From ceb652655101d0c7167d6bb9c662a7ae4aa8dbd8 Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Mon, 4 Oct 2021 12:28:32 +0200 Subject: [PATCH] Built motion from commit 9a9fea8c.|2.5.35 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1151 files changed, 1151 insertions(+), 1151 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2e5ceee..e472eb8 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-04T10:02:00.575Z", + "time": "2021-10-04T10:16:04.457Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 40ff06e..b37deb4 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-04T10:02:00.575Z", + "time": "2021-10-04T10:16:04.457Z", "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 1aea757..0dd3278 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 _0xef30=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x346790,_0x432400){var _0xa3f648=function(_0x3c24d4){while(--_0x3c24d4){_0x346790['push'](_0x346790['shift']());}};_0xa3f648(++_0x432400);}(_0xef30,0x118));var _0x0ef3=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xef30[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0x0ef3('0x0'));module[_0x0ef3('0x1')]={'name':{'type':Sequelize[_0x0ef3('0x2')],'get':function(_0x3924cd){return this[_0x0ef3('0x3')]('action');}},'action':{'type':Sequelize[_0x0ef3('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0ef3('0x5'),_0x0ef3('0x6'),_0x0ef3('0x7'),_0x0ef3('0x8'),_0x0ef3('0x9'),_0x0ef3('0xa'),_0x0ef3('0xb'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x0ef3('0xc')},'data1':{'type':Sequelize[_0x0ef3('0x4')](0x1000),'comment':_0x0ef3('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0ef3('0xe')},'data3':{'type':Sequelize[_0x0ef3('0x4')](0x1000),'comment':_0x0ef3('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0ef3('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0ef3('0x11')},'data6':{'type':Sequelize[_0x0ef3('0x4')],'comments':_0x0ef3('0x12')},'data7':{'type':Sequelize[_0x0ef3('0x13')],'comments':_0x0ef3('0x14')}}; \ No newline at end of file +var _0x1da4=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0xeb74f,_0x16c8b5){var _0x3ab646=function(_0x2ebcd5){while(--_0x2ebcd5){_0xeb74f['push'](_0xeb74f['shift']());}};_0x3ab646(++_0x16c8b5);}(_0x1da4,0xd8));var _0x41da=function(_0x26709c,_0x5b9ace){_0x26709c=_0x26709c-0x0;var _0x5c7e51=_0x1da4[_0x26709c];return _0x5c7e51;};'use strict';var Sequelize=require(_0x41da('0x0'));module[_0x41da('0x1')]={'name':{'type':Sequelize[_0x41da('0x2')],'get':function(_0x2dc686){return this[_0x41da('0x3')]('action');}},'action':{'type':Sequelize[_0x41da('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x41da('0x5'),_0x41da('0x6'),_0x41da('0x7'),_0x41da('0x8'),_0x41da('0x9'),_0x41da('0xa'),_0x41da('0xb'),_0x41da('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x41da('0xd')},'data1':{'type':Sequelize[_0x41da('0x4')](0x1000),'comment':_0x41da('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x41da('0xf')},'data3':{'type':Sequelize[_0x41da('0x4')](0x1000),'comment':_0x41da('0x10')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x41da('0x4')](0x1000),'comments':_0x41da('0x11')},'data6':{'type':Sequelize[_0x41da('0x4')],'comments':_0x41da('0x12')},'data7':{'type':Sequelize[_0x41da('0x13')],'comments':_0x41da('0x14')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d396b9c..c7e689c 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 _0x59bc=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','send','find','params','catch','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x2f52c0,_0x15a9cb){var _0x378a40=function(_0x3a9d2d){while(--_0x3a9d2d){_0x2f52c0['push'](_0x2f52c0['shift']());}};_0x378a40(++_0x15a9cb);}(_0x59bc,0x15a));var _0xc59b=function(_0x1b7b17,_0x4da230){_0x1b7b17=_0x1b7b17-0x0;var _0x1afb97=_0x59bc[_0x1b7b17];return _0x1afb97;};'use strict';var emlformat=require(_0xc59b('0x0'));var rimraf=require(_0xc59b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc59b('0x2'));var rp=require(_0xc59b('0x3'));var moment=require(_0xc59b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc59b('0x5'));var util=require('util');var path=require(_0xc59b('0x6'));var sox=require(_0xc59b('0x7'));var csv=require('to-csv');var ejs=require(_0xc59b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc59b('0x9'));var squel=require(_0xc59b('0xa'));var crypto=require('crypto');var jsforce=require(_0xc59b('0xb'));var deskjs=require(_0xc59b('0xc'));var toCsv=require(_0xc59b('0xd'));var querystring=require(_0xc59b('0xe'));var Papa=require(_0xc59b('0xf'));var Redis=require('ioredis');var authService=require(_0xc59b('0x10'));var qs=require(_0xc59b('0x11'));var as=require(_0xc59b('0x12'));var hardwareService=require(_0xc59b('0x13'));var logger=require(_0xc59b('0x14'))(_0xc59b('0x15'));var utils=require(_0xc59b('0x16'));var config=require(_0xc59b('0x17'));var licenseUtil=require(_0xc59b('0x18'));var db=require(_0xc59b('0x19'))['db'];function respondWithStatusCode(_0x38aa10,_0xd45ee3){_0xd45ee3=_0xd45ee3||0xcc;return function(_0x3a28a4){if(_0x3a28a4){return _0x38aa10['sendStatus'](_0xd45ee3);}return _0x38aa10['status'](_0xd45ee3)['end']();};}function respondWithResult(_0x15f758,_0x25c53f){_0x25c53f=_0x25c53f||0xc8;return function(_0x1da842){if(_0x1da842){return _0x15f758[_0xc59b('0x1a')](_0x25c53f)[_0xc59b('0x1b')](_0x1da842);}};}function respondWithFilteredResult(_0x400c3d,_0xc7fd3d){return function(_0x46511d){if(_0x46511d){var _0x5518b2=typeof _0xc7fd3d['offset']===_0xc59b('0x1c')&&typeof _0xc7fd3d['limit']===_0xc59b('0x1c');var _0x1ffb2b=_0x46511d[_0xc59b('0x1d')];var _0x493f09=_0x5518b2?0x0:_0xc7fd3d[_0xc59b('0x1e')];var _0x4ba1f1=_0x5518b2?_0x46511d['count']:_0xc7fd3d[_0xc59b('0x1e')]+_0xc7fd3d[_0xc59b('0x1f')];var _0x3ca068;if(_0x4ba1f1>=_0x1ffb2b){_0x4ba1f1=_0x1ffb2b;_0x3ca068=0xc8;}else{_0x3ca068=0xce;}_0x400c3d[_0xc59b('0x1a')](_0x3ca068);return _0x400c3d['set'](_0xc59b('0x20'),_0x493f09+'-'+_0x4ba1f1+'/'+_0x1ffb2b)[_0xc59b('0x1b')](_0x46511d);}return null;};}function patchUpdates(_0x13291f){return function(_0x4877e5){try{jsonpatch[_0xc59b('0x21')](_0x4877e5,_0x13291f,!![]);}catch(_0x16bd80){return BPromise[_0xc59b('0x22')](_0x16bd80);}return _0x4877e5[_0xc59b('0x23')]();};}function saveUpdates(_0x347329,_0x141ecc){return function(_0x449ad3){if(_0x449ad3){return _0x449ad3[_0xc59b('0x24')](_0x347329)[_0xc59b('0x25')](function(_0x370263){return _0x370263;});}return null;};}function removeEntity(_0x1e71f0,_0x1aee97){return function(_0x470ec1){if(_0x470ec1){return _0x470ec1['destroy']()[_0xc59b('0x25')](function(){_0x1e71f0[_0xc59b('0x1a')](0xcc)[_0xc59b('0x26')]();});}};}function handleEntityNotFound(_0x9e6c57,_0x36f49a){return function(_0x5c6359){if(!_0x5c6359){_0x9e6c57['sendStatus'](0x194);}return _0x5c6359;};}function handleError(_0x5cfd47,_0x4bcf28){_0x4bcf28=_0x4bcf28||0x1f4;return function(_0x2805a4){logger['error'](_0x2805a4[_0xc59b('0x27')]);if(_0x2805a4['name']){delete _0x2805a4['name'];}_0x5cfd47[_0xc59b('0x1a')](_0x4bcf28)[_0xc59b('0x28')](_0x2805a4);};}exports[_0xc59b('0x24')]=function(_0x39e31c,_0x35daa5){if(_0x39e31c['body']['id']){delete _0x39e31c['body']['id'];}return db['Action'][_0xc59b('0x29')]({'where':{'id':_0x39e31c[_0xc59b('0x2a')]['id']}})[_0xc59b('0x25')](handleEntityNotFound(_0x35daa5,null))['then'](saveUpdates(_0x39e31c['body'],null))[_0xc59b('0x25')](respondWithResult(_0x35daa5,null))[_0xc59b('0x2b')](handleError(_0x35daa5,null));};exports['destroy']=function(_0x5cee57,_0x488cd5){return db[_0xc59b('0x2c')][_0xc59b('0x29')]({'where':{'id':_0x5cee57[_0xc59b('0x2a')]['id']}})[_0xc59b('0x25')](handleEntityNotFound(_0x488cd5,null))['then'](removeEntity(_0x488cd5,null))[_0xc59b('0x2b')](handleError(_0x488cd5,null));}; \ No newline at end of file +var _0x3378=['then','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3378,0xca));var _0x8337=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0x3378[_0x1b4c04];return _0x374f5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8337('0x0'));var zipdir=require(_0x8337('0x1'));var jsonpatch=require(_0x8337('0x2'));var rp=require(_0x8337('0x3'));var moment=require(_0x8337('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8337('0x5'));var util=require(_0x8337('0x6'));var path=require(_0x8337('0x7'));var sox=require(_0x8337('0x8'));var csv=require(_0x8337('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8337('0xa'));var _=require(_0x8337('0xb'));var squel=require('squel');var crypto=require(_0x8337('0xc'));var jsforce=require(_0x8337('0xd'));var deskjs=require(_0x8337('0xe'));var toCsv=require(_0x8337('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8337('0xf'));var authService=require(_0x8337('0x10'));var qs=require(_0x8337('0x11'));var as=require(_0x8337('0x12'));var hardwareService=require(_0x8337('0x13'));var logger=require(_0x8337('0x14'))(_0x8337('0x15'));var utils=require(_0x8337('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8337('0x17'))['db'];function respondWithStatusCode(_0xb33423,_0x598bf5){_0x598bf5=_0x598bf5||0xcc;return function(_0x2ca27f){if(_0x2ca27f){return _0xb33423[_0x8337('0x18')](_0x598bf5);}return _0xb33423[_0x8337('0x19')](_0x598bf5)[_0x8337('0x1a')]();};}function respondWithResult(_0x2bec1c,_0x24ff85){_0x24ff85=_0x24ff85||0xc8;return function(_0xa3d98a){if(_0xa3d98a){return _0x2bec1c[_0x8337('0x19')](_0x24ff85)[_0x8337('0x1b')](_0xa3d98a);}};}function respondWithFilteredResult(_0x37a55e,_0x38b0e5){return function(_0x42650a){if(_0x42650a){var _0x331a00=typeof _0x38b0e5[_0x8337('0x1c')]===_0x8337('0x1d')&&typeof _0x38b0e5[_0x8337('0x1e')]===_0x8337('0x1d');var _0x42293e=_0x42650a[_0x8337('0x1f')];var _0x105f61=_0x331a00?0x0:_0x38b0e5['offset'];var _0x4b8ca4=_0x331a00?_0x42650a[_0x8337('0x1f')]:_0x38b0e5[_0x8337('0x1c')]+_0x38b0e5['limit'];var _0x467738;if(_0x4b8ca4>=_0x42293e){_0x4b8ca4=_0x42293e;_0x467738=0xc8;}else{_0x467738=0xce;}_0x37a55e[_0x8337('0x19')](_0x467738);return _0x37a55e['set'](_0x8337('0x20'),_0x105f61+'-'+_0x4b8ca4+'/'+_0x42293e)[_0x8337('0x1b')](_0x42650a);}return null;};}function patchUpdates(_0x4a625b){return function(_0x3f7a5c){try{jsonpatch[_0x8337('0x21')](_0x3f7a5c,_0x4a625b,!![]);}catch(_0x26bd3d){return BPromise[_0x8337('0x22')](_0x26bd3d);}return _0x3f7a5c[_0x8337('0x23')]();};}function saveUpdates(_0x39eccb,_0x21a923){return function(_0xcd98ba){if(_0xcd98ba){return _0xcd98ba[_0x8337('0x24')](_0x39eccb)['then'](function(_0x205030){return _0x205030;});}return null;};}function removeEntity(_0x5e2b82,_0x1ac2d8){return function(_0x507a6c){if(_0x507a6c){return _0x507a6c[_0x8337('0x25')]()[_0x8337('0x26')](function(){_0x5e2b82[_0x8337('0x19')](0xcc)[_0x8337('0x1a')]();});}};}function handleEntityNotFound(_0x242554,_0xa31f34){return function(_0x4ea5a2){if(!_0x4ea5a2){_0x242554[_0x8337('0x18')](0x194);}return _0x4ea5a2;};}function handleError(_0x38455a,_0x2d15b7){_0x2d15b7=_0x2d15b7||0x1f4;return function(_0x227ad9){logger[_0x8337('0x27')](_0x227ad9[_0x8337('0x28')]);if(_0x227ad9[_0x8337('0x29')]){delete _0x227ad9['name'];}_0x38455a[_0x8337('0x19')](_0x2d15b7)[_0x8337('0x2a')](_0x227ad9);};}exports['update']=function(_0xeb28c3,_0x4c890e){if(_0xeb28c3[_0x8337('0x2b')]['id']){delete _0xeb28c3[_0x8337('0x2b')]['id'];}return db[_0x8337('0x2c')][_0x8337('0x2d')]({'where':{'id':_0xeb28c3[_0x8337('0x2e')]['id']}})[_0x8337('0x26')](handleEntityNotFound(_0x4c890e,null))[_0x8337('0x26')](saveUpdates(_0xeb28c3[_0x8337('0x2b')],null))[_0x8337('0x26')](respondWithResult(_0x4c890e,null))[_0x8337('0x2f')](handleError(_0x4c890e,null));};exports[_0x8337('0x25')]=function(_0x5185af,_0x302589){return db['Action'][_0x8337('0x2d')]({'where':{'id':_0x5185af[_0x8337('0x2e')]['id']}})[_0x8337('0x26')](handleEntityNotFound(_0x302589,null))[_0x8337('0x26')](removeEntity(_0x302589,null))['catch'](handleError(_0x302589,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6b998a7..dfbde9d 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 _0x096b=['path','../../config/environment','./action.attributes','exports','define','tools_actions','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f00f9,_0xe140fb){var _0x3161e2=function(_0x4e7acd){while(--_0x4e7acd){_0x3f00f9['push'](_0x3f00f9['shift']());}};_0x3161e2(++_0xe140fb);}(_0x096b,0x1df));var _0xb096=function(_0x5f3734,_0x10f54f){_0x5f3734=_0x5f3734-0x0;var _0x4c07bc=_0x096b[_0x5f3734];return _0x4c07bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb096('0x0'))(_0xb096('0x1'));var moment=require(_0xb096('0x2'));var BPromise=require(_0xb096('0x3'));var rp=require(_0xb096('0x4'));var fs=require('fs');var path=require(_0xb096('0x5'));var rimraf=require('rimraf');var config=require(_0xb096('0x6'));var attributes=require(_0xb096('0x7'));module[_0xb096('0x8')]=function(_0x18aa4c,_0x2de10b){return _0x18aa4c[_0xb096('0x9')]('Action',attributes,{'tableName':_0xb096('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x137b=['exports','define','Action','tools_actions','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x416c91,_0x2fa7f5){var _0x192761=function(_0x547f50){while(--_0x547f50){_0x416c91['push'](_0x416c91['shift']());}};_0x192761(++_0x2fa7f5);}(_0x137b,0xac));var _0xb137=function(_0x4a1353,_0x2fbe86){_0x4a1353=_0x4a1353-0x0;var _0x3805cc=_0x137b[_0x4a1353];return _0x3805cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb137('0x0'))(_0xb137('0x1'));var moment=require(_0xb137('0x2'));var BPromise=require(_0xb137('0x3'));var rp=require(_0xb137('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb137('0x5'));var config=require(_0xb137('0x6'));var attributes=require(_0xb137('0x7'));module[_0xb137('0x8')]=function(_0x4d7a70,_0x4755da){return _0x4d7a70[_0xb137('0x9')](_0xb137('0xa'),attributes,{'tableName':_0xb137('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index d506a37..5e1bff4 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30014e,_0x555f27){var _0x1e3be1=function(_0x36b923){while(--_0x36b923){_0x30014e['push'](_0x30014e['shift']());}};_0x1e3be1(++_0x555f27);}(_0x5fab,0x177));var _0xb5fa=function(_0x2b72ef,_0x574981){_0x2b72ef=_0x2b72ef-0x0;var _0x56a161=_0x5fab[_0x2b72ef];return _0x56a161;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5a4de8,_0x10ab46){var _0x52733d=function(_0x366d6c){while(--_0x366d6c){_0x5a4de8['push'](_0x5a4de8['shift']());}};_0x52733d(++_0x10ab46);}(_0xe14b,0x93));var _0xbe14=function(_0x1fde40,_0x2c75dc){_0x1fde40=_0x1fde40-0x0;var _0x4abfbc=_0xe14b[_0x1fde40];return _0x4abfbc;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index c4a8516..9530e3c 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 _0x4700=['/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x2fcdf5,_0x36ef43){var _0xe475f=function(_0xc2ea80){while(--_0xc2ea80){_0x2fcdf5['push'](_0x2fcdf5['shift']());}};_0xe475f(++_0x36ef43);}(_0x4700,0x17d));var _0x0470=function(_0x524305,_0x17929f){_0x524305=_0x524305-0x0;var _0x3b9e3f=_0x4700[_0x524305];return _0x3b9e3f;};'use strict';var multer=require(_0x0470('0x0'));var util=require('util');var path=require(_0x0470('0x1'));var timeout=require(_0x0470('0x2'));var express=require(_0x0470('0x3'));var router=express[_0x0470('0x4')]();var fs_extra=require(_0x0470('0x5'));var auth=require(_0x0470('0x6'));var interaction=require(_0x0470('0x7'));var config=require('../../config/environment');var controller=require(_0x0470('0x8'));router['put'](_0x0470('0x9'),auth['isAuthenticated'](),controller[_0x0470('0xa')]);router[_0x0470('0xb')](_0x0470('0x9'),auth['isAuthenticated'](),controller[_0x0470('0xc')]);module['exports']=router; \ No newline at end of file +var _0xa55a=['isAuthenticated','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0xa55a,0x6a));var _0xaa55=function(_0x58762c,_0x23f5b3){_0x58762c=_0x58762c-0x0;var _0x1fd080=_0xa55a[_0x58762c];return _0x1fd080;};'use strict';var multer=require(_0xaa55('0x0'));var util=require('util');var path=require(_0xaa55('0x1'));var timeout=require(_0xaa55('0x2'));var express=require(_0xaa55('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaa55('0x4'));var interaction=require(_0xaa55('0x5'));var config=require(_0xaa55('0x6'));var controller=require('./action.controller');router[_0xaa55('0x7')](_0xaa55('0x8'),auth['isAuthenticated'](),controller[_0xaa55('0x9')]);router[_0xaa55('0xa')](_0xaa55('0x8'),auth[_0xaa55('0xb')](),controller[_0xaa55('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 3798a96..1c45615 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 _0xbd51=['sequelize','STRING'];(function(_0x405f28,_0x3ea99f){var _0x1a6075=function(_0x1d8d30){while(--_0x1d8d30){_0x405f28['push'](_0x405f28['shift']());}};_0x1a6075(++_0x3ea99f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x301df8,_0x507b76){_0x301df8=_0x301df8-0x0;var _0x58fcb9=_0xbd51[_0x301df8];return _0x58fcb9;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x038b=['exports','STRING','TEXT'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x038b,0x114));var _0xb038=function(_0x2b51da,_0x1ae9e9){_0x2b51da=_0x2b51da-0x0;var _0x11b95b=_0x038b[_0x2b51da];return _0x11b95b;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2f1a0e7..f7710f0 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 _0x6343=['foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','right_join','SUM(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NOT\x20NULL','value','Sequelize','function','output','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','send','index','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','findAll','rows','catch','show','params','keys','AnalyticCustomReport','rawAttributes','includeAll','include','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parse'];(function(_0x48d059,_0x1841b3){var _0x3450db=function(_0x3ffe10){while(--_0x3ffe10){_0x48d059['push'](_0x48d059['shift']());}};_0x3450db(++_0x1841b3);}(_0x6343,0x168));var _0x3634=function(_0x3a060c,_0x1fb019){_0x3a060c=_0x3a060c-0x0;var _0x24fee=_0x6343[_0x3a060c];return _0x24fee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];var dbH=require(_0x3634('0x12'))[_0x3634('0x13')];function respondWithStatusCode(_0x35ae07,_0x501eba){_0x501eba=_0x501eba||0xcc;return function(_0x7f5aca){if(_0x7f5aca){return _0x35ae07[_0x3634('0x14')](_0x501eba);}return _0x35ae07[_0x3634('0x15')](_0x501eba)[_0x3634('0x16')]();};}function respondWithResult(_0x7e4801,_0x2ad793){_0x2ad793=_0x2ad793||0xc8;return function(_0x5a5063){if(_0x5a5063){return _0x7e4801[_0x3634('0x15')](_0x2ad793)['json'](_0x5a5063);}};}function respondWithFilteredResult(_0x69609d,_0x18285c){return function(_0x2fc628){if(_0x2fc628){var _0x78f93f=typeof _0x18285c[_0x3634('0x17')]==='undefined'&&typeof _0x18285c[_0x3634('0x18')]==='undefined';var _0x50350d=_0x2fc628[_0x3634('0x19')];var _0x4b2115=_0x78f93f?0x0:_0x18285c[_0x3634('0x17')];var _0x32e3c6=_0x78f93f?_0x2fc628[_0x3634('0x19')]:_0x18285c['offset']+_0x18285c[_0x3634('0x18')];var _0x4366bc;if(_0x32e3c6>=_0x50350d){_0x32e3c6=_0x50350d;_0x4366bc=0xc8;}else{_0x4366bc=0xce;}_0x69609d['status'](_0x4366bc);return _0x69609d[_0x3634('0x1a')]('Content-Range',_0x4b2115+'-'+_0x32e3c6+'/'+_0x50350d)[_0x3634('0x1b')](_0x2fc628);}return null;};}function patchUpdates(_0x2fa200){return function(_0x5b77a7){try{jsonpatch[_0x3634('0x1c')](_0x5b77a7,_0x2fa200,!![]);}catch(_0x3df472){return BPromise[_0x3634('0x1d')](_0x3df472);}return _0x5b77a7['save']();};}function saveUpdates(_0x22b7ef,_0x2c8874){return function(_0x52652d){if(_0x52652d){return _0x52652d[_0x3634('0x1e')](_0x22b7ef)['then'](function(_0x5e9188){return _0x5e9188;});}return null;};}function removeEntity(_0x3a8c41,_0x862ab5){return function(_0x5df6fb){if(_0x5df6fb){return _0x5df6fb[_0x3634('0x1f')]()[_0x3634('0x20')](function(){var _0x17db44=_0x5df6fb[_0x3634('0x21')]({'plain':!![]});var _0x363ca2=_0x3634('0x22');return db[_0x3634('0x23')][_0x3634('0x1f')]({'where':{'type':_0x363ca2,'resourceId':_0x17db44['id']}})[_0x3634('0x20')](function(){return _0x5df6fb;});})['then'](function(){_0x3a8c41[_0x3634('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58841d,_0x59f481){return function(_0x7a35c4){if(!_0x7a35c4){_0x58841d['sendStatus'](0x194);}return _0x7a35c4;};}function handleError(_0x3bf28b,_0x12b80e){_0x12b80e=_0x12b80e||0x1f4;return function(_0x49804f){logger['error'](_0x49804f[_0x3634('0x24')]);if(_0x49804f['name']){delete _0x49804f[_0x3634('0x25')];}_0x3bf28b['status'](_0x12b80e)[_0x3634('0x26')](_0x49804f);};}exports[_0x3634('0x27')]=function(_0x1d88f7,_0x17a0fd){var _0x1f46d9={},_0x20b062={},_0x309d53={'count':0x0,'rows':[]};var _0xe1a964=_['map'](db['AnalyticCustomReport']['rawAttributes'],function(_0x3ebdbf){return{'name':_0x3ebdbf['fieldName'],'type':_0x3ebdbf[_0x3634('0x28')][_0x3634('0x29')]};});_0x20b062[_0x3634('0x2a')]=_[_0x3634('0x2b')](_0xe1a964,_0x3634('0x25'));_0x20b062[_0x3634('0x2c')]=_['keys'](_0x1d88f7[_0x3634('0x2c')]);_0x20b062[_0x3634('0x2d')]=_[_0x3634('0x2e')](_0x20b062[_0x3634('0x2a')],_0x20b062[_0x3634('0x2c')]);_0x1f46d9[_0x3634('0x2f')]=_[_0x3634('0x2e')](_0x20b062[_0x3634('0x2a')],qs[_0x3634('0x30')](_0x1d88f7['query'][_0x3634('0x30')]));_0x1f46d9[_0x3634('0x2f')]=_0x1f46d9[_0x3634('0x2f')][_0x3634('0x31')]?_0x1f46d9['attributes']:_0x20b062[_0x3634('0x2a')];if(!_0x1d88f7[_0x3634('0x2c')][_0x3634('0x32')]('nolimit')){_0x1f46d9['limit']=qs['limit'](_0x1d88f7[_0x3634('0x2c')][_0x3634('0x18')]);_0x1f46d9['offset']=qs[_0x3634('0x17')](_0x1d88f7[_0x3634('0x2c')][_0x3634('0x17')]);}_0x1f46d9[_0x3634('0x33')]=qs[_0x3634('0x34')](_0x1d88f7[_0x3634('0x2c')][_0x3634('0x34')]);_0x1f46d9['where']=qs[_0x3634('0x2d')](_['pick'](_0x1d88f7[_0x3634('0x2c')],_0x20b062[_0x3634('0x2d')]),_0xe1a964);if(_0x1d88f7[_0x3634('0x2c')][_0x3634('0x35')]){_0x1f46d9[_0x3634('0x36')]=_['merge'](_0x1f46d9[_0x3634('0x36')],{'$or':_[_0x3634('0x2b')](_0xe1a964,function(_0x32d112){if(_0x32d112[_0x3634('0x28')]!==_0x3634('0x37')){var _0x17714e={};_0x17714e[_0x32d112[_0x3634('0x25')]]={'$like':'%'+_0x1d88f7[_0x3634('0x2c')][_0x3634('0x35')]+'%'};return _0x17714e;}})});}_0x1f46d9=_['merge']({},_0x1f46d9,_0x1d88f7['options']);var _0x14586d={'where':_0x1f46d9['where']};return db['AnalyticCustomReport']['count'](_0x14586d)[_0x3634('0x20')](function(_0x4d06f9){_0x309d53[_0x3634('0x19')]=_0x4d06f9;if(_0x1d88f7[_0x3634('0x2c')]['includeAll']){_0x1f46d9['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3634('0x38')](_0x1f46d9);})[_0x3634('0x20')](function(_0x5b1dad){_0x309d53[_0x3634('0x39')]=_0x5b1dad;return _0x309d53;})[_0x3634('0x20')](respondWithFilteredResult(_0x17a0fd,_0x1f46d9))[_0x3634('0x3a')](handleError(_0x17a0fd,null));};exports[_0x3634('0x3b')]=function(_0x123a91,_0x5f0711){var _0x497278={'raw':![],'where':{'id':_0x123a91[_0x3634('0x3c')]['id']}},_0x29acea={};_0x29acea[_0x3634('0x2a')]=_[_0x3634('0x3d')](db[_0x3634('0x3e')][_0x3634('0x3f')]);_0x29acea['query']=_[_0x3634('0x3d')](_0x123a91[_0x3634('0x2c')]);_0x29acea[_0x3634('0x2d')]=_['intersection'](_0x29acea['model'],_0x29acea[_0x3634('0x2c')]);_0x497278[_0x3634('0x2f')]=_[_0x3634('0x2e')](_0x29acea[_0x3634('0x2a')],qs[_0x3634('0x30')](_0x123a91[_0x3634('0x2c')][_0x3634('0x30')]));_0x497278[_0x3634('0x2f')]=_0x497278['attributes'][_0x3634('0x31')]?_0x497278[_0x3634('0x2f')]:_0x29acea[_0x3634('0x2a')];if(_0x123a91[_0x3634('0x2c')][_0x3634('0x40')]){_0x497278[_0x3634('0x41')]=[{'all':!![]}];}_0x497278=_[_0x3634('0x42')]({},_0x497278,_0x123a91[_0x3634('0x43')]);return db[_0x3634('0x3e')]['find'](_0x497278)[_0x3634('0x20')](handleEntityNotFound(_0x5f0711,null))[_0x3634('0x20')](respondWithResult(_0x5f0711,null))['catch'](handleError(_0x5f0711,null));};exports[_0x3634('0x44')]=function(_0x454012,_0x254c83){return db[_0x3634('0x3e')][_0x3634('0x44')](_0x454012[_0x3634('0x45')],{})['then'](function(_0x2663a2){var _0x2356a9=_0x454012[_0x3634('0x46')][_0x3634('0x21')]({'plain':!![]});if(!_0x2356a9)throw new Error(_0x3634('0x47'));if(_0x2356a9['role']===_0x3634('0x46')){var _0x20f9f8=_0x2663a2['get']({'plain':!![]});var _0x52b79b=_0x3634('0x48');return db['UserProfileSection'][_0x3634('0x49')]({'where':{'name':_0x52b79b,'userProfileId':_0x2356a9[_0x3634('0x4a')]},'raw':!![]})[_0x3634('0x20')](function(_0x1834a3){if(_0x1834a3&&_0x1834a3['autoAssociation']===0x0){return db[_0x3634('0x23')][_0x3634('0x44')]({'name':_0x20f9f8[_0x3634('0x25')],'resourceId':_0x20f9f8['id'],'type':_0x3634('0x22'),'sectionId':_0x1834a3['id']},{})[_0x3634('0x20')](function(){return _0x2663a2;});}else{return _0x2663a2;}})[_0x3634('0x3a')](function(_0xe3b65){logger[_0x3634('0x4b')](_0x3634('0x4c'),_0xe3b65);throw _0xe3b65;});}return _0x2663a2;})[_0x3634('0x20')](respondWithResult(_0x254c83,0xc9))[_0x3634('0x3a')](handleError(_0x254c83,null));};exports[_0x3634('0x1e')]=function(_0x557438,_0x32b48c){if(_0x557438[_0x3634('0x45')]['id']){delete _0x557438[_0x3634('0x45')]['id'];}return db[_0x3634('0x3e')][_0x3634('0x49')]({'where':{'id':_0x557438[_0x3634('0x3c')]['id']}})[_0x3634('0x20')](handleEntityNotFound(_0x32b48c,null))[_0x3634('0x20')](saveUpdates(_0x557438[_0x3634('0x45')],null))['then'](respondWithResult(_0x32b48c,null))[_0x3634('0x3a')](handleError(_0x32b48c,null));};exports[_0x3634('0x1f')]=function(_0x48d641,_0x31165c){return db[_0x3634('0x3e')]['find']({'where':{'id':_0x48d641[_0x3634('0x3c')]['id']}})[_0x3634('0x20')](handleEntityNotFound(_0x31165c,null))[_0x3634('0x20')](removeEntity(_0x31165c,null))['catch'](handleError(_0x31165c,null));};exports[_0x3634('0x4d')]=function(_0x53da29,_0x1ab731){var _0x51f2f8=0xa;var _0x960c9a=[_0x3634('0x4e'),_0x3634('0x4f'),'right_join',_0x3634('0x50')];var _0x2b72cd={'SUM':'SUM(%s)','COUNT':_0x3634('0x51'),'COUNT DISTINCT':_0x3634('0x52'),'MAX':_0x3634('0x53'),'MIN':_0x3634('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3634('0x55'),'GROUP_CONCAT ASC':_0x3634('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5b8db4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3634('0x57'),'HOUR':'HOUR(%s)','ROUND':_0x3634('0x58'),'UNIX_TIMESTAMP':_0x3634('0x59')};var _0x185b18=function(_0x5e29a2){return!_[_0x3634('0x5a')]([_0x3634('0x5b'),'IS\x20NOT\x20NULL',_0x3634('0x5c'),_0x3634('0x5d')],_0x5e29a2);};var _0x27e00b=function(_0x5a9808){if(!_0x5a9808||!_0x5a9808[_0x3634('0x5e')][_0x3634('0x31')]){return'';}for(var _0x897c0e='(',_0xb7dd01=0x0;_0xb7dd01<_0x5a9808[_0x3634('0x5e')]['length'];_0xb7dd01+=0x1){_0xb7dd01>0x0&&(_0x897c0e+='\x20'+_0x5a9808[_0x3634('0x5f')]+'\x20');_0x897c0e+=_0x5a9808[_0x3634('0x5e')][_0xb7dd01][_0x3634('0x60')]?_0x27e00b(_0x5a9808['rules'][_0xb7dd01][_0x3634('0x60')]):_0x5a9808['rules'][_0xb7dd01][_0x3634('0x61')]+'\x20'+_0x5a9808[_0x3634('0x5e')][_0xb7dd01]['condition']+(_0x185b18(_0x5a9808[_0x3634('0x5e')][_0xb7dd01][_0x3634('0x62')])?'\x20'+_0x5a9808[_0x3634('0x5e')][_0xb7dd01]['value']:'');}return _0x897c0e+')';};var _0x44b9c1={'where':{'id':_0x53da29[_0x3634('0x3c')]['id']}},_0x4b724c,_0x4b81ec,_0x1cea1b,_0x58cd2e,_0x30fd12;_0x44b9c1=_[_0x3634('0x42')]({},_0x44b9c1,_0x53da29[_0x3634('0x43')]);return db['AnalyticCustomReport'][_0x3634('0x49')](_0x44b9c1)[_0x3634('0x20')](function(_0x49a72f){if(_0x49a72f){_0x4b724c=_0x49a72f;return _0x49a72f[_0x3634('0x63')]();}return null;})['then'](function(_0xf9a13){if(_0xf9a13){if(!_0xf9a13['length']){throw new db['Sequelize'][(_0x3634('0x64'))](_0x3634('0x65'),0x193);}_0x4b81ec=_0xf9a13;return db[_0x3634('0x66')][_0x3634('0x38')]({'raw':!![]});}return null;})[_0x3634('0x20')](function(_0x49e63d){if(_0x49e63d){_0x1cea1b=_[_0x3634('0x67')](_0x49e63d,'id');var _0x14d4b8;var _0x2e7b1d=squel[_0x3634('0x68')]();_0x2e7b1d[_0x3634('0x69')](_0x4b724c[_0x3634('0x6a')]);for(var _0x23f153=0x0;_0x23f153<_0x4b81ec[_0x3634('0x31')];_0x23f153+=0x1){_0x14d4b8=_0x4b81ec[_0x23f153][_0x3634('0x6b')]?_0x1cea1b[_0x4b81ec[_0x23f153][_0x3634('0x6b')]][_0x3634('0x6c')]:_0x4b81ec[_0x23f153]['field'];_0x14d4b8=_0x4b81ec[_0x23f153]['function']?_[_0x3634('0x6d')](_0x2b72cd[_0x4b81ec[_0x23f153]['function']],'%s',_0x14d4b8):_0x14d4b8;_0x14d4b8=_0x4b81ec[_0x23f153][_0x3634('0x6e')]?_[_0x3634('0x6d')](_0x5b8db4[_0x4b81ec[_0x23f153][_0x3634('0x6e')]],'%s',_0x14d4b8):_0x14d4b8;if(_0x4b81ec[_0x23f153][_0x3634('0x6f')]){_0x2e7b1d[_0x3634('0x60')](_0x14d4b8);}_0x4b81ec[_0x23f153]['orderBy']&&_0x2e7b1d[_0x3634('0x33')](_0x14d4b8,_0x4b81ec[_0x23f153][_0x3634('0x70')]===_0x3634('0x71')?![]:!![]);_0x2e7b1d[_0x3634('0x61')](_0x14d4b8,_0x4b81ec[_0x23f153][_0x3634('0x72')]||_0x14d4b8);}if(_0x4b724c['joins']){_0x4b724c[_0x3634('0x73')]=JSON[_0x3634('0x74')](_0x4b724c[_0x3634('0x73')]);for(var _0x363d8b=0x0;_0x363d8b<_0x4b724c['joins']['length'];_0x363d8b+=0x1){if(_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x28')]&&_[_0x3634('0x5a')](_0x960c9a,_0x4b724c[_0x3634('0x73')][_0x363d8b]['type'])&&_0x4b724c[_0x3634('0x73')][_0x363d8b]['parentKey']&&_0x4b724c[_0x3634('0x73')][_0x363d8b]['foreignTable']&&_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x75')]){_0x2e7b1d[_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x28')]](_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x76')],null,util['format'](_0x3634('0x77'),_0x4b724c['table'],_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x78')],_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x76')],_0x4b724c[_0x3634('0x73')][_0x363d8b][_0x3634('0x75')]));}}}if(_0x4b724c[_0x3634('0x79')]){_0x4b724c[_0x3634('0x79')]=JSON[_0x3634('0x74')](_0x4b724c['conditions']);_0x2e7b1d[_0x3634('0x36')](_0x27e00b(_0x4b724c[_0x3634('0x79')][_0x3634('0x60')]));}_0x30fd12=_0x2e7b1d[_0x3634('0x7a')]();_0x2e7b1d[_0x3634('0x18')](_0x51f2f8);_0x2e7b1d[_0x3634('0x17')](0x0);logger[_0x3634('0x7b')](_0x3634('0x7c'),_0x2e7b1d[_0x3634('0x7d')]());return dbH[_0x3634('0x7e')]['query'](_0x2e7b1d[_0x3634('0x7d')](),{'type':dbH[_0x3634('0x7e')]['QueryTypes']['SELECT']});}})[_0x3634('0x20')](respondWithResult(_0x1ab731,null))[_0x3634('0x3a')](handleError(_0x1ab731,null));};function runReport(_0x32373b,_0x30f7ca,_0x47e9f8){var _0x448db1=_0x30f7ca[_0x3634('0x25')];var _0x5bacd9=0xa;var _0x45f090=[_0x3634('0x4e'),'left_join',_0x3634('0x7f'),_0x3634('0x50')];var _0x4e167a={'SUM':_0x3634('0x80'),'COUNT':_0x3634('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3634('0x53'),'MIN':_0x3634('0x54'),'AVG':_0x3634('0x81'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3018cd={'SEC_TO_TIME':_0x3634('0x82'),'DATE':_0x3634('0x57'),'HOUR':_0x3634('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x7ba69b=function(_0x11f24e){return!_[_0x3634('0x5a')]([_0x3634('0x5b'),_0x3634('0x84'),_0x3634('0x5c'),_0x3634('0x5d')],_0x11f24e);};var _0x4ccc03=function(_0x5ef909){if(!_0x5ef909||!_0x5ef909[_0x3634('0x5e')][_0x3634('0x31')]){return'';}for(var _0x182a13='(',_0x52d5a6=0x0;_0x52d5a6<_0x5ef909[_0x3634('0x5e')][_0x3634('0x31')];_0x52d5a6+=0x1){_0x52d5a6>0x0&&(_0x182a13+='\x20'+_0x5ef909[_0x3634('0x5f')]+'\x20');_0x182a13+=_0x5ef909['rules'][_0x52d5a6][_0x3634('0x60')]?_0x4ccc03(_0x5ef909['rules'][_0x52d5a6][_0x3634('0x60')]):_0x5ef909['rules'][_0x52d5a6][_0x3634('0x61')]+'\x20'+_0x5ef909[_0x3634('0x5e')][_0x52d5a6][_0x3634('0x62')]+(_0x7ba69b(_0x5ef909[_0x3634('0x5e')][_0x52d5a6][_0x3634('0x62')])?'\x20'+_0x5ef909[_0x3634('0x5e')][_0x52d5a6][_0x3634('0x85')]:'');}return _0x182a13+')';};var _0x1b101f={'where':{'id':_0x32373b['id']}},_0x15cb16,_0x2de3cb,_0x4ae858,_0x1feaeb,_0x307f2c;_0x1b101f=_[_0x3634('0x42')]({},_0x1b101f,_0x47e9f8);return db[_0x3634('0x3e')][_0x3634('0x49')](_0x1b101f)[_0x3634('0x20')](function(_0xb4f1f){if(_0xb4f1f){_0x15cb16=_0xb4f1f;return _0xb4f1f[_0x3634('0x63')]();}return null;})[_0x3634('0x20')](function(_0x10e0a2){if(_0x10e0a2){if(!_0x10e0a2[_0x3634('0x31')]){throw new db[(_0x3634('0x86'))][(_0x3634('0x64'))](_0x3634('0x65'),0x193);}_0x2de3cb=_0x10e0a2;return db[_0x3634('0x66')][_0x3634('0x38')]({'raw':!![]});}return null;})[_0x3634('0x20')](function(_0x351c1f){if(_0x351c1f){_0x4ae858=_[_0x3634('0x67')](_0x351c1f,'id');var _0x5e68cd;var _0x512ed4=squel[_0x3634('0x68')]();_0x512ed4[_0x3634('0x69')](_0x15cb16['table']);for(var _0x3f7ee6=0x0;_0x3f7ee6<_0x2de3cb[_0x3634('0x31')];_0x3f7ee6+=0x1){_0x5e68cd=_0x2de3cb[_0x3f7ee6]['MetricId']?_0x4ae858[_0x2de3cb[_0x3f7ee6][_0x3634('0x6b')]]['metric']:_0x2de3cb[_0x3f7ee6][_0x3634('0x61')];_0x5e68cd=_0x2de3cb[_0x3f7ee6][_0x3634('0x87')]?_[_0x3634('0x6d')](_0x4e167a[_0x2de3cb[_0x3f7ee6][_0x3634('0x87')]],'%s',_0x5e68cd):_0x5e68cd;_0x5e68cd=_0x2de3cb[_0x3f7ee6][_0x3634('0x6e')]?_[_0x3634('0x6d')](_0x3018cd[_0x2de3cb[_0x3f7ee6][_0x3634('0x6e')]],'%s',_0x5e68cd):_0x5e68cd;if(_0x2de3cb[_0x3f7ee6][_0x3634('0x6f')]){_0x512ed4[_0x3634('0x60')](_0x5e68cd);}_0x2de3cb[_0x3f7ee6][_0x3634('0x70')]&&_0x512ed4['order'](_0x5e68cd,_0x2de3cb[_0x3f7ee6][_0x3634('0x70')]===_0x3634('0x71')?![]:!![]);_0x512ed4['field'](_0x5e68cd,_0x2de3cb[_0x3f7ee6][_0x3634('0x72')]||_0x5e68cd);}if(_0x15cb16['joins']){_0x15cb16['joins']=JSON[_0x3634('0x74')](_0x15cb16['joins']);for(var _0xac7d50=0x0;_0xac7d50<_0x15cb16[_0x3634('0x73')][_0x3634('0x31')];_0xac7d50+=0x1){if(_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x28')]&&_[_0x3634('0x5a')](_0x45f090,_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x28')])&&_0x15cb16['joins'][_0xac7d50][_0x3634('0x78')]&&_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x76')]&&_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x75')]){_0x512ed4[_0x15cb16[_0x3634('0x73')][_0xac7d50]['type']](_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x76')],null,util['format'](_0x3634('0x77'),_0x15cb16[_0x3634('0x6a')],_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x78')],_0x15cb16[_0x3634('0x73')][_0xac7d50]['foreignTable'],_0x15cb16[_0x3634('0x73')][_0xac7d50][_0x3634('0x75')]));}}}if(_0x15cb16[_0x3634('0x79')]){_0x15cb16['conditions']=JSON[_0x3634('0x74')](_0x15cb16[_0x3634('0x79')]);_0x512ed4[_0x3634('0x36')](_0x4ccc03(_0x15cb16[_0x3634('0x79')]['group']));}_0x307f2c=_0x512ed4['clone']();_0x512ed4[_0x3634('0x18')](_0x5bacd9);_0x512ed4[_0x3634('0x17')](0x0);return;}})[_0x3634('0x20')](function(){if(_0x30f7ca[_0x3634('0x88')]==='web'){return null;}var _0x4a0665=_[_0x3634('0x42')](_0x30f7ca,{'name':_0x30f7ca['fullPath']||_0x30f7ca[_0x3634('0x25')]||_0x15cb16[_0x3634('0x25')],'basename':_0x448db1,'savename':util[_0x3634('0x6e')](_0x3634('0x89'),_0x30f7ca['name']||_0x15cb16[_0x3634('0x25')],require('randomstring')[_0x3634('0x8a')](0x4),_0x30f7ca[_0x3634('0x88')]||_0x3634('0x8b')),'reportId':_0x15cb16['id'],'reportType':'custom'});return db[_0x3634('0x8c')]['create'](_0x4a0665,{'raw':!![]});})['then'](function(_0x46be9f){if(_0x15cb16[_0x3634('0x6a')]===_0x3634('0x8d')){_0x307f2c['where'](_0x15cb16['table']+_0x3634('0x8e'),_0x30f7ca[_0x3634('0x8f')],_0x30f7ca[_0x3634('0x90')]);}else{_0x307f2c[_0x3634('0x36')](_0x15cb16[_0x3634('0x6a')]+_0x3634('0x91'),_0x30f7ca[_0x3634('0x8f')],_0x30f7ca[_0x3634('0x90')]);}if(_0x46be9f){logger[_0x3634('0x92')](_0x3634('0x93'),_0x307f2c[_0x3634('0x7d')]());require(_0x3634('0x94'))[_0x3634('0x95')](path[_0x3634('0x4e')](__dirname,_0x3634('0x96'),_0x46be9f[_0x3634('0x88')]),[_0x46be9f['id'],_0x307f2c[_0x3634('0x7d')](),path[_0x3634('0x4e')](__dirname,_0x3634('0x97'),_0x46be9f[_0x3634('0x98')]),_0x448db1]);return _0x46be9f;}else{var _0x3e7ae9=squel[_0x3634('0x68')]();_0x3e7ae9[_0x3634('0x69')]('('+_0x307f2c['toString']()+')',_0x3634('0x99'));_0x3e7ae9[_0x3634('0x61')]('COUNT(*)','count');_0x307f2c['limit'](_0x30f7ca[_0x3634('0x18')]||_0x5bacd9);_0x307f2c[_0x3634('0x17')](_0x30f7ca[_0x3634('0x17')]||0x0);return dbH['sequelize'][_0x3634('0x2c')](_0x3e7ae9[_0x3634('0x7d')](),{'type':dbH['sequelize'][_0x3634('0x9a')]['SELECT']})['then'](function(_0x5ef8f0){if(!_0x5ef8f0[_0x3634('0x31')]){_0x1feaeb=0x0;}else{_0x1feaeb=_0x5ef8f0[0x0][_0x3634('0x19')]||0x0;}return dbH[_0x3634('0x7e')]['query'](_0x307f2c[_0x3634('0x7d')](),{'type':dbH[_0x3634('0x7e')][_0x3634('0x9a')][_0x3634('0x9b')]});})[_0x3634('0x20')](function(_0x2c88cf){return{'rows':_0x2c88cf||[],'count':_0x1feaeb};});}});}exports[_0x3634('0x9c')]=function(_0x2cdc07,_0x17186f){return runReport(_0x2cdc07[_0x3634('0x3c')],_0x2cdc07[_0x3634('0x2c')],_0x2cdc07['options'])[_0x3634('0x20')](respondWithResult(_0x17186f,null))[_0x3634('0x3a')](handleError(_0x17186f,null));};exports[_0x3634('0x9d')]=runReport;exports['query']=function(_0x1308b9,_0x24d445){var _0x193129=0xa;var _0x4652ea=[_0x3634('0x4e'),_0x3634('0x4f'),'right_join',_0x3634('0x50')];var _0x2d341d={'SUM':_0x3634('0x80'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3634('0x52'),'MAX':_0x3634('0x53'),'MIN':'MIN(%s)','AVG':_0x3634('0x81'),'GROUP_CONCAT':_0x3634('0x55'),'GROUP_CONCAT ASC':_0x3634('0x56'),'GROUP_CONCAT DESC':_0x3634('0x9e')};var _0xa6b7e4={'SEC_TO_TIME':_0x3634('0x82'),'DATE':_0x3634('0x57'),'HOUR':_0x3634('0x83'),'ROUND':_0x3634('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xb5ca9f=function(_0x56e0e8){return!_[_0x3634('0x5a')]([_0x3634('0x5b'),_0x3634('0x84'),'IS\x20EMPTY',_0x3634('0x5d')],_0x56e0e8);};var _0x523840=function(_0x2390b9){if(!_0x2390b9||!_0x2390b9[_0x3634('0x5e')][_0x3634('0x31')]){return'';}for(var _0x537825='(',_0x41cd86=0x0;_0x41cd86<_0x2390b9[_0x3634('0x5e')][_0x3634('0x31')];_0x41cd86+=0x1){_0x41cd86>0x0&&(_0x537825+='\x20'+_0x2390b9[_0x3634('0x5f')]+'\x20');_0x537825+=_0x2390b9[_0x3634('0x5e')][_0x41cd86]['group']?_0x523840(_0x2390b9['rules'][_0x41cd86]['group']):_0x2390b9[_0x3634('0x5e')][_0x41cd86]['field']+'\x20'+_0x2390b9['rules'][_0x41cd86][_0x3634('0x62')]+(_0xb5ca9f(_0x2390b9[_0x3634('0x5e')][_0x41cd86]['condition'])?'\x20'+_0x2390b9[_0x3634('0x5e')][_0x41cd86][_0x3634('0x85')]:'');}return _0x537825+')';};var _0x362e43={'where':{'id':_0x1308b9[_0x3634('0x3c')]['id']}},_0x4d874c,_0x48eeaf,_0x1f31d0,_0x302c96,_0x1c986b;_0x362e43=_['merge']({},_0x362e43,_0x1308b9[_0x3634('0x43')]);return db[_0x3634('0x3e')][_0x3634('0x49')](_0x362e43)['then'](function(_0xa65b57){if(_0xa65b57){_0x4d874c=_0xa65b57;return _0xa65b57[_0x3634('0x63')]();}return null;})[_0x3634('0x20')](function(_0x5c1f18){if(_0x5c1f18){if(!_0x5c1f18['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x3634('0x65'),0x193);}_0x48eeaf=_0x5c1f18;return db[_0x3634('0x66')][_0x3634('0x38')]({'raw':!![]});}return null;})[_0x3634('0x20')](function(_0x2293c8){if(_0x2293c8){_0x1f31d0=_[_0x3634('0x67')](_0x2293c8,'id');var _0x3dd2e2;var _0x40b6e0=squel[_0x3634('0x68')]();_0x40b6e0[_0x3634('0x69')](_0x4d874c[_0x3634('0x6a')]);for(var _0x1ddc27=0x0;_0x1ddc27<_0x48eeaf[_0x3634('0x31')];_0x1ddc27+=0x1){_0x3dd2e2=_0x48eeaf[_0x1ddc27][_0x3634('0x6b')]?_0x1f31d0[_0x48eeaf[_0x1ddc27][_0x3634('0x6b')]][_0x3634('0x6c')]:_0x48eeaf[_0x1ddc27][_0x3634('0x61')];_0x3dd2e2=_0x48eeaf[_0x1ddc27][_0x3634('0x87')]?_['replace'](_0x2d341d[_0x48eeaf[_0x1ddc27][_0x3634('0x87')]],'%s',_0x3dd2e2):_0x3dd2e2;_0x3dd2e2=_0x48eeaf[_0x1ddc27][_0x3634('0x6e')]?_[_0x3634('0x6d')](_0xa6b7e4[_0x48eeaf[_0x1ddc27][_0x3634('0x6e')]],'%s',_0x3dd2e2):_0x3dd2e2;if(_0x48eeaf[_0x1ddc27][_0x3634('0x6f')]){_0x40b6e0['group'](_0x3dd2e2);}_0x48eeaf[_0x1ddc27][_0x3634('0x70')]&&_0x40b6e0[_0x3634('0x33')](_0x3dd2e2,_0x48eeaf[_0x1ddc27][_0x3634('0x70')]===_0x3634('0x71')?![]:!![]);_0x40b6e0[_0x3634('0x61')](_0x3dd2e2,_0x48eeaf[_0x1ddc27]['alias']||_0x3dd2e2);}if(_0x4d874c[_0x3634('0x73')]){_0x4d874c[_0x3634('0x73')]=JSON[_0x3634('0x74')](_0x4d874c[_0x3634('0x73')]);for(var _0x18e824=0x0;_0x18e824<_0x4d874c['joins'][_0x3634('0x31')];_0x18e824+=0x1){if(_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x28')]&&_[_0x3634('0x5a')](_0x4652ea,_0x4d874c['joins'][_0x18e824][_0x3634('0x28')])&&_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x78')]&&_0x4d874c[_0x3634('0x73')][_0x18e824]['foreignTable']&&_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x75')]){_0x40b6e0[_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x28')]](_0x4d874c['joins'][_0x18e824][_0x3634('0x76')],null,util[_0x3634('0x6e')](_0x3634('0x77'),_0x4d874c[_0x3634('0x6a')],_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x78')],_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x76')],_0x4d874c[_0x3634('0x73')][_0x18e824][_0x3634('0x75')]));}}}if(_0x4d874c[_0x3634('0x79')]){_0x4d874c[_0x3634('0x79')]=JSON['parse'](_0x4d874c[_0x3634('0x79')]);_0x40b6e0[_0x3634('0x36')](_0x523840(_0x4d874c[_0x3634('0x79')][_0x3634('0x60')]));}_0x1c986b=_0x40b6e0[_0x3634('0x7a')]();_0x40b6e0[_0x3634('0x18')](_0x193129);_0x40b6e0['offset'](0x0);logger['debug'](_0x3634('0x7c'),_0x40b6e0[_0x3634('0x7d')]());return dbH['sequelize'][_0x3634('0x2c')](_0x40b6e0['toString'](),{'type':dbH[_0x3634('0x7e')][_0x3634('0x9a')][_0x3634('0x9b')]});}})[_0x3634('0x20')](function(){return{'sql':_0x1c986b[_0x3634('0x7d')]()};})[_0x3634('0x20')](respondWithResult(_0x24d445,null))[_0x3634('0x3a')](handleError(_0x24d445,null));}; \ No newline at end of file +var _0xf87a=['Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','status','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','AnalyticCustomReport','includeAll','include','findAll','rows','catch','params','options','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','preview','join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','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','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','function','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','sequelize','toString','QueryTypes','SELECT','left_join','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','from','format','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','Limited\x20Query:','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','offset','undefined','limit','count','set'];(function(_0x58b214,_0x4c5ecf){var _0x19eee3=function(_0x13769e){while(--_0x13769e){_0x58b214['push'](_0x58b214['shift']());}};_0x19eee3(++_0x4c5ecf);}(_0xf87a,0x8b));var _0xaf87=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf87a[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf87('0x0'));var rp=require(_0xaf87('0x1'));var moment=require('moment');var BPromise=require(_0xaf87('0x2'));var Mustache=require(_0xaf87('0x3'));var util=require(_0xaf87('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf87('0x5'));var fs=require('fs');var fs_extra=require(_0xaf87('0x6'));var _=require(_0xaf87('0x7'));var squel=require(_0xaf87('0x8'));var crypto=require(_0xaf87('0x9'));var jsforce=require(_0xaf87('0xa'));var deskjs=require(_0xaf87('0xb'));var toCsv=require('to-csv');var querystring=require(_0xaf87('0xc'));var Papa=require(_0xaf87('0xd'));var Redis=require(_0xaf87('0xe'));var authService=require(_0xaf87('0xf'));var qs=require(_0xaf87('0x10'));var as=require(_0xaf87('0x11'));var hardwareService=require(_0xaf87('0x12'));var logger=require(_0xaf87('0x13'))(_0xaf87('0x14'));var utils=require(_0xaf87('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xaf87('0x16')];function respondWithStatusCode(_0x77251f,_0x569c98){_0x569c98=_0x569c98||0xcc;return function(_0x2b29f7){if(_0x2b29f7){return _0x77251f[_0xaf87('0x17')](_0x569c98);}return _0x77251f['status'](_0x569c98)['end']();};}function respondWithResult(_0x49a180,_0x1f2966){_0x1f2966=_0x1f2966||0xc8;return function(_0xadb65c){if(_0xadb65c){return _0x49a180['status'](_0x1f2966)['json'](_0xadb65c);}};}function respondWithFilteredResult(_0x1803ae,_0xb8579d){return function(_0x3e32b2){if(_0x3e32b2){var _0x59841f=typeof _0xb8579d[_0xaf87('0x18')]===_0xaf87('0x19')&&typeof _0xb8579d[_0xaf87('0x1a')]===_0xaf87('0x19');var _0x7def97=_0x3e32b2[_0xaf87('0x1b')];var _0x55df6d=_0x59841f?0x0:_0xb8579d[_0xaf87('0x18')];var _0x4a0248=_0x59841f?_0x3e32b2[_0xaf87('0x1b')]:_0xb8579d[_0xaf87('0x18')]+_0xb8579d[_0xaf87('0x1a')];var _0x48c7ba;if(_0x4a0248>=_0x7def97){_0x4a0248=_0x7def97;_0x48c7ba=0xc8;}else{_0x48c7ba=0xce;}_0x1803ae['status'](_0x48c7ba);return _0x1803ae[_0xaf87('0x1c')](_0xaf87('0x1d'),_0x55df6d+'-'+_0x4a0248+'/'+_0x7def97)['json'](_0x3e32b2);}return null;};}function patchUpdates(_0x4cbf54){return function(_0x1d82cf){try{jsonpatch[_0xaf87('0x1e')](_0x1d82cf,_0x4cbf54,!![]);}catch(_0xe9602b){return BPromise[_0xaf87('0x1f')](_0xe9602b);}return _0x1d82cf[_0xaf87('0x20')]();};}function saveUpdates(_0x329fa1,_0xd185d0){return function(_0xe7a2c3){if(_0xe7a2c3){return _0xe7a2c3['update'](_0x329fa1)[_0xaf87('0x21')](function(_0x93833e){return _0x93833e;});}return null;};}function removeEntity(_0x2ac89d,_0x379912){return function(_0x30de6b){if(_0x30de6b){return _0x30de6b[_0xaf87('0x22')]()['then'](function(){var _0x219090=_0x30de6b[_0xaf87('0x23')]({'plain':!![]});var _0x2665af=_0xaf87('0x24');return db[_0xaf87('0x25')]['destroy']({'where':{'type':_0x2665af,'resourceId':_0x219090['id']}})[_0xaf87('0x21')](function(){return _0x30de6b;});})['then'](function(){_0x2ac89d[_0xaf87('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548184,_0xfe37f3){return function(_0x52828f){if(!_0x52828f){_0x548184['sendStatus'](0x194);}return _0x52828f;};}function handleError(_0x214fca,_0x19f923){_0x19f923=_0x19f923||0x1f4;return function(_0x47d37c){logger[_0xaf87('0x27')](_0x47d37c[_0xaf87('0x28')]);if(_0x47d37c[_0xaf87('0x29')]){delete _0x47d37c[_0xaf87('0x29')];}_0x214fca['status'](_0x19f923)[_0xaf87('0x2a')](_0x47d37c);};}exports[_0xaf87('0x2b')]=function(_0xb77baf,_0x18efae){var _0x15bb47={},_0x8ccd5e={},_0x47406b={'count':0x0,'rows':[]};var _0x5d7811=_[_0xaf87('0x2c')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5508b3){return{'name':_0x5508b3[_0xaf87('0x2d')],'type':_0x5508b3[_0xaf87('0x2e')][_0xaf87('0x2f')]};});_0x8ccd5e[_0xaf87('0x30')]=_['map'](_0x5d7811,'name');_0x8ccd5e[_0xaf87('0x31')]=_[_0xaf87('0x32')](_0xb77baf[_0xaf87('0x31')]);_0x8ccd5e[_0xaf87('0x33')]=_[_0xaf87('0x34')](_0x8ccd5e[_0xaf87('0x30')],_0x8ccd5e[_0xaf87('0x31')]);_0x15bb47[_0xaf87('0x35')]=_[_0xaf87('0x34')](_0x8ccd5e[_0xaf87('0x30')],qs[_0xaf87('0x36')](_0xb77baf[_0xaf87('0x31')][_0xaf87('0x36')]));_0x15bb47[_0xaf87('0x35')]=_0x15bb47[_0xaf87('0x35')][_0xaf87('0x37')]?_0x15bb47[_0xaf87('0x35')]:_0x8ccd5e[_0xaf87('0x30')];if(!_0xb77baf[_0xaf87('0x31')][_0xaf87('0x38')]('nolimit')){_0x15bb47[_0xaf87('0x1a')]=qs[_0xaf87('0x1a')](_0xb77baf[_0xaf87('0x31')][_0xaf87('0x1a')]);_0x15bb47[_0xaf87('0x18')]=qs['offset'](_0xb77baf['query'][_0xaf87('0x18')]);}_0x15bb47['order']=qs[_0xaf87('0x39')](_0xb77baf['query'][_0xaf87('0x39')]);_0x15bb47[_0xaf87('0x3a')]=qs[_0xaf87('0x33')](_[_0xaf87('0x3b')](_0xb77baf[_0xaf87('0x31')],_0x8ccd5e[_0xaf87('0x33')]),_0x5d7811);if(_0xb77baf[_0xaf87('0x31')]['filter']){_0x15bb47[_0xaf87('0x3a')]=_[_0xaf87('0x3c')](_0x15bb47[_0xaf87('0x3a')],{'$or':_[_0xaf87('0x2c')](_0x5d7811,function(_0xe3cdbb){if(_0xe3cdbb[_0xaf87('0x2e')]!==_0xaf87('0x3d')){var _0x248c3f={};_0x248c3f[_0xe3cdbb[_0xaf87('0x29')]]={'$like':'%'+_0xb77baf['query'][_0xaf87('0x3e')]+'%'};return _0x248c3f;}})});}_0x15bb47=_[_0xaf87('0x3c')]({},_0x15bb47,_0xb77baf['options']);var _0x1f9914={'where':_0x15bb47['where']};return db[_0xaf87('0x3f')][_0xaf87('0x1b')](_0x1f9914)[_0xaf87('0x21')](function(_0x3ea153){_0x47406b[_0xaf87('0x1b')]=_0x3ea153;if(_0xb77baf['query'][_0xaf87('0x40')]){_0x15bb47[_0xaf87('0x41')]=[{'all':!![]}];}return db[_0xaf87('0x3f')][_0xaf87('0x42')](_0x15bb47);})[_0xaf87('0x21')](function(_0x2568d2){_0x47406b[_0xaf87('0x43')]=_0x2568d2;return _0x47406b;})['then'](respondWithFilteredResult(_0x18efae,_0x15bb47))[_0xaf87('0x44')](handleError(_0x18efae,null));};exports['show']=function(_0x30e013,_0x17ccfc){var _0xa3d58a={'raw':![],'where':{'id':_0x30e013[_0xaf87('0x45')]['id']}},_0x2b4824={};_0x2b4824[_0xaf87('0x30')]=_[_0xaf87('0x32')](db[_0xaf87('0x3f')]['rawAttributes']);_0x2b4824[_0xaf87('0x31')]=_['keys'](_0x30e013['query']);_0x2b4824[_0xaf87('0x33')]=_[_0xaf87('0x34')](_0x2b4824['model'],_0x2b4824[_0xaf87('0x31')]);_0xa3d58a['attributes']=_['intersection'](_0x2b4824[_0xaf87('0x30')],qs[_0xaf87('0x36')](_0x30e013[_0xaf87('0x31')][_0xaf87('0x36')]));_0xa3d58a[_0xaf87('0x35')]=_0xa3d58a[_0xaf87('0x35')][_0xaf87('0x37')]?_0xa3d58a[_0xaf87('0x35')]:_0x2b4824['model'];if(_0x30e013[_0xaf87('0x31')][_0xaf87('0x40')]){_0xa3d58a[_0xaf87('0x41')]=[{'all':!![]}];}_0xa3d58a=_[_0xaf87('0x3c')]({},_0xa3d58a,_0x30e013[_0xaf87('0x46')]);return db[_0xaf87('0x3f')][_0xaf87('0x47')](_0xa3d58a)[_0xaf87('0x21')](handleEntityNotFound(_0x17ccfc,null))['then'](respondWithResult(_0x17ccfc,null))[_0xaf87('0x44')](handleError(_0x17ccfc,null));};exports[_0xaf87('0x48')]=function(_0x1b9370,_0x3545ea){return db[_0xaf87('0x3f')][_0xaf87('0x48')](_0x1b9370[_0xaf87('0x49')],{})['then'](function(_0x17e6ef){var _0x2f6eec=_0x1b9370[_0xaf87('0x4a')]['get']({'plain':!![]});if(!_0x2f6eec)throw new Error(_0xaf87('0x4b'));if(_0x2f6eec[_0xaf87('0x4c')]==='user'){var _0x257311=_0x17e6ef[_0xaf87('0x23')]({'plain':!![]});var _0x2782f9=_0xaf87('0x4d');return db[_0xaf87('0x4e')][_0xaf87('0x47')]({'where':{'name':_0x2782f9,'userProfileId':_0x2f6eec[_0xaf87('0x4f')]},'raw':!![]})[_0xaf87('0x21')](function(_0x3c8758){if(_0x3c8758&&_0x3c8758[_0xaf87('0x50')]===0x0){return db[_0xaf87('0x25')][_0xaf87('0x48')]({'name':_0x257311['name'],'resourceId':_0x257311['id'],'type':_0xaf87('0x24'),'sectionId':_0x3c8758['id']},{})[_0xaf87('0x21')](function(){return _0x17e6ef;});}else{return _0x17e6ef;}})['catch'](function(_0x1fa4b7){logger[_0xaf87('0x27')](_0xaf87('0x51'),_0x1fa4b7);throw _0x1fa4b7;});}return _0x17e6ef;})[_0xaf87('0x21')](respondWithResult(_0x3545ea,0xc9))[_0xaf87('0x44')](handleError(_0x3545ea,null));};exports['update']=function(_0x1c9ae0,_0x3c7b83){if(_0x1c9ae0['body']['id']){delete _0x1c9ae0[_0xaf87('0x49')]['id'];}return db[_0xaf87('0x3f')][_0xaf87('0x47')]({'where':{'id':_0x1c9ae0[_0xaf87('0x45')]['id']}})[_0xaf87('0x21')](handleEntityNotFound(_0x3c7b83,null))[_0xaf87('0x21')](saveUpdates(_0x1c9ae0[_0xaf87('0x49')],null))[_0xaf87('0x21')](respondWithResult(_0x3c7b83,null))[_0xaf87('0x44')](handleError(_0x3c7b83,null));};exports['destroy']=function(_0x3b217c,_0x56fda2){return db[_0xaf87('0x3f')][_0xaf87('0x47')]({'where':{'id':_0x3b217c[_0xaf87('0x45')]['id']}})[_0xaf87('0x21')](handleEntityNotFound(_0x56fda2,null))[_0xaf87('0x21')](removeEntity(_0x56fda2,null))['catch'](handleError(_0x56fda2,null));};exports[_0xaf87('0x52')]=function(_0x513083,_0x2ddea0){var _0xbe7d65=0xa;var _0x3e0131=[_0xaf87('0x53'),'left_join','right_join',_0xaf87('0x54')];var _0x45ef93={'SUM':'SUM(%s)','COUNT':_0xaf87('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xaf87('0x56'),'MIN':_0xaf87('0x57'),'AVG':_0xaf87('0x58'),'GROUP_CONCAT':_0xaf87('0x59'),'GROUP_CONCAT ASC':_0xaf87('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1e8643={'SEC_TO_TIME':_0xaf87('0x5b'),'DATE':_0xaf87('0x5c'),'HOUR':_0xaf87('0x5d'),'ROUND':_0xaf87('0x5e'),'UNIX_TIMESTAMP':_0xaf87('0x5f')};var _0x7ee883=function(_0x5b75b7){return!_[_0xaf87('0x60')]([_0xaf87('0x61'),_0xaf87('0x62'),_0xaf87('0x63'),_0xaf87('0x64')],_0x5b75b7);};var _0x11116b=function(_0x2c2b62){if(!_0x2c2b62||!_0x2c2b62[_0xaf87('0x65')][_0xaf87('0x37')]){return'';}for(var _0x3d1c76='(',_0x28c7b9=0x0;_0x28c7b9<_0x2c2b62[_0xaf87('0x65')]['length'];_0x28c7b9+=0x1){_0x28c7b9>0x0&&(_0x3d1c76+='\x20'+_0x2c2b62[_0xaf87('0x66')]+'\x20');_0x3d1c76+=_0x2c2b62[_0xaf87('0x65')][_0x28c7b9]['group']?_0x11116b(_0x2c2b62['rules'][_0x28c7b9][_0xaf87('0x67')]):_0x2c2b62[_0xaf87('0x65')][_0x28c7b9][_0xaf87('0x68')]+'\x20'+_0x2c2b62[_0xaf87('0x65')][_0x28c7b9][_0xaf87('0x69')]+(_0x7ee883(_0x2c2b62[_0xaf87('0x65')][_0x28c7b9][_0xaf87('0x69')])?'\x20'+_0x2c2b62[_0xaf87('0x65')][_0x28c7b9][_0xaf87('0x6a')]:'');}return _0x3d1c76+')';};var _0x163e9f={'where':{'id':_0x513083['params']['id']}},_0x5c6a0b,_0x15b256,_0x459329,_0x1cc36a,_0x5a10d7;_0x163e9f=_[_0xaf87('0x3c')]({},_0x163e9f,_0x513083['options']);return db[_0xaf87('0x3f')][_0xaf87('0x47')](_0x163e9f)[_0xaf87('0x21')](function(_0x31554c){if(_0x31554c){_0x5c6a0b=_0x31554c;return _0x31554c[_0xaf87('0x6b')]();}return null;})['then'](function(_0x81a021){if(_0x81a021){if(!_0x81a021['length']){throw new db[(_0xaf87('0x6c'))][(_0xaf87('0x6d'))](_0xaf87('0x6e'),0x193);}_0x15b256=_0x81a021;return db[_0xaf87('0x6f')][_0xaf87('0x42')]({'raw':!![]});}return null;})[_0xaf87('0x21')](function(_0x13fc56){if(_0x13fc56){_0x459329=_[_0xaf87('0x70')](_0x13fc56,'id');var _0x3f1c6a;var _0x119b1c=squel[_0xaf87('0x71')]();_0x119b1c['from'](_0x5c6a0b[_0xaf87('0x72')]);for(var _0x45a36b=0x0;_0x45a36b<_0x15b256[_0xaf87('0x37')];_0x45a36b+=0x1){_0x3f1c6a=_0x15b256[_0x45a36b][_0xaf87('0x73')]?_0x459329[_0x15b256[_0x45a36b][_0xaf87('0x73')]][_0xaf87('0x74')]:_0x15b256[_0x45a36b]['field'];_0x3f1c6a=_0x15b256[_0x45a36b]['function']?_[_0xaf87('0x75')](_0x45ef93[_0x15b256[_0x45a36b][_0xaf87('0x76')]],'%s',_0x3f1c6a):_0x3f1c6a;_0x3f1c6a=_0x15b256[_0x45a36b]['format']?_[_0xaf87('0x75')](_0x1e8643[_0x15b256[_0x45a36b]['format']],'%s',_0x3f1c6a):_0x3f1c6a;if(_0x15b256[_0x45a36b][_0xaf87('0x77')]){_0x119b1c['group'](_0x3f1c6a);}_0x15b256[_0x45a36b][_0xaf87('0x78')]&&_0x119b1c[_0xaf87('0x79')](_0x3f1c6a,_0x15b256[_0x45a36b][_0xaf87('0x78')]===_0xaf87('0x7a')?![]:!![]);_0x119b1c[_0xaf87('0x68')](_0x3f1c6a,_0x15b256[_0x45a36b][_0xaf87('0x7b')]||_0x3f1c6a);}if(_0x5c6a0b[_0xaf87('0x7c')]){_0x5c6a0b[_0xaf87('0x7c')]=JSON['parse'](_0x5c6a0b['joins']);for(var _0x592099=0x0;_0x592099<_0x5c6a0b[_0xaf87('0x7c')][_0xaf87('0x37')];_0x592099+=0x1){if(_0x5c6a0b['joins'][_0x592099][_0xaf87('0x2e')]&&_[_0xaf87('0x60')](_0x3e0131,_0x5c6a0b[_0xaf87('0x7c')][_0x592099][_0xaf87('0x2e')])&&_0x5c6a0b[_0xaf87('0x7c')][_0x592099][_0xaf87('0x7d')]&&_0x5c6a0b[_0xaf87('0x7c')][_0x592099][_0xaf87('0x7e')]&&_0x5c6a0b['joins'][_0x592099]['foreignKey']){_0x119b1c[_0x5c6a0b[_0xaf87('0x7c')][_0x592099][_0xaf87('0x2e')]](_0x5c6a0b['joins'][_0x592099][_0xaf87('0x7e')],null,util['format'](_0xaf87('0x7f'),_0x5c6a0b['table'],_0x5c6a0b[_0xaf87('0x7c')][_0x592099][_0xaf87('0x7d')],_0x5c6a0b['joins'][_0x592099][_0xaf87('0x7e')],_0x5c6a0b[_0xaf87('0x7c')][_0x592099]['foreignKey']));}}}if(_0x5c6a0b['conditions']){_0x5c6a0b[_0xaf87('0x80')]=JSON[_0xaf87('0x81')](_0x5c6a0b['conditions']);_0x119b1c[_0xaf87('0x3a')](_0x11116b(_0x5c6a0b[_0xaf87('0x80')][_0xaf87('0x67')]));}_0x5a10d7=_0x119b1c[_0xaf87('0x82')]();_0x119b1c[_0xaf87('0x1a')](_0xbe7d65);_0x119b1c[_0xaf87('0x18')](0x0);logger[_0xaf87('0x83')]('Limited\x20Query:',_0x119b1c['toString']());return dbH[_0xaf87('0x84')][_0xaf87('0x31')](_0x119b1c[_0xaf87('0x85')](),{'type':dbH[_0xaf87('0x84')][_0xaf87('0x86')][_0xaf87('0x87')]});}})[_0xaf87('0x21')](respondWithResult(_0x2ddea0,null))[_0xaf87('0x44')](handleError(_0x2ddea0,null));};function runReport(_0x773bf6,_0x28d331,_0x578bab){var _0x95ab5b=_0x28d331['name'];var _0x3be676=0xa;var _0x44d484=[_0xaf87('0x53'),_0xaf87('0x88'),_0xaf87('0x89'),_0xaf87('0x54')];var _0x2bd7e6={'SUM':_0xaf87('0x8a'),'COUNT':_0xaf87('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xaf87('0x56'),'MIN':_0xaf87('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xaf87('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf87('0x8b')};var _0x10c1b4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xaf87('0x5d'),'ROUND':_0xaf87('0x5e'),'UNIX_TIMESTAMP':_0xaf87('0x5f')};var _0x34c8b1=function(_0x5cf046){return!_[_0xaf87('0x60')]([_0xaf87('0x61'),_0xaf87('0x62'),_0xaf87('0x63'),'IS\x20NOT\x20EMPTY'],_0x5cf046);};var _0x27b696=function(_0x908da4){if(!_0x908da4||!_0x908da4[_0xaf87('0x65')]['length']){return'';}for(var _0x4fc2b5='(',_0x4bc0bf=0x0;_0x4bc0bf<_0x908da4[_0xaf87('0x65')][_0xaf87('0x37')];_0x4bc0bf+=0x1){_0x4bc0bf>0x0&&(_0x4fc2b5+='\x20'+_0x908da4[_0xaf87('0x66')]+'\x20');_0x4fc2b5+=_0x908da4[_0xaf87('0x65')][_0x4bc0bf][_0xaf87('0x67')]?_0x27b696(_0x908da4[_0xaf87('0x65')][_0x4bc0bf][_0xaf87('0x67')]):_0x908da4['rules'][_0x4bc0bf]['field']+'\x20'+_0x908da4[_0xaf87('0x65')][_0x4bc0bf][_0xaf87('0x69')]+(_0x34c8b1(_0x908da4[_0xaf87('0x65')][_0x4bc0bf][_0xaf87('0x69')])?'\x20'+_0x908da4[_0xaf87('0x65')][_0x4bc0bf][_0xaf87('0x6a')]:'');}return _0x4fc2b5+')';};var _0x15d9a7={'where':{'id':_0x773bf6['id']}},_0x2f552d,_0xccc498,_0x3729d0,_0x4ff441,_0x5cf31c;_0x15d9a7=_[_0xaf87('0x3c')]({},_0x15d9a7,_0x578bab);return db[_0xaf87('0x3f')][_0xaf87('0x47')](_0x15d9a7)[_0xaf87('0x21')](function(_0x93eebc){if(_0x93eebc){_0x2f552d=_0x93eebc;return _0x93eebc[_0xaf87('0x6b')]();}return null;})[_0xaf87('0x21')](function(_0x23541e){if(_0x23541e){if(!_0x23541e['length']){throw new db['Sequelize'][(_0xaf87('0x6d'))](_0xaf87('0x6e'),0x193);}_0xccc498=_0x23541e;return db['AnalyticMetric'][_0xaf87('0x42')]({'raw':!![]});}return null;})[_0xaf87('0x21')](function(_0x814ac6){if(_0x814ac6){_0x3729d0=_[_0xaf87('0x70')](_0x814ac6,'id');var _0x1f08e0;var _0x199649=squel[_0xaf87('0x71')]();_0x199649[_0xaf87('0x8c')](_0x2f552d['table']);for(var _0x320030=0x0;_0x320030<_0xccc498['length'];_0x320030+=0x1){_0x1f08e0=_0xccc498[_0x320030][_0xaf87('0x73')]?_0x3729d0[_0xccc498[_0x320030]['MetricId']][_0xaf87('0x74')]:_0xccc498[_0x320030][_0xaf87('0x68')];_0x1f08e0=_0xccc498[_0x320030]['function']?_[_0xaf87('0x75')](_0x2bd7e6[_0xccc498[_0x320030][_0xaf87('0x76')]],'%s',_0x1f08e0):_0x1f08e0;_0x1f08e0=_0xccc498[_0x320030][_0xaf87('0x8d')]?_[_0xaf87('0x75')](_0x10c1b4[_0xccc498[_0x320030][_0xaf87('0x8d')]],'%s',_0x1f08e0):_0x1f08e0;if(_0xccc498[_0x320030][_0xaf87('0x77')]){_0x199649['group'](_0x1f08e0);}_0xccc498[_0x320030][_0xaf87('0x78')]&&_0x199649[_0xaf87('0x79')](_0x1f08e0,_0xccc498[_0x320030][_0xaf87('0x78')]==='DESC'?![]:!![]);_0x199649['field'](_0x1f08e0,_0xccc498[_0x320030]['alias']||_0x1f08e0);}if(_0x2f552d[_0xaf87('0x7c')]){_0x2f552d[_0xaf87('0x7c')]=JSON[_0xaf87('0x81')](_0x2f552d['joins']);for(var _0x5ee425=0x0;_0x5ee425<_0x2f552d['joins'][_0xaf87('0x37')];_0x5ee425+=0x1){if(_0x2f552d[_0xaf87('0x7c')][_0x5ee425][_0xaf87('0x2e')]&&_[_0xaf87('0x60')](_0x44d484,_0x2f552d[_0xaf87('0x7c')][_0x5ee425][_0xaf87('0x2e')])&&_0x2f552d[_0xaf87('0x7c')][_0x5ee425][_0xaf87('0x7d')]&&_0x2f552d[_0xaf87('0x7c')][_0x5ee425]['foreignTable']&&_0x2f552d[_0xaf87('0x7c')][_0x5ee425][_0xaf87('0x8e')]){_0x199649[_0x2f552d['joins'][_0x5ee425][_0xaf87('0x2e')]](_0x2f552d[_0xaf87('0x7c')][_0x5ee425][_0xaf87('0x7e')],null,util['format'](_0xaf87('0x7f'),_0x2f552d[_0xaf87('0x72')],_0x2f552d['joins'][_0x5ee425]['parentKey'],_0x2f552d[_0xaf87('0x7c')][_0x5ee425][_0xaf87('0x7e')],_0x2f552d[_0xaf87('0x7c')][_0x5ee425]['foreignKey']));}}}if(_0x2f552d['conditions']){_0x2f552d['conditions']=JSON[_0xaf87('0x81')](_0x2f552d[_0xaf87('0x80')]);_0x199649[_0xaf87('0x3a')](_0x27b696(_0x2f552d[_0xaf87('0x80')][_0xaf87('0x67')]));}_0x5cf31c=_0x199649[_0xaf87('0x82')]();_0x199649[_0xaf87('0x1a')](_0x3be676);_0x199649['offset'](0x0);return;}})[_0xaf87('0x21')](function(){if(_0x28d331[_0xaf87('0x8f')]===_0xaf87('0x90')){return null;}var _0x515e4e=_[_0xaf87('0x3c')](_0x28d331,{'name':_0x28d331[_0xaf87('0x91')]||_0x28d331[_0xaf87('0x29')]||_0x2f552d[_0xaf87('0x29')],'basename':_0x95ab5b,'savename':util['format'](_0xaf87('0x92'),_0x28d331['name']||_0x2f552d[_0xaf87('0x29')],require(_0xaf87('0x93'))[_0xaf87('0x94')](0x4),_0x28d331[_0xaf87('0x8f')]||_0xaf87('0x95')),'reportId':_0x2f552d['id'],'reportType':_0xaf87('0x96')});return db[_0xaf87('0x97')][_0xaf87('0x48')](_0x515e4e,{'raw':!![]});})[_0xaf87('0x21')](function(_0x362cca){if(_0x2f552d[_0xaf87('0x72')]===_0xaf87('0x98')){_0x5cf31c['where'](_0x2f552d[_0xaf87('0x72')]+_0xaf87('0x99'),_0x28d331[_0xaf87('0x9a')],_0x28d331[_0xaf87('0x9b')]);}else{_0x5cf31c[_0xaf87('0x3a')](_0x2f552d[_0xaf87('0x72')]+_0xaf87('0x9c'),_0x28d331[_0xaf87('0x9a')],_0x28d331[_0xaf87('0x9b')]);}if(_0x362cca){logger[_0xaf87('0x9d')](_0xaf87('0x9e'),_0x5cf31c['toString']());require(_0xaf87('0x9f'))[_0xaf87('0xa0')](path[_0xaf87('0x53')](__dirname,_0xaf87('0xa1'),_0x362cca['output']),[_0x362cca['id'],_0x5cf31c[_0xaf87('0x85')](),path[_0xaf87('0x53')](__dirname,_0xaf87('0xa2'),_0x362cca[_0xaf87('0xa3')]),_0x95ab5b]);return _0x362cca;}else{var _0x5c3170=squel[_0xaf87('0x71')]();_0x5c3170[_0xaf87('0x8c')]('('+_0x5cf31c[_0xaf87('0x85')]()+')',_0xaf87('0xa4'));_0x5c3170[_0xaf87('0x68')](_0xaf87('0xa5'),'count');_0x5cf31c[_0xaf87('0x1a')](_0x28d331[_0xaf87('0x1a')]||_0x3be676);_0x5cf31c['offset'](_0x28d331[_0xaf87('0x18')]||0x0);return dbH[_0xaf87('0x84')]['query'](_0x5c3170[_0xaf87('0x85')](),{'type':dbH[_0xaf87('0x84')][_0xaf87('0x86')][_0xaf87('0x87')]})[_0xaf87('0x21')](function(_0x12c0f5){if(!_0x12c0f5[_0xaf87('0x37')]){_0x4ff441=0x0;}else{_0x4ff441=_0x12c0f5[0x0][_0xaf87('0x1b')]||0x0;}return dbH[_0xaf87('0x84')][_0xaf87('0x31')](_0x5cf31c[_0xaf87('0x85')](),{'type':dbH[_0xaf87('0x84')][_0xaf87('0x86')]['SELECT']});})[_0xaf87('0x21')](function(_0x2be863){return{'rows':_0x2be863||[],'count':_0x4ff441};});}});}exports[_0xaf87('0xa6')]=function(_0x565eb9,_0x86f3f1){return runReport(_0x565eb9[_0xaf87('0x45')],_0x565eb9[_0xaf87('0x31')],_0x565eb9['options'])[_0xaf87('0x21')](respondWithResult(_0x86f3f1,null))['catch'](handleError(_0x86f3f1,null));};exports['runReport']=runReport;exports['query']=function(_0xfa5b31,_0x4d352d){var _0x5488f0=0xa;var _0x305edf=[_0xaf87('0x53'),'left_join',_0xaf87('0x89'),_0xaf87('0x54')];var _0x3a2a57={'SUM':'SUM(%s)','COUNT':_0xaf87('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xaf87('0x56'),'MIN':'MIN(%s)','AVG':_0xaf87('0x58'),'GROUP_CONCAT':_0xaf87('0x59'),'GROUP_CONCAT ASC':_0xaf87('0x5a'),'GROUP_CONCAT DESC':_0xaf87('0x8b')};var _0x236142={'SEC_TO_TIME':_0xaf87('0x5b'),'DATE':_0xaf87('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xaf87('0x5e'),'UNIX_TIMESTAMP':_0xaf87('0x5f')};var _0x20146d=function(_0x36f1fe){return!_[_0xaf87('0x60')]([_0xaf87('0x61'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xaf87('0x64')],_0x36f1fe);};var _0x12531a=function(_0x3f3f37){if(!_0x3f3f37||!_0x3f3f37[_0xaf87('0x65')][_0xaf87('0x37')]){return'';}for(var _0x436179='(',_0x58e491=0x0;_0x58e491<_0x3f3f37[_0xaf87('0x65')][_0xaf87('0x37')];_0x58e491+=0x1){_0x58e491>0x0&&(_0x436179+='\x20'+_0x3f3f37[_0xaf87('0x66')]+'\x20');_0x436179+=_0x3f3f37['rules'][_0x58e491][_0xaf87('0x67')]?_0x12531a(_0x3f3f37['rules'][_0x58e491][_0xaf87('0x67')]):_0x3f3f37[_0xaf87('0x65')][_0x58e491][_0xaf87('0x68')]+'\x20'+_0x3f3f37[_0xaf87('0x65')][_0x58e491][_0xaf87('0x69')]+(_0x20146d(_0x3f3f37[_0xaf87('0x65')][_0x58e491]['condition'])?'\x20'+_0x3f3f37[_0xaf87('0x65')][_0x58e491][_0xaf87('0x6a')]:'');}return _0x436179+')';};var _0xc72ad1={'where':{'id':_0xfa5b31[_0xaf87('0x45')]['id']}},_0x268d60,_0x292b9e,_0x39208e,_0x3adbaa,_0x305b56;_0xc72ad1=_[_0xaf87('0x3c')]({},_0xc72ad1,_0xfa5b31[_0xaf87('0x46')]);return db[_0xaf87('0x3f')][_0xaf87('0x47')](_0xc72ad1)[_0xaf87('0x21')](function(_0x48eab8){if(_0x48eab8){_0x268d60=_0x48eab8;return _0x48eab8[_0xaf87('0x6b')]();}return null;})[_0xaf87('0x21')](function(_0x285e42){if(_0x285e42){if(!_0x285e42['length']){throw new db[(_0xaf87('0x6c'))][(_0xaf87('0x6d'))](_0xaf87('0x6e'),0x193);}_0x292b9e=_0x285e42;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xaf87('0x21')](function(_0x32dc11){if(_0x32dc11){_0x39208e=_[_0xaf87('0x70')](_0x32dc11,'id');var _0x1c6729;var _0x4bd939=squel[_0xaf87('0x71')]();_0x4bd939['from'](_0x268d60[_0xaf87('0x72')]);for(var _0x217c45=0x0;_0x217c45<_0x292b9e['length'];_0x217c45+=0x1){_0x1c6729=_0x292b9e[_0x217c45][_0xaf87('0x73')]?_0x39208e[_0x292b9e[_0x217c45][_0xaf87('0x73')]][_0xaf87('0x74')]:_0x292b9e[_0x217c45]['field'];_0x1c6729=_0x292b9e[_0x217c45][_0xaf87('0x76')]?_[_0xaf87('0x75')](_0x3a2a57[_0x292b9e[_0x217c45][_0xaf87('0x76')]],'%s',_0x1c6729):_0x1c6729;_0x1c6729=_0x292b9e[_0x217c45]['format']?_[_0xaf87('0x75')](_0x236142[_0x292b9e[_0x217c45][_0xaf87('0x8d')]],'%s',_0x1c6729):_0x1c6729;if(_0x292b9e[_0x217c45][_0xaf87('0x77')]){_0x4bd939[_0xaf87('0x67')](_0x1c6729);}_0x292b9e[_0x217c45][_0xaf87('0x78')]&&_0x4bd939[_0xaf87('0x79')](_0x1c6729,_0x292b9e[_0x217c45]['orderBy']==='DESC'?![]:!![]);_0x4bd939[_0xaf87('0x68')](_0x1c6729,_0x292b9e[_0x217c45]['alias']||_0x1c6729);}if(_0x268d60['joins']){_0x268d60[_0xaf87('0x7c')]=JSON[_0xaf87('0x81')](_0x268d60['joins']);for(var _0xc6e764=0x0;_0xc6e764<_0x268d60['joins'][_0xaf87('0x37')];_0xc6e764+=0x1){if(_0x268d60['joins'][_0xc6e764][_0xaf87('0x2e')]&&_[_0xaf87('0x60')](_0x305edf,_0x268d60[_0xaf87('0x7c')][_0xc6e764][_0xaf87('0x2e')])&&_0x268d60['joins'][_0xc6e764][_0xaf87('0x7d')]&&_0x268d60[_0xaf87('0x7c')][_0xc6e764][_0xaf87('0x7e')]&&_0x268d60['joins'][_0xc6e764][_0xaf87('0x8e')]){_0x4bd939[_0x268d60[_0xaf87('0x7c')][_0xc6e764][_0xaf87('0x2e')]](_0x268d60['joins'][_0xc6e764][_0xaf87('0x7e')],null,util[_0xaf87('0x8d')](_0xaf87('0x7f'),_0x268d60[_0xaf87('0x72')],_0x268d60[_0xaf87('0x7c')][_0xc6e764][_0xaf87('0x7d')],_0x268d60[_0xaf87('0x7c')][_0xc6e764][_0xaf87('0x7e')],_0x268d60[_0xaf87('0x7c')][_0xc6e764][_0xaf87('0x8e')]));}}}if(_0x268d60[_0xaf87('0x80')]){_0x268d60[_0xaf87('0x80')]=JSON[_0xaf87('0x81')](_0x268d60['conditions']);_0x4bd939[_0xaf87('0x3a')](_0x12531a(_0x268d60[_0xaf87('0x80')]['group']));}_0x305b56=_0x4bd939[_0xaf87('0x82')]();_0x4bd939[_0xaf87('0x1a')](_0x5488f0);_0x4bd939[_0xaf87('0x18')](0x0);logger[_0xaf87('0x83')](_0xaf87('0xa7'),_0x4bd939['toString']());return dbH[_0xaf87('0x84')][_0xaf87('0x31')](_0x4bd939[_0xaf87('0x85')](),{'type':dbH[_0xaf87('0x84')][_0xaf87('0x86')][_0xaf87('0x87')]});}})[_0xaf87('0x21')](function(){return{'sql':_0x305b56[_0xaf87('0x85')]()};})[_0xaf87('0x21')](respondWithResult(_0x4d352d,null))['catch'](handleError(_0x4d352d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9375960..e207c1e 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 _0x1158=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x787e9d,_0x59ea62){var _0x4bf116=function(_0x47df0b){while(--_0x47df0b){_0x787e9d['push'](_0x787e9d['shift']());}};_0x4bf116(++_0x59ea62);}(_0x1158,0x8d));var _0x8115=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x1158[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x8115('0x0'));var util=require(_0x8115('0x1'));var logger=require(_0x8115('0x2'))(_0x8115('0x3'));var moment=require(_0x8115('0x4'));var BPromise=require(_0x8115('0x5'));var rp=require(_0x8115('0x6'));var fs=require('fs');var path=require(_0x8115('0x7'));var rimraf=require(_0x8115('0x8'));var config=require(_0x8115('0x9'));var attributes=require(_0x8115('0xa'));module[_0x8115('0xb')]=function(_0x15b2ae,_0x178030){return _0x15b2ae[_0x8115('0xc')]('AnalyticCustomReport',attributes,{'tableName':_0x8115('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4059=['../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','request-promise'];(function(_0x28e5f7,_0x18ce28){var _0x1ba4de=function(_0x3775dd){while(--_0x3775dd){_0x28e5f7['push'](_0x28e5f7['shift']());}};_0x1ba4de(++_0x18ce28);}(_0x4059,0x1c7));var _0x9405=function(_0x5d60d0,_0x406cb4){_0x5d60d0=_0x5d60d0-0x0;var _0x1ce8dd=_0x4059[_0x5d60d0];return _0x1ce8dd;};'use strict';var _=require(_0x9405('0x0'));var util=require(_0x9405('0x1'));var logger=require(_0x9405('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9405('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9405('0x4'));var attributes=require(_0x9405('0x5'));module[_0x9405('0x6')]=function(_0x54414a,_0x262a84){return _0x54414a[_0x9405('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0x9405('0x8'),'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 ba0c88c..494968b 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 _0xa096=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0x210d44,_0x2aee9b){var _0x4fd2f0=function(_0x3778c6){while(--_0x3778c6){_0x210d44['push'](_0x210d44['shift']());}};_0x4fd2f0(++_0x2aee9b);}(_0xa096,0x13d));var _0x6a09=function(_0x1823c8,_0x243627){_0x1823c8=_0x1823c8-0x0;var _0x5760f9=_0xa096[_0x1823c8];return _0x5760f9;};'use strict';var _=require(_0x6a09('0x0'));var util=require(_0x6a09('0x1'));var moment=require(_0x6a09('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a09('0x4'))['db'];var utils=require(_0x6a09('0x5'));var logger=require(_0x6a09('0x6'))(_0x6a09('0x7'));var config=require(_0x6a09('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29fde9,_0x190c17,_0xb34253){return new BPromise(function(_0x239bb0,_0x5d8229){return client[_0x6a09('0x9')](_0x29fde9,_0xb34253)[_0x6a09('0xa')](function(_0x5d09d3){logger[_0x6a09('0xb')](_0x6a09('0xc'),_0x190c17,'request\x20sent');logger['debug'](_0x6a09('0xd'),_0x190c17,_0x6a09('0xe'),JSON[_0x6a09('0xf')](_0x5d09d3));if(_0x5d09d3[_0x6a09('0x10')]){if(_0x5d09d3['error'][_0x6a09('0x11')]===0x1f4){logger[_0x6a09('0x10')](_0x6a09('0xc'),_0x190c17,_0x5d09d3[_0x6a09('0x10')]['message']);return _0x5d8229(_0x5d09d3[_0x6a09('0x10')][_0x6a09('0x12')]);}logger[_0x6a09('0x10')](_0x6a09('0xc'),_0x190c17,_0x5d09d3[_0x6a09('0x10')]['message']);return _0x239bb0(_0x5d09d3[_0x6a09('0x10')][_0x6a09('0x12')]);}else{logger[_0x6a09('0xb')](_0x6a09('0xc'),_0x190c17,'request\x20sent');_0x239bb0(_0x5d09d3[_0x6a09('0x13')]['message']);}})['catch'](function(_0x13e130){logger[_0x6a09('0x10')](_0x6a09('0xc'),_0x190c17,_0x13e130);_0x5d8229(_0x13e130);});});} \ No newline at end of file +var _0xc541=['moment','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','lodash'];(function(_0x52a295,_0x4f5804){var _0x2424e0=function(_0x315c2a){while(--_0x315c2a){_0x52a295['push'](_0x52a295['shift']());}};_0x2424e0(++_0x4f5804);}(_0xc541,0x8f));var _0x1c54=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0xc541[_0x35f7f5];return _0x5567a4;};'use strict';var _=require(_0x1c54('0x0'));var util=require('util');var moment=require(_0x1c54('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c54('0x2'));var config=require(_0x1c54('0x3'));var jayson=require(_0x1c54('0x4'));var client=jayson[_0x1c54('0x5')][_0x1c54('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x332b82,_0x577d7d,_0xa300ea){return new BPromise(function(_0x344ea7,_0x2575b2){return client[_0x1c54('0x7')](_0x332b82,_0xa300ea)['then'](function(_0x2dd8d8){logger[_0x1c54('0x8')]('AnalyticCustomReport,\x20%s,\x20%s',_0x577d7d,'request\x20sent');logger[_0x1c54('0x9')](_0x1c54('0xa'),_0x577d7d,_0x1c54('0xb'),JSON[_0x1c54('0xc')](_0x2dd8d8));if(_0x2dd8d8[_0x1c54('0xd')]){if(_0x2dd8d8[_0x1c54('0xd')]['code']===0x1f4){logger[_0x1c54('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x577d7d,_0x2dd8d8[_0x1c54('0xd')][_0x1c54('0xe')]);return _0x2575b2(_0x2dd8d8[_0x1c54('0xd')]['message']);}logger[_0x1c54('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x577d7d,_0x2dd8d8[_0x1c54('0xd')][_0x1c54('0xe')]);return _0x344ea7(_0x2dd8d8['error'][_0x1c54('0xe')]);}else{logger[_0x1c54('0x8')](_0x1c54('0xf'),_0x577d7d,_0x1c54('0xb'));_0x344ea7(_0x2dd8d8['result'][_0x1c54('0xe')]);}})['catch'](function(_0x21f065){logger[_0x1c54('0xd')](_0x1c54('0xf'),_0x577d7d,_0x21f065);_0x2575b2(_0x21f065);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0483d27..599299a 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 _0x8693=['/:id/run','run','/:id/query','query','post','create','put','update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','preview'];(function(_0x42dffa,_0x5431a3){var _0x40293a=function(_0x4a392c){while(--_0x4a392c){_0x42dffa['push'](_0x42dffa['shift']());}};_0x40293a(++_0x5431a3);}(_0x8693,0x1d7));var _0x3869=function(_0x9b6ce7,_0x18816e){_0x9b6ce7=_0x9b6ce7-0x0;var _0x350863=_0x8693[_0x9b6ce7];return _0x350863;};'use strict';var multer=require(_0x3869('0x0'));var util=require(_0x3869('0x1'));var path=require(_0x3869('0x2'));var timeout=require('connect-timeout');var express=require(_0x3869('0x3'));var router=express['Router']();var fs_extra=require(_0x3869('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3869('0x5'));var config=require(_0x3869('0x6'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x3869('0x7')](),controller[_0x3869('0x8')]);router[_0x3869('0x9')](_0x3869('0xa'),auth['isAuthenticated'](),controller[_0x3869('0xb')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x3869('0xc')]);router[_0x3869('0x9')](_0x3869('0xd'),auth[_0x3869('0x7')](),controller[_0x3869('0xe')]);router[_0x3869('0x9')](_0x3869('0xf'),auth[_0x3869('0x7')](),controller[_0x3869('0x10')]);router[_0x3869('0x11')]('/',auth[_0x3869('0x7')](),controller[_0x3869('0x12')]);router[_0x3869('0x13')](_0x3869('0xa'),auth[_0x3869('0x7')](),controller[_0x3869('0x14')]);router['delete'](_0x3869('0xa'),auth[_0x3869('0x7')](),controller['destroy']);module[_0x3869('0x15')]=router; \ No newline at end of file +var _0x6946=['isAuthenticated','index','/:id','show','preview','/:id/run','run','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x6946,0xbf));var _0x6694=function(_0x466ffe,_0x34706b){_0x466ffe=_0x466ffe-0x0;var _0x10e04d=_0x6946[_0x466ffe];return _0x10e04d;};'use strict';var multer=require(_0x6694('0x0'));var util=require('util');var path=require(_0x6694('0x1'));var timeout=require(_0x6694('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6694('0x3'));var auth=require(_0x6694('0x4'));var interaction=require(_0x6694('0x5'));var config=require(_0x6694('0x6'));var controller=require(_0x6694('0x7'));router[_0x6694('0x8')]('/',auth[_0x6694('0x9')](),controller[_0x6694('0xa')]);router[_0x6694('0x8')](_0x6694('0xb'),auth['isAuthenticated'](),controller[_0x6694('0xc')]);router['get']('/:id/preview',auth[_0x6694('0x9')](),controller[_0x6694('0xd')]);router[_0x6694('0x8')](_0x6694('0xe'),auth[_0x6694('0x9')](),controller[_0x6694('0xf')]);router[_0x6694('0x8')]('/:id/query',auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x6694('0x9')](),controller['create']);router[_0x6694('0x10')](_0x6694('0xb'),auth[_0x6694('0x9')](),controller['update']);router[_0x6694('0x11')](_0x6694('0xb'),auth[_0x6694('0x9')](),controller[_0x6694('0x12')]);module[_0x6694('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c4e499e..20ecca7 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['sequelize','STRING'];(function(_0x30df3b,_0x90abb5){var _0xe1b865=function(_0x290722){while(--_0x290722){_0x30df3b['push'](_0x30df3b['shift']());}};_0xe1b865(++_0x90abb5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2ad8cc,_0x12275d){_0x2ad8cc=_0x2ad8cc-0x0;var _0x34e054=_0xbd51[_0x2ad8cc];return _0x34e054;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x502c44,_0x35405c){var _0x4ffbcf=function(_0x3df300){while(--_0x3df300){_0x502c44['push'](_0x502c44['shift']());}};_0x4ffbcf(++_0x35405c);}(_0xb138,0x1dd));var _0x8b13=function(_0x55b44c,_0x4a070a){_0x55b44c=_0x55b44c-0x0;var _0x768ac6=_0xb138[_0x55b44c];return _0x768ac6;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('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 62eaed7..9151bcf 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x25acfc,_0x4ca8d3){var _0x1285be=function(_0x558e77){while(--_0x558e77){_0x25acfc['push'](_0x25acfc['shift']());}};_0x1285be(++_0x4ca8d3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x5fc3[_0x191154];return _0x3dcd73;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%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','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','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','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x2c0bb4,_0xd83a7a){var _0x6a14eb=function(_0x4ac762){while(--_0x4ac762){_0x2c0bb4['push'](_0x2c0bb4['shift']());}};_0x6a14eb(++_0xd83a7a);}(_0x814b,0x1a2));var _0xb814=function(_0x269e23,_0x14d11c){_0x269e23=_0x269e23-0x0;var _0x69ad53=_0x814b[_0x269e23];return _0x69ad53;};'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'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index bb3bafd..4c6f5dd 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 _0x718f=['request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment'];(function(_0x5f52e4,_0x5a69b3){var _0x25148b=function(_0x461a44){while(--_0x461a44){_0x5f52e4['push'](_0x5f52e4['shift']());}};_0x25148b(++_0x5a69b3);}(_0x718f,0x128));var _0xf718=function(_0x129fa8,_0x3dba2a){_0x129fa8=_0x129fa8-0x0;var _0x546bab=_0x718f[_0x129fa8];return _0x546bab;};'use strict';var _=require(_0xf718('0x0'));var util=require('util');var logger=require(_0xf718('0x1'))(_0xf718('0x2'));var moment=require(_0xf718('0x3'));var BPromise=require('bluebird');var rp=require(_0xf718('0x4'));var fs=require('fs');var path=require(_0xf718('0x5'));var rimraf=require(_0xf718('0x6'));var config=require('../../config/environment');var attributes=require(_0xf718('0x7'));module[_0xf718('0x8')]=function(_0x4d8631,_0x1893bf){return _0x4d8631[_0xf718('0x9')](_0xf718('0xa'),attributes,{'tableName':_0xf718('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f71=['rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','moment','request-promise'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x3f71,0x109));var _0x13f7=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x3f71[_0x2b8077];return _0x308091;};'use strict';var _=require(_0x13f7('0x0'));var util=require('util');var logger=require(_0x13f7('0x1'))(_0x13f7('0x2'));var moment=require(_0x13f7('0x3'));var BPromise=require('bluebird');var rp=require(_0x13f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13f7('0x5'));var config=require('../../config/environment');var attributes=require(_0x13f7('0x6'));module[_0x13f7('0x7')]=function(_0x270f63,_0x498da1){return _0x270f63[_0x13f7('0x8')](_0x13f7('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 3820e94..f1e56f9 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 _0xf02f=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request'];(function(_0x4d9dc7,_0x38ee05){var _0x18780a=function(_0x1ed086){while(--_0x1ed086){_0x4d9dc7['push'](_0x4d9dc7['shift']());}};_0x18780a(++_0x38ee05);}(_0xf02f,0xbc));var _0xff02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf02f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xff02('0x0'));var util=require(_0xff02('0x1'));var moment=require(_0xff02('0x2'));var BPromise=require(_0xff02('0x3'));var rs=require(_0xff02('0x4'));var fs=require('fs');var Redis=require(_0xff02('0x5'));var db=require(_0xff02('0x6'))['db'];var utils=require(_0xff02('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xff02('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53df27,_0x7c02dd,_0x55218e){return new BPromise(function(_0x4f24b2,_0x29fad0){return client[_0xff02('0x9')](_0x53df27,_0x55218e)[_0xff02('0xa')](function(_0x586ee2){logger['info'](_0xff02('0xb'),_0x7c02dd,_0xff02('0xc'));logger[_0xff02('0xd')](_0xff02('0xe'),_0x7c02dd,_0xff02('0xc'),JSON[_0xff02('0xf')](_0x586ee2));if(_0x586ee2[_0xff02('0x10')]){if(_0x586ee2[_0xff02('0x10')][_0xff02('0x11')]===0x1f4){logger[_0xff02('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c02dd,_0x586ee2[_0xff02('0x10')]['message']);return _0x29fad0(_0x586ee2[_0xff02('0x10')]['message']);}logger[_0xff02('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c02dd,_0x586ee2[_0xff02('0x10')][_0xff02('0x12')]);return _0x4f24b2(_0x586ee2[_0xff02('0x10')]['message']);}else{logger[_0xff02('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c02dd,_0xff02('0xc'));_0x4f24b2(_0x586ee2[_0xff02('0x14')][_0xff02('0x12')]);}})[_0xff02('0x15')](function(_0x4cbd26){logger[_0xff02('0x10')](_0xff02('0xb'),_0x7c02dd,_0x4cbd26);_0x29fad0(_0x4cbd26);});});} \ No newline at end of file +var _0x34b5=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x34b5,0x114));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x534b('0x0'));var util=require(_0x534b('0x1'));var moment=require(_0x534b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x534b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x534b('0x4'));var logger=require(_0x534b('0x5'))(_0x534b('0x6'));var config=require(_0x534b('0x7'));var jayson=require(_0x534b('0x8'));var client=jayson[_0x534b('0x9')][_0x534b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9d06f1,_0x2ac54a,_0x560920){return new BPromise(function(_0x2aa21e,_0x313c9a){return client[_0x534b('0xb')](_0x9d06f1,_0x560920)[_0x534b('0xc')](function(_0x200297){logger[_0x534b('0xd')](_0x534b('0xe'),_0x2ac54a,_0x534b('0xf'));logger[_0x534b('0x10')](_0x534b('0x11'),_0x2ac54a,_0x534b('0xf'),JSON['stringify'](_0x200297));if(_0x200297[_0x534b('0x12')]){if(_0x200297[_0x534b('0x12')][_0x534b('0x13')]===0x1f4){logger['error'](_0x534b('0xe'),_0x2ac54a,_0x200297[_0x534b('0x12')][_0x534b('0x14')]);return _0x313c9a(_0x200297[_0x534b('0x12')][_0x534b('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2ac54a,_0x200297[_0x534b('0x12')][_0x534b('0x14')]);return _0x2aa21e(_0x200297['error'][_0x534b('0x14')]);}else{logger[_0x534b('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2ac54a,_0x534b('0xf'));_0x2aa21e(_0x200297[_0x534b('0x15')][_0x534b('0x14')]);}})[_0x534b('0x16')](function(_0x1e1eb1){logger[_0x534b('0x12')](_0x534b('0xe'),_0x2ac54a,_0x1e1eb1);_0x313c9a(_0x1e1eb1);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 1015d21..9c85e70 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 _0x757b=['query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query'];(function(_0x200bec,_0x1a697e){var _0x42c7df=function(_0x2c2b6a){while(--_0x2c2b6a){_0x200bec['push'](_0x200bec['shift']());}};_0x42c7df(++_0x1a697e);}(_0x757b,0x7a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb757('0x0'));var util=require('util');var path=require(_0xb757('0x1'));var timeout=require(_0xb757('0x2'));var express=require(_0xb757('0x3'));var router=express['Router']();var fs_extra=require(_0xb757('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb757('0x5'));var config=require('../../config/environment');var controller=require(_0xb757('0x6'));router[_0xb757('0x7')]('/',auth[_0xb757('0x8')](),controller[_0xb757('0x9')]);router[_0xb757('0x7')](_0xb757('0xa'),auth[_0xb757('0x8')](),controller[_0xb757('0xb')]);router['get'](_0xb757('0xc'),auth[_0xb757('0x8')](),controller[_0xb757('0xd')]);router[_0xb757('0x7')]('/:id/run',auth[_0xb757('0x8')](),controller[_0xb757('0xe')]);router[_0xb757('0x7')](_0xb757('0xf'),auth['isAuthenticated'](),controller[_0xb757('0x10')]);router['post']('/',auth[_0xb757('0x8')](),controller[_0xb757('0x11')]);router[_0xb757('0x12')](_0xb757('0xa'),auth[_0xb757('0x8')](),controller[_0xb757('0x13')]);router[_0xb757('0x14')](_0xb757('0xa'),auth[_0xb757('0x8')](),controller[_0xb757('0x15')]);module[_0xb757('0x16')]=router; \ No newline at end of file +var _0x6d00=['/:id/query','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run'];(function(_0x565cc6,_0x1ec418){var _0x168820=function(_0x6e340a){while(--_0x6e340a){_0x565cc6['push'](_0x565cc6['shift']());}};_0x168820(++_0x1ec418);}(_0x6d00,0x11b));var _0x06d0=function(_0x33504d,_0xf81588){_0x33504d=_0x33504d-0x0;var _0x5ee631=_0x6d00[_0x33504d];return _0x5ee631;};'use strict';var multer=require('multer');var util=require(_0x06d0('0x0'));var path=require(_0x06d0('0x1'));var timeout=require(_0x06d0('0x2'));var express=require('express');var router=express[_0x06d0('0x3')]();var fs_extra=require(_0x06d0('0x4'));var auth=require(_0x06d0('0x5'));var interaction=require(_0x06d0('0x6'));var config=require(_0x06d0('0x7'));var controller=require(_0x06d0('0x8'));router['get']('/',auth[_0x06d0('0x9')](),controller[_0x06d0('0xa')]);router[_0x06d0('0xb')](_0x06d0('0xc'),auth[_0x06d0('0x9')](),controller['show']);router['get'](_0x06d0('0xd'),auth[_0x06d0('0x9')](),controller[_0x06d0('0xe')]);router[_0x06d0('0xb')](_0x06d0('0xf'),auth[_0x06d0('0x9')](),controller['run']);router[_0x06d0('0xb')](_0x06d0('0x10'),auth[_0x06d0('0x9')](),controller['query']);router[_0x06d0('0x11')]('/',auth[_0x06d0('0x9')](),controller[_0x06d0('0x12')]);router[_0x06d0('0x13')]('/:id',auth[_0x06d0('0x9')](),controller[_0x06d0('0x14')]);router[_0x06d0('0x15')](_0x06d0('0xc'),auth[_0x06d0('0x9')](),controller[_0x06d0('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 21edc16..31d9c18 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 _0x65c7=['STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x91a34b,_0x21b8b5){var _0x257b89=function(_0x353ee8){while(--_0x353ee8){_0x91a34b['push'](_0x91a34b['shift']());}};_0x257b89(++_0x21b8b5);}(_0x65c7,0xb3));var _0x765c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65c7[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x765c('0x0'));var moment=require(_0x765c('0x1'));module[_0x765c('0x2')]={'name':{'type':Sequelize[_0x765c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x765c('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x765c('0x4')](_0x765c('0x5'),_0x765c('0x6'),_0x765c('0x7')),'allowNull':![],'defaultValue':_0x765c('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x765c('0x8')]},'endDate':{'type':Sequelize[_0x765c('0x8')]},'status':{'type':Sequelize[_0x765c('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x765c('0x9'),_0x765c('0xa')),'allowNull':![],'defaultValue':_0x765c('0x9')},'reportId':{'type':Sequelize[_0x765c('0xb')](0xb)[_0x765c('0xc')]},'reportType':{'type':Sequelize[_0x765c('0x3')]}}; \ No newline at end of file +var _0x84a5=['pdf','xlsx','DATE','Loading','manual','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x14e142,_0xb7fe8d){var _0x3ad413=function(_0x57f761){while(--_0x57f761){_0x14e142['push'](_0x14e142['shift']());}};_0x3ad413(++_0xb7fe8d);}(_0x84a5,0x16e));var _0x584a=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x84a5[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x584a('0x0'));var moment=require(_0x584a('0x1'));module[_0x584a('0x2')]={'name':{'type':Sequelize[_0x584a('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x584a('0x4')](_0x584a('0x5'),_0x584a('0x6'),_0x584a('0x7')),'allowNull':![],'defaultValue':_0x584a('0x5')},'savename':{'type':Sequelize[_0x584a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x584a('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x584a('0x3')],'defaultValue':_0x584a('0x9')},'type':{'type':Sequelize[_0x584a('0x4')](_0x584a('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x584a('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x584a('0xb')]},'reportType':{'type':Sequelize[_0x584a('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e1697cb..1db4610 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 _0xc780=['AnalyticExtractedReport','includeAll','include','rows','catch','show','params','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','output','existsSync','join','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','update','destroy','then','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0xc780,0xd9));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c78('0x0'));var rimraf=require(_0x0c78('0x1'));var zipdir=require(_0x0c78('0x2'));var jsonpatch=require(_0x0c78('0x3'));var rp=require(_0x0c78('0x4'));var moment=require(_0x0c78('0x5'));var BPromise=require(_0x0c78('0x6'));var Mustache=require('mustache');var util=require(_0x0c78('0x7'));var path=require(_0x0c78('0x8'));var sox=require(_0x0c78('0x9'));var csv=require('to-csv');var ejs=require(_0x0c78('0xa'));var fs=require('fs');var fs_extra=require(_0x0c78('0xb'));var _=require(_0x0c78('0xc'));var squel=require(_0x0c78('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c78('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0c78('0xf'));var Papa=require(_0x0c78('0x10'));var Redis=require(_0x0c78('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0c78('0x12'));var hardwareService=require(_0x0c78('0x13'));var logger=require(_0x0c78('0x14'))(_0x0c78('0x15'));var utils=require(_0x0c78('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0c78('0x17'));var db=require(_0x0c78('0x18'))['db'];function respondWithStatusCode(_0xc5c1f9,_0x240e24){_0x240e24=_0x240e24||0xcc;return function(_0x164802){if(_0x164802){return _0xc5c1f9['sendStatus'](_0x240e24);}return _0xc5c1f9['status'](_0x240e24)[_0x0c78('0x19')]();};}function respondWithResult(_0x33da42,_0x5d0d64){_0x5d0d64=_0x5d0d64||0xc8;return function(_0x1a9012){if(_0x1a9012){return _0x33da42[_0x0c78('0x1a')](_0x5d0d64)[_0x0c78('0x1b')](_0x1a9012);}};}function respondWithFilteredResult(_0x40cf71,_0x4787bd){return function(_0x422f49){if(_0x422f49){var _0x3b213f=typeof _0x4787bd[_0x0c78('0x1c')]===_0x0c78('0x1d')&&typeof _0x4787bd[_0x0c78('0x1e')]===_0x0c78('0x1d');var _0x3e5956=_0x422f49[_0x0c78('0x1f')];var _0x41450c=_0x3b213f?0x0:_0x4787bd[_0x0c78('0x1c')];var _0x115ce6=_0x3b213f?_0x422f49['count']:_0x4787bd['offset']+_0x4787bd[_0x0c78('0x1e')];var _0x23382e;if(_0x115ce6>=_0x3e5956){_0x115ce6=_0x3e5956;_0x23382e=0xc8;}else{_0x23382e=0xce;}_0x40cf71['status'](_0x23382e);return _0x40cf71['set']('Content-Range',_0x41450c+'-'+_0x115ce6+'/'+_0x3e5956)['json'](_0x422f49);}return null;};}function patchUpdates(_0xc9a28e){return function(_0x36bba6){try{jsonpatch[_0x0c78('0x20')](_0x36bba6,_0xc9a28e,!![]);}catch(_0x1f9060){return BPromise['reject'](_0x1f9060);}return _0x36bba6['save']();};}function saveUpdates(_0x292f7c,_0x36f481){return function(_0x442485){if(_0x442485){return _0x442485[_0x0c78('0x21')](_0x292f7c)['then'](function(_0x4607c4){return _0x4607c4;});}return null;};}function removeEntity(_0x59087e,_0xae6009){return function(_0x17b8ec){if(_0x17b8ec){return _0x17b8ec[_0x0c78('0x22')]()[_0x0c78('0x23')](function(){var _0x3b13c5=_0x17b8ec[_0x0c78('0x24')]({'plain':!![]});var _0xa43e2a=_0x0c78('0x25');return db[_0x0c78('0x26')][_0x0c78('0x22')]({'where':{'type':_0xa43e2a,'resourceId':_0x3b13c5['id']}})[_0x0c78('0x23')](function(){return _0x17b8ec;});})[_0x0c78('0x23')](function(){_0x59087e['status'](0xcc)[_0x0c78('0x19')]();});}};}function handleEntityNotFound(_0x5ac821,_0x4928eb){return function(_0xe65a6){if(!_0xe65a6){_0x5ac821[_0x0c78('0x27')](0x194);}return _0xe65a6;};}function handleError(_0x55845a,_0x4eb00e){_0x4eb00e=_0x4eb00e||0x1f4;return function(_0x23e1b9){logger[_0x0c78('0x28')](_0x23e1b9[_0x0c78('0x29')]);if(_0x23e1b9[_0x0c78('0x2a')]){delete _0x23e1b9[_0x0c78('0x2a')];}_0x55845a['status'](_0x4eb00e)[_0x0c78('0x2b')](_0x23e1b9);};}exports[_0x0c78('0x2c')]=function(_0x12069e,_0x5e4ba2){var _0x25d700={},_0x4e4c9e={},_0x1087ba={'count':0x0,'rows':[]};var _0x2f9940=_[_0x0c78('0x2d')](db['AnalyticExtractedReport'][_0x0c78('0x2e')],function(_0x429daf){return{'name':_0x429daf['fieldName'],'type':_0x429daf[_0x0c78('0x2f')][_0x0c78('0x30')]};});_0x4e4c9e[_0x0c78('0x31')]=_['map'](_0x2f9940,_0x0c78('0x2a'));_0x4e4c9e[_0x0c78('0x32')]=_['keys'](_0x12069e[_0x0c78('0x32')]);_0x4e4c9e[_0x0c78('0x33')]=_['intersection'](_0x4e4c9e['model'],_0x4e4c9e['query']);_0x25d700[_0x0c78('0x34')]=_['intersection'](_0x4e4c9e[_0x0c78('0x31')],qs[_0x0c78('0x35')](_0x12069e[_0x0c78('0x32')][_0x0c78('0x35')]));_0x25d700[_0x0c78('0x34')]=_0x25d700[_0x0c78('0x34')][_0x0c78('0x36')]?_0x25d700[_0x0c78('0x34')]:_0x4e4c9e[_0x0c78('0x31')];if(!_0x12069e[_0x0c78('0x32')]['hasOwnProperty'](_0x0c78('0x37'))){_0x25d700[_0x0c78('0x1e')]=qs[_0x0c78('0x1e')](_0x12069e['query'][_0x0c78('0x1e')]);_0x25d700[_0x0c78('0x1c')]=qs[_0x0c78('0x1c')](_0x12069e[_0x0c78('0x32')][_0x0c78('0x1c')]);}_0x25d700['order']=qs['sort'](_0x12069e[_0x0c78('0x32')][_0x0c78('0x38')]);_0x25d700[_0x0c78('0x39')]=qs['filters'](_[_0x0c78('0x3a')](_0x12069e[_0x0c78('0x32')],_0x4e4c9e[_0x0c78('0x33')]),_0x2f9940);if(_0x12069e['query']['filter']){_0x25d700['where']=_['merge'](_0x25d700[_0x0c78('0x39')],{'$or':_['map'](_0x2f9940,function(_0x208eec){if(_0x208eec[_0x0c78('0x2f')]!=='VIRTUAL'){var _0x59988e={};_0x59988e[_0x208eec['name']]={'$like':'%'+_0x12069e[_0x0c78('0x32')][_0x0c78('0x3b')]+'%'};return _0x59988e;}})});}_0x25d700=_[_0x0c78('0x3c')]({},_0x25d700,_0x12069e[_0x0c78('0x3d')]);var _0x39c8d9={'where':_0x25d700[_0x0c78('0x39')]};return db[_0x0c78('0x3e')]['count'](_0x39c8d9)[_0x0c78('0x23')](function(_0x5c8368){_0x1087ba[_0x0c78('0x1f')]=_0x5c8368;if(_0x12069e['query'][_0x0c78('0x3f')]){_0x25d700[_0x0c78('0x40')]=[{'all':!![]}];}return db[_0x0c78('0x3e')]['findAll'](_0x25d700);})[_0x0c78('0x23')](function(_0x1ae781){_0x1087ba[_0x0c78('0x41')]=_0x1ae781;return _0x1087ba;})[_0x0c78('0x23')](respondWithFilteredResult(_0x5e4ba2,_0x25d700))[_0x0c78('0x42')](handleError(_0x5e4ba2,null));};exports[_0x0c78('0x43')]=function(_0x5623bb,_0x44c035){var _0x2a7008={'raw':!![],'where':{'id':_0x5623bb[_0x0c78('0x44')]['id']}},_0x42b03d={};_0x42b03d[_0x0c78('0x31')]=_[_0x0c78('0x45')](db[_0x0c78('0x3e')][_0x0c78('0x2e')]);_0x42b03d[_0x0c78('0x32')]=_[_0x0c78('0x45')](_0x5623bb['query']);_0x42b03d[_0x0c78('0x33')]=_[_0x0c78('0x46')](_0x42b03d[_0x0c78('0x31')],_0x42b03d[_0x0c78('0x32')]);_0x2a7008['attributes']=_[_0x0c78('0x46')](_0x42b03d[_0x0c78('0x31')],qs[_0x0c78('0x35')](_0x5623bb['query'][_0x0c78('0x35')]));_0x2a7008['attributes']=_0x2a7008[_0x0c78('0x34')]['length']?_0x2a7008[_0x0c78('0x34')]:_0x42b03d[_0x0c78('0x31')];if(_0x5623bb[_0x0c78('0x32')][_0x0c78('0x3f')]){_0x2a7008[_0x0c78('0x40')]=[{'all':!![]}];}_0x2a7008=_[_0x0c78('0x3c')]({},_0x2a7008,_0x5623bb['options']);return db[_0x0c78('0x3e')][_0x0c78('0x47')](_0x2a7008)[_0x0c78('0x23')](handleEntityNotFound(_0x44c035,null))[_0x0c78('0x23')](respondWithResult(_0x44c035,null))[_0x0c78('0x42')](handleError(_0x44c035,null));};exports[_0x0c78('0x48')]=function(_0x3a055f,_0x38ebf1){return db['AnalyticExtractedReport'][_0x0c78('0x48')](_0x3a055f['body'],{})[_0x0c78('0x23')](function(_0x468aa6){var _0x54bf0a=_0x3a055f[_0x0c78('0x49')][_0x0c78('0x24')]({'plain':!![]});if(!_0x54bf0a)throw new Error(_0x0c78('0x4a'));if(_0x54bf0a['role']==='user'){var _0x3dd323=_0x468aa6[_0x0c78('0x24')]({'plain':!![]});var _0x4f2eed=_0x0c78('0x25');return db[_0x0c78('0x4b')][_0x0c78('0x47')]({'where':{'name':_0x4f2eed,'userProfileId':_0x54bf0a[_0x0c78('0x4c')]},'raw':!![]})[_0x0c78('0x23')](function(_0x191e31){if(_0x191e31&&_0x191e31[_0x0c78('0x4d')]===0x0){return db[_0x0c78('0x26')][_0x0c78('0x48')]({'name':_0x3dd323[_0x0c78('0x2a')],'resourceId':_0x3dd323['id'],'type':_0x191e31[_0x0c78('0x2a')],'sectionId':_0x191e31['id']},{})[_0x0c78('0x23')](function(){return _0x468aa6;});}else{return _0x468aa6;}})[_0x0c78('0x42')](function(_0x7e297f){logger[_0x0c78('0x28')](_0x0c78('0x4e'),_0x7e297f);throw _0x7e297f;});}return _0x468aa6;})[_0x0c78('0x23')](respondWithResult(_0x38ebf1,0xc9))[_0x0c78('0x42')](handleError(_0x38ebf1,null));};exports['update']=function(_0x2954d4,_0x75bd73){if(_0x2954d4[_0x0c78('0x4f')]['id']){delete _0x2954d4['body']['id'];}return db[_0x0c78('0x3e')][_0x0c78('0x47')]({'where':{'id':_0x2954d4[_0x0c78('0x44')]['id']}})[_0x0c78('0x23')](handleEntityNotFound(_0x75bd73,null))[_0x0c78('0x23')](saveUpdates(_0x2954d4['body'],null))[_0x0c78('0x23')](respondWithResult(_0x75bd73,null))[_0x0c78('0x42')](handleError(_0x75bd73,null));};exports[_0x0c78('0x22')]=function(_0x4a1121,_0xbdda5f){return db[_0x0c78('0x3e')]['find']({'where':{'id':_0x4a1121[_0x0c78('0x44')]['id']}})['then'](handleEntityNotFound(_0xbdda5f,null))['then'](removeEntity(_0xbdda5f,null))[_0x0c78('0x42')](handleError(_0xbdda5f,null));};exports[_0x0c78('0x50')]=function(_0xa01ce,_0x3ba92c,_0x4c60c0){return db[_0x0c78('0x3e')][_0x0c78('0x47')]({'where':{'id':_0xa01ce['params']['id']},'attributes':[_0x0c78('0x2a'),'basename','savename',_0x0c78('0x51')],'raw':!![]})[_0x0c78('0x23')](handleEntityNotFound(_0x3ba92c,null))[_0x0c78('0x23')](function(_0x41d774){if(_0x41d774){if(!fs[_0x0c78('0x52')](path[_0x0c78('0x53')](config[_0x0c78('0x54')],_0x0c78('0x55'),_0x41d774[_0x0c78('0x56')]))){throw new db[(_0x0c78('0x57'))]['ValidationError'](_0x0c78('0x58'));}if(_0xa01ce[_0x0c78('0x32')]['exists']){return _0x3ba92c[_0x0c78('0x27')](0xc8);}return _0x3ba92c[_0x0c78('0x50')](path[_0x0c78('0x53')](config[_0x0c78('0x54')],_0x0c78('0x55'),_0x41d774[_0x0c78('0x56')]),util[_0x0c78('0x59')](_0x0c78('0x5a'),_0x41d774[_0x0c78('0x5b')]||_0x41d774['name'],_0x41d774['output'][_0x0c78('0x5c')]()));}})[_0x0c78('0x42')](handleError(_0x3ba92c,null));}; \ No newline at end of file +var _0x8762=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','count','includeAll','include','rows','catch','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','output','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','basename','toLowerCase','eml-format'];(function(_0x3e45b9,_0x4a26d1){var _0x2c76d8=function(_0x566159){while(--_0x566159){_0x3e45b9['push'](_0x3e45b9['shift']());}};_0x2c76d8(++_0x4a26d1);}(_0x8762,0x1f3));var _0x2876=function(_0x581aaa,_0x28fbaa){_0x581aaa=_0x581aaa-0x0;var _0x1e22b9=_0x8762[_0x581aaa];return _0x1e22b9;};'use strict';var emlformat=require(_0x2876('0x0'));var rimraf=require(_0x2876('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2876('0x2'));var rp=require('request-promise');var moment=require(_0x2876('0x3'));var BPromise=require(_0x2876('0x4'));var Mustache=require(_0x2876('0x5'));var util=require(_0x2876('0x6'));var path=require(_0x2876('0x7'));var sox=require(_0x2876('0x8'));var csv=require(_0x2876('0x9'));var ejs=require(_0x2876('0xa'));var fs=require('fs');var fs_extra=require(_0x2876('0xb'));var _=require(_0x2876('0xc'));var squel=require(_0x2876('0xd'));var crypto=require(_0x2876('0xe'));var jsforce=require(_0x2876('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2876('0x9'));var querystring=require('querystring');var Papa=require(_0x2876('0x10'));var Redis=require(_0x2876('0x11'));var authService=require(_0x2876('0x12'));var qs=require(_0x2876('0x13'));var as=require(_0x2876('0x14'));var hardwareService=require(_0x2876('0x15'));var logger=require(_0x2876('0x16'))(_0x2876('0x17'));var utils=require(_0x2876('0x18'));var config=require(_0x2876('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2876('0x1a'))['db'];function respondWithStatusCode(_0x421523,_0x55eb3f){_0x55eb3f=_0x55eb3f||0xcc;return function(_0x27b527){if(_0x27b527){return _0x421523[_0x2876('0x1b')](_0x55eb3f);}return _0x421523[_0x2876('0x1c')](_0x55eb3f)[_0x2876('0x1d')]();};}function respondWithResult(_0x299dcf,_0x5638d7){_0x5638d7=_0x5638d7||0xc8;return function(_0x4fda63){if(_0x4fda63){return _0x299dcf['status'](_0x5638d7)['json'](_0x4fda63);}};}function respondWithFilteredResult(_0x496d57,_0x6d839d){return function(_0x39d3a6){if(_0x39d3a6){var _0x326b74=typeof _0x6d839d['offset']===_0x2876('0x1e')&&typeof _0x6d839d[_0x2876('0x1f')]===_0x2876('0x1e');var _0x45fa94=_0x39d3a6['count'];var _0x21cdfd=_0x326b74?0x0:_0x6d839d[_0x2876('0x20')];var _0xb95c78=_0x326b74?_0x39d3a6['count']:_0x6d839d[_0x2876('0x20')]+_0x6d839d[_0x2876('0x1f')];var _0x7eb9d4;if(_0xb95c78>=_0x45fa94){_0xb95c78=_0x45fa94;_0x7eb9d4=0xc8;}else{_0x7eb9d4=0xce;}_0x496d57[_0x2876('0x1c')](_0x7eb9d4);return _0x496d57[_0x2876('0x21')](_0x2876('0x22'),_0x21cdfd+'-'+_0xb95c78+'/'+_0x45fa94)[_0x2876('0x23')](_0x39d3a6);}return null;};}function patchUpdates(_0xa9906d){return function(_0x410152){try{jsonpatch[_0x2876('0x24')](_0x410152,_0xa9906d,!![]);}catch(_0x5b0e13){return BPromise[_0x2876('0x25')](_0x5b0e13);}return _0x410152[_0x2876('0x26')]();};}function saveUpdates(_0x15670d,_0x3b465a){return function(_0x5c367f){if(_0x5c367f){return _0x5c367f[_0x2876('0x27')](_0x15670d)['then'](function(_0x23fe7c){return _0x23fe7c;});}return null;};}function removeEntity(_0x4bc84f,_0x5b3763){return function(_0x3f4b51){if(_0x3f4b51){return _0x3f4b51['destroy']()[_0x2876('0x28')](function(){var _0x48b4db=_0x3f4b51[_0x2876('0x29')]({'plain':!![]});var _0xc87dd5='ExtractedReports';return db[_0x2876('0x2a')][_0x2876('0x2b')]({'where':{'type':_0xc87dd5,'resourceId':_0x48b4db['id']}})[_0x2876('0x28')](function(){return _0x3f4b51;});})['then'](function(){_0x4bc84f[_0x2876('0x1c')](0xcc)[_0x2876('0x1d')]();});}};}function handleEntityNotFound(_0x49525f,_0x3006fd){return function(_0x5259c4){if(!_0x5259c4){_0x49525f[_0x2876('0x1b')](0x194);}return _0x5259c4;};}function handleError(_0x20a6f4,_0x261b77){_0x261b77=_0x261b77||0x1f4;return function(_0xa57ab){logger['error'](_0xa57ab['stack']);if(_0xa57ab[_0x2876('0x2c')]){delete _0xa57ab[_0x2876('0x2c')];}_0x20a6f4[_0x2876('0x1c')](_0x261b77)[_0x2876('0x2d')](_0xa57ab);};}exports[_0x2876('0x2e')]=function(_0x398d7d,_0x17ff7b){var _0x19a657={},_0x5db568={},_0x1eed0b={'count':0x0,'rows':[]};var _0x3cf264=_[_0x2876('0x2f')](db[_0x2876('0x30')][_0x2876('0x31')],function(_0x418de3){return{'name':_0x418de3[_0x2876('0x32')],'type':_0x418de3[_0x2876('0x33')][_0x2876('0x34')]};});_0x5db568['model']=_[_0x2876('0x2f')](_0x3cf264,_0x2876('0x2c'));_0x5db568[_0x2876('0x35')]=_[_0x2876('0x36')](_0x398d7d[_0x2876('0x35')]);_0x5db568[_0x2876('0x37')]=_['intersection'](_0x5db568[_0x2876('0x38')],_0x5db568['query']);_0x19a657[_0x2876('0x39')]=_[_0x2876('0x3a')](_0x5db568[_0x2876('0x38')],qs[_0x2876('0x3b')](_0x398d7d['query']['fields']));_0x19a657[_0x2876('0x39')]=_0x19a657[_0x2876('0x39')][_0x2876('0x3c')]?_0x19a657[_0x2876('0x39')]:_0x5db568['model'];if(!_0x398d7d[_0x2876('0x35')][_0x2876('0x3d')](_0x2876('0x3e'))){_0x19a657[_0x2876('0x1f')]=qs[_0x2876('0x1f')](_0x398d7d[_0x2876('0x35')][_0x2876('0x1f')]);_0x19a657['offset']=qs[_0x2876('0x20')](_0x398d7d[_0x2876('0x35')][_0x2876('0x20')]);}_0x19a657[_0x2876('0x3f')]=qs[_0x2876('0x40')](_0x398d7d['query'][_0x2876('0x40')]);_0x19a657['where']=qs[_0x2876('0x37')](_['pick'](_0x398d7d[_0x2876('0x35')],_0x5db568[_0x2876('0x37')]),_0x3cf264);if(_0x398d7d[_0x2876('0x35')][_0x2876('0x41')]){_0x19a657[_0x2876('0x42')]=_['merge'](_0x19a657['where'],{'$or':_[_0x2876('0x2f')](_0x3cf264,function(_0x454ef0){if(_0x454ef0[_0x2876('0x33')]!==_0x2876('0x43')){var _0x529a90={};_0x529a90[_0x454ef0['name']]={'$like':'%'+_0x398d7d[_0x2876('0x35')][_0x2876('0x41')]+'%'};return _0x529a90;}})});}_0x19a657=_['merge']({},_0x19a657,_0x398d7d[_0x2876('0x44')]);var _0x817961={'where':_0x19a657[_0x2876('0x42')]};return db[_0x2876('0x30')][_0x2876('0x45')](_0x817961)[_0x2876('0x28')](function(_0x39128c){_0x1eed0b[_0x2876('0x45')]=_0x39128c;if(_0x398d7d[_0x2876('0x35')][_0x2876('0x46')]){_0x19a657[_0x2876('0x47')]=[{'all':!![]}];}return db[_0x2876('0x30')]['findAll'](_0x19a657);})[_0x2876('0x28')](function(_0x28896f){_0x1eed0b[_0x2876('0x48')]=_0x28896f;return _0x1eed0b;})[_0x2876('0x28')](respondWithFilteredResult(_0x17ff7b,_0x19a657))[_0x2876('0x49')](handleError(_0x17ff7b,null));};exports['show']=function(_0x2fb5c1,_0x412a00){var _0x4d8fb7={'raw':!![],'where':{'id':_0x2fb5c1[_0x2876('0x4a')]['id']}},_0x1f5497={};_0x1f5497[_0x2876('0x38')]=_[_0x2876('0x36')](db[_0x2876('0x30')][_0x2876('0x31')]);_0x1f5497[_0x2876('0x35')]=_[_0x2876('0x36')](_0x2fb5c1[_0x2876('0x35')]);_0x1f5497[_0x2876('0x37')]=_['intersection'](_0x1f5497[_0x2876('0x38')],_0x1f5497['query']);_0x4d8fb7[_0x2876('0x39')]=_['intersection'](_0x1f5497[_0x2876('0x38')],qs['fields'](_0x2fb5c1['query'][_0x2876('0x3b')]));_0x4d8fb7[_0x2876('0x39')]=_0x4d8fb7[_0x2876('0x39')][_0x2876('0x3c')]?_0x4d8fb7[_0x2876('0x39')]:_0x1f5497[_0x2876('0x38')];if(_0x2fb5c1[_0x2876('0x35')][_0x2876('0x46')]){_0x4d8fb7[_0x2876('0x47')]=[{'all':!![]}];}_0x4d8fb7=_[_0x2876('0x4b')]({},_0x4d8fb7,_0x2fb5c1[_0x2876('0x44')]);return db[_0x2876('0x30')][_0x2876('0x4c')](_0x4d8fb7)[_0x2876('0x28')](handleEntityNotFound(_0x412a00,null))[_0x2876('0x28')](respondWithResult(_0x412a00,null))[_0x2876('0x49')](handleError(_0x412a00,null));};exports[_0x2876('0x4d')]=function(_0x4269a1,_0x58b453){return db[_0x2876('0x30')]['create'](_0x4269a1['body'],{})[_0x2876('0x28')](function(_0x18a076){var _0x3e1732=_0x4269a1['user'][_0x2876('0x29')]({'plain':!![]});if(!_0x3e1732)throw new Error(_0x2876('0x4e'));if(_0x3e1732[_0x2876('0x4f')]===_0x2876('0x50')){var _0x569ade=_0x18a076[_0x2876('0x29')]({'plain':!![]});var _0x2cc26f=_0x2876('0x51');return db['UserProfileSection'][_0x2876('0x4c')]({'where':{'name':_0x2cc26f,'userProfileId':_0x3e1732['userProfileId']},'raw':!![]})['then'](function(_0x381716){if(_0x381716&&_0x381716[_0x2876('0x52')]===0x0){return db[_0x2876('0x2a')][_0x2876('0x4d')]({'name':_0x569ade[_0x2876('0x2c')],'resourceId':_0x569ade['id'],'type':_0x381716[_0x2876('0x2c')],'sectionId':_0x381716['id']},{})['then'](function(){return _0x18a076;});}else{return _0x18a076;}})[_0x2876('0x49')](function(_0x31b6e3){logger[_0x2876('0x53')](_0x2876('0x54'),_0x31b6e3);throw _0x31b6e3;});}return _0x18a076;})[_0x2876('0x28')](respondWithResult(_0x58b453,0xc9))['catch'](handleError(_0x58b453,null));};exports[_0x2876('0x27')]=function(_0x290566,_0x2e003a){if(_0x290566[_0x2876('0x55')]['id']){delete _0x290566[_0x2876('0x55')]['id'];}return db[_0x2876('0x30')][_0x2876('0x4c')]({'where':{'id':_0x290566[_0x2876('0x4a')]['id']}})[_0x2876('0x28')](handleEntityNotFound(_0x2e003a,null))[_0x2876('0x28')](saveUpdates(_0x290566[_0x2876('0x55')],null))[_0x2876('0x28')](respondWithResult(_0x2e003a,null))['catch'](handleError(_0x2e003a,null));};exports[_0x2876('0x2b')]=function(_0x48dbf8,_0x4dd5b0){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x48dbf8[_0x2876('0x4a')]['id']}})[_0x2876('0x28')](handleEntityNotFound(_0x4dd5b0,null))[_0x2876('0x28')](removeEntity(_0x4dd5b0,null))[_0x2876('0x49')](handleError(_0x4dd5b0,null));};exports[_0x2876('0x56')]=function(_0x255628,_0x465bdc,_0xfb96dd){return db[_0x2876('0x30')][_0x2876('0x4c')]({'where':{'id':_0x255628[_0x2876('0x4a')]['id']},'attributes':[_0x2876('0x2c'),'basename',_0x2876('0x57'),_0x2876('0x58')],'raw':!![]})[_0x2876('0x28')](handleEntityNotFound(_0x465bdc,null))[_0x2876('0x28')](function(_0x43d705){if(_0x43d705){if(!fs[_0x2876('0x59')](path['join'](config[_0x2876('0x5a')],_0x2876('0x5b'),_0x43d705[_0x2876('0x57')]))){throw new db['Sequelize'][(_0x2876('0x5c'))](_0x2876('0x5d'));}if(_0x255628['query'][_0x2876('0x5e')]){return _0x465bdc[_0x2876('0x1b')](0xc8);}return _0x465bdc[_0x2876('0x56')](path[_0x2876('0x5f')](config['root'],_0x2876('0x5b'),_0x43d705[_0x2876('0x57')]),util[_0x2876('0x60')](_0x2876('0x61'),_0x43d705[_0x2876('0x62')]||_0x43d705[_0x2876('0x2c')],_0x43d705[_0x2876('0x58')][_0x2876('0x63')]()));}})[_0x2876('0x49')](handleError(_0x465bdc,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f237b80..8e0356d 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 _0x3231=['bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','../../config/logger','api','moment'];(function(_0x127728,_0x11c9c5){var _0x3b6cfe=function(_0x627b1e){while(--_0x627b1e){_0x127728['push'](_0x127728['shift']());}};_0x3b6cfe(++_0x11c9c5);}(_0x3231,0x15c));var _0x1323=function(_0x4aba51,_0xcc8225){_0x4aba51=_0x4aba51-0x0;var _0x3de7b4=_0x3231[_0x4aba51];return _0x3de7b4;};'use strict';var _=require(_0x1323('0x0'));var util=require('util');var logger=require(_0x1323('0x1'))(_0x1323('0x2'));var moment=require(_0x1323('0x3'));var BPromise=require(_0x1323('0x4'));var rp=require(_0x1323('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1323('0x6'));var config=require('../../config/environment');var attributes=require(_0x1323('0x7'));module[_0x1323('0x8')]=function(_0x432206,_0x22e4d2){return _0x432206[_0x1323('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x1323('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e92=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','api','bluebird','path','rimraf'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1e92,0x158));var _0x21e9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1e92[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x21e9('0x0'));var util=require(_0x21e9('0x1'));var logger=require('../../config/logger')(_0x21e9('0x2'));var moment=require('moment');var BPromise=require(_0x21e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21e9('0x4'));var rimraf=require(_0x21e9('0x5'));var config=require('../../config/environment');var attributes=require(_0x21e9('0x6'));module[_0x21e9('0x7')]=function(_0x16460f,_0x56bf4d){return _0x16460f[_0x21e9('0x8')](_0x21e9('0x9'),attributes,{'tableName':'analytics_extracted_reports','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 fdb8d3b..774e90b 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 _0x75c8=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x3f0114,_0x34ef8e){var _0x5269f4=function(_0x1760b2){while(--_0x1760b2){_0x3f0114['push'](_0x3f0114['shift']());}};_0x5269f4(++_0x34ef8e);}(_0x75c8,0x1c2));var _0x875c=function(_0x217c41,_0xd11329){_0x217c41=_0x217c41-0x0;var _0x2d75a9=_0x75c8[_0x217c41];return _0x2d75a9;};'use strict';var _=require(_0x875c('0x0'));var util=require(_0x875c('0x1'));var moment=require(_0x875c('0x2'));var BPromise=require(_0x875c('0x3'));var rs=require(_0x875c('0x4'));var fs=require('fs');var Redis=require(_0x875c('0x5'));var db=require(_0x875c('0x6'))['db'];var utils=require(_0x875c('0x7'));var logger=require(_0x875c('0x8'))(_0x875c('0x9'));var config=require(_0x875c('0xa'));var jayson=require(_0x875c('0xb'));var client=jayson[_0x875c('0xc')][_0x875c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xea85db,_0x2fbb18,_0x480ec0){return new BPromise(function(_0x380c23,_0x474442){return client[_0x875c('0xe')](_0xea85db,_0x480ec0)[_0x875c('0xf')](function(_0x148fe4){logger[_0x875c('0x10')](_0x875c('0x11'),_0x2fbb18,'request\x20sent');logger[_0x875c('0x12')](_0x875c('0x13'),_0x2fbb18,_0x875c('0x14'),JSON[_0x875c('0x15')](_0x148fe4));if(_0x148fe4[_0x875c('0x16')]){if(_0x148fe4[_0x875c('0x16')][_0x875c('0x17')]===0x1f4){logger[_0x875c('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2fbb18,_0x148fe4[_0x875c('0x16')][_0x875c('0x18')]);return _0x474442(_0x148fe4['error']['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2fbb18,_0x148fe4['error'][_0x875c('0x18')]);return _0x380c23(_0x148fe4[_0x875c('0x16')][_0x875c('0x18')]);}else{logger[_0x875c('0x10')](_0x875c('0x11'),_0x2fbb18,_0x875c('0x14'));_0x380c23(_0x148fe4[_0x875c('0x19')][_0x875c('0x18')]);}})['catch'](function(_0x1ef14e){logger[_0x875c('0x16')](_0x875c('0x11'),_0x2fbb18,_0x1ef14e);_0x474442(_0x1ef14e);});});} \ No newline at end of file +var _0x0b9f=['error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x0b9f,0xa7));var _0xf0b9=function(_0x507781,_0x3238d3){_0x507781=_0x507781-0x0;var _0x32e3b9=_0x0b9f[_0x507781];return _0x32e3b9;};'use strict';var _=require(_0xf0b9('0x0'));var util=require(_0xf0b9('0x1'));var moment=require(_0xf0b9('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0b9('0x5'))(_0xf0b9('0x6'));var config=require(_0xf0b9('0x7'));var jayson=require(_0xf0b9('0x8'));var client=jayson['client'][_0xf0b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a44cd,_0x5cef53,_0x3dbc8d){return new BPromise(function(_0x564223,_0x5e2200){return client[_0xf0b9('0xa')](_0x2a44cd,_0x3dbc8d)[_0xf0b9('0xb')](function(_0x429737){logger[_0xf0b9('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5cef53,_0xf0b9('0xd'));logger[_0xf0b9('0xe')](_0xf0b9('0xf'),_0x5cef53,_0xf0b9('0xd'),JSON[_0xf0b9('0x10')](_0x429737));if(_0x429737[_0xf0b9('0x11')]){if(_0x429737[_0xf0b9('0x11')][_0xf0b9('0x12')]===0x1f4){logger['error'](_0xf0b9('0x13'),_0x5cef53,_0x429737[_0xf0b9('0x11')][_0xf0b9('0x14')]);return _0x5e2200(_0x429737[_0xf0b9('0x11')][_0xf0b9('0x14')]);}logger[_0xf0b9('0x11')](_0xf0b9('0x13'),_0x5cef53,_0x429737[_0xf0b9('0x11')]['message']);return _0x564223(_0x429737[_0xf0b9('0x11')][_0xf0b9('0x14')]);}else{logger[_0xf0b9('0xc')](_0xf0b9('0x13'),_0x5cef53,_0xf0b9('0xd'));_0x564223(_0x429737[_0xf0b9('0x15')][_0xf0b9('0x14')]);}})[_0xf0b9('0x16')](function(_0x42a877){logger['error'](_0xf0b9('0x13'),_0x5cef53,_0x42a877);_0x5e2200(_0x42a877);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ae6a9cd..7661eab 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 _0xffec=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0xdd3c0,_0x37ca60){var _0x4faa02=function(_0x3771e7){while(--_0x3771e7){_0xdd3c0['push'](_0xdd3c0['shift']());}};_0x4faa02(++_0x37ca60);}(_0xffec,0xc9));var _0xcffe=function(_0x2cbe38,_0x3155de){_0x2cbe38=_0x2cbe38-0x0;var _0x46bb17=_0xffec[_0x2cbe38];return _0x46bb17;};'use strict';var multer=require(_0xcffe('0x0'));var util=require(_0xcffe('0x1'));var path=require('path');var timeout=require(_0xcffe('0x2'));var express=require(_0xcffe('0x3'));var router=express[_0xcffe('0x4')]();var fs_extra=require(_0xcffe('0x5'));var auth=require(_0xcffe('0x6'));var interaction=require(_0xcffe('0x7'));var config=require(_0xcffe('0x8'));var controller=require(_0xcffe('0x9'));router[_0xcffe('0xa')]('/',auth[_0xcffe('0xb')](),controller[_0xcffe('0xc')]);router['get'](_0xcffe('0xd'),auth[_0xcffe('0xb')](),controller[_0xcffe('0xe')]);router[_0xcffe('0xa')]('/:id/download',auth[_0xcffe('0xb')](),controller[_0xcffe('0xf')]);router[_0xcffe('0x10')]('/',auth['isAuthenticated'](),controller[_0xcffe('0x11')]);router[_0xcffe('0x12')]('/:id',auth[_0xcffe('0xb')](),controller[_0xcffe('0x13')]);router[_0xcffe('0x14')](_0xcffe('0xd'),auth['isAuthenticated'](),controller[_0xcffe('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4330=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','multer','util'];(function(_0x389125,_0x4b686c){var _0x2eebf5=function(_0x59c50b){while(--_0x59c50b){_0x389125['push'](_0x389125['shift']());}};_0x2eebf5(++_0x4b686c);}(_0x4330,0xbb));var _0x0433=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4330[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x0433('0x0'));var util=require(_0x0433('0x1'));var path=require(_0x0433('0x2'));var timeout=require(_0x0433('0x3'));var express=require(_0x0433('0x4'));var router=express[_0x0433('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0433('0x6'));var interaction=require(_0x0433('0x7'));var config=require('../../config/environment');var controller=require(_0x0433('0x8'));router[_0x0433('0x9')]('/',auth[_0x0433('0xa')](),controller[_0x0433('0xb')]);router[_0x0433('0x9')](_0x0433('0xc'),auth[_0x0433('0xa')](),controller[_0x0433('0xd')]);router[_0x0433('0x9')](_0x0433('0xe'),auth[_0x0433('0xa')](),controller[_0x0433('0xf')]);router[_0x0433('0x10')]('/',auth[_0x0433('0xa')](),controller[_0x0433('0x11')]);router[_0x0433('0x12')](_0x0433('0xc'),auth[_0x0433('0xa')](),controller[_0x0433('0x13')]);router['delete'](_0x0433('0xc'),auth['isAuthenticated'](),controller[_0x0433('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index b6fddb6..0e45973 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 _0x34bd=['STRING','BOOLEAN','exports','TEXT'];(function(_0x554047,_0x46ec41){var _0x5d11e4=function(_0x5a026e){while(--_0x5a026e){_0x554047['push'](_0x554047['shift']());}};_0x5d11e4(++_0x46ec41);}(_0x34bd,0x112));var _0xd34b=function(_0x2542d1,_0xdb7645){_0x2542d1=_0x2542d1-0x0;var _0xec2ce7=_0x34bd[_0x2542d1];return _0xec2ce7;};'use strict';var Sequelize=require('sequelize');module[_0xd34b('0x0')]={'field':{'type':Sequelize[_0xd34b('0x1')]},'alias':{'type':Sequelize[_0xd34b('0x2')]},'function':{'type':Sequelize[_0xd34b('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xd34b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd34b('0x2')]},'custom':{'type':Sequelize[_0xd34b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xada7=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x305866,_0x556589){var _0x5894ea=function(_0x1f222e){while(--_0x1f222e){_0x305866['push'](_0x305866['shift']());}};_0x5894ea(++_0x556589);}(_0xada7,0x8b));var _0x7ada=function(_0xb33879,_0x38b0cc){_0xb33879=_0xb33879-0x0;var _0x305a36=_0xada7[_0xb33879];return _0x305a36;};'use strict';var Sequelize=require(_0x7ada('0x0'));module['exports']={'field':{'type':Sequelize[_0x7ada('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x7ada('0x2')]},'format':{'type':Sequelize[_0x7ada('0x2')]},'groupBy':{'type':Sequelize[_0x7ada('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7ada('0x2')]},'custom':{'type':Sequelize[_0x7ada('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0e1685d..11aa750 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 _0x318d=['apply','reject','update','destroy','then','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','params','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x318d,0x7d));var _0xd318=function(_0x44c0c2,_0x29d866){_0x44c0c2=_0x44c0c2-0x0;var _0x5b2eb8=_0x318d[_0x44c0c2];return _0x5b2eb8;};'use strict';var emlformat=require(_0xd318('0x0'));var rimraf=require(_0xd318('0x1'));var zipdir=require(_0xd318('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd318('0x3'));var moment=require(_0xd318('0x4'));var BPromise=require(_0xd318('0x5'));var Mustache=require(_0xd318('0x6'));var util=require(_0xd318('0x7'));var path=require('path');var sox=require(_0xd318('0x8'));var csv=require(_0xd318('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd318('0xa'));var squel=require(_0xd318('0xb'));var crypto=require(_0xd318('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd318('0xd'));var toCsv=require(_0xd318('0x9'));var querystring=require(_0xd318('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd318('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd318('0x10'));var logger=require(_0xd318('0x11'))(_0xd318('0x12'));var utils=require(_0xd318('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd318('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35bf73,_0x27c39a){_0x27c39a=_0x27c39a||0xcc;return function(_0x2fe697){if(_0x2fe697){return _0x35bf73[_0xd318('0x15')](_0x27c39a);}return _0x35bf73[_0xd318('0x16')](_0x27c39a)[_0xd318('0x17')]();};}function respondWithResult(_0x5d0f07,_0x4d6277){_0x4d6277=_0x4d6277||0xc8;return function(_0x3b17dd){if(_0x3b17dd){return _0x5d0f07[_0xd318('0x16')](_0x4d6277)[_0xd318('0x18')](_0x3b17dd);}};}function respondWithFilteredResult(_0x4c0e71,_0xc463a6){return function(_0x301e65){if(_0x301e65){var _0x1f5cd8=typeof _0xc463a6[_0xd318('0x19')]===_0xd318('0x1a')&&typeof _0xc463a6[_0xd318('0x1b')]===_0xd318('0x1a');var _0x176198=_0x301e65['count'];var _0x35f75b=_0x1f5cd8?0x0:_0xc463a6[_0xd318('0x19')];var _0x3a60b9=_0x1f5cd8?_0x301e65['count']:_0xc463a6[_0xd318('0x19')]+_0xc463a6[_0xd318('0x1b')];var _0x49d6d8;if(_0x3a60b9>=_0x176198){_0x3a60b9=_0x176198;_0x49d6d8=0xc8;}else{_0x49d6d8=0xce;}_0x4c0e71['status'](_0x49d6d8);return _0x4c0e71['set'](_0xd318('0x1c'),_0x35f75b+'-'+_0x3a60b9+'/'+_0x176198)[_0xd318('0x18')](_0x301e65);}return null;};}function patchUpdates(_0x28d7be){return function(_0x3f40a3){try{jsonpatch[_0xd318('0x1d')](_0x3f40a3,_0x28d7be,!![]);}catch(_0x564173){return BPromise[_0xd318('0x1e')](_0x564173);}return _0x3f40a3['save']();};}function saveUpdates(_0x44fe39,_0x19e9f8){return function(_0xc2a190){if(_0xc2a190){return _0xc2a190[_0xd318('0x1f')](_0x44fe39)['then'](function(_0x5db1f2){return _0x5db1f2;});}return null;};}function removeEntity(_0x22c9ec,_0x4edd99){return function(_0x456a44){if(_0x456a44){return _0x456a44[_0xd318('0x20')]()[_0xd318('0x21')](function(){_0x22c9ec['status'](0xcc)[_0xd318('0x17')]();});}};}function handleEntityNotFound(_0x42ffca,_0x20eb9f){return function(_0x4eec19){if(!_0x4eec19){_0x42ffca[_0xd318('0x15')](0x194);}return _0x4eec19;};}function handleError(_0x1eb65f,_0x213101){_0x213101=_0x213101||0x1f4;return function(_0x5d06b6){logger['error'](_0x5d06b6[_0xd318('0x22')]);if(_0x5d06b6[_0xd318('0x23')]){delete _0x5d06b6[_0xd318('0x23')];}_0x1eb65f[_0xd318('0x16')](_0x213101)[_0xd318('0x24')](_0x5d06b6);};}exports[_0xd318('0x25')]=function(_0x2767e3,_0x76672d){var _0x287ff0={},_0x5b732c={},_0x22c947={'count':0x0,'rows':[]};var _0x2bba54=_[_0xd318('0x26')](db[_0xd318('0x27')][_0xd318('0x28')],function(_0x54e3ed){return{'name':_0x54e3ed[_0xd318('0x29')],'type':_0x54e3ed['type']['key']};});_0x5b732c[_0xd318('0x2a')]=_[_0xd318('0x26')](_0x2bba54,_0xd318('0x23'));_0x5b732c['query']=_[_0xd318('0x2b')](_0x2767e3['query']);_0x5b732c[_0xd318('0x2c')]=_[_0xd318('0x2d')](_0x5b732c[_0xd318('0x2a')],_0x5b732c[_0xd318('0x2e')]);_0x287ff0['attributes']=_[_0xd318('0x2d')](_0x5b732c['model'],qs['fields'](_0x2767e3[_0xd318('0x2e')][_0xd318('0x2f')]));_0x287ff0[_0xd318('0x30')]=_0x287ff0[_0xd318('0x30')]['length']?_0x287ff0[_0xd318('0x30')]:_0x5b732c[_0xd318('0x2a')];if(!_0x2767e3[_0xd318('0x2e')][_0xd318('0x31')](_0xd318('0x32'))){_0x287ff0[_0xd318('0x1b')]=qs[_0xd318('0x1b')](_0x2767e3['query'][_0xd318('0x1b')]);_0x287ff0[_0xd318('0x19')]=qs[_0xd318('0x19')](_0x2767e3[_0xd318('0x2e')]['offset']);}_0x287ff0['order']=qs['sort'](_0x2767e3[_0xd318('0x2e')][_0xd318('0x33')]);_0x287ff0[_0xd318('0x34')]=qs[_0xd318('0x2c')](_[_0xd318('0x35')](_0x2767e3[_0xd318('0x2e')],_0x5b732c['filters']),_0x2bba54);if(_0x2767e3[_0xd318('0x2e')]['filter']){_0x287ff0[_0xd318('0x34')]=_['merge'](_0x287ff0[_0xd318('0x34')],{'$or':_[_0xd318('0x26')](_0x2bba54,function(_0x1ca0a6){if(_0x1ca0a6[_0xd318('0x36')]!==_0xd318('0x37')){var _0x379327={};_0x379327[_0x1ca0a6[_0xd318('0x23')]]={'$like':'%'+_0x2767e3[_0xd318('0x2e')]['filter']+'%'};return _0x379327;}})});}_0x287ff0=_[_0xd318('0x38')]({},_0x287ff0,_0x2767e3[_0xd318('0x39')]);var _0x4917a9={'where':_0x287ff0[_0xd318('0x34')]};return db['AnalyticFieldReport'][_0xd318('0x3a')](_0x4917a9)[_0xd318('0x21')](function(_0x4f173d){_0x22c947[_0xd318('0x3a')]=_0x4f173d;if(_0x2767e3[_0xd318('0x2e')][_0xd318('0x3b')]){_0x287ff0['include']=[{'all':!![]}];}return db[_0xd318('0x27')][_0xd318('0x3c')](_0x287ff0);})[_0xd318('0x21')](function(_0x7db432){_0x22c947[_0xd318('0x3d')]=_0x7db432;return _0x22c947;})[_0xd318('0x21')](respondWithFilteredResult(_0x76672d,_0x287ff0))[_0xd318('0x3e')](handleError(_0x76672d,null));};exports['show']=function(_0x5e3f57,_0x5ad4ba){var _0x4298df={'raw':![],'where':{'id':_0x5e3f57[_0xd318('0x3f')]['id']}},_0xb7b96d={};_0xb7b96d[_0xd318('0x2a')]=_['keys'](db[_0xd318('0x27')][_0xd318('0x28')]);_0xb7b96d[_0xd318('0x2e')]=_[_0xd318('0x2b')](_0x5e3f57[_0xd318('0x2e')]);_0xb7b96d[_0xd318('0x2c')]=_['intersection'](_0xb7b96d['model'],_0xb7b96d[_0xd318('0x2e')]);_0x4298df[_0xd318('0x30')]=_[_0xd318('0x2d')](_0xb7b96d[_0xd318('0x2a')],qs[_0xd318('0x2f')](_0x5e3f57[_0xd318('0x2e')][_0xd318('0x2f')]));_0x4298df[_0xd318('0x30')]=_0x4298df['attributes'][_0xd318('0x40')]?_0x4298df[_0xd318('0x30')]:_0xb7b96d['model'];if(_0x5e3f57['query']['includeAll']){_0x4298df[_0xd318('0x41')]=[{'all':!![]}];}_0x4298df=_[_0xd318('0x38')]({},_0x4298df,_0x5e3f57[_0xd318('0x39')]);return db[_0xd318('0x27')][_0xd318('0x42')](_0x4298df)[_0xd318('0x21')](handleEntityNotFound(_0x5ad4ba,null))[_0xd318('0x21')](respondWithResult(_0x5ad4ba,null))[_0xd318('0x3e')](handleError(_0x5ad4ba,null));};exports['create']=function(_0x1d7f07,_0x3d3c16){return db[_0xd318('0x27')][_0xd318('0x43')](_0x1d7f07[_0xd318('0x44')],{})[_0xd318('0x21')](respondWithResult(_0x3d3c16,0xc9))[_0xd318('0x3e')](handleError(_0x3d3c16,null));};exports[_0xd318('0x45')]=function(_0x10a6cc,_0x5f5dcd){return db[_0xd318('0x27')]['bulkCreate'](_0x10a6cc[_0xd318('0x44')],{'raw':![],'individualHooks':!![]})[_0xd318('0x21')](respondWithResult(_0x5f5dcd,0xc9))[_0xd318('0x3e')](handleError(_0x5f5dcd,null));};exports[_0xd318('0x1f')]=function(_0x26c57a,_0x211be6){if(_0x26c57a[_0xd318('0x44')]['id']){delete _0x26c57a[_0xd318('0x44')]['id'];}return db['AnalyticFieldReport'][_0xd318('0x42')]({'where':{'id':_0x26c57a['params']['id']}})[_0xd318('0x21')](handleEntityNotFound(_0x211be6,null))[_0xd318('0x21')](saveUpdates(_0x26c57a['body'],null))['then'](respondWithResult(_0x211be6,null))[_0xd318('0x3e')](handleError(_0x211be6,null));};exports[_0xd318('0x20')]=function(_0x139293,_0x38b1a9){return db[_0xd318('0x27')][_0xd318('0x42')]({'where':{'id':_0x139293['params']['id']}})['then'](handleEntityNotFound(_0x38b1a9,null))['then'](removeEntity(_0x38b1a9,null))[_0xd318('0x3e')](handleError(_0x38b1a9,null));};exports[_0xd318('0x46')]=function(_0x2b61e9,_0x12e0b3){return db[_0xd318('0x27')][_0xd318('0x20')]({'where':{'id':_0x2b61e9['query'][_0xd318('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x12e0b3,0xcc))[_0xd318('0x3e')](handleError(_0x12e0b3,null));};exports[_0xd318('0x48')]=function(_0x2b32af,_0x5093e2,_0x18a930){return db['AnalyticCustomReport'][_0xd318('0x49')]({'where':{'id':_0x2b32af[_0xd318('0x3f')]['id']}})[_0xd318('0x21')](handleEntityNotFound(_0x5093e2,null))[_0xd318('0x21')](function(_0x347622){if(_0x347622){return db[_0xd318('0x4a')][_0xd318('0x4b')](function(_0x4b2fc5){return db['AnalyticFieldReport'][_0xd318('0x20')]({'where':{'CustomReportId':_0x2b32af['params']['id']},'transaction':_0x4b2fc5})[_0xd318('0x21')](function(_0x2e5cfb){var _0x21379b=_[_0xd318('0x26')](_0x2b32af[_0xd318('0x44')],function(_0x41ac6d){delete _0x41ac6d['id'];_0x41ac6d[_0xd318('0x4c')]=_0x2b32af['params']['id'];return _0x41ac6d;});return db[_0xd318('0x27')][_0xd318('0x45')](_0x21379b,{'transaction':_0x4b2fc5});});})['then'](function(){return db[_0xd318('0x27')][_0xd318('0x3c')]({'where':{'CustomReportId':_0x2b32af[_0xd318('0x3f')]['id']}});});}})['then'](respondWithResult(_0x5093e2,null))[_0xd318('0x3e')](handleError(_0x5093e2,null));}; \ No newline at end of file +var _0x3d53=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x5ba618,_0x472df0){var _0x1b6fc7=function(_0x30f96c){while(--_0x30f96c){_0x5ba618['push'](_0x5ba618['shift']());}};_0x1b6fc7(++_0x472df0);}(_0x3d53,0x150));var _0x33d5=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x3d53[_0x40220a];return _0x3903cc;};'use strict';var emlformat=require(_0x33d5('0x0'));var rimraf=require(_0x33d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33d5('0x2'));var rp=require(_0x33d5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x33d5('0x4'));var util=require(_0x33d5('0x5'));var path=require(_0x33d5('0x6'));var sox=require(_0x33d5('0x7'));var csv=require('to-csv');var ejs=require(_0x33d5('0x8'));var fs=require('fs');var fs_extra=require(_0x33d5('0x9'));var _=require(_0x33d5('0xa'));var squel=require(_0x33d5('0xb'));var crypto=require(_0x33d5('0xc'));var jsforce=require(_0x33d5('0xd'));var deskjs=require(_0x33d5('0xe'));var toCsv=require(_0x33d5('0xf'));var querystring=require(_0x33d5('0x10'));var Papa=require(_0x33d5('0x11'));var Redis=require(_0x33d5('0x12'));var authService=require(_0x33d5('0x13'));var qs=require(_0x33d5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33d5('0x15'));var logger=require(_0x33d5('0x16'))('api');var utils=require(_0x33d5('0x17'));var config=require(_0x33d5('0x18'));var licenseUtil=require(_0x33d5('0x19'));var db=require(_0x33d5('0x1a'))['db'];function respondWithStatusCode(_0x4469d2,_0x129c08){_0x129c08=_0x129c08||0xcc;return function(_0x5397e2){if(_0x5397e2){return _0x4469d2[_0x33d5('0x1b')](_0x129c08);}return _0x4469d2['status'](_0x129c08)[_0x33d5('0x1c')]();};}function respondWithResult(_0x29d8a2,_0x3c49bf){_0x3c49bf=_0x3c49bf||0xc8;return function(_0x4ce83f){if(_0x4ce83f){return _0x29d8a2[_0x33d5('0x1d')](_0x3c49bf)['json'](_0x4ce83f);}};}function respondWithFilteredResult(_0x336041,_0x4ea8fd){return function(_0x6ac1b7){if(_0x6ac1b7){var _0x472b05=typeof _0x4ea8fd[_0x33d5('0x1e')]===_0x33d5('0x1f')&&typeof _0x4ea8fd[_0x33d5('0x20')]==='undefined';var _0x287541=_0x6ac1b7[_0x33d5('0x21')];var _0x58fb7b=_0x472b05?0x0:_0x4ea8fd['offset'];var _0x137694=_0x472b05?_0x6ac1b7[_0x33d5('0x21')]:_0x4ea8fd['offset']+_0x4ea8fd[_0x33d5('0x20')];var _0x3be224;if(_0x137694>=_0x287541){_0x137694=_0x287541;_0x3be224=0xc8;}else{_0x3be224=0xce;}_0x336041['status'](_0x3be224);return _0x336041[_0x33d5('0x22')](_0x33d5('0x23'),_0x58fb7b+'-'+_0x137694+'/'+_0x287541)[_0x33d5('0x24')](_0x6ac1b7);}return null;};}function patchUpdates(_0x32ee29){return function(_0x4efb87){try{jsonpatch[_0x33d5('0x25')](_0x4efb87,_0x32ee29,!![]);}catch(_0xf19dcb){return BPromise[_0x33d5('0x26')](_0xf19dcb);}return _0x4efb87[_0x33d5('0x27')]();};}function saveUpdates(_0x35832d,_0x27351a){return function(_0x26194e){if(_0x26194e){return _0x26194e[_0x33d5('0x28')](_0x35832d)[_0x33d5('0x29')](function(_0x29a891){return _0x29a891;});}return null;};}function removeEntity(_0x5afc01,_0x4763f2){return function(_0x5ae890){if(_0x5ae890){return _0x5ae890[_0x33d5('0x2a')]()[_0x33d5('0x29')](function(){_0x5afc01[_0x33d5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9dc12f,_0x3d2d8e){return function(_0x42e2da){if(!_0x42e2da){_0x9dc12f[_0x33d5('0x1b')](0x194);}return _0x42e2da;};}function handleError(_0x26d9ed,_0x1c7abf){_0x1c7abf=_0x1c7abf||0x1f4;return function(_0x4d2288){logger[_0x33d5('0x2b')](_0x4d2288['stack']);if(_0x4d2288['name']){delete _0x4d2288['name'];}_0x26d9ed['status'](_0x1c7abf)[_0x33d5('0x2c')](_0x4d2288);};}exports[_0x33d5('0x2d')]=function(_0x3b77a1,_0x1ffe4d){var _0x5caa89={},_0x3ac732={},_0x221a11={'count':0x0,'rows':[]};var _0x4fcca9=_[_0x33d5('0x2e')](db[_0x33d5('0x2f')]['rawAttributes'],function(_0x40b262){return{'name':_0x40b262[_0x33d5('0x30')],'type':_0x40b262[_0x33d5('0x31')][_0x33d5('0x32')]};});_0x3ac732[_0x33d5('0x33')]=_[_0x33d5('0x2e')](_0x4fcca9,'name');_0x3ac732[_0x33d5('0x34')]=_[_0x33d5('0x35')](_0x3b77a1[_0x33d5('0x34')]);_0x3ac732['filters']=_['intersection'](_0x3ac732[_0x33d5('0x33')],_0x3ac732[_0x33d5('0x34')]);_0x5caa89['attributes']=_[_0x33d5('0x36')](_0x3ac732['model'],qs[_0x33d5('0x37')](_0x3b77a1[_0x33d5('0x34')]['fields']));_0x5caa89[_0x33d5('0x38')]=_0x5caa89[_0x33d5('0x38')][_0x33d5('0x39')]?_0x5caa89[_0x33d5('0x38')]:_0x3ac732[_0x33d5('0x33')];if(!_0x3b77a1[_0x33d5('0x34')]['hasOwnProperty'](_0x33d5('0x3a'))){_0x5caa89[_0x33d5('0x20')]=qs[_0x33d5('0x20')](_0x3b77a1[_0x33d5('0x34')][_0x33d5('0x20')]);_0x5caa89['offset']=qs[_0x33d5('0x1e')](_0x3b77a1['query'][_0x33d5('0x1e')]);}_0x5caa89[_0x33d5('0x3b')]=qs[_0x33d5('0x3c')](_0x3b77a1[_0x33d5('0x34')][_0x33d5('0x3c')]);_0x5caa89[_0x33d5('0x3d')]=qs[_0x33d5('0x3e')](_[_0x33d5('0x3f')](_0x3b77a1[_0x33d5('0x34')],_0x3ac732['filters']),_0x4fcca9);if(_0x3b77a1['query']['filter']){_0x5caa89[_0x33d5('0x3d')]=_[_0x33d5('0x40')](_0x5caa89[_0x33d5('0x3d')],{'$or':_[_0x33d5('0x2e')](_0x4fcca9,function(_0x38403c){if(_0x38403c[_0x33d5('0x31')]!==_0x33d5('0x41')){var _0x922d4={};_0x922d4[_0x38403c['name']]={'$like':'%'+_0x3b77a1[_0x33d5('0x34')][_0x33d5('0x42')]+'%'};return _0x922d4;}})});}_0x5caa89=_['merge']({},_0x5caa89,_0x3b77a1['options']);var _0x280ddc={'where':_0x5caa89[_0x33d5('0x3d')]};return db[_0x33d5('0x2f')][_0x33d5('0x21')](_0x280ddc)[_0x33d5('0x29')](function(_0x4343ba){_0x221a11[_0x33d5('0x21')]=_0x4343ba;if(_0x3b77a1[_0x33d5('0x34')][_0x33d5('0x43')]){_0x5caa89[_0x33d5('0x44')]=[{'all':!![]}];}return db[_0x33d5('0x2f')]['findAll'](_0x5caa89);})[_0x33d5('0x29')](function(_0x68ab4d){_0x221a11[_0x33d5('0x45')]=_0x68ab4d;return _0x221a11;})[_0x33d5('0x29')](respondWithFilteredResult(_0x1ffe4d,_0x5caa89))[_0x33d5('0x46')](handleError(_0x1ffe4d,null));};exports[_0x33d5('0x47')]=function(_0x548a44,_0x2e86e7){var _0x26d65a={'raw':![],'where':{'id':_0x548a44[_0x33d5('0x48')]['id']}},_0xfdc23f={};_0xfdc23f[_0x33d5('0x33')]=_[_0x33d5('0x35')](db[_0x33d5('0x2f')][_0x33d5('0x49')]);_0xfdc23f[_0x33d5('0x34')]=_[_0x33d5('0x35')](_0x548a44[_0x33d5('0x34')]);_0xfdc23f[_0x33d5('0x3e')]=_[_0x33d5('0x36')](_0xfdc23f[_0x33d5('0x33')],_0xfdc23f[_0x33d5('0x34')]);_0x26d65a[_0x33d5('0x38')]=_[_0x33d5('0x36')](_0xfdc23f['model'],qs['fields'](_0x548a44[_0x33d5('0x34')][_0x33d5('0x37')]));_0x26d65a[_0x33d5('0x38')]=_0x26d65a[_0x33d5('0x38')][_0x33d5('0x39')]?_0x26d65a[_0x33d5('0x38')]:_0xfdc23f[_0x33d5('0x33')];if(_0x548a44[_0x33d5('0x34')][_0x33d5('0x43')]){_0x26d65a[_0x33d5('0x44')]=[{'all':!![]}];}_0x26d65a=_[_0x33d5('0x40')]({},_0x26d65a,_0x548a44[_0x33d5('0x4a')]);return db[_0x33d5('0x2f')][_0x33d5('0x4b')](_0x26d65a)[_0x33d5('0x29')](handleEntityNotFound(_0x2e86e7,null))['then'](respondWithResult(_0x2e86e7,null))[_0x33d5('0x46')](handleError(_0x2e86e7,null));};exports[_0x33d5('0x4c')]=function(_0x1eaf2e,_0x5b745e){return db[_0x33d5('0x2f')][_0x33d5('0x4c')](_0x1eaf2e[_0x33d5('0x4d')],{})[_0x33d5('0x29')](respondWithResult(_0x5b745e,0xc9))[_0x33d5('0x46')](handleError(_0x5b745e,null));};exports[_0x33d5('0x4e')]=function(_0x1425fd,_0x522f4a){return db['AnalyticFieldReport']['bulkCreate'](_0x1425fd[_0x33d5('0x4d')],{'raw':![],'individualHooks':!![]})[_0x33d5('0x29')](respondWithResult(_0x522f4a,0xc9))['catch'](handleError(_0x522f4a,null));};exports[_0x33d5('0x28')]=function(_0x45bc1b,_0xd34cff){if(_0x45bc1b[_0x33d5('0x4d')]['id']){delete _0x45bc1b[_0x33d5('0x4d')]['id'];}return db[_0x33d5('0x2f')]['find']({'where':{'id':_0x45bc1b[_0x33d5('0x48')]['id']}})[_0x33d5('0x29')](handleEntityNotFound(_0xd34cff,null))[_0x33d5('0x29')](saveUpdates(_0x45bc1b[_0x33d5('0x4d')],null))['then'](respondWithResult(_0xd34cff,null))[_0x33d5('0x46')](handleError(_0xd34cff,null));};exports[_0x33d5('0x2a')]=function(_0x2722c8,_0x4e5ca7){return db[_0x33d5('0x2f')][_0x33d5('0x4b')]({'where':{'id':_0x2722c8[_0x33d5('0x48')]['id']}})[_0x33d5('0x29')](handleEntityNotFound(_0x4e5ca7,null))[_0x33d5('0x29')](removeEntity(_0x4e5ca7,null))[_0x33d5('0x46')](handleError(_0x4e5ca7,null));};exports[_0x33d5('0x4f')]=function(_0x4cd64b,_0x515501){return db['AnalyticFieldReport'][_0x33d5('0x2a')]({'where':{'id':_0x4cd64b['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x33d5('0x29')](respondWithResult(_0x515501,0xcc))[_0x33d5('0x46')](handleError(_0x515501,null));};exports[_0x33d5('0x50')]=function(_0xed7611,_0x110cfc,_0x5644de){return db[_0x33d5('0x51')][_0x33d5('0x52')]({'where':{'id':_0xed7611['params']['id']}})[_0x33d5('0x29')](handleEntityNotFound(_0x110cfc,null))[_0x33d5('0x29')](function(_0xa2d839){if(_0xa2d839){return db[_0x33d5('0x53')][_0x33d5('0x54')](function(_0x5f2dc8){return db['AnalyticFieldReport'][_0x33d5('0x2a')]({'where':{'CustomReportId':_0xed7611[_0x33d5('0x48')]['id']},'transaction':_0x5f2dc8})[_0x33d5('0x29')](function(_0x19eef3){var _0x3cfe8b=_[_0x33d5('0x2e')](_0xed7611[_0x33d5('0x4d')],function(_0x18a3ea){delete _0x18a3ea['id'];_0x18a3ea[_0x33d5('0x55')]=_0xed7611[_0x33d5('0x48')]['id'];return _0x18a3ea;});return db[_0x33d5('0x2f')]['bulkCreate'](_0x3cfe8b,{'transaction':_0x5f2dc8});});})[_0x33d5('0x29')](function(){return db[_0x33d5('0x2f')][_0x33d5('0x56')]({'where':{'CustomReportId':_0xed7611[_0x33d5('0x48')]['id']}});});}})[_0x33d5('0x29')](respondWithResult(_0x110cfc,null))[_0x33d5('0x46')](handleError(_0x110cfc,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9477c2e..605e805 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 _0x2a6c=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x20a008,_0x463a98){var _0x15cd94=function(_0x519623){while(--_0x519623){_0x20a008['push'](_0x20a008['shift']());}};_0x15cd94(++_0x463a98);}(_0x2a6c,0xa8));var _0xc2a6=function(_0x37b097,_0xcecfd8){_0x37b097=_0x37b097-0x0;var _0x376470=_0x2a6c[_0x37b097];return _0x376470;};'use strict';var _=require(_0xc2a6('0x0'));var util=require('util');var logger=require(_0xc2a6('0x1'))(_0xc2a6('0x2'));var moment=require(_0xc2a6('0x3'));var BPromise=require(_0xc2a6('0x4'));var rp=require(_0xc2a6('0x5'));var fs=require('fs');var path=require(_0xc2a6('0x6'));var rimraf=require('rimraf');var config=require(_0xc2a6('0x7'));var attributes=require(_0xc2a6('0x8'));module[_0xc2a6('0x9')]=function(_0x395e3a,_0x3465b5){return _0x395e3a[_0xc2a6('0xa')](_0xc2a6('0xb'),attributes,{'tableName':_0xc2a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6d2=['util','api','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','lodash'];(function(_0x2c17a5,_0x3fd48d){var _0x5a1b13=function(_0xb624ff){while(--_0xb624ff){_0x2c17a5['push'](_0x2c17a5['shift']());}};_0x5a1b13(++_0x3fd48d);}(_0xc6d2,0x18f));var _0x2c6d=function(_0x5583e2,_0x5ed956){_0x5583e2=_0x5583e2-0x0;var _0x4ff4a3=_0xc6d2[_0x5583e2];return _0x4ff4a3;};'use strict';var _=require(_0x2c6d('0x0'));var util=require(_0x2c6d('0x1'));var logger=require('../../config/logger')(_0x2c6d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2c6d('0x3'));var fs=require('fs');var path=require(_0x2c6d('0x4'));var rimraf=require(_0x2c6d('0x5'));var config=require(_0x2c6d('0x6'));var attributes=require(_0x2c6d('0x7'));module['exports']=function(_0x35c4c7,_0x2e8973){return _0x35c4c7[_0x2c6d('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x2c6d('0x9'),'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 1e4b3c5..dc08cc4 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 _0x4aff=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4aff,0xfd));var _0xf4af=function(_0x4de226,_0xf589ec){_0x4de226=_0x4de226-0x0;var _0x2fb276=_0x4aff[_0x4de226];return _0x2fb276;};'use strict';var _=require(_0xf4af('0x0'));var util=require(_0xf4af('0x1'));var moment=require(_0xf4af('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4af('0x3'));var fs=require('fs');var Redis=require(_0xf4af('0x4'));var db=require(_0xf4af('0x5'))['db'];var utils=require(_0xf4af('0x6'));var logger=require(_0xf4af('0x7'))(_0xf4af('0x8'));var config=require(_0xf4af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf4af('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473f75,_0x1fbcf2,_0x4bc3d8){return new BPromise(function(_0x4fc213,_0x2f583d){return client[_0xf4af('0xb')](_0x473f75,_0x4bc3d8)[_0xf4af('0xc')](function(_0xfec765){logger[_0xf4af('0xd')](_0xf4af('0xe'),_0x1fbcf2,_0xf4af('0xf'));logger[_0xf4af('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1fbcf2,'request\x20sent',JSON['stringify'](_0xfec765));if(_0xfec765[_0xf4af('0x11')]){if(_0xfec765[_0xf4af('0x11')]['code']===0x1f4){logger[_0xf4af('0x11')](_0xf4af('0xe'),_0x1fbcf2,_0xfec765['error'][_0xf4af('0x12')]);return _0x2f583d(_0xfec765[_0xf4af('0x11')][_0xf4af('0x12')]);}logger[_0xf4af('0x11')](_0xf4af('0xe'),_0x1fbcf2,_0xfec765['error'][_0xf4af('0x12')]);return _0x4fc213(_0xfec765[_0xf4af('0x11')]['message']);}else{logger[_0xf4af('0xd')](_0xf4af('0xe'),_0x1fbcf2,_0xf4af('0xf'));_0x4fc213(_0xfec765['result'][_0xf4af('0x12')]);}})['catch'](function(_0x4a8066){logger[_0xf4af('0x11')](_0xf4af('0xe'),_0x1fbcf2,_0x4a8066);_0x2f583d(_0x4a8066);});});} \ No newline at end of file +var _0x9423=['code','message','result','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x9423,0x8f));var _0x3942=function(_0x31fe22,_0x3237a1){_0x31fe22=_0x31fe22-0x0;var _0x22a27d=_0x9423[_0x31fe22];return _0x22a27d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3942('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3942('0x1'));var db=require(_0x3942('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3942('0x3'))(_0x3942('0x4'));var config=require(_0x3942('0x5'));var jayson=require(_0x3942('0x6'));var client=jayson[_0x3942('0x7')][_0x3942('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x581a3c,_0x561bfa,_0x4762a4){return new BPromise(function(_0x45939a,_0x4851c2){return client[_0x3942('0x9')](_0x581a3c,_0x4762a4)[_0x3942('0xa')](function(_0x6a9349){logger['info'](_0x3942('0xb'),_0x561bfa,'request\x20sent');logger[_0x3942('0xc')](_0x3942('0xd'),_0x561bfa,_0x3942('0xe'),JSON[_0x3942('0xf')](_0x6a9349));if(_0x6a9349[_0x3942('0x10')]){if(_0x6a9349[_0x3942('0x10')][_0x3942('0x11')]===0x1f4){logger[_0x3942('0x10')](_0x3942('0xb'),_0x561bfa,_0x6a9349[_0x3942('0x10')][_0x3942('0x12')]);return _0x4851c2(_0x6a9349['error'][_0x3942('0x12')]);}logger['error'](_0x3942('0xb'),_0x561bfa,_0x6a9349['error']['message']);return _0x45939a(_0x6a9349['error'][_0x3942('0x12')]);}else{logger['info'](_0x3942('0xb'),_0x561bfa,_0x3942('0xe'));_0x45939a(_0x6a9349[_0x3942('0x13')][_0x3942('0x12')]);}})['catch'](function(_0x384e2e){logger[_0x3942('0x10')](_0x3942('0xb'),_0x561bfa,_0x384e2e);_0x4851c2(_0x384e2e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 5ff481b..3f0b0cc 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(_0x199128,_0x38136e){var _0x15f671=function(_0x3b6ae0){while(--_0x3b6ae0){_0x199128['push'](_0x199128['shift']());}};_0x15f671(++_0x38136e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0x44db8e,_0x143b54){var _0x40667a=function(_0x618866){while(--_0x618866){_0x44db8e['push'](_0x44db8e['shift']());}};_0x40667a(++_0x143b54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 b768675..bbc5111 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 _0xfaa4=['exports','STRING','name','TEXT','sequelize'];(function(_0x35a7b3,_0x599a42){var _0x2efcc3=function(_0x2d2697){while(--_0x2d2697){_0x35a7b3['push'](_0x35a7b3['shift']());}};_0x2efcc3(++_0x599a42);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x11cbc6,_0x1e3fd3){_0x11cbc6=_0x11cbc6-0x0;var _0x5efc16=_0xfaa4[_0x11cbc6];return _0x5efc16;};'use strict';var Sequelize=require(_0x4faa('0x0'));module[_0x4faa('0x1')]={'name':{'type':Sequelize[_0x4faa('0x2')],'allowNull':![],'unique':_0x4faa('0x3')},'table':{'type':Sequelize[_0x4faa('0x2')]},'metric':{'type':Sequelize[_0x4faa('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x13eb=['exports','name','STRING','sequelize'];(function(_0x176c18,_0x31e845){var _0x2d64b4=function(_0x27cd68){while(--_0x27cd68){_0x176c18['push'](_0x176c18['shift']());}};_0x2d64b4(++_0x31e845);}(_0x13eb,0x8f));var _0xb13e=function(_0x2d1d37,_0x1048d8){_0x2d1d37=_0x2d1d37-0x0;var _0x3e9649=_0x13eb[_0x2d1d37];return _0x3e9649;};'use strict';var Sequelize=require(_0xb13e('0x0'));module[_0xb13e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb13e('0x2')},'table':{'type':Sequelize[_0xb13e('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xb13e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3d8a4ea..a99e3a0 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x477c84,_0x5396ac){var _0x2722fa=function(_0x298e4d){while(--_0x298e4d){_0x477c84['push'](_0x477c84['shift']());}};_0x2722fa(++_0x5396ac);}(_0x9a19,0x114));var _0x99a1=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x9a19[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file +var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','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/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x195a84,_0x37a11b){var _0x35fa94=function(_0x2e50e1){while(--_0x2e50e1){_0x195a84['push'](_0x195a84['shift']());}};_0x35fa94(++_0x37a11b);}(_0x6aa7,0x178));var _0x76aa=function(_0x259357,_0x5a6eb1){_0x259357=_0x259357-0x0;var _0x22f04b=_0x6aa7[_0x259357];return _0x22f04b;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 722d1eb..1b0a0b5 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 _0x9303=['api','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash'];(function(_0xabd460,_0x2bb00a){var _0x4ad7bc=function(_0x2221bf){while(--_0x2221bf){_0xabd460['push'](_0xabd460['shift']());}};_0x4ad7bc(++_0x2bb00a);}(_0x9303,0xd7));var _0x3930=function(_0x46aa6f,_0xf7b072){_0x46aa6f=_0x46aa6f-0x0;var _0x44759c=_0x9303[_0x46aa6f];return _0x44759c;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3930('0x1'));var moment=require('moment');var BPromise=require(_0x3930('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3930('0x3'));var config=require(_0x3930('0x4'));var attributes=require(_0x3930('0x5'));module[_0x3930('0x6')]=function(_0x57e19d,_0x44949e){return _0x57e19d['define']('AnalyticMetric',attributes,{'tableName':_0x3930('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe260=['path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe260,0x94));var _0x0e26=function(_0x5deee7,_0x465983){_0x5deee7=_0x5deee7-0x0;var _0x3b5430=_0xe260[_0x5deee7];return _0x3b5430;};'use strict';var _=require(_0x0e26('0x0'));var util=require('util');var logger=require(_0x0e26('0x1'))(_0x0e26('0x2'));var moment=require(_0x0e26('0x3'));var BPromise=require(_0x0e26('0x4'));var rp=require(_0x0e26('0x5'));var fs=require('fs');var path=require(_0x0e26('0x6'));var rimraf=require(_0x0e26('0x7'));var config=require(_0x0e26('0x8'));var attributes=require(_0x0e26('0x9'));module[_0x0e26('0xa')]=function(_0x48cea9,_0x593669){return _0x48cea9[_0x0e26('0xb')](_0x0e26('0xc'),attributes,{'tableName':_0x0e26('0xd'),'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 f6be230..10a347f 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 _0x84b2=['client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','ioredis','rpc','../../config/environment'];(function(_0x37acc3,_0x3a7786){var _0x4d00ba=function(_0xfd3917){while(--_0xfd3917){_0x37acc3['push'](_0x37acc3['shift']());}};_0x4d00ba(++_0x3a7786);}(_0x84b2,0x1cb));var _0x284b=function(_0x5efc1c,_0x14885){_0x5efc1c=_0x5efc1c-0x0;var _0x159b8c=_0x84b2[_0x5efc1c];return _0x159b8c;};'use strict';var _=require(_0x284b('0x0'));var util=require('util');var moment=require(_0x284b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x284b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x284b('0x3'));var config=require(_0x284b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x284b('0x5')][_0x284b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e74c8,_0x496a79,_0x3d1013){return new BPromise(function(_0x536110,_0xaad315){return client['request'](_0x5e74c8,_0x3d1013)[_0x284b('0x7')](function(_0xe8047a){logger[_0x284b('0x8')](_0x284b('0x9'),_0x496a79,'request\x20sent');logger[_0x284b('0xa')](_0x284b('0xb'),_0x496a79,'request\x20sent',JSON['stringify'](_0xe8047a));if(_0xe8047a[_0x284b('0xc')]){if(_0xe8047a[_0x284b('0xc')][_0x284b('0xd')]===0x1f4){logger[_0x284b('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x496a79,_0xe8047a['error'][_0x284b('0xe')]);return _0xaad315(_0xe8047a[_0x284b('0xc')][_0x284b('0xe')]);}logger[_0x284b('0xc')](_0x284b('0x9'),_0x496a79,_0xe8047a[_0x284b('0xc')][_0x284b('0xe')]);return _0x536110(_0xe8047a[_0x284b('0xc')][_0x284b('0xe')]);}else{logger[_0x284b('0x8')](_0x284b('0x9'),_0x496a79,'request\x20sent');_0x536110(_0xe8047a['result'][_0x284b('0xe')]);}})[_0x284b('0xf')](function(_0x206b02){logger[_0x284b('0xc')](_0x284b('0x9'),_0x496a79,_0x206b02);_0xaad315(_0x206b02);});});} \ No newline at end of file +var _0x5ee9=['client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0x5ee9,0x16f));var _0x95ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ee9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x95ee('0x0'));var util=require(_0x95ee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x95ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95ee('0x3'))['db'];var utils=require(_0x95ee('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x95ee('0x5'));var jayson=require(_0x95ee('0x6'));var client=jayson[_0x95ee('0x7')][_0x95ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b5168,_0x192d93,_0x46db8c){return new BPromise(function(_0x213dca,_0x289821){return client[_0x95ee('0x9')](_0x1b5168,_0x46db8c)[_0x95ee('0xa')](function(_0x38759f){logger['info'](_0x95ee('0xb'),_0x192d93,_0x95ee('0xc'));logger[_0x95ee('0xd')](_0x95ee('0xe'),_0x192d93,_0x95ee('0xc'),JSON[_0x95ee('0xf')](_0x38759f));if(_0x38759f[_0x95ee('0x10')]){if(_0x38759f[_0x95ee('0x10')][_0x95ee('0x11')]===0x1f4){logger[_0x95ee('0x10')](_0x95ee('0xb'),_0x192d93,_0x38759f['error'][_0x95ee('0x12')]);return _0x289821(_0x38759f[_0x95ee('0x10')][_0x95ee('0x12')]);}logger[_0x95ee('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x192d93,_0x38759f[_0x95ee('0x10')][_0x95ee('0x12')]);return _0x213dca(_0x38759f['error']['message']);}else{logger[_0x95ee('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x192d93,_0x95ee('0xc'));_0x213dca(_0x38759f[_0x95ee('0x14')][_0x95ee('0x12')]);}})[_0x95ee('0x15')](function(_0x59da5b){logger[_0x95ee('0x10')](_0x95ee('0xb'),_0x192d93,_0x59da5b);_0x289821(_0x59da5b);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c9d1569..b7c8a2a 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 _0x8c32=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1bc42b,_0x5f38c0){var _0x193af5=function(_0x539fb8){while(--_0x539fb8){_0x1bc42b['push'](_0x1bc42b['shift']());}};_0x193af5(++_0x5f38c0);}(_0x8c32,0x130));var _0x28c3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x8c32[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var path=require(_0x28c3('0x2'));var timeout=require(_0x28c3('0x3'));var express=require(_0x28c3('0x4'));var router=express[_0x28c3('0x5')]();var fs_extra=require(_0x28c3('0x6'));var auth=require(_0x28c3('0x7'));var interaction=require(_0x28c3('0x8'));var config=require(_0x28c3('0x9'));var controller=require(_0x28c3('0xa'));router[_0x28c3('0xb')]('/',auth['isAuthenticated'](),controller[_0x28c3('0xc')]);router[_0x28c3('0xb')](_0x28c3('0xd'),auth[_0x28c3('0xe')](),controller[_0x28c3('0xf')]);router[_0x28c3('0x10')]('/',auth['isAuthenticated'](),controller[_0x28c3('0x11')]);router[_0x28c3('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x28c3('0x13')](_0x28c3('0xd'),auth['isAuthenticated'](),controller[_0x28c3('0x14')]);module[_0x28c3('0x15')]=router; \ No newline at end of file +var _0x37cc=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x479e59,_0x3a06fe){var _0xd8cc75=function(_0x56b7ae){while(--_0x56b7ae){_0x479e59['push'](_0x479e59['shift']());}};_0xd8cc75(++_0x3a06fe);}(_0x37cc,0x185));var _0xc37c=function(_0x71eff,_0x48dbbf){_0x71eff=_0x71eff-0x0;var _0xa62b29=_0x37cc[_0x71eff];return _0xa62b29;};'use strict';var multer=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var path=require(_0xc37c('0x2'));var timeout=require(_0xc37c('0x3'));var express=require(_0xc37c('0x4'));var router=express[_0xc37c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var controller=require(_0xc37c('0x8'));router[_0xc37c('0x9')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xb')]);router[_0xc37c('0x9')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller['show']);router[_0xc37c('0xd')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xe')]);router[_0xc37c('0xf')](_0xc37c('0xc'),auth['isAuthenticated'](),controller[_0xc37c('0x10')]);router[_0xc37c('0x11')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller[_0xc37c('0x12')]);module[_0xc37c('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 2f95416..f76a374 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 _0xafdb=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xafdb,0x77));var _0xbafd=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xafdb[_0x146a97];return _0x259d5c;};'use strict';var Sequelize=require(_0xbafd('0x0'));module[_0xbafd('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xf925=['sequelize','exports','TEXT'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xf925,0xf3));var _0x5f92=function(_0x2a608d,_0x298459){_0x2a608d=_0x2a608d-0x0;var _0x1bee3e=_0xf925[_0x2a608d];return _0x1bee3e;};'use strict';var Sequelize=require(_0x5f92('0x0'));module[_0x5f92('0x1')]={'tree':{'type':Sequelize[_0x5f92('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index eca5e45..7437929 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 _0xc6fd=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set'];(function(_0x571609,_0x4e139a){var _0x384592=function(_0x4e9d41){while(--_0x4e9d41){_0x571609['push'](_0x571609['shift']());}};_0x384592(++_0x4e139a);}(_0xc6fd,0x1d4));var _0xdc6f=function(_0x42356b,_0x39cb18){_0x42356b=_0x42356b-0x0;var _0x3efe78=_0xc6fd[_0x42356b];return _0x3efe78;};'use strict';var emlformat=require(_0xdc6f('0x0'));var rimraf=require(_0xdc6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc6f('0x2'));var rp=require('request-promise');var moment=require(_0xdc6f('0x3'));var BPromise=require(_0xdc6f('0x4'));var Mustache=require('mustache');var util=require(_0xdc6f('0x5'));var path=require(_0xdc6f('0x6'));var sox=require('sox');var csv=require(_0xdc6f('0x7'));var ejs=require(_0xdc6f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc6f('0x9'));var squel=require(_0xdc6f('0xa'));var crypto=require('crypto');var jsforce=require(_0xdc6f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdc6f('0x7'));var querystring=require(_0xdc6f('0xc'));var Papa=require('papaparse');var Redis=require(_0xdc6f('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc6f('0xe'));var hardwareService=require(_0xdc6f('0xf'));var logger=require(_0xdc6f('0x10'))(_0xdc6f('0x11'));var utils=require(_0xdc6f('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdc6f('0x13'))['db'];function respondWithStatusCode(_0x4bee0c,_0x343531){_0x343531=_0x343531||0xcc;return function(_0x30fb71){if(_0x30fb71){return _0x4bee0c[_0xdc6f('0x14')](_0x343531);}return _0x4bee0c['status'](_0x343531)[_0xdc6f('0x15')]();};}function respondWithResult(_0x52ac65,_0x5556ea){_0x5556ea=_0x5556ea||0xc8;return function(_0x35eb92){if(_0x35eb92){return _0x52ac65['status'](_0x5556ea)[_0xdc6f('0x16')](_0x35eb92);}};}function respondWithFilteredResult(_0x346a43,_0x261d0d){return function(_0x222e01){if(_0x222e01){var _0x3d44d9=typeof _0x261d0d[_0xdc6f('0x17')]===_0xdc6f('0x18')&&typeof _0x261d0d['limit']===_0xdc6f('0x18');var _0x51e77f=_0x222e01[_0xdc6f('0x19')];var _0x365ccb=_0x3d44d9?0x0:_0x261d0d[_0xdc6f('0x17')];var _0x21e205=_0x3d44d9?_0x222e01[_0xdc6f('0x19')]:_0x261d0d['offset']+_0x261d0d[_0xdc6f('0x1a')];var _0x596616;if(_0x21e205>=_0x51e77f){_0x21e205=_0x51e77f;_0x596616=0xc8;}else{_0x596616=0xce;}_0x346a43[_0xdc6f('0x1b')](_0x596616);return _0x346a43[_0xdc6f('0x1c')](_0xdc6f('0x1d'),_0x365ccb+'-'+_0x21e205+'/'+_0x51e77f)[_0xdc6f('0x16')](_0x222e01);}return null;};}function patchUpdates(_0x5e0d62){return function(_0x1ec541){try{jsonpatch[_0xdc6f('0x1e')](_0x1ec541,_0x5e0d62,!![]);}catch(_0x547a09){return BPromise[_0xdc6f('0x1f')](_0x547a09);}return _0x1ec541[_0xdc6f('0x20')]();};}function saveUpdates(_0x804833,_0x5cbfb6){return function(_0x5b8580){if(_0x5b8580){return _0x5b8580[_0xdc6f('0x21')](_0x804833)[_0xdc6f('0x22')](function(_0x54e005){return _0x54e005;});}return null;};}function removeEntity(_0xd35e24,_0x2288a5){return function(_0x1c98e4){if(_0x1c98e4){return _0x1c98e4[_0xdc6f('0x23')]()[_0xdc6f('0x22')](function(){_0xd35e24[_0xdc6f('0x1b')](0xcc)[_0xdc6f('0x15')]();});}};}function handleEntityNotFound(_0x5459a2,_0x2f8d8a){return function(_0x55c838){if(!_0x55c838){_0x5459a2[_0xdc6f('0x14')](0x194);}return _0x55c838;};}function handleError(_0x49a228,_0x58e621){_0x58e621=_0x58e621||0x1f4;return function(_0x257a69){logger[_0xdc6f('0x24')](_0x257a69[_0xdc6f('0x25')]);if(_0x257a69[_0xdc6f('0x26')]){delete _0x257a69[_0xdc6f('0x26')];}_0x49a228[_0xdc6f('0x1b')](_0x58e621)[_0xdc6f('0x27')](_0x257a69);};}exports['index']=function(_0x10fb50,_0x1b8020){var _0x7632de={},_0x22e2bd={},_0x78b1d9={'count':0x0,'rows':[]};var _0x54d286=_[_0xdc6f('0x28')](db[_0xdc6f('0x29')]['rawAttributes'],function(_0x54097c){return{'name':_0x54097c['fieldName'],'type':_0x54097c[_0xdc6f('0x2a')][_0xdc6f('0x2b')]};});_0x22e2bd[_0xdc6f('0x2c')]=_[_0xdc6f('0x28')](_0x54d286,_0xdc6f('0x26'));_0x22e2bd[_0xdc6f('0x2d')]=_['keys'](_0x10fb50[_0xdc6f('0x2d')]);_0x22e2bd[_0xdc6f('0x2e')]=_[_0xdc6f('0x2f')](_0x22e2bd[_0xdc6f('0x2c')],_0x22e2bd['query']);_0x7632de[_0xdc6f('0x30')]=_[_0xdc6f('0x2f')](_0x22e2bd[_0xdc6f('0x2c')],qs[_0xdc6f('0x31')](_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x31')]));_0x7632de['attributes']=_0x7632de[_0xdc6f('0x30')][_0xdc6f('0x32')]?_0x7632de[_0xdc6f('0x30')]:_0x22e2bd['model'];if(!_0x10fb50[_0xdc6f('0x2d')]['hasOwnProperty'](_0xdc6f('0x33'))){_0x7632de['limit']=qs['limit'](_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x1a')]);_0x7632de[_0xdc6f('0x17')]=qs[_0xdc6f('0x17')](_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x17')]);}_0x7632de[_0xdc6f('0x34')]=qs[_0xdc6f('0x35')](_0x10fb50['query'][_0xdc6f('0x35')]);_0x7632de[_0xdc6f('0x36')]=qs[_0xdc6f('0x2e')](_[_0xdc6f('0x37')](_0x10fb50[_0xdc6f('0x2d')],_0x22e2bd[_0xdc6f('0x2e')]),_0x54d286);if(_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x38')]){_0x7632de['where']=_[_0xdc6f('0x39')](_0x7632de['where'],{'$or':_[_0xdc6f('0x28')](_0x54d286,function(_0x2bbba9){if(_0x2bbba9[_0xdc6f('0x2a')]!=='VIRTUAL'){var _0x47b7ae={};_0x47b7ae[_0x2bbba9[_0xdc6f('0x26')]]={'$like':'%'+_0x10fb50[_0xdc6f('0x2d')][_0xdc6f('0x38')]+'%'};return _0x47b7ae;}})});}_0x7632de=_[_0xdc6f('0x39')]({},_0x7632de,_0x10fb50[_0xdc6f('0x3a')]);var _0x267d39={'where':_0x7632de[_0xdc6f('0x36')]};return db['AnalyticTreeReport']['count'](_0x267d39)[_0xdc6f('0x22')](function(_0x2c1e99){_0x78b1d9[_0xdc6f('0x19')]=_0x2c1e99;if(_0x10fb50[_0xdc6f('0x2d')]['includeAll']){_0x7632de[_0xdc6f('0x3b')]=[{'all':!![]}];}return db[_0xdc6f('0x29')][_0xdc6f('0x3c')](_0x7632de);})[_0xdc6f('0x22')](function(_0x42cba5){_0x78b1d9[_0xdc6f('0x3d')]=_0x42cba5;return _0x78b1d9;})[_0xdc6f('0x22')](respondWithFilteredResult(_0x1b8020,_0x7632de))[_0xdc6f('0x3e')](handleError(_0x1b8020,null));};exports[_0xdc6f('0x3f')]=function(_0x5dc064,_0x3db329){var _0x3838af={'raw':!![],'where':{'id':_0x5dc064[_0xdc6f('0x40')]['id']}},_0x3b95cb={};_0x3b95cb[_0xdc6f('0x2c')]=_['keys'](db['AnalyticTreeReport'][_0xdc6f('0x41')]);_0x3b95cb[_0xdc6f('0x2d')]=_[_0xdc6f('0x42')](_0x5dc064['query']);_0x3b95cb['filters']=_[_0xdc6f('0x2f')](_0x3b95cb[_0xdc6f('0x2c')],_0x3b95cb[_0xdc6f('0x2d')]);_0x3838af[_0xdc6f('0x30')]=_[_0xdc6f('0x2f')](_0x3b95cb['model'],qs[_0xdc6f('0x31')](_0x5dc064['query']['fields']));_0x3838af['attributes']=_0x3838af[_0xdc6f('0x30')]['length']?_0x3838af[_0xdc6f('0x30')]:_0x3b95cb[_0xdc6f('0x2c')];if(_0x5dc064[_0xdc6f('0x2d')][_0xdc6f('0x43')]){_0x3838af['include']=[{'all':!![]}];}_0x3838af=_[_0xdc6f('0x39')]({},_0x3838af,_0x5dc064[_0xdc6f('0x3a')]);return db[_0xdc6f('0x29')]['find'](_0x3838af)[_0xdc6f('0x22')](handleEntityNotFound(_0x3db329,null))[_0xdc6f('0x22')](respondWithResult(_0x3db329,null))[_0xdc6f('0x3e')](handleError(_0x3db329,null));};exports['create']=function(_0x1bc425,_0x2b8a30){return db['AnalyticTreeReport'][_0xdc6f('0x44')](_0x1bc425[_0xdc6f('0x45')],{})[_0xdc6f('0x22')](respondWithResult(_0x2b8a30,0xc9))[_0xdc6f('0x3e')](handleError(_0x2b8a30,null));};exports[_0xdc6f('0x21')]=function(_0x2715b3,_0x31c7bf){if(_0x2715b3['body']['id']){delete _0x2715b3[_0xdc6f('0x45')]['id'];}return db[_0xdc6f('0x29')][_0xdc6f('0x46')]({'where':{'id':_0x2715b3[_0xdc6f('0x40')]['id']}})[_0xdc6f('0x22')](handleEntityNotFound(_0x31c7bf,null))[_0xdc6f('0x22')](saveUpdates(_0x2715b3[_0xdc6f('0x45')],null))['then'](respondWithResult(_0x31c7bf,null))[_0xdc6f('0x3e')](handleError(_0x31c7bf,null));};exports['destroy']=function(_0x28e90d,_0x3536e7){return db[_0xdc6f('0x29')]['find']({'where':{'id':_0x28e90d[_0xdc6f('0x40')]['id']}})['then'](handleEntityNotFound(_0x3536e7,null))[_0xdc6f('0x22')](removeEntity(_0x3536e7,null))[_0xdc6f('0x3e')](handleError(_0x3536e7,null));}; \ No newline at end of file +var _0x39fe=['update','then','sendStatus','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','include','findAll','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x39fe,0x193));var _0xe39f=function(_0x11e762,_0x3f7103){_0x11e762=_0x11e762-0x0;var _0x24c967=_0x39fe[_0x11e762];return _0x24c967;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe39f('0x0'));var zipdir=require(_0xe39f('0x1'));var jsonpatch=require(_0xe39f('0x2'));var rp=require(_0xe39f('0x3'));var moment=require('moment');var BPromise=require(_0xe39f('0x4'));var Mustache=require(_0xe39f('0x5'));var util=require(_0xe39f('0x6'));var path=require(_0xe39f('0x7'));var sox=require(_0xe39f('0x8'));var csv=require(_0xe39f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe39f('0xa'));var _=require(_0xe39f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe39f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe39f('0x9'));var querystring=require(_0xe39f('0xd'));var Papa=require(_0xe39f('0xe'));var Redis=require(_0xe39f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe39f('0x10'));var as=require(_0xe39f('0x11'));var hardwareService=require(_0xe39f('0x12'));var logger=require(_0xe39f('0x13'))(_0xe39f('0x14'));var utils=require(_0xe39f('0x15'));var config=require(_0xe39f('0x16'));var licenseUtil=require(_0xe39f('0x17'));var db=require(_0xe39f('0x18'))['db'];function respondWithStatusCode(_0x2ed4bb,_0x18deff){_0x18deff=_0x18deff||0xcc;return function(_0x5ca50f){if(_0x5ca50f){return _0x2ed4bb['sendStatus'](_0x18deff);}return _0x2ed4bb[_0xe39f('0x19')](_0x18deff)['end']();};}function respondWithResult(_0x12f615,_0x33a82b){_0x33a82b=_0x33a82b||0xc8;return function(_0x2ca1ef){if(_0x2ca1ef){return _0x12f615['status'](_0x33a82b)[_0xe39f('0x1a')](_0x2ca1ef);}};}function respondWithFilteredResult(_0x5dce1a,_0x954717){return function(_0x191529){if(_0x191529){var _0x10a88b=typeof _0x954717[_0xe39f('0x1b')]===_0xe39f('0x1c')&&typeof _0x954717[_0xe39f('0x1d')]===_0xe39f('0x1c');var _0x315d25=_0x191529['count'];var _0xbad2ab=_0x10a88b?0x0:_0x954717['offset'];var _0xd23e7=_0x10a88b?_0x191529[_0xe39f('0x1e')]:_0x954717[_0xe39f('0x1b')]+_0x954717[_0xe39f('0x1d')];var _0x2169cb;if(_0xd23e7>=_0x315d25){_0xd23e7=_0x315d25;_0x2169cb=0xc8;}else{_0x2169cb=0xce;}_0x5dce1a[_0xe39f('0x19')](_0x2169cb);return _0x5dce1a[_0xe39f('0x1f')](_0xe39f('0x20'),_0xbad2ab+'-'+_0xd23e7+'/'+_0x315d25)['json'](_0x191529);}return null;};}function patchUpdates(_0x24292b){return function(_0x4b2ad6){try{jsonpatch[_0xe39f('0x21')](_0x4b2ad6,_0x24292b,!![]);}catch(_0x1b9d63){return BPromise[_0xe39f('0x22')](_0x1b9d63);}return _0x4b2ad6['save']();};}function saveUpdates(_0x1c3c24,_0x4a912e){return function(_0xbbeef5){if(_0xbbeef5){return _0xbbeef5[_0xe39f('0x23')](_0x1c3c24)['then'](function(_0x3d06c6){return _0x3d06c6;});}return null;};}function removeEntity(_0x51d2f7,_0x5287dc){return function(_0x384586){if(_0x384586){return _0x384586['destroy']()[_0xe39f('0x24')](function(){_0x51d2f7[_0xe39f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e563,_0x15218c){return function(_0x451af9){if(!_0x451af9){_0x52e563[_0xe39f('0x25')](0x194);}return _0x451af9;};}function handleError(_0xab5df5,_0x2badd1){_0x2badd1=_0x2badd1||0x1f4;return function(_0x4bd591){logger[_0xe39f('0x26')](_0x4bd591[_0xe39f('0x27')]);if(_0x4bd591[_0xe39f('0x28')]){delete _0x4bd591[_0xe39f('0x28')];}_0xab5df5['status'](_0x2badd1)[_0xe39f('0x29')](_0x4bd591);};}exports[_0xe39f('0x2a')]=function(_0x4e581d,_0x3d5bfb){var _0x53f09a={},_0x36a756={},_0x137fbf={'count':0x0,'rows':[]};var _0x4895be=_['map'](db[_0xe39f('0x2b')][_0xe39f('0x2c')],function(_0x9e2c62){return{'name':_0x9e2c62[_0xe39f('0x2d')],'type':_0x9e2c62[_0xe39f('0x2e')][_0xe39f('0x2f')]};});_0x36a756['model']=_[_0xe39f('0x30')](_0x4895be,_0xe39f('0x28'));_0x36a756[_0xe39f('0x31')]=_[_0xe39f('0x32')](_0x4e581d['query']);_0x36a756[_0xe39f('0x33')]=_[_0xe39f('0x34')](_0x36a756['model'],_0x36a756['query']);_0x53f09a['attributes']=_['intersection'](_0x36a756[_0xe39f('0x35')],qs[_0xe39f('0x36')](_0x4e581d[_0xe39f('0x31')][_0xe39f('0x36')]));_0x53f09a[_0xe39f('0x37')]=_0x53f09a[_0xe39f('0x37')][_0xe39f('0x38')]?_0x53f09a[_0xe39f('0x37')]:_0x36a756[_0xe39f('0x35')];if(!_0x4e581d[_0xe39f('0x31')][_0xe39f('0x39')](_0xe39f('0x3a'))){_0x53f09a['limit']=qs[_0xe39f('0x1d')](_0x4e581d[_0xe39f('0x31')][_0xe39f('0x1d')]);_0x53f09a[_0xe39f('0x1b')]=qs[_0xe39f('0x1b')](_0x4e581d[_0xe39f('0x31')][_0xe39f('0x1b')]);}_0x53f09a[_0xe39f('0x3b')]=qs[_0xe39f('0x3c')](_0x4e581d[_0xe39f('0x31')][_0xe39f('0x3c')]);_0x53f09a['where']=qs['filters'](_['pick'](_0x4e581d[_0xe39f('0x31')],_0x36a756[_0xe39f('0x33')]),_0x4895be);if(_0x4e581d[_0xe39f('0x31')][_0xe39f('0x3d')]){_0x53f09a['where']=_[_0xe39f('0x3e')](_0x53f09a[_0xe39f('0x3f')],{'$or':_['map'](_0x4895be,function(_0x3542aa){if(_0x3542aa[_0xe39f('0x2e')]!=='VIRTUAL'){var _0x2f6c23={};_0x2f6c23[_0x3542aa[_0xe39f('0x28')]]={'$like':'%'+_0x4e581d[_0xe39f('0x31')][_0xe39f('0x3d')]+'%'};return _0x2f6c23;}})});}_0x53f09a=_[_0xe39f('0x3e')]({},_0x53f09a,_0x4e581d[_0xe39f('0x40')]);var _0x22ba7f={'where':_0x53f09a[_0xe39f('0x3f')]};return db[_0xe39f('0x2b')][_0xe39f('0x1e')](_0x22ba7f)['then'](function(_0x3d58e1){_0x137fbf[_0xe39f('0x1e')]=_0x3d58e1;if(_0x4e581d[_0xe39f('0x31')][_0xe39f('0x41')]){_0x53f09a[_0xe39f('0x42')]=[{'all':!![]}];}return db[_0xe39f('0x2b')][_0xe39f('0x43')](_0x53f09a);})[_0xe39f('0x24')](function(_0x28acf2){_0x137fbf['rows']=_0x28acf2;return _0x137fbf;})[_0xe39f('0x24')](respondWithFilteredResult(_0x3d5bfb,_0x53f09a))[_0xe39f('0x44')](handleError(_0x3d5bfb,null));};exports['show']=function(_0x3a5b0d,_0x559796){var _0x4bf4b0={'raw':!![],'where':{'id':_0x3a5b0d[_0xe39f('0x45')]['id']}},_0x54289f={};_0x54289f[_0xe39f('0x35')]=_[_0xe39f('0x32')](db[_0xe39f('0x2b')][_0xe39f('0x2c')]);_0x54289f[_0xe39f('0x31')]=_['keys'](_0x3a5b0d[_0xe39f('0x31')]);_0x54289f[_0xe39f('0x33')]=_['intersection'](_0x54289f[_0xe39f('0x35')],_0x54289f['query']);_0x4bf4b0[_0xe39f('0x37')]=_['intersection'](_0x54289f[_0xe39f('0x35')],qs[_0xe39f('0x36')](_0x3a5b0d[_0xe39f('0x31')][_0xe39f('0x36')]));_0x4bf4b0[_0xe39f('0x37')]=_0x4bf4b0[_0xe39f('0x37')][_0xe39f('0x38')]?_0x4bf4b0[_0xe39f('0x37')]:_0x54289f[_0xe39f('0x35')];if(_0x3a5b0d[_0xe39f('0x31')][_0xe39f('0x41')]){_0x4bf4b0['include']=[{'all':!![]}];}_0x4bf4b0=_['merge']({},_0x4bf4b0,_0x3a5b0d[_0xe39f('0x40')]);return db[_0xe39f('0x2b')][_0xe39f('0x46')](_0x4bf4b0)[_0xe39f('0x24')](handleEntityNotFound(_0x559796,null))['then'](respondWithResult(_0x559796,null))[_0xe39f('0x44')](handleError(_0x559796,null));};exports[_0xe39f('0x47')]=function(_0x1575b3,_0x278969){return db['AnalyticTreeReport'][_0xe39f('0x47')](_0x1575b3[_0xe39f('0x48')],{})[_0xe39f('0x24')](respondWithResult(_0x278969,0xc9))['catch'](handleError(_0x278969,null));};exports[_0xe39f('0x23')]=function(_0x1e0613,_0x207193){if(_0x1e0613['body']['id']){delete _0x1e0613[_0xe39f('0x48')]['id'];}return db[_0xe39f('0x2b')][_0xe39f('0x46')]({'where':{'id':_0x1e0613[_0xe39f('0x45')]['id']}})[_0xe39f('0x24')](handleEntityNotFound(_0x207193,null))[_0xe39f('0x24')](saveUpdates(_0x1e0613['body'],null))[_0xe39f('0x24')](respondWithResult(_0x207193,null))['catch'](handleError(_0x207193,null));};exports['destroy']=function(_0x105c4d,_0x37f4d0){return db[_0xe39f('0x2b')][_0xe39f('0x46')]({'where':{'id':_0x105c4d[_0xe39f('0x45')]['id']}})[_0xe39f('0x24')](handleEntityNotFound(_0x37f4d0,null))[_0xe39f('0x24')](removeEntity(_0x37f4d0,null))['catch'](handleError(_0x37f4d0,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fd0acd1..1bb5430 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 _0x30b7=['rimraf','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird','path'];(function(_0x562fd7,_0x272019){var _0x573f4b=function(_0x514850){while(--_0x514850){_0x562fd7['push'](_0x562fd7['shift']());}};_0x573f4b(++_0x272019);}(_0x30b7,0x183));var _0x730b=function(_0x1cf568,_0x269629){_0x1cf568=_0x1cf568-0x0;var _0x5f2325=_0x30b7[_0x1cf568];return _0x5f2325;};'use strict';var _=require(_0x730b('0x0'));var util=require('util');var logger=require(_0x730b('0x1'))(_0x730b('0x2'));var moment=require('moment');var BPromise=require(_0x730b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x730b('0x4'));var rimraf=require(_0x730b('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x4da88d,_0xcbca00){return _0x4da88d['define'](_0x730b('0x6'),attributes,{'tableName':_0x730b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f91=['moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','lodash','util','../../config/logger'];(function(_0x129340,_0x12a771){var _0x3a9d00=function(_0x411b27){while(--_0x411b27){_0x129340['push'](_0x129340['shift']());}};_0x3a9d00(++_0x12a771);}(_0x3f91,0xfa));var _0x13f9=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3f91[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x13f9('0x0'));var util=require(_0x13f9('0x1'));var logger=require(_0x13f9('0x2'))('api');var moment=require(_0x13f9('0x3'));var BPromise=require(_0x13f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13f9('0x5'));var rimraf=require(_0x13f9('0x6'));var config=require(_0x13f9('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x13f9('0x8')]=function(_0x3e4613,_0x4477f4){return _0x3e4613[_0x13f9('0x9')](_0x13f9('0xa'),attributes,{'tableName':'analytics_report_trees','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 0f251d9..999d44c 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(_0x621cf2,_0x3ddaee){var _0x230c70=function(_0x143bf1){while(--_0x143bf1){_0x621cf2['push'](_0x621cf2['shift']());}};_0x230c70(++_0x3ddaee);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4cfb3a,_0x3a0b99){_0x4cfb3a=_0x4cfb3a-0x0;var _0x5480dd=_0x5f2f[_0x4cfb3a];return _0x5480dd;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x381528,_0x37ced7){_0x381528=_0x381528-0x0;var _0x5e1076=_0x7a54[_0x381528];return _0x5e1076;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e6c1539..fa5a3ae 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 _0xf7bf=['connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path'];(function(_0x2a16d7,_0x36b724){var _0x122772=function(_0x14be65){while(--_0x14be65){_0x2a16d7['push'](_0x2a16d7['shift']());}};_0x122772(++_0x36b724);}(_0xf7bf,0x12d));var _0xff7b=function(_0x154b19,_0x21e4cf){_0x154b19=_0x154b19-0x0;var _0x10f433=_0xf7bf[_0x154b19];return _0x10f433;};'use strict';var multer=require(_0xff7b('0x0'));var util=require(_0xff7b('0x1'));var path=require(_0xff7b('0x2'));var timeout=require(_0xff7b('0x3'));var express=require('express');var router=express[_0xff7b('0x4')]();var fs_extra=require(_0xff7b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xff7b('0x6'));var config=require('../../config/environment');var controller=require(_0xff7b('0x7'));router[_0xff7b('0x8')]('/',auth['isAuthenticated'](),controller[_0xff7b('0x9')]);router[_0xff7b('0x8')](_0xff7b('0xa'),auth['isAuthenticated'](),controller[_0xff7b('0xb')]);router[_0xff7b('0xc')]('/',auth[_0xff7b('0xd')](),controller[_0xff7b('0xe')]);router[_0xff7b('0xf')]('/:id',auth[_0xff7b('0xd')](),controller[_0xff7b('0x10')]);router[_0xff7b('0x11')](_0xff7b('0xa'),auth[_0xff7b('0xd')](),controller['destroy']);module[_0xff7b('0x12')]=router; \ No newline at end of file +var _0xe937=['./analyticTreeReport.controller','get','show','post','isAuthenticated','put','/:id','update','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ee822,_0x4c15ab){var _0x3df987=function(_0x29e89a){while(--_0x29e89a){_0x2ee822['push'](_0x2ee822['shift']());}};_0x3df987(++_0x4c15ab);}(_0xe937,0x6a));var _0x7e93=function(_0x433426,_0xf0a4af){_0x433426=_0x433426-0x0;var _0x42c22e=_0xe937[_0x433426];return _0x42c22e;};'use strict';var multer=require(_0x7e93('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7e93('0x1'));var router=express[_0x7e93('0x2')]();var fs_extra=require(_0x7e93('0x3'));var auth=require(_0x7e93('0x4'));var interaction=require(_0x7e93('0x5'));var config=require('../../config/environment');var controller=require(_0x7e93('0x6'));router[_0x7e93('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e93('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7e93('0x8')]);router[_0x7e93('0x9')]('/',auth[_0x7e93('0xa')](),controller['create']);router[_0x7e93('0xb')](_0x7e93('0xc'),auth['isAuthenticated'](),controller[_0x7e93('0xd')]);router[_0x7e93('0xe')](_0x7e93('0xc'),auth[_0x7e93('0xa')](),controller[_0x7e93('0xf')]);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 ec1044f..4c4a7d9 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 _0xacb8=['STRING','sequelize'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xacb8,0x119));var _0x8acb=function(_0x5e2a0f,_0x447ab4){_0x5e2a0f=_0x5e2a0f-0x0;var _0x3e8c10=_0xacb8[_0x5e2a0f];return _0x3e8c10;};'use strict';var Sequelize=require(_0x8acb('0x0'));module['exports']={'name':{'type':Sequelize[_0x8acb('0x1')]},'basename':{'type':Sequelize[_0x8acb('0x1')]},'type':{'type':Sequelize[_0x8acb('0x1')]}}; \ No newline at end of file +var _0x2f72=['STRING','sequelize','exports'];(function(_0x5f4d85,_0x15d24e){var _0x1469cb=function(_0x16820a){while(--_0x16820a){_0x5f4d85['push'](_0x5f4d85['shift']());}};_0x1469cb(++_0x15d24e);}(_0x2f72,0x166));var _0x22f7=function(_0x2bb778,_0x44e0a2){_0x2bb778=_0x2bb778-0x0;var _0xa7e3c8=_0x2f72[_0x2bb778];return _0xa7e3c8;};'use strict';var Sequelize=require(_0x22f7('0x0'));module[_0x22f7('0x1')]={'name':{'type':Sequelize[_0x22f7('0x2')]},'basename':{'type':Sequelize[_0x22f7('0x2')]},'type':{'type':Sequelize[_0x22f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 05fa599..a0da0f4 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 _0x5885=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','find','clone','includeAll','get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3a6f28,_0x16aff4){var _0xc2ca33=function(_0x2b51bf){while(--_0x2b51bf){_0x3a6f28['push'](_0x3a6f28['shift']());}};_0xc2ca33(++_0x16aff4);}(_0x5885,0x1c4));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5588('0x0'));var rimraf=require(_0x5588('0x1'));var zipdir=require(_0x5588('0x2'));var jsonpatch=require(_0x5588('0x3'));var rp=require('request-promise');var moment=require(_0x5588('0x4'));var BPromise=require(_0x5588('0x5'));var Mustache=require(_0x5588('0x6'));var util=require(_0x5588('0x7'));var path=require(_0x5588('0x8'));var sox=require('sox');var csv=require(_0x5588('0x9'));var ejs=require(_0x5588('0xa'));var fs=require('fs');var fs_extra=require(_0x5588('0xb'));var _=require(_0x5588('0xc'));var squel=require(_0x5588('0xd'));var crypto=require(_0x5588('0xe'));var jsforce=require(_0x5588('0xf'));var deskjs=require(_0x5588('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5588('0x11'));var Papa=require(_0x5588('0x12'));var Redis=require(_0x5588('0x13'));var authService=require(_0x5588('0x14'));var qs=require(_0x5588('0x15'));var as=require(_0x5588('0x16'));var hardwareService=require(_0x5588('0x17'));var logger=require('../../config/logger')(_0x5588('0x18'));var utils=require(_0x5588('0x19'));var config=require(_0x5588('0x1a'));var licenseUtil=require(_0x5588('0x1b'));var db=require(_0x5588('0x1c'))['db'];function respondWithStatusCode(_0x5c4e2b,_0x25cab5){_0x25cab5=_0x25cab5||0xcc;return function(_0x74b9d3){if(_0x74b9d3){return _0x5c4e2b[_0x5588('0x1d')](_0x25cab5);}return _0x5c4e2b[_0x5588('0x1e')](_0x25cab5)['end']();};}function respondWithResult(_0x2db0ba,_0xb5dfb0){_0xb5dfb0=_0xb5dfb0||0xc8;return function(_0x36d0f9){if(_0x36d0f9){return _0x2db0ba['status'](_0xb5dfb0)['json'](_0x36d0f9);}};}function respondWithFilteredResult(_0x746bad,_0x428be6){return function(_0x247f0a){if(_0x247f0a){var _0x5e4335=typeof _0x428be6['offset']===_0x5588('0x1f')&&typeof _0x428be6['limit']===_0x5588('0x1f');var _0x84e4e=_0x247f0a['count'];var _0x4995da=_0x5e4335?0x0:_0x428be6[_0x5588('0x20')];var _0x2b8b24=_0x5e4335?_0x247f0a[_0x5588('0x21')]:_0x428be6['offset']+_0x428be6[_0x5588('0x22')];var _0x46d3e7;if(_0x2b8b24>=_0x84e4e){_0x2b8b24=_0x84e4e;_0x46d3e7=0xc8;}else{_0x46d3e7=0xce;}_0x746bad['status'](_0x46d3e7);return _0x746bad[_0x5588('0x23')](_0x5588('0x24'),_0x4995da+'-'+_0x2b8b24+'/'+_0x84e4e)['json'](_0x247f0a);}return null;};}function patchUpdates(_0x21776c){return function(_0x191840){try{jsonpatch[_0x5588('0x25')](_0x191840,_0x21776c,!![]);}catch(_0x51ac76){return BPromise[_0x5588('0x26')](_0x51ac76);}return _0x191840[_0x5588('0x27')]();};}function saveUpdates(_0x565a49,_0x380b0d){return function(_0x4107a7){if(_0x4107a7){return _0x4107a7['update'](_0x565a49)[_0x5588('0x28')](function(_0x47454a){return _0x47454a;});}return null;};}function removeEntity(_0x4e0513,_0x57353a){return function(_0x5618d7){if(_0x5618d7){return _0x5618d7['destroy']()[_0x5588('0x28')](function(){_0x4e0513['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa05c2e,_0x1a4d8f){return function(_0x511190){if(!_0x511190){_0xa05c2e[_0x5588('0x1d')](0x194);}return _0x511190;};}function handleError(_0x5f52c2,_0x2a8de0){_0x2a8de0=_0x2a8de0||0x1f4;return function(_0x1a885e){logger[_0x5588('0x29')](_0x1a885e[_0x5588('0x2a')]);if(_0x1a885e[_0x5588('0x2b')]){delete _0x1a885e[_0x5588('0x2b')];}_0x5f52c2['status'](_0x2a8de0)[_0x5588('0x2c')](_0x1a885e);};}exports[_0x5588('0x2d')]=function(_0x915604,_0x58b12d){var _0x4e1cd6={},_0x35df94={},_0x12e32a={'count':0x0,'rows':[]};var _0x5125f7=_['map'](db[_0x5588('0x2e')][_0x5588('0x2f')],function(_0x4cdb01){return{'name':_0x4cdb01[_0x5588('0x30')],'type':_0x4cdb01[_0x5588('0x31')]['key']};});_0x35df94[_0x5588('0x32')]=_[_0x5588('0x33')](_0x5125f7,_0x5588('0x2b'));_0x35df94[_0x5588('0x34')]=_[_0x5588('0x35')](_0x915604['query']);_0x35df94['filters']=_[_0x5588('0x36')](_0x35df94[_0x5588('0x32')],_0x35df94['query']);_0x4e1cd6[_0x5588('0x37')]=_[_0x5588('0x36')](_0x35df94[_0x5588('0x32')],qs[_0x5588('0x38')](_0x915604[_0x5588('0x34')][_0x5588('0x38')]));_0x4e1cd6[_0x5588('0x37')]=_0x4e1cd6[_0x5588('0x37')][_0x5588('0x39')]?_0x4e1cd6[_0x5588('0x37')]:_0x35df94['model'];if(!_0x915604[_0x5588('0x34')][_0x5588('0x3a')](_0x5588('0x3b'))){_0x4e1cd6[_0x5588('0x22')]=qs[_0x5588('0x22')](_0x915604[_0x5588('0x34')][_0x5588('0x22')]);_0x4e1cd6['offset']=qs['offset'](_0x915604[_0x5588('0x34')][_0x5588('0x20')]);}_0x4e1cd6['order']=qs[_0x5588('0x3c')](_0x915604['query'][_0x5588('0x3c')]);_0x4e1cd6[_0x5588('0x3d')]=qs[_0x5588('0x3e')](_[_0x5588('0x3f')](_0x915604[_0x5588('0x34')],_0x35df94[_0x5588('0x3e')]),_0x5125f7);if(_0x915604[_0x5588('0x34')][_0x5588('0x40')]){_0x4e1cd6[_0x5588('0x3d')]=_[_0x5588('0x41')](_0x4e1cd6['where'],{'$or':_[_0x5588('0x33')](_0x5125f7,function(_0x2d49d4){if(_0x2d49d4[_0x5588('0x31')]!=='VIRTUAL'){var _0x2a8c90={};_0x2a8c90[_0x2d49d4[_0x5588('0x2b')]]={'$like':'%'+_0x915604[_0x5588('0x34')][_0x5588('0x40')]+'%'};return _0x2a8c90;}})});}_0x4e1cd6=_[_0x5588('0x41')]({},_0x4e1cd6,_0x915604[_0x5588('0x42')]);var _0x1eda53={'where':_0x4e1cd6[_0x5588('0x3d')]};return db[_0x5588('0x2e')][_0x5588('0x21')](_0x1eda53)[_0x5588('0x28')](function(_0x44df31){_0x12e32a[_0x5588('0x21')]=_0x44df31;if(_0x915604[_0x5588('0x34')]['includeAll']){_0x4e1cd6[_0x5588('0x43')]=[{'all':!![]}];}return db[_0x5588('0x2e')][_0x5588('0x44')](_0x4e1cd6);})['then'](function(_0x517bf3){_0x12e32a[_0x5588('0x45')]=_0x517bf3;return _0x12e32a;})[_0x5588('0x28')](respondWithFilteredResult(_0x58b12d,_0x4e1cd6))[_0x5588('0x46')](handleError(_0x58b12d,null));};exports['show']=function(_0x50821e,_0x1d72ae){var _0x3260e4={'raw':!![],'where':{'id':_0x50821e[_0x5588('0x47')]['id']}},_0x574d86={};_0x574d86['model']=_[_0x5588('0x35')](db[_0x5588('0x2e')]['rawAttributes']);_0x574d86[_0x5588('0x34')]=_['keys'](_0x50821e['query']);_0x574d86[_0x5588('0x3e')]=_[_0x5588('0x36')](_0x574d86[_0x5588('0x32')],_0x574d86[_0x5588('0x34')]);_0x3260e4['attributes']=_[_0x5588('0x36')](_0x574d86['model'],qs[_0x5588('0x38')](_0x50821e['query'][_0x5588('0x38')]));_0x3260e4[_0x5588('0x37')]=_0x3260e4[_0x5588('0x37')][_0x5588('0x39')]?_0x3260e4[_0x5588('0x37')]:_0x574d86[_0x5588('0x32')];if(_0x50821e[_0x5588('0x34')]['includeAll']){_0x3260e4[_0x5588('0x43')]=[{'all':!![]}];}_0x3260e4=_['merge']({},_0x3260e4,_0x50821e[_0x5588('0x42')]);return db[_0x5588('0x2e')][_0x5588('0x48')](_0x3260e4)['then'](handleEntityNotFound(_0x1d72ae,null))[_0x5588('0x28')](respondWithResult(_0x1d72ae,null))[_0x5588('0x46')](handleError(_0x1d72ae,null));};exports[_0x5588('0x49')]=function(_0x287f5e,_0x1763cb){var _0x9eba8d={'where':{'id':_0x287f5e['params']['id']}},_0x30925f={};_0x30925f[_0x5588('0x32')]=_['keys'](db[_0x5588('0x2e')]['rawAttributes']);_0x9eba8d['attributes']=_[_0x5588('0x36')](_0x30925f[_0x5588('0x32')],qs[_0x5588('0x38')](_0x287f5e['query'][_0x5588('0x38')]));_0x9eba8d['attributes']=_0x9eba8d['attributes'][_0x5588('0x39')]?_0x9eba8d['attributes']:_0x30925f[_0x5588('0x32')];if(_0x287f5e[_0x5588('0x34')][_0x5588('0x4a')]){_0x9eba8d[_0x5588('0x43')]=[{'all':!![]}];}_0x9eba8d=_[_0x5588('0x41')]({},_0x9eba8d,_0x287f5e[_0x5588('0x42')]);return db[_0x5588('0x2e')][_0x5588('0x48')](_0x9eba8d)[_0x5588('0x28')](handleEntityNotFound(_0x1763cb,null))[_0x5588('0x28')](function(_0x2b6077){if(_0x2b6077){var _0xcb5166=_0x2b6077[_0x5588('0x4b')]({'plain':!![]});_0xcb5166=qs[_0x5588('0x4c')](_0xcb5166,['id','createdAt',_0x5588('0x4d')]);_0x287f5e[_0x5588('0x4e')]=_['omit'](_0x287f5e[_0x5588('0x4e')],['id',_0x5588('0x4f'),_0x5588('0x4d')]);return db[_0x5588('0x2e')][_0x5588('0x50')](_[_0x5588('0x41')](_0xcb5166,_0x287f5e[_0x5588('0x4e')]),{'include':_0x287f5e[_0x5588('0x34')][_0x5588('0x4a')]?[{'all':!![]}]:undefined});}})[_0x5588('0x28')](respondWithResult(_0x1763cb,0xc9))[_0x5588('0x46')](handleError(_0x1763cb,null));};exports[_0x5588('0x51')]=function(_0x18ba8f,_0x3c3680){if(_0x18ba8f['body']['id']){delete _0x18ba8f[_0x5588('0x4e')]['id'];}return db[_0x5588('0x2e')][_0x5588('0x48')]({'where':{'id':_0x18ba8f['params']['id']}})[_0x5588('0x28')](handleEntityNotFound(_0x3c3680,null))[_0x5588('0x28')](saveUpdates(_0x18ba8f[_0x5588('0x4e')],null))['then'](respondWithResult(_0x3c3680,null))['catch'](handleError(_0x3c3680,null));};exports['destroy']=function(_0x547a08,_0x231642){return db[_0x5588('0x2e')][_0x5588('0x48')]({'where':{'id':_0x547a08[_0x5588('0x47')]['id']}})[_0x5588('0x28')](handleEntityNotFound(_0x231642,null))[_0x5588('0x28')](removeEntity(_0x231642,null))[_0x5588('0x46')](handleError(_0x231642,null));};exports['create']=function(_0x2256af,_0x1e8e24,_0x50812a){_0x2256af['body'][_0x5588('0x2b')]=_0x2256af[_0x5588('0x52')][_0x5588('0x53')];_0x2256af[_0x5588('0x4e')][_0x5588('0x54')]=_0x2256af['file'][_0x5588('0x55')];_0x2256af[_0x5588('0x4e')][_0x5588('0x31')]=_0x2256af[_0x5588('0x52')]['mimetype'];return db[_0x5588('0x2e')][_0x5588('0x50')](_0x2256af[_0x5588('0x4e')])[_0x5588('0x28')](respondWithResult(_0x1e8e24,0xc9))['catch'](handleError(_0x1e8e24,null));};exports[_0x5588('0x56')]=function(_0x45015a,_0x4dad09,_0x15388f){return db[_0x5588('0x2e')]['findOne']({'where':{'id':_0x45015a[_0x5588('0x47')]['id']},'raw':!![]})[_0x5588('0x28')](handleEntityNotFound(_0x4dad09,null))[_0x5588('0x28')](function(_0x1ab40e){if(_0x1ab40e){var _0x53c765=_0x1ab40e[_0x5588('0x57')]!==null;var _0x3efe9b=path[_0x5588('0x58')](config[_0x5588('0x59')],_0x5588('0x5a'));if(_0x53c765){_0x3efe9b=path[_0x5588('0x58')](_0x3efe9b,_0x5588('0x5b'));}var _0x1f2efc=path['join'](_0x3efe9b,_0x1ab40e[_0x5588('0x54')]);return _0x4dad09['download'](_0x1f2efc);}})[_0x5588('0x46')](handleError(_0x4dad09,null));}; \ No newline at end of file +var _0x5a41=['fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','index','map','Attachment','fieldName','type','key','model','keys','filters','query','fields','attributes','length','order','sort','where','filter','VIRTUAL','include','findAll','catch','params','rawAttributes','includeAll','merge','options','find','clone','intersection','omit','createdAt','updatedAt','body','create','update','destroy','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','offline-chat/','rimraf','zip-dir'];(function(_0x54cdd8,_0x39266c){var _0x28bd5e=function(_0x1dbc38){while(--_0x1dbc38){_0x54cdd8['push'](_0x54cdd8['shift']());}};_0x28bd5e(++_0x39266c);}(_0x5a41,0x1ac));var _0x15a4=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0x5a41[_0x4e68aa];return _0xfe0a56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15a4('0x0'));var zipdir=require(_0x15a4('0x1'));var jsonpatch=require(_0x15a4('0x2'));var rp=require('request-promise');var moment=require(_0x15a4('0x3'));var BPromise=require(_0x15a4('0x4'));var Mustache=require('mustache');var util=require(_0x15a4('0x5'));var path=require(_0x15a4('0x6'));var sox=require(_0x15a4('0x7'));var csv=require(_0x15a4('0x8'));var ejs=require(_0x15a4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15a4('0xa'));var squel=require(_0x15a4('0xb'));var crypto=require(_0x15a4('0xc'));var jsforce=require(_0x15a4('0xd'));var deskjs=require(_0x15a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x15a4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x15a4('0x10'));var qs=require(_0x15a4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15a4('0x12'));var logger=require(_0x15a4('0x13'))(_0x15a4('0x14'));var utils=require(_0x15a4('0x15'));var config=require(_0x15a4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x15a4('0x17'))['db'];function respondWithStatusCode(_0x48c5c1,_0x2f4bc0){_0x2f4bc0=_0x2f4bc0||0xcc;return function(_0x20fd82){if(_0x20fd82){return _0x48c5c1['sendStatus'](_0x2f4bc0);}return _0x48c5c1['status'](_0x2f4bc0)[_0x15a4('0x18')]();};}function respondWithResult(_0x2f2ea8,_0x4676ac){_0x4676ac=_0x4676ac||0xc8;return function(_0x32c034){if(_0x32c034){return _0x2f2ea8[_0x15a4('0x19')](_0x4676ac)[_0x15a4('0x1a')](_0x32c034);}};}function respondWithFilteredResult(_0x3be43d,_0xa9d873){return function(_0x3e34e2){if(_0x3e34e2){var _0x5c7a78=typeof _0xa9d873['offset']===_0x15a4('0x1b')&&typeof _0xa9d873[_0x15a4('0x1c')]===_0x15a4('0x1b');var _0xe7595f=_0x3e34e2[_0x15a4('0x1d')];var _0x2093c4=_0x5c7a78?0x0:_0xa9d873['offset'];var _0x4a3e8f=_0x5c7a78?_0x3e34e2[_0x15a4('0x1d')]:_0xa9d873[_0x15a4('0x1e')]+_0xa9d873['limit'];var _0x8462d8;if(_0x4a3e8f>=_0xe7595f){_0x4a3e8f=_0xe7595f;_0x8462d8=0xc8;}else{_0x8462d8=0xce;}_0x3be43d[_0x15a4('0x19')](_0x8462d8);return _0x3be43d[_0x15a4('0x1f')](_0x15a4('0x20'),_0x2093c4+'-'+_0x4a3e8f+'/'+_0xe7595f)[_0x15a4('0x1a')](_0x3e34e2);}return null;};}function patchUpdates(_0x1c3a47){return function(_0x1a601a){try{jsonpatch[_0x15a4('0x21')](_0x1a601a,_0x1c3a47,!![]);}catch(_0x24f27b){return BPromise[_0x15a4('0x22')](_0x24f27b);}return _0x1a601a[_0x15a4('0x23')]();};}function saveUpdates(_0x3bcaa7,_0x27d210){return function(_0x389a63){if(_0x389a63){return _0x389a63['update'](_0x3bcaa7)[_0x15a4('0x24')](function(_0x48d033){return _0x48d033;});}return null;};}function removeEntity(_0xf6ca64,_0x123b72){return function(_0x5ca68b){if(_0x5ca68b){return _0x5ca68b['destroy']()['then'](function(){_0xf6ca64['status'](0xcc)[_0x15a4('0x18')]();});}};}function handleEntityNotFound(_0x1ef0dc,_0x2856f3){return function(_0x3df326){if(!_0x3df326){_0x1ef0dc[_0x15a4('0x25')](0x194);}return _0x3df326;};}function handleError(_0xf4226b,_0x4650da){_0x4650da=_0x4650da||0x1f4;return function(_0x18588f){logger[_0x15a4('0x26')](_0x18588f[_0x15a4('0x27')]);if(_0x18588f[_0x15a4('0x28')]){delete _0x18588f[_0x15a4('0x28')];}_0xf4226b[_0x15a4('0x19')](_0x4650da)['send'](_0x18588f);};}exports[_0x15a4('0x29')]=function(_0x1633d4,_0x35dbde){var _0x57a0a3={},_0x4273e9={},_0x4b5fc8={'count':0x0,'rows':[]};var _0x59380f=_[_0x15a4('0x2a')](db[_0x15a4('0x2b')]['rawAttributes'],function(_0x28207c){return{'name':_0x28207c[_0x15a4('0x2c')],'type':_0x28207c[_0x15a4('0x2d')][_0x15a4('0x2e')]};});_0x4273e9[_0x15a4('0x2f')]=_['map'](_0x59380f,_0x15a4('0x28'));_0x4273e9['query']=_[_0x15a4('0x30')](_0x1633d4['query']);_0x4273e9[_0x15a4('0x31')]=_['intersection'](_0x4273e9[_0x15a4('0x2f')],_0x4273e9[_0x15a4('0x32')]);_0x57a0a3['attributes']=_['intersection'](_0x4273e9[_0x15a4('0x2f')],qs[_0x15a4('0x33')](_0x1633d4[_0x15a4('0x32')][_0x15a4('0x33')]));_0x57a0a3[_0x15a4('0x34')]=_0x57a0a3[_0x15a4('0x34')][_0x15a4('0x35')]?_0x57a0a3[_0x15a4('0x34')]:_0x4273e9[_0x15a4('0x2f')];if(!_0x1633d4['query']['hasOwnProperty']('nolimit')){_0x57a0a3[_0x15a4('0x1c')]=qs['limit'](_0x1633d4['query'][_0x15a4('0x1c')]);_0x57a0a3[_0x15a4('0x1e')]=qs[_0x15a4('0x1e')](_0x1633d4[_0x15a4('0x32')]['offset']);}_0x57a0a3[_0x15a4('0x36')]=qs['sort'](_0x1633d4[_0x15a4('0x32')][_0x15a4('0x37')]);_0x57a0a3[_0x15a4('0x38')]=qs['filters'](_['pick'](_0x1633d4[_0x15a4('0x32')],_0x4273e9['filters']),_0x59380f);if(_0x1633d4[_0x15a4('0x32')][_0x15a4('0x39')]){_0x57a0a3[_0x15a4('0x38')]=_['merge'](_0x57a0a3[_0x15a4('0x38')],{'$or':_[_0x15a4('0x2a')](_0x59380f,function(_0x2648c0){if(_0x2648c0['type']!==_0x15a4('0x3a')){var _0x54e32d={};_0x54e32d[_0x2648c0['name']]={'$like':'%'+_0x1633d4[_0x15a4('0x32')][_0x15a4('0x39')]+'%'};return _0x54e32d;}})});}_0x57a0a3=_['merge']({},_0x57a0a3,_0x1633d4['options']);var _0x5aad0b={'where':_0x57a0a3[_0x15a4('0x38')]};return db[_0x15a4('0x2b')][_0x15a4('0x1d')](_0x5aad0b)['then'](function(_0x5caead){_0x4b5fc8[_0x15a4('0x1d')]=_0x5caead;if(_0x1633d4[_0x15a4('0x32')]['includeAll']){_0x57a0a3[_0x15a4('0x3b')]=[{'all':!![]}];}return db[_0x15a4('0x2b')][_0x15a4('0x3c')](_0x57a0a3);})[_0x15a4('0x24')](function(_0x4eb5d0){_0x4b5fc8['rows']=_0x4eb5d0;return _0x4b5fc8;})[_0x15a4('0x24')](respondWithFilteredResult(_0x35dbde,_0x57a0a3))[_0x15a4('0x3d')](handleError(_0x35dbde,null));};exports['show']=function(_0x582590,_0x232376){var _0x37f56b={'raw':!![],'where':{'id':_0x582590[_0x15a4('0x3e')]['id']}},_0xf8120c={};_0xf8120c['model']=_[_0x15a4('0x30')](db[_0x15a4('0x2b')][_0x15a4('0x3f')]);_0xf8120c[_0x15a4('0x32')]=_[_0x15a4('0x30')](_0x582590[_0x15a4('0x32')]);_0xf8120c[_0x15a4('0x31')]=_['intersection'](_0xf8120c[_0x15a4('0x2f')],_0xf8120c[_0x15a4('0x32')]);_0x37f56b['attributes']=_['intersection'](_0xf8120c[_0x15a4('0x2f')],qs[_0x15a4('0x33')](_0x582590[_0x15a4('0x32')][_0x15a4('0x33')]));_0x37f56b['attributes']=_0x37f56b[_0x15a4('0x34')]['length']?_0x37f56b[_0x15a4('0x34')]:_0xf8120c[_0x15a4('0x2f')];if(_0x582590[_0x15a4('0x32')][_0x15a4('0x40')]){_0x37f56b[_0x15a4('0x3b')]=[{'all':!![]}];}_0x37f56b=_[_0x15a4('0x41')]({},_0x37f56b,_0x582590[_0x15a4('0x42')]);return db[_0x15a4('0x2b')][_0x15a4('0x43')](_0x37f56b)[_0x15a4('0x24')](handleEntityNotFound(_0x232376,null))['then'](respondWithResult(_0x232376,null))[_0x15a4('0x3d')](handleError(_0x232376,null));};exports[_0x15a4('0x44')]=function(_0x41ae69,_0x41d6d){var _0x3e5699={'where':{'id':_0x41ae69[_0x15a4('0x3e')]['id']}},_0xeea47={};_0xeea47[_0x15a4('0x2f')]=_['keys'](db['Attachment'][_0x15a4('0x3f')]);_0x3e5699[_0x15a4('0x34')]=_[_0x15a4('0x45')](_0xeea47[_0x15a4('0x2f')],qs['fields'](_0x41ae69[_0x15a4('0x32')][_0x15a4('0x33')]));_0x3e5699['attributes']=_0x3e5699[_0x15a4('0x34')]['length']?_0x3e5699[_0x15a4('0x34')]:_0xeea47[_0x15a4('0x2f')];if(_0x41ae69[_0x15a4('0x32')][_0x15a4('0x40')]){_0x3e5699[_0x15a4('0x3b')]=[{'all':!![]}];}_0x3e5699=_[_0x15a4('0x41')]({},_0x3e5699,_0x41ae69[_0x15a4('0x42')]);return db[_0x15a4('0x2b')][_0x15a4('0x43')](_0x3e5699)[_0x15a4('0x24')](handleEntityNotFound(_0x41d6d,null))['then'](function(_0xedc8b1){if(_0xedc8b1){var _0x1663fb=_0xedc8b1['get']({'plain':!![]});_0x1663fb=qs[_0x15a4('0x46')](_0x1663fb,['id',_0x15a4('0x47'),_0x15a4('0x48')]);_0x41ae69['body']=_[_0x15a4('0x46')](_0x41ae69[_0x15a4('0x49')],['id',_0x15a4('0x47'),'updatedAt']);return db[_0x15a4('0x2b')][_0x15a4('0x4a')](_['merge'](_0x1663fb,_0x41ae69[_0x15a4('0x49')]),{'include':_0x41ae69[_0x15a4('0x32')][_0x15a4('0x40')]?[{'all':!![]}]:undefined});}})[_0x15a4('0x24')](respondWithResult(_0x41d6d,0xc9))[_0x15a4('0x3d')](handleError(_0x41d6d,null));};exports[_0x15a4('0x4b')]=function(_0x53799a,_0xc7e756){if(_0x53799a[_0x15a4('0x49')]['id']){delete _0x53799a[_0x15a4('0x49')]['id'];}return db[_0x15a4('0x2b')][_0x15a4('0x43')]({'where':{'id':_0x53799a[_0x15a4('0x3e')]['id']}})[_0x15a4('0x24')](handleEntityNotFound(_0xc7e756,null))[_0x15a4('0x24')](saveUpdates(_0x53799a['body'],null))[_0x15a4('0x24')](respondWithResult(_0xc7e756,null))[_0x15a4('0x3d')](handleError(_0xc7e756,null));};exports[_0x15a4('0x4c')]=function(_0x129565,_0x94ded6){return db[_0x15a4('0x2b')]['find']({'where':{'id':_0x129565[_0x15a4('0x3e')]['id']}})[_0x15a4('0x24')](handleEntityNotFound(_0x94ded6,null))[_0x15a4('0x24')](removeEntity(_0x94ded6,null))[_0x15a4('0x3d')](handleError(_0x94ded6,null));};exports[_0x15a4('0x4a')]=function(_0x2837a,_0x418c54,_0x1f3eb3){_0x2837a[_0x15a4('0x49')][_0x15a4('0x28')]=_0x2837a[_0x15a4('0x4d')][_0x15a4('0x4e')];_0x2837a[_0x15a4('0x49')][_0x15a4('0x4f')]=_0x2837a[_0x15a4('0x4d')][_0x15a4('0x50')];_0x2837a[_0x15a4('0x49')][_0x15a4('0x2d')]=_0x2837a[_0x15a4('0x4d')][_0x15a4('0x51')];return db[_0x15a4('0x2b')][_0x15a4('0x4a')](_0x2837a[_0x15a4('0x49')])[_0x15a4('0x24')](respondWithResult(_0x418c54,0xc9))['catch'](handleError(_0x418c54,null));};exports[_0x15a4('0x52')]=function(_0x2f3eb2,_0x37cc31,_0x139523){return db[_0x15a4('0x2b')]['findOne']({'where':{'id':_0x2f3eb2[_0x15a4('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x37cc31,null))[_0x15a4('0x24')](function(_0x298f8e){if(_0x298f8e){var _0x2eb8a7=_0x298f8e[_0x15a4('0x53')]!==null;var _0x9577ec=path[_0x15a4('0x54')](config['root'],'server/files/attachments/');if(_0x2eb8a7){_0x9577ec=path[_0x15a4('0x54')](_0x9577ec,_0x15a4('0x55'));}var _0x521c93=path[_0x15a4('0x54')](_0x9577ec,_0x298f8e[_0x15a4('0x4f')]);return _0x37cc31[_0x15a4('0x52')](_0x521c93);}})['catch'](handleError(_0x37cc31,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 305e491..d7c9c70 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 _0x094b=['api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','attachments','lodash','../../config/logger'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0x094b,0x184));var _0xb094=function(_0x29aeb4,_0x4a2ecd){_0x29aeb4=_0x29aeb4-0x0;var _0x29da19=_0x094b[_0x29aeb4];return _0x29da19;};'use strict';var _=require(_0xb094('0x0'));var util=require('util');var logger=require(_0xb094('0x1'))(_0xb094('0x2'));var moment=require('moment');var BPromise=require(_0xb094('0x3'));var rp=require(_0xb094('0x4'));var fs=require('fs');var path=require(_0xb094('0x5'));var rimraf=require(_0xb094('0x6'));var config=require('../../config/environment');var attributes=require(_0xb094('0x7'));module[_0xb094('0x8')]=function(_0x1804fb,_0x271451){return _0x1804fb['define']('Attachment',attributes,{'tableName':_0xb094('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc1=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','Attachment','lodash'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0x4fc1,0x167));var _0x14fc=function(_0x3d43a6,_0x3c3e81){_0x3d43a6=_0x3d43a6-0x0;var _0x32bd7b=_0x4fc1[_0x3d43a6];return _0x32bd7b;};'use strict';var _=require(_0x14fc('0x0'));var util=require(_0x14fc('0x1'));var logger=require(_0x14fc('0x2'))('api');var moment=require(_0x14fc('0x3'));var BPromise=require(_0x14fc('0x4'));var rp=require(_0x14fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14fc('0x6'));var config=require(_0x14fc('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x107ba4,_0x23fdec){return _0x107ba4[_0x14fc('0x8')](_0x14fc('0x9'),attributes,{'tableName':'attachments','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 117749d..b274197 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 _0xd52a=['../../config/logger','rpc','../../config/environment','request','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateAttachment','create','options','raw','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4a8704,_0x1cf4f2){var _0x4d73fb=function(_0x110ce3){while(--_0x110ce3){_0x4a8704['push'](_0x4a8704['shift']());}};_0x4d73fb(++_0x1cf4f2);}(_0xd52a,0xca));var _0xad52=function(_0x280ded,_0x32da1a){_0x280ded=_0x280ded-0x0;var _0x2b3bc7=_0xd52a[_0x280ded];return _0x2b3bc7;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('Attachment,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['Attachment'][_0xad52('0x14')](_0x39128c['body'],{'raw':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24fb52){logger['info'](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON[_0xad52('0xd')](_0x24fb52));_0x1c19e9(_0x24fb52);})[_0xad52('0x12')](function(_0x2f1526){logger['error'](_0xad52('0x13'),_0x2f1526['message'],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2f1526[_0xad52('0xf')]));});});}; \ No newline at end of file +var _0xbf6e=['error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3e4a51,_0x5b7b0a){var _0x46ace0=function(_0x1dad49){while(--_0x1dad49){_0x3e4a51['push'](_0x3e4a51['shift']());}};_0x46ace0(++_0x5b7b0a);}(_0xbf6e,0x149));var _0xebf6=function(_0x2fe3b9,_0x5de54e){_0x2fe3b9=_0x2fe3b9-0x0;var _0xec07e3=_0xbf6e[_0x2fe3b9];return _0xec07e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf6('0x0'));var BPromise=require(_0xebf6('0x1'));var rs=require(_0xebf6('0x2'));var fs=require('fs');var Redis=require(_0xebf6('0x3'));var db=require(_0xebf6('0x4'))['db'];var utils=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('rpc');var config=require(_0xebf6('0x7'));var jayson=require(_0xebf6('0x8'));var client=jayson[_0xebf6('0x9')][_0xebf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143344,_0x1e02b3,_0x137e39){return new BPromise(function(_0x548e9e,_0x1d8035){return client[_0xebf6('0xb')](_0x143344,_0x137e39)[_0xebf6('0xc')](function(_0x591132){logger[_0xebf6('0xd')](_0xebf6('0xe'),_0x1e02b3,'request\x20sent');logger[_0xebf6('0xf')](_0xebf6('0x10'),_0x1e02b3,_0xebf6('0x11'),JSON[_0xebf6('0x12')](_0x591132));if(_0x591132[_0xebf6('0x13')]){if(_0x591132[_0xebf6('0x13')]['code']===0x1f4){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error'][_0xebf6('0x14')]);return _0x1d8035(_0x591132[_0xebf6('0x13')][_0xebf6('0x14')]);}logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error']['message']);return _0x548e9e(_0x591132['error'][_0xebf6('0x14')]);}else{logger[_0xebf6('0xd')]('Attachment,\x20%s,\x20%s',_0x1e02b3,_0xebf6('0x11'));_0x548e9e(_0x591132[_0xebf6('0x15')][_0xebf6('0x14')]);}})[_0xebf6('0x16')](function(_0x3100ee){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x3100ee);_0x1d8035(_0x3100ee);});});}exports[_0xebf6('0x17')]=function(_0x2d3984){var _0x308480=this;return new Promise(function(_0x55fa31,_0x496dea){return db[_0xebf6('0x18')][_0xebf6('0x19')](_0x2d3984[_0xebf6('0x1a')],{'raw':_0x2d3984[_0xebf6('0x1b')]?_0x2d3984[_0xebf6('0x1b')][_0xebf6('0x1c')]===undefined?!![]:![]:!![]})[_0xebf6('0xc')](function(_0x80f523){logger['info'](_0xebf6('0x17'),_0x2d3984);logger[_0xebf6('0xf')](_0xebf6('0x17'),_0x2d3984,JSON[_0xebf6('0x12')](_0x80f523));_0x55fa31(_0x80f523);})[_0xebf6('0x16')](function(_0x14c8ac){logger[_0xebf6('0x13')](_0xebf6('0x17'),_0x14c8ac[_0xebf6('0x14')],_0x2d3984);_0x496dea(_0x308480[_0xebf6('0x13')](0x1f4,_0x14c8ac[_0xebf6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b17297b..fce9b5a 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4152bb,_0x77a3c2){var _0x4abae3=function(_0x48092f){while(--_0x48092f){_0x4152bb['push'](_0x4152bb['shift']());}};_0x4abae3(++_0x77a3c2);}(_0xadb5,0xad));var _0x5adb=function(_0x52850f,_0x50ab0e){_0x52850f=_0x52850f-0x0;var _0x5911ea=_0xadb5[_0x52850f];return _0x5911ea;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58a4b5,_0x182439){_0x58a4b5=_0x58a4b5-0x0;var _0x51821d=_0x0b0e[_0x58a4b5];return _0x51821d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 53111fb..8921bac 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 _0xe02f=['emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','find'];(function(_0x40fa6e,_0x3aa4ff){var _0x2ecd50=function(_0x23fe9a){while(--_0x23fe9a){_0x40fa6e['push'](_0x40fa6e['shift']());}};_0x2ecd50(++_0x3aa4ff);}(_0xe02f,0x96));var _0xfe02=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xe02f[_0x196f40];return _0x544d7b;};'use strict';var _=require(_0xfe02('0x0'));var passport=require(_0xfe02('0x1'));var GoogleStrategy=require(_0xfe02('0x2'))[_0xfe02('0x3')];var moment=require(_0xfe02('0x4'));var db=require(_0xfe02('0x5'))['db'];var config=require(_0xfe02('0x6'));var signToken=require(_0xfe02('0x7'))[_0xfe02('0x8')];var utils=require(_0xfe02('0x9'));exports[_0xfe02('0xa')]=passport[_0xfe02('0xb')](_0xfe02('0xc'),{'failureRedirect':_0xfe02('0xd'),'scope':[_0xfe02('0xe'),_0xfe02('0xf')],'session':![]});exports['callback']=passport[_0xfe02('0xb')]('google',{'failureRedirect':_0xfe02('0xd'),'session':![]});passport[_0xfe02('0x10')](new GoogleStrategy({'clientID':config[_0xfe02('0xc')]?config[_0xfe02('0xc')][_0xfe02('0x11')]:'id','clientSecret':config[_0xfe02('0xc')]?config[_0xfe02('0xc')]['clientSecret']:_0xfe02('0x12'),'callbackURL':config[_0xfe02('0xc')]?config[_0xfe02('0xc')][_0xfe02('0x13')]:''},function(_0xd9a4fa,_0x3aea59,_0x2073f5,_0x34d3a7){var _0x291f9a,_0xaf0f97;return db[_0xfe02('0x14')][_0xfe02('0x15')]({'where':{'id':0x1},'attributes':[_0xfe02('0x16'),_0xfe02('0x17')],'raw':!![]})['then'](function(_0x4e34b8){_0x291f9a=_0x4e34b8;return db['User'][_0xfe02('0x18')]({'where':{'email':_['map'](_0x2073f5[_0xfe02('0x19')],_0xfe02('0x1a')),'role':{'$or':[_0xfe02('0x1b'),_0xfe02('0x1c'),'agent']}}});})[_0xfe02('0x1d')](function(_0x394ef1){_0xaf0f97=_0x394ef1;if(_0xaf0f97){if(_0xaf0f97[_0xfe02('0x1e')]){return _0x34d3a7(_0xfe02('0x1f'));}else if(_0x291f9a['blockDuration']>0x0){if(_0xaf0f97['blocked']){if(moment(_0xaf0f97['blockedAt'])[_0xfe02('0x20')](_0x291f9a[_0xfe02('0x17')],'minutes')>moment()){return _0x34d3a7(_0xfe02('0x1f'));}else{return utils['clearBlockUser'](_0xaf0f97,0x0,![],null)['then'](function(){return utils[_0xfe02('0x21')](_0xaf0f97);})[_0xfe02('0x1d')](function(){return _0x34d3a7(null,_0xaf0f97);});}}else{return utils[_0xfe02('0x21')](_0xaf0f97)[_0xfe02('0x1d')](function(){return _0x34d3a7(null,_0xaf0f97);});}}else{return utils['getLicense'](_0xaf0f97)[_0xfe02('0x1d')](function(){return _0x34d3a7(null,_0xaf0f97);});}}return _0x34d3a7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xfe02('0x22')](function(_0x25d930){_0x34d3a7(_0x25d930);});})); \ No newline at end of file +var _0x0638=['login','authenticate','google','profile','email','callback','clientID','Setting','findOne','allowedLoginAttempts','then','map','emails','value','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','getLicense','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils'];(function(_0x185d17,_0x36bb78){var _0x2debcb=function(_0x42112a){while(--_0x42112a){_0x185d17['push'](_0x185d17['shift']());}};_0x2debcb(++_0x36bb78);}(_0x0638,0x173));var _0x8063=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x0638[_0x135904];return _0x1ce7d5;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x8063('0x0'))['Strategy'];var moment=require(_0x8063('0x1'));var db=require(_0x8063('0x2'))['db'];var config=require(_0x8063('0x3'));var signToken=require(_0x8063('0x4'))[_0x8063('0x5')];var utils=require(_0x8063('0x6'));exports[_0x8063('0x7')]=passport[_0x8063('0x8')](_0x8063('0x9'),{'failureRedirect':'/login','scope':[_0x8063('0xa'),_0x8063('0xb')],'session':![]});exports[_0x8063('0xc')]=passport[_0x8063('0x8')](_0x8063('0x9'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x8063('0x9')][_0x8063('0xd')]:'id','clientSecret':config[_0x8063('0x9')]?config[_0x8063('0x9')]['clientSecret']:'secret','callbackURL':config['google']?config[_0x8063('0x9')]['callbackURL']:''},function(_0x34b16c,_0x9095cf,_0x117bdc,_0x1f138c){var _0x8e1b3d,_0x37aec4;return db[_0x8063('0xe')][_0x8063('0xf')]({'where':{'id':0x1},'attributes':[_0x8063('0x10'),'blockDuration'],'raw':!![]})[_0x8063('0x11')](function(_0x1eb90f){_0x8e1b3d=_0x1eb90f;return db['User']['find']({'where':{'email':_[_0x8063('0x12')](_0x117bdc[_0x8063('0x13')],_0x8063('0x14')),'role':{'$or':[_0x8063('0x15'),'user',_0x8063('0x16')]}}});})['then'](function(_0x299e24){_0x37aec4=_0x299e24;if(_0x37aec4){if(_0x37aec4['disabled']){return _0x1f138c(_0x8063('0x17'));}else if(_0x8e1b3d[_0x8063('0x18')]>0x0){if(_0x37aec4['blocked']){if(moment(_0x37aec4['blockedAt'])[_0x8063('0x19')](_0x8e1b3d[_0x8063('0x18')],'minutes')>moment()){return _0x1f138c(_0x8063('0x17'));}else{return utils['clearBlockUser'](_0x37aec4,0x0,![],null)['then'](function(){return utils[_0x8063('0x1a')](_0x37aec4);})[_0x8063('0x11')](function(){return _0x1f138c(null,_0x37aec4);});}}else{return utils[_0x8063('0x1a')](_0x37aec4)['then'](function(){return _0x1f138c(null,_0x37aec4);});}}else{return utils[_0x8063('0x1a')](_0x37aec4)[_0x8063('0x11')](function(){return _0x1f138c(null,_0x37aec4);});}}return _0x1f138c(_0x8063('0x17'));})['catch'](function(_0x40caad){_0x1f138c(_0x40caad);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 4a3c695..9f87de5 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 _0xb268=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb268,0x114));var _0x8b26=function(_0x4793ec,_0x2c98e7){_0x4793ec=_0x4793ec-0x0;var _0x180cf4=_0xb268[_0x4793ec];return _0x180cf4;};'use strict';var express=require(_0x8b26('0x0'));var passport=require(_0x8b26('0x1'));var router=express[_0x8b26('0x2')]();var controller=require(_0x8b26('0x3'));var userController=require(_0x8b26('0x4'));var authService=require(_0x8b26('0x5'));router['get']('/',controller['login']);router[_0x8b26('0x6')](_0x8b26('0x7'),controller[_0x8b26('0x8')],authService[_0x8b26('0x9')],userController[_0x8b26('0xa')],authService['setTokenCookie']);module[_0x8b26('0xb')]=router; \ No newline at end of file +var _0x1e9c=['setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login'];(function(_0x4868ff,_0x3ff993){var _0x1ec7c9=function(_0x16a197){while(--_0x16a197){_0x4868ff['push'](_0x4868ff['shift']());}};_0x1ec7c9(++_0x3ff993);}(_0x1e9c,0xec));var _0xc1e9=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x1e9c[_0x2aec52];return _0x3b8835;};'use strict';var express=require(_0xc1e9('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xc1e9('0x1'));var userController=require(_0xc1e9('0x2'));var authService=require('../../components/auth/service');router[_0xc1e9('0x3')]('/',controller['login']);router[_0xc1e9('0x3')](_0xc1e9('0x4'),controller[_0xc1e9('0x5')],authService['isMiddleware'],userController[_0xc1e9('0x6')],authService[_0xc1e9('0x7')]);module[_0xc1e9('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 5fe1c57..b593e57 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 _0x5ce6=['authenticate','blocked','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','name'];(function(_0x164735,_0x307209){var _0x49804a=function(_0x9cc28){while(--_0x9cc28){_0x164735['push'](_0x164735['shift']());}};_0x49804a(++_0x307209);}(_0x5ce6,0xee));var _0x65ce=function(_0x2d23d2,_0x494788){_0x2d23d2=_0x2d23d2-0x0;var _0xcc59f1=_0x5ce6[_0x2d23d2];return _0xcc59f1;};'use strict';var util=require('util');var passport=require(_0x65ce('0x0'));var LocalStrategy=require(_0x65ce('0x1'))[_0x65ce('0x2')];var jayson=require(_0x65ce('0x3'));var _=require(_0x65ce('0x4'));var rs=require(_0x65ce('0x5'));var moment=require(_0x65ce('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x65ce('0x7'));var utils=require(_0x65ce('0x8'));var client=jayson[_0x65ce('0x9')][_0x65ce('0xa')]({'port':0x232b});function localAuthenticate(_0x53afee,_0x1a6018,_0x1a3021,_0x4b6ab2){var _0x49a56b,_0xc99619;return db['Setting'][_0x65ce('0xb')]({'where':{'id':0x1},'attributes':[_0x65ce('0xc'),'blockDuration'],'raw':!![]})[_0x65ce('0xd')](function(_0x4995dd){_0x49a56b=_0x4995dd;return _0x53afee['findOne']({'attributes':['id','name',_0x65ce('0xe'),_0x65ce('0xf'),_0x65ce('0x10'),_0x65ce('0x11'),'blocked',_0x65ce('0x12'),_0x65ce('0x13')],'where':{'name':_0x1a6018,'role':{'$or':[_0x65ce('0x14'),_0x65ce('0x15'),'agent']}}});})[_0x65ce('0xd')](function(_0x26b897){if(!_0x26b897||_0x26b897&&_0x26b897[_0x65ce('0x16')]!==_0x1a6018){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xc99619=_0x26b897;return _0xc99619;}})[_0x65ce('0xd')](function(){_0xc99619[_0x65ce('0x17')](_0x1a3021,function(_0x52f0a7,_0xfd6b83){var _0x46d483=_0xc99619[_0x65ce('0x13')]+0x1;if(_0x52f0a7){return _0x4b6ab2(_0x52f0a7);}else if(!_0xfd6b83){if(_0xc99619[_0x65ce('0x11')]){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x49a56b[_0x65ce('0xc')]>0x0){if(_0xc99619[_0x65ce('0x18')]){if(_0x49a56b[_0x65ce('0x19')]>0x0){if(moment(_0xc99619[_0x65ce('0x12')])['add'](_0x49a56b[_0x65ce('0x19')],_0x65ce('0x1a'))>moment()){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}else{return utils['clearBlockUser'](_0xc99619,_0x46d483,![],null)[_0x65ce('0xd')](function(){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}}else{if(_0x46d483>=_0x49a56b['allowedLoginAttempts']){return utils[_0x65ce('0x1c')](_0xc99619,0x0,!![],moment())[_0x65ce('0xd')](function(){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});});}else{return utils[_0x65ce('0x1c')](_0xc99619,_0x46d483,![],null)['then'](function(){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});});}}}else{return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}}else{if(_0xc99619['disabled']){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x49a56b[_0x65ce('0xc')]>0x0){if(_0xc99619[_0x65ce('0x18')]){if(_0x49a56b['blockDuration']>0x0){if(moment(_0xc99619['blockedAt'])[_0x65ce('0x1d')](_0x49a56b['blockDuration'],_0x65ce('0x1a'))>moment()){return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x65ce('0x1c')](_0xc99619,0x0,![],null)[_0x65ce('0xd')](function(){return utils[_0x65ce('0x1e')](_0xc99619);})[_0x65ce('0xd')](function(){return _0x4b6ab2(null,_0xc99619);});}}else{return _0x4b6ab2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x65ce('0x1c')](_0xc99619,0x0,![],null)[_0x65ce('0xd')](function(){return utils[_0x65ce('0x1e')](_0xc99619);})[_0x65ce('0xd')](function(){return _0x4b6ab2(null,_0xc99619);})[_0x65ce('0x1f')](function(_0x362604){return _0x4b6ab2(null,![],_0x362604);});}}else{if(_0xc99619[_0x65ce('0x18')]){return _0x4b6ab2(null,![],{'message':_0x65ce('0x1b')});}else{return utils['getLicense'](_0xc99619)['then'](function(){return _0x4b6ab2(null,_0xc99619);});}}}});})[_0x65ce('0x1f')](function(_0x1c61eb){return _0x4b6ab2(null,![],_0x1c61eb);});}function sendServiceMail(_0x4e33bf){return db[_0x65ce('0x20')][_0x65ce('0x21')]({'where':{'service':!![]},'attributes':['id',_0x65ce('0x16'),'email'],'include':[{'model':db[_0x65ce('0x22')],'as':'Smtp'}]})[_0x65ce('0xd')](function(_0x340bbb){if(!_0x340bbb){throw new Error(_0x65ce('0x23'));}var _0x4e858c={'tls':{'rejectUnauthorized':![]}};if(_0x340bbb[_0x65ce('0x24')]['service']){_0x4e858c['service']=_0x340bbb[_0x65ce('0x24')][_0x65ce('0x25')];}else{_0x4e858c[_0x65ce('0x26')]=_0x340bbb[_0x65ce('0x24')][_0x65ce('0x26')];_0x4e858c[_0x65ce('0x27')]=_0x340bbb['Smtp'][_0x65ce('0x27')];_0x4e858c[_0x65ce('0x28')]=_0x340bbb[_0x65ce('0x24')]['secure'];}if(_0x340bbb['Smtp'][_0x65ce('0x29')]){_0x4e858c[_0x65ce('0x2a')]={'user':_0x340bbb[_0x65ce('0x24')][_0x65ce('0x15')],'pass':_0x340bbb['Smtp'][_0x65ce('0x2b')]};}var _0x142036={'account':_0x4e858c,'message':_[_0x65ce('0x2c')]({'from':util[_0x65ce('0x2d')]('\x22%s\x22\x20<%s>',_0x340bbb[_0x65ce('0x16')],_0x340bbb['email']||_0x340bbb['Smtp'][_0x65ce('0x15')])},_0x4e33bf)};return client[_0x65ce('0x2e')]('SendMail',_0x142036);})[_0x65ce('0xd')](function(_0x3db0f9){if(_0x3db0f9['error']){throw new Error(util[_0x65ce('0x2d')](_0x65ce('0x2f'),_0x3db0f9['error']['message']||JSON[_0x65ce('0x30')](_0x3db0f9['error'])));}return!![];});}function handleError(_0x47828c,_0x51fa8d,_0x20d38d){return _0x47828c[_0x65ce('0x31')](_0x51fa8d||0x1f4)[_0x65ce('0x32')]({'message':_0x20d38d?_0x20d38d[_0x65ce('0x33')]||_0x20d38d:''});}exports[_0x65ce('0x34')]=function(_0x4bd221,_0x209145,_0x19fc3b){passport['authenticate']('local',function(_0x4f281e,_0x186a47,_0x52c5be){var _0x2a0a26=_0x4f281e||_0x52c5be;if(_0x2a0a26){return handleError(_0x209145,0x191,_0x2a0a26);}if(!_0x186a47){return handleError(_0x209145,0x194,{'message':_0x65ce('0x35')});}else{var _0x1b8160={'payload':{'id':_0x186a47['id'],'role':_0x186a47[_0x65ce('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x65ce('0x36')](_0x1b8160)['then'](function(_0x336fbe){_0x209145[_0x65ce('0x37')]({'id':_0x186a47['id'],'token':_0x336fbe,'statusCall':'','isAlreadyLogged':_0x186a47[_0x65ce('0x38')]});});}})(_0x4bd221,_0x209145,_0x19fc3b);};exports[_0x65ce('0x39')]=function(_0x1f0728,_0xc156b5,_0x499ab0){if(!_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')]){return handleError(_0xc156b5,0x1f4,{'message':_0x65ce('0x3c')});}var _0x25b2f1=rs['generate']();_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')]=_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')][_0x65ce('0x3d')]()[_0x65ce('0x3e')]();var _0x37cc87;return db[_0x65ce('0x3f')][_0x65ce('0xb')]({'where':{'id':0x1},'attributes':[_0x65ce('0xc'),_0x65ce('0x19')],'raw':!![]})['then'](function(_0x198e39){_0x37cc87=_0x198e39;return db[_0x65ce('0x40')][_0x65ce('0x21')]({'where':{'email':_0x1f0728[_0x65ce('0x3a')][_0x65ce('0x3b')]}});})['then'](function(_0x582a57){if(!_0x582a57){throw new Error(_0x65ce('0x41'));}if(_0x582a57[_0x65ce('0x11')]){throw new Error(_0x65ce('0x42'));}if(_0x582a57[_0x65ce('0x18')]){if(moment(_0x582a57[_0x65ce('0x12')])[_0x65ce('0x1d')](_0x37cc87[_0x65ce('0x19')],'minutes')>moment()){throw new Error(_0x65ce('0x43'));}else{_0x582a57[_0x65ce('0x18')]=![];_0x582a57[_0x65ce('0x12')]=null;}}_0x582a57[_0x65ce('0x44')]=_0x25b2f1;_0x582a57[_0x65ce('0x45')]=Date[_0x65ce('0x46')]()+0x36ee80;return _0x582a57[_0x65ce('0x47')]();})[_0x65ce('0xd')](function(){return sendServiceMail({'to':_0x1f0728[_0x65ce('0x3a')]['email'],'subject':_0x65ce('0x48'),'text':_0x65ce('0x49')+_0x65ce('0x4a')+_0x65ce('0x4b')+_0x1f0728[_0x65ce('0x4c')][_0x65ce('0x26')]+'/reset/'+_0x25b2f1+'\x0a\x0a'+_0x65ce('0x4d')});})['then'](function(){_0xc156b5[_0x65ce('0x31')](0xc8)[_0x65ce('0x32')]({'message':_0x65ce('0x4e')});})[_0x65ce('0x1f')](function(_0x4600b2){return handleError(_0xc156b5,0x1f4,_0x4600b2);});};exports['reset']=function(_0x32fada,_0x5189df,_0x5281c3){return db[_0x65ce('0x40')][_0x65ce('0x21')]({'where':{'resetPasswordToken':_0x32fada[_0x65ce('0x4f')][_0x65ce('0x50')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x65ce('0xd')](function(_0x4fd3d0){if(!_0x4fd3d0){throw new Error(_0x65ce('0x51'));}return db['Setting'][_0x65ce('0xb')]({'attributes':['id',_0x65ce('0x52'),_0x65ce('0x53'),_0x65ce('0x54')]})[_0x65ce('0xd')](function(_0x5d6e69){if(_0x5d6e69[_0x65ce('0x52')])authService['validatePasswordPattern'](_0x32fada[_0x65ce('0x3a')]['password']);if(!_0x5d6e69[_0x65ce('0x53')]||!_0x4fd3d0[_0x65ce('0x55')])return _0x4fd3d0;authService[_0x65ce('0x56')](_0x32fada['body']['password'],_0x4fd3d0[_0x65ce('0x55')],_0x5d6e69[_0x65ce('0x54')]);return _0x4fd3d0;})[_0x65ce('0xd')](function(){_0x4fd3d0['password']=_0x32fada[_0x65ce('0x3a')][_0x65ce('0xe')];_0x4fd3d0[_0x65ce('0x44')]=null;_0x4fd3d0[_0x65ce('0x45')]=null;return _0x4fd3d0[_0x65ce('0x47')]();});})[_0x65ce('0xd')](function(){_0x5189df[_0x65ce('0x31')](0xc8)[_0x65ce('0x32')]({'message':'Password\x20reset!'});})[_0x65ce('0x1f')](function(_0x135de1){return handleError(_0x5189df,0x1f4,_0x135de1);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x65ce('0xe')},function(_0x5341a3,_0x2f4e58,_0xe52352){return localAuthenticate(db['User'],_0x5341a3,_0x2f4e58,_0xe52352);})); \ No newline at end of file +var _0x2b72=['add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','service','host','port','secure','auth','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','params','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x2b72,0x1d1));var _0x22b7=function(_0x51ee24,_0xa976d1){_0x51ee24=_0x51ee24-0x0;var _0x97ce62=_0x2b72[_0x51ee24];return _0x97ce62;};'use strict';var util=require(_0x22b7('0x0'));var passport=require('passport');var LocalStrategy=require(_0x22b7('0x1'))[_0x22b7('0x2')];var jayson=require(_0x22b7('0x3'));var _=require(_0x22b7('0x4'));var rs=require(_0x22b7('0x5'));var moment=require(_0x22b7('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x22b7('0x7'));var utils=require(_0x22b7('0x8'));var client=jayson[_0x22b7('0x9')][_0x22b7('0xa')]({'port':0x232b});function localAuthenticate(_0x40299c,_0x4c7898,_0x244c87,_0x4b3d4b){var _0x15f77c,_0x937d28;return db[_0x22b7('0xb')][_0x22b7('0xc')]({'where':{'id':0x1},'attributes':[_0x22b7('0xd'),'blockDuration'],'raw':!![]})[_0x22b7('0xe')](function(_0x2c4157){_0x15f77c=_0x2c4157;return _0x40299c[_0x22b7('0xc')]({'attributes':['id',_0x22b7('0xf'),_0x22b7('0x10'),'salt',_0x22b7('0x11'),_0x22b7('0x12'),_0x22b7('0x13'),_0x22b7('0x14'),_0x22b7('0x15')],'where':{'name':_0x4c7898,'role':{'$or':[_0x22b7('0x16'),_0x22b7('0x17'),_0x22b7('0x18')]}}});})['then'](function(_0xdf74bb){if(!_0xdf74bb||_0xdf74bb&&_0xdf74bb[_0x22b7('0xf')]!==_0x4c7898){throw new Error(_0x22b7('0x19'));}else{_0x937d28=_0xdf74bb;return _0x937d28;}})[_0x22b7('0xe')](function(){_0x937d28['authenticate'](_0x244c87,function(_0x2396c1,_0xa8b43f){var _0x2af6cc=_0x937d28[_0x22b7('0x15')]+0x1;if(_0x2396c1){return _0x4b3d4b(_0x2396c1);}else if(!_0xa8b43f){if(_0x937d28[_0x22b7('0x12')]){return _0x4b3d4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x15f77c['allowedLoginAttempts']>0x0){if(_0x937d28[_0x22b7('0x13')]){if(_0x15f77c[_0x22b7('0x1a')]>0x0){if(moment(_0x937d28[_0x22b7('0x14')])[_0x22b7('0x1b')](_0x15f77c[_0x22b7('0x1a')],_0x22b7('0x1c'))>moment()){return _0x4b3d4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x937d28,_0x2af6cc,![],null)['then'](function(){return _0x4b3d4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4b3d4b(null,![],{'message':_0x22b7('0x19')});}}else{if(_0x2af6cc>=_0x15f77c[_0x22b7('0xd')]){return utils[_0x22b7('0x1d')](_0x937d28,0x0,!![],moment())[_0x22b7('0xe')](function(){return _0x4b3d4b(null,![],{'message':_0x22b7('0x19')});});}else{return utils[_0x22b7('0x1d')](_0x937d28,_0x2af6cc,![],null)['then'](function(){return _0x4b3d4b(null,![],{'message':_0x22b7('0x19')});});}}}else{return _0x4b3d4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x937d28['disabled']){return _0x4b3d4b(null,![],{'message':_0x22b7('0x19')});}else if(_0x15f77c[_0x22b7('0xd')]>0x0){if(_0x937d28['blocked']){if(_0x15f77c[_0x22b7('0x1a')]>0x0){if(moment(_0x937d28[_0x22b7('0x14')])[_0x22b7('0x1b')](_0x15f77c['blockDuration'],_0x22b7('0x1c'))>moment()){return _0x4b3d4b(null,![],{'message':_0x22b7('0x19')});}else{return utils[_0x22b7('0x1d')](_0x937d28,0x0,![],null)[_0x22b7('0xe')](function(){return utils[_0x22b7('0x1e')](_0x937d28);})[_0x22b7('0xe')](function(){return _0x4b3d4b(null,_0x937d28);});}}else{return _0x4b3d4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x22b7('0x1d')](_0x937d28,0x0,![],null)['then'](function(){return utils[_0x22b7('0x1e')](_0x937d28);})[_0x22b7('0xe')](function(){return _0x4b3d4b(null,_0x937d28);})[_0x22b7('0x1f')](function(_0x39884c){return _0x4b3d4b(null,![],_0x39884c);});}}else{if(_0x937d28[_0x22b7('0x13')]){return _0x4b3d4b(null,![],{'message':_0x22b7('0x19')});}else{return utils['getLicense'](_0x937d28)[_0x22b7('0xe')](function(){return _0x4b3d4b(null,_0x937d28);});}}}});})['catch'](function(_0x15d423){return _0x4b3d4b(null,![],_0x15d423);});}function sendServiceMail(_0x3d67bd){return db[_0x22b7('0x20')][_0x22b7('0x21')]({'where':{'service':!![]},'attributes':['id',_0x22b7('0xf'),_0x22b7('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x22b7('0x23')}]})[_0x22b7('0xe')](function(_0xd602eb){if(!_0xd602eb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x424095={'tls':{'rejectUnauthorized':![]}};if(_0xd602eb['Smtp']['service']){_0x424095[_0x22b7('0x24')]=_0xd602eb[_0x22b7('0x23')][_0x22b7('0x24')];}else{_0x424095[_0x22b7('0x25')]=_0xd602eb[_0x22b7('0x23')][_0x22b7('0x25')];_0x424095['port']=_0xd602eb[_0x22b7('0x23')][_0x22b7('0x26')];_0x424095['secure']=_0xd602eb['Smtp'][_0x22b7('0x27')];}if(_0xd602eb['Smtp']['authentication']){_0x424095[_0x22b7('0x28')]={'user':_0xd602eb['Smtp'][_0x22b7('0x17')],'pass':_0xd602eb['Smtp']['pass']};}var _0x348809={'account':_0x424095,'message':_['merge']({'from':util[_0x22b7('0x29')](_0x22b7('0x2a'),_0xd602eb[_0x22b7('0xf')],_0xd602eb[_0x22b7('0x22')]||_0xd602eb[_0x22b7('0x23')][_0x22b7('0x17')])},_0x3d67bd)};return client[_0x22b7('0x2b')](_0x22b7('0x2c'),_0x348809);})[_0x22b7('0xe')](function(_0x1a0a78){if(_0x1a0a78[_0x22b7('0x2d')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1a0a78[_0x22b7('0x2d')][_0x22b7('0x2e')]||JSON[_0x22b7('0x2f')](_0x1a0a78[_0x22b7('0x2d')])));}return!![];});}function handleError(_0x5b9e64,_0x20eaeb,_0x50c52c){return _0x5b9e64['status'](_0x20eaeb||0x1f4)[_0x22b7('0x30')]({'message':_0x50c52c?_0x50c52c[_0x22b7('0x2e')]||_0x50c52c:''});}exports[_0x22b7('0x31')]=function(_0x41ad3f,_0x199b88,_0x1703c4){passport['authenticate']('local',function(_0x5b84bb,_0x2bef7,_0x23f778){var _0x2e52f5=_0x5b84bb||_0x23f778;if(_0x2e52f5){return handleError(_0x199b88,0x191,_0x2e52f5);}if(!_0x2bef7){return handleError(_0x199b88,0x194,{'message':_0x22b7('0x32')});}else{var _0x3a4933={'payload':{'id':_0x2bef7['id'],'role':_0x2bef7[_0x22b7('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x22b7('0x33')](_0x3a4933)[_0x22b7('0xe')](function(_0x4bdb2a){_0x199b88[_0x22b7('0x34')]({'id':_0x2bef7['id'],'token':_0x4bdb2a,'statusCall':'','isAlreadyLogged':_0x2bef7['online']});});}})(_0x41ad3f,_0x199b88,_0x1703c4);};exports[_0x22b7('0x35')]=function(_0x46298b,_0x4e0a4c,_0xe95765){if(!_0x46298b[_0x22b7('0x36')][_0x22b7('0x22')]){return handleError(_0x4e0a4c,0x1f4,{'message':_0x22b7('0x37')});}var _0x4d4ca2=rs[_0x22b7('0x38')]();_0x46298b[_0x22b7('0x36')]['email']=_0x46298b[_0x22b7('0x36')][_0x22b7('0x22')][_0x22b7('0x39')]()[_0x22b7('0x3a')]();var _0x4815a5;return db[_0x22b7('0xb')][_0x22b7('0xc')]({'where':{'id':0x1},'attributes':[_0x22b7('0xd'),_0x22b7('0x1a')],'raw':!![]})['then'](function(_0x2509ea){_0x4815a5=_0x2509ea;return db['User'][_0x22b7('0x21')]({'where':{'email':_0x46298b['body'][_0x22b7('0x22')]}});})[_0x22b7('0xe')](function(_0x5eeb01){if(!_0x5eeb01){throw new Error(_0x22b7('0x3b'));}if(_0x5eeb01[_0x22b7('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5eeb01[_0x22b7('0x13')]){if(moment(_0x5eeb01[_0x22b7('0x14')])[_0x22b7('0x1b')](_0x4815a5['blockDuration'],_0x22b7('0x1c'))>moment()){throw new Error(_0x22b7('0x3c'));}else{_0x5eeb01[_0x22b7('0x13')]=![];_0x5eeb01[_0x22b7('0x14')]=null;}}_0x5eeb01[_0x22b7('0x3d')]=_0x4d4ca2;_0x5eeb01[_0x22b7('0x3e')]=Date[_0x22b7('0x3f')]()+0x36ee80;return _0x5eeb01[_0x22b7('0x40')]();})[_0x22b7('0xe')](function(){return sendServiceMail({'to':_0x46298b[_0x22b7('0x36')][_0x22b7('0x22')],'subject':_0x22b7('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x22b7('0x42')+'https://'+_0x46298b['headers']['host']+_0x22b7('0x43')+_0x4d4ca2+'\x0a\x0a'+_0x22b7('0x44')});})[_0x22b7('0xe')](function(){_0x4e0a4c[_0x22b7('0x45')](0xc8)[_0x22b7('0x30')]({'message':_0x22b7('0x46')});})[_0x22b7('0x1f')](function(_0x4d17e2){return handleError(_0x4e0a4c,0x1f4,_0x4d17e2);});};exports[_0x22b7('0x47')]=function(_0x5384a7,_0x26c02d,_0xac6dcd){return db[_0x22b7('0x48')]['find']({'where':{'resetPasswordToken':_0x5384a7[_0x22b7('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x22b7('0x3f')]()}}})[_0x22b7('0xe')](function(_0x4e7bfd){if(!_0x4e7bfd){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x22b7('0xb')][_0x22b7('0xc')]({'attributes':['id',_0x22b7('0x4a'),_0x22b7('0x4b'),'passwordHistoryLimit']})[_0x22b7('0xe')](function(_0x432b84){if(_0x432b84[_0x22b7('0x4a')])authService[_0x22b7('0x4c')](_0x5384a7[_0x22b7('0x36')]['password']);if(!_0x432b84['enforcePasswordHistory']||!_0x4e7bfd[_0x22b7('0x4d')])return _0x4e7bfd;authService[_0x22b7('0x4e')](_0x5384a7[_0x22b7('0x36')][_0x22b7('0x10')],_0x4e7bfd[_0x22b7('0x4d')],_0x432b84[_0x22b7('0x4f')]);return _0x4e7bfd;})[_0x22b7('0xe')](function(){_0x4e7bfd['password']=_0x5384a7[_0x22b7('0x36')][_0x22b7('0x10')];_0x4e7bfd[_0x22b7('0x3d')]=null;_0x4e7bfd[_0x22b7('0x3e')]=null;return _0x4e7bfd[_0x22b7('0x40')]();});})[_0x22b7('0xe')](function(){_0x26c02d[_0x22b7('0x45')](0xc8)[_0x22b7('0x30')]({'message':_0x22b7('0x50')});})[_0x22b7('0x1f')](function(_0x47f13a){return handleError(_0x26c02d,0x1f4,_0x47f13a);});};passport[_0x22b7('0x51')](new LocalStrategy({'usernameField':_0x22b7('0xf'),'passwordField':_0x22b7('0x10')},function(_0x2b84ac,_0x155640,_0x1682df){return localAuthenticate(db[_0x22b7('0x48')],_0x2b84ac,_0x155640,_0x1682df);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 8973224..ab9edb4 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 _0xb717=['forgot','post','/reset/:token','reset','exports','express','Router','./authLocal.controller','login','/forgot'];(function(_0x47b456,_0x173597){var _0x30551c=function(_0x504570){while(--_0x504570){_0x47b456['push'](_0x47b456['shift']());}};_0x30551c(++_0x173597);}(_0xb717,0xf5));var _0x7b71=function(_0x291967,_0x380df9){_0x291967=_0x291967-0x0;var _0x128ca7=_0xb717[_0x291967];return _0x128ca7;};'use strict';var express=require(_0x7b71('0x0'));var router=express[_0x7b71('0x1')]();var controller=require(_0x7b71('0x2'));router['post']('/',controller[_0x7b71('0x3')]);router['post'](_0x7b71('0x4'),controller[_0x7b71('0x5')]);router[_0x7b71('0x6')](_0x7b71('0x7'),controller[_0x7b71('0x8')]);module[_0x7b71('0x9')]=router; \ No newline at end of file +var _0xa8da=['/forgot','forgot','reset','exports','express','Router','./authLocal.controller','post','login'];(function(_0x27ca80,_0x20a064){var _0x176f0a=function(_0x1e5d6a){while(--_0x1e5d6a){_0x27ca80['push'](_0x27ca80['shift']());}};_0x176f0a(++_0x20a064);}(_0xa8da,0x1f3));var _0xaa8d=function(_0x553b7a,_0x76bae0){_0x553b7a=_0x553b7a-0x0;var _0x1a364b=_0xa8da[_0x553b7a];return _0x1a364b;};'use strict';var express=require(_0xaa8d('0x0'));var router=express[_0xaa8d('0x1')]();var controller=require(_0xaa8d('0x2'));router[_0xaa8d('0x3')]('/',controller[_0xaa8d('0x4')]);router[_0xaa8d('0x3')](_0xaa8d('0x5'),controller[_0xaa8d('0x6')]);router['post']('/reset/:token',controller[_0xaa8d('0x7')]);module[_0xaa8d('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index b2ee0b9..cb76991 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 _0x7d6b=['INTEGER','sequelize','STRING'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0x7d6b,0x1c9));var _0xb7d6=function(_0x189c28,_0x26e114){_0x189c28=_0x189c28-0x0;var _0x2ca13f=_0x7d6b[_0x189c28];return _0x2ca13f;};'use strict';var Sequelize=require(_0xb7d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb7d6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xb7d6('0x1')]},'description':{'type':Sequelize[_0xb7d6('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb7d6('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x0a7a=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x0a7a,0x10c));var _0xa0a7=function(_0x40441d,_0x1be777){_0x40441d=_0x40441d-0x0;var _0x308484=_0x0a7a[_0x40441d];return _0x308484;};'use strict';var Sequelize=require('sequelize');module[_0xa0a7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xa0a7('0x1')]},'description':{'type':Sequelize[_0xa0a7('0x1')]},'status':{'type':Sequelize[_0xa0a7('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa0a7('0x3')],'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 2581d5d..eedd4e0 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 _0xc536=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','Automation','findAll','rows','catch','params','includeAll','options','create','body','find','addConditions','Condition','ids','omit','findOne','map','getConditions','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3dfedc,_0x219a28){var _0x148cd5=function(_0x212b85){while(--_0x212b85){_0x3dfedc['push'](_0x3dfedc['shift']());}};_0x148cd5(++_0x219a28);}(_0xc536,0x9a));var _0x6c53=function(_0x2945ba,_0x1a266d){_0x2945ba=_0x2945ba-0x0;var _0x25c656=_0xc536[_0x2945ba];return _0x25c656;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6c53('0x0'));var jsonpatch=require(_0x6c53('0x1'));var rp=require(_0x6c53('0x2'));var moment=require(_0x6c53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c53('0x4'));var util=require(_0x6c53('0x5'));var path=require('path');var sox=require(_0x6c53('0x6'));var csv=require(_0x6c53('0x7'));var ejs=require(_0x6c53('0x8'));var fs=require('fs');var fs_extra=require(_0x6c53('0x9'));var _=require(_0x6c53('0xa'));var squel=require('squel');var crypto=require(_0x6c53('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c53('0x7'));var querystring=require('querystring');var Papa=require(_0x6c53('0xc'));var Redis=require(_0x6c53('0xd'));var authService=require(_0x6c53('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6c53('0xf'));var hardwareService=require(_0x6c53('0x10'));var logger=require(_0x6c53('0x11'))(_0x6c53('0x12'));var utils=require(_0x6c53('0x13'));var config=require(_0x6c53('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c53('0x15'))['db'];function respondWithStatusCode(_0x171207,_0x2436de){_0x2436de=_0x2436de||0xcc;return function(_0x5e7d59){if(_0x5e7d59){return _0x171207['sendStatus'](_0x2436de);}return _0x171207[_0x6c53('0x16')](_0x2436de)[_0x6c53('0x17')]();};}function respondWithResult(_0x36638a,_0x5def7e){_0x5def7e=_0x5def7e||0xc8;return function(_0x498853){if(_0x498853){return _0x36638a[_0x6c53('0x16')](_0x5def7e)[_0x6c53('0x18')](_0x498853);}};}function respondWithFilteredResult(_0x18b1c5,_0x5afacb){return function(_0x3eaf78){if(_0x3eaf78){var _0x161490=typeof _0x5afacb[_0x6c53('0x19')]==='undefined'&&typeof _0x5afacb['limit']==='undefined';var _0x22fa55=_0x3eaf78[_0x6c53('0x1a')];var _0xa33e6d=_0x161490?0x0:_0x5afacb['offset'];var _0xf19944=_0x161490?_0x3eaf78[_0x6c53('0x1a')]:_0x5afacb[_0x6c53('0x19')]+_0x5afacb['limit'];var _0x243342;if(_0xf19944>=_0x22fa55){_0xf19944=_0x22fa55;_0x243342=0xc8;}else{_0x243342=0xce;}_0x18b1c5[_0x6c53('0x16')](_0x243342);return _0x18b1c5['set']('Content-Range',_0xa33e6d+'-'+_0xf19944+'/'+_0x22fa55)[_0x6c53('0x18')](_0x3eaf78);}return null;};}function patchUpdates(_0xac1836){return function(_0x2c68a6){try{jsonpatch[_0x6c53('0x1b')](_0x2c68a6,_0xac1836,!![]);}catch(_0x1e9a8c){return BPromise[_0x6c53('0x1c')](_0x1e9a8c);}return _0x2c68a6[_0x6c53('0x1d')]();};}function saveUpdates(_0x48e220,_0x1e4b01){return function(_0x38ec77){if(_0x38ec77){return _0x38ec77[_0x6c53('0x1e')](_0x48e220)[_0x6c53('0x1f')](function(_0x26660f){return _0x26660f;});}return null;};}function removeEntity(_0x35fcef,_0x34e90c){return function(_0x102723){if(_0x102723){return _0x102723[_0x6c53('0x20')]()[_0x6c53('0x1f')](function(){_0x35fcef[_0x6c53('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c91e4,_0x1c34f7){return function(_0x513776){if(!_0x513776){_0x4c91e4['sendStatus'](0x194);}return _0x513776;};}function handleError(_0x507d1a,_0x28fd9c){_0x28fd9c=_0x28fd9c||0x1f4;return function(_0x3345fc){logger['error'](_0x3345fc['stack']);if(_0x3345fc[_0x6c53('0x21')]){delete _0x3345fc[_0x6c53('0x21')];}_0x507d1a['status'](_0x28fd9c)[_0x6c53('0x22')](_0x3345fc);};}exports[_0x6c53('0x23')]=function(_0x2da5ab,_0x411802){var _0x260e87={},_0x439375={},_0x2395c8={'count':0x0,'rows':[]};var _0x410da4=_['map'](db['Automation'][_0x6c53('0x24')],function(_0x39d74f){return{'name':_0x39d74f[_0x6c53('0x25')],'type':_0x39d74f['type'][_0x6c53('0x26')]};});_0x439375[_0x6c53('0x27')]=_['map'](_0x410da4,'name');_0x439375[_0x6c53('0x28')]=_[_0x6c53('0x29')](_0x2da5ab[_0x6c53('0x28')]);_0x439375[_0x6c53('0x2a')]=_['intersection'](_0x439375[_0x6c53('0x27')],_0x439375[_0x6c53('0x28')]);_0x260e87[_0x6c53('0x2b')]=_[_0x6c53('0x2c')](_0x439375[_0x6c53('0x27')],qs[_0x6c53('0x2d')](_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x2d')]));_0x260e87['attributes']=_0x260e87['attributes'][_0x6c53('0x2e')]?_0x260e87['attributes']:_0x439375[_0x6c53('0x27')];if(!_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x2f')](_0x6c53('0x30'))){_0x260e87[_0x6c53('0x31')]=qs[_0x6c53('0x31')](_0x2da5ab[_0x6c53('0x28')]['limit']);_0x260e87[_0x6c53('0x19')]=qs[_0x6c53('0x19')](_0x2da5ab['query'][_0x6c53('0x19')]);}_0x260e87[_0x6c53('0x32')]=qs['sort'](_0x2da5ab['query'][_0x6c53('0x33')]);_0x260e87[_0x6c53('0x34')]=qs['filters'](_[_0x6c53('0x35')](_0x2da5ab['query'],_0x439375[_0x6c53('0x2a')]),_0x410da4);if(_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x36')]){_0x260e87[_0x6c53('0x34')]=_[_0x6c53('0x37')](_0x260e87[_0x6c53('0x34')],{'$or':_['map'](_0x410da4,function(_0x423275){if(_0x423275[_0x6c53('0x38')]!==_0x6c53('0x39')){var _0x4ef4ee={};_0x4ef4ee[_0x423275[_0x6c53('0x21')]]={'$like':'%'+_0x2da5ab[_0x6c53('0x28')][_0x6c53('0x36')]+'%'};return _0x4ef4ee;}})});}_0x260e87=_['merge']({},_0x260e87,_0x2da5ab['options']);var _0x116240={'where':_0x260e87[_0x6c53('0x34')]};return db['Automation'][_0x6c53('0x1a')](_0x116240)[_0x6c53('0x1f')](function(_0x234c5f){_0x2395c8[_0x6c53('0x1a')]=_0x234c5f;if(_0x2da5ab['query']['includeAll']){_0x260e87[_0x6c53('0x3a')]=[{'all':!![]}];}return db[_0x6c53('0x3b')][_0x6c53('0x3c')](_0x260e87);})[_0x6c53('0x1f')](function(_0x2e3506){_0x2395c8[_0x6c53('0x3d')]=_0x2e3506;return _0x2395c8;})['then'](respondWithFilteredResult(_0x411802,_0x260e87))[_0x6c53('0x3e')](handleError(_0x411802,null));};exports['show']=function(_0x350dc4,_0x40d1b3){var _0x4425f2={'raw':![],'where':{'id':_0x350dc4[_0x6c53('0x3f')]['id']}},_0x7202cf={};_0x7202cf[_0x6c53('0x27')]=_[_0x6c53('0x29')](db[_0x6c53('0x3b')][_0x6c53('0x24')]);_0x7202cf['query']=_[_0x6c53('0x29')](_0x350dc4['query']);_0x7202cf[_0x6c53('0x2a')]=_[_0x6c53('0x2c')](_0x7202cf[_0x6c53('0x27')],_0x7202cf['query']);_0x4425f2[_0x6c53('0x2b')]=_[_0x6c53('0x2c')](_0x7202cf[_0x6c53('0x27')],qs['fields'](_0x350dc4[_0x6c53('0x28')][_0x6c53('0x2d')]));_0x4425f2[_0x6c53('0x2b')]=_0x4425f2[_0x6c53('0x2b')]['length']?_0x4425f2[_0x6c53('0x2b')]:_0x7202cf[_0x6c53('0x27')];if(_0x350dc4['query'][_0x6c53('0x40')]){_0x4425f2[_0x6c53('0x3a')]=[{'all':!![]}];}_0x4425f2=_[_0x6c53('0x37')]({},_0x4425f2,_0x350dc4[_0x6c53('0x41')]);return db[_0x6c53('0x3b')]['find'](_0x4425f2)['then'](handleEntityNotFound(_0x40d1b3,null))[_0x6c53('0x1f')](respondWithResult(_0x40d1b3,null))[_0x6c53('0x3e')](handleError(_0x40d1b3,null));};exports[_0x6c53('0x42')]=function(_0x4a9cf8,_0x41fec1){return db[_0x6c53('0x3b')][_0x6c53('0x42')](_0x4a9cf8[_0x6c53('0x43')],{})[_0x6c53('0x1f')](respondWithResult(_0x41fec1,0xc9))['catch'](handleError(_0x41fec1,null));};exports['update']=function(_0x50809e,_0x4502e4){if(_0x50809e['body']['id']){delete _0x50809e[_0x6c53('0x43')]['id'];}return db['Automation'][_0x6c53('0x44')]({'where':{'id':_0x50809e['params']['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x4502e4,null))['then'](saveUpdates(_0x50809e[_0x6c53('0x43')],null))[_0x6c53('0x1f')](respondWithResult(_0x4502e4,null))[_0x6c53('0x3e')](handleError(_0x4502e4,null));};exports[_0x6c53('0x20')]=function(_0x550805,_0x11ba2a){return db[_0x6c53('0x3b')]['find']({'where':{'id':_0x550805[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x11ba2a,null))['then'](removeEntity(_0x11ba2a,null))[_0x6c53('0x3e')](handleError(_0x11ba2a,null));};exports[_0x6c53('0x45')]=function(_0x4d43f9,_0xe424b9,_0x55f5b1){return db[_0x6c53('0x46')][_0x6c53('0x44')]({'where':{'id':_0x4d43f9[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0xe424b9,null))['then'](function(_0x341e3d){if(_0x341e3d){return _0x341e3d[_0x6c53('0x45')](_0x4d43f9[_0x6c53('0x43')][_0x6c53('0x47')],_[_0x6c53('0x48')](_0x4d43f9[_0x6c53('0x43')],[_0x6c53('0x47'),'id'])||{});}})[_0x6c53('0x1f')](respondWithResult(_0xe424b9,null))[_0x6c53('0x3e')](handleError(_0xe424b9,null));};exports['getConditions']=function(_0x317bda,_0x3baa7b,_0x1db9d5){var _0x2dc6b8={};var _0x58a3b9={};var _0x3d0d6d;var _0x1a7a12;return db[_0x6c53('0x3b')][_0x6c53('0x49')]({'where':{'id':_0x317bda['params']['id']}})['then'](handleEntityNotFound(_0x3baa7b,null))['then'](function(_0x2d90cb){if(_0x2d90cb){_0x3d0d6d=_0x2d90cb;_0x58a3b9[_0x6c53('0x27')]=_[_0x6c53('0x29')](db[_0x6c53('0x46')][_0x6c53('0x24')]);_0x58a3b9[_0x6c53('0x28')]=_[_0x6c53('0x29')](_0x317bda[_0x6c53('0x28')]);_0x58a3b9['filters']=_[_0x6c53('0x2c')](_0x58a3b9[_0x6c53('0x27')],_0x58a3b9[_0x6c53('0x28')]);_0x2dc6b8[_0x6c53('0x2b')]=_[_0x6c53('0x2c')](_0x58a3b9['model'],qs[_0x6c53('0x2d')](_0x317bda['query'][_0x6c53('0x2d')]));_0x2dc6b8[_0x6c53('0x2b')]=_0x2dc6b8['attributes']['length']?_0x2dc6b8[_0x6c53('0x2b')]:_0x58a3b9[_0x6c53('0x27')];_0x2dc6b8[_0x6c53('0x32')]=qs[_0x6c53('0x33')](_0x317bda[_0x6c53('0x28')]['sort']);_0x2dc6b8[_0x6c53('0x34')]=qs[_0x6c53('0x2a')](_[_0x6c53('0x35')](_0x317bda[_0x6c53('0x28')],_0x58a3b9['filters']));if(_0x317bda['query'][_0x6c53('0x36')]){_0x2dc6b8[_0x6c53('0x34')]=_['merge'](_0x2dc6b8[_0x6c53('0x34')],{'$or':_[_0x6c53('0x4a')](_0x2dc6b8[_0x6c53('0x2b')],function(_0x19d9b1){var _0x27e9f5={};_0x27e9f5[_0x19d9b1]={'$like':'%'+_0x317bda[_0x6c53('0x28')][_0x6c53('0x36')]+'%'};return _0x27e9f5;})});}_0x2dc6b8=_[_0x6c53('0x37')]({},_0x2dc6b8,_0x317bda[_0x6c53('0x41')]);return _0x3d0d6d[_0x6c53('0x4b')](_0x2dc6b8);}})[_0x6c53('0x1f')](function(_0x521e5f){if(_0x521e5f){_0x1a7a12=_0x521e5f[_0x6c53('0x2e')];if(!_0x317bda['query'][_0x6c53('0x2f')](_0x6c53('0x30'))){_0x2dc6b8['limit']=qs[_0x6c53('0x31')](_0x317bda[_0x6c53('0x28')][_0x6c53('0x31')]);_0x2dc6b8[_0x6c53('0x19')]=qs[_0x6c53('0x19')](_0x317bda[_0x6c53('0x28')]['offset']);}return _0x3d0d6d[_0x6c53('0x4b')](_0x2dc6b8);}})['then'](function(_0x49ce7a){if(_0x49ce7a){return _0x49ce7a?{'count':_0x1a7a12,'rows':_0x49ce7a}:null;}})['then'](respondWithResult(_0x3baa7b,null))[_0x6c53('0x3e')](handleError(_0x3baa7b,null));};exports[_0x6c53('0x4c')]=function(_0x48823b,_0x62537a,_0x1ca5f1){return db[_0x6c53('0x4d')][_0x6c53('0x44')]({'where':{'id':_0x48823b[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x62537a,null))[_0x6c53('0x1f')](function(_0x449b7e){if(_0x449b7e){return _0x449b7e[_0x6c53('0x4c')](_0x48823b[_0x6c53('0x43')][_0x6c53('0x47')],_[_0x6c53('0x48')](_0x48823b[_0x6c53('0x43')],[_0x6c53('0x47'),'id'])||{});}})[_0x6c53('0x1f')](respondWithResult(_0x62537a,null))[_0x6c53('0x3e')](handleError(_0x62537a,null));};exports[_0x6c53('0x4e')]=function(_0x15b6ac,_0x839e14,_0x1d0946){var _0x4544c={};var _0x295b46={};var _0x1a5c01;var _0x319bff;return db[_0x6c53('0x3b')][_0x6c53('0x49')]({'where':{'id':_0x15b6ac[_0x6c53('0x3f')]['id']}})[_0x6c53('0x1f')](handleEntityNotFound(_0x839e14,null))[_0x6c53('0x1f')](function(_0x132b16){if(_0x132b16){_0x1a5c01=_0x132b16;_0x295b46[_0x6c53('0x27')]=_[_0x6c53('0x29')](db[_0x6c53('0x4d')][_0x6c53('0x24')]);_0x295b46[_0x6c53('0x28')]=_[_0x6c53('0x29')](_0x15b6ac[_0x6c53('0x28')]);_0x295b46[_0x6c53('0x2a')]=_[_0x6c53('0x2c')](_0x295b46['model'],_0x295b46['query']);_0x4544c['attributes']=_[_0x6c53('0x2c')](_0x295b46['model'],qs[_0x6c53('0x2d')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x2d')]));_0x4544c['attributes']=_0x4544c[_0x6c53('0x2b')]['length']?_0x4544c[_0x6c53('0x2b')]:_0x295b46[_0x6c53('0x27')];_0x4544c[_0x6c53('0x32')]=qs[_0x6c53('0x33')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x33')]);_0x4544c[_0x6c53('0x34')]=qs[_0x6c53('0x2a')](_['pick'](_0x15b6ac['query'],_0x295b46[_0x6c53('0x2a')]));if(_0x15b6ac['query']['filter']){_0x4544c[_0x6c53('0x34')]=_[_0x6c53('0x37')](_0x4544c[_0x6c53('0x34')],{'$or':_[_0x6c53('0x4a')](_0x4544c[_0x6c53('0x2b')],function(_0x3999bf){var _0x27154d={};_0x27154d[_0x3999bf]={'$like':'%'+_0x15b6ac['query'][_0x6c53('0x36')]+'%'};return _0x27154d;})});}_0x4544c=_[_0x6c53('0x37')]({},_0x4544c,_0x15b6ac[_0x6c53('0x41')]);return _0x1a5c01['getActions'](_0x4544c);}})['then'](function(_0x500f2c){if(_0x500f2c){_0x319bff=_0x500f2c[_0x6c53('0x2e')];if(!_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x2f')](_0x6c53('0x30'))){_0x4544c[_0x6c53('0x31')]=qs[_0x6c53('0x31')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x31')]);_0x4544c['offset']=qs[_0x6c53('0x19')](_0x15b6ac[_0x6c53('0x28')][_0x6c53('0x19')]);}return _0x1a5c01[_0x6c53('0x4e')](_0x4544c);}})['then'](function(_0x4cf468){if(_0x4cf468){return _0x4cf468?{'count':_0x319bff,'rows':_0x4cf468}:null;}})[_0x6c53('0x1f')](respondWithResult(_0x839e14,null))['catch'](handleError(_0x839e14,null));}; \ No newline at end of file +var _0x78ac=['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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','map','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Automation','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','update','body','find','Condition','addConditions','ids','omit','getConditions','findOne','length','addActions','Action','getActions','pick','rimraf','zip-dir'];(function(_0x4821ef,_0x71f899){var _0x5a7277=function(_0x208c3e){while(--_0x208c3e){_0x4821ef['push'](_0x4821ef['shift']());}};_0x5a7277(++_0x71f899);}(_0x78ac,0x162));var _0xc78a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x78ac[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc78a('0x0'));var zipdir=require(_0xc78a('0x1'));var jsonpatch=require(_0xc78a('0x2'));var rp=require(_0xc78a('0x3'));var moment=require(_0xc78a('0x4'));var BPromise=require(_0xc78a('0x5'));var Mustache=require(_0xc78a('0x6'));var util=require(_0xc78a('0x7'));var path=require(_0xc78a('0x8'));var sox=require(_0xc78a('0x9'));var csv=require(_0xc78a('0xa'));var ejs=require(_0xc78a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc78a('0xc'));var squel=require('squel');var crypto=require(_0xc78a('0xd'));var jsforce=require(_0xc78a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc78a('0xa'));var querystring=require(_0xc78a('0xf'));var Papa=require(_0xc78a('0x10'));var Redis=require(_0xc78a('0x11'));var authService=require(_0xc78a('0x12'));var qs=require(_0xc78a('0x13'));var as=require(_0xc78a('0x14'));var hardwareService=require(_0xc78a('0x15'));var logger=require(_0xc78a('0x16'))(_0xc78a('0x17'));var utils=require(_0xc78a('0x18'));var config=require(_0xc78a('0x19'));var licenseUtil=require(_0xc78a('0x1a'));var db=require(_0xc78a('0x1b'))['db'];function respondWithStatusCode(_0x2672b6,_0xa0756e){_0xa0756e=_0xa0756e||0xcc;return function(_0x3fe890){if(_0x3fe890){return _0x2672b6[_0xc78a('0x1c')](_0xa0756e);}return _0x2672b6[_0xc78a('0x1d')](_0xa0756e)[_0xc78a('0x1e')]();};}function respondWithResult(_0x381024,_0x59131c){_0x59131c=_0x59131c||0xc8;return function(_0x124d0d){if(_0x124d0d){return _0x381024[_0xc78a('0x1d')](_0x59131c)[_0xc78a('0x1f')](_0x124d0d);}};}function respondWithFilteredResult(_0x309921,_0x3b4d78){return function(_0x1d0961){if(_0x1d0961){var _0xdc0eb3=typeof _0x3b4d78[_0xc78a('0x20')]===_0xc78a('0x21')&&typeof _0x3b4d78[_0xc78a('0x22')]===_0xc78a('0x21');var _0x1b4d36=_0x1d0961['count'];var _0x2bd86b=_0xdc0eb3?0x0:_0x3b4d78['offset'];var _0x3e4ad0=_0xdc0eb3?_0x1d0961[_0xc78a('0x23')]:_0x3b4d78[_0xc78a('0x20')]+_0x3b4d78['limit'];var _0x287048;if(_0x3e4ad0>=_0x1b4d36){_0x3e4ad0=_0x1b4d36;_0x287048=0xc8;}else{_0x287048=0xce;}_0x309921[_0xc78a('0x1d')](_0x287048);return _0x309921[_0xc78a('0x24')](_0xc78a('0x25'),_0x2bd86b+'-'+_0x3e4ad0+'/'+_0x1b4d36)['json'](_0x1d0961);}return null;};}function patchUpdates(_0x4ecf06){return function(_0x24a43b){try{jsonpatch[_0xc78a('0x26')](_0x24a43b,_0x4ecf06,!![]);}catch(_0x26001d){return BPromise[_0xc78a('0x27')](_0x26001d);}return _0x24a43b[_0xc78a('0x28')]();};}function saveUpdates(_0xadaabb,_0x46a2d2){return function(_0x14ecfb){if(_0x14ecfb){return _0x14ecfb['update'](_0xadaabb)['then'](function(_0x49a20f){return _0x49a20f;});}return null;};}function removeEntity(_0x191ff8,_0x1de6e1){return function(_0x3ed97c){if(_0x3ed97c){return _0x3ed97c[_0xc78a('0x29')]()['then'](function(){_0x191ff8['status'](0xcc)[_0xc78a('0x1e')]();});}};}function handleEntityNotFound(_0x41f793,_0x42958b){return function(_0x300604){if(!_0x300604){_0x41f793[_0xc78a('0x1c')](0x194);}return _0x300604;};}function handleError(_0x14890e,_0x41d41b){_0x41d41b=_0x41d41b||0x1f4;return function(_0x41cad4){logger[_0xc78a('0x2a')](_0x41cad4[_0xc78a('0x2b')]);if(_0x41cad4[_0xc78a('0x2c')]){delete _0x41cad4[_0xc78a('0x2c')];}_0x14890e[_0xc78a('0x1d')](_0x41d41b)[_0xc78a('0x2d')](_0x41cad4);};}exports['index']=function(_0x2311ea,_0x4ad677){var _0x16317f={},_0x1dc8ae={},_0x9f1bb6={'count':0x0,'rows':[]};var _0x2db726=_[_0xc78a('0x2e')](db['Automation']['rawAttributes'],function(_0x1e54a0){return{'name':_0x1e54a0['fieldName'],'type':_0x1e54a0['type'][_0xc78a('0x2f')]};});_0x1dc8ae['model']=_[_0xc78a('0x2e')](_0x2db726,'name');_0x1dc8ae[_0xc78a('0x30')]=_[_0xc78a('0x31')](_0x2311ea[_0xc78a('0x30')]);_0x1dc8ae[_0xc78a('0x32')]=_[_0xc78a('0x33')](_0x1dc8ae[_0xc78a('0x34')],_0x1dc8ae[_0xc78a('0x30')]);_0x16317f[_0xc78a('0x35')]=_[_0xc78a('0x33')](_0x1dc8ae[_0xc78a('0x34')],qs[_0xc78a('0x36')](_0x2311ea[_0xc78a('0x30')][_0xc78a('0x36')]));_0x16317f['attributes']=_0x16317f[_0xc78a('0x35')]['length']?_0x16317f[_0xc78a('0x35')]:_0x1dc8ae[_0xc78a('0x34')];if(!_0x2311ea[_0xc78a('0x30')][_0xc78a('0x37')](_0xc78a('0x38'))){_0x16317f[_0xc78a('0x22')]=qs[_0xc78a('0x22')](_0x2311ea['query'][_0xc78a('0x22')]);_0x16317f[_0xc78a('0x20')]=qs[_0xc78a('0x20')](_0x2311ea['query'][_0xc78a('0x20')]);}_0x16317f[_0xc78a('0x39')]=qs[_0xc78a('0x3a')](_0x2311ea['query']['sort']);_0x16317f[_0xc78a('0x3b')]=qs[_0xc78a('0x32')](_['pick'](_0x2311ea['query'],_0x1dc8ae[_0xc78a('0x32')]),_0x2db726);if(_0x2311ea['query'][_0xc78a('0x3c')]){_0x16317f['where']=_[_0xc78a('0x3d')](_0x16317f[_0xc78a('0x3b')],{'$or':_['map'](_0x2db726,function(_0x120b31){if(_0x120b31['type']!==_0xc78a('0x3e')){var _0x22115e={};_0x22115e[_0x120b31[_0xc78a('0x2c')]]={'$like':'%'+_0x2311ea[_0xc78a('0x30')][_0xc78a('0x3c')]+'%'};return _0x22115e;}})});}_0x16317f=_['merge']({},_0x16317f,_0x2311ea[_0xc78a('0x3f')]);var _0x3f2eea={'where':_0x16317f[_0xc78a('0x3b')]};return db[_0xc78a('0x40')][_0xc78a('0x23')](_0x3f2eea)[_0xc78a('0x41')](function(_0x452479){_0x9f1bb6['count']=_0x452479;if(_0x2311ea[_0xc78a('0x30')]['includeAll']){_0x16317f[_0xc78a('0x42')]=[{'all':!![]}];}return db[_0xc78a('0x40')][_0xc78a('0x43')](_0x16317f);})[_0xc78a('0x41')](function(_0x362ae0){_0x9f1bb6[_0xc78a('0x44')]=_0x362ae0;return _0x9f1bb6;})[_0xc78a('0x41')](respondWithFilteredResult(_0x4ad677,_0x16317f))[_0xc78a('0x45')](handleError(_0x4ad677,null));};exports[_0xc78a('0x46')]=function(_0xe2cd01,_0x18d1fd){var _0x405975={'raw':![],'where':{'id':_0xe2cd01[_0xc78a('0x47')]['id']}},_0x4936b2={};_0x4936b2[_0xc78a('0x34')]=_['keys'](db[_0xc78a('0x40')][_0xc78a('0x48')]);_0x4936b2['query']=_[_0xc78a('0x31')](_0xe2cd01[_0xc78a('0x30')]);_0x4936b2[_0xc78a('0x32')]=_['intersection'](_0x4936b2[_0xc78a('0x34')],_0x4936b2[_0xc78a('0x30')]);_0x405975['attributes']=_['intersection'](_0x4936b2[_0xc78a('0x34')],qs[_0xc78a('0x36')](_0xe2cd01[_0xc78a('0x30')][_0xc78a('0x36')]));_0x405975[_0xc78a('0x35')]=_0x405975[_0xc78a('0x35')]['length']?_0x405975[_0xc78a('0x35')]:_0x4936b2[_0xc78a('0x34')];if(_0xe2cd01[_0xc78a('0x30')][_0xc78a('0x49')]){_0x405975['include']=[{'all':!![]}];}_0x405975=_['merge']({},_0x405975,_0xe2cd01[_0xc78a('0x3f')]);return db[_0xc78a('0x40')]['find'](_0x405975)[_0xc78a('0x41')](handleEntityNotFound(_0x18d1fd,null))[_0xc78a('0x41')](respondWithResult(_0x18d1fd,null))[_0xc78a('0x45')](handleError(_0x18d1fd,null));};exports[_0xc78a('0x4a')]=function(_0x1a5652,_0x5a818e){return db['Automation'][_0xc78a('0x4a')](_0x1a5652['body'],{})['then'](respondWithResult(_0x5a818e,0xc9))[_0xc78a('0x45')](handleError(_0x5a818e,null));};exports[_0xc78a('0x4b')]=function(_0x50d272,_0x279fe6){if(_0x50d272[_0xc78a('0x4c')]['id']){delete _0x50d272[_0xc78a('0x4c')]['id'];}return db[_0xc78a('0x40')][_0xc78a('0x4d')]({'where':{'id':_0x50d272[_0xc78a('0x47')]['id']}})[_0xc78a('0x41')](handleEntityNotFound(_0x279fe6,null))[_0xc78a('0x41')](saveUpdates(_0x50d272['body'],null))[_0xc78a('0x41')](respondWithResult(_0x279fe6,null))['catch'](handleError(_0x279fe6,null));};exports[_0xc78a('0x29')]=function(_0x3682d6,_0x352a6e){return db[_0xc78a('0x40')][_0xc78a('0x4d')]({'where':{'id':_0x3682d6['params']['id']}})[_0xc78a('0x41')](handleEntityNotFound(_0x352a6e,null))[_0xc78a('0x41')](removeEntity(_0x352a6e,null))[_0xc78a('0x45')](handleError(_0x352a6e,null));};exports['addConditions']=function(_0x3f52bb,_0xe7c17e,_0x361031){return db[_0xc78a('0x4e')][_0xc78a('0x4d')]({'where':{'id':_0x3f52bb['params']['id']}})[_0xc78a('0x41')](handleEntityNotFound(_0xe7c17e,null))['then'](function(_0x2afc85){if(_0x2afc85){return _0x2afc85[_0xc78a('0x4f')](_0x3f52bb[_0xc78a('0x4c')][_0xc78a('0x50')],_[_0xc78a('0x51')](_0x3f52bb[_0xc78a('0x4c')],['ids','id'])||{});}})[_0xc78a('0x41')](respondWithResult(_0xe7c17e,null))[_0xc78a('0x45')](handleError(_0xe7c17e,null));};exports[_0xc78a('0x52')]=function(_0x437275,_0x2ab322,_0x232d49){var _0x338a89={};var _0x1f3621={};var _0x4668a8;var _0x28871e;return db[_0xc78a('0x40')][_0xc78a('0x53')]({'where':{'id':_0x437275[_0xc78a('0x47')]['id']}})[_0xc78a('0x41')](handleEntityNotFound(_0x2ab322,null))['then'](function(_0x270799){if(_0x270799){_0x4668a8=_0x270799;_0x1f3621[_0xc78a('0x34')]=_['keys'](db[_0xc78a('0x4e')]['rawAttributes']);_0x1f3621[_0xc78a('0x30')]=_[_0xc78a('0x31')](_0x437275[_0xc78a('0x30')]);_0x1f3621[_0xc78a('0x32')]=_['intersection'](_0x1f3621[_0xc78a('0x34')],_0x1f3621[_0xc78a('0x30')]);_0x338a89['attributes']=_['intersection'](_0x1f3621[_0xc78a('0x34')],qs['fields'](_0x437275['query']['fields']));_0x338a89['attributes']=_0x338a89[_0xc78a('0x35')][_0xc78a('0x54')]?_0x338a89[_0xc78a('0x35')]:_0x1f3621[_0xc78a('0x34')];_0x338a89[_0xc78a('0x39')]=qs[_0xc78a('0x3a')](_0x437275['query'][_0xc78a('0x3a')]);_0x338a89[_0xc78a('0x3b')]=qs[_0xc78a('0x32')](_['pick'](_0x437275[_0xc78a('0x30')],_0x1f3621[_0xc78a('0x32')]));if(_0x437275[_0xc78a('0x30')][_0xc78a('0x3c')]){_0x338a89[_0xc78a('0x3b')]=_[_0xc78a('0x3d')](_0x338a89[_0xc78a('0x3b')],{'$or':_[_0xc78a('0x2e')](_0x338a89['attributes'],function(_0x6a0530){var _0x5a52ca={};_0x5a52ca[_0x6a0530]={'$like':'%'+_0x437275[_0xc78a('0x30')]['filter']+'%'};return _0x5a52ca;})});}_0x338a89=_[_0xc78a('0x3d')]({},_0x338a89,_0x437275[_0xc78a('0x3f')]);return _0x4668a8[_0xc78a('0x52')](_0x338a89);}})['then'](function(_0x27c360){if(_0x27c360){_0x28871e=_0x27c360[_0xc78a('0x54')];if(!_0x437275[_0xc78a('0x30')][_0xc78a('0x37')](_0xc78a('0x38'))){_0x338a89[_0xc78a('0x22')]=qs[_0xc78a('0x22')](_0x437275[_0xc78a('0x30')][_0xc78a('0x22')]);_0x338a89[_0xc78a('0x20')]=qs[_0xc78a('0x20')](_0x437275[_0xc78a('0x30')][_0xc78a('0x20')]);}return _0x4668a8[_0xc78a('0x52')](_0x338a89);}})['then'](function(_0x18090a){if(_0x18090a){return _0x18090a?{'count':_0x28871e,'rows':_0x18090a}:null;}})['then'](respondWithResult(_0x2ab322,null))[_0xc78a('0x45')](handleError(_0x2ab322,null));};exports[_0xc78a('0x55')]=function(_0x335fe5,_0x210c61,_0x2e1436){return db[_0xc78a('0x56')][_0xc78a('0x4d')]({'where':{'id':_0x335fe5[_0xc78a('0x47')]['id']}})[_0xc78a('0x41')](handleEntityNotFound(_0x210c61,null))[_0xc78a('0x41')](function(_0x3d1618){if(_0x3d1618){return _0x3d1618['addActions'](_0x335fe5['body']['ids'],_['omit'](_0x335fe5['body'],[_0xc78a('0x50'),'id'])||{});}})[_0xc78a('0x41')](respondWithResult(_0x210c61,null))[_0xc78a('0x45')](handleError(_0x210c61,null));};exports[_0xc78a('0x57')]=function(_0x26724d,_0x82cec6,_0x3d9e81){var _0x31665b={};var _0x4dd410={};var _0x46279b;var _0x1186fb;return db[_0xc78a('0x40')]['findOne']({'where':{'id':_0x26724d[_0xc78a('0x47')]['id']}})['then'](handleEntityNotFound(_0x82cec6,null))[_0xc78a('0x41')](function(_0x2a5f3a){if(_0x2a5f3a){_0x46279b=_0x2a5f3a;_0x4dd410[_0xc78a('0x34')]=_[_0xc78a('0x31')](db[_0xc78a('0x56')][_0xc78a('0x48')]);_0x4dd410[_0xc78a('0x30')]=_[_0xc78a('0x31')](_0x26724d[_0xc78a('0x30')]);_0x4dd410[_0xc78a('0x32')]=_['intersection'](_0x4dd410[_0xc78a('0x34')],_0x4dd410[_0xc78a('0x30')]);_0x31665b['attributes']=_[_0xc78a('0x33')](_0x4dd410[_0xc78a('0x34')],qs['fields'](_0x26724d[_0xc78a('0x30')][_0xc78a('0x36')]));_0x31665b['attributes']=_0x31665b[_0xc78a('0x35')][_0xc78a('0x54')]?_0x31665b[_0xc78a('0x35')]:_0x4dd410['model'];_0x31665b[_0xc78a('0x39')]=qs[_0xc78a('0x3a')](_0x26724d['query'][_0xc78a('0x3a')]);_0x31665b[_0xc78a('0x3b')]=qs[_0xc78a('0x32')](_[_0xc78a('0x58')](_0x26724d[_0xc78a('0x30')],_0x4dd410[_0xc78a('0x32')]));if(_0x26724d['query'][_0xc78a('0x3c')]){_0x31665b[_0xc78a('0x3b')]=_[_0xc78a('0x3d')](_0x31665b[_0xc78a('0x3b')],{'$or':_[_0xc78a('0x2e')](_0x31665b[_0xc78a('0x35')],function(_0x3f5b7b){var _0x1abb5f={};_0x1abb5f[_0x3f5b7b]={'$like':'%'+_0x26724d[_0xc78a('0x30')]['filter']+'%'};return _0x1abb5f;})});}_0x31665b=_['merge']({},_0x31665b,_0x26724d['options']);return _0x46279b['getActions'](_0x31665b);}})[_0xc78a('0x41')](function(_0x514a36){if(_0x514a36){_0x1186fb=_0x514a36[_0xc78a('0x54')];if(!_0x26724d['query'][_0xc78a('0x37')](_0xc78a('0x38'))){_0x31665b[_0xc78a('0x22')]=qs['limit'](_0x26724d[_0xc78a('0x30')][_0xc78a('0x22')]);_0x31665b[_0xc78a('0x20')]=qs['offset'](_0x26724d['query'][_0xc78a('0x20')]);}return _0x46279b['getActions'](_0x31665b);}})[_0xc78a('0x41')](function(_0x58d86f){if(_0x58d86f){return _0x58d86f?{'count':_0x1186fb,'rows':_0x58d86f}:null;}})['then'](respondWithResult(_0x82cec6,null))[_0xc78a('0x45')](handleError(_0x82cec6,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 0611398..bb3778a 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 _0x9acc=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x5d5499,_0x24a4f0){var _0x38ad7f=function(_0x419766){while(--_0x419766){_0x5d5499['push'](_0x5d5499['shift']());}};_0x38ad7f(++_0x24a4f0);}(_0x9acc,0xa8));var _0xc9ac=function(_0x4bf1e3,_0x22d016){_0x4bf1e3=_0x4bf1e3-0x0;var _0x533270=_0x9acc[_0x4bf1e3];return _0x533270;};'use strict';var _=require(_0xc9ac('0x0'));var util=require(_0xc9ac('0x1'));var logger=require(_0xc9ac('0x2'))('api');var moment=require(_0xc9ac('0x3'));var BPromise=require(_0xc9ac('0x4'));var rp=require(_0xc9ac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9ac('0x6'));var config=require(_0xc9ac('0x7'));var attributes=require(_0xc9ac('0x8'));module[_0xc9ac('0x9')]=function(_0x15dcb0,_0x5a46fe){return _0x15dcb0[_0xc9ac('0xa')](_0xc9ac('0xb'),attributes,{'tableName':_0xc9ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1a6=['moment','bluebird','request-promise','path','rimraf','./automation.attributes','Automation','tools_automations','util','../../config/logger','api'];(function(_0x305419,_0x18e5f5){var _0x1d98b4=function(_0x90a0cf){while(--_0x90a0cf){_0x305419['push'](_0x305419['shift']());}};_0x1d98b4(++_0x18e5f5);}(_0xa1a6,0x126));var _0x6a1a=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0xa1a6[_0x5c6244];return _0x5800ce;};'use strict';var _=require('lodash');var util=require(_0x6a1a('0x0'));var logger=require(_0x6a1a('0x1'))(_0x6a1a('0x2'));var moment=require(_0x6a1a('0x3'));var BPromise=require(_0x6a1a('0x4'));var rp=require(_0x6a1a('0x5'));var fs=require('fs');var path=require(_0x6a1a('0x6'));var rimraf=require(_0x6a1a('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a1a('0x8'));module['exports']=function(_0x36ff81,_0x56fc95){return _0x36ff81['define'](_0x6a1a('0x9'),attributes,{'tableName':_0x6a1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 14472af..499ecbe 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 _0x57c3=['rpc','jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4cf205,_0xb79c74){var _0x2c3942=function(_0x355b39){while(--_0x355b39){_0x4cf205['push'](_0x4cf205['shift']());}};_0x2c3942(++_0xb79c74);}(_0x57c3,0xc2));var _0x357c=function(_0x21a062,_0x4f96dd){_0x21a062=_0x21a062-0x0;var _0x105e62=_0x57c3[_0x21a062];return _0x105e62;};'use strict';var _=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var moment=require(_0x357c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x357c('0x3'))['db'];var utils=require(_0x357c('0x4'));var logger=require(_0x357c('0x5'))(_0x357c('0x6'));var config=require('../../config/environment');var jayson=require(_0x357c('0x7'));var client=jayson['client'][_0x357c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x471e56,_0x2320eb,_0x44d3ee){return new BPromise(function(_0x1fc04b,_0x1e4977){return client[_0x357c('0x9')](_0x471e56,_0x44d3ee)['then'](function(_0x5dd3dd){logger[_0x357c('0xa')](_0x357c('0xb'),_0x2320eb,_0x357c('0xc'));logger[_0x357c('0xd')](_0x357c('0xe'),_0x2320eb,_0x357c('0xc'),JSON[_0x357c('0xf')](_0x5dd3dd));if(_0x5dd3dd[_0x357c('0x10')]){if(_0x5dd3dd[_0x357c('0x10')][_0x357c('0x11')]===0x1f4){logger[_0x357c('0x10')]('Automation,\x20%s,\x20%s',_0x2320eb,_0x5dd3dd[_0x357c('0x10')][_0x357c('0x12')]);return _0x1e4977(_0x5dd3dd[_0x357c('0x10')]['message']);}logger['error'](_0x357c('0xb'),_0x2320eb,_0x5dd3dd[_0x357c('0x10')][_0x357c('0x12')]);return _0x1fc04b(_0x5dd3dd[_0x357c('0x10')][_0x357c('0x12')]);}else{logger[_0x357c('0xa')]('Automation,\x20%s,\x20%s',_0x2320eb,_0x357c('0xc'));_0x1fc04b(_0x5dd3dd[_0x357c('0x13')]['message']);}})['catch'](function(_0x105d19){logger[_0x357c('0x10')](_0x357c('0xb'),_0x2320eb,_0x105d19);_0x1e4977(_0x105d19);});});} \ No newline at end of file +var _0xc7da=['request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7da,0xf2));var _0xac7d=function(_0x2ed00c,_0x3bc41f){_0x2ed00c=_0x2ed00c-0x0;var _0x5e8c28=_0xc7da[_0x2ed00c];return _0x5e8c28;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('Automation,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('Automation,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('Automation,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 601c486..11ee720 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 _0x6d0b=['/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get'];(function(_0x3d775c,_0x1ec3f9){var _0x5bc3a1=function(_0x214b4e){while(--_0x214b4e){_0x3d775c['push'](_0x3d775c['shift']());}};_0x5bc3a1(++_0x1ec3f9);}(_0x6d0b,0x71));var _0xb6d0=function(_0x4e6265,_0x27612b){_0x4e6265=_0x4e6265-0x0;var _0x2e4f4c=_0x6d0b[_0x4e6265];return _0x2e4f4c;};'use strict';var multer=require(_0xb6d0('0x0'));var util=require('util');var path=require(_0xb6d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb6d0('0x2'));var router=express[_0xb6d0('0x3')]();var fs_extra=require(_0xb6d0('0x4'));var auth=require(_0xb6d0('0x5'));var interaction=require(_0xb6d0('0x6'));var config=require(_0xb6d0('0x7'));var controller=require(_0xb6d0('0x8'));router['get']('/',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xa')]);router[_0xb6d0('0xb')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xd')]);router[_0xb6d0('0xb')](_0xb6d0('0xe'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0xf')]);router[_0xb6d0('0xb')](_0xb6d0('0x10'),auth['isAuthenticated'](),controller[_0xb6d0('0x11')]);router['post']('/',auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x12')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xb6d0('0x13')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0xb6d0('0x14')](_0xb6d0('0xc'),auth[_0xb6d0('0x9')](),controller[_0xb6d0('0x15')]);router[_0xb6d0('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb6d0('0x17')]);module[_0xb6d0('0x18')]=router; \ No newline at end of file +var _0xa37e=['/:id/conditions','isAuthenticated','/:id/actions','create','post','addConditions','addActions','/:id','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','get','show'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa37e,0x97));var _0xea37=function(_0x449019,_0x532220){_0x449019=_0x449019-0x0;var _0x415042=_0xa37e[_0x449019];return _0x415042;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea37('0x5'));var controller=require(_0xea37('0x6'));router[_0xea37('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xea37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xea37('0x8')]);router[_0xea37('0x7')](_0xea37('0x9'),auth[_0xea37('0xa')](),controller['getConditions']);router[_0xea37('0x7')](_0xea37('0xb'),auth[_0xea37('0xa')](),controller['getActions']);router['post']('/',auth[_0xea37('0xa')](),controller[_0xea37('0xc')]);router[_0xea37('0xd')]('/:id/conditions',auth[_0xea37('0xa')](),controller[_0xea37('0xe')]);router[_0xea37('0xd')]('/:id/actions',auth[_0xea37('0xa')](),controller[_0xea37('0xf')]);router['put'](_0xea37('0x10'),auth['isAuthenticated'](),controller[_0xea37('0x11')]);router['delete'](_0xea37('0x10'),auth[_0xea37('0xa')](),controller[_0xea37('0x12')]);module[_0xea37('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 87d0cad..4c209cf 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 _0xdfae=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xdfae,0x191));var _0xedfa=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xdfae[_0x61b3ab];return _0x57097f;};'use strict';var Sequelize=require(_0xedfa('0x0'));module[_0xedfa('0x1')]={'name':{'type':Sequelize[_0xedfa('0x2')],'unique':_0xedfa('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xedfa('0x4')](_0xedfa('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xedfa('0x2')]},'active':{'type':Sequelize[_0xedfa('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xedfa('0x7')](0x4)[_0xedfa('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xedfa('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xedfa('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'comment':_0xedfa('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xedfa('0xe')},'dialTimezone':{'type':Sequelize[_0xedfa('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xedfa('0x2')],'defaultValue':_0xedfa('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xedfa('0x4')](_0xedfa('0x10'),_0xedfa('0x11'),'onlyIfOpen'),'defaultValue':_0xedfa('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xedfa('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xedfa('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xedfa('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xedfa('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xedfa('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xedfa('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xedfa('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xedfa('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xedfa('0x7')](0x9)[_0xedfa('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xedfa('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xedfa('0x4')](_0xedfa('0x18'),_0xedfa('0x19')),'defaultValue':_0xedfa('0x18')},'dialPrefix':{'type':Sequelize[_0xedfa('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xedfa('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xedfa('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xedfa('0x7')](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xedfa('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xedfa('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xedfa('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xedfa('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xedfa('0x23')}}; \ No newline at end of file +var _0x77ed=['ENUM','ivr','STRING','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\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\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name'];(function(_0x12865d,_0x5f3b15){var _0x53b04c=function(_0x65d081){while(--_0x65d081){_0x12865d['push'](_0x12865d['shift']());}};_0x53b04c(++_0x5f3b15);}(_0x77ed,0x11c));var _0xd77e=function(_0x3c2d9c,_0x49408c){_0x3c2d9c=_0x3c2d9c-0x0;var _0x5e16a2=_0x77ed[_0x3c2d9c];return _0x5e16a2;};'use strict';var Sequelize=require(_0xd77e('0x0'));module[_0xd77e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd77e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd77e('0x3')](_0xd77e('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd77e('0x5')]},'active':{'type':Sequelize[_0xd77e('0x6')],'defaultValue':0x0,'comment':_0xd77e('0x7')},'limitCalls':{'type':Sequelize[_0xd77e('0x8')](0x4)[_0xd77e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd77e('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd77e('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd77e('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd77e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd77e('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd77e('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd77e('0x8')](0x5)[_0xd77e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'defaultValue':0x3,'comment':_0xd77e('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd77e('0x8')](0x5)[_0xd77e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd77e('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd77e('0x5')],'defaultValue':_0xd77e('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xd77e('0x13'),_0xd77e('0x14'),_0xd77e('0x15')),'defaultValue':_0xd77e('0x13')},'dialAMDActive':{'type':Sequelize[_0xd77e('0x6')],'defaultValue':0x0,'comment':_0xd77e('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd77e('0x17')},'dialAMDGreeting':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd77e('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd77e('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd77e('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd77e('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd77e('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd77e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd77e('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd77e('0x8')](0x9)[_0xd77e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xd77e('0x1e'),_0xd77e('0x1f')),'defaultValue':_0xd77e('0x1e')},'dialPrefix':{'type':Sequelize[_0xd77e('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd77e('0x20')},'dialCutDigit':{'type':Sequelize[_0xd77e('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd77e('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd77e('0x8')](0x5)[_0xd77e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0x22')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd77e('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0xd77e('0x8')](0x5)[_0xd77e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd77e('0x25')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd77e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0x26')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd77e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd77e('0x8')](0x5)[_0xd77e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd77e('0x8')](0x3)[_0xd77e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd77e('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd77e('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index c092e12..3b0f79d 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 _0xcbb8=['hasOwnProperty','order','sort','filters','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','include','omit','createdAt','updatedAt','update','getHoppers','CmHopper','nolimit','pick','CampaignId','filter','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','removeBlackLists','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','fieldName','model','map','keys','query','intersection','attributes'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcbb8,0x15e));var _0x8cbb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xcbb8[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x8cbb('0x0'));var rimraf=require(_0x8cbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cbb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8cbb('0x3'));var util=require(_0x8cbb('0x4'));var path=require('path');var sox=require(_0x8cbb('0x5'));var csv=require(_0x8cbb('0x6'));var ejs=require(_0x8cbb('0x7'));var fs=require('fs');var fs_extra=require(_0x8cbb('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cbb('0x9'));var jsforce=require(_0x8cbb('0xa'));var deskjs=require(_0x8cbb('0xb'));var toCsv=require(_0x8cbb('0x6'));var querystring=require(_0x8cbb('0xc'));var Papa=require(_0x8cbb('0xd'));var Redis=require(_0x8cbb('0xe'));var authService=require(_0x8cbb('0xf'));var qs=require(_0x8cbb('0x10'));var as=require(_0x8cbb('0x11'));var hardwareService=require(_0x8cbb('0x12'));var logger=require(_0x8cbb('0x13'))(_0x8cbb('0x14'));var utils=require(_0x8cbb('0x15'));var config=require(_0x8cbb('0x16'));var licenseUtil=require(_0x8cbb('0x17'));var db=require(_0x8cbb('0x18'))['db'];function respondWithStatusCode(_0x2b994f,_0x17733d){_0x17733d=_0x17733d||0xcc;return function(_0x581087){if(_0x581087){return _0x2b994f['sendStatus'](_0x17733d);}return _0x2b994f[_0x8cbb('0x19')](_0x17733d)[_0x8cbb('0x1a')]();};}function respondWithResult(_0x1083c5,_0x3e2277){_0x3e2277=_0x3e2277||0xc8;return function(_0x3dc3f3){if(_0x3dc3f3){return _0x1083c5['status'](_0x3e2277)[_0x8cbb('0x1b')](_0x3dc3f3);}};}function respondWithFilteredResult(_0x1eb428,_0x21f883){return function(_0x2c6e5a){if(_0x2c6e5a){var _0x439dd8=typeof _0x21f883['offset']===_0x8cbb('0x1c')&&typeof _0x21f883[_0x8cbb('0x1d')]===_0x8cbb('0x1c');var _0x3fb08a=_0x2c6e5a[_0x8cbb('0x1e')];var _0x1dde45=_0x439dd8?0x0:_0x21f883[_0x8cbb('0x1f')];var _0x36758f=_0x439dd8?_0x2c6e5a[_0x8cbb('0x1e')]:_0x21f883['offset']+_0x21f883['limit'];var _0x221d79;if(_0x36758f>=_0x3fb08a){_0x36758f=_0x3fb08a;_0x221d79=0xc8;}else{_0x221d79=0xce;}_0x1eb428['status'](_0x221d79);return _0x1eb428[_0x8cbb('0x20')](_0x8cbb('0x21'),_0x1dde45+'-'+_0x36758f+'/'+_0x3fb08a)[_0x8cbb('0x1b')](_0x2c6e5a);}return null;};}function patchUpdates(_0x120982){return function(_0x12e13f){try{jsonpatch[_0x8cbb('0x22')](_0x12e13f,_0x120982,!![]);}catch(_0x1a3963){return BPromise['reject'](_0x1a3963);}return _0x12e13f['save']();};}function saveUpdates(_0x329fe1,_0x2baf9b){return function(_0x322e1d){if(_0x322e1d){return _0x322e1d['update'](_0x329fe1)[_0x8cbb('0x23')](function(_0x1d5c22){return _0x1d5c22;});}return null;};}function removeEntity(_0x2ce7cd,_0xb83f3e){return function(_0x2ec4ed){if(_0x2ec4ed){return _0x2ec4ed[_0x8cbb('0x24')]()[_0x8cbb('0x23')](function(){var _0x1d3ad0=_0x2ec4ed[_0x8cbb('0x25')]({'plain':!![]});var _0x4cd45e=_0x8cbb('0x26');return db[_0x8cbb('0x27')]['destroy']({'where':{'type':_0x4cd45e,'resourceId':_0x1d3ad0['id']}})['then'](function(){return _0x2ec4ed;});})['then'](function(){_0x2ce7cd['status'](0xcc)[_0x8cbb('0x1a')]();});}};}function handleEntityNotFound(_0x7a7626,_0x11f0a9){return function(_0x3eacc0){if(!_0x3eacc0){_0x7a7626[_0x8cbb('0x28')](0x194);}return _0x3eacc0;};}function handleError(_0x5217c2,_0xf45da6){_0xf45da6=_0xf45da6||0x1f4;return function(_0x35fe87){logger[_0x8cbb('0x29')](_0x35fe87[_0x8cbb('0x2a')]);if(_0x35fe87['name']){delete _0x35fe87[_0x8cbb('0x2b')];}_0x5217c2[_0x8cbb('0x19')](_0xf45da6)[_0x8cbb('0x2c')](_0x35fe87);};}exports[_0x8cbb('0x2d')]=function(_0x7c678a,_0x4aa709){var _0xe383db={},_0x4f4a61={},_0xae9d1f={'count':0x0,'rows':[]};var _0x28f026=_['map'](db[_0x8cbb('0x2e')][_0x8cbb('0x2f')],function(_0x20718f){return{'name':_0x20718f[_0x8cbb('0x30')],'type':_0x20718f['type']['key']};});_0x4f4a61[_0x8cbb('0x31')]=_[_0x8cbb('0x32')](_0x28f026,_0x8cbb('0x2b'));_0x4f4a61['query']=_[_0x8cbb('0x33')](_0x7c678a[_0x8cbb('0x34')]);_0x4f4a61['filters']=_[_0x8cbb('0x35')](_0x4f4a61[_0x8cbb('0x31')],_0x4f4a61[_0x8cbb('0x34')]);_0xe383db[_0x8cbb('0x36')]=_['intersection'](_0x4f4a61[_0x8cbb('0x31')],qs['fields'](_0x7c678a[_0x8cbb('0x34')]['fields']));_0xe383db[_0x8cbb('0x36')]=_0xe383db[_0x8cbb('0x36')]['length']?_0xe383db['attributes']:_0x4f4a61[_0x8cbb('0x31')];if(!_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0xe383db[_0x8cbb('0x1d')]=qs['limit'](_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0xe383db[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x7c678a[_0x8cbb('0x34')]['offset']);}_0xe383db[_0x8cbb('0x38')]=qs['sort'](_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x39')]);_0xe383db['where']=qs[_0x8cbb('0x3a')](_['pick'](_0x7c678a[_0x8cbb('0x34')],_0x4f4a61['filters']),_0x28f026);if(_0x7c678a[_0x8cbb('0x34')]['filter']){_0xe383db[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0xe383db[_0x8cbb('0x3b')],{'$or':_['map'](_0x28f026,function(_0x2e4931){if(_0x2e4931[_0x8cbb('0x3d')]!==_0x8cbb('0x3e')){var _0x1dc5ca={};_0x1dc5ca[_0x2e4931[_0x8cbb('0x2b')]]={'$like':'%'+_0x7c678a['query']['filter']+'%'};return _0x1dc5ca;}})});}_0xe383db=_[_0x8cbb('0x3c')]({},_0xe383db,_0x7c678a[_0x8cbb('0x3f')]);var _0x35c34a={'where':_0xe383db[_0x8cbb('0x3b')]};return db[_0x8cbb('0x2e')]['count'](_0x35c34a)[_0x8cbb('0x23')](function(_0x15773f){_0xae9d1f[_0x8cbb('0x1e')]=_0x15773f;if(_0x7c678a[_0x8cbb('0x34')][_0x8cbb('0x40')]){_0xe383db['include']=[{'all':!![]}];}return db[_0x8cbb('0x2e')][_0x8cbb('0x41')](_0xe383db);})[_0x8cbb('0x23')](function(_0x246ee5){_0xae9d1f[_0x8cbb('0x42')]=_0x246ee5;return _0xae9d1f;})[_0x8cbb('0x23')](respondWithFilteredResult(_0x4aa709,_0xe383db))[_0x8cbb('0x43')](handleError(_0x4aa709,null));};exports[_0x8cbb('0x44')]=function(_0x3a092a,_0x4c84d2){var _0x263da3={'raw':![],'where':{'id':_0x3a092a[_0x8cbb('0x45')]['id']}},_0xf29097={};_0xf29097[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x2e')][_0x8cbb('0x2f')]);_0xf29097[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x3a092a[_0x8cbb('0x34')]);_0xf29097['filters']=_[_0x8cbb('0x35')](_0xf29097[_0x8cbb('0x31')],_0xf29097[_0x8cbb('0x34')]);_0x263da3['attributes']=_[_0x8cbb('0x35')](_0xf29097[_0x8cbb('0x31')],qs[_0x8cbb('0x46')](_0x3a092a[_0x8cbb('0x34')]['fields']));_0x263da3[_0x8cbb('0x36')]=_0x263da3[_0x8cbb('0x36')]['length']?_0x263da3[_0x8cbb('0x36')]:_0xf29097[_0x8cbb('0x31')];if(_0x3a092a[_0x8cbb('0x34')][_0x8cbb('0x40')]){_0x263da3['include']=[{'all':!![]}];}_0x263da3=_[_0x8cbb('0x3c')]({},_0x263da3,_0x3a092a[_0x8cbb('0x3f')]);return db[_0x8cbb('0x2e')][_0x8cbb('0x47')](_0x263da3)[_0x8cbb('0x23')](handleEntityNotFound(_0x4c84d2,null))[_0x8cbb('0x23')](respondWithResult(_0x4c84d2,null))[_0x8cbb('0x43')](handleError(_0x4c84d2,null));};exports[_0x8cbb('0x48')]=function(_0x45e4db,_0x1b5a4c){return db[_0x8cbb('0x2e')][_0x8cbb('0x48')](_0x45e4db[_0x8cbb('0x49')],{})[_0x8cbb('0x23')](function(_0x8de3ba){var _0xcb9f12=_0x45e4db[_0x8cbb('0x4a')][_0x8cbb('0x25')]({'plain':!![]});if(!_0xcb9f12)throw new Error(_0x8cbb('0x4b'));if(_0xcb9f12[_0x8cbb('0x4c')]==='user'){var _0x1ffb31=_0x8de3ba['get']({'plain':!![]});var _0x5689a1=_0x8cbb('0x26');return db[_0x8cbb('0x4d')][_0x8cbb('0x47')]({'where':{'name':_0x5689a1,'userProfileId':_0xcb9f12[_0x8cbb('0x4e')]},'raw':!![]})[_0x8cbb('0x23')](function(_0x1aeba8){if(_0x1aeba8&&_0x1aeba8[_0x8cbb('0x4f')]===0x0){return db[_0x8cbb('0x27')]['create']({'name':_0x1ffb31[_0x8cbb('0x2b')],'resourceId':_0x1ffb31['id'],'type':_0x1aeba8['name'],'sectionId':_0x1aeba8['id']},{})['then'](function(){return _0x8de3ba;});}else{return _0x8de3ba;}})[_0x8cbb('0x43')](function(_0x353f18){logger['error'](_0x8cbb('0x50'),_0x353f18);throw _0x353f18;});}return _0x8de3ba;})['then'](respondWithResult(_0x1b5a4c,0xc9))[_0x8cbb('0x43')](handleError(_0x1b5a4c,null));};exports['clone']=function(_0x3b351b,_0x2e72b2){var _0x43b710={'where':{'id':_0x3b351b['params']['id']}},_0x4c1b62={};_0x4c1b62['model']=_[_0x8cbb('0x33')](db[_0x8cbb('0x2e')][_0x8cbb('0x2f')]);_0x43b710[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x4c1b62[_0x8cbb('0x31')],qs[_0x8cbb('0x46')](_0x3b351b[_0x8cbb('0x34')][_0x8cbb('0x46')]));_0x43b710[_0x8cbb('0x36')]=_0x43b710[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x43b710[_0x8cbb('0x36')]:_0x4c1b62['model'];if(_0x3b351b['query'][_0x8cbb('0x40')]){_0x43b710[_0x8cbb('0x52')]=[{'all':!![]}];}_0x43b710=_[_0x8cbb('0x3c')]({},_0x43b710,_0x3b351b['options']);return db['Campaign'][_0x8cbb('0x47')](_0x43b710)[_0x8cbb('0x23')](handleEntityNotFound(_0x2e72b2,null))[_0x8cbb('0x23')](function(_0x2dd000){if(_0x2dd000){var _0x520898=_0x2dd000[_0x8cbb('0x25')]({'plain':!![]});_0x520898=qs[_0x8cbb('0x53')](_0x520898,['id',_0x8cbb('0x54'),_0x8cbb('0x55')]);_0x3b351b[_0x8cbb('0x49')]=_[_0x8cbb('0x53')](_0x3b351b[_0x8cbb('0x49')],['id',_0x8cbb('0x54'),_0x8cbb('0x55')]);return db[_0x8cbb('0x2e')][_0x8cbb('0x48')](_[_0x8cbb('0x3c')](_0x520898,_0x3b351b[_0x8cbb('0x49')]),{'include':_0x3b351b[_0x8cbb('0x34')][_0x8cbb('0x40')]?[{'all':!![]}]:undefined})[_0x8cbb('0x23')](function(_0x58c107){var _0x121590=_0x3b351b['user'][_0x8cbb('0x25')]({'plain':!![]});if(!_0x121590)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x121590['role']===_0x8cbb('0x4a')){var _0xefae33=_0x58c107['get']({'plain':!![]});var _0x4f4f45=_0x8cbb('0x26');return db[_0x8cbb('0x4d')][_0x8cbb('0x47')]({'where':{'name':_0x4f4f45,'userProfileId':_0x121590[_0x8cbb('0x4e')]},'raw':!![]})[_0x8cbb('0x23')](function(_0x5c4527){if(_0x5c4527&&_0x5c4527['autoAssociation']===0x0){return db[_0x8cbb('0x27')][_0x8cbb('0x48')]({'name':_0xefae33['name'],'resourceId':_0xefae33['id'],'type':_0x5c4527['name'],'sectionId':_0x5c4527['id']},{})['then'](function(){return _0x58c107;});}else{return _0x58c107;}})[_0x8cbb('0x43')](function(_0x3b0e0a){logger[_0x8cbb('0x29')](_0x8cbb('0x50'),_0x3b0e0a);throw _0x3b0e0a;});}return _0x58c107;});}})[_0x8cbb('0x23')](respondWithResult(_0x2e72b2,0xc9))[_0x8cbb('0x43')](handleError(_0x2e72b2,null));};exports[_0x8cbb('0x56')]=function(_0x2916c5,_0x69332a){if(_0x2916c5['body']['id']){delete _0x2916c5[_0x8cbb('0x49')]['id'];}return db[_0x8cbb('0x2e')]['find']({'where':{'id':_0x2916c5[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x69332a,null))[_0x8cbb('0x23')](saveUpdates(_0x2916c5[_0x8cbb('0x49')],null))['then'](respondWithResult(_0x69332a,null))[_0x8cbb('0x43')](handleError(_0x69332a,null));};exports[_0x8cbb('0x24')]=function(_0x3694e9,_0x357d69){return db[_0x8cbb('0x2e')][_0x8cbb('0x47')]({'where':{'id':_0x3694e9[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x357d69,null))[_0x8cbb('0x23')](removeEntity(_0x357d69,null))[_0x8cbb('0x43')](handleError(_0x357d69,null));};exports[_0x8cbb('0x57')]=function(_0x2cf412,_0x4d8a8c,_0x461166){var _0x8b95af={'raw':!![],'where':{}};var _0x10fe10={};var _0x4be602={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x2cf412['params']['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x4d8a8c,null))[_0x8cbb('0x23')](function(_0x4c209c){if(_0x4c209c){_0x10fe10[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x58')][_0x8cbb('0x2f')]);_0x10fe10[_0x8cbb('0x34')]=_['keys'](_0x2cf412['query']);_0x10fe10['filters']=_[_0x8cbb('0x35')](_0x10fe10[_0x8cbb('0x31')],_0x10fe10[_0x8cbb('0x34')]);_0x8b95af[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x10fe10[_0x8cbb('0x31')],qs['fields'](_0x2cf412['query'][_0x8cbb('0x46')]));_0x8b95af['attributes']=_0x8b95af[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x8b95af['attributes']:_0x10fe10['model'];if(!_0x2cf412['query'][_0x8cbb('0x37')](_0x8cbb('0x59'))){_0x8b95af[_0x8cbb('0x1d')]=qs[_0x8cbb('0x1d')](_0x2cf412[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x8b95af[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x2cf412[_0x8cbb('0x34')]['offset']);}_0x8b95af[_0x8cbb('0x38')]=qs['sort'](_0x2cf412['query'][_0x8cbb('0x39')]);_0x8b95af[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x2cf412[_0x8cbb('0x34')],_0x10fe10[_0x8cbb('0x3a')]));_0x8b95af[_0x8cbb('0x3b')][_0x8cbb('0x5b')]=_0x4c209c['id'];if(_0x2cf412[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x8b95af[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x8b95af[_0x8cbb('0x3b')],{'$or':_[_0x8cbb('0x32')](_0x8b95af[_0x8cbb('0x36')],function(_0x23c3b1){var _0x5b74a4={};_0x5b74a4[_0x23c3b1]={'$like':'%'+_0x2cf412['query']['filter']+'%'};return _0x5b74a4;})});}_0x8b95af=_[_0x8cbb('0x3c')]({},_0x8b95af,_0x2cf412['options']);return db[_0x8cbb('0x58')][_0x8cbb('0x1e')]({'where':_0x8b95af[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x2e77b5){_0x4be602[_0x8cbb('0x1e')]=_0x2e77b5;if(_0x2cf412[_0x8cbb('0x34')]['includeAll']){_0x8b95af[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x58')]['findAll'](_0x8b95af);})[_0x8cbb('0x23')](function(_0xaebf3e){_0x4be602[_0x8cbb('0x42')]=_0xaebf3e;return _0x4be602;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x4d8a8c,_0x8b95af))[_0x8cbb('0x43')](handleError(_0x4d8a8c,null));};exports['getHopperHistories']=function(_0x2d2e6f,_0x458b84,_0x3a12c7){var _0x3af596={'raw':!![],'where':{}};var _0x39a682={};var _0x548045={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')][_0x8cbb('0x5d')]({'where':{'id':_0x2d2e6f['params']['id']}})['then'](handleEntityNotFound(_0x458b84,null))[_0x8cbb('0x23')](function(_0xabe686){if(_0xabe686){_0x39a682[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x5e')][_0x8cbb('0x2f')]);_0x39a682[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x2d2e6f[_0x8cbb('0x34')]);_0x39a682[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x39a682[_0x8cbb('0x31')],_0x39a682[_0x8cbb('0x34')]);_0x3af596[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x39a682['model'],qs[_0x8cbb('0x46')](_0x2d2e6f['query']['fields']));_0x3af596[_0x8cbb('0x36')]=_0x3af596[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x3af596['attributes']:_0x39a682['model'];if(!_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x37')](_0x8cbb('0x59'))){_0x3af596['limit']=qs[_0x8cbb('0x1d')](_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x3af596[_0x8cbb('0x1f')]=qs['offset'](_0x2d2e6f[_0x8cbb('0x34')]['offset']);}_0x3af596[_0x8cbb('0x38')]=qs[_0x8cbb('0x39')](_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x39')]);_0x3af596[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_['pick'](_0x2d2e6f['query'],_0x39a682[_0x8cbb('0x3a')]));_0x3af596[_0x8cbb('0x3b')]['CampaignId']=_0xabe686['id'];if(_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x3af596['where']=_['merge'](_0x3af596['where'],{'$or':_['map'](_0x3af596[_0x8cbb('0x36')],function(_0x16dc85){var _0x244f74={};_0x244f74[_0x16dc85]={'$like':'%'+_0x2d2e6f[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0x244f74;})});}_0x3af596=_[_0x8cbb('0x3c')]({},_0x3af596,_0x2d2e6f[_0x8cbb('0x3f')]);return db[_0x8cbb('0x5e')][_0x8cbb('0x1e')]({'where':_0x3af596[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x5c69f4){_0x548045['count']=_0x5c69f4;if(_0x2d2e6f[_0x8cbb('0x34')]['includeAll']){_0x3af596[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x5e')][_0x8cbb('0x41')](_0x3af596);})[_0x8cbb('0x23')](function(_0x410182){_0x548045[_0x8cbb('0x42')]=_0x410182;return _0x548045;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x458b84,_0x3af596))[_0x8cbb('0x43')](handleError(_0x458b84,null));};exports[_0x8cbb('0x5f')]=function(_0x36cc49,_0x3808bc,_0x2b8d61){var _0x4853d3={'raw':!![],'where':{}};var _0x562fe7={};var _0x5003c8={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x36cc49[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x3808bc,null))[_0x8cbb('0x23')](function(_0x1b5b6b){if(_0x1b5b6b){_0x562fe7[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db['CmHopperFinal'][_0x8cbb('0x2f')]);_0x562fe7[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x36cc49[_0x8cbb('0x34')]);_0x562fe7[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x562fe7[_0x8cbb('0x31')],_0x562fe7[_0x8cbb('0x34')]);_0x4853d3[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x562fe7['model'],qs[_0x8cbb('0x46')](_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x46')]));_0x4853d3[_0x8cbb('0x36')]=_0x4853d3[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x4853d3[_0x8cbb('0x36')]:_0x562fe7[_0x8cbb('0x31')];if(!_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0x4853d3[_0x8cbb('0x1d')]=qs['limit'](_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x4853d3[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x36cc49[_0x8cbb('0x34')]['offset']);}_0x4853d3['order']=qs[_0x8cbb('0x39')](_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x39')]);_0x4853d3[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x36cc49[_0x8cbb('0x34')],_0x562fe7[_0x8cbb('0x3a')]));_0x4853d3['where'][_0x8cbb('0x5b')]=_0x1b5b6b['id'];if(_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x4853d3[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x4853d3[_0x8cbb('0x3b')],{'$or':_[_0x8cbb('0x32')](_0x4853d3[_0x8cbb('0x36')],function(_0x4204b7){var _0xecdfc={};_0xecdfc[_0x4204b7]={'$like':'%'+_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0xecdfc;})});}_0x4853d3=_[_0x8cbb('0x3c')]({},_0x4853d3,_0x36cc49['options']);return db['CmHopperFinal'][_0x8cbb('0x1e')]({'where':_0x4853d3[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x4c692a){_0x5003c8['count']=_0x4c692a;if(_0x36cc49[_0x8cbb('0x34')][_0x8cbb('0x40')]){_0x4853d3[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x60')][_0x8cbb('0x41')](_0x4853d3);})['then'](function(_0x36e5f0){_0x5003c8['rows']=_0x36e5f0;return _0x5003c8;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x3808bc,_0x4853d3))['catch'](handleError(_0x3808bc,null));};exports['getHopperBlacks']=function(_0x1cac54,_0x118845,_0x442a18){var _0x1c5ce9={'raw':!![],'where':{}};var _0x595744={};var _0x3da660={'count':0x0,'rows':[]};return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x1cac54['params']['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x118845,null))[_0x8cbb('0x23')](function(_0x5e41e6){if(_0x5e41e6){_0x595744[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db['CmHopperBlack'][_0x8cbb('0x2f')]);_0x595744[_0x8cbb('0x34')]=_['keys'](_0x1cac54[_0x8cbb('0x34')]);_0x595744[_0x8cbb('0x3a')]=_['intersection'](_0x595744[_0x8cbb('0x31')],_0x595744[_0x8cbb('0x34')]);_0x1c5ce9[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x595744[_0x8cbb('0x31')],qs['fields'](_0x1cac54['query']['fields']));_0x1c5ce9[_0x8cbb('0x36')]=_0x1c5ce9[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x1c5ce9[_0x8cbb('0x36')]:_0x595744[_0x8cbb('0x31')];if(!_0x1cac54[_0x8cbb('0x34')][_0x8cbb('0x37')](_0x8cbb('0x59'))){_0x1c5ce9['limit']=qs[_0x8cbb('0x1d')](_0x1cac54[_0x8cbb('0x34')]['limit']);_0x1c5ce9[_0x8cbb('0x1f')]=qs['offset'](_0x1cac54[_0x8cbb('0x34')][_0x8cbb('0x1f')]);}_0x1c5ce9['order']=qs[_0x8cbb('0x39')](_0x1cac54[_0x8cbb('0x34')]['sort']);_0x1c5ce9[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x1cac54[_0x8cbb('0x34')],_0x595744[_0x8cbb('0x3a')]));_0x1c5ce9[_0x8cbb('0x3b')][_0x8cbb('0x5b')]=_0x5e41e6['id'];if(_0x1cac54[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x1c5ce9['where']=_[_0x8cbb('0x3c')](_0x1c5ce9[_0x8cbb('0x3b')],{'$or':_['map'](_0x1c5ce9[_0x8cbb('0x36')],function(_0x357e8e){var _0xe86f41={};_0xe86f41[_0x357e8e]={'$like':'%'+_0x1cac54['query'][_0x8cbb('0x5c')]+'%'};return _0xe86f41;})});}_0x1c5ce9=_[_0x8cbb('0x3c')]({},_0x1c5ce9,_0x1cac54[_0x8cbb('0x3f')]);return db[_0x8cbb('0x61')][_0x8cbb('0x1e')]({'where':_0x1c5ce9[_0x8cbb('0x3b')]})[_0x8cbb('0x23')](function(_0x3e6bbf){_0x3da660[_0x8cbb('0x1e')]=_0x3e6bbf;if(_0x1cac54[_0x8cbb('0x34')]['includeAll']){_0x1c5ce9[_0x8cbb('0x52')]=[{'all':!![]}];}return db[_0x8cbb('0x61')][_0x8cbb('0x41')](_0x1c5ce9);})['then'](function(_0x51fff8){_0x3da660['rows']=_0x51fff8;return _0x3da660;});}})[_0x8cbb('0x23')](respondWithFilteredResult(_0x118845,_0x1c5ce9))[_0x8cbb('0x43')](handleError(_0x118845,null));};exports[_0x8cbb('0x62')]=function(_0x1439c7,_0x5a0ac1,_0x39ad65){var _0x560a5c={};var _0x498bd9={};var _0x5be4c6;var _0x4f73ac;return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x1439c7['params']['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x5a0ac1,null))['then'](function(_0x34d9f3){if(_0x34d9f3){_0x5be4c6=_0x34d9f3;_0x498bd9[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db[_0x8cbb('0x63')]['rawAttributes']);_0x498bd9[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x1439c7[_0x8cbb('0x34')]);_0x498bd9[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x498bd9[_0x8cbb('0x31')],_0x498bd9[_0x8cbb('0x34')]);_0x560a5c[_0x8cbb('0x36')]=_['intersection'](_0x498bd9['model'],qs['fields'](_0x1439c7['query']['fields']));_0x560a5c[_0x8cbb('0x36')]=_0x560a5c[_0x8cbb('0x36')][_0x8cbb('0x51')]?_0x560a5c[_0x8cbb('0x36')]:_0x498bd9[_0x8cbb('0x31')];_0x560a5c[_0x8cbb('0x38')]=qs['sort'](_0x1439c7[_0x8cbb('0x34')]['sort']);_0x560a5c[_0x8cbb('0x3b')]=qs[_0x8cbb('0x3a')](_[_0x8cbb('0x5a')](_0x1439c7[_0x8cbb('0x34')],_0x498bd9['filters']));if(_0x1439c7[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x560a5c[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x560a5c['where'],{'$or':_[_0x8cbb('0x32')](_0x560a5c['attributes'],function(_0x208389){var _0x18dd6d={};_0x18dd6d[_0x208389]={'$like':'%'+_0x1439c7[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0x18dd6d;})});}_0x560a5c=_[_0x8cbb('0x3c')]({},_0x560a5c,_0x1439c7[_0x8cbb('0x3f')]);return _0x5be4c6['getLists'](_0x560a5c);}})[_0x8cbb('0x23')](function(_0x6612da){if(_0x6612da){_0x4f73ac=_0x6612da[_0x8cbb('0x51')];if(!_0x1439c7[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0x560a5c[_0x8cbb('0x1d')]=qs[_0x8cbb('0x1d')](_0x1439c7['query'][_0x8cbb('0x1d')]);_0x560a5c[_0x8cbb('0x1f')]=qs[_0x8cbb('0x1f')](_0x1439c7[_0x8cbb('0x34')]['offset']);}return _0x5be4c6[_0x8cbb('0x62')](_0x560a5c);}})[_0x8cbb('0x23')](function(_0x3141ea){if(_0x3141ea){return _0x3141ea?{'count':_0x4f73ac,'rows':_0x3141ea}:null;}})[_0x8cbb('0x23')](respondWithResult(_0x5a0ac1,null))[_0x8cbb('0x43')](handleError(_0x5a0ac1,null));};exports[_0x8cbb('0x64')]=function(_0x461ddc,_0x30d162,_0x2c61ca){var _0x4c8c3f,_0x43f6f2;return db[_0x8cbb('0x2e')][_0x8cbb('0x47')]({'where':{'id':_0x461ddc[_0x8cbb('0x45')]['id']}})['then'](handleEntityNotFound(_0x30d162,null))[_0x8cbb('0x23')](function(_0x592013){if(_0x592013){_0x43f6f2=_0x592013;return _0x592013['addLists'](_0x461ddc[_0x8cbb('0x49')][_0x8cbb('0x65')],_[_0x8cbb('0x53')](_0x461ddc[_0x8cbb('0x49')],[_0x8cbb('0x65'),'id'])||{});}return null;})[_0x8cbb('0x66')](function(_0x3cc0a9){var _0x112907;_0x4c8c3f=_0x3cc0a9||[];var _0x139376=[];if(_0x3cc0a9){for(var _0x2ffb05=0x0;_0x2ffb05<_0x3cc0a9['length'];_0x2ffb05+=0x1){var _0x3dec72=_0x3cc0a9[_0x2ffb05][_0x8cbb('0x25')]({'plain':!![]});_0x43f6f2[_0x8cbb('0x67')]=_0x461ddc[_0x8cbb('0x49')][_0x8cbb('0x67')]?_0x461ddc[_0x8cbb('0x49')][_0x8cbb('0x67')]:_0x43f6f2[_0x8cbb('0x67')];switch(_0x43f6f2[_0x8cbb('0x67')]){case _0x8cbb('0x68'):_0x112907=squel['insert']()['into'](_0x8cbb('0x69'))[_0x8cbb('0x6a')](['phone',_0x8cbb('0x6b'),_0x8cbb('0x6c'),_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel['select']()[_0x8cbb('0x6e')]('phone',_0x8cbb('0x6f'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x6b'))['field']('id','ContactId')[_0x8cbb('0x6e')](_0x3dec72[_0x8cbb('0x71')]['toString'](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x461ddc[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x54'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x55'))['from']('cm_contacts')['where'](_0x8cbb('0x73'))[_0x8cbb('0x3b')](_0x8cbb('0x74'),_0x3dec72[_0x8cbb('0x71')][_0x8cbb('0x72')]())[_0x8cbb('0x3b')](_0x8cbb('0x75'))['where'](_0x8cbb('0x76'),squel[_0x8cbb('0x77')]()['field'](_0x8cbb('0x78'))[_0x8cbb('0x79')](_0x8cbb('0x7a'))['where'](_0x8cbb('0x7b'),_0x461ddc[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')]()))[_0x8cbb('0x3b')](_0x8cbb('0x76'),squel[_0x8cbb('0x77')]()[_0x8cbb('0x6e')](_0x8cbb('0x7c'))[_0x8cbb('0x79')]('cm_hopper')[_0x8cbb('0x3b')](_0x8cbb('0x7b'),_0x461ddc[_0x8cbb('0x45')]['id']['toString']())))[_0x8cbb('0x72')]();break;case _0x8cbb('0x7d'):_0x112907=squel[_0x8cbb('0x7e')]()['into'](_0x8cbb('0x69'))['fromQuery']([_0x8cbb('0x6f'),_0x8cbb('0x6b'),_0x8cbb('0x6c'),_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel['select']()[_0x8cbb('0x6e')](_0x8cbb('0x6f'),_0x8cbb('0x6f'))[_0x8cbb('0x6e')]('NOW()',_0x8cbb('0x6b'))['field']('id',_0x8cbb('0x6c'))[_0x8cbb('0x6e')](_0x3dec72[_0x8cbb('0x71')][_0x8cbb('0x72')](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x461ddc['params']['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))[_0x8cbb('0x6e')]('NOW()',_0x8cbb('0x54'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x55'))[_0x8cbb('0x79')]('cm_contacts')[_0x8cbb('0x3b')](_0x8cbb('0x73'))[_0x8cbb('0x3b')]('ListId\x20=\x20?',_0x3dec72[_0x8cbb('0x71')][_0x8cbb('0x72')]())[_0x8cbb('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x8cbb('0x3b')](_0x8cbb('0x76'),squel[_0x8cbb('0x77')]()[_0x8cbb('0x6e')]('COALESCE(phone,\x27\x27)')[_0x8cbb('0x79')](_0x8cbb('0x69'))['where'](_0x8cbb('0x7b'),_0x461ddc['params']['id'][_0x8cbb('0x72')]())))[_0x8cbb('0x72')]();break;default:_0x112907=squel[_0x8cbb('0x7e')]()[_0x8cbb('0x7f')]('cm_hopper')[_0x8cbb('0x6a')]([_0x8cbb('0x6f'),_0x8cbb('0x6b'),'ContactId',_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel[_0x8cbb('0x77')]()[_0x8cbb('0x6e')]('phone',_0x8cbb('0x6f'))[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x6b'))[_0x8cbb('0x6e')]('id',_0x8cbb('0x6c'))[_0x8cbb('0x6e')](_0x3dec72['CmListId'][_0x8cbb('0x72')](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x461ddc[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))['field'](_0x8cbb('0x70'),'createdAt')[_0x8cbb('0x6e')](_0x8cbb('0x70'),_0x8cbb('0x55'))[_0x8cbb('0x79')]('cm_contacts')[_0x8cbb('0x3b')](_0x8cbb('0x73'))[_0x8cbb('0x3b')](_0x8cbb('0x74'),_0x3dec72['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8cbb('0x72')]();}_0x139376[_0x8cbb('0x80')](db['sequelize']['query'](_0x112907));}return BPromise['all'](_0x139376);}})[_0x8cbb('0x23')](function(){return _0x4c8c3f;})[_0x8cbb('0x23')](respondWithResult(_0x30d162,null))[_0x8cbb('0x43')](handleError(_0x30d162,null));};exports[_0x8cbb('0x81')]=function(_0x4aa7f6,_0x42a05b,_0x120fb4){return db[_0x8cbb('0x2e')]['find']({'where':{'id':_0x4aa7f6[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x42a05b,null))[_0x8cbb('0x23')](function(_0x1fdf42){if(_0x1fdf42){return _0x1fdf42[_0x8cbb('0x81')](_0x4aa7f6[_0x8cbb('0x34')]['ids']);}})[_0x8cbb('0x23')](function(_0x4392c6){if(_0x4392c6){return db[_0x8cbb('0x58')]['destroy']({'where':{'ListId':_0x4aa7f6[_0x8cbb('0x34')][_0x8cbb('0x65')],'CampaignId':_0x4aa7f6[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](function(){return _0x4392c6;});}})['then'](respondWithStatusCode(_0x42a05b,null))['catch'](handleError(_0x42a05b,null));};exports[_0x8cbb('0x82')]=function(_0x53b087,_0x58df63,_0x5be96d){var _0x3b9130={};var _0x1c1e54={};var _0x130085;var _0x30185e;return db[_0x8cbb('0x2e')]['findOne']({'where':{'id':_0x53b087[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x58df63,null))[_0x8cbb('0x23')](function(_0x457b94){if(_0x457b94){_0x130085=_0x457b94;_0x1c1e54[_0x8cbb('0x31')]=_[_0x8cbb('0x33')](db['CmList'][_0x8cbb('0x2f')]);_0x1c1e54[_0x8cbb('0x34')]=_[_0x8cbb('0x33')](_0x53b087[_0x8cbb('0x34')]);_0x1c1e54[_0x8cbb('0x3a')]=_[_0x8cbb('0x35')](_0x1c1e54[_0x8cbb('0x31')],_0x1c1e54[_0x8cbb('0x34')]);_0x3b9130[_0x8cbb('0x36')]=_[_0x8cbb('0x35')](_0x1c1e54[_0x8cbb('0x31')],qs[_0x8cbb('0x46')](_0x53b087['query'][_0x8cbb('0x46')]));_0x3b9130[_0x8cbb('0x36')]=_0x3b9130[_0x8cbb('0x36')]['length']?_0x3b9130['attributes']:_0x1c1e54[_0x8cbb('0x31')];_0x3b9130['order']=qs[_0x8cbb('0x39')](_0x53b087['query'][_0x8cbb('0x39')]);_0x3b9130['where']=qs['filters'](_[_0x8cbb('0x5a')](_0x53b087[_0x8cbb('0x34')],_0x1c1e54[_0x8cbb('0x3a')]));if(_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x5c')]){_0x3b9130[_0x8cbb('0x3b')]=_[_0x8cbb('0x3c')](_0x3b9130[_0x8cbb('0x3b')],{'$or':_['map'](_0x3b9130[_0x8cbb('0x36')],function(_0x1b7e80){var _0x3233ca={};_0x3233ca[_0x1b7e80]={'$like':'%'+_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x5c')]+'%'};return _0x3233ca;})});}_0x3b9130=_[_0x8cbb('0x3c')]({},_0x3b9130,_0x53b087[_0x8cbb('0x3f')]);return _0x130085['getBlackLists'](_0x3b9130);}})['then'](function(_0x570872){if(_0x570872){_0x30185e=_0x570872['length'];if(!_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x37')]('nolimit')){_0x3b9130[_0x8cbb('0x1d')]=qs['limit'](_0x53b087[_0x8cbb('0x34')][_0x8cbb('0x1d')]);_0x3b9130['offset']=qs[_0x8cbb('0x1f')](_0x53b087['query']['offset']);}return _0x130085[_0x8cbb('0x82')](_0x3b9130);}})['then'](function(_0x24334f){if(_0x24334f){return _0x24334f?{'count':_0x30185e,'rows':_0x24334f}:null;}})[_0x8cbb('0x23')](respondWithResult(_0x58df63,null))[_0x8cbb('0x43')](handleError(_0x58df63,null));};exports[_0x8cbb('0x83')]=function(_0x85a562,_0x3160d0,_0x56a357){var _0x31b9c9,_0x267fd9;return db[_0x8cbb('0x2e')][_0x8cbb('0x47')]({'where':{'id':_0x85a562[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x3160d0,null))[_0x8cbb('0x23')](function(_0x582ffc){if(_0x582ffc){_0x267fd9=_0x582ffc;return _0x582ffc[_0x8cbb('0x83')](_0x85a562[_0x8cbb('0x49')][_0x8cbb('0x65')],_[_0x8cbb('0x53')](_0x85a562[_0x8cbb('0x49')],[_0x8cbb('0x65'),'id'])||{});}return null;})[_0x8cbb('0x66')](function(_0x558c53){var _0x79986e;_0x31b9c9=_0x558c53||[];var _0x2b3a17=[];if(_0x558c53){for(var _0x161797=0x0;_0x161797<_0x558c53['length'];_0x161797+=0x1){var _0x55599e=_0x558c53[_0x161797][_0x8cbb('0x25')]({'plain':!![]});_0x79986e=squel[_0x8cbb('0x7e')]()['into'](_0x8cbb('0x84'))[_0x8cbb('0x6a')]([_0x8cbb('0x6f'),_0x8cbb('0x6c'),_0x8cbb('0x6d'),_0x8cbb('0x5b'),_0x8cbb('0x54'),_0x8cbb('0x55')],squel['select']()[_0x8cbb('0x6e')]('phone','phone')[_0x8cbb('0x6e')]('id','ContactId')[_0x8cbb('0x6e')](_0x55599e[_0x8cbb('0x71')][_0x8cbb('0x72')](),_0x8cbb('0x6d'))[_0x8cbb('0x6e')](_0x85a562[_0x8cbb('0x45')]['id'][_0x8cbb('0x72')](),_0x8cbb('0x5b'))['field'](_0x8cbb('0x70'),'createdAt')[_0x8cbb('0x6e')]('NOW()',_0x8cbb('0x55'))[_0x8cbb('0x79')](_0x8cbb('0x85'))[_0x8cbb('0x3b')](_0x8cbb('0x73'))['where'](_0x8cbb('0x74'),_0x55599e[_0x8cbb('0x71')][_0x8cbb('0x72')]())[_0x8cbb('0x3b')](_0x8cbb('0x75')))[_0x8cbb('0x72')]();_0x2b3a17['push'](db['sequelize'][_0x8cbb('0x34')](_0x79986e));}return BPromise['all'](_0x2b3a17);}})[_0x8cbb('0x23')](function(){return _0x31b9c9;})[_0x8cbb('0x23')](respondWithResult(_0x3160d0,null))[_0x8cbb('0x43')](handleError(_0x3160d0,null));};exports[_0x8cbb('0x86')]=function(_0x59bda0,_0x5dcebf,_0x28fe94){return db[_0x8cbb('0x2e')]['find']({'where':{'id':_0x59bda0[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](handleEntityNotFound(_0x5dcebf,null))[_0x8cbb('0x23')](function(_0xcf56b5){if(_0xcf56b5){return _0xcf56b5['removeBlackLists'](_0x59bda0[_0x8cbb('0x34')][_0x8cbb('0x65')]);}})['then'](function(_0x3ea1f5){if(_0x3ea1f5){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x59bda0['query'][_0x8cbb('0x65')],'CampaignId':_0x59bda0[_0x8cbb('0x45')]['id']}})[_0x8cbb('0x23')](function(){return _0x3ea1f5;});}})[_0x8cbb('0x23')](respondWithStatusCode(_0x5dcebf,null))[_0x8cbb('0x43')](handleError(_0x5dcebf,null));}; \ No newline at end of file +var _0xd851=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','hasOwnProperty','nolimit','CampaignId','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','CampaignId\x20=\x20?','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Campaign','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation'];(function(_0x26a706,_0x25cc80){var _0x1bcd7c=function(_0x4af445){while(--_0x4af445){_0x26a706['push'](_0x26a706['shift']());}};_0x1bcd7c(++_0x25cc80);}(_0xd851,0xb9));var _0x1d85=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0xd851[_0x199bc4];return _0x136ffb;};'use strict';var emlformat=require(_0x1d85('0x0'));var rimraf=require(_0x1d85('0x1'));var zipdir=require(_0x1d85('0x2'));var jsonpatch=require(_0x1d85('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1d85('0x4'));var Mustache=require(_0x1d85('0x5'));var util=require(_0x1d85('0x6'));var path=require(_0x1d85('0x7'));var sox=require('sox');var csv=require(_0x1d85('0x8'));var ejs=require(_0x1d85('0x9'));var fs=require('fs');var fs_extra=require(_0x1d85('0xa'));var _=require(_0x1d85('0xb'));var squel=require(_0x1d85('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1d85('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1d85('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1d85('0xf'));var qs=require(_0x1d85('0x10'));var as=require(_0x1d85('0x11'));var hardwareService=require(_0x1d85('0x12'));var logger=require(_0x1d85('0x13'))('api');var utils=require(_0x1d85('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1d85('0x15'));var db=require(_0x1d85('0x16'))['db'];function respondWithStatusCode(_0x35596b,_0x3a5ae0){_0x3a5ae0=_0x3a5ae0||0xcc;return function(_0x27df25){if(_0x27df25){return _0x35596b['sendStatus'](_0x3a5ae0);}return _0x35596b[_0x1d85('0x17')](_0x3a5ae0)[_0x1d85('0x18')]();};}function respondWithResult(_0x176f13,_0x223eb8){_0x223eb8=_0x223eb8||0xc8;return function(_0x48282e){if(_0x48282e){return _0x176f13[_0x1d85('0x17')](_0x223eb8)['json'](_0x48282e);}};}function respondWithFilteredResult(_0x158bb3,_0xa15ba2){return function(_0x48d76a){if(_0x48d76a){var _0x1813ee=typeof _0xa15ba2[_0x1d85('0x19')]===_0x1d85('0x1a')&&typeof _0xa15ba2[_0x1d85('0x1b')]===_0x1d85('0x1a');var _0x26a6fb=_0x48d76a[_0x1d85('0x1c')];var _0x45d24b=_0x1813ee?0x0:_0xa15ba2[_0x1d85('0x19')];var _0x570730=_0x1813ee?_0x48d76a['count']:_0xa15ba2['offset']+_0xa15ba2[_0x1d85('0x1b')];var _0x41b1af;if(_0x570730>=_0x26a6fb){_0x570730=_0x26a6fb;_0x41b1af=0xc8;}else{_0x41b1af=0xce;}_0x158bb3[_0x1d85('0x17')](_0x41b1af);return _0x158bb3[_0x1d85('0x1d')](_0x1d85('0x1e'),_0x45d24b+'-'+_0x570730+'/'+_0x26a6fb)[_0x1d85('0x1f')](_0x48d76a);}return null;};}function patchUpdates(_0x5150e9){return function(_0x440a94){try{jsonpatch[_0x1d85('0x20')](_0x440a94,_0x5150e9,!![]);}catch(_0x54b82b){return BPromise[_0x1d85('0x21')](_0x54b82b);}return _0x440a94['save']();};}function saveUpdates(_0x21ee0a,_0x4ff5fe){return function(_0x581732){if(_0x581732){return _0x581732[_0x1d85('0x22')](_0x21ee0a)[_0x1d85('0x23')](function(_0x50a983){return _0x50a983;});}return null;};}function removeEntity(_0x5f2afb,_0x2bea5e){return function(_0x20af16){if(_0x20af16){return _0x20af16[_0x1d85('0x24')]()[_0x1d85('0x23')](function(){var _0x1dc6c7=_0x20af16[_0x1d85('0x25')]({'plain':!![]});var _0x4e44b8='IvrCampaigns';return db[_0x1d85('0x26')][_0x1d85('0x24')]({'where':{'type':_0x4e44b8,'resourceId':_0x1dc6c7['id']}})[_0x1d85('0x23')](function(){return _0x20af16;});})[_0x1d85('0x23')](function(){_0x5f2afb[_0x1d85('0x17')](0xcc)[_0x1d85('0x18')]();});}};}function handleEntityNotFound(_0x2a778a,_0x2ecd53){return function(_0x2ea5c7){if(!_0x2ea5c7){_0x2a778a[_0x1d85('0x27')](0x194);}return _0x2ea5c7;};}function handleError(_0x3eec1c,_0x5d2944){_0x5d2944=_0x5d2944||0x1f4;return function(_0x370875){logger[_0x1d85('0x28')](_0x370875[_0x1d85('0x29')]);if(_0x370875[_0x1d85('0x2a')]){delete _0x370875[_0x1d85('0x2a')];}_0x3eec1c[_0x1d85('0x17')](_0x5d2944)[_0x1d85('0x2b')](_0x370875);};}exports[_0x1d85('0x2c')]=function(_0xfa414d,_0x3b8a83){var _0x36f7e7={},_0x306b4d={},_0x4e80ba={'count':0x0,'rows':[]};var _0x5205c7=_[_0x1d85('0x2d')](db[_0x1d85('0x2e')]['rawAttributes'],function(_0x527228){return{'name':_0x527228['fieldName'],'type':_0x527228[_0x1d85('0x2f')][_0x1d85('0x30')]};});_0x306b4d[_0x1d85('0x31')]=_[_0x1d85('0x2d')](_0x5205c7,_0x1d85('0x2a'));_0x306b4d['query']=_['keys'](_0xfa414d[_0x1d85('0x32')]);_0x306b4d[_0x1d85('0x33')]=_[_0x1d85('0x34')](_0x306b4d[_0x1d85('0x31')],_0x306b4d[_0x1d85('0x32')]);_0x36f7e7[_0x1d85('0x35')]=_[_0x1d85('0x34')](_0x306b4d[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0xfa414d[_0x1d85('0x32')][_0x1d85('0x36')]));_0x36f7e7['attributes']=_0x36f7e7[_0x1d85('0x35')][_0x1d85('0x37')]?_0x36f7e7['attributes']:_0x306b4d[_0x1d85('0x31')];if(!_0xfa414d[_0x1d85('0x32')]['hasOwnProperty']('nolimit')){_0x36f7e7[_0x1d85('0x1b')]=qs[_0x1d85('0x1b')](_0xfa414d['query']['limit']);_0x36f7e7['offset']=qs[_0x1d85('0x19')](_0xfa414d[_0x1d85('0x32')][_0x1d85('0x19')]);}_0x36f7e7[_0x1d85('0x38')]=qs[_0x1d85('0x39')](_0xfa414d['query']['sort']);_0x36f7e7[_0x1d85('0x3a')]=qs[_0x1d85('0x33')](_[_0x1d85('0x3b')](_0xfa414d[_0x1d85('0x32')],_0x306b4d[_0x1d85('0x33')]),_0x5205c7);if(_0xfa414d[_0x1d85('0x32')][_0x1d85('0x3c')]){_0x36f7e7[_0x1d85('0x3a')]=_['merge'](_0x36f7e7[_0x1d85('0x3a')],{'$or':_[_0x1d85('0x2d')](_0x5205c7,function(_0x449c5a){if(_0x449c5a[_0x1d85('0x2f')]!==_0x1d85('0x3d')){var _0xc27c96={};_0xc27c96[_0x449c5a['name']]={'$like':'%'+_0xfa414d['query']['filter']+'%'};return _0xc27c96;}})});}_0x36f7e7=_[_0x1d85('0x3e')]({},_0x36f7e7,_0xfa414d[_0x1d85('0x3f')]);var _0x112132={'where':_0x36f7e7[_0x1d85('0x3a')]};return db['Campaign']['count'](_0x112132)[_0x1d85('0x23')](function(_0x47aaa8){_0x4e80ba[_0x1d85('0x1c')]=_0x47aaa8;if(_0xfa414d[_0x1d85('0x32')][_0x1d85('0x40')]){_0x36f7e7['include']=[{'all':!![]}];}return db[_0x1d85('0x2e')][_0x1d85('0x41')](_0x36f7e7);})[_0x1d85('0x23')](function(_0x3d26a4){_0x4e80ba[_0x1d85('0x42')]=_0x3d26a4;return _0x4e80ba;})[_0x1d85('0x23')](respondWithFilteredResult(_0x3b8a83,_0x36f7e7))[_0x1d85('0x43')](handleError(_0x3b8a83,null));};exports[_0x1d85('0x44')]=function(_0x492122,_0x8841b2){var _0x2bb6b8={'raw':![],'where':{'id':_0x492122[_0x1d85('0x45')]['id']}},_0x5a09a7={};_0x5a09a7[_0x1d85('0x31')]=_[_0x1d85('0x46')](db[_0x1d85('0x2e')][_0x1d85('0x47')]);_0x5a09a7['query']=_['keys'](_0x492122[_0x1d85('0x32')]);_0x5a09a7['filters']=_[_0x1d85('0x34')](_0x5a09a7[_0x1d85('0x31')],_0x5a09a7[_0x1d85('0x32')]);_0x2bb6b8[_0x1d85('0x35')]=_[_0x1d85('0x34')](_0x5a09a7[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0x492122['query'][_0x1d85('0x36')]));_0x2bb6b8[_0x1d85('0x35')]=_0x2bb6b8[_0x1d85('0x35')][_0x1d85('0x37')]?_0x2bb6b8[_0x1d85('0x35')]:_0x5a09a7[_0x1d85('0x31')];if(_0x492122[_0x1d85('0x32')][_0x1d85('0x40')]){_0x2bb6b8[_0x1d85('0x48')]=[{'all':!![]}];}_0x2bb6b8=_[_0x1d85('0x3e')]({},_0x2bb6b8,_0x492122['options']);return db[_0x1d85('0x2e')][_0x1d85('0x49')](_0x2bb6b8)[_0x1d85('0x23')](handleEntityNotFound(_0x8841b2,null))['then'](respondWithResult(_0x8841b2,null))[_0x1d85('0x43')](handleError(_0x8841b2,null));};exports[_0x1d85('0x4a')]=function(_0x16605b,_0x4e977f){return db[_0x1d85('0x2e')]['create'](_0x16605b[_0x1d85('0x4b')],{})[_0x1d85('0x23')](function(_0x2374df){var _0x4af694=_0x16605b['user'][_0x1d85('0x25')]({'plain':!![]});if(!_0x4af694)throw new Error(_0x1d85('0x4c'));if(_0x4af694[_0x1d85('0x4d')]===_0x1d85('0x4e')){var _0x571953=_0x2374df[_0x1d85('0x25')]({'plain':!![]});var _0x2c0898=_0x1d85('0x4f');return db[_0x1d85('0x50')][_0x1d85('0x49')]({'where':{'name':_0x2c0898,'userProfileId':_0x4af694[_0x1d85('0x51')]},'raw':!![]})['then'](function(_0xba87e3){if(_0xba87e3&&_0xba87e3[_0x1d85('0x52')]===0x0){return db[_0x1d85('0x26')][_0x1d85('0x4a')]({'name':_0x571953[_0x1d85('0x2a')],'resourceId':_0x571953['id'],'type':_0xba87e3[_0x1d85('0x2a')],'sectionId':_0xba87e3['id']},{})[_0x1d85('0x23')](function(){return _0x2374df;});}else{return _0x2374df;}})[_0x1d85('0x43')](function(_0x55785d){logger[_0x1d85('0x28')](_0x1d85('0x53'),_0x55785d);throw _0x55785d;});}return _0x2374df;})[_0x1d85('0x23')](respondWithResult(_0x4e977f,0xc9))['catch'](handleError(_0x4e977f,null));};exports[_0x1d85('0x54')]=function(_0x3a0e8f,_0x2a6a9a){var _0x5bf736={'where':{'id':_0x3a0e8f['params']['id']}},_0x562f09={};_0x562f09[_0x1d85('0x31')]=_[_0x1d85('0x46')](db[_0x1d85('0x2e')][_0x1d85('0x47')]);_0x5bf736['attributes']=_[_0x1d85('0x34')](_0x562f09[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0x3a0e8f['query'][_0x1d85('0x36')]));_0x5bf736[_0x1d85('0x35')]=_0x5bf736[_0x1d85('0x35')][_0x1d85('0x37')]?_0x5bf736['attributes']:_0x562f09[_0x1d85('0x31')];if(_0x3a0e8f[_0x1d85('0x32')][_0x1d85('0x40')]){_0x5bf736['include']=[{'all':!![]}];}_0x5bf736=_[_0x1d85('0x3e')]({},_0x5bf736,_0x3a0e8f['options']);return db[_0x1d85('0x2e')][_0x1d85('0x49')](_0x5bf736)['then'](handleEntityNotFound(_0x2a6a9a,null))['then'](function(_0x3291dc){if(_0x3291dc){var _0x117e65=_0x3291dc[_0x1d85('0x25')]({'plain':!![]});_0x117e65=qs[_0x1d85('0x55')](_0x117e65,['id',_0x1d85('0x56'),_0x1d85('0x57')]);_0x3a0e8f['body']=_['omit'](_0x3a0e8f[_0x1d85('0x4b')],['id',_0x1d85('0x56'),_0x1d85('0x57')]);return db['Campaign'][_0x1d85('0x4a')](_[_0x1d85('0x3e')](_0x117e65,_0x3a0e8f[_0x1d85('0x4b')]),{'include':_0x3a0e8f[_0x1d85('0x32')][_0x1d85('0x40')]?[{'all':!![]}]:undefined})[_0x1d85('0x23')](function(_0x3eeaab){var _0x29f2a8=_0x3a0e8f[_0x1d85('0x4e')][_0x1d85('0x25')]({'plain':!![]});if(!_0x29f2a8)throw new Error(_0x1d85('0x4c'));if(_0x29f2a8[_0x1d85('0x4d')]===_0x1d85('0x4e')){var _0x3eee87=_0x3eeaab[_0x1d85('0x25')]({'plain':!![]});var _0x40a166='IvrCampaigns';return db[_0x1d85('0x50')][_0x1d85('0x49')]({'where':{'name':_0x40a166,'userProfileId':_0x29f2a8[_0x1d85('0x51')]},'raw':!![]})['then'](function(_0x3a72e1){if(_0x3a72e1&&_0x3a72e1[_0x1d85('0x52')]===0x0){return db[_0x1d85('0x26')][_0x1d85('0x4a')]({'name':_0x3eee87[_0x1d85('0x2a')],'resourceId':_0x3eee87['id'],'type':_0x3a72e1[_0x1d85('0x2a')],'sectionId':_0x3a72e1['id']},{})['then'](function(){return _0x3eeaab;});}else{return _0x3eeaab;}})[_0x1d85('0x43')](function(_0xe7d534){logger[_0x1d85('0x28')](_0x1d85('0x53'),_0xe7d534);throw _0xe7d534;});}return _0x3eeaab;});}})[_0x1d85('0x23')](respondWithResult(_0x2a6a9a,0xc9))[_0x1d85('0x43')](handleError(_0x2a6a9a,null));};exports[_0x1d85('0x22')]=function(_0x3941b9,_0x12fb39){if(_0x3941b9[_0x1d85('0x4b')]['id']){delete _0x3941b9[_0x1d85('0x4b')]['id'];}return db[_0x1d85('0x2e')][_0x1d85('0x49')]({'where':{'id':_0x3941b9[_0x1d85('0x45')]['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0x12fb39,null))[_0x1d85('0x23')](saveUpdates(_0x3941b9[_0x1d85('0x4b')],null))[_0x1d85('0x23')](respondWithResult(_0x12fb39,null))[_0x1d85('0x43')](handleError(_0x12fb39,null));};exports['destroy']=function(_0x282218,_0x50e610){return db['Campaign'][_0x1d85('0x49')]({'where':{'id':_0x282218[_0x1d85('0x45')]['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0x50e610,null))[_0x1d85('0x23')](removeEntity(_0x50e610,null))[_0x1d85('0x43')](handleError(_0x50e610,null));};exports[_0x1d85('0x58')]=function(_0x1c3130,_0x4a39b1,_0x7f18d1){var _0x495196={'raw':!![],'where':{}};var _0x415d73={};var _0x268684={'count':0x0,'rows':[]};return db[_0x1d85('0x2e')]['findOne']({'where':{'id':_0x1c3130['params']['id']}})['then'](handleEntityNotFound(_0x4a39b1,null))['then'](function(_0x5b3b0a){if(_0x5b3b0a){_0x415d73[_0x1d85('0x31')]=_[_0x1d85('0x46')](db[_0x1d85('0x59')][_0x1d85('0x47')]);_0x415d73[_0x1d85('0x32')]=_[_0x1d85('0x46')](_0x1c3130['query']);_0x415d73[_0x1d85('0x33')]=_[_0x1d85('0x34')](_0x415d73[_0x1d85('0x31')],_0x415d73['query']);_0x495196[_0x1d85('0x35')]=_[_0x1d85('0x34')](_0x415d73[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0x1c3130[_0x1d85('0x32')][_0x1d85('0x36')]));_0x495196[_0x1d85('0x35')]=_0x495196[_0x1d85('0x35')][_0x1d85('0x37')]?_0x495196[_0x1d85('0x35')]:_0x415d73['model'];if(!_0x1c3130['query'][_0x1d85('0x5a')](_0x1d85('0x5b'))){_0x495196[_0x1d85('0x1b')]=qs[_0x1d85('0x1b')](_0x1c3130[_0x1d85('0x32')]['limit']);_0x495196[_0x1d85('0x19')]=qs[_0x1d85('0x19')](_0x1c3130[_0x1d85('0x32')]['offset']);}_0x495196['order']=qs[_0x1d85('0x39')](_0x1c3130[_0x1d85('0x32')][_0x1d85('0x39')]);_0x495196[_0x1d85('0x3a')]=qs['filters'](_['pick'](_0x1c3130['query'],_0x415d73[_0x1d85('0x33')]));_0x495196[_0x1d85('0x3a')][_0x1d85('0x5c')]=_0x5b3b0a['id'];if(_0x1c3130[_0x1d85('0x32')]['filter']){_0x495196[_0x1d85('0x3a')]=_[_0x1d85('0x3e')](_0x495196['where'],{'$or':_[_0x1d85('0x2d')](_0x495196[_0x1d85('0x35')],function(_0x13ae06){var _0xf02a7f={};_0xf02a7f[_0x13ae06]={'$like':'%'+_0x1c3130[_0x1d85('0x32')][_0x1d85('0x3c')]+'%'};return _0xf02a7f;})});}_0x495196=_[_0x1d85('0x3e')]({},_0x495196,_0x1c3130[_0x1d85('0x3f')]);return db[_0x1d85('0x59')]['count']({'where':_0x495196['where']})[_0x1d85('0x23')](function(_0x46f924){_0x268684[_0x1d85('0x1c')]=_0x46f924;if(_0x1c3130['query'][_0x1d85('0x40')]){_0x495196[_0x1d85('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0x1d85('0x41')](_0x495196);})[_0x1d85('0x23')](function(_0x22f0ed){_0x268684[_0x1d85('0x42')]=_0x22f0ed;return _0x268684;});}})[_0x1d85('0x23')](respondWithFilteredResult(_0x4a39b1,_0x495196))['catch'](handleError(_0x4a39b1,null));};exports['getHopperHistories']=function(_0x42a93b,_0x48ed5c,_0x1f8245){var _0x9434ab={'raw':!![],'where':{}};var _0x248dd0={};var _0x218d30={'count':0x0,'rows':[]};return db[_0x1d85('0x2e')][_0x1d85('0x5d')]({'where':{'id':_0x42a93b[_0x1d85('0x45')]['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0x48ed5c,null))[_0x1d85('0x23')](function(_0x2156ca){if(_0x2156ca){_0x248dd0[_0x1d85('0x31')]=_[_0x1d85('0x46')](db[_0x1d85('0x5e')][_0x1d85('0x47')]);_0x248dd0[_0x1d85('0x32')]=_[_0x1d85('0x46')](_0x42a93b[_0x1d85('0x32')]);_0x248dd0['filters']=_[_0x1d85('0x34')](_0x248dd0[_0x1d85('0x31')],_0x248dd0['query']);_0x9434ab['attributes']=_[_0x1d85('0x34')](_0x248dd0[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0x42a93b[_0x1d85('0x32')][_0x1d85('0x36')]));_0x9434ab[_0x1d85('0x35')]=_0x9434ab[_0x1d85('0x35')][_0x1d85('0x37')]?_0x9434ab['attributes']:_0x248dd0[_0x1d85('0x31')];if(!_0x42a93b[_0x1d85('0x32')][_0x1d85('0x5a')](_0x1d85('0x5b'))){_0x9434ab[_0x1d85('0x1b')]=qs[_0x1d85('0x1b')](_0x42a93b[_0x1d85('0x32')]['limit']);_0x9434ab[_0x1d85('0x19')]=qs[_0x1d85('0x19')](_0x42a93b[_0x1d85('0x32')][_0x1d85('0x19')]);}_0x9434ab[_0x1d85('0x38')]=qs[_0x1d85('0x39')](_0x42a93b['query']['sort']);_0x9434ab[_0x1d85('0x3a')]=qs['filters'](_[_0x1d85('0x3b')](_0x42a93b['query'],_0x248dd0['filters']));_0x9434ab[_0x1d85('0x3a')]['CampaignId']=_0x2156ca['id'];if(_0x42a93b[_0x1d85('0x32')][_0x1d85('0x3c')]){_0x9434ab['where']=_[_0x1d85('0x3e')](_0x9434ab['where'],{'$or':_['map'](_0x9434ab[_0x1d85('0x35')],function(_0x462437){var _0x267be={};_0x267be[_0x462437]={'$like':'%'+_0x42a93b['query'][_0x1d85('0x3c')]+'%'};return _0x267be;})});}_0x9434ab=_['merge']({},_0x9434ab,_0x42a93b['options']);return db['CmHopperHistory'][_0x1d85('0x1c')]({'where':_0x9434ab[_0x1d85('0x3a')]})[_0x1d85('0x23')](function(_0x1a6d17){_0x218d30[_0x1d85('0x1c')]=_0x1a6d17;if(_0x42a93b[_0x1d85('0x32')]['includeAll']){_0x9434ab['include']=[{'all':!![]}];}return db[_0x1d85('0x5e')]['findAll'](_0x9434ab);})[_0x1d85('0x23')](function(_0x21b8e4){_0x218d30['rows']=_0x21b8e4;return _0x218d30;});}})[_0x1d85('0x23')](respondWithFilteredResult(_0x48ed5c,_0x9434ab))[_0x1d85('0x43')](handleError(_0x48ed5c,null));};exports[_0x1d85('0x5f')]=function(_0x3f2ab2,_0xae2637,_0x680dd7){var _0x31a75c={'raw':!![],'where':{}};var _0x3f9771={};var _0x379eb4={'count':0x0,'rows':[]};return db['Campaign'][_0x1d85('0x5d')]({'where':{'id':_0x3f2ab2['params']['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0xae2637,null))['then'](function(_0xdb505c){if(_0xdb505c){_0x3f9771['model']=_[_0x1d85('0x46')](db[_0x1d85('0x60')][_0x1d85('0x47')]);_0x3f9771['query']=_[_0x1d85('0x46')](_0x3f2ab2['query']);_0x3f9771[_0x1d85('0x33')]=_['intersection'](_0x3f9771[_0x1d85('0x31')],_0x3f9771[_0x1d85('0x32')]);_0x31a75c[_0x1d85('0x35')]=_[_0x1d85('0x34')](_0x3f9771[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0x3f2ab2['query'][_0x1d85('0x36')]));_0x31a75c['attributes']=_0x31a75c[_0x1d85('0x35')][_0x1d85('0x37')]?_0x31a75c[_0x1d85('0x35')]:_0x3f9771[_0x1d85('0x31')];if(!_0x3f2ab2[_0x1d85('0x32')][_0x1d85('0x5a')](_0x1d85('0x5b'))){_0x31a75c[_0x1d85('0x1b')]=qs[_0x1d85('0x1b')](_0x3f2ab2[_0x1d85('0x32')][_0x1d85('0x1b')]);_0x31a75c[_0x1d85('0x19')]=qs['offset'](_0x3f2ab2[_0x1d85('0x32')][_0x1d85('0x19')]);}_0x31a75c[_0x1d85('0x38')]=qs[_0x1d85('0x39')](_0x3f2ab2['query'][_0x1d85('0x39')]);_0x31a75c['where']=qs['filters'](_[_0x1d85('0x3b')](_0x3f2ab2[_0x1d85('0x32')],_0x3f9771[_0x1d85('0x33')]));_0x31a75c[_0x1d85('0x3a')][_0x1d85('0x5c')]=_0xdb505c['id'];if(_0x3f2ab2['query'][_0x1d85('0x3c')]){_0x31a75c[_0x1d85('0x3a')]=_[_0x1d85('0x3e')](_0x31a75c[_0x1d85('0x3a')],{'$or':_[_0x1d85('0x2d')](_0x31a75c[_0x1d85('0x35')],function(_0x48b38b){var _0x4b94c7={};_0x4b94c7[_0x48b38b]={'$like':'%'+_0x3f2ab2[_0x1d85('0x32')][_0x1d85('0x3c')]+'%'};return _0x4b94c7;})});}_0x31a75c=_[_0x1d85('0x3e')]({},_0x31a75c,_0x3f2ab2[_0x1d85('0x3f')]);return db[_0x1d85('0x60')][_0x1d85('0x1c')]({'where':_0x31a75c[_0x1d85('0x3a')]})[_0x1d85('0x23')](function(_0x475379){_0x379eb4[_0x1d85('0x1c')]=_0x475379;if(_0x3f2ab2['query'][_0x1d85('0x40')]){_0x31a75c[_0x1d85('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x1d85('0x41')](_0x31a75c);})['then'](function(_0x4bcdac){_0x379eb4[_0x1d85('0x42')]=_0x4bcdac;return _0x379eb4;});}})[_0x1d85('0x23')](respondWithFilteredResult(_0xae2637,_0x31a75c))[_0x1d85('0x43')](handleError(_0xae2637,null));};exports['getHopperBlacks']=function(_0xea65e4,_0x912c54,_0x493b5a){var _0x3eb9b3={'raw':!![],'where':{}};var _0x33eca4={};var _0x24d3e5={'count':0x0,'rows':[]};return db['Campaign'][_0x1d85('0x5d')]({'where':{'id':_0xea65e4[_0x1d85('0x45')]['id']}})['then'](handleEntityNotFound(_0x912c54,null))[_0x1d85('0x23')](function(_0x5dd7b7){if(_0x5dd7b7){_0x33eca4[_0x1d85('0x31')]=_['keys'](db['CmHopperBlack'][_0x1d85('0x47')]);_0x33eca4[_0x1d85('0x32')]=_[_0x1d85('0x46')](_0xea65e4[_0x1d85('0x32')]);_0x33eca4[_0x1d85('0x33')]=_['intersection'](_0x33eca4['model'],_0x33eca4[_0x1d85('0x32')]);_0x3eb9b3['attributes']=_[_0x1d85('0x34')](_0x33eca4[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0xea65e4[_0x1d85('0x32')]['fields']));_0x3eb9b3['attributes']=_0x3eb9b3[_0x1d85('0x35')][_0x1d85('0x37')]?_0x3eb9b3[_0x1d85('0x35')]:_0x33eca4[_0x1d85('0x31')];if(!_0xea65e4[_0x1d85('0x32')][_0x1d85('0x5a')](_0x1d85('0x5b'))){_0x3eb9b3[_0x1d85('0x1b')]=qs[_0x1d85('0x1b')](_0xea65e4[_0x1d85('0x32')]['limit']);_0x3eb9b3[_0x1d85('0x19')]=qs['offset'](_0xea65e4[_0x1d85('0x32')][_0x1d85('0x19')]);}_0x3eb9b3['order']=qs['sort'](_0xea65e4['query'][_0x1d85('0x39')]);_0x3eb9b3['where']=qs[_0x1d85('0x33')](_[_0x1d85('0x3b')](_0xea65e4[_0x1d85('0x32')],_0x33eca4[_0x1d85('0x33')]));_0x3eb9b3[_0x1d85('0x3a')][_0x1d85('0x5c')]=_0x5dd7b7['id'];if(_0xea65e4[_0x1d85('0x32')][_0x1d85('0x3c')]){_0x3eb9b3['where']=_['merge'](_0x3eb9b3[_0x1d85('0x3a')],{'$or':_[_0x1d85('0x2d')](_0x3eb9b3[_0x1d85('0x35')],function(_0x592552){var _0x3c44bd={};_0x3c44bd[_0x592552]={'$like':'%'+_0xea65e4[_0x1d85('0x32')][_0x1d85('0x3c')]+'%'};return _0x3c44bd;})});}_0x3eb9b3=_[_0x1d85('0x3e')]({},_0x3eb9b3,_0xea65e4[_0x1d85('0x3f')]);return db['CmHopperBlack'][_0x1d85('0x1c')]({'where':_0x3eb9b3['where']})[_0x1d85('0x23')](function(_0x479d23){_0x24d3e5[_0x1d85('0x1c')]=_0x479d23;if(_0xea65e4[_0x1d85('0x32')]['includeAll']){_0x3eb9b3[_0x1d85('0x48')]=[{'all':!![]}];}return db[_0x1d85('0x61')]['findAll'](_0x3eb9b3);})[_0x1d85('0x23')](function(_0xe57733){_0x24d3e5['rows']=_0xe57733;return _0x24d3e5;});}})[_0x1d85('0x23')](respondWithFilteredResult(_0x912c54,_0x3eb9b3))[_0x1d85('0x43')](handleError(_0x912c54,null));};exports[_0x1d85('0x62')]=function(_0x443a8c,_0x33e5f2,_0x119030){var _0x5a7ee4={};var _0x2025cd={};var _0x174898;var _0x1a09f9;return db[_0x1d85('0x2e')][_0x1d85('0x5d')]({'where':{'id':_0x443a8c[_0x1d85('0x45')]['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0x33e5f2,null))[_0x1d85('0x23')](function(_0x3c7ca6){if(_0x3c7ca6){_0x174898=_0x3c7ca6;_0x2025cd[_0x1d85('0x31')]=_['keys'](db['CmList'][_0x1d85('0x47')]);_0x2025cd[_0x1d85('0x32')]=_[_0x1d85('0x46')](_0x443a8c[_0x1d85('0x32')]);_0x2025cd[_0x1d85('0x33')]=_['intersection'](_0x2025cd[_0x1d85('0x31')],_0x2025cd['query']);_0x5a7ee4['attributes']=_[_0x1d85('0x34')](_0x2025cd[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0x443a8c[_0x1d85('0x32')]['fields']));_0x5a7ee4[_0x1d85('0x35')]=_0x5a7ee4['attributes'][_0x1d85('0x37')]?_0x5a7ee4['attributes']:_0x2025cd['model'];_0x5a7ee4[_0x1d85('0x38')]=qs[_0x1d85('0x39')](_0x443a8c[_0x1d85('0x32')][_0x1d85('0x39')]);_0x5a7ee4[_0x1d85('0x3a')]=qs[_0x1d85('0x33')](_[_0x1d85('0x3b')](_0x443a8c[_0x1d85('0x32')],_0x2025cd[_0x1d85('0x33')]));if(_0x443a8c[_0x1d85('0x32')]['filter']){_0x5a7ee4[_0x1d85('0x3a')]=_[_0x1d85('0x3e')](_0x5a7ee4[_0x1d85('0x3a')],{'$or':_[_0x1d85('0x2d')](_0x5a7ee4['attributes'],function(_0x495e4f){var _0x5ba7d2={};_0x5ba7d2[_0x495e4f]={'$like':'%'+_0x443a8c[_0x1d85('0x32')][_0x1d85('0x3c')]+'%'};return _0x5ba7d2;})});}_0x5a7ee4=_[_0x1d85('0x3e')]({},_0x5a7ee4,_0x443a8c['options']);return _0x174898['getLists'](_0x5a7ee4);}})['then'](function(_0x50d7f6){if(_0x50d7f6){_0x1a09f9=_0x50d7f6['length'];if(!_0x443a8c[_0x1d85('0x32')][_0x1d85('0x5a')](_0x1d85('0x5b'))){_0x5a7ee4[_0x1d85('0x1b')]=qs['limit'](_0x443a8c[_0x1d85('0x32')][_0x1d85('0x1b')]);_0x5a7ee4['offset']=qs['offset'](_0x443a8c[_0x1d85('0x32')]['offset']);}return _0x174898[_0x1d85('0x62')](_0x5a7ee4);}})['then'](function(_0x27a806){if(_0x27a806){return _0x27a806?{'count':_0x1a09f9,'rows':_0x27a806}:null;}})['then'](respondWithResult(_0x33e5f2,null))[_0x1d85('0x43')](handleError(_0x33e5f2,null));};exports[_0x1d85('0x63')]=function(_0x530e3c,_0x2fdbb3,_0x2eee62){var _0x13f38c,_0x597822;return db[_0x1d85('0x2e')][_0x1d85('0x49')]({'where':{'id':_0x530e3c['params']['id']}})['then'](handleEntityNotFound(_0x2fdbb3,null))['then'](function(_0x322105){if(_0x322105){_0x597822=_0x322105;return _0x322105['addLists'](_0x530e3c[_0x1d85('0x4b')][_0x1d85('0x64')],_[_0x1d85('0x55')](_0x530e3c[_0x1d85('0x4b')],[_0x1d85('0x64'),'id'])||{});}return null;})[_0x1d85('0x65')](function(_0x499a73){var _0x2a0722;_0x13f38c=_0x499a73||[];var _0x374c32=[];if(_0x499a73){for(var _0x147077=0x0;_0x147077<_0x499a73[_0x1d85('0x37')];_0x147077+=0x1){var _0x1c8888=_0x499a73[_0x147077][_0x1d85('0x25')]({'plain':!![]});_0x597822[_0x1d85('0x66')]=_0x530e3c[_0x1d85('0x4b')]['dialCheckDuplicateType']?_0x530e3c[_0x1d85('0x4b')]['dialCheckDuplicateType']:_0x597822[_0x1d85('0x66')];switch(_0x597822[_0x1d85('0x66')]){case'always':_0x2a0722=squel[_0x1d85('0x67')]()['into'](_0x1d85('0x68'))[_0x1d85('0x69')](['phone',_0x1d85('0x6a'),_0x1d85('0x6b'),_0x1d85('0x6c'),'CampaignId',_0x1d85('0x56'),'updatedAt'],squel[_0x1d85('0x6d')]()['field'](_0x1d85('0x6e'),_0x1d85('0x6e'))[_0x1d85('0x6f')]('NOW()',_0x1d85('0x6a'))[_0x1d85('0x6f')]('id',_0x1d85('0x6b'))['field'](_0x1c8888[_0x1d85('0x70')]['toString'](),_0x1d85('0x6c'))[_0x1d85('0x6f')](_0x530e3c['params']['id'][_0x1d85('0x71')](),_0x1d85('0x5c'))[_0x1d85('0x6f')](_0x1d85('0x72'),'createdAt')[_0x1d85('0x6f')](_0x1d85('0x72'),_0x1d85('0x57'))[_0x1d85('0x73')](_0x1d85('0x74'))[_0x1d85('0x3a')](_0x1d85('0x75'))[_0x1d85('0x3a')]('ListId\x20=\x20?',_0x1c8888['CmListId']['toString']())['where'](_0x1d85('0x76'))[_0x1d85('0x3a')](_0x1d85('0x77'),squel['select']()[_0x1d85('0x6f')](_0x1d85('0x78'))[_0x1d85('0x73')](_0x1d85('0x79'))['where']('CampaignId\x20=\x20?',_0x530e3c[_0x1d85('0x45')]['id']['toString']()))[_0x1d85('0x3a')](_0x1d85('0x77'),squel['select']()['field'](_0x1d85('0x7a'))[_0x1d85('0x73')](_0x1d85('0x68'))[_0x1d85('0x3a')]('CampaignId\x20=\x20?',_0x530e3c['params']['id'][_0x1d85('0x71')]())))[_0x1d85('0x71')]();break;case _0x1d85('0x7b'):_0x2a0722=squel[_0x1d85('0x67')]()[_0x1d85('0x7c')](_0x1d85('0x68'))[_0x1d85('0x69')]([_0x1d85('0x6e'),'scheduledAt',_0x1d85('0x6b'),_0x1d85('0x6c'),_0x1d85('0x5c'),_0x1d85('0x56'),_0x1d85('0x57')],squel[_0x1d85('0x6d')]()[_0x1d85('0x6f')](_0x1d85('0x6e'),_0x1d85('0x6e'))[_0x1d85('0x6f')](_0x1d85('0x72'),'scheduledAt')['field']('id',_0x1d85('0x6b'))['field'](_0x1c8888[_0x1d85('0x70')]['toString'](),_0x1d85('0x6c'))[_0x1d85('0x6f')](_0x530e3c[_0x1d85('0x45')]['id'][_0x1d85('0x71')](),_0x1d85('0x5c'))[_0x1d85('0x6f')](_0x1d85('0x72'),_0x1d85('0x56'))[_0x1d85('0x6f')](_0x1d85('0x72'),'updatedAt')[_0x1d85('0x73')](_0x1d85('0x74'))[_0x1d85('0x3a')]('deletedAt\x20IS\x20NULL')[_0x1d85('0x3a')]('ListId\x20=\x20?',_0x1c8888['CmListId'][_0x1d85('0x71')]())[_0x1d85('0x3a')](_0x1d85('0x76'))[_0x1d85('0x3a')](_0x1d85('0x77'),squel[_0x1d85('0x6d')]()[_0x1d85('0x6f')](_0x1d85('0x7a'))[_0x1d85('0x73')](_0x1d85('0x68'))[_0x1d85('0x3a')](_0x1d85('0x7d'),_0x530e3c[_0x1d85('0x45')]['id']['toString']())))[_0x1d85('0x71')]();break;default:_0x2a0722=squel[_0x1d85('0x67')]()['into'](_0x1d85('0x68'))[_0x1d85('0x69')](['phone',_0x1d85('0x6a'),'ContactId',_0x1d85('0x6c'),_0x1d85('0x5c'),_0x1d85('0x56'),'updatedAt'],squel[_0x1d85('0x6d')]()[_0x1d85('0x6f')](_0x1d85('0x6e'),_0x1d85('0x6e'))[_0x1d85('0x6f')](_0x1d85('0x72'),_0x1d85('0x6a'))[_0x1d85('0x6f')]('id','ContactId')[_0x1d85('0x6f')](_0x1c8888[_0x1d85('0x70')]['toString'](),_0x1d85('0x6c'))[_0x1d85('0x6f')](_0x530e3c[_0x1d85('0x45')]['id'][_0x1d85('0x71')](),_0x1d85('0x5c'))[_0x1d85('0x6f')](_0x1d85('0x72'),_0x1d85('0x56'))['field'](_0x1d85('0x72'),_0x1d85('0x57'))[_0x1d85('0x73')](_0x1d85('0x74'))['where'](_0x1d85('0x75'))[_0x1d85('0x3a')](_0x1d85('0x7e'),_0x1c8888[_0x1d85('0x70')]['toString']())[_0x1d85('0x3a')](_0x1d85('0x76')))[_0x1d85('0x71')]();}_0x374c32[_0x1d85('0x7f')](db[_0x1d85('0x80')][_0x1d85('0x32')](_0x2a0722));}return BPromise[_0x1d85('0x81')](_0x374c32);}})[_0x1d85('0x23')](function(){return _0x13f38c;})[_0x1d85('0x23')](respondWithResult(_0x2fdbb3,null))['catch'](handleError(_0x2fdbb3,null));};exports[_0x1d85('0x82')]=function(_0x11595a,_0x7f1a82,_0x4f13bd){return db[_0x1d85('0x2e')][_0x1d85('0x49')]({'where':{'id':_0x11595a['params']['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0x7f1a82,null))[_0x1d85('0x23')](function(_0x2a4fc4){if(_0x2a4fc4){return _0x2a4fc4[_0x1d85('0x82')](_0x11595a[_0x1d85('0x32')][_0x1d85('0x64')]);}})[_0x1d85('0x23')](function(_0x39a078){if(_0x39a078){return db[_0x1d85('0x59')]['destroy']({'where':{'ListId':_0x11595a[_0x1d85('0x32')][_0x1d85('0x64')],'CampaignId':_0x11595a[_0x1d85('0x45')]['id']}})[_0x1d85('0x23')](function(){return _0x39a078;});}})[_0x1d85('0x23')](respondWithStatusCode(_0x7f1a82,null))[_0x1d85('0x43')](handleError(_0x7f1a82,null));};exports[_0x1d85('0x83')]=function(_0xa82ac,_0x5162b7,_0x42c2d8){var _0x461a4d={};var _0x3dfe12={};var _0x490880;var _0x3fd269;return db['Campaign']['findOne']({'where':{'id':_0xa82ac[_0x1d85('0x45')]['id']}})['then'](handleEntityNotFound(_0x5162b7,null))[_0x1d85('0x23')](function(_0x59c202){if(_0x59c202){_0x490880=_0x59c202;_0x3dfe12[_0x1d85('0x31')]=_[_0x1d85('0x46')](db['CmList'][_0x1d85('0x47')]);_0x3dfe12[_0x1d85('0x32')]=_[_0x1d85('0x46')](_0xa82ac[_0x1d85('0x32')]);_0x3dfe12[_0x1d85('0x33')]=_[_0x1d85('0x34')](_0x3dfe12[_0x1d85('0x31')],_0x3dfe12[_0x1d85('0x32')]);_0x461a4d[_0x1d85('0x35')]=_[_0x1d85('0x34')](_0x3dfe12[_0x1d85('0x31')],qs[_0x1d85('0x36')](_0xa82ac['query']['fields']));_0x461a4d[_0x1d85('0x35')]=_0x461a4d[_0x1d85('0x35')][_0x1d85('0x37')]?_0x461a4d[_0x1d85('0x35')]:_0x3dfe12['model'];_0x461a4d[_0x1d85('0x38')]=qs['sort'](_0xa82ac['query']['sort']);_0x461a4d[_0x1d85('0x3a')]=qs['filters'](_['pick'](_0xa82ac['query'],_0x3dfe12[_0x1d85('0x33')]));if(_0xa82ac['query'][_0x1d85('0x3c')]){_0x461a4d[_0x1d85('0x3a')]=_[_0x1d85('0x3e')](_0x461a4d[_0x1d85('0x3a')],{'$or':_[_0x1d85('0x2d')](_0x461a4d[_0x1d85('0x35')],function(_0x1d7a89){var _0x3dba26={};_0x3dba26[_0x1d7a89]={'$like':'%'+_0xa82ac[_0x1d85('0x32')][_0x1d85('0x3c')]+'%'};return _0x3dba26;})});}_0x461a4d=_[_0x1d85('0x3e')]({},_0x461a4d,_0xa82ac[_0x1d85('0x3f')]);return _0x490880[_0x1d85('0x83')](_0x461a4d);}})[_0x1d85('0x23')](function(_0x27aba4){if(_0x27aba4){_0x3fd269=_0x27aba4[_0x1d85('0x37')];if(!_0xa82ac['query'][_0x1d85('0x5a')](_0x1d85('0x5b'))){_0x461a4d[_0x1d85('0x1b')]=qs[_0x1d85('0x1b')](_0xa82ac['query'][_0x1d85('0x1b')]);_0x461a4d['offset']=qs[_0x1d85('0x19')](_0xa82ac[_0x1d85('0x32')][_0x1d85('0x19')]);}return _0x490880[_0x1d85('0x83')](_0x461a4d);}})['then'](function(_0x301515){if(_0x301515){return _0x301515?{'count':_0x3fd269,'rows':_0x301515}:null;}})[_0x1d85('0x23')](respondWithResult(_0x5162b7,null))['catch'](handleError(_0x5162b7,null));};exports[_0x1d85('0x84')]=function(_0x5166d3,_0x16d6fe,_0x9254a5){var _0x545aa5,_0x379f75;return db[_0x1d85('0x2e')][_0x1d85('0x49')]({'where':{'id':_0x5166d3['params']['id']}})[_0x1d85('0x23')](handleEntityNotFound(_0x16d6fe,null))[_0x1d85('0x23')](function(_0x11bec3){if(_0x11bec3){_0x379f75=_0x11bec3;return _0x11bec3['addBlackLists'](_0x5166d3[_0x1d85('0x4b')][_0x1d85('0x64')],_[_0x1d85('0x55')](_0x5166d3[_0x1d85('0x4b')],[_0x1d85('0x64'),'id'])||{});}return null;})[_0x1d85('0x65')](function(_0xe77a6d){var _0x10ba8a;_0x545aa5=_0xe77a6d||[];var _0x2d7e52=[];if(_0xe77a6d){for(var _0x2ccf5d=0x0;_0x2ccf5d<_0xe77a6d['length'];_0x2ccf5d+=0x1){var _0x16bc0f=_0xe77a6d[_0x2ccf5d][_0x1d85('0x25')]({'plain':!![]});_0x10ba8a=squel['insert']()['into']('cm_hopper_black')['fromQuery'](['phone','ContactId',_0x1d85('0x6c'),_0x1d85('0x5c'),_0x1d85('0x56'),'updatedAt'],squel[_0x1d85('0x6d')]()[_0x1d85('0x6f')](_0x1d85('0x6e'),_0x1d85('0x6e'))[_0x1d85('0x6f')]('id',_0x1d85('0x6b'))['field'](_0x16bc0f['CmListId']['toString'](),'ListId')[_0x1d85('0x6f')](_0x5166d3['params']['id'][_0x1d85('0x71')](),_0x1d85('0x5c'))[_0x1d85('0x6f')](_0x1d85('0x72'),'createdAt')['field'](_0x1d85('0x72'),_0x1d85('0x57'))[_0x1d85('0x73')]('cm_contacts')[_0x1d85('0x3a')](_0x1d85('0x75'))[_0x1d85('0x3a')](_0x1d85('0x7e'),_0x16bc0f[_0x1d85('0x70')]['toString']())[_0x1d85('0x3a')](_0x1d85('0x76')))[_0x1d85('0x71')]();_0x2d7e52[_0x1d85('0x7f')](db[_0x1d85('0x80')][_0x1d85('0x32')](_0x10ba8a));}return BPromise[_0x1d85('0x81')](_0x2d7e52);}})[_0x1d85('0x23')](function(){return _0x545aa5;})[_0x1d85('0x23')](respondWithResult(_0x16d6fe,null))[_0x1d85('0x43')](handleError(_0x16d6fe,null));};exports[_0x1d85('0x85')]=function(_0x1391da,_0xca9dcd,_0x58787c){return db['Campaign'][_0x1d85('0x49')]({'where':{'id':_0x1391da['params']['id']}})['then'](handleEntityNotFound(_0xca9dcd,null))['then'](function(_0x3ab0f8){if(_0x3ab0f8){return _0x3ab0f8[_0x1d85('0x85')](_0x1391da[_0x1d85('0x32')][_0x1d85('0x64')]);}})[_0x1d85('0x23')](function(_0x373fc0){if(_0x373fc0){return db[_0x1d85('0x61')][_0x1d85('0x24')]({'where':{'ListId':_0x1391da[_0x1d85('0x32')][_0x1d85('0x64')],'CampaignId':_0x1391da[_0x1d85('0x45')]['id']}})['then'](function(){return _0x373fc0;});}})[_0x1d85('0x23')](respondWithStatusCode(_0xca9dcd,null))['catch'](handleError(_0xca9dcd,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index b9244fa..bb0452c 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(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x90d801,_0x5e10e5){var _0x136d39=function(_0x5b723c){while(--_0x5b723c){_0x90d801['push'](_0x90d801['shift']());}};_0x136d39(++_0x5e10e5);}(_0x7a54,0x106));var _0x47a5=function(_0x17da7a,_0x359a66){_0x17da7a=_0x17da7a-0x0;var _0x5969e1=_0x7a54[_0x17da7a];return _0x5969e1;};'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 d6d949d..bdee7f0 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 _0xb575=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Campaign','findAll','options','raw','attributes','limit','include','map','model','GetCampaign','debug','stringify','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1a3e5f,_0x34c969){var _0x552d2b=function(_0x13d375){while(--_0x13d375){_0x1a3e5f['push'](_0x1a3e5f['shift']());}};_0x552d2b(++_0x34c969);}(_0xb575,0xda));var _0x5b57=function(_0x4e60d0,_0x376888){_0x4e60d0=_0x4e60d0-0x0;var _0x48049e=_0xb575[_0x4e60d0];return _0x48049e;};'use strict';var _=require(_0x5b57('0x0'));var util=require(_0x5b57('0x1'));var moment=require('moment');var BPromise=require(_0x5b57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b57('0x3'));var logger=require(_0x5b57('0x4'))('rpc');var config=require(_0x5b57('0x5'));var jayson=require(_0x5b57('0x6'));var client=jayson[_0x5b57('0x7')][_0x5b57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x672beb,_0x5d223d,_0x4232d0){return new BPromise(function(_0x5dd0c7,_0x2f9789){return client[_0x5b57('0x9')](_0x672beb,_0x4232d0)[_0x5b57('0xa')](function(_0x49ce3a){logger[_0x5b57('0xb')](_0x5b57('0xc'),_0x5d223d,_0x5b57('0xd'));logger['debug'](_0x5b57('0xe'),_0x5d223d,_0x5b57('0xd'),JSON['stringify'](_0x49ce3a));if(_0x49ce3a['error']){if(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x10')]===0x1f4){logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);return _0x2f9789(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);}logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x49ce3a['error'][_0x5b57('0x11')]);return _0x5dd0c7(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);}else{logger['info'](_0x5b57('0xc'),_0x5d223d,_0x5b57('0xd'));_0x5dd0c7(_0x49ce3a[_0x5b57('0x12')][_0x5b57('0x11')]);}})[_0x5b57('0x13')](function(_0x1e7cc0){logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x1e7cc0);_0x2f9789(_0x1e7cc0);});});}exports['GetCampaign']=function(_0x336db6){var _0x1e316f=this;return new Promise(function(_0x2cb809,_0x137899){return db[_0x5b57('0x14')][_0x5b57('0x15')]({'raw':_0x336db6['options']?_0x336db6[_0x5b57('0x16')][_0x5b57('0x17')]===undefined?!![]:![]:!![],'where':_0x336db6[_0x5b57('0x16')]?_0x336db6[_0x5b57('0x16')]['where']||null:null,'attributes':_0x336db6[_0x5b57('0x16')]?_0x336db6[_0x5b57('0x16')][_0x5b57('0x18')]||null:null,'limit':_0x336db6['options']?_0x336db6[_0x5b57('0x16')][_0x5b57('0x19')]||null:null,'include':_0x336db6[_0x5b57('0x16')]?_0x336db6[_0x5b57('0x16')][_0x5b57('0x1a')]?_[_0x5b57('0x1b')](_0x336db6['options'][_0x5b57('0x1a')],function(_0x50ea5f){return{'model':db[_0x50ea5f[_0x5b57('0x1c')]],'as':_0x50ea5f['as'],'attributes':_0x50ea5f[_0x5b57('0x18')],'include':_0x50ea5f['include']?_['map'](_0x50ea5f[_0x5b57('0x1a')],function(_0x5eab3d){return{'model':db[_0x5eab3d[_0x5b57('0x1c')]],'as':_0x5eab3d['as'],'attributes':_0x5eab3d[_0x5b57('0x18')],'include':_0x5eab3d[_0x5b57('0x1a')]?_[_0x5b57('0x1b')](_0x5eab3d[_0x5b57('0x1a')],function(_0x17ac8b){return{'model':db[_0x17ac8b[_0x5b57('0x1c')]],'as':_0x17ac8b['as'],'attributes':_0x17ac8b[_0x5b57('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5b57('0xa')](function(_0x31c4a5){logger[_0x5b57('0xb')](_0x5b57('0x1d'),_0x336db6);logger[_0x5b57('0x1e')](_0x5b57('0x1d'),_0x336db6,JSON[_0x5b57('0x1f')](_0x31c4a5));_0x2cb809(_0x31c4a5);})[_0x5b57('0x13')](function(_0x3e8bc6){logger['error'](_0x5b57('0x1d'),_0x3e8bc6['message'],_0x336db6);_0x137899(_0x1e316f[_0x5b57('0xf')](0x1f4,_0x3e8bc6[_0x5b57('0x11')]));});});}; \ No newline at end of file +var _0xadec=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','GetCampaign'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xadec,0x156));var _0xcade=function(_0x3c5a30,_0x2da842){_0x3c5a30=_0x3c5a30-0x0;var _0x57dcdc=_0xadec[_0x3c5a30];return _0x57dcdc;};'use strict';var _=require(_0xcade('0x0'));var util=require(_0xcade('0x1'));var moment=require(_0xcade('0x2'));var BPromise=require(_0xcade('0x3'));var rs=require(_0xcade('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcade('0x5'))(_0xcade('0x6'));var config=require(_0xcade('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51d665,_0x1fe48f,_0x4c36e8){return new BPromise(function(_0x625da7,_0x5bebbe){return client['request'](_0x51d665,_0x4c36e8)[_0xcade('0x8')](function(_0x182658){logger[_0xcade('0x9')]('Campaign,\x20%s,\x20%s',_0x1fe48f,_0xcade('0xa'));logger[_0xcade('0xb')](_0xcade('0xc'),_0x1fe48f,_0xcade('0xa'),JSON[_0xcade('0xd')](_0x182658));if(_0x182658[_0xcade('0xe')]){if(_0x182658[_0xcade('0xe')][_0xcade('0xf')]===0x1f4){logger[_0xcade('0xe')](_0xcade('0x10'),_0x1fe48f,_0x182658[_0xcade('0xe')][_0xcade('0x11')]);return _0x5bebbe(_0x182658[_0xcade('0xe')][_0xcade('0x11')]);}logger['error'](_0xcade('0x10'),_0x1fe48f,_0x182658[_0xcade('0xe')][_0xcade('0x11')]);return _0x625da7(_0x182658['error'][_0xcade('0x11')]);}else{logger[_0xcade('0x9')]('Campaign,\x20%s,\x20%s',_0x1fe48f,_0xcade('0xa'));_0x625da7(_0x182658[_0xcade('0x12')][_0xcade('0x11')]);}})['catch'](function(_0x1678cd){logger[_0xcade('0xe')](_0xcade('0x10'),_0x1fe48f,_0x1678cd);_0x5bebbe(_0x1678cd);});});}exports['GetCampaign']=function(_0x126272){var _0x124e64=this;return new Promise(function(_0x1c7be1,_0x1c54a0){return db[_0xcade('0x13')][_0xcade('0x14')]({'raw':_0x126272[_0xcade('0x15')]?_0x126272['options'][_0xcade('0x16')]===undefined?!![]:![]:!![],'where':_0x126272[_0xcade('0x15')]?_0x126272[_0xcade('0x15')][_0xcade('0x17')]||null:null,'attributes':_0x126272[_0xcade('0x15')]?_0x126272['options']['attributes']||null:null,'limit':_0x126272[_0xcade('0x15')]?_0x126272['options'][_0xcade('0x18')]||null:null,'include':_0x126272[_0xcade('0x15')]?_0x126272[_0xcade('0x15')][_0xcade('0x19')]?_[_0xcade('0x1a')](_0x126272[_0xcade('0x15')][_0xcade('0x19')],function(_0x264df7){return{'model':db[_0x264df7[_0xcade('0x1b')]],'as':_0x264df7['as'],'attributes':_0x264df7[_0xcade('0x1c')],'include':_0x264df7[_0xcade('0x19')]?_[_0xcade('0x1a')](_0x264df7['include'],function(_0x4139b3){return{'model':db[_0x4139b3[_0xcade('0x1b')]],'as':_0x4139b3['as'],'attributes':_0x4139b3['attributes'],'include':_0x4139b3[_0xcade('0x19')]?_[_0xcade('0x1a')](_0x4139b3[_0xcade('0x19')],function(_0x264f53){return{'model':db[_0x264f53[_0xcade('0x1b')]],'as':_0x264f53['as'],'attributes':_0x264f53[_0xcade('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcade('0x8')](function(_0x4bbe2a){logger[_0xcade('0x9')](_0xcade('0x1d'),_0x126272);logger[_0xcade('0xb')](_0xcade('0x1d'),_0x126272,JSON[_0xcade('0xd')](_0x4bbe2a));_0x1c7be1(_0x4bbe2a);})[_0xcade('0x1e')](function(_0x31fe0d){logger[_0xcade('0xe')]('GetCampaign',_0x31fe0d[_0xcade('0x11')],_0x126272);_0x1c54a0(_0x124e64[_0xcade('0xe')](0x1f4,_0x31fe0d[_0xcade('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index c409b85..8b7a486 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 _0xc5b5=['/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','getHopperHistories'];(function(_0x4236fa,_0x37b6a9){var _0x292b61=function(_0xfd0a6d){while(--_0xfd0a6d){_0x4236fa['push'](_0x4236fa['shift']());}};_0x292b61(++_0x37b6a9);}(_0xc5b5,0x1b2));var _0x5c5b=function(_0x35faf2,_0x56a899){_0x35faf2=_0x35faf2-0x0;var _0x113601=_0xc5b5[_0x35faf2];return _0x113601;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c5b('0x0'));var timeout=require(_0x5c5b('0x1'));var express=require('express');var router=express[_0x5c5b('0x2')]();var fs_extra=require(_0x5c5b('0x3'));var auth=require(_0x5c5b('0x4'));var interaction=require(_0x5c5b('0x5'));var config=require('../../config/environment');var controller=require(_0x5c5b('0x6'));router[_0x5c5b('0x7')]('/',auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x9')]);router[_0x5c5b('0x7')](_0x5c5b('0xa'),auth['isAuthenticated'](),controller[_0x5c5b('0xb')]);router[_0x5c5b('0x7')]('/:id/hoppers',auth[_0x5c5b('0x8')](),controller['getHoppers']);router[_0x5c5b('0x7')](_0x5c5b('0xc'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0xd')]);router['get'](_0x5c5b('0xe'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0xf')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x5c5b('0x10')]);router[_0x5c5b('0x7')](_0x5c5b('0x11'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x12')]);router['get'](_0x5c5b('0x13'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x14')]);router[_0x5c5b('0x15')]('/',auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x16')]);router[_0x5c5b('0x15')](_0x5c5b('0x17'),auth[_0x5c5b('0x8')](),controller['clone']);router[_0x5c5b('0x15')](_0x5c5b('0x11'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x18')]);router[_0x5c5b('0x15')](_0x5c5b('0x13'),auth['isAuthenticated'](),controller[_0x5c5b('0x19')]);router[_0x5c5b('0x1a')](_0x5c5b('0xa'),auth['isAuthenticated'](),controller[_0x5c5b('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x5c5b('0x1c')](_0x5c5b('0x11'),auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x1d')]);router[_0x5c5b('0x1c')]('/:id/blacklists',auth[_0x5c5b('0x8')](),controller[_0x5c5b('0x1e')]);module[_0x5c5b('0x1f')]=router; \ No newline at end of file +var _0xacb8=['removeLists','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','delete','/:id','destroy'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xacb8,0x119));var _0x8acb=function(_0x58c531,_0x126bc6){_0x58c531=_0x58c531-0x0;var _0xddcc4a=_0xacb8[_0x58c531];return _0xddcc4a;};'use strict';var multer=require(_0x8acb('0x0'));var util=require('util');var path=require(_0x8acb('0x1'));var timeout=require(_0x8acb('0x2'));var express=require(_0x8acb('0x3'));var router=express['Router']();var fs_extra=require(_0x8acb('0x4'));var auth=require(_0x8acb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8acb('0x6'));var controller=require(_0x8acb('0x7'));router[_0x8acb('0x8')]('/',auth[_0x8acb('0x9')](),controller[_0x8acb('0xa')]);router[_0x8acb('0x8')]('/:id',auth[_0x8acb('0x9')](),controller[_0x8acb('0xb')]);router[_0x8acb('0x8')](_0x8acb('0xc'),auth[_0x8acb('0x9')](),controller[_0x8acb('0xd')]);router['get']('/:id/hopper_histories',auth[_0x8acb('0x9')](),controller[_0x8acb('0xe')]);router[_0x8acb('0x8')](_0x8acb('0xf'),auth['isAuthenticated'](),controller[_0x8acb('0x10')]);router[_0x8acb('0x8')]('/:id/hopper_black',auth[_0x8acb('0x9')](),controller[_0x8acb('0x11')]);router[_0x8acb('0x8')](_0x8acb('0x12'),auth[_0x8acb('0x9')](),controller['getLists']);router[_0x8acb('0x8')](_0x8acb('0x13'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x14')]);router[_0x8acb('0x15')]('/',auth[_0x8acb('0x9')](),controller['create']);router[_0x8acb('0x15')](_0x8acb('0x16'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x17')]);router[_0x8acb('0x15')](_0x8acb('0x12'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x18')]);router[_0x8acb('0x15')]('/:id/blacklists',auth[_0x8acb('0x9')](),controller[_0x8acb('0x19')]);router['put']('/:id',auth[_0x8acb('0x9')](),controller['update']);router[_0x8acb('0x1a')](_0x8acb('0x1b'),auth['isAuthenticated'](),controller[_0x8acb('0x1c')]);router[_0x8acb('0x1a')](_0x8acb('0x12'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x1d')]);router[_0x8acb('0x1a')](_0x8acb('0x13'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x8acb('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9c5dbf2..89b6984 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 _0xfead=['key','exports','STRING','VIRTUAL','getDataValue'];(function(_0x1690c2,_0x47c82f){var _0x3dde51=function(_0x21f6af){while(--_0x21f6af){_0x1690c2['push'](_0x1690c2['shift']());}};_0x3dde51(++_0x47c82f);}(_0xfead,0x128));var _0xdfea=function(_0x2f84ea,_0x418e1){_0x2f84ea=_0x2f84ea-0x0;var _0x4079dd=_0xfead[_0x2f84ea];return _0x4079dd;};'use strict';var Sequelize=require('sequelize');module[_0xdfea('0x0')]={'key':{'type':Sequelize[_0xdfea('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xdfea('0x1')]},'name':{'type':Sequelize[_0xdfea('0x2')],'get':function(){return this[_0xdfea('0x3')](_0xdfea('0x4'));}}}; \ No newline at end of file +var _0x7047=['VIRTUAL','getDataValue','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7047,0xd2));var _0x7704=function(_0x1f5d2d,_0x2416b4){_0x1f5d2d=_0x1f5d2d-0x0;var _0x1642ff=_0x7047[_0x1f5d2d];return _0x1642ff;};'use strict';var Sequelize=require(_0x7704('0x0'));module[_0x7704('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7704('0x2')],'get':function(){return this[_0x7704('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index fe7f3e7..8d0102d 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 _0xbe18=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x6d97b2,_0x3c1332){var _0x514465=function(_0x13c3ce){while(--_0x13c3ce){_0x6d97b2['push'](_0x6d97b2['shift']());}};_0x514465(++_0x3c1332);}(_0xbe18,0x1c8));var _0x8be1=function(_0x1fe7c9,_0x3a70f2){_0x1fe7c9=_0x1fe7c9-0x0;var _0x45c245=_0xbe18[_0x1fe7c9];return _0x45c245;};'use strict';var emlformat=require(_0x8be1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8be1('0x1'));var jsonpatch=require(_0x8be1('0x2'));var rp=require(_0x8be1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8be1('0x4'));var util=require(_0x8be1('0x5'));var path=require(_0x8be1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8be1('0x7'));var fs=require('fs');var fs_extra=require(_0x8be1('0x8'));var _=require(_0x8be1('0x9'));var squel=require('squel');var crypto=require(_0x8be1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8be1('0xb'));var toCsv=require(_0x8be1('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8be1('0xd'));var authService=require(_0x8be1('0xe'));var qs=require(_0x8be1('0xf'));var as=require(_0x8be1('0x10'));var hardwareService=require(_0x8be1('0x11'));var logger=require(_0x8be1('0x12'))('api');var utils=require(_0x8be1('0x13'));var config=require(_0x8be1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8be1('0x15'))['db'];function respondWithStatusCode(_0x29d8fc,_0x436dd4){_0x436dd4=_0x436dd4||0xcc;return function(_0xa3cc68){if(_0xa3cc68){return _0x29d8fc[_0x8be1('0x16')](_0x436dd4);}return _0x29d8fc[_0x8be1('0x17')](_0x436dd4)[_0x8be1('0x18')]();};}function respondWithResult(_0x5d7934,_0x520645){_0x520645=_0x520645||0xc8;return function(_0x5a1e8b){if(_0x5a1e8b){return _0x5d7934[_0x8be1('0x17')](_0x520645)[_0x8be1('0x19')](_0x5a1e8b);}};}function respondWithFilteredResult(_0x1d9eeb,_0x57f05b){return function(_0x4f2c9d){if(_0x4f2c9d){var _0x5e44db=typeof _0x57f05b[_0x8be1('0x1a')]===_0x8be1('0x1b')&&typeof _0x57f05b[_0x8be1('0x1c')]===_0x8be1('0x1b');var _0x4ccfcd=_0x4f2c9d['count'];var _0x11d8ef=_0x5e44db?0x0:_0x57f05b[_0x8be1('0x1a')];var _0x11f103=_0x5e44db?_0x4f2c9d['count']:_0x57f05b[_0x8be1('0x1a')]+_0x57f05b['limit'];var _0x4e04e2;if(_0x11f103>=_0x4ccfcd){_0x11f103=_0x4ccfcd;_0x4e04e2=0xc8;}else{_0x4e04e2=0xce;}_0x1d9eeb['status'](_0x4e04e2);return _0x1d9eeb[_0x8be1('0x1d')](_0x8be1('0x1e'),_0x11d8ef+'-'+_0x11f103+'/'+_0x4ccfcd)[_0x8be1('0x19')](_0x4f2c9d);}return null;};}function patchUpdates(_0x4a3618){return function(_0x18d953){try{jsonpatch[_0x8be1('0x1f')](_0x18d953,_0x4a3618,!![]);}catch(_0x1e9a64){return BPromise[_0x8be1('0x20')](_0x1e9a64);}return _0x18d953['save']();};}function saveUpdates(_0x2347bc,_0x334844){return function(_0x457e49){if(_0x457e49){return _0x457e49[_0x8be1('0x21')](_0x2347bc)[_0x8be1('0x22')](function(_0x36846b){return _0x36846b;});}return null;};}function removeEntity(_0xae0726,_0x1527c2){return function(_0xecb3f6){if(_0xecb3f6){return _0xecb3f6[_0x8be1('0x23')]()[_0x8be1('0x22')](function(){var _0x38f681=_0xecb3f6[_0x8be1('0x24')]({'plain':!![]});var _0x4acf11=_0x8be1('0x25');return db[_0x8be1('0x26')][_0x8be1('0x23')]({'where':{'type':_0x4acf11,'resourceId':_0x38f681['id']}})[_0x8be1('0x22')](function(){return _0xecb3f6;});})[_0x8be1('0x22')](function(){_0xae0726['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x783cd3,_0x12ff42){return function(_0x2dc431){if(!_0x2dc431){_0x783cd3[_0x8be1('0x16')](0x194);}return _0x2dc431;};}function handleError(_0x3bb225,_0x4ff037){_0x4ff037=_0x4ff037||0x1f4;return function(_0x28021e){logger['error'](_0x28021e['stack']);if(_0x28021e['name']){delete _0x28021e[_0x8be1('0x27')];}_0x3bb225[_0x8be1('0x17')](_0x4ff037)['send'](_0x28021e);};}exports[_0x8be1('0x28')]=function(_0x4bae19,_0x390c12){var _0x297fba={},_0x3189de={},_0x80072b={'count':0x0,'rows':[]};var _0x22230d=_[_0x8be1('0x29')](db[_0x8be1('0x2a')][_0x8be1('0x2b')],function(_0x250887){return{'name':_0x250887[_0x8be1('0x2c')],'type':_0x250887[_0x8be1('0x2d')][_0x8be1('0x2e')]};});_0x3189de[_0x8be1('0x2f')]=_['map'](_0x22230d,_0x8be1('0x27'));_0x3189de[_0x8be1('0x30')]=_[_0x8be1('0x31')](_0x4bae19[_0x8be1('0x30')]);_0x3189de[_0x8be1('0x32')]=_[_0x8be1('0x33')](_0x3189de['model'],_0x3189de[_0x8be1('0x30')]);_0x297fba[_0x8be1('0x34')]=_[_0x8be1('0x33')](_0x3189de['model'],qs['fields'](_0x4bae19[_0x8be1('0x30')][_0x8be1('0x35')]));_0x297fba[_0x8be1('0x34')]=_0x297fba[_0x8be1('0x34')][_0x8be1('0x36')]?_0x297fba[_0x8be1('0x34')]:_0x3189de[_0x8be1('0x2f')];if(!_0x4bae19[_0x8be1('0x30')][_0x8be1('0x37')](_0x8be1('0x38'))){_0x297fba[_0x8be1('0x1c')]=qs[_0x8be1('0x1c')](_0x4bae19[_0x8be1('0x30')]['limit']);_0x297fba[_0x8be1('0x1a')]=qs[_0x8be1('0x1a')](_0x4bae19[_0x8be1('0x30')][_0x8be1('0x1a')]);}_0x297fba['order']=qs[_0x8be1('0x39')](_0x4bae19['query'][_0x8be1('0x39')]);_0x297fba[_0x8be1('0x3a')]=qs[_0x8be1('0x32')](_[_0x8be1('0x3b')](_0x4bae19[_0x8be1('0x30')],_0x3189de[_0x8be1('0x32')]),_0x22230d);if(_0x4bae19['query'][_0x8be1('0x3c')]){_0x297fba[_0x8be1('0x3a')]=_[_0x8be1('0x3d')](_0x297fba['where'],{'$or':[{'key':{'$like':'%'+_0x4bae19[_0x8be1('0x30')][_0x8be1('0x3c')]+'%'}},{'value':{'$like':'%'+_0x4bae19['query'][_0x8be1('0x3c')]+'%'}}]});}_0x297fba=_['merge']({},_0x297fba,_0x4bae19['options']);var _0x553c41={'where':_0x297fba['where']};return db[_0x8be1('0x2a')][_0x8be1('0x3e')](_0x553c41)[_0x8be1('0x22')](function(_0x5990ac){_0x80072b[_0x8be1('0x3e')]=_0x5990ac;if(_0x4bae19['query'][_0x8be1('0x3f')]){_0x297fba[_0x8be1('0x40')]=[{'all':!![]}];}return db[_0x8be1('0x2a')][_0x8be1('0x41')](_0x297fba);})[_0x8be1('0x22')](function(_0x5c21c2){_0x80072b[_0x8be1('0x42')]=_0x5c21c2;return _0x80072b;})[_0x8be1('0x22')](respondWithFilteredResult(_0x390c12,_0x297fba))[_0x8be1('0x43')](handleError(_0x390c12,null));};exports[_0x8be1('0x44')]=function(_0x952b48,_0x54353d){var _0x4a7da8={'raw':!![],'where':{'id':_0x952b48[_0x8be1('0x45')]['id']}},_0x4e5638={};_0x4e5638[_0x8be1('0x2f')]=_['keys'](db[_0x8be1('0x2a')][_0x8be1('0x2b')]);_0x4e5638['query']=_['keys'](_0x952b48[_0x8be1('0x30')]);_0x4e5638[_0x8be1('0x32')]=_[_0x8be1('0x33')](_0x4e5638[_0x8be1('0x2f')],_0x4e5638[_0x8be1('0x30')]);_0x4a7da8[_0x8be1('0x34')]=_['intersection'](_0x4e5638[_0x8be1('0x2f')],qs[_0x8be1('0x35')](_0x952b48[_0x8be1('0x30')]['fields']));_0x4a7da8[_0x8be1('0x34')]=_0x4a7da8[_0x8be1('0x34')][_0x8be1('0x36')]?_0x4a7da8[_0x8be1('0x34')]:_0x4e5638[_0x8be1('0x2f')];if(_0x952b48[_0x8be1('0x30')][_0x8be1('0x3f')]){_0x4a7da8[_0x8be1('0x40')]=[{'all':!![]}];}_0x4a7da8=_[_0x8be1('0x3d')]({},_0x4a7da8,_0x952b48['options']);return db['CannedAnswer'][_0x8be1('0x46')](_0x4a7da8)[_0x8be1('0x22')](handleEntityNotFound(_0x54353d,null))['then'](respondWithResult(_0x54353d,null))[_0x8be1('0x43')](handleError(_0x54353d,null));};exports[_0x8be1('0x21')]=function(_0x588972,_0xdf10e2){if(_0x588972[_0x8be1('0x47')]['id']){delete _0x588972[_0x8be1('0x47')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x588972[_0x8be1('0x45')]['id']}})[_0x8be1('0x22')](handleEntityNotFound(_0xdf10e2,null))[_0x8be1('0x22')](saveUpdates(_0x588972[_0x8be1('0x47')],null))[_0x8be1('0x22')](respondWithResult(_0xdf10e2,null))[_0x8be1('0x43')](handleError(_0xdf10e2,null));};exports[_0x8be1('0x23')]=function(_0x325e29,_0x59b699){return db[_0x8be1('0x2a')][_0x8be1('0x46')]({'where':{'id':_0x325e29[_0x8be1('0x45')]['id']}})[_0x8be1('0x22')](handleEntityNotFound(_0x59b699,null))[_0x8be1('0x22')](removeEntity(_0x59b699,null))['catch'](handleError(_0x59b699,null));};exports['create']=function(_0x2b0583,_0xae0897){var _0xad7cf0={'key':_0x2b0583[_0x8be1('0x47')][_0x8be1('0x2e')]};if(_0x2b0583[_0x8be1('0x47')][_0x8be1('0x48')]){_0xad7cf0[_0x8be1('0x48')]=_0x2b0583[_0x8be1('0x47')][_0x8be1('0x48')];}else if(_0x2b0583['body'][_0x8be1('0x49')]){_0xad7cf0[_0x8be1('0x49')]=_0x2b0583[_0x8be1('0x47')][_0x8be1('0x49')];}else if(_0x2b0583[_0x8be1('0x47')][_0x8be1('0x4a')]){_0xad7cf0[_0x8be1('0x4a')]=_0x2b0583[_0x8be1('0x47')]['OpenchannelAccountId'];}else if(_0x2b0583[_0x8be1('0x47')][_0x8be1('0x4b')]){_0xad7cf0[_0x8be1('0x4b')]=_0x2b0583[_0x8be1('0x47')][_0x8be1('0x4b')];}return db[_0x8be1('0x2a')][_0x8be1('0x46')]({'where':_0xad7cf0})['then'](function(_0xc46a6c){if(_0xc46a6c){throw new db[(_0x8be1('0x4c'))][(_0x8be1('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8be1('0x2a')]['create'](_0x2b0583[_0x8be1('0x47')]);})[_0x8be1('0x22')](function(_0x8a416e){var _0x42c8be=_0x2b0583['user']['get']({'plain':!![]});if(!_0x42c8be)throw new Error(_0x8be1('0x4e'));if(_0x42c8be[_0x8be1('0x4f')]==='user'){var _0x3a9e91=_0x8a416e[_0x8be1('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x8be1('0x46')]({'where':{'name':_0x8be1('0x25'),'userProfileId':_0x42c8be[_0x8be1('0x50')]},'raw':!![]})['then'](function(_0x473c16){if(_0x473c16&&_0x473c16[_0x8be1('0x51')]===0x0){return db['UserProfileResource'][_0x8be1('0x52')]({'name':_0x3a9e91[_0x8be1('0x27')],'resourceId':_0x3a9e91['id'],'type':_0x473c16[_0x8be1('0x27')],'sectionId':_0x473c16['id']},{})['then'](function(){return _0x8a416e;});}else{return _0x8a416e;}})['catch'](function(_0x174cfc){logger[_0x8be1('0x53')](_0x8be1('0x54'),_0x174cfc);throw _0x174cfc;});}return _0x8a416e;})[_0x8be1('0x22')](respondWithResult(_0xae0897,0xc9))[_0x8be1('0x43')](handleError(_0xae0897,null));}; \ No newline at end of file +var _0x2df1=['rows','catch','show','params','keys','rawAttributes','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll'];(function(_0x1f7605,_0x2f094d){var _0x121539=function(_0x47f6e7){while(--_0x47f6e7){_0x1f7605['push'](_0x1f7605['shift']());}};_0x121539(++_0x2f094d);}(_0x2df1,0x122));var _0x12df=function(_0x1aa4e7,_0x445f2e){_0x1aa4e7=_0x1aa4e7-0x0;var _0x6fd3ff=_0x2df1[_0x1aa4e7];return _0x6fd3ff;};'use strict';var emlformat=require(_0x12df('0x0'));var rimraf=require(_0x12df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12df('0x2'));var rp=require('request-promise');var moment=require(_0x12df('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x12df('0x4'));var util=require('util');var path=require(_0x12df('0x5'));var sox=require(_0x12df('0x6'));var csv=require(_0x12df('0x7'));var ejs=require(_0x12df('0x8'));var fs=require('fs');var fs_extra=require(_0x12df('0x9'));var _=require('lodash');var squel=require(_0x12df('0xa'));var crypto=require('crypto');var jsforce=require(_0x12df('0xb'));var deskjs=require(_0x12df('0xc'));var toCsv=require(_0x12df('0x7'));var querystring=require(_0x12df('0xd'));var Papa=require('papaparse');var Redis=require(_0x12df('0xe'));var authService=require(_0x12df('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x12df('0x10'));var hardwareService=require(_0x12df('0x11'));var logger=require(_0x12df('0x12'))(_0x12df('0x13'));var utils=require('../../config/utils');var config=require(_0x12df('0x14'));var licenseUtil=require(_0x12df('0x15'));var db=require(_0x12df('0x16'))['db'];function respondWithStatusCode(_0x1e74fc,_0x511520){_0x511520=_0x511520||0xcc;return function(_0xd89cc5){if(_0xd89cc5){return _0x1e74fc[_0x12df('0x17')](_0x511520);}return _0x1e74fc[_0x12df('0x18')](_0x511520)[_0x12df('0x19')]();};}function respondWithResult(_0x219a9f,_0x45948b){_0x45948b=_0x45948b||0xc8;return function(_0x5857ca){if(_0x5857ca){return _0x219a9f['status'](_0x45948b)[_0x12df('0x1a')](_0x5857ca);}};}function respondWithFilteredResult(_0x27f1cf,_0x1813a8){return function(_0xa82442){if(_0xa82442){var _0x2be756=typeof _0x1813a8[_0x12df('0x1b')]===_0x12df('0x1c')&&typeof _0x1813a8[_0x12df('0x1d')]===_0x12df('0x1c');var _0x39e92c=_0xa82442[_0x12df('0x1e')];var _0x13fdf7=_0x2be756?0x0:_0x1813a8[_0x12df('0x1b')];var _0x43b6d3=_0x2be756?_0xa82442[_0x12df('0x1e')]:_0x1813a8[_0x12df('0x1b')]+_0x1813a8[_0x12df('0x1d')];var _0x1567f8;if(_0x43b6d3>=_0x39e92c){_0x43b6d3=_0x39e92c;_0x1567f8=0xc8;}else{_0x1567f8=0xce;}_0x27f1cf[_0x12df('0x18')](_0x1567f8);return _0x27f1cf['set'](_0x12df('0x1f'),_0x13fdf7+'-'+_0x43b6d3+'/'+_0x39e92c)[_0x12df('0x1a')](_0xa82442);}return null;};}function patchUpdates(_0x332157){return function(_0x9b72b2){try{jsonpatch[_0x12df('0x20')](_0x9b72b2,_0x332157,!![]);}catch(_0x12664d){return BPromise['reject'](_0x12664d);}return _0x9b72b2[_0x12df('0x21')]();};}function saveUpdates(_0x8d4125,_0xa4d23c){return function(_0x175047){if(_0x175047){return _0x175047[_0x12df('0x22')](_0x8d4125)[_0x12df('0x23')](function(_0x255bcc){return _0x255bcc;});}return null;};}function removeEntity(_0x55469d,_0x17ee08){return function(_0x59604a){if(_0x59604a){return _0x59604a[_0x12df('0x24')]()[_0x12df('0x23')](function(){var _0x518399=_0x59604a[_0x12df('0x25')]({'plain':!![]});var _0x3ec3ed=_0x12df('0x26');return db['UserProfileResource'][_0x12df('0x24')]({'where':{'type':_0x3ec3ed,'resourceId':_0x518399['id']}})[_0x12df('0x23')](function(){return _0x59604a;});})[_0x12df('0x23')](function(){_0x55469d[_0x12df('0x18')](0xcc)[_0x12df('0x19')]();});}};}function handleEntityNotFound(_0x1a34e5,_0x51614f){return function(_0x3ba3c7){if(!_0x3ba3c7){_0x1a34e5[_0x12df('0x17')](0x194);}return _0x3ba3c7;};}function handleError(_0x43bb86,_0x5a0219){_0x5a0219=_0x5a0219||0x1f4;return function(_0x11f2a2){logger[_0x12df('0x27')](_0x11f2a2[_0x12df('0x28')]);if(_0x11f2a2[_0x12df('0x29')]){delete _0x11f2a2['name'];}_0x43bb86[_0x12df('0x18')](_0x5a0219)[_0x12df('0x2a')](_0x11f2a2);};}exports[_0x12df('0x2b')]=function(_0x52177d,_0x539b9e){var _0x349ed2={},_0x36d661={},_0x42ec96={'count':0x0,'rows':[]};var _0x490592=_[_0x12df('0x2c')](db[_0x12df('0x2d')]['rawAttributes'],function(_0x3b25d4){return{'name':_0x3b25d4[_0x12df('0x2e')],'type':_0x3b25d4[_0x12df('0x2f')]['key']};});_0x36d661[_0x12df('0x30')]=_[_0x12df('0x2c')](_0x490592,'name');_0x36d661[_0x12df('0x31')]=_['keys'](_0x52177d['query']);_0x36d661[_0x12df('0x32')]=_['intersection'](_0x36d661[_0x12df('0x30')],_0x36d661['query']);_0x349ed2[_0x12df('0x33')]=_[_0x12df('0x34')](_0x36d661[_0x12df('0x30')],qs[_0x12df('0x35')](_0x52177d[_0x12df('0x31')][_0x12df('0x35')]));_0x349ed2[_0x12df('0x33')]=_0x349ed2['attributes'][_0x12df('0x36')]?_0x349ed2['attributes']:_0x36d661[_0x12df('0x30')];if(!_0x52177d[_0x12df('0x31')][_0x12df('0x37')](_0x12df('0x38'))){_0x349ed2['limit']=qs[_0x12df('0x1d')](_0x52177d[_0x12df('0x31')]['limit']);_0x349ed2[_0x12df('0x1b')]=qs[_0x12df('0x1b')](_0x52177d[_0x12df('0x31')][_0x12df('0x1b')]);}_0x349ed2['order']=qs['sort'](_0x52177d[_0x12df('0x31')][_0x12df('0x39')]);_0x349ed2[_0x12df('0x3a')]=qs[_0x12df('0x32')](_[_0x12df('0x3b')](_0x52177d['query'],_0x36d661[_0x12df('0x32')]),_0x490592);if(_0x52177d[_0x12df('0x31')][_0x12df('0x3c')]){_0x349ed2[_0x12df('0x3a')]=_[_0x12df('0x3d')](_0x349ed2['where'],{'$or':[{'key':{'$like':'%'+_0x52177d[_0x12df('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x52177d[_0x12df('0x31')]['filter']+'%'}}]});}_0x349ed2=_[_0x12df('0x3d')]({},_0x349ed2,_0x52177d[_0x12df('0x3e')]);var _0x2b1ee6={'where':_0x349ed2[_0x12df('0x3a')]};return db[_0x12df('0x2d')][_0x12df('0x1e')](_0x2b1ee6)[_0x12df('0x23')](function(_0x11ee8c){_0x42ec96[_0x12df('0x1e')]=_0x11ee8c;if(_0x52177d[_0x12df('0x31')][_0x12df('0x3f')]){_0x349ed2[_0x12df('0x40')]=[{'all':!![]}];}return db[_0x12df('0x2d')][_0x12df('0x41')](_0x349ed2);})[_0x12df('0x23')](function(_0x2ad362){_0x42ec96[_0x12df('0x42')]=_0x2ad362;return _0x42ec96;})[_0x12df('0x23')](respondWithFilteredResult(_0x539b9e,_0x349ed2))[_0x12df('0x43')](handleError(_0x539b9e,null));};exports[_0x12df('0x44')]=function(_0x396e19,_0x56a7c5){var _0x4e993a={'raw':!![],'where':{'id':_0x396e19[_0x12df('0x45')]['id']}},_0x4c0315={};_0x4c0315[_0x12df('0x30')]=_[_0x12df('0x46')](db[_0x12df('0x2d')][_0x12df('0x47')]);_0x4c0315[_0x12df('0x31')]=_['keys'](_0x396e19[_0x12df('0x31')]);_0x4c0315[_0x12df('0x32')]=_[_0x12df('0x34')](_0x4c0315[_0x12df('0x30')],_0x4c0315[_0x12df('0x31')]);_0x4e993a['attributes']=_[_0x12df('0x34')](_0x4c0315[_0x12df('0x30')],qs[_0x12df('0x35')](_0x396e19['query'][_0x12df('0x35')]));_0x4e993a['attributes']=_0x4e993a[_0x12df('0x33')][_0x12df('0x36')]?_0x4e993a[_0x12df('0x33')]:_0x4c0315[_0x12df('0x30')];if(_0x396e19[_0x12df('0x31')]['includeAll']){_0x4e993a[_0x12df('0x40')]=[{'all':!![]}];}_0x4e993a=_['merge']({},_0x4e993a,_0x396e19['options']);return db[_0x12df('0x2d')][_0x12df('0x48')](_0x4e993a)[_0x12df('0x23')](handleEntityNotFound(_0x56a7c5,null))['then'](respondWithResult(_0x56a7c5,null))[_0x12df('0x43')](handleError(_0x56a7c5,null));};exports[_0x12df('0x22')]=function(_0x325d0b,_0x26300c){if(_0x325d0b['body']['id']){delete _0x325d0b[_0x12df('0x49')]['id'];}return db[_0x12df('0x2d')][_0x12df('0x48')]({'where':{'id':_0x325d0b[_0x12df('0x45')]['id']}})['then'](handleEntityNotFound(_0x26300c,null))[_0x12df('0x23')](saveUpdates(_0x325d0b['body'],null))['then'](respondWithResult(_0x26300c,null))[_0x12df('0x43')](handleError(_0x26300c,null));};exports[_0x12df('0x24')]=function(_0x1bdede,_0x2f919b){return db[_0x12df('0x2d')]['find']({'where':{'id':_0x1bdede[_0x12df('0x45')]['id']}})[_0x12df('0x23')](handleEntityNotFound(_0x2f919b,null))[_0x12df('0x23')](removeEntity(_0x2f919b,null))[_0x12df('0x43')](handleError(_0x2f919b,null));};exports[_0x12df('0x4a')]=function(_0x5f3415,_0x8f6cc0){var _0xcec2ac={'key':_0x5f3415[_0x12df('0x49')][_0x12df('0x4b')]};if(_0x5f3415[_0x12df('0x49')][_0x12df('0x4c')]){_0xcec2ac[_0x12df('0x4c')]=_0x5f3415[_0x12df('0x49')][_0x12df('0x4c')];}else if(_0x5f3415[_0x12df('0x49')]['SmsAccountId']){_0xcec2ac[_0x12df('0x4d')]=_0x5f3415[_0x12df('0x49')]['SmsAccountId'];}else if(_0x5f3415[_0x12df('0x49')][_0x12df('0x4e')]){_0xcec2ac[_0x12df('0x4e')]=_0x5f3415[_0x12df('0x49')][_0x12df('0x4e')];}else if(_0x5f3415[_0x12df('0x49')][_0x12df('0x4f')]){_0xcec2ac['ChatWebsiteId']=_0x5f3415['body'][_0x12df('0x4f')];}return db[_0x12df('0x2d')][_0x12df('0x48')]({'where':_0xcec2ac})['then'](function(_0x3c8cf8){if(_0x3c8cf8){throw new db['Sequelize'][(_0x12df('0x50'))](_0x12df('0x51'));}return db[_0x12df('0x2d')]['create'](_0x5f3415[_0x12df('0x49')]);})['then'](function(_0x3e8c4d){var _0x33aebe=_0x5f3415[_0x12df('0x52')][_0x12df('0x25')]({'plain':!![]});if(!_0x33aebe)throw new Error(_0x12df('0x53'));if(_0x33aebe[_0x12df('0x54')]===_0x12df('0x52')){var _0x2462a9=_0x3e8c4d['get']({'plain':!![]});return db[_0x12df('0x55')][_0x12df('0x48')]({'where':{'name':_0x12df('0x26'),'userProfileId':_0x33aebe['userProfileId']},'raw':!![]})[_0x12df('0x23')](function(_0x31dc69){if(_0x31dc69&&_0x31dc69[_0x12df('0x56')]===0x0){return db[_0x12df('0x57')][_0x12df('0x4a')]({'name':_0x2462a9['name'],'resourceId':_0x2462a9['id'],'type':_0x31dc69[_0x12df('0x29')],'sectionId':_0x31dc69['id']},{})['then'](function(){return _0x3e8c4d;});}else{return _0x3e8c4d;}})[_0x12df('0x43')](function(_0x43651d){logger[_0x12df('0x27')](_0x12df('0x58'),_0x43651d);throw _0x43651d;});}return _0x3e8c4d;})[_0x12df('0x23')](respondWithResult(_0x8f6cc0,0xc9))[_0x12df('0x43')](handleError(_0x8f6cc0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 4492ba4..7750dfb 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 _0xcbbb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4ff391,_0x797a58){var _0x3d2f2b=function(_0x5d8bfd){while(--_0x5d8bfd){_0x4ff391['push'](_0x4ff391['shift']());}};_0x3d2f2b(++_0x797a58);}(_0xcbbb,0x1ee));var _0xbcbb=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xcbbb[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xbcbb('0x0'));var util=require(_0xbcbb('0x1'));var logger=require(_0xbcbb('0x2'))(_0xbcbb('0x3'));var moment=require(_0xbcbb('0x4'));var BPromise=require(_0xbcbb('0x5'));var rp=require(_0xbcbb('0x6'));var fs=require('fs');var path=require(_0xbcbb('0x7'));var rimraf=require(_0xbcbb('0x8'));var config=require(_0xbcbb('0x9'));var attributes=require(_0xbcbb('0xa'));module[_0xbcbb('0xb')]=function(_0x5d593d,_0xcefac7){return _0x5d593d['define']('CannedAnswer',attributes,{'tableName':_0xbcbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbcbb('0xd'),'collate':_0xbcbb('0xe')});}; \ No newline at end of file +var _0x3d62=['bluebird','request-promise','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x3d62,0x133));var _0x23d6=function(_0x3d6d4e,_0x44be00){_0x3d6d4e=_0x3d6d4e-0x0;var _0xa6f07c=_0x3d62[_0x3d6d4e];return _0xa6f07c;};'use strict';var _=require(_0x23d6('0x0'));var util=require(_0x23d6('0x1'));var logger=require(_0x23d6('0x2'))(_0x23d6('0x3'));var moment=require(_0x23d6('0x4'));var BPromise=require(_0x23d6('0x5'));var rp=require(_0x23d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x23d6('0x7')]=function(_0x1b6705,_0x1626b3){return _0x1b6705[_0x23d6('0x8')](_0x23d6('0x9'),attributes,{'tableName':_0x23d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x23d6('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 4cd3e64..b9c3ac6 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(_0x1f0392,_0x481e10){var _0x27222b=function(_0x59fb50){while(--_0x59fb50){_0x1f0392['push'](_0x1f0392['shift']());}};_0x27222b(++_0x481e10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x3c99ff,_0x31cdc4){var _0x914a6a=function(_0x224419){while(--_0x224419){_0x3c99ff['push'](_0x3c99ff['shift']());}};_0x914a6a(++_0x31cdc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 85c5b09..2cb53cb 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 _0x296a=['put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x296a,0x15a));var _0xa296=function(_0x3d998b,_0x309a28){_0x3d998b=_0x3d998b-0x0;var _0x2ba888=_0x296a[_0x3d998b];return _0x2ba888;};'use strict';var multer=require(_0xa296('0x0'));var util=require('util');var path=require(_0xa296('0x1'));var timeout=require(_0xa296('0x2'));var express=require(_0xa296('0x3'));var router=express['Router']();var fs_extra=require(_0xa296('0x4'));var auth=require(_0xa296('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa296('0x6'));var controller=require('./cannedAnswer.controller');router[_0xa296('0x7')]('/',auth[_0xa296('0x8')](),controller[_0xa296('0x9')]);router['get'](_0xa296('0xa'),auth['isAuthenticated'](),controller[_0xa296('0xb')]);router[_0xa296('0xc')]('/',auth[_0xa296('0x8')](),controller[_0xa296('0xd')]);router[_0xa296('0xe')](_0xa296('0xa'),auth[_0xa296('0x8')](),controller[_0xa296('0xf')]);router[_0xa296('0x10')]('/:id',auth[_0xa296('0x8')](),controller[_0xa296('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa84f=['update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','show','post','isAuthenticated','create','put'];(function(_0x180e1a,_0x306b34){var _0x5810b2=function(_0x5d5c26){while(--_0x5d5c26){_0x180e1a['push'](_0x180e1a['shift']());}};_0x5810b2(++_0x306b34);}(_0xa84f,0x1a1));var _0xfa84=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xa84f[_0xffd1b5];return _0x3176d6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfa84('0x0'));var express=require(_0xfa84('0x1'));var router=express[_0xfa84('0x2')]();var fs_extra=require(_0xfa84('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfa84('0x4'));var config=require(_0xfa84('0x5'));var controller=require(_0xfa84('0x6'));router[_0xfa84('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa84('0x8')]);router['get'](_0xfa84('0x9'),auth['isAuthenticated'](),controller[_0xfa84('0xa')]);router[_0xfa84('0xb')]('/',auth[_0xfa84('0xc')](),controller[_0xfa84('0xd')]);router[_0xfa84('0xe')](_0xfa84('0x9'),auth[_0xfa84('0xc')](),controller[_0xfa84('0xf')]);router[_0xfa84('0x10')](_0xfa84('0x9'),auth[_0xfa84('0xc')](),controller['destroy']);module[_0xfa84('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 75ee4b3..9936962 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 _0xa446=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa446,0xc6));var _0x6a44=function(_0xf263c0,_0x5b88be){_0xf263c0=_0xf263c0-0x0;var _0x50ac9c=_0xa446[_0xf263c0];return _0x50ac9c;};'use strict';var Sequelize=require(_0x6a44('0x0'));module[_0x6a44('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6a44('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6a44('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x6a44('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6a44('0x3')]},'lastapp':{'type':Sequelize[_0x6a44('0x3')]},'lastdata':{'type':Sequelize[_0x6a44('0x3')]},'duration':{'type':Sequelize[_0x6a44('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6a44('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6a44('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6a44('0x3')]},'userfield':{'type':Sequelize[_0x6a44('0x3')]},'uniqueid':{'type':Sequelize[_0x6a44('0x3')]},'linkedid':{'type':Sequelize[_0x6a44('0x3')]},'sequence':{'type':Sequelize[_0x6a44('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a44('0x3')]},'tag':{'type':Sequelize[_0x6a44('0x3')]}}; \ No newline at end of file +var _0x152f=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x152f,0x144));var _0xf152=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x152f[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'calldate':{'type':Sequelize[_0xf152('0x2')],'allowNull':![],'defaultValue':_0xf152('0x3')},'clid':{'type':Sequelize[_0xf152('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xf152('0x4')]},'dcontext':{'type':Sequelize[_0xf152('0x4')]},'channel':{'type':Sequelize[_0xf152('0x4')]},'dstchannel':{'type':Sequelize[_0xf152('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf152('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf152('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf152('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf152('0x4')]},'linkedid':{'type':Sequelize[_0xf152('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xf152('0x4')]},'type':{'type':Sequelize[_0xf152('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index b86f397..2bd324b 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 _0x7d9f=['util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','Cdr','rawAttributes','model','keys','attributes','intersection','fields','query','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x1f5e4a,_0x16111e){var _0x380da7=function(_0x49dbbb){while(--_0x49dbbb){_0x1f5e4a['push'](_0x1f5e4a['shift']());}};_0x380da7(++_0x16111e);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x542149,_0x5df180){_0x542149=_0x542149-0x0;var _0x36df57=_0x7d9f[_0x542149];return _0x36df57;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={},_0x508b00={},_0x20315e={'count':0x0,'rows':[]};var _0x193add=_[_0xf7d9('0x29')](db[_0xf7d9('0x2a')][_0xf7d9('0x2b')],function(_0x16318f){return{'name':_0x16318f['fieldName'],'type':_0x16318f['type']['key']};});_0x508b00[_0xf7d9('0x2c')]=_['map'](_0x193add,_0xf7d9('0x27'));_0x508b00['query']=_[_0xf7d9('0x2d')](_0x3847ff['query']);_0x508b00['filters']=_['intersection'](_0x508b00[_0xf7d9('0x2c')],_0x508b00['query']);_0x2c04c3[_0xf7d9('0x2e')]=_[_0xf7d9('0x2f')](_0x508b00[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2c04c3[_0xf7d9('0x2e')]=_0x2c04c3[_0xf7d9('0x2e')]['length']?_0x2c04c3[_0xf7d9('0x2e')]:_0x508b00[_0xf7d9('0x2c')];if(!_0x3847ff['query']['hasOwnProperty'](_0xf7d9('0x32'))){_0x2c04c3[_0xf7d9('0x1b')]=qs[_0xf7d9('0x1b')](_0x3847ff['query'][_0xf7d9('0x1b')]);_0x2c04c3[_0xf7d9('0x1d')]=qs[_0xf7d9('0x1d')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x1d')]);}_0x2c04c3[_0xf7d9('0x33')]=qs[_0xf7d9('0x34')](_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x34')]);_0x2c04c3[_0xf7d9('0x35')]=qs[_0xf7d9('0x36')](_['pick'](_0x3847ff[_0xf7d9('0x31')],_0x508b00['filters']),_0x193add);if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x37')]){_0x2c04c3[_0xf7d9('0x35')]=_[_0xf7d9('0x38')](_0x2c04c3['where'],{'$or':_['map'](_0x193add,function(_0x2173e2){if(_0x2173e2['type']!==_0xf7d9('0x39')){var _0xb3723c={};_0xb3723c[_0x2173e2[_0xf7d9('0x27')]]={'$like':'%'+_0x3847ff[_0xf7d9('0x31')]['filter']+'%'};return _0xb3723c;}})});}_0x2c04c3=_['merge']({},_0x2c04c3,_0x3847ff[_0xf7d9('0x3a')]);var _0x410c72={'where':_0x2c04c3[_0xf7d9('0x35')]};return db[_0xf7d9('0x2a')]['count'](_0x410c72)[_0xf7d9('0x24')](function(_0xd6d84f){_0x20315e[_0xf7d9('0x1e')]=_0xd6d84f;if(_0x3847ff[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2c04c3['include']=[{'all':!![]}];}return db[_0xf7d9('0x2a')][_0xf7d9('0x3c')](_0x2c04c3);})[_0xf7d9('0x24')](function(_0x3db665){_0x20315e[_0xf7d9('0x3d')]=_0x3db665;return _0x20315e;})[_0xf7d9('0x24')](respondWithFilteredResult(_0x2b5f17,_0x2c04c3))[_0xf7d9('0x3e')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x3f')]=function(_0x40d026,_0x3d056f){var _0x2a349b={'raw':!![],'where':{'id':_0x40d026['params']['id']}},_0x46b7d4={};_0x46b7d4[_0xf7d9('0x2c')]=_[_0xf7d9('0x2d')](db['Cdr']['rawAttributes']);_0x46b7d4['query']=_[_0xf7d9('0x2d')](_0x40d026['query']);_0x46b7d4[_0xf7d9('0x36')]=_[_0xf7d9('0x2f')](_0x46b7d4[_0xf7d9('0x2c')],_0x46b7d4[_0xf7d9('0x31')]);_0x2a349b[_0xf7d9('0x2e')]=_['intersection'](_0x46b7d4[_0xf7d9('0x2c')],qs[_0xf7d9('0x30')](_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x30')]));_0x2a349b[_0xf7d9('0x2e')]=_0x2a349b['attributes']['length']?_0x2a349b[_0xf7d9('0x2e')]:_0x46b7d4[_0xf7d9('0x2c')];if(_0x40d026[_0xf7d9('0x31')][_0xf7d9('0x3b')]){_0x2a349b[_0xf7d9('0x40')]=[{'all':!![]}];}_0x2a349b=_['merge']({},_0x2a349b,_0x40d026[_0xf7d9('0x3a')]);return db['Cdr'][_0xf7d9('0x41')](_0x2a349b)[_0xf7d9('0x24')](handleEntityNotFound(_0x3d056f,null))[_0xf7d9('0x24')](respondWithResult(_0x3d056f,null))[_0xf7d9('0x3e')](handleError(_0x3d056f,null));};exports[_0xf7d9('0x42')]=function(_0x1e3a53,_0x4003e9){return db[_0xf7d9('0x2a')][_0xf7d9('0x42')](_0x1e3a53[_0xf7d9('0x43')],{})[_0xf7d9('0x24')](respondWithResult(_0x4003e9,0xc9))[_0xf7d9('0x3e')](handleError(_0x4003e9,null));};exports[_0xf7d9('0x23')]=function(_0x3cdeb5,_0x50731a){if(_0x3cdeb5[_0xf7d9('0x43')]['id']){delete _0x3cdeb5[_0xf7d9('0x43')]['id'];}return db['Cdr']['find']({'where':{'id':_0x3cdeb5[_0xf7d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x50731a,null))['then'](saveUpdates(_0x3cdeb5[_0xf7d9('0x43')],null))[_0xf7d9('0x24')](respondWithResult(_0x50731a,null))[_0xf7d9('0x3e')](handleError(_0x50731a,null));};exports[_0xf7d9('0x45')]=function(_0xf923e0,_0x9c3719){return db[_0xf7d9('0x2a')][_0xf7d9('0x41')]({'where':{'id':_0xf923e0[_0xf7d9('0x44')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x9c3719,null))[_0xf7d9('0x24')](removeEntity(_0x9c3719,null))[_0xf7d9('0x3e')](handleError(_0x9c3719,null));};exports['describe']=function(_0x48076b,_0x42da01){return db[_0xf7d9('0x2a')][_0xf7d9('0x46')]()[_0xf7d9('0x24')](respondWithResult(_0x42da01,null))['catch'](handleError(_0x42da01,null));}; \ No newline at end of file +var _0x0fda=['limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','index','map','Cdr','fieldName','type','key','name','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','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'];(function(_0x295fdf,_0x43b028){var _0x3e49b3=function(_0x1aa45b){while(--_0x1aa45b){_0x295fdf['push'](_0x295fdf['shift']());}};_0x3e49b3(++_0x43b028);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x342398,_0x5ef6e4){_0x342398=_0x342398-0x0;var _0x58d773=_0x0fda[_0x342398];return _0x58d773;};'use strict';var emlformat=require(_0xa0fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa0fd('0x1'));var jsonpatch=require(_0xa0fd('0x2'));var rp=require(_0xa0fd('0x3'));var moment=require(_0xa0fd('0x4'));var BPromise=require(_0xa0fd('0x5'));var Mustache=require(_0xa0fd('0x6'));var util=require(_0xa0fd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa0fd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0fd('0x9'));var squel=require(_0xa0fd('0xa'));var crypto=require(_0xa0fd('0xb'));var jsforce=require(_0xa0fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa0fd('0x8'));var querystring=require(_0xa0fd('0xd'));var Papa=require(_0xa0fd('0xe'));var Redis=require(_0xa0fd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa0fd('0x10'));var as=require(_0xa0fd('0x11'));var hardwareService=require(_0xa0fd('0x12'));var logger=require('../../config/logger')(_0xa0fd('0x13'));var utils=require(_0xa0fd('0x14'));var config=require(_0xa0fd('0x15'));var licenseUtil=require(_0xa0fd('0x16'));var db=require(_0xa0fd('0x17'))['db'];function respondWithStatusCode(_0x4d5c32,_0x490112){_0x490112=_0x490112||0xcc;return function(_0x32dcee){if(_0x32dcee){return _0x4d5c32[_0xa0fd('0x18')](_0x490112);}return _0x4d5c32['status'](_0x490112)[_0xa0fd('0x19')]();};}function respondWithResult(_0x8a67a5,_0x11e4eb){_0x11e4eb=_0x11e4eb||0xc8;return function(_0x1e4a48){if(_0x1e4a48){return _0x8a67a5[_0xa0fd('0x1a')](_0x11e4eb)[_0xa0fd('0x1b')](_0x1e4a48);}};}function respondWithFilteredResult(_0x2811c0,_0x4fe62c){return function(_0x1c6ffc){if(_0x1c6ffc){var _0x326ba8=typeof _0x4fe62c['offset']==='undefined'&&typeof _0x4fe62c[_0xa0fd('0x1c')]===_0xa0fd('0x1d');var _0x5d2d7b=_0x1c6ffc[_0xa0fd('0x1e')];var _0x22a876=_0x326ba8?0x0:_0x4fe62c[_0xa0fd('0x1f')];var _0x5073a8=_0x326ba8?_0x1c6ffc['count']:_0x4fe62c[_0xa0fd('0x1f')]+_0x4fe62c['limit'];var _0x40e288;if(_0x5073a8>=_0x5d2d7b){_0x5073a8=_0x5d2d7b;_0x40e288=0xc8;}else{_0x40e288=0xce;}_0x2811c0[_0xa0fd('0x1a')](_0x40e288);return _0x2811c0[_0xa0fd('0x20')](_0xa0fd('0x21'),_0x22a876+'-'+_0x5073a8+'/'+_0x5d2d7b)[_0xa0fd('0x1b')](_0x1c6ffc);}return null;};}function patchUpdates(_0x2273f4){return function(_0x113059){try{jsonpatch['apply'](_0x113059,_0x2273f4,!![]);}catch(_0x166934){return BPromise[_0xa0fd('0x22')](_0x166934);}return _0x113059[_0xa0fd('0x23')]();};}function saveUpdates(_0x18eaa8,_0x26e3a4){return function(_0x3af329){if(_0x3af329){return _0x3af329[_0xa0fd('0x24')](_0x18eaa8)[_0xa0fd('0x25')](function(_0xda6f53){return _0xda6f53;});}return null;};}function removeEntity(_0x13fc62,_0x28dbda){return function(_0x310279){if(_0x310279){return _0x310279[_0xa0fd('0x26')]()['then'](function(){_0x13fc62[_0xa0fd('0x1a')](0xcc)[_0xa0fd('0x19')]();});}};}function handleEntityNotFound(_0x541118,_0x197ae5){return function(_0x3cd5b0){if(!_0x3cd5b0){_0x541118['sendStatus'](0x194);}return _0x3cd5b0;};}function handleError(_0x5bb0ee,_0x2e9b0d){_0x2e9b0d=_0x2e9b0d||0x1f4;return function(_0x267899){logger['error'](_0x267899['stack']);if(_0x267899['name']){delete _0x267899['name'];}_0x5bb0ee[_0xa0fd('0x1a')](_0x2e9b0d)['send'](_0x267899);};}exports[_0xa0fd('0x27')]=function(_0x1db300,_0x2f5b0d){var _0x4a307b={},_0x36aaed={},_0x19c352={'count':0x0,'rows':[]};var _0x4feb93=_[_0xa0fd('0x28')](db[_0xa0fd('0x29')]['rawAttributes'],function(_0x366921){return{'name':_0x366921[_0xa0fd('0x2a')],'type':_0x366921[_0xa0fd('0x2b')][_0xa0fd('0x2c')]};});_0x36aaed['model']=_[_0xa0fd('0x28')](_0x4feb93,_0xa0fd('0x2d'));_0x36aaed['query']=_['keys'](_0x1db300['query']);_0x36aaed[_0xa0fd('0x2e')]=_['intersection'](_0x36aaed['model'],_0x36aaed[_0xa0fd('0x2f')]);_0x4a307b['attributes']=_[_0xa0fd('0x30')](_0x36aaed[_0xa0fd('0x31')],qs[_0xa0fd('0x32')](_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x32')]));_0x4a307b[_0xa0fd('0x33')]=_0x4a307b[_0xa0fd('0x33')][_0xa0fd('0x34')]?_0x4a307b['attributes']:_0x36aaed[_0xa0fd('0x31')];if(!_0x1db300['query'][_0xa0fd('0x35')]('nolimit')){_0x4a307b['limit']=qs[_0xa0fd('0x1c')](_0x1db300['query'][_0xa0fd('0x1c')]);_0x4a307b[_0xa0fd('0x1f')]=qs[_0xa0fd('0x1f')](_0x1db300[_0xa0fd('0x2f')]['offset']);}_0x4a307b[_0xa0fd('0x36')]=qs[_0xa0fd('0x37')](_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x37')]);_0x4a307b[_0xa0fd('0x38')]=qs[_0xa0fd('0x2e')](_[_0xa0fd('0x39')](_0x1db300['query'],_0x36aaed['filters']),_0x4feb93);if(_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3a')]){_0x4a307b[_0xa0fd('0x38')]=_[_0xa0fd('0x3b')](_0x4a307b['where'],{'$or':_[_0xa0fd('0x28')](_0x4feb93,function(_0x3938da){if(_0x3938da[_0xa0fd('0x2b')]!==_0xa0fd('0x3c')){var _0x214094={};_0x214094[_0x3938da['name']]={'$like':'%'+_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3a')]+'%'};return _0x214094;}})});}_0x4a307b=_['merge']({},_0x4a307b,_0x1db300['options']);var _0x27082a={'where':_0x4a307b[_0xa0fd('0x38')]};return db[_0xa0fd('0x29')][_0xa0fd('0x1e')](_0x27082a)[_0xa0fd('0x25')](function(_0xbeca16){_0x19c352[_0xa0fd('0x1e')]=_0xbeca16;if(_0x1db300[_0xa0fd('0x2f')][_0xa0fd('0x3d')]){_0x4a307b[_0xa0fd('0x3e')]=[{'all':!![]}];}return db[_0xa0fd('0x29')][_0xa0fd('0x3f')](_0x4a307b);})[_0xa0fd('0x25')](function(_0x466767){_0x19c352[_0xa0fd('0x40')]=_0x466767;return _0x19c352;})['then'](respondWithFilteredResult(_0x2f5b0d,_0x4a307b))['catch'](handleError(_0x2f5b0d,null));};exports['show']=function(_0x241e3e,_0x288a8a){var _0x399eb1={'raw':!![],'where':{'id':_0x241e3e[_0xa0fd('0x41')]['id']}},_0x54fb8c={};_0x54fb8c[_0xa0fd('0x31')]=_[_0xa0fd('0x42')](db['Cdr'][_0xa0fd('0x43')]);_0x54fb8c[_0xa0fd('0x2f')]=_[_0xa0fd('0x42')](_0x241e3e[_0xa0fd('0x2f')]);_0x54fb8c[_0xa0fd('0x2e')]=_[_0xa0fd('0x30')](_0x54fb8c['model'],_0x54fb8c[_0xa0fd('0x2f')]);_0x399eb1[_0xa0fd('0x33')]=_[_0xa0fd('0x30')](_0x54fb8c[_0xa0fd('0x31')],qs[_0xa0fd('0x32')](_0x241e3e[_0xa0fd('0x2f')]['fields']));_0x399eb1[_0xa0fd('0x33')]=_0x399eb1[_0xa0fd('0x33')][_0xa0fd('0x34')]?_0x399eb1[_0xa0fd('0x33')]:_0x54fb8c[_0xa0fd('0x31')];if(_0x241e3e['query']['includeAll']){_0x399eb1[_0xa0fd('0x3e')]=[{'all':!![]}];}_0x399eb1=_[_0xa0fd('0x3b')]({},_0x399eb1,_0x241e3e[_0xa0fd('0x44')]);return db[_0xa0fd('0x29')][_0xa0fd('0x45')](_0x399eb1)['then'](handleEntityNotFound(_0x288a8a,null))[_0xa0fd('0x25')](respondWithResult(_0x288a8a,null))[_0xa0fd('0x46')](handleError(_0x288a8a,null));};exports[_0xa0fd('0x47')]=function(_0x210a75,_0x93d528){return db[_0xa0fd('0x29')]['create'](_0x210a75['body'],{})['then'](respondWithResult(_0x93d528,0xc9))[_0xa0fd('0x46')](handleError(_0x93d528,null));};exports['update']=function(_0x4e4ce4,_0xcf725e){if(_0x4e4ce4['body']['id']){delete _0x4e4ce4[_0xa0fd('0x48')]['id'];}return db[_0xa0fd('0x29')]['find']({'where':{'id':_0x4e4ce4['params']['id']}})[_0xa0fd('0x25')](handleEntityNotFound(_0xcf725e,null))[_0xa0fd('0x25')](saveUpdates(_0x4e4ce4[_0xa0fd('0x48')],null))[_0xa0fd('0x25')](respondWithResult(_0xcf725e,null))[_0xa0fd('0x46')](handleError(_0xcf725e,null));};exports[_0xa0fd('0x26')]=function(_0x5268ba,_0x5712f2){return db['Cdr']['find']({'where':{'id':_0x5268ba[_0xa0fd('0x41')]['id']}})[_0xa0fd('0x25')](handleEntityNotFound(_0x5712f2,null))[_0xa0fd('0x25')](removeEntity(_0x5712f2,null))[_0xa0fd('0x46')](handleError(_0x5712f2,null));};exports[_0xa0fd('0x49')]=function(_0x53c1a2,_0x53f51c){return db['Cdr']['describe']()['then'](respondWithResult(_0x53f51c,null))[_0xa0fd('0x46')](handleError(_0x53f51c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 4352d74..ec6839f 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x42d952,_0x1fcf78){var _0x32696b=function(_0xde0c8d){while(--_0xde0c8d){_0x42d952['push'](_0x42d952['shift']());}};_0x32696b(++_0x1fcf78);}(_0x7a54,0x106));var _0x47a5=function(_0x2b8641,_0x37e2f0){_0x2b8641=_0x2b8641-0x0;var _0xec2ba6=_0x7a54[_0x2b8641];return _0xec2ba6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5f4fa9,_0x16d7a8){var _0x257d7f=function(_0x41022f){while(--_0x41022f){_0x5f4fa9['push'](_0x5f4fa9['shift']());}};_0x257d7f(++_0x16d7a8);}(_0x7a54,0x106));var _0x47a5=function(_0x4c0c4d,_0x2fb026){_0x4c0c4d=_0x4c0c4d-0x0;var _0x2f43d0=_0x7a54[_0x4c0c4d];return _0x2f43d0;};'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 fdaa801..b4639df 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 _0x08d9=['then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x16fdb3,_0xb837ab){var _0x51cf6a=function(_0x2950a2){while(--_0x2950a2){_0x16fdb3['push'](_0x16fdb3['shift']());}};_0x51cf6a(++_0xb837ab);}(_0x08d9,0xb2));var _0x908d=function(_0x5bde0e,_0x425cff){_0x5bde0e=_0x5bde0e-0x0;var _0x2c8e62=_0x08d9[_0x5bde0e];return _0x2c8e62;};'use strict';var _=require(_0x908d('0x0'));var util=require(_0x908d('0x1'));var moment=require(_0x908d('0x2'));var BPromise=require(_0x908d('0x3'));var rs=require(_0x908d('0x4'));var fs=require('fs');var Redis=require(_0x908d('0x5'));var db=require(_0x908d('0x6'))['db'];var utils=require(_0x908d('0x7'));var logger=require(_0x908d('0x8'))(_0x908d('0x9'));var config=require('../../config/environment');var jayson=require(_0x908d('0xa'));var client=jayson[_0x908d('0xb')][_0x908d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30fe1b,_0x2f4f1b,_0x397846){return new BPromise(function(_0x20def9,_0x1a0802){return client[_0x908d('0xd')](_0x30fe1b,_0x397846)[_0x908d('0xe')](function(_0x68af12){logger[_0x908d('0xf')](_0x908d('0x10'),_0x2f4f1b,'request\x20sent');logger[_0x908d('0x11')](_0x908d('0x12'),_0x2f4f1b,'request\x20sent',JSON['stringify'](_0x68af12));if(_0x68af12[_0x908d('0x13')]){if(_0x68af12[_0x908d('0x13')][_0x908d('0x14')]===0x1f4){logger['error'](_0x908d('0x10'),_0x2f4f1b,_0x68af12['error'][_0x908d('0x15')]);return _0x1a0802(_0x68af12['error']['message']);}logger['error'](_0x908d('0x10'),_0x2f4f1b,_0x68af12[_0x908d('0x13')][_0x908d('0x15')]);return _0x20def9(_0x68af12[_0x908d('0x13')][_0x908d('0x15')]);}else{logger[_0x908d('0xf')](_0x908d('0x10'),_0x2f4f1b,_0x908d('0x16'));_0x20def9(_0x68af12['result'][_0x908d('0x15')]);}})[_0x908d('0x17')](function(_0x4cfb06){logger['error'](_0x908d('0x10'),_0x2f4f1b,_0x4cfb06);_0x1a0802(_0x4cfb06);});});} \ No newline at end of file +var _0xfd67=['then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xb267b0,_0x5fe22c){var _0xbc1e3b=function(_0x53f855){while(--_0x53f855){_0xb267b0['push'](_0xb267b0['shift']());}};_0xbc1e3b(++_0x5fe22c);}(_0xfd67,0x1d7));var _0x7fd6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfd67[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x7fd6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7fd6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fd6('0x2'));var db=require(_0x7fd6('0x3'))['db'];var utils=require(_0x7fd6('0x4'));var logger=require(_0x7fd6('0x5'))(_0x7fd6('0x6'));var config=require(_0x7fd6('0x7'));var jayson=require(_0x7fd6('0x8'));var client=jayson[_0x7fd6('0x9')][_0x7fd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47150b,_0x266c5f,_0x34969b){return new BPromise(function(_0x7a5ebb,_0x2f04ad){return client[_0x7fd6('0xb')](_0x47150b,_0x34969b)[_0x7fd6('0xc')](function(_0xc544e0){logger[_0x7fd6('0xd')](_0x7fd6('0xe'),_0x266c5f,'request\x20sent');logger[_0x7fd6('0xf')](_0x7fd6('0x10'),_0x266c5f,_0x7fd6('0x11'),JSON['stringify'](_0xc544e0));if(_0xc544e0[_0x7fd6('0x12')]){if(_0xc544e0[_0x7fd6('0x12')][_0x7fd6('0x13')]===0x1f4){logger[_0x7fd6('0x12')](_0x7fd6('0xe'),_0x266c5f,_0xc544e0[_0x7fd6('0x12')][_0x7fd6('0x14')]);return _0x2f04ad(_0xc544e0[_0x7fd6('0x12')][_0x7fd6('0x14')]);}logger['error'](_0x7fd6('0xe'),_0x266c5f,_0xc544e0[_0x7fd6('0x12')][_0x7fd6('0x14')]);return _0x7a5ebb(_0xc544e0['error'][_0x7fd6('0x14')]);}else{logger['info'](_0x7fd6('0xe'),_0x266c5f,'request\x20sent');_0x7a5ebb(_0xc544e0[_0x7fd6('0x15')][_0x7fd6('0x14')]);}})[_0x7fd6('0x16')](function(_0x101566){logger['error'](_0x7fd6('0xe'),_0x266c5f,_0x101566);_0x2f04ad(_0x101566);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1fbcdf6..5a1428b 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19e166,_0x4cc641){var _0x5e6bed=function(_0xb7fce7){while(--_0xb7fce7){_0x19e166['push'](_0x19e166['shift']());}};_0x5e6bed(++_0x4cc641);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 714f9f5..643d6b9 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 _0x7c28=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x7c28,0x11a));var _0x87c2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x7c28[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x87c2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x87c2('0x1')],'allowNull':![],'defaultValue':_0x87c2('0x2')},'appdata':{'type':Sequelize[_0x87c2('0x3')]()},'description':{'type':Sequelize[_0x87c2('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x87c2('0x4')}}; \ No newline at end of file +var _0x65d8=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x43a602,_0x4fe4ef){var _0x5b085c=function(_0xf6f6c4){while(--_0xf6f6c4){_0x43a602['push'](_0x43a602['shift']());}};_0x5b085c(++_0x4fe4ef);}(_0x65d8,0xba));var _0x865d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x65d8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x865d('0x0'));module[_0x865d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x865d('0x2')],'allowNull':![],'defaultValue':_0x865d('0x3')},'appdata':{'type':Sequelize[_0x865d('0x4')]()},'description':{'type':Sequelize[_0x865d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x865d('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 3d41ade..42d8c48 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 _0xaa1b=['bluebird','mustache','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','params','model','ChatApplication','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3f2635,_0x300424){var _0x55a340=function(_0x33b314){while(--_0x33b314){_0x3f2635['push'](_0x3f2635['shift']());}};_0x55a340(++_0x300424);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbaa1('0x0'));var rimraf=require(_0xbaa1('0x1'));var zipdir=require(_0xbaa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbaa1('0x3'));var moment=require('moment');var BPromise=require(_0xbaa1('0x4'));var Mustache=require(_0xbaa1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbaa1('0x6'));var ejs=require(_0xbaa1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaa1('0x8'));var squel=require('squel');var crypto=require(_0xbaa1('0x9'));var jsforce=require(_0xbaa1('0xa'));var deskjs=require(_0xbaa1('0xb'));var toCsv=require(_0xbaa1('0x6'));var querystring=require(_0xbaa1('0xc'));var Papa=require(_0xbaa1('0xd'));var Redis=require('ioredis');var authService=require(_0xbaa1('0xe'));var qs=require(_0xbaa1('0xf'));var as=require(_0xbaa1('0x10'));var hardwareService=require(_0xbaa1('0x11'));var logger=require(_0xbaa1('0x12'))(_0xbaa1('0x13'));var utils=require(_0xbaa1('0x14'));var config=require(_0xbaa1('0x15'));var licenseUtil=require(_0xbaa1('0x16'));var db=require(_0xbaa1('0x17'))['db'];function respondWithStatusCode(_0x8ce72d,_0x1376c6){_0x1376c6=_0x1376c6||0xcc;return function(_0x5064a4){if(_0x5064a4){return _0x8ce72d['sendStatus'](_0x1376c6);}return _0x8ce72d['status'](_0x1376c6)['end']();};}function respondWithResult(_0x2184ab,_0x388cfd){_0x388cfd=_0x388cfd||0xc8;return function(_0x3bfbcc){if(_0x3bfbcc){return _0x2184ab[_0xbaa1('0x18')](_0x388cfd)[_0xbaa1('0x19')](_0x3bfbcc);}};}function respondWithFilteredResult(_0x2e7db5,_0x30f191){return function(_0xdbaa8b){if(_0xdbaa8b){var _0x35a3fd=typeof _0x30f191[_0xbaa1('0x1a')]===_0xbaa1('0x1b')&&typeof _0x30f191[_0xbaa1('0x1c')]===_0xbaa1('0x1b');var _0x16725c=_0xdbaa8b[_0xbaa1('0x1d')];var _0x155a16=_0x35a3fd?0x0:_0x30f191[_0xbaa1('0x1a')];var _0x200f01=_0x35a3fd?_0xdbaa8b[_0xbaa1('0x1d')]:_0x30f191['offset']+_0x30f191[_0xbaa1('0x1c')];var _0x3e3f4a;if(_0x200f01>=_0x16725c){_0x200f01=_0x16725c;_0x3e3f4a=0xc8;}else{_0x3e3f4a=0xce;}_0x2e7db5[_0xbaa1('0x18')](_0x3e3f4a);return _0x2e7db5[_0xbaa1('0x1e')](_0xbaa1('0x1f'),_0x155a16+'-'+_0x200f01+'/'+_0x16725c)[_0xbaa1('0x19')](_0xdbaa8b);}return null;};}function patchUpdates(_0x5c2115){return function(_0x1c587c){try{jsonpatch[_0xbaa1('0x20')](_0x1c587c,_0x5c2115,!![]);}catch(_0x1c38f3){return BPromise[_0xbaa1('0x21')](_0x1c38f3);}return _0x1c587c[_0xbaa1('0x22')]();};}function saveUpdates(_0x5a7d21,_0x4e4a0c){return function(_0x2b01ec){if(_0x2b01ec){return _0x2b01ec[_0xbaa1('0x23')](_0x5a7d21)[_0xbaa1('0x24')](function(_0x34946c){return _0x34946c;});}return null;};}function removeEntity(_0x117079,_0x113bbd){return function(_0x4806e7){if(_0x4806e7){return _0x4806e7[_0xbaa1('0x25')]()[_0xbaa1('0x24')](function(){_0x117079[_0xbaa1('0x18')](0xcc)[_0xbaa1('0x26')]();});}};}function handleEntityNotFound(_0x1204f4,_0x2a56ad){return function(_0x39e3ce){if(!_0x39e3ce){_0x1204f4[_0xbaa1('0x27')](0x194);}return _0x39e3ce;};}function handleError(_0x5f913f,_0x58d85d){_0x58d85d=_0x58d85d||0x1f4;return function(_0x2b80a4){logger[_0xbaa1('0x28')](_0x2b80a4[_0xbaa1('0x29')]);if(_0x2b80a4[_0xbaa1('0x2a')]){delete _0x2b80a4[_0xbaa1('0x2a')];}_0x5f913f[_0xbaa1('0x18')](_0x58d85d)['send'](_0x2b80a4);};}exports['show']=function(_0x18b6d6,_0x1e1869){var _0x270759={'raw':!![],'where':{'id':_0x18b6d6[_0xbaa1('0x2b')]['id']}},_0x48cbc0={};_0x48cbc0[_0xbaa1('0x2c')]=_['keys'](db[_0xbaa1('0x2d')]['rawAttributes']);_0x48cbc0[_0xbaa1('0x2e')]=_[_0xbaa1('0x2f')](_0x18b6d6[_0xbaa1('0x2e')]);_0x48cbc0['filters']=_['intersection'](_0x48cbc0[_0xbaa1('0x2c')],_0x48cbc0[_0xbaa1('0x2e')]);_0x270759[_0xbaa1('0x30')]=_[_0xbaa1('0x31')](_0x48cbc0[_0xbaa1('0x2c')],qs[_0xbaa1('0x32')](_0x18b6d6['query'][_0xbaa1('0x32')]));_0x270759[_0xbaa1('0x30')]=_0x270759[_0xbaa1('0x30')][_0xbaa1('0x33')]?_0x270759['attributes']:_0x48cbc0[_0xbaa1('0x2c')];if(_0x18b6d6['query'][_0xbaa1('0x34')]){_0x270759[_0xbaa1('0x35')]=[{'all':!![]}];}_0x270759=_[_0xbaa1('0x36')]({},_0x270759,_0x18b6d6[_0xbaa1('0x37')]);return db['ChatApplication'][_0xbaa1('0x38')](_0x270759)[_0xbaa1('0x24')](handleEntityNotFound(_0x1e1869,null))[_0xbaa1('0x24')](respondWithResult(_0x1e1869,null))['catch'](handleError(_0x1e1869,null));};exports[_0xbaa1('0x23')]=function(_0x446695,_0x5e093e){if(_0x446695[_0xbaa1('0x39')]['id']){delete _0x446695[_0xbaa1('0x39')]['id'];}return db[_0xbaa1('0x2d')]['find']({'where':{'id':_0x446695[_0xbaa1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5e093e,null))['then'](saveUpdates(_0x446695[_0xbaa1('0x39')],null))['then'](respondWithResult(_0x5e093e,null))[_0xbaa1('0x3a')](handleError(_0x5e093e,null));};exports[_0xbaa1('0x25')]=function(_0x42804c,_0x4f6a48){return db[_0xbaa1('0x2d')][_0xbaa1('0x38')]({'where':{'id':_0x42804c['params']['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x4f6a48,null))[_0xbaa1('0x24')](removeEntity(_0x4f6a48,null))[_0xbaa1('0x3a')](handleError(_0x4f6a48,null));}; \ No newline at end of file +var _0xd73a=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3ae393,_0x27e9b8){var _0x51c512=function(_0x5e1901){while(--_0x5e1901){_0x3ae393['push'](_0x3ae393['shift']());}};_0x51c512(++_0x27e9b8);}(_0xd73a,0x171));var _0xad73=function(_0xc8d57f,_0x286573){_0xc8d57f=_0xc8d57f-0x0;var _0x2e5d1f=_0xd73a[_0xc8d57f];return _0x2e5d1f;};'use strict';var emlformat=require(_0xad73('0x0'));var rimraf=require(_0xad73('0x1'));var zipdir=require(_0xad73('0x2'));var jsonpatch=require(_0xad73('0x3'));var rp=require(_0xad73('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad73('0x5'));var util=require(_0xad73('0x6'));var path=require(_0xad73('0x7'));var sox=require(_0xad73('0x8'));var csv=require(_0xad73('0x9'));var ejs=require(_0xad73('0xa'));var fs=require('fs');var fs_extra=require(_0xad73('0xb'));var _=require(_0xad73('0xc'));var squel=require(_0xad73('0xd'));var crypto=require(_0xad73('0xe'));var jsforce=require(_0xad73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xad73('0x9'));var querystring=require('querystring');var Papa=require(_0xad73('0x10'));var Redis=require(_0xad73('0x11'));var authService=require(_0xad73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xad73('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad73('0x14'))('api');var utils=require(_0xad73('0x15'));var config=require(_0xad73('0x16'));var licenseUtil=require(_0xad73('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1045be,_0x241ff5){_0x241ff5=_0x241ff5||0xcc;return function(_0x488787){if(_0x488787){return _0x1045be[_0xad73('0x18')](_0x241ff5);}return _0x1045be[_0xad73('0x19')](_0x241ff5)[_0xad73('0x1a')]();};}function respondWithResult(_0x27a9d2,_0x15f72d){_0x15f72d=_0x15f72d||0xc8;return function(_0x82fe13){if(_0x82fe13){return _0x27a9d2['status'](_0x15f72d)[_0xad73('0x1b')](_0x82fe13);}};}function respondWithFilteredResult(_0x35c2c5,_0x4336fa){return function(_0x155548){if(_0x155548){var _0x2f0dcd=typeof _0x4336fa[_0xad73('0x1c')]===_0xad73('0x1d')&&typeof _0x4336fa[_0xad73('0x1e')]===_0xad73('0x1d');var _0xad072c=_0x155548['count'];var _0x47381a=_0x2f0dcd?0x0:_0x4336fa['offset'];var _0x5bd242=_0x2f0dcd?_0x155548[_0xad73('0x1f')]:_0x4336fa[_0xad73('0x1c')]+_0x4336fa[_0xad73('0x1e')];var _0x578068;if(_0x5bd242>=_0xad072c){_0x5bd242=_0xad072c;_0x578068=0xc8;}else{_0x578068=0xce;}_0x35c2c5[_0xad73('0x19')](_0x578068);return _0x35c2c5[_0xad73('0x20')]('Content-Range',_0x47381a+'-'+_0x5bd242+'/'+_0xad072c)[_0xad73('0x1b')](_0x155548);}return null;};}function patchUpdates(_0x4289df){return function(_0x3e02ed){try{jsonpatch[_0xad73('0x21')](_0x3e02ed,_0x4289df,!![]);}catch(_0x2e6cdb){return BPromise[_0xad73('0x22')](_0x2e6cdb);}return _0x3e02ed[_0xad73('0x23')]();};}function saveUpdates(_0x497c3d,_0xfe2758){return function(_0x31f5c4){if(_0x31f5c4){return _0x31f5c4[_0xad73('0x24')](_0x497c3d)[_0xad73('0x25')](function(_0xb3e0b0){return _0xb3e0b0;});}return null;};}function removeEntity(_0x2a1295,_0xbfb297){return function(_0x439f09){if(_0x439f09){return _0x439f09[_0xad73('0x26')]()[_0xad73('0x25')](function(){_0x2a1295[_0xad73('0x19')](0xcc)[_0xad73('0x1a')]();});}};}function handleEntityNotFound(_0x182805,_0xfec523){return function(_0x1b7d84){if(!_0x1b7d84){_0x182805[_0xad73('0x18')](0x194);}return _0x1b7d84;};}function handleError(_0x34f8c4,_0x920ffc){_0x920ffc=_0x920ffc||0x1f4;return function(_0xb7700c){logger[_0xad73('0x27')](_0xb7700c['stack']);if(_0xb7700c['name']){delete _0xb7700c['name'];}_0x34f8c4[_0xad73('0x19')](_0x920ffc)[_0xad73('0x28')](_0xb7700c);};}exports['show']=function(_0x3f1f80,_0x54a8f9){var _0x54eadc={'raw':!![],'where':{'id':_0x3f1f80[_0xad73('0x29')]['id']}},_0x1f826c={};_0x1f826c[_0xad73('0x2a')]=_[_0xad73('0x2b')](db['ChatApplication'][_0xad73('0x2c')]);_0x1f826c[_0xad73('0x2d')]=_[_0xad73('0x2b')](_0x3f1f80['query']);_0x1f826c[_0xad73('0x2e')]=_[_0xad73('0x2f')](_0x1f826c[_0xad73('0x2a')],_0x1f826c[_0xad73('0x2d')]);_0x54eadc[_0xad73('0x30')]=_['intersection'](_0x1f826c['model'],qs['fields'](_0x3f1f80[_0xad73('0x2d')]['fields']));_0x54eadc[_0xad73('0x30')]=_0x54eadc['attributes'][_0xad73('0x31')]?_0x54eadc[_0xad73('0x30')]:_0x1f826c['model'];if(_0x3f1f80['query'][_0xad73('0x32')]){_0x54eadc[_0xad73('0x33')]=[{'all':!![]}];}_0x54eadc=_['merge']({},_0x54eadc,_0x3f1f80['options']);return db[_0xad73('0x34')]['find'](_0x54eadc)[_0xad73('0x25')](handleEntityNotFound(_0x54a8f9,null))[_0xad73('0x25')](respondWithResult(_0x54a8f9,null))['catch'](handleError(_0x54a8f9,null));};exports[_0xad73('0x24')]=function(_0x52518c,_0x33d874){if(_0x52518c[_0xad73('0x35')]['id']){delete _0x52518c[_0xad73('0x35')]['id'];}return db[_0xad73('0x34')][_0xad73('0x36')]({'where':{'id':_0x52518c[_0xad73('0x29')]['id']}})[_0xad73('0x25')](handleEntityNotFound(_0x33d874,null))[_0xad73('0x25')](saveUpdates(_0x52518c[_0xad73('0x35')],null))['then'](respondWithResult(_0x33d874,null))[_0xad73('0x37')](handleError(_0x33d874,null));};exports[_0xad73('0x26')]=function(_0x52169f,_0x221d3d){return db[_0xad73('0x34')][_0xad73('0x36')]({'where':{'id':_0x52169f[_0xad73('0x29')]['id']}})[_0xad73('0x25')](handleEntityNotFound(_0x221d3d,null))[_0xad73('0x25')](removeEntity(_0x221d3d,null))[_0xad73('0x37')](handleError(_0x221d3d,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 437a3ce..36f3834 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 _0xd2ea=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xbbc90c,_0x47572a){var _0x2f4106=function(_0x1848fe){while(--_0x1848fe){_0xbbc90c['push'](_0xbbc90c['shift']());}};_0x2f4106(++_0x47572a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2fbda7,_0x430470){_0x2fbda7=_0x2fbda7-0x0;var _0x387e9d=_0xd2ea[_0x2fbda7];return _0x387e9d;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad2e('0xe')});}; \ No newline at end of file +var _0x6adb=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x6adb,0x134));var _0xb6ad=function(_0x5611b6,_0x159cef){_0x5611b6=_0x5611b6-0x0;var _0x5e3f5b=_0x6adb[_0x5611b6];return _0x5e3f5b;};'use strict';var _=require('lodash');var util=require(_0xb6ad('0x0'));var logger=require(_0xb6ad('0x1'))(_0xb6ad('0x2'));var moment=require(_0xb6ad('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6ad('0x4'));var rimraf=require(_0xb6ad('0x5'));var config=require(_0xb6ad('0x6'));var attributes=require(_0xb6ad('0x7'));module[_0xb6ad('0x8')]=function(_0x303d03,_0x301efb){return _0x303d03[_0xb6ad('0x9')](_0xb6ad('0xa'),attributes,{'tableName':_0xb6ad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb6ad('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 4bca592..d740d82 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 _0x942a=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x942a,0x1ca));var _0xa942=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x942a[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xa942('0x0'));var util=require(_0xa942('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa942('0x2'))['db'];var utils=require(_0xa942('0x3'));var logger=require('../../config/logger')(_0xa942('0x4'));var config=require(_0xa942('0x5'));var jayson=require(_0xa942('0x6'));var client=jayson[_0xa942('0x7')][_0xa942('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36ca8b,_0x53955f,_0x48ade5){return new BPromise(function(_0x55bd68,_0x249238){return client[_0xa942('0x9')](_0x36ca8b,_0x48ade5)['then'](function(_0x266b36){logger[_0xa942('0xa')]('ChatApplication,\x20%s,\x20%s',_0x53955f,_0xa942('0xb'));logger[_0xa942('0xc')](_0xa942('0xd'),_0x53955f,_0xa942('0xb'),JSON[_0xa942('0xe')](_0x266b36));if(_0x266b36[_0xa942('0xf')]){if(_0x266b36[_0xa942('0xf')][_0xa942('0x10')]===0x1f4){logger[_0xa942('0xf')](_0xa942('0x11'),_0x53955f,_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);return _0x249238(_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);}logger[_0xa942('0xf')](_0xa942('0x11'),_0x53955f,_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);return _0x55bd68(_0x266b36[_0xa942('0xf')][_0xa942('0x12')]);}else{logger['info'](_0xa942('0x11'),_0x53955f,_0xa942('0xb'));_0x55bd68(_0x266b36[_0xa942('0x13')][_0xa942('0x12')]);}})[_0xa942('0x14')](function(_0x3abe36){logger[_0xa942('0xf')](_0xa942('0x11'),_0x53955f,_0x3abe36);_0x249238(_0x3abe36);});});} \ No newline at end of file +var _0x0ba5=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x0ba5,0xd9));var _0x50ba=function(_0x435117,_0x2b9bad){_0x435117=_0x435117-0x0;var _0x585a63=_0x0ba5[_0x435117];return _0x585a63;};'use strict';var _=require(_0x50ba('0x0'));var util=require(_0x50ba('0x1'));var moment=require(_0x50ba('0x2'));var BPromise=require(_0x50ba('0x3'));var rs=require(_0x50ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50ba('0x5'))['db'];var utils=require(_0x50ba('0x6'));var logger=require('../../config/logger')(_0x50ba('0x7'));var config=require(_0x50ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x50ba('0x9')][_0x50ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d1f01,_0x922b9,_0x1dfc6c){return new BPromise(function(_0x2c2654,_0x24fe8e){return client[_0x50ba('0xb')](_0x4d1f01,_0x1dfc6c)[_0x50ba('0xc')](function(_0x17d416){logger[_0x50ba('0xd')](_0x50ba('0xe'),_0x922b9,_0x50ba('0xf'));logger[_0x50ba('0x10')](_0x50ba('0x11'),_0x922b9,_0x50ba('0xf'),JSON[_0x50ba('0x12')](_0x17d416));if(_0x17d416[_0x50ba('0x13')]){if(_0x17d416[_0x50ba('0x13')][_0x50ba('0x14')]===0x1f4){logger[_0x50ba('0x13')](_0x50ba('0xe'),_0x922b9,_0x17d416['error']['message']);return _0x24fe8e(_0x17d416[_0x50ba('0x13')]['message']);}logger['error'](_0x50ba('0xe'),_0x922b9,_0x17d416['error'][_0x50ba('0x15')]);return _0x2c2654(_0x17d416[_0x50ba('0x13')][_0x50ba('0x15')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x922b9,_0x50ba('0xf'));_0x2c2654(_0x17d416[_0x50ba('0x16')][_0x50ba('0x15')]);}})[_0x50ba('0x17')](function(_0x589347){logger[_0x50ba('0x13')]('ChatApplication,\x20%s,\x20%s',_0x922b9,_0x589347);_0x24fe8e(_0x589347);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index d8b1d22..7ee7485 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 _0x23cc=['util','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x137863,_0x25fa28){var _0x3e9639=function(_0x56300a){while(--_0x56300a){_0x137863['push'](_0x137863['shift']());}};_0x3e9639(++_0x25fa28);}(_0x23cc,0x180));var _0xc23c=function(_0x5a2389,_0x376a45){_0x5a2389=_0x5a2389-0x0;var _0xc70f4a=_0x23cc[_0x5a2389];return _0xc70f4a;};'use strict';var multer=require('multer');var util=require(_0xc23c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc23c('0x1'));var router=express[_0xc23c('0x2')]();var fs_extra=require(_0xc23c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc23c('0x4'));var config=require('../../config/environment');var controller=require(_0xc23c('0x5'));router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc23c('0x6')](_0xc23c('0x7'),auth[_0xc23c('0x8')](),controller[_0xc23c('0x9')]);router[_0xc23c('0xa')]('/:id',auth[_0xc23c('0x8')](),controller[_0xc23c('0xb')]);module['exports']=router; \ No newline at end of file +var _0x668d=['show','put','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x8b8be1,_0x5cbe7c){var _0x424735=function(_0x57adf6){while(--_0x57adf6){_0x8b8be1['push'](_0x8b8be1['shift']());}};_0x424735(++_0x5cbe7c);}(_0x668d,0x113));var _0xd668=function(_0x23666e,_0x3a73a8){_0x23666e=_0x23666e-0x0;var _0x308fd8=_0x668d[_0x23666e];return _0x308fd8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd668('0x0'));var timeout=require('connect-timeout');var express=require(_0xd668('0x1'));var router=express['Router']();var fs_extra=require(_0xd668('0x2'));var auth=require(_0xd668('0x3'));var interaction=require(_0xd668('0x4'));var config=require(_0xd668('0x5'));var controller=require(_0xd668('0x6'));router[_0xd668('0x7')](_0xd668('0x8'),auth[_0xd668('0x9')](),controller[_0xd668('0xa')]);router[_0xd668('0xb')](_0xd668('0x8'),auth[_0xd668('0x9')](),controller['update']);router[_0xd668('0xc')](_0xd668('0x8'),auth['isAuthenticated'](),controller[_0xd668('0xd')]);module[_0xd668('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 1f27ea6..4827f7e 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 _0x59f2=['STRING'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x59f2,0xb3));var _0x259f=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x59f2[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x259f('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x0213=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2382fb,_0x4ded71){var _0x3a90b1=function(_0xe937f0){while(--_0xe937f0){_0x2382fb['push'](_0x2382fb['shift']());}};_0x3a90b1(++_0x4ded71);}(_0x0213,0x105));var _0x3021=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x0213[_0x71b765];return _0x34cb24;};'use strict';var Sequelize=require(_0x3021('0x0'));module[_0x3021('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3021('0x2')]},'write':{'type':Sequelize[_0x3021('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index ae3f73a..aa382fe 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 _0xa186=['rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','include','findAll','show','params','options','catch','create','body','find','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','fields','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x38b1fe,_0x53aedb){var _0x1b3f86=function(_0x2d4112){while(--_0x2d4112){_0x38b1fe['push'](_0x38b1fe['shift']());}};_0x1b3f86(++_0x53aedb);}(_0xa186,0xf1));var _0x6a18=function(_0x4bbe48,_0x56a57a){_0x4bbe48=_0x4bbe48-0x0;var _0x279b5a=_0xa186[_0x4bbe48];return _0x279b5a;};'use strict';var emlformat=require(_0x6a18('0x0'));var rimraf=require(_0x6a18('0x1'));var zipdir=require(_0x6a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a18('0x4'));var util=require(_0x6a18('0x5'));var path=require(_0x6a18('0x6'));var sox=require(_0x6a18('0x7'));var csv=require(_0x6a18('0x8'));var ejs=require(_0x6a18('0x9'));var fs=require('fs');var fs_extra=require(_0x6a18('0xa'));var _=require(_0x6a18('0xb'));var squel=require(_0x6a18('0xc'));var crypto=require(_0x6a18('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6a18('0xe'));var toCsv=require(_0x6a18('0x8'));var querystring=require(_0x6a18('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a18('0x10'));var qs=require(_0x6a18('0x11'));var as=require(_0x6a18('0x12'));var hardwareService=require(_0x6a18('0x13'));var logger=require(_0x6a18('0x14'))(_0x6a18('0x15'));var utils=require(_0x6a18('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a18('0x17'))['db'];config[_0x6a18('0x18')]=_[_0x6a18('0x19')](config['redis'],{'host':_0x6a18('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a18('0x1b'))[_0x6a18('0x1c')](socket);function respondWithStatusCode(_0x479814,_0x32a94b){_0x32a94b=_0x32a94b||0xcc;return function(_0x1de975){if(_0x1de975){return _0x479814[_0x6a18('0x1d')](_0x32a94b);}return _0x479814[_0x6a18('0x1e')](_0x32a94b)[_0x6a18('0x1f')]();};}function respondWithResult(_0x6e570e,_0x540996){_0x540996=_0x540996||0xc8;return function(_0xdd9b40){if(_0xdd9b40){return _0x6e570e['status'](_0x540996)[_0x6a18('0x20')](_0xdd9b40);}};}function respondWithFilteredResult(_0x50207e,_0x593a67){return function(_0x4c4cba){if(_0x4c4cba){var _0x296068=typeof _0x593a67[_0x6a18('0x21')]==='undefined'&&typeof _0x593a67[_0x6a18('0x22')]==='undefined';var _0x2feb5c=_0x4c4cba[_0x6a18('0x23')];var _0x3c3ab1=_0x296068?0x0:_0x593a67['offset'];var _0xfacf04=_0x296068?_0x4c4cba[_0x6a18('0x23')]:_0x593a67[_0x6a18('0x21')]+_0x593a67[_0x6a18('0x22')];var _0x5766ec;if(_0xfacf04>=_0x2feb5c){_0xfacf04=_0x2feb5c;_0x5766ec=0xc8;}else{_0x5766ec=0xce;}_0x50207e[_0x6a18('0x1e')](_0x5766ec);return _0x50207e['set'](_0x6a18('0x24'),_0x3c3ab1+'-'+_0xfacf04+'/'+_0x2feb5c)[_0x6a18('0x20')](_0x4c4cba);}return null;};}function patchUpdates(_0x4e8316){return function(_0xdd33ac){try{jsonpatch[_0x6a18('0x25')](_0xdd33ac,_0x4e8316,!![]);}catch(_0x528c46){return BPromise[_0x6a18('0x26')](_0x528c46);}return _0xdd33ac[_0x6a18('0x27')]();};}function saveUpdates(_0x43286f,_0x419f99){return function(_0x4a9e7a){if(_0x4a9e7a){return _0x4a9e7a[_0x6a18('0x28')](_0x43286f)[_0x6a18('0x29')](function(_0x4240fd){return _0x4240fd;});}return null;};}function removeEntity(_0x31042b,_0x443fdd){return function(_0x11db7c){if(_0x11db7c){return _0x11db7c[_0x6a18('0x2a')]()[_0x6a18('0x29')](function(){_0x31042b[_0x6a18('0x1e')](0xcc)[_0x6a18('0x1f')]();});}};}function handleEntityNotFound(_0x5dfad3,_0x464637){return function(_0x58b31b){if(!_0x58b31b){_0x5dfad3['sendStatus'](0x194);}return _0x58b31b;};}function handleError(_0x15a4aa,_0x194ab8){_0x194ab8=_0x194ab8||0x1f4;return function(_0x1fd0eb){logger['error'](_0x1fd0eb[_0x6a18('0x2b')]);if(_0x1fd0eb[_0x6a18('0x2c')]){delete _0x1fd0eb[_0x6a18('0x2c')];}_0x15a4aa[_0x6a18('0x1e')](_0x194ab8)[_0x6a18('0x2d')](_0x1fd0eb);};}exports[_0x6a18('0x2e')]=function(_0x560482,_0x1701bd){var _0x48a1d7={},_0x8b20f8={},_0x22c1fc={'count':0x0,'rows':[]};var _0x4f703b=_['map'](db['ChatGroup'][_0x6a18('0x2f')],function(_0x8bb678){return{'name':_0x8bb678[_0x6a18('0x30')],'type':_0x8bb678[_0x6a18('0x31')][_0x6a18('0x32')]};});_0x8b20f8[_0x6a18('0x33')]=_[_0x6a18('0x34')](_0x4f703b,_0x6a18('0x2c'));_0x8b20f8[_0x6a18('0x35')]=_[_0x6a18('0x36')](_0x560482[_0x6a18('0x35')]);_0x8b20f8['filters']=_[_0x6a18('0x37')](_0x8b20f8[_0x6a18('0x33')],_0x8b20f8[_0x6a18('0x35')]);_0x48a1d7[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0x8b20f8[_0x6a18('0x33')],qs['fields'](_0x560482[_0x6a18('0x35')]['fields']));_0x48a1d7[_0x6a18('0x38')]=_0x48a1d7[_0x6a18('0x38')][_0x6a18('0x39')]?_0x48a1d7[_0x6a18('0x38')]:_0x8b20f8['model'];if(!_0x560482[_0x6a18('0x35')][_0x6a18('0x3a')](_0x6a18('0x3b'))){_0x48a1d7[_0x6a18('0x22')]=qs[_0x6a18('0x22')](_0x560482['query'][_0x6a18('0x22')]);_0x48a1d7[_0x6a18('0x21')]=qs['offset'](_0x560482[_0x6a18('0x35')]['offset']);}_0x48a1d7[_0x6a18('0x3c')]=qs[_0x6a18('0x3d')](_0x560482[_0x6a18('0x35')][_0x6a18('0x3d')]);_0x48a1d7[_0x6a18('0x3e')]=qs[_0x6a18('0x3f')](_[_0x6a18('0x40')](_0x560482['query'],_0x8b20f8['filters']),_0x4f703b);if(_0x560482['query'][_0x6a18('0x41')]){_0x48a1d7[_0x6a18('0x3e')]=_[_0x6a18('0x42')](_0x48a1d7[_0x6a18('0x3e')],{'$or':_['map'](_0x4f703b,function(_0x4f1d43){if(_0x4f1d43['type']!==_0x6a18('0x43')){var _0x172459={};_0x172459[_0x4f1d43[_0x6a18('0x2c')]]={'$like':'%'+_0x560482['query'][_0x6a18('0x41')]+'%'};return _0x172459;}})});}_0x48a1d7=_['merge']({},_0x48a1d7,_0x560482['options']);var _0x141b8a={'where':_0x48a1d7[_0x6a18('0x3e')]};return db[_0x6a18('0x44')]['count'](_0x141b8a)[_0x6a18('0x29')](function(_0x592688){_0x22c1fc['count']=_0x592688;if(_0x560482[_0x6a18('0x35')][_0x6a18('0x45')]){_0x48a1d7[_0x6a18('0x46')]=[{'all':!![]}];}return db[_0x6a18('0x44')][_0x6a18('0x47')](_0x48a1d7);})['then'](function(_0x152f5c){_0x22c1fc['rows']=_0x152f5c;return _0x22c1fc;})[_0x6a18('0x29')](respondWithFilteredResult(_0x1701bd,_0x48a1d7))['catch'](handleError(_0x1701bd,null));};exports[_0x6a18('0x48')]=function(_0x5a7382,_0xfa001f){var _0x506a06={'raw':!![],'where':{'id':_0x5a7382[_0x6a18('0x49')]['id']}},_0x389c10={};_0x389c10['model']=_[_0x6a18('0x36')](db[_0x6a18('0x44')][_0x6a18('0x2f')]);_0x389c10[_0x6a18('0x35')]=_['keys'](_0x5a7382[_0x6a18('0x35')]);_0x389c10[_0x6a18('0x3f')]=_['intersection'](_0x389c10['model'],_0x389c10[_0x6a18('0x35')]);_0x506a06[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0x389c10[_0x6a18('0x33')],qs['fields'](_0x5a7382['query']['fields']));_0x506a06[_0x6a18('0x38')]=_0x506a06[_0x6a18('0x38')][_0x6a18('0x39')]?_0x506a06[_0x6a18('0x38')]:_0x389c10[_0x6a18('0x33')];if(_0x5a7382[_0x6a18('0x35')]['includeAll']){_0x506a06[_0x6a18('0x46')]=[{'all':!![]}];}_0x506a06=_[_0x6a18('0x42')]({},_0x506a06,_0x5a7382[_0x6a18('0x4a')]);return db[_0x6a18('0x44')]['find'](_0x506a06)[_0x6a18('0x29')](handleEntityNotFound(_0xfa001f,null))[_0x6a18('0x29')](respondWithResult(_0xfa001f,null))[_0x6a18('0x4b')](handleError(_0xfa001f,null));};exports[_0x6a18('0x4c')]=function(_0x19082a,_0x1efa7a){return db[_0x6a18('0x44')][_0x6a18('0x4c')](_0x19082a[_0x6a18('0x4d')],{})['then'](respondWithResult(_0x1efa7a,0xc9))['catch'](handleError(_0x1efa7a,null));};exports['update']=function(_0x5aead9,_0xc3c5f3){if(_0x5aead9[_0x6a18('0x4d')]['id']){delete _0x5aead9[_0x6a18('0x4d')]['id'];}return db[_0x6a18('0x44')]['find']({'where':{'id':_0x5aead9[_0x6a18('0x49')]['id']}})['then'](handleEntityNotFound(_0xc3c5f3,null))[_0x6a18('0x29')](saveUpdates(_0x5aead9[_0x6a18('0x4d')],null))[_0x6a18('0x29')](respondWithResult(_0xc3c5f3,null))['catch'](handleError(_0xc3c5f3,null));};exports[_0x6a18('0x2a')]=function(_0xe18c8a,_0x735183){return db['ChatGroup'][_0x6a18('0x4e')]({'where':{'id':_0xe18c8a[_0x6a18('0x49')]['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x735183,null))[_0x6a18('0x29')](removeEntity(_0x735183,null))[_0x6a18('0x4b')](handleError(_0x735183,null));};exports[_0x6a18('0x4f')]=function(_0x3021f1,_0x29112e){return db[_0x6a18('0x44')][_0x6a18('0x4f')]()[_0x6a18('0x29')](respondWithResult(_0x29112e,null))[_0x6a18('0x4b')](handleError(_0x29112e,null));};exports['getUnread']=function(_0x2e0dae,_0x38c26c,_0x5a7b70){return db[_0x6a18('0x50')]['count']({'where':{'ChatGroupId':_0x2e0dae[_0x6a18('0x49')]['id'],'ToId':_0x2e0dae[_0x6a18('0x51')]['id'],'read':![]}})[_0x6a18('0x29')](function(_0x36755f){return{'id':_['toInteger'](_0x2e0dae['params']['id']),'count':_0x36755f};})[_0x6a18('0x29')](respondWithResult(_0x38c26c,null))[_0x6a18('0x4b')](handleError(_0x38c26c,null));};exports[_0x6a18('0x52')]=function(_0xb29ad9,_0x53c2fd,_0x33f572){return db[_0x6a18('0x44')]['find']({'where':{'id':_0xb29ad9[_0x6a18('0x49')]['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x53c2fd,null))[_0x6a18('0x29')](function(_0x4d5bc3){if(_0x4d5bc3){return _0x4d5bc3[_0x6a18('0x52')](_0xb29ad9['body'][_0x6a18('0x53')],_[_0x6a18('0x54')](_0xb29ad9[_0x6a18('0x4d')],['ids','id'])||{});}})[_0x6a18('0x29')](respondWithResult(_0x53c2fd,null))[_0x6a18('0x4b')](handleError(_0x53c2fd,null));};exports[_0x6a18('0x55')]=function(_0x3833b2,_0x57f79e,_0x2ee56d){var _0x2b2726={};var _0xf82666={};var _0x58047c;var _0x49ff04;return db['ChatGroup'][_0x6a18('0x56')]({'where':{'id':_0x3833b2['params']['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x57f79e,null))['then'](function(_0x1b8799){if(_0x1b8799){_0x58047c=_0x1b8799;_0xf82666[_0x6a18('0x33')]=_['keys'](db[_0x6a18('0x57')][_0x6a18('0x2f')]);_0xf82666['query']=_[_0x6a18('0x36')](_0x3833b2['query']);_0xf82666[_0x6a18('0x3f')]=_[_0x6a18('0x37')](_0xf82666['model'],_0xf82666[_0x6a18('0x35')]);_0x2b2726[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0xf82666[_0x6a18('0x33')],qs[_0x6a18('0x58')](_0x3833b2[_0x6a18('0x35')][_0x6a18('0x58')]));_0x2b2726[_0x6a18('0x38')]=_0x2b2726[_0x6a18('0x38')]['length']?_0x2b2726[_0x6a18('0x38')]:_0xf82666[_0x6a18('0x33')];_0x2b2726[_0x6a18('0x3c')]=qs['sort'](_0x3833b2[_0x6a18('0x35')][_0x6a18('0x3d')]);_0x2b2726[_0x6a18('0x3e')]=qs[_0x6a18('0x3f')](_[_0x6a18('0x40')](_0x3833b2['query'],_0xf82666[_0x6a18('0x3f')]));if(_0x3833b2[_0x6a18('0x35')][_0x6a18('0x41')]){_0x2b2726['where']=_[_0x6a18('0x42')](_0x2b2726['where'],{'$or':_[_0x6a18('0x34')](_0x2b2726[_0x6a18('0x38')],function(_0x4ce1e8){var _0xf1c1aa={};_0xf1c1aa[_0x4ce1e8]={'$like':'%'+_0x3833b2[_0x6a18('0x35')]['filter']+'%'};return _0xf1c1aa;})});}_0x2b2726=_['merge']({},_0x2b2726,_0x3833b2['options']);return _0x58047c['getMembers'](_0x2b2726);}})[_0x6a18('0x29')](function(_0x5a4324){if(_0x5a4324){_0x49ff04=_0x5a4324[_0x6a18('0x39')];if(!_0x3833b2[_0x6a18('0x35')][_0x6a18('0x3a')](_0x6a18('0x3b'))){_0x2b2726[_0x6a18('0x22')]=qs[_0x6a18('0x22')](_0x3833b2[_0x6a18('0x35')][_0x6a18('0x22')]);_0x2b2726[_0x6a18('0x21')]=qs[_0x6a18('0x21')](_0x3833b2['query'][_0x6a18('0x21')]);}return _0x58047c[_0x6a18('0x55')](_0x2b2726);}})[_0x6a18('0x29')](function(_0x2e5722){if(_0x2e5722){return _0x2e5722?{'count':_0x49ff04,'rows':_0x2e5722}:null;}})[_0x6a18('0x29')](respondWithResult(_0x57f79e,null))['catch'](handleError(_0x57f79e,null));};exports['removeMembers']=function(_0x504a2e,_0x510e62,_0x4b9aae){return db[_0x6a18('0x44')][_0x6a18('0x4e')]({'where':{'id':_0x504a2e['params']['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x510e62,null))[_0x6a18('0x29')](function(_0x4c8e7f){if(_0x4c8e7f){return _0x4c8e7f[_0x6a18('0x59')](_0x504a2e[_0x6a18('0x35')][_0x6a18('0x53')]);}})[_0x6a18('0x29')](respondWithStatusCode(_0x510e62,null))[_0x6a18('0x4b')](handleError(_0x510e62,null));};exports['addMessage']=function(_0x5bdcf8,_0x1a732a,_0x1832f2){if(_0x5bdcf8[_0x6a18('0x4d')]['id']){delete _0x5bdcf8[_0x6a18('0x4d')]['id'];}return db[_0x6a18('0x44')]['find']({'where':{'id':_0x5bdcf8[_0x6a18('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a732a,null))[_0x6a18('0x29')](function(_0x3b0a13){if(_0x3b0a13){_0x5bdcf8[_0x6a18('0x4d')][_0x6a18('0x5a')]=_0x3b0a13['id'];return db['ChatInternalMessage'][_0x6a18('0x4c')](_0x5bdcf8['body']);}})[_0x6a18('0x29')](respondWithResult(_0x1a732a,null))['catch'](handleError(_0x1a732a,null));};exports['getMessages']=function(_0x3be920,_0x501e14,_0x643d2b){var _0x55288c={};var _0x5d7399={};var _0x475fe7;var _0x1255d0;return db['ChatGroup'][_0x6a18('0x56')]({'where':{'id':_0x3be920[_0x6a18('0x49')]['id']}})[_0x6a18('0x29')](handleEntityNotFound(_0x501e14,null))['then'](function(_0xba79c8){if(_0xba79c8){_0x475fe7=_0xba79c8;_0x5d7399[_0x6a18('0x33')]=_[_0x6a18('0x36')](db[_0x6a18('0x50')][_0x6a18('0x2f')]);_0x5d7399[_0x6a18('0x35')]=_[_0x6a18('0x36')](_0x3be920[_0x6a18('0x35')]);_0x5d7399[_0x6a18('0x3f')]=_['intersection'](_0x5d7399['model'],_0x5d7399[_0x6a18('0x35')]);_0x55288c[_0x6a18('0x38')]=_[_0x6a18('0x37')](_0x5d7399[_0x6a18('0x33')],qs[_0x6a18('0x58')](_0x3be920[_0x6a18('0x35')][_0x6a18('0x58')]));_0x55288c[_0x6a18('0x38')]=_0x55288c['attributes'][_0x6a18('0x39')]?_0x55288c['attributes']:_0x5d7399[_0x6a18('0x33')];_0x55288c['order']=qs[_0x6a18('0x3d')](_0x3be920[_0x6a18('0x35')][_0x6a18('0x3d')]);_0x55288c['where']=qs[_0x6a18('0x3f')](_[_0x6a18('0x40')](_0x3be920[_0x6a18('0x35')],_0x5d7399[_0x6a18('0x3f')]));if(_0x3be920[_0x6a18('0x35')][_0x6a18('0x41')]){_0x55288c['where']=_[_0x6a18('0x42')](_0x55288c[_0x6a18('0x3e')],{'$or':_[_0x6a18('0x34')](_0x55288c[_0x6a18('0x38')],function(_0x206c02){var _0x30007d={};_0x30007d[_0x206c02]={'$like':'%'+_0x3be920[_0x6a18('0x35')]['filter']+'%'};return _0x30007d;})});}if(_0x3be920['query'][_0x6a18('0x5b')]){var _0x4268a8=_0x3be920[_0x6a18('0x35')]['$gte'][_0x6a18('0x5c')](',');var _0xc22da1={};_0xc22da1[_0x4268a8[0x0]]={'$gte':moment(_0x4268a8[0x1])[_0x6a18('0x5d')](_0x6a18('0x5e'))};_0x55288c['where']=_[_0x6a18('0x42')](_0x55288c['where'],_0xc22da1);}_0x55288c=_['merge']({},_0x55288c,_0x3be920[_0x6a18('0x4a')]);return _0x475fe7['getMessages'](_0x55288c);}})[_0x6a18('0x29')](function(_0x1adafc){if(_0x1adafc){_0x1255d0=_0x1adafc[_0x6a18('0x39')];if(!_0x3be920[_0x6a18('0x35')][_0x6a18('0x3a')](_0x6a18('0x3b'))){_0x55288c['limit']=qs['limit'](_0x3be920[_0x6a18('0x35')][_0x6a18('0x22')]);_0x55288c[_0x6a18('0x21')]=qs[_0x6a18('0x21')](_0x3be920[_0x6a18('0x35')][_0x6a18('0x21')]);}return _0x475fe7[_0x6a18('0x5f')](_0x55288c);}})['then'](function(_0x5d8438){if(_0x5d8438){return _0x5d8438?{'count':_0x1255d0,'rows':_0x5d8438}:null;}})[_0x6a18('0x29')](respondWithResult(_0x501e14,null))[_0x6a18('0x4b')](handleError(_0x501e14,null));}; \ No newline at end of file +var _0xf9c6=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','then','catch','show','params','include','merge','find','create','body','describe','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1679cc,_0x242c53){var _0x4aaec8=function(_0x303c5f){while(--_0x303c5f){_0x1679cc['push'](_0x1679cc['shift']());}};_0x4aaec8(++_0x242c53);}(_0xf9c6,0x117));var _0x6f9c=function(_0x4f4b6f,_0x36f7ad){_0x4f4b6f=_0x4f4b6f-0x0;var _0x3bb63c=_0xf9c6[_0x4f4b6f];return _0x3bb63c;};'use strict';var emlformat=require(_0x6f9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f9c('0x1'));var jsonpatch=require(_0x6f9c('0x2'));var rp=require(_0x6f9c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6f9c('0x4'));var util=require(_0x6f9c('0x5'));var path=require('path');var sox=require(_0x6f9c('0x6'));var csv=require(_0x6f9c('0x7'));var ejs=require(_0x6f9c('0x8'));var fs=require('fs');var fs_extra=require(_0x6f9c('0x9'));var _=require(_0x6f9c('0xa'));var squel=require(_0x6f9c('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f9c('0xc'));var deskjs=require(_0x6f9c('0xd'));var toCsv=require(_0x6f9c('0x7'));var querystring=require('querystring');var Papa=require(_0x6f9c('0xe'));var Redis=require(_0x6f9c('0xf'));var authService=require(_0x6f9c('0x10'));var qs=require(_0x6f9c('0x11'));var as=require(_0x6f9c('0x12'));var hardwareService=require(_0x6f9c('0x13'));var logger=require(_0x6f9c('0x14'))(_0x6f9c('0x15'));var utils=require(_0x6f9c('0x16'));var config=require(_0x6f9c('0x17'));var licenseUtil=require(_0x6f9c('0x18'));var db=require('../../mysqldb')['db'];config[_0x6f9c('0x19')]=_[_0x6f9c('0x1a')](config[_0x6f9c('0x19')],{'host':_0x6f9c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f9c('0x19')]));require(_0x6f9c('0x1c'))[_0x6f9c('0x1d')](socket);function respondWithStatusCode(_0x47a494,_0x16d120){_0x16d120=_0x16d120||0xcc;return function(_0x29a773){if(_0x29a773){return _0x47a494[_0x6f9c('0x1e')](_0x16d120);}return _0x47a494[_0x6f9c('0x1f')](_0x16d120)[_0x6f9c('0x20')]();};}function respondWithResult(_0x350a3a,_0x41bc74){_0x41bc74=_0x41bc74||0xc8;return function(_0x52151b){if(_0x52151b){return _0x350a3a[_0x6f9c('0x1f')](_0x41bc74)[_0x6f9c('0x21')](_0x52151b);}};}function respondWithFilteredResult(_0x25a0fe,_0xa7a9ec){return function(_0x2dc3c8){if(_0x2dc3c8){var _0x502c1b=typeof _0xa7a9ec[_0x6f9c('0x22')]===_0x6f9c('0x23')&&typeof _0xa7a9ec[_0x6f9c('0x24')]==='undefined';var _0x638f67=_0x2dc3c8['count'];var _0x107952=_0x502c1b?0x0:_0xa7a9ec[_0x6f9c('0x22')];var _0x569087=_0x502c1b?_0x2dc3c8[_0x6f9c('0x25')]:_0xa7a9ec['offset']+_0xa7a9ec['limit'];var _0x367b83;if(_0x569087>=_0x638f67){_0x569087=_0x638f67;_0x367b83=0xc8;}else{_0x367b83=0xce;}_0x25a0fe[_0x6f9c('0x1f')](_0x367b83);return _0x25a0fe[_0x6f9c('0x26')](_0x6f9c('0x27'),_0x107952+'-'+_0x569087+'/'+_0x638f67)[_0x6f9c('0x21')](_0x2dc3c8);}return null;};}function patchUpdates(_0x3a7fb8){return function(_0x31c85d){try{jsonpatch[_0x6f9c('0x28')](_0x31c85d,_0x3a7fb8,!![]);}catch(_0x52656c){return BPromise[_0x6f9c('0x29')](_0x52656c);}return _0x31c85d[_0x6f9c('0x2a')]();};}function saveUpdates(_0x317ae3,_0x56ffeb){return function(_0x5e9715){if(_0x5e9715){return _0x5e9715[_0x6f9c('0x2b')](_0x317ae3)['then'](function(_0x5902cf){return _0x5902cf;});}return null;};}function removeEntity(_0x5a98d0,_0x13cbe4){return function(_0x2fedec){if(_0x2fedec){return _0x2fedec[_0x6f9c('0x2c')]()['then'](function(){_0x5a98d0[_0x6f9c('0x1f')](0xcc)[_0x6f9c('0x20')]();});}};}function handleEntityNotFound(_0x935f9b,_0x2d2882){return function(_0x280f3b){if(!_0x280f3b){_0x935f9b[_0x6f9c('0x1e')](0x194);}return _0x280f3b;};}function handleError(_0x5d20fa,_0x3352a2){_0x3352a2=_0x3352a2||0x1f4;return function(_0x21ba28){logger[_0x6f9c('0x2d')](_0x21ba28[_0x6f9c('0x2e')]);if(_0x21ba28[_0x6f9c('0x2f')]){delete _0x21ba28[_0x6f9c('0x2f')];}_0x5d20fa[_0x6f9c('0x1f')](_0x3352a2)[_0x6f9c('0x30')](_0x21ba28);};}exports[_0x6f9c('0x31')]=function(_0x13232c,_0x356714){var _0x4c5642={},_0x4e1153={},_0x1baf4f={'count':0x0,'rows':[]};var _0x492cab=_[_0x6f9c('0x32')](db[_0x6f9c('0x33')][_0x6f9c('0x34')],function(_0x2dee34){return{'name':_0x2dee34[_0x6f9c('0x35')],'type':_0x2dee34[_0x6f9c('0x36')][_0x6f9c('0x37')]};});_0x4e1153[_0x6f9c('0x38')]=_[_0x6f9c('0x32')](_0x492cab,_0x6f9c('0x2f'));_0x4e1153[_0x6f9c('0x39')]=_[_0x6f9c('0x3a')](_0x13232c['query']);_0x4e1153[_0x6f9c('0x3b')]=_[_0x6f9c('0x3c')](_0x4e1153[_0x6f9c('0x38')],_0x4e1153[_0x6f9c('0x39')]);_0x4c5642[_0x6f9c('0x3d')]=_[_0x6f9c('0x3c')](_0x4e1153[_0x6f9c('0x38')],qs[_0x6f9c('0x3e')](_0x13232c['query']['fields']));_0x4c5642['attributes']=_0x4c5642[_0x6f9c('0x3d')][_0x6f9c('0x3f')]?_0x4c5642[_0x6f9c('0x3d')]:_0x4e1153['model'];if(!_0x13232c[_0x6f9c('0x39')][_0x6f9c('0x40')](_0x6f9c('0x41'))){_0x4c5642[_0x6f9c('0x24')]=qs['limit'](_0x13232c[_0x6f9c('0x39')][_0x6f9c('0x24')]);_0x4c5642[_0x6f9c('0x22')]=qs[_0x6f9c('0x22')](_0x13232c[_0x6f9c('0x39')][_0x6f9c('0x22')]);}_0x4c5642[_0x6f9c('0x42')]=qs[_0x6f9c('0x43')](_0x13232c[_0x6f9c('0x39')][_0x6f9c('0x43')]);_0x4c5642[_0x6f9c('0x44')]=qs['filters'](_[_0x6f9c('0x45')](_0x13232c[_0x6f9c('0x39')],_0x4e1153[_0x6f9c('0x3b')]),_0x492cab);if(_0x13232c['query'][_0x6f9c('0x46')]){_0x4c5642[_0x6f9c('0x44')]=_['merge'](_0x4c5642[_0x6f9c('0x44')],{'$or':_[_0x6f9c('0x32')](_0x492cab,function(_0x3ab3aa){if(_0x3ab3aa[_0x6f9c('0x36')]!==_0x6f9c('0x47')){var _0x50f83f={};_0x50f83f[_0x3ab3aa[_0x6f9c('0x2f')]]={'$like':'%'+_0x13232c[_0x6f9c('0x39')][_0x6f9c('0x46')]+'%'};return _0x50f83f;}})});}_0x4c5642=_['merge']({},_0x4c5642,_0x13232c[_0x6f9c('0x48')]);var _0x29be88={'where':_0x4c5642[_0x6f9c('0x44')]};return db[_0x6f9c('0x33')][_0x6f9c('0x25')](_0x29be88)['then'](function(_0x3ce580){_0x1baf4f[_0x6f9c('0x25')]=_0x3ce580;if(_0x13232c[_0x6f9c('0x39')][_0x6f9c('0x49')]){_0x4c5642['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x4c5642);})[_0x6f9c('0x4a')](function(_0x4ad8da){_0x1baf4f['rows']=_0x4ad8da;return _0x1baf4f;})[_0x6f9c('0x4a')](respondWithFilteredResult(_0x356714,_0x4c5642))[_0x6f9c('0x4b')](handleError(_0x356714,null));};exports[_0x6f9c('0x4c')]=function(_0x350e48,_0x3afc9d){var _0x48b429={'raw':!![],'where':{'id':_0x350e48[_0x6f9c('0x4d')]['id']}},_0x261d59={};_0x261d59[_0x6f9c('0x38')]=_[_0x6f9c('0x3a')](db['ChatGroup']['rawAttributes']);_0x261d59[_0x6f9c('0x39')]=_[_0x6f9c('0x3a')](_0x350e48[_0x6f9c('0x39')]);_0x261d59['filters']=_['intersection'](_0x261d59[_0x6f9c('0x38')],_0x261d59[_0x6f9c('0x39')]);_0x48b429[_0x6f9c('0x3d')]=_['intersection'](_0x261d59['model'],qs['fields'](_0x350e48[_0x6f9c('0x39')][_0x6f9c('0x3e')]));_0x48b429['attributes']=_0x48b429[_0x6f9c('0x3d')][_0x6f9c('0x3f')]?_0x48b429[_0x6f9c('0x3d')]:_0x261d59[_0x6f9c('0x38')];if(_0x350e48['query'][_0x6f9c('0x49')]){_0x48b429[_0x6f9c('0x4e')]=[{'all':!![]}];}_0x48b429=_[_0x6f9c('0x4f')]({},_0x48b429,_0x350e48[_0x6f9c('0x48')]);return db[_0x6f9c('0x33')][_0x6f9c('0x50')](_0x48b429)[_0x6f9c('0x4a')](handleEntityNotFound(_0x3afc9d,null))['then'](respondWithResult(_0x3afc9d,null))[_0x6f9c('0x4b')](handleError(_0x3afc9d,null));};exports[_0x6f9c('0x51')]=function(_0xda62d8,_0x6d04c0){return db['ChatGroup']['create'](_0xda62d8[_0x6f9c('0x52')],{})['then'](respondWithResult(_0x6d04c0,0xc9))[_0x6f9c('0x4b')](handleError(_0x6d04c0,null));};exports[_0x6f9c('0x2b')]=function(_0x33a021,_0x264219){if(_0x33a021[_0x6f9c('0x52')]['id']){delete _0x33a021['body']['id'];}return db[_0x6f9c('0x33')][_0x6f9c('0x50')]({'where':{'id':_0x33a021[_0x6f9c('0x4d')]['id']}})[_0x6f9c('0x4a')](handleEntityNotFound(_0x264219,null))[_0x6f9c('0x4a')](saveUpdates(_0x33a021[_0x6f9c('0x52')],null))[_0x6f9c('0x4a')](respondWithResult(_0x264219,null))[_0x6f9c('0x4b')](handleError(_0x264219,null));};exports[_0x6f9c('0x2c')]=function(_0x2e3959,_0x530ce5){return db[_0x6f9c('0x33')][_0x6f9c('0x50')]({'where':{'id':_0x2e3959[_0x6f9c('0x4d')]['id']}})[_0x6f9c('0x4a')](handleEntityNotFound(_0x530ce5,null))[_0x6f9c('0x4a')](removeEntity(_0x530ce5,null))[_0x6f9c('0x4b')](handleError(_0x530ce5,null));};exports[_0x6f9c('0x53')]=function(_0x5a2e4e,_0x34bd19){return db[_0x6f9c('0x33')][_0x6f9c('0x53')]()[_0x6f9c('0x4a')](respondWithResult(_0x34bd19,null))['catch'](handleError(_0x34bd19,null));};exports['getUnread']=function(_0x1c73f3,_0x5ddd95,_0x4b6962){return db[_0x6f9c('0x54')][_0x6f9c('0x25')]({'where':{'ChatGroupId':_0x1c73f3[_0x6f9c('0x4d')]['id'],'ToId':_0x1c73f3['user']['id'],'read':![]}})['then'](function(_0x5e0ee4){return{'id':_[_0x6f9c('0x55')](_0x1c73f3['params']['id']),'count':_0x5e0ee4};})[_0x6f9c('0x4a')](respondWithResult(_0x5ddd95,null))[_0x6f9c('0x4b')](handleError(_0x5ddd95,null));};exports[_0x6f9c('0x56')]=function(_0x298ab0,_0x5097af,_0x54c05f){return db[_0x6f9c('0x33')]['find']({'where':{'id':_0x298ab0[_0x6f9c('0x4d')]['id']}})[_0x6f9c('0x4a')](handleEntityNotFound(_0x5097af,null))[_0x6f9c('0x4a')](function(_0x512560){if(_0x512560){return _0x512560[_0x6f9c('0x56')](_0x298ab0[_0x6f9c('0x52')][_0x6f9c('0x57')],_[_0x6f9c('0x58')](_0x298ab0[_0x6f9c('0x52')],[_0x6f9c('0x57'),'id'])||{});}})[_0x6f9c('0x4a')](respondWithResult(_0x5097af,null))[_0x6f9c('0x4b')](handleError(_0x5097af,null));};exports[_0x6f9c('0x59')]=function(_0x356c89,_0x16bc41,_0xede51){var _0x15587a={};var _0x43863c={};var _0x19a17e;var _0x4c3419;return db['ChatGroup']['findOne']({'where':{'id':_0x356c89[_0x6f9c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x16bc41,null))['then'](function(_0x25ac1b){if(_0x25ac1b){_0x19a17e=_0x25ac1b;_0x43863c['model']=_[_0x6f9c('0x3a')](db[_0x6f9c('0x5a')][_0x6f9c('0x34')]);_0x43863c[_0x6f9c('0x39')]=_['keys'](_0x356c89['query']);_0x43863c[_0x6f9c('0x3b')]=_[_0x6f9c('0x3c')](_0x43863c['model'],_0x43863c[_0x6f9c('0x39')]);_0x15587a[_0x6f9c('0x3d')]=_[_0x6f9c('0x3c')](_0x43863c['model'],qs[_0x6f9c('0x3e')](_0x356c89[_0x6f9c('0x39')]['fields']));_0x15587a[_0x6f9c('0x3d')]=_0x15587a[_0x6f9c('0x3d')]['length']?_0x15587a[_0x6f9c('0x3d')]:_0x43863c[_0x6f9c('0x38')];_0x15587a[_0x6f9c('0x42')]=qs[_0x6f9c('0x43')](_0x356c89[_0x6f9c('0x39')][_0x6f9c('0x43')]);_0x15587a[_0x6f9c('0x44')]=qs[_0x6f9c('0x3b')](_[_0x6f9c('0x45')](_0x356c89[_0x6f9c('0x39')],_0x43863c['filters']));if(_0x356c89[_0x6f9c('0x39')][_0x6f9c('0x46')]){_0x15587a[_0x6f9c('0x44')]=_[_0x6f9c('0x4f')](_0x15587a[_0x6f9c('0x44')],{'$or':_[_0x6f9c('0x32')](_0x15587a[_0x6f9c('0x3d')],function(_0x2d78d3){var _0x76fea8={};_0x76fea8[_0x2d78d3]={'$like':'%'+_0x356c89[_0x6f9c('0x39')][_0x6f9c('0x46')]+'%'};return _0x76fea8;})});}_0x15587a=_['merge']({},_0x15587a,_0x356c89[_0x6f9c('0x48')]);return _0x19a17e[_0x6f9c('0x59')](_0x15587a);}})['then'](function(_0x4ac85f){if(_0x4ac85f){_0x4c3419=_0x4ac85f['length'];if(!_0x356c89[_0x6f9c('0x39')][_0x6f9c('0x40')](_0x6f9c('0x41'))){_0x15587a[_0x6f9c('0x24')]=qs[_0x6f9c('0x24')](_0x356c89[_0x6f9c('0x39')][_0x6f9c('0x24')]);_0x15587a[_0x6f9c('0x22')]=qs['offset'](_0x356c89[_0x6f9c('0x39')]['offset']);}return _0x19a17e[_0x6f9c('0x59')](_0x15587a);}})[_0x6f9c('0x4a')](function(_0x52d974){if(_0x52d974){return _0x52d974?{'count':_0x4c3419,'rows':_0x52d974}:null;}})['then'](respondWithResult(_0x16bc41,null))[_0x6f9c('0x4b')](handleError(_0x16bc41,null));};exports[_0x6f9c('0x5b')]=function(_0x441112,_0x3fe7a5,_0x584821){return db[_0x6f9c('0x33')][_0x6f9c('0x50')]({'where':{'id':_0x441112[_0x6f9c('0x4d')]['id']}})[_0x6f9c('0x4a')](handleEntityNotFound(_0x3fe7a5,null))[_0x6f9c('0x4a')](function(_0x58d7f2){if(_0x58d7f2){return _0x58d7f2['removeMembers'](_0x441112[_0x6f9c('0x39')][_0x6f9c('0x57')]);}})[_0x6f9c('0x4a')](respondWithStatusCode(_0x3fe7a5,null))['catch'](handleError(_0x3fe7a5,null));};exports['addMessage']=function(_0x16d804,_0x3a2a8f,_0x4324ff){if(_0x16d804[_0x6f9c('0x52')]['id']){delete _0x16d804[_0x6f9c('0x52')]['id'];}return db[_0x6f9c('0x33')][_0x6f9c('0x50')]({'where':{'id':_0x16d804[_0x6f9c('0x4d')]['id']}})[_0x6f9c('0x4a')](handleEntityNotFound(_0x3a2a8f,null))[_0x6f9c('0x4a')](function(_0x196ba1){if(_0x196ba1){_0x16d804['body'][_0x6f9c('0x5c')]=_0x196ba1['id'];return db[_0x6f9c('0x54')]['create'](_0x16d804['body']);}})[_0x6f9c('0x4a')](respondWithResult(_0x3a2a8f,null))['catch'](handleError(_0x3a2a8f,null));};exports[_0x6f9c('0x5d')]=function(_0x4f1a25,_0x1f937f,_0x5ceb18){var _0x52ddf9={};var _0xa8dd2b={};var _0x167170;var _0x228dcc;return db[_0x6f9c('0x33')][_0x6f9c('0x5e')]({'where':{'id':_0x4f1a25[_0x6f9c('0x4d')]['id']}})[_0x6f9c('0x4a')](handleEntityNotFound(_0x1f937f,null))[_0x6f9c('0x4a')](function(_0x339518){if(_0x339518){_0x167170=_0x339518;_0xa8dd2b['model']=_[_0x6f9c('0x3a')](db[_0x6f9c('0x54')][_0x6f9c('0x34')]);_0xa8dd2b[_0x6f9c('0x39')]=_[_0x6f9c('0x3a')](_0x4f1a25['query']);_0xa8dd2b['filters']=_['intersection'](_0xa8dd2b[_0x6f9c('0x38')],_0xa8dd2b[_0x6f9c('0x39')]);_0x52ddf9[_0x6f9c('0x3d')]=_[_0x6f9c('0x3c')](_0xa8dd2b['model'],qs['fields'](_0x4f1a25[_0x6f9c('0x39')]['fields']));_0x52ddf9[_0x6f9c('0x3d')]=_0x52ddf9[_0x6f9c('0x3d')][_0x6f9c('0x3f')]?_0x52ddf9[_0x6f9c('0x3d')]:_0xa8dd2b[_0x6f9c('0x38')];_0x52ddf9[_0x6f9c('0x42')]=qs[_0x6f9c('0x43')](_0x4f1a25['query'][_0x6f9c('0x43')]);_0x52ddf9['where']=qs[_0x6f9c('0x3b')](_[_0x6f9c('0x45')](_0x4f1a25[_0x6f9c('0x39')],_0xa8dd2b['filters']));if(_0x4f1a25[_0x6f9c('0x39')][_0x6f9c('0x46')]){_0x52ddf9[_0x6f9c('0x44')]=_[_0x6f9c('0x4f')](_0x52ddf9[_0x6f9c('0x44')],{'$or':_[_0x6f9c('0x32')](_0x52ddf9[_0x6f9c('0x3d')],function(_0x2d6639){var _0x5507cb={};_0x5507cb[_0x2d6639]={'$like':'%'+_0x4f1a25[_0x6f9c('0x39')][_0x6f9c('0x46')]+'%'};return _0x5507cb;})});}if(_0x4f1a25[_0x6f9c('0x39')][_0x6f9c('0x5f')]){var _0x313f20=_0x4f1a25[_0x6f9c('0x39')][_0x6f9c('0x5f')][_0x6f9c('0x60')](',');var _0x3825aa={};_0x3825aa[_0x313f20[0x0]]={'$gte':moment(_0x313f20[0x1])[_0x6f9c('0x61')](_0x6f9c('0x62'))};_0x52ddf9['where']=_['merge'](_0x52ddf9['where'],_0x3825aa);}_0x52ddf9=_[_0x6f9c('0x4f')]({},_0x52ddf9,_0x4f1a25[_0x6f9c('0x48')]);return _0x167170[_0x6f9c('0x5d')](_0x52ddf9);}})['then'](function(_0x2e12e0){if(_0x2e12e0){_0x228dcc=_0x2e12e0[_0x6f9c('0x3f')];if(!_0x4f1a25[_0x6f9c('0x39')]['hasOwnProperty']('nolimit')){_0x52ddf9[_0x6f9c('0x24')]=qs[_0x6f9c('0x24')](_0x4f1a25[_0x6f9c('0x39')][_0x6f9c('0x24')]);_0x52ddf9[_0x6f9c('0x22')]=qs[_0x6f9c('0x22')](_0x4f1a25[_0x6f9c('0x39')]['offset']);}return _0x167170[_0x6f9c('0x5d')](_0x52ddf9);}})[_0x6f9c('0x4a')](function(_0x3e2c5a){if(_0x3e2c5a){return _0x3e2c5a?{'count':_0x228dcc,'rows':_0x3e2c5a}:null;}})[_0x6f9c('0x4a')](respondWithResult(_0x1f937f,null))[_0x6f9c('0x4b')](handleError(_0x1f937f,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b5aeec0..de4a152 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 _0x3af5=['setMaxListeners','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0x3af5,0x1d3));var _0x53af=function(_0xc6ea98,_0x1f0fe7){_0xc6ea98=_0xc6ea98-0x0;var _0x154999=_0x3af5[_0xc6ea98];return _0x154999;};'use strict';var EventEmitter=require(_0x53af('0x0'));var ChatGroup=require(_0x53af('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x53af('0x2')](0x0);var events={'afterCreate':_0x53af('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x370c3b){return function(_0x500041,_0x518926,_0x205be1){ChatGroupEvents[_0x53af('0x4')](_0x370c3b+':'+_0x500041['id'],_0x500041);ChatGroupEvents['emit'](_0x370c3b,_0x500041);_0x205be1(null);};}for(var e in events){if(events[_0x53af('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x53af('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x2da6=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x2da6,0x1dd));var _0x62da=function(_0x1bef10,_0x488a41){_0x1bef10=_0x1bef10-0x0;var _0x50e083=_0x2da6[_0x1bef10];return _0x50e083;};'use strict';var EventEmitter=require(_0x62da('0x0'));var ChatGroup=require(_0x62da('0x1'))['db'][_0x62da('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x62da('0x3')](0x0);var events={'afterCreate':_0x62da('0x4'),'afterUpdate':_0x62da('0x5'),'afterDestroy':_0x62da('0x6')};function emitEvent(_0x3552dc){return function(_0x4c079d,_0x4a8428,_0xe28204){ChatGroupEvents[_0x62da('0x7')](_0x3552dc+':'+_0x4c079d['id'],_0x4c079d);ChatGroupEvents[_0x62da('0x7')](_0x3552dc,_0x4c079d);_0xe28204(null);};}for(var e in events){if(events[_0x62da('0x8')](e)){var event=events[e];ChatGroup[_0x62da('0x9')](e,emitEvent(event));}}module[_0x62da('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0774463..7b46075 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 _0xe4dd=['../../config/logger','api','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xe4dd,0x9a));var _0xde4d=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0xe4dd[_0x4fbb15];return _0x436338;};'use strict';var _=require(_0xde4d('0x0'));var util=require(_0xde4d('0x1'));var logger=require(_0xde4d('0x2'))(_0xde4d('0x3'));var moment=require('moment');var BPromise=require(_0xde4d('0x4'));var rp=require(_0xde4d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xde4d('0x6'));var attributes=require(_0xde4d('0x7'));module[_0xde4d('0x8')]=function(_0x14b8c7,_0x495f20){return _0x14b8c7[_0xde4d('0x9')](_0xde4d('0xa'),attributes,{'tableName':_0xde4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc68a=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api'];(function(_0x450152,_0x5a03bc){var _0x193c9c=function(_0x5ade6c){while(--_0x5ade6c){_0x450152['push'](_0x450152['shift']());}};_0x193c9c(++_0x5a03bc);}(_0xc68a,0x194));var _0xac68=function(_0x35cabc,_0xc0f89a){_0x35cabc=_0x35cabc-0x0;var _0x2af2b9=_0xc68a[_0x35cabc];return _0x2af2b9;};'use strict';var _=require(_0xac68('0x0'));var util=require(_0xac68('0x1'));var logger=require(_0xac68('0x2'))(_0xac68('0x3'));var moment=require('moment');var BPromise=require(_0xac68('0x4'));var rp=require(_0xac68('0x5'));var fs=require('fs');var path=require(_0xac68('0x6'));var rimraf=require(_0xac68('0x7'));var config=require(_0xac68('0x8'));var attributes=require(_0xac68('0x9'));module['exports']=function(_0x48cc93,_0x1d5c0c){return _0x48cc93[_0xac68('0xa')]('ChatGroup',attributes,{'tableName':_0xac68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 735eef0..002fb68 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 _0x3c06=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','request\x20sent','debug','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x55663f,_0x31653b){var _0x261b0c=function(_0x48186b){while(--_0x48186b){_0x55663f['push'](_0x55663f['shift']());}};_0x261b0c(++_0x31653b);}(_0x3c06,0xf7));var _0x63c0=function(_0x5b492b,_0x35a35d){_0x5b492b=_0x5b492b-0x0;var _0x2de782=_0x3c06[_0x5b492b];return _0x2de782;};'use strict';var _=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var moment=require(_0x63c0('0x2'));var BPromise=require(_0x63c0('0x3'));var rs=require(_0x63c0('0x4'));var fs=require('fs');var Redis=require(_0x63c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x63c0('0x6'));var logger=require(_0x63c0('0x7'))(_0x63c0('0x8'));var config=require(_0x63c0('0x9'));var jayson=require(_0x63c0('0xa'));var client=jayson[_0x63c0('0xb')][_0x63c0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x63c0('0xd')],{'host':_0x63c0('0xe'),'port':0x18eb});var socket=require(_0x63c0('0xf'))(new Redis(config[_0x63c0('0xd')]));require(_0x63c0('0x10'))['register'](socket);function respondWithRpcPromise(_0x5188a4,_0x20d2a7,_0x3b7eb4){return new BPromise(function(_0x792b51,_0x246bad){return client[_0x63c0('0x11')](_0x5188a4,_0x3b7eb4)['then'](function(_0x1ae320){logger['info']('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0x63c0('0x12'));logger[_0x63c0('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x20d2a7,_0x63c0('0x12'),JSON[_0x63c0('0x14')](_0x1ae320));if(_0x1ae320['error']){if(_0x1ae320[_0x63c0('0x15')][_0x63c0('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);return _0x246bad(_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);}logger[_0x63c0('0x15')](_0x63c0('0x18'),_0x20d2a7,_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);return _0x792b51(_0x1ae320[_0x63c0('0x15')][_0x63c0('0x17')]);}else{logger[_0x63c0('0x19')]('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0x63c0('0x12'));_0x792b51(_0x1ae320[_0x63c0('0x1a')][_0x63c0('0x17')]);}})[_0x63c0('0x1b')](function(_0xfd51ff){logger[_0x63c0('0x15')]('ChatGroup,\x20%s,\x20%s',_0x20d2a7,_0xfd51ff);_0x246bad(_0xfd51ff);});});} \ No newline at end of file +var _0x17ba=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17ba,0xab));var _0xa17b=function(_0x2d07c5,_0x114a9b){_0x2d07c5=_0x2d07c5-0x0;var _0x1a4085=_0x17ba[_0x2d07c5];return _0x1a4085;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});config[_0xa17b('0xd')]=_[_0xa17b('0xe')](config[_0xa17b('0xd')],{'host':_0xa17b('0xf'),'port':0x18eb});var socket=require(_0xa17b('0x10'))(new Redis(config[_0xa17b('0xd')]));require(_0xa17b('0x11'))[_0xa17b('0x12')](socket);function respondWithRpcPromise(_0x578799,_0x2556c4,_0x38b8f1){return new BPromise(function(_0x322dc0,_0x1e799a){return client[_0xa17b('0x13')](_0x578799,_0x38b8f1)[_0xa17b('0x14')](function(_0xc5ef2e){logger['info'](_0xa17b('0x15'),_0x2556c4,_0xa17b('0x16'));logger[_0xa17b('0x17')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2556c4,_0xa17b('0x16'),JSON[_0xa17b('0x18')](_0xc5ef2e));if(_0xc5ef2e[_0xa17b('0x19')]){if(_0xc5ef2e[_0xa17b('0x19')]['code']===0x1f4){logger[_0xa17b('0x19')]('ChatGroup,\x20%s,\x20%s',_0x2556c4,_0xc5ef2e[_0xa17b('0x19')][_0xa17b('0x1a')]);return _0x1e799a(_0xc5ef2e['error'][_0xa17b('0x1a')]);}logger[_0xa17b('0x19')](_0xa17b('0x15'),_0x2556c4,_0xc5ef2e[_0xa17b('0x19')]['message']);return _0x322dc0(_0xc5ef2e[_0xa17b('0x19')]['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x2556c4,_0xa17b('0x16'));_0x322dc0(_0xc5ef2e[_0xa17b('0x1b')]['message']);}})[_0xa17b('0x1c')](function(_0x166d44){logger[_0xa17b('0x19')](_0xa17b('0x15'),_0x2556c4,_0x166d44);_0x1e799a(_0x166d44);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 5d920d4..5e20082 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 _0x55bf=['chatGroup:','./chatGroup.events','save','remove','update','emit','register','length'];(function(_0x18401f,_0x57cc61){var _0x5925e5=function(_0x450cf5){while(--_0x450cf5){_0x18401f['push'](_0x18401f['shift']());}};_0x5925e5(++_0x57cc61);}(_0x55bf,0x199));var _0xf55b=function(_0x1f1584,_0x32656e){_0x1f1584=_0x1f1584-0x0;var _0x43b6fb=_0x55bf[_0x1f1584];return _0x43b6fb;};'use strict';var ChatGroupEvents=require(_0xf55b('0x0'));var events=[_0xf55b('0x1'),_0xf55b('0x2'),_0xf55b('0x3')];function createListener(_0x5e0b87,_0x36af37){return function(_0x948a83){_0x36af37[_0xf55b('0x4')](_0x5e0b87,_0x948a83);};}function removeListener(_0x360e79,_0x1e72cb){return function(){ChatGroupEvents['removeListener'](_0x360e79,_0x1e72cb);};}exports[_0xf55b('0x5')]=function(_0x189de5){for(var _0x46fbaa=0x0,_0xe58fb4=events[_0xf55b('0x6')];_0x46fbaa<_0xe58fb4;_0x46fbaa++){var _0x17fc0b=events[_0x46fbaa];var _0x476ca3=createListener(_0xf55b('0x7')+_0x17fc0b,_0x189de5);ChatGroupEvents['on'](_0x17fc0b,_0x476ca3);}}; \ No newline at end of file +var _0x90fe=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x31cabf,_0x249573){var _0x1e6e0c=function(_0x44a2c4){while(--_0x44a2c4){_0x31cabf['push'](_0x31cabf['shift']());}};_0x1e6e0c(++_0x249573);}(_0x90fe,0xac));var _0xe90f=function(_0x8ad274,_0x569281){_0x8ad274=_0x8ad274-0x0;var _0x10640c=_0x90fe[_0x8ad274];return _0x10640c;};'use strict';var ChatGroupEvents=require(_0xe90f('0x0'));var events=[_0xe90f('0x1'),_0xe90f('0x2'),_0xe90f('0x3')];function createListener(_0x3ad19d,_0x2a407c){return function(_0x2ad8d6){_0x2a407c[_0xe90f('0x4')](_0x3ad19d,_0x2ad8d6);};}function removeListener(_0x314717,_0x3edbac){return function(){ChatGroupEvents[_0xe90f('0x5')](_0x314717,_0x3edbac);};}exports['register']=function(_0x55881f){for(var _0x56f6fb=0x0,_0x52018e=events[_0xe90f('0x6')];_0x56f6fb<_0x52018e;_0x56f6fb++){var _0x54abf4=events[_0x56f6fb];var _0x33ee7a=createListener(_0xe90f('0x7')+_0x54abf4,_0x55881f);ChatGroupEvents['on'](_0x54abf4,_0x33ee7a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4cdc953..a2516bd 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 _0x3391=['index','describe','/:id','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x3391,0x8a));var _0x1339=function(_0x295f1a,_0x456368){_0x295f1a=_0x295f1a-0x0;var _0x3e136d=_0x3391[_0x295f1a];return _0x3e136d;};'use strict';var multer=require(_0x1339('0x0'));var util=require(_0x1339('0x1'));var path=require(_0x1339('0x2'));var timeout=require(_0x1339('0x3'));var express=require(_0x1339('0x4'));var router=express[_0x1339('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1339('0x6'));var interaction=require(_0x1339('0x7'));var config=require(_0x1339('0x8'));var controller=require(_0x1339('0x9'));router[_0x1339('0xa')]('/',auth[_0x1339('0xb')](),controller[_0x1339('0xc')]);router[_0x1339('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x1339('0xd')]);router[_0x1339('0xa')](_0x1339('0xe'),auth[_0x1339('0xb')](),controller['show']);router[_0x1339('0xa')](_0x1339('0xf'),auth[_0x1339('0xb')](),controller[_0x1339('0x10')]);router[_0x1339('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x1339('0x11')]);router[_0x1339('0xa')](_0x1339('0x12'),auth[_0x1339('0xb')](),controller[_0x1339('0x13')]);router[_0x1339('0x14')]('/',auth['isAuthenticated'](),controller[_0x1339('0x15')]);router['post'](_0x1339('0x16'),auth['isAuthenticated'](),controller['addMembers']);router['post']('/:id/messages',auth[_0x1339('0xb')](),controller[_0x1339('0x17')]);router[_0x1339('0x18')](_0x1339('0xe'),auth['isAuthenticated'](),controller[_0x1339('0x19')]);router[_0x1339('0x1a')](_0x1339('0xe'),auth[_0x1339('0xb')](),controller[_0x1339('0x1b')]);router['delete'](_0x1339('0x16'),auth[_0x1339('0xb')](),controller[_0x1339('0x1c')]);module[_0x1339('0x1d')]=router; \ No newline at end of file +var _0x6a23=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','getMembers','/:id/messages','post','create','/:id/members','addMembers','addMessage'];(function(_0x2b543a,_0x18d0e7){var _0x59f7d8=function(_0x5199fe){while(--_0x5199fe){_0x2b543a['push'](_0x2b543a['shift']());}};_0x59f7d8(++_0x18d0e7);}(_0x6a23,0x12c));var _0x36a2=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x6a23[_0x3f1710];return _0x528458;};'use strict';var multer=require(_0x36a2('0x0'));var util=require(_0x36a2('0x1'));var path=require(_0x36a2('0x2'));var timeout=require(_0x36a2('0x3'));var express=require(_0x36a2('0x4'));var router=express[_0x36a2('0x5')]();var fs_extra=require(_0x36a2('0x6'));var auth=require(_0x36a2('0x7'));var interaction=require(_0x36a2('0x8'));var config=require(_0x36a2('0x9'));var controller=require(_0x36a2('0xa'));router[_0x36a2('0xb')]('/',auth[_0x36a2('0xc')](),controller[_0x36a2('0xd')]);router[_0x36a2('0xb')]('/describe',auth[_0x36a2('0xc')](),controller['describe']);router[_0x36a2('0xb')](_0x36a2('0xe'),auth[_0x36a2('0xc')](),controller[_0x36a2('0xf')]);router[_0x36a2('0xb')](_0x36a2('0x10'),auth['isAuthenticated'](),controller['getUnread']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x36a2('0x11')]);router['get'](_0x36a2('0x12'),auth[_0x36a2('0xc')](),controller['getMessages']);router[_0x36a2('0x13')]('/',auth[_0x36a2('0xc')](),controller[_0x36a2('0x14')]);router[_0x36a2('0x13')](_0x36a2('0x15'),auth[_0x36a2('0xc')](),controller[_0x36a2('0x16')]);router[_0x36a2('0x13')](_0x36a2('0x12'),auth[_0x36a2('0xc')](),controller[_0x36a2('0x17')]);router['put'](_0x36a2('0xe'),auth[_0x36a2('0xc')](),controller[_0x36a2('0x18')]);router['delete'](_0x36a2('0xe'),auth[_0x36a2('0xc')](),controller[_0x36a2('0x19')]);router['delete'](_0x36a2('0x15'),auth[_0x36a2('0xc')](),controller['removeMembers']);module[_0x36a2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 49f4e22..2dadf26 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 _0x6599=['star','TEXT','DATE','STRING','long','out','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x6599,0xb0));var _0x9659=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x6599[_0x5c811c];return _0x5df3af;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'closed':{'type':Sequelize[_0x9659('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9659('0x2')]},'ratingType':{'type':Sequelize[_0x9659('0x3')](_0x9659('0x4'),'thumb'),'defaultValue':_0x9659('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x9659('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9659('0x6')]},'disposition':{'type':Sequelize[_0x9659('0x7')]},'secondDisposition':{'type':Sequelize[_0x9659('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x9659('0x7')]},'browserVersion':{'type':Sequelize[_0x9659('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9659('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x9659('0x7')]},'deviceType':{'type':Sequelize[_0x9659('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9659('0x7')]},'formData':{'type':Sequelize[_0x9659('0x5')](_0x9659('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9659('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9659('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9659('0x7')]},'customerPort':{'type':Sequelize[_0x9659('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9659('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xb677=['DATE','STRING','sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb677,0x119));var _0x7b67=function(_0xc30d17,_0x1151d6){_0xc30d17=_0xc30d17-0x0;var _0x310acf=_0xb677[_0xc30d17];return _0x310acf;};'use strict';var Sequelize=require(_0x7b67('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7b67('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7b67('0x2')]},'ratingType':{'type':Sequelize[_0x7b67('0x3')](_0x7b67('0x4'),_0x7b67('0x5')),'defaultValue':_0x7b67('0x4')},'ratingMessage':{'type':Sequelize[_0x7b67('0x6')]},'pathTranscript':{'type':Sequelize[_0x7b67('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7b67('0x7')]},'disposition':{'type':Sequelize[_0x7b67('0x8')]},'secondDisposition':{'type':Sequelize[_0x7b67('0x8')]},'thirdDisposition':{'type':Sequelize[_0x7b67('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7b67('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x7b67('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x7b67('0x8')]},'referer':{'type':Sequelize[_0x7b67('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7b67('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x7b67('0x7')]},'lastMsgAt':{'type':Sequelize[_0x7b67('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x7b67('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x7b67('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x7b67('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 dced317..2d74739 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(_0x734794,_0x1c69ce){var _0x142844=function(_0x1b394c){while(--_0x1b394c){_0x734794['push'](_0x734794['shift']());}};_0x142844(++_0x1c69ce);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));}; \ No newline at end of file +var _0x0b0e=['closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','spread','chatInteractionTags:save','removeTags','files','tmp','attachments','lastName','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','createReadStream','pipe','createWriteStream','firstName','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','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','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','filters','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x4e9866,_0x2c16a0){var _0x20b298=function(_0x4f5179){while(--_0x4f5179){_0x4e9866['push'](_0x4e9866['shift']());}};_0x20b298(++_0x2c16a0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x0b0e[_0x4bd950];return _0x5dc59a;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);var jayson=require(_0xe0b0('0x1e'));var client=jayson['client'][_0xe0b0('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xe0b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xadee6e,_0x519ae8,_0x11fdca,_0x4a4cc0){return new BPromise(function(_0x2d6fb6,_0x100204){var _0x56bcc7=_0x4a4cc0||client;return _0x56bcc7['request'](_0xadee6e,_0x11fdca)[_0xe0b0('0x20')](function(_0x50a441){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'),JSON['stringify'](_0x50a441));if(_0x50a441[_0xe0b0('0x22')]){if(_0x50a441['error'][_0xe0b0('0x23')]===0x1f4){logger[_0xe0b0('0x22')](_0xe0b0('0x24'),_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x100204(_0x50a441['error']['message']);}logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x2d6fb6(_0x50a441['error'][_0xe0b0('0x25')]);}else{logger['info'](_0xe0b0('0x24'),_0x519ae8,'request\x20sent');_0x2d6fb6(_0x50a441[_0xe0b0('0x26')]['message']);}})[_0xe0b0('0x27')](function(_0x4de537){logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x4de537);_0x100204(_0x4de537);});});}function respondWithStatusCode(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0xcc;return function(_0x362aba){if(_0x362aba){return _0x3c221d[_0xe0b0('0x28')](_0x5c5317);}return _0x3c221d[_0xe0b0('0x29')](_0x5c5317)[_0xe0b0('0x2a')]();};}function respondWithResult(_0x3ec2,_0x10745d){_0x10745d=_0x10745d||0xc8;return function(_0x5200a6){if(_0x5200a6){return _0x3ec2[_0xe0b0('0x29')](_0x10745d)[_0xe0b0('0x2b')](_0x5200a6);}};}function respondWithFilteredResult(_0x5b7a64,_0x15e13b){return function(_0x419b1f){if(_0x419b1f){var _0x36d137=typeof _0x15e13b[_0xe0b0('0x2c')]===_0xe0b0('0x2d')&&typeof _0x15e13b[_0xe0b0('0x2e')]===_0xe0b0('0x2d');var _0x4fb3b7=_0x419b1f[_0xe0b0('0x2f')];var _0x3c0109=_0x36d137?0x0:_0x15e13b['offset'];var _0x4fe400=_0x36d137?_0x419b1f[_0xe0b0('0x2f')]:_0x15e13b[_0xe0b0('0x2c')]+_0x15e13b[_0xe0b0('0x2e')];var _0x3f81d5;if(_0x4fe400>=_0x4fb3b7){_0x4fe400=_0x4fb3b7;_0x3f81d5=0xc8;}else{_0x3f81d5=0xce;}_0x5b7a64[_0xe0b0('0x29')](_0x3f81d5);return _0x5b7a64['set'](_0xe0b0('0x30'),_0x3c0109+'-'+_0x4fe400+'/'+_0x4fb3b7)[_0xe0b0('0x2b')](_0x419b1f);}return null;};}function patchUpdates(_0x7867c4){return function(_0x29d725){try{jsonpatch[_0xe0b0('0x31')](_0x29d725,_0x7867c4,!![]);}catch(_0x4fe835){return BPromise[_0xe0b0('0x32')](_0x4fe835);}return _0x29d725[_0xe0b0('0x33')]();};}function saveUpdates(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(_0x3575bc){return _0x3575bc[_0xe0b0('0x34')](_0xfc51d3)[_0xe0b0('0x20')](function(_0x20908f){return _0x20908f;});}return null;};}function removeEntity(_0x2125d5,_0x1dd010){return function(_0xd56467){if(_0xd56467){return _0xd56467[_0xe0b0('0x35')]()[_0xe0b0('0x20')](function(){_0x2125d5[_0xe0b0('0x29')](0xcc)[_0xe0b0('0x2a')]();});}};}function handleEntityNotFound(_0x4cf80c,_0x121608){return function(_0x135be5){if(!_0x135be5){_0x4cf80c[_0xe0b0('0x28')](0x194);}return _0x135be5;};}function handleError(_0x1eb3f9,_0x1a2d24){_0x1a2d24=_0x1a2d24||0x1f4;return function(_0x2c6e60){logger[_0xe0b0('0x22')](_0x2c6e60['stack']);if(_0x2c6e60['name']){delete _0x2c6e60['name'];}_0x1eb3f9['status'](_0x1a2d24)[_0xe0b0('0x36')](_0x2c6e60);};}function getMustacheRender(_0xc3d967,_0xe6f635){return Mustache['render'](_0xc3d967,_[_0xe0b0('0x37')](_0xe6f635[_0xe0b0('0x38')],{'contact':_0xe6f635[_0xe0b0('0x39')],'message':_0xe6f635[_0xe0b0('0x25')],'agent':_0xe6f635['agent'],'interaction':_0xe6f635[_0xe0b0('0x3a')],'account':_0xe6f635[_0xe0b0('0x3b')]}))||'';}function getInteractionUsers(_0x43d352,_0x30dcbb){return new BPromise(function(_0x4265e3,_0x1205db){try{if(_0x30dcbb[_0x43d352['id']]){_0x43d352[_0xe0b0('0x3c')]=_[_0xe0b0('0x3d')](_0x30dcbb[_0x43d352['id']],function(_0xeaffbb){return{'id':_0xeaffbb['id'],'fullname':_0xeaffbb['fullname']};});}}catch(_0x3e349b){_0x1205db(_0x3e349b);}_0x4265e3(_0x43d352);});}function getInteractionTags(_0x54f646,_0x34178d){return new BPromise(function(_0x2d5f47,_0x46c4ea){try{if(_0x54f646[_0xe0b0('0x3e')]){_0x54f646['Tags']=[];_0x54f646[_0xe0b0('0x3e')][_0xe0b0('0x3f')](',')[_0xe0b0('0x40')](function(_0x402a0e){_0x54f646[_0xe0b0('0x41')][_0xe0b0('0x42')](_0x34178d[_0x402a0e]);});}delete _0x54f646[_0xe0b0('0x3e')];}catch(_0x3bde8b){_0x46c4ea(_0x3bde8b);}_0x2d5f47(_0x54f646);});}function updateChatInteraction(_0x52ffe4,_0x2aad80,_0x309bbf){return new BPromise(function(_0x528818,_0x515bd2){return getInteractionUsers(_0x52ffe4,_0x309bbf)[_0xe0b0('0x20')](function(_0x247f8d){return getInteractionTags(_0x247f8d,_0x2aad80);})['then'](function(_0x18a59d){_0x528818(_0x18a59d);})[_0xe0b0('0x27')](function(_0x6bca5c){_0x515bd2(_0x6bca5c);});});}exports[_0xe0b0('0x43')]=function(_0x1a8cc7,_0x5c31b5){var _0x5d2fa2={},_0x51c580={},_0xc3235b={'count':0x0,'rows':[]};var _0x38e715=_['map'](db[_0xe0b0('0x44')][_0xe0b0('0x45')],function(_0x14197b){return{'name':_0x14197b[_0xe0b0('0x46')],'type':_0x14197b[_0xe0b0('0x47')]['key']};});_0x51c580['model']=_[_0xe0b0('0x3d')](_0x38e715,_0xe0b0('0x48'));_0x51c580[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1a8cc7[_0xe0b0('0x49')]);_0x51c580['filters']=_[_0xe0b0('0x4b')](_0x51c580[_0xe0b0('0x4c')],_0x51c580['query']);_0x5d2fa2['attributes']=_['intersection'](_0x51c580[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x5d2fa2['attributes']=_0x5d2fa2[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5d2fa2['attributes']:_0x51c580['model'];if(!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x50')]('nolimit')){_0x5d2fa2[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1a8cc7['query']['limit']);_0x5d2fa2[_0xe0b0('0x2c')]=qs['offset'](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x2c')]);}_0x5d2fa2[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5d2fa2['where']=qs['filters'](_[_0xe0b0('0x53')](_0x1a8cc7['query'],_0x51c580['filters']),_0x38e715);var _0x249d9a=[];var _0x222174=squel['select']()['field']('id')[_0xe0b0('0x54')](_0xe0b0('0x48'))[_0xe0b0('0x54')](_0xe0b0('0x55'))[_0xe0b0('0x56')](_0xe0b0('0x57'));var _0x84fabb=squel['select']()[_0xe0b0('0x54')]('u.id')[_0xe0b0('0x54')]('u.fullname')['field'](_0xe0b0('0x58'))[_0xe0b0('0x56')](_0xe0b0('0x59'),'ui')[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'u',_0xe0b0('0x5c'));var _0x4548da=squel[_0xe0b0('0x5d')]()[_0xe0b0('0x56')]('chat_interactions','i')[_0xe0b0('0x5a')]('cm_contacts','c',_0xe0b0('0x5e'))[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'o',_0xe0b0('0x5f'))[_0xe0b0('0x5a')](_0xe0b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xe0b0('0x5a')](_0xe0b0('0x61'),'me',_0xe0b0('0x62'))[_0xe0b0('0x5a')](_0xe0b0('0x63'),'it',_0xe0b0('0x64'))[_0xe0b0('0x5a')](_0xe0b0('0x57'),'t',_0xe0b0('0x65'));var _0xf331df=squel[_0xe0b0('0x66')]();var _0x18ab99=[];var _0xc719d2=squel[_0xe0b0('0x66')]();var _0xcdf97;if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x67')]){_0xcdf97=as[_0xe0b0('0x68')](_0x1a8cc7['query'][_0xe0b0('0x67')]);var _0xe7fbac=_0xcdf97[_0xe0b0('0x69')];for(var _0x2f24e6=0x0;_0x2f24e6<_0xcdf97[_0xe0b0('0x6a')][_0xe0b0('0x4f')];_0x2f24e6++){var _0x2bdb59=_0xcdf97['conditions'][_0x2f24e6];var _0x47dcc4='i';var _0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0x2bdb59['field']]);if(!_0x139014){switch(_0x2bdb59[_0xe0b0('0x54')]){case _0xe0b0('0x6c'):if(_0x2bdb59[_0xe0b0('0x6d')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+'`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+_0xe0b0('0x6f'));}break;case'Contact':if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){if(_0x2bdb59['value'][_0xe0b0('0x3f')]('\x20')['length']>0x1){_0xf331df[_0xe7fbac]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b0('0x72')](_0x2bdb59['value']),null);}else{var _0x4d75e4='%'+_0x2bdb59[_0xe0b0('0x6d')]+'%';_0xf331df[_0xe7fbac](_0xe0b0('0x73'),_0x4d75e4,_0x4d75e4,_0x4d75e4);}}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),'ContactId']);_0x2bdb59[_0xe0b0('0x54')]=_0xe0b0('0x74');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')]['end']);}break;case'Tag':var _0x4b41a=_0x2bdb59[_0xe0b0('0x6d')][_0xe0b0('0x3f')](',')['map'](function(_0x49b754){return Number(_0x49b754);});_0x4b41a[_0xe0b0('0x40')](function(_0x26f36f){_0xc719d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26f36f+',%');});_0x18ab99=_['union'](_0x18ab99,_0x4b41a);break;case _0xe0b0('0x78'):if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){_0xf331df[_0xe7fbac](_0xe0b0('0x79'),'%'+_0x2bdb59[_0xe0b0('0x6d')]+'%',null);}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0xe0b0('0x7a')]);_0x2bdb59['field']=_0xe0b0('0x7a');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value']['start'],_0x14da9c['value']['end']);}break;case'body':_0x14da9c=as[_0xe0b0('0x75')]('me',null,_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value'][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);break;}}else{var _0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')]['start'],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);}}}else{var _0x86e90=_(_0x1a8cc7[_0xe0b0('0x49')])[_0xe0b0('0x4a')]()[_0xe0b0('0x3d')](function(_0x16a2ae){return _['some'](_0x38e715,[_0xe0b0('0x48'),_0x16a2ae])?_0x16a2ae:undefined;})['compact']()[_0xe0b0('0x6d')]();if(!_[_0xe0b0('0x7b')](_0x86e90)){_0x86e90[_0xe0b0('0x40')](function(_0x9c7221){if(_0x9c7221==='ChatWebsiteId'){_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x7d'),[]['concat'](_0x1a8cc7['query'][_0x9c7221]));}else if(_0x9c7221===_0xe0b0('0x7e')){var _0x30adc5=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x80')];var _0x31dd21=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x81')];_0x4548da[_0xe0b0('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30adc5,_0x31dd21);}else{if(_0x1a8cc7['query'][_0x9c7221]===_0xe0b0('0x82')){_0x4548da['where']('i.'+_0x9c7221+'\x20IS\x20NULL');}else{_0x4548da['where']('i.'+_0x9c7221+'\x20=\x20?',_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221]);}}});}if(_0x1a8cc7['query'][_0xe0b0('0x83')]){if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x83')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`unreadMessages`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')](_0xe0b0('0x84'));}}if(_0x1a8cc7['query'][_0xe0b0('0x85')]){_0x18ab99=_[_0xe0b0('0x86')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x85')])?_0x1a8cc7[_0xe0b0('0x49')]['tag']:new Array(_0x1a8cc7['query']['tag']);_0x18ab99['forEach'](function(_0x5c258b){_0xc719d2['or'](_0xe0b0('0x87'),'%,'+_0x5c258b+',%');});}if(_0x1a8cc7['query'][_0xe0b0('0x88')]){var _0x5f4aaf=_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x88')][_0xe0b0('0x89')]('\x5c','\x5c\x5c')[_0xe0b0('0x89')](/'/g,'\x27\x27');if(qs[_0xe0b0('0x8a')](_0x5f4aaf)){_0xf331df['or'](_0xe0b0('0x8b'),_0x5f4aaf+'%');}else{_0xf331df['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f4aaf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f4aaf+'%');}}}_0x4548da['where'](_0xf331df);_0x4548da[_0xe0b0('0x8c')](_0xe0b0('0x8d'));var _0x264363={'type':db[_0xe0b0('0x8e')][_0xe0b0('0x8f')]['SELECT'],'raw':!![]};var _0x234716=_0x4548da[_0xe0b0('0x90')]();_0x234716[_0xe0b0('0x54')](_0xe0b0('0x8d'));_0x234716[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));if(_0x5d2fa2[_0xe0b0('0x51')]){_0x5d2fa2[_0xe0b0('0x51')]['forEach'](function(_0x589c47){var _0x6e0e9=_0x589c47[0x0]===_0xe0b0('0x92')?_0x589c47[0x0]:'i.'+_0x589c47[0x0];_0x4548da['order'](_0x6e0e9,_0x589c47[0x1]===_0xe0b0('0x93')?![]:!![]);});}if(!_[_0xe0b0('0x7b')](_0x18ab99)){_0x4548da[_0xe0b0('0x6e')](_0xc719d2);_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x94'),_0x18ab99);}BPromise[_0xe0b0('0x95')]()[_0xe0b0('0x20')](function(){if(!_0xcdf97){if(_0x1a8cc7[_0xe0b0('0x49')]['ChatWebsiteId'])return;_0x234716['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x96'));return;}if(_0x1a8cc7['user'][_0xe0b0('0x97')]!==_0xe0b0('0x98'))return;return _0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56c4b9){if(_['isEmpty'](_0x56c4b9)){_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x9b'));_0x4548da['where'](_0xe0b0('0x9b'));}else{_0x234716[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x56c4b9,'id'));_0x4548da[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe0b0('0x3d')](_0x56c4b9,'id'));}});})['then'](function(){if(_0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x97')]===_0xe0b0('0x98')&&!_0xcdf97&&!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x9c')])return[];return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x234716[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x48497e){_0xc3235b[_0xe0b0('0x2f')]=_0x48497e[_0xe0b0('0x4f')];if(_0xc3235b[_0xe0b0('0x2f')]===0x0)return[];return db['sequelize'][_0xe0b0('0x49')](_0x222174['toString'](),_0x264363)[_0xe0b0('0x20')](function(_0x350c40){_0x249d9a=_['keyBy'](_0x350c40,'id');_0x264363=_[_0xe0b0('0x37')](_0x264363,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8cc7['query'][_0xe0b0('0x4d')]){_0x5d2fa2['attributes']['forEach'](function(_0x4f027c){_0x4548da[_0xe0b0('0x54')]('i.'+_0x4f027c);});}else{_0x4548da[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));_0x4548da[_0xe0b0('0x54')]('a.key',_0xe0b0('0x9f'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa0'),'Account.mandatoryDisposition');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa1'),'contactName');_0x4548da['field'](_0xe0b0('0xa2'));_0x4548da['field'](_0xe0b0('0xa3'),_0xe0b0('0xa4'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa5'),_0xe0b0('0xa6'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa7'),'Contact.email');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa8'),_0xe0b0('0xa9'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaa'),'Contact.mobile');_0x4548da['field'](_0xe0b0('0xab'),_0xe0b0('0xac'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xad'),_0xe0b0('0xae'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaf'),_0xe0b0('0xb0'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xb1'),'TagIds');}if(_0x5d2fa2[_0xe0b0('0x2e')])_0x4548da[_0xe0b0('0x2e')](_0x5d2fa2[_0xe0b0('0x2e')]);if(_0x5d2fa2[_0xe0b0('0x2c')])_0x4548da['offset'](_0x5d2fa2[_0xe0b0('0x2c')]);return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x4548da[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x484cb2){if(_0x484cb2[_0xe0b0('0x4f')]>0x0)_0x84fabb['where'](_0xe0b0('0xb2'),_[_0xe0b0('0x3d')](_0x484cb2,'id'));return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x84fabb[_0xe0b0('0x9e')](),_0x264363)['then'](function(_0x567e42){var _0x3822e4=_['groupBy'](_0x567e42,_0xe0b0('0xb3'));var _0x4c82d6=[];_0x484cb2[_0xe0b0('0x40')](function(_0x474fbb){_0x4c82d6[_0xe0b0('0x42')](updateChatInteraction(_0x474fbb,_0x249d9a,_0x3822e4));});return BPromise[_0xe0b0('0xb4')](_0x4c82d6);});});})[_0xe0b0('0x20')](function(_0x1bb4da){_0xc3235b[_0xe0b0('0xb5')]=_0x1bb4da;return _0xc3235b;})['then'](respondWithFilteredResult(_0x5c31b5,_0x5d2fa2))['catch'](handleError(_0x5c31b5,null));};exports[_0xe0b0('0xb6')]=function(_0x717e74,_0x184938){var _0x20d6bd={'raw':![],'where':{'id':_0x717e74[_0xe0b0('0xb7')]['id']}},_0xd83992={};_0xd83992[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db[_0xe0b0('0x44')][_0xe0b0('0x45')]);_0xd83992['query']=_['keys'](_0x717e74[_0xe0b0('0x49')]);_0xd83992[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0xd83992[_0xe0b0('0x4c')],_0xd83992[_0xe0b0('0x49')]);_0x20d6bd[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0xd83992['model'],qs['fields'](_0x717e74[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x20d6bd[_0xe0b0('0x4e')]=_0x20d6bd[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x20d6bd[_0xe0b0('0x4e')]:_0xd83992[_0xe0b0('0x4c')];if(_0x717e74[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x20d6bd[_0xe0b0('0xba')]=[{'all':!![]}];}_0x20d6bd=_['merge']({},_0x20d6bd,_0x717e74[_0xe0b0('0xbb')]);return db[_0xe0b0('0x44')]['find'](_0x20d6bd)[_0xe0b0('0x20')](handleEntityNotFound(_0x184938,null))[_0xe0b0('0x20')](respondWithResult(_0x184938,null))[_0xe0b0('0x27')](handleError(_0x184938,null));};exports[_0xe0b0('0xbc')]=function(_0x41fdef,_0x594f91){return db[_0xe0b0('0x44')][_0xe0b0('0xbc')](_0x41fdef[_0xe0b0('0x38')],{})[_0xe0b0('0x20')](respondWithResult(_0x594f91,0xc9))[_0xe0b0('0x27')](handleError(_0x594f91,null));};exports['update']=function(_0x475404,_0x58d61b){if(_0x475404[_0xe0b0('0x38')]['id']){delete _0x475404[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')]['find']({'where':{'id':_0x475404['params']['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x58d61b,null))[_0xe0b0('0x20')](saveUpdates(_0x475404[_0xe0b0('0x38')],null))['then'](respondWithResult(_0x58d61b,null))['catch'](handleError(_0x58d61b,null));};exports['destroy']=function(_0x5175e1,_0x57694c){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x5175e1[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x57694c,null))[_0xe0b0('0x20')](removeEntity(_0x57694c,null))[_0xe0b0('0x27')](handleError(_0x57694c,null));};exports[_0xe0b0('0xbd')]=function(_0xd73b8a,_0x437588){return db['ChatInteraction']['describe']()[_0xe0b0('0x20')](respondWithResult(_0x437588,null))[_0xe0b0('0x27')](handleError(_0x437588,null));};exports[_0xe0b0('0xbe')]=function(_0x52dfd8,_0x6ab413){var _0x395083=_0x52dfd8[_0xe0b0('0xb7')]['id'];var _0xd231c4;var _0x35ca4e;var _0x1b8d4a;return db['ChatInteraction']['findOne']({'where':{'id':_0x395083}})['then'](function(_0x1ce027){_0xd231c4=_0x1ce027;return db[_0xe0b0('0xbf')][_0xe0b0('0xc0')]({'where':{'id':_0x1ce027[_0xe0b0('0x9c')]},'attributes':['id',_0xe0b0('0xc1'),_0xe0b0('0xc2'),_0xe0b0('0xc3'),_0xe0b0('0xc4'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x28ba25){if(_0x28ba25&&_0x28ba25[_0xe0b0('0xc1')]&&_0x28ba25[_0xe0b0('0xc2')]){_0x35ca4e=_0x28ba25;var _0x5451e7={'interaction':{'id':_0x395083},'agent':{'id':_0x52dfd8[_0xe0b0('0x99')]['id'],'name':_0x52dfd8[_0xe0b0('0x99')][_0xe0b0('0x48')],'fullname':_0x52dfd8['user'][_0xe0b0('0xc5')],'email':_0x52dfd8['user'][_0xe0b0('0xc6')]},'contact':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x39')],'account':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x3b')]};var _0x26df60={'rejectUnauthorized':![],'method':_0xe0b0('0xc7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x28ba25[_0xe0b0('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x52dfd8[_0xe0b0('0x99')]['email']],'buttons':null,'topic':_0x35ca4e[_0xe0b0('0xc3')],'note':_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xc4')])?null:getMustacheRender(_0x35ca4e['vidaooNote'],_0x5451e7),'metadata':null},'redirect':_0xe0b0('0xc9'),'json':!![]};try{if(!_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xca')])){var _0x566a6e=getMustacheRender(_0x35ca4e[_0xe0b0('0xca')],_0x5451e7);var _0x32f67b=JSON[_0xe0b0('0x7f')](_0x566a6e);_0x26df60[_0xe0b0('0x38')][_0xe0b0('0xcb')]=_0x32f67b;}}catch(_0x15be52){throw new db['Sequelize'][(_0xe0b0('0xcc'))](_0xe0b0('0xcd'));}return rp(_0x26df60);}else{throw new db[(_0xe0b0('0x8e'))][(_0xe0b0('0xcc'))](_0xe0b0('0xce'));}})[_0xe0b0('0x20')](function(_0x38b2cf){_0x1b8d4a=_0x38b2cf;if(_0x1b8d4a['id']){var _0x31b01a={'body':_0x1b8d4a[_0xe0b0('0xcf')],'ChatWebsiteId':_0x35ca4e['id'],'ChatInteractionId':_0xd231c4['id'],'direction':_0xe0b0('0xd0'),'UserId':_0x52dfd8[_0xe0b0('0x99')]['id']};return db['ChatMessage'][_0xe0b0('0xbc')](_0x31b01a,{});}else{throw new db['Sequelize']['ValidationError'](_0xe0b0('0xd1'));}})[_0xe0b0('0x20')](function(){return _0xd231c4['updateAttributes']({'vidaooSessionId':_0x1b8d4a['id']});})[_0xe0b0('0x20')](respondWithResult(_0x6ab413,null))[_0xe0b0('0x27')](handleError(_0x6ab413,null));};exports[_0xe0b0('0xd2')]=function(_0x11e969,_0xa18619){if(_0x11e969[_0xe0b0('0x38')]['id']){delete _0x11e969[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x11e969['params']['id']},'include':[{'model':db[_0xe0b0('0xd3')],'as':_0xe0b0('0xd4')}]})[_0xe0b0('0x20')](handleEntityNotFound(_0xa18619,null))[_0xe0b0('0x20')](saveUpdates(_0x11e969['body'],null))['then'](respondWithResult(_0xa18619,null))[_0xe0b0('0x27')](handleError(_0xa18619,null));};exports[_0xe0b0('0xd5')]=function(_0x333c2a,_0x2cd7db,_0x308d03){if(_0x333c2a[_0xe0b0('0x38')]['id']){delete _0x333c2a[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x333c2a[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](function(_0xaa7a71){if(!_0xaa7a71){logger[_0xe0b0('0x22')](_0xe0b0('0xd6'),_0xe0b0('0xd5'),0x194,_0xe0b0('0xd7'));_0x2cd7db[_0xe0b0('0x28')](0x194);}else{if(_0xaa7a71[_0xe0b0('0x7a')]){throw new db[(_0xe0b0('0x8e'))]['ValidationError'](_0xe0b0('0xd8'));}}return _0xaa7a71;})[_0xe0b0('0x20')](function(_0x36a006){if(_0x36a006){return _0x36a006['update']({'closed':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xd9')],'disposition':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xda')]})[_0xe0b0('0x20')](function(_0x3532f1){return _0x3532f1;});}})[_0xe0b0('0x20')](function(_0x581ae9){return respondWithRpcPromise(_0xe0b0('0xdb'),'abandon',_0x333c2a[_0xe0b0('0x38')],client9004);})['then'](respondWithResult(_0x2cd7db,null))[_0xe0b0('0x27')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xdc')]=function(_0x4bd799,_0x2102bc,_0x4f0cbe){_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0x48')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xde')];_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0xdf')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xe0')];_0x4bd799['body'][_0xe0b0('0x47')]=_0x4bd799['file']['mimetype'];return db[_0xe0b0('0xe1')][_0xe0b0('0xbc')](_0x4bd799[_0xe0b0('0x38')])['then'](respondWithResult(_0x2102bc,0xc9))['catch'](handleError(_0x2102bc,null));};exports[_0xe0b0('0xe2')]=function(_0x3c207e,_0x4fc379,_0x98e7c9){return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0xb7')]['id']},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null))[_0xe0b0('0x20')](function(_0x4074bb){if(_0x4074bb){if(_0x4074bb[_0xe0b0('0xd9')]){return _0x4fc379[_0xe0b0('0x29')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe0b0('0xe1')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0x49')][_0xe0b0('0xe3')]},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null));}})[_0xe0b0('0x20')](function(_0x54f90a){if(_0x54f90a){var _0x1aa40b=_0x54f90a[_0xe0b0('0xe4')]!==null;var _0x22c8a2=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server/files/attachments/');if(_0x1aa40b){_0x22c8a2=path[_0xe0b0('0xe5')](_0x22c8a2,_0xe0b0('0xe7'));}var _0x321b0b=path[_0xe0b0('0xe5')](_0x22c8a2,_0x54f90a[_0xe0b0('0xdf')]);return _0x4fc379[_0xe0b0('0xe8')](_0x321b0b);}})[_0xe0b0('0x27')](handleError(_0x4fc379,null));};exports[_0xe0b0('0xe9')]=function(_0x1ccfc1,_0x2b1474){var _0x574f0a=null;var _0x108371=null;var _0x3f2ec=null;var _0x4f0db7=null;if(_0x1ccfc1[_0xe0b0('0x38')]['id']){delete _0x1ccfc1['body']['id'];}if(_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]){_0x4f0db7=path['join'](config[_0xe0b0('0xe6')],_0xe0b0('0xeb'),util[_0xe0b0('0xec')](_0xe0b0('0xed'),Date[_0xe0b0('0xee')]()));_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xef')]=_0x4f0db7;}return db['ChatInteraction']['find']({'where':{'id':_0x1ccfc1[_0xe0b0('0xb7')]['id']},'include':[{'model':db[_0xe0b0('0xf0')],'as':_0xe0b0('0xf1'),'include':[{'model':db['User'],'as':_0xe0b0('0x78')}]}]})[_0xe0b0('0x20')](handleEntityNotFound(_0x2b1474,null))[_0xe0b0('0x20')](saveUpdates(_0x1ccfc1[_0xe0b0('0x38')],null))[_0xe0b0('0x20')](function(_0x117d00){if(_0x117d00){_0x574f0a=_0x117d00;return db[_0xe0b0('0xbf')][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x9c')]}});}})[_0xe0b0('0x20')](function(_0x5aa313){if(_0x5aa313){_0x3f2ec=_0x5aa313;return db['CmContact'][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x74')]}});}})[_0xe0b0('0x20')](function(_0x3c93c6){if(_0x3c93c6){_0x108371=_0x3c93c6;if(_0x4f0db7){var _0x203351=null;for(var _0x343409=0x1;_0x343409<_0x574f0a[_0xe0b0('0xf1')]['length'];++_0x343409){_0x203351=_0x574f0a[_0xe0b0('0xf1')][_0x343409];var _0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util['format'](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351['UserId']):'System';var _0x3b3473=_0x1ccfc1['body'][_0xe0b0('0xf4')]||util['format'](_0xe0b0('0xf2'),_0xe0b0('0xf5'),_0x203351['ContactId']);switch(_0x3f2ec[_0xe0b0('0xf6')]){case _0xe0b0('0xf7'):_0x2e7fe2=_0x203351['UserId']?util[_0xe0b0('0xec')]('%s%d',_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');break;case _0xe0b0('0xf9'):_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?_0x203351[_0xe0b0('0x78')][_0xe0b0('0xfa')]||_0x203351['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8');break;case'agent_fullname':_0x2e7fe2=_0x203351['UserId']?_0x203351[_0xe0b0('0x78')]['fullname']:_0xe0b0('0xf8');break;default:_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util[_0xe0b0('0xec')](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');}var _0x8364b0=util[_0xe0b0('0xec')](_0xe0b0('0xfb'),moment(_0x203351[_0xe0b0('0x7e')])[_0xe0b0('0xec')](_0xe0b0('0xfc')),_0x203351[_0xe0b0('0xfd')]==='in'?_0x3b3473:_0x2e7fe2,_0x203351['body']);if(!_0x203351[_0xe0b0('0xfe')]){fs[_0xe0b0('0xff')](_0x4f0db7,_0x8364b0);}}return db[_0xe0b0('0x100')][_0xe0b0('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b0('0x101')],'as':'Smtp','raw':!![]}]});}}})[_0xe0b0('0x20')](function(_0x3a75d8){if(_0x3a75d8&&_0x3a75d8[_0xe0b0('0x102')]&&_0x1ccfc1[_0xe0b0('0x38')]){var _0x1e2ef8={'tls':{'rejectUnauthorized':![]}};if(_0x3a75d8[_0xe0b0('0x102')]['service']){_0x1e2ef8[_0xe0b0('0x103')]=_0x3a75d8['Smtp'][_0xe0b0('0x103')];}else{_0x1e2ef8[_0xe0b0('0x104')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x104')];_0x1e2ef8[_0xe0b0('0x105')]=_0x3a75d8[_0xe0b0('0x102')]['port'];_0x1e2ef8[_0xe0b0('0x106')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x106')];}if(_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x107')]){_0x1e2ef8[_0xe0b0('0x108')]={'user':_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x99')],'pass':_0x3a75d8['Smtp']['pass']};}return respondWithRpcPromise(_0xe0b0('0x109'),'sendMail',{'account':_0x1e2ef8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3a75d8['name'],_0x3a75d8[_0xe0b0('0xc6')]||_0x3a75d8['Smtp']['user']),'to':_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')],'subject':_0xe0b0('0x10a'),'text':util[_0xe0b0('0xec')](_0xe0b0('0x10b'),_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]),'attachments':[{'path':_0x4f0db7}]}})[_0xe0b0('0x20')](function(){return _0x574f0a;})[_0xe0b0('0x27')](function(_0x43f1b1){console['error'](_0x43f1b1);});}else{return _0x574f0a;}})['then'](respondWithStatusCode(_0x2b1474,0xc8))[_0xe0b0('0x27')](handleError(_0x2b1474,null));};exports[_0xe0b0('0x10c')]=function(_0x2b8a03,_0x4f784a,_0x4b5a48){return db[_0xe0b0('0xf0')]['find']({'where':{'id':_0x2b8a03[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x4f784a,null))['then'](function(_0x2e393e){if(_0x2e393e){return _0x2e393e[_0xe0b0('0x10c')](_0x2b8a03[_0xe0b0('0x38')][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x2b8a03[_0xe0b0('0x38')],[_0xe0b0('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x4f784a,null))[_0xe0b0('0x27')](handleError(_0x4f784a,null));};exports[_0xe0b0('0x10f')]=function(_0x1f3162,_0x22da3a,_0x2b2c68){var _0x5c5c2d={'raw':![],'where':{}};var _0x4d6429={};var _0x322d1b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1f3162[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22da3a,null))[_0xe0b0('0x20')](function(_0x151da2){if(_0x151da2){_0x4d6429[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage']['rawAttributes']);_0x4d6429[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1f3162[_0xe0b0('0x49')]);_0x4d6429[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x4d6429[_0xe0b0('0x4c')],_0x4d6429[_0xe0b0('0x49')]);_0x5c5c2d[_0xe0b0('0x4e')]=_['intersection'](_0x4d6429[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1f3162[_0xe0b0('0x49')]['fields']));_0x5c5c2d[_0xe0b0('0x4e')]=_0x5c5c2d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5c5c2d[_0xe0b0('0x4e')]:_0x4d6429[_0xe0b0('0x4c')];if(!_0x1f3162[_0xe0b0('0x49')]['hasOwnProperty'](_0xe0b0('0x110'))){_0x5c5c2d[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1f3162['query'][_0xe0b0('0x2e')]);_0x5c5c2d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x1f3162[_0xe0b0('0x49')]['offset']);}_0x5c5c2d[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5c5c2d[_0xe0b0('0x7c')]=qs[_0xe0b0('0xb8')](_[_0xe0b0('0x53')](_0x1f3162[_0xe0b0('0x49')],_0x4d6429['filters']));_0x5c5c2d[_0xe0b0('0x7c')]['ChatInteractionId']=_0x151da2['id'];if(_0x1f3162['query'][_0xe0b0('0x88')]){_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d['where'],{'$or':_[_0xe0b0('0x3d')](_0x5c5c2d['attributes'],function(_0xf0c217){var _0x4c5406={};_0x4c5406[_0xf0c217]={'$like':'%'+_0x1f3162['query']['filter']+'%'};return _0x4c5406;})});}if(_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x80')]){var _0x55e013=_0x1f3162[_0xe0b0('0x49')]['$gte']['split'](',');var _0x31fa9d={};_0x31fa9d[_0x55e013[0x0]]={'$gte':moment(_0x55e013[0x1])['format'](_0xe0b0('0x111'))};_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d[_0xe0b0('0x7c')],_0x31fa9d);}_0x5c5c2d=_['merge']({},_0x5c5c2d,_0x1f3162[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')][_0xe0b0('0x2f')]({'where':_0x5c5c2d[_0xe0b0('0x7c')]})[_0xe0b0('0x20')](function(_0x51600e){_0x322d1b[_0xe0b0('0x2f')]=_0x51600e;if(_0x1f3162[_0xe0b0('0x49')]['includeAll']){_0x5c5c2d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x5c5c2d);})[_0xe0b0('0x20')](function(_0x1e0374){_0x322d1b[_0xe0b0('0xb5')]=_0x1e0374;return _0x322d1b;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x22da3a,_0x5c5c2d))[_0xe0b0('0x27')](handleError(_0x22da3a,null));};exports[_0xe0b0('0x113')]=function(_0x5b7b02,_0x565f67,_0x2853bf){var _0x4c0d9d={'where':{}},_0x38dd79={},_0x2dc446={'count':0x0,'rows':[]};return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x5b7b02[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x565f67,null))['then'](function(_0x5996a6){if(_0x5996a6){_0x38dd79[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage'][_0xe0b0('0x45')]);_0x38dd79[_0xe0b0('0x49')]=_['keys'](_0x5b7b02[_0xe0b0('0x49')]);_0x38dd79[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x38dd79['model'],_0x38dd79[_0xe0b0('0x49')]);_0x4c0d9d[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0x38dd79[_0xe0b0('0x4c')],qs['fields'](_0x5b7b02[_0xe0b0('0x49')]['fields']));_0x4c0d9d[_0xe0b0('0x4e')]=_0x4c0d9d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x4c0d9d['attributes']:_0x38dd79[_0xe0b0('0x4c')];if(!_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x50')](_0xe0b0('0x110'))){_0x4c0d9d['limit']=qs[_0xe0b0('0x2e')](_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x2e')]);_0x4c0d9d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x5b7b02[_0xe0b0('0x49')]['offset']);}_0x4c0d9d['order']=qs['sort'](_0x5b7b02[_0xe0b0('0x49')]['sort']);_0x4c0d9d[_0xe0b0('0x7c')]=qs['filters'](_['pick'](_0x5b7b02[_0xe0b0('0x49')],_0x38dd79[_0xe0b0('0xb8')]));_0x4c0d9d[_0xe0b0('0x7c')][_0xe0b0('0xb3')]=_0x5996a6['id'];if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x88')]){_0x4c0d9d[_0xe0b0('0x7c')]=_['merge'](_0x4c0d9d[_0xe0b0('0x7c')],{'$or':_[_0xe0b0('0x3d')](_0x4c0d9d[_0xe0b0('0x4e')],function(_0x15033e){var _0x14ba21={};_0x14ba21[_0x15033e]={'$like':'%'+_0x5b7b02[_0xe0b0('0x49')]['filter']+'%'};return _0x14ba21;})});}_0x4c0d9d['where'][_0xe0b0('0xfe')]=![];if(_0x5b7b02[_0xe0b0('0x49')]['id']){_0x4c0d9d[_0xe0b0('0x7c')]['id']={'$gt':_0x5b7b02[_0xe0b0('0x49')]['id']};}_0x4c0d9d=_[_0xe0b0('0x37')]({},_0x4c0d9d,_0x5b7b02[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')]['count']({'where':_0x4c0d9d['where']})[_0xe0b0('0x20')](function(_0x16386b){_0x2dc446[_0xe0b0('0x2f')]=_0x16386b;_0x4c0d9d['include']=[];if(_0x5b7b02['query'][_0xe0b0('0x114')]){_0x4c0d9d[_0xe0b0('0xba')][_0xe0b0('0x42')]({'model':db[_0xe0b0('0x78')],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5'),_0xe0b0('0xfa')]});}if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x4c0d9d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x4c0d9d);})['then'](function(_0x2df3df){_0x2dc446['rows']=_0x2df3df;return _0x2dc446;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x565f67,_0x4c0d9d))[_0xe0b0('0x27')](handleError(_0x565f67,null));};exports['addTags']=function(_0x236966,_0x41fd0e,_0x17e7d4){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x236966[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x41fd0e,null))[_0xe0b0('0x20')](function(_0x19dafb){if(_0x19dafb){return _0x19dafb['setTags'](_0x236966['body'][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x236966['body'],['ids','id'])||{})[_0xe0b0('0x115')](function(){return db['Tag'][_0xe0b0('0x112')]({'attributes':['id',_0xe0b0('0x48'),_0xe0b0('0x55')],'where':{'id':_0x236966[_0xe0b0('0x38')][_0xe0b0('0x10d')]}});})[_0xe0b0('0x20')](function(_0x36106e){socket['emit'](_0xe0b0('0x116'),{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]});return{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]};});}})['then'](respondWithResult(_0x41fd0e,null))[_0xe0b0('0x27')](handleError(_0x41fd0e,null));};exports[_0xe0b0('0x117')]=function(_0x263288,_0x7117ca,_0x21ccfe){return db['ChatInteraction']['find']({'where':{'id':_0x263288['params']['id']}})['then'](handleEntityNotFound(_0x7117ca,null))[_0xe0b0('0x20')](function(_0x1bd420){if(_0x1bd420){return _0x1bd420[_0xe0b0('0x117')](_0x263288['query'][_0xe0b0('0x10d')]);}})[_0xe0b0('0x20')](respondWithStatusCode(_0x7117ca,null))[_0xe0b0('0x27')](handleError(_0x7117ca,null));};exports[_0xe0b0('0xe8')]=function(_0x2d2852,_0x16a02b){var _0x125ead=moment()['unix']()[_0xe0b0('0x9e')]();var _0x380fe1=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server',_0xe0b0('0x118'),_0xe0b0('0x119'));var _0x3eb643=path[_0xe0b0('0xe5')](config['root'],'server',_0xe0b0('0x118'),_0xe0b0('0x11a'));var _0x26bd6c=path[_0xe0b0('0xe5')](_0x380fe1,_0x125ead);var _0x104409=util[_0xe0b0('0xec')]('transcript-%d-%s.zip',_0x2d2852[_0xe0b0('0xb7')]['id'],_0x125ead);var _0x6f9dbd=path[_0xe0b0('0xe5')](_0x380fe1,_0x104409);var _0x4c6646=[];_0x4c6646[_0xe0b0('0x42')]({'model':db['User'],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5')],'raw':!![]});_0x4c6646['push']({'model':db[_0xe0b0('0xd3')],'as':'Contact','attributes':['id','firstName',_0xe0b0('0x11b')],'raw':!![]});if(_0x2d2852['query']['attachments']){_0x4c6646['push']({'model':db[_0xe0b0('0xe1')],'as':_0xe0b0('0xe1'),'raw':!![]});}var _0x573ca9=[{'model':db[_0xe0b0('0xf0')],'as':'Messages','attributes':['id',_0xe0b0('0x38'),_0xe0b0('0x7e'),_0xe0b0('0xfd'),_0xe0b0('0xfe'),'read'],'include':_0x4c6646}];_0x573ca9['push']({'model':db['ChatWebsite'],'as':_0xe0b0('0x11c'),'attributes':['id',_0xe0b0('0x48')]});_0x573ca9['push']({'model':db['User'],'as':_0xe0b0('0x11d'),'attributes':['id',_0xe0b0('0xc5')]});return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x2d2852['params']['id']},'include':_0x573ca9})['then'](handleEntityNotFound(_0x16a02b,null))[_0xe0b0('0x20')](function(_0x329684){if(_0x329684){var _0x5b1bb7=_0x329684[_0xe0b0('0x11e')]({'plain':!![]});fs[_0xe0b0('0x11f')](_0x26bd6c);var _0x5b7df1={'channel':'Chat','account':_0x5b1bb7['Account'][_0xe0b0('0x48')],'agent':_0x5b1bb7[_0xe0b0('0x11d')]?_0x5b1bb7['Owner'][_0xe0b0('0xc5')]:_0xe0b0('0x120'),'createdAt':moment(_0x5b1bb7[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'closedAt':_0x5b1bb7[_0xe0b0('0xd9')]?moment(_0x5b1bb7['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')]():'','disposition':_0x5b1bb7['disposition'],'chatInfo':{'browser':_0x5b1bb7[_0xe0b0('0x121')],'os':_0x5b1bb7['osName'],'referer':_0x5b1bb7['referer'],'customerIp':_0x5b1bb7[_0xe0b0('0x122')],'customerPort':_0x5b1bb7[_0xe0b0('0x123')]?_0x5b1bb7[_0xe0b0('0x123')]:_0xe0b0('0x120')},'messages':_(_0x5b1bb7['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x26a916){if(_0x26a916[_0xe0b0('0xe1')]){var _0x5b5bb2=path['join'](_0x3eb643,_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]);if(fs['existsSync'](_0x5b5bb2)){fs[_0xe0b0('0x124')](_0x5b5bb2)[_0xe0b0('0x125')](fs[_0xe0b0('0x126')](path[_0xe0b0('0xe5')](_0x26bd6c,_0x26a916['Attachment'][_0xe0b0('0xdf')])));}}return{'date':moment(_0x26a916[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'sender':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?_0x26a916[_0xe0b0('0x78')]?_0x26a916['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8'):_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x127')]+(_0x26a916[_0xe0b0('0xd4')]['lastName']?'\x20'+_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x11b')]:''),'body':_0x26a916['Attachment']?_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]:_0x26a916[_0xe0b0('0x38')],'direction':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?'A':'C','secret':_0x26a916[_0xe0b0('0xfe')],'read':_0x26a916['read'],'attachment':_0x26a916[_0xe0b0('0xe1')]};})[_0xe0b0('0x6d')]()};return ejs[_0xe0b0('0x128')](path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],_0xe0b0('0x129'),_0xe0b0('0x12a'),_0xe0b0('0x12b')),{'interaction':_0x5b7df1})[_0xe0b0('0x20')](function(_0x1f5871){var _0x4d12b2=path[_0xe0b0('0xe5')](_0x26bd6c,'transcript-'+_0x5b1bb7['id']+'-'+_0x125ead+_0xe0b0('0x12c'));var _0x4b655d={'path':_0x4d12b2,'channel':'Chat','interactionId':_0x5b1bb7['id']};return pdf[_0xe0b0('0x12d')](_0x1f5871,_0x4b655d);})[_0xe0b0('0x20')](function(){return new BPromise(function(_0x5b8cef,_0x4d4eae){zipdir(_0x26bd6c,{'saveTo':_0x6f9dbd},function(_0x388f0d,_0x317dee){if(_0x388f0d)return _0x4d4eae(_0x388f0d);return _0x5b8cef(_0x317dee);});})['then'](function(){return new BPromise(function(_0x5501c2,_0xa7f2cf){rimraf(_0x26bd6c,function(_0x2c61b3){if(_0x2c61b3)_0xa7f2cf(_0x2c61b3);return _0x5501c2();});});})['then'](function(){return _0x16a02b[_0xe0b0('0xe8')](_0x6f9dbd,_0x104409,function(_0x465315){if(_0x465315){console[_0xe0b0('0x12e')](_0xe0b0('0x12f'),_0x465315);}else{fs['unlinkSync'](_0x6f9dbd);}});});});}else{return _0x16a02b[_0xe0b0('0x28')](0xc8);}})[_0xe0b0('0x27')](handleError(_0x16a02b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 58e9913..d7a802d 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 _0x1e4e=['Users','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove'];(function(_0x166e62,_0x398c3d){var _0x1b580b=function(_0x1b70f7){while(--_0x1b70f7){_0x166e62['push'](_0x166e62['shift']());}};_0x1b580b(++_0x398c3d);}(_0x1e4e,0x79));var _0xe1e4=function(_0x47318f,_0x37198e){_0x47318f=_0x47318f-0x0;var _0x5b6fe6=_0x1e4e[_0x47318f];return _0x5b6fe6;};'use strict';var EventEmitter=require(_0xe1e4('0x0'));var ChatInteraction=require(_0xe1e4('0x1'))['db'][_0xe1e4('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xe1e4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe1e4('0x4')](0x0);var events={'afterCreate':_0xe1e4('0x5'),'afterUpdate':'update','afterDestroy':_0xe1e4('0x6')};function emitEvent(_0x11bd24){return function(_0x36b85a,_0x2ac7d3,_0xf27133){_0x36b85a['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x252ef7){_0x36b85a['setDataValue'](_0xe1e4('0x7'),_0x252ef7['map'](function(_0x385d30){return{'id':_0x385d30['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x36b85a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe1e4('0x8')](function(_0x4edd13){_0x36b85a[_0xe1e4('0x9')](_0xe1e4('0xa'),_0x4edd13[_0xe1e4('0xb')]);ChatInteractionEvents[_0xe1e4('0xc')](_0x11bd24+':'+_0x36b85a['id'],_0x36b85a);ChatInteractionEvents['emit'](_0x11bd24,_0x36b85a);_0xf27133(null);})[_0xe1e4('0xd')](_0xf27133(null));};}for(var e in events){if(events[_0xe1e4('0xe')](e)){var event=events[e];ChatInteraction[_0xe1e4('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x4fc6=['../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x222ce2,_0x4732be){var _0x5bb103=function(_0x521772){while(--_0x521772){_0x222ce2['push'](_0x222ce2['shift']());}};_0x5bb103(++_0x4732be);}(_0x4fc6,0x143));var _0x64fc=function(_0x3f8bc2,_0x4093cd){_0x3f8bc2=_0x3f8bc2-0x0;var _0x16a48d=_0x4fc6[_0x3f8bc2];return _0x16a48d;};'use strict';var EventEmitter=require(_0x64fc('0x0'));var ChatInteraction=require(_0x64fc('0x1'))['db'][_0x64fc('0x2')];var ChatMessage=require(_0x64fc('0x1'))['db'][_0x64fc('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x64fc('0x4'),'afterUpdate':_0x64fc('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5121d4){return function(_0x10e9ff,_0x22810d,_0x4c94c5){_0x10e9ff[_0x64fc('0x6')]({'attributes':['id'],'raw':!![]})[_0x64fc('0x7')](function(_0x4d1c14){_0x10e9ff[_0x64fc('0x8')](_0x64fc('0x9'),_0x4d1c14[_0x64fc('0xa')](function(_0xcd6c25){return{'id':_0xcd6c25['id']};}));return ChatMessage[_0x64fc('0xb')]({'where':{'ChatInteractionId':_0x10e9ff['id'],'direction':'in','read':![]},'raw':!![]});})[_0x64fc('0x7')](function(_0x3a510f){_0x10e9ff[_0x64fc('0x8')](_0x64fc('0xc'),_0x3a510f[_0x64fc('0xd')]);ChatInteractionEvents[_0x64fc('0xe')](_0x5121d4+':'+_0x10e9ff['id'],_0x10e9ff);ChatInteractionEvents['emit'](_0x5121d4,_0x10e9ff);_0x4c94c5(null);})[_0x64fc('0xf')](_0x4c94c5(null));};}for(var e in events){if(events[_0x64fc('0x10')](e)){var event=events[e];ChatInteraction[_0x64fc('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 6725883..1bc782b 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 _0x894e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x818df1,_0x59619f){var _0x21efbd=function(_0xec33f){while(--_0xec33f){_0x818df1['push'](_0x818df1['shift']());}};_0x21efbd(++_0x59619f);}(_0x894e,0x1a0));var _0xe894=function(_0x52835d,_0x47b9b3){_0x52835d=_0x52835d-0x0;var _0x5724c0=_0x894e[_0x52835d];return _0x5724c0;};'use strict';var _=require(_0xe894('0x0'));var util=require('util');var logger=require(_0xe894('0x1'))(_0xe894('0x2'));var moment=require(_0xe894('0x3'));var BPromise=require(_0xe894('0x4'));var rp=require(_0xe894('0x5'));var fs=require('fs');var path=require(_0xe894('0x6'));var rimraf=require(_0xe894('0x7'));var config=require(_0xe894('0x8'));var attributes=require('./chatInteraction.attributes');module[_0xe894('0x9')]=function(_0x40d08c,_0x360b5e){return _0x40d08c['define']('ChatInteraction',attributes,{'tableName':_0xe894('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a69f5,_0x234662,_0xdc513b){if(_0x5a69f5[_0xe894('0xb')](_0xe894('0xc'))){_0x5a69f5['closedAt']=moment()['format'](_0xe894('0xd'));}_0xdc513b(null,_0x5a69f5);}},'charset':_0xe894('0xe'),'collate':_0xe894('0xf')});}; \ No newline at end of file +var _0x8939=['utf8mb4','util','../../config/logger','bluebird','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8939,0x15f));var _0x9893=function(_0x42a2d1,_0x55a9c3){_0x42a2d1=_0x42a2d1-0x0;var _0x59d91e=_0x8939[_0x42a2d1];return _0x59d91e;};'use strict';var _=require('lodash');var util=require(_0x9893('0x0'));var logger=require(_0x9893('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9893('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9893('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9893('0x4'));module[_0x9893('0x5')]=function(_0x2c1b86,_0x378e02){return _0x2c1b86[_0x9893('0x6')](_0x9893('0x7'),attributes,{'tableName':_0x9893('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe1ed9f,_0x50eb6d,_0x108b4b){if(_0xe1ed9f[_0x9893('0x9')](_0x9893('0xa'))){_0xe1ed9f[_0x9893('0xb')]=moment()['format'](_0x9893('0xc'));}_0x108b4b(null,_0xe1ed9f);}},'charset':_0x9893('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 980f889..d10a3fe 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 _0x6ca2=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','then','UpdateChatInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x2f1d17,_0x5076aa){var _0x4b1270=function(_0x55125c){while(--_0x55125c){_0x2f1d17['push'](_0x2f1d17['shift']());}};_0x4b1270(++_0x5076aa);}(_0x6ca2,0x181));var _0x26ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6ca2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26ca('0x0'));var util=require('util');var moment=require(_0x26ca('0x1'));var BPromise=require(_0x26ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26ca('0x3'))['db'];var utils=require(_0x26ca('0x4'));var logger=require(_0x26ca('0x5'))(_0x26ca('0x6'));var config=require(_0x26ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x26ca('0x8')][_0x26ca('0x9')]({'port':0x232a});config[_0x26ca('0xa')]=_['defaults'](config[_0x26ca('0xa')],{'host':_0x26ca('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26ca('0xa')]));require(_0x26ca('0xc'))['register'](socket);function respondWithRpcPromise(_0x3fdf97,_0x5cc4ca,_0x47cc59){return new BPromise(function(_0x3ed7d3,_0x483c0d){return client[_0x26ca('0xd')](_0x3fdf97,_0x47cc59)['then'](function(_0x1ed7a4){logger[_0x26ca('0xe')](_0x26ca('0xf'),_0x5cc4ca,_0x26ca('0x10'));logger[_0x26ca('0x11')](_0x26ca('0x12'),_0x5cc4ca,_0x26ca('0x10'),JSON[_0x26ca('0x13')](_0x1ed7a4));if(_0x1ed7a4[_0x26ca('0x14')]){if(_0x1ed7a4['error'][_0x26ca('0x15')]===0x1f4){logger[_0x26ca('0x14')](_0x26ca('0xf'),_0x5cc4ca,_0x1ed7a4['error'][_0x26ca('0x16')]);return _0x483c0d(_0x1ed7a4[_0x26ca('0x14')][_0x26ca('0x16')]);}logger[_0x26ca('0x14')](_0x26ca('0xf'),_0x5cc4ca,_0x1ed7a4['error'][_0x26ca('0x16')]);return _0x3ed7d3(_0x1ed7a4[_0x26ca('0x14')][_0x26ca('0x16')]);}else{logger[_0x26ca('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x5cc4ca,_0x26ca('0x10'));_0x3ed7d3(_0x1ed7a4['result'][_0x26ca('0x16')]);}})[_0x26ca('0x17')](function(_0xfe6879){logger[_0x26ca('0x14')](_0x26ca('0xf'),_0x5cc4ca,_0xfe6879);_0x483c0d(_0xfe6879);});});}exports['UpdateChatInteraction']=function(_0x19e856){var _0x1c25c3=this;return new Promise(function(_0x85760b,_0x7531bd){return db[_0x26ca('0x18')][_0x26ca('0x19')](_0x19e856[_0x26ca('0x1a')],{'raw':_0x19e856['options']?_0x19e856[_0x26ca('0x1b')][_0x26ca('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19e856[_0x26ca('0x1b')]?_0x19e856['options'][_0x26ca('0x1d')]||null:null,'attributes':_0x19e856['options']?_0x19e856[_0x26ca('0x1b')][_0x26ca('0x1e')]||null:null,'limit':_0x19e856[_0x26ca('0x1b')]?_0x19e856['options'][_0x26ca('0x1f')]||null:null})[_0x26ca('0x20')](function(_0x2b1260){logger[_0x26ca('0xe')](_0x26ca('0x21'),_0x19e856);logger[_0x26ca('0x11')](_0x26ca('0x21'),_0x19e856,JSON[_0x26ca('0x13')](_0x2b1260));_0x85760b(_0x2b1260);})['catch'](function(_0x1ea98d){logger[_0x26ca('0x14')]('UpdateChatInteraction',_0x1ea98d['message'],_0x19e856);_0x7531bd(_0x1c25c3[_0x26ca('0x14')](0x1f4,_0x1ea98d[_0x26ca('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x5570a1){return new Promise(function(_0x56983d,_0x2eefa4){return db[_0x26ca('0x18')]['find']({'where':_0x5570a1[_0x26ca('0x1b')]?_0x5570a1['options'][_0x26ca('0x1d')]||null:null})[_0x26ca('0x20')](function(_0x2f3f19){if(_0x2f3f19){return _0x2f3f19[_0x26ca('0x22')](_0x5570a1[_0x26ca('0x1a')][_0x26ca('0x23')],_[_0x26ca('0x24')](_0x5570a1[_0x26ca('0x1a')],[_0x26ca('0x23'),'id'])||{});}})[_0x26ca('0x25')](function(_0x12ba78){logger['info'](_0x26ca('0x26'),_0x5570a1);logger[_0x26ca('0x11')]('AddTags',_0x5570a1,JSON[_0x26ca('0x13')](_0x12ba78));_0x56983d(_0x12ba78);})['catch'](function(_0x10c2c2){logger[_0x26ca('0x14')](_0x26ca('0x26'),_0x10c2c2[_0x26ca('0x16')],_0x5570a1);_0x2eefa4(_this['error'](0x1f4,_0x10c2c2['message']));});});}; \ No newline at end of file +var _0x5f75=['find','ids','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','register','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','result','ChatInteraction','update','body','options','raw','where','limit','UpdateChatInteraction','stringify','catch'];(function(_0x1e6c80,_0x3f5af7){var _0x3c3ec0=function(_0xdbdc23){while(--_0xdbdc23){_0x1e6c80['push'](_0x1e6c80['shift']());}};_0x3c3ec0(++_0x3f5af7);}(_0x5f75,0x1d7));var _0x55f7=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x5f75[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x55f7('0x0'));var util=require('util');var moment=require(_0x55f7('0x1'));var BPromise=require('bluebird');var rs=require(_0x55f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55f7('0x3'))['db'];var utils=require(_0x55f7('0x4'));var logger=require(_0x55f7('0x5'))(_0x55f7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55f7('0x7')]['http']({'port':0x232a});config[_0x55f7('0x8')]=_[_0x55f7('0x9')](config['redis'],{'host':_0x55f7('0xa'),'port':0x18eb});var socket=require(_0x55f7('0xb'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x55f7('0xc')](socket);function respondWithRpcPromise(_0x202b71,_0x20f99c,_0x4ca73d){return new BPromise(function(_0x1db6a1,_0x444224){return client['request'](_0x202b71,_0x4ca73d)[_0x55f7('0xd')](function(_0x1b8e76){logger[_0x55f7('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x20f99c,'request\x20sent');logger[_0x55f7('0xf')](_0x55f7('0x10'),_0x20f99c,'request\x20sent',JSON['stringify'](_0x1b8e76));if(_0x1b8e76[_0x55f7('0x11')]){if(_0x1b8e76[_0x55f7('0x11')][_0x55f7('0x12')]===0x1f4){logger[_0x55f7('0x11')](_0x55f7('0x13'),_0x20f99c,_0x1b8e76['error'][_0x55f7('0x14')]);return _0x444224(_0x1b8e76[_0x55f7('0x11')][_0x55f7('0x14')]);}logger['error'](_0x55f7('0x13'),_0x20f99c,_0x1b8e76[_0x55f7('0x11')][_0x55f7('0x14')]);return _0x1db6a1(_0x1b8e76[_0x55f7('0x11')]['message']);}else{logger[_0x55f7('0xe')](_0x55f7('0x13'),_0x20f99c,_0x55f7('0x15'));_0x1db6a1(_0x1b8e76[_0x55f7('0x16')][_0x55f7('0x14')]);}})['catch'](function(_0x54ff89){logger['error'](_0x55f7('0x13'),_0x20f99c,_0x54ff89);_0x444224(_0x54ff89);});});}exports['UpdateChatInteraction']=function(_0x1eddb9){var _0x195feb=this;return new Promise(function(_0x1bbc5b,_0x1fb2e9){return db[_0x55f7('0x17')][_0x55f7('0x18')](_0x1eddb9[_0x55f7('0x19')],{'raw':_0x1eddb9[_0x55f7('0x1a')]?_0x1eddb9[_0x55f7('0x1a')][_0x55f7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eddb9[_0x55f7('0x1a')]?_0x1eddb9['options'][_0x55f7('0x1c')]||null:null,'attributes':_0x1eddb9[_0x55f7('0x1a')]?_0x1eddb9['options']['attributes']||null:null,'limit':_0x1eddb9[_0x55f7('0x1a')]?_0x1eddb9[_0x55f7('0x1a')][_0x55f7('0x1d')]||null:null})[_0x55f7('0xd')](function(_0x2ef812){logger['info'](_0x55f7('0x1e'),_0x1eddb9);logger[_0x55f7('0xf')](_0x55f7('0x1e'),_0x1eddb9,JSON[_0x55f7('0x1f')](_0x2ef812));_0x1bbc5b(_0x2ef812);})[_0x55f7('0x20')](function(_0x5cdcc4){logger['error'](_0x55f7('0x1e'),_0x5cdcc4[_0x55f7('0x14')],_0x1eddb9);_0x1fb2e9(_0x195feb[_0x55f7('0x11')](0x1f4,_0x5cdcc4['message']));});});};exports['AddTagsToChatInteraction']=function(_0x4a2bf2){return new Promise(function(_0x549f81,_0x2bf8c6){return db[_0x55f7('0x17')][_0x55f7('0x21')]({'where':_0x4a2bf2[_0x55f7('0x1a')]?_0x4a2bf2[_0x55f7('0x1a')][_0x55f7('0x1c')]||null:null})[_0x55f7('0xd')](function(_0x1a11b1){if(_0x1a11b1){return _0x1a11b1['addTags'](_0x4a2bf2['body'][_0x55f7('0x22')],_['omit'](_0x4a2bf2[_0x55f7('0x19')],[_0x55f7('0x22'),'id'])||{});}})['spread'](function(_0x3d215e){logger[_0x55f7('0xe')](_0x55f7('0x23'),_0x4a2bf2);logger[_0x55f7('0xf')](_0x55f7('0x23'),_0x4a2bf2,JSON['stringify'](_0x3d215e));_0x549f81(_0x3d215e);})[_0x55f7('0x20')](function(_0xf2dce8){logger[_0x55f7('0x11')](_0x55f7('0x23'),_0xf2dce8['message'],_0x4a2bf2);_0x2bf8c6(_this['error'](0x1f4,_0xf2dce8[_0x55f7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a9c1abc..3b77cc3 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 _0xdf48=['update','emit','removeListener','length','chatInteraction:','save'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xdf48,0x113));var _0x8df4=function(_0x494ef8,_0x4688df){_0x494ef8=_0x494ef8-0x0;var _0x39c19=_0xdf48[_0x494ef8];return _0x39c19;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x8df4('0x0'),'remove',_0x8df4('0x1')];function createListener(_0x28d63d,_0x31588b){return function(_0x1631e1){_0x31588b[_0x8df4('0x2')](_0x28d63d,_0x1631e1);};}function removeListener(_0x365985,_0x78d3d){return function(){ChatInteractionEvents[_0x8df4('0x3')](_0x365985,_0x78d3d);};}exports['register']=function(_0x20cf09){for(var _0x4e2ce8=0x0,_0x5d33b1=events[_0x8df4('0x4')];_0x4e2ce8<_0x5d33b1;_0x4e2ce8++){var _0x59b430=events[_0x4e2ce8];var _0x551af1=createListener(_0x8df4('0x5')+_0x59b430,_0x20cf09);ChatInteractionEvents['on'](_0x59b430,_0x551af1);}}; \ No newline at end of file +var _0xd0ae=['update','emit','register','length','./chatInteraction.events','save'];(function(_0x4be1e5,_0x23a9fb){var _0x4df4d2=function(_0x16b519){while(--_0x16b519){_0x4be1e5['push'](_0x4be1e5['shift']());}};_0x4df4d2(++_0x23a9fb);}(_0xd0ae,0x160));var _0xed0a=function(_0x552f5b,_0x4cfa89){_0x552f5b=_0x552f5b-0x0;var _0x2bebd2=_0xd0ae[_0x552f5b];return _0x2bebd2;};'use strict';var ChatInteractionEvents=require(_0xed0a('0x0'));var events=[_0xed0a('0x1'),'remove',_0xed0a('0x2')];function createListener(_0x4c59b9,_0x377708){return function(_0x419790){_0x377708[_0xed0a('0x3')](_0x4c59b9,_0x419790);};}function removeListener(_0x11748b,_0x1b202f){return function(){ChatInteractionEvents['removeListener'](_0x11748b,_0x1b202f);};}exports[_0xed0a('0x4')]=function(_0x1c7a79){for(var _0xbfe1f9=0x0,_0x3747ce=events[_0xed0a('0x5')];_0xbfe1f9<_0x3747ce;_0xbfe1f9++){var _0x11534a=events[_0xbfe1f9];var _0x41ed4b=createListener('chatInteraction:'+_0x11534a,_0x1c7a79);ChatInteractionEvents['on'](_0x11534a,_0x41ed4b);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 74ddbd9..455623c 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 _0x78f8=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','customUpdate','/:id/abandon','/:id/close','close','delete','/:id','/:id/tags','removeTags','exports','multer'];(function(_0x53c103,_0x207914){var _0x21a11a=function(_0x231268){while(--_0x231268){_0x53c103['push'](_0x53c103['shift']());}};_0x21a11a(++_0x207914);}(_0x78f8,0x17f));var _0x878f=function(_0x2082a7,_0x5ecad1){_0x2082a7=_0x2082a7-0x0;var _0x35aeb1=_0x78f8[_0x2082a7];return _0x35aeb1;};'use strict';var multer=require(_0x878f('0x0'));var util=require('util');var path=require(_0x878f('0x1'));var timeout=require('connect-timeout');var express=require(_0x878f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x878f('0x3'));var interaction=require(_0x878f('0x4'));var config=require(_0x878f('0x5'));var controller=require(_0x878f('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x878f('0x7')](_0x878f('0x8'),auth[_0x878f('0x9')](),controller[_0x878f('0xa')]);router['get']('/:id',auth[_0x878f('0xb')](),controller['show']);router[_0x878f('0x7')]('/:id/attachment_download',auth[_0x878f('0xb')](),controller[_0x878f('0xc')]);router[_0x878f('0x7')](_0x878f('0xd'),auth[_0x878f('0x9')](),controller[_0x878f('0xe')]);router[_0x878f('0x7')](_0x878f('0xf'),auth[_0x878f('0xb')](),controller[_0x878f('0x10')]);router[_0x878f('0x7')](_0x878f('0x11'),auth[_0x878f('0x9')](),controller[_0x878f('0x12')]);router[_0x878f('0x13')]('/',auth[_0x878f('0x9')](),controller[_0x878f('0x14')]);router['post']('/:id/vidaoo',auth[_0x878f('0x9')](),controller[_0x878f('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b001e,_0x35c629,_0x21f528){_0x21f528(null,path[_0x878f('0x16')](config[_0x878f('0x17')],'server/files/attachments/'));},'filename':function(_0x1bb7e5,_0x2c8d79,_0x123fc1){_0x123fc1(null,util[_0x878f('0x18')](_0x878f('0x19'),Date[_0x878f('0x1a')](),_0x2c8d79[_0x878f('0x1b')][_0x878f('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x878f('0x13')](_0x878f('0x1d'),upload[_0x878f('0x1e')](_0x878f('0x1f')),controller[_0x878f('0x20')]);router[_0x878f('0x13')](_0x878f('0xd'),auth[_0x878f('0xb')](),controller[_0x878f('0x21')]);router[_0x878f('0x13')]('/:id/tags',auth[_0x878f('0x9')](),interaction[_0x878f('0x22')](_0x878f('0x23'),_0x878f('0x24')),controller['addTags']);router[_0x878f('0x25')]('/:id',auth[_0x878f('0x9')](),interaction[_0x878f('0x22')](_0x878f('0x23'),_0x878f('0x26')),controller['update']);router['put']('/:id/custom_update',controller[_0x878f('0x27')]);router[_0x878f('0x25')](_0x878f('0x28'),auth[_0x878f('0xb')](),controller['abandon']);router[_0x878f('0x25')](_0x878f('0x29'),controller[_0x878f('0x2a')]);router[_0x878f('0x2b')](_0x878f('0x2c'),auth[_0x878f('0x9')](),interaction['tracked'](_0x878f('0x23'),'chatinteraction:destroy'),controller['destroy']);router[_0x878f('0x2b')](_0x878f('0x2d'),auth[_0x878f('0x9')](),controller[_0x878f('0x2e')]);module[_0x878f('0x2f')]=router; \ No newline at end of file +var _0x2511=['addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload'];(function(_0x1d0395,_0x59b0de){var _0x1e4e75=function(_0x2915c5){while(--_0x2915c5){_0x1d0395['push'](_0x1d0395['shift']());}};_0x1e4e75(++_0x59b0de);}(_0x2511,0x1b7));var _0x1251=function(_0x1a0ebb,_0x33f753){_0x1a0ebb=_0x1a0ebb-0x0;var _0x2707d8=_0x2511[_0x1a0ebb];return _0x2707d8;};'use strict';var multer=require(_0x1251('0x0'));var util=require(_0x1251('0x1'));var path=require(_0x1251('0x2'));var timeout=require(_0x1251('0x3'));var express=require(_0x1251('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1251('0x5'));var interaction=require(_0x1251('0x6'));var config=require(_0x1251('0x7'));var controller=require(_0x1251('0x8'));router['get']('/',auth[_0x1251('0x9')](),controller[_0x1251('0xa')]);router[_0x1251('0xb')](_0x1251('0xc'),auth[_0x1251('0x9')](),controller[_0x1251('0xd')]);router['get'](_0x1251('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x1251('0xf')]);router['get'](_0x1251('0x10'),auth[_0x1251('0x11')](),controller[_0x1251('0x12')]);router[_0x1251('0xb')](_0x1251('0x13'),auth[_0x1251('0x9')](),controller['getMessages']);router[_0x1251('0xb')](_0x1251('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x1251('0x15')]);router[_0x1251('0xb')]('/:id/download',auth[_0x1251('0x9')](),controller[_0x1251('0x16')]);router[_0x1251('0x17')]('/',auth[_0x1251('0x9')](),controller[_0x1251('0x18')]);router[_0x1251('0x17')](_0x1251('0x19'),auth[_0x1251('0x9')](),controller[_0x1251('0x1a')]);var upload=multer({'storage':multer[_0x1251('0x1b')]({'destination':function(_0x24674a,_0x16a034,_0x10ea17){_0x10ea17(null,path[_0x1251('0x1c')](config[_0x1251('0x1d')],'server/files/attachments/'));},'filename':function(_0x4de35c,_0x5967ab,_0x18c295){_0x18c295(null,util[_0x1251('0x1e')](_0x1251('0x1f'),Date['now'](),_0x5967ab[_0x1251('0x20')][_0x1251('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x1251('0x22'),upload[_0x1251('0x23')](_0x1251('0x24')),controller[_0x1251('0x25')]);router[_0x1251('0x17')](_0x1251('0x13'),auth[_0x1251('0x11')](),controller[_0x1251('0x26')]);router[_0x1251('0x17')](_0x1251('0x27'),auth[_0x1251('0x9')](),interaction[_0x1251('0x28')](_0x1251('0x29'),'chatinteraction:addtags'),controller[_0x1251('0x2a')]);router[_0x1251('0x2b')](_0x1251('0xe'),auth['isAuthenticated'](),interaction[_0x1251('0x28')](_0x1251('0x29'),_0x1251('0x2c')),controller[_0x1251('0x2d')]);router['put']('/:id/custom_update',controller[_0x1251('0x2e')]);router[_0x1251('0x2b')](_0x1251('0x2f'),auth[_0x1251('0x11')](),controller[_0x1251('0x30')]);router[_0x1251('0x2b')]('/:id/close',controller['close']);router[_0x1251('0x31')](_0x1251('0xe'),auth[_0x1251('0x9')](),interaction[_0x1251('0x28')](_0x1251('0x29'),_0x1251('0x32')),controller[_0x1251('0x33')]);router[_0x1251('0x31')](_0x1251('0x27'),auth[_0x1251('0x9')](),controller['removeTags']);module[_0x1251('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 88f6433..c328527 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 _0x49ce=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x49ce,0x100));var _0xe49c=function(_0x4ee881,_0x10ddc8){_0x4ee881=_0x4ee881-0x0;var _0x305f48=_0x49ce[_0x4ee881];return _0x305f48;};'use strict';var Sequelize=require(_0xe49c('0x0'));module[_0xe49c('0x1')]={'body':{'type':Sequelize[_0xe49c('0x2')](_0xe49c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe49c('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf343=['INTEGER','medium','BOOLEAN'];(function(_0x5818e5,_0x4a974b){var _0x19dffd=function(_0x259381){while(--_0x259381){_0x5818e5['push'](_0x5818e5['shift']());}};_0x19dffd(++_0x4a974b);}(_0xf343,0x12d));var _0x3f34=function(_0x429f82,_0x211f75){_0x429f82=_0x429f82-0x0;var _0x4d82bb=_0xf343[_0x429f82];return _0x4d82bb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x3f34('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x3f34('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3f34('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6a90e6e..d7ad004 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 _0x2685=['autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','role','UserProfileSection','Agents','userProfileId'];(function(_0x3b7111,_0x588944){var _0x28e1b1=function(_0x674627){while(--_0x674627){_0x3b7111['push'](_0x3b7111['shift']());}};_0x28e1b1(++_0x588944);}(_0x2685,0x78));var _0x5268=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x2685[_0x38537f];return _0x141e23;};'use strict';var emlformat=require(_0x5268('0x0'));var rimraf=require(_0x5268('0x1'));var zipdir=require(_0x5268('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5268('0x3'));var util=require(_0x5268('0x4'));var path=require(_0x5268('0x5'));var sox=require(_0x5268('0x6'));var csv=require('to-csv');var ejs=require(_0x5268('0x7'));var fs=require('fs');var fs_extra=require(_0x5268('0x8'));var _=require(_0x5268('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5268('0xa'));var deskjs=require(_0x5268('0xb'));var toCsv=require(_0x5268('0xc'));var querystring=require(_0x5268('0xd'));var Papa=require(_0x5268('0xe'));var Redis=require(_0x5268('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5268('0x10'));var as=require(_0x5268('0x11'));var hardwareService=require(_0x5268('0x12'));var logger=require(_0x5268('0x13'))(_0x5268('0x14'));var utils=require(_0x5268('0x15'));var config=require(_0x5268('0x16'));var licenseUtil=require(_0x5268('0x17'));var db=require(_0x5268('0x18'))['db'];config[_0x5268('0x19')]=_['defaults'](config[_0x5268('0x19')],{'host':_0x5268('0x1a'),'port':0x18eb});var socket=require(_0x5268('0x1b'))(new Redis(config['redis']));require(_0x5268('0x1c'))[_0x5268('0x1d')](socket);function respondWithStatusCode(_0xb4f75d,_0x4a54e8){_0x4a54e8=_0x4a54e8||0xcc;return function(_0x352a4c){if(_0x352a4c){return _0xb4f75d[_0x5268('0x1e')](_0x4a54e8);}return _0xb4f75d[_0x5268('0x1f')](_0x4a54e8)[_0x5268('0x20')]();};}function respondWithResult(_0x4a83e8,_0x3acdc0){_0x3acdc0=_0x3acdc0||0xc8;return function(_0x39a6eb){if(_0x39a6eb){return _0x4a83e8[_0x5268('0x1f')](_0x3acdc0)['json'](_0x39a6eb);}};}function respondWithFilteredResult(_0x22146a,_0x443725){return function(_0x4b769a){if(_0x4b769a){var _0x12fd6d=typeof _0x443725[_0x5268('0x21')]===_0x5268('0x22')&&typeof _0x443725[_0x5268('0x23')]==='undefined';var _0x2d3fb9=_0x4b769a[_0x5268('0x24')];var _0x4d0a0c=_0x12fd6d?0x0:_0x443725[_0x5268('0x21')];var _0x266b88=_0x12fd6d?_0x4b769a[_0x5268('0x24')]:_0x443725[_0x5268('0x21')]+_0x443725[_0x5268('0x23')];var _0x59d292;if(_0x266b88>=_0x2d3fb9){_0x266b88=_0x2d3fb9;_0x59d292=0xc8;}else{_0x59d292=0xce;}_0x22146a[_0x5268('0x1f')](_0x59d292);return _0x22146a[_0x5268('0x25')](_0x5268('0x26'),_0x4d0a0c+'-'+_0x266b88+'/'+_0x2d3fb9)[_0x5268('0x27')](_0x4b769a);}return null;};}function patchUpdates(_0x22e667){return function(_0xd7008a){try{jsonpatch['apply'](_0xd7008a,_0x22e667,!![]);}catch(_0x7e9538){return BPromise[_0x5268('0x28')](_0x7e9538);}return _0xd7008a[_0x5268('0x29')]();};}function saveUpdates(_0x5d3dd8,_0x402935){return function(_0x332352){if(_0x332352){return _0x332352['update'](_0x5d3dd8)['then'](function(_0x45e406){return _0x45e406;});}return null;};}function removeEntity(_0x5f56ad,_0x4c4362){return function(_0x2c9c5f){if(_0x2c9c5f){return _0x2c9c5f[_0x5268('0x2a')]()[_0x5268('0x2b')](function(){_0x5f56ad[_0x5268('0x1f')](0xcc)[_0x5268('0x20')]();});}};}function handleEntityNotFound(_0x29c76d,_0x32aed2){return function(_0x254c6f){if(!_0x254c6f){_0x29c76d[_0x5268('0x1e')](0x194);}return _0x254c6f;};}function handleError(_0x1922af,_0x4fd728){_0x4fd728=_0x4fd728||0x1f4;return function(_0x424e99){logger[_0x5268('0x2c')](_0x424e99[_0x5268('0x2d')]);if(_0x424e99[_0x5268('0x2e')]){delete _0x424e99[_0x5268('0x2e')];}_0x1922af[_0x5268('0x1f')](_0x4fd728)['send'](_0x424e99);};}exports[_0x5268('0x2f')]=function(_0x324317,_0x2a1b97){var _0x4a3df8={},_0x1c7844={},_0xbd4927={'count':0x0,'rows':[]};var _0x3153=_['map'](db[_0x5268('0x30')][_0x5268('0x31')],function(_0x244519){return{'name':_0x244519[_0x5268('0x32')],'type':_0x244519[_0x5268('0x33')][_0x5268('0x34')]};});_0x1c7844[_0x5268('0x35')]=_[_0x5268('0x36')](_0x3153,_0x5268('0x2e'));_0x1c7844[_0x5268('0x37')]=_['keys'](_0x324317['query']);_0x1c7844[_0x5268('0x38')]=_['intersection'](_0x1c7844['model'],_0x1c7844['query']);_0x4a3df8['attributes']=_[_0x5268('0x39')](_0x1c7844[_0x5268('0x35')],qs['fields'](_0x324317[_0x5268('0x37')][_0x5268('0x3a')]));_0x4a3df8[_0x5268('0x3b')]=_0x4a3df8[_0x5268('0x3b')][_0x5268('0x3c')]?_0x4a3df8[_0x5268('0x3b')]:_0x1c7844[_0x5268('0x35')];if(!_0x324317[_0x5268('0x37')][_0x5268('0x3d')](_0x5268('0x3e'))){_0x4a3df8[_0x5268('0x23')]=qs[_0x5268('0x23')](_0x324317[_0x5268('0x37')][_0x5268('0x23')]);_0x4a3df8[_0x5268('0x21')]=qs['offset'](_0x324317[_0x5268('0x37')][_0x5268('0x21')]);}_0x4a3df8[_0x5268('0x3f')]=qs[_0x5268('0x40')](_0x324317['query'][_0x5268('0x40')]);_0x4a3df8[_0x5268('0x41')]=qs[_0x5268('0x38')](_[_0x5268('0x42')](_0x324317['query'],_0x1c7844[_0x5268('0x38')]),_0x3153);if(_0x324317[_0x5268('0x37')][_0x5268('0x43')]){_0x4a3df8[_0x5268('0x41')]=_[_0x5268('0x44')](_0x4a3df8[_0x5268('0x41')],{'$or':_[_0x5268('0x36')](_0x3153,function(_0x3a034d){if(_0x3a034d[_0x5268('0x33')]!=='VIRTUAL'){var _0x3cb7c5={};_0x3cb7c5[_0x3a034d[_0x5268('0x2e')]]={'$like':'%'+_0x324317[_0x5268('0x37')]['filter']+'%'};return _0x3cb7c5;}})});}_0x4a3df8=_[_0x5268('0x44')]({},_0x4a3df8,_0x324317['options']);var _0x4de773={'where':_0x4a3df8[_0x5268('0x41')]};return db[_0x5268('0x30')][_0x5268('0x24')](_0x4de773)[_0x5268('0x2b')](function(_0x4a17d1){_0xbd4927[_0x5268('0x24')]=_0x4a17d1;if(_0x324317[_0x5268('0x37')][_0x5268('0x45')]){_0x4a3df8[_0x5268('0x46')]=[{'all':!![]}];}return db[_0x5268('0x30')][_0x5268('0x47')](_0x4a3df8);})[_0x5268('0x2b')](function(_0x14659d){_0xbd4927['rows']=_0x14659d;return _0xbd4927;})['then'](respondWithFilteredResult(_0x2a1b97,_0x4a3df8))[_0x5268('0x48')](handleError(_0x2a1b97,null));};exports[_0x5268('0x49')]=function(_0x2ba589,_0x386395){var _0xbd1935={'raw':!![],'where':{'id':_0x2ba589[_0x5268('0x4a')]['id']}},_0x55b54d={};_0x55b54d[_0x5268('0x35')]=_[_0x5268('0x4b')](db['ChatInternalMessage'][_0x5268('0x31')]);_0x55b54d[_0x5268('0x37')]=_['keys'](_0x2ba589[_0x5268('0x37')]);_0x55b54d[_0x5268('0x38')]=_[_0x5268('0x39')](_0x55b54d['model'],_0x55b54d[_0x5268('0x37')]);_0xbd1935[_0x5268('0x3b')]=_[_0x5268('0x39')](_0x55b54d[_0x5268('0x35')],qs['fields'](_0x2ba589[_0x5268('0x37')][_0x5268('0x3a')]));_0xbd1935[_0x5268('0x3b')]=_0xbd1935['attributes'][_0x5268('0x3c')]?_0xbd1935[_0x5268('0x3b')]:_0x55b54d[_0x5268('0x35')];if(_0x2ba589[_0x5268('0x37')][_0x5268('0x45')]){_0xbd1935[_0x5268('0x46')]=[{'all':!![]}];}_0xbd1935=_[_0x5268('0x44')]({},_0xbd1935,_0x2ba589['options']);return db[_0x5268('0x30')][_0x5268('0x4c')](_0xbd1935)['then'](handleEntityNotFound(_0x386395,null))[_0x5268('0x2b')](respondWithResult(_0x386395,null))[_0x5268('0x48')](handleError(_0x386395,null));};exports[_0x5268('0x4d')]=function(_0x37606a,_0x21740c){return db[_0x5268('0x30')]['create'](_0x37606a[_0x5268('0x4e')],{})[_0x5268('0x2b')](respondWithResult(_0x21740c,0xc9))['catch'](handleError(_0x21740c,null));};exports[_0x5268('0x4f')]=function(_0x5b5e4f,_0x2b458b){if(_0x5b5e4f[_0x5268('0x4e')]['id']){delete _0x5b5e4f[_0x5268('0x4e')]['id'];}return db['ChatInternalMessage'][_0x5268('0x4c')]({'where':{'id':_0x5b5e4f[_0x5268('0x4a')]['id']}})[_0x5268('0x2b')](handleEntityNotFound(_0x2b458b,null))[_0x5268('0x2b')](saveUpdates(_0x5b5e4f['body'],null))[_0x5268('0x2b')](respondWithResult(_0x2b458b,null))[_0x5268('0x48')](handleError(_0x2b458b,null));};exports[_0x5268('0x2a')]=function(_0x5e53b9,_0x42ed53){return db['ChatInternalMessage']['find']({'where':{'id':_0x5e53b9[_0x5268('0x4a')]['id']}})[_0x5268('0x2b')](handleEntityNotFound(_0x42ed53,null))[_0x5268('0x2b')](removeEntity(_0x42ed53,null))[_0x5268('0x48')](handleError(_0x42ed53,null));};exports['describe']=function(_0x3a6221,_0x54ac29){return db['ChatInternalMessage'][_0x5268('0x50')]()[_0x5268('0x2b')](respondWithResult(_0x54ac29,null))[_0x5268('0x48')](handleError(_0x54ac29,null));};function wrapUser(_0x45e635){return function(_0x10a9e4){var _0xef5c7=_0x45e635['get']({'plain':!![]});_0xef5c7[_0x5268('0x51')]=[];if(_0x10a9e4){_0xef5c7[_0x5268('0x52')]=_0x10a9e4[_0x5268('0x53')];_0xef5c7[_0x5268('0x54')]=_0x10a9e4;}else{_0xef5c7['lastMessageAt']=moment(0x0)['format'](_0x5268('0x55'));_0xef5c7[_0x5268('0x54')]={};}return _0xef5c7;};}exports[_0x5268('0x56')]=function(_0x2dca65,_0xea835b,_0x3f7bfe){var _0x29f517=[];return db[_0x5268('0x57')][_0x5268('0x47')]({'where':{'role':[_0x5268('0x58'),'admin',_0x5268('0x59')]},'attributes':['id',_0x5268('0x5a'),_0x5268('0x2e'),'role',_0x5268('0x5b'),_0x5268('0x5c'),_0x5268('0x5d'),_0x5268('0x5e'),'allowmessenger',_0x5268('0x5f')],'order':qs['sort'](_0x5268('0x60')),'include':[{'model':db[_0x5268('0x61')],'as':_0x5268('0x62'),'attributes':['id','name',_0x5268('0x33')],'through':{'attributes':[]}}]})[_0x5268('0x2b')](function(_0x22fa3c){if(_0x22fa3c){var _0x1f01e2=_0x2dca65[_0x5268('0x59')][_0x5268('0x63')]({'plain':!![]});if(!_0x1f01e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f01e2[_0x5268('0x64')]===_0x5268('0x59')){return db[_0x5268('0x65')][_0x5268('0x4c')]({'where':{'name':_0x5268('0x66'),'userProfileId':_0x1f01e2[_0x5268('0x67')]},'raw':!![]})[_0x5268('0x2b')](function(_0x2e58aa){if(_0x2e58aa){if(_0x2e58aa[_0x5268('0x68')]===0x0){return db[_0x5268('0x69')][_0x5268('0x47')]({'where':{'sectionId':_0x2e58aa['id']},'raw':!![]})['then'](function(_0x25686c){var _0x59eec0=[];if(_['isEmpty'](_0x25686c)){_0x59eec0=_['filter'](_0x22fa3c,function(_0x13efc2){if(_0x13efc2['role']!==_0x5268('0x58')){return _0x13efc2;}});return _0x59eec0;}else{for(var _0x3e3bbd=0x0;_0x3e3bbd<_0x22fa3c['length'];_0x3e3bbd++){var _0x431295=_0x22fa3c[_0x3e3bbd];if(_0x431295[_0x5268('0x64')]===_0x5268('0x58')){var _0x329174=_[_0x5268('0x4c')](_0x25686c,function(_0x32cd22){return _0x32cd22[_0x5268('0x6a')]===_0x431295['id'];});if(_0x329174)_0x59eec0[_0x5268('0x6b')](_0x431295);}else{_0x59eec0[_0x5268('0x6b')](_0x431295);}}return _0x59eec0;}});}else{return _0x22fa3c;}}else{var _0x3a942b=_['filter'](_0x22fa3c,function(_0x3eb37e){if(_0x3eb37e[_0x5268('0x64')]!==_0x5268('0x58')){return _0x3eb37e;}});return _0x3a942b;}});}else{return _0x22fa3c;}}})[_0x5268('0x2b')](function(_0x33f381){var _0x1e4c72=[];if(_0x33f381){_0x29f517=_0x33f381;for(var _0x2f8c86=0x0;_0x2f8c86<_0x33f381[_0x5268('0x3c')];_0x2f8c86+=0x1){_0x29f517[_0x2f8c86]['messages']=[];_0x1e4c72['push'](db[_0x5268('0x30')][_0x5268('0x4c')]({'where':{'FromId':[_0x2dca65[_0x5268('0x59')]['id'],_0x33f381[_0x2f8c86]['id']],'ToId':[_0x2dca65[_0x5268('0x59')]['id'],_0x33f381[_0x2f8c86]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x5268('0x6c'),_0x5268('0x6d'),_0x5268('0x6e'),_0x5268('0x4e')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x33f381[_0x2f8c86])));}return BPromise[_0x5268('0x6f')](_0x1e4c72);}return[];})[_0x5268('0x2b')](function(_0x12a11c){return{'rows':_0x12a11c,'count':_0x12a11c[_0x5268('0x3c')]};})[_0x5268('0x2b')](respondWithResult(_0xea835b,null))['catch'](handleError(_0xea835b,null));}; \ No newline at end of file +var _0x98e9=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','then','params','keys','find','catch','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','user','role','userpic','internal','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','destroy','end','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query'];(function(_0x58cf25,_0x81c579){var _0x5ea98c=function(_0x23b4c2){while(--_0x23b4c2){_0x58cf25['push'](_0x58cf25['shift']());}};_0x5ea98c(++_0x81c579);}(_0x98e9,0x170));var _0x998e=function(_0x370bc1,_0x48b79f){_0x370bc1=_0x370bc1-0x0;var _0xea7580=_0x98e9[_0x370bc1];return _0xea7580;};'use strict';var emlformat=require(_0x998e('0x0'));var rimraf=require(_0x998e('0x1'));var zipdir=require(_0x998e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x998e('0x3'));var moment=require(_0x998e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x998e('0x5'));var util=require(_0x998e('0x6'));var path=require(_0x998e('0x7'));var sox=require(_0x998e('0x8'));var csv=require(_0x998e('0x9'));var ejs=require(_0x998e('0xa'));var fs=require('fs');var fs_extra=require(_0x998e('0xb'));var _=require(_0x998e('0xc'));var squel=require(_0x998e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x998e('0xe'));var toCsv=require(_0x998e('0x9'));var querystring=require(_0x998e('0xf'));var Papa=require(_0x998e('0x10'));var Redis=require(_0x998e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x998e('0x12'));var as=require(_0x998e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x998e('0x14'))(_0x998e('0x15'));var utils=require('../../config/utils');var config=require(_0x998e('0x16'));var licenseUtil=require(_0x998e('0x17'));var db=require(_0x998e('0x18'))['db'];config[_0x998e('0x19')]=_['defaults'](config['redis'],{'host':_0x998e('0x1a'),'port':0x18eb});var socket=require(_0x998e('0x1b'))(new Redis(config[_0x998e('0x19')]));require(_0x998e('0x1c'))['register'](socket);function respondWithStatusCode(_0x545951,_0x569b75){_0x569b75=_0x569b75||0xcc;return function(_0x2c12ba){if(_0x2c12ba){return _0x545951[_0x998e('0x1d')](_0x569b75);}return _0x545951[_0x998e('0x1e')](_0x569b75)['end']();};}function respondWithResult(_0x18b19a,_0x467f18){_0x467f18=_0x467f18||0xc8;return function(_0x139104){if(_0x139104){return _0x18b19a[_0x998e('0x1e')](_0x467f18)[_0x998e('0x1f')](_0x139104);}};}function respondWithFilteredResult(_0x38ca28,_0x232b36){return function(_0x1fc93e){if(_0x1fc93e){var _0x51f6db=typeof _0x232b36[_0x998e('0x20')]===_0x998e('0x21')&&typeof _0x232b36[_0x998e('0x22')]===_0x998e('0x21');var _0x4240fe=_0x1fc93e['count'];var _0x10aaf6=_0x51f6db?0x0:_0x232b36[_0x998e('0x20')];var _0xb114d2=_0x51f6db?_0x1fc93e[_0x998e('0x23')]:_0x232b36[_0x998e('0x20')]+_0x232b36[_0x998e('0x22')];var _0x96baa;if(_0xb114d2>=_0x4240fe){_0xb114d2=_0x4240fe;_0x96baa=0xc8;}else{_0x96baa=0xce;}_0x38ca28[_0x998e('0x1e')](_0x96baa);return _0x38ca28['set']('Content-Range',_0x10aaf6+'-'+_0xb114d2+'/'+_0x4240fe)[_0x998e('0x1f')](_0x1fc93e);}return null;};}function patchUpdates(_0x52d6de){return function(_0x489208){try{jsonpatch['apply'](_0x489208,_0x52d6de,!![]);}catch(_0x4f3756){return BPromise[_0x998e('0x24')](_0x4f3756);}return _0x489208[_0x998e('0x25')]();};}function saveUpdates(_0x3854ad,_0x2eda6a){return function(_0x7b518c){if(_0x7b518c){return _0x7b518c[_0x998e('0x26')](_0x3854ad)['then'](function(_0x5568af){return _0x5568af;});}return null;};}function removeEntity(_0x5c9bf0,_0x17f501){return function(_0x1a4c63){if(_0x1a4c63){return _0x1a4c63[_0x998e('0x27')]()['then'](function(){_0x5c9bf0[_0x998e('0x1e')](0xcc)[_0x998e('0x28')]();});}};}function handleEntityNotFound(_0x54b0f7,_0x384ab2){return function(_0xe1e234){if(!_0xe1e234){_0x54b0f7['sendStatus'](0x194);}return _0xe1e234;};}function handleError(_0x6e566d,_0x292c83){_0x292c83=_0x292c83||0x1f4;return function(_0x251bf1){logger[_0x998e('0x29')](_0x251bf1[_0x998e('0x2a')]);if(_0x251bf1[_0x998e('0x2b')]){delete _0x251bf1[_0x998e('0x2b')];}_0x6e566d[_0x998e('0x1e')](_0x292c83)['send'](_0x251bf1);};}exports['index']=function(_0x5d8f1f,_0x5b7ce3){var _0x1f771f={},_0x1defec={},_0x4ac9e9={'count':0x0,'rows':[]};var _0x14f06e=_[_0x998e('0x2c')](db[_0x998e('0x2d')][_0x998e('0x2e')],function(_0x4eef1b){return{'name':_0x4eef1b[_0x998e('0x2f')],'type':_0x4eef1b[_0x998e('0x30')][_0x998e('0x31')]};});_0x1defec[_0x998e('0x32')]=_['map'](_0x14f06e,_0x998e('0x2b'));_0x1defec[_0x998e('0x33')]=_['keys'](_0x5d8f1f['query']);_0x1defec[_0x998e('0x34')]=_[_0x998e('0x35')](_0x1defec['model'],_0x1defec[_0x998e('0x33')]);_0x1f771f[_0x998e('0x36')]=_[_0x998e('0x35')](_0x1defec['model'],qs[_0x998e('0x37')](_0x5d8f1f[_0x998e('0x33')]['fields']));_0x1f771f[_0x998e('0x36')]=_0x1f771f[_0x998e('0x36')][_0x998e('0x38')]?_0x1f771f[_0x998e('0x36')]:_0x1defec[_0x998e('0x32')];if(!_0x5d8f1f[_0x998e('0x33')][_0x998e('0x39')]('nolimit')){_0x1f771f[_0x998e('0x22')]=qs['limit'](_0x5d8f1f[_0x998e('0x33')][_0x998e('0x22')]);_0x1f771f[_0x998e('0x20')]=qs[_0x998e('0x20')](_0x5d8f1f['query'][_0x998e('0x20')]);}_0x1f771f[_0x998e('0x3a')]=qs[_0x998e('0x3b')](_0x5d8f1f[_0x998e('0x33')]['sort']);_0x1f771f['where']=qs[_0x998e('0x34')](_['pick'](_0x5d8f1f[_0x998e('0x33')],_0x1defec[_0x998e('0x34')]),_0x14f06e);if(_0x5d8f1f[_0x998e('0x33')]['filter']){_0x1f771f[_0x998e('0x3c')]=_[_0x998e('0x3d')](_0x1f771f[_0x998e('0x3c')],{'$or':_['map'](_0x14f06e,function(_0x1db07a){if(_0x1db07a['type']!==_0x998e('0x3e')){var _0x2a024a={};_0x2a024a[_0x1db07a[_0x998e('0x2b')]]={'$like':'%'+_0x5d8f1f[_0x998e('0x33')][_0x998e('0x3f')]+'%'};return _0x2a024a;}})});}_0x1f771f=_[_0x998e('0x3d')]({},_0x1f771f,_0x5d8f1f[_0x998e('0x40')]);var _0x583724={'where':_0x1f771f[_0x998e('0x3c')]};return db['ChatInternalMessage'][_0x998e('0x23')](_0x583724)['then'](function(_0x4439fe){_0x4ac9e9[_0x998e('0x23')]=_0x4439fe;if(_0x5d8f1f[_0x998e('0x33')][_0x998e('0x41')]){_0x1f771f[_0x998e('0x42')]=[{'all':!![]}];}return db[_0x998e('0x2d')]['findAll'](_0x1f771f);})['then'](function(_0x35e1a5){_0x4ac9e9['rows']=_0x35e1a5;return _0x4ac9e9;})[_0x998e('0x43')](respondWithFilteredResult(_0x5b7ce3,_0x1f771f))['catch'](handleError(_0x5b7ce3,null));};exports['show']=function(_0xb5a232,_0x52286b){var _0x1f88a1={'raw':!![],'where':{'id':_0xb5a232[_0x998e('0x44')]['id']}},_0x757c08={};_0x757c08[_0x998e('0x32')]=_[_0x998e('0x45')](db[_0x998e('0x2d')]['rawAttributes']);_0x757c08['query']=_[_0x998e('0x45')](_0xb5a232[_0x998e('0x33')]);_0x757c08[_0x998e('0x34')]=_[_0x998e('0x35')](_0x757c08['model'],_0x757c08[_0x998e('0x33')]);_0x1f88a1['attributes']=_['intersection'](_0x757c08['model'],qs[_0x998e('0x37')](_0xb5a232[_0x998e('0x33')][_0x998e('0x37')]));_0x1f88a1[_0x998e('0x36')]=_0x1f88a1['attributes']['length']?_0x1f88a1['attributes']:_0x757c08[_0x998e('0x32')];if(_0xb5a232['query'][_0x998e('0x41')]){_0x1f88a1[_0x998e('0x42')]=[{'all':!![]}];}_0x1f88a1=_[_0x998e('0x3d')]({},_0x1f88a1,_0xb5a232[_0x998e('0x40')]);return db[_0x998e('0x2d')][_0x998e('0x46')](_0x1f88a1)[_0x998e('0x43')](handleEntityNotFound(_0x52286b,null))[_0x998e('0x43')](respondWithResult(_0x52286b,null))[_0x998e('0x47')](handleError(_0x52286b,null));};exports[_0x998e('0x48')]=function(_0x20b8e7,_0x1ecb3a){return db['ChatInternalMessage'][_0x998e('0x48')](_0x20b8e7[_0x998e('0x49')],{})[_0x998e('0x43')](respondWithResult(_0x1ecb3a,0xc9))['catch'](handleError(_0x1ecb3a,null));};exports['update']=function(_0x35a0a0,_0x1aea19){if(_0x35a0a0['body']['id']){delete _0x35a0a0['body']['id'];}return db[_0x998e('0x2d')][_0x998e('0x46')]({'where':{'id':_0x35a0a0['params']['id']}})[_0x998e('0x43')](handleEntityNotFound(_0x1aea19,null))[_0x998e('0x43')](saveUpdates(_0x35a0a0[_0x998e('0x49')],null))[_0x998e('0x43')](respondWithResult(_0x1aea19,null))['catch'](handleError(_0x1aea19,null));};exports[_0x998e('0x27')]=function(_0x3bf4fa,_0x326281){return db[_0x998e('0x2d')][_0x998e('0x46')]({'where':{'id':_0x3bf4fa[_0x998e('0x44')]['id']}})['then'](handleEntityNotFound(_0x326281,null))[_0x998e('0x43')](removeEntity(_0x326281,null))['catch'](handleError(_0x326281,null));};exports['describe']=function(_0x15922c,_0x3693ff){return db[_0x998e('0x2d')][_0x998e('0x4a')]()[_0x998e('0x43')](respondWithResult(_0x3693ff,null))[_0x998e('0x47')](handleError(_0x3693ff,null));};function wrapUser(_0x56b933){return function(_0x23a076){var _0x135094=_0x56b933[_0x998e('0x4b')]({'plain':!![]});_0x135094['messages']=[];if(_0x23a076){_0x135094[_0x998e('0x4c')]=_0x23a076[_0x998e('0x4d')];_0x135094[_0x998e('0x4e')]=_0x23a076;}else{_0x135094[_0x998e('0x4c')]=moment(0x0)[_0x998e('0x4f')](_0x998e('0x50'));_0x135094[_0x998e('0x4e')]={};}return _0x135094;};}exports['getUsers']=function(_0x4e6324,_0x6a613d,_0x570009){var _0x3f8883=[];return db[_0x998e('0x51')][_0x998e('0x52')]({'where':{'role':['agent','admin',_0x998e('0x53')]},'attributes':['id','fullname','name',_0x998e('0x54'),_0x998e('0x55'),_0x998e('0x56'),'online','lastLoginAt','allowmessenger',_0x998e('0x57')],'order':qs['sort'](_0x998e('0x58')),'include':[{'model':db[_0x998e('0x59')],'as':_0x998e('0x5a'),'attributes':['id',_0x998e('0x2b'),_0x998e('0x30')],'through':{'attributes':[]}}]})[_0x998e('0x43')](function(_0x425685){if(_0x425685){var _0x25ba37=_0x4e6324['user'][_0x998e('0x4b')]({'plain':!![]});if(!_0x25ba37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ba37['role']===_0x998e('0x53')){return db[_0x998e('0x5b')]['find']({'where':{'name':_0x998e('0x5c'),'userProfileId':_0x25ba37[_0x998e('0x5d')]},'raw':!![]})[_0x998e('0x43')](function(_0x4fe535){if(_0x4fe535){if(_0x4fe535[_0x998e('0x5e')]===0x0){return db[_0x998e('0x5f')][_0x998e('0x52')]({'where':{'sectionId':_0x4fe535['id']},'raw':!![]})[_0x998e('0x43')](function(_0x43ada4){var _0x2eb5fd=[];if(_[_0x998e('0x60')](_0x43ada4)){_0x2eb5fd=_[_0x998e('0x3f')](_0x425685,function(_0x2d161b){if(_0x2d161b[_0x998e('0x54')]!==_0x998e('0x61')){return _0x2d161b;}});return _0x2eb5fd;}else{for(var _0x4f9750=0x0;_0x4f9750<_0x425685[_0x998e('0x38')];_0x4f9750++){var _0x280003=_0x425685[_0x4f9750];if(_0x280003['role']===_0x998e('0x61')){var _0x19927c=_[_0x998e('0x46')](_0x43ada4,function(_0x3c06d5){return _0x3c06d5[_0x998e('0x62')]===_0x280003['id'];});if(_0x19927c)_0x2eb5fd[_0x998e('0x63')](_0x280003);}else{_0x2eb5fd[_0x998e('0x63')](_0x280003);}}return _0x2eb5fd;}});}else{return _0x425685;}}else{var _0xc8e0c7=_[_0x998e('0x3f')](_0x425685,function(_0x12baed){if(_0x12baed[_0x998e('0x54')]!==_0x998e('0x61')){return _0x12baed;}});return _0xc8e0c7;}});}else{return _0x425685;}}})['then'](function(_0x1589ad){var _0x2ebf11=[];if(_0x1589ad){_0x3f8883=_0x1589ad;for(var _0x205bda=0x0;_0x205bda<_0x1589ad[_0x998e('0x38')];_0x205bda+=0x1){_0x3f8883[_0x205bda][_0x998e('0x64')]=[];_0x2ebf11[_0x998e('0x63')](db['ChatInternalMessage'][_0x998e('0x46')]({'where':{'FromId':[_0x4e6324[_0x998e('0x53')]['id'],_0x1589ad[_0x205bda]['id']],'ToId':[_0x4e6324[_0x998e('0x53')]['id'],_0x1589ad[_0x205bda]['id']],'ChatGroupId':null},'attributes':['id',_0x998e('0x4d'),'FromId',_0x998e('0x65'),_0x998e('0x66'),'body'],'order':qs['sort'](_0x998e('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x998e('0x43')](wrapUser(_0x1589ad[_0x205bda])));}return BPromise[_0x998e('0x68')](_0x2ebf11);}return[];})['then'](function(_0x32721e){return{'rows':_0x32721e,'count':_0x32721e['length']};})[_0x998e('0x43')](respondWithResult(_0x6a613d,null))[_0x998e('0x47')](handleError(_0x6a613d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index acfce94..00356ed 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 _0x5a6d=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','save','update'];(function(_0x2c15d7,_0x13eb66){var _0x461208=function(_0x4270c2){while(--_0x4270c2){_0x2c15d7['push'](_0x2c15d7['shift']());}};_0x461208(++_0x13eb66);}(_0x5a6d,0x1d4));var _0xd5a6=function(_0x315cd3,_0x5e20c1){_0x315cd3=_0x315cd3-0x0;var _0x3a31c5=_0x5a6d[_0x315cd3];return _0x3a31c5;};'use strict';var EventEmitter=require(_0xd5a6('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xd5a6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5a6('0x2'),'afterUpdate':_0xd5a6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16ee2c){return function(_0x15e432,_0x2223be,_0x59826e){ChatInternalMessageEvents['emit'](_0x16ee2c+':'+_0x15e432['id'],_0x15e432);ChatInternalMessageEvents[_0xd5a6('0x4')](_0x16ee2c,_0x15e432);_0x59826e(null);};}for(var e in events){if(events[_0xd5a6('0x5')](e)){var event=events[e];ChatInternalMessage[_0xd5a6('0x6')](e,emitEvent(event));}}module[_0xd5a6('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x117d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0xad3484,_0x40a31a){var _0x173e0c=function(_0x5098ce){while(--_0x5098ce){_0xad3484['push'](_0xad3484['shift']());}};_0x173e0c(++_0x40a31a);}(_0x117d,0x1e1));var _0xd117=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0x117d[_0x3f7598];return _0x51fb16;};'use strict';var EventEmitter=require(_0xd117('0x0'));var ChatInternalMessage=require(_0xd117('0x1'))['db'][_0xd117('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd117('0x3')](0x0);var events={'afterCreate':_0xd117('0x4'),'afterUpdate':_0xd117('0x5'),'afterDestroy':_0xd117('0x6')};function emitEvent(_0x4d6ee7){return function(_0x513770,_0x4fbc25,_0x2a8274){ChatInternalMessageEvents[_0xd117('0x7')](_0x4d6ee7+':'+_0x513770['id'],_0x513770);ChatInternalMessageEvents['emit'](_0x4d6ee7,_0x513770);_0x2a8274(null);};}for(var e in events){if(events[_0xd117('0x8')](e)){var event=events[e];ChatInternalMessage[_0xd117('0x9')](e,emitEvent(event));}}module[_0xd117('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index ed50d8e..c344e1c 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 _0xb5dd=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27efcf,_0x320952){var _0xdb0237=function(_0x2a7389){while(--_0x2a7389){_0x27efcf['push'](_0x27efcf['shift']());}};_0xdb0237(++_0x320952);}(_0xb5dd,0x188));var _0xdb5d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb5dd[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xdb5d('0x0'));var util=require(_0xdb5d('0x1'));var logger=require(_0xdb5d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdb5d('0x3'));var rp=require(_0xdb5d('0x4'));var fs=require('fs');var path=require(_0xdb5d('0x5'));var rimraf=require(_0xdb5d('0x6'));var config=require(_0xdb5d('0x7'));var attributes=require(_0xdb5d('0x8'));module[_0xdb5d('0x9')]=function(_0x2748be,_0x36d2ed){return _0x2748be[_0xdb5d('0xa')](_0xdb5d('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb5d('0xc'),'collate':_0xdb5d('0xd')});}; \ No newline at end of file +var _0xd98f=['ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x53822b,_0x3fa297){var _0x5f5ccf=function(_0xea35c9){while(--_0xea35c9){_0x53822b['push'](_0x53822b['shift']());}};_0x5f5ccf(++_0x3fa297);}(_0xd98f,0x1d7));var _0xfd98=function(_0x3a217d,_0x41c41a){_0x3a217d=_0x3a217d-0x0;var _0x16010f=_0xd98f[_0x3a217d];return _0x16010f;};'use strict';var _=require(_0xfd98('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfd98('0x1'));var moment=require('moment');var BPromise=require(_0xfd98('0x2'));var rp=require(_0xfd98('0x3'));var fs=require('fs');var path=require(_0xfd98('0x4'));var rimraf=require(_0xfd98('0x5'));var config=require(_0xfd98('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xfd98('0x7')]=function(_0x5785ac,_0x5f3162){return _0x5785ac[_0xfd98('0x8')](_0xfd98('0x9'),attributes,{'tableName':_0xfd98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd98('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 18f55c7..0cec356 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 _0xa711=['redis','defaults','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1b37d7,_0xb98a46){var _0x2d35b6=function(_0x1ce684){while(--_0x1ce684){_0x1b37d7['push'](_0x1b37d7['shift']());}};_0x2d35b6(++_0xb98a46);}(_0xa711,0x6e));var _0x1a71=function(_0x53db5b,_0x24fd31){_0x53db5b=_0x53db5b-0x0;var _0x39b7b9=_0xa711[_0x53db5b];return _0x39b7b9;};'use strict';var _=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var moment=require('moment');var BPromise=require(_0x1a71('0x2'));var rs=require(_0x1a71('0x3'));var fs=require('fs');var Redis=require(_0x1a71('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a71('0x5'));var logger=require(_0x1a71('0x6'))(_0x1a71('0x7'));var config=require(_0x1a71('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1a71('0x9')]['http']({'port':0x232a});config[_0x1a71('0xa')]=_[_0x1a71('0xb')](config[_0x1a71('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a71('0xa')]));require('./chatInternalMessage.socket')[_0x1a71('0xc')](socket);function respondWithRpcPromise(_0x4a1285,_0x5a3a59,_0x1c272b){return new BPromise(function(_0xcda80d,_0x25432e){return client[_0x1a71('0xd')](_0x4a1285,_0x1c272b)[_0x1a71('0xe')](function(_0x5d0b5b){logger[_0x1a71('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5a3a59,'request\x20sent');logger[_0x1a71('0x10')](_0x1a71('0x11'),_0x5a3a59,'request\x20sent',JSON['stringify'](_0x5d0b5b));if(_0x5d0b5b['error']){if(_0x5d0b5b[_0x1a71('0x12')]['code']===0x1f4){logger[_0x1a71('0x12')](_0x1a71('0x13'),_0x5a3a59,_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);return _0x25432e(_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5a3a59,_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);return _0xcda80d(_0x5d0b5b[_0x1a71('0x12')][_0x1a71('0x14')]);}else{logger[_0x1a71('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5a3a59,_0x1a71('0x15'));_0xcda80d(_0x5d0b5b[_0x1a71('0x16')][_0x1a71('0x14')]);}})[_0x1a71('0x17')](function(_0x3e5104){logger['error'](_0x1a71('0x13'),_0x5a3a59,_0x3e5104);_0x25432e(_0x3e5104);});});} \ No newline at end of file +var _0xd8e0=['ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd8e0,0x111));var _0x0d8e=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd8e0[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x0d8e('0x0'));var util=require(_0x0d8e('0x1'));var moment=require(_0x0d8e('0x2'));var BPromise=require(_0x0d8e('0x3'));var rs=require(_0x0d8e('0x4'));var fs=require('fs');var Redis=require(_0x0d8e('0x5'));var db=require(_0x0d8e('0x6'))['db'];var utils=require(_0x0d8e('0x7'));var logger=require(_0x0d8e('0x8'))(_0x0d8e('0x9'));var config=require(_0x0d8e('0xa'));var jayson=require(_0x0d8e('0xb'));var client=jayson[_0x0d8e('0xc')][_0x0d8e('0xd')]({'port':0x232a});config[_0x0d8e('0xe')]=_[_0x0d8e('0xf')](config[_0x0d8e('0xe')],{'host':_0x0d8e('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8e('0xe')]));require(_0x0d8e('0x11'))[_0x0d8e('0x12')](socket);function respondWithRpcPromise(_0xfa6994,_0x5950ad,_0x1f2f5b){return new BPromise(function(_0x3a252c,_0x26e4c9){return client[_0x0d8e('0x13')](_0xfa6994,_0x1f2f5b)[_0x0d8e('0x14')](function(_0x596df4){logger[_0x0d8e('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5950ad,_0x0d8e('0x16'));logger[_0x0d8e('0x17')](_0x0d8e('0x18'),_0x5950ad,_0x0d8e('0x16'),JSON[_0x0d8e('0x19')](_0x596df4));if(_0x596df4[_0x0d8e('0x1a')]){if(_0x596df4[_0x0d8e('0x1a')]['code']===0x1f4){logger['error'](_0x0d8e('0x1b'),_0x5950ad,_0x596df4['error'][_0x0d8e('0x1c')]);return _0x26e4c9(_0x596df4[_0x0d8e('0x1a')][_0x0d8e('0x1c')]);}logger[_0x0d8e('0x1a')](_0x0d8e('0x1b'),_0x5950ad,_0x596df4[_0x0d8e('0x1a')]['message']);return _0x3a252c(_0x596df4[_0x0d8e('0x1a')][_0x0d8e('0x1c')]);}else{logger['info'](_0x0d8e('0x1b'),_0x5950ad,'request\x20sent');_0x3a252c(_0x596df4[_0x0d8e('0x1d')][_0x0d8e('0x1c')]);}})['catch'](function(_0x4fc808){logger[_0x0d8e('0x1a')](_0x0d8e('0x1b'),_0x5950ad,_0x4fc808);_0x26e4c9(_0x4fc808);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 02a790f..00ff613 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 _0x1054=['register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x336fe2,_0x2cd93e){var _0x36d6c8=function(_0x28bb18){while(--_0x28bb18){_0x336fe2['push'](_0x336fe2['shift']());}};_0x36d6c8(++_0x2cd93e);}(_0x1054,0x10a));var _0x4105=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x1054[_0xa041de];return _0x1d654c;};'use strict';var ChatInternalMessageEvents=require(_0x4105('0x0'));var events=[_0x4105('0x1'),_0x4105('0x2'),_0x4105('0x3')];function createListener(_0x2eedb2,_0x17a3a3){return function(_0x534ba9){_0x17a3a3[_0x4105('0x4')](_0x2eedb2,_0x534ba9);};}function removeListener(_0x3b5f88,_0x515c3a){return function(){ChatInternalMessageEvents[_0x4105('0x5')](_0x3b5f88,_0x515c3a);};}exports[_0x4105('0x6')]=function(_0x22fe0a){for(var _0x358536=0x0,_0x3e25da=events['length'];_0x358536<_0x3e25da;_0x358536++){var _0x51df3a=events[_0x358536];var _0x2fb3fe=createListener(_0x4105('0x7')+_0x51df3a,_0x22fe0a);ChatInternalMessageEvents['on'](_0x51df3a,_0x2fb3fe);}}; \ No newline at end of file +var _0x2d0d=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2d0d,0x196));var _0xd2d0=function(_0x1b9cfb,_0x2c5a2b){_0x1b9cfb=_0x1b9cfb-0x0;var _0x38a552=_0x2d0d[_0x1b9cfb];return _0x38a552;};'use strict';var ChatInternalMessageEvents=require(_0xd2d0('0x0'));var events=[_0xd2d0('0x1'),_0xd2d0('0x2'),_0xd2d0('0x3')];function createListener(_0x14f780,_0x19ea09){return function(_0x303c37){_0x19ea09[_0xd2d0('0x4')](_0x14f780,_0x303c37);};}function removeListener(_0x1e8f8d,_0x20cada){return function(){ChatInternalMessageEvents[_0xd2d0('0x5')](_0x1e8f8d,_0x20cada);};}exports[_0xd2d0('0x6')]=function(_0x1cbbf1){for(var _0x351cf4=0x0,_0xf1103c=events[_0xd2d0('0x7')];_0x351cf4<_0xf1103c;_0x351cf4++){var _0x5eed2c=events[_0x351cf4];var _0x2b5662=createListener(_0xd2d0('0x8')+_0x5eed2c,_0x1cbbf1);ChatInternalMessageEvents['on'](_0x5eed2c,_0x2b5662);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f5ee625..047eb1f 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 _0x5588=['../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','describe','getUsers','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x15fce8,_0x7612b7){var _0x3f54aa=function(_0x4c1752){while(--_0x4c1752){_0x15fce8['push'](_0x15fce8['shift']());}};_0x3f54aa(++_0x7612b7);}(_0x5588,0x18b));var _0x8558=function(_0x309e3b,_0x5397fc){_0x309e3b=_0x309e3b-0x0;var _0x21351c=_0x5588[_0x309e3b];return _0x21351c;};'use strict';var multer=require(_0x8558('0x0'));var util=require(_0x8558('0x1'));var path=require('path');var timeout=require(_0x8558('0x2'));var express=require('express');var router=express[_0x8558('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8558('0x4'));var interaction=require(_0x8558('0x5'));var config=require('../../config/environment');var controller=require(_0x8558('0x6'));router[_0x8558('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8558('0x7')]('/describe',auth[_0x8558('0x8')](),controller[_0x8558('0x9')]);router[_0x8558('0x7')]('/users',auth[_0x8558('0x8')](),controller[_0x8558('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8558('0xb')]);router[_0x8558('0xc')]('/',auth[_0x8558('0x8')](),controller[_0x8558('0xd')]);router[_0x8558('0xe')](_0x8558('0xf'),controller[_0x8558('0x10')]);router['delete'](_0x8558('0xf'),auth['isAuthenticated'](),controller[_0x8558('0x11')]);module[_0x8558('0x12')]=router; \ No newline at end of file +var _0xacca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3dee92,_0x55e1eb){var _0x44d36e=function(_0x34de1a){while(--_0x34de1a){_0x3dee92['push'](_0x3dee92['shift']());}};_0x44d36e(++_0x55e1eb);}(_0xacca,0x110));var _0xaacc=function(_0x5ec973,_0x196985){_0x5ec973=_0x5ec973-0x0;var _0x20be94=_0xacca[_0x5ec973];return _0x20be94;};'use strict';var multer=require(_0xaacc('0x0'));var util=require(_0xaacc('0x1'));var path=require('path');var timeout=require(_0xaacc('0x2'));var express=require(_0xaacc('0x3'));var router=express[_0xaacc('0x4')]();var fs_extra=require(_0xaacc('0x5'));var auth=require(_0xaacc('0x6'));var interaction=require(_0xaacc('0x7'));var config=require(_0xaacc('0x8'));var controller=require(_0xaacc('0x9'));router[_0xaacc('0xa')]('/',auth[_0xaacc('0xb')](),controller['index']);router[_0xaacc('0xa')]('/describe',auth[_0xaacc('0xb')](),controller['describe']);router[_0xaacc('0xa')](_0xaacc('0xc'),auth[_0xaacc('0xb')](),controller[_0xaacc('0xd')]);router['get'](_0xaacc('0xe'),auth[_0xaacc('0xb')](),controller[_0xaacc('0xf')]);router[_0xaacc('0x10')]('/',auth[_0xaacc('0xb')](),controller[_0xaacc('0x11')]);router[_0xaacc('0x12')](_0xaacc('0xe'),controller[_0xaacc('0x13')]);router[_0xaacc('0x14')](_0xaacc('0xe'),auth[_0xaacc('0xb')](),controller[_0xaacc('0x15')]);module[_0xaacc('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 bfae2c5..eb751a3 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 _0xb2af=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb2af,0xd2));var _0xfb2a=function(_0x42d2a7,_0x132483){_0x42d2a7=_0x42d2a7-0x0;var _0x2349fc=_0xb2af[_0x42d2a7];return _0x2349fc;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'body':{'type':Sequelize[_0xfb2a('0x2')](_0xfb2a('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfb2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb2a('0x5')]('in',_0xfb2a('0x6')),'defaultValue':_0xfb2a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfb2a('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfb2a('0x2')]}}; \ No newline at end of file +var _0x8c7a=['sequelize','medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x55e724,_0x8f22f1){var _0x1b317c=function(_0x21d4dd){while(--_0x21d4dd){_0x55e724['push'](_0x55e724['shift']());}};_0x1b317c(++_0x8f22f1);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x3d1284,_0x1bb481){_0x3d1284=_0x3d1284-0x0;var _0x4ac2e2=_0x8c7a[_0x3d1284];return _0x4ac2e2;};'use strict';var Sequelize=require(_0xa8c7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa8c7('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa8c7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa8c7('0x3')]('in',_0xa8c7('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa8c7('0x5')]},'providerResponse':{'type':Sequelize[_0xa8c7('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 69708a4..889967d 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 _0xbee3=['find','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','rejectMessage','sequelize','Sequelize','fullname','internal','rejectmessage','parse','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','ChatMessage','rows','show','params','length','create','body'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xbee3,0xae));var _0x3bee=function(_0x81d558,_0x661891){_0x81d558=_0x81d558-0x0;var _0x3ff3bc=_0xbee3[_0x81d558];return _0x3ff3bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require(_0x3bee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3bee('0x2'));var Mustache=require(_0x3bee('0x3'));var util=require('util');var path=require(_0x3bee('0x4'));var sox=require(_0x3bee('0x5'));var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require(_0x3bee('0x8'));var _=require(_0x3bee('0x9'));var squel=require(_0x3bee('0xa'));var crypto=require(_0x3bee('0xb'));var jsforce=require(_0x3bee('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require(_0x3bee('0xe'));var Redis=require('ioredis');var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bee('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3bee('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3bee('0x14'))['db'];config['redis']=_[_0x3bee('0x15')](config[_0x3bee('0x16')],{'host':_0x3bee('0x17'),'port':0x18eb});var socket=require(_0x3bee('0x18'))(new Redis(config[_0x3bee('0x16')]));require(_0x3bee('0x19'))['register'](socket);var jayson=require(_0x3bee('0x1a'));var client=jayson[_0x3bee('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x3bee('0x1b')][_0x3bee('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4eff95,_0x5afb50,_0x42c30e,_0x1bb3ad){return new BPromise(function(_0x43eb0a,_0x3a4691){var _0x8d7fa1=_0x1bb3ad||client;return _0x8d7fa1[_0x3bee('0x1d')](_0x4eff95,_0x42c30e)['then'](function(_0x517b64){logger[_0x3bee('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5afb50,_0x3bee('0x1f'));logger[_0x3bee('0x20')](_0x3bee('0x21'),_0x5afb50,_0x3bee('0x1f'),JSON['stringify'](_0x517b64));if(_0x517b64[_0x3bee('0x22')]){if(_0x517b64[_0x3bee('0x22')][_0x3bee('0x23')]===0x1f4){logger['error'](_0x3bee('0x24'),_0x5afb50,_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);return _0x3a4691(_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);}logger[_0x3bee('0x22')](_0x3bee('0x24'),_0x5afb50,_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);return _0x43eb0a(_0x517b64[_0x3bee('0x22')][_0x3bee('0x25')]);}else{logger['info'](_0x3bee('0x24'),_0x5afb50,_0x3bee('0x1f'));_0x43eb0a(_0x517b64[_0x3bee('0x26')]['message']);}})[_0x3bee('0x27')](function(_0x3bb01d){logger[_0x3bee('0x22')]('ChatMessage,\x20%s,\x20%s',_0x5afb50,_0x3bb01d);_0x3a4691(_0x3bb01d);});});}function respondWithStatusCode(_0x5c126f,_0x132021){_0x132021=_0x132021||0xcc;return function(_0x883c28){if(_0x883c28){return _0x5c126f['sendStatus'](_0x132021);}return _0x5c126f[_0x3bee('0x28')](_0x132021)[_0x3bee('0x29')]();};}function respondWithResult(_0x3ee6c0,_0x4334e5){_0x4334e5=_0x4334e5||0xc8;return function(_0x16ab4c){if(_0x16ab4c){return _0x3ee6c0['status'](_0x4334e5)['json'](_0x16ab4c);}};}function respondWithFilteredResult(_0x4c4d84,_0x274d39){return function(_0x4f68bb){if(_0x4f68bb){var _0x3c4b2a=typeof _0x274d39[_0x3bee('0x2a')]===_0x3bee('0x2b')&&typeof _0x274d39[_0x3bee('0x2c')]===_0x3bee('0x2b');var _0x103ce5=_0x4f68bb[_0x3bee('0x2d')];var _0x2d0c0f=_0x3c4b2a?0x0:_0x274d39[_0x3bee('0x2a')];var _0x3f8f00=_0x3c4b2a?_0x4f68bb['count']:_0x274d39[_0x3bee('0x2a')]+_0x274d39[_0x3bee('0x2c')];var _0x47b0ce;if(_0x3f8f00>=_0x103ce5){_0x3f8f00=_0x103ce5;_0x47b0ce=0xc8;}else{_0x47b0ce=0xce;}_0x4c4d84[_0x3bee('0x28')](_0x47b0ce);return _0x4c4d84[_0x3bee('0x2e')](_0x3bee('0x2f'),_0x2d0c0f+'-'+_0x3f8f00+'/'+_0x103ce5)[_0x3bee('0x30')](_0x4f68bb);}return null;};}function patchUpdates(_0x31964e){return function(_0x52ceed){try{jsonpatch[_0x3bee('0x31')](_0x52ceed,_0x31964e,!![]);}catch(_0x5ec237){return BPromise[_0x3bee('0x32')](_0x5ec237);}return _0x52ceed['save']();};}function saveUpdates(_0x155178,_0x5e05ee){return function(_0x103864){if(_0x103864){return _0x103864[_0x3bee('0x33')](_0x155178)[_0x3bee('0x34')](function(_0x21f710){return _0x21f710;});}return null;};}function removeEntity(_0x41dc6e,_0x5e6a91){return function(_0x196c27){if(_0x196c27){return _0x196c27[_0x3bee('0x35')]()[_0x3bee('0x34')](function(){_0x41dc6e[_0x3bee('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x259746,_0x1b5c53){return function(_0x37de75){if(!_0x37de75){_0x259746[_0x3bee('0x36')](0x194);}return _0x37de75;};}function handleError(_0x18a092,_0x11f7fa){_0x11f7fa=_0x11f7fa||0x1f4;return function(_0x3bb4a3){logger[_0x3bee('0x22')](_0x3bb4a3['stack']);if(_0x3bb4a3[_0x3bee('0x37')]){delete _0x3bb4a3['name'];}_0x18a092[_0x3bee('0x28')](_0x11f7fa)['send'](_0x3bb4a3);};}exports[_0x3bee('0x38')]=function(_0x2a988d,_0x487d69){var _0x2e4c48={},_0x477672={},_0x49cf08={'count':0x0,'rows':[]};var _0x14db5d=_[_0x3bee('0x39')](db['ChatMessage'][_0x3bee('0x3a')],function(_0x59bdd6){return{'name':_0x59bdd6[_0x3bee('0x3b')],'type':_0x59bdd6['type'][_0x3bee('0x3c')]};});_0x477672[_0x3bee('0x3d')]=_[_0x3bee('0x39')](_0x14db5d,'name');_0x477672[_0x3bee('0x3e')]=_[_0x3bee('0x3f')](_0x2a988d[_0x3bee('0x3e')]);_0x477672[_0x3bee('0x40')]=_['intersection'](_0x477672[_0x3bee('0x3d')],_0x477672[_0x3bee('0x3e')]);_0x2e4c48['attributes']=_[_0x3bee('0x41')](_0x477672[_0x3bee('0x3d')],qs[_0x3bee('0x42')](_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x42')]));_0x2e4c48[_0x3bee('0x43')]=_0x2e4c48[_0x3bee('0x43')]['length']?_0x2e4c48[_0x3bee('0x43')]:_0x477672[_0x3bee('0x3d')];if(!_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x44')]('nolimit')){_0x2e4c48[_0x3bee('0x2c')]=qs[_0x3bee('0x2c')](_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x2c')]);_0x2e4c48[_0x3bee('0x2a')]=qs[_0x3bee('0x2a')](_0x2a988d['query']['offset']);}_0x2e4c48['order']=qs['sort'](_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x45')]);_0x2e4c48[_0x3bee('0x46')]=qs[_0x3bee('0x40')](_['pick'](_0x2a988d[_0x3bee('0x3e')],_0x477672[_0x3bee('0x40')]),_0x14db5d);if(_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x47')]){_0x2e4c48[_0x3bee('0x46')]=_[_0x3bee('0x48')](_0x2e4c48[_0x3bee('0x46')],{'$or':_['map'](_0x14db5d,function(_0x202ea0){if(_0x202ea0['type']!==_0x3bee('0x49')){var _0x45a10f={};_0x45a10f[_0x202ea0['name']]={'$like':'%'+_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x47')]+'%'};return _0x45a10f;}})});}_0x2e4c48=_['merge']({},_0x2e4c48,_0x2a988d[_0x3bee('0x4a')]);var _0x48ba93={'where':_0x2e4c48[_0x3bee('0x46')]};return db['ChatMessage'][_0x3bee('0x2d')](_0x48ba93)[_0x3bee('0x34')](function(_0x53ae76){_0x49cf08[_0x3bee('0x2d')]=_0x53ae76;if(_0x2a988d[_0x3bee('0x3e')][_0x3bee('0x4b')]){_0x2e4c48[_0x3bee('0x4c')]=[{'all':!![]}];}return db[_0x3bee('0x4d')]['findAll'](_0x2e4c48);})[_0x3bee('0x34')](function(_0x1552f1){_0x49cf08[_0x3bee('0x4e')]=_0x1552f1;return _0x49cf08;})[_0x3bee('0x34')](respondWithFilteredResult(_0x487d69,_0x2e4c48))[_0x3bee('0x27')](handleError(_0x487d69,null));};exports[_0x3bee('0x4f')]=function(_0x33578d,_0x2280b1){var _0x50a297={'raw':!![],'where':{'id':_0x33578d[_0x3bee('0x50')]['id']}},_0x37c704={};_0x37c704['model']=_[_0x3bee('0x3f')](db[_0x3bee('0x4d')][_0x3bee('0x3a')]);_0x37c704['query']=_['keys'](_0x33578d[_0x3bee('0x3e')]);_0x37c704[_0x3bee('0x40')]=_['intersection'](_0x37c704[_0x3bee('0x3d')],_0x37c704[_0x3bee('0x3e')]);_0x50a297[_0x3bee('0x43')]=_['intersection'](_0x37c704[_0x3bee('0x3d')],qs[_0x3bee('0x42')](_0x33578d[_0x3bee('0x3e')]['fields']));_0x50a297[_0x3bee('0x43')]=_0x50a297[_0x3bee('0x43')][_0x3bee('0x51')]?_0x50a297[_0x3bee('0x43')]:_0x37c704[_0x3bee('0x3d')];if(_0x33578d[_0x3bee('0x3e')][_0x3bee('0x4b')]){_0x50a297[_0x3bee('0x4c')]=[{'all':!![]}];}_0x50a297=_['merge']({},_0x50a297,_0x33578d[_0x3bee('0x4a')]);return db[_0x3bee('0x4d')]['find'](_0x50a297)[_0x3bee('0x34')](handleEntityNotFound(_0x2280b1,null))[_0x3bee('0x34')](respondWithResult(_0x2280b1,null))['catch'](handleError(_0x2280b1,null));};exports[_0x3bee('0x52')]=function(_0x539411,_0x92a9ce){return db[_0x3bee('0x4d')][_0x3bee('0x52')](_0x539411[_0x3bee('0x53')],{})[_0x3bee('0x34')](respondWithResult(_0x92a9ce,0xc9))[_0x3bee('0x27')](handleError(_0x92a9ce,null));};exports[_0x3bee('0x33')]=function(_0x34f6ec,_0x51d41b){if(_0x34f6ec[_0x3bee('0x53')]['id']){delete _0x34f6ec[_0x3bee('0x53')]['id'];}return db[_0x3bee('0x4d')][_0x3bee('0x54')]({'where':{'id':_0x34f6ec[_0x3bee('0x50')]['id']}})['then'](handleEntityNotFound(_0x51d41b,null))['then'](saveUpdates(_0x34f6ec[_0x3bee('0x53')],null))[_0x3bee('0x34')](respondWithResult(_0x51d41b,null))[_0x3bee('0x27')](handleError(_0x51d41b,null));};exports['destroy']=function(_0x194f27,_0x1a537d){return db[_0x3bee('0x4d')]['find']({'where':{'id':_0x194f27[_0x3bee('0x50')]['id']}})[_0x3bee('0x34')](handleEntityNotFound(_0x1a537d,null))['then'](removeEntity(_0x1a537d,null))['catch'](handleError(_0x1a537d,null));};exports['describe']=function(_0x480172,_0x206041){return db[_0x3bee('0x4d')][_0x3bee('0x55')]()[_0x3bee('0x34')](respondWithResult(_0x206041,null))['catch'](handleError(_0x206041,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x3cd897,_0x13728e,_0x550f0c){var _0x2753e8={'agent':{},'channel':_0x3bee('0x56')};if(_0x3cd897['body']['id']){delete _0x3cd897[_0x3bee('0x53')]['id'];}_0x3cd897[_0x3bee('0x53')][_0x3bee('0x57')]=!![];_0x3cd897['body'][_0x3bee('0x58')]=moment()[_0x3bee('0x59')](_0x3bee('0x5a'));_0x3cd897['body'][_0x3bee('0x5b')]=_0x3cd897[_0x3bee('0x53')][_0x3bee('0x5b')]||_0x3cd897[_0x3bee('0x5c')]['id'];_0x2753e8[_0x3bee('0x5d')]['id']=_0x3cd897[_0x3bee('0x53')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x3cd897[_0x3bee('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13728e,null))['then'](saveUpdates(_0x3cd897[_0x3bee('0x53')],null))[_0x3bee('0x34')](function(_0x4b7389){if(_0x4b7389){_0x2753e8[_0x3bee('0x25')]=_0x4b7389[_0x3bee('0x5e')]({'plain':!![]});return db[_0x3bee('0x5f')][_0x3bee('0x54')]({'where':{'id':_0x4b7389[_0x3bee('0x60')]}});}return null;})[_0x3bee('0x34')](handleEntityNotFound(_0x13728e,null))[_0x3bee('0x34')](function(_0x1f3a7e){if(_0x1f3a7e){return _0x1f3a7e[_0x3bee('0x33')]({'UserId':_0x3cd897[_0x3bee('0x53')][_0x3bee('0x5b')],'read1stAt':_[_0x3bee('0x61')](_0x1f3a7e[_0x3bee('0x62')])?moment()[_0x3bee('0x59')](_0x3bee('0x5a')):undefined});}return null;})[_0x3bee('0x34')](function(_0x208212){if(_0x208212){_0x2753e8[_0x3bee('0x63')]=_0x208212[_0x3bee('0x5e')]({'plain':!![]});interaction_log[_0x3bee('0x1e')](_0x3bee('0x64'),_0x3cd897[_0x3bee('0x5c')]['id'],_0x3cd897[_0x3bee('0x5c')][_0x3bee('0x37')],_0x3cd897[_0x3bee('0x5c')]['role'],_0x2753e8[_0x3bee('0x63')]['id'],_0x3cd897['body']?JSON['stringify'](_0x3cd897['body']):_0x3bee('0x65'));return respondWithRpcPromise(_0x3bee('0x66'),_0x3bee('0x67'),_0x2753e8);}return null;})[_0x3bee('0x34')](function(_0x4bbf80){var _0x924b4f=_0x3bee('0x68')+_0x4bbf80[_0x3bee('0x25')][_0x3bee('0x69')];return db['sequelize']['query'](_0x924b4f,{'type':db['Sequelize'][_0x3bee('0x6a')]['SELECT'],'raw':!![]})['then'](function(_0x13e115){return _0x13e115;});})['then'](function(_0x285147){if(_0x285147){_0x2753e8['message'][_0x3bee('0x6b')]=_0x285147[0x0];if(!_0x3cd897[_0x3bee('0x53')]['UserId'])return;return db[_0x3bee('0x6c')][_0x3bee('0x54')]({'where':{'id':_0x3cd897[_0x3bee('0x53')][_0x3bee('0x5b')],'role':'agent'},'attributes':['id','name','fullname',_0x3bee('0x6d'),'internal'],'raw':!![]});}return null;})[_0x3bee('0x34')](function(_0x47bd12){if(!_0x47bd12)return null;_0x2753e8[_0x3bee('0x25')][_0x3bee('0x5d')]=_0x47bd12;return _0x2753e8;})[_0x3bee('0x34')](function(_0x4f7c88){if(_0x4f7c88){if(_0x3cd897['body']['manual']){_0x2753e8[_0x3bee('0x25')][_0x3bee('0x6e')]=util['format'](_0x3bee('0x6f'),_0x3cd897[_0x3bee('0x5c')][_0x3bee('0x37')]);_0x2753e8[_0x3bee('0x25')][_0x3bee('0x70')]=_0x2753e8[_0x3bee('0x70')];_0x2753e8[_0x3bee('0x25')][_0x3bee('0x71')]=_0x2753e8[_0x3bee('0x70')];_0x2753e8[_0x3bee('0x25')][_0x3bee('0x72')]=_0x3bee('0x73');return respondWithRpcPromise(_0x3bee('0x74'),'EventManager',{'event':'acceptmessage','message':_[_0x3bee('0x48')](_0x2753e8['message'],JSON['parse'](_0x2753e8['interaction'][_0x3bee('0x75')]))},client9002)[_0x3bee('0x34')](function(){return _0x2753e8;});}return _0x2753e8;}return null;})[_0x3bee('0x34')](respondWithResult(_0x13728e,null))[_0x3bee('0x27')](handleError(_0x13728e,null));};var interaction_log=require('../../config/logger')(_0x3bee('0x76'));exports['reject']=function(_0x234a87,_0x2cc272,_0x1b7a02){var _0x4935b8={'agent':{},'channel':_0x3bee('0x56')};if(_0x234a87['body']['id']){delete _0x234a87[_0x3bee('0x53')]['id'];}_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')]=_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')]||_0x234a87[_0x3bee('0x5c')]['id'];_0x4935b8[_0x3bee('0x5d')]['id']=_0x234a87[_0x3bee('0x53')]['UserId'];return db[_0x3bee('0x4d')][_0x3bee('0x54')]({'where':{'id':_0x234a87[_0x3bee('0x50')]['id'],'UserId':null}})[_0x3bee('0x34')](handleEntityNotFound(_0x2cc272,null))['then'](function(_0x15e2d2){if(_0x15e2d2){_0x4935b8['message']=_0x15e2d2[_0x3bee('0x5e')]({'plain':!![]});return db[_0x3bee('0x5f')][_0x3bee('0x54')]({'where':{'id':_0x15e2d2['ChatInteractionId']}});}return null;})[_0x3bee('0x34')](handleEntityNotFound(_0x2cc272,null))[_0x3bee('0x34')](function(_0x3ff3c8){if(_0x3ff3c8){_0x4935b8[_0x3bee('0x63')]=_0x3ff3c8[_0x3bee('0x5e')]({'plain':!![]});interaction_log[_0x3bee('0x1e')](_0x3bee('0x77'),_0x234a87[_0x3bee('0x5c')]['id'],_0x234a87[_0x3bee('0x5c')][_0x3bee('0x37')],_0x234a87[_0x3bee('0x5c')][_0x3bee('0x78')],_0x4935b8[_0x3bee('0x63')]['id'],_0x234a87[_0x3bee('0x53')]?JSON[_0x3bee('0x79')](_0x234a87[_0x3bee('0x53')]):_0x3bee('0x65'));return respondWithRpcPromise('RejectMessage',_0x3bee('0x7a'),_0x4935b8);}return null;})[_0x3bee('0x34')](function(_0x5d19e5){var _0x535e98=_0x3bee('0x68')+_0x5d19e5[_0x3bee('0x25')][_0x3bee('0x69')];return db[_0x3bee('0x7b')]['query'](_0x535e98,{'type':db[_0x3bee('0x7c')][_0x3bee('0x6a')]['SELECT'],'raw':!![]})[_0x3bee('0x34')](function(_0x3cc181){return _0x3cc181;});})['then'](function(_0x26e358){if(_0x26e358){_0x4935b8[_0x3bee('0x25')]['contact']=_0x26e358[0x0];if(!_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')])return;return db['User'][_0x3bee('0x54')]({'where':{'id':_0x234a87[_0x3bee('0x53')][_0x3bee('0x5b')],'role':'agent'},'attributes':['id',_0x3bee('0x37'),_0x3bee('0x7d'),_0x3bee('0x6d'),_0x3bee('0x7e')],'raw':!![]});}return null;})[_0x3bee('0x34')](function(_0x4c63b4){if(!_0x4c63b4)return null;_0x4935b8[_0x3bee('0x25')][_0x3bee('0x5d')]=_0x4c63b4;return _0x4935b8;})[_0x3bee('0x34')](function(_0x2310c7){if(_0x2310c7){_0x2310c7[_0x3bee('0x25')][_0x3bee('0x6e')]=util[_0x3bee('0x59')](_0x3bee('0x6f'),_0x234a87[_0x3bee('0x5c')][_0x3bee('0x37')]);_0x2310c7[_0x3bee('0x25')][_0x3bee('0x70')]=_0x4935b8[_0x3bee('0x70')];_0x2310c7[_0x3bee('0x25')][_0x3bee('0x71')]=_0x4935b8[_0x3bee('0x70')];_0x2310c7['message']['event']=_0x3bee('0x32');respondWithRpcPromise('EventManager',_0x3bee('0x74'),{'event':_0x3bee('0x7f'),'message':_[_0x3bee('0x48')](_0x4935b8[_0x3bee('0x25')],JSON[_0x3bee('0x80')](_0x4935b8[_0x3bee('0x63')][_0x3bee('0x75')]))},client9002);return _0x4935b8;}return null;})[_0x3bee('0x34')](respondWithResult(_0x2cc272,null))['catch'](handleError(_0x2cc272,null));}; \ No newline at end of file +var _0x35c9=['contact','interface','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','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','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','describe','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x35c9,0x18a));var _0x935c=function(_0x4a7c71,_0x253d33){_0x4a7c71=_0x4a7c71-0x0;var _0x96692e=_0x35c9[_0x4a7c71];return _0x96692e;};'use strict';var emlformat=require(_0x935c('0x0'));var rimraf=require(_0x935c('0x1'));var zipdir=require(_0x935c('0x2'));var jsonpatch=require(_0x935c('0x3'));var rp=require(_0x935c('0x4'));var moment=require(_0x935c('0x5'));var BPromise=require(_0x935c('0x6'));var Mustache=require(_0x935c('0x7'));var util=require(_0x935c('0x8'));var path=require(_0x935c('0x9'));var sox=require(_0x935c('0xa'));var csv=require(_0x935c('0xb'));var ejs=require(_0x935c('0xc'));var fs=require('fs');var fs_extra=require(_0x935c('0xd'));var _=require('lodash');var squel=require(_0x935c('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x935c('0xb'));var querystring=require(_0x935c('0xf'));var Papa=require(_0x935c('0x10'));var Redis=require('ioredis');var authService=require(_0x935c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x935c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x935c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x935c('0x14'));var db=require('../../mysqldb')['db'];config[_0x935c('0x15')]=_[_0x935c('0x16')](config['redis'],{'host':_0x935c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x935c('0x15')]));require(_0x935c('0x18'))[_0x935c('0x19')](socket);var jayson=require(_0x935c('0x1a'));var client=jayson[_0x935c('0x1b')][_0x935c('0x1c')]({'port':0x232c});var client9002=jayson[_0x935c('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15d7f4,_0x4a2bd4,_0x1198e2,_0x382984){return new BPromise(function(_0x52674c,_0x54fd68){var _0x3c8279=_0x382984||client;return _0x3c8279[_0x935c('0x1d')](_0x15d7f4,_0x1198e2)[_0x935c('0x1e')](function(_0x374cac){logger[_0x935c('0x1f')](_0x935c('0x20'),_0x4a2bd4,_0x935c('0x21'));logger[_0x935c('0x22')](_0x935c('0x23'),_0x4a2bd4,_0x935c('0x21'),JSON[_0x935c('0x24')](_0x374cac));if(_0x374cac[_0x935c('0x25')]){if(_0x374cac[_0x935c('0x25')][_0x935c('0x26')]===0x1f4){logger[_0x935c('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4a2bd4,_0x374cac['error'][_0x935c('0x27')]);return _0x54fd68(_0x374cac[_0x935c('0x25')]['message']);}logger[_0x935c('0x25')](_0x935c('0x20'),_0x4a2bd4,_0x374cac[_0x935c('0x25')]['message']);return _0x52674c(_0x374cac[_0x935c('0x25')][_0x935c('0x27')]);}else{logger[_0x935c('0x1f')](_0x935c('0x20'),_0x4a2bd4,_0x935c('0x21'));_0x52674c(_0x374cac[_0x935c('0x28')][_0x935c('0x27')]);}})[_0x935c('0x29')](function(_0x5a2455){logger[_0x935c('0x25')](_0x935c('0x20'),_0x4a2bd4,_0x5a2455);_0x54fd68(_0x5a2455);});});}function respondWithStatusCode(_0x1d4e05,_0x478d63){_0x478d63=_0x478d63||0xcc;return function(_0x433b1f){if(_0x433b1f){return _0x1d4e05[_0x935c('0x2a')](_0x478d63);}return _0x1d4e05[_0x935c('0x2b')](_0x478d63)[_0x935c('0x2c')]();};}function respondWithResult(_0x535e27,_0x145928){_0x145928=_0x145928||0xc8;return function(_0x4e7f95){if(_0x4e7f95){return _0x535e27[_0x935c('0x2b')](_0x145928)[_0x935c('0x2d')](_0x4e7f95);}};}function respondWithFilteredResult(_0x3c5813,_0x1f4588){return function(_0x22bf3a){if(_0x22bf3a){var _0x12d3f3=typeof _0x1f4588[_0x935c('0x2e')]===_0x935c('0x2f')&&typeof _0x1f4588['limit']===_0x935c('0x2f');var _0x577b8a=_0x22bf3a[_0x935c('0x30')];var _0x5ecf62=_0x12d3f3?0x0:_0x1f4588[_0x935c('0x2e')];var _0x562438=_0x12d3f3?_0x22bf3a[_0x935c('0x30')]:_0x1f4588[_0x935c('0x2e')]+_0x1f4588[_0x935c('0x31')];var _0x121e2e;if(_0x562438>=_0x577b8a){_0x562438=_0x577b8a;_0x121e2e=0xc8;}else{_0x121e2e=0xce;}_0x3c5813[_0x935c('0x2b')](_0x121e2e);return _0x3c5813[_0x935c('0x32')]('Content-Range',_0x5ecf62+'-'+_0x562438+'/'+_0x577b8a)[_0x935c('0x2d')](_0x22bf3a);}return null;};}function patchUpdates(_0x3ae1f8){return function(_0x44bf3d){try{jsonpatch[_0x935c('0x33')](_0x44bf3d,_0x3ae1f8,!![]);}catch(_0x362884){return BPromise[_0x935c('0x34')](_0x362884);}return _0x44bf3d[_0x935c('0x35')]();};}function saveUpdates(_0x3ba99e,_0x550928){return function(_0x28ac05){if(_0x28ac05){return _0x28ac05[_0x935c('0x36')](_0x3ba99e)[_0x935c('0x1e')](function(_0x4a7c89){return _0x4a7c89;});}return null;};}function removeEntity(_0x321357,_0x2fcfe3){return function(_0x5e9246){if(_0x5e9246){return _0x5e9246[_0x935c('0x37')]()[_0x935c('0x1e')](function(){_0x321357[_0x935c('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ceb0e,_0x1d283e){return function(_0x213d20){if(!_0x213d20){_0x1ceb0e[_0x935c('0x2a')](0x194);}return _0x213d20;};}function handleError(_0x398ee2,_0x5f92e0){_0x5f92e0=_0x5f92e0||0x1f4;return function(_0x5c6249){logger[_0x935c('0x25')](_0x5c6249['stack']);if(_0x5c6249['name']){delete _0x5c6249[_0x935c('0x38')];}_0x398ee2[_0x935c('0x2b')](_0x5f92e0)[_0x935c('0x39')](_0x5c6249);};}exports[_0x935c('0x3a')]=function(_0x2adda8,_0x505d61){var _0x5488d1={},_0x2ce877={},_0x375a8b={'count':0x0,'rows':[]};var _0x1d8de7=_[_0x935c('0x3b')](db[_0x935c('0x3c')]['rawAttributes'],function(_0x5bdd89){return{'name':_0x5bdd89[_0x935c('0x3d')],'type':_0x5bdd89[_0x935c('0x3e')][_0x935c('0x3f')]};});_0x2ce877[_0x935c('0x40')]=_['map'](_0x1d8de7,_0x935c('0x38'));_0x2ce877[_0x935c('0x41')]=_['keys'](_0x2adda8[_0x935c('0x41')]);_0x2ce877['filters']=_[_0x935c('0x42')](_0x2ce877['model'],_0x2ce877[_0x935c('0x41')]);_0x5488d1[_0x935c('0x43')]=_[_0x935c('0x42')](_0x2ce877[_0x935c('0x40')],qs[_0x935c('0x44')](_0x2adda8[_0x935c('0x41')][_0x935c('0x44')]));_0x5488d1[_0x935c('0x43')]=_0x5488d1[_0x935c('0x43')][_0x935c('0x45')]?_0x5488d1[_0x935c('0x43')]:_0x2ce877[_0x935c('0x40')];if(!_0x2adda8[_0x935c('0x41')][_0x935c('0x46')](_0x935c('0x47'))){_0x5488d1[_0x935c('0x31')]=qs[_0x935c('0x31')](_0x2adda8[_0x935c('0x41')][_0x935c('0x31')]);_0x5488d1[_0x935c('0x2e')]=qs[_0x935c('0x2e')](_0x2adda8['query'][_0x935c('0x2e')]);}_0x5488d1['order']=qs[_0x935c('0x48')](_0x2adda8['query'][_0x935c('0x48')]);_0x5488d1[_0x935c('0x49')]=qs[_0x935c('0x4a')](_[_0x935c('0x4b')](_0x2adda8[_0x935c('0x41')],_0x2ce877[_0x935c('0x4a')]),_0x1d8de7);if(_0x2adda8[_0x935c('0x41')][_0x935c('0x4c')]){_0x5488d1[_0x935c('0x49')]=_[_0x935c('0x4d')](_0x5488d1['where'],{'$or':_['map'](_0x1d8de7,function(_0x8c4539){if(_0x8c4539[_0x935c('0x3e')]!==_0x935c('0x4e')){var _0x5124d1={};_0x5124d1[_0x8c4539[_0x935c('0x38')]]={'$like':'%'+_0x2adda8[_0x935c('0x41')][_0x935c('0x4c')]+'%'};return _0x5124d1;}})});}_0x5488d1=_[_0x935c('0x4d')]({},_0x5488d1,_0x2adda8[_0x935c('0x4f')]);var _0x425f1b={'where':_0x5488d1[_0x935c('0x49')]};return db[_0x935c('0x3c')]['count'](_0x425f1b)[_0x935c('0x1e')](function(_0x490110){_0x375a8b[_0x935c('0x30')]=_0x490110;if(_0x2adda8[_0x935c('0x41')][_0x935c('0x50')]){_0x5488d1[_0x935c('0x51')]=[{'all':!![]}];}return db[_0x935c('0x3c')][_0x935c('0x52')](_0x5488d1);})[_0x935c('0x1e')](function(_0x2d5ba0){_0x375a8b[_0x935c('0x53')]=_0x2d5ba0;return _0x375a8b;})[_0x935c('0x1e')](respondWithFilteredResult(_0x505d61,_0x5488d1))[_0x935c('0x29')](handleError(_0x505d61,null));};exports['show']=function(_0x28c6e5,_0x95c4bb){var _0x111e15={'raw':!![],'where':{'id':_0x28c6e5[_0x935c('0x54')]['id']}},_0x552cc7={};_0x552cc7[_0x935c('0x40')]=_[_0x935c('0x55')](db['ChatMessage'][_0x935c('0x56')]);_0x552cc7[_0x935c('0x41')]=_[_0x935c('0x55')](_0x28c6e5[_0x935c('0x41')]);_0x552cc7[_0x935c('0x4a')]=_[_0x935c('0x42')](_0x552cc7[_0x935c('0x40')],_0x552cc7[_0x935c('0x41')]);_0x111e15['attributes']=_[_0x935c('0x42')](_0x552cc7[_0x935c('0x40')],qs[_0x935c('0x44')](_0x28c6e5[_0x935c('0x41')]['fields']));_0x111e15[_0x935c('0x43')]=_0x111e15['attributes'][_0x935c('0x45')]?_0x111e15[_0x935c('0x43')]:_0x552cc7[_0x935c('0x40')];if(_0x28c6e5[_0x935c('0x41')]['includeAll']){_0x111e15[_0x935c('0x51')]=[{'all':!![]}];}_0x111e15=_['merge']({},_0x111e15,_0x28c6e5[_0x935c('0x4f')]);return db[_0x935c('0x3c')][_0x935c('0x57')](_0x111e15)[_0x935c('0x1e')](handleEntityNotFound(_0x95c4bb,null))[_0x935c('0x1e')](respondWithResult(_0x95c4bb,null))[_0x935c('0x29')](handleError(_0x95c4bb,null));};exports[_0x935c('0x58')]=function(_0x23a99f,_0xde45ae){return db[_0x935c('0x3c')][_0x935c('0x58')](_0x23a99f[_0x935c('0x59')],{})['then'](respondWithResult(_0xde45ae,0xc9))[_0x935c('0x29')](handleError(_0xde45ae,null));};exports['update']=function(_0x1d6f42,_0x133cda){if(_0x1d6f42[_0x935c('0x59')]['id']){delete _0x1d6f42[_0x935c('0x59')]['id'];}return db[_0x935c('0x3c')][_0x935c('0x57')]({'where':{'id':_0x1d6f42['params']['id']}})[_0x935c('0x1e')](handleEntityNotFound(_0x133cda,null))['then'](saveUpdates(_0x1d6f42['body'],null))[_0x935c('0x1e')](respondWithResult(_0x133cda,null))[_0x935c('0x29')](handleError(_0x133cda,null));};exports[_0x935c('0x37')]=function(_0x42fbce,_0x24322a){return db[_0x935c('0x3c')][_0x935c('0x57')]({'where':{'id':_0x42fbce[_0x935c('0x54')]['id']}})['then'](handleEntityNotFound(_0x24322a,null))[_0x935c('0x1e')](removeEntity(_0x24322a,null))[_0x935c('0x29')](handleError(_0x24322a,null));};exports[_0x935c('0x5a')]=function(_0x7fd58d,_0x133163){return db[_0x935c('0x3c')][_0x935c('0x5a')]()[_0x935c('0x1e')](respondWithResult(_0x133163,null))[_0x935c('0x29')](handleError(_0x133163,null));};var interaction_log=require('../../config/logger')(_0x935c('0x5b'));exports[_0x935c('0x5c')]=function(_0x13f221,_0x2f9946,_0x2d8f18){var _0x56cf8b={'agent':{},'channel':_0x935c('0x5d')};if(_0x13f221['body']['id']){delete _0x13f221['body']['id'];}_0x13f221['body']['read']=!![];_0x13f221[_0x935c('0x59')]['readAt']=moment()[_0x935c('0x5e')](_0x935c('0x5f'));_0x13f221[_0x935c('0x59')][_0x935c('0x60')]=_0x13f221['body'][_0x935c('0x60')]||_0x13f221[_0x935c('0x61')]['id'];_0x56cf8b[_0x935c('0x62')]['id']=_0x13f221[_0x935c('0x59')][_0x935c('0x60')];return db[_0x935c('0x3c')][_0x935c('0x57')]({'where':{'id':_0x13f221[_0x935c('0x54')]['id'],'UserId':null}})[_0x935c('0x1e')](handleEntityNotFound(_0x2f9946,null))['then'](saveUpdates(_0x13f221[_0x935c('0x59')],null))['then'](function(_0x3bd2e2){if(_0x3bd2e2){_0x56cf8b[_0x935c('0x27')]=_0x3bd2e2[_0x935c('0x63')]({'plain':!![]});return db[_0x935c('0x64')][_0x935c('0x57')]({'where':{'id':_0x3bd2e2[_0x935c('0x65')]}});}return null;})[_0x935c('0x1e')](handleEntityNotFound(_0x2f9946,null))[_0x935c('0x1e')](function(_0x2ef405){if(_0x2ef405){return _0x2ef405[_0x935c('0x36')]({'UserId':_0x13f221[_0x935c('0x59')][_0x935c('0x60')],'read1stAt':_[_0x935c('0x66')](_0x2ef405[_0x935c('0x67')])?moment()[_0x935c('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x935c('0x1e')](function(_0x161ccb){if(_0x161ccb){_0x56cf8b[_0x935c('0x68')]=_0x161ccb[_0x935c('0x63')]({'plain':!![]});interaction_log['info'](_0x935c('0x69'),_0x13f221['user']['id'],_0x13f221[_0x935c('0x61')][_0x935c('0x38')],_0x13f221['user'][_0x935c('0x6a')],_0x56cf8b[_0x935c('0x68')]['id'],_0x13f221[_0x935c('0x59')]?JSON['stringify'](_0x13f221[_0x935c('0x59')]):_0x935c('0x6b'));return respondWithRpcPromise(_0x935c('0x6c'),'acceptMessage',_0x56cf8b);}return null;})['then'](function(_0x46568d){var _0x1a700a=_0x935c('0x6d')+_0x46568d[_0x935c('0x27')][_0x935c('0x6e')];return db[_0x935c('0x6f')]['query'](_0x1a700a,{'type':db[_0x935c('0x70')][_0x935c('0x71')]['SELECT'],'raw':!![]})[_0x935c('0x1e')](function(_0x598f63){return _0x598f63;});})[_0x935c('0x1e')](function(_0xd3e309){if(_0xd3e309){_0x56cf8b[_0x935c('0x27')]['contact']=_0xd3e309[0x0];if(!_0x13f221[_0x935c('0x59')][_0x935c('0x60')])return;return db[_0x935c('0x72')][_0x935c('0x57')]({'where':{'id':_0x13f221['body'][_0x935c('0x60')],'role':_0x935c('0x62')},'attributes':['id',_0x935c('0x38'),_0x935c('0x73'),_0x935c('0x74'),'internal'],'raw':!![]});}return null;})[_0x935c('0x1e')](function(_0x2aafd5){if(!_0x2aafd5)return null;_0x56cf8b[_0x935c('0x27')]['agent']=_0x2aafd5;return _0x56cf8b;})[_0x935c('0x1e')](function(_0x54c817){if(_0x54c817){if(_0x13f221[_0x935c('0x59')][_0x935c('0x75')]){_0x56cf8b[_0x935c('0x27')]['interface']=util[_0x935c('0x5e')](_0x935c('0x76'),_0x13f221[_0x935c('0x61')][_0x935c('0x38')]);_0x56cf8b[_0x935c('0x27')][_0x935c('0x77')]=_0x56cf8b[_0x935c('0x77')];_0x56cf8b['message'][_0x935c('0x78')]=_0x56cf8b[_0x935c('0x77')];_0x56cf8b[_0x935c('0x27')][_0x935c('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x935c('0x7a'),'message':_[_0x935c('0x4d')](_0x56cf8b[_0x935c('0x27')],JSON[_0x935c('0x7b')](_0x56cf8b[_0x935c('0x68')]['formData']))},client9002)[_0x935c('0x1e')](function(){return _0x56cf8b;});}return _0x56cf8b;}return null;})['then'](respondWithResult(_0x2f9946,null))[_0x935c('0x29')](handleError(_0x2f9946,null));};var interaction_log=require('../../config/logger')(_0x935c('0x5b'));exports[_0x935c('0x34')]=function(_0x514b52,_0x57eb2,_0x3fcf8e){var _0x36cfac={'agent':{},'channel':_0x935c('0x5d')};if(_0x514b52['body']['id']){delete _0x514b52['body']['id'];}_0x514b52['body'][_0x935c('0x60')]=_0x514b52[_0x935c('0x59')]['UserId']||_0x514b52['user']['id'];_0x36cfac[_0x935c('0x62')]['id']=_0x514b52[_0x935c('0x59')][_0x935c('0x60')];return db[_0x935c('0x3c')][_0x935c('0x57')]({'where':{'id':_0x514b52[_0x935c('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57eb2,null))[_0x935c('0x1e')](function(_0x19fc80){if(_0x19fc80){_0x36cfac[_0x935c('0x27')]=_0x19fc80['get']({'plain':!![]});return db[_0x935c('0x64')][_0x935c('0x57')]({'where':{'id':_0x19fc80[_0x935c('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x57eb2,null))[_0x935c('0x1e')](function(_0xa520c4){if(_0xa520c4){_0x36cfac[_0x935c('0x68')]=_0xa520c4[_0x935c('0x63')]({'plain':!![]});interaction_log['info'](_0x935c('0x7c'),_0x514b52['user']['id'],_0x514b52[_0x935c('0x61')][_0x935c('0x38')],_0x514b52['user'][_0x935c('0x6a')],_0x36cfac[_0x935c('0x68')]['id'],_0x514b52[_0x935c('0x59')]?JSON['stringify'](_0x514b52[_0x935c('0x59')]):_0x935c('0x6b'));return respondWithRpcPromise(_0x935c('0x7d'),'rejectMessage',_0x36cfac);}return null;})[_0x935c('0x1e')](function(_0x4f9924){var _0x4405ce=_0x935c('0x6d')+_0x4f9924[_0x935c('0x27')][_0x935c('0x6e')];return db['sequelize'][_0x935c('0x41')](_0x4405ce,{'type':db[_0x935c('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x935c('0x1e')](function(_0x3a735e){return _0x3a735e;});})[_0x935c('0x1e')](function(_0xb54a94){if(_0xb54a94){_0x36cfac[_0x935c('0x27')][_0x935c('0x7e')]=_0xb54a94[0x0];if(!_0x514b52[_0x935c('0x59')][_0x935c('0x60')])return;return db[_0x935c('0x72')][_0x935c('0x57')]({'where':{'id':_0x514b52[_0x935c('0x59')][_0x935c('0x60')],'role':_0x935c('0x62')},'attributes':['id',_0x935c('0x38'),'fullname',_0x935c('0x74'),'internal'],'raw':!![]});}return null;})[_0x935c('0x1e')](function(_0x2476b1){if(!_0x2476b1)return null;_0x36cfac[_0x935c('0x27')][_0x935c('0x62')]=_0x2476b1;return _0x36cfac;})[_0x935c('0x1e')](function(_0x4a357b){if(_0x4a357b){_0x4a357b[_0x935c('0x27')][_0x935c('0x7f')]=util[_0x935c('0x5e')](_0x935c('0x76'),_0x514b52[_0x935c('0x61')][_0x935c('0x38')]);_0x4a357b[_0x935c('0x27')][_0x935c('0x77')]=_0x36cfac[_0x935c('0x77')];_0x4a357b[_0x935c('0x27')]['motionChannel']=_0x36cfac[_0x935c('0x77')];_0x4a357b[_0x935c('0x27')]['event']=_0x935c('0x34');respondWithRpcPromise(_0x935c('0x80'),_0x935c('0x80'),{'event':_0x935c('0x81'),'message':_[_0x935c('0x4d')](_0x36cfac[_0x935c('0x27')],JSON[_0x935c('0x7b')](_0x36cfac[_0x935c('0x68')]['formData']))},client9002);return _0x36cfac;}return null;})[_0x935c('0x1e')](respondWithResult(_0x57eb2,null))[_0x935c('0x29')](handleError(_0x57eb2,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 26ffe7e..17c06da 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 _0x1345=['events','../../mysqldb','ChatMessage','save','remove','emit','hook','exports'];(function(_0x5c6d39,_0x163c70){var _0x331a7a=function(_0x24329b){while(--_0x24329b){_0x5c6d39['push'](_0x5c6d39['shift']());}};_0x331a7a(++_0x163c70);}(_0x1345,0xb8));var _0x5134=function(_0x37ad1c,_0x247bd6){_0x37ad1c=_0x37ad1c-0x0;var _0xedeefb=_0x1345[_0x37ad1c];return _0xedeefb;};'use strict';var EventEmitter=require(_0x5134('0x0'));var ChatMessage=require(_0x5134('0x1'))['db'][_0x5134('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5134('0x3'),'afterUpdate':'update','afterDestroy':_0x5134('0x4')};function emitEvent(_0x2a25b1){return function(_0x4522a9,_0x47595b,_0x193081){ChatMessageEvents['emit'](_0x2a25b1+':'+_0x4522a9['id'],_0x4522a9);ChatMessageEvents[_0x5134('0x5')](_0x2a25b1,_0x4522a9);_0x193081(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x5134('0x6')](e,emitEvent(event));}}module[_0x5134('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x1417=['ChatMessage','setMaxListeners','update','remove','emit','events'];(function(_0x500404,_0x4b70f9){var _0x1cda34=function(_0x5f361a){while(--_0x5f361a){_0x500404['push'](_0x500404['shift']());}};_0x1cda34(++_0x4b70f9);}(_0x1417,0x71));var _0x7141=function(_0x315086,_0xb1fec4){_0x315086=_0x315086-0x0;var _0x3ffa0c=_0x1417[_0x315086];return _0x3ffa0c;};'use strict';var EventEmitter=require(_0x7141('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x7141('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7141('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7141('0x3'),'afterDestroy':_0x7141('0x4')};function emitEvent(_0x5af999){return function(_0x326502,_0x189e3f,_0x781394){ChatMessageEvents['emit'](_0x5af999+':'+_0x326502['id'],_0x326502);ChatMessageEvents[_0x7141('0x5')](_0x5af999,_0x326502);_0x781394(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 8a99738..6ab039a 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 _0xb9a7=['then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9a7,0x66));var _0x7b9a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb9a7[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7b9a('0x0'));var util=require(_0x7b9a('0x1'));var logger=require(_0x7b9a('0x2'))(_0x7b9a('0x3'));var moment=require(_0x7b9a('0x4'));var BPromise=require(_0x7b9a('0x5'));var rp=require(_0x7b9a('0x6'));var fs=require('fs');var path=require(_0x7b9a('0x7'));var rimraf=require(_0x7b9a('0x8'));var config=require(_0x7b9a('0x9'));var attributes=require(_0x7b9a('0xa'));module[_0x7b9a('0xb')]=function(_0x12d6ca,_0x4a3a36){return _0x12d6ca[_0x7b9a('0xc')]('ChatMessage',attributes,{'tableName':_0x7b9a('0xd'),'paranoid':![],'indexes':[{'name':_0x7b9a('0xe'),'fields':['body'],'type':_0x7b9a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ca8dd,_0x2d9fdf,_0x20e42a){var _0x1cdd76=_0x12d6ca[_0x7b9a('0x10')];var _0x370083=_0x3ca8dd[_0x7b9a('0x11')]({'plain':!![]});if(_0x370083[_0x7b9a('0x12')][_0x7b9a('0x13')]()==='in'||_0x370083['direction'][_0x7b9a('0x13')]()===_0x7b9a('0x14')&&!_0x370083[_0x7b9a('0x15')]&&!_[_0x7b9a('0x16')](_0x370083['UserId'])){_0x1cdd76[_0x7b9a('0x17')][_0x7b9a('0x18')]({'where':{'id':_0x370083[_0x7b9a('0x19')]}})[_0x7b9a('0x1a')](function(_0x4fbd3a){if(_0x4fbd3a){_0x4fbd3a[_0x7b9a('0x1b')]({'lastMsgAt':_0x370083[_0x7b9a('0x1c')],'lastMsgDirection':_0x370083['direction']['toLowerCase']()});}})[_0x7b9a('0x1d')](function(_0x2445c7){console[_0x7b9a('0x1e')](_0x2445c7);});}_0x20e42a();}},'charset':'utf8mb4','collate':_0x7b9a('0x1f')});}; \ No newline at end of file +var _0xcefe=['api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x422345,_0x4e4c07){var _0x1f8f59=function(_0x234be9){while(--_0x234be9){_0x422345['push'](_0x422345['shift']());}};_0x1f8f59(++_0x4e4c07);}(_0xcefe,0x15a));var _0xecef=function(_0x57f8cd,_0x378850){_0x57f8cd=_0x57f8cd-0x0;var _0x2a65ea=_0xcefe[_0x57f8cd];return _0x2a65ea;};'use strict';var _=require(_0xecef('0x0'));var util=require('util');var logger=require(_0xecef('0x1'))(_0xecef('0x2'));var moment=require(_0xecef('0x3'));var BPromise=require('bluebird');var rp=require(_0xecef('0x4'));var fs=require('fs');var path=require(_0xecef('0x5'));var rimraf=require(_0xecef('0x6'));var config=require(_0xecef('0x7'));var attributes=require(_0xecef('0x8'));module['exports']=function(_0x5bc733,_0x147289){return _0x5bc733[_0xecef('0x9')]('ChatMessage',attributes,{'tableName':_0xecef('0xa'),'paranoid':![],'indexes':[{'name':_0xecef('0xb'),'fields':[_0xecef('0xc')],'type':_0xecef('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41bb3f,_0x361e61,_0x36cc1b){var _0x316a26=_0x5bc733[_0xecef('0xe')];var _0x43e0c0=_0x41bb3f[_0xecef('0xf')]({'plain':!![]});if(_0x43e0c0[_0xecef('0x10')][_0xecef('0x11')]()==='in'||_0x43e0c0[_0xecef('0x10')][_0xecef('0x11')]()===_0xecef('0x12')&&!_0x43e0c0[_0xecef('0x13')]&&!_['isNil'](_0x43e0c0[_0xecef('0x14')])){_0x316a26[_0xecef('0x15')][_0xecef('0x16')]({'where':{'id':_0x43e0c0['ChatInteractionId']}})[_0xecef('0x17')](function(_0x29e515){if(_0x29e515){_0x29e515[_0xecef('0x18')]({'lastMsgAt':_0x43e0c0[_0xecef('0x19')],'lastMsgDirection':_0x43e0c0[_0xecef('0x10')][_0xecef('0x11')]()});}})[_0xecef('0x1a')](function(_0x29e69b){console[_0xecef('0x1b')](_0x29e69b);});}_0x36cc1b();}},'charset':'utf8mb4','collate':_0xecef('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fc04b96..ad040e2 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 _0x01be=['body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create'];(function(_0x2b0661,_0xa854f4){var _0x3cdd13=function(_0x435b7d){while(--_0x435b7d){_0x2b0661['push'](_0x2b0661['shift']());}};_0x3cdd13(++_0xa854f4);}(_0x01be,0x136));var _0xe01b=function(_0x39bd7f,_0xf8d10f){_0x39bd7f=_0x39bd7f-0x0;var _0x510ccf=_0x01be[_0x39bd7f];return _0x510ccf;};'use strict';var _=require(_0xe01b('0x0'));var util=require(_0xe01b('0x1'));var moment=require(_0xe01b('0x2'));var BPromise=require(_0xe01b('0x3'));var rs=require(_0xe01b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe01b('0x5'))['db'];var utils=require(_0xe01b('0x6'));var logger=require('../../config/logger')(_0xe01b('0x7'));var config=require(_0xe01b('0x8'));var jayson=require(_0xe01b('0x9'));var client=jayson[_0xe01b('0xa')][_0xe01b('0xb')]({'port':0x232a});config[_0xe01b('0xc')]=_['defaults'](config[_0xe01b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe01b('0xd'))(new Redis(config[_0xe01b('0xc')]));require('./chatMessage.socket')[_0xe01b('0xe')](socket);function respondWithRpcPromise(_0x34f26a,_0x5ebafe,_0x4a7f05){return new BPromise(function(_0x2648cd,_0x10cdae){return client[_0xe01b('0xf')](_0x34f26a,_0x4a7f05)['then'](function(_0x279580){logger[_0xe01b('0x10')](_0xe01b('0x11'),_0x5ebafe,_0xe01b('0x12'));logger[_0xe01b('0x13')](_0xe01b('0x14'),_0x5ebafe,_0xe01b('0x12'),JSON[_0xe01b('0x15')](_0x279580));if(_0x279580[_0xe01b('0x16')]){if(_0x279580['error'][_0xe01b('0x17')]===0x1f4){logger[_0xe01b('0x16')](_0xe01b('0x11'),_0x5ebafe,_0x279580['error'][_0xe01b('0x18')]);return _0x10cdae(_0x279580['error'][_0xe01b('0x18')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x5ebafe,_0x279580['error'][_0xe01b('0x18')]);return _0x2648cd(_0x279580['error']['message']);}else{logger[_0xe01b('0x10')]('ChatMessage,\x20%s,\x20%s',_0x5ebafe,_0xe01b('0x12'));_0x2648cd(_0x279580[_0xe01b('0x19')][_0xe01b('0x18')]);}})[_0xe01b('0x1a')](function(_0x53ff14){logger[_0xe01b('0x16')](_0xe01b('0x11'),_0x5ebafe,_0x53ff14);_0x10cdae(_0x53ff14);});});}exports[_0xe01b('0x1b')]=function(_0x235adc){var _0x5b12d4=this;return new Promise(function(_0x5f1402,_0xc666d6){return db[_0xe01b('0x1c')][_0xe01b('0x1d')](_0x235adc[_0xe01b('0x1e')],{'raw':_0x235adc[_0xe01b('0x1f')]?_0x235adc[_0xe01b('0x1f')][_0xe01b('0x20')]===undefined?!![]:![]:!![]})[_0xe01b('0x21')](function(_0x1eeb98){logger[_0xe01b('0x10')](_0xe01b('0x1b'),_0x235adc);logger[_0xe01b('0x13')](_0xe01b('0x1b'),_0x235adc,JSON[_0xe01b('0x15')](_0x1eeb98));_0x5f1402(_0x1eeb98);})[_0xe01b('0x1a')](function(_0x1614fb){logger[_0xe01b('0x16')](_0xe01b('0x1b'),_0x1614fb[_0xe01b('0x18')],_0x235adc);_0xc666d6(_0x5b12d4[_0xe01b('0x16')](0x1f4,_0x1614fb['message']));});});}; \ No newline at end of file +var _0x63eb=['defaults','redis','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x63eb,0x195));var _0xb63e=function(_0x30ca0b,_0x5cbe5b){_0x30ca0b=_0x30ca0b-0x0;var _0x320b45=_0x63eb[_0x30ca0b];return _0x320b45;};'use strict';var _=require(_0xb63e('0x0'));var util=require(_0xb63e('0x1'));var moment=require(_0xb63e('0x2'));var BPromise=require(_0xb63e('0x3'));var rs=require(_0xb63e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb63e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb63e('0x6'))(_0xb63e('0x7'));var config=require(_0xb63e('0x8'));var jayson=require(_0xb63e('0x9'));var client=jayson[_0xb63e('0xa')]['http']({'port':0x232a});config['redis']=_[_0xb63e('0xb')](config[_0xb63e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb63e('0xd'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xb63e('0xe')](socket);function respondWithRpcPromise(_0x1ab60b,_0x31887c,_0x3d196d){return new BPromise(function(_0x8a9280,_0x5bfb39){return client[_0xb63e('0xf')](_0x1ab60b,_0x3d196d)[_0xb63e('0x10')](function(_0xb4d903){logger['info'](_0xb63e('0x11'),_0x31887c,_0xb63e('0x12'));logger[_0xb63e('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x31887c,_0xb63e('0x12'),JSON[_0xb63e('0x14')](_0xb4d903));if(_0xb4d903['error']){if(_0xb4d903['error'][_0xb63e('0x15')]===0x1f4){logger[_0xb63e('0x16')](_0xb63e('0x11'),_0x31887c,_0xb4d903[_0xb63e('0x16')][_0xb63e('0x17')]);return _0x5bfb39(_0xb4d903[_0xb63e('0x16')]['message']);}logger[_0xb63e('0x16')](_0xb63e('0x11'),_0x31887c,_0xb4d903[_0xb63e('0x16')][_0xb63e('0x17')]);return _0x8a9280(_0xb4d903[_0xb63e('0x16')][_0xb63e('0x17')]);}else{logger[_0xb63e('0x18')](_0xb63e('0x11'),_0x31887c,_0xb63e('0x12'));_0x8a9280(_0xb4d903['result']['message']);}})[_0xb63e('0x19')](function(_0x32a606){logger[_0xb63e('0x16')](_0xb63e('0x11'),_0x31887c,_0x32a606);_0x5bfb39(_0x32a606);});});}exports['CreateChatMessage']=function(_0x17b1ed){var _0x40e991=this;return new Promise(function(_0x306bad,_0x40f9a2){return db[_0xb63e('0x1a')][_0xb63e('0x1b')](_0x17b1ed[_0xb63e('0x1c')],{'raw':_0x17b1ed[_0xb63e('0x1d')]?_0x17b1ed['options'][_0xb63e('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x274e10){logger[_0xb63e('0x18')](_0xb63e('0x1f'),_0x17b1ed);logger['debug'](_0xb63e('0x1f'),_0x17b1ed,JSON['stringify'](_0x274e10));_0x306bad(_0x274e10);})[_0xb63e('0x19')](function(_0x31629c){logger[_0xb63e('0x16')](_0xb63e('0x1f'),_0x31629c[_0xb63e('0x17')],_0x17b1ed);_0x40f9a2(_0x40e991['error'](0x1f4,_0x31629c['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index a145dd0..0134b96 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 _0x7c09=['save','remove','emit','removeListener','length','chatMessage:'];(function(_0x3c8c0a,_0x581709){var _0x401fd6=function(_0x13de2d){while(--_0x13de2d){_0x3c8c0a['push'](_0x3c8c0a['shift']());}};_0x401fd6(++_0x581709);}(_0x7c09,0x102));var _0x97c0=function(_0x3664f6,_0x231eeb){_0x3664f6=_0x3664f6-0x0;var _0x19a375=_0x7c09[_0x3664f6];return _0x19a375;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){ChatMessageEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);ChatMessageEvents['on'](_0x2c19fa,_0x109bc8);}}; \ No newline at end of file +var _0x1561=['chatMessage:','remove','update','removeListener','register','length'];(function(_0x462d45,_0xec23a){var _0x51acb3=function(_0x13e784){while(--_0x13e784){_0x462d45['push'](_0x462d45['shift']());}};_0x51acb3(++_0xec23a);}(_0x1561,0x1bd));var _0x1156=function(_0x4cd9dd,_0x3701c8){_0x4cd9dd=_0x4cd9dd-0x0;var _0x24446a=_0x1561[_0x4cd9dd];return _0x24446a;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x1156('0x0'),_0x1156('0x1')];function createListener(_0x14f74b,_0x1ce4ca){return function(_0x1f66f7){_0x1ce4ca['emit'](_0x14f74b,_0x1f66f7);};}function removeListener(_0x1be639,_0x2b0b90){return function(){ChatMessageEvents[_0x1156('0x2')](_0x1be639,_0x2b0b90);};}exports[_0x1156('0x3')]=function(_0x5c989c){for(var _0xb0dab7=0x0,_0x4a7048=events[_0x1156('0x4')];_0xb0dab7<_0x4a7048;_0xb0dab7++){var _0x6c3476=events[_0xb0dab7];var _0x273b53=createListener(_0x1156('0x5')+_0x6c3476,_0x5c989c);ChatMessageEvents['on'](_0x6c3476,_0x273b53);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 795f11d..cd2c09a 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 _0xb977=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','chat','chatmessage:create','create','/:id','update','put','/:id/reject','reject','destroy','multer','util','path'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb977,0x1d8));var _0x7b97=function(_0x3c7130,_0x4abee0){_0x3c7130=_0x3c7130-0x0;var _0x477bf1=_0xb977[_0x3c7130];return _0x477bf1;};'use strict';var multer=require(_0x7b97('0x0'));var util=require(_0x7b97('0x1'));var path=require(_0x7b97('0x2'));var timeout=require(_0x7b97('0x3'));var express=require(_0x7b97('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b97('0x5'));var interaction=require(_0x7b97('0x6'));var config=require(_0x7b97('0x7'));var controller=require(_0x7b97('0x8'));router[_0x7b97('0x9')]('/',auth[_0x7b97('0xa')](),controller[_0x7b97('0xb')]);router[_0x7b97('0x9')](_0x7b97('0xc'),auth[_0x7b97('0xa')](),controller['describe']);router[_0x7b97('0x9')]('/:id',auth[_0x7b97('0xa')](),controller[_0x7b97('0xd')]);router[_0x7b97('0xe')]('/',auth[_0x7b97('0xa')](),interaction[_0x7b97('0xf')](_0x7b97('0x10'),_0x7b97('0x11')),controller[_0x7b97('0x12')]);router['put'](_0x7b97('0x13'),controller[_0x7b97('0x14')]);router[_0x7b97('0x15')]('/:id/accept',auth[_0x7b97('0xa')](),controller['accept']);router['put'](_0x7b97('0x16'),auth[_0x7b97('0xa')](),controller[_0x7b97('0x17')]);router['delete'](_0x7b97('0x13'),auth[_0x7b97('0xa')](),controller[_0x7b97('0x18')]);module['exports']=router; \ No newline at end of file +var _0x8206=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject'];(function(_0x531924,_0x5642f5){var _0x5b9d45=function(_0x2ed9b0){while(--_0x2ed9b0){_0x531924['push'](_0x531924['shift']());}};_0x5b9d45(++_0x5642f5);}(_0x8206,0x9f));var _0x6820=function(_0x98f6c3,_0x28639f){_0x98f6c3=_0x98f6c3-0x0;var _0x29238c=_0x8206[_0x98f6c3];return _0x29238c;};'use strict';var multer=require(_0x6820('0x0'));var util=require(_0x6820('0x1'));var path=require(_0x6820('0x2'));var timeout=require(_0x6820('0x3'));var express=require(_0x6820('0x4'));var router=express['Router']();var fs_extra=require(_0x6820('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6820('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x6820('0x7')]('/',auth['isAuthenticated'](),controller[_0x6820('0x8')]);router[_0x6820('0x7')](_0x6820('0x9'),auth[_0x6820('0xa')](),controller[_0x6820('0xb')]);router[_0x6820('0x7')](_0x6820('0xc'),auth[_0x6820('0xa')](),controller['show']);router[_0x6820('0xd')]('/',auth[_0x6820('0xa')](),interaction[_0x6820('0xe')](_0x6820('0xf'),_0x6820('0x10')),controller[_0x6820('0x11')]);router[_0x6820('0x12')](_0x6820('0xc'),controller[_0x6820('0x13')]);router[_0x6820('0x12')](_0x6820('0x14'),auth[_0x6820('0xa')](),controller[_0x6820('0x15')]);router[_0x6820('0x12')]('/:id/reject',auth[_0x6820('0xa')](),controller[_0x6820('0x16')]);router[_0x6820('0x17')](_0x6820('0xc'),auth[_0x6820('0xa')](),controller[_0x6820('0x18')]);module[_0x6820('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 36c3b47..fcc3dbe 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 _0x1ab0=['sequelize','exports','TEXT'];(function(_0x32447e,_0x4e3b81){var _0x3a41b0=function(_0x495e43){while(--_0x495e43){_0x32447e['push'](_0x32447e['shift']());}};_0x3a41b0(++_0x4e3b81);}(_0x1ab0,0x1dd));var _0x01ab=function(_0x260393,_0x429d84){_0x260393=_0x260393-0x0;var _0x8c9b95=_0x1ab0[_0x260393];return _0x8c9b95;};'use strict';var Sequelize=require(_0x01ab('0x0'));module[_0x01ab('0x1')]={'body':{'type':Sequelize[_0x01ab('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xd1ac=['exports','TEXT','sequelize'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xd1ac,0xa1));var _0xcd1a=function(_0x4c2af0,_0x40921a){_0x4c2af0=_0x4c2af0-0x0;var _0x259f2c=_0xd1ac[_0x4c2af0];return _0x259f2c;};'use strict';var Sequelize=require(_0xcd1a('0x0'));module[_0xcd1a('0x1')]={'body':{'type':Sequelize[_0xcd1a('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 537f3a9..53a8f5d 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(_0x2316b8,_0x4dea87){var _0x5add63=function(_0x2a5bd6){while(--_0x2a5bd6){_0x2316b8['push'](_0x2316b8['shift']());}};_0x5add63(++_0x4dea87);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x30a099,_0x2eb6bb){_0x30a099=_0x30a099-0x0;var _0x3fc35b=_0x7a54[_0x30a099];return _0x3fc35b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 54ee0af..948a304 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 _0x50d9=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x56b886,_0x1ff474){var _0x164baf=function(_0x575d09){while(--_0x575d09){_0x56b886['push'](_0x56b886['shift']());}};_0x164baf(++_0x1ff474);}(_0x50d9,0x1e9));var _0x950d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x50d9[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x950d('0x0'));var logger=require('../../config/logger')(_0x950d('0x1'));var moment=require(_0x950d('0x2'));var BPromise=require(_0x950d('0x3'));var rp=require(_0x950d('0x4'));var fs=require('fs');var path=require(_0x950d('0x5'));var rimraf=require(_0x950d('0x6'));var config=require(_0x950d('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0x950d('0x8')]=function(_0x1a3069,_0x3a1f35){return _0x1a3069['define']('ChatOfflineMessage',attributes,{'tableName':_0x950d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x950d('0xa'),'collate':_0x950d('0xb')});}; \ No newline at end of file +var _0x2a25=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','chat_offline_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x555ebb,_0x488366){var _0x1c2733=function(_0x4e8d65){while(--_0x4e8d65){_0x555ebb['push'](_0x555ebb['shift']());}};_0x1c2733(++_0x488366);}(_0x2a25,0xee));var _0x52a2=function(_0xbef85a,_0x23e70a){_0xbef85a=_0xbef85a-0x0;var _0x233d64=_0x2a25[_0xbef85a];return _0x233d64;};'use strict';var _=require(_0x52a2('0x0'));var util=require(_0x52a2('0x1'));var logger=require(_0x52a2('0x2'))(_0x52a2('0x3'));var moment=require(_0x52a2('0x4'));var BPromise=require(_0x52a2('0x5'));var rp=require(_0x52a2('0x6'));var fs=require('fs');var path=require(_0x52a2('0x7'));var rimraf=require(_0x52a2('0x8'));var config=require(_0x52a2('0x9'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x3d5157,_0x2bc6b7){return _0x3d5157['define']('ChatOfflineMessage',attributes,{'tableName':_0x52a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x52a2('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3e67344..b54365e 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 _0x28d1=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x2f6ce3,_0x23cd93){var _0x20cf45=function(_0x1d3462){while(--_0x1d3462){_0x2f6ce3['push'](_0x2f6ce3['shift']());}};_0x20cf45(++_0x23cd93);}(_0x28d1,0xbd));var _0x128d=function(_0x2dcea6,_0x1c428b){_0x2dcea6=_0x2dcea6-0x0;var _0x129701=_0x28d1[_0x2dcea6];return _0x129701;};'use strict';var _=require(_0x128d('0x0'));var util=require(_0x128d('0x1'));var moment=require(_0x128d('0x2'));var BPromise=require(_0x128d('0x3'));var rs=require(_0x128d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x128d('0x5'));var logger=require(_0x128d('0x6'))(_0x128d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x128d('0x8')][_0x128d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3913e7,_0x155c80,_0xf2e2b5){return new BPromise(function(_0x1645a3,_0x464c32){return client[_0x128d('0xa')](_0x3913e7,_0xf2e2b5)[_0x128d('0xb')](function(_0x552695){logger['info'](_0x128d('0xc'),_0x155c80,_0x128d('0xd'));logger[_0x128d('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x155c80,_0x128d('0xd'),JSON[_0x128d('0xf')](_0x552695));if(_0x552695['error']){if(_0x552695[_0x128d('0x10')]['code']===0x1f4){logger[_0x128d('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x155c80,_0x552695[_0x128d('0x10')][_0x128d('0x11')]);return _0x464c32(_0x552695[_0x128d('0x10')][_0x128d('0x11')]);}logger[_0x128d('0x10')](_0x128d('0xc'),_0x155c80,_0x552695[_0x128d('0x10')][_0x128d('0x11')]);return _0x1645a3(_0x552695[_0x128d('0x10')][_0x128d('0x11')]);}else{logger[_0x128d('0x12')](_0x128d('0xc'),_0x155c80,'request\x20sent');_0x1645a3(_0x552695[_0x128d('0x13')][_0x128d('0x11')]);}})[_0x128d('0x14')](function(_0x4339df){logger[_0x128d('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x155c80,_0x4339df);_0x464c32(_0x4339df);});});} \ No newline at end of file +var _0x60ed=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x474952,_0x44bd77){var _0x332502=function(_0x540ebe){while(--_0x540ebe){_0x474952['push'](_0x474952['shift']());}};_0x332502(++_0x44bd77);}(_0x60ed,0x73));var _0xd60e=function(_0x24148d,_0xb1e251){_0x24148d=_0x24148d-0x0;var _0x4de78d=_0x60ed[_0x24148d];return _0x4de78d;};'use strict';var _=require(_0xd60e('0x0'));var util=require(_0xd60e('0x1'));var moment=require(_0xd60e('0x2'));var BPromise=require(_0xd60e('0x3'));var rs=require(_0xd60e('0x4'));var fs=require('fs');var Redis=require(_0xd60e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd60e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd60e('0x7')][_0xd60e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3adc23,_0x47b2bf,_0x7988cb){return new BPromise(function(_0xa3aac7,_0xc22bc1){return client['request'](_0x3adc23,_0x7988cb)[_0xd60e('0x9')](function(_0x1ca561){logger[_0xd60e('0xa')](_0xd60e('0xb'),_0x47b2bf,_0xd60e('0xc'));logger[_0xd60e('0xd')](_0xd60e('0xe'),_0x47b2bf,_0xd60e('0xc'),JSON['stringify'](_0x1ca561));if(_0x1ca561[_0xd60e('0xf')]){if(_0x1ca561[_0xd60e('0xf')][_0xd60e('0x10')]===0x1f4){logger[_0xd60e('0xf')](_0xd60e('0xb'),_0x47b2bf,_0x1ca561[_0xd60e('0xf')][_0xd60e('0x11')]);return _0xc22bc1(_0x1ca561['error'][_0xd60e('0x11')]);}logger['error'](_0xd60e('0xb'),_0x47b2bf,_0x1ca561[_0xd60e('0xf')][_0xd60e('0x11')]);return _0xa3aac7(_0x1ca561[_0xd60e('0xf')][_0xd60e('0x11')]);}else{logger[_0xd60e('0xa')](_0xd60e('0xb'),_0x47b2bf,_0xd60e('0xc'));_0xa3aac7(_0x1ca561['result'][_0xd60e('0x11')]);}})[_0xd60e('0x12')](function(_0x2dfb82){logger[_0xd60e('0xf')](_0xd60e('0xb'),_0x47b2bf,_0x2dfb82);_0xc22bc1(_0x2dfb82);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3c8b17f..386785a 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 _0xd1b5=['./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xd1b5,0x1d9));var _0x5d1b=function(_0x3ff556,_0x3bbeff){_0x3ff556=_0x3ff556-0x0;var _0x453a3b=_0xd1b5[_0x3ff556];return _0x453a3b;};'use strict';var multer=require(_0x5d1b('0x0'));var util=require(_0x5d1b('0x1'));var path=require(_0x5d1b('0x2'));var timeout=require(_0x5d1b('0x3'));var express=require(_0x5d1b('0x4'));var router=express[_0x5d1b('0x5')]();var fs_extra=require(_0x5d1b('0x6'));var auth=require(_0x5d1b('0x7'));var interaction=require(_0x5d1b('0x8'));var config=require(_0x5d1b('0x9'));var controller=require(_0x5d1b('0xa'));router['get']('/',auth[_0x5d1b('0xb')](),controller[_0x5d1b('0xc')]);router[_0x5d1b('0xd')](_0x5d1b('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x5d1b('0xd')](_0x5d1b('0xf'),auth['isAuthenticated'](),controller[_0x5d1b('0x10')]);router[_0x5d1b('0x11')]('/',auth[_0x5d1b('0xb')](),controller[_0x5d1b('0x12')]);router[_0x5d1b('0x13')](_0x5d1b('0xf'),auth[_0x5d1b('0xb')](),controller['update']);router['delete']('/:id',auth[_0x5d1b('0xb')](),controller[_0x5d1b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8310=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8310,0x10d));var _0x0831=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0x8310[_0x2a453b];return _0x132f79;};'use strict';var multer=require(_0x0831('0x0'));var util=require(_0x0831('0x1'));var path=require(_0x0831('0x2'));var timeout=require(_0x0831('0x3'));var express=require(_0x0831('0x4'));var router=express[_0x0831('0x5')]();var fs_extra=require(_0x0831('0x6'));var auth=require(_0x0831('0x7'));var interaction=require(_0x0831('0x8'));var config=require(_0x0831('0x9'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x0831('0xa')](),controller[_0x0831('0xb')]);router[_0x0831('0xc')](_0x0831('0xd'),auth[_0x0831('0xa')](),controller[_0x0831('0xe')]);router[_0x0831('0xc')](_0x0831('0xf'),auth[_0x0831('0xa')](),controller[_0x0831('0x10')]);router[_0x0831('0x11')]('/',auth['isAuthenticated'](),controller[_0x0831('0x12')]);router[_0x0831('0x13')](_0x0831('0xf'),auth[_0x0831('0xa')](),controller[_0x0831('0x14')]);router[_0x0831('0x15')](_0x0831('0xf'),auth[_0x0831('0xa')](),controller[_0x0831('0x16')]);module[_0x0831('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 281407c..5b240d5 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 _0x50ab=['timeout','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x12e140,_0x2fa70d){var _0x33f9c3=function(_0x146117){while(--_0x146117){_0x12e140['push'](_0x12e140['shift']());}};_0x33f9c3(++_0x2fa70d);}(_0x50ab,0x19f));var _0xb50a=function(_0x53b0f8,_0x459130){_0x53b0f8=_0x53b0f8-0x0;var _0x133415=_0x50ab[_0x53b0f8];return _0x133415;};'use strict';var Sequelize=require(_0xb50a('0x0'));module[_0xb50a('0x1')]={'name':{'type':Sequelize[_0xb50a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb50a('0x3')](_0xb50a('0x4'),_0xb50a('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb50a('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x466d=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x229103,_0x2813cb){var _0x1eb67d=function(_0x5efed9){while(--_0x5efed9){_0x229103['push'](_0x229103['shift']());}};_0x1eb67d(++_0x2813cb);}(_0x466d,0x80));var _0xd466=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x466d[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0xd466('0x0'));module[_0xd466('0x1')]={'name':{'type':Sequelize[_0xd466('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd466('0x3')](_0xd466('0x4'),_0xd466('0x5')),'defaultValue':_0xd466('0x4')},'selector':{'type':Sequelize[_0xd466('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 d620bfa..52b904c 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 _0xac9d=['destroy','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x26c8de,_0x6961c){var _0x4eafec=function(_0x3eb910){while(--_0x3eb910){_0x26c8de['push'](_0x26c8de['shift']());}};_0x4eafec(++_0x6961c);}(_0xac9d,0x14d));var _0xdac9=function(_0xb0ed0c,_0x1a1fb1){_0xb0ed0c=_0xb0ed0c-0x0;var _0x5d5356=_0xac9d[_0xb0ed0c];return _0x5d5356;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={'raw':!![],'where':{'id':_0x170afd[_0xdac9('0x2d')]['id']}},_0x3eed7a={};_0x3eed7a[_0xdac9('0x2e')]=_[_0xdac9('0x2f')](db[_0xdac9('0x30')][_0xdac9('0x31')]);_0x3eed7a[_0xdac9('0x32')]=_[_0xdac9('0x2f')](_0x170afd[_0xdac9('0x32')]);_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_0x3eed7a[_0xdac9('0x2e')],_0x3eed7a[_0xdac9('0x32')]);_0x4c4e21[_0xdac9('0x35')]=_[_0xdac9('0x34')](_0x3eed7a[_0xdac9('0x2e')],qs[_0xdac9('0x36')](_0x170afd[_0xdac9('0x32')][_0xdac9('0x36')]));_0x4c4e21[_0xdac9('0x35')]=_0x4c4e21[_0xdac9('0x35')]['length']?_0x4c4e21['attributes']:_0x3eed7a[_0xdac9('0x2e')];if(_0x170afd[_0xdac9('0x32')][_0xdac9('0x37')]){_0x4c4e21[_0xdac9('0x38')]=[{'all':!![]}];}_0x4c4e21=_[_0xdac9('0x39')]({},_0x4c4e21,_0x170afd['options']);return db[_0xdac9('0x30')]['find'](_0x4c4e21)[_0xdac9('0x26')](handleEntityNotFound(_0x4fe3bd,null))[_0xdac9('0x26')](respondWithResult(_0x4fe3bd,null))['catch'](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x3a')]=function(_0x5222f8,_0x52d758){return db[_0xdac9('0x30')][_0xdac9('0x3a')](_0x5222f8[_0xdac9('0x3b')],{})[_0xdac9('0x26')](respondWithResult(_0x52d758,0xc9))[_0xdac9('0x3c')](handleError(_0x52d758,null));};exports[_0xdac9('0x25')]=function(_0x51cde6,_0x265975){if(_0x51cde6[_0xdac9('0x3b')]['id']){delete _0x51cde6['body']['id'];}return db[_0xdac9('0x30')][_0xdac9('0x3d')]({'where':{'id':_0x51cde6[_0xdac9('0x2d')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x265975,null))[_0xdac9('0x26')](saveUpdates(_0x51cde6[_0xdac9('0x3b')],null))[_0xdac9('0x26')](respondWithResult(_0x265975,null))['catch'](handleError(_0x265975,null));};exports[_0xdac9('0x27')]=function(_0x2f9f10,_0x238769){return db['ChatProactiveAction'][_0xdac9('0x3d')]({'where':{'id':_0x2f9f10[_0xdac9('0x2d')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x238769,null))[_0xdac9('0x26')](removeEntity(_0x238769,null))['catch'](handleError(_0x238769,null));}; \ No newline at end of file +var _0x0fcd=['body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0fcd,0x129));var _0xd0fc=function(_0x41b975,_0x3d52a8){_0x41b975=_0x41b975-0x0;var _0x37d28c=_0x0fcd[_0x41b975];return _0x37d28c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0fc('0x0'));var zipdir=require(_0xd0fc('0x1'));var jsonpatch=require(_0xd0fc('0x2'));var rp=require(_0xd0fc('0x3'));var moment=require(_0xd0fc('0x4'));var BPromise=require(_0xd0fc('0x5'));var Mustache=require('mustache');var util=require(_0xd0fc('0x6'));var path=require(_0xd0fc('0x7'));var sox=require(_0xd0fc('0x8'));var csv=require(_0xd0fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0fc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd0fc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd0fc('0xc'));var toCsv=require(_0xd0fc('0x9'));var querystring=require(_0xd0fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xd0fc('0xe'));var authService=require(_0xd0fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0fc('0x10'));var logger=require(_0xd0fc('0x11'))(_0xd0fc('0x12'));var utils=require('../../config/utils');var config=require(_0xd0fc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0fc('0x14'))['db'];function respondWithStatusCode(_0xe6df1f,_0x478b90){_0x478b90=_0x478b90||0xcc;return function(_0x2ccc68){if(_0x2ccc68){return _0xe6df1f[_0xd0fc('0x15')](_0x478b90);}return _0xe6df1f[_0xd0fc('0x16')](_0x478b90)['end']();};}function respondWithResult(_0x2f5405,_0x3f2e1f){_0x3f2e1f=_0x3f2e1f||0xc8;return function(_0x34492c){if(_0x34492c){return _0x2f5405['status'](_0x3f2e1f)['json'](_0x34492c);}};}function respondWithFilteredResult(_0x3f7fde,_0xd4f6a1){return function(_0x4304b0){if(_0x4304b0){var _0x4f7fe1=typeof _0xd4f6a1['offset']==='undefined'&&typeof _0xd4f6a1['limit']===_0xd0fc('0x17');var _0x4ced92=_0x4304b0[_0xd0fc('0x18')];var _0x5703f1=_0x4f7fe1?0x0:_0xd4f6a1[_0xd0fc('0x19')];var _0x20849d=_0x4f7fe1?_0x4304b0[_0xd0fc('0x18')]:_0xd4f6a1['offset']+_0xd4f6a1['limit'];var _0x53ac93;if(_0x20849d>=_0x4ced92){_0x20849d=_0x4ced92;_0x53ac93=0xc8;}else{_0x53ac93=0xce;}_0x3f7fde['status'](_0x53ac93);return _0x3f7fde[_0xd0fc('0x1a')](_0xd0fc('0x1b'),_0x5703f1+'-'+_0x20849d+'/'+_0x4ced92)[_0xd0fc('0x1c')](_0x4304b0);}return null;};}function patchUpdates(_0xb5c2fc){return function(_0x43d092){try{jsonpatch[_0xd0fc('0x1d')](_0x43d092,_0xb5c2fc,!![]);}catch(_0x10e8bd){return BPromise['reject'](_0x10e8bd);}return _0x43d092[_0xd0fc('0x1e')]();};}function saveUpdates(_0x25eb91,_0x4e914c){return function(_0x57d302){if(_0x57d302){return _0x57d302[_0xd0fc('0x1f')](_0x25eb91)[_0xd0fc('0x20')](function(_0x3b5491){return _0x3b5491;});}return null;};}function removeEntity(_0x2633f0,_0x1cdb25){return function(_0x3c24ae){if(_0x3c24ae){return _0x3c24ae[_0xd0fc('0x21')]()[_0xd0fc('0x20')](function(){_0x2633f0[_0xd0fc('0x16')](0xcc)[_0xd0fc('0x22')]();});}};}function handleEntityNotFound(_0x57d598,_0x305e0f){return function(_0x380635){if(!_0x380635){_0x57d598[_0xd0fc('0x15')](0x194);}return _0x380635;};}function handleError(_0x1af5a7,_0x3ebaad){_0x3ebaad=_0x3ebaad||0x1f4;return function(_0x94cbd){logger[_0xd0fc('0x23')](_0x94cbd[_0xd0fc('0x24')]);if(_0x94cbd[_0xd0fc('0x25')]){delete _0x94cbd[_0xd0fc('0x25')];}_0x1af5a7[_0xd0fc('0x16')](_0x3ebaad)[_0xd0fc('0x26')](_0x94cbd);};}exports[_0xd0fc('0x27')]=function(_0x739792,_0x2fcd27){var _0x758d5d={'raw':!![],'where':{'id':_0x739792[_0xd0fc('0x28')]['id']}},_0x131fdc={};_0x131fdc[_0xd0fc('0x29')]=_[_0xd0fc('0x2a')](db['ChatProactiveAction'][_0xd0fc('0x2b')]);_0x131fdc[_0xd0fc('0x2c')]=_[_0xd0fc('0x2a')](_0x739792[_0xd0fc('0x2c')]);_0x131fdc[_0xd0fc('0x2d')]=_[_0xd0fc('0x2e')](_0x131fdc[_0xd0fc('0x29')],_0x131fdc['query']);_0x758d5d[_0xd0fc('0x2f')]=_[_0xd0fc('0x2e')](_0x131fdc['model'],qs['fields'](_0x739792[_0xd0fc('0x2c')][_0xd0fc('0x30')]));_0x758d5d[_0xd0fc('0x2f')]=_0x758d5d[_0xd0fc('0x2f')][_0xd0fc('0x31')]?_0x758d5d['attributes']:_0x131fdc[_0xd0fc('0x29')];if(_0x739792[_0xd0fc('0x2c')][_0xd0fc('0x32')]){_0x758d5d[_0xd0fc('0x33')]=[{'all':!![]}];}_0x758d5d=_[_0xd0fc('0x34')]({},_0x758d5d,_0x739792[_0xd0fc('0x35')]);return db[_0xd0fc('0x36')][_0xd0fc('0x37')](_0x758d5d)['then'](handleEntityNotFound(_0x2fcd27,null))[_0xd0fc('0x20')](respondWithResult(_0x2fcd27,null))['catch'](handleError(_0x2fcd27,null));};exports['create']=function(_0x4fef30,_0x52dbdf){return db[_0xd0fc('0x36')][_0xd0fc('0x38')](_0x4fef30[_0xd0fc('0x39')],{})[_0xd0fc('0x20')](respondWithResult(_0x52dbdf,0xc9))[_0xd0fc('0x3a')](handleError(_0x52dbdf,null));};exports[_0xd0fc('0x1f')]=function(_0x1ab05e,_0x3eb0e0){if(_0x1ab05e[_0xd0fc('0x39')]['id']){delete _0x1ab05e['body']['id'];}return db[_0xd0fc('0x36')]['find']({'where':{'id':_0x1ab05e['params']['id']}})[_0xd0fc('0x20')](handleEntityNotFound(_0x3eb0e0,null))[_0xd0fc('0x20')](saveUpdates(_0x1ab05e['body'],null))[_0xd0fc('0x20')](respondWithResult(_0x3eb0e0,null))[_0xd0fc('0x3a')](handleError(_0x3eb0e0,null));};exports[_0xd0fc('0x21')]=function(_0x143bd3,_0x2d3834){return db[_0xd0fc('0x36')][_0xd0fc('0x37')]({'where':{'id':_0x143bd3[_0xd0fc('0x28')]['id']}})[_0xd0fc('0x20')](handleEntityNotFound(_0x2d3834,null))[_0xd0fc('0x20')](removeEntity(_0x2d3834,null))[_0xd0fc('0x3a')](handleError(_0x2d3834,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 9afc1e8..0b333c9 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 _0xef5a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_proactive_actions','util','../../config/logger','api','moment'];(function(_0x87b218,_0x254d1f){var _0x21c59b=function(_0x1504ec){while(--_0x1504ec){_0x87b218['push'](_0x87b218['shift']());}};_0x21c59b(++_0x254d1f);}(_0xef5a,0x11a));var _0xaef5=function(_0x4a9433,_0x5337cb){_0x4a9433=_0x4a9433-0x0;var _0x434947=_0xef5a[_0x4a9433];return _0x434947;};'use strict';var _=require('lodash');var util=require(_0xaef5('0x0'));var logger=require(_0xaef5('0x1'))(_0xaef5('0x2'));var moment=require(_0xaef5('0x3'));var BPromise=require(_0xaef5('0x4'));var rp=require(_0xaef5('0x5'));var fs=require('fs');var path=require(_0xaef5('0x6'));var rimraf=require(_0xaef5('0x7'));var config=require(_0xaef5('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xaef5('0x9')]=function(_0x1047c2,_0xbbfbe5){return _0x1047c2['define']('ChatProactiveAction',attributes,{'tableName':_0xaef5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a8c=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x21e1e5,_0x5e4810){var _0x1d0582=function(_0x5a6769){while(--_0x5a6769){_0x21e1e5['push'](_0x21e1e5['shift']());}};_0x1d0582(++_0x5e4810);}(_0x8a8c,0xed));var _0xc8a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a8c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a8('0x0'));var util=require(_0xc8a8('0x1'));var logger=require(_0xc8a8('0x2'))(_0xc8a8('0x3'));var moment=require(_0xc8a8('0x4'));var BPromise=require(_0xc8a8('0x5'));var rp=require(_0xc8a8('0x6'));var fs=require('fs');var path=require(_0xc8a8('0x7'));var rimraf=require(_0xc8a8('0x8'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xc8a8('0x9')]=function(_0x3d9d32,_0x58805b){return _0x3d9d32[_0xc8a8('0xa')](_0xc8a8('0xb'),attributes,{'tableName':_0xc8a8('0xc'),'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 ca1d7a7..81467ed 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 _0xe790=['code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x4ee6e4,_0x492c03){var _0x4ff1d8=function(_0x46f8ec){while(--_0x46f8ec){_0x4ee6e4['push'](_0x4ee6e4['shift']());}};_0x4ff1d8(++_0x492c03);}(_0xe790,0x90));var _0x0e79=function(_0x44cc5c,_0x2ab75c){_0x44cc5c=_0x44cc5c-0x0;var _0xc9061=_0xe790[_0x44cc5c];return _0xc9061;};'use strict';var _=require('lodash');var util=require(_0x0e79('0x0'));var moment=require(_0x0e79('0x1'));var BPromise=require(_0x0e79('0x2'));var rs=require(_0x0e79('0x3'));var fs=require('fs');var Redis=require(_0x0e79('0x4'));var db=require(_0x0e79('0x5'))['db'];var utils=require(_0x0e79('0x6'));var logger=require(_0x0e79('0x7'))('rpc');var config=require(_0x0e79('0x8'));var jayson=require(_0x0e79('0x9'));var client=jayson['client'][_0x0e79('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a7e30,_0x3c2e12,_0x5c3314){return new BPromise(function(_0x4e399a,_0x5a37a7){return client[_0x0e79('0xb')](_0x3a7e30,_0x5c3314)['then'](function(_0xc25700){logger[_0x0e79('0xc')](_0x0e79('0xd'),_0x3c2e12,_0x0e79('0xe'));logger['debug'](_0x0e79('0xf'),_0x3c2e12,'request\x20sent',JSON['stringify'](_0xc25700));if(_0xc25700['error']){if(_0xc25700['error'][_0x0e79('0x10')]===0x1f4){logger[_0x0e79('0x11')](_0x0e79('0xd'),_0x3c2e12,_0xc25700['error'][_0x0e79('0x12')]);return _0x5a37a7(_0xc25700[_0x0e79('0x11')][_0x0e79('0x12')]);}logger['error'](_0x0e79('0xd'),_0x3c2e12,_0xc25700['error']['message']);return _0x4e399a(_0xc25700[_0x0e79('0x11')][_0x0e79('0x12')]);}else{logger[_0x0e79('0xc')](_0x0e79('0xd'),_0x3c2e12,'request\x20sent');_0x4e399a(_0xc25700[_0x0e79('0x13')][_0x0e79('0x12')]);}})['catch'](function(_0x112ca8){logger[_0x0e79('0x11')](_0x0e79('0xd'),_0x3c2e12,_0x112ca8);_0x5a37a7(_0x112ca8);});});} \ No newline at end of file +var _0x6ece=['info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5d4818,_0x3ccae2){var _0x578a9c=function(_0x530284){while(--_0x530284){_0x5d4818['push'](_0x5d4818['shift']());}};_0x578a9c(++_0x3ccae2);}(_0x6ece,0x8f));var _0xe6ec=function(_0x5810b0,_0x4c4ba2){_0x5810b0=_0x5810b0-0x0;var _0x50ee55=_0x6ece[_0x5810b0];return _0x50ee55;};'use strict';var _=require(_0xe6ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe6ec('0x1'));var fs=require('fs');var Redis=require(_0xe6ec('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe6ec('0x3'));var jayson=require(_0xe6ec('0x4'));var client=jayson[_0xe6ec('0x5')][_0xe6ec('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x53fdc9,_0x3e61c0,_0x35fa77){return new BPromise(function(_0x5a69d4,_0x51b6af){return client[_0xe6ec('0x7')](_0x53fdc9,_0x35fa77)[_0xe6ec('0x8')](function(_0x2bfd7b){logger[_0xe6ec('0x9')](_0xe6ec('0xa'),_0x3e61c0,'request\x20sent');logger['debug'](_0xe6ec('0xb'),_0x3e61c0,'request\x20sent',JSON[_0xe6ec('0xc')](_0x2bfd7b));if(_0x2bfd7b[_0xe6ec('0xd')]){if(_0x2bfd7b[_0xe6ec('0xd')][_0xe6ec('0xe')]===0x1f4){logger['error'](_0xe6ec('0xa'),_0x3e61c0,_0x2bfd7b[_0xe6ec('0xd')]['message']);return _0x51b6af(_0x2bfd7b[_0xe6ec('0xd')][_0xe6ec('0xf')]);}logger[_0xe6ec('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3e61c0,_0x2bfd7b['error'][_0xe6ec('0xf')]);return _0x5a69d4(_0x2bfd7b['error'][_0xe6ec('0xf')]);}else{logger['info'](_0xe6ec('0xa'),_0x3e61c0,_0xe6ec('0x10'));_0x5a69d4(_0x2bfd7b[_0xe6ec('0x11')][_0xe6ec('0xf')]);}})[_0xe6ec('0x12')](function(_0x154892){logger[_0xe6ec('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3e61c0,_0x154892);_0x51b6af(_0x154892);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6041ca0..2b7b47d 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 _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x56e9e0,_0x4c693f){var _0x319b3c=function(_0x4beb5e){while(--_0x4beb5e){_0x56e9e0['push'](_0x56e9e0['shift']());}};_0x319b3c(++_0x4c693f);}(_0xee14,0x13a));var _0x4ee1=function(_0x416b39,_0x1add02){_0x416b39=_0x416b39-0x0;var _0x20e95c=_0xee14[_0x416b39];return _0x20e95c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('0x12')]=router; \ No newline at end of file +var _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x50d77f,_0x1a76da){var _0x477ae3=function(_0x358ee2){while(--_0x358ee2){_0x50d77f['push'](_0x50d77f['shift']());}};_0x477ae3(++_0x1a76da);}(_0xeda8,0x104));var _0x8eda=function(_0x267c8e,_0x3f31b8){_0x267c8e=_0x267c8e-0x0;var _0x446e27=_0xeda8[_0x267c8e];return _0x446e27;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 64887c6..7fd50f2 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 _0x8d6e=['beepall','roundrobin','STRING','rrmemory'];(function(_0x356b5b,_0x148ff3){var _0x26f888=function(_0x32f1c2){while(--_0x32f1c2){_0x356b5b['push'](_0x356b5b['shift']());}};_0x26f888(++_0x148ff3);}(_0x8d6e,0x7e));var _0xe8d6=function(_0x7fc203,_0x4b525e){_0x7fc203=_0x7fc203-0x0;var _0xe1c223=_0x8d6e[_0x7fc203];return _0xe1c223;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe8d6('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe8d6('0x1'),_0xe8d6('0x2'),_0xe8d6('0x3'))}}; \ No newline at end of file +var _0xde54=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xde54,0x12e));var _0x4de5=function(_0x3b52eb,_0x4e6484){_0x3b52eb=_0x3b52eb-0x0;var _0x21ca76=_0xde54[_0x3b52eb];return _0x21ca76;};'use strict';var Sequelize=require(_0x4de5('0x0'));module[_0x4de5('0x1')]={'name':{'type':Sequelize[_0x4de5('0x2')],'unique':_0x4de5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4de5('0x2')]},'timeout':{'type':Sequelize[_0x4de5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4de5('0x5'),_0x4de5('0x6'),_0x4de5('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0852d21..253efcd 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 _0xbf94=['online','voicePause','interface','flatMap','sequelize','transaction','each','userChatQueue:save','removeTeams','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','compact','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','register','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','sendStatus','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','ChatQueue','rows','show','rawAttributes','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','nolimit','ChatQueueId','merge','UserChatQueue','findAll','User','findAndCountAll','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','Agents'];(function(_0x3d78ca,_0xd1826f){var _0x5c4e97=function(_0x18ef38){while(--_0x18ef38){_0x3d78ca['push'](_0x3d78ca['shift']());}};_0x5c4e97(++_0xd1826f);}(_0xbf94,0xb7));var _0x4bf9=function(_0x49cb53,_0x45fd70){_0x49cb53=_0x49cb53-0x0;var _0xa326a7=_0xbf94[_0x49cb53];return _0xa326a7;};'use strict';var emlformat=require(_0x4bf9('0x0'));var rimraf=require(_0x4bf9('0x1'));var zipdir=require(_0x4bf9('0x2'));var jsonpatch=require(_0x4bf9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4bf9('0x4'));var util=require(_0x4bf9('0x5'));var path=require(_0x4bf9('0x6'));var sox=require(_0x4bf9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bf9('0x8'));var _=require(_0x4bf9('0x9'));var squel=require(_0x4bf9('0xa'));var crypto=require('crypto');var jsforce=require(_0x4bf9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4bf9('0xc'));var querystring=require('querystring');var Papa=require(_0x4bf9('0xd'));var Redis=require(_0x4bf9('0xe'));var authService=require(_0x4bf9('0xf'));var qs=require(_0x4bf9('0x10'));var as=require(_0x4bf9('0x11'));var hardwareService=require(_0x4bf9('0x12'));var logger=require(_0x4bf9('0x13'))(_0x4bf9('0x14'));var utils=require('../../config/utils');var config=require(_0x4bf9('0x15'));var licenseUtil=require(_0x4bf9('0x16'));var db=require(_0x4bf9('0x17'))['db'];config['redis']=_[_0x4bf9('0x18')](config[_0x4bf9('0x19')],{'host':_0x4bf9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4bf9('0x1b'))[_0x4bf9('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4bf9('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f0964,_0xa9f26d,_0x1e6b3e,_0x263521){return new BPromise(function(_0x24b673,_0x5d0364){var _0x5a5508=_0x263521||client;return _0x5a5508['request'](_0x3f0964,_0x1e6b3e)[_0x4bf9('0x1e')](function(_0x115fc2){logger['info'](_0x4bf9('0x1f'),_0xa9f26d,_0x4bf9('0x20'));logger[_0x4bf9('0x21')](_0x4bf9('0x22'),_0xa9f26d,_0x4bf9('0x20'),JSON[_0x4bf9('0x23')](_0x115fc2));if(_0x115fc2[_0x4bf9('0x24')]){if(_0x115fc2['error']['code']===0x1f4){logger[_0x4bf9('0x24')](_0x4bf9('0x1f'),_0xa9f26d,_0x115fc2[_0x4bf9('0x24')]['message']);return _0x5d0364(_0x115fc2[_0x4bf9('0x24')][_0x4bf9('0x25')]);}logger['error'](_0x4bf9('0x1f'),_0xa9f26d,_0x115fc2[_0x4bf9('0x24')]['message']);return _0x24b673(_0x115fc2['error'][_0x4bf9('0x25')]);}else{logger[_0x4bf9('0x26')](_0x4bf9('0x1f'),_0xa9f26d,'request\x20sent');_0x24b673(_0x115fc2[_0x4bf9('0x27')][_0x4bf9('0x25')]);}})[_0x4bf9('0x28')](function(_0x1cc08f){logger[_0x4bf9('0x24')](_0x4bf9('0x1f'),_0xa9f26d,_0x1cc08f);_0x5d0364(_0x1cc08f);});});}function respondWithStatusCode(_0x203db3,_0x1b3547){_0x1b3547=_0x1b3547||0xcc;return function(_0x31cedb){if(_0x31cedb){return _0x203db3['sendStatus'](_0x1b3547);}return _0x203db3[_0x4bf9('0x29')](_0x1b3547)[_0x4bf9('0x2a')]();};}function respondWithResult(_0x25875b,_0x29ee7b){_0x29ee7b=_0x29ee7b||0xc8;return function(_0x7d5718){if(_0x7d5718){return _0x25875b[_0x4bf9('0x29')](_0x29ee7b)['json'](_0x7d5718);}};}function respondWithFilteredResult(_0x2657f4,_0x3e2ba8){return function(_0x21df76){if(_0x21df76){var _0xf870a0=typeof _0x3e2ba8[_0x4bf9('0x2b')]===_0x4bf9('0x2c')&&typeof _0x3e2ba8[_0x4bf9('0x2d')]===_0x4bf9('0x2c');var _0x1ad8ce=_0x21df76[_0x4bf9('0x2e')];var _0x1222be=_0xf870a0?0x0:_0x3e2ba8[_0x4bf9('0x2b')];var _0x4e1004=_0xf870a0?_0x21df76[_0x4bf9('0x2e')]:_0x3e2ba8['offset']+_0x3e2ba8[_0x4bf9('0x2d')];var _0x48fcee;if(_0x4e1004>=_0x1ad8ce){_0x4e1004=_0x1ad8ce;_0x48fcee=0xc8;}else{_0x48fcee=0xce;}_0x2657f4[_0x4bf9('0x29')](_0x48fcee);return _0x2657f4[_0x4bf9('0x2f')](_0x4bf9('0x30'),_0x1222be+'-'+_0x4e1004+'/'+_0x1ad8ce)[_0x4bf9('0x31')](_0x21df76);}return null;};}function patchUpdates(_0x4fba7e){return function(_0x1e2fab){try{jsonpatch[_0x4bf9('0x32')](_0x1e2fab,_0x4fba7e,!![]);}catch(_0xfea041){return BPromise[_0x4bf9('0x33')](_0xfea041);}return _0x1e2fab[_0x4bf9('0x34')]();};}function saveUpdates(_0x2a176d,_0x4857b7){return function(_0x1b16f4){if(_0x1b16f4){return _0x1b16f4['update'](_0x2a176d)[_0x4bf9('0x1e')](function(_0x43c89b){return _0x43c89b;});}return null;};}function removeEntity(_0x305653,_0x39dcae){return function(_0x37c747){if(_0x37c747){return _0x37c747[_0x4bf9('0x35')]()[_0x4bf9('0x1e')](function(){var _0x4c6164=_0x37c747[_0x4bf9('0x36')]({'plain':!![]});var _0x2b51d3='ChatQueues';return db[_0x4bf9('0x37')]['destroy']({'where':{'type':_0x2b51d3,'resourceId':_0x4c6164['id']}})[_0x4bf9('0x1e')](function(){return _0x37c747;});})[_0x4bf9('0x1e')](function(){_0x305653[_0x4bf9('0x29')](0xcc)[_0x4bf9('0x2a')]();});}};}function handleEntityNotFound(_0x471842,_0xffc1ae){return function(_0x31a887){if(!_0x31a887){_0x471842[_0x4bf9('0x38')](0x194);}return _0x31a887;};}function handleError(_0x38a2da,_0x446164){_0x446164=_0x446164||0x1f4;return function(_0x49d4b9){logger['error'](_0x49d4b9[_0x4bf9('0x39')]);if(_0x49d4b9[_0x4bf9('0x3a')]){delete _0x49d4b9[_0x4bf9('0x3a')];}_0x38a2da[_0x4bf9('0x29')](_0x446164)['send'](_0x49d4b9);};}exports[_0x4bf9('0x3b')]=function(_0x5edb85,_0x210e10){var _0x358dd0={},_0x21039b={},_0x2c9b8c={'count':0x0,'rows':[]};var _0x1870e2=_[_0x4bf9('0x3c')](db['ChatQueue']['rawAttributes'],function(_0x3ce9f9){return{'name':_0x3ce9f9[_0x4bf9('0x3d')],'type':_0x3ce9f9[_0x4bf9('0x3e')][_0x4bf9('0x3f')]};});_0x21039b[_0x4bf9('0x40')]=_[_0x4bf9('0x3c')](_0x1870e2,_0x4bf9('0x3a'));_0x21039b[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x5edb85[_0x4bf9('0x41')]);_0x21039b[_0x4bf9('0x43')]=_[_0x4bf9('0x44')](_0x21039b[_0x4bf9('0x40')],_0x21039b[_0x4bf9('0x41')]);_0x358dd0[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x21039b[_0x4bf9('0x40')],qs[_0x4bf9('0x46')](_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x46')]));_0x358dd0['attributes']=_0x358dd0[_0x4bf9('0x45')]['length']?_0x358dd0[_0x4bf9('0x45')]:_0x21039b['model'];if(!_0x5edb85['query'][_0x4bf9('0x47')]('nolimit')){_0x358dd0[_0x4bf9('0x2d')]=qs[_0x4bf9('0x2d')](_0x5edb85['query'][_0x4bf9('0x2d')]);_0x358dd0[_0x4bf9('0x2b')]=qs[_0x4bf9('0x2b')](_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x2b')]);}_0x358dd0[_0x4bf9('0x48')]=qs[_0x4bf9('0x49')](_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x49')]);_0x358dd0[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x5edb85[_0x4bf9('0x41')],_0x21039b[_0x4bf9('0x43')]),_0x1870e2);if(_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x4c')]){_0x358dd0['where']=_['merge'](_0x358dd0['where'],{'$or':_[_0x4bf9('0x3c')](_0x1870e2,function(_0x44f180){if(_0x44f180['type']!=='VIRTUAL'){var _0x577d8a={};_0x577d8a[_0x44f180[_0x4bf9('0x3a')]]={'$like':'%'+_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x4c')]+'%'};return _0x577d8a;}})});}_0x358dd0=_['merge']({},_0x358dd0,_0x5edb85[_0x4bf9('0x4d')]);var _0x529952={'where':_0x358dd0[_0x4bf9('0x4a')]};return db['ChatQueue'][_0x4bf9('0x2e')](_0x529952)[_0x4bf9('0x1e')](function(_0x5e88c0){_0x2c9b8c['count']=_0x5e88c0;if(_0x5edb85[_0x4bf9('0x41')][_0x4bf9('0x4e')]){_0x358dd0['include']=[{'all':!![]}];}return db[_0x4bf9('0x4f')]['findAll'](_0x358dd0);})[_0x4bf9('0x1e')](function(_0x1fc10a){_0x2c9b8c[_0x4bf9('0x50')]=_0x1fc10a;return _0x2c9b8c;})[_0x4bf9('0x1e')](respondWithFilteredResult(_0x210e10,_0x358dd0))[_0x4bf9('0x28')](handleError(_0x210e10,null));};exports[_0x4bf9('0x51')]=function(_0x2178e5,_0x2793ea){var _0x50e22e={'raw':!![],'where':{'id':_0x2178e5['params']['id']}},_0x19a48={};_0x19a48[_0x4bf9('0x40')]=_[_0x4bf9('0x42')](db[_0x4bf9('0x4f')][_0x4bf9('0x52')]);_0x19a48[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x2178e5[_0x4bf9('0x41')]);_0x19a48[_0x4bf9('0x43')]=_[_0x4bf9('0x44')](_0x19a48[_0x4bf9('0x40')],_0x19a48[_0x4bf9('0x41')]);_0x50e22e[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x19a48[_0x4bf9('0x40')],qs[_0x4bf9('0x46')](_0x2178e5[_0x4bf9('0x41')]['fields']));_0x50e22e['attributes']=_0x50e22e[_0x4bf9('0x45')][_0x4bf9('0x53')]?_0x50e22e[_0x4bf9('0x45')]:_0x19a48['model'];if(_0x2178e5[_0x4bf9('0x41')]['includeAll']){_0x50e22e[_0x4bf9('0x54')]=[{'all':!![]}];}_0x50e22e=_['merge']({},_0x50e22e,_0x2178e5['options']);return db['ChatQueue'][_0x4bf9('0x55')](_0x50e22e)[_0x4bf9('0x1e')](handleEntityNotFound(_0x2793ea,null))[_0x4bf9('0x1e')](respondWithResult(_0x2793ea,null))[_0x4bf9('0x28')](handleError(_0x2793ea,null));};exports[_0x4bf9('0x56')]=function(_0x23ced9,_0x1ff87e){return db[_0x4bf9('0x4f')][_0x4bf9('0x56')](_0x23ced9[_0x4bf9('0x57')],{})['then'](function(_0x47a15d){var _0x7f0977=_0x23ced9[_0x4bf9('0x58')][_0x4bf9('0x36')]({'plain':!![]});if(!_0x7f0977)throw new Error(_0x4bf9('0x59'));if(_0x7f0977[_0x4bf9('0x5a')]==='user'){var _0x2d6102=_0x47a15d['get']({'plain':!![]});var _0xf80ee6='ChatQueues';return db['UserProfileSection'][_0x4bf9('0x55')]({'where':{'name':_0xf80ee6,'userProfileId':_0x7f0977[_0x4bf9('0x5b')]},'raw':!![]})[_0x4bf9('0x1e')](function(_0x36d0af){if(_0x36d0af&&_0x36d0af[_0x4bf9('0x5c')]===0x0){return db[_0x4bf9('0x37')][_0x4bf9('0x56')]({'name':_0x2d6102['name'],'resourceId':_0x2d6102['id'],'type':_0x36d0af[_0x4bf9('0x3a')],'sectionId':_0x36d0af['id']},{})['then'](function(){return _0x47a15d;});}else{return _0x47a15d;}})[_0x4bf9('0x28')](function(_0x2ec935){logger[_0x4bf9('0x24')](_0x4bf9('0x5d'),_0x2ec935);throw _0x2ec935;});}return _0x47a15d;})[_0x4bf9('0x1e')](respondWithResult(_0x1ff87e,0xc9))[_0x4bf9('0x28')](handleError(_0x1ff87e,null));};exports[_0x4bf9('0x5e')]=function(_0x362ea9,_0x3510d7){if(_0x362ea9[_0x4bf9('0x57')]['id']){delete _0x362ea9[_0x4bf9('0x57')]['id'];}return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x362ea9[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x3510d7,null))['then'](saveUpdates(_0x362ea9[_0x4bf9('0x57')],null))[_0x4bf9('0x1e')](respondWithResult(_0x3510d7,null))['catch'](handleError(_0x3510d7,null));};exports[_0x4bf9('0x35')]=function(_0x183448,_0x55ffa7){return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x183448[_0x4bf9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x55ffa7,null))[_0x4bf9('0x1e')](removeEntity(_0x55ffa7,null))[_0x4bf9('0x28')](handleError(_0x55ffa7,null));};exports[_0x4bf9('0x60')]=function(_0x2f8aac,_0x2eb376){return db[_0x4bf9('0x4f')][_0x4bf9('0x60')]()[_0x4bf9('0x1e')](respondWithResult(_0x2eb376,null))['catch'](handleError(_0x2eb376,null));};exports[_0x4bf9('0x61')]=function(_0x390789,_0x4c158a,_0x346445){var _0xe63f6b={'raw':!![],'where':{}},_0x3fbe62={},_0x2ea187;return db[_0x4bf9('0x4f')][_0x4bf9('0x62')]({'where':{'id':_0x390789[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x4c158a,null))[_0x4bf9('0x1e')](function(_0x2891b0){if(_0x2891b0){_0x2ea187=_0x2891b0[_0x4bf9('0x36')]({'plain':!![]});_0x3fbe62['model']=_[_0x4bf9('0x42')](db['UserChatQueue'][_0x4bf9('0x52')]);_0x3fbe62[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x390789[_0x4bf9('0x41')]);_0x3fbe62[_0x4bf9('0x43')]=_['intersection'](_0x3fbe62[_0x4bf9('0x40')],_0x3fbe62[_0x4bf9('0x41')]);_0xe63f6b[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x3fbe62[_0x4bf9('0x40')],qs['fields'](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x46')]));_0xe63f6b['attributes']=_0xe63f6b[_0x4bf9('0x45')][_0x4bf9('0x53')]?_0xe63f6b['attributes']:_0x3fbe62[_0x4bf9('0x40')];if(!_0x390789[_0x4bf9('0x41')]['hasOwnProperty'](_0x4bf9('0x63'))){_0xe63f6b[_0x4bf9('0x2d')]=qs['limit'](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x2d')]);_0xe63f6b[_0x4bf9('0x2b')]=qs[_0x4bf9('0x2b')](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x2b')]);}_0xe63f6b['order']=qs[_0x4bf9('0x49')](_0x390789[_0x4bf9('0x41')][_0x4bf9('0x49')]);_0xe63f6b[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x390789[_0x4bf9('0x41')],_0x3fbe62[_0x4bf9('0x43')]));_0xe63f6b[_0x4bf9('0x4a')][_0x4bf9('0x64')]=_0x2891b0['id'];if(_0x390789['query'][_0x4bf9('0x4c')]){_0xe63f6b[_0x4bf9('0x4a')]=_['merge'](_0xe63f6b[_0x4bf9('0x4a')],{'$or':_[_0x4bf9('0x3c')](_0xe63f6b['attributes'],function(_0x7b3b69){var _0x561180={};_0x561180[_0x7b3b69]={'$like':'%'+_0x390789['query']['filter']+'%'};return _0x561180;})});}_0xe63f6b=_[_0x4bf9('0x65')]({},_0xe63f6b,_0x390789[_0x4bf9('0x4d')]);return db[_0x4bf9('0x66')][_0x4bf9('0x67')](_0xe63f6b);}})[_0x4bf9('0x1e')](function(_0xd32ac){if(_0xd32ac){return db[_0x4bf9('0x68')][_0x4bf9('0x69')]({'where':{'id':_[_0x4bf9('0x3c')](_0xd32ac,'UserId'),'role':'agent'},'attributes':['id',_0x4bf9('0x3a'),_0x4bf9('0x6a'),_0x4bf9('0x6b'),_0x4bf9('0x6c')]});}})[_0x4bf9('0x1e')](function(_0x47efd9){if(_0x47efd9){return{'count':_0x47efd9[_0x4bf9('0x2e')],'rows':_[_0x4bf9('0x3c')](_0x47efd9[_0x4bf9('0x50')],function(_0x1355b2){return{'membername':_0x1355b2['name'],'UserId':_0x1355b2['id'],'queue_name':_0x2ea187[_0x4bf9('0x3a')],'ChatQueueId':_0x2ea187['id'],'interface':util[_0x4bf9('0x6d')](_0x4bf9('0x6e'),'SIP',_0x1355b2['name']),'penalty':0x0,'paused':_0x1355b2[_0x4bf9('0x6a')],'createdAt':_0x1355b2[_0x4bf9('0x6c')],'updatedAt':_0x1355b2[_0x4bf9('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4bf9('0x1e')](respondWithFilteredResult(_0x4c158a,_0xe63f6b))[_0x4bf9('0x28')](handleError(_0x4c158a,null));};exports[_0x4bf9('0x6f')]=function(_0x559a17,_0x4273d8,_0x35ced3){var _0x1c985a={};var _0x1d870b={};var _0x507f03;var _0x294672;return db[_0x4bf9('0x4f')][_0x4bf9('0x62')]({'where':{'id':_0x559a17['params']['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x4273d8,null))[_0x4bf9('0x1e')](function(_0x50e044){if(_0x50e044){_0x507f03=_0x50e044;_0x1d870b[_0x4bf9('0x40')]=_[_0x4bf9('0x42')](db[_0x4bf9('0x70')][_0x4bf9('0x52')]);_0x1d870b['query']=_[_0x4bf9('0x42')](_0x559a17[_0x4bf9('0x41')]);_0x1d870b[_0x4bf9('0x43')]=_[_0x4bf9('0x44')](_0x1d870b[_0x4bf9('0x40')],_0x1d870b[_0x4bf9('0x41')]);_0x1c985a[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x1d870b[_0x4bf9('0x40')],qs[_0x4bf9('0x46')](_0x559a17[_0x4bf9('0x41')]['fields']));_0x1c985a[_0x4bf9('0x45')]=_0x1c985a[_0x4bf9('0x45')]['length']?_0x1c985a[_0x4bf9('0x45')]:_0x1d870b[_0x4bf9('0x40')];_0x1c985a[_0x4bf9('0x48')]=qs[_0x4bf9('0x49')](_0x559a17['query']['sort']);_0x1c985a[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x559a17['query'],_0x1d870b[_0x4bf9('0x43')]));if(_0x559a17[_0x4bf9('0x41')]['filter']){_0x1c985a[_0x4bf9('0x4a')]=_[_0x4bf9('0x65')](_0x1c985a[_0x4bf9('0x4a')],{'$or':_[_0x4bf9('0x3c')](_0x1c985a['attributes'],function(_0x16d12d){var _0x58e715={};_0x58e715[_0x16d12d]={'$like':'%'+_0x559a17[_0x4bf9('0x41')][_0x4bf9('0x4c')]+'%'};return _0x58e715;})});}_0x1c985a=_[_0x4bf9('0x65')]({},_0x1c985a,_0x559a17[_0x4bf9('0x4d')]);return _0x507f03[_0x4bf9('0x6f')](_0x1c985a);}})[_0x4bf9('0x1e')](function(_0x3d3ed0){if(_0x3d3ed0){_0x294672=_0x3d3ed0[_0x4bf9('0x53')];if(!_0x559a17[_0x4bf9('0x41')][_0x4bf9('0x47')](_0x4bf9('0x63'))){_0x1c985a[_0x4bf9('0x2d')]=qs[_0x4bf9('0x2d')](_0x559a17[_0x4bf9('0x41')][_0x4bf9('0x2d')]);_0x1c985a[_0x4bf9('0x2b')]=qs[_0x4bf9('0x2b')](_0x559a17['query'][_0x4bf9('0x2b')]);}return _0x507f03['getTeams'](_0x1c985a);}})[_0x4bf9('0x1e')](function(_0x163214){if(_0x163214){return _0x163214?{'count':_0x294672,'rows':_0x163214}:null;}})['then'](respondWithResult(_0x4273d8,null))[_0x4bf9('0x28')](handleError(_0x4273d8,null));};exports['addTeams']=function(_0x4f8669,_0x3ce567,_0xd18895){var _0x15015a=_0x4f8669[_0x4bf9('0x57')][_0x4bf9('0x71')];return db[_0x4bf9('0x70')][_0x4bf9('0x67')]({'where':{'id':_0x15015a},'attributes':['id'],'include':[{'model':db[_0x4bf9('0x68')],'as':_0x4bf9('0x72'),'attributes':['id',_0x4bf9('0x3a'),_0x4bf9('0x73'),_0x4bf9('0x74'),_0x4bf9('0x75')],'raw':!![]}]})[_0x4bf9('0x1e')](function(_0x2f3526){if(_0x2f3526){var _0x190826=_[_0x4bf9('0x76')](_0x2f3526,function(_0x30e3cc){var _0x2bc391=_0x30e3cc[_0x4bf9('0x36')]({'plain':!![]});return _0x2bc391[_0x4bf9('0x72')];});return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x4f8669[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](function(_0x1705c7){return db[_0x4bf9('0x77')][_0x4bf9('0x78')](function(_0x30c171){return _0x1705c7['addTeams'](_0x15015a,{'transaction':_0x30c171})[_0x4bf9('0x1e')](function(){return BPromise[_0x4bf9('0x79')](_0x190826,function(_0x57ad3c){return db[_0x4bf9('0x66')]['findOrCreate']({'where':{'UserId':_0x57ad3c['id'],'ChatQueueId':_0x4f8669[_0x4bf9('0x5f')]['id']},'transaction':_0x30c171});});})[_0x4bf9('0x1e')](function(){_0x190826['forEach'](function(_0x479604){socket['emit'](_0x4bf9('0x7a'),{'UserId':_0x479604['id'],'ChatQueueId':_0x1705c7['id']});});});});});}})['then'](respondWithStatusCode(_0x3ce567,null))['catch'](handleError(_0x3ce567,null));};exports[_0x4bf9('0x7b')]=function(_0x337b28,_0x5d9314,_0x132ba5){return db[_0x4bf9('0x70')]['findAll']({'where':{'id':_0x337b28[_0x4bf9('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4bf9('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4bf9('0x1e')](handleEntityNotFound(_0x5d9314,null))[_0x4bf9('0x1e')](function(_0x3aab83){var _0x274653=_[_0x4bf9('0x3c')](_0x3aab83,'id');var _0xc1264d=[];var _0x4103ef=[];var _0x49e1a7=squel['select']();_0x49e1a7['field'](_0x4bf9('0x7c'))[_0x4bf9('0x7d')](_0x4bf9('0x7e'),'tq')[_0x4bf9('0x7f')](_0x4bf9('0x80'),'ut',_0x4bf9('0x81'))['where'](_0x4bf9('0x82'),_0x337b28[_0x4bf9('0x5f')]['id']);for(var _0x42625e=0x0;_0x42625e<_0x3aab83[_0x4bf9('0x53')];_0x42625e+=0x1){let _0x15bf3a=_0x3aab83[_0x42625e];for(var _0x3f45df=0x0;_0x3f45df<_0x15bf3a[_0x4bf9('0x72')][_0x4bf9('0x53')];_0x3f45df+=0x1){let _0x3f119a=_0x15bf3a[_0x4bf9('0x72')][_0x3f45df];var _0x5a0f0d=_0x49e1a7[_0x4bf9('0x83')]();_0x5a0f0d['where']('ut.UserId\x20=\x20?',_0x3f119a['id']);_0x4103ef[_0x4bf9('0x84')](db[_0x4bf9('0x77')][_0x4bf9('0x41')](_0x5a0f0d[_0x4bf9('0x85')](),{'type':db[_0x4bf9('0x77')][_0x4bf9('0x86')]['SELECT']})[_0x4bf9('0x1e')](function(_0x1da9a2){if(_0x1da9a2[_0x4bf9('0x53')]===0x1){return _0x3f119a['id'];}else{var _0x3ebfde=_[_0x4bf9('0x87')](_[_0x4bf9('0x3c')](_0x1da9a2,_0x4bf9('0x88')),function(_0xd46b11){return _[_0x4bf9('0x89')](_0x274653,_0xd46b11);});if(_0x3ebfde){return _0x3f119a['id'];}}}));}}return BPromise[_0x4bf9('0x8a')](_0x4103ef)['then'](function(_0xa561b0){_0xc1264d=_(_0xc1264d)['union'](_0xa561b0)[_0x4bf9('0x8b')]()['value']();return db['ChatQueue'][_0x4bf9('0x55')]({'where':{'id':_0x337b28[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](function(_0x1840b9){return db[_0x4bf9('0x77')][_0x4bf9('0x78')](function(_0x2bb799){return _0x1840b9[_0x4bf9('0x7b')](_0x337b28['query'][_0x4bf9('0x71')],{'transaction':_0x2bb799})[_0x4bf9('0x1e')](function(){if(!_[_0x4bf9('0x8c')](_0xc1264d)){return _0x1840b9[_0x4bf9('0x8d')](_0xc1264d,{'transaction':_0x2bb799});}})[_0x4bf9('0x1e')](function(){_0xc1264d[_0x4bf9('0x8e')](function(_0x2ccc3f){socket[_0x4bf9('0x8f')](_0x4bf9('0x90'),{'UserId':_0x2ccc3f,'ChatQueueId':_0x1840b9['id']});});});});});});})[_0x4bf9('0x1e')](respondWithStatusCode(_0x5d9314,null))[_0x4bf9('0x28')](handleError(_0x5d9314,null));};exports['addAgents']=function(_0x4a9705,_0x3cd5c9,_0x238610){return db[_0x4bf9('0x4f')][_0x4bf9('0x55')]({'where':{'id':_0x4a9705[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x3cd5c9,null))['then'](function(_0x5ab8fd){if(_0x5ab8fd){return _0x5ab8fd[_0x4bf9('0x91')](_0x4a9705['body'][_0x4bf9('0x71')],_[_0x4bf9('0x92')](_0x4a9705[_0x4bf9('0x57')],[_0x4bf9('0x71'),'id'])||{})[_0x4bf9('0x93')](function(_0x5a2136){for(var _0x52b074=0x0;_0x52b074<_0x4a9705[_0x4bf9('0x57')][_0x4bf9('0x71')]['length'];_0x52b074+=0x1){socket[_0x4bf9('0x8f')](_0x4bf9('0x7a'),{'UserId':Number(_0x4a9705[_0x4bf9('0x57')][_0x4bf9('0x71')][_0x52b074]),'ChatQueueId':Number(_0x4a9705[_0x4bf9('0x5f')]['id'])});}return _0x5a2136;});}})[_0x4bf9('0x1e')](respondWithResult(_0x3cd5c9,null))[_0x4bf9('0x28')](handleError(_0x3cd5c9,null));};exports[_0x4bf9('0x8d')]=function(_0x45fbed,_0x55a3f4,_0x423616){return db['ChatQueue']['find']({'where':{'id':_0x45fbed[_0x4bf9('0x5f')]['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x55a3f4,null))['then'](function(_0x14c9b5){if(_0x14c9b5){return _0x14c9b5[_0x4bf9('0x8d')](_0x45fbed[_0x4bf9('0x41')][_0x4bf9('0x71')])[_0x4bf9('0x1e')](function(){if(_['isArray'](_0x45fbed[_0x4bf9('0x41')]['ids'])){for(var _0x48c047=0x0;_0x48c047<_0x45fbed['query'][_0x4bf9('0x71')]['length'];_0x48c047+=0x1){socket[_0x4bf9('0x8f')]('userChatQueue:remove',{'UserId':Number(_0x45fbed[_0x4bf9('0x41')][_0x4bf9('0x71')][_0x48c047]),'ChatQueueId':Number(_0x45fbed[_0x4bf9('0x5f')]['id'])});}}else{socket[_0x4bf9('0x8f')](_0x4bf9('0x90'),{'UserId':Number(_0x45fbed[_0x4bf9('0x41')]['ids']),'ChatQueueId':Number(_0x45fbed['params']['id'])});}});}})['then'](respondWithStatusCode(_0x55a3f4,null))[_0x4bf9('0x28')](handleError(_0x55a3f4,null));};exports[_0x4bf9('0x94')]=function(_0x5acc64,_0x4953cc,_0x4a21a7){var _0x18f05e={};var _0x4fc6cc={};var _0x3a75f7;var _0x31531a;return db['ChatQueue'][_0x4bf9('0x62')]({'where':{'id':_0x5acc64['params']['id']}})[_0x4bf9('0x1e')](handleEntityNotFound(_0x4953cc,null))['then'](function(_0x35f80f){if(_0x35f80f){_0x3a75f7=_0x35f80f;_0x4fc6cc['model']=_[_0x4bf9('0x42')](db[_0x4bf9('0x68')]['rawAttributes']);_0x4fc6cc[_0x4bf9('0x41')]=_[_0x4bf9('0x42')](_0x5acc64['query']);_0x4fc6cc[_0x4bf9('0x43')]=_['intersection'](_0x4fc6cc['model'],_0x4fc6cc[_0x4bf9('0x41')]);_0x18f05e[_0x4bf9('0x45')]=_[_0x4bf9('0x44')](_0x4fc6cc['model'],qs[_0x4bf9('0x46')](_0x5acc64[_0x4bf9('0x41')]['fields']));_0x18f05e[_0x4bf9('0x45')]=_0x18f05e['attributes']['length']?_0x18f05e['attributes']:_0x4fc6cc['model'];_0x18f05e[_0x4bf9('0x48')]=qs[_0x4bf9('0x49')](_0x5acc64[_0x4bf9('0x41')][_0x4bf9('0x49')]);_0x18f05e[_0x4bf9('0x4a')]=qs[_0x4bf9('0x43')](_[_0x4bf9('0x4b')](_0x5acc64[_0x4bf9('0x41')],_0x4fc6cc[_0x4bf9('0x43')]));if(_0x5acc64[_0x4bf9('0x41')]['filter']){_0x18f05e[_0x4bf9('0x4a')]=_[_0x4bf9('0x65')](_0x18f05e['where'],{'$or':_[_0x4bf9('0x3c')](_0x18f05e[_0x4bf9('0x45')],function(_0x347062){var _0x399ad7={};_0x399ad7[_0x347062]={'$like':'%'+_0x5acc64['query']['filter']+'%'};return _0x399ad7;})});}_0x18f05e=_[_0x4bf9('0x65')]({},_0x18f05e,_0x5acc64[_0x4bf9('0x4d')]);return _0x3a75f7[_0x4bf9('0x94')](_0x18f05e);}})['then'](function(_0x5d3b35){if(_0x5d3b35){_0x31531a=_0x5d3b35[_0x4bf9('0x53')];if(!_0x5acc64[_0x4bf9('0x41')]['hasOwnProperty'](_0x4bf9('0x63'))){_0x18f05e['limit']=qs[_0x4bf9('0x2d')](_0x5acc64['query'][_0x4bf9('0x2d')]);_0x18f05e['offset']=qs[_0x4bf9('0x2b')](_0x5acc64[_0x4bf9('0x41')][_0x4bf9('0x2b')]);}return _0x3a75f7['getAgents'](_0x18f05e);}})['then'](function(_0x1c0ec4){if(_0x1c0ec4){return _0x1c0ec4?{'count':_0x31531a,'rows':_0x1c0ec4}:null;}})[_0x4bf9('0x1e')](respondWithResult(_0x4953cc,null))[_0x4bf9('0x28')](handleError(_0x4953cc,null));}; \ No newline at end of file +var _0x2782=['set','Content-Range','json','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','intersection','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count'];(function(_0x489ac6,_0xb2a891){var _0x211821=function(_0x594caa){while(--_0x594caa){_0x489ac6['push'](_0x489ac6['shift']());}};_0x211821(++_0xb2a891);}(_0x2782,0x101));var _0x2278=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x2782[_0x20589d];return _0x422de9;};'use strict';var emlformat=require(_0x2278('0x0'));var rimraf=require(_0x2278('0x1'));var zipdir=require(_0x2278('0x2'));var jsonpatch=require(_0x2278('0x3'));var rp=require(_0x2278('0x4'));var moment=require('moment');var BPromise=require(_0x2278('0x5'));var Mustache=require(_0x2278('0x6'));var util=require(_0x2278('0x7'));var path=require(_0x2278('0x8'));var sox=require(_0x2278('0x9'));var csv=require(_0x2278('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2278('0xb'));var _=require(_0x2278('0xc'));var squel=require(_0x2278('0xd'));var crypto=require(_0x2278('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2278('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2278('0x10'));var Papa=require('papaparse');var Redis=require(_0x2278('0x11'));var authService=require(_0x2278('0x12'));var qs=require(_0x2278('0x13'));var as=require(_0x2278('0x14'));var hardwareService=require(_0x2278('0x15'));var logger=require(_0x2278('0x16'))(_0x2278('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2278('0x18'));var db=require(_0x2278('0x19'))['db'];config['redis']=_[_0x2278('0x1a')](config[_0x2278('0x1b')],{'host':_0x2278('0x1c'),'port':0x18eb});var socket=require(_0x2278('0x1d'))(new Redis(config[_0x2278('0x1b')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x2278('0x1e'));var client=jayson['client'][_0x2278('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x30e05f,_0x3fa0c7,_0x54f9e6,_0x128459){return new BPromise(function(_0x7e050d,_0x1b2e19){var _0x153be8=_0x128459||client;return _0x153be8['request'](_0x30e05f,_0x54f9e6)[_0x2278('0x20')](function(_0x4c7540){logger[_0x2278('0x21')](_0x2278('0x22'),_0x3fa0c7,_0x2278('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3fa0c7,_0x2278('0x23'),JSON['stringify'](_0x4c7540));if(_0x4c7540[_0x2278('0x24')]){if(_0x4c7540[_0x2278('0x24')][_0x2278('0x25')]===0x1f4){logger[_0x2278('0x24')]('ChatQueue,\x20%s,\x20%s',_0x3fa0c7,_0x4c7540[_0x2278('0x24')][_0x2278('0x26')]);return _0x1b2e19(_0x4c7540[_0x2278('0x24')][_0x2278('0x26')]);}logger[_0x2278('0x24')](_0x2278('0x22'),_0x3fa0c7,_0x4c7540[_0x2278('0x24')]['message']);return _0x7e050d(_0x4c7540[_0x2278('0x24')][_0x2278('0x26')]);}else{logger[_0x2278('0x21')](_0x2278('0x22'),_0x3fa0c7,_0x2278('0x23'));_0x7e050d(_0x4c7540[_0x2278('0x27')][_0x2278('0x26')]);}})[_0x2278('0x28')](function(_0x47a7bc){logger[_0x2278('0x24')](_0x2278('0x22'),_0x3fa0c7,_0x47a7bc);_0x1b2e19(_0x47a7bc);});});}function respondWithStatusCode(_0xd20a5d,_0x40e7a2){_0x40e7a2=_0x40e7a2||0xcc;return function(_0xb52ae9){if(_0xb52ae9){return _0xd20a5d[_0x2278('0x29')](_0x40e7a2);}return _0xd20a5d[_0x2278('0x2a')](_0x40e7a2)[_0x2278('0x2b')]();};}function respondWithResult(_0x33f22b,_0x59106d){_0x59106d=_0x59106d||0xc8;return function(_0x319d8a){if(_0x319d8a){return _0x33f22b[_0x2278('0x2a')](_0x59106d)['json'](_0x319d8a);}};}function respondWithFilteredResult(_0xbf132f,_0xd2be08){return function(_0x4b0405){if(_0x4b0405){var _0x299416=typeof _0xd2be08[_0x2278('0x2c')]===_0x2278('0x2d')&&typeof _0xd2be08['limit']===_0x2278('0x2d');var _0x5ebdbc=_0x4b0405[_0x2278('0x2e')];var _0xffbcab=_0x299416?0x0:_0xd2be08[_0x2278('0x2c')];var _0x46c0c3=_0x299416?_0x4b0405[_0x2278('0x2e')]:_0xd2be08[_0x2278('0x2c')]+_0xd2be08['limit'];var _0x47d276;if(_0x46c0c3>=_0x5ebdbc){_0x46c0c3=_0x5ebdbc;_0x47d276=0xc8;}else{_0x47d276=0xce;}_0xbf132f[_0x2278('0x2a')](_0x47d276);return _0xbf132f[_0x2278('0x2f')](_0x2278('0x30'),_0xffbcab+'-'+_0x46c0c3+'/'+_0x5ebdbc)[_0x2278('0x31')](_0x4b0405);}return null;};}function patchUpdates(_0x1da93d){return function(_0x53acf3){try{jsonpatch[_0x2278('0x32')](_0x53acf3,_0x1da93d,!![]);}catch(_0x2d7b82){return BPromise[_0x2278('0x33')](_0x2d7b82);}return _0x53acf3[_0x2278('0x34')]();};}function saveUpdates(_0x2c0458,_0x1058fc){return function(_0x526286){if(_0x526286){return _0x526286[_0x2278('0x35')](_0x2c0458)[_0x2278('0x20')](function(_0x3f5fd5){return _0x3f5fd5;});}return null;};}function removeEntity(_0x40decf,_0x425007){return function(_0x28658b){if(_0x28658b){return _0x28658b[_0x2278('0x36')]()[_0x2278('0x20')](function(){var _0x1cfd7b=_0x28658b['get']({'plain':!![]});var _0x37eaa9=_0x2278('0x37');return db[_0x2278('0x38')][_0x2278('0x36')]({'where':{'type':_0x37eaa9,'resourceId':_0x1cfd7b['id']}})[_0x2278('0x20')](function(){return _0x28658b;});})[_0x2278('0x20')](function(){_0x40decf['status'](0xcc)[_0x2278('0x2b')]();});}};}function handleEntityNotFound(_0x1ee7da,_0x1dd74d){return function(_0x3f4cd4){if(!_0x3f4cd4){_0x1ee7da['sendStatus'](0x194);}return _0x3f4cd4;};}function handleError(_0x2b82d3,_0x21d55e){_0x21d55e=_0x21d55e||0x1f4;return function(_0x4a6559){logger[_0x2278('0x24')](_0x4a6559['stack']);if(_0x4a6559['name']){delete _0x4a6559[_0x2278('0x39')];}_0x2b82d3['status'](_0x21d55e)['send'](_0x4a6559);};}exports[_0x2278('0x3a')]=function(_0x35cfb1,_0x56141e){var _0x2c30bc={},_0xd71b44={},_0x5a646a={'count':0x0,'rows':[]};var _0x17fbcf=_[_0x2278('0x3b')](db[_0x2278('0x3c')][_0x2278('0x3d')],function(_0x2df5c6){return{'name':_0x2df5c6[_0x2278('0x3e')],'type':_0x2df5c6[_0x2278('0x3f')][_0x2278('0x40')]};});_0xd71b44[_0x2278('0x41')]=_[_0x2278('0x3b')](_0x17fbcf,_0x2278('0x39'));_0xd71b44[_0x2278('0x42')]=_['keys'](_0x35cfb1['query']);_0xd71b44['filters']=_['intersection'](_0xd71b44[_0x2278('0x41')],_0xd71b44[_0x2278('0x42')]);_0x2c30bc[_0x2278('0x43')]=_['intersection'](_0xd71b44[_0x2278('0x41')],qs[_0x2278('0x44')](_0x35cfb1[_0x2278('0x42')][_0x2278('0x44')]));_0x2c30bc[_0x2278('0x43')]=_0x2c30bc[_0x2278('0x43')]['length']?_0x2c30bc['attributes']:_0xd71b44[_0x2278('0x41')];if(!_0x35cfb1['query'][_0x2278('0x45')](_0x2278('0x46'))){_0x2c30bc['limit']=qs['limit'](_0x35cfb1[_0x2278('0x42')][_0x2278('0x47')]);_0x2c30bc[_0x2278('0x2c')]=qs[_0x2278('0x2c')](_0x35cfb1[_0x2278('0x42')][_0x2278('0x2c')]);}_0x2c30bc[_0x2278('0x48')]=qs[_0x2278('0x49')](_0x35cfb1[_0x2278('0x42')]['sort']);_0x2c30bc[_0x2278('0x4a')]=qs[_0x2278('0x4b')](_[_0x2278('0x4c')](_0x35cfb1[_0x2278('0x42')],_0xd71b44[_0x2278('0x4b')]),_0x17fbcf);if(_0x35cfb1[_0x2278('0x42')][_0x2278('0x4d')]){_0x2c30bc['where']=_[_0x2278('0x4e')](_0x2c30bc[_0x2278('0x4a')],{'$or':_[_0x2278('0x3b')](_0x17fbcf,function(_0x3e52d9){if(_0x3e52d9['type']!==_0x2278('0x4f')){var _0x55580d={};_0x55580d[_0x3e52d9['name']]={'$like':'%'+_0x35cfb1[_0x2278('0x42')]['filter']+'%'};return _0x55580d;}})});}_0x2c30bc=_['merge']({},_0x2c30bc,_0x35cfb1[_0x2278('0x50')]);var _0x258df1={'where':_0x2c30bc[_0x2278('0x4a')]};return db[_0x2278('0x3c')]['count'](_0x258df1)['then'](function(_0x4c3c23){_0x5a646a['count']=_0x4c3c23;if(_0x35cfb1['query'][_0x2278('0x51')]){_0x2c30bc[_0x2278('0x52')]=[{'all':!![]}];}return db[_0x2278('0x3c')][_0x2278('0x53')](_0x2c30bc);})['then'](function(_0xf2600d){_0x5a646a['rows']=_0xf2600d;return _0x5a646a;})[_0x2278('0x20')](respondWithFilteredResult(_0x56141e,_0x2c30bc))['catch'](handleError(_0x56141e,null));};exports[_0x2278('0x54')]=function(_0x2ebcca,_0xded3b){var _0x32caea={'raw':!![],'where':{'id':_0x2ebcca['params']['id']}},_0x3ec770={};_0x3ec770[_0x2278('0x41')]=_[_0x2278('0x55')](db[_0x2278('0x3c')][_0x2278('0x3d')]);_0x3ec770[_0x2278('0x42')]=_[_0x2278('0x55')](_0x2ebcca[_0x2278('0x42')]);_0x3ec770[_0x2278('0x4b')]=_[_0x2278('0x56')](_0x3ec770[_0x2278('0x41')],_0x3ec770[_0x2278('0x42')]);_0x32caea[_0x2278('0x43')]=_[_0x2278('0x56')](_0x3ec770[_0x2278('0x41')],qs[_0x2278('0x44')](_0x2ebcca[_0x2278('0x42')][_0x2278('0x44')]));_0x32caea[_0x2278('0x43')]=_0x32caea[_0x2278('0x43')][_0x2278('0x57')]?_0x32caea[_0x2278('0x43')]:_0x3ec770[_0x2278('0x41')];if(_0x2ebcca[_0x2278('0x42')][_0x2278('0x51')]){_0x32caea[_0x2278('0x52')]=[{'all':!![]}];}_0x32caea=_[_0x2278('0x4e')]({},_0x32caea,_0x2ebcca[_0x2278('0x50')]);return db[_0x2278('0x3c')][_0x2278('0x58')](_0x32caea)['then'](handleEntityNotFound(_0xded3b,null))['then'](respondWithResult(_0xded3b,null))['catch'](handleError(_0xded3b,null));};exports['create']=function(_0x4239a3,_0x3ccbc6){return db[_0x2278('0x3c')]['create'](_0x4239a3[_0x2278('0x59')],{})['then'](function(_0x1a0447){var _0x2d3e73=_0x4239a3[_0x2278('0x5a')][_0x2278('0x5b')]({'plain':!![]});if(!_0x2d3e73)throw new Error(_0x2278('0x5c'));if(_0x2d3e73['role']===_0x2278('0x5a')){var _0x29f43f=_0x1a0447[_0x2278('0x5b')]({'plain':!![]});var _0x4fe779='ChatQueues';return db[_0x2278('0x5d')]['find']({'where':{'name':_0x4fe779,'userProfileId':_0x2d3e73['userProfileId']},'raw':!![]})[_0x2278('0x20')](function(_0x49a23a){if(_0x49a23a&&_0x49a23a[_0x2278('0x5e')]===0x0){return db[_0x2278('0x38')]['create']({'name':_0x29f43f['name'],'resourceId':_0x29f43f['id'],'type':_0x49a23a[_0x2278('0x39')],'sectionId':_0x49a23a['id']},{})[_0x2278('0x20')](function(){return _0x1a0447;});}else{return _0x1a0447;}})[_0x2278('0x28')](function(_0x5d1610){logger[_0x2278('0x24')](_0x2278('0x5f'),_0x5d1610);throw _0x5d1610;});}return _0x1a0447;})[_0x2278('0x20')](respondWithResult(_0x3ccbc6,0xc9))[_0x2278('0x28')](handleError(_0x3ccbc6,null));};exports['update']=function(_0x39758b,_0x272bdf){if(_0x39758b['body']['id']){delete _0x39758b['body']['id'];}return db[_0x2278('0x3c')][_0x2278('0x58')]({'where':{'id':_0x39758b[_0x2278('0x60')]['id']}})[_0x2278('0x20')](handleEntityNotFound(_0x272bdf,null))[_0x2278('0x20')](saveUpdates(_0x39758b[_0x2278('0x59')],null))['then'](respondWithResult(_0x272bdf,null))[_0x2278('0x28')](handleError(_0x272bdf,null));};exports[_0x2278('0x36')]=function(_0x40b38b,_0x15b720){return db[_0x2278('0x3c')][_0x2278('0x58')]({'where':{'id':_0x40b38b[_0x2278('0x60')]['id']}})[_0x2278('0x20')](handleEntityNotFound(_0x15b720,null))[_0x2278('0x20')](removeEntity(_0x15b720,null))[_0x2278('0x28')](handleError(_0x15b720,null));};exports[_0x2278('0x61')]=function(_0x1c8cea,_0x17c919){return db[_0x2278('0x3c')][_0x2278('0x61')]()[_0x2278('0x20')](respondWithResult(_0x17c919,null))[_0x2278('0x28')](handleError(_0x17c919,null));};exports['getMembers']=function(_0x54a9ab,_0x411d93,_0xf24cb4){var _0x2aa40e={'raw':!![],'where':{}},_0x181ad5={},_0x3798d1;return db[_0x2278('0x3c')][_0x2278('0x62')]({'where':{'id':_0x54a9ab[_0x2278('0x60')]['id']}})[_0x2278('0x20')](handleEntityNotFound(_0x411d93,null))['then'](function(_0x30e8a8){if(_0x30e8a8){_0x3798d1=_0x30e8a8['get']({'plain':!![]});_0x181ad5[_0x2278('0x41')]=_[_0x2278('0x55')](db['UserChatQueue'][_0x2278('0x3d')]);_0x181ad5[_0x2278('0x42')]=_[_0x2278('0x55')](_0x54a9ab[_0x2278('0x42')]);_0x181ad5[_0x2278('0x4b')]=_[_0x2278('0x56')](_0x181ad5[_0x2278('0x41')],_0x181ad5['query']);_0x2aa40e['attributes']=_[_0x2278('0x56')](_0x181ad5[_0x2278('0x41')],qs[_0x2278('0x44')](_0x54a9ab[_0x2278('0x42')]['fields']));_0x2aa40e[_0x2278('0x43')]=_0x2aa40e[_0x2278('0x43')]['length']?_0x2aa40e[_0x2278('0x43')]:_0x181ad5[_0x2278('0x41')];if(!_0x54a9ab[_0x2278('0x42')]['hasOwnProperty'](_0x2278('0x46'))){_0x2aa40e['limit']=qs[_0x2278('0x47')](_0x54a9ab[_0x2278('0x42')][_0x2278('0x47')]);_0x2aa40e[_0x2278('0x2c')]=qs[_0x2278('0x2c')](_0x54a9ab[_0x2278('0x42')][_0x2278('0x2c')]);}_0x2aa40e['order']=qs[_0x2278('0x49')](_0x54a9ab[_0x2278('0x42')][_0x2278('0x49')]);_0x2aa40e[_0x2278('0x4a')]=qs[_0x2278('0x4b')](_[_0x2278('0x4c')](_0x54a9ab[_0x2278('0x42')],_0x181ad5[_0x2278('0x4b')]));_0x2aa40e[_0x2278('0x4a')]['ChatQueueId']=_0x30e8a8['id'];if(_0x54a9ab[_0x2278('0x42')][_0x2278('0x4d')]){_0x2aa40e[_0x2278('0x4a')]=_[_0x2278('0x4e')](_0x2aa40e[_0x2278('0x4a')],{'$or':_[_0x2278('0x3b')](_0x2aa40e[_0x2278('0x43')],function(_0x42d5d6){var _0x57fb96={};_0x57fb96[_0x42d5d6]={'$like':'%'+_0x54a9ab[_0x2278('0x42')][_0x2278('0x4d')]+'%'};return _0x57fb96;})});}_0x2aa40e=_[_0x2278('0x4e')]({},_0x2aa40e,_0x54a9ab[_0x2278('0x50')]);return db['UserChatQueue'][_0x2278('0x53')](_0x2aa40e);}})[_0x2278('0x20')](function(_0x447837){if(_0x447837){return db[_0x2278('0x63')][_0x2278('0x64')]({'where':{'id':_[_0x2278('0x3b')](_0x447837,_0x2278('0x65')),'role':_0x2278('0x66')},'attributes':['id',_0x2278('0x39'),_0x2278('0x67'),_0x2278('0x68'),_0x2278('0x69')]});}})['then'](function(_0x4af52c){if(_0x4af52c){return{'count':_0x4af52c[_0x2278('0x2e')],'rows':_[_0x2278('0x3b')](_0x4af52c[_0x2278('0x6a')],function(_0x21b4b5){return{'membername':_0x21b4b5[_0x2278('0x39')],'UserId':_0x21b4b5['id'],'queue_name':_0x3798d1[_0x2278('0x39')],'ChatQueueId':_0x3798d1['id'],'interface':util[_0x2278('0x6b')](_0x2278('0x6c'),_0x2278('0x6d'),_0x21b4b5[_0x2278('0x39')]),'penalty':0x0,'paused':_0x21b4b5['chatPause'],'createdAt':_0x21b4b5['createdAt'],'updatedAt':_0x21b4b5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2278('0x20')](respondWithFilteredResult(_0x411d93,_0x2aa40e))['catch'](handleError(_0x411d93,null));};exports['getTeams']=function(_0x4d3c52,_0x4cf8e8,_0x3fe289){var _0x4225f3={};var _0x180673={};var _0x29cf98;var _0x4422cf;return db[_0x2278('0x3c')][_0x2278('0x62')]({'where':{'id':_0x4d3c52[_0x2278('0x60')]['id']}})['then'](handleEntityNotFound(_0x4cf8e8,null))['then'](function(_0x354d35){if(_0x354d35){_0x29cf98=_0x354d35;_0x180673[_0x2278('0x41')]=_[_0x2278('0x55')](db[_0x2278('0x6e')][_0x2278('0x3d')]);_0x180673['query']=_[_0x2278('0x55')](_0x4d3c52['query']);_0x180673[_0x2278('0x4b')]=_[_0x2278('0x56')](_0x180673['model'],_0x180673[_0x2278('0x42')]);_0x4225f3[_0x2278('0x43')]=_[_0x2278('0x56')](_0x180673[_0x2278('0x41')],qs[_0x2278('0x44')](_0x4d3c52[_0x2278('0x42')][_0x2278('0x44')]));_0x4225f3[_0x2278('0x43')]=_0x4225f3[_0x2278('0x43')][_0x2278('0x57')]?_0x4225f3['attributes']:_0x180673[_0x2278('0x41')];_0x4225f3[_0x2278('0x48')]=qs[_0x2278('0x49')](_0x4d3c52['query'][_0x2278('0x49')]);_0x4225f3[_0x2278('0x4a')]=qs['filters'](_[_0x2278('0x4c')](_0x4d3c52[_0x2278('0x42')],_0x180673[_0x2278('0x4b')]));if(_0x4d3c52['query'][_0x2278('0x4d')]){_0x4225f3[_0x2278('0x4a')]=_[_0x2278('0x4e')](_0x4225f3[_0x2278('0x4a')],{'$or':_['map'](_0x4225f3[_0x2278('0x43')],function(_0x5ddc4f){var _0x54413b={};_0x54413b[_0x5ddc4f]={'$like':'%'+_0x4d3c52[_0x2278('0x42')][_0x2278('0x4d')]+'%'};return _0x54413b;})});}_0x4225f3=_[_0x2278('0x4e')]({},_0x4225f3,_0x4d3c52[_0x2278('0x50')]);return _0x29cf98['getTeams'](_0x4225f3);}})[_0x2278('0x20')](function(_0x294391){if(_0x294391){_0x4422cf=_0x294391[_0x2278('0x57')];if(!_0x4d3c52[_0x2278('0x42')]['hasOwnProperty'](_0x2278('0x46'))){_0x4225f3['limit']=qs[_0x2278('0x47')](_0x4d3c52[_0x2278('0x42')]['limit']);_0x4225f3[_0x2278('0x2c')]=qs[_0x2278('0x2c')](_0x4d3c52[_0x2278('0x42')][_0x2278('0x2c')]);}return _0x29cf98[_0x2278('0x6f')](_0x4225f3);}})[_0x2278('0x20')](function(_0x2c4b56){if(_0x2c4b56){return _0x2c4b56?{'count':_0x4422cf,'rows':_0x2c4b56}:null;}})[_0x2278('0x20')](respondWithResult(_0x4cf8e8,null))[_0x2278('0x28')](handleError(_0x4cf8e8,null));};exports[_0x2278('0x70')]=function(_0x3f62d0,_0x31702c,_0x36beff){var _0x23e857=_0x3f62d0[_0x2278('0x59')][_0x2278('0x71')];return db[_0x2278('0x6e')][_0x2278('0x53')]({'where':{'id':_0x23e857},'attributes':['id'],'include':[{'model':db[_0x2278('0x63')],'as':_0x2278('0x72'),'attributes':['id',_0x2278('0x39'),_0x2278('0x73'),_0x2278('0x74'),_0x2278('0x75')],'raw':!![]}]})['then'](function(_0x2b15ee){if(_0x2b15ee){var _0x229174=_[_0x2278('0x76')](_0x2b15ee,function(_0x6d95b8){var _0x3d1404=_0x6d95b8['get']({'plain':!![]});return _0x3d1404[_0x2278('0x72')];});return db[_0x2278('0x3c')]['find']({'where':{'id':_0x3f62d0[_0x2278('0x60')]['id']}})['then'](function(_0x177c1d){return db[_0x2278('0x77')][_0x2278('0x78')](function(_0x221f58){return _0x177c1d[_0x2278('0x70')](_0x23e857,{'transaction':_0x221f58})[_0x2278('0x20')](function(){return BPromise[_0x2278('0x79')](_0x229174,function(_0x3bacdb){return db['UserChatQueue'][_0x2278('0x7a')]({'where':{'UserId':_0x3bacdb['id'],'ChatQueueId':_0x3f62d0['params']['id']},'transaction':_0x221f58});});})[_0x2278('0x20')](function(){_0x229174[_0x2278('0x7b')](function(_0x539fcb){socket[_0x2278('0x7c')]('userChatQueue:save',{'UserId':_0x539fcb['id'],'ChatQueueId':_0x177c1d['id']});});});});});}})[_0x2278('0x20')](respondWithStatusCode(_0x31702c,null))[_0x2278('0x28')](handleError(_0x31702c,null));};exports[_0x2278('0x7d')]=function(_0x4c70b9,_0x52556e,_0xe8c06a){return db[_0x2278('0x6e')][_0x2278('0x53')]({'where':{'id':_0x4c70b9[_0x2278('0x42')][_0x2278('0x71')]},'attributes':['id'],'include':[{'model':db[_0x2278('0x63')],'as':_0x2278('0x72'),'attributes':['id'],'raw':!![]}]})[_0x2278('0x20')](handleEntityNotFound(_0x52556e,null))[_0x2278('0x20')](function(_0x2afa35){var _0x3698f2=_[_0x2278('0x3b')](_0x2afa35,'id');var _0x1b187a=[];var _0x39d1f8=[];var _0x239073=squel['select']();_0x239073[_0x2278('0x7e')](_0x2278('0x7f'))[_0x2278('0x80')]('team_has_chat_queues','tq')[_0x2278('0x81')](_0x2278('0x82'),'ut',_0x2278('0x83'))[_0x2278('0x4a')](_0x2278('0x84'),_0x4c70b9[_0x2278('0x60')]['id']);for(var _0x1a2db2=0x0;_0x1a2db2<_0x2afa35[_0x2278('0x57')];_0x1a2db2+=0x1){let _0x39a74a=_0x2afa35[_0x1a2db2];for(var _0x1b7754=0x0;_0x1b7754<_0x39a74a[_0x2278('0x72')][_0x2278('0x57')];_0x1b7754+=0x1){let _0x4b92fe=_0x39a74a[_0x2278('0x72')][_0x1b7754];var _0x26c34e=_0x239073[_0x2278('0x85')]();_0x26c34e[_0x2278('0x4a')](_0x2278('0x86'),_0x4b92fe['id']);_0x39d1f8[_0x2278('0x87')](db[_0x2278('0x77')][_0x2278('0x42')](_0x26c34e[_0x2278('0x88')](),{'type':db[_0x2278('0x77')][_0x2278('0x89')][_0x2278('0x8a')]})['then'](function(_0x504932){if(_0x504932['length']===0x1){return _0x4b92fe['id'];}else{var _0x429f82=_['every'](_[_0x2278('0x3b')](_0x504932,_0x2278('0x8b')),function(_0x41bb6b){return _[_0x2278('0x8c')](_0x3698f2,_0x41bb6b);});if(_0x429f82){return _0x4b92fe['id'];}}}));}}return BPromise[_0x2278('0x8d')](_0x39d1f8)[_0x2278('0x20')](function(_0x296ed2){_0x1b187a=_(_0x1b187a)[_0x2278('0x8e')](_0x296ed2)[_0x2278('0x8f')]()[_0x2278('0x90')]();return db[_0x2278('0x3c')]['find']({'where':{'id':_0x4c70b9[_0x2278('0x60')]['id']}})[_0x2278('0x20')](function(_0x4cd092){return db[_0x2278('0x77')][_0x2278('0x78')](function(_0x3c333f){return _0x4cd092[_0x2278('0x7d')](_0x4c70b9['query'][_0x2278('0x71')],{'transaction':_0x3c333f})[_0x2278('0x20')](function(){if(!_[_0x2278('0x91')](_0x1b187a)){return _0x4cd092[_0x2278('0x92')](_0x1b187a,{'transaction':_0x3c333f});}})[_0x2278('0x20')](function(){_0x1b187a[_0x2278('0x7b')](function(_0x21d715){socket[_0x2278('0x7c')](_0x2278('0x93'),{'UserId':_0x21d715,'ChatQueueId':_0x4cd092['id']});});});});});});})['then'](respondWithStatusCode(_0x52556e,null))[_0x2278('0x28')](handleError(_0x52556e,null));};exports[_0x2278('0x94')]=function(_0x2d1da3,_0x55739d,_0x8efa01){return db[_0x2278('0x3c')][_0x2278('0x58')]({'where':{'id':_0x2d1da3['params']['id']}})[_0x2278('0x20')](handleEntityNotFound(_0x55739d,null))[_0x2278('0x20')](function(_0x38fd00){if(_0x38fd00){return _0x38fd00[_0x2278('0x94')](_0x2d1da3[_0x2278('0x59')][_0x2278('0x71')],_[_0x2278('0x95')](_0x2d1da3[_0x2278('0x59')],['ids','id'])||{})[_0x2278('0x96')](function(_0x564083){for(var _0x3f9ca1=0x0;_0x3f9ca1<_0x2d1da3[_0x2278('0x59')]['ids'][_0x2278('0x57')];_0x3f9ca1+=0x1){socket[_0x2278('0x7c')]('userChatQueue:save',{'UserId':Number(_0x2d1da3[_0x2278('0x59')][_0x2278('0x71')][_0x3f9ca1]),'ChatQueueId':Number(_0x2d1da3[_0x2278('0x60')]['id'])});}return _0x564083;});}})[_0x2278('0x20')](respondWithResult(_0x55739d,null))[_0x2278('0x28')](handleError(_0x55739d,null));};exports[_0x2278('0x92')]=function(_0x132574,_0x9e9de3,_0x17b4d9){return db[_0x2278('0x3c')]['find']({'where':{'id':_0x132574['params']['id']}})[_0x2278('0x20')](handleEntityNotFound(_0x9e9de3,null))[_0x2278('0x20')](function(_0x35580d){if(_0x35580d){return _0x35580d[_0x2278('0x92')](_0x132574['query'][_0x2278('0x71')])['then'](function(){if(_['isArray'](_0x132574[_0x2278('0x42')][_0x2278('0x71')])){for(var _0x204dc5=0x0;_0x204dc5<_0x132574[_0x2278('0x42')][_0x2278('0x71')][_0x2278('0x57')];_0x204dc5+=0x1){socket['emit'](_0x2278('0x93'),{'UserId':Number(_0x132574[_0x2278('0x42')][_0x2278('0x71')][_0x204dc5]),'ChatQueueId':Number(_0x132574['params']['id'])});}}else{socket[_0x2278('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x132574[_0x2278('0x42')][_0x2278('0x71')]),'ChatQueueId':Number(_0x132574[_0x2278('0x60')]['id'])});}});}})[_0x2278('0x20')](respondWithStatusCode(_0x9e9de3,null))[_0x2278('0x28')](handleError(_0x9e9de3,null));};exports[_0x2278('0x97')]=function(_0x47b183,_0x2642af,_0x19ace6){var _0x167675={};var _0x19de41={};var _0x5dd67c;var _0x59e052;return db['ChatQueue'][_0x2278('0x62')]({'where':{'id':_0x47b183[_0x2278('0x60')]['id']}})[_0x2278('0x20')](handleEntityNotFound(_0x2642af,null))['then'](function(_0x486b71){if(_0x486b71){_0x5dd67c=_0x486b71;_0x19de41[_0x2278('0x41')]=_[_0x2278('0x55')](db[_0x2278('0x63')]['rawAttributes']);_0x19de41['query']=_[_0x2278('0x55')](_0x47b183[_0x2278('0x42')]);_0x19de41[_0x2278('0x4b')]=_[_0x2278('0x56')](_0x19de41[_0x2278('0x41')],_0x19de41['query']);_0x167675[_0x2278('0x43')]=_['intersection'](_0x19de41[_0x2278('0x41')],qs[_0x2278('0x44')](_0x47b183[_0x2278('0x42')]['fields']));_0x167675[_0x2278('0x43')]=_0x167675[_0x2278('0x43')][_0x2278('0x57')]?_0x167675[_0x2278('0x43')]:_0x19de41['model'];_0x167675[_0x2278('0x48')]=qs[_0x2278('0x49')](_0x47b183['query'][_0x2278('0x49')]);_0x167675[_0x2278('0x4a')]=qs[_0x2278('0x4b')](_[_0x2278('0x4c')](_0x47b183[_0x2278('0x42')],_0x19de41[_0x2278('0x4b')]));if(_0x47b183['query'][_0x2278('0x4d')]){_0x167675[_0x2278('0x4a')]=_[_0x2278('0x4e')](_0x167675[_0x2278('0x4a')],{'$or':_[_0x2278('0x3b')](_0x167675[_0x2278('0x43')],function(_0x4641b8){var _0x1aff33={};_0x1aff33[_0x4641b8]={'$like':'%'+_0x47b183[_0x2278('0x42')][_0x2278('0x4d')]+'%'};return _0x1aff33;})});}_0x167675=_['merge']({},_0x167675,_0x47b183[_0x2278('0x50')]);return _0x5dd67c['getAgents'](_0x167675);}})[_0x2278('0x20')](function(_0x235531){if(_0x235531){_0x59e052=_0x235531[_0x2278('0x57')];if(!_0x47b183[_0x2278('0x42')][_0x2278('0x45')](_0x2278('0x46'))){_0x167675[_0x2278('0x47')]=qs[_0x2278('0x47')](_0x47b183[_0x2278('0x42')][_0x2278('0x47')]);_0x167675['offset']=qs['offset'](_0x47b183[_0x2278('0x42')][_0x2278('0x2c')]);}return _0x5dd67c[_0x2278('0x97')](_0x167675);}})[_0x2278('0x20')](function(_0x230203){if(_0x230203){return _0x230203?{'count':_0x59e052,'rows':_0x230203}:null;}})[_0x2278('0x20')](respondWithResult(_0x2642af,null))['catch'](handleError(_0x2642af,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 11fd17e..aa323fc 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 _0xaef9=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x1b1d28,_0x3643ae){var _0x2e6f34=function(_0xfedc35){while(--_0xfedc35){_0x1b1d28['push'](_0x1b1d28['shift']());}};_0x2e6f34(++_0x3643ae);}(_0xaef9,0x194));var _0x9aef=function(_0x465a18,_0x5f3867){_0x465a18=_0x465a18-0x0;var _0x43c605=_0xaef9[_0x465a18];return _0x43c605;};'use strict';var EventEmitter=require(_0x9aef('0x0'));var ChatQueue=require(_0x9aef('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9aef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9aef('0x3'),'afterDestroy':_0x9aef('0x4')};function emitEvent(_0x460c1b){return function(_0x3afe7c,_0x181bbc,_0xd9c81a){ChatQueueEvents[_0x9aef('0x5')](_0x460c1b+':'+_0x3afe7c['id'],_0x3afe7c);ChatQueueEvents[_0x9aef('0x5')](_0x460c1b,_0x3afe7c);_0xd9c81a(null);};}for(var e in events){if(events[_0x9aef('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9aef('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x58f0=['exports','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x6dc241,_0x3d6db7){var _0xac50e7=function(_0x42c8a1){while(--_0x42c8a1){_0x6dc241['push'](_0x6dc241['shift']());}};_0xac50e7(++_0x3d6db7);}(_0x58f0,0xe9));var _0x058f=function(_0x305290,_0x349aef){_0x305290=_0x305290-0x0;var _0x4f219c=_0x58f0[_0x305290];return _0x4f219c;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x058f('0x0'))['db'][_0x058f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x058f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x058f('0x3'),'afterDestroy':_0x058f('0x4')};function emitEvent(_0x2244bc){return function(_0x3222f0,_0x3e8cce,_0x464619){ChatQueueEvents[_0x058f('0x5')](_0x2244bc+':'+_0x3222f0['id'],_0x3222f0);ChatQueueEvents[_0x058f('0x5')](_0x2244bc,_0x3222f0);_0x464619(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x058f('0x6')](e,emitEvent(event));}}module[_0x058f('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 67a260c..d41cd76 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 _0x0631=['api','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x0631,0x128));var _0x1063=function(_0x308a1d,_0x3d379d){_0x308a1d=_0x308a1d-0x0;var _0x5eb875=_0x0631[_0x308a1d];return _0x5eb875;};'use strict';var _=require(_0x1063('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1063('0x1'));var moment=require(_0x1063('0x2'));var BPromise=require(_0x1063('0x3'));var rp=require(_0x1063('0x4'));var fs=require('fs');var path=require(_0x1063('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1063('0x6'));module[_0x1063('0x7')]=function(_0x1a8134,_0x5bc626){return _0x1a8134[_0x1063('0x8')](_0x1063('0x9'),attributes,{'tableName':_0x1063('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa962=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api'];(function(_0x169600,_0x1d1346){var _0x3bee22=function(_0x19639b){while(--_0x19639b){_0x169600['push'](_0x169600['shift']());}};_0x3bee22(++_0x1d1346);}(_0xa962,0x10e));var _0x2a96=function(_0x23551e,_0x56f82f){_0x23551e=_0x23551e-0x0;var _0x4e36ff=_0xa962[_0x23551e];return _0x4e36ff;};'use strict';var _=require(_0x2a96('0x0'));var util=require(_0x2a96('0x1'));var logger=require('../../config/logger')(_0x2a96('0x2'));var moment=require(_0x2a96('0x3'));var BPromise=require(_0x2a96('0x4'));var rp=require(_0x2a96('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a96('0x6'));var config=require(_0x2a96('0x7'));var attributes=require(_0x2a96('0x8'));module[_0x2a96('0x9')]=function(_0x52e73b,_0x8c447a){return _0x52e73b[_0x2a96('0xa')](_0x2a96('0xb'),attributes,{'tableName':_0x2a96('0xc'),'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 693f693..5fc4e3b 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 _0xa79a=['raw','where','attributes','limit','include','map','model','then','debug','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x5d4df5,_0x17e12a){var _0x5f033d=function(_0x387d0a){while(--_0x387d0a){_0x5d4df5['push'](_0x5d4df5['shift']());}};_0x5f033d(++_0x17e12a);}(_0xa79a,0x1df));var _0xaa79=function(_0x6923ea,_0x4b5785){_0x6923ea=_0x6923ea-0x0;var _0x37b5d1=_0xa79a[_0x6923ea];return _0x37b5d1;};'use strict';var _=require(_0xaa79('0x0'));var util=require(_0xaa79('0x1'));var moment=require(_0xaa79('0x2'));var BPromise=require(_0xaa79('0x3'));var rs=require(_0xaa79('0x4'));var fs=require('fs');var Redis=require(_0xaa79('0x5'));var db=require(_0xaa79('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa79('0x7'))(_0xaa79('0x8'));var config=require(_0xaa79('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xaa79('0xa')]=_[_0xaa79('0xb')](config[_0xaa79('0xa')],{'host':_0xaa79('0xc'),'port':0x18eb});var socket=require(_0xaa79('0xd'))(new Redis(config[_0xaa79('0xa')]));require(_0xaa79('0xe'))[_0xaa79('0xf')](socket);function respondWithRpcPromise(_0x5b1e44,_0x3f7ac2,_0x4dfea7){return new BPromise(function(_0x1aacca,_0x5ec753){return client['request'](_0x5b1e44,_0x4dfea7)['then'](function(_0x3065b1){logger[_0xaa79('0x10')](_0xaa79('0x11'),_0x3f7ac2,_0xaa79('0x12'));logger['debug'](_0xaa79('0x13'),_0x3f7ac2,'request\x20sent',JSON[_0xaa79('0x14')](_0x3065b1));if(_0x3065b1[_0xaa79('0x15')]){if(_0x3065b1[_0xaa79('0x15')]['code']===0x1f4){logger[_0xaa79('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0x3065b1[_0xaa79('0x15')][_0xaa79('0x16')]);return _0x5ec753(_0x3065b1['error'][_0xaa79('0x16')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0x3065b1[_0xaa79('0x15')][_0xaa79('0x16')]);return _0x1aacca(_0x3065b1[_0xaa79('0x15')][_0xaa79('0x16')]);}else{logger[_0xaa79('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0xaa79('0x12'));_0x1aacca(_0x3065b1['result']['message']);}})[_0xaa79('0x17')](function(_0x306f1d){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3f7ac2,_0x306f1d);_0x5ec753(_0x306f1d);});});}exports[_0xaa79('0x18')]=function(_0x363fb8){var _0x2c579e=this;return new Promise(function(_0x18f321,_0x105fec){return db[_0xaa79('0x19')][_0xaa79('0x1a')]({'raw':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8['options'][_0xaa79('0x1c')]===undefined?!![]:![]:!![],'where':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8['options'][_0xaa79('0x1d')]||null:null,'attributes':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8[_0xaa79('0x1b')][_0xaa79('0x1e')]||null:null,'limit':_0x363fb8[_0xaa79('0x1b')]?_0x363fb8[_0xaa79('0x1b')][_0xaa79('0x1f')]||null:null,'include':_0x363fb8['options']?_0x363fb8['options'][_0xaa79('0x20')]?_[_0xaa79('0x21')](_0x363fb8[_0xaa79('0x1b')][_0xaa79('0x20')],function(_0x47cb92){return{'model':db[_0x47cb92[_0xaa79('0x22')]],'as':_0x47cb92['as'],'attributes':_0x47cb92[_0xaa79('0x1e')],'include':_0x47cb92['include']?_[_0xaa79('0x21')](_0x47cb92[_0xaa79('0x20')],function(_0x479f96){return{'model':db[_0x479f96[_0xaa79('0x22')]],'as':_0x479f96['as'],'attributes':_0x479f96[_0xaa79('0x1e')],'include':_0x479f96[_0xaa79('0x20')]?_[_0xaa79('0x21')](_0x479f96['include'],function(_0x2bf2d9){return{'model':db[_0x2bf2d9[_0xaa79('0x22')]],'as':_0x2bf2d9['as'],'attributes':_0x2bf2d9[_0xaa79('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaa79('0x23')](function(_0x4784d3){logger[_0xaa79('0x10')]('GetChatQueue',_0x363fb8);logger[_0xaa79('0x24')](_0xaa79('0x18'),_0x363fb8,JSON[_0xaa79('0x14')](_0x4784d3));_0x18f321(_0x4784d3);})[_0xaa79('0x17')](function(_0x3fba96){logger['error'](_0xaa79('0x18'),_0x3fba96[_0xaa79('0x16')],_0x363fb8);_0x105fec(_0x2c579e[_0xaa79('0x15')](0x1f4,_0x3fba96['message']));});});};exports['ShowChatQueue']=function(_0xf49fb5){var _0x7399d7=this;return new Promise(function(_0x27eb58,_0x39dac0){return db[_0xaa79('0x19')][_0xaa79('0x25')]({'raw':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')][_0xaa79('0x1c')]===undefined?!![]:![]:!![],'where':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')]['where']||null:null,'attributes':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')][_0xaa79('0x1e')]||null:null,'include':_0xf49fb5[_0xaa79('0x1b')]?_0xf49fb5[_0xaa79('0x1b')][_0xaa79('0x20')]?_[_0xaa79('0x21')](_0xf49fb5[_0xaa79('0x1b')]['include'],function(_0x581b2a){return{'model':db[_0x581b2a[_0xaa79('0x22')]],'as':_0x581b2a['as'],'attributes':_0x581b2a[_0xaa79('0x1e')],'include':_0x581b2a[_0xaa79('0x20')]?_['map'](_0x581b2a[_0xaa79('0x20')],function(_0x40e8ed){return{'model':db[_0x40e8ed[_0xaa79('0x22')]],'as':_0x40e8ed['as'],'attributes':_0x40e8ed['attributes'],'include':_0x40e8ed['include']?_[_0xaa79('0x21')](_0x40e8ed['include'],function(_0x1ef57b){return{'model':db[_0x1ef57b[_0xaa79('0x22')]],'as':_0x1ef57b['as'],'attributes':_0x1ef57b[_0xaa79('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaa79('0x23')](function(_0x25da8b){logger['info']('ShowChatQueue',_0xf49fb5);logger[_0xaa79('0x24')]('ShowChatQueue',_0xf49fb5,JSON[_0xaa79('0x14')](_0x25da8b));_0x27eb58(_0x25da8b);})[_0xaa79('0x17')](function(_0x275176){logger['error'](_0xaa79('0x26'),_0x275176[_0xaa79('0x16')],_0xf49fb5);_0x39dac0(_0x7399d7[_0xaa79('0x15')](0x1f4,_0x275176['message']));});});}; \ No newline at end of file +var _0x7d25=['../../config/utils','client','redis','defaults','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowChatQueue','ChatQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x239a98,_0x288178){var _0x16d789=function(_0xbdf050){while(--_0xbdf050){_0x239a98['push'](_0x239a98['shift']());}};_0x16d789(++_0x288178);}(_0x7d25,0x8a));var _0x57d2=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x7d25[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./chatQueue.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('ChatQueue,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});}exports[_0x57d2('0x17')]=function(_0x5b1b9d){var _0x1cbe4a=this;return new Promise(function(_0xcf924f,_0x55191e){return db['ChatQueue'][_0x57d2('0x18')]({'raw':_0x5b1b9d[_0x57d2('0x19')]?_0x5b1b9d[_0x57d2('0x19')][_0x57d2('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b1b9d[_0x57d2('0x19')]?_0x5b1b9d[_0x57d2('0x19')][_0x57d2('0x1b')]||null:null,'attributes':_0x5b1b9d[_0x57d2('0x19')]?_0x5b1b9d[_0x57d2('0x19')][_0x57d2('0x1c')]||null:null,'limit':_0x5b1b9d[_0x57d2('0x19')]?_0x5b1b9d[_0x57d2('0x19')][_0x57d2('0x1d')]||null:null,'include':_0x5b1b9d[_0x57d2('0x19')]?_0x5b1b9d['options'][_0x57d2('0x1e')]?_[_0x57d2('0x1f')](_0x5b1b9d[_0x57d2('0x19')][_0x57d2('0x1e')],function(_0x4363b3){return{'model':db[_0x4363b3['model']],'as':_0x4363b3['as'],'attributes':_0x4363b3[_0x57d2('0x1c')],'include':_0x4363b3[_0x57d2('0x1e')]?_[_0x57d2('0x1f')](_0x4363b3[_0x57d2('0x1e')],function(_0x18d500){return{'model':db[_0x18d500[_0x57d2('0x20')]],'as':_0x18d500['as'],'attributes':_0x18d500[_0x57d2('0x1c')],'include':_0x18d500['include']?_[_0x57d2('0x1f')](_0x18d500[_0x57d2('0x1e')],function(_0x277426){return{'model':db[_0x277426[_0x57d2('0x20')]],'as':_0x277426['as'],'attributes':_0x277426[_0x57d2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x57d2('0xc')](function(_0x1dd6cb){logger[_0x57d2('0xd')](_0x57d2('0x17'),_0x5b1b9d);logger[_0x57d2('0x10')]('GetChatQueue',_0x5b1b9d,JSON[_0x57d2('0x12')](_0x1dd6cb));_0xcf924f(_0x1dd6cb);})[_0x57d2('0x21')](function(_0x26e052){logger[_0x57d2('0x13')]('GetChatQueue',_0x26e052[_0x57d2('0x15')],_0x5b1b9d);_0x55191e(_0x1cbe4a[_0x57d2('0x13')](0x1f4,_0x26e052[_0x57d2('0x15')]));});});};exports[_0x57d2('0x22')]=function(_0xb3051c){var _0x40f3f2=this;return new Promise(function(_0x3cbc4b,_0x36c0d7){return db[_0x57d2('0x23')]['find']({'raw':_0xb3051c[_0x57d2('0x19')]?_0xb3051c[_0x57d2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xb3051c[_0x57d2('0x19')]?_0xb3051c[_0x57d2('0x19')]['where']||null:null,'attributes':_0xb3051c[_0x57d2('0x19')]?_0xb3051c[_0x57d2('0x19')][_0x57d2('0x1c')]||null:null,'include':_0xb3051c[_0x57d2('0x19')]?_0xb3051c[_0x57d2('0x19')]['include']?_['map'](_0xb3051c['options']['include'],function(_0x371939){return{'model':db[_0x371939[_0x57d2('0x20')]],'as':_0x371939['as'],'attributes':_0x371939[_0x57d2('0x1c')],'include':_0x371939[_0x57d2('0x1e')]?_[_0x57d2('0x1f')](_0x371939['include'],function(_0x375a83){return{'model':db[_0x375a83['model']],'as':_0x375a83['as'],'attributes':_0x375a83[_0x57d2('0x1c')],'include':_0x375a83[_0x57d2('0x1e')]?_[_0x57d2('0x1f')](_0x375a83['include'],function(_0x38a223){return{'model':db[_0x38a223[_0x57d2('0x20')]],'as':_0x38a223['as'],'attributes':_0x38a223['attributes']};}):[]};}):[]};}):[]:[]})[_0x57d2('0xc')](function(_0x28c52d){logger[_0x57d2('0xd')](_0x57d2('0x22'),_0xb3051c);logger[_0x57d2('0x10')](_0x57d2('0x22'),_0xb3051c,JSON['stringify'](_0x28c52d));_0x3cbc4b(_0x28c52d);})[_0x57d2('0x21')](function(_0x53c2e0){logger[_0x57d2('0x13')](_0x57d2('0x22'),_0x53c2e0[_0x57d2('0x15')],_0xb3051c);_0x36c0d7(_0x40f3f2[_0x57d2('0x13')](0x1f4,_0x53c2e0[_0x57d2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 9edbca5..e141664 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 _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x5293b7,_0x63b44){var _0x4bacff=function(_0x2930fe){while(--_0x2930fe){_0x5293b7['push'](_0x5293b7['shift']());}};_0x4bacff(++_0x63b44);}(_0x4b84,0x1cc));var _0x44b8=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0x4b84[_0x22c684];return _0x39fcbb;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file +var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0xfca472,_0x1325e7){var _0x24f1b3=function(_0x3f6d2a){while(--_0x3f6d2a){_0xfca472['push'](_0xfca472['shift']());}};_0x24f1b3(++_0x1325e7);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xdea5b0,_0x28830f){_0xdea5b0=_0xdea5b0-0x0;var _0x5d10ac=_0x4c6d[_0xdea5b0];return _0x5d10ac;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5a35f25..afe8152 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4bf4d5,_0x56efd2){var _0x4cc49d=function(_0x686d07){while(--_0x686d07){_0x4bf4d5['push'](_0x4bf4d5['shift']());}};_0x4cc49d(++_0x56efd2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +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(_0x2163f0,_0x4540ee){var _0x5a3a5f=function(_0x4f7b66){while(--_0x4f7b66){_0x2163f0['push'](_0x2163f0['shift']());}};_0x5a3a5f(++_0x4540ee);}(_0x814b,0x1a2));var _0xb814=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x814b[_0x59ae8f];return _0x3900b5;};'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 695dc7d..fdb7174 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 _0x1c28=['exports','STRING','DATE','sequelize'];(function(_0x153648,_0x1bf468){var _0x3390d1=function(_0x514397){while(--_0x514397){_0x153648['push'](_0x153648['shift']());}};_0x3390d1(++_0x1bf468);}(_0x1c28,0xfb));var _0x81c2=function(_0x224366,_0x403688){_0x224366=_0x224366-0x0;var _0x4de6d8=_0x1c28[_0x224366];return _0x4de6d8;};'use strict';var moment=require('moment');var Sequelize=require(_0x81c2('0x0'));module[_0x81c2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x81c2('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x81c2('0x3')]},'acceptAt':{'type':Sequelize[_0x81c2('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x81c2('0x2')]}}; \ No newline at end of file +var _0x771d=['exports','STRING','DATE','moment','sequelize'];(function(_0x33a7f4,_0x4d7bf9){var _0x36b9f4=function(_0x1e2d50){while(--_0x1e2d50){_0x33a7f4['push'](_0x33a7f4['shift']());}};_0x36b9f4(++_0x4d7bf9);}(_0x771d,0xd5));var _0xd771=function(_0x156e66,_0x48c90f){_0x156e66=_0x156e66-0x0;var _0x102fa0=_0x771d[_0x156e66];return _0x102fa0;};'use strict';var moment=require(_0xd771('0x0'));var Sequelize=require(_0xd771('0x1'));module[_0xd771('0x2')]={'uniqueid':{'type':Sequelize[_0xd771('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd771('0x3')]},'joinAt':{'type':Sequelize[_0xd771('0x4')]},'leaveAt':{'type':Sequelize[_0xd771('0x4')]},'acceptAt':{'type':Sequelize[_0xd771('0x4')]},'exitAt':{'type':Sequelize[_0xd771('0x4')]},'reason':{'type':Sequelize[_0xd771('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 70a6b32..f71c1e6 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 _0x374c=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x374c,0x1e3));var _0xc374=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x374c[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc374('0x0'));var zipdir=require(_0xc374('0x1'));var jsonpatch=require(_0xc374('0x2'));var rp=require(_0xc374('0x3'));var moment=require(_0xc374('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc374('0x5'));var util=require('util');var path=require(_0xc374('0x6'));var sox=require(_0xc374('0x7'));var csv=require('to-csv');var ejs=require(_0xc374('0x8'));var fs=require('fs');var fs_extra=require(_0xc374('0x9'));var _=require(_0xc374('0xa'));var squel=require(_0xc374('0xb'));var crypto=require(_0xc374('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc374('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc374('0xe'));var Redis=require(_0xc374('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc374('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc374('0x11'));var logger=require(_0xc374('0x12'))(_0xc374('0x13'));var utils=require('../../config/utils');var config=require(_0xc374('0x14'));var licenseUtil=require(_0xc374('0x15'));var db=require(_0xc374('0x16'))['db'];function respondWithStatusCode(_0x5e0f82,_0x44eba3){_0x44eba3=_0x44eba3||0xcc;return function(_0x30bde){if(_0x30bde){return _0x5e0f82[_0xc374('0x17')](_0x44eba3);}return _0x5e0f82['status'](_0x44eba3)[_0xc374('0x18')]();};}function respondWithResult(_0x47a7bf,_0xae92ab){_0xae92ab=_0xae92ab||0xc8;return function(_0x1f472b){if(_0x1f472b){return _0x47a7bf['status'](_0xae92ab)[_0xc374('0x19')](_0x1f472b);}};}function respondWithFilteredResult(_0x3f868a,_0x4109ec){return function(_0x198919){if(_0x198919){var _0x1178a1=typeof _0x4109ec[_0xc374('0x1a')]===_0xc374('0x1b')&&typeof _0x4109ec[_0xc374('0x1c')]===_0xc374('0x1b');var _0x1c3784=_0x198919[_0xc374('0x1d')];var _0x5957c5=_0x1178a1?0x0:_0x4109ec[_0xc374('0x1a')];var _0x3553bb=_0x1178a1?_0x198919[_0xc374('0x1d')]:_0x4109ec['offset']+_0x4109ec[_0xc374('0x1c')];var _0x16c7de;if(_0x3553bb>=_0x1c3784){_0x3553bb=_0x1c3784;_0x16c7de=0xc8;}else{_0x16c7de=0xce;}_0x3f868a['status'](_0x16c7de);return _0x3f868a['set'](_0xc374('0x1e'),_0x5957c5+'-'+_0x3553bb+'/'+_0x1c3784)[_0xc374('0x19')](_0x198919);}return null;};}function patchUpdates(_0x4110bf){return function(_0x2beb98){try{jsonpatch['apply'](_0x2beb98,_0x4110bf,!![]);}catch(_0xa65465){return BPromise[_0xc374('0x1f')](_0xa65465);}return _0x2beb98[_0xc374('0x20')]();};}function saveUpdates(_0x16959d,_0x3cbbad){return function(_0x33c61d){if(_0x33c61d){return _0x33c61d[_0xc374('0x21')](_0x16959d)[_0xc374('0x22')](function(_0x2b7fa6){return _0x2b7fa6;});}return null;};}function removeEntity(_0x18699e,_0x4110a5){return function(_0x5b92c6){if(_0x5b92c6){return _0x5b92c6[_0xc374('0x23')]()[_0xc374('0x22')](function(){_0x18699e[_0xc374('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fe1,_0x3d4fb3){return function(_0x19c668){if(!_0x19c668){_0x460fe1[_0xc374('0x17')](0x194);}return _0x19c668;};}function handleError(_0x52d69c,_0x5c6d3e){_0x5c6d3e=_0x5c6d3e||0x1f4;return function(_0x4ad849){logger[_0xc374('0x25')](_0x4ad849[_0xc374('0x26')]);if(_0x4ad849[_0xc374('0x27')]){delete _0x4ad849['name'];}_0x52d69c[_0xc374('0x24')](_0x5c6d3e)['send'](_0x4ad849);};}exports[_0xc374('0x28')]=function(_0xbd1d3d,_0x434c44){var _0x31ae09={},_0x2a87f2={},_0xb7cc5={'count':0x0,'rows':[]};var _0x10b1a0=_[_0xc374('0x29')](db['ChatQueueReport'][_0xc374('0x2a')],function(_0x48aa6f){return{'name':_0x48aa6f[_0xc374('0x2b')],'type':_0x48aa6f[_0xc374('0x2c')][_0xc374('0x2d')]};});_0x2a87f2[_0xc374('0x2e')]=_['map'](_0x10b1a0,_0xc374('0x27'));_0x2a87f2['query']=_[_0xc374('0x2f')](_0xbd1d3d[_0xc374('0x30')]);_0x2a87f2[_0xc374('0x31')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],_0x2a87f2[_0xc374('0x30')]);_0x31ae09[_0xc374('0x33')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],qs[_0xc374('0x34')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x34')]));_0x31ae09['attributes']=_0x31ae09[_0xc374('0x33')]['length']?_0x31ae09[_0xc374('0x33')]:_0x2a87f2[_0xc374('0x2e')];if(!_0xbd1d3d[_0xc374('0x30')]['hasOwnProperty'](_0xc374('0x35'))){_0x31ae09[_0xc374('0x1c')]=qs['limit'](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1c')]);_0x31ae09[_0xc374('0x1a')]=qs[_0xc374('0x1a')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1a')]);}_0x31ae09[_0xc374('0x36')]=qs['sort'](_0xbd1d3d['query']['sort']);_0x31ae09[_0xc374('0x37')]=qs[_0xc374('0x31')](_[_0xc374('0x38')](_0xbd1d3d[_0xc374('0x30')],_0x2a87f2['filters']),_0x10b1a0);if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x39')]){_0x31ae09[_0xc374('0x37')]=_[_0xc374('0x3a')](_0x31ae09['where'],{'$or':_['map'](_0x10b1a0,function(_0x53cc84){if(_0x53cc84[_0xc374('0x2c')]!==_0xc374('0x3b')){var _0x5c4011={};_0x5c4011[_0x53cc84[_0xc374('0x27')]]={'$like':'%'+_0xbd1d3d[_0xc374('0x30')]['filter']+'%'};return _0x5c4011;}})});}_0x31ae09=_[_0xc374('0x3a')]({},_0x31ae09,_0xbd1d3d['options']);var _0x5baff8={'where':_0x31ae09[_0xc374('0x37')]};return db[_0xc374('0x3c')][_0xc374('0x1d')](_0x5baff8)[_0xc374('0x22')](function(_0x39b59f){_0xb7cc5['count']=_0x39b59f;if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x3d')]){_0x31ae09[_0xc374('0x3e')]=[{'all':!![]}];}return db[_0xc374('0x3c')][_0xc374('0x3f')](_0x31ae09);})[_0xc374('0x22')](function(_0x39225c){_0xb7cc5['rows']=_0x39225c;return _0xb7cc5;})[_0xc374('0x22')](respondWithFilteredResult(_0x434c44,_0x31ae09))['catch'](handleError(_0x434c44,null));};exports[_0xc374('0x40')]=function(_0x4f5e44,_0x59e86d){var _0x3abfe5={'raw':!![],'where':{'id':_0x4f5e44[_0xc374('0x41')]['id']}},_0xb4b71b={};_0xb4b71b['model']=_[_0xc374('0x2f')](db[_0xc374('0x3c')]['rawAttributes']);_0xb4b71b[_0xc374('0x30')]=_[_0xc374('0x2f')](_0x4f5e44[_0xc374('0x30')]);_0xb4b71b[_0xc374('0x31')]=_[_0xc374('0x32')](_0xb4b71b[_0xc374('0x2e')],_0xb4b71b[_0xc374('0x30')]);_0x3abfe5[_0xc374('0x33')]=_['intersection'](_0xb4b71b['model'],qs[_0xc374('0x34')](_0x4f5e44[_0xc374('0x30')]['fields']));_0x3abfe5[_0xc374('0x33')]=_0x3abfe5[_0xc374('0x33')]['length']?_0x3abfe5[_0xc374('0x33')]:_0xb4b71b[_0xc374('0x2e')];if(_0x4f5e44[_0xc374('0x30')][_0xc374('0x3d')]){_0x3abfe5[_0xc374('0x3e')]=[{'all':!![]}];}_0x3abfe5=_[_0xc374('0x3a')]({},_0x3abfe5,_0x4f5e44[_0xc374('0x42')]);return db[_0xc374('0x3c')][_0xc374('0x43')](_0x3abfe5)[_0xc374('0x22')](handleEntityNotFound(_0x59e86d,null))['then'](respondWithResult(_0x59e86d,null))[_0xc374('0x44')](handleError(_0x59e86d,null));};exports['create']=function(_0x45a599,_0x423d05){return db['ChatQueueReport'][_0xc374('0x45')](_0x45a599[_0xc374('0x46')],{})[_0xc374('0x22')](respondWithResult(_0x423d05,0xc9))[_0xc374('0x44')](handleError(_0x423d05,null));};exports[_0xc374('0x21')]=function(_0x549b95,_0x42d0cc){if(_0x549b95[_0xc374('0x46')]['id']){delete _0x549b95[_0xc374('0x46')]['id'];}return db['ChatQueueReport'][_0xc374('0x43')]({'where':{'id':_0x549b95['params']['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x42d0cc,null))[_0xc374('0x22')](saveUpdates(_0x549b95[_0xc374('0x46')],null))['then'](respondWithResult(_0x42d0cc,null))[_0xc374('0x44')](handleError(_0x42d0cc,null));};exports['destroy']=function(_0x1cf1cf,_0x3d001b){return db[_0xc374('0x3c')][_0xc374('0x43')]({'where':{'id':_0x1cf1cf[_0xc374('0x41')]['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x3d001b,null))['then'](removeEntity(_0x3d001b,null))[_0xc374('0x44')](handleError(_0x3d001b,null));};exports['describe']=function(_0x3dba84,_0x3b63e5){return db[_0xc374('0x3c')][_0xc374('0x47')]()[_0xc374('0x22')](respondWithResult(_0x3b63e5,null))['catch'](handleError(_0x3b63e5,null));}; \ No newline at end of file +var _0x5353=['update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','error','stack','name','send','index','map','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','ChatQueueReport','findAll','rows','catch','show','params','include','create','body'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x5353,0x12f));var _0x3535=function(_0x3e43af,_0x20502e){_0x3e43af=_0x3e43af-0x0;var _0x2ac603=_0x5353[_0x3e43af];return _0x2ac603;};'use strict';var emlformat=require(_0x3535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3535('0x1'));var jsonpatch=require(_0x3535('0x2'));var rp=require(_0x3535('0x3'));var moment=require(_0x3535('0x4'));var BPromise=require(_0x3535('0x5'));var Mustache=require(_0x3535('0x6'));var util=require(_0x3535('0x7'));var path=require(_0x3535('0x8'));var sox=require(_0x3535('0x9'));var csv=require(_0x3535('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3535('0xb'));var _=require('lodash');var squel=require(_0x3535('0xc'));var crypto=require(_0x3535('0xd'));var jsforce=require(_0x3535('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3535('0xa'));var querystring=require(_0x3535('0xf'));var Papa=require(_0x3535('0x10'));var Redis=require(_0x3535('0x11'));var authService=require(_0x3535('0x12'));var qs=require(_0x3535('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3535('0x14'));var logger=require(_0x3535('0x15'))('api');var utils=require(_0x3535('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3535('0x17'))['db'];function respondWithStatusCode(_0xff9aa8,_0xe7c052){_0xe7c052=_0xe7c052||0xcc;return function(_0x46b5c1){if(_0x46b5c1){return _0xff9aa8[_0x3535('0x18')](_0xe7c052);}return _0xff9aa8[_0x3535('0x19')](_0xe7c052)[_0x3535('0x1a')]();};}function respondWithResult(_0x5115bd,_0x2f4e64){_0x2f4e64=_0x2f4e64||0xc8;return function(_0x501016){if(_0x501016){return _0x5115bd[_0x3535('0x19')](_0x2f4e64)[_0x3535('0x1b')](_0x501016);}};}function respondWithFilteredResult(_0xf87404,_0x4c704f){return function(_0x1f18da){if(_0x1f18da){var _0x4b7c81=typeof _0x4c704f[_0x3535('0x1c')]==='undefined'&&typeof _0x4c704f['limit']===_0x3535('0x1d');var _0x222937=_0x1f18da[_0x3535('0x1e')];var _0x298235=_0x4b7c81?0x0:_0x4c704f[_0x3535('0x1c')];var _0x2a1705=_0x4b7c81?_0x1f18da[_0x3535('0x1e')]:_0x4c704f[_0x3535('0x1c')]+_0x4c704f[_0x3535('0x1f')];var _0x1fca4f;if(_0x2a1705>=_0x222937){_0x2a1705=_0x222937;_0x1fca4f=0xc8;}else{_0x1fca4f=0xce;}_0xf87404[_0x3535('0x19')](_0x1fca4f);return _0xf87404[_0x3535('0x20')]('Content-Range',_0x298235+'-'+_0x2a1705+'/'+_0x222937)['json'](_0x1f18da);}return null;};}function patchUpdates(_0xfea414){return function(_0x4e76c5){try{jsonpatch['apply'](_0x4e76c5,_0xfea414,!![]);}catch(_0x23f5b6){return BPromise[_0x3535('0x21')](_0x23f5b6);}return _0x4e76c5[_0x3535('0x22')]();};}function saveUpdates(_0x56db66,_0x52f0e3){return function(_0x3d73d2){if(_0x3d73d2){return _0x3d73d2['update'](_0x56db66)[_0x3535('0x23')](function(_0x542372){return _0x542372;});}return null;};}function removeEntity(_0x44fc44,_0x4d372e){return function(_0x450250){if(_0x450250){return _0x450250['destroy']()['then'](function(){_0x44fc44[_0x3535('0x19')](0xcc)[_0x3535('0x1a')]();});}};}function handleEntityNotFound(_0x5a25d1,_0x14e803){return function(_0x213f35){if(!_0x213f35){_0x5a25d1[_0x3535('0x18')](0x194);}return _0x213f35;};}function handleError(_0xefa28c,_0x51ba08){_0x51ba08=_0x51ba08||0x1f4;return function(_0x2bbe00){logger[_0x3535('0x24')](_0x2bbe00[_0x3535('0x25')]);if(_0x2bbe00[_0x3535('0x26')]){delete _0x2bbe00[_0x3535('0x26')];}_0xefa28c[_0x3535('0x19')](_0x51ba08)[_0x3535('0x27')](_0x2bbe00);};}exports[_0x3535('0x28')]=function(_0x4c993a,_0x167e64){var _0x17e2a0={},_0x4cf180={},_0x2594d7={'count':0x0,'rows':[]};var _0x2a84e0=_[_0x3535('0x29')](db['ChatQueueReport']['rawAttributes'],function(_0x3e8a1e){return{'name':_0x3e8a1e[_0x3535('0x2a')],'type':_0x3e8a1e['type'][_0x3535('0x2b')]};});_0x4cf180[_0x3535('0x2c')]=_[_0x3535('0x29')](_0x2a84e0,_0x3535('0x26'));_0x4cf180['query']=_[_0x3535('0x2d')](_0x4c993a[_0x3535('0x2e')]);_0x4cf180['filters']=_[_0x3535('0x2f')](_0x4cf180[_0x3535('0x2c')],_0x4cf180[_0x3535('0x2e')]);_0x17e2a0[_0x3535('0x30')]=_[_0x3535('0x2f')](_0x4cf180[_0x3535('0x2c')],qs[_0x3535('0x31')](_0x4c993a['query']['fields']));_0x17e2a0[_0x3535('0x30')]=_0x17e2a0[_0x3535('0x30')][_0x3535('0x32')]?_0x17e2a0[_0x3535('0x30')]:_0x4cf180[_0x3535('0x2c')];if(!_0x4c993a[_0x3535('0x2e')][_0x3535('0x33')](_0x3535('0x34'))){_0x17e2a0['limit']=qs[_0x3535('0x1f')](_0x4c993a[_0x3535('0x2e')][_0x3535('0x1f')]);_0x17e2a0[_0x3535('0x1c')]=qs[_0x3535('0x1c')](_0x4c993a[_0x3535('0x2e')]['offset']);}_0x17e2a0[_0x3535('0x35')]=qs['sort'](_0x4c993a[_0x3535('0x2e')][_0x3535('0x36')]);_0x17e2a0['where']=qs[_0x3535('0x37')](_[_0x3535('0x38')](_0x4c993a[_0x3535('0x2e')],_0x4cf180[_0x3535('0x37')]),_0x2a84e0);if(_0x4c993a['query']['filter']){_0x17e2a0[_0x3535('0x39')]=_[_0x3535('0x3a')](_0x17e2a0[_0x3535('0x39')],{'$or':_[_0x3535('0x29')](_0x2a84e0,function(_0x32d907){if(_0x32d907[_0x3535('0x3b')]!==_0x3535('0x3c')){var _0x396fd9={};_0x396fd9[_0x32d907[_0x3535('0x26')]]={'$like':'%'+_0x4c993a[_0x3535('0x2e')][_0x3535('0x3d')]+'%'};return _0x396fd9;}})});}_0x17e2a0=_[_0x3535('0x3a')]({},_0x17e2a0,_0x4c993a['options']);var _0x46aabb={'where':_0x17e2a0[_0x3535('0x39')]};return db['ChatQueueReport'][_0x3535('0x1e')](_0x46aabb)[_0x3535('0x23')](function(_0x5c4c2f){_0x2594d7[_0x3535('0x1e')]=_0x5c4c2f;if(_0x4c993a[_0x3535('0x2e')][_0x3535('0x3e')]){_0x17e2a0['include']=[{'all':!![]}];}return db[_0x3535('0x3f')][_0x3535('0x40')](_0x17e2a0);})[_0x3535('0x23')](function(_0x5258cc){_0x2594d7[_0x3535('0x41')]=_0x5258cc;return _0x2594d7;})[_0x3535('0x23')](respondWithFilteredResult(_0x167e64,_0x17e2a0))[_0x3535('0x42')](handleError(_0x167e64,null));};exports[_0x3535('0x43')]=function(_0x6c896c,_0x139ed6){var _0x347777={'raw':!![],'where':{'id':_0x6c896c[_0x3535('0x44')]['id']}},_0x2d12cc={};_0x2d12cc[_0x3535('0x2c')]=_[_0x3535('0x2d')](db[_0x3535('0x3f')]['rawAttributes']);_0x2d12cc[_0x3535('0x2e')]=_['keys'](_0x6c896c[_0x3535('0x2e')]);_0x2d12cc['filters']=_[_0x3535('0x2f')](_0x2d12cc[_0x3535('0x2c')],_0x2d12cc[_0x3535('0x2e')]);_0x347777[_0x3535('0x30')]=_[_0x3535('0x2f')](_0x2d12cc['model'],qs[_0x3535('0x31')](_0x6c896c[_0x3535('0x2e')]['fields']));_0x347777[_0x3535('0x30')]=_0x347777[_0x3535('0x30')][_0x3535('0x32')]?_0x347777[_0x3535('0x30')]:_0x2d12cc[_0x3535('0x2c')];if(_0x6c896c[_0x3535('0x2e')]['includeAll']){_0x347777[_0x3535('0x45')]=[{'all':!![]}];}_0x347777=_[_0x3535('0x3a')]({},_0x347777,_0x6c896c['options']);return db[_0x3535('0x3f')]['find'](_0x347777)[_0x3535('0x23')](handleEntityNotFound(_0x139ed6,null))[_0x3535('0x23')](respondWithResult(_0x139ed6,null))[_0x3535('0x42')](handleError(_0x139ed6,null));};exports[_0x3535('0x46')]=function(_0x2d8769,_0x45eb1b){return db[_0x3535('0x3f')][_0x3535('0x46')](_0x2d8769[_0x3535('0x47')],{})[_0x3535('0x23')](respondWithResult(_0x45eb1b,0xc9))[_0x3535('0x42')](handleError(_0x45eb1b,null));};exports[_0x3535('0x48')]=function(_0x5c881d,_0x2bd81b){if(_0x5c881d[_0x3535('0x47')]['id']){delete _0x5c881d[_0x3535('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5c881d[_0x3535('0x44')]['id']}})[_0x3535('0x23')](handleEntityNotFound(_0x2bd81b,null))[_0x3535('0x23')](saveUpdates(_0x5c881d[_0x3535('0x47')],null))[_0x3535('0x23')](respondWithResult(_0x2bd81b,null))[_0x3535('0x42')](handleError(_0x2bd81b,null));};exports['destroy']=function(_0x1f17ed,_0x399f30){return db[_0x3535('0x3f')][_0x3535('0x49')]({'where':{'id':_0x1f17ed['params']['id']}})['then'](handleEntityNotFound(_0x399f30,null))['then'](removeEntity(_0x399f30,null))[_0x3535('0x42')](handleError(_0x399f30,null));};exports[_0x3535('0x4a')]=function(_0x10d4e6,_0x1c17f4){return db[_0x3535('0x3f')][_0x3535('0x4a')]()[_0x3535('0x23')](respondWithResult(_0x1c17f4,null))[_0x3535('0x42')](handleError(_0x1c17f4,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 1975d3a..324a740 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x170a9e,_0x1d569a){var _0x348728=function(_0x8eaa2e){while(--_0x8eaa2e){_0x170a9e['push'](_0x170a9e['shift']());}};_0x348728(++_0x1d569a);}(_0x757a,0xde));var _0xa757=function(_0x508fd2,_0x1d0e8e){_0x508fd2=_0x508fd2-0x0;var _0x19ecd8=_0x757a[_0x508fd2];return _0x19ecd8;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2fc4e6,_0x2b6a85){var _0x2c9889=function(_0x1f60b9){while(--_0x1f60b9){_0x2fc4e6['push'](_0x2fc4e6['shift']());}};_0x2c9889(++_0x2b6a85);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index ecb30d1..05e236b 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 _0x04fa=['catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','UpdateChatQueueReport','options','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x618880,_0x16ab63){var _0x2ce8de=function(_0x573c5d){while(--_0x573c5d){_0x618880['push'](_0x618880['shift']());}};_0x2ce8de(++_0x16ab63);}(_0x04fa,0x119));var _0xa04f=function(_0x3d3d75,_0x593f53){_0x3d3d75=_0x3d3d75-0x0;var _0xe990a1=_0x04fa[_0x3d3d75];return _0xe990a1;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var moment=require(_0xa04f('0x1'));var BPromise=require(_0xa04f('0x2'));var rs=require(_0xa04f('0x3'));var fs=require('fs');var Redis=require(_0xa04f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa04f('0x5'));var logger=require('../../config/logger')(_0xa04f('0x6'));var config=require(_0xa04f('0x7'));var jayson=require(_0xa04f('0x8'));var client=jayson['client'][_0xa04f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c521c,_0x315771,_0x56f898){return new BPromise(function(_0x303e54,_0x4a2e03){return client['request'](_0x2c521c,_0x56f898)['then'](function(_0x5ea498){logger[_0xa04f('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x315771,'request\x20sent');logger[_0xa04f('0xb')](_0xa04f('0xc'),_0x315771,'request\x20sent',JSON[_0xa04f('0xd')](_0x5ea498));if(_0x5ea498['error']){if(_0x5ea498[_0xa04f('0xe')][_0xa04f('0xf')]===0x1f4){logger['error'](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')]['message']);return _0x4a2e03(_0x5ea498['error']['message']);}logger[_0xa04f('0xe')](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);return _0x303e54(_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);}else{logger['info'](_0xa04f('0x10'),_0x315771,_0xa04f('0x12'));_0x303e54(_0x5ea498['result'][_0xa04f('0x11')]);}})[_0xa04f('0x13')](function(_0x505abc){logger[_0xa04f('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x315771,_0x505abc);_0x4a2e03(_0x505abc);});});}exports[_0xa04f('0x14')]=function(_0x5d59d5){var _0x3252a1=this;return new Promise(function(_0x25bb59,_0x5d9bc9){return db[_0xa04f('0x15')][_0xa04f('0x16')](_0x5d59d5[_0xa04f('0x17')],{'raw':_0x5d59d5['options']?_0x5d59d5['options'][_0xa04f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5d68f4){logger[_0xa04f('0xa')](_0xa04f('0x14'),_0x5d59d5);logger['debug']('CreateChatQueueReport',_0x5d59d5,JSON[_0xa04f('0xd')](_0x5d68f4));_0x25bb59(_0x5d68f4);})[_0xa04f('0x13')](function(_0x17d471){logger[_0xa04f('0xe')](_0xa04f('0x14'),_0x17d471[_0xa04f('0x11')],_0x5d59d5);_0x5d9bc9(_0x3252a1[_0xa04f('0xe')](0x1f4,_0x17d471[_0xa04f('0x11')]));});});};exports[_0xa04f('0x19')]=function(_0x3ee16d){var _0x3f6cab=this;return new Promise(function(_0x1b1dad,_0x10ae93){return db[_0xa04f('0x15')]['update'](_0x3ee16d[_0xa04f('0x17')],{'raw':_0x3ee16d[_0xa04f('0x1a')]?_0x3ee16d[_0xa04f('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ee16d['options']?_0x3ee16d[_0xa04f('0x1a')][_0xa04f('0x1b')]||null:null,'attributes':_0x3ee16d[_0xa04f('0x1a')]?_0x3ee16d['options'][_0xa04f('0x1c')]||null:null,'limit':_0x3ee16d[_0xa04f('0x1a')]?_0x3ee16d[_0xa04f('0x1a')]['limit']||null:null})[_0xa04f('0x1d')](function(_0x1c0cc5){logger[_0xa04f('0xa')](_0xa04f('0x19'),_0x3ee16d);logger[_0xa04f('0xb')](_0xa04f('0x19'),_0x3ee16d,JSON[_0xa04f('0xd')](_0x1c0cc5));_0x1b1dad(_0x1c0cc5);})['catch'](function(_0x406131){logger[_0xa04f('0xe')]('UpdateChatQueueReport',_0x406131['message'],_0x3ee16d);_0x10ae93(_0x3f6cab[_0xa04f('0xe')](0x1f4,_0x406131[_0xa04f('0x11')]));});});}; \ No newline at end of file +var _0xd94d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','update','limit','UpdateChatQueueReport','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xd94d,0x16f));var _0xdd94=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd94d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xdd94('0x0'));var moment=require(_0xdd94('0x1'));var BPromise=require(_0xdd94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd94('0x3'));var db=require(_0xdd94('0x4'))['db'];var utils=require(_0xdd94('0x5'));var logger=require(_0xdd94('0x6'))(_0xdd94('0x7'));var config=require(_0xdd94('0x8'));var jayson=require(_0xdd94('0x9'));var client=jayson['client'][_0xdd94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa08a87,_0x5649d2,_0x2d1991){return new BPromise(function(_0x216e61,_0x3c2358){return client[_0xdd94('0xb')](_0xa08a87,_0x2d1991)[_0xdd94('0xc')](function(_0x31654c){logger[_0xdd94('0xd')](_0xdd94('0xe'),_0x5649d2,'request\x20sent');logger['debug'](_0xdd94('0xf'),_0x5649d2,'request\x20sent',JSON[_0xdd94('0x10')](_0x31654c));if(_0x31654c[_0xdd94('0x11')]){if(_0x31654c['error']['code']===0x1f4){logger['error'](_0xdd94('0xe'),_0x5649d2,_0x31654c['error'][_0xdd94('0x12')]);return _0x3c2358(_0x31654c[_0xdd94('0x11')][_0xdd94('0x12')]);}logger[_0xdd94('0x11')](_0xdd94('0xe'),_0x5649d2,_0x31654c[_0xdd94('0x11')][_0xdd94('0x12')]);return _0x216e61(_0x31654c[_0xdd94('0x11')]['message']);}else{logger[_0xdd94('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x5649d2,_0xdd94('0x13'));_0x216e61(_0x31654c[_0xdd94('0x14')][_0xdd94('0x12')]);}})['catch'](function(_0x430b65){logger[_0xdd94('0x11')](_0xdd94('0xe'),_0x5649d2,_0x430b65);_0x3c2358(_0x430b65);});});}exports[_0xdd94('0x15')]=function(_0x321b2b){var _0x5ab4ad=this;return new Promise(function(_0x6600ba,_0x4db4c3){return db[_0xdd94('0x16')][_0xdd94('0x17')](_0x321b2b[_0xdd94('0x18')],{'raw':_0x321b2b[_0xdd94('0x19')]?_0x321b2b[_0xdd94('0x19')][_0xdd94('0x1a')]===undefined?!![]:![]:!![]})[_0xdd94('0xc')](function(_0x517c4e){logger[_0xdd94('0xd')](_0xdd94('0x15'),_0x321b2b);logger[_0xdd94('0x1b')](_0xdd94('0x15'),_0x321b2b,JSON[_0xdd94('0x10')](_0x517c4e));_0x6600ba(_0x517c4e);})['catch'](function(_0x5f4a9a){logger[_0xdd94('0x11')](_0xdd94('0x15'),_0x5f4a9a['message'],_0x321b2b);_0x4db4c3(_0x5ab4ad[_0xdd94('0x11')](0x1f4,_0x5f4a9a[_0xdd94('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x3a0f4c){var _0x37d0b1=this;return new Promise(function(_0x418e55,_0x55e9d2){return db['ChatQueueReport'][_0xdd94('0x1c')](_0x3a0f4c['body'],{'raw':_0x3a0f4c['options']?_0x3a0f4c['options'][_0xdd94('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a0f4c[_0xdd94('0x19')]?_0x3a0f4c[_0xdd94('0x19')]['where']||null:null,'attributes':_0x3a0f4c[_0xdd94('0x19')]?_0x3a0f4c[_0xdd94('0x19')]['attributes']||null:null,'limit':_0x3a0f4c[_0xdd94('0x19')]?_0x3a0f4c[_0xdd94('0x19')][_0xdd94('0x1d')]||null:null})[_0xdd94('0xc')](function(_0x4e6102){logger[_0xdd94('0xd')](_0xdd94('0x1e'),_0x3a0f4c);logger['debug'](_0xdd94('0x1e'),_0x3a0f4c,JSON[_0xdd94('0x10')](_0x4e6102));_0x418e55(_0x4e6102);})['catch'](function(_0x39d377){logger[_0xdd94('0x11')](_0xdd94('0x1e'),_0x39d377[_0xdd94('0x12')],_0x3a0f4c);_0x55e9d2(_0x37d0b1['error'](0x1f4,_0x39d377['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 704ea4a..d1438b7 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 _0x9ea0=['fs-extra','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x9910ec,_0x305971){var _0x1b1c9b=function(_0x9dc0dd){while(--_0x9dc0dd){_0x9910ec['push'](_0x9910ec['shift']());}};_0x1b1c9b(++_0x305971);}(_0x9ea0,0xa6));var _0x09ea=function(_0x219407,_0x36c620){_0x219407=_0x219407-0x0;var _0x240e77=_0x9ea0[_0x219407];return _0x240e77;};'use strict';var multer=require('multer');var util=require(_0x09ea('0x0'));var path=require(_0x09ea('0x1'));var timeout=require(_0x09ea('0x2'));var express=require('express');var router=express[_0x09ea('0x3')]();var fs_extra=require(_0x09ea('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09ea('0x5'));router['get']('/',auth[_0x09ea('0x6')](),controller['index']);router[_0x09ea('0x7')](_0x09ea('0x8'),auth['isAuthenticated'](),controller[_0x09ea('0x9')]);router[_0x09ea('0x7')](_0x09ea('0xa'),auth[_0x09ea('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x09ea('0xb')]);router[_0x09ea('0xc')](_0x09ea('0xa'),auth[_0x09ea('0x6')](),controller[_0x09ea('0xd')]);router[_0x09ea('0xe')](_0x09ea('0xa'),auth[_0x09ea('0x6')](),controller[_0x09ea('0xf')]);module[_0x09ea('0x10')]=router; \ No newline at end of file +var _0x5fd9=['../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create','delete','destroy','exports','multer','util','path','Router'];(function(_0x3069a6,_0x505399){var _0x4cf0a4=function(_0x37ca7d){while(--_0x37ca7d){_0x3069a6['push'](_0x3069a6['shift']());}};_0x4cf0a4(++_0x505399);}(_0x5fd9,0x8c));var _0x95fd=function(_0x513119,_0x425e6f){_0x513119=_0x513119-0x0;var _0x587511=_0x5fd9[_0x513119];return _0x587511;};'use strict';var multer=require(_0x95fd('0x0'));var util=require(_0x95fd('0x1'));var path=require(_0x95fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95fd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x95fd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x95fd('0x5'));var controller=require(_0x95fd('0x6'));router[_0x95fd('0x7')]('/',auth[_0x95fd('0x8')](),controller['index']);router['get'](_0x95fd('0x9'),auth[_0x95fd('0x8')](),controller['describe']);router[_0x95fd('0x7')](_0x95fd('0xa'),auth[_0x95fd('0x8')](),controller['show']);router[_0x95fd('0xb')]('/',auth[_0x95fd('0x8')](),controller[_0x95fd('0xc')]);router['put'](_0x95fd('0xa'),auth[_0x95fd('0x8')](),controller['update']);router[_0x95fd('0xd')](_0x95fd('0xa'),auth[_0x95fd('0x8')](),controller[_0x95fd('0xe')]);module[_0x95fd('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index c9db8cc..dc6cf01 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x16ab1a,_0x215490){var _0x3c82e1=function(_0x189be5){while(--_0x189be5){_0x16ab1a['push'](_0x16ab1a['shift']());}};_0x3c82e1(++_0x215490);}(_0x008c,0x188));var _0xc008=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0x008c[_0x1b9cd5];return _0x4c74ca;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x195456,_0x178217){var _0x13c560=function(_0x199dae){while(--_0x199dae){_0x195456['push'](_0x195456['shift']());}};_0x13c560(++_0x178217);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0xf3cd[_0x483d2a];return _0x5ba5d5;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index edbe966..241d410 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 _0x322c=['save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','length','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3b77bc,_0x2c2afe){var _0x2b9427=function(_0x32cf85){while(--_0x32cf85){_0x3b77bc['push'](_0x3b77bc['shift']());}};_0x2b9427(++_0x2c2afe);}(_0x322c,0x11b));var _0xc322=function(_0x3efdeb,_0x4d5455){_0x3efdeb=_0x3efdeb-0x0;var _0x360961=_0x322c[_0x3efdeb];return _0x360961;};'use strict';var emlformat=require(_0xc322('0x0'));var rimraf=require(_0xc322('0x1'));var zipdir=require(_0xc322('0x2'));var jsonpatch=require(_0xc322('0x3'));var rp=require(_0xc322('0x4'));var moment=require('moment');var BPromise=require(_0xc322('0x5'));var Mustache=require(_0xc322('0x6'));var util=require(_0xc322('0x7'));var path=require(_0xc322('0x8'));var sox=require(_0xc322('0x9'));var csv=require('to-csv');var ejs=require(_0xc322('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc322('0xb'));var squel=require(_0xc322('0xc'));var crypto=require(_0xc322('0xd'));var jsforce=require(_0xc322('0xe'));var deskjs=require(_0xc322('0xf'));var toCsv=require(_0xc322('0x10'));var querystring=require(_0xc322('0x11'));var Papa=require(_0xc322('0x12'));var Redis=require(_0xc322('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc322('0x14'));var as=require(_0xc322('0x15'));var hardwareService=require(_0xc322('0x16'));var logger=require('../../config/logger')(_0xc322('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc322('0x18'));var db=require(_0xc322('0x19'))['db'];function respondWithStatusCode(_0x5bfc60,_0x8a72dc){_0x8a72dc=_0x8a72dc||0xcc;return function(_0x290ad4){if(_0x290ad4){return _0x5bfc60['sendStatus'](_0x8a72dc);}return _0x5bfc60['status'](_0x8a72dc)[_0xc322('0x1a')]();};}function respondWithResult(_0x1b7fcf,_0x24293a){_0x24293a=_0x24293a||0xc8;return function(_0x12c428){if(_0x12c428){return _0x1b7fcf[_0xc322('0x1b')](_0x24293a)[_0xc322('0x1c')](_0x12c428);}};}function respondWithFilteredResult(_0x4152db,_0x36456b){return function(_0x2f2e5f){if(_0x2f2e5f){var _0x4ff175=typeof _0x36456b[_0xc322('0x1d')]===_0xc322('0x1e')&&typeof _0x36456b[_0xc322('0x1f')]===_0xc322('0x1e');var _0x5739d2=_0x2f2e5f[_0xc322('0x20')];var _0x44c530=_0x4ff175?0x0:_0x36456b[_0xc322('0x1d')];var _0x1be88e=_0x4ff175?_0x2f2e5f[_0xc322('0x20')]:_0x36456b[_0xc322('0x1d')]+_0x36456b[_0xc322('0x1f')];var _0x5b9813;if(_0x1be88e>=_0x5739d2){_0x1be88e=_0x5739d2;_0x5b9813=0xc8;}else{_0x5b9813=0xce;}_0x4152db[_0xc322('0x1b')](_0x5b9813);return _0x4152db[_0xc322('0x21')](_0xc322('0x22'),_0x44c530+'-'+_0x1be88e+'/'+_0x5739d2)[_0xc322('0x1c')](_0x2f2e5f);}return null;};}function patchUpdates(_0x41d28c){return function(_0x240de4){try{jsonpatch[_0xc322('0x23')](_0x240de4,_0x41d28c,!![]);}catch(_0xe4cdf0){return BPromise[_0xc322('0x24')](_0xe4cdf0);}return _0x240de4[_0xc322('0x25')]();};}function saveUpdates(_0x16158a,_0x32a2ca){return function(_0x3fec49){if(_0x3fec49){return _0x3fec49[_0xc322('0x26')](_0x16158a)['then'](function(_0x1aba3b){return _0x1aba3b;});}return null;};}function removeEntity(_0x34ead1,_0x5a373e){return function(_0x51fb79){if(_0x51fb79){return _0x51fb79[_0xc322('0x27')]()[_0xc322('0x28')](function(){_0x34ead1[_0xc322('0x1b')](0xcc)[_0xc322('0x1a')]();});}};}function handleEntityNotFound(_0x3098a7,_0xcf7dc8){return function(_0x12d8f9){if(!_0x12d8f9){_0x3098a7[_0xc322('0x29')](0x194);}return _0x12d8f9;};}function handleError(_0x154082,_0x5390ec){_0x5390ec=_0x5390ec||0x1f4;return function(_0x208b53){logger[_0xc322('0x2a')](_0x208b53[_0xc322('0x2b')]);if(_0x208b53[_0xc322('0x2c')]){delete _0x208b53['name'];}_0x154082[_0xc322('0x1b')](_0x5390ec)[_0xc322('0x2d')](_0x208b53);};}exports[_0xc322('0x2e')]=function(_0xb1f933,_0x5733a7){var _0x33b178={},_0x14fdfe={},_0x529854={'count':0x0,'rows':[]};var _0x590c6d=_[_0xc322('0x2f')](db[_0xc322('0x30')][_0xc322('0x31')],function(_0x301dd){return{'name':_0x301dd[_0xc322('0x32')],'type':_0x301dd['type'][_0xc322('0x33')]};});_0x14fdfe[_0xc322('0x34')]=_[_0xc322('0x2f')](_0x590c6d,_0xc322('0x2c'));_0x14fdfe['query']=_[_0xc322('0x35')](_0xb1f933['query']);_0x14fdfe[_0xc322('0x36')]=_[_0xc322('0x37')](_0x14fdfe['model'],_0x14fdfe[_0xc322('0x38')]);_0x33b178[_0xc322('0x39')]=_['intersection'](_0x14fdfe[_0xc322('0x34')],qs['fields'](_0xb1f933['query'][_0xc322('0x3a')]));_0x33b178[_0xc322('0x39')]=_0x33b178[_0xc322('0x39')]['length']?_0x33b178['attributes']:_0x14fdfe[_0xc322('0x34')];if(!_0xb1f933[_0xc322('0x38')][_0xc322('0x3b')](_0xc322('0x3c'))){_0x33b178['limit']=qs['limit'](_0xb1f933[_0xc322('0x38')][_0xc322('0x1f')]);_0x33b178[_0xc322('0x1d')]=qs[_0xc322('0x1d')](_0xb1f933[_0xc322('0x38')]['offset']);}_0x33b178[_0xc322('0x3d')]=qs[_0xc322('0x3e')](_0xb1f933[_0xc322('0x38')]['sort']);_0x33b178[_0xc322('0x3f')]=qs[_0xc322('0x36')](_[_0xc322('0x40')](_0xb1f933[_0xc322('0x38')],_0x14fdfe[_0xc322('0x36')]),_0x590c6d);if(_0xb1f933[_0xc322('0x38')]['filter']){_0x33b178[_0xc322('0x3f')]=_[_0xc322('0x41')](_0x33b178['where'],{'$or':_[_0xc322('0x2f')](_0x590c6d,function(_0x1c6ccd){if(_0x1c6ccd[_0xc322('0x42')]!==_0xc322('0x43')){var _0x5ca07d={};_0x5ca07d[_0x1c6ccd['name']]={'$like':'%'+_0xb1f933[_0xc322('0x38')][_0xc322('0x44')]+'%'};return _0x5ca07d;}})});}_0x33b178=_[_0xc322('0x41')]({},_0x33b178,_0xb1f933[_0xc322('0x45')]);var _0x8bb0a2={'where':_0x33b178[_0xc322('0x3f')]};return db[_0xc322('0x30')][_0xc322('0x20')](_0x8bb0a2)['then'](function(_0x5d2221){_0x529854[_0xc322('0x20')]=_0x5d2221;if(_0xb1f933[_0xc322('0x38')][_0xc322('0x46')]){_0x33b178['include']=[{'all':!![]}];}return db[_0xc322('0x30')][_0xc322('0x47')](_0x33b178);})['then'](function(_0x2e525b){_0x529854['rows']=_0x2e525b;return _0x529854;})[_0xc322('0x28')](respondWithFilteredResult(_0x5733a7,_0x33b178))[_0xc322('0x48')](handleError(_0x5733a7,null));};exports['show']=function(_0x2a6a5c,_0x408687){var _0xd52440={'raw':!![],'where':{'id':_0x2a6a5c['params']['id']}},_0x5f4a6b={};_0x5f4a6b[_0xc322('0x34')]=_[_0xc322('0x35')](db['ChatTransferReport'][_0xc322('0x31')]);_0x5f4a6b[_0xc322('0x38')]=_[_0xc322('0x35')](_0x2a6a5c['query']);_0x5f4a6b[_0xc322('0x36')]=_[_0xc322('0x37')](_0x5f4a6b[_0xc322('0x34')],_0x5f4a6b['query']);_0xd52440[_0xc322('0x39')]=_[_0xc322('0x37')](_0x5f4a6b[_0xc322('0x34')],qs[_0xc322('0x3a')](_0x2a6a5c['query'][_0xc322('0x3a')]));_0xd52440['attributes']=_0xd52440['attributes'][_0xc322('0x49')]?_0xd52440[_0xc322('0x39')]:_0x5f4a6b[_0xc322('0x34')];if(_0x2a6a5c['query'][_0xc322('0x46')]){_0xd52440[_0xc322('0x4a')]=[{'all':!![]}];}_0xd52440=_[_0xc322('0x41')]({},_0xd52440,_0x2a6a5c['options']);return db[_0xc322('0x30')][_0xc322('0x4b')](_0xd52440)[_0xc322('0x28')](handleEntityNotFound(_0x408687,null))[_0xc322('0x28')](respondWithResult(_0x408687,null))[_0xc322('0x48')](handleError(_0x408687,null));};exports['create']=function(_0x423eeb,_0x497b35){return db[_0xc322('0x30')][_0xc322('0x4c')](_0x423eeb[_0xc322('0x4d')],{})['then'](respondWithResult(_0x497b35,0xc9))[_0xc322('0x48')](handleError(_0x497b35,null));};exports['update']=function(_0x8429a2,_0x3304d){if(_0x8429a2[_0xc322('0x4d')]['id']){delete _0x8429a2[_0xc322('0x4d')]['id'];}return db[_0xc322('0x30')]['find']({'where':{'id':_0x8429a2['params']['id']}})[_0xc322('0x28')](handleEntityNotFound(_0x3304d,null))[_0xc322('0x28')](saveUpdates(_0x8429a2['body'],null))[_0xc322('0x28')](respondWithResult(_0x3304d,null))[_0xc322('0x48')](handleError(_0x3304d,null));};exports[_0xc322('0x27')]=function(_0x8a1a7,_0x342fa2){return db['ChatTransferReport'][_0xc322('0x4b')]({'where':{'id':_0x8a1a7[_0xc322('0x4e')]['id']}})[_0xc322('0x28')](handleEntityNotFound(_0x342fa2,null))['then'](removeEntity(_0x342fa2,null))['catch'](handleError(_0x342fa2,null));};exports[_0xc322('0x4f')]=function(_0x38f40f,_0x40e1bb){return db[_0xc322('0x30')]['describe']()[_0xc322('0x28')](respondWithResult(_0x40e1bb,null))[_0xc322('0x48')](handleError(_0x40e1bb,null));}; \ No newline at end of file +var _0xffae=['map','ChatTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','error','stack','name','index'];(function(_0x4ed327,_0x5d7d2f){var _0x65e35c=function(_0x33b145){while(--_0x33b145){_0x4ed327['push'](_0x4ed327['shift']());}};_0x65e35c(++_0x5d7d2f);}(_0xffae,0xe5));var _0xeffa=function(_0x3704ea,_0x449e14){_0x3704ea=_0x3704ea-0x0;var _0x38a4ff=_0xffae[_0x3704ea];return _0x38a4ff;};'use strict';var emlformat=require(_0xeffa('0x0'));var rimraf=require(_0xeffa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeffa('0x2'));var rp=require(_0xeffa('0x3'));var moment=require(_0xeffa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeffa('0x5'));var util=require('util');var path=require(_0xeffa('0x6'));var sox=require(_0xeffa('0x7'));var csv=require(_0xeffa('0x8'));var ejs=require(_0xeffa('0x9'));var fs=require('fs');var fs_extra=require(_0xeffa('0xa'));var _=require('lodash');var squel=require(_0xeffa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeffa('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeffa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeffa('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeffa('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xeffa('0x10'));var licenseUtil=require(_0xeffa('0x11'));var db=require(_0xeffa('0x12'))['db'];function respondWithStatusCode(_0x3d2e44,_0x52ab48){_0x52ab48=_0x52ab48||0xcc;return function(_0xc7c1e2){if(_0xc7c1e2){return _0x3d2e44[_0xeffa('0x13')](_0x52ab48);}return _0x3d2e44[_0xeffa('0x14')](_0x52ab48)[_0xeffa('0x15')]();};}function respondWithResult(_0x37cf52,_0xc56b03){_0xc56b03=_0xc56b03||0xc8;return function(_0x5f5cda){if(_0x5f5cda){return _0x37cf52[_0xeffa('0x14')](_0xc56b03)['json'](_0x5f5cda);}};}function respondWithFilteredResult(_0x5edaa9,_0xb0b25c){return function(_0x30fa0c){if(_0x30fa0c){var _0x8358b9=typeof _0xb0b25c[_0xeffa('0x16')]===_0xeffa('0x17')&&typeof _0xb0b25c['limit']===_0xeffa('0x17');var _0x5b0639=_0x30fa0c[_0xeffa('0x18')];var _0x24ef7a=_0x8358b9?0x0:_0xb0b25c['offset'];var _0x213cca=_0x8358b9?_0x30fa0c[_0xeffa('0x18')]:_0xb0b25c[_0xeffa('0x16')]+_0xb0b25c[_0xeffa('0x19')];var _0x481b7b;if(_0x213cca>=_0x5b0639){_0x213cca=_0x5b0639;_0x481b7b=0xc8;}else{_0x481b7b=0xce;}_0x5edaa9['status'](_0x481b7b);return _0x5edaa9[_0xeffa('0x1a')](_0xeffa('0x1b'),_0x24ef7a+'-'+_0x213cca+'/'+_0x5b0639)['json'](_0x30fa0c);}return null;};}function patchUpdates(_0x2ee9d5){return function(_0x1bf6fb){try{jsonpatch[_0xeffa('0x1c')](_0x1bf6fb,_0x2ee9d5,!![]);}catch(_0x6209f0){return BPromise['reject'](_0x6209f0);}return _0x1bf6fb['save']();};}function saveUpdates(_0x3bee37,_0x53124d){return function(_0x1569be){if(_0x1569be){return _0x1569be['update'](_0x3bee37)[_0xeffa('0x1d')](function(_0x181c17){return _0x181c17;});}return null;};}function removeEntity(_0x6e810e,_0x286d72){return function(_0xc73e1f){if(_0xc73e1f){return _0xc73e1f[_0xeffa('0x1e')]()['then'](function(){_0x6e810e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x259894,_0x27b10c){return function(_0xb89200){if(!_0xb89200){_0x259894[_0xeffa('0x13')](0x194);}return _0xb89200;};}function handleError(_0x1066cf,_0x37d7f4){_0x37d7f4=_0x37d7f4||0x1f4;return function(_0x2da56e){logger[_0xeffa('0x1f')](_0x2da56e[_0xeffa('0x20')]);if(_0x2da56e['name']){delete _0x2da56e[_0xeffa('0x21')];}_0x1066cf['status'](_0x37d7f4)['send'](_0x2da56e);};}exports[_0xeffa('0x22')]=function(_0x337e53,_0x21c027){var _0x1a00c1={},_0x134f08={},_0x4f3e09={'count':0x0,'rows':[]};var _0x33845e=_[_0xeffa('0x23')](db[_0xeffa('0x24')][_0xeffa('0x25')],function(_0x1d9aa7){return{'name':_0x1d9aa7[_0xeffa('0x26')],'type':_0x1d9aa7[_0xeffa('0x27')]['key']};});_0x134f08[_0xeffa('0x28')]=_[_0xeffa('0x23')](_0x33845e,_0xeffa('0x21'));_0x134f08['query']=_[_0xeffa('0x29')](_0x337e53[_0xeffa('0x2a')]);_0x134f08[_0xeffa('0x2b')]=_[_0xeffa('0x2c')](_0x134f08[_0xeffa('0x28')],_0x134f08['query']);_0x1a00c1[_0xeffa('0x2d')]=_[_0xeffa('0x2c')](_0x134f08['model'],qs[_0xeffa('0x2e')](_0x337e53['query']['fields']));_0x1a00c1[_0xeffa('0x2d')]=_0x1a00c1[_0xeffa('0x2d')][_0xeffa('0x2f')]?_0x1a00c1[_0xeffa('0x2d')]:_0x134f08[_0xeffa('0x28')];if(!_0x337e53['query'][_0xeffa('0x30')]('nolimit')){_0x1a00c1[_0xeffa('0x19')]=qs['limit'](_0x337e53[_0xeffa('0x2a')][_0xeffa('0x19')]);_0x1a00c1[_0xeffa('0x16')]=qs[_0xeffa('0x16')](_0x337e53[_0xeffa('0x2a')][_0xeffa('0x16')]);}_0x1a00c1[_0xeffa('0x31')]=qs['sort'](_0x337e53[_0xeffa('0x2a')][_0xeffa('0x32')]);_0x1a00c1[_0xeffa('0x33')]=qs[_0xeffa('0x2b')](_[_0xeffa('0x34')](_0x337e53[_0xeffa('0x2a')],_0x134f08[_0xeffa('0x2b')]),_0x33845e);if(_0x337e53[_0xeffa('0x2a')][_0xeffa('0x35')]){_0x1a00c1['where']=_[_0xeffa('0x36')](_0x1a00c1[_0xeffa('0x33')],{'$or':_[_0xeffa('0x23')](_0x33845e,function(_0x4d6dab){if(_0x4d6dab['type']!=='VIRTUAL'){var _0x5ba622={};_0x5ba622[_0x4d6dab['name']]={'$like':'%'+_0x337e53[_0xeffa('0x2a')][_0xeffa('0x35')]+'%'};return _0x5ba622;}})});}_0x1a00c1=_[_0xeffa('0x36')]({},_0x1a00c1,_0x337e53[_0xeffa('0x37')]);var _0x38d81f={'where':_0x1a00c1[_0xeffa('0x33')]};return db[_0xeffa('0x24')][_0xeffa('0x18')](_0x38d81f)[_0xeffa('0x1d')](function(_0x54211d){_0x4f3e09[_0xeffa('0x18')]=_0x54211d;if(_0x337e53['query'][_0xeffa('0x38')]){_0x1a00c1[_0xeffa('0x39')]=[{'all':!![]}];}return db[_0xeffa('0x24')][_0xeffa('0x3a')](_0x1a00c1);})[_0xeffa('0x1d')](function(_0x26c1fe){_0x4f3e09[_0xeffa('0x3b')]=_0x26c1fe;return _0x4f3e09;})['then'](respondWithFilteredResult(_0x21c027,_0x1a00c1))[_0xeffa('0x3c')](handleError(_0x21c027,null));};exports['show']=function(_0x15ad8e,_0x32c3f4){var _0x1d11d8={'raw':!![],'where':{'id':_0x15ad8e['params']['id']}},_0x283acc={};_0x283acc['model']=_['keys'](db[_0xeffa('0x24')][_0xeffa('0x25')]);_0x283acc[_0xeffa('0x2a')]=_[_0xeffa('0x29')](_0x15ad8e[_0xeffa('0x2a')]);_0x283acc['filters']=_[_0xeffa('0x2c')](_0x283acc[_0xeffa('0x28')],_0x283acc[_0xeffa('0x2a')]);_0x1d11d8['attributes']=_[_0xeffa('0x2c')](_0x283acc['model'],qs[_0xeffa('0x2e')](_0x15ad8e[_0xeffa('0x2a')]['fields']));_0x1d11d8[_0xeffa('0x2d')]=_0x1d11d8[_0xeffa('0x2d')][_0xeffa('0x2f')]?_0x1d11d8['attributes']:_0x283acc['model'];if(_0x15ad8e['query']['includeAll']){_0x1d11d8[_0xeffa('0x39')]=[{'all':!![]}];}_0x1d11d8=_[_0xeffa('0x36')]({},_0x1d11d8,_0x15ad8e[_0xeffa('0x37')]);return db[_0xeffa('0x24')][_0xeffa('0x3d')](_0x1d11d8)[_0xeffa('0x1d')](handleEntityNotFound(_0x32c3f4,null))['then'](respondWithResult(_0x32c3f4,null))['catch'](handleError(_0x32c3f4,null));};exports[_0xeffa('0x3e')]=function(_0x43955b,_0x5a989d){return db[_0xeffa('0x24')][_0xeffa('0x3e')](_0x43955b[_0xeffa('0x3f')],{})[_0xeffa('0x1d')](respondWithResult(_0x5a989d,0xc9))[_0xeffa('0x3c')](handleError(_0x5a989d,null));};exports[_0xeffa('0x40')]=function(_0x108be6,_0x455cc9){if(_0x108be6[_0xeffa('0x3f')]['id']){delete _0x108be6[_0xeffa('0x3f')]['id'];}return db['ChatTransferReport'][_0xeffa('0x3d')]({'where':{'id':_0x108be6['params']['id']}})[_0xeffa('0x1d')](handleEntityNotFound(_0x455cc9,null))[_0xeffa('0x1d')](saveUpdates(_0x108be6[_0xeffa('0x3f')],null))[_0xeffa('0x1d')](respondWithResult(_0x455cc9,null))['catch'](handleError(_0x455cc9,null));};exports[_0xeffa('0x1e')]=function(_0x23e0c9,_0x149187){return db[_0xeffa('0x24')][_0xeffa('0x3d')]({'where':{'id':_0x23e0c9[_0xeffa('0x41')]['id']}})[_0xeffa('0x1d')](handleEntityNotFound(_0x149187,null))[_0xeffa('0x1d')](removeEntity(_0x149187,null))[_0xeffa('0x3c')](handleError(_0x149187,null));};exports['describe']=function(_0x291f59,_0x5f47be){return db[_0xeffa('0x24')]['describe']()[_0xeffa('0x1d')](respondWithResult(_0x5f47be,null))[_0xeffa('0x3c')](handleError(_0x5f47be,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index fa2c807..e4fac61 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 _0x9182=['bluebird','path','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9182,0x146));var _0x2918=function(_0x2455e9,_0x1dca3a){_0x2455e9=_0x2455e9-0x0;var _0x497597=_0x9182[_0x2455e9];return _0x497597;};'use strict';var _=require(_0x2918('0x0'));var util=require(_0x2918('0x1'));var logger=require(_0x2918('0x2'))(_0x2918('0x3'));var moment=require('moment');var BPromise=require(_0x2918('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2918('0x5'));var rimraf=require('rimraf');var config=require(_0x2918('0x6'));var attributes=require(_0x2918('0x7'));module['exports']=function(_0x469040,_0x4ac3ea){return _0x469040['define'](_0x2918('0x8'),attributes,{'tableName':_0x2918('0x9'),'paranoid':![],'indexes':[{'name':_0x2918('0xa'),'fields':[_0x2918('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f13=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x3c7185,_0x456c77){var _0x51b03b=function(_0x4c7f07){while(--_0x4c7f07){_0x3c7185['push'](_0x3c7185['shift']());}};_0x51b03b(++_0x456c77);}(_0x1f13,0xdb));var _0x31f1=function(_0xce7bbf,_0x1e1546){_0xce7bbf=_0xce7bbf-0x0;var _0xd88dca=_0x1f13[_0xce7bbf];return _0xd88dca;};'use strict';var _=require(_0x31f1('0x0'));var util=require(_0x31f1('0x1'));var logger=require(_0x31f1('0x2'))(_0x31f1('0x3'));var moment=require('moment');var BPromise=require(_0x31f1('0x4'));var rp=require(_0x31f1('0x5'));var fs=require('fs');var path=require(_0x31f1('0x6'));var rimraf=require(_0x31f1('0x7'));var config=require(_0x31f1('0x8'));var attributes=require(_0x31f1('0x9'));module['exports']=function(_0x2a948e,_0x1d140e){return _0x2a948e[_0x31f1('0xa')](_0x31f1('0xb'),attributes,{'tableName':_0x31f1('0xc'),'paranoid':![],'indexes':[{'name':_0x31f1('0xd'),'fields':[_0x31f1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index fe8ac80..326644f 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 _0xb0bc=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0xb0bc,0x17a));var _0xcb0b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb0bc[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xcb0b('0x0'));var util=require(_0xcb0b('0x1'));var moment=require(_0xcb0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb0b('0x3'));var fs=require('fs');var Redis=require(_0xcb0b('0x4'));var db=require(_0xcb0b('0x5'))['db'];var utils=require(_0xcb0b('0x6'));var logger=require('../../config/logger')(_0xcb0b('0x7'));var config=require(_0xcb0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24c421,_0x133184,_0x3a321e){return new BPromise(function(_0x40119a,_0x4d1680){return client['request'](_0x24c421,_0x3a321e)[_0xcb0b('0xa')](function(_0xf22231){logger['info'](_0xcb0b('0xb'),_0x133184,_0xcb0b('0xc'));logger[_0xcb0b('0xd')](_0xcb0b('0xe'),_0x133184,_0xcb0b('0xc'),JSON['stringify'](_0xf22231));if(_0xf22231[_0xcb0b('0xf')]){if(_0xf22231[_0xcb0b('0xf')][_0xcb0b('0x10')]===0x1f4){logger[_0xcb0b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x133184,_0xf22231[_0xcb0b('0xf')]['message']);return _0x4d1680(_0xf22231['error']['message']);}logger[_0xcb0b('0xf')](_0xcb0b('0xb'),_0x133184,_0xf22231[_0xcb0b('0xf')][_0xcb0b('0x11')]);return _0x40119a(_0xf22231[_0xcb0b('0xf')][_0xcb0b('0x11')]);}else{logger['info'](_0xcb0b('0xb'),_0x133184,_0xcb0b('0xc'));_0x40119a(_0xf22231['result'][_0xcb0b('0x11')]);}})[_0xcb0b('0x12')](function(_0x1c34b0){logger[_0xcb0b('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x133184,_0x1c34b0);_0x4d1680(_0x1c34b0);});});} \ No newline at end of file +var _0xe54c=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x576f41,_0x4d2077){var _0x3ef2d4=function(_0x4767ba){while(--_0x4767ba){_0x576f41['push'](_0x576f41['shift']());}};_0x3ef2d4(++_0x4d2077);}(_0xe54c,0x145));var _0xce54=function(_0x47bf8b,_0x5c377e){_0x47bf8b=_0x47bf8b-0x0;var _0x2d71ff=_0xe54c[_0x47bf8b];return _0x2d71ff;};'use strict';var _=require(_0xce54('0x0'));var util=require(_0xce54('0x1'));var moment=require(_0xce54('0x2'));var BPromise=require(_0xce54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce54('0x4'));var db=require(_0xce54('0x5'))['db'];var utils=require(_0xce54('0x6'));var logger=require(_0xce54('0x7'))('rpc');var config=require(_0xce54('0x8'));var jayson=require(_0xce54('0x9'));var client=jayson[_0xce54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x305110,_0x3837f6,_0x558a90){return new BPromise(function(_0x5e3038,_0x1246b9){return client[_0xce54('0xb')](_0x305110,_0x558a90)[_0xce54('0xc')](function(_0x11cbee){logger[_0xce54('0xd')](_0xce54('0xe'),_0x3837f6,'request\x20sent');logger[_0xce54('0xf')](_0xce54('0x10'),_0x3837f6,_0xce54('0x11'),JSON[_0xce54('0x12')](_0x11cbee));if(_0x11cbee[_0xce54('0x13')]){if(_0x11cbee['error']['code']===0x1f4){logger[_0xce54('0x13')](_0xce54('0xe'),_0x3837f6,_0x11cbee[_0xce54('0x13')][_0xce54('0x14')]);return _0x1246b9(_0x11cbee['error'][_0xce54('0x14')]);}logger['error'](_0xce54('0xe'),_0x3837f6,_0x11cbee[_0xce54('0x13')][_0xce54('0x14')]);return _0x5e3038(_0x11cbee[_0xce54('0x13')][_0xce54('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3837f6,'request\x20sent');_0x5e3038(_0x11cbee[_0xce54('0x15')][_0xce54('0x14')]);}})[_0xce54('0x16')](function(_0x171669){logger[_0xce54('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3837f6,_0x171669);_0x1246b9(_0x171669);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 54a0380..14ab3d8 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 _0x4615=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d4262,_0x644ce){var _0xcd1204=function(_0x58ec6f){while(--_0x58ec6f){_0x4d4262['push'](_0x4d4262['shift']());}};_0xcd1204(++_0x644ce);}(_0x4615,0xae));var _0x5461=function(_0x3d5970,_0x28f570){_0x3d5970=_0x3d5970-0x0;var _0x2284ef=_0x4615[_0x3d5970];return _0x2284ef;};'use strict';var multer=require(_0x5461('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5461('0x1'));var express=require(_0x5461('0x2'));var router=express['Router']();var fs_extra=require(_0x5461('0x3'));var auth=require(_0x5461('0x4'));var interaction=require(_0x5461('0x5'));var config=require(_0x5461('0x6'));var controller=require(_0x5461('0x7'));router[_0x5461('0x8')]('/',auth[_0x5461('0x9')](),controller['index']);router[_0x5461('0x8')](_0x5461('0xa'),auth['isAuthenticated'](),controller[_0x5461('0xb')]);router[_0x5461('0x8')](_0x5461('0xc'),auth[_0x5461('0x9')](),controller[_0x5461('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5461('0xe')]);router[_0x5461('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5461('0x10')]);router[_0x5461('0x11')]('/:id',auth[_0x5461('0x9')](),controller[_0x5461('0x12')]);module[_0x5461('0x13')]=router; \ No newline at end of file +var _0x8b35=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy'];(function(_0x1e179b,_0x4d6ab7){var _0x1292a5=function(_0x22303d){while(--_0x22303d){_0x1e179b['push'](_0x1e179b['shift']());}};_0x1292a5(++_0x4d6ab7);}(_0x8b35,0x1ba));var _0x58b3=function(_0x4497c0,_0x356cfa){_0x4497c0=_0x4497c0-0x0;var _0x1b7e0c=_0x8b35[_0x4497c0];return _0x1b7e0c;};'use strict';var multer=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var path=require(_0x58b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x58b3('0x3'));var router=express[_0x58b3('0x4')]();var fs_extra=require(_0x58b3('0x5'));var auth=require(_0x58b3('0x6'));var interaction=require(_0x58b3('0x7'));var config=require('../../config/environment');var controller=require(_0x58b3('0x8'));router[_0x58b3('0x9')]('/',auth[_0x58b3('0xa')](),controller[_0x58b3('0xb')]);router[_0x58b3('0x9')]('/describe',auth[_0x58b3('0xa')](),controller[_0x58b3('0xc')]);router['get'](_0x58b3('0xd'),auth[_0x58b3('0xa')](),controller[_0x58b3('0xe')]);router[_0x58b3('0xf')]('/',auth['isAuthenticated'](),controller[_0x58b3('0x10')]);router[_0x58b3('0x11')]('/:id',auth[_0x58b3('0xa')](),controller[_0x58b3('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x58b3('0x13')]);module[_0x58b3('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 c218379..5059fa7 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 _0x9f1a=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','thumb','star','input','name','text','onlineForm','parse','getDataValue','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa'];(function(_0x1a0620,_0x4f40c3){var _0x475abc=function(_0x276d92){while(--_0x276d92){_0x1a0620['push'](_0x1a0620['shift']());}};_0x475abc(++_0x4f40c3);}(_0x9f1a,0xfa));var _0xa9f1=function(_0x24e7ad,_0x4d1bd9){_0x24e7ad=_0x24e7ad-0x0;var _0x4aa36c=_0x9f1a[_0x24e7ad];return _0x4aa36c;};'use strict';var Sequelize=require(_0xa9f1('0x0'));var rs=require('randomstring');module[_0xa9f1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa9f1('0x2')]},'mapKey':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x3')},'key':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x4')},'customerAlias':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':_0xa9f1('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':_0xa9f1('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa9f1('0x7')](_0xa9f1('0x8'),_0xa9f1('0x9')),'defaultValue':_0xa9f1('0x8')},'header_online':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xa')},'start_chat_button':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0xc')},'download_transcript':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa9f1('0xe')]},'closingQuestion':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x10')},'noteTitle':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x11')},'placeholderMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x12')},'closingMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0xb')},'skipMessageButton':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x13')},'conditionAgreement':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x14')},'ratingType':{'type':Sequelize[_0xa9f1('0x7')]('star',_0xa9f1('0x15')),'defaultValue':_0xa9f1('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa9f1('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa9f1('0x17'),'variable':null,'config':{'placeholder':_0xa9f1('0x18'),'type':_0xa9f1('0x19'),'required':!![]},'props':{'title':_0xa9f1('0x18'),'helpText':''}},{'type':_0xa9f1('0x17'),'props':{'title':_0xa9f1('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa9f1('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa9f1('0x1a'))?JSON[_0xa9f1('0x1b')](this[_0xa9f1('0x1c')](_0xa9f1('0x1a'))):{};},'set':function(_0x1bef70){return this[_0xa9f1('0x1d')]('onlineForm',JSON[_0xa9f1('0x1e')](_0x1bef70));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa9f1('0x17'),'props':{'title':_0xa9f1('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa9f1('0x3')},'variable':null},{'type':_0xa9f1('0x1f'),'config':{'placeholder':_0xa9f1('0x20')},'props':{'title':'Comments','helpText':_0xa9f1('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xa9f1('0x1b')](this[_0xa9f1('0x1c')](_0xa9f1('0x22'))):{};},'set':function(_0x5cdeeb){return this['setDataValue'](_0xa9f1('0x22'),JSON[_0xa9f1('0x1e')](_0x5cdeeb));}},'token':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':function(){return rs[_0xa9f1('0x23')]();}},'autoclose':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa9f1('0x2')]},'forwardOffline':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa9f1('0x2')]},'waitingTitle':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x24')},'waitingMessage':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0x27')},'skipUnmanaged':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x13')},'sendUnmanaged':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa9f1('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa9f1('0x28');}},'notificationSound':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa9f1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':_0xa9f1('0x2a')},'verticalAlignment':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xa9f1('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa9f1('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':_0xa9f1('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa9f1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa9f1('0x2c')},'systemAvatar':{'type':Sequelize[_0xa9f1('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa9f1('0xd')],'comment':_0xa9f1('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![],'comment':_0xa9f1('0x2e'),'set':function(_0x3f9bae){if(!_0x3f9bae)this['setDataValue'](_0xa9f1('0x2f'),null);this[_0xa9f1('0x1d')]('mandatoryDisposition',_0x3f9bae);}},'vidaooEscalation':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa9f1('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa9f1('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa9f1('0x2')],'defaultValue':function(){return _0xa9f1('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa9f1('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa9f1('0xe')]}}; \ No newline at end of file +var _0xe32c=['name','text','input','getDataValue','parse','onlineForm','setDataValue','stringify','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Feedback','ENUM','star','thumb'];(function(_0x2b5a15,_0x3c6da1){var _0x91dcdb=function(_0x322425){while(--_0x322425){_0x2b5a15['push'](_0x2b5a15['shift']());}};_0x91dcdb(++_0x3c6da1);}(_0xe32c,0x197));var _0xce32=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0xe32c[_0x263b0e];return _0x113fee;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xce32('0x0'));module[_0xce32('0x1')]={'name':{'type':Sequelize[_0xce32('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xce32('0x3')},'description':{'type':Sequelize[_0xce32('0x2')]},'mapKey':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x5')},'customerAlias':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xce32('0x2')],'allowNull':![],'defaultValue':_0xce32('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xce32('0x2')],'allowNull':![],'defaultValue':_0xce32('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xce32('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xce32('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xce32('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xce32('0x8'),_0xce32('0x9')),'defaultValue':_0xce32('0x8')},'header_online':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xce32('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xce32('0xc')},'header_offline':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0xd')},'download_transcript':{'type':Sequelize[_0xce32('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xce32('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xce32('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xce32('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xce32('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xce32('0x13')},'placeholderMessage':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xce32('0xc')},'skipMessageButton':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x15')},'ratingType':{'type':Sequelize[_0xce32('0x16')](_0xce32('0x17'),_0xce32('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xce32('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xce32('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xce32('0x19'),'type':_0xce32('0x1a'),'required':!![]},'props':{'title':_0xce32('0x19'),'helpText':''}},{'type':_0xce32('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xce32('0x4'),'type':_0xce32('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xce32('0x1c')]('onlineForm')?JSON[_0xce32('0x1d')](this[_0xce32('0x1c')](_0xce32('0x1e'))):{};},'set':function(_0x441ae5){return this[_0xce32('0x1f')](_0xce32('0x1e'),JSON[_0xce32('0x20')](_0x441ae5));}},'offlineForm':{'type':Sequelize[_0xce32('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xce32('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xce32('0x4'),'type':_0xce32('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0xce32('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xce32('0x22'))?JSON[_0xce32('0x1d')](this[_0xce32('0x1c')]('offlineForm')):{};},'set':function(_0x548998){return this[_0xce32('0x1f')]('offlineForm',JSON['stringify'](_0x548998));}},'token':{'type':Sequelize[_0xce32('0x2')],'defaultValue':function(){return rs[_0xce32('0x23')]();}},'autoclose':{'type':Sequelize[_0xce32('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xce32('0x2')]},'forwardOffline':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xce32('0x2')]},'waitingTitle':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xce32('0x25')},'offlineMessageBody':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xce32('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x27')},'skipUnmanaged':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x28')},'sendUnmanaged':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xce32('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xce32('0x2')]},'notificationTemplate':{'type':Sequelize[_0xce32('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[_0xce32('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xce32('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x29')},'verticalAlignment':{'type':Sequelize[_0xce32('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xce32('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xce32('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xce32('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xce32('0x2')],'allowNull':![],'defaultValue':_0xce32('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xce32('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xce32('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xce32('0x2')],'defaultValue':_0xce32('0x2b')},'systemAvatar':{'type':Sequelize[_0xce32('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xce32('0x7')],'comment':_0xce32('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xce32('0x2d'),'set':function(_0x1470f5){if(!_0x1470f5)this[_0xce32('0x1f')](_0xce32('0x2e'),null);this[_0xce32('0x1f')](_0xce32('0x2f'),_0x1470f5);}},'vidaooEscalation':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xce32('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xce32('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xce32('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xce32('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xce32('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 971133e..1ab0ac7 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 _0x3603=['applications','Applications','list','orderBy','asc','contact','customerIp','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','files','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','textColor','backgroundColor','addApplications','transaction','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','apply','reject','save','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','count','include','rows','catch','show','params','Pause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','includeAll','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','file','addAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','describe','ValidationError','difference','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','List','Contacts','account'];(function(_0x655ab,_0x3bf2e9){var _0x1c456a=function(_0x53d4dd){while(--_0x53d4dd){_0x655ab['push'](_0x655ab['shift']());}};_0x1c456a(++_0x3bf2e9);}(_0x3603,0x8e));var _0x3360=function(_0x487383,_0x5bc48e){_0x487383=_0x487383-0x0;var _0x1df6e1=_0x3603[_0x487383];return _0x1df6e1;};'use strict';var emlformat=require(_0x3360('0x0'));var rimraf=require(_0x3360('0x1'));var zipdir=require(_0x3360('0x2'));var jsonpatch=require(_0x3360('0x3'));var rp=require(_0x3360('0x4'));var moment=require(_0x3360('0x5'));var BPromise=require(_0x3360('0x6'));var Mustache=require(_0x3360('0x7'));var util=require(_0x3360('0x8'));var path=require(_0x3360('0x9'));var sox=require(_0x3360('0xa'));var csv=require('to-csv');var ejs=require(_0x3360('0xb'));var fs=require('fs');var fs_extra=require(_0x3360('0xc'));var _=require(_0x3360('0xd'));var squel=require(_0x3360('0xe'));var crypto=require('crypto');var jsforce=require(_0x3360('0xf'));var deskjs=require(_0x3360('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3360('0x11'));var authService=require(_0x3360('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3360('0x13'));var hardwareService=require(_0x3360('0x14'));var logger=require(_0x3360('0x15'))(_0x3360('0x16'));var utils=require(_0x3360('0x17'));var config=require(_0x3360('0x18'));var licenseUtil=require(_0x3360('0x19'));var db=require(_0x3360('0x1a'))['db'];config[_0x3360('0x1b')]=_[_0x3360('0x1c')](config['redis'],{'host':_0x3360('0x1d'),'port':0x18eb});var socket=require(_0x3360('0x1e'))(new Redis(config['redis']));require(_0x3360('0x1f'))[_0x3360('0x20')](socket);var jayson=require(_0x3360('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3360('0x22')][_0x3360('0x23')]({'port':0x232a});var client9003=jayson[_0x3360('0x22')][_0x3360('0x23')]({'port':0x232b});var client9001=jayson[_0x3360('0x22')][_0x3360('0x23')]({'port':0x2329});function respondWithRpcPromise(_0x481903,_0x6665dd,_0x3dd88e,_0x1e2893){return new BPromise(function(_0x2c5478,_0x3cf19a){var _0x2e99df=_0x1e2893||client;return _0x2e99df[_0x3360('0x24')](_0x481903,_0x3dd88e)[_0x3360('0x25')](function(_0x4c523d){logger[_0x3360('0x26')](_0x3360('0x27'),_0x6665dd,_0x3360('0x28'));logger[_0x3360('0x29')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x6665dd,_0x3360('0x28'),JSON[_0x3360('0x2a')](_0x4c523d));if(_0x4c523d[_0x3360('0x2b')]){if(_0x4c523d[_0x3360('0x2b')][_0x3360('0x2c')]===0x1f4){logger[_0x3360('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x6665dd,_0x4c523d[_0x3360('0x2b')][_0x3360('0x2d')]);return _0x3cf19a(_0x4c523d[_0x3360('0x2b')][_0x3360('0x2d')]);}logger['error'](_0x3360('0x27'),_0x6665dd,_0x4c523d[_0x3360('0x2b')][_0x3360('0x2d')]);return _0x2c5478(_0x4c523d['error'][_0x3360('0x2d')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x6665dd,_0x3360('0x28'));_0x2c5478(_0x4c523d[_0x3360('0x2e')][_0x3360('0x2d')]);}})['catch'](function(_0x2271f8){logger[_0x3360('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x6665dd,_0x2271f8);_0x3cf19a(_0x2271f8);});});}function respondWithStatusCode(_0x307ded,_0x4aa468){_0x4aa468=_0x4aa468||0xcc;return function(_0x4d1da4){if(_0x4d1da4){return _0x307ded[_0x3360('0x2f')](_0x4aa468);}return _0x307ded['status'](_0x4aa468)[_0x3360('0x30')]();};}function respondWithResult(_0xe0aa13,_0x4fd634){_0x4fd634=_0x4fd634||0xc8;return function(_0x1918de){if(_0x1918de){return _0xe0aa13[_0x3360('0x31')](_0x4fd634)[_0x3360('0x32')](_0x1918de);}};}function respondWithFilteredResult(_0x3d4da3,_0x4be4bb){return function(_0x9a0c70){if(_0x9a0c70){var _0x129fdf=typeof _0x4be4bb[_0x3360('0x33')]===_0x3360('0x34')&&typeof _0x4be4bb[_0x3360('0x35')]==='undefined';var _0x3bc4c8=_0x9a0c70['count'];var _0x2b0550=_0x129fdf?0x0:_0x4be4bb[_0x3360('0x33')];var _0x2b672c=_0x129fdf?_0x9a0c70['count']:_0x4be4bb[_0x3360('0x33')]+_0x4be4bb[_0x3360('0x35')];var _0xb42aa9;if(_0x2b672c>=_0x3bc4c8){_0x2b672c=_0x3bc4c8;_0xb42aa9=0xc8;}else{_0xb42aa9=0xce;}_0x3d4da3[_0x3360('0x31')](_0xb42aa9);return _0x3d4da3['set']('Content-Range',_0x2b0550+'-'+_0x2b672c+'/'+_0x3bc4c8)[_0x3360('0x32')](_0x9a0c70);}return null;};}function patchUpdates(_0x423daf){return function(_0xb65e2e){try{jsonpatch[_0x3360('0x36')](_0xb65e2e,_0x423daf,!![]);}catch(_0x285289){return BPromise[_0x3360('0x37')](_0x285289);}return _0xb65e2e[_0x3360('0x38')]();};}function saveUpdates(_0x43f90c,_0x1c55f6){return function(_0x69a45f){if(_0x69a45f){return _0x69a45f['update'](_0x43f90c)[_0x3360('0x25')](function(_0x58dcd3){return _0x58dcd3;});}return null;};}function removeEntity(_0x576efb,_0x107da3){return function(_0x5c20ac){if(_0x5c20ac){return _0x5c20ac[_0x3360('0x39')]()[_0x3360('0x25')](function(){var _0x14bffd=_0x5c20ac[_0x3360('0x3a')]({'plain':!![]});var _0x303596=_0x3360('0x3b');return db['UserProfileResource'][_0x3360('0x39')]({'where':{'type':_0x303596,'resourceId':_0x14bffd['id']}})[_0x3360('0x25')](function(){return _0x5c20ac;});})['then'](function(){_0x576efb[_0x3360('0x31')](0xcc)[_0x3360('0x30')]();});}};}function handleEntityNotFound(_0x2edaa5,_0x14cf19){return function(_0x129c13){if(!_0x129c13){_0x2edaa5[_0x3360('0x2f')](0x194);}return _0x129c13;};}function handleError(_0x233022,_0x4fa682){_0x4fa682=_0x4fa682||0x1f4;return function(_0x3d26c4){logger[_0x3360('0x2b')](_0x3d26c4[_0x3360('0x3c')]);if(_0x3d26c4[_0x3360('0x3d')]){delete _0x3d26c4[_0x3360('0x3d')];}_0x233022['status'](_0x4fa682)[_0x3360('0x3e')](_0x3d26c4);};}exports[_0x3360('0x3f')]=function(_0x400918,_0x23747f){var _0x18a8b4={'include':[{'model':db['Pause'],'as':_0x3360('0x40')}]},_0x549adf={},_0x26d34f={'count':0x0,'rows':[]};var _0x619328=_[_0x3360('0x41')](db[_0x3360('0x42')][_0x3360('0x43')],function(_0x4745d2){return{'name':_0x4745d2['fieldName'],'type':_0x4745d2['type'][_0x3360('0x44')]};});_0x549adf[_0x3360('0x45')]=_['map'](_0x619328,'name');_0x549adf[_0x3360('0x46')]=_[_0x3360('0x47')](_0x400918[_0x3360('0x46')]);_0x549adf[_0x3360('0x48')]=_[_0x3360('0x49')](_0x549adf['model'],_0x549adf[_0x3360('0x46')]);_0x18a8b4[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x549adf[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x400918[_0x3360('0x46')][_0x3360('0x4b')]));_0x18a8b4[_0x3360('0x4a')]=_0x18a8b4[_0x3360('0x4a')][_0x3360('0x4c')]?_0x18a8b4[_0x3360('0x4a')]:_0x549adf['model'];if(!_0x400918[_0x3360('0x46')][_0x3360('0x4d')]('nolimit')){_0x18a8b4[_0x3360('0x35')]=qs[_0x3360('0x35')](_0x400918[_0x3360('0x46')][_0x3360('0x35')]);_0x18a8b4['offset']=qs[_0x3360('0x33')](_0x400918[_0x3360('0x46')][_0x3360('0x33')]);}_0x18a8b4[_0x3360('0x4e')]=qs['sort'](_0x400918[_0x3360('0x46')][_0x3360('0x4f')]);_0x18a8b4['where']=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x400918[_0x3360('0x46')],_0x549adf[_0x3360('0x48')]),_0x619328);if(_0x400918[_0x3360('0x46')][_0x3360('0x51')]){_0x18a8b4[_0x3360('0x52')]=_[_0x3360('0x53')](_0x18a8b4['where'],{'$or':_[_0x3360('0x41')](_0x619328,function(_0x147353){if(_0x147353[_0x3360('0x54')]!==_0x3360('0x55')){var _0x2eafb2={};_0x2eafb2[_0x147353[_0x3360('0x3d')]]={'$like':'%'+_0x400918[_0x3360('0x46')]['filter']+'%'};return _0x2eafb2;}})});}_0x18a8b4=_[_0x3360('0x53')]({},_0x18a8b4,_0x400918[_0x3360('0x56')]);var _0x41af55={'where':_0x18a8b4[_0x3360('0x52')]};return db[_0x3360('0x42')][_0x3360('0x57')](_0x41af55)[_0x3360('0x25')](function(_0x286ad7){_0x26d34f[_0x3360('0x57')]=_0x286ad7;if(_0x400918[_0x3360('0x46')]['includeAll']){_0x18a8b4[_0x3360('0x58')]=[{'all':!![]}];}return db[_0x3360('0x42')]['findAll'](_0x18a8b4);})[_0x3360('0x25')](function(_0x31186c){_0x26d34f[_0x3360('0x59')]=_0x31186c;return _0x26d34f;})[_0x3360('0x25')](respondWithFilteredResult(_0x23747f,_0x18a8b4))[_0x3360('0x5a')](handleError(_0x23747f,null));};exports[_0x3360('0x5b')]=function(_0x25e845,_0x2143be){var _0x38477e={'raw':![],'where':{'id':_0x25e845[_0x3360('0x5c')]['id']},'include':[{'model':db[_0x3360('0x5d')],'as':_0x3360('0x40')}]},_0x18de1f={};_0x18de1f['model']=_['keys'](db['ChatWebsite'][_0x3360('0x43')]);_0x18de1f[_0x3360('0x46')]=_[_0x3360('0x47')](_0x25e845[_0x3360('0x46')]);_0x18de1f['filters']=_[_0x3360('0x49')](_0x18de1f[_0x3360('0x45')],_0x18de1f['query']);_0x38477e[_0x3360('0x4a')]=_['intersection'](_0x18de1f[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x25e845['query']['fields']));_0x38477e[_0x3360('0x4a')]=_0x38477e['attributes'][_0x3360('0x4c')]?_0x38477e[_0x3360('0x4a')]:_0x18de1f[_0x3360('0x45')];if(_0x25e845[_0x3360('0x46')]['includeAll']){_0x38477e[_0x3360('0x58')]=[{'all':!![]}];}_0x38477e=_[_0x3360('0x53')]({},_0x38477e,_0x25e845[_0x3360('0x56')]);return db[_0x3360('0x42')][_0x3360('0x5e')](_0x38477e)[_0x3360('0x25')](handleEntityNotFound(_0x2143be,null))[_0x3360('0x25')](respondWithResult(_0x2143be,null))['catch'](handleError(_0x2143be,null));};exports[_0x3360('0x5f')]=function(_0x2371d2,_0x5aa9a3){return db['ChatWebsite'][_0x3360('0x5f')](_0x2371d2[_0x3360('0x60')],{})[_0x3360('0x25')](function(_0x54a997){var _0x327b94=_0x2371d2['user'][_0x3360('0x3a')]({'plain':!![]});if(!_0x327b94)throw new Error(_0x3360('0x61'));if(_0x327b94[_0x3360('0x62')]===_0x3360('0x63')){var _0x4e4c52=_0x54a997[_0x3360('0x3a')]({'plain':!![]});var _0xb6908c='ChatWebsites';return db[_0x3360('0x64')][_0x3360('0x5e')]({'where':{'name':_0xb6908c,'userProfileId':_0x327b94[_0x3360('0x65')]},'raw':!![]})[_0x3360('0x25')](function(_0x346339){if(_0x346339&&_0x346339['autoAssociation']===0x0){return db[_0x3360('0x66')]['create']({'name':_0x4e4c52[_0x3360('0x3d')],'resourceId':_0x4e4c52['id'],'type':_0x346339[_0x3360('0x3d')],'sectionId':_0x346339['id']},{})['then'](function(){return _0x54a997;});}else{return _0x54a997;}})[_0x3360('0x5a')](function(_0x2fb913){logger[_0x3360('0x2b')](_0x3360('0x67'),_0x2fb913);throw _0x2fb913;});}return _0x54a997;})['then'](respondWithResult(_0x5aa9a3,0xc9))[_0x3360('0x5a')](handleError(_0x5aa9a3,null));};exports[_0x3360('0x68')]=function(_0x5beb17,_0x2f9834){if(_0x5beb17[_0x3360('0x60')]['id']){delete _0x5beb17[_0x3360('0x60')]['id'];}return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x5beb17['params']['id']},'include':[{'model':db[_0x3360('0x5d')],'as':_0x3360('0x40')}]})[_0x3360('0x25')](handleEntityNotFound(_0x2f9834,null))[_0x3360('0x25')](saveUpdates(_0x5beb17[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x2f9834,null))[_0x3360('0x5a')](handleError(_0x2f9834,null));};exports[_0x3360('0x39')]=function(_0x57afb9,_0x500b8e){return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x57afb9['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x500b8e,null))[_0x3360('0x25')](removeEntity(_0x500b8e,null))[_0x3360('0x5a')](handleError(_0x500b8e,null));};exports['describe']=function(_0x368db2,_0x143167){return db['ChatWebsite']['describe']()[_0x3360('0x25')](respondWithResult(_0x143167,null))[_0x3360('0x5a')](handleError(_0x143167,null));};exports[_0x3360('0x69')]=function(_0x3b9c24,_0x114572,_0x286e62){if(_0x3b9c24[_0x3360('0x60')]['id']){delete _0x3b9c24['body']['id'];}return db[_0x3360('0x42')]['find']({'where':{'id':_0x3b9c24[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x114572,null))[_0x3360('0x25')](function(_0x51f975){if(_0x51f975){_0x3b9c24[_0x3360('0x60')][_0x3360('0x6a')]=_0x51f975['id'];return db[_0x3360('0x6b')][_0x3360('0x5f')](_0x3b9c24[_0x3360('0x60')]);}})['then'](respondWithResult(_0x114572,null))[_0x3360('0x5a')](handleError(_0x114572,null));};exports[_0x3360('0x6c')]=function(_0x799497,_0x4282dd,_0x8caed2){var _0x3fa7b6={'raw':![],'where':{}};var _0x37d136={};var _0x4ea58b={'count':0x0,'rows':[]};return db[_0x3360('0x42')][_0x3360('0x6d')]({'where':{'id':_0x799497[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4282dd,null))['then'](function(_0x3dcc7f){if(_0x3dcc7f){_0x37d136[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0x6b')]['rawAttributes']);_0x37d136['query']=_[_0x3360('0x47')](_0x799497[_0x3360('0x46')]);_0x37d136[_0x3360('0x48')]=_[_0x3360('0x49')](_0x37d136[_0x3360('0x45')],_0x37d136[_0x3360('0x46')]);_0x3fa7b6['attributes']=_['intersection'](_0x37d136['model'],qs['fields'](_0x799497[_0x3360('0x46')][_0x3360('0x4b')]));_0x3fa7b6['attributes']=_0x3fa7b6[_0x3360('0x4a')][_0x3360('0x4c')]?_0x3fa7b6[_0x3360('0x4a')]:_0x37d136[_0x3360('0x45')];if(!_0x799497[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x3fa7b6[_0x3360('0x35')]=qs[_0x3360('0x35')](_0x799497[_0x3360('0x46')][_0x3360('0x35')]);_0x3fa7b6[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x799497[_0x3360('0x46')]['offset']);}_0x3fa7b6['order']=qs[_0x3360('0x4f')](_0x799497[_0x3360('0x46')][_0x3360('0x4f')]);_0x3fa7b6[_0x3360('0x52')]=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x799497[_0x3360('0x46')],_0x37d136[_0x3360('0x48')]));_0x3fa7b6[_0x3360('0x52')][_0x3360('0x6a')]=_0x3dcc7f['id'];if(_0x799497[_0x3360('0x46')][_0x3360('0x51')]){_0x3fa7b6['where']=_[_0x3360('0x53')](_0x3fa7b6[_0x3360('0x52')],{'$or':_['map'](_0x3fa7b6[_0x3360('0x4a')],function(_0x3effcd){var _0x574c5a={};_0x574c5a[_0x3effcd]={'$like':'%'+_0x799497['query'][_0x3360('0x51')]+'%'};return _0x574c5a;})});}_0x3fa7b6=_['merge']({},_0x3fa7b6,_0x799497['options']);return db[_0x3360('0x6b')][_0x3360('0x57')]({'where':_0x3fa7b6[_0x3360('0x52')]})[_0x3360('0x25')](function(_0x3fb0a2){_0x4ea58b['count']=_0x3fb0a2;if(_0x799497['query'][_0x3360('0x6f')]){_0x3fa7b6[_0x3360('0x58')]=[{'all':!![]}];}return db[_0x3360('0x6b')][_0x3360('0x70')](_0x3fa7b6);})[_0x3360('0x25')](function(_0x3ec6c2){_0x4ea58b[_0x3360('0x59')]=_0x3ec6c2;return _0x4ea58b;});}})[_0x3360('0x25')](respondWithFilteredResult(_0x4282dd,_0x3fa7b6))[_0x3360('0x5a')](handleError(_0x4282dd,null));};exports[_0x3360('0x71')]=function(_0x5f418a,_0x282df5,_0x46408d){return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x5f418a[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x282df5,null))[_0x3360('0x25')](function(_0x498e66){if(_0x498e66){return _0x498e66[_0x3360('0x71')](_0x5f418a[_0x3360('0x46')]['ids']);}})[_0x3360('0x25')](respondWithStatusCode(_0x282df5,null))[_0x3360('0x5a')](handleError(_0x282df5,null));};exports['addAnswer']=function(_0x47b6f7,_0x20fe91,_0x44fae0){if(_0x47b6f7[_0x3360('0x60')]['id']){delete _0x47b6f7['body']['id'];}return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x47b6f7[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x20fe91,null))[_0x3360('0x25')](function(_0x4e8375){if(_0x4e8375){_0x47b6f7[_0x3360('0x60')]['ChatWebsiteId']=_0x4e8375['id'];return db[_0x3360('0x72')][_0x3360('0x5f')](_0x47b6f7[_0x3360('0x60')]);}})[_0x3360('0x25')](respondWithResult(_0x20fe91,null))[_0x3360('0x5a')](handleError(_0x20fe91,null));};exports[_0x3360('0x73')]=function(_0x4bbd77,_0x39c8a9,_0x408b10){var _0x4c7fcd={'raw':![],'where':{}};var _0x25c369={};var _0x27e981={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3360('0x6d')]({'where':{'id':_0x4bbd77['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x39c8a9,null))[_0x3360('0x25')](function(_0x308f9c){if(_0x308f9c){_0x25c369[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0x72')][_0x3360('0x43')]);_0x25c369[_0x3360('0x46')]=_[_0x3360('0x47')](_0x4bbd77[_0x3360('0x46')]);_0x25c369[_0x3360('0x48')]=_[_0x3360('0x49')](_0x25c369['model'],_0x25c369[_0x3360('0x46')]);_0x4c7fcd[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x25c369['model'],qs[_0x3360('0x4b')](_0x4bbd77['query']['fields']));_0x4c7fcd['attributes']=_0x4c7fcd[_0x3360('0x4a')]['length']?_0x4c7fcd[_0x3360('0x4a')]:_0x25c369[_0x3360('0x45')];if(!_0x4bbd77[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x4c7fcd['limit']=qs[_0x3360('0x35')](_0x4bbd77[_0x3360('0x46')][_0x3360('0x35')]);_0x4c7fcd[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x4bbd77['query']['offset']);}_0x4c7fcd[_0x3360('0x4e')]=qs['sort'](_0x4bbd77[_0x3360('0x46')][_0x3360('0x4f')]);_0x4c7fcd[_0x3360('0x52')]=qs['filters'](_[_0x3360('0x50')](_0x4bbd77[_0x3360('0x46')],_0x25c369[_0x3360('0x48')]));_0x4c7fcd[_0x3360('0x52')][_0x3360('0x6a')]=_0x308f9c['id'];if(_0x4bbd77[_0x3360('0x46')]['filter']){_0x4c7fcd['where']=_[_0x3360('0x53')](_0x4c7fcd[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x4c7fcd[_0x3360('0x4a')],function(_0x39ca95){var _0x5c31d6={};_0x5c31d6[_0x39ca95]={'$like':'%'+_0x4bbd77[_0x3360('0x46')][_0x3360('0x51')]+'%'};return _0x5c31d6;})});}_0x4c7fcd=_[_0x3360('0x53')]({},_0x4c7fcd,_0x4bbd77['options']);return db['CannedAnswer'][_0x3360('0x57')]({'where':_0x4c7fcd[_0x3360('0x52')]})[_0x3360('0x25')](function(_0x203d8a){_0x27e981[_0x3360('0x57')]=_0x203d8a;if(_0x4bbd77[_0x3360('0x46')]['includeAll']){_0x4c7fcd[_0x3360('0x58')]=[{'all':!![]}];}return db[_0x3360('0x72')]['findAll'](_0x4c7fcd);})['then'](function(_0x212c8a){_0x27e981['rows']=_0x212c8a;return _0x27e981;});}})[_0x3360('0x25')](respondWithFilteredResult(_0x39c8a9,_0x4c7fcd))[_0x3360('0x5a')](handleError(_0x39c8a9,null));};exports[_0x3360('0x74')]=function(_0x22a70a,_0x44767e,_0x561964){return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x22a70a[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x44767e,null))['then'](function(_0x2f6773){if(_0x2f6773){return _0x2f6773['removeAnswers'](_0x22a70a[_0x3360('0x46')][_0x3360('0x75')]);}})[_0x3360('0x25')](respondWithStatusCode(_0x44767e,null))[_0x3360('0x5a')](handleError(_0x44767e,null));};exports['addLogo']=function(_0x16a9e1,_0x49f04c,_0x4a7d5f){_0x16a9e1[_0x3360('0x60')]['sitepic']=_0x16a9e1[_0x3360('0x76')]['filename'];return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x16a9e1['params']['id']}})['then'](handleEntityNotFound(_0x49f04c,null))[_0x3360('0x25')](saveUpdates(_0x16a9e1[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x49f04c,null))['catch'](handleError(_0x49f04c,null));};exports[_0x3360('0x77')]=function(_0x2d8ead,_0x13a345,_0x1e3a77){_0x2d8ead['body']['agentAvatar']=_0x2d8ead['file'][_0x3360('0x78')];return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x2d8ead[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13a345,null))['then'](saveUpdates(_0x2d8ead['body'],null))['then'](respondWithResult(_0x13a345,null))[_0x3360('0x5a')](handleError(_0x13a345,null));};exports['addCustomerAvatar']=function(_0x525ee4,_0x416222,_0x38a9fe){_0x525ee4[_0x3360('0x60')]['customerAvatar']=_0x525ee4[_0x3360('0x76')][_0x3360('0x78')];return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x525ee4[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x416222,null))['then'](saveUpdates(_0x525ee4[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x416222,null))['catch'](handleError(_0x416222,null));};exports[_0x3360('0x79')]=function(_0x344c4f,_0x36230a,_0x179fdc){_0x344c4f[_0x3360('0x60')][_0x3360('0x7a')]=_0x344c4f['file'][_0x3360('0x78')];return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x344c4f[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x36230a,null))[_0x3360('0x25')](saveUpdates(_0x344c4f[_0x3360('0x60')],null))[_0x3360('0x25')](respondWithResult(_0x36230a,null))[_0x3360('0x5a')](handleError(_0x36230a,null));};exports[_0x3360('0x7b')]=function(_0x58bc2b,_0x1d909e,_0x117ef1){var _0x154268=path[_0x3360('0x7c')](config['root'],_0x3360('0x7d'));var _0x3f150a={'where':{'id':_0x58bc2b[_0x3360('0x5c')]['id']},'attributes':['id',_0x3360('0x7e')],'raw':!![]};var _0x2d4f3c=![];return require('../../config/license/util')[_0x3360('0x7f')]()[_0x3360('0x25')](function(_0x1fabbc){if(_0x1fabbc){_0x2d4f3c=_0x1fabbc[_0x3360('0x80')];}})[_0x3360('0x25')](function(){return db['ChatWebsite'][_0x3360('0x5e')](_0x3f150a);})['then'](handleEntityNotFound(_0x1d909e,null))[_0x3360('0x25')](function(_0x15f604){if(_0x15f604){if(!_[_0x3360('0x81')](_0x15f604[_0x3360('0x7e')])){if(fs['existsSync'](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x83'),_0x15f604[_0x3360('0x7e')]))&&_0x2d4f3c){_0x154268=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x83'),_0x15f604[_0x3360('0x7e')]);}}return _0x1d909e[_0x3360('0x84')](_0x154268);}})[_0x3360('0x5a')](handleError(_0x1d909e,null));};exports[_0x3360('0x85')]=function(_0x30d8f7,_0x3f8b75,_0x1d969a){var _0x199e7d=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x86'));var _0x17518b={'where':{'id':_0x30d8f7[_0x3360('0x5c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3360('0x42')][_0x3360('0x5e')](_0x17518b)[_0x3360('0x25')](handleEntityNotFound(_0x3f8b75,null))['then'](function(_0x4c586a){if(_0x4c586a){if(!_['isNil'](_0x4c586a[_0x3360('0x87')])){if(fs[_0x3360('0x88')](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x4c586a[_0x3360('0x87')]))){_0x199e7d=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x4c586a[_0x3360('0x87')]);}}return _0x3f8b75[_0x3360('0x84')](_0x199e7d);}})[_0x3360('0x5a')](handleError(_0x3f8b75,null));};exports[_0x3360('0x8a')]=function(_0x4b0d2a,_0x485ef5,_0x40e792){var _0x2d23c8=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x8b'));var _0x24a362={'where':{'id':_0x4b0d2a[_0x3360('0x5c')]['id']},'attributes':['id','customerAvatar',_0x3360('0x8c')],'raw':!![]};return db[_0x3360('0x42')]['find'](_0x24a362)[_0x3360('0x25')](handleEntityNotFound(_0x485ef5,null))[_0x3360('0x25')](function(_0x16f1a2){if(_0x16f1a2){if(!_[_0x3360('0x81')](_0x16f1a2[_0x3360('0x8d')])){if(fs[_0x3360('0x88')](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x16f1a2[_0x3360('0x8d')]))&&_0x16f1a2[_0x3360('0x8c')]){_0x2d23c8=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x89'),_0x16f1a2[_0x3360('0x8d')]);}}return _0x485ef5[_0x3360('0x84')](_0x2d23c8);}})[_0x3360('0x5a')](handleError(_0x485ef5,null));};exports['getSystemAvatar']=function(_0x58edda,_0xfe94ba,_0x25bdbb){var _0x184ad1=path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x8e'));var _0x730ba8={'where':{'id':_0x58edda[_0x3360('0x5c')]['id']},'attributes':['id',_0x3360('0x7a')],'raw':!![]};return db[_0x3360('0x42')]['find'](_0x730ba8)[_0x3360('0x25')](handleEntityNotFound(_0xfe94ba,null))['then'](function(_0x2e26c5){if(_0x2e26c5){if(!_[_0x3360('0x81')](_0x2e26c5[_0x3360('0x7a')])){if(fs['existsSync'](path[_0x3360('0x7c')](config[_0x3360('0x82')],'server/files/images/avatars/',_0x2e26c5[_0x3360('0x7a')]))){_0x184ad1=path['join'](config[_0x3360('0x82')],_0x3360('0x89'),_0x2e26c5[_0x3360('0x7a')]);}}return _0xfe94ba['download'](_0x184ad1);}})[_0x3360('0x5a')](handleError(_0xfe94ba,null));};exports['notify']=function(_0x4b675f,_0x1e990d,_0x29807b){var _0x19c6a8=require(_0x3360('0x8f'));var _0x15017d=new _0x19c6a8();var _0x4d50be=_0x15017d[_0x3360('0x90')](_0x4b675f[_0x3360('0x91')][_0x3360('0x92')])[_0x3360('0x93')]();var _0x48c153={'body':_0x4b675f[_0x3360('0x60')],'channel':_0x3360('0x94')};var _0x514d09=[];var _0x253b75=[];var _0x3955dd={};var _0x14e4c3=![];return db[_0x3360('0x95')][_0x3360('0x96')]()[_0x3360('0x25')](function(_0x25489f){if(!_0x25489f){throw new db['Sequelize'][(_0x3360('0x97'))]('no\x20available\x20attributes');}_0x514d09=_[_0x3360('0x98')](_[_0x3360('0x47')](_0x25489f),[_0x3360('0x99'),_0x3360('0x9a')]);_0x253b75=_[_0x3360('0x98')](_[_0x3360('0x47')](_0x25489f),[_0x3360('0x99'),_0x3360('0x9a'),'CompanyId',_0x3360('0x9b')]);if(_0x4b675f[_0x3360('0x60')]['id']){delete _0x4b675f[_0x3360('0x60')]['id'];}if(_['isNil'](_0x4b675f['body'][_0x3360('0x9c')])){throw new db[(_0x3360('0x9d'))]['ValidationError'](_0x3360('0x9e'));}if(_['isNil'](_0x4b675f[_0x3360('0x60')][_0x3360('0x60')])||_0x4b675f[_0x3360('0x60')][_0x3360('0x60')]===''){throw new db[(_0x3360('0x9d'))][(_0x3360('0x97'))](_0x3360('0x9f'));}if(_[_0x3360('0x81')](_0x4b675f[_0x3360('0x60')]['mapKey'])){throw new db['Sequelize'][(_0x3360('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x253b75);}if(!_[_0x3360('0xa0')](_0x253b75,_0x4b675f[_0x3360('0x60')][_0x3360('0xa1')])){throw new db['Sequelize'][(_0x3360('0x97'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x253b75);}_0x3955dd[_0x4b675f['body'][_0x3360('0xa1')]]=_0x4b675f[_0x3360('0x60')][_0x3360('0x9c')];})[_0x3360('0x25')](function(){return db[_0x3360('0x42')]['find']({'where':{'id':_0x4b675f['params']['id']},'include':[{'model':db[_0x3360('0xa2')],'as':_0x3360('0xa3'),'include':[{'model':db[_0x3360('0x95')],'as':_0x3360('0xa4'),'where':_0x3955dd,'limit':0x1,'order':[[_0x3360('0x9a'),'DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3360('0x25')](handleEntityNotFound(_0x1e990d,null))[_0x3360('0x25')](function(_0x1e2fe1){if(_0x1e2fe1&&_0x1e2fe1[_0x3360('0xa3')]){_0x48c153[_0x3360('0xa5')]=_0x1e2fe1;_0x48c153[_0x3360('0xa6')]=_0x1e2fe1[_0x3360('0xa7')];_0x48c153[_0x3360('0xa8')]=_0x1e2fe1[_0x3360('0xa3')];_0x48c153[_0x3360('0xa6')]=_[_0x3360('0xa9')](_0x48c153[_0x3360('0xa6')],['priority'],[_0x3360('0xaa')]);if(_0x48c153['account'][_0x3360('0xa7')]){delete _0x48c153['account'][_0x3360('0xa7')];}if(_0x48c153['account'][_0x3360('0xa3')]&&_0x48c153[_0x3360('0xa5')][_0x3360('0xa3')][_0x3360('0xa4')][_0x3360('0x4c')]){return _0x48c153[_0x3360('0xa5')][_0x3360('0xa3')][_0x3360('0xa4')][0x0];}var _0x56fe55=_[_0x3360('0x1c')](_0x4b675f[_0x3360('0x60')],{'firstName':_0x4b675f['body'][_0x3360('0x9c')],'ListId':_0x1e2fe1[_0x3360('0x9b')]});_0x56fe55[_0x4b675f['body']['mapKey']]=_0x4b675f[_0x3360('0x60')][_0x3360('0x9c')];return db[_0x3360('0x95')][_0x3360('0x5f')](_0x56fe55,{'fields':_0x514d09,'raw':!![]});}})[_0x3360('0x25')](handleEntityNotFound(_0x1e990d,null))[_0x3360('0x25')](function(_0x52c2c3){_0x48c153[_0x3360('0xab')]=_0x52c2c3;var _0x21a1cc=_0x4b675f[_0x3360('0x60')][_0x3360('0xac')];if(_0x4b675f['headers']['cf-connecting-ip']){_0x21a1cc=_0x4b675f[_0x3360('0x91')]['cf-connecting-ip'];}else if(_0x4b675f[_0x3360('0x91')][_0x3360('0xad')]){_0x21a1cc=_[_0x3360('0xae')](_0x4b675f[_0x3360('0x91')][_0x3360('0xad')]['split'](','));}if(_0x52c2c3){var _0x48cd60={'ContactId':_0x52c2c3['id'],'ChatWebsiteId':_0x4b675f[_0x3360('0x5c')]['id'],'from':(_0x52c2c3[_0x3360('0xaf')]||'')+'\x20'+(_0x52c2c3[_0x3360('0xb0')]||''),'customerIp':_0x21a1cc,'customerPort':_0x4b675f[_0x3360('0x91')][_0x3360('0xb1')]?_0x4b675f['headers']['x-real-port']:null,'referer':_0x4b675f['body'][_0x3360('0xb2')],'browserName':_0x4d50be[_0x3360('0xb3')]['name']&&_0x4d50be['browser'][_0x3360('0xb4')]?util[_0x3360('0xb5')](_0x3360('0xb6'),_0x4d50be[_0x3360('0xb3')]['name'],_0x4d50be['browser'][_0x3360('0xb4')]):'unknown','browserVersion':_0x4d50be[_0x3360('0xb3')][_0x3360('0xb4')]||_0x3360('0xb7'),'osName':util[_0x3360('0xb5')](_0x3360('0xb6'),_0x4d50be['os']['name'],_0x4d50be['os']['version']),'osVersion':_0x4d50be['os'][_0x3360('0xb4')],'deviceModel':_0x4d50be[_0x3360('0xb8')][_0x3360('0x45')]&&_0x4d50be[_0x3360('0xb8')][_0x3360('0xb9')]?util[_0x3360('0xb5')](_0x3360('0xba'),_0x4d50be['device']['model'],_0x4d50be[_0x3360('0xb8')][_0x3360('0xb9')],_0x4d50be[_0x3360('0xb8')][_0x3360('0x54')]):null,'deviceVendor':_0x4d50be[_0x3360('0xb8')][_0x3360('0xb9')],'deviceType':_0x4d50be[_0x3360('0xb8')]['type'],'formData':JSON[_0x3360('0x2a')](_0x4b675f['body'])};var _0x9b578={'ChatWebsiteId':_0x4b675f[_0x3360('0x5c')]['id'],'closed':![]};if(_0x4b675f[_0x3360('0x60')]['threadId']){_0x9b578['threadId']=_0x4b675f['body'][_0x3360('0xbb')];return db[_0x3360('0xbc')][_0x3360('0x5e')]({'where':_0x9b578})[_0x3360('0x25')](function(_0x214ab7){if(_0x214ab7){return[_0x214ab7,![]];}_0x48cd60[_0x3360('0xbb')]=_0x4b675f['body']['threadId'];_0x48cd60[_0x3360('0xbd')]=_0x4b675f[_0x3360('0x60')][_0x3360('0xbd')];return db[_0x3360('0xbc')][_0x3360('0x5f')](_0x48cd60)['then'](function(_0x92992e){return[_0x92992e,!![]];});});}_0x9b578[_0x3360('0xbe')]=_0x52c2c3['id'];if(_0x4b675f[_0x3360('0x60')][_0x3360('0xbf')]&&_0x4b675f[_0x3360('0x60')][_0x3360('0xbf')]['id']){_0x9b578['id']=_0x4b675f[_0x3360('0x60')][_0x3360('0xbf')]['id'];return db[_0x3360('0xbc')]['find']({'where':_0x9b578})['then'](function(_0x217445){if(_0x217445){return[_0x217445,![]];}return db[_0x3360('0xbc')][_0x3360('0x5f')](_0x48cd60)[_0x3360('0x25')](function(_0x170983){return[_0x170983,!![]];});});}return db[_0x3360('0xbc')]['create'](_0x48cd60)['then'](function(_0x404bd8){return[_0x404bd8,!![]];});}})[_0x3360('0xc0')](function(_0x43cff2,_0xce9590){if(_0x43cff2){_0x14e4c3=_0xce9590;if(!_0xce9590){var _0x3e6b06={'from':(_0x48c153[_0x3360('0xab')][_0x3360('0xaf')]||'')+'\x20'+(_0x48c153['contact'][_0x3360('0xb0')]||'')};if(_0x4b675f[_0x3360('0x60')][_0x3360('0xbb')]&&_0x4b675f[_0x3360('0x60')][_0x3360('0xc1')]&&_0x4b675f['body']['threadId']!=_0x4b675f[_0x3360('0x60')][_0x3360('0xc1')]){_0x3e6b06[_0x3360('0xbb')]=_0x4b675f['body'][_0x3360('0xc1')];}return _0x43cff2[_0x3360('0x68')](_0x3e6b06);}else{return _0x43cff2;}}})[_0x3360('0x25')](function(_0x579e11){_0x48c153[_0x3360('0xbf')]=_0x579e11[_0x3360('0x3a')]({'plain':!![]});_0x48c153['interaction'][_0x3360('0xc2')]=_0x14e4c3;if(_0x48c153[_0x3360('0xbf')][_0x3360('0xc2')]){if(_0x48c153[_0x3360('0xa5')][_0x3360('0xc3')]){_0x48c153[_0x3360('0xa6')][_0x3360('0xc4')]({'id':0x0,'priority':_0x48c153[_0x3360('0xa6')][_0x3360('0x4c')]+0x1,'app':_0x3360('0xc5'),'appdata':_0x3360('0xc6'),'interval':_0x3360('0xc7')});}}return db['ChatMessage'][_0x3360('0x5f')]({'body':_0x4b675f['body'][_0x3360('0x60')],'ChatWebsiteId':_0x4b675f[_0x3360('0x5c')]['id'],'ChatInteractionId':_0x579e11['id'],'direction':'in','ContactId':_0x48c153[_0x3360('0xab')]['id'],'AttachmentId':_0x4b675f['body'][_0x3360('0xc8')]});})[_0x3360('0x25')](function(_0x2ef4bf){_0x48c153[_0x3360('0x2d')]=_0x2ef4bf;if(_0x48c153[_0x3360('0xbf')][_0x3360('0xc9')]){return db[_0x3360('0xca')]['find']({'attributes':['id',_0x3360('0x3d')],'where':{'id':_0x48c153[_0x3360('0xbf')][_0x3360('0xc9')]}})[_0x3360('0x25')](function(_0x554526){if(_0x554526){_0x48c153['applications'][_0x3360('0xcb')]({'id':0x0,'priority':0x0,'app':_0x3360('0xcc'),'appdata':_0x554526[_0x3360('0x3d')]+','+(_0x48c153[_0x3360('0xa5')][_0x3360('0xcd')]||0xa),'interval':_0x3360('0xc7')});_0x48c153[_0x3360('0xce')]=!![];}return respondWithRpcPromise('Start',_0x3360('0xcf'),_0x48c153);});}return respondWithRpcPromise(_0x3360('0xd0'),_0x3360('0xcf'),_0x48c153);})[_0x3360('0x25')](function(_0x51b1d6){respondWithRpcPromise(_0x3360('0xd1'),_0x3360('0xd1'),{'event':_0x3360('0xd2'),'message':_0x51b1d6},client9002);return _0x51b1d6;})['then'](respondWithResult(_0x1e990d,null))[_0x3360('0x5a')](handleError(_0x1e990d,null));};exports[_0x3360('0xd3')]=function(_0x28d20c,_0x3f2004,_0x576c34){var _0x4e4eff,_0x1ed81a,_0xc45de5;var _0xd54bb7=[];var _0x31c6f3=[];var _0x1bf78d={};var _0x3edb07=_0x28d20c['files']||[];var _0x6fb5bf=[];var _0x35b7d2;return db[_0x3360('0x95')][_0x3360('0x96')]()[_0x3360('0x25')](function(_0x489511){if(!_0x489511){throw new db[(_0x3360('0x9d'))][(_0x3360('0x97'))]('no\x20available\x20attributes');}_0x31c6f3=_[_0x3360('0x98')](_[_0x3360('0x47')](_0x489511),[_0x3360('0x99'),'updatedAt']);_0xd54bb7=_['difference'](_[_0x3360('0x47')](_0x489511),[_0x3360('0x99'),_0x3360('0x9a'),'CompanyId',_0x3360('0x9b')]);if(_0x28d20c['body']['id']){delete _0x28d20c['body']['id'];}if(_['isNil'](_0x28d20c[_0x3360('0x60')]['from'])){throw _0x3f2004[_0x3360('0x31')](0x1f4)[_0x3360('0x3e')](new db[(_0x3360('0x9d'))][(_0x3360('0x97'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x28d20c['body'][_0x3360('0x60')])||_0x28d20c[_0x3360('0x60')][_0x3360('0x60')]===''){throw _0x3f2004[_0x3360('0x31')](0x1f4)[_0x3360('0x3e')](new db[(_0x3360('0x9d'))][(_0x3360('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x28d20c[_0x3360('0x60')]['mapKeyOffline'])){throw _0x3f2004['status'](0x1f4)[_0x3360('0x3e')](new db['Sequelize']['ValidationError'](_0x3360('0xd4')+_0xd54bb7));}if(!_[_0x3360('0xa0')](_0xd54bb7,_0x28d20c['body'][_0x3360('0xd5')])){throw _0x3f2004['status'](0x1f4)['send'](new db[(_0x3360('0x9d'))][(_0x3360('0x97'))](_0x3360('0xd6')+_0xd54bb7));}_0x1bf78d[_0x28d20c['body'][_0x3360('0xd5')]]=_0x28d20c['body']['from'];})[_0x3360('0x25')](function(){return db[_0x3360('0x42')]['find']({'where':{'id':_0x28d20c[_0x3360('0x5c')]['id']},'include':[{'model':db[_0x3360('0xa2')],'as':_0x3360('0xa3')},{'model':db[_0x3360('0xd7')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x3f2004,null))['then'](function(_0x3d643f){if(_0x3d643f&&_0x3d643f[_0x3360('0xa3')]){_0x1ed81a=_0x3d643f;var _0x49c763=_[_0x3360('0x1c')](_0x28d20c[_0x3360('0x60')],{'firstName':_0x28d20c[_0x3360('0x60')][_0x3360('0x9c')],'phone':_0x28d20c['body'][_0x3360('0x9c')],'ListId':_0x3d643f[_0x3360('0x9b')]});_0x49c763[_0x28d20c[_0x3360('0x60')][_0x3360('0xd5')]]=_0x28d20c[_0x3360('0x60')][_0x3360('0x9c')];return db[_0x3360('0x95')]['findOrCreate']({'where':_0x1bf78d,'defaults':_0x49c763});}})[_0x3360('0xc0')](function(_0x3c3917){if(_0x3c3917){_0xc45de5=_0x3c3917;var _0x4f9006=fs[_0x3360('0xd8')](path[_0x3360('0x7c')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x3360('0xd9'));var _0x4079e6=ejs['render'](_0x4f9006,{'body':_[_0x3360('0xda')](_0x28d20c[_0x3360('0x60')]['body']),'bodyTitle':_0x1ed81a[_0x3360('0xdb')]});return db[_0x3360('0xdc')][_0x3360('0x5f')]({'body':_0x4079e6,'ContactId':_0x3c3917['id'],'ChatWebsiteId':_0x1ed81a['id']});}})[_0x3360('0x25')](function(_0x244ae4){_0x35b7d2=_0x244ae4;if(_0x3edb07['length']){var _0x102bc3=_0x3edb07['map'](function(_0x320a28){return{'name':_0x320a28[_0x3360('0xdd')],'basename':_0x320a28[_0x3360('0x78')],'type':_0x320a28['mimetype'],'ChatOfflineMessageId':_0x244ae4['id']};});_0x6fb5bf=_0x102bc3[_0x3360('0x41')](_0x2998a7=>{var _0x360f47={'filename':_0x2998a7[_0x3360('0x3d')],'path':path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0xde'),'files',_0x3360('0xdf'),_0x3360('0xe0'),_0x2998a7[_0x3360('0xe1')])};return _0x360f47;});if(!_0x1ed81a['openNewInteraction']){return db[_0x3360('0xe2')]['transaction'](function(_0x2c5e59){return db['Attachment'][_0x3360('0xe3')](_0x102bc3,{'transaction':_0x2c5e59});});}}})[_0x3360('0x25')](function(){if(_0x35b7d2){_0x4e4eff=_0x35b7d2;return db[_0x3360('0xd7')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x3360('0xe4'),'raw':!![]}]});}})[_0x3360('0x25')](function(_0xb1717e){if(_0xb1717e&&_0xb1717e[_0x3360('0xe4')]&&_0x1ed81a[_0x3360('0xe5')]&&_0x1ed81a[_0x3360('0xe6')]){var _0x336e11={'tls':{'rejectUnauthorized':![]}};if(_0xb1717e[_0x3360('0xe4')][_0x3360('0xe7')]){_0x336e11[_0x3360('0xe7')]=_0xb1717e['Smtp']['service'];}else{_0x336e11[_0x3360('0xe8')]=_0xb1717e[_0x3360('0xe4')][_0x3360('0xe8')];_0x336e11[_0x3360('0xe9')]=_0xb1717e[_0x3360('0xe4')]['port'];_0x336e11[_0x3360('0xea')]=_0xb1717e['Smtp']['secure'];}if(_0xb1717e[_0x3360('0xe4')]['authentication']){_0x336e11[_0x3360('0xeb')]={'user':_0xb1717e['Smtp']['user'],'pass':_0xb1717e[_0x3360('0xe4')][_0x3360('0xec')]};}return respondWithRpcPromise(_0x3360('0xed'),_0x3360('0xee'),{'account':_0x336e11,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xb1717e[_0x3360('0x3d')],_0xb1717e[_0x3360('0xef')]||_0xb1717e['Smtp'][_0x3360('0x63')]),'to':_0x1ed81a[_0x3360('0xe6')],'subject':_0x1ed81a[_0x3360('0xf0')],'html':_0x4e4eff[_0x3360('0x60')],'attachments':_0x6fb5bf}},client9003)[_0x3360('0x25')](function(){return _0x4e4eff;})['catch'](function(_0xaf9c8){console[_0x3360('0x2b')](_0xaf9c8);});}})[_0x3360('0x25')](function(){if(_0x1ed81a&&_0x1ed81a['openNewInteraction']&&_0x1ed81a[_0x3360('0xf1')]){var _0x37ca49=[];if(_0x3edb07['length']){_0x37ca49=_0x3edb07['map'](function(_0x202198){return{'name':_0x202198['originalname'],'basename':_0x202198[_0x3360('0x78')],'type':_0x202198[_0x3360('0xf2')],'ChatOfflineMessageId':_0x35b7d2['id']};});}var _0x3475ec;if(!_[_0x3360('0x81')](_0x1ed81a['subjectOffline'])){var _0x2609b9=_['map'](_0x28d20c[_0x3360('0x60')],function(_0x39675a){return _0x39675a;});var _0x559ff8=_[_0x3360('0xf3')](_0x2609b9)[0x0];var _0x44c405=_['mapValues'](_0x559ff8,function(_0x5daec9){return _0x5daec9;});_0x3475ec=_0x44c405[0x1][_0x1ed81a[_0x3360('0xf4')]];}var _0x359b23={'from':_0xc45de5['email'],'firstName':_0xc45de5[_0x3360('0xaf')],'lastName':_0xc45de5[_0x3360('0xb0')],'mapKey':'email','message':{'from':_0xc45de5[_0x3360('0xef')],'to':_0x1ed81a['MailAccount'][_0x3360('0xef')],'cc':'','subject':_[_0x3360('0x81')](_0x3475ec)?_0x1ed81a[_0x3360('0xf0')]:_0x3475ec,'messageId':'','sentAt':new Date(),'attach':_0x37ca49[_0x3360('0x4c')],'attachments':_0x37ca49,'originChannel':_0x3360('0xf5'),'ChatWebsiteId':_0x1ed81a['id'],'ChatOfflineMessageId':_0x4e4eff['id'],'originTo':_0x1ed81a['MailAccount'][_0x3360('0xef')]},'body':_0x4e4eff[_0x3360('0x60')]};var _0x24f594={'account':{'id':_0x1ed81a['MailAccountId']},'body':_0x359b23,'log':_0x3360('0xf6')};return respondWithRpcPromise(_0x3360('0xf6'),_0x3360('0xf7'),_0x24f594,client9001)[_0x3360('0x25')](function(){return _0x4e4eff;})[_0x3360('0x5a')](function(_0x332ad6){console[_0x3360('0x2b')](_0x332ad6);});}return;})[_0x3360('0x25')](function(){if(_0x4e4eff){return _0x4e4eff;}})[_0x3360('0x25')](respondWithResult(_0x3f2004,null))[_0x3360('0x5a')](function(_0x544ea7){console[_0x3360('0x2b')](_0x3360('0x5a'),_0x544ea7);for(var _0x2b8e47 of _0x3edb07){var _0x3d19da=path[_0x3360('0x7c')](config[_0x3360('0x82')],'server',_0x3360('0xf8'),_0x3360('0xdf'),'offline-chat',_0x2b8e47[_0x3360('0x78')]);fs_extra['remove'](_0x3d19da)['catch'](function(_0xcaa786){console[_0x3360('0x2b')](_0x3360('0xf9'),_0x3d19da,_0xcaa786);});}});};exports[_0x3360('0xfa')]=function(_0x44f9fa,_0x471407,_0xff0452){return db[_0x3360('0xbc')][_0x3360('0x5e')]({'where':{'id':_0x44f9fa[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x471407,null))[_0x3360('0x25')](function(_0x5a0b8e){if(_0x5a0b8e){return _0x5a0b8e[_0x3360('0xfa')](_0x44f9fa[_0x3360('0x60')][_0x3360('0x75')],_[_0x3360('0xfb')](_0x44f9fa[_0x3360('0x60')],[_0x3360('0x75'),'id'])||{});}})[_0x3360('0x25')](respondWithResult(_0x471407,null))[_0x3360('0x5a')](handleError(_0x471407,null));};exports[_0x3360('0xfc')]=function(_0x504d0e,_0x4eb3e4,_0x41c085){var _0x304fa0={'raw':![],'where':{}};var _0x320db5={};var _0x2ef208={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x504d0e[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x4eb3e4,null))[_0x3360('0x25')](function(_0x22fab0){if(_0x22fab0){_0x320db5[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0xbc')][_0x3360('0x43')]);_0x320db5[_0x3360('0x46')]=_[_0x3360('0x47')](_0x504d0e['query']);_0x320db5[_0x3360('0x48')]=_[_0x3360('0x49')](_0x320db5[_0x3360('0x45')],_0x320db5[_0x3360('0x46')]);_0x304fa0[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x320db5[_0x3360('0x45')],qs['fields'](_0x504d0e[_0x3360('0x46')][_0x3360('0x4b')]));_0x304fa0[_0x3360('0x4a')]=_0x304fa0['attributes'][_0x3360('0x4c')]?_0x304fa0[_0x3360('0x4a')]:_0x320db5[_0x3360('0x45')];if(!_0x504d0e[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x304fa0[_0x3360('0x35')]=qs['limit'](_0x504d0e[_0x3360('0x46')][_0x3360('0x35')]);_0x304fa0[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x504d0e[_0x3360('0x46')]['offset']);}_0x304fa0['order']=qs['sort'](_0x504d0e[_0x3360('0x46')][_0x3360('0x4f')]);_0x304fa0[_0x3360('0x52')]=qs['filters'](_[_0x3360('0x50')](_0x504d0e[_0x3360('0x46')],_0x320db5['filters']));_0x304fa0[_0x3360('0x52')][_0x3360('0x6a')]=_0x22fab0['id'];if(_0x504d0e['query'][_0x3360('0x51')]){_0x304fa0[_0x3360('0x52')]=_[_0x3360('0x53')](_0x304fa0[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x304fa0[_0x3360('0x4a')],function(_0x4dd89a){var _0x3f1dbf={};_0x3f1dbf[_0x4dd89a]={'$like':'%'+_0x504d0e[_0x3360('0x46')]['filter']+'%'};return _0x3f1dbf;})});}_0x304fa0=_['merge']({},_0x304fa0,_0x504d0e[_0x3360('0x56')]);return db['ChatInteraction']['count']({'where':_0x304fa0['where']})[_0x3360('0x25')](function(_0x1460f6){_0x2ef208['count']=_0x1460f6;if(_0x504d0e['query'][_0x3360('0x6f')]){_0x304fa0[_0x3360('0x58')]=[{'model':db['CmContact'],'as':_0x3360('0xfd'),'required':![]},{'model':db[_0x3360('0xca')],'as':_0x3360('0xfe'),'attributes':[_0x3360('0x3d'),_0x3360('0xff'),_0x3360('0x100')],'required':![]},{'model':db[_0x3360('0x101')],'as':'Tags','attributes':['id',_0x3360('0x3d'),_0x3360('0x102')],'where':_0x504d0e[_0x3360('0x46')][_0x3360('0x103')]?{'id':_0x504d0e['query']['tag']}:undefined,'required':_0x504d0e['query'][_0x3360('0x103')]?!![]:![]}];}return db[_0x3360('0xbc')][_0x3360('0x70')](_0x304fa0);})[_0x3360('0x25')](function(_0x14e8fc){_0x2ef208[_0x3360('0x59')]=_0x14e8fc;return _0x2ef208;});}})[_0x3360('0x25')](respondWithFilteredResult(_0x4eb3e4,_0x304fa0))[_0x3360('0x5a')](handleError(_0x4eb3e4,null));};function iftimePromise(_0x1001ca,_0x347c30){return respondWithRpcPromise('Command',_0x3360('0x104'),{'command':_0x347c30[_0x3360('0x105')]?util[_0x3360('0xb5')](_0x3360('0x106'),_0x1001ca[_0x3360('0x107')],_0x347c30[_0x3360('0x105')]):util['format'](_0x3360('0x108'),_0x1001ca[_0x3360('0x107')])},client9002)[_0x3360('0x25')](function(_0x2bcfb8){var _0x4542d5=_0x2bcfb8&&_0x2bcfb8[_0x3360('0x109')](_0x3360('0x10a'))>=0x0?!![]:![];logger[_0x3360('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x347c30['id'],_0x1001ca['id'],_0x1001ca[_0x3360('0x107')],_0x4542d5?_0x3360('0x10b'):'OFFLINE',_0x347c30[_0x3360('0x105')]?_0x347c30[_0x3360('0x105')]:_0x3360('0x10c'));return _0x4542d5;})['catch'](function(_0x4fcf9e){logger[_0x3360('0x2b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x347c30['id'],_0x1001ca['id'],_0x1001ca[_0x3360('0x107')],util['inspect'](_0x4fcf9e,{'showHidden':![],'depth':null}),_0x347c30[_0x3360('0x105')]?_0x347c30['timezone']:_0x3360('0x10c'));return![];});}exports[_0x3360('0x104')]=function(_0x8b34d0,_0x338869,_0x76695e){var _0x999e4c=0x0;var _0x1dad48=0x0;var _0x1aeb46=![];var _0x1ff036;var _0x1823bb;return db[_0x3360('0x42')]['find']({'where':{'id':_0x8b34d0[_0x3360('0x5c')]['id']},'include':[{'model':db[_0x3360('0x10d')],'as':_0x3360('0x10d'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x3360('0x107')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x338869,null))[_0x3360('0x25')](function(_0x52c68c){if(_0x52c68c){_0x1ff036=_0x52c68c;return _0x52c68c[_0x3360('0x10e')]({'raw':!![]});}})['then'](function(_0x147fb8){if(_0x1ff036){if(_0x147fb8){_0x1823bb=_0x147fb8;}}return require('../../config/license/util')[_0x3360('0x7f')]();})['then'](function(_0xf46d25){if(_0xf46d25){_0x1dad48=_0xf46d25[_0x3360('0x10f')];_0x1aeb46=_0xf46d25[_0x3360('0x80')];}})['then'](function(){return db[_0x3360('0xbc')][_0x3360('0x57')]({'where':{'closed':![]}});})[_0x3360('0x25')](function(_0x16dbf5){_0x999e4c=_0x16dbf5;if(_0x1dad48&&_0x16dbf5>_0x1dad48){return db[_0x3360('0x110')][_0x3360('0x6d')]({'where':{'id':0x1}})['then'](function(_0x2c9161){if(_0x2c9161){_0x2c9161[_0x3360('0x111')](_0x3360('0x112'));}});}})[_0x3360('0x25')](function(){if(_0x1ff036['Interval']&&_0x1ff036[_0x3360('0x10d')][_0x3360('0x113')]){var _0x2c2654=[];for(var _0x1eeb88=0x0;_0x1eeb88<_0x1ff036[_0x3360('0x10d')][_0x3360('0x113')][_0x3360('0x4c')];_0x1eeb88++){var _0x1b12b2=_0x1ff036['Interval']['Intervals'][_0x1eeb88][_0x3360('0x3a')]({'plain':!![]});_0x2c2654[_0x3360('0xc4')](iftimePromise(_0x1b12b2,_0x1ff036));}return BPromise[_0x3360('0x114')](_0x2c2654)[_0x3360('0x25')](function(_0x289312){return _['some'](_0x289312);});}else{return!![];}})[_0x3360('0x25')](function(_0x4f8fb8){var _0x48919d=fs[_0x3360('0xd8')](path[_0x3360('0x7c')](config[_0x3360('0x82')],_0x3360('0x115')),_0x3360('0xd9'));var _0x187768={'remote':_0x1ff036[_0x3360('0x116')],'query':querystring['stringify'](_[_0x3360('0x53')](_0x1ff036[_0x3360('0x3a')]({'plain':!![]}),{'customerIp':_0x8b34d0[_0x3360('0x91')][_0x3360('0xad')]||_0x8b34d0['headers'][_0x3360('0x117')]||_0x8b34d0[_0x3360('0x118')][_0x3360('0x119')]||_0x8b34d0['ip'],'referer':_0x8b34d0[_0x3360('0x91')]['referer'],'openedInteractions':_0x999e4c,'maxInteractions':_0x1dad48,'virtual':_0x1aeb46[_0x3360('0x10f')],'online':_0x4f8fb8,'custom':_0x1aeb46}))['replace'](/'/g,'\x5c\x27')};_0x338869['send'](ejs['render'](Mustache['render'](_0x48919d,_0x187768),{'proactiveActions':_0x1823bb,'alignment':_0x1ff036[_0x3360('0x11a')],'verticalAlignment':_0x1ff036['verticalAlignment'],'div_color':_0x1ff036[_0x3360('0x102')],'text_color':_0x1ff036[_0x3360('0x11b')],'button_color':_0x1ff036['color_button'],'background_color':_0x1ff036[_0x3360('0x11c')]}));})[_0x3360('0x5a')](handleError(_0x338869,null));};exports[_0x3360('0x11d')]=function(_0x3f0c45,_0x4543ac,_0x37c25e){return db['ChatWebsite'][_0x3360('0x6d')]({'where':{'id':_0x3f0c45['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x4543ac,null))['then'](function(_0xde0d64){if(_0xde0d64){return db[_0x3360('0xe2')][_0x3360('0x11e')](function(_0x3cc050){return db[_0x3360('0x11f')][_0x3360('0x39')]({'where':{'ChatWebsiteId':_0x3f0c45[_0x3360('0x5c')]['id']},'transaction':_0x3cc050})[_0x3360('0x25')](function(_0x2d354a){var _0x76cd70=_['map'](_0x3f0c45['body'],function(_0x35252a){_0x35252a[_0x3360('0x6a')]=_0x3f0c45[_0x3360('0x5c')]['id'];return _0x35252a;});return db[_0x3360('0x11f')][_0x3360('0xe3')](_0x76cd70,{'transaction':_0x3cc050});});})[_0x3360('0x25')](function(){return db[_0x3360('0x11f')][_0x3360('0x120')]({'where':{'ChatWebsiteId':_0x3f0c45[_0x3360('0x5c')]['id']},'order':'priority'});});}})[_0x3360('0x25')](respondWithResult(_0x4543ac,null))[_0x3360('0x5a')](handleError(_0x4543ac,null));};exports[_0x3360('0x121')]=function(_0x1d79c2,_0x51e1bf,_0x55859b){var _0x2e6db0={};var _0x49e625={};var _0x5b4dc7;var _0x9312f8;return db[_0x3360('0x42')]['findOne']({'where':{'id':_0x1d79c2[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x51e1bf,null))[_0x3360('0x25')](function(_0x2dbd98){if(_0x2dbd98){_0x5b4dc7=_0x2dbd98;_0x49e625['model']=_[_0x3360('0x47')](db[_0x3360('0x11f')]['rawAttributes']);_0x49e625[_0x3360('0x46')]=_[_0x3360('0x47')](_0x1d79c2[_0x3360('0x46')]);_0x49e625[_0x3360('0x48')]=_['intersection'](_0x49e625[_0x3360('0x45')],_0x49e625[_0x3360('0x46')]);_0x2e6db0['attributes']=_[_0x3360('0x49')](_0x49e625[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x1d79c2['query']['fields']));_0x2e6db0[_0x3360('0x4a')]=_0x2e6db0[_0x3360('0x4a')][_0x3360('0x4c')]?_0x2e6db0[_0x3360('0x4a')]:_0x49e625[_0x3360('0x45')];_0x2e6db0[_0x3360('0x4e')]=qs[_0x3360('0x4f')](_0x1d79c2[_0x3360('0x46')][_0x3360('0x4f')]);_0x2e6db0[_0x3360('0x52')]=qs['filters'](_['pick'](_0x1d79c2['query'],_0x49e625[_0x3360('0x48')]));if(_0x1d79c2[_0x3360('0x46')]['filter']){_0x2e6db0[_0x3360('0x52')]=_[_0x3360('0x53')](_0x2e6db0[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x2e6db0[_0x3360('0x4a')],function(_0x4b8d5e){var _0x3faa8c={};_0x3faa8c[_0x4b8d5e]={'$like':'%'+_0x1d79c2[_0x3360('0x46')][_0x3360('0x51')]+'%'};return _0x3faa8c;})});}_0x2e6db0=_[_0x3360('0x53')]({},_0x2e6db0,_0x1d79c2['options']);return _0x5b4dc7['getApplications'](_0x2e6db0);}})[_0x3360('0x25')](function(_0x201d08){if(_0x201d08){_0x9312f8=_0x201d08[_0x3360('0x4c')];if(!_0x1d79c2[_0x3360('0x46')][_0x3360('0x4d')](_0x3360('0x6e'))){_0x2e6db0[_0x3360('0x35')]=qs[_0x3360('0x35')](_0x1d79c2[_0x3360('0x46')]['limit']);_0x2e6db0[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x1d79c2['query'][_0x3360('0x33')]);}return _0x5b4dc7[_0x3360('0x121')](_0x2e6db0);}})[_0x3360('0x25')](function(_0x227b22){if(_0x227b22){return _0x227b22?{'count':_0x9312f8,'rows':_0x227b22}:null;}})[_0x3360('0x25')](respondWithResult(_0x51e1bf,null))[_0x3360('0x5a')](handleError(_0x51e1bf,null));};exports[_0x3360('0x122')]=function(_0x971e34,_0x4b185a,_0x5dfac3){return db[_0x3360('0x123')][_0x3360('0x5e')]({'where':{'id':_0x971e34[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b185a,null))['then'](function(_0x5627f2){if(_0x5627f2){return _0x5627f2[_0x3360('0x122')](_0x971e34[_0x3360('0x60')]['ids'],_[_0x3360('0xfb')](_0x971e34['body'],[_0x3360('0x75'),'id'])||{});}})['then'](respondWithResult(_0x4b185a,null))['catch'](handleError(_0x4b185a,null));};exports[_0x3360('0x10e')]=function(_0x29b430,_0x20c6e9,_0x53f3a4){var _0x3b0a05={};var _0x4f1cc8={};var _0x535777;var _0x2319c3;return db[_0x3360('0x42')][_0x3360('0x6d')]({'where':{'id':_0x29b430['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x20c6e9,null))['then'](function(_0x54a40b){if(_0x54a40b){_0x535777=_0x54a40b;_0x4f1cc8['model']=_['keys'](db[_0x3360('0x124')][_0x3360('0x43')]);_0x4f1cc8['query']=_[_0x3360('0x47')](_0x29b430['query']);_0x4f1cc8[_0x3360('0x48')]=_[_0x3360('0x49')](_0x4f1cc8[_0x3360('0x45')],_0x4f1cc8[_0x3360('0x46')]);_0x3b0a05[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x4f1cc8[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x29b430[_0x3360('0x46')][_0x3360('0x4b')]));_0x3b0a05[_0x3360('0x4a')]=_0x3b0a05['attributes'][_0x3360('0x4c')]?_0x3b0a05[_0x3360('0x4a')]:_0x4f1cc8[_0x3360('0x45')];_0x3b0a05[_0x3360('0x4e')]=qs[_0x3360('0x4f')](_0x29b430[_0x3360('0x46')][_0x3360('0x4f')]);_0x3b0a05['where']=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x29b430[_0x3360('0x46')],_0x4f1cc8[_0x3360('0x48')]));if(_0x29b430[_0x3360('0x46')][_0x3360('0x51')]){_0x3b0a05[_0x3360('0x52')]=_[_0x3360('0x53')](_0x3b0a05[_0x3360('0x52')],{'$or':_['map'](_0x3b0a05[_0x3360('0x4a')],function(_0x5d2f51){var _0x475add={};_0x475add[_0x5d2f51]={'$like':'%'+_0x29b430[_0x3360('0x46')]['filter']+'%'};return _0x475add;})});}_0x3b0a05=_[_0x3360('0x53')]({},_0x3b0a05,_0x29b430[_0x3360('0x56')]);return _0x535777['getProactiveActions'](_0x3b0a05);}})['then'](function(_0x5c2f9c){if(_0x5c2f9c){_0x2319c3=_0x5c2f9c['length'];if(!_0x29b430[_0x3360('0x46')][_0x3360('0x4d')]('nolimit')){_0x3b0a05[_0x3360('0x35')]=qs['limit'](_0x29b430[_0x3360('0x46')][_0x3360('0x35')]);_0x3b0a05['offset']=qs[_0x3360('0x33')](_0x29b430[_0x3360('0x46')]['offset']);}return _0x535777[_0x3360('0x10e')](_0x3b0a05);}})[_0x3360('0x25')](function(_0x3a7cc2){if(_0x3a7cc2){return _0x3a7cc2?{'count':_0x2319c3,'rows':_0x3a7cc2}:null;}})[_0x3360('0x25')](respondWithResult(_0x20c6e9,null))['catch'](handleError(_0x20c6e9,null));};exports[_0x3360('0x125')]=function(_0x5e9738,_0x5aa6a6,_0x1eb587){var _0x49f4a6=_0x5e9738[_0x3360('0x46')][_0x3360('0x126')]===_0x3360('0x127')?'offlineForm':_0x3360('0x128');return db[_0x3360('0x42')][_0x3360('0x5e')]({'attributes':['id',_0x49f4a6],'where':{'id':_0x5e9738['params']['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x5aa6a6,null))[_0x3360('0x25')](function(_0x28e3d3){if(_0x28e3d3){var _0x41f729=_0x28e3d3[_0x49f4a6];var _0xd41731=_0x41f729&&_0x41f729[_0x3360('0x129')]?_0x41f729[_0x3360('0x129')]:[];_0x5aa6a6[_0x3360('0x3e')]({'fromKey':_[_0x3360('0x81')](_0x41f729[_0x3360('0x12a')])?undefined:_0x41f729[_0x3360('0x12a')],'count':_0xd41731[_0x3360('0x4c')],'rows':_0xd41731});}})[_0x3360('0x5a')](handleError(_0x5aa6a6,null));};exports[_0x3360('0x12b')]=function(_0x170f42,_0xa6edff,_0x37ba3d){var _0x43dba4={'raw':![],'where':{}};var _0x40f595={};var _0x4f1fe6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3360('0x6d')]({'where':{'id':_0x170f42[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0xa6edff,null))[_0x3360('0x25')](function(_0x689483){if(_0x689483){_0x40f595[_0x3360('0x45')]=_[_0x3360('0x47')](db[_0x3360('0xdc')][_0x3360('0x43')]);_0x40f595[_0x3360('0x46')]=_[_0x3360('0x47')](_0x170f42[_0x3360('0x46')]);_0x40f595[_0x3360('0x48')]=_[_0x3360('0x49')](_0x40f595[_0x3360('0x45')],_0x40f595[_0x3360('0x46')]);_0x43dba4[_0x3360('0x4a')]=_['intersection'](_0x40f595[_0x3360('0x45')],qs['fields'](_0x170f42[_0x3360('0x46')][_0x3360('0x4b')]));_0x43dba4[_0x3360('0x4a')]=_0x43dba4[_0x3360('0x4a')][_0x3360('0x4c')]?_0x43dba4['attributes']:_0x40f595[_0x3360('0x45')];if(!_0x170f42['query']['hasOwnProperty'](_0x3360('0x6e'))){_0x43dba4[_0x3360('0x35')]=qs['limit'](_0x170f42[_0x3360('0x46')][_0x3360('0x35')]);_0x43dba4[_0x3360('0x33')]=qs[_0x3360('0x33')](_0x170f42[_0x3360('0x46')][_0x3360('0x33')]);}_0x43dba4[_0x3360('0x4e')]=qs[_0x3360('0x4f')](_0x170f42[_0x3360('0x46')]['sort']);_0x43dba4[_0x3360('0x52')]=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x170f42[_0x3360('0x46')],_0x40f595['filters']));_0x43dba4[_0x3360('0x52')]['ChatWebsiteId']=_0x689483['id'];if(_0x170f42['query'][_0x3360('0x51')]){_0x43dba4[_0x3360('0x52')]=_[_0x3360('0x53')](_0x43dba4[_0x3360('0x52')],{'$or':_[_0x3360('0x41')](_0x43dba4['attributes'],function(_0x478fa5){var _0x2c6145={};_0x2c6145[_0x478fa5]={'$like':'%'+_0x170f42['query'][_0x3360('0x51')]+'%'};return _0x2c6145;})});}_0x43dba4=_[_0x3360('0x53')]({},_0x43dba4,_0x170f42[_0x3360('0x56')]);return db[_0x3360('0xdc')][_0x3360('0x57')]({'where':_0x43dba4[_0x3360('0x52')]})['then'](function(_0x1518fb){_0x4f1fe6[_0x3360('0x57')]=_0x1518fb;if(_0x170f42[_0x3360('0x46')][_0x3360('0x6f')]){_0x43dba4['include']=[{'all':!![]}];}else{_0x43dba4[_0x3360('0x58')]=[{'model':db[_0x3360('0x95')],'as':_0x3360('0xfd'),'required':![]},{'model':db[_0x3360('0x12c')],'as':_0x3360('0x12d'),'required':![]}];}return db[_0x3360('0xdc')][_0x3360('0x70')](_0x43dba4);})[_0x3360('0x25')](function(_0x2cff9f){_0x4f1fe6['rows']=_0x2cff9f;return _0x4f1fe6;});}})['then'](respondWithFilteredResult(_0xa6edff,_0x43dba4))[_0x3360('0x5a')](handleError(_0xa6edff,null));};exports['addAgents']=function(_0x27e4fd,_0x168b0d,_0x1dc5ec){return db['ChatWebsite'][_0x3360('0x5e')]({'where':{'id':_0x27e4fd[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x168b0d,null))[_0x3360('0x25')](function(_0x3cdd86){if(_0x3cdd86){return _0x3cdd86[_0x3360('0x12e')](_0x27e4fd[_0x3360('0x60')]['ids'],_[_0x3360('0xfb')](_0x27e4fd[_0x3360('0x60')],[_0x3360('0x75'),'id'])||{})[_0x3360('0xc0')](function(_0x3b4de0){for(var _0xe64181=0x0;_0xe64181<_0x27e4fd[_0x3360('0x60')]['ids']['length'];_0xe64181+=0x1){socket[_0x3360('0x12f')](_0x3360('0x130'),{'UserId':Number(_0x27e4fd['body']['ids'][_0xe64181]),'ChatWebsiteId':Number(_0x27e4fd[_0x3360('0x5c')]['id'])});}return _0x3b4de0;});}})[_0x3360('0x25')](respondWithResult(_0x168b0d,null))[_0x3360('0x5a')](handleError(_0x168b0d,null));};exports[_0x3360('0x131')]=function(_0x224e67,_0x4e6df8,_0x340a36){return db[_0x3360('0x42')][_0x3360('0x5e')]({'where':{'id':_0x224e67[_0x3360('0x5c')]['id']}})[_0x3360('0x25')](handleEntityNotFound(_0x4e6df8,null))['then'](function(_0x19b51c){if(_0x19b51c){return _0x19b51c['removeAgents'](_0x224e67['query']['ids'])[_0x3360('0x25')](function(){if(_['isArray'](_0x224e67[_0x3360('0x46')]['ids'])){for(var _0x12edd3=0x0;_0x12edd3<_0x224e67['query'][_0x3360('0x75')]['length'];_0x12edd3+=0x1){socket[_0x3360('0x12f')](_0x3360('0x132'),{'UserId':Number(_0x224e67['query'][_0x3360('0x75')][_0x12edd3]),'ChatWebsiteId':Number(_0x224e67[_0x3360('0x5c')]['id'])});}}else{socket[_0x3360('0x12f')](_0x3360('0x132'),{'UserId':Number(_0x224e67[_0x3360('0x46')][_0x3360('0x75')]),'ChatWebsiteId':Number(_0x224e67[_0x3360('0x5c')]['id'])});}});}})[_0x3360('0x25')](respondWithStatusCode(_0x4e6df8,null))['catch'](handleError(_0x4e6df8,null));};exports[_0x3360('0x133')]=function(_0x11aaa3,_0x34351b,_0x155fd1){var _0x1acc6a={};var _0x37fafd={};var _0x276db1;var _0xd2745c;return db[_0x3360('0x42')][_0x3360('0x6d')]({'where':{'id':_0x11aaa3[_0x3360('0x5c')]['id']}})['then'](handleEntityNotFound(_0x34351b,null))[_0x3360('0x25')](function(_0x322307){if(_0x322307){_0x276db1=_0x322307;_0x37fafd[_0x3360('0x45')]=_['keys'](db['User'][_0x3360('0x43')]);_0x37fafd[_0x3360('0x46')]=_[_0x3360('0x47')](_0x11aaa3[_0x3360('0x46')]);_0x37fafd[_0x3360('0x48')]=_[_0x3360('0x49')](_0x37fafd['model'],_0x37fafd[_0x3360('0x46')]);_0x1acc6a[_0x3360('0x4a')]=_[_0x3360('0x49')](_0x37fafd[_0x3360('0x45')],qs[_0x3360('0x4b')](_0x11aaa3[_0x3360('0x46')][_0x3360('0x4b')]));_0x1acc6a['attributes']=_0x1acc6a[_0x3360('0x4a')][_0x3360('0x4c')]?_0x1acc6a['attributes']:_0x37fafd[_0x3360('0x45')];_0x1acc6a['order']=qs['sort'](_0x11aaa3[_0x3360('0x46')]['sort']);_0x1acc6a[_0x3360('0x52')]=qs[_0x3360('0x48')](_[_0x3360('0x50')](_0x11aaa3[_0x3360('0x46')],_0x37fafd[_0x3360('0x48')]));if(_0x11aaa3['query'][_0x3360('0x51')]){_0x1acc6a[_0x3360('0x52')]=_[_0x3360('0x53')](_0x1acc6a[_0x3360('0x52')],{'$or':_['map'](_0x1acc6a[_0x3360('0x4a')],function(_0x3a05d1){var _0x330f46={};_0x330f46[_0x3a05d1]={'$like':'%'+_0x11aaa3[_0x3360('0x46')][_0x3360('0x51')]+'%'};return _0x330f46;})});}_0x1acc6a=_['merge']({},_0x1acc6a,_0x11aaa3['options']);return _0x276db1[_0x3360('0x133')](_0x1acc6a);}})[_0x3360('0x25')](function(_0x249b91){if(_0x249b91){_0xd2745c=_0x249b91[_0x3360('0x4c')];if(!_0x11aaa3[_0x3360('0x46')]['hasOwnProperty'](_0x3360('0x6e'))){_0x1acc6a[_0x3360('0x35')]=qs['limit'](_0x11aaa3[_0x3360('0x46')][_0x3360('0x35')]);_0x1acc6a['offset']=qs[_0x3360('0x33')](_0x11aaa3[_0x3360('0x46')][_0x3360('0x33')]);}return _0x276db1[_0x3360('0x133')](_0x1acc6a);}})[_0x3360('0x25')](function(_0x521f57){if(_0x521f57){return _0x521f57?{'count':_0xd2745c,'rows':_0x521f57}:null;}})['then'](respondWithResult(_0x34351b,null))[_0x3360('0x5a')](handleError(_0x34351b,null));}; \ No newline at end of file +var _0x2ff7=['offlineForm','onlineForm','items','getOfflineMessages','ChatOfflineMessage','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','ChatWebsite','includeAll','findAll','rows','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','options','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','systemAvatar','getLogo','join','getLicense','custom','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','download','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','ChatApplication','Applications','list','applications','orderBy','priority','account','Contacts','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','referer','browser','format','%s\x20%s','version','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','interaction','contact','messageId','autoclose','close','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','originalname','mimetype','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','service','Smtp','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','License','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','remoteAddress','virtual','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','false'];(function(_0x492739,_0x4d7d80){var _0x4b668c=function(_0x1136af){while(--_0x1136af){_0x492739['push'](_0x492739['shift']());}};_0x4b668c(++_0x4d7d80);}(_0x2ff7,0x13c));var _0x72ff=function(_0x33613f,_0x1d2c1b){_0x33613f=_0x33613f-0x0;var _0x12079b=_0x2ff7[_0x33613f];return _0x12079b;};'use strict';var emlformat=require(_0x72ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72ff('0x1'));var jsonpatch=require(_0x72ff('0x2'));var rp=require(_0x72ff('0x3'));var moment=require('moment');var BPromise=require(_0x72ff('0x4'));var Mustache=require(_0x72ff('0x5'));var util=require(_0x72ff('0x6'));var path=require(_0x72ff('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x72ff('0x8'));var fs=require('fs');var fs_extra=require(_0x72ff('0x9'));var _=require(_0x72ff('0xa'));var squel=require(_0x72ff('0xb'));var crypto=require(_0x72ff('0xc'));var jsforce=require(_0x72ff('0xd'));var deskjs=require(_0x72ff('0xe'));var toCsv=require(_0x72ff('0xf'));var querystring=require(_0x72ff('0x10'));var Papa=require(_0x72ff('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x72ff('0x12'));var as=require(_0x72ff('0x13'));var hardwareService=require(_0x72ff('0x14'));var logger=require('../../config/logger')(_0x72ff('0x15'));var utils=require(_0x72ff('0x16'));var config=require(_0x72ff('0x17'));var licenseUtil=require(_0x72ff('0x18'));var db=require(_0x72ff('0x19'))['db'];config[_0x72ff('0x1a')]=_[_0x72ff('0x1b')](config[_0x72ff('0x1a')],{'host':_0x72ff('0x1c'),'port':0x18eb});var socket=require(_0x72ff('0x1d'))(new Redis(config[_0x72ff('0x1a')]));require(_0x72ff('0x1e'))[_0x72ff('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x72ff('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x72ff('0x20')][_0x72ff('0x21')]({'port':0x232a});var client9003=jayson[_0x72ff('0x20')][_0x72ff('0x21')]({'port':0x232b});var client9001=jayson[_0x72ff('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0x55230b,_0xc23b0b,_0x4a0cd0,_0x5759e8){return new BPromise(function(_0x42bc8f,_0x5ccce2){var _0x32a5a3=_0x5759e8||client;return _0x32a5a3[_0x72ff('0x22')](_0x55230b,_0x4a0cd0)[_0x72ff('0x23')](function(_0x580157){logger[_0x72ff('0x24')](_0x72ff('0x25'),_0xc23b0b,'request\x20sent');logger[_0x72ff('0x26')](_0x72ff('0x27'),_0xc23b0b,_0x72ff('0x28'),JSON[_0x72ff('0x29')](_0x580157));if(_0x580157['error']){if(_0x580157['error'][_0x72ff('0x2a')]===0x1f4){logger[_0x72ff('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0xc23b0b,_0x580157[_0x72ff('0x2b')][_0x72ff('0x2c')]);return _0x5ccce2(_0x580157[_0x72ff('0x2b')][_0x72ff('0x2c')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0xc23b0b,_0x580157[_0x72ff('0x2b')][_0x72ff('0x2c')]);return _0x42bc8f(_0x580157[_0x72ff('0x2b')][_0x72ff('0x2c')]);}else{logger[_0x72ff('0x24')](_0x72ff('0x25'),_0xc23b0b,'request\x20sent');_0x42bc8f(_0x580157[_0x72ff('0x2d')]['message']);}})[_0x72ff('0x2e')](function(_0x11cf12){logger['error'](_0x72ff('0x25'),_0xc23b0b,_0x11cf12);_0x5ccce2(_0x11cf12);});});}function respondWithStatusCode(_0x5036ff,_0x1590c9){_0x1590c9=_0x1590c9||0xcc;return function(_0x2148f8){if(_0x2148f8){return _0x5036ff[_0x72ff('0x2f')](_0x1590c9);}return _0x5036ff[_0x72ff('0x30')](_0x1590c9)[_0x72ff('0x31')]();};}function respondWithResult(_0x2ccdda,_0x5319f1){_0x5319f1=_0x5319f1||0xc8;return function(_0x21339e){if(_0x21339e){return _0x2ccdda['status'](_0x5319f1)[_0x72ff('0x32')](_0x21339e);}};}function respondWithFilteredResult(_0x54f0ef,_0x426be7){return function(_0x250827){if(_0x250827){var _0xbf8ce8=typeof _0x426be7[_0x72ff('0x33')]===_0x72ff('0x34')&&typeof _0x426be7[_0x72ff('0x35')]==='undefined';var _0x593022=_0x250827[_0x72ff('0x36')];var _0x297d72=_0xbf8ce8?0x0:_0x426be7[_0x72ff('0x33')];var _0x9e455f=_0xbf8ce8?_0x250827['count']:_0x426be7[_0x72ff('0x33')]+_0x426be7[_0x72ff('0x35')];var _0x525f69;if(_0x9e455f>=_0x593022){_0x9e455f=_0x593022;_0x525f69=0xc8;}else{_0x525f69=0xce;}_0x54f0ef[_0x72ff('0x30')](_0x525f69);return _0x54f0ef[_0x72ff('0x37')](_0x72ff('0x38'),_0x297d72+'-'+_0x9e455f+'/'+_0x593022)[_0x72ff('0x32')](_0x250827);}return null;};}function patchUpdates(_0x4efe33){return function(_0x1ad4df){try{jsonpatch['apply'](_0x1ad4df,_0x4efe33,!![]);}catch(_0x1086af){return BPromise[_0x72ff('0x39')](_0x1086af);}return _0x1ad4df[_0x72ff('0x3a')]();};}function saveUpdates(_0x4aa540,_0x324c4b){return function(_0x580068){if(_0x580068){return _0x580068[_0x72ff('0x3b')](_0x4aa540)[_0x72ff('0x23')](function(_0x12a384){return _0x12a384;});}return null;};}function removeEntity(_0x4f43cd,_0xf42a46){return function(_0x5af3de){if(_0x5af3de){return _0x5af3de[_0x72ff('0x3c')]()[_0x72ff('0x23')](function(){var _0x2d11fa=_0x5af3de[_0x72ff('0x3d')]({'plain':!![]});var _0x435036='ChatWebsites';return db[_0x72ff('0x3e')][_0x72ff('0x3c')]({'where':{'type':_0x435036,'resourceId':_0x2d11fa['id']}})['then'](function(){return _0x5af3de;});})[_0x72ff('0x23')](function(){_0x4f43cd[_0x72ff('0x30')](0xcc)[_0x72ff('0x31')]();});}};}function handleEntityNotFound(_0x2c3c28,_0x229d92){return function(_0x233df9){if(!_0x233df9){_0x2c3c28[_0x72ff('0x2f')](0x194);}return _0x233df9;};}function handleError(_0x39bb5e,_0x4ebd57){_0x4ebd57=_0x4ebd57||0x1f4;return function(_0x1cc94e){logger['error'](_0x1cc94e[_0x72ff('0x3f')]);if(_0x1cc94e[_0x72ff('0x40')]){delete _0x1cc94e[_0x72ff('0x40')];}_0x39bb5e[_0x72ff('0x30')](_0x4ebd57)['send'](_0x1cc94e);};}exports[_0x72ff('0x41')]=function(_0x27c2c4,_0x5975db){var _0x23009a={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3d3c94={},_0x427df8={'count':0x0,'rows':[]};var _0x280f48=_['map'](db['ChatWebsite'][_0x72ff('0x42')],function(_0x714c69){return{'name':_0x714c69[_0x72ff('0x43')],'type':_0x714c69[_0x72ff('0x44')][_0x72ff('0x45')]};});_0x3d3c94[_0x72ff('0x46')]=_[_0x72ff('0x47')](_0x280f48,_0x72ff('0x40'));_0x3d3c94[_0x72ff('0x48')]=_['keys'](_0x27c2c4['query']);_0x3d3c94[_0x72ff('0x49')]=_[_0x72ff('0x4a')](_0x3d3c94[_0x72ff('0x46')],_0x3d3c94[_0x72ff('0x48')]);_0x23009a['attributes']=_[_0x72ff('0x4a')](_0x3d3c94['model'],qs['fields'](_0x27c2c4[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x23009a['attributes']=_0x23009a[_0x72ff('0x4c')][_0x72ff('0x4d')]?_0x23009a[_0x72ff('0x4c')]:_0x3d3c94['model'];if(!_0x27c2c4[_0x72ff('0x48')][_0x72ff('0x4e')](_0x72ff('0x4f'))){_0x23009a['limit']=qs[_0x72ff('0x35')](_0x27c2c4[_0x72ff('0x48')][_0x72ff('0x35')]);_0x23009a['offset']=qs[_0x72ff('0x33')](_0x27c2c4['query'][_0x72ff('0x33')]);}_0x23009a['order']=qs[_0x72ff('0x50')](_0x27c2c4[_0x72ff('0x48')][_0x72ff('0x50')]);_0x23009a[_0x72ff('0x51')]=qs[_0x72ff('0x49')](_['pick'](_0x27c2c4[_0x72ff('0x48')],_0x3d3c94['filters']),_0x280f48);if(_0x27c2c4['query'][_0x72ff('0x52')]){_0x23009a[_0x72ff('0x51')]=_[_0x72ff('0x53')](_0x23009a['where'],{'$or':_[_0x72ff('0x47')](_0x280f48,function(_0x3a7ef6){if(_0x3a7ef6[_0x72ff('0x44')]!=='VIRTUAL'){var _0x2e7e5f={};_0x2e7e5f[_0x3a7ef6[_0x72ff('0x40')]]={'$like':'%'+_0x27c2c4[_0x72ff('0x48')]['filter']+'%'};return _0x2e7e5f;}})});}_0x23009a=_[_0x72ff('0x53')]({},_0x23009a,_0x27c2c4['options']);var _0x4997aa={'where':_0x23009a[_0x72ff('0x51')]};return db[_0x72ff('0x54')]['count'](_0x4997aa)[_0x72ff('0x23')](function(_0x13b68d){_0x427df8['count']=_0x13b68d;if(_0x27c2c4[_0x72ff('0x48')][_0x72ff('0x55')]){_0x23009a['include']=[{'all':!![]}];}return db[_0x72ff('0x54')][_0x72ff('0x56')](_0x23009a);})['then'](function(_0x370d38){_0x427df8[_0x72ff('0x57')]=_0x370d38;return _0x427df8;})[_0x72ff('0x23')](respondWithFilteredResult(_0x5975db,_0x23009a))[_0x72ff('0x2e')](handleError(_0x5975db,null));};exports['show']=function(_0x13aeec,_0x1ba62a){var _0x5f386b={'raw':![],'where':{'id':_0x13aeec[_0x72ff('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x59e4ae={};_0x59e4ae['model']=_[_0x72ff('0x59')](db[_0x72ff('0x54')]['rawAttributes']);_0x59e4ae['query']=_[_0x72ff('0x59')](_0x13aeec['query']);_0x59e4ae[_0x72ff('0x49')]=_[_0x72ff('0x4a')](_0x59e4ae[_0x72ff('0x46')],_0x59e4ae['query']);_0x5f386b[_0x72ff('0x4c')]=_[_0x72ff('0x4a')](_0x59e4ae[_0x72ff('0x46')],qs[_0x72ff('0x4b')](_0x13aeec[_0x72ff('0x48')]['fields']));_0x5f386b[_0x72ff('0x4c')]=_0x5f386b[_0x72ff('0x4c')][_0x72ff('0x4d')]?_0x5f386b[_0x72ff('0x4c')]:_0x59e4ae[_0x72ff('0x46')];if(_0x13aeec[_0x72ff('0x48')][_0x72ff('0x55')]){_0x5f386b[_0x72ff('0x5a')]=[{'all':!![]}];}_0x5f386b=_['merge']({},_0x5f386b,_0x13aeec['options']);return db['ChatWebsite']['find'](_0x5f386b)['then'](handleEntityNotFound(_0x1ba62a,null))[_0x72ff('0x23')](respondWithResult(_0x1ba62a,null))[_0x72ff('0x2e')](handleError(_0x1ba62a,null));};exports['create']=function(_0x53109b,_0x48639f){return db[_0x72ff('0x54')][_0x72ff('0x5b')](_0x53109b[_0x72ff('0x5c')],{})[_0x72ff('0x23')](function(_0x482d41){var _0x409b5c=_0x53109b[_0x72ff('0x5d')]['get']({'plain':!![]});if(!_0x409b5c)throw new Error(_0x72ff('0x5e'));if(_0x409b5c['role']==='user'){var _0x5787ca=_0x482d41[_0x72ff('0x3d')]({'plain':!![]});var _0x4fc5f1=_0x72ff('0x5f');return db[_0x72ff('0x60')][_0x72ff('0x61')]({'where':{'name':_0x4fc5f1,'userProfileId':_0x409b5c[_0x72ff('0x62')]},'raw':!![]})[_0x72ff('0x23')](function(_0x2c37b2){if(_0x2c37b2&&_0x2c37b2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5787ca[_0x72ff('0x40')],'resourceId':_0x5787ca['id'],'type':_0x2c37b2[_0x72ff('0x40')],'sectionId':_0x2c37b2['id']},{})[_0x72ff('0x23')](function(){return _0x482d41;});}else{return _0x482d41;}})[_0x72ff('0x2e')](function(_0x1ccba8){logger[_0x72ff('0x2b')](_0x72ff('0x63'),_0x1ccba8);throw _0x1ccba8;});}return _0x482d41;})[_0x72ff('0x23')](respondWithResult(_0x48639f,0xc9))[_0x72ff('0x2e')](handleError(_0x48639f,null));};exports[_0x72ff('0x3b')]=function(_0x5c7ccc,_0x4df5d1){if(_0x5c7ccc[_0x72ff('0x5c')]['id']){delete _0x5c7ccc[_0x72ff('0x5c')]['id'];}return db[_0x72ff('0x54')]['find']({'where':{'id':_0x5c7ccc[_0x72ff('0x58')]['id']},'include':[{'model':db[_0x72ff('0x64')],'as':'mandatoryDispositionPause'}]})[_0x72ff('0x23')](handleEntityNotFound(_0x4df5d1,null))[_0x72ff('0x23')](saveUpdates(_0x5c7ccc[_0x72ff('0x5c')],null))[_0x72ff('0x23')](respondWithResult(_0x4df5d1,null))[_0x72ff('0x2e')](handleError(_0x4df5d1,null));};exports[_0x72ff('0x3c')]=function(_0x7a93ae,_0xe38358){return db['ChatWebsite'][_0x72ff('0x61')]({'where':{'id':_0x7a93ae['params']['id']}})['then'](handleEntityNotFound(_0xe38358,null))[_0x72ff('0x23')](removeEntity(_0xe38358,null))[_0x72ff('0x2e')](handleError(_0xe38358,null));};exports[_0x72ff('0x65')]=function(_0x5c7196,_0x5b15fe){return db[_0x72ff('0x54')]['describe']()[_0x72ff('0x23')](respondWithResult(_0x5b15fe,null))[_0x72ff('0x2e')](handleError(_0x5b15fe,null));};exports['addDisposition']=function(_0x1b457a,_0x517109,_0x2750fb){if(_0x1b457a[_0x72ff('0x5c')]['id']){delete _0x1b457a[_0x72ff('0x5c')]['id'];}return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x1b457a[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x517109,null))['then'](function(_0x2a520b){if(_0x2a520b){_0x1b457a[_0x72ff('0x5c')][_0x72ff('0x66')]=_0x2a520b['id'];return db[_0x72ff('0x67')][_0x72ff('0x5b')](_0x1b457a['body']);}})[_0x72ff('0x23')](respondWithResult(_0x517109,null))[_0x72ff('0x2e')](handleError(_0x517109,null));};exports[_0x72ff('0x68')]=function(_0x31a020,_0x12174d,_0x297f41){var _0x351c78={'raw':![],'where':{}};var _0xd801b0={};var _0x487484={'count':0x0,'rows':[]};return db[_0x72ff('0x54')][_0x72ff('0x69')]({'where':{'id':_0x31a020[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x12174d,null))['then'](function(_0x564bf1){if(_0x564bf1){_0xd801b0[_0x72ff('0x46')]=_[_0x72ff('0x59')](db[_0x72ff('0x67')]['rawAttributes']);_0xd801b0[_0x72ff('0x48')]=_[_0x72ff('0x59')](_0x31a020[_0x72ff('0x48')]);_0xd801b0[_0x72ff('0x49')]=_[_0x72ff('0x4a')](_0xd801b0[_0x72ff('0x46')],_0xd801b0[_0x72ff('0x48')]);_0x351c78[_0x72ff('0x4c')]=_[_0x72ff('0x4a')](_0xd801b0[_0x72ff('0x46')],qs[_0x72ff('0x4b')](_0x31a020[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x351c78['attributes']=_0x351c78['attributes'][_0x72ff('0x4d')]?_0x351c78[_0x72ff('0x4c')]:_0xd801b0[_0x72ff('0x46')];if(!_0x31a020[_0x72ff('0x48')][_0x72ff('0x4e')](_0x72ff('0x4f'))){_0x351c78[_0x72ff('0x35')]=qs[_0x72ff('0x35')](_0x31a020[_0x72ff('0x48')]['limit']);_0x351c78[_0x72ff('0x33')]=qs[_0x72ff('0x33')](_0x31a020[_0x72ff('0x48')][_0x72ff('0x33')]);}_0x351c78[_0x72ff('0x6a')]=qs['sort'](_0x31a020[_0x72ff('0x48')][_0x72ff('0x50')]);_0x351c78[_0x72ff('0x51')]=qs['filters'](_[_0x72ff('0x6b')](_0x31a020[_0x72ff('0x48')],_0xd801b0['filters']));_0x351c78[_0x72ff('0x51')]['ChatWebsiteId']=_0x564bf1['id'];if(_0x31a020[_0x72ff('0x48')][_0x72ff('0x52')]){_0x351c78['where']=_[_0x72ff('0x53')](_0x351c78['where'],{'$or':_[_0x72ff('0x47')](_0x351c78[_0x72ff('0x4c')],function(_0x3ea647){var _0x4e60e8={};_0x4e60e8[_0x3ea647]={'$like':'%'+_0x31a020[_0x72ff('0x48')][_0x72ff('0x52')]+'%'};return _0x4e60e8;})});}_0x351c78=_[_0x72ff('0x53')]({},_0x351c78,_0x31a020['options']);return db[_0x72ff('0x67')]['count']({'where':_0x351c78['where']})[_0x72ff('0x23')](function(_0x3b79f8){_0x487484[_0x72ff('0x36')]=_0x3b79f8;if(_0x31a020[_0x72ff('0x48')]['includeAll']){_0x351c78['include']=[{'all':!![]}];}return db[_0x72ff('0x67')][_0x72ff('0x56')](_0x351c78);})[_0x72ff('0x23')](function(_0x483594){_0x487484[_0x72ff('0x57')]=_0x483594;return _0x487484;});}})[_0x72ff('0x23')](respondWithFilteredResult(_0x12174d,_0x351c78))[_0x72ff('0x2e')](handleError(_0x12174d,null));};exports['removeDispositions']=function(_0x6f8d12,_0x51033b,_0x1d4cf9){return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x6f8d12[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x51033b,null))[_0x72ff('0x23')](function(_0x510d26){if(_0x510d26){return _0x510d26[_0x72ff('0x6c')](_0x6f8d12[_0x72ff('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x51033b,null))[_0x72ff('0x2e')](handleError(_0x51033b,null));};exports[_0x72ff('0x6d')]=function(_0xc06ada,_0x31abbe,_0x3679ca){if(_0xc06ada['body']['id']){delete _0xc06ada[_0x72ff('0x5c')]['id'];}return db[_0x72ff('0x54')]['find']({'where':{'id':_0xc06ada[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x31abbe,null))[_0x72ff('0x23')](function(_0x5859ef){if(_0x5859ef){_0xc06ada['body'][_0x72ff('0x66')]=_0x5859ef['id'];return db[_0x72ff('0x6e')][_0x72ff('0x5b')](_0xc06ada[_0x72ff('0x5c')]);}})[_0x72ff('0x23')](respondWithResult(_0x31abbe,null))[_0x72ff('0x2e')](handleError(_0x31abbe,null));};exports[_0x72ff('0x6f')]=function(_0x48d358,_0x289a6e,_0x36087c){var _0x2b1c15={'raw':![],'where':{}};var _0x26a1d2={};var _0x59adfb={'count':0x0,'rows':[]};return db[_0x72ff('0x54')][_0x72ff('0x69')]({'where':{'id':_0x48d358[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x289a6e,null))[_0x72ff('0x23')](function(_0x28425f){if(_0x28425f){_0x26a1d2['model']=_[_0x72ff('0x59')](db[_0x72ff('0x6e')]['rawAttributes']);_0x26a1d2[_0x72ff('0x48')]=_[_0x72ff('0x59')](_0x48d358[_0x72ff('0x48')]);_0x26a1d2[_0x72ff('0x49')]=_['intersection'](_0x26a1d2[_0x72ff('0x46')],_0x26a1d2['query']);_0x2b1c15['attributes']=_['intersection'](_0x26a1d2[_0x72ff('0x46')],qs[_0x72ff('0x4b')](_0x48d358[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x2b1c15[_0x72ff('0x4c')]=_0x2b1c15[_0x72ff('0x4c')][_0x72ff('0x4d')]?_0x2b1c15[_0x72ff('0x4c')]:_0x26a1d2[_0x72ff('0x46')];if(!_0x48d358['query'][_0x72ff('0x4e')](_0x72ff('0x4f'))){_0x2b1c15[_0x72ff('0x35')]=qs[_0x72ff('0x35')](_0x48d358[_0x72ff('0x48')]['limit']);_0x2b1c15[_0x72ff('0x33')]=qs[_0x72ff('0x33')](_0x48d358['query'][_0x72ff('0x33')]);}_0x2b1c15[_0x72ff('0x6a')]=qs[_0x72ff('0x50')](_0x48d358[_0x72ff('0x48')][_0x72ff('0x50')]);_0x2b1c15['where']=qs['filters'](_['pick'](_0x48d358[_0x72ff('0x48')],_0x26a1d2[_0x72ff('0x49')]));_0x2b1c15['where'][_0x72ff('0x66')]=_0x28425f['id'];if(_0x48d358['query'][_0x72ff('0x52')]){_0x2b1c15[_0x72ff('0x51')]=_[_0x72ff('0x53')](_0x2b1c15['where'],{'$or':_[_0x72ff('0x47')](_0x2b1c15[_0x72ff('0x4c')],function(_0x19e02b){var _0x35b73b={};_0x35b73b[_0x19e02b]={'$like':'%'+_0x48d358[_0x72ff('0x48')]['filter']+'%'};return _0x35b73b;})});}_0x2b1c15=_[_0x72ff('0x53')]({},_0x2b1c15,_0x48d358[_0x72ff('0x70')]);return db[_0x72ff('0x6e')]['count']({'where':_0x2b1c15['where']})[_0x72ff('0x23')](function(_0x33aa92){_0x59adfb[_0x72ff('0x36')]=_0x33aa92;if(_0x48d358[_0x72ff('0x48')][_0x72ff('0x55')]){_0x2b1c15['include']=[{'all':!![]}];}return db[_0x72ff('0x6e')][_0x72ff('0x56')](_0x2b1c15);})[_0x72ff('0x23')](function(_0x1cd392){_0x59adfb[_0x72ff('0x57')]=_0x1cd392;return _0x59adfb;});}})[_0x72ff('0x23')](respondWithFilteredResult(_0x289a6e,_0x2b1c15))['catch'](handleError(_0x289a6e,null));};exports[_0x72ff('0x71')]=function(_0xc39b08,_0x510491,_0x5a55c4){return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0xc39b08[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x510491,null))[_0x72ff('0x23')](function(_0x4d59f5){if(_0x4d59f5){return _0x4d59f5[_0x72ff('0x71')](_0xc39b08[_0x72ff('0x48')][_0x72ff('0x72')]);}})['then'](respondWithStatusCode(_0x510491,null))[_0x72ff('0x2e')](handleError(_0x510491,null));};exports[_0x72ff('0x73')]=function(_0x1a20ba,_0x1fb1a2,_0x237ff0){_0x1a20ba[_0x72ff('0x5c')][_0x72ff('0x74')]=_0x1a20ba[_0x72ff('0x75')][_0x72ff('0x76')];return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x1a20ba['params']['id']}})['then'](handleEntityNotFound(_0x1fb1a2,null))[_0x72ff('0x23')](saveUpdates(_0x1a20ba[_0x72ff('0x5c')],null))[_0x72ff('0x23')](respondWithResult(_0x1fb1a2,null))['catch'](handleError(_0x1fb1a2,null));};exports[_0x72ff('0x77')]=function(_0x423bcd,_0x494063,_0x238ff8){_0x423bcd['body'][_0x72ff('0x78')]=_0x423bcd[_0x72ff('0x75')][_0x72ff('0x76')];return db['ChatWebsite']['find']({'where':{'id':_0x423bcd[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x494063,null))[_0x72ff('0x23')](saveUpdates(_0x423bcd['body'],null))[_0x72ff('0x23')](respondWithResult(_0x494063,null))[_0x72ff('0x2e')](handleError(_0x494063,null));};exports['addCustomerAvatar']=function(_0x5cb413,_0x3776b1,_0x1ee990){_0x5cb413[_0x72ff('0x5c')]['customerAvatar']=_0x5cb413[_0x72ff('0x75')]['filename'];return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x5cb413['params']['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x3776b1,null))[_0x72ff('0x23')](saveUpdates(_0x5cb413[_0x72ff('0x5c')],null))['then'](respondWithResult(_0x3776b1,null))[_0x72ff('0x2e')](handleError(_0x3776b1,null));};exports['addSystemAvatar']=function(_0x255cdd,_0x2284f9,_0x5b1205){_0x255cdd[_0x72ff('0x5c')][_0x72ff('0x79')]=_0x255cdd['file'][_0x72ff('0x76')];return db['ChatWebsite'][_0x72ff('0x61')]({'where':{'id':_0x255cdd['params']['id']}})['then'](handleEntityNotFound(_0x2284f9,null))[_0x72ff('0x23')](saveUpdates(_0x255cdd['body'],null))[_0x72ff('0x23')](respondWithResult(_0x2284f9,null))['catch'](handleError(_0x2284f9,null));};exports[_0x72ff('0x7a')]=function(_0x338f46,_0x41578c,_0x3aa748){var _0x59551f=path[_0x72ff('0x7b')](config['root'],'server/files/images/logos/default_logo.svg');var _0x4013b9={'where':{'id':_0x338f46[_0x72ff('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4d33a6=![];return require('../../config/license/util')[_0x72ff('0x7c')]()[_0x72ff('0x23')](function(_0x51f32c){if(_0x51f32c){_0x4d33a6=_0x51f32c[_0x72ff('0x7d')];}})[_0x72ff('0x23')](function(){return db[_0x72ff('0x54')][_0x72ff('0x61')](_0x4013b9);})[_0x72ff('0x23')](handleEntityNotFound(_0x41578c,null))[_0x72ff('0x23')](function(_0x317b0d){if(_0x317b0d){if(!_['isNil'](_0x317b0d[_0x72ff('0x74')])){if(fs[_0x72ff('0x7e')](path['join'](config[_0x72ff('0x7f')],_0x72ff('0x80'),_0x317b0d[_0x72ff('0x74')]))&&_0x4d33a6){_0x59551f=path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],_0x72ff('0x80'),_0x317b0d[_0x72ff('0x74')]);}}return _0x41578c['download'](_0x59551f);}})[_0x72ff('0x2e')](handleError(_0x41578c,null));};exports[_0x72ff('0x81')]=function(_0x48076e,_0x3e2884,_0x5e4aea){var _0x28dd44=path['join'](config[_0x72ff('0x7f')],_0x72ff('0x82'));var _0x4495ee={'where':{'id':_0x48076e[_0x72ff('0x58')]['id']},'attributes':['id',_0x72ff('0x78')],'raw':!![]};return db['ChatWebsite'][_0x72ff('0x61')](_0x4495ee)[_0x72ff('0x23')](handleEntityNotFound(_0x3e2884,null))[_0x72ff('0x23')](function(_0x1e19f6){if(_0x1e19f6){if(!_['isNil'](_0x1e19f6[_0x72ff('0x78')])){if(fs[_0x72ff('0x7e')](path['join'](config[_0x72ff('0x7f')],_0x72ff('0x83'),_0x1e19f6[_0x72ff('0x78')]))){_0x28dd44=path[_0x72ff('0x7b')](config['root'],'server/files/images/avatars/',_0x1e19f6[_0x72ff('0x78')]);}}return _0x3e2884['download'](_0x28dd44);}})[_0x72ff('0x2e')](handleError(_0x3e2884,null));};exports[_0x72ff('0x84')]=function(_0x5b4820,_0x4ed5bc,_0x11360f){var _0x45ef94=path['join'](config[_0x72ff('0x7f')],'server/files/images/avatars/customer_avatar.png');var _0x8ea2f2={'where':{'id':_0x5b4820[_0x72ff('0x58')]['id']},'attributes':['id',_0x72ff('0x85'),_0x72ff('0x86')],'raw':!![]};return db[_0x72ff('0x54')][_0x72ff('0x61')](_0x8ea2f2)[_0x72ff('0x23')](handleEntityNotFound(_0x4ed5bc,null))[_0x72ff('0x23')](function(_0x306b6d){if(_0x306b6d){if(!_[_0x72ff('0x87')](_0x306b6d[_0x72ff('0x85')])){if(fs[_0x72ff('0x7e')](path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],_0x72ff('0x83'),_0x306b6d[_0x72ff('0x85')]))&&_0x306b6d[_0x72ff('0x86')]){_0x45ef94=path['join'](config[_0x72ff('0x7f')],_0x72ff('0x83'),_0x306b6d[_0x72ff('0x85')]);}}return _0x4ed5bc['download'](_0x45ef94);}})['catch'](handleError(_0x4ed5bc,null));};exports[_0x72ff('0x88')]=function(_0x36c85b,_0x491d8d,_0x4f58be){var _0x5cc626=path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],_0x72ff('0x89'));var _0xf1b60f={'where':{'id':_0x36c85b[_0x72ff('0x58')]['id']},'attributes':['id',_0x72ff('0x79')],'raw':!![]};return db[_0x72ff('0x54')][_0x72ff('0x61')](_0xf1b60f)[_0x72ff('0x23')](handleEntityNotFound(_0x491d8d,null))[_0x72ff('0x23')](function(_0x92892){if(_0x92892){if(!_['isNil'](_0x92892[_0x72ff('0x79')])){if(fs[_0x72ff('0x7e')](path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],'server/files/images/avatars/',_0x92892[_0x72ff('0x79')]))){_0x5cc626=path[_0x72ff('0x7b')](config['root'],_0x72ff('0x83'),_0x92892[_0x72ff('0x79')]);}}return _0x491d8d[_0x72ff('0x8a')](_0x5cc626);}})['catch'](handleError(_0x491d8d,null));};exports['notify']=function(_0x974897,_0x37cc67,_0x1860a2){var _0x42cf26=require(_0x72ff('0x8b'));var _0x3a2516=new _0x42cf26();var _0xb0e47b=_0x3a2516['setUA'](_0x974897[_0x72ff('0x8c')][_0x72ff('0x8d')])['getResult']();var _0x50a2b8={'body':_0x974897[_0x72ff('0x5c')],'channel':_0x72ff('0x8e')};var _0x576d7e=[];var _0x3b4fa5=[];var _0x4e2885={};var _0x5a83c2=![];return db[_0x72ff('0x8f')][_0x72ff('0x65')]()[_0x72ff('0x23')](function(_0x488782){if(!_0x488782){throw new db[(_0x72ff('0x90'))][(_0x72ff('0x91'))](_0x72ff('0x92'));}_0x576d7e=_[_0x72ff('0x93')](_[_0x72ff('0x59')](_0x488782),[_0x72ff('0x94'),_0x72ff('0x95')]);_0x3b4fa5=_['difference'](_[_0x72ff('0x59')](_0x488782),[_0x72ff('0x94'),'updatedAt',_0x72ff('0x96'),_0x72ff('0x97')]);if(_0x974897[_0x72ff('0x5c')]['id']){delete _0x974897[_0x72ff('0x5c')]['id'];}if(_['isNil'](_0x974897[_0x72ff('0x5c')]['from'])){throw new db[(_0x72ff('0x90'))]['ValidationError'](_0x72ff('0x98'));}if(_[_0x72ff('0x87')](_0x974897[_0x72ff('0x5c')]['body'])||_0x974897[_0x72ff('0x5c')]['body']===''){throw new db[(_0x72ff('0x90'))][(_0x72ff('0x91'))](_0x72ff('0x99'));}if(_[_0x72ff('0x87')](_0x974897['body'][_0x72ff('0x9a')])){throw new db[(_0x72ff('0x90'))]['ValidationError'](_0x72ff('0x9b')+_0x3b4fa5);}if(!_[_0x72ff('0x9c')](_0x3b4fa5,_0x974897['body'][_0x72ff('0x9a')])){throw new db[(_0x72ff('0x90'))][(_0x72ff('0x91'))](_0x72ff('0x9d')+_0x3b4fa5);}_0x4e2885[_0x974897['body'][_0x72ff('0x9a')]]=_0x974897[_0x72ff('0x5c')][_0x72ff('0x9e')];})['then'](function(){return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x974897['params']['id']},'include':[{'model':db[_0x72ff('0x9f')],'as':_0x72ff('0xa0'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4e2885,'limit':0x1,'order':[['updatedAt',_0x72ff('0xa1')]]}]},{'model':db[_0x72ff('0xa2')],'as':_0x72ff('0xa3')}]});})[_0x72ff('0x23')](handleEntityNotFound(_0x37cc67,null))[_0x72ff('0x23')](function(_0x2159ab){if(_0x2159ab&&_0x2159ab['List']){_0x50a2b8['account']=_0x2159ab;_0x50a2b8['applications']=_0x2159ab['Applications'];_0x50a2b8[_0x72ff('0xa4')]=_0x2159ab[_0x72ff('0xa0')];_0x50a2b8[_0x72ff('0xa5')]=_[_0x72ff('0xa6')](_0x50a2b8['applications'],[_0x72ff('0xa7')],['asc']);if(_0x50a2b8['account'][_0x72ff('0xa3')]){delete _0x50a2b8[_0x72ff('0xa8')][_0x72ff('0xa3')];}if(_0x50a2b8[_0x72ff('0xa8')][_0x72ff('0xa0')]&&_0x50a2b8['account'][_0x72ff('0xa0')][_0x72ff('0xa9')][_0x72ff('0x4d')]){return _0x50a2b8['account'][_0x72ff('0xa0')][_0x72ff('0xa9')][0x0];}var _0x2e61cc=_[_0x72ff('0x1b')](_0x974897[_0x72ff('0x5c')],{'firstName':_0x974897[_0x72ff('0x5c')][_0x72ff('0x9e')],'ListId':_0x2159ab[_0x72ff('0x97')]});_0x2e61cc[_0x974897['body'][_0x72ff('0x9a')]]=_0x974897[_0x72ff('0x5c')][_0x72ff('0x9e')];return db[_0x72ff('0x8f')][_0x72ff('0x5b')](_0x2e61cc,{'fields':_0x576d7e,'raw':!![]});}})[_0x72ff('0x23')](handleEntityNotFound(_0x37cc67,null))[_0x72ff('0x23')](function(_0x56a11a){_0x50a2b8['contact']=_0x56a11a;var _0x150f88=_0x974897[_0x72ff('0x5c')][_0x72ff('0xaa')];if(_0x974897['headers']['cf-connecting-ip']){_0x150f88=_0x974897[_0x72ff('0x8c')][_0x72ff('0xab')];}else if(_0x974897[_0x72ff('0x8c')][_0x72ff('0xac')]){_0x150f88=_['first'](_0x974897[_0x72ff('0x8c')][_0x72ff('0xac')][_0x72ff('0xad')](','));}if(_0x56a11a){var _0xa0fa72={'ContactId':_0x56a11a['id'],'ChatWebsiteId':_0x974897[_0x72ff('0x58')]['id'],'from':(_0x56a11a[_0x72ff('0xae')]||'')+'\x20'+(_0x56a11a[_0x72ff('0xaf')]||''),'customerIp':_0x150f88,'customerPort':_0x974897[_0x72ff('0x8c')]['x-real-port']?_0x974897[_0x72ff('0x8c')]['x-real-port']:null,'referer':_0x974897[_0x72ff('0x5c')][_0x72ff('0xb0')],'browserName':_0xb0e47b[_0x72ff('0xb1')][_0x72ff('0x40')]&&_0xb0e47b[_0x72ff('0xb1')]['version']?util[_0x72ff('0xb2')](_0x72ff('0xb3'),_0xb0e47b[_0x72ff('0xb1')][_0x72ff('0x40')],_0xb0e47b['browser'][_0x72ff('0xb4')]):_0x72ff('0xb5'),'browserVersion':_0xb0e47b[_0x72ff('0xb1')][_0x72ff('0xb4')]||'unknown','osName':util[_0x72ff('0xb2')](_0x72ff('0xb3'),_0xb0e47b['os']['name'],_0xb0e47b['os'][_0x72ff('0xb4')]),'osVersion':_0xb0e47b['os']['version'],'deviceModel':_0xb0e47b['device']['model']&&_0xb0e47b['device'][_0x72ff('0xb6')]?util[_0x72ff('0xb2')](_0x72ff('0xb7'),_0xb0e47b[_0x72ff('0xb8')][_0x72ff('0x46')],_0xb0e47b['device'][_0x72ff('0xb6')],_0xb0e47b[_0x72ff('0xb8')][_0x72ff('0x44')]):null,'deviceVendor':_0xb0e47b[_0x72ff('0xb8')][_0x72ff('0xb6')],'deviceType':_0xb0e47b['device'][_0x72ff('0x44')],'formData':JSON[_0x72ff('0x29')](_0x974897[_0x72ff('0x5c')])};var _0x480897={'ChatWebsiteId':_0x974897[_0x72ff('0x58')]['id'],'closed':![]};if(_0x974897[_0x72ff('0x5c')][_0x72ff('0xb9')]){_0x480897[_0x72ff('0xb9')]=_0x974897['body'][_0x72ff('0xb9')];return db[_0x72ff('0xba')][_0x72ff('0x61')]({'where':_0x480897})[_0x72ff('0x23')](function(_0x383357){if(_0x383357){return[_0x383357,![]];}_0xa0fa72[_0x72ff('0xb9')]=_0x974897['body'][_0x72ff('0xb9')];_0xa0fa72[_0x72ff('0xbb')]=_0x974897[_0x72ff('0x5c')]['externalUrl'];return db[_0x72ff('0xba')][_0x72ff('0x5b')](_0xa0fa72)['then'](function(_0x50e29c){return[_0x50e29c,!![]];});});}_0x480897['ContactId']=_0x56a11a['id'];if(_0x974897[_0x72ff('0x5c')][_0x72ff('0xbc')]&&_0x974897['body'][_0x72ff('0xbc')]['id']){_0x480897['id']=_0x974897[_0x72ff('0x5c')][_0x72ff('0xbc')]['id'];return db[_0x72ff('0xba')][_0x72ff('0x61')]({'where':_0x480897})[_0x72ff('0x23')](function(_0x2c4705){if(_0x2c4705){return[_0x2c4705,![]];}return db[_0x72ff('0xba')][_0x72ff('0x5b')](_0xa0fa72)['then'](function(_0x162f95){return[_0x162f95,!![]];});});}return db[_0x72ff('0xba')]['create'](_0xa0fa72)[_0x72ff('0x23')](function(_0x20ab25){return[_0x20ab25,!![]];});}})['spread'](function(_0x253db8,_0x8b8695){if(_0x253db8){_0x5a83c2=_0x8b8695;if(!_0x8b8695){var _0x97ea48={'from':(_0x50a2b8[_0x72ff('0xbd')][_0x72ff('0xae')]||'')+'\x20'+(_0x50a2b8[_0x72ff('0xbd')][_0x72ff('0xaf')]||'')};if(_0x974897['body'][_0x72ff('0xb9')]&&_0x974897[_0x72ff('0x5c')]['messageId']&&_0x974897[_0x72ff('0x5c')][_0x72ff('0xb9')]!=_0x974897['body'][_0x72ff('0xbe')]){_0x97ea48[_0x72ff('0xb9')]=_0x974897[_0x72ff('0x5c')][_0x72ff('0xbe')];}return _0x253db8[_0x72ff('0x3b')](_0x97ea48);}else{return _0x253db8;}}})[_0x72ff('0x23')](function(_0x296163){_0x50a2b8[_0x72ff('0xbc')]=_0x296163[_0x72ff('0x3d')]({'plain':!![]});_0x50a2b8['interaction']['created']=_0x5a83c2;if(_0x50a2b8['interaction']['created']){if(_0x50a2b8[_0x72ff('0xa8')][_0x72ff('0xbf')]){_0x50a2b8[_0x72ff('0xa5')]['push']({'id':0x0,'priority':_0x50a2b8[_0x72ff('0xa5')][_0x72ff('0x4d')]+0x1,'app':_0x72ff('0xc0'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0x72ff('0x5b')]({'body':_0x974897[_0x72ff('0x5c')][_0x72ff('0x5c')],'ChatWebsiteId':_0x974897[_0x72ff('0x58')]['id'],'ChatInteractionId':_0x296163['id'],'direction':'in','ContactId':_0x50a2b8[_0x72ff('0xbd')]['id'],'AttachmentId':_0x974897[_0x72ff('0x5c')][_0x72ff('0xc1')]});})[_0x72ff('0x23')](function(_0x22924f){_0x50a2b8[_0x72ff('0x2c')]=_0x22924f;if(_0x50a2b8[_0x72ff('0xbc')][_0x72ff('0xc2')]){return db[_0x72ff('0xc3')]['find']({'attributes':['id',_0x72ff('0x40')],'where':{'id':_0x50a2b8[_0x72ff('0xbc')]['UserId']}})['then'](function(_0x3ed77f){if(_0x3ed77f){_0x50a2b8['applications'][_0x72ff('0xc4')]({'id':0x0,'priority':0x0,'app':_0x72ff('0xc5'),'appdata':_0x3ed77f[_0x72ff('0x40')]+','+(_0x50a2b8[_0x72ff('0xa8')]['waitForTheAssignedAgent']||0xa),'interval':_0x72ff('0xc6')});_0x50a2b8[_0x72ff('0xc7')]=!![];}return respondWithRpcPromise(_0x72ff('0xc8'),_0x72ff('0xc9'),_0x50a2b8);});}return respondWithRpcPromise(_0x72ff('0xc8'),_0x72ff('0xc9'),_0x50a2b8);})[_0x72ff('0x23')](function(_0x5be021){respondWithRpcPromise(_0x72ff('0xca'),'EventManager',{'event':'notify','message':_0x5be021},client9002);return _0x5be021;})[_0x72ff('0x23')](respondWithResult(_0x37cc67,null))[_0x72ff('0x2e')](handleError(_0x37cc67,null));};exports[_0x72ff('0xcb')]=function(_0x4478d3,_0x34e02a,_0x427d09){var _0x1fec9c,_0x5a38a7,_0x29b950;var _0x1616bd=[];var _0x176386=[];var _0x589eaa={};var _0x5a5b17=_0x4478d3[_0x72ff('0xcc')]||[];var _0x49f043=[];var _0x4e2bea;return db[_0x72ff('0x8f')][_0x72ff('0x65')]()[_0x72ff('0x23')](function(_0x3e1c5a){if(!_0x3e1c5a){throw new db[(_0x72ff('0x90'))][(_0x72ff('0x91'))](_0x72ff('0x92'));}_0x176386=_[_0x72ff('0x93')](_[_0x72ff('0x59')](_0x3e1c5a),['createdAt',_0x72ff('0x95')]);_0x1616bd=_['difference'](_[_0x72ff('0x59')](_0x3e1c5a),['createdAt','updatedAt',_0x72ff('0x96'),_0x72ff('0x97')]);if(_0x4478d3[_0x72ff('0x5c')]['id']){delete _0x4478d3[_0x72ff('0x5c')]['id'];}if(_[_0x72ff('0x87')](_0x4478d3[_0x72ff('0x5c')][_0x72ff('0x9e')])){throw _0x34e02a[_0x72ff('0x30')](0x1f4)[_0x72ff('0xcd')](new db[(_0x72ff('0x90'))][(_0x72ff('0x91'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x4478d3[_0x72ff('0x5c')]['body'])||_0x4478d3[_0x72ff('0x5c')][_0x72ff('0x5c')]===''){throw _0x34e02a[_0x72ff('0x30')](0x1f4)[_0x72ff('0xcd')](new db[(_0x72ff('0x90'))][(_0x72ff('0x91'))](_0x72ff('0x99')));}if(_['isNil'](_0x4478d3[_0x72ff('0x5c')]['mapKeyOffline'])){throw _0x34e02a[_0x72ff('0x30')](0x1f4)[_0x72ff('0xcd')](new db[(_0x72ff('0x90'))]['ValidationError'](_0x72ff('0xce')+_0x1616bd));}if(!_[_0x72ff('0x9c')](_0x1616bd,_0x4478d3[_0x72ff('0x5c')][_0x72ff('0xcf')])){throw _0x34e02a['status'](0x1f4)[_0x72ff('0xcd')](new db[(_0x72ff('0x90'))]['ValidationError'](_0x72ff('0xd0')+_0x1616bd));}_0x589eaa[_0x4478d3[_0x72ff('0x5c')][_0x72ff('0xcf')]]=_0x4478d3[_0x72ff('0x5c')][_0x72ff('0x9e')];})[_0x72ff('0x23')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4478d3['params']['id']},'include':[{'model':db['CmList'],'as':_0x72ff('0xa0')},{'model':db[_0x72ff('0xd1')],'as':_0x72ff('0xd1')}]});})[_0x72ff('0x23')](handleEntityNotFound(_0x34e02a,null))[_0x72ff('0x23')](function(_0x4647f5){if(_0x4647f5&&_0x4647f5['List']){_0x5a38a7=_0x4647f5;var _0x2f2863=_[_0x72ff('0x1b')](_0x4478d3[_0x72ff('0x5c')],{'firstName':_0x4478d3[_0x72ff('0x5c')][_0x72ff('0x9e')],'phone':_0x4478d3[_0x72ff('0x5c')][_0x72ff('0x9e')],'ListId':_0x4647f5[_0x72ff('0x97')]});_0x2f2863[_0x4478d3[_0x72ff('0x5c')][_0x72ff('0xcf')]]=_0x4478d3['body'][_0x72ff('0x9e')];return db['CmContact'][_0x72ff('0xd2')]({'where':_0x589eaa,'defaults':_0x2f2863});}})[_0x72ff('0xd3')](function(_0x8b85b7){if(_0x8b85b7){_0x29b950=_0x8b85b7;var _0x265b7e=fs[_0x72ff('0xd4')](path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],_0x72ff('0xd5')),'utf8');var _0xf38104=ejs[_0x72ff('0xd6')](_0x265b7e,{'body':_[_0x72ff('0xd7')](_0x4478d3['body']['body']),'bodyTitle':_0x5a38a7[_0x72ff('0xd8')]});return db['ChatOfflineMessage'][_0x72ff('0x5b')]({'body':_0xf38104,'ContactId':_0x8b85b7['id'],'ChatWebsiteId':_0x5a38a7['id']});}})['then'](function(_0x5a9c9c){_0x4e2bea=_0x5a9c9c;if(_0x5a5b17[_0x72ff('0x4d')]){var _0x50d729=_0x5a5b17['map'](function(_0x454716){return{'name':_0x454716[_0x72ff('0xd9')],'basename':_0x454716[_0x72ff('0x76')],'type':_0x454716[_0x72ff('0xda')],'ChatOfflineMessageId':_0x5a9c9c['id']};});_0x49f043=_0x50d729[_0x72ff('0x47')](_0x3058eb=>{var _0xefd43b={'filename':_0x3058eb[_0x72ff('0x40')],'path':path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],'server','files',_0x72ff('0xdb'),_0x72ff('0xdc'),_0x3058eb['basename'])};return _0xefd43b;});if(!_0x5a38a7[_0x72ff('0xdd')]){return db['sequelize'][_0x72ff('0xde')](function(_0x1deb92){return db[_0x72ff('0xdf')][_0x72ff('0xe0')](_0x50d729,{'transaction':_0x1deb92});});}}})['then'](function(){if(_0x4e2bea){_0x1fec9c=_0x4e2bea;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x72ff('0xe1')],'as':'Smtp','raw':!![]}]});}})[_0x72ff('0x23')](function(_0x41c3ea){if(_0x41c3ea&&_0x41c3ea['Smtp']&&_0x5a38a7[_0x72ff('0xe2')]&&_0x5a38a7[_0x72ff('0xe3')]){var _0x4114e1={'tls':{'rejectUnauthorized':![]}};if(_0x41c3ea['Smtp'][_0x72ff('0xe4')]){_0x4114e1[_0x72ff('0xe4')]=_0x41c3ea[_0x72ff('0xe5')][_0x72ff('0xe4')];}else{_0x4114e1['host']=_0x41c3ea['Smtp'][_0x72ff('0xe6')];_0x4114e1[_0x72ff('0xe7')]=_0x41c3ea[_0x72ff('0xe5')]['port'];_0x4114e1[_0x72ff('0xe8')]=_0x41c3ea['Smtp'][_0x72ff('0xe8')];}if(_0x41c3ea['Smtp'][_0x72ff('0xe9')]){_0x4114e1[_0x72ff('0xea')]={'user':_0x41c3ea[_0x72ff('0xe5')][_0x72ff('0x5d')],'pass':_0x41c3ea[_0x72ff('0xe5')]['pass']};}return respondWithRpcPromise(_0x72ff('0xeb'),_0x72ff('0xec'),{'account':_0x4114e1,'message':{'from':util[_0x72ff('0xb2')](_0x72ff('0xed'),_0x41c3ea['name'],_0x41c3ea[_0x72ff('0xee')]||_0x41c3ea[_0x72ff('0xe5')][_0x72ff('0x5d')]),'to':_0x5a38a7['forwardOfflineAddress'],'subject':_0x5a38a7[_0x72ff('0xef')],'html':_0x1fec9c['body'],'attachments':_0x49f043}},client9003)[_0x72ff('0x23')](function(){return _0x1fec9c;})[_0x72ff('0x2e')](function(_0x27a123){console[_0x72ff('0x2b')](_0x27a123);});}})[_0x72ff('0x23')](function(){if(_0x5a38a7&&_0x5a38a7[_0x72ff('0xdd')]&&_0x5a38a7[_0x72ff('0xf0')]){var _0xf35b00=[];if(_0x5a5b17[_0x72ff('0x4d')]){_0xf35b00=_0x5a5b17[_0x72ff('0x47')](function(_0x5b4a5a){return{'name':_0x5b4a5a[_0x72ff('0xd9')],'basename':_0x5b4a5a['filename'],'type':_0x5b4a5a[_0x72ff('0xda')],'ChatOfflineMessageId':_0x4e2bea['id']};});}var _0x256c3;if(!_['isNil'](_0x5a38a7[_0x72ff('0xf1')])){var _0x14b78e=_[_0x72ff('0x47')](_0x4478d3[_0x72ff('0x5c')],function(_0x331f7d){return _0x331f7d;});var _0x38e48d=_['toPairsIn'](_0x14b78e)[0x0];var _0x514611=_[_0x72ff('0xf2')](_0x38e48d,function(_0x287a1c){return _0x287a1c;});_0x256c3=_0x514611[0x1][_0x5a38a7[_0x72ff('0xf1')]];}var _0x30263d={'from':_0x29b950[_0x72ff('0xee')],'firstName':_0x29b950[_0x72ff('0xae')],'lastName':_0x29b950[_0x72ff('0xaf')],'mapKey':_0x72ff('0xee'),'message':{'from':_0x29b950[_0x72ff('0xee')],'to':_0x5a38a7[_0x72ff('0xd1')][_0x72ff('0xee')],'cc':'','subject':_[_0x72ff('0x87')](_0x256c3)?_0x5a38a7[_0x72ff('0xef')]:_0x256c3,'messageId':'','sentAt':new Date(),'attach':_0xf35b00[_0x72ff('0x4d')],'attachments':_0xf35b00,'originChannel':'Chat','ChatWebsiteId':_0x5a38a7['id'],'ChatOfflineMessageId':_0x1fec9c['id'],'originTo':_0x5a38a7[_0x72ff('0xd1')][_0x72ff('0xee')]},'body':_0x1fec9c[_0x72ff('0x5c')]};var _0x177f02={'account':{'id':_0x5a38a7['MailAccountId']},'body':_0x30263d,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x72ff('0xf3'),_0x72ff('0xf4'),_0x177f02,client9001)['then'](function(){return _0x1fec9c;})['catch'](function(_0x1859b6){console[_0x72ff('0x2b')](_0x1859b6);});}return;})['then'](function(){if(_0x1fec9c){return _0x1fec9c;}})['then'](respondWithResult(_0x34e02a,null))[_0x72ff('0x2e')](function(_0x4a4292){console[_0x72ff('0x2b')](_0x72ff('0x2e'),_0x4a4292);for(var _0x11e1c8 of _0x5a5b17){var _0x85369e=path['join'](config[_0x72ff('0x7f')],_0x72ff('0xf5'),'files',_0x72ff('0xdb'),_0x72ff('0xdc'),_0x11e1c8[_0x72ff('0x76')]);fs_extra[_0x72ff('0xf6')](_0x85369e)[_0x72ff('0x2e')](function(_0xc1b98c){console['error'](_0x72ff('0xf7'),_0x85369e,_0xc1b98c);});}});};exports[_0x72ff('0xf8')]=function(_0x16f3c5,_0x77ae4f,_0x2de124){return db[_0x72ff('0xba')][_0x72ff('0x61')]({'where':{'id':_0x16f3c5['params']['id']}})['then'](handleEntityNotFound(_0x77ae4f,null))['then'](function(_0x260757){if(_0x260757){return _0x260757[_0x72ff('0xf8')](_0x16f3c5[_0x72ff('0x5c')][_0x72ff('0x72')],_[_0x72ff('0xf9')](_0x16f3c5['body'],[_0x72ff('0x72'),'id'])||{});}})['then'](respondWithResult(_0x77ae4f,null))[_0x72ff('0x2e')](handleError(_0x77ae4f,null));};exports[_0x72ff('0xfa')]=function(_0x1f2f37,_0x27b562,_0xc6ddeb){var _0x55e3d5={'raw':![],'where':{}};var _0x372144={};var _0x4cb8d5={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1f2f37[_0x72ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x27b562,null))[_0x72ff('0x23')](function(_0x5e1c3d){if(_0x5e1c3d){_0x372144[_0x72ff('0x46')]=_[_0x72ff('0x59')](db[_0x72ff('0xba')]['rawAttributes']);_0x372144[_0x72ff('0x48')]=_[_0x72ff('0x59')](_0x1f2f37[_0x72ff('0x48')]);_0x372144[_0x72ff('0x49')]=_[_0x72ff('0x4a')](_0x372144[_0x72ff('0x46')],_0x372144['query']);_0x55e3d5[_0x72ff('0x4c')]=_[_0x72ff('0x4a')](_0x372144[_0x72ff('0x46')],qs[_0x72ff('0x4b')](_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x55e3d5[_0x72ff('0x4c')]=_0x55e3d5['attributes'][_0x72ff('0x4d')]?_0x55e3d5[_0x72ff('0x4c')]:_0x372144['model'];if(!_0x1f2f37['query']['hasOwnProperty'](_0x72ff('0x4f'))){_0x55e3d5[_0x72ff('0x35')]=qs['limit'](_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x35')]);_0x55e3d5['offset']=qs['offset'](_0x1f2f37['query'][_0x72ff('0x33')]);}_0x55e3d5['order']=qs[_0x72ff('0x50')](_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x50')]);_0x55e3d5[_0x72ff('0x51')]=qs['filters'](_['pick'](_0x1f2f37[_0x72ff('0x48')],_0x372144[_0x72ff('0x49')]));_0x55e3d5[_0x72ff('0x51')][_0x72ff('0x66')]=_0x5e1c3d['id'];if(_0x1f2f37['query'][_0x72ff('0x52')]){_0x55e3d5[_0x72ff('0x51')]=_[_0x72ff('0x53')](_0x55e3d5[_0x72ff('0x51')],{'$or':_[_0x72ff('0x47')](_0x55e3d5[_0x72ff('0x4c')],function(_0x3c6d75){var _0xe4ae3d={};_0xe4ae3d[_0x3c6d75]={'$like':'%'+_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x52')]+'%'};return _0xe4ae3d;})});}_0x55e3d5=_[_0x72ff('0x53')]({},_0x55e3d5,_0x1f2f37[_0x72ff('0x70')]);return db['ChatInteraction']['count']({'where':_0x55e3d5[_0x72ff('0x51')]})[_0x72ff('0x23')](function(_0x12ec64){_0x4cb8d5[_0x72ff('0x36')]=_0x12ec64;if(_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x55')]){_0x55e3d5[_0x72ff('0x5a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x72ff('0xc3')],'as':_0x72ff('0xfb'),'attributes':['name',_0x72ff('0xfc'),_0x72ff('0xfd')],'required':![]},{'model':db[_0x72ff('0xfe')],'as':_0x72ff('0xff'),'attributes':['id','name',_0x72ff('0x100')],'where':_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x101')]?{'id':_0x1f2f37[_0x72ff('0x48')][_0x72ff('0x101')]}:undefined,'required':_0x1f2f37['query'][_0x72ff('0x101')]?!![]:![]}];}return db[_0x72ff('0xba')][_0x72ff('0x56')](_0x55e3d5);})[_0x72ff('0x23')](function(_0x2132da){_0x4cb8d5['rows']=_0x2132da;return _0x4cb8d5;});}})[_0x72ff('0x23')](respondWithFilteredResult(_0x27b562,_0x55e3d5))[_0x72ff('0x2e')](handleError(_0x27b562,null));};function iftimePromise(_0x8b70a4,_0x1f9a87){return respondWithRpcPromise('Command',_0x72ff('0x102'),{'command':_0x1f9a87[_0x72ff('0x103')]?util[_0x72ff('0xb2')]('iftime\x20%s,%s',_0x8b70a4[_0x72ff('0x104')],_0x1f9a87[_0x72ff('0x103')]):util[_0x72ff('0xb2')](_0x72ff('0x105'),_0x8b70a4[_0x72ff('0x104')])},client9002)[_0x72ff('0x23')](function(_0x7212e1){var _0x14c3d8=_0x7212e1&&_0x7212e1['indexOf'](_0x72ff('0x106'))>=0x0?!![]:![];logger[_0x72ff('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1f9a87['id'],_0x8b70a4['id'],_0x8b70a4['interval'],_0x14c3d8?_0x72ff('0x107'):'OFFLINE',_0x1f9a87[_0x72ff('0x103')]?_0x1f9a87[_0x72ff('0x103')]:_0x72ff('0x108'));return _0x14c3d8;})[_0x72ff('0x2e')](function(_0x538c20){logger['error'](_0x72ff('0x109'),_0x1f9a87['id'],_0x8b70a4['id'],_0x8b70a4['interval'],util[_0x72ff('0x10a')](_0x538c20,{'showHidden':![],'depth':null}),_0x1f9a87[_0x72ff('0x103')]?_0x1f9a87['timezone']:_0x72ff('0x108'));return![];});}exports[_0x72ff('0x102')]=function(_0x4bf417,_0x2a0eb3,_0xa15eaf){var _0x33e24=0x0;var _0x201533=0x0;var _0x1eeb6f=![];var _0x299fea;var _0xf1eac1;return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x4bf417[_0x72ff('0x58')]['id']},'include':[{'model':db[_0x72ff('0x10b')],'as':_0x72ff('0x10b'),'include':[{'model':db[_0x72ff('0x10b')],'as':_0x72ff('0x10c'),'attributes':['id',_0x72ff('0x104')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2a0eb3,null))[_0x72ff('0x23')](function(_0x328a58){if(_0x328a58){_0x299fea=_0x328a58;return _0x328a58[_0x72ff('0x10d')]({'raw':!![]});}})[_0x72ff('0x23')](function(_0x3b2f9b){if(_0x299fea){if(_0x3b2f9b){_0xf1eac1=_0x3b2f9b;}}return require(_0x72ff('0x18'))['getLicense']();})[_0x72ff('0x23')](function(_0x103e99){if(_0x103e99){_0x201533=_0x103e99['virtual'];_0x1eeb6f=_0x103e99[_0x72ff('0x7d')];}})[_0x72ff('0x23')](function(){return db['ChatInteraction'][_0x72ff('0x36')]({'where':{'closed':![]}});})[_0x72ff('0x23')](function(_0x18b49b){_0x33e24=_0x18b49b;if(_0x201533&&_0x18b49b>_0x201533){return db[_0x72ff('0x10e')][_0x72ff('0x69')]({'where':{'id':0x1}})[_0x72ff('0x23')](function(_0x2fccf1){if(_0x2fccf1){_0x2fccf1['increment']('chatLicenseExceeded');}});}})[_0x72ff('0x23')](function(){if(_0x299fea[_0x72ff('0x10b')]&&_0x299fea['Interval']['Intervals']){var _0x34559c=[];for(var _0x4790e0=0x0;_0x4790e0<_0x299fea[_0x72ff('0x10b')][_0x72ff('0x10c')][_0x72ff('0x4d')];_0x4790e0++){var _0x50d0dd=_0x299fea[_0x72ff('0x10b')][_0x72ff('0x10c')][_0x4790e0][_0x72ff('0x3d')]({'plain':!![]});_0x34559c['push'](iftimePromise(_0x50d0dd,_0x299fea));}return BPromise['all'](_0x34559c)[_0x72ff('0x23')](function(_0x3d9d5d){return _[_0x72ff('0x10f')](_0x3d9d5d);});}else{return!![];}})[_0x72ff('0x23')](function(_0x427eb5){var _0x312ccb=fs[_0x72ff('0xd4')](path[_0x72ff('0x7b')](config[_0x72ff('0x7f')],_0x72ff('0x110')),_0x72ff('0x111'));var _0x39e012={'remote':_0x299fea[_0x72ff('0x112')],'query':querystring['stringify'](_[_0x72ff('0x53')](_0x299fea[_0x72ff('0x3d')]({'plain':!![]}),{'customerIp':_0x4bf417[_0x72ff('0x8c')]['x-forwarded-for']||_0x4bf417[_0x72ff('0x8c')][_0x72ff('0x113')]||_0x4bf417['connection'][_0x72ff('0x114')]||_0x4bf417['ip'],'referer':_0x4bf417[_0x72ff('0x8c')][_0x72ff('0xb0')],'openedInteractions':_0x33e24,'maxInteractions':_0x201533,'virtual':_0x1eeb6f[_0x72ff('0x115')],'online':_0x427eb5,'custom':_0x1eeb6f}))[_0x72ff('0x116')](/'/g,'\x5c\x27')};_0x2a0eb3[_0x72ff('0xcd')](ejs[_0x72ff('0xd6')](Mustache['render'](_0x312ccb,_0x39e012),{'proactiveActions':_0xf1eac1,'alignment':_0x299fea[_0x72ff('0x117')],'verticalAlignment':_0x299fea[_0x72ff('0x118')],'div_color':_0x299fea[_0x72ff('0x100')],'text_color':_0x299fea[_0x72ff('0x119')],'button_color':_0x299fea[_0x72ff('0x11a')],'background_color':_0x299fea[_0x72ff('0x11b')]}));})[_0x72ff('0x2e')](handleError(_0x2a0eb3,null));};exports[_0x72ff('0x11c')]=function(_0x4fcdc8,_0x51474a,_0x4bcbd6){return db[_0x72ff('0x54')]['findOne']({'where':{'id':_0x4fcdc8[_0x72ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x51474a,null))[_0x72ff('0x23')](function(_0x1dd1a6){if(_0x1dd1a6){return db[_0x72ff('0x11d')][_0x72ff('0xde')](function(_0x3605e8){return db[_0x72ff('0xa2')][_0x72ff('0x3c')]({'where':{'ChatWebsiteId':_0x4fcdc8['params']['id']},'transaction':_0x3605e8})[_0x72ff('0x23')](function(_0x4346d1){var _0x3c3c06=_['map'](_0x4fcdc8['body'],function(_0x5db279){_0x5db279[_0x72ff('0x66')]=_0x4fcdc8[_0x72ff('0x58')]['id'];return _0x5db279;});return db[_0x72ff('0xa2')]['bulkCreate'](_0x3c3c06,{'transaction':_0x3605e8});});})[_0x72ff('0x23')](function(){return db[_0x72ff('0xa2')][_0x72ff('0x11e')]({'where':{'ChatWebsiteId':_0x4fcdc8[_0x72ff('0x58')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x51474a,null))[_0x72ff('0x2e')](handleError(_0x51474a,null));};exports['getApplications']=function(_0x3783fc,_0x5a089a,_0x46a729){var _0x3d7b21={};var _0x19d23d={};var _0x5bba6a;var _0x2ac79c;return db[_0x72ff('0x54')][_0x72ff('0x69')]({'where':{'id':_0x3783fc[_0x72ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x5a089a,null))[_0x72ff('0x23')](function(_0x5d43d1){if(_0x5d43d1){_0x5bba6a=_0x5d43d1;_0x19d23d[_0x72ff('0x46')]=_['keys'](db[_0x72ff('0xa2')][_0x72ff('0x42')]);_0x19d23d['query']=_['keys'](_0x3783fc[_0x72ff('0x48')]);_0x19d23d[_0x72ff('0x49')]=_['intersection'](_0x19d23d['model'],_0x19d23d[_0x72ff('0x48')]);_0x3d7b21[_0x72ff('0x4c')]=_[_0x72ff('0x4a')](_0x19d23d[_0x72ff('0x46')],qs[_0x72ff('0x4b')](_0x3783fc[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x3d7b21[_0x72ff('0x4c')]=_0x3d7b21[_0x72ff('0x4c')][_0x72ff('0x4d')]?_0x3d7b21[_0x72ff('0x4c')]:_0x19d23d[_0x72ff('0x46')];_0x3d7b21[_0x72ff('0x6a')]=qs[_0x72ff('0x50')](_0x3783fc[_0x72ff('0x48')]['sort']);_0x3d7b21['where']=qs[_0x72ff('0x49')](_['pick'](_0x3783fc[_0x72ff('0x48')],_0x19d23d['filters']));if(_0x3783fc[_0x72ff('0x48')][_0x72ff('0x52')]){_0x3d7b21[_0x72ff('0x51')]=_[_0x72ff('0x53')](_0x3d7b21[_0x72ff('0x51')],{'$or':_[_0x72ff('0x47')](_0x3d7b21['attributes'],function(_0x16dfb3){var _0x19cca6={};_0x19cca6[_0x16dfb3]={'$like':'%'+_0x3783fc[_0x72ff('0x48')][_0x72ff('0x52')]+'%'};return _0x19cca6;})});}_0x3d7b21=_[_0x72ff('0x53')]({},_0x3d7b21,_0x3783fc['options']);return _0x5bba6a[_0x72ff('0x11f')](_0x3d7b21);}})['then'](function(_0x3f36c1){if(_0x3f36c1){_0x2ac79c=_0x3f36c1[_0x72ff('0x4d')];if(!_0x3783fc['query']['hasOwnProperty'](_0x72ff('0x4f'))){_0x3d7b21[_0x72ff('0x35')]=qs[_0x72ff('0x35')](_0x3783fc[_0x72ff('0x48')][_0x72ff('0x35')]);_0x3d7b21['offset']=qs[_0x72ff('0x33')](_0x3783fc[_0x72ff('0x48')]['offset']);}return _0x5bba6a[_0x72ff('0x11f')](_0x3d7b21);}})[_0x72ff('0x23')](function(_0x536487){if(_0x536487){return _0x536487?{'count':_0x2ac79c,'rows':_0x536487}:null;}})[_0x72ff('0x23')](respondWithResult(_0x5a089a,null))['catch'](handleError(_0x5a089a,null));};exports[_0x72ff('0x120')]=function(_0x144667,_0x18d29a,_0x15f798){return db[_0x72ff('0x121')][_0x72ff('0x61')]({'where':{'id':_0x144667[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x18d29a,null))[_0x72ff('0x23')](function(_0x46e5d6){if(_0x46e5d6){return _0x46e5d6[_0x72ff('0x120')](_0x144667['body']['ids'],_['omit'](_0x144667[_0x72ff('0x5c')],[_0x72ff('0x72'),'id'])||{});}})[_0x72ff('0x23')](respondWithResult(_0x18d29a,null))[_0x72ff('0x2e')](handleError(_0x18d29a,null));};exports[_0x72ff('0x10d')]=function(_0x1a63ff,_0x14e0d7,_0xcead90){var _0x99e59d={};var _0x5a60ab={};var _0x4f6ea;var _0x22d6ab;return db['ChatWebsite'][_0x72ff('0x69')]({'where':{'id':_0x1a63ff[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x14e0d7,null))['then'](function(_0xae181f){if(_0xae181f){_0x4f6ea=_0xae181f;_0x5a60ab[_0x72ff('0x46')]=_[_0x72ff('0x59')](db[_0x72ff('0x122')]['rawAttributes']);_0x5a60ab['query']=_[_0x72ff('0x59')](_0x1a63ff[_0x72ff('0x48')]);_0x5a60ab[_0x72ff('0x49')]=_[_0x72ff('0x4a')](_0x5a60ab[_0x72ff('0x46')],_0x5a60ab['query']);_0x99e59d[_0x72ff('0x4c')]=_['intersection'](_0x5a60ab[_0x72ff('0x46')],qs['fields'](_0x1a63ff[_0x72ff('0x48')]['fields']));_0x99e59d['attributes']=_0x99e59d[_0x72ff('0x4c')]['length']?_0x99e59d[_0x72ff('0x4c')]:_0x5a60ab[_0x72ff('0x46')];_0x99e59d[_0x72ff('0x6a')]=qs[_0x72ff('0x50')](_0x1a63ff['query'][_0x72ff('0x50')]);_0x99e59d['where']=qs['filters'](_[_0x72ff('0x6b')](_0x1a63ff[_0x72ff('0x48')],_0x5a60ab[_0x72ff('0x49')]));if(_0x1a63ff[_0x72ff('0x48')][_0x72ff('0x52')]){_0x99e59d[_0x72ff('0x51')]=_['merge'](_0x99e59d[_0x72ff('0x51')],{'$or':_[_0x72ff('0x47')](_0x99e59d[_0x72ff('0x4c')],function(_0x5449a8){var _0x510eb7={};_0x510eb7[_0x5449a8]={'$like':'%'+_0x1a63ff[_0x72ff('0x48')][_0x72ff('0x52')]+'%'};return _0x510eb7;})});}_0x99e59d=_['merge']({},_0x99e59d,_0x1a63ff[_0x72ff('0x70')]);return _0x4f6ea[_0x72ff('0x10d')](_0x99e59d);}})[_0x72ff('0x23')](function(_0x88e9ab){if(_0x88e9ab){_0x22d6ab=_0x88e9ab[_0x72ff('0x4d')];if(!_0x1a63ff[_0x72ff('0x48')]['hasOwnProperty'](_0x72ff('0x4f'))){_0x99e59d[_0x72ff('0x35')]=qs[_0x72ff('0x35')](_0x1a63ff['query'][_0x72ff('0x35')]);_0x99e59d['offset']=qs['offset'](_0x1a63ff['query']['offset']);}return _0x4f6ea['getProactiveActions'](_0x99e59d);}})[_0x72ff('0x23')](function(_0x38a28e){if(_0x38a28e){return _0x38a28e?{'count':_0x22d6ab,'rows':_0x38a28e}:null;}})[_0x72ff('0x23')](respondWithResult(_0x14e0d7,null))[_0x72ff('0x2e')](handleError(_0x14e0d7,null));};exports['getFields']=function(_0x2198a0,_0x2ab5e8,_0x5466f3){var _0x3004c0=_0x2198a0[_0x72ff('0x48')]['online']===_0x72ff('0x123')?_0x72ff('0x124'):_0x72ff('0x125');return db['ChatWebsite'][_0x72ff('0x61')]({'attributes':['id',_0x3004c0],'where':{'id':_0x2198a0[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x2ab5e8,null))[_0x72ff('0x23')](function(_0x1f129c){if(_0x1f129c){var _0x10f3e5=_0x1f129c[_0x3004c0];var _0x44562a=_0x10f3e5&&_0x10f3e5[_0x72ff('0x126')]?_0x10f3e5[_0x72ff('0x126')]:[];_0x2ab5e8[_0x72ff('0xcd')]({'fromKey':_[_0x72ff('0x87')](_0x10f3e5['fromKey'])?undefined:_0x10f3e5['fromKey'],'count':_0x44562a[_0x72ff('0x4d')],'rows':_0x44562a});}})[_0x72ff('0x2e')](handleError(_0x2ab5e8,null));};exports[_0x72ff('0x127')]=function(_0x5e4cb2,_0x5cd7dd,_0x217dd8){var _0x3d12f8={'raw':![],'where':{}};var _0x1e6a6b={};var _0x94e399={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x72ff('0x69')]({'where':{'id':_0x5e4cb2['params']['id']}})['then'](handleEntityNotFound(_0x5cd7dd,null))[_0x72ff('0x23')](function(_0x1b369e){if(_0x1b369e){_0x1e6a6b[_0x72ff('0x46')]=_['keys'](db[_0x72ff('0x128')]['rawAttributes']);_0x1e6a6b[_0x72ff('0x48')]=_[_0x72ff('0x59')](_0x5e4cb2[_0x72ff('0x48')]);_0x1e6a6b[_0x72ff('0x49')]=_['intersection'](_0x1e6a6b[_0x72ff('0x46')],_0x1e6a6b['query']);_0x3d12f8[_0x72ff('0x4c')]=_['intersection'](_0x1e6a6b['model'],qs['fields'](_0x5e4cb2[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x3d12f8[_0x72ff('0x4c')]=_0x3d12f8[_0x72ff('0x4c')]['length']?_0x3d12f8[_0x72ff('0x4c')]:_0x1e6a6b[_0x72ff('0x46')];if(!_0x5e4cb2[_0x72ff('0x48')][_0x72ff('0x4e')](_0x72ff('0x4f'))){_0x3d12f8[_0x72ff('0x35')]=qs['limit'](_0x5e4cb2[_0x72ff('0x48')][_0x72ff('0x35')]);_0x3d12f8['offset']=qs[_0x72ff('0x33')](_0x5e4cb2['query']['offset']);}_0x3d12f8['order']=qs[_0x72ff('0x50')](_0x5e4cb2[_0x72ff('0x48')][_0x72ff('0x50')]);_0x3d12f8[_0x72ff('0x51')]=qs[_0x72ff('0x49')](_[_0x72ff('0x6b')](_0x5e4cb2['query'],_0x1e6a6b['filters']));_0x3d12f8[_0x72ff('0x51')]['ChatWebsiteId']=_0x1b369e['id'];if(_0x5e4cb2[_0x72ff('0x48')][_0x72ff('0x52')]){_0x3d12f8[_0x72ff('0x51')]=_['merge'](_0x3d12f8['where'],{'$or':_[_0x72ff('0x47')](_0x3d12f8[_0x72ff('0x4c')],function(_0x11b48b){var _0x14f38e={};_0x14f38e[_0x11b48b]={'$like':'%'+_0x5e4cb2[_0x72ff('0x48')][_0x72ff('0x52')]+'%'};return _0x14f38e;})});}_0x3d12f8=_[_0x72ff('0x53')]({},_0x3d12f8,_0x5e4cb2[_0x72ff('0x70')]);return db[_0x72ff('0x128')]['count']({'where':_0x3d12f8[_0x72ff('0x51')]})[_0x72ff('0x23')](function(_0x4d9aaa){_0x94e399[_0x72ff('0x36')]=_0x4d9aaa;if(_0x5e4cb2['query'][_0x72ff('0x55')]){_0x3d12f8[_0x72ff('0x5a')]=[{'all':!![]}];}else{_0x3d12f8[_0x72ff('0x5a')]=[{'model':db[_0x72ff('0x8f')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x72ff('0x129'),'required':![]}];}return db[_0x72ff('0x128')][_0x72ff('0x56')](_0x3d12f8);})['then'](function(_0x352e49){_0x94e399['rows']=_0x352e49;return _0x94e399;});}})[_0x72ff('0x23')](respondWithFilteredResult(_0x5cd7dd,_0x3d12f8))[_0x72ff('0x2e')](handleError(_0x5cd7dd,null));};exports['addAgents']=function(_0x3db21e,_0x551de6,_0x217ef2){return db['ChatWebsite'][_0x72ff('0x61')]({'where':{'id':_0x3db21e['params']['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x551de6,null))['then'](function(_0x1c4e74){if(_0x1c4e74){return _0x1c4e74['addAgents'](_0x3db21e[_0x72ff('0x5c')][_0x72ff('0x72')],_['omit'](_0x3db21e[_0x72ff('0x5c')],['ids','id'])||{})['spread'](function(_0x220aad){for(var _0x5a7769=0x0;_0x5a7769<_0x3db21e[_0x72ff('0x5c')][_0x72ff('0x72')][_0x72ff('0x4d')];_0x5a7769+=0x1){socket[_0x72ff('0x12a')](_0x72ff('0x12b'),{'UserId':Number(_0x3db21e[_0x72ff('0x5c')][_0x72ff('0x72')][_0x5a7769]),'ChatWebsiteId':Number(_0x3db21e['params']['id'])});}return _0x220aad;});}})[_0x72ff('0x23')](respondWithResult(_0x551de6,null))[_0x72ff('0x2e')](handleError(_0x551de6,null));};exports[_0x72ff('0x12c')]=function(_0x2d980e,_0x5195f7,_0x149263){return db[_0x72ff('0x54')][_0x72ff('0x61')]({'where':{'id':_0x2d980e['params']['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x5195f7,null))[_0x72ff('0x23')](function(_0x2a8be2){if(_0x2a8be2){return _0x2a8be2[_0x72ff('0x12c')](_0x2d980e[_0x72ff('0x48')][_0x72ff('0x72')])['then'](function(){if(_[_0x72ff('0x12d')](_0x2d980e[_0x72ff('0x48')][_0x72ff('0x72')])){for(var _0x2b632a=0x0;_0x2b632a<_0x2d980e[_0x72ff('0x48')][_0x72ff('0x72')]['length'];_0x2b632a+=0x1){socket[_0x72ff('0x12a')](_0x72ff('0x12e'),{'UserId':Number(_0x2d980e[_0x72ff('0x48')][_0x72ff('0x72')][_0x2b632a]),'ChatWebsiteId':Number(_0x2d980e['params']['id'])});}}else{socket[_0x72ff('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x2d980e[_0x72ff('0x48')][_0x72ff('0x72')]),'ChatWebsiteId':Number(_0x2d980e[_0x72ff('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x5195f7,null))[_0x72ff('0x2e')](handleError(_0x5195f7,null));};exports[_0x72ff('0x12f')]=function(_0xa78f10,_0x937f04,_0x530c7a){var _0x5c66c1={};var _0x20b755={};var _0x1bbac8;var _0x4bd020;return db[_0x72ff('0x54')][_0x72ff('0x69')]({'where':{'id':_0xa78f10[_0x72ff('0x58')]['id']}})[_0x72ff('0x23')](handleEntityNotFound(_0x937f04,null))[_0x72ff('0x23')](function(_0x37d37f){if(_0x37d37f){_0x1bbac8=_0x37d37f;_0x20b755[_0x72ff('0x46')]=_[_0x72ff('0x59')](db[_0x72ff('0xc3')][_0x72ff('0x42')]);_0x20b755[_0x72ff('0x48')]=_[_0x72ff('0x59')](_0xa78f10['query']);_0x20b755[_0x72ff('0x49')]=_[_0x72ff('0x4a')](_0x20b755[_0x72ff('0x46')],_0x20b755['query']);_0x5c66c1[_0x72ff('0x4c')]=_[_0x72ff('0x4a')](_0x20b755[_0x72ff('0x46')],qs[_0x72ff('0x4b')](_0xa78f10[_0x72ff('0x48')][_0x72ff('0x4b')]));_0x5c66c1[_0x72ff('0x4c')]=_0x5c66c1[_0x72ff('0x4c')]['length']?_0x5c66c1['attributes']:_0x20b755[_0x72ff('0x46')];_0x5c66c1[_0x72ff('0x6a')]=qs[_0x72ff('0x50')](_0xa78f10['query'][_0x72ff('0x50')]);_0x5c66c1[_0x72ff('0x51')]=qs['filters'](_[_0x72ff('0x6b')](_0xa78f10['query'],_0x20b755[_0x72ff('0x49')]));if(_0xa78f10[_0x72ff('0x48')][_0x72ff('0x52')]){_0x5c66c1[_0x72ff('0x51')]=_['merge'](_0x5c66c1['where'],{'$or':_['map'](_0x5c66c1[_0x72ff('0x4c')],function(_0xe790c0){var _0x59705b={};_0x59705b[_0xe790c0]={'$like':'%'+_0xa78f10['query'][_0x72ff('0x52')]+'%'};return _0x59705b;})});}_0x5c66c1=_['merge']({},_0x5c66c1,_0xa78f10[_0x72ff('0x70')]);return _0x1bbac8['getAgents'](_0x5c66c1);}})['then'](function(_0x2cb0e9){if(_0x2cb0e9){_0x4bd020=_0x2cb0e9[_0x72ff('0x4d')];if(!_0xa78f10[_0x72ff('0x48')][_0x72ff('0x4e')](_0x72ff('0x4f'))){_0x5c66c1[_0x72ff('0x35')]=qs[_0x72ff('0x35')](_0xa78f10['query'][_0x72ff('0x35')]);_0x5c66c1[_0x72ff('0x33')]=qs[_0x72ff('0x33')](_0xa78f10[_0x72ff('0x48')][_0x72ff('0x33')]);}return _0x1bbac8[_0x72ff('0x12f')](_0x5c66c1);}})[_0x72ff('0x23')](function(_0x61c527){if(_0x61c527){return _0x61c527?{'count':_0x4bd020,'rows':_0x61c527}:null;}})['then'](respondWithResult(_0x937f04,null))['catch'](handleError(_0x937f04,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index abfb9da..684938f 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 _0xe94a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','save','update'];(function(_0x4bb234,_0x105f9b){var _0x2f2db7=function(_0xc5c510){while(--_0xc5c510){_0x4bb234['push'](_0x4bb234['shift']());}};_0x2f2db7(++_0x105f9b);}(_0xe94a,0x1c7));var _0xae94=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xe94a[_0x26721d];return _0x1035c5;};'use strict';var EventEmitter=require(_0xae94('0x0'));var ChatWebsite=require(_0xae94('0x1'))['db'][_0xae94('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae94('0x3'),'afterUpdate':_0xae94('0x4'),'afterDestroy':_0xae94('0x5')};function emitEvent(_0x46e549){return function(_0x3bf666,_0xf48ae1,_0x4cf51a){ChatWebsiteEvents[_0xae94('0x6')](_0x46e549+':'+_0x3bf666['id'],_0x3bf666);ChatWebsiteEvents[_0xae94('0x6')](_0x46e549,_0x3bf666);_0x4cf51a(null);};}for(var e in events){if(events[_0xae94('0x7')](e)){var event=events[e];ChatWebsite[_0xae94('0x8')](e,emitEvent(event));}}module[_0xae94('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x294b=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x22dac7,_0x45ffe6){var _0xad9681=function(_0x39e77d){while(--_0x39e77d){_0x22dac7['push'](_0x22dac7['shift']());}};_0xad9681(++_0x45ffe6);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb294('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xb294('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb294('0x2')](0x0);var events={'afterCreate':_0xb294('0x3'),'afterUpdate':_0xb294('0x4'),'afterDestroy':_0xb294('0x5')};function emitEvent(_0x417648){return function(_0x58fe24,_0x5c0237,_0xba5c68){ChatWebsiteEvents[_0xb294('0x6')](_0x417648+':'+_0x58fe24['id'],_0x58fe24);ChatWebsiteEvents[_0xb294('0x6')](_0x417648,_0x58fe24);_0xba5c68(null);};}for(var e in events){if(events[_0xb294('0x7')](e)){var event=events[e];ChatWebsite[_0xb294('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index aae9c5d..1ee2b0f 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 _0xf0b5=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x437ae5,_0x390206){var _0x3f2172=function(_0x93dc76){while(--_0x93dc76){_0x437ae5['push'](_0x437ae5['shift']());}};_0x3f2172(++_0x390206);}(_0xf0b5,0x1ca));var _0x5f0b=function(_0x325460,_0x5ef353){_0x325460=_0x325460-0x0;var _0x2beb62=_0xf0b5[_0x325460];return _0x2beb62;};'use strict';var _=require(_0x5f0b('0x0'));var util=require(_0x5f0b('0x1'));var logger=require(_0x5f0b('0x2'))(_0x5f0b('0x3'));var moment=require(_0x5f0b('0x4'));var BPromise=require('bluebird');var rp=require(_0x5f0b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f0b('0x6'));var config=require(_0x5f0b('0x7'));var attributes=require(_0x5f0b('0x8'));module[_0x5f0b('0x9')]=function(_0x24a7ed,_0x35325a){return _0x24a7ed['define'](_0x5f0b('0xa'),attributes,{'tableName':_0x5f0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93dc=['path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93dc,0x1c8));var _0xc93d=function(_0x32d679,_0x34a787){_0x32d679=_0x32d679-0x0;var _0xcb2cd4=_0x93dc[_0x32d679];return _0xcb2cd4;};'use strict';var _=require('lodash');var util=require(_0xc93d('0x0'));var logger=require(_0xc93d('0x1'))('api');var moment=require(_0xc93d('0x2'));var BPromise=require(_0xc93d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc93d('0x4'));var rimraf=require(_0xc93d('0x5'));var config=require('../../config/environment');var attributes=require(_0xc93d('0x6'));module[_0xc93d('0x7')]=function(_0x446503,_0x3a0c79){return _0x446503['define'](_0xc93d('0x8'),attributes,{'tableName':_0xc93d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 3007260..63994b0 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 _0xe6a9=['error','code','message','result','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ed6cb,_0x3367cd){var _0xcb52ba=function(_0x3e0d29){while(--_0x3e0d29){_0x3ed6cb['push'](_0x3ed6cb['shift']());}};_0xcb52ba(++_0x3367cd);}(_0xe6a9,0x7c));var _0x9e6a=function(_0x391e9c,_0x3b4958){_0x391e9c=_0x391e9c-0x0;var _0x1807da=_0xe6a9[_0x391e9c];return _0x1807da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e6a('0x0'));var BPromise=require(_0x9e6a('0x1'));var rs=require(_0x9e6a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e6a('0x3'));var logger=require(_0x9e6a('0x4'))('rpc');var config=require(_0x9e6a('0x5'));var jayson=require(_0x9e6a('0x6'));var client=jayson[_0x9e6a('0x7')][_0x9e6a('0x8')]({'port':0x232a});config[_0x9e6a('0x9')]=_[_0x9e6a('0xa')](config[_0x9e6a('0x9')],{'host':_0x9e6a('0xb'),'port':0x18eb});var socket=require(_0x9e6a('0xc'))(new Redis(config[_0x9e6a('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x7f6bf3,_0x4078b7,_0x1540b3){return new BPromise(function(_0x2c3b97,_0x322c0e){return client[_0x9e6a('0xd')](_0x7f6bf3,_0x1540b3)[_0x9e6a('0xe')](function(_0xff0a1f){logger['info'](_0x9e6a('0xf'),_0x4078b7,_0x9e6a('0x10'));logger[_0x9e6a('0x11')](_0x9e6a('0x12'),_0x4078b7,_0x9e6a('0x10'),JSON[_0x9e6a('0x13')](_0xff0a1f));if(_0xff0a1f[_0x9e6a('0x14')]){if(_0xff0a1f[_0x9e6a('0x14')][_0x9e6a('0x15')]===0x1f4){logger[_0x9e6a('0x14')](_0x9e6a('0xf'),_0x4078b7,_0xff0a1f[_0x9e6a('0x14')]['message']);return _0x322c0e(_0xff0a1f[_0x9e6a('0x14')]['message']);}logger[_0x9e6a('0x14')](_0x9e6a('0xf'),_0x4078b7,_0xff0a1f[_0x9e6a('0x14')][_0x9e6a('0x16')]);return _0x2c3b97(_0xff0a1f['error'][_0x9e6a('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4078b7,_0x9e6a('0x10'));_0x2c3b97(_0xff0a1f[_0x9e6a('0x17')]['message']);}})['catch'](function(_0x8afdb0){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4078b7,_0x8afdb0);_0x322c0e(_0x8afdb0);});});} \ No newline at end of file +var _0x1e45=['redis','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults'];(function(_0x27e285,_0x274ef3){var _0x33513c=function(_0x8471d5){while(--_0x8471d5){_0x27e285['push'](_0x27e285['shift']());}};_0x33513c(++_0x274ef3);}(_0x1e45,0x18e));var _0x51e4=function(_0x445552,_0x5a5431){_0x445552=_0x445552-0x0;var _0x2e5eca=_0x1e45[_0x445552];return _0x2e5eca;};'use strict';var _=require(_0x51e4('0x0'));var util=require(_0x51e4('0x1'));var moment=require('moment');var BPromise=require(_0x51e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51e4('0x3'));var db=require(_0x51e4('0x4'))['db'];var utils=require(_0x51e4('0x5'));var logger=require('../../config/logger')(_0x51e4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x51e4('0x7')][_0x51e4('0x8')]({'port':0x232a});config['redis']=_[_0x51e4('0x9')](config[_0x51e4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x51e4('0xb'))(new Redis(config[_0x51e4('0xa')]));require(_0x51e4('0xc'))[_0x51e4('0xd')](socket);function respondWithRpcPromise(_0x1fc877,_0x1897ad,_0x1cc396){return new BPromise(function(_0x165630,_0xe98f22){return client[_0x51e4('0xe')](_0x1fc877,_0x1cc396)['then'](function(_0x5a98b1){logger[_0x51e4('0xf')](_0x51e4('0x10'),_0x1897ad,_0x51e4('0x11'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1897ad,_0x51e4('0x11'),JSON[_0x51e4('0x12')](_0x5a98b1));if(_0x5a98b1[_0x51e4('0x13')]){if(_0x5a98b1['error'][_0x51e4('0x14')]===0x1f4){logger[_0x51e4('0x13')](_0x51e4('0x10'),_0x1897ad,_0x5a98b1['error'][_0x51e4('0x15')]);return _0xe98f22(_0x5a98b1[_0x51e4('0x13')][_0x51e4('0x15')]);}logger[_0x51e4('0x13')](_0x51e4('0x10'),_0x1897ad,_0x5a98b1[_0x51e4('0x13')][_0x51e4('0x15')]);return _0x165630(_0x5a98b1[_0x51e4('0x13')][_0x51e4('0x15')]);}else{logger[_0x51e4('0xf')](_0x51e4('0x10'),_0x1897ad,_0x51e4('0x11'));_0x165630(_0x5a98b1[_0x51e4('0x16')][_0x51e4('0x15')]);}})[_0x51e4('0x17')](function(_0x9fb3c1){logger[_0x51e4('0x13')](_0x51e4('0x10'),_0x1897ad,_0x9fb3c1);_0xe98f22(_0x9fb3c1);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 73d49bf..f034beb 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 _0xe54f=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x174fc8,_0x339e86){var _0x1df08c=function(_0x4dcff4){while(--_0x4dcff4){_0x174fc8['push'](_0x174fc8['shift']());}};_0x1df08c(++_0x339e86);}(_0xe54f,0x1d1));var _0xfe54=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xe54f[_0x50e593];return _0x3821d0;};'use strict';var ChatWebsiteEvents=require(_0xfe54('0x0'));var events=[_0xfe54('0x1'),_0xfe54('0x2'),'update'];function createListener(_0x4ae8f3,_0x428f23){return function(_0x513ba4){_0x428f23[_0xfe54('0x3')](_0x4ae8f3,_0x513ba4);};}function removeListener(_0x3e137c,_0x551d68){return function(){ChatWebsiteEvents[_0xfe54('0x4')](_0x3e137c,_0x551d68);};}exports[_0xfe54('0x5')]=function(_0xf34dfe){for(var _0x4d9ff7=0x0,_0x21b0f9=events[_0xfe54('0x6')];_0x4d9ff7<_0x21b0f9;_0x4d9ff7++){var _0x40c803=events[_0x4d9ff7];var _0x489da9=createListener(_0xfe54('0x7')+_0x40c803,_0xf34dfe);ChatWebsiteEvents['on'](_0x40c803,_0x489da9);}}; \ No newline at end of file +var _0x0574=['update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x29583f,_0x25f8c8){var _0x2a8003=function(_0x3a3d19){while(--_0x3a3d19){_0x29583f['push'](_0x29583f['shift']());}};_0x2a8003(++_0x25f8c8);}(_0x0574,0x12f));var _0x4057=function(_0x8c453,_0x57ffe1){_0x8c453=_0x8c453-0x0;var _0xc76889=_0x0574[_0x8c453];return _0xc76889;};'use strict';var ChatWebsiteEvents=require(_0x4057('0x0'));var events=[_0x4057('0x1'),_0x4057('0x2'),_0x4057('0x3')];function createListener(_0x26d509,_0x4683dd){return function(_0x3a09dd){_0x4683dd[_0x4057('0x4')](_0x26d509,_0x3a09dd);};}function removeListener(_0x46aeee,_0x52f595){return function(){ChatWebsiteEvents[_0x4057('0x5')](_0x46aeee,_0x52f595);};}exports[_0x4057('0x6')]=function(_0x3014e0){for(var _0xab5502=0x0,_0x33be93=events[_0x4057('0x7')];_0xab5502<_0x33be93;_0xab5502++){var _0x4cd77c=events[_0xab5502];var _0x478409=createListener(_0x4057('0x8')+_0x4cd77c,_0x3014e0);ChatWebsiteEvents['on'](_0x4cd77c,_0x478409);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index c59f396..fc6400d 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 _0x9076=['/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','format','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','server/files','ensureDir','replace','/:id/offline','any','offline','addApplications','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields'];(function(_0x27ec97,_0x57baa9){var _0x1840ff=function(_0x111932){while(--_0x111932){_0x27ec97['push'](_0x27ec97['shift']());}};_0x1840ff(++_0x57baa9);}(_0x9076,0xab));var _0x6907=function(_0x47ae05,_0x2d57f2){_0x47ae05=_0x47ae05-0x0;var _0x2c07ea=_0x9076[_0x47ae05];return _0x2c07ea;};'use strict';var multer=require(_0x6907('0x0'));var util=require(_0x6907('0x1'));var path=require(_0x6907('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6907('0x3')]();var fs_extra=require(_0x6907('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6907('0x5'));var config=require(_0x6907('0x6'));var controller=require(_0x6907('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6907('0x8')]);router['get'](_0x6907('0x9'),auth[_0x6907('0xa')](),controller[_0x6907('0xb')]);router[_0x6907('0xc')]('/:id',auth[_0x6907('0xa')](),controller[_0x6907('0xd')]);router[_0x6907('0xc')](_0x6907('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x6907('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x6907('0xc')](_0x6907('0x10'),controller[_0x6907('0x11')]);router[_0x6907('0xc')](_0x6907('0x12'),controller['getAvatar']);router[_0x6907('0xc')]('/:id/customer_avatar',controller[_0x6907('0x13')]);router[_0x6907('0xc')]('/:id/system_avatar',controller[_0x6907('0x14')]);router[_0x6907('0xc')](_0x6907('0x15'),auth[_0x6907('0xa')](),controller['getInteractions']);router[_0x6907('0xc')]('/:id/snippet',controller[_0x6907('0x16')]);router[_0x6907('0xc')](_0x6907('0x17'),auth[_0x6907('0xa')](),controller['getApplications']);router['get'](_0x6907('0x18'),auth[_0x6907('0xa')](),controller[_0x6907('0x19')]);router[_0x6907('0xc')](_0x6907('0x1a'),controller['getFields']);router['get'](_0x6907('0x1b'),auth['isAuthenticated'](),controller[_0x6907('0x1c')]);router[_0x6907('0xc')](_0x6907('0x1d'),auth[_0x6907('0xa')](),controller[_0x6907('0x1e')]);router[_0x6907('0x1f')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6907('0x1f')](_0x6907('0xe'),auth[_0x6907('0xa')](),controller[_0x6907('0x20')]);router[_0x6907('0x1f')](_0x6907('0xf'),auth['isAuthenticated'](),controller[_0x6907('0x21')]);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x24b4ba,_0x215dd1,_0x2bca19){_0x2bca19(null,path[_0x6907('0x23')](config[_0x6907('0x24')],_0x6907('0x25')));},'filename':function(_0x1d8831,_0x554f1a,_0x59a1f8){_0x59a1f8(null,util['format'](_0x6907('0x26'),Date['now'](),_0x554f1a[_0x6907('0x27')]));}})});router[_0x6907('0x1f')](_0x6907('0x10'),upload[_0x6907('0x28')](_0x6907('0x29')),controller[_0x6907('0x2a')]);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x38be8c,_0x3af2ec,_0x5ab5dd){_0x5ab5dd(null,path[_0x6907('0x23')](config[_0x6907('0x24')],_0x6907('0x2b')));},'filename':function(_0x20b7d0,_0x49bbf9,_0x619bff){_0x619bff(null,util['format'](_0x6907('0x26'),Date[_0x6907('0x2c')](),_0x49bbf9[_0x6907('0x27')]));}})});router[_0x6907('0x1f')](_0x6907('0x12'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x58f10e,_0x11444f,_0x561c9d){_0x561c9d(null,path[_0x6907('0x23')](config[_0x6907('0x24')],'server/files/images/avatars/'));},'filename':function(_0x48d8fd,_0x7b3a9c,_0x399e6a){_0x399e6a(null,util[_0x6907('0x2d')]('%s-%s',Date[_0x6907('0x2c')](),_0x7b3a9c['originalname']));}})});router[_0x6907('0x1f')](_0x6907('0x2e'),upload[_0x6907('0x28')](_0x6907('0x29')),controller[_0x6907('0x2f')]);var upload=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x1a2e49,_0x166789,_0x4d2462){_0x4d2462(null,path['join'](config[_0x6907('0x24')],'server/files/images/avatars/'));},'filename':function(_0x14c6b0,_0x2eb9ab,_0x1b8773){_0x1b8773(null,util[_0x6907('0x2d')]('%s-%s',Date[_0x6907('0x2c')](),_0x2eb9ab[_0x6907('0x27')]));}})});router[_0x6907('0x1f')](_0x6907('0x30'),upload[_0x6907('0x28')]('file'),controller[_0x6907('0x31')]);router[_0x6907('0x1f')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x6907('0x22')]({'destination':function(_0x540ac2,_0x37b904,_0x4f9435){const _0x5633d2=path['join'](config['root'],_0x6907('0x32'),'attachments','offline-chat');fs_extra[_0x6907('0x33')](_0x5633d2,function(){_0x4f9435(null,_0x5633d2);});},'filename':function(_0x1bbbae,_0x448051,_0xb06910){const _0x9551a5=_0x448051[_0x6907('0x27')][_0x6907('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4be33b=path['extname'](_0x9551a5);const _0x5f213c=Date[_0x6907('0x2c')]()+'-'+_0x9551a5[_0x6907('0x34')](_0x4be33b,'')+_0x4be33b;_0xb06910(null,_0x5f213c);}})});router[_0x6907('0x1f')](_0x6907('0x35'),offlineUploadMulter[_0x6907('0x36')](),controller[_0x6907('0x37')]);router['post']('/:id/interactions',auth[_0x6907('0xa')](),controller['addInteraction']);router[_0x6907('0x1f')](_0x6907('0x17'),auth[_0x6907('0xa')](),controller[_0x6907('0x38')]);router[_0x6907('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x6907('0x1f')](_0x6907('0x1d'),auth[_0x6907('0xa')](),controller[_0x6907('0x39')]);router[_0x6907('0x3a')](_0x6907('0x3b'),auth['isAuthenticated'](),controller[_0x6907('0x3c')]);router[_0x6907('0x3d')](_0x6907('0x3b'),auth[_0x6907('0xa')](),controller[_0x6907('0x3e')]);router['delete']('/:id/dispositions',auth[_0x6907('0xa')](),controller[_0x6907('0x3f')]);router[_0x6907('0x3d')](_0x6907('0xf'),auth[_0x6907('0xa')](),controller[_0x6907('0x40')]);router[_0x6907('0x3d')](_0x6907('0x1d'),auth[_0x6907('0xa')](),controller[_0x6907('0x41')]);module['exports']=router; \ No newline at end of file +var _0xf6c3=['describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','root','server/files/images/logos/','format','%s-%s','now','single','addLogo','diskStorage','join','server/files/images/avatars/','originalname','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe'];(function(_0x2f3709,_0x1afca5){var _0x3c22d7=function(_0xacb8a){while(--_0xacb8a){_0x2f3709['push'](_0x2f3709['shift']());}};_0x3c22d7(++_0x1afca5);}(_0xf6c3,0xcd));var _0x3f6c=function(_0x19fbeb,_0x3335ef){_0x19fbeb=_0x19fbeb-0x0;var _0x5f27a1=_0xf6c3[_0x19fbeb];return _0x5f27a1;};'use strict';var multer=require(_0x3f6c('0x0'));var util=require(_0x3f6c('0x1'));var path=require(_0x3f6c('0x2'));var timeout=require(_0x3f6c('0x3'));var express=require(_0x3f6c('0x4'));var router=express[_0x3f6c('0x5')]();var fs_extra=require(_0x3f6c('0x6'));var auth=require(_0x3f6c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3f6c('0x8'));var controller=require(_0x3f6c('0x9'));router[_0x3f6c('0xa')]('/',auth[_0x3f6c('0xb')](),controller[_0x3f6c('0xc')]);router[_0x3f6c('0xa')](_0x3f6c('0xd'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0xe')]);router[_0x3f6c('0xa')](_0x3f6c('0xf'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x10')]);router[_0x3f6c('0xa')]('/:id/dispositions',auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x11')]);router['get'](_0x3f6c('0x12'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x13')]);router[_0x3f6c('0xa')](_0x3f6c('0x14'),controller['getLogo']);router[_0x3f6c('0xa')](_0x3f6c('0x15'),controller[_0x3f6c('0x16')]);router['get']('/:id/customer_avatar',controller[_0x3f6c('0x17')]);router[_0x3f6c('0xa')](_0x3f6c('0x18'),controller[_0x3f6c('0x19')]);router[_0x3f6c('0xa')](_0x3f6c('0x1a'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x1b')]);router['get']('/:id/snippet',controller[_0x3f6c('0x1c')]);router[_0x3f6c('0xa')](_0x3f6c('0x1d'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x1e')]);router['get'](_0x3f6c('0x1f'),auth[_0x3f6c('0xb')](),controller['getProactiveActions']);router[_0x3f6c('0xa')](_0x3f6c('0x20'),controller['getFields']);router[_0x3f6c('0xa')]('/:id/offline_messages',auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x21')]);router['get'](_0x3f6c('0x22'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x23')]);router[_0x3f6c('0x24')]('/',auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x25')]);router[_0x3f6c('0x24')](_0x3f6c('0x26'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x3f6c('0x24')](_0x3f6c('0x12'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ff99d,_0x11a2f0,_0x1c62b7){_0x1c62b7(null,path['join'](config[_0x3f6c('0x28')],_0x3f6c('0x29')));},'filename':function(_0x6d5f8f,_0x43c85f,_0x4d391a){_0x4d391a(null,util[_0x3f6c('0x2a')](_0x3f6c('0x2b'),Date[_0x3f6c('0x2c')](),_0x43c85f['originalname']));}})});router[_0x3f6c('0x24')](_0x3f6c('0x14'),upload[_0x3f6c('0x2d')]('file'),controller[_0x3f6c('0x2e')]);var upload=multer({'storage':multer[_0x3f6c('0x2f')]({'destination':function(_0x21f1cc,_0x51614e,_0x40ba83){_0x40ba83(null,path[_0x3f6c('0x30')](config[_0x3f6c('0x28')],_0x3f6c('0x31')));},'filename':function(_0x4e7998,_0x41a291,_0xc70ad3){_0xc70ad3(null,util[_0x3f6c('0x2a')]('%s-%s',Date[_0x3f6c('0x2c')](),_0x41a291[_0x3f6c('0x32')]));}})});router[_0x3f6c('0x24')](_0x3f6c('0x15'),upload['single'](_0x3f6c('0x33')),controller[_0x3f6c('0x34')]);var upload=multer({'storage':multer[_0x3f6c('0x2f')]({'destination':function(_0x581586,_0x39de38,_0x4b561d){_0x4b561d(null,path[_0x3f6c('0x30')](config[_0x3f6c('0x28')],_0x3f6c('0x31')));},'filename':function(_0x1df341,_0x11b5f2,_0x4d3704){_0x4d3704(null,util[_0x3f6c('0x2a')](_0x3f6c('0x2b'),Date['now'](),_0x11b5f2[_0x3f6c('0x32')]));}})});router[_0x3f6c('0x24')]('/:id/customer_avatar',upload[_0x3f6c('0x2d')](_0x3f6c('0x33')),controller[_0x3f6c('0x35')]);var upload=multer({'storage':multer[_0x3f6c('0x2f')]({'destination':function(_0x2e4877,_0x2421b5,_0x3ef351){_0x3ef351(null,path[_0x3f6c('0x30')](config[_0x3f6c('0x28')],_0x3f6c('0x31')));},'filename':function(_0x3910fd,_0x8e36ed,_0x5029b4){_0x5029b4(null,util['format'](_0x3f6c('0x2b'),Date[_0x3f6c('0x2c')](),_0x8e36ed[_0x3f6c('0x32')]));}})});router[_0x3f6c('0x24')]('/:id/system_avatar',upload[_0x3f6c('0x2d')]('file'),controller[_0x3f6c('0x36')]);router[_0x3f6c('0x24')]('/:id/notify',controller[_0x3f6c('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x3f6c('0x2f')]({'destination':function(_0x53c23a,_0x2192cb,_0x90db60){const _0x6bfb3d=path[_0x3f6c('0x30')](config[_0x3f6c('0x28')],_0x3f6c('0x38'),_0x3f6c('0x39'),'offline-chat');fs_extra[_0x3f6c('0x3a')](_0x6bfb3d,function(){_0x90db60(null,_0x6bfb3d);});},'filename':function(_0x564b9e,_0x11b831,_0x407f42){const _0x2f46aa=_0x11b831['originalname'][_0x3f6c('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1d73fe=path[_0x3f6c('0x3c')](_0x2f46aa);const _0x2c1f92=Date[_0x3f6c('0x2c')]()+'-'+_0x2f46aa[_0x3f6c('0x3b')](_0x1d73fe,'')+_0x1d73fe;_0x407f42(null,_0x2c1f92);}})});router['post'](_0x3f6c('0x3d'),offlineUploadMulter['any'](),controller[_0x3f6c('0x3e')]);router[_0x3f6c('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x3f6c('0x3f')]);router[_0x3f6c('0x24')](_0x3f6c('0x1d'),auth[_0x3f6c('0xb')](),controller['addApplications']);router[_0x3f6c('0x24')](_0x3f6c('0x1f'),auth['isAuthenticated'](),controller[_0x3f6c('0x40')]);router['post'](_0x3f6c('0x22'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x41')]);router[_0x3f6c('0x42')](_0x3f6c('0xf'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x43')]);router[_0x3f6c('0x44')](_0x3f6c('0xf'),auth[_0x3f6c('0xb')](),controller[_0x3f6c('0x45')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3f6c('0x46')]);router[_0x3f6c('0x44')](_0x3f6c('0x12'),auth['isAuthenticated'](),controller[_0x3f6c('0x47')]);router[_0x3f6c('0x44')](_0x3f6c('0x22'),auth['isAuthenticated'](),controller[_0x3f6c('0x48')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index acb2afa..12ec5da 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 _0x5353=['ENUM','AmazonAWS','Google','sequelize','STRING'];(function(_0x260d17,_0x41db16){var _0x11dc8d=function(_0x1f0492){while(--_0x1f0492){_0x260d17['push'](_0x260d17['shift']());}};_0x11dc8d(++_0x41db16);}(_0x5353,0x12f));var _0x3535=function(_0x3d1939,_0x1e9a55){_0x3d1939=_0x3d1939-0x0;var _0x3f944d=_0x5353[_0x3d1939];return _0x3f944d;};'use strict';var Sequelize=require(_0x3535('0x0'));module['exports']={'name':{'type':Sequelize[_0x3535('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3535('0x2')](_0x3535('0x3'),_0x3535('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3535('0x1')]},'data2':{'type':Sequelize[_0x3535('0x1')]}}; \ No newline at end of file +var _0x9fd4=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x16b331,_0xbbc92b){var _0x5613d9=function(_0x5c5c8b){while(--_0x5c5c8b){_0x16b331['push'](_0x16b331['shift']());}};_0x5613d9(++_0xbbc92b);}(_0x9fd4,0x16c));var _0x49fd=function(_0x459bcb,_0x1c02aa){_0x459bcb=_0x459bcb-0x0;var _0x308a6b=_0x9fd4[_0x459bcb];return _0x308a6b;};'use strict';var Sequelize=require(_0x49fd('0x0'));module[_0x49fd('0x1')]={'name':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x49fd('0x3')](_0x49fd('0x4'),_0x49fd('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x49fd('0x2')]},'data2':{'type':Sequelize[_0x49fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 09db763..f00b934 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x4641c3,_0x54dc03){var _0x4e73d1=function(_0x10d4e4){while(--_0x10d4e4){_0x4641c3['push'](_0x4641c3['shift']());}};_0x4e73d1(++_0x54dc03);}(_0xdb28,0x106));var _0x8db2=function(_0x472726,_0x38cf2d){_0x472726=_0x472726-0x0;var _0xb3be3e=_0xdb28[_0x472726];return _0xb3be3e;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x4ef30d,_0x2586bd){var _0x5768e5=function(_0x496a90){while(--_0x496a90){_0x4ef30d['push'](_0x4ef30d['shift']());}};_0x5768e5(++_0x2586bd);}(_0x2032,0xd9));var _0x2203=function(_0x186b67,_0x439a85){_0x186b67=_0x186b67-0x0;var _0x4753cd=_0x2032[_0x186b67];return _0x4753cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 6bca8d8..94f5c8a 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 _0x3c93=['define','CloudProvider','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x3c93,0x10a));var _0x33c9=function(_0x6b2baa,_0xede85a){_0x6b2baa=_0x6b2baa-0x0;var _0x2f552d=_0x3c93[_0x6b2baa];return _0x2f552d;};'use strict';var _=require(_0x33c9('0x0'));var util=require(_0x33c9('0x1'));var logger=require(_0x33c9('0x2'))(_0x33c9('0x3'));var moment=require('moment');var BPromise=require(_0x33c9('0x4'));var rp=require(_0x33c9('0x5'));var fs=require('fs');var path=require(_0x33c9('0x6'));var rimraf=require(_0x33c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x33c9('0x8'));module['exports']=function(_0x5031b8,_0x2dcfcb){return _0x5031b8[_0x33c9('0x9')](_0x33c9('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4d3=['../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','../../config/logger','api','bluebird','path'];(function(_0xe97423,_0x5a5df8){var _0x31c066=function(_0x28ac2d){while(--_0x28ac2d){_0xe97423['push'](_0xe97423['shift']());}};_0x31c066(++_0x5a5df8);}(_0xe4d3,0x1b3));var _0x3e4d=function(_0x16ce5b,_0x5c5fdb){_0x16ce5b=_0x16ce5b-0x0;var _0x44639c=_0xe4d3[_0x16ce5b];return _0x44639c;};'use strict';var _=require(_0x3e4d('0x0'));var util=require('util');var logger=require(_0x3e4d('0x1'))(_0x3e4d('0x2'));var moment=require('moment');var BPromise=require(_0x3e4d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e4d('0x4'));var rimraf=require('rimraf');var config=require(_0x3e4d('0x5'));var attributes=require(_0x3e4d('0x6'));module[_0x3e4d('0x7')]=function(_0x2705c8,_0x5a9392){return _0x2705c8[_0x3e4d('0x8')]('CloudProvider',attributes,{'tableName':_0x3e4d('0x9'),'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 5ba58f8..72c2112 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 _0x530f=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s'];(function(_0x1b47fb,_0x3924de){var _0x2245f1=function(_0x584613){while(--_0x584613){_0x1b47fb['push'](_0x1b47fb['shift']());}};_0x2245f1(++_0x3924de);}(_0x530f,0x167));var _0xf530=function(_0x39b316,_0x3def1e){_0x39b316=_0x39b316-0x0;var _0x182ab1=_0x530f[_0x39b316];return _0x182ab1;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf530('0x1'));var fs=require('fs');var Redis=require(_0xf530('0x2'));var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require(_0xf530('0x5'))(_0xf530('0x6'));var config=require(_0xf530('0x7'));var jayson=require(_0xf530('0x8'));var client=jayson['client'][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce7f8,_0x1e8282,_0x50682f){return new BPromise(function(_0x2bbe3c,_0xf205be){return client[_0xf530('0xa')](_0x2ce7f8,_0x50682f)[_0xf530('0xb')](function(_0x4132bf){logger[_0xf530('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0xf530('0xd'));logger[_0xf530('0xe')](_0xf530('0xf'),_0x1e8282,_0xf530('0xd'),JSON[_0xf530('0x10')](_0x4132bf));if(_0x4132bf[_0xf530('0x11')]){if(_0x4132bf['error']['code']===0x1f4){logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0xf205be(_0x4132bf[_0xf530('0x11')]['message']);}logger[_0xf530('0x11')](_0xf530('0x12'),_0x1e8282,_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);return _0x2bbe3c(_0x4132bf[_0xf530('0x11')][_0xf530('0x13')]);}else{logger[_0xf530('0xc')](_0xf530('0x12'),_0x1e8282,'request\x20sent');_0x2bbe3c(_0x4132bf[_0xf530('0x14')][_0xf530('0x13')]);}})['catch'](function(_0x32eaea){logger[_0xf530('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1e8282,_0x32eaea);_0xf205be(_0x32eaea);});});} \ No newline at end of file +var _0xcae2=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x390cea,_0x43c078){var _0x14bf80=function(_0x196f3c){while(--_0x196f3c){_0x390cea['push'](_0x390cea['shift']());}};_0x14bf80(++_0x43c078);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rs=require(_0x2cae('0x4'));var fs=require('fs');var Redis=require(_0x2cae('0x5'));var db=require(_0x2cae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cae('0x7'))(_0x2cae('0x8'));var config=require(_0x2cae('0x9'));var jayson=require(_0x2cae('0xa'));var client=jayson['client'][_0x2cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feff6,_0x1e1a3d,_0x25b6a2){return new BPromise(function(_0x2e7498,_0x49e1d1){return client['request'](_0x1feff6,_0x25b6a2)['then'](function(_0x49f0d3){logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));logger[_0x2cae('0xf')](_0x2cae('0x10'),_0x1e1a3d,_0x2cae('0xe'),JSON['stringify'](_0x49f0d3));if(_0x49f0d3[_0x2cae('0x11')]){if(_0x49f0d3['error'][_0x2cae('0x12')]===0x1f4){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x49e1d1(_0x49f0d3[_0x2cae('0x11')]['message']);}logger[_0x2cae('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x2e7498(_0x49f0d3['error'][_0x2cae('0x13')]);}else{logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));_0x2e7498(_0x49f0d3['result'][_0x2cae('0x13')]);}})[_0x2cae('0x14')](function(_0x4a89e1){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x4a89e1);_0x49e1d1(_0x4a89e1);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 4a4b6f0..6d7ff9b 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 _0x0a39=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','destroy'];(function(_0x5b0fa4,_0x59b18d){var _0x31df63=function(_0x210bf8){while(--_0x210bf8){_0x5b0fa4['push'](_0x5b0fa4['shift']());}};_0x31df63(++_0x59b18d);}(_0x0a39,0x176));var _0x90a3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0a39[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x90a3('0x0'));var util=require('util');var path=require(_0x90a3('0x1'));var timeout=require(_0x90a3('0x2'));var express=require('express');var router=express[_0x90a3('0x3')]();var fs_extra=require(_0x90a3('0x4'));var auth=require(_0x90a3('0x5'));var interaction=require(_0x90a3('0x6'));var config=require(_0x90a3('0x7'));var controller=require(_0x90a3('0x8'));router[_0x90a3('0x9')]('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0xb')]);router[_0x90a3('0x9')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0xd')]);router['post']('/',auth[_0x90a3('0xa')](),controller[_0x90a3('0xe')]);router[_0x90a3('0xf')](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller['update']);router['delete'](_0x90a3('0xc'),auth[_0x90a3('0xa')](),controller[_0x90a3('0x10')]);module['exports']=router; \ No newline at end of file +var _0x686f=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','util','path'];(function(_0x143731,_0xa4bb31){var _0xa0e4de=function(_0xa2fb93){while(--_0xa2fb93){_0x143731['push'](_0x143731['shift']());}};_0xa0e4de(++_0xa4bb31);}(_0x686f,0x108));var _0xf686=function(_0x2c8f94,_0x595db3){_0x2c8f94=_0x2c8f94-0x0;var _0x2ac00e=_0x686f[_0x2c8f94];return _0x2ac00e;};'use strict';var multer=require('multer');var util=require(_0xf686('0x0'));var path=require(_0xf686('0x1'));var timeout=require(_0xf686('0x2'));var express=require(_0xf686('0x3'));var router=express[_0xf686('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf686('0x5'));var interaction=require(_0xf686('0x6'));var config=require(_0xf686('0x7'));var controller=require(_0xf686('0x8'));router[_0xf686('0x9')]('/',auth['isAuthenticated'](),controller[_0xf686('0xa')]);router[_0xf686('0x9')](_0xf686('0xb'),auth[_0xf686('0xc')](),controller['show']);router[_0xf686('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf686('0xe')]('/:id',auth[_0xf686('0xc')](),controller[_0xf686('0xf')]);router[_0xf686('0x10')](_0xf686('0xb'),auth['isAuthenticated'](),controller[_0xf686('0x11')]);module[_0xf686('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index b959512..d66525e 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 _0xc726=['sequelize','exports','STRING','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc726,0x134));var _0x6c72=function(_0x3194c2,_0x807309){_0x3194c2=_0x3194c2-0x0;var _0x4c666a=_0xc726[_0x3194c2];return _0x4c666a;};'use strict';var Sequelize=require(_0x6c72('0x0'));module[_0x6c72('0x1')]={'name':{'type':Sequelize[_0x6c72('0x2')],'unique':_0x6c72('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6c72('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x6c72('0x2')]},'phone':{'type':Sequelize[_0x6c72('0x2')]},'fax':{'type':Sequelize[_0x6c72('0x2')]},'type':{'type':Sequelize[_0x6c72('0x2')]},'street':{'type':Sequelize[_0x6c72('0x2')]},'postalCode':{'type':Sequelize[_0x6c72('0x2')]},'city':{'type':Sequelize[_0x6c72('0x2')]},'country':{'type':Sequelize[_0x6c72('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x6c72('0x2')]},'sPostalCode':{'type':Sequelize[_0x6c72('0x2')]},'sCity':{'type':Sequelize[_0x6c72('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6c72('0x2')]}}; \ No newline at end of file +var _0x786f=['sequelize','exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x786f,0xc8));var _0xf786=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x786f[_0x49beea];return _0x27693a;};'use strict';var Sequelize=require(_0xf786('0x0'));module[_0xf786('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf786('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf786('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf786('0x3')]},'fax':{'type':Sequelize[_0xf786('0x3')]},'type':{'type':Sequelize[_0xf786('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf786('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xf786('0x3')]},'email':{'type':Sequelize[_0xf786('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf786('0x3')]},'sStreet':{'type':Sequelize[_0xf786('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xf786('0x3')]},'description':{'type':Sequelize[_0xf786('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index d11d2d1..704a275 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 _0x3509=['undefined','limit','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','end','stack','name','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','count','includeAll','rows','catch','show','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','CmContact','addContacts','ids','omit','getContacts','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0xa83955,_0x842b87){var _0x39d283=function(_0x1f7c2e){while(--_0x1f7c2e){_0xa83955['push'](_0xa83955['shift']());}};_0x39d283(++_0x842b87);}(_0x3509,0x137));var _0x9350=function(_0x3ca012,_0x4cff79){_0x3ca012=_0x3ca012-0x0;var _0x1a8b78=_0x3509[_0x3ca012];return _0x1a8b78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9350('0x0'));var zipdir=require(_0x9350('0x1'));var jsonpatch=require(_0x9350('0x2'));var rp=require(_0x9350('0x3'));var moment=require(_0x9350('0x4'));var BPromise=require(_0x9350('0x5'));var Mustache=require('mustache');var util=require(_0x9350('0x6'));var path=require(_0x9350('0x7'));var sox=require(_0x9350('0x8'));var csv=require(_0x9350('0x9'));var ejs=require(_0x9350('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9350('0xb'));var squel=require(_0x9350('0xc'));var crypto=require(_0x9350('0xd'));var jsforce=require(_0x9350('0xe'));var deskjs=require(_0x9350('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9350('0x10'));var Redis=require(_0x9350('0x11'));var authService=require(_0x9350('0x12'));var qs=require(_0x9350('0x13'));var as=require(_0x9350('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9350('0x15'))(_0x9350('0x16'));var utils=require('../../config/utils');var config=require(_0x9350('0x17'));var licenseUtil=require(_0x9350('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a2c51,_0x252cb2){_0x252cb2=_0x252cb2||0xcc;return function(_0x21f30e){if(_0x21f30e){return _0x1a2c51[_0x9350('0x19')](_0x252cb2);}return _0x1a2c51[_0x9350('0x1a')](_0x252cb2)['end']();};}function respondWithResult(_0x19d600,_0x59e0ff){_0x59e0ff=_0x59e0ff||0xc8;return function(_0x415d5c){if(_0x415d5c){return _0x19d600[_0x9350('0x1a')](_0x59e0ff)[_0x9350('0x1b')](_0x415d5c);}};}function respondWithFilteredResult(_0x43938f,_0x34324b){return function(_0x42f8bb){if(_0x42f8bb){var _0x321995=typeof _0x34324b[_0x9350('0x1c')]===_0x9350('0x1d')&&typeof _0x34324b[_0x9350('0x1e')]==='undefined';var _0xb949cf=_0x42f8bb['count'];var _0x3f5dfe=_0x321995?0x0:_0x34324b[_0x9350('0x1c')];var _0x16a8eb=_0x321995?_0x42f8bb['count']:_0x34324b[_0x9350('0x1c')]+_0x34324b[_0x9350('0x1e')];var _0x218930;if(_0x16a8eb>=_0xb949cf){_0x16a8eb=_0xb949cf;_0x218930=0xc8;}else{_0x218930=0xce;}_0x43938f[_0x9350('0x1a')](_0x218930);return _0x43938f[_0x9350('0x1f')]('Content-Range',_0x3f5dfe+'-'+_0x16a8eb+'/'+_0xb949cf)[_0x9350('0x1b')](_0x42f8bb);}return null;};}function patchUpdates(_0x512b1c){return function(_0x203d0d){try{jsonpatch[_0x9350('0x20')](_0x203d0d,_0x512b1c,!![]);}catch(_0x23828b){return BPromise[_0x9350('0x21')](_0x23828b);}return _0x203d0d[_0x9350('0x22')]();};}function saveUpdates(_0x167084,_0x4620d4){return function(_0x29ff72){if(_0x29ff72){return _0x29ff72['update'](_0x167084)[_0x9350('0x23')](function(_0xc8545e){return _0xc8545e;});}return null;};}function removeEntity(_0x4b9e35,_0x13b1a1){return function(_0x2e0a96){if(_0x2e0a96){return _0x2e0a96[_0x9350('0x24')]()['then'](function(){var _0x3971b0=_0x2e0a96[_0x9350('0x25')]({'plain':!![]});var _0x98556c=_0x9350('0x26');return db[_0x9350('0x27')][_0x9350('0x24')]({'where':{'type':_0x98556c,'resourceId':_0x3971b0['id']}})['then'](function(){return _0x2e0a96;});})[_0x9350('0x23')](function(){_0x4b9e35[_0x9350('0x1a')](0xcc)[_0x9350('0x28')]();});}};}function handleEntityNotFound(_0x5798df,_0x660492){return function(_0x5663be){if(!_0x5663be){_0x5798df['sendStatus'](0x194);}return _0x5663be;};}function handleError(_0x59c1d1,_0x471193){_0x471193=_0x471193||0x1f4;return function(_0xc545a8){logger['error'](_0xc545a8[_0x9350('0x29')]);if(_0xc545a8[_0x9350('0x2a')]){delete _0xc545a8[_0x9350('0x2a')];}_0x59c1d1[_0x9350('0x1a')](_0x471193)['send'](_0xc545a8);};}exports['index']=function(_0x319599,_0x53f37a){var _0x30f51e={},_0x553536={},_0x358424={'count':0x0,'rows':[]};return db[_0x9350('0x2b')][_0x9350('0x2c')]()[_0x9350('0x23')](function(_0x4e7d31){_0x553536[_0x9350('0x2d')]=_[_0x9350('0x2e')](_0x4e7d31);_0x553536[_0x9350('0x2f')]=_['keys'](_0x319599['query']);_0x553536[_0x9350('0x30')]=_[_0x9350('0x31')](_0x553536['model'],_0x553536[_0x9350('0x2f')]);_0x30f51e['attributes']=_[_0x9350('0x31')](_0x553536[_0x9350('0x2d')],qs[_0x9350('0x32')](_0x319599[_0x9350('0x2f')]['fields']));_0x30f51e[_0x9350('0x33')]=_0x30f51e[_0x9350('0x33')][_0x9350('0x34')]?_0x30f51e[_0x9350('0x33')]:_0x553536[_0x9350('0x2d')];if(!_0x319599[_0x9350('0x2f')][_0x9350('0x35')](_0x9350('0x36'))){_0x30f51e[_0x9350('0x1e')]=qs[_0x9350('0x1e')](_0x319599[_0x9350('0x2f')][_0x9350('0x1e')]);_0x30f51e[_0x9350('0x1c')]=qs[_0x9350('0x1c')](_0x319599[_0x9350('0x2f')]['offset']);}_0x30f51e[_0x9350('0x37')]=qs[_0x9350('0x38')](_0x319599[_0x9350('0x2f')][_0x9350('0x38')]);_0x30f51e[_0x9350('0x39')]=qs[_0x9350('0x30')](_['pick'](_0x319599[_0x9350('0x2f')],_0x553536['filters']),_0x4e7d31);if(_0x319599['query'][_0x9350('0x3a')]){_0x30f51e[_0x9350('0x39')]=_[_0x9350('0x3b')](_0x30f51e[_0x9350('0x39')],{'$or':_[_0x9350('0x3c')](_0x30f51e[_0x9350('0x33')],function(_0x425541){var _0x23b473={};_0x23b473[_0x425541]={'$like':'%'+_0x319599['query'][_0x9350('0x3a')]+'%'};return _0x23b473;})});}_0x30f51e=_[_0x9350('0x3b')]({},_0x30f51e,_0x319599['options']);var _0x2ffb01={'where':_0x30f51e[_0x9350('0x39')]};return db[_0x9350('0x2b')][_0x9350('0x3d')](_0x2ffb01)[_0x9350('0x23')](function(_0x20742c){_0x358424[_0x9350('0x3d')]=_0x20742c;if(_0x319599[_0x9350('0x2f')][_0x9350('0x3e')]){_0x30f51e['include']=[{'all':!![]}];}return db[_0x9350('0x2b')]['findAll'](_0x30f51e);})[_0x9350('0x23')](function(_0x4c3357){_0x358424[_0x9350('0x3f')]=_0x4c3357;return _0x358424;})[_0x9350('0x23')](respondWithFilteredResult(_0x53f37a,_0x30f51e))['catch'](handleError(_0x53f37a,null));})[_0x9350('0x40')](handleError(_0x53f37a,null));};exports[_0x9350('0x41')]=function(_0x3be0e6,_0x53938b){var _0x1510ed={'raw':![],'where':{'id':_0x3be0e6[_0x9350('0x42')]['id']}},_0x1dc2ae={};_0x1dc2ae[_0x9350('0x2d')]=_['keys'](db[_0x9350('0x2b')][_0x9350('0x43')]);_0x1dc2ae[_0x9350('0x2f')]=_[_0x9350('0x2e')](_0x3be0e6[_0x9350('0x2f')]);_0x1dc2ae[_0x9350('0x30')]=_[_0x9350('0x31')](_0x1dc2ae['model'],_0x1dc2ae[_0x9350('0x2f')]);_0x1510ed[_0x9350('0x33')]=_['intersection'](_0x1dc2ae[_0x9350('0x2d')],qs['fields'](_0x3be0e6['query']['fields']));_0x1510ed['attributes']=_0x1510ed[_0x9350('0x33')][_0x9350('0x34')]?_0x1510ed[_0x9350('0x33')]:_0x1dc2ae[_0x9350('0x2d')];if(_0x3be0e6[_0x9350('0x2f')][_0x9350('0x3e')]){_0x1510ed[_0x9350('0x44')]=[{'all':!![]}];}_0x1510ed=_[_0x9350('0x3b')]({},_0x1510ed,_0x3be0e6[_0x9350('0x45')]);return db['CmCompany']['find'](_0x1510ed)[_0x9350('0x23')](handleEntityNotFound(_0x53938b,null))['then'](respondWithResult(_0x53938b,null))[_0x9350('0x40')](handleError(_0x53938b,null));};exports[_0x9350('0x46')]=function(_0x4c7f73,_0x2d364a){return db[_0x9350('0x2b')]['create'](_0x4c7f73[_0x9350('0x47')],{})[_0x9350('0x23')](function(_0x3e1cd7){var _0x2d3f37=_0x4c7f73[_0x9350('0x48')][_0x9350('0x25')]({'plain':!![]});if(!_0x2d3f37)throw new Error(_0x9350('0x49'));if(_0x2d3f37[_0x9350('0x4a')]===_0x9350('0x48')){var _0x295004=_0x3e1cd7['get']({'plain':!![]});var _0x42c787=_0x9350('0x26');return db[_0x9350('0x4b')][_0x9350('0x4c')]({'where':{'name':_0x42c787,'userProfileId':_0x2d3f37[_0x9350('0x4d')]},'raw':!![]})[_0x9350('0x23')](function(_0x283f4f){if(_0x283f4f&&_0x283f4f[_0x9350('0x4e')]===0x0){return db[_0x9350('0x27')][_0x9350('0x46')]({'name':_0x295004[_0x9350('0x2a')],'resourceId':_0x295004['id'],'type':_0x283f4f[_0x9350('0x2a')],'sectionId':_0x283f4f['id']},{})[_0x9350('0x23')](function(){return _0x3e1cd7;});}else{return _0x3e1cd7;}})[_0x9350('0x40')](function(_0x3b90a2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b90a2);throw _0x3b90a2;});}return _0x3e1cd7;})[_0x9350('0x23')](respondWithResult(_0x2d364a,0xc9))['catch'](handleError(_0x2d364a,null));};exports['update']=function(_0x1b7a1c,_0x46ffbb){if(_0x1b7a1c[_0x9350('0x47')]['id']){delete _0x1b7a1c[_0x9350('0x47')]['id'];}return db[_0x9350('0x2b')][_0x9350('0x4c')]({'where':{'id':_0x1b7a1c[_0x9350('0x42')]['id']}})[_0x9350('0x23')](handleEntityNotFound(_0x46ffbb,null))[_0x9350('0x23')](saveUpdates(_0x1b7a1c[_0x9350('0x47')],null))[_0x9350('0x23')](respondWithResult(_0x46ffbb,null))[_0x9350('0x40')](handleError(_0x46ffbb,null));};exports['destroy']=function(_0x579a78,_0xa6e822){return db[_0x9350('0x2b')][_0x9350('0x4c')]({'where':{'id':_0x579a78['params']['id']}})[_0x9350('0x23')](handleEntityNotFound(_0xa6e822,null))['then'](removeEntity(_0xa6e822,null))['catch'](handleError(_0xa6e822,null));};exports[_0x9350('0x2c')]=function(_0x5c5997,_0x441a06){return db[_0x9350('0x2b')]['describe']()['then'](respondWithResult(_0x441a06,null))['catch'](handleError(_0x441a06,null));};exports['addContacts']=function(_0x1d36f2,_0x1fa958,_0x4c52ef){return db[_0x9350('0x4f')][_0x9350('0x4c')]({'where':{'id':_0x1d36f2[_0x9350('0x42')]['id']}})[_0x9350('0x23')](handleEntityNotFound(_0x1fa958,null))[_0x9350('0x23')](function(_0x1a17f6){if(_0x1a17f6){return _0x1a17f6[_0x9350('0x50')](_0x1d36f2['body'][_0x9350('0x51')],_[_0x9350('0x52')](_0x1d36f2[_0x9350('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x1fa958,null))[_0x9350('0x40')](handleError(_0x1fa958,null));};exports[_0x9350('0x53')]=function(_0x5657ce,_0x2442a1,_0x54c5e1){var _0x2fc7a3={};var _0x418f6e={};var _0x4f1da1;var _0x53e4eb;return db['CmCompany'][_0x9350('0x54')]({'where':{'id':_0x5657ce[_0x9350('0x42')]['id']}})[_0x9350('0x23')](handleEntityNotFound(_0x2442a1,null))[_0x9350('0x23')](function(_0x34424e){if(_0x34424e){_0x4f1da1=_0x34424e;_0x418f6e['model']=_[_0x9350('0x2e')](db[_0x9350('0x4f')][_0x9350('0x43')]);_0x418f6e[_0x9350('0x2f')]=_[_0x9350('0x2e')](_0x5657ce[_0x9350('0x2f')]);_0x418f6e[_0x9350('0x30')]=_[_0x9350('0x31')](_0x418f6e[_0x9350('0x2d')],_0x418f6e[_0x9350('0x2f')]);_0x2fc7a3['attributes']=_[_0x9350('0x31')](_0x418f6e[_0x9350('0x2d')],qs[_0x9350('0x32')](_0x5657ce[_0x9350('0x2f')][_0x9350('0x32')]));_0x2fc7a3[_0x9350('0x33')]=_0x2fc7a3[_0x9350('0x33')][_0x9350('0x34')]?_0x2fc7a3[_0x9350('0x33')]:_0x418f6e[_0x9350('0x2d')];_0x2fc7a3[_0x9350('0x37')]=qs['sort'](_0x5657ce['query'][_0x9350('0x38')]);_0x2fc7a3[_0x9350('0x39')]=qs[_0x9350('0x30')](_['pick'](_0x5657ce[_0x9350('0x2f')],_0x418f6e['filters']));if(_0x5657ce[_0x9350('0x2f')]['filter']){_0x2fc7a3[_0x9350('0x39')]=_[_0x9350('0x3b')](_0x2fc7a3[_0x9350('0x39')],{'$or':_[_0x9350('0x3c')](_0x2fc7a3['attributes'],function(_0x50723a){var _0x5bcb79={};_0x5bcb79[_0x50723a]={'$like':'%'+_0x5657ce[_0x9350('0x2f')][_0x9350('0x3a')]+'%'};return _0x5bcb79;})});}_0x2fc7a3=_[_0x9350('0x3b')]({},_0x2fc7a3,_0x5657ce[_0x9350('0x45')]);return _0x4f1da1[_0x9350('0x53')](_0x2fc7a3);}})[_0x9350('0x23')](function(_0x349094){if(_0x349094){_0x53e4eb=_0x349094[_0x9350('0x34')];if(!_0x5657ce[_0x9350('0x2f')]['hasOwnProperty'](_0x9350('0x36'))){_0x2fc7a3[_0x9350('0x1e')]=qs[_0x9350('0x1e')](_0x5657ce['query'][_0x9350('0x1e')]);_0x2fc7a3['offset']=qs[_0x9350('0x1c')](_0x5657ce[_0x9350('0x2f')][_0x9350('0x1c')]);}return _0x4f1da1['getContacts'](_0x2fc7a3);}})[_0x9350('0x23')](function(_0x2e0d2f){if(_0x2e0d2f){return _0x2e0d2f?{'count':_0x53e4eb,'rows':_0x2e0d2f}:null;}})[_0x9350('0x23')](respondWithResult(_0x2442a1,null))['catch'](handleError(_0x2442a1,null));}; \ No newline at end of file +var _0xedb0=['filter','options','include','findAll','rows','catch','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Companies','UserProfileResource','end','error','name','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','map'];(function(_0x17e73b,_0x237aba){var _0x14fdb7=function(_0x34a9cd){while(--_0x34a9cd){_0x17e73b['push'](_0x17e73b['shift']());}};_0x14fdb7(++_0x237aba);}(_0xedb0,0x10c));var _0x0edb=function(_0x349711,_0x12a44c){_0x349711=_0x349711-0x0;var _0x17cae0=_0xedb0[_0x349711];return _0x17cae0;};'use strict';var emlformat=require(_0x0edb('0x0'));var rimraf=require(_0x0edb('0x1'));var zipdir=require(_0x0edb('0x2'));var jsonpatch=require(_0x0edb('0x3'));var rp=require(_0x0edb('0x4'));var moment=require('moment');var BPromise=require(_0x0edb('0x5'));var Mustache=require(_0x0edb('0x6'));var util=require('util');var path=require(_0x0edb('0x7'));var sox=require(_0x0edb('0x8'));var csv=require(_0x0edb('0x9'));var ejs=require(_0x0edb('0xa'));var fs=require('fs');var fs_extra=require(_0x0edb('0xb'));var _=require(_0x0edb('0xc'));var squel=require(_0x0edb('0xd'));var crypto=require(_0x0edb('0xe'));var jsforce=require(_0x0edb('0xf'));var deskjs=require(_0x0edb('0x10'));var toCsv=require(_0x0edb('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0edb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0edb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0edb('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0edb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0edb('0x15'));var db=require(_0x0edb('0x16'))['db'];function respondWithStatusCode(_0x541502,_0xc48998){_0xc48998=_0xc48998||0xcc;return function(_0x5c8f38){if(_0x5c8f38){return _0x541502[_0x0edb('0x17')](_0xc48998);}return _0x541502['status'](_0xc48998)['end']();};}function respondWithResult(_0x2fa523,_0x1e69c0){_0x1e69c0=_0x1e69c0||0xc8;return function(_0x3a549a){if(_0x3a549a){return _0x2fa523[_0x0edb('0x18')](_0x1e69c0)[_0x0edb('0x19')](_0x3a549a);}};}function respondWithFilteredResult(_0x388e87,_0x130762){return function(_0x5d07f6){if(_0x5d07f6){var _0x19ad51=typeof _0x130762[_0x0edb('0x1a')]===_0x0edb('0x1b')&&typeof _0x130762[_0x0edb('0x1c')]===_0x0edb('0x1b');var _0x1812df=_0x5d07f6[_0x0edb('0x1d')];var _0x469332=_0x19ad51?0x0:_0x130762['offset'];var _0x3e4486=_0x19ad51?_0x5d07f6[_0x0edb('0x1d')]:_0x130762[_0x0edb('0x1a')]+_0x130762[_0x0edb('0x1c')];var _0x514556;if(_0x3e4486>=_0x1812df){_0x3e4486=_0x1812df;_0x514556=0xc8;}else{_0x514556=0xce;}_0x388e87[_0x0edb('0x18')](_0x514556);return _0x388e87[_0x0edb('0x1e')](_0x0edb('0x1f'),_0x469332+'-'+_0x3e4486+'/'+_0x1812df)[_0x0edb('0x19')](_0x5d07f6);}return null;};}function patchUpdates(_0x3fc6a1){return function(_0x40554c){try{jsonpatch[_0x0edb('0x20')](_0x40554c,_0x3fc6a1,!![]);}catch(_0x1d4bd5){return BPromise[_0x0edb('0x21')](_0x1d4bd5);}return _0x40554c['save']();};}function saveUpdates(_0x4ea3fa,_0x4fb902){return function(_0x19c9fd){if(_0x19c9fd){return _0x19c9fd[_0x0edb('0x22')](_0x4ea3fa)[_0x0edb('0x23')](function(_0x271b78){return _0x271b78;});}return null;};}function removeEntity(_0x3d5f7c,_0x167163){return function(_0x2230b0){if(_0x2230b0){return _0x2230b0[_0x0edb('0x24')]()['then'](function(){var _0x25ec8d=_0x2230b0[_0x0edb('0x25')]({'plain':!![]});var _0x455018=_0x0edb('0x26');return db[_0x0edb('0x27')][_0x0edb('0x24')]({'where':{'type':_0x455018,'resourceId':_0x25ec8d['id']}})[_0x0edb('0x23')](function(){return _0x2230b0;});})[_0x0edb('0x23')](function(){_0x3d5f7c[_0x0edb('0x18')](0xcc)[_0x0edb('0x28')]();});}};}function handleEntityNotFound(_0x5063af,_0x55d902){return function(_0x4b6318){if(!_0x4b6318){_0x5063af[_0x0edb('0x17')](0x194);}return _0x4b6318;};}function handleError(_0x455a93,_0x165a28){_0x165a28=_0x165a28||0x1f4;return function(_0x3aee70){logger[_0x0edb('0x29')](_0x3aee70['stack']);if(_0x3aee70['name']){delete _0x3aee70[_0x0edb('0x2a')];}_0x455a93[_0x0edb('0x18')](_0x165a28)['send'](_0x3aee70);};}exports[_0x0edb('0x2b')]=function(_0x2fac6a,_0x49f011){var _0x45dd9a={},_0x3c1f9a={},_0x3519cc={'count':0x0,'rows':[]};return db[_0x0edb('0x2c')][_0x0edb('0x2d')]()[_0x0edb('0x23')](function(_0x257e65){_0x3c1f9a[_0x0edb('0x2e')]=_['keys'](_0x257e65);_0x3c1f9a[_0x0edb('0x2f')]=_[_0x0edb('0x30')](_0x2fac6a['query']);_0x3c1f9a[_0x0edb('0x31')]=_[_0x0edb('0x32')](_0x3c1f9a[_0x0edb('0x2e')],_0x3c1f9a[_0x0edb('0x2f')]);_0x45dd9a[_0x0edb('0x33')]=_[_0x0edb('0x32')](_0x3c1f9a[_0x0edb('0x2e')],qs[_0x0edb('0x34')](_0x2fac6a['query'][_0x0edb('0x34')]));_0x45dd9a['attributes']=_0x45dd9a[_0x0edb('0x33')]['length']?_0x45dd9a['attributes']:_0x3c1f9a[_0x0edb('0x2e')];if(!_0x2fac6a[_0x0edb('0x2f')]['hasOwnProperty'](_0x0edb('0x35'))){_0x45dd9a[_0x0edb('0x1c')]=qs['limit'](_0x2fac6a[_0x0edb('0x2f')][_0x0edb('0x1c')]);_0x45dd9a[_0x0edb('0x1a')]=qs[_0x0edb('0x1a')](_0x2fac6a[_0x0edb('0x2f')]['offset']);}_0x45dd9a[_0x0edb('0x36')]=qs[_0x0edb('0x37')](_0x2fac6a[_0x0edb('0x2f')][_0x0edb('0x37')]);_0x45dd9a['where']=qs['filters'](_[_0x0edb('0x38')](_0x2fac6a[_0x0edb('0x2f')],_0x3c1f9a[_0x0edb('0x31')]),_0x257e65);if(_0x2fac6a[_0x0edb('0x2f')]['filter']){_0x45dd9a[_0x0edb('0x39')]=_[_0x0edb('0x3a')](_0x45dd9a[_0x0edb('0x39')],{'$or':_[_0x0edb('0x3b')](_0x45dd9a[_0x0edb('0x33')],function(_0x278570){var _0x4d8da2={};_0x4d8da2[_0x278570]={'$like':'%'+_0x2fac6a['query'][_0x0edb('0x3c')]+'%'};return _0x4d8da2;})});}_0x45dd9a=_[_0x0edb('0x3a')]({},_0x45dd9a,_0x2fac6a[_0x0edb('0x3d')]);var _0x5b8659={'where':_0x45dd9a['where']};return db['CmCompany']['count'](_0x5b8659)[_0x0edb('0x23')](function(_0x12198d){_0x3519cc[_0x0edb('0x1d')]=_0x12198d;if(_0x2fac6a[_0x0edb('0x2f')]['includeAll']){_0x45dd9a[_0x0edb('0x3e')]=[{'all':!![]}];}return db['CmCompany'][_0x0edb('0x3f')](_0x45dd9a);})['then'](function(_0x40dc74){_0x3519cc[_0x0edb('0x40')]=_0x40dc74;return _0x3519cc;})[_0x0edb('0x23')](respondWithFilteredResult(_0x49f011,_0x45dd9a))[_0x0edb('0x41')](handleError(_0x49f011,null));})[_0x0edb('0x41')](handleError(_0x49f011,null));};exports['show']=function(_0x2e4d9b,_0x3e3953){var _0x14c15d={'raw':![],'where':{'id':_0x2e4d9b['params']['id']}},_0x37417d={};_0x37417d['model']=_[_0x0edb('0x30')](db[_0x0edb('0x2c')][_0x0edb('0x42')]);_0x37417d[_0x0edb('0x2f')]=_[_0x0edb('0x30')](_0x2e4d9b[_0x0edb('0x2f')]);_0x37417d[_0x0edb('0x31')]=_['intersection'](_0x37417d[_0x0edb('0x2e')],_0x37417d[_0x0edb('0x2f')]);_0x14c15d[_0x0edb('0x33')]=_[_0x0edb('0x32')](_0x37417d[_0x0edb('0x2e')],qs[_0x0edb('0x34')](_0x2e4d9b[_0x0edb('0x2f')]['fields']));_0x14c15d[_0x0edb('0x33')]=_0x14c15d[_0x0edb('0x33')][_0x0edb('0x43')]?_0x14c15d['attributes']:_0x37417d['model'];if(_0x2e4d9b['query']['includeAll']){_0x14c15d[_0x0edb('0x3e')]=[{'all':!![]}];}_0x14c15d=_[_0x0edb('0x3a')]({},_0x14c15d,_0x2e4d9b[_0x0edb('0x3d')]);return db['CmCompany'][_0x0edb('0x44')](_0x14c15d)[_0x0edb('0x23')](handleEntityNotFound(_0x3e3953,null))[_0x0edb('0x23')](respondWithResult(_0x3e3953,null))[_0x0edb('0x41')](handleError(_0x3e3953,null));};exports[_0x0edb('0x45')]=function(_0x15fd61,_0x4ff593){return db[_0x0edb('0x2c')]['create'](_0x15fd61[_0x0edb('0x46')],{})[_0x0edb('0x23')](function(_0x5c9ff8){var _0x5224ea=_0x15fd61[_0x0edb('0x47')][_0x0edb('0x25')]({'plain':!![]});if(!_0x5224ea)throw new Error(_0x0edb('0x48'));if(_0x5224ea['role']===_0x0edb('0x47')){var _0x141956=_0x5c9ff8['get']({'plain':!![]});var _0x4051fe=_0x0edb('0x26');return db['UserProfileSection'][_0x0edb('0x44')]({'where':{'name':_0x4051fe,'userProfileId':_0x5224ea['userProfileId']},'raw':!![]})[_0x0edb('0x23')](function(_0x17c516){if(_0x17c516&&_0x17c516[_0x0edb('0x49')]===0x0){return db[_0x0edb('0x27')]['create']({'name':_0x141956[_0x0edb('0x2a')],'resourceId':_0x141956['id'],'type':_0x17c516[_0x0edb('0x2a')],'sectionId':_0x17c516['id']},{})['then'](function(){return _0x5c9ff8;});}else{return _0x5c9ff8;}})[_0x0edb('0x41')](function(_0x8f3f64){logger['error'](_0x0edb('0x4a'),_0x8f3f64);throw _0x8f3f64;});}return _0x5c9ff8;})['then'](respondWithResult(_0x4ff593,0xc9))[_0x0edb('0x41')](handleError(_0x4ff593,null));};exports[_0x0edb('0x22')]=function(_0x2b5ac0,_0x5ad408){if(_0x2b5ac0[_0x0edb('0x46')]['id']){delete _0x2b5ac0[_0x0edb('0x46')]['id'];}return db[_0x0edb('0x2c')][_0x0edb('0x44')]({'where':{'id':_0x2b5ac0[_0x0edb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ad408,null))['then'](saveUpdates(_0x2b5ac0[_0x0edb('0x46')],null))['then'](respondWithResult(_0x5ad408,null))[_0x0edb('0x41')](handleError(_0x5ad408,null));};exports[_0x0edb('0x24')]=function(_0x560604,_0x45f2d8){return db[_0x0edb('0x2c')]['find']({'where':{'id':_0x560604['params']['id']}})[_0x0edb('0x23')](handleEntityNotFound(_0x45f2d8,null))[_0x0edb('0x23')](removeEntity(_0x45f2d8,null))['catch'](handleError(_0x45f2d8,null));};exports[_0x0edb('0x2d')]=function(_0x3188d5,_0x10ac46){return db[_0x0edb('0x2c')][_0x0edb('0x2d')]()['then'](respondWithResult(_0x10ac46,null))[_0x0edb('0x41')](handleError(_0x10ac46,null));};exports[_0x0edb('0x4c')]=function(_0x4ad731,_0x11b4f5,_0x37d42e){return db[_0x0edb('0x4d')][_0x0edb('0x44')]({'where':{'id':_0x4ad731[_0x0edb('0x4b')]['id']}})[_0x0edb('0x23')](handleEntityNotFound(_0x11b4f5,null))[_0x0edb('0x23')](function(_0xd76e54){if(_0xd76e54){return _0xd76e54[_0x0edb('0x4c')](_0x4ad731['body'][_0x0edb('0x4e')],_[_0x0edb('0x4f')](_0x4ad731[_0x0edb('0x46')],[_0x0edb('0x4e'),'id'])||{});}})[_0x0edb('0x23')](respondWithResult(_0x11b4f5,null))['catch'](handleError(_0x11b4f5,null));};exports[_0x0edb('0x50')]=function(_0x354d55,_0x4ea9de,_0x8dd145){var _0x282b2d={};var _0x403c22={};var _0x159b04;var _0x329210;return db[_0x0edb('0x2c')]['findOne']({'where':{'id':_0x354d55['params']['id']}})['then'](handleEntityNotFound(_0x4ea9de,null))[_0x0edb('0x23')](function(_0x515a84){if(_0x515a84){_0x159b04=_0x515a84;_0x403c22[_0x0edb('0x2e')]=_[_0x0edb('0x30')](db[_0x0edb('0x4d')]['rawAttributes']);_0x403c22[_0x0edb('0x2f')]=_[_0x0edb('0x30')](_0x354d55[_0x0edb('0x2f')]);_0x403c22[_0x0edb('0x31')]=_[_0x0edb('0x32')](_0x403c22[_0x0edb('0x2e')],_0x403c22[_0x0edb('0x2f')]);_0x282b2d[_0x0edb('0x33')]=_[_0x0edb('0x32')](_0x403c22[_0x0edb('0x2e')],qs[_0x0edb('0x34')](_0x354d55[_0x0edb('0x2f')][_0x0edb('0x34')]));_0x282b2d[_0x0edb('0x33')]=_0x282b2d[_0x0edb('0x33')][_0x0edb('0x43')]?_0x282b2d['attributes']:_0x403c22[_0x0edb('0x2e')];_0x282b2d[_0x0edb('0x36')]=qs[_0x0edb('0x37')](_0x354d55['query'][_0x0edb('0x37')]);_0x282b2d[_0x0edb('0x39')]=qs[_0x0edb('0x31')](_[_0x0edb('0x38')](_0x354d55[_0x0edb('0x2f')],_0x403c22[_0x0edb('0x31')]));if(_0x354d55[_0x0edb('0x2f')][_0x0edb('0x3c')]){_0x282b2d[_0x0edb('0x39')]=_[_0x0edb('0x3a')](_0x282b2d[_0x0edb('0x39')],{'$or':_['map'](_0x282b2d['attributes'],function(_0xa87677){var _0x4e29a7={};_0x4e29a7[_0xa87677]={'$like':'%'+_0x354d55[_0x0edb('0x2f')][_0x0edb('0x3c')]+'%'};return _0x4e29a7;})});}_0x282b2d=_[_0x0edb('0x3a')]({},_0x282b2d,_0x354d55['options']);return _0x159b04[_0x0edb('0x50')](_0x282b2d);}})[_0x0edb('0x23')](function(_0x6e5b0f){if(_0x6e5b0f){_0x329210=_0x6e5b0f[_0x0edb('0x43')];if(!_0x354d55[_0x0edb('0x2f')][_0x0edb('0x51')]('nolimit')){_0x282b2d[_0x0edb('0x1c')]=qs[_0x0edb('0x1c')](_0x354d55[_0x0edb('0x2f')][_0x0edb('0x1c')]);_0x282b2d[_0x0edb('0x1a')]=qs[_0x0edb('0x1a')](_0x354d55[_0x0edb('0x2f')][_0x0edb('0x1a')]);}return _0x159b04[_0x0edb('0x50')](_0x282b2d);}})['then'](function(_0x155a5d){if(_0x155a5d){return _0x155a5d?{'count':_0x329210,'rows':_0x155a5d}:null;}})[_0x0edb('0x23')](respondWithResult(_0x4ea9de,null))[_0x0edb('0x41')](handleError(_0x4ea9de,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4593b1d..17c6bb6 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 _0x3090=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmCompany','lodash','util'];(function(_0xa15223,_0x3f90ee){var _0x395b9a=function(_0x4eb25b){while(--_0x4eb25b){_0xa15223['push'](_0xa15223['shift']());}};_0x395b9a(++_0x3f90ee);}(_0x3090,0x127));var _0x0309=function(_0xb6dab,_0x5bff55){_0xb6dab=_0xb6dab-0x0;var _0x1ec72d=_0x3090[_0xb6dab];return _0x1ec72d;};'use strict';var _=require(_0x0309('0x0'));var util=require(_0x0309('0x1'));var logger=require(_0x0309('0x2'))(_0x0309('0x3'));var moment=require('moment');var BPromise=require(_0x0309('0x4'));var rp=require(_0x0309('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0309('0x6'));var config=require(_0x0309('0x7'));var attributes=require('./cmCompany.attributes');module[_0x0309('0x8')]=function(_0x29745f,_0x25a1e5){return _0x29745f[_0x0309('0x9')](_0x0309('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x900b=['bluebird','path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment'];(function(_0xfbe590,_0xeb207c){var _0x1b3fc0=function(_0xe43099){while(--_0xe43099){_0xfbe590['push'](_0xfbe590['shift']());}};_0x1b3fc0(++_0xeb207c);}(_0x900b,0x128));var _0xb900=function(_0x124cdd,_0x365e00){_0x124cdd=_0x124cdd-0x0;var _0x40a2f6=_0x900b[_0x124cdd];return _0x40a2f6;};'use strict';var _=require(_0xb900('0x0'));var util=require('util');var logger=require(_0xb900('0x1'))(_0xb900('0x2'));var moment=require(_0xb900('0x3'));var BPromise=require(_0xb900('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb900('0x5'));var rimraf=require(_0xb900('0x6'));var config=require(_0xb900('0x7'));var attributes=require('./cmCompany.attributes');module[_0xb900('0x8')]=function(_0x13ff61,_0x89c2f1){return _0x13ff61[_0xb900('0x9')](_0xb900('0xa'),attributes,{'tableName':_0xb900('0xb'),'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 18b3fa4..3f1eb7d 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 _0xfd63=['code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfd63,0xdd));var _0x3fd6=function(_0x441c73,_0x3b3205){_0x441c73=_0x441c73-0x0;var _0x221693=_0xfd63[_0x441c73];return _0x221693;};'use strict';var _=require('lodash');var util=require(_0x3fd6('0x0'));var moment=require(_0x3fd6('0x1'));var BPromise=require(_0x3fd6('0x2'));var rs=require(_0x3fd6('0x3'));var fs=require('fs');var Redis=require(_0x3fd6('0x4'));var db=require(_0x3fd6('0x5'))['db'];var utils=require(_0x3fd6('0x6'));var logger=require(_0x3fd6('0x7'))('rpc');var config=require(_0x3fd6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fd6('0x9')][_0x3fd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c443,_0x4554c6,_0x3f32c8){return new BPromise(function(_0x517f29,_0x53a0f2){return client[_0x3fd6('0xb')](_0x31c443,_0x3f32c8)[_0x3fd6('0xc')](function(_0x7082c1){logger['info'](_0x3fd6('0xd'),_0x4554c6,_0x3fd6('0xe'));logger[_0x3fd6('0xf')](_0x3fd6('0x10'),_0x4554c6,_0x3fd6('0xe'),JSON[_0x3fd6('0x11')](_0x7082c1));if(_0x7082c1[_0x3fd6('0x12')]){if(_0x7082c1[_0x3fd6('0x12')][_0x3fd6('0x13')]===0x1f4){logger[_0x3fd6('0x12')](_0x3fd6('0xd'),_0x4554c6,_0x7082c1[_0x3fd6('0x12')]['message']);return _0x53a0f2(_0x7082c1['error'][_0x3fd6('0x14')]);}logger[_0x3fd6('0x12')]('CmCompany,\x20%s,\x20%s',_0x4554c6,_0x7082c1[_0x3fd6('0x12')]['message']);return _0x517f29(_0x7082c1[_0x3fd6('0x12')][_0x3fd6('0x14')]);}else{logger[_0x3fd6('0x15')](_0x3fd6('0xd'),_0x4554c6,_0x3fd6('0xe'));_0x517f29(_0x7082c1[_0x3fd6('0x16')][_0x3fd6('0x14')]);}})[_0x3fd6('0x17')](function(_0x5ca04e){logger[_0x3fd6('0x12')](_0x3fd6('0xd'),_0x4554c6,_0x5ca04e);_0x53a0f2(_0x5ca04e);});});} \ No newline at end of file +var _0x6aef=['debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x377315,_0xb569ab){var _0x2ce4ef=function(_0x317ad9){while(--_0x317ad9){_0x377315['push'](_0x377315['shift']());}};_0x2ce4ef(++_0xb569ab);}(_0x6aef,0x144));var _0xf6ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf6ae('0x0'));var moment=require(_0xf6ae('0x1'));var BPromise=require(_0xf6ae('0x2'));var rs=require(_0xf6ae('0x3'));var fs=require('fs');var Redis=require(_0xf6ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf6ae('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf6ae('0x6')][_0xf6ae('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x288bc5,_0x38fbd0,_0x2f99fc){return new BPromise(function(_0x270e5f,_0x1b9708){return client[_0xf6ae('0x8')](_0x288bc5,_0x2f99fc)[_0xf6ae('0x9')](function(_0x3d7476){logger[_0xf6ae('0xa')](_0xf6ae('0xb'),_0x38fbd0,'request\x20sent');logger[_0xf6ae('0xc')](_0xf6ae('0xd'),_0x38fbd0,_0xf6ae('0xe'),JSON[_0xf6ae('0xf')](_0x3d7476));if(_0x3d7476[_0xf6ae('0x10')]){if(_0x3d7476[_0xf6ae('0x10')][_0xf6ae('0x11')]===0x1f4){logger['error'](_0xf6ae('0xb'),_0x38fbd0,_0x3d7476[_0xf6ae('0x10')][_0xf6ae('0x12')]);return _0x1b9708(_0x3d7476[_0xf6ae('0x10')]['message']);}logger['error'](_0xf6ae('0xb'),_0x38fbd0,_0x3d7476[_0xf6ae('0x10')]['message']);return _0x270e5f(_0x3d7476['error'][_0xf6ae('0x12')]);}else{logger[_0xf6ae('0xa')](_0xf6ae('0xb'),_0x38fbd0,_0xf6ae('0xe'));_0x270e5f(_0x3d7476[_0xf6ae('0x13')][_0xf6ae('0x12')]);}})[_0xf6ae('0x14')](function(_0x36fca6){logger[_0xf6ae('0x10')](_0xf6ae('0xb'),_0x38fbd0,_0x36fca6);_0x1b9708(_0x36fca6);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 84aac68..0d5b825 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 _0x5ee0=['delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','create','post','/:id/contacts','addContacts'];(function(_0x150800,_0x3e8f49){var _0x4796b9=function(_0x48d5ab){while(--_0x48d5ab){_0x150800['push'](_0x150800['shift']());}};_0x4796b9(++_0x3e8f49);}(_0x5ee0,0x129));var _0x05ee=function(_0x425e96,_0x2389bd){_0x425e96=_0x425e96-0x0;var _0xe80832=_0x5ee0[_0x425e96];return _0xe80832;};'use strict';var multer=require(_0x05ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05ee('0x1'));var express=require(_0x05ee('0x2'));var router=express['Router']();var fs_extra=require(_0x05ee('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x05ee('0x4'));var controller=require(_0x05ee('0x5'));router[_0x05ee('0x6')]('/',auth[_0x05ee('0x7')](),controller[_0x05ee('0x8')]);router[_0x05ee('0x6')](_0x05ee('0x9'),auth[_0x05ee('0x7')](),controller[_0x05ee('0xa')]);router[_0x05ee('0x6')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0xc')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x05ee('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x05ee('0xe')]);router[_0x05ee('0xf')](_0x05ee('0x10'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x11')]);router['put'](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller['update']);router[_0x05ee('0x12')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x13')]);module[_0x05ee('0x14')]=router; \ No newline at end of file +var _0x6824=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','/:id/contacts','addContacts','put','update','destroy','exports','multer','util','path','express'];(function(_0xe6fedd,_0x3c1278){var _0x3a6beb=function(_0xdbba8e){while(--_0xdbba8e){_0xe6fedd['push'](_0xe6fedd['shift']());}};_0x3a6beb(++_0x3c1278);}(_0x6824,0x104));var _0x4682=function(_0x40eb6e,_0x18015a){_0x40eb6e=_0x40eb6e-0x0;var _0x150089=_0x6824[_0x40eb6e];return _0x150089;};'use strict';var multer=require(_0x4682('0x0'));var util=require(_0x4682('0x1'));var path=require(_0x4682('0x2'));var timeout=require('connect-timeout');var express=require(_0x4682('0x3'));var router=express[_0x4682('0x4')]();var fs_extra=require(_0x4682('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4682('0x6'));var config=require(_0x4682('0x7'));var controller=require('./cmCompany.controller');router[_0x4682('0x8')]('/',auth[_0x4682('0x9')](),controller[_0x4682('0xa')]);router[_0x4682('0x8')]('/describe',auth[_0x4682('0x9')](),controller[_0x4682('0xb')]);router[_0x4682('0x8')](_0x4682('0xc'),auth[_0x4682('0x9')](),controller[_0x4682('0xd')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x4682('0xe')]('/',auth['isAuthenticated'](),controller[_0x4682('0xf')]);router[_0x4682('0xe')](_0x4682('0x10'),auth['isAuthenticated'](),controller[_0x4682('0x11')]);router[_0x4682('0x12')](_0x4682('0xc'),auth[_0x4682('0x9')](),controller[_0x4682('0x13')]);router['delete'](_0x4682('0xc'),auth[_0x4682('0x9')](),controller[_0x4682('0x14')]);module[_0x4682('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 0525786..8bd7ae4 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 _0x5487=['INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x5487,0xab));var _0x7548=function(_0x5b35dc,_0x114032){_0x5b35dc=_0x5b35dc-0x0;var _0x36b398=_0x5487[_0x5b35dc];return _0x36b398;};'use strict';var _=require(_0x7548('0x0'));var Sequelize=require(_0x7548('0x1'));module[_0x7548('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7548('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7548('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7548('0x3')]},'description':{'type':Sequelize[_0x7548('0x4')]},'phone':{'type':Sequelize[_0x7548('0x3')]},'mobile':{'type':Sequelize[_0x7548('0x3')]},'fax':{'type':Sequelize[_0x7548('0x3')]},'email':{'type':Sequelize[_0x7548('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x7548('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7548('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7548('0x3')]},'viber':{'type':Sequelize[_0x7548('0x3')]},'line':{'type':Sequelize[_0x7548('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7548('0x3')]},'UserId':{'type':Sequelize[_0x7548('0x5')]},'priority':{'type':Sequelize[_0x7548('0x5')](0x2)[_0x7548('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7548('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xd747=['NOW','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x426f74,_0x3edf53){var _0x42a4a8=function(_0x3a9e8c){while(--_0x3a9e8c){_0x426f74['push'](_0x426f74['shift']());}};_0x42a4a8(++_0x3edf53);}(_0xd747,0xa2));var _0x7d74=function(_0x3a9ee5,_0x287e7e){_0x3a9ee5=_0x3a9ee5-0x0;var _0x458151=_0xd747[_0x3a9ee5];return _0x458151;};'use strict';var _=require('lodash');var Sequelize=require(_0x7d74('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x7d74('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7d74('0x1')]},'street':{'type':Sequelize[_0x7d74('0x1')]},'postalCode':{'type':Sequelize[_0x7d74('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7d74('0x1')]},'description':{'type':Sequelize[_0x7d74('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x7d74('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7d74('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7d74('0x1')]},'skype':{'type':Sequelize[_0x7d74('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x7d74('0x1')]},'line':{'type':Sequelize[_0x7d74('0x1')]},'wechat':{'type':Sequelize[_0x7d74('0x1')]},'telegram':{'type':Sequelize[_0x7d74('0x1')]},'UserId':{'type':Sequelize[_0x7d74('0x3')]},'priority':{'type':Sequelize[_0x7d74('0x3')](0x2)[_0x7d74('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7d74('0x5')],'defaultValue':Sequelize[_0x7d74('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5685b76..91ba42c 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 _0x933e=['OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','duplicates','$or','findOrCreate','omit','params','$and','pickBy','format','cf_%d','table','setFields','id\x20=\x20?','phone','getTags','rawAttributes','pick','options','setTags','ContactId','includeAll','CmHopperHistory','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','import','binding','No\x20firstName\x20column\x20specified','child_process','fork','message','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','getJourney','mail','chat','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','key','Owner','browserName','customerIp','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','flatten','sortBy','reverse','moment','bluebird','util','path','squel','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','undefined','count','offset','set','Content-Range','update','destroy','then','status','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','model','filters','intersection','query','attributes','fields','nolimit','limit','order','sort','select','field','color','from','cm_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','expr','search','sqlOperator','conditions','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','DATE','text','hasOwnProperty','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','TagIds','Tags','rows','catch','find','columnName','displayName','analytics','findAll','custom','values','body','get','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','VoiceCallReport','ChatQueueReport','FaxQueueReport'];(function(_0x1bfcaa,_0x22cbde){var _0x152149=function(_0x1d070d){while(--_0x1d070d){_0x1bfcaa['push'](_0x1bfcaa['shift']());}};_0x152149(++_0x22cbde);}(_0x933e,0x17d));var _0xe933=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x933e[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0xe933('0x0'));var BPromise=require(_0xe933('0x1'));var util=require(_0xe933('0x2'));var path=require(_0xe933('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe933('0x4'));var Papa=require('papaparse');var Redis=require(_0xe933('0x5'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xe933('0x6'))(_0xe933('0x7'));var config=require(_0xe933('0x8'));var db=require('../../mysqldb')['db'];config[_0xe933('0x9')]=_[_0xe933('0xa')](config['redis'],{'host':_0xe933('0xb'),'port':0x18eb});var socket=require(_0xe933('0xc'))(new Redis(config['redis']));require(_0xe933('0xd'))[_0xe933('0xe')](socket);function respondWithResult(_0x29c34c,_0x3fff22){_0x3fff22=_0x3fff22||0xc8;return function(_0x399560){if(_0x399560){return _0x29c34c['status'](_0x3fff22)[_0xe933('0xf')](_0x399560);}};}function respondWithFilteredResult(_0x37e239,_0x53224a){return function(_0x38d97f){if(_0x38d97f){var _0x1b4fbf=typeof _0x53224a['offset']===_0xe933('0x10')&&typeof _0x53224a['limit']===_0xe933('0x10');var _0x464d3d=_0x38d97f[_0xe933('0x11')];var _0x50bb11=_0x1b4fbf?0x0:_0x53224a['offset'];var _0x3226a3=_0x1b4fbf?_0x38d97f[_0xe933('0x11')]:_0x53224a[_0xe933('0x12')]+_0x53224a['limit'];var _0x5ce427;if(_0x3226a3>=_0x464d3d){_0x3226a3=_0x464d3d;_0x5ce427=0xc8;}else{_0x5ce427=0xce;}_0x37e239['status'](_0x5ce427);return _0x37e239[_0xe933('0x13')](_0xe933('0x14'),_0x50bb11+'-'+_0x3226a3+'/'+_0x464d3d)[_0xe933('0xf')](_0x38d97f);}return null;};}function saveUpdates(_0x349dc9){return function(_0x12aae7){if(_0x12aae7){return _0x12aae7[_0xe933('0x15')](_0x349dc9)['then'](function(_0x492036){return _0x492036;});}return null;};}function removeEntity(_0x2e4024){return function(_0x266ee7){if(_0x266ee7){return _0x266ee7[_0xe933('0x16')]()[_0xe933('0x17')](function(){_0x2e4024[_0xe933('0x18')](0xcc)[_0xe933('0x19')]();});}};}function handleEntityNotFound(_0x5a6372){return function(_0x3b9e4a){if(!_0x3b9e4a){_0x5a6372[_0xe933('0x1a')](0x194);}return _0x3b9e4a;};}function handleError(_0x49c7a5,_0x54dd2c){_0x54dd2c=_0x54dd2c||0x1f4;return function(_0x334ee4){logger[_0xe933('0x1b')](_0x334ee4[_0xe933('0x1c')]);if(_0x334ee4[_0xe933('0x1d')]){delete _0x334ee4[_0xe933('0x1d')];}_0x49c7a5['status'](_0x54dd2c)[_0xe933('0x1e')](_0x334ee4);};}exports[_0xe933('0x1f')]=function(_0xf19f5c,_0x1285c5){var _0x2ef829={},_0x230683={},_0x4c57eb={'count':0x0,'rows':[]};return db[_0xe933('0x20')][_0xe933('0x21')]()[_0xe933('0x17')](function(_0xadf85c){var _0xda5aa9=[];for(var _0x46cfa4=0x0;_0x46cfa40x1){_0x3b858d['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14887d),null);}else{if(qs[_0xe933('0x62')](_0x14887d)){_0x3b858d['or'](_0xe933('0x63'),_0x14887d+'%');_0x3b858d['or'](_0xe933('0x64'),_0x14887d+'%');_0x3b858d['or'](_0xe933('0x65'),_0x14887d+'%');_0x3b858d['or'](_0xe933('0x66'),_0x14887d+'%');}else if(qs['isEmail'](_0x14887d)){_0x3b858d['or'](_0xe933('0x67'),_0x14887d+'%');}else{_0x3b858d['or'](_0xe933('0x68'),'%'+_0x14887d+'%');_0x3b858d['or']('c.lastName\x20LIKE\x20?','%'+_0x14887d+'%');_0x3b858d['or'](_0xe933('0x67'),'%'+_0x14887d+'%');}}}}_0x15de7d[_0xe933('0x42')](_0x3b858d);_0x15de7d[_0xe933('0x69')](_0xe933('0x6a'));var _0x57d973={'type':db[_0xe933('0x6b')]['QueryTypes'][_0xe933('0x6c')],'raw':!![]};var _0x5a3613=_0x15de7d[_0xe933('0x6d')]()[_0xe933('0x38')](_0xe933('0x6a'));if(_0x2ef829[_0xe933('0x35')]){_0x2ef829[_0xe933('0x35')][_0xe933('0x5a')](function(_0x4be8a7){_0x15de7d[_0xe933('0x35')]('c.'+_0x4be8a7[0x0],_0x4be8a7[0x1]===_0xe933('0x6e')?![]:!![]);});}if(!_[_0xe933('0x59')](_0x430af2)){_0x15de7d[_0xe933('0x6f')](_0x5253dc);_0x5a3613[_0xe933('0x42')](_0xe933('0x70'),_0x430af2);}BPromise[_0xe933('0x71')]()[_0xe933('0x17')](function(){if(!_0x175c78)return;if(_0xf19f5c[_0xe933('0x72')][_0xe933('0x73')]!==_0xe933('0x74'))return;if(!_[_0xe933('0x75')](_0x175c78[_0xe933('0x46')],[_0xe933('0x38'),_0xe933('0x4c')])){return _0xf19f5c[_0xe933('0x72')][_0xe933('0x76')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b0c46){if(_['isEmpty'](_0x1b0c46)){_0x5a3613[_0xe933('0x42')]('c.ListId\x20IS\x20NULL');_0x15de7d[_0xe933('0x42')](_0xe933('0x77'));}else{_0x5a3613[_0xe933('0x42')](_0xe933('0x5c'),_['map'](_0x1b0c46,'id'));_0x15de7d[_0xe933('0x42')](_0xe933('0x5c'),_[_0xe933('0x49')](_0x1b0c46,'id'));}});}})[_0xe933('0x17')](function(){if(_0xf19f5c[_0xe933('0x72')][_0xe933('0x73')]===_0xe933('0x74')&&!_0x175c78&&!_0xf19f5c[_0xe933('0x30')][_0xe933('0x5b')])return[];return db[_0xe933('0x78')][_0xe933('0x30')](_0x5a3613[_0xe933('0x79')](),_0x57d973);})['then'](function(_0x233662){_0x4c57eb[_0xe933('0x11')]=_0x233662[_0xe933('0x23')];if(_0x4c57eb['count']===0x0)return[];return db[_0xe933('0x78')][_0xe933('0x30')](_0x11661a[_0xe933('0x79')](),_0x57d973)[_0xe933('0x17')](function(_0x1f76b9){_0xf3ae3d=_[_0xe933('0x7a')](_0x1f76b9,'id');_0x57d973=_[_0xe933('0x7b')](_0x57d973,{'model':db[_0xe933('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf19f5c['query'][_0xe933('0x32')]){_0x2ef829[_0xe933('0x31')]['forEach'](function(_0x340c21){_0x15de7d[_0xe933('0x38')]('c.'+_0x340c21);});}else{_0x15de7d[_0xe933('0x38')]('c.id');_0x15de7d[_0xe933('0x38')](_0xe933('0x7c'));_0x15de7d[_0xe933('0x38')]('c.lastName');_0x15de7d[_0xe933('0x38')](_0xe933('0x7d'));_0x15de7d['field'](_0xe933('0x7e'));_0x15de7d[_0xe933('0x38')](_0xe933('0x7f'));_0x15de7d['field']('c.email');_0x15de7d['field'](_0xe933('0x80'));_0x15de7d[_0xe933('0x38')](_0xe933('0x81'));_0x15de7d[_0xe933('0x38')]('c.deletedAt');_0x15de7d[_0xe933('0x38')]('c.CompanyId');_0x15de7d[_0xe933('0x38')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe933('0x82'));}if(_0x2ef829[_0xe933('0x34')])_0x15de7d[_0xe933('0x34')](_0x2ef829[_0xe933('0x34')]);if(_0x2ef829[_0xe933('0x12')])_0x15de7d[_0xe933('0x12')](_0x2ef829[_0xe933('0x12')]);return db[_0xe933('0x78')][_0xe933('0x30')](_0x15de7d[_0xe933('0x79')](),_0x57d973);});})[_0xe933('0x17')](function(_0x45d146){_0x45d146[_0xe933('0x5a')](function(_0x1266f6){if(_0x1266f6[_0xe933('0x82')]){_0x1266f6[_0xe933('0x83')]=[];_0x1266f6['TagIds']['split'](',')[_0xe933('0x5a')](function(_0x5cd5f5){_0x1266f6['Tags'][_0xe933('0x26')](_0xf3ae3d[_0x5cd5f5]);});}delete _0x1266f6[_0xe933('0x82')];});_0x4c57eb[_0xe933('0x84')]=_0x45d146;return _0x4c57eb;})['then'](respondWithFilteredResult(_0x1285c5,_0x2ef829));})[_0xe933('0x85')](handleError(_0x1285c5,null));};exports[_0xe933('0x16')]=function(_0x51e7d9,_0x5d28f2){return db[_0xe933('0x20')][_0xe933('0x86')]({'where':{'id':_0x51e7d9['params']['id']}})[_0xe933('0x17')](handleEntityNotFound(_0x5d28f2,null))['then'](removeEntity(_0x5d28f2,null))[_0xe933('0x85')](handleError(_0x5d28f2,null));};exports['describe']=function(_0x3d0a28,_0x10e323){return db['CmContact'][_0xe933('0x21')]()[_0xe933('0x17')](function(_0x521be7){delete _0x521be7['tags'];for(var _0x59bc49=0x0;_0x59bc49=_0x1772ee){_0x33abe3=_0x1772ee;_0x202ebb=0xc8;}else{_0x202ebb=0xce;}_0x3f341c[_0x1750('0x12')](_0x202ebb);return _0x3f341c[_0x1750('0x16')]('Content-Range',_0x1cce22+'-'+_0x33abe3+'/'+_0x1772ee)['json'](_0x53dbfb);}return null;};}function saveUpdates(_0xce300f){return function(_0x5f3a2b){if(_0x5f3a2b){return _0x5f3a2b[_0x1750('0x17')](_0xce300f)['then'](function(_0x196dd2){return _0x196dd2;});}return null;};}function removeEntity(_0x21f433){return function(_0xc91c63){if(_0xc91c63){return _0xc91c63[_0x1750('0x18')]()[_0x1750('0x19')](function(){_0x21f433['status'](0xcc)[_0x1750('0x1a')]();});}};}function handleEntityNotFound(_0x210cd3){return function(_0x53a29d){if(!_0x53a29d){_0x210cd3[_0x1750('0x1b')](0x194);}return _0x53a29d;};}function handleError(_0x2d5842,_0x34b4f0){_0x34b4f0=_0x34b4f0||0x1f4;return function(_0x306fd0){logger[_0x1750('0x1c')](_0x306fd0['stack']);if(_0x306fd0[_0x1750('0x1d')]){delete _0x306fd0[_0x1750('0x1d')];}_0x2d5842[_0x1750('0x12')](_0x34b4f0)[_0x1750('0x1e')](_0x306fd0);};}exports[_0x1750('0x1f')]=function(_0x15b64,_0x2240df){var _0x33bd85={},_0x381d5d={},_0x3add7a={'count':0x0,'rows':[]};return db[_0x1750('0x20')][_0x1750('0x21')]()[_0x1750('0x19')](function(_0x2f2702){var _0x276d12=[];for(var _0x3712ce=0x0;_0x3712ce0x1){_0x407462['or'](_0x1750('0x5b'),qs[_0x1750('0x5c')](_0xfbe3d5),null);}else{if(qs[_0x1750('0x5d')](_0xfbe3d5)){_0x407462['or'](_0x1750('0x5e'),_0xfbe3d5+'%');_0x407462['or'](_0x1750('0x5f'),_0xfbe3d5+'%');_0x407462['or'](_0x1750('0x60'),_0xfbe3d5+'%');_0x407462['or'](_0x1750('0x61'),_0xfbe3d5+'%');}else if(qs[_0x1750('0x62')](_0xfbe3d5)){_0x407462['or'](_0x1750('0x63'),_0xfbe3d5+'%');}else{_0x407462['or']('c.firstName\x20LIKE\x20?','%'+_0xfbe3d5+'%');_0x407462['or'](_0x1750('0x64'),'%'+_0xfbe3d5+'%');_0x407462['or']('c.email\x20LIKE\x20?','%'+_0xfbe3d5+'%');}}}}_0x37a66d[_0x1750('0x3c')](_0x407462);_0x37a66d[_0x1750('0x65')](_0x1750('0x66'));var _0x4ba84c={'type':db[_0x1750('0x67')][_0x1750('0x68')][_0x1750('0x69')],'raw':!![]};var _0x2b26ec=_0x37a66d[_0x1750('0x6a')]()['field']('c.id');if(_0x33bd85[_0x1750('0x30')]){_0x33bd85[_0x1750('0x30')][_0x1750('0x54')](function(_0x4dca64){_0x37a66d[_0x1750('0x30')]('c.'+_0x4dca64[0x0],_0x4dca64[0x1]===_0x1750('0x6b')?![]:!![]);});}if(!_[_0x1750('0x53')](_0x2d94d2)){_0x37a66d['having'](_0xcd8d04);_0x2b26ec[_0x1750('0x3c')](_0x1750('0x6c'),_0x2d94d2);}BPromise[_0x1750('0x6d')]()['then'](function(){if(!_0xb3993a)return;if(_0x15b64['user'][_0x1750('0x6e')]!=='agent')return;if(!_['some'](_0xb3993a[_0x1750('0x42')],[_0x1750('0x34'),'User'])){return _0x15b64[_0x1750('0x6f')][_0x1750('0x70')]({'attributes':['id'],'raw':!![]})[_0x1750('0x19')](function(_0x1e2277){if(_['isEmpty'](_0x1e2277)){_0x2b26ec[_0x1750('0x3c')](_0x1750('0x71'));_0x37a66d['where'](_0x1750('0x71'));}else{_0x2b26ec[_0x1750('0x3c')]('c.ListId\x20IN\x20?',_['map'](_0x1e2277,'id'));_0x37a66d[_0x1750('0x3c')](_0x1750('0x72'),_[_0x1750('0x46')](_0x1e2277,'id'));}});}})[_0x1750('0x19')](function(){if(_0x15b64[_0x1750('0x6f')]['role']===_0x1750('0x73')&&!_0xb3993a&&!_0x15b64[_0x1750('0x2a')][_0x1750('0x55')])return[];return db[_0x1750('0x74')][_0x1750('0x2a')](_0x2b26ec['toString'](),_0x4ba84c);})[_0x1750('0x19')](function(_0x16a1c1){_0x3add7a['count']=_0x16a1c1[_0x1750('0x23')];if(_0x3add7a[_0x1750('0x75')]===0x0)return[];return db[_0x1750('0x74')][_0x1750('0x2a')](_0x119520[_0x1750('0x76')](),_0x4ba84c)[_0x1750('0x19')](function(_0x18dab6){_0x1680d3=_[_0x1750('0x77')](_0x18dab6,'id');_0x4ba84c=_[_0x1750('0x78')](_0x4ba84c,{'model':db[_0x1750('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15b64[_0x1750('0x2a')][_0x1750('0x2e')]){_0x33bd85[_0x1750('0x2d')][_0x1750('0x54')](function(_0x30e478){_0x37a66d[_0x1750('0x34')]('c.'+_0x30e478);});}else{_0x37a66d[_0x1750('0x34')](_0x1750('0x66'));_0x37a66d[_0x1750('0x34')](_0x1750('0x79'));_0x37a66d[_0x1750('0x34')](_0x1750('0x7a'));_0x37a66d[_0x1750('0x34')](_0x1750('0x7b'));_0x37a66d[_0x1750('0x34')]('c.mobile');_0x37a66d[_0x1750('0x34')](_0x1750('0x7c'));_0x37a66d[_0x1750('0x34')]('c.email');_0x37a66d['field']('c.ListId');_0x37a66d[_0x1750('0x34')]('c.createdAt');_0x37a66d[_0x1750('0x34')](_0x1750('0x7d'));_0x37a66d[_0x1750('0x34')](_0x1750('0x7e'));_0x37a66d['field'](_0x1750('0x7f'),_0x1750('0x80'));}if(_0x33bd85[_0x1750('0x14')])_0x37a66d[_0x1750('0x14')](_0x33bd85[_0x1750('0x14')]);if(_0x33bd85['offset'])_0x37a66d['offset'](_0x33bd85['offset']);return db['sequelize'][_0x1750('0x2a')](_0x37a66d[_0x1750('0x76')](),_0x4ba84c);});})['then'](function(_0x64e835){_0x64e835[_0x1750('0x54')](function(_0x58809b){if(_0x58809b[_0x1750('0x80')]){_0x58809b[_0x1750('0x81')]=[];_0x58809b['TagIds']['split'](',')[_0x1750('0x54')](function(_0x45c2d7){_0x58809b[_0x1750('0x81')][_0x1750('0x25')](_0x1680d3[_0x45c2d7]);});}delete _0x58809b[_0x1750('0x80')];});_0x3add7a[_0x1750('0x82')]=_0x64e835;return _0x3add7a;})[_0x1750('0x19')](respondWithFilteredResult(_0x2240df,_0x33bd85));})[_0x1750('0x83')](handleError(_0x2240df,null));};exports['destroy']=function(_0x402d8a,_0x10d4b7){return db[_0x1750('0x20')][_0x1750('0x43')]({'where':{'id':_0x402d8a['params']['id']}})[_0x1750('0x19')](handleEntityNotFound(_0x10d4b7,null))[_0x1750('0x19')](removeEntity(_0x10d4b7,null))[_0x1750('0x83')](handleError(_0x10d4b7,null));};exports['describe']=function(_0x527676,_0x71bee7){return db['CmContact'][_0x1750('0x21')]()[_0x1750('0x19')](function(_0x3f1be8){delete _0x3f1be8['tags'];for(var _0xa84e2b=0x0;_0xa84e2b{}\s\\|]/g,'-');_0x4d566e(null,util[_0x8320('0x20')](_0x8320('0x21'),path[_0x8320('0x22')](_0x573a62[_0x8320('0x1f')],path[_0x8320('0x23')](_0x573a62[_0x8320('0x1f')])),Date['now'](),path['extname'](_0x573a62[_0x8320('0x1f')])));}})});router[_0x8320('0x18')](_0x8320('0x24'),upload[_0x8320('0x25')](_0x8320('0x26')),controller[_0x8320('0x27')]);var upload=multer({'storage':multer[_0x8320('0x1b')]({'destination':function(_0x867c63,_0x44172b,_0x179483){_0x179483(null,path[_0x8320('0x1c')](config[_0x8320('0x1d')],_0x8320('0x1e')));},'filename':function(_0x326421,_0x405e27,_0x7a19b2){_0x405e27[_0x8320('0x1f')]=_0x405e27[_0x8320('0x1f')][_0x8320('0x28')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7a19b2(null,util['format'](_0x8320('0x21'),path[_0x8320('0x22')](_0x405e27['originalname'],path[_0x8320('0x23')](_0x405e27[_0x8320('0x1f')])),Date[_0x8320('0x29')](),path[_0x8320('0x23')](_0x405e27[_0x8320('0x1f')])));}})});router['post'](_0x8320('0x2a'),upload[_0x8320('0x25')](_0x8320('0x26')),controller[_0x8320('0x2b')]);router[_0x8320('0x18')](_0x8320('0x2c'),auth['isAuthenticated'](),controller[_0x8320('0x2d')]);router[_0x8320('0x2e')]('/:id',auth[_0x8320('0x9')](),controller[_0x8320('0x2f')]);router['delete'](_0x8320('0xd'),auth[_0x8320('0x9')](),controller[_0x8320('0x30')]);module[_0x8320('0x31')]=router; \ No newline at end of file +var _0xbc15=['%s-%s%s','basename','upload','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getTags','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','merge','create','/create_many','bulkCreate','/:id/tags','setTags','join','root','originalname','replace','format','extname','now','/csv','single','file','uploadCsv','diskStorage'];(function(_0x1f868b,_0x13769a){var _0x21437a=function(_0xdbee44){while(--_0xdbee44){_0x1f868b['push'](_0x1f868b['shift']());}};_0x21437a(++_0x13769a);}(_0xbc15,0x10e));var _0x5bc1=function(_0x301c53,_0xc298fe){_0x301c53=_0x301c53-0x0;var _0x4c2cab=_0xbc15[_0x301c53];return _0x4c2cab;};'use strict';var multer=require(_0x5bc1('0x0'));var util=require(_0x5bc1('0x1'));var path=require(_0x5bc1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5bc1('0x3'));var auth=require(_0x5bc1('0x4'));var interaction=require(_0x5bc1('0x5'));var config=require(_0x5bc1('0x6'));var controller=require(_0x5bc1('0x7'));router[_0x5bc1('0x8')]('/',auth[_0x5bc1('0x9')](),controller[_0x5bc1('0xa')]);router['get'](_0x5bc1('0xb'),auth[_0x5bc1('0x9')](),controller[_0x5bc1('0xc')]);router['get'](_0x5bc1('0xd'),auth[_0x5bc1('0x9')](),controller[_0x5bc1('0xe')]);router[_0x5bc1('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0x5bc1('0xf')]);router[_0x5bc1('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x5bc1('0x8')](_0x5bc1('0x10'),auth[_0x5bc1('0x9')](),controller[_0x5bc1('0x11')]);router[_0x5bc1('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x5bc1('0x12')]);router['get'](_0x5bc1('0x13'),auth[_0x5bc1('0x9')](),controller[_0x5bc1('0x14')]);router[_0x5bc1('0x8')](_0x5bc1('0x15'),auth['isAuthenticated'](),controller[_0x5bc1('0x16')]);router[_0x5bc1('0x17')]('/merge',auth[_0x5bc1('0x9')](),controller[_0x5bc1('0x18')]);router[_0x5bc1('0x17')]('/',auth[_0x5bc1('0x9')](),controller[_0x5bc1('0x19')]);router[_0x5bc1('0x17')](_0x5bc1('0x1a'),auth['isAuthenticated'](),controller[_0x5bc1('0x1b')]);router[_0x5bc1('0x17')](_0x5bc1('0x1c'),auth[_0x5bc1('0x9')](),controller[_0x5bc1('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d2d56,_0x3b0684,_0x2e9a54){_0x2e9a54(null,path[_0x5bc1('0x1e')](config[_0x5bc1('0x1f')],'server/files/tmp'));},'filename':function(_0x332231,_0x369936,_0x42f20f){_0x369936[_0x5bc1('0x20')]=_0x369936[_0x5bc1('0x20')][_0x5bc1('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x42f20f(null,util[_0x5bc1('0x22')]('%s-%s%s',path['basename'](_0x369936[_0x5bc1('0x20')],path[_0x5bc1('0x23')](_0x369936[_0x5bc1('0x20')])),Date[_0x5bc1('0x24')](),path[_0x5bc1('0x23')](_0x369936[_0x5bc1('0x20')])));}})});router[_0x5bc1('0x17')](_0x5bc1('0x25'),upload[_0x5bc1('0x26')](_0x5bc1('0x27')),controller[_0x5bc1('0x28')]);var upload=multer({'storage':multer[_0x5bc1('0x29')]({'destination':function(_0x53e154,_0x3fa77c,_0x332abc){_0x332abc(null,path[_0x5bc1('0x1e')](config[_0x5bc1('0x1f')],'server/files/tmp'));},'filename':function(_0x363503,_0x1ff9dc,_0x2844b2){_0x1ff9dc[_0x5bc1('0x20')]=_0x1ff9dc[_0x5bc1('0x20')][_0x5bc1('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2844b2(null,util['format'](_0x5bc1('0x2a'),path[_0x5bc1('0x2b')](_0x1ff9dc[_0x5bc1('0x20')],path[_0x5bc1('0x23')](_0x1ff9dc[_0x5bc1('0x20')])),Date[_0x5bc1('0x24')](),path['extname'](_0x1ff9dc[_0x5bc1('0x20')])));}})});router[_0x5bc1('0x17')]('/upload',upload[_0x5bc1('0x26')]('file'),controller[_0x5bc1('0x2c')]);router[_0x5bc1('0x17')](_0x5bc1('0x2d'),auth['isAuthenticated'](),controller[_0x5bc1('0x2e')]);router[_0x5bc1('0x2f')](_0x5bc1('0xd'),auth['isAuthenticated'](),controller[_0x5bc1('0x30')]);router[_0x5bc1('0x31')](_0x5bc1('0xd'),auth['isAuthenticated'](),controller[_0x5bc1('0x32')]);module[_0x5bc1('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 95cdfd7..8ec8d35 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 _0xf44c=['sequelize','VIRTUAL','getDataValue','alias','STRING','name','long','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','voice'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xf44c,0x159));var _0xcf44=function(_0x4a75c6,_0x275f60){_0x4a75c6=_0x4a75c6-0x0;var _0xfc61f3=_0xf44c[_0x4a75c6];return _0xfc61f3;};'use strict';var Sequelize=require(_0xcf44('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xcf44('0x1')],'get':function(_0x4b6718){return this[_0xcf44('0x2')](_0xcf44('0x3'));}},'alias':{'type':Sequelize[_0xcf44('0x4')],'allowNull':![],'set':function(_0x4f1183){this['setDataValue']('alias',_0x4f1183?_0x4f1183:this[_0xcf44('0x2')](_0xcf44('0x5')));}},'type':{'type':Sequelize[_0xcf44('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xcf44('0x6')),'get':function(){if(this[_0xcf44('0x2')]('type')===_0xcf44('0x7')){return JSON[_0xcf44('0x8')](this['getDataValue'](_0xcf44('0x9')));}else{return this['getDataValue'](_0xcf44('0x9'));}},'set':function(_0x47cdc2){if(Array[_0xcf44('0xa')](_0x47cdc2)){this[_0xcf44('0xb')]('values',JSON[_0xcf44('0xc')](_0x47cdc2));}else{this['setDataValue']('values',_0x47cdc2);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xcf44('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xcf44('0xe'))}}; \ No newline at end of file +var _0x3bb4=['type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','TEXT','long'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x3bb4,0xc3));var _0x43bb=function(_0x25a993,_0x23312c){_0x25a993=_0x25a993-0x0;var _0x1ab96a=_0x3bb4[_0x25a993];return _0x1ab96a;};'use strict';var Sequelize=require(_0x43bb('0x0'));var _=require(_0x43bb('0x1'));module[_0x43bb('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x586fe5){return this[_0x43bb('0x3')](_0x43bb('0x4'));}},'alias':{'type':Sequelize[_0x43bb('0x5')],'allowNull':![],'set':function(_0x5a3465){this[_0x43bb('0x6')](_0x43bb('0x4'),_0x5a3465?_0x5a3465:this[_0x43bb('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x43bb('0x7')](_0x43bb('0x8')),'get':function(){if(this[_0x43bb('0x3')](_0x43bb('0x9'))===_0x43bb('0xa')){return JSON[_0x43bb('0xb')](this[_0x43bb('0x3')](_0x43bb('0xc')));}else{return this[_0x43bb('0x3')](_0x43bb('0xc'));}},'set':function(_0x363693){if(Array[_0x43bb('0xd')](_0x363693)){this[_0x43bb('0x6')](_0x43bb('0xc'),JSON[_0x43bb('0xe')](_0x363693));}else{this['setDataValue'](_0x43bb('0xc'),_0x363693);}}},'required':{'type':Sequelize[_0x43bb('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x43bb('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x43bb('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 49b1b24..e4d1360 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 _0x51d6=['rows','catch','show','body','find','params','create','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','CmCustomField','rawAttributes','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','include'];(function(_0x466c38,_0x2e1407){var _0x48f688=function(_0x2b6d5c){while(--_0x2b6d5c){_0x466c38['push'](_0x466c38['shift']());}};_0x48f688(++_0x2e1407);}(_0x51d6,0xbd));var _0x651d=function(_0x13b11f,_0x350843){_0x13b11f=_0x13b11f-0x0;var _0x2fcc2f=_0x51d6[_0x13b11f];return _0x2fcc2f;};'use strict';var emlformat=require(_0x651d('0x0'));var rimraf=require(_0x651d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x651d('0x2'));var rp=require(_0x651d('0x3'));var moment=require(_0x651d('0x4'));var BPromise=require(_0x651d('0x5'));var Mustache=require(_0x651d('0x6'));var util=require('util');var path=require(_0x651d('0x7'));var sox=require(_0x651d('0x8'));var csv=require(_0x651d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x651d('0xa'));var _=require(_0x651d('0xb'));var squel=require(_0x651d('0xc'));var crypto=require(_0x651d('0xd'));var jsforce=require(_0x651d('0xe'));var deskjs=require(_0x651d('0xf'));var toCsv=require(_0x651d('0x9'));var querystring=require(_0x651d('0x10'));var Papa=require('papaparse');var Redis=require(_0x651d('0x11'));var authService=require(_0x651d('0x12'));var qs=require(_0x651d('0x13'));var as=require(_0x651d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x651d('0x15'))(_0x651d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x651d('0x17'))['db'];function respondWithStatusCode(_0x141054,_0x306d23){_0x306d23=_0x306d23||0xcc;return function(_0x31392c){if(_0x31392c){return _0x141054[_0x651d('0x18')](_0x306d23);}return _0x141054[_0x651d('0x19')](_0x306d23)[_0x651d('0x1a')]();};}function respondWithResult(_0x202c46,_0x8c0c9e){_0x8c0c9e=_0x8c0c9e||0xc8;return function(_0x53c7d6){if(_0x53c7d6){return _0x202c46[_0x651d('0x19')](_0x8c0c9e)[_0x651d('0x1b')](_0x53c7d6);}};}function respondWithFilteredResult(_0x31d23d,_0xcec6a2){return function(_0x27168f){if(_0x27168f){var _0x3bc61a=typeof _0xcec6a2[_0x651d('0x1c')]===_0x651d('0x1d')&&typeof _0xcec6a2[_0x651d('0x1e')]===_0x651d('0x1d');var _0x1fb0c4=_0x27168f[_0x651d('0x1f')];var _0x59baa9=_0x3bc61a?0x0:_0xcec6a2[_0x651d('0x1c')];var _0x38573e=_0x3bc61a?_0x27168f[_0x651d('0x1f')]:_0xcec6a2[_0x651d('0x1c')]+_0xcec6a2[_0x651d('0x1e')];var _0x4cdeb6;if(_0x38573e>=_0x1fb0c4){_0x38573e=_0x1fb0c4;_0x4cdeb6=0xc8;}else{_0x4cdeb6=0xce;}_0x31d23d[_0x651d('0x19')](_0x4cdeb6);return _0x31d23d[_0x651d('0x20')](_0x651d('0x21'),_0x59baa9+'-'+_0x38573e+'/'+_0x1fb0c4)[_0x651d('0x1b')](_0x27168f);}return null;};}function patchUpdates(_0x31b5bb){return function(_0x5ba6b1){try{jsonpatch[_0x651d('0x22')](_0x5ba6b1,_0x31b5bb,!![]);}catch(_0x4ebaf1){return BPromise[_0x651d('0x23')](_0x4ebaf1);}return _0x5ba6b1[_0x651d('0x24')]();};}function saveUpdates(_0x19d21c,_0x1aa8bf){return function(_0x4e3a72){if(_0x4e3a72){return _0x4e3a72[_0x651d('0x25')](_0x19d21c)[_0x651d('0x26')](function(_0xde5c64){return _0xde5c64;});}return null;};}function removeEntity(_0x5d97b0,_0x4bf984){return function(_0x45e726){if(_0x45e726){return _0x45e726['destroy']()['then'](function(){_0x5d97b0[_0x651d('0x19')](0xcc)[_0x651d('0x1a')]();});}};}function handleEntityNotFound(_0x238e02,_0x3242ee){return function(_0x489f5d){if(!_0x489f5d){_0x238e02[_0x651d('0x18')](0x194);}return _0x489f5d;};}function handleError(_0x2636a6,_0x44a8a0){_0x44a8a0=_0x44a8a0||0x1f4;return function(_0x3ea51d){logger[_0x651d('0x27')](_0x3ea51d[_0x651d('0x28')]);if(_0x3ea51d[_0x651d('0x29')]){delete _0x3ea51d['name'];}_0x2636a6[_0x651d('0x19')](_0x44a8a0)['send'](_0x3ea51d);};}exports[_0x651d('0x2a')]=function(_0x4fcda3,_0x532994){var _0x19340d={},_0x5343bf={},_0x168725={'count':0x0,'rows':[]};var _0x526cfa=_[_0x651d('0x2b')](db[_0x651d('0x2c')][_0x651d('0x2d')],function(_0x42c35c){return{'name':_0x42c35c['fieldName'],'type':_0x42c35c['type'][_0x651d('0x2e')]};});_0x5343bf['model']=_[_0x651d('0x2f')](_[_0x651d('0x2b')](_0x526cfa,_0x651d('0x29')),[_0x651d('0x29')]);_0x5343bf[_0x651d('0x30')]=_[_0x651d('0x31')](_0x4fcda3['query']);_0x5343bf[_0x651d('0x32')]=_[_0x651d('0x33')](_0x5343bf[_0x651d('0x34')],_0x5343bf[_0x651d('0x30')]);_0x19340d[_0x651d('0x35')]=_['intersection'](_0x5343bf[_0x651d('0x34')],qs[_0x651d('0x36')](_0x4fcda3[_0x651d('0x30')]['fields']));_0x19340d[_0x651d('0x35')]=_0x19340d[_0x651d('0x35')][_0x651d('0x37')]?_0x19340d['attributes']:_0x5343bf['model'];if(!_0x4fcda3[_0x651d('0x30')][_0x651d('0x38')]('nolimit')){_0x19340d[_0x651d('0x1e')]=qs['limit'](_0x4fcda3['query'][_0x651d('0x1e')]);_0x19340d[_0x651d('0x1c')]=qs['offset'](_0x4fcda3[_0x651d('0x30')]['offset']);}_0x19340d[_0x651d('0x39')]=qs[_0x651d('0x3a')](_0x4fcda3['query'][_0x651d('0x3a')]);_0x19340d[_0x651d('0x3b')]=qs[_0x651d('0x32')](_['pick'](_0x4fcda3[_0x651d('0x30')],_0x5343bf[_0x651d('0x32')]),_0x526cfa);if(_0x4fcda3['query']['filter']){_0x19340d[_0x651d('0x3b')]=_[_0x651d('0x3c')](_0x19340d[_0x651d('0x3b')],{'$or':_[_0x651d('0x2b')](_0x526cfa,function(_0x436eba){if(_0x436eba[_0x651d('0x3d')]!==_0x651d('0x3e')){var _0x48090a={};_0x48090a[_0x436eba[_0x651d('0x29')]]={'$like':'%'+_0x4fcda3['query'][_0x651d('0x3f')]+'%'};return _0x48090a;}})});}_0x19340d=_[_0x651d('0x3c')]({},_0x19340d,_0x4fcda3[_0x651d('0x40')]);var _0x64d2d2={'where':_0x19340d[_0x651d('0x3b')]};return db[_0x651d('0x2c')]['count'](_0x64d2d2)[_0x651d('0x26')](function(_0x2b2aa0){_0x168725['count']=_0x2b2aa0;if(_0x4fcda3[_0x651d('0x30')]['includeAll']){_0x19340d[_0x651d('0x41')]=[{'all':!![]}];}return db[_0x651d('0x2c')]['findAll'](_0x19340d);})[_0x651d('0x26')](function(_0x4a87e5){_0x168725[_0x651d('0x42')]=_0x4a87e5;return _0x168725;})['then'](respondWithFilteredResult(_0x532994,_0x19340d))[_0x651d('0x43')](handleError(_0x532994,null));};exports[_0x651d('0x44')]=function(_0x4edf9d,_0x3b5101){var _0x3ae6de={'raw':!![],'where':{'id':_0x4edf9d['params']['id']}},_0x134436={};_0x134436[_0x651d('0x34')]=_[_0x651d('0x31')](db[_0x651d('0x2c')][_0x651d('0x2d')]);_0x134436[_0x651d('0x30')]=_['keys'](_0x4edf9d['query']);_0x134436[_0x651d('0x32')]=_[_0x651d('0x33')](_0x134436['model'],_0x134436[_0x651d('0x30')]);_0x3ae6de[_0x651d('0x35')]=_[_0x651d('0x33')](_0x134436['model'],qs[_0x651d('0x36')](_0x4edf9d[_0x651d('0x30')]['fields']));_0x3ae6de[_0x651d('0x35')]=_0x3ae6de['attributes'][_0x651d('0x37')]?_0x3ae6de['attributes']:_0x134436['model'];if(_0x4edf9d[_0x651d('0x30')]['includeAll']){_0x3ae6de['include']=[{'all':!![]}];}_0x3ae6de=_[_0x651d('0x3c')]({},_0x3ae6de,_0x4edf9d[_0x651d('0x40')]);return db['CmCustomField']['find'](_0x3ae6de)[_0x651d('0x26')](handleEntityNotFound(_0x3b5101,null))[_0x651d('0x26')](respondWithResult(_0x3b5101,null))[_0x651d('0x43')](handleError(_0x3b5101,null));};exports[_0x651d('0x25')]=function(_0x2594e3,_0x5f01bd){if(_0x2594e3[_0x651d('0x45')]['id']){delete _0x2594e3[_0x651d('0x45')]['id'];}return db[_0x651d('0x2c')][_0x651d('0x46')]({'where':{'id':_0x2594e3['params']['id']}})[_0x651d('0x26')](handleEntityNotFound(_0x5f01bd,null))[_0x651d('0x26')](saveUpdates(_0x2594e3[_0x651d('0x45')],null))[_0x651d('0x26')](respondWithResult(_0x5f01bd,null))[_0x651d('0x43')](handleError(_0x5f01bd,null));};exports['destroy']=function(_0x2b63f2,_0x221d83){return db['CmCustomField']['find']({'where':{'id':_0x2b63f2[_0x651d('0x47')]['id']}})[_0x651d('0x26')](handleEntityNotFound(_0x221d83,null))['then'](removeEntity(_0x221d83,null))[_0x651d('0x43')](handleError(_0x221d83,null));};exports[_0x651d('0x48')]=function(_0x2ee9d3,_0x570445){var _0x450389;return db['sequelize']['transaction'](function(_0x5dd2f6){return db[_0x651d('0x2c')][_0x651d('0x48')](_0x2ee9d3[_0x651d('0x45')],{'transaction':_0x5dd2f6})[_0x651d('0x26')](function(_0x4c4b1f){_0x450389=_0x4c4b1f;var _0x683d65={'type':db[_0x651d('0x49')][_0x651d('0x4a')],'transaction':_0x5dd2f6};switch(_0x2ee9d3[_0x651d('0x45')][_0x651d('0x3d')]){case _0x651d('0x4b'):_0x683d65['type']=db[_0x651d('0x49')][_0x651d('0x4a')];break;case _0x651d('0x4c'):_0x683d65['type']=db['Sequelize']['INTEGER'];break;case _0x651d('0x4d'):_0x683d65['type']=db['Sequelize'][_0x651d('0x4e')];_0x683d65[_0x651d('0x4f')]=![];break;default:}return db[_0x651d('0x50')]['queryInterface'][_0x651d('0x51')](_0x651d('0x52'),util[_0x651d('0x53')](_0x651d('0x54'),_0x450389['id']),_0x683d65);})[_0x651d('0x26')](function(){return _0x450389;});})['then'](respondWithResult(_0x570445,0xc9))[_0x651d('0x43')](handleError(_0x570445,null));}; \ No newline at end of file +var _0x1194=['sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','differenceBy','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','merge','options','CmCustomField','includeAll','include','rows','catch','show','params','keys','length','find','body','create'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x1194,0x1d4));var _0x4119=function(_0x24689f,_0x4fff42){_0x24689f=_0x24689f-0x0;var _0x2c1c51=_0x1194[_0x24689f];return _0x2c1c51;};'use strict';var emlformat=require(_0x4119('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4119('0x1'));var jsonpatch=require(_0x4119('0x2'));var rp=require(_0x4119('0x3'));var moment=require(_0x4119('0x4'));var BPromise=require(_0x4119('0x5'));var Mustache=require(_0x4119('0x6'));var util=require('util');var path=require(_0x4119('0x7'));var sox=require(_0x4119('0x8'));var csv=require('to-csv');var ejs=require(_0x4119('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4119('0xa'));var squel=require(_0x4119('0xb'));var crypto=require(_0x4119('0xc'));var jsforce=require(_0x4119('0xd'));var deskjs=require(_0x4119('0xe'));var toCsv=require(_0x4119('0xf'));var querystring=require(_0x4119('0x10'));var Papa=require(_0x4119('0x11'));var Redis=require(_0x4119('0x12'));var authService=require(_0x4119('0x13'));var qs=require(_0x4119('0x14'));var as=require(_0x4119('0x15'));var hardwareService=require(_0x4119('0x16'));var logger=require(_0x4119('0x17'))(_0x4119('0x18'));var utils=require(_0x4119('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4119('0x1a'))['db'];function respondWithStatusCode(_0x49ab38,_0xfd2475){_0xfd2475=_0xfd2475||0xcc;return function(_0x2c111d){if(_0x2c111d){return _0x49ab38['sendStatus'](_0xfd2475);}return _0x49ab38[_0x4119('0x1b')](_0xfd2475)[_0x4119('0x1c')]();};}function respondWithResult(_0x1f68db,_0x51518d){_0x51518d=_0x51518d||0xc8;return function(_0x178d80){if(_0x178d80){return _0x1f68db['status'](_0x51518d)[_0x4119('0x1d')](_0x178d80);}};}function respondWithFilteredResult(_0x26afe6,_0x1f83e9){return function(_0x301a97){if(_0x301a97){var _0x26c83f=typeof _0x1f83e9[_0x4119('0x1e')]===_0x4119('0x1f')&&typeof _0x1f83e9['limit']===_0x4119('0x1f');var _0x592635=_0x301a97[_0x4119('0x20')];var _0x3eea10=_0x26c83f?0x0:_0x1f83e9[_0x4119('0x1e')];var _0x29ec9e=_0x26c83f?_0x301a97['count']:_0x1f83e9[_0x4119('0x1e')]+_0x1f83e9[_0x4119('0x21')];var _0x5e2863;if(_0x29ec9e>=_0x592635){_0x29ec9e=_0x592635;_0x5e2863=0xc8;}else{_0x5e2863=0xce;}_0x26afe6['status'](_0x5e2863);return _0x26afe6['set'](_0x4119('0x22'),_0x3eea10+'-'+_0x29ec9e+'/'+_0x592635)[_0x4119('0x1d')](_0x301a97);}return null;};}function patchUpdates(_0x3dbdf2){return function(_0x516b26){try{jsonpatch[_0x4119('0x23')](_0x516b26,_0x3dbdf2,!![]);}catch(_0x537345){return BPromise[_0x4119('0x24')](_0x537345);}return _0x516b26[_0x4119('0x25')]();};}function saveUpdates(_0x819368,_0x123ecb){return function(_0x4825d1){if(_0x4825d1){return _0x4825d1[_0x4119('0x26')](_0x819368)['then'](function(_0x155d1d){return _0x155d1d;});}return null;};}function removeEntity(_0x21f3ef,_0x174d38){return function(_0x41e7ab){if(_0x41e7ab){return _0x41e7ab[_0x4119('0x27')]()[_0x4119('0x28')](function(){_0x21f3ef[_0x4119('0x1b')](0xcc)[_0x4119('0x1c')]();});}};}function handleEntityNotFound(_0x5cbaf8,_0x52e1b9){return function(_0xe0cdae){if(!_0xe0cdae){_0x5cbaf8[_0x4119('0x29')](0x194);}return _0xe0cdae;};}function handleError(_0x903bcc,_0x205c2b){_0x205c2b=_0x205c2b||0x1f4;return function(_0x1fdd39){logger[_0x4119('0x2a')](_0x1fdd39[_0x4119('0x2b')]);if(_0x1fdd39['name']){delete _0x1fdd39[_0x4119('0x2c')];}_0x903bcc[_0x4119('0x1b')](_0x205c2b)[_0x4119('0x2d')](_0x1fdd39);};}exports[_0x4119('0x2e')]=function(_0x1393db,_0x3d47da){var _0x407f2c={},_0x4f64c8={},_0x2bd7bc={'count':0x0,'rows':[]};var _0x221bfc=_[_0x4119('0x2f')](db['CmCustomField'][_0x4119('0x30')],function(_0x4f58cf){return{'name':_0x4f58cf[_0x4119('0x31')],'type':_0x4f58cf['type'][_0x4119('0x32')]};});_0x4f64c8[_0x4119('0x33')]=_[_0x4119('0x34')](_[_0x4119('0x2f')](_0x221bfc,_0x4119('0x2c')),[_0x4119('0x2c')]);_0x4f64c8[_0x4119('0x35')]=_['keys'](_0x1393db['query']);_0x4f64c8[_0x4119('0x36')]=_[_0x4119('0x37')](_0x4f64c8[_0x4119('0x33')],_0x4f64c8[_0x4119('0x35')]);_0x407f2c['attributes']=_[_0x4119('0x37')](_0x4f64c8[_0x4119('0x33')],qs[_0x4119('0x38')](_0x1393db[_0x4119('0x35')][_0x4119('0x38')]));_0x407f2c[_0x4119('0x39')]=_0x407f2c[_0x4119('0x39')]['length']?_0x407f2c[_0x4119('0x39')]:_0x4f64c8[_0x4119('0x33')];if(!_0x1393db[_0x4119('0x35')][_0x4119('0x3a')](_0x4119('0x3b'))){_0x407f2c['limit']=qs[_0x4119('0x21')](_0x1393db[_0x4119('0x35')][_0x4119('0x21')]);_0x407f2c[_0x4119('0x1e')]=qs[_0x4119('0x1e')](_0x1393db[_0x4119('0x35')][_0x4119('0x1e')]);}_0x407f2c['order']=qs[_0x4119('0x3c')](_0x1393db[_0x4119('0x35')]['sort']);_0x407f2c[_0x4119('0x3d')]=qs[_0x4119('0x36')](_['pick'](_0x1393db[_0x4119('0x35')],_0x4f64c8[_0x4119('0x36')]),_0x221bfc);if(_0x1393db['query']['filter']){_0x407f2c[_0x4119('0x3d')]=_['merge'](_0x407f2c['where'],{'$or':_[_0x4119('0x2f')](_0x221bfc,function(_0x268681){if(_0x268681[_0x4119('0x3e')]!==_0x4119('0x3f')){var _0x53f449={};_0x53f449[_0x268681[_0x4119('0x2c')]]={'$like':'%'+_0x1393db[_0x4119('0x35')]['filter']+'%'};return _0x53f449;}})});}_0x407f2c=_[_0x4119('0x40')]({},_0x407f2c,_0x1393db[_0x4119('0x41')]);var _0x97f617={'where':_0x407f2c[_0x4119('0x3d')]};return db[_0x4119('0x42')][_0x4119('0x20')](_0x97f617)['then'](function(_0x15d282){_0x2bd7bc[_0x4119('0x20')]=_0x15d282;if(_0x1393db['query'][_0x4119('0x43')]){_0x407f2c[_0x4119('0x44')]=[{'all':!![]}];}return db[_0x4119('0x42')]['findAll'](_0x407f2c);})['then'](function(_0x2037a7){_0x2bd7bc[_0x4119('0x45')]=_0x2037a7;return _0x2bd7bc;})[_0x4119('0x28')](respondWithFilteredResult(_0x3d47da,_0x407f2c))[_0x4119('0x46')](handleError(_0x3d47da,null));};exports[_0x4119('0x47')]=function(_0x304ad4,_0x3c25e6){var _0x443d26={'raw':!![],'where':{'id':_0x304ad4[_0x4119('0x48')]['id']}},_0x1896cd={};_0x1896cd[_0x4119('0x33')]=_[_0x4119('0x49')](db['CmCustomField'][_0x4119('0x30')]);_0x1896cd[_0x4119('0x35')]=_[_0x4119('0x49')](_0x304ad4['query']);_0x1896cd['filters']=_[_0x4119('0x37')](_0x1896cd['model'],_0x1896cd[_0x4119('0x35')]);_0x443d26[_0x4119('0x39')]=_[_0x4119('0x37')](_0x1896cd['model'],qs['fields'](_0x304ad4['query'][_0x4119('0x38')]));_0x443d26[_0x4119('0x39')]=_0x443d26[_0x4119('0x39')][_0x4119('0x4a')]?_0x443d26[_0x4119('0x39')]:_0x1896cd['model'];if(_0x304ad4[_0x4119('0x35')][_0x4119('0x43')]){_0x443d26[_0x4119('0x44')]=[{'all':!![]}];}_0x443d26=_[_0x4119('0x40')]({},_0x443d26,_0x304ad4[_0x4119('0x41')]);return db[_0x4119('0x42')][_0x4119('0x4b')](_0x443d26)[_0x4119('0x28')](handleEntityNotFound(_0x3c25e6,null))[_0x4119('0x28')](respondWithResult(_0x3c25e6,null))['catch'](handleError(_0x3c25e6,null));};exports[_0x4119('0x26')]=function(_0x3e76af,_0x9cf8ed){if(_0x3e76af[_0x4119('0x4c')]['id']){delete _0x3e76af['body']['id'];}return db[_0x4119('0x42')]['find']({'where':{'id':_0x3e76af['params']['id']}})[_0x4119('0x28')](handleEntityNotFound(_0x9cf8ed,null))[_0x4119('0x28')](saveUpdates(_0x3e76af[_0x4119('0x4c')],null))[_0x4119('0x28')](respondWithResult(_0x9cf8ed,null))['catch'](handleError(_0x9cf8ed,null));};exports['destroy']=function(_0x928414,_0x38508a){return db['CmCustomField'][_0x4119('0x4b')]({'where':{'id':_0x928414[_0x4119('0x48')]['id']}})[_0x4119('0x28')](handleEntityNotFound(_0x38508a,null))[_0x4119('0x28')](removeEntity(_0x38508a,null))[_0x4119('0x46')](handleError(_0x38508a,null));};exports[_0x4119('0x4d')]=function(_0x28326c,_0x5aabab){var _0x477baa;return db[_0x4119('0x4e')][_0x4119('0x4f')](function(_0x23e235){return db[_0x4119('0x42')]['create'](_0x28326c['body'],{'transaction':_0x23e235})[_0x4119('0x28')](function(_0xe1244b){_0x477baa=_0xe1244b;var _0xd09487={'type':db[_0x4119('0x50')][_0x4119('0x51')],'transaction':_0x23e235};switch(_0x28326c[_0x4119('0x4c')][_0x4119('0x3e')]){case _0x4119('0x52'):_0xd09487[_0x4119('0x3e')]=db[_0x4119('0x50')][_0x4119('0x51')];break;case _0x4119('0x53'):_0xd09487['type']=db['Sequelize'][_0x4119('0x54')];break;case _0x4119('0x55'):_0xd09487[_0x4119('0x3e')]=db[_0x4119('0x50')][_0x4119('0x56')];_0xd09487[_0x4119('0x57')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x4119('0x58'),util[_0x4119('0x59')](_0x4119('0x5a'),_0x477baa['id']),_0xd09487);})[_0x4119('0x28')](function(){return _0x477baa;});})[_0x4119('0x28')](respondWithResult(_0x5aabab,0xc9))[_0x4119('0x46')](handleError(_0x5aabab,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f358c45..c7a832e 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 _0xe409=['../../config/environment','./cmCustomField.attributes','define','cm_custom_fields','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x1b5d6c,_0x29ccdf){var _0x365f40=function(_0x255117){while(--_0x255117){_0x1b5d6c['push'](_0x1b5d6c['shift']());}};_0x365f40(++_0x29ccdf);}(_0xe409,0x19e));var _0x9e40=function(_0x1d714d,_0x4e4435){_0x1d714d=_0x1d714d-0x0;var _0x4a0b0e=_0xe409[_0x1d714d];return _0x4a0b0e;};'use strict';var _=require(_0x9e40('0x0'));var util=require(_0x9e40('0x1'));var logger=require(_0x9e40('0x2'))('api');var moment=require(_0x9e40('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e40('0x4'));var rimraf=require(_0x9e40('0x5'));var config=require(_0x9e40('0x6'));var attributes=require(_0x9e40('0x7'));module['exports']=function(_0x35c198,_0x290b4a){return _0x35c198[_0x9e40('0x8')]('CmCustomField',attributes,{'tableName':_0x9e40('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92cc=['request-promise','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','bluebird'];(function(_0x54f795,_0x567a78){var _0x880e70=function(_0x405c2f){while(--_0x405c2f){_0x54f795['push'](_0x54f795['shift']());}};_0x880e70(++_0x567a78);}(_0x92cc,0xd8));var _0xc92c=function(_0x5ae502,_0x26b0be){_0x5ae502=_0x5ae502-0x0;var _0x148c82=_0x92cc[_0x5ae502];return _0x148c82;};'use strict';var _=require(_0xc92c('0x0'));var util=require(_0xc92c('0x1'));var logger=require(_0xc92c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc92c('0x3'));var rp=require(_0xc92c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc92c('0x5'));var config=require(_0xc92c('0x6'));var attributes=require(_0xc92c('0x7'));module['exports']=function(_0x2feedd,_0x3a697f){return _0x2feedd['define'](_0xc92c('0x8'),attributes,{'tableName':_0xc92c('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 96d5c0e..19eecf9 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 _0x2a95=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x59ba8a,_0x9468e8){var _0x2a2bae=function(_0x13ad37){while(--_0x13ad37){_0x59ba8a['push'](_0x59ba8a['shift']());}};_0x2a2bae(++_0x9468e8);}(_0x2a95,0x1c0));var _0x52a9=function(_0x5eac6c,_0x51afe9){_0x5eac6c=_0x5eac6c-0x0;var _0x3090a6=_0x2a95[_0x5eac6c];return _0x3090a6;};'use strict';var _=require(_0x52a9('0x0'));var util=require('util');var moment=require(_0x52a9('0x1'));var BPromise=require(_0x52a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52a9('0x3'));var db=require(_0x52a9('0x4'))['db'];var utils=require(_0x52a9('0x5'));var logger=require(_0x52a9('0x6'))('rpc');var config=require(_0x52a9('0x7'));var jayson=require(_0x52a9('0x8'));var client=jayson[_0x52a9('0x9')][_0x52a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eb3f2,_0xf1ecde,_0x237c12){return new BPromise(function(_0x450bc7,_0x1b3ff7){return client[_0x52a9('0xb')](_0x5eb3f2,_0x237c12)[_0x52a9('0xc')](function(_0x5bc559){logger[_0x52a9('0xd')](_0x52a9('0xe'),_0xf1ecde,_0x52a9('0xf'));logger[_0x52a9('0x10')](_0x52a9('0x11'),_0xf1ecde,'request\x20sent',JSON[_0x52a9('0x12')](_0x5bc559));if(_0x5bc559[_0x52a9('0x13')]){if(_0x5bc559[_0x52a9('0x13')]['code']===0x1f4){logger[_0x52a9('0x13')](_0x52a9('0xe'),_0xf1ecde,_0x5bc559[_0x52a9('0x13')][_0x52a9('0x14')]);return _0x1b3ff7(_0x5bc559[_0x52a9('0x13')]['message']);}logger[_0x52a9('0x13')](_0x52a9('0xe'),_0xf1ecde,_0x5bc559[_0x52a9('0x13')][_0x52a9('0x14')]);return _0x450bc7(_0x5bc559[_0x52a9('0x13')][_0x52a9('0x14')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0xf1ecde,'request\x20sent');_0x450bc7(_0x5bc559[_0x52a9('0x15')][_0x52a9('0x14')]);}})[_0x52a9('0x16')](function(_0x1540f3){logger['error'](_0x52a9('0xe'),_0xf1ecde,_0x1540f3);_0x1b3ff7(_0x1540f3);});});} \ No newline at end of file +var _0x04c9=['then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x04c9,0x19b));var _0x904c=function(_0x432ee6,_0x5aea6e){_0x432ee6=_0x432ee6-0x0;var _0x52a843=_0x04c9[_0x432ee6];return _0x52a843;};'use strict';var _=require('lodash');var util=require(_0x904c('0x0'));var moment=require(_0x904c('0x1'));var BPromise=require(_0x904c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x904c('0x3'))['db'];var utils=require(_0x904c('0x4'));var logger=require('../../config/logger')(_0x904c('0x5'));var config=require(_0x904c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x904c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x12327e,_0x37416e,_0x12ea19){return new BPromise(function(_0x5599b7,_0x344673){return client[_0x904c('0x8')](_0x12327e,_0x12ea19)[_0x904c('0x9')](function(_0x3b41ca){logger[_0x904c('0xa')]('CmCustomField,\x20%s,\x20%s',_0x37416e,_0x904c('0xb'));logger[_0x904c('0xc')](_0x904c('0xd'),_0x37416e,'request\x20sent',JSON[_0x904c('0xe')](_0x3b41ca));if(_0x3b41ca[_0x904c('0xf')]){if(_0x3b41ca[_0x904c('0xf')][_0x904c('0x10')]===0x1f4){logger['error'](_0x904c('0x11'),_0x37416e,_0x3b41ca[_0x904c('0xf')]['message']);return _0x344673(_0x3b41ca['error']['message']);}logger[_0x904c('0xf')]('CmCustomField,\x20%s,\x20%s',_0x37416e,_0x3b41ca[_0x904c('0xf')]['message']);return _0x5599b7(_0x3b41ca[_0x904c('0xf')][_0x904c('0x12')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x37416e,_0x904c('0xb'));_0x5599b7(_0x3b41ca[_0x904c('0x13')][_0x904c('0x12')]);}})[_0x904c('0x14')](function(_0x215226){logger[_0x904c('0xf')](_0x904c('0x11'),_0x37416e,_0x215226);_0x344673(_0x215226);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 87b513f..bae5081 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 _0xd8b1=['show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated'];(function(_0x12d2ef,_0x5897f5){var _0x35e407=function(_0x5a1496){while(--_0x5a1496){_0x12d2ef['push'](_0x12d2ef['shift']());}};_0x35e407(++_0x5897f5);}(_0xd8b1,0x105));var _0x1d8b=function(_0x3b774f,_0x2427ea){_0x3b774f=_0x3b774f-0x0;var _0x5d0d42=_0xd8b1[_0x3b774f];return _0x5d0d42;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1d8b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['delete'](_0x1d8b('0x9'),auth['isAuthenticated'](),controller[_0x1d8b('0xf')]);module[_0x1d8b('0x10')]=router; \ No newline at end of file +var _0x92bc=['/:id','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated'];(function(_0x447ef1,_0x374cd2){var _0x3d72ec=function(_0x3e10b){while(--_0x3e10b){_0x447ef1['push'](_0x447ef1['shift']());}};_0x3d72ec(++_0x374cd2);}(_0x92bc,0x106));var _0xc92b=function(_0x14e68d,_0x5d3968){_0x14e68d=_0x14e68d-0x0;var _0x32a06f=_0x92bc[_0x14e68d];return _0x32a06f;};'use strict';var multer=require(_0xc92b('0x0'));var util=require(_0xc92b('0x1'));var path=require(_0xc92b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc92b('0x3')]();var fs_extra=require(_0xc92b('0x4'));var auth=require(_0xc92b('0x5'));var interaction=require(_0xc92b('0x6'));var config=require('../../config/environment');var controller=require(_0xc92b('0x7'));router[_0xc92b('0x8')]('/',auth[_0xc92b('0x9')](),controller['index']);router['get'](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller['show']);router[_0xc92b('0xb')]('/',auth[_0xc92b('0x9')](),controller[_0xc92b('0xc')]);router['put'](_0xc92b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc92b('0xd')]('/:id',auth[_0xc92b('0x9')](),controller[_0xc92b('0xe')]);module[_0xc92b('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 4c88d35..f7081f1 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 _0x1966=['sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue'];(function(_0x4e0e0c,_0x142eae){var _0x196348=function(_0x1a23f2){while(--_0x1a23f2){_0x4e0e0c['push'](_0x4e0e0c['shift']());}};_0x196348(++_0x142eae);}(_0x1966,0x1dd));var _0x6196=function(_0x1e826e,_0x49e0ca){_0x1e826e=_0x1e826e-0x0;var _0x10c35b=_0x1966[_0x1e826e];return _0x10c35b;};'use strict';var moment=require('moment');var Sequelize=require(_0x6196('0x0'));module[_0x6196('0x1')]={'phone':{'type':Sequelize[_0x6196('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x6196('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6196('0x4')],'defaultValue':moment()[_0x6196('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6196('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6196('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6196('0x4')]},'priority':{'type':Sequelize[_0x6196('0x6')](0x2)[_0x6196('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6196('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6196('0x6')],'unique':_0x6196('0x8')},'ListId':{'type':Sequelize[_0x6196('0x6')],'unique':_0x6196('0x8')},'UserId':{'type':Sequelize[_0x6196('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x6196('0x6')],'unique':_0x6196('0x8')},'CampaignId':{'type':Sequelize[_0x6196('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6196('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x404c=['BOOLEAN','DATE','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','format','INTEGER'];(function(_0x17d711,_0x5b4fb7){var _0x371e29=function(_0x519f59){while(--_0x519f59){_0x17d711['push'](_0x17d711['shift']());}};_0x371e29(++_0x5b4fb7);}(_0x404c,0x1c6));var _0xc404=function(_0x51d8aa,_0x2c4a01){_0x51d8aa=_0x51d8aa-0x0;var _0x2af145=_0x404c[_0x51d8aa];return _0x2af145;};'use strict';var moment=require(_0xc404('0x0'));var Sequelize=require(_0xc404('0x1'));module[_0xc404('0x2')]={'phone':{'type':Sequelize[_0xc404('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc404('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xc404('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc404('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc404('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc404('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc404('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc404('0x7')]},'priority':{'type':Sequelize[_0xc404('0x5')](0x2)[_0xc404('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc404('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc404('0x5')],'unique':_0xc404('0x9')},'ListId':{'type':Sequelize[_0xc404('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xc404('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xc404('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xc404('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc404('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc404('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc404('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 10bf1b7..7742320 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 _0xe309=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','stack','name','send','CmHopper','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$notLike','$like','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','omit','dataValues','updatedAt','statedesc','deleted','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','scheduledat','LOCK','CmCompany','Company','CmList','List','Queue','dialActive','outbound','preview','CmHopper,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe309,0x106));var _0x9e30=function(_0x3308ef,_0x1235e5){_0x3308ef=_0x3308ef-0x0;var _0x529f66=_0xe309[_0x3308ef];return _0x529f66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e30('0x0'));var zipdir=require(_0x9e30('0x1'));var jsonpatch=require(_0x9e30('0x2'));var rp=require(_0x9e30('0x3'));var moment=require(_0x9e30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e30('0x5'));var util=require(_0x9e30('0x6'));var path=require(_0x9e30('0x7'));var sox=require(_0x9e30('0x8'));var csv=require(_0x9e30('0x9'));var ejs=require(_0x9e30('0xa'));var fs=require('fs');var fs_extra=require(_0x9e30('0xb'));var _=require('lodash');var squel=require(_0x9e30('0xc'));var crypto=require(_0x9e30('0xd'));var jsforce=require(_0x9e30('0xe'));var deskjs=require(_0x9e30('0xf'));var toCsv=require(_0x9e30('0x9'));var querystring=require(_0x9e30('0x10'));var Papa=require('papaparse');var Redis=require(_0x9e30('0x11'));var authService=require(_0x9e30('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e30('0x13'))(_0x9e30('0x14'));var utils=require(_0x9e30('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e30('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe36985,_0xdb35d7){_0xdb35d7=_0xdb35d7||0xcc;return function(_0x3d4c13){if(_0x3d4c13){return _0xe36985[_0x9e30('0x17')](_0xdb35d7);}return _0xe36985[_0x9e30('0x18')](_0xdb35d7)[_0x9e30('0x19')]();};}function respondWithResult(_0x1dcf9f,_0x3cf5dc){_0x3cf5dc=_0x3cf5dc||0xc8;return function(_0x1f2f52){if(_0x1f2f52){return _0x1dcf9f[_0x9e30('0x18')](_0x3cf5dc)[_0x9e30('0x1a')](_0x1f2f52);}};}function respondWithFilteredResult(_0x141f6a,_0x1d77e2){return function(_0x3ba37e){if(_0x3ba37e){var _0x2175ea=typeof _0x1d77e2['offset']===_0x9e30('0x1b')&&typeof _0x1d77e2['limit']===_0x9e30('0x1b');var _0x461548=_0x3ba37e[_0x9e30('0x1c')];var _0xfdc813=_0x2175ea?0x0:_0x1d77e2[_0x9e30('0x1d')];var _0x2dc65e=_0x2175ea?_0x3ba37e['count']:_0x1d77e2[_0x9e30('0x1d')]+_0x1d77e2[_0x9e30('0x1e')];var _0x277784;if(_0x2dc65e>=_0x461548){_0x2dc65e=_0x461548;_0x277784=0xc8;}else{_0x277784=0xce;}_0x141f6a[_0x9e30('0x18')](_0x277784);return _0x141f6a[_0x9e30('0x1f')](_0x9e30('0x20'),_0xfdc813+'-'+_0x2dc65e+'/'+_0x461548)[_0x9e30('0x1a')](_0x3ba37e);}return null;};}function patchUpdates(_0x2d53d7){return function(_0x1af545){try{jsonpatch[_0x9e30('0x21')](_0x1af545,_0x2d53d7,!![]);}catch(_0x3f1dba){return BPromise['reject'](_0x3f1dba);}return _0x1af545[_0x9e30('0x22')]();};}function saveUpdates(_0x218d92,_0x490823){return function(_0x5f000b){if(_0x5f000b){return _0x5f000b[_0x9e30('0x23')](_0x218d92)[_0x9e30('0x24')](function(_0x5303a8){return _0x5303a8;});}return null;};}function removeEntity(_0x5a000b,_0x38996f){return function(_0x58b32b){if(_0x58b32b){return _0x58b32b['destroy']()[_0x9e30('0x24')](function(){_0x5a000b[_0x9e30('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8a3f,_0x456935){return function(_0x2cbb5c){if(!_0x2cbb5c){_0x3a8a3f[_0x9e30('0x17')](0x194);}return _0x2cbb5c;};}function handleError(_0x20c1ca,_0x8c6522){_0x8c6522=_0x8c6522||0x1f4;return function(_0x66b329){logger['error'](_0x66b329[_0x9e30('0x25')]);if(_0x66b329[_0x9e30('0x26')]){delete _0x66b329['name'];}_0x20c1ca['status'](_0x8c6522)[_0x9e30('0x27')](_0x66b329);};}exports['index']=function(_0x527523,_0x55182b){var _0x19ae17={},_0x4d5aa1={},_0x4d51bb={'count':0x0,'rows':[]};var _0x40c3d5=_['map'](db[_0x9e30('0x28')][_0x9e30('0x29')],function(_0x20c534){return{'name':_0x20c534[_0x9e30('0x2a')],'type':_0x20c534[_0x9e30('0x2b')][_0x9e30('0x2c')]};});_0x4d5aa1['model']=_['map'](_0x40c3d5,_0x9e30('0x26'));_0x4d5aa1['query']=_[_0x9e30('0x2d')](_0x527523[_0x9e30('0x2e')]);_0x4d5aa1[_0x9e30('0x2f')]=_[_0x9e30('0x30')](_0x4d5aa1[_0x9e30('0x31')],_0x4d5aa1[_0x9e30('0x2e')]);_0x4d5aa1['filters']=_['concat'](_0x4d5aa1['filters'],[_0x9e30('0x32'),_0x9e30('0x33'),_0x9e30('0x34'),_0x9e30('0x35'),'$lt',_0x9e30('0x36'),_0x9e30('0x37'),_0x9e30('0x38'),'$not',_0x9e30('0x39'),_0x9e30('0x3a'),_0x9e30('0x3b'),'$notIn','$like',_0x9e30('0x3c'),'$iLike','$notILike',_0x9e30('0x3d'),'$overlap',_0x9e30('0x3e'),_0x9e30('0x3f'),'$any']);_0x19ae17[_0x9e30('0x40')]=_[_0x9e30('0x30')](_0x4d5aa1['model'],qs[_0x9e30('0x41')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x41')]));_0x19ae17[_0x9e30('0x40')]=_0x19ae17[_0x9e30('0x40')][_0x9e30('0x42')]?_0x19ae17[_0x9e30('0x40')]:_0x4d5aa1[_0x9e30('0x31')];if(!_0x527523[_0x9e30('0x2e')][_0x9e30('0x43')]('nolimit')){_0x19ae17[_0x9e30('0x1e')]=qs[_0x9e30('0x1e')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x1e')]);_0x19ae17['offset']=qs[_0x9e30('0x1d')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x1d')]);}_0x19ae17[_0x9e30('0x44')]=qs[_0x9e30('0x45')](_0x527523[_0x9e30('0x2e')][_0x9e30('0x45')]);_0x19ae17['where']=qs[_0x9e30('0x2f')](_['pick'](_0x527523[_0x9e30('0x2e')],_0x4d5aa1[_0x9e30('0x2f')]),_0x40c3d5);if(_0x527523['query'][_0x9e30('0x46')]){_0x19ae17[_0x9e30('0x47')]=_[_0x9e30('0x48')](_0x19ae17['where'],{'$or':_[_0x9e30('0x49')](_0x40c3d5,function(_0x5d8d98){if(_0x5d8d98['type']!==_0x9e30('0x4a')){var _0x4470db={};_0x4470db[_0x5d8d98[_0x9e30('0x26')]]={'$like':'%'+_0x527523['query'][_0x9e30('0x46')]+'%'};return _0x4470db;}})});}_0x19ae17=_[_0x9e30('0x48')]({},_0x19ae17,_0x527523[_0x9e30('0x4b')]);var _0x5649b6={'where':_0x19ae17[_0x9e30('0x47')]};return db[_0x9e30('0x28')][_0x9e30('0x1c')](_0x5649b6)['then'](function(_0x59b59d){_0x4d51bb[_0x9e30('0x1c')]=_0x59b59d;if(_0x527523[_0x9e30('0x2e')][_0x9e30('0x4c')]){_0x19ae17['include']=[{'all':!![]}];}return db[_0x9e30('0x28')][_0x9e30('0x4d')](_0x19ae17);})[_0x9e30('0x24')](function(_0x3e6563){_0x4d51bb['rows']=_0x3e6563;return _0x4d51bb;})[_0x9e30('0x24')](respondWithFilteredResult(_0x55182b,_0x19ae17))[_0x9e30('0x4e')](handleError(_0x55182b,null));};exports[_0x9e30('0x4f')]=function(_0x2cd0a5,_0x359f82){var _0x560c0d={'raw':!![],'where':{'id':_0x2cd0a5[_0x9e30('0x50')]['id']}},_0x543c2d={};_0x543c2d[_0x9e30('0x31')]=_[_0x9e30('0x2d')](db[_0x9e30('0x28')]['rawAttributes']);_0x543c2d[_0x9e30('0x2e')]=_[_0x9e30('0x2d')](_0x2cd0a5[_0x9e30('0x2e')]);_0x543c2d['filters']=_[_0x9e30('0x30')](_0x543c2d[_0x9e30('0x31')],_0x543c2d[_0x9e30('0x2e')]);_0x560c0d['attributes']=_[_0x9e30('0x30')](_0x543c2d[_0x9e30('0x31')],qs['fields'](_0x2cd0a5['query'][_0x9e30('0x41')]));_0x560c0d[_0x9e30('0x40')]=_0x560c0d[_0x9e30('0x40')]['length']?_0x560c0d['attributes']:_0x543c2d['model'];if(_0x2cd0a5[_0x9e30('0x2e')][_0x9e30('0x4c')]){_0x560c0d[_0x9e30('0x51')]=[{'all':!![]}];}_0x560c0d=_[_0x9e30('0x48')]({},_0x560c0d,_0x2cd0a5[_0x9e30('0x4b')]);return db[_0x9e30('0x28')][_0x9e30('0x52')](_0x560c0d)[_0x9e30('0x24')](handleEntityNotFound(_0x359f82,null))[_0x9e30('0x24')](respondWithResult(_0x359f82,null))[_0x9e30('0x4e')](handleError(_0x359f82,null));};exports[_0x9e30('0x53')]=function(_0x5a1260,_0x5ce6ff){return db[_0x9e30('0x28')][_0x9e30('0x53')](_0x5a1260['body'],{})[_0x9e30('0x24')](respondWithResult(_0x5ce6ff,0xc9))['catch'](handleError(_0x5ce6ff,null));};exports[_0x9e30('0x23')]=function(_0x4d0601,_0x505cd3){if(_0x4d0601[_0x9e30('0x54')]['id']){delete _0x4d0601[_0x9e30('0x54')]['id'];}return db[_0x9e30('0x28')]['find']({'where':{'id':_0x4d0601[_0x9e30('0x50')]['id']}})[_0x9e30('0x24')](handleEntityNotFound(_0x505cd3,null))[_0x9e30('0x24')](saveUpdates(_0x4d0601[_0x9e30('0x54')],null))[_0x9e30('0x24')](respondWithResult(_0x505cd3,null))['catch'](handleError(_0x505cd3,null));};exports[_0x9e30('0x55')]=function(_0x4881f6,_0x15eb07){return db['CmHopper'][_0x9e30('0x55')]()[_0x9e30('0x24')](respondWithResult(_0x15eb07,null))[_0x9e30('0x4e')](handleError(_0x15eb07,null));};exports[_0x9e30('0x56')]=function(_0x3af1d0,_0x4bfbed){var _0x9db4c0;return db['CmHopper'][_0x9e30('0x52')]({'where':{'id':_0x3af1d0[_0x9e30('0x50')]['id']}})['then'](handleEntityNotFound(_0x4bfbed,null))[_0x9e30('0x24')](function(_0x57a233){if(_0x57a233){return _0x57a233[_0x9e30('0x56')]()[_0x9e30('0x24')](function(_0x338482){return _0x338482;});}})['then'](function(_0x322e89){_0x9db4c0=_0x322e89;if(_0x322e89){if(_0x322e89[_0x9e30('0x57')]||_0x322e89[_0x9e30('0x58')]){return db[_0x322e89[_0x9e30('0x57')]?'VoiceQueue':'Campaign'][_0x9e30('0x52')]({'where':{'id':_0x322e89[_0x9e30('0x57')]?_0x322e89[_0x9e30('0x57')]:_0x322e89[_0x9e30('0x58')]},'attributes':['id',_0x9e30('0x26')],'raw':!![]});}}})[_0x9e30('0x24')](function(_0x4f3dda){var _0x17cd49={};if(_0x4f3dda){_[_0x9e30('0x48')](_0x17cd49,_[_0x9e30('0x59')](_0x9db4c0[_0x9e30('0x5a')],['createdAt',_0x9e30('0x5b'),'id']));_0x17cd49['state']=0x15;_0x17cd49[_0x9e30('0x5c')]=_0x9e30('0x5d');_0x17cd49['campaign']=_0x4f3dda[_0x9e30('0x26')];_0x17cd49[_0x9e30('0x5e')]=_0x3af1d0['user'][_0x9e30('0x26')];_0x17cd49[_0x9e30('0x5f')]=_0x3af1d0[_0x9e30('0x60')]['id'];_0x17cd49[_0x9e30('0x5d')]=!![];_0x17cd49['deletedat']=moment()[_0x9e30('0x61')](_0x9e30('0x62'));_0x17cd49[_0x9e30('0x63')]=_0x9db4c0[_0x9e30('0x64')];_0x17cd49[_0x9e30('0x65')]=_0x9db4c0[_0x9e30('0x57')]?'queue':_0x9e30('0x66');return db[_0x9e30('0x67')]['find']({'where':{'id':_0x17cd49[_0x9e30('0x68')]},'attributes':[_0x9e30('0x69'),'lastName']})['then'](function(_0x1a2888){if(!_['isNil'](_0x4bfbed)&&!_[_0x9e30('0x6a')](_0x1a2888['firstName'])){_0x17cd49['calleridname']=_0x1a2888[_0x9e30('0x69')];if(!_['isNil'](_0x1a2888['lastName'])){_0x17cd49[_0x9e30('0x6b')]+='\x20'+_0x1a2888['lastName'];}}})[_0x9e30('0x6c')](function(){return db[_0x9e30('0x6d')]['create'](_0x17cd49);});}})['then'](function(){return _0x4bfbed[_0x9e30('0x18')](0xcc)[_0x9e30('0x19')]();})['catch'](handleError(_0x4bfbed,null));};exports[_0x9e30('0x6e')]=function(_0x52cf4f,_0x4982f2,_0x2f26da){var _0x345bd6=[];return db['CmContact'][_0x9e30('0x55')]()[_0x9e30('0x24')](function(_0x591d22){_0x345bd6=_[_0x9e30('0x2d')](_0x591d22);return _0x52cf4f[_0x9e30('0x60')][_0x9e30('0x6f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x9e30('0x70')],'raw':!![]});})['then'](function(_0x4e4980){if(_0x4e4980&&_0x4e4980[_0x9e30('0x42')]){return db[_0x9e30('0x71')]['transaction'](function(_0x2b9f39){var _0x19f606={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9e30('0x61')](_0x9e30('0x62'))},'VoiceQueueId':{'$in':_[_0x9e30('0x49')](_0x4e4980,'id')},'$or':[{'UserId':null},{'UserId':_0x52cf4f[_0x9e30('0x60')]['id']}]};var _0x5b7d3c=[];if(_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x72')]&&_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x72')]===_0x9e30('0x73')){if(!_[_0x9e30('0x74')](_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x75')])){_0x19f606['id']={'$in':_0x52cf4f[_0x9e30('0x54')]['hopperIds']};}_0x5b7d3c=[[_0x9e30('0x76'),_0x9e30('0x77')],[_0x9e30('0x78'),_0x4e4980[0x0][_0x9e30('0x70')]===_0x9e30('0x77')?_0x9e30('0x79'):_0x9e30('0x77')],db['sequelize'][_0x9e30('0x7a')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x9e30('0x79')]];}else{if(!_[_0x9e30('0x74')](_0x52cf4f[_0x9e30('0x54')]['hopperIds'])){_0x19f606['id']={'$notIn':_0x52cf4f[_0x9e30('0x54')][_0x9e30('0x75')]};}_0x5b7d3c=[[_0x9e30('0x76'),'DESC'],['scheduledAt',_0x4e4980[0x0][_0x9e30('0x70')]],db[_0x9e30('0x71')][_0x9e30('0x7a')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x9e30('0x77')]];}return db[_0x9e30('0x28')]['findOne']({'attributes':['id',_0x9e30('0x7b')],'where':_0x19f606,'order':_0x5b7d3c,'transaction':_0x2b9f39,'lock':_0x2b9f39[_0x9e30('0x7c')]['UPDATE'],'include':[{'model':db[_0x9e30('0x67')],'as':'Contact','attributes':_0x345bd6,'include':[{'model':db[_0x9e30('0x7d')],'as':_0x9e30('0x7e'),'attributes':['id',_0x9e30('0x26')]}]},{'model':db[_0x9e30('0x7f')],'as':_0x9e30('0x80'),'attributes':['id',_0x9e30('0x26')]},{'model':db['VoiceQueue'],'as':_0x9e30('0x81'),'attributes':['id',_0x9e30('0x26'),_0x9e30('0x82')]}]})['then'](function(_0x44a59b){if(_0x44a59b){return _0x44a59b[_0x9e30('0x23')]({'UserId':_0x52cf4f[_0x9e30('0x60')]['id']},{'transaction':_0x2b9f39});}});});}})['then'](handleEntityNotFound(_0x4982f2,null))[_0x9e30('0x24')](respondWithResult(_0x4982f2,null))['catch'](handleError(_0x4982f2,null));};exports['getOpenContacts']=function(_0x29ee2c,_0xd872fb,_0x30df06){return _0x29ee2c['user']['getVoiceQueues']({'where':{'type':_0x9e30('0x83'),'dialActive':!![],'dialMethod':_0x9e30('0x84')},'attributes':['id'],'raw':!![]})[_0x9e30('0x24')](function(_0x4fdb13){if(_0x4fdb13&&_0x4fdb13['length']){return db[_0x9e30('0x28')][_0x9e30('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9e30('0x61')](_0x9e30('0x62'))},'VoiceQueueId':{'$in':_[_0x9e30('0x49')](_0x4fdb13,'id')},'$or':[{'UserId':null},{'UserId':_0x29ee2c[_0x9e30('0x60')]['id']}]}});}return 0x0;})['then'](function(_0x45c446){if(!_[_0x9e30('0x6a')](_0x45c446)&&_['isNumber'](_0x45c446)){return _0xd872fb[_0x9e30('0x18')](0xc8)[_0x9e30('0x1a')]({'contacts':_0x45c446});}else{logger['error'](_0x9e30('0x85'),'getOpenContacts',0x194,'entity\x20not\x20found');_0xd872fb[_0x9e30('0x17')](0x194);}})[_0x9e30('0x4e')](handleError(_0xd872fb,null));}; \ No newline at end of file +var _0x7e77=['fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gte','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmHopper','includeAll','include','rows','catch','show','params','find','create','body','update','describe','VoiceQueueId','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','lastName','isNil','firstName','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','dialOrderByScheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','List','VoiceQueue','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','then','destroy','end','error','name','send','index','rawAttributes'];(function(_0x4b7f28,_0x27d23a){var _0xf5b553=function(_0x1cb9c1){while(--_0x1cb9c1){_0x4b7f28['push'](_0x4b7f28['shift']());}};_0xf5b553(++_0x27d23a);}(_0x7e77,0x64));var _0x77e7=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x7e77[_0x5519a9];return _0x32f2cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77e7('0x0'));var zipdir=require(_0x77e7('0x1'));var jsonpatch=require(_0x77e7('0x2'));var rp=require('request-promise');var moment=require(_0x77e7('0x3'));var BPromise=require(_0x77e7('0x4'));var Mustache=require(_0x77e7('0x5'));var util=require('util');var path=require(_0x77e7('0x6'));var sox=require(_0x77e7('0x7'));var csv=require('to-csv');var ejs=require(_0x77e7('0x8'));var fs=require('fs');var fs_extra=require(_0x77e7('0x9'));var _=require(_0x77e7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x77e7('0xb'));var deskjs=require(_0x77e7('0xc'));var toCsv=require(_0x77e7('0xd'));var querystring=require(_0x77e7('0xe'));var Papa=require(_0x77e7('0xf'));var Redis=require('ioredis');var authService=require(_0x77e7('0x10'));var qs=require(_0x77e7('0x11'));var as=require(_0x77e7('0x12'));var hardwareService=require(_0x77e7('0x13'));var logger=require('../../config/logger')(_0x77e7('0x14'));var utils=require(_0x77e7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x77e7('0x16'));var db=require(_0x77e7('0x17'))['db'];function respondWithStatusCode(_0x2ac756,_0x44635e){_0x44635e=_0x44635e||0xcc;return function(_0x13c91d){if(_0x13c91d){return _0x2ac756[_0x77e7('0x18')](_0x44635e);}return _0x2ac756[_0x77e7('0x19')](_0x44635e)['end']();};}function respondWithResult(_0x317c77,_0x2bd3cb){_0x2bd3cb=_0x2bd3cb||0xc8;return function(_0x10f3e2){if(_0x10f3e2){return _0x317c77[_0x77e7('0x19')](_0x2bd3cb)[_0x77e7('0x1a')](_0x10f3e2);}};}function respondWithFilteredResult(_0x5eab68,_0x51a2bf){return function(_0x45a6ce){if(_0x45a6ce){var _0x1b1dc1=typeof _0x51a2bf[_0x77e7('0x1b')]===_0x77e7('0x1c')&&typeof _0x51a2bf[_0x77e7('0x1d')]==='undefined';var _0x127772=_0x45a6ce[_0x77e7('0x1e')];var _0x5ebba0=_0x1b1dc1?0x0:_0x51a2bf[_0x77e7('0x1b')];var _0xd4c7ce=_0x1b1dc1?_0x45a6ce[_0x77e7('0x1e')]:_0x51a2bf[_0x77e7('0x1b')]+_0x51a2bf['limit'];var _0x343ece;if(_0xd4c7ce>=_0x127772){_0xd4c7ce=_0x127772;_0x343ece=0xc8;}else{_0x343ece=0xce;}_0x5eab68[_0x77e7('0x19')](_0x343ece);return _0x5eab68[_0x77e7('0x1f')]('Content-Range',_0x5ebba0+'-'+_0xd4c7ce+'/'+_0x127772)[_0x77e7('0x1a')](_0x45a6ce);}return null;};}function patchUpdates(_0x1d2331){return function(_0x36df68){try{jsonpatch['apply'](_0x36df68,_0x1d2331,!![]);}catch(_0x238655){return BPromise['reject'](_0x238655);}return _0x36df68['save']();};}function saveUpdates(_0xbb2702,_0x3af05d){return function(_0x347209){if(_0x347209){return _0x347209['update'](_0xbb2702)[_0x77e7('0x20')](function(_0x597224){return _0x597224;});}return null;};}function removeEntity(_0xde362,_0x2cbde5){return function(_0x162768){if(_0x162768){return _0x162768[_0x77e7('0x21')]()[_0x77e7('0x20')](function(){_0xde362[_0x77e7('0x19')](0xcc)[_0x77e7('0x22')]();});}};}function handleEntityNotFound(_0x378b8d,_0x4c4bf2){return function(_0x63e828){if(!_0x63e828){_0x378b8d[_0x77e7('0x18')](0x194);}return _0x63e828;};}function handleError(_0x2cd213,_0x341c9d){_0x341c9d=_0x341c9d||0x1f4;return function(_0x550c4e){logger[_0x77e7('0x23')](_0x550c4e['stack']);if(_0x550c4e[_0x77e7('0x24')]){delete _0x550c4e[_0x77e7('0x24')];}_0x2cd213[_0x77e7('0x19')](_0x341c9d)[_0x77e7('0x25')](_0x550c4e);};}exports[_0x77e7('0x26')]=function(_0x2df6f9,_0x383605){var _0x2c7d80={},_0x42f15b={},_0x3438c3={'count':0x0,'rows':[]};var _0x5e94d2=_['map'](db['CmHopper'][_0x77e7('0x27')],function(_0x381dfd){return{'name':_0x381dfd[_0x77e7('0x28')],'type':_0x381dfd[_0x77e7('0x29')][_0x77e7('0x2a')]};});_0x42f15b[_0x77e7('0x2b')]=_[_0x77e7('0x2c')](_0x5e94d2,'name');_0x42f15b[_0x77e7('0x2d')]=_[_0x77e7('0x2e')](_0x2df6f9[_0x77e7('0x2d')]);_0x42f15b[_0x77e7('0x2f')]=_[_0x77e7('0x30')](_0x42f15b['model'],_0x42f15b[_0x77e7('0x2d')]);_0x42f15b['filters']=_[_0x77e7('0x31')](_0x42f15b[_0x77e7('0x2f')],[_0x77e7('0x32'),_0x77e7('0x33'),'$gt',_0x77e7('0x34'),'$lt',_0x77e7('0x35'),'$ne',_0x77e7('0x36'),'$not',_0x77e7('0x37'),_0x77e7('0x38'),_0x77e7('0x39'),_0x77e7('0x3a'),_0x77e7('0x3b'),_0x77e7('0x3c'),_0x77e7('0x3d'),_0x77e7('0x3e'),_0x77e7('0x3b'),_0x77e7('0x3f'),_0x77e7('0x40'),_0x77e7('0x41'),'$any']);_0x2c7d80[_0x77e7('0x42')]=_['intersection'](_0x42f15b['model'],qs[_0x77e7('0x43')](_0x2df6f9['query'][_0x77e7('0x43')]));_0x2c7d80[_0x77e7('0x42')]=_0x2c7d80[_0x77e7('0x42')][_0x77e7('0x44')]?_0x2c7d80['attributes']:_0x42f15b[_0x77e7('0x2b')];if(!_0x2df6f9['query']['hasOwnProperty'](_0x77e7('0x45'))){_0x2c7d80[_0x77e7('0x1d')]=qs[_0x77e7('0x1d')](_0x2df6f9[_0x77e7('0x2d')][_0x77e7('0x1d')]);_0x2c7d80[_0x77e7('0x1b')]=qs[_0x77e7('0x1b')](_0x2df6f9[_0x77e7('0x2d')][_0x77e7('0x1b')]);}_0x2c7d80['order']=qs[_0x77e7('0x46')](_0x2df6f9['query'][_0x77e7('0x46')]);_0x2c7d80[_0x77e7('0x47')]=qs[_0x77e7('0x2f')](_[_0x77e7('0x48')](_0x2df6f9[_0x77e7('0x2d')],_0x42f15b[_0x77e7('0x2f')]),_0x5e94d2);if(_0x2df6f9[_0x77e7('0x2d')][_0x77e7('0x49')]){_0x2c7d80[_0x77e7('0x47')]=_[_0x77e7('0x4a')](_0x2c7d80[_0x77e7('0x47')],{'$or':_['map'](_0x5e94d2,function(_0x1cf532){if(_0x1cf532[_0x77e7('0x29')]!==_0x77e7('0x4b')){var _0x57e673={};_0x57e673[_0x1cf532[_0x77e7('0x24')]]={'$like':'%'+_0x2df6f9[_0x77e7('0x2d')][_0x77e7('0x49')]+'%'};return _0x57e673;}})});}_0x2c7d80=_[_0x77e7('0x4a')]({},_0x2c7d80,_0x2df6f9[_0x77e7('0x4c')]);var _0x13f925={'where':_0x2c7d80[_0x77e7('0x47')]};return db[_0x77e7('0x4d')][_0x77e7('0x1e')](_0x13f925)[_0x77e7('0x20')](function(_0x1cc8fb){_0x3438c3[_0x77e7('0x1e')]=_0x1cc8fb;if(_0x2df6f9['query'][_0x77e7('0x4e')]){_0x2c7d80[_0x77e7('0x4f')]=[{'all':!![]}];}return db[_0x77e7('0x4d')]['findAll'](_0x2c7d80);})[_0x77e7('0x20')](function(_0x25dddb){_0x3438c3[_0x77e7('0x50')]=_0x25dddb;return _0x3438c3;})[_0x77e7('0x20')](respondWithFilteredResult(_0x383605,_0x2c7d80))[_0x77e7('0x51')](handleError(_0x383605,null));};exports[_0x77e7('0x52')]=function(_0x8ab15e,_0x41761c){var _0x5cdee9={'raw':!![],'where':{'id':_0x8ab15e[_0x77e7('0x53')]['id']}},_0x545968={};_0x545968[_0x77e7('0x2b')]=_[_0x77e7('0x2e')](db[_0x77e7('0x4d')][_0x77e7('0x27')]);_0x545968[_0x77e7('0x2d')]=_[_0x77e7('0x2e')](_0x8ab15e[_0x77e7('0x2d')]);_0x545968[_0x77e7('0x2f')]=_[_0x77e7('0x30')](_0x545968[_0x77e7('0x2b')],_0x545968[_0x77e7('0x2d')]);_0x5cdee9[_0x77e7('0x42')]=_[_0x77e7('0x30')](_0x545968[_0x77e7('0x2b')],qs[_0x77e7('0x43')](_0x8ab15e[_0x77e7('0x2d')][_0x77e7('0x43')]));_0x5cdee9[_0x77e7('0x42')]=_0x5cdee9[_0x77e7('0x42')][_0x77e7('0x44')]?_0x5cdee9[_0x77e7('0x42')]:_0x545968[_0x77e7('0x2b')];if(_0x8ab15e[_0x77e7('0x2d')]['includeAll']){_0x5cdee9[_0x77e7('0x4f')]=[{'all':!![]}];}_0x5cdee9=_[_0x77e7('0x4a')]({},_0x5cdee9,_0x8ab15e[_0x77e7('0x4c')]);return db[_0x77e7('0x4d')][_0x77e7('0x54')](_0x5cdee9)[_0x77e7('0x20')](handleEntityNotFound(_0x41761c,null))[_0x77e7('0x20')](respondWithResult(_0x41761c,null))[_0x77e7('0x51')](handleError(_0x41761c,null));};exports[_0x77e7('0x55')]=function(_0x30a32c,_0x1569ca){return db['CmHopper'][_0x77e7('0x55')](_0x30a32c[_0x77e7('0x56')],{})[_0x77e7('0x20')](respondWithResult(_0x1569ca,0xc9))[_0x77e7('0x51')](handleError(_0x1569ca,null));};exports[_0x77e7('0x57')]=function(_0x6507e7,_0x24b5ca){if(_0x6507e7['body']['id']){delete _0x6507e7[_0x77e7('0x56')]['id'];}return db[_0x77e7('0x4d')][_0x77e7('0x54')]({'where':{'id':_0x6507e7[_0x77e7('0x53')]['id']}})[_0x77e7('0x20')](handleEntityNotFound(_0x24b5ca,null))[_0x77e7('0x20')](saveUpdates(_0x6507e7[_0x77e7('0x56')],null))[_0x77e7('0x20')](respondWithResult(_0x24b5ca,null))['catch'](handleError(_0x24b5ca,null));};exports[_0x77e7('0x58')]=function(_0x250d33,_0x3f6fd7){return db['CmHopper']['describe']()['then'](respondWithResult(_0x3f6fd7,null))[_0x77e7('0x51')](handleError(_0x3f6fd7,null));};exports[_0x77e7('0x21')]=function(_0x3ba195,_0x1313e8){var _0x3316c0;return db[_0x77e7('0x4d')][_0x77e7('0x54')]({'where':{'id':_0x3ba195[_0x77e7('0x53')]['id']}})[_0x77e7('0x20')](handleEntityNotFound(_0x1313e8,null))[_0x77e7('0x20')](function(_0x154330){if(_0x154330){return _0x154330[_0x77e7('0x21')]()['then'](function(_0x3f332f){return _0x3f332f;});}})['then'](function(_0x22a46d){_0x3316c0=_0x22a46d;if(_0x22a46d){if(_0x22a46d[_0x77e7('0x59')]||_0x22a46d[_0x77e7('0x5a')]){return db[_0x22a46d['VoiceQueueId']?'VoiceQueue':'Campaign'][_0x77e7('0x54')]({'where':{'id':_0x22a46d[_0x77e7('0x59')]?_0x22a46d['VoiceQueueId']:_0x22a46d[_0x77e7('0x5a')]},'attributes':['id',_0x77e7('0x24')],'raw':!![]});}}})[_0x77e7('0x20')](function(_0x468ea5){var _0x32fd02={};if(_0x468ea5){_[_0x77e7('0x4a')](_0x32fd02,_[_0x77e7('0x5b')](_0x3316c0[_0x77e7('0x5c')],[_0x77e7('0x5d'),_0x77e7('0x5e'),'id']));_0x32fd02[_0x77e7('0x5f')]=0x15;_0x32fd02[_0x77e7('0x60')]=_0x77e7('0x61');_0x32fd02['campaign']=_0x468ea5[_0x77e7('0x24')];_0x32fd02['membername']=_0x3ba195[_0x77e7('0x62')][_0x77e7('0x24')];_0x32fd02[_0x77e7('0x63')]=_0x3ba195[_0x77e7('0x62')]['id'];_0x32fd02[_0x77e7('0x61')]=!![];_0x32fd02['deletedat']=moment()[_0x77e7('0x64')](_0x77e7('0x65'));_0x32fd02[_0x77e7('0x66')]=_0x3316c0[_0x77e7('0x67')];_0x32fd02['campaigntype']=_0x3316c0[_0x77e7('0x59')]?_0x77e7('0x68'):'ivr';return db[_0x77e7('0x69')]['find']({'where':{'id':_0x32fd02['ContactId']},'attributes':['firstName',_0x77e7('0x6a')]})[_0x77e7('0x20')](function(_0x41b7b5){if(!_['isNil'](_0x1313e8)&&!_[_0x77e7('0x6b')](_0x41b7b5[_0x77e7('0x6c')])){_0x32fd02[_0x77e7('0x6d')]=_0x41b7b5[_0x77e7('0x6c')];if(!_[_0x77e7('0x6b')](_0x41b7b5[_0x77e7('0x6a')])){_0x32fd02[_0x77e7('0x6d')]+='\x20'+_0x41b7b5[_0x77e7('0x6a')];}}})['finally'](function(){return db[_0x77e7('0x6e')][_0x77e7('0x55')](_0x32fd02);});}})['then'](function(){return _0x1313e8['status'](0xcc)[_0x77e7('0x22')]();})[_0x77e7('0x51')](handleError(_0x1313e8,null));};exports[_0x77e7('0x6f')]=function(_0x17bd06,_0x2d46a5,_0x1b3ffe){var _0x539db3=[];return db[_0x77e7('0x69')]['describe']()[_0x77e7('0x20')](function(_0x522d38){_0x539db3=_[_0x77e7('0x2e')](_0x522d38);return _0x17bd06[_0x77e7('0x62')][_0x77e7('0x70')]({'where':{'type':_0x77e7('0x71'),'dialActive':!![],'dialMethod':_0x77e7('0x72')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x77e7('0x20')](function(_0x3c0100){if(_0x3c0100&&_0x3c0100[_0x77e7('0x44')]){return db[_0x77e7('0x73')][_0x77e7('0x74')](function(_0x1b059e){var _0x1f9287={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x77e7('0x64')](_0x77e7('0x65'))},'VoiceQueueId':{'$in':_['map'](_0x3c0100,'id')},'$or':[{'UserId':null},{'UserId':_0x17bd06[_0x77e7('0x62')]['id']}]};var _0x524956=[];if(_0x17bd06[_0x77e7('0x56')][_0x77e7('0x75')]&&_0x17bd06[_0x77e7('0x56')][_0x77e7('0x75')]==='prev'){if(!_[_0x77e7('0x76')](_0x17bd06['body'][_0x77e7('0x77')])){_0x1f9287['id']={'$in':_0x17bd06[_0x77e7('0x56')]['hopperIds']};}_0x524956=[[_0x77e7('0x78'),_0x77e7('0x79')],[_0x77e7('0x7a'),_0x3c0100[0x0]['dialOrderByScheduledAt']==='ASC'?'DESC':_0x77e7('0x79')],db[_0x77e7('0x73')][_0x77e7('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x77e7('0x7c')]];}else{if(!_[_0x77e7('0x76')](_0x17bd06[_0x77e7('0x56')][_0x77e7('0x77')])){_0x1f9287['id']={'$notIn':_0x17bd06[_0x77e7('0x56')][_0x77e7('0x77')]};}_0x524956=[[_0x77e7('0x78'),'DESC'],[_0x77e7('0x7a'),_0x3c0100[0x0][_0x77e7('0x7d')]],db[_0x77e7('0x73')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x77e7('0x79')]];}return db[_0x77e7('0x4d')][_0x77e7('0x7e')]({'attributes':['id',_0x77e7('0x7f')],'where':_0x1f9287,'order':_0x524956,'transaction':_0x1b059e,'lock':_0x1b059e[_0x77e7('0x80')][_0x77e7('0x81')],'include':[{'model':db[_0x77e7('0x69')],'as':_0x77e7('0x82'),'attributes':_0x539db3,'include':[{'model':db[_0x77e7('0x83')],'as':_0x77e7('0x84'),'attributes':['id',_0x77e7('0x24')]}]},{'model':db['CmList'],'as':_0x77e7('0x85'),'attributes':['id','name']},{'model':db[_0x77e7('0x86')],'as':'Queue','attributes':['id','name',_0x77e7('0x87')]}]})[_0x77e7('0x20')](function(_0x4759fc){if(_0x4759fc){return _0x4759fc[_0x77e7('0x57')]({'UserId':_0x17bd06[_0x77e7('0x62')]['id']},{'transaction':_0x1b059e});}});});}})[_0x77e7('0x20')](handleEntityNotFound(_0x2d46a5,null))[_0x77e7('0x20')](respondWithResult(_0x2d46a5,null))[_0x77e7('0x51')](handleError(_0x2d46a5,null));};exports['getOpenContacts']=function(_0x47e4ab,_0x36f6bb,_0x44bfa5){return _0x47e4ab[_0x77e7('0x62')][_0x77e7('0x70')]({'where':{'type':_0x77e7('0x71'),'dialActive':!![],'dialMethod':_0x77e7('0x72')},'attributes':['id'],'raw':!![]})[_0x77e7('0x20')](function(_0x220777){if(_0x220777&&_0x220777['length']){return db['CmHopper'][_0x77e7('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x77e7('0x64')](_0x77e7('0x65'))},'VoiceQueueId':{'$in':_[_0x77e7('0x2c')](_0x220777,'id')},'$or':[{'UserId':null},{'UserId':_0x47e4ab[_0x77e7('0x62')]['id']}]}});}return 0x0;})[_0x77e7('0x20')](function(_0x1c1f2b){if(!_[_0x77e7('0x6b')](_0x1c1f2b)&&_[_0x77e7('0x88')](_0x1c1f2b)){return _0x36f6bb['status'](0xc8)[_0x77e7('0x1a')]({'contacts':_0x1c1f2b});}else{logger[_0x77e7('0x23')](_0x77e7('0x89'),_0x77e7('0x8a'),0x194,_0x77e7('0x8b'));_0x36f6bb[_0x77e7('0x18')](0x194);}})[_0x77e7('0x51')](handleError(_0x36f6bb,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 5f8434e..5617747 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 _0xadb5=['CmHopper','cm_hopper','scheduledat','phone','priority','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x14dd38,_0x1d733d){var _0x33e94f=function(_0x508386){while(--_0x508386){_0x14dd38['push'](_0x14dd38['shift']());}};_0x33e94f(++_0x1d733d);}(_0xadb5,0xad));var _0x5adb=function(_0x47efe2,_0x55eb0b){_0x47efe2=_0x47efe2-0x0;var _0x390d80=_0xadb5[_0x47efe2];return _0x390d80;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./cmHopper.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xb')]},{'name':_0x5adb('0xc'),'fields':[_0x5adb('0xc')]},{'name':_0x5adb('0xd'),'fields':[_0x5adb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x35c300,_0x284351){var _0x59e44b=function(_0x327e5c){while(--_0x327e5c){_0x35c300['push'](_0x35c300['shift']());}};_0x59e44b(++_0x284351);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]},{'name':_0x901d('0xf'),'fields':[_0x901d('0xf')]},{'name':_0x901d('0x10'),'fields':[_0x901d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b6ee613..0bf2c34 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 _0x4e80=['length','UserId','push','all','transaction','MoveContactManagedDialer','CountReScheduled','sequelize','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','limit','map','include','model','attributes','ShowCmHopper','where','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','LOCK','UPDATE','Contact','keys','name','voicePause'];(function(_0xca67ed,_0x51c523){var _0x1d43f9=function(_0x2fb29a){while(--_0x2fb29a){_0xca67ed['push'](_0xca67ed['shift']());}};_0x1d43f9(++_0x51c523);}(_0x4e80,0x115));var _0x04e8=function(_0xf231d0,_0x13c159){_0xf231d0=_0xf231d0-0x0;var _0x472a9d=_0x4e80[_0xf231d0];return _0x472a9d;};'use strict';var _=require(_0x04e8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x04e8('0x1'));var rs=require(_0x04e8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04e8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x04e8('0x4'))('rpc');var config=require(_0x04e8('0x5'));var jayson=require(_0x04e8('0x6'));var client=jayson['client'][_0x04e8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x330b21,_0x1bec92,_0x74535f){return new BPromise(function(_0x559c13,_0x2c99f9){return client['request'](_0x330b21,_0x74535f)[_0x04e8('0x8')](function(_0x11ec8b){logger[_0x04e8('0x9')](_0x04e8('0xa'),_0x1bec92,_0x04e8('0xb'));logger[_0x04e8('0xc')](_0x04e8('0xd'),_0x1bec92,_0x04e8('0xb'),JSON[_0x04e8('0xe')](_0x11ec8b));if(_0x11ec8b[_0x04e8('0xf')]){if(_0x11ec8b['error'][_0x04e8('0x10')]===0x1f4){logger[_0x04e8('0xf')](_0x04e8('0xa'),_0x1bec92,_0x11ec8b[_0x04e8('0xf')][_0x04e8('0x11')]);return _0x2c99f9(_0x11ec8b[_0x04e8('0xf')][_0x04e8('0x11')]);}logger[_0x04e8('0xf')](_0x04e8('0xa'),_0x1bec92,_0x11ec8b[_0x04e8('0xf')]['message']);return _0x559c13(_0x11ec8b[_0x04e8('0xf')][_0x04e8('0x11')]);}else{logger[_0x04e8('0x9')](_0x04e8('0xa'),_0x1bec92,'request\x20sent');_0x559c13(_0x11ec8b[_0x04e8('0x12')][_0x04e8('0x11')]);}})[_0x04e8('0x13')](function(_0x435097){logger[_0x04e8('0xf')](_0x04e8('0xa'),_0x1bec92,_0x435097);_0x2c99f9(_0x435097);});});}exports[_0x04e8('0x14')]=function(_0x3997a8){var _0x3e6f74=this;return new Promise(function(_0x179e80,_0x1b1bb6){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'raw':_0x3997a8[_0x04e8('0x17')]?_0x3997a8[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![],'where':_0x3997a8[_0x04e8('0x17')]?_0x3997a8[_0x04e8('0x17')]['where']||null:null,'attributes':_0x3997a8[_0x04e8('0x17')]?_0x3997a8[_0x04e8('0x17')]['attributes']||null:null,'limit':_0x3997a8['options']?_0x3997a8['options'][_0x04e8('0x19')]||null:null,'include':_0x3997a8['options']?_0x3997a8[_0x04e8('0x17')]['include']?_[_0x04e8('0x1a')](_0x3997a8[_0x04e8('0x17')][_0x04e8('0x1b')],function(_0x108b3a){return{'model':db[_0x108b3a[_0x04e8('0x1c')]],'as':_0x108b3a['as'],'attributes':_0x108b3a[_0x04e8('0x1d')],'include':_0x108b3a['include']?_[_0x04e8('0x1a')](_0x108b3a['include'],function(_0x35f6f7){return{'model':db[_0x35f6f7['model']],'as':_0x35f6f7['as'],'attributes':_0x35f6f7['attributes'],'include':_0x35f6f7[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x35f6f7['include'],function(_0x4c5f3d){return{'model':db[_0x4c5f3d[_0x04e8('0x1c')]],'as':_0x4c5f3d['as'],'attributes':_0x4c5f3d['attributes']};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x464ebe){logger['info'](_0x04e8('0x14'),_0x3997a8);logger[_0x04e8('0xc')](_0x04e8('0x14'),_0x3997a8,JSON[_0x04e8('0xe')](_0x464ebe));_0x179e80(_0x464ebe);})[_0x04e8('0x13')](function(_0x1f46c6){logger[_0x04e8('0xf')](_0x04e8('0x14'),_0x1f46c6['message'],_0x3997a8);_0x1b1bb6(_0x3e6f74[_0x04e8('0xf')](0x1f4,_0x1f46c6[_0x04e8('0x11')]));});});};exports[_0x04e8('0x1e')]=function(_0x108088){var _0x40abc8=this;return new Promise(function(_0x5ef4b5,_0x4da885){return db[_0x04e8('0x15')]['find']({'raw':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')][_0x04e8('0x1f')]||null:null,'attributes':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')][_0x04e8('0x1d')]||null:null,'include':_0x108088[_0x04e8('0x17')]?_0x108088[_0x04e8('0x17')][_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x108088[_0x04e8('0x17')][_0x04e8('0x1b')],function(_0x5be7c1){return{'model':db[_0x5be7c1[_0x04e8('0x1c')]],'as':_0x5be7c1['as'],'attributes':_0x5be7c1[_0x04e8('0x1d')],'include':_0x5be7c1[_0x04e8('0x1b')]?_['map'](_0x5be7c1['include'],function(_0x1f96b4){return{'model':db[_0x1f96b4['model']],'as':_0x1f96b4['as'],'attributes':_0x1f96b4[_0x04e8('0x1d')],'include':_0x1f96b4[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x1f96b4[_0x04e8('0x1b')],function(_0x332139){return{'model':db[_0x332139[_0x04e8('0x1c')]],'as':_0x332139['as'],'attributes':_0x332139[_0x04e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x259424){logger[_0x04e8('0x9')](_0x04e8('0x1e'),_0x108088);logger[_0x04e8('0xc')](_0x04e8('0x1e'),_0x108088,JSON['stringify'](_0x259424));_0x5ef4b5(_0x259424);})[_0x04e8('0x13')](function(_0x2babb0){logger['error'](_0x04e8('0x1e'),_0x2babb0[_0x04e8('0x11')],_0x108088);_0x4da885(_0x40abc8[_0x04e8('0xf')](0x1f4,_0x2babb0[_0x04e8('0x11')]));});});};exports['CreateCmHopper']=function(_0x562cc6){var _0x926875=this;return new Promise(function(_0x10323d,_0x2a2450){return db[_0x04e8('0x15')][_0x04e8('0x20')](_0x562cc6[_0x04e8('0x21')],{'raw':_0x562cc6[_0x04e8('0x17')]?_0x562cc6[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x231796){logger['info'](_0x04e8('0x22'),_0x562cc6);logger[_0x04e8('0xc')]('CreateCmHopper',_0x562cc6,JSON[_0x04e8('0xe')](_0x231796));_0x10323d(_0x231796);})[_0x04e8('0x13')](function(_0x50fdf7){logger[_0x04e8('0xf')](_0x04e8('0x22'),_0x50fdf7[_0x04e8('0x11')],_0x562cc6);_0x2a2450(_0x926875[_0x04e8('0xf')](0x1f4,_0x50fdf7[_0x04e8('0x11')]));});});};exports[_0x04e8('0x23')]=function(_0x517011){var _0x30baae=this;return new Promise(function(_0x416279,_0x283294){return db['CmHopper'][_0x04e8('0x24')](_0x517011[_0x04e8('0x21')],{'raw':_0x517011['options']?_0x517011[_0x04e8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517011[_0x04e8('0x17')]?_0x517011['options'][_0x04e8('0x1f')]||null:null,'attributes':_0x517011[_0x04e8('0x17')]?_0x517011['options']['attributes']||null:null,'limit':_0x517011[_0x04e8('0x17')]?_0x517011[_0x04e8('0x17')]['limit']||null:null})[_0x04e8('0x8')](function(_0x4b31c0){logger['info'](_0x04e8('0x23'),_0x517011);logger['debug']('UpdateCmHopper',_0x517011,JSON['stringify'](_0x4b31c0));_0x416279(_0x4b31c0);})['catch'](function(_0x3f87c1){logger[_0x04e8('0xf')](_0x04e8('0x23'),_0x3f87c1[_0x04e8('0x11')],_0x517011);_0x283294(_0x30baae[_0x04e8('0xf')](0x1f4,_0x3f87c1[_0x04e8('0x11')]));});});};exports[_0x04e8('0x25')]=function(_0x10dccd){var _0x165b06=this;return new Promise(function(_0x1c2d58,_0xada182){return db['CmHopper'][_0x04e8('0x26')]({'where':_0x10dccd[_0x04e8('0x17')]?_0x10dccd[_0x04e8('0x17')][_0x04e8('0x1f')]||null:null})[_0x04e8('0x8')](function(_0x4bed14){logger[_0x04e8('0x9')](_0x04e8('0x25'),_0x10dccd);logger[_0x04e8('0xc')](_0x04e8('0x25'),_0x10dccd,JSON[_0x04e8('0xe')](_0x4bed14));_0x1c2d58(_0x4bed14);})[_0x04e8('0x13')](function(_0xae422f){logger[_0x04e8('0xf')](_0x04e8('0x25'),_0xae422f[_0x04e8('0x11')],_0x10dccd);_0xada182(_0x165b06[_0x04e8('0xf')](0x1f4,_0xae422f[_0x04e8('0x11')]));});});};exports[_0x04e8('0x27')]=function(_0x24a758){var _0x5dfa34=this;return new Promise(function(_0x1ff789,_0x2d737c){return db[_0x04e8('0x28')][_0x04e8('0x29')]()[_0x04e8('0x8')](function(_0x1c1141){return db['sequelize']['transaction'](function(_0xa33210){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'where':_0x24a758[_0x04e8('0x17')]?_0x24a758[_0x04e8('0x17')]['where']||null:null,'attributes':_0x24a758['options']?_0x24a758[_0x04e8('0x17')][_0x04e8('0x1d')]||null:null,'limit':_0x24a758[_0x04e8('0x17')]?_0x24a758[_0x04e8('0x17')][_0x04e8('0x19')]||null:null,'order':_0x24a758[_0x04e8('0x17')]?_0x24a758[_0x04e8('0x17')]['order']||null:null,'transaction':_0xa33210,'lock':_0xa33210[_0x04e8('0x2a')][_0x04e8('0x2b')],'include':[{'model':db[_0x04e8('0x28')],'as':_0x04e8('0x2c'),'attributes':_[_0x04e8('0x2d')](_0x1c1141)},{'model':db['User'],'as':'Agent','attributes':['id',_0x04e8('0x2e'),_0x04e8('0x2f')]}]})['then'](function(_0x572ae6){var _0x507e93=[];var _0x584157=[];for(var _0x362677=0x0;_0x362677<_0x572ae6[_0x04e8('0x30')];_0x362677+=0x1){var _0x3cc58e=_0x572ae6[_0x362677][_0x04e8('0x31')];if(_0x3cc58e===null){_0x507e93[_0x04e8('0x32')](_0x572ae6[_0x362677][_0x04e8('0x24')](_0x24a758[_0x04e8('0x21')],{'transaction':_0xa33210}));}else if(!_0x584157['includes'](_0x3cc58e)){_0x584157[_0x04e8('0x32')](_0x3cc58e);_0x507e93[_0x04e8('0x32')](_0x572ae6[_0x362677][_0x04e8('0x24')](_0x24a758[_0x04e8('0x21')],{'transaction':_0xa33210}));}}return BPromise[_0x04e8('0x33')](_0x507e93);});})[_0x04e8('0x8')](function(_0xfaef86){logger[_0x04e8('0x9')](_0x04e8('0x27'),_0x24a758);logger['debug']('GetContactDialer',_0x24a758,JSON[_0x04e8('0xe')](_0xfaef86));_0x1ff789(_0xfaef86);})['catch'](function(_0xefff0e){logger[_0x04e8('0xf')]('GetContactDialer',_0xefff0e['message'],_0x24a758);_0x2d737c(_0x5dfa34[_0x04e8('0xf')](0x1f4,_0xefff0e[_0x04e8('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x425cc8){var _0x47a76d=this;return new Promise(function(_0x9c4347,_0x12d2e4){return db['sequelize'][_0x04e8('0x34')](function(_0x47960c){return db['CmHopperFinal'][_0x04e8('0x20')](_0x425cc8[_0x04e8('0x21')],{'raw':_0x425cc8[_0x04e8('0x17')]?_0x425cc8[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![],'transaction':_0x47960c})['then'](function(){return db[_0x04e8('0x15')][_0x04e8('0x26')]({'where':_0x425cc8[_0x04e8('0x17')]?_0x425cc8['options'][_0x04e8('0x1f')]||null:null,'transaction':_0x47960c});});})[_0x04e8('0x8')](function(_0x76f97a){logger[_0x04e8('0x9')]('MoveContactManagedDialer',_0x425cc8);logger[_0x04e8('0xc')](_0x04e8('0x35'),_0x425cc8,JSON[_0x04e8('0xe')](_0x76f97a));_0x9c4347(_0x76f97a);})[_0x04e8('0x13')](function(_0x30cf22){logger[_0x04e8('0xf')](_0x04e8('0x35'),_0x30cf22['message'],_0x425cc8);_0x12d2e4(_0x47a76d[_0x04e8('0xf')](0x1f4,_0x30cf22[_0x04e8('0x11')]));});});};exports[_0x04e8('0x36')]=function(_0x1488e0){var _0x401dc6=this;return new Promise(function(_0x3ff8f8,_0x22aa92){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'raw':_0x1488e0['options']?_0x1488e0[_0x04e8('0x17')][_0x04e8('0x18')]===undefined?!![]:![]:!![],'where':_0x1488e0[_0x04e8('0x17')]?_0x1488e0[_0x04e8('0x17')][_0x04e8('0x1f')]||null:null,'attributes':[[db[_0x04e8('0x37')]['fn'](_0x04e8('0x38'),db[_0x04e8('0x37')]['fn']('IF',db[_0x04e8('0x37')][_0x04e8('0x39')]('`scheduledat`\x20>=\x20'+util[_0x04e8('0x3a')](_0x04e8('0x3b'),moment()[_0x04e8('0x3a')](_0x04e8('0x3c')))+_0x04e8('0x3d')))),_0x04e8('0x3e')]]})[_0x04e8('0x8')](function(_0x1ec622){logger[_0x04e8('0x9')]('CountReScheduled',_0x1488e0);logger[_0x04e8('0xc')](_0x04e8('0x36'),_0x1488e0,JSON[_0x04e8('0xe')](_0x1ec622));_0x3ff8f8(_0x1ec622);})[_0x04e8('0x13')](function(_0x59d5e8){logger['error'](_0x04e8('0x36'),_0x59d5e8[_0x04e8('0x11')],_0x1488e0);_0x22aa92(_0x401dc6[_0x04e8('0xf')](0x1f4,_0x59d5e8['message']));});});};exports[_0x04e8('0x3f')]=function(_0x387b86){var _0x5dd03d=this;return new Promise(function(_0x382db6,_0x362ed8){return db[_0x04e8('0x28')][_0x04e8('0x29')]()[_0x04e8('0x8')](function(_0x44b030){return db[_0x04e8('0x37')][_0x04e8('0x34')](function(_0x21bdd1){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'where':_0x387b86[_0x04e8('0x17')]?_0x387b86[_0x04e8('0x17')]['where']||null:null,'attributes':_0x387b86['options']?_0x387b86[_0x04e8('0x17')][_0x04e8('0x1d')]||null:null,'limit':0x1,'order':_0x387b86[_0x04e8('0x17')]?_0x387b86[_0x04e8('0x17')][_0x04e8('0x40')]||null:null,'group':db[_0x04e8('0x15')][_0x04e8('0x31')],'transaction':_0x21bdd1,'lock':_0x21bdd1[_0x04e8('0x2a')][_0x04e8('0x2b')],'include':_0x387b86[_0x04e8('0x17')]?_0x387b86[_0x04e8('0x17')][_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x387b86['options']['include'],function(_0x4b1047){return{'model':db[_0x4b1047['model']],'as':_0x4b1047['as'],'attributes':_0x4b1047[_0x04e8('0x1d')],'include':_0x4b1047[_0x04e8('0x1b')]?_['map'](_0x4b1047['include'],function(_0x633eba){return{'model':db[_0x633eba['model']],'as':_0x633eba['as'],'attributes':_0x633eba[_0x04e8('0x1d')],'include':_0x633eba[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x633eba[_0x04e8('0x1b')],function(_0x7d701d){return{'model':db[_0x7d701d['model']],'as':_0x7d701d['as'],'attributes':_0x7d701d[_0x04e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x8ad8a3){var _0x3dd622=[];for(var _0x3eb0f5=0x0;_0x3eb0f5<_0x8ad8a3[_0x04e8('0x30')];_0x3eb0f5+=0x1){_0x3dd622[_0x04e8('0x32')](_0x8ad8a3[_0x3eb0f5][_0x04e8('0x24')](_0x387b86[_0x04e8('0x21')],{'transaction':_0x21bdd1}));}return BPromise[_0x04e8('0x33')](_0x3dd622);});})[_0x04e8('0x8')](function(_0x49d1af){logger['info'](_0x04e8('0x3f'),_0x387b86);logger[_0x04e8('0xc')](_0x04e8('0x3f'),_0x387b86,JSON[_0x04e8('0xe')](_0x49d1af));_0x382db6(_0x49d1af);})[_0x04e8('0x13')](function(_0x5e8644){logger[_0x04e8('0xf')](_0x04e8('0x3f'),_0x5e8644[_0x04e8('0x11')],_0x387b86);_0x362ed8(_0x5dd03d[_0x04e8('0xf')](0x1f4,_0x5e8644[_0x04e8('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x48f340){var _0x2a244b=this;return new Promise(function(_0x355d40,_0x34ace7){db[_0x04e8('0x28')][_0x04e8('0x29')]()[_0x04e8('0x8')](function(_0x407cfe){return db[_0x04e8('0x15')][_0x04e8('0x16')]({'raw':_0x48f340[_0x04e8('0x17')]?_0x48f340['options'][_0x04e8('0x18')]===undefined?!![]:![]:!![],'where':_0x48f340[_0x04e8('0x17')]?_0x48f340['options'][_0x04e8('0x1f')]||null:null,'attributes':_0x48f340[_0x04e8('0x17')]?_0x48f340[_0x04e8('0x17')]['attributes']||null:null,'limit':_0x48f340[_0x04e8('0x17')]?_0x48f340[_0x04e8('0x17')][_0x04e8('0x19')]||null:null,'include':_0x48f340[_0x04e8('0x17')]?_0x48f340[_0x04e8('0x17')]['include']?_['map'](_0x48f340[_0x04e8('0x17')][_0x04e8('0x1b')],function(_0x5ba7ce){return{'model':db[_0x5ba7ce[_0x04e8('0x1c')]],'as':_0x5ba7ce['as'],'attributes':_0x5ba7ce['as']===_0x04e8('0x2c')?_[_0x04e8('0x2d')](_0x407cfe):_0x5ba7ce[_0x04e8('0x1d')],'include':_0x5ba7ce[_0x04e8('0x1b')]?_[_0x04e8('0x1a')](_0x5ba7ce[_0x04e8('0x1b')],function(_0x2a977d){return{'model':db[_0x2a977d[_0x04e8('0x1c')]],'as':_0x2a977d['as'],'attributes':_0x2a977d[_0x04e8('0x1d')],'include':_0x2a977d[_0x04e8('0x1b')]?_['map'](_0x2a977d[_0x04e8('0x1b')],function(_0x1af9c5){return{'model':db[_0x1af9c5[_0x04e8('0x1c')]],'as':_0x1af9c5['as'],'attributes':_0x1af9c5[_0x04e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04e8('0x8')](function(_0x12fa88){logger[_0x04e8('0x9')](_0x04e8('0x14'),_0x48f340);logger[_0x04e8('0xc')](_0x04e8('0x14'),_0x48f340,JSON[_0x04e8('0xe')](_0x12fa88));_0x355d40(_0x12fa88);})[_0x04e8('0x13')](function(_0x427f84){logger[_0x04e8('0xf')]('GetCmHopper',_0x427f84[_0x04e8('0x11')],_0x48f340);_0x34ace7(_0x2a244b[_0x04e8('0xf')](0x1f4,_0x427f84[_0x04e8('0x11')]));});});});}; \ No newline at end of file +var _0xe0cb=['attributes','include','map','model','debug','catch','ShowCmHopper','find','where','CreateCmHopper','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','limit','order','LOCK','UPDATE','keys','User','Agent','voicePause','UserId','includes','push','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','findAll','COUNT','literal','format','\x22%s\x22','contactsRescheduled','GetContactRecallMe','length','all','GetCmHopperPreview','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','info','result','GetCmHopper','CmHopper','options','raw'];(function(_0x1ff3cb,_0x3c7f05){var _0x38a9a8=function(_0x2e5ade){while(--_0x2e5ade){_0x1ff3cb['push'](_0x1ff3cb['shift']());}};_0x38a9a8(++_0x3c7f05);}(_0xe0cb,0x144));var _0xbe0c=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0xe0cb[_0x4c05da];return _0x1614db;};'use strict';var _=require(_0xbe0c('0x0'));var util=require(_0xbe0c('0x1'));var moment=require(_0xbe0c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe0c('0x3'));var db=require(_0xbe0c('0x4'))['db'];var utils=require(_0xbe0c('0x5'));var logger=require(_0xbe0c('0x6'))('rpc');var config=require(_0xbe0c('0x7'));var jayson=require(_0xbe0c('0x8'));var client=jayson[_0xbe0c('0x9')][_0xbe0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19caad,_0x324c21,_0x3284ae){return new BPromise(function(_0x42c929,_0x39fa66){return client[_0xbe0c('0xb')](_0x19caad,_0x3284ae)[_0xbe0c('0xc')](function(_0x4645d2){logger['info']('CmHopper,\x20%s,\x20%s',_0x324c21,_0xbe0c('0xd'));logger['debug'](_0xbe0c('0xe'),_0x324c21,_0xbe0c('0xd'),JSON[_0xbe0c('0xf')](_0x4645d2));if(_0x4645d2[_0xbe0c('0x10')]){if(_0x4645d2[_0xbe0c('0x10')][_0xbe0c('0x11')]===0x1f4){logger['error'](_0xbe0c('0x12'),_0x324c21,_0x4645d2[_0xbe0c('0x10')]['message']);return _0x39fa66(_0x4645d2[_0xbe0c('0x10')][_0xbe0c('0x13')]);}logger[_0xbe0c('0x10')](_0xbe0c('0x12'),_0x324c21,_0x4645d2[_0xbe0c('0x10')]['message']);return _0x42c929(_0x4645d2[_0xbe0c('0x10')][_0xbe0c('0x13')]);}else{logger[_0xbe0c('0x14')]('CmHopper,\x20%s,\x20%s',_0x324c21,_0xbe0c('0xd'));_0x42c929(_0x4645d2[_0xbe0c('0x15')][_0xbe0c('0x13')]);}})['catch'](function(_0x2d659f){logger['error'](_0xbe0c('0x12'),_0x324c21,_0x2d659f);_0x39fa66(_0x2d659f);});});}exports[_0xbe0c('0x16')]=function(_0x3d0d5d){var _0x4caec9=this;return new Promise(function(_0x3b7590,_0x17bbd9){return db[_0xbe0c('0x17')]['findAll']({'raw':_0x3d0d5d[_0xbe0c('0x18')]?_0x3d0d5d[_0xbe0c('0x18')][_0xbe0c('0x19')]===undefined?!![]:![]:!![],'where':_0x3d0d5d[_0xbe0c('0x18')]?_0x3d0d5d[_0xbe0c('0x18')]['where']||null:null,'attributes':_0x3d0d5d[_0xbe0c('0x18')]?_0x3d0d5d[_0xbe0c('0x18')][_0xbe0c('0x1a')]||null:null,'limit':_0x3d0d5d[_0xbe0c('0x18')]?_0x3d0d5d['options']['limit']||null:null,'include':_0x3d0d5d[_0xbe0c('0x18')]?_0x3d0d5d['options'][_0xbe0c('0x1b')]?_[_0xbe0c('0x1c')](_0x3d0d5d['options'][_0xbe0c('0x1b')],function(_0x467997){return{'model':db[_0x467997['model']],'as':_0x467997['as'],'attributes':_0x467997[_0xbe0c('0x1a')],'include':_0x467997['include']?_[_0xbe0c('0x1c')](_0x467997[_0xbe0c('0x1b')],function(_0x430ab7){return{'model':db[_0x430ab7[_0xbe0c('0x1d')]],'as':_0x430ab7['as'],'attributes':_0x430ab7[_0xbe0c('0x1a')],'include':_0x430ab7[_0xbe0c('0x1b')]?_[_0xbe0c('0x1c')](_0x430ab7[_0xbe0c('0x1b')],function(_0x3735d4){return{'model':db[_0x3735d4['model']],'as':_0x3735d4['as'],'attributes':_0x3735d4[_0xbe0c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30fe5f){logger[_0xbe0c('0x14')](_0xbe0c('0x16'),_0x3d0d5d);logger[_0xbe0c('0x1e')]('GetCmHopper',_0x3d0d5d,JSON[_0xbe0c('0xf')](_0x30fe5f));_0x3b7590(_0x30fe5f);})[_0xbe0c('0x1f')](function(_0x1ce47a){logger[_0xbe0c('0x10')](_0xbe0c('0x16'),_0x1ce47a['message'],_0x3d0d5d);_0x17bbd9(_0x4caec9[_0xbe0c('0x10')](0x1f4,_0x1ce47a[_0xbe0c('0x13')]));});});};exports[_0xbe0c('0x20')]=function(_0x482430){var _0x7b4050=this;return new Promise(function(_0x43daad,_0x193b39){return db[_0xbe0c('0x17')][_0xbe0c('0x21')]({'raw':_0x482430[_0xbe0c('0x18')]?_0x482430[_0xbe0c('0x18')][_0xbe0c('0x19')]===undefined?!![]:![]:!![],'where':_0x482430[_0xbe0c('0x18')]?_0x482430[_0xbe0c('0x18')][_0xbe0c('0x22')]||null:null,'attributes':_0x482430[_0xbe0c('0x18')]?_0x482430[_0xbe0c('0x18')][_0xbe0c('0x1a')]||null:null,'include':_0x482430[_0xbe0c('0x18')]?_0x482430['options'][_0xbe0c('0x1b')]?_[_0xbe0c('0x1c')](_0x482430[_0xbe0c('0x18')][_0xbe0c('0x1b')],function(_0xbcfdcf){return{'model':db[_0xbcfdcf[_0xbe0c('0x1d')]],'as':_0xbcfdcf['as'],'attributes':_0xbcfdcf[_0xbe0c('0x1a')],'include':_0xbcfdcf['include']?_[_0xbe0c('0x1c')](_0xbcfdcf[_0xbe0c('0x1b')],function(_0x36724a){return{'model':db[_0x36724a['model']],'as':_0x36724a['as'],'attributes':_0x36724a[_0xbe0c('0x1a')],'include':_0x36724a[_0xbe0c('0x1b')]?_['map'](_0x36724a['include'],function(_0x36faee){return{'model':db[_0x36faee[_0xbe0c('0x1d')]],'as':_0x36faee['as'],'attributes':_0x36faee[_0xbe0c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe0c('0xc')](function(_0x3b7bc2){logger['info']('ShowCmHopper',_0x482430);logger[_0xbe0c('0x1e')](_0xbe0c('0x20'),_0x482430,JSON[_0xbe0c('0xf')](_0x3b7bc2));_0x43daad(_0x3b7bc2);})[_0xbe0c('0x1f')](function(_0x28a8e2){logger[_0xbe0c('0x10')]('ShowCmHopper',_0x28a8e2['message'],_0x482430);_0x193b39(_0x7b4050[_0xbe0c('0x10')](0x1f4,_0x28a8e2[_0xbe0c('0x13')]));});});};exports[_0xbe0c('0x23')]=function(_0x4b023e){var _0x5aec03=this;return new Promise(function(_0x463771,_0x2d8c72){return db[_0xbe0c('0x17')]['create'](_0x4b023e[_0xbe0c('0x24')],{'raw':_0x4b023e[_0xbe0c('0x18')]?_0x4b023e['options'][_0xbe0c('0x19')]===undefined?!![]:![]:!![]})[_0xbe0c('0xc')](function(_0x2f2668){logger['info']('CreateCmHopper',_0x4b023e);logger[_0xbe0c('0x1e')](_0xbe0c('0x23'),_0x4b023e,JSON[_0xbe0c('0xf')](_0x2f2668));_0x463771(_0x2f2668);})[_0xbe0c('0x1f')](function(_0x581d3f){logger[_0xbe0c('0x10')]('CreateCmHopper',_0x581d3f[_0xbe0c('0x13')],_0x4b023e);_0x2d8c72(_0x5aec03[_0xbe0c('0x10')](0x1f4,_0x581d3f[_0xbe0c('0x13')]));});});};exports[_0xbe0c('0x25')]=function(_0xc94487){var _0x1cc329=this;return new Promise(function(_0x2dc670,_0x34d7e6){return db[_0xbe0c('0x17')][_0xbe0c('0x26')](_0xc94487[_0xbe0c('0x24')],{'raw':_0xc94487['options']?_0xc94487[_0xbe0c('0x18')][_0xbe0c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc94487[_0xbe0c('0x18')]?_0xc94487[_0xbe0c('0x18')][_0xbe0c('0x22')]||null:null,'attributes':_0xc94487['options']?_0xc94487[_0xbe0c('0x18')][_0xbe0c('0x1a')]||null:null,'limit':_0xc94487[_0xbe0c('0x18')]?_0xc94487[_0xbe0c('0x18')]['limit']||null:null})[_0xbe0c('0xc')](function(_0x3d597d){logger[_0xbe0c('0x14')](_0xbe0c('0x25'),_0xc94487);logger[_0xbe0c('0x1e')](_0xbe0c('0x25'),_0xc94487,JSON[_0xbe0c('0xf')](_0x3d597d));_0x2dc670(_0x3d597d);})['catch'](function(_0x550453){logger[_0xbe0c('0x10')](_0xbe0c('0x25'),_0x550453[_0xbe0c('0x13')],_0xc94487);_0x34d7e6(_0x1cc329[_0xbe0c('0x10')](0x1f4,_0x550453[_0xbe0c('0x13')]));});});};exports[_0xbe0c('0x27')]=function(_0x19ef6d){var _0x4c0d83=this;return new Promise(function(_0x125854,_0x390740){return db[_0xbe0c('0x17')]['destroy']({'where':_0x19ef6d[_0xbe0c('0x18')]?_0x19ef6d[_0xbe0c('0x18')]['where']||null:null})[_0xbe0c('0xc')](function(_0x551a5e){logger[_0xbe0c('0x14')](_0xbe0c('0x27'),_0x19ef6d);logger[_0xbe0c('0x1e')](_0xbe0c('0x27'),_0x19ef6d,JSON['stringify'](_0x551a5e));_0x125854(_0x551a5e);})[_0xbe0c('0x1f')](function(_0x6cbee6){logger[_0xbe0c('0x10')](_0xbe0c('0x27'),_0x6cbee6[_0xbe0c('0x13')],_0x19ef6d);_0x390740(_0x4c0d83[_0xbe0c('0x10')](0x1f4,_0x6cbee6['message']));});});};exports[_0xbe0c('0x28')]=function(_0xaedccb){var _0x6c4bcc=this;return new Promise(function(_0x492864,_0x4ce612){return db[_0xbe0c('0x29')][_0xbe0c('0x2a')]()[_0xbe0c('0xc')](function(_0x2b14e9){return db[_0xbe0c('0x2b')][_0xbe0c('0x2c')](function(_0x28fa67){return db[_0xbe0c('0x17')]['findAll']({'where':_0xaedccb['options']?_0xaedccb[_0xbe0c('0x18')]['where']||null:null,'attributes':_0xaedccb[_0xbe0c('0x18')]?_0xaedccb[_0xbe0c('0x18')][_0xbe0c('0x1a')]||null:null,'limit':_0xaedccb[_0xbe0c('0x18')]?_0xaedccb[_0xbe0c('0x18')][_0xbe0c('0x2d')]||null:null,'order':_0xaedccb[_0xbe0c('0x18')]?_0xaedccb[_0xbe0c('0x18')][_0xbe0c('0x2e')]||null:null,'transaction':_0x28fa67,'lock':_0x28fa67[_0xbe0c('0x2f')][_0xbe0c('0x30')],'include':[{'model':db[_0xbe0c('0x29')],'as':'Contact','attributes':_[_0xbe0c('0x31')](_0x2b14e9)},{'model':db[_0xbe0c('0x32')],'as':_0xbe0c('0x33'),'attributes':['id','name',_0xbe0c('0x34')]}]})['then'](function(_0x2bf671){var _0x2dc4b5=[];var _0x2f10fe=[];for(var _0x7f9e6f=0x0;_0x7f9e6f<_0x2bf671['length'];_0x7f9e6f+=0x1){var _0x48504e=_0x2bf671[_0x7f9e6f][_0xbe0c('0x35')];if(_0x48504e===null){_0x2dc4b5['push'](_0x2bf671[_0x7f9e6f]['update'](_0xaedccb[_0xbe0c('0x24')],{'transaction':_0x28fa67}));}else if(!_0x2f10fe[_0xbe0c('0x36')](_0x48504e)){_0x2f10fe['push'](_0x48504e);_0x2dc4b5[_0xbe0c('0x37')](_0x2bf671[_0x7f9e6f]['update'](_0xaedccb[_0xbe0c('0x24')],{'transaction':_0x28fa67}));}}return BPromise['all'](_0x2dc4b5);});})[_0xbe0c('0xc')](function(_0x5c6768){logger[_0xbe0c('0x14')](_0xbe0c('0x28'),_0xaedccb);logger[_0xbe0c('0x1e')](_0xbe0c('0x28'),_0xaedccb,JSON['stringify'](_0x5c6768));_0x492864(_0x5c6768);})['catch'](function(_0x169d00){logger[_0xbe0c('0x10')]('GetContactDialer',_0x169d00[_0xbe0c('0x13')],_0xaedccb);_0x4ce612(_0x6c4bcc[_0xbe0c('0x10')](0x1f4,_0x169d00['message']));});});});};exports[_0xbe0c('0x38')]=function(_0x3205c8){var _0x537fed=this;return new Promise(function(_0x1a3fac,_0x545c44){return db[_0xbe0c('0x2b')][_0xbe0c('0x2c')](function(_0x297b30){return db[_0xbe0c('0x39')][_0xbe0c('0x3a')](_0x3205c8['body'],{'raw':_0x3205c8[_0xbe0c('0x18')]?_0x3205c8[_0xbe0c('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x297b30})[_0xbe0c('0xc')](function(){return db[_0xbe0c('0x17')]['destroy']({'where':_0x3205c8[_0xbe0c('0x18')]?_0x3205c8['options'][_0xbe0c('0x22')]||null:null,'transaction':_0x297b30});});})[_0xbe0c('0xc')](function(_0x30baf5){logger[_0xbe0c('0x14')](_0xbe0c('0x38'),_0x3205c8);logger[_0xbe0c('0x1e')]('MoveContactManagedDialer',_0x3205c8,JSON[_0xbe0c('0xf')](_0x30baf5));_0x1a3fac(_0x30baf5);})[_0xbe0c('0x1f')](function(_0x4832d2){logger[_0xbe0c('0x10')](_0xbe0c('0x38'),_0x4832d2[_0xbe0c('0x13')],_0x3205c8);_0x545c44(_0x537fed[_0xbe0c('0x10')](0x1f4,_0x4832d2['message']));});});};exports[_0xbe0c('0x3b')]=function(_0x2d5018){var _0x46eabd=this;return new Promise(function(_0x513e16,_0x539f73){return db[_0xbe0c('0x17')][_0xbe0c('0x3c')]({'raw':_0x2d5018[_0xbe0c('0x18')]?_0x2d5018[_0xbe0c('0x18')][_0xbe0c('0x19')]===undefined?!![]:![]:!![],'where':_0x2d5018[_0xbe0c('0x18')]?_0x2d5018[_0xbe0c('0x18')][_0xbe0c('0x22')]||null:null,'attributes':[[db[_0xbe0c('0x2b')]['fn'](_0xbe0c('0x3d'),db[_0xbe0c('0x2b')]['fn']('IF',db['sequelize'][_0xbe0c('0x3e')]('`scheduledat`\x20>=\x20'+util[_0xbe0c('0x3f')](_0xbe0c('0x40'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0xbe0c('0x41')]]})['then'](function(_0x16980f){logger['info']('CountReScheduled',_0x2d5018);logger[_0xbe0c('0x1e')](_0xbe0c('0x3b'),_0x2d5018,JSON['stringify'](_0x16980f));_0x513e16(_0x16980f);})['catch'](function(_0x2a8aba){logger[_0xbe0c('0x10')](_0xbe0c('0x3b'),_0x2a8aba[_0xbe0c('0x13')],_0x2d5018);_0x539f73(_0x46eabd[_0xbe0c('0x10')](0x1f4,_0x2a8aba[_0xbe0c('0x13')]));});});};exports[_0xbe0c('0x42')]=function(_0x8da604){var _0x163c7a=this;return new Promise(function(_0x3c60b6,_0x30de6a){return db[_0xbe0c('0x29')][_0xbe0c('0x2a')]()['then'](function(_0x4950af){return db[_0xbe0c('0x2b')][_0xbe0c('0x2c')](function(_0x1ad756){return db[_0xbe0c('0x17')][_0xbe0c('0x3c')]({'where':_0x8da604[_0xbe0c('0x18')]?_0x8da604['options'][_0xbe0c('0x22')]||null:null,'attributes':_0x8da604['options']?_0x8da604[_0xbe0c('0x18')][_0xbe0c('0x1a')]||null:null,'limit':0x1,'order':_0x8da604[_0xbe0c('0x18')]?_0x8da604[_0xbe0c('0x18')][_0xbe0c('0x2e')]||null:null,'group':db[_0xbe0c('0x17')][_0xbe0c('0x35')],'transaction':_0x1ad756,'lock':_0x1ad756[_0xbe0c('0x2f')][_0xbe0c('0x30')],'include':_0x8da604[_0xbe0c('0x18')]?_0x8da604[_0xbe0c('0x18')][_0xbe0c('0x1b')]?_['map'](_0x8da604[_0xbe0c('0x18')][_0xbe0c('0x1b')],function(_0x3efeff){return{'model':db[_0x3efeff['model']],'as':_0x3efeff['as'],'attributes':_0x3efeff[_0xbe0c('0x1a')],'include':_0x3efeff['include']?_[_0xbe0c('0x1c')](_0x3efeff[_0xbe0c('0x1b')],function(_0x34d4f8){return{'model':db[_0x34d4f8[_0xbe0c('0x1d')]],'as':_0x34d4f8['as'],'attributes':_0x34d4f8[_0xbe0c('0x1a')],'include':_0x34d4f8['include']?_[_0xbe0c('0x1c')](_0x34d4f8[_0xbe0c('0x1b')],function(_0x260e8c){return{'model':db[_0x260e8c[_0xbe0c('0x1d')]],'as':_0x260e8c['as'],'attributes':_0x260e8c[_0xbe0c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe0c('0xc')](function(_0x53b98b){var _0x515856=[];for(var _0x175be2=0x0;_0x175be2<_0x53b98b[_0xbe0c('0x43')];_0x175be2+=0x1){_0x515856['push'](_0x53b98b[_0x175be2][_0xbe0c('0x26')](_0x8da604[_0xbe0c('0x24')],{'transaction':_0x1ad756}));}return BPromise[_0xbe0c('0x44')](_0x515856);});})[_0xbe0c('0xc')](function(_0x3a5441){logger[_0xbe0c('0x14')]('GetContactRecallMe',_0x8da604);logger[_0xbe0c('0x1e')](_0xbe0c('0x42'),_0x8da604,JSON[_0xbe0c('0xf')](_0x3a5441));_0x3c60b6(_0x3a5441);})[_0xbe0c('0x1f')](function(_0x507bfc){logger[_0xbe0c('0x10')](_0xbe0c('0x42'),_0x507bfc['message'],_0x8da604);_0x30de6a(_0x163c7a['error'](0x1f4,_0x507bfc[_0xbe0c('0x13')]));});});});};exports[_0xbe0c('0x45')]=function(_0x11cf17){var _0x228499=this;return new Promise(function(_0x1ff3d5,_0x18cb58){db[_0xbe0c('0x29')][_0xbe0c('0x2a')]()['then'](function(_0x3cb475){return db[_0xbe0c('0x17')][_0xbe0c('0x3c')]({'raw':_0x11cf17[_0xbe0c('0x18')]?_0x11cf17[_0xbe0c('0x18')][_0xbe0c('0x19')]===undefined?!![]:![]:!![],'where':_0x11cf17['options']?_0x11cf17[_0xbe0c('0x18')]['where']||null:null,'attributes':_0x11cf17[_0xbe0c('0x18')]?_0x11cf17[_0xbe0c('0x18')][_0xbe0c('0x1a')]||null:null,'limit':_0x11cf17['options']?_0x11cf17[_0xbe0c('0x18')][_0xbe0c('0x2d')]||null:null,'include':_0x11cf17[_0xbe0c('0x18')]?_0x11cf17[_0xbe0c('0x18')][_0xbe0c('0x1b')]?_[_0xbe0c('0x1c')](_0x11cf17['options'][_0xbe0c('0x1b')],function(_0x5904e5){return{'model':db[_0x5904e5['model']],'as':_0x5904e5['as'],'attributes':_0x5904e5['as']==='Contact'?_['keys'](_0x3cb475):_0x5904e5['attributes'],'include':_0x5904e5['include']?_[_0xbe0c('0x1c')](_0x5904e5[_0xbe0c('0x1b')],function(_0x396e33){return{'model':db[_0x396e33[_0xbe0c('0x1d')]],'as':_0x396e33['as'],'attributes':_0x396e33[_0xbe0c('0x1a')],'include':_0x396e33[_0xbe0c('0x1b')]?_[_0xbe0c('0x1c')](_0x396e33[_0xbe0c('0x1b')],function(_0x3d2a6b){return{'model':db[_0x3d2a6b[_0xbe0c('0x1d')]],'as':_0x3d2a6b['as'],'attributes':_0x3d2a6b['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe0c('0xc')](function(_0x582c9a){logger[_0xbe0c('0x14')](_0xbe0c('0x16'),_0x11cf17);logger['debug']('GetCmHopper',_0x11cf17,JSON[_0xbe0c('0xf')](_0x582c9a));_0x1ff3d5(_0x582c9a);})[_0xbe0c('0x1f')](function(_0x132b59){logger[_0xbe0c('0x10')](_0xbe0c('0x16'),_0x132b59[_0xbe0c('0x13')],_0x11cf17);_0x18cb58(_0x228499[_0xbe0c('0x10')](0x1f4,_0x132b59[_0xbe0c('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 5ed9b62..d1fbe5e 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 _0x0c8d=['/describe','/opencontacts','isAuthenticated','getOpenContacts','/:id','post','create','/preview','getPreview','put','update','delete','destroy','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./cmHopper.controller','index','get'];(function(_0x1695ce,_0xfa80a6){var _0x41e575=function(_0x5d48c8){while(--_0x5d48c8){_0x1695ce['push'](_0x1695ce['shift']());}};_0x41e575(++_0xfa80a6);}(_0x0c8d,0x184));var _0xd0c8=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0c8d[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0xd0c8('0x0'));var path=require(_0xd0c8('0x1'));var timeout=require(_0xd0c8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0c8('0x3'));var config=require(_0xd0c8('0x4'));var controller=require(_0xd0c8('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd0c8('0x6')]);router[_0xd0c8('0x7')](_0xd0c8('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xd0c8('0x7')](_0xd0c8('0x9'),auth[_0xd0c8('0xa')](),controller[_0xd0c8('0xb')]);router[_0xd0c8('0x7')](_0xd0c8('0xc'),auth[_0xd0c8('0xa')](),controller['show']);router[_0xd0c8('0xd')]('/',auth['isAuthenticated'](),controller[_0xd0c8('0xe')]);router[_0xd0c8('0xd')](_0xd0c8('0xf'),auth[_0xd0c8('0xa')](),controller[_0xd0c8('0x10')]);router[_0xd0c8('0x11')](_0xd0c8('0xc'),auth[_0xd0c8('0xa')](),controller[_0xd0c8('0x12')]);router[_0xd0c8('0x13')](_0xd0c8('0xc'),auth['isAuthenticated'](),controller[_0xd0c8('0x14')]);module[_0xd0c8('0x15')]=router; \ No newline at end of file +var _0x4a7b=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/opencontacts','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a7b,0x1a3));var _0xb4a7=function(_0x11eb5c,_0x3b5438){_0x11eb5c=_0x11eb5c-0x0;var _0x2304e3=_0x4a7b[_0x11eb5c];return _0x2304e3;};'use strict';var multer=require(_0xb4a7('0x0'));var util=require(_0xb4a7('0x1'));var path=require('path');var timeout=require(_0xb4a7('0x2'));var express=require(_0xb4a7('0x3'));var router=express[_0xb4a7('0x4')]();var fs_extra=require(_0xb4a7('0x5'));var auth=require(_0xb4a7('0x6'));var interaction=require(_0xb4a7('0x7'));var config=require(_0xb4a7('0x8'));var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb4a7('0x9')]);router['get'](_0xb4a7('0xa'),auth[_0xb4a7('0xb')](),controller[_0xb4a7('0xc')]);router[_0xb4a7('0xd')](_0xb4a7('0xe'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xb4a7('0xd')](_0xb4a7('0xf'),auth['isAuthenticated'](),controller[_0xb4a7('0x10')]);router[_0xb4a7('0x11')]('/',auth[_0xb4a7('0xb')](),controller[_0xb4a7('0x12')]);router[_0xb4a7('0x11')](_0xb4a7('0x13'),auth[_0xb4a7('0xb')](),controller[_0xb4a7('0x14')]);router[_0xb4a7('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb4a7('0x16')]);router[_0xb4a7('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xb4a7('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 3dc87c6..3bbc91f 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 _0x26d1=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0xd691c6,_0x22e908){var _0x249fd0=function(_0x54346a){while(--_0x54346a){_0xd691c6['push'](_0xd691c6['shift']());}};_0x249fd0(++_0x22e908);}(_0x26d1,0x8e));var _0x126d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x26d1[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x126d('0x0'));var Sequelize=require('sequelize');module[_0x126d('0x1')]={'phone':{'type':Sequelize[_0x126d('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x126d('0x3')],'unique':_0x126d('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x126d('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x15c5=['moment','INTEGER','contactListQueue'];(function(_0x2b12c2,_0x1a89ae){var _0x5d5163=function(_0x5df0a5){while(--_0x5df0a5){_0x2b12c2['push'](_0x2b12c2['shift']());}};_0x5d5163(++_0x1a89ae);}(_0x15c5,0x192));var _0x515c=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x15c5[_0x559a80];return _0x42f555;};'use strict';var moment=require(_0x515c('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x515c('0x1')],'unique':_0x515c('0x2')},'ListId':{'type':Sequelize[_0x515c('0x1')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 8e2d896..a6443c5 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 _0xccbd=['send','map','CmHopperBlack','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','show','params','keys','merge','options','catch','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','stack','name'];(function(_0x3d237a,_0x140c2a){var _0x24e44f=function(_0x2c743b){while(--_0x2c743b){_0x3d237a['push'](_0x3d237a['shift']());}};_0x24e44f(++_0x140c2a);}(_0xccbd,0xb2));var _0xdccb=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xccbd[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0xdccb('0x0'));var rimraf=require(_0xdccb('0x1'));var zipdir=require(_0xdccb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdccb('0x3'));var BPromise=require(_0xdccb('0x4'));var Mustache=require('mustache');var util=require(_0xdccb('0x5'));var path=require(_0xdccb('0x6'));var sox=require(_0xdccb('0x7'));var csv=require(_0xdccb('0x8'));var ejs=require(_0xdccb('0x9'));var fs=require('fs');var fs_extra=require(_0xdccb('0xa'));var _=require(_0xdccb('0xb'));var squel=require(_0xdccb('0xc'));var crypto=require(_0xdccb('0xd'));var jsforce=require(_0xdccb('0xe'));var deskjs=require(_0xdccb('0xf'));var toCsv=require(_0xdccb('0x8'));var querystring=require('querystring');var Papa=require(_0xdccb('0x10'));var Redis=require(_0xdccb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdccb('0x12'));var as=require(_0xdccb('0x13'));var hardwareService=require(_0xdccb('0x14'));var logger=require('../../config/logger')(_0xdccb('0x15'));var utils=require(_0xdccb('0x16'));var config=require(_0xdccb('0x17'));var licenseUtil=require(_0xdccb('0x18'));var db=require(_0xdccb('0x19'))['db'];function respondWithStatusCode(_0x3a506d,_0x426fe0){_0x426fe0=_0x426fe0||0xcc;return function(_0x5b42c9){if(_0x5b42c9){return _0x3a506d[_0xdccb('0x1a')](_0x426fe0);}return _0x3a506d[_0xdccb('0x1b')](_0x426fe0)[_0xdccb('0x1c')]();};}function respondWithResult(_0x3865df,_0x24551b){_0x24551b=_0x24551b||0xc8;return function(_0x4d8a5e){if(_0x4d8a5e){return _0x3865df[_0xdccb('0x1b')](_0x24551b)[_0xdccb('0x1d')](_0x4d8a5e);}};}function respondWithFilteredResult(_0x21b231,_0x2fdd61){return function(_0x30d531){if(_0x30d531){var _0x2836bb=typeof _0x2fdd61[_0xdccb('0x1e')]===_0xdccb('0x1f')&&typeof _0x2fdd61[_0xdccb('0x20')]===_0xdccb('0x1f');var _0x4a110e=_0x30d531[_0xdccb('0x21')];var _0x519a35=_0x2836bb?0x0:_0x2fdd61[_0xdccb('0x1e')];var _0x383c77=_0x2836bb?_0x30d531[_0xdccb('0x21')]:_0x2fdd61[_0xdccb('0x1e')]+_0x2fdd61[_0xdccb('0x20')];var _0x5a6531;if(_0x383c77>=_0x4a110e){_0x383c77=_0x4a110e;_0x5a6531=0xc8;}else{_0x5a6531=0xce;}_0x21b231['status'](_0x5a6531);return _0x21b231['set'](_0xdccb('0x22'),_0x519a35+'-'+_0x383c77+'/'+_0x4a110e)[_0xdccb('0x1d')](_0x30d531);}return null;};}function patchUpdates(_0x318bce){return function(_0x5c8ada){try{jsonpatch[_0xdccb('0x23')](_0x5c8ada,_0x318bce,!![]);}catch(_0x558ea1){return BPromise['reject'](_0x558ea1);}return _0x5c8ada['save']();};}function saveUpdates(_0x3d6747,_0xdfa0ad){return function(_0x24cbca){if(_0x24cbca){return _0x24cbca[_0xdccb('0x24')](_0x3d6747)[_0xdccb('0x25')](function(_0x5c13dd){return _0x5c13dd;});}return null;};}function removeEntity(_0xa25d1d,_0x375c5c){return function(_0x3dd864){if(_0x3dd864){return _0x3dd864[_0xdccb('0x26')]()[_0xdccb('0x25')](function(){_0xa25d1d['status'](0xcc)[_0xdccb('0x1c')]();});}};}function handleEntityNotFound(_0x1e897e,_0x231c60){return function(_0x11077f){if(!_0x11077f){_0x1e897e['sendStatus'](0x194);}return _0x11077f;};}function handleError(_0x28cfc9,_0x25d661){_0x25d661=_0x25d661||0x1f4;return function(_0x230293){logger['error'](_0x230293[_0xdccb('0x27')]);if(_0x230293['name']){delete _0x230293[_0xdccb('0x28')];}_0x28cfc9['status'](_0x25d661)[_0xdccb('0x29')](_0x230293);};}exports['index']=function(_0x3f51fa,_0x5dd0d3){var _0x139f32={},_0x2fc157={},_0x21703c={'count':0x0,'rows':[]};var _0x5ec6f8=_[_0xdccb('0x2a')](db[_0xdccb('0x2b')][_0xdccb('0x2c')],function(_0x37d8c5){return{'name':_0x37d8c5['fieldName'],'type':_0x37d8c5[_0xdccb('0x2d')][_0xdccb('0x2e')]};});_0x2fc157[_0xdccb('0x2f')]=_['map'](_0x5ec6f8,_0xdccb('0x28'));_0x2fc157[_0xdccb('0x30')]=_['keys'](_0x3f51fa[_0xdccb('0x30')]);_0x2fc157[_0xdccb('0x31')]=_[_0xdccb('0x32')](_0x2fc157['model'],_0x2fc157[_0xdccb('0x30')]);_0x139f32[_0xdccb('0x33')]=_[_0xdccb('0x32')](_0x2fc157['model'],qs[_0xdccb('0x34')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x34')]));_0x139f32[_0xdccb('0x33')]=_0x139f32[_0xdccb('0x33')][_0xdccb('0x35')]?_0x139f32['attributes']:_0x2fc157[_0xdccb('0x2f')];if(!_0x3f51fa['query'][_0xdccb('0x36')](_0xdccb('0x37'))){_0x139f32['limit']=qs['limit'](_0x3f51fa['query'][_0xdccb('0x20')]);_0x139f32[_0xdccb('0x1e')]=qs[_0xdccb('0x1e')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x1e')]);}_0x139f32[_0xdccb('0x38')]=qs[_0xdccb('0x39')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x39')]);_0x139f32[_0xdccb('0x3a')]=qs[_0xdccb('0x31')](_[_0xdccb('0x3b')](_0x3f51fa[_0xdccb('0x30')],_0x2fc157[_0xdccb('0x31')]),_0x5ec6f8);if(_0x3f51fa['query'][_0xdccb('0x3c')]){_0x139f32['where']=_['merge'](_0x139f32[_0xdccb('0x3a')],{'$or':_['map'](_0x5ec6f8,function(_0x212a5a){if(_0x212a5a[_0xdccb('0x2d')]!=='VIRTUAL'){var _0x1ba313={};_0x1ba313[_0x212a5a['name']]={'$like':'%'+_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x3c')]+'%'};return _0x1ba313;}})});}_0x139f32=_['merge']({},_0x139f32,_0x3f51fa['options']);var _0x1ba058={'where':_0x139f32[_0xdccb('0x3a')]};return db['CmHopperBlack'][_0xdccb('0x21')](_0x1ba058)[_0xdccb('0x25')](function(_0x10dca7){_0x21703c[_0xdccb('0x21')]=_0x10dca7;if(_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x3d')]){_0x139f32[_0xdccb('0x3e')]=[{'all':!![]}];}return db[_0xdccb('0x2b')][_0xdccb('0x3f')](_0x139f32);})['then'](function(_0x4d8ea4){_0x21703c['rows']=_0x4d8ea4;return _0x21703c;})[_0xdccb('0x25')](respondWithFilteredResult(_0x5dd0d3,_0x139f32))['catch'](handleError(_0x5dd0d3,null));};exports[_0xdccb('0x40')]=function(_0x40225b,_0x351581){var _0x4de8c6={'raw':!![],'where':{'id':_0x40225b[_0xdccb('0x41')]['id']}},_0x2edd7a={};_0x2edd7a[_0xdccb('0x2f')]=_[_0xdccb('0x42')](db[_0xdccb('0x2b')]['rawAttributes']);_0x2edd7a['query']=_[_0xdccb('0x42')](_0x40225b[_0xdccb('0x30')]);_0x2edd7a[_0xdccb('0x31')]=_[_0xdccb('0x32')](_0x2edd7a[_0xdccb('0x2f')],_0x2edd7a[_0xdccb('0x30')]);_0x4de8c6[_0xdccb('0x33')]=_[_0xdccb('0x32')](_0x2edd7a[_0xdccb('0x2f')],qs[_0xdccb('0x34')](_0x40225b[_0xdccb('0x30')]['fields']));_0x4de8c6[_0xdccb('0x33')]=_0x4de8c6[_0xdccb('0x33')][_0xdccb('0x35')]?_0x4de8c6[_0xdccb('0x33')]:_0x2edd7a[_0xdccb('0x2f')];if(_0x40225b[_0xdccb('0x30')][_0xdccb('0x3d')]){_0x4de8c6[_0xdccb('0x3e')]=[{'all':!![]}];}_0x4de8c6=_[_0xdccb('0x43')]({},_0x4de8c6,_0x40225b[_0xdccb('0x44')]);return db[_0xdccb('0x2b')]['find'](_0x4de8c6)[_0xdccb('0x25')](handleEntityNotFound(_0x351581,null))['then'](respondWithResult(_0x351581,null))[_0xdccb('0x45')](handleError(_0x351581,null));};exports[_0xdccb('0x24')]=function(_0x2dfbc5,_0x48f64e){if(_0x2dfbc5[_0xdccb('0x46')]['id']){delete _0x2dfbc5[_0xdccb('0x46')]['id'];}return db[_0xdccb('0x2b')][_0xdccb('0x47')]({'where':{'id':_0x2dfbc5['params']['id']}})[_0xdccb('0x25')](handleEntityNotFound(_0x48f64e,null))['then'](saveUpdates(_0x2dfbc5['body'],null))[_0xdccb('0x25')](respondWithResult(_0x48f64e,null))[_0xdccb('0x45')](handleError(_0x48f64e,null));};exports['destroy']=function(_0x22b264,_0x371c30){return db[_0xdccb('0x2b')][_0xdccb('0x47')]({'where':{'id':_0x22b264[_0xdccb('0x41')]['id']}})[_0xdccb('0x25')](handleEntityNotFound(_0x371c30,null))[_0xdccb('0x25')](removeEntity(_0x371c30,null))[_0xdccb('0x45')](handleError(_0x371c30,null));};exports[_0xdccb('0x48')]=function(_0x237417,_0x3db9ad){return db[_0xdccb('0x2b')][_0xdccb('0x48')]()['then'](respondWithResult(_0x3db9ad,null))['catch'](handleError(_0x3db9ad,null));}; \ No newline at end of file +var _0xdd79=['destroy','sendStatus','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xdd79,0x10f));var _0x9dd7=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdd79[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x9dd7('0x0'));var rimraf=require(_0x9dd7('0x1'));var zipdir=require(_0x9dd7('0x2'));var jsonpatch=require(_0x9dd7('0x3'));var rp=require(_0x9dd7('0x4'));var moment=require(_0x9dd7('0x5'));var BPromise=require(_0x9dd7('0x6'));var Mustache=require('mustache');var util=require(_0x9dd7('0x7'));var path=require(_0x9dd7('0x8'));var sox=require(_0x9dd7('0x9'));var csv=require(_0x9dd7('0xa'));var ejs=require(_0x9dd7('0xb'));var fs=require('fs');var fs_extra=require(_0x9dd7('0xc'));var _=require(_0x9dd7('0xd'));var squel=require('squel');var crypto=require(_0x9dd7('0xe'));var jsforce=require(_0x9dd7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9dd7('0xa'));var querystring=require(_0x9dd7('0x10'));var Papa=require(_0x9dd7('0x11'));var Redis=require(_0x9dd7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9dd7('0x13'));var as=require(_0x9dd7('0x14'));var hardwareService=require(_0x9dd7('0x15'));var logger=require(_0x9dd7('0x16'))(_0x9dd7('0x17'));var utils=require(_0x9dd7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9dd7('0x19'));var db=require(_0x9dd7('0x1a'))['db'];function respondWithStatusCode(_0x4b17d5,_0x22200d){_0x22200d=_0x22200d||0xcc;return function(_0xed9042){if(_0xed9042){return _0x4b17d5['sendStatus'](_0x22200d);}return _0x4b17d5[_0x9dd7('0x1b')](_0x22200d)[_0x9dd7('0x1c')]();};}function respondWithResult(_0x3ecc73,_0x33e434){_0x33e434=_0x33e434||0xc8;return function(_0x5d184c){if(_0x5d184c){return _0x3ecc73[_0x9dd7('0x1b')](_0x33e434)[_0x9dd7('0x1d')](_0x5d184c);}};}function respondWithFilteredResult(_0x4e0e32,_0x58ce68){return function(_0x15fe9d){if(_0x15fe9d){var _0x1562e5=typeof _0x58ce68['offset']===_0x9dd7('0x1e')&&typeof _0x58ce68[_0x9dd7('0x1f')]===_0x9dd7('0x1e');var _0x2e8027=_0x15fe9d[_0x9dd7('0x20')];var _0x488225=_0x1562e5?0x0:_0x58ce68[_0x9dd7('0x21')];var _0x23c587=_0x1562e5?_0x15fe9d[_0x9dd7('0x20')]:_0x58ce68[_0x9dd7('0x21')]+_0x58ce68[_0x9dd7('0x1f')];var _0x4bcc98;if(_0x23c587>=_0x2e8027){_0x23c587=_0x2e8027;_0x4bcc98=0xc8;}else{_0x4bcc98=0xce;}_0x4e0e32[_0x9dd7('0x1b')](_0x4bcc98);return _0x4e0e32[_0x9dd7('0x22')](_0x9dd7('0x23'),_0x488225+'-'+_0x23c587+'/'+_0x2e8027)[_0x9dd7('0x1d')](_0x15fe9d);}return null;};}function patchUpdates(_0x30961e){return function(_0x497394){try{jsonpatch[_0x9dd7('0x24')](_0x497394,_0x30961e,!![]);}catch(_0x22f984){return BPromise[_0x9dd7('0x25')](_0x22f984);}return _0x497394[_0x9dd7('0x26')]();};}function saveUpdates(_0x8a8d09,_0x164342){return function(_0x1ded6b){if(_0x1ded6b){return _0x1ded6b[_0x9dd7('0x27')](_0x8a8d09)[_0x9dd7('0x28')](function(_0x1769c9){return _0x1769c9;});}return null;};}function removeEntity(_0x2ddf5a,_0x436a0f){return function(_0x527a8b){if(_0x527a8b){return _0x527a8b[_0x9dd7('0x29')]()[_0x9dd7('0x28')](function(){_0x2ddf5a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x356e6a,_0x44ab78){return function(_0x484a2a){if(!_0x484a2a){_0x356e6a[_0x9dd7('0x2a')](0x194);}return _0x484a2a;};}function handleError(_0x1ba10c,_0x2d602d){_0x2d602d=_0x2d602d||0x1f4;return function(_0x10d85a){logger['error'](_0x10d85a[_0x9dd7('0x2b')]);if(_0x10d85a[_0x9dd7('0x2c')]){delete _0x10d85a[_0x9dd7('0x2c')];}_0x1ba10c[_0x9dd7('0x1b')](_0x2d602d)[_0x9dd7('0x2d')](_0x10d85a);};}exports[_0x9dd7('0x2e')]=function(_0x2369b1,_0x1e3cee){var _0xc79657={},_0x116f98={},_0x4ad018={'count':0x0,'rows':[]};var _0x11a7b3=_['map'](db[_0x9dd7('0x2f')][_0x9dd7('0x30')],function(_0x22de17){return{'name':_0x22de17[_0x9dd7('0x31')],'type':_0x22de17[_0x9dd7('0x32')]['key']};});_0x116f98[_0x9dd7('0x33')]=_[_0x9dd7('0x34')](_0x11a7b3,_0x9dd7('0x2c'));_0x116f98[_0x9dd7('0x35')]=_[_0x9dd7('0x36')](_0x2369b1['query']);_0x116f98[_0x9dd7('0x37')]=_[_0x9dd7('0x38')](_0x116f98[_0x9dd7('0x33')],_0x116f98[_0x9dd7('0x35')]);_0xc79657['attributes']=_['intersection'](_0x116f98[_0x9dd7('0x33')],qs['fields'](_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x39')]));_0xc79657[_0x9dd7('0x3a')]=_0xc79657[_0x9dd7('0x3a')][_0x9dd7('0x3b')]?_0xc79657['attributes']:_0x116f98[_0x9dd7('0x33')];if(!_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x3c')](_0x9dd7('0x3d'))){_0xc79657[_0x9dd7('0x1f')]=qs[_0x9dd7('0x1f')](_0x2369b1['query'][_0x9dd7('0x1f')]);_0xc79657[_0x9dd7('0x21')]=qs[_0x9dd7('0x21')](_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x21')]);}_0xc79657[_0x9dd7('0x3e')]=qs[_0x9dd7('0x3f')](_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x3f')]);_0xc79657[_0x9dd7('0x40')]=qs['filters'](_['pick'](_0x2369b1[_0x9dd7('0x35')],_0x116f98['filters']),_0x11a7b3);if(_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x41')]){_0xc79657['where']=_[_0x9dd7('0x42')](_0xc79657['where'],{'$or':_[_0x9dd7('0x34')](_0x11a7b3,function(_0x4194eb){if(_0x4194eb['type']!==_0x9dd7('0x43')){var _0x23bf69={};_0x23bf69[_0x4194eb['name']]={'$like':'%'+_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x41')]+'%'};return _0x23bf69;}})});}_0xc79657=_['merge']({},_0xc79657,_0x2369b1[_0x9dd7('0x44')]);var _0x2fb8bc={'where':_0xc79657['where']};return db[_0x9dd7('0x2f')]['count'](_0x2fb8bc)[_0x9dd7('0x28')](function(_0x2f4596){_0x4ad018[_0x9dd7('0x20')]=_0x2f4596;if(_0x2369b1[_0x9dd7('0x35')][_0x9dd7('0x45')]){_0xc79657[_0x9dd7('0x46')]=[{'all':!![]}];}return db[_0x9dd7('0x2f')][_0x9dd7('0x47')](_0xc79657);})['then'](function(_0x515948){_0x4ad018['rows']=_0x515948;return _0x4ad018;})[_0x9dd7('0x28')](respondWithFilteredResult(_0x1e3cee,_0xc79657))[_0x9dd7('0x48')](handleError(_0x1e3cee,null));};exports[_0x9dd7('0x49')]=function(_0x27bc9b,_0xbefa88){var _0xc19086={'raw':!![],'where':{'id':_0x27bc9b[_0x9dd7('0x4a')]['id']}},_0x3ee9b2={};_0x3ee9b2['model']=_['keys'](db[_0x9dd7('0x2f')][_0x9dd7('0x30')]);_0x3ee9b2[_0x9dd7('0x35')]=_[_0x9dd7('0x36')](_0x27bc9b['query']);_0x3ee9b2[_0x9dd7('0x37')]=_[_0x9dd7('0x38')](_0x3ee9b2[_0x9dd7('0x33')],_0x3ee9b2['query']);_0xc19086[_0x9dd7('0x3a')]=_[_0x9dd7('0x38')](_0x3ee9b2[_0x9dd7('0x33')],qs[_0x9dd7('0x39')](_0x27bc9b[_0x9dd7('0x35')][_0x9dd7('0x39')]));_0xc19086[_0x9dd7('0x3a')]=_0xc19086['attributes'][_0x9dd7('0x3b')]?_0xc19086[_0x9dd7('0x3a')]:_0x3ee9b2[_0x9dd7('0x33')];if(_0x27bc9b[_0x9dd7('0x35')][_0x9dd7('0x45')]){_0xc19086['include']=[{'all':!![]}];}_0xc19086=_[_0x9dd7('0x42')]({},_0xc19086,_0x27bc9b['options']);return db[_0x9dd7('0x2f')][_0x9dd7('0x4b')](_0xc19086)[_0x9dd7('0x28')](handleEntityNotFound(_0xbefa88,null))['then'](respondWithResult(_0xbefa88,null))[_0x9dd7('0x48')](handleError(_0xbefa88,null));};exports[_0x9dd7('0x27')]=function(_0x56c997,_0x34ca6f){if(_0x56c997[_0x9dd7('0x4c')]['id']){delete _0x56c997[_0x9dd7('0x4c')]['id'];}return db[_0x9dd7('0x2f')][_0x9dd7('0x4b')]({'where':{'id':_0x56c997['params']['id']}})['then'](handleEntityNotFound(_0x34ca6f,null))[_0x9dd7('0x28')](saveUpdates(_0x56c997[_0x9dd7('0x4c')],null))[_0x9dd7('0x28')](respondWithResult(_0x34ca6f,null))['catch'](handleError(_0x34ca6f,null));};exports['destroy']=function(_0x2500da,_0x9e8077){return db[_0x9dd7('0x2f')][_0x9dd7('0x4b')]({'where':{'id':_0x2500da[_0x9dd7('0x4a')]['id']}})[_0x9dd7('0x28')](handleEntityNotFound(_0x9e8077,null))[_0x9dd7('0x28')](removeEntity(_0x9e8077,null))[_0x9dd7('0x48')](handleError(_0x9e8077,null));};exports[_0x9dd7('0x4d')]=function(_0x43e325,_0x190c1c){return db[_0x9dd7('0x2f')][_0x9dd7('0x4d')]()[_0x9dd7('0x28')](respondWithResult(_0x190c1c,null))[_0x9dd7('0x48')](handleError(_0x190c1c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 56143ab..1f0a799 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 _0x592f=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','bluebird'];(function(_0x236286,_0x333397){var _0x1a1f90=function(_0x1e12d5){while(--_0x1e12d5){_0x236286['push'](_0x236286['shift']());}};_0x1a1f90(++_0x333397);}(_0x592f,0x151));var _0xf592=function(_0x3509dd,_0x9b0970){_0x3509dd=_0x3509dd-0x0;var _0x55c374=_0x592f[_0x3509dd];return _0x55c374;};'use strict';var _=require(_0xf592('0x0'));var util=require(_0xf592('0x1'));var logger=require(_0xf592('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf592('0x3'));var rp=require(_0xf592('0x4'));var fs=require('fs');var path=require(_0xf592('0x5'));var rimraf=require(_0xf592('0x6'));var config=require(_0xf592('0x7'));var attributes=require(_0xf592('0x8'));module['exports']=function(_0xd4d485,_0x481275){return _0xd4d485['define'](_0xf592('0x9'),attributes,{'tableName':_0xf592('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x269e=['cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x38f569,_0x4aa7e9){var _0x2f5442=function(_0x32ebc1){while(--_0x32ebc1){_0x38f569['push'](_0x38f569['shift']());}};_0x2f5442(++_0x4aa7e9);}(_0x269e,0xd2));var _0xe269=function(_0x3989d6,_0x2c5400){_0x3989d6=_0x3989d6-0x0;var _0xae8e03=_0x269e[_0x3989d6];return _0xae8e03;};'use strict';var _=require(_0xe269('0x0'));var util=require('util');var logger=require(_0xe269('0x1'))(_0xe269('0x2'));var moment=require(_0xe269('0x3'));var BPromise=require(_0xe269('0x4'));var rp=require(_0xe269('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe269('0x6'));module[_0xe269('0x7')]=function(_0x3e86d4,_0xb812df){return _0x3e86d4[_0xe269('0x8')](_0xe269('0x9'),attributes,{'tableName':_0xe269('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index f0c3939..13b3aa4 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 _0x02a2=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','info','catch','CmHopperBlack','findAll','options','where','attributes','include','map','model','GetCmHopperBlack','update','raw','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x02a2,0x191));var _0x202a=function(_0xe8fb87,_0x597079){_0xe8fb87=_0xe8fb87-0x0;var _0x118b05=_0x02a2[_0xe8fb87];return _0x118b05;};'use strict';var _=require(_0x202a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x202a('0x1'));var rs=require(_0x202a('0x2'));var fs=require('fs');var Redis=require(_0x202a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x202a('0x4'));var logger=require(_0x202a('0x5'))(_0x202a('0x6'));var config=require(_0x202a('0x7'));var jayson=require(_0x202a('0x8'));var client=jayson[_0x202a('0x9')][_0x202a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22d3cc,_0x4b9890,_0x32364d){return new BPromise(function(_0x156627,_0x2b2fc0){return client[_0x202a('0xb')](_0x22d3cc,_0x32364d)[_0x202a('0xc')](function(_0x2478d3){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x202a('0xd'));logger[_0x202a('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4b9890,_0x202a('0xd'),JSON[_0x202a('0xf')](_0x2478d3));if(_0x2478d3[_0x202a('0x10')]){if(_0x2478d3['error'][_0x202a('0x11')]===0x1f4){logger[_0x202a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x2478d3['error'][_0x202a('0x12')]);return _0x2b2fc0(_0x2478d3[_0x202a('0x10')][_0x202a('0x12')]);}logger[_0x202a('0x10')](_0x202a('0x13'),_0x4b9890,_0x2478d3[_0x202a('0x10')]['message']);return _0x156627(_0x2478d3[_0x202a('0x10')][_0x202a('0x12')]);}else{logger[_0x202a('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x202a('0xd'));_0x156627(_0x2478d3['result'][_0x202a('0x12')]);}})[_0x202a('0x15')](function(_0x46eae1){logger[_0x202a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4b9890,_0x46eae1);_0x2b2fc0(_0x46eae1);});});}exports['GetCmHopperBlack']=function(_0x1fe522){var _0x3f306f=this;return new Promise(function(_0x381bbb,_0x583020){return db[_0x202a('0x16')][_0x202a('0x17')]({'raw':_0x1fe522[_0x202a('0x18')]?_0x1fe522[_0x202a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1fe522['options']?_0x1fe522[_0x202a('0x18')][_0x202a('0x19')]||null:null,'attributes':_0x1fe522[_0x202a('0x18')]?_0x1fe522[_0x202a('0x18')][_0x202a('0x1a')]||null:null,'limit':_0x1fe522['options']?_0x1fe522['options']['limit']||null:null,'include':_0x1fe522[_0x202a('0x18')]?_0x1fe522[_0x202a('0x18')][_0x202a('0x1b')]?_[_0x202a('0x1c')](_0x1fe522[_0x202a('0x18')][_0x202a('0x1b')],function(_0x24a174){return{'model':db[_0x24a174['model']],'as':_0x24a174['as'],'attributes':_0x24a174[_0x202a('0x1a')],'include':_0x24a174[_0x202a('0x1b')]?_[_0x202a('0x1c')](_0x24a174['include'],function(_0x5143cb){return{'model':db[_0x5143cb['model']],'as':_0x5143cb['as'],'attributes':_0x5143cb['attributes'],'include':_0x5143cb[_0x202a('0x1b')]?_[_0x202a('0x1c')](_0x5143cb[_0x202a('0x1b')],function(_0x24d0a1){return{'model':db[_0x24d0a1[_0x202a('0x1d')]],'as':_0x24d0a1['as'],'attributes':_0x24d0a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x202a('0xc')](function(_0x416993){logger[_0x202a('0x14')]('GetCmHopperBlack',_0x1fe522);logger[_0x202a('0xe')](_0x202a('0x1e'),_0x1fe522,JSON['stringify'](_0x416993));_0x381bbb(_0x416993);})[_0x202a('0x15')](function(_0x5ec506){logger[_0x202a('0x10')](_0x202a('0x1e'),_0x5ec506[_0x202a('0x12')],_0x1fe522);_0x583020(_0x3f306f[_0x202a('0x10')](0x1f4,_0x5ec506[_0x202a('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x449475){var _0x4ed50d=this;return new Promise(function(_0x4169a9,_0x1ad9e9){return db['CmHopperBlack'][_0x202a('0x1f')](_0x449475['body'],{'raw':_0x449475[_0x202a('0x18')]?_0x449475['options'][_0x202a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x449475[_0x202a('0x18')]?_0x449475[_0x202a('0x18')][_0x202a('0x19')]||null:null,'attributes':_0x449475[_0x202a('0x18')]?_0x449475['options'][_0x202a('0x1a')]||null:null,'limit':_0x449475[_0x202a('0x18')]?_0x449475[_0x202a('0x18')][_0x202a('0x21')]||null:null})['then'](function(_0x46aa01){logger[_0x202a('0x14')](_0x202a('0x22'),_0x449475);logger[_0x202a('0xe')](_0x202a('0x22'),_0x449475,JSON[_0x202a('0xf')](_0x46aa01));_0x4169a9(_0x46aa01);})[_0x202a('0x15')](function(_0x3cb3b3){logger[_0x202a('0x10')](_0x202a('0x22'),_0x3cb3b3['message'],_0x449475);_0x1ad9e9(_0x4ed50d[_0x202a('0x10')](0x1f4,_0x3cb3b3[_0x202a('0x12')]));});});};exports[_0x202a('0x23')]=function(_0x1063c4){var _0x24ef3c=this;return new Promise(function(_0x131b42,_0x3cb887){return db['CmHopperBlack'][_0x202a('0x24')]({'where':_0x1063c4[_0x202a('0x18')]?_0x1063c4[_0x202a('0x18')][_0x202a('0x19')]||null:null})[_0x202a('0xc')](function(_0x495316){logger['info']('DestroyCmHopperBlack',_0x1063c4);logger['debug'](_0x202a('0x23'),_0x1063c4,JSON[_0x202a('0xf')](_0x495316));_0x131b42(_0x495316);})[_0x202a('0x15')](function(_0x1de85e){logger[_0x202a('0x10')]('DestroyCmHopperBlack',_0x1de85e[_0x202a('0x12')],_0x1063c4);_0x3cb887(_0x24ef3c[_0x202a('0x10')](0x1f4,_0x1de85e[_0x202a('0x12')]));});});}; \ No newline at end of file +var _0x4b50=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','body','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','util','moment'];(function(_0x32032a,_0x24e8d1){var _0x5d5792=function(_0x517d18){while(--_0x517d18){_0x32032a['push'](_0x32032a['shift']());}};_0x5d5792(++_0x24e8d1);}(_0x4b50,0x195));var _0x04b5=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x4b50[_0x427d3a];return _0xe5c521;};'use strict';var _=require('lodash');var util=require(_0x04b5('0x0'));var moment=require(_0x04b5('0x1'));var BPromise=require(_0x04b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x04b5('0x4'))(_0x04b5('0x5'));var config=require(_0x04b5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x04b5('0x7')][_0x04b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3650c7,_0x25c8a2,_0x18e98e){return new BPromise(function(_0x3a8d4b,_0xe46729){return client[_0x04b5('0x9')](_0x3650c7,_0x18e98e)[_0x04b5('0xa')](function(_0x1148c4){logger[_0x04b5('0xb')](_0x04b5('0xc'),_0x25c8a2,_0x04b5('0xd'));logger[_0x04b5('0xe')](_0x04b5('0xf'),_0x25c8a2,_0x04b5('0xd'),JSON[_0x04b5('0x10')](_0x1148c4));if(_0x1148c4['error']){if(_0x1148c4[_0x04b5('0x11')][_0x04b5('0x12')]===0x1f4){logger['error'](_0x04b5('0xc'),_0x25c8a2,_0x1148c4['error'][_0x04b5('0x13')]);return _0xe46729(_0x1148c4['error']['message']);}logger[_0x04b5('0x11')](_0x04b5('0xc'),_0x25c8a2,_0x1148c4[_0x04b5('0x11')][_0x04b5('0x13')]);return _0x3a8d4b(_0x1148c4[_0x04b5('0x11')][_0x04b5('0x13')]);}else{logger[_0x04b5('0xb')](_0x04b5('0xc'),_0x25c8a2,'request\x20sent');_0x3a8d4b(_0x1148c4[_0x04b5('0x14')][_0x04b5('0x13')]);}})['catch'](function(_0x306b95){logger[_0x04b5('0x11')](_0x04b5('0xc'),_0x25c8a2,_0x306b95);_0xe46729(_0x306b95);});});}exports[_0x04b5('0x15')]=function(_0x12d801){var _0x14b457=this;return new Promise(function(_0x293b5f,_0x13bc23){return db[_0x04b5('0x16')][_0x04b5('0x17')]({'raw':_0x12d801['options']?_0x12d801[_0x04b5('0x18')][_0x04b5('0x19')]===undefined?!![]:![]:!![],'where':_0x12d801['options']?_0x12d801[_0x04b5('0x18')][_0x04b5('0x1a')]||null:null,'attributes':_0x12d801[_0x04b5('0x18')]?_0x12d801[_0x04b5('0x18')][_0x04b5('0x1b')]||null:null,'limit':_0x12d801['options']?_0x12d801[_0x04b5('0x18')][_0x04b5('0x1c')]||null:null,'include':_0x12d801[_0x04b5('0x18')]?_0x12d801[_0x04b5('0x18')][_0x04b5('0x1d')]?_[_0x04b5('0x1e')](_0x12d801[_0x04b5('0x18')][_0x04b5('0x1d')],function(_0x46a1b7){return{'model':db[_0x46a1b7[_0x04b5('0x1f')]],'as':_0x46a1b7['as'],'attributes':_0x46a1b7[_0x04b5('0x1b')],'include':_0x46a1b7[_0x04b5('0x1d')]?_[_0x04b5('0x1e')](_0x46a1b7[_0x04b5('0x1d')],function(_0x317c52){return{'model':db[_0x317c52[_0x04b5('0x1f')]],'as':_0x317c52['as'],'attributes':_0x317c52[_0x04b5('0x1b')],'include':_0x317c52['include']?_[_0x04b5('0x1e')](_0x317c52[_0x04b5('0x1d')],function(_0x50dcc5){return{'model':db[_0x50dcc5[_0x04b5('0x1f')]],'as':_0x50dcc5['as'],'attributes':_0x50dcc5[_0x04b5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x04b5('0xa')](function(_0x3ca191){logger[_0x04b5('0xb')](_0x04b5('0x15'),_0x12d801);logger[_0x04b5('0xe')](_0x04b5('0x15'),_0x12d801,JSON[_0x04b5('0x10')](_0x3ca191));_0x293b5f(_0x3ca191);})[_0x04b5('0x20')](function(_0x418fc9){logger[_0x04b5('0x11')](_0x04b5('0x15'),_0x418fc9['message'],_0x12d801);_0x13bc23(_0x14b457[_0x04b5('0x11')](0x1f4,_0x418fc9[_0x04b5('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x5e1028){var _0x13060f=this;return new Promise(function(_0x2777dc,_0xa8e74b){return db[_0x04b5('0x16')]['update'](_0x5e1028[_0x04b5('0x21')],{'raw':_0x5e1028[_0x04b5('0x18')]?_0x5e1028[_0x04b5('0x18')][_0x04b5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1028[_0x04b5('0x18')]?_0x5e1028['options'][_0x04b5('0x1a')]||null:null,'attributes':_0x5e1028[_0x04b5('0x18')]?_0x5e1028[_0x04b5('0x18')][_0x04b5('0x1b')]||null:null,'limit':_0x5e1028[_0x04b5('0x18')]?_0x5e1028[_0x04b5('0x18')][_0x04b5('0x1c')]||null:null})[_0x04b5('0xa')](function(_0x3dffc4){logger[_0x04b5('0xb')](_0x04b5('0x22'),_0x5e1028);logger['debug'](_0x04b5('0x22'),_0x5e1028,JSON[_0x04b5('0x10')](_0x3dffc4));_0x2777dc(_0x3dffc4);})[_0x04b5('0x20')](function(_0x3d723a){logger['error'](_0x04b5('0x22'),_0x3d723a[_0x04b5('0x13')],_0x5e1028);_0xa8e74b(_0x13060f[_0x04b5('0x11')](0x1f4,_0x3d723a[_0x04b5('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x18e41b){var _0x4c12ab=this;return new Promise(function(_0x3e040e,_0x4d4387){return db[_0x04b5('0x16')][_0x04b5('0x23')]({'where':_0x18e41b[_0x04b5('0x18')]?_0x18e41b[_0x04b5('0x18')][_0x04b5('0x1a')]||null:null})['then'](function(_0x43580a){logger['info']('DestroyCmHopperBlack',_0x18e41b);logger[_0x04b5('0xe')](_0x04b5('0x24'),_0x18e41b,JSON[_0x04b5('0x10')](_0x43580a));_0x3e040e(_0x43580a);})[_0x04b5('0x20')](function(_0x2409e8){logger[_0x04b5('0x11')](_0x04b5('0x24'),_0x2409e8[_0x04b5('0x13')],_0x18e41b);_0x4d4387(_0x4c12ab['error'](0x1f4,_0x2409e8['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 785555d..605d97c 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 _0xdf55=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x63e59d,_0x1696a7){var _0x5f4893=function(_0x351c15){while(--_0x351c15){_0x63e59d['push'](_0x63e59d['shift']());}};_0x5f4893(++_0x1696a7);}(_0xdf55,0x83));var _0x5df5=function(_0x4f8100,_0x928620){_0x4f8100=_0x4f8100-0x0;var _0x360262=_0xdf55[_0x4f8100];return _0x360262;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['put']('/:id',auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0xf')](_0x5df5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5df5('0x10')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','multer','util'];(function(_0x22ebf4,_0x3c039a){var _0x450f87=function(_0x54f42d){while(--_0x54f42d){_0x22ebf4['push'](_0x22ebf4['shift']());}};_0x450f87(++_0x3c039a);}(_0x814b,0x1a2));var _0xb814=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x814b[_0x4cc492];return _0x1f36b9;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index cd4a305..35331cd 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 _0x20c1=['setDataValue','diff','seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x151d9d,_0x577d53){var _0x2e75df=function(_0x37b200){while(--_0x37b200){_0x151d9d['push'](_0x151d9d['shift']());}};_0x2e75df(++_0x577d53);}(_0x20c1,0xeb));var _0x120c=function(_0x4bbd25,_0x322268){_0x4bbd25=_0x4bbd25-0x0;var _0x5d3d83=_0x20c1[_0x4bbd25];return _0x5d3d83;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x120c('0x0'));module[_0x120c('0x1')]={'state':{'type':Sequelize[_0x120c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x120c('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x120c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x120c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x120c('0x3')]},'calleridnum':{'type':Sequelize[_0x120c('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x120c('0x4')]},'responsetime':{'type':Sequelize[_0x120c('0x4')]},'answertime':{'type':Sequelize[_0x120c('0x4')]},'droptime':{'type':Sequelize[_0x120c('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x120c('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x120c('0x3')]},'reason':{'type':Sequelize[_0x120c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x120c('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x120c('0x4')],'set':function(_0x57849c){var _0x23ded3=this[_0x120c('0x5')](_0x120c('0x6'));if(_0x23ded3&&_0x57849c){this[_0x120c('0x7')]('followuptime',moment(_0x57849c)[_0x120c('0x8')](moment(_0x23ded3),_0x120c('0x9')));}return this[_0x120c('0x7')]('dispositionat',_0x57849c);}},'amd':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x120c('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x120c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x120c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x68da=['moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x341919,_0x332fb5){var _0x58fac1=function(_0x58ef8b){while(--_0x58ef8b){_0x341919['push'](_0x341919['shift']());}};_0x58fac1(++_0x332fb5);}(_0x68da,0x15d));var _0xa68d=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0x68da[_0xcfeff4];return _0xb2fadc;};'use strict';var Sequelize=require(_0xa68d('0x0'));var moment=require(_0xa68d('0x1'));module[_0xa68d('0x2')]={'state':{'type':Sequelize[_0xa68d('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa68d('0x4')]},'countbusyretry':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa68d('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xa68d('0x5')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa68d('0x5')]},'calleridname':{'type':Sequelize[_0xa68d('0x5')]},'starttime':{'type':Sequelize[_0xa68d('0x4')]},'responsetime':{'type':Sequelize[_0xa68d('0x4')]},'answertime':{'type':Sequelize[_0xa68d('0x4')]},'droptime':{'type':Sequelize[_0xa68d('0x4')]},'endtime':{'type':Sequelize[_0xa68d('0x4')]},'ringtime':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa68d('0x5')]},'campaign':{'type':Sequelize[_0xa68d('0x5')]},'campaigntype':{'type':Sequelize[_0xa68d('0x5')]},'membername':{'type':Sequelize[_0xa68d('0x5')]},'reason':{'type':Sequelize[_0xa68d('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa68d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xa68d('0x4')],'set':function(_0x52ccc4){var _0xfa5cc0=this[_0xa68d('0x6')](_0xa68d('0x7'));if(_0xfa5cc0&&_0x52ccc4){this[_0xa68d('0x8')](_0xa68d('0x9'),moment(_0x52ccc4)[_0xa68d('0xa')](moment(_0xfa5cc0),_0xa68d('0xb')));}return this['setDataValue'](_0xa68d('0xc'),_0x52ccc4);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa68d('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa68d('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa68d('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa68d('0x4')]},'callback':{'type':Sequelize[_0xa68d('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa68d('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa68d('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa68d('0x4')]},'recallme':{'type':Sequelize[_0xa68d('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa68d('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa68d('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa68d('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 3883aad..f3d9a4e 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 _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xdaddd0,_0x438f28){var _0x301d05=function(_0x2dead8){while(--_0x2dead8){_0xdaddd0['push'](_0xdaddd0['shift']());}};_0x301d05(++_0x438f28);}(_0x2a07,0x74));var _0x72a0=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x2a07[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file +var _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x2da658,_0x2c9473){var _0x4139c7=function(_0x7226){while(--_0x7226){_0x2da658['push'](_0x2da658['shift']());}};_0x4139c7(++_0x2c9473);}(_0xd117,0x182));var _0x7d11=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0xd117[_0x51639a];return _0x3abae4;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c282247..6e0eaa5 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 _0x0b78=['define','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0xc1bc9,_0x33c932){var _0x3973f2=function(_0x386a24){while(--_0x386a24){_0xc1bc9['push'](_0xc1bc9['shift']());}};_0x3973f2(++_0x33c932);}(_0x0b78,0x1b7));var _0x80b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b78[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x80b7('0x0'));var util=require('util');var logger=require(_0x80b7('0x1'))(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require(_0x80b7('0x4'));var rp=require(_0x80b7('0x5'));var fs=require('fs');var path=require(_0x80b7('0x6'));var rimraf=require(_0x80b7('0x7'));var config=require(_0x80b7('0x8'));var attributes=require(_0x80b7('0x9'));module[_0x80b7('0xa')]=function(_0x364fe7,_0x25f5f1){return _0x364fe7[_0x80b7('0xb')]('CmHopperFinal',attributes,{'tableName':_0x80b7('0xc'),'paranoid':![],'indexes':[{'name':_0x80b7('0xd'),'fields':[_0x80b7('0xd')]},{'name':_0x80b7('0xe'),'fields':[_0x80b7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x74a1=['path','../../config/environment','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x74a1,0x13f));var _0x174a=function(_0x11ed52,_0xe2c31f){_0x11ed52=_0x11ed52-0x0;var _0xeee5ea=_0x74a1[_0x11ed52];return _0xeee5ea;};'use strict';var _=require(_0x174a('0x0'));var util=require(_0x174a('0x1'));var logger=require(_0x174a('0x2'))(_0x174a('0x3'));var moment=require(_0x174a('0x4'));var BPromise=require('bluebird');var rp=require(_0x174a('0x5'));var fs=require('fs');var path=require(_0x174a('0x6'));var rimraf=require('rimraf');var config=require(_0x174a('0x7'));var attributes=require(_0x174a('0x8'));module[_0x174a('0x9')]=function(_0x487ca2,_0x16b612){return _0x487ca2[_0x174a('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x174a('0xb'),'fields':[_0x174a('0xb')]},{'name':_0x174a('0xc'),'fields':[_0x174a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 72535eb..36f0ac5 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(_0x290caf,_0x40381c){var _0x1b13e6=function(_0xc292ca){while(--_0xc292ca){_0x290caf['push'](_0x290caf['shift']());}};_0x1b13e6(++_0x40381c);}(_0xb10b,0x12a));var _0xbb10=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0xb10b[_0x32a81f];return _0x5b67a2;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5d92da,_0xe9723a){var _0x24fe12=function(_0x43bfb5){while(--_0x43bfb5){_0x5d92da['push'](_0x5d92da['shift']());}};_0x24fe12(++_0xe9723a);}(_0x7a54,0x106));var _0x47a5=function(_0x2b1e4f,_0x5e3229){_0x2b1e4f=_0x2b1e4f-0x0;var _0x501c33=_0x7a54[_0x2b1e4f];return _0x501c33;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 193259d..4207249 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 _0x7373=['/describe','isAuthenticated','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','index'];(function(_0x55ae74,_0x5e5f2b){var _0x426b4c=function(_0x4b1c19){while(--_0x4b1c19){_0x55ae74['push'](_0x55ae74['shift']());}};_0x426b4c(++_0x5e5f2b);}(_0x7373,0x1db));var _0x3737=function(_0x22854f,_0x2aac13){_0x22854f=_0x22854f-0x0;var _0xf397e0=_0x7373[_0x22854f];return _0xf397e0;};'use strict';var multer=require(_0x3737('0x0'));var util=require('util');var path=require(_0x3737('0x1'));var timeout=require(_0x3737('0x2'));var express=require(_0x3737('0x3'));var router=express[_0x3737('0x4')]();var fs_extra=require(_0x3737('0x5'));var auth=require(_0x3737('0x6'));var interaction=require(_0x3737('0x7'));var config=require('../../config/environment');var controller=require(_0x3737('0x8'));router[_0x3737('0x9')]('/',auth['isAuthenticated'](),controller[_0x3737('0xa')]);router[_0x3737('0x9')](_0x3737('0xb'),auth[_0x3737('0xc')](),controller[_0x3737('0xd')]);router['get'](_0x3737('0xe'),auth[_0x3737('0xc')](),controller['show']);router['get']('/voice/queue/countAttributes/:id',auth[_0x3737('0xc')](),controller[_0x3737('0xf')]);router[_0x3737('0x9')](_0x3737('0x10'),auth[_0x3737('0xc')](),controller[_0x3737('0x11')]);router[_0x3737('0x12')](_0x3737('0x13'),auth[_0x3737('0xc')](),controller[_0x3737('0x14')]);router['post'](_0x3737('0x15'),auth[_0x3737('0xc')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x3737('0x12')](_0x3737('0x16'),auth[_0x3737('0xc')](),controller[_0x3737('0x17')]);router[_0x3737('0x18')](_0x3737('0xe'),auth[_0x3737('0xc')](),controller[_0x3737('0x19')]);module[_0x3737('0x1a')]=router; \ No newline at end of file +var _0xffad=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','connect-timeout','express','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x13b5ad,_0x4a8940){var _0x53fd45=function(_0x5ec1c0){while(--_0x5ec1c0){_0x13b5ad['push'](_0x13b5ad['shift']());}};_0x53fd45(++_0x4a8940);}(_0xffad,0x175));var _0xdffa=function(_0x588794,_0x130e43){_0x588794=_0x588794-0x0;var _0x51032e=_0xffad[_0x588794];return _0x51032e;};'use strict';var multer=require(_0xdffa('0x0'));var util=require(_0xdffa('0x1'));var path=require('path');var timeout=require(_0xdffa('0x2'));var express=require(_0xdffa('0x3'));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(_0xdffa('0x4'));var controller=require(_0xdffa('0x5'));router['get']('/',auth[_0xdffa('0x6')](),controller[_0xdffa('0x7')]);router['get'](_0xdffa('0x8'),auth[_0xdffa('0x6')](),controller[_0xdffa('0x9')]);router[_0xdffa('0xa')](_0xdffa('0xb'),auth[_0xdffa('0x6')](),controller[_0xdffa('0xc')]);router[_0xdffa('0xa')](_0xdffa('0xd'),auth[_0xdffa('0x6')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0xdffa('0xe'),auth[_0xdffa('0x6')](),controller[_0xdffa('0xf')]);router[_0xdffa('0x10')](_0xdffa('0x11'),auth[_0xdffa('0x6')](),controller[_0xdffa('0x12')]);router[_0xdffa('0x10')](_0xdffa('0x13'),auth['isAuthenticated'](),controller[_0xdffa('0x14')]);router[_0xdffa('0x10')](_0xdffa('0x15'),auth[_0xdffa('0x6')](),controller[_0xdffa('0x16')]);router[_0xdffa('0x17')](_0xdffa('0xb'),auth[_0xdffa('0x6')](),controller[_0xdffa('0x18')]);module[_0xdffa('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9525660..733ffc1 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 _0x1d37=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x1a0d62,_0x5c9c35){var _0x240a6a=function(_0x89f8c2){while(--_0x89f8c2){_0x1a0d62['push'](_0x1a0d62['shift']());}};_0x240a6a(++_0x5c9c35);}(_0x1d37,0xa2));var _0x71d3=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x1d37[_0x4310e8];return _0x301445;};'use strict';var Sequelize=require(_0x71d3('0x0'));module[_0x71d3('0x1')]={'state':{'type':Sequelize[_0x71d3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x71d3('0x3')]},'scheduledat':{'type':Sequelize[_0x71d3('0x4')]},'countbusyretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x71d3('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x71d3('0x3')]},'calleridnum':{'type':Sequelize[_0x71d3('0x3')]},'calleridname':{'type':Sequelize[_0x71d3('0x3')]},'starttime':{'type':Sequelize[_0x71d3('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x71d3('0x4')]},'droptime':{'type':Sequelize[_0x71d3('0x4')]},'endtime':{'type':Sequelize[_0x71d3('0x4')]},'ringtime':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x71d3('0x3')]},'campaign':{'type':Sequelize[_0x71d3('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x71d3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x71d3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x71d3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x71d3('0x4')]},'edited':{'type':Sequelize[_0x71d3('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x71d3('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x53e2=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x18ed72,_0x7607b){var _0x3b689d=function(_0x1a22aa){while(--_0x1a22aa){_0x18ed72['push'](_0x18ed72['shift']());}};_0x3b689d(++_0x7607b);}(_0x53e2,0x14e));var _0x253e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x253e('0x0'));module[_0x253e('0x1')]={'state':{'type':Sequelize[_0x253e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x253e('0x3')]},'scheduledat':{'type':Sequelize[_0x253e('0x4')]},'countbusyretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x253e('0x3')]},'originatecalleridname':{'type':Sequelize[_0x253e('0x3')]},'calleridnum':{'type':Sequelize[_0x253e('0x3')]},'calleridname':{'type':Sequelize[_0x253e('0x3')]},'starttime':{'type':Sequelize[_0x253e('0x4')]},'responsetime':{'type':Sequelize[_0x253e('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x253e('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x253e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x253e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x253e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x253e('0x4')]},'recallme':{'type':Sequelize[_0x253e('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x253e('0x4')]},'edited':{'type':Sequelize[_0x253e('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x253e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x253e('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 179c35a..929c77f 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 _0xda7e=['findAll','rows','catch','show','params','create','describe','body','uniqueid','find','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x215cd2,_0x51991d){var _0x594ea3=function(_0x29c029){while(--_0x29c029){_0x215cd2['push'](_0x215cd2['shift']());}};_0x594ea3(++_0x51991d);}(_0xda7e,0xa8));var _0xeda7=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0xda7e[_0x47604d];return _0x388e4c;};'use strict';var emlformat=require(_0xeda7('0x0'));var rimraf=require(_0xeda7('0x1'));var zipdir=require(_0xeda7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeda7('0x3'));var Mustache=require(_0xeda7('0x4'));var util=require(_0xeda7('0x5'));var path=require(_0xeda7('0x6'));var sox=require(_0xeda7('0x7'));var csv=require(_0xeda7('0x8'));var ejs=require(_0xeda7('0x9'));var fs=require('fs');var fs_extra=require(_0xeda7('0xa'));var _=require(_0xeda7('0xb'));var squel=require(_0xeda7('0xc'));var crypto=require(_0xeda7('0xd'));var jsforce=require(_0xeda7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeda7('0xf'));var Papa=require(_0xeda7('0x10'));var Redis=require(_0xeda7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeda7('0x12'));var as=require(_0xeda7('0x13'));var hardwareService=require(_0xeda7('0x14'));var logger=require(_0xeda7('0x15'))(_0xeda7('0x16'));var utils=require(_0xeda7('0x17'));var config=require(_0xeda7('0x18'));var licenseUtil=require(_0xeda7('0x19'));var db=require(_0xeda7('0x1a'))['db'];function respondWithStatusCode(_0x2742ff,_0x3ba18e){_0x3ba18e=_0x3ba18e||0xcc;return function(_0x547dd1){if(_0x547dd1){return _0x2742ff[_0xeda7('0x1b')](_0x3ba18e);}return _0x2742ff['status'](_0x3ba18e)[_0xeda7('0x1c')]();};}function respondWithResult(_0x596315,_0x235363){_0x235363=_0x235363||0xc8;return function(_0xd1163d){if(_0xd1163d){return _0x596315[_0xeda7('0x1d')](_0x235363)[_0xeda7('0x1e')](_0xd1163d);}};}function respondWithFilteredResult(_0x5173be,_0x1cf8de){return function(_0x23ccd4){if(_0x23ccd4){var _0x476f88=typeof _0x1cf8de[_0xeda7('0x1f')]==='undefined'&&typeof _0x1cf8de[_0xeda7('0x20')]===_0xeda7('0x21');var _0x193d15=_0x23ccd4[_0xeda7('0x22')];var _0x35c7a9=_0x476f88?0x0:_0x1cf8de[_0xeda7('0x1f')];var _0x4213b7=_0x476f88?_0x23ccd4['count']:_0x1cf8de[_0xeda7('0x1f')]+_0x1cf8de[_0xeda7('0x20')];var _0x3967b1;if(_0x4213b7>=_0x193d15){_0x4213b7=_0x193d15;_0x3967b1=0xc8;}else{_0x3967b1=0xce;}_0x5173be[_0xeda7('0x1d')](_0x3967b1);return _0x5173be[_0xeda7('0x23')](_0xeda7('0x24'),_0x35c7a9+'-'+_0x4213b7+'/'+_0x193d15)['json'](_0x23ccd4);}return null;};}function patchUpdates(_0x3c3890){return function(_0x1d5747){try{jsonpatch[_0xeda7('0x25')](_0x1d5747,_0x3c3890,!![]);}catch(_0x5d545e){return BPromise['reject'](_0x5d545e);}return _0x1d5747[_0xeda7('0x26')]();};}function saveUpdates(_0x405b35,_0x599e5f){return function(_0x575e24){if(_0x575e24){return _0x575e24[_0xeda7('0x27')](_0x405b35)[_0xeda7('0x28')](function(_0x58ddc7){return _0x58ddc7;});}return null;};}function removeEntity(_0x19a06c,_0x3e657d){return function(_0x429dfa){if(_0x429dfa){return _0x429dfa['destroy']()['then'](function(){_0x19a06c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2199f3,_0x1ef118){return function(_0x437ee6){if(!_0x437ee6){_0x2199f3[_0xeda7('0x1b')](0x194);}return _0x437ee6;};}function handleError(_0x38fe9b,_0x43193e){_0x43193e=_0x43193e||0x1f4;return function(_0x46225a){logger[_0xeda7('0x29')](_0x46225a[_0xeda7('0x2a')]);if(_0x46225a[_0xeda7('0x2b')]){delete _0x46225a['name'];}_0x38fe9b[_0xeda7('0x1d')](_0x43193e)['send'](_0x46225a);};}exports[_0xeda7('0x2c')]=function(_0x427a6d,_0x3707a4){var _0x5a9845={},_0x43f93d={},_0x52266c={'count':0x0,'rows':[]};var _0x514d3a=_[_0xeda7('0x2d')](db[_0xeda7('0x2e')][_0xeda7('0x2f')],function(_0x2e744c){return{'name':_0x2e744c[_0xeda7('0x30')],'type':_0x2e744c[_0xeda7('0x31')][_0xeda7('0x32')]};});_0x43f93d[_0xeda7('0x33')]=_[_0xeda7('0x2d')](_0x514d3a,'name');_0x43f93d[_0xeda7('0x34')]=_[_0xeda7('0x35')](_0x427a6d[_0xeda7('0x34')]);_0x43f93d[_0xeda7('0x36')]=_[_0xeda7('0x37')](_0x43f93d[_0xeda7('0x33')],_0x43f93d[_0xeda7('0x34')]);_0x5a9845[_0xeda7('0x38')]=_[_0xeda7('0x37')](_0x43f93d['model'],qs[_0xeda7('0x39')](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x39')]));_0x5a9845[_0xeda7('0x38')]=_0x5a9845[_0xeda7('0x38')][_0xeda7('0x3a')]?_0x5a9845['attributes']:_0x43f93d['model'];if(!_0x427a6d[_0xeda7('0x34')][_0xeda7('0x3b')]('nolimit')){_0x5a9845[_0xeda7('0x20')]=qs[_0xeda7('0x20')](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x20')]);_0x5a9845[_0xeda7('0x1f')]=qs['offset'](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x1f')]);}_0x5a9845[_0xeda7('0x3c')]=qs[_0xeda7('0x3d')](_0x427a6d[_0xeda7('0x34')][_0xeda7('0x3d')]);_0x5a9845[_0xeda7('0x3e')]=qs[_0xeda7('0x36')](_[_0xeda7('0x3f')](_0x427a6d[_0xeda7('0x34')],_0x43f93d['filters']),_0x514d3a);if(_0x427a6d['query'][_0xeda7('0x40')]){_0x5a9845['where']=_[_0xeda7('0x41')](_0x5a9845['where'],{'$or':_[_0xeda7('0x2d')](_0x514d3a,function(_0x2a4d51){if(_0x2a4d51[_0xeda7('0x31')]!=='VIRTUAL'){var _0x36c03d={};_0x36c03d[_0x2a4d51[_0xeda7('0x2b')]]={'$like':'%'+_0x427a6d[_0xeda7('0x34')][_0xeda7('0x40')]+'%'};return _0x36c03d;}})});}_0x5a9845=_[_0xeda7('0x41')]({},_0x5a9845,_0x427a6d[_0xeda7('0x42')]);var _0x4ff0ef={'where':_0x5a9845[_0xeda7('0x3e')]};return db[_0xeda7('0x2e')][_0xeda7('0x22')](_0x4ff0ef)['then'](function(_0x1ca90d){_0x52266c[_0xeda7('0x22')]=_0x1ca90d;if(_0x427a6d[_0xeda7('0x34')][_0xeda7('0x43')]){_0x5a9845[_0xeda7('0x44')]=[{'all':!![]}];}return db[_0xeda7('0x2e')][_0xeda7('0x45')](_0x5a9845);})[_0xeda7('0x28')](function(_0x3f35e6){_0x52266c[_0xeda7('0x46')]=_0x3f35e6;return _0x52266c;})[_0xeda7('0x28')](respondWithFilteredResult(_0x3707a4,_0x5a9845))[_0xeda7('0x47')](handleError(_0x3707a4,null));};exports[_0xeda7('0x48')]=function(_0x683b4c,_0x1a8255){var _0x25dd6a={'raw':!![],'where':{'id':_0x683b4c[_0xeda7('0x49')]['id']}},_0x1dcf5b={};_0x1dcf5b['model']=_['keys'](db[_0xeda7('0x2e')]['rawAttributes']);_0x1dcf5b[_0xeda7('0x34')]=_[_0xeda7('0x35')](_0x683b4c[_0xeda7('0x34')]);_0x1dcf5b[_0xeda7('0x36')]=_[_0xeda7('0x37')](_0x1dcf5b[_0xeda7('0x33')],_0x1dcf5b[_0xeda7('0x34')]);_0x25dd6a[_0xeda7('0x38')]=_[_0xeda7('0x37')](_0x1dcf5b[_0xeda7('0x33')],qs[_0xeda7('0x39')](_0x683b4c[_0xeda7('0x34')]['fields']));_0x25dd6a[_0xeda7('0x38')]=_0x25dd6a[_0xeda7('0x38')][_0xeda7('0x3a')]?_0x25dd6a[_0xeda7('0x38')]:_0x1dcf5b[_0xeda7('0x33')];if(_0x683b4c[_0xeda7('0x34')]['includeAll']){_0x25dd6a['include']=[{'all':!![]}];}_0x25dd6a=_['merge']({},_0x25dd6a,_0x683b4c[_0xeda7('0x42')]);return db[_0xeda7('0x2e')]['find'](_0x25dd6a)[_0xeda7('0x28')](handleEntityNotFound(_0x1a8255,null))[_0xeda7('0x28')](respondWithResult(_0x1a8255,null))[_0xeda7('0x47')](handleError(_0x1a8255,null));};exports[_0xeda7('0x4a')]=function(_0x24c4b8,_0x2195a5){return db[_0xeda7('0x2e')][_0xeda7('0x4a')](_0x24c4b8['body'],{})['then'](respondWithResult(_0x2195a5,0xc9))['catch'](handleError(_0x2195a5,null));};exports['describe']=function(_0x4759a2,_0x16ca63){return db['CmHopperHistory'][_0xeda7('0x4b')]()['then'](respondWithResult(_0x16ca63,null))[_0xeda7('0x47')](handleError(_0x16ca63,null));};exports[_0xeda7('0x27')]=function(_0x511205,_0x1d73a0){if(_0x511205[_0xeda7('0x4c')]['uniqueid']){delete _0x511205[_0xeda7('0x4c')][_0xeda7('0x4d')];}return db[_0xeda7('0x2e')][_0xeda7('0x4e')]({'where':{'uniqueid':_0x511205[_0xeda7('0x49')]['id']}})[_0xeda7('0x28')](handleEntityNotFound(_0x1d73a0,null))[_0xeda7('0x28')](saveUpdates(_0x511205['body'],null))[_0xeda7('0x28')](respondWithResult(_0x1d73a0,null))[_0xeda7('0x47')](handleError(_0x1d73a0,null));}; \ No newline at end of file +var _0xe6db=['order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','describe','body','eml-format','rimraf','fast-json-patch','request-promise','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','CmHopperHistory','fieldName','type','key','model','map','query','intersection','attributes','fields','nolimit'];(function(_0x2c6e7c,_0x422235){var _0x376d42=function(_0x41441b){while(--_0x41441b){_0x2c6e7c['push'](_0x2c6e7c['shift']());}};_0x376d42(++_0x422235);}(_0xe6db,0xb2));var _0xbe6d=function(_0x9b8ece,_0xe835cb){_0x9b8ece=_0x9b8ece-0x0;var _0x53ea6d=_0xe6db[_0x9b8ece];return _0x53ea6d;};'use strict';var emlformat=require(_0xbe6d('0x0'));var rimraf=require(_0xbe6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe6d('0x2'));var rp=require(_0xbe6d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbe6d('0x4'));var util=require(_0xbe6d('0x5'));var path=require(_0xbe6d('0x6'));var sox=require(_0xbe6d('0x7'));var csv=require(_0xbe6d('0x8'));var ejs=require(_0xbe6d('0x9'));var fs=require('fs');var fs_extra=require(_0xbe6d('0xa'));var _=require(_0xbe6d('0xb'));var squel=require(_0xbe6d('0xc'));var crypto=require(_0xbe6d('0xd'));var jsforce=require(_0xbe6d('0xe'));var deskjs=require(_0xbe6d('0xf'));var toCsv=require(_0xbe6d('0x8'));var querystring=require(_0xbe6d('0x10'));var Papa=require(_0xbe6d('0x11'));var Redis=require(_0xbe6d('0x12'));var authService=require(_0xbe6d('0x13'));var qs=require(_0xbe6d('0x14'));var as=require(_0xbe6d('0x15'));var hardwareService=require(_0xbe6d('0x16'));var logger=require('../../config/logger')(_0xbe6d('0x17'));var utils=require('../../config/utils');var config=require(_0xbe6d('0x18'));var licenseUtil=require(_0xbe6d('0x19'));var db=require(_0xbe6d('0x1a'))['db'];function respondWithStatusCode(_0x15df5a,_0x165e96){_0x165e96=_0x165e96||0xcc;return function(_0x1a3ec7){if(_0x1a3ec7){return _0x15df5a[_0xbe6d('0x1b')](_0x165e96);}return _0x15df5a[_0xbe6d('0x1c')](_0x165e96)[_0xbe6d('0x1d')]();};}function respondWithResult(_0x163e28,_0x581a98){_0x581a98=_0x581a98||0xc8;return function(_0x294239){if(_0x294239){return _0x163e28[_0xbe6d('0x1c')](_0x581a98)[_0xbe6d('0x1e')](_0x294239);}};}function respondWithFilteredResult(_0xadbac4,_0x4f3681){return function(_0x3552f8){if(_0x3552f8){var _0x2acb69=typeof _0x4f3681[_0xbe6d('0x1f')]==='undefined'&&typeof _0x4f3681[_0xbe6d('0x20')]===_0xbe6d('0x21');var _0x272f20=_0x3552f8[_0xbe6d('0x22')];var _0x5328f2=_0x2acb69?0x0:_0x4f3681['offset'];var _0x4be41a=_0x2acb69?_0x3552f8[_0xbe6d('0x22')]:_0x4f3681[_0xbe6d('0x1f')]+_0x4f3681[_0xbe6d('0x20')];var _0x153417;if(_0x4be41a>=_0x272f20){_0x4be41a=_0x272f20;_0x153417=0xc8;}else{_0x153417=0xce;}_0xadbac4['status'](_0x153417);return _0xadbac4[_0xbe6d('0x23')](_0xbe6d('0x24'),_0x5328f2+'-'+_0x4be41a+'/'+_0x272f20)[_0xbe6d('0x1e')](_0x3552f8);}return null;};}function patchUpdates(_0x3835d1){return function(_0x2dbef6){try{jsonpatch[_0xbe6d('0x25')](_0x2dbef6,_0x3835d1,!![]);}catch(_0x3bc885){return BPromise[_0xbe6d('0x26')](_0x3bc885);}return _0x2dbef6[_0xbe6d('0x27')]();};}function saveUpdates(_0xbd7631,_0x42ea97){return function(_0x502e1e){if(_0x502e1e){return _0x502e1e[_0xbe6d('0x28')](_0xbd7631)[_0xbe6d('0x29')](function(_0xae2234){return _0xae2234;});}return null;};}function removeEntity(_0xb2115,_0x1d9c5b){return function(_0xf85b8f){if(_0xf85b8f){return _0xf85b8f['destroy']()['then'](function(){_0xb2115[_0xbe6d('0x1c')](0xcc)[_0xbe6d('0x1d')]();});}};}function handleEntityNotFound(_0x1f794d,_0xf3f28e){return function(_0x4e06fb){if(!_0x4e06fb){_0x1f794d[_0xbe6d('0x1b')](0x194);}return _0x4e06fb;};}function handleError(_0x636acf,_0x2a95ac){_0x2a95ac=_0x2a95ac||0x1f4;return function(_0x4db198){logger['error'](_0x4db198[_0xbe6d('0x2a')]);if(_0x4db198[_0xbe6d('0x2b')]){delete _0x4db198['name'];}_0x636acf['status'](_0x2a95ac)[_0xbe6d('0x2c')](_0x4db198);};}exports['index']=function(_0x1ab01d,_0x254787){var _0x1a5920={},_0x31c3ad={},_0x6b769a={'count':0x0,'rows':[]};var _0x15849b=_['map'](db[_0xbe6d('0x2d')]['rawAttributes'],function(_0x92238e){return{'name':_0x92238e[_0xbe6d('0x2e')],'type':_0x92238e[_0xbe6d('0x2f')][_0xbe6d('0x30')]};});_0x31c3ad[_0xbe6d('0x31')]=_[_0xbe6d('0x32')](_0x15849b,_0xbe6d('0x2b'));_0x31c3ad[_0xbe6d('0x33')]=_['keys'](_0x1ab01d[_0xbe6d('0x33')]);_0x31c3ad['filters']=_[_0xbe6d('0x34')](_0x31c3ad['model'],_0x31c3ad[_0xbe6d('0x33')]);_0x1a5920[_0xbe6d('0x35')]=_[_0xbe6d('0x34')](_0x31c3ad[_0xbe6d('0x31')],qs[_0xbe6d('0x36')](_0x1ab01d[_0xbe6d('0x33')][_0xbe6d('0x36')]));_0x1a5920[_0xbe6d('0x35')]=_0x1a5920[_0xbe6d('0x35')]['length']?_0x1a5920[_0xbe6d('0x35')]:_0x31c3ad[_0xbe6d('0x31')];if(!_0x1ab01d[_0xbe6d('0x33')]['hasOwnProperty'](_0xbe6d('0x37'))){_0x1a5920['limit']=qs[_0xbe6d('0x20')](_0x1ab01d[_0xbe6d('0x33')]['limit']);_0x1a5920[_0xbe6d('0x1f')]=qs[_0xbe6d('0x1f')](_0x1ab01d['query'][_0xbe6d('0x1f')]);}_0x1a5920[_0xbe6d('0x38')]=qs[_0xbe6d('0x39')](_0x1ab01d['query'][_0xbe6d('0x39')]);_0x1a5920['where']=qs[_0xbe6d('0x3a')](_[_0xbe6d('0x3b')](_0x1ab01d[_0xbe6d('0x33')],_0x31c3ad[_0xbe6d('0x3a')]),_0x15849b);if(_0x1ab01d[_0xbe6d('0x33')]['filter']){_0x1a5920[_0xbe6d('0x3c')]=_[_0xbe6d('0x3d')](_0x1a5920[_0xbe6d('0x3c')],{'$or':_[_0xbe6d('0x32')](_0x15849b,function(_0x139584){if(_0x139584[_0xbe6d('0x2f')]!==_0xbe6d('0x3e')){var _0x4e80a7={};_0x4e80a7[_0x139584['name']]={'$like':'%'+_0x1ab01d['query'][_0xbe6d('0x3f')]+'%'};return _0x4e80a7;}})});}_0x1a5920=_['merge']({},_0x1a5920,_0x1ab01d[_0xbe6d('0x40')]);var _0x1846a6={'where':_0x1a5920[_0xbe6d('0x3c')]};return db['CmHopperHistory'][_0xbe6d('0x22')](_0x1846a6)[_0xbe6d('0x29')](function(_0x155c53){_0x6b769a[_0xbe6d('0x22')]=_0x155c53;if(_0x1ab01d[_0xbe6d('0x33')]['includeAll']){_0x1a5920[_0xbe6d('0x41')]=[{'all':!![]}];}return db[_0xbe6d('0x2d')][_0xbe6d('0x42')](_0x1a5920);})[_0xbe6d('0x29')](function(_0x35a08b){_0x6b769a[_0xbe6d('0x43')]=_0x35a08b;return _0x6b769a;})[_0xbe6d('0x29')](respondWithFilteredResult(_0x254787,_0x1a5920))[_0xbe6d('0x44')](handleError(_0x254787,null));};exports[_0xbe6d('0x45')]=function(_0x19517b,_0x44ce96){var _0x55e9a9={'raw':!![],'where':{'id':_0x19517b[_0xbe6d('0x46')]['id']}},_0xb24f5={};_0xb24f5[_0xbe6d('0x31')]=_[_0xbe6d('0x47')](db[_0xbe6d('0x2d')]['rawAttributes']);_0xb24f5[_0xbe6d('0x33')]=_[_0xbe6d('0x47')](_0x19517b[_0xbe6d('0x33')]);_0xb24f5[_0xbe6d('0x3a')]=_[_0xbe6d('0x34')](_0xb24f5['model'],_0xb24f5[_0xbe6d('0x33')]);_0x55e9a9[_0xbe6d('0x35')]=_[_0xbe6d('0x34')](_0xb24f5[_0xbe6d('0x31')],qs[_0xbe6d('0x36')](_0x19517b['query'][_0xbe6d('0x36')]));_0x55e9a9['attributes']=_0x55e9a9[_0xbe6d('0x35')][_0xbe6d('0x48')]?_0x55e9a9[_0xbe6d('0x35')]:_0xb24f5[_0xbe6d('0x31')];if(_0x19517b[_0xbe6d('0x33')][_0xbe6d('0x49')]){_0x55e9a9[_0xbe6d('0x41')]=[{'all':!![]}];}_0x55e9a9=_[_0xbe6d('0x3d')]({},_0x55e9a9,_0x19517b[_0xbe6d('0x40')]);return db[_0xbe6d('0x2d')][_0xbe6d('0x4a')](_0x55e9a9)[_0xbe6d('0x29')](handleEntityNotFound(_0x44ce96,null))[_0xbe6d('0x29')](respondWithResult(_0x44ce96,null))[_0xbe6d('0x44')](handleError(_0x44ce96,null));};exports[_0xbe6d('0x4b')]=function(_0x487902,_0x2dd851){return db['CmHopperHistory'][_0xbe6d('0x4b')](_0x487902['body'],{})[_0xbe6d('0x29')](respondWithResult(_0x2dd851,0xc9))[_0xbe6d('0x44')](handleError(_0x2dd851,null));};exports[_0xbe6d('0x4c')]=function(_0x33267e,_0x2e84a1){return db[_0xbe6d('0x2d')][_0xbe6d('0x4c')]()[_0xbe6d('0x29')](respondWithResult(_0x2e84a1,null))[_0xbe6d('0x44')](handleError(_0x2e84a1,null));};exports['update']=function(_0x2b5cee,_0x369396){if(_0x2b5cee['body']['uniqueid']){delete _0x2b5cee[_0xbe6d('0x4d')]['uniqueid'];}return db[_0xbe6d('0x2d')]['find']({'where':{'uniqueid':_0x2b5cee[_0xbe6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x369396,null))[_0xbe6d('0x29')](saveUpdates(_0x2b5cee['body'],null))[_0xbe6d('0x29')](respondWithResult(_0x369396,null))['catch'](handleError(_0x369396,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 18e6a91..dd0e629 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 _0x419f=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x419f,0x176));var _0xf419=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x419f[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var logger=require(_0xf419('0x2'))(_0xf419('0x3'));var moment=require(_0xf419('0x4'));var BPromise=require(_0xf419('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf419('0x6'));var rimraf=require('rimraf');var config=require(_0xf419('0x7'));var attributes=require(_0xf419('0x8'));module[_0xf419('0x9')]=function(_0x38f2fa,_0x2d8430){return _0x38f2fa[_0xf419('0xa')](_0xf419('0xb'),attributes,{'tableName':_0xf419('0xc'),'paranoid':![],'indexes':[{'name':_0xf419('0xd'),'fields':['endtime']},{'name':_0xf419('0xe'),'fields':[_0xf419('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdab3=['moment','bluebird','request-promise','path','rimraf','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xdab3,0xeb));var _0x3dab=function(_0x52ddad,_0x154c16){_0x52ddad=_0x52ddad-0x0;var _0x589e64=_0xdab3[_0x52ddad];return _0x589e64;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var logger=require('../../config/logger')(_0x3dab('0x2'));var moment=require(_0x3dab('0x3'));var BPromise=require(_0x3dab('0x4'));var rp=require(_0x3dab('0x5'));var fs=require('fs');var path=require(_0x3dab('0x6'));var rimraf=require(_0x3dab('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x3dab('0x8')]=function(_0x2e95d1,_0x2e3718){return _0x2e95d1[_0x3dab('0x9')](_0x3dab('0xa'),attributes,{'tableName':_0x3dab('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x3dab('0xc')]},{'name':_0x3dab('0xd'),'fields':[_0x3dab('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index ccb85e0..6ddf30d 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 _0xe1ee=['message','request\x20sent','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','stringify','AvgHandleTime','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s'];(function(_0x625a7b,_0x4a31b5){var _0x103751=function(_0x272750){while(--_0x272750){_0x625a7b['push'](_0x625a7b['shift']());}};_0x103751(++_0x4a31b5);}(_0xe1ee,0x158));var _0xee1e=function(_0x1e7d80,_0x28ea35){_0x1e7d80=_0x1e7d80-0x0;var _0x1fb199=_0xe1ee[_0x1e7d80];return _0x1fb199;};'use strict';var _=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var moment=require('moment');var BPromise=require(_0xee1e('0x2'));var rs=require(_0xee1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee1e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee1e('0x6'));var client=jayson[_0xee1e('0x7')][_0xee1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dbd99,_0x4dcff2,_0x335d60){return new BPromise(function(_0x5d549e,_0x575700){return client['request'](_0x3dbd99,_0x335d60)[_0xee1e('0x9')](function(_0x14d58b){logger[_0xee1e('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4dcff2,'request\x20sent');logger[_0xee1e('0xb')](_0xee1e('0xc'),_0x4dcff2,'request\x20sent',JSON['stringify'](_0x14d58b));if(_0x14d58b[_0xee1e('0xd')]){if(_0x14d58b[_0xee1e('0xd')][_0xee1e('0xe')]===0x1f4){logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x14d58b['error'][_0xee1e('0x10')]);return _0x575700(_0x14d58b[_0xee1e('0xd')][_0xee1e('0x10')]);}logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x14d58b[_0xee1e('0xd')]['message']);return _0x5d549e(_0x14d58b[_0xee1e('0xd')]['message']);}else{logger[_0xee1e('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4dcff2,_0xee1e('0x11'));_0x5d549e(_0x14d58b['result'][_0xee1e('0x10')]);}})[_0xee1e('0x12')](function(_0x3f579f){logger[_0xee1e('0xd')](_0xee1e('0xf'),_0x4dcff2,_0x3f579f);_0x575700(_0x3f579f);});});}exports[_0xee1e('0x13')]=function(_0xd6cb33){var _0x518044=this;return new Promise(function(_0x2ceeb1,_0x20c0a1){return db[_0xee1e('0x14')][_0xee1e('0x15')](_0xd6cb33[_0xee1e('0x16')],{'raw':_0xd6cb33[_0xee1e('0x17')]?_0xd6cb33[_0xee1e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xee1e('0x9')](function(_0x21e0f5){logger['info'](_0xee1e('0x13'),_0xd6cb33);logger[_0xee1e('0xb')]('CreateCmHopperHistory',_0xd6cb33,JSON[_0xee1e('0x18')](_0x21e0f5));_0x2ceeb1(_0x21e0f5);})[_0xee1e('0x12')](function(_0x16df32){logger[_0xee1e('0xd')](_0xee1e('0x13'),_0x16df32[_0xee1e('0x10')],_0xd6cb33);_0x20c0a1(_0x518044['error'](0x1f4,_0x16df32[_0xee1e('0x10')]));});});};exports[_0xee1e('0x19')]=function(_0x2d5921){var _0x5c8d99=this;return new Promise(function(_0x1887c7,_0x17240c){return db[_0xee1e('0x14')]['findAll']({'raw':_0x2d5921['options']?_0x2d5921[_0xee1e('0x17')][_0xee1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d5921[_0xee1e('0x17')]?_0x2d5921[_0xee1e('0x17')][_0xee1e('0x1b')]||null:null,'attributes':[[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')][_0xee1e('0x1e')]('id')),_0xee1e('0x1f')],[db['sequelize']['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x21')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')]['literal'](_0xee1e('0x23')))),_0xee1e('0x24')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x25'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x26')))),_0xee1e('0x27')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x25'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x28')))),_0xee1e('0x29')]]})[_0xee1e('0x9')](function(_0x4ec8e2){logger[_0xee1e('0xa')](_0xee1e('0x19'),_0x2d5921);logger['debug'](_0xee1e('0x19'),_0x2d5921,JSON[_0xee1e('0x18')](_0x4ec8e2));_0x1887c7(_0x4ec8e2);})['catch'](function(_0x5bd318){logger['error'](_0xee1e('0x19'),_0x5bd318[_0xee1e('0x10')],_0x2d5921);_0x17240c(_0x5c8d99['error'](0x1f4,_0x5bd318[_0xee1e('0x10')]));});});};exports[_0xee1e('0x2a')]=function(_0x503607){var _0x26bde2=this;return new Promise(function(_0x5eeed6,_0x1aa62e){return db[_0xee1e('0x14')][_0xee1e('0x2b')]({'raw':_0x503607[_0xee1e('0x17')]?_0x503607[_0xee1e('0x17')][_0xee1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x503607['options']?_0x503607[_0xee1e('0x17')][_0xee1e('0x1b')]||null:null,'attributes':[['campaign',_0xee1e('0x2c')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x2d')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x2e')))),_0xee1e('0x2f')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xee1e('0x30')],[db[_0xee1e('0x1c')]['fn']('COUNT',db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x31')))),_0xee1e('0x32')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x33')))),'outboundCongestionCallsDay'],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x34')))),_0xee1e('0x35')],[db[_0xee1e('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xee1e('0x36')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x37')))),_0xee1e('0x38')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x39')))),_0xee1e('0x3a')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x3b')))),_0xee1e('0x3c')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db['sequelize']['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x3d')))),_0xee1e('0x3e')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x3f')))),_0xee1e('0x40')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x41')))),_0xee1e('0x3e')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db['sequelize'][_0xee1e('0x20')](_0xee1e('0x42')))),_0xee1e('0x43')]],'group':[_0xee1e('0x44')]})[_0xee1e('0x9')](function(_0x1fe0d9){logger[_0xee1e('0xa')]('GetVoiceQueueHopperHistory',_0x503607);logger[_0xee1e('0xb')]('GetVoiceQueueHopperHistory',_0x503607,JSON['stringify'](_0x1fe0d9));_0x5eeed6(_0x1fe0d9);})[_0xee1e('0x12')](function(_0x5bd396){logger[_0xee1e('0xd')]('GetVoiceQueueHopperHistory',_0x5bd396[_0xee1e('0x10')],_0x503607);_0x1aa62e(_0x26bde2[_0xee1e('0xd')](0x1f4,_0x5bd396['message']));});});};exports[_0xee1e('0x45')]=function(_0x39e73f){var _0x79f947=this;return new Promise(function(_0x266e07,_0x44ed17){return db[_0xee1e('0x14')][_0xee1e('0x2b')]({'raw':_0x39e73f[_0xee1e('0x17')]?_0x39e73f[_0xee1e('0x17')][_0xee1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x39e73f[_0xee1e('0x17')]?_0x39e73f[_0xee1e('0x17')][_0xee1e('0x1b')]||null:null,'attributes':[[_0xee1e('0x44'),'name'],[db['sequelize']['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['col']('id')),_0xee1e('0x46')],[db[_0xee1e('0x1c')]['fn'](_0xee1e('0x1d'),db[_0xee1e('0x1c')]['fn']('IF',db[_0xee1e('0x1c')][_0xee1e('0x20')](_0xee1e('0x21')))),_0xee1e('0x47')]],'group':['campaign']})[_0xee1e('0x9')](function(_0x1eb00c){logger[_0xee1e('0xa')]('GetCampaignHopperHistory',_0x39e73f);logger[_0xee1e('0xb')]('GetCampaignHopperHistory',_0x39e73f,JSON[_0xee1e('0x18')](_0x1eb00c));_0x266e07(_0x1eb00c);})[_0xee1e('0x12')](function(_0xb5e42c){logger['error']('GetCampaignHopperHistory',_0xb5e42c[_0xee1e('0x10')],_0x39e73f);_0x44ed17(_0x79f947[_0xee1e('0xd')](0x1f4,_0xb5e42c[_0xee1e('0x10')]));});});}; \ No newline at end of file +var _0xfaa4=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperHistory','create','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','stringify','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','where','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x3c9970,_0x2a46cc){_0x3c9970=_0x3c9970-0x0;var _0x249e86=_0xfaa4[_0x3c9970];return _0x249e86;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var moment=require(_0x4faa('0x2'));var BPromise=require(_0x4faa('0x3'));var rs=require(_0x4faa('0x4'));var fs=require('fs');var Redis=require(_0x4faa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4faa('0x6'));var logger=require(_0x4faa('0x7'))(_0x4faa('0x8'));var config=require(_0x4faa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4faa('0xa')][_0x4faa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa46a7d,_0x504f83,_0x528871){return new BPromise(function(_0x5d476f,_0x159843){return client[_0x4faa('0xc')](_0xa46a7d,_0x528871)[_0x4faa('0xd')](function(_0x4dd4d4){logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,_0x4faa('0x10'));logger[_0x4faa('0x11')](_0x4faa('0x12'),_0x504f83,'request\x20sent',JSON['stringify'](_0x4dd4d4));if(_0x4dd4d4[_0x4faa('0x13')]){if(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x14')]===0x1f4){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x159843(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);}logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x5d476f(_0x4dd4d4['error'][_0x4faa('0x15')]);}else{logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,'request\x20sent');_0x5d476f(_0x4dd4d4[_0x4faa('0x16')][_0x4faa('0x15')]);}})[_0x4faa('0x17')](function(_0x536a2b){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x536a2b);_0x159843(_0x536a2b);});});}exports['CreateCmHopperHistory']=function(_0x5d8c8a){var _0x5444d9=this;return new Promise(function(_0x33592d,_0x361cdc){return db[_0x4faa('0x18')][_0x4faa('0x19')](_0x5d8c8a['body'],{'raw':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![]})[_0x4faa('0xd')](function(_0x492417){logger[_0x4faa('0xe')]('CreateCmHopperHistory',_0x5d8c8a);logger['debug'](_0x4faa('0x1c'),_0x5d8c8a,JSON['stringify'](_0x492417));_0x33592d(_0x492417);})['catch'](function(_0x14683b){logger[_0x4faa('0x13')](_0x4faa('0x1c'),_0x14683b[_0x4faa('0x15')],_0x5d8c8a);_0x361cdc(_0x5444d9[_0x4faa('0x13')](0x1f4,_0x14683b[_0x4faa('0x15')]));});});};exports[_0x4faa('0x1d')]=function(_0x177774){var _0x5087ca=this;return new Promise(function(_0x1049a6,_0xe6992){return db['CmHopperHistory'][_0x4faa('0x1e')]({'raw':_0x177774[_0x4faa('0x1a')]?_0x177774[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![],'where':_0x177774['options']?_0x177774[_0x4faa('0x1a')]['where']||null:null,'attributes':[[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')][_0x4faa('0x21')]('id')),_0x4faa('0x22')],[db[_0x4faa('0x1f')]['fn']('COUNT',db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x24')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')]['literal'](_0x4faa('0x25')))),_0x4faa('0x26')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')]['literal'](_0x4faa('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x4faa('0x1f')]['fn']('AVG',db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x29'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x2a')))),_0x4faa('0x2b')]]})[_0x4faa('0xd')](function(_0x4ebbef){logger[_0x4faa('0xe')](_0x4faa('0x1d'),_0x177774);logger[_0x4faa('0x11')]('AvgHandleTime',_0x177774,JSON[_0x4faa('0x2c')](_0x4ebbef));_0x1049a6(_0x4ebbef);})[_0x4faa('0x17')](function(_0x244c22){logger[_0x4faa('0x13')](_0x4faa('0x1d'),_0x244c22[_0x4faa('0x15')],_0x177774);_0xe6992(_0x5087ca[_0x4faa('0x13')](0x1f4,_0x244c22[_0x4faa('0x15')]));});});};exports[_0x4faa('0x2d')]=function(_0x477313){var _0x39b9bc=this;return new Promise(function(_0x1e355e,_0x2e4a87){return db[_0x4faa('0x18')]['findAll']({'raw':_0x477313[_0x4faa('0x1a')]?_0x477313['options']['raw']===undefined?!![]:![]:!![],'where':_0x477313[_0x4faa('0x1a')]?_0x477313[_0x4faa('0x1a')]['where']||null:null,'attributes':[[_0x4faa('0x2e'),_0x4faa('0x2f')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db['sequelize'][_0x4faa('0x23')](_0x4faa('0x30')))),_0x4faa('0x31')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')]['literal'](_0x4faa('0x32')))),_0x4faa('0x33')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x24')))),_0x4faa('0x34')],[db['sequelize']['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x35')))),'outboundBusyCallsDay'],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db['sequelize'][_0x4faa('0x23')](_0x4faa('0x36')))),_0x4faa('0x37')],[db['sequelize']['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x38')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x4faa('0x39')))),_0x4faa('0x3a')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db['sequelize']['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0x4faa('0x3b')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x3c')))),_0x4faa('0x3d')],[db['sequelize']['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x3e')))),_0x4faa('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x40')))),_0x4faa('0x41')],[db['sequelize']['fn']('COUNT',db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db['sequelize'][_0x4faa('0x23')](_0x4faa('0x42')))),_0x4faa('0x41')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')]['fn']('IF',db[_0x4faa('0x1f')][_0x4faa('0x23')](_0x4faa('0x43')))),'outboundReCallsDay']],'group':[_0x4faa('0x2e')]})[_0x4faa('0xd')](function(_0x11f544){logger['info'](_0x4faa('0x2d'),_0x477313);logger['debug']('GetVoiceQueueHopperHistory',_0x477313,JSON['stringify'](_0x11f544));_0x1e355e(_0x11f544);})[_0x4faa('0x17')](function(_0x307eb2){logger['error'](_0x4faa('0x2d'),_0x307eb2[_0x4faa('0x15')],_0x477313);_0x2e4a87(_0x39b9bc[_0x4faa('0x13')](0x1f4,_0x307eb2[_0x4faa('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x47c3ab){var _0x3a43e3=this;return new Promise(function(_0x1462ba,_0x3cf67e){return db[_0x4faa('0x18')][_0x4faa('0x1e')]({'raw':_0x47c3ab['options']?_0x47c3ab[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![],'where':_0x47c3ab['options']?_0x47c3ab[_0x4faa('0x1a')][_0x4faa('0x44')]||null:null,'attributes':[['campaign',_0x4faa('0x2f')],[db[_0x4faa('0x1f')]['fn'](_0x4faa('0x20'),db[_0x4faa('0x1f')][_0x4faa('0x21')]('id')),'ivrTotalCallsDays'],[db[_0x4faa('0x1f')]['fn']('COUNT',db[_0x4faa('0x1f')]['fn']('IF',db['sequelize'][_0x4faa('0x23')](_0x4faa('0x24')))),_0x4faa('0x45')]],'group':['campaign']})['then'](function(_0x1cd9c8){logger['info'](_0x4faa('0x46'),_0x47c3ab);logger[_0x4faa('0x11')](_0x4faa('0x46'),_0x47c3ab,JSON[_0x4faa('0x2c')](_0x1cd9c8));_0x1462ba(_0x1cd9c8);})[_0x4faa('0x17')](function(_0x949e25){logger[_0x4faa('0x13')]('GetCampaignHopperHistory',_0x949e25[_0x4faa('0x15')],_0x47c3ab);_0x3cf67e(_0x3a43e3[_0x4faa('0x13')](0x1f4,_0x949e25[_0x4faa('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 2c71f62..9a65aa7 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 _0xb66d=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/:id','post','create','update','util'];(function(_0x1b484d,_0x349431){var _0x24f38b=function(_0x1c4c9b){while(--_0x1c4c9b){_0x1b484d['push'](_0x1b484d['shift']());}};_0x24f38b(++_0x349431);}(_0xb66d,0x67));var _0xdb66=function(_0x1486e5,_0x39684f){_0x1486e5=_0x1486e5-0x0;var _0x29d89b=_0xb66d[_0x1486e5];return _0x29d89b;};'use strict';var multer=require('multer');var util=require(_0xdb66('0x0'));var path=require('path');var timeout=require(_0xdb66('0x1'));var express=require(_0xdb66('0x2'));var router=express[_0xdb66('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdb66('0x4'));var config=require(_0xdb66('0x5'));var controller=require(_0xdb66('0x6'));router['get']('/',auth[_0xdb66('0x7')](),controller[_0xdb66('0x8')]);router['get']('/describe',auth[_0xdb66('0x7')](),controller['describe']);router['get'](_0xdb66('0x9'),auth[_0xdb66('0x7')](),controller['show']);router[_0xdb66('0xa')]('/',auth[_0xdb66('0x7')](),controller[_0xdb66('0xb')]);router['put'](_0xdb66('0x9'),auth[_0xdb66('0x7')](),controller[_0xdb66('0xc')]);module['exports']=router; \ No newline at end of file +var _0x0aa0=['describe','/:id','show','post','create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe'];(function(_0x48f1cb,_0x33e810){var _0x3ba0ad=function(_0x423641){while(--_0x423641){_0x48f1cb['push'](_0x48f1cb['shift']());}};_0x3ba0ad(++_0x33e810);}(_0x0aa0,0x1e2));var _0x00aa=function(_0x1b6318,_0x5761fd){_0x1b6318=_0x1b6318-0x0;var _0x573968=_0x0aa0[_0x1b6318];return _0x573968;};'use strict';var multer=require(_0x00aa('0x0'));var util=require(_0x00aa('0x1'));var path=require('path');var timeout=require(_0x00aa('0x2'));var express=require(_0x00aa('0x3'));var router=express[_0x00aa('0x4')]();var fs_extra=require(_0x00aa('0x5'));var auth=require(_0x00aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x00aa('0x7'));var controller=require(_0x00aa('0x8'));router['get']('/',auth[_0x00aa('0x9')](),controller['index']);router[_0x00aa('0xa')](_0x00aa('0xb'),auth[_0x00aa('0x9')](),controller[_0x00aa('0xc')]);router['get'](_0x00aa('0xd'),auth[_0x00aa('0x9')](),controller[_0x00aa('0xe')]);router[_0x00aa('0xf')]('/',auth['isAuthenticated'](),controller[_0x00aa('0x10')]);router[_0x00aa('0x11')](_0x00aa('0xd'),auth[_0x00aa('0x9')](),controller['update']);module[_0x00aa('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 304b2b2..420c769 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 _0x4bc3=['name','STRING','sequelize','exports'];(function(_0x1f8a9b,_0x3ce8bb){var _0x4c1722=function(_0x456379){while(--_0x456379){_0x1f8a9b['push'](_0x1f8a9b['shift']());}};_0x4c1722(++_0x3ce8bb);}(_0x4bc3,0x16e));var _0x34bc=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4bc3[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x34bc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x34bc('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4989=['STRING','sequelize','name'];(function(_0x20d10c,_0x298c6c){var _0x346406=function(_0x52ff98){while(--_0x52ff98){_0x20d10c['push'](_0x20d10c['shift']());}};_0x346406(++_0x298c6c);}(_0x4989,0x79));var _0x9498=function(_0x5e6d65,_0x5db89c){_0x5e6d65=_0x5e6d65-0x0;var _0x5e1f75=_0x4989[_0x5e6d65];return _0x5e1f75;};'use strict';var Sequelize=require(_0x9498('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9498('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9498('0x2')]},'dialPrefix':{'type':Sequelize[_0x9498('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 0f5a518..e4f7c03 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 _0x4e1c=['errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CmContact','CustomFields','cf_%d','order','raw','getContactsCsv','concat','format','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','get','Lists','UserProfileResource','stack','name','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','findOne','Disposition','nolimit','findAll','removeDispositions','addContacts','isArray','tags','join','push','ids','dataValues'];(function(_0x177ffc,_0x12fe57){var _0x5de778=function(_0x3f994e){while(--_0x3f994e){_0x177ffc['push'](_0x177ffc['shift']());}};_0x5de778(++_0x12fe57);}(_0x4e1c,0x140));var _0xc4e1=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x4e1c[_0x1e7701];return _0x3ab707;};'use strict';var emlformat=require(_0xc4e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e1('0x1'));var moment=require(_0xc4e1('0x2'));var BPromise=require(_0xc4e1('0x3'));var Mustache=require(_0xc4e1('0x4'));var util=require(_0xc4e1('0x5'));var path=require(_0xc4e1('0x6'));var sox=require(_0xc4e1('0x7'));var csv=require(_0xc4e1('0x8'));var ejs=require(_0xc4e1('0x9'));var fs=require('fs');var fs_extra=require(_0xc4e1('0xa'));var _=require(_0xc4e1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4e1('0x8'));var querystring=require(_0xc4e1('0xc'));var Papa=require('papaparse');var Redis=require(_0xc4e1('0xd'));var authService=require(_0xc4e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc4e1('0xf'));var hardwareService=require(_0xc4e1('0x10'));var logger=require('../../config/logger')(_0xc4e1('0x11'));var utils=require(_0xc4e1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc4e1('0x13'));var db=require(_0xc4e1('0x14'))['db'];config['redis']=_['defaults'](config[_0xc4e1('0x15')],{'host':_0xc4e1('0x16'),'port':0x18eb});var socket=require(_0xc4e1('0x17'))(new Redis(config['redis']));require(_0xc4e1('0x18'))[_0xc4e1('0x19')](socket);function respondWithStatusCode(_0x3955e3,_0x531fc4){_0x531fc4=_0x531fc4||0xcc;return function(_0xbe3646){if(_0xbe3646){return _0x3955e3[_0xc4e1('0x1a')](_0x531fc4);}return _0x3955e3[_0xc4e1('0x1b')](_0x531fc4)[_0xc4e1('0x1c')]();};}function respondWithResult(_0xd4c068,_0x324d26){_0x324d26=_0x324d26||0xc8;return function(_0x407b1c){if(_0x407b1c){return _0xd4c068[_0xc4e1('0x1b')](_0x324d26)[_0xc4e1('0x1d')](_0x407b1c);}};}function respondWithFilteredResult(_0x4095a7,_0x22f246){return function(_0x236e39){if(_0x236e39){var _0x2b406f=typeof _0x22f246[_0xc4e1('0x1e')]===_0xc4e1('0x1f')&&typeof _0x22f246['limit']==='undefined';var _0x2fd5c2=_0x236e39['count'];var _0xb4e357=_0x2b406f?0x0:_0x22f246['offset'];var _0x294eb6=_0x2b406f?_0x236e39[_0xc4e1('0x20')]:_0x22f246[_0xc4e1('0x1e')]+_0x22f246[_0xc4e1('0x21')];var _0x1ed368;if(_0x294eb6>=_0x2fd5c2){_0x294eb6=_0x2fd5c2;_0x1ed368=0xc8;}else{_0x1ed368=0xce;}_0x4095a7[_0xc4e1('0x1b')](_0x1ed368);return _0x4095a7['set']('Content-Range',_0xb4e357+'-'+_0x294eb6+'/'+_0x2fd5c2)[_0xc4e1('0x1d')](_0x236e39);}return null;};}function patchUpdates(_0xfc94a1){return function(_0x40a452){try{jsonpatch[_0xc4e1('0x22')](_0x40a452,_0xfc94a1,!![]);}catch(_0xb3ca2a){return BPromise[_0xc4e1('0x23')](_0xb3ca2a);}return _0x40a452['save']();};}function saveUpdates(_0x109d23,_0x48ad68){return function(_0x4ab20c){if(_0x4ab20c){return _0x4ab20c[_0xc4e1('0x24')](_0x109d23)[_0xc4e1('0x25')](function(_0x41efa9){return _0x41efa9;});}return null;};}function removeEntity(_0x5b8719,_0x31d7f7){return function(_0x1d441e){if(_0x1d441e){return _0x1d441e[_0xc4e1('0x26')]()['then'](function(){var _0x5487a0=_0x1d441e[_0xc4e1('0x27')]({'plain':!![]});var _0x4cccb5=_0xc4e1('0x28');return db[_0xc4e1('0x29')][_0xc4e1('0x26')]({'where':{'type':_0x4cccb5,'resourceId':_0x5487a0['id']}})[_0xc4e1('0x25')](function(){return _0x1d441e;});})['then'](function(){_0x5b8719['status'](0xcc)[_0xc4e1('0x1c')]();});}};}function handleEntityNotFound(_0x1d29bd,_0xe5047c){return function(_0x589d41){if(!_0x589d41){_0x1d29bd[_0xc4e1('0x1a')](0x194);}return _0x589d41;};}function handleError(_0x2a7c2f,_0x5c4bdf){_0x5c4bdf=_0x5c4bdf||0x1f4;return function(_0x37362c){logger['error'](_0x37362c[_0xc4e1('0x2a')]);if(_0x37362c[_0xc4e1('0x2b')]){delete _0x37362c[_0xc4e1('0x2b')];}_0x2a7c2f[_0xc4e1('0x1b')](_0x5c4bdf)['send'](_0x37362c);};}exports['index']=function(_0x5096d4,_0x35ba3e){var _0x4adb5b={},_0x2022b6={},_0x2061a1={'count':0x0,'rows':[]};var _0x1a816f=_[_0xc4e1('0x2c')](db[_0xc4e1('0x2d')][_0xc4e1('0x2e')],function(_0x48326c){return{'name':_0x48326c[_0xc4e1('0x2f')],'type':_0x48326c[_0xc4e1('0x30')][_0xc4e1('0x31')]};});_0x2022b6[_0xc4e1('0x32')]=_[_0xc4e1('0x2c')](_0x1a816f,_0xc4e1('0x2b'));_0x2022b6[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x5096d4[_0xc4e1('0x33')]);_0x2022b6[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x2022b6[_0xc4e1('0x32')],_0x2022b6[_0xc4e1('0x33')]);_0x4adb5b[_0xc4e1('0x37')]=_[_0xc4e1('0x36')](_0x2022b6['model'],qs[_0xc4e1('0x38')](_0x5096d4[_0xc4e1('0x33')]['fields']));_0x4adb5b[_0xc4e1('0x37')]=_0x4adb5b[_0xc4e1('0x37')][_0xc4e1('0x39')]?_0x4adb5b[_0xc4e1('0x37')]:_0x2022b6[_0xc4e1('0x32')];if(!_0x5096d4['query'][_0xc4e1('0x3a')]('nolimit')){_0x4adb5b[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x5096d4['query']['limit']);_0x4adb5b['offset']=qs[_0xc4e1('0x1e')](_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x1e')]);}_0x4adb5b['order']=qs[_0xc4e1('0x3b')](_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x4adb5b[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x5096d4['query'],_0x2022b6[_0xc4e1('0x35')]),_0x1a816f);if(_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x3e')]){_0x4adb5b[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x4adb5b[_0xc4e1('0x3c')],{'$or':_[_0xc4e1('0x2c')](_0x1a816f,function(_0x51f22d){if(_0x51f22d[_0xc4e1('0x30')]!=='VIRTUAL'){var _0x4b5331={};_0x4b5331[_0x51f22d['name']]={'$like':'%'+_0x5096d4['query'][_0xc4e1('0x3e')]+'%'};return _0x4b5331;}})});}_0x4adb5b=_[_0xc4e1('0x3f')]({},_0x4adb5b,_0x5096d4[_0xc4e1('0x40')]);var _0x2721b4={'where':_0x4adb5b[_0xc4e1('0x3c')]};return db[_0xc4e1('0x2d')][_0xc4e1('0x20')](_0x2721b4)[_0xc4e1('0x25')](function(_0x26e6fd){_0x2061a1[_0xc4e1('0x20')]=_0x26e6fd;if(_0x5096d4[_0xc4e1('0x33')][_0xc4e1('0x41')]){_0x4adb5b[_0xc4e1('0x42')]=[{'all':!![]}];}return db[_0xc4e1('0x2d')]['findAll'](_0x4adb5b);})['then'](function(_0x15db2e){_0x2061a1[_0xc4e1('0x43')]=_0x15db2e;return _0x2061a1;})[_0xc4e1('0x25')](respondWithFilteredResult(_0x35ba3e,_0x4adb5b))[_0xc4e1('0x44')](handleError(_0x35ba3e,null));};exports[_0xc4e1('0x45')]=function(_0x329b8a,_0x162527){var _0x401b5c={'raw':![],'where':{'id':_0x329b8a['params']['id']}},_0x28f0ea={};_0x28f0ea[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db[_0xc4e1('0x2d')]['rawAttributes']);_0x28f0ea[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x329b8a['query']);_0x28f0ea[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x28f0ea[_0xc4e1('0x32')],_0x28f0ea[_0xc4e1('0x33')]);_0x401b5c[_0xc4e1('0x37')]=_['intersection'](_0x28f0ea[_0xc4e1('0x32')],qs['fields'](_0x329b8a[_0xc4e1('0x33')][_0xc4e1('0x38')]));_0x401b5c[_0xc4e1('0x37')]=_0x401b5c[_0xc4e1('0x37')][_0xc4e1('0x39')]?_0x401b5c[_0xc4e1('0x37')]:_0x28f0ea[_0xc4e1('0x32')];if(_0x329b8a[_0xc4e1('0x33')][_0xc4e1('0x41')]){_0x401b5c[_0xc4e1('0x42')]=[{'all':!![]}];}_0x401b5c=_[_0xc4e1('0x3f')]({},_0x401b5c,_0x329b8a[_0xc4e1('0x40')]);return db[_0xc4e1('0x2d')][_0xc4e1('0x46')](_0x401b5c)[_0xc4e1('0x25')](handleEntityNotFound(_0x162527,null))['then'](respondWithResult(_0x162527,null))[_0xc4e1('0x44')](handleError(_0x162527,null));};exports['create']=function(_0x25fa6d,_0x2470fa){return db[_0xc4e1('0x2d')][_0xc4e1('0x47')](_0x25fa6d[_0xc4e1('0x48')],{})[_0xc4e1('0x25')](function(_0x30f9a7){var _0x28fe4f=_0x25fa6d[_0xc4e1('0x49')]['get']({'plain':!![]});if(!_0x28fe4f)throw new Error(_0xc4e1('0x4a'));if(_0x28fe4f[_0xc4e1('0x4b')]===_0xc4e1('0x49')){var _0x3312ee=_0x30f9a7['get']({'plain':!![]});var _0x47fb04=_0xc4e1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x47fb04,'userProfileId':_0x28fe4f['userProfileId']},'raw':!![]})[_0xc4e1('0x25')](function(_0x42a077){if(_0x42a077&&_0x42a077[_0xc4e1('0x4c')]===0x0){return db[_0xc4e1('0x29')][_0xc4e1('0x47')]({'name':_0x3312ee[_0xc4e1('0x2b')],'resourceId':_0x3312ee['id'],'type':_0x42a077[_0xc4e1('0x2b')],'sectionId':_0x42a077['id']},{})[_0xc4e1('0x25')](function(){return _0x30f9a7;});}else{return _0x30f9a7;}})[_0xc4e1('0x44')](function(_0x11868b){logger['error'](_0xc4e1('0x4d'),_0x11868b);throw _0x11868b;});}return _0x30f9a7;})[_0xc4e1('0x25')](respondWithResult(_0x2470fa,0xc9))['catch'](handleError(_0x2470fa,null));};exports['update']=function(_0x3dabf0,_0x5060da){if(_0x3dabf0[_0xc4e1('0x48')]['id']){delete _0x3dabf0[_0xc4e1('0x48')]['id'];}return db['CmList']['find']({'where':{'id':_0x3dabf0[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x5060da,null))[_0xc4e1('0x25')](saveUpdates(_0x3dabf0[_0xc4e1('0x48')],null))[_0xc4e1('0x25')](respondWithResult(_0x5060da,null))[_0xc4e1('0x44')](handleError(_0x5060da,null));};exports[_0xc4e1('0x26')]=function(_0x57b02d,_0x408c37){return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0x57b02d[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x408c37,null))[_0xc4e1('0x25')](removeEntity(_0x408c37,null))[_0xc4e1('0x44')](handleError(_0x408c37,null));};exports[_0xc4e1('0x4f')]=function(_0x383bbc,_0x58de55){return db['CmList'][_0xc4e1('0x4f')]()[_0xc4e1('0x25')](respondWithResult(_0x58de55,null))[_0xc4e1('0x44')](handleError(_0x58de55,null));};exports[_0xc4e1('0x50')]=function(_0xeb8be5,_0x9514fd,_0x15bd8a){if(_0xeb8be5[_0xc4e1('0x48')]['id']){delete _0xeb8be5[_0xc4e1('0x48')]['id'];}return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0xeb8be5[_0xc4e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x9514fd,null))[_0xc4e1('0x25')](function(_0x42dde6){if(_0x42dde6){_0xeb8be5[_0xc4e1('0x48')][_0xc4e1('0x51')]=_0x42dde6['id'];return db['Disposition'][_0xc4e1('0x47')](_0xeb8be5[_0xc4e1('0x48')]);}})[_0xc4e1('0x25')](respondWithResult(_0x9514fd,null))[_0xc4e1('0x44')](handleError(_0x9514fd,null));};exports['getDispositions']=function(_0x54fe24,_0x609353,_0x180b01){var _0x313693={'raw':![],'where':{}};var _0x3e5642={};var _0x6a3fe6={'count':0x0,'rows':[]};return db['CmList'][_0xc4e1('0x52')]({'where':{'id':_0x54fe24['params']['id']}})['then'](handleEntityNotFound(_0x609353,null))['then'](function(_0xc546fa){if(_0xc546fa){_0x3e5642[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db[_0xc4e1('0x53')][_0xc4e1('0x2e')]);_0x3e5642[_0xc4e1('0x33')]=_['keys'](_0x54fe24[_0xc4e1('0x33')]);_0x3e5642[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x3e5642[_0xc4e1('0x32')],_0x3e5642['query']);_0x313693[_0xc4e1('0x37')]=_[_0xc4e1('0x36')](_0x3e5642[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x38')]));_0x313693['attributes']=_0x313693[_0xc4e1('0x37')][_0xc4e1('0x39')]?_0x313693[_0xc4e1('0x37')]:_0x3e5642[_0xc4e1('0x32')];if(!_0x54fe24['query'][_0xc4e1('0x3a')](_0xc4e1('0x54'))){_0x313693[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x21')]);_0x313693[_0xc4e1('0x1e')]=qs['offset'](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x1e')]);}_0x313693['order']=qs['sort'](_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x313693[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x54fe24[_0xc4e1('0x33')],_0x3e5642[_0xc4e1('0x35')]));_0x313693['where'][_0xc4e1('0x51')]=_0xc546fa['id'];if(_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x3e')]){_0x313693[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x313693[_0xc4e1('0x3c')],{'$or':_[_0xc4e1('0x2c')](_0x313693[_0xc4e1('0x37')],function(_0x2edef5){var _0x53d49b={};_0x53d49b[_0x2edef5]={'$like':'%'+_0x54fe24[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x53d49b;})});}_0x313693=_[_0xc4e1('0x3f')]({},_0x313693,_0x54fe24[_0xc4e1('0x40')]);return db['Disposition'][_0xc4e1('0x20')]({'where':_0x313693[_0xc4e1('0x3c')]})[_0xc4e1('0x25')](function(_0x598778){_0x6a3fe6[_0xc4e1('0x20')]=_0x598778;if(_0x54fe24['query'][_0xc4e1('0x41')]){_0x313693['include']=[{'all':!![]}];}return db['Disposition'][_0xc4e1('0x55')](_0x313693);})[_0xc4e1('0x25')](function(_0x360bd0){_0x6a3fe6[_0xc4e1('0x43')]=_0x360bd0;return _0x6a3fe6;});}})[_0xc4e1('0x25')](respondWithFilteredResult(_0x609353,_0x313693))[_0xc4e1('0x44')](handleError(_0x609353,null));};exports[_0xc4e1('0x56')]=function(_0x47dc7e,_0x83c5b5,_0x30096b){return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x47dc7e[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x83c5b5,null))[_0xc4e1('0x25')](function(_0x53abc8){if(_0x53abc8){return _0x53abc8['removeDispositions'](_0x47dc7e['query']['ids']);}})[_0xc4e1('0x25')](respondWithStatusCode(_0x83c5b5,null))[_0xc4e1('0x44')](handleError(_0x83c5b5,null));};exports[_0xc4e1('0x57')]=function(_0x141054,_0x262aa7,_0x13c156){return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x141054['params']['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x262aa7,null))[_0xc4e1('0x25')](function(_0x2d6f1e){if(_0x2d6f1e){var _0x4a900f=[];var _0x150769={'success':[],'errors':[]};return db['CmContact'][_0xc4e1('0x4f')]()[_0xc4e1('0x25')](function(_0x1b8eba){if(_0x141054[_0xc4e1('0x48')]['tags']&&_[_0xc4e1('0x58')](_0x141054[_0xc4e1('0x48')][_0xc4e1('0x59')])){if(_0x141054['body']['tags'][_0xc4e1('0x39')]){_0x141054[_0xc4e1('0x48')][_0xc4e1('0x59')]=_0x141054['body'][_0xc4e1('0x59')][_0xc4e1('0x5a')](';')+';';}else{_0x141054[_0xc4e1('0x48')][_0xc4e1('0x59')]=null;}}else{_0x141054['body'][_0xc4e1('0x59')]=null;}if(_0x141054['body']&&_[_0xc4e1('0x58')](_0x141054[_0xc4e1('0x48')])){for(var _0x5e508e=0x0;_0x5e508e<_0x141054['body'][_0xc4e1('0x39')];_0x5e508e+=0x1){_0x141054[_0xc4e1('0x48')][_0x5e508e][_0xc4e1('0x51')]=_0x141054[_0xc4e1('0x4e')]['id'];_0x4a900f[_0xc4e1('0x5b')](_0x141054[_0xc4e1('0x48')][_0x5e508e]);}return BPromise['each'](_0x4a900f,function(_0x14f22f){return db['CmContact'][_0xc4e1('0x47')](_['omit'](_0x14f22f,[_0xc4e1('0x5c'),'id'])||{},{'fields':_[_0xc4e1('0x34')](_0x1b8eba),'raw':!![]})[_0xc4e1('0x25')](function(_0x4e203f){_0x150769['success']['push'](_0x4e203f[_0xc4e1('0x5d')]);})[_0xc4e1('0x44')](function(_0x544a39){_0x150769[_0xc4e1('0x5e')]['push']({'data':_0x14f22f,'error':_0x544a39['message']});});})[_0xc4e1('0x25')](function(_0x46b27a){return _0x150769;})[_0xc4e1('0x44')](function(_0x32e050){return _0x32e050;});}else{_0x262aa7[_0xc4e1('0x1b')](0x190)[_0xc4e1('0x1d')]({'message':_0xc4e1('0x5f')});}});}})['then'](respondWithResult(_0x262aa7,null))[_0xc4e1('0x44')](handleError(_0x262aa7,null));};exports[_0xc4e1('0x60')]=function(_0x25439c,_0x44284c,_0x5efc01){var _0x3f0edd;return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x25439c['params']['id']},'include':[{'model':db[_0xc4e1('0x61')],'as':'CustomFields'}]})[_0xc4e1('0x25')](handleEntityNotFound(_0x44284c,null))['then'](function(_0x52b192){if(_0x52b192){_0x3f0edd=_0x52b192;return db[_0xc4e1('0x62')][_0xc4e1('0x2e')];}})[_0xc4e1('0x25')](function(_0x1ad672){if(_0x1ad672){var _0x497d0f={};var _0x17e175={};_0x17e175[_0xc4e1('0x32')]=_['concat'](_[_0xc4e1('0x34')](_0x1ad672),_[_0xc4e1('0x2c')](_0x3f0edd[_0xc4e1('0x63')],function(_0x7ee25c){return util['format'](_0xc4e1('0x64'),_0x7ee25c['id']);}));_0x17e175[_0xc4e1('0x33')]=_['keys'](_0x25439c[_0xc4e1('0x33')]);_0x17e175[_0xc4e1('0x35')]=_['intersection'](_0x17e175[_0xc4e1('0x32')],_0x17e175[_0xc4e1('0x33')]);_0x497d0f['attributes']=_[_0xc4e1('0x36')](_0x17e175[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0x25439c['query'][_0xc4e1('0x38')]));_0x497d0f[_0xc4e1('0x37')]=_0x497d0f[_0xc4e1('0x37')]['length']?_0x497d0f['attributes']:_0x17e175[_0xc4e1('0x32')];if(!_0x25439c[_0xc4e1('0x33')][_0xc4e1('0x3a')]('nolimit')){_0x497d0f[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x25439c[_0xc4e1('0x33')]['limit']);_0x497d0f[_0xc4e1('0x1e')]=qs[_0xc4e1('0x1e')](_0x25439c[_0xc4e1('0x33')]['offset']);}_0x497d0f[_0xc4e1('0x65')]=qs[_0xc4e1('0x3b')](_0x25439c[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x497d0f['where']=qs['filters'](_['pick'](_0x25439c[_0xc4e1('0x33')],_0x17e175[_0xc4e1('0x35')]));_0x497d0f[_0xc4e1('0x66')]=!![];if(_0x25439c[_0xc4e1('0x33')]['filter']){_0x497d0f[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x497d0f[_0xc4e1('0x3c')],{'$or':_['map'](_0x497d0f[_0xc4e1('0x37')],function(_0x2f826b){var _0x486216={};_0x486216[_0x2f826b]={'$like':'%'+_0x25439c['query'][_0xc4e1('0x3e')]+'%'};return _0x486216;})});}_0x497d0f=_[_0xc4e1('0x3f')]({},_0x497d0f,_0x25439c[_0xc4e1('0x40')]);return _0x3f0edd[_0xc4e1('0x60')](_0x497d0f);}})['then'](respondWithResult(_0x44284c,null))[_0xc4e1('0x44')](handleError(_0x44284c,null));};exports[_0xc4e1('0x67')]=function(_0x207e8a,_0xb5117d,_0x4a1f69){var _0x382f34;return db[_0xc4e1('0x2d')]['find']({'where':{'id':_0x207e8a['params']['id']},'include':[{'model':db[_0xc4e1('0x61')],'as':_0xc4e1('0x63')}]})[_0xc4e1('0x25')](handleEntityNotFound(_0xb5117d,null))['then'](function(_0x4bc1b8){if(_0x4bc1b8){_0x382f34=_0x4bc1b8;return db[_0xc4e1('0x62')][_0xc4e1('0x2e')];}})['then'](function(_0x52b1e7){if(_0x52b1e7){var _0x23d7cc={};var _0xfb726f={};_0xfb726f[_0xc4e1('0x32')]=_[_0xc4e1('0x68')](_[_0xc4e1('0x34')](_0x52b1e7),_[_0xc4e1('0x2c')](_0x382f34[_0xc4e1('0x63')],function(_0x22b809){return util[_0xc4e1('0x69')](_0xc4e1('0x64'),_0x22b809['id']);}));_0xfb726f['query']=_[_0xc4e1('0x34')](_0x207e8a[_0xc4e1('0x33')]);_0xfb726f[_0xc4e1('0x35')]=_['intersection'](_0xfb726f[_0xc4e1('0x32')],_0xfb726f[_0xc4e1('0x33')]);_0x23d7cc['attributes']=_[_0xc4e1('0x36')](_0xfb726f[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0x207e8a[_0xc4e1('0x33')]['fields']));_0x23d7cc[_0xc4e1('0x37')]=_0x23d7cc[_0xc4e1('0x37')]['length']?_0x23d7cc[_0xc4e1('0x37')]:_0xfb726f[_0xc4e1('0x32')];if(!_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3a')](_0xc4e1('0x54'))){_0x23d7cc[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x21')]);_0x23d7cc[_0xc4e1('0x1e')]=qs[_0xc4e1('0x1e')](_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x1e')]);}_0x23d7cc['order']=qs[_0xc4e1('0x3b')](_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x23d7cc[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x207e8a['query'],_0xfb726f[_0xc4e1('0x35')]));_0x23d7cc[_0xc4e1('0x66')]=!![];if(_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3e')]){_0x23d7cc[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x23d7cc['where'],{'$or':_[_0xc4e1('0x2c')](_0x23d7cc[_0xc4e1('0x37')],function(_0x5cbe36){var _0x374cea={};_0x374cea[_0x5cbe36]={'$like':'%'+_0x207e8a[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x374cea;})});}_0x23d7cc=_[_0xc4e1('0x3f')]({},_0x23d7cc,_0x207e8a['options']);return _0x382f34[_0xc4e1('0x60')](_0x23d7cc);}})[_0xc4e1('0x25')](function(_0x48429b){if(!_['isEmpty'](_0x48429b)){var _0x3fe3b8=toCsv(_0x48429b);var _0x2016e7=Date[_0xc4e1('0x6a')]();fs[_0xc4e1('0x6b')](util['format'](_0xc4e1('0x6c'),_0x382f34['id'],_0x2016e7),_0x3fe3b8);_0xb5117d[_0xc4e1('0x6d')](_0xc4e1('0x6e'),_0xc4e1('0x6f')+util[_0xc4e1('0x69')]('list_%d_%s.csv',_0x382f34['id'],_0x2016e7));_0xb5117d[_0xc4e1('0x6d')](_0xc4e1('0x70'),_0xc4e1('0x71'));return _0xb5117d['download'](util[_0xc4e1('0x69')](_0xc4e1('0x6c'),_0x382f34['id'],_0x2016e7));}else{return _0xb5117d[_0xc4e1('0x1a')](0xcc);}})['catch'](handleError(_0xb5117d,null));};exports[_0xc4e1('0x72')]=function(_0x2ca164,_0x477506,_0x288494){var _0x2b7683;delete _0x2ca164[_0xc4e1('0x48')]['id'];return db[_0xc4e1('0x2d')][_0xc4e1('0x52')]({'where':{'id':_0x2ca164[_0xc4e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x477506,null))['then'](function(_0x1a0e4e){if(_0x1a0e4e){return db[_0xc4e1('0x73')][_0xc4e1('0x74')](function(_0x2232fd){return db['CmCustomField']['create'](_0x2ca164[_0xc4e1('0x48')],{'transaction':_0x2232fd})[_0xc4e1('0x25')](function(_0x36f914){_0x2b7683=_0x36f914;return _0x1a0e4e[_0xc4e1('0x75')](_0x36f914,{'transaction':_0x2232fd});})[_0xc4e1('0x25')](function(){var _0x2020f2={'type':db[_0xc4e1('0x76')]['TEXT'],'transaction':_0x2232fd};switch(_0x2ca164['body'][_0xc4e1('0x30')]){case _0xc4e1('0x77'):_0x2020f2[_0xc4e1('0x30')]=db[_0xc4e1('0x76')][_0xc4e1('0x78')];break;case _0xc4e1('0x79'):_0x2020f2['type']=db[_0xc4e1('0x76')][_0xc4e1('0x7a')];break;case _0xc4e1('0x7b'):_0x2020f2[_0xc4e1('0x30')]=db[_0xc4e1('0x76')][_0xc4e1('0x7c')];_0x2020f2[_0xc4e1('0x7d')]=![];break;default:}return db[_0xc4e1('0x73')][_0xc4e1('0x7e')][_0xc4e1('0x7f')](_0xc4e1('0x80'),util[_0xc4e1('0x69')](_0xc4e1('0x81'),_0x2b7683['id']),_0x2020f2);})[_0xc4e1('0x25')](function(){return _0x2b7683;});});}})[_0xc4e1('0x25')](respondWithResult(_0x477506,null))[_0xc4e1('0x44')](handleError(_0x477506,null));};exports['getCustomFields']=function(_0x58fcf0,_0x45020a,_0x25ea35){var _0x180a82={};var _0x41bf88={};var _0x3b792f;var _0xe5e64a;return db[_0xc4e1('0x2d')][_0xc4e1('0x52')]({'where':{'id':_0x58fcf0[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x45020a,null))['then'](function(_0x563eca){if(_0x563eca){_0x3b792f=_0x563eca;_0x41bf88[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db[_0xc4e1('0x61')][_0xc4e1('0x2e')]);_0x41bf88['query']=_[_0xc4e1('0x34')](_0x58fcf0[_0xc4e1('0x33')]);_0x41bf88[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x41bf88[_0xc4e1('0x32')],_0x41bf88['query']);_0x180a82['attributes']=_[_0xc4e1('0x36')](_0x41bf88['model'],qs[_0xc4e1('0x38')](_0x58fcf0[_0xc4e1('0x33')][_0xc4e1('0x38')]));_0x180a82[_0xc4e1('0x37')]=_0x180a82['attributes'][_0xc4e1('0x39')]?_0x180a82['attributes']:_0x41bf88[_0xc4e1('0x32')];_0x180a82[_0xc4e1('0x65')]=qs['sort'](_0x58fcf0[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x180a82[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_[_0xc4e1('0x3d')](_0x58fcf0[_0xc4e1('0x33')],_0x41bf88[_0xc4e1('0x35')]));_0x180a82[_0xc4e1('0x3c')]=_['merge'](_0x180a82['where'],{'$or':[{'ListId':_0x563eca['id']},{'ListId':null}]});if(_0x58fcf0[_0xc4e1('0x33')]['filter']){_0x180a82[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x180a82[_0xc4e1('0x3c')],{'$or':_[_0xc4e1('0x2c')](_0x180a82['attributes'],function(_0x5058fb){var _0x451dac={};_0x451dac[_0x5058fb]={'$like':'%'+_0x58fcf0[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x451dac;})});}_0x180a82=_[_0xc4e1('0x3f')]({},_0x180a82,_0x58fcf0[_0xc4e1('0x40')]);return db[_0xc4e1('0x61')]['findAndCountAll'](_0x180a82);}})['then'](respondWithResult(_0x45020a,null))[_0xc4e1('0x44')](handleError(_0x45020a,null));};exports[_0xc4e1('0x82')]=function(_0x2f7a75,_0xfdcea,_0x581b72){return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0x2f7a75[_0xc4e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfdcea,null))[_0xc4e1('0x25')](function(_0x15e526){if(_0x15e526){return _0x15e526['addAgents'](_0x2f7a75[_0xc4e1('0x48')][_0xc4e1('0x5c')],_[_0xc4e1('0x83')](_0x2f7a75['body'],['ids','id'])||{})[_0xc4e1('0x84')](function(_0x5c3a15){for(var _0x596cd5=0x0;_0x596cd5<_0x2f7a75[_0xc4e1('0x48')]['ids'][_0xc4e1('0x39')];_0x596cd5+=0x1){socket[_0xc4e1('0x85')](_0xc4e1('0x86'),{'UserId':Number(_0x2f7a75[_0xc4e1('0x48')]['ids'][_0x596cd5]),'CmListId':Number(_0x2f7a75[_0xc4e1('0x4e')]['id'])});}return _0x5c3a15;});}})[_0xc4e1('0x25')](respondWithResult(_0xfdcea,null))[_0xc4e1('0x44')](handleError(_0xfdcea,null));};exports[_0xc4e1('0x87')]=function(_0x51badd,_0x32dba0,_0x1b298d){return db[_0xc4e1('0x2d')][_0xc4e1('0x46')]({'where':{'id':_0x51badd[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x32dba0,null))[_0xc4e1('0x25')](function(_0x433794){if(_0x433794){return _0x433794['removeAgents'](_0x51badd[_0xc4e1('0x33')]['ids'])[_0xc4e1('0x25')](function(){if(_[_0xc4e1('0x58')](_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')])){for(var _0x4bf4d5=0x0;_0x4bf4d5<_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')][_0xc4e1('0x39')];_0x4bf4d5+=0x1){socket[_0xc4e1('0x85')](_0xc4e1('0x88'),{'UserId':Number(_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')][_0x4bf4d5]),'CmListId':Number(_0x51badd[_0xc4e1('0x4e')]['id'])});}}else{socket['emit'](_0xc4e1('0x88'),{'UserId':Number(_0x51badd[_0xc4e1('0x33')][_0xc4e1('0x5c')]),'CmListId':Number(_0x51badd[_0xc4e1('0x4e')]['id'])});}});}})[_0xc4e1('0x25')](respondWithStatusCode(_0x32dba0,null))[_0xc4e1('0x44')](handleError(_0x32dba0,null));};exports[_0xc4e1('0x89')]=function(_0xc4e08a,_0x220021,_0x556bbf){var _0x27b579={};var _0x48aa7c={};var _0x320a90;var _0x460153;return db['CmList'][_0xc4e1('0x52')]({'where':{'id':_0xc4e08a[_0xc4e1('0x4e')]['id']}})[_0xc4e1('0x25')](handleEntityNotFound(_0x220021,null))[_0xc4e1('0x25')](function(_0x23727f){if(_0x23727f){_0x320a90=_0x23727f;_0x48aa7c[_0xc4e1('0x32')]=_[_0xc4e1('0x34')](db['User'][_0xc4e1('0x2e')]);_0x48aa7c[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0xc4e08a[_0xc4e1('0x33')]);_0x48aa7c[_0xc4e1('0x35')]=_[_0xc4e1('0x36')](_0x48aa7c['model'],_0x48aa7c['query']);_0x27b579['attributes']=_[_0xc4e1('0x36')](_0x48aa7c[_0xc4e1('0x32')],qs[_0xc4e1('0x38')](_0xc4e08a['query'][_0xc4e1('0x38')]));_0x27b579[_0xc4e1('0x37')]=_0x27b579[_0xc4e1('0x37')]['length']?_0x27b579[_0xc4e1('0x37')]:_0x48aa7c[_0xc4e1('0x32')];_0x27b579[_0xc4e1('0x65')]=qs[_0xc4e1('0x3b')](_0xc4e08a[_0xc4e1('0x33')][_0xc4e1('0x3b')]);_0x27b579[_0xc4e1('0x3c')]=qs[_0xc4e1('0x35')](_['pick'](_0xc4e08a[_0xc4e1('0x33')],_0x48aa7c[_0xc4e1('0x35')]));if(_0xc4e08a[_0xc4e1('0x33')]['filter']){_0x27b579[_0xc4e1('0x3c')]=_[_0xc4e1('0x3f')](_0x27b579['where'],{'$or':_[_0xc4e1('0x2c')](_0x27b579['attributes'],function(_0x56b92b){var _0x4980e7={};_0x4980e7[_0x56b92b]={'$like':'%'+_0xc4e08a[_0xc4e1('0x33')][_0xc4e1('0x3e')]+'%'};return _0x4980e7;})});}_0x27b579=_[_0xc4e1('0x3f')]({},_0x27b579,_0xc4e08a['options']);return _0x320a90['getAgents'](_0x27b579);}})[_0xc4e1('0x25')](function(_0x59ddf5){if(_0x59ddf5){_0x460153=_0x59ddf5[_0xc4e1('0x39')];if(!_0xc4e08a['query'][_0xc4e1('0x3a')](_0xc4e1('0x54'))){_0x27b579[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0xc4e08a[_0xc4e1('0x33')][_0xc4e1('0x21')]);_0x27b579[_0xc4e1('0x1e')]=qs[_0xc4e1('0x1e')](_0xc4e08a['query'][_0xc4e1('0x1e')]);}return _0x320a90[_0xc4e1('0x89')](_0x27b579);}})[_0xc4e1('0x25')](function(_0x2ef54e){if(_0x2ef54e){return _0x2ef54e?{'count':_0x460153,'rows':_0x2ef54e}:null;}})[_0xc4e1('0x25')](respondWithResult(_0x220021,null))[_0xc4e1('0x44')](handleError(_0x220021,null));}; \ No newline at end of file +var _0x5337=['redis','defaults','register','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','CmList','rawAttributes','fieldName','key','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','filters','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ListId','getDispositions','Disposition','pick','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','addColumn','cf_%s','getCustomFields','findOne','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x9e72c8,_0x5ac1a9){var _0x1468b2=function(_0x2cac69){while(--_0x2cac69){_0x9e72c8['push'](_0x9e72c8['shift']());}};_0x1468b2(++_0x5ac1a9);}(_0x5337,0x104));var _0x7533=function(_0x4bb93d,_0x1cda9a){_0x4bb93d=_0x4bb93d-0x0;var _0x106b4f=_0x5337[_0x4bb93d];return _0x106b4f;};'use strict';var emlformat=require(_0x7533('0x0'));var rimraf=require(_0x7533('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7533('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7533('0x3'));var util=require(_0x7533('0x4'));var path=require(_0x7533('0x5'));var sox=require('sox');var csv=require(_0x7533('0x6'));var ejs=require(_0x7533('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7533('0x8'));var squel=require(_0x7533('0x9'));var crypto=require(_0x7533('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7533('0xb'));var toCsv=require(_0x7533('0x6'));var querystring=require('querystring');var Papa=require(_0x7533('0xc'));var Redis=require(_0x7533('0xd'));var authService=require(_0x7533('0xe'));var qs=require(_0x7533('0xf'));var as=require(_0x7533('0x10'));var hardwareService=require(_0x7533('0x11'));var logger=require(_0x7533('0x12'))('api');var utils=require(_0x7533('0x13'));var config=require(_0x7533('0x14'));var licenseUtil=require(_0x7533('0x15'));var db=require('../../mysqldb')['db'];config[_0x7533('0x16')]=_[_0x7533('0x17')](config[_0x7533('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7533('0x16')]));require('./cmList.socket')[_0x7533('0x18')](socket);function respondWithStatusCode(_0x4142b5,_0x48d831){_0x48d831=_0x48d831||0xcc;return function(_0xf78d7d){if(_0xf78d7d){return _0x4142b5[_0x7533('0x19')](_0x48d831);}return _0x4142b5[_0x7533('0x1a')](_0x48d831)['end']();};}function respondWithResult(_0x5e1cdc,_0x1d2494){_0x1d2494=_0x1d2494||0xc8;return function(_0x9e5ca2){if(_0x9e5ca2){return _0x5e1cdc[_0x7533('0x1a')](_0x1d2494)[_0x7533('0x1b')](_0x9e5ca2);}};}function respondWithFilteredResult(_0x15c8b9,_0x4dc305){return function(_0x2c9723){if(_0x2c9723){var _0x1a687b=typeof _0x4dc305[_0x7533('0x1c')]==='undefined'&&typeof _0x4dc305[_0x7533('0x1d')]==='undefined';var _0x472731=_0x2c9723[_0x7533('0x1e')];var _0x5b82f8=_0x1a687b?0x0:_0x4dc305['offset'];var _0x1f83e1=_0x1a687b?_0x2c9723[_0x7533('0x1e')]:_0x4dc305[_0x7533('0x1c')]+_0x4dc305[_0x7533('0x1d')];var _0x2e39e7;if(_0x1f83e1>=_0x472731){_0x1f83e1=_0x472731;_0x2e39e7=0xc8;}else{_0x2e39e7=0xce;}_0x15c8b9[_0x7533('0x1a')](_0x2e39e7);return _0x15c8b9['set'](_0x7533('0x1f'),_0x5b82f8+'-'+_0x1f83e1+'/'+_0x472731)[_0x7533('0x1b')](_0x2c9723);}return null;};}function patchUpdates(_0x21b208){return function(_0x37d79b){try{jsonpatch[_0x7533('0x20')](_0x37d79b,_0x21b208,!![]);}catch(_0x2917e5){return BPromise[_0x7533('0x21')](_0x2917e5);}return _0x37d79b[_0x7533('0x22')]();};}function saveUpdates(_0x1337c6,_0x3c62ed){return function(_0x2a9380){if(_0x2a9380){return _0x2a9380[_0x7533('0x23')](_0x1337c6)['then'](function(_0x5b4458){return _0x5b4458;});}return null;};}function removeEntity(_0x9f2c63,_0x4bb7cb){return function(_0x400072){if(_0x400072){return _0x400072[_0x7533('0x24')]()[_0x7533('0x25')](function(){var _0x3159c7=_0x400072[_0x7533('0x26')]({'plain':!![]});var _0x4a379f='Lists';return db[_0x7533('0x27')][_0x7533('0x24')]({'where':{'type':_0x4a379f,'resourceId':_0x3159c7['id']}})[_0x7533('0x25')](function(){return _0x400072;});})[_0x7533('0x25')](function(){_0x9f2c63['status'](0xcc)[_0x7533('0x28')]();});}};}function handleEntityNotFound(_0x326d56,_0xf5741d){return function(_0x1eb7b9){if(!_0x1eb7b9){_0x326d56[_0x7533('0x19')](0x194);}return _0x1eb7b9;};}function handleError(_0x5564dd,_0x2c9658){_0x2c9658=_0x2c9658||0x1f4;return function(_0xa1229b){logger[_0x7533('0x29')](_0xa1229b[_0x7533('0x2a')]);if(_0xa1229b[_0x7533('0x2b')]){delete _0xa1229b['name'];}_0x5564dd[_0x7533('0x1a')](_0x2c9658)[_0x7533('0x2c')](_0xa1229b);};}exports[_0x7533('0x2d')]=function(_0x4aaf10,_0x5dcf88){var _0x6eeb66={},_0x17d0c0={},_0x5967f8={'count':0x0,'rows':[]};var _0x39292c=_['map'](db[_0x7533('0x2e')][_0x7533('0x2f')],function(_0x1f3889){return{'name':_0x1f3889[_0x7533('0x30')],'type':_0x1f3889['type'][_0x7533('0x31')]};});_0x17d0c0[_0x7533('0x32')]=_[_0x7533('0x33')](_0x39292c,_0x7533('0x2b'));_0x17d0c0['query']=_[_0x7533('0x34')](_0x4aaf10[_0x7533('0x35')]);_0x17d0c0['filters']=_[_0x7533('0x36')](_0x17d0c0[_0x7533('0x32')],_0x17d0c0['query']);_0x6eeb66['attributes']=_[_0x7533('0x36')](_0x17d0c0[_0x7533('0x32')],qs[_0x7533('0x37')](_0x4aaf10['query'][_0x7533('0x37')]));_0x6eeb66[_0x7533('0x38')]=_0x6eeb66[_0x7533('0x38')]['length']?_0x6eeb66[_0x7533('0x38')]:_0x17d0c0['model'];if(!_0x4aaf10['query'][_0x7533('0x39')](_0x7533('0x3a'))){_0x6eeb66[_0x7533('0x1d')]=qs[_0x7533('0x1d')](_0x4aaf10['query'][_0x7533('0x1d')]);_0x6eeb66[_0x7533('0x1c')]=qs['offset'](_0x4aaf10[_0x7533('0x35')][_0x7533('0x1c')]);}_0x6eeb66[_0x7533('0x3b')]=qs[_0x7533('0x3c')](_0x4aaf10['query']['sort']);_0x6eeb66['where']=qs['filters'](_['pick'](_0x4aaf10['query'],_0x17d0c0['filters']),_0x39292c);if(_0x4aaf10[_0x7533('0x35')]['filter']){_0x6eeb66[_0x7533('0x3d')]=_['merge'](_0x6eeb66[_0x7533('0x3d')],{'$or':_['map'](_0x39292c,function(_0x390d41){if(_0x390d41[_0x7533('0x3e')]!==_0x7533('0x3f')){var _0x1955c2={};_0x1955c2[_0x390d41['name']]={'$like':'%'+_0x4aaf10[_0x7533('0x35')][_0x7533('0x40')]+'%'};return _0x1955c2;}})});}_0x6eeb66=_[_0x7533('0x41')]({},_0x6eeb66,_0x4aaf10[_0x7533('0x42')]);var _0x31913b={'where':_0x6eeb66['where']};return db[_0x7533('0x2e')][_0x7533('0x1e')](_0x31913b)[_0x7533('0x25')](function(_0xcf4b2a){_0x5967f8['count']=_0xcf4b2a;if(_0x4aaf10[_0x7533('0x35')][_0x7533('0x43')]){_0x6eeb66[_0x7533('0x44')]=[{'all':!![]}];}return db[_0x7533('0x2e')][_0x7533('0x45')](_0x6eeb66);})[_0x7533('0x25')](function(_0x424d59){_0x5967f8[_0x7533('0x46')]=_0x424d59;return _0x5967f8;})[_0x7533('0x25')](respondWithFilteredResult(_0x5dcf88,_0x6eeb66))[_0x7533('0x47')](handleError(_0x5dcf88,null));};exports[_0x7533('0x48')]=function(_0x54e371,_0x36f188){var _0x1a087c={'raw':![],'where':{'id':_0x54e371['params']['id']}},_0x4e321e={};_0x4e321e[_0x7533('0x32')]=_['keys'](db['CmList']['rawAttributes']);_0x4e321e[_0x7533('0x35')]=_[_0x7533('0x34')](_0x54e371[_0x7533('0x35')]);_0x4e321e[_0x7533('0x49')]=_[_0x7533('0x36')](_0x4e321e[_0x7533('0x32')],_0x4e321e[_0x7533('0x35')]);_0x1a087c['attributes']=_[_0x7533('0x36')](_0x4e321e[_0x7533('0x32')],qs[_0x7533('0x37')](_0x54e371['query'][_0x7533('0x37')]));_0x1a087c['attributes']=_0x1a087c['attributes'][_0x7533('0x4a')]?_0x1a087c[_0x7533('0x38')]:_0x4e321e[_0x7533('0x32')];if(_0x54e371[_0x7533('0x35')][_0x7533('0x43')]){_0x1a087c[_0x7533('0x44')]=[{'all':!![]}];}_0x1a087c=_[_0x7533('0x41')]({},_0x1a087c,_0x54e371[_0x7533('0x42')]);return db['CmList'][_0x7533('0x4b')](_0x1a087c)[_0x7533('0x25')](handleEntityNotFound(_0x36f188,null))[_0x7533('0x25')](respondWithResult(_0x36f188,null))[_0x7533('0x47')](handleError(_0x36f188,null));};exports[_0x7533('0x4c')]=function(_0x4eb11d,_0x23a6c7){return db[_0x7533('0x2e')][_0x7533('0x4c')](_0x4eb11d['body'],{})['then'](function(_0x201ec1){var _0x409c73=_0x4eb11d[_0x7533('0x4d')][_0x7533('0x26')]({'plain':!![]});if(!_0x409c73)throw new Error(_0x7533('0x4e'));if(_0x409c73[_0x7533('0x4f')]===_0x7533('0x4d')){var _0x9b2636=_0x201ec1['get']({'plain':!![]});var _0x382242='Lists';return db[_0x7533('0x50')][_0x7533('0x4b')]({'where':{'name':_0x382242,'userProfileId':_0x409c73['userProfileId']},'raw':!![]})[_0x7533('0x25')](function(_0x408e9a){if(_0x408e9a&&_0x408e9a[_0x7533('0x51')]===0x0){return db['UserProfileResource'][_0x7533('0x4c')]({'name':_0x9b2636[_0x7533('0x2b')],'resourceId':_0x9b2636['id'],'type':_0x408e9a[_0x7533('0x2b')],'sectionId':_0x408e9a['id']},{})[_0x7533('0x25')](function(){return _0x201ec1;});}else{return _0x201ec1;}})[_0x7533('0x47')](function(_0x48d739){logger['error'](_0x7533('0x52'),_0x48d739);throw _0x48d739;});}return _0x201ec1;})['then'](respondWithResult(_0x23a6c7,0xc9))[_0x7533('0x47')](handleError(_0x23a6c7,null));};exports['update']=function(_0x41144d,_0x4f7e75){if(_0x41144d[_0x7533('0x53')]['id']){delete _0x41144d[_0x7533('0x53')]['id'];}return db[_0x7533('0x2e')][_0x7533('0x4b')]({'where':{'id':_0x41144d[_0x7533('0x54')]['id']}})[_0x7533('0x25')](handleEntityNotFound(_0x4f7e75,null))['then'](saveUpdates(_0x41144d[_0x7533('0x53')],null))[_0x7533('0x25')](respondWithResult(_0x4f7e75,null))['catch'](handleError(_0x4f7e75,null));};exports[_0x7533('0x24')]=function(_0x2451be,_0x55ac4a){return db[_0x7533('0x2e')][_0x7533('0x4b')]({'where':{'id':_0x2451be[_0x7533('0x54')]['id']}})[_0x7533('0x25')](handleEntityNotFound(_0x55ac4a,null))['then'](removeEntity(_0x55ac4a,null))[_0x7533('0x47')](handleError(_0x55ac4a,null));};exports[_0x7533('0x55')]=function(_0x1c32d4,_0x8a959){return db[_0x7533('0x2e')][_0x7533('0x55')]()['then'](respondWithResult(_0x8a959,null))[_0x7533('0x47')](handleError(_0x8a959,null));};exports[_0x7533('0x56')]=function(_0x421228,_0x5b9af2,_0xc28f0c){if(_0x421228[_0x7533('0x53')]['id']){delete _0x421228[_0x7533('0x53')]['id'];}return db['CmList'][_0x7533('0x4b')]({'where':{'id':_0x421228[_0x7533('0x54')]['id']}})['then'](handleEntityNotFound(_0x5b9af2,null))['then'](function(_0x44f6f6){if(_0x44f6f6){_0x421228[_0x7533('0x53')][_0x7533('0x57')]=_0x44f6f6['id'];return db['Disposition'][_0x7533('0x4c')](_0x421228[_0x7533('0x53')]);}})[_0x7533('0x25')](respondWithResult(_0x5b9af2,null))[_0x7533('0x47')](handleError(_0x5b9af2,null));};exports[_0x7533('0x58')]=function(_0x114b8b,_0x298ad2,_0x3716a7){var _0x3cea55={'raw':![],'where':{}};var _0x1982d={};var _0x31aea3={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x114b8b[_0x7533('0x54')]['id']}})[_0x7533('0x25')](handleEntityNotFound(_0x298ad2,null))[_0x7533('0x25')](function(_0x28d0a4){if(_0x28d0a4){_0x1982d['model']=_[_0x7533('0x34')](db[_0x7533('0x59')][_0x7533('0x2f')]);_0x1982d[_0x7533('0x35')]=_[_0x7533('0x34')](_0x114b8b[_0x7533('0x35')]);_0x1982d['filters']=_[_0x7533('0x36')](_0x1982d[_0x7533('0x32')],_0x1982d[_0x7533('0x35')]);_0x3cea55['attributes']=_[_0x7533('0x36')](_0x1982d[_0x7533('0x32')],qs['fields'](_0x114b8b[_0x7533('0x35')]['fields']));_0x3cea55[_0x7533('0x38')]=_0x3cea55[_0x7533('0x38')][_0x7533('0x4a')]?_0x3cea55[_0x7533('0x38')]:_0x1982d[_0x7533('0x32')];if(!_0x114b8b[_0x7533('0x35')]['hasOwnProperty']('nolimit')){_0x3cea55[_0x7533('0x1d')]=qs[_0x7533('0x1d')](_0x114b8b[_0x7533('0x35')]['limit']);_0x3cea55[_0x7533('0x1c')]=qs[_0x7533('0x1c')](_0x114b8b[_0x7533('0x35')]['offset']);}_0x3cea55['order']=qs[_0x7533('0x3c')](_0x114b8b['query'][_0x7533('0x3c')]);_0x3cea55['where']=qs[_0x7533('0x49')](_[_0x7533('0x5a')](_0x114b8b[_0x7533('0x35')],_0x1982d[_0x7533('0x49')]));_0x3cea55['where'][_0x7533('0x57')]=_0x28d0a4['id'];if(_0x114b8b[_0x7533('0x35')]['filter']){_0x3cea55[_0x7533('0x3d')]=_[_0x7533('0x41')](_0x3cea55['where'],{'$or':_['map'](_0x3cea55[_0x7533('0x38')],function(_0x1c9332){var _0x5d2489={};_0x5d2489[_0x1c9332]={'$like':'%'+_0x114b8b['query'][_0x7533('0x40')]+'%'};return _0x5d2489;})});}_0x3cea55=_['merge']({},_0x3cea55,_0x114b8b[_0x7533('0x42')]);return db[_0x7533('0x59')][_0x7533('0x1e')]({'where':_0x3cea55['where']})[_0x7533('0x25')](function(_0xc5716f){_0x31aea3['count']=_0xc5716f;if(_0x114b8b[_0x7533('0x35')][_0x7533('0x43')]){_0x3cea55[_0x7533('0x44')]=[{'all':!![]}];}return db[_0x7533('0x59')][_0x7533('0x45')](_0x3cea55);})[_0x7533('0x25')](function(_0x3b4942){_0x31aea3[_0x7533('0x46')]=_0x3b4942;return _0x31aea3;});}})[_0x7533('0x25')](respondWithFilteredResult(_0x298ad2,_0x3cea55))[_0x7533('0x47')](handleError(_0x298ad2,null));};exports[_0x7533('0x5b')]=function(_0x129a63,_0xb6f27,_0x2a124e){return db[_0x7533('0x2e')][_0x7533('0x4b')]({'where':{'id':_0x129a63['params']['id']}})['then'](handleEntityNotFound(_0xb6f27,null))[_0x7533('0x25')](function(_0x252a5e){if(_0x252a5e){return _0x252a5e[_0x7533('0x5b')](_0x129a63[_0x7533('0x35')][_0x7533('0x5c')]);}})[_0x7533('0x25')](respondWithStatusCode(_0xb6f27,null))[_0x7533('0x47')](handleError(_0xb6f27,null));};exports[_0x7533('0x5d')]=function(_0x59d557,_0x28bebe,_0x122801){return db[_0x7533('0x2e')][_0x7533('0x4b')]({'where':{'id':_0x59d557[_0x7533('0x54')]['id']}})[_0x7533('0x25')](handleEntityNotFound(_0x28bebe,null))[_0x7533('0x25')](function(_0x47d2f7){if(_0x47d2f7){var _0x1d2618=[];var _0x3a8b98={'success':[],'errors':[]};return db[_0x7533('0x5e')][_0x7533('0x55')]()[_0x7533('0x25')](function(_0xba91a9){if(_0x59d557[_0x7533('0x53')][_0x7533('0x5f')]&&_[_0x7533('0x60')](_0x59d557[_0x7533('0x53')][_0x7533('0x5f')])){if(_0x59d557[_0x7533('0x53')][_0x7533('0x5f')]['length']){_0x59d557['body']['tags']=_0x59d557[_0x7533('0x53')]['tags']['join'](';')+';';}else{_0x59d557['body'][_0x7533('0x5f')]=null;}}else{_0x59d557[_0x7533('0x53')][_0x7533('0x5f')]=null;}if(_0x59d557[_0x7533('0x53')]&&_[_0x7533('0x60')](_0x59d557[_0x7533('0x53')])){for(var _0x4296fb=0x0;_0x4296fb<_0x59d557[_0x7533('0x53')][_0x7533('0x4a')];_0x4296fb+=0x1){_0x59d557[_0x7533('0x53')][_0x4296fb][_0x7533('0x57')]=_0x59d557['params']['id'];_0x1d2618[_0x7533('0x61')](_0x59d557[_0x7533('0x53')][_0x4296fb]);}return BPromise['each'](_0x1d2618,function(_0x2e99c0){return db['CmContact'][_0x7533('0x4c')](_[_0x7533('0x62')](_0x2e99c0,[_0x7533('0x5c'),'id'])||{},{'fields':_['keys'](_0xba91a9),'raw':!![]})[_0x7533('0x25')](function(_0x46bc0b){_0x3a8b98[_0x7533('0x63')][_0x7533('0x61')](_0x46bc0b['dataValues']);})['catch'](function(_0xb81805){_0x3a8b98[_0x7533('0x64')][_0x7533('0x61')]({'data':_0x2e99c0,'error':_0xb81805[_0x7533('0x65')]});});})[_0x7533('0x25')](function(_0x20bb54){return _0x3a8b98;})['catch'](function(_0x171509){return _0x171509;});}else{_0x28bebe['status'](0x190)[_0x7533('0x1b')]({'message':_0x7533('0x66')});}});}})['then'](respondWithResult(_0x28bebe,null))[_0x7533('0x47')](handleError(_0x28bebe,null));};exports[_0x7533('0x67')]=function(_0x38c0de,_0x3b7b78,_0x35e223){var _0x3f623d;return db['CmList']['find']({'where':{'id':_0x38c0de[_0x7533('0x54')]['id']},'include':[{'model':db[_0x7533('0x68')],'as':_0x7533('0x69')}]})[_0x7533('0x25')](handleEntityNotFound(_0x3b7b78,null))[_0x7533('0x25')](function(_0x23c530){if(_0x23c530){_0x3f623d=_0x23c530;return db[_0x7533('0x5e')][_0x7533('0x2f')];}})[_0x7533('0x25')](function(_0x23fa7f){if(_0x23fa7f){var _0x3721e6={};var _0x300739={};_0x300739[_0x7533('0x32')]=_[_0x7533('0x6a')](_[_0x7533('0x34')](_0x23fa7f),_[_0x7533('0x33')](_0x3f623d[_0x7533('0x69')],function(_0x2e2fe5){return util[_0x7533('0x6b')](_0x7533('0x6c'),_0x2e2fe5['id']);}));_0x300739[_0x7533('0x35')]=_[_0x7533('0x34')](_0x38c0de[_0x7533('0x35')]);_0x300739[_0x7533('0x49')]=_['intersection'](_0x300739['model'],_0x300739[_0x7533('0x35')]);_0x3721e6[_0x7533('0x38')]=_[_0x7533('0x36')](_0x300739[_0x7533('0x32')],qs['fields'](_0x38c0de[_0x7533('0x35')]['fields']));_0x3721e6[_0x7533('0x38')]=_0x3721e6['attributes'][_0x7533('0x4a')]?_0x3721e6[_0x7533('0x38')]:_0x300739[_0x7533('0x32')];if(!_0x38c0de[_0x7533('0x35')]['hasOwnProperty'](_0x7533('0x3a'))){_0x3721e6['limit']=qs[_0x7533('0x1d')](_0x38c0de[_0x7533('0x35')][_0x7533('0x1d')]);_0x3721e6[_0x7533('0x1c')]=qs[_0x7533('0x1c')](_0x38c0de[_0x7533('0x35')][_0x7533('0x1c')]);}_0x3721e6[_0x7533('0x3b')]=qs[_0x7533('0x3c')](_0x38c0de[_0x7533('0x35')][_0x7533('0x3c')]);_0x3721e6['where']=qs['filters'](_[_0x7533('0x5a')](_0x38c0de[_0x7533('0x35')],_0x300739[_0x7533('0x49')]));_0x3721e6[_0x7533('0x6d')]=!![];if(_0x38c0de[_0x7533('0x35')]['filter']){_0x3721e6[_0x7533('0x3d')]=_['merge'](_0x3721e6[_0x7533('0x3d')],{'$or':_[_0x7533('0x33')](_0x3721e6[_0x7533('0x38')],function(_0x206627){var _0x43c63c={};_0x43c63c[_0x206627]={'$like':'%'+_0x38c0de[_0x7533('0x35')][_0x7533('0x40')]+'%'};return _0x43c63c;})});}_0x3721e6=_[_0x7533('0x41')]({},_0x3721e6,_0x38c0de['options']);return _0x3f623d[_0x7533('0x67')](_0x3721e6);}})[_0x7533('0x25')](respondWithResult(_0x3b7b78,null))[_0x7533('0x47')](handleError(_0x3b7b78,null));};exports['getContactsCsv']=function(_0x1042f8,_0x3bc00f,_0x43af01){var _0x498d55;return db['CmList'][_0x7533('0x4b')]({'where':{'id':_0x1042f8[_0x7533('0x54')]['id']},'include':[{'model':db[_0x7533('0x68')],'as':_0x7533('0x69')}]})['then'](handleEntityNotFound(_0x3bc00f,null))[_0x7533('0x25')](function(_0x3d42e0){if(_0x3d42e0){_0x498d55=_0x3d42e0;return db['CmContact'][_0x7533('0x2f')];}})[_0x7533('0x25')](function(_0x38f5d4){if(_0x38f5d4){var _0x432ad6={};var _0x320890={};_0x320890[_0x7533('0x32')]=_['concat'](_['keys'](_0x38f5d4),_[_0x7533('0x33')](_0x498d55['CustomFields'],function(_0x56a2d3){return util[_0x7533('0x6b')](_0x7533('0x6c'),_0x56a2d3['id']);}));_0x320890[_0x7533('0x35')]=_[_0x7533('0x34')](_0x1042f8['query']);_0x320890[_0x7533('0x49')]=_['intersection'](_0x320890[_0x7533('0x32')],_0x320890[_0x7533('0x35')]);_0x432ad6[_0x7533('0x38')]=_['intersection'](_0x320890[_0x7533('0x32')],qs[_0x7533('0x37')](_0x1042f8['query']['fields']));_0x432ad6[_0x7533('0x38')]=_0x432ad6['attributes'][_0x7533('0x4a')]?_0x432ad6[_0x7533('0x38')]:_0x320890['model'];if(!_0x1042f8[_0x7533('0x35')][_0x7533('0x39')](_0x7533('0x3a'))){_0x432ad6[_0x7533('0x1d')]=qs['limit'](_0x1042f8['query'][_0x7533('0x1d')]);_0x432ad6[_0x7533('0x1c')]=qs[_0x7533('0x1c')](_0x1042f8[_0x7533('0x35')]['offset']);}_0x432ad6['order']=qs[_0x7533('0x3c')](_0x1042f8[_0x7533('0x35')][_0x7533('0x3c')]);_0x432ad6['where']=qs['filters'](_[_0x7533('0x5a')](_0x1042f8[_0x7533('0x35')],_0x320890[_0x7533('0x49')]));_0x432ad6[_0x7533('0x6d')]=!![];if(_0x1042f8['query'][_0x7533('0x40')]){_0x432ad6[_0x7533('0x3d')]=_[_0x7533('0x41')](_0x432ad6[_0x7533('0x3d')],{'$or':_[_0x7533('0x33')](_0x432ad6['attributes'],function(_0x52b4ca){var _0x4e3257={};_0x4e3257[_0x52b4ca]={'$like':'%'+_0x1042f8['query']['filter']+'%'};return _0x4e3257;})});}_0x432ad6=_['merge']({},_0x432ad6,_0x1042f8['options']);return _0x498d55[_0x7533('0x67')](_0x432ad6);}})[_0x7533('0x25')](function(_0x428861){if(!_['isEmpty'](_0x428861)){var _0x4d898b=toCsv(_0x428861);var _0x6932b0=Date[_0x7533('0x6e')]();fs[_0x7533('0x6f')](util[_0x7533('0x6b')](_0x7533('0x70'),_0x498d55['id'],_0x6932b0),_0x4d898b);_0x3bc00f[_0x7533('0x71')]('Content-disposition',_0x7533('0x72')+util['format']('list_%d_%s.csv',_0x498d55['id'],_0x6932b0));_0x3bc00f['setHeader'](_0x7533('0x73'),_0x7533('0x74'));return _0x3bc00f[_0x7533('0x75')](util[_0x7533('0x6b')](_0x7533('0x70'),_0x498d55['id'],_0x6932b0));}else{return _0x3bc00f[_0x7533('0x19')](0xcc);}})[_0x7533('0x47')](handleError(_0x3bc00f,null));};exports[_0x7533('0x76')]=function(_0x4495a4,_0x16f2df,_0x5c72e8){var _0xde02d;delete _0x4495a4[_0x7533('0x53')]['id'];return db[_0x7533('0x2e')]['findOne']({'where':{'id':_0x4495a4['params']['id']}})['then'](handleEntityNotFound(_0x16f2df,null))[_0x7533('0x25')](function(_0x50f65b){if(_0x50f65b){return db[_0x7533('0x77')]['transaction'](function(_0x425968){return db['CmCustomField']['create'](_0x4495a4[_0x7533('0x53')],{'transaction':_0x425968})[_0x7533('0x25')](function(_0x2df556){_0xde02d=_0x2df556;return _0x50f65b[_0x7533('0x78')](_0x2df556,{'transaction':_0x425968});})[_0x7533('0x25')](function(){var _0x3245b7={'type':db[_0x7533('0x79')]['TEXT'],'transaction':_0x425968};switch(_0x4495a4['body'][_0x7533('0x3e')]){case _0x7533('0x7a'):_0x3245b7[_0x7533('0x3e')]=db[_0x7533('0x79')][_0x7533('0x7b')];break;case _0x7533('0x7c'):_0x3245b7['type']=db[_0x7533('0x79')][_0x7533('0x7d')];break;case _0x7533('0x7e'):_0x3245b7[_0x7533('0x3e')]=db['Sequelize'][_0x7533('0x7f')];_0x3245b7['defaultValue']=![];break;default:}return db[_0x7533('0x77')]['queryInterface'][_0x7533('0x80')]('cm_contacts',util[_0x7533('0x6b')](_0x7533('0x81'),_0xde02d['id']),_0x3245b7);})[_0x7533('0x25')](function(){return _0xde02d;});});}})[_0x7533('0x25')](respondWithResult(_0x16f2df,null))['catch'](handleError(_0x16f2df,null));};exports[_0x7533('0x82')]=function(_0x2dc14d,_0x3868e7,_0xb9b285){var _0x23a448={};var _0xf793f6={};var _0x3a33ed;var _0x1e7ebf;return db[_0x7533('0x2e')][_0x7533('0x83')]({'where':{'id':_0x2dc14d[_0x7533('0x54')]['id']}})[_0x7533('0x25')](handleEntityNotFound(_0x3868e7,null))['then'](function(_0x1f9e06){if(_0x1f9e06){_0x3a33ed=_0x1f9e06;_0xf793f6['model']=_[_0x7533('0x34')](db[_0x7533('0x68')][_0x7533('0x2f')]);_0xf793f6[_0x7533('0x35')]=_[_0x7533('0x34')](_0x2dc14d[_0x7533('0x35')]);_0xf793f6[_0x7533('0x49')]=_['intersection'](_0xf793f6['model'],_0xf793f6[_0x7533('0x35')]);_0x23a448[_0x7533('0x38')]=_[_0x7533('0x36')](_0xf793f6[_0x7533('0x32')],qs[_0x7533('0x37')](_0x2dc14d['query'][_0x7533('0x37')]));_0x23a448['attributes']=_0x23a448['attributes']['length']?_0x23a448[_0x7533('0x38')]:_0xf793f6[_0x7533('0x32')];_0x23a448['order']=qs[_0x7533('0x3c')](_0x2dc14d['query'][_0x7533('0x3c')]);_0x23a448[_0x7533('0x3d')]=qs[_0x7533('0x49')](_[_0x7533('0x5a')](_0x2dc14d['query'],_0xf793f6[_0x7533('0x49')]));_0x23a448['where']=_[_0x7533('0x41')](_0x23a448[_0x7533('0x3d')],{'$or':[{'ListId':_0x1f9e06['id']},{'ListId':null}]});if(_0x2dc14d[_0x7533('0x35')][_0x7533('0x40')]){_0x23a448[_0x7533('0x3d')]=_[_0x7533('0x41')](_0x23a448[_0x7533('0x3d')],{'$or':_[_0x7533('0x33')](_0x23a448[_0x7533('0x38')],function(_0x2a893c){var _0x30fce1={};_0x30fce1[_0x2a893c]={'$like':'%'+_0x2dc14d['query'][_0x7533('0x40')]+'%'};return _0x30fce1;})});}_0x23a448=_[_0x7533('0x41')]({},_0x23a448,_0x2dc14d[_0x7533('0x42')]);return db[_0x7533('0x68')][_0x7533('0x84')](_0x23a448);}})[_0x7533('0x25')](respondWithResult(_0x3868e7,null))[_0x7533('0x47')](handleError(_0x3868e7,null));};exports[_0x7533('0x85')]=function(_0x7fbbf7,_0x146c0f,_0x3244f0){return db['CmList']['find']({'where':{'id':_0x7fbbf7[_0x7533('0x54')]['id']}})['then'](handleEntityNotFound(_0x146c0f,null))[_0x7533('0x25')](function(_0x3ff9c0){if(_0x3ff9c0){return _0x3ff9c0[_0x7533('0x85')](_0x7fbbf7[_0x7533('0x53')][_0x7533('0x5c')],_[_0x7533('0x62')](_0x7fbbf7['body'],['ids','id'])||{})[_0x7533('0x86')](function(_0xe05aeb){for(var _0x1a3dba=0x0;_0x1a3dba<_0x7fbbf7[_0x7533('0x53')]['ids'][_0x7533('0x4a')];_0x1a3dba+=0x1){socket[_0x7533('0x87')](_0x7533('0x88'),{'UserId':Number(_0x7fbbf7['body'][_0x7533('0x5c')][_0x1a3dba]),'CmListId':Number(_0x7fbbf7[_0x7533('0x54')]['id'])});}return _0xe05aeb;});}})[_0x7533('0x25')](respondWithResult(_0x146c0f,null))[_0x7533('0x47')](handleError(_0x146c0f,null));};exports[_0x7533('0x89')]=function(_0x54ae70,_0x31f62c,_0x147d3f){return db[_0x7533('0x2e')][_0x7533('0x4b')]({'where':{'id':_0x54ae70['params']['id']}})[_0x7533('0x25')](handleEntityNotFound(_0x31f62c,null))['then'](function(_0x5e48ce){if(_0x5e48ce){return _0x5e48ce[_0x7533('0x89')](_0x54ae70[_0x7533('0x35')][_0x7533('0x5c')])[_0x7533('0x25')](function(){if(_[_0x7533('0x60')](_0x54ae70['query'][_0x7533('0x5c')])){for(var _0x3eba66=0x0;_0x3eba66<_0x54ae70[_0x7533('0x35')][_0x7533('0x5c')][_0x7533('0x4a')];_0x3eba66+=0x1){socket['emit'](_0x7533('0x8a'),{'UserId':Number(_0x54ae70[_0x7533('0x35')][_0x7533('0x5c')][_0x3eba66]),'CmListId':Number(_0x54ae70[_0x7533('0x54')]['id'])});}}else{socket[_0x7533('0x87')](_0x7533('0x8a'),{'UserId':Number(_0x54ae70[_0x7533('0x35')][_0x7533('0x5c')]),'CmListId':Number(_0x54ae70['params']['id'])});}});}})[_0x7533('0x25')](respondWithStatusCode(_0x31f62c,null))[_0x7533('0x47')](handleError(_0x31f62c,null));};exports['getAgents']=function(_0x1105b0,_0x59c46d,_0xd773ee){var _0x40d17b={};var _0x3350c9={};var _0x39cbb0;var _0x12155a;return db[_0x7533('0x2e')]['findOne']({'where':{'id':_0x1105b0[_0x7533('0x54')]['id']}})['then'](handleEntityNotFound(_0x59c46d,null))[_0x7533('0x25')](function(_0x14ff39){if(_0x14ff39){_0x39cbb0=_0x14ff39;_0x3350c9['model']=_[_0x7533('0x34')](db[_0x7533('0x8b')][_0x7533('0x2f')]);_0x3350c9[_0x7533('0x35')]=_[_0x7533('0x34')](_0x1105b0[_0x7533('0x35')]);_0x3350c9['filters']=_[_0x7533('0x36')](_0x3350c9[_0x7533('0x32')],_0x3350c9[_0x7533('0x35')]);_0x40d17b[_0x7533('0x38')]=_[_0x7533('0x36')](_0x3350c9[_0x7533('0x32')],qs['fields'](_0x1105b0['query'][_0x7533('0x37')]));_0x40d17b['attributes']=_0x40d17b[_0x7533('0x38')][_0x7533('0x4a')]?_0x40d17b['attributes']:_0x3350c9[_0x7533('0x32')];_0x40d17b[_0x7533('0x3b')]=qs[_0x7533('0x3c')](_0x1105b0['query'][_0x7533('0x3c')]);_0x40d17b[_0x7533('0x3d')]=qs[_0x7533('0x49')](_[_0x7533('0x5a')](_0x1105b0[_0x7533('0x35')],_0x3350c9[_0x7533('0x49')]));if(_0x1105b0[_0x7533('0x35')][_0x7533('0x40')]){_0x40d17b[_0x7533('0x3d')]=_['merge'](_0x40d17b[_0x7533('0x3d')],{'$or':_[_0x7533('0x33')](_0x40d17b['attributes'],function(_0x219ec3){var _0x3caff7={};_0x3caff7[_0x219ec3]={'$like':'%'+_0x1105b0[_0x7533('0x35')][_0x7533('0x40')]+'%'};return _0x3caff7;})});}_0x40d17b=_[_0x7533('0x41')]({},_0x40d17b,_0x1105b0[_0x7533('0x42')]);return _0x39cbb0[_0x7533('0x8c')](_0x40d17b);}})[_0x7533('0x25')](function(_0x290649){if(_0x290649){_0x12155a=_0x290649[_0x7533('0x4a')];if(!_0x1105b0['query'][_0x7533('0x39')](_0x7533('0x3a'))){_0x40d17b[_0x7533('0x1d')]=qs[_0x7533('0x1d')](_0x1105b0[_0x7533('0x35')][_0x7533('0x1d')]);_0x40d17b['offset']=qs['offset'](_0x1105b0[_0x7533('0x35')]['offset']);}return _0x39cbb0[_0x7533('0x8c')](_0x40d17b);}})[_0x7533('0x25')](function(_0x4b263a){if(_0x4b263a){return _0x4b263a?{'count':_0x12155a,'rows':_0x4b263a}:null;}})[_0x7533('0x25')](respondWithResult(_0x59c46d,null))[_0x7533('0x47')](handleError(_0x59c46d,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 34364eb..cfe8d3a 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x102871,_0x126630){_0x102871=_0x102871-0x0;var _0x19f015=_0x326f[_0x102871];return _0x19f015;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x172d9c,_0x1d4da7){_0x172d9c=_0x172d9c-0x0;var _0x5ba879=_0x3e74[_0x172d9c];return _0x5ba879;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index be9aac5..3866593 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 _0xa74f=['cm_lists','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x16b737,_0x16d0cb){var _0x3405fa=function(_0x389d5b){while(--_0x389d5b){_0x16b737['push'](_0x16b737['shift']());}};_0x3405fa(++_0x16d0cb);}(_0xa74f,0x9a));var _0xfa74=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xa74f[_0x257a28];return _0x13bccc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c76=['define','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x24d455,_0x7f4ae1){var _0x31392a=function(_0x4cbf9f){while(--_0x4cbf9f){_0x24d455['push'](_0x24d455['shift']());}};_0x31392a(++_0x7f4ae1);}(_0x6c76,0x184));var _0x66c7=function(_0x592a76,_0x82b8ab){_0x592a76=_0x592a76-0x0;var _0x5b0367=_0x6c76[_0x592a76];return _0x5b0367;};'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('./cmList.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('CmList',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 dfefbf7..24310fc 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 _0x922f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x392365,_0x54e90e){var _0x493d94=function(_0xaded29){while(--_0xaded29){_0x392365['push'](_0x392365['shift']());}};_0x493d94(++_0x54e90e);}(_0x922f,0x117));var _0xf922=function(_0x5d6e45,_0x47bc47){_0x5d6e45=_0x5d6e45-0x0;var _0x53a7f1=_0x922f[_0x5d6e45];return _0x53a7f1;};'use strict';var _=require(_0xf922('0x0'));var util=require(_0xf922('0x1'));var moment=require(_0xf922('0x2'));var BPromise=require(_0xf922('0x3'));var rs=require(_0xf922('0x4'));var fs=require('fs');var Redis=require(_0xf922('0x5'));var db=require(_0xf922('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf922('0x7'))(_0xf922('0x8'));var config=require('../../config/environment');var jayson=require(_0xf922('0x9'));var client=jayson[_0xf922('0xa')]['http']({'port':0x232a});config['redis']=_[_0xf922('0xb')](config[_0xf922('0xc')],{'host':_0xf922('0xd'),'port':0x18eb});var socket=require(_0xf922('0xe'))(new Redis(config[_0xf922('0xc')]));require(_0xf922('0xf'))[_0xf922('0x10')](socket);function respondWithRpcPromise(_0x75973e,_0xb5665a,_0x284bdf){return new BPromise(function(_0x4756a9,_0x173c6b){return client[_0xf922('0x11')](_0x75973e,_0x284bdf)[_0xf922('0x12')](function(_0x55a85d){logger[_0xf922('0x13')](_0xf922('0x14'),_0xb5665a,'request\x20sent');logger['debug'](_0xf922('0x15'),_0xb5665a,_0xf922('0x16'),JSON[_0xf922('0x17')](_0x55a85d));if(_0x55a85d[_0xf922('0x18')]){if(_0x55a85d[_0xf922('0x18')][_0xf922('0x19')]===0x1f4){logger[_0xf922('0x18')](_0xf922('0x14'),_0xb5665a,_0x55a85d[_0xf922('0x18')][_0xf922('0x1a')]);return _0x173c6b(_0x55a85d['error'][_0xf922('0x1a')]);}logger[_0xf922('0x18')](_0xf922('0x14'),_0xb5665a,_0x55a85d[_0xf922('0x18')][_0xf922('0x1a')]);return _0x4756a9(_0x55a85d['error'][_0xf922('0x1a')]);}else{logger[_0xf922('0x13')](_0xf922('0x14'),_0xb5665a,'request\x20sent');_0x4756a9(_0x55a85d['result'][_0xf922('0x1a')]);}})[_0xf922('0x1b')](function(_0x437768){logger[_0xf922('0x18')](_0xf922('0x14'),_0xb5665a,_0x437768);_0x173c6b(_0x437768);});});} \ No newline at end of file +var _0x7a06=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x422d4b,_0x1ce750){var _0x483cf7=function(_0x21c188){while(--_0x21c188){_0x422d4b['push'](_0x422d4b['shift']());}};_0x483cf7(++_0x1ce750);}(_0x7a06,0x6a));var _0x67a0=function(_0x25c49d,_0xcc82ce){_0x25c49d=_0x25c49d-0x0;var _0x448469=_0x7a06[_0x25c49d];return _0x448469;};'use strict';var _=require(_0x67a0('0x0'));var util=require(_0x67a0('0x1'));var moment=require(_0x67a0('0x2'));var BPromise=require('bluebird');var rs=require(_0x67a0('0x3'));var fs=require('fs');var Redis=require(_0x67a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x67a0('0x5'));var jayson=require(_0x67a0('0x6'));var client=jayson[_0x67a0('0x7')]['http']({'port':0x232a});config[_0x67a0('0x8')]=_[_0x67a0('0x9')](config[_0x67a0('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x67a0('0xa'))(new Redis(config[_0x67a0('0x8')]));require(_0x67a0('0xb'))[_0x67a0('0xc')](socket);function respondWithRpcPromise(_0xe68602,_0x335db1,_0x56f103){return new BPromise(function(_0x13f36a,_0x4da01b){return client[_0x67a0('0xd')](_0xe68602,_0x56f103)[_0x67a0('0xe')](function(_0x14e4ac){logger[_0x67a0('0xf')](_0x67a0('0x10'),_0x335db1,_0x67a0('0x11'));logger[_0x67a0('0x12')](_0x67a0('0x13'),_0x335db1,_0x67a0('0x11'),JSON[_0x67a0('0x14')](_0x14e4ac));if(_0x14e4ac[_0x67a0('0x15')]){if(_0x14e4ac[_0x67a0('0x15')]['code']===0x1f4){logger[_0x67a0('0x15')](_0x67a0('0x10'),_0x335db1,_0x14e4ac[_0x67a0('0x15')][_0x67a0('0x16')]);return _0x4da01b(_0x14e4ac[_0x67a0('0x15')][_0x67a0('0x16')]);}logger['error'](_0x67a0('0x10'),_0x335db1,_0x14e4ac[_0x67a0('0x15')]['message']);return _0x13f36a(_0x14e4ac[_0x67a0('0x15')][_0x67a0('0x16')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x335db1,_0x67a0('0x11'));_0x13f36a(_0x14e4ac[_0x67a0('0x17')]['message']);}})[_0x67a0('0x18')](function(_0x2d44b7){logger['error'](_0x67a0('0x10'),_0x335db1,_0x2d44b7);_0x4da01b(_0x2d44b7);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index ff26792..07e366d 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 _0xe2c8=['register','length','cmList:','./cmList.events','remove','update','removeListener'];(function(_0x5ba014,_0x51c29e){var _0x5e1971=function(_0x4168ef){while(--_0x4168ef){_0x5ba014['push'](_0x5ba014['shift']());}};_0x5e1971(++_0x51c29e);}(_0xe2c8,0x17d));var _0x8e2c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xe2c8[_0x3511d3];return _0x5d6321;};'use strict';var CmListEvents=require(_0x8e2c('0x0'));var events=['save',_0x8e2c('0x1'),_0x8e2c('0x2')];function createListener(_0x43ac85,_0x3db327){return function(_0xeca532){_0x3db327['emit'](_0x43ac85,_0xeca532);};}function removeListener(_0x408609,_0xa75c9a){return function(){CmListEvents[_0x8e2c('0x3')](_0x408609,_0xa75c9a);};}exports[_0x8e2c('0x4')]=function(_0x3f039b){for(var _0x2ac58d=0x0,_0x8b17be=events[_0x8e2c('0x5')];_0x2ac58d<_0x8b17be;_0x2ac58d++){var _0x2b9e3e=events[_0x2ac58d];var _0x45bfc5=createListener(_0x8e2c('0x6')+_0x2b9e3e,_0x3f039b);CmListEvents['on'](_0x2b9e3e,_0x45bfc5);}}; \ No newline at end of file +var _0x08da=['remove','emit','removeListener','register','length','cmList:','save'];(function(_0xc4998a,_0x56d417){var _0x43b4bc=function(_0x3971fb){while(--_0x3971fb){_0xc4998a['push'](_0xc4998a['shift']());}};_0x43b4bc(++_0x56d417);}(_0x08da,0x180));var _0xa08d=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x08da[_0x341e0f];return _0x59555a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xa08d('0x0'),_0xa08d('0x1'),'update'];function createListener(_0x3b1dcc,_0x4119ca){return function(_0x34cf03){_0x4119ca[_0xa08d('0x2')](_0x3b1dcc,_0x34cf03);};}function removeListener(_0x50abf7,_0x2b272b){return function(){CmListEvents[_0xa08d('0x3')](_0x50abf7,_0x2b272b);};}exports[_0xa08d('0x4')]=function(_0x277770){for(var _0x17635c=0x0,_0x272991=events[_0xa08d('0x5')];_0x17635c<_0x272991;_0x17635c++){var _0x1210d0=events[_0x17635c];var _0x58f858=createListener(_0xa08d('0x6')+_0x1210d0,_0x277770);CmListEvents['on'](_0x1210d0,_0x58f858);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e5438e0..f1c65ed 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 _0xc84f=['describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./cmList.controller','get','isAuthenticated'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xc84f,0x197));var _0xfc84=function(_0x44c99e,_0x21c373){_0x44c99e=_0x44c99e-0x0;var _0x4746c2=_0xc84f[_0x44c99e];return _0x4746c2;};'use strict';var multer=require('multer');var util=require(_0xfc84('0x0'));var path=require('path');var timeout=require(_0xfc84('0x1'));var express=require(_0xfc84('0x2'));var router=express[_0xfc84('0x3')]();var fs_extra=require(_0xfc84('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfc84('0x5'));var controller=require(_0xfc84('0x6'));router[_0xfc84('0x7')]('/',auth[_0xfc84('0x8')](),controller['index']);router['get']('/describe',auth[_0xfc84('0x8')](),controller[_0xfc84('0x9')]);router['get'](_0xfc84('0xa'),auth['isAuthenticated'](),controller[_0xfc84('0xb')]);router[_0xfc84('0x7')](_0xfc84('0xc'),auth['isAuthenticated'](),controller[_0xfc84('0xd')]);router[_0xfc84('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xfc84('0xe')]);router[_0xfc84('0x7')](_0xfc84('0xf'),auth['isAuthenticated'](),controller[_0xfc84('0x10')]);router[_0xfc84('0x7')](_0xfc84('0x11'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x12')]);router[_0xfc84('0x7')](_0xfc84('0x13'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x14')]);router[_0xfc84('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfc84('0xc'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x16')]);router['post']('/:id/contacts',auth[_0xfc84('0x8')](),controller[_0xfc84('0x17')]);router[_0xfc84('0x15')](_0xfc84('0x11'),auth[_0xfc84('0x8')](),controller['addCustomField']);router[_0xfc84('0x15')](_0xfc84('0x13'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x18')]);router[_0xfc84('0x19')]('/:id',auth[_0xfc84('0x8')](),controller[_0xfc84('0x1a')]);router[_0xfc84('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xfc84('0x1c')]);router['delete'](_0xfc84('0xc'),auth[_0xfc84('0x8')](),controller[_0xfc84('0x1d')]);router[_0xfc84('0x1b')]('/:id/users',auth[_0xfc84('0x8')](),controller[_0xfc84('0x1e')]);module[_0xfc84('0x1f')]=router; \ No newline at end of file +var _0xc367=['/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','addAgents','update','delete','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions'];(function(_0x3f7f09,_0x4542b3){var _0x29ac03=function(_0x3f38ba){while(--_0x3f38ba){_0x3f7f09['push'](_0x3f7f09['shift']());}};_0x29ac03(++_0x4542b3);}(_0xc367,0x67));var _0x7c36=function(_0x5903d7,_0x4f4955){_0x5903d7=_0x5903d7-0x0;var _0x49a11a=_0xc367[_0x5903d7];return _0x49a11a;};'use strict';var multer=require(_0x7c36('0x0'));var util=require(_0x7c36('0x1'));var path=require('path');var timeout=require(_0x7c36('0x2'));var express=require(_0x7c36('0x3'));var router=express[_0x7c36('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7c36('0x6'));var controller=require('./cmList.controller');router[_0x7c36('0x7')]('/',auth[_0x7c36('0x8')](),controller['index']);router[_0x7c36('0x7')]('/describe',auth[_0x7c36('0x8')](),controller[_0x7c36('0x9')]);router[_0x7c36('0x7')](_0x7c36('0xa'),auth[_0x7c36('0x8')](),controller['show']);router['get'](_0x7c36('0xb'),auth['isAuthenticated'](),controller[_0x7c36('0xc')]);router['get'](_0x7c36('0xd'),auth[_0x7c36('0x8')](),controller['getContacts']);router[_0x7c36('0x7')](_0x7c36('0xe'),auth[_0x7c36('0x8')](),controller[_0x7c36('0xf')]);router[_0x7c36('0x7')](_0x7c36('0x10'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x11')]);router['get']('/:id/users',auth[_0x7c36('0x8')](),controller[_0x7c36('0x12')]);router[_0x7c36('0x13')]('/',auth['isAuthenticated'](),controller[_0x7c36('0x14')]);router['post'](_0x7c36('0xb'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x15')]);router[_0x7c36('0x13')](_0x7c36('0xd'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x16')]);router[_0x7c36('0x13')](_0x7c36('0x10'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x17')]);router[_0x7c36('0x13')](_0x7c36('0x18'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x19')]);router['put'](_0x7c36('0xa'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x1a')]);router[_0x7c36('0x1b')]('/:id',auth[_0x7c36('0x8')](),controller['destroy']);router[_0x7c36('0x1b')](_0x7c36('0xb'),auth[_0x7c36('0x8')](),controller['removeDispositions']);router[_0x7c36('0x1b')](_0x7c36('0x18'),auth[_0x7c36('0x8')](),controller[_0x7c36('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 2530104..a7faef1 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 _0x00a4=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00a4,0x198));var _0x400a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00a4[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x400a('0x0'));module[_0x400a('0x1')]={'name':{'type':Sequelize[_0x400a('0x2')],'get':function(_0x4fad0f){return this[_0x400a('0x3')](_0x400a('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x400a('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x8bd1=['getDataValue','field','STRING'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x8bd1,0x1c8));var _0x18bd=function(_0x56213b,_0x307ddf){_0x56213b=_0x56213b-0x0;var _0x15948c=_0x8bd1[_0x56213b];return _0x15948c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3227be){return this[_0x18bd('0x0')](_0x18bd('0x1'));}},'field':{'type':Sequelize[_0x18bd('0x2')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x18bd('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index e3299bf..b899d31 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x26fb4b,_0x5a0591){var _0x4e790f=function(_0x2b9393){while(--_0x2b9393){_0x26fb4b['push'](_0x26fb4b['shift']());}};_0x4e790f(++_0x5a0591);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +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(_0x28d8b8,_0x29fd1d){var _0xa0806e=function(_0x552a39){while(--_0x552a39){_0x28d8b8['push'](_0x28d8b8['shift']());}};_0xa0806e(++_0x29fd1d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 4e41536..345040e 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 _0x2a16=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x4ec54f,_0x60e104){var _0x28d59d=function(_0x964591){while(--_0x964591){_0x4ec54f['push'](_0x4ec54f['shift']());}};_0x28d59d(++_0x60e104);}(_0x2a16,0xe0));var _0x62a1=function(_0x523645,_0x45d437){_0x523645=_0x523645-0x0;var _0x5326a5=_0x2a16[_0x523645];return _0x5326a5;};'use strict';var _=require(_0x62a1('0x0'));var util=require(_0x62a1('0x1'));var logger=require(_0x62a1('0x2'))(_0x62a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x62a1('0x4'));var fs=require('fs');var path=require(_0x62a1('0x5'));var rimraf=require(_0x62a1('0x6'));var config=require(_0x62a1('0x7'));var attributes=require(_0x62a1('0x8'));module[_0x62a1('0x9')]=function(_0x7ed0e4,_0x2ebc33){return _0x7ed0e4[_0x62a1('0xa')](_0x62a1('0xb'),attributes,{'tableName':_0x62a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda8a=['./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21aa18,_0x17316d){var _0x97b86e=function(_0x2e0fee){while(--_0x2e0fee){_0x21aa18['push'](_0x21aa18['shift']());}};_0x97b86e(++_0x17316d);}(_0xda8a,0x1be));var _0xada8=function(_0x499716,_0x2d8909){_0x499716=_0x499716-0x0;var _0x2ab4da=_0xda8a[_0x499716];return _0x2ab4da;};'use strict';var _=require(_0xada8('0x0'));var util=require(_0xada8('0x1'));var logger=require(_0xada8('0x2'))(_0xada8('0x3'));var moment=require('moment');var BPromise=require(_0xada8('0x4'));var rp=require(_0xada8('0x5'));var fs=require('fs');var path=require(_0xada8('0x6'));var rimraf=require(_0xada8('0x7'));var config=require(_0xada8('0x8'));var attributes=require(_0xada8('0x9'));module[_0xada8('0xa')]=function(_0x4d515b,_0x3e87c6){return _0x4d515b['define'](_0xada8('0xb'),attributes,{'tableName':_0xada8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 7c91d1d..03b1627 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 _0x4869=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','randomstring','ioredis'];(function(_0x15354a,_0x16edaa){var _0x3a55ab=function(_0x498af8){while(--_0x498af8){_0x15354a['push'](_0x15354a['shift']());}};_0x3a55ab(++_0x16edaa);}(_0x4869,0xb1));var _0x9486=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4869[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x9486('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9486('0x1'));var fs=require('fs');var Redis=require(_0x9486('0x2'));var db=require(_0x9486('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9486('0x4'))(_0x9486('0x5'));var config=require('../../config/environment');var jayson=require(_0x9486('0x6'));var client=jayson['client'][_0x9486('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24bec0,_0x198c57,_0x15ef2d){return new BPromise(function(_0x570bff,_0x5ac6d1){return client[_0x9486('0x8')](_0x24bec0,_0x15ef2d)[_0x9486('0x9')](function(_0x423cf3){logger['info'](_0x9486('0xa'),_0x198c57,_0x9486('0xb'));logger['debug'](_0x9486('0xc'),_0x198c57,_0x9486('0xb'),JSON[_0x9486('0xd')](_0x423cf3));if(_0x423cf3[_0x9486('0xe')]){if(_0x423cf3['error'][_0x9486('0xf')]===0x1f4){logger[_0x9486('0xe')](_0x9486('0xa'),_0x198c57,_0x423cf3[_0x9486('0xe')][_0x9486('0x10')]);return _0x5ac6d1(_0x423cf3[_0x9486('0xe')][_0x9486('0x10')]);}logger[_0x9486('0xe')]('Condition,\x20%s,\x20%s',_0x198c57,_0x423cf3[_0x9486('0xe')][_0x9486('0x10')]);return _0x570bff(_0x423cf3[_0x9486('0xe')]['message']);}else{logger[_0x9486('0x11')]('Condition,\x20%s,\x20%s',_0x198c57,_0x9486('0xb'));_0x570bff(_0x423cf3[_0x9486('0x12')][_0x9486('0x10')]);}})[_0x9486('0x13')](function(_0x1f592c){logger[_0x9486('0xe')]('Condition,\x20%s,\x20%s',_0x198c57,_0x1f592c);_0x5ac6d1(_0x1f592c);});});} \ No newline at end of file +var _0x8a63=['info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0x8a63,0x136));var _0x38a6=function(_0x2c574e,_0x491053){_0x2c574e=_0x2c574e-0x0;var _0x1101f7=_0x8a63[_0x2c574e];return _0x1101f7;};'use strict';var _=require('lodash');var util=require(_0x38a6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x38a6('0x1'));var fs=require('fs');var Redis=require(_0x38a6('0x2'));var db=require(_0x38a6('0x3'))['db'];var utils=require(_0x38a6('0x4'));var logger=require(_0x38a6('0x5'))(_0x38a6('0x6'));var config=require(_0x38a6('0x7'));var jayson=require(_0x38a6('0x8'));var client=jayson[_0x38a6('0x9')][_0x38a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1de8b6,_0xba02d6,_0x11329e){return new BPromise(function(_0x11b087,_0x29125c){return client['request'](_0x1de8b6,_0x11329e)[_0x38a6('0xb')](function(_0x452916){logger[_0x38a6('0xc')](_0x38a6('0xd'),_0xba02d6,_0x38a6('0xe'));logger[_0x38a6('0xf')](_0x38a6('0x10'),_0xba02d6,_0x38a6('0xe'),JSON[_0x38a6('0x11')](_0x452916));if(_0x452916[_0x38a6('0x12')]){if(_0x452916[_0x38a6('0x12')][_0x38a6('0x13')]===0x1f4){logger[_0x38a6('0x12')](_0x38a6('0xd'),_0xba02d6,_0x452916[_0x38a6('0x12')][_0x38a6('0x14')]);return _0x29125c(_0x452916[_0x38a6('0x12')][_0x38a6('0x14')]);}logger[_0x38a6('0x12')]('Condition,\x20%s,\x20%s',_0xba02d6,_0x452916[_0x38a6('0x12')][_0x38a6('0x14')]);return _0x11b087(_0x452916[_0x38a6('0x12')][_0x38a6('0x14')]);}else{logger['info'](_0x38a6('0xd'),_0xba02d6,_0x38a6('0xe'));_0x11b087(_0x452916[_0x38a6('0x15')][_0x38a6('0x14')]);}})[_0x38a6('0x16')](function(_0x34ae99){logger[_0x38a6('0x12')](_0x38a6('0xd'),_0xba02d6,_0x34ae99);_0x29125c(_0x34ae99);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1384ca8..e9137d0 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 _0x9e51=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./condition.controller','put','/:id','update'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x9e51,0x1d6));var _0x19e5=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x9e51[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x19e5('0x0'));var util=require('util');var path=require(_0x19e5('0x1'));var timeout=require(_0x19e5('0x2'));var express=require(_0x19e5('0x3'));var router=express[_0x19e5('0x4')]();var fs_extra=require(_0x19e5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x19e5('0x6'));var config=require('../../config/environment');var controller=require(_0x19e5('0x7'));router[_0x19e5('0x8')](_0x19e5('0x9'),auth['isAuthenticated'](),controller[_0x19e5('0xa')]);router[_0x19e5('0xb')](_0x19e5('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x19e5('0xc')]=router; \ No newline at end of file +var _0x7140=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','delete','destroy','exports'];(function(_0xd25c9e,_0x1a7379){var _0x20edec=function(_0x2fdedc){while(--_0x2fdedc){_0xd25c9e['push'](_0xd25c9e['shift']());}};_0x20edec(++_0x1a7379);}(_0x7140,0x1e1));var _0x0714=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x7140[_0x513545];return _0x18b7c5;};'use strict';var multer=require(_0x0714('0x0'));var util=require(_0x0714('0x1'));var path=require(_0x0714('0x2'));var timeout=require('connect-timeout');var express=require(_0x0714('0x3'));var router=express[_0x0714('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0714('0x5'));var interaction=require(_0x0714('0x6'));var config=require('../../config/environment');var controller=require(_0x0714('0x7'));router['put'](_0x0714('0x8'),auth[_0x0714('0x9')](),controller['update']);router[_0x0714('0xa')](_0x0714('0x8'),auth['isAuthenticated'](),controller[_0x0714('0xb')]);module[_0x0714('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index aa88cca..ae33f09 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xb7e7,0x121));var _0x7b7e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb7e7[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x1b54e1,_0xa731c2){var _0x16b3e7=function(_0x247ed4){while(--_0x247ed4){_0x1b54e1['push'](_0x1b54e1['shift']());}};_0x16b3e7(++_0xa731c2);}(_0x757a,0xde));var _0xa757=function(_0x3aab54,_0x4c0372){_0x3aab54=_0x3aab54-0x0;var _0x2e7f70=_0x757a[_0x3aab54];return _0x2e7f70;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 03e9710..fa481a4 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 _0x6654=['fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','get','CustomDashboards','UserProfileResource','destroy','then','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','Dashboard','includeAll','findAll','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','clone','include','find','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','order','nolimit','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv'];(function(_0x3d16f0,_0x5df679){var _0x88fdad=function(_0x53ee29){while(--_0x53ee29){_0x3d16f0['push'](_0x3d16f0['shift']());}};_0x88fdad(++_0x5df679);}(_0x6654,0x1e3));var _0x4665=function(_0x5d5103,_0x38fc77){_0x5d5103=_0x5d5103-0x0;var _0x2faa61=_0x6654[_0x5d5103];return _0x2faa61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4665('0x0'));var zipdir=require(_0x4665('0x1'));var jsonpatch=require(_0x4665('0x2'));var rp=require('request-promise');var moment=require(_0x4665('0x3'));var BPromise=require(_0x4665('0x4'));var Mustache=require('mustache');var util=require(_0x4665('0x5'));var path=require(_0x4665('0x6'));var sox=require(_0x4665('0x7'));var csv=require(_0x4665('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4665('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4665('0xa'));var deskjs=require(_0x4665('0xb'));var toCsv=require(_0x4665('0x8'));var querystring=require(_0x4665('0xc'));var Papa=require(_0x4665('0xd'));var Redis=require(_0x4665('0xe'));var authService=require(_0x4665('0xf'));var qs=require(_0x4665('0x10'));var as=require(_0x4665('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4665('0x12'))('api');var utils=require(_0x4665('0x13'));var config=require(_0x4665('0x14'));var licenseUtil=require(_0x4665('0x15'));var db=require(_0x4665('0x16'))['db'];config['redis']=_[_0x4665('0x17')](config[_0x4665('0x18')],{'host':_0x4665('0x19'),'port':0x18eb});var socket=require(_0x4665('0x1a'))(new Redis(config['redis']));require(_0x4665('0x1b'))['register'](socket);function respondWithStatusCode(_0xfd20ab,_0x233d96){_0x233d96=_0x233d96||0xcc;return function(_0x12ad0e){if(_0x12ad0e){return _0xfd20ab[_0x4665('0x1c')](_0x233d96);}return _0xfd20ab['status'](_0x233d96)[_0x4665('0x1d')]();};}function respondWithResult(_0x35d594,_0x1893b0){_0x1893b0=_0x1893b0||0xc8;return function(_0x1cfc1c){if(_0x1cfc1c){return _0x35d594[_0x4665('0x1e')](_0x1893b0)[_0x4665('0x1f')](_0x1cfc1c);}};}function respondWithFilteredResult(_0x126544,_0x316eb7){return function(_0x35abe8){if(_0x35abe8){var _0x298be7=typeof _0x316eb7[_0x4665('0x20')]==='undefined'&&typeof _0x316eb7[_0x4665('0x21')]===_0x4665('0x22');var _0x58dfc5=_0x35abe8[_0x4665('0x23')];var _0x48851f=_0x298be7?0x0:_0x316eb7['offset'];var _0x18aec6=_0x298be7?_0x35abe8[_0x4665('0x23')]:_0x316eb7[_0x4665('0x20')]+_0x316eb7[_0x4665('0x21')];var _0x493e89;if(_0x18aec6>=_0x58dfc5){_0x18aec6=_0x58dfc5;_0x493e89=0xc8;}else{_0x493e89=0xce;}_0x126544[_0x4665('0x1e')](_0x493e89);return _0x126544[_0x4665('0x24')](_0x4665('0x25'),_0x48851f+'-'+_0x18aec6+'/'+_0x58dfc5)[_0x4665('0x1f')](_0x35abe8);}return null;};}function patchUpdates(_0x2acffc){return function(_0x26658c){try{jsonpatch[_0x4665('0x26')](_0x26658c,_0x2acffc,!![]);}catch(_0x1c37de){return BPromise['reject'](_0x1c37de);}return _0x26658c[_0x4665('0x27')]();};}function saveUpdates(_0x1d2304,_0x5c391d){return function(_0x2f1f88){if(_0x2f1f88){return _0x2f1f88[_0x4665('0x28')](_0x1d2304)['then'](function(_0x5f1ce2){return _0x5f1ce2;});}return null;};}function removeEntity(_0x4b6b0d,_0x481e14){return function(_0x1ae2b8){if(_0x1ae2b8){return _0x1ae2b8['destroy']()['then'](function(){var _0xe5a1e2=_0x1ae2b8[_0x4665('0x29')]({'plain':!![]});var _0x307607=_0x4665('0x2a');return db[_0x4665('0x2b')][_0x4665('0x2c')]({'where':{'type':_0x307607,'resourceId':_0xe5a1e2['id']}})['then'](function(){return _0x1ae2b8;});})[_0x4665('0x2d')](function(){_0x4b6b0d[_0x4665('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf450,_0x302a0d){return function(_0x2af6ad){if(!_0x2af6ad){_0x1bf450[_0x4665('0x1c')](0x194);}return _0x2af6ad;};}function handleError(_0x1d5547,_0x25ffe8){_0x25ffe8=_0x25ffe8||0x1f4;return function(_0x20ef2a){logger[_0x4665('0x2e')](_0x20ef2a['stack']);if(_0x20ef2a[_0x4665('0x2f')]){delete _0x20ef2a[_0x4665('0x2f')];}_0x1d5547[_0x4665('0x1e')](_0x25ffe8)[_0x4665('0x30')](_0x20ef2a);};}exports[_0x4665('0x31')]=function(_0x364688,_0x48baaf){var _0x391a5={},_0xc8d5d6={},_0x164f35={'count':0x0,'rows':[]};var _0x1eed5a=_['map'](db['Dashboard'][_0x4665('0x32')],function(_0x53f721){return{'name':_0x53f721[_0x4665('0x33')],'type':_0x53f721[_0x4665('0x34')]['key']};});_0xc8d5d6[_0x4665('0x35')]=_[_0x4665('0x36')](_0x1eed5a,_0x4665('0x2f'));_0xc8d5d6[_0x4665('0x37')]=_[_0x4665('0x38')](_0x364688[_0x4665('0x37')]);_0xc8d5d6[_0x4665('0x39')]=_[_0x4665('0x3a')](_0xc8d5d6[_0x4665('0x35')],_0xc8d5d6[_0x4665('0x37')]);_0x391a5[_0x4665('0x3b')]=_['intersection'](_0xc8d5d6[_0x4665('0x35')],qs[_0x4665('0x3c')](_0x364688[_0x4665('0x37')]['fields']));_0x391a5[_0x4665('0x3b')]=_0x391a5['attributes'][_0x4665('0x3d')]?_0x391a5[_0x4665('0x3b')]:_0xc8d5d6[_0x4665('0x35')];if(!_0x364688[_0x4665('0x37')][_0x4665('0x3e')]('nolimit')){_0x391a5[_0x4665('0x21')]=qs['limit'](_0x364688[_0x4665('0x37')]['limit']);_0x391a5[_0x4665('0x20')]=qs['offset'](_0x364688['query'][_0x4665('0x20')]);}_0x391a5['order']=qs[_0x4665('0x3f')](_0x364688[_0x4665('0x37')]['sort']);_0x391a5[_0x4665('0x40')]=qs[_0x4665('0x39')](_[_0x4665('0x41')](_0x364688['query'],_0xc8d5d6['filters']),_0x1eed5a);if(_0x364688[_0x4665('0x37')]['filter']){_0x391a5[_0x4665('0x40')]=_[_0x4665('0x42')](_0x391a5[_0x4665('0x40')],{'$or':_[_0x4665('0x36')](_0x1eed5a,function(_0x33156e){if(_0x33156e[_0x4665('0x34')]!=='VIRTUAL'){var _0x1aa609={};_0x1aa609[_0x33156e[_0x4665('0x2f')]]={'$like':'%'+_0x364688[_0x4665('0x37')][_0x4665('0x43')]+'%'};return _0x1aa609;}})});}_0x391a5=_['merge']({},_0x391a5,_0x364688['options']);var _0x488ab1={'where':_0x391a5[_0x4665('0x40')]};return db[_0x4665('0x44')][_0x4665('0x23')](_0x488ab1)['then'](function(_0x5d4052){_0x164f35['count']=_0x5d4052;if(_0x364688[_0x4665('0x37')][_0x4665('0x45')]){_0x391a5['include']=[{'all':!![]}];}return db[_0x4665('0x44')][_0x4665('0x46')](_0x391a5);})[_0x4665('0x2d')](function(_0x31d5f0){_0x164f35['rows']=_0x31d5f0;return _0x164f35;})[_0x4665('0x2d')](respondWithFilteredResult(_0x48baaf,_0x391a5))[_0x4665('0x47')](handleError(_0x48baaf,null));};exports[_0x4665('0x48')]=function(_0x236fba,_0x242994){var _0x3dbf3={'raw':![],'where':{'id':_0x236fba[_0x4665('0x49')]['id']}},_0x5360c8={};_0x5360c8['model']=_[_0x4665('0x38')](db[_0x4665('0x44')][_0x4665('0x32')]);_0x5360c8[_0x4665('0x37')]=_[_0x4665('0x38')](_0x236fba['query']);_0x5360c8[_0x4665('0x39')]=_[_0x4665('0x3a')](_0x5360c8[_0x4665('0x35')],_0x5360c8['query']);_0x3dbf3[_0x4665('0x3b')]=_['intersection'](_0x5360c8['model'],qs[_0x4665('0x3c')](_0x236fba[_0x4665('0x37')]['fields']));_0x3dbf3[_0x4665('0x3b')]=_0x3dbf3['attributes'][_0x4665('0x3d')]?_0x3dbf3['attributes']:_0x5360c8[_0x4665('0x35')];if(_0x236fba['query'][_0x4665('0x45')]){_0x3dbf3['include']=[{'all':!![]}];}_0x3dbf3=_[_0x4665('0x42')]({},_0x3dbf3,_0x236fba[_0x4665('0x4a')]);return db['Dashboard']['find'](_0x3dbf3)['then'](handleEntityNotFound(_0x242994,null))[_0x4665('0x2d')](respondWithResult(_0x242994,null))['catch'](handleError(_0x242994,null));};exports[_0x4665('0x4b')]=function(_0x11d318,_0x32f8a0){return db['Dashboard'][_0x4665('0x4b')](_0x11d318[_0x4665('0x4c')],{})[_0x4665('0x2d')](function(_0x4af210){var _0x551ac9=_0x11d318[_0x4665('0x4d')][_0x4665('0x29')]({'plain':!![]});if(!_0x551ac9)throw new Error(_0x4665('0x4e'));if(_0x551ac9[_0x4665('0x4f')]===_0x4665('0x4d')){var _0x1344f9=_0x4af210[_0x4665('0x29')]({'plain':!![]});var _0x1e7ffa=_0x4665('0x2a');return db[_0x4665('0x50')]['find']({'where':{'name':_0x1e7ffa,'userProfileId':_0x551ac9[_0x4665('0x51')]},'raw':!![]})[_0x4665('0x2d')](function(_0x15c5c4){if(_0x15c5c4&&_0x15c5c4['autoAssociation']===0x0){return db['UserProfileResource'][_0x4665('0x4b')]({'name':_0x1344f9[_0x4665('0x2f')],'resourceId':_0x1344f9['id'],'type':_0x15c5c4[_0x4665('0x2f')],'sectionId':_0x15c5c4['id']},{})[_0x4665('0x2d')](function(){return _0x4af210;});}else{return _0x4af210;}})[_0x4665('0x47')](function(_0x494a38){logger[_0x4665('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x494a38);throw _0x494a38;});}return _0x4af210;})['then'](respondWithResult(_0x32f8a0,0xc9))['catch'](handleError(_0x32f8a0,null));};exports[_0x4665('0x52')]=function(_0x35f051,_0x65b317){var _0x5286e1={'where':{'id':_0x35f051['params']['id']}},_0x54910a={};_0x54910a['model']=_[_0x4665('0x38')](db[_0x4665('0x44')][_0x4665('0x32')]);_0x5286e1['attributes']=_['intersection'](_0x54910a[_0x4665('0x35')],qs[_0x4665('0x3c')](_0x35f051[_0x4665('0x37')][_0x4665('0x3c')]));_0x5286e1[_0x4665('0x3b')]=_0x5286e1['attributes'][_0x4665('0x3d')]?_0x5286e1[_0x4665('0x3b')]:_0x54910a[_0x4665('0x35')];if(_0x35f051[_0x4665('0x37')][_0x4665('0x45')]){_0x5286e1[_0x4665('0x53')]=[{'all':!![]}];}_0x5286e1=_[_0x4665('0x42')]({},_0x5286e1,_0x35f051['options']);return db['Dashboard'][_0x4665('0x54')](_0x5286e1)[_0x4665('0x2d')](handleEntityNotFound(_0x65b317,null))[_0x4665('0x2d')](function(_0x5de22a){if(_0x5de22a){var _0x41dc16=_0x5de22a[_0x4665('0x29')]({'plain':!![]});_0x41dc16=qs[_0x4665('0x55')](_0x41dc16,['id',_0x4665('0x56'),_0x4665('0x57')]);_0x35f051['body']=_[_0x4665('0x55')](_0x35f051[_0x4665('0x4c')],['id','createdAt','updatedAt']);return db[_0x4665('0x44')]['create'](_[_0x4665('0x42')](_0x41dc16,_0x35f051[_0x4665('0x4c')]),{'include':_0x35f051[_0x4665('0x37')][_0x4665('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x2ee2eb){var _0x494bc8=_0x35f051[_0x4665('0x4d')][_0x4665('0x29')]({'plain':!![]});if(!_0x494bc8)throw new Error(_0x4665('0x4e'));if(_0x494bc8[_0x4665('0x4f')]===_0x4665('0x4d')){var _0xd116d8=_0x2ee2eb[_0x4665('0x29')]({'plain':!![]});var _0x1fdfc5=_0x4665('0x2a');return db['UserProfileSection'][_0x4665('0x54')]({'where':{'name':_0x1fdfc5,'userProfileId':_0x494bc8[_0x4665('0x51')]},'raw':!![]})['then'](function(_0x5a609c){if(_0x5a609c&&_0x5a609c[_0x4665('0x58')]===0x0){return db[_0x4665('0x2b')][_0x4665('0x4b')]({'name':_0xd116d8[_0x4665('0x2f')],'resourceId':_0xd116d8['id'],'type':_0x5a609c[_0x4665('0x2f')],'sectionId':_0x5a609c['id']},{})[_0x4665('0x2d')](function(){return _0x2ee2eb;});}else{return _0x2ee2eb;}})[_0x4665('0x47')](function(_0x4f0323){logger[_0x4665('0x2e')](_0x4665('0x59'),_0x4f0323);throw _0x4f0323;});}return _0x2ee2eb;});}})['then'](respondWithResult(_0x65b317,0xc9))[_0x4665('0x47')](handleError(_0x65b317,null));};exports[_0x4665('0x28')]=function(_0x257427,_0x7787eb){if(_0x257427[_0x4665('0x4c')]['id']){delete _0x257427[_0x4665('0x4c')]['id'];}return db[_0x4665('0x44')]['find']({'where':{'id':_0x257427['params']['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x7787eb,null))['then'](saveUpdates(_0x257427[_0x4665('0x4c')],null))[_0x4665('0x2d')](respondWithResult(_0x7787eb,null))[_0x4665('0x47')](handleError(_0x7787eb,null));};exports['destroy']=function(_0x48c26c,_0x29d410){return db[_0x4665('0x44')][_0x4665('0x54')]({'where':{'id':_0x48c26c[_0x4665('0x49')]['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x29d410,null))[_0x4665('0x2d')](removeEntity(_0x29d410,null))[_0x4665('0x47')](handleError(_0x29d410,null));};function widgetAttributes(_0x4bf490){try{switch(_0x4bf490['type']){case _0x4665('0x5a'):return[{'name':_0x4665('0x5b'),'value':_0x4bf490[_0x4665('0x5b')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||_0x4665('0x5e')}];case _0x4665('0x5f'):return[{'name':_0x4665('0x60'),'value':_0x4bf490[_0x4665('0x60')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||''}];case _0x4665('0x61'):return[{'name':_0x4665('0x62'),'value':_0x4bf490[_0x4665('0x62')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||_0x4665('0x63')},{'name':_0x4665('0x64'),'value':_0x4bf490[_0x4665('0x64')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x1]?_0x4bf490[_0x4665('0x5c')][0x1]['value']:undefined)||_0x4665('0x65')},{'name':_0x4665('0x66'),'value':_0x4bf490[_0x4665('0x66')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x2]?_0x4bf490['attrs'][0x2][_0x4665('0x5d')]:undefined)||0xc}];case _0x4665('0x67'):return[{'name':_0x4665('0x68'),'value':_0x4bf490[_0x4665('0x68')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490['attrs'][0x0][_0x4665('0x5d')]:undefined)||_0x4665('0x69')},{'name':_0x4665('0x6a'),'value':_0x4bf490[_0x4665('0x6a')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x1]?_0x4bf490['attrs'][0x1]['value']:undefined)||[]},{'name':_0x4665('0x66'),'value':_0x4bf490[_0x4665('0x66')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x2]?_0x4bf490[_0x4665('0x5c')][0x2]['value']:undefined)||0x14}];case _0x4665('0x6b'):case'pie-chart':return[{'name':_0x4665('0x6c'),'value':_0x4bf490[_0x4665('0x6c')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x0]?_0x4bf490['attrs'][0x0]['value']:undefined)||_0x4665('0x69')},{'name':_0x4665('0x6d'),'value':_0x4bf490[_0x4665('0x6d')]||(_0x4bf490['attrs']&&_0x4bf490['attrs'][0x1]?_0x4bf490['attrs'][0x1][_0x4665('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x4bf490[_0x4665('0x6e')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x2]?_0x4bf490[_0x4665('0x5c')][0x2]['value']:undefined)||null},{'name':_0x4665('0x6a'),'value':_0x4bf490[_0x4665('0x6a')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490[_0x4665('0x5c')][0x3]?_0x4bf490[_0x4665('0x5c')][0x3][_0x4665('0x5d')]:undefined)||[]}];case _0x4665('0x6f'):return[{'name':'attrReport','type':_0x4bf490['reportType']||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x34')]:undefined)||null,'value':_0x4bf490[_0x4665('0x70')]||(_0x4bf490['attrs']&&_0x4bf490[_0x4665('0x5c')][0x0]?_0x4bf490[_0x4665('0x5c')][0x0][_0x4665('0x5d')]:undefined)||null},{'name':_0x4665('0x71'),'value':_0x4bf490[_0x4665('0x71')]||(_0x4bf490[_0x4665('0x5c')]&&_0x4bf490['attrs'][0x1]?_0x4bf490[_0x4665('0x5c')][0x1][_0x4665('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x2ea91a){logger[_0x4665('0x2e')](_0x4665('0x72'),JSON[_0x4665('0x73')](_0x2ea91a));return[];}}exports[_0x4665('0x74')]=function(_0x55a794,_0x25f4c6,_0x552682){if(_0x55a794[_0x4665('0x4c')]['id']){delete _0x55a794['body']['id'];}return db[_0x4665('0x44')][_0x4665('0x54')]({'where':{'id':_0x55a794['params']['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x25f4c6,null))['then'](function(_0x44975f){if(_0x44975f){_0x55a794[_0x4665('0x4c')][_0x4665('0x75')]=_0x44975f['id'];_0x55a794[_0x4665('0x4c')][_0x4665('0x5c')]=widgetAttributes(_0x55a794[_0x4665('0x4c')]);return db['DashboardItem'][_0x4665('0x4b')](_0x55a794['body']);}})[_0x4665('0x2d')](respondWithResult(_0x25f4c6,null))[_0x4665('0x47')](handleError(_0x25f4c6,null));};exports[_0x4665('0x76')]=function(_0x373271,_0x1f8061,_0x362f24){var _0x33e450={};var _0x3a6c71={};var _0x36b17e;var _0x4f8c1d;return db[_0x4665('0x44')][_0x4665('0x77')]({'where':{'id':_0x373271[_0x4665('0x49')]['id']}})[_0x4665('0x2d')](handleEntityNotFound(_0x1f8061,null))[_0x4665('0x2d')](function(_0x4c551a){if(_0x4c551a){_0x36b17e=_0x4c551a;_0x3a6c71['model']=_['keys'](db[_0x4665('0x78')][_0x4665('0x32')]);_0x3a6c71[_0x4665('0x37')]=_[_0x4665('0x38')](_0x373271[_0x4665('0x37')]);_0x3a6c71['filters']=_[_0x4665('0x3a')](_0x3a6c71[_0x4665('0x35')],_0x3a6c71['query']);_0x33e450[_0x4665('0x3b')]=_[_0x4665('0x3a')](_0x3a6c71['model'],qs[_0x4665('0x3c')](_0x373271['query'][_0x4665('0x3c')]));_0x33e450['attributes']=_0x33e450[_0x4665('0x3b')][_0x4665('0x3d')]?_0x33e450['attributes']:_0x3a6c71[_0x4665('0x35')];_0x33e450[_0x4665('0x79')]=qs[_0x4665('0x3f')](_0x373271[_0x4665('0x37')][_0x4665('0x3f')]);_0x33e450[_0x4665('0x40')]=qs[_0x4665('0x39')](_[_0x4665('0x41')](_0x373271['query'],_0x3a6c71[_0x4665('0x39')]));if(_0x373271[_0x4665('0x37')]['filter']){_0x33e450[_0x4665('0x40')]=_[_0x4665('0x42')](_0x33e450[_0x4665('0x40')],{'$or':_['map'](_0x33e450[_0x4665('0x3b')],function(_0x915b35){var _0x34fca2={};_0x34fca2[_0x915b35]={'$like':'%'+_0x373271[_0x4665('0x37')]['filter']+'%'};return _0x34fca2;})});}_0x33e450=_[_0x4665('0x42')]({},_0x33e450,_0x373271[_0x4665('0x4a')]);return _0x36b17e['getItems'](_0x33e450);}})['then'](function(_0x555c1e){if(_0x555c1e){_0x4f8c1d=_0x555c1e[_0x4665('0x3d')];if(!_0x373271[_0x4665('0x37')][_0x4665('0x3e')](_0x4665('0x7a'))){_0x33e450[_0x4665('0x21')]=qs[_0x4665('0x21')](_0x373271[_0x4665('0x37')]['limit']);_0x33e450[_0x4665('0x20')]=qs[_0x4665('0x20')](_0x373271[_0x4665('0x37')][_0x4665('0x20')]);}return _0x36b17e[_0x4665('0x76')](_0x33e450);}})[_0x4665('0x2d')](function(_0x5b9ea9){if(_0x5b9ea9){return _0x5b9ea9?{'count':_0x4f8c1d,'rows':_0x5b9ea9}:null;}})[_0x4665('0x2d')](respondWithResult(_0x1f8061,null))['catch'](handleError(_0x1f8061,null));}; \ No newline at end of file +var _0x80e0=['widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','sort','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','CustomDashboards','error','stack','name','send','Dashboard','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','clone','omit','updatedAt','createdAt','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','attrRefresh'];(function(_0x5d67e7,_0x28f784){var _0x19b0ed=function(_0x1cd374){while(--_0x1cd374){_0x5d67e7['push'](_0x5d67e7['shift']());}};_0x19b0ed(++_0x28f784);}(_0x80e0,0x79));var _0x080e=function(_0x3bb168,_0x5d02f8){_0x3bb168=_0x3bb168-0x0;var _0x11d4c9=_0x80e0[_0x3bb168];return _0x11d4c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x080e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x080e('0x1'));var rp=require(_0x080e('0x2'));var moment=require('moment');var BPromise=require(_0x080e('0x3'));var Mustache=require(_0x080e('0x4'));var util=require(_0x080e('0x5'));var path=require(_0x080e('0x6'));var sox=require(_0x080e('0x7'));var csv=require(_0x080e('0x8'));var ejs=require(_0x080e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x080e('0xa'));var squel=require(_0x080e('0xb'));var crypto=require(_0x080e('0xc'));var jsforce=require(_0x080e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x080e('0x8'));var querystring=require(_0x080e('0xe'));var Papa=require('papaparse');var Redis=require(_0x080e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x080e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x080e('0x11'));var utils=require(_0x080e('0x12'));var config=require(_0x080e('0x13'));var licenseUtil=require(_0x080e('0x14'));var db=require(_0x080e('0x15'))['db'];config[_0x080e('0x16')]=_[_0x080e('0x17')](config[_0x080e('0x16')],{'host':_0x080e('0x18'),'port':0x18eb});var socket=require(_0x080e('0x19'))(new Redis(config[_0x080e('0x16')]));require(_0x080e('0x1a'))[_0x080e('0x1b')](socket);function respondWithStatusCode(_0x2f3bca,_0x3a3c47){_0x3a3c47=_0x3a3c47||0xcc;return function(_0x164cc2){if(_0x164cc2){return _0x2f3bca[_0x080e('0x1c')](_0x3a3c47);}return _0x2f3bca[_0x080e('0x1d')](_0x3a3c47)[_0x080e('0x1e')]();};}function respondWithResult(_0x30ca37,_0x411f39){_0x411f39=_0x411f39||0xc8;return function(_0xacdcb6){if(_0xacdcb6){return _0x30ca37[_0x080e('0x1d')](_0x411f39)['json'](_0xacdcb6);}};}function respondWithFilteredResult(_0xe1b38c,_0x3cfeb7){return function(_0xcd4669){if(_0xcd4669){var _0x31511b=typeof _0x3cfeb7[_0x080e('0x1f')]===_0x080e('0x20')&&typeof _0x3cfeb7['limit']===_0x080e('0x20');var _0x5dc2b7=_0xcd4669[_0x080e('0x21')];var _0x4b70de=_0x31511b?0x0:_0x3cfeb7['offset'];var _0xf2b786=_0x31511b?_0xcd4669[_0x080e('0x21')]:_0x3cfeb7[_0x080e('0x1f')]+_0x3cfeb7[_0x080e('0x22')];var _0x3a46c4;if(_0xf2b786>=_0x5dc2b7){_0xf2b786=_0x5dc2b7;_0x3a46c4=0xc8;}else{_0x3a46c4=0xce;}_0xe1b38c['status'](_0x3a46c4);return _0xe1b38c[_0x080e('0x23')](_0x080e('0x24'),_0x4b70de+'-'+_0xf2b786+'/'+_0x5dc2b7)['json'](_0xcd4669);}return null;};}function patchUpdates(_0x30f709){return function(_0x19dcfd){try{jsonpatch['apply'](_0x19dcfd,_0x30f709,!![]);}catch(_0x40b9dc){return BPromise[_0x080e('0x25')](_0x40b9dc);}return _0x19dcfd[_0x080e('0x26')]();};}function saveUpdates(_0x38e772,_0x233dde){return function(_0x51f583){if(_0x51f583){return _0x51f583[_0x080e('0x27')](_0x38e772)[_0x080e('0x28')](function(_0x59c32b){return _0x59c32b;});}return null;};}function removeEntity(_0x41770,_0x4e21d2){return function(_0x1ed5ac){if(_0x1ed5ac){return _0x1ed5ac[_0x080e('0x29')]()[_0x080e('0x28')](function(){var _0x1d355a=_0x1ed5ac['get']({'plain':!![]});var _0x50336f=_0x080e('0x2a');return db['UserProfileResource'][_0x080e('0x29')]({'where':{'type':_0x50336f,'resourceId':_0x1d355a['id']}})[_0x080e('0x28')](function(){return _0x1ed5ac;});})[_0x080e('0x28')](function(){_0x41770['status'](0xcc)[_0x080e('0x1e')]();});}};}function handleEntityNotFound(_0x1ebc2d,_0x33ec04){return function(_0x39c825){if(!_0x39c825){_0x1ebc2d[_0x080e('0x1c')](0x194);}return _0x39c825;};}function handleError(_0x4851b9,_0x62630b){_0x62630b=_0x62630b||0x1f4;return function(_0x28b2d6){logger[_0x080e('0x2b')](_0x28b2d6[_0x080e('0x2c')]);if(_0x28b2d6[_0x080e('0x2d')]){delete _0x28b2d6[_0x080e('0x2d')];}_0x4851b9['status'](_0x62630b)[_0x080e('0x2e')](_0x28b2d6);};}exports['index']=function(_0x5c382f,_0xaa388b){var _0x29a0b8={},_0x49ef42={},_0x3f2def={'count':0x0,'rows':[]};var _0xa40822=_['map'](db[_0x080e('0x2f')]['rawAttributes'],function(_0xeb8b37){return{'name':_0xeb8b37[_0x080e('0x30')],'type':_0xeb8b37[_0x080e('0x31')][_0x080e('0x32')]};});_0x49ef42['model']=_['map'](_0xa40822,_0x080e('0x2d'));_0x49ef42[_0x080e('0x33')]=_[_0x080e('0x34')](_0x5c382f[_0x080e('0x33')]);_0x49ef42[_0x080e('0x35')]=_['intersection'](_0x49ef42[_0x080e('0x36')],_0x49ef42['query']);_0x29a0b8[_0x080e('0x37')]=_[_0x080e('0x38')](_0x49ef42[_0x080e('0x36')],qs[_0x080e('0x39')](_0x5c382f[_0x080e('0x33')][_0x080e('0x39')]));_0x29a0b8[_0x080e('0x37')]=_0x29a0b8[_0x080e('0x37')]['length']?_0x29a0b8['attributes']:_0x49ef42['model'];if(!_0x5c382f[_0x080e('0x33')][_0x080e('0x3a')](_0x080e('0x3b'))){_0x29a0b8[_0x080e('0x22')]=qs[_0x080e('0x22')](_0x5c382f['query'][_0x080e('0x22')]);_0x29a0b8[_0x080e('0x1f')]=qs['offset'](_0x5c382f[_0x080e('0x33')]['offset']);}_0x29a0b8[_0x080e('0x3c')]=qs['sort'](_0x5c382f['query']['sort']);_0x29a0b8[_0x080e('0x3d')]=qs[_0x080e('0x35')](_[_0x080e('0x3e')](_0x5c382f[_0x080e('0x33')],_0x49ef42[_0x080e('0x35')]),_0xa40822);if(_0x5c382f[_0x080e('0x33')][_0x080e('0x3f')]){_0x29a0b8[_0x080e('0x3d')]=_[_0x080e('0x40')](_0x29a0b8[_0x080e('0x3d')],{'$or':_['map'](_0xa40822,function(_0x220b74){if(_0x220b74['type']!==_0x080e('0x41')){var _0x1ac69f={};_0x1ac69f[_0x220b74[_0x080e('0x2d')]]={'$like':'%'+_0x5c382f[_0x080e('0x33')][_0x080e('0x3f')]+'%'};return _0x1ac69f;}})});}_0x29a0b8=_[_0x080e('0x40')]({},_0x29a0b8,_0x5c382f[_0x080e('0x42')]);var _0xd4b5d9={'where':_0x29a0b8[_0x080e('0x3d')]};return db[_0x080e('0x2f')][_0x080e('0x21')](_0xd4b5d9)['then'](function(_0x2cea34){_0x3f2def[_0x080e('0x21')]=_0x2cea34;if(_0x5c382f[_0x080e('0x33')][_0x080e('0x43')]){_0x29a0b8['include']=[{'all':!![]}];}return db[_0x080e('0x2f')][_0x080e('0x44')](_0x29a0b8);})[_0x080e('0x28')](function(_0x33f15d){_0x3f2def['rows']=_0x33f15d;return _0x3f2def;})[_0x080e('0x28')](respondWithFilteredResult(_0xaa388b,_0x29a0b8))[_0x080e('0x45')](handleError(_0xaa388b,null));};exports[_0x080e('0x46')]=function(_0xdf640a,_0x46b3c8){var _0x417b81={'raw':![],'where':{'id':_0xdf640a[_0x080e('0x47')]['id']}},_0x7b3214={};_0x7b3214[_0x080e('0x36')]=_[_0x080e('0x34')](db['Dashboard'][_0x080e('0x48')]);_0x7b3214[_0x080e('0x33')]=_[_0x080e('0x34')](_0xdf640a[_0x080e('0x33')]);_0x7b3214[_0x080e('0x35')]=_['intersection'](_0x7b3214[_0x080e('0x36')],_0x7b3214[_0x080e('0x33')]);_0x417b81[_0x080e('0x37')]=_[_0x080e('0x38')](_0x7b3214[_0x080e('0x36')],qs[_0x080e('0x39')](_0xdf640a[_0x080e('0x33')][_0x080e('0x39')]));_0x417b81[_0x080e('0x37')]=_0x417b81[_0x080e('0x37')][_0x080e('0x49')]?_0x417b81[_0x080e('0x37')]:_0x7b3214[_0x080e('0x36')];if(_0xdf640a[_0x080e('0x33')][_0x080e('0x43')]){_0x417b81[_0x080e('0x4a')]=[{'all':!![]}];}_0x417b81=_['merge']({},_0x417b81,_0xdf640a[_0x080e('0x42')]);return db[_0x080e('0x2f')][_0x080e('0x4b')](_0x417b81)[_0x080e('0x28')](handleEntityNotFound(_0x46b3c8,null))[_0x080e('0x28')](respondWithResult(_0x46b3c8,null))[_0x080e('0x45')](handleError(_0x46b3c8,null));};exports[_0x080e('0x4c')]=function(_0x160832,_0x4fbcc6){return db[_0x080e('0x2f')][_0x080e('0x4c')](_0x160832[_0x080e('0x4d')],{})[_0x080e('0x28')](function(_0x417583){var _0x3253f1=_0x160832['user'][_0x080e('0x4e')]({'plain':!![]});if(!_0x3253f1)throw new Error(_0x080e('0x4f'));if(_0x3253f1[_0x080e('0x50')]==='user'){var _0x289d81=_0x417583['get']({'plain':!![]});var _0x137694=_0x080e('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x137694,'userProfileId':_0x3253f1['userProfileId']},'raw':!![]})[_0x080e('0x28')](function(_0x56d577){if(_0x56d577&&_0x56d577[_0x080e('0x51')]===0x0){return db['UserProfileResource'][_0x080e('0x4c')]({'name':_0x289d81[_0x080e('0x2d')],'resourceId':_0x289d81['id'],'type':_0x56d577['name'],'sectionId':_0x56d577['id']},{})[_0x080e('0x28')](function(){return _0x417583;});}else{return _0x417583;}})[_0x080e('0x45')](function(_0x8deb7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8deb7);throw _0x8deb7;});}return _0x417583;})[_0x080e('0x28')](respondWithResult(_0x4fbcc6,0xc9))['catch'](handleError(_0x4fbcc6,null));};exports[_0x080e('0x52')]=function(_0x1a6383,_0x1dbe2d){var _0x50b8fb={'where':{'id':_0x1a6383['params']['id']}},_0x5e0e61={};_0x5e0e61[_0x080e('0x36')]=_[_0x080e('0x34')](db[_0x080e('0x2f')][_0x080e('0x48')]);_0x50b8fb['attributes']=_[_0x080e('0x38')](_0x5e0e61[_0x080e('0x36')],qs[_0x080e('0x39')](_0x1a6383[_0x080e('0x33')][_0x080e('0x39')]));_0x50b8fb[_0x080e('0x37')]=_0x50b8fb[_0x080e('0x37')][_0x080e('0x49')]?_0x50b8fb['attributes']:_0x5e0e61['model'];if(_0x1a6383[_0x080e('0x33')]['includeAll']){_0x50b8fb[_0x080e('0x4a')]=[{'all':!![]}];}_0x50b8fb=_[_0x080e('0x40')]({},_0x50b8fb,_0x1a6383[_0x080e('0x42')]);return db[_0x080e('0x2f')][_0x080e('0x4b')](_0x50b8fb)[_0x080e('0x28')](handleEntityNotFound(_0x1dbe2d,null))['then'](function(_0x550c2f){if(_0x550c2f){var _0x4a55bf=_0x550c2f[_0x080e('0x4e')]({'plain':!![]});_0x4a55bf=qs[_0x080e('0x53')](_0x4a55bf,['id','createdAt',_0x080e('0x54')]);_0x1a6383[_0x080e('0x4d')]=_[_0x080e('0x53')](_0x1a6383[_0x080e('0x4d')],['id',_0x080e('0x55'),_0x080e('0x54')]);return db[_0x080e('0x2f')][_0x080e('0x4c')](_[_0x080e('0x40')](_0x4a55bf,_0x1a6383[_0x080e('0x4d')]),{'include':_0x1a6383[_0x080e('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x080e('0x28')](function(_0x446cb9){var _0x47b529=_0x1a6383[_0x080e('0x56')]['get']({'plain':!![]});if(!_0x47b529)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47b529[_0x080e('0x50')]===_0x080e('0x56')){var _0x40e579=_0x446cb9[_0x080e('0x4e')]({'plain':!![]});var _0x1c3915='CustomDashboards';return db['UserProfileSection'][_0x080e('0x4b')]({'where':{'name':_0x1c3915,'userProfileId':_0x47b529[_0x080e('0x57')]},'raw':!![]})[_0x080e('0x28')](function(_0x33e442){if(_0x33e442&&_0x33e442[_0x080e('0x51')]===0x0){return db[_0x080e('0x58')][_0x080e('0x4c')]({'name':_0x40e579['name'],'resourceId':_0x40e579['id'],'type':_0x33e442[_0x080e('0x2d')],'sectionId':_0x33e442['id']},{})[_0x080e('0x28')](function(){return _0x446cb9;});}else{return _0x446cb9;}})[_0x080e('0x45')](function(_0x4c8955){logger[_0x080e('0x2b')](_0x080e('0x59'),_0x4c8955);throw _0x4c8955;});}return _0x446cb9;});}})[_0x080e('0x28')](respondWithResult(_0x1dbe2d,0xc9))[_0x080e('0x45')](handleError(_0x1dbe2d,null));};exports[_0x080e('0x27')]=function(_0x35c4fd,_0x130c6e){if(_0x35c4fd[_0x080e('0x4d')]['id']){delete _0x35c4fd[_0x080e('0x4d')]['id'];}return db[_0x080e('0x2f')][_0x080e('0x4b')]({'where':{'id':_0x35c4fd[_0x080e('0x47')]['id']}})['then'](handleEntityNotFound(_0x130c6e,null))[_0x080e('0x28')](saveUpdates(_0x35c4fd[_0x080e('0x4d')],null))[_0x080e('0x28')](respondWithResult(_0x130c6e,null))[_0x080e('0x45')](handleError(_0x130c6e,null));};exports[_0x080e('0x29')]=function(_0x3e714a,_0x36e5c2){return db[_0x080e('0x2f')][_0x080e('0x4b')]({'where':{'id':_0x3e714a[_0x080e('0x47')]['id']}})[_0x080e('0x28')](handleEntityNotFound(_0x36e5c2,null))[_0x080e('0x28')](removeEntity(_0x36e5c2,null))[_0x080e('0x45')](handleError(_0x36e5c2,null));};function widgetAttributes(_0xb9965d){try{switch(_0xb9965d[_0x080e('0x31')]){case _0x080e('0x5a'):return[{'name':_0x080e('0x5b'),'value':_0xb9965d[_0x080e('0x5b')]||(_0xb9965d['attrs']&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0x080e('0x5d'),'value':_0xb9965d[_0x080e('0x5d')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0][_0x080e('0x5e')]:undefined)||''}];case _0x080e('0x5f'):return[{'name':'attrHourFormat','value':_0xb9965d[_0x080e('0x60')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0][_0x080e('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0x080e('0x61'),'value':_0xb9965d[_0x080e('0x61')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x1]?_0xb9965d[_0x080e('0x5c')][0x1][_0x080e('0x5e')]:undefined)||_0x080e('0x62')},{'name':_0x080e('0x63'),'value':_0xb9965d[_0x080e('0x63')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x2]?_0xb9965d['attrs'][0x2][_0x080e('0x5e')]:undefined)||0xc}];case _0x080e('0x64'):return[{'name':_0x080e('0x65'),'value':_0xb9965d['attrMetric']||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0][_0x080e('0x5e')]:undefined)||_0x080e('0x66')},{'name':'attrVoiceQueues','value':_0xb9965d['attrVoiceQueues']||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x1]?_0xb9965d['attrs'][0x1]['value']:undefined)||[]},{'name':_0x080e('0x63'),'value':_0xb9965d[_0x080e('0x63')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x2]?_0xb9965d[_0x080e('0x5c')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x080e('0x67'),'value':_0xb9965d[_0x080e('0x67')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0][_0x080e('0x5e')]:undefined)||'total'},{'name':_0x080e('0x68'),'value':_0xb9965d['attrSerie2']||(_0xb9965d['attrs']&&_0xb9965d[_0x080e('0x5c')][0x1]?_0xb9965d['attrs'][0x1][_0x080e('0x5e')]:undefined)||null},{'name':_0x080e('0x69'),'value':_0xb9965d['attrSerie3']||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d['attrs'][0x2]?_0xb9965d[_0x080e('0x5c')][0x2][_0x080e('0x5e')]:undefined)||null},{'name':_0x080e('0x6a'),'value':_0xb9965d[_0x080e('0x6a')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x3]?_0xb9965d['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0xb9965d['reportType']||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0][_0x080e('0x31')]:undefined)||null,'value':_0xb9965d[_0x080e('0x6b')]||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x0]?_0xb9965d[_0x080e('0x5c')][0x0]['value']:undefined)||null},{'name':_0x080e('0x6c'),'value':_0xb9965d['attrRefresh']||(_0xb9965d[_0x080e('0x5c')]&&_0xb9965d[_0x080e('0x5c')][0x1]?_0xb9965d[_0x080e('0x5c')][0x1][_0x080e('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x408e12){logger[_0x080e('0x2b')](_0x080e('0x6d'),JSON[_0x080e('0x6e')](_0x408e12));return[];}}exports['addItem']=function(_0x1f8adc,_0x40e2e0,_0x2cf16e){if(_0x1f8adc[_0x080e('0x4d')]['id']){delete _0x1f8adc[_0x080e('0x4d')]['id'];}return db[_0x080e('0x2f')][_0x080e('0x4b')]({'where':{'id':_0x1f8adc[_0x080e('0x47')]['id']}})[_0x080e('0x28')](handleEntityNotFound(_0x40e2e0,null))[_0x080e('0x28')](function(_0xa77573){if(_0xa77573){_0x1f8adc[_0x080e('0x4d')]['DashboardId']=_0xa77573['id'];_0x1f8adc[_0x080e('0x4d')][_0x080e('0x5c')]=widgetAttributes(_0x1f8adc['body']);return db[_0x080e('0x6f')][_0x080e('0x4c')](_0x1f8adc[_0x080e('0x4d')]);}})[_0x080e('0x28')](respondWithResult(_0x40e2e0,null))[_0x080e('0x45')](handleError(_0x40e2e0,null));};exports[_0x080e('0x70')]=function(_0x576e32,_0x2f83e2,_0x50b23b){var _0x225efc={};var _0xb4a850={};var _0x3b174f;var _0x2688c3;return db[_0x080e('0x2f')][_0x080e('0x71')]({'where':{'id':_0x576e32['params']['id']}})[_0x080e('0x28')](handleEntityNotFound(_0x2f83e2,null))[_0x080e('0x28')](function(_0x33c02e){if(_0x33c02e){_0x3b174f=_0x33c02e;_0xb4a850[_0x080e('0x36')]=_[_0x080e('0x34')](db['DashboardItem']['rawAttributes']);_0xb4a850[_0x080e('0x33')]=_['keys'](_0x576e32[_0x080e('0x33')]);_0xb4a850['filters']=_[_0x080e('0x38')](_0xb4a850[_0x080e('0x36')],_0xb4a850[_0x080e('0x33')]);_0x225efc[_0x080e('0x37')]=_['intersection'](_0xb4a850[_0x080e('0x36')],qs[_0x080e('0x39')](_0x576e32[_0x080e('0x33')]['fields']));_0x225efc[_0x080e('0x37')]=_0x225efc[_0x080e('0x37')][_0x080e('0x49')]?_0x225efc[_0x080e('0x37')]:_0xb4a850[_0x080e('0x36')];_0x225efc[_0x080e('0x3c')]=qs['sort'](_0x576e32[_0x080e('0x33')][_0x080e('0x72')]);_0x225efc[_0x080e('0x3d')]=qs[_0x080e('0x35')](_['pick'](_0x576e32[_0x080e('0x33')],_0xb4a850[_0x080e('0x35')]));if(_0x576e32[_0x080e('0x33')]['filter']){_0x225efc[_0x080e('0x3d')]=_['merge'](_0x225efc[_0x080e('0x3d')],{'$or':_['map'](_0x225efc['attributes'],function(_0x49b45a){var _0x15a968={};_0x15a968[_0x49b45a]={'$like':'%'+_0x576e32[_0x080e('0x33')][_0x080e('0x3f')]+'%'};return _0x15a968;})});}_0x225efc=_[_0x080e('0x40')]({},_0x225efc,_0x576e32[_0x080e('0x42')]);return _0x3b174f[_0x080e('0x70')](_0x225efc);}})[_0x080e('0x28')](function(_0x293af9){if(_0x293af9){_0x2688c3=_0x293af9[_0x080e('0x49')];if(!_0x576e32[_0x080e('0x33')][_0x080e('0x3a')]('nolimit')){_0x225efc[_0x080e('0x22')]=qs[_0x080e('0x22')](_0x576e32[_0x080e('0x33')][_0x080e('0x22')]);_0x225efc[_0x080e('0x1f')]=qs[_0x080e('0x1f')](_0x576e32[_0x080e('0x33')][_0x080e('0x1f')]);}return _0x3b174f['getItems'](_0x225efc);}})[_0x080e('0x28')](function(_0x4a1c91){if(_0x4a1c91){return _0x4a1c91?{'count':_0x2688c3,'rows':_0x4a1c91}:null;}})[_0x080e('0x28')](respondWithResult(_0x2f83e2,null))[_0x080e('0x45')](handleError(_0x2f83e2,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 54bab7b..767227a 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 _0x3e24=['../../mysqldb','Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x34332d,_0x3bfcb7){var _0x8b9b43=function(_0x37a1c0){while(--_0x37a1c0){_0x34332d['push'](_0x34332d['shift']());}};_0x8b9b43(++_0x3bfcb7);}(_0x3e24,0x167));var _0x43e2=function(_0x4b3afb,_0x3647a8){_0x4b3afb=_0x4b3afb-0x0;var _0xbd2892=_0x3e24[_0x4b3afb];return _0xbd2892;};'use strict';var EventEmitter=require(_0x43e2('0x0'));var Dashboard=require(_0x43e2('0x1'))['db'][_0x43e2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x43e2('0x3')](0x0);var events={'afterCreate':_0x43e2('0x4'),'afterUpdate':'update','afterDestroy':_0x43e2('0x5')};function emitEvent(_0x1ff04b){return function(_0x5d2806,_0x1dd127,_0x18629c){DashboardEvents[_0x43e2('0x6')](_0x1ff04b+':'+_0x5d2806['id'],_0x5d2806);DashboardEvents[_0x43e2('0x6')](_0x1ff04b,_0x5d2806);_0x18629c(null);};}for(var e in events){if(events[_0x43e2('0x7')](e)){var event=events[e];Dashboard[_0x43e2('0x8')](e,emitEvent(event));}}module[_0x43e2('0x9')]=DashboardEvents; \ No newline at end of file +var _0x141c=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','save','update','remove','emit'];(function(_0x30da2e,_0x146e54){var _0x794139=function(_0x25bd28){while(--_0x25bd28){_0x30da2e['push'](_0x30da2e['shift']());}};_0x794139(++_0x146e54);}(_0x141c,0x143));var _0xc141=function(_0x58c1e3,_0x214851){_0x58c1e3=_0x58c1e3-0x0;var _0x5bf69c=_0x141c[_0x58c1e3];return _0x5bf69c;};'use strict';var EventEmitter=require(_0xc141('0x0'));var Dashboard=require(_0xc141('0x1'))['db'][_0xc141('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc141('0x3'),'afterUpdate':_0xc141('0x4'),'afterDestroy':_0xc141('0x5')};function emitEvent(_0x1cb34b){return function(_0x2d4ffe,_0x4ccbfa,_0xe33597){DashboardEvents[_0xc141('0x6')](_0x1cb34b+':'+_0x2d4ffe['id'],_0x2d4ffe);DashboardEvents[_0xc141('0x6')](_0x1cb34b,_0x2d4ffe);_0xe33597(null);};}for(var e in events){if(events[_0xc141('0x7')](e)){var event=events[e];Dashboard[_0xc141('0x8')](e,emitEvent(event));}}module[_0xc141('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 3494416..1fb33c6 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 _0x6d23=['util','../../config/logger','moment','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash'];(function(_0x4fa5c0,_0x34e425){var _0x81da33=function(_0x26502e){while(--_0x26502e){_0x4fa5c0['push'](_0x4fa5c0['shift']());}};_0x81da33(++_0x34e425);}(_0x6d23,0x14f));var _0x36d2=function(_0x243af5,_0xa25ed9){_0x243af5=_0x243af5-0x0;var _0x508826=_0x6d23[_0x243af5];return _0x508826;};'use strict';var _=require(_0x36d2('0x0'));var util=require(_0x36d2('0x1'));var logger=require(_0x36d2('0x2'))('api');var moment=require(_0x36d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36d2('0x4'));var rimraf=require(_0x36d2('0x5'));var config=require(_0x36d2('0x6'));var attributes=require(_0x36d2('0x7'));module[_0x36d2('0x8')]=function(_0x2e5975,_0x4ce629){return _0x2e5975[_0x36d2('0x9')](_0x36d2('0xa'),attributes,{'tableName':_0x36d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5b1=['lodash','moment','path','rimraf','exports','define','dashboards'];(function(_0x4e435d,_0x3ea863){var _0x411552=function(_0x33cbeb){while(--_0x33cbeb){_0x4e435d['push'](_0x4e435d['shift']());}};_0x411552(++_0x3ea863);}(_0xb5b1,0xcb));var _0x1b5b=function(_0x2484d2,_0x4ef1e0){_0x2484d2=_0x2484d2-0x0;var _0x4f47da=_0xb5b1[_0x2484d2];return _0x4f47da;};'use strict';var _=require(_0x1b5b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1b5b('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b5b('0x2'));var rimraf=require(_0x1b5b('0x3'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x1b5b('0x4')]=function(_0x7c7b3,_0x2bc562){return _0x7c7b3[_0x1b5b('0x5')]('Dashboard',attributes,{'tableName':_0x1b5b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 13bf11f..a07c6ee 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 _0x3a08=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','Dashboard,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','request\x20sent','debug'];(function(_0x19f866,_0xf68c27){var _0x59bf91=function(_0x315b27){while(--_0x315b27){_0x19f866['push'](_0x19f866['shift']());}};_0x59bf91(++_0xf68c27);}(_0x3a08,0x131));var _0x83a0=function(_0x1256cf,_0x359628){_0x1256cf=_0x1256cf-0x0;var _0x1d16b7=_0x3a08[_0x1256cf];return _0x1d16b7;};'use strict';var _=require(_0x83a0('0x0'));var util=require('util');var moment=require(_0x83a0('0x1'));var BPromise=require(_0x83a0('0x2'));var rs=require(_0x83a0('0x3'));var fs=require('fs');var Redis=require(_0x83a0('0x4'));var db=require(_0x83a0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83a0('0x6'))('rpc');var config=require(_0x83a0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x83a0('0x8')]({'port':0x232a});config[_0x83a0('0x9')]=_[_0x83a0('0xa')](config[_0x83a0('0x9')],{'host':_0x83a0('0xb'),'port':0x18eb});var socket=require(_0x83a0('0xc'))(new Redis(config[_0x83a0('0x9')]));require(_0x83a0('0xd'))[_0x83a0('0xe')](socket);function respondWithRpcPromise(_0x26d031,_0x3bfd7b,_0x2c0739){return new BPromise(function(_0x2c1ac4,_0x338313){return client[_0x83a0('0xf')](_0x26d031,_0x2c0739)[_0x83a0('0x10')](function(_0x2883e9){logger['info']('Dashboard,\x20%s,\x20%s',_0x3bfd7b,_0x83a0('0x11'));logger[_0x83a0('0x12')](_0x83a0('0x13'),_0x3bfd7b,_0x83a0('0x11'),JSON[_0x83a0('0x14')](_0x2883e9));if(_0x2883e9[_0x83a0('0x15')]){if(_0x2883e9[_0x83a0('0x15')]['code']===0x1f4){logger[_0x83a0('0x15')](_0x83a0('0x16'),_0x3bfd7b,_0x2883e9[_0x83a0('0x15')]['message']);return _0x338313(_0x2883e9[_0x83a0('0x15')]['message']);}logger['error'](_0x83a0('0x16'),_0x3bfd7b,_0x2883e9['error'][_0x83a0('0x17')]);return _0x2c1ac4(_0x2883e9[_0x83a0('0x15')]['message']);}else{logger[_0x83a0('0x18')](_0x83a0('0x16'),_0x3bfd7b,'request\x20sent');_0x2c1ac4(_0x2883e9[_0x83a0('0x19')][_0x83a0('0x17')]);}})[_0x83a0('0x1a')](function(_0x1642ae){logger[_0x83a0('0x15')](_0x83a0('0x16'),_0x3bfd7b,_0x1642ae);_0x338313(_0x1642ae);});});} \ No newline at end of file +var _0xa2e3=['info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket'];(function(_0xb4e6b1,_0x37bb2e){var _0x515972=function(_0x51417c){while(--_0x51417c){_0xb4e6b1['push'](_0xb4e6b1['shift']());}};_0x515972(++_0x37bb2e);}(_0xa2e3,0x128));var _0x3a2e=function(_0x2a659c,_0x37b069){_0x2a659c=_0x2a659c-0x0;var _0x529157=_0xa2e3[_0x2a659c];return _0x529157;};'use strict';var _=require(_0x3a2e('0x0'));var util=require(_0x3a2e('0x1'));var moment=require('moment');var BPromise=require(_0x3a2e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a2e('0x3'));var db=require(_0x3a2e('0x4'))['db'];var utils=require(_0x3a2e('0x5'));var logger=require(_0x3a2e('0x6'))(_0x3a2e('0x7'));var config=require(_0x3a2e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a2e('0x9')][_0x3a2e('0xa')]({'port':0x232a});config['redis']=_[_0x3a2e('0xb')](config[_0x3a2e('0xc')],{'host':_0x3a2e('0xd'),'port':0x18eb});var socket=require(_0x3a2e('0xe'))(new Redis(config['redis']));require(_0x3a2e('0xf'))['register'](socket);function respondWithRpcPromise(_0x10d297,_0x456cad,_0x65070f){return new BPromise(function(_0x3c1304,_0x5ba407){return client['request'](_0x10d297,_0x65070f)['then'](function(_0x43cd18){logger[_0x3a2e('0x10')](_0x3a2e('0x11'),_0x456cad,_0x3a2e('0x12'));logger['debug'](_0x3a2e('0x13'),_0x456cad,_0x3a2e('0x12'),JSON[_0x3a2e('0x14')](_0x43cd18));if(_0x43cd18[_0x3a2e('0x15')]){if(_0x43cd18['error']['code']===0x1f4){logger[_0x3a2e('0x15')](_0x3a2e('0x11'),_0x456cad,_0x43cd18['error']['message']);return _0x5ba407(_0x43cd18[_0x3a2e('0x15')]['message']);}logger[_0x3a2e('0x15')](_0x3a2e('0x11'),_0x456cad,_0x43cd18[_0x3a2e('0x15')][_0x3a2e('0x16')]);return _0x3c1304(_0x43cd18['error'][_0x3a2e('0x16')]);}else{logger['info'](_0x3a2e('0x11'),_0x456cad,'request\x20sent');_0x3c1304(_0x43cd18[_0x3a2e('0x17')][_0x3a2e('0x16')]);}})['catch'](function(_0x4be2d2){logger['error'](_0x3a2e('0x11'),_0x456cad,_0x4be2d2);_0x5ba407(_0x4be2d2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6b69e75..a709ad9 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 _0x7398=['removeListener','register','length','remove','emit'];(function(_0x1bef5b,_0x272aa4){var _0x3358ad=function(_0x2ad8e6){while(--_0x2ad8e6){_0x1bef5b['push'](_0x1bef5b['shift']());}};_0x3358ad(++_0x272aa4);}(_0x7398,0xd5));var _0x8739=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7398[_0x4f9b18];return _0x29f20c;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x8739('0x0'),'update'];function createListener(_0x13d8c5,_0x1b97e4){return function(_0x3d14c4){_0x1b97e4[_0x8739('0x1')](_0x13d8c5,_0x3d14c4);};}function removeListener(_0x50c54f,_0x3da8e2){return function(){DashboardEvents[_0x8739('0x2')](_0x50c54f,_0x3da8e2);};}exports[_0x8739('0x3')]=function(_0x40c6c2){for(var _0x551acf=0x0,_0x22ec91=events[_0x8739('0x4')];_0x551acf<_0x22ec91;_0x551acf++){var _0x242e3b=events[_0x551acf];var _0x1fbda1=createListener('dashboard:'+_0x242e3b,_0x40c6c2);DashboardEvents['on'](_0x242e3b,_0x1fbda1);}}; \ No newline at end of file +var _0x4f18=['update','removeListener','register','length','dashboard:','./dashboard.events','remove'];(function(_0x2417cb,_0x30f452){var _0x4dabae=function(_0x41659a){while(--_0x41659a){_0x2417cb['push'](_0x2417cb['shift']());}};_0x4dabae(++_0x30f452);}(_0x4f18,0x1b0));var _0x84f1=function(_0x471809,_0x566d8e){_0x471809=_0x471809-0x0;var _0x82c43d=_0x4f18[_0x471809];return _0x82c43d;};'use strict';var DashboardEvents=require(_0x84f1('0x0'));var events=['save',_0x84f1('0x1'),_0x84f1('0x2')];function createListener(_0x4c73aa,_0x29458c){return function(_0x24db64){_0x29458c['emit'](_0x4c73aa,_0x24db64);};}function removeListener(_0x9fdf5,_0x5880ef){return function(){DashboardEvents[_0x84f1('0x3')](_0x9fdf5,_0x5880ef);};}exports[_0x84f1('0x4')]=function(_0xb1fd49){for(var _0x2e6c1d=0x0,_0x4c93b0=events[_0x84f1('0x5')];_0x2e6c1d<_0x4c93b0;_0x2e6c1d++){var _0x3155be=events[_0x2e6c1d];var _0x3b7654=createListener(_0x84f1('0x6')+_0x3155be,_0xb1fd49);DashboardEvents['on'](_0x3155be,_0x3b7654);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index fa6b4bc..aafa91d 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 _0x2ffc=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3f23f8,_0x2aadcd){var _0x22edc3=function(_0x37e358){while(--_0x37e358){_0x3f23f8['push'](_0x3f23f8['shift']());}};_0x22edc3(++_0x2aadcd);}(_0x2ffc,0x12e));var _0xc2ff=function(_0x4edb41,_0x15436a){_0x4edb41=_0x4edb41-0x0;var _0x2ffc8e=_0x2ffc[_0x4edb41];return _0x2ffc8e;};'use strict';var multer=require(_0xc2ff('0x0'));var util=require('util');var path=require(_0xc2ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xc2ff('0x2'));var router=express[_0xc2ff('0x3')]();var fs_extra=require(_0xc2ff('0x4'));var auth=require(_0xc2ff('0x5'));var interaction=require(_0xc2ff('0x6'));var config=require(_0xc2ff('0x7'));var controller=require('./dashboard.controller');router[_0xc2ff('0x8')]('/',auth[_0xc2ff('0x9')](),controller[_0xc2ff('0xa')]);router['get'](_0xc2ff('0xb'),auth[_0xc2ff('0x9')](),controller[_0xc2ff('0xc')]);router['get'](_0xc2ff('0xd'),auth[_0xc2ff('0x9')](),controller[_0xc2ff('0xe')]);router[_0xc2ff('0xf')]('/',auth[_0xc2ff('0x9')](),controller[_0xc2ff('0x10')]);router[_0xc2ff('0xf')](_0xc2ff('0x11'),auth['isAuthenticated'](),controller[_0xc2ff('0x12')]);router['post']('/:id/items',auth['isAuthenticated'](),controller['addItem']);router[_0xc2ff('0x13')](_0xc2ff('0xb'),auth[_0xc2ff('0x9')](),controller['update']);router[_0xc2ff('0x14')](_0xc2ff('0xb'),auth['isAuthenticated'](),controller[_0xc2ff('0x15')]);module['exports']=router; \ No newline at end of file +var _0xde9a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','create','clone','/:id/items','addItem','put','update','delete','exports','multer'];(function(_0x347a4b,_0x15c25d){var _0x150134=function(_0x106a0b){while(--_0x106a0b){_0x347a4b['push'](_0x347a4b['shift']());}};_0x150134(++_0x15c25d);}(_0xde9a,0x1b9));var _0xade9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xde9a[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xade9('0x0'));var util=require(_0xade9('0x1'));var path=require(_0xade9('0x2'));var timeout=require(_0xade9('0x3'));var express=require(_0xade9('0x4'));var router=express[_0xade9('0x5')]();var fs_extra=require(_0xade9('0x6'));var auth=require(_0xade9('0x7'));var interaction=require(_0xade9('0x8'));var config=require(_0xade9('0x9'));var controller=require(_0xade9('0xa'));router[_0xade9('0xb')]('/',auth[_0xade9('0xc')](),controller[_0xade9('0xd')]);router[_0xade9('0xb')](_0xade9('0xe'),auth[_0xade9('0xc')](),controller[_0xade9('0xf')]);router[_0xade9('0xb')]('/:id/items',auth[_0xade9('0xc')](),controller[_0xade9('0x10')]);router[_0xade9('0x11')]('/',auth['isAuthenticated'](),controller[_0xade9('0x12')]);router['post']('/:id/clone',auth[_0xade9('0xc')](),controller[_0xade9('0x13')]);router[_0xade9('0x11')](_0xade9('0x14'),auth[_0xade9('0xc')](),controller[_0xade9('0x15')]);router[_0xade9('0x16')](_0xade9('0xe'),auth[_0xade9('0xc')](),controller[_0xade9('0x17')]);router[_0xade9('0x18')](_0xade9('0xe'),auth[_0xade9('0xc')](),controller['destroy']);module[_0xade9('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5afb88c..42d2008 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 _0x5d17=['#ffffff','sequelize','squel','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0x5d17,0x114));var _0x75d1=function(_0x4d3940,_0x167a82){_0x4d3940=_0x4d3940-0x0;var _0x542862=_0x5d17[_0x4d3940];return _0x542862;};'use strict';var Sequelize=require(_0x75d1('0x0'));var squel=require(_0x75d1('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75d1('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x75d1('0x3')]('long'),'get':function(){try{return JSON[_0x75d1('0x4')](this[_0x75d1('0x5')](_0x75d1('0x6')));}catch(_0x32bd45){return[];}},'set':function(_0x56ac0a){try{this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')](_0x56ac0a));}catch(_0x1ee61b){this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x75d1('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x75d1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x75d1('0x2')]},'titleFontSize':{'type':Sequelize[_0x75d1('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x56c3ce,_0x1f8b29){var _0x5a3866=function(_0x142a2f){while(--_0x142a2f){_0x56c3ce['push'](_0x56c3ce['shift']());}};_0x5a3866(++_0x1f8b29);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index ca0d8af..ae8e5bd 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 _0x7a30=['save','update','then','destroy','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','model','attributes','length','include','options','find','catch','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject'];(function(_0x41d126,_0x38d33e){var _0x5c0b51=function(_0x31fbb7){while(--_0x31fbb7){_0x41d126['push'](_0x41d126['shift']());}};_0x5c0b51(++_0x38d33e);}(_0x7a30,0x8c));var _0x07a3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a30[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x07a3('0x0'));var rimraf=require(_0x07a3('0x1'));var zipdir=require(_0x07a3('0x2'));var jsonpatch=require(_0x07a3('0x3'));var rp=require(_0x07a3('0x4'));var moment=require(_0x07a3('0x5'));var BPromise=require(_0x07a3('0x6'));var Mustache=require(_0x07a3('0x7'));var util=require('util');var path=require(_0x07a3('0x8'));var sox=require(_0x07a3('0x9'));var csv=require(_0x07a3('0xa'));var ejs=require(_0x07a3('0xb'));var fs=require('fs');var fs_extra=require(_0x07a3('0xc'));var _=require(_0x07a3('0xd'));var squel=require(_0x07a3('0xe'));var crypto=require('crypto');var jsforce=require(_0x07a3('0xf'));var deskjs=require(_0x07a3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x07a3('0x11'));var Papa=require(_0x07a3('0x12'));var Redis=require('ioredis');var authService=require(_0x07a3('0x13'));var qs=require(_0x07a3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07a3('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x07a3('0x16'));var config=require(_0x07a3('0x17'));var licenseUtil=require(_0x07a3('0x18'));var db=require(_0x07a3('0x19'))['db'];config['redis']=_[_0x07a3('0x1a')](config[_0x07a3('0x1b')],{'host':_0x07a3('0x1c'),'port':0x18eb});var socket=require(_0x07a3('0x1d'))(new Redis(config[_0x07a3('0x1b')]));require('./dashboardItem.socket')[_0x07a3('0x1e')](socket);function respondWithStatusCode(_0x430f9a,_0x2c11a8){_0x2c11a8=_0x2c11a8||0xcc;return function(_0x36ec6b){if(_0x36ec6b){return _0x430f9a[_0x07a3('0x1f')](_0x2c11a8);}return _0x430f9a[_0x07a3('0x20')](_0x2c11a8)[_0x07a3('0x21')]();};}function respondWithResult(_0x254710,_0x394729){_0x394729=_0x394729||0xc8;return function(_0x1718fb){if(_0x1718fb){return _0x254710[_0x07a3('0x20')](_0x394729)['json'](_0x1718fb);}};}function respondWithFilteredResult(_0x7dc732,_0x1dbdd2){return function(_0x46a8b8){if(_0x46a8b8){var _0x5d8352=typeof _0x1dbdd2[_0x07a3('0x22')]==='undefined'&&typeof _0x1dbdd2[_0x07a3('0x23')]===_0x07a3('0x24');var _0x1c4db9=_0x46a8b8[_0x07a3('0x25')];var _0x5968c5=_0x5d8352?0x0:_0x1dbdd2[_0x07a3('0x22')];var _0x3bba04=_0x5d8352?_0x46a8b8[_0x07a3('0x25')]:_0x1dbdd2[_0x07a3('0x22')]+_0x1dbdd2[_0x07a3('0x23')];var _0xd7ac84;if(_0x3bba04>=_0x1c4db9){_0x3bba04=_0x1c4db9;_0xd7ac84=0xc8;}else{_0xd7ac84=0xce;}_0x7dc732[_0x07a3('0x20')](_0xd7ac84);return _0x7dc732['set'](_0x07a3('0x26'),_0x5968c5+'-'+_0x3bba04+'/'+_0x1c4db9)[_0x07a3('0x27')](_0x46a8b8);}return null;};}function patchUpdates(_0x448cf6){return function(_0x4207eb){try{jsonpatch[_0x07a3('0x28')](_0x4207eb,_0x448cf6,!![]);}catch(_0x58670b){return BPromise[_0x07a3('0x29')](_0x58670b);}return _0x4207eb[_0x07a3('0x2a')]();};}function saveUpdates(_0x388c76,_0x2b80a5){return function(_0x11e682){if(_0x11e682){return _0x11e682[_0x07a3('0x2b')](_0x388c76)[_0x07a3('0x2c')](function(_0x1be6b4){return _0x1be6b4;});}return null;};}function removeEntity(_0x3cdd31,_0x55f2bc){return function(_0x4cd156){if(_0x4cd156){return _0x4cd156[_0x07a3('0x2d')]()[_0x07a3('0x2c')](function(){_0x3cdd31[_0x07a3('0x20')](0xcc)[_0x07a3('0x21')]();});}};}function handleEntityNotFound(_0x14ea35,_0x75403e){return function(_0x2adc0b){if(!_0x2adc0b){_0x14ea35[_0x07a3('0x1f')](0x194);}return _0x2adc0b;};}function handleError(_0xbaf345,_0x2ddc52){_0x2ddc52=_0x2ddc52||0x1f4;return function(_0x22e798){logger['error'](_0x22e798[_0x07a3('0x2e')]);if(_0x22e798['name']){delete _0x22e798[_0x07a3('0x2f')];}_0xbaf345['status'](_0x2ddc52)[_0x07a3('0x30')](_0x22e798);};}exports[_0x07a3('0x31')]=function(_0x573f23,_0x51ca4f){var _0x258c5e={'raw':![],'where':{'id':_0x573f23[_0x07a3('0x32')]['id']}},_0x5e7478={};_0x5e7478['model']=_[_0x07a3('0x33')](db[_0x07a3('0x34')][_0x07a3('0x35')]);_0x5e7478[_0x07a3('0x36')]=_[_0x07a3('0x33')](_0x573f23[_0x07a3('0x36')]);_0x5e7478[_0x07a3('0x37')]=_['intersection'](_0x5e7478[_0x07a3('0x38')],_0x5e7478[_0x07a3('0x36')]);_0x258c5e['attributes']=_['intersection'](_0x5e7478[_0x07a3('0x38')],qs['fields'](_0x573f23[_0x07a3('0x36')]['fields']));_0x258c5e[_0x07a3('0x39')]=_0x258c5e[_0x07a3('0x39')][_0x07a3('0x3a')]?_0x258c5e[_0x07a3('0x39')]:_0x5e7478[_0x07a3('0x38')];if(_0x573f23[_0x07a3('0x36')]['includeAll']){_0x258c5e[_0x07a3('0x3b')]=[{'all':!![]}];}_0x258c5e=_['merge']({},_0x258c5e,_0x573f23[_0x07a3('0x3c')]);return db['DashboardItem'][_0x07a3('0x3d')](_0x258c5e)[_0x07a3('0x2c')](handleEntityNotFound(_0x51ca4f,null))[_0x07a3('0x2c')](respondWithResult(_0x51ca4f,null))['catch'](handleError(_0x51ca4f,null));};exports[_0x07a3('0x2d')]=function(_0x4da3c7,_0x42ae06){return db[_0x07a3('0x34')]['find']({'where':{'id':_0x4da3c7[_0x07a3('0x32')]['id']}})[_0x07a3('0x2c')](handleEntityNotFound(_0x42ae06,null))[_0x07a3('0x2c')](removeEntity(_0x42ae06,null))[_0x07a3('0x3e')](handleError(_0x42ae06,null));};function widgetAttributes(_0x54c32e){try{switch(_0x54c32e[_0x07a3('0x3f')]){case _0x07a3('0x40'):return[{'name':_0x07a3('0x41'),'value':_0x54c32e['attrUrl']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x43')]:undefined)||'https://'}];case'custom':return[{'name':_0x07a3('0x44'),'value':_0x54c32e[_0x07a3('0x44')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0]['value']:undefined)||''}];case _0x07a3('0x45'):return[{'name':_0x07a3('0x46'),'value':_0x54c32e['attrHourFormat']||(_0x54c32e['attrs']&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x43')]:undefined)||'HH:mm:ss'},{'name':_0x07a3('0x47'),'value':_0x54c32e[_0x07a3('0x47')]||(_0x54c32e['attrs']&&_0x54c32e['attrs'][0x1]?_0x54c32e['attrs'][0x1][_0x07a3('0x43')]:undefined)||_0x07a3('0x48')},{'name':_0x07a3('0x49'),'value':_0x54c32e['attrFontSize']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x2]?_0x54c32e[_0x07a3('0x42')][0x2][_0x07a3('0x43')]:undefined)||0xc}];case _0x07a3('0x4a'):return[{'name':_0x07a3('0x4b'),'value':_0x54c32e[_0x07a3('0x4b')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e['attrs'][0x0]['value']:undefined)||_0x07a3('0x4c')},{'name':_0x07a3('0x4d'),'value':_0x54c32e[_0x07a3('0x4d')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x1]?_0x54c32e['attrs'][0x1][_0x07a3('0x43')]:undefined)||[]},{'name':'attrFontSize','value':_0x54c32e[_0x07a3('0x49')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x2]?_0x54c32e[_0x07a3('0x42')][0x2][_0x07a3('0x43')]:undefined)||0x14}];case _0x07a3('0x4e'):case _0x07a3('0x4f'):return[{'name':'attrSerie1','value':_0x54c32e['attrSerie1']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x43')]:undefined)||_0x07a3('0x4c')},{'name':_0x07a3('0x50'),'value':_0x54c32e[_0x07a3('0x50')]||(_0x54c32e['attrs']&&_0x54c32e[_0x07a3('0x42')][0x1]?_0x54c32e[_0x07a3('0x42')][0x1][_0x07a3('0x43')]:undefined)||null},{'name':'attrSerie3','value':_0x54c32e[_0x07a3('0x51')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x2]?_0x54c32e[_0x07a3('0x42')][0x2]['value']:undefined)||null},{'name':_0x07a3('0x4d'),'value':_0x54c32e['attrVoiceQueues']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x3]?_0x54c32e[_0x07a3('0x42')][0x3][_0x07a3('0x43')]:undefined)||[]}];case _0x07a3('0x52'):return[{'name':_0x07a3('0x53'),'type':_0x54c32e[_0x07a3('0x54')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e[_0x07a3('0x42')][0x0]?_0x54c32e[_0x07a3('0x42')][0x0][_0x07a3('0x3f')]:undefined)||null,'value':_0x54c32e['attrReport']||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x0]?_0x54c32e['attrs'][0x0][_0x07a3('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x54c32e[_0x07a3('0x55')]||(_0x54c32e[_0x07a3('0x42')]&&_0x54c32e['attrs'][0x1]?_0x54c32e[_0x07a3('0x42')][0x1][_0x07a3('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x3861da){logger[_0x07a3('0x56')](_0x07a3('0x57'),JSON[_0x07a3('0x58')](_0x3861da));return[];}}exports[_0x07a3('0x59')]=function(_0x1cc673,_0x31dfd9){if(_0x1cc673[_0x07a3('0x5a')]){_0x1cc673['body'][_0x07a3('0x42')]=widgetAttributes(_0x1cc673[_0x07a3('0x5a')]);}return db[_0x07a3('0x34')]['create'](_0x1cc673[_0x07a3('0x5a')],{})[_0x07a3('0x2c')](respondWithResult(_0x31dfd9,0xc9))[_0x07a3('0x3e')](handleError(_0x31dfd9,null));};exports[_0x07a3('0x2b')]=function(_0xcd900,_0x40e6da){if(_0xcd900[_0x07a3('0x5a')]['id']){delete _0xcd900[_0x07a3('0x5a')]['id'];}_0xcd900['body'][_0x07a3('0x42')]=widgetAttributes(_0xcd900['body']);return db[_0x07a3('0x34')][_0x07a3('0x3d')]({'where':{'id':_0xcd900[_0x07a3('0x32')]['id']}})[_0x07a3('0x2c')](handleEntityNotFound(_0x40e6da,null))['then'](saveUpdates(_0xcd900['body'],null))[_0x07a3('0x2c')](respondWithResult(_0x40e6da,null))[_0x07a3('0x3e')](handleError(_0x40e6da,null));}; \ No newline at end of file +var _0x831c=['fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','update','eml-format','rimraf'];(function(_0x43b8da,_0x346385){var _0x343207=function(_0x4559bc){while(--_0x4559bc){_0x43b8da['push'](_0x43b8da['shift']());}};_0x343207(++_0x346385);}(_0x831c,0x172));var _0xc831=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x831c[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0xc831('0x0'));var rimraf=require(_0xc831('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc831('0x2'));var rp=require(_0xc831('0x3'));var moment=require(_0xc831('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc831('0x5'));var util=require(_0xc831('0x6'));var path=require(_0xc831('0x7'));var sox=require(_0xc831('0x8'));var csv=require('to-csv');var ejs=require(_0xc831('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc831('0xa'));var crypto=require('crypto');var jsforce=require(_0xc831('0xb'));var deskjs=require(_0xc831('0xc'));var toCsv=require(_0xc831('0xd'));var querystring=require(_0xc831('0xe'));var Papa=require(_0xc831('0xf'));var Redis=require(_0xc831('0x10'));var authService=require(_0xc831('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc831('0x12'));var logger=require(_0xc831('0x13'))(_0xc831('0x14'));var utils=require(_0xc831('0x15'));var config=require(_0xc831('0x16'));var licenseUtil=require(_0xc831('0x17'));var db=require(_0xc831('0x18'))['db'];config[_0xc831('0x19')]=_['defaults'](config[_0xc831('0x19')],{'host':_0xc831('0x1a'),'port':0x18eb});var socket=require(_0xc831('0x1b'))(new Redis(config[_0xc831('0x19')]));require(_0xc831('0x1c'))[_0xc831('0x1d')](socket);function respondWithStatusCode(_0x163490,_0x2013b2){_0x2013b2=_0x2013b2||0xcc;return function(_0x3f7181){if(_0x3f7181){return _0x163490[_0xc831('0x1e')](_0x2013b2);}return _0x163490[_0xc831('0x1f')](_0x2013b2)[_0xc831('0x20')]();};}function respondWithResult(_0x2b1266,_0x7b9875){_0x7b9875=_0x7b9875||0xc8;return function(_0xba4607){if(_0xba4607){return _0x2b1266[_0xc831('0x1f')](_0x7b9875)[_0xc831('0x21')](_0xba4607);}};}function respondWithFilteredResult(_0x36c23e,_0x8a6913){return function(_0xa21ce5){if(_0xa21ce5){var _0x2d88bd=typeof _0x8a6913[_0xc831('0x22')]===_0xc831('0x23')&&typeof _0x8a6913[_0xc831('0x24')]===_0xc831('0x23');var _0x48d4fc=_0xa21ce5[_0xc831('0x25')];var _0x36e6c6=_0x2d88bd?0x0:_0x8a6913['offset'];var _0x10f3c7=_0x2d88bd?_0xa21ce5['count']:_0x8a6913[_0xc831('0x22')]+_0x8a6913[_0xc831('0x24')];var _0x221907;if(_0x10f3c7>=_0x48d4fc){_0x10f3c7=_0x48d4fc;_0x221907=0xc8;}else{_0x221907=0xce;}_0x36c23e['status'](_0x221907);return _0x36c23e[_0xc831('0x26')](_0xc831('0x27'),_0x36e6c6+'-'+_0x10f3c7+'/'+_0x48d4fc)[_0xc831('0x21')](_0xa21ce5);}return null;};}function patchUpdates(_0x60e76e){return function(_0x53d3d0){try{jsonpatch[_0xc831('0x28')](_0x53d3d0,_0x60e76e,!![]);}catch(_0x480eae){return BPromise[_0xc831('0x29')](_0x480eae);}return _0x53d3d0[_0xc831('0x2a')]();};}function saveUpdates(_0x288569,_0x161579){return function(_0x2f0d7c){if(_0x2f0d7c){return _0x2f0d7c['update'](_0x288569)['then'](function(_0x4f5fd8){return _0x4f5fd8;});}return null;};}function removeEntity(_0x1b0d22,_0xd5001f){return function(_0x353853){if(_0x353853){return _0x353853[_0xc831('0x2b')]()[_0xc831('0x2c')](function(){_0x1b0d22[_0xc831('0x1f')](0xcc)[_0xc831('0x20')]();});}};}function handleEntityNotFound(_0x2847e6,_0x508558){return function(_0x4f71b0){if(!_0x4f71b0){_0x2847e6[_0xc831('0x1e')](0x194);}return _0x4f71b0;};}function handleError(_0xee01dc,_0x3214c5){_0x3214c5=_0x3214c5||0x1f4;return function(_0x2dab6e){logger[_0xc831('0x2d')](_0x2dab6e[_0xc831('0x2e')]);if(_0x2dab6e[_0xc831('0x2f')]){delete _0x2dab6e[_0xc831('0x2f')];}_0xee01dc[_0xc831('0x1f')](_0x3214c5)['send'](_0x2dab6e);};}exports[_0xc831('0x30')]=function(_0x4ad877,_0x52e28c){var _0x58bcc9={'raw':![],'where':{'id':_0x4ad877[_0xc831('0x31')]['id']}},_0x3d79bc={};_0x3d79bc[_0xc831('0x32')]=_[_0xc831('0x33')](db['DashboardItem']['rawAttributes']);_0x3d79bc[_0xc831('0x34')]=_[_0xc831('0x33')](_0x4ad877[_0xc831('0x34')]);_0x3d79bc[_0xc831('0x35')]=_[_0xc831('0x36')](_0x3d79bc['model'],_0x3d79bc[_0xc831('0x34')]);_0x58bcc9[_0xc831('0x37')]=_[_0xc831('0x36')](_0x3d79bc[_0xc831('0x32')],qs[_0xc831('0x38')](_0x4ad877['query'][_0xc831('0x38')]));_0x58bcc9['attributes']=_0x58bcc9[_0xc831('0x37')][_0xc831('0x39')]?_0x58bcc9['attributes']:_0x3d79bc[_0xc831('0x32')];if(_0x4ad877[_0xc831('0x34')][_0xc831('0x3a')]){_0x58bcc9['include']=[{'all':!![]}];}_0x58bcc9=_[_0xc831('0x3b')]({},_0x58bcc9,_0x4ad877[_0xc831('0x3c')]);return db[_0xc831('0x3d')][_0xc831('0x3e')](_0x58bcc9)[_0xc831('0x2c')](handleEntityNotFound(_0x52e28c,null))[_0xc831('0x2c')](respondWithResult(_0x52e28c,null))[_0xc831('0x3f')](handleError(_0x52e28c,null));};exports['destroy']=function(_0x5349d1,_0x1af703){return db[_0xc831('0x3d')][_0xc831('0x3e')]({'where':{'id':_0x5349d1[_0xc831('0x31')]['id']}})[_0xc831('0x2c')](handleEntityNotFound(_0x1af703,null))[_0xc831('0x2c')](removeEntity(_0x1af703,null))[_0xc831('0x3f')](handleError(_0x1af703,null));};function widgetAttributes(_0x49f32a){try{switch(_0x49f32a[_0xc831('0x40')]){case _0xc831('0x41'):return[{'name':_0xc831('0x42'),'value':_0x49f32a[_0xc831('0x42')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a[_0xc831('0x43')][0x0]?_0x49f32a['attrs'][0x0]['value']:undefined)||_0xc831('0x44')}];case _0xc831('0x45'):return[{'name':_0xc831('0x46'),'value':_0x49f32a[_0xc831('0x46')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a[_0xc831('0x43')][0x0]?_0x49f32a['attrs'][0x0][_0xc831('0x47')]:undefined)||''}];case'clock':return[{'name':_0xc831('0x48'),'value':_0x49f32a['attrHourFormat']||(_0x49f32a['attrs']&&_0x49f32a[_0xc831('0x43')][0x0]?_0x49f32a[_0xc831('0x43')][0x0]['value']:undefined)||_0xc831('0x49')},{'name':_0xc831('0x4a'),'value':_0x49f32a[_0xc831('0x4a')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x1]?_0x49f32a[_0xc831('0x43')][0x1][_0xc831('0x47')]:undefined)||'0.00'},{'name':_0xc831('0x4b'),'value':_0x49f32a['attrFontSize']||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x2]?_0x49f32a[_0xc831('0x43')][0x2]['value']:undefined)||0xc}];case _0xc831('0x4c'):return[{'name':_0xc831('0x4d'),'value':_0x49f32a[_0xc831('0x4d')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x0]?_0x49f32a[_0xc831('0x43')][0x0]['value']:undefined)||'total'},{'name':_0xc831('0x4e'),'value':_0x49f32a['attrVoiceQueues']||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a[_0xc831('0x43')][0x1]?_0x49f32a[_0xc831('0x43')][0x1][_0xc831('0x47')]:undefined)||[]},{'name':'attrFontSize','value':_0x49f32a[_0xc831('0x4b')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x2]?_0x49f32a[_0xc831('0x43')][0x2]['value']:undefined)||0x14}];case _0xc831('0x4f'):case _0xc831('0x50'):return[{'name':_0xc831('0x51'),'value':_0x49f32a[_0xc831('0x51')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x0]?_0x49f32a[_0xc831('0x43')][0x0][_0xc831('0x47')]:undefined)||_0xc831('0x52')},{'name':_0xc831('0x53'),'value':_0x49f32a['attrSerie2']||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a[_0xc831('0x43')][0x1]?_0x49f32a['attrs'][0x1][_0xc831('0x47')]:undefined)||null},{'name':'attrSerie3','value':_0x49f32a[_0xc831('0x54')]||(_0x49f32a['attrs']&&_0x49f32a[_0xc831('0x43')][0x2]?_0x49f32a['attrs'][0x2][_0xc831('0x47')]:undefined)||null},{'name':_0xc831('0x4e'),'value':_0x49f32a[_0xc831('0x4e')]||(_0x49f32a['attrs']&&_0x49f32a['attrs'][0x3]?_0x49f32a[_0xc831('0x43')][0x3][_0xc831('0x47')]:undefined)||[]}];case _0xc831('0x55'):return[{'name':'attrReport','type':_0x49f32a[_0xc831('0x56')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x0]?_0x49f32a[_0xc831('0x43')][0x0][_0xc831('0x40')]:undefined)||null,'value':_0x49f32a[_0xc831('0x57')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a['attrs'][0x0]?_0x49f32a[_0xc831('0x43')][0x0][_0xc831('0x47')]:undefined)||null},{'name':_0xc831('0x58'),'value':_0x49f32a[_0xc831('0x58')]||(_0x49f32a[_0xc831('0x43')]&&_0x49f32a[_0xc831('0x43')][0x1]?_0x49f32a[_0xc831('0x43')][0x1][_0xc831('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x52e816){logger[_0xc831('0x2d')](_0xc831('0x59'),JSON['stringify'](_0x52e816));return[];}}exports[_0xc831('0x5a')]=function(_0x462f61,_0x19aa4d){if(_0x462f61[_0xc831('0x5b')]){_0x462f61[_0xc831('0x5b')][_0xc831('0x43')]=widgetAttributes(_0x462f61[_0xc831('0x5b')]);}return db['DashboardItem']['create'](_0x462f61[_0xc831('0x5b')],{})[_0xc831('0x2c')](respondWithResult(_0x19aa4d,0xc9))['catch'](handleError(_0x19aa4d,null));};exports[_0xc831('0x5c')]=function(_0x5091e8,_0x6d62b6){if(_0x5091e8[_0xc831('0x5b')]['id']){delete _0x5091e8['body']['id'];}_0x5091e8[_0xc831('0x5b')][_0xc831('0x43')]=widgetAttributes(_0x5091e8[_0xc831('0x5b')]);return db['DashboardItem'][_0xc831('0x3e')]({'where':{'id':_0x5091e8['params']['id']}})[_0xc831('0x2c')](handleEntityNotFound(_0x6d62b6,null))[_0xc831('0x2c')](saveUpdates(_0x5091e8[_0xc831('0x5b')],null))[_0xc831('0x2c')](respondWithResult(_0x6d62b6,null))[_0xc831('0x3f')](handleError(_0x6d62b6,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 3f10387..34da916 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 _0xdebe=['events','../../mysqldb','DashboardItem','setMaxListeners','update','emit','exports'];(function(_0x4f9617,_0x16a10a){var _0x55b7d0=function(_0x43824a){while(--_0x43824a){_0x4f9617['push'](_0x4f9617['shift']());}};_0x55b7d0(++_0x16a10a);}(_0xdebe,0x142));var _0xedeb=function(_0xb00e88,_0x315c7e){_0xb00e88=_0xb00e88-0x0;var _0x17d2f6=_0xdebe[_0xb00e88];return _0x17d2f6;};'use strict';var EventEmitter=require(_0xedeb('0x0'));var DashboardItem=require(_0xedeb('0x1'))['db'][_0xedeb('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xedeb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xedeb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x367144){return function(_0x43f70b,_0x5781ad,_0x43b7c8){DashboardItemEvents[_0xedeb('0x5')](_0x367144+':'+_0x43f70b['id'],_0x43f70b);DashboardItemEvents['emit'](_0x367144,_0x43f70b);_0x43b7c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xedeb('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x281a=['hasOwnProperty','hook','setMaxListeners','update','emit'];(function(_0x58d523,_0x3359ce){var _0x92d96c=function(_0x8d4222){while(--_0x8d4222){_0x58d523['push'](_0x58d523['shift']());}};_0x92d96c(++_0x3359ce);}(_0x281a,0x160));var _0xa281=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x281a[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa281('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa281('0x1'),'afterDestroy':'remove'};function emitEvent(_0x457b4e){return function(_0x36627b,_0x38dcff,_0x5a336e){DashboardItemEvents[_0xa281('0x2')](_0x457b4e+':'+_0x36627b['id'],_0x36627b);DashboardItemEvents['emit'](_0x457b4e,_0x36627b);_0x5a336e(null);};}for(var e in events){if(events[_0xa281('0x3')](e)){var event=events[e];DashboardItem[_0xa281('0x4')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 483e3f0..639dbb1 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 _0xa58e=['util','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items','lodash'];(function(_0x4d467f,_0x54d2e7){var _0x521bb5=function(_0x126081){while(--_0x126081){_0x4d467f['push'](_0x4d467f['shift']());}};_0x521bb5(++_0x54d2e7);}(_0xa58e,0x1d3));var _0xea58=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa58e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xea58('0x0'));var util=require(_0xea58('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea58('0x2'));var fs=require('fs');var path=require(_0xea58('0x3'));var rimraf=require(_0xea58('0x4'));var config=require(_0xea58('0x5'));var attributes=require(_0xea58('0x6'));module['exports']=function(_0x34d83f,_0x56968f){return _0x34d83f[_0xea58('0x7')]('DashboardItem',attributes,{'tableName':_0xea58('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeef0=['define','dashboard_items','lodash','util','../../config/logger','api','request-promise','rimraf','exports'];(function(_0x59db37,_0x14464c){var _0x3a4d97=function(_0x3e1094){while(--_0x3e1094){_0x59db37['push'](_0x59db37['shift']());}};_0x3a4d97(++_0x14464c);}(_0xeef0,0x1c4));var _0x0eef=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xeef0[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x0eef('0x0'));var util=require(_0x0eef('0x1'));var logger=require(_0x0eef('0x2'))(_0x0eef('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0eef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0eef('0x5'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x0eef('0x6')]=function(_0x671256,_0x1c86e1){return _0x671256[_0x0eef('0x7')]('DashboardItem',attributes,{'tableName':_0x0eef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 2dfaebf..6dc45aa 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 _0x38c3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38c3,0x171));var _0x338c=function(_0x2f4f25,_0x592d31){_0x2f4f25=_0x2f4f25-0x0;var _0x6a112a=_0x38c3[_0x2f4f25];return _0x6a112a;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var moment=require(_0x338c('0x2'));var BPromise=require('bluebird');var rs=require(_0x338c('0x3'));var fs=require('fs');var Redis=require(_0x338c('0x4'));var db=require(_0x338c('0x5'))['db'];var utils=require(_0x338c('0x6'));var logger=require(_0x338c('0x7'))(_0x338c('0x8'));var config=require(_0x338c('0x9'));var jayson=require(_0x338c('0xa'));var client=jayson[_0x338c('0xb')][_0x338c('0xc')]({'port':0x232a});config[_0x338c('0xd')]=_[_0x338c('0xe')](config['redis'],{'host':_0x338c('0xf'),'port':0x18eb});var socket=require(_0x338c('0x10'))(new Redis(config[_0x338c('0xd')]));require(_0x338c('0x11'))[_0x338c('0x12')](socket);function respondWithRpcPromise(_0x27e19b,_0x5b23f5,_0x368237){return new BPromise(function(_0x1e375c,_0x518fa4){return client[_0x338c('0x13')](_0x27e19b,_0x368237)['then'](function(_0x5b6035){logger[_0x338c('0x14')](_0x338c('0x15'),_0x5b23f5,_0x338c('0x16'));logger[_0x338c('0x17')](_0x338c('0x18'),_0x5b23f5,_0x338c('0x16'),JSON[_0x338c('0x19')](_0x5b6035));if(_0x5b6035[_0x338c('0x1a')]){if(_0x5b6035[_0x338c('0x1a')][_0x338c('0x1b')]===0x1f4){logger['error'](_0x338c('0x15'),_0x5b23f5,_0x5b6035[_0x338c('0x1a')][_0x338c('0x1c')]);return _0x518fa4(_0x5b6035[_0x338c('0x1a')][_0x338c('0x1c')]);}logger[_0x338c('0x1a')](_0x338c('0x15'),_0x5b23f5,_0x5b6035[_0x338c('0x1a')][_0x338c('0x1c')]);return _0x1e375c(_0x5b6035[_0x338c('0x1a')]['message']);}else{logger['info'](_0x338c('0x15'),_0x5b23f5,_0x338c('0x16'));_0x1e375c(_0x5b6035[_0x338c('0x1d')]['message']);}})[_0x338c('0x1e')](function(_0x1344fa){logger[_0x338c('0x1a')](_0x338c('0x15'),_0x5b23f5,_0x1344fa);_0x518fa4(_0x1344fa);});});} \ No newline at end of file +var _0xe828=['http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xe828,0xcf));var _0x8e82=function(_0x3d1cd7,_0x233452){_0x3d1cd7=_0x3d1cd7-0x0;var _0x5521ab=_0xe828[_0x3d1cd7];return _0x5521ab;};'use strict';var _=require(_0x8e82('0x0'));var util=require(_0x8e82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e82('0x2'));var fs=require('fs');var Redis=require(_0x8e82('0x3'));var db=require(_0x8e82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e82('0x5'))('rpc');var config=require(_0x8e82('0x6'));var jayson=require(_0x8e82('0x7'));var client=jayson[_0x8e82('0x8')][_0x8e82('0x9')]({'port':0x232a});config[_0x8e82('0xa')]=_[_0x8e82('0xb')](config[_0x8e82('0xa')],{'host':_0x8e82('0xc'),'port':0x18eb});var socket=require(_0x8e82('0xd'))(new Redis(config[_0x8e82('0xa')]));require(_0x8e82('0xe'))[_0x8e82('0xf')](socket);function respondWithRpcPromise(_0x1c5c4a,_0x229c8a,_0x583a94){return new BPromise(function(_0x595c94,_0x4aa76c){return client[_0x8e82('0x10')](_0x1c5c4a,_0x583a94)[_0x8e82('0x11')](function(_0x160b22){logger['info'](_0x8e82('0x12'),_0x229c8a,_0x8e82('0x13'));logger[_0x8e82('0x14')](_0x8e82('0x15'),_0x229c8a,_0x8e82('0x13'),JSON[_0x8e82('0x16')](_0x160b22));if(_0x160b22['error']){if(_0x160b22[_0x8e82('0x17')][_0x8e82('0x18')]===0x1f4){logger[_0x8e82('0x17')](_0x8e82('0x12'),_0x229c8a,_0x160b22['error'][_0x8e82('0x19')]);return _0x4aa76c(_0x160b22[_0x8e82('0x17')][_0x8e82('0x19')]);}logger['error'](_0x8e82('0x12'),_0x229c8a,_0x160b22[_0x8e82('0x17')][_0x8e82('0x19')]);return _0x595c94(_0x160b22[_0x8e82('0x17')][_0x8e82('0x19')]);}else{logger['info'](_0x8e82('0x12'),_0x229c8a,_0x8e82('0x13'));_0x595c94(_0x160b22[_0x8e82('0x1a')][_0x8e82('0x19')]);}})['catch'](function(_0x2e0c30){logger['error'](_0x8e82('0x12'),_0x229c8a,_0x2e0c30);_0x4aa76c(_0x2e0c30);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a2f850e..c43bfc3 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 _0xd6a7=['dashboardItem:','save','remove','removeListener','register'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd6a7,0x150));var _0x7d6a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd6a7[_0x3ab51d];return _0x29a04e;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7d6a('0x0'),_0x7d6a('0x1'),'update'];function createListener(_0x245687,_0x4f6cfe){return function(_0x945731){_0x4f6cfe['emit'](_0x245687,_0x945731);};}function removeListener(_0x3444a4,_0x203a98){return function(){DashboardItemEvents[_0x7d6a('0x2')](_0x3444a4,_0x203a98);};}exports[_0x7d6a('0x3')]=function(_0x4f812b){for(var _0x303220=0x0,_0x1b6b8f=events['length'];_0x303220<_0x1b6b8f;_0x303220++){var _0x114885=events[_0x303220];var _0x141f8c=createListener(_0x7d6a('0x4')+_0x114885,_0x4f812b);DashboardItemEvents['on'](_0x114885,_0x141f8c);}}; \ No newline at end of file +var _0xa870=['save','remove','update','emit','removeListener','length','dashboardItem:','./dashboardItem.events'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa870,0xdf));var _0x0a87=function(_0x3d35ba,_0x12f690){_0x3d35ba=_0x3d35ba-0x0;var _0x2b1edf=_0xa870[_0x3d35ba];return _0x2b1edf;};'use strict';var DashboardItemEvents=require(_0x0a87('0x0'));var events=[_0x0a87('0x1'),_0x0a87('0x2'),_0x0a87('0x3')];function createListener(_0x460129,_0x3503ca){return function(_0x360840){_0x3503ca[_0x0a87('0x4')](_0x460129,_0x360840);};}function removeListener(_0x359e3c,_0x3a3574){return function(){DashboardItemEvents[_0x0a87('0x5')](_0x359e3c,_0x3a3574);};}exports['register']=function(_0x54ad0c){for(var _0x49741b=0x0,_0x12c9e6=events[_0x0a87('0x6')];_0x49741b<_0x12c9e6;_0x49741b++){var _0x4a0ba4=events[_0x49741b];var _0xef1bad=createListener(_0x0a87('0x7')+_0x4a0ba4,_0x54ad0c);DashboardItemEvents['on'](_0x4a0ba4,_0xef1bad);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 6640bb5..0f0fb57 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 _0xc3a7=['create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post'];(function(_0x27d464,_0x5d3412){var _0x2d9781=function(_0x57196c){while(--_0x57196c){_0x27d464['push'](_0x27d464['shift']());}};_0x2d9781(++_0x5d3412);}(_0xc3a7,0x9f));var _0x7c3a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc3a7[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x7c3a('0x0'));var util=require('util');var path=require(_0x7c3a('0x1'));var timeout=require(_0x7c3a('0x2'));var express=require('express');var router=express[_0x7c3a('0x3')]();var fs_extra=require(_0x7c3a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7c3a('0x5'));var config=require(_0x7c3a('0x6'));var controller=require(_0x7c3a('0x7'));router[_0x7c3a('0x8')]('/:id',auth[_0x7c3a('0x9')](),controller[_0x7c3a('0xa')]);router[_0x7c3a('0xb')]('/',auth['isAuthenticated'](),controller[_0x7c3a('0xc')]);router[_0x7c3a('0xd')](_0x7c3a('0xe'),auth[_0x7c3a('0x9')](),controller[_0x7c3a('0xf')]);router[_0x7c3a('0x10')](_0x7c3a('0xe'),auth[_0x7c3a('0x9')](),controller[_0x7c3a('0x11')]);module[_0x7c3a('0x12')]=router; \ No newline at end of file +var _0x1bd1=['put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create'];(function(_0x52d2b8,_0x5723e1){var _0xd63311=function(_0xf1b9bc){while(--_0xf1b9bc){_0x52d2b8['push'](_0x52d2b8['shift']());}};_0xd63311(++_0x5723e1);}(_0x1bd1,0x1be));var _0x11bd=function(_0x1f5d35,_0x13db91){_0x1f5d35=_0x1f5d35-0x0;var _0x27355a=_0x1bd1[_0x1f5d35];return _0x27355a;};'use strict';var multer=require(_0x11bd('0x0'));var util=require('util');var path=require(_0x11bd('0x1'));var timeout=require('connect-timeout');var express=require(_0x11bd('0x2'));var router=express[_0x11bd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x11bd('0x4'));var interaction=require(_0x11bd('0x5'));var config=require(_0x11bd('0x6'));var controller=require('./dashboardItem.controller');router[_0x11bd('0x7')](_0x11bd('0x8'),auth[_0x11bd('0x9')](),controller[_0x11bd('0xa')]);router[_0x11bd('0xb')]('/',auth[_0x11bd('0x9')](),controller[_0x11bd('0xc')]);router[_0x11bd('0xd')](_0x11bd('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x11bd('0xe')](_0x11bd('0x8'),auth[_0x11bd('0x9')](),controller[_0x11bd('0xf')]);module[_0x11bd('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9621a2e..8449272 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 _0x6c44=['STRING','ENUM','first','second','third','sequelize'];(function(_0x1c263e,_0x4d4689){var _0x2b501c=function(_0x361a45){while(--_0x361a45){_0x1c263e['push'](_0x1c263e['shift']());}};_0x2b501c(++_0x4d4689);}(_0x6c44,0x15b));var _0x46c4=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x6c44[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0x46c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x46c4('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x46c4('0x2')](_0x46c4('0x3'),_0x46c4('0x4'),_0x46c4('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x46c4('0x1')]}}; \ No newline at end of file +var _0xbcef=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0x106cfa,_0x4c0898){var _0x2b6a81=function(_0xa3df00){while(--_0xa3df00){_0x106cfa['push'](_0x106cfa['shift']());}};_0x2b6a81(++_0x4c0898);}(_0xbcef,0x1f2));var _0xfbce=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbcef[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xfbce('0x0'));module[_0xfbce('0x1')]={'name':{'type':Sequelize[_0xfbce('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xfbce('0x3')](_0xfbce('0x4'),_0xfbce('0x5'),_0xfbce('0x6')),'allowNull':![],'defaultValue':_0xfbce('0x4')},'description':{'type':Sequelize[_0xfbce('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 170300b..4ff879d 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 _0x3004=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','Disposition','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','reject','then','destroy','Dispositions','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key'];(function(_0x213768,_0xd622ef){var _0x108375=function(_0xcba2db){while(--_0xcba2db){_0x213768['push'](_0x213768['shift']());}};_0x108375(++_0xd622ef);}(_0x3004,0x123));var _0x4300=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x3004[_0x1ebe90];return _0x447c82;};'use strict';var emlformat=require(_0x4300('0x0'));var rimraf=require(_0x4300('0x1'));var zipdir=require(_0x4300('0x2'));var jsonpatch=require(_0x4300('0x3'));var rp=require(_0x4300('0x4'));var moment=require('moment');var BPromise=require(_0x4300('0x5'));var Mustache=require(_0x4300('0x6'));var util=require('util');var path=require(_0x4300('0x7'));var sox=require('sox');var csv=require(_0x4300('0x8'));var ejs=require(_0x4300('0x9'));var fs=require('fs');var fs_extra=require(_0x4300('0xa'));var _=require('lodash');var squel=require(_0x4300('0xb'));var crypto=require('crypto');var jsforce=require(_0x4300('0xc'));var deskjs=require(_0x4300('0xd'));var toCsv=require(_0x4300('0x8'));var querystring=require(_0x4300('0xe'));var Papa=require(_0x4300('0xf'));var Redis=require(_0x4300('0x10'));var authService=require(_0x4300('0x11'));var qs=require(_0x4300('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4300('0x13'))('api');var utils=require(_0x4300('0x14'));var config=require(_0x4300('0x15'));var licenseUtil=require(_0x4300('0x16'));var db=require(_0x4300('0x17'))['db'];function respondWithStatusCode(_0x41c5af,_0x4ac1f){_0x4ac1f=_0x4ac1f||0xcc;return function(_0x3c6216){if(_0x3c6216){return _0x41c5af[_0x4300('0x18')](_0x4ac1f);}return _0x41c5af[_0x4300('0x19')](_0x4ac1f)[_0x4300('0x1a')]();};}function respondWithResult(_0x4c5cb2,_0x19bf05){_0x19bf05=_0x19bf05||0xc8;return function(_0x52758e){if(_0x52758e){return _0x4c5cb2['status'](_0x19bf05)[_0x4300('0x1b')](_0x52758e);}};}function respondWithFilteredResult(_0x173fa9,_0x2ff9f6){return function(_0x566458){if(_0x566458){var _0x39b0cc=typeof _0x2ff9f6['offset']===_0x4300('0x1c')&&typeof _0x2ff9f6['limit']===_0x4300('0x1c');var _0x28e53e=_0x566458[_0x4300('0x1d')];var _0x5a8218=_0x39b0cc?0x0:_0x2ff9f6['offset'];var _0x2acec9=_0x39b0cc?_0x566458[_0x4300('0x1d')]:_0x2ff9f6['offset']+_0x2ff9f6[_0x4300('0x1e')];var _0x319c55;if(_0x2acec9>=_0x28e53e){_0x2acec9=_0x28e53e;_0x319c55=0xc8;}else{_0x319c55=0xce;}_0x173fa9[_0x4300('0x19')](_0x319c55);return _0x173fa9[_0x4300('0x1f')]('Content-Range',_0x5a8218+'-'+_0x2acec9+'/'+_0x28e53e)[_0x4300('0x1b')](_0x566458);}return null;};}function patchUpdates(_0x1ab77b){return function(_0x2768dd){try{jsonpatch['apply'](_0x2768dd,_0x1ab77b,!![]);}catch(_0x3bf2cf){return BPromise[_0x4300('0x20')](_0x3bf2cf);}return _0x2768dd['save']();};}function saveUpdates(_0x49c607,_0x267cd4){return function(_0x56a80b){if(_0x56a80b){return _0x56a80b['update'](_0x49c607)[_0x4300('0x21')](function(_0x1bdd6a){return _0x1bdd6a;});}return null;};}function removeEntity(_0x346d83,_0x491d71){return function(_0x62e215){if(_0x62e215){return _0x62e215[_0x4300('0x22')]()[_0x4300('0x21')](function(){var _0x4f0712=_0x62e215['get']({'plain':!![]});var _0x4a61b0=_0x4300('0x23');return db[_0x4300('0x24')][_0x4300('0x22')]({'where':{'type':_0x4a61b0,'resourceId':_0x4f0712['id']}})['then'](function(){return _0x62e215;});})['then'](function(){_0x346d83['status'](0xcc)[_0x4300('0x1a')]();});}};}function handleEntityNotFound(_0x2e6ae9,_0x5480d4){return function(_0x1ce6cc){if(!_0x1ce6cc){_0x2e6ae9[_0x4300('0x18')](0x194);}return _0x1ce6cc;};}function handleError(_0x2275c7,_0x1b1007){_0x1b1007=_0x1b1007||0x1f4;return function(_0x14d4e9){logger[_0x4300('0x25')](_0x14d4e9[_0x4300('0x26')]);if(_0x14d4e9[_0x4300('0x27')]){delete _0x14d4e9['name'];}_0x2275c7['status'](_0x1b1007)['send'](_0x14d4e9);};}exports['index']=function(_0x57ead3,_0x12e602){var _0x4a3b70={},_0x1701a8={},_0x463de6={'count':0x0,'rows':[]};var _0x4c08c6=_[_0x4300('0x28')](db['Disposition'][_0x4300('0x29')],function(_0x1d7ca7){return{'name':_0x1d7ca7[_0x4300('0x2a')],'type':_0x1d7ca7[_0x4300('0x2b')][_0x4300('0x2c')]};});_0x1701a8[_0x4300('0x2d')]=_[_0x4300('0x28')](_0x4c08c6,_0x4300('0x27'));_0x1701a8['query']=_[_0x4300('0x2e')](_0x57ead3[_0x4300('0x2f')]);_0x1701a8[_0x4300('0x30')]=_[_0x4300('0x31')](_0x1701a8[_0x4300('0x2d')],_0x1701a8[_0x4300('0x2f')]);_0x4a3b70[_0x4300('0x32')]=_[_0x4300('0x31')](_0x1701a8[_0x4300('0x2d')],qs[_0x4300('0x33')](_0x57ead3['query'][_0x4300('0x33')]));_0x4a3b70['attributes']=_0x4a3b70[_0x4300('0x32')][_0x4300('0x34')]?_0x4a3b70[_0x4300('0x32')]:_0x1701a8[_0x4300('0x2d')];if(!_0x57ead3[_0x4300('0x2f')][_0x4300('0x35')](_0x4300('0x36'))){_0x4a3b70[_0x4300('0x1e')]=qs[_0x4300('0x1e')](_0x57ead3[_0x4300('0x2f')]['limit']);_0x4a3b70['offset']=qs[_0x4300('0x37')](_0x57ead3[_0x4300('0x2f')]['offset']);}_0x4a3b70[_0x4300('0x38')]=qs['sort'](_0x57ead3[_0x4300('0x2f')][_0x4300('0x39')]);_0x4a3b70[_0x4300('0x3a')]=qs[_0x4300('0x30')](_[_0x4300('0x3b')](_0x57ead3[_0x4300('0x2f')],_0x1701a8['filters']),_0x4c08c6);if(_0x57ead3[_0x4300('0x2f')]['filter']){_0x4a3b70['where']=_[_0x4300('0x3c')](_0x4a3b70[_0x4300('0x3a')],{'$or':_['map'](_0x4c08c6,function(_0x3de08f){if(_0x3de08f[_0x4300('0x2b')]!==_0x4300('0x3d')){var _0x3c5d7c={};_0x3c5d7c[_0x3de08f[_0x4300('0x27')]]={'$like':'%'+_0x57ead3['query'][_0x4300('0x3e')]+'%'};return _0x3c5d7c;}})});}_0x4a3b70=_[_0x4300('0x3c')]({},_0x4a3b70,_0x57ead3[_0x4300('0x3f')]);var _0x4cbe4f={'where':_0x4a3b70[_0x4300('0x3a')]};return db[_0x4300('0x40')][_0x4300('0x1d')](_0x4cbe4f)['then'](function(_0xfac35a){_0x463de6[_0x4300('0x1d')]=_0xfac35a;if(_0x57ead3[_0x4300('0x2f')]['includeAll']){_0x4a3b70[_0x4300('0x41')]=[{'all':!![]}];}return db['Disposition'][_0x4300('0x42')](_0x4a3b70);})[_0x4300('0x21')](function(_0xe9beab){_0x463de6[_0x4300('0x43')]=_0xe9beab;return _0x463de6;})['then'](respondWithFilteredResult(_0x12e602,_0x4a3b70))[_0x4300('0x44')](handleError(_0x12e602,null));};exports[_0x4300('0x45')]=function(_0x1b0f53,_0xdb371a){var _0xace9a2={'raw':!![],'where':{'id':_0x1b0f53[_0x4300('0x46')]['id']}},_0x5a7067={};_0x5a7067[_0x4300('0x2d')]=_[_0x4300('0x2e')](db[_0x4300('0x40')][_0x4300('0x29')]);_0x5a7067['query']=_['keys'](_0x1b0f53[_0x4300('0x2f')]);_0x5a7067[_0x4300('0x30')]=_[_0x4300('0x31')](_0x5a7067[_0x4300('0x2d')],_0x5a7067[_0x4300('0x2f')]);_0xace9a2[_0x4300('0x32')]=_[_0x4300('0x31')](_0x5a7067[_0x4300('0x2d')],qs['fields'](_0x1b0f53[_0x4300('0x2f')][_0x4300('0x33')]));_0xace9a2[_0x4300('0x32')]=_0xace9a2[_0x4300('0x32')][_0x4300('0x34')]?_0xace9a2[_0x4300('0x32')]:_0x5a7067[_0x4300('0x2d')];if(_0x1b0f53[_0x4300('0x2f')][_0x4300('0x47')]){_0xace9a2[_0x4300('0x41')]=[{'all':!![]}];}_0xace9a2=_[_0x4300('0x3c')]({},_0xace9a2,_0x1b0f53['options']);return db[_0x4300('0x40')][_0x4300('0x48')](_0xace9a2)[_0x4300('0x21')](handleEntityNotFound(_0xdb371a,null))[_0x4300('0x21')](respondWithResult(_0xdb371a,null))['catch'](handleError(_0xdb371a,null));};exports['create']=function(_0x57abd7,_0x29992a){return db['Disposition'][_0x4300('0x49')](_0x57abd7[_0x4300('0x4a')],{})[_0x4300('0x21')](function(_0x73c519){var _0x1c07d7=_0x57abd7[_0x4300('0x4b')][_0x4300('0x4c')]({'plain':!![]});if(!_0x1c07d7)throw new Error(_0x4300('0x4d'));if(_0x1c07d7[_0x4300('0x4e')]===_0x4300('0x4b')){var _0x4e0ae4=_0x73c519['get']({'plain':!![]});var _0x41d02a=_0x4300('0x23');return db[_0x4300('0x4f')][_0x4300('0x48')]({'where':{'name':_0x41d02a,'userProfileId':_0x1c07d7[_0x4300('0x50')]},'raw':!![]})['then'](function(_0x4eec11){if(_0x4eec11&&_0x4eec11[_0x4300('0x51')]===0x0){return db[_0x4300('0x24')][_0x4300('0x49')]({'name':_0x4e0ae4[_0x4300('0x27')],'resourceId':_0x4e0ae4['id'],'type':_0x4eec11['name'],'sectionId':_0x4eec11['id']},{})['then'](function(){return _0x73c519;});}else{return _0x73c519;}})[_0x4300('0x44')](function(_0x57bdba){logger[_0x4300('0x25')](_0x4300('0x52'),_0x57bdba);throw _0x57bdba;});}return _0x73c519;})[_0x4300('0x21')](respondWithResult(_0x29992a,0xc9))['catch'](handleError(_0x29992a,null));};exports[_0x4300('0x53')]=function(_0x2c1d57,_0x15a066){if(_0x2c1d57['body']['id']){delete _0x2c1d57[_0x4300('0x4a')]['id'];}return db[_0x4300('0x40')][_0x4300('0x48')]({'where':{'id':_0x2c1d57[_0x4300('0x46')]['id']}})['then'](handleEntityNotFound(_0x15a066,null))[_0x4300('0x21')](saveUpdates(_0x2c1d57[_0x4300('0x4a')],null))[_0x4300('0x21')](respondWithResult(_0x15a066,null))[_0x4300('0x44')](handleError(_0x15a066,null));};exports[_0x4300('0x22')]=function(_0x3daa1f,_0x3dcb4a){return db[_0x4300('0x40')][_0x4300('0x48')]({'where':{'id':_0x3daa1f['params']['id']}})['then'](handleEntityNotFound(_0x3dcb4a,null))['then'](removeEntity(_0x3dcb4a,null))[_0x4300('0x44')](handleError(_0x3dcb4a,null));}; \ No newline at end of file +var _0xa992=['send','index','map','Disposition','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','Dispositions','UserProfileResource','then','error','stack','name'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa992,0x18c));var _0x2a99=function(_0x38ce04,_0x3c5383){_0x38ce04=_0x38ce04-0x0;var _0x27eb0d=_0xa992[_0x38ce04];return _0x27eb0d;};'use strict';var emlformat=require(_0x2a99('0x0'));var rimraf=require(_0x2a99('0x1'));var zipdir=require(_0x2a99('0x2'));var jsonpatch=require(_0x2a99('0x3'));var rp=require('request-promise');var moment=require(_0x2a99('0x4'));var BPromise=require(_0x2a99('0x5'));var Mustache=require(_0x2a99('0x6'));var util=require(_0x2a99('0x7'));var path=require(_0x2a99('0x8'));var sox=require(_0x2a99('0x9'));var csv=require(_0x2a99('0xa'));var ejs=require(_0x2a99('0xb'));var fs=require('fs');var fs_extra=require(_0x2a99('0xc'));var _=require(_0x2a99('0xd'));var squel=require('squel');var crypto=require(_0x2a99('0xe'));var jsforce=require(_0x2a99('0xf'));var deskjs=require(_0x2a99('0x10'));var toCsv=require(_0x2a99('0xa'));var querystring=require(_0x2a99('0x11'));var Papa=require(_0x2a99('0x12'));var Redis=require(_0x2a99('0x13'));var authService=require(_0x2a99('0x14'));var qs=require(_0x2a99('0x15'));var as=require(_0x2a99('0x16'));var hardwareService=require(_0x2a99('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2a99('0x18'));var config=require(_0x2a99('0x19'));var licenseUtil=require(_0x2a99('0x1a'));var db=require(_0x2a99('0x1b'))['db'];function respondWithStatusCode(_0x22e9e2,_0x13e434){_0x13e434=_0x13e434||0xcc;return function(_0x530f6a){if(_0x530f6a){return _0x22e9e2[_0x2a99('0x1c')](_0x13e434);}return _0x22e9e2[_0x2a99('0x1d')](_0x13e434)[_0x2a99('0x1e')]();};}function respondWithResult(_0x2e04f2,_0x2b07a3){_0x2b07a3=_0x2b07a3||0xc8;return function(_0x5f2cfa){if(_0x5f2cfa){return _0x2e04f2[_0x2a99('0x1d')](_0x2b07a3)['json'](_0x5f2cfa);}};}function respondWithFilteredResult(_0x5cbe7b,_0x14528e){return function(_0x271db6){if(_0x271db6){var _0x343ba4=typeof _0x14528e['offset']==='undefined'&&typeof _0x14528e['limit']===_0x2a99('0x1f');var _0x4346c4=_0x271db6['count'];var _0x1819fd=_0x343ba4?0x0:_0x14528e[_0x2a99('0x20')];var _0xbca200=_0x343ba4?_0x271db6[_0x2a99('0x21')]:_0x14528e['offset']+_0x14528e[_0x2a99('0x22')];var _0x410ea7;if(_0xbca200>=_0x4346c4){_0xbca200=_0x4346c4;_0x410ea7=0xc8;}else{_0x410ea7=0xce;}_0x5cbe7b[_0x2a99('0x1d')](_0x410ea7);return _0x5cbe7b[_0x2a99('0x23')](_0x2a99('0x24'),_0x1819fd+'-'+_0xbca200+'/'+_0x4346c4)['json'](_0x271db6);}return null;};}function patchUpdates(_0x24fcbf){return function(_0x281efc){try{jsonpatch[_0x2a99('0x25')](_0x281efc,_0x24fcbf,!![]);}catch(_0x35fddf){return BPromise[_0x2a99('0x26')](_0x35fddf);}return _0x281efc[_0x2a99('0x27')]();};}function saveUpdates(_0x3dc468,_0x36aa21){return function(_0x3541fc){if(_0x3541fc){return _0x3541fc[_0x2a99('0x28')](_0x3dc468)['then'](function(_0x1109cd){return _0x1109cd;});}return null;};}function removeEntity(_0x4e715c,_0x5a0964){return function(_0x48c611){if(_0x48c611){return _0x48c611[_0x2a99('0x29')]()['then'](function(){var _0x4bb142=_0x48c611[_0x2a99('0x2a')]({'plain':!![]});var _0x5ec334=_0x2a99('0x2b');return db[_0x2a99('0x2c')][_0x2a99('0x29')]({'where':{'type':_0x5ec334,'resourceId':_0x4bb142['id']}})[_0x2a99('0x2d')](function(){return _0x48c611;});})[_0x2a99('0x2d')](function(){_0x4e715c[_0x2a99('0x1d')](0xcc)[_0x2a99('0x1e')]();});}};}function handleEntityNotFound(_0x3485c8,_0x2b5d97){return function(_0x2f0bf0){if(!_0x2f0bf0){_0x3485c8['sendStatus'](0x194);}return _0x2f0bf0;};}function handleError(_0x47736f,_0x4271b4){_0x4271b4=_0x4271b4||0x1f4;return function(_0x5ad092){logger[_0x2a99('0x2e')](_0x5ad092[_0x2a99('0x2f')]);if(_0x5ad092[_0x2a99('0x30')]){delete _0x5ad092['name'];}_0x47736f[_0x2a99('0x1d')](_0x4271b4)[_0x2a99('0x31')](_0x5ad092);};}exports[_0x2a99('0x32')]=function(_0x30f087,_0x5ea029){var _0x24dc9f={},_0x1dbffa={},_0x4864b6={'count':0x0,'rows':[]};var _0x153a3e=_[_0x2a99('0x33')](db[_0x2a99('0x34')]['rawAttributes'],function(_0x1a45d4){return{'name':_0x1a45d4[_0x2a99('0x35')],'type':_0x1a45d4[_0x2a99('0x36')][_0x2a99('0x37')]};});_0x1dbffa[_0x2a99('0x38')]=_['map'](_0x153a3e,_0x2a99('0x30'));_0x1dbffa['query']=_[_0x2a99('0x39')](_0x30f087[_0x2a99('0x3a')]);_0x1dbffa[_0x2a99('0x3b')]=_[_0x2a99('0x3c')](_0x1dbffa[_0x2a99('0x38')],_0x1dbffa[_0x2a99('0x3a')]);_0x24dc9f[_0x2a99('0x3d')]=_[_0x2a99('0x3c')](_0x1dbffa[_0x2a99('0x38')],qs[_0x2a99('0x3e')](_0x30f087[_0x2a99('0x3a')]['fields']));_0x24dc9f[_0x2a99('0x3d')]=_0x24dc9f[_0x2a99('0x3d')][_0x2a99('0x3f')]?_0x24dc9f[_0x2a99('0x3d')]:_0x1dbffa[_0x2a99('0x38')];if(!_0x30f087[_0x2a99('0x3a')][_0x2a99('0x40')](_0x2a99('0x41'))){_0x24dc9f[_0x2a99('0x22')]=qs[_0x2a99('0x22')](_0x30f087['query']['limit']);_0x24dc9f['offset']=qs[_0x2a99('0x20')](_0x30f087[_0x2a99('0x3a')][_0x2a99('0x20')]);}_0x24dc9f[_0x2a99('0x42')]=qs[_0x2a99('0x43')](_0x30f087[_0x2a99('0x3a')][_0x2a99('0x43')]);_0x24dc9f['where']=qs[_0x2a99('0x3b')](_['pick'](_0x30f087['query'],_0x1dbffa[_0x2a99('0x3b')]),_0x153a3e);if(_0x30f087[_0x2a99('0x3a')][_0x2a99('0x44')]){_0x24dc9f[_0x2a99('0x45')]=_[_0x2a99('0x46')](_0x24dc9f[_0x2a99('0x45')],{'$or':_[_0x2a99('0x33')](_0x153a3e,function(_0x26b186){if(_0x26b186[_0x2a99('0x36')]!==_0x2a99('0x47')){var _0x93025a={};_0x93025a[_0x26b186[_0x2a99('0x30')]]={'$like':'%'+_0x30f087[_0x2a99('0x3a')]['filter']+'%'};return _0x93025a;}})});}_0x24dc9f=_[_0x2a99('0x46')]({},_0x24dc9f,_0x30f087[_0x2a99('0x48')]);var _0x529822={'where':_0x24dc9f[_0x2a99('0x45')]};return db[_0x2a99('0x34')][_0x2a99('0x21')](_0x529822)[_0x2a99('0x2d')](function(_0x3e9348){_0x4864b6['count']=_0x3e9348;if(_0x30f087[_0x2a99('0x3a')][_0x2a99('0x49')]){_0x24dc9f[_0x2a99('0x4a')]=[{'all':!![]}];}return db[_0x2a99('0x34')]['findAll'](_0x24dc9f);})[_0x2a99('0x2d')](function(_0x26db27){_0x4864b6[_0x2a99('0x4b')]=_0x26db27;return _0x4864b6;})[_0x2a99('0x2d')](respondWithFilteredResult(_0x5ea029,_0x24dc9f))['catch'](handleError(_0x5ea029,null));};exports['show']=function(_0x5386db,_0x3f1682){var _0x50c82d={'raw':!![],'where':{'id':_0x5386db[_0x2a99('0x4c')]['id']}},_0x324f98={};_0x324f98['model']=_[_0x2a99('0x39')](db['Disposition'][_0x2a99('0x4d')]);_0x324f98[_0x2a99('0x3a')]=_[_0x2a99('0x39')](_0x5386db['query']);_0x324f98[_0x2a99('0x3b')]=_['intersection'](_0x324f98['model'],_0x324f98[_0x2a99('0x3a')]);_0x50c82d[_0x2a99('0x3d')]=_[_0x2a99('0x3c')](_0x324f98[_0x2a99('0x38')],qs[_0x2a99('0x3e')](_0x5386db[_0x2a99('0x3a')]['fields']));_0x50c82d[_0x2a99('0x3d')]=_0x50c82d[_0x2a99('0x3d')][_0x2a99('0x3f')]?_0x50c82d[_0x2a99('0x3d')]:_0x324f98['model'];if(_0x5386db['query'][_0x2a99('0x49')]){_0x50c82d[_0x2a99('0x4a')]=[{'all':!![]}];}_0x50c82d=_[_0x2a99('0x46')]({},_0x50c82d,_0x5386db[_0x2a99('0x48')]);return db[_0x2a99('0x34')]['find'](_0x50c82d)[_0x2a99('0x2d')](handleEntityNotFound(_0x3f1682,null))[_0x2a99('0x2d')](respondWithResult(_0x3f1682,null))[_0x2a99('0x4e')](handleError(_0x3f1682,null));};exports[_0x2a99('0x4f')]=function(_0x310042,_0x164bca){return db[_0x2a99('0x34')][_0x2a99('0x4f')](_0x310042['body'],{})['then'](function(_0x100338){var _0x135d89=_0x310042[_0x2a99('0x50')][_0x2a99('0x2a')]({'plain':!![]});if(!_0x135d89)throw new Error(_0x2a99('0x51'));if(_0x135d89[_0x2a99('0x52')]===_0x2a99('0x50')){var _0x5ae31d=_0x100338[_0x2a99('0x2a')]({'plain':!![]});var _0x496f0a=_0x2a99('0x2b');return db[_0x2a99('0x53')]['find']({'where':{'name':_0x496f0a,'userProfileId':_0x135d89[_0x2a99('0x54')]},'raw':!![]})['then'](function(_0x4bb119){if(_0x4bb119&&_0x4bb119[_0x2a99('0x55')]===0x0){return db['UserProfileResource'][_0x2a99('0x4f')]({'name':_0x5ae31d['name'],'resourceId':_0x5ae31d['id'],'type':_0x4bb119[_0x2a99('0x30')],'sectionId':_0x4bb119['id']},{})['then'](function(){return _0x100338;});}else{return _0x100338;}})[_0x2a99('0x4e')](function(_0x3b150a){logger[_0x2a99('0x2e')](_0x2a99('0x56'),_0x3b150a);throw _0x3b150a;});}return _0x100338;})[_0x2a99('0x2d')](respondWithResult(_0x164bca,0xc9))[_0x2a99('0x4e')](handleError(_0x164bca,null));};exports['update']=function(_0xa5c4c5,_0x2a53f0){if(_0xa5c4c5['body']['id']){delete _0xa5c4c5['body']['id'];}return db['Disposition'][_0x2a99('0x57')]({'where':{'id':_0xa5c4c5['params']['id']}})[_0x2a99('0x2d')](handleEntityNotFound(_0x2a53f0,null))['then'](saveUpdates(_0xa5c4c5[_0x2a99('0x58')],null))[_0x2a99('0x2d')](respondWithResult(_0x2a53f0,null))[_0x2a99('0x4e')](handleError(_0x2a53f0,null));};exports[_0x2a99('0x29')]=function(_0x2f2745,_0x111e29){return db['Disposition']['find']({'where':{'id':_0x2f2745[_0x2a99('0x4c')]['id']}})[_0x2a99('0x2d')](handleEntityNotFound(_0x111e29,null))[_0x2a99('0x2d')](removeEntity(_0x111e29,null))[_0x2a99('0x4e')](handleError(_0x111e29,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 87a56b1..1c25649 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 _0x8965=['name_mail','MailAccountId','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId'];(function(_0x6440b9,_0xb718f1){var _0x40e827=function(_0x13b5f9){while(--_0x13b5f9){_0x6440b9['push'](_0x6440b9['shift']());}};_0x40e827(++_0xb718f1);}(_0x8965,0x1e8));var _0x5896=function(_0x3404c2,_0x3941e2){_0x3404c2=_0x3404c2-0x0;var _0x1a581d=_0x8965[_0x3404c2];return _0x1a581d;};'use strict';var _=require('lodash');var util=require(_0x5896('0x0'));var logger=require('../../config/logger')(_0x5896('0x1'));var moment=require(_0x5896('0x2'));var BPromise=require(_0x5896('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5896('0x4'));var rimraf=require(_0x5896('0x5'));var config=require(_0x5896('0x6'));var attributes=require(_0x5896('0x7'));module[_0x5896('0x8')]=function(_0x2ebefa,_0x4216d5){return _0x2ebefa[_0x5896('0x9')]('Disposition',attributes,{'tableName':_0x5896('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5896('0xb'),'fields':[_0x5896('0xc'),_0x5896('0xd')]},{'unique':!![],'name':_0x5896('0xe'),'fields':[_0x5896('0xc'),_0x5896('0xf')]},{'unique':!![],'name':_0x5896('0x10'),'fields':[_0x5896('0xc'),_0x5896('0x11')]},{'unique':!![],'name':_0x5896('0x12'),'fields':[_0x5896('0xc'),_0x5896('0x13')]},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':_0x5896('0x14'),'fields':['name',_0x5896('0x15')]},{'unique':!![],'name':_0x5896('0x16'),'fields':[_0x5896('0xc'),_0x5896('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e8e=['name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_chat'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x4e8e,0xca));var _0xe4e8=function(_0x1e1a63,_0x2f2793){_0x1e1a63=_0x1e1a63-0x0;var _0xb4deb0=_0x4e8e[_0x1e1a63];return _0xb4deb0;};'use strict';var _=require(_0xe4e8('0x0'));var util=require(_0xe4e8('0x1'));var logger=require(_0xe4e8('0x2'))(_0xe4e8('0x3'));var moment=require(_0xe4e8('0x4'));var BPromise=require('bluebird');var rp=require(_0xe4e8('0x5'));var fs=require('fs');var path=require(_0xe4e8('0x6'));var rimraf=require(_0xe4e8('0x7'));var config=require(_0xe4e8('0x8'));var attributes=require(_0xe4e8('0x9'));module[_0xe4e8('0xa')]=function(_0x594b9a,_0x5db0bb){return _0x594b9a['define'](_0xe4e8('0xb'),attributes,{'tableName':_0xe4e8('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name','ListId']},{'unique':!![],'name':_0xe4e8('0xd'),'fields':[_0xe4e8('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xe4e8('0xf'),'fields':['name',_0xe4e8('0x10')]},{'unique':!![],'name':_0xe4e8('0x11'),'fields':[_0xe4e8('0xe'),_0xe4e8('0x12')]},{'unique':!![],'name':_0xe4e8('0x13'),'fields':['name',_0xe4e8('0x14')]},{'unique':!![],'name':_0xe4e8('0x15'),'fields':['name',_0xe4e8('0x16')]},{'unique':!![],'name':_0xe4e8('0x17'),'fields':['name','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 132bb3d..7f04869 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(_0x1d1321,_0x1ff4da){var _0x55a35b=function(_0x5ad913){while(--_0x5ad913){_0x1d1321['push'](_0x1d1321['shift']());}};_0x55a35b(++_0x1ff4da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x4df7ff,_0x4f34ed){var _0x387ad6=function(_0x43cfe0){while(--_0x43cfe0){_0x4df7ff['push'](_0x4df7ff['shift']());}};_0x387ad6(++_0x4f34ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 17f826d..600faeb 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 _0xaed7=['util','express','Router','../../components/auth/service','./disposition.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x21ce2c,_0x4453e7){var _0x468691=function(_0x265e61){while(--_0x265e61){_0x21ce2c['push'](_0x21ce2c['shift']());}};_0x468691(++_0x4453e7);}(_0xaed7,0x88));var _0x7aed=function(_0x243eab,_0x4b9c97){_0x243eab=_0x243eab-0x0;var _0x5044d4=_0xaed7[_0x243eab];return _0x5044d4;};'use strict';var multer=require('multer');var util=require(_0x7aed('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7aed('0x1'));var router=express[_0x7aed('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7aed('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7aed('0x4'));router['get']('/',auth[_0x7aed('0x5')](),controller[_0x7aed('0x6')]);router[_0x7aed('0x7')]('/:id',auth[_0x7aed('0x5')](),controller[_0x7aed('0x8')]);router[_0x7aed('0x9')]('/',auth[_0x7aed('0x5')](),controller[_0x7aed('0xa')]);router[_0x7aed('0xb')]('/:id',auth[_0x7aed('0x5')](),controller[_0x7aed('0xc')]);router[_0x7aed('0xd')](_0x7aed('0xe'),auth[_0x7aed('0x5')](),controller[_0x7aed('0xf')]);module[_0x7aed('0x10')]=router; \ No newline at end of file +var _0x5b41=['create','put','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0x5d5a41,_0x3c4cd1){var _0x4be05e=function(_0x54ed2b){while(--_0x54ed2b){_0x5d5a41['push'](_0x5d5a41['shift']());}};_0x4be05e(++_0x3c4cd1);}(_0x5b41,0xaa));var _0x15b4=function(_0x239264,_0x340497){_0x239264=_0x239264-0x0;var _0x482244=_0x5b41[_0x239264];return _0x482244;};'use strict';var multer=require(_0x15b4('0x0'));var util=require('util');var path=require(_0x15b4('0x1'));var timeout=require(_0x15b4('0x2'));var express=require('express');var router=express[_0x15b4('0x3')]();var fs_extra=require(_0x15b4('0x4'));var auth=require(_0x15b4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x15b4('0x6'));var controller=require('./disposition.controller');router[_0x15b4('0x7')]('/',auth[_0x15b4('0x8')](),controller['index']);router[_0x15b4('0x7')](_0x15b4('0x9'),auth[_0x15b4('0x8')](),controller[_0x15b4('0xa')]);router[_0x15b4('0xb')]('/',auth[_0x15b4('0x8')](),controller[_0x15b4('0xc')]);router[_0x15b4('0xd')](_0x15b4('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x15b4('0x9'),auth['isAuthenticated'](),controller['destroy']);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 8f4a5a9..edd7d88 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 _0xccce=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','sequelize','STRING','yes','4800','7200','9600','12000','14400','ENUM','2400'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xccce,0x89));var _0xeccc=function(_0x18bdb2,_0x35073d){_0x18bdb2=_0x18bdb2-0x0;var _0x127f4e=_0xccce[_0x18bdb2];return _0x127f4e;};'use strict';var Sequelize=require(_0xeccc('0x0'));module['exports']={'name':{'type':Sequelize[_0xeccc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xeccc('0x2'),'no'),'defaultValue':_0xeccc('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xeccc('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM']('2400',_0xeccc('0x3'),_0xeccc('0x4'),_0xeccc('0x5'),_0xeccc('0x6'),_0xeccc('0x7')),'defaultValue':_0xeccc('0x3')},'maxrate':{'type':Sequelize[_0xeccc('0x8')](_0xeccc('0x9'),_0xeccc('0x3'),_0xeccc('0x4'),'9600','12000',_0xeccc('0x7')),'defaultValue':_0xeccc('0x7')},'modem':{'type':Sequelize[_0xeccc('0x1')],'defaultValue':_0xeccc('0xa')},'gateway':{'type':Sequelize[_0xeccc('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xeccc('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xeccc('0x8')](_0xeccc('0xc'),_0xeccc('0xd'),_0xeccc('0xe'),_0xeccc('0xf')),'defaultValue':_0xeccc('0xc')},'key':{'type':Sequelize[_0xeccc('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xeccc('0x10');}},'notificationSound':{'type':Sequelize[_0xeccc('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeccc('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeccc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeccc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeccc('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeccc('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xeccc('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28897f){if(!_0x28897f)this['setDataValue'](_0xeccc('0x13'),null);this[_0xeccc('0x14')]('mandatoryDisposition',_0x28897f);}}}; \ No newline at end of file +var _0xe3f2=['DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','9600','12000','14400','2400','v17,v27,v29','INTEGER','SIP','IAX'];(function(_0x4a5bdc,_0x3ba456){var _0x17715e=function(_0x2f8687){while(--_0x2f8687){_0x4a5bdc['push'](_0x4a5bdc['shift']());}};_0x17715e(++_0x3ba456);}(_0xe3f2,0x80));var _0x2e3f=function(_0x525cbd,_0x9d5fbe){_0x525cbd=_0x525cbd-0x0;var _0x2f2347=_0xe3f2[_0x525cbd];return _0x2f2347;};'use strict';var Sequelize=require(_0x2e3f('0x0'));module[_0x2e3f('0x1')]={'name':{'type':Sequelize[_0x2e3f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2e3f('0x2')]},'ecm':{'type':Sequelize[_0x2e3f('0x3')](_0x2e3f('0x4'),'no'),'defaultValue':_0x2e3f('0x4')},'headerinfo':{'type':Sequelize[_0x2e3f('0x2')],'defaultValue':_0x2e3f('0x5')},'localstationid':{'type':Sequelize[_0x2e3f('0x2')],'unique':_0x2e3f('0x6')},'minrate':{'type':Sequelize[_0x2e3f('0x3')]('2400',_0x2e3f('0x7'),'7200',_0x2e3f('0x8'),_0x2e3f('0x9'),_0x2e3f('0xa')),'defaultValue':_0x2e3f('0x7')},'maxrate':{'type':Sequelize[_0x2e3f('0x3')](_0x2e3f('0xb'),_0x2e3f('0x7'),'7200',_0x2e3f('0x8'),'12000',_0x2e3f('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x2e3f('0x2')],'defaultValue':_0x2e3f('0xc')},'gateway':{'type':Sequelize[_0x2e3f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2e3f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2e3f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2e3f('0x3')](_0x2e3f('0xe'),_0x2e3f('0xf'),_0x2e3f('0x10'),_0x2e3f('0x11')),'defaultValue':_0x2e3f('0xe')},'key':{'type':Sequelize[_0x2e3f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2e3f('0x12')],'defaultValue':function(){return _0x2e3f('0x13');}},'notificationSound':{'type':Sequelize[_0x2e3f('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2e3f('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e3f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e3f('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e3f('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x2e3f('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x2e3f('0x14')],'defaultValue':![],'comment':_0x2e3f('0x16'),'set':function(_0x329177){if(!_0x329177)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x2e3f('0x17'),_0x329177);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 5ed1ac0..ba1a5d8 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 _0x8168=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','Pause','length','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','params','addDisposition','FaxAccountId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2c30e1,_0x52e536){var _0x4e5584=function(_0x3c74af){while(--_0x3c74af){_0x2c30e1['push'](_0x2c30e1['shift']());}};_0x4e5584(++_0x52e536);}(_0x8168,0xc4));var _0x8816=function(_0x3869c8,_0x2ff137){_0x3869c8=_0x3869c8-0x0;var _0x4caf60=_0x8168[_0x3869c8];return _0x4caf60;};'use strict';var emlformat=require(_0x8816('0x0'));var rimraf=require(_0x8816('0x1'));var zipdir=require(_0x8816('0x2'));var jsonpatch=require(_0x8816('0x3'));var rp=require(_0x8816('0x4'));var moment=require(_0x8816('0x5'));var BPromise=require(_0x8816('0x6'));var Mustache=require(_0x8816('0x7'));var util=require('util');var path=require(_0x8816('0x8'));var sox=require(_0x8816('0x9'));var csv=require(_0x8816('0xa'));var ejs=require(_0x8816('0xb'));var fs=require('fs');var fs_extra=require(_0x8816('0xc'));var _=require(_0x8816('0xd'));var squel=require(_0x8816('0xe'));var crypto=require(_0x8816('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8816('0xa'));var querystring=require(_0x8816('0x10'));var Papa=require(_0x8816('0x11'));var Redis=require('ioredis');var authService=require(_0x8816('0x12'));var qs=require(_0x8816('0x13'));var as=require(_0x8816('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8816('0x15'))(_0x8816('0x16'));var utils=require('../../config/utils');var config=require(_0x8816('0x17'));var licenseUtil=require(_0x8816('0x18'));var db=require(_0x8816('0x19'))['db'];config[_0x8816('0x1a')]=_[_0x8816('0x1b')](config['redis'],{'host':_0x8816('0x1c'),'port':0x18eb});var socket=require(_0x8816('0x1d'))(new Redis(config[_0x8816('0x1a')]));require(_0x8816('0x1e'))[_0x8816('0x1f')](socket);var jayson=require(_0x8816('0x20'));var client=jayson[_0x8816('0x21')][_0x8816('0x22')]({'port':0x232c});var client9002=jayson[_0x8816('0x21')][_0x8816('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x10a3e2,_0x25bf7a,_0x1071b9,_0x27676a){return new BPromise(function(_0x3faf88,_0x444143){var _0x5f43e8=_0x27676a||client;return _0x5f43e8[_0x8816('0x23')](_0x10a3e2,_0x1071b9)[_0x8816('0x24')](function(_0x2a6a14){logger['info'](_0x8816('0x25'),_0x25bf7a,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x25bf7a,_0x8816('0x26'),JSON[_0x8816('0x27')](_0x2a6a14));if(_0x2a6a14[_0x8816('0x28')]){if(_0x2a6a14[_0x8816('0x28')][_0x8816('0x29')]===0x1f4){logger['error'](_0x8816('0x25'),_0x25bf7a,_0x2a6a14[_0x8816('0x28')]['message']);return _0x444143(_0x2a6a14['error'][_0x8816('0x2a')]);}logger[_0x8816('0x28')](_0x8816('0x25'),_0x25bf7a,_0x2a6a14['error'][_0x8816('0x2a')]);return _0x3faf88(_0x2a6a14['error'][_0x8816('0x2a')]);}else{logger[_0x8816('0x2b')](_0x8816('0x25'),_0x25bf7a,'request\x20sent');_0x3faf88(_0x2a6a14[_0x8816('0x2c')][_0x8816('0x2a')]);}})[_0x8816('0x2d')](function(_0x483845){logger[_0x8816('0x28')](_0x8816('0x25'),_0x25bf7a,_0x483845);_0x444143(_0x483845);});});}function respondWithStatusCode(_0x42a76d,_0x240bac){_0x240bac=_0x240bac||0xcc;return function(_0x1e5d2d){if(_0x1e5d2d){return _0x42a76d['sendStatus'](_0x240bac);}return _0x42a76d[_0x8816('0x2e')](_0x240bac)[_0x8816('0x2f')]();};}function respondWithResult(_0x36e0bb,_0x3ea4ce){_0x3ea4ce=_0x3ea4ce||0xc8;return function(_0x528dbd){if(_0x528dbd){return _0x36e0bb['status'](_0x3ea4ce)[_0x8816('0x30')](_0x528dbd);}};}function respondWithFilteredResult(_0x553d1f,_0x54269f){return function(_0x1524a9){if(_0x1524a9){var _0x563a57=typeof _0x54269f[_0x8816('0x31')]===_0x8816('0x32')&&typeof _0x54269f[_0x8816('0x33')]==='undefined';var _0x3c4614=_0x1524a9[_0x8816('0x34')];var _0x15d830=_0x563a57?0x0:_0x54269f['offset'];var _0xbc1399=_0x563a57?_0x1524a9['count']:_0x54269f[_0x8816('0x31')]+_0x54269f[_0x8816('0x33')];var _0x26e74f;if(_0xbc1399>=_0x3c4614){_0xbc1399=_0x3c4614;_0x26e74f=0xc8;}else{_0x26e74f=0xce;}_0x553d1f[_0x8816('0x2e')](_0x26e74f);return _0x553d1f[_0x8816('0x35')](_0x8816('0x36'),_0x15d830+'-'+_0xbc1399+'/'+_0x3c4614)['json'](_0x1524a9);}return null;};}function patchUpdates(_0x5e2f57){return function(_0x5f17){try{jsonpatch[_0x8816('0x37')](_0x5f17,_0x5e2f57,!![]);}catch(_0x7432d3){return BPromise['reject'](_0x7432d3);}return _0x5f17[_0x8816('0x38')]();};}function saveUpdates(_0x59cd31,_0xb00516){return function(_0x96fc3c){if(_0x96fc3c){return _0x96fc3c[_0x8816('0x39')](_0x59cd31)[_0x8816('0x24')](function(_0x2e7132){return _0x2e7132;});}return null;};}function removeEntity(_0x30bf42,_0x53f2d1){return function(_0x16725c){if(_0x16725c){return _0x16725c[_0x8816('0x3a')]()[_0x8816('0x24')](function(){var _0x56fabb=_0x16725c[_0x8816('0x3b')]({'plain':!![]});var _0x367a11=_0x8816('0x3c');return db[_0x8816('0x3d')]['destroy']({'where':{'type':_0x367a11,'resourceId':_0x56fabb['id']}})[_0x8816('0x24')](function(){return _0x16725c;});})[_0x8816('0x24')](function(){_0x30bf42['status'](0xcc)[_0x8816('0x2f')]();});}};}function handleEntityNotFound(_0x5a12ce,_0x52f3cd){return function(_0xad8789){if(!_0xad8789){_0x5a12ce[_0x8816('0x3e')](0x194);}return _0xad8789;};}function handleError(_0x12aa43,_0x424b79){_0x424b79=_0x424b79||0x1f4;return function(_0x21a50a){logger[_0x8816('0x28')](_0x21a50a[_0x8816('0x3f')]);if(_0x21a50a[_0x8816('0x40')]){delete _0x21a50a[_0x8816('0x40')];}_0x12aa43[_0x8816('0x2e')](_0x424b79)[_0x8816('0x41')](_0x21a50a);};}exports[_0x8816('0x42')]=function(_0x4599a3,_0x17ac86){var _0x37ac85={'include':[{'model':db['Pause'],'as':_0x8816('0x43')}]},_0x2bc114={},_0x5dc527={'count':0x0,'rows':[]};var _0x2a9afd=_[_0x8816('0x44')](db[_0x8816('0x45')][_0x8816('0x46')],function(_0x24835c){return{'name':_0x24835c['fieldName'],'type':_0x24835c[_0x8816('0x47')][_0x8816('0x48')]};});_0x2bc114[_0x8816('0x49')]=_[_0x8816('0x44')](_0x2a9afd,_0x8816('0x40'));_0x2bc114[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x4599a3[_0x8816('0x4a')]);_0x2bc114['filters']=_[_0x8816('0x4c')](_0x2bc114[_0x8816('0x49')],_0x2bc114['query']);_0x37ac85['attributes']=_[_0x8816('0x4c')](_0x2bc114[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x4d')]));_0x37ac85[_0x8816('0x4e')]=_0x37ac85[_0x8816('0x4e')]['length']?_0x37ac85[_0x8816('0x4e')]:_0x2bc114[_0x8816('0x49')];if(!_0x4599a3[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x37ac85[_0x8816('0x33')]=qs[_0x8816('0x33')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x33')]);_0x37ac85[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x31')]);}_0x37ac85[_0x8816('0x51')]=qs[_0x8816('0x52')](_0x4599a3[_0x8816('0x4a')][_0x8816('0x52')]);_0x37ac85[_0x8816('0x53')]=qs[_0x8816('0x54')](_[_0x8816('0x55')](_0x4599a3['query'],_0x2bc114[_0x8816('0x54')]),_0x2a9afd);if(_0x4599a3[_0x8816('0x4a')][_0x8816('0x56')]){_0x37ac85[_0x8816('0x53')]=_[_0x8816('0x57')](_0x37ac85[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x2a9afd,function(_0x200c17){if(_0x200c17[_0x8816('0x47')]!==_0x8816('0x58')){var _0x1c3d23={};_0x1c3d23[_0x200c17[_0x8816('0x40')]]={'$like':'%'+_0x4599a3[_0x8816('0x4a')]['filter']+'%'};return _0x1c3d23;}})});}_0x37ac85=_['merge']({},_0x37ac85,_0x4599a3[_0x8816('0x59')]);var _0x20a4c5={'where':_0x37ac85[_0x8816('0x53')]};return db[_0x8816('0x45')]['count'](_0x20a4c5)[_0x8816('0x24')](function(_0x209bf7){_0x5dc527[_0x8816('0x34')]=_0x209bf7;if(_0x4599a3[_0x8816('0x4a')]['includeAll']){_0x37ac85[_0x8816('0x5a')]=[{'all':!![]}];}return db[_0x8816('0x45')]['findAll'](_0x37ac85);})[_0x8816('0x24')](function(_0x207433){_0x5dc527[_0x8816('0x5b')]=_0x207433;return _0x5dc527;})[_0x8816('0x24')](respondWithFilteredResult(_0x17ac86,_0x37ac85))['catch'](handleError(_0x17ac86,null));};exports[_0x8816('0x5c')]=function(_0x1dec5a,_0x547eaa){var _0x36da3a={'raw':![],'where':{'id':_0x1dec5a['params']['id']},'include':[{'model':db[_0x8816('0x5d')],'as':_0x8816('0x43')}]},_0x494eed={};_0x494eed['model']=_[_0x8816('0x4b')](db[_0x8816('0x45')]['rawAttributes']);_0x494eed[_0x8816('0x4a')]=_['keys'](_0x1dec5a['query']);_0x494eed[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x494eed[_0x8816('0x49')],_0x494eed[_0x8816('0x4a')]);_0x36da3a[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x494eed[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x1dec5a['query'][_0x8816('0x4d')]));_0x36da3a[_0x8816('0x4e')]=_0x36da3a[_0x8816('0x4e')][_0x8816('0x5e')]?_0x36da3a['attributes']:_0x494eed[_0x8816('0x49')];if(_0x1dec5a[_0x8816('0x4a')][_0x8816('0x5f')]){_0x36da3a[_0x8816('0x5a')]=[{'all':!![]}];}_0x36da3a=_[_0x8816('0x57')]({},_0x36da3a,_0x1dec5a[_0x8816('0x59')]);return db[_0x8816('0x45')]['find'](_0x36da3a)[_0x8816('0x24')](handleEntityNotFound(_0x547eaa,null))[_0x8816('0x24')](respondWithResult(_0x547eaa,null))[_0x8816('0x2d')](handleError(_0x547eaa,null));};exports[_0x8816('0x60')]=function(_0x8591fc,_0x77aa84){return db[_0x8816('0x45')][_0x8816('0x60')](_0x8591fc[_0x8816('0x61')],{})['then'](function(_0x40e67f){var _0x552cd6=_0x8591fc['user'][_0x8816('0x3b')]({'plain':!![]});if(!_0x552cd6)throw new Error(_0x8816('0x62'));if(_0x552cd6['role']===_0x8816('0x63')){var _0x37f5e1=_0x40e67f[_0x8816('0x3b')]({'plain':!![]});var _0xb02cad=_0x8816('0x3c');return db[_0x8816('0x64')][_0x8816('0x65')]({'where':{'name':_0xb02cad,'userProfileId':_0x552cd6[_0x8816('0x66')]},'raw':!![]})['then'](function(_0x107118){if(_0x107118&&_0x107118[_0x8816('0x67')]===0x0){return db['UserProfileResource']['create']({'name':_0x37f5e1[_0x8816('0x40')],'resourceId':_0x37f5e1['id'],'type':_0x107118['name'],'sectionId':_0x107118['id']},{})['then'](function(){return _0x40e67f;});}else{return _0x40e67f;}})[_0x8816('0x2d')](function(_0x2859f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2859f4);throw _0x2859f4;});}return _0x40e67f;})[_0x8816('0x24')](respondWithResult(_0x77aa84,0xc9))[_0x8816('0x2d')](handleError(_0x77aa84,null));};exports['update']=function(_0x49de89,_0x32b3fd){if(_0x49de89[_0x8816('0x61')]['id']){delete _0x49de89[_0x8816('0x61')]['id'];}return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x49de89[_0x8816('0x68')]['id']},'include':[{'model':db[_0x8816('0x5d')],'as':_0x8816('0x43')}]})[_0x8816('0x24')](handleEntityNotFound(_0x32b3fd,null))[_0x8816('0x24')](saveUpdates(_0x49de89[_0x8816('0x61')],null))['then'](respondWithResult(_0x32b3fd,null))['catch'](handleError(_0x32b3fd,null));};exports[_0x8816('0x3a')]=function(_0x2b2130,_0x42d72a){return db['FaxAccount'][_0x8816('0x65')]({'where':{'id':_0x2b2130[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x42d72a,null))[_0x8816('0x24')](removeEntity(_0x42d72a,null))[_0x8816('0x2d')](handleError(_0x42d72a,null));};exports['describe']=function(_0x444b72,_0x141f73){return db[_0x8816('0x45')]['describe']()[_0x8816('0x24')](respondWithResult(_0x141f73,null))[_0x8816('0x2d')](handleError(_0x141f73,null));};exports[_0x8816('0x69')]=function(_0x35bcd5,_0x85732e,_0x542910){if(_0x35bcd5[_0x8816('0x61')]['id']){delete _0x35bcd5[_0x8816('0x61')]['id'];}return db[_0x8816('0x45')]['find']({'where':{'id':_0x35bcd5['params']['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x85732e,null))[_0x8816('0x24')](function(_0x3b52f0){if(_0x3b52f0){_0x35bcd5[_0x8816('0x61')][_0x8816('0x6a')]=_0x3b52f0['id'];return db[_0x8816('0x6b')][_0x8816('0x60')](_0x35bcd5[_0x8816('0x61')]);}})[_0x8816('0x24')](respondWithResult(_0x85732e,null))[_0x8816('0x2d')](handleError(_0x85732e,null));};exports[_0x8816('0x6c')]=function(_0x347df1,_0x365b55,_0x313041){var _0x2349ab={'raw':![],'where':{}};var _0x1a02d9={};var _0x48ad1e={'count':0x0,'rows':[]};return db[_0x8816('0x45')]['findOne']({'where':{'id':_0x347df1[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x365b55,null))[_0x8816('0x24')](function(_0x25c5b9){if(_0x25c5b9){_0x1a02d9[_0x8816('0x49')]=_[_0x8816('0x4b')](db['Disposition'][_0x8816('0x46')]);_0x1a02d9['query']=_['keys'](_0x347df1[_0x8816('0x4a')]);_0x1a02d9[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x1a02d9[_0x8816('0x49')],_0x1a02d9[_0x8816('0x4a')]);_0x2349ab[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x1a02d9[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x347df1[_0x8816('0x4a')][_0x8816('0x4d')]));_0x2349ab[_0x8816('0x4e')]=_0x2349ab[_0x8816('0x4e')][_0x8816('0x5e')]?_0x2349ab[_0x8816('0x4e')]:_0x1a02d9[_0x8816('0x49')];if(!_0x347df1[_0x8816('0x4a')]['hasOwnProperty'](_0x8816('0x50'))){_0x2349ab[_0x8816('0x33')]=qs[_0x8816('0x33')](_0x347df1['query'][_0x8816('0x33')]);_0x2349ab['offset']=qs[_0x8816('0x31')](_0x347df1[_0x8816('0x4a')]['offset']);}_0x2349ab['order']=qs['sort'](_0x347df1[_0x8816('0x4a')]['sort']);_0x2349ab[_0x8816('0x53')]=qs[_0x8816('0x54')](_['pick'](_0x347df1[_0x8816('0x4a')],_0x1a02d9[_0x8816('0x54')]));_0x2349ab[_0x8816('0x53')][_0x8816('0x6a')]=_0x25c5b9['id'];if(_0x347df1[_0x8816('0x4a')][_0x8816('0x56')]){_0x2349ab[_0x8816('0x53')]=_['merge'](_0x2349ab['where'],{'$or':_[_0x8816('0x44')](_0x2349ab[_0x8816('0x4e')],function(_0x49c170){var _0xca6e5b={};_0xca6e5b[_0x49c170]={'$like':'%'+_0x347df1[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0xca6e5b;})});}_0x2349ab=_['merge']({},_0x2349ab,_0x347df1[_0x8816('0x59')]);return db[_0x8816('0x6b')][_0x8816('0x34')]({'where':_0x2349ab[_0x8816('0x53')]})[_0x8816('0x24')](function(_0xf5d73){_0x48ad1e[_0x8816('0x34')]=_0xf5d73;if(_0x347df1[_0x8816('0x4a')][_0x8816('0x5f')]){_0x2349ab[_0x8816('0x5a')]=[{'all':!![]}];}return db[_0x8816('0x6b')][_0x8816('0x6d')](_0x2349ab);})['then'](function(_0xcc13a4){_0x48ad1e[_0x8816('0x5b')]=_0xcc13a4;return _0x48ad1e;});}})['then'](respondWithFilteredResult(_0x365b55,_0x2349ab))[_0x8816('0x2d')](handleError(_0x365b55,null));};exports[_0x8816('0x6e')]=function(_0x4dd08c,_0xda35cf,_0x5eb431){return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x4dd08c[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0xda35cf,null))[_0x8816('0x24')](function(_0x5e6d1f){if(_0x5e6d1f){return _0x5e6d1f[_0x8816('0x6e')](_0x4dd08c[_0x8816('0x4a')][_0x8816('0x6f')]);}})[_0x8816('0x24')](respondWithStatusCode(_0xda35cf,null))[_0x8816('0x2d')](handleError(_0xda35cf,null));};exports[_0x8816('0x70')]=function(_0x2dfcf0,_0xc6bd58,_0x2af670){if(_0x2dfcf0['body']['id']){delete _0x2dfcf0['body']['id'];}return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x2dfcf0[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0xc6bd58,null))['then'](function(_0x1d19ce){if(_0x1d19ce){_0x2dfcf0[_0x8816('0x61')][_0x8816('0x6a')]=_0x1d19ce['id'];return db[_0x8816('0x71')][_0x8816('0x60')](_0x2dfcf0['body']);}})[_0x8816('0x24')](respondWithResult(_0xc6bd58,null))[_0x8816('0x2d')](handleError(_0xc6bd58,null));};exports['getAnswers']=function(_0x843567,_0x53408b,_0x515bea){var _0x4d0dcd={'raw':![],'where':{}};var _0x2a1059={};var _0x1b21a8={'count':0x0,'rows':[]};return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x843567[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x53408b,null))[_0x8816('0x24')](function(_0x4ead86){if(_0x4ead86){_0x2a1059[_0x8816('0x49')]=_['keys'](db[_0x8816('0x71')][_0x8816('0x46')]);_0x2a1059['query']=_['keys'](_0x843567['query']);_0x2a1059[_0x8816('0x54')]=_['intersection'](_0x2a1059['model'],_0x2a1059[_0x8816('0x4a')]);_0x4d0dcd['attributes']=_[_0x8816('0x4c')](_0x2a1059['model'],qs['fields'](_0x843567[_0x8816('0x4a')]['fields']));_0x4d0dcd[_0x8816('0x4e')]=_0x4d0dcd[_0x8816('0x4e')][_0x8816('0x5e')]?_0x4d0dcd[_0x8816('0x4e')]:_0x2a1059['model'];if(!_0x843567['query'][_0x8816('0x4f')](_0x8816('0x50'))){_0x4d0dcd[_0x8816('0x33')]=qs['limit'](_0x843567[_0x8816('0x4a')]['limit']);_0x4d0dcd[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x843567[_0x8816('0x4a')][_0x8816('0x31')]);}_0x4d0dcd[_0x8816('0x51')]=qs[_0x8816('0x52')](_0x843567[_0x8816('0x4a')][_0x8816('0x52')]);_0x4d0dcd[_0x8816('0x53')]=qs[_0x8816('0x54')](_['pick'](_0x843567[_0x8816('0x4a')],_0x2a1059[_0x8816('0x54')]));_0x4d0dcd[_0x8816('0x53')][_0x8816('0x6a')]=_0x4ead86['id'];if(_0x843567[_0x8816('0x4a')]['filter']){_0x4d0dcd[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4d0dcd[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4d0dcd[_0x8816('0x4e')],function(_0x4ed690){var _0xc5e86e={};_0xc5e86e[_0x4ed690]={'$like':'%'+_0x843567[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0xc5e86e;})});}_0x4d0dcd=_['merge']({},_0x4d0dcd,_0x843567['options']);return db['CannedAnswer'][_0x8816('0x34')]({'where':_0x4d0dcd[_0x8816('0x53')]})[_0x8816('0x24')](function(_0x212b3e){_0x1b21a8[_0x8816('0x34')]=_0x212b3e;if(_0x843567['query'][_0x8816('0x5f')]){_0x4d0dcd[_0x8816('0x5a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4d0dcd);})[_0x8816('0x24')](function(_0x21ef4c){_0x1b21a8[_0x8816('0x5b')]=_0x21ef4c;return _0x1b21a8;});}})[_0x8816('0x24')](respondWithFilteredResult(_0x53408b,_0x4d0dcd))[_0x8816('0x2d')](handleError(_0x53408b,null));};exports[_0x8816('0x73')]=function(_0x17be59,_0x47c57a,_0x53e312){return db['FaxAccount'][_0x8816('0x65')]({'where':{'id':_0x17be59['params']['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x47c57a,null))[_0x8816('0x24')](function(_0x267a97){if(_0x267a97){return _0x267a97['removeAnswers'](_0x17be59[_0x8816('0x4a')]['ids']);}})[_0x8816('0x24')](respondWithStatusCode(_0x47c57a,null))[_0x8816('0x2d')](handleError(_0x47c57a,null));};exports[_0x8816('0x74')]=function(_0x6ec47c,_0xf8523c,_0x36894d){return db[_0x8816('0x75')]['find']({'where':{'id':_0x6ec47c[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0xf8523c,null))[_0x8816('0x24')](function(_0x1b11a2){if(_0x1b11a2){return _0x1b11a2[_0x8816('0x74')](_0x6ec47c[_0x8816('0x61')]['ids'],_[_0x8816('0x76')](_0x6ec47c['body'],[_0x8816('0x6f'),'id'])||{});}})[_0x8816('0x24')](respondWithResult(_0xf8523c,null))[_0x8816('0x2d')](handleError(_0xf8523c,null));};exports[_0x8816('0x77')]=function(_0x292d91,_0x51e0fe,_0x2c7233){var _0x67a15f={'raw':![],'where':{}};var _0x4e55c1={};var _0x4bb5bb={'count':0x0,'rows':[]};return db['FaxAccount'][_0x8816('0x72')]({'where':{'id':_0x292d91[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x51e0fe,null))[_0x8816('0x24')](function(_0x44c92c){if(_0x44c92c){_0x4e55c1['model']=_[_0x8816('0x4b')](db[_0x8816('0x75')][_0x8816('0x46')]);_0x4e55c1['query']=_[_0x8816('0x4b')](_0x292d91[_0x8816('0x4a')]);_0x4e55c1[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x4e55c1[_0x8816('0x49')],_0x4e55c1[_0x8816('0x4a')]);_0x67a15f[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x4e55c1[_0x8816('0x49')],qs['fields'](_0x292d91[_0x8816('0x4a')][_0x8816('0x4d')]));_0x67a15f[_0x8816('0x4e')]=_0x67a15f[_0x8816('0x4e')][_0x8816('0x5e')]?_0x67a15f['attributes']:_0x4e55c1[_0x8816('0x49')];if(!_0x292d91[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x67a15f['limit']=qs[_0x8816('0x33')](_0x292d91[_0x8816('0x4a')][_0x8816('0x33')]);_0x67a15f[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x292d91[_0x8816('0x4a')][_0x8816('0x31')]);}_0x67a15f[_0x8816('0x51')]=qs['sort'](_0x292d91[_0x8816('0x4a')]['sort']);_0x67a15f[_0x8816('0x53')]=qs['filters'](_['pick'](_0x292d91['query'],_0x4e55c1[_0x8816('0x54')]));_0x67a15f['where']['FaxAccountId']=_0x44c92c['id'];if(_0x292d91[_0x8816('0x4a')]['filter']){_0x67a15f[_0x8816('0x53')]=_[_0x8816('0x57')](_0x67a15f[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x67a15f[_0x8816('0x4e')],function(_0x412a4f){var _0x530540={};_0x530540[_0x412a4f]={'$like':'%'+_0x292d91[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0x530540;})});}_0x67a15f=_[_0x8816('0x57')]({},_0x67a15f,_0x292d91['options']);return db[_0x8816('0x75')][_0x8816('0x34')]({'where':_0x67a15f[_0x8816('0x53')]})[_0x8816('0x24')](function(_0x531b32){_0x4bb5bb[_0x8816('0x34')]=_0x531b32;if(_0x292d91[_0x8816('0x4a')][_0x8816('0x5f')]){_0x67a15f[_0x8816('0x5a')]=[{'model':db[_0x8816('0x78')],'as':_0x8816('0x79'),'required':![]},{'model':db[_0x8816('0x7a')],'as':_0x8816('0x7b'),'attributes':['name','fullname',_0x8816('0x7c')],'required':![]},{'model':db['Tag'],'as':_0x8816('0x7d'),'attributes':['id','name',_0x8816('0x7e')],'where':_0x292d91[_0x8816('0x4a')][_0x8816('0x7f')]?{'id':_0x292d91['query']['tag']}:undefined,'required':_0x292d91['query'][_0x8816('0x7f')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x67a15f);})['then'](function(_0x519a72){_0x4bb5bb[_0x8816('0x5b')]=_0x519a72;return _0x4bb5bb;});}})[_0x8816('0x24')](respondWithFilteredResult(_0x51e0fe,_0x67a15f))[_0x8816('0x2d')](handleError(_0x51e0fe,null));};exports[_0x8816('0x80')]=function(_0x4c6e10,_0x5e152d,_0x465fc9){return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x4c6e10[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x5e152d,null))[_0x8816('0x24')](function(_0x2850e2){if(_0x2850e2){return db[_0x8816('0x81')][_0x8816('0x82')](function(_0x4960b1){return db[_0x8816('0x83')][_0x8816('0x3a')]({'where':{'FaxAccountId':_0x4c6e10[_0x8816('0x68')]['id']},'transaction':_0x4960b1})[_0x8816('0x24')](function(_0x3f91b1){var _0x54e9ea=_[_0x8816('0x44')](_0x4c6e10[_0x8816('0x61')],function(_0x48f067){_0x48f067[_0x8816('0x6a')]=_0x4c6e10[_0x8816('0x68')]['id'];return _0x48f067;});return db[_0x8816('0x83')][_0x8816('0x84')](_0x54e9ea,{'transaction':_0x4960b1});});})[_0x8816('0x24')](function(){return db['FaxApplication'][_0x8816('0x85')]({'where':{'FaxAccountId':_0x4c6e10[_0x8816('0x68')]['id']},'order':_0x8816('0x86')});});}})[_0x8816('0x24')](respondWithResult(_0x5e152d,null))[_0x8816('0x2d')](handleError(_0x5e152d,null));};exports[_0x8816('0x87')]=function(_0x42758a,_0x836ff5,_0x40159d){var _0x4f589f={};var _0x2f4286={};var _0x1c91b0;var _0x3f75ee;return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x42758a[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x836ff5,null))[_0x8816('0x24')](function(_0x2b5594){if(_0x2b5594){_0x1c91b0=_0x2b5594;_0x2f4286[_0x8816('0x49')]=_[_0x8816('0x4b')](db[_0x8816('0x83')][_0x8816('0x46')]);_0x2f4286[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x42758a[_0x8816('0x4a')]);_0x2f4286[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x2f4286[_0x8816('0x49')],_0x2f4286[_0x8816('0x4a')]);_0x4f589f[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x2f4286[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x42758a[_0x8816('0x4a')][_0x8816('0x4d')]));_0x4f589f['attributes']=_0x4f589f[_0x8816('0x4e')][_0x8816('0x5e')]?_0x4f589f[_0x8816('0x4e')]:_0x2f4286[_0x8816('0x49')];_0x4f589f[_0x8816('0x51')]=qs['sort'](_0x42758a[_0x8816('0x4a')][_0x8816('0x52')]);_0x4f589f[_0x8816('0x53')]=qs[_0x8816('0x54')](_[_0x8816('0x55')](_0x42758a[_0x8816('0x4a')],_0x2f4286[_0x8816('0x54')]));if(_0x42758a[_0x8816('0x4a')][_0x8816('0x56')]){_0x4f589f[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4f589f[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4f589f[_0x8816('0x4e')],function(_0x10829f){var _0x1ba6e8={};_0x1ba6e8[_0x10829f]={'$like':'%'+_0x42758a[_0x8816('0x4a')]['filter']+'%'};return _0x1ba6e8;})});}_0x4f589f=_[_0x8816('0x57')]({},_0x4f589f,_0x42758a[_0x8816('0x59')]);return _0x1c91b0[_0x8816('0x87')](_0x4f589f);}})['then'](function(_0x748c71){if(_0x748c71){_0x3f75ee=_0x748c71[_0x8816('0x5e')];if(!_0x42758a['query'][_0x8816('0x4f')](_0x8816('0x50'))){_0x4f589f[_0x8816('0x33')]=qs['limit'](_0x42758a['query'][_0x8816('0x33')]);_0x4f589f[_0x8816('0x31')]=qs['offset'](_0x42758a['query'][_0x8816('0x31')]);}return _0x1c91b0['getApplications'](_0x4f589f);}})[_0x8816('0x24')](function(_0x51356f){if(_0x51356f){return _0x51356f?{'count':_0x3f75ee,'rows':_0x51356f}:null;}})[_0x8816('0x24')](respondWithResult(_0x836ff5,null))[_0x8816('0x2d')](handleError(_0x836ff5,null));};function Extension(_0x1c153d,_0x2f869d,_0x13dced,_0x17d37b){this['context']=_0x8816('0x88');this[_0x8816('0x89')]=_0x1c153d[_0x8816('0x8a')];this[_0x8816('0x8b')]=_0x17d37b;this[_0x8816('0x47')]=_0x8816('0x8c');this['description']=_0x8816('0x8d');this[_0x8816('0x6a')]=_0x1c153d['id'];this[_0x8816('0x86')]=_0x2f869d;this[_0x8816('0x8e')]=_0x13dced;}function createExtensionsReciveFax(_0x434ec3){var _0x51c589=0x1;var _0x4246fa=[];_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,'',_0x8816('0x90')));_0x51c589+=0x1;_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,_0x8816('0x91'),_0x8816('0x92')));_0x51c589+=0x1;for(var _0x17e5e8 in _0x434ec3){if(_0x434ec3[_0x8816('0x4f')](_0x17e5e8)&&(_0x17e5e8===_0x8816('0x93')||_0x17e5e8===_0x8816('0x8a')||_0x17e5e8===_0x8816('0x94')||_0x17e5e8==='faxdetect'||_0x17e5e8===_0x8816('0x95')||_0x17e5e8===_0x8816('0x96')||_0x17e5e8===_0x8816('0x97')||_0x17e5e8===_0x8816('0x98')||_0x17e5e8===_0x8816('0x99'))){_0x4246fa['push'](new Extension(_0x434ec3,_0x51c589,_0x8816('0x9a')+_0x17e5e8+')='+_0x434ec3[_0x17e5e8],_0x8816('0x92')));_0x51c589+=0x1;}}_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,'6',_0x8816('0x9b')));_0x51c589+=0x1;_0x4246fa[_0x8816('0x8f')](new Extension(_0x434ec3,_0x51c589,_0x8816('0x9c'),'ReceiveFax'));_0x51c589=0x0;return _0x4246fa;}exports[_0x8816('0x9d')]=function(_0x47b746,_0xf4188a,_0x1031d1){var _0x1547d3;return db[_0x8816('0x81')][_0x8816('0x82')](function(_0x5a133d){return db[_0x8816('0x45')][_0x8816('0x60')](_0x47b746[_0x8816('0x61')],{'transaction':_0x5a133d})[_0x8816('0x24')](function(_0x290164){_0x1547d3=_0x290164[_0x8816('0x3b')]({'plain':!![]});return db[_0x8816('0x9e')]['bulkCreate'](createExtensionsReciveFax(_0x1547d3),{'transaction':_0x5a133d});});})[_0x8816('0x24')](function(){return _0x1547d3;})[_0x8816('0x24')](respondWithResult(_0xf4188a,null))[_0x8816('0x2d')](handleError(_0xf4188a,null));};exports['updateAccountApplications']=function(_0x1f03eb,_0x535cc3,_0x1ba3df){var _0x2256fc;return db[_0x8816('0x81')][_0x8816('0x82')](function(_0x3c423e){return db['FaxAccount']['update'](_0x1f03eb[_0x8816('0x61')],{'where':{'id':_0x1f03eb[_0x8816('0x61')]['id']},'transaction':_0x3c423e})[_0x8816('0x24')](function(_0x474b55){return db[_0x8816('0x9e')][_0x8816('0x3a')]({'where':{'FaxAccountId':_0x1f03eb['body']['id']},'transaction':_0x3c423e})[_0x8816('0x24')](function(_0x248832){return db[_0x8816('0x9e')][_0x8816('0x84')](createExtensionsReciveFax(_[_0x8816('0x76')](_0x1f03eb[_0x8816('0x61')],[_0x8816('0x9f'),'key',_0x8816('0xa0'),_0x8816('0xa1'),_0x8816('0xa2'),_0x8816('0xa3')])),{'transaction':_0x3c423e});});});})[_0x8816('0x24')](function(){return db[_0x8816('0x45')]['findById'](_0x1f03eb[_0x8816('0x61')]['id']);})[_0x8816('0x24')](respondWithResult(_0x535cc3,null))[_0x8816('0x2d')](handleError(_0x535cc3,null));};exports['getMessages']=function(_0x52e3d8,_0xf59bd7,_0x26bd67){var _0x4ba33c={'raw':!![],'where':{}};var _0x165b90={};var _0x472434={'count':0x0,'rows':[]};return db[_0x8816('0x45')][_0x8816('0x72')]({'where':{'id':_0x52e3d8[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0xf59bd7,null))[_0x8816('0x24')](function(_0x21654e){if(_0x21654e){_0x165b90[_0x8816('0x49')]=_[_0x8816('0x4b')](db[_0x8816('0xa4')][_0x8816('0x46')]);_0x165b90[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x52e3d8[_0x8816('0x4a')]);_0x165b90[_0x8816('0x54')]=_[_0x8816('0x4c')](_0x165b90[_0x8816('0x49')],_0x165b90['query']);_0x4ba33c[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x165b90[_0x8816('0x49')],qs[_0x8816('0x4d')](_0x52e3d8['query'][_0x8816('0x4d')]));_0x4ba33c[_0x8816('0x4e')]=_0x4ba33c[_0x8816('0x4e')][_0x8816('0x5e')]?_0x4ba33c[_0x8816('0x4e')]:_0x165b90[_0x8816('0x49')];if(!_0x52e3d8[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x4ba33c[_0x8816('0x33')]=qs['limit'](_0x52e3d8[_0x8816('0x4a')]['limit']);_0x4ba33c['offset']=qs['offset'](_0x52e3d8[_0x8816('0x4a')][_0x8816('0x31')]);}_0x4ba33c['order']=qs[_0x8816('0x52')](_0x52e3d8[_0x8816('0x4a')]['sort']);_0x4ba33c[_0x8816('0x53')]=qs['filters'](_[_0x8816('0x55')](_0x52e3d8['query'],_0x165b90[_0x8816('0x54')]));_0x4ba33c['where'][_0x8816('0x6a')]=_0x21654e['id'];if(_0x52e3d8['query'][_0x8816('0x56')]){_0x4ba33c[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4ba33c[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4ba33c[_0x8816('0x4e')],function(_0x4dd49d){var _0x2db8f1={};_0x2db8f1[_0x4dd49d]={'$like':'%'+_0x52e3d8[_0x8816('0x4a')]['filter']+'%'};return _0x2db8f1;})});}if(_0x52e3d8[_0x8816('0x4a')][_0x8816('0xa5')]){var _0x2ff7e5=_0x52e3d8[_0x8816('0x4a')]['$gte'][_0x8816('0xa6')](',');var _0x31c7d6={};_0x31c7d6[_0x2ff7e5[0x0]]={'$gte':moment(_0x2ff7e5[0x1])['format'](_0x8816('0xa7'))};_0x4ba33c['where']=_[_0x8816('0x57')](_0x4ba33c[_0x8816('0x53')],_0x31c7d6);}_0x4ba33c=_['merge']({},_0x4ba33c,_0x52e3d8['options']);return db[_0x8816('0xa4')]['count']({'where':_0x4ba33c['where']})['then'](function(_0x332d35){_0x472434['count']=_0x332d35;if(_0x52e3d8['query']['includeAll']){_0x4ba33c['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x4ba33c);})['then'](function(_0x4ff7ac){_0x472434[_0x8816('0x5b')]=_0x4ff7ac;return _0x472434;});}})[_0x8816('0x24')](respondWithFilteredResult(_0xf59bd7,_0x4ba33c))['catch'](handleError(_0xf59bd7,null));};exports[_0x8816('0x41')]=function(_0x562c2d,_0x240055,_0x55fb1b){var _0x490479,_0x525e17={},_0x11898e;if(_0x562c2d[_0x8816('0x61')]['to']){_0x11898e=_0x562c2d[_0x8816('0x61')]['to'][0x0];}return db['FaxAccount'][_0x8816('0x65')]({'where':{'id':_0x562c2d[_0x8816('0x68')]['id']},'include':[{'model':db[_0x8816('0xa8')],'as':_0x8816('0xa9'),'include':[{'model':db[_0x8816('0x78')],'as':'Contacts','where':{'fax':_0x11898e},'limit':0x1,'order':[['updatedAt',_0x8816('0xaa')]]}]}]})[_0x8816('0x24')](handleEntityNotFound(_0x240055,null))[_0x8816('0x24')](function(_0x1cd6e0){_0x490479=_0x1cd6e0;if(_0x562c2d[_0x8816('0x61')][_0x8816('0xab')]&&_0x562c2d[_0x8816('0x61')]['attachments']['length']){for(var _0x451f63=0x0;_0x451f63<_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][_0x8816('0x5e')];_0x451f63+=0x1){_0x562c2d['body'][_0x8816('0xab')][_0x451f63]={'filename':_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][_0x451f63]['name'],'id':_0x562c2d[_0x8816('0x61')]['attachments'][_0x451f63]['id'],'path':path[_0x8816('0xac')](config[_0x8816('0xad')],_0x8816('0xae'),_0x562c2d['body'][_0x8816('0xab')][_0x451f63][_0x8816('0xaf')])};}}return respondWithRpcPromise(_0x8816('0xb0'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x562c2d['params']['id'])?undefined:_0x562c2d['params']['id'],'path':_[_0x8816('0xb1')](_0x562c2d['body'][_0x8816('0xab')][0x0][_0x8816('0x8')])?undefined:_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0x8')],'fax':_['isNil'](_0x562c2d['body']['to'][0x0])?undefined:_0x562c2d[_0x8816('0x61')]['to'][0x0]},client9002);})[_0x8816('0x24')](function(){if(_0x490479){if(_[_0x8816('0xb1')](_0x562c2d[_0x8816('0x61')][_0x8816('0xb2')])){_0x562c2d[_0x8816('0x61')][_0x8816('0xb2')]=util[_0x8816('0xb3')](_0x8816('0xb4'),_0x490479[_0x8816('0x40')],_0x490479[_0x8816('0xb5')]);}if(_0x490479[_0x8816('0xa9')]){if(_0x490479[_0x8816('0xa9')][_0x8816('0xb6')]['length']){return _0x490479['List']['Contacts'][0x0];}else{return db[_0x8816('0x78')][_0x8816('0x60')](_[_0x8816('0x1b')](_0x562c2d['body'],{'firstName':_0x562c2d['body']['to'][0x0],'phone':_0x562c2d[_0x8816('0x61')]['to'][0x0],'fax':_0x562c2d[_0x8816('0x61')]['to'][0x0],'ListId':_0x490479['ListId']}));}}else{throw new Error(_0x8816('0xb7'));}}else{throw new Error(_0x8816('0xb8'));}})['then'](function(_0x2b84f7){if(_0x2b84f7){return db[_0x8816('0x75')][_0x8816('0x65')]({'where':{'ContactId':_0x2b84f7['id'],'closed':![],'FaxAccountId':_0x490479['id']}})[_0x8816('0x24')](function(_0x32d7b2){if(_0x32d7b2){return[_0x32d7b2,![]];}return db[_0x8816('0x75')][_0x8816('0x60')]({'UserId':_0x562c2d[_0x8816('0x63')]['id'],'ContactId':_0x2b84f7['id'],'FaxAccountId':_0x490479['id'],'fax':_0x562c2d[_0x8816('0x61')]['to'][0x0],'firstMsgDirection':_0x8816('0xb9'),'Messages':[_[_0x8816('0x57')](_0x562c2d[_0x8816('0x61')],{'read':![],'body':_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0xba')],'FaxAccountId':_0x490479['id'],'UserId':_0x562c2d[_0x8816('0x63')]['id'],'ContactId':_0x2b84f7['id'],'AttachmentId':_0x562c2d['body'][_0x8816('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x8816('0xa4')],'as':_0x8816('0xbb')}]})['then'](function(_0x83890b){return[_0x83890b,!![]];});});}else{throw new Error(_0x8816('0xbc'));}})[_0x8816('0xbd')](function(_0x1d5ea3,_0x1768f2){if(_0x1768f2){return _0x1d5ea3;}return db[_0x8816('0xa4')]['create']({'direction':_0x8816('0xb9'),'read':![],'body':_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0xba')],'FaxAccountId':_0x490479['id'],'FaxInteractionId':_0x1d5ea3['id'],'UserId':_0x562c2d[_0x8816('0x63')]['id'],'ContactId':_0x1d5ea3[_0x8816('0xbe')],'AttachmentId':_0x562c2d['body'][_0x8816('0xab')][0x0]['id']})[_0x8816('0x24')](function(_0x2014dc){_0x1d5ea3['dataValues']['Messages']=[];_0x1d5ea3[_0x8816('0xbf')]['Messages'][_0x8816('0x8f')](_0x2014dc[_0x8816('0xbf')]);return _0x1d5ea3;});})[_0x8816('0x24')](function(_0xb9ef98){respondWithRpcPromise(_0x8816('0xc0'),_0x8816('0xc0'),{'FaxAccountId':_[_0x8816('0xb1')](_0x562c2d[_0x8816('0x68')]['id'])?undefined:_0x562c2d['params']['id'],'path':_[_0x8816('0xb1')](_0x562c2d['body'][_0x8816('0xab')][0x0][_0x8816('0x8')])?undefined:_0x562c2d[_0x8816('0x61')][_0x8816('0xab')][0x0][_0x8816('0x8')],'fax':_['isNil'](_0x562c2d['body']['to'][0x0])?undefined:_0x562c2d[_0x8816('0x61')]['to'][0x0],'AttachmentId':_0x562c2d[_0x8816('0x61')]['attachments'][0x0]['id']},client9002)[_0x8816('0x24')](function(_0x3c73e7){logger[_0x8816('0x2b')](_0x8816('0xc1'),_0x3c73e7);})[_0x8816('0x2d')](function(_0x2111a2){logger[_0x8816('0x2b')]('SendFaxRpc,\x20%s',_0x2111a2);});return _0xb9ef98;})[_0x8816('0x24')](respondWithResult(_0x240055,null))[_0x8816('0x2d')](handleError(_0x240055,null));};exports[_0x8816('0xc2')]=function(_0x38af48,_0x43838e,_0x2c1c21){return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x38af48[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x43838e,null))[_0x8816('0x24')](function(_0x88218d){if(_0x88218d){return _0x88218d['addAgents'](_0x38af48['body']['ids'],_['omit'](_0x38af48[_0x8816('0x61')],[_0x8816('0x6f'),'id'])||{})[_0x8816('0xbd')](function(_0x67772){for(var _0x29be28=0x0;_0x29be28<_0x38af48[_0x8816('0x61')]['ids'][_0x8816('0x5e')];_0x29be28+=0x1){socket[_0x8816('0xc3')](_0x8816('0xc4'),{'UserId':Number(_0x38af48[_0x8816('0x61')][_0x8816('0x6f')][_0x29be28]),'FaxAccountId':Number(_0x38af48[_0x8816('0x68')]['id'])});}return _0x67772;});}})[_0x8816('0x24')](respondWithResult(_0x43838e,null))[_0x8816('0x2d')](handleError(_0x43838e,null));};exports[_0x8816('0xc5')]=function(_0x16a3aa,_0x15f385,_0x5decb9){return db[_0x8816('0x45')][_0x8816('0x65')]({'where':{'id':_0x16a3aa[_0x8816('0x68')]['id']}})['then'](handleEntityNotFound(_0x15f385,null))['then'](function(_0x343939){if(_0x343939){return _0x343939['removeAgents'](_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')])[_0x8816('0x24')](function(){if(_['isArray'](_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')])){for(var _0x5d996c=0x0;_0x5d996c<_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')][_0x8816('0x5e')];_0x5d996c+=0x1){socket['emit'](_0x8816('0xc6'),{'UserId':Number(_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')][_0x5d996c]),'FaxAccountId':Number(_0x16a3aa[_0x8816('0x68')]['id'])});}}else{socket[_0x8816('0xc3')]('userFaxAccount:remove',{'UserId':Number(_0x16a3aa[_0x8816('0x4a')][_0x8816('0x6f')]),'FaxAccountId':Number(_0x16a3aa['params']['id'])});}});}})[_0x8816('0x24')](respondWithStatusCode(_0x15f385,null))['catch'](handleError(_0x15f385,null));};exports[_0x8816('0xc7')]=function(_0x4bd698,_0x481e55,_0x10ac42){var _0x4e5ea9={};var _0x447b77={};var _0x504bba;var _0x263805;return db[_0x8816('0x45')]['findOne']({'where':{'id':_0x4bd698[_0x8816('0x68')]['id']}})[_0x8816('0x24')](handleEntityNotFound(_0x481e55,null))[_0x8816('0x24')](function(_0x29e032){if(_0x29e032){_0x504bba=_0x29e032;_0x447b77[_0x8816('0x49')]=_[_0x8816('0x4b')](db['User']['rawAttributes']);_0x447b77[_0x8816('0x4a')]=_[_0x8816('0x4b')](_0x4bd698[_0x8816('0x4a')]);_0x447b77[_0x8816('0x54')]=_['intersection'](_0x447b77[_0x8816('0x49')],_0x447b77[_0x8816('0x4a')]);_0x4e5ea9[_0x8816('0x4e')]=_[_0x8816('0x4c')](_0x447b77['model'],qs['fields'](_0x4bd698[_0x8816('0x4a')]['fields']));_0x4e5ea9[_0x8816('0x4e')]=_0x4e5ea9['attributes'][_0x8816('0x5e')]?_0x4e5ea9[_0x8816('0x4e')]:_0x447b77[_0x8816('0x49')];_0x4e5ea9[_0x8816('0x51')]=qs[_0x8816('0x52')](_0x4bd698[_0x8816('0x4a')][_0x8816('0x52')]);_0x4e5ea9[_0x8816('0x53')]=qs[_0x8816('0x54')](_['pick'](_0x4bd698[_0x8816('0x4a')],_0x447b77['filters']));if(_0x4bd698[_0x8816('0x4a')][_0x8816('0x56')]){_0x4e5ea9[_0x8816('0x53')]=_[_0x8816('0x57')](_0x4e5ea9[_0x8816('0x53')],{'$or':_[_0x8816('0x44')](_0x4e5ea9[_0x8816('0x4e')],function(_0x39b031){var _0xe1242e={};_0xe1242e[_0x39b031]={'$like':'%'+_0x4bd698[_0x8816('0x4a')][_0x8816('0x56')]+'%'};return _0xe1242e;})});}_0x4e5ea9=_['merge']({},_0x4e5ea9,_0x4bd698[_0x8816('0x59')]);return _0x504bba[_0x8816('0xc7')](_0x4e5ea9);}})[_0x8816('0x24')](function(_0x5a6b04){if(_0x5a6b04){_0x263805=_0x5a6b04['length'];if(!_0x4bd698[_0x8816('0x4a')][_0x8816('0x4f')](_0x8816('0x50'))){_0x4e5ea9['limit']=qs[_0x8816('0x33')](_0x4bd698[_0x8816('0x4a')][_0x8816('0x33')]);_0x4e5ea9[_0x8816('0x31')]=qs[_0x8816('0x31')](_0x4bd698[_0x8816('0x4a')]['offset']);}return _0x504bba[_0x8816('0xc7')](_0x4e5ea9);}})['then'](function(_0x195039){if(_0x195039){return _0x195039?{'count':_0x263805,'rows':_0x195039}:null;}})[_0x8816('0x24')](respondWithResult(_0x481e55,null))[_0x8816('0x2d')](handleError(_0x481e55,null));}; \ No newline at end of file +var _0xd6fb=['maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','push','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','root','server/files/attachments','basename','isNil','from','\x22%s\x22\x20<%s>','fax','CmContact','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','filter','merge','include','findAll','rows','params','fields','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','length','nolimit','pick','FaxAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo'];(function(_0x12dd11,_0x52b882){var _0x3a502b=function(_0x1a660d){while(--_0x1a660d){_0x12dd11['push'](_0x12dd11['shift']());}};_0x3a502b(++_0x52b882);}(_0xd6fb,0x1b6));var _0xbd6f=function(_0x31ed50,_0x302724){_0x31ed50=_0x31ed50-0x0;var _0x27ccc3=_0xd6fb[_0x31ed50];return _0x27ccc3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbd6f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd6f('0x1'));var moment=require(_0xbd6f('0x2'));var BPromise=require(_0xbd6f('0x3'));var Mustache=require(_0xbd6f('0x4'));var util=require('util');var path=require(_0xbd6f('0x5'));var sox=require(_0xbd6f('0x6'));var csv=require('to-csv');var ejs=require(_0xbd6f('0x7'));var fs=require('fs');var fs_extra=require(_0xbd6f('0x8'));var _=require(_0xbd6f('0x9'));var squel=require('squel');var crypto=require(_0xbd6f('0xa'));var jsforce=require(_0xbd6f('0xb'));var deskjs=require(_0xbd6f('0xc'));var toCsv=require(_0xbd6f('0xd'));var querystring=require('querystring');var Papa=require(_0xbd6f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd6f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd6f('0x10'))(_0xbd6f('0x11'));var utils=require(_0xbd6f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbd6f('0x13'));var db=require(_0xbd6f('0x14'))['db'];config[_0xbd6f('0x15')]=_[_0xbd6f('0x16')](config[_0xbd6f('0x15')],{'host':_0xbd6f('0x17'),'port':0x18eb});var socket=require(_0xbd6f('0x18'))(new Redis(config[_0xbd6f('0x15')]));require(_0xbd6f('0x19'))[_0xbd6f('0x1a')](socket);var jayson=require(_0xbd6f('0x1b'));var client=jayson['client'][_0xbd6f('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xbd6f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x32446c,_0x3bd11c,_0x19bda2,_0x449a20){return new BPromise(function(_0x5f316d,_0x594593){var _0x18d05f=_0x449a20||client;return _0x18d05f['request'](_0x32446c,_0x19bda2)[_0xbd6f('0x1d')](function(_0x5d13bb){logger[_0xbd6f('0x1e')](_0xbd6f('0x1f'),_0x3bd11c,_0xbd6f('0x20'));logger[_0xbd6f('0x21')](_0xbd6f('0x22'),_0x3bd11c,_0xbd6f('0x20'),JSON[_0xbd6f('0x23')](_0x5d13bb));if(_0x5d13bb[_0xbd6f('0x24')]){if(_0x5d13bb[_0xbd6f('0x24')][_0xbd6f('0x25')]===0x1f4){logger[_0xbd6f('0x24')](_0xbd6f('0x1f'),_0x3bd11c,_0x5d13bb[_0xbd6f('0x24')][_0xbd6f('0x26')]);return _0x594593(_0x5d13bb['error'][_0xbd6f('0x26')]);}logger[_0xbd6f('0x24')]('FaxAccount,\x20%s,\x20%s',_0x3bd11c,_0x5d13bb[_0xbd6f('0x24')][_0xbd6f('0x26')]);return _0x5f316d(_0x5d13bb[_0xbd6f('0x24')]['message']);}else{logger[_0xbd6f('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x3bd11c,'request\x20sent');_0x5f316d(_0x5d13bb['result'][_0xbd6f('0x26')]);}})[_0xbd6f('0x27')](function(_0x31b494){logger[_0xbd6f('0x24')](_0xbd6f('0x1f'),_0x3bd11c,_0x31b494);_0x594593(_0x31b494);});});}function respondWithStatusCode(_0x13445e,_0x3a7291){_0x3a7291=_0x3a7291||0xcc;return function(_0x4392db){if(_0x4392db){return _0x13445e['sendStatus'](_0x3a7291);}return _0x13445e['status'](_0x3a7291)[_0xbd6f('0x28')]();};}function respondWithResult(_0x15cf1b,_0x3e468c){_0x3e468c=_0x3e468c||0xc8;return function(_0x184ad6){if(_0x184ad6){return _0x15cf1b[_0xbd6f('0x29')](_0x3e468c)[_0xbd6f('0x2a')](_0x184ad6);}};}function respondWithFilteredResult(_0x177c49,_0x43eff4){return function(_0x5168a0){if(_0x5168a0){var _0x4f89b8=typeof _0x43eff4[_0xbd6f('0x2b')]===_0xbd6f('0x2c')&&typeof _0x43eff4[_0xbd6f('0x2d')]===_0xbd6f('0x2c');var _0x384012=_0x5168a0[_0xbd6f('0x2e')];var _0x4af51=_0x4f89b8?0x0:_0x43eff4['offset'];var _0x252757=_0x4f89b8?_0x5168a0[_0xbd6f('0x2e')]:_0x43eff4['offset']+_0x43eff4[_0xbd6f('0x2d')];var _0x3cdf21;if(_0x252757>=_0x384012){_0x252757=_0x384012;_0x3cdf21=0xc8;}else{_0x3cdf21=0xce;}_0x177c49['status'](_0x3cdf21);return _0x177c49[_0xbd6f('0x2f')](_0xbd6f('0x30'),_0x4af51+'-'+_0x252757+'/'+_0x384012)['json'](_0x5168a0);}return null;};}function patchUpdates(_0x43edbc){return function(_0x4897da){try{jsonpatch[_0xbd6f('0x31')](_0x4897da,_0x43edbc,!![]);}catch(_0x32606f){return BPromise[_0xbd6f('0x32')](_0x32606f);}return _0x4897da[_0xbd6f('0x33')]();};}function saveUpdates(_0x4d78d9,_0x142f72){return function(_0x4e06cd){if(_0x4e06cd){return _0x4e06cd[_0xbd6f('0x34')](_0x4d78d9)['then'](function(_0x5da8f1){return _0x5da8f1;});}return null;};}function removeEntity(_0x550c2a,_0x2ce8){return function(_0x115f37){if(_0x115f37){return _0x115f37[_0xbd6f('0x35')]()[_0xbd6f('0x1d')](function(){var _0x19912c=_0x115f37[_0xbd6f('0x36')]({'plain':!![]});var _0x556b8c=_0xbd6f('0x37');return db['UserProfileResource'][_0xbd6f('0x35')]({'where':{'type':_0x556b8c,'resourceId':_0x19912c['id']}})['then'](function(){return _0x115f37;});})[_0xbd6f('0x1d')](function(){_0x550c2a[_0xbd6f('0x29')](0xcc)[_0xbd6f('0x28')]();});}};}function handleEntityNotFound(_0xcf1ad1,_0x3d34e8){return function(_0x3a7fe8){if(!_0x3a7fe8){_0xcf1ad1['sendStatus'](0x194);}return _0x3a7fe8;};}function handleError(_0x136e97,_0x46bf2a){_0x46bf2a=_0x46bf2a||0x1f4;return function(_0x1314f2){logger[_0xbd6f('0x24')](_0x1314f2[_0xbd6f('0x38')]);if(_0x1314f2[_0xbd6f('0x39')]){delete _0x1314f2[_0xbd6f('0x39')];}_0x136e97['status'](_0x46bf2a)[_0xbd6f('0x3a')](_0x1314f2);};}exports['index']=function(_0x297dba,_0x4ebd3b){var _0x5658e2={'include':[{'model':db[_0xbd6f('0x3b')],'as':_0xbd6f('0x3c')}]},_0x335770={},_0x4641f9={'count':0x0,'rows':[]};var _0x39be2f=_[_0xbd6f('0x3d')](db[_0xbd6f('0x3e')][_0xbd6f('0x3f')],function(_0x5d08a7){return{'name':_0x5d08a7['fieldName'],'type':_0x5d08a7[_0xbd6f('0x40')][_0xbd6f('0x41')]};});_0x335770[_0xbd6f('0x42')]=_[_0xbd6f('0x3d')](_0x39be2f,_0xbd6f('0x39'));_0x335770['query']=_[_0xbd6f('0x43')](_0x297dba[_0xbd6f('0x44')]);_0x335770[_0xbd6f('0x45')]=_[_0xbd6f('0x46')](_0x335770[_0xbd6f('0x42')],_0x335770[_0xbd6f('0x44')]);_0x5658e2[_0xbd6f('0x47')]=_[_0xbd6f('0x46')](_0x335770[_0xbd6f('0x42')],qs['fields'](_0x297dba[_0xbd6f('0x44')]['fields']));_0x5658e2['attributes']=_0x5658e2[_0xbd6f('0x47')]['length']?_0x5658e2[_0xbd6f('0x47')]:_0x335770['model'];if(!_0x297dba[_0xbd6f('0x44')][_0xbd6f('0x48')]('nolimit')){_0x5658e2[_0xbd6f('0x2d')]=qs['limit'](_0x297dba[_0xbd6f('0x44')][_0xbd6f('0x2d')]);_0x5658e2[_0xbd6f('0x2b')]=qs['offset'](_0x297dba[_0xbd6f('0x44')][_0xbd6f('0x2b')]);}_0x5658e2[_0xbd6f('0x49')]=qs[_0xbd6f('0x4a')](_0x297dba[_0xbd6f('0x44')][_0xbd6f('0x4a')]);_0x5658e2[_0xbd6f('0x4b')]=qs[_0xbd6f('0x45')](_['pick'](_0x297dba['query'],_0x335770['filters']),_0x39be2f);if(_0x297dba[_0xbd6f('0x44')][_0xbd6f('0x4c')]){_0x5658e2[_0xbd6f('0x4b')]=_[_0xbd6f('0x4d')](_0x5658e2[_0xbd6f('0x4b')],{'$or':_[_0xbd6f('0x3d')](_0x39be2f,function(_0x2e4f2c){if(_0x2e4f2c[_0xbd6f('0x40')]!=='VIRTUAL'){var _0xa1a0be={};_0xa1a0be[_0x2e4f2c['name']]={'$like':'%'+_0x297dba['query'][_0xbd6f('0x4c')]+'%'};return _0xa1a0be;}})});}_0x5658e2=_[_0xbd6f('0x4d')]({},_0x5658e2,_0x297dba['options']);var _0x49353e={'where':_0x5658e2[_0xbd6f('0x4b')]};return db[_0xbd6f('0x3e')][_0xbd6f('0x2e')](_0x49353e)['then'](function(_0x1ec294){_0x4641f9[_0xbd6f('0x2e')]=_0x1ec294;if(_0x297dba['query']['includeAll']){_0x5658e2[_0xbd6f('0x4e')]=[{'all':!![]}];}return db[_0xbd6f('0x3e')][_0xbd6f('0x4f')](_0x5658e2);})[_0xbd6f('0x1d')](function(_0x5e2cf7){_0x4641f9[_0xbd6f('0x50')]=_0x5e2cf7;return _0x4641f9;})[_0xbd6f('0x1d')](respondWithFilteredResult(_0x4ebd3b,_0x5658e2))[_0xbd6f('0x27')](handleError(_0x4ebd3b,null));};exports['show']=function(_0x42ae8e,_0x2cce1f){var _0x2b3250={'raw':![],'where':{'id':_0x42ae8e[_0xbd6f('0x51')]['id']},'include':[{'model':db[_0xbd6f('0x3b')],'as':_0xbd6f('0x3c')}]},_0x14b3fa={};_0x14b3fa[_0xbd6f('0x42')]=_['keys'](db[_0xbd6f('0x3e')][_0xbd6f('0x3f')]);_0x14b3fa[_0xbd6f('0x44')]=_[_0xbd6f('0x43')](_0x42ae8e[_0xbd6f('0x44')]);_0x14b3fa[_0xbd6f('0x45')]=_[_0xbd6f('0x46')](_0x14b3fa[_0xbd6f('0x42')],_0x14b3fa[_0xbd6f('0x44')]);_0x2b3250[_0xbd6f('0x47')]=_[_0xbd6f('0x46')](_0x14b3fa[_0xbd6f('0x42')],qs[_0xbd6f('0x52')](_0x42ae8e[_0xbd6f('0x44')][_0xbd6f('0x52')]));_0x2b3250[_0xbd6f('0x47')]=_0x2b3250['attributes']['length']?_0x2b3250[_0xbd6f('0x47')]:_0x14b3fa[_0xbd6f('0x42')];if(_0x42ae8e['query'][_0xbd6f('0x53')]){_0x2b3250[_0xbd6f('0x4e')]=[{'all':!![]}];}_0x2b3250=_[_0xbd6f('0x4d')]({},_0x2b3250,_0x42ae8e[_0xbd6f('0x54')]);return db[_0xbd6f('0x3e')]['find'](_0x2b3250)[_0xbd6f('0x1d')](handleEntityNotFound(_0x2cce1f,null))[_0xbd6f('0x1d')](respondWithResult(_0x2cce1f,null))[_0xbd6f('0x27')](handleError(_0x2cce1f,null));};exports[_0xbd6f('0x55')]=function(_0x5a3073,_0x3d9b6f){return db[_0xbd6f('0x3e')][_0xbd6f('0x55')](_0x5a3073[_0xbd6f('0x56')],{})['then'](function(_0x21c0f8){var _0x594689=_0x5a3073[_0xbd6f('0x57')][_0xbd6f('0x36')]({'plain':!![]});if(!_0x594689)throw new Error(_0xbd6f('0x58'));if(_0x594689[_0xbd6f('0x59')]===_0xbd6f('0x57')){var _0x27acec=_0x21c0f8[_0xbd6f('0x36')]({'plain':!![]});var _0x359871=_0xbd6f('0x37');return db[_0xbd6f('0x5a')][_0xbd6f('0x5b')]({'where':{'name':_0x359871,'userProfileId':_0x594689[_0xbd6f('0x5c')]},'raw':!![]})[_0xbd6f('0x1d')](function(_0x3efc38){if(_0x3efc38&&_0x3efc38['autoAssociation']===0x0){return db['UserProfileResource'][_0xbd6f('0x55')]({'name':_0x27acec[_0xbd6f('0x39')],'resourceId':_0x27acec['id'],'type':_0x3efc38[_0xbd6f('0x39')],'sectionId':_0x3efc38['id']},{})[_0xbd6f('0x1d')](function(){return _0x21c0f8;});}else{return _0x21c0f8;}})[_0xbd6f('0x27')](function(_0x31ca41){logger['error'](_0xbd6f('0x5d'),_0x31ca41);throw _0x31ca41;});}return _0x21c0f8;})[_0xbd6f('0x1d')](respondWithResult(_0x3d9b6f,0xc9))[_0xbd6f('0x27')](handleError(_0x3d9b6f,null));};exports[_0xbd6f('0x34')]=function(_0x542b59,_0x2bc36e){if(_0x542b59[_0xbd6f('0x56')]['id']){delete _0x542b59['body']['id'];}return db[_0xbd6f('0x3e')][_0xbd6f('0x5b')]({'where':{'id':_0x542b59[_0xbd6f('0x51')]['id']},'include':[{'model':db[_0xbd6f('0x3b')],'as':_0xbd6f('0x3c')}]})[_0xbd6f('0x1d')](handleEntityNotFound(_0x2bc36e,null))[_0xbd6f('0x1d')](saveUpdates(_0x542b59[_0xbd6f('0x56')],null))[_0xbd6f('0x1d')](respondWithResult(_0x2bc36e,null))[_0xbd6f('0x27')](handleError(_0x2bc36e,null));};exports['destroy']=function(_0x1c068a,_0x3539cd){return db[_0xbd6f('0x3e')][_0xbd6f('0x5b')]({'where':{'id':_0x1c068a[_0xbd6f('0x51')]['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x3539cd,null))[_0xbd6f('0x1d')](removeEntity(_0x3539cd,null))[_0xbd6f('0x27')](handleError(_0x3539cd,null));};exports[_0xbd6f('0x5e')]=function(_0x10ff93,_0x5ba2f5){return db['FaxAccount'][_0xbd6f('0x5e')]()[_0xbd6f('0x1d')](respondWithResult(_0x5ba2f5,null))[_0xbd6f('0x27')](handleError(_0x5ba2f5,null));};exports[_0xbd6f('0x5f')]=function(_0x346072,_0x5227b9,_0x26988c){if(_0x346072[_0xbd6f('0x56')]['id']){delete _0x346072['body']['id'];}return db[_0xbd6f('0x3e')][_0xbd6f('0x5b')]({'where':{'id':_0x346072[_0xbd6f('0x51')]['id']}})['then'](handleEntityNotFound(_0x5227b9,null))[_0xbd6f('0x1d')](function(_0x3a0c5a){if(_0x3a0c5a){_0x346072[_0xbd6f('0x56')]['FaxAccountId']=_0x3a0c5a['id'];return db['Disposition']['create'](_0x346072['body']);}})[_0xbd6f('0x1d')](respondWithResult(_0x5227b9,null))[_0xbd6f('0x27')](handleError(_0x5227b9,null));};exports[_0xbd6f('0x60')]=function(_0x478f87,_0x145eb7,_0x335fdc){var _0x5c3fe9={'raw':![],'where':{}};var _0x4fd8e6={};var _0xbfeacb={'count':0x0,'rows':[]};return db[_0xbd6f('0x3e')][_0xbd6f('0x61')]({'where':{'id':_0x478f87[_0xbd6f('0x51')]['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x145eb7,null))[_0xbd6f('0x1d')](function(_0x550fb6){if(_0x550fb6){_0x4fd8e6[_0xbd6f('0x42')]=_[_0xbd6f('0x43')](db['Disposition'][_0xbd6f('0x3f')]);_0x4fd8e6[_0xbd6f('0x44')]=_[_0xbd6f('0x43')](_0x478f87[_0xbd6f('0x44')]);_0x4fd8e6['filters']=_[_0xbd6f('0x46')](_0x4fd8e6['model'],_0x4fd8e6[_0xbd6f('0x44')]);_0x5c3fe9[_0xbd6f('0x47')]=_[_0xbd6f('0x46')](_0x4fd8e6[_0xbd6f('0x42')],qs[_0xbd6f('0x52')](_0x478f87[_0xbd6f('0x44')][_0xbd6f('0x52')]));_0x5c3fe9['attributes']=_0x5c3fe9[_0xbd6f('0x47')][_0xbd6f('0x62')]?_0x5c3fe9[_0xbd6f('0x47')]:_0x4fd8e6[_0xbd6f('0x42')];if(!_0x478f87['query'][_0xbd6f('0x48')](_0xbd6f('0x63'))){_0x5c3fe9[_0xbd6f('0x2d')]=qs[_0xbd6f('0x2d')](_0x478f87[_0xbd6f('0x44')]['limit']);_0x5c3fe9[_0xbd6f('0x2b')]=qs[_0xbd6f('0x2b')](_0x478f87[_0xbd6f('0x44')]['offset']);}_0x5c3fe9[_0xbd6f('0x49')]=qs[_0xbd6f('0x4a')](_0x478f87['query']['sort']);_0x5c3fe9[_0xbd6f('0x4b')]=qs[_0xbd6f('0x45')](_[_0xbd6f('0x64')](_0x478f87[_0xbd6f('0x44')],_0x4fd8e6['filters']));_0x5c3fe9[_0xbd6f('0x4b')][_0xbd6f('0x65')]=_0x550fb6['id'];if(_0x478f87[_0xbd6f('0x44')]['filter']){_0x5c3fe9[_0xbd6f('0x4b')]=_[_0xbd6f('0x4d')](_0x5c3fe9['where'],{'$or':_['map'](_0x5c3fe9[_0xbd6f('0x47')],function(_0x5bf502){var _0x408310={};_0x408310[_0x5bf502]={'$like':'%'+_0x478f87[_0xbd6f('0x44')][_0xbd6f('0x4c')]+'%'};return _0x408310;})});}_0x5c3fe9=_[_0xbd6f('0x4d')]({},_0x5c3fe9,_0x478f87[_0xbd6f('0x54')]);return db[_0xbd6f('0x66')][_0xbd6f('0x2e')]({'where':_0x5c3fe9[_0xbd6f('0x4b')]})[_0xbd6f('0x1d')](function(_0x1e261b){_0xbfeacb[_0xbd6f('0x2e')]=_0x1e261b;if(_0x478f87[_0xbd6f('0x44')]['includeAll']){_0x5c3fe9['include']=[{'all':!![]}];}return db[_0xbd6f('0x66')][_0xbd6f('0x4f')](_0x5c3fe9);})[_0xbd6f('0x1d')](function(_0x50b569){_0xbfeacb[_0xbd6f('0x50')]=_0x50b569;return _0xbfeacb;});}})[_0xbd6f('0x1d')](respondWithFilteredResult(_0x145eb7,_0x5c3fe9))['catch'](handleError(_0x145eb7,null));};exports[_0xbd6f('0x67')]=function(_0x5488be,_0x5e1431,_0x4da81a){return db['FaxAccount'][_0xbd6f('0x5b')]({'where':{'id':_0x5488be['params']['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x5e1431,null))[_0xbd6f('0x1d')](function(_0x315f61){if(_0x315f61){return _0x315f61[_0xbd6f('0x67')](_0x5488be[_0xbd6f('0x44')][_0xbd6f('0x68')]);}})[_0xbd6f('0x1d')](respondWithStatusCode(_0x5e1431,null))[_0xbd6f('0x27')](handleError(_0x5e1431,null));};exports[_0xbd6f('0x69')]=function(_0x15ed6a,_0x31d166,_0x5af83d){if(_0x15ed6a['body']['id']){delete _0x15ed6a['body']['id'];}return db[_0xbd6f('0x3e')][_0xbd6f('0x5b')]({'where':{'id':_0x15ed6a[_0xbd6f('0x51')]['id']}})['then'](handleEntityNotFound(_0x31d166,null))[_0xbd6f('0x1d')](function(_0x4f9287){if(_0x4f9287){_0x15ed6a[_0xbd6f('0x56')][_0xbd6f('0x65')]=_0x4f9287['id'];return db[_0xbd6f('0x6a')][_0xbd6f('0x55')](_0x15ed6a[_0xbd6f('0x56')]);}})[_0xbd6f('0x1d')](respondWithResult(_0x31d166,null))[_0xbd6f('0x27')](handleError(_0x31d166,null));};exports[_0xbd6f('0x6b')]=function(_0x4a77ed,_0x5140c5,_0xa719b5){var _0x8fe0fa={'raw':![],'where':{}};var _0x4e55eb={};var _0x1a4f70={'count':0x0,'rows':[]};return db[_0xbd6f('0x3e')][_0xbd6f('0x61')]({'where':{'id':_0x4a77ed[_0xbd6f('0x51')]['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x5140c5,null))['then'](function(_0x3f51ba){if(_0x3f51ba){_0x4e55eb[_0xbd6f('0x42')]=_['keys'](db[_0xbd6f('0x6a')][_0xbd6f('0x3f')]);_0x4e55eb['query']=_['keys'](_0x4a77ed[_0xbd6f('0x44')]);_0x4e55eb['filters']=_[_0xbd6f('0x46')](_0x4e55eb[_0xbd6f('0x42')],_0x4e55eb[_0xbd6f('0x44')]);_0x8fe0fa[_0xbd6f('0x47')]=_[_0xbd6f('0x46')](_0x4e55eb[_0xbd6f('0x42')],qs[_0xbd6f('0x52')](_0x4a77ed[_0xbd6f('0x44')]['fields']));_0x8fe0fa[_0xbd6f('0x47')]=_0x8fe0fa[_0xbd6f('0x47')]['length']?_0x8fe0fa[_0xbd6f('0x47')]:_0x4e55eb[_0xbd6f('0x42')];if(!_0x4a77ed['query'][_0xbd6f('0x48')](_0xbd6f('0x63'))){_0x8fe0fa[_0xbd6f('0x2d')]=qs[_0xbd6f('0x2d')](_0x4a77ed[_0xbd6f('0x44')][_0xbd6f('0x2d')]);_0x8fe0fa[_0xbd6f('0x2b')]=qs[_0xbd6f('0x2b')](_0x4a77ed['query']['offset']);}_0x8fe0fa[_0xbd6f('0x49')]=qs[_0xbd6f('0x4a')](_0x4a77ed[_0xbd6f('0x44')][_0xbd6f('0x4a')]);_0x8fe0fa[_0xbd6f('0x4b')]=qs[_0xbd6f('0x45')](_[_0xbd6f('0x64')](_0x4a77ed[_0xbd6f('0x44')],_0x4e55eb['filters']));_0x8fe0fa[_0xbd6f('0x4b')]['FaxAccountId']=_0x3f51ba['id'];if(_0x4a77ed[_0xbd6f('0x44')][_0xbd6f('0x4c')]){_0x8fe0fa[_0xbd6f('0x4b')]=_[_0xbd6f('0x4d')](_0x8fe0fa[_0xbd6f('0x4b')],{'$or':_[_0xbd6f('0x3d')](_0x8fe0fa[_0xbd6f('0x47')],function(_0x5adbab){var _0x2cb03e={};_0x2cb03e[_0x5adbab]={'$like':'%'+_0x4a77ed['query'][_0xbd6f('0x4c')]+'%'};return _0x2cb03e;})});}_0x8fe0fa=_[_0xbd6f('0x4d')]({},_0x8fe0fa,_0x4a77ed[_0xbd6f('0x54')]);return db[_0xbd6f('0x6a')][_0xbd6f('0x2e')]({'where':_0x8fe0fa['where']})[_0xbd6f('0x1d')](function(_0x5854d2){_0x1a4f70[_0xbd6f('0x2e')]=_0x5854d2;if(_0x4a77ed[_0xbd6f('0x44')][_0xbd6f('0x53')]){_0x8fe0fa['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x8fe0fa);})[_0xbd6f('0x1d')](function(_0x457283){_0x1a4f70[_0xbd6f('0x50')]=_0x457283;return _0x1a4f70;});}})[_0xbd6f('0x1d')](respondWithFilteredResult(_0x5140c5,_0x8fe0fa))[_0xbd6f('0x27')](handleError(_0x5140c5,null));};exports[_0xbd6f('0x6c')]=function(_0x3eeed6,_0x1f3131,_0x4a0327){return db[_0xbd6f('0x3e')][_0xbd6f('0x5b')]({'where':{'id':_0x3eeed6['params']['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x1f3131,null))['then'](function(_0x528ca7){if(_0x528ca7){return _0x528ca7[_0xbd6f('0x6c')](_0x3eeed6[_0xbd6f('0x44')][_0xbd6f('0x68')]);}})[_0xbd6f('0x1d')](respondWithStatusCode(_0x1f3131,null))[_0xbd6f('0x27')](handleError(_0x1f3131,null));};exports[_0xbd6f('0x6d')]=function(_0x42d263,_0x4b01dc,_0x56bed7){return db[_0xbd6f('0x6e')][_0xbd6f('0x5b')]({'where':{'id':_0x42d263['params']['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x4b01dc,null))[_0xbd6f('0x1d')](function(_0x575cb0){if(_0x575cb0){return _0x575cb0['addInteraction'](_0x42d263[_0xbd6f('0x56')]['ids'],_['omit'](_0x42d263[_0xbd6f('0x56')],[_0xbd6f('0x68'),'id'])||{});}})[_0xbd6f('0x1d')](respondWithResult(_0x4b01dc,null))['catch'](handleError(_0x4b01dc,null));};exports[_0xbd6f('0x6f')]=function(_0xdb5872,_0x5d812d,_0x3e4621){var _0x58c7c4={'raw':![],'where':{}};var _0x27edbc={};var _0x3a17f2={'count':0x0,'rows':[]};return db['FaxAccount'][_0xbd6f('0x61')]({'where':{'id':_0xdb5872[_0xbd6f('0x51')]['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x5d812d,null))['then'](function(_0x301e2d){if(_0x301e2d){_0x27edbc['model']=_[_0xbd6f('0x43')](db[_0xbd6f('0x6e')][_0xbd6f('0x3f')]);_0x27edbc['query']=_['keys'](_0xdb5872['query']);_0x27edbc[_0xbd6f('0x45')]=_['intersection'](_0x27edbc[_0xbd6f('0x42')],_0x27edbc[_0xbd6f('0x44')]);_0x58c7c4[_0xbd6f('0x47')]=_['intersection'](_0x27edbc[_0xbd6f('0x42')],qs[_0xbd6f('0x52')](_0xdb5872['query']['fields']));_0x58c7c4['attributes']=_0x58c7c4['attributes']['length']?_0x58c7c4[_0xbd6f('0x47')]:_0x27edbc['model'];if(!_0xdb5872['query'][_0xbd6f('0x48')](_0xbd6f('0x63'))){_0x58c7c4['limit']=qs[_0xbd6f('0x2d')](_0xdb5872[_0xbd6f('0x44')][_0xbd6f('0x2d')]);_0x58c7c4[_0xbd6f('0x2b')]=qs['offset'](_0xdb5872[_0xbd6f('0x44')]['offset']);}_0x58c7c4['order']=qs[_0xbd6f('0x4a')](_0xdb5872[_0xbd6f('0x44')][_0xbd6f('0x4a')]);_0x58c7c4[_0xbd6f('0x4b')]=qs[_0xbd6f('0x45')](_[_0xbd6f('0x64')](_0xdb5872[_0xbd6f('0x44')],_0x27edbc[_0xbd6f('0x45')]));_0x58c7c4[_0xbd6f('0x4b')][_0xbd6f('0x65')]=_0x301e2d['id'];if(_0xdb5872[_0xbd6f('0x44')][_0xbd6f('0x4c')]){_0x58c7c4[_0xbd6f('0x4b')]=_[_0xbd6f('0x4d')](_0x58c7c4[_0xbd6f('0x4b')],{'$or':_['map'](_0x58c7c4['attributes'],function(_0x22f4ec){var _0x5eee92={};_0x5eee92[_0x22f4ec]={'$like':'%'+_0xdb5872['query']['filter']+'%'};return _0x5eee92;})});}_0x58c7c4=_[_0xbd6f('0x4d')]({},_0x58c7c4,_0xdb5872[_0xbd6f('0x54')]);return db[_0xbd6f('0x6e')]['count']({'where':_0x58c7c4['where']})[_0xbd6f('0x1d')](function(_0x22e74d){_0x3a17f2[_0xbd6f('0x2e')]=_0x22e74d;if(_0xdb5872['query'][_0xbd6f('0x53')]){_0x58c7c4[_0xbd6f('0x4e')]=[{'model':db['CmContact'],'as':_0xbd6f('0x70'),'required':![]},{'model':db[_0xbd6f('0x71')],'as':_0xbd6f('0x72'),'attributes':[_0xbd6f('0x39'),_0xbd6f('0x73'),_0xbd6f('0x74')],'required':![]},{'model':db[_0xbd6f('0x75')],'as':_0xbd6f('0x76'),'attributes':['id',_0xbd6f('0x39'),_0xbd6f('0x77')],'where':_0xdb5872['query'][_0xbd6f('0x78')]?{'id':_0xdb5872[_0xbd6f('0x44')][_0xbd6f('0x78')]}:undefined,'required':_0xdb5872[_0xbd6f('0x44')][_0xbd6f('0x78')]?!![]:![]}];}return db[_0xbd6f('0x6e')][_0xbd6f('0x4f')](_0x58c7c4);})[_0xbd6f('0x1d')](function(_0x454f22){_0x3a17f2[_0xbd6f('0x50')]=_0x454f22;return _0x3a17f2;});}})['then'](respondWithFilteredResult(_0x5d812d,_0x58c7c4))[_0xbd6f('0x27')](handleError(_0x5d812d,null));};exports[_0xbd6f('0x79')]=function(_0x30e2ae,_0x46acc2,_0x282a0a){return db[_0xbd6f('0x3e')]['findOne']({'where':{'id':_0x30e2ae['params']['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x46acc2,null))['then'](function(_0x32f0a4){if(_0x32f0a4){return db[_0xbd6f('0x7a')][_0xbd6f('0x7b')](function(_0x17f9d9){return db['FaxApplication'][_0xbd6f('0x35')]({'where':{'FaxAccountId':_0x30e2ae[_0xbd6f('0x51')]['id']},'transaction':_0x17f9d9})['then'](function(_0x48ccfb){var _0x3eb57e=_[_0xbd6f('0x3d')](_0x30e2ae[_0xbd6f('0x56')],function(_0x4825e9){_0x4825e9[_0xbd6f('0x65')]=_0x30e2ae['params']['id'];return _0x4825e9;});return db[_0xbd6f('0x7c')][_0xbd6f('0x7d')](_0x3eb57e,{'transaction':_0x17f9d9});});})[_0xbd6f('0x1d')](function(){return db[_0xbd6f('0x7c')][_0xbd6f('0x7e')]({'where':{'FaxAccountId':_0x30e2ae['params']['id']},'order':_0xbd6f('0x7f')});});}})[_0xbd6f('0x1d')](respondWithResult(_0x46acc2,null))[_0xbd6f('0x27')](handleError(_0x46acc2,null));};exports[_0xbd6f('0x80')]=function(_0x431cee,_0x44ca82,_0x4970c4){var _0x182e11={};var _0x1328ed={};var _0x59567a;var _0xbfde5e;return db['FaxAccount'][_0xbd6f('0x61')]({'where':{'id':_0x431cee[_0xbd6f('0x51')]['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x44ca82,null))[_0xbd6f('0x1d')](function(_0x34e7bd){if(_0x34e7bd){_0x59567a=_0x34e7bd;_0x1328ed[_0xbd6f('0x42')]=_['keys'](db[_0xbd6f('0x7c')][_0xbd6f('0x3f')]);_0x1328ed[_0xbd6f('0x44')]=_[_0xbd6f('0x43')](_0x431cee[_0xbd6f('0x44')]);_0x1328ed[_0xbd6f('0x45')]=_['intersection'](_0x1328ed[_0xbd6f('0x42')],_0x1328ed[_0xbd6f('0x44')]);_0x182e11[_0xbd6f('0x47')]=_[_0xbd6f('0x46')](_0x1328ed[_0xbd6f('0x42')],qs[_0xbd6f('0x52')](_0x431cee[_0xbd6f('0x44')][_0xbd6f('0x52')]));_0x182e11[_0xbd6f('0x47')]=_0x182e11['attributes'][_0xbd6f('0x62')]?_0x182e11[_0xbd6f('0x47')]:_0x1328ed[_0xbd6f('0x42')];_0x182e11[_0xbd6f('0x49')]=qs[_0xbd6f('0x4a')](_0x431cee[_0xbd6f('0x44')]['sort']);_0x182e11['where']=qs[_0xbd6f('0x45')](_[_0xbd6f('0x64')](_0x431cee['query'],_0x1328ed[_0xbd6f('0x45')]));if(_0x431cee[_0xbd6f('0x44')][_0xbd6f('0x4c')]){_0x182e11['where']=_[_0xbd6f('0x4d')](_0x182e11[_0xbd6f('0x4b')],{'$or':_['map'](_0x182e11['attributes'],function(_0x3a343c){var _0x5c69c0={};_0x5c69c0[_0x3a343c]={'$like':'%'+_0x431cee[_0xbd6f('0x44')][_0xbd6f('0x4c')]+'%'};return _0x5c69c0;})});}_0x182e11=_['merge']({},_0x182e11,_0x431cee[_0xbd6f('0x54')]);return _0x59567a[_0xbd6f('0x80')](_0x182e11);}})[_0xbd6f('0x1d')](function(_0xc0f6c3){if(_0xc0f6c3){_0xbfde5e=_0xc0f6c3[_0xbd6f('0x62')];if(!_0x431cee[_0xbd6f('0x44')]['hasOwnProperty'](_0xbd6f('0x63'))){_0x182e11['limit']=qs['limit'](_0x431cee['query'][_0xbd6f('0x2d')]);_0x182e11['offset']=qs[_0xbd6f('0x2b')](_0x431cee[_0xbd6f('0x44')][_0xbd6f('0x2b')]);}return _0x59567a[_0xbd6f('0x80')](_0x182e11);}})[_0xbd6f('0x1d')](function(_0x3cb6ee){if(_0x3cb6ee){return _0x3cb6ee?{'count':_0xbfde5e,'rows':_0x3cb6ee}:null;}})[_0xbd6f('0x1d')](respondWithResult(_0x44ca82,null))[_0xbd6f('0x27')](handleError(_0x44ca82,null));};function Extension(_0x41fc68,_0x270ee9,_0x304e3f,_0x45ad8c){this[_0xbd6f('0x81')]=_0xbd6f('0x82');this[_0xbd6f('0x83')]=_0x41fc68[_0xbd6f('0x84')];this[_0xbd6f('0x85')]=_0x45ad8c;this[_0xbd6f('0x40')]=_0xbd6f('0x86');this['description']=_0xbd6f('0x87');this[_0xbd6f('0x65')]=_0x41fc68['id'];this[_0xbd6f('0x7f')]=_0x270ee9;this[_0xbd6f('0x88')]=_0x304e3f;}function createExtensionsReciveFax(_0x2bcb20){var _0x9a3965=0x1;var _0x5545c7=[];_0x5545c7['push'](new Extension(_0x2bcb20,_0x9a3965,'',_0xbd6f('0x89')));_0x9a3965+=0x1;_0x5545c7['push'](new Extension(_0x2bcb20,_0x9a3965,_0xbd6f('0x8a'),_0xbd6f('0x8b')));_0x9a3965+=0x1;for(var _0xc33add in _0x2bcb20){if(_0x2bcb20['hasOwnProperty'](_0xc33add)&&(_0xc33add===_0xbd6f('0x8c')||_0xc33add===_0xbd6f('0x84')||_0xc33add===_0xbd6f('0x8d')||_0xc33add===_0xbd6f('0x8e')||_0xc33add===_0xbd6f('0x8f')||_0xc33add===_0xbd6f('0x90')||_0xc33add===_0xbd6f('0x91')||_0xc33add===_0xbd6f('0x92')||_0xc33add===_0xbd6f('0x93'))){_0x5545c7['push'](new Extension(_0x2bcb20,_0x9a3965,_0xbd6f('0x94')+_0xc33add+')='+_0x2bcb20[_0xc33add],'Set'));_0x9a3965+=0x1;}}_0x5545c7['push'](new Extension(_0x2bcb20,_0x9a3965,'6',_0xbd6f('0x95')));_0x9a3965+=0x1;_0x5545c7[_0xbd6f('0x96')](new Extension(_0x2bcb20,_0x9a3965,_0xbd6f('0x97'),_0xbd6f('0x98')));_0x9a3965=0x0;return _0x5545c7;}exports[_0xbd6f('0x99')]=function(_0x46bf05,_0x216188,_0x46dddb){var _0x5026b5;return db[_0xbd6f('0x7a')]['transaction'](function(_0x28eee7){return db[_0xbd6f('0x3e')][_0xbd6f('0x55')](_0x46bf05['body'],{'transaction':_0x28eee7})[_0xbd6f('0x1d')](function(_0x45bd81){_0x5026b5=_0x45bd81[_0xbd6f('0x36')]({'plain':!![]});return db[_0xbd6f('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x5026b5),{'transaction':_0x28eee7});});})[_0xbd6f('0x1d')](function(){return _0x5026b5;})['then'](respondWithResult(_0x216188,null))[_0xbd6f('0x27')](handleError(_0x216188,null));};exports[_0xbd6f('0x9b')]=function(_0x1c7714,_0x251989,_0x4a5392){var _0x342b43;return db[_0xbd6f('0x7a')][_0xbd6f('0x7b')](function(_0x3c49be){return db[_0xbd6f('0x3e')][_0xbd6f('0x34')](_0x1c7714['body'],{'where':{'id':_0x1c7714[_0xbd6f('0x56')]['id']},'transaction':_0x3c49be})[_0xbd6f('0x1d')](function(_0x5a7005){return db[_0xbd6f('0x9a')][_0xbd6f('0x35')]({'where':{'FaxAccountId':_0x1c7714[_0xbd6f('0x56')]['id']},'transaction':_0x3c49be})['then'](function(_0x1d288f){return db[_0xbd6f('0x9a')][_0xbd6f('0x7d')](createExtensionsReciveFax(_['omit'](_0x1c7714[_0xbd6f('0x56')],['tech',_0xbd6f('0x41'),_0xbd6f('0x9c'),_0xbd6f('0x9d'),_0xbd6f('0x9e'),_0xbd6f('0x9f')])),{'transaction':_0x3c49be});});});})['then'](function(){return db['FaxAccount']['findById'](_0x1c7714[_0xbd6f('0x56')]['id']);})['then'](respondWithResult(_0x251989,null))[_0xbd6f('0x27')](handleError(_0x251989,null));};exports[_0xbd6f('0xa0')]=function(_0x200785,_0x159de5,_0x43fa76){var _0x53f41e={'raw':!![],'where':{}};var _0x45199c={};var _0x4140c5={'count':0x0,'rows':[]};return db['FaxAccount'][_0xbd6f('0x61')]({'where':{'id':_0x200785['params']['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x159de5,null))[_0xbd6f('0x1d')](function(_0x3d6557){if(_0x3d6557){_0x45199c[_0xbd6f('0x42')]=_[_0xbd6f('0x43')](db[_0xbd6f('0xa1')][_0xbd6f('0x3f')]);_0x45199c[_0xbd6f('0x44')]=_[_0xbd6f('0x43')](_0x200785[_0xbd6f('0x44')]);_0x45199c[_0xbd6f('0x45')]=_[_0xbd6f('0x46')](_0x45199c[_0xbd6f('0x42')],_0x45199c['query']);_0x53f41e[_0xbd6f('0x47')]=_['intersection'](_0x45199c[_0xbd6f('0x42')],qs[_0xbd6f('0x52')](_0x200785['query']['fields']));_0x53f41e[_0xbd6f('0x47')]=_0x53f41e[_0xbd6f('0x47')]['length']?_0x53f41e[_0xbd6f('0x47')]:_0x45199c[_0xbd6f('0x42')];if(!_0x200785['query'][_0xbd6f('0x48')]('nolimit')){_0x53f41e['limit']=qs['limit'](_0x200785[_0xbd6f('0x44')][_0xbd6f('0x2d')]);_0x53f41e[_0xbd6f('0x2b')]=qs['offset'](_0x200785['query']['offset']);}_0x53f41e[_0xbd6f('0x49')]=qs[_0xbd6f('0x4a')](_0x200785[_0xbd6f('0x44')]['sort']);_0x53f41e[_0xbd6f('0x4b')]=qs[_0xbd6f('0x45')](_[_0xbd6f('0x64')](_0x200785['query'],_0x45199c['filters']));_0x53f41e[_0xbd6f('0x4b')][_0xbd6f('0x65')]=_0x3d6557['id'];if(_0x200785['query'][_0xbd6f('0x4c')]){_0x53f41e[_0xbd6f('0x4b')]=_[_0xbd6f('0x4d')](_0x53f41e[_0xbd6f('0x4b')],{'$or':_[_0xbd6f('0x3d')](_0x53f41e[_0xbd6f('0x47')],function(_0x49863c){var _0x2f779a={};_0x2f779a[_0x49863c]={'$like':'%'+_0x200785[_0xbd6f('0x44')]['filter']+'%'};return _0x2f779a;})});}if(_0x200785[_0xbd6f('0x44')][_0xbd6f('0xa2')]){var _0x124601=_0x200785[_0xbd6f('0x44')][_0xbd6f('0xa2')][_0xbd6f('0xa3')](',');var _0x1a1350={};_0x1a1350[_0x124601[0x0]]={'$gte':moment(_0x124601[0x1])[_0xbd6f('0xa4')](_0xbd6f('0xa5'))};_0x53f41e['where']=_['merge'](_0x53f41e[_0xbd6f('0x4b')],_0x1a1350);}_0x53f41e=_[_0xbd6f('0x4d')]({},_0x53f41e,_0x200785[_0xbd6f('0x54')]);return db[_0xbd6f('0xa1')][_0xbd6f('0x2e')]({'where':_0x53f41e[_0xbd6f('0x4b')]})[_0xbd6f('0x1d')](function(_0xe45b71){_0x4140c5[_0xbd6f('0x2e')]=_0xe45b71;if(_0x200785[_0xbd6f('0x44')]['includeAll']){_0x53f41e[_0xbd6f('0x4e')]=[{'all':!![]}];}return db[_0xbd6f('0xa1')]['findAll'](_0x53f41e);})[_0xbd6f('0x1d')](function(_0x34f8d4){_0x4140c5[_0xbd6f('0x50')]=_0x34f8d4;return _0x4140c5;});}})[_0xbd6f('0x1d')](respondWithFilteredResult(_0x159de5,_0x53f41e))[_0xbd6f('0x27')](handleError(_0x159de5,null));};exports[_0xbd6f('0x3a')]=function(_0x50aee9,_0xa0d5d0,_0x8f9aba){var _0x4f9fe7,_0x5c380a={},_0x2d8007;if(_0x50aee9[_0xbd6f('0x56')]['to']){_0x2d8007=_0x50aee9['body']['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x50aee9[_0xbd6f('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0xbd6f('0xa6'),'include':[{'model':db['CmContact'],'as':_0xbd6f('0xa7'),'where':{'fax':_0x2d8007},'limit':0x1,'order':[[_0xbd6f('0x9d'),_0xbd6f('0xa8')]]}]}]})[_0xbd6f('0x1d')](handleEntityNotFound(_0xa0d5d0,null))[_0xbd6f('0x1d')](function(_0x20a98b){_0x4f9fe7=_0x20a98b;if(_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')]&&_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][_0xbd6f('0x62')]){for(var _0x3b4d7f=0x0;_0x3b4d7f<_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][_0xbd6f('0x62')];_0x3b4d7f+=0x1){_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][_0x3b4d7f]={'filename':_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][_0x3b4d7f][_0xbd6f('0x39')],'id':_0x50aee9['body']['attachments'][_0x3b4d7f]['id'],'path':path['join'](config[_0xbd6f('0xaa')],_0xbd6f('0xab'),_0x50aee9['body'][_0xbd6f('0xa9')][_0x3b4d7f][_0xbd6f('0xac')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_['isNil'](_0x50aee9[_0xbd6f('0x51')]['id'])?undefined:_0x50aee9[_0xbd6f('0x51')]['id'],'path':_['isNil'](_0x50aee9[_0xbd6f('0x56')]['attachments'][0x0]['path'])?undefined:_0x50aee9['body'][_0xbd6f('0xa9')][0x0][_0xbd6f('0x5')],'fax':_[_0xbd6f('0xad')](_0x50aee9[_0xbd6f('0x56')]['to'][0x0])?undefined:_0x50aee9[_0xbd6f('0x56')]['to'][0x0]},client9002);})[_0xbd6f('0x1d')](function(){if(_0x4f9fe7){if(_[_0xbd6f('0xad')](_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xae')])){_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xae')]=util[_0xbd6f('0xa4')](_0xbd6f('0xaf'),_0x4f9fe7[_0xbd6f('0x39')],_0x4f9fe7[_0xbd6f('0xb0')]);}if(_0x4f9fe7[_0xbd6f('0xa6')]){if(_0x4f9fe7[_0xbd6f('0xa6')]['Contacts'][_0xbd6f('0x62')]){return _0x4f9fe7[_0xbd6f('0xa6')][_0xbd6f('0xa7')][0x0];}else{return db[_0xbd6f('0xb1')][_0xbd6f('0x55')](_['defaults'](_0x50aee9[_0xbd6f('0x56')],{'firstName':_0x50aee9[_0xbd6f('0x56')]['to'][0x0],'phone':_0x50aee9[_0xbd6f('0x56')]['to'][0x0],'fax':_0x50aee9[_0xbd6f('0x56')]['to'][0x0],'ListId':_0x4f9fe7[_0xbd6f('0x9f')]}));}}else{throw new Error(_0xbd6f('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xbd6f('0x1d')](function(_0x16db81){if(_0x16db81){return db[_0xbd6f('0x6e')][_0xbd6f('0x5b')]({'where':{'ContactId':_0x16db81['id'],'closed':![],'FaxAccountId':_0x4f9fe7['id']}})[_0xbd6f('0x1d')](function(_0x45e11e){if(_0x45e11e){return[_0x45e11e,![]];}return db[_0xbd6f('0x6e')][_0xbd6f('0x55')]({'UserId':_0x50aee9[_0xbd6f('0x57')]['id'],'ContactId':_0x16db81['id'],'FaxAccountId':_0x4f9fe7['id'],'fax':_0x50aee9[_0xbd6f('0x56')]['to'][0x0],'firstMsgDirection':_0xbd6f('0xb3'),'Messages':[_[_0xbd6f('0x4d')](_0x50aee9['body'],{'read':![],'body':_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][0x0][_0xbd6f('0xb4')],'FaxAccountId':_0x4f9fe7['id'],'UserId':_0x50aee9[_0xbd6f('0x57')]['id'],'ContactId':_0x16db81['id'],'AttachmentId':_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0xbd6f('0xa1')],'as':'Messages'}]})[_0xbd6f('0x1d')](function(_0x3b7052){return[_0x3b7052,!![]];});});}else{throw new Error(_0xbd6f('0xb5'));}})[_0xbd6f('0xb6')](function(_0x4deed7,_0x435996){if(_0x435996){return _0x4deed7;}return db['FaxMessage']['create']({'direction':_0xbd6f('0xb3'),'read':![],'body':_0x50aee9[_0xbd6f('0x56')]['attachments'][0x0][_0xbd6f('0xb4')],'FaxAccountId':_0x4f9fe7['id'],'FaxInteractionId':_0x4deed7['id'],'UserId':_0x50aee9[_0xbd6f('0x57')]['id'],'ContactId':_0x4deed7['ContactId'],'AttachmentId':_0x50aee9[_0xbd6f('0x56')]['attachments'][0x0]['id']})[_0xbd6f('0x1d')](function(_0x51aa8b){_0x4deed7[_0xbd6f('0xb7')][_0xbd6f('0xb8')]=[];_0x4deed7[_0xbd6f('0xb7')][_0xbd6f('0xb8')]['push'](_0x51aa8b[_0xbd6f('0xb7')]);return _0x4deed7;});})[_0xbd6f('0x1d')](function(_0x210482){respondWithRpcPromise(_0xbd6f('0xb9'),_0xbd6f('0xb9'),{'FaxAccountId':_[_0xbd6f('0xad')](_0x50aee9[_0xbd6f('0x51')]['id'])?undefined:_0x50aee9[_0xbd6f('0x51')]['id'],'path':_[_0xbd6f('0xad')](_0x50aee9['body'][_0xbd6f('0xa9')][0x0][_0xbd6f('0x5')])?undefined:_0x50aee9['body'][_0xbd6f('0xa9')][0x0][_0xbd6f('0x5')],'fax':_[_0xbd6f('0xad')](_0x50aee9['body']['to'][0x0])?undefined:_0x50aee9[_0xbd6f('0x56')]['to'][0x0],'AttachmentId':_0x50aee9[_0xbd6f('0x56')][_0xbd6f('0xa9')][0x0]['id']},client9002)[_0xbd6f('0x1d')](function(_0x37fe46){logger['info'](_0xbd6f('0xba'),_0x37fe46);})[_0xbd6f('0x27')](function(_0x245c27){logger[_0xbd6f('0x1e')](_0xbd6f('0xba'),_0x245c27);});return _0x210482;})[_0xbd6f('0x1d')](respondWithResult(_0xa0d5d0,null))[_0xbd6f('0x27')](handleError(_0xa0d5d0,null));};exports[_0xbd6f('0xbb')]=function(_0x1306f5,_0x1d8e01,_0x44992e){return db[_0xbd6f('0x3e')]['find']({'where':{'id':_0x1306f5[_0xbd6f('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d8e01,null))[_0xbd6f('0x1d')](function(_0x43f69c){if(_0x43f69c){return _0x43f69c['addAgents'](_0x1306f5['body'][_0xbd6f('0x68')],_['omit'](_0x1306f5['body'],[_0xbd6f('0x68'),'id'])||{})[_0xbd6f('0xb6')](function(_0x381361){for(var _0x2df9f1=0x0;_0x2df9f1<_0x1306f5[_0xbd6f('0x56')][_0xbd6f('0x68')]['length'];_0x2df9f1+=0x1){socket[_0xbd6f('0xbc')](_0xbd6f('0xbd'),{'UserId':Number(_0x1306f5[_0xbd6f('0x56')][_0xbd6f('0x68')][_0x2df9f1]),'FaxAccountId':Number(_0x1306f5[_0xbd6f('0x51')]['id'])});}return _0x381361;});}})['then'](respondWithResult(_0x1d8e01,null))[_0xbd6f('0x27')](handleError(_0x1d8e01,null));};exports[_0xbd6f('0xbe')]=function(_0x1584c2,_0x1c8632,_0x277a48){return db[_0xbd6f('0x3e')][_0xbd6f('0x5b')]({'where':{'id':_0x1584c2[_0xbd6f('0x51')]['id']}})['then'](handleEntityNotFound(_0x1c8632,null))[_0xbd6f('0x1d')](function(_0x3acc41){if(_0x3acc41){return _0x3acc41['removeAgents'](_0x1584c2[_0xbd6f('0x44')]['ids'])[_0xbd6f('0x1d')](function(){if(_[_0xbd6f('0xbf')](_0x1584c2[_0xbd6f('0x44')][_0xbd6f('0x68')])){for(var _0x536c23=0x0;_0x536c23<_0x1584c2[_0xbd6f('0x44')][_0xbd6f('0x68')]['length'];_0x536c23+=0x1){socket[_0xbd6f('0xbc')](_0xbd6f('0xc0'),{'UserId':Number(_0x1584c2[_0xbd6f('0x44')][_0xbd6f('0x68')][_0x536c23]),'FaxAccountId':Number(_0x1584c2['params']['id'])});}}else{socket[_0xbd6f('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x1584c2[_0xbd6f('0x44')][_0xbd6f('0x68')]),'FaxAccountId':Number(_0x1584c2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1c8632,null))[_0xbd6f('0x27')](handleError(_0x1c8632,null));};exports[_0xbd6f('0xc1')]=function(_0x45ad6f,_0x3e2490,_0x4c473b){var _0x4b878e={};var _0x5f5640={};var _0x55bed5;var _0xdf10ff;return db[_0xbd6f('0x3e')]['findOne']({'where':{'id':_0x45ad6f['params']['id']}})[_0xbd6f('0x1d')](handleEntityNotFound(_0x3e2490,null))[_0xbd6f('0x1d')](function(_0x30c643){if(_0x30c643){_0x55bed5=_0x30c643;_0x5f5640[_0xbd6f('0x42')]=_[_0xbd6f('0x43')](db[_0xbd6f('0x71')][_0xbd6f('0x3f')]);_0x5f5640[_0xbd6f('0x44')]=_[_0xbd6f('0x43')](_0x45ad6f['query']);_0x5f5640['filters']=_[_0xbd6f('0x46')](_0x5f5640[_0xbd6f('0x42')],_0x5f5640[_0xbd6f('0x44')]);_0x4b878e[_0xbd6f('0x47')]=_['intersection'](_0x5f5640[_0xbd6f('0x42')],qs['fields'](_0x45ad6f['query']['fields']));_0x4b878e['attributes']=_0x4b878e[_0xbd6f('0x47')][_0xbd6f('0x62')]?_0x4b878e[_0xbd6f('0x47')]:_0x5f5640['model'];_0x4b878e['order']=qs[_0xbd6f('0x4a')](_0x45ad6f[_0xbd6f('0x44')][_0xbd6f('0x4a')]);_0x4b878e[_0xbd6f('0x4b')]=qs[_0xbd6f('0x45')](_['pick'](_0x45ad6f[_0xbd6f('0x44')],_0x5f5640[_0xbd6f('0x45')]));if(_0x45ad6f[_0xbd6f('0x44')]['filter']){_0x4b878e[_0xbd6f('0x4b')]=_[_0xbd6f('0x4d')](_0x4b878e[_0xbd6f('0x4b')],{'$or':_['map'](_0x4b878e[_0xbd6f('0x47')],function(_0x24b78b){var _0x310c29={};_0x310c29[_0x24b78b]={'$like':'%'+_0x45ad6f[_0xbd6f('0x44')][_0xbd6f('0x4c')]+'%'};return _0x310c29;})});}_0x4b878e=_[_0xbd6f('0x4d')]({},_0x4b878e,_0x45ad6f[_0xbd6f('0x54')]);return _0x55bed5['getAgents'](_0x4b878e);}})[_0xbd6f('0x1d')](function(_0x801ef4){if(_0x801ef4){_0xdf10ff=_0x801ef4[_0xbd6f('0x62')];if(!_0x45ad6f[_0xbd6f('0x44')]['hasOwnProperty'](_0xbd6f('0x63'))){_0x4b878e[_0xbd6f('0x2d')]=qs[_0xbd6f('0x2d')](_0x45ad6f[_0xbd6f('0x44')][_0xbd6f('0x2d')]);_0x4b878e['offset']=qs[_0xbd6f('0x2b')](_0x45ad6f['query'][_0xbd6f('0x2b')]);}return _0x55bed5[_0xbd6f('0xc1')](_0x4b878e);}})[_0xbd6f('0x1d')](function(_0x3e3ae1){if(_0x3e3ae1){return _0x3e3ae1?{'count':_0xdf10ff,'rows':_0x3e3ae1}:null;}})['then'](respondWithResult(_0x3e2490,null))[_0xbd6f('0x27')](handleError(_0x3e2490,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5b4dca4..4b902b3 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 _0x3563=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x103567,_0x53fdc3){var _0x5cf64b=function(_0x2f17bd){while(--_0x2f17bd){_0x103567['push'](_0x103567['shift']());}};_0x5cf64b(++_0x53fdc3);}(_0x3563,0x17b));var _0x3356=function(_0x2c5f38,_0x1c2350){_0x2c5f38=_0x2c5f38-0x0;var _0x5db7fc=_0x3563[_0x2c5f38];return _0x5db7fc;};'use strict';var EventEmitter=require(_0x3356('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x3356('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3356('0x2')](0x0);var events={'afterCreate':_0x3356('0x3'),'afterUpdate':_0x3356('0x4'),'afterDestroy':_0x3356('0x5')};function emitEvent(_0x4c76a2){return function(_0x48b625,_0x41ab33,_0x5ceefc){FaxAccountEvents[_0x3356('0x6')](_0x4c76a2+':'+_0x48b625['id'],_0x48b625);FaxAccountEvents['emit'](_0x4c76a2,_0x48b625);_0x5ceefc(null);};}for(var e in events){if(events[_0x3356('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x3356('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x9bdf=['../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x30b9ac,_0x318574){var _0x395a0d=function(_0x44422b){while(--_0x44422b){_0x30b9ac['push'](_0x30b9ac['shift']());}};_0x395a0d(++_0x318574);}(_0x9bdf,0x103));var _0xf9bd=function(_0x5d1761,_0x5057c2){_0x5d1761=_0x5d1761-0x0;var _0x5dccb=_0x9bdf[_0x5d1761];return _0x5dccb;};'use strict';var EventEmitter=require(_0xf9bd('0x0'));var FaxAccount=require(_0xf9bd('0x1'))['db'][_0xf9bd('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf9bd('0x3')](0x0);var events={'afterCreate':_0xf9bd('0x4'),'afterUpdate':_0xf9bd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x43959a){return function(_0x402ee6,_0x3aee03,_0x2ae7f0){FaxAccountEvents[_0xf9bd('0x6')](_0x43959a+':'+_0x402ee6['id'],_0x402ee6);FaxAccountEvents[_0xf9bd('0x6')](_0x43959a,_0x402ee6);_0x2ae7f0(null);};}for(var e in events){if(events[_0xf9bd('0x7')](e)){var event=events[e];FaxAccount[_0xf9bd('0x8')](e,emitEvent(event));}}module[_0xf9bd('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 5441c9a..50a60d8 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 _0xac28=['fax_accounts','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define','FaxAccount'];(function(_0x36b2e2,_0x424c2f){var _0xc234a1=function(_0x3d0e06){while(--_0x3d0e06){_0x36b2e2['push'](_0x36b2e2['shift']());}};_0xc234a1(++_0x424c2f);}(_0xac28,0x14b));var _0x8ac2=function(_0x1b8e29,_0x7eccc9){_0x1b8e29=_0x1b8e29-0x0;var _0x2f54f0=_0xac28[_0x1b8e29];return _0x2f54f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ac2('0x0'))(_0x8ac2('0x1'));var moment=require(_0x8ac2('0x2'));var BPromise=require(_0x8ac2('0x3'));var rp=require(_0x8ac2('0x4'));var fs=require('fs');var path=require(_0x8ac2('0x5'));var rimraf=require('rimraf');var config=require(_0x8ac2('0x6'));var attributes=require(_0x8ac2('0x7'));module['exports']=function(_0x172e74,_0x3f2f41){return _0x172e74[_0x8ac2('0x8')](_0x8ac2('0x9'),attributes,{'tableName':_0x8ac2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35a0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash','util','../../config/logger'];(function(_0xd02c35,_0x4be949){var _0x459eb0=function(_0x21973e){while(--_0x21973e){_0xd02c35['push'](_0xd02c35['shift']());}};_0x459eb0(++_0x4be949);}(_0x35a0,0x169));var _0x035a=function(_0x4eaa34,_0x37fb5b){_0x4eaa34=_0x4eaa34-0x0;var _0x20ec3c=_0x35a0[_0x4eaa34];return _0x20ec3c;};'use strict';var _=require(_0x035a('0x0'));var util=require(_0x035a('0x1'));var logger=require(_0x035a('0x2'))('api');var moment=require(_0x035a('0x3'));var BPromise=require(_0x035a('0x4'));var rp=require(_0x035a('0x5'));var fs=require('fs');var path=require(_0x035a('0x6'));var rimraf=require(_0x035a('0x7'));var config=require(_0x035a('0x8'));var attributes=require(_0x035a('0x9'));module[_0x035a('0xa')]=function(_0x48cb59,_0x53afe5){return _0x48cb59[_0x035a('0xb')](_0x035a('0xc'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index be0a1b1..8c044a8 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 _0x1be8=['Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','body','fax','describe','Sequelize','ValidationError','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','priority','FaxInteraction','create'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x1be8,0x119));var _0x81be=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0x1be8[_0x4ad0f7];return _0x30f5c8;};'use strict';var _=require(_0x81be('0x0'));var util=require(_0x81be('0x1'));var moment=require(_0x81be('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x81be('0x4'));var logger=require(_0x81be('0x5'))(_0x81be('0x6'));var config=require(_0x81be('0x7'));var jayson=require(_0x81be('0x8'));var client=jayson['client'][_0x81be('0x9')]({'port':0x232c});config[_0x81be('0xa')]=_[_0x81be('0xb')](config[_0x81be('0xa')],{'host':_0x81be('0xc'),'port':0x18eb});var socket=require(_0x81be('0xd'))(new Redis(config[_0x81be('0xa')]));require(_0x81be('0xe'))[_0x81be('0xf')](socket);function respondWithRpcPromise(_0x5081a4,_0x5704d1,_0x5b6065){return new BPromise(function(_0x2ca43a,_0x44e5e7){return client[_0x81be('0x10')](_0x5081a4,_0x5b6065)[_0x81be('0x11')](function(_0x10c092){logger[_0x81be('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5704d1,_0x81be('0x13'));logger[_0x81be('0x14')](_0x81be('0x15'),_0x5704d1,_0x81be('0x13'),JSON[_0x81be('0x16')](_0x10c092));if(_0x10c092[_0x81be('0x17')]){if(_0x10c092['error'][_0x81be('0x18')]===0x1f4){logger[_0x81be('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5704d1,_0x10c092[_0x81be('0x17')][_0x81be('0x19')]);return _0x44e5e7(_0x10c092[_0x81be('0x17')][_0x81be('0x19')]);}logger[_0x81be('0x17')](_0x81be('0x1a'),_0x5704d1,_0x10c092[_0x81be('0x17')]['message']);return _0x2ca43a(_0x10c092['error'][_0x81be('0x19')]);}else{logger[_0x81be('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5704d1,_0x81be('0x13'));_0x2ca43a(_0x10c092['result']['message']);}})[_0x81be('0x1b')](function(_0x3a5e94){logger[_0x81be('0x17')](_0x81be('0x1a'),_0x5704d1,_0x3a5e94);_0x44e5e7(_0x3a5e94);});});}exports[_0x81be('0x1c')]=function(_0x4df9e8){var _0x410a1c=this;return new Promise(function(_0x7ddeb2,_0x39f0ea){return db[_0x81be('0x1d')]['findAll']({'raw':_0x4df9e8['options']?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x1f')]===undefined?!![]:![]:!![],'where':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8['options'][_0x81be('0x20')]||null:null,'attributes':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x21')]||null:null,'limit':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x22')]||null:null,'include':_0x4df9e8[_0x81be('0x1e')]?_0x4df9e8[_0x81be('0x1e')][_0x81be('0x23')]?_[_0x81be('0x24')](_0x4df9e8[_0x81be('0x1e')][_0x81be('0x23')],function(_0x41f530){return{'model':db[_0x41f530[_0x81be('0x25')]],'as':_0x41f530['as'],'attributes':_0x41f530[_0x81be('0x21')],'include':_0x41f530[_0x81be('0x23')]?_['map'](_0x41f530[_0x81be('0x23')],function(_0x3168cf){return{'model':db[_0x3168cf[_0x81be('0x25')]],'as':_0x3168cf['as'],'attributes':_0x3168cf[_0x81be('0x21')],'include':_0x3168cf[_0x81be('0x23')]?_[_0x81be('0x24')](_0x3168cf[_0x81be('0x23')],function(_0x328a94){return{'model':db[_0x328a94[_0x81be('0x25')]],'as':_0x328a94['as'],'attributes':_0x328a94[_0x81be('0x21')]};}):[]};}):[]};}):[]:[]})[_0x81be('0x11')](function(_0x92aa35){logger[_0x81be('0x12')](_0x81be('0x1c'),_0x4df9e8);logger[_0x81be('0x14')](_0x81be('0x1c'),_0x4df9e8,JSON[_0x81be('0x16')](_0x92aa35));_0x7ddeb2(_0x92aa35);})[_0x81be('0x1b')](function(_0x3b3565){logger['error'](_0x81be('0x1c'),_0x3b3565[_0x81be('0x19')],_0x4df9e8);_0x39f0ea(_0x410a1c[_0x81be('0x17')](0x1f4,_0x3b3565[_0x81be('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x453e90,_0x3a2470,_0x165a0c){var _0x24145d=this;return new Promise(function(_0x566d9a,_0x4e927c){var _0x37d082={'body':_0x453e90[_0x81be('0x26')],'channel':_0x81be('0x27')};var _0x422c58=[];var _0x4a4251=[];var _0x593cb9={};return db['CmContact'][_0x81be('0x28')]()[_0x81be('0x11')](function(_0x4e0c9c){if(!_0x4e0c9c){throw new db[(_0x81be('0x29'))][(_0x81be('0x2a'))]('no\x20available\x20attributes');}_0x422c58=_[_0x81be('0x2b')](_[_0x81be('0x2c')](_0x4e0c9c),['createdAt',_0x81be('0x2d')]);_0x4a4251=_[_0x81be('0x2b')](_[_0x81be('0x2c')](_0x4e0c9c),[_0x81be('0x2e'),_0x81be('0x2d'),_0x81be('0x2f'),_0x81be('0x30')]);if(_0x453e90[_0x81be('0x26')]['id']){delete _0x453e90[_0x81be('0x26')]['id'];}if(_[_0x81be('0x31')](_0x453e90[_0x81be('0x26')][_0x81be('0x32')])){throw new db['Sequelize'][(_0x81be('0x2a'))](_0x81be('0x33'));}if(_[_0x81be('0x31')](_0x453e90['body']['body'])||_0x453e90['body'][_0x81be('0x26')]===''){throw new db[(_0x81be('0x29'))][(_0x81be('0x2a'))](_0x81be('0x34'));}if(_[_0x81be('0x31')](_0x453e90[_0x81be('0x26')]['mapKey'])){throw new db['Sequelize'][(_0x81be('0x2a'))](_0x81be('0x35')+_0x4a4251);}if(!_[_0x81be('0x36')](_0x4a4251,_0x453e90['body']['mapKey'])){throw new db[(_0x81be('0x29'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a4251);}_0x593cb9[_0x453e90[_0x81be('0x26')][_0x81be('0x37')]]=_0x453e90[_0x81be('0x26')][_0x81be('0x32')];})[_0x81be('0x11')](function(){return db['FaxAccount'][_0x81be('0x38')]({'where':{'id':_0x453e90[_0x81be('0x39')]['id']},'include':[{'model':db[_0x81be('0x3a')],'as':_0x81be('0x3b'),'include':[{'model':db[_0x81be('0x3c')],'as':_0x81be('0x3d'),'where':_0x593cb9,'limit':0x1,'order':[[_0x81be('0x2d'),_0x81be('0x3e')]]}]},{'model':db[_0x81be('0x3f')],'as':_0x81be('0x40')}]});})['then'](function(_0x92f1e3){if(_0x92f1e3&&_0x92f1e3[_0x81be('0x3b')]){var _0xdf1f65=_0x92f1e3[_0x81be('0x41')]({'plain':!![]});_0x37d082[_0x81be('0x39')]=_0xdf1f65;_0x37d082[_0x81be('0x42')]=_0xdf1f65[_0x81be('0x40')];_0x37d082['list']=_0xdf1f65['List'];_0x37d082[_0x81be('0x42')]=_[_0x81be('0x43')](_0x37d082['applications'],[_0x81be('0x44')],['asc']);if(_0x37d082[_0x81be('0x39')]['Applications']){delete _0x37d082[_0x81be('0x39')][_0x81be('0x40')];}if(_0x37d082['account'][_0x81be('0x3b')]&&_0x37d082[_0x81be('0x39')][_0x81be('0x3b')]['Contacts']['length']){return _0x37d082[_0x81be('0x39')][_0x81be('0x3b')][_0x81be('0x3d')][0x0];}var _0x569395=_['defaults'](_0x453e90['body'],{'firstName':_0x453e90[_0x81be('0x26')][_0x81be('0x32')],'ListId':_0xdf1f65[_0x81be('0x30')]});_0x569395[_0x453e90[_0x81be('0x26')][_0x81be('0x37')]]=_0x453e90['body'][_0x81be('0x32')];return db[_0x81be('0x3c')]['create'](_0x569395,{'fields':_0x422c58,'raw':!![]});}})[_0x81be('0x11')](function(_0x4dcbe2){_0x37d082['contact']=_0x4dcbe2;if(_0x4dcbe2){var _0x435bed={'ContactId':_0x4dcbe2['id'],'FaxAccountId':_0x453e90[_0x81be('0x39')]['id'],'fax':_0x4dcbe2[_0x81be('0x27')]};return db[_0x81be('0x45')]['find']({'where':{'ContactId':_0x4dcbe2['id'],'closed':![],'FaxAccountId':_0x453e90[_0x81be('0x39')]['id']}})[_0x81be('0x11')](function(_0x43c2d8){if(_0x43c2d8){return[_0x43c2d8,![]];}return db[_0x81be('0x45')][_0x81be('0x46')](_0x435bed)[_0x81be('0x11')](function(_0x3c2c75){return[_0x3c2c75,!![]];});});}else{throw new Error(_0x81be('0x47'));}})[_0x81be('0x48')](function(_0x56052c,_0x2e0766){var _0xc30336=_0x56052c['get']({'plain':!![]});if(_0x2e0766){if(_0x37d082[_0x81be('0x39')][_0x81be('0x49')]){_0x37d082[_0x81be('0x42')][_0x81be('0x4a')]({'id':0x0,'priority':_0x37d082[_0x81be('0x42')]['length']+0x1,'app':'close','appdata':_0x81be('0x4b'),'interval':_0x81be('0x4c')});}_0xc30336['created']=!![];}else{_0xc30336['created']=![];}_0x37d082[_0x81be('0x4d')]=_0xc30336;return db[_0x81be('0x4e')][_0x81be('0x46')]({'body':_0x453e90[_0x81be('0x26')][_0x81be('0x26')],'FaxAccountId':_0x453e90[_0x81be('0x39')]['id'],'FaxInteractionId':_0x56052c['id'],'direction':'in','ContactId':_0x56052c[_0x81be('0x4f')],'AttachmentId':_0x453e90['body'][_0x81be('0x50')]});})[_0x81be('0x11')](function(_0x2de298){_0x37d082[_0x81be('0x19')]=_0x2de298;if(_0x37d082[_0x81be('0x4d')]['UserId']){return db[_0x81be('0x51')][_0x81be('0x38')]({'attributes':['id','name'],'where':{'id':_0x37d082[_0x81be('0x4d')][_0x81be('0x52')]}})[_0x81be('0x11')](function(_0x3147f6){if(_0x3147f6){_0x37d082['applications'][_0x81be('0x53')]({'id':0x0,'priority':0x0,'app':_0x81be('0x54'),'appdata':_0x3147f6['name']+','+(_0x37d082[_0x81be('0x39')][_0x81be('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x81be('0x56'),_0x81be('0x57'),_0x37d082);});}return respondWithRpcPromise('Start',_0x81be('0x57'),_0x37d082);})['then'](function(_0x2aaece){_0x566d9a(_0x2aaece);})[_0x81be('0x1b')](function(_0x1fff22){_0x4e927c(_0x24145d['error'](0x1f4,_0x1fff22[_0x81be('0x19')]));});});}; \ No newline at end of file +var _0x1351=['info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxAccount','options','attributes','include','model','map','then','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','account','list','applications','orderBy','asc','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','length','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','name','interaction','unshift','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x1f4c0b,_0x28f740){var _0xa2eddb=function(_0x51f179){while(--_0x51f179){_0x1f4c0b['push'](_0x1f4c0b['shift']());}};_0xa2eddb(++_0x28f740);}(_0x1351,0x148));var _0x1135=function(_0xd29cff,_0x2e8786){_0xd29cff=_0xd29cff-0x0;var _0x4a8977=_0x1351[_0xd29cff];return _0x4a8977;};'use strict';var _=require('lodash');var util=require(_0x1135('0x0'));var moment=require(_0x1135('0x1'));var BPromise=require(_0x1135('0x2'));var rs=require(_0x1135('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1135('0x4'))['db'];var utils=require(_0x1135('0x5'));var logger=require(_0x1135('0x6'))(_0x1135('0x7'));var config=require('../../config/environment');var jayson=require(_0x1135('0x8'));var client=jayson[_0x1135('0x9')]['http']({'port':0x232c});config[_0x1135('0xa')]=_[_0x1135('0xb')](config[_0x1135('0xa')],{'host':_0x1135('0xc'),'port':0x18eb});var socket=require(_0x1135('0xd'))(new Redis(config[_0x1135('0xa')]));require('./faxAccount.socket')[_0x1135('0xe')](socket);function respondWithRpcPromise(_0x27602a,_0xde35d8,_0x2738f8){return new BPromise(function(_0x97ab32,_0x37c82e){return client[_0x1135('0xf')](_0x27602a,_0x2738f8)['then'](function(_0x1761c3){logger[_0x1135('0x10')](_0x1135('0x11'),_0xde35d8,_0x1135('0x12'));logger[_0x1135('0x13')](_0x1135('0x14'),_0xde35d8,'request\x20sent',JSON['stringify'](_0x1761c3));if(_0x1761c3['error']){if(_0x1761c3[_0x1135('0x15')][_0x1135('0x16')]===0x1f4){logger[_0x1135('0x15')](_0x1135('0x11'),_0xde35d8,_0x1761c3[_0x1135('0x15')][_0x1135('0x17')]);return _0x37c82e(_0x1761c3[_0x1135('0x15')][_0x1135('0x17')]);}logger['error'](_0x1135('0x11'),_0xde35d8,_0x1761c3['error'][_0x1135('0x17')]);return _0x97ab32(_0x1761c3[_0x1135('0x15')][_0x1135('0x17')]);}else{logger['info'](_0x1135('0x11'),_0xde35d8,'request\x20sent');_0x97ab32(_0x1761c3['result'][_0x1135('0x17')]);}})[_0x1135('0x18')](function(_0x2ed239){logger[_0x1135('0x15')]('FaxAccount,\x20%s,\x20%s',_0xde35d8,_0x2ed239);_0x37c82e(_0x2ed239);});});}exports[_0x1135('0x19')]=function(_0x41d45e){var _0x51c379=this;return new Promise(function(_0x52c824,_0x4bf63d){return db['FaxAccount']['findAll']({'raw':_0x41d45e['options']?_0x41d45e[_0x1135('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x41d45e[_0x1135('0x1a')]?_0x41d45e[_0x1135('0x1a')]['where']||null:null,'attributes':_0x41d45e['options']?_0x41d45e[_0x1135('0x1a')][_0x1135('0x1b')]||null:null,'limit':_0x41d45e[_0x1135('0x1a')]?_0x41d45e[_0x1135('0x1a')]['limit']||null:null,'include':_0x41d45e[_0x1135('0x1a')]?_0x41d45e[_0x1135('0x1a')][_0x1135('0x1c')]?_['map'](_0x41d45e[_0x1135('0x1a')][_0x1135('0x1c')],function(_0x267ce4){return{'model':db[_0x267ce4[_0x1135('0x1d')]],'as':_0x267ce4['as'],'attributes':_0x267ce4[_0x1135('0x1b')],'include':_0x267ce4['include']?_[_0x1135('0x1e')](_0x267ce4['include'],function(_0x5a2475){return{'model':db[_0x5a2475[_0x1135('0x1d')]],'as':_0x5a2475['as'],'attributes':_0x5a2475[_0x1135('0x1b')],'include':_0x5a2475['include']?_[_0x1135('0x1e')](_0x5a2475[_0x1135('0x1c')],function(_0x5d39dc){return{'model':db[_0x5d39dc[_0x1135('0x1d')]],'as':_0x5d39dc['as'],'attributes':_0x5d39dc[_0x1135('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1135('0x1f')](function(_0x33c0e7){logger[_0x1135('0x10')]('GetFaxAccount',_0x41d45e);logger[_0x1135('0x13')]('GetFaxAccount',_0x41d45e,JSON['stringify'](_0x33c0e7));_0x52c824(_0x33c0e7);})[_0x1135('0x18')](function(_0x34e820){logger['error'](_0x1135('0x19'),_0x34e820[_0x1135('0x17')],_0x41d45e);_0x4bf63d(_0x51c379['error'](0x1f4,_0x34e820[_0x1135('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x250136,_0x73a148,_0x53af2e){var _0x31a8dd=this;return new Promise(function(_0x4a2056,_0x41660f){var _0x4b9948={'body':_0x250136[_0x1135('0x20')],'channel':_0x1135('0x21')};var _0x36eb8d=[];var _0x225c79=[];var _0x5bceca={};return db['CmContact'][_0x1135('0x22')]()[_0x1135('0x1f')](function(_0x55753e){if(!_0x55753e){throw new db[(_0x1135('0x23'))][(_0x1135('0x24'))](_0x1135('0x25'));}_0x36eb8d=_[_0x1135('0x26')](_[_0x1135('0x27')](_0x55753e),['createdAt','updatedAt']);_0x225c79=_[_0x1135('0x26')](_[_0x1135('0x27')](_0x55753e),[_0x1135('0x28'),_0x1135('0x29'),_0x1135('0x2a'),_0x1135('0x2b')]);if(_0x250136['body']['id']){delete _0x250136['body']['id'];}if(_['isNil'](_0x250136[_0x1135('0x20')][_0x1135('0x2c')])){throw new db[(_0x1135('0x23'))]['ValidationError'](_0x1135('0x2d'));}if(_[_0x1135('0x2e')](_0x250136[_0x1135('0x20')]['body'])||_0x250136[_0x1135('0x20')][_0x1135('0x20')]===''){throw new db['Sequelize'][(_0x1135('0x24'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1135('0x2e')](_0x250136[_0x1135('0x20')][_0x1135('0x2f')])){throw new db[(_0x1135('0x23'))][(_0x1135('0x24'))](_0x1135('0x30')+_0x225c79);}if(!_[_0x1135('0x31')](_0x225c79,_0x250136[_0x1135('0x20')]['mapKey'])){throw new db['Sequelize'][(_0x1135('0x24'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x225c79);}_0x5bceca[_0x250136['body']['mapKey']]=_0x250136['body'][_0x1135('0x2c')];})[_0x1135('0x1f')](function(){return db[_0x1135('0x32')][_0x1135('0x33')]({'where':{'id':_0x250136['account']['id']},'include':[{'model':db[_0x1135('0x34')],'as':_0x1135('0x35'),'include':[{'model':db[_0x1135('0x36')],'as':_0x1135('0x37'),'where':_0x5bceca,'limit':0x1,'order':[[_0x1135('0x29'),_0x1135('0x38')]]}]},{'model':db[_0x1135('0x39')],'as':_0x1135('0x3a')}]});})[_0x1135('0x1f')](function(_0x3acd77){if(_0x3acd77&&_0x3acd77[_0x1135('0x35')]){var _0x412b87=_0x3acd77[_0x1135('0x3b')]({'plain':!![]});_0x4b9948[_0x1135('0x3c')]=_0x412b87;_0x4b9948['applications']=_0x412b87[_0x1135('0x3a')];_0x4b9948[_0x1135('0x3d')]=_0x412b87[_0x1135('0x35')];_0x4b9948[_0x1135('0x3e')]=_[_0x1135('0x3f')](_0x4b9948[_0x1135('0x3e')],['priority'],[_0x1135('0x40')]);if(_0x4b9948[_0x1135('0x3c')][_0x1135('0x3a')]){delete _0x4b9948[_0x1135('0x3c')][_0x1135('0x3a')];}if(_0x4b9948[_0x1135('0x3c')][_0x1135('0x35')]&&_0x4b9948['account'][_0x1135('0x35')][_0x1135('0x37')]['length']){return _0x4b9948[_0x1135('0x3c')][_0x1135('0x35')][_0x1135('0x37')][0x0];}var _0x315d8f=_[_0x1135('0xb')](_0x250136[_0x1135('0x20')],{'firstName':_0x250136[_0x1135('0x20')][_0x1135('0x2c')],'ListId':_0x412b87[_0x1135('0x2b')]});_0x315d8f[_0x250136['body'][_0x1135('0x2f')]]=_0x250136[_0x1135('0x20')]['from'];return db[_0x1135('0x36')][_0x1135('0x41')](_0x315d8f,{'fields':_0x36eb8d,'raw':!![]});}})[_0x1135('0x1f')](function(_0x4c9a18){_0x4b9948[_0x1135('0x42')]=_0x4c9a18;if(_0x4c9a18){var _0x3c99bf={'ContactId':_0x4c9a18['id'],'FaxAccountId':_0x250136[_0x1135('0x3c')]['id'],'fax':_0x4c9a18[_0x1135('0x21')]};return db[_0x1135('0x43')]['find']({'where':{'ContactId':_0x4c9a18['id'],'closed':![],'FaxAccountId':_0x250136['account']['id']}})[_0x1135('0x1f')](function(_0x42a16c){if(_0x42a16c){return[_0x42a16c,![]];}return db[_0x1135('0x43')][_0x1135('0x41')](_0x3c99bf)[_0x1135('0x1f')](function(_0x1e111d){return[_0x1e111d,!![]];});});}else{throw new Error(_0x1135('0x44'));}})[_0x1135('0x45')](function(_0x58f9c5,_0x30a4ca){var _0x47b63a=_0x58f9c5[_0x1135('0x3b')]({'plain':!![]});if(_0x30a4ca){if(_0x4b9948[_0x1135('0x3c')]['autoclose']){_0x4b9948['applications'][_0x1135('0x46')]({'id':0x0,'priority':_0x4b9948['applications'][_0x1135('0x47')]+0x1,'app':_0x1135('0x48'),'appdata':_0x1135('0x49'),'interval':_0x1135('0x4a')});}_0x47b63a[_0x1135('0x4b')]=!![];}else{_0x47b63a[_0x1135('0x4b')]=![];}_0x4b9948['interaction']=_0x47b63a;return db['FaxMessage'][_0x1135('0x41')]({'body':_0x250136[_0x1135('0x20')][_0x1135('0x20')],'FaxAccountId':_0x250136[_0x1135('0x3c')]['id'],'FaxInteractionId':_0x58f9c5['id'],'direction':'in','ContactId':_0x58f9c5[_0x1135('0x4c')],'AttachmentId':_0x250136[_0x1135('0x20')][_0x1135('0x4d')]});})[_0x1135('0x1f')](function(_0x378ee4){_0x4b9948[_0x1135('0x17')]=_0x378ee4;if(_0x4b9948['interaction'][_0x1135('0x4e')]){return db[_0x1135('0x4f')][_0x1135('0x33')]({'attributes':['id',_0x1135('0x50')],'where':{'id':_0x4b9948[_0x1135('0x51')][_0x1135('0x4e')]}})['then'](function(_0x3f9ee2){if(_0x3f9ee2){_0x4b9948[_0x1135('0x3e')][_0x1135('0x52')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3f9ee2['name']+','+(_0x4b9948[_0x1135('0x3c')][_0x1135('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1135('0x54'),_0x1135('0x55'),_0x4b9948);});}return respondWithRpcPromise(_0x1135('0x54'),_0x1135('0x55'),_0x4b9948);})[_0x1135('0x1f')](function(_0x16187b){_0x4a2056(_0x16187b);})['catch'](function(_0x572118){_0x41660f(_0x31a8dd[_0x1135('0x15')](0x1f4,_0x572118[_0x1135('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index a5ce099..60ea785 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 _0xd7d5=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd7d5,0x1c7));var _0x5d7d=function(_0x135d89,_0x297b6e){_0x135d89=_0x135d89-0x0;var _0x48727c=_0xd7d5[_0x135d89];return _0x48727c;};'use strict';var FaxAccountEvents=require(_0x5d7d('0x0'));var events=[_0x5d7d('0x1'),_0x5d7d('0x2'),_0x5d7d('0x3')];function createListener(_0x4acabf,_0x4499d1){return function(_0x35d834){_0x4499d1[_0x5d7d('0x4')](_0x4acabf,_0x35d834);};}function removeListener(_0x2230a4,_0x41c851){return function(){FaxAccountEvents[_0x5d7d('0x5')](_0x2230a4,_0x41c851);};}exports[_0x5d7d('0x6')]=function(_0x2f3c37){for(var _0x23350d=0x0,_0x1d24ac=events[_0x5d7d('0x7')];_0x23350d<_0x1d24ac;_0x23350d++){var _0x29fc66=events[_0x23350d];var _0x200165=createListener(_0x5d7d('0x8')+_0x29fc66,_0x2f3c37);FaxAccountEvents['on'](_0x29fc66,_0x200165);}}; \ No newline at end of file +var _0x9e2e=['faxAccount:','save','remove','update','removeListener','register','length'];(function(_0x38d040,_0x117cdc){var _0x2ab2a1=function(_0x2038bb){while(--_0x2038bb){_0x38d040['push'](_0x38d040['shift']());}};_0x2ab2a1(++_0x117cdc);}(_0x9e2e,0x1ac));var _0xe9e2=function(_0x50692b,_0x4cf5bc){_0x50692b=_0x50692b-0x0;var _0x57748b=_0x9e2e[_0x50692b];return _0x57748b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xe9e2('0x0'),_0xe9e2('0x1'),_0xe9e2('0x2')];function createListener(_0x83abc3,_0x411f49){return function(_0x1242aa){_0x411f49['emit'](_0x83abc3,_0x1242aa);};}function removeListener(_0xf300d7,_0x45f3e5){return function(){FaxAccountEvents[_0xe9e2('0x3')](_0xf300d7,_0x45f3e5);};}exports[_0xe9e2('0x4')]=function(_0x554994){for(var _0x2b298c=0x0,_0x233610=events[_0xe9e2('0x5')];_0x2b298c<_0x233610;_0x2b298c++){var _0x4a1d51=events[_0x2b298c];var _0x3d7814=createListener(_0xe9e2('0x6')+_0x4a1d51,_0x554994);FaxAccountEvents['on'](_0x4a1d51,_0x3d7814);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d0f4799..f15e024 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(_0x215fe7,_0x541d89){var _0x5e90bd=function(_0x43e246){while(--_0x43e246){_0x215fe7['push'](_0x215fe7['shift']());}};_0x5e90bd(++_0x541d89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +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(_0x1844aa,_0x51bd44){var _0x1bb1ce=function(_0x1329fe){while(--_0x1329fe){_0x1844aa['push'](_0x1844aa['shift']());}};_0x1bb1ce(++_0x51bd44);}(_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 215f648..aba10e5 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 _0x37d7=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3ff61a,_0x24ab96){var _0x558316=function(_0x2e7a93){while(--_0x2e7a93){_0x3ff61a['push'](_0x3ff61a['shift']());}};_0x558316(++_0x24ab96);}(_0x37d7,0x1e8));var _0x737d=function(_0x2040dd,_0x156a63){_0x2040dd=_0x2040dd-0x0;var _0x27688f=_0x37d7[_0x2040dd];return _0x27688f;};'use strict';var Sequelize=require(_0x737d('0x0'));module[_0x737d('0x1')]={'priority':{'type':Sequelize[_0x737d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x737d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x737d('0x4')]()},'description':{'type':Sequelize[_0x737d('0x3')]},'interval':{'type':Sequelize[_0x737d('0x3')],'defaultValue':_0x737d('0x5')}}; \ No newline at end of file +var _0xdd6d=['*,*,*,*','exports','STRING','TEXT'];(function(_0x52ab0a,_0xf641d5){var _0x1d2cab=function(_0x47d5a1){while(--_0x47d5a1){_0x52ab0a['push'](_0x52ab0a['shift']());}};_0x1d2cab(++_0xf641d5);}(_0xdd6d,0xd9));var _0xddd6=function(_0x48925b,_0x1f5a56){_0x48925b=_0x48925b-0x0;var _0x128edd=_0xdd6d[_0x48925b];return _0x128edd;};'use strict';var Sequelize=require('sequelize');module[_0xddd6('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xddd6('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xddd6('0x2')]()},'description':{'type':Sequelize[_0xddd6('0x1')]},'interval':{'type':Sequelize[_0xddd6('0x1')],'defaultValue':_0xddd6('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index eb7533e..94d35c5 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 _0x21c1=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','FaxApplication','includeAll','findAll','rows','catch','show','params','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','attributes'];(function(_0x27b0b3,_0x1b0e02){var _0x3c6546=function(_0x42c348){while(--_0x42c348){_0x27b0b3['push'](_0x27b0b3['shift']());}};_0x3c6546(++_0x1b0e02);}(_0x21c1,0xac));var _0x121c=function(_0x39f72a,_0x20d6fb){_0x39f72a=_0x39f72a-0x0;var _0x4c8a68=_0x21c1[_0x39f72a];return _0x4c8a68;};'use strict';var emlformat=require(_0x121c('0x0'));var rimraf=require(_0x121c('0x1'));var zipdir=require(_0x121c('0x2'));var jsonpatch=require(_0x121c('0x3'));var rp=require(_0x121c('0x4'));var moment=require(_0x121c('0x5'));var BPromise=require(_0x121c('0x6'));var Mustache=require(_0x121c('0x7'));var util=require(_0x121c('0x8'));var path=require(_0x121c('0x9'));var sox=require(_0x121c('0xa'));var csv=require(_0x121c('0xb'));var ejs=require(_0x121c('0xc'));var fs=require('fs');var fs_extra=require(_0x121c('0xd'));var _=require(_0x121c('0xe'));var squel=require(_0x121c('0xf'));var crypto=require(_0x121c('0x10'));var jsforce=require(_0x121c('0x11'));var deskjs=require(_0x121c('0x12'));var toCsv=require(_0x121c('0xb'));var querystring=require(_0x121c('0x13'));var Papa=require('papaparse');var Redis=require(_0x121c('0x14'));var authService=require(_0x121c('0x15'));var qs=require(_0x121c('0x16'));var as=require(_0x121c('0x17'));var hardwareService=require(_0x121c('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x121c('0x19'));var config=require(_0x121c('0x1a'));var licenseUtil=require(_0x121c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x201bd6,_0x547d59){_0x547d59=_0x547d59||0xcc;return function(_0x2cf5ce){if(_0x2cf5ce){return _0x201bd6[_0x121c('0x1c')](_0x547d59);}return _0x201bd6['status'](_0x547d59)[_0x121c('0x1d')]();};}function respondWithResult(_0x3d0a18,_0x47eaf7){_0x47eaf7=_0x47eaf7||0xc8;return function(_0x370f2b){if(_0x370f2b){return _0x3d0a18[_0x121c('0x1e')](_0x47eaf7)['json'](_0x370f2b);}};}function respondWithFilteredResult(_0x2ecf03,_0x404565){return function(_0x1d5a2e){if(_0x1d5a2e){var _0x5a0499=typeof _0x404565[_0x121c('0x1f')]===_0x121c('0x20')&&typeof _0x404565[_0x121c('0x21')]===_0x121c('0x20');var _0x9e1b57=_0x1d5a2e[_0x121c('0x22')];var _0x45b6b4=_0x5a0499?0x0:_0x404565[_0x121c('0x1f')];var _0x3788f9=_0x5a0499?_0x1d5a2e[_0x121c('0x22')]:_0x404565[_0x121c('0x1f')]+_0x404565[_0x121c('0x21')];var _0x898dcb;if(_0x3788f9>=_0x9e1b57){_0x3788f9=_0x9e1b57;_0x898dcb=0xc8;}else{_0x898dcb=0xce;}_0x2ecf03[_0x121c('0x1e')](_0x898dcb);return _0x2ecf03[_0x121c('0x23')]('Content-Range',_0x45b6b4+'-'+_0x3788f9+'/'+_0x9e1b57)[_0x121c('0x24')](_0x1d5a2e);}return null;};}function patchUpdates(_0x240999){return function(_0xfa639){try{jsonpatch['apply'](_0xfa639,_0x240999,!![]);}catch(_0x467438){return BPromise[_0x121c('0x25')](_0x467438);}return _0xfa639[_0x121c('0x26')]();};}function saveUpdates(_0x16a8bb,_0x548559){return function(_0x273e27){if(_0x273e27){return _0x273e27['update'](_0x16a8bb)[_0x121c('0x27')](function(_0x1638f7){return _0x1638f7;});}return null;};}function removeEntity(_0x31a99b,_0x61a05e){return function(_0x1fa974){if(_0x1fa974){return _0x1fa974[_0x121c('0x28')]()['then'](function(){_0x31a99b[_0x121c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26c0f2,_0xa18060){return function(_0x4f8e6d){if(!_0x4f8e6d){_0x26c0f2[_0x121c('0x1c')](0x194);}return _0x4f8e6d;};}function handleError(_0x27d835,_0x4195a1){_0x4195a1=_0x4195a1||0x1f4;return function(_0x32e9ac){logger['error'](_0x32e9ac[_0x121c('0x29')]);if(_0x32e9ac[_0x121c('0x2a')]){delete _0x32e9ac[_0x121c('0x2a')];}_0x27d835[_0x121c('0x1e')](_0x4195a1)[_0x121c('0x2b')](_0x32e9ac);};}exports[_0x121c('0x2c')]=function(_0x3f6966,_0x2da161){var _0x4dcf53={},_0x426154={},_0x413b32={'count':0x0,'rows':[]};var _0x2f33f6=_[_0x121c('0x2d')](db['FaxApplication'][_0x121c('0x2e')],function(_0x3f4235){return{'name':_0x3f4235['fieldName'],'type':_0x3f4235[_0x121c('0x2f')][_0x121c('0x30')]};});_0x426154['model']=_[_0x121c('0x2d')](_0x2f33f6,_0x121c('0x2a'));_0x426154[_0x121c('0x31')]=_[_0x121c('0x32')](_0x3f6966[_0x121c('0x31')]);_0x426154['filters']=_[_0x121c('0x33')](_0x426154['model'],_0x426154[_0x121c('0x31')]);_0x4dcf53[_0x121c('0x34')]=_[_0x121c('0x33')](_0x426154[_0x121c('0x35')],qs[_0x121c('0x36')](_0x3f6966[_0x121c('0x31')][_0x121c('0x36')]));_0x4dcf53[_0x121c('0x34')]=_0x4dcf53[_0x121c('0x34')][_0x121c('0x37')]?_0x4dcf53[_0x121c('0x34')]:_0x426154[_0x121c('0x35')];if(!_0x3f6966[_0x121c('0x31')][_0x121c('0x38')](_0x121c('0x39'))){_0x4dcf53[_0x121c('0x21')]=qs[_0x121c('0x21')](_0x3f6966[_0x121c('0x31')][_0x121c('0x21')]);_0x4dcf53[_0x121c('0x1f')]=qs[_0x121c('0x1f')](_0x3f6966[_0x121c('0x31')]['offset']);}_0x4dcf53[_0x121c('0x3a')]=qs['sort'](_0x3f6966[_0x121c('0x31')][_0x121c('0x3b')]);_0x4dcf53[_0x121c('0x3c')]=qs[_0x121c('0x3d')](_[_0x121c('0x3e')](_0x3f6966[_0x121c('0x31')],_0x426154[_0x121c('0x3d')]),_0x2f33f6);if(_0x3f6966[_0x121c('0x31')]['filter']){_0x4dcf53[_0x121c('0x3c')]=_[_0x121c('0x3f')](_0x4dcf53['where'],{'$or':_[_0x121c('0x2d')](_0x2f33f6,function(_0xe40076){if(_0xe40076[_0x121c('0x2f')]!=='VIRTUAL'){var _0x1bfcd8={};_0x1bfcd8[_0xe40076[_0x121c('0x2a')]]={'$like':'%'+_0x3f6966[_0x121c('0x31')][_0x121c('0x40')]+'%'};return _0x1bfcd8;}})});}_0x4dcf53=_[_0x121c('0x3f')]({},_0x4dcf53,_0x3f6966[_0x121c('0x41')]);var _0x485564={'where':_0x4dcf53[_0x121c('0x3c')]};return db[_0x121c('0x42')][_0x121c('0x22')](_0x485564)['then'](function(_0xeb697){_0x413b32['count']=_0xeb697;if(_0x3f6966[_0x121c('0x31')][_0x121c('0x43')]){_0x4dcf53['include']=[{'all':!![]}];}return db['FaxApplication'][_0x121c('0x44')](_0x4dcf53);})['then'](function(_0x287499){_0x413b32[_0x121c('0x45')]=_0x287499;return _0x413b32;})[_0x121c('0x27')](respondWithFilteredResult(_0x2da161,_0x4dcf53))[_0x121c('0x46')](handleError(_0x2da161,null));};exports[_0x121c('0x47')]=function(_0x38916b,_0x9756c6){var _0x14cd1d={'raw':!![],'where':{'id':_0x38916b[_0x121c('0x48')]['id']}},_0x43df29={};_0x43df29['model']=_[_0x121c('0x32')](db['FaxApplication'][_0x121c('0x2e')]);_0x43df29[_0x121c('0x31')]=_[_0x121c('0x32')](_0x38916b[_0x121c('0x31')]);_0x43df29['filters']=_[_0x121c('0x33')](_0x43df29['model'],_0x43df29['query']);_0x14cd1d[_0x121c('0x34')]=_['intersection'](_0x43df29[_0x121c('0x35')],qs[_0x121c('0x36')](_0x38916b[_0x121c('0x31')][_0x121c('0x36')]));_0x14cd1d['attributes']=_0x14cd1d[_0x121c('0x34')][_0x121c('0x37')]?_0x14cd1d[_0x121c('0x34')]:_0x43df29[_0x121c('0x35')];if(_0x38916b[_0x121c('0x31')][_0x121c('0x43')]){_0x14cd1d['include']=[{'all':!![]}];}_0x14cd1d=_[_0x121c('0x3f')]({},_0x14cd1d,_0x38916b[_0x121c('0x41')]);return db[_0x121c('0x42')]['find'](_0x14cd1d)[_0x121c('0x27')](handleEntityNotFound(_0x9756c6,null))['then'](respondWithResult(_0x9756c6,null))[_0x121c('0x46')](handleError(_0x9756c6,null));};exports['create']=function(_0x180be9,_0x108771){return db[_0x121c('0x42')]['create'](_0x180be9[_0x121c('0x49')],{})[_0x121c('0x27')](respondWithResult(_0x108771,0xc9))[_0x121c('0x46')](handleError(_0x108771,null));};exports['update']=function(_0x76eda,_0x27c052){if(_0x76eda[_0x121c('0x49')]['id']){delete _0x76eda[_0x121c('0x49')]['id'];}return db[_0x121c('0x42')][_0x121c('0x4a')]({'where':{'id':_0x76eda['params']['id']}})['then'](handleEntityNotFound(_0x27c052,null))['then'](saveUpdates(_0x76eda[_0x121c('0x49')],null))[_0x121c('0x27')](respondWithResult(_0x27c052,null))[_0x121c('0x46')](handleError(_0x27c052,null));};exports[_0x121c('0x28')]=function(_0xf82a4a,_0x3fd916){return db[_0x121c('0x42')][_0x121c('0x4a')]({'where':{'id':_0xf82a4a[_0x121c('0x48')]['id']}})[_0x121c('0x27')](handleEntityNotFound(_0x3fd916,null))[_0x121c('0x27')](removeEntity(_0x3fd916,null))[_0x121c('0x46')](handleError(_0x3fd916,null));}; \ No newline at end of file +var _0x5a06=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','FaxApplication','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5a06,0xc6));var _0x65a0=function(_0x57c029,_0x302ebd){_0x57c029=_0x57c029-0x0;var _0x6b7d44=_0x5a06[_0x57c029];return _0x6b7d44;};'use strict';var emlformat=require(_0x65a0('0x0'));var rimraf=require(_0x65a0('0x1'));var zipdir=require(_0x65a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65a0('0x3'));var moment=require(_0x65a0('0x4'));var BPromise=require(_0x65a0('0x5'));var Mustache=require('mustache');var util=require(_0x65a0('0x6'));var path=require(_0x65a0('0x7'));var sox=require(_0x65a0('0x8'));var csv=require(_0x65a0('0x9'));var ejs=require(_0x65a0('0xa'));var fs=require('fs');var fs_extra=require(_0x65a0('0xb'));var _=require('lodash');var squel=require(_0x65a0('0xc'));var crypto=require(_0x65a0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x65a0('0xe'));var toCsv=require(_0x65a0('0x9'));var querystring=require(_0x65a0('0xf'));var Papa=require(_0x65a0('0x10'));var Redis=require(_0x65a0('0x11'));var authService=require(_0x65a0('0x12'));var qs=require(_0x65a0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65a0('0x14'));var logger=require(_0x65a0('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x65a0('0x16'))['db'];function respondWithStatusCode(_0x16a46b,_0x391a89){_0x391a89=_0x391a89||0xcc;return function(_0xa8de95){if(_0xa8de95){return _0x16a46b['sendStatus'](_0x391a89);}return _0x16a46b[_0x65a0('0x17')](_0x391a89)[_0x65a0('0x18')]();};}function respondWithResult(_0x2ef3ca,_0xc32822){_0xc32822=_0xc32822||0xc8;return function(_0xb579ad){if(_0xb579ad){return _0x2ef3ca[_0x65a0('0x17')](_0xc32822)[_0x65a0('0x19')](_0xb579ad);}};}function respondWithFilteredResult(_0xbbce05,_0xeba321){return function(_0x34745f){if(_0x34745f){var _0x44d858=typeof _0xeba321['offset']==='undefined'&&typeof _0xeba321['limit']==='undefined';var _0x59a7d7=_0x34745f['count'];var _0x29c5ba=_0x44d858?0x0:_0xeba321[_0x65a0('0x1a')];var _0x3d37fc=_0x44d858?_0x34745f[_0x65a0('0x1b')]:_0xeba321[_0x65a0('0x1a')]+_0xeba321['limit'];var _0xe8348d;if(_0x3d37fc>=_0x59a7d7){_0x3d37fc=_0x59a7d7;_0xe8348d=0xc8;}else{_0xe8348d=0xce;}_0xbbce05[_0x65a0('0x17')](_0xe8348d);return _0xbbce05[_0x65a0('0x1c')](_0x65a0('0x1d'),_0x29c5ba+'-'+_0x3d37fc+'/'+_0x59a7d7)[_0x65a0('0x19')](_0x34745f);}return null;};}function patchUpdates(_0x310ee3){return function(_0x33cd9d){try{jsonpatch[_0x65a0('0x1e')](_0x33cd9d,_0x310ee3,!![]);}catch(_0x4b244b){return BPromise['reject'](_0x4b244b);}return _0x33cd9d[_0x65a0('0x1f')]();};}function saveUpdates(_0x1fb3ae,_0x5e47e3){return function(_0x31b0db){if(_0x31b0db){return _0x31b0db[_0x65a0('0x20')](_0x1fb3ae)[_0x65a0('0x21')](function(_0x1ad1e4){return _0x1ad1e4;});}return null;};}function removeEntity(_0x4f639a,_0x222511){return function(_0x9b158d){if(_0x9b158d){return _0x9b158d[_0x65a0('0x22')]()[_0x65a0('0x21')](function(){_0x4f639a[_0x65a0('0x17')](0xcc)[_0x65a0('0x18')]();});}};}function handleEntityNotFound(_0x165466,_0x445d3){return function(_0x5af5bd){if(!_0x5af5bd){_0x165466[_0x65a0('0x23')](0x194);}return _0x5af5bd;};}function handleError(_0x3e7220,_0x3f1115){_0x3f1115=_0x3f1115||0x1f4;return function(_0x4999bf){logger[_0x65a0('0x24')](_0x4999bf[_0x65a0('0x25')]);if(_0x4999bf[_0x65a0('0x26')]){delete _0x4999bf[_0x65a0('0x26')];}_0x3e7220['status'](_0x3f1115)['send'](_0x4999bf);};}exports[_0x65a0('0x27')]=function(_0x9d7fec,_0x396e26){var _0x574d9f={},_0x1c5b3e={},_0x3055d9={'count':0x0,'rows':[]};var _0x13a8ee=_[_0x65a0('0x28')](db[_0x65a0('0x29')]['rawAttributes'],function(_0x41d253){return{'name':_0x41d253['fieldName'],'type':_0x41d253[_0x65a0('0x2a')]['key']};});_0x1c5b3e[_0x65a0('0x2b')]=_[_0x65a0('0x28')](_0x13a8ee,_0x65a0('0x26'));_0x1c5b3e[_0x65a0('0x2c')]=_[_0x65a0('0x2d')](_0x9d7fec[_0x65a0('0x2c')]);_0x1c5b3e['filters']=_[_0x65a0('0x2e')](_0x1c5b3e['model'],_0x1c5b3e['query']);_0x574d9f[_0x65a0('0x2f')]=_[_0x65a0('0x2e')](_0x1c5b3e[_0x65a0('0x2b')],qs['fields'](_0x9d7fec['query'][_0x65a0('0x30')]));_0x574d9f[_0x65a0('0x2f')]=_0x574d9f[_0x65a0('0x2f')][_0x65a0('0x31')]?_0x574d9f[_0x65a0('0x2f')]:_0x1c5b3e[_0x65a0('0x2b')];if(!_0x9d7fec['query']['hasOwnProperty'](_0x65a0('0x32'))){_0x574d9f[_0x65a0('0x33')]=qs[_0x65a0('0x33')](_0x9d7fec['query']['limit']);_0x574d9f[_0x65a0('0x1a')]=qs[_0x65a0('0x1a')](_0x9d7fec[_0x65a0('0x2c')][_0x65a0('0x1a')]);}_0x574d9f[_0x65a0('0x34')]=qs[_0x65a0('0x35')](_0x9d7fec[_0x65a0('0x2c')][_0x65a0('0x35')]);_0x574d9f[_0x65a0('0x36')]=qs[_0x65a0('0x37')](_[_0x65a0('0x38')](_0x9d7fec[_0x65a0('0x2c')],_0x1c5b3e[_0x65a0('0x37')]),_0x13a8ee);if(_0x9d7fec[_0x65a0('0x2c')]['filter']){_0x574d9f[_0x65a0('0x36')]=_[_0x65a0('0x39')](_0x574d9f[_0x65a0('0x36')],{'$or':_['map'](_0x13a8ee,function(_0x5c26b8){if(_0x5c26b8[_0x65a0('0x2a')]!==_0x65a0('0x3a')){var _0x329886={};_0x329886[_0x5c26b8[_0x65a0('0x26')]]={'$like':'%'+_0x9d7fec[_0x65a0('0x2c')][_0x65a0('0x3b')]+'%'};return _0x329886;}})});}_0x574d9f=_[_0x65a0('0x39')]({},_0x574d9f,_0x9d7fec['options']);var _0x16967f={'where':_0x574d9f['where']};return db[_0x65a0('0x29')][_0x65a0('0x1b')](_0x16967f)[_0x65a0('0x21')](function(_0x192040){_0x3055d9[_0x65a0('0x1b')]=_0x192040;if(_0x9d7fec[_0x65a0('0x2c')][_0x65a0('0x3c')]){_0x574d9f[_0x65a0('0x3d')]=[{'all':!![]}];}return db[_0x65a0('0x29')][_0x65a0('0x3e')](_0x574d9f);})[_0x65a0('0x21')](function(_0x14d307){_0x3055d9['rows']=_0x14d307;return _0x3055d9;})[_0x65a0('0x21')](respondWithFilteredResult(_0x396e26,_0x574d9f))[_0x65a0('0x3f')](handleError(_0x396e26,null));};exports[_0x65a0('0x40')]=function(_0x881bef,_0x5adddb){var _0x421f4c={'raw':!![],'where':{'id':_0x881bef['params']['id']}},_0x25df3c={};_0x25df3c[_0x65a0('0x2b')]=_[_0x65a0('0x2d')](db[_0x65a0('0x29')][_0x65a0('0x41')]);_0x25df3c[_0x65a0('0x2c')]=_[_0x65a0('0x2d')](_0x881bef[_0x65a0('0x2c')]);_0x25df3c[_0x65a0('0x37')]=_[_0x65a0('0x2e')](_0x25df3c[_0x65a0('0x2b')],_0x25df3c['query']);_0x421f4c[_0x65a0('0x2f')]=_[_0x65a0('0x2e')](_0x25df3c[_0x65a0('0x2b')],qs[_0x65a0('0x30')](_0x881bef['query'][_0x65a0('0x30')]));_0x421f4c[_0x65a0('0x2f')]=_0x421f4c['attributes'][_0x65a0('0x31')]?_0x421f4c[_0x65a0('0x2f')]:_0x25df3c['model'];if(_0x881bef[_0x65a0('0x2c')][_0x65a0('0x3c')]){_0x421f4c[_0x65a0('0x3d')]=[{'all':!![]}];}_0x421f4c=_['merge']({},_0x421f4c,_0x881bef['options']);return db['FaxApplication'][_0x65a0('0x42')](_0x421f4c)[_0x65a0('0x21')](handleEntityNotFound(_0x5adddb,null))['then'](respondWithResult(_0x5adddb,null))[_0x65a0('0x3f')](handleError(_0x5adddb,null));};exports[_0x65a0('0x43')]=function(_0x1d0de6,_0x4d7fc5){return db[_0x65a0('0x29')][_0x65a0('0x43')](_0x1d0de6['body'],{})['then'](respondWithResult(_0x4d7fc5,0xc9))[_0x65a0('0x3f')](handleError(_0x4d7fc5,null));};exports[_0x65a0('0x20')]=function(_0x352995,_0x5d8af0){if(_0x352995['body']['id']){delete _0x352995[_0x65a0('0x44')]['id'];}return db[_0x65a0('0x29')][_0x65a0('0x42')]({'where':{'id':_0x352995['params']['id']}})[_0x65a0('0x21')](handleEntityNotFound(_0x5d8af0,null))['then'](saveUpdates(_0x352995[_0x65a0('0x44')],null))[_0x65a0('0x21')](respondWithResult(_0x5d8af0,null))[_0x65a0('0x3f')](handleError(_0x5d8af0,null));};exports[_0x65a0('0x22')]=function(_0x44da9f,_0x374473){return db['FaxApplication'][_0x65a0('0x42')]({'where':{'id':_0x44da9f[_0x65a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x374473,null))[_0x65a0('0x21')](removeEntity(_0x374473,null))['catch'](handleError(_0x374473,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a0014ab..1dc6769 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 _0x3403=['request-promise','../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x5bccd3,_0x4e2b7b){var _0x322dbc=function(_0x2f7b82){while(--_0x2f7b82){_0x5bccd3['push'](_0x5bccd3['shift']());}};_0x322dbc(++_0x4e2b7b);}(_0x3403,0xed));var _0x3340=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3403[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x3340('0x0'));var logger=require('../../config/logger')(_0x3340('0x1'));var moment=require(_0x3340('0x2'));var BPromise=require('bluebird');var rp=require(_0x3340('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3340('0x4'));var attributes=require(_0x3340('0x5'));module[_0x3340('0x6')]=function(_0x417ad5,_0x475ff1){return _0x417ad5[_0x3340('0x7')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3340('0x8'),'collate':_0x3340('0x9')});}; \ No newline at end of file +var _0xd422=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd422,0x124));var _0x2d42=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xd422[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x2d42('0x0'));var util=require(_0x2d42('0x1'));var logger=require(_0x2d42('0x2'))(_0x2d42('0x3'));var moment=require(_0x2d42('0x4'));var BPromise=require('bluebird');var rp=require(_0x2d42('0x5'));var fs=require('fs');var path=require(_0x2d42('0x6'));var rimraf=require(_0x2d42('0x7'));var config=require(_0x2d42('0x8'));var attributes=require(_0x2d42('0x9'));module[_0x2d42('0xa')]=function(_0x2d12ca,_0xc516a1){return _0x2d12ca[_0x2d42('0xb')](_0x2d42('0xc'),attributes,{'tableName':_0x2d42('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d42('0xe'),'collate':_0x2d42('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0462dfb..4e30bd9 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 _0x5c83=['../../config/environment','client','http','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','update','body','raw','options','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x5c83,0xb2));var _0x35c8=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x5c83[_0x26a906];return _0x495575;};'use strict';var _=require(_0x35c8('0x0'));var util=require(_0x35c8('0x1'));var moment=require(_0x35c8('0x2'));var BPromise=require(_0x35c8('0x3'));var rs=require(_0x35c8('0x4'));var fs=require('fs');var Redis=require(_0x35c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x35c8('0x6'));var logger=require(_0x35c8('0x7'))('rpc');var config=require(_0x35c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x35c8('0x9')][_0x35c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x559284,_0x482e87,_0x1cf049){return new BPromise(function(_0x5ad7bd,_0x40ab2c){return client['request'](_0x559284,_0x1cf049)[_0x35c8('0xb')](function(_0x1bc8e4){logger[_0x35c8('0xc')]('FaxApplication,\x20%s,\x20%s',_0x482e87,_0x35c8('0xd'));logger[_0x35c8('0xe')](_0x35c8('0xf'),_0x482e87,_0x35c8('0xd'),JSON[_0x35c8('0x10')](_0x1bc8e4));if(_0x1bc8e4['error']){if(_0x1bc8e4['error'][_0x35c8('0x11')]===0x1f4){logger[_0x35c8('0x12')](_0x35c8('0x13'),_0x482e87,_0x1bc8e4['error'][_0x35c8('0x14')]);return _0x40ab2c(_0x1bc8e4[_0x35c8('0x12')][_0x35c8('0x14')]);}logger[_0x35c8('0x12')]('FaxApplication,\x20%s,\x20%s',_0x482e87,_0x1bc8e4[_0x35c8('0x12')][_0x35c8('0x14')]);return _0x5ad7bd(_0x1bc8e4[_0x35c8('0x12')][_0x35c8('0x14')]);}else{logger[_0x35c8('0xc')](_0x35c8('0x13'),_0x482e87,_0x35c8('0xd'));_0x5ad7bd(_0x1bc8e4[_0x35c8('0x15')][_0x35c8('0x14')]);}})['catch'](function(_0x3a178d){logger[_0x35c8('0x12')](_0x35c8('0x13'),_0x482e87,_0x3a178d);_0x40ab2c(_0x3a178d);});});}exports[_0x35c8('0x16')]=function(_0x3b54d0){var _0x50d2f6=this;return new Promise(function(_0x23f337,_0x81b3fd){return db['FaxApplication'][_0x35c8('0x17')](_0x3b54d0[_0x35c8('0x18')],{'raw':_0x3b54d0['options']?_0x3b54d0['options'][_0x35c8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b54d0[_0x35c8('0x1a')]?_0x3b54d0[_0x35c8('0x1a')][_0x35c8('0x1b')]||null:null,'attributes':_0x3b54d0[_0x35c8('0x1a')]?_0x3b54d0[_0x35c8('0x1a')][_0x35c8('0x1c')]||null:null,'limit':_0x3b54d0[_0x35c8('0x1a')]?_0x3b54d0[_0x35c8('0x1a')][_0x35c8('0x1d')]||null:null})['then'](function(_0x4a33ea){logger[_0x35c8('0xc')]('UpdateFaxApplication',_0x3b54d0);logger['debug']('UpdateFaxApplication',_0x3b54d0,JSON[_0x35c8('0x10')](_0x4a33ea));_0x23f337(_0x4a33ea);})[_0x35c8('0x1e')](function(_0x1cf882){logger[_0x35c8('0x12')]('UpdateFaxApplication',_0x1cf882[_0x35c8('0x14')],_0x3b54d0);_0x81b3fd(_0x50d2f6[_0x35c8('0x12')](0x1f4,_0x1cf882[_0x35c8('0x14')]));});});}; \ No newline at end of file +var _0x18ec=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','FaxApplication','update','body','options','where','attributes','UpdateFaxApplication'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x18ec,0x1d1));var _0xc18e=function(_0x585ff1,_0x43bdc3){_0x585ff1=_0x585ff1-0x0;var _0x470649=_0x18ec[_0x585ff1];return _0x470649;};'use strict';var _=require(_0xc18e('0x0'));var util=require(_0xc18e('0x1'));var moment=require('moment');var BPromise=require(_0xc18e('0x2'));var rs=require(_0xc18e('0x3'));var fs=require('fs');var Redis=require(_0xc18e('0x4'));var db=require(_0xc18e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc18e('0x6'))(_0xc18e('0x7'));var config=require(_0xc18e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc18e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2efdb2,_0x593d8d,_0x49dec5){return new BPromise(function(_0x16e96b,_0x171c34){return client[_0xc18e('0xa')](_0x2efdb2,_0x49dec5)[_0xc18e('0xb')](function(_0x370702){logger['info'](_0xc18e('0xc'),_0x593d8d,'request\x20sent');logger[_0xc18e('0xd')](_0xc18e('0xe'),_0x593d8d,_0xc18e('0xf'),JSON['stringify'](_0x370702));if(_0x370702[_0xc18e('0x10')]){if(_0x370702[_0xc18e('0x10')]['code']===0x1f4){logger[_0xc18e('0x10')](_0xc18e('0xc'),_0x593d8d,_0x370702['error'][_0xc18e('0x11')]);return _0x171c34(_0x370702['error'][_0xc18e('0x11')]);}logger[_0xc18e('0x10')](_0xc18e('0xc'),_0x593d8d,_0x370702['error'][_0xc18e('0x11')]);return _0x16e96b(_0x370702['error']['message']);}else{logger[_0xc18e('0x12')](_0xc18e('0xc'),_0x593d8d,_0xc18e('0xf'));_0x16e96b(_0x370702[_0xc18e('0x13')][_0xc18e('0x11')]);}})[_0xc18e('0x14')](function(_0x1061b8){logger[_0xc18e('0x10')](_0xc18e('0xc'),_0x593d8d,_0x1061b8);_0x171c34(_0x1061b8);});});}exports['UpdateFaxApplication']=function(_0xda93d8){var _0x11b88a=this;return new Promise(function(_0x341160,_0x3a279e){return db[_0xc18e('0x15')][_0xc18e('0x16')](_0xda93d8[_0xc18e('0x17')],{'raw':_0xda93d8[_0xc18e('0x18')]?_0xda93d8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda93d8[_0xc18e('0x18')]?_0xda93d8[_0xc18e('0x18')][_0xc18e('0x19')]||null:null,'attributes':_0xda93d8[_0xc18e('0x18')]?_0xda93d8[_0xc18e('0x18')][_0xc18e('0x1a')]||null:null,'limit':_0xda93d8['options']?_0xda93d8[_0xc18e('0x18')]['limit']||null:null})[_0xc18e('0xb')](function(_0x192422){logger[_0xc18e('0x12')]('UpdateFaxApplication',_0xda93d8);logger[_0xc18e('0xd')](_0xc18e('0x1b'),_0xda93d8,JSON[_0xc18e('0x1c')](_0x192422));_0x341160(_0x192422);})[_0xc18e('0x14')](function(_0x194998){logger['error']('UpdateFaxApplication',_0x194998[_0xc18e('0x11')],_0xda93d8);_0x3a279e(_0x11b88a[_0xc18e('0x10')](0x1f4,_0x194998['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 255925e..5303cfd 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 _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x955f,0x1eb));var _0xf955=function(_0x4467bd,_0x263abc){_0x4467bd=_0x4467bd-0x0;var _0x3ee10d=_0x955f[_0x4467bd];return _0x3ee10d;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./faxApplication.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file +var _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefda,0x96));var _0xaefd=function(_0x5edbcf,_0x4fd67e){_0x5edbcf=_0x5edbcf-0x0;var _0xfedcc1=_0xefda[_0x5edbcf];return _0xfedcc1;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index a666e72..07ae913 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 _0xcd1b=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xcd1b,0xcb));var _0xbcd1=function(_0x59f318,_0x3b5bc7){_0x59f318=_0x59f318-0x0;var _0x39fb3f=_0xcd1b[_0x59f318];return _0x39fb3f;};'use strict';var Sequelize=require(_0xbcd1('0x0'));module[_0xbcd1('0x1')]={'closed':{'type':Sequelize[_0xbcd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbcd1('0x3')]},'disposition':{'type':Sequelize[_0xbcd1('0x4')]},'secondDisposition':{'type':Sequelize[_0xbcd1('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbcd1('0x4')]},'note':{'type':Sequelize[_0xbcd1('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xbcd1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xbcd1('0x5')]('in',_0xbcd1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbcd1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbcd1('0x5')]('in',_0xbcd1('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf930=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x121c29,_0x392b98){var _0x569e32=function(_0x3acfab){while(--_0x3acfab){_0x121c29['push'](_0x121c29['shift']());}};_0x569e32(++_0x392b98);}(_0xf930,0x17e));var _0x0f93=function(_0x35e21a,_0x689d32){_0x35e21a=_0x35e21a-0x0;var _0x50949e=_0xf930[_0x35e21a];return _0x50949e;};'use strict';var Sequelize=require(_0x0f93('0x0'));module[_0x0f93('0x1')]={'closed':{'type':Sequelize[_0x0f93('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f93('0x3')]},'disposition':{'type':Sequelize[_0x0f93('0x4')]},'secondDisposition':{'type':Sequelize[_0x0f93('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0f93('0x3')]},'fax':{'type':Sequelize[_0x0f93('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0f93('0x5')]('in',_0x0f93('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0f93('0x5')]('in',_0x0f93('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index ab683ba..cb5adc8 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 _0x27cf=['keys','query','filters','attributes','fields','length','order','sort','where','pick','select','field','from','tools_tags','u.id','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','start','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','toString','keyBy','merge','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','sequelize','groupBy','all','rows','catch','show','params','intersection','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','createWriteStream','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','Tags','TagIds','split','push','index','map','FaxInteraction','rawAttributes','type','key','model'];(function(_0x5db684,_0x11a298){var _0x14d7ca=function(_0x5e2fe4){while(--_0x5e2fe4){_0x5db684['push'](_0x5db684['shift']());}};_0x14d7ca(++_0x11a298);}(_0x27cf,0x9b));var _0xf27c=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x27cf[_0x1b7368];return _0x25d54c;};'use strict';var emlformat=require(_0xf27c('0x0'));var rimraf=require(_0xf27c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf27c('0x2'));var moment=require(_0xf27c('0x3'));var BPromise=require(_0xf27c('0x4'));var Mustache=require(_0xf27c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf27c('0x6'));var csv=require(_0xf27c('0x7'));var ejs=require(_0xf27c('0x8'));var fs=require('fs');var fs_extra=require(_0xf27c('0x9'));var _=require(_0xf27c('0xa'));var squel=require('squel');var crypto=require(_0xf27c('0xb'));var jsforce=require(_0xf27c('0xc'));var deskjs=require(_0xf27c('0xd'));var toCsv=require(_0xf27c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf27c('0xe'));var authService=require(_0xf27c('0xf'));var qs=require(_0xf27c('0x10'));var as=require(_0xf27c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf27c('0x12'))('api');var utils=require(_0xf27c('0x13'));var config=require(_0xf27c('0x14'));var licenseUtil=require(_0xf27c('0x15'));var db=require('../../mysqldb')['db'];config[_0xf27c('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf27c('0x17'))(new Redis(config['redis']));require(_0xf27c('0x18'))[_0xf27c('0x19')](socket);function respondWithStatusCode(_0x1aac6a,_0x5e3275){_0x5e3275=_0x5e3275||0xcc;return function(_0x40593b){if(_0x40593b){return _0x1aac6a[_0xf27c('0x1a')](_0x5e3275);}return _0x1aac6a[_0xf27c('0x1b')](_0x5e3275)[_0xf27c('0x1c')]();};}function respondWithResult(_0x3c6faa,_0x4c756e){_0x4c756e=_0x4c756e||0xc8;return function(_0x4e7ff1){if(_0x4e7ff1){return _0x3c6faa[_0xf27c('0x1b')](_0x4c756e)[_0xf27c('0x1d')](_0x4e7ff1);}};}function respondWithFilteredResult(_0x4348ed,_0x21cf6a){return function(_0x5173ac){if(_0x5173ac){var _0x4b4329=typeof _0x21cf6a[_0xf27c('0x1e')]==='undefined'&&typeof _0x21cf6a[_0xf27c('0x1f')]==='undefined';var _0x29d3a8=_0x5173ac[_0xf27c('0x20')];var _0x4b0287=_0x4b4329?0x0:_0x21cf6a[_0xf27c('0x1e')];var _0x5f5200=_0x4b4329?_0x5173ac[_0xf27c('0x20')]:_0x21cf6a[_0xf27c('0x1e')]+_0x21cf6a[_0xf27c('0x1f')];var _0x2f1721;if(_0x5f5200>=_0x29d3a8){_0x5f5200=_0x29d3a8;_0x2f1721=0xc8;}else{_0x2f1721=0xce;}_0x4348ed[_0xf27c('0x1b')](_0x2f1721);return _0x4348ed[_0xf27c('0x21')](_0xf27c('0x22'),_0x4b0287+'-'+_0x5f5200+'/'+_0x29d3a8)[_0xf27c('0x1d')](_0x5173ac);}return null;};}function patchUpdates(_0x28d8b4){return function(_0x5a0ada){try{jsonpatch[_0xf27c('0x23')](_0x5a0ada,_0x28d8b4,!![]);}catch(_0x4bd52f){return BPromise[_0xf27c('0x24')](_0x4bd52f);}return _0x5a0ada[_0xf27c('0x25')]();};}function saveUpdates(_0xfb2215,_0x4f5f61){return function(_0x4c32fa){if(_0x4c32fa){return _0x4c32fa[_0xf27c('0x26')](_0xfb2215)[_0xf27c('0x27')](function(_0x511971){return _0x511971;});}return null;};}function removeEntity(_0x45e2df,_0xacaefb){return function(_0x12e382){if(_0x12e382){return _0x12e382[_0xf27c('0x28')]()[_0xf27c('0x27')](function(){_0x45e2df[_0xf27c('0x1b')](0xcc)[_0xf27c('0x1c')]();});}};}function handleEntityNotFound(_0x1ef2fb,_0xf05e61){return function(_0x43953d){if(!_0x43953d){_0x1ef2fb[_0xf27c('0x1a')](0x194);}return _0x43953d;};}function handleError(_0x3cfad9,_0x56ea67){_0x56ea67=_0x56ea67||0x1f4;return function(_0x3bdfae){logger[_0xf27c('0x29')](_0x3bdfae[_0xf27c('0x2a')]);if(_0x3bdfae[_0xf27c('0x2b')]){delete _0x3bdfae[_0xf27c('0x2b')];}_0x3cfad9['status'](_0x56ea67)[_0xf27c('0x2c')](_0x3bdfae);};}function getInteractionUsers(_0x17e9db,_0x15c3e0){return new BPromise(function(_0x44bcea,_0x43b06c){try{if(_0x15c3e0[_0x17e9db['id']]){_0x17e9db[_0xf27c('0x2d')]=_['map'](_0x15c3e0[_0x17e9db['id']],function(_0x37be8b){return{'id':_0x37be8b['id'],'fullname':_0x37be8b[_0xf27c('0x2e')]};});}}catch(_0x384cde){_0x43b06c(_0x384cde);}_0x44bcea(_0x17e9db);});}function getInteractionTags(_0x45b486,_0x351a45){return new BPromise(function(_0x18165d,_0x48534b){try{if(_0x45b486['TagIds']){_0x45b486[_0xf27c('0x2f')]=[];_0x45b486[_0xf27c('0x30')][_0xf27c('0x31')](',')['forEach'](function(_0x55e544){_0x45b486[_0xf27c('0x2f')][_0xf27c('0x32')](_0x351a45[_0x55e544]);});}delete _0x45b486[_0xf27c('0x30')];}catch(_0x1db0b0){_0x48534b(_0x1db0b0);}_0x18165d(_0x45b486);});}function updateFaxInteraction(_0x78df42,_0x36b212,_0x3d46fe){return new BPromise(function(_0x80b3f7,_0x2f7e26){return getInteractionUsers(_0x78df42,_0x3d46fe)[_0xf27c('0x27')](function(_0x44b7c9){return getInteractionTags(_0x44b7c9,_0x36b212);})['then'](function(_0x418182){_0x80b3f7(_0x418182);})['catch'](function(_0x129b1f){_0x2f7e26(_0x129b1f);});});}exports[_0xf27c('0x33')]=function(_0xd66bb8,_0x266a90){var _0x479528={},_0x2ed4f8={},_0x555c6b={'count':0x0,'rows':[]};var _0x102893=_[_0xf27c('0x34')](db[_0xf27c('0x35')][_0xf27c('0x36')],function(_0x28a8e3){return{'name':_0x28a8e3['fieldName'],'type':_0x28a8e3[_0xf27c('0x37')][_0xf27c('0x38')]};});_0x2ed4f8[_0xf27c('0x39')]=_[_0xf27c('0x34')](_0x102893,_0xf27c('0x2b'));_0x2ed4f8['query']=_[_0xf27c('0x3a')](_0xd66bb8[_0xf27c('0x3b')]);_0x2ed4f8[_0xf27c('0x3c')]=_['intersection'](_0x2ed4f8['model'],_0x2ed4f8[_0xf27c('0x3b')]);_0x479528[_0xf27c('0x3d')]=_['intersection'](_0x2ed4f8[_0xf27c('0x39')],qs['fields'](_0xd66bb8['query'][_0xf27c('0x3e')]));_0x479528['attributes']=_0x479528['attributes'][_0xf27c('0x3f')]?_0x479528['attributes']:_0x2ed4f8['model'];if(!_0xd66bb8[_0xf27c('0x3b')]['hasOwnProperty']('nolimit')){_0x479528['limit']=qs[_0xf27c('0x1f')](_0xd66bb8[_0xf27c('0x3b')]['limit']);_0x479528['offset']=qs['offset'](_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x1e')]);}_0x479528[_0xf27c('0x40')]=qs[_0xf27c('0x41')](_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x41')]);_0x479528[_0xf27c('0x42')]=qs['filters'](_[_0xf27c('0x43')](_0xd66bb8[_0xf27c('0x3b')],_0x2ed4f8['filters']),_0x102893);var _0x233a15=[];var _0x39b876=squel[_0xf27c('0x44')]()[_0xf27c('0x45')]('id')[_0xf27c('0x45')]('name')['field']('color')[_0xf27c('0x46')](_0xf27c('0x47'));var _0x208304=squel[_0xf27c('0x44')]()[_0xf27c('0x45')](_0xf27c('0x48'))[_0xf27c('0x45')]('u.fullname')[_0xf27c('0x45')]('ui.FaxInteractionId')[_0xf27c('0x46')](_0xf27c('0x49'),'ui')[_0xf27c('0x4a')](_0xf27c('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0xc26967=squel[_0xf27c('0x44')]()['from'](_0xf27c('0x4c'),'i')[_0xf27c('0x4a')](_0xf27c('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf27c('0x4a')](_0xf27c('0x4b'),'o',_0xf27c('0x4e'))['left_join']('fax_accounts','a',_0xf27c('0x4f'))[_0xf27c('0x4a')](_0xf27c('0x50'),'me',_0xf27c('0x51'))[_0xf27c('0x4a')](_0xf27c('0x52'),'it',_0xf27c('0x53'))['left_join'](_0xf27c('0x47'),'t',_0xf27c('0x54'));var _0x2a18ec=squel[_0xf27c('0x55')]();var _0x420234=[];var _0x17bc14=squel[_0xf27c('0x55')]();var _0x34d3d2;if(_0xd66bb8[_0xf27c('0x3b')]['search']){_0x34d3d2=as[_0xf27c('0x56')](_0xd66bb8[_0xf27c('0x3b')]['search']);var _0x17d374=_0x34d3d2[_0xf27c('0x57')];for(var _0x462a69=0x0;_0x462a69<_0x34d3d2[_0xf27c('0x58')][_0xf27c('0x3f')];_0x462a69++){var _0x28fcf3=_0x34d3d2[_0xf27c('0x58')][_0x462a69];var _0x55944a='i';var _0x64cdae=_[_0xf27c('0x59')](_0x102893,[_0xf27c('0x2b'),_0x28fcf3[_0xf27c('0x45')]]);if(!_0x64cdae){switch(_0x28fcf3['field']){case _0xf27c('0x5a'):if(_0x28fcf3[_0xf27c('0x5b')]==0x1){_0xc26967[_0xf27c('0x5c')]('`'+_0x28fcf3[_0xf27c('0x45')]+_0xf27c('0x5d'));}else{_0xc26967[_0xf27c('0x5c')]('`'+_0x28fcf3[_0xf27c('0x45')]+_0xf27c('0x5e'));}break;case _0xf27c('0x5f'):if(_0x28fcf3[_0xf27c('0x60')]===_0xf27c('0x61')){if(_0x28fcf3[_0xf27c('0x5b')][_0xf27c('0x31')]('\x20')[_0xf27c('0x3f')]>0x1){_0x2a18ec[_0x17d374]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf27c('0x62')](_0x28fcf3[_0xf27c('0x5b')]),null);}else{var _0x3c1bfb='%'+_0x28fcf3['value']+'%';_0x2a18ec[_0x17d374]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3c1bfb,_0x3c1bfb,_0x3c1bfb);}}else{_0x64cdae=_[_0xf27c('0x59')](_0x102893,[_0xf27c('0x2b'),_0xf27c('0x63')]);_0x28fcf3[_0xf27c('0x45')]=_0xf27c('0x63');_0x28c912=as[_0xf27c('0x64')](_0x55944a,_0x64cdae[_0xf27c('0x37')],_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912[_0xf27c('0x65')],_0x28c912[_0xf27c('0x5b')]['start'],_0x28c912['value'][_0xf27c('0x1c')]);}break;case'Tag':var _0x1034e6=_0x28fcf3['value'][_0xf27c('0x31')](',')['map'](function(_0x5930a1){return Number(_0x5930a1);});_0x1034e6[_0xf27c('0x66')](function(_0x559400){_0x17bc14['or'](_0xf27c('0x67'),'%,'+_0x559400+',%');});_0x420234=_['union'](_0x420234,_0x1034e6);break;case _0xf27c('0x68'):if(_0x28fcf3[_0xf27c('0x60')]===_0xf27c('0x61')){_0x2a18ec[_0x17d374]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x28fcf3[_0xf27c('0x5b')]+'%',null);}else{_0x64cdae=_['find'](_0x102893,[_0xf27c('0x2b'),_0xf27c('0x69')]);_0x28fcf3[_0xf27c('0x45')]=_0xf27c('0x69');_0x28c912=as['buildExpression'](_0x55944a,_0x64cdae[_0xf27c('0x37')],_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912['text'],_0x28c912[_0xf27c('0x5b')][_0xf27c('0x6a')],_0x28c912['value'][_0xf27c('0x1c')]);}break;case _0xf27c('0x6b'):_0x28c912=as[_0xf27c('0x64')]('me',null,_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912['text'],_0x28c912[_0xf27c('0x5b')][_0xf27c('0x6a')],_0x28c912[_0xf27c('0x5b')]['end']);break;}}else{var _0x28c912=as['buildExpression'](_0x55944a,_0x64cdae[_0xf27c('0x37')],_0x28fcf3);_0x2a18ec[_0x17d374](_0x28c912[_0xf27c('0x65')],_0x28c912[_0xf27c('0x5b')]['start'],_0x28c912[_0xf27c('0x5b')][_0xf27c('0x1c')]);}}}else{var _0x5b5e60=_(_0xd66bb8[_0xf27c('0x3b')])[_0xf27c('0x3a')]()[_0xf27c('0x34')](function(_0x31ba75){return _[_0xf27c('0x6c')](_0x102893,[_0xf27c('0x2b'),_0x31ba75])?_0x31ba75:undefined;})[_0xf27c('0x6d')]()[_0xf27c('0x5b')]();if(!_[_0xf27c('0x6e')](_0x5b5e60)){_0x5b5e60[_0xf27c('0x66')](function(_0x4df506){if(_0x4df506===_0xf27c('0x6f')){_0xc26967['where'](_0xf27c('0x70'),[]['concat'](_0xd66bb8[_0xf27c('0x3b')][_0x4df506]));}else if(_0x4df506==='createdAt'){var _0x279ef7=JSON[_0xf27c('0x71')](_0xd66bb8['query'][_0x4df506])[_0xf27c('0x72')];var _0x29f8d9=JSON[_0xf27c('0x71')](_0xd66bb8[_0xf27c('0x3b')][_0x4df506])[_0xf27c('0x73')];_0xc26967[_0xf27c('0x42')](_0xf27c('0x74'),_0x279ef7,_0x29f8d9);}else{if(_0xd66bb8['query'][_0x4df506]===_0xf27c('0x75')){_0xc26967[_0xf27c('0x42')]('i.'+_0x4df506+_0xf27c('0x76'));}else{_0xc26967[_0xf27c('0x42')]('i.'+_0x4df506+_0xf27c('0x77'),_0xd66bb8['query'][_0x4df506]);}}});}if(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x78')]){if(_0xd66bb8['query'][_0xf27c('0x78')]==0x1){_0xc26967['having'](_0xf27c('0x79'));}else{_0xc26967[_0xf27c('0x5c')](_0xf27c('0x7a'));}}if(_0xd66bb8[_0xf27c('0x3b')]['tag']){_0x420234=_[_0xf27c('0x7b')](_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7c')])?_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7c')]:new Array(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7c')]);_0x420234[_0xf27c('0x66')](function(_0x14f3e5){_0x17bc14['or'](_0xf27c('0x67'),'%,'+_0x14f3e5+',%');});}if(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7d')]){var _0x247ec7=_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x7d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf27c('0x7e')](_0x247ec7)){_0x2a18ec['or'](_0xf27c('0x7f'),_0x247ec7+'%')['or'](_0xf27c('0x80'),_0x247ec7+'%');}_0x2a18ec['or'](_0xf27c('0x81'),_0x247ec7+'%');}}_0xc26967['where'](_0x2a18ec);_0xc26967[_0xf27c('0x82')](_0xf27c('0x83'));var _0x10997d={'type':db[_0xf27c('0x84')][_0xf27c('0x85')][_0xf27c('0x86')],'raw':!![]};var _0x49b895=_0xc26967[_0xf27c('0x87')]();_0x49b895[_0xf27c('0x45')](_0xf27c('0x83'));_0x49b895[_0xf27c('0x45')](_0xf27c('0x88'),_0xf27c('0x5a'));if(_0x479528[_0xf27c('0x40')]){_0x479528[_0xf27c('0x40')]['forEach'](function(_0x3c437f){var _0x318f68=_0x3c437f[0x0]===_0xf27c('0x89')?_0x3c437f[0x0]:'i.'+_0x3c437f[0x0];_0xc26967[_0xf27c('0x40')](_0x318f68,_0x3c437f[0x1]===_0xf27c('0x8a')?![]:!![]);});}if(!_[_0xf27c('0x6e')](_0x420234)){_0xc26967[_0xf27c('0x5c')](_0x17bc14);_0x49b895[_0xf27c('0x42')](_0xf27c('0x8b'),_0x420234);}BPromise[_0xf27c('0x8c')]()[_0xf27c('0x27')](function(){if(!_0x34d3d2){if(_0xd66bb8[_0xf27c('0x3b')]['FaxAccountId'])return;_0x49b895[_0xf27c('0x42')](_0xf27c('0x8d'));_0xc26967[_0xf27c('0x42')](_0xf27c('0x8d'));return;}if(_0xd66bb8['user'][_0xf27c('0x8e')]!=='agent')return;return _0xd66bb8[_0xf27c('0x8f')][_0xf27c('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x120acf){if(_['isEmpty'](_0x120acf)){_0x49b895[_0xf27c('0x42')](_0xf27c('0x91'));_0xc26967[_0xf27c('0x42')](_0xf27c('0x91'));}else{_0x49b895[_0xf27c('0x42')](_0xf27c('0x70'),_[_0xf27c('0x34')](_0x120acf,'id'));_0xc26967[_0xf27c('0x42')](_0xf27c('0x70'),_['map'](_0x120acf,'id'));}});})['then'](function(){if(_0xd66bb8[_0xf27c('0x8f')]['role']===_0xf27c('0x92')&&!_0x34d3d2&&!_0xd66bb8[_0xf27c('0x3b')]['FaxAccountId'])return[];return db['sequelize']['query'](_0x49b895[_0xf27c('0x93')](),_0x10997d);})[_0xf27c('0x27')](function(_0xb8c0f){_0x555c6b[_0xf27c('0x20')]=_0xb8c0f[_0xf27c('0x3f')];if(_0x555c6b[_0xf27c('0x20')]===0x0)return[];return db['sequelize'][_0xf27c('0x3b')](_0x39b876[_0xf27c('0x93')](),_0x10997d)['then'](function(_0x59303a){_0x233a15=_[_0xf27c('0x94')](_0x59303a,'id');_0x10997d=_[_0xf27c('0x95')](_0x10997d,{'model':db[_0xf27c('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd66bb8[_0xf27c('0x3b')][_0xf27c('0x3e')]){_0x479528[_0xf27c('0x3d')]['forEach'](function(_0x25e6c5){_0xc26967[_0xf27c('0x45')]('i.'+_0x25e6c5);});}else{_0xc26967[_0xf27c('0x45')](_0xf27c('0x88'),_0xf27c('0x5a'));_0xc26967[_0xf27c('0x45')]('a.key',_0xf27c('0x96'));_0xc26967[_0xf27c('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xc26967[_0xf27c('0x45')](_0xf27c('0x97'),_0xf27c('0x89'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x98'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x99'),'Contact.firstName');_0xc26967[_0xf27c('0x45')](_0xf27c('0x9a'),_0xf27c('0x9b'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x9c'),_0xf27c('0x9d'));_0xc26967[_0xf27c('0x45')]('c.phone',_0xf27c('0x9e'));_0xc26967[_0xf27c('0x45')](_0xf27c('0x9f'),'Contact.mobile');_0xc26967['field'](_0xf27c('0xa0'),'Contact.fax');_0xc26967[_0xf27c('0x45')](_0xf27c('0xa1'),_0xf27c('0xa2'));_0xc26967[_0xf27c('0x45')]('o.internal',_0xf27c('0xa3'));_0xc26967['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf27c('0x30'));}if(_0x479528['limit'])_0xc26967[_0xf27c('0x1f')](_0x479528['limit']);if(_0x479528[_0xf27c('0x1e')])_0xc26967[_0xf27c('0x1e')](_0x479528[_0xf27c('0x1e')]);return db[_0xf27c('0xa4')][_0xf27c('0x3b')](_0xc26967[_0xf27c('0x93')](),_0x10997d);})[_0xf27c('0x27')](function(_0x2ffa1d){if(_0x2ffa1d[_0xf27c('0x3f')]>0x0)_0x208304[_0xf27c('0x42')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x2ffa1d,'id'));return db['sequelize'][_0xf27c('0x3b')](_0x208304[_0xf27c('0x93')](),_0x10997d)[_0xf27c('0x27')](function(_0x5c3cd4){var _0x49c904=_[_0xf27c('0xa5')](_0x5c3cd4,'FaxInteractionId');var _0x436b2d=[];_0x2ffa1d[_0xf27c('0x66')](function(_0x37f6b8){_0x436b2d[_0xf27c('0x32')](updateFaxInteraction(_0x37f6b8,_0x233a15,_0x49c904));});return BPromise[_0xf27c('0xa6')](_0x436b2d);});});})[_0xf27c('0x27')](function(_0x1d54fc){_0x555c6b[_0xf27c('0xa7')]=_0x1d54fc;return _0x555c6b;})[_0xf27c('0x27')](respondWithFilteredResult(_0x266a90,_0x479528))[_0xf27c('0xa8')](handleError(_0x266a90,null));};exports[_0xf27c('0xa9')]=function(_0x4d48d1,_0x4fa6ad){var _0x12bc70={'raw':![],'where':{'id':_0x4d48d1[_0xf27c('0xaa')]['id']}},_0x48ba12={};_0x48ba12[_0xf27c('0x39')]=_[_0xf27c('0x3a')](db[_0xf27c('0x35')]['rawAttributes']);_0x48ba12[_0xf27c('0x3b')]=_['keys'](_0x4d48d1[_0xf27c('0x3b')]);_0x48ba12[_0xf27c('0x3c')]=_[_0xf27c('0xab')](_0x48ba12['model'],_0x48ba12[_0xf27c('0x3b')]);_0x12bc70[_0xf27c('0x3d')]=_[_0xf27c('0xab')](_0x48ba12[_0xf27c('0x39')],qs[_0xf27c('0x3e')](_0x4d48d1[_0xf27c('0x3b')][_0xf27c('0x3e')]));_0x12bc70['attributes']=_0x12bc70[_0xf27c('0x3d')][_0xf27c('0x3f')]?_0x12bc70[_0xf27c('0x3d')]:_0x48ba12[_0xf27c('0x39')];if(_0x4d48d1['query']['includeAll']){_0x12bc70[_0xf27c('0xac')]=[{'all':!![]}];}_0x12bc70=_['merge']({},_0x12bc70,_0x4d48d1[_0xf27c('0xad')]);return db[_0xf27c('0x35')][_0xf27c('0x59')](_0x12bc70)[_0xf27c('0x27')](handleEntityNotFound(_0x4fa6ad,null))[_0xf27c('0x27')](respondWithResult(_0x4fa6ad,null))[_0xf27c('0xa8')](handleError(_0x4fa6ad,null));};exports[_0xf27c('0xae')]=function(_0x330e71,_0x3c7c14){return db[_0xf27c('0x35')][_0xf27c('0xae')](_0x330e71[_0xf27c('0x6b')],{})[_0xf27c('0x27')](respondWithResult(_0x3c7c14,0xc9))[_0xf27c('0xa8')](handleError(_0x3c7c14,null));};exports[_0xf27c('0x26')]=function(_0x48b107,_0x120568){if(_0x48b107[_0xf27c('0x6b')]['id']){delete _0x48b107[_0xf27c('0x6b')]['id'];}return db[_0xf27c('0x35')][_0xf27c('0x59')]({'where':{'id':_0x48b107[_0xf27c('0xaa')]['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x120568,null))[_0xf27c('0x27')](saveUpdates(_0x48b107[_0xf27c('0x6b')],null))[_0xf27c('0x27')](respondWithResult(_0x120568,null))[_0xf27c('0xa8')](handleError(_0x120568,null));};exports[_0xf27c('0x28')]=function(_0x1356a6,_0x3f245b){return db[_0xf27c('0x35')][_0xf27c('0x59')]({'where':{'id':_0x1356a6[_0xf27c('0xaa')]['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x3f245b,null))['then'](removeEntity(_0x3f245b,null))['catch'](handleError(_0x3f245b,null));};exports['describe']=function(_0x25a0bb,_0x1f1082){return db[_0xf27c('0x35')][_0xf27c('0xaf')]()[_0xf27c('0x27')](respondWithResult(_0x1f1082,null))[_0xf27c('0xa8')](handleError(_0x1f1082,null));};exports[_0xf27c('0xb0')]=function(_0x1b0f5e,_0x2c7071,_0x29bbce){return db[_0xf27c('0xb1')][_0xf27c('0x59')]({'where':{'id':_0x1b0f5e['params']['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x2c7071,null))['then'](function(_0x1390ce){if(_0x1390ce){return _0x1390ce['addMessage'](_0x1b0f5e[_0xf27c('0x6b')][_0xf27c('0xb2')],_[_0xf27c('0xb3')](_0x1b0f5e[_0xf27c('0x6b')],['ids','id'])||{});}})['then'](respondWithResult(_0x2c7071,null))[_0xf27c('0xa8')](handleError(_0x2c7071,null));};exports[_0xf27c('0xb4')]=function(_0x2d91c0,_0x18394a,_0x17bd2b){var _0x143390={'raw':![],'where':{}};var _0xf8165a={};var _0x176f12={'count':0x0,'rows':[]};return db[_0xf27c('0x35')][_0xf27c('0xb5')]({'where':{'id':_0x2d91c0['params']['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x18394a,null))['then'](function(_0x39bef5){if(_0x39bef5){_0xf8165a['model']=_['keys'](db[_0xf27c('0xb1')]['rawAttributes']);_0xf8165a[_0xf27c('0x3b')]=_[_0xf27c('0x3a')](_0x2d91c0['query']);_0xf8165a['filters']=_[_0xf27c('0xab')](_0xf8165a[_0xf27c('0x39')],_0xf8165a[_0xf27c('0x3b')]);_0x143390[_0xf27c('0x3d')]=_[_0xf27c('0xab')](_0xf8165a['model'],qs[_0xf27c('0x3e')](_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x3e')]));_0x143390[_0xf27c('0x3d')]=_0x143390[_0xf27c('0x3d')][_0xf27c('0x3f')]?_0x143390[_0xf27c('0x3d')]:_0xf8165a[_0xf27c('0x39')];if(!_0x2d91c0['query'][_0xf27c('0xb6')](_0xf27c('0xb7'))){_0x143390[_0xf27c('0x1f')]=qs[_0xf27c('0x1f')](_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x1f')]);_0x143390[_0xf27c('0x1e')]=qs[_0xf27c('0x1e')](_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x1e')]);}_0x143390[_0xf27c('0x40')]=qs[_0xf27c('0x41')](_0x2d91c0[_0xf27c('0x3b')]['sort']);_0x143390[_0xf27c('0x42')]=qs[_0xf27c('0x3c')](_['pick'](_0x2d91c0[_0xf27c('0x3b')],_0xf8165a['filters']));_0x143390[_0xf27c('0x42')][_0xf27c('0xb8')]=_0x39bef5['id'];if(_0x2d91c0['query']['filter']){_0x143390['where']=_[_0xf27c('0x95')](_0x143390[_0xf27c('0x42')],{'$or':_['map'](_0x143390['attributes'],function(_0x2c14c3){var _0x19d723={};_0x19d723[_0x2c14c3]={'$like':'%'+_0x2d91c0[_0xf27c('0x3b')]['filter']+'%'};return _0x19d723;})});}if(_0x2d91c0[_0xf27c('0x3b')][_0xf27c('0x72')]){var _0x168d6d=_0x2d91c0[_0xf27c('0x3b')]['$gte']['split'](',');var _0x418514={};_0x418514[_0x168d6d[0x0]]={'$gte':moment(_0x168d6d[0x1])[_0xf27c('0xb9')](_0xf27c('0xba'))};_0x143390[_0xf27c('0x42')]=_[_0xf27c('0x95')](_0x143390[_0xf27c('0x42')],_0x418514);}_0x143390=_[_0xf27c('0x95')]({},_0x143390,_0x2d91c0['options']);return db['FaxMessage'][_0xf27c('0x20')]({'where':_0x143390[_0xf27c('0x42')]})['then'](function(_0x5a3371){_0x176f12['count']=_0x5a3371;if(_0x2d91c0[_0xf27c('0x3b')]['includeAll']){_0x143390[_0xf27c('0xac')]=[{'all':!![]}];}return db['FaxMessage'][_0xf27c('0xbb')](_0x143390);})[_0xf27c('0x27')](function(_0x45d673){_0x176f12[_0xf27c('0xa7')]=_0x45d673;return _0x176f12;});}})[_0xf27c('0x27')](respondWithFilteredResult(_0x18394a,_0x143390))[_0xf27c('0xa8')](handleError(_0x18394a,null));};exports[_0xf27c('0xbc')]=function(_0x3ade9a,_0x59cbfe,_0x465e40){return db[_0xf27c('0x35')][_0xf27c('0x59')]({'where':{'id':_0x3ade9a[_0xf27c('0xaa')]['id']}})['then'](handleEntityNotFound(_0x59cbfe,null))['then'](function(_0x1b04f5){if(_0x1b04f5){return _0x1b04f5[_0xf27c('0xbd')](_0x3ade9a[_0xf27c('0x6b')][_0xf27c('0xb2')],_[_0xf27c('0xb3')](_0x3ade9a[_0xf27c('0x6b')],['ids','id'])||{})[_0xf27c('0xbe')](function(){return db[_0xf27c('0xbf')]['findAll']({'attributes':['id',_0xf27c('0x2b'),_0xf27c('0xc0')],'where':{'id':_0x3ade9a[_0xf27c('0x6b')][_0xf27c('0xb2')]}});})['then'](function(_0x2c5269){socket[_0xf27c('0xc1')](_0xf27c('0xc2'),{'id':Number(_0x3ade9a[_0xf27c('0xaa')]['id']),'tags':_0x2c5269||[]});return{'id':Number(_0x3ade9a[_0xf27c('0xaa')]['id']),'tags':_0x2c5269||[]};});}})[_0xf27c('0x27')](respondWithResult(_0x59cbfe,null))['catch'](handleError(_0x59cbfe,null));};exports[_0xf27c('0xc3')]=function(_0x263670,_0x3537d7,_0x38c629){return db['FaxInteraction']['find']({'where':{'id':_0x263670[_0xf27c('0xaa')]['id']}})[_0xf27c('0x27')](handleEntityNotFound(_0x3537d7,null))['then'](function(_0x735d89){if(_0x735d89){return _0x735d89['removeTags'](_0x263670[_0xf27c('0x3b')][_0xf27c('0xb2')]);}})[_0xf27c('0x27')](respondWithStatusCode(_0x3537d7,null))[_0xf27c('0xa8')](handleError(_0x3537d7,null));};exports[_0xf27c('0xc4')]=function(_0x5e97fe,_0x160b41){var _0x5d51d5=moment()['unix']()['toString']();var _0x29f72b=path[_0xf27c('0xc5')](config['root'],_0xf27c('0xc6'),_0xf27c('0xc7'),_0xf27c('0xc8'));var _0x44cd9d=path[_0xf27c('0xc5')](config[_0xf27c('0xc9')],_0xf27c('0xc6'),_0xf27c('0xc7'),_0xf27c('0xca'));var _0x1837f6=path[_0xf27c('0xc5')](_0x29f72b,_0x5d51d5);var _0x2734ae=util[_0xf27c('0xb9')]('transcript-%d-%s.zip',_0x5e97fe['params']['id'],_0x5d51d5);var _0x2badf1=path['join'](_0x29f72b,_0x2734ae);var _0x48f6c1=[];_0x48f6c1[_0xf27c('0x32')]({'model':db['Attachment'],'as':_0xf27c('0xcb'),'raw':!![]});var _0x29bca3=[{'model':db[_0xf27c('0xb1')],'as':_0xf27c('0xcc'),'attributes':['id',_0xf27c('0x6b'),_0xf27c('0xcd')],'include':_0x48f6c1}];return db['FaxInteraction']['find']({'where':{'id':_0x5e97fe[_0xf27c('0xaa')]['id']},'include':_0x29bca3})['then'](handleEntityNotFound(_0x160b41,null))[_0xf27c('0x27')](function(_0x3d609d){if(_0x3d609d&&_0x3d609d[_0xf27c('0xcc')]){var _0x4441ea=_0x3d609d[_0xf27c('0xce')]({'plain':!![]});fs['mkdirSync'](_0x1837f6);for(var _0x1fea05=0x0;_0x1fea05<_0x4441ea[_0xf27c('0xcc')]['length'];_0x1fea05++){var _0x23119c=_0x4441ea[_0xf27c('0xcc')][_0x1fea05][_0xf27c('0xcb')];if(_0x23119c){var _0x23e1fb=path[_0xf27c('0xc5')](_0x44cd9d,_0x23119c[_0xf27c('0xcf')]);if(fs[_0xf27c('0xd0')](_0x23e1fb)){fs[_0xf27c('0xd1')](_0x23e1fb)['pipe'](fs[_0xf27c('0xd2')](path['join'](_0x1837f6,_0x23119c[_0xf27c('0xcf')])));}}}return BPromise[_0xf27c('0x8c')]()[_0xf27c('0x27')](function(){return new BPromise(function(_0x2d68df,_0x35a9cb){zipdir(_0x1837f6,{'saveTo':_0x2badf1},function(_0x5c5d7b,_0x5c79b9){if(_0x5c5d7b)return _0x35a9cb(_0x5c5d7b);return _0x2d68df(_0x5c79b9);});})[_0xf27c('0x27')](function(){return new BPromise(function(_0x546680,_0x1c2aa0){rimraf(_0x1837f6,function(_0x378140){if(_0x378140)_0x1c2aa0(_0x378140);return _0x546680();});});})[_0xf27c('0x27')](function(){return _0x160b41[_0xf27c('0xc4')](_0x2badf1,_0x2734ae,function(_0x54a445){if(_0x54a445){console['log'](_0xf27c('0xd3'),_0x54a445);}else{fs[_0xf27c('0xd4')](_0x2badf1);}});});});}else{return _0x160b41[_0xf27c('0x1a')](0xc8);}})['catch'](handleError(_0x160b41,null));}; \ No newline at end of file +var _0x20c6=['createWriteStream','log','eml-format','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','map','fullname','TagIds','split','forEach','push','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','select','field','color','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','from','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','order','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','rows','catch','show','params','includeAll','include','FaxInteraction','find','create','describe','addMessage','FaxMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream'];(function(_0x4ebc94,_0x1b5aa1){var _0x1bbfdb=function(_0x373206){while(--_0x373206){_0x4ebc94['push'](_0x4ebc94['shift']());}};_0x1bbfdb(++_0x1b5aa1);}(_0x20c6,0xd4));var _0x620c=function(_0x286a7f,_0x21db56){_0x286a7f=_0x286a7f-0x0;var _0x3faca1=_0x20c6[_0x286a7f];return _0x3faca1;};'use strict';var emlformat=require(_0x620c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x620c('0x1'));var moment=require(_0x620c('0x2'));var BPromise=require(_0x620c('0x3'));var Mustache=require(_0x620c('0x4'));var util=require(_0x620c('0x5'));var path=require('path');var sox=require(_0x620c('0x6'));var csv=require(_0x620c('0x7'));var ejs=require(_0x620c('0x8'));var fs=require('fs');var fs_extra=require(_0x620c('0x9'));var _=require(_0x620c('0xa'));var squel=require(_0x620c('0xb'));var crypto=require(_0x620c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x620c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x620c('0xe'));var Papa=require('papaparse');var Redis=require(_0x620c('0xf'));var authService=require(_0x620c('0x10'));var qs=require(_0x620c('0x11'));var as=require(_0x620c('0x12'));var hardwareService=require(_0x620c('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x620c('0x14'));var db=require(_0x620c('0x15'))['db'];config[_0x620c('0x16')]=_[_0x620c('0x17')](config[_0x620c('0x16')],{'host':_0x620c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x620c('0x16')]));require(_0x620c('0x19'))[_0x620c('0x1a')](socket);function respondWithStatusCode(_0x5d4e4c,_0x547477){_0x547477=_0x547477||0xcc;return function(_0x1e524b){if(_0x1e524b){return _0x5d4e4c[_0x620c('0x1b')](_0x547477);}return _0x5d4e4c[_0x620c('0x1c')](_0x547477)[_0x620c('0x1d')]();};}function respondWithResult(_0x5b76d7,_0x23e432){_0x23e432=_0x23e432||0xc8;return function(_0x2a7e39){if(_0x2a7e39){return _0x5b76d7[_0x620c('0x1c')](_0x23e432)[_0x620c('0x1e')](_0x2a7e39);}};}function respondWithFilteredResult(_0x5d5161,_0x182fb6){return function(_0x22f167){if(_0x22f167){var _0x4bd7b=typeof _0x182fb6[_0x620c('0x1f')]===_0x620c('0x20')&&typeof _0x182fb6[_0x620c('0x21')]===_0x620c('0x20');var _0x1bc7a0=_0x22f167[_0x620c('0x22')];var _0x253af7=_0x4bd7b?0x0:_0x182fb6[_0x620c('0x1f')];var _0x21545c=_0x4bd7b?_0x22f167[_0x620c('0x22')]:_0x182fb6['offset']+_0x182fb6['limit'];var _0x1a57c1;if(_0x21545c>=_0x1bc7a0){_0x21545c=_0x1bc7a0;_0x1a57c1=0xc8;}else{_0x1a57c1=0xce;}_0x5d5161[_0x620c('0x1c')](_0x1a57c1);return _0x5d5161['set'](_0x620c('0x23'),_0x253af7+'-'+_0x21545c+'/'+_0x1bc7a0)['json'](_0x22f167);}return null;};}function patchUpdates(_0xb88ac3){return function(_0x4f04b7){try{jsonpatch[_0x620c('0x24')](_0x4f04b7,_0xb88ac3,!![]);}catch(_0x2b6798){return BPromise[_0x620c('0x25')](_0x2b6798);}return _0x4f04b7[_0x620c('0x26')]();};}function saveUpdates(_0x4dd2c6,_0x5186b6){return function(_0x44c00b){if(_0x44c00b){return _0x44c00b[_0x620c('0x27')](_0x4dd2c6)[_0x620c('0x28')](function(_0x27335d){return _0x27335d;});}return null;};}function removeEntity(_0x2cb781,_0x6385c7){return function(_0x281461){if(_0x281461){return _0x281461['destroy']()[_0x620c('0x28')](function(){_0x2cb781[_0x620c('0x1c')](0xcc)[_0x620c('0x1d')]();});}};}function handleEntityNotFound(_0x373b20,_0x65d673){return function(_0x9661fd){if(!_0x9661fd){_0x373b20[_0x620c('0x1b')](0x194);}return _0x9661fd;};}function handleError(_0x5c4f09,_0x394e55){_0x394e55=_0x394e55||0x1f4;return function(_0x58c130){logger[_0x620c('0x29')](_0x58c130[_0x620c('0x2a')]);if(_0x58c130[_0x620c('0x2b')]){delete _0x58c130[_0x620c('0x2b')];}_0x5c4f09[_0x620c('0x1c')](_0x394e55)['send'](_0x58c130);};}function getInteractionUsers(_0x533508,_0x45f91e){return new BPromise(function(_0x423b82,_0x1aa8b3){try{if(_0x45f91e[_0x533508['id']]){_0x533508['Users']=_[_0x620c('0x2c')](_0x45f91e[_0x533508['id']],function(_0x14bf3e){return{'id':_0x14bf3e['id'],'fullname':_0x14bf3e[_0x620c('0x2d')]};});}}catch(_0x4dbc13){_0x1aa8b3(_0x4dbc13);}_0x423b82(_0x533508);});}function getInteractionTags(_0x54a4a0,_0x3d14c7){return new BPromise(function(_0x1c50fd,_0x3ba969){try{if(_0x54a4a0['TagIds']){_0x54a4a0['Tags']=[];_0x54a4a0[_0x620c('0x2e')][_0x620c('0x2f')](',')[_0x620c('0x30')](function(_0x98ab86){_0x54a4a0['Tags'][_0x620c('0x31')](_0x3d14c7[_0x98ab86]);});}delete _0x54a4a0['TagIds'];}catch(_0x55757f){_0x3ba969(_0x55757f);}_0x1c50fd(_0x54a4a0);});}function updateFaxInteraction(_0x146d9d,_0x559388,_0x572b6f){return new BPromise(function(_0x4fbe4a,_0x450dd6){return getInteractionUsers(_0x146d9d,_0x572b6f)[_0x620c('0x28')](function(_0x39bde2){return getInteractionTags(_0x39bde2,_0x559388);})[_0x620c('0x28')](function(_0x414603){_0x4fbe4a(_0x414603);})['catch'](function(_0x2b093e){_0x450dd6(_0x2b093e);});});}exports[_0x620c('0x32')]=function(_0x4bfd50,_0x4bf719){var _0x1619c3={},_0x505be9={},_0x112f1c={'count':0x0,'rows':[]};var _0x2e6d46=_[_0x620c('0x2c')](db['FaxInteraction'][_0x620c('0x33')],function(_0x366614){return{'name':_0x366614['fieldName'],'type':_0x366614[_0x620c('0x34')][_0x620c('0x35')]};});_0x505be9[_0x620c('0x36')]=_[_0x620c('0x2c')](_0x2e6d46,_0x620c('0x2b'));_0x505be9[_0x620c('0x37')]=_[_0x620c('0x38')](_0x4bfd50[_0x620c('0x37')]);_0x505be9[_0x620c('0x39')]=_[_0x620c('0x3a')](_0x505be9[_0x620c('0x36')],_0x505be9[_0x620c('0x37')]);_0x1619c3[_0x620c('0x3b')]=_[_0x620c('0x3a')](_0x505be9[_0x620c('0x36')],qs['fields'](_0x4bfd50[_0x620c('0x37')]['fields']));_0x1619c3[_0x620c('0x3b')]=_0x1619c3[_0x620c('0x3b')][_0x620c('0x3c')]?_0x1619c3[_0x620c('0x3b')]:_0x505be9[_0x620c('0x36')];if(!_0x4bfd50[_0x620c('0x37')][_0x620c('0x3d')](_0x620c('0x3e'))){_0x1619c3[_0x620c('0x21')]=qs['limit'](_0x4bfd50[_0x620c('0x37')][_0x620c('0x21')]);_0x1619c3[_0x620c('0x1f')]=qs[_0x620c('0x1f')](_0x4bfd50[_0x620c('0x37')][_0x620c('0x1f')]);}_0x1619c3['order']=qs['sort'](_0x4bfd50[_0x620c('0x37')][_0x620c('0x3f')]);_0x1619c3[_0x620c('0x40')]=qs['filters'](_['pick'](_0x4bfd50['query'],_0x505be9['filters']),_0x2e6d46);var _0x8ee301=[];var _0x497837=squel[_0x620c('0x41')]()[_0x620c('0x42')]('id')[_0x620c('0x42')](_0x620c('0x2b'))['field'](_0x620c('0x43'))['from'](_0x620c('0x44'));var _0x1982fa=squel[_0x620c('0x41')]()[_0x620c('0x42')](_0x620c('0x45'))[_0x620c('0x42')](_0x620c('0x46'))['field']('ui.FaxInteractionId')['from'](_0x620c('0x47'),'ui')[_0x620c('0x48')](_0x620c('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x5bbf70=squel[_0x620c('0x41')]()[_0x620c('0x4a')](_0x620c('0x4b'),'i')[_0x620c('0x48')](_0x620c('0x4c'),'c',_0x620c('0x4d'))[_0x620c('0x48')](_0x620c('0x49'),'o',_0x620c('0x4e'))['left_join'](_0x620c('0x4f'),'a',_0x620c('0x50'))[_0x620c('0x48')](_0x620c('0x51'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x620c('0x48')](_0x620c('0x52'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join'](_0x620c('0x44'),'t','t.id\x20=\x20it.TagId');var _0x96859f=squel[_0x620c('0x53')]();var _0x387f39=[];var _0xd84237=squel[_0x620c('0x53')]();var _0x2178d1;if(_0x4bfd50[_0x620c('0x37')][_0x620c('0x54')]){_0x2178d1=as['parseSearch'](_0x4bfd50[_0x620c('0x37')]['search']);var _0x13dfbe=_0x2178d1[_0x620c('0x55')];for(var _0x540893=0x0;_0x540893<_0x2178d1['conditions'][_0x620c('0x3c')];_0x540893++){var _0x432a4b=_0x2178d1[_0x620c('0x56')][_0x540893];var _0x3734ae='i';var _0x264f1=_['find'](_0x2e6d46,[_0x620c('0x2b'),_0x432a4b[_0x620c('0x42')]]);if(!_0x264f1){switch(_0x432a4b[_0x620c('0x42')]){case _0x620c('0x57'):if(_0x432a4b['value']==0x1){_0x5bbf70['having']('`'+_0x432a4b['field']+_0x620c('0x58'));}else{_0x5bbf70[_0x620c('0x59')]('`'+_0x432a4b[_0x620c('0x42')]+'`\x20>\x200');}break;case _0x620c('0x5a'):if(_0x432a4b[_0x620c('0x5b')]==='$substring'){if(_0x432a4b[_0x620c('0x5c')][_0x620c('0x2f')]('\x20')[_0x620c('0x3c')]>0x1){_0x96859f[_0x13dfbe](_0x620c('0x5d'),qs['getFullTextValue'](_0x432a4b['value']),null);}else{var _0x459a54='%'+_0x432a4b['value']+'%';_0x96859f[_0x13dfbe](_0x620c('0x5e'),_0x459a54,_0x459a54,_0x459a54);}}else{_0x264f1=_['find'](_0x2e6d46,[_0x620c('0x2b'),'ContactId']);_0x432a4b[_0x620c('0x42')]=_0x620c('0x5f');_0x5269f1=as[_0x620c('0x60')](_0x3734ae,_0x264f1['type'],_0x432a4b);_0x96859f[_0x13dfbe](_0x5269f1[_0x620c('0x61')],_0x5269f1['value'][_0x620c('0x62')],_0x5269f1[_0x620c('0x5c')][_0x620c('0x1d')]);}break;case'Tag':var _0xa973dd=_0x432a4b['value'][_0x620c('0x2f')](',')[_0x620c('0x2c')](function(_0x48aedc){return Number(_0x48aedc);});_0xa973dd['forEach'](function(_0x336e3c){_0xd84237['or'](_0x620c('0x63'),'%,'+_0x336e3c+',%');});_0x387f39=_[_0x620c('0x64')](_0x387f39,_0xa973dd);break;case _0x620c('0x65'):if(_0x432a4b[_0x620c('0x5b')]===_0x620c('0x66')){_0x96859f[_0x13dfbe](_0x620c('0x67'),'%'+_0x432a4b[_0x620c('0x5c')]+'%',null);}else{_0x264f1=_['find'](_0x2e6d46,[_0x620c('0x2b'),_0x620c('0x68')]);_0x432a4b[_0x620c('0x42')]=_0x620c('0x68');_0x5269f1=as[_0x620c('0x60')](_0x3734ae,_0x264f1[_0x620c('0x34')],_0x432a4b);_0x96859f[_0x13dfbe](_0x5269f1[_0x620c('0x61')],_0x5269f1[_0x620c('0x5c')][_0x620c('0x62')],_0x5269f1['value']['end']);}break;case _0x620c('0x69'):_0x5269f1=as[_0x620c('0x60')]('me',null,_0x432a4b);_0x96859f[_0x13dfbe](_0x5269f1[_0x620c('0x61')],_0x5269f1[_0x620c('0x5c')][_0x620c('0x62')],_0x5269f1['value'][_0x620c('0x1d')]);break;}}else{var _0x5269f1=as[_0x620c('0x60')](_0x3734ae,_0x264f1[_0x620c('0x34')],_0x432a4b);_0x96859f[_0x13dfbe](_0x5269f1[_0x620c('0x61')],_0x5269f1[_0x620c('0x5c')][_0x620c('0x62')],_0x5269f1[_0x620c('0x5c')][_0x620c('0x1d')]);}}}else{var _0x425320=_(_0x4bfd50[_0x620c('0x37')])[_0x620c('0x38')]()['map'](function(_0x4de398){return _[_0x620c('0x6a')](_0x2e6d46,[_0x620c('0x2b'),_0x4de398])?_0x4de398:undefined;})[_0x620c('0x6b')]()[_0x620c('0x5c')]();if(!_[_0x620c('0x6c')](_0x425320)){_0x425320[_0x620c('0x30')](function(_0x57fb03){if(_0x57fb03==='FaxAccountId'){_0x5bbf70['where'](_0x620c('0x6d'),[][_0x620c('0x6e')](_0x4bfd50[_0x620c('0x37')][_0x57fb03]));}else if(_0x57fb03==='createdAt'){var _0x249bbd=JSON[_0x620c('0x6f')](_0x4bfd50[_0x620c('0x37')][_0x57fb03])[_0x620c('0x70')];var _0x234df5=JSON[_0x620c('0x6f')](_0x4bfd50[_0x620c('0x37')][_0x57fb03])['$lte'];_0x5bbf70[_0x620c('0x40')](_0x620c('0x71'),_0x249bbd,_0x234df5);}else{if(_0x4bfd50[_0x620c('0x37')][_0x57fb03]==='null'){_0x5bbf70[_0x620c('0x40')]('i.'+_0x57fb03+'\x20IS\x20NULL');}else{_0x5bbf70[_0x620c('0x40')]('i.'+_0x57fb03+_0x620c('0x72'),_0x4bfd50[_0x620c('0x37')][_0x57fb03]);}}});}if(_0x4bfd50['query'][_0x620c('0x73')]){if(_0x4bfd50[_0x620c('0x37')]['read']==0x1){_0x5bbf70[_0x620c('0x59')](_0x620c('0x74'));}else{_0x5bbf70[_0x620c('0x59')]('`unreadMessages`\x20>\x200');}}if(_0x4bfd50[_0x620c('0x37')][_0x620c('0x75')]){_0x387f39=_['isArray'](_0x4bfd50[_0x620c('0x37')]['tag'])?_0x4bfd50[_0x620c('0x37')][_0x620c('0x75')]:new Array(_0x4bfd50[_0x620c('0x37')][_0x620c('0x75')]);_0x387f39['forEach'](function(_0x473b83){_0xd84237['or'](_0x620c('0x63'),'%,'+_0x473b83+',%');});}if(_0x4bfd50[_0x620c('0x37')]['filter']){var _0x37a684=_0x4bfd50[_0x620c('0x37')][_0x620c('0x76')][_0x620c('0x77')]('\x5c','\x5c\x5c')[_0x620c('0x77')](/'/g,'\x27\x27');if(qs[_0x620c('0x78')](_0x37a684)){_0x96859f['or']('i.id\x20LIKE\x20?',_0x37a684+'%')['or'](_0x620c('0x79'),_0x37a684+'%');}_0x96859f['or'](_0x620c('0x7a'),_0x37a684+'%');}}_0x5bbf70[_0x620c('0x40')](_0x96859f);_0x5bbf70['group'](_0x620c('0x7b'));var _0x28e499={'type':db[_0x620c('0x7c')][_0x620c('0x7d')][_0x620c('0x7e')],'raw':!![]};var _0x540c24=_0x5bbf70[_0x620c('0x7f')]();_0x540c24[_0x620c('0x42')]('i.id');_0x540c24['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1619c3['order']){_0x1619c3['order'][_0x620c('0x30')](function(_0x36ef39){var _0x5364aa=_0x36ef39[0x0]===_0x620c('0x80')?_0x36ef39[0x0]:'i.'+_0x36ef39[0x0];_0x5bbf70[_0x620c('0x81')](_0x5364aa,_0x36ef39[0x1]===_0x620c('0x82')?![]:!![]);});}if(!_[_0x620c('0x6c')](_0x387f39)){_0x5bbf70['having'](_0xd84237);_0x540c24[_0x620c('0x40')](_0x620c('0x83'),_0x387f39);}BPromise[_0x620c('0x84')]()['then'](function(){if(!_0x2178d1){if(_0x4bfd50[_0x620c('0x37')][_0x620c('0x85')])return;_0x540c24[_0x620c('0x40')](_0x620c('0x86'));_0x5bbf70[_0x620c('0x40')](_0x620c('0x86'));return;}if(_0x4bfd50[_0x620c('0x87')][_0x620c('0x88')]!=='agent')return;return _0x4bfd50[_0x620c('0x87')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x620c('0x28')](function(_0x187141){if(_[_0x620c('0x6c')](_0x187141)){_0x540c24[_0x620c('0x40')](_0x620c('0x89'));_0x5bbf70[_0x620c('0x40')](_0x620c('0x89'));}else{_0x540c24['where'](_0x620c('0x6d'),_[_0x620c('0x2c')](_0x187141,'id'));_0x5bbf70[_0x620c('0x40')](_0x620c('0x6d'),_[_0x620c('0x2c')](_0x187141,'id'));}});})[_0x620c('0x28')](function(){if(_0x4bfd50[_0x620c('0x87')]['role']===_0x620c('0x8a')&&!_0x2178d1&&!_0x4bfd50['query'][_0x620c('0x85')])return[];return db[_0x620c('0x8b')][_0x620c('0x37')](_0x540c24['toString'](),_0x28e499);})[_0x620c('0x28')](function(_0x24df25){_0x112f1c['count']=_0x24df25['length'];if(_0x112f1c[_0x620c('0x22')]===0x0)return[];return db[_0x620c('0x8b')]['query'](_0x497837[_0x620c('0x8c')](),_0x28e499)['then'](function(_0x347238){_0x8ee301=_[_0x620c('0x8d')](_0x347238,'id');_0x28e499=_[_0x620c('0x8e')](_0x28e499,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bfd50[_0x620c('0x37')][_0x620c('0x8f')]){_0x1619c3[_0x620c('0x3b')][_0x620c('0x30')](function(_0x5b46ea){_0x5bbf70[_0x620c('0x42')]('i.'+_0x5b46ea);});}else{_0x5bbf70[_0x620c('0x42')](_0x620c('0x90'),_0x620c('0x57'));_0x5bbf70[_0x620c('0x42')]('a.key',_0x620c('0x91'));_0x5bbf70[_0x620c('0x42')](_0x620c('0x92'),'Account.mandatoryDisposition');_0x5bbf70[_0x620c('0x42')]('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',_0x620c('0x80'));_0x5bbf70[_0x620c('0x42')](_0x620c('0x93'));_0x5bbf70['field'](_0x620c('0x94'),_0x620c('0x95'));_0x5bbf70['field'](_0x620c('0x96'),_0x620c('0x97'));_0x5bbf70[_0x620c('0x42')](_0x620c('0x98'),_0x620c('0x99'));_0x5bbf70[_0x620c('0x42')](_0x620c('0x9a'),_0x620c('0x9b'));_0x5bbf70['field'](_0x620c('0x9c'),_0x620c('0x9d'));_0x5bbf70[_0x620c('0x42')](_0x620c('0x9e'),_0x620c('0x9f'));_0x5bbf70[_0x620c('0x42')](_0x620c('0xa0'),_0x620c('0xa1'));_0x5bbf70[_0x620c('0x42')](_0x620c('0xa2'),_0x620c('0xa3'));_0x5bbf70[_0x620c('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1619c3[_0x620c('0x21')])_0x5bbf70[_0x620c('0x21')](_0x1619c3['limit']);if(_0x1619c3[_0x620c('0x1f')])_0x5bbf70[_0x620c('0x1f')](_0x1619c3[_0x620c('0x1f')]);return db[_0x620c('0x8b')]['query'](_0x5bbf70['toString'](),_0x28e499);})['then'](function(_0x26f3dd){if(_0x26f3dd['length']>0x0)_0x1982fa[_0x620c('0x40')](_0x620c('0xa4'),_['map'](_0x26f3dd,'id'));return db[_0x620c('0x8b')]['query'](_0x1982fa[_0x620c('0x8c')](),_0x28e499)[_0x620c('0x28')](function(_0x46ad91){var _0x543fe3=_['groupBy'](_0x46ad91,_0x620c('0xa5'));var _0xab3aa5=[];_0x26f3dd[_0x620c('0x30')](function(_0x2592e7){_0xab3aa5[_0x620c('0x31')](updateFaxInteraction(_0x2592e7,_0x8ee301,_0x543fe3));});return BPromise['all'](_0xab3aa5);});});})[_0x620c('0x28')](function(_0x2a25d5){_0x112f1c[_0x620c('0xa6')]=_0x2a25d5;return _0x112f1c;})['then'](respondWithFilteredResult(_0x4bf719,_0x1619c3))[_0x620c('0xa7')](handleError(_0x4bf719,null));};exports[_0x620c('0xa8')]=function(_0x5d80ec,_0x50e144){var _0x442d8d={'raw':![],'where':{'id':_0x5d80ec[_0x620c('0xa9')]['id']}},_0x1fb24c={};_0x1fb24c[_0x620c('0x36')]=_[_0x620c('0x38')](db['FaxInteraction'][_0x620c('0x33')]);_0x1fb24c['query']=_[_0x620c('0x38')](_0x5d80ec[_0x620c('0x37')]);_0x1fb24c[_0x620c('0x39')]=_[_0x620c('0x3a')](_0x1fb24c[_0x620c('0x36')],_0x1fb24c[_0x620c('0x37')]);_0x442d8d[_0x620c('0x3b')]=_[_0x620c('0x3a')](_0x1fb24c[_0x620c('0x36')],qs['fields'](_0x5d80ec[_0x620c('0x37')][_0x620c('0x8f')]));_0x442d8d[_0x620c('0x3b')]=_0x442d8d[_0x620c('0x3b')]['length']?_0x442d8d[_0x620c('0x3b')]:_0x1fb24c['model'];if(_0x5d80ec[_0x620c('0x37')][_0x620c('0xaa')]){_0x442d8d[_0x620c('0xab')]=[{'all':!![]}];}_0x442d8d=_[_0x620c('0x8e')]({},_0x442d8d,_0x5d80ec['options']);return db[_0x620c('0xac')][_0x620c('0xad')](_0x442d8d)[_0x620c('0x28')](handleEntityNotFound(_0x50e144,null))[_0x620c('0x28')](respondWithResult(_0x50e144,null))[_0x620c('0xa7')](handleError(_0x50e144,null));};exports[_0x620c('0xae')]=function(_0x40b392,_0x5819bc){return db[_0x620c('0xac')]['create'](_0x40b392[_0x620c('0x69')],{})[_0x620c('0x28')](respondWithResult(_0x5819bc,0xc9))[_0x620c('0xa7')](handleError(_0x5819bc,null));};exports['update']=function(_0x371212,_0x408b34){if(_0x371212['body']['id']){delete _0x371212[_0x620c('0x69')]['id'];}return db[_0x620c('0xac')][_0x620c('0xad')]({'where':{'id':_0x371212[_0x620c('0xa9')]['id']}})[_0x620c('0x28')](handleEntityNotFound(_0x408b34,null))[_0x620c('0x28')](saveUpdates(_0x371212[_0x620c('0x69')],null))[_0x620c('0x28')](respondWithResult(_0x408b34,null))[_0x620c('0xa7')](handleError(_0x408b34,null));};exports['destroy']=function(_0x371cbc,_0x26387d){return db[_0x620c('0xac')][_0x620c('0xad')]({'where':{'id':_0x371cbc[_0x620c('0xa9')]['id']}})[_0x620c('0x28')](handleEntityNotFound(_0x26387d,null))[_0x620c('0x28')](removeEntity(_0x26387d,null))[_0x620c('0xa7')](handleError(_0x26387d,null));};exports[_0x620c('0xaf')]=function(_0x2d92c4,_0x5a1d66){return db[_0x620c('0xac')][_0x620c('0xaf')]()[_0x620c('0x28')](respondWithResult(_0x5a1d66,null))[_0x620c('0xa7')](handleError(_0x5a1d66,null));};exports[_0x620c('0xb0')]=function(_0x535c35,_0xc413ef,_0x12b775){return db[_0x620c('0xb1')][_0x620c('0xad')]({'where':{'id':_0x535c35[_0x620c('0xa9')]['id']}})[_0x620c('0x28')](handleEntityNotFound(_0xc413ef,null))[_0x620c('0x28')](function(_0x27ce3d){if(_0x27ce3d){return _0x27ce3d[_0x620c('0xb0')](_0x535c35[_0x620c('0x69')][_0x620c('0xb2')],_[_0x620c('0xb3')](_0x535c35['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xc413ef,null))[_0x620c('0xa7')](handleError(_0xc413ef,null));};exports[_0x620c('0xb4')]=function(_0x1ecaa3,_0x47838c,_0x20cfa0){var _0x25af5a={'raw':![],'where':{}};var _0x2a641a={};var _0xe46ea8={'count':0x0,'rows':[]};return db[_0x620c('0xac')]['findOne']({'where':{'id':_0x1ecaa3[_0x620c('0xa9')]['id']}})[_0x620c('0x28')](handleEntityNotFound(_0x47838c,null))[_0x620c('0x28')](function(_0x22d0bf){if(_0x22d0bf){_0x2a641a[_0x620c('0x36')]=_['keys'](db['FaxMessage'][_0x620c('0x33')]);_0x2a641a[_0x620c('0x37')]=_[_0x620c('0x38')](_0x1ecaa3[_0x620c('0x37')]);_0x2a641a[_0x620c('0x39')]=_['intersection'](_0x2a641a[_0x620c('0x36')],_0x2a641a['query']);_0x25af5a[_0x620c('0x3b')]=_[_0x620c('0x3a')](_0x2a641a[_0x620c('0x36')],qs[_0x620c('0x8f')](_0x1ecaa3[_0x620c('0x37')][_0x620c('0x8f')]));_0x25af5a[_0x620c('0x3b')]=_0x25af5a['attributes']['length']?_0x25af5a[_0x620c('0x3b')]:_0x2a641a[_0x620c('0x36')];if(!_0x1ecaa3[_0x620c('0x37')][_0x620c('0x3d')]('nolimit')){_0x25af5a['limit']=qs['limit'](_0x1ecaa3[_0x620c('0x37')][_0x620c('0x21')]);_0x25af5a[_0x620c('0x1f')]=qs[_0x620c('0x1f')](_0x1ecaa3[_0x620c('0x37')][_0x620c('0x1f')]);}_0x25af5a[_0x620c('0x81')]=qs[_0x620c('0x3f')](_0x1ecaa3[_0x620c('0x37')]['sort']);_0x25af5a[_0x620c('0x40')]=qs[_0x620c('0x39')](_[_0x620c('0xb5')](_0x1ecaa3[_0x620c('0x37')],_0x2a641a[_0x620c('0x39')]));_0x25af5a[_0x620c('0x40')][_0x620c('0xa5')]=_0x22d0bf['id'];if(_0x1ecaa3[_0x620c('0x37')]['filter']){_0x25af5a[_0x620c('0x40')]=_['merge'](_0x25af5a[_0x620c('0x40')],{'$or':_[_0x620c('0x2c')](_0x25af5a['attributes'],function(_0x1c6b15){var _0x11f2c7={};_0x11f2c7[_0x1c6b15]={'$like':'%'+_0x1ecaa3[_0x620c('0x37')][_0x620c('0x76')]+'%'};return _0x11f2c7;})});}if(_0x1ecaa3[_0x620c('0x37')][_0x620c('0x70')]){var _0x5adbc5=_0x1ecaa3[_0x620c('0x37')]['$gte'][_0x620c('0x2f')](',');var _0x59cbe6={};_0x59cbe6[_0x5adbc5[0x0]]={'$gte':moment(_0x5adbc5[0x1])[_0x620c('0xb6')](_0x620c('0xb7'))};_0x25af5a['where']=_[_0x620c('0x8e')](_0x25af5a[_0x620c('0x40')],_0x59cbe6);}_0x25af5a=_['merge']({},_0x25af5a,_0x1ecaa3[_0x620c('0xb8')]);return db['FaxMessage']['count']({'where':_0x25af5a[_0x620c('0x40')]})[_0x620c('0x28')](function(_0x37e8b6){_0xe46ea8[_0x620c('0x22')]=_0x37e8b6;if(_0x1ecaa3['query'][_0x620c('0xaa')]){_0x25af5a[_0x620c('0xab')]=[{'all':!![]}];}return db['FaxMessage'][_0x620c('0xb9')](_0x25af5a);})[_0x620c('0x28')](function(_0x31efd3){_0xe46ea8['rows']=_0x31efd3;return _0xe46ea8;});}})[_0x620c('0x28')](respondWithFilteredResult(_0x47838c,_0x25af5a))[_0x620c('0xa7')](handleError(_0x47838c,null));};exports[_0x620c('0xba')]=function(_0x27a330,_0x8951a6,_0x2d126d){return db[_0x620c('0xac')][_0x620c('0xad')]({'where':{'id':_0x27a330[_0x620c('0xa9')]['id']}})[_0x620c('0x28')](handleEntityNotFound(_0x8951a6,null))[_0x620c('0x28')](function(_0x2256e3){if(_0x2256e3){return _0x2256e3[_0x620c('0xbb')](_0x27a330[_0x620c('0x69')][_0x620c('0xb2')],_[_0x620c('0xb3')](_0x27a330[_0x620c('0x69')],['ids','id'])||{})[_0x620c('0xbc')](function(){return db['Tag'][_0x620c('0xb9')]({'attributes':['id',_0x620c('0x2b'),_0x620c('0x43')],'where':{'id':_0x27a330[_0x620c('0x69')][_0x620c('0xb2')]}});})[_0x620c('0x28')](function(_0x107849){socket[_0x620c('0xbd')](_0x620c('0xbe'),{'id':Number(_0x27a330[_0x620c('0xa9')]['id']),'tags':_0x107849||[]});return{'id':Number(_0x27a330[_0x620c('0xa9')]['id']),'tags':_0x107849||[]};});}})['then'](respondWithResult(_0x8951a6,null))[_0x620c('0xa7')](handleError(_0x8951a6,null));};exports[_0x620c('0xbf')]=function(_0x14d43a,_0x31cca1,_0x502d12){return db['FaxInteraction'][_0x620c('0xad')]({'where':{'id':_0x14d43a[_0x620c('0xa9')]['id']}})[_0x620c('0x28')](handleEntityNotFound(_0x31cca1,null))[_0x620c('0x28')](function(_0x307728){if(_0x307728){return _0x307728['removeTags'](_0x14d43a['query']['ids']);}})['then'](respondWithStatusCode(_0x31cca1,null))['catch'](handleError(_0x31cca1,null));};exports[_0x620c('0xc0')]=function(_0x1a11f9,_0x4fdd35){var _0x4d7cb2=moment()[_0x620c('0xc1')]()[_0x620c('0x8c')]();var _0x36a0d0=path[_0x620c('0xc2')](config[_0x620c('0xc3')],'server',_0x620c('0xc4'),_0x620c('0xc5'));var _0x2a0b23=path['join'](config[_0x620c('0xc3')],_0x620c('0xc6'),'files',_0x620c('0xc7'));var _0x2084be=path['join'](_0x36a0d0,_0x4d7cb2);var _0x1f1aea=util[_0x620c('0xb6')](_0x620c('0xc8'),_0x1a11f9[_0x620c('0xa9')]['id'],_0x4d7cb2);var _0x15fd58=path[_0x620c('0xc2')](_0x36a0d0,_0x1f1aea);var _0x2495df=[];_0x2495df[_0x620c('0x31')]({'model':db[_0x620c('0xc9')],'as':'Attachment','raw':!![]});var _0x2e8242=[{'model':db[_0x620c('0xb1')],'as':'Messages','attributes':['id','body','createdAt'],'include':_0x2495df}];return db[_0x620c('0xac')][_0x620c('0xad')]({'where':{'id':_0x1a11f9[_0x620c('0xa9')]['id']},'include':_0x2e8242})[_0x620c('0x28')](handleEntityNotFound(_0x4fdd35,null))[_0x620c('0x28')](function(_0x530d31){if(_0x530d31&&_0x530d31[_0x620c('0xca')]){var _0x241f88=_0x530d31[_0x620c('0xcb')]({'plain':!![]});fs[_0x620c('0xcc')](_0x2084be);for(var _0x4cedcc=0x0;_0x4cedcc<_0x241f88[_0x620c('0xca')]['length'];_0x4cedcc++){var _0x48e317=_0x241f88['Messages'][_0x4cedcc]['Attachment'];if(_0x48e317){var _0x1b6432=path[_0x620c('0xc2')](_0x2a0b23,_0x48e317[_0x620c('0xcd')]);if(fs[_0x620c('0xce')](_0x1b6432)){fs[_0x620c('0xcf')](_0x1b6432)['pipe'](fs[_0x620c('0xd0')](path[_0x620c('0xc2')](_0x2084be,_0x48e317[_0x620c('0xcd')])));}}}return BPromise[_0x620c('0x84')]()[_0x620c('0x28')](function(){return new BPromise(function(_0x3f657d,_0x5597c2){zipdir(_0x2084be,{'saveTo':_0x15fd58},function(_0x3030ae,_0x14a838){if(_0x3030ae)return _0x5597c2(_0x3030ae);return _0x3f657d(_0x14a838);});})[_0x620c('0x28')](function(){return new BPromise(function(_0x55dba0,_0x590fa5){rimraf(_0x2084be,function(_0x230803){if(_0x230803)_0x590fa5(_0x230803);return _0x55dba0();});});})['then'](function(){return _0x4fdd35[_0x620c('0xc0')](_0x15fd58,_0x1f1aea,function(_0x12e74e){if(_0x12e74e){console[_0x620c('0xd1')]('err',_0x12e74e);}else{fs['unlinkSync'](_0x15fd58);}});});});}else{return _0x4fdd35[_0x620c('0x1b')](0xc8);}})[_0x620c('0xa7')](handleError(_0x4fdd35,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 2e38d50..abe5102 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 _0x2065=['update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners'];(function(_0xf86c4b,_0x540f7d){var _0x562f7e=function(_0x376a71){while(--_0x376a71){_0xf86c4b['push'](_0xf86c4b['shift']());}};_0x562f7e(++_0x540f7d);}(_0x2065,0xc2));var _0x5206=function(_0x51821c,_0x3d03be){_0x51821c=_0x51821c-0x0;var _0x4f57a3=_0x2065[_0x51821c];return _0x4f57a3;};'use strict';var EventEmitter=require(_0x5206('0x0'));var FaxInteraction=require(_0x5206('0x1'))['db'][_0x5206('0x2')];var FaxMessage=require(_0x5206('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5206('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5206('0x4'),'afterDestroy':_0x5206('0x5')};function emitEvent(_0xcdaeea){return function(_0x20ee11,_0x56ad9a,_0x466a5d){_0x20ee11[_0x5206('0x6')]({'attributes':['id'],'raw':!![]})[_0x5206('0x7')](function(_0x2a751d){_0x20ee11[_0x5206('0x8')](_0x5206('0x9'),_0x2a751d[_0x5206('0xa')](function(_0xe8794b){return{'id':_0xe8794b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x20ee11['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5206('0x7')](function(_0x1f75da){_0x20ee11[_0x5206('0x8')](_0x5206('0xb'),_0x1f75da[_0x5206('0xc')]);FaxInteractionEvents[_0x5206('0xd')](_0xcdaeea+':'+_0x20ee11['id'],_0x20ee11);FaxInteractionEvents[_0x5206('0xd')](_0xcdaeea,_0x20ee11);_0x466a5d(null);})[_0x5206('0xe')](_0x466a5d(null));};}for(var e in events){if(events[_0x5206('0xf')](e)){var event=events[e];FaxInteraction[_0x5206('0x10')](e,emitEvent(event));}}module[_0x5206('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x63fa=['update','remove','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','../../mysqldb','FaxInteraction','setMaxListeners','save'];(function(_0x43c279,_0x38a78d){var _0x1a480c=function(_0x190017){while(--_0x190017){_0x43c279['push'](_0x43c279['shift']());}};_0x1a480c(++_0x38a78d);}(_0x63fa,0x17b));var _0xa63f=function(_0x34647e,_0x2d7553){_0x34647e=_0x34647e-0x0;var _0x5747ca=_0x63fa[_0x34647e];return _0x5747ca;};'use strict';var EventEmitter=require(_0xa63f('0x0'));var FaxInteraction=require(_0xa63f('0x1'))['db'][_0xa63f('0x2')];var FaxMessage=require(_0xa63f('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa63f('0x3')](0x0);var events={'afterCreate':_0xa63f('0x4'),'afterUpdate':_0xa63f('0x5'),'afterDestroy':_0xa63f('0x6')};function emitEvent(_0x4ff275){return function(_0x1576da,_0x17c92d,_0x51a751){_0x1576da['getUsers']({'attributes':['id'],'raw':!![]})[_0xa63f('0x7')](function(_0x2d3b02){_0x1576da[_0xa63f('0x8')](_0xa63f('0x9'),_0x2d3b02[_0xa63f('0xa')](function(_0x8948bf){return{'id':_0x8948bf['id']};}));return FaxMessage[_0xa63f('0xb')]({'where':{'FaxInteractionId':_0x1576da['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa63f('0x7')](function(_0x16d5dd){_0x1576da[_0xa63f('0x8')]('unreadMessages',_0x16d5dd[_0xa63f('0xc')]);FaxInteractionEvents[_0xa63f('0xd')](_0x4ff275+':'+_0x1576da['id'],_0x1576da);FaxInteractionEvents['emit'](_0x4ff275,_0x1576da);_0x51a751(null);})[_0xa63f('0xe')](_0x51a751(null));};}for(var e in events){if(events[_0xa63f('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index bca5d54..9d327ad 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 _0xd237=['path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird'];(function(_0x54613d,_0x4b8872){var _0x11c35b=function(_0x4ca863){while(--_0x4ca863){_0x54613d['push'](_0x54613d['shift']());}};_0x11c35b(++_0x4b8872);}(_0xd237,0x12b));var _0x7d23=function(_0xb86549,_0x4fd63c){_0xb86549=_0xb86549-0x0;var _0x4853a8=_0xd237[_0xb86549];return _0x4853a8;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var logger=require(_0x7d23('0x2'))(_0x7d23('0x3'));var moment=require('moment');var BPromise=require(_0x7d23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d23('0x5'));var rimraf=require(_0x7d23('0x6'));var config=require(_0x7d23('0x7'));var attributes=require(_0x7d23('0x8'));module[_0x7d23('0x9')]=function(_0x5f2a3e,_0x5e7bbf){return _0x5f2a3e[_0x7d23('0xa')](_0x7d23('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x397bb1,_0x39eebd,_0x1cf1a2){if(_0x397bb1[_0x7d23('0xc')](_0x7d23('0xd'))){_0x397bb1[_0x7d23('0xe')]=moment()['format'](_0x7d23('0xf'));}_0x1cf1a2(null,_0x397bb1);}}});}; \ No newline at end of file +var _0x6ee2=['fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction'];(function(_0x38c767,_0x3a5e35){var _0x5ad145=function(_0x5a5a58){while(--_0x5a5a58){_0x38c767['push'](_0x38c767['shift']());}};_0x5ad145(++_0x3a5e35);}(_0x6ee2,0x155));var _0x26ee=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x6ee2[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x26ee('0x0'));var util=require(_0x26ee('0x1'));var logger=require(_0x26ee('0x2'))('api');var moment=require(_0x26ee('0x3'));var BPromise=require(_0x26ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x26ee('0x5'));var config=require(_0x26ee('0x6'));var attributes=require(_0x26ee('0x7'));module[_0x26ee('0x8')]=function(_0x10466e,_0x3d2e3b){return _0x10466e[_0x26ee('0x9')](_0x26ee('0xa'),attributes,{'tableName':_0x26ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e87f8,_0x414d2c,_0x535544){if(_0x4e87f8['changed'](_0x26ee('0xc'))){_0x4e87f8[_0x26ee('0xd')]=moment()[_0x26ee('0xe')](_0x26ee('0xf'));}_0x535544(null,_0x4e87f8);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a0456ea..aebec2e 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 _0x8f06=['debug','AddTagsToFaxInteraction','find','where','addTags','body','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateFaxInteraction','FaxInteraction','update','options','raw','attributes'];(function(_0x160ff7,_0x33f2fb){var _0x3b37be=function(_0x1328b1){while(--_0x1328b1){_0x160ff7['push'](_0x160ff7['shift']());}};_0x3b37be(++_0x33f2fb);}(_0x8f06,0x1e3));var _0x68f0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f06[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x68f0('0x0'));var util=require(_0x68f0('0x1'));var moment=require(_0x68f0('0x2'));var BPromise=require(_0x68f0('0x3'));var rs=require(_0x68f0('0x4'));var fs=require('fs');var Redis=require(_0x68f0('0x5'));var db=require(_0x68f0('0x6'))['db'];var utils=require(_0x68f0('0x7'));var logger=require(_0x68f0('0x8'))(_0x68f0('0x9'));var config=require(_0x68f0('0xa'));var jayson=require(_0x68f0('0xb'));var client=jayson[_0x68f0('0xc')][_0x68f0('0xd')]({'port':0x232a});config['redis']=_[_0x68f0('0xe')](config[_0x68f0('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x68f0('0x10'))(new Redis(config[_0x68f0('0xf')]));require(_0x68f0('0x11'))[_0x68f0('0x12')](socket);function respondWithRpcPromise(_0x293f5a,_0x5b7949,_0x102790){return new BPromise(function(_0x4f923b,_0x418891){return client['request'](_0x293f5a,_0x102790)[_0x68f0('0x13')](function(_0x258eb8){logger[_0x68f0('0x14')](_0x68f0('0x15'),_0x5b7949,_0x68f0('0x16'));logger['debug'](_0x68f0('0x17'),_0x5b7949,_0x68f0('0x16'),JSON[_0x68f0('0x18')](_0x258eb8));if(_0x258eb8['error']){if(_0x258eb8[_0x68f0('0x19')]['code']===0x1f4){logger['error'](_0x68f0('0x15'),_0x5b7949,_0x258eb8[_0x68f0('0x19')][_0x68f0('0x1a')]);return _0x418891(_0x258eb8['error'][_0x68f0('0x1a')]);}logger['error'](_0x68f0('0x15'),_0x5b7949,_0x258eb8['error'][_0x68f0('0x1a')]);return _0x4f923b(_0x258eb8[_0x68f0('0x19')][_0x68f0('0x1a')]);}else{logger['info'](_0x68f0('0x15'),_0x5b7949,_0x68f0('0x16'));_0x4f923b(_0x258eb8['result'][_0x68f0('0x1a')]);}})['catch'](function(_0x472d70){logger[_0x68f0('0x19')](_0x68f0('0x15'),_0x5b7949,_0x472d70);_0x418891(_0x472d70);});});}exports[_0x68f0('0x1b')]=function(_0x394344){var _0x341e8f=this;return new Promise(function(_0x5783c3,_0x212990){return db[_0x68f0('0x1c')][_0x68f0('0x1d')](_0x394344['body'],{'raw':_0x394344[_0x68f0('0x1e')]?_0x394344[_0x68f0('0x1e')][_0x68f0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x394344['options']?_0x394344[_0x68f0('0x1e')]['where']||null:null,'attributes':_0x394344[_0x68f0('0x1e')]?_0x394344['options'][_0x68f0('0x20')]||null:null,'limit':_0x394344['options']?_0x394344['options']['limit']||null:null})['then'](function(_0x53b003){logger['info'](_0x68f0('0x1b'),_0x394344);logger[_0x68f0('0x21')](_0x68f0('0x1b'),_0x394344,JSON['stringify'](_0x53b003));_0x5783c3(_0x53b003);})['catch'](function(_0x27cdbb){logger['error'](_0x68f0('0x1b'),_0x27cdbb[_0x68f0('0x1a')],_0x394344);_0x212990(_0x341e8f[_0x68f0('0x19')](0x1f4,_0x27cdbb[_0x68f0('0x1a')]));});});};exports[_0x68f0('0x22')]=function(_0x4172e0){return new Promise(function(_0x5a5c42,_0x2d4b1f){return db[_0x68f0('0x1c')][_0x68f0('0x23')]({'where':_0x4172e0[_0x68f0('0x1e')]?_0x4172e0[_0x68f0('0x1e')][_0x68f0('0x24')]||null:null})[_0x68f0('0x13')](function(_0x5c91e8){if(_0x5c91e8){return _0x5c91e8[_0x68f0('0x25')](_0x4172e0[_0x68f0('0x26')]['ids'],_[_0x68f0('0x27')](_0x4172e0['body'],['ids','id'])||{});}})[_0x68f0('0x28')](function(_0x1c55ff){logger[_0x68f0('0x14')](_0x68f0('0x29'),_0x4172e0);logger[_0x68f0('0x21')]('AddTags',_0x4172e0,JSON[_0x68f0('0x18')](_0x1c55ff));_0x5a5c42(_0x1c55ff);})[_0x68f0('0x2a')](function(_0x4ecc05){logger[_0x68f0('0x19')](_0x68f0('0x29'),_0x4ecc05[_0x68f0('0x1a')],_0x4172e0);_0x2d4b1f(_this[_0x68f0('0x19')](0x1f4,_0x4ecc05[_0x68f0('0x1a')]));});});}; \ No newline at end of file +var _0x343e=['spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','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','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','omit'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x343e,0x1ba));var _0xe343=function(_0x3c786d,_0xe68ade){_0x3c786d=_0x3c786d-0x0;var _0x59ab1e=_0x343e[_0x3c786d];return _0x59ab1e;};'use strict';var _=require(_0xe343('0x0'));var util=require(_0xe343('0x1'));var moment=require(_0xe343('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe343('0x3'));var db=require(_0xe343('0x4'))['db'];var utils=require(_0xe343('0x5'));var logger=require('../../config/logger')(_0xe343('0x6'));var config=require('../../config/environment');var jayson=require(_0xe343('0x7'));var client=jayson[_0xe343('0x8')][_0xe343('0x9')]({'port':0x232a});config[_0xe343('0xa')]=_[_0xe343('0xb')](config['redis'],{'host':_0xe343('0xc'),'port':0x18eb});var socket=require(_0xe343('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xe343('0xe')](socket);function respondWithRpcPromise(_0x4af874,_0x2692de,_0x3f0192){return new BPromise(function(_0x291d0a,_0x441cd2){return client[_0xe343('0xf')](_0x4af874,_0x3f0192)[_0xe343('0x10')](function(_0x384aef){logger[_0xe343('0x11')](_0xe343('0x12'),_0x2692de,_0xe343('0x13'));logger[_0xe343('0x14')](_0xe343('0x15'),_0x2692de,'request\x20sent',JSON[_0xe343('0x16')](_0x384aef));if(_0x384aef['error']){if(_0x384aef[_0xe343('0x17')][_0xe343('0x18')]===0x1f4){logger[_0xe343('0x17')](_0xe343('0x12'),_0x2692de,_0x384aef[_0xe343('0x17')][_0xe343('0x19')]);return _0x441cd2(_0x384aef['error'][_0xe343('0x19')]);}logger[_0xe343('0x17')](_0xe343('0x12'),_0x2692de,_0x384aef[_0xe343('0x17')][_0xe343('0x19')]);return _0x291d0a(_0x384aef['error']['message']);}else{logger['info'](_0xe343('0x12'),_0x2692de,_0xe343('0x13'));_0x291d0a(_0x384aef[_0xe343('0x1a')]['message']);}})[_0xe343('0x1b')](function(_0x399e43){logger[_0xe343('0x17')](_0xe343('0x12'),_0x2692de,_0x399e43);_0x441cd2(_0x399e43);});});}exports[_0xe343('0x1c')]=function(_0x4847bd){var _0x408b76=this;return new Promise(function(_0x20e5a9,_0x241379){return db[_0xe343('0x1d')][_0xe343('0x1e')](_0x4847bd[_0xe343('0x1f')],{'raw':_0x4847bd[_0xe343('0x20')]?_0x4847bd[_0xe343('0x20')][_0xe343('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4847bd['options']?_0x4847bd[_0xe343('0x20')][_0xe343('0x22')]||null:null,'attributes':_0x4847bd[_0xe343('0x20')]?_0x4847bd['options'][_0xe343('0x23')]||null:null,'limit':_0x4847bd[_0xe343('0x20')]?_0x4847bd[_0xe343('0x20')][_0xe343('0x24')]||null:null})['then'](function(_0x4de2f2){logger[_0xe343('0x11')](_0xe343('0x1c'),_0x4847bd);logger[_0xe343('0x14')](_0xe343('0x1c'),_0x4847bd,JSON[_0xe343('0x16')](_0x4de2f2));_0x20e5a9(_0x4de2f2);})['catch'](function(_0x2d5962){logger['error'](_0xe343('0x1c'),_0x2d5962[_0xe343('0x19')],_0x4847bd);_0x241379(_0x408b76['error'](0x1f4,_0x2d5962[_0xe343('0x19')]));});});};exports[_0xe343('0x25')]=function(_0x3ce7cb){return new Promise(function(_0x43210a,_0x224949){return db[_0xe343('0x1d')][_0xe343('0x26')]({'where':_0x3ce7cb[_0xe343('0x20')]?_0x3ce7cb['options'][_0xe343('0x22')]||null:null})['then'](function(_0x2f8252){if(_0x2f8252){return _0x2f8252[_0xe343('0x27')](_0x3ce7cb[_0xe343('0x1f')][_0xe343('0x28')],_[_0xe343('0x29')](_0x3ce7cb['body'],[_0xe343('0x28'),'id'])||{});}})[_0xe343('0x2a')](function(_0xd12dd7){logger[_0xe343('0x11')](_0xe343('0x2b'),_0x3ce7cb);logger[_0xe343('0x14')](_0xe343('0x2b'),_0x3ce7cb,JSON[_0xe343('0x16')](_0xd12dd7));_0x43210a(_0xd12dd7);})[_0xe343('0x1b')](function(_0x39a9b9){logger[_0xe343('0x17')]('AddTags',_0x39a9b9['message'],_0x3ce7cb);_0x224949(_this[_0xe343('0x17')](0x1f4,_0x39a9b9[_0xe343('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 7a13b35..f609dcf 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 _0x3ba0=['update','emit','removeListener','register','length','./faxInteraction.events','remove'];(function(_0x32355d,_0xa6b12e){var _0x995a4f=function(_0xf240ac){while(--_0xf240ac){_0x32355d['push'](_0x32355d['shift']());}};_0x995a4f(++_0xa6b12e);}(_0x3ba0,0x18d));var _0x03ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3ba0[_0xa464c9];return _0x3d73c4;};'use strict';var FaxInteractionEvents=require(_0x03ba('0x0'));var events=['save',_0x03ba('0x1'),_0x03ba('0x2')];function createListener(_0x2a4dcf,_0x403261){return function(_0x6ad811){_0x403261[_0x03ba('0x3')](_0x2a4dcf,_0x6ad811);};}function removeListener(_0x23c1cf,_0x2371b0){return function(){FaxInteractionEvents[_0x03ba('0x4')](_0x23c1cf,_0x2371b0);};}exports[_0x03ba('0x5')]=function(_0x1b6581){for(var _0x239db5=0x0,_0x83be5a=events[_0x03ba('0x6')];_0x239db5<_0x83be5a;_0x239db5++){var _0x3d6cf9=events[_0x239db5];var _0x2a1ede=createListener('faxInteraction:'+_0x3d6cf9,_0x1b6581);FaxInteractionEvents['on'](_0x3d6cf9,_0x2a1ede);}}; \ No newline at end of file +var _0x0d2a=['register','length','faxInteraction:','./faxInteraction.events','remove','update','emit','removeListener'];(function(_0x1f87d8,_0x2659a0){var _0x59cfbb=function(_0x4fcd01){while(--_0x4fcd01){_0x1f87d8['push'](_0x1f87d8['shift']());}};_0x59cfbb(++_0x2659a0);}(_0x0d2a,0xcb));var _0xa0d2=function(_0x394049,_0xc85850){_0x394049=_0x394049-0x0;var _0x5a7ae3=_0x0d2a[_0x394049];return _0x5a7ae3;};'use strict';var FaxInteractionEvents=require(_0xa0d2('0x0'));var events=['save',_0xa0d2('0x1'),_0xa0d2('0x2')];function createListener(_0x5ce07f,_0x4b6533){return function(_0x2fae7e){_0x4b6533[_0xa0d2('0x3')](_0x5ce07f,_0x2fae7e);};}function removeListener(_0x110c24,_0x1a4018){return function(){FaxInteractionEvents[_0xa0d2('0x4')](_0x110c24,_0x1a4018);};}exports[_0xa0d2('0x5')]=function(_0x4e4a6e){for(var _0x215934=0x0,_0x32545b=events[_0xa0d2('0x6')];_0x215934<_0x32545b;_0x215934++){var _0x172b9e=events[_0x215934];var _0x283b36=createListener(_0xa0d2('0x7')+_0x172b9e,_0x4e4a6e);FaxInteractionEvents['on'](_0x172b9e,_0x283b36);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 159a210..106a0a7 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 _0xee16=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','addTags','put','faxinteraction:update','faxinteraction:destroy','destroy','delete'];(function(_0x3a4f18,_0x1af741){var _0x4c20fc=function(_0x27115f){while(--_0x27115f){_0x3a4f18['push'](_0x3a4f18['shift']());}};_0x4c20fc(++_0x1af741);}(_0xee16,0x187));var _0x6ee1=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0xee16[_0x46451c];return _0x12dce4;};'use strict';var multer=require('multer');var util=require(_0x6ee1('0x0'));var path=require(_0x6ee1('0x1'));var timeout=require(_0x6ee1('0x2'));var express=require('express');var router=express[_0x6ee1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ee1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ee1('0x5'));var controller=require(_0x6ee1('0x6'));router[_0x6ee1('0x7')]('/',auth[_0x6ee1('0x8')](),controller[_0x6ee1('0x9')]);router[_0x6ee1('0x7')]('/describe',auth[_0x6ee1('0x8')](),controller[_0x6ee1('0xa')]);router[_0x6ee1('0x7')](_0x6ee1('0xb'),auth[_0x6ee1('0x8')](),controller[_0x6ee1('0xc')]);router[_0x6ee1('0x7')](_0x6ee1('0xd'),auth['isAuthenticated'](),controller[_0x6ee1('0xe')]);router[_0x6ee1('0x7')](_0x6ee1('0xf'),auth[_0x6ee1('0x8')](),controller['download']);router[_0x6ee1('0x10')]('/',auth[_0x6ee1('0x8')](),controller[_0x6ee1('0x11')]);router[_0x6ee1('0x10')](_0x6ee1('0xd'),auth[_0x6ee1('0x8')](),controller['addMessage']);router[_0x6ee1('0x10')](_0x6ee1('0x12'),auth['isAuthenticated'](),interaction['tracked']('fax','faxinteraction:addtags'),controller[_0x6ee1('0x13')]);router[_0x6ee1('0x14')]('/:id',auth['isAuthenticated'](),interaction['tracked']('fax',_0x6ee1('0x15')),controller['update']);router['delete'](_0x6ee1('0xb'),auth[_0x6ee1('0x8')](),interaction['tracked']('fax',_0x6ee1('0x16')),controller[_0x6ee1('0x17')]);router[_0x6ee1('0x18')](_0x6ee1('0x12'),auth[_0x6ee1('0x8')](),controller['removeTags']);module[_0x6ee1('0x19')]=router; \ No newline at end of file +var _0x406a=['tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','getMessages','post','create','/:id/messages','addMessage','/:id/tags'];(function(_0x4260aa,_0xd487ed){var _0x4cb285=function(_0x869e1d){while(--_0x869e1d){_0x4260aa['push'](_0x4260aa['shift']());}};_0x4cb285(++_0xd487ed);}(_0x406a,0xfd));var _0xa406=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x406a[_0x616290];return _0x453879;};'use strict';var multer=require(_0xa406('0x0'));var util=require('util');var path=require(_0xa406('0x1'));var timeout=require(_0xa406('0x2'));var express=require(_0xa406('0x3'));var router=express[_0xa406('0x4')]();var fs_extra=require(_0xa406('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa406('0x6'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xa406('0x7')]('/',auth[_0xa406('0x8')](),controller['index']);router[_0xa406('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa406('0x7')](_0xa406('0x9'),auth['isAuthenticated'](),controller[_0xa406('0xa')]);router[_0xa406('0x7')]('/:id/messages',auth[_0xa406('0x8')](),controller[_0xa406('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xa406('0xc')]('/',auth['isAuthenticated'](),controller[_0xa406('0xd')]);router[_0xa406('0xc')](_0xa406('0xe'),auth[_0xa406('0x8')](),controller[_0xa406('0xf')]);router['post'](_0xa406('0x10'),auth[_0xa406('0x8')](),interaction[_0xa406('0x11')](_0xa406('0x12'),_0xa406('0x13')),controller[_0xa406('0x14')]);router[_0xa406('0x15')](_0xa406('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xa406('0x12'),'faxinteraction:update'),controller[_0xa406('0x16')]);router[_0xa406('0x17')](_0xa406('0x9'),auth[_0xa406('0x8')](),interaction['tracked'](_0xa406('0x12'),_0xa406('0x18')),controller[_0xa406('0x19')]);router['delete']('/:id/tags',auth[_0xa406('0x8')](),controller['removeTags']);module[_0xa406('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 9538dae..7f806c0 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 _0x12fd=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x12fd,0x199));var _0xd12f=function(_0x13bdd8,_0x2c7754){_0x13bdd8=_0x13bdd8-0x0;var _0xe0c327=_0x12fd[_0x13bdd8];return _0xe0c327;};'use strict';var Sequelize=require(_0xd12f('0x0'));module[_0xd12f('0x1')]={'body':{'type':Sequelize[_0xd12f('0x2')](_0xd12f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd12f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd12f('0x5')),'defaultValue':_0xd12f('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd12f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd12f('0x6')]}}; \ No newline at end of file +var _0xb43b=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4f4757,_0x44241a){var _0x549c37=function(_0x3c3cfb){while(--_0x3c3cfb){_0x4f4757['push'](_0x4f4757['shift']());}};_0x549c37(++_0x44241a);}(_0xb43b,0xbf));var _0xbb43=function(_0x4a4949,_0xbbacb3){_0x4a4949=_0x4a4949-0x0;var _0x4fec8c=_0xb43b[_0x4a4949];return _0x4fec8c;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb43('0x1')](_0xbb43('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbb43('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbb43('0x4')]('in',_0xbb43('0x5')),'defaultValue':_0xbb43('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xbb43('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xbb43('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3b4d27a..bafa133 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 _0xff0c=['SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxMessage.socket','register','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','update','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','internal','EventManager','rejectmessage','create','findOne','AttachmentId'];(function(_0x5d0dde,_0x194e9a){var _0x35b3f6=function(_0x43999f){while(--_0x43999f){_0x5d0dde['push'](_0x5d0dde['shift']());}};_0x35b3f6(++_0x194e9a);}(_0xff0c,0xa0));var _0xcff0=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0xff0c[_0xc0638b];return _0xd57dfa;};'use strict';var emlformat=require(_0xcff0('0x0'));var rimraf=require(_0xcff0('0x1'));var zipdir=require(_0xcff0('0x2'));var jsonpatch=require(_0xcff0('0x3'));var rp=require(_0xcff0('0x4'));var moment=require(_0xcff0('0x5'));var BPromise=require(_0xcff0('0x6'));var Mustache=require(_0xcff0('0x7'));var util=require(_0xcff0('0x8'));var path=require(_0xcff0('0x9'));var sox=require(_0xcff0('0xa'));var csv=require('to-csv');var ejs=require(_0xcff0('0xb'));var fs=require('fs');var fs_extra=require(_0xcff0('0xc'));var _=require(_0xcff0('0xd'));var squel=require(_0xcff0('0xe'));var crypto=require(_0xcff0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcff0('0x10'));var toCsv=require(_0xcff0('0x11'));var querystring=require(_0xcff0('0x12'));var Papa=require('papaparse');var Redis=require(_0xcff0('0x13'));var authService=require(_0xcff0('0x14'));var qs=require(_0xcff0('0x15'));var as=require(_0xcff0('0x16'));var hardwareService=require(_0xcff0('0x17'));var logger=require(_0xcff0('0x18'))(_0xcff0('0x19'));var utils=require('../../config/utils');var config=require(_0xcff0('0x1a'));var licenseUtil=require(_0xcff0('0x1b'));var db=require(_0xcff0('0x1c'))['db'];config[_0xcff0('0x1d')]=_[_0xcff0('0x1e')](config[_0xcff0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcff0('0x1d')]));require(_0xcff0('0x1f'))[_0xcff0('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcff0('0x21')][_0xcff0('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xcff0('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xcd27c3,_0x5e80ea,_0x141f6f,_0x18083a){return new BPromise(function(_0x404acb,_0x467887){var _0x427ff8=_0x18083a||client;return _0x427ff8[_0xcff0('0x23')](_0xcd27c3,_0x141f6f)[_0xcff0('0x24')](function(_0x5b236d){logger['info'](_0xcff0('0x25'),_0x5e80ea,_0xcff0('0x26'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5e80ea,'request\x20sent',JSON[_0xcff0('0x27')](_0x5b236d));if(_0x5b236d[_0xcff0('0x28')]){if(_0x5b236d['error'][_0xcff0('0x29')]===0x1f4){logger[_0xcff0('0x28')](_0xcff0('0x25'),_0x5e80ea,_0x5b236d[_0xcff0('0x28')][_0xcff0('0x2a')]);return _0x467887(_0x5b236d['error'][_0xcff0('0x2a')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x5e80ea,_0x5b236d[_0xcff0('0x28')]['message']);return _0x404acb(_0x5b236d['error'][_0xcff0('0x2a')]);}else{logger[_0xcff0('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x5e80ea,_0xcff0('0x26'));_0x404acb(_0x5b236d[_0xcff0('0x2c')]['message']);}})['catch'](function(_0x422661){logger['error'](_0xcff0('0x25'),_0x5e80ea,_0x422661);_0x467887(_0x422661);});});}function respondWithStatusCode(_0x131f9e,_0x2e33f9){_0x2e33f9=_0x2e33f9||0xcc;return function(_0x5decb9){if(_0x5decb9){return _0x131f9e[_0xcff0('0x2d')](_0x2e33f9);}return _0x131f9e['status'](_0x2e33f9)[_0xcff0('0x2e')]();};}function respondWithResult(_0x2b3694,_0x28c366){_0x28c366=_0x28c366||0xc8;return function(_0x4e0472){if(_0x4e0472){return _0x2b3694[_0xcff0('0x2f')](_0x28c366)[_0xcff0('0x30')](_0x4e0472);}};}function respondWithFilteredResult(_0xbf9cb,_0x5e8f77){return function(_0x32af95){if(_0x32af95){var _0x152bf7=typeof _0x5e8f77[_0xcff0('0x31')]==='undefined'&&typeof _0x5e8f77[_0xcff0('0x32')]===_0xcff0('0x33');var _0x5cbc46=_0x32af95[_0xcff0('0x34')];var _0xd181b9=_0x152bf7?0x0:_0x5e8f77[_0xcff0('0x31')];var _0x1b6d67=_0x152bf7?_0x32af95[_0xcff0('0x34')]:_0x5e8f77[_0xcff0('0x31')]+_0x5e8f77[_0xcff0('0x32')];var _0x68515b;if(_0x1b6d67>=_0x5cbc46){_0x1b6d67=_0x5cbc46;_0x68515b=0xc8;}else{_0x68515b=0xce;}_0xbf9cb[_0xcff0('0x2f')](_0x68515b);return _0xbf9cb[_0xcff0('0x35')](_0xcff0('0x36'),_0xd181b9+'-'+_0x1b6d67+'/'+_0x5cbc46)[_0xcff0('0x30')](_0x32af95);}return null;};}function patchUpdates(_0x34e401){return function(_0x3c519b){try{jsonpatch['apply'](_0x3c519b,_0x34e401,!![]);}catch(_0x4dd2a2){return BPromise[_0xcff0('0x37')](_0x4dd2a2);}return _0x3c519b[_0xcff0('0x38')]();};}function saveUpdates(_0x1b1d26,_0x25641f){return function(_0x23866d){if(_0x23866d){return _0x23866d['update'](_0x1b1d26)[_0xcff0('0x24')](function(_0x4a0283){return _0x4a0283;});}return null;};}function removeEntity(_0x493845,_0x4a975a){return function(_0x18ee7c){if(_0x18ee7c){return _0x18ee7c[_0xcff0('0x39')]()['then'](function(){_0x493845[_0xcff0('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509ef1,_0x14d2ae){return function(_0x9d7e4a){if(!_0x9d7e4a){_0x509ef1[_0xcff0('0x2d')](0x194);}return _0x9d7e4a;};}function handleError(_0x729151,_0x369857){_0x369857=_0x369857||0x1f4;return function(_0x22666c){logger[_0xcff0('0x28')](_0x22666c[_0xcff0('0x3a')]);if(_0x22666c[_0xcff0('0x3b')]){delete _0x22666c[_0xcff0('0x3b')];}_0x729151[_0xcff0('0x2f')](_0x369857)[_0xcff0('0x3c')](_0x22666c);};}exports[_0xcff0('0x3d')]=function(_0x1da295,_0x15f4ae){var _0x1a8c61={},_0x53c2f2={},_0x4142f4={'count':0x0,'rows':[]};var _0x63c138=_['map'](db[_0xcff0('0x3e')][_0xcff0('0x3f')],function(_0x3ceb75){return{'name':_0x3ceb75[_0xcff0('0x40')],'type':_0x3ceb75[_0xcff0('0x41')][_0xcff0('0x42')]};});_0x53c2f2['model']=_[_0xcff0('0x43')](_0x63c138,'name');_0x53c2f2[_0xcff0('0x44')]=_[_0xcff0('0x45')](_0x1da295[_0xcff0('0x44')]);_0x53c2f2[_0xcff0('0x46')]=_[_0xcff0('0x47')](_0x53c2f2[_0xcff0('0x48')],_0x53c2f2['query']);_0x1a8c61['attributes']=_['intersection'](_0x53c2f2[_0xcff0('0x48')],qs[_0xcff0('0x49')](_0x1da295[_0xcff0('0x44')][_0xcff0('0x49')]));_0x1a8c61[_0xcff0('0x4a')]=_0x1a8c61[_0xcff0('0x4a')][_0xcff0('0x4b')]?_0x1a8c61[_0xcff0('0x4a')]:_0x53c2f2['model'];if(!_0x1da295[_0xcff0('0x44')][_0xcff0('0x4c')](_0xcff0('0x4d'))){_0x1a8c61[_0xcff0('0x32')]=qs['limit'](_0x1da295[_0xcff0('0x44')]['limit']);_0x1a8c61['offset']=qs[_0xcff0('0x31')](_0x1da295['query'][_0xcff0('0x31')]);}_0x1a8c61['order']=qs[_0xcff0('0x4e')](_0x1da295['query'][_0xcff0('0x4e')]);_0x1a8c61[_0xcff0('0x4f')]=qs['filters'](_['pick'](_0x1da295[_0xcff0('0x44')],_0x53c2f2[_0xcff0('0x46')]),_0x63c138);if(_0x1da295[_0xcff0('0x44')][_0xcff0('0x50')]){_0x1a8c61[_0xcff0('0x4f')]=_[_0xcff0('0x51')](_0x1a8c61[_0xcff0('0x4f')],{'$or':_[_0xcff0('0x43')](_0x63c138,function(_0x3a170f){if(_0x3a170f[_0xcff0('0x41')]!==_0xcff0('0x52')){var _0x486551={};_0x486551[_0x3a170f[_0xcff0('0x3b')]]={'$like':'%'+_0x1da295[_0xcff0('0x44')]['filter']+'%'};return _0x486551;}})});}_0x1a8c61=_[_0xcff0('0x51')]({},_0x1a8c61,_0x1da295[_0xcff0('0x53')]);var _0x5a9fe0={'where':_0x1a8c61[_0xcff0('0x4f')]};return db[_0xcff0('0x3e')][_0xcff0('0x34')](_0x5a9fe0)['then'](function(_0x3e07d3){_0x4142f4['count']=_0x3e07d3;if(_0x1da295[_0xcff0('0x44')][_0xcff0('0x54')]){_0x1a8c61[_0xcff0('0x55')]=[{'all':!![]}];}return db[_0xcff0('0x3e')][_0xcff0('0x56')](_0x1a8c61);})[_0xcff0('0x24')](function(_0x5c7445){_0x4142f4['rows']=_0x5c7445;return _0x4142f4;})['then'](respondWithFilteredResult(_0x15f4ae,_0x1a8c61))[_0xcff0('0x57')](handleError(_0x15f4ae,null));};exports[_0xcff0('0x58')]=function(_0x27682c,_0x376781){var _0x5ef693={'raw':!![],'where':{'id':_0x27682c[_0xcff0('0x59')]['id']}},_0x96b2e7={};_0x96b2e7['model']=_[_0xcff0('0x45')](db['FaxMessage']['rawAttributes']);_0x96b2e7['query']=_['keys'](_0x27682c[_0xcff0('0x44')]);_0x96b2e7[_0xcff0('0x46')]=_['intersection'](_0x96b2e7['model'],_0x96b2e7['query']);_0x5ef693[_0xcff0('0x4a')]=_[_0xcff0('0x47')](_0x96b2e7[_0xcff0('0x48')],qs[_0xcff0('0x49')](_0x27682c[_0xcff0('0x44')][_0xcff0('0x49')]));_0x5ef693[_0xcff0('0x4a')]=_0x5ef693['attributes'][_0xcff0('0x4b')]?_0x5ef693[_0xcff0('0x4a')]:_0x96b2e7['model'];if(_0x27682c['query'][_0xcff0('0x54')]){_0x5ef693[_0xcff0('0x55')]=[{'all':!![]}];}_0x5ef693=_[_0xcff0('0x51')]({},_0x5ef693,_0x27682c[_0xcff0('0x53')]);return db[_0xcff0('0x3e')][_0xcff0('0x5a')](_0x5ef693)[_0xcff0('0x24')](handleEntityNotFound(_0x376781,null))[_0xcff0('0x24')](respondWithResult(_0x376781,null))[_0xcff0('0x57')](handleError(_0x376781,null));};exports[_0xcff0('0x5b')]=function(_0x3eb132,_0xb1c5f3){if(_0x3eb132[_0xcff0('0x5c')]['id']){delete _0x3eb132[_0xcff0('0x5c')]['id'];}return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x3eb132['params']['id']}})[_0xcff0('0x24')](handleEntityNotFound(_0xb1c5f3,null))[_0xcff0('0x24')](saveUpdates(_0x3eb132[_0xcff0('0x5c')],null))[_0xcff0('0x24')](respondWithResult(_0xb1c5f3,null))[_0xcff0('0x57')](handleError(_0xb1c5f3,null));};exports['destroy']=function(_0x396b26,_0x46a501){return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x396b26['params']['id']}})[_0xcff0('0x24')](handleEntityNotFound(_0x46a501,null))['then'](removeEntity(_0x46a501,null))[_0xcff0('0x57')](handleError(_0x46a501,null));};exports[_0xcff0('0x5d')]=function(_0xb5764,_0x493606){return db[_0xcff0('0x3e')][_0xcff0('0x5d')]()['then'](respondWithResult(_0x493606,null))[_0xcff0('0x57')](handleError(_0x493606,null));};var interaction_log=require('../../config/logger')(_0xcff0('0x5e'));exports[_0xcff0('0x5f')]=function(_0x68f38c,_0x1b9256,_0x351716){var _0x4f1055={'agent':{},'channel':_0xcff0('0x60')};if(_0x68f38c[_0xcff0('0x5c')]['id']){delete _0x68f38c[_0xcff0('0x5c')]['id'];}_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x61')]=!![];_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x62')]=moment()[_0xcff0('0x63')](_0xcff0('0x64'));_0x68f38c[_0xcff0('0x5c')]['UserId']=_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x65')]||_0x68f38c[_0xcff0('0x66')]['id'];_0x4f1055['agent']['id']=_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x65')];return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x68f38c[_0xcff0('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b9256,null))[_0xcff0('0x24')](saveUpdates(_0x68f38c[_0xcff0('0x5c')],null))[_0xcff0('0x24')](function(_0x4018af){if(_0x4018af){_0x4f1055['message']=_0x4018af[_0xcff0('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xcff0('0x5a')]({'where':{'id':_0x4018af['FaxInteractionId']}});}return null;})[_0xcff0('0x24')](handleEntityNotFound(_0x1b9256,null))[_0xcff0('0x24')](function(_0xaf968c){if(_0xaf968c){return _0xaf968c[_0xcff0('0x5b')]({'UserId':_0x68f38c[_0xcff0('0x5c')]['UserId'],'read1stAt':_[_0xcff0('0x68')](_0xaf968c[_0xcff0('0x69')])?moment()[_0xcff0('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcff0('0x24')](function(_0x5b08f1){if(_0x5b08f1){_0x4f1055[_0xcff0('0x6a')]=_0x5b08f1[_0xcff0('0x67')]({'plain':!![]});interaction_log[_0xcff0('0x2b')](_0xcff0('0x6b'),_0x68f38c[_0xcff0('0x66')]['id'],_0x68f38c[_0xcff0('0x66')][_0xcff0('0x3b')],_0x68f38c[_0xcff0('0x66')][_0xcff0('0x6c')],_0x4f1055[_0xcff0('0x6a')]['id'],_0x68f38c[_0xcff0('0x5c')]?JSON[_0xcff0('0x27')](_0x68f38c[_0xcff0('0x5c')]):_0xcff0('0x6d'));return respondWithRpcPromise(_0xcff0('0x6e'),'acceptMessage',_0x4f1055);}return null;})[_0xcff0('0x24')](function(_0x316c42){var _0x40004b=_0xcff0('0x6f')+_0x316c42[_0xcff0('0x2a')][_0xcff0('0x70')];return db[_0xcff0('0x71')]['query'](_0x40004b,{'type':db[_0xcff0('0x72')][_0xcff0('0x73')][_0xcff0('0x74')],'raw':!![]})[_0xcff0('0x24')](function(_0x1d6f16){return _0x1d6f16;});})[_0xcff0('0x24')](function(_0x4c0121){if(_0x4c0121){_0x4f1055[_0xcff0('0x2a')]['contact']=_0x4c0121[0x0];if(!_0x68f38c[_0xcff0('0x5c')]['UserId'])return;return db['User'][_0xcff0('0x5a')]({'where':{'id':_0x68f38c[_0xcff0('0x5c')]['UserId'],'role':_0xcff0('0x75')},'attributes':['id',_0xcff0('0x3b'),_0xcff0('0x76'),'email','internal'],'raw':!![]});}return null;})[_0xcff0('0x24')](function(_0x55b28c){if(!_0x55b28c)return null;_0x4f1055[_0xcff0('0x2a')][_0xcff0('0x75')]=_0x55b28c;return _0x4f1055;})[_0xcff0('0x24')](function(_0x17eaa9){if(_0x17eaa9){if(_0x68f38c[_0xcff0('0x5c')][_0xcff0('0x77')]){_0x4f1055['message'][_0xcff0('0x78')]=util[_0xcff0('0x63')](_0xcff0('0x79'),_0x68f38c[_0xcff0('0x66')][_0xcff0('0x3b')]);_0x4f1055[_0xcff0('0x2a')][_0xcff0('0x7a')]=_0x4f1055[_0xcff0('0x7a')];_0x4f1055[_0xcff0('0x2a')][_0xcff0('0x7b')]=_0x4f1055[_0xcff0('0x7a')];_0x4f1055['message'][_0xcff0('0x7c')]=_0xcff0('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xcff0('0x7d'),'message':_0x4f1055[_0xcff0('0x2a')]},client9002)['then'](function(){return _0x4f1055;});}return _0x4f1055;}return null;})[_0xcff0('0x24')](respondWithResult(_0x1b9256,null))[_0xcff0('0x57')](handleError(_0x1b9256,null));};var interaction_log=require(_0xcff0('0x18'))(_0xcff0('0x5e'));exports[_0xcff0('0x37')]=function(_0x8a3b70,_0x3d504b,_0x255631){var _0x575da8={'agent':{},'channel':_0xcff0('0x60')};if(_0x8a3b70['body']['id']){delete _0x8a3b70[_0xcff0('0x5c')]['id'];}_0x8a3b70['body'][_0xcff0('0x65')]=_0x8a3b70[_0xcff0('0x5c')][_0xcff0('0x65')]||_0x8a3b70[_0xcff0('0x66')]['id'];_0x575da8['agent']['id']=_0x8a3b70[_0xcff0('0x5c')][_0xcff0('0x65')];return db['FaxMessage'][_0xcff0('0x5a')]({'where':{'id':_0x8a3b70[_0xcff0('0x59')]['id'],'UserId':null}})[_0xcff0('0x24')](handleEntityNotFound(_0x3d504b,null))['then'](function(_0xbc6d30){if(_0xbc6d30){_0x575da8[_0xcff0('0x2a')]=_0xbc6d30[_0xcff0('0x67')]({'plain':!![]});return db[_0xcff0('0x7e')][_0xcff0('0x5a')]({'where':{'id':_0xbc6d30['FaxInteractionId']}});}return null;})[_0xcff0('0x24')](handleEntityNotFound(_0x3d504b,null))[_0xcff0('0x24')](function(_0x58cb07){if(_0x58cb07){_0x575da8[_0xcff0('0x6a')]=_0x58cb07[_0xcff0('0x67')]({'plain':!![]});interaction_log[_0xcff0('0x2b')](_0xcff0('0x7f'),_0x8a3b70[_0xcff0('0x66')]['id'],_0x8a3b70[_0xcff0('0x66')][_0xcff0('0x3b')],_0x8a3b70[_0xcff0('0x66')]['role'],_0x575da8[_0xcff0('0x6a')]['id'],_0x8a3b70[_0xcff0('0x5c')]?JSON[_0xcff0('0x27')](_0x8a3b70[_0xcff0('0x5c')]):_0xcff0('0x6d'));return respondWithRpcPromise(_0xcff0('0x80'),_0xcff0('0x81'),_0x575da8);}return null;})[_0xcff0('0x24')](function(_0x336d5e){var _0x3509b6=_0xcff0('0x6f')+_0x336d5e[_0xcff0('0x2a')][_0xcff0('0x70')];return db[_0xcff0('0x71')][_0xcff0('0x44')](_0x3509b6,{'type':db[_0xcff0('0x72')][_0xcff0('0x73')][_0xcff0('0x74')],'raw':!![]})['then'](function(_0x4a8089){return _0x4a8089;});})[_0xcff0('0x24')](function(_0x3f1d51){if(_0x3f1d51){_0x575da8['message'][_0xcff0('0x82')]=_0x3f1d51[0x0];if(!_0x8a3b70['body'][_0xcff0('0x65')])return;return db[_0xcff0('0x83')][_0xcff0('0x5a')]({'where':{'id':_0x8a3b70[_0xcff0('0x5c')][_0xcff0('0x65')],'role':_0xcff0('0x75')},'attributes':['id',_0xcff0('0x3b'),_0xcff0('0x76'),'email',_0xcff0('0x84')],'raw':!![]});}return null;})[_0xcff0('0x24')](function(_0x14aed0){if(!_0x14aed0)return null;_0x575da8[_0xcff0('0x2a')][_0xcff0('0x75')]=_0x14aed0;return _0x575da8;})[_0xcff0('0x24')](function(_0x552634){if(_0x552634){_0x552634[_0xcff0('0x2a')][_0xcff0('0x78')]=util['format'](_0xcff0('0x79'),_0x8a3b70[_0xcff0('0x66')][_0xcff0('0x3b')]);_0x552634[_0xcff0('0x2a')][_0xcff0('0x7a')]=_0x575da8['channel'];_0x552634[_0xcff0('0x2a')][_0xcff0('0x7b')]=_0x575da8[_0xcff0('0x7a')];_0x552634[_0xcff0('0x2a')][_0xcff0('0x7c')]=_0xcff0('0x37');respondWithRpcPromise(_0xcff0('0x85'),_0xcff0('0x85'),{'event':_0xcff0('0x86'),'message':_0x552634[_0xcff0('0x2a')]},client9002);return _0x575da8;}return null;})[_0xcff0('0x24')](respondWithResult(_0x3d504b,null))[_0xcff0('0x57')](handleError(_0x3d504b,null));};exports[_0xcff0('0x87')]=function(_0x5a9844,_0x2f0773){var _0x2d804c;return db[_0xcff0('0x3e')][_0xcff0('0x87')](_0x5a9844[_0xcff0('0x5c')],{})[_0xcff0('0x24')](function(_0x8cf4f0){_0x2d804c=_0x8cf4f0;return db['CmContact'][_0xcff0('0x88')]({'where':{'id':_0x2d804c['ContactId']}});})[_0xcff0('0x24')](function(_0x17b6be){if(_[_0xcff0('0x68')](_0x17b6be)){return;}else{_0x2d804c[_0xcff0('0x60')]=_0x17b6be['fax'];return db['Attachment'][_0xcff0('0x88')]({'where':{'id':_0x2d804c[_0xcff0('0x89')]}});}})['then'](function(_0x253445){return respondWithRpcPromise(_0xcff0('0x8a'),_0xcff0('0x8a'),{'FaxAccountId':_[_0xcff0('0x68')](_0x5a9844[_0xcff0('0x5c')])?undefined:_0x5a9844[_0xcff0('0x5c')][_0xcff0('0x8b')],'path':_[_0xcff0('0x68')](_0x253445)?undefined:util[_0xcff0('0x63')](_0xcff0('0x8c'),_0x253445[_0xcff0('0x8d')]),'fax':_[_0xcff0('0x68')](_0x2d804c[_0xcff0('0x60')])?undefined:_0x2d804c[_0xcff0('0x60')],'AttachmentId':_0x2d804c[_0xcff0('0x89')]},client9002);})[_0xcff0('0x24')](respondWithResult(_0x2f0773,0xc9))[_0xcff0('0x57')](handleError(_0x2f0773,null));};exports[_0xcff0('0x8e')]=function(_0x143388,_0x44800a){var _0x3dca85=path[_0xcff0('0x8f')](config[_0xcff0('0x90')],_0xcff0('0x91'),_0xcff0('0x92'),_0xcff0('0x93'));return db[_0xcff0('0x3e')][_0xcff0('0x5a')]({'where':{'id':_0x143388[_0xcff0('0x59')]['id']},'include':[{'model':db[_0xcff0('0x94')],'as':_0xcff0('0x94')}]})[_0xcff0('0x24')](handleEntityNotFound(_0x44800a,null))[_0xcff0('0x24')](function(_0x3b0a29){if(_0x3b0a29){return _0x44800a[_0xcff0('0x8e')](path[_0xcff0('0x8f')](_0x3dca85,_0x3b0a29['Attachment'][_0xcff0('0x8d')]));}})[_0xcff0('0x57')](handleError(_0x44800a,null));}; \ No newline at end of file +var _0x866e=['readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','reject','CmContact','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','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','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','sendStatus','name','send','map','FaxMessage','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','describe','fax-interactions','accept','fax','read'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x866e,0x1ec));var _0xe866=function(_0x224dae,_0x182cc4){_0x224dae=_0x224dae-0x0;var _0x3661de=_0x866e[_0x224dae];return _0x3661de;};'use strict';var emlformat=require(_0xe866('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe866('0x1'));var moment=require(_0xe866('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe866('0x3'));var util=require(_0xe866('0x4'));var path=require(_0xe866('0x5'));var sox=require(_0xe866('0x6'));var csv=require(_0xe866('0x7'));var ejs=require(_0xe866('0x8'));var fs=require('fs');var fs_extra=require(_0xe866('0x9'));var _=require(_0xe866('0xa'));var squel=require(_0xe866('0xb'));var crypto=require(_0xe866('0xc'));var jsforce=require(_0xe866('0xd'));var deskjs=require(_0xe866('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe866('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe866('0x10'));var qs=require(_0xe866('0x11'));var as=require(_0xe866('0x12'));var hardwareService=require(_0xe866('0x13'));var logger=require(_0xe866('0x14'))(_0xe866('0x15'));var utils=require(_0xe866('0x16'));var config=require(_0xe866('0x17'));var licenseUtil=require(_0xe866('0x18'));var db=require(_0xe866('0x19'))['db'];config[_0xe866('0x1a')]=_['defaults'](config[_0xe866('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe866('0x1b'))(new Redis(config[_0xe866('0x1a')]));require(_0xe866('0x1c'))[_0xe866('0x1d')](socket);var jayson=require(_0xe866('0x1e'));var client=jayson[_0xe866('0x1f')][_0xe866('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xe866('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x7af191,_0x10646b,_0x20b759,_0x53c61c){return new BPromise(function(_0x54f711,_0xcc29f2){var _0x5cfe38=_0x53c61c||client;return _0x5cfe38[_0xe866('0x21')](_0x7af191,_0x20b759)[_0xe866('0x22')](function(_0x3d4b5f){logger[_0xe866('0x23')](_0xe866('0x24'),_0x10646b,_0xe866('0x25'));logger[_0xe866('0x26')](_0xe866('0x27'),_0x10646b,_0xe866('0x25'),JSON[_0xe866('0x28')](_0x3d4b5f));if(_0x3d4b5f[_0xe866('0x29')]){if(_0x3d4b5f['error'][_0xe866('0x2a')]===0x1f4){logger[_0xe866('0x29')](_0xe866('0x24'),_0x10646b,_0x3d4b5f['error'][_0xe866('0x2b')]);return _0xcc29f2(_0x3d4b5f[_0xe866('0x29')][_0xe866('0x2b')]);}logger[_0xe866('0x29')](_0xe866('0x24'),_0x10646b,_0x3d4b5f[_0xe866('0x29')][_0xe866('0x2b')]);return _0x54f711(_0x3d4b5f[_0xe866('0x29')]['message']);}else{logger[_0xe866('0x23')]('FaxMessage,\x20%s,\x20%s',_0x10646b,_0xe866('0x25'));_0x54f711(_0x3d4b5f[_0xe866('0x2c')][_0xe866('0x2b')]);}})[_0xe866('0x2d')](function(_0x2060f2){logger[_0xe866('0x29')](_0xe866('0x24'),_0x10646b,_0x2060f2);_0xcc29f2(_0x2060f2);});});}function respondWithStatusCode(_0x3f637b,_0x5770b9){_0x5770b9=_0x5770b9||0xcc;return function(_0x5d997e){if(_0x5d997e){return _0x3f637b['sendStatus'](_0x5770b9);}return _0x3f637b[_0xe866('0x2e')](_0x5770b9)[_0xe866('0x2f')]();};}function respondWithResult(_0x329abc,_0x2e722d){_0x2e722d=_0x2e722d||0xc8;return function(_0x336ac0){if(_0x336ac0){return _0x329abc['status'](_0x2e722d)[_0xe866('0x30')](_0x336ac0);}};}function respondWithFilteredResult(_0x3b3602,_0x30cad3){return function(_0x33bd0e){if(_0x33bd0e){var _0x31a54c=typeof _0x30cad3[_0xe866('0x31')]===_0xe866('0x32')&&typeof _0x30cad3['limit']===_0xe866('0x32');var _0x17eb10=_0x33bd0e['count'];var _0x446617=_0x31a54c?0x0:_0x30cad3[_0xe866('0x31')];var _0x10cc7b=_0x31a54c?_0x33bd0e[_0xe866('0x33')]:_0x30cad3[_0xe866('0x31')]+_0x30cad3[_0xe866('0x34')];var _0x2df120;if(_0x10cc7b>=_0x17eb10){_0x10cc7b=_0x17eb10;_0x2df120=0xc8;}else{_0x2df120=0xce;}_0x3b3602[_0xe866('0x2e')](_0x2df120);return _0x3b3602[_0xe866('0x35')](_0xe866('0x36'),_0x446617+'-'+_0x10cc7b+'/'+_0x17eb10)['json'](_0x33bd0e);}return null;};}function patchUpdates(_0x2fe00a){return function(_0x28be18){try{jsonpatch['apply'](_0x28be18,_0x2fe00a,!![]);}catch(_0x3deac7){return BPromise['reject'](_0x3deac7);}return _0x28be18[_0xe866('0x37')]();};}function saveUpdates(_0x52f975,_0x42cf74){return function(_0x721d80){if(_0x721d80){return _0x721d80[_0xe866('0x38')](_0x52f975)[_0xe866('0x22')](function(_0x2fc9ca){return _0x2fc9ca;});}return null;};}function removeEntity(_0x299954,_0x25f170){return function(_0x4fd5a6){if(_0x4fd5a6){return _0x4fd5a6[_0xe866('0x39')]()[_0xe866('0x22')](function(){_0x299954[_0xe866('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488ad9,_0xb41cdc){return function(_0x3051fc){if(!_0x3051fc){_0x488ad9[_0xe866('0x3a')](0x194);}return _0x3051fc;};}function handleError(_0x1f74f5,_0xfe0f7b){_0xfe0f7b=_0xfe0f7b||0x1f4;return function(_0x2f0646){logger[_0xe866('0x29')](_0x2f0646['stack']);if(_0x2f0646[_0xe866('0x3b')]){delete _0x2f0646[_0xe866('0x3b')];}_0x1f74f5['status'](_0xfe0f7b)[_0xe866('0x3c')](_0x2f0646);};}exports['index']=function(_0x3a0905,_0x5993ca){var _0x5ed116={},_0x553ba1={},_0x317051={'count':0x0,'rows':[]};var _0x2fada8=_[_0xe866('0x3d')](db[_0xe866('0x3e')][_0xe866('0x3f')],function(_0x54f735){return{'name':_0x54f735[_0xe866('0x40')],'type':_0x54f735['type']['key']};});_0x553ba1[_0xe866('0x41')]=_[_0xe866('0x3d')](_0x2fada8,'name');_0x553ba1[_0xe866('0x42')]=_[_0xe866('0x43')](_0x3a0905[_0xe866('0x42')]);_0x553ba1[_0xe866('0x44')]=_['intersection'](_0x553ba1[_0xe866('0x41')],_0x553ba1[_0xe866('0x42')]);_0x5ed116[_0xe866('0x45')]=_[_0xe866('0x46')](_0x553ba1[_0xe866('0x41')],qs[_0xe866('0x47')](_0x3a0905[_0xe866('0x42')][_0xe866('0x47')]));_0x5ed116['attributes']=_0x5ed116[_0xe866('0x45')][_0xe866('0x48')]?_0x5ed116[_0xe866('0x45')]:_0x553ba1[_0xe866('0x41')];if(!_0x3a0905['query'][_0xe866('0x49')](_0xe866('0x4a'))){_0x5ed116[_0xe866('0x34')]=qs[_0xe866('0x34')](_0x3a0905[_0xe866('0x42')][_0xe866('0x34')]);_0x5ed116[_0xe866('0x31')]=qs[_0xe866('0x31')](_0x3a0905['query'][_0xe866('0x31')]);}_0x5ed116['order']=qs[_0xe866('0x4b')](_0x3a0905['query'][_0xe866('0x4b')]);_0x5ed116['where']=qs[_0xe866('0x44')](_[_0xe866('0x4c')](_0x3a0905[_0xe866('0x42')],_0x553ba1[_0xe866('0x44')]),_0x2fada8);if(_0x3a0905[_0xe866('0x42')][_0xe866('0x4d')]){_0x5ed116['where']=_[_0xe866('0x4e')](_0x5ed116[_0xe866('0x4f')],{'$or':_[_0xe866('0x3d')](_0x2fada8,function(_0x50b4ca){if(_0x50b4ca[_0xe866('0x50')]!==_0xe866('0x51')){var _0x71643d={};_0x71643d[_0x50b4ca[_0xe866('0x3b')]]={'$like':'%'+_0x3a0905[_0xe866('0x42')]['filter']+'%'};return _0x71643d;}})});}_0x5ed116=_[_0xe866('0x4e')]({},_0x5ed116,_0x3a0905[_0xe866('0x52')]);var _0x385fa3={'where':_0x5ed116[_0xe866('0x4f')]};return db[_0xe866('0x3e')]['count'](_0x385fa3)['then'](function(_0x51c535){_0x317051['count']=_0x51c535;if(_0x3a0905[_0xe866('0x42')]['includeAll']){_0x5ed116[_0xe866('0x53')]=[{'all':!![]}];}return db[_0xe866('0x3e')][_0xe866('0x54')](_0x5ed116);})[_0xe866('0x22')](function(_0x53c3f8){_0x317051[_0xe866('0x55')]=_0x53c3f8;return _0x317051;})[_0xe866('0x22')](respondWithFilteredResult(_0x5993ca,_0x5ed116))[_0xe866('0x2d')](handleError(_0x5993ca,null));};exports[_0xe866('0x56')]=function(_0x4c8edf,_0x2d6107){var _0x904390={'raw':!![],'where':{'id':_0x4c8edf[_0xe866('0x57')]['id']}},_0x30f309={};_0x30f309[_0xe866('0x41')]=_[_0xe866('0x43')](db[_0xe866('0x3e')]['rawAttributes']);_0x30f309['query']=_[_0xe866('0x43')](_0x4c8edf['query']);_0x30f309[_0xe866('0x44')]=_[_0xe866('0x46')](_0x30f309['model'],_0x30f309[_0xe866('0x42')]);_0x904390['attributes']=_[_0xe866('0x46')](_0x30f309[_0xe866('0x41')],qs[_0xe866('0x47')](_0x4c8edf[_0xe866('0x42')][_0xe866('0x47')]));_0x904390[_0xe866('0x45')]=_0x904390[_0xe866('0x45')][_0xe866('0x48')]?_0x904390[_0xe866('0x45')]:_0x30f309[_0xe866('0x41')];if(_0x4c8edf['query'][_0xe866('0x58')]){_0x904390[_0xe866('0x53')]=[{'all':!![]}];}_0x904390=_['merge']({},_0x904390,_0x4c8edf[_0xe866('0x52')]);return db[_0xe866('0x3e')][_0xe866('0x59')](_0x904390)[_0xe866('0x22')](handleEntityNotFound(_0x2d6107,null))[_0xe866('0x22')](respondWithResult(_0x2d6107,null))['catch'](handleError(_0x2d6107,null));};exports[_0xe866('0x38')]=function(_0x20d0b3,_0x5545e1){if(_0x20d0b3[_0xe866('0x5a')]['id']){delete _0x20d0b3[_0xe866('0x5a')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x20d0b3[_0xe866('0x57')]['id']}})['then'](handleEntityNotFound(_0x5545e1,null))['then'](saveUpdates(_0x20d0b3[_0xe866('0x5a')],null))[_0xe866('0x22')](respondWithResult(_0x5545e1,null))[_0xe866('0x2d')](handleError(_0x5545e1,null));};exports[_0xe866('0x39')]=function(_0x4d73ad,_0x5d833a){return db[_0xe866('0x3e')]['find']({'where':{'id':_0x4d73ad[_0xe866('0x57')]['id']}})['then'](handleEntityNotFound(_0x5d833a,null))['then'](removeEntity(_0x5d833a,null))[_0xe866('0x2d')](handleError(_0x5d833a,null));};exports['describe']=function(_0x8dc77a,_0x473fc9){return db[_0xe866('0x3e')][_0xe866('0x5b')]()[_0xe866('0x22')](respondWithResult(_0x473fc9,null))[_0xe866('0x2d')](handleError(_0x473fc9,null));};var interaction_log=require(_0xe866('0x14'))(_0xe866('0x5c'));exports[_0xe866('0x5d')]=function(_0x46f9d9,_0x403319,_0x1de790){var _0x1dadd7={'agent':{},'channel':_0xe866('0x5e')};if(_0x46f9d9[_0xe866('0x5a')]['id']){delete _0x46f9d9[_0xe866('0x5a')]['id'];}_0x46f9d9[_0xe866('0x5a')][_0xe866('0x5f')]=!![];_0x46f9d9['body'][_0xe866('0x60')]=moment()['format'](_0xe866('0x61'));_0x46f9d9['body']['UserId']=_0x46f9d9[_0xe866('0x5a')]['UserId']||_0x46f9d9['user']['id'];_0x1dadd7['agent']['id']=_0x46f9d9[_0xe866('0x5a')][_0xe866('0x62')];return db[_0xe866('0x3e')]['find']({'where':{'id':_0x46f9d9[_0xe866('0x57')]['id'],'UserId':null}})[_0xe866('0x22')](handleEntityNotFound(_0x403319,null))[_0xe866('0x22')](saveUpdates(_0x46f9d9[_0xe866('0x5a')],null))['then'](function(_0x47a767){if(_0x47a767){_0x1dadd7[_0xe866('0x2b')]=_0x47a767[_0xe866('0x63')]({'plain':!![]});return db[_0xe866('0x64')][_0xe866('0x59')]({'where':{'id':_0x47a767[_0xe866('0x65')]}});}return null;})[_0xe866('0x22')](handleEntityNotFound(_0x403319,null))[_0xe866('0x22')](function(_0xb0aef){if(_0xb0aef){return _0xb0aef[_0xe866('0x38')]({'UserId':_0x46f9d9[_0xe866('0x5a')][_0xe866('0x62')],'read1stAt':_[_0xe866('0x66')](_0xb0aef[_0xe866('0x67')])?moment()[_0xe866('0x68')](_0xe866('0x61')):undefined});}return null;})['then'](function(_0x27794d){if(_0x27794d){_0x1dadd7[_0xe866('0x69')]=_0x27794d['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46f9d9['user']['id'],_0x46f9d9[_0xe866('0x6a')][_0xe866('0x3b')],_0x46f9d9[_0xe866('0x6a')][_0xe866('0x6b')],_0x1dadd7[_0xe866('0x69')]['id'],_0x46f9d9['body']?JSON[_0xe866('0x28')](_0x46f9d9[_0xe866('0x5a')]):_0xe866('0x6c'));return respondWithRpcPromise(_0xe866('0x6d'),'acceptMessage',_0x1dadd7);}return null;})['then'](function(_0x154792){var _0x47ea15=_0xe866('0x6e')+_0x154792['message'][_0xe866('0x6f')];return db[_0xe866('0x70')][_0xe866('0x42')](_0x47ea15,{'type':db[_0xe866('0x71')][_0xe866('0x72')]['SELECT'],'raw':!![]})[_0xe866('0x22')](function(_0x1f4843){return _0x1f4843;});})['then'](function(_0x62d532){if(_0x62d532){_0x1dadd7[_0xe866('0x2b')][_0xe866('0x73')]=_0x62d532[0x0];if(!_0x46f9d9['body']['UserId'])return;return db[_0xe866('0x74')]['find']({'where':{'id':_0x46f9d9[_0xe866('0x5a')]['UserId'],'role':_0xe866('0x75')},'attributes':['id','name',_0xe866('0x76'),'email',_0xe866('0x77')],'raw':!![]});}return null;})[_0xe866('0x22')](function(_0x319501){if(!_0x319501)return null;_0x1dadd7['message'][_0xe866('0x75')]=_0x319501;return _0x1dadd7;})[_0xe866('0x22')](function(_0x24d629){if(_0x24d629){if(_0x46f9d9['body'][_0xe866('0x78')]){_0x1dadd7[_0xe866('0x2b')][_0xe866('0x79')]=util[_0xe866('0x68')](_0xe866('0x7a'),_0x46f9d9[_0xe866('0x6a')][_0xe866('0x3b')]);_0x1dadd7[_0xe866('0x2b')]['channel']=_0x1dadd7[_0xe866('0x7b')];_0x1dadd7['message'][_0xe866('0x7c')]=_0x1dadd7[_0xe866('0x7b')];_0x1dadd7[_0xe866('0x2b')][_0xe866('0x7d')]=_0xe866('0x5d');return respondWithRpcPromise('EventManager',_0xe866('0x7e'),{'event':_0xe866('0x7f'),'message':_0x1dadd7[_0xe866('0x2b')]},client9002)['then'](function(){return _0x1dadd7;});}return _0x1dadd7;}return null;})['then'](respondWithResult(_0x403319,null))['catch'](handleError(_0x403319,null));};var interaction_log=require(_0xe866('0x14'))(_0xe866('0x5c'));exports['reject']=function(_0x17a0c3,_0x3b7234,_0x265c9a){var _0xdcd292={'agent':{},'channel':_0xe866('0x5e')};if(_0x17a0c3[_0xe866('0x5a')]['id']){delete _0x17a0c3[_0xe866('0x5a')]['id'];}_0x17a0c3[_0xe866('0x5a')]['UserId']=_0x17a0c3[_0xe866('0x5a')][_0xe866('0x62')]||_0x17a0c3[_0xe866('0x6a')]['id'];_0xdcd292[_0xe866('0x75')]['id']=_0x17a0c3[_0xe866('0x5a')][_0xe866('0x62')];return db[_0xe866('0x3e')][_0xe866('0x59')]({'where':{'id':_0x17a0c3[_0xe866('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b7234,null))[_0xe866('0x22')](function(_0x520f90){if(_0x520f90){_0xdcd292[_0xe866('0x2b')]=_0x520f90['get']({'plain':!![]});return db[_0xe866('0x64')]['find']({'where':{'id':_0x520f90[_0xe866('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3b7234,null))[_0xe866('0x22')](function(_0x46a4f8){if(_0x46a4f8){_0xdcd292['interaction']=_0x46a4f8[_0xe866('0x63')]({'plain':!![]});interaction_log[_0xe866('0x23')](_0xe866('0x80'),_0x17a0c3[_0xe866('0x6a')]['id'],_0x17a0c3[_0xe866('0x6a')]['name'],_0x17a0c3[_0xe866('0x6a')][_0xe866('0x6b')],_0xdcd292['interaction']['id'],_0x17a0c3[_0xe866('0x5a')]?JSON[_0xe866('0x28')](_0x17a0c3[_0xe866('0x5a')]):_0xe866('0x6c'));return respondWithRpcPromise(_0xe866('0x81'),_0xe866('0x82'),_0xdcd292);}return null;})['then'](function(_0x337a20){var _0x3dbe25='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x337a20[_0xe866('0x2b')]['ContactId'];return db['sequelize'][_0xe866('0x42')](_0x3dbe25,{'type':db[_0xe866('0x71')][_0xe866('0x72')][_0xe866('0x83')],'raw':!![]})[_0xe866('0x22')](function(_0x1e3b8e){return _0x1e3b8e;});})[_0xe866('0x22')](function(_0x189f92){if(_0x189f92){_0xdcd292[_0xe866('0x2b')]['contact']=_0x189f92[0x0];if(!_0x17a0c3['body'][_0xe866('0x62')])return;return db[_0xe866('0x74')][_0xe866('0x59')]({'where':{'id':_0x17a0c3[_0xe866('0x5a')][_0xe866('0x62')],'role':_0xe866('0x75')},'attributes':['id','name',_0xe866('0x76'),'email',_0xe866('0x77')],'raw':!![]});}return null;})[_0xe866('0x22')](function(_0x2267a1){if(!_0x2267a1)return null;_0xdcd292['message'][_0xe866('0x75')]=_0x2267a1;return _0xdcd292;})['then'](function(_0x1c1b9f){if(_0x1c1b9f){_0x1c1b9f[_0xe866('0x2b')][_0xe866('0x79')]=util[_0xe866('0x68')](_0xe866('0x7a'),_0x17a0c3['user'][_0xe866('0x3b')]);_0x1c1b9f['message'][_0xe866('0x7b')]=_0xdcd292[_0xe866('0x7b')];_0x1c1b9f[_0xe866('0x2b')]['motionChannel']=_0xdcd292['channel'];_0x1c1b9f[_0xe866('0x2b')][_0xe866('0x7d')]=_0xe866('0x84');respondWithRpcPromise(_0xe866('0x7e'),'EventManager',{'event':'rejectmessage','message':_0x1c1b9f['message']},client9002);return _0xdcd292;}return null;})[_0xe866('0x22')](respondWithResult(_0x3b7234,null))[_0xe866('0x2d')](handleError(_0x3b7234,null));};exports['create']=function(_0x2c8796,_0x4c0a64){var _0x25aa1d;return db['FaxMessage']['create'](_0x2c8796[_0xe866('0x5a')],{})[_0xe866('0x22')](function(_0xa3c68e){_0x25aa1d=_0xa3c68e;return db[_0xe866('0x85')]['findOne']({'where':{'id':_0x25aa1d[_0xe866('0x6f')]}});})[_0xe866('0x22')](function(_0x9f82f6){if(_[_0xe866('0x66')](_0x9f82f6)){return;}else{_0x25aa1d[_0xe866('0x5e')]=_0x9f82f6['fax'];return db[_0xe866('0x86')][_0xe866('0x87')]({'where':{'id':_0x25aa1d['AttachmentId']}});}})[_0xe866('0x22')](function(_0x2ae5b7){return respondWithRpcPromise(_0xe866('0x88'),_0xe866('0x88'),{'FaxAccountId':_[_0xe866('0x66')](_0x2c8796[_0xe866('0x5a')])?undefined:_0x2c8796[_0xe866('0x5a')][_0xe866('0x89')],'path':_['isNil'](_0x2ae5b7)?undefined:util[_0xe866('0x68')](_0xe866('0x8a'),_0x2ae5b7[_0xe866('0x8b')]),'fax':_[_0xe866('0x66')](_0x25aa1d[_0xe866('0x5e')])?undefined:_0x25aa1d[_0xe866('0x5e')],'AttachmentId':_0x25aa1d[_0xe866('0x8c')]},client9002);})['then'](respondWithResult(_0x4c0a64,0xc9))[_0xe866('0x2d')](handleError(_0x4c0a64,null));};exports[_0xe866('0x8d')]=function(_0x3dfb9e,_0x5a1800){var _0x1daf28=path[_0xe866('0x8e')](config[_0xe866('0x8f')],_0xe866('0x90'),_0xe866('0x91'),_0xe866('0x92'));return db[_0xe866('0x3e')][_0xe866('0x59')]({'where':{'id':_0x3dfb9e[_0xe866('0x57')]['id']},'include':[{'model':db[_0xe866('0x86')],'as':'Attachment'}]})[_0xe866('0x22')](handleEntityNotFound(_0x5a1800,null))[_0xe866('0x22')](function(_0x3f6ce8){if(_0x3f6ce8){return _0x5a1800[_0xe866('0x8d')](path[_0xe866('0x8e')](_0x1daf28,_0x3f6ce8['Attachment']['basename']));}})[_0xe866('0x2d')](handleError(_0x5a1800,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6da73ee..b62d4c3 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 _0xaee6=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4b3edd,_0x415325){var _0x4baf90=function(_0x19e868){while(--_0x19e868){_0x4b3edd['push'](_0x4b3edd['shift']());}};_0x4baf90(++_0x415325);}(_0xaee6,0x187));var _0x6aee=function(_0xa63b6,_0x53fe44){_0xa63b6=_0xa63b6-0x0;var _0x196c5d=_0xaee6[_0xa63b6];return _0x196c5d;};'use strict';var EventEmitter=require(_0x6aee('0x0'));var FaxMessage=require(_0x6aee('0x1'))['db'][_0x6aee('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6aee('0x3')](0x0);var events={'afterCreate':_0x6aee('0x4'),'afterUpdate':_0x6aee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46980d){return function(_0x3f11af,_0x1e23ba,_0x5e83b4){FaxMessageEvents[_0x6aee('0x6')](_0x46980d+':'+_0x3f11af['id'],_0x3f11af);FaxMessageEvents[_0x6aee('0x6')](_0x46980d,_0x3f11af);_0x5e83b4(null);};}for(var e in events){if(events[_0x6aee('0x7')](e)){var event=events[e];FaxMessage[_0x6aee('0x8')](e,emitEvent(event));}}module[_0x6aee('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x0424=['exports','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x263b1e,_0x3ed97b){var _0x3a64b3=function(_0x4c0981){while(--_0x4c0981){_0x263b1e['push'](_0x263b1e['shift']());}};_0x3a64b3(++_0x3ed97b);}(_0x0424,0x159));var _0x4042=function(_0x4ec805,_0x3b8515){_0x4ec805=_0x4ec805-0x0;var _0x386805=_0x0424[_0x4ec805];return _0x386805;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x4042('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4042('0x1')](0x0);var events={'afterCreate':_0x4042('0x2'),'afterUpdate':_0x4042('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cd879){return function(_0x519987,_0x491eae,_0x20d8df){FaxMessageEvents[_0x4042('0x4')](_0x3cd879+':'+_0x519987['id'],_0x519987);FaxMessageEvents[_0x4042('0x4')](_0x3cd879,_0x519987);_0x20d8df(null);};}for(var e in events){if(events[_0x4042('0x5')](e)){var event=events[e];FaxMessage[_0x4042('0x6')](e,emitEvent(event));}}module[_0x4042('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 570861e..e070636 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 _0xe470=['define','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe470,0x151));var _0x0e47=function(_0x8d5527,_0x585e60){_0x8d5527=_0x8d5527-0x0;var _0x32a98c=_0xe470[_0x8d5527];return _0x32a98c;};'use strict';var _=require(_0x0e47('0x0'));var util=require(_0x0e47('0x1'));var logger=require(_0x0e47('0x2'))(_0x0e47('0x3'));var moment=require(_0x0e47('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e47('0x5'));var fs=require('fs');var path=require(_0x0e47('0x6'));var rimraf=require(_0x0e47('0x7'));var config=require(_0x0e47('0x8'));var attributes=require(_0x0e47('0x9'));module[_0x0e47('0xa')]=function(_0x2c0cc1,_0x28dbba){return _0x2c0cc1[_0x0e47('0xb')]('FaxMessage',attributes,{'tableName':_0x0e47('0xc'),'paranoid':![],'indexes':[{'name':_0x0e47('0xd'),'fields':[_0x0e47('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x454ee6,_0x2accfb,_0x59143){var _0x57dc21=_0x2c0cc1[_0x0e47('0xf')];var _0x15bc71=_0x454ee6[_0x0e47('0x10')]({'plain':!![]});if(_0x15bc71['direction'][_0x0e47('0x11')]()==='in'||_0x15bc71[_0x0e47('0x12')][_0x0e47('0x11')]()==='out'&&!_0x15bc71[_0x0e47('0x13')]&&!_[_0x0e47('0x14')](_0x15bc71[_0x0e47('0x15')])){_0x57dc21[_0x0e47('0x16')][_0x0e47('0x17')]({'where':{'id':_0x15bc71[_0x0e47('0x18')]}})['then'](function(_0x13ae08){if(_0x13ae08){_0x13ae08['update']({'lastMsgAt':_0x15bc71['createdAt'],'lastMsgDirection':_0x15bc71['direction'][_0x0e47('0x11')]()});}})[_0x0e47('0x19')](function(_0x526e8a){console[_0x0e47('0x1a')](_0x526e8a);});}_0x59143();}},'charset':_0x0e47('0x1b'),'collate':_0x0e47('0x1c')});}; \ No newline at end of file +var _0x8da9=['path','rimraf','define','FaxMessage','body','get','direction','toLowerCase','out','secret','findOne','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise'];(function(_0x2d0fff,_0x128adc){var _0x40c5b1=function(_0x2bbb86){while(--_0x2bbb86){_0x2d0fff['push'](_0x2d0fff['shift']());}};_0x40c5b1(++_0x128adc);}(_0x8da9,0x65));var _0x98da=function(_0x191d3f,_0x4dc6bb){_0x191d3f=_0x191d3f-0x0;var _0x3b0772=_0x8da9[_0x191d3f];return _0x3b0772;};'use strict';var _=require(_0x98da('0x0'));var util=require(_0x98da('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x98da('0x2'));var BPromise=require('bluebird');var rp=require(_0x98da('0x3'));var fs=require('fs');var path=require(_0x98da('0x4'));var rimraf=require(_0x98da('0x5'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module['exports']=function(_0xbd78b9,_0x2a4b33){return _0xbd78b9[_0x98da('0x6')](_0x98da('0x7'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x98da('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2256cb,_0x4412df,_0x10773c){var _0x3d0019=_0xbd78b9['models'];var _0x4b2a3b=_0x2256cb[_0x98da('0x9')]({'plain':!![]});if(_0x4b2a3b[_0x98da('0xa')][_0x98da('0xb')]()==='in'||_0x4b2a3b[_0x98da('0xa')][_0x98da('0xb')]()===_0x98da('0xc')&&!_0x4b2a3b[_0x98da('0xd')]&&!_['isNil'](_0x4b2a3b['UserId'])){_0x3d0019['FaxInteraction'][_0x98da('0xe')]({'where':{'id':_0x4b2a3b['FaxInteractionId']}})[_0x98da('0xf')](function(_0x2687b1){if(_0x2687b1){_0x2687b1[_0x98da('0x10')]({'lastMsgAt':_0x4b2a3b[_0x98da('0x11')],'lastMsgDirection':_0x4b2a3b[_0x98da('0xa')][_0x98da('0xb')]()});}})['catch'](function(_0x3c3ff7){console[_0x98da('0x12')](_0x3c3ff7);});}_0x10773c();}},'charset':_0x98da('0x13'),'collate':_0x98da('0x14')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ab00ee6..c4dd46e 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 _0x34e8=['request\x20sent','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','update','body','attributes','limit','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x110945,_0x2ebb53){var _0x17a79d=function(_0x2ef008){while(--_0x2ef008){_0x110945['push'](_0x110945['shift']());}};_0x17a79d(++_0x2ebb53);}(_0x34e8,0x12c));var _0x834e=function(_0x46b019,_0x5e7cb0){_0x46b019=_0x46b019-0x0;var _0x274f55=_0x34e8[_0x46b019];return _0x274f55;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});config['redis']=_[_0x834e('0xc')](config[_0x834e('0xd')],{'host':_0x834e('0xe'),'port':0x18eb});var socket=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xd')]));require(_0x834e('0x10'))[_0x834e('0x11')](socket);function respondWithRpcPromise(_0x1af45a,_0x3bdda9,_0x186b3b){return new BPromise(function(_0x1e41fe,_0x36e124){return client[_0x834e('0x12')](_0x1af45a,_0x186b3b)[_0x834e('0x13')](function(_0x293514){logger[_0x834e('0x14')](_0x834e('0x15'),_0x3bdda9,'request\x20sent');logger[_0x834e('0x16')](_0x834e('0x17'),_0x3bdda9,'request\x20sent',JSON[_0x834e('0x18')](_0x293514));if(_0x293514[_0x834e('0x19')]){if(_0x293514[_0x834e('0x19')][_0x834e('0x1a')]===0x1f4){logger['error'](_0x834e('0x15'),_0x3bdda9,_0x293514[_0x834e('0x19')]['message']);return _0x36e124(_0x293514[_0x834e('0x19')]['message']);}logger[_0x834e('0x19')](_0x834e('0x15'),_0x3bdda9,_0x293514['error'][_0x834e('0x1b')]);return _0x1e41fe(_0x293514[_0x834e('0x19')][_0x834e('0x1b')]);}else{logger['info'](_0x834e('0x15'),_0x3bdda9,_0x834e('0x1c'));_0x1e41fe(_0x293514[_0x834e('0x1d')][_0x834e('0x1b')]);}})[_0x834e('0x1e')](function(_0x254677){logger[_0x834e('0x19')]('FaxMessage,\x20%s,\x20%s',_0x3bdda9,_0x254677);_0x36e124(_0x254677);});});}exports[_0x834e('0x1f')]=function(_0x1fd2c6){var _0x113ff4=this;return new Promise(function(_0x325a99,_0x4ab05d){return db[_0x834e('0x20')][_0x834e('0x21')](_0x1fd2c6['body'],{'raw':_0x1fd2c6[_0x834e('0x22')]?_0x1fd2c6[_0x834e('0x22')][_0x834e('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x4e3f48){logger[_0x834e('0x14')](_0x834e('0x1f'),_0x1fd2c6);logger['debug'](_0x834e('0x1f'),_0x1fd2c6,JSON[_0x834e('0x18')](_0x4e3f48));_0x325a99(_0x4e3f48);})['catch'](function(_0x3bc4f7){logger[_0x834e('0x19')](_0x834e('0x1f'),_0x3bc4f7['message'],_0x1fd2c6);_0x4ab05d(_0x113ff4[_0x834e('0x19')](0x1f4,_0x3bc4f7[_0x834e('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x5bef62){var _0x1e713a=this;return new Promise(function(_0x508a1d,_0x2826ec){return db[_0x834e('0x20')][_0x834e('0x24')](_0x5bef62[_0x834e('0x25')],{'raw':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bef62['options']?_0x5bef62['options']['where']||null:null,'attributes':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')][_0x834e('0x26')]||null:null,'limit':_0x5bef62['options']?_0x5bef62[_0x834e('0x22')][_0x834e('0x27')]||null:null})[_0x834e('0x13')](function(_0x1e026a){logger[_0x834e('0x14')](_0x834e('0x28'),_0x5bef62);logger[_0x834e('0x16')](_0x834e('0x28'),_0x5bef62,JSON[_0x834e('0x18')](_0x1e026a));_0x508a1d(_0x1e026a);})['catch'](function(_0xef9ec2){logger['error'](_0x834e('0x28'),_0xef9ec2[_0x834e('0x1b')],_0x5bef62);_0x2826ec(_0x1e713a[_0x834e('0x19')](0x1f4,_0xef9ec2[_0x834e('0x1b')]));});});}; \ No newline at end of file +var _0x9c44=['code','message','info','catch','FaxMessage','create','body','options','CreateFaxMessage','stringify','UpdateFaxMessage','update','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});config[_0x49c4('0x9')]=_[_0x49c4('0xa')](config[_0x49c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0xb'))(new Redis(config[_0x49c4('0x9')]));require(_0x49c4('0xc'))[_0x49c4('0xd')](socket);function respondWithRpcPromise(_0x4c7d3a,_0x5ab4a3,_0x451ea6){return new BPromise(function(_0x313e73,_0x58cad7){return client[_0x49c4('0xe')](_0x4c7d3a,_0x451ea6)[_0x49c4('0xf')](function(_0x4adb3c){logger['info'](_0x49c4('0x10'),_0x5ab4a3,_0x49c4('0x11'));logger['debug'](_0x49c4('0x12'),_0x5ab4a3,_0x49c4('0x11'),JSON['stringify'](_0x4adb3c));if(_0x4adb3c[_0x49c4('0x13')]){if(_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x14')]===0x1f4){logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x58cad7(_0x4adb3c[_0x49c4('0x13')]['message']);}logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x313e73(_0x4adb3c[_0x49c4('0x13')]['message']);}else{logger[_0x49c4('0x16')](_0x49c4('0x10'),_0x5ab4a3,'request\x20sent');_0x313e73(_0x4adb3c['result'][_0x49c4('0x15')]);}})[_0x49c4('0x17')](function(_0x3addb2){logger['error'](_0x49c4('0x10'),_0x5ab4a3,_0x3addb2);_0x58cad7(_0x3addb2);});});}exports['CreateFaxMessage']=function(_0x2cbd50){var _0x1806c2=this;return new Promise(function(_0xe31fcc,_0x291526){return db[_0x49c4('0x18')][_0x49c4('0x19')](_0x2cbd50[_0x49c4('0x1a')],{'raw':_0x2cbd50[_0x49c4('0x1b')]?_0x2cbd50[_0x49c4('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x57f502){logger[_0x49c4('0x16')]('CreateFaxMessage',_0x2cbd50);logger['debug'](_0x49c4('0x1c'),_0x2cbd50,JSON[_0x49c4('0x1d')](_0x57f502));_0xe31fcc(_0x57f502);})[_0x49c4('0x17')](function(_0xd335e4){logger['error']('CreateFaxMessage',_0xd335e4[_0x49c4('0x15')],_0x2cbd50);_0x291526(_0x1806c2[_0x49c4('0x13')](0x1f4,_0xd335e4['message']));});});};exports[_0x49c4('0x1e')]=function(_0x43e014){var _0x210159=this;return new Promise(function(_0xa7a826,_0x531d92){return db['FaxMessage'][_0x49c4('0x1f')](_0x43e014['body'],{'raw':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e014[_0x49c4('0x1b')]?_0x43e014['options'][_0x49c4('0x21')]||null:null,'attributes':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x22')]||null:null,'limit':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x23')]||null:null})[_0x49c4('0xf')](function(_0x17b50f){logger[_0x49c4('0x16')](_0x49c4('0x1e'),_0x43e014);logger['debug']('UpdateFaxMessage',_0x43e014,JSON['stringify'](_0x17b50f));_0xa7a826(_0x17b50f);})[_0x49c4('0x17')](function(_0x7ee704){logger[_0x49c4('0x13')](_0x49c4('0x1e'),_0x7ee704[_0x49c4('0x15')],_0x43e014);_0x531d92(_0x210159['error'](0x1f4,_0x7ee704[_0x49c4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 04488cd..cebbbc4 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 _0xed77=['faxMessage:','remove','emit','register','length'];(function(_0x15dab9,_0x2bac5e){var _0x356d97=function(_0x1f933d){while(--_0x1f933d){_0x15dab9['push'](_0x15dab9['shift']());}};_0x356d97(++_0x2bac5e);}(_0xed77,0x13c));var _0x7ed7=function(_0x2a6ba1,_0x6d173f){_0x2a6ba1=_0x2a6ba1-0x0;var _0x1b3e46=_0xed77[_0x2a6ba1];return _0x1b3e46;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x7ed7('0x0'),'update'];function createListener(_0x228435,_0x2dc401){return function(_0x772400){_0x2dc401[_0x7ed7('0x1')](_0x228435,_0x772400);};}function removeListener(_0x20cfa9,_0x2f219c){return function(){FaxMessageEvents['removeListener'](_0x20cfa9,_0x2f219c);};}exports[_0x7ed7('0x2')]=function(_0x19208b){for(var _0x513b0e=0x0,_0x52d42e=events[_0x7ed7('0x3')];_0x513b0e<_0x52d42e;_0x513b0e++){var _0x51bd2c=events[_0x513b0e];var _0x33693a=createListener(_0x7ed7('0x4')+_0x51bd2c,_0x19208b);FaxMessageEvents['on'](_0x51bd2c,_0x33693a);}}; \ No newline at end of file +var _0x8b62=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x21bd67,_0x11389f){var _0x46d728=function(_0x6902fa){while(--_0x6902fa){_0x21bd67['push'](_0x21bd67['shift']());}};_0x46d728(++_0x11389f);}(_0x8b62,0x115));var _0x28b6=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0x8b62[_0x16e57d];return _0x40239c;};'use strict';var FaxMessageEvents=require(_0x28b6('0x0'));var events=[_0x28b6('0x1'),_0x28b6('0x2'),'update'];function createListener(_0x2a5800,_0x37bb8a){return function(_0x4b128c){_0x37bb8a['emit'](_0x2a5800,_0x4b128c);};}function removeListener(_0x26dee9,_0x40211c){return function(){FaxMessageEvents[_0x28b6('0x3')](_0x26dee9,_0x40211c);};}exports[_0x28b6('0x4')]=function(_0x2e42cf){for(var _0x1181b7=0x0,_0x3f5f07=events[_0x28b6('0x5')];_0x1181b7<_0x3f5f07;_0x1181b7++){var _0x3189ae=events[_0x1181b7];var _0x5559bb=createListener(_0x28b6('0x6')+_0x3189ae,_0x2e42cf);FaxMessageEvents['on'](_0x3189ae,_0x5559bb);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index edaf22f..4abb7de 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 _0x5ec6=['express','fs-extra','../../components/interaction/service','./faxMessage.controller','isAuthenticated','index','/describe','get','/:id','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x43328e,_0xb9da9e){var _0x2b6ef7=function(_0x2eabf4){while(--_0x2eabf4){_0x43328e['push'](_0x43328e['shift']());}};_0x2b6ef7(++_0xb9da9e);}(_0x5ec6,0x7f));var _0x65ec=function(_0x51895f,_0x5e6fee){_0x51895f=_0x51895f-0x0;var _0x46b8bf=_0x5ec6[_0x51895f];return _0x46b8bf;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var fs_extra=require(_0x65ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65ec('0x5'));var config=require('../../config/environment');var controller=require(_0x65ec('0x6'));router['get']('/',auth[_0x65ec('0x7')](),controller[_0x65ec('0x8')]);router['get'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller['describe']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['show']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),interaction[_0x65ec('0xf')](_0x65ec('0x10'),'faxmessage:create'),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')]('/:id',auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);router[_0x65ec('0x12')](_0x65ec('0x14'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x15')]);router[_0x65ec('0x12')](_0x65ec('0x16'),auth['isAuthenticated'](),controller[_0x65ec('0x17')]);router[_0x65ec('0x18')](_0x65ec('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x65ec('0x19')]=router; \ No newline at end of file +var _0xc788=['describe','/:id','show','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc788,0xc4));var _0x8c78=function(_0x9ba307,_0x570631){_0x9ba307=_0x9ba307-0x0;var _0x335d04=_0xc788[_0x9ba307];return _0x335d04;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./faxMessage.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/download',auth[_0x8c78('0x9')](),controller['download']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),interaction['tracked'](_0x8c78('0x10'),_0x8c78('0x11')),controller['create']);router[_0x8c78('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8c78('0x13')]);router[_0x8c78('0x12')](_0x8c78('0x14'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x15')]);router[_0x8c78('0x12')](_0x8c78('0x16'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x17')]);router[_0x8c78('0x18')]('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3b75eec..59bb087 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 _0x18d4=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x36a157,_0x5384e7){var _0xb144bf=function(_0x2eb714){while(--_0x2eb714){_0x36a157['push'](_0x36a157['shift']());}};_0xb144bf(++_0x5384e7);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x418d('0x0'));module[_0x418d('0x1')]={'name':{'type':Sequelize[_0x418d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x418d('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x418d('0x4')](_0x418d('0x5'),_0x418d('0x6'),_0x418d('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x418d('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d4b=['exports','STRING','INTEGER','beepall','roundrobin','sequelize'];(function(_0x37cb5e,_0x41800d){var _0x28989e=function(_0x566d3d){while(--_0x566d3d){_0x37cb5e['push'](_0x37cb5e['shift']());}};_0x28989e(++_0x41800d);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x413dfc,_0x4bac10){_0x413dfc=_0x413dfc-0x0;var _0x4ac1ac=_0x6d4b[_0x413dfc];return _0x4ac1ac;};'use strict';var Sequelize=require(_0xb6d4('0x0'));module[_0xb6d4('0x1')]={'name':{'type':Sequelize[_0xb6d4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb6d4('0x2')]},'timeout':{'type':Sequelize[_0xb6d4('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xb6d4('0x4'),_0xb6d4('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb6d4('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 15c57b3..01938b3 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 _0xcded=['QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserFaxQueue','nolimit','order','FaxQueueId','findAll','agent','updatedAt','format','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','User','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcded,0x12e));var _0xdcde=function(_0x23f642,_0x3c8f66){_0x23f642=_0x23f642-0x0;var _0x4ba0d0=_0xcded[_0x23f642];return _0x4ba0d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdcde('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdcde('0x1'));var rp=require(_0xdcde('0x2'));var moment=require(_0xdcde('0x3'));var BPromise=require(_0xdcde('0x4'));var Mustache=require(_0xdcde('0x5'));var util=require(_0xdcde('0x6'));var path=require(_0xdcde('0x7'));var sox=require('sox');var csv=require(_0xdcde('0x8'));var ejs=require(_0xdcde('0x9'));var fs=require('fs');var fs_extra=require(_0xdcde('0xa'));var _=require(_0xdcde('0xb'));var squel=require('squel');var crypto=require(_0xdcde('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdcde('0x8'));var querystring=require('querystring');var Papa=require(_0xdcde('0xd'));var Redis=require(_0xdcde('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdcde('0xf'));var as=require(_0xdcde('0x10'));var hardwareService=require(_0xdcde('0x11'));var logger=require(_0xdcde('0x12'))(_0xdcde('0x13'));var utils=require(_0xdcde('0x14'));var config=require(_0xdcde('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcde('0x16'))['db'];config[_0xdcde('0x17')]=_[_0xdcde('0x18')](config[_0xdcde('0x17')],{'host':_0xdcde('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdcde('0x17')]));require('./faxQueue.socket')[_0xdcde('0x1a')](socket);function respondWithStatusCode(_0x510660,_0x554ab5){_0x554ab5=_0x554ab5||0xcc;return function(_0x5e2766){if(_0x5e2766){return _0x510660[_0xdcde('0x1b')](_0x554ab5);}return _0x510660[_0xdcde('0x1c')](_0x554ab5)[_0xdcde('0x1d')]();};}function respondWithResult(_0x3fa5cf,_0x5489bb){_0x5489bb=_0x5489bb||0xc8;return function(_0xd35b2a){if(_0xd35b2a){return _0x3fa5cf['status'](_0x5489bb)[_0xdcde('0x1e')](_0xd35b2a);}};}function respondWithFilteredResult(_0x41dc5f,_0x33a7f4){return function(_0x49747c){if(_0x49747c){var _0x3b227e=typeof _0x33a7f4[_0xdcde('0x1f')]===_0xdcde('0x20')&&typeof _0x33a7f4[_0xdcde('0x21')]==='undefined';var _0x2460d0=_0x49747c[_0xdcde('0x22')];var _0x4f566d=_0x3b227e?0x0:_0x33a7f4[_0xdcde('0x1f')];var _0x1bfbeb=_0x3b227e?_0x49747c[_0xdcde('0x22')]:_0x33a7f4[_0xdcde('0x1f')]+_0x33a7f4[_0xdcde('0x21')];var _0x53822d;if(_0x1bfbeb>=_0x2460d0){_0x1bfbeb=_0x2460d0;_0x53822d=0xc8;}else{_0x53822d=0xce;}_0x41dc5f[_0xdcde('0x1c')](_0x53822d);return _0x41dc5f[_0xdcde('0x23')](_0xdcde('0x24'),_0x4f566d+'-'+_0x1bfbeb+'/'+_0x2460d0)[_0xdcde('0x1e')](_0x49747c);}return null;};}function patchUpdates(_0x373ad8){return function(_0x5898f4){try{jsonpatch[_0xdcde('0x25')](_0x5898f4,_0x373ad8,!![]);}catch(_0x1f330b){return BPromise[_0xdcde('0x26')](_0x1f330b);}return _0x5898f4[_0xdcde('0x27')]();};}function saveUpdates(_0x14712d,_0x3cc8e0){return function(_0xe1ae57){if(_0xe1ae57){return _0xe1ae57[_0xdcde('0x28')](_0x14712d)[_0xdcde('0x29')](function(_0x3587e6){return _0x3587e6;});}return null;};}function removeEntity(_0x333ab3,_0x516950){return function(_0x14b052){if(_0x14b052){return _0x14b052[_0xdcde('0x2a')]()['then'](function(){var _0x1296af=_0x14b052[_0xdcde('0x2b')]({'plain':!![]});var _0x149f64=_0xdcde('0x2c');return db['UserProfileResource'][_0xdcde('0x2a')]({'where':{'type':_0x149f64,'resourceId':_0x1296af['id']}})[_0xdcde('0x29')](function(){return _0x14b052;});})[_0xdcde('0x29')](function(){_0x333ab3['status'](0xcc)[_0xdcde('0x1d')]();});}};}function handleEntityNotFound(_0x18c19e,_0x1d5286){return function(_0x5188ae){if(!_0x5188ae){_0x18c19e[_0xdcde('0x1b')](0x194);}return _0x5188ae;};}function handleError(_0x136b30,_0x59b626){_0x59b626=_0x59b626||0x1f4;return function(_0x212fad){logger[_0xdcde('0x2d')](_0x212fad[_0xdcde('0x2e')]);if(_0x212fad[_0xdcde('0x2f')]){delete _0x212fad[_0xdcde('0x2f')];}_0x136b30[_0xdcde('0x1c')](_0x59b626)[_0xdcde('0x30')](_0x212fad);};}exports[_0xdcde('0x31')]=function(_0x5ec77a,_0x365145){var _0x4cdfc5={},_0x15bcd1={},_0x214784={'count':0x0,'rows':[]};var _0x548fa5=_[_0xdcde('0x32')](db[_0xdcde('0x33')]['rawAttributes'],function(_0x18bbfa){return{'name':_0x18bbfa[_0xdcde('0x34')],'type':_0x18bbfa[_0xdcde('0x35')][_0xdcde('0x36')]};});_0x15bcd1[_0xdcde('0x37')]=_[_0xdcde('0x32')](_0x548fa5,_0xdcde('0x2f'));_0x15bcd1['query']=_[_0xdcde('0x38')](_0x5ec77a[_0xdcde('0x39')]);_0x15bcd1[_0xdcde('0x3a')]=_['intersection'](_0x15bcd1[_0xdcde('0x37')],_0x15bcd1['query']);_0x4cdfc5['attributes']=_[_0xdcde('0x3b')](_0x15bcd1['model'],qs[_0xdcde('0x3c')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x3c')]));_0x4cdfc5[_0xdcde('0x3d')]=_0x4cdfc5[_0xdcde('0x3d')]['length']?_0x4cdfc5[_0xdcde('0x3d')]:_0x15bcd1[_0xdcde('0x37')];if(!_0x5ec77a['query'][_0xdcde('0x3e')]('nolimit')){_0x4cdfc5['limit']=qs[_0xdcde('0x21')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x21')]);_0x4cdfc5[_0xdcde('0x1f')]=qs[_0xdcde('0x1f')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x1f')]);}_0x4cdfc5['order']=qs[_0xdcde('0x3f')](_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x3f')]);_0x4cdfc5['where']=qs['filters'](_[_0xdcde('0x40')](_0x5ec77a[_0xdcde('0x39')],_0x15bcd1[_0xdcde('0x3a')]),_0x548fa5);if(_0x5ec77a['query'][_0xdcde('0x41')]){_0x4cdfc5[_0xdcde('0x42')]=_[_0xdcde('0x43')](_0x4cdfc5[_0xdcde('0x42')],{'$or':_[_0xdcde('0x32')](_0x548fa5,function(_0x2feeb5){if(_0x2feeb5['type']!=='VIRTUAL'){var _0x3f4d21={};_0x3f4d21[_0x2feeb5[_0xdcde('0x2f')]]={'$like':'%'+_0x5ec77a[_0xdcde('0x39')]['filter']+'%'};return _0x3f4d21;}})});}_0x4cdfc5=_[_0xdcde('0x43')]({},_0x4cdfc5,_0x5ec77a['options']);var _0xfe43d2={'where':_0x4cdfc5[_0xdcde('0x42')]};return db[_0xdcde('0x33')][_0xdcde('0x22')](_0xfe43d2)[_0xdcde('0x29')](function(_0x1658db){_0x214784[_0xdcde('0x22')]=_0x1658db;if(_0x5ec77a[_0xdcde('0x39')][_0xdcde('0x44')]){_0x4cdfc5[_0xdcde('0x45')]=[{'all':!![]}];}return db[_0xdcde('0x33')]['findAll'](_0x4cdfc5);})['then'](function(_0x5d449b){_0x214784[_0xdcde('0x46')]=_0x5d449b;return _0x214784;})[_0xdcde('0x29')](respondWithFilteredResult(_0x365145,_0x4cdfc5))[_0xdcde('0x47')](handleError(_0x365145,null));};exports[_0xdcde('0x48')]=function(_0x2ae2c2,_0x11e879){var _0x273078={'raw':!![],'where':{'id':_0x2ae2c2[_0xdcde('0x49')]['id']}},_0x38a4f5={};_0x38a4f5[_0xdcde('0x37')]=_['keys'](db['FaxQueue'][_0xdcde('0x4a')]);_0x38a4f5[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x2ae2c2['query']);_0x38a4f5['filters']=_[_0xdcde('0x3b')](_0x38a4f5[_0xdcde('0x37')],_0x38a4f5[_0xdcde('0x39')]);_0x273078[_0xdcde('0x3d')]=_['intersection'](_0x38a4f5['model'],qs[_0xdcde('0x3c')](_0x2ae2c2[_0xdcde('0x39')]['fields']));_0x273078[_0xdcde('0x3d')]=_0x273078['attributes'][_0xdcde('0x4b')]?_0x273078[_0xdcde('0x3d')]:_0x38a4f5['model'];if(_0x2ae2c2[_0xdcde('0x39')]['includeAll']){_0x273078[_0xdcde('0x45')]=[{'all':!![]}];}_0x273078=_['merge']({},_0x273078,_0x2ae2c2[_0xdcde('0x4c')]);return db[_0xdcde('0x33')][_0xdcde('0x4d')](_0x273078)[_0xdcde('0x29')](handleEntityNotFound(_0x11e879,null))['then'](respondWithResult(_0x11e879,null))[_0xdcde('0x47')](handleError(_0x11e879,null));};exports[_0xdcde('0x4e')]=function(_0x23be15,_0x229442){return db[_0xdcde('0x33')][_0xdcde('0x4e')](_0x23be15[_0xdcde('0x4f')],{})[_0xdcde('0x29')](function(_0x503bb6){var _0x2452bd=_0x23be15[_0xdcde('0x50')][_0xdcde('0x2b')]({'plain':!![]});if(!_0x2452bd)throw new Error(_0xdcde('0x51'));if(_0x2452bd[_0xdcde('0x52')]==='user'){var _0x5045e0=_0x503bb6[_0xdcde('0x2b')]({'plain':!![]});var _0x217d84=_0xdcde('0x2c');return db[_0xdcde('0x53')][_0xdcde('0x4d')]({'where':{'name':_0x217d84,'userProfileId':_0x2452bd[_0xdcde('0x54')]},'raw':!![]})[_0xdcde('0x29')](function(_0x3dc3fb){if(_0x3dc3fb&&_0x3dc3fb[_0xdcde('0x55')]===0x0){return db['UserProfileResource'][_0xdcde('0x4e')]({'name':_0x5045e0[_0xdcde('0x2f')],'resourceId':_0x5045e0['id'],'type':_0x3dc3fb[_0xdcde('0x2f')],'sectionId':_0x3dc3fb['id']},{})[_0xdcde('0x29')](function(){return _0x503bb6;});}else{return _0x503bb6;}})[_0xdcde('0x47')](function(_0x3c4031){logger[_0xdcde('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c4031);throw _0x3c4031;});}return _0x503bb6;})[_0xdcde('0x29')](respondWithResult(_0x229442,0xc9))[_0xdcde('0x47')](handleError(_0x229442,null));};exports[_0xdcde('0x28')]=function(_0x247436,_0x51c726){if(_0x247436[_0xdcde('0x4f')]['id']){delete _0x247436[_0xdcde('0x4f')]['id'];}return db[_0xdcde('0x33')][_0xdcde('0x4d')]({'where':{'id':_0x247436[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x51c726,null))[_0xdcde('0x29')](saveUpdates(_0x247436[_0xdcde('0x4f')],null))[_0xdcde('0x29')](respondWithResult(_0x51c726,null))[_0xdcde('0x47')](handleError(_0x51c726,null));};exports[_0xdcde('0x2a')]=function(_0xf6218c,_0x45aa9f){return db[_0xdcde('0x33')]['find']({'where':{'id':_0xf6218c[_0xdcde('0x49')]['id']}})['then'](handleEntityNotFound(_0x45aa9f,null))[_0xdcde('0x29')](removeEntity(_0x45aa9f,null))[_0xdcde('0x47')](handleError(_0x45aa9f,null));};exports['describe']=function(_0x29eac7,_0x242466){return db[_0xdcde('0x33')][_0xdcde('0x56')]()[_0xdcde('0x29')](respondWithResult(_0x242466,null))[_0xdcde('0x47')](handleError(_0x242466,null));};exports[_0xdcde('0x57')]=function(_0x5e0224,_0x1186d1,_0x30de2e){var _0x8e5c1b={'raw':!![],'where':{}},_0x9be0b4={},_0x19f0be;return db[_0xdcde('0x33')][_0xdcde('0x58')]({'where':{'id':_0x5e0224[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x1186d1,null))[_0xdcde('0x29')](function(_0x50e587){if(_0x50e587){_0x19f0be=_0x50e587[_0xdcde('0x2b')]({'plain':!![]});_0x9be0b4[_0xdcde('0x37')]=_[_0xdcde('0x38')](db[_0xdcde('0x59')]['rawAttributes']);_0x9be0b4[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x5e0224[_0xdcde('0x39')]);_0x9be0b4[_0xdcde('0x3a')]=_['intersection'](_0x9be0b4[_0xdcde('0x37')],_0x9be0b4[_0xdcde('0x39')]);_0x8e5c1b[_0xdcde('0x3d')]=_[_0xdcde('0x3b')](_0x9be0b4[_0xdcde('0x37')],qs[_0xdcde('0x3c')](_0x5e0224[_0xdcde('0x39')][_0xdcde('0x3c')]));_0x8e5c1b[_0xdcde('0x3d')]=_0x8e5c1b[_0xdcde('0x3d')][_0xdcde('0x4b')]?_0x8e5c1b[_0xdcde('0x3d')]:_0x9be0b4[_0xdcde('0x37')];if(!_0x5e0224[_0xdcde('0x39')]['hasOwnProperty'](_0xdcde('0x5a'))){_0x8e5c1b[_0xdcde('0x21')]=qs[_0xdcde('0x21')](_0x5e0224[_0xdcde('0x39')]['limit']);_0x8e5c1b['offset']=qs['offset'](_0x5e0224[_0xdcde('0x39')][_0xdcde('0x1f')]);}_0x8e5c1b[_0xdcde('0x5b')]=qs[_0xdcde('0x3f')](_0x5e0224[_0xdcde('0x39')][_0xdcde('0x3f')]);_0x8e5c1b[_0xdcde('0x42')]=qs['filters'](_['pick'](_0x5e0224['query'],_0x9be0b4[_0xdcde('0x3a')]));_0x8e5c1b[_0xdcde('0x42')][_0xdcde('0x5c')]=_0x50e587['id'];if(_0x5e0224['query'][_0xdcde('0x41')]){_0x8e5c1b['where']=_[_0xdcde('0x43')](_0x8e5c1b[_0xdcde('0x42')],{'$or':_['map'](_0x8e5c1b['attributes'],function(_0x422d55){var _0x19f90a={};_0x19f90a[_0x422d55]={'$like':'%'+_0x5e0224[_0xdcde('0x39')]['filter']+'%'};return _0x19f90a;})});}_0x8e5c1b=_['merge']({},_0x8e5c1b,_0x5e0224[_0xdcde('0x4c')]);return db['UserFaxQueue'][_0xdcde('0x5d')](_0x8e5c1b);}})[_0xdcde('0x29')](function(_0x1e493c){if(_0x1e493c){return db['User']['findAndCountAll']({'where':{'id':_[_0xdcde('0x32')](_0x1e493c,'UserId'),'role':_0xdcde('0x5e')},'attributes':['id','name','faxPause',_0xdcde('0x5f'),'createdAt']});}})[_0xdcde('0x29')](function(_0x47d9c2){if(_0x47d9c2){return{'count':_0x47d9c2[_0xdcde('0x22')],'rows':_['map'](_0x47d9c2[_0xdcde('0x46')],function(_0x2961a1){return{'membername':_0x2961a1['name'],'UserId':_0x2961a1['id'],'queue_name':_0x19f0be[_0xdcde('0x2f')],'FaxQueueId':_0x19f0be['id'],'interface':util[_0xdcde('0x60')](_0xdcde('0x61'),_0xdcde('0x62'),_0x2961a1[_0xdcde('0x2f')]),'penalty':0x0,'paused':_0x2961a1[_0xdcde('0x63')],'createdAt':_0x2961a1['createdAt'],'updatedAt':_0x2961a1[_0xdcde('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1186d1,_0x8e5c1b))[_0xdcde('0x47')](handleError(_0x1186d1,null));};exports[_0xdcde('0x64')]=function(_0x1c8c83,_0x15b95a,_0x2a54bd){var _0x5132db={};var _0x3cdbdc={};var _0x4b1c65;var _0x3ec42e;return db[_0xdcde('0x33')][_0xdcde('0x58')]({'where':{'id':_0x1c8c83[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x15b95a,null))[_0xdcde('0x29')](function(_0x88fe8d){if(_0x88fe8d){_0x4b1c65=_0x88fe8d;_0x3cdbdc[_0xdcde('0x37')]=_['keys'](db[_0xdcde('0x65')][_0xdcde('0x4a')]);_0x3cdbdc[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x1c8c83[_0xdcde('0x39')]);_0x3cdbdc[_0xdcde('0x3a')]=_[_0xdcde('0x3b')](_0x3cdbdc['model'],_0x3cdbdc[_0xdcde('0x39')]);_0x5132db[_0xdcde('0x3d')]=_['intersection'](_0x3cdbdc[_0xdcde('0x37')],qs['fields'](_0x1c8c83[_0xdcde('0x39')]['fields']));_0x5132db[_0xdcde('0x3d')]=_0x5132db[_0xdcde('0x3d')][_0xdcde('0x4b')]?_0x5132db[_0xdcde('0x3d')]:_0x3cdbdc['model'];_0x5132db[_0xdcde('0x5b')]=qs['sort'](_0x1c8c83[_0xdcde('0x39')]['sort']);_0x5132db['where']=qs[_0xdcde('0x3a')](_[_0xdcde('0x40')](_0x1c8c83['query'],_0x3cdbdc[_0xdcde('0x3a')]));if(_0x1c8c83['query']['filter']){_0x5132db[_0xdcde('0x42')]=_[_0xdcde('0x43')](_0x5132db[_0xdcde('0x42')],{'$or':_[_0xdcde('0x32')](_0x5132db[_0xdcde('0x3d')],function(_0x5cc164){var _0x5256ed={};_0x5256ed[_0x5cc164]={'$like':'%'+_0x1c8c83[_0xdcde('0x39')][_0xdcde('0x41')]+'%'};return _0x5256ed;})});}_0x5132db=_[_0xdcde('0x43')]({},_0x5132db,_0x1c8c83[_0xdcde('0x4c')]);return _0x4b1c65[_0xdcde('0x64')](_0x5132db);}})[_0xdcde('0x29')](function(_0x31bd1b){if(_0x31bd1b){_0x3ec42e=_0x31bd1b[_0xdcde('0x4b')];if(!_0x1c8c83[_0xdcde('0x39')]['hasOwnProperty']('nolimit')){_0x5132db[_0xdcde('0x21')]=qs[_0xdcde('0x21')](_0x1c8c83[_0xdcde('0x39')]['limit']);_0x5132db[_0xdcde('0x1f')]=qs['offset'](_0x1c8c83[_0xdcde('0x39')][_0xdcde('0x1f')]);}return _0x4b1c65[_0xdcde('0x64')](_0x5132db);}})[_0xdcde('0x29')](function(_0x1317df){if(_0x1317df){return _0x1317df?{'count':_0x3ec42e,'rows':_0x1317df}:null;}})[_0xdcde('0x29')](respondWithResult(_0x15b95a,null))[_0xdcde('0x47')](handleError(_0x15b95a,null));};exports[_0xdcde('0x66')]=function(_0x45cb78,_0x126cd7,_0x3be76d){var _0x3889a9=_0x45cb78[_0xdcde('0x4f')][_0xdcde('0x67')];return db[_0xdcde('0x65')][_0xdcde('0x5d')]({'where':{'id':_0x3889a9},'attributes':['id'],'include':[{'model':db[_0xdcde('0x68')],'as':_0xdcde('0x69'),'attributes':['id',_0xdcde('0x2f'),'online',_0xdcde('0x6a'),'interface'],'raw':!![]}]})[_0xdcde('0x29')](function(_0x51b6d3){if(_0x51b6d3){var _0x4cc3f4=_[_0xdcde('0x6b')](_0x51b6d3,function(_0x85d8e6){var _0xb4e103=_0x85d8e6[_0xdcde('0x2b')]({'plain':!![]});return _0xb4e103[_0xdcde('0x69')];});return db[_0xdcde('0x33')][_0xdcde('0x4d')]({'where':{'id':_0x45cb78['params']['id']}})[_0xdcde('0x29')](function(_0x59b50c){return db[_0xdcde('0x6c')][_0xdcde('0x6d')](function(_0x4e68e6){return _0x59b50c['addTeams'](_0x3889a9,{'transaction':_0x4e68e6})[_0xdcde('0x29')](function(){return BPromise[_0xdcde('0x6e')](_0x4cc3f4,function(_0x299e90){return db['UserFaxQueue'][_0xdcde('0x6f')]({'where':{'UserId':_0x299e90['id'],'FaxQueueId':_0x45cb78[_0xdcde('0x49')]['id']},'transaction':_0x4e68e6});});})[_0xdcde('0x29')](function(){_0x4cc3f4['forEach'](function(_0x22c353){socket[_0xdcde('0x70')](_0xdcde('0x71'),{'UserId':_0x22c353['id'],'FaxQueueId':_0x59b50c['id']});});});});});}})['then'](respondWithStatusCode(_0x126cd7,null))['catch'](handleError(_0x126cd7,null));};exports[_0xdcde('0x72')]=function(_0x217427,_0x5399f6,_0x580e48){return db[_0xdcde('0x65')][_0xdcde('0x5d')]({'where':{'id':_0x217427['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdcde('0x69'),'attributes':['id'],'raw':!![]}]})[_0xdcde('0x29')](handleEntityNotFound(_0x5399f6,null))[_0xdcde('0x29')](function(_0x4cab55){var _0x360cf9=_[_0xdcde('0x32')](_0x4cab55,'id');var _0x14bcd1=[];var _0x46f867=[];var _0x1c13c1=squel[_0xdcde('0x73')]();_0x1c13c1[_0xdcde('0x74')](_0xdcde('0x75'))[_0xdcde('0x76')](_0xdcde('0x77'),'tq')[_0xdcde('0x78')]('user_has_teams','ut',_0xdcde('0x79'))[_0xdcde('0x42')](_0xdcde('0x7a'),_0x217427[_0xdcde('0x49')]['id']);for(var _0x2f0b96=0x0;_0x2f0b96<_0x4cab55[_0xdcde('0x4b')];_0x2f0b96+=0x1){let _0x2756f0=_0x4cab55[_0x2f0b96];for(var _0x584afd=0x0;_0x584afd<_0x2756f0['Agents'][_0xdcde('0x4b')];_0x584afd+=0x1){let _0x3ca277=_0x2756f0['Agents'][_0x584afd];var _0xf4f84b=_0x1c13c1[_0xdcde('0x7b')]();_0xf4f84b[_0xdcde('0x42')](_0xdcde('0x7c'),_0x3ca277['id']);_0x46f867[_0xdcde('0x7d')](db[_0xdcde('0x6c')][_0xdcde('0x39')](_0xf4f84b[_0xdcde('0x7e')](),{'type':db[_0xdcde('0x6c')][_0xdcde('0x7f')][_0xdcde('0x80')]})[_0xdcde('0x29')](function(_0x18ca7e){if(_0x18ca7e['length']===0x1){return _0x3ca277['id'];}else{var _0x19667c=_[_0xdcde('0x81')](_['map'](_0x18ca7e,_0xdcde('0x82')),function(_0x1a199a){return _['includes'](_0x360cf9,_0x1a199a);});if(_0x19667c){return _0x3ca277['id'];}}}));}}return BPromise[_0xdcde('0x83')](_0x46f867)[_0xdcde('0x29')](function(_0x87ede1){_0x14bcd1=_(_0x14bcd1)[_0xdcde('0x84')](_0x87ede1)[_0xdcde('0x85')]()[_0xdcde('0x86')]();return db['FaxQueue']['find']({'where':{'id':_0x217427['params']['id']}})[_0xdcde('0x29')](function(_0x4ea890){return db[_0xdcde('0x6c')][_0xdcde('0x6d')](function(_0x5484f0){return _0x4ea890[_0xdcde('0x72')](_0x217427[_0xdcde('0x39')][_0xdcde('0x67')],{'transaction':_0x5484f0})[_0xdcde('0x29')](function(){if(!_[_0xdcde('0x87')](_0x14bcd1)){return _0x4ea890[_0xdcde('0x88')](_0x14bcd1,{'transaction':_0x5484f0});}})[_0xdcde('0x29')](function(){_0x14bcd1['forEach'](function(_0x47176b){socket['emit'](_0xdcde('0x89'),{'UserId':_0x47176b,'FaxQueueId':_0x4ea890['id']});});});});});});})[_0xdcde('0x29')](respondWithStatusCode(_0x5399f6,null))[_0xdcde('0x47')](handleError(_0x5399f6,null));};exports[_0xdcde('0x8a')]=function(_0x1753d1,_0x26fd80,_0x13d34f){return db[_0xdcde('0x33')][_0xdcde('0x4d')]({'where':{'id':_0x1753d1[_0xdcde('0x49')]['id']}})['then'](handleEntityNotFound(_0x26fd80,null))[_0xdcde('0x29')](function(_0x526814){if(_0x526814){return _0x526814['addAgents'](_0x1753d1['body'][_0xdcde('0x67')],_[_0xdcde('0x8b')](_0x1753d1['body'],[_0xdcde('0x67'),'id'])||{})[_0xdcde('0x8c')](function(_0x563d46){for(var _0x439e01=0x0;_0x439e01<_0x1753d1[_0xdcde('0x4f')][_0xdcde('0x67')]['length'];_0x439e01+=0x1){socket[_0xdcde('0x70')](_0xdcde('0x71'),{'UserId':Number(_0x1753d1[_0xdcde('0x4f')][_0xdcde('0x67')][_0x439e01]),'FaxQueueId':Number(_0x1753d1[_0xdcde('0x49')]['id'])});}return _0x563d46;});}})[_0xdcde('0x29')](respondWithResult(_0x26fd80,null))[_0xdcde('0x47')](handleError(_0x26fd80,null));};exports['removeAgents']=function(_0xf6fc0c,_0x153520,_0x17b317){return db['FaxQueue'][_0xdcde('0x4d')]({'where':{'id':_0xf6fc0c[_0xdcde('0x49')]['id']}})['then'](handleEntityNotFound(_0x153520,null))['then'](function(_0xbabaf4){if(_0xbabaf4){return _0xbabaf4[_0xdcde('0x88')](_0xf6fc0c[_0xdcde('0x39')][_0xdcde('0x67')])[_0xdcde('0x29')](function(){if(_[_0xdcde('0x8d')](_0xf6fc0c[_0xdcde('0x39')][_0xdcde('0x67')])){for(var _0x2fa602=0x0;_0x2fa602<_0xf6fc0c[_0xdcde('0x39')]['ids'][_0xdcde('0x4b')];_0x2fa602+=0x1){socket['emit'](_0xdcde('0x89'),{'UserId':Number(_0xf6fc0c['query']['ids'][_0x2fa602]),'FaxQueueId':Number(_0xf6fc0c[_0xdcde('0x49')]['id'])});}}else{socket[_0xdcde('0x70')](_0xdcde('0x89'),{'UserId':Number(_0xf6fc0c[_0xdcde('0x39')][_0xdcde('0x67')]),'FaxQueueId':Number(_0xf6fc0c['params']['id'])});}});}})[_0xdcde('0x29')](respondWithStatusCode(_0x153520,null))[_0xdcde('0x47')](handleError(_0x153520,null));};exports[_0xdcde('0x8e')]=function(_0x1a397d,_0x3c8e92,_0x227eb8){var _0x21b690={};var _0x3c3965={};var _0x5f4ff9;var _0x2aac67;return db['FaxQueue']['findOne']({'where':{'id':_0x1a397d[_0xdcde('0x49')]['id']}})[_0xdcde('0x29')](handleEntityNotFound(_0x3c8e92,null))[_0xdcde('0x29')](function(_0x54971c){if(_0x54971c){_0x5f4ff9=_0x54971c;_0x3c3965[_0xdcde('0x37')]=_[_0xdcde('0x38')](db['User'][_0xdcde('0x4a')]);_0x3c3965[_0xdcde('0x39')]=_[_0xdcde('0x38')](_0x1a397d[_0xdcde('0x39')]);_0x3c3965[_0xdcde('0x3a')]=_[_0xdcde('0x3b')](_0x3c3965[_0xdcde('0x37')],_0x3c3965['query']);_0x21b690[_0xdcde('0x3d')]=_[_0xdcde('0x3b')](_0x3c3965[_0xdcde('0x37')],qs['fields'](_0x1a397d['query'][_0xdcde('0x3c')]));_0x21b690[_0xdcde('0x3d')]=_0x21b690['attributes'][_0xdcde('0x4b')]?_0x21b690['attributes']:_0x3c3965[_0xdcde('0x37')];_0x21b690[_0xdcde('0x5b')]=qs[_0xdcde('0x3f')](_0x1a397d[_0xdcde('0x39')][_0xdcde('0x3f')]);_0x21b690[_0xdcde('0x42')]=qs[_0xdcde('0x3a')](_['pick'](_0x1a397d[_0xdcde('0x39')],_0x3c3965[_0xdcde('0x3a')]));if(_0x1a397d[_0xdcde('0x39')][_0xdcde('0x41')]){_0x21b690[_0xdcde('0x42')]=_[_0xdcde('0x43')](_0x21b690[_0xdcde('0x42')],{'$or':_[_0xdcde('0x32')](_0x21b690[_0xdcde('0x3d')],function(_0xaf3a47){var _0x12be43={};_0x12be43[_0xaf3a47]={'$like':'%'+_0x1a397d['query'][_0xdcde('0x41')]+'%'};return _0x12be43;})});}_0x21b690=_['merge']({},_0x21b690,_0x1a397d[_0xdcde('0x4c')]);return _0x5f4ff9['getAgents'](_0x21b690);}})[_0xdcde('0x29')](function(_0x33ef69){if(_0x33ef69){_0x2aac67=_0x33ef69[_0xdcde('0x4b')];if(!_0x1a397d['query'][_0xdcde('0x3e')]('nolimit')){_0x21b690[_0xdcde('0x21')]=qs['limit'](_0x1a397d[_0xdcde('0x39')]['limit']);_0x21b690[_0xdcde('0x1f')]=qs['offset'](_0x1a397d[_0xdcde('0x39')][_0xdcde('0x1f')]);}return _0x5f4ff9[_0xdcde('0x8e')](_0x21b690);}})['then'](function(_0x3646e2){if(_0x3646e2){return _0x3646e2?{'count':_0x2aac67,'rows':_0x3646e2}:null;}})[_0xdcde('0x29')](respondWithResult(_0x3c8e92,null))[_0xdcde('0x47')](handleError(_0x3c8e92,null));}; \ No newline at end of file +var _0xac38=['getTeams','addTeams','ids','online','voicePause','Agents','sequelize','each','forEach','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','FaxQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','get','FaxQueues','UserProfileResource','error','stack','send','map','FaxQueue','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','findOne','UserFaxQueue','pick','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','Team'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac38,0x135));var _0x8ac3=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xac38[_0x374ccf];return _0x443cde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ac3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ac3('0x1'));var moment=require(_0x8ac3('0x2'));var BPromise=require(_0x8ac3('0x3'));var Mustache=require(_0x8ac3('0x4'));var util=require('util');var path=require(_0x8ac3('0x5'));var sox=require(_0x8ac3('0x6'));var csv=require(_0x8ac3('0x7'));var ejs=require(_0x8ac3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ac3('0x9'));var jsforce=require(_0x8ac3('0xa'));var deskjs=require(_0x8ac3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8ac3('0xc'));var Papa=require(_0x8ac3('0xd'));var Redis=require(_0x8ac3('0xe'));var authService=require(_0x8ac3('0xf'));var qs=require(_0x8ac3('0x10'));var as=require(_0x8ac3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ac3('0x12'))(_0x8ac3('0x13'));var utils=require(_0x8ac3('0x14'));var config=require(_0x8ac3('0x15'));var licenseUtil=require(_0x8ac3('0x16'));var db=require('../../mysqldb')['db'];config[_0x8ac3('0x17')]=_[_0x8ac3('0x18')](config[_0x8ac3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ac3('0x19'))(new Redis(config[_0x8ac3('0x17')]));require(_0x8ac3('0x1a'))['register'](socket);function respondWithStatusCode(_0x34ed5b,_0x1dc77f){_0x1dc77f=_0x1dc77f||0xcc;return function(_0x1fbcac){if(_0x1fbcac){return _0x34ed5b[_0x8ac3('0x1b')](_0x1dc77f);}return _0x34ed5b[_0x8ac3('0x1c')](_0x1dc77f)[_0x8ac3('0x1d')]();};}function respondWithResult(_0x522911,_0x3063c2){_0x3063c2=_0x3063c2||0xc8;return function(_0x4221a5){if(_0x4221a5){return _0x522911[_0x8ac3('0x1c')](_0x3063c2)[_0x8ac3('0x1e')](_0x4221a5);}};}function respondWithFilteredResult(_0x3f0b67,_0x57c4f6){return function(_0x1dcb45){if(_0x1dcb45){var _0x12f501=typeof _0x57c4f6[_0x8ac3('0x1f')]===_0x8ac3('0x20')&&typeof _0x57c4f6['limit']===_0x8ac3('0x20');var _0x30d01e=_0x1dcb45[_0x8ac3('0x21')];var _0x44c4ce=_0x12f501?0x0:_0x57c4f6['offset'];var _0x1474b7=_0x12f501?_0x1dcb45[_0x8ac3('0x21')]:_0x57c4f6['offset']+_0x57c4f6[_0x8ac3('0x22')];var _0x17a733;if(_0x1474b7>=_0x30d01e){_0x1474b7=_0x30d01e;_0x17a733=0xc8;}else{_0x17a733=0xce;}_0x3f0b67[_0x8ac3('0x1c')](_0x17a733);return _0x3f0b67[_0x8ac3('0x23')](_0x8ac3('0x24'),_0x44c4ce+'-'+_0x1474b7+'/'+_0x30d01e)['json'](_0x1dcb45);}return null;};}function patchUpdates(_0x2726c1){return function(_0x146485){try{jsonpatch['apply'](_0x146485,_0x2726c1,!![]);}catch(_0x1d24af){return BPromise['reject'](_0x1d24af);}return _0x146485[_0x8ac3('0x25')]();};}function saveUpdates(_0x434bc6,_0x20541e){return function(_0x51b99b){if(_0x51b99b){return _0x51b99b['update'](_0x434bc6)[_0x8ac3('0x26')](function(_0xdb6fa1){return _0xdb6fa1;});}return null;};}function removeEntity(_0x1dc93a,_0x121b83){return function(_0x30ef15){if(_0x30ef15){return _0x30ef15['destroy']()[_0x8ac3('0x26')](function(){var _0x4e61b6=_0x30ef15[_0x8ac3('0x27')]({'plain':!![]});var _0x2194fe=_0x8ac3('0x28');return db[_0x8ac3('0x29')]['destroy']({'where':{'type':_0x2194fe,'resourceId':_0x4e61b6['id']}})[_0x8ac3('0x26')](function(){return _0x30ef15;});})['then'](function(){_0x1dc93a[_0x8ac3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8a07,_0x4dd187){return function(_0x2e7af1){if(!_0x2e7af1){_0x5d8a07[_0x8ac3('0x1b')](0x194);}return _0x2e7af1;};}function handleError(_0x54db7e,_0x4c779b){_0x4c779b=_0x4c779b||0x1f4;return function(_0x2ef800){logger[_0x8ac3('0x2a')](_0x2ef800[_0x8ac3('0x2b')]);if(_0x2ef800['name']){delete _0x2ef800['name'];}_0x54db7e[_0x8ac3('0x1c')](_0x4c779b)[_0x8ac3('0x2c')](_0x2ef800);};}exports['index']=function(_0x3bde32,_0x4d447d){var _0x458ba3={},_0x249a32={},_0x437979={'count':0x0,'rows':[]};var _0xfcd3d7=_[_0x8ac3('0x2d')](db[_0x8ac3('0x2e')][_0x8ac3('0x2f')],function(_0x222e6e){return{'name':_0x222e6e[_0x8ac3('0x30')],'type':_0x222e6e['type'][_0x8ac3('0x31')]};});_0x249a32[_0x8ac3('0x32')]=_[_0x8ac3('0x2d')](_0xfcd3d7,_0x8ac3('0x33'));_0x249a32[_0x8ac3('0x34')]=_['keys'](_0x3bde32[_0x8ac3('0x34')]);_0x249a32[_0x8ac3('0x35')]=_[_0x8ac3('0x36')](_0x249a32['model'],_0x249a32[_0x8ac3('0x34')]);_0x458ba3[_0x8ac3('0x37')]=_[_0x8ac3('0x36')](_0x249a32[_0x8ac3('0x32')],qs[_0x8ac3('0x38')](_0x3bde32[_0x8ac3('0x34')][_0x8ac3('0x38')]));_0x458ba3[_0x8ac3('0x37')]=_0x458ba3[_0x8ac3('0x37')][_0x8ac3('0x39')]?_0x458ba3['attributes']:_0x249a32[_0x8ac3('0x32')];if(!_0x3bde32[_0x8ac3('0x34')][_0x8ac3('0x3a')](_0x8ac3('0x3b'))){_0x458ba3['limit']=qs[_0x8ac3('0x22')](_0x3bde32['query'][_0x8ac3('0x22')]);_0x458ba3['offset']=qs[_0x8ac3('0x1f')](_0x3bde32[_0x8ac3('0x34')][_0x8ac3('0x1f')]);}_0x458ba3[_0x8ac3('0x3c')]=qs[_0x8ac3('0x3d')](_0x3bde32[_0x8ac3('0x34')][_0x8ac3('0x3d')]);_0x458ba3['where']=qs[_0x8ac3('0x35')](_['pick'](_0x3bde32[_0x8ac3('0x34')],_0x249a32[_0x8ac3('0x35')]),_0xfcd3d7);if(_0x3bde32[_0x8ac3('0x34')][_0x8ac3('0x3e')]){_0x458ba3[_0x8ac3('0x3f')]=_['merge'](_0x458ba3['where'],{'$or':_['map'](_0xfcd3d7,function(_0x3f299c){if(_0x3f299c[_0x8ac3('0x40')]!==_0x8ac3('0x41')){var _0xfa82b4={};_0xfa82b4[_0x3f299c[_0x8ac3('0x33')]]={'$like':'%'+_0x3bde32['query'][_0x8ac3('0x3e')]+'%'};return _0xfa82b4;}})});}_0x458ba3=_[_0x8ac3('0x42')]({},_0x458ba3,_0x3bde32[_0x8ac3('0x43')]);var _0x52ce68={'where':_0x458ba3['where']};return db['FaxQueue'][_0x8ac3('0x21')](_0x52ce68)[_0x8ac3('0x26')](function(_0x330474){_0x437979[_0x8ac3('0x21')]=_0x330474;if(_0x3bde32['query'][_0x8ac3('0x44')]){_0x458ba3[_0x8ac3('0x45')]=[{'all':!![]}];}return db[_0x8ac3('0x2e')]['findAll'](_0x458ba3);})[_0x8ac3('0x26')](function(_0x309b96){_0x437979[_0x8ac3('0x46')]=_0x309b96;return _0x437979;})[_0x8ac3('0x26')](respondWithFilteredResult(_0x4d447d,_0x458ba3))[_0x8ac3('0x47')](handleError(_0x4d447d,null));};exports[_0x8ac3('0x48')]=function(_0x567450,_0x36dea6){var _0x420e6c={'raw':!![],'where':{'id':_0x567450[_0x8ac3('0x49')]['id']}},_0x2769ab={};_0x2769ab[_0x8ac3('0x32')]=_[_0x8ac3('0x4a')](db[_0x8ac3('0x2e')][_0x8ac3('0x2f')]);_0x2769ab[_0x8ac3('0x34')]=_[_0x8ac3('0x4a')](_0x567450[_0x8ac3('0x34')]);_0x2769ab[_0x8ac3('0x35')]=_['intersection'](_0x2769ab[_0x8ac3('0x32')],_0x2769ab[_0x8ac3('0x34')]);_0x420e6c[_0x8ac3('0x37')]=_[_0x8ac3('0x36')](_0x2769ab[_0x8ac3('0x32')],qs[_0x8ac3('0x38')](_0x567450[_0x8ac3('0x34')]['fields']));_0x420e6c[_0x8ac3('0x37')]=_0x420e6c[_0x8ac3('0x37')][_0x8ac3('0x39')]?_0x420e6c[_0x8ac3('0x37')]:_0x2769ab[_0x8ac3('0x32')];if(_0x567450['query']['includeAll']){_0x420e6c[_0x8ac3('0x45')]=[{'all':!![]}];}_0x420e6c=_['merge']({},_0x420e6c,_0x567450['options']);return db[_0x8ac3('0x2e')]['find'](_0x420e6c)[_0x8ac3('0x26')](handleEntityNotFound(_0x36dea6,null))[_0x8ac3('0x26')](respondWithResult(_0x36dea6,null))[_0x8ac3('0x47')](handleError(_0x36dea6,null));};exports['create']=function(_0x12aafe,_0x4663b2){return db[_0x8ac3('0x2e')][_0x8ac3('0x4b')](_0x12aafe[_0x8ac3('0x4c')],{})['then'](function(_0x527286){var _0xcfb9f0=_0x12aafe['user'][_0x8ac3('0x27')]({'plain':!![]});if(!_0xcfb9f0)throw new Error(_0x8ac3('0x4d'));if(_0xcfb9f0['role']===_0x8ac3('0x4e')){var _0x5a6265=_0x527286['get']({'plain':!![]});var _0x5ce43b=_0x8ac3('0x28');return db[_0x8ac3('0x4f')][_0x8ac3('0x50')]({'where':{'name':_0x5ce43b,'userProfileId':_0xcfb9f0['userProfileId']},'raw':!![]})[_0x8ac3('0x26')](function(_0x5ab13b){if(_0x5ab13b&&_0x5ab13b[_0x8ac3('0x51')]===0x0){return db['UserProfileResource'][_0x8ac3('0x4b')]({'name':_0x5a6265[_0x8ac3('0x33')],'resourceId':_0x5a6265['id'],'type':_0x5ab13b[_0x8ac3('0x33')],'sectionId':_0x5ab13b['id']},{})['then'](function(){return _0x527286;});}else{return _0x527286;}})[_0x8ac3('0x47')](function(_0x2d9e4f){logger[_0x8ac3('0x2a')](_0x8ac3('0x52'),_0x2d9e4f);throw _0x2d9e4f;});}return _0x527286;})[_0x8ac3('0x26')](respondWithResult(_0x4663b2,0xc9))[_0x8ac3('0x47')](handleError(_0x4663b2,null));};exports[_0x8ac3('0x53')]=function(_0x3d2c87,_0x359fc8){if(_0x3d2c87[_0x8ac3('0x4c')]['id']){delete _0x3d2c87['body']['id'];}return db[_0x8ac3('0x2e')]['find']({'where':{'id':_0x3d2c87[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](handleEntityNotFound(_0x359fc8,null))[_0x8ac3('0x26')](saveUpdates(_0x3d2c87[_0x8ac3('0x4c')],null))[_0x8ac3('0x26')](respondWithResult(_0x359fc8,null))['catch'](handleError(_0x359fc8,null));};exports[_0x8ac3('0x54')]=function(_0x4723fb,_0x3d0f21){return db[_0x8ac3('0x2e')][_0x8ac3('0x50')]({'where':{'id':_0x4723fb[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](handleEntityNotFound(_0x3d0f21,null))[_0x8ac3('0x26')](removeEntity(_0x3d0f21,null))['catch'](handleError(_0x3d0f21,null));};exports[_0x8ac3('0x55')]=function(_0x192006,_0x5d3937){return db[_0x8ac3('0x2e')][_0x8ac3('0x55')]()[_0x8ac3('0x26')](respondWithResult(_0x5d3937,null))[_0x8ac3('0x47')](handleError(_0x5d3937,null));};exports[_0x8ac3('0x56')]=function(_0x55d3a1,_0x5f2889,_0xba9c7a){var _0x53a3f8={'raw':!![],'where':{}},_0x2d27f3={},_0x12dce6;return db[_0x8ac3('0x2e')][_0x8ac3('0x57')]({'where':{'id':_0x55d3a1[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](handleEntityNotFound(_0x5f2889,null))['then'](function(_0x350493){if(_0x350493){_0x12dce6=_0x350493[_0x8ac3('0x27')]({'plain':!![]});_0x2d27f3[_0x8ac3('0x32')]=_[_0x8ac3('0x4a')](db[_0x8ac3('0x58')][_0x8ac3('0x2f')]);_0x2d27f3[_0x8ac3('0x34')]=_['keys'](_0x55d3a1['query']);_0x2d27f3[_0x8ac3('0x35')]=_[_0x8ac3('0x36')](_0x2d27f3['model'],_0x2d27f3[_0x8ac3('0x34')]);_0x53a3f8[_0x8ac3('0x37')]=_[_0x8ac3('0x36')](_0x2d27f3[_0x8ac3('0x32')],qs[_0x8ac3('0x38')](_0x55d3a1[_0x8ac3('0x34')]['fields']));_0x53a3f8[_0x8ac3('0x37')]=_0x53a3f8[_0x8ac3('0x37')][_0x8ac3('0x39')]?_0x53a3f8[_0x8ac3('0x37')]:_0x2d27f3[_0x8ac3('0x32')];if(!_0x55d3a1[_0x8ac3('0x34')][_0x8ac3('0x3a')](_0x8ac3('0x3b'))){_0x53a3f8[_0x8ac3('0x22')]=qs[_0x8ac3('0x22')](_0x55d3a1['query'][_0x8ac3('0x22')]);_0x53a3f8[_0x8ac3('0x1f')]=qs['offset'](_0x55d3a1[_0x8ac3('0x34')][_0x8ac3('0x1f')]);}_0x53a3f8['order']=qs[_0x8ac3('0x3d')](_0x55d3a1[_0x8ac3('0x34')][_0x8ac3('0x3d')]);_0x53a3f8[_0x8ac3('0x3f')]=qs['filters'](_[_0x8ac3('0x59')](_0x55d3a1[_0x8ac3('0x34')],_0x2d27f3[_0x8ac3('0x35')]));_0x53a3f8['where']['FaxQueueId']=_0x350493['id'];if(_0x55d3a1[_0x8ac3('0x34')][_0x8ac3('0x3e')]){_0x53a3f8['where']=_[_0x8ac3('0x42')](_0x53a3f8[_0x8ac3('0x3f')],{'$or':_['map'](_0x53a3f8[_0x8ac3('0x37')],function(_0xf3e8ec){var _0x400280={};_0x400280[_0xf3e8ec]={'$like':'%'+_0x55d3a1[_0x8ac3('0x34')]['filter']+'%'};return _0x400280;})});}_0x53a3f8=_[_0x8ac3('0x42')]({},_0x53a3f8,_0x55d3a1[_0x8ac3('0x43')]);return db[_0x8ac3('0x58')][_0x8ac3('0x5a')](_0x53a3f8);}})[_0x8ac3('0x26')](function(_0x19c6d9){if(_0x19c6d9){return db[_0x8ac3('0x5b')][_0x8ac3('0x5c')]({'where':{'id':_[_0x8ac3('0x2d')](_0x19c6d9,_0x8ac3('0x5d')),'role':_0x8ac3('0x5e')},'attributes':['id',_0x8ac3('0x33'),'faxPause',_0x8ac3('0x5f'),_0x8ac3('0x60')]});}})['then'](function(_0x426449){if(_0x426449){return{'count':_0x426449[_0x8ac3('0x21')],'rows':_[_0x8ac3('0x2d')](_0x426449[_0x8ac3('0x46')],function(_0x142ed4){return{'membername':_0x142ed4[_0x8ac3('0x33')],'UserId':_0x142ed4['id'],'queue_name':_0x12dce6['name'],'FaxQueueId':_0x12dce6['id'],'interface':util[_0x8ac3('0x61')](_0x8ac3('0x62'),_0x8ac3('0x63'),_0x142ed4[_0x8ac3('0x33')]),'penalty':0x0,'paused':_0x142ed4[_0x8ac3('0x64')],'createdAt':_0x142ed4['createdAt'],'updatedAt':_0x142ed4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5f2889,_0x53a3f8))[_0x8ac3('0x47')](handleError(_0x5f2889,null));};exports['getTeams']=function(_0x435f78,_0x2b663b,_0x144f28){var _0x1b02b5={};var _0x596704={};var _0x210e5b;var _0x286bc7;return db[_0x8ac3('0x2e')]['findOne']({'where':{'id':_0x435f78[_0x8ac3('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b663b,null))[_0x8ac3('0x26')](function(_0x26848c){if(_0x26848c){_0x210e5b=_0x26848c;_0x596704[_0x8ac3('0x32')]=_[_0x8ac3('0x4a')](db[_0x8ac3('0x65')][_0x8ac3('0x2f')]);_0x596704[_0x8ac3('0x34')]=_[_0x8ac3('0x4a')](_0x435f78[_0x8ac3('0x34')]);_0x596704[_0x8ac3('0x35')]=_[_0x8ac3('0x36')](_0x596704[_0x8ac3('0x32')],_0x596704[_0x8ac3('0x34')]);_0x1b02b5[_0x8ac3('0x37')]=_['intersection'](_0x596704[_0x8ac3('0x32')],qs[_0x8ac3('0x38')](_0x435f78[_0x8ac3('0x34')][_0x8ac3('0x38')]));_0x1b02b5[_0x8ac3('0x37')]=_0x1b02b5[_0x8ac3('0x37')]['length']?_0x1b02b5['attributes']:_0x596704[_0x8ac3('0x32')];_0x1b02b5[_0x8ac3('0x3c')]=qs[_0x8ac3('0x3d')](_0x435f78['query'][_0x8ac3('0x3d')]);_0x1b02b5[_0x8ac3('0x3f')]=qs[_0x8ac3('0x35')](_[_0x8ac3('0x59')](_0x435f78[_0x8ac3('0x34')],_0x596704[_0x8ac3('0x35')]));if(_0x435f78['query']['filter']){_0x1b02b5[_0x8ac3('0x3f')]=_[_0x8ac3('0x42')](_0x1b02b5[_0x8ac3('0x3f')],{'$or':_[_0x8ac3('0x2d')](_0x1b02b5[_0x8ac3('0x37')],function(_0x228c20){var _0x16924f={};_0x16924f[_0x228c20]={'$like':'%'+_0x435f78[_0x8ac3('0x34')][_0x8ac3('0x3e')]+'%'};return _0x16924f;})});}_0x1b02b5=_['merge']({},_0x1b02b5,_0x435f78[_0x8ac3('0x43')]);return _0x210e5b[_0x8ac3('0x66')](_0x1b02b5);}})[_0x8ac3('0x26')](function(_0x144ef7){if(_0x144ef7){_0x286bc7=_0x144ef7[_0x8ac3('0x39')];if(!_0x435f78['query']['hasOwnProperty']('nolimit')){_0x1b02b5[_0x8ac3('0x22')]=qs[_0x8ac3('0x22')](_0x435f78[_0x8ac3('0x34')][_0x8ac3('0x22')]);_0x1b02b5['offset']=qs[_0x8ac3('0x1f')](_0x435f78[_0x8ac3('0x34')][_0x8ac3('0x1f')]);}return _0x210e5b[_0x8ac3('0x66')](_0x1b02b5);}})[_0x8ac3('0x26')](function(_0x5396ac){if(_0x5396ac){return _0x5396ac?{'count':_0x286bc7,'rows':_0x5396ac}:null;}})[_0x8ac3('0x26')](respondWithResult(_0x2b663b,null))['catch'](handleError(_0x2b663b,null));};exports[_0x8ac3('0x67')]=function(_0x399019,_0x44f163,_0x559ae9){var _0x156a0f=_0x399019[_0x8ac3('0x4c')][_0x8ac3('0x68')];return db[_0x8ac3('0x65')][_0x8ac3('0x5a')]({'where':{'id':_0x156a0f},'attributes':['id'],'include':[{'model':db[_0x8ac3('0x5b')],'as':'Agents','attributes':['id','name',_0x8ac3('0x69'),_0x8ac3('0x6a'),'interface'],'raw':!![]}]})[_0x8ac3('0x26')](function(_0x31c3d8){if(_0x31c3d8){var _0x37c724=_['flatMap'](_0x31c3d8,function(_0x5add5f){var _0x1cf488=_0x5add5f[_0x8ac3('0x27')]({'plain':!![]});return _0x1cf488[_0x8ac3('0x6b')];});return db[_0x8ac3('0x2e')]['find']({'where':{'id':_0x399019[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](function(_0x3bd319){return db[_0x8ac3('0x6c')]['transaction'](function(_0x503c5a){return _0x3bd319[_0x8ac3('0x67')](_0x156a0f,{'transaction':_0x503c5a})['then'](function(){return BPromise[_0x8ac3('0x6d')](_0x37c724,function(_0x1cf7bc){return db[_0x8ac3('0x58')]['findOrCreate']({'where':{'UserId':_0x1cf7bc['id'],'FaxQueueId':_0x399019[_0x8ac3('0x49')]['id']},'transaction':_0x503c5a});});})[_0x8ac3('0x26')](function(){_0x37c724[_0x8ac3('0x6e')](function(_0x3d5914){socket['emit'](_0x8ac3('0x6f'),{'UserId':_0x3d5914['id'],'FaxQueueId':_0x3bd319['id']});});});});});}})[_0x8ac3('0x26')](respondWithStatusCode(_0x44f163,null))[_0x8ac3('0x47')](handleError(_0x44f163,null));};exports[_0x8ac3('0x70')]=function(_0x96b186,_0x14f47e,_0x588de0){return db[_0x8ac3('0x65')][_0x8ac3('0x5a')]({'where':{'id':_0x96b186[_0x8ac3('0x34')][_0x8ac3('0x68')]},'attributes':['id'],'include':[{'model':db[_0x8ac3('0x5b')],'as':_0x8ac3('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x8ac3('0x26')](handleEntityNotFound(_0x14f47e,null))[_0x8ac3('0x26')](function(_0x7b5d35){var _0x24f258=_[_0x8ac3('0x2d')](_0x7b5d35,'id');var _0x3529c9=[];var _0x165de5=[];var _0x5020d0=squel['select']();_0x5020d0[_0x8ac3('0x71')](_0x8ac3('0x72'))[_0x8ac3('0x73')](_0x8ac3('0x74'),'tq')['join'](_0x8ac3('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8ac3('0x3f')](_0x8ac3('0x76'),_0x96b186[_0x8ac3('0x49')]['id']);for(var _0x2b9ad4=0x0;_0x2b9ad4<_0x7b5d35[_0x8ac3('0x39')];_0x2b9ad4+=0x1){let _0x47e536=_0x7b5d35[_0x2b9ad4];for(var _0xc1988b=0x0;_0xc1988b<_0x47e536['Agents'][_0x8ac3('0x39')];_0xc1988b+=0x1){let _0x23d53f=_0x47e536[_0x8ac3('0x6b')][_0xc1988b];var _0x100e17=_0x5020d0['clone']();_0x100e17[_0x8ac3('0x3f')]('ut.UserId\x20=\x20?',_0x23d53f['id']);_0x165de5[_0x8ac3('0x77')](db[_0x8ac3('0x6c')][_0x8ac3('0x34')](_0x100e17[_0x8ac3('0x78')](),{'type':db['sequelize']['QueryTypes'][_0x8ac3('0x79')]})[_0x8ac3('0x26')](function(_0x8786a2){if(_0x8786a2['length']===0x1){return _0x23d53f['id'];}else{var _0x4287a2=_[_0x8ac3('0x7a')](_[_0x8ac3('0x2d')](_0x8786a2,_0x8ac3('0x7b')),function(_0x2ca4ab){return _[_0x8ac3('0x7c')](_0x24f258,_0x2ca4ab);});if(_0x4287a2){return _0x23d53f['id'];}}}));}}return BPromise['all'](_0x165de5)['then'](function(_0x411e59){_0x3529c9=_(_0x3529c9)[_0x8ac3('0x7d')](_0x411e59)[_0x8ac3('0x7e')]()[_0x8ac3('0x7f')]();return db[_0x8ac3('0x2e')][_0x8ac3('0x50')]({'where':{'id':_0x96b186[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](function(_0x3ee2a7){return db[_0x8ac3('0x6c')][_0x8ac3('0x80')](function(_0xc412ab){return _0x3ee2a7[_0x8ac3('0x70')](_0x96b186[_0x8ac3('0x34')][_0x8ac3('0x68')],{'transaction':_0xc412ab})[_0x8ac3('0x26')](function(){if(!_[_0x8ac3('0x81')](_0x3529c9)){return _0x3ee2a7[_0x8ac3('0x82')](_0x3529c9,{'transaction':_0xc412ab});}})[_0x8ac3('0x26')](function(){_0x3529c9['forEach'](function(_0x48f116){socket[_0x8ac3('0x83')](_0x8ac3('0x84'),{'UserId':_0x48f116,'FaxQueueId':_0x3ee2a7['id']});});});});});});})[_0x8ac3('0x26')](respondWithStatusCode(_0x14f47e,null))[_0x8ac3('0x47')](handleError(_0x14f47e,null));};exports['addAgents']=function(_0x3a5272,_0x5241ae,_0x393173){return db[_0x8ac3('0x2e')][_0x8ac3('0x50')]({'where':{'id':_0x3a5272[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](handleEntityNotFound(_0x5241ae,null))['then'](function(_0x2bb928){if(_0x2bb928){return _0x2bb928[_0x8ac3('0x85')](_0x3a5272['body'][_0x8ac3('0x68')],_['omit'](_0x3a5272[_0x8ac3('0x4c')],[_0x8ac3('0x68'),'id'])||{})[_0x8ac3('0x86')](function(_0xa5370){for(var _0x52c6d7=0x0;_0x52c6d7<_0x3a5272[_0x8ac3('0x4c')][_0x8ac3('0x68')]['length'];_0x52c6d7+=0x1){socket[_0x8ac3('0x83')](_0x8ac3('0x6f'),{'UserId':Number(_0x3a5272['body']['ids'][_0x52c6d7]),'FaxQueueId':Number(_0x3a5272[_0x8ac3('0x49')]['id'])});}return _0xa5370;});}})[_0x8ac3('0x26')](respondWithResult(_0x5241ae,null))[_0x8ac3('0x47')](handleError(_0x5241ae,null));};exports[_0x8ac3('0x82')]=function(_0x501439,_0x23c6fb,_0x45f6fe){return db[_0x8ac3('0x2e')][_0x8ac3('0x50')]({'where':{'id':_0x501439['params']['id']}})[_0x8ac3('0x26')](handleEntityNotFound(_0x23c6fb,null))[_0x8ac3('0x26')](function(_0x43e995){if(_0x43e995){return _0x43e995[_0x8ac3('0x82')](_0x501439[_0x8ac3('0x34')][_0x8ac3('0x68')])[_0x8ac3('0x26')](function(){if(_[_0x8ac3('0x87')](_0x501439[_0x8ac3('0x34')][_0x8ac3('0x68')])){for(var _0x2a9b08=0x0;_0x2a9b08<_0x501439[_0x8ac3('0x34')][_0x8ac3('0x68')][_0x8ac3('0x39')];_0x2a9b08+=0x1){socket[_0x8ac3('0x83')](_0x8ac3('0x84'),{'UserId':Number(_0x501439[_0x8ac3('0x34')][_0x8ac3('0x68')][_0x2a9b08]),'FaxQueueId':Number(_0x501439[_0x8ac3('0x49')]['id'])});}}else{socket[_0x8ac3('0x83')](_0x8ac3('0x84'),{'UserId':Number(_0x501439['query'][_0x8ac3('0x68')]),'FaxQueueId':Number(_0x501439['params']['id'])});}});}})[_0x8ac3('0x26')](respondWithStatusCode(_0x23c6fb,null))[_0x8ac3('0x47')](handleError(_0x23c6fb,null));};exports['getAgents']=function(_0x2c46c9,_0x191238,_0x1b71ad){var _0x5814e5={};var _0x4b2beb={};var _0x588def;var _0x2e7db7;return db[_0x8ac3('0x2e')][_0x8ac3('0x57')]({'where':{'id':_0x2c46c9[_0x8ac3('0x49')]['id']}})[_0x8ac3('0x26')](handleEntityNotFound(_0x191238,null))[_0x8ac3('0x26')](function(_0x494f19){if(_0x494f19){_0x588def=_0x494f19;_0x4b2beb[_0x8ac3('0x32')]=_[_0x8ac3('0x4a')](db[_0x8ac3('0x5b')][_0x8ac3('0x2f')]);_0x4b2beb[_0x8ac3('0x34')]=_[_0x8ac3('0x4a')](_0x2c46c9[_0x8ac3('0x34')]);_0x4b2beb[_0x8ac3('0x35')]=_[_0x8ac3('0x36')](_0x4b2beb['model'],_0x4b2beb[_0x8ac3('0x34')]);_0x5814e5[_0x8ac3('0x37')]=_[_0x8ac3('0x36')](_0x4b2beb['model'],qs[_0x8ac3('0x38')](_0x2c46c9['query']['fields']));_0x5814e5[_0x8ac3('0x37')]=_0x5814e5[_0x8ac3('0x37')][_0x8ac3('0x39')]?_0x5814e5['attributes']:_0x4b2beb[_0x8ac3('0x32')];_0x5814e5[_0x8ac3('0x3c')]=qs[_0x8ac3('0x3d')](_0x2c46c9[_0x8ac3('0x34')][_0x8ac3('0x3d')]);_0x5814e5[_0x8ac3('0x3f')]=qs[_0x8ac3('0x35')](_['pick'](_0x2c46c9[_0x8ac3('0x34')],_0x4b2beb['filters']));if(_0x2c46c9['query'][_0x8ac3('0x3e')]){_0x5814e5[_0x8ac3('0x3f')]=_[_0x8ac3('0x42')](_0x5814e5[_0x8ac3('0x3f')],{'$or':_['map'](_0x5814e5[_0x8ac3('0x37')],function(_0x2b7944){var _0x2b86f9={};_0x2b86f9[_0x2b7944]={'$like':'%'+_0x2c46c9[_0x8ac3('0x34')]['filter']+'%'};return _0x2b86f9;})});}_0x5814e5=_[_0x8ac3('0x42')]({},_0x5814e5,_0x2c46c9['options']);return _0x588def['getAgents'](_0x5814e5);}})[_0x8ac3('0x26')](function(_0x415f11){if(_0x415f11){_0x2e7db7=_0x415f11[_0x8ac3('0x39')];if(!_0x2c46c9['query'][_0x8ac3('0x3a')](_0x8ac3('0x3b'))){_0x5814e5[_0x8ac3('0x22')]=qs[_0x8ac3('0x22')](_0x2c46c9[_0x8ac3('0x34')][_0x8ac3('0x22')]);_0x5814e5['offset']=qs[_0x8ac3('0x1f')](_0x2c46c9[_0x8ac3('0x34')][_0x8ac3('0x1f')]);}return _0x588def[_0x8ac3('0x88')](_0x5814e5);}})['then'](function(_0x315af){if(_0x315af){return _0x315af?{'count':_0x2e7db7,'rows':_0x315af}:null;}})[_0x8ac3('0x26')](respondWithResult(_0x191238,null))['catch'](handleError(_0x191238,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d592bad..0b1157b 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 _0x6461=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x6461,0x1d1));var _0x1646=function(_0x9938d2,_0x461cdb){_0x9938d2=_0x9938d2-0x0;var _0x1a5804=_0x6461[_0x9938d2];return _0x1a5804;};'use strict';var EventEmitter=require(_0x1646('0x0'));var FaxQueue=require(_0x1646('0x1'))['db'][_0x1646('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1646('0x3')](0x0);var events={'afterCreate':_0x1646('0x4'),'afterUpdate':_0x1646('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45580e){return function(_0x4248be,_0x380ef5,_0x1fc8c6){FaxQueueEvents[_0x1646('0x6')](_0x45580e+':'+_0x4248be['id'],_0x4248be);FaxQueueEvents[_0x1646('0x6')](_0x45580e,_0x4248be);_0x1fc8c6(null);};}for(var e in events){if(events[_0x1646('0x7')](e)){var event=events[e];FaxQueue[_0x1646('0x8')](e,emitEvent(event));}}module[_0x1646('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x5659=['hook','events','../../mysqldb','FaxQueue','save','remove','emit','hasOwnProperty'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5659,0x141));var _0x9565=function(_0x1344cc,_0x19667f){_0x1344cc=_0x1344cc-0x0;var _0x4b7296=_0x5659[_0x1344cc];return _0x4b7296;};'use strict';var EventEmitter=require(_0x9565('0x0'));var FaxQueue=require(_0x9565('0x1'))['db'][_0x9565('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9565('0x3'),'afterUpdate':'update','afterDestroy':_0x9565('0x4')};function emitEvent(_0x2f62a1){return function(_0x5bb9f2,_0x1f68cb,_0x4898dd){FaxQueueEvents['emit'](_0x2f62a1+':'+_0x5bb9f2['id'],_0x5bb9f2);FaxQueueEvents[_0x9565('0x5')](_0x2f62a1,_0x5bb9f2);_0x4898dd(null);};}for(var e in events){if(events[_0x9565('0x6')](e)){var event=events[e];FaxQueue[_0x9565('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 0a20a2a..53b4a12 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 _0xa754=['path','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4989fe,_0x201e34){var _0x4afd24=function(_0x3bb870){while(--_0x3bb870){_0x4989fe['push'](_0x4989fe['shift']());}};_0x4afd24(++_0x201e34);}(_0xa754,0x192));var _0x4a75=function(_0x31eae6,_0x112161){_0x31eae6=_0x31eae6-0x0;var _0x192fa7=_0xa754[_0x31eae6];return _0x192fa7;};'use strict';var _=require('lodash');var util=require(_0x4a75('0x0'));var logger=require(_0x4a75('0x1'))(_0x4a75('0x2'));var moment=require(_0x4a75('0x3'));var BPromise=require(_0x4a75('0x4'));var rp=require(_0x4a75('0x5'));var fs=require('fs');var path=require(_0x4a75('0x6'));var rimraf=require('rimraf');var config=require(_0x4a75('0x7'));var attributes=require(_0x4a75('0x8'));module[_0x4a75('0x9')]=function(_0x16acda,_0x1cb64b){return _0x16acda['define'](_0x4a75('0xa'),attributes,{'tableName':_0x4a75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45eb=['api','moment','bluebird','request-promise','../../config/environment','./faxQueue.attributes','exports','define','lodash','util'];(function(_0x1927c4,_0x3d6592){var _0xe23d65=function(_0x2372ab){while(--_0x2372ab){_0x1927c4['push'](_0x1927c4['shift']());}};_0xe23d65(++_0x3d6592);}(_0x45eb,0x1f2));var _0xb45e=function(_0x1904d8,_0x2cef18){_0x1904d8=_0x1904d8-0x0;var _0xb58a6f=_0x45eb[_0x1904d8];return _0xb58a6f;};'use strict';var _=require(_0xb45e('0x0'));var util=require(_0xb45e('0x1'));var logger=require('../../config/logger')(_0xb45e('0x2'));var moment=require(_0xb45e('0x3'));var BPromise=require(_0xb45e('0x4'));var rp=require(_0xb45e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb45e('0x6'));var attributes=require(_0xb45e('0x7'));module[_0xb45e('0x8')]=function(_0x2f9abf,_0x59bc84){return _0x2f9abf[_0xb45e('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index b67a2ec..ea7cf41 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 _0x9af3=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','GetFaxQueue','debug','ShowFaxQueue','find','where','lodash'];(function(_0x57ae2d,_0x405530){var _0x3e5200=function(_0x4883e0){while(--_0x4883e0){_0x57ae2d['push'](_0x57ae2d['shift']());}};_0x3e5200(++_0x405530);}(_0x9af3,0x14f));var _0x39af=function(_0x4e9f60,_0xee66e5){_0x4e9f60=_0x4e9f60-0x0;var _0x444aa3=_0x9af3[_0x4e9f60];return _0x444aa3;};'use strict';var _=require(_0x39af('0x0'));var util=require(_0x39af('0x1'));var moment=require('moment');var BPromise=require(_0x39af('0x2'));var rs=require(_0x39af('0x3'));var fs=require('fs');var Redis=require(_0x39af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39af('0x5'));var logger=require('../../config/logger')(_0x39af('0x6'));var config=require(_0x39af('0x7'));var jayson=require(_0x39af('0x8'));var client=jayson[_0x39af('0x9')][_0x39af('0xa')]({'port':0x232a});config[_0x39af('0xb')]=_[_0x39af('0xc')](config['redis'],{'host':_0x39af('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39af('0xb')]));require(_0x39af('0xe'))[_0x39af('0xf')](socket);function respondWithRpcPromise(_0x306261,_0xbbf7ff,_0x30db55){return new BPromise(function(_0x3b092f,_0x4c5c0a){return client[_0x39af('0x10')](_0x306261,_0x30db55)[_0x39af('0x11')](function(_0x276f54){logger[_0x39af('0x12')](_0x39af('0x13'),_0xbbf7ff,'request\x20sent');logger['debug'](_0x39af('0x14'),_0xbbf7ff,'request\x20sent',JSON[_0x39af('0x15')](_0x276f54));if(_0x276f54['error']){if(_0x276f54[_0x39af('0x16')][_0x39af('0x17')]===0x1f4){logger[_0x39af('0x16')]('FaxQueue,\x20%s,\x20%s',_0xbbf7ff,_0x276f54[_0x39af('0x16')]['message']);return _0x4c5c0a(_0x276f54[_0x39af('0x16')][_0x39af('0x18')]);}logger[_0x39af('0x16')](_0x39af('0x13'),_0xbbf7ff,_0x276f54['error'][_0x39af('0x18')]);return _0x3b092f(_0x276f54[_0x39af('0x16')][_0x39af('0x18')]);}else{logger['info'](_0x39af('0x13'),_0xbbf7ff,_0x39af('0x19'));_0x3b092f(_0x276f54[_0x39af('0x1a')][_0x39af('0x18')]);}})[_0x39af('0x1b')](function(_0x117894){logger['error'](_0x39af('0x13'),_0xbbf7ff,_0x117894);_0x4c5c0a(_0x117894);});});}exports['GetFaxQueue']=function(_0x138513){var _0x5f42a4=this;return new Promise(function(_0x10dd75,_0xd645){return db[_0x39af('0x1c')][_0x39af('0x1d')]({'raw':_0x138513[_0x39af('0x1e')]?_0x138513[_0x39af('0x1e')][_0x39af('0x1f')]===undefined?!![]:![]:!![],'where':_0x138513[_0x39af('0x1e')]?_0x138513[_0x39af('0x1e')]['where']||null:null,'attributes':_0x138513[_0x39af('0x1e')]?_0x138513['options'][_0x39af('0x20')]||null:null,'limit':_0x138513['options']?_0x138513['options'][_0x39af('0x21')]||null:null,'include':_0x138513[_0x39af('0x1e')]?_0x138513[_0x39af('0x1e')][_0x39af('0x22')]?_[_0x39af('0x23')](_0x138513[_0x39af('0x1e')][_0x39af('0x22')],function(_0x2dbd86){return{'model':db[_0x2dbd86[_0x39af('0x24')]],'as':_0x2dbd86['as'],'attributes':_0x2dbd86[_0x39af('0x20')],'include':_0x2dbd86[_0x39af('0x22')]?_['map'](_0x2dbd86['include'],function(_0x5b68d9){return{'model':db[_0x5b68d9[_0x39af('0x24')]],'as':_0x5b68d9['as'],'attributes':_0x5b68d9[_0x39af('0x20')],'include':_0x5b68d9[_0x39af('0x22')]?_['map'](_0x5b68d9[_0x39af('0x22')],function(_0x32603d){return{'model':db[_0x32603d[_0x39af('0x24')]],'as':_0x32603d['as'],'attributes':_0x32603d[_0x39af('0x20')]};}):[]};}):[]};}):[]:[]})[_0x39af('0x11')](function(_0xd97ff8){logger[_0x39af('0x12')](_0x39af('0x25'),_0x138513);logger[_0x39af('0x26')]('GetFaxQueue',_0x138513,JSON['stringify'](_0xd97ff8));_0x10dd75(_0xd97ff8);})[_0x39af('0x1b')](function(_0x562ab2){logger['error'](_0x39af('0x25'),_0x562ab2[_0x39af('0x18')],_0x138513);_0xd645(_0x5f42a4[_0x39af('0x16')](0x1f4,_0x562ab2['message']));});});};exports[_0x39af('0x27')]=function(_0x5b0a84){var _0x234cd5=this;return new Promise(function(_0x1079dc,_0x3b890c){return db['FaxQueue'][_0x39af('0x28')]({'raw':_0x5b0a84['options']?_0x5b0a84[_0x39af('0x1e')][_0x39af('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b0a84[_0x39af('0x1e')]?_0x5b0a84[_0x39af('0x1e')][_0x39af('0x29')]||null:null,'attributes':_0x5b0a84['options']?_0x5b0a84['options'][_0x39af('0x20')]||null:null,'include':_0x5b0a84[_0x39af('0x1e')]?_0x5b0a84['options'][_0x39af('0x22')]?_[_0x39af('0x23')](_0x5b0a84[_0x39af('0x1e')][_0x39af('0x22')],function(_0x37d858){return{'model':db[_0x37d858[_0x39af('0x24')]],'as':_0x37d858['as'],'attributes':_0x37d858[_0x39af('0x20')],'include':_0x37d858[_0x39af('0x22')]?_[_0x39af('0x23')](_0x37d858[_0x39af('0x22')],function(_0x3548d9){return{'model':db[_0x3548d9[_0x39af('0x24')]],'as':_0x3548d9['as'],'attributes':_0x3548d9[_0x39af('0x20')],'include':_0x3548d9[_0x39af('0x22')]?_[_0x39af('0x23')](_0x3548d9[_0x39af('0x22')],function(_0x59e640){return{'model':db[_0x59e640['model']],'as':_0x59e640['as'],'attributes':_0x59e640[_0x39af('0x20')]};}):[]};}):[]};}):[]:[]})[_0x39af('0x11')](function(_0x44f6a7){logger[_0x39af('0x12')](_0x39af('0x27'),_0x5b0a84);logger['debug'](_0x39af('0x27'),_0x5b0a84,JSON[_0x39af('0x15')](_0x44f6a7));_0x1079dc(_0x44f6a7);})[_0x39af('0x1b')](function(_0xbd9a07){logger[_0x39af('0x16')]('ShowFaxQueue',_0xbd9a07[_0x39af('0x18')],_0x5b0a84);_0x3b890c(_0x234cd5[_0x39af('0x16')](0x1f4,_0xbd9a07[_0x39af('0x18')]));});});}; \ No newline at end of file +var _0xb68c=['register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','attributes','limit','map','include','model','debug','ShowFaxQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0xb68c,0xf2));var _0xcb68=function(_0x2b935,_0x43733e){_0x2b935=_0x2b935-0x0;var _0x5a9aec=_0xb68c[_0x2b935];return _0x5a9aec;};'use strict';var _=require(_0xcb68('0x0'));var util=require(_0xcb68('0x1'));var moment=require(_0xcb68('0x2'));var BPromise=require(_0xcb68('0x3'));var rs=require(_0xcb68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb68('0x5'))['db'];var utils=require(_0xcb68('0x6'));var logger=require('../../config/logger')(_0xcb68('0x7'));var config=require(_0xcb68('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb68('0x9')][_0xcb68('0xa')]({'port':0x232a});config[_0xcb68('0xb')]=_[_0xcb68('0xc')](config['redis'],{'host':_0xcb68('0xd'),'port':0x18eb});var socket=require(_0xcb68('0xe'))(new Redis(config['redis']));require(_0xcb68('0xf'))[_0xcb68('0x10')](socket);function respondWithRpcPromise(_0x6a1fbf,_0x3442b2,_0x2c589c){return new BPromise(function(_0x4afd79,_0x1134bd){return client[_0xcb68('0x11')](_0x6a1fbf,_0x2c589c)[_0xcb68('0x12')](function(_0x50db10){logger[_0xcb68('0x13')](_0xcb68('0x14'),_0x3442b2,_0xcb68('0x15'));logger['debug'](_0xcb68('0x16'),_0x3442b2,_0xcb68('0x15'),JSON[_0xcb68('0x17')](_0x50db10));if(_0x50db10[_0xcb68('0x18')]){if(_0x50db10[_0xcb68('0x18')][_0xcb68('0x19')]===0x1f4){logger[_0xcb68('0x18')](_0xcb68('0x14'),_0x3442b2,_0x50db10[_0xcb68('0x18')][_0xcb68('0x1a')]);return _0x1134bd(_0x50db10[_0xcb68('0x18')][_0xcb68('0x1a')]);}logger[_0xcb68('0x18')](_0xcb68('0x14'),_0x3442b2,_0x50db10['error'][_0xcb68('0x1a')]);return _0x4afd79(_0x50db10[_0xcb68('0x18')][_0xcb68('0x1a')]);}else{logger['info'](_0xcb68('0x14'),_0x3442b2,'request\x20sent');_0x4afd79(_0x50db10[_0xcb68('0x1b')][_0xcb68('0x1a')]);}})[_0xcb68('0x1c')](function(_0x5f1ba3){logger['error'](_0xcb68('0x14'),_0x3442b2,_0x5f1ba3);_0x1134bd(_0x5f1ba3);});});}exports[_0xcb68('0x1d')]=function(_0x23e5ee){var _0x3ec4f0=this;return new Promise(function(_0x3fa4ed,_0x3c871a){return db[_0xcb68('0x1e')][_0xcb68('0x1f')]({'raw':_0x23e5ee[_0xcb68('0x20')]?_0x23e5ee[_0xcb68('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x23e5ee['options']?_0x23e5ee['options']['where']||null:null,'attributes':_0x23e5ee[_0xcb68('0x20')]?_0x23e5ee['options'][_0xcb68('0x21')]||null:null,'limit':_0x23e5ee[_0xcb68('0x20')]?_0x23e5ee[_0xcb68('0x20')][_0xcb68('0x22')]||null:null,'include':_0x23e5ee['options']?_0x23e5ee['options']['include']?_[_0xcb68('0x23')](_0x23e5ee[_0xcb68('0x20')][_0xcb68('0x24')],function(_0x54f43d){return{'model':db[_0x54f43d['model']],'as':_0x54f43d['as'],'attributes':_0x54f43d[_0xcb68('0x21')],'include':_0x54f43d['include']?_[_0xcb68('0x23')](_0x54f43d[_0xcb68('0x24')],function(_0x474107){return{'model':db[_0x474107[_0xcb68('0x25')]],'as':_0x474107['as'],'attributes':_0x474107['attributes'],'include':_0x474107[_0xcb68('0x24')]?_[_0xcb68('0x23')](_0x474107[_0xcb68('0x24')],function(_0xf4ed87){return{'model':db[_0xf4ed87[_0xcb68('0x25')]],'as':_0xf4ed87['as'],'attributes':_0xf4ed87['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x583033){logger[_0xcb68('0x13')](_0xcb68('0x1d'),_0x23e5ee);logger[_0xcb68('0x26')](_0xcb68('0x1d'),_0x23e5ee,JSON[_0xcb68('0x17')](_0x583033));_0x3fa4ed(_0x583033);})[_0xcb68('0x1c')](function(_0x56fb3c){logger[_0xcb68('0x18')](_0xcb68('0x1d'),_0x56fb3c[_0xcb68('0x1a')],_0x23e5ee);_0x3c871a(_0x3ec4f0[_0xcb68('0x18')](0x1f4,_0x56fb3c[_0xcb68('0x1a')]));});});};exports[_0xcb68('0x27')]=function(_0x5b0892){var _0x31f326=this;return new Promise(function(_0x47df4b,_0x110ef8){return db['FaxQueue'][_0xcb68('0x28')]({'raw':_0x5b0892[_0xcb68('0x20')]?_0x5b0892[_0xcb68('0x20')][_0xcb68('0x29')]===undefined?!![]:![]:!![],'where':_0x5b0892[_0xcb68('0x20')]?_0x5b0892[_0xcb68('0x20')][_0xcb68('0x2a')]||null:null,'attributes':_0x5b0892['options']?_0x5b0892[_0xcb68('0x20')]['attributes']||null:null,'include':_0x5b0892[_0xcb68('0x20')]?_0x5b0892[_0xcb68('0x20')][_0xcb68('0x24')]?_['map'](_0x5b0892[_0xcb68('0x20')]['include'],function(_0x2df1bd){return{'model':db[_0x2df1bd['model']],'as':_0x2df1bd['as'],'attributes':_0x2df1bd[_0xcb68('0x21')],'include':_0x2df1bd[_0xcb68('0x24')]?_['map'](_0x2df1bd[_0xcb68('0x24')],function(_0x1f38a1){return{'model':db[_0x1f38a1[_0xcb68('0x25')]],'as':_0x1f38a1['as'],'attributes':_0x1f38a1['attributes'],'include':_0x1f38a1[_0xcb68('0x24')]?_[_0xcb68('0x23')](_0x1f38a1[_0xcb68('0x24')],function(_0x1fdfa5){return{'model':db[_0x1fdfa5[_0xcb68('0x25')]],'as':_0x1fdfa5['as'],'attributes':_0x1fdfa5[_0xcb68('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcb68('0x12')](function(_0xa5eca7){logger['info'](_0xcb68('0x27'),_0x5b0892);logger['debug'](_0xcb68('0x27'),_0x5b0892,JSON[_0xcb68('0x17')](_0xa5eca7));_0x47df4b(_0xa5eca7);})[_0xcb68('0x1c')](function(_0x18e413){logger[_0xcb68('0x18')](_0xcb68('0x27'),_0x18e413['message'],_0x5b0892);_0x110ef8(_0x31f326[_0xcb68('0x18')](0x1f4,_0x18e413[_0xcb68('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0b1435b..0061a4e 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 _0x3e38=['./faxQueue.events','save','update','emit','removeListener','register','length','faxQueue:'];(function(_0x108831,_0x5e4f70){var _0x4da77a=function(_0x139446){while(--_0x139446){_0x108831['push'](_0x108831['shift']());}};_0x4da77a(++_0x5e4f70);}(_0x3e38,0x68));var _0x83e3=function(_0x4f4d0e,_0x2b5535){_0x4f4d0e=_0x4f4d0e-0x0;var _0x1a8dd0=_0x3e38[_0x4f4d0e];return _0x1a8dd0;};'use strict';var FaxQueueEvents=require(_0x83e3('0x0'));var events=[_0x83e3('0x1'),'remove',_0x83e3('0x2')];function createListener(_0x4670a4,_0x35d0ee){return function(_0x47ece9){_0x35d0ee[_0x83e3('0x3')](_0x4670a4,_0x47ece9);};}function removeListener(_0x4cd376,_0x2fe3e8){return function(){FaxQueueEvents[_0x83e3('0x4')](_0x4cd376,_0x2fe3e8);};}exports[_0x83e3('0x5')]=function(_0x5cadbb){for(var _0x1a5030=0x0,_0x2f8480=events[_0x83e3('0x6')];_0x1a5030<_0x2f8480;_0x1a5030++){var _0x59a194=events[_0x1a5030];var _0x121de5=createListener(_0x83e3('0x7')+_0x59a194,_0x5cadbb);FaxQueueEvents['on'](_0x59a194,_0x121de5);}}; \ No newline at end of file +var _0x6408=['remove','update','emit','register','length','./faxQueue.events','save'];(function(_0x5ed928,_0x2dbbdc){var _0x2effcc=function(_0x19ba45){while(--_0x19ba45){_0x5ed928['push'](_0x5ed928['shift']());}};_0x2effcc(++_0x2dbbdc);}(_0x6408,0x194));var _0x8640=function(_0x53572e,_0x4e0297){_0x53572e=_0x53572e-0x0;var _0x54cb36=_0x6408[_0x53572e];return _0x54cb36;};'use strict';var FaxQueueEvents=require(_0x8640('0x0'));var events=[_0x8640('0x1'),_0x8640('0x2'),_0x8640('0x3')];function createListener(_0x93e7cd,_0x12f8f1){return function(_0x225114){_0x12f8f1[_0x8640('0x4')](_0x93e7cd,_0x225114);};}function removeListener(_0x1b8bfe,_0x270724){return function(){FaxQueueEvents['removeListener'](_0x1b8bfe,_0x270724);};}exports[_0x8640('0x5')]=function(_0xfa32a8){for(var _0x4c8799=0x0,_0x1b9083=events[_0x8640('0x6')];_0x4c8799<_0x1b9083;_0x4c8799++){var _0x52c497=events[_0x4c8799];var _0x40b941=createListener('faxQueue:'+_0x52c497,_0xfa32a8);FaxQueueEvents['on'](_0x52c497,_0x40b941);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 1fbdce7..6d2a29d 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 _0xb016=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service'];(function(_0x5b0f5a,_0x229787){var _0x4c0a72=function(_0x1d6815){while(--_0x1d6815){_0x5b0f5a['push'](_0x5b0f5a['shift']());}};_0x4c0a72(++_0x229787);}(_0xb016,0x159));var _0x6b01=function(_0x24b81d,_0x3bfe61){_0x24b81d=_0x24b81d-0x0;var _0x20d9be=_0xb016[_0x24b81d];return _0x20d9be;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./faxQueue.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/describe',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0x7')](_0x6b01('0xc'),auth[_0x6b01('0x8')](),controller['getMembers']);router['get'](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router['get'](_0x6b01('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6b01('0x10')]('/',auth['isAuthenticated'](),controller[_0x6b01('0x11')]);router[_0x6b01('0x10')]('/:id/teams',auth[_0x6b01('0x8')](),controller['addTeams']);router['post']('/:id/users',auth[_0x6b01('0x8')](),controller['addAgents']);router['put'](_0x6b01('0x12'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x13')]);router[_0x6b01('0x14')](_0x6b01('0x12'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x15')]);router[_0x6b01('0x14')](_0x6b01('0xd'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x16')]);router['delete'](_0x6b01('0xf'),auth[_0x6b01('0x8')](),controller[_0x6b01('0x17')]);module[_0x6b01('0x18')]=router; \ No newline at end of file +var _0x6c45=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout'];(function(_0x4d7d9f,_0x48d5bc){var _0x225e7a=function(_0x6d066){while(--_0x6d066){_0x4d7d9f['push'](_0x4d7d9f['shift']());}};_0x225e7a(++_0x48d5bc);}(_0x6c45,0xb1));var _0x56c4=function(_0x1c7b34,_0x370e4c){_0x1c7b34=_0x1c7b34-0x0;var _0x5b2960=_0x6c45[_0x1c7b34];return _0x5b2960;};'use strict';var multer=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var path=require('path');var timeout=require(_0x56c4('0x2'));var express=require(_0x56c4('0x3'));var router=express[_0x56c4('0x4')]();var fs_extra=require(_0x56c4('0x5'));var auth=require(_0x56c4('0x6'));var interaction=require(_0x56c4('0x7'));var config=require(_0x56c4('0x8'));var controller=require(_0x56c4('0x9'));router[_0x56c4('0xa')]('/',auth[_0x56c4('0xb')](),controller[_0x56c4('0xc')]);router[_0x56c4('0xa')](_0x56c4('0xd'),auth[_0x56c4('0xb')](),controller[_0x56c4('0xe')]);router[_0x56c4('0xa')](_0x56c4('0xf'),auth[_0x56c4('0xb')](),controller[_0x56c4('0x10')]);router[_0x56c4('0xa')]('/:id/members',auth[_0x56c4('0xb')](),controller[_0x56c4('0x11')]);router[_0x56c4('0xa')](_0x56c4('0x12'),auth['isAuthenticated'](),controller[_0x56c4('0x13')]);router[_0x56c4('0xa')](_0x56c4('0x14'),auth[_0x56c4('0xb')](),controller['getAgents']);router[_0x56c4('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x56c4('0x15')](_0x56c4('0x12'),auth[_0x56c4('0xb')](),controller[_0x56c4('0x16')]);router[_0x56c4('0x15')]('/:id/users',auth[_0x56c4('0xb')](),controller[_0x56c4('0x17')]);router['put'](_0x56c4('0xf'),auth[_0x56c4('0xb')](),controller[_0x56c4('0x18')]);router[_0x56c4('0x19')]('/:id',auth[_0x56c4('0xb')](),controller[_0x56c4('0x1a')]);router['delete'](_0x56c4('0x12'),auth[_0x56c4('0xb')](),controller[_0x56c4('0x1b')]);router[_0x56c4('0x19')]('/:id/users',auth[_0x56c4('0xb')](),controller[_0x56c4('0x1c')]);module[_0x56c4('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8e203a8..7262113 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 _0x3339=['exports','STRING','DATE','moment','sequelize'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3339,0x19d));var _0x9333=function(_0x2e5074,_0x4ee5ec){_0x2e5074=_0x2e5074-0x0;var _0x345dc3=_0x3339[_0x2e5074];return _0x345dc3;};'use strict';var moment=require(_0x9333('0x0'));var Sequelize=require(_0x9333('0x1'));module[_0x9333('0x2')]={'uniqueid':{'type':Sequelize[_0x9333('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9333('0x4')]},'acceptAt':{'type':Sequelize[_0x9333('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9333('0x3')]}}; \ No newline at end of file +var _0xe3d7=['DATE','sequelize','exports','STRING'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xe3d7,0x109));var _0x7e3d=function(_0x8994a1,_0x56009c){_0x8994a1=_0x8994a1-0x0;var _0xdb1ed4=_0xe3d7[_0x8994a1];return _0xdb1ed4;};'use strict';var moment=require('moment');var Sequelize=require(_0x7e3d('0x0'));module[_0x7e3d('0x1')]={'uniqueid':{'type':Sequelize[_0x7e3d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7e3d('0x2')]},'joinAt':{'type':Sequelize[_0x7e3d('0x3')]},'leaveAt':{'type':Sequelize[_0x7e3d('0x3')]},'acceptAt':{'type':Sequelize[_0x7e3d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7e3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ed2366b..ce797ce 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 _0xd404=['update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2504e1,_0x2aeb88){var _0x4d8b65=function(_0x2b3fca){while(--_0x2b3fca){_0x2504e1['push'](_0x2504e1['shift']());}};_0x4d8b65(++_0x2aeb88);}(_0xd404,0x15b));var _0x4d40=function(_0x115dd8,_0xd66e42){_0x115dd8=_0x115dd8-0x0;var _0x1d0477=_0xd404[_0x115dd8];return _0x1d0477;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require(_0x4d40('0x3'));var moment=require('moment');var BPromise=require(_0x4d40('0x4'));var Mustache=require(_0x4d40('0x5'));var util=require(_0x4d40('0x6'));var path=require(_0x4d40('0x7'));var sox=require(_0x4d40('0x8'));var csv=require(_0x4d40('0x9'));var ejs=require(_0x4d40('0xa'));var fs=require('fs');var fs_extra=require(_0x4d40('0xb'));var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var licenseUtil=require(_0x4d40('0x18'));var db=require(_0x4d40('0x19'))['db'];function respondWithStatusCode(_0x3c3b7e,_0x28e5bf){_0x28e5bf=_0x28e5bf||0xcc;return function(_0x42a621){if(_0x42a621){return _0x3c3b7e['sendStatus'](_0x28e5bf);}return _0x3c3b7e[_0x4d40('0x1a')](_0x28e5bf)[_0x4d40('0x1b')]();};}function respondWithResult(_0x3b071b,_0x2083bd){_0x2083bd=_0x2083bd||0xc8;return function(_0x477a91){if(_0x477a91){return _0x3b071b['status'](_0x2083bd)[_0x4d40('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x4077ce,_0x20bc1b){return function(_0xcee25a){if(_0xcee25a){var _0x453857=typeof _0x20bc1b[_0x4d40('0x1d')]===_0x4d40('0x1e')&&typeof _0x20bc1b[_0x4d40('0x1f')]===_0x4d40('0x1e');var _0x4b5d23=_0xcee25a['count'];var _0x1ae5c7=_0x453857?0x0:_0x20bc1b[_0x4d40('0x1d')];var _0x4e505f=_0x453857?_0xcee25a[_0x4d40('0x20')]:_0x20bc1b[_0x4d40('0x1d')]+_0x20bc1b['limit'];var _0x36d031;if(_0x4e505f>=_0x4b5d23){_0x4e505f=_0x4b5d23;_0x36d031=0xc8;}else{_0x36d031=0xce;}_0x4077ce['status'](_0x36d031);return _0x4077ce[_0x4d40('0x21')](_0x4d40('0x22'),_0x1ae5c7+'-'+_0x4e505f+'/'+_0x4b5d23)['json'](_0xcee25a);}return null;};}function patchUpdates(_0x57c997){return function(_0x375ce0){try{jsonpatch[_0x4d40('0x23')](_0x375ce0,_0x57c997,!![]);}catch(_0x4d52ce){return BPromise[_0x4d40('0x24')](_0x4d52ce);}return _0x375ce0[_0x4d40('0x25')]();};}function saveUpdates(_0x30f058,_0x5d4c24){return function(_0x356fd6){if(_0x356fd6){return _0x356fd6[_0x4d40('0x26')](_0x30f058)[_0x4d40('0x27')](function(_0x5ca0a0){return _0x5ca0a0;});}return null;};}function removeEntity(_0x4eebc3,_0x2df33a){return function(_0x90b652){if(_0x90b652){return _0x90b652[_0x4d40('0x28')]()[_0x4d40('0x27')](function(){_0x4eebc3[_0x4d40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbcd540,_0x1f5e5b){return function(_0x560df8){if(!_0x560df8){_0xbcd540['sendStatus'](0x194);}return _0x560df8;};}function handleError(_0x274d44,_0x2a0c82){_0x2a0c82=_0x2a0c82||0x1f4;return function(_0x3fa83e){logger[_0x4d40('0x29')](_0x3fa83e[_0x4d40('0x2a')]);if(_0x3fa83e[_0x4d40('0x2b')]){delete _0x3fa83e[_0x4d40('0x2b')];}_0x274d44[_0x4d40('0x1a')](_0x2a0c82)[_0x4d40('0x2c')](_0x3fa83e);};}exports[_0x4d40('0x2d')]=function(_0x1c0fcf,_0x4ca431){var _0x4e4e61={},_0x52f706={},_0x158a86={'count':0x0,'rows':[]};var _0x350488=_[_0x4d40('0x2e')](db[_0x4d40('0x2f')]['rawAttributes'],function(_0x18e601){return{'name':_0x18e601[_0x4d40('0x30')],'type':_0x18e601[_0x4d40('0x31')]['key']};});_0x52f706[_0x4d40('0x32')]=_[_0x4d40('0x2e')](_0x350488,_0x4d40('0x2b'));_0x52f706[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x1c0fcf['query']);_0x52f706[_0x4d40('0x35')]=_['intersection'](_0x52f706[_0x4d40('0x32')],_0x52f706[_0x4d40('0x33')]);_0x4e4e61[_0x4d40('0x36')]=_[_0x4d40('0x37')](_0x52f706['model'],qs['fields'](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x38')]));_0x4e4e61[_0x4d40('0x36')]=_0x4e4e61[_0x4d40('0x36')]['length']?_0x4e4e61[_0x4d40('0x36')]:_0x52f706['model'];if(!_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x39')](_0x4d40('0x3a'))){_0x4e4e61[_0x4d40('0x1f')]=qs[_0x4d40('0x1f')](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x1f')]);_0x4e4e61[_0x4d40('0x1d')]=qs[_0x4d40('0x1d')](_0x1c0fcf[_0x4d40('0x33')]['offset']);}_0x4e4e61[_0x4d40('0x3b')]=qs[_0x4d40('0x3c')](_0x1c0fcf['query']['sort']);_0x4e4e61['where']=qs[_0x4d40('0x35')](_[_0x4d40('0x3d')](_0x1c0fcf['query'],_0x52f706[_0x4d40('0x35')]),_0x350488);if(_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x3e')]){_0x4e4e61[_0x4d40('0x3f')]=_[_0x4d40('0x40')](_0x4e4e61['where'],{'$or':_[_0x4d40('0x2e')](_0x350488,function(_0x21a4ec){if(_0x21a4ec['type']!=='VIRTUAL'){var _0x3a4924={};_0x3a4924[_0x21a4ec[_0x4d40('0x2b')]]={'$like':'%'+_0x1c0fcf['query'][_0x4d40('0x3e')]+'%'};return _0x3a4924;}})});}_0x4e4e61=_[_0x4d40('0x40')]({},_0x4e4e61,_0x1c0fcf['options']);var _0x1e8427={'where':_0x4e4e61[_0x4d40('0x3f')]};return db['FaxQueueReport'][_0x4d40('0x20')](_0x1e8427)[_0x4d40('0x27')](function(_0x4841ac){_0x158a86[_0x4d40('0x20')]=_0x4841ac;if(_0x1c0fcf['query'][_0x4d40('0x41')]){_0x4e4e61[_0x4d40('0x42')]=[{'all':!![]}];}return db[_0x4d40('0x2f')][_0x4d40('0x43')](_0x4e4e61);})[_0x4d40('0x27')](function(_0x2ef0ca){_0x158a86[_0x4d40('0x44')]=_0x2ef0ca;return _0x158a86;})[_0x4d40('0x27')](respondWithFilteredResult(_0x4ca431,_0x4e4e61))[_0x4d40('0x45')](handleError(_0x4ca431,null));};exports['show']=function(_0x250847,_0x3718a8){var _0x1c2fa8={'raw':!![],'where':{'id':_0x250847[_0x4d40('0x46')]['id']}},_0xcdde22={};_0xcdde22['model']=_[_0x4d40('0x34')](db['FaxQueueReport'][_0x4d40('0x47')]);_0xcdde22[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x250847[_0x4d40('0x33')]);_0xcdde22['filters']=_[_0x4d40('0x37')](_0xcdde22[_0x4d40('0x32')],_0xcdde22['query']);_0x1c2fa8[_0x4d40('0x36')]=_['intersection'](_0xcdde22[_0x4d40('0x32')],qs[_0x4d40('0x38')](_0x250847[_0x4d40('0x33')][_0x4d40('0x38')]));_0x1c2fa8['attributes']=_0x1c2fa8[_0x4d40('0x36')]['length']?_0x1c2fa8[_0x4d40('0x36')]:_0xcdde22[_0x4d40('0x32')];if(_0x250847[_0x4d40('0x33')][_0x4d40('0x41')]){_0x1c2fa8['include']=[{'all':!![]}];}_0x1c2fa8=_[_0x4d40('0x40')]({},_0x1c2fa8,_0x250847[_0x4d40('0x48')]);return db[_0x4d40('0x2f')][_0x4d40('0x49')](_0x1c2fa8)['then'](handleEntityNotFound(_0x3718a8,null))[_0x4d40('0x27')](respondWithResult(_0x3718a8,null))[_0x4d40('0x45')](handleError(_0x3718a8,null));};exports['create']=function(_0x200d29,_0x493d8e){return db[_0x4d40('0x2f')][_0x4d40('0x4a')](_0x200d29[_0x4d40('0x4b')],{})[_0x4d40('0x27')](respondWithResult(_0x493d8e,0xc9))[_0x4d40('0x45')](handleError(_0x493d8e,null));};exports[_0x4d40('0x26')]=function(_0x30be7b,_0x37b6bf){if(_0x30be7b[_0x4d40('0x4b')]['id']){delete _0x30be7b['body']['id'];}return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0x30be7b[_0x4d40('0x46')]['id']}})[_0x4d40('0x27')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x27')](saveUpdates(_0x30be7b['body'],null))[_0x4d40('0x27')](respondWithResult(_0x37b6bf,null))[_0x4d40('0x45')](handleError(_0x37b6bf,null));};exports['destroy']=function(_0xdf0235,_0x48ffd7){return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0xdf0235[_0x4d40('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ffd7,null))[_0x4d40('0x27')](removeEntity(_0x48ffd7,null))[_0x4d40('0x45')](handleError(_0x48ffd7,null));};exports[_0x4d40('0x4c')]=function(_0x55df43,_0xd3e7cd){return db['FaxQueueReport'][_0x4d40('0x4c')]()[_0x4d40('0x27')](respondWithResult(_0xd3e7cd,null))['catch'](handleError(_0xd3e7cd,null));}; \ No newline at end of file +var _0x24cd=['json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','FaxQueueReport','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','filters','length','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3d52e4,_0x27a73d){var _0x58404e=function(_0x170510){while(--_0x170510){_0x3d52e4['push'](_0x3d52e4['shift']());}};_0x58404e(++_0x27a73d);}(_0x24cd,0x83));var _0xd24c=function(_0x49fe42,_0x41000b){_0x49fe42=_0x49fe42-0x0;var _0x1465a3=_0x24cd[_0x49fe42];return _0x1465a3;};'use strict';var emlformat=require(_0xd24c('0x0'));var rimraf=require(_0xd24c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd24c('0x2'));var rp=require('request-promise');var moment=require(_0xd24c('0x3'));var BPromise=require(_0xd24c('0x4'));var Mustache=require(_0xd24c('0x5'));var util=require('util');var path=require(_0xd24c('0x6'));var sox=require(_0xd24c('0x7'));var csv=require('to-csv');var ejs=require(_0xd24c('0x8'));var fs=require('fs');var fs_extra=require(_0xd24c('0x9'));var _=require(_0xd24c('0xa'));var squel=require(_0xd24c('0xb'));var crypto=require(_0xd24c('0xc'));var jsforce=require(_0xd24c('0xd'));var deskjs=require(_0xd24c('0xe'));var toCsv=require(_0xd24c('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd24c('0x10'));var authService=require(_0xd24c('0x11'));var qs=require(_0xd24c('0x12'));var as=require(_0xd24c('0x13'));var hardwareService=require(_0xd24c('0x14'));var logger=require(_0xd24c('0x15'))(_0xd24c('0x16'));var utils=require(_0xd24c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd24c('0x18'));var db=require(_0xd24c('0x19'))['db'];function respondWithStatusCode(_0x55de4d,_0x3296ea){_0x3296ea=_0x3296ea||0xcc;return function(_0x3bed2){if(_0x3bed2){return _0x55de4d[_0xd24c('0x1a')](_0x3296ea);}return _0x55de4d[_0xd24c('0x1b')](_0x3296ea)[_0xd24c('0x1c')]();};}function respondWithResult(_0x6a81d9,_0x2c29c6){_0x2c29c6=_0x2c29c6||0xc8;return function(_0x20b624){if(_0x20b624){return _0x6a81d9['status'](_0x2c29c6)[_0xd24c('0x1d')](_0x20b624);}};}function respondWithFilteredResult(_0xe096c,_0x528489){return function(_0x34aa92){if(_0x34aa92){var _0x3aa193=typeof _0x528489[_0xd24c('0x1e')]===_0xd24c('0x1f')&&typeof _0x528489['limit']==='undefined';var _0xc87bb7=_0x34aa92[_0xd24c('0x20')];var _0x170d59=_0x3aa193?0x0:_0x528489['offset'];var _0x9f2d2d=_0x3aa193?_0x34aa92[_0xd24c('0x20')]:_0x528489[_0xd24c('0x1e')]+_0x528489[_0xd24c('0x21')];var _0x478a0f;if(_0x9f2d2d>=_0xc87bb7){_0x9f2d2d=_0xc87bb7;_0x478a0f=0xc8;}else{_0x478a0f=0xce;}_0xe096c[_0xd24c('0x1b')](_0x478a0f);return _0xe096c['set'](_0xd24c('0x22'),_0x170d59+'-'+_0x9f2d2d+'/'+_0xc87bb7)[_0xd24c('0x1d')](_0x34aa92);}return null;};}function patchUpdates(_0x1b3a2f){return function(_0x38c380){try{jsonpatch[_0xd24c('0x23')](_0x38c380,_0x1b3a2f,!![]);}catch(_0x4964e5){return BPromise[_0xd24c('0x24')](_0x4964e5);}return _0x38c380[_0xd24c('0x25')]();};}function saveUpdates(_0x17375b,_0x206ce7){return function(_0x48fffd){if(_0x48fffd){return _0x48fffd[_0xd24c('0x26')](_0x17375b)[_0xd24c('0x27')](function(_0x2549d0){return _0x2549d0;});}return null;};}function removeEntity(_0x5c862f,_0x44471f){return function(_0x2c3328){if(_0x2c3328){return _0x2c3328[_0xd24c('0x28')]()['then'](function(){_0x5c862f[_0xd24c('0x1b')](0xcc)[_0xd24c('0x1c')]();});}};}function handleEntityNotFound(_0x848e0e,_0x40cdf7){return function(_0x574cd4){if(!_0x574cd4){_0x848e0e['sendStatus'](0x194);}return _0x574cd4;};}function handleError(_0x32d310,_0x4d56f4){_0x4d56f4=_0x4d56f4||0x1f4;return function(_0x13a9a7){logger[_0xd24c('0x29')](_0x13a9a7[_0xd24c('0x2a')]);if(_0x13a9a7['name']){delete _0x13a9a7['name'];}_0x32d310[_0xd24c('0x1b')](_0x4d56f4)[_0xd24c('0x2b')](_0x13a9a7);};}exports[_0xd24c('0x2c')]=function(_0x160f03,_0x111e13){var _0x2ecbaa={},_0x1be144={},_0x20d37f={'count':0x0,'rows':[]};var _0x1c48d6=_[_0xd24c('0x2d')](db[_0xd24c('0x2e')]['rawAttributes'],function(_0x4e128b){return{'name':_0x4e128b[_0xd24c('0x2f')],'type':_0x4e128b[_0xd24c('0x30')][_0xd24c('0x31')]};});_0x1be144['model']=_['map'](_0x1c48d6,_0xd24c('0x32'));_0x1be144[_0xd24c('0x33')]=_[_0xd24c('0x34')](_0x160f03[_0xd24c('0x33')]);_0x1be144['filters']=_[_0xd24c('0x35')](_0x1be144[_0xd24c('0x36')],_0x1be144[_0xd24c('0x33')]);_0x2ecbaa[_0xd24c('0x37')]=_[_0xd24c('0x35')](_0x1be144[_0xd24c('0x36')],qs[_0xd24c('0x38')](_0x160f03[_0xd24c('0x33')][_0xd24c('0x38')]));_0x2ecbaa['attributes']=_0x2ecbaa[_0xd24c('0x37')]['length']?_0x2ecbaa['attributes']:_0x1be144[_0xd24c('0x36')];if(!_0x160f03[_0xd24c('0x33')][_0xd24c('0x39')](_0xd24c('0x3a'))){_0x2ecbaa[_0xd24c('0x21')]=qs[_0xd24c('0x21')](_0x160f03[_0xd24c('0x33')]['limit']);_0x2ecbaa[_0xd24c('0x1e')]=qs[_0xd24c('0x1e')](_0x160f03[_0xd24c('0x33')][_0xd24c('0x1e')]);}_0x2ecbaa[_0xd24c('0x3b')]=qs[_0xd24c('0x3c')](_0x160f03['query'][_0xd24c('0x3c')]);_0x2ecbaa[_0xd24c('0x3d')]=qs['filters'](_[_0xd24c('0x3e')](_0x160f03[_0xd24c('0x33')],_0x1be144['filters']),_0x1c48d6);if(_0x160f03[_0xd24c('0x33')][_0xd24c('0x3f')]){_0x2ecbaa['where']=_[_0xd24c('0x40')](_0x2ecbaa[_0xd24c('0x3d')],{'$or':_[_0xd24c('0x2d')](_0x1c48d6,function(_0x29e425){if(_0x29e425['type']!==_0xd24c('0x41')){var _0x5c2a39={};_0x5c2a39[_0x29e425[_0xd24c('0x32')]]={'$like':'%'+_0x160f03['query']['filter']+'%'};return _0x5c2a39;}})});}_0x2ecbaa=_['merge']({},_0x2ecbaa,_0x160f03[_0xd24c('0x42')]);var _0x4d2e9a={'where':_0x2ecbaa['where']};return db[_0xd24c('0x2e')][_0xd24c('0x20')](_0x4d2e9a)[_0xd24c('0x27')](function(_0x3d188e){_0x20d37f['count']=_0x3d188e;if(_0x160f03[_0xd24c('0x33')]['includeAll']){_0x2ecbaa[_0xd24c('0x43')]=[{'all':!![]}];}return db[_0xd24c('0x2e')][_0xd24c('0x44')](_0x2ecbaa);})[_0xd24c('0x27')](function(_0x27eefa){_0x20d37f[_0xd24c('0x45')]=_0x27eefa;return _0x20d37f;})[_0xd24c('0x27')](respondWithFilteredResult(_0x111e13,_0x2ecbaa))[_0xd24c('0x46')](handleError(_0x111e13,null));};exports[_0xd24c('0x47')]=function(_0x18b9cd,_0x4b13ea){var _0x2607e5={'raw':!![],'where':{'id':_0x18b9cd['params']['id']}},_0x742082={};_0x742082[_0xd24c('0x36')]=_[_0xd24c('0x34')](db['FaxQueueReport'][_0xd24c('0x48')]);_0x742082['query']=_[_0xd24c('0x34')](_0x18b9cd[_0xd24c('0x33')]);_0x742082[_0xd24c('0x49')]=_[_0xd24c('0x35')](_0x742082[_0xd24c('0x36')],_0x742082['query']);_0x2607e5[_0xd24c('0x37')]=_['intersection'](_0x742082[_0xd24c('0x36')],qs['fields'](_0x18b9cd[_0xd24c('0x33')][_0xd24c('0x38')]));_0x2607e5['attributes']=_0x2607e5[_0xd24c('0x37')][_0xd24c('0x4a')]?_0x2607e5['attributes']:_0x742082[_0xd24c('0x36')];if(_0x18b9cd['query']['includeAll']){_0x2607e5['include']=[{'all':!![]}];}_0x2607e5=_[_0xd24c('0x40')]({},_0x2607e5,_0x18b9cd[_0xd24c('0x42')]);return db['FaxQueueReport']['find'](_0x2607e5)[_0xd24c('0x27')](handleEntityNotFound(_0x4b13ea,null))[_0xd24c('0x27')](respondWithResult(_0x4b13ea,null))[_0xd24c('0x46')](handleError(_0x4b13ea,null));};exports[_0xd24c('0x4b')]=function(_0x4e5b2d,_0x2931b7){return db[_0xd24c('0x2e')]['create'](_0x4e5b2d[_0xd24c('0x4c')],{})[_0xd24c('0x27')](respondWithResult(_0x2931b7,0xc9))[_0xd24c('0x46')](handleError(_0x2931b7,null));};exports['update']=function(_0x3039aa,_0x4b10c6){if(_0x3039aa[_0xd24c('0x4c')]['id']){delete _0x3039aa[_0xd24c('0x4c')]['id'];}return db[_0xd24c('0x2e')][_0xd24c('0x4d')]({'where':{'id':_0x3039aa['params']['id']}})[_0xd24c('0x27')](handleEntityNotFound(_0x4b10c6,null))[_0xd24c('0x27')](saveUpdates(_0x3039aa[_0xd24c('0x4c')],null))[_0xd24c('0x27')](respondWithResult(_0x4b10c6,null))[_0xd24c('0x46')](handleError(_0x4b10c6,null));};exports[_0xd24c('0x28')]=function(_0x3ce7d0,_0x34321f){return db[_0xd24c('0x2e')][_0xd24c('0x4d')]({'where':{'id':_0x3ce7d0[_0xd24c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x34321f,null))[_0xd24c('0x27')](removeEntity(_0x34321f,null))[_0xd24c('0x46')](handleError(_0x34321f,null));};exports['describe']=function(_0x5bb14f,_0x58f3f4){return db[_0xd24c('0x2e')][_0xd24c('0x4f')]()[_0xd24c('0x27')](respondWithResult(_0x58f3f4,null))[_0xd24c('0x46')](handleError(_0x58f3f4,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index eafc7dd..8fafed9 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x814b,0x1a2));var _0xb814=function(_0x574159,_0x952110){_0x574159=_0x574159-0x0;var _0x5dd226=_0x814b[_0x574159];return _0x5dd226;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x5a0610,_0x17227b){var _0xb0ecc9=function(_0xca99fa){while(--_0xca99fa){_0x5a0610['push'](_0x5a0610['shift']());}};_0xb0ecc9(++_0x17227b);}(_0xabce,0x103));var _0xeabc=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xabce[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index a72b2ae..f9bc79d 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 _0x64eb=['FaxQueueReport','body','options','raw','catch','UpdateFaxQueueReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport'];(function(_0x28a20a,_0x293a7a){var _0x3f4290=function(_0x351983){while(--_0x351983){_0x28a20a['push'](_0x28a20a['shift']());}};_0x3f4290(++_0x293a7a);}(_0x64eb,0x19c));var _0xb64e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb64e('0x0'));var util=require(_0xb64e('0x1'));var moment=require('moment');var BPromise=require(_0xb64e('0x2'));var rs=require(_0xb64e('0x3'));var fs=require('fs');var Redis=require(_0xb64e('0x4'));var db=require(_0xb64e('0x5'))['db'];var utils=require(_0xb64e('0x6'));var logger=require(_0xb64e('0x7'))('rpc');var config=require(_0xb64e('0x8'));var jayson=require(_0xb64e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23422f,_0x2db78d,_0x4db29e){return new BPromise(function(_0x159d41,_0x204f81){return client[_0xb64e('0xa')](_0x23422f,_0x4db29e)[_0xb64e('0xb')](function(_0x48ce40){logger[_0xb64e('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x2db78d,'request\x20sent');logger[_0xb64e('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2db78d,_0xb64e('0xe'),JSON[_0xb64e('0xf')](_0x48ce40));if(_0x48ce40[_0xb64e('0x10')]){if(_0x48ce40['error'][_0xb64e('0x11')]===0x1f4){logger[_0xb64e('0x10')](_0xb64e('0x12'),_0x2db78d,_0x48ce40[_0xb64e('0x10')][_0xb64e('0x13')]);return _0x204f81(_0x48ce40[_0xb64e('0x10')][_0xb64e('0x13')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2db78d,_0x48ce40[_0xb64e('0x10')][_0xb64e('0x13')]);return _0x159d41(_0x48ce40['error'][_0xb64e('0x13')]);}else{logger[_0xb64e('0xc')](_0xb64e('0x12'),_0x2db78d,'request\x20sent');_0x159d41(_0x48ce40[_0xb64e('0x14')][_0xb64e('0x13')]);}})['catch'](function(_0x4c07c8){logger[_0xb64e('0x10')](_0xb64e('0x12'),_0x2db78d,_0x4c07c8);_0x204f81(_0x4c07c8);});});}exports[_0xb64e('0x15')]=function(_0xb1e034){var _0x5e5376=this;return new Promise(function(_0x789b1f,_0x4d3efe){return db[_0xb64e('0x16')]['create'](_0xb1e034[_0xb64e('0x17')],{'raw':_0xb1e034[_0xb64e('0x18')]?_0xb1e034[_0xb64e('0x18')][_0xb64e('0x19')]===undefined?!![]:![]:!![]})[_0xb64e('0xb')](function(_0xc35a16){logger['info'](_0xb64e('0x15'),_0xb1e034);logger[_0xb64e('0xd')]('CreateFaxQueueReport',_0xb1e034,JSON['stringify'](_0xc35a16));_0x789b1f(_0xc35a16);})[_0xb64e('0x1a')](function(_0x2be354){logger[_0xb64e('0x10')]('CreateFaxQueueReport',_0x2be354[_0xb64e('0x13')],_0xb1e034);_0x4d3efe(_0x5e5376[_0xb64e('0x10')](0x1f4,_0x2be354['message']));});});};exports[_0xb64e('0x1b')]=function(_0x37f311){var _0x36bc3f=this;return new Promise(function(_0x1af8a1,_0x28bb38){return db[_0xb64e('0x16')][_0xb64e('0x1c')](_0x37f311[_0xb64e('0x17')],{'raw':_0x37f311[_0xb64e('0x18')]?_0x37f311[_0xb64e('0x18')][_0xb64e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37f311[_0xb64e('0x18')]?_0x37f311[_0xb64e('0x18')][_0xb64e('0x1d')]||null:null,'attributes':_0x37f311['options']?_0x37f311[_0xb64e('0x18')][_0xb64e('0x1e')]||null:null,'limit':_0x37f311[_0xb64e('0x18')]?_0x37f311['options']['limit']||null:null})['then'](function(_0x12223b){logger[_0xb64e('0xc')]('UpdateFaxQueueReport',_0x37f311);logger[_0xb64e('0xd')]('UpdateFaxQueueReport',_0x37f311,JSON[_0xb64e('0xf')](_0x12223b));_0x1af8a1(_0x12223b);})[_0xb64e('0x1a')](function(_0x55be0c){logger[_0xb64e('0x10')](_0xb64e('0x1b'),_0x55be0c[_0xb64e('0x13')],_0x37f311);_0x28bb38(_0x36bc3f[_0xb64e('0x10')](0x1f4,_0x55be0c[_0xb64e('0x13')]));});});}; \ No newline at end of file +var _0xf0cb=['create','body','options','catch','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport'];(function(_0x30df78,_0x588e52){var _0x382d38=function(_0x56cffa){while(--_0x56cffa){_0x30df78['push'](_0x30df78['shift']());}};_0x382d38(++_0x588e52);}(_0xf0cb,0xa0));var _0xbf0c=function(_0x2a76fa,_0x1cee7d){_0x2a76fa=_0x2a76fa-0x0;var _0x2d2442=_0xf0cb[_0x2a76fa];return _0x2d2442;};'use strict';var _=require(_0xbf0c('0x0'));var util=require(_0xbf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf0c('0x2'))['db'];var utils=require(_0xbf0c('0x3'));var logger=require('../../config/logger')(_0xbf0c('0x4'));var config=require(_0xbf0c('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf0c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d460a,_0x492980,_0x265fae){return new BPromise(function(_0x29e21b,_0x126069){return client[_0xbf0c('0x7')](_0x3d460a,_0x265fae)[_0xbf0c('0x8')](function(_0x1af683){logger[_0xbf0c('0x9')](_0xbf0c('0xa'),_0x492980,_0xbf0c('0xb'));logger[_0xbf0c('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x492980,_0xbf0c('0xb'),JSON[_0xbf0c('0xd')](_0x1af683));if(_0x1af683['error']){if(_0x1af683[_0xbf0c('0xe')][_0xbf0c('0xf')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x492980,_0x1af683[_0xbf0c('0xe')]['message']);return _0x126069(_0x1af683[_0xbf0c('0xe')][_0xbf0c('0x10')]);}logger[_0xbf0c('0xe')](_0xbf0c('0xa'),_0x492980,_0x1af683[_0xbf0c('0xe')][_0xbf0c('0x10')]);return _0x29e21b(_0x1af683[_0xbf0c('0xe')][_0xbf0c('0x10')]);}else{logger[_0xbf0c('0x9')](_0xbf0c('0xa'),_0x492980,_0xbf0c('0xb'));_0x29e21b(_0x1af683[_0xbf0c('0x11')][_0xbf0c('0x10')]);}})['catch'](function(_0x29dd4b){logger[_0xbf0c('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x492980,_0x29dd4b);_0x126069(_0x29dd4b);});});}exports[_0xbf0c('0x12')]=function(_0x5cbbe8){var _0x3a7477=this;return new Promise(function(_0x4f8967,_0x507346){return db[_0xbf0c('0x13')][_0xbf0c('0x14')](_0x5cbbe8[_0xbf0c('0x15')],{'raw':_0x5cbbe8[_0xbf0c('0x16')]?_0x5cbbe8[_0xbf0c('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xbf0c('0x8')](function(_0x2c5404){logger[_0xbf0c('0x9')]('CreateFaxQueueReport',_0x5cbbe8);logger[_0xbf0c('0xc')](_0xbf0c('0x12'),_0x5cbbe8,JSON['stringify'](_0x2c5404));_0x4f8967(_0x2c5404);})[_0xbf0c('0x17')](function(_0x23d9a6){logger[_0xbf0c('0xe')](_0xbf0c('0x12'),_0x23d9a6[_0xbf0c('0x10')],_0x5cbbe8);_0x507346(_0x3a7477['error'](0x1f4,_0x23d9a6['message']));});});};exports[_0xbf0c('0x18')]=function(_0x8b905b){var _0x152c52=this;return new Promise(function(_0x1fcffb,_0x1e409a){return db['FaxQueueReport'][_0xbf0c('0x19')](_0x8b905b[_0xbf0c('0x15')],{'raw':_0x8b905b[_0xbf0c('0x16')]?_0x8b905b['options'][_0xbf0c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8b905b['options']?_0x8b905b['options'][_0xbf0c('0x1b')]||null:null,'attributes':_0x8b905b[_0xbf0c('0x16')]?_0x8b905b[_0xbf0c('0x16')][_0xbf0c('0x1c')]||null:null,'limit':_0x8b905b['options']?_0x8b905b[_0xbf0c('0x16')][_0xbf0c('0x1d')]||null:null})['then'](function(_0x2100ec){logger['info']('UpdateFaxQueueReport',_0x8b905b);logger[_0xbf0c('0xc')](_0xbf0c('0x18'),_0x8b905b,JSON[_0xbf0c('0xd')](_0x2100ec));_0x1fcffb(_0x2100ec);})[_0xbf0c('0x17')](function(_0x4fdf81){logger[_0xbf0c('0xe')](_0xbf0c('0x18'),_0x4fdf81[_0xbf0c('0x10')],_0x8b905b);_0x1e409a(_0x152c52[_0xbf0c('0xe')](0x1f4,_0x4fdf81[_0xbf0c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 63908b5..e324a45 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 _0xc981=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x41ed42,_0x116eb5){var _0x35e608=function(_0x566bcb){while(--_0x566bcb){_0x41ed42['push'](_0x41ed42['shift']());}};_0x35e608(++_0x116eb5);}(_0xc981,0x8c));var _0x1c98=function(_0x3ca3b3,_0x52fb5c){_0x3ca3b3=_0x3ca3b3-0x0;var _0x482bd2=_0xc981[_0x3ca3b3];return _0x482bd2;};'use strict';var multer=require('multer');var util=require(_0x1c98('0x0'));var path=require(_0x1c98('0x1'));var timeout=require(_0x1c98('0x2'));var express=require(_0x1c98('0x3'));var router=express[_0x1c98('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1c98('0x5'));var interaction=require(_0x1c98('0x6'));var config=require(_0x1c98('0x7'));var controller=require('./faxQueueReport.controller');router[_0x1c98('0x8')]('/',auth['isAuthenticated'](),controller[_0x1c98('0x9')]);router['get']('/describe',auth[_0x1c98('0xa')](),controller[_0x1c98('0xb')]);router[_0x1c98('0x8')](_0x1c98('0xc'),auth[_0x1c98('0xa')](),controller[_0x1c98('0xd')]);router['post']('/',auth[_0x1c98('0xa')](),controller[_0x1c98('0xe')]);router[_0x1c98('0xf')](_0x1c98('0xc'),auth['isAuthenticated'](),controller[_0x1c98('0x10')]);router[_0x1c98('0x11')](_0x1c98('0xc'),auth[_0x1c98('0xa')](),controller[_0x1c98('0x12')]);module[_0x1c98('0x13')]=router; \ No newline at end of file +var _0xdb88=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports'];(function(_0x400aec,_0x20d3bb){var _0x54d53f=function(_0x508336){while(--_0x508336){_0x400aec['push'](_0x400aec['shift']());}};_0x54d53f(++_0x20d3bb);}(_0xdb88,0x90));var _0x8db8=function(_0x104857,_0x34844c){_0x104857=_0x104857-0x0;var _0x5c7d6d=_0xdb88[_0x104857];return _0x5c7d6d;};'use strict';var multer=require(_0x8db8('0x0'));var util=require(_0x8db8('0x1'));var path=require(_0x8db8('0x2'));var timeout=require('connect-timeout');var express=require(_0x8db8('0x3'));var router=express['Router']();var fs_extra=require(_0x8db8('0x4'));var auth=require(_0x8db8('0x5'));var interaction=require(_0x8db8('0x6'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8db8('0x7')](_0x8db8('0x8'),auth[_0x8db8('0x9')](),controller[_0x8db8('0xa')]);router[_0x8db8('0x7')](_0x8db8('0xb'),auth[_0x8db8('0x9')](),controller[_0x8db8('0xc')]);router[_0x8db8('0xd')]('/',auth[_0x8db8('0x9')](),controller[_0x8db8('0xe')]);router[_0x8db8('0xf')](_0x8db8('0xb'),auth[_0x8db8('0x9')](),controller['update']);router['delete'](_0x8db8('0xb'),auth[_0x8db8('0x9')](),controller[_0x8db8('0x10')]);module[_0x8db8('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 8e48405..7a6650d 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x4d51f8,_0x41f37d){var _0x251a66=function(_0x16df9c){while(--_0x16df9c){_0x4d51f8['push'](_0x4d51f8['shift']());}};_0x251a66(++_0x41f37d);}(_0xe706,0xa3));var _0x6e70=function(_0x1be67f,_0x2de2f3){_0x1be67f=_0x1be67f-0x0;var _0x2abef4=_0xe706[_0x1be67f];return _0x2abef4;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1a9e51,_0x56e399){_0x1a9e51=_0x1a9e51-0x0;var _0x22d2ef=_0x9bde[_0x1a9e51];return _0x22d2ef;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b8c429b..1604f25 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 _0x4eb5=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','params','keys','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4eb5,0x155));var _0x54eb=function(_0x283423,_0x9b9084){_0x283423=_0x283423-0x0;var _0x502e55=_0x4eb5[_0x283423];return _0x502e55;};'use strict';var emlformat=require(_0x54eb('0x0'));var rimraf=require(_0x54eb('0x1'));var zipdir=require(_0x54eb('0x2'));var jsonpatch=require(_0x54eb('0x3'));var rp=require('request-promise');var moment=require(_0x54eb('0x4'));var BPromise=require(_0x54eb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x54eb('0x6'));var sox=require(_0x54eb('0x7'));var csv=require(_0x54eb('0x8'));var ejs=require(_0x54eb('0x9'));var fs=require('fs');var fs_extra=require(_0x54eb('0xa'));var _=require(_0x54eb('0xb'));var squel=require(_0x54eb('0xc'));var crypto=require(_0x54eb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x54eb('0x8'));var querystring=require(_0x54eb('0xe'));var Papa=require(_0x54eb('0xf'));var Redis=require(_0x54eb('0x10'));var authService=require(_0x54eb('0x11'));var qs=require(_0x54eb('0x12'));var as=require(_0x54eb('0x13'));var hardwareService=require(_0x54eb('0x14'));var logger=require('../../config/logger')(_0x54eb('0x15'));var utils=require(_0x54eb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x54eb('0x17'))['db'];function respondWithStatusCode(_0x5af5cb,_0x180032){_0x180032=_0x180032||0xcc;return function(_0x39ea6b){if(_0x39ea6b){return _0x5af5cb[_0x54eb('0x18')](_0x180032);}return _0x5af5cb[_0x54eb('0x19')](_0x180032)['end']();};}function respondWithResult(_0x2c65e0,_0x3fabc2){_0x3fabc2=_0x3fabc2||0xc8;return function(_0x2e84a3){if(_0x2e84a3){return _0x2c65e0[_0x54eb('0x19')](_0x3fabc2)[_0x54eb('0x1a')](_0x2e84a3);}};}function respondWithFilteredResult(_0x10765d,_0x4f51f1){return function(_0x4f99a9){if(_0x4f99a9){var _0x6954dc=typeof _0x4f51f1[_0x54eb('0x1b')]===_0x54eb('0x1c')&&typeof _0x4f51f1[_0x54eb('0x1d')]===_0x54eb('0x1c');var _0x184869=_0x4f99a9[_0x54eb('0x1e')];var _0x1813c8=_0x6954dc?0x0:_0x4f51f1[_0x54eb('0x1b')];var _0x365d0d=_0x6954dc?_0x4f99a9[_0x54eb('0x1e')]:_0x4f51f1[_0x54eb('0x1b')]+_0x4f51f1[_0x54eb('0x1d')];var _0x2a2b5f;if(_0x365d0d>=_0x184869){_0x365d0d=_0x184869;_0x2a2b5f=0xc8;}else{_0x2a2b5f=0xce;}_0x10765d[_0x54eb('0x19')](_0x2a2b5f);return _0x10765d[_0x54eb('0x1f')](_0x54eb('0x20'),_0x1813c8+'-'+_0x365d0d+'/'+_0x184869)[_0x54eb('0x1a')](_0x4f99a9);}return null;};}function patchUpdates(_0x9af41f){return function(_0x59a72b){try{jsonpatch[_0x54eb('0x21')](_0x59a72b,_0x9af41f,!![]);}catch(_0x4a2680){return BPromise[_0x54eb('0x22')](_0x4a2680);}return _0x59a72b[_0x54eb('0x23')]();};}function saveUpdates(_0x5846ec,_0x431f0d){return function(_0x23ad5e){if(_0x23ad5e){return _0x23ad5e[_0x54eb('0x24')](_0x5846ec)['then'](function(_0x3fb09c){return _0x3fb09c;});}return null;};}function removeEntity(_0x55e122,_0x34e406){return function(_0x44d07c){if(_0x44d07c){return _0x44d07c[_0x54eb('0x25')]()[_0x54eb('0x26')](function(){_0x55e122[_0x54eb('0x19')](0xcc)[_0x54eb('0x27')]();});}};}function handleEntityNotFound(_0x38af40,_0xbc45be){return function(_0x3fccec){if(!_0x3fccec){_0x38af40[_0x54eb('0x18')](0x194);}return _0x3fccec;};}function handleError(_0x17e276,_0x37026f){_0x37026f=_0x37026f||0x1f4;return function(_0x7b462){logger[_0x54eb('0x28')](_0x7b462[_0x54eb('0x29')]);if(_0x7b462[_0x54eb('0x2a')]){delete _0x7b462['name'];}_0x17e276[_0x54eb('0x19')](_0x37026f)[_0x54eb('0x2b')](_0x7b462);};}exports[_0x54eb('0x2c')]=function(_0x28d3d9,_0x44f068){var _0x10edc8={},_0x5d1d35={},_0x485960={'count':0x0,'rows':[]};var _0x32c85e=_[_0x54eb('0x2d')](db[_0x54eb('0x2e')][_0x54eb('0x2f')],function(_0x393b6b){return{'name':_0x393b6b['fieldName'],'type':_0x393b6b[_0x54eb('0x30')]['key']};});_0x5d1d35[_0x54eb('0x31')]=_[_0x54eb('0x2d')](_0x32c85e,_0x54eb('0x2a'));_0x5d1d35[_0x54eb('0x32')]=_['keys'](_0x28d3d9['query']);_0x5d1d35[_0x54eb('0x33')]=_['intersection'](_0x5d1d35[_0x54eb('0x31')],_0x5d1d35['query']);_0x10edc8[_0x54eb('0x34')]=_[_0x54eb('0x35')](_0x5d1d35['model'],qs[_0x54eb('0x36')](_0x28d3d9[_0x54eb('0x32')][_0x54eb('0x36')]));_0x10edc8[_0x54eb('0x34')]=_0x10edc8[_0x54eb('0x34')][_0x54eb('0x37')]?_0x10edc8['attributes']:_0x5d1d35[_0x54eb('0x31')];if(!_0x28d3d9[_0x54eb('0x32')]['hasOwnProperty'](_0x54eb('0x38'))){_0x10edc8['limit']=qs['limit'](_0x28d3d9[_0x54eb('0x32')]['limit']);_0x10edc8[_0x54eb('0x1b')]=qs['offset'](_0x28d3d9[_0x54eb('0x32')][_0x54eb('0x1b')]);}_0x10edc8[_0x54eb('0x39')]=qs[_0x54eb('0x3a')](_0x28d3d9[_0x54eb('0x32')][_0x54eb('0x3a')]);_0x10edc8[_0x54eb('0x3b')]=qs[_0x54eb('0x33')](_['pick'](_0x28d3d9[_0x54eb('0x32')],_0x5d1d35[_0x54eb('0x33')]),_0x32c85e);if(_0x28d3d9['query'][_0x54eb('0x3c')]){_0x10edc8[_0x54eb('0x3b')]=_['merge'](_0x10edc8[_0x54eb('0x3b')],{'$or':_[_0x54eb('0x2d')](_0x32c85e,function(_0x3304a3){if(_0x3304a3[_0x54eb('0x30')]!==_0x54eb('0x3d')){var _0x41b176={};_0x41b176[_0x3304a3['name']]={'$like':'%'+_0x28d3d9['query']['filter']+'%'};return _0x41b176;}})});}_0x10edc8=_[_0x54eb('0x3e')]({},_0x10edc8,_0x28d3d9['options']);var _0x4570e4={'where':_0x10edc8[_0x54eb('0x3b')]};return db['FaxTransferReport']['count'](_0x4570e4)[_0x54eb('0x26')](function(_0x228c3b){_0x485960['count']=_0x228c3b;if(_0x28d3d9['query'][_0x54eb('0x3f')]){_0x10edc8[_0x54eb('0x40')]=[{'all':!![]}];}return db[_0x54eb('0x2e')]['findAll'](_0x10edc8);})[_0x54eb('0x26')](function(_0x3ee8cd){_0x485960[_0x54eb('0x41')]=_0x3ee8cd;return _0x485960;})[_0x54eb('0x26')](respondWithFilteredResult(_0x44f068,_0x10edc8))['catch'](handleError(_0x44f068,null));};exports['show']=function(_0x2fec90,_0xf86fc0){var _0x1d6d0e={'raw':!![],'where':{'id':_0x2fec90[_0x54eb('0x42')]['id']}},_0x8b58a4={};_0x8b58a4['model']=_[_0x54eb('0x43')](db[_0x54eb('0x2e')][_0x54eb('0x2f')]);_0x8b58a4[_0x54eb('0x32')]=_[_0x54eb('0x43')](_0x2fec90['query']);_0x8b58a4['filters']=_['intersection'](_0x8b58a4[_0x54eb('0x31')],_0x8b58a4[_0x54eb('0x32')]);_0x1d6d0e['attributes']=_[_0x54eb('0x35')](_0x8b58a4[_0x54eb('0x31')],qs['fields'](_0x2fec90[_0x54eb('0x32')]['fields']));_0x1d6d0e[_0x54eb('0x34')]=_0x1d6d0e[_0x54eb('0x34')][_0x54eb('0x37')]?_0x1d6d0e[_0x54eb('0x34')]:_0x8b58a4[_0x54eb('0x31')];if(_0x2fec90[_0x54eb('0x32')][_0x54eb('0x3f')]){_0x1d6d0e[_0x54eb('0x40')]=[{'all':!![]}];}_0x1d6d0e=_[_0x54eb('0x3e')]({},_0x1d6d0e,_0x2fec90[_0x54eb('0x44')]);return db[_0x54eb('0x2e')][_0x54eb('0x45')](_0x1d6d0e)['then'](handleEntityNotFound(_0xf86fc0,null))['then'](respondWithResult(_0xf86fc0,null))['catch'](handleError(_0xf86fc0,null));};exports[_0x54eb('0x46')]=function(_0x265b04,_0x2c766b){return db[_0x54eb('0x2e')][_0x54eb('0x46')](_0x265b04[_0x54eb('0x47')],{})[_0x54eb('0x26')](respondWithResult(_0x2c766b,0xc9))[_0x54eb('0x48')](handleError(_0x2c766b,null));};exports['update']=function(_0x4315c1,_0x29ffe8){if(_0x4315c1['body']['id']){delete _0x4315c1['body']['id'];}return db[_0x54eb('0x2e')][_0x54eb('0x45')]({'where':{'id':_0x4315c1[_0x54eb('0x42')]['id']}})[_0x54eb('0x26')](handleEntityNotFound(_0x29ffe8,null))[_0x54eb('0x26')](saveUpdates(_0x4315c1[_0x54eb('0x47')],null))[_0x54eb('0x26')](respondWithResult(_0x29ffe8,null))['catch'](handleError(_0x29ffe8,null));};exports[_0x54eb('0x25')]=function(_0x3a114a,_0x1e0a0a){return db['FaxTransferReport']['find']({'where':{'id':_0x3a114a[_0x54eb('0x42')]['id']}})[_0x54eb('0x26')](handleEntityNotFound(_0x1e0a0a,null))[_0x54eb('0x26')](removeEntity(_0x1e0a0a,null))['catch'](handleError(_0x1e0a0a,null));};exports['describe']=function(_0x3bee78,_0x1b27e2){return db[_0x54eb('0x2e')]['describe']()['then'](respondWithResult(_0x1b27e2,null))['catch'](handleError(_0x1b27e2,null));}; \ No newline at end of file +var _0x2ac4=['fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../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','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0xb021f4,_0x78fb58){var _0x380940=function(_0x3317fa){while(--_0x3317fa){_0xb021f4['push'](_0xb021f4['shift']());}};_0x380940(++_0x78fb58);}(_0x2ac4,0xac));var _0x42ac=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x2ac4[_0x20ef64];return _0x3707d8;};'use strict';var emlformat=require(_0x42ac('0x0'));var rimraf=require(_0x42ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42ac('0x2'));var rp=require(_0x42ac('0x3'));var moment=require('moment');var BPromise=require(_0x42ac('0x4'));var Mustache=require(_0x42ac('0x5'));var util=require(_0x42ac('0x6'));var path=require(_0x42ac('0x7'));var sox=require(_0x42ac('0x8'));var csv=require(_0x42ac('0x9'));var ejs=require(_0x42ac('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42ac('0xb'));var squel=require(_0x42ac('0xc'));var crypto=require(_0x42ac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x42ac('0xe'));var toCsv=require(_0x42ac('0x9'));var querystring=require(_0x42ac('0xf'));var Papa=require(_0x42ac('0x10'));var Redis=require('ioredis');var authService=require(_0x42ac('0x11'));var qs=require(_0x42ac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x42ac('0x13'))(_0x42ac('0x14'));var utils=require(_0x42ac('0x15'));var config=require(_0x42ac('0x16'));var licenseUtil=require(_0x42ac('0x17'));var db=require(_0x42ac('0x18'))['db'];function respondWithStatusCode(_0x1bef1e,_0x546c6a){_0x546c6a=_0x546c6a||0xcc;return function(_0x3451c2){if(_0x3451c2){return _0x1bef1e[_0x42ac('0x19')](_0x546c6a);}return _0x1bef1e[_0x42ac('0x1a')](_0x546c6a)[_0x42ac('0x1b')]();};}function respondWithResult(_0x5c168d,_0x172b9a){_0x172b9a=_0x172b9a||0xc8;return function(_0x2f4aed){if(_0x2f4aed){return _0x5c168d[_0x42ac('0x1a')](_0x172b9a)[_0x42ac('0x1c')](_0x2f4aed);}};}function respondWithFilteredResult(_0xccfe18,_0x32a51f){return function(_0x18b28a){if(_0x18b28a){var _0x84a2eb=typeof _0x32a51f[_0x42ac('0x1d')]===_0x42ac('0x1e')&&typeof _0x32a51f[_0x42ac('0x1f')]==='undefined';var _0x11276b=_0x18b28a[_0x42ac('0x20')];var _0x489f5a=_0x84a2eb?0x0:_0x32a51f['offset'];var _0x49c39f=_0x84a2eb?_0x18b28a[_0x42ac('0x20')]:_0x32a51f['offset']+_0x32a51f['limit'];var _0x45b439;if(_0x49c39f>=_0x11276b){_0x49c39f=_0x11276b;_0x45b439=0xc8;}else{_0x45b439=0xce;}_0xccfe18[_0x42ac('0x1a')](_0x45b439);return _0xccfe18[_0x42ac('0x21')](_0x42ac('0x22'),_0x489f5a+'-'+_0x49c39f+'/'+_0x11276b)[_0x42ac('0x1c')](_0x18b28a);}return null;};}function patchUpdates(_0x1fa510){return function(_0x5024aa){try{jsonpatch[_0x42ac('0x23')](_0x5024aa,_0x1fa510,!![]);}catch(_0x1d8094){return BPromise[_0x42ac('0x24')](_0x1d8094);}return _0x5024aa['save']();};}function saveUpdates(_0x1a9332,_0x14e527){return function(_0x29b47d){if(_0x29b47d){return _0x29b47d[_0x42ac('0x25')](_0x1a9332)[_0x42ac('0x26')](function(_0x379acc){return _0x379acc;});}return null;};}function removeEntity(_0x38f123,_0x22aedb){return function(_0x9361df){if(_0x9361df){return _0x9361df[_0x42ac('0x27')]()[_0x42ac('0x26')](function(){_0x38f123[_0x42ac('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34275a,_0x16c6da){return function(_0x358ad7){if(!_0x358ad7){_0x34275a['sendStatus'](0x194);}return _0x358ad7;};}function handleError(_0x515b84,_0x47d499){_0x47d499=_0x47d499||0x1f4;return function(_0x3c3b56){logger[_0x42ac('0x28')](_0x3c3b56[_0x42ac('0x29')]);if(_0x3c3b56[_0x42ac('0x2a')]){delete _0x3c3b56[_0x42ac('0x2a')];}_0x515b84[_0x42ac('0x1a')](_0x47d499)['send'](_0x3c3b56);};}exports['index']=function(_0x2db5fc,_0x2d0f3d){var _0x5d7145={},_0x232a97={},_0x2024ad={'count':0x0,'rows':[]};var _0x1b7932=_[_0x42ac('0x2b')](db['FaxTransferReport'][_0x42ac('0x2c')],function(_0x1066db){return{'name':_0x1066db[_0x42ac('0x2d')],'type':_0x1066db[_0x42ac('0x2e')][_0x42ac('0x2f')]};});_0x232a97[_0x42ac('0x30')]=_[_0x42ac('0x2b')](_0x1b7932,'name');_0x232a97[_0x42ac('0x31')]=_['keys'](_0x2db5fc['query']);_0x232a97[_0x42ac('0x32')]=_[_0x42ac('0x33')](_0x232a97[_0x42ac('0x30')],_0x232a97['query']);_0x5d7145[_0x42ac('0x34')]=_[_0x42ac('0x33')](_0x232a97['model'],qs[_0x42ac('0x35')](_0x2db5fc['query']['fields']));_0x5d7145[_0x42ac('0x34')]=_0x5d7145[_0x42ac('0x34')]['length']?_0x5d7145[_0x42ac('0x34')]:_0x232a97['model'];if(!_0x2db5fc[_0x42ac('0x31')][_0x42ac('0x36')](_0x42ac('0x37'))){_0x5d7145[_0x42ac('0x1f')]=qs[_0x42ac('0x1f')](_0x2db5fc['query'][_0x42ac('0x1f')]);_0x5d7145[_0x42ac('0x1d')]=qs[_0x42ac('0x1d')](_0x2db5fc[_0x42ac('0x31')]['offset']);}_0x5d7145[_0x42ac('0x38')]=qs[_0x42ac('0x39')](_0x2db5fc[_0x42ac('0x31')][_0x42ac('0x39')]);_0x5d7145[_0x42ac('0x3a')]=qs[_0x42ac('0x32')](_[_0x42ac('0x3b')](_0x2db5fc['query'],_0x232a97[_0x42ac('0x32')]),_0x1b7932);if(_0x2db5fc['query']['filter']){_0x5d7145[_0x42ac('0x3a')]=_[_0x42ac('0x3c')](_0x5d7145['where'],{'$or':_[_0x42ac('0x2b')](_0x1b7932,function(_0x5b0873){if(_0x5b0873[_0x42ac('0x2e')]!=='VIRTUAL'){var _0x47ae83={};_0x47ae83[_0x5b0873[_0x42ac('0x2a')]]={'$like':'%'+_0x2db5fc[_0x42ac('0x31')]['filter']+'%'};return _0x47ae83;}})});}_0x5d7145=_[_0x42ac('0x3c')]({},_0x5d7145,_0x2db5fc[_0x42ac('0x3d')]);var _0x2faaf5={'where':_0x5d7145[_0x42ac('0x3a')]};return db[_0x42ac('0x3e')][_0x42ac('0x20')](_0x2faaf5)['then'](function(_0x3bd1b0){_0x2024ad['count']=_0x3bd1b0;if(_0x2db5fc[_0x42ac('0x31')][_0x42ac('0x3f')]){_0x5d7145[_0x42ac('0x40')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x42ac('0x41')](_0x5d7145);})[_0x42ac('0x26')](function(_0x582ba4){_0x2024ad[_0x42ac('0x42')]=_0x582ba4;return _0x2024ad;})['then'](respondWithFilteredResult(_0x2d0f3d,_0x5d7145))[_0x42ac('0x43')](handleError(_0x2d0f3d,null));};exports[_0x42ac('0x44')]=function(_0xc09a8e,_0x172112){var _0xbb1de4={'raw':!![],'where':{'id':_0xc09a8e[_0x42ac('0x45')]['id']}},_0x46f48c={};_0x46f48c['model']=_[_0x42ac('0x46')](db[_0x42ac('0x3e')]['rawAttributes']);_0x46f48c['query']=_['keys'](_0xc09a8e['query']);_0x46f48c['filters']=_[_0x42ac('0x33')](_0x46f48c[_0x42ac('0x30')],_0x46f48c[_0x42ac('0x31')]);_0xbb1de4[_0x42ac('0x34')]=_[_0x42ac('0x33')](_0x46f48c['model'],qs[_0x42ac('0x35')](_0xc09a8e['query'][_0x42ac('0x35')]));_0xbb1de4['attributes']=_0xbb1de4[_0x42ac('0x34')]['length']?_0xbb1de4['attributes']:_0x46f48c[_0x42ac('0x30')];if(_0xc09a8e[_0x42ac('0x31')]['includeAll']){_0xbb1de4['include']=[{'all':!![]}];}_0xbb1de4=_[_0x42ac('0x3c')]({},_0xbb1de4,_0xc09a8e[_0x42ac('0x3d')]);return db[_0x42ac('0x3e')][_0x42ac('0x47')](_0xbb1de4)[_0x42ac('0x26')](handleEntityNotFound(_0x172112,null))[_0x42ac('0x26')](respondWithResult(_0x172112,null))['catch'](handleError(_0x172112,null));};exports[_0x42ac('0x48')]=function(_0x167e4a,_0x3f32ec){return db[_0x42ac('0x3e')][_0x42ac('0x48')](_0x167e4a[_0x42ac('0x49')],{})[_0x42ac('0x26')](respondWithResult(_0x3f32ec,0xc9))[_0x42ac('0x43')](handleError(_0x3f32ec,null));};exports[_0x42ac('0x25')]=function(_0x55a7e7,_0x480e27){if(_0x55a7e7[_0x42ac('0x49')]['id']){delete _0x55a7e7[_0x42ac('0x49')]['id'];}return db[_0x42ac('0x3e')]['find']({'where':{'id':_0x55a7e7[_0x42ac('0x45')]['id']}})['then'](handleEntityNotFound(_0x480e27,null))[_0x42ac('0x26')](saveUpdates(_0x55a7e7[_0x42ac('0x49')],null))[_0x42ac('0x26')](respondWithResult(_0x480e27,null))[_0x42ac('0x43')](handleError(_0x480e27,null));};exports[_0x42ac('0x27')]=function(_0x17fe54,_0x1f404b){return db['FaxTransferReport'][_0x42ac('0x47')]({'where':{'id':_0x17fe54['params']['id']}})[_0x42ac('0x26')](handleEntityNotFound(_0x1f404b,null))[_0x42ac('0x26')](removeEntity(_0x1f404b,null))[_0x42ac('0x43')](handleError(_0x1f404b,null));};exports[_0x42ac('0x4a')]=function(_0x12beb9,_0xdeac5a){return db[_0x42ac('0x3e')][_0x42ac('0x4a')]()[_0x42ac('0x26')](respondWithResult(_0xdeac5a,null))[_0x42ac('0x43')](handleError(_0xdeac5a,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a3c34a7..aa89d3a 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 _0x391f=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x8e4022,_0x2c6987){var _0xcde5db=function(_0x57c2ec){while(--_0x57c2ec){_0x8e4022['push'](_0x8e4022['shift']());}};_0xcde5db(++_0x2c6987);}(_0x391f,0x10c));var _0xf391=function(_0x53f955,_0x4d8f15){_0x53f955=_0x53f955-0x0;var _0x3cd9c6=_0x391f[_0x53f955];return _0x3cd9c6;};'use strict';var _=require(_0xf391('0x0'));var util=require(_0xf391('0x1'));var logger=require(_0xf391('0x2'))(_0xf391('0x3'));var moment=require(_0xf391('0x4'));var BPromise=require(_0xf391('0x5'));var rp=require(_0xf391('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf391('0x7'));var config=require(_0xf391('0x8'));var attributes=require(_0xf391('0x9'));module[_0xf391('0xa')]=function(_0x2c9be6,_0x5885e7){return _0x2c9be6[_0xf391('0xb')](_0xf391('0xc'),attributes,{'tableName':_0xf391('0xd'),'paranoid':![],'indexes':[{'name':_0xf391('0xe'),'fields':[_0xf391('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf330=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x7a0220,_0x73e776){var _0x582068=function(_0x2089c7){while(--_0x2089c7){_0x7a0220['push'](_0x7a0220['shift']());}};_0x582068(++_0x73e776);}(_0xf330,0x160));var _0x0f33=function(_0x101554,_0x112c00){_0x101554=_0x101554-0x0;var _0x47f4f5=_0xf330[_0x101554];return _0x47f4f5;};'use strict';var _=require(_0x0f33('0x0'));var util=require(_0x0f33('0x1'));var logger=require(_0x0f33('0x2'))('api');var moment=require(_0x0f33('0x3'));var BPromise=require(_0x0f33('0x4'));var rp=require(_0x0f33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f33('0x6'));var config=require(_0x0f33('0x7'));var attributes=require(_0x0f33('0x8'));module[_0x0f33('0x9')]=function(_0x568a18,_0x470e19){return _0x568a18[_0x0f33('0xa')](_0x0f33('0xb'),attributes,{'tableName':_0x0f33('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0f33('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 f7e4971..5353163 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 _0xbdd8=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x122bec,_0x39a551){var _0x507605=function(_0x157e38){while(--_0x157e38){_0x122bec['push'](_0x122bec['shift']());}};_0x507605(++_0x39a551);}(_0xbdd8,0xb8));var _0x8bdd=function(_0x92b20f,_0x165faa){_0x92b20f=_0x92b20f-0x0;var _0x5ea366=_0xbdd8[_0x92b20f];return _0x5ea366;};'use strict';var _=require(_0x8bdd('0x0'));var util=require(_0x8bdd('0x1'));var moment=require(_0x8bdd('0x2'));var BPromise=require(_0x8bdd('0x3'));var rs=require(_0x8bdd('0x4'));var fs=require('fs');var Redis=require(_0x8bdd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bdd('0x6'));var logger=require(_0x8bdd('0x7'))('rpc');var config=require(_0x8bdd('0x8'));var jayson=require(_0x8bdd('0x9'));var client=jayson[_0x8bdd('0xa')][_0x8bdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x749171,_0x2831b7,_0x52450c){return new BPromise(function(_0x4da90d,_0x575c81){return client[_0x8bdd('0xc')](_0x749171,_0x52450c)[_0x8bdd('0xd')](function(_0x3ad0e4){logger[_0x8bdd('0xe')](_0x8bdd('0xf'),_0x2831b7,_0x8bdd('0x10'));logger[_0x8bdd('0x11')](_0x8bdd('0x12'),_0x2831b7,_0x8bdd('0x10'),JSON['stringify'](_0x3ad0e4));if(_0x3ad0e4[_0x8bdd('0x13')]){if(_0x3ad0e4[_0x8bdd('0x13')]['code']===0x1f4){logger[_0x8bdd('0x13')](_0x8bdd('0xf'),_0x2831b7,_0x3ad0e4['error'][_0x8bdd('0x14')]);return _0x575c81(_0x3ad0e4[_0x8bdd('0x13')][_0x8bdd('0x14')]);}logger[_0x8bdd('0x13')](_0x8bdd('0xf'),_0x2831b7,_0x3ad0e4[_0x8bdd('0x13')][_0x8bdd('0x14')]);return _0x4da90d(_0x3ad0e4[_0x8bdd('0x13')][_0x8bdd('0x14')]);}else{logger['info'](_0x8bdd('0xf'),_0x2831b7,_0x8bdd('0x10'));_0x4da90d(_0x3ad0e4['result'][_0x8bdd('0x14')]);}})[_0x8bdd('0x15')](function(_0x23da61){logger[_0x8bdd('0x13')](_0x8bdd('0xf'),_0x2831b7,_0x23da61);_0x575c81(_0x23da61);});});} \ No newline at end of file +var _0x078e=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x52d6bd,_0x41873e){var _0x21a990=function(_0x4da406){while(--_0x4da406){_0x52d6bd['push'](_0x52d6bd['shift']());}};_0x21a990(++_0x41873e);}(_0x078e,0x147));var _0xe078=function(_0xfb60c2,_0x4afb20){_0xfb60c2=_0xfb60c2-0x0;var _0x388c5c=_0x078e[_0xfb60c2];return _0x388c5c;};'use strict';var _=require(_0xe078('0x0'));var util=require(_0xe078('0x1'));var moment=require(_0xe078('0x2'));var BPromise=require(_0xe078('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe078('0x4'));var db=require(_0xe078('0x5'))['db'];var utils=require(_0xe078('0x6'));var logger=require('../../config/logger')(_0xe078('0x7'));var config=require(_0xe078('0x8'));var jayson=require(_0xe078('0x9'));var client=jayson[_0xe078('0xa')][_0xe078('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x340c3e,_0x590b18,_0x45ba1c){return new BPromise(function(_0x1e8f79,_0x458194){return client[_0xe078('0xc')](_0x340c3e,_0x45ba1c)[_0xe078('0xd')](function(_0x2442eb){logger[_0xe078('0xe')](_0xe078('0xf'),_0x590b18,_0xe078('0x10'));logger[_0xe078('0x11')](_0xe078('0x12'),_0x590b18,_0xe078('0x10'),JSON[_0xe078('0x13')](_0x2442eb));if(_0x2442eb[_0xe078('0x14')]){if(_0x2442eb[_0xe078('0x14')]['code']===0x1f4){logger[_0xe078('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x590b18,_0x2442eb[_0xe078('0x14')][_0xe078('0x15')]);return _0x458194(_0x2442eb[_0xe078('0x14')][_0xe078('0x15')]);}logger[_0xe078('0x14')](_0xe078('0xf'),_0x590b18,_0x2442eb[_0xe078('0x14')][_0xe078('0x15')]);return _0x1e8f79(_0x2442eb['error'][_0xe078('0x15')]);}else{logger[_0xe078('0xe')](_0xe078('0xf'),_0x590b18,_0xe078('0x10'));_0x1e8f79(_0x2442eb['result']['message']);}})[_0xe078('0x16')](function(_0x5a543d){logger[_0xe078('0x14')](_0xe078('0xf'),_0x590b18,_0x5a543d);_0x458194(_0x5a543d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a3c00de..e3de591 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 _0xef2f=['/:id','isAuthenticated','show','post','create','put','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','describe'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xef2f,0x73));var _0xfef2=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xef2f[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0xfef2('0x0'));var util=require(_0xfef2('0x1'));var path=require(_0xfef2('0x2'));var timeout=require(_0xfef2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfef2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfef2('0x5'));var config=require(_0xfef2('0x6'));var controller=require(_0xfef2('0x7'));router[_0xfef2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfef2('0x8')](_0xfef2('0x9'),auth['isAuthenticated'](),controller[_0xfef2('0xa')]);router[_0xfef2('0x8')](_0xfef2('0xb'),auth[_0xfef2('0xc')](),controller[_0xfef2('0xd')]);router[_0xfef2('0xe')]('/',auth[_0xfef2('0xc')](),controller[_0xfef2('0xf')]);router[_0xfef2('0x10')](_0xfef2('0xb'),auth[_0xfef2('0xc')](),controller['update']);router['delete'](_0xfef2('0xb'),auth[_0xfef2('0xc')](),controller['destroy']);module[_0xfef2('0x11')]=router; \ No newline at end of file +var _0xa7c5=['delete','destroy','exports','multer','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x35b1c4,_0x56b60b){var _0x475339=function(_0x597c71){while(--_0x597c71){_0x35b1c4['push'](_0x35b1c4['shift']());}};_0x475339(++_0x56b60b);}(_0xa7c5,0xb3));var _0x5a7c=function(_0x5e2210,_0x172a2){_0x5e2210=_0x5e2210-0x0;var _0x16ff51=_0xa7c5[_0x5e2210];return _0x16ff51;};'use strict';var multer=require(_0x5a7c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5a7c('0x1'));var interaction=require(_0x5a7c('0x2'));var config=require('../../config/environment');var controller=require(_0x5a7c('0x3'));router[_0x5a7c('0x4')]('/',auth[_0x5a7c('0x5')](),controller[_0x5a7c('0x6')]);router[_0x5a7c('0x4')]('/describe',auth[_0x5a7c('0x5')](),controller[_0x5a7c('0x7')]);router[_0x5a7c('0x4')](_0x5a7c('0x8'),auth['isAuthenticated'](),controller[_0x5a7c('0x9')]);router[_0x5a7c('0xa')]('/',auth[_0x5a7c('0x5')](),controller[_0x5a7c('0xb')]);router[_0x5a7c('0xc')](_0x5a7c('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x5a7c('0xd')](_0x5a7c('0x8'),auth[_0x5a7c('0x5')](),controller[_0x5a7c('0xe')]);module[_0x5a7c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6fd0017..5679593 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 _0x1c19=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','post','addConfiguration'];(function(_0x260da4,_0x419de9){var _0x414b67=function(_0x23c50b){while(--_0x23c50b){_0x260da4['push'](_0x260da4['shift']());}};_0x414b67(++_0x419de9);}(_0x1c19,0x134));var _0x91c1=function(_0x344128,_0x9b9e88){_0x344128=_0x344128-0x0;var _0x693fae=_0x1c19[_0x344128];return _0x693fae;};'use strict';var multer=require('multer');var util=require(_0x91c1('0x0'));var path=require(_0x91c1('0x1'));var timeout=require(_0x91c1('0x2'));var express=require(_0x91c1('0x3'));var router=express[_0x91c1('0x4')]();var fs_extra=require(_0x91c1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x91c1('0x6'));var controller=require(_0x91c1('0x7'));router['get']('/',auth[_0x91c1('0x8')](),controller[_0x91c1('0x9')]);router[_0x91c1('0xa')](_0x91c1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x91c1('0xa')](_0x91c1('0xc'),auth[_0x91c1('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x91c1('0x8')](),controller['getFields']);router[_0x91c1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x91c1('0xd')](_0x91c1('0xc'),auth[_0x91c1('0x8')](),controller[_0x91c1('0xe')]);router['put'](_0x91c1('0xb'),auth[_0x91c1('0x8')](),controller['update']);router['delete'](_0x91c1('0xb'),auth[_0x91c1('0x8')](),controller[_0x91c1('0xf')]);module[_0x91c1('0x10')]=router; \ No newline at end of file +var _0xca5b=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./intDeskAccount.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca5b,0x91));var _0xbca5=function(_0xbf3f74,_0x1ae4bf){_0xbf3f74=_0xbf3f74-0x0;var _0xd26ead=_0xca5b[_0xbf3f74];return _0xd26ead;};'use strict';var multer=require(_0xbca5('0x0'));var util=require(_0xbca5('0x1'));var path=require(_0xbca5('0x2'));var timeout=require(_0xbca5('0x3'));var express=require(_0xbca5('0x4'));var router=express[_0xbca5('0x5')]();var fs_extra=require(_0xbca5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbca5('0x7'));router[_0xbca5('0x8')]('/',auth[_0xbca5('0x9')](),controller[_0xbca5('0xa')]);router[_0xbca5('0x8')](_0xbca5('0xb'),auth['isAuthenticated'](),controller[_0xbca5('0xc')]);router[_0xbca5('0x8')](_0xbca5('0xd'),auth[_0xbca5('0x9')](),controller[_0xbca5('0xe')]);router['get'](_0xbca5('0xf'),auth[_0xbca5('0x9')](),controller['getFields']);router[_0xbca5('0x10')]('/',auth[_0xbca5('0x9')](),controller[_0xbca5('0x11')]);router[_0xbca5('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xbca5('0x12')](_0xbca5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbca5('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xbca5('0x14')]);module[_0xbca5('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 3e15328..462fe67 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 _0x22c4=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x3c63df,_0x544fd9){var _0x174e74=function(_0x24caf0){while(--_0x24caf0){_0x3c63df['push'](_0x3c63df['shift']());}};_0x174e74(++_0x544fd9);}(_0x22c4,0xcc));var _0x422c=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0x22c4[_0xf35bc1];return _0xa6b162;};'use strict';var Sequelize=require(_0x422c('0x0'));module[_0x422c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x422c('0x2')]},'username':{'type':Sequelize[_0x422c('0x2')]},'remoteUri':{'type':Sequelize[_0x422c('0x2')]},'authType':{'type':Sequelize[_0x422c('0x3')](_0x422c('0x4')),'defaultValue':_0x422c('0x4')},'password':{'type':Sequelize[_0x422c('0x2')]},'consumerKey':{'type':Sequelize[_0x422c('0x2')]},'consumerSecret':{'type':Sequelize[_0x422c('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x422c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x422c('0x5'),_0x422c('0x6')),'defaultValue':_0x422c('0x5')}}; \ No newline at end of file +var _0x5eae=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5eae,0x9e));var _0xe5ea=function(_0x27b7cd,_0x285187){_0x27b7cd=_0x27b7cd-0x0;var _0x7497b=_0x5eae[_0x27b7cd];return _0x7497b;};'use strict';var Sequelize=require(_0xe5ea('0x0'));module[_0xe5ea('0x1')]={'name':{'type':Sequelize[_0xe5ea('0x2')]},'description':{'type':Sequelize[_0xe5ea('0x2')]},'username':{'type':Sequelize[_0xe5ea('0x2')]},'remoteUri':{'type':Sequelize[_0xe5ea('0x2')]},'authType':{'type':Sequelize[_0xe5ea('0x3')]('basic'),'defaultValue':_0xe5ea('0x4')},'password':{'type':Sequelize[_0xe5ea('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xe5ea('0x2')]},'token':{'type':Sequelize[_0xe5ea('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe5ea('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe5ea('0x3')](_0xe5ea('0x5'),_0xe5ea('0x6')),'defaultValue':_0xe5ea('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f614373..23a52ee 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 _0x8818=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','DeskAccount','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','getConfigurations','findOne','params','DeskConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv'];(function(_0x3c8a9e,_0x5505cd){var _0x4c90b9=function(_0x17b1ae){while(--_0x17b1ae){_0x3c8a9e['push'](_0x3c8a9e['shift']());}};_0x4c90b9(++_0x5505cd);}(_0x8818,0x148));var _0x8881=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x8818[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8881('0x0'));var jsonpatch=require(_0x8881('0x1'));var rp=require(_0x8881('0x2'));var moment=require('moment');var BPromise=require(_0x8881('0x3'));var Mustache=require(_0x8881('0x4'));var util=require('util');var path=require(_0x8881('0x5'));var sox=require(_0x8881('0x6'));var csv=require(_0x8881('0x7'));var ejs=require(_0x8881('0x8'));var fs=require('fs');var fs_extra=require(_0x8881('0x9'));var _=require(_0x8881('0xa'));var squel=require(_0x8881('0xb'));var crypto=require(_0x8881('0xc'));var jsforce=require(_0x8881('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8881('0x7'));var querystring=require(_0x8881('0xe'));var Papa=require('papaparse');var Redis=require(_0x8881('0xf'));var authService=require(_0x8881('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8881('0x11'));var hardwareService=require(_0x8881('0x12'));var logger=require(_0x8881('0x13'))(_0x8881('0x14'));var utils=require(_0x8881('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8881('0x16'));var db=require(_0x8881('0x17'))['db'];var integrations=require(_0x8881('0x18'));function respondWithStatusCode(_0xc5e2d1,_0x1ddb2b){_0x1ddb2b=_0x1ddb2b||0xcc;return function(_0x110fb5){if(_0x110fb5){return _0xc5e2d1['sendStatus'](_0x1ddb2b);}return _0xc5e2d1[_0x8881('0x19')](_0x1ddb2b)[_0x8881('0x1a')]();};}function respondWithResult(_0x44bc3a,_0xbad330){_0xbad330=_0xbad330||0xc8;return function(_0x2dc2c5){if(_0x2dc2c5){return _0x44bc3a[_0x8881('0x19')](_0xbad330)[_0x8881('0x1b')](_0x2dc2c5);}};}function respondWithFilteredResult(_0x5acaf6,_0x3aecb4){return function(_0x25bb64){if(_0x25bb64){var _0x2cf8ae=typeof _0x3aecb4['offset']===_0x8881('0x1c')&&typeof _0x3aecb4['limit']===_0x8881('0x1c');var _0x35182a=_0x25bb64[_0x8881('0x1d')];var _0x51972c=_0x2cf8ae?0x0:_0x3aecb4[_0x8881('0x1e')];var _0x56bea0=_0x2cf8ae?_0x25bb64['count']:_0x3aecb4[_0x8881('0x1e')]+_0x3aecb4[_0x8881('0x1f')];var _0x15fe45;if(_0x56bea0>=_0x35182a){_0x56bea0=_0x35182a;_0x15fe45=0xc8;}else{_0x15fe45=0xce;}_0x5acaf6[_0x8881('0x19')](_0x15fe45);return _0x5acaf6[_0x8881('0x20')](_0x8881('0x21'),_0x51972c+'-'+_0x56bea0+'/'+_0x35182a)[_0x8881('0x1b')](_0x25bb64);}return null;};}function patchUpdates(_0x109cb3){return function(_0x4518de){try{jsonpatch[_0x8881('0x22')](_0x4518de,_0x109cb3,!![]);}catch(_0x47e563){return BPromise['reject'](_0x47e563);}return _0x4518de['save']();};}function saveUpdates(_0x38d357,_0x2f3903){return function(_0x4ae9c1){if(_0x4ae9c1){return _0x4ae9c1[_0x8881('0x23')](_0x38d357)['then'](function(_0x8db8c3){return _0x8db8c3;});}return null;};}function removeEntity(_0xdad700,_0x38b024){return function(_0x30b9ff){if(_0x30b9ff){return _0x30b9ff[_0x8881('0x24')]()[_0x8881('0x25')](function(){_0xdad700[_0x8881('0x19')](0xcc)[_0x8881('0x1a')]();});}};}function handleEntityNotFound(_0x10fbec,_0x7ad0af){return function(_0x138f36){if(!_0x138f36){_0x10fbec[_0x8881('0x26')](0x194);}return _0x138f36;};}function handleError(_0x3f3022,_0x9e7efe){_0x9e7efe=_0x9e7efe||0x1f4;return function(_0xccde3c){logger[_0x8881('0x27')](_0xccde3c[_0x8881('0x28')]);if(_0xccde3c[_0x8881('0x29')]){delete _0xccde3c[_0x8881('0x29')];}_0x3f3022['status'](_0x9e7efe)[_0x8881('0x2a')](_0xccde3c);};}exports['index']=function(_0x371744,_0x4d7acd){var _0x681490={},_0xa00125={},_0x518241={'count':0x0,'rows':[]};var _0x43097f=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3bdfe0){return{'name':_0x3bdfe0['fieldName'],'type':_0x3bdfe0[_0x8881('0x2b')][_0x8881('0x2c')]};});_0xa00125[_0x8881('0x2d')]=_['map'](_0x43097f,'name');_0xa00125[_0x8881('0x2e')]=_[_0x8881('0x2f')](_0x371744[_0x8881('0x2e')]);_0xa00125['filters']=_[_0x8881('0x30')](_0xa00125['model'],_0xa00125[_0x8881('0x2e')]);_0x681490['attributes']=_[_0x8881('0x30')](_0xa00125[_0x8881('0x2d')],qs[_0x8881('0x31')](_0x371744['query']['fields']));_0x681490[_0x8881('0x32')]=_0x681490['attributes'][_0x8881('0x33')]?_0x681490[_0x8881('0x32')]:_0xa00125[_0x8881('0x2d')];if(!_0x371744['query'][_0x8881('0x34')](_0x8881('0x35'))){_0x681490[_0x8881('0x1f')]=qs[_0x8881('0x1f')](_0x371744[_0x8881('0x2e')][_0x8881('0x1f')]);_0x681490['offset']=qs[_0x8881('0x1e')](_0x371744[_0x8881('0x2e')]['offset']);}_0x681490[_0x8881('0x36')]=qs[_0x8881('0x37')](_0x371744[_0x8881('0x2e')]['sort']);_0x681490[_0x8881('0x38')]=qs[_0x8881('0x39')](_[_0x8881('0x3a')](_0x371744[_0x8881('0x2e')],_0xa00125[_0x8881('0x39')]),_0x43097f);if(_0x371744[_0x8881('0x2e')]['filter']){_0x681490[_0x8881('0x38')]=_[_0x8881('0x3b')](_0x681490[_0x8881('0x38')],{'$or':_[_0x8881('0x3c')](_0x43097f,function(_0x4cae01){if(_0x4cae01[_0x8881('0x2b')]!==_0x8881('0x3d')){var _0x1be31d={};_0x1be31d[_0x4cae01[_0x8881('0x29')]]={'$like':'%'+_0x371744[_0x8881('0x2e')][_0x8881('0x3e')]+'%'};return _0x1be31d;}})});}_0x681490=_[_0x8881('0x3b')]({},_0x681490,_0x371744[_0x8881('0x3f')]);var _0x58fded={'where':_0x681490[_0x8881('0x38')]};return db[_0x8881('0x40')][_0x8881('0x1d')](_0x58fded)[_0x8881('0x25')](function(_0x5c0c6b){_0x518241['count']=_0x5c0c6b;if(_0x371744[_0x8881('0x2e')][_0x8881('0x41')]){_0x681490[_0x8881('0x42')]=[{'all':!![]}];}return db['DeskAccount'][_0x8881('0x43')](_0x681490);})['then'](function(_0x218bfc){_0x518241['rows']=_0x218bfc;return _0x518241;})[_0x8881('0x25')](respondWithFilteredResult(_0x4d7acd,_0x681490))[_0x8881('0x44')](handleError(_0x4d7acd,null));};exports[_0x8881('0x45')]=function(_0x3c4273,_0x36383a){var _0x491728={'raw':![],'where':{'id':_0x3c4273['params']['id']}},_0x5272c1={};_0x5272c1['model']=_[_0x8881('0x2f')](db[_0x8881('0x40')][_0x8881('0x46')]);_0x5272c1['query']=_[_0x8881('0x2f')](_0x3c4273[_0x8881('0x2e')]);_0x5272c1[_0x8881('0x39')]=_[_0x8881('0x30')](_0x5272c1[_0x8881('0x2d')],_0x5272c1[_0x8881('0x2e')]);_0x491728['attributes']=_['intersection'](_0x5272c1[_0x8881('0x2d')],qs[_0x8881('0x31')](_0x3c4273[_0x8881('0x2e')][_0x8881('0x31')]));_0x491728[_0x8881('0x32')]=_0x491728[_0x8881('0x32')]['length']?_0x491728[_0x8881('0x32')]:_0x5272c1[_0x8881('0x2d')];if(_0x3c4273[_0x8881('0x2e')][_0x8881('0x41')]){_0x491728[_0x8881('0x42')]=[{'all':!![]}];}_0x491728=_[_0x8881('0x3b')]({},_0x491728,_0x3c4273['options']);return db[_0x8881('0x40')][_0x8881('0x47')](_0x491728)[_0x8881('0x25')](handleEntityNotFound(_0x36383a,null))[_0x8881('0x25')](respondWithResult(_0x36383a,null))[_0x8881('0x44')](handleError(_0x36383a,null));};exports[_0x8881('0x48')]=function(_0x53dd3c,_0x5335a3){return db[_0x8881('0x40')][_0x8881('0x48')](_0x53dd3c[_0x8881('0x49')],{})[_0x8881('0x25')](respondWithResult(_0x5335a3,0xc9))['catch'](handleError(_0x5335a3,null));};exports[_0x8881('0x23')]=function(_0x1dd17e,_0x1c34ac){if(_0x1dd17e[_0x8881('0x49')]['id']){delete _0x1dd17e[_0x8881('0x49')]['id'];}return db[_0x8881('0x40')][_0x8881('0x47')]({'where':{'id':_0x1dd17e['params']['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x1c34ac,null))['then'](saveUpdates(_0x1dd17e[_0x8881('0x49')],null))[_0x8881('0x25')](respondWithResult(_0x1c34ac,null))['catch'](handleError(_0x1c34ac,null));};exports[_0x8881('0x24')]=function(_0x5878fd,_0x3d4a39){return db[_0x8881('0x40')][_0x8881('0x47')]({'where':{'id':_0x5878fd['params']['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x3d4a39,null))[_0x8881('0x25')](removeEntity(_0x3d4a39,null))[_0x8881('0x44')](handleError(_0x3d4a39,null));};exports[_0x8881('0x4a')]=function(_0x524ce6,_0x535043,_0x162c47){var _0x1e5e20={};var _0x463349={};var _0x579f84;var _0x42737d;return db['DeskAccount'][_0x8881('0x4b')]({'where':{'id':_0x524ce6[_0x8881('0x4c')]['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x535043,null))[_0x8881('0x25')](function(_0x1594f1){if(_0x1594f1){_0x579f84=_0x1594f1;_0x463349[_0x8881('0x2d')]=_[_0x8881('0x2f')](db[_0x8881('0x4d')][_0x8881('0x46')]);_0x463349['query']=_[_0x8881('0x2f')](_0x524ce6[_0x8881('0x2e')]);_0x463349['filters']=_[_0x8881('0x30')](_0x463349[_0x8881('0x2d')],_0x463349[_0x8881('0x2e')]);_0x1e5e20[_0x8881('0x32')]=_['intersection'](_0x463349[_0x8881('0x2d')],qs[_0x8881('0x31')](_0x524ce6[_0x8881('0x2e')][_0x8881('0x31')]));_0x1e5e20[_0x8881('0x32')]=_0x1e5e20[_0x8881('0x32')]['length']?_0x1e5e20[_0x8881('0x32')]:_0x463349[_0x8881('0x2d')];_0x1e5e20[_0x8881('0x36')]=qs[_0x8881('0x37')](_0x524ce6[_0x8881('0x2e')]['sort']);_0x1e5e20[_0x8881('0x38')]=qs[_0x8881('0x39')](_['pick'](_0x524ce6[_0x8881('0x2e')],_0x463349[_0x8881('0x39')]));if(_0x524ce6[_0x8881('0x2e')][_0x8881('0x3e')]){_0x1e5e20[_0x8881('0x38')]=_[_0x8881('0x3b')](_0x1e5e20[_0x8881('0x38')],{'$or':_[_0x8881('0x3c')](_0x1e5e20[_0x8881('0x32')],function(_0x1e9522){var _0x2bc7cb={};_0x2bc7cb[_0x1e9522]={'$like':'%'+_0x524ce6[_0x8881('0x2e')]['filter']+'%'};return _0x2bc7cb;})});}_0x1e5e20=_[_0x8881('0x3b')]({},_0x1e5e20,_0x524ce6[_0x8881('0x3f')]);return _0x579f84[_0x8881('0x4a')](_0x1e5e20);}})[_0x8881('0x25')](function(_0x4ad9ea){if(_0x4ad9ea){_0x42737d=_0x4ad9ea[_0x8881('0x33')];if(!_0x524ce6[_0x8881('0x2e')][_0x8881('0x34')](_0x8881('0x35'))){_0x1e5e20[_0x8881('0x1f')]=qs[_0x8881('0x1f')](_0x524ce6[_0x8881('0x2e')][_0x8881('0x1f')]);_0x1e5e20[_0x8881('0x1e')]=qs[_0x8881('0x1e')](_0x524ce6[_0x8881('0x2e')][_0x8881('0x1e')]);}return _0x579f84[_0x8881('0x4a')](_0x1e5e20);}})[_0x8881('0x25')](function(_0x3a2fbe){if(_0x3a2fbe){return _0x3a2fbe?{'count':_0x42737d,'rows':_0x3a2fbe}:null;}})[_0x8881('0x25')](respondWithResult(_0x535043,null))[_0x8881('0x44')](handleError(_0x535043,null));};exports['addConfiguration']=function(_0x1ac4bc,_0x3876fd,_0x4bfbbb){if(_0x1ac4bc[_0x8881('0x49')]['id']){delete _0x1ac4bc['body']['id'];}return db[_0x8881('0x40')][_0x8881('0x4b')]({'where':{'id':_0x1ac4bc[_0x8881('0x4c')]['id']}})[_0x8881('0x25')](handleEntityNotFound(_0x3876fd,null))[_0x8881('0x25')](function(_0x2b3453){if(_0x2b3453){_0x1ac4bc[_0x8881('0x49')][_0x8881('0x4e')]=_0x2b3453['id'];_0x1ac4bc['body'][_0x8881('0x4f')]=integrations[_0x8881('0x50')](_0x1ac4bc['body']['channel'],_0x1ac4bc[_0x8881('0x49')][_0x8881('0x2b')]);_0x1ac4bc[_0x8881('0x49')][_0x8881('0x51')]=integrations[_0x8881('0x52')](_0x1ac4bc[_0x8881('0x49')][_0x8881('0x53')],_0x1ac4bc[_0x8881('0x49')][_0x8881('0x2b')]);return db['DeskConfiguration'][_0x8881('0x48')](_0x1ac4bc[_0x8881('0x49')],{'include':[{'model':db['DeskField'],'as':_0x8881('0x4f')},{'model':db['DeskField'],'as':_0x8881('0x51')}]});}return null;})[_0x8881('0x25')](respondWithResult(_0x3876fd,null))[_0x8881('0x44')](handleError(_0x3876fd,null));};exports[_0x8881('0x54')]=function(_0x4553e0,_0x160334,_0x5b4fc3){var _0x2e551a=[{'name':_0x8881('0x55'),'label':_0x8881('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x382517='';return db['DeskAccount']['findOne']({'where':{'id':_0x4553e0['params']['id']},'attributes':['id','remoteUri',_0x8881('0x56'),_0x8881('0x57'),_0x8881('0x58'),_0x8881('0x59'),_0x8881('0x5a'),_0x8881('0x5b'),'tokenSecret']})[_0x8881('0x25')](handleEntityNotFound(_0x160334,null))['then'](function(_0x134767){if(_0x134767){_0x382517=_0x134767['remoteUri'];var _0x830009=_0x382517[_0x8881('0x5c')](-0x1);if(_0x830009==='/'){_0x382517=_0x382517['substring'](0x0,_0x382517[_0x8881('0x5d')](_0x830009));}var _0x31e99e={'method':_0x8881('0x5e'),'uri':util[_0x8881('0x5f')](_0x8881('0x60'),_0x382517),'headers':{'Content-Type':'application/json','Accept':_0x8881('0x61')},'json':!![]};if(_0x134767[_0x8881('0x56')]===_0x8881('0x62')){_0x31e99e['headers'][_0x8881('0x63')]=util[_0x8881('0x5f')](_0x8881('0x64'),new Buffer(util[_0x8881('0x5f')](_0x8881('0x65'),_0x134767['username'],_0x134767[_0x8881('0x58')]))['toString'](_0x8881('0x66')));}return rp(_0x31e99e)[_0x8881('0x25')](function(_0x354287){return _0x2e551a[_0x8881('0x67')](_[_0x8881('0x3c')](_0x354287[_0x8881('0x68')][_0x8881('0x69')],function(_0x50a186){return{'id':_0x50a186['name'],'name':_0x50a186[_0x8881('0x29')],'type':_0x50a186[_0x8881('0x2b')],'active':_0x50a186[_0x8881('0x6a')],'label':_0x50a186[_0x8881('0x6b')],'custom':!![]};}));});}})[_0x8881('0x25')](function(_0xa8c960){return{'count':_0xa8c960[_0x8881('0x33')],'rows':_0xa8c960};})['then'](respondWithResult(_0x160334,null))[_0x8881('0x44')](function(_0x31814e){var _0x1f0ca8=_0x4553e0[_0x8881('0x2e')][_0x8881('0x6c')]?0x1f4:_0x31814e[_0x8881('0x6d')]||0x1f4;logger[_0x8881('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x8881('0x54'),_0x1f0ca8,JSON[_0x8881('0x6e')](_0x31814e));delete _0x31814e[_0x8881('0x29')];if(_0x1f0ca8===0x191){_0x1f0ca8=0x190;}_0x160334[_0x8881('0x19')](_0x1f0ca8)[_0x8881('0x2a')](_0x4553e0['query'][_0x8881('0x6c')]?{'message':_0x8881('0x6f'),'statusCode':_0x31814e['statusCode']}:_0x31814e);});}; \ No newline at end of file +var _0xbd1c=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','name','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','VIRTUAL','options','include','DeskAccount','rows','catch','includeAll','find','create','body','getConfigurations','params','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','lastIndexOf','format','%s/custom_fields','application/json','headers','%s:%s','toString','base64','concat','entries','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','eml-format'];(function(_0x5696bc,_0xdfac28){var _0x2b85f2=function(_0x447f56){while(--_0x447f56){_0x5696bc['push'](_0x5696bc['shift']());}};_0x2b85f2(++_0xdfac28);}(_0xbd1c,0x1bb));var _0xcbd1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xbd1c[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xcbd1('0x0'));var rimraf=require(_0xcbd1('0x1'));var zipdir=require(_0xcbd1('0x2'));var jsonpatch=require(_0xcbd1('0x3'));var rp=require(_0xcbd1('0x4'));var moment=require('moment');var BPromise=require(_0xcbd1('0x5'));var Mustache=require(_0xcbd1('0x6'));var util=require('util');var path=require(_0xcbd1('0x7'));var sox=require(_0xcbd1('0x8'));var csv=require(_0xcbd1('0x9'));var ejs=require(_0xcbd1('0xa'));var fs=require('fs');var fs_extra=require(_0xcbd1('0xb'));var _=require(_0xcbd1('0xc'));var squel=require(_0xcbd1('0xd'));var crypto=require(_0xcbd1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbd1('0x9'));var querystring=require(_0xcbd1('0xf'));var Papa=require(_0xcbd1('0x10'));var Redis=require(_0xcbd1('0x11'));var authService=require(_0xcbd1('0x12'));var qs=require(_0xcbd1('0x13'));var as=require(_0xcbd1('0x14'));var hardwareService=require(_0xcbd1('0x15'));var logger=require('../../config/logger')(_0xcbd1('0x16'));var utils=require('../../config/utils');var config=require(_0xcbd1('0x17'));var licenseUtil=require(_0xcbd1('0x18'));var db=require(_0xcbd1('0x19'))['db'];var integrations=require(_0xcbd1('0x1a'));function respondWithStatusCode(_0x5de054,_0x2389d3){_0x2389d3=_0x2389d3||0xcc;return function(_0x31abb4){if(_0x31abb4){return _0x5de054['sendStatus'](_0x2389d3);}return _0x5de054['status'](_0x2389d3)[_0xcbd1('0x1b')]();};}function respondWithResult(_0xb19408,_0x561b6e){_0x561b6e=_0x561b6e||0xc8;return function(_0x224b59){if(_0x224b59){return _0xb19408[_0xcbd1('0x1c')](_0x561b6e)['json'](_0x224b59);}};}function respondWithFilteredResult(_0x48546c,_0x502253){return function(_0x5511a7){if(_0x5511a7){var _0x3f7041=typeof _0x502253[_0xcbd1('0x1d')]===_0xcbd1('0x1e')&&typeof _0x502253[_0xcbd1('0x1f')]===_0xcbd1('0x1e');var _0xa999a=_0x5511a7[_0xcbd1('0x20')];var _0x3f4179=_0x3f7041?0x0:_0x502253[_0xcbd1('0x1d')];var _0x585102=_0x3f7041?_0x5511a7[_0xcbd1('0x20')]:_0x502253[_0xcbd1('0x1d')]+_0x502253[_0xcbd1('0x1f')];var _0x535abf;if(_0x585102>=_0xa999a){_0x585102=_0xa999a;_0x535abf=0xc8;}else{_0x535abf=0xce;}_0x48546c[_0xcbd1('0x1c')](_0x535abf);return _0x48546c[_0xcbd1('0x21')](_0xcbd1('0x22'),_0x3f4179+'-'+_0x585102+'/'+_0xa999a)[_0xcbd1('0x23')](_0x5511a7);}return null;};}function patchUpdates(_0x20be8a){return function(_0x4d25b7){try{jsonpatch['apply'](_0x4d25b7,_0x20be8a,!![]);}catch(_0x3dcbc9){return BPromise[_0xcbd1('0x24')](_0x3dcbc9);}return _0x4d25b7[_0xcbd1('0x25')]();};}function saveUpdates(_0x363c0f,_0x450df6){return function(_0xfaae31){if(_0xfaae31){return _0xfaae31[_0xcbd1('0x26')](_0x363c0f)[_0xcbd1('0x27')](function(_0x5f58ef){return _0x5f58ef;});}return null;};}function removeEntity(_0x37f34f,_0x1c4905){return function(_0xec2e86){if(_0xec2e86){return _0xec2e86[_0xcbd1('0x28')]()[_0xcbd1('0x27')](function(){_0x37f34f[_0xcbd1('0x1c')](0xcc)[_0xcbd1('0x1b')]();});}};}function handleEntityNotFound(_0x4e73f4,_0x1893e7){return function(_0x1ff414){if(!_0x1ff414){_0x4e73f4[_0xcbd1('0x29')](0x194);}return _0x1ff414;};}function handleError(_0xc2359a,_0x296b47){_0x296b47=_0x296b47||0x1f4;return function(_0x3be493){logger['error'](_0x3be493['stack']);if(_0x3be493[_0xcbd1('0x2a')]){delete _0x3be493[_0xcbd1('0x2a')];}_0xc2359a[_0xcbd1('0x1c')](_0x296b47)['send'](_0x3be493);};}exports[_0xcbd1('0x2b')]=function(_0xf9fa82,_0x36ff2f){var _0x3153fb={},_0x102edf={},_0x5d900b={'count':0x0,'rows':[]};var _0x17f08c=_['map'](db['DeskAccount'][_0xcbd1('0x2c')],function(_0x8cdddb){return{'name':_0x8cdddb[_0xcbd1('0x2d')],'type':_0x8cdddb[_0xcbd1('0x2e')][_0xcbd1('0x2f')]};});_0x102edf['model']=_[_0xcbd1('0x30')](_0x17f08c,_0xcbd1('0x2a'));_0x102edf[_0xcbd1('0x31')]=_[_0xcbd1('0x32')](_0xf9fa82[_0xcbd1('0x31')]);_0x102edf['filters']=_[_0xcbd1('0x33')](_0x102edf[_0xcbd1('0x34')],_0x102edf[_0xcbd1('0x31')]);_0x3153fb['attributes']=_[_0xcbd1('0x33')](_0x102edf['model'],qs[_0xcbd1('0x35')](_0xf9fa82[_0xcbd1('0x31')][_0xcbd1('0x35')]));_0x3153fb[_0xcbd1('0x36')]=_0x3153fb[_0xcbd1('0x36')][_0xcbd1('0x37')]?_0x3153fb[_0xcbd1('0x36')]:_0x102edf[_0xcbd1('0x34')];if(!_0xf9fa82['query'][_0xcbd1('0x38')](_0xcbd1('0x39'))){_0x3153fb[_0xcbd1('0x1f')]=qs[_0xcbd1('0x1f')](_0xf9fa82['query']['limit']);_0x3153fb[_0xcbd1('0x1d')]=qs[_0xcbd1('0x1d')](_0xf9fa82['query'][_0xcbd1('0x1d')]);}_0x3153fb['order']=qs[_0xcbd1('0x3a')](_0xf9fa82['query']['sort']);_0x3153fb['where']=qs['filters'](_[_0xcbd1('0x3b')](_0xf9fa82[_0xcbd1('0x31')],_0x102edf[_0xcbd1('0x3c')]),_0x17f08c);if(_0xf9fa82[_0xcbd1('0x31')][_0xcbd1('0x3d')]){_0x3153fb['where']=_[_0xcbd1('0x3e')](_0x3153fb[_0xcbd1('0x3f')],{'$or':_['map'](_0x17f08c,function(_0x3f4507){if(_0x3f4507[_0xcbd1('0x2e')]!==_0xcbd1('0x40')){var _0x50ab1d={};_0x50ab1d[_0x3f4507[_0xcbd1('0x2a')]]={'$like':'%'+_0xf9fa82[_0xcbd1('0x31')][_0xcbd1('0x3d')]+'%'};return _0x50ab1d;}})});}_0x3153fb=_[_0xcbd1('0x3e')]({},_0x3153fb,_0xf9fa82[_0xcbd1('0x41')]);var _0x1b63e5={'where':_0x3153fb['where']};return db['DeskAccount'][_0xcbd1('0x20')](_0x1b63e5)[_0xcbd1('0x27')](function(_0x2a930b){_0x5d900b[_0xcbd1('0x20')]=_0x2a930b;if(_0xf9fa82['query']['includeAll']){_0x3153fb[_0xcbd1('0x42')]=[{'all':!![]}];}return db[_0xcbd1('0x43')]['findAll'](_0x3153fb);})[_0xcbd1('0x27')](function(_0x543bc6){_0x5d900b[_0xcbd1('0x44')]=_0x543bc6;return _0x5d900b;})[_0xcbd1('0x27')](respondWithFilteredResult(_0x36ff2f,_0x3153fb))[_0xcbd1('0x45')](handleError(_0x36ff2f,null));};exports['show']=function(_0x5bb07d,_0x5d6eb6){var _0x430ac0={'raw':![],'where':{'id':_0x5bb07d['params']['id']}},_0xcc36e4={};_0xcc36e4[_0xcbd1('0x34')]=_['keys'](db[_0xcbd1('0x43')]['rawAttributes']);_0xcc36e4['query']=_[_0xcbd1('0x32')](_0x5bb07d[_0xcbd1('0x31')]);_0xcc36e4[_0xcbd1('0x3c')]=_[_0xcbd1('0x33')](_0xcc36e4['model'],_0xcc36e4[_0xcbd1('0x31')]);_0x430ac0[_0xcbd1('0x36')]=_[_0xcbd1('0x33')](_0xcc36e4['model'],qs[_0xcbd1('0x35')](_0x5bb07d[_0xcbd1('0x31')][_0xcbd1('0x35')]));_0x430ac0[_0xcbd1('0x36')]=_0x430ac0[_0xcbd1('0x36')][_0xcbd1('0x37')]?_0x430ac0[_0xcbd1('0x36')]:_0xcc36e4[_0xcbd1('0x34')];if(_0x5bb07d[_0xcbd1('0x31')][_0xcbd1('0x46')]){_0x430ac0[_0xcbd1('0x42')]=[{'all':!![]}];}_0x430ac0=_[_0xcbd1('0x3e')]({},_0x430ac0,_0x5bb07d[_0xcbd1('0x41')]);return db['DeskAccount'][_0xcbd1('0x47')](_0x430ac0)[_0xcbd1('0x27')](handleEntityNotFound(_0x5d6eb6,null))[_0xcbd1('0x27')](respondWithResult(_0x5d6eb6,null))[_0xcbd1('0x45')](handleError(_0x5d6eb6,null));};exports[_0xcbd1('0x48')]=function(_0x138555,_0x285a8b){return db[_0xcbd1('0x43')][_0xcbd1('0x48')](_0x138555[_0xcbd1('0x49')],{})[_0xcbd1('0x27')](respondWithResult(_0x285a8b,0xc9))[_0xcbd1('0x45')](handleError(_0x285a8b,null));};exports[_0xcbd1('0x26')]=function(_0x5c5ff7,_0x4605eb){if(_0x5c5ff7[_0xcbd1('0x49')]['id']){delete _0x5c5ff7[_0xcbd1('0x49')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x5c5ff7['params']['id']}})[_0xcbd1('0x27')](handleEntityNotFound(_0x4605eb,null))[_0xcbd1('0x27')](saveUpdates(_0x5c5ff7['body'],null))['then'](respondWithResult(_0x4605eb,null))[_0xcbd1('0x45')](handleError(_0x4605eb,null));};exports[_0xcbd1('0x28')]=function(_0x489e55,_0x22eade){return db['DeskAccount'][_0xcbd1('0x47')]({'where':{'id':_0x489e55['params']['id']}})['then'](handleEntityNotFound(_0x22eade,null))[_0xcbd1('0x27')](removeEntity(_0x22eade,null))[_0xcbd1('0x45')](handleError(_0x22eade,null));};exports[_0xcbd1('0x4a')]=function(_0x1df70b,_0x422f30,_0x1de5af){var _0x547056={};var _0x3247cd={};var _0x1708cd;var _0xad7c33;return db[_0xcbd1('0x43')]['findOne']({'where':{'id':_0x1df70b[_0xcbd1('0x4b')]['id']}})[_0xcbd1('0x27')](handleEntityNotFound(_0x422f30,null))['then'](function(_0x34abe3){if(_0x34abe3){_0x1708cd=_0x34abe3;_0x3247cd[_0xcbd1('0x34')]=_[_0xcbd1('0x32')](db['DeskConfiguration'][_0xcbd1('0x2c')]);_0x3247cd[_0xcbd1('0x31')]=_[_0xcbd1('0x32')](_0x1df70b[_0xcbd1('0x31')]);_0x3247cd[_0xcbd1('0x3c')]=_['intersection'](_0x3247cd[_0xcbd1('0x34')],_0x3247cd[_0xcbd1('0x31')]);_0x547056[_0xcbd1('0x36')]=_['intersection'](_0x3247cd[_0xcbd1('0x34')],qs['fields'](_0x1df70b[_0xcbd1('0x31')][_0xcbd1('0x35')]));_0x547056['attributes']=_0x547056['attributes'][_0xcbd1('0x37')]?_0x547056[_0xcbd1('0x36')]:_0x3247cd[_0xcbd1('0x34')];_0x547056[_0xcbd1('0x4c')]=qs['sort'](_0x1df70b['query']['sort']);_0x547056[_0xcbd1('0x3f')]=qs[_0xcbd1('0x3c')](_[_0xcbd1('0x3b')](_0x1df70b[_0xcbd1('0x31')],_0x3247cd[_0xcbd1('0x3c')]));if(_0x1df70b[_0xcbd1('0x31')][_0xcbd1('0x3d')]){_0x547056[_0xcbd1('0x3f')]=_[_0xcbd1('0x3e')](_0x547056['where'],{'$or':_[_0xcbd1('0x30')](_0x547056['attributes'],function(_0x53a293){var _0x5e5248={};_0x5e5248[_0x53a293]={'$like':'%'+_0x1df70b[_0xcbd1('0x31')][_0xcbd1('0x3d')]+'%'};return _0x5e5248;})});}_0x547056=_[_0xcbd1('0x3e')]({},_0x547056,_0x1df70b['options']);return _0x1708cd[_0xcbd1('0x4a')](_0x547056);}})[_0xcbd1('0x27')](function(_0x55aefe){if(_0x55aefe){_0xad7c33=_0x55aefe['length'];if(!_0x1df70b[_0xcbd1('0x31')][_0xcbd1('0x38')](_0xcbd1('0x39'))){_0x547056[_0xcbd1('0x1f')]=qs[_0xcbd1('0x1f')](_0x1df70b[_0xcbd1('0x31')][_0xcbd1('0x1f')]);_0x547056['offset']=qs[_0xcbd1('0x1d')](_0x1df70b[_0xcbd1('0x31')][_0xcbd1('0x1d')]);}return _0x1708cd[_0xcbd1('0x4a')](_0x547056);}})[_0xcbd1('0x27')](function(_0x39668f){if(_0x39668f){return _0x39668f?{'count':_0xad7c33,'rows':_0x39668f}:null;}})['then'](respondWithResult(_0x422f30,null))[_0xcbd1('0x45')](handleError(_0x422f30,null));};exports[_0xcbd1('0x4d')]=function(_0x15eca5,_0x168a56,_0x2d6b6f){if(_0x15eca5[_0xcbd1('0x49')]['id']){delete _0x15eca5[_0xcbd1('0x49')]['id'];}return db[_0xcbd1('0x43')][_0xcbd1('0x4e')]({'where':{'id':_0x15eca5[_0xcbd1('0x4b')]['id']}})[_0xcbd1('0x27')](handleEntityNotFound(_0x168a56,null))[_0xcbd1('0x27')](function(_0x3669da){if(_0x3669da){_0x15eca5[_0xcbd1('0x49')][_0xcbd1('0x4f')]=_0x3669da['id'];_0x15eca5[_0xcbd1('0x49')][_0xcbd1('0x50')]=integrations[_0xcbd1('0x51')](_0x15eca5[_0xcbd1('0x49')][_0xcbd1('0x52')],_0x15eca5[_0xcbd1('0x49')][_0xcbd1('0x2e')]);_0x15eca5[_0xcbd1('0x49')]['Descriptions']=integrations['getDescriptions'](_0x15eca5[_0xcbd1('0x49')][_0xcbd1('0x52')],_0x15eca5[_0xcbd1('0x49')][_0xcbd1('0x2e')]);return db['DeskConfiguration'][_0xcbd1('0x48')](_0x15eca5['body'],{'include':[{'model':db['DeskField'],'as':_0xcbd1('0x50')},{'model':db['DeskField'],'as':_0xcbd1('0x53')}]});}return null;})[_0xcbd1('0x27')](respondWithResult(_0x168a56,null))[_0xcbd1('0x45')](handleError(_0x168a56,null));};exports[_0xcbd1('0x54')]=function(_0x2a231b,_0x25b9a8,_0x335038){var _0x5521d4=[{'name':_0xcbd1('0x55'),'label':_0xcbd1('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 _0x25cc85='';return db['DeskAccount']['findOne']({'where':{'id':_0x2a231b[_0xcbd1('0x4b')]['id']},'attributes':['id',_0xcbd1('0x56'),_0xcbd1('0x57'),_0xcbd1('0x58'),_0xcbd1('0x59'),_0xcbd1('0x5a'),_0xcbd1('0x5b'),_0xcbd1('0x5c'),'tokenSecret']})[_0xcbd1('0x27')](handleEntityNotFound(_0x25b9a8,null))[_0xcbd1('0x27')](function(_0x4563d9){if(_0x4563d9){_0x25cc85=_0x4563d9[_0xcbd1('0x56')];var _0x44776c=_0x25cc85['slice'](-0x1);if(_0x44776c==='/'){_0x25cc85=_0x25cc85['substring'](0x0,_0x25cc85[_0xcbd1('0x5d')](_0x44776c));}var _0x45b343={'method':'GET','uri':util[_0xcbd1('0x5e')](_0xcbd1('0x5f'),_0x25cc85),'headers':{'Content-Type':_0xcbd1('0x60'),'Accept':'application/json'},'json':!![]};if(_0x4563d9[_0xcbd1('0x57')]==='basic'){_0x45b343[_0xcbd1('0x61')]['Authorization']=util[_0xcbd1('0x5e')]('Basic\x20%s',new Buffer(util[_0xcbd1('0x5e')](_0xcbd1('0x62'),_0x4563d9[_0xcbd1('0x58')],_0x4563d9['password']))[_0xcbd1('0x63')](_0xcbd1('0x64')));}return rp(_0x45b343)[_0xcbd1('0x27')](function(_0x532b25){return _0x5521d4[_0xcbd1('0x65')](_[_0xcbd1('0x30')](_0x532b25['_embedded'][_0xcbd1('0x66')],function(_0x4ea1f2){return{'id':_0x4ea1f2[_0xcbd1('0x2a')],'name':_0x4ea1f2[_0xcbd1('0x2a')],'type':_0x4ea1f2['type'],'active':_0x4ea1f2[_0xcbd1('0x67')],'label':_0x4ea1f2[_0xcbd1('0x68')],'custom':!![]};}));});}})[_0xcbd1('0x27')](function(_0x2b068c){return{'count':_0x2b068c[_0xcbd1('0x37')],'rows':_0x2b068c};})['then'](respondWithResult(_0x25b9a8,null))[_0xcbd1('0x45')](function(_0x524481){var _0x51f1d7=_0x2a231b[_0xcbd1('0x31')]['test']?0x1f4:_0x524481[_0xcbd1('0x69')]||0x1f4;logger[_0xcbd1('0x6a')](_0xcbd1('0x6b'),_0xcbd1('0x54'),_0x51f1d7,JSON['stringify'](_0x524481));delete _0x524481[_0xcbd1('0x2a')];if(_0x51f1d7===0x191){_0x51f1d7=0x190;}_0x25b9a8[_0xcbd1('0x1c')](_0x51f1d7)[_0xcbd1('0x6c')](_0x2a231b[_0xcbd1('0x31')][_0xcbd1('0x6d')]?{'message':_0xcbd1('0x6e'),'statusCode':_0x524481[_0xcbd1('0x69')]}:_0x524481);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 202b4d3..45777f6 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 _0x4731=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x335a61,_0x21b879){var _0x48a02b=function(_0x2978a8){while(--_0x2978a8){_0x335a61['push'](_0x335a61['shift']());}};_0x48a02b(++_0x21b879);}(_0x4731,0x118));var _0x1473=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x4731[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var logger=require(_0x1473('0x2'))('api');var moment=require(_0x1473('0x3'));var BPromise=require('bluebird');var rp=require(_0x1473('0x4'));var fs=require('fs');var path=require(_0x1473('0x5'));var rimraf=require(_0x1473('0x6'));var config=require(_0x1473('0x7'));var attributes=require(_0x1473('0x8'));var integrations=require(_0x1473('0x9'));module[_0x1473('0xa')]=function(_0x1e4f00,_0x58bd6f){return _0x1e4f00['define']('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe00a=['api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','../../config/logger'];(function(_0xd22c48,_0x350cfe){var _0x48fa79=function(_0x43c895){while(--_0x43c895){_0xd22c48['push'](_0xd22c48['shift']());}};_0x48fa79(++_0x350cfe);}(_0xe00a,0x1ab));var _0xae00=function(_0x1b8b9c,_0x31dc20){_0x1b8b9c=_0x1b8b9c-0x0;var _0x25844a=_0xe00a[_0x1b8b9c];return _0x25844a;};'use strict';var _=require(_0xae00('0x0'));var util=require('util');var logger=require(_0xae00('0x1'))(_0xae00('0x2'));var moment=require(_0xae00('0x3'));var BPromise=require('bluebird');var rp=require(_0xae00('0x4'));var fs=require('fs');var path=require(_0xae00('0x5'));var rimraf=require(_0xae00('0x6'));var config=require(_0xae00('0x7'));var attributes=require(_0xae00('0x8'));var integrations=require(_0xae00('0x9'));module[_0xae00('0xa')]=function(_0x254f5e,_0x4b9858){return _0x254f5e['define'](_0xae00('0xb'),attributes,{'tableName':_0xae00('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index f705ea3..7b44b78 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 _0x9b92=['include','map','model','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x9b92,0xdd));var _0x29b9=function(_0x94e04c,_0x5752e3){_0x94e04c=_0x94e04c-0x0;var _0x3f9f6d=_0x9b92[_0x94e04c];return _0x3f9f6d;};'use strict';var _=require(_0x29b9('0x0'));var util=require(_0x29b9('0x1'));var moment=require(_0x29b9('0x2'));var BPromise=require(_0x29b9('0x3'));var rs=require(_0x29b9('0x4'));var fs=require('fs');var Redis=require(_0x29b9('0x5'));var db=require(_0x29b9('0x6'))['db'];var utils=require(_0x29b9('0x7'));var logger=require(_0x29b9('0x8'))(_0x29b9('0x9'));var config=require(_0x29b9('0xa'));var jayson=require(_0x29b9('0xb'));var client=jayson['client'][_0x29b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10c82b,_0x210590,_0x48d5c6){return new BPromise(function(_0x8a809,_0x5ad157){return client[_0x29b9('0xd')](_0x10c82b,_0x48d5c6)[_0x29b9('0xe')](function(_0x2d0c24){logger[_0x29b9('0xf')](_0x29b9('0x10'),_0x210590,'request\x20sent');logger[_0x29b9('0x11')](_0x29b9('0x12'),_0x210590,_0x29b9('0x13'),JSON[_0x29b9('0x14')](_0x2d0c24));if(_0x2d0c24['error']){if(_0x2d0c24['error']['code']===0x1f4){logger[_0x29b9('0x15')]('DeskAccount,\x20%s,\x20%s',_0x210590,_0x2d0c24[_0x29b9('0x15')][_0x29b9('0x16')]);return _0x5ad157(_0x2d0c24[_0x29b9('0x15')][_0x29b9('0x16')]);}logger[_0x29b9('0x15')](_0x29b9('0x10'),_0x210590,_0x2d0c24[_0x29b9('0x15')][_0x29b9('0x16')]);return _0x8a809(_0x2d0c24[_0x29b9('0x15')]['message']);}else{logger['info'](_0x29b9('0x10'),_0x210590,_0x29b9('0x13'));_0x8a809(_0x2d0c24[_0x29b9('0x17')][_0x29b9('0x16')]);}})[_0x29b9('0x18')](function(_0x15bc1b){logger[_0x29b9('0x15')](_0x29b9('0x10'),_0x210590,_0x15bc1b);_0x5ad157(_0x15bc1b);});});}exports[_0x29b9('0x19')]=function(_0x2828e8){var _0x21cff8=this;return new Promise(function(_0x56c0e6,_0x40b20a){return db[_0x29b9('0x1a')]['findAll']({'raw':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')]['where']||null:null,'attributes':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1d')]||null:null,'limit':_0x2828e8['options']?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1e')]||null:null,'include':_0x2828e8[_0x29b9('0x1b')]?_0x2828e8[_0x29b9('0x1b')][_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x2828e8[_0x29b9('0x1b')]['include'],function(_0x5c8f1e){return{'model':db[_0x5c8f1e[_0x29b9('0x21')]],'as':_0x5c8f1e['as'],'attributes':_0x5c8f1e[_0x29b9('0x1d')],'include':_0x5c8f1e['include']?_[_0x29b9('0x20')](_0x5c8f1e[_0x29b9('0x1f')],function(_0x182078){return{'model':db[_0x182078['model']],'as':_0x182078['as'],'attributes':_0x182078[_0x29b9('0x1d')],'include':_0x182078[_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x182078[_0x29b9('0x1f')],function(_0x49422c){return{'model':db[_0x49422c['model']],'as':_0x49422c['as'],'attributes':_0x49422c[_0x29b9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x29b9('0xe')](function(_0x15c122){logger[_0x29b9('0xf')]('GetDeskAccount',_0x2828e8);logger[_0x29b9('0x11')](_0x29b9('0x19'),_0x2828e8,JSON[_0x29b9('0x14')](_0x15c122));_0x56c0e6(_0x15c122);})[_0x29b9('0x18')](function(_0x5b4ac6){logger['error'](_0x29b9('0x19'),_0x5b4ac6['message'],_0x2828e8);_0x40b20a(_0x21cff8['error'](0x1f4,_0x5b4ac6[_0x29b9('0x16')]));});});};exports[_0x29b9('0x22')]=function(_0x59f1a7){var _0x1b06fd=this;return new Promise(function(_0x5e6484,_0x4379e2){return db[_0x29b9('0x1a')][_0x29b9('0x23')]({'raw':_0x59f1a7['options']?_0x59f1a7['options'][_0x29b9('0x1c')]===undefined?!![]:![]:!![],'where':_0x59f1a7[_0x29b9('0x1b')]?_0x59f1a7['options']['where']||null:null,'attributes':_0x59f1a7[_0x29b9('0x1b')]?_0x59f1a7[_0x29b9('0x1b')]['attributes']||null:null,'include':_0x59f1a7[_0x29b9('0x1b')]?_0x59f1a7[_0x29b9('0x1b')]['include']?_[_0x29b9('0x20')](_0x59f1a7[_0x29b9('0x1b')][_0x29b9('0x1f')],function(_0x14d6b0){return{'model':db[_0x14d6b0[_0x29b9('0x21')]],'as':_0x14d6b0['as'],'attributes':_0x14d6b0['attributes'],'include':_0x14d6b0[_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x14d6b0[_0x29b9('0x1f')],function(_0x5a53b1){return{'model':db[_0x5a53b1[_0x29b9('0x21')]],'as':_0x5a53b1['as'],'attributes':_0x5a53b1[_0x29b9('0x1d')],'include':_0x5a53b1[_0x29b9('0x1f')]?_[_0x29b9('0x20')](_0x5a53b1[_0x29b9('0x1f')],function(_0x884164){return{'model':db[_0x884164[_0x29b9('0x21')]],'as':_0x884164['as'],'attributes':_0x884164[_0x29b9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x29b9('0xe')](function(_0x56cc43){logger['info'](_0x29b9('0x22'),_0x59f1a7);logger[_0x29b9('0x11')]('ShowDeskAccount',_0x59f1a7,JSON[_0x29b9('0x14')](_0x56cc43));_0x5e6484(_0x56cc43);})[_0x29b9('0x18')](function(_0x45e433){logger[_0x29b9('0x15')](_0x29b9('0x22'),_0x45e433[_0x29b9('0x16')],_0x59f1a7);_0x4379e2(_0x1b06fd[_0x29b9('0x15')](0x1f4,_0x45e433[_0x29b9('0x16')]));});});}; \ No newline at end of file +var _0x8065=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','DeskAccount','find','raw','ShowDeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x153dd4,_0x45c990){var _0x24b6f8=function(_0x3c1f21){while(--_0x3c1f21){_0x153dd4['push'](_0x153dd4['shift']());}};_0x24b6f8(++_0x45c990);}(_0x8065,0x1ce));var _0x5806=function(_0x2a1349,_0x50602d){_0x2a1349=_0x2a1349-0x0;var _0x2dd607=_0x8065[_0x2a1349];return _0x2dd607;};'use strict';var _=require('lodash');var util=require(_0x5806('0x0'));var moment=require(_0x5806('0x1'));var BPromise=require(_0x5806('0x2'));var rs=require(_0x5806('0x3'));var fs=require('fs');var Redis=require(_0x5806('0x4'));var db=require(_0x5806('0x5'))['db'];var utils=require(_0x5806('0x6'));var logger=require(_0x5806('0x7'))(_0x5806('0x8'));var config=require(_0x5806('0x9'));var jayson=require(_0x5806('0xa'));var client=jayson[_0x5806('0xb')][_0x5806('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c236d,_0x395603,_0x4190f1){return new BPromise(function(_0x370a30,_0x5c5e9a){return client[_0x5806('0xd')](_0x4c236d,_0x4190f1)[_0x5806('0xe')](function(_0x39f35d){logger[_0x5806('0xf')](_0x5806('0x10'),_0x395603,_0x5806('0x11'));logger[_0x5806('0x12')](_0x5806('0x13'),_0x395603,_0x5806('0x11'),JSON[_0x5806('0x14')](_0x39f35d));if(_0x39f35d[_0x5806('0x15')]){if(_0x39f35d['error'][_0x5806('0x16')]===0x1f4){logger['error'](_0x5806('0x10'),_0x395603,_0x39f35d['error'][_0x5806('0x17')]);return _0x5c5e9a(_0x39f35d[_0x5806('0x15')][_0x5806('0x17')]);}logger[_0x5806('0x15')](_0x5806('0x10'),_0x395603,_0x39f35d['error'][_0x5806('0x17')]);return _0x370a30(_0x39f35d['error']['message']);}else{logger[_0x5806('0xf')](_0x5806('0x10'),_0x395603,_0x5806('0x11'));_0x370a30(_0x39f35d[_0x5806('0x18')][_0x5806('0x17')]);}})['catch'](function(_0x129de2){logger[_0x5806('0x15')](_0x5806('0x10'),_0x395603,_0x129de2);_0x5c5e9a(_0x129de2);});});}exports[_0x5806('0x19')]=function(_0x5775ee){var _0x550089=this;return new Promise(function(_0xe49f6c,_0x5bb943){return db['DeskAccount'][_0x5806('0x1a')]({'raw':_0x5775ee[_0x5806('0x1b')]?_0x5775ee[_0x5806('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5775ee[_0x5806('0x1b')]?_0x5775ee[_0x5806('0x1b')][_0x5806('0x1c')]||null:null,'attributes':_0x5775ee[_0x5806('0x1b')]?_0x5775ee['options'][_0x5806('0x1d')]||null:null,'limit':_0x5775ee['options']?_0x5775ee[_0x5806('0x1b')][_0x5806('0x1e')]||null:null,'include':_0x5775ee[_0x5806('0x1b')]?_0x5775ee['options'][_0x5806('0x1f')]?_[_0x5806('0x20')](_0x5775ee[_0x5806('0x1b')]['include'],function(_0xe56c74){return{'model':db[_0xe56c74[_0x5806('0x21')]],'as':_0xe56c74['as'],'attributes':_0xe56c74[_0x5806('0x1d')],'include':_0xe56c74[_0x5806('0x1f')]?_[_0x5806('0x20')](_0xe56c74[_0x5806('0x1f')],function(_0x105db4){return{'model':db[_0x105db4['model']],'as':_0x105db4['as'],'attributes':_0x105db4[_0x5806('0x1d')],'include':_0x105db4[_0x5806('0x1f')]?_[_0x5806('0x20')](_0x105db4[_0x5806('0x1f')],function(_0xb2c015){return{'model':db[_0xb2c015['model']],'as':_0xb2c015['as'],'attributes':_0xb2c015[_0x5806('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5806('0xe')](function(_0x50f47a){logger['info'](_0x5806('0x19'),_0x5775ee);logger[_0x5806('0x12')](_0x5806('0x19'),_0x5775ee,JSON[_0x5806('0x14')](_0x50f47a));_0xe49f6c(_0x50f47a);})[_0x5806('0x22')](function(_0x42ea07){logger[_0x5806('0x15')]('GetDeskAccount',_0x42ea07[_0x5806('0x17')],_0x5775ee);_0x5bb943(_0x550089[_0x5806('0x15')](0x1f4,_0x42ea07[_0x5806('0x17')]));});});};exports['ShowDeskAccount']=function(_0x49e0c9){var _0x5e1c41=this;return new Promise(function(_0x1763a4,_0x45b8dd){return db[_0x5806('0x23')][_0x5806('0x24')]({'raw':_0x49e0c9[_0x5806('0x1b')]?_0x49e0c9['options'][_0x5806('0x25')]===undefined?!![]:![]:!![],'where':_0x49e0c9[_0x5806('0x1b')]?_0x49e0c9[_0x5806('0x1b')][_0x5806('0x1c')]||null:null,'attributes':_0x49e0c9[_0x5806('0x1b')]?_0x49e0c9[_0x5806('0x1b')][_0x5806('0x1d')]||null:null,'include':_0x49e0c9[_0x5806('0x1b')]?_0x49e0c9[_0x5806('0x1b')][_0x5806('0x1f')]?_[_0x5806('0x20')](_0x49e0c9[_0x5806('0x1b')][_0x5806('0x1f')],function(_0x4dfe75){return{'model':db[_0x4dfe75[_0x5806('0x21')]],'as':_0x4dfe75['as'],'attributes':_0x4dfe75[_0x5806('0x1d')],'include':_0x4dfe75['include']?_['map'](_0x4dfe75[_0x5806('0x1f')],function(_0x323b02){return{'model':db[_0x323b02[_0x5806('0x21')]],'as':_0x323b02['as'],'attributes':_0x323b02[_0x5806('0x1d')],'include':_0x323b02[_0x5806('0x1f')]?_[_0x5806('0x20')](_0x323b02[_0x5806('0x1f')],function(_0x2750cb){return{'model':db[_0x2750cb[_0x5806('0x21')]],'as':_0x2750cb['as'],'attributes':_0x2750cb[_0x5806('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5806('0xe')](function(_0x40d5b8){logger['info'](_0x5806('0x26'),_0x49e0c9);logger[_0x5806('0x12')]('ShowDeskAccount',_0x49e0c9,JSON['stringify'](_0x40d5b8));_0x1763a4(_0x40d5b8);})[_0x5806('0x22')](function(_0x5d1d15){logger['error'](_0x5806('0x26'),_0x5d1d15['message'],_0x49e0c9);_0x45b8dd(_0x5e1c41[_0x5806('0x15')](0x1f4,_0x5d1d15[_0x5806('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index ff5cfe7..29265aa 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x168374,_0x3f4156){var _0x406865=function(_0x42e8e2){while(--_0x42e8e2){_0x168374['push'](_0x168374['shift']());}};_0x406865(++_0x3f4156);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +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(_0x35f64d,_0x39977f){var _0x594c05=function(_0xd64e2b){while(--_0xd64e2b){_0x35f64d['push'](_0x35f64d['shift']());}};_0x594c05(++_0x39977f);}(_0xedd9,0xfc));var _0x9edd=function(_0xb0c522,_0x3b60d1){_0xb0c522=_0xb0c522-0x0;var _0x468364=_0xedd9[_0xb0c522];return _0x468364;};'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 3afc95a..b3c5d6e 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 _0x5b1e=['sequelize','STRING'];(function(_0xd8768,_0x3fedcb){var _0x46228f=function(_0x65a836){while(--_0x65a836){_0xd8768['push'](_0xd8768['shift']());}};_0x46228f(++_0x3fedcb);}(_0x5b1e,0x1bc));var _0xe5b1=function(_0x2b82b0,_0x5b5ec1){_0x2b82b0=_0x2b82b0-0x0;var _0x47483d=_0x5b1e[_0x2b82b0];return _0x47483d;};'use strict';var Sequelize=require(_0xe5b1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe5b1('0x1')]}}; \ No newline at end of file +var _0x8e1f=['sequelize','STRING'];(function(_0x12a111,_0x1eec41){var _0x1b56c4=function(_0x45588a){while(--_0x45588a){_0x12a111['push'](_0x12a111['shift']());}};_0x1b56c4(++_0x1eec41);}(_0x8e1f,0x6a));var _0xf8e1=function(_0x26a0d4,_0x4e402e){_0x26a0d4=_0x26a0d4-0x0;var _0x2302e6=_0x8e1f[_0x26a0d4];return _0x2302e6;};'use strict';var Sequelize=require(_0xf8e1('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8e1('0x1')]},'description':{'type':Sequelize[_0xf8e1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 53ac312..da3f422 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 _0x0f85=['squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','sendStatus','name','send','index','map','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','DeskConfiguration','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','DeskField','getFields','hasOwnProperty','nolimit','findOne','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','moment','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x2cee71,_0x1cf994){var _0x4da250=function(_0x295baf){while(--_0x295baf){_0x2cee71['push'](_0x2cee71['shift']());}};_0x4da250(++_0x1cf994);}(_0x0f85,0x186));var _0x50f8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0f85[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x50f8('0x0'));var rimraf=require(_0x50f8('0x1'));var zipdir=require(_0x50f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x50f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x50f8('0x4'));var util=require(_0x50f8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x50f8('0x6'));var ejs=require(_0x50f8('0x7'));var fs=require('fs');var fs_extra=require(_0x50f8('0x8'));var _=require(_0x50f8('0x9'));var squel=require(_0x50f8('0xa'));var crypto=require(_0x50f8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50f8('0xc'));var Papa=require(_0x50f8('0xd'));var Redis=require(_0x50f8('0xe'));var authService=require(_0x50f8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x50f8('0x10'));var hardwareService=require(_0x50f8('0x11'));var logger=require(_0x50f8('0x12'))('api');var utils=require(_0x50f8('0x13'));var config=require(_0x50f8('0x14'));var licenseUtil=require(_0x50f8('0x15'));var db=require(_0x50f8('0x16'))['db'];function respondWithStatusCode(_0x992918,_0x135964){_0x135964=_0x135964||0xcc;return function(_0x1a3455){if(_0x1a3455){return _0x992918['sendStatus'](_0x135964);}return _0x992918[_0x50f8('0x17')](_0x135964)[_0x50f8('0x18')]();};}function respondWithResult(_0x4a017b,_0x53767a){_0x53767a=_0x53767a||0xc8;return function(_0x8f5e8){if(_0x8f5e8){return _0x4a017b['status'](_0x53767a)[_0x50f8('0x19')](_0x8f5e8);}};}function respondWithFilteredResult(_0x2a411d,_0x2aab17){return function(_0x20340b){if(_0x20340b){var _0x45b249=typeof _0x2aab17[_0x50f8('0x1a')]===_0x50f8('0x1b')&&typeof _0x2aab17[_0x50f8('0x1c')]===_0x50f8('0x1b');var _0x28c4f6=_0x20340b[_0x50f8('0x1d')];var _0x4eb46e=_0x45b249?0x0:_0x2aab17['offset'];var _0x357c5d=_0x45b249?_0x20340b[_0x50f8('0x1d')]:_0x2aab17[_0x50f8('0x1a')]+_0x2aab17[_0x50f8('0x1c')];var _0x455d89;if(_0x357c5d>=_0x28c4f6){_0x357c5d=_0x28c4f6;_0x455d89=0xc8;}else{_0x455d89=0xce;}_0x2a411d[_0x50f8('0x17')](_0x455d89);return _0x2a411d[_0x50f8('0x1e')](_0x50f8('0x1f'),_0x4eb46e+'-'+_0x357c5d+'/'+_0x28c4f6)[_0x50f8('0x19')](_0x20340b);}return null;};}function patchUpdates(_0xc775ab){return function(_0x35ad95){try{jsonpatch[_0x50f8('0x20')](_0x35ad95,_0xc775ab,!![]);}catch(_0xac21c0){return BPromise['reject'](_0xac21c0);}return _0x35ad95['save']();};}function saveUpdates(_0x168d9f,_0x8da00c){return function(_0x4dc4eb){if(_0x4dc4eb){return _0x4dc4eb['update'](_0x168d9f)[_0x50f8('0x21')](function(_0x473ba5){return _0x473ba5;});}return null;};}function removeEntity(_0x5b086d,_0x524918){return function(_0x6ede21){if(_0x6ede21){return _0x6ede21[_0x50f8('0x22')]()[_0x50f8('0x21')](function(){_0x5b086d[_0x50f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed5ee1,_0x566bdf){return function(_0x5f4c06){if(!_0x5f4c06){_0xed5ee1[_0x50f8('0x23')](0x194);}return _0x5f4c06;};}function handleError(_0x2166ad,_0x38e0db){_0x38e0db=_0x38e0db||0x1f4;return function(_0x3fef8f){logger['error'](_0x3fef8f['stack']);if(_0x3fef8f[_0x50f8('0x24')]){delete _0x3fef8f[_0x50f8('0x24')];}_0x2166ad[_0x50f8('0x17')](_0x38e0db)[_0x50f8('0x25')](_0x3fef8f);};}exports[_0x50f8('0x26')]=function(_0x1593bc,_0x13f40b){var _0x2f7d78={},_0x3775ce={},_0x4bd428={'count':0x0,'rows':[]};var _0x5a884e=_[_0x50f8('0x27')](db['DeskConfiguration']['rawAttributes'],function(_0x482cb5){return{'name':_0x482cb5[_0x50f8('0x28')],'type':_0x482cb5['type'][_0x50f8('0x29')]};});_0x3775ce['model']=_[_0x50f8('0x27')](_0x5a884e,_0x50f8('0x24'));_0x3775ce['query']=_[_0x50f8('0x2a')](_0x1593bc[_0x50f8('0x2b')]);_0x3775ce[_0x50f8('0x2c')]=_['intersection'](_0x3775ce[_0x50f8('0x2d')],_0x3775ce['query']);_0x2f7d78[_0x50f8('0x2e')]=_[_0x50f8('0x2f')](_0x3775ce[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x2f7d78['attributes']=_0x2f7d78[_0x50f8('0x2e')][_0x50f8('0x31')]?_0x2f7d78[_0x50f8('0x2e')]:_0x3775ce[_0x50f8('0x2d')];if(!_0x1593bc[_0x50f8('0x2b')]['hasOwnProperty']('nolimit')){_0x2f7d78[_0x50f8('0x1c')]=qs[_0x50f8('0x1c')](_0x1593bc['query'][_0x50f8('0x1c')]);_0x2f7d78['offset']=qs[_0x50f8('0x1a')](_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x1a')]);}_0x2f7d78[_0x50f8('0x32')]=qs[_0x50f8('0x33')](_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x33')]);_0x2f7d78[_0x50f8('0x34')]=qs[_0x50f8('0x2c')](_[_0x50f8('0x35')](_0x1593bc[_0x50f8('0x2b')],_0x3775ce['filters']),_0x5a884e);if(_0x1593bc['query']['filter']){_0x2f7d78[_0x50f8('0x34')]=_[_0x50f8('0x36')](_0x2f7d78[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x5a884e,function(_0x19eb81){if(_0x19eb81['type']!==_0x50f8('0x37')){var _0x588261={};_0x588261[_0x19eb81[_0x50f8('0x24')]]={'$like':'%'+_0x1593bc[_0x50f8('0x2b')][_0x50f8('0x38')]+'%'};return _0x588261;}})});}_0x2f7d78=_[_0x50f8('0x36')]({},_0x2f7d78,_0x1593bc[_0x50f8('0x39')]);var _0x3c2fe6={'where':_0x2f7d78[_0x50f8('0x34')]};return db[_0x50f8('0x3a')][_0x50f8('0x1d')](_0x3c2fe6)[_0x50f8('0x21')](function(_0x45b634){_0x4bd428[_0x50f8('0x1d')]=_0x45b634;if(_0x1593bc['query']['includeAll']){_0x2f7d78['include']=[{'all':!![]}];}return db[_0x50f8('0x3a')][_0x50f8('0x3b')](_0x2f7d78);})['then'](function(_0x51ceca){_0x4bd428[_0x50f8('0x3c')]=_0x51ceca;return _0x4bd428;})[_0x50f8('0x21')](respondWithFilteredResult(_0x13f40b,_0x2f7d78))[_0x50f8('0x3d')](handleError(_0x13f40b,null));};exports[_0x50f8('0x3e')]=function(_0x5a8b23,_0x16bff0){var _0x4ab369={'raw':![],'where':{'id':_0x5a8b23['params']['id']}},_0x323949={};_0x323949[_0x50f8('0x2d')]=_['keys'](db[_0x50f8('0x3a')][_0x50f8('0x3f')]);_0x323949[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0x5a8b23[_0x50f8('0x2b')]);_0x323949[_0x50f8('0x2c')]=_[_0x50f8('0x2f')](_0x323949[_0x50f8('0x2d')],_0x323949[_0x50f8('0x2b')]);_0x4ab369[_0x50f8('0x2e')]=_['intersection'](_0x323949[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x5a8b23[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x4ab369['attributes']=_0x4ab369['attributes'][_0x50f8('0x31')]?_0x4ab369[_0x50f8('0x2e')]:_0x323949[_0x50f8('0x2d')];if(_0x5a8b23[_0x50f8('0x2b')][_0x50f8('0x40')]){_0x4ab369[_0x50f8('0x41')]=[{'all':!![]}];}_0x4ab369=_[_0x50f8('0x36')]({},_0x4ab369,_0x5a8b23[_0x50f8('0x39')]);return db['DeskConfiguration'][_0x50f8('0x42')](_0x4ab369)[_0x50f8('0x21')](handleEntityNotFound(_0x16bff0,null))[_0x50f8('0x21')](respondWithResult(_0x16bff0,null))[_0x50f8('0x3d')](handleError(_0x16bff0,null));};exports[_0x50f8('0x43')]=function(_0x362633,_0x377e01){return db[_0x50f8('0x3a')][_0x50f8('0x43')](_0x362633[_0x50f8('0x44')],{})[_0x50f8('0x21')](respondWithResult(_0x377e01,0xc9))[_0x50f8('0x3d')](handleError(_0x377e01,null));};exports['update']=function(_0x1cca51,_0xfb7112){if(_0x1cca51[_0x50f8('0x44')]['id']){delete _0x1cca51[_0x50f8('0x44')]['id'];}return db[_0x50f8('0x3a')]['find']({'where':{'id':_0x1cca51[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0xfb7112,null))[_0x50f8('0x21')](saveUpdates(_0x1cca51[_0x50f8('0x44')],null))['then'](respondWithResult(_0xfb7112,null))[_0x50f8('0x3d')](handleError(_0xfb7112,null));};exports[_0x50f8('0x22')]=function(_0x1307ae,_0xe97ea0){return db['DeskConfiguration'][_0x50f8('0x42')]({'where':{'id':_0x1307ae['params']['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0xe97ea0,null))[_0x50f8('0x21')](removeEntity(_0xe97ea0,null))[_0x50f8('0x3d')](handleError(_0xe97ea0,null));};exports['getFields']=function(_0x2d6c25,_0x5c5862,_0x3ba389){var _0x117488={};var _0x49047e={};var _0x2f7e40;var _0x31caf7;return db[_0x50f8('0x3a')]['findOne']({'where':{'id':_0x2d6c25[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x5c5862,null))['then'](function(_0x12e0a9){if(_0x12e0a9){_0x2f7e40=_0x12e0a9;_0x49047e[_0x50f8('0x2d')]=_[_0x50f8('0x2a')](db[_0x50f8('0x46')][_0x50f8('0x3f')]);_0x49047e[_0x50f8('0x2b')]=_['keys'](_0x2d6c25[_0x50f8('0x2b')]);_0x49047e[_0x50f8('0x2c')]=_[_0x50f8('0x2f')](_0x49047e[_0x50f8('0x2d')],_0x49047e[_0x50f8('0x2b')]);_0x117488['attributes']=_[_0x50f8('0x2f')](_0x49047e[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x2d6c25[_0x50f8('0x2b')]['fields']));_0x117488[_0x50f8('0x2e')]=_0x117488[_0x50f8('0x2e')]['length']?_0x117488[_0x50f8('0x2e')]:_0x49047e[_0x50f8('0x2d')];_0x117488[_0x50f8('0x32')]=qs['sort'](_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x33')]);_0x117488['where']=qs[_0x50f8('0x2c')](_[_0x50f8('0x35')](_0x2d6c25[_0x50f8('0x2b')],_0x49047e[_0x50f8('0x2c')]));if(_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x38')]){_0x117488[_0x50f8('0x34')]=_['merge'](_0x117488[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x117488[_0x50f8('0x2e')],function(_0x5ef56d){var _0x4d11de={};_0x4d11de[_0x5ef56d]={'$like':'%'+_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x38')]+'%'};return _0x4d11de;})});}_0x117488=_[_0x50f8('0x36')]({},_0x117488,_0x2d6c25[_0x50f8('0x39')]);return _0x2f7e40[_0x50f8('0x47')](_0x117488);}})[_0x50f8('0x21')](function(_0x31987e){if(_0x31987e){_0x31caf7=_0x31987e['length'];if(!_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x48')](_0x50f8('0x49'))){_0x117488['limit']=qs[_0x50f8('0x1c')](_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x1c')]);_0x117488[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0x2d6c25[_0x50f8('0x2b')][_0x50f8('0x1a')]);}return _0x2f7e40[_0x50f8('0x47')](_0x117488);}})[_0x50f8('0x21')](function(_0x570bce){if(_0x570bce){return _0x570bce?{'count':_0x31caf7,'rows':_0x570bce}:null;}})[_0x50f8('0x21')](respondWithResult(_0x5c5862,null))[_0x50f8('0x3d')](handleError(_0x5c5862,null));};exports['getSubjects']=function(_0x188b0e,_0x41f4a2,_0x540e17){var _0x3e5caf={};var _0x1f1a15={};var _0x461d01;var _0x296021;return db[_0x50f8('0x3a')][_0x50f8('0x4a')]({'where':{'id':_0x188b0e[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x41f4a2,null))[_0x50f8('0x21')](function(_0x56515c){if(_0x56515c){_0x461d01=_0x56515c;_0x1f1a15[_0x50f8('0x2d')]=_[_0x50f8('0x2a')](db['DeskField'][_0x50f8('0x3f')]);_0x1f1a15[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0x188b0e[_0x50f8('0x2b')]);_0x1f1a15[_0x50f8('0x2c')]=_['intersection'](_0x1f1a15[_0x50f8('0x2d')],_0x1f1a15['query']);_0x3e5caf['attributes']=_['intersection'](_0x1f1a15['model'],qs[_0x50f8('0x30')](_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x3e5caf[_0x50f8('0x2e')]=_0x3e5caf['attributes'][_0x50f8('0x31')]?_0x3e5caf['attributes']:_0x1f1a15[_0x50f8('0x2d')];_0x3e5caf[_0x50f8('0x32')]=qs['sort'](_0x188b0e[_0x50f8('0x2b')]['sort']);_0x3e5caf[_0x50f8('0x34')]=qs['filters'](_[_0x50f8('0x35')](_0x188b0e['query'],_0x1f1a15[_0x50f8('0x2c')]));if(_0x188b0e['query'][_0x50f8('0x38')]){_0x3e5caf['where']=_['merge'](_0x3e5caf[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x3e5caf['attributes'],function(_0x5969f3){var _0x56147f={};_0x56147f[_0x5969f3]={'$like':'%'+_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x38')]+'%'};return _0x56147f;})});}_0x3e5caf=_['merge']({},_0x3e5caf,_0x188b0e[_0x50f8('0x39')]);return _0x461d01[_0x50f8('0x4b')](_0x3e5caf);}})['then'](function(_0x38563d){if(_0x38563d){_0x296021=_0x38563d[_0x50f8('0x31')];if(!_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x48')]('nolimit')){_0x3e5caf['limit']=qs[_0x50f8('0x1c')](_0x188b0e[_0x50f8('0x2b')]['limit']);_0x3e5caf[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0x188b0e[_0x50f8('0x2b')][_0x50f8('0x1a')]);}return _0x461d01[_0x50f8('0x4b')](_0x3e5caf);}})[_0x50f8('0x21')](function(_0x2c890f){if(_0x2c890f){return _0x2c890f?{'count':_0x296021,'rows':_0x2c890f}:null;}})[_0x50f8('0x21')](respondWithResult(_0x41f4a2,null))['catch'](handleError(_0x41f4a2,null));};exports[_0x50f8('0x4c')]=function(_0x2b3256,_0x568fa1,_0xf2aba2){var _0x153e90={};var _0x33859a={};var _0x7bda58;var _0x24edab;return db['DeskConfiguration'][_0x50f8('0x4a')]({'where':{'id':_0x2b3256[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x568fa1,null))[_0x50f8('0x21')](function(_0x4c032a){if(_0x4c032a){_0x7bda58=_0x4c032a;_0x33859a[_0x50f8('0x2d')]=_['keys'](db[_0x50f8('0x46')][_0x50f8('0x3f')]);_0x33859a[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0x2b3256['query']);_0x33859a[_0x50f8('0x2c')]=_[_0x50f8('0x2f')](_0x33859a['model'],_0x33859a[_0x50f8('0x2b')]);_0x153e90[_0x50f8('0x2e')]=_[_0x50f8('0x2f')](_0x33859a[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x153e90[_0x50f8('0x2e')]=_0x153e90['attributes'][_0x50f8('0x31')]?_0x153e90[_0x50f8('0x2e')]:_0x33859a['model'];_0x153e90[_0x50f8('0x32')]=qs[_0x50f8('0x33')](_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x33')]);_0x153e90['where']=qs['filters'](_['pick'](_0x2b3256['query'],_0x33859a['filters']));if(_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x38')]){_0x153e90[_0x50f8('0x34')]=_[_0x50f8('0x36')](_0x153e90['where'],{'$or':_[_0x50f8('0x27')](_0x153e90[_0x50f8('0x2e')],function(_0x5ec7e3){var _0x49d354={};_0x49d354[_0x5ec7e3]={'$like':'%'+_0x2b3256[_0x50f8('0x2b')]['filter']+'%'};return _0x49d354;})});}_0x153e90=_[_0x50f8('0x36')]({},_0x153e90,_0x2b3256['options']);return _0x7bda58[_0x50f8('0x4c')](_0x153e90);}})[_0x50f8('0x21')](function(_0x3673a1){if(_0x3673a1){_0x24edab=_0x3673a1['length'];if(!_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x48')](_0x50f8('0x49'))){_0x153e90[_0x50f8('0x1c')]=qs['limit'](_0x2b3256[_0x50f8('0x2b')][_0x50f8('0x1c')]);_0x153e90[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0x2b3256['query'][_0x50f8('0x1a')]);}return _0x7bda58[_0x50f8('0x4c')](_0x153e90);}})[_0x50f8('0x21')](function(_0x1c11bf){if(_0x1c11bf){return _0x1c11bf?{'count':_0x24edab,'rows':_0x1c11bf}:null;}})[_0x50f8('0x21')](respondWithResult(_0x568fa1,null))[_0x50f8('0x3d')](handleError(_0x568fa1,null));};exports[_0x50f8('0x4d')]=function(_0xdac624,_0x3b58a5,_0x260289){var _0x35c038={};var _0x406a7f={};var _0x4ed5a6;var _0x3543e5;return db['DeskConfiguration'][_0x50f8('0x4a')]({'where':{'id':_0xdac624[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x3b58a5,null))[_0x50f8('0x21')](function(_0x27ab66){if(_0x27ab66){_0x4ed5a6=_0x27ab66;_0x406a7f[_0x50f8('0x2d')]=_[_0x50f8('0x2a')](db['Tag'][_0x50f8('0x3f')]);_0x406a7f[_0x50f8('0x2b')]=_[_0x50f8('0x2a')](_0xdac624[_0x50f8('0x2b')]);_0x406a7f[_0x50f8('0x2c')]=_['intersection'](_0x406a7f['model'],_0x406a7f['query']);_0x35c038[_0x50f8('0x2e')]=_['intersection'](_0x406a7f[_0x50f8('0x2d')],qs[_0x50f8('0x30')](_0xdac624[_0x50f8('0x2b')][_0x50f8('0x30')]));_0x35c038[_0x50f8('0x2e')]=_0x35c038[_0x50f8('0x2e')][_0x50f8('0x31')]?_0x35c038[_0x50f8('0x2e')]:_0x406a7f['model'];_0x35c038[_0x50f8('0x32')]=qs[_0x50f8('0x33')](_0xdac624['query'][_0x50f8('0x33')]);_0x35c038[_0x50f8('0x34')]=qs[_0x50f8('0x2c')](_[_0x50f8('0x35')](_0xdac624[_0x50f8('0x2b')],_0x406a7f[_0x50f8('0x2c')]));if(_0xdac624[_0x50f8('0x2b')][_0x50f8('0x38')]){_0x35c038['where']=_['merge'](_0x35c038[_0x50f8('0x34')],{'$or':_[_0x50f8('0x27')](_0x35c038[_0x50f8('0x2e')],function(_0x2717aa){var _0x355eb5={};_0x355eb5[_0x2717aa]={'$like':'%'+_0xdac624[_0x50f8('0x2b')]['filter']+'%'};return _0x355eb5;})});}_0x35c038=_['merge']({},_0x35c038,_0xdac624[_0x50f8('0x39')]);return _0x4ed5a6[_0x50f8('0x4d')](_0x35c038);}})['then'](function(_0x45b993){if(_0x45b993){_0x3543e5=_0x45b993[_0x50f8('0x31')];if(!_0xdac624[_0x50f8('0x2b')][_0x50f8('0x48')](_0x50f8('0x49'))){_0x35c038[_0x50f8('0x1c')]=qs['limit'](_0xdac624[_0x50f8('0x2b')][_0x50f8('0x1c')]);_0x35c038[_0x50f8('0x1a')]=qs[_0x50f8('0x1a')](_0xdac624['query'][_0x50f8('0x1a')]);}return _0x4ed5a6['getTags'](_0x35c038);}})['then'](function(_0x8fd9fe){if(_0x8fd9fe){return _0x8fd9fe?{'count':_0x3543e5,'rows':_0x8fd9fe}:null;}})[_0x50f8('0x21')](respondWithResult(_0x3b58a5,null))[_0x50f8('0x3d')](handleError(_0x3b58a5,null));};exports[_0x50f8('0x4e')]=function(_0x384d37,_0x870a92,_0x28539f){if(_0x384d37[_0x50f8('0x44')]['id']){delete _0x384d37[_0x50f8('0x44')]['id'];}return db['DeskConfiguration'][_0x50f8('0x4a')]({'where':{'id':_0x384d37[_0x50f8('0x45')]['id']}})[_0x50f8('0x21')](handleEntityNotFound(_0x870a92,null))['then'](function(_0x10c6d7){if(_0x10c6d7){return _0x10c6d7[_0x50f8('0x4e')](_0x384d37['body'][_0x50f8('0x4f')]||[]);}return null;})[_0x50f8('0x21')](respondWithResult(_0x870a92,null))['catch'](handleError(_0x870a92,null));}; \ No newline at end of file +var _0xb4b4=['findOne','DeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','DeskConfiguration','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getFields'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0xb4b4,0x10e));var _0x4b4b=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xb4b4[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0x4b4b('0x0'));var rimraf=require(_0x4b4b('0x1'));var zipdir=require(_0x4b4b('0x2'));var jsonpatch=require(_0x4b4b('0x3'));var rp=require(_0x4b4b('0x4'));var moment=require(_0x4b4b('0x5'));var BPromise=require(_0x4b4b('0x6'));var Mustache=require(_0x4b4b('0x7'));var util=require(_0x4b4b('0x8'));var path=require(_0x4b4b('0x9'));var sox=require(_0x4b4b('0xa'));var csv=require(_0x4b4b('0xb'));var ejs=require(_0x4b4b('0xc'));var fs=require('fs');var fs_extra=require(_0x4b4b('0xd'));var _=require('lodash');var squel=require(_0x4b4b('0xe'));var crypto=require(_0x4b4b('0xf'));var jsforce=require(_0x4b4b('0x10'));var deskjs=require(_0x4b4b('0x11'));var toCsv=require(_0x4b4b('0xb'));var querystring=require('querystring');var Papa=require(_0x4b4b('0x12'));var Redis=require('ioredis');var authService=require(_0x4b4b('0x13'));var qs=require(_0x4b4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b4b('0x15'));var logger=require(_0x4b4b('0x16'))(_0x4b4b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b4b('0x18'));var db=require(_0x4b4b('0x19'))['db'];function respondWithStatusCode(_0x686c86,_0x280e09){_0x280e09=_0x280e09||0xcc;return function(_0x3db4e4){if(_0x3db4e4){return _0x686c86[_0x4b4b('0x1a')](_0x280e09);}return _0x686c86[_0x4b4b('0x1b')](_0x280e09)[_0x4b4b('0x1c')]();};}function respondWithResult(_0x1e1d54,_0x562e3a){_0x562e3a=_0x562e3a||0xc8;return function(_0x43af38){if(_0x43af38){return _0x1e1d54[_0x4b4b('0x1b')](_0x562e3a)[_0x4b4b('0x1d')](_0x43af38);}};}function respondWithFilteredResult(_0x26dbe,_0xe897e2){return function(_0x497757){if(_0x497757){var _0x1c36c7=typeof _0xe897e2['offset']===_0x4b4b('0x1e')&&typeof _0xe897e2[_0x4b4b('0x1f')]==='undefined';var _0x2a143a=_0x497757[_0x4b4b('0x20')];var _0x4da6ba=_0x1c36c7?0x0:_0xe897e2[_0x4b4b('0x21')];var _0x241e21=_0x1c36c7?_0x497757[_0x4b4b('0x20')]:_0xe897e2[_0x4b4b('0x21')]+_0xe897e2['limit'];var _0x242775;if(_0x241e21>=_0x2a143a){_0x241e21=_0x2a143a;_0x242775=0xc8;}else{_0x242775=0xce;}_0x26dbe[_0x4b4b('0x1b')](_0x242775);return _0x26dbe[_0x4b4b('0x22')](_0x4b4b('0x23'),_0x4da6ba+'-'+_0x241e21+'/'+_0x2a143a)['json'](_0x497757);}return null;};}function patchUpdates(_0xec3bb3){return function(_0x47d5e4){try{jsonpatch['apply'](_0x47d5e4,_0xec3bb3,!![]);}catch(_0x1dd3e6){return BPromise['reject'](_0x1dd3e6);}return _0x47d5e4['save']();};}function saveUpdates(_0x5853f4,_0x238858){return function(_0x14fb70){if(_0x14fb70){return _0x14fb70[_0x4b4b('0x24')](_0x5853f4)[_0x4b4b('0x25')](function(_0x1f991d){return _0x1f991d;});}return null;};}function removeEntity(_0x20e016,_0x5ed1a4){return function(_0x1d8536){if(_0x1d8536){return _0x1d8536[_0x4b4b('0x26')]()[_0x4b4b('0x25')](function(){_0x20e016[_0x4b4b('0x1b')](0xcc)[_0x4b4b('0x1c')]();});}};}function handleEntityNotFound(_0x39e786,_0x3523c4){return function(_0x54318f){if(!_0x54318f){_0x39e786[_0x4b4b('0x1a')](0x194);}return _0x54318f;};}function handleError(_0x41d56f,_0x5d18d2){_0x5d18d2=_0x5d18d2||0x1f4;return function(_0x43227b){logger[_0x4b4b('0x27')](_0x43227b[_0x4b4b('0x28')]);if(_0x43227b[_0x4b4b('0x29')]){delete _0x43227b['name'];}_0x41d56f[_0x4b4b('0x1b')](_0x5d18d2)[_0x4b4b('0x2a')](_0x43227b);};}exports[_0x4b4b('0x2b')]=function(_0x534896,_0x302b33){var _0x5dfcb7={},_0xd37d17={},_0x4518a1={'count':0x0,'rows':[]};var _0x513fe2=_[_0x4b4b('0x2c')](db['DeskConfiguration']['rawAttributes'],function(_0xf2fb9d){return{'name':_0xf2fb9d[_0x4b4b('0x2d')],'type':_0xf2fb9d['type'][_0x4b4b('0x2e')]};});_0xd37d17[_0x4b4b('0x2f')]=_[_0x4b4b('0x2c')](_0x513fe2,_0x4b4b('0x29'));_0xd37d17[_0x4b4b('0x30')]=_[_0x4b4b('0x31')](_0x534896[_0x4b4b('0x30')]);_0xd37d17[_0x4b4b('0x32')]=_['intersection'](_0xd37d17[_0x4b4b('0x2f')],_0xd37d17[_0x4b4b('0x30')]);_0x5dfcb7['attributes']=_[_0x4b4b('0x33')](_0xd37d17['model'],qs[_0x4b4b('0x34')](_0x534896[_0x4b4b('0x30')][_0x4b4b('0x34')]));_0x5dfcb7[_0x4b4b('0x35')]=_0x5dfcb7['attributes'][_0x4b4b('0x36')]?_0x5dfcb7[_0x4b4b('0x35')]:_0xd37d17[_0x4b4b('0x2f')];if(!_0x534896['query']['hasOwnProperty'](_0x4b4b('0x37'))){_0x5dfcb7[_0x4b4b('0x1f')]=qs[_0x4b4b('0x1f')](_0x534896[_0x4b4b('0x30')][_0x4b4b('0x1f')]);_0x5dfcb7['offset']=qs['offset'](_0x534896['query'][_0x4b4b('0x21')]);}_0x5dfcb7[_0x4b4b('0x38')]=qs['sort'](_0x534896[_0x4b4b('0x30')][_0x4b4b('0x39')]);_0x5dfcb7[_0x4b4b('0x3a')]=qs['filters'](_[_0x4b4b('0x3b')](_0x534896[_0x4b4b('0x30')],_0xd37d17[_0x4b4b('0x32')]),_0x513fe2);if(_0x534896['query'][_0x4b4b('0x3c')]){_0x5dfcb7[_0x4b4b('0x3a')]=_[_0x4b4b('0x3d')](_0x5dfcb7[_0x4b4b('0x3a')],{'$or':_[_0x4b4b('0x2c')](_0x513fe2,function(_0x80dbda){if(_0x80dbda[_0x4b4b('0x3e')]!==_0x4b4b('0x3f')){var _0x15c05c={};_0x15c05c[_0x80dbda[_0x4b4b('0x29')]]={'$like':'%'+_0x534896[_0x4b4b('0x30')][_0x4b4b('0x3c')]+'%'};return _0x15c05c;}})});}_0x5dfcb7=_[_0x4b4b('0x3d')]({},_0x5dfcb7,_0x534896[_0x4b4b('0x40')]);var _0x297ad0={'where':_0x5dfcb7[_0x4b4b('0x3a')]};return db[_0x4b4b('0x41')][_0x4b4b('0x20')](_0x297ad0)[_0x4b4b('0x25')](function(_0x589760){_0x4518a1['count']=_0x589760;if(_0x534896[_0x4b4b('0x30')][_0x4b4b('0x42')]){_0x5dfcb7['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x4b4b('0x43')](_0x5dfcb7);})[_0x4b4b('0x25')](function(_0x1601ca){_0x4518a1[_0x4b4b('0x44')]=_0x1601ca;return _0x4518a1;})[_0x4b4b('0x25')](respondWithFilteredResult(_0x302b33,_0x5dfcb7))[_0x4b4b('0x45')](handleError(_0x302b33,null));};exports[_0x4b4b('0x46')]=function(_0x4b0aef,_0x1c95c4){var _0x3e5b38={'raw':![],'where':{'id':_0x4b0aef['params']['id']}},_0xbd75d9={};_0xbd75d9[_0x4b4b('0x2f')]=_[_0x4b4b('0x31')](db[_0x4b4b('0x41')][_0x4b4b('0x47')]);_0xbd75d9[_0x4b4b('0x30')]=_[_0x4b4b('0x31')](_0x4b0aef['query']);_0xbd75d9[_0x4b4b('0x32')]=_[_0x4b4b('0x33')](_0xbd75d9[_0x4b4b('0x2f')],_0xbd75d9[_0x4b4b('0x30')]);_0x3e5b38[_0x4b4b('0x35')]=_[_0x4b4b('0x33')](_0xbd75d9[_0x4b4b('0x2f')],qs[_0x4b4b('0x34')](_0x4b0aef[_0x4b4b('0x30')][_0x4b4b('0x34')]));_0x3e5b38[_0x4b4b('0x35')]=_0x3e5b38['attributes'][_0x4b4b('0x36')]?_0x3e5b38[_0x4b4b('0x35')]:_0xbd75d9['model'];if(_0x4b0aef[_0x4b4b('0x30')][_0x4b4b('0x42')]){_0x3e5b38[_0x4b4b('0x48')]=[{'all':!![]}];}_0x3e5b38=_[_0x4b4b('0x3d')]({},_0x3e5b38,_0x4b0aef[_0x4b4b('0x40')]);return db[_0x4b4b('0x41')][_0x4b4b('0x49')](_0x3e5b38)['then'](handleEntityNotFound(_0x1c95c4,null))[_0x4b4b('0x25')](respondWithResult(_0x1c95c4,null))[_0x4b4b('0x45')](handleError(_0x1c95c4,null));};exports['create']=function(_0x553bc7,_0x4ea109){return db[_0x4b4b('0x41')][_0x4b4b('0x4a')](_0x553bc7[_0x4b4b('0x4b')],{})[_0x4b4b('0x25')](respondWithResult(_0x4ea109,0xc9))['catch'](handleError(_0x4ea109,null));};exports[_0x4b4b('0x24')]=function(_0x4f9443,_0x591047){if(_0x4f9443[_0x4b4b('0x4b')]['id']){delete _0x4f9443[_0x4b4b('0x4b')]['id'];}return db[_0x4b4b('0x41')][_0x4b4b('0x49')]({'where':{'id':_0x4f9443[_0x4b4b('0x4c')]['id']}})[_0x4b4b('0x25')](handleEntityNotFound(_0x591047,null))[_0x4b4b('0x25')](saveUpdates(_0x4f9443[_0x4b4b('0x4b')],null))[_0x4b4b('0x25')](respondWithResult(_0x591047,null))['catch'](handleError(_0x591047,null));};exports[_0x4b4b('0x26')]=function(_0x5e4a8d,_0x5e720e){return db[_0x4b4b('0x41')][_0x4b4b('0x49')]({'where':{'id':_0x5e4a8d['params']['id']}})['then'](handleEntityNotFound(_0x5e720e,null))[_0x4b4b('0x25')](removeEntity(_0x5e720e,null))['catch'](handleError(_0x5e720e,null));};exports[_0x4b4b('0x4d')]=function(_0x5a4cac,_0x1b3d45,_0x597374){var _0x13654c={};var _0x4ecd17={};var _0x1d32fa;var _0x4ef821;return db['DeskConfiguration'][_0x4b4b('0x4e')]({'where':{'id':_0x5a4cac[_0x4b4b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1b3d45,null))['then'](function(_0x209af4){if(_0x209af4){_0x1d32fa=_0x209af4;_0x4ecd17['model']=_['keys'](db[_0x4b4b('0x4f')][_0x4b4b('0x47')]);_0x4ecd17[_0x4b4b('0x30')]=_[_0x4b4b('0x31')](_0x5a4cac[_0x4b4b('0x30')]);_0x4ecd17[_0x4b4b('0x32')]=_['intersection'](_0x4ecd17[_0x4b4b('0x2f')],_0x4ecd17[_0x4b4b('0x30')]);_0x13654c[_0x4b4b('0x35')]=_[_0x4b4b('0x33')](_0x4ecd17[_0x4b4b('0x2f')],qs[_0x4b4b('0x34')](_0x5a4cac[_0x4b4b('0x30')][_0x4b4b('0x34')]));_0x13654c[_0x4b4b('0x35')]=_0x13654c[_0x4b4b('0x35')][_0x4b4b('0x36')]?_0x13654c['attributes']:_0x4ecd17['model'];_0x13654c[_0x4b4b('0x38')]=qs['sort'](_0x5a4cac['query'][_0x4b4b('0x39')]);_0x13654c[_0x4b4b('0x3a')]=qs[_0x4b4b('0x32')](_[_0x4b4b('0x3b')](_0x5a4cac['query'],_0x4ecd17[_0x4b4b('0x32')]));if(_0x5a4cac[_0x4b4b('0x30')][_0x4b4b('0x3c')]){_0x13654c[_0x4b4b('0x3a')]=_[_0x4b4b('0x3d')](_0x13654c['where'],{'$or':_[_0x4b4b('0x2c')](_0x13654c[_0x4b4b('0x35')],function(_0x90899c){var _0x1dc013={};_0x1dc013[_0x90899c]={'$like':'%'+_0x5a4cac[_0x4b4b('0x30')]['filter']+'%'};return _0x1dc013;})});}_0x13654c=_[_0x4b4b('0x3d')]({},_0x13654c,_0x5a4cac[_0x4b4b('0x40')]);return _0x1d32fa[_0x4b4b('0x4d')](_0x13654c);}})['then'](function(_0x219560){if(_0x219560){_0x4ef821=_0x219560['length'];if(!_0x5a4cac[_0x4b4b('0x30')][_0x4b4b('0x50')](_0x4b4b('0x37'))){_0x13654c[_0x4b4b('0x1f')]=qs[_0x4b4b('0x1f')](_0x5a4cac[_0x4b4b('0x30')][_0x4b4b('0x1f')]);_0x13654c[_0x4b4b('0x21')]=qs[_0x4b4b('0x21')](_0x5a4cac[_0x4b4b('0x30')]['offset']);}return _0x1d32fa['getFields'](_0x13654c);}})[_0x4b4b('0x25')](function(_0xd1796c){if(_0xd1796c){return _0xd1796c?{'count':_0x4ef821,'rows':_0xd1796c}:null;}})[_0x4b4b('0x25')](respondWithResult(_0x1b3d45,null))[_0x4b4b('0x45')](handleError(_0x1b3d45,null));};exports[_0x4b4b('0x51')]=function(_0x193410,_0x1ef070,_0x5ae62c){var _0x1036f1={};var _0x269dbb={};var _0x189ed2;var _0x2a4c76;return db[_0x4b4b('0x41')][_0x4b4b('0x4e')]({'where':{'id':_0x193410['params']['id']}})['then'](handleEntityNotFound(_0x1ef070,null))[_0x4b4b('0x25')](function(_0xbf9c1d){if(_0xbf9c1d){_0x189ed2=_0xbf9c1d;_0x269dbb[_0x4b4b('0x2f')]=_[_0x4b4b('0x31')](db[_0x4b4b('0x4f')][_0x4b4b('0x47')]);_0x269dbb[_0x4b4b('0x30')]=_[_0x4b4b('0x31')](_0x193410['query']);_0x269dbb[_0x4b4b('0x32')]=_['intersection'](_0x269dbb[_0x4b4b('0x2f')],_0x269dbb[_0x4b4b('0x30')]);_0x1036f1[_0x4b4b('0x35')]=_['intersection'](_0x269dbb[_0x4b4b('0x2f')],qs[_0x4b4b('0x34')](_0x193410['query'][_0x4b4b('0x34')]));_0x1036f1[_0x4b4b('0x35')]=_0x1036f1[_0x4b4b('0x35')][_0x4b4b('0x36')]?_0x1036f1['attributes']:_0x269dbb['model'];_0x1036f1['order']=qs[_0x4b4b('0x39')](_0x193410[_0x4b4b('0x30')]['sort']);_0x1036f1['where']=qs[_0x4b4b('0x32')](_[_0x4b4b('0x3b')](_0x193410['query'],_0x269dbb[_0x4b4b('0x32')]));if(_0x193410[_0x4b4b('0x30')][_0x4b4b('0x3c')]){_0x1036f1[_0x4b4b('0x3a')]=_[_0x4b4b('0x3d')](_0x1036f1[_0x4b4b('0x3a')],{'$or':_['map'](_0x1036f1[_0x4b4b('0x35')],function(_0xc39850){var _0x2e1e90={};_0x2e1e90[_0xc39850]={'$like':'%'+_0x193410[_0x4b4b('0x30')][_0x4b4b('0x3c')]+'%'};return _0x2e1e90;})});}_0x1036f1=_[_0x4b4b('0x3d')]({},_0x1036f1,_0x193410[_0x4b4b('0x40')]);return _0x189ed2['getSubjects'](_0x1036f1);}})[_0x4b4b('0x25')](function(_0x59cd87){if(_0x59cd87){_0x2a4c76=_0x59cd87[_0x4b4b('0x36')];if(!_0x193410['query']['hasOwnProperty']('nolimit')){_0x1036f1[_0x4b4b('0x1f')]=qs[_0x4b4b('0x1f')](_0x193410[_0x4b4b('0x30')][_0x4b4b('0x1f')]);_0x1036f1['offset']=qs[_0x4b4b('0x21')](_0x193410[_0x4b4b('0x30')][_0x4b4b('0x21')]);}return _0x189ed2[_0x4b4b('0x51')](_0x1036f1);}})[_0x4b4b('0x25')](function(_0xa18522){if(_0xa18522){return _0xa18522?{'count':_0x2a4c76,'rows':_0xa18522}:null;}})['then'](respondWithResult(_0x1ef070,null))['catch'](handleError(_0x1ef070,null));};exports[_0x4b4b('0x52')]=function(_0xb9e23e,_0x1065d2,_0x459d9b){var _0xf55a97={};var _0x1724a7={};var _0x25a08c;var _0x50e542;return db[_0x4b4b('0x41')][_0x4b4b('0x4e')]({'where':{'id':_0xb9e23e[_0x4b4b('0x4c')]['id']}})[_0x4b4b('0x25')](handleEntityNotFound(_0x1065d2,null))[_0x4b4b('0x25')](function(_0x5b9ae8){if(_0x5b9ae8){_0x25a08c=_0x5b9ae8;_0x1724a7[_0x4b4b('0x2f')]=_[_0x4b4b('0x31')](db['DeskField'][_0x4b4b('0x47')]);_0x1724a7[_0x4b4b('0x30')]=_['keys'](_0xb9e23e[_0x4b4b('0x30')]);_0x1724a7[_0x4b4b('0x32')]=_[_0x4b4b('0x33')](_0x1724a7[_0x4b4b('0x2f')],_0x1724a7[_0x4b4b('0x30')]);_0xf55a97['attributes']=_['intersection'](_0x1724a7[_0x4b4b('0x2f')],qs[_0x4b4b('0x34')](_0xb9e23e[_0x4b4b('0x30')][_0x4b4b('0x34')]));_0xf55a97[_0x4b4b('0x35')]=_0xf55a97[_0x4b4b('0x35')][_0x4b4b('0x36')]?_0xf55a97[_0x4b4b('0x35')]:_0x1724a7[_0x4b4b('0x2f')];_0xf55a97[_0x4b4b('0x38')]=qs[_0x4b4b('0x39')](_0xb9e23e[_0x4b4b('0x30')]['sort']);_0xf55a97['where']=qs['filters'](_['pick'](_0xb9e23e[_0x4b4b('0x30')],_0x1724a7[_0x4b4b('0x32')]));if(_0xb9e23e[_0x4b4b('0x30')][_0x4b4b('0x3c')]){_0xf55a97[_0x4b4b('0x3a')]=_[_0x4b4b('0x3d')](_0xf55a97[_0x4b4b('0x3a')],{'$or':_[_0x4b4b('0x2c')](_0xf55a97['attributes'],function(_0xdf1f2f){var _0x587e64={};_0x587e64[_0xdf1f2f]={'$like':'%'+_0xb9e23e[_0x4b4b('0x30')]['filter']+'%'};return _0x587e64;})});}_0xf55a97=_[_0x4b4b('0x3d')]({},_0xf55a97,_0xb9e23e[_0x4b4b('0x40')]);return _0x25a08c['getDescriptions'](_0xf55a97);}})[_0x4b4b('0x25')](function(_0x366fb3){if(_0x366fb3){_0x50e542=_0x366fb3[_0x4b4b('0x36')];if(!_0xb9e23e[_0x4b4b('0x30')][_0x4b4b('0x50')](_0x4b4b('0x37'))){_0xf55a97[_0x4b4b('0x1f')]=qs[_0x4b4b('0x1f')](_0xb9e23e[_0x4b4b('0x30')][_0x4b4b('0x1f')]);_0xf55a97['offset']=qs[_0x4b4b('0x21')](_0xb9e23e[_0x4b4b('0x30')][_0x4b4b('0x21')]);}return _0x25a08c[_0x4b4b('0x52')](_0xf55a97);}})[_0x4b4b('0x25')](function(_0x29d4be){if(_0x29d4be){return _0x29d4be?{'count':_0x50e542,'rows':_0x29d4be}:null;}})[_0x4b4b('0x25')](respondWithResult(_0x1065d2,null))[_0x4b4b('0x45')](handleError(_0x1065d2,null));};exports[_0x4b4b('0x53')]=function(_0x21cba3,_0x37001a,_0x2263cf){var _0x3dbc16={};var _0x45a129={};var _0x3c3dee;var _0x5c6506;return db['DeskConfiguration'][_0x4b4b('0x4e')]({'where':{'id':_0x21cba3[_0x4b4b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37001a,null))[_0x4b4b('0x25')](function(_0x254a87){if(_0x254a87){_0x3c3dee=_0x254a87;_0x45a129[_0x4b4b('0x2f')]=_[_0x4b4b('0x31')](db[_0x4b4b('0x54')]['rawAttributes']);_0x45a129[_0x4b4b('0x30')]=_[_0x4b4b('0x31')](_0x21cba3[_0x4b4b('0x30')]);_0x45a129[_0x4b4b('0x32')]=_[_0x4b4b('0x33')](_0x45a129[_0x4b4b('0x2f')],_0x45a129[_0x4b4b('0x30')]);_0x3dbc16['attributes']=_[_0x4b4b('0x33')](_0x45a129[_0x4b4b('0x2f')],qs[_0x4b4b('0x34')](_0x21cba3[_0x4b4b('0x30')][_0x4b4b('0x34')]));_0x3dbc16[_0x4b4b('0x35')]=_0x3dbc16[_0x4b4b('0x35')][_0x4b4b('0x36')]?_0x3dbc16[_0x4b4b('0x35')]:_0x45a129['model'];_0x3dbc16[_0x4b4b('0x38')]=qs[_0x4b4b('0x39')](_0x21cba3['query']['sort']);_0x3dbc16[_0x4b4b('0x3a')]=qs[_0x4b4b('0x32')](_['pick'](_0x21cba3['query'],_0x45a129[_0x4b4b('0x32')]));if(_0x21cba3[_0x4b4b('0x30')][_0x4b4b('0x3c')]){_0x3dbc16[_0x4b4b('0x3a')]=_[_0x4b4b('0x3d')](_0x3dbc16[_0x4b4b('0x3a')],{'$or':_[_0x4b4b('0x2c')](_0x3dbc16[_0x4b4b('0x35')],function(_0x5f5cd8){var _0x1318c7={};_0x1318c7[_0x5f5cd8]={'$like':'%'+_0x21cba3[_0x4b4b('0x30')][_0x4b4b('0x3c')]+'%'};return _0x1318c7;})});}_0x3dbc16=_['merge']({},_0x3dbc16,_0x21cba3[_0x4b4b('0x40')]);return _0x3c3dee['getTags'](_0x3dbc16);}})[_0x4b4b('0x25')](function(_0x3f57f0){if(_0x3f57f0){_0x5c6506=_0x3f57f0[_0x4b4b('0x36')];if(!_0x21cba3[_0x4b4b('0x30')]['hasOwnProperty'](_0x4b4b('0x37'))){_0x3dbc16[_0x4b4b('0x1f')]=qs[_0x4b4b('0x1f')](_0x21cba3['query'][_0x4b4b('0x1f')]);_0x3dbc16['offset']=qs[_0x4b4b('0x21')](_0x21cba3[_0x4b4b('0x30')]['offset']);}return _0x3c3dee[_0x4b4b('0x53')](_0x3dbc16);}})[_0x4b4b('0x25')](function(_0x28e50b){if(_0x28e50b){return _0x28e50b?{'count':_0x5c6506,'rows':_0x28e50b}:null;}})['then'](respondWithResult(_0x37001a,null))['catch'](handleError(_0x37001a,null));};exports['setTags']=function(_0x4f72e8,_0x337b93,_0x40b703){if(_0x4f72e8[_0x4b4b('0x4b')]['id']){delete _0x4f72e8[_0x4b4b('0x4b')]['id'];}return db[_0x4b4b('0x41')][_0x4b4b('0x4e')]({'where':{'id':_0x4f72e8[_0x4b4b('0x4c')]['id']}})[_0x4b4b('0x25')](handleEntityNotFound(_0x337b93,null))[_0x4b4b('0x25')](function(_0x4c53e8){if(_0x4c53e8){return _0x4c53e8[_0x4b4b('0x55')](_0x4f72e8[_0x4b4b('0x4b')][_0x4b4b('0x56')]||[]);}return null;})[_0x4b4b('0x25')](respondWithResult(_0x337b93,null))[_0x4b4b('0x45')](handleError(_0x337b93,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7115aa3..bf4f52e 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 _0x883e=['./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x10acc2,_0x381818){var _0x5159f0=function(_0x272676){while(--_0x272676){_0x10acc2['push'](_0x10acc2['shift']());}};_0x5159f0(++_0x381818);}(_0x883e,0xd0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require(_0xe883('0x1'));var logger=require(_0xe883('0x2'))('api');var moment=require(_0xe883('0x3'));var BPromise=require(_0xe883('0x4'));var rp=require(_0xe883('0x5'));var fs=require('fs');var path=require(_0xe883('0x6'));var rimraf=require(_0xe883('0x7'));var config=require('../../config/environment');var attributes=require(_0xe883('0x8'));module['exports']=function(_0xfc9a5f,_0x2acbf0){return _0xfc9a5f[_0xe883('0x9')](_0xe883('0xa'),attributes,{'tableName':_0xe883('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab25=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1e7ead,_0x4dba3c){var _0x4f17af=function(_0x5e6eea){while(--_0x5e6eea){_0x1e7ead['push'](_0x1e7ead['shift']());}};_0x4f17af(++_0x4dba3c);}(_0xab25,0x1e7));var _0x5ab2=function(_0x328d5f,_0x96b5e5){_0x328d5f=_0x328d5f-0x0;var _0x396cbc=_0xab25[_0x328d5f];return _0x396cbc;};'use strict';var _=require(_0x5ab2('0x0'));var util=require(_0x5ab2('0x1'));var logger=require('../../config/logger')(_0x5ab2('0x2'));var moment=require(_0x5ab2('0x3'));var BPromise=require(_0x5ab2('0x4'));var rp=require(_0x5ab2('0x5'));var fs=require('fs');var path=require(_0x5ab2('0x6'));var rimraf=require('rimraf');var config=require(_0x5ab2('0x7'));var attributes=require(_0x5ab2('0x8'));module[_0x5ab2('0x9')]=function(_0x3eebb3,_0x2facaa){return _0x3eebb3[_0x5ab2('0xa')](_0x5ab2('0xb'),attributes,{'tableName':_0x5ab2('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 c8b319b..6567f6e 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 _0x7b77=['debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent'];(function(_0x3d27fb,_0x233f87){var _0x4d097b=function(_0x5a9828){while(--_0x5a9828){_0x3d27fb['push'](_0x3d27fb['shift']());}};_0x4d097b(++_0x233f87);}(_0x7b77,0x179));var _0x77b7=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7b77[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var moment=require(_0x77b7('0x2'));var BPromise=require(_0x77b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b7('0x4'));var db=require(_0x77b7('0x5'))['db'];var utils=require(_0x77b7('0x6'));var logger=require('../../config/logger')(_0x77b7('0x7'));var config=require(_0x77b7('0x8'));var jayson=require(_0x77b7('0x9'));var client=jayson[_0x77b7('0xa')][_0x77b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe3c16b,_0x5c9387,_0x39d8e4){return new BPromise(function(_0x32b8ab,_0x33d439){return client['request'](_0xe3c16b,_0x39d8e4)[_0x77b7('0xc')](function(_0x4cfd3f){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5c9387,_0x77b7('0xd'));logger[_0x77b7('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5c9387,_0x77b7('0xd'),JSON[_0x77b7('0xf')](_0x4cfd3f));if(_0x4cfd3f[_0x77b7('0x10')]){if(_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x11')]===0x1f4){logger[_0x77b7('0x10')](_0x77b7('0x12'),_0x5c9387,_0x4cfd3f['error'][_0x77b7('0x13')]);return _0x33d439(_0x4cfd3f[_0x77b7('0x10')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5c9387,_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x13')]);return _0x32b8ab(_0x4cfd3f[_0x77b7('0x10')][_0x77b7('0x13')]);}else{logger[_0x77b7('0x14')](_0x77b7('0x12'),_0x5c9387,'request\x20sent');_0x32b8ab(_0x4cfd3f[_0x77b7('0x15')][_0x77b7('0x13')]);}})[_0x77b7('0x16')](function(_0x2060df){logger[_0x77b7('0x10')](_0x77b7('0x12'),_0x5c9387,_0x2060df);_0x33d439(_0x2060df);});});} \ No newline at end of file +var _0xeda7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b2b75,_0x3c0844){var _0x34c82a=function(_0x7b607e){while(--_0x7b607e){_0x4b2b75['push'](_0x4b2b75['shift']());}};_0x34c82a(++_0x3c0844);}(_0xeda7,0x196));var _0x7eda=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xeda7[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var moment=require(_0x7eda('0x2'));var BPromise=require(_0x7eda('0x3'));var rs=require(_0x7eda('0x4'));var fs=require('fs');var Redis=require(_0x7eda('0x5'));var db=require(_0x7eda('0x6'))['db'];var utils=require(_0x7eda('0x7'));var logger=require(_0x7eda('0x8'))(_0x7eda('0x9'));var config=require(_0x7eda('0xa'));var jayson=require(_0x7eda('0xb'));var client=jayson[_0x7eda('0xc')][_0x7eda('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x314602,_0x839e38,_0x163427){return new BPromise(function(_0x2bc200,_0x11576a){return client[_0x7eda('0xe')](_0x314602,_0x163427)['then'](function(_0x29bce2){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x839e38,_0x7eda('0xf'));logger[_0x7eda('0x10')](_0x7eda('0x11'),_0x839e38,_0x7eda('0xf'),JSON['stringify'](_0x29bce2));if(_0x29bce2['error']){if(_0x29bce2[_0x7eda('0x12')][_0x7eda('0x13')]===0x1f4){logger[_0x7eda('0x12')](_0x7eda('0x14'),_0x839e38,_0x29bce2['error'][_0x7eda('0x15')]);return _0x11576a(_0x29bce2['error'][_0x7eda('0x15')]);}logger[_0x7eda('0x12')](_0x7eda('0x14'),_0x839e38,_0x29bce2[_0x7eda('0x12')][_0x7eda('0x15')]);return _0x2bc200(_0x29bce2[_0x7eda('0x12')][_0x7eda('0x15')]);}else{logger[_0x7eda('0x16')](_0x7eda('0x14'),_0x839e38,'request\x20sent');_0x2bc200(_0x29bce2['result'][_0x7eda('0x15')]);}})['catch'](function(_0x597ce9){logger[_0x7eda('0x12')](_0x7eda('0x14'),_0x839e38,_0x597ce9);_0x11576a(_0x597ce9);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4254061..6e51ae0 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 _0xe421=['post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4fc371,_0x242d20){var _0x2870ac=function(_0x5158f8){while(--_0x5158f8){_0x4fc371['push'](_0x4fc371['shift']());}};_0x2870ac(++_0x242d20);}(_0xe421,0x10f));var _0x1e42=function(_0x10fce1,_0x38c702){_0x10fce1=_0x10fce1-0x0;var _0x4f5c25=_0xe421[_0x10fce1];return _0x4f5c25;};'use strict';var multer=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var path=require('path');var timeout=require(_0x1e42('0x2'));var express=require(_0x1e42('0x3'));var router=express[_0x1e42('0x4')]();var fs_extra=require(_0x1e42('0x5'));var auth=require(_0x1e42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e42('0x7'));var controller=require(_0x1e42('0x8'));router[_0x1e42('0x9')]('/',auth[_0x1e42('0xa')](),controller[_0x1e42('0xb')]);router[_0x1e42('0x9')](_0x1e42('0xc'),auth[_0x1e42('0xa')](),controller[_0x1e42('0xd')]);router[_0x1e42('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1e42('0xc'),auth[_0x1e42('0xa')](),controller[_0x1e42('0xf')]);router[_0x1e42('0x10')](_0x1e42('0xc'),auth[_0x1e42('0xa')](),controller[_0x1e42('0x11')]);module[_0x1e42('0x12')]=router; \ No newline at end of file +var _0x3624=['put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','show','post'];(function(_0x49dc4a,_0x51a2d9){var _0x1f6464=function(_0x84cf86){while(--_0x84cf86){_0x49dc4a['push'](_0x49dc4a['shift']());}};_0x1f6464(++_0x51a2d9);}(_0x3624,0x152));var _0x4362=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x3624[_0x1e4a8e];return _0x5408f9;};'use strict';var multer=require(_0x4362('0x0'));var util=require(_0x4362('0x1'));var path=require(_0x4362('0x2'));var timeout=require(_0x4362('0x3'));var express=require(_0x4362('0x4'));var router=express[_0x4362('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4362('0x6'));var interaction=require(_0x4362('0x7'));var config=require(_0x4362('0x8'));var controller=require(_0x4362('0x9'));router[_0x4362('0xa')]('/',auth[_0x4362('0xb')](),controller['index']);router[_0x4362('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4362('0xc')]);router[_0x4362('0xd')]('/',auth[_0x4362('0xb')](),controller['create']);router[_0x4362('0xe')]('/:id',auth[_0x4362('0xb')](),controller[_0x4362('0xf')]);router['delete']('/:id',auth[_0x4362('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 61d90b4..6ca162f 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 _0xde5f=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xde5f,0xfc));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfde5('0x0'));module[_0xfde5('0x1')]={'type':{'type':Sequelize[_0xfde5('0x2')](_0xfde5('0x3'),_0xfde5('0x4'),_0xfde5('0x5'),_0xfde5('0x6'),_0xfde5('0x7')),'defaultValue':_0xfde5('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfde5('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xfde5('0x3'),_0xfde5('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xfde5('0x8')]},'idField':{'type':Sequelize[_0xfde5('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x15c2=['variable','customVariable','keyValue','STRING','sequelize','ENUM','string'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x15c2,0x66));var _0x215c=function(_0x1e660e,_0x522348){_0x1e660e=_0x1e660e-0x0;var _0x155339=_0x15c2[_0x1e660e];return _0x155339;};'use strict';var Sequelize=require(_0x215c('0x0'));module['exports']={'type':{'type':Sequelize[_0x215c('0x1')](_0x215c('0x2'),_0x215c('0x3'),_0x215c('0x4'),_0x215c('0x5'),'picklist'),'defaultValue':_0x215c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x215c('0x6')]},'keyType':{'type':Sequelize[_0x215c('0x1')]('string',_0x215c('0x3'),_0x215c('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x215c('0x6')]},'nameField':{'type':Sequelize[_0x215c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x215c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 178ff16..d2b44b4 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 _0x644f=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','then','destroy','error','name','index','DeskField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','create','body','update','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5d5f3b,_0x135fed){var _0x3d805d=function(_0x219149){while(--_0x219149){_0x5d5f3b['push'](_0x5d5f3b['shift']());}};_0x3d805d(++_0x135fed);}(_0x644f,0xc2));var _0xf644=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x644f[_0x43e4b3];return _0x10c655;};'use strict';var emlformat=require(_0xf644('0x0'));var rimraf=require(_0xf644('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf644('0x2'));var moment=require(_0xf644('0x3'));var BPromise=require(_0xf644('0x4'));var Mustache=require(_0xf644('0x5'));var util=require(_0xf644('0x6'));var path=require(_0xf644('0x7'));var sox=require(_0xf644('0x8'));var csv=require(_0xf644('0x9'));var ejs=require(_0xf644('0xa'));var fs=require('fs');var fs_extra=require(_0xf644('0xb'));var _=require(_0xf644('0xc'));var squel=require(_0xf644('0xd'));var crypto=require('crypto');var jsforce=require(_0xf644('0xe'));var deskjs=require(_0xf644('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf644('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf644('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf644('0x12'));var hardwareService=require(_0xf644('0x13'));var logger=require('../../config/logger')(_0xf644('0x14'));var utils=require(_0xf644('0x15'));var config=require(_0xf644('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf644('0x17'))['db'];function respondWithStatusCode(_0x301425,_0x516f19){_0x516f19=_0x516f19||0xcc;return function(_0x3678c9){if(_0x3678c9){return _0x301425[_0xf644('0x18')](_0x516f19);}return _0x301425['status'](_0x516f19)[_0xf644('0x19')]();};}function respondWithResult(_0x53497c,_0x228cf7){_0x228cf7=_0x228cf7||0xc8;return function(_0x14d787){if(_0x14d787){return _0x53497c['status'](_0x228cf7)[_0xf644('0x1a')](_0x14d787);}};}function respondWithFilteredResult(_0xc0182,_0x52f74a){return function(_0x5b0b81){if(_0x5b0b81){var _0x4c197b=typeof _0x52f74a['offset']===_0xf644('0x1b')&&typeof _0x52f74a[_0xf644('0x1c')]===_0xf644('0x1b');var _0x329bb9=_0x5b0b81['count'];var _0x5bd03c=_0x4c197b?0x0:_0x52f74a[_0xf644('0x1d')];var _0x4650b5=_0x4c197b?_0x5b0b81[_0xf644('0x1e')]:_0x52f74a[_0xf644('0x1d')]+_0x52f74a['limit'];var _0x4beeb0;if(_0x4650b5>=_0x329bb9){_0x4650b5=_0x329bb9;_0x4beeb0=0xc8;}else{_0x4beeb0=0xce;}_0xc0182[_0xf644('0x1f')](_0x4beeb0);return _0xc0182[_0xf644('0x20')](_0xf644('0x21'),_0x5bd03c+'-'+_0x4650b5+'/'+_0x329bb9)[_0xf644('0x1a')](_0x5b0b81);}return null;};}function patchUpdates(_0x29f81a){return function(_0x2bc954){try{jsonpatch[_0xf644('0x22')](_0x2bc954,_0x29f81a,!![]);}catch(_0x20c0fb){return BPromise['reject'](_0x20c0fb);}return _0x2bc954[_0xf644('0x23')]();};}function saveUpdates(_0x1c36b4,_0x2180c6){return function(_0x9f426c){if(_0x9f426c){return _0x9f426c['update'](_0x1c36b4)[_0xf644('0x24')](function(_0x3b863f){return _0x3b863f;});}return null;};}function removeEntity(_0x42b88b,_0x17b2c6){return function(_0xc2a8fc){if(_0xc2a8fc){return _0xc2a8fc[_0xf644('0x25')]()[_0xf644('0x24')](function(){_0x42b88b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22febe,_0x41b6a1){return function(_0xaeb4b){if(!_0xaeb4b){_0x22febe[_0xf644('0x18')](0x194);}return _0xaeb4b;};}function handleError(_0x329a02,_0x20d683){_0x20d683=_0x20d683||0x1f4;return function(_0x2b2882){logger[_0xf644('0x26')](_0x2b2882['stack']);if(_0x2b2882[_0xf644('0x27')]){delete _0x2b2882[_0xf644('0x27')];}_0x329a02['status'](_0x20d683)['send'](_0x2b2882);};}exports[_0xf644('0x28')]=function(_0x31343f,_0x16c745){var _0x3881e3={},_0x2bcb20={},_0x1ef501={'count':0x0,'rows':[]};var _0x2b9413=_['map'](db[_0xf644('0x29')][_0xf644('0x2a')],function(_0x4ad5ac){return{'name':_0x4ad5ac['fieldName'],'type':_0x4ad5ac[_0xf644('0x2b')][_0xf644('0x2c')]};});_0x2bcb20[_0xf644('0x2d')]=_[_0xf644('0x2e')](_0x2b9413,_0xf644('0x27'));_0x2bcb20[_0xf644('0x2f')]=_[_0xf644('0x30')](_0x31343f[_0xf644('0x2f')]);_0x2bcb20[_0xf644('0x31')]=_[_0xf644('0x32')](_0x2bcb20['model'],_0x2bcb20['query']);_0x3881e3[_0xf644('0x33')]=_[_0xf644('0x32')](_0x2bcb20[_0xf644('0x2d')],qs[_0xf644('0x34')](_0x31343f[_0xf644('0x2f')][_0xf644('0x34')]));_0x3881e3[_0xf644('0x33')]=_0x3881e3['attributes'][_0xf644('0x35')]?_0x3881e3['attributes']:_0x2bcb20['model'];if(!_0x31343f[_0xf644('0x2f')][_0xf644('0x36')](_0xf644('0x37'))){_0x3881e3['limit']=qs['limit'](_0x31343f[_0xf644('0x2f')][_0xf644('0x1c')]);_0x3881e3[_0xf644('0x1d')]=qs['offset'](_0x31343f[_0xf644('0x2f')][_0xf644('0x1d')]);}_0x3881e3['order']=qs[_0xf644('0x38')](_0x31343f[_0xf644('0x2f')][_0xf644('0x38')]);_0x3881e3[_0xf644('0x39')]=qs[_0xf644('0x31')](_[_0xf644('0x3a')](_0x31343f['query'],_0x2bcb20[_0xf644('0x31')]),_0x2b9413);if(_0x31343f['query'][_0xf644('0x3b')]){_0x3881e3[_0xf644('0x39')]=_[_0xf644('0x3c')](_0x3881e3[_0xf644('0x39')],{'$or':_[_0xf644('0x2e')](_0x2b9413,function(_0x60bec){if(_0x60bec['type']!==_0xf644('0x3d')){var _0x2b8781={};_0x2b8781[_0x60bec[_0xf644('0x27')]]={'$like':'%'+_0x31343f['query']['filter']+'%'};return _0x2b8781;}})});}_0x3881e3=_[_0xf644('0x3c')]({},_0x3881e3,_0x31343f[_0xf644('0x3e')]);var _0x11d879={'where':_0x3881e3[_0xf644('0x39')]};return db['DeskField'][_0xf644('0x1e')](_0x11d879)['then'](function(_0x10b861){_0x1ef501['count']=_0x10b861;if(_0x31343f[_0xf644('0x2f')][_0xf644('0x3f')]){_0x3881e3[_0xf644('0x40')]=[{'all':!![]}];}return db[_0xf644('0x29')]['findAll'](_0x3881e3);})[_0xf644('0x24')](function(_0x266bf4){_0x1ef501['rows']=_0x266bf4;return _0x1ef501;})[_0xf644('0x24')](respondWithFilteredResult(_0x16c745,_0x3881e3))[_0xf644('0x41')](handleError(_0x16c745,null));};exports['show']=function(_0x101f71,_0x5c2187){var _0x3f73c7={'raw':!![],'where':{'id':_0x101f71[_0xf644('0x42')]['id']}},_0x322f84={};_0x322f84[_0xf644('0x2d')]=_[_0xf644('0x30')](db['DeskField'][_0xf644('0x2a')]);_0x322f84[_0xf644('0x2f')]=_[_0xf644('0x30')](_0x101f71[_0xf644('0x2f')]);_0x322f84[_0xf644('0x31')]=_['intersection'](_0x322f84[_0xf644('0x2d')],_0x322f84[_0xf644('0x2f')]);_0x3f73c7[_0xf644('0x33')]=_['intersection'](_0x322f84[_0xf644('0x2d')],qs[_0xf644('0x34')](_0x101f71[_0xf644('0x2f')][_0xf644('0x34')]));_0x3f73c7['attributes']=_0x3f73c7['attributes'][_0xf644('0x35')]?_0x3f73c7[_0xf644('0x33')]:_0x322f84[_0xf644('0x2d')];if(_0x101f71[_0xf644('0x2f')]['includeAll']){_0x3f73c7['include']=[{'all':!![]}];}_0x3f73c7=_[_0xf644('0x3c')]({},_0x3f73c7,_0x101f71[_0xf644('0x3e')]);return db[_0xf644('0x29')]['find'](_0x3f73c7)[_0xf644('0x24')](handleEntityNotFound(_0x5c2187,null))[_0xf644('0x24')](respondWithResult(_0x5c2187,null))[_0xf644('0x41')](handleError(_0x5c2187,null));};exports[_0xf644('0x43')]=function(_0x184f30,_0x3a224b){return db[_0xf644('0x29')][_0xf644('0x43')](_0x184f30[_0xf644('0x44')],{})['then'](respondWithResult(_0x3a224b,0xc9))[_0xf644('0x41')](handleError(_0x3a224b,null));};exports[_0xf644('0x45')]=function(_0x1756bc,_0x212a99){if(_0x1756bc[_0xf644('0x44')]['id']){delete _0x1756bc[_0xf644('0x44')]['id'];}return db[_0xf644('0x29')]['find']({'where':{'id':_0x1756bc[_0xf644('0x42')]['id']}})[_0xf644('0x24')](handleEntityNotFound(_0x212a99,null))['then'](saveUpdates(_0x1756bc['body'],null))['then'](respondWithResult(_0x212a99,null))[_0xf644('0x41')](handleError(_0x212a99,null));};exports['destroy']=function(_0x3f1a46,_0x3df93f){return db['DeskField'][_0xf644('0x46')]({'where':{'id':_0x3f1a46[_0xf644('0x42')]['id']}})[_0xf644('0x24')](handleEntityNotFound(_0x3df93f,null))[_0xf644('0x24')](removeEntity(_0x3df93f,null))[_0xf644('0x41')](handleError(_0x3df93f,null));}; \ No newline at end of file +var _0x090a=['rows','catch','show','params','includeAll','find','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0x58053f,_0x121503){var _0x2c30c7=function(_0x4d3d73){while(--_0x4d3d73){_0x58053f['push'](_0x58053f['shift']());}};_0x2c30c7(++_0x121503);}(_0x090a,0x133));var _0xa090=function(_0x436c85,_0x79d3ab){_0x436c85=_0x436c85-0x0;var _0x3769a2=_0x090a[_0x436c85];return _0x3769a2;};'use strict';var emlformat=require(_0xa090('0x0'));var rimraf=require(_0xa090('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa090('0x2'));var rp=require(_0xa090('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa090('0x4'));var util=require('util');var path=require(_0xa090('0x5'));var sox=require(_0xa090('0x6'));var csv=require(_0xa090('0x7'));var ejs=require(_0xa090('0x8'));var fs=require('fs');var fs_extra=require(_0xa090('0x9'));var _=require(_0xa090('0xa'));var squel=require(_0xa090('0xb'));var crypto=require(_0xa090('0xc'));var jsforce=require(_0xa090('0xd'));var deskjs=require(_0xa090('0xe'));var toCsv=require(_0xa090('0x7'));var querystring=require(_0xa090('0xf'));var Papa=require(_0xa090('0x10'));var Redis=require(_0xa090('0x11'));var authService=require(_0xa090('0x12'));var qs=require(_0xa090('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa090('0x14'));var logger=require('../../config/logger')(_0xa090('0x15'));var utils=require(_0xa090('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa090('0x17'));var db=require(_0xa090('0x18'))['db'];function respondWithStatusCode(_0x46164a,_0x337aad){_0x337aad=_0x337aad||0xcc;return function(_0x168827){if(_0x168827){return _0x46164a[_0xa090('0x19')](_0x337aad);}return _0x46164a['status'](_0x337aad)[_0xa090('0x1a')]();};}function respondWithResult(_0x26d9c7,_0x1407d3){_0x1407d3=_0x1407d3||0xc8;return function(_0x25601e){if(_0x25601e){return _0x26d9c7[_0xa090('0x1b')](_0x1407d3)[_0xa090('0x1c')](_0x25601e);}};}function respondWithFilteredResult(_0xe1f5c9,_0x297e21){return function(_0x1a7314){if(_0x1a7314){var _0x48c5b2=typeof _0x297e21['offset']===_0xa090('0x1d')&&typeof _0x297e21[_0xa090('0x1e')]===_0xa090('0x1d');var _0xd3983=_0x1a7314['count'];var _0x2ad993=_0x48c5b2?0x0:_0x297e21[_0xa090('0x1f')];var _0x19aaf5=_0x48c5b2?_0x1a7314[_0xa090('0x20')]:_0x297e21['offset']+_0x297e21['limit'];var _0x36afd8;if(_0x19aaf5>=_0xd3983){_0x19aaf5=_0xd3983;_0x36afd8=0xc8;}else{_0x36afd8=0xce;}_0xe1f5c9[_0xa090('0x1b')](_0x36afd8);return _0xe1f5c9[_0xa090('0x21')](_0xa090('0x22'),_0x2ad993+'-'+_0x19aaf5+'/'+_0xd3983)[_0xa090('0x1c')](_0x1a7314);}return null;};}function patchUpdates(_0x5e0036){return function(_0x479a66){try{jsonpatch[_0xa090('0x23')](_0x479a66,_0x5e0036,!![]);}catch(_0x553d64){return BPromise['reject'](_0x553d64);}return _0x479a66[_0xa090('0x24')]();};}function saveUpdates(_0x39983b,_0x2f68c6){return function(_0x17693f){if(_0x17693f){return _0x17693f[_0xa090('0x25')](_0x39983b)[_0xa090('0x26')](function(_0x474b6b){return _0x474b6b;});}return null;};}function removeEntity(_0xc60bfd,_0x2f587d){return function(_0x210ae3){if(_0x210ae3){return _0x210ae3[_0xa090('0x27')]()[_0xa090('0x26')](function(){_0xc60bfd[_0xa090('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a954,_0xfd6cf0){return function(_0x34e50a){if(!_0x34e50a){_0x55a954[_0xa090('0x19')](0x194);}return _0x34e50a;};}function handleError(_0x3f8af2,_0x365f35){_0x365f35=_0x365f35||0x1f4;return function(_0x452734){logger[_0xa090('0x28')](_0x452734[_0xa090('0x29')]);if(_0x452734[_0xa090('0x2a')]){delete _0x452734[_0xa090('0x2a')];}_0x3f8af2[_0xa090('0x1b')](_0x365f35)[_0xa090('0x2b')](_0x452734);};}exports[_0xa090('0x2c')]=function(_0x2f36da,_0x512f0d){var _0xae6cc1={},_0x3e69f8={},_0x23286f={'count':0x0,'rows':[]};var _0x2e18d6=_[_0xa090('0x2d')](db[_0xa090('0x2e')][_0xa090('0x2f')],function(_0x1c21c8){return{'name':_0x1c21c8[_0xa090('0x30')],'type':_0x1c21c8[_0xa090('0x31')]['key']};});_0x3e69f8['model']=_[_0xa090('0x2d')](_0x2e18d6,_0xa090('0x2a'));_0x3e69f8[_0xa090('0x32')]=_[_0xa090('0x33')](_0x2f36da[_0xa090('0x32')]);_0x3e69f8[_0xa090('0x34')]=_[_0xa090('0x35')](_0x3e69f8[_0xa090('0x36')],_0x3e69f8[_0xa090('0x32')]);_0xae6cc1[_0xa090('0x37')]=_[_0xa090('0x35')](_0x3e69f8[_0xa090('0x36')],qs[_0xa090('0x38')](_0x2f36da['query'][_0xa090('0x38')]));_0xae6cc1['attributes']=_0xae6cc1[_0xa090('0x37')][_0xa090('0x39')]?_0xae6cc1[_0xa090('0x37')]:_0x3e69f8['model'];if(!_0x2f36da[_0xa090('0x32')]['hasOwnProperty'](_0xa090('0x3a'))){_0xae6cc1['limit']=qs['limit'](_0x2f36da[_0xa090('0x32')][_0xa090('0x1e')]);_0xae6cc1[_0xa090('0x1f')]=qs['offset'](_0x2f36da[_0xa090('0x32')]['offset']);}_0xae6cc1[_0xa090('0x3b')]=qs[_0xa090('0x3c')](_0x2f36da[_0xa090('0x32')][_0xa090('0x3c')]);_0xae6cc1[_0xa090('0x3d')]=qs[_0xa090('0x34')](_[_0xa090('0x3e')](_0x2f36da[_0xa090('0x32')],_0x3e69f8[_0xa090('0x34')]),_0x2e18d6);if(_0x2f36da[_0xa090('0x32')][_0xa090('0x3f')]){_0xae6cc1[_0xa090('0x3d')]=_[_0xa090('0x40')](_0xae6cc1['where'],{'$or':_[_0xa090('0x2d')](_0x2e18d6,function(_0x33a41d){if(_0x33a41d[_0xa090('0x31')]!==_0xa090('0x41')){var _0x4cb5cc={};_0x4cb5cc[_0x33a41d['name']]={'$like':'%'+_0x2f36da[_0xa090('0x32')][_0xa090('0x3f')]+'%'};return _0x4cb5cc;}})});}_0xae6cc1=_['merge']({},_0xae6cc1,_0x2f36da[_0xa090('0x42')]);var _0xd6908e={'where':_0xae6cc1[_0xa090('0x3d')]};return db['DeskField']['count'](_0xd6908e)[_0xa090('0x26')](function(_0x3f43f2){_0x23286f[_0xa090('0x20')]=_0x3f43f2;if(_0x2f36da[_0xa090('0x32')]['includeAll']){_0xae6cc1[_0xa090('0x43')]=[{'all':!![]}];}return db[_0xa090('0x2e')]['findAll'](_0xae6cc1);})[_0xa090('0x26')](function(_0x2032ea){_0x23286f[_0xa090('0x44')]=_0x2032ea;return _0x23286f;})['then'](respondWithFilteredResult(_0x512f0d,_0xae6cc1))[_0xa090('0x45')](handleError(_0x512f0d,null));};exports[_0xa090('0x46')]=function(_0x49f658,_0x38afa6){var _0x19f357={'raw':!![],'where':{'id':_0x49f658[_0xa090('0x47')]['id']}},_0x3abc8b={};_0x3abc8b[_0xa090('0x36')]=_[_0xa090('0x33')](db[_0xa090('0x2e')]['rawAttributes']);_0x3abc8b['query']=_[_0xa090('0x33')](_0x49f658[_0xa090('0x32')]);_0x3abc8b[_0xa090('0x34')]=_[_0xa090('0x35')](_0x3abc8b[_0xa090('0x36')],_0x3abc8b['query']);_0x19f357[_0xa090('0x37')]=_[_0xa090('0x35')](_0x3abc8b[_0xa090('0x36')],qs['fields'](_0x49f658[_0xa090('0x32')][_0xa090('0x38')]));_0x19f357[_0xa090('0x37')]=_0x19f357[_0xa090('0x37')][_0xa090('0x39')]?_0x19f357['attributes']:_0x3abc8b[_0xa090('0x36')];if(_0x49f658[_0xa090('0x32')][_0xa090('0x48')]){_0x19f357[_0xa090('0x43')]=[{'all':!![]}];}_0x19f357=_[_0xa090('0x40')]({},_0x19f357,_0x49f658[_0xa090('0x42')]);return db[_0xa090('0x2e')][_0xa090('0x49')](_0x19f357)[_0xa090('0x26')](handleEntityNotFound(_0x38afa6,null))['then'](respondWithResult(_0x38afa6,null))[_0xa090('0x45')](handleError(_0x38afa6,null));};exports['create']=function(_0x1bba33,_0x190450){return db[_0xa090('0x2e')]['create'](_0x1bba33[_0xa090('0x4a')],{})[_0xa090('0x26')](respondWithResult(_0x190450,0xc9))[_0xa090('0x45')](handleError(_0x190450,null));};exports[_0xa090('0x25')]=function(_0x549210,_0x3c8358){if(_0x549210[_0xa090('0x4a')]['id']){delete _0x549210[_0xa090('0x4a')]['id'];}return db[_0xa090('0x2e')]['find']({'where':{'id':_0x549210[_0xa090('0x47')]['id']}})[_0xa090('0x26')](handleEntityNotFound(_0x3c8358,null))[_0xa090('0x26')](saveUpdates(_0x549210['body'],null))[_0xa090('0x26')](respondWithResult(_0x3c8358,null))[_0xa090('0x45')](handleError(_0x3c8358,null));};exports[_0xa090('0x27')]=function(_0x2eddeb,_0x2fcd34){return db[_0xa090('0x2e')]['find']({'where':{'id':_0x2eddeb[_0xa090('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fcd34,null))[_0xa090('0x26')](removeEntity(_0x2fcd34,null))['catch'](handleError(_0x2fcd34,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index cb7595d..cf6fec4 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 _0x9d7c=['int_desk_fields','desk_unique_index','idField','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x5369ab,_0x6fb335){var _0x306ea5=function(_0x5dd32f){while(--_0x5dd32f){_0x5369ab['push'](_0x5369ab['shift']());}};_0x306ea5(++_0x6fb335);}(_0x9d7c,0x1bf));var _0xc9d7=function(_0x527c39,_0x3ea2a6){_0x527c39=_0x527c39-0x0;var _0x3f4dd6=_0x9d7c[_0x527c39];return _0x3f4dd6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc9d7('0x0'))(_0xc9d7('0x1'));var moment=require(_0xc9d7('0x2'));var BPromise=require(_0xc9d7('0x3'));var rp=require(_0xc9d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc9d7('0x5'));var attributes=require(_0xc9d7('0x6'));module[_0xc9d7('0x7')]=function(_0x2827d6,_0x5af21b){return _0x2827d6[_0xc9d7('0x8')]('DeskField',attributes,{'tableName':_0xc9d7('0x9'),'paranoid':![],'indexes':[{'name':_0xc9d7('0xa'),'fields':[_0xc9d7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6012=['path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5f31cf,_0x2595c3){var _0x24f87e=function(_0x32e244){while(--_0x32e244){_0x5f31cf['push'](_0x5f31cf['shift']());}};_0x24f87e(++_0x2595c3);}(_0x6012,0x15a));var _0x2601=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0x6012[_0x13137e];return _0x346261;};'use strict';var _=require(_0x2601('0x0'));var util=require(_0x2601('0x1'));var logger=require(_0x2601('0x2'))('api');var moment=require(_0x2601('0x3'));var BPromise=require(_0x2601('0x4'));var rp=require(_0x2601('0x5'));var fs=require('fs');var path=require(_0x2601('0x6'));var rimraf=require(_0x2601('0x7'));var config=require(_0x2601('0x8'));var attributes=require('./intDeskField.attributes');module[_0x2601('0x9')]=function(_0x30eacc,_0x5ea8fa){return _0x30eacc[_0x2601('0xa')](_0x2601('0xb'),attributes,{'tableName':_0x2601('0xc'),'paranoid':![],'indexes':[{'name':_0x2601('0xd'),'fields':[_0x2601('0xe'),_0x2601('0xf')],'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 f1535cb..0f5274b 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 _0x0e5b=['DeskField,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','code','error'];(function(_0x2700da,_0x35e578){var _0xab08c7=function(_0x522715){while(--_0x522715){_0x2700da['push'](_0x2700da['shift']());}};_0xab08c7(++_0x35e578);}(_0x0e5b,0x97));var _0xb0e5=function(_0x18b10f,_0x2b59b8){_0x18b10f=_0x18b10f-0x0;var _0x3026ef=_0x0e5b[_0x18b10f];return _0x3026ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb0e5('0x0'));var BPromise=require('bluebird');var rs=require(_0xb0e5('0x1'));var fs=require('fs');var Redis=require(_0xb0e5('0x2'));var db=require(_0xb0e5('0x3'))['db'];var utils=require(_0xb0e5('0x4'));var logger=require(_0xb0e5('0x5'))(_0xb0e5('0x6'));var config=require(_0xb0e5('0x7'));var jayson=require(_0xb0e5('0x8'));var client=jayson[_0xb0e5('0x9')][_0xb0e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ba97a,_0x5c6078,_0x15d469){return new BPromise(function(_0x367a69,_0x4da6a6){return client[_0xb0e5('0xb')](_0x2ba97a,_0x15d469)['then'](function(_0x196608){logger[_0xb0e5('0xc')]('DeskField,\x20%s,\x20%s',_0x5c6078,_0xb0e5('0xd'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x5c6078,_0xb0e5('0xd'),JSON[_0xb0e5('0xe')](_0x196608));if(_0x196608['error']){if(_0x196608['error'][_0xb0e5('0xf')]===0x1f4){logger[_0xb0e5('0x10')](_0xb0e5('0x11'),_0x5c6078,_0x196608[_0xb0e5('0x10')]['message']);return _0x4da6a6(_0x196608[_0xb0e5('0x10')]['message']);}logger[_0xb0e5('0x10')](_0xb0e5('0x11'),_0x5c6078,_0x196608[_0xb0e5('0x10')]['message']);return _0x367a69(_0x196608[_0xb0e5('0x10')][_0xb0e5('0x12')]);}else{logger[_0xb0e5('0xc')](_0xb0e5('0x11'),_0x5c6078,_0xb0e5('0xd'));_0x367a69(_0x196608[_0xb0e5('0x13')][_0xb0e5('0x12')]);}})[_0xb0e5('0x14')](function(_0x54fe4d){logger[_0xb0e5('0x10')](_0xb0e5('0x11'),_0x5c6078,_0x54fe4d);_0x4da6a6(_0x54fe4d);});});} \ No newline at end of file +var _0x3a35=['jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3f758f,_0x302451){var _0x26e4ae=function(_0x54beae){while(--_0x54beae){_0x3f758f['push'](_0x3f758f['shift']());}};_0x26e4ae(++_0x302451);}(_0x3a35,0x1b2));var _0x53a3=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x3a35[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x53a3('0x0'));var util=require('util');var moment=require(_0x53a3('0x1'));var BPromise=require('bluebird');var rs=require(_0x53a3('0x2'));var fs=require('fs');var Redis=require(_0x53a3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x53a3('0x4'));var logger=require(_0x53a3('0x5'))('rpc');var config=require(_0x53a3('0x6'));var jayson=require(_0x53a3('0x7'));var client=jayson[_0x53a3('0x8')][_0x53a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x117928,_0x44e2d4,_0x19ae89){return new BPromise(function(_0x365037,_0x57c508){return client[_0x53a3('0xa')](_0x117928,_0x19ae89)[_0x53a3('0xb')](function(_0x508436){logger[_0x53a3('0xc')](_0x53a3('0xd'),_0x44e2d4,_0x53a3('0xe'));logger['debug'](_0x53a3('0xf'),_0x44e2d4,_0x53a3('0xe'),JSON[_0x53a3('0x10')](_0x508436));if(_0x508436[_0x53a3('0x11')]){if(_0x508436[_0x53a3('0x11')]['code']===0x1f4){logger[_0x53a3('0x11')](_0x53a3('0xd'),_0x44e2d4,_0x508436[_0x53a3('0x11')][_0x53a3('0x12')]);return _0x57c508(_0x508436[_0x53a3('0x11')][_0x53a3('0x12')]);}logger[_0x53a3('0x11')]('DeskField,\x20%s,\x20%s',_0x44e2d4,_0x508436[_0x53a3('0x11')][_0x53a3('0x12')]);return _0x365037(_0x508436[_0x53a3('0x11')][_0x53a3('0x12')]);}else{logger[_0x53a3('0xc')]('DeskField,\x20%s,\x20%s',_0x44e2d4,'request\x20sent');_0x365037(_0x508436[_0x53a3('0x13')][_0x53a3('0x12')]);}})[_0x53a3('0x14')](function(_0x2e6820){logger['error'](_0x53a3('0xd'),_0x44e2d4,_0x2e6820);_0x57c508(_0x2e6820);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 83d896e..8871591 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 _0x9d01=['getConfigurations','/:id/fields','create','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x1f77be,_0x1ea03c){var _0x349b38=function(_0x4dc45f){while(--_0x4dc45f){_0x1f77be['push'](_0x1f77be['shift']());}};_0x349b38(++_0x1ea03c);}(_0x9d01,0xf9));var _0x19d0=function(_0x5aaf20,_0x38dc01){_0x5aaf20=_0x5aaf20-0x0;var _0x5a8c39=_0x9d01[_0x5aaf20];return _0x5a8c39;};'use strict';var multer=require(_0x19d0('0x0'));var util=require(_0x19d0('0x1'));var path=require(_0x19d0('0x2'));var timeout=require(_0x19d0('0x3'));var express=require(_0x19d0('0x4'));var router=express[_0x19d0('0x5')]();var fs_extra=require(_0x19d0('0x6'));var auth=require(_0x19d0('0x7'));var interaction=require(_0x19d0('0x8'));var config=require('../../config/environment');var controller=require(_0x19d0('0x9'));router[_0x19d0('0xa')]('/',auth[_0x19d0('0xb')](),controller[_0x19d0('0xc')]);router[_0x19d0('0xa')](_0x19d0('0xd'),auth[_0x19d0('0xb')](),controller['show']);router[_0x19d0('0xa')](_0x19d0('0xe'),auth['isAuthenticated'](),controller[_0x19d0('0xf')]);router['get'](_0x19d0('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x19d0('0xb')](),controller[_0x19d0('0x11')]);router[_0x19d0('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x19d0('0x13')](_0x19d0('0xd'),auth['isAuthenticated'](),controller[_0x19d0('0x14')]);router[_0x19d0('0x15')](_0x19d0('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7777=['post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x436073,_0x11b1d6){var _0x564463=function(_0x5836cf){while(--_0x5836cf){_0x436073['push'](_0x436073['shift']());}};_0x564463(++_0x11b1d6);}(_0x7777,0x7c));var _0x7777=function(_0x5400b,_0x55943a){_0x5400b=_0x5400b-0x0;var _0x36a39b=_0x7777[_0x5400b];return _0x36a39b;};'use strict';var multer=require(_0x7777('0x0'));var util=require(_0x7777('0x1'));var path=require('path');var timeout=require(_0x7777('0x2'));var express=require(_0x7777('0x3'));var router=express[_0x7777('0x4')]();var fs_extra=require(_0x7777('0x5'));var auth=require(_0x7777('0x6'));var interaction=require(_0x7777('0x7'));var config=require(_0x7777('0x8'));var controller=require(_0x7777('0x9'));router[_0x7777('0xa')]('/',auth[_0x7777('0xb')](),controller['index']);router[_0x7777('0xa')](_0x7777('0xc'),auth[_0x7777('0xb')](),controller['show']);router[_0x7777('0xa')](_0x7777('0xd'),auth[_0x7777('0xb')](),controller[_0x7777('0xe')]);router[_0x7777('0xa')]('/:id/fields',auth[_0x7777('0xb')](),controller[_0x7777('0xf')]);router[_0x7777('0x10')]('/',auth[_0x7777('0xb')](),controller['create']);router['post'](_0x7777('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x7777('0xc'),auth['isAuthenticated'](),controller[_0x7777('0x11')]);router['delete'](_0x7777('0xc'),auth[_0x7777('0xb')](),controller[_0x7777('0x12')]);module[_0x7777('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f8d73ad..f5b323d 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 _0x126d=['STRING','sequelize','exports'];(function(_0xe66f5a,_0x20056b){var _0x9f6f71=function(_0x85f64b){while(--_0x85f64b){_0xe66f5a['push'](_0xe66f5a['shift']());}};_0x9f6f71(++_0x20056b);}(_0x126d,0xc7));var _0xd126=function(_0x464aa2,_0x22e33f){_0x464aa2=_0x464aa2-0x0;var _0x5e7021=_0x126d[_0x464aa2];return _0x5e7021;};'use strict';var Sequelize=require(_0xd126('0x0'));module[_0xd126('0x1')]={'name':{'type':Sequelize[_0xd126('0x2')]},'username':{'type':Sequelize[_0xd126('0x2')]},'password':{'type':Sequelize[_0xd126('0x2')]},'remoteUri':{'type':Sequelize[_0xd126('0x2')]},'tenantId':{'type':Sequelize[_0xd126('0x2')]},'clientId':{'type':Sequelize[_0xd126('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd126('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd126('0x2')]}}; \ No newline at end of file +var _0xff24=['exports','STRING','sequelize'];(function(_0x4e13f2,_0xa3dcb1){var _0xfa0160=function(_0x1c2d31){while(--_0x1c2d31){_0x4e13f2['push'](_0x4e13f2['shift']());}};_0xfa0160(++_0xa3dcb1);}(_0xff24,0xb6));var _0x4ff2=function(_0x24a9b6,_0x236702){_0x24a9b6=_0x24a9b6-0x0;var _0xf89854=_0xff24[_0x24a9b6];return _0xf89854;};'use strict';var Sequelize=require(_0x4ff2('0x0'));module[_0x4ff2('0x1')]={'name':{'type':Sequelize[_0x4ff2('0x2')]},'username':{'type':Sequelize[_0x4ff2('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x4ff2('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x4ff2('0x2')]},'serverUrl':{'type':Sequelize[_0x4ff2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4ff2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 499272d..149d018 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 _0xb790=[')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','error','stack','name','send','index','Dynamics365Account','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','keys','options','catch','create','body','find','params','findOne','Dynamics365Configuration','order','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','versionnumber','concat','username','password','clientId','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId'];(function(_0x9a2110,_0x3b8d2f){var _0x201fcd=function(_0x185068){while(--_0x185068){_0x9a2110['push'](_0x9a2110['shift']());}};_0x201fcd(++_0x3b8d2f);}(_0xb790,0xe5));var _0x0b79=function(_0x109946,_0x3494b7){_0x109946=_0x109946-0x0;var _0x4ed20b=_0xb790[_0x109946];return _0x4ed20b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b79('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0b79('0x2'));var path=require(_0x0b79('0x3'));var sox=require('sox');var csv=require(_0x0b79('0x4'));var ejs=require(_0x0b79('0x5'));var fs=require('fs');var fs_extra=require(_0x0b79('0x6'));var _=require(_0x0b79('0x7'));var squel=require(_0x0b79('0x8'));var crypto=require(_0x0b79('0x9'));var jsforce=require(_0x0b79('0xa'));var deskjs=require(_0x0b79('0xb'));var toCsv=require(_0x0b79('0x4'));var querystring=require(_0x0b79('0xc'));var Papa=require(_0x0b79('0xd'));var Redis=require(_0x0b79('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0xf'));var hardwareService=require(_0x0b79('0x10'));var logger=require(_0x0b79('0x11'))(_0x0b79('0x12'));var utils=require(_0x0b79('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x14'));var db=require(_0x0b79('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44c94c,_0x1c0a61){_0x1c0a61=_0x1c0a61||0xcc;return function(_0x439e12){if(_0x439e12){return _0x44c94c[_0x0b79('0x16')](_0x1c0a61);}return _0x44c94c['status'](_0x1c0a61)[_0x0b79('0x17')]();};}function respondWithResult(_0x4681e4,_0x162522){_0x162522=_0x162522||0xc8;return function(_0x39551a){if(_0x39551a){return _0x4681e4['status'](_0x162522)[_0x0b79('0x18')](_0x39551a);}};}function respondWithFilteredResult(_0x44f4f7,_0x5bf09b){return function(_0x1820fa){if(_0x1820fa){var _0x23d5c3=typeof _0x5bf09b[_0x0b79('0x19')]===_0x0b79('0x1a')&&typeof _0x5bf09b[_0x0b79('0x1b')]===_0x0b79('0x1a');var _0x4f4754=_0x1820fa[_0x0b79('0x1c')];var _0x55bc36=_0x23d5c3?0x0:_0x5bf09b['offset'];var _0x4e7614=_0x23d5c3?_0x1820fa[_0x0b79('0x1c')]:_0x5bf09b[_0x0b79('0x19')]+_0x5bf09b[_0x0b79('0x1b')];var _0x5579dd;if(_0x4e7614>=_0x4f4754){_0x4e7614=_0x4f4754;_0x5579dd=0xc8;}else{_0x5579dd=0xce;}_0x44f4f7[_0x0b79('0x1d')](_0x5579dd);return _0x44f4f7['set'](_0x0b79('0x1e'),_0x55bc36+'-'+_0x4e7614+'/'+_0x4f4754)[_0x0b79('0x18')](_0x1820fa);}return null;};}function patchUpdates(_0x8482ad){return function(_0x5b630c){try{jsonpatch[_0x0b79('0x1f')](_0x5b630c,_0x8482ad,!![]);}catch(_0x330027){return BPromise[_0x0b79('0x20')](_0x330027);}return _0x5b630c['save']();};}function saveUpdates(_0xa836a8,_0x58901a){return function(_0x5bd229){if(_0x5bd229){return _0x5bd229[_0x0b79('0x21')](_0xa836a8)['then'](function(_0x80fbe9){return _0x80fbe9;});}return null;};}function removeEntity(_0x235a7f,_0x3a04d3){return function(_0x136734){if(_0x136734){return _0x136734['destroy']()[_0x0b79('0x22')](function(){_0x235a7f[_0x0b79('0x1d')](0xcc)[_0x0b79('0x17')]();});}};}function handleEntityNotFound(_0x553ed1,_0x143ca2){return function(_0x316866){if(!_0x316866){_0x553ed1[_0x0b79('0x16')](0x194);}return _0x316866;};}function handleError(_0x4a2f93,_0x39b034){_0x39b034=_0x39b034||0x1f4;return function(_0x18a2ea){logger[_0x0b79('0x23')](_0x18a2ea[_0x0b79('0x24')]);if(_0x18a2ea[_0x0b79('0x25')]){delete _0x18a2ea['name'];}_0x4a2f93[_0x0b79('0x1d')](_0x39b034)[_0x0b79('0x26')](_0x18a2ea);};}exports[_0x0b79('0x27')]=function(_0x365ea4,_0x48756d){var _0x47cdf2={},_0x10f10c={},_0x5595fd={'count':0x0,'rows':[]};var _0x2f0639=_['map'](db[_0x0b79('0x28')][_0x0b79('0x29')],function(_0x19971a){return{'name':_0x19971a['fieldName'],'type':_0x19971a[_0x0b79('0x2a')]['key']};});_0x10f10c[_0x0b79('0x2b')]=_[_0x0b79('0x2c')](_0x2f0639,_0x0b79('0x25'));_0x10f10c['query']=_['keys'](_0x365ea4[_0x0b79('0x2d')]);_0x10f10c[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],_0x10f10c[_0x0b79('0x2d')]);_0x47cdf2[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x47cdf2[_0x0b79('0x30')]=_0x47cdf2[_0x0b79('0x30')][_0x0b79('0x32')]?_0x47cdf2[_0x0b79('0x30')]:_0x10f10c[_0x0b79('0x2b')];if(!_0x365ea4['query']['hasOwnProperty'](_0x0b79('0x33'))){_0x47cdf2[_0x0b79('0x1b')]=qs[_0x0b79('0x1b')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x47cdf2[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x19')]);}_0x47cdf2['order']=qs[_0x0b79('0x34')](_0x365ea4[_0x0b79('0x2d')]['sort']);_0x47cdf2[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x365ea4[_0x0b79('0x2d')],_0x10f10c[_0x0b79('0x2e')]),_0x2f0639);if(_0x365ea4[_0x0b79('0x2d')]['filter']){_0x47cdf2[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x47cdf2[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x2f0639,function(_0x221ce3){if(_0x221ce3['type']!==_0x0b79('0x38')){var _0x5b8d0b={};_0x5b8d0b[_0x221ce3[_0x0b79('0x25')]]={'$like':'%'+_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x5b8d0b;}})});}_0x47cdf2=_['merge']({},_0x47cdf2,_0x365ea4['options']);var _0x564884={'where':_0x47cdf2[_0x0b79('0x35')]};return db['Dynamics365Account'][_0x0b79('0x1c')](_0x564884)[_0x0b79('0x22')](function(_0x293a33){_0x5595fd[_0x0b79('0x1c')]=_0x293a33;if(_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x3a')]){_0x47cdf2[_0x0b79('0x3b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x0b79('0x3c')](_0x47cdf2);})[_0x0b79('0x22')](function(_0x6f2200){_0x5595fd[_0x0b79('0x3d')]=_0x6f2200;return _0x5595fd;})[_0x0b79('0x22')](respondWithFilteredResult(_0x48756d,_0x47cdf2))['catch'](handleError(_0x48756d,null));};exports[_0x0b79('0x3e')]=function(_0x2b9f9f,_0x47f9e8){var _0x1a8e38={'raw':![],'where':{'id':_0x2b9f9f['params']['id']}},_0xb74c93={};_0xb74c93['model']=_[_0x0b79('0x3f')](db[_0x0b79('0x28')][_0x0b79('0x29')]);_0xb74c93[_0x0b79('0x2d')]=_['keys'](_0x2b9f9f[_0x0b79('0x2d')]);_0xb74c93[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0xb74c93['model'],_0xb74c93[_0x0b79('0x2d')]);_0x1a8e38[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0xb74c93[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x2b9f9f[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x1a8e38[_0x0b79('0x30')]=_0x1a8e38[_0x0b79('0x30')][_0x0b79('0x32')]?_0x1a8e38[_0x0b79('0x30')]:_0xb74c93['model'];if(_0x2b9f9f['query'][_0x0b79('0x3a')]){_0x1a8e38[_0x0b79('0x3b')]=[{'all':!![]}];}_0x1a8e38=_[_0x0b79('0x37')]({},_0x1a8e38,_0x2b9f9f[_0x0b79('0x40')]);return db[_0x0b79('0x28')]['find'](_0x1a8e38)[_0x0b79('0x22')](handleEntityNotFound(_0x47f9e8,null))['then'](respondWithResult(_0x47f9e8,null))[_0x0b79('0x41')](handleError(_0x47f9e8,null));};exports[_0x0b79('0x42')]=function(_0x358bce,_0x25f719){return db[_0x0b79('0x28')][_0x0b79('0x42')](_0x358bce[_0x0b79('0x43')],{})[_0x0b79('0x22')](respondWithResult(_0x25f719,0xc9))[_0x0b79('0x41')](handleError(_0x25f719,null));};exports[_0x0b79('0x21')]=function(_0x362aa4,_0x21dc25){if(_0x362aa4[_0x0b79('0x43')]['id']){delete _0x362aa4[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x362aa4['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x21dc25,null))['then'](saveUpdates(_0x362aa4[_0x0b79('0x43')],null))[_0x0b79('0x22')](respondWithResult(_0x21dc25,null))[_0x0b79('0x41')](handleError(_0x21dc25,null));};exports['destroy']=function(_0x4172b9,_0x1862c4){return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x4172b9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x1862c4,null))[_0x0b79('0x22')](removeEntity(_0x1862c4,null))[_0x0b79('0x41')](handleError(_0x1862c4,null));};exports['getConfigurations']=function(_0x1a6f6a,_0x472051,_0x17d0db){var _0x278d42={};var _0x7b9f57={};var _0x46eb9e;var _0x2309be;return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x1a6f6a['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x472051,null))['then'](function(_0x1616fa){if(_0x1616fa){_0x46eb9e=_0x1616fa;_0x7b9f57[_0x0b79('0x2b')]=_['keys'](db[_0x0b79('0x47')][_0x0b79('0x29')]);_0x7b9f57[_0x0b79('0x2d')]=_[_0x0b79('0x3f')](_0x1a6f6a[_0x0b79('0x2d')]);_0x7b9f57[_0x0b79('0x2e')]=_['intersection'](_0x7b9f57['model'],_0x7b9f57[_0x0b79('0x2d')]);_0x278d42[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x7b9f57[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x278d42[_0x0b79('0x30')]=_0x278d42[_0x0b79('0x30')][_0x0b79('0x32')]?_0x278d42['attributes']:_0x7b9f57[_0x0b79('0x2b')];_0x278d42[_0x0b79('0x48')]=qs[_0x0b79('0x34')](_0x1a6f6a[_0x0b79('0x2d')]['sort']);_0x278d42[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x1a6f6a[_0x0b79('0x2d')],_0x7b9f57[_0x0b79('0x2e')]));if(_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]){_0x278d42[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x278d42[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x278d42[_0x0b79('0x30')],function(_0x2abb67){var _0x4416af={};_0x4416af[_0x2abb67]={'$like':'%'+_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x4416af;})});}_0x278d42=_['merge']({},_0x278d42,_0x1a6f6a['options']);return _0x46eb9e['getConfigurations'](_0x278d42);}})[_0x0b79('0x22')](function(_0xdf3b19){if(_0xdf3b19){_0x2309be=_0xdf3b19['length'];if(!_0x1a6f6a[_0x0b79('0x2d')]['hasOwnProperty']('nolimit')){_0x278d42[_0x0b79('0x1b')]=qs['limit'](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x278d42[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x19')]);}return _0x46eb9e['getConfigurations'](_0x278d42);}})['then'](function(_0x32aee1){if(_0x32aee1){return _0x32aee1?{'count':_0x2309be,'rows':_0x32aee1}:null;}})[_0x0b79('0x22')](respondWithResult(_0x472051,null))['catch'](handleError(_0x472051,null));};exports['addConfiguration']=function(_0x52acb9,_0x92fa34,_0x4922b1){if(_0x52acb9[_0x0b79('0x43')]['id']){delete _0x52acb9[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x52acb9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x92fa34,null))[_0x0b79('0x22')](function(_0x8ecdc9){if(_0x8ecdc9){_0x52acb9['body'][_0x0b79('0x49')]=_0x8ecdc9['id'];_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4a')]=integrations[_0x0b79('0x4b')](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9['body']['type']);_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4d')]=integrations['getDescriptions'](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9[_0x0b79('0x43')][_0x0b79('0x2a')]);return db[_0x0b79('0x47')][_0x0b79('0x42')](_0x52acb9[_0x0b79('0x43')],{'include':[{'model':db[_0x0b79('0x4e')],'as':_0x0b79('0x4a')},{'model':db[_0x0b79('0x4e')],'as':'Descriptions'}]});}return null;})[_0x0b79('0x22')](respondWithResult(_0x92fa34,null))[_0x0b79('0x41')](handleError(_0x92fa34,null));};exports[_0x0b79('0x4f')]=function(_0x21ee3b,_0x30c29c,_0x4d4bb3){var _0x1e8278=_0x21ee3b[_0x0b79('0x2d')]['ticketType'];var _0x4e7c7b=_0x1e8278==='incident'?'Incident':_0x0b79('0x50');var _0x26fc79='';var _0x5c8a1d='';var _0x3c15f4='';var _0x4e5ef4='';var _0x3a69fb='';var _0x253f93='';var _0x1d3cd7='';var _0xa5920f='';var _0x2e216d=[_0x0b79('0x51'),'description',_0x0b79('0x52'),_0x0b79('0x53'),_0x0b79('0x54'),'subject',_0x0b79('0x55'),_0x0b79('0x56'),_0x0b79('0x57'),_0x0b79('0x58')];var _0x570b45=[_0x0b79('0x59'),_0x0b79('0x5a'),'actualserviceunits',_0x0b79('0x5b'),_0x0b79('0x5c'),_0x0b79('0x5d'),_0x0b79('0x5e'),_0x0b79('0x5f'),_0x0b79('0x60'),'createdbyexternalpartyyominame','createdbyname',_0x0b79('0x61'),_0x0b79('0x62'),_0x0b79('0x63'),_0x0b79('0x64'),_0x0b79('0x65'),_0x0b79('0x66'),_0x0b79('0x67'),_0x0b79('0x68'),_0x0b79('0x69'),_0x0b79('0x6a'),_0x0b79('0x6b'),_0x0b79('0x6c'),_0x0b79('0x6d'),'firstresponsebykpiidname',_0x0b79('0x6e'),'importsequencenumber','influencescore',_0x0b79('0x6f'),_0x0b79('0x70'),'masteridname',_0x0b79('0x71'),_0x0b79('0x72'),'modifiedbyname',_0x0b79('0x73'),_0x0b79('0x74'),'modifiedonbehalfbyname',_0x0b79('0x75'),_0x0b79('0x76'),_0x0b79('0x77'),_0x0b79('0x78'),'onholdtime',_0x0b79('0x79'),_0x0b79('0x7a'),_0x0b79('0x7b'),'owneridyominame',_0x0b79('0x7c'),_0x0b79('0x7d'),_0x0b79('0x7e'),_0x0b79('0x7f'),_0x0b79('0x80'),_0x0b79('0x81'),_0x0b79('0x82'),_0x0b79('0x83'),_0x0b79('0x84'),_0x0b79('0x85'),_0x0b79('0x86'),_0x0b79('0x87'),'slainvokedidname','slaname',_0x0b79('0x88'),_0x0b79('0x89'),_0x0b79('0x8a'),_0x0b79('0x8b'),'ticketnumber','timezoneruleversionnumber',_0x0b79('0x8c'),'traversedpath','utcconversiontimezonecode',_0x0b79('0x8d')];var _0x4bf810=_0x2e216d[_0x0b79('0x8e')](_0x570b45);return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x21ee3b[_0x0b79('0x45')]['id']},'attributes':['id',_0x0b79('0x8f'),_0x0b79('0x90'),'remoteUri','tenantId',_0x0b79('0x91'),'clientSecret']})[_0x0b79('0x22')](handleEntityNotFound(_0x30c29c,null))[_0x0b79('0x22')](function(_0x411a9f){if(_0x411a9f){_0xa5920f=_0x411a9f['remoteUri'];var _0x2662d2=_0xa5920f[_0x0b79('0x92')](-0x1);if(_0x2662d2==='/'){_0xa5920f=_0xa5920f['substring'](0x0,_0xa5920f[_0x0b79('0x93')](_0x2662d2));}_0x1d3cd7=util['format'](_0x0b79('0x94'),_0xa5920f);var _0x46b7a7={'method':_0x0b79('0x95'),'uri':_0x0b79('0x96')+_0x411a9f[_0x0b79('0x97')]+_0x0b79('0x98'),'form':{'client_id':_0x411a9f[_0x0b79('0x91')],'resource':_0xa5920f,'username':_0x411a9f[_0x0b79('0x8f')],'password':_0x411a9f['password'],'grant_type':_0x0b79('0x90'),'client_secret':_0x411a9f[_0x0b79('0x99')]},'json':!![]};return rp(_0x46b7a7);}})[_0x0b79('0x22')](function(_0x131c38){_0x253f93=_0x131c38['access_token'];var _0x3f360e={'method':_0x0b79('0x9a'),'uri':encodeURI(_0x1d3cd7+_0x0b79('0x9b')+_0x4e7c7b+'\x27'),'headers':{'Authorization':_0x0b79('0x9c')+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3f360e);})[_0x0b79('0x22')](function(_0x1261a2){var _0x530def=_0x1261a2['value'][0x0];var _0x4c5956=_0x530def[_0x0b79('0x9e')];var _0x39b1a2={'method':'GET','uri':_0x1d3cd7+'EntityDefinitions('+_0x4c5956+_0x0b79('0x9f'),'headers':{'Authorization':'Bearer\x20'+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x39b1a2);})[_0x0b79('0x22')](function(_0x59a5bc){_0x26fc79=_0x59a5bc;_0x5c8a1d=_0x26fc79[_0x0b79('0xa0')];_0x5c8a1d=_['remove'](_0x5c8a1d,function(_0x12b003){return!_0x4bf810[_0x0b79('0xa1')](_0x12b003[_0x0b79('0xa2')]);});var _0x427131=[];var _0x19da21=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x42e594){if(_0x42e594[_0x0b79('0xa4')]){var _0x21225a=_0x42e594[_0x0b79('0xa4')][_0x0b79('0xa5')](_0x42e594[_0x0b79('0xa4')]['lastIndexOf']('.')+0x1);if(_0x21225a==='PicklistAttributeMetadata'){_0x427131[_0x0b79('0xa6')](getSelectList(_0x1d3cd7,_0x1e8278,_0x19da21,_0x26fc79[_0x0b79('0x9e')],_0x42e594[_0x0b79('0x9e')],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x427131);})['then'](function(_0x5a58eb){_0x3c15f4=_0x5a58eb[0x0];var _0x901f06=[];var _0x559f13=[];_0x5c8a1d['forEach'](function(_0x1ccf84){if(!_[_0x0b79('0xa8')](_0x1ccf84[_0x0b79('0xa4')])){var _0x502b33=_0x1ccf84['@odata.type'][_0x0b79('0xa5')](_0x1ccf84['@odata.type'][_0x0b79('0x93')]('.')+0x1);if(_0x502b33===_0x0b79('0xa9')){_0x901f06[_0x0b79('0xa6')](getBooleanList(_0x1d3cd7,_0x1e8278,_0x559f13,_0x26fc79[_0x0b79('0x9e')],_0x1ccf84[_0x0b79('0x9e')],_0x253f93));}}});return Promise['all'](_0x901f06);})[_0x0b79('0x22')](function(_0x347724){_0x4e5ef4=_0x347724[0x0];var _0x452ac=[];var _0x4bbdf9=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x129fce){if(_0x129fce[_0x0b79('0xa4')]){var _0x54a8e5=_0x129fce['@odata.type']['substring'](_0x129fce[_0x0b79('0xa4')][_0x0b79('0x93')]('.')+0x1);if(_0x54a8e5===_0x0b79('0xaa')||_0x54a8e5==='DoubleAttributeMetadata'||_0x54a8e5==='BigIntAttributeMetadata'||_0x54a8e5===_0x0b79('0xab')||_0x54a8e5==='MemoAttributeMetadata'||_0x54a8e5===_0x0b79('0xac')||_0x54a8e5===_0x0b79('0xad')||_0x54a8e5===_0x0b79('0xae')||_0x54a8e5==='StateAttributeMetadata'||_0x54a8e5===_0x0b79('0xaf')){_0x452ac['push'](getInputList(_0x1d3cd7,_0x1e8278,_0x54a8e5,_0x4bbdf9,_0x26fc79['MetadataId'],_0x129fce['MetadataId'],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x452ac);})[_0x0b79('0x22')](function(_0x5234be){_0x3a69fb=_0x5234be[0x0];var _0x57cb37=_0x3c15f4[_0x0b79('0x8e')](_0x4e5ef4)[_0x0b79('0x8e')](_0x3a69fb);var _0x45ff53={'count':_0x57cb37['length'],'rows':_0x57cb37};return _0x45ff53;})[_0x0b79('0x22')](respondWithResult(_0x30c29c,null))['catch'](function(_0x1f56a6){var _0x131d18=_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?0x1f4:_0x1f56a6[_0x0b79('0xb1')]||0x1f4;logger[_0x0b79('0x23')](_0x1f56a6['stack']);delete _0x1f56a6[_0x0b79('0x25')];if(_0x131d18===0x191){_0x131d18=0x190;}_0x30c29c[_0x0b79('0x1d')](_0x131d18)[_0x0b79('0x26')](_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?{'message':_0x0b79('0xb2'),'statusCode':_0x1f56a6[_0x0b79('0xb1')]}:_0x1f56a6);});};function getSelectList(_0x49414d,_0x2f157b,_0x1bad80,_0x5ed3b3,_0x3d3b5c,_0x309ab9){var _0x4ec192={'method':_0x0b79('0x9a'),'uri':_0x49414d+_0x0b79('0xb3')+_0x5ed3b3+_0x0b79('0xb4')+_0x3d3b5c+_0x0b79('0xb5')+_0x0b79('0xb6'),'headers':{'Authorization':_0x0b79('0x9c')+_0x309ab9,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x4ec192)[_0x0b79('0x22')](function(_0x1b294d){var _0x1d7f69=[];var _0x181ebf=_0x1b294d['OptionSet'][_0x0b79('0xb7')];_0x181ebf[_0x0b79('0xa3')](function(_0x2a50dc){_0x1d7f69['push']({'name':_0x2a50dc[_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':String(_0x2a50dc['Value'])});});var _0x38ddaa={'id':_0x2f157b+'_'+_0x1b294d[_0x0b79('0xa2')],'name':_0x1b294d[_0x0b79('0xba')]['UserLocalizedLabel'][_0x0b79('0xb8')],'custom':![],'options':_0x1d7f69};_0x1bad80[_0x0b79('0xa6')](_0x38ddaa);return _0x1bad80;});}function getBooleanList(_0x3e228c,_0x467bcf,_0x201d96,_0x19d668,_0x3b0107,_0x415f32){var _0x123c70={'method':_0x0b79('0x9a'),'uri':_0x3e228c+_0x0b79('0xb3')+_0x19d668+_0x0b79('0xb4')+_0x3b0107+_0x0b79('0xbb'),'headers':{'Authorization':_0x0b79('0x9c')+_0x415f32,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x123c70)['then'](function(_0xa34638){var _0x475264=[];_0x475264[_0x0b79('0xa6')]({'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbd')][_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':_0x0b79('0xbe')},{'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbf')][_0x0b79('0xb8')][_0x0b79('0xb9')][_0x0b79('0xb8')],'value':_0x0b79('0xc0')});var _0x3a34c9={'id':_0x467bcf+'_'+_0xa34638[_0x0b79('0xa2')],'name':_0xa34638['DisplayName'][_0x0b79('0xb9')][_0x0b79('0xb8')],'custom':![],'options':_0x475264};_0x201d96[_0x0b79('0xa6')](_0x3a34c9);return _0x201d96;});}function getInputList(_0x2eebce,_0x449d0b,_0x523e8f,_0xa0dfef,_0x42e7e7,_0x30a3ba,_0x483e50){var _0x3b8b8d={'method':_0x0b79('0x9a'),'uri':_0x2eebce+_0x0b79('0xb3')+_0x42e7e7+_0x0b79('0xb4')+_0x30a3ba+_0x0b79('0xc1')+_0x523e8f+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x0b79('0x9c')+_0x483e50,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3b8b8d)[_0x0b79('0x22')](function(_0xa4bbfa){var _0x31077c={'id':_0x449d0b+'_'+_0xa4bbfa[_0x0b79('0xa2')],'name':_0xa4bbfa[_0x0b79('0xba')][_0x0b79('0xb9')]?_0xa4bbfa['DisplayName'][_0x0b79('0xb9')]['Label']:_0xa4bbfa[_0x0b79('0xa2')],'custom':![],'options':[]};_0xa0dfef[_0x0b79('0xa6')](_0x31077c);return _0xa0dfef;});} \ No newline at end of file +var _0xcee8=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','pick','filter','VIRTUAL','options','where','includeAll','include','Dynamics365Account','rows','show','length','merge','find','catch','create','body','params','findOne','Dynamics365Configuration','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Dynamics365Field','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','clientId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','test','statusCode','Wrong\x20credentials','GET',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','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','../../components/integrations/configuration','sendStatus'];(function(_0x3b83da,_0x3149a6){var _0x6c8ce2=function(_0x19c096){while(--_0x19c096){_0x3b83da['push'](_0x3b83da['shift']());}};_0x6c8ce2(++_0x3149a6);}(_0xcee8,0xb1));var _0x8cee=function(_0x10d423,_0x287e09){_0x10d423=_0x10d423-0x0;var _0x3ead0c=_0xcee8[_0x10d423];return _0x3ead0c;};'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'];var integrations=require(_0x8cee('0x18'));function respondWithStatusCode(_0x28bd09,_0x4e1f09){_0x4e1f09=_0x4e1f09||0xcc;return function(_0x5d4de3){if(_0x5d4de3){return _0x28bd09[_0x8cee('0x19')](_0x4e1f09);}return _0x28bd09[_0x8cee('0x1a')](_0x4e1f09)[_0x8cee('0x1b')]();};}function respondWithResult(_0x227762,_0xedc808){_0xedc808=_0xedc808||0xc8;return function(_0x9d7853){if(_0x9d7853){return _0x227762[_0x8cee('0x1a')](_0xedc808)[_0x8cee('0x1c')](_0x9d7853);}};}function respondWithFilteredResult(_0x237248,_0x487241){return function(_0x33b07e){if(_0x33b07e){var _0x39213b=typeof _0x487241[_0x8cee('0x1d')]===_0x8cee('0x1e')&&typeof _0x487241[_0x8cee('0x1f')]==='undefined';var _0x3015bf=_0x33b07e['count'];var _0x4a3556=_0x39213b?0x0:_0x487241[_0x8cee('0x1d')];var _0x1bed34=_0x39213b?_0x33b07e[_0x8cee('0x20')]:_0x487241[_0x8cee('0x1d')]+_0x487241[_0x8cee('0x1f')];var _0x56ecf7;if(_0x1bed34>=_0x3015bf){_0x1bed34=_0x3015bf;_0x56ecf7=0xc8;}else{_0x56ecf7=0xce;}_0x237248[_0x8cee('0x1a')](_0x56ecf7);return _0x237248[_0x8cee('0x21')](_0x8cee('0x22'),_0x4a3556+'-'+_0x1bed34+'/'+_0x3015bf)['json'](_0x33b07e);}return null;};}function patchUpdates(_0x31dbd5){return function(_0x3e198f){try{jsonpatch['apply'](_0x3e198f,_0x31dbd5,!![]);}catch(_0x5c8e6b){return BPromise[_0x8cee('0x23')](_0x5c8e6b);}return _0x3e198f['save']();};}function saveUpdates(_0x54539b,_0x51a93f){return function(_0x51cf76){if(_0x51cf76){return _0x51cf76[_0x8cee('0x24')](_0x54539b)['then'](function(_0x117bc6){return _0x117bc6;});}return null;};}function removeEntity(_0x5e231e,_0x2ea47b){return function(_0x27e8fb){if(_0x27e8fb){return _0x27e8fb[_0x8cee('0x25')]()[_0x8cee('0x26')](function(){_0x5e231e[_0x8cee('0x1a')](0xcc)[_0x8cee('0x1b')]();});}};}function handleEntityNotFound(_0x89974f,_0x415f47){return function(_0x5a5ee5){if(!_0x5a5ee5){_0x89974f[_0x8cee('0x19')](0x194);}return _0x5a5ee5;};}function handleError(_0xc2ad7f,_0x5df746){_0x5df746=_0x5df746||0x1f4;return function(_0x5c4810){logger[_0x8cee('0x27')](_0x5c4810[_0x8cee('0x28')]);if(_0x5c4810[_0x8cee('0x29')]){delete _0x5c4810[_0x8cee('0x29')];}_0xc2ad7f[_0x8cee('0x1a')](_0x5df746)[_0x8cee('0x2a')](_0x5c4810);};}exports['index']=function(_0x1572d5,_0x4a7781){var _0x75f082={},_0x139867={},_0x16f571={'count':0x0,'rows':[]};var _0x1b6128=_[_0x8cee('0x2b')](db['Dynamics365Account'][_0x8cee('0x2c')],function(_0x5a301c){return{'name':_0x5a301c[_0x8cee('0x2d')],'type':_0x5a301c[_0x8cee('0x2e')][_0x8cee('0x2f')]};});_0x139867[_0x8cee('0x30')]=_['map'](_0x1b6128,_0x8cee('0x29'));_0x139867['query']=_[_0x8cee('0x31')](_0x1572d5['query']);_0x139867[_0x8cee('0x32')]=_['intersection'](_0x139867['model'],_0x139867[_0x8cee('0x33')]);_0x75f082[_0x8cee('0x34')]=_[_0x8cee('0x35')](_0x139867[_0x8cee('0x30')],qs[_0x8cee('0x36')](_0x1572d5[_0x8cee('0x33')][_0x8cee('0x36')]));_0x75f082[_0x8cee('0x34')]=_0x75f082['attributes']['length']?_0x75f082[_0x8cee('0x34')]:_0x139867[_0x8cee('0x30')];if(!_0x1572d5[_0x8cee('0x33')][_0x8cee('0x37')](_0x8cee('0x38'))){_0x75f082[_0x8cee('0x1f')]=qs['limit'](_0x1572d5[_0x8cee('0x33')][_0x8cee('0x1f')]);_0x75f082[_0x8cee('0x1d')]=qs[_0x8cee('0x1d')](_0x1572d5['query']['offset']);}_0x75f082['order']=qs['sort'](_0x1572d5[_0x8cee('0x33')]['sort']);_0x75f082['where']=qs[_0x8cee('0x32')](_[_0x8cee('0x39')](_0x1572d5[_0x8cee('0x33')],_0x139867[_0x8cee('0x32')]),_0x1b6128);if(_0x1572d5[_0x8cee('0x33')][_0x8cee('0x3a')]){_0x75f082['where']=_['merge'](_0x75f082['where'],{'$or':_[_0x8cee('0x2b')](_0x1b6128,function(_0xb07688){if(_0xb07688[_0x8cee('0x2e')]!==_0x8cee('0x3b')){var _0x50e460={};_0x50e460[_0xb07688[_0x8cee('0x29')]]={'$like':'%'+_0x1572d5[_0x8cee('0x33')]['filter']+'%'};return _0x50e460;}})});}_0x75f082=_['merge']({},_0x75f082,_0x1572d5[_0x8cee('0x3c')]);var _0x18b30c={'where':_0x75f082[_0x8cee('0x3d')]};return db['Dynamics365Account'][_0x8cee('0x20')](_0x18b30c)['then'](function(_0x43fec8){_0x16f571[_0x8cee('0x20')]=_0x43fec8;if(_0x1572d5[_0x8cee('0x33')][_0x8cee('0x3e')]){_0x75f082[_0x8cee('0x3f')]=[{'all':!![]}];}return db[_0x8cee('0x40')]['findAll'](_0x75f082);})[_0x8cee('0x26')](function(_0x6d5472){_0x16f571[_0x8cee('0x41')]=_0x6d5472;return _0x16f571;})[_0x8cee('0x26')](respondWithFilteredResult(_0x4a7781,_0x75f082))['catch'](handleError(_0x4a7781,null));};exports[_0x8cee('0x42')]=function(_0x190725,_0x582c90){var _0xa68469={'raw':![],'where':{'id':_0x190725['params']['id']}},_0x425eda={};_0x425eda[_0x8cee('0x30')]=_['keys'](db[_0x8cee('0x40')][_0x8cee('0x2c')]);_0x425eda[_0x8cee('0x33')]=_[_0x8cee('0x31')](_0x190725[_0x8cee('0x33')]);_0x425eda[_0x8cee('0x32')]=_[_0x8cee('0x35')](_0x425eda[_0x8cee('0x30')],_0x425eda[_0x8cee('0x33')]);_0xa68469[_0x8cee('0x34')]=_[_0x8cee('0x35')](_0x425eda[_0x8cee('0x30')],qs[_0x8cee('0x36')](_0x190725[_0x8cee('0x33')]['fields']));_0xa68469[_0x8cee('0x34')]=_0xa68469[_0x8cee('0x34')][_0x8cee('0x43')]?_0xa68469[_0x8cee('0x34')]:_0x425eda['model'];if(_0x190725[_0x8cee('0x33')][_0x8cee('0x3e')]){_0xa68469[_0x8cee('0x3f')]=[{'all':!![]}];}_0xa68469=_[_0x8cee('0x44')]({},_0xa68469,_0x190725[_0x8cee('0x3c')]);return db[_0x8cee('0x40')][_0x8cee('0x45')](_0xa68469)['then'](handleEntityNotFound(_0x582c90,null))['then'](respondWithResult(_0x582c90,null))[_0x8cee('0x46')](handleError(_0x582c90,null));};exports[_0x8cee('0x47')]=function(_0x267d77,_0x28b97b){return db[_0x8cee('0x40')][_0x8cee('0x47')](_0x267d77[_0x8cee('0x48')],{})[_0x8cee('0x26')](respondWithResult(_0x28b97b,0xc9))['catch'](handleError(_0x28b97b,null));};exports[_0x8cee('0x24')]=function(_0x10495e,_0x14a1bd){if(_0x10495e[_0x8cee('0x48')]['id']){delete _0x10495e['body']['id'];}return db[_0x8cee('0x40')][_0x8cee('0x45')]({'where':{'id':_0x10495e[_0x8cee('0x49')]['id']}})['then'](handleEntityNotFound(_0x14a1bd,null))[_0x8cee('0x26')](saveUpdates(_0x10495e[_0x8cee('0x48')],null))['then'](respondWithResult(_0x14a1bd,null))[_0x8cee('0x46')](handleError(_0x14a1bd,null));};exports[_0x8cee('0x25')]=function(_0x56182b,_0x4ca024){return db[_0x8cee('0x40')][_0x8cee('0x45')]({'where':{'id':_0x56182b['params']['id']}})[_0x8cee('0x26')](handleEntityNotFound(_0x4ca024,null))[_0x8cee('0x26')](removeEntity(_0x4ca024,null))[_0x8cee('0x46')](handleError(_0x4ca024,null));};exports['getConfigurations']=function(_0x37f6e6,_0x6f1319,_0x3ed61f){var _0x244c60={};var _0x5ecb09={};var _0x3f0a57;var _0x5cfb48;return db[_0x8cee('0x40')][_0x8cee('0x4a')]({'where':{'id':_0x37f6e6['params']['id']}})['then'](handleEntityNotFound(_0x6f1319,null))['then'](function(_0x34dde3){if(_0x34dde3){_0x3f0a57=_0x34dde3;_0x5ecb09[_0x8cee('0x30')]=_['keys'](db[_0x8cee('0x4b')][_0x8cee('0x2c')]);_0x5ecb09[_0x8cee('0x33')]=_[_0x8cee('0x31')](_0x37f6e6['query']);_0x5ecb09[_0x8cee('0x32')]=_[_0x8cee('0x35')](_0x5ecb09[_0x8cee('0x30')],_0x5ecb09[_0x8cee('0x33')]);_0x244c60[_0x8cee('0x34')]=_[_0x8cee('0x35')](_0x5ecb09[_0x8cee('0x30')],qs[_0x8cee('0x36')](_0x37f6e6[_0x8cee('0x33')]['fields']));_0x244c60[_0x8cee('0x34')]=_0x244c60[_0x8cee('0x34')][_0x8cee('0x43')]?_0x244c60['attributes']:_0x5ecb09['model'];_0x244c60['order']=qs['sort'](_0x37f6e6[_0x8cee('0x33')][_0x8cee('0x4c')]);_0x244c60[_0x8cee('0x3d')]=qs['filters'](_[_0x8cee('0x39')](_0x37f6e6[_0x8cee('0x33')],_0x5ecb09[_0x8cee('0x32')]));if(_0x37f6e6[_0x8cee('0x33')][_0x8cee('0x3a')]){_0x244c60[_0x8cee('0x3d')]=_[_0x8cee('0x44')](_0x244c60[_0x8cee('0x3d')],{'$or':_[_0x8cee('0x2b')](_0x244c60[_0x8cee('0x34')],function(_0x1b40d0){var _0x5550f7={};_0x5550f7[_0x1b40d0]={'$like':'%'+_0x37f6e6[_0x8cee('0x33')][_0x8cee('0x3a')]+'%'};return _0x5550f7;})});}_0x244c60=_[_0x8cee('0x44')]({},_0x244c60,_0x37f6e6['options']);return _0x3f0a57[_0x8cee('0x4d')](_0x244c60);}})[_0x8cee('0x26')](function(_0x53959e){if(_0x53959e){_0x5cfb48=_0x53959e[_0x8cee('0x43')];if(!_0x37f6e6[_0x8cee('0x33')][_0x8cee('0x37')]('nolimit')){_0x244c60[_0x8cee('0x1f')]=qs[_0x8cee('0x1f')](_0x37f6e6[_0x8cee('0x33')][_0x8cee('0x1f')]);_0x244c60[_0x8cee('0x1d')]=qs['offset'](_0x37f6e6[_0x8cee('0x33')][_0x8cee('0x1d')]);}return _0x3f0a57[_0x8cee('0x4d')](_0x244c60);}})['then'](function(_0x6648b){if(_0x6648b){return _0x6648b?{'count':_0x5cfb48,'rows':_0x6648b}:null;}})[_0x8cee('0x26')](respondWithResult(_0x6f1319,null))[_0x8cee('0x46')](handleError(_0x6f1319,null));};exports[_0x8cee('0x4e')]=function(_0x3a27ee,_0x5613cb,_0x2204e4){if(_0x3a27ee['body']['id']){delete _0x3a27ee[_0x8cee('0x48')]['id'];}return db[_0x8cee('0x40')][_0x8cee('0x4a')]({'where':{'id':_0x3a27ee[_0x8cee('0x49')]['id']}})[_0x8cee('0x26')](handleEntityNotFound(_0x5613cb,null))[_0x8cee('0x26')](function(_0x5ec6c4){if(_0x5ec6c4){_0x3a27ee[_0x8cee('0x48')][_0x8cee('0x4f')]=_0x5ec6c4['id'];_0x3a27ee[_0x8cee('0x48')][_0x8cee('0x50')]=integrations[_0x8cee('0x51')](_0x3a27ee[_0x8cee('0x48')][_0x8cee('0x52')],_0x3a27ee[_0x8cee('0x48')][_0x8cee('0x2e')]);_0x3a27ee[_0x8cee('0x48')]['Descriptions']=integrations['getDescriptions'](_0x3a27ee[_0x8cee('0x48')][_0x8cee('0x52')],_0x3a27ee[_0x8cee('0x48')]['type']);return db['Dynamics365Configuration'][_0x8cee('0x47')](_0x3a27ee[_0x8cee('0x48')],{'include':[{'model':db[_0x8cee('0x53')],'as':_0x8cee('0x50')},{'model':db[_0x8cee('0x53')],'as':'Descriptions'}]});}return null;})[_0x8cee('0x26')](respondWithResult(_0x5613cb,null))['catch'](handleError(_0x5613cb,null));};exports['getFields']=function(_0x49b18a,_0x98af20,_0x5808ca){var _0x1087e8=_0x49b18a[_0x8cee('0x33')]['ticketType'];var _0x31cfbb=_0x1087e8==='incident'?_0x8cee('0x54'):_0x8cee('0x55');var _0x57ab97='';var _0x348707='';var _0x3a3600='';var _0x4cb877='';var _0x1f3f31='';var _0x5141ea='';var _0x4fa498='';var _0x30a313='';var _0x112a38=[_0x8cee('0x56'),_0x8cee('0x57'),_0x8cee('0x58'),_0x8cee('0x59'),_0x8cee('0x5a'),_0x8cee('0x5b'),'phonenumber',_0x8cee('0x5c'),_0x8cee('0x5d'),_0x8cee('0x5e')];var _0x27708a=[_0x8cee('0x5f'),_0x8cee('0x60'),_0x8cee('0x61'),_0x8cee('0x62'),'contactidname',_0x8cee('0x63'),_0x8cee('0x64'),_0x8cee('0x65'),_0x8cee('0x66'),'createdbyexternalpartyyominame',_0x8cee('0x67'),_0x8cee('0x68'),_0x8cee('0x69'),'createdonbehalfbyname',_0x8cee('0x6a'),_0x8cee('0x6b'),_0x8cee('0x6c'),_0x8cee('0x6d'),_0x8cee('0x6e'),_0x8cee('0x6f'),_0x8cee('0x70'),'entityimage_url',_0x8cee('0x71'),_0x8cee('0x72'),_0x8cee('0x73'),_0x8cee('0x74'),_0x8cee('0x75'),'influencescore',_0x8cee('0x76'),_0x8cee('0x77'),_0x8cee('0x78'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x8cee('0x79'),'modifiedbyyominame',_0x8cee('0x7a'),_0x8cee('0x7b'),_0x8cee('0x7c'),_0x8cee('0x7d'),_0x8cee('0x7e'),'numberofchildincidents',_0x8cee('0x7f'),_0x8cee('0x80'),_0x8cee('0x81'),'owneridtype',_0x8cee('0x82'),'parentcaseidname','primarycontactidname',_0x8cee('0x83'),_0x8cee('0x84'),_0x8cee('0x85'),'productserialnumber',_0x8cee('0x86'),_0x8cee('0x87'),_0x8cee('0x88'),_0x8cee('0x89'),_0x8cee('0x8a'),'sentimentvalue',_0x8cee('0x8b'),'slaname',_0x8cee('0x8c'),_0x8cee('0x8d'),_0x8cee('0x8e'),_0x8cee('0x8f'),_0x8cee('0x90'),_0x8cee('0x91'),'transactioncurrencyidname',_0x8cee('0x92'),_0x8cee('0x93'),_0x8cee('0x94')];var _0x353bbe=_0x112a38['concat'](_0x27708a);return db[_0x8cee('0x40')]['findOne']({'where':{'id':_0x49b18a[_0x8cee('0x49')]['id']},'attributes':['id',_0x8cee('0x95'),'password',_0x8cee('0x96'),'tenantId',_0x8cee('0x97'),_0x8cee('0x98')]})[_0x8cee('0x26')](handleEntityNotFound(_0x98af20,null))[_0x8cee('0x26')](function(_0x21a385){if(_0x21a385){_0x30a313=_0x21a385[_0x8cee('0x96')];var _0x4d34c9=_0x30a313['slice'](-0x1);if(_0x4d34c9==='/'){_0x30a313=_0x30a313[_0x8cee('0x99')](0x0,_0x30a313[_0x8cee('0x9a')](_0x4d34c9));}_0x4fa498=util[_0x8cee('0x9b')](_0x8cee('0x9c'),_0x30a313);var _0x4b865a={'method':_0x8cee('0x9d'),'uri':_0x8cee('0x9e')+_0x21a385['tenantId']+'/oauth2/token','form':{'client_id':_0x21a385[_0x8cee('0x97')],'resource':_0x30a313,'username':_0x21a385[_0x8cee('0x95')],'password':_0x21a385[_0x8cee('0x9f')],'grant_type':'password','client_secret':_0x21a385[_0x8cee('0x98')]},'json':!![]};return rp(_0x4b865a);}})[_0x8cee('0x26')](function(_0x259b2a){_0x5141ea=_0x259b2a[_0x8cee('0xa0')];var _0x1f8775={'method':'GET','uri':encodeURI(_0x4fa498+_0x8cee('0xa1')+_0x31cfbb+'\x27'),'headers':{'Authorization':_0x8cee('0xa2')+_0x5141ea,'If-None-Match':null,'OData-Version':_0x8cee('0xa3')},'json':!![]};return rp(_0x1f8775);})[_0x8cee('0x26')](function(_0x531cf6){var _0x4c9562=_0x531cf6['value'][0x0];var _0xaaa7f9=_0x4c9562['MetadataId'];var _0x1b5491={'method':'GET','uri':_0x4fa498+_0x8cee('0xa4')+_0xaaa7f9+_0x8cee('0xa5'),'headers':{'Authorization':'Bearer\x20'+_0x5141ea,'If-None-Match':null,'OData-Version':_0x8cee('0xa3')},'json':!![]};return rp(_0x1b5491);})[_0x8cee('0x26')](function(_0xc874b6){_0x57ab97=_0xc874b6;_0x348707=_0x57ab97[_0x8cee('0xa6')];_0x348707=_[_0x8cee('0xa7')](_0x348707,function(_0x34bc01){return!_0x353bbe[_0x8cee('0xa8')](_0x34bc01[_0x8cee('0xa9')]);});var _0x5951bf=[];var _0x52a90a=[];_0x348707[_0x8cee('0xaa')](function(_0x3beaa0){if(_0x3beaa0['@odata.type']){var _0x32f864=_0x3beaa0[_0x8cee('0xab')][_0x8cee('0x99')](_0x3beaa0[_0x8cee('0xab')][_0x8cee('0x9a')]('.')+0x1);if(_0x32f864===_0x8cee('0xac')){_0x5951bf[_0x8cee('0xad')](getSelectList(_0x4fa498,_0x1087e8,_0x52a90a,_0x57ab97[_0x8cee('0xae')],_0x3beaa0[_0x8cee('0xae')],_0x5141ea));}}});return Promise[_0x8cee('0xaf')](_0x5951bf);})[_0x8cee('0x26')](function(_0x5e79a0){_0x3a3600=_0x5e79a0[0x0];var _0x25f62d=[];var _0x21d002=[];_0x348707['forEach'](function(_0x2bf37e){if(!_[_0x8cee('0xb0')](_0x2bf37e[_0x8cee('0xab')])){var _0x2baae7=_0x2bf37e[_0x8cee('0xab')][_0x8cee('0x99')](_0x2bf37e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x2baae7===_0x8cee('0xb1')){_0x25f62d['push'](getBooleanList(_0x4fa498,_0x1087e8,_0x21d002,_0x57ab97[_0x8cee('0xae')],_0x2bf37e['MetadataId'],_0x5141ea));}}});return Promise[_0x8cee('0xaf')](_0x25f62d);})[_0x8cee('0x26')](function(_0x46cfd9){_0x4cb877=_0x46cfd9[0x0];var _0x4854b0=[];var _0x13d0ca=[];_0x348707[_0x8cee('0xaa')](function(_0x38319b){if(_0x38319b['@odata.type']){var _0xcfc20c=_0x38319b[_0x8cee('0xab')][_0x8cee('0x99')](_0x38319b[_0x8cee('0xab')]['lastIndexOf']('.')+0x1);if(_0xcfc20c==='StringAttributeMetadata'||_0xcfc20c==='DoubleAttributeMetadata'||_0xcfc20c===_0x8cee('0xb2')||_0xcfc20c==='IntegerAttributeMetadata'||_0xcfc20c==='MemoAttributeMetadata'||_0xcfc20c===_0x8cee('0xb3')||_0xcfc20c===_0x8cee('0xb4')||_0xcfc20c===_0x8cee('0xb5')||_0xcfc20c===_0x8cee('0xb6')||_0xcfc20c==='DecimalAttributeMetadata'){_0x4854b0[_0x8cee('0xad')](getInputList(_0x4fa498,_0x1087e8,_0xcfc20c,_0x13d0ca,_0x57ab97['MetadataId'],_0x38319b[_0x8cee('0xae')],_0x5141ea));}}});return Promise['all'](_0x4854b0);})[_0x8cee('0x26')](function(_0x2ac0e4){_0x1f3f31=_0x2ac0e4[0x0];var _0x1434d2=_0x3a3600[_0x8cee('0xb7')](_0x4cb877)[_0x8cee('0xb7')](_0x1f3f31);var _0x46a1ce={'count':_0x1434d2[_0x8cee('0x43')],'rows':_0x1434d2};return _0x46a1ce;})[_0x8cee('0x26')](respondWithResult(_0x98af20,null))[_0x8cee('0x46')](function(_0x3e219c){var _0x105cd4=_0x49b18a[_0x8cee('0x33')][_0x8cee('0xb8')]?0x1f4:_0x3e219c[_0x8cee('0xb9')]||0x1f4;logger[_0x8cee('0x27')](_0x3e219c[_0x8cee('0x28')]);delete _0x3e219c[_0x8cee('0x29')];if(_0x105cd4===0x191){_0x105cd4=0x190;}_0x98af20[_0x8cee('0x1a')](_0x105cd4)[_0x8cee('0x2a')](_0x49b18a[_0x8cee('0x33')][_0x8cee('0xb8')]?{'message':_0x8cee('0xba'),'statusCode':_0x3e219c[_0x8cee('0xb9')]}:_0x3e219c);});};function getSelectList(_0x751e74,_0x7ad805,_0x28c7a1,_0x521d3a,_0x475bde,_0x2b7f11){var _0xc321f6={'method':_0x8cee('0xbb'),'uri':_0x751e74+'EntityDefinitions('+_0x521d3a+_0x8cee('0xbc')+_0x475bde+_0x8cee('0xbd')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x8cee('0xa2')+_0x2b7f11,'If-None-Match':null,'OData-Version':_0x8cee('0xa3')},'json':!![]};return rp(_0xc321f6)['then'](function(_0x2b7ea2){var _0x4761bd=[];var _0x3fa672=_0x2b7ea2[_0x8cee('0xbe')][_0x8cee('0xbf')];_0x3fa672[_0x8cee('0xaa')](function(_0x3f531b){_0x4761bd[_0x8cee('0xad')]({'name':_0x3f531b[_0x8cee('0xc0')][_0x8cee('0xc1')][_0x8cee('0xc0')],'value':String(_0x3f531b[_0x8cee('0xc2')])});});var _0x138ae4={'id':_0x7ad805+'_'+_0x2b7ea2[_0x8cee('0xa9')],'name':_0x2b7ea2[_0x8cee('0xc3')][_0x8cee('0xc1')][_0x8cee('0xc0')],'custom':![],'options':_0x4761bd};_0x28c7a1[_0x8cee('0xad')](_0x138ae4);return _0x28c7a1;});}function getBooleanList(_0x5cfe3d,_0x575f0f,_0x5448ed,_0x1131a1,_0x3474bd,_0x2247d0){var _0x45414a={'method':_0x8cee('0xbb'),'uri':_0x5cfe3d+_0x8cee('0xa4')+_0x1131a1+_0x8cee('0xbc')+_0x3474bd+_0x8cee('0xc4'),'headers':{'Authorization':_0x8cee('0xa2')+_0x2247d0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x45414a)[_0x8cee('0x26')](function(_0x1f25ba){var _0x4673fa=[];_0x4673fa[_0x8cee('0xad')]({'name':_0x1f25ba[_0x8cee('0xbe')][_0x8cee('0xc5')]['Label']['UserLocalizedLabel'][_0x8cee('0xc0')],'value':_0x8cee('0xc6')},{'name':_0x1f25ba[_0x8cee('0xbe')][_0x8cee('0xc7')]['Label'][_0x8cee('0xc1')][_0x8cee('0xc0')],'value':_0x8cee('0xc8')});var _0x46f761={'id':_0x575f0f+'_'+_0x1f25ba[_0x8cee('0xa9')],'name':_0x1f25ba['DisplayName'][_0x8cee('0xc1')][_0x8cee('0xc0')],'custom':![],'options':_0x4673fa};_0x5448ed[_0x8cee('0xad')](_0x46f761);return _0x5448ed;});}function getInputList(_0x5b3a9c,_0x5ab484,_0x4e21b2,_0x14f4cd,_0x1b39c9,_0x53ed44,_0xa02df2){var _0x40a2b0={'method':_0x8cee('0xbb'),'uri':_0x5b3a9c+_0x8cee('0xa4')+_0x1b39c9+_0x8cee('0xbc')+_0x53ed44+_0x8cee('0xc9')+_0x4e21b2+_0x8cee('0xca'),'headers':{'Authorization':_0x8cee('0xa2')+_0xa02df2,'If-None-Match':null,'OData-Version':_0x8cee('0xa3')},'json':!![]};return rp(_0x40a2b0)['then'](function(_0x5219ca){var _0x225434={'id':_0x5ab484+'_'+_0x5219ca[_0x8cee('0xa9')],'name':_0x5219ca['DisplayName'][_0x8cee('0xc1')]?_0x5219ca[_0x8cee('0xc3')][_0x8cee('0xc1')][_0x8cee('0xc0')]:_0x5219ca[_0x8cee('0xa9')],'custom':![],'options':[]};_0x14f4cd[_0x8cee('0xad')](_0x225434);return _0x14f4cd;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3998ae6..87d8498 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(_0x263551,_0x28e61e){var _0x5b9876=function(_0xafc9fa){while(--_0xafc9fa){_0x263551['push'](_0x263551['shift']());}};_0x5b9876(++_0x28e61e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x3e4f11,_0x38cb0d){var _0x3fd9d1=function(_0x33828f){while(--_0x33828f){_0x3e4f11['push'](_0x3e4f11['shift']());}};_0x3fd9d1(++_0x38cb0d);}(_0xe706,0xa3));var _0x6e70=function(_0x270075,_0x142657){_0x270075=_0x270075-0x0;var _0x24a211=_0xe706[_0x270075];return _0x24a211;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'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 0123b3e..a353e8f 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 _0x61f9=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','then','ShowDynamics365Account','find','stringify'];(function(_0x353d59,_0xbc0e8e){var _0x59d50f=function(_0x397865){while(--_0x397865){_0x353d59['push'](_0x353d59['shift']());}};_0x59d50f(++_0xbc0e8e);}(_0x61f9,0x1d1));var _0x961f=function(_0x582ec4,_0x1e3475){_0x582ec4=_0x582ec4-0x0;var _0x5d7b1b=_0x61f9[_0x582ec4];return _0x5d7b1b;};'use strict';var _=require('lodash');var util=require(_0x961f('0x0'));var moment=require('moment');var BPromise=require(_0x961f('0x1'));var rs=require(_0x961f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x961f('0x3'));var logger=require(_0x961f('0x4'))(_0x961f('0x5'));var config=require(_0x961f('0x6'));var jayson=require(_0x961f('0x7'));var client=jayson['client'][_0x961f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x535dc5,_0x38b0f4,_0x49f8ae){return new BPromise(function(_0x1868b1,_0x25442a){return client['request'](_0x535dc5,_0x49f8ae)['then'](function(_0x462896){logger[_0x961f('0x9')](_0x961f('0xa'),_0x38b0f4,_0x961f('0xb'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x38b0f4,'request\x20sent',JSON['stringify'](_0x462896));if(_0x462896[_0x961f('0xc')]){if(_0x462896[_0x961f('0xc')][_0x961f('0xd')]===0x1f4){logger[_0x961f('0xc')](_0x961f('0xa'),_0x38b0f4,_0x462896[_0x961f('0xc')][_0x961f('0xe')]);return _0x25442a(_0x462896[_0x961f('0xc')]['message']);}logger[_0x961f('0xc')](_0x961f('0xa'),_0x38b0f4,_0x462896[_0x961f('0xc')][_0x961f('0xe')]);return _0x1868b1(_0x462896[_0x961f('0xc')][_0x961f('0xe')]);}else{logger[_0x961f('0x9')](_0x961f('0xa'),_0x38b0f4,_0x961f('0xb'));_0x1868b1(_0x462896[_0x961f('0xf')][_0x961f('0xe')]);}})[_0x961f('0x10')](function(_0x2a1f2e){logger[_0x961f('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x38b0f4,_0x2a1f2e);_0x25442a(_0x2a1f2e);});});}exports[_0x961f('0x11')]=function(_0x4e9d39){var _0x1c63ea=this;return new Promise(function(_0x3f9d7b,_0x4353f3){return db[_0x961f('0x12')][_0x961f('0x13')]({'raw':_0x4e9d39['options']?_0x4e9d39[_0x961f('0x14')][_0x961f('0x15')]===undefined?!![]:![]:!![],'where':_0x4e9d39[_0x961f('0x14')]?_0x4e9d39[_0x961f('0x14')]['where']||null:null,'attributes':_0x4e9d39['options']?_0x4e9d39[_0x961f('0x14')][_0x961f('0x16')]||null:null,'limit':_0x4e9d39[_0x961f('0x14')]?_0x4e9d39[_0x961f('0x14')][_0x961f('0x17')]||null:null,'include':_0x4e9d39[_0x961f('0x14')]?_0x4e9d39[_0x961f('0x14')][_0x961f('0x18')]?_[_0x961f('0x19')](_0x4e9d39['options'][_0x961f('0x18')],function(_0x2d02bb){return{'model':db[_0x2d02bb[_0x961f('0x1a')]],'as':_0x2d02bb['as'],'attributes':_0x2d02bb[_0x961f('0x16')],'include':_0x2d02bb[_0x961f('0x18')]?_[_0x961f('0x19')](_0x2d02bb[_0x961f('0x18')],function(_0x382588){return{'model':db[_0x382588[_0x961f('0x1a')]],'as':_0x382588['as'],'attributes':_0x382588[_0x961f('0x16')],'include':_0x382588['include']?_[_0x961f('0x19')](_0x382588[_0x961f('0x18')],function(_0x4841ea){return{'model':db[_0x4841ea[_0x961f('0x1a')]],'as':_0x4841ea['as'],'attributes':_0x4841ea[_0x961f('0x16')]};}):[]};}):[]};}):[]:[]})[_0x961f('0x1b')](function(_0x5aaf6a){logger[_0x961f('0x9')](_0x961f('0x11'),_0x4e9d39);logger['debug'](_0x961f('0x11'),_0x4e9d39,JSON['stringify'](_0x5aaf6a));_0x3f9d7b(_0x5aaf6a);})['catch'](function(_0x4079f2){logger['error'](_0x961f('0x11'),_0x4079f2[_0x961f('0xe')],_0x4e9d39);_0x4353f3(_0x1c63ea[_0x961f('0xc')](0x1f4,_0x4079f2[_0x961f('0xe')]));});});};exports[_0x961f('0x1c')]=function(_0x1dedbd){var _0x1041d4=this;return new Promise(function(_0x41d44b,_0x59e899){return db['Dynamics365Account'][_0x961f('0x1d')]({'raw':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd[_0x961f('0x14')][_0x961f('0x15')]===undefined?!![]:![]:!![],'where':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd[_0x961f('0x14')]['where']||null:null,'attributes':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd[_0x961f('0x14')][_0x961f('0x16')]||null:null,'include':_0x1dedbd[_0x961f('0x14')]?_0x1dedbd['options']['include']?_[_0x961f('0x19')](_0x1dedbd[_0x961f('0x14')][_0x961f('0x18')],function(_0x2a07be){return{'model':db[_0x2a07be[_0x961f('0x1a')]],'as':_0x2a07be['as'],'attributes':_0x2a07be['attributes'],'include':_0x2a07be[_0x961f('0x18')]?_[_0x961f('0x19')](_0x2a07be[_0x961f('0x18')],function(_0x49a333){return{'model':db[_0x49a333[_0x961f('0x1a')]],'as':_0x49a333['as'],'attributes':_0x49a333[_0x961f('0x16')],'include':_0x49a333[_0x961f('0x18')]?_['map'](_0x49a333[_0x961f('0x18')],function(_0x22a864){return{'model':db[_0x22a864['model']],'as':_0x22a864['as'],'attributes':_0x22a864[_0x961f('0x16')]};}):[]};}):[]};}):[]:[]})[_0x961f('0x1b')](function(_0xc0abc5){logger[_0x961f('0x9')](_0x961f('0x1c'),_0x1dedbd);logger['debug']('ShowDynamics365Account',_0x1dedbd,JSON[_0x961f('0x1e')](_0xc0abc5));_0x41d44b(_0xc0abc5);})[_0x961f('0x10')](function(_0x1827e0){logger['error'](_0x961f('0x1c'),_0x1827e0[_0x961f('0xe')],_0x1dedbd);_0x59e899(_0x1041d4[_0x961f('0xc')](0x1f4,_0x1827e0[_0x961f('0xe')]));});});}; \ No newline at end of file +var _0x538b=['Dynamics365Account,\x20%s,\x20%s','message','result','catch','Dynamics365Account','options','attributes','limit','include','map','model','then','GetDynamics365Account','find','raw','where','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x4be6a0,_0x403cc8){var _0x4f3a6e=function(_0x4699fe){while(--_0x4699fe){_0x4be6a0['push'](_0x4be6a0['shift']());}};_0x4f3a6e(++_0x403cc8);}(_0x538b,0x7d));var _0xb538=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x538b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xb538('0x0'));var util=require(_0xb538('0x1'));var moment=require(_0xb538('0x2'));var BPromise=require(_0xb538('0x3'));var rs=require(_0xb538('0x4'));var fs=require('fs');var Redis=require(_0xb538('0x5'));var db=require(_0xb538('0x6'))['db'];var utils=require(_0xb538('0x7'));var logger=require(_0xb538('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb538('0x9'));var client=jayson[_0xb538('0xa')][_0xb538('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25a732,_0x4ae563,_0x3303a5){return new BPromise(function(_0x21fa2f,_0x30e0f8){return client[_0xb538('0xc')](_0x25a732,_0x3303a5)['then'](function(_0x20ad01){logger[_0xb538('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x4ae563,_0xb538('0xe'));logger[_0xb538('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4ae563,'request\x20sent',JSON[_0xb538('0x10')](_0x20ad01));if(_0x20ad01[_0xb538('0x11')]){if(_0x20ad01[_0xb538('0x11')][_0xb538('0x12')]===0x1f4){logger[_0xb538('0x11')](_0xb538('0x13'),_0x4ae563,_0x20ad01[_0xb538('0x11')][_0xb538('0x14')]);return _0x30e0f8(_0x20ad01['error'][_0xb538('0x14')]);}logger[_0xb538('0x11')](_0xb538('0x13'),_0x4ae563,_0x20ad01[_0xb538('0x11')][_0xb538('0x14')]);return _0x21fa2f(_0x20ad01['error'][_0xb538('0x14')]);}else{logger[_0xb538('0xd')](_0xb538('0x13'),_0x4ae563,_0xb538('0xe'));_0x21fa2f(_0x20ad01[_0xb538('0x15')][_0xb538('0x14')]);}})[_0xb538('0x16')](function(_0x5d16c9){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x4ae563,_0x5d16c9);_0x30e0f8(_0x5d16c9);});});}exports['GetDynamics365Account']=function(_0x596cd4){var _0x2edcb6=this;return new Promise(function(_0x4ed5e0,_0x18b2f5){return db[_0xb538('0x17')]['findAll']({'raw':_0x596cd4['options']?_0x596cd4[_0xb538('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x596cd4[_0xb538('0x18')]?_0x596cd4['options']['where']||null:null,'attributes':_0x596cd4[_0xb538('0x18')]?_0x596cd4[_0xb538('0x18')][_0xb538('0x19')]||null:null,'limit':_0x596cd4['options']?_0x596cd4['options'][_0xb538('0x1a')]||null:null,'include':_0x596cd4['options']?_0x596cd4[_0xb538('0x18')][_0xb538('0x1b')]?_[_0xb538('0x1c')](_0x596cd4[_0xb538('0x18')][_0xb538('0x1b')],function(_0x42f15e){return{'model':db[_0x42f15e[_0xb538('0x1d')]],'as':_0x42f15e['as'],'attributes':_0x42f15e[_0xb538('0x19')],'include':_0x42f15e[_0xb538('0x1b')]?_[_0xb538('0x1c')](_0x42f15e[_0xb538('0x1b')],function(_0x48880d){return{'model':db[_0x48880d[_0xb538('0x1d')]],'as':_0x48880d['as'],'attributes':_0x48880d[_0xb538('0x19')],'include':_0x48880d[_0xb538('0x1b')]?_[_0xb538('0x1c')](_0x48880d[_0xb538('0x1b')],function(_0x181cc7){return{'model':db[_0x181cc7[_0xb538('0x1d')]],'as':_0x181cc7['as'],'attributes':_0x181cc7[_0xb538('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb538('0x1e')](function(_0x1624b6){logger[_0xb538('0xd')](_0xb538('0x1f'),_0x596cd4);logger[_0xb538('0xf')](_0xb538('0x1f'),_0x596cd4,JSON[_0xb538('0x10')](_0x1624b6));_0x4ed5e0(_0x1624b6);})[_0xb538('0x16')](function(_0x2ff27a){logger[_0xb538('0x11')](_0xb538('0x1f'),_0x2ff27a[_0xb538('0x14')],_0x596cd4);_0x18b2f5(_0x2edcb6[_0xb538('0x11')](0x1f4,_0x2ff27a[_0xb538('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x18c0db){var _0x159b50=this;return new Promise(function(_0x597e78,_0x348fb1){return db[_0xb538('0x17')][_0xb538('0x20')]({'raw':_0x18c0db[_0xb538('0x18')]?_0x18c0db[_0xb538('0x18')][_0xb538('0x21')]===undefined?!![]:![]:!![],'where':_0x18c0db[_0xb538('0x18')]?_0x18c0db['options'][_0xb538('0x22')]||null:null,'attributes':_0x18c0db[_0xb538('0x18')]?_0x18c0db['options'][_0xb538('0x19')]||null:null,'include':_0x18c0db[_0xb538('0x18')]?_0x18c0db[_0xb538('0x18')][_0xb538('0x1b')]?_[_0xb538('0x1c')](_0x18c0db['options'][_0xb538('0x1b')],function(_0x580548){return{'model':db[_0x580548[_0xb538('0x1d')]],'as':_0x580548['as'],'attributes':_0x580548[_0xb538('0x19')],'include':_0x580548[_0xb538('0x1b')]?_[_0xb538('0x1c')](_0x580548[_0xb538('0x1b')],function(_0x3cee20){return{'model':db[_0x3cee20[_0xb538('0x1d')]],'as':_0x3cee20['as'],'attributes':_0x3cee20['attributes'],'include':_0x3cee20[_0xb538('0x1b')]?_['map'](_0x3cee20[_0xb538('0x1b')],function(_0x2b04f8){return{'model':db[_0x2b04f8[_0xb538('0x1d')]],'as':_0x2b04f8['as'],'attributes':_0x2b04f8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb538('0x1e')](function(_0x13379d){logger[_0xb538('0xd')]('ShowDynamics365Account',_0x18c0db);logger[_0xb538('0xf')](_0xb538('0x23'),_0x18c0db,JSON[_0xb538('0x10')](_0x13379d));_0x597e78(_0x13379d);})[_0xb538('0x16')](function(_0x284ae8){logger[_0xb538('0x11')](_0xb538('0x23'),_0x284ae8[_0xb538('0x14')],_0x18c0db);_0x348fb1(_0x159b50['error'](0x1f4,_0x284ae8['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 60392ad..edab4bf 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 _0xd276=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','post','create','put','/:id','update','exports','multer'];(function(_0x31c796,_0x2e3c7f){var _0x128356=function(_0x35534a){while(--_0x35534a){_0x31c796['push'](_0x31c796['shift']());}};_0x128356(++_0x2e3c7f);}(_0xd276,0xfc));var _0x6d27=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xd276[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x6d27('0x0'));var util=require(_0x6d27('0x1'));var path=require(_0x6d27('0x2'));var timeout=require(_0x6d27('0x3'));var express=require('express');var router=express[_0x6d27('0x4')]();var fs_extra=require(_0x6d27('0x5'));var auth=require(_0x6d27('0x6'));var interaction=require(_0x6d27('0x7'));var config=require('../../config/environment');var controller=require(_0x6d27('0x8'));router[_0x6d27('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d27('0xa')]);router[_0x6d27('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6d27('0xb')]);router[_0x6d27('0x9')](_0x6d27('0xc'),auth[_0x6d27('0xd')](),controller[_0x6d27('0xe')]);router[_0x6d27('0x9')](_0x6d27('0xf'),auth[_0x6d27('0xd')](),controller[_0x6d27('0x10')]);router[_0x6d27('0x9')]('/:id/descriptions',auth[_0x6d27('0xd')](),controller['getDescriptions']);router[_0x6d27('0x11')]('/',auth[_0x6d27('0xd')](),controller[_0x6d27('0x12')]);router[_0x6d27('0x13')](_0x6d27('0x14'),auth[_0x6d27('0xd')](),controller[_0x6d27('0x15')]);router['delete']('/:id',auth[_0x6d27('0xd')](),controller['destroy']);module[_0x6d27('0x16')]=router; \ No newline at end of file +var _0x8101=['/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x450c0f,_0x473776){var _0x59c286=function(_0x1d2db3){while(--_0x1d2db3){_0x450c0f['push'](_0x450c0f['shift']());}};_0x59c286(++_0x473776);}(_0x8101,0xc0));var _0x1810=function(_0x15de11,_0x3cd20d){_0x15de11=_0x15de11-0x0;var _0x4f1c07=_0x8101[_0x15de11];return _0x4f1c07;};'use strict';var multer=require(_0x1810('0x0'));var util=require(_0x1810('0x1'));var path=require(_0x1810('0x2'));var timeout=require(_0x1810('0x3'));var express=require(_0x1810('0x4'));var router=express[_0x1810('0x5')]();var fs_extra=require(_0x1810('0x6'));var auth=require(_0x1810('0x7'));var interaction=require(_0x1810('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x1810('0x9')]('/',auth[_0x1810('0xa')](),controller['index']);router[_0x1810('0x9')](_0x1810('0xb'),auth[_0x1810('0xa')](),controller[_0x1810('0xc')]);router[_0x1810('0x9')](_0x1810('0xd'),auth[_0x1810('0xa')](),controller[_0x1810('0xe')]);router[_0x1810('0x9')](_0x1810('0xf'),auth[_0x1810('0xa')](),controller['getSubjects']);router[_0x1810('0x9')](_0x1810('0x10'),auth['isAuthenticated'](),controller[_0x1810('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1810('0x12')]);router[_0x1810('0x13')](_0x1810('0xb'),auth[_0x1810('0xa')](),controller[_0x1810('0x14')]);router[_0x1810('0x15')]('/:id',auth[_0x1810('0xa')](),controller[_0x1810('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 1599ec4..f8132a2 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 _0xa3cc=['ENUM','incident','sequelize','exports','STRING'];(function(_0x113a96,_0x47d645){var _0x5cce26=function(_0x1bcf21){while(--_0x1bcf21){_0x113a96['push'](_0x113a96['shift']());}};_0x5cce26(++_0x47d645);}(_0xa3cc,0x1dd));var _0xca3c=function(_0x448b76,_0x382e4e){_0x448b76=_0x448b76-0x0;var _0x40b35b=_0xa3cc[_0x448b76];return _0x40b35b;};'use strict';var Sequelize=require(_0xca3c('0x0'));module[_0xca3c('0x1')]={'name':{'type':Sequelize[_0xca3c('0x2')]},'description':{'type':Sequelize[_0xca3c('0x2')]},'ticketType':{'type':Sequelize[_0xca3c('0x3')]('incident','phonecall'),'defaultValue':_0xca3c('0x4')}}; \ No newline at end of file +var _0x6301=['phonecall','STRING','incident'];(function(_0x1129cf,_0xa0c4ea){var _0x5b00b6=function(_0x36bebb){while(--_0x36bebb){_0x1129cf['push'](_0x1129cf['shift']());}};_0x5b00b6(++_0xa0c4ea);}(_0x6301,0x10c));var _0x1630=function(_0x564eec,_0x2174aa){_0x564eec=_0x564eec-0x0;var _0xb25d75=_0x6301[_0x564eec];return _0xb25d75;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1630('0x0')]},'description':{'type':Sequelize[_0x1630('0x0')]},'ticketType':{'type':Sequelize['ENUM'](_0x1630('0x1'),_0x1630('0x2')),'defaultValue':_0x1630('0x1')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index fecb9cd..6481abe 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 _0x847a=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','Dynamics365Field','length','hasOwnProperty','getSubjects','nolimit','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x847a,0x8f));var _0xa847=function(_0x4833cf,_0x2d22a3){_0x4833cf=_0x4833cf-0x0;var _0x4cea7f=_0x847a[_0x4833cf];return _0x4cea7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa847('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa847('0x1'));var rp=require(_0xa847('0x2'));var moment=require('moment');var BPromise=require(_0xa847('0x3'));var Mustache=require(_0xa847('0x4'));var util=require(_0xa847('0x5'));var path=require(_0xa847('0x6'));var sox=require(_0xa847('0x7'));var csv=require(_0xa847('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa847('0x9'));var _=require(_0xa847('0xa'));var squel=require(_0xa847('0xb'));var crypto=require(_0xa847('0xc'));var jsforce=require(_0xa847('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa847('0xe'));var Papa=require(_0xa847('0xf'));var Redis=require(_0xa847('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa847('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa847('0x12'))(_0xa847('0x13'));var utils=require(_0xa847('0x14'));var config=require(_0xa847('0x15'));var licenseUtil=require(_0xa847('0x16'));var db=require(_0xa847('0x17'))['db'];function respondWithStatusCode(_0x35a658,_0x255415){_0x255415=_0x255415||0xcc;return function(_0x10ccaf){if(_0x10ccaf){return _0x35a658[_0xa847('0x18')](_0x255415);}return _0x35a658[_0xa847('0x19')](_0x255415)['end']();};}function respondWithResult(_0x28670c,_0x38dcd0){_0x38dcd0=_0x38dcd0||0xc8;return function(_0x1af371){if(_0x1af371){return _0x28670c[_0xa847('0x19')](_0x38dcd0)[_0xa847('0x1a')](_0x1af371);}};}function respondWithFilteredResult(_0x1cfe06,_0x2ce256){return function(_0x1ee6db){if(_0x1ee6db){var _0x222133=typeof _0x2ce256[_0xa847('0x1b')]===_0xa847('0x1c')&&typeof _0x2ce256['limit']===_0xa847('0x1c');var _0x279c68=_0x1ee6db[_0xa847('0x1d')];var _0x5ac103=_0x222133?0x0:_0x2ce256['offset'];var _0x5592e0=_0x222133?_0x1ee6db['count']:_0x2ce256[_0xa847('0x1b')]+_0x2ce256[_0xa847('0x1e')];var _0x50a63d;if(_0x5592e0>=_0x279c68){_0x5592e0=_0x279c68;_0x50a63d=0xc8;}else{_0x50a63d=0xce;}_0x1cfe06[_0xa847('0x19')](_0x50a63d);return _0x1cfe06['set'](_0xa847('0x1f'),_0x5ac103+'-'+_0x5592e0+'/'+_0x279c68)['json'](_0x1ee6db);}return null;};}function patchUpdates(_0x2e474d){return function(_0x4a5dd6){try{jsonpatch[_0xa847('0x20')](_0x4a5dd6,_0x2e474d,!![]);}catch(_0x5b0529){return BPromise[_0xa847('0x21')](_0x5b0529);}return _0x4a5dd6[_0xa847('0x22')]();};}function saveUpdates(_0x4df40f,_0x41d08c){return function(_0x40e045){if(_0x40e045){return _0x40e045[_0xa847('0x23')](_0x4df40f)[_0xa847('0x24')](function(_0x341051){return _0x341051;});}return null;};}function removeEntity(_0x5944f5,_0x4c631a){return function(_0x4e0140){if(_0x4e0140){return _0x4e0140[_0xa847('0x25')]()[_0xa847('0x24')](function(){_0x5944f5[_0xa847('0x19')](0xcc)[_0xa847('0x26')]();});}};}function handleEntityNotFound(_0x236829,_0x588f0a){return function(_0x347654){if(!_0x347654){_0x236829['sendStatus'](0x194);}return _0x347654;};}function handleError(_0x41e6d8,_0x1fa00c){_0x1fa00c=_0x1fa00c||0x1f4;return function(_0x3e7680){logger[_0xa847('0x27')](_0x3e7680[_0xa847('0x28')]);if(_0x3e7680[_0xa847('0x29')]){delete _0x3e7680['name'];}_0x41e6d8[_0xa847('0x19')](_0x1fa00c)['send'](_0x3e7680);};}exports[_0xa847('0x2a')]=function(_0x2534f3,_0x1c0bd4){var _0x50fdbb={},_0x5dfe1a={},_0x389808={'count':0x0,'rows':[]};var _0x3b1b30=_[_0xa847('0x2b')](db['Dynamics365Configuration'][_0xa847('0x2c')],function(_0x427469){return{'name':_0x427469['fieldName'],'type':_0x427469[_0xa847('0x2d')]['key']};});_0x5dfe1a[_0xa847('0x2e')]=_[_0xa847('0x2b')](_0x3b1b30,_0xa847('0x29'));_0x5dfe1a[_0xa847('0x2f')]=_[_0xa847('0x30')](_0x2534f3[_0xa847('0x2f')]);_0x5dfe1a[_0xa847('0x31')]=_[_0xa847('0x32')](_0x5dfe1a[_0xa847('0x2e')],_0x5dfe1a['query']);_0x50fdbb[_0xa847('0x33')]=_[_0xa847('0x32')](_0x5dfe1a[_0xa847('0x2e')],qs[_0xa847('0x34')](_0x2534f3[_0xa847('0x2f')][_0xa847('0x34')]));_0x50fdbb[_0xa847('0x33')]=_0x50fdbb[_0xa847('0x33')]['length']?_0x50fdbb[_0xa847('0x33')]:_0x5dfe1a[_0xa847('0x2e')];if(!_0x2534f3[_0xa847('0x2f')]['hasOwnProperty']('nolimit')){_0x50fdbb[_0xa847('0x1e')]=qs[_0xa847('0x1e')](_0x2534f3[_0xa847('0x2f')]['limit']);_0x50fdbb['offset']=qs[_0xa847('0x1b')](_0x2534f3[_0xa847('0x2f')][_0xa847('0x1b')]);}_0x50fdbb[_0xa847('0x35')]=qs[_0xa847('0x36')](_0x2534f3[_0xa847('0x2f')][_0xa847('0x36')]);_0x50fdbb[_0xa847('0x37')]=qs[_0xa847('0x31')](_[_0xa847('0x38')](_0x2534f3[_0xa847('0x2f')],_0x5dfe1a[_0xa847('0x31')]),_0x3b1b30);if(_0x2534f3['query'][_0xa847('0x39')]){_0x50fdbb[_0xa847('0x37')]=_[_0xa847('0x3a')](_0x50fdbb[_0xa847('0x37')],{'$or':_['map'](_0x3b1b30,function(_0x4c49f4){if(_0x4c49f4[_0xa847('0x2d')]!==_0xa847('0x3b')){var _0x1fc925={};_0x1fc925[_0x4c49f4[_0xa847('0x29')]]={'$like':'%'+_0x2534f3[_0xa847('0x2f')][_0xa847('0x39')]+'%'};return _0x1fc925;}})});}_0x50fdbb=_['merge']({},_0x50fdbb,_0x2534f3[_0xa847('0x3c')]);var _0x5763b2={'where':_0x50fdbb['where']};return db[_0xa847('0x3d')][_0xa847('0x1d')](_0x5763b2)[_0xa847('0x24')](function(_0x1f50da){_0x389808[_0xa847('0x1d')]=_0x1f50da;if(_0x2534f3['query'][_0xa847('0x3e')]){_0x50fdbb[_0xa847('0x3f')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xa847('0x40')](_0x50fdbb);})[_0xa847('0x24')](function(_0x5121e4){_0x389808[_0xa847('0x41')]=_0x5121e4;return _0x389808;})[_0xa847('0x24')](respondWithFilteredResult(_0x1c0bd4,_0x50fdbb))[_0xa847('0x42')](handleError(_0x1c0bd4,null));};exports[_0xa847('0x43')]=function(_0x1cd157,_0x1de382){var _0x22d8b4={'raw':![],'where':{'id':_0x1cd157[_0xa847('0x44')]['id']}},_0x5b2288={};_0x5b2288[_0xa847('0x2e')]=_[_0xa847('0x30')](db[_0xa847('0x3d')][_0xa847('0x2c')]);_0x5b2288[_0xa847('0x2f')]=_[_0xa847('0x30')](_0x1cd157[_0xa847('0x2f')]);_0x5b2288[_0xa847('0x31')]=_[_0xa847('0x32')](_0x5b2288['model'],_0x5b2288['query']);_0x22d8b4[_0xa847('0x33')]=_[_0xa847('0x32')](_0x5b2288[_0xa847('0x2e')],qs[_0xa847('0x34')](_0x1cd157[_0xa847('0x2f')][_0xa847('0x34')]));_0x22d8b4[_0xa847('0x33')]=_0x22d8b4[_0xa847('0x33')]['length']?_0x22d8b4[_0xa847('0x33')]:_0x5b2288[_0xa847('0x2e')];if(_0x1cd157[_0xa847('0x2f')][_0xa847('0x3e')]){_0x22d8b4[_0xa847('0x3f')]=[{'all':!![]}];}_0x22d8b4=_['merge']({},_0x22d8b4,_0x1cd157['options']);return db[_0xa847('0x3d')][_0xa847('0x45')](_0x22d8b4)[_0xa847('0x24')](handleEntityNotFound(_0x1de382,null))[_0xa847('0x24')](respondWithResult(_0x1de382,null))[_0xa847('0x42')](handleError(_0x1de382,null));};exports[_0xa847('0x46')]=function(_0x38b1a4,_0x1127ef){return db[_0xa847('0x3d')]['create'](_0x38b1a4[_0xa847('0x47')],{})[_0xa847('0x24')](respondWithResult(_0x1127ef,0xc9))[_0xa847('0x42')](handleError(_0x1127ef,null));};exports[_0xa847('0x23')]=function(_0x1c3ad1,_0x1cda13){if(_0x1c3ad1[_0xa847('0x47')]['id']){delete _0x1c3ad1[_0xa847('0x47')]['id'];}return db['Dynamics365Configuration'][_0xa847('0x45')]({'where':{'id':_0x1c3ad1[_0xa847('0x44')]['id']}})['then'](handleEntityNotFound(_0x1cda13,null))[_0xa847('0x24')](saveUpdates(_0x1c3ad1['body'],null))[_0xa847('0x24')](respondWithResult(_0x1cda13,null))[_0xa847('0x42')](handleError(_0x1cda13,null));};exports[_0xa847('0x25')]=function(_0x151f9f,_0x1f6113){return db[_0xa847('0x3d')]['find']({'where':{'id':_0x151f9f[_0xa847('0x44')]['id']}})[_0xa847('0x24')](handleEntityNotFound(_0x1f6113,null))[_0xa847('0x24')](removeEntity(_0x1f6113,null))[_0xa847('0x42')](handleError(_0x1f6113,null));};exports[_0xa847('0x48')]=function(_0xadeb28,_0x5a78f8,_0x4290a3){var _0x3d8907={};var _0x216fbd={};var _0xee7572;var _0x1c30d6;return db['Dynamics365Configuration'][_0xa847('0x49')]({'where':{'id':_0xadeb28['params']['id']}})[_0xa847('0x24')](handleEntityNotFound(_0x5a78f8,null))[_0xa847('0x24')](function(_0x18b09b){if(_0x18b09b){_0xee7572=_0x18b09b;_0x216fbd['model']=_[_0xa847('0x30')](db[_0xa847('0x4a')][_0xa847('0x2c')]);_0x216fbd[_0xa847('0x2f')]=_[_0xa847('0x30')](_0xadeb28['query']);_0x216fbd[_0xa847('0x31')]=_[_0xa847('0x32')](_0x216fbd['model'],_0x216fbd[_0xa847('0x2f')]);_0x3d8907[_0xa847('0x33')]=_[_0xa847('0x32')](_0x216fbd[_0xa847('0x2e')],qs[_0xa847('0x34')](_0xadeb28[_0xa847('0x2f')]['fields']));_0x3d8907[_0xa847('0x33')]=_0x3d8907['attributes'][_0xa847('0x4b')]?_0x3d8907[_0xa847('0x33')]:_0x216fbd[_0xa847('0x2e')];_0x3d8907[_0xa847('0x35')]=qs[_0xa847('0x36')](_0xadeb28[_0xa847('0x2f')]['sort']);_0x3d8907[_0xa847('0x37')]=qs[_0xa847('0x31')](_[_0xa847('0x38')](_0xadeb28[_0xa847('0x2f')],_0x216fbd[_0xa847('0x31')]));if(_0xadeb28[_0xa847('0x2f')][_0xa847('0x39')]){_0x3d8907['where']=_['merge'](_0x3d8907[_0xa847('0x37')],{'$or':_[_0xa847('0x2b')](_0x3d8907['attributes'],function(_0x3d0e13){var _0x164852={};_0x164852[_0x3d0e13]={'$like':'%'+_0xadeb28[_0xa847('0x2f')][_0xa847('0x39')]+'%'};return _0x164852;})});}_0x3d8907=_[_0xa847('0x3a')]({},_0x3d8907,_0xadeb28[_0xa847('0x3c')]);return _0xee7572['getFields'](_0x3d8907);}})[_0xa847('0x24')](function(_0x34681e){if(_0x34681e){_0x1c30d6=_0x34681e[_0xa847('0x4b')];if(!_0xadeb28[_0xa847('0x2f')][_0xa847('0x4c')]('nolimit')){_0x3d8907[_0xa847('0x1e')]=qs[_0xa847('0x1e')](_0xadeb28['query'][_0xa847('0x1e')]);_0x3d8907[_0xa847('0x1b')]=qs['offset'](_0xadeb28[_0xa847('0x2f')][_0xa847('0x1b')]);}return _0xee7572['getFields'](_0x3d8907);}})[_0xa847('0x24')](function(_0x53b860){if(_0x53b860){return _0x53b860?{'count':_0x1c30d6,'rows':_0x53b860}:null;}})['then'](respondWithResult(_0x5a78f8,null))['catch'](handleError(_0x5a78f8,null));};exports[_0xa847('0x4d')]=function(_0x234386,_0x24bd06,_0xcab256){var _0x242eb5={};var _0x2d3d05={};var _0x1cfc35;var _0x4e6d08;return db[_0xa847('0x3d')][_0xa847('0x49')]({'where':{'id':_0x234386['params']['id']}})['then'](handleEntityNotFound(_0x24bd06,null))[_0xa847('0x24')](function(_0x2a5ec0){if(_0x2a5ec0){_0x1cfc35=_0x2a5ec0;_0x2d3d05[_0xa847('0x2e')]=_[_0xa847('0x30')](db[_0xa847('0x4a')][_0xa847('0x2c')]);_0x2d3d05[_0xa847('0x2f')]=_[_0xa847('0x30')](_0x234386['query']);_0x2d3d05[_0xa847('0x31')]=_['intersection'](_0x2d3d05['model'],_0x2d3d05[_0xa847('0x2f')]);_0x242eb5[_0xa847('0x33')]=_[_0xa847('0x32')](_0x2d3d05[_0xa847('0x2e')],qs['fields'](_0x234386[_0xa847('0x2f')][_0xa847('0x34')]));_0x242eb5[_0xa847('0x33')]=_0x242eb5[_0xa847('0x33')]['length']?_0x242eb5[_0xa847('0x33')]:_0x2d3d05[_0xa847('0x2e')];_0x242eb5[_0xa847('0x35')]=qs['sort'](_0x234386[_0xa847('0x2f')][_0xa847('0x36')]);_0x242eb5[_0xa847('0x37')]=qs['filters'](_['pick'](_0x234386[_0xa847('0x2f')],_0x2d3d05['filters']));if(_0x234386[_0xa847('0x2f')][_0xa847('0x39')]){_0x242eb5[_0xa847('0x37')]=_[_0xa847('0x3a')](_0x242eb5[_0xa847('0x37')],{'$or':_['map'](_0x242eb5[_0xa847('0x33')],function(_0x427c4f){var _0x4f21fa={};_0x4f21fa[_0x427c4f]={'$like':'%'+_0x234386[_0xa847('0x2f')][_0xa847('0x39')]+'%'};return _0x4f21fa;})});}_0x242eb5=_[_0xa847('0x3a')]({},_0x242eb5,_0x234386[_0xa847('0x3c')]);return _0x1cfc35[_0xa847('0x4d')](_0x242eb5);}})[_0xa847('0x24')](function(_0x35e71e){if(_0x35e71e){_0x4e6d08=_0x35e71e[_0xa847('0x4b')];if(!_0x234386[_0xa847('0x2f')]['hasOwnProperty'](_0xa847('0x4e'))){_0x242eb5['limit']=qs[_0xa847('0x1e')](_0x234386[_0xa847('0x2f')][_0xa847('0x1e')]);_0x242eb5['offset']=qs[_0xa847('0x1b')](_0x234386[_0xa847('0x2f')]['offset']);}return _0x1cfc35[_0xa847('0x4d')](_0x242eb5);}})['then'](function(_0x5e2127){if(_0x5e2127){return _0x5e2127?{'count':_0x4e6d08,'rows':_0x5e2127}:null;}})[_0xa847('0x24')](respondWithResult(_0x24bd06,null))['catch'](handleError(_0x24bd06,null));};exports[_0xa847('0x4f')]=function(_0x4d05ef,_0x205abe,_0x1243de){var _0x4e6617={};var _0x24ff65={};var _0xccd14f;var _0x47fc01;return db[_0xa847('0x3d')][_0xa847('0x49')]({'where':{'id':_0x4d05ef[_0xa847('0x44')]['id']}})[_0xa847('0x24')](handleEntityNotFound(_0x205abe,null))[_0xa847('0x24')](function(_0x5c483e){if(_0x5c483e){_0xccd14f=_0x5c483e;_0x24ff65[_0xa847('0x2e')]=_[_0xa847('0x30')](db[_0xa847('0x4a')][_0xa847('0x2c')]);_0x24ff65['query']=_[_0xa847('0x30')](_0x4d05ef[_0xa847('0x2f')]);_0x24ff65[_0xa847('0x31')]=_[_0xa847('0x32')](_0x24ff65[_0xa847('0x2e')],_0x24ff65[_0xa847('0x2f')]);_0x4e6617[_0xa847('0x33')]=_[_0xa847('0x32')](_0x24ff65[_0xa847('0x2e')],qs['fields'](_0x4d05ef[_0xa847('0x2f')][_0xa847('0x34')]));_0x4e6617[_0xa847('0x33')]=_0x4e6617[_0xa847('0x33')][_0xa847('0x4b')]?_0x4e6617[_0xa847('0x33')]:_0x24ff65[_0xa847('0x2e')];_0x4e6617[_0xa847('0x35')]=qs[_0xa847('0x36')](_0x4d05ef[_0xa847('0x2f')]['sort']);_0x4e6617[_0xa847('0x37')]=qs[_0xa847('0x31')](_[_0xa847('0x38')](_0x4d05ef[_0xa847('0x2f')],_0x24ff65[_0xa847('0x31')]));if(_0x4d05ef[_0xa847('0x2f')][_0xa847('0x39')]){_0x4e6617[_0xa847('0x37')]=_[_0xa847('0x3a')](_0x4e6617[_0xa847('0x37')],{'$or':_['map'](_0x4e6617[_0xa847('0x33')],function(_0x27b4f3){var _0x14cbd0={};_0x14cbd0[_0x27b4f3]={'$like':'%'+_0x4d05ef[_0xa847('0x2f')]['filter']+'%'};return _0x14cbd0;})});}_0x4e6617=_[_0xa847('0x3a')]({},_0x4e6617,_0x4d05ef[_0xa847('0x3c')]);return _0xccd14f[_0xa847('0x4f')](_0x4e6617);}})[_0xa847('0x24')](function(_0x5887ad){if(_0x5887ad){_0x47fc01=_0x5887ad[_0xa847('0x4b')];if(!_0x4d05ef[_0xa847('0x2f')][_0xa847('0x4c')](_0xa847('0x4e'))){_0x4e6617[_0xa847('0x1e')]=qs[_0xa847('0x1e')](_0x4d05ef[_0xa847('0x2f')][_0xa847('0x1e')]);_0x4e6617[_0xa847('0x1b')]=qs['offset'](_0x4d05ef[_0xa847('0x2f')][_0xa847('0x1b')]);}return _0xccd14f[_0xa847('0x4f')](_0x4e6617);}})[_0xa847('0x24')](function(_0x571eb4){if(_0x571eb4){return _0x571eb4?{'count':_0x47fc01,'rows':_0x571eb4}:null;}})[_0xa847('0x24')](respondWithResult(_0x205abe,null))[_0xa847('0x42')](handleError(_0x205abe,null));}; \ No newline at end of file +var _0x0a24=['VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','order','hasOwnProperty','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge'];(function(_0x3c965f,_0x2f0c8e){var _0x3aff2c=function(_0x58d56f){while(--_0x58d56f){_0x3c965f['push'](_0x3c965f['shift']());}};_0x3aff2c(++_0x2f0c8e);}(_0x0a24,0x19f));var _0x40a2=function(_0x48a80d,_0x1b2aaf){_0x48a80d=_0x48a80d-0x0;var _0x267bcb=_0x0a24[_0x48a80d];return _0x267bcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40a2('0x0'));var zipdir=require(_0x40a2('0x1'));var jsonpatch=require(_0x40a2('0x2'));var rp=require(_0x40a2('0x3'));var moment=require(_0x40a2('0x4'));var BPromise=require(_0x40a2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x40a2('0x6'));var csv=require(_0x40a2('0x7'));var ejs=require(_0x40a2('0x8'));var fs=require('fs');var fs_extra=require(_0x40a2('0x9'));var _=require(_0x40a2('0xa'));var squel=require(_0x40a2('0xb'));var crypto=require(_0x40a2('0xc'));var jsforce=require(_0x40a2('0xd'));var deskjs=require(_0x40a2('0xe'));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(_0x40a2('0xf'));var as=require(_0x40a2('0x10'));var hardwareService=require(_0x40a2('0x11'));var logger=require(_0x40a2('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x40a2('0x13'));var licenseUtil=require(_0x40a2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442c03,_0x1d3c4e){_0x1d3c4e=_0x1d3c4e||0xcc;return function(_0x2c9f46){if(_0x2c9f46){return _0x442c03['sendStatus'](_0x1d3c4e);}return _0x442c03['status'](_0x1d3c4e)[_0x40a2('0x15')]();};}function respondWithResult(_0x3a6746,_0x3b2d4c){_0x3b2d4c=_0x3b2d4c||0xc8;return function(_0x49e813){if(_0x49e813){return _0x3a6746[_0x40a2('0x16')](_0x3b2d4c)[_0x40a2('0x17')](_0x49e813);}};}function respondWithFilteredResult(_0x4886f9,_0x177c92){return function(_0x240e00){if(_0x240e00){var _0x1e48f7=typeof _0x177c92[_0x40a2('0x18')]===_0x40a2('0x19')&&typeof _0x177c92[_0x40a2('0x1a')]==='undefined';var _0x4d1e87=_0x240e00['count'];var _0x553b47=_0x1e48f7?0x0:_0x177c92[_0x40a2('0x18')];var _0x288ce6=_0x1e48f7?_0x240e00['count']:_0x177c92['offset']+_0x177c92['limit'];var _0x46ecb4;if(_0x288ce6>=_0x4d1e87){_0x288ce6=_0x4d1e87;_0x46ecb4=0xc8;}else{_0x46ecb4=0xce;}_0x4886f9['status'](_0x46ecb4);return _0x4886f9[_0x40a2('0x1b')](_0x40a2('0x1c'),_0x553b47+'-'+_0x288ce6+'/'+_0x4d1e87)[_0x40a2('0x17')](_0x240e00);}return null;};}function patchUpdates(_0xc0e210){return function(_0x54123d){try{jsonpatch[_0x40a2('0x1d')](_0x54123d,_0xc0e210,!![]);}catch(_0x443eb1){return BPromise[_0x40a2('0x1e')](_0x443eb1);}return _0x54123d[_0x40a2('0x1f')]();};}function saveUpdates(_0x5e7528,_0x55e1bb){return function(_0x578610){if(_0x578610){return _0x578610[_0x40a2('0x20')](_0x5e7528)[_0x40a2('0x21')](function(_0x119d84){return _0x119d84;});}return null;};}function removeEntity(_0x1a0494,_0x1fe8d1){return function(_0x2724c3){if(_0x2724c3){return _0x2724c3[_0x40a2('0x22')]()[_0x40a2('0x21')](function(){_0x1a0494[_0x40a2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe27f43,_0x2a737f){return function(_0x2417ae){if(!_0x2417ae){_0xe27f43[_0x40a2('0x23')](0x194);}return _0x2417ae;};}function handleError(_0x3fa639,_0x55276a){_0x55276a=_0x55276a||0x1f4;return function(_0x42453f){logger['error'](_0x42453f[_0x40a2('0x24')]);if(_0x42453f[_0x40a2('0x25')]){delete _0x42453f[_0x40a2('0x25')];}_0x3fa639['status'](_0x55276a)[_0x40a2('0x26')](_0x42453f);};}exports[_0x40a2('0x27')]=function(_0x10fc28,_0x16c86d){var _0x39a2f3={},_0x5ac775={},_0x30defe={'count':0x0,'rows':[]};var _0x1e0b3c=_[_0x40a2('0x28')](db[_0x40a2('0x29')][_0x40a2('0x2a')],function(_0x1ea390){return{'name':_0x1ea390[_0x40a2('0x2b')],'type':_0x1ea390[_0x40a2('0x2c')][_0x40a2('0x2d')]};});_0x5ac775['model']=_[_0x40a2('0x28')](_0x1e0b3c,_0x40a2('0x25'));_0x5ac775['query']=_[_0x40a2('0x2e')](_0x10fc28[_0x40a2('0x2f')]);_0x5ac775[_0x40a2('0x30')]=_[_0x40a2('0x31')](_0x5ac775[_0x40a2('0x32')],_0x5ac775[_0x40a2('0x2f')]);_0x39a2f3[_0x40a2('0x33')]=_[_0x40a2('0x31')](_0x5ac775[_0x40a2('0x32')],qs[_0x40a2('0x34')](_0x10fc28[_0x40a2('0x2f')][_0x40a2('0x34')]));_0x39a2f3[_0x40a2('0x33')]=_0x39a2f3[_0x40a2('0x33')][_0x40a2('0x35')]?_0x39a2f3[_0x40a2('0x33')]:_0x5ac775[_0x40a2('0x32')];if(!_0x10fc28[_0x40a2('0x2f')]['hasOwnProperty'](_0x40a2('0x36'))){_0x39a2f3[_0x40a2('0x1a')]=qs[_0x40a2('0x1a')](_0x10fc28[_0x40a2('0x2f')][_0x40a2('0x1a')]);_0x39a2f3[_0x40a2('0x18')]=qs[_0x40a2('0x18')](_0x10fc28[_0x40a2('0x2f')]['offset']);}_0x39a2f3['order']=qs['sort'](_0x10fc28[_0x40a2('0x2f')][_0x40a2('0x37')]);_0x39a2f3[_0x40a2('0x38')]=qs[_0x40a2('0x30')](_[_0x40a2('0x39')](_0x10fc28['query'],_0x5ac775[_0x40a2('0x30')]),_0x1e0b3c);if(_0x10fc28[_0x40a2('0x2f')]['filter']){_0x39a2f3[_0x40a2('0x38')]=_[_0x40a2('0x3a')](_0x39a2f3[_0x40a2('0x38')],{'$or':_[_0x40a2('0x28')](_0x1e0b3c,function(_0x2fa367){if(_0x2fa367[_0x40a2('0x2c')]!==_0x40a2('0x3b')){var _0x4bfaad={};_0x4bfaad[_0x2fa367[_0x40a2('0x25')]]={'$like':'%'+_0x10fc28['query'][_0x40a2('0x3c')]+'%'};return _0x4bfaad;}})});}_0x39a2f3=_[_0x40a2('0x3a')]({},_0x39a2f3,_0x10fc28[_0x40a2('0x3d')]);var _0x32bbcb={'where':_0x39a2f3[_0x40a2('0x38')]};return db[_0x40a2('0x29')][_0x40a2('0x3e')](_0x32bbcb)['then'](function(_0x4c4796){_0x30defe[_0x40a2('0x3e')]=_0x4c4796;if(_0x10fc28['query'][_0x40a2('0x3f')]){_0x39a2f3[_0x40a2('0x40')]=[{'all':!![]}];}return db[_0x40a2('0x29')][_0x40a2('0x41')](_0x39a2f3);})[_0x40a2('0x21')](function(_0x13187b){_0x30defe['rows']=_0x13187b;return _0x30defe;})['then'](respondWithFilteredResult(_0x16c86d,_0x39a2f3))[_0x40a2('0x42')](handleError(_0x16c86d,null));};exports[_0x40a2('0x43')]=function(_0x5dc434,_0x440c14){var _0x149896={'raw':![],'where':{'id':_0x5dc434[_0x40a2('0x44')]['id']}},_0x471cb0={};_0x471cb0['model']=_[_0x40a2('0x2e')](db['Dynamics365Configuration'][_0x40a2('0x2a')]);_0x471cb0['query']=_['keys'](_0x5dc434[_0x40a2('0x2f')]);_0x471cb0[_0x40a2('0x30')]=_[_0x40a2('0x31')](_0x471cb0[_0x40a2('0x32')],_0x471cb0['query']);_0x149896[_0x40a2('0x33')]=_[_0x40a2('0x31')](_0x471cb0[_0x40a2('0x32')],qs['fields'](_0x5dc434[_0x40a2('0x2f')][_0x40a2('0x34')]));_0x149896[_0x40a2('0x33')]=_0x149896['attributes'][_0x40a2('0x35')]?_0x149896['attributes']:_0x471cb0[_0x40a2('0x32')];if(_0x5dc434[_0x40a2('0x2f')][_0x40a2('0x3f')]){_0x149896['include']=[{'all':!![]}];}_0x149896=_['merge']({},_0x149896,_0x5dc434[_0x40a2('0x3d')]);return db[_0x40a2('0x29')][_0x40a2('0x45')](_0x149896)['then'](handleEntityNotFound(_0x440c14,null))[_0x40a2('0x21')](respondWithResult(_0x440c14,null))[_0x40a2('0x42')](handleError(_0x440c14,null));};exports['create']=function(_0x185556,_0x256465){return db['Dynamics365Configuration'][_0x40a2('0x46')](_0x185556[_0x40a2('0x47')],{})['then'](respondWithResult(_0x256465,0xc9))[_0x40a2('0x42')](handleError(_0x256465,null));};exports['update']=function(_0x270759,_0x5898d8){if(_0x270759['body']['id']){delete _0x270759[_0x40a2('0x47')]['id'];}return db[_0x40a2('0x29')][_0x40a2('0x45')]({'where':{'id':_0x270759[_0x40a2('0x44')]['id']}})[_0x40a2('0x21')](handleEntityNotFound(_0x5898d8,null))[_0x40a2('0x21')](saveUpdates(_0x270759[_0x40a2('0x47')],null))['then'](respondWithResult(_0x5898d8,null))[_0x40a2('0x42')](handleError(_0x5898d8,null));};exports[_0x40a2('0x22')]=function(_0x37193b,_0x13fc1c){return db[_0x40a2('0x29')][_0x40a2('0x45')]({'where':{'id':_0x37193b[_0x40a2('0x44')]['id']}})[_0x40a2('0x21')](handleEntityNotFound(_0x13fc1c,null))['then'](removeEntity(_0x13fc1c,null))[_0x40a2('0x42')](handleError(_0x13fc1c,null));};exports[_0x40a2('0x48')]=function(_0x507935,_0x242efb,_0xf70b1d){var _0x24cf8f={};var _0x13cc0c={};var _0x4d5509;var _0x5a0cf1;return db['Dynamics365Configuration'][_0x40a2('0x49')]({'where':{'id':_0x507935['params']['id']}})['then'](handleEntityNotFound(_0x242efb,null))[_0x40a2('0x21')](function(_0x51bd11){if(_0x51bd11){_0x4d5509=_0x51bd11;_0x13cc0c['model']=_['keys'](db['Dynamics365Field'][_0x40a2('0x2a')]);_0x13cc0c[_0x40a2('0x2f')]=_[_0x40a2('0x2e')](_0x507935['query']);_0x13cc0c['filters']=_[_0x40a2('0x31')](_0x13cc0c[_0x40a2('0x32')],_0x13cc0c[_0x40a2('0x2f')]);_0x24cf8f[_0x40a2('0x33')]=_[_0x40a2('0x31')](_0x13cc0c[_0x40a2('0x32')],qs['fields'](_0x507935[_0x40a2('0x2f')][_0x40a2('0x34')]));_0x24cf8f['attributes']=_0x24cf8f['attributes']['length']?_0x24cf8f[_0x40a2('0x33')]:_0x13cc0c['model'];_0x24cf8f[_0x40a2('0x4a')]=qs[_0x40a2('0x37')](_0x507935[_0x40a2('0x2f')][_0x40a2('0x37')]);_0x24cf8f['where']=qs[_0x40a2('0x30')](_[_0x40a2('0x39')](_0x507935[_0x40a2('0x2f')],_0x13cc0c['filters']));if(_0x507935['query'][_0x40a2('0x3c')]){_0x24cf8f[_0x40a2('0x38')]=_['merge'](_0x24cf8f[_0x40a2('0x38')],{'$or':_['map'](_0x24cf8f[_0x40a2('0x33')],function(_0x447ce7){var _0x3df31c={};_0x3df31c[_0x447ce7]={'$like':'%'+_0x507935[_0x40a2('0x2f')][_0x40a2('0x3c')]+'%'};return _0x3df31c;})});}_0x24cf8f=_[_0x40a2('0x3a')]({},_0x24cf8f,_0x507935[_0x40a2('0x3d')]);return _0x4d5509['getFields'](_0x24cf8f);}})[_0x40a2('0x21')](function(_0x3190a2){if(_0x3190a2){_0x5a0cf1=_0x3190a2[_0x40a2('0x35')];if(!_0x507935[_0x40a2('0x2f')][_0x40a2('0x4b')](_0x40a2('0x36'))){_0x24cf8f[_0x40a2('0x1a')]=qs[_0x40a2('0x1a')](_0x507935[_0x40a2('0x2f')][_0x40a2('0x1a')]);_0x24cf8f[_0x40a2('0x18')]=qs[_0x40a2('0x18')](_0x507935[_0x40a2('0x2f')][_0x40a2('0x18')]);}return _0x4d5509[_0x40a2('0x48')](_0x24cf8f);}})['then'](function(_0x2bb46f){if(_0x2bb46f){return _0x2bb46f?{'count':_0x5a0cf1,'rows':_0x2bb46f}:null;}})[_0x40a2('0x21')](respondWithResult(_0x242efb,null))['catch'](handleError(_0x242efb,null));};exports['getSubjects']=function(_0x1f7142,_0x415b6b,_0x262dbf){var _0x141a5d={};var _0x2c5384={};var _0x247cd4;var _0x3c19fe;return db['Dynamics365Configuration'][_0x40a2('0x49')]({'where':{'id':_0x1f7142[_0x40a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x415b6b,null))['then'](function(_0x4ab840){if(_0x4ab840){_0x247cd4=_0x4ab840;_0x2c5384['model']=_[_0x40a2('0x2e')](db[_0x40a2('0x4c')]['rawAttributes']);_0x2c5384['query']=_['keys'](_0x1f7142[_0x40a2('0x2f')]);_0x2c5384[_0x40a2('0x30')]=_[_0x40a2('0x31')](_0x2c5384[_0x40a2('0x32')],_0x2c5384[_0x40a2('0x2f')]);_0x141a5d[_0x40a2('0x33')]=_['intersection'](_0x2c5384['model'],qs['fields'](_0x1f7142[_0x40a2('0x2f')][_0x40a2('0x34')]));_0x141a5d[_0x40a2('0x33')]=_0x141a5d['attributes'][_0x40a2('0x35')]?_0x141a5d[_0x40a2('0x33')]:_0x2c5384[_0x40a2('0x32')];_0x141a5d[_0x40a2('0x4a')]=qs['sort'](_0x1f7142['query']['sort']);_0x141a5d['where']=qs[_0x40a2('0x30')](_['pick'](_0x1f7142[_0x40a2('0x2f')],_0x2c5384[_0x40a2('0x30')]));if(_0x1f7142[_0x40a2('0x2f')][_0x40a2('0x3c')]){_0x141a5d[_0x40a2('0x38')]=_[_0x40a2('0x3a')](_0x141a5d[_0x40a2('0x38')],{'$or':_[_0x40a2('0x28')](_0x141a5d[_0x40a2('0x33')],function(_0x4236d2){var _0x44d6d3={};_0x44d6d3[_0x4236d2]={'$like':'%'+_0x1f7142[_0x40a2('0x2f')][_0x40a2('0x3c')]+'%'};return _0x44d6d3;})});}_0x141a5d=_['merge']({},_0x141a5d,_0x1f7142[_0x40a2('0x3d')]);return _0x247cd4[_0x40a2('0x4d')](_0x141a5d);}})[_0x40a2('0x21')](function(_0x1abc23){if(_0x1abc23){_0x3c19fe=_0x1abc23['length'];if(!_0x1f7142[_0x40a2('0x2f')][_0x40a2('0x4b')](_0x40a2('0x36'))){_0x141a5d[_0x40a2('0x1a')]=qs[_0x40a2('0x1a')](_0x1f7142[_0x40a2('0x2f')][_0x40a2('0x1a')]);_0x141a5d[_0x40a2('0x18')]=qs[_0x40a2('0x18')](_0x1f7142[_0x40a2('0x2f')][_0x40a2('0x18')]);}return _0x247cd4[_0x40a2('0x4d')](_0x141a5d);}})['then'](function(_0x238892){if(_0x238892){return _0x238892?{'count':_0x3c19fe,'rows':_0x238892}:null;}})[_0x40a2('0x21')](respondWithResult(_0x415b6b,null))[_0x40a2('0x42')](handleError(_0x415b6b,null));};exports[_0x40a2('0x4e')]=function(_0xc084f6,_0x4d3931,_0x4df536){var _0x4212b8={};var _0x2541f9={};var _0x3baf23;var _0x580a11;return db[_0x40a2('0x29')][_0x40a2('0x49')]({'where':{'id':_0xc084f6[_0x40a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d3931,null))[_0x40a2('0x21')](function(_0x245d61){if(_0x245d61){_0x3baf23=_0x245d61;_0x2541f9[_0x40a2('0x32')]=_['keys'](db[_0x40a2('0x4c')][_0x40a2('0x2a')]);_0x2541f9[_0x40a2('0x2f')]=_[_0x40a2('0x2e')](_0xc084f6['query']);_0x2541f9['filters']=_[_0x40a2('0x31')](_0x2541f9[_0x40a2('0x32')],_0x2541f9[_0x40a2('0x2f')]);_0x4212b8[_0x40a2('0x33')]=_[_0x40a2('0x31')](_0x2541f9[_0x40a2('0x32')],qs['fields'](_0xc084f6['query'][_0x40a2('0x34')]));_0x4212b8[_0x40a2('0x33')]=_0x4212b8[_0x40a2('0x33')]['length']?_0x4212b8['attributes']:_0x2541f9[_0x40a2('0x32')];_0x4212b8[_0x40a2('0x4a')]=qs[_0x40a2('0x37')](_0xc084f6[_0x40a2('0x2f')][_0x40a2('0x37')]);_0x4212b8[_0x40a2('0x38')]=qs['filters'](_['pick'](_0xc084f6[_0x40a2('0x2f')],_0x2541f9[_0x40a2('0x30')]));if(_0xc084f6[_0x40a2('0x2f')][_0x40a2('0x3c')]){_0x4212b8[_0x40a2('0x38')]=_[_0x40a2('0x3a')](_0x4212b8['where'],{'$or':_['map'](_0x4212b8[_0x40a2('0x33')],function(_0x118d22){var _0x1291ce={};_0x1291ce[_0x118d22]={'$like':'%'+_0xc084f6['query']['filter']+'%'};return _0x1291ce;})});}_0x4212b8=_['merge']({},_0x4212b8,_0xc084f6[_0x40a2('0x3d')]);return _0x3baf23[_0x40a2('0x4e')](_0x4212b8);}})[_0x40a2('0x21')](function(_0x499e1e){if(_0x499e1e){_0x580a11=_0x499e1e[_0x40a2('0x35')];if(!_0xc084f6['query'][_0x40a2('0x4b')](_0x40a2('0x36'))){_0x4212b8[_0x40a2('0x1a')]=qs[_0x40a2('0x1a')](_0xc084f6[_0x40a2('0x2f')]['limit']);_0x4212b8[_0x40a2('0x18')]=qs[_0x40a2('0x18')](_0xc084f6[_0x40a2('0x2f')]['offset']);}return _0x3baf23[_0x40a2('0x4e')](_0x4212b8);}})[_0x40a2('0x21')](function(_0x4dc787){if(_0x4dc787){return _0x4dc787?{'count':_0x580a11,'rows':_0x4dc787}:null;}})[_0x40a2('0x21')](respondWithResult(_0x4d3931,null))[_0x40a2('0x42')](handleError(_0x4d3931,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 571abb0..a348b99 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 _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x3a898d,_0x595cc1){var _0xc9372=function(_0x4eb05e){while(--_0x4eb05e){_0x3a898d['push'](_0x3a898d['shift']());}};_0xc9372(++_0x595cc1);}(_0x34e8,0x12c));var _0x834e=function(_0x1201e7,_0xd9e0e0){_0x1201e7=_0x1201e7-0x0;var _0x2f810a=_0x34e8[_0x1201e7];return _0x2f810a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x20ee4d,_0x5c470a){var _0x36d115=function(_0x22be35){while(--_0x22be35){_0x20ee4d['push'](_0x20ee4d['shift']());}};_0x36d115(++_0x5c470a);}(_0x84ab,0x12f));var _0xb84a=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x84ab[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 146adf1..cd7a0a6 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 _0x3622=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1881ac,_0x57ecf4){var _0x3b966e=function(_0x134036){while(--_0x134036){_0x1881ac['push'](_0x1881ac['shift']());}};_0x3b966e(++_0x57ecf4);}(_0x3622,0x161));var _0x2362=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x3622[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x2362('0x0'));var util=require(_0x2362('0x1'));var moment=require(_0x2362('0x2'));var BPromise=require(_0x2362('0x3'));var rs=require(_0x2362('0x4'));var fs=require('fs');var Redis=require(_0x2362('0x5'));var db=require(_0x2362('0x6'))['db'];var utils=require(_0x2362('0x7'));var logger=require(_0x2362('0x8'))('rpc');var config=require(_0x2362('0x9'));var jayson=require(_0x2362('0xa'));var client=jayson[_0x2362('0xb')][_0x2362('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4eeffc,_0xb7d800,_0xde8634){return new BPromise(function(_0x32de7b,_0x534fb0){return client[_0x2362('0xd')](_0x4eeffc,_0xde8634)[_0x2362('0xe')](function(_0x5b315a){logger['info'](_0x2362('0xf'),_0xb7d800,_0x2362('0x10'));logger[_0x2362('0x11')](_0x2362('0x12'),_0xb7d800,'request\x20sent',JSON['stringify'](_0x5b315a));if(_0x5b315a['error']){if(_0x5b315a[_0x2362('0x13')][_0x2362('0x14')]===0x1f4){logger[_0x2362('0x13')](_0x2362('0xf'),_0xb7d800,_0x5b315a[_0x2362('0x13')][_0x2362('0x15')]);return _0x534fb0(_0x5b315a['error'][_0x2362('0x15')]);}logger[_0x2362('0x13')](_0x2362('0xf'),_0xb7d800,_0x5b315a['error']['message']);return _0x32de7b(_0x5b315a[_0x2362('0x13')]['message']);}else{logger[_0x2362('0x16')](_0x2362('0xf'),_0xb7d800,_0x2362('0x10'));_0x32de7b(_0x5b315a[_0x2362('0x17')]['message']);}})[_0x2362('0x18')](function(_0x571dc2){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xb7d800,_0x571dc2);_0x534fb0(_0x571dc2);});});} \ No newline at end of file +var _0xadb0=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x485113,_0x199534){var _0x37faae=function(_0x111cb7){while(--_0x111cb7){_0x485113['push'](_0x485113['shift']());}};_0x37faae(++_0x199534);}(_0xadb0,0x82));var _0x0adb=function(_0x324c08,_0x494619){_0x324c08=_0x324c08-0x0;var _0x571fe7=_0xadb0[_0x324c08];return _0x571fe7;};'use strict';var _=require(_0x0adb('0x0'));var util=require(_0x0adb('0x1'));var moment=require(_0x0adb('0x2'));var BPromise=require(_0x0adb('0x3'));var rs=require(_0x0adb('0x4'));var fs=require('fs');var Redis=require(_0x0adb('0x5'));var db=require(_0x0adb('0x6'))['db'];var utils=require(_0x0adb('0x7'));var logger=require('../../config/logger')(_0x0adb('0x8'));var config=require(_0x0adb('0x9'));var jayson=require(_0x0adb('0xa'));var client=jayson[_0x0adb('0xb')][_0x0adb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x558cd9,_0x417a89,_0x5c40dd){return new BPromise(function(_0x10f0de,_0x7ed12){return client[_0x0adb('0xd')](_0x558cd9,_0x5c40dd)[_0x0adb('0xe')](function(_0x556ab5){logger[_0x0adb('0xf')](_0x0adb('0x10'),_0x417a89,_0x0adb('0x11'));logger['debug'](_0x0adb('0x12'),_0x417a89,'request\x20sent',JSON[_0x0adb('0x13')](_0x556ab5));if(_0x556ab5['error']){if(_0x556ab5[_0x0adb('0x14')]['code']===0x1f4){logger[_0x0adb('0x14')](_0x0adb('0x10'),_0x417a89,_0x556ab5[_0x0adb('0x14')][_0x0adb('0x15')]);return _0x7ed12(_0x556ab5['error'][_0x0adb('0x15')]);}logger[_0x0adb('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x417a89,_0x556ab5[_0x0adb('0x14')][_0x0adb('0x15')]);return _0x10f0de(_0x556ab5[_0x0adb('0x14')]['message']);}else{logger[_0x0adb('0xf')](_0x0adb('0x10'),_0x417a89,_0x0adb('0x11'));_0x10f0de(_0x556ab5[_0x0adb('0x16')]['message']);}})['catch'](function(_0x16bc55){logger[_0x0adb('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x417a89,_0x16bc55);_0x7ed12(_0x16bc55);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2e561ff..f9e6194 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 _0xc24e=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x42e13d,_0x4205c5){var _0x58d783=function(_0x4ab959){while(--_0x4ab959){_0x42e13d['push'](_0x42e13d['shift']());}};_0x58d783(++_0x4205c5);}(_0xc24e,0x104));var _0xec24=function(_0x15c92a,_0xf7c6d6){_0x15c92a=_0x15c92a-0x0;var _0x4700f6=_0xc24e[_0x15c92a];return _0x4700f6;};'use strict';var multer=require(_0xec24('0x0'));var util=require(_0xec24('0x1'));var path=require(_0xec24('0x2'));var timeout=require(_0xec24('0x3'));var express=require(_0xec24('0x4'));var router=express[_0xec24('0x5')]();var fs_extra=require(_0xec24('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xec24('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xec24('0x8')]('/',auth[_0xec24('0x9')](),controller[_0xec24('0xa')]);router[_0xec24('0x8')](_0xec24('0xb'),auth[_0xec24('0x9')](),controller[_0xec24('0xc')]);router[_0xec24('0xd')]('/',auth[_0xec24('0x9')](),controller[_0xec24('0xe')]);router[_0xec24('0xf')](_0xec24('0xb'),auth[_0xec24('0x9')](),controller[_0xec24('0x10')]);router['delete'](_0xec24('0xb'),auth[_0xec24('0x9')](),controller[_0xec24('0x11')]);module[_0xec24('0x12')]=router; \ No newline at end of file +var _0x1569=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x52daea,_0xa2df7e){var _0x16c531=function(_0x197ecb){while(--_0x197ecb){_0x52daea['push'](_0x52daea['shift']());}};_0x16c531(++_0xa2df7e);}(_0x1569,0x85));var _0x9156=function(_0x4ef078,_0x490047){_0x4ef078=_0x4ef078-0x0;var _0x33215c=_0x1569[_0x4ef078];return _0x33215c;};'use strict';var multer=require('multer');var util=require(_0x9156('0x0'));var path=require('path');var timeout=require(_0x9156('0x1'));var express=require(_0x9156('0x2'));var router=express[_0x9156('0x3')]();var fs_extra=require(_0x9156('0x4'));var auth=require(_0x9156('0x5'));var interaction=require(_0x9156('0x6'));var config=require(_0x9156('0x7'));var controller=require(_0x9156('0x8'));router[_0x9156('0x9')]('/',auth[_0x9156('0xa')](),controller[_0x9156('0xb')]);router[_0x9156('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9156('0xc')]);router[_0x9156('0xd')]('/',auth[_0x9156('0xa')](),controller[_0x9156('0xe')]);router[_0x9156('0xf')](_0x9156('0x10'),auth[_0x9156('0xa')](),controller[_0x9156('0x11')]);router[_0x9156('0x12')](_0x9156('0x10'),auth[_0x9156('0xa')](),controller['destroy']);module[_0x9156('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 69d6f90..3fe5dae 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 _0x7592=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2cbb2e,_0x227b71){var _0x5b3d29=function(_0x21ed57){while(--_0x21ed57){_0x2cbb2e['push'](_0x2cbb2e['shift']());}};_0x5b3d29(++_0x227b71);}(_0x7592,0x1dc));var _0x2759=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x7592[_0x2f32c4];return _0x95b5dc;};'use strict';var Sequelize=require(_0x2759('0x0'));module[_0x2759('0x1')]={'type':{'type':Sequelize[_0x2759('0x2')](_0x2759('0x3'),'variable',_0x2759('0x4'),_0x2759('0x5'),_0x2759('0x6')),'defaultValue':_0x2759('0x3')},'content':{'type':Sequelize[_0x2759('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2759('0x2')]('string',_0x2759('0x8'),_0x2759('0x4'))},'keyContent':{'type':Sequelize[_0x2759('0x7')]},'idField':{'type':Sequelize[_0x2759('0x7')]},'nameField':{'type':Sequelize[_0x2759('0x7')]},'customField':{'type':Sequelize[_0x2759('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2759('0x7')]}}; \ No newline at end of file +var _0x8368=['keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0x8368,0x17e));var _0x8836=function(_0x51972f,_0x11f19e){_0x51972f=_0x51972f-0x0;var _0x13af1b=_0x8368[_0x51972f];return _0x13af1b;};'use strict';var Sequelize=require(_0x8836('0x0'));module[_0x8836('0x1')]={'type':{'type':Sequelize[_0x8836('0x2')](_0x8836('0x3'),_0x8836('0x4'),'customVariable',_0x8836('0x5'),_0x8836('0x6')),'defaultValue':_0x8836('0x3')},'content':{'type':Sequelize[_0x8836('0x7')]},'key':{'type':Sequelize[_0x8836('0x7')]},'keyType':{'type':Sequelize[_0x8836('0x2')](_0x8836('0x3'),_0x8836('0x4'),_0x8836('0x8'))},'keyContent':{'type':Sequelize[_0x8836('0x7')]},'idField':{'type':Sequelize[_0x8836('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8836('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 8bb9769..3c82d03 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 _0xf73f=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xf73f,0x1dd));var _0xff73=function(_0x3cf915,_0x38a9a0){_0x3cf915=_0x3cf915-0x0;var _0x12ee40=_0xf73f[_0x3cf915];return _0x12ee40;};'use strict';var emlformat=require(_0xff73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff73('0x1'));var jsonpatch=require(_0xff73('0x2'));var rp=require(_0xff73('0x3'));var moment=require(_0xff73('0x4'));var BPromise=require(_0xff73('0x5'));var Mustache=require(_0xff73('0x6'));var util=require(_0xff73('0x7'));var path=require(_0xff73('0x8'));var sox=require(_0xff73('0x9'));var csv=require('to-csv');var ejs=require(_0xff73('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xff73('0xb'));var crypto=require(_0xff73('0xc'));var jsforce=require(_0xff73('0xd'));var deskjs=require(_0xff73('0xe'));var toCsv=require(_0xff73('0xf'));var querystring=require(_0xff73('0x10'));var Papa=require('papaparse');var Redis=require(_0xff73('0x11'));var authService=require(_0xff73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xff73('0x13'));var hardwareService=require(_0xff73('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xff73('0x15'));var config=require(_0xff73('0x16'));var licenseUtil=require(_0xff73('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449ebd,_0x209145){_0x209145=_0x209145||0xcc;return function(_0x2d8e0f){if(_0x2d8e0f){return _0x449ebd[_0xff73('0x18')](_0x209145);}return _0x449ebd[_0xff73('0x19')](_0x209145)[_0xff73('0x1a')]();};}function respondWithResult(_0x4d655f,_0x27f1e1){_0x27f1e1=_0x27f1e1||0xc8;return function(_0x137ae5){if(_0x137ae5){return _0x4d655f[_0xff73('0x19')](_0x27f1e1)['json'](_0x137ae5);}};}function respondWithFilteredResult(_0x358cc5,_0x5e1329){return function(_0x408213){if(_0x408213){var _0x4c50f8=typeof _0x5e1329[_0xff73('0x1b')]==='undefined'&&typeof _0x5e1329[_0xff73('0x1c')]===_0xff73('0x1d');var _0x559191=_0x408213[_0xff73('0x1e')];var _0x3e1d1f=_0x4c50f8?0x0:_0x5e1329[_0xff73('0x1b')];var _0x423fd2=_0x4c50f8?_0x408213[_0xff73('0x1e')]:_0x5e1329[_0xff73('0x1b')]+_0x5e1329['limit'];var _0x3ca9d8;if(_0x423fd2>=_0x559191){_0x423fd2=_0x559191;_0x3ca9d8=0xc8;}else{_0x3ca9d8=0xce;}_0x358cc5[_0xff73('0x19')](_0x3ca9d8);return _0x358cc5[_0xff73('0x1f')]('Content-Range',_0x3e1d1f+'-'+_0x423fd2+'/'+_0x559191)[_0xff73('0x20')](_0x408213);}return null;};}function patchUpdates(_0x554538){return function(_0x1236a3){try{jsonpatch[_0xff73('0x21')](_0x1236a3,_0x554538,!![]);}catch(_0x4da06a){return BPromise[_0xff73('0x22')](_0x4da06a);}return _0x1236a3[_0xff73('0x23')]();};}function saveUpdates(_0x12b599,_0x260eea){return function(_0x118969){if(_0x118969){return _0x118969[_0xff73('0x24')](_0x12b599)[_0xff73('0x25')](function(_0x559669){return _0x559669;});}return null;};}function removeEntity(_0x5065e6,_0x459b4b){return function(_0x79d167){if(_0x79d167){return _0x79d167['destroy']()[_0xff73('0x25')](function(){_0x5065e6[_0xff73('0x19')](0xcc)[_0xff73('0x1a')]();});}};}function handleEntityNotFound(_0x1cb221,_0xb76bde){return function(_0x188d0b){if(!_0x188d0b){_0x1cb221['sendStatus'](0x194);}return _0x188d0b;};}function handleError(_0x311a8d,_0x5842e6){_0x5842e6=_0x5842e6||0x1f4;return function(_0x2a3ba3){logger[_0xff73('0x26')](_0x2a3ba3[_0xff73('0x27')]);if(_0x2a3ba3[_0xff73('0x28')]){delete _0x2a3ba3['name'];}_0x311a8d['status'](_0x5842e6)[_0xff73('0x29')](_0x2a3ba3);};}exports['index']=function(_0x42a549,_0x55f6e1){var _0x2d272b={},_0x1101f1={},_0x5c3ed0={'count':0x0,'rows':[]};var _0x5c1d8a=_['map'](db['Dynamics365Field'][_0xff73('0x2a')],function(_0x22afec){return{'name':_0x22afec[_0xff73('0x2b')],'type':_0x22afec[_0xff73('0x2c')][_0xff73('0x2d')]};});_0x1101f1[_0xff73('0x2e')]=_[_0xff73('0x2f')](_0x5c1d8a,_0xff73('0x28'));_0x1101f1[_0xff73('0x30')]=_[_0xff73('0x31')](_0x42a549[_0xff73('0x30')]);_0x1101f1['filters']=_[_0xff73('0x32')](_0x1101f1[_0xff73('0x2e')],_0x1101f1[_0xff73('0x30')]);_0x2d272b['attributes']=_['intersection'](_0x1101f1[_0xff73('0x2e')],qs[_0xff73('0x33')](_0x42a549[_0xff73('0x30')]['fields']));_0x2d272b[_0xff73('0x34')]=_0x2d272b[_0xff73('0x34')][_0xff73('0x35')]?_0x2d272b[_0xff73('0x34')]:_0x1101f1[_0xff73('0x2e')];if(!_0x42a549[_0xff73('0x30')][_0xff73('0x36')](_0xff73('0x37'))){_0x2d272b[_0xff73('0x1c')]=qs[_0xff73('0x1c')](_0x42a549[_0xff73('0x30')][_0xff73('0x1c')]);_0x2d272b[_0xff73('0x1b')]=qs[_0xff73('0x1b')](_0x42a549[_0xff73('0x30')][_0xff73('0x1b')]);}_0x2d272b['order']=qs['sort'](_0x42a549[_0xff73('0x30')]['sort']);_0x2d272b[_0xff73('0x38')]=qs[_0xff73('0x39')](_[_0xff73('0x3a')](_0x42a549[_0xff73('0x30')],_0x1101f1[_0xff73('0x39')]),_0x5c1d8a);if(_0x42a549['query'][_0xff73('0x3b')]){_0x2d272b[_0xff73('0x38')]=_[_0xff73('0x3c')](_0x2d272b[_0xff73('0x38')],{'$or':_[_0xff73('0x2f')](_0x5c1d8a,function(_0x3f237){if(_0x3f237['type']!==_0xff73('0x3d')){var _0x3188a3={};_0x3188a3[_0x3f237['name']]={'$like':'%'+_0x42a549['query'][_0xff73('0x3b')]+'%'};return _0x3188a3;}})});}_0x2d272b=_[_0xff73('0x3c')]({},_0x2d272b,_0x42a549[_0xff73('0x3e')]);var _0x398969={'where':_0x2d272b['where']};return db[_0xff73('0x3f')]['count'](_0x398969)[_0xff73('0x25')](function(_0x3c2441){_0x5c3ed0['count']=_0x3c2441;if(_0x42a549[_0xff73('0x30')][_0xff73('0x40')]){_0x2d272b[_0xff73('0x41')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xff73('0x42')](_0x2d272b);})[_0xff73('0x25')](function(_0x341aa3){_0x5c3ed0[_0xff73('0x43')]=_0x341aa3;return _0x5c3ed0;})[_0xff73('0x25')](respondWithFilteredResult(_0x55f6e1,_0x2d272b))[_0xff73('0x44')](handleError(_0x55f6e1,null));};exports[_0xff73('0x45')]=function(_0x489887,_0x3d4fdd){var _0x26a86c={'raw':!![],'where':{'id':_0x489887[_0xff73('0x46')]['id']}},_0x40b85a={};_0x40b85a[_0xff73('0x2e')]=_[_0xff73('0x31')](db[_0xff73('0x3f')]['rawAttributes']);_0x40b85a[_0xff73('0x30')]=_['keys'](_0x489887[_0xff73('0x30')]);_0x40b85a[_0xff73('0x39')]=_['intersection'](_0x40b85a['model'],_0x40b85a[_0xff73('0x30')]);_0x26a86c[_0xff73('0x34')]=_[_0xff73('0x32')](_0x40b85a[_0xff73('0x2e')],qs[_0xff73('0x33')](_0x489887['query'][_0xff73('0x33')]));_0x26a86c['attributes']=_0x26a86c['attributes']['length']?_0x26a86c[_0xff73('0x34')]:_0x40b85a[_0xff73('0x2e')];if(_0x489887[_0xff73('0x30')]['includeAll']){_0x26a86c['include']=[{'all':!![]}];}_0x26a86c=_[_0xff73('0x3c')]({},_0x26a86c,_0x489887[_0xff73('0x3e')]);return db['Dynamics365Field'][_0xff73('0x47')](_0x26a86c)[_0xff73('0x25')](handleEntityNotFound(_0x3d4fdd,null))[_0xff73('0x25')](respondWithResult(_0x3d4fdd,null))[_0xff73('0x44')](handleError(_0x3d4fdd,null));};exports['create']=function(_0x32b3fe,_0x445ca2){return db['Dynamics365Field'][_0xff73('0x48')](_0x32b3fe[_0xff73('0x49')],{})['then'](respondWithResult(_0x445ca2,0xc9))[_0xff73('0x44')](handleError(_0x445ca2,null));};exports[_0xff73('0x24')]=function(_0x5959fd,_0x544ed2){if(_0x5959fd[_0xff73('0x49')]['id']){delete _0x5959fd[_0xff73('0x49')]['id'];}return db[_0xff73('0x3f')][_0xff73('0x47')]({'where':{'id':_0x5959fd['params']['id']}})[_0xff73('0x25')](handleEntityNotFound(_0x544ed2,null))[_0xff73('0x25')](saveUpdates(_0x5959fd[_0xff73('0x49')],null))[_0xff73('0x25')](respondWithResult(_0x544ed2,null))[_0xff73('0x44')](handleError(_0x544ed2,null));};exports[_0xff73('0x4a')]=function(_0x1cfdf2,_0x1ed97f){return db['Dynamics365Field']['find']({'where':{'id':_0x1cfdf2[_0xff73('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ed97f,null))[_0xff73('0x25')](removeEntity(_0x1ed97f,null))[_0xff73('0x44')](handleError(_0x1ed97f,null));}; \ No newline at end of file +var _0x43f7=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x43f7,0xcb));var _0x743f=function(_0x58ef72,_0x332754){_0x58ef72=_0x58ef72-0x0;var _0x365902=_0x43f7[_0x58ef72];return _0x365902;};'use strict';var emlformat=require(_0x743f('0x0'));var rimraf=require(_0x743f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x743f('0x2'));var moment=require(_0x743f('0x3'));var BPromise=require(_0x743f('0x4'));var Mustache=require(_0x743f('0x5'));var util=require(_0x743f('0x6'));var path=require(_0x743f('0x7'));var sox=require(_0x743f('0x8'));var csv=require(_0x743f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x743f('0xa'));var _=require(_0x743f('0xb'));var squel=require('squel');var crypto=require(_0x743f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x743f('0xd'));var toCsv=require(_0x743f('0x9'));var querystring=require('querystring');var Papa=require(_0x743f('0xe'));var Redis=require(_0x743f('0xf'));var authService=require(_0x743f('0x10'));var qs=require(_0x743f('0x11'));var as=require(_0x743f('0x12'));var hardwareService=require(_0x743f('0x13'));var logger=require(_0x743f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x743f('0x15'));var licenseUtil=require(_0x743f('0x16'));var db=require(_0x743f('0x17'))['db'];function respondWithStatusCode(_0x306038,_0x47fe60){_0x47fe60=_0x47fe60||0xcc;return function(_0x37427d){if(_0x37427d){return _0x306038[_0x743f('0x18')](_0x47fe60);}return _0x306038['status'](_0x47fe60)[_0x743f('0x19')]();};}function respondWithResult(_0x3e74e8,_0x4760a8){_0x4760a8=_0x4760a8||0xc8;return function(_0x3ee617){if(_0x3ee617){return _0x3e74e8[_0x743f('0x1a')](_0x4760a8)[_0x743f('0x1b')](_0x3ee617);}};}function respondWithFilteredResult(_0x2b68fe,_0x1d4eed){return function(_0x34389f){if(_0x34389f){var _0x702242=typeof _0x1d4eed['offset']===_0x743f('0x1c')&&typeof _0x1d4eed[_0x743f('0x1d')]===_0x743f('0x1c');var _0x419f53=_0x34389f['count'];var _0x196e28=_0x702242?0x0:_0x1d4eed['offset'];var _0x17db7d=_0x702242?_0x34389f[_0x743f('0x1e')]:_0x1d4eed[_0x743f('0x1f')]+_0x1d4eed[_0x743f('0x1d')];var _0x58c9cc;if(_0x17db7d>=_0x419f53){_0x17db7d=_0x419f53;_0x58c9cc=0xc8;}else{_0x58c9cc=0xce;}_0x2b68fe['status'](_0x58c9cc);return _0x2b68fe[_0x743f('0x20')](_0x743f('0x21'),_0x196e28+'-'+_0x17db7d+'/'+_0x419f53)['json'](_0x34389f);}return null;};}function patchUpdates(_0x1caaae){return function(_0x3a3b33){try{jsonpatch[_0x743f('0x22')](_0x3a3b33,_0x1caaae,!![]);}catch(_0x3cc791){return BPromise['reject'](_0x3cc791);}return _0x3a3b33[_0x743f('0x23')]();};}function saveUpdates(_0x545a23,_0x501584){return function(_0x5eafac){if(_0x5eafac){return _0x5eafac[_0x743f('0x24')](_0x545a23)[_0x743f('0x25')](function(_0x4c3b15){return _0x4c3b15;});}return null;};}function removeEntity(_0x4fb23f,_0x56a8f2){return function(_0x2fb0a4){if(_0x2fb0a4){return _0x2fb0a4[_0x743f('0x26')]()[_0x743f('0x25')](function(){_0x4fb23f[_0x743f('0x1a')](0xcc)[_0x743f('0x19')]();});}};}function handleEntityNotFound(_0x2da8fe,_0x2b0bc0){return function(_0x415226){if(!_0x415226){_0x2da8fe['sendStatus'](0x194);}return _0x415226;};}function handleError(_0x4a3930,_0x51d5dd){_0x51d5dd=_0x51d5dd||0x1f4;return function(_0x4d03aa){logger[_0x743f('0x27')](_0x4d03aa['stack']);if(_0x4d03aa[_0x743f('0x28')]){delete _0x4d03aa[_0x743f('0x28')];}_0x4a3930[_0x743f('0x1a')](_0x51d5dd)[_0x743f('0x29')](_0x4d03aa);};}exports[_0x743f('0x2a')]=function(_0x25c287,_0x1039a1){var _0x1f6056={},_0x179d01={},_0x90e373={'count':0x0,'rows':[]};var _0x56d02f=_[_0x743f('0x2b')](db[_0x743f('0x2c')][_0x743f('0x2d')],function(_0x5d4fe9){return{'name':_0x5d4fe9[_0x743f('0x2e')],'type':_0x5d4fe9[_0x743f('0x2f')][_0x743f('0x30')]};});_0x179d01[_0x743f('0x31')]=_['map'](_0x56d02f,_0x743f('0x28'));_0x179d01[_0x743f('0x32')]=_['keys'](_0x25c287[_0x743f('0x32')]);_0x179d01['filters']=_['intersection'](_0x179d01['model'],_0x179d01[_0x743f('0x32')]);_0x1f6056[_0x743f('0x33')]=_[_0x743f('0x34')](_0x179d01[_0x743f('0x31')],qs[_0x743f('0x35')](_0x25c287['query'][_0x743f('0x35')]));_0x1f6056[_0x743f('0x33')]=_0x1f6056[_0x743f('0x33')][_0x743f('0x36')]?_0x1f6056[_0x743f('0x33')]:_0x179d01[_0x743f('0x31')];if(!_0x25c287[_0x743f('0x32')][_0x743f('0x37')](_0x743f('0x38'))){_0x1f6056[_0x743f('0x1d')]=qs['limit'](_0x25c287[_0x743f('0x32')][_0x743f('0x1d')]);_0x1f6056[_0x743f('0x1f')]=qs['offset'](_0x25c287['query'][_0x743f('0x1f')]);}_0x1f6056['order']=qs[_0x743f('0x39')](_0x25c287['query']['sort']);_0x1f6056[_0x743f('0x3a')]=qs[_0x743f('0x3b')](_[_0x743f('0x3c')](_0x25c287[_0x743f('0x32')],_0x179d01[_0x743f('0x3b')]),_0x56d02f);if(_0x25c287['query']['filter']){_0x1f6056[_0x743f('0x3a')]=_[_0x743f('0x3d')](_0x1f6056[_0x743f('0x3a')],{'$or':_[_0x743f('0x2b')](_0x56d02f,function(_0x32645d){if(_0x32645d['type']!==_0x743f('0x3e')){var _0x42d066={};_0x42d066[_0x32645d[_0x743f('0x28')]]={'$like':'%'+_0x25c287[_0x743f('0x32')][_0x743f('0x3f')]+'%'};return _0x42d066;}})});}_0x1f6056=_[_0x743f('0x3d')]({},_0x1f6056,_0x25c287[_0x743f('0x40')]);var _0x1b31b5={'where':_0x1f6056[_0x743f('0x3a')]};return db[_0x743f('0x2c')]['count'](_0x1b31b5)[_0x743f('0x25')](function(_0x7aa0f1){_0x90e373['count']=_0x7aa0f1;if(_0x25c287[_0x743f('0x32')][_0x743f('0x41')]){_0x1f6056[_0x743f('0x42')]=[{'all':!![]}];}return db[_0x743f('0x2c')][_0x743f('0x43')](_0x1f6056);})[_0x743f('0x25')](function(_0x1d7a3c){_0x90e373[_0x743f('0x44')]=_0x1d7a3c;return _0x90e373;})['then'](respondWithFilteredResult(_0x1039a1,_0x1f6056))[_0x743f('0x45')](handleError(_0x1039a1,null));};exports[_0x743f('0x46')]=function(_0x35fdb7,_0xe49258){var _0x79f97={'raw':!![],'where':{'id':_0x35fdb7['params']['id']}},_0x4446a1={};_0x4446a1[_0x743f('0x31')]=_[_0x743f('0x47')](db[_0x743f('0x2c')][_0x743f('0x2d')]);_0x4446a1[_0x743f('0x32')]=_['keys'](_0x35fdb7[_0x743f('0x32')]);_0x4446a1[_0x743f('0x3b')]=_[_0x743f('0x34')](_0x4446a1['model'],_0x4446a1[_0x743f('0x32')]);_0x79f97[_0x743f('0x33')]=_[_0x743f('0x34')](_0x4446a1[_0x743f('0x31')],qs['fields'](_0x35fdb7[_0x743f('0x32')]['fields']));_0x79f97['attributes']=_0x79f97[_0x743f('0x33')][_0x743f('0x36')]?_0x79f97['attributes']:_0x4446a1[_0x743f('0x31')];if(_0x35fdb7['query'][_0x743f('0x41')]){_0x79f97[_0x743f('0x42')]=[{'all':!![]}];}_0x79f97=_[_0x743f('0x3d')]({},_0x79f97,_0x35fdb7[_0x743f('0x40')]);return db[_0x743f('0x2c')]['find'](_0x79f97)['then'](handleEntityNotFound(_0xe49258,null))['then'](respondWithResult(_0xe49258,null))[_0x743f('0x45')](handleError(_0xe49258,null));};exports[_0x743f('0x48')]=function(_0x4fbc28,_0x1c65fd){return db[_0x743f('0x2c')]['create'](_0x4fbc28[_0x743f('0x49')],{})[_0x743f('0x25')](respondWithResult(_0x1c65fd,0xc9))[_0x743f('0x45')](handleError(_0x1c65fd,null));};exports[_0x743f('0x24')]=function(_0x4175d8,_0x404f26){if(_0x4175d8[_0x743f('0x49')]['id']){delete _0x4175d8[_0x743f('0x49')]['id'];}return db[_0x743f('0x2c')][_0x743f('0x4a')]({'where':{'id':_0x4175d8[_0x743f('0x4b')]['id']}})[_0x743f('0x25')](handleEntityNotFound(_0x404f26,null))[_0x743f('0x25')](saveUpdates(_0x4175d8[_0x743f('0x49')],null))[_0x743f('0x25')](respondWithResult(_0x404f26,null))[_0x743f('0x45')](handleError(_0x404f26,null));};exports[_0x743f('0x26')]=function(_0x27e30e,_0x180522){return db['Dynamics365Field'][_0x743f('0x4a')]({'where':{'id':_0x27e30e[_0x743f('0x4b')]['id']}})[_0x743f('0x25')](handleEntityNotFound(_0x180522,null))['then'](removeEntity(_0x180522,null))[_0x743f('0x45')](handleError(_0x180522,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c3f158e..d363e2e 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 _0x7a24=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4d8057,_0x90ef33){var _0x572caf=function(_0x3f64b0){while(--_0x3f64b0){_0x4d8057['push'](_0x4d8057['shift']());}};_0x572caf(++_0x90ef33);}(_0x7a24,0x171));var _0x47a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a24[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x47a2('0x0'));var util=require(_0x47a2('0x1'));var logger=require(_0x47a2('0x2'))(_0x47a2('0x3'));var moment=require('moment');var BPromise=require(_0x47a2('0x4'));var rp=require(_0x47a2('0x5'));var fs=require('fs');var path=require(_0x47a2('0x6'));var rimraf=require(_0x47a2('0x7'));var config=require(_0x47a2('0x8'));var attributes=require(_0x47a2('0x9'));module[_0x47a2('0xa')]=function(_0x3ffc84,_0x211c00){return _0x3ffc84[_0x47a2('0xb')](_0x47a2('0xc'),attributes,{'tableName':_0x47a2('0xd'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x47a2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec3e=['idField','FieldId','lodash','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x28e633,_0xe6024){var _0x4d714e=function(_0x4834bc){while(--_0x4834bc){_0x28e633['push'](_0x28e633['shift']());}};_0x4d714e(++_0xe6024);}(_0xec3e,0xaa));var _0xeec3=function(_0x33aae2,_0x11988d){_0x33aae2=_0x33aae2-0x0;var _0x18a391=_0xec3e[_0x33aae2];return _0x18a391;};'use strict';var _=require(_0xeec3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeec3('0x1'));var fs=require('fs');var path=require(_0xeec3('0x2'));var rimraf=require(_0xeec3('0x3'));var config=require(_0xeec3('0x4'));var attributes=require('./intDynamics365Field.attributes');module[_0xeec3('0x5')]=function(_0x520890,_0xdcf723){return _0x520890[_0xeec3('0x6')](_0xeec3('0x7'),attributes,{'tableName':_0xeec3('0x8'),'paranoid':![],'indexes':[{'name':_0xeec3('0x9'),'fields':[_0xeec3('0xa'),_0xeec3('0xb')],'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 ce94cb3..9ece501 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 _0x75f4=['request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s'];(function(_0x3b36e7,_0x4602a2){var _0x3a13e3=function(_0x14795f){while(--_0x14795f){_0x3b36e7['push'](_0x3b36e7['shift']());}};_0x3a13e3(++_0x4602a2);}(_0x75f4,0x68));var _0x475f=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0x75f4[_0x352d28];return _0x387d7e;};'use strict';var _=require(_0x475f('0x0'));var util=require(_0x475f('0x1'));var moment=require(_0x475f('0x2'));var BPromise=require(_0x475f('0x3'));var rs=require(_0x475f('0x4'));var fs=require('fs');var Redis=require(_0x475f('0x5'));var db=require(_0x475f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x475f('0x7'))(_0x475f('0x8'));var config=require(_0x475f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x475f('0xa')][_0x475f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x312f53,_0x402e0c,_0x371e9f){return new BPromise(function(_0x5ccc57,_0x107cca){return client[_0x475f('0xc')](_0x312f53,_0x371e9f)[_0x475f('0xd')](function(_0x538b41){logger[_0x475f('0xe')](_0x475f('0xf'),_0x402e0c,_0x475f('0x10'));logger[_0x475f('0x11')](_0x475f('0x12'),_0x402e0c,'request\x20sent',JSON[_0x475f('0x13')](_0x538b41));if(_0x538b41[_0x475f('0x14')]){if(_0x538b41['error']['code']===0x1f4){logger[_0x475f('0x14')](_0x475f('0xf'),_0x402e0c,_0x538b41[_0x475f('0x14')]['message']);return _0x107cca(_0x538b41[_0x475f('0x14')][_0x475f('0x15')]);}logger[_0x475f('0x14')](_0x475f('0xf'),_0x402e0c,_0x538b41['error'][_0x475f('0x15')]);return _0x5ccc57(_0x538b41[_0x475f('0x14')][_0x475f('0x15')]);}else{logger[_0x475f('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x402e0c,_0x475f('0x10'));_0x5ccc57(_0x538b41[_0x475f('0x16')]['message']);}})[_0x475f('0x17')](function(_0xb1216d){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x402e0c,_0xb1216d);_0x107cca(_0xb1216d);});});} \ No newline at end of file +var _0x7758=['info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3ebbd2,_0x18293c){var _0x5cc1ba=function(_0x3ccace){while(--_0x3ccace){_0x3ebbd2['push'](_0x3ebbd2['shift']());}};_0x5cc1ba(++_0x18293c);}(_0x7758,0x1e9));var _0x8775=function(_0x3044f0,_0x5b4670){_0x3044f0=_0x3044f0-0x0;var _0x5e7c21=_0x7758[_0x3044f0];return _0x5e7c21;};'use strict';var _=require(_0x8775('0x0'));var util=require('util');var moment=require(_0x8775('0x1'));var BPromise=require(_0x8775('0x2'));var rs=require(_0x8775('0x3'));var fs=require('fs');var Redis=require(_0x8775('0x4'));var db=require(_0x8775('0x5'))['db'];var utils=require(_0x8775('0x6'));var logger=require(_0x8775('0x7'))(_0x8775('0x8'));var config=require(_0x8775('0x9'));var jayson=require(_0x8775('0xa'));var client=jayson[_0x8775('0xb')][_0x8775('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e7cdf,_0x5c5a4b,_0x5285e3){return new BPromise(function(_0x1fe59c,_0x3f757d){return client[_0x8775('0xd')](_0x2e7cdf,_0x5285e3)[_0x8775('0xe')](function(_0x37099b){logger[_0x8775('0xf')](_0x8775('0x10'),_0x5c5a4b,_0x8775('0x11'));logger[_0x8775('0x12')](_0x8775('0x13'),_0x5c5a4b,_0x8775('0x11'),JSON[_0x8775('0x14')](_0x37099b));if(_0x37099b[_0x8775('0x15')]){if(_0x37099b[_0x8775('0x15')]['code']===0x1f4){logger[_0x8775('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x5c5a4b,_0x37099b[_0x8775('0x15')][_0x8775('0x16')]);return _0x3f757d(_0x37099b[_0x8775('0x15')][_0x8775('0x16')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x5c5a4b,_0x37099b[_0x8775('0x15')]['message']);return _0x1fe59c(_0x37099b['error'][_0x8775('0x16')]);}else{logger[_0x8775('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5c5a4b,_0x8775('0x11'));_0x1fe59c(_0x37099b['result'][_0x8775('0x16')]);}})[_0x8775('0x17')](function(_0x101743){logger[_0x8775('0x15')](_0x8775('0x10'),_0x5c5a4b,_0x101743);_0x3f757d(_0x101743);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 70f0a72..166c171 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 _0x20d0=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x3600f5,_0x4911e6){var _0x351e54=function(_0x2f92a7){while(--_0x2f92a7){_0x3600f5['push'](_0x3600f5['shift']());}};_0x351e54(++_0x4911e6);}(_0x20d0,0x10e));var _0x020d=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x20d0[_0x2abc3d];return _0x252745;};'use strict';var multer=require(_0x020d('0x0'));var util=require(_0x020d('0x1'));var path=require(_0x020d('0x2'));var timeout=require(_0x020d('0x3'));var express=require(_0x020d('0x4'));var router=express[_0x020d('0x5')]();var fs_extra=require(_0x020d('0x6'));var auth=require(_0x020d('0x7'));var interaction=require(_0x020d('0x8'));var config=require(_0x020d('0x9'));var controller=require(_0x020d('0xa'));router[_0x020d('0xb')]('/',auth[_0x020d('0xc')](),controller[_0x020d('0xd')]);router[_0x020d('0xb')]('/:id',auth[_0x020d('0xc')](),controller[_0x020d('0xe')]);router[_0x020d('0xb')](_0x020d('0xf'),auth[_0x020d('0xc')](),controller[_0x020d('0x10')]);router['get'](_0x020d('0x11'),auth['isAuthenticated'](),controller[_0x020d('0x12')]);router[_0x020d('0x13')]('/',auth[_0x020d('0xc')](),controller[_0x020d('0x14')]);router['post'](_0x020d('0xf'),auth[_0x020d('0xc')](),controller[_0x020d('0x15')]);router[_0x020d('0x16')]('/:id',auth[_0x020d('0xc')](),controller[_0x020d('0x17')]);router[_0x020d('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x020d('0x19')]);module['exports']=router; \ No newline at end of file +var _0x3b61=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id'];(function(_0x3055a3,_0x5b79a6){var _0x3801ac=function(_0x2ce9fd){while(--_0x2ce9fd){_0x3055a3['push'](_0x3055a3['shift']());}};_0x3801ac(++_0x5b79a6);}(_0x3b61,0x1a3));var _0x13b6=function(_0x4491d9,_0x265573){_0x4491d9=_0x4491d9-0x0;var _0x582f25=_0x3b61[_0x4491d9];return _0x582f25;};'use strict';var multer=require(_0x13b6('0x0'));var util=require(_0x13b6('0x1'));var path=require('path');var timeout=require(_0x13b6('0x2'));var express=require(_0x13b6('0x3'));var router=express[_0x13b6('0x4')]();var fs_extra=require(_0x13b6('0x5'));var auth=require(_0x13b6('0x6'));var interaction=require(_0x13b6('0x7'));var config=require(_0x13b6('0x8'));var controller=require(_0x13b6('0x9'));router[_0x13b6('0xa')]('/',auth[_0x13b6('0xb')](),controller['index']);router[_0x13b6('0xa')](_0x13b6('0xc'),auth[_0x13b6('0xb')](),controller['show']);router['get'](_0x13b6('0xd'),auth[_0x13b6('0xb')](),controller[_0x13b6('0xe')]);router[_0x13b6('0xa')](_0x13b6('0xf'),auth[_0x13b6('0xb')](),controller[_0x13b6('0x10')]);router[_0x13b6('0x11')]('/',auth[_0x13b6('0xb')](),controller[_0x13b6('0x12')]);router[_0x13b6('0x11')](_0x13b6('0xd'),auth[_0x13b6('0xb')](),controller[_0x13b6('0x13')]);router[_0x13b6('0x14')]('/:id',auth[_0x13b6('0xb')](),controller[_0x13b6('0x15')]);router['delete'](_0x13b6('0xc'),auth['isAuthenticated'](),controller[_0x13b6('0x16')]);module[_0x13b6('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 8768325..8e8b63a 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 _0xf4f4=['exports','STRING','username','sequelize'];(function(_0x3fba41,_0x39825c){var _0x12e6a2=function(_0x5dda68){while(--_0x5dda68){_0x3fba41['push'](_0x3fba41['shift']());}};_0x12e6a2(++_0x39825c);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x11045d,_0x14910b){_0x11045d=_0x11045d-0x0;var _0x38a685=_0xf4f4[_0x11045d];return _0x38a685;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f4f('0x2')]},'username':{'type':Sequelize[_0x4f4f('0x2')],'unique':_0x4f4f('0x3')},'apiKey':{'type':Sequelize[_0x4f4f('0x2')]},'remoteUri':{'type':Sequelize[_0x4f4f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0xa87486,_0x5ff890){var _0x4fc6d5=function(_0x1c85c8){while(--_0x1c85c8){_0xa87486['push'](_0xa87486['shift']());}};_0x4fc6d5(++_0x5ff890);}(_0x1a37,0xb4));var _0x71a3=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x1a37[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('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 54d2c10..3dc1212 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 _0xce25=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','findOne','FreshdeskConfiguration','order','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','api/v2/ticket_fields','format','%s:X','apiKey','toString','base64','requester','agent','description','group','source','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce25,0x196));var _0x5ce2=function(_0x4d36a4,_0x303dd0){_0x4d36a4=_0x4d36a4-0x0;var _0x8d4548=_0xce25[_0x4d36a4];return _0x8d4548;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ce2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ce2('0x1'));var Mustache=require(_0x5ce2('0x2'));var util=require('util');var path=require(_0x5ce2('0x3'));var sox=require(_0x5ce2('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce2('0x5'));var _=require(_0x5ce2('0x6'));var squel=require(_0x5ce2('0x7'));var crypto=require(_0x5ce2('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5ce2('0x9'));var toCsv=require(_0x5ce2('0xa'));var querystring=require(_0x5ce2('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ce2('0xc'));var authService=require(_0x5ce2('0xd'));var qs=require(_0x5ce2('0xe'));var as=require(_0x5ce2('0xf'));var hardwareService=require(_0x5ce2('0x10'));var logger=require(_0x5ce2('0x11'))('api');var utils=require(_0x5ce2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5ce2('0x13'));var db=require(_0x5ce2('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x496c1e,_0x595d33){_0x595d33=_0x595d33||0xcc;return function(_0x550fb3){if(_0x550fb3){return _0x496c1e[_0x5ce2('0x15')](_0x595d33);}return _0x496c1e['status'](_0x595d33)['end']();};}function respondWithResult(_0x3a69ec,_0x56bd1b){_0x56bd1b=_0x56bd1b||0xc8;return function(_0x9316be){if(_0x9316be){return _0x3a69ec[_0x5ce2('0x16')](_0x56bd1b)[_0x5ce2('0x17')](_0x9316be);}};}function respondWithFilteredResult(_0x53e047,_0x36a2a5){return function(_0x2727c7){if(_0x2727c7){var _0x11f60a=typeof _0x36a2a5['offset']==='undefined'&&typeof _0x36a2a5[_0x5ce2('0x18')]===_0x5ce2('0x19');var _0x2890f0=_0x2727c7['count'];var _0x19915d=_0x11f60a?0x0:_0x36a2a5[_0x5ce2('0x1a')];var _0x3dd57a=_0x11f60a?_0x2727c7[_0x5ce2('0x1b')]:_0x36a2a5[_0x5ce2('0x1a')]+_0x36a2a5[_0x5ce2('0x18')];var _0x3b3eea;if(_0x3dd57a>=_0x2890f0){_0x3dd57a=_0x2890f0;_0x3b3eea=0xc8;}else{_0x3b3eea=0xce;}_0x53e047[_0x5ce2('0x16')](_0x3b3eea);return _0x53e047[_0x5ce2('0x1c')](_0x5ce2('0x1d'),_0x19915d+'-'+_0x3dd57a+'/'+_0x2890f0)[_0x5ce2('0x17')](_0x2727c7);}return null;};}function patchUpdates(_0x2d32c9){return function(_0xc9644){try{jsonpatch[_0x5ce2('0x1e')](_0xc9644,_0x2d32c9,!![]);}catch(_0x1c2841){return BPromise[_0x5ce2('0x1f')](_0x1c2841);}return _0xc9644[_0x5ce2('0x20')]();};}function saveUpdates(_0x28899f,_0x350fd9){return function(_0x587abb){if(_0x587abb){return _0x587abb['update'](_0x28899f)[_0x5ce2('0x21')](function(_0x2e9675){return _0x2e9675;});}return null;};}function removeEntity(_0x3440b5,_0x4f27aa){return function(_0x49054a){if(_0x49054a){return _0x49054a[_0x5ce2('0x22')]()[_0x5ce2('0x21')](function(){_0x3440b5['status'](0xcc)[_0x5ce2('0x23')]();});}};}function handleEntityNotFound(_0x3ab8c8,_0x25accf){return function(_0x2198aa){if(!_0x2198aa){_0x3ab8c8[_0x5ce2('0x15')](0x194);}return _0x2198aa;};}function handleError(_0x208448,_0x3a4bb9){_0x3a4bb9=_0x3a4bb9||0x1f4;return function(_0x19e637){logger[_0x5ce2('0x24')](_0x19e637[_0x5ce2('0x25')]);if(_0x19e637[_0x5ce2('0x26')]){delete _0x19e637[_0x5ce2('0x26')];}_0x208448[_0x5ce2('0x16')](_0x3a4bb9)[_0x5ce2('0x27')](_0x19e637);};}exports[_0x5ce2('0x28')]=function(_0x3ee0cd,_0x33d83c){var _0x2898ae={},_0x444d56={},_0x127a83={'count':0x0,'rows':[]};var _0x17e9ba=_[_0x5ce2('0x29')](db[_0x5ce2('0x2a')][_0x5ce2('0x2b')],function(_0x26332f){return{'name':_0x26332f[_0x5ce2('0x2c')],'type':_0x26332f[_0x5ce2('0x2d')][_0x5ce2('0x2e')]};});_0x444d56[_0x5ce2('0x2f')]=_[_0x5ce2('0x29')](_0x17e9ba,_0x5ce2('0x26'));_0x444d56[_0x5ce2('0x30')]=_['keys'](_0x3ee0cd[_0x5ce2('0x30')]);_0x444d56[_0x5ce2('0x31')]=_[_0x5ce2('0x32')](_0x444d56['model'],_0x444d56['query']);_0x2898ae[_0x5ce2('0x33')]=_[_0x5ce2('0x32')](_0x444d56[_0x5ce2('0x2f')],qs['fields'](_0x3ee0cd['query'][_0x5ce2('0x34')]));_0x2898ae[_0x5ce2('0x33')]=_0x2898ae['attributes'][_0x5ce2('0x35')]?_0x2898ae[_0x5ce2('0x33')]:_0x444d56[_0x5ce2('0x2f')];if(!_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x36')](_0x5ce2('0x37'))){_0x2898ae[_0x5ce2('0x18')]=qs[_0x5ce2('0x18')](_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x18')]);_0x2898ae[_0x5ce2('0x1a')]=qs['offset'](_0x3ee0cd['query']['offset']);}_0x2898ae['order']=qs[_0x5ce2('0x38')](_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x38')]);_0x2898ae[_0x5ce2('0x39')]=qs[_0x5ce2('0x31')](_[_0x5ce2('0x3a')](_0x3ee0cd[_0x5ce2('0x30')],_0x444d56[_0x5ce2('0x31')]),_0x17e9ba);if(_0x3ee0cd[_0x5ce2('0x30')][_0x5ce2('0x3b')]){_0x2898ae[_0x5ce2('0x39')]=_[_0x5ce2('0x3c')](_0x2898ae['where'],{'$or':_[_0x5ce2('0x29')](_0x17e9ba,function(_0x389fdc){if(_0x389fdc['type']!==_0x5ce2('0x3d')){var _0x3f2a07={};_0x3f2a07[_0x389fdc[_0x5ce2('0x26')]]={'$like':'%'+_0x3ee0cd[_0x5ce2('0x30')]['filter']+'%'};return _0x3f2a07;}})});}_0x2898ae=_[_0x5ce2('0x3c')]({},_0x2898ae,_0x3ee0cd[_0x5ce2('0x3e')]);var _0x338edc={'where':_0x2898ae[_0x5ce2('0x39')]};return db[_0x5ce2('0x2a')][_0x5ce2('0x1b')](_0x338edc)['then'](function(_0x2b82ae){_0x127a83[_0x5ce2('0x1b')]=_0x2b82ae;if(_0x3ee0cd['query'][_0x5ce2('0x3f')]){_0x2898ae[_0x5ce2('0x40')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x5ce2('0x41')](_0x2898ae);})[_0x5ce2('0x21')](function(_0x206656){_0x127a83[_0x5ce2('0x42')]=_0x206656;return _0x127a83;})[_0x5ce2('0x21')](respondWithFilteredResult(_0x33d83c,_0x2898ae))[_0x5ce2('0x43')](handleError(_0x33d83c,null));};exports[_0x5ce2('0x44')]=function(_0x370e3e,_0x3fde76){var _0x49a759={'raw':![],'where':{'id':_0x370e3e[_0x5ce2('0x45')]['id']}},_0xf652b4={};_0xf652b4['model']=_[_0x5ce2('0x46')](db['FreshdeskAccount'][_0x5ce2('0x2b')]);_0xf652b4[_0x5ce2('0x30')]=_[_0x5ce2('0x46')](_0x370e3e[_0x5ce2('0x30')]);_0xf652b4[_0x5ce2('0x31')]=_[_0x5ce2('0x32')](_0xf652b4[_0x5ce2('0x2f')],_0xf652b4['query']);_0x49a759[_0x5ce2('0x33')]=_[_0x5ce2('0x32')](_0xf652b4[_0x5ce2('0x2f')],qs[_0x5ce2('0x34')](_0x370e3e['query'][_0x5ce2('0x34')]));_0x49a759[_0x5ce2('0x33')]=_0x49a759[_0x5ce2('0x33')][_0x5ce2('0x35')]?_0x49a759['attributes']:_0xf652b4[_0x5ce2('0x2f')];if(_0x370e3e[_0x5ce2('0x30')][_0x5ce2('0x3f')]){_0x49a759[_0x5ce2('0x40')]=[{'all':!![]}];}_0x49a759=_['merge']({},_0x49a759,_0x370e3e[_0x5ce2('0x3e')]);return db[_0x5ce2('0x2a')][_0x5ce2('0x47')](_0x49a759)[_0x5ce2('0x21')](handleEntityNotFound(_0x3fde76,null))[_0x5ce2('0x21')](respondWithResult(_0x3fde76,null))['catch'](handleError(_0x3fde76,null));};exports[_0x5ce2('0x48')]=function(_0x2fe4d4,_0xdae367){return db[_0x5ce2('0x2a')][_0x5ce2('0x48')](_0x2fe4d4[_0x5ce2('0x49')],{})[_0x5ce2('0x21')](respondWithResult(_0xdae367,0xc9))[_0x5ce2('0x43')](handleError(_0xdae367,null));};exports[_0x5ce2('0x4a')]=function(_0x215d5,_0x47c22b){if(_0x215d5[_0x5ce2('0x49')]['id']){delete _0x215d5[_0x5ce2('0x49')]['id'];}return db[_0x5ce2('0x2a')]['find']({'where':{'id':_0x215d5[_0x5ce2('0x45')]['id']}})['then'](handleEntityNotFound(_0x47c22b,null))[_0x5ce2('0x21')](saveUpdates(_0x215d5['body'],null))[_0x5ce2('0x21')](respondWithResult(_0x47c22b,null))['catch'](handleError(_0x47c22b,null));};exports['destroy']=function(_0x4ae957,_0x3d9fd4){return db[_0x5ce2('0x2a')][_0x5ce2('0x47')]({'where':{'id':_0x4ae957[_0x5ce2('0x45')]['id']}})[_0x5ce2('0x21')](handleEntityNotFound(_0x3d9fd4,null))[_0x5ce2('0x21')](removeEntity(_0x3d9fd4,null))[_0x5ce2('0x43')](handleError(_0x3d9fd4,null));};exports['getConfigurations']=function(_0x51944a,_0x582c4b,_0x4f9b2f){var _0x361867={};var _0x49f7e6={};var _0x1d9eed;var _0x296ea8;return db[_0x5ce2('0x2a')][_0x5ce2('0x4b')]({'where':{'id':_0x51944a['params']['id']}})[_0x5ce2('0x21')](handleEntityNotFound(_0x582c4b,null))[_0x5ce2('0x21')](function(_0x187b74){if(_0x187b74){_0x1d9eed=_0x187b74;_0x49f7e6[_0x5ce2('0x2f')]=_[_0x5ce2('0x46')](db[_0x5ce2('0x4c')][_0x5ce2('0x2b')]);_0x49f7e6['query']=_[_0x5ce2('0x46')](_0x51944a[_0x5ce2('0x30')]);_0x49f7e6[_0x5ce2('0x31')]=_[_0x5ce2('0x32')](_0x49f7e6['model'],_0x49f7e6[_0x5ce2('0x30')]);_0x361867[_0x5ce2('0x33')]=_['intersection'](_0x49f7e6[_0x5ce2('0x2f')],qs[_0x5ce2('0x34')](_0x51944a[_0x5ce2('0x30')][_0x5ce2('0x34')]));_0x361867[_0x5ce2('0x33')]=_0x361867[_0x5ce2('0x33')][_0x5ce2('0x35')]?_0x361867[_0x5ce2('0x33')]:_0x49f7e6[_0x5ce2('0x2f')];_0x361867[_0x5ce2('0x4d')]=qs['sort'](_0x51944a[_0x5ce2('0x30')]['sort']);_0x361867[_0x5ce2('0x39')]=qs[_0x5ce2('0x31')](_[_0x5ce2('0x3a')](_0x51944a['query'],_0x49f7e6[_0x5ce2('0x31')]));if(_0x51944a['query']['filter']){_0x361867[_0x5ce2('0x39')]=_[_0x5ce2('0x3c')](_0x361867[_0x5ce2('0x39')],{'$or':_['map'](_0x361867[_0x5ce2('0x33')],function(_0x14c084){var _0xcae51f={};_0xcae51f[_0x14c084]={'$like':'%'+_0x51944a[_0x5ce2('0x30')][_0x5ce2('0x3b')]+'%'};return _0xcae51f;})});}_0x361867=_['merge']({},_0x361867,_0x51944a[_0x5ce2('0x3e')]);return _0x1d9eed[_0x5ce2('0x4e')](_0x361867);}})[_0x5ce2('0x21')](function(_0x2dd112){if(_0x2dd112){_0x296ea8=_0x2dd112[_0x5ce2('0x35')];if(!_0x51944a[_0x5ce2('0x30')][_0x5ce2('0x36')](_0x5ce2('0x37'))){_0x361867[_0x5ce2('0x18')]=qs['limit'](_0x51944a['query'][_0x5ce2('0x18')]);_0x361867[_0x5ce2('0x1a')]=qs['offset'](_0x51944a['query'][_0x5ce2('0x1a')]);}return _0x1d9eed[_0x5ce2('0x4e')](_0x361867);}})[_0x5ce2('0x21')](function(_0x58e990){if(_0x58e990){return _0x58e990?{'count':_0x296ea8,'rows':_0x58e990}:null;}})['then'](respondWithResult(_0x582c4b,null))[_0x5ce2('0x43')](handleError(_0x582c4b,null));};exports[_0x5ce2('0x4f')]=function(_0x3f8deb,_0x1fe0a2,_0x2268d8){if(_0x3f8deb[_0x5ce2('0x49')]['id']){delete _0x3f8deb[_0x5ce2('0x49')]['id'];}return db[_0x5ce2('0x2a')][_0x5ce2('0x4b')]({'where':{'id':_0x3f8deb['params']['id']}})['then'](handleEntityNotFound(_0x1fe0a2,null))[_0x5ce2('0x21')](function(_0x423799){if(_0x423799){_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x50')]=_0x423799['id'];_0x3f8deb[_0x5ce2('0x49')]['Subjects']=integrations[_0x5ce2('0x51')](_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x52')],_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x2d')]);_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x53')]=integrations['getDescriptions'](_0x3f8deb[_0x5ce2('0x49')][_0x5ce2('0x52')],_0x3f8deb['body'][_0x5ce2('0x2d')]);return db[_0x5ce2('0x4c')][_0x5ce2('0x48')](_0x3f8deb[_0x5ce2('0x49')],{'include':[{'model':db[_0x5ce2('0x54')],'as':'Subjects'},{'model':db[_0x5ce2('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1fe0a2,null))[_0x5ce2('0x43')](handleError(_0x1fe0a2,null));};exports[_0x5ce2('0x55')]=function(_0x46bd13,_0x1ae5ae,_0xacc9b9){var _0x2549ea='';return db[_0x5ce2('0x2a')][_0x5ce2('0x4b')]({'where':{'id':_0x46bd13[_0x5ce2('0x45')]['id']},'attributes':['id',_0x5ce2('0x56'),'apiKey']})[_0x5ce2('0x21')](handleEntityNotFound(_0x1ae5ae,null))[_0x5ce2('0x21')](function(_0x590943){if(_0x590943){_0x2549ea=_0x590943[_0x5ce2('0x56')];var _0x543636=_0x2549ea[_0x5ce2('0x57')](-0x1);if(_0x543636==='/'){_0x2549ea=_0x2549ea[_0x5ce2('0x58')](0x0,_0x2549ea[_0x5ce2('0x59')](_0x543636));}return rp({'method':_0x5ce2('0x5a'),'uri':util['format']('%s/%s',_0x2549ea,_0x5ce2('0x5b')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x5ce2('0x5c')](_0x5ce2('0x5d'),_0x590943[_0x5ce2('0x5e')]))[_0x5ce2('0x5f')](_0x5ce2('0x60')))},'json':!![]});}})[_0x5ce2('0x21')](function(_0x5132d7){if(_0x5132d7){var _0x1ee889=[_0x5ce2('0x61'),'subject',_0x5ce2('0x62'),_0x5ce2('0x63'),_0x5ce2('0x16'),'priority',_0x5ce2('0x64'),_0x5ce2('0x65'),'ticket_type','group','company'];_['remove'](_0x5132d7,function(_0x27aaef){return _0x1ee889[_0x5ce2('0x66')](_0x27aaef[_0x5ce2('0x26')])||!_0x27aaef[_0x5ce2('0x67')]&&_0x27aaef[_0x5ce2('0x2d')]!==_0x5ce2('0x68')&&_0x27aaef['type']!==_0x5ce2('0x69');});return{'count':_0x5132d7['length'],'rows':_[_0x5ce2('0x29')](_0x5132d7,function(_0x28e691){return{'id':_0x28e691[_0x5ce2('0x26')],'name':_0x28e691[_0x5ce2('0x6a')],'custom':!_0x28e691['default'],'options':_0x28e691[_0x5ce2('0x6b')]?_[_0x5ce2('0x29')](_0x28e691['choices'],function(_0x216e46){return{'name':_['capitalize'](_0x216e46),'value':_0x216e46};}):[]};})};}})[_0x5ce2('0x21')](respondWithResult(_0x1ae5ae,null))['catch'](function(_0x37249c){var _0x544a6a=_0x46bd13[_0x5ce2('0x30')][_0x5ce2('0x6c')]?0x1f4:_0x37249c[_0x5ce2('0x6d')]||0x1f4;logger[_0x5ce2('0x24')](_0x5ce2('0x6e'),'getFields',_0x544a6a,JSON[_0x5ce2('0x6f')](_0x37249c));delete _0x37249c[_0x5ce2('0x26')];if(_0x544a6a===0x191){_0x544a6a=0x190;}_0x1ae5ae[_0x5ce2('0x16')](_0x544a6a)[_0x5ce2('0x27')](_0x46bd13['query'][_0x5ce2('0x6c')]?{'message':_0x5ce2('0x70'),'statusCode':_0x37249c['statusCode']}:_0x37249c);});}; \ No newline at end of file +var _0x1123=['VIRTUAL','options','count','includeAll','include','findAll','catch','show','intersection','body','update','find','params','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','agent','priority','group','source','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x2f04a4,_0x1be47e){var _0x5dde34=function(_0x2aac62){while(--_0x2aac62){_0x2f04a4['push'](_0x2f04a4['shift']());}};_0x5dde34(++_0x1be47e);}(_0x1123,0x118));var _0x3112=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1123[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3112('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3112('0x1'));var moment=require(_0x3112('0x2'));var BPromise=require(_0x3112('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3112('0x4'));var sox=require(_0x3112('0x5'));var csv=require(_0x3112('0x6'));var ejs=require(_0x3112('0x7'));var fs=require('fs');var fs_extra=require(_0x3112('0x8'));var _=require(_0x3112('0x9'));var squel=require(_0x3112('0xa'));var crypto=require(_0x3112('0xb'));var jsforce=require(_0x3112('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3112('0x6'));var querystring=require(_0x3112('0xd'));var Papa=require(_0x3112('0xe'));var Redis=require(_0x3112('0xf'));var authService=require(_0x3112('0x10'));var qs=require(_0x3112('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3112('0x12'))(_0x3112('0x13'));var utils=require(_0x3112('0x14'));var config=require(_0x3112('0x15'));var licenseUtil=require(_0x3112('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3112('0x17'));function respondWithStatusCode(_0x50a8a8,_0x5f2e90){_0x5f2e90=_0x5f2e90||0xcc;return function(_0x410b6d){if(_0x410b6d){return _0x50a8a8[_0x3112('0x18')](_0x5f2e90);}return _0x50a8a8[_0x3112('0x19')](_0x5f2e90)['end']();};}function respondWithResult(_0x48d238,_0x1d9f06){_0x1d9f06=_0x1d9f06||0xc8;return function(_0x5eeae7){if(_0x5eeae7){return _0x48d238[_0x3112('0x19')](_0x1d9f06)['json'](_0x5eeae7);}};}function respondWithFilteredResult(_0x56b594,_0x43a554){return function(_0x868e4b){if(_0x868e4b){var _0x5a6255=typeof _0x43a554[_0x3112('0x1a')]===_0x3112('0x1b')&&typeof _0x43a554['limit']==='undefined';var _0x3b2b44=_0x868e4b['count'];var _0x254ffc=_0x5a6255?0x0:_0x43a554[_0x3112('0x1a')];var _0x5e9262=_0x5a6255?_0x868e4b['count']:_0x43a554[_0x3112('0x1a')]+_0x43a554[_0x3112('0x1c')];var _0x901d10;if(_0x5e9262>=_0x3b2b44){_0x5e9262=_0x3b2b44;_0x901d10=0xc8;}else{_0x901d10=0xce;}_0x56b594[_0x3112('0x19')](_0x901d10);return _0x56b594[_0x3112('0x1d')](_0x3112('0x1e'),_0x254ffc+'-'+_0x5e9262+'/'+_0x3b2b44)['json'](_0x868e4b);}return null;};}function patchUpdates(_0x7fa729){return function(_0x4c61ba){try{jsonpatch[_0x3112('0x1f')](_0x4c61ba,_0x7fa729,!![]);}catch(_0x2f36ca){return BPromise[_0x3112('0x20')](_0x2f36ca);}return _0x4c61ba[_0x3112('0x21')]();};}function saveUpdates(_0x45ebd2,_0x4897b4){return function(_0x435227){if(_0x435227){return _0x435227['update'](_0x45ebd2)[_0x3112('0x22')](function(_0x4d5652){return _0x4d5652;});}return null;};}function removeEntity(_0x537e31,_0x31b3ac){return function(_0x48f464){if(_0x48f464){return _0x48f464[_0x3112('0x23')]()[_0x3112('0x22')](function(){_0x537e31[_0x3112('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32d8f4,_0x41233d){return function(_0xb5413b){if(!_0xb5413b){_0x32d8f4[_0x3112('0x18')](0x194);}return _0xb5413b;};}function handleError(_0x58b30f,_0x34ca6d){_0x34ca6d=_0x34ca6d||0x1f4;return function(_0x1a8d96){logger['error'](_0x1a8d96[_0x3112('0x24')]);if(_0x1a8d96['name']){delete _0x1a8d96[_0x3112('0x25')];}_0x58b30f[_0x3112('0x19')](_0x34ca6d)[_0x3112('0x26')](_0x1a8d96);};}exports[_0x3112('0x27')]=function(_0x20f457,_0x58e291){var _0x1d1e4a={},_0x5305c1={},_0x210364={'count':0x0,'rows':[]};var _0x53553c=_[_0x3112('0x28')](db[_0x3112('0x29')][_0x3112('0x2a')],function(_0xc56c20){return{'name':_0xc56c20[_0x3112('0x2b')],'type':_0xc56c20[_0x3112('0x2c')]['key']};});_0x5305c1['model']=_[_0x3112('0x28')](_0x53553c,_0x3112('0x25'));_0x5305c1[_0x3112('0x2d')]=_[_0x3112('0x2e')](_0x20f457[_0x3112('0x2d')]);_0x5305c1[_0x3112('0x2f')]=_['intersection'](_0x5305c1[_0x3112('0x30')],_0x5305c1[_0x3112('0x2d')]);_0x1d1e4a[_0x3112('0x31')]=_['intersection'](_0x5305c1['model'],qs[_0x3112('0x32')](_0x20f457[_0x3112('0x2d')][_0x3112('0x32')]));_0x1d1e4a['attributes']=_0x1d1e4a[_0x3112('0x31')][_0x3112('0x33')]?_0x1d1e4a[_0x3112('0x31')]:_0x5305c1['model'];if(!_0x20f457[_0x3112('0x2d')][_0x3112('0x34')]('nolimit')){_0x1d1e4a['limit']=qs[_0x3112('0x1c')](_0x20f457[_0x3112('0x2d')][_0x3112('0x1c')]);_0x1d1e4a['offset']=qs[_0x3112('0x1a')](_0x20f457[_0x3112('0x2d')][_0x3112('0x1a')]);}_0x1d1e4a[_0x3112('0x35')]=qs[_0x3112('0x36')](_0x20f457[_0x3112('0x2d')][_0x3112('0x36')]);_0x1d1e4a[_0x3112('0x37')]=qs[_0x3112('0x2f')](_[_0x3112('0x38')](_0x20f457[_0x3112('0x2d')],_0x5305c1[_0x3112('0x2f')]),_0x53553c);if(_0x20f457['query'][_0x3112('0x39')]){_0x1d1e4a[_0x3112('0x37')]=_[_0x3112('0x3a')](_0x1d1e4a['where'],{'$or':_[_0x3112('0x28')](_0x53553c,function(_0x50d592){if(_0x50d592[_0x3112('0x2c')]!==_0x3112('0x3b')){var _0xd1212d={};_0xd1212d[_0x50d592[_0x3112('0x25')]]={'$like':'%'+_0x20f457['query'][_0x3112('0x39')]+'%'};return _0xd1212d;}})});}_0x1d1e4a=_['merge']({},_0x1d1e4a,_0x20f457[_0x3112('0x3c')]);var _0x223e10={'where':_0x1d1e4a[_0x3112('0x37')]};return db['FreshdeskAccount'][_0x3112('0x3d')](_0x223e10)[_0x3112('0x22')](function(_0x86e0e3){_0x210364['count']=_0x86e0e3;if(_0x20f457[_0x3112('0x2d')][_0x3112('0x3e')]){_0x1d1e4a[_0x3112('0x3f')]=[{'all':!![]}];}return db[_0x3112('0x29')][_0x3112('0x40')](_0x1d1e4a);})[_0x3112('0x22')](function(_0x208236){_0x210364['rows']=_0x208236;return _0x210364;})[_0x3112('0x22')](respondWithFilteredResult(_0x58e291,_0x1d1e4a))[_0x3112('0x41')](handleError(_0x58e291,null));};exports[_0x3112('0x42')]=function(_0x31f64e,_0x3b3950){var _0x83d160={'raw':![],'where':{'id':_0x31f64e['params']['id']}},_0x4bad75={};_0x4bad75[_0x3112('0x30')]=_[_0x3112('0x2e')](db[_0x3112('0x29')][_0x3112('0x2a')]);_0x4bad75[_0x3112('0x2d')]=_[_0x3112('0x2e')](_0x31f64e['query']);_0x4bad75[_0x3112('0x2f')]=_[_0x3112('0x43')](_0x4bad75[_0x3112('0x30')],_0x4bad75[_0x3112('0x2d')]);_0x83d160[_0x3112('0x31')]=_[_0x3112('0x43')](_0x4bad75[_0x3112('0x30')],qs[_0x3112('0x32')](_0x31f64e['query'][_0x3112('0x32')]));_0x83d160[_0x3112('0x31')]=_0x83d160['attributes'][_0x3112('0x33')]?_0x83d160['attributes']:_0x4bad75[_0x3112('0x30')];if(_0x31f64e['query']['includeAll']){_0x83d160[_0x3112('0x3f')]=[{'all':!![]}];}_0x83d160=_['merge']({},_0x83d160,_0x31f64e[_0x3112('0x3c')]);return db[_0x3112('0x29')]['find'](_0x83d160)[_0x3112('0x22')](handleEntityNotFound(_0x3b3950,null))[_0x3112('0x22')](respondWithResult(_0x3b3950,null))['catch'](handleError(_0x3b3950,null));};exports['create']=function(_0x3c6cd2,_0x5cd27d){return db[_0x3112('0x29')]['create'](_0x3c6cd2[_0x3112('0x44')],{})[_0x3112('0x22')](respondWithResult(_0x5cd27d,0xc9))['catch'](handleError(_0x5cd27d,null));};exports[_0x3112('0x45')]=function(_0x5f1305,_0x2f8d76){if(_0x5f1305[_0x3112('0x44')]['id']){delete _0x5f1305[_0x3112('0x44')]['id'];}return db[_0x3112('0x29')]['find']({'where':{'id':_0x5f1305['params']['id']}})[_0x3112('0x22')](handleEntityNotFound(_0x2f8d76,null))[_0x3112('0x22')](saveUpdates(_0x5f1305[_0x3112('0x44')],null))['then'](respondWithResult(_0x2f8d76,null))[_0x3112('0x41')](handleError(_0x2f8d76,null));};exports[_0x3112('0x23')]=function(_0x12279e,_0x1f6afc){return db['FreshdeskAccount'][_0x3112('0x46')]({'where':{'id':_0x12279e[_0x3112('0x47')]['id']}})[_0x3112('0x22')](handleEntityNotFound(_0x1f6afc,null))[_0x3112('0x22')](removeEntity(_0x1f6afc,null))[_0x3112('0x41')](handleError(_0x1f6afc,null));};exports[_0x3112('0x48')]=function(_0x259378,_0x375837,_0x58f82c){var _0x2cc682={};var _0x1dcad2={};var _0x4e67c2;var _0x1ddb22;return db[_0x3112('0x29')][_0x3112('0x49')]({'where':{'id':_0x259378[_0x3112('0x47')]['id']}})['then'](handleEntityNotFound(_0x375837,null))['then'](function(_0x450853){if(_0x450853){_0x4e67c2=_0x450853;_0x1dcad2[_0x3112('0x30')]=_[_0x3112('0x2e')](db[_0x3112('0x4a')][_0x3112('0x2a')]);_0x1dcad2['query']=_[_0x3112('0x2e')](_0x259378[_0x3112('0x2d')]);_0x1dcad2[_0x3112('0x2f')]=_[_0x3112('0x43')](_0x1dcad2[_0x3112('0x30')],_0x1dcad2[_0x3112('0x2d')]);_0x2cc682['attributes']=_['intersection'](_0x1dcad2[_0x3112('0x30')],qs[_0x3112('0x32')](_0x259378[_0x3112('0x2d')][_0x3112('0x32')]));_0x2cc682['attributes']=_0x2cc682[_0x3112('0x31')][_0x3112('0x33')]?_0x2cc682[_0x3112('0x31')]:_0x1dcad2['model'];_0x2cc682['order']=qs[_0x3112('0x36')](_0x259378['query'][_0x3112('0x36')]);_0x2cc682['where']=qs[_0x3112('0x2f')](_[_0x3112('0x38')](_0x259378['query'],_0x1dcad2[_0x3112('0x2f')]));if(_0x259378[_0x3112('0x2d')][_0x3112('0x39')]){_0x2cc682['where']=_['merge'](_0x2cc682[_0x3112('0x37')],{'$or':_['map'](_0x2cc682[_0x3112('0x31')],function(_0x3498ac){var _0x1c1a4a={};_0x1c1a4a[_0x3498ac]={'$like':'%'+_0x259378['query'][_0x3112('0x39')]+'%'};return _0x1c1a4a;})});}_0x2cc682=_[_0x3112('0x3a')]({},_0x2cc682,_0x259378[_0x3112('0x3c')]);return _0x4e67c2['getConfigurations'](_0x2cc682);}})[_0x3112('0x22')](function(_0x2716f1){if(_0x2716f1){_0x1ddb22=_0x2716f1[_0x3112('0x33')];if(!_0x259378['query'][_0x3112('0x34')](_0x3112('0x4b'))){_0x2cc682[_0x3112('0x1c')]=qs[_0x3112('0x1c')](_0x259378[_0x3112('0x2d')][_0x3112('0x1c')]);_0x2cc682[_0x3112('0x1a')]=qs[_0x3112('0x1a')](_0x259378[_0x3112('0x2d')][_0x3112('0x1a')]);}return _0x4e67c2['getConfigurations'](_0x2cc682);}})[_0x3112('0x22')](function(_0x3e25a4){if(_0x3e25a4){return _0x3e25a4?{'count':_0x1ddb22,'rows':_0x3e25a4}:null;}})[_0x3112('0x22')](respondWithResult(_0x375837,null))[_0x3112('0x41')](handleError(_0x375837,null));};exports[_0x3112('0x4c')]=function(_0x4b413e,_0x277f23,_0x521608){if(_0x4b413e['body']['id']){delete _0x4b413e[_0x3112('0x44')]['id'];}return db[_0x3112('0x29')][_0x3112('0x49')]({'where':{'id':_0x4b413e[_0x3112('0x47')]['id']}})[_0x3112('0x22')](handleEntityNotFound(_0x277f23,null))[_0x3112('0x22')](function(_0x523e5c){if(_0x523e5c){_0x4b413e[_0x3112('0x44')][_0x3112('0x4d')]=_0x523e5c['id'];_0x4b413e[_0x3112('0x44')][_0x3112('0x4e')]=integrations[_0x3112('0x4f')](_0x4b413e[_0x3112('0x44')][_0x3112('0x50')],_0x4b413e['body'][_0x3112('0x2c')]);_0x4b413e[_0x3112('0x44')][_0x3112('0x51')]=integrations[_0x3112('0x52')](_0x4b413e[_0x3112('0x44')]['channel'],_0x4b413e[_0x3112('0x44')][_0x3112('0x2c')]);return db['FreshdeskConfiguration'][_0x3112('0x53')](_0x4b413e[_0x3112('0x44')],{'include':[{'model':db[_0x3112('0x54')],'as':_0x3112('0x4e')},{'model':db[_0x3112('0x54')],'as':_0x3112('0x51')}]});}return null;})['then'](respondWithResult(_0x277f23,null))[_0x3112('0x41')](handleError(_0x277f23,null));};exports[_0x3112('0x55')]=function(_0x12fb73,_0x4d99a1,_0x6a60d2){var _0x104f47='';return db[_0x3112('0x29')]['findOne']({'where':{'id':_0x12fb73[_0x3112('0x47')]['id']},'attributes':['id',_0x3112('0x56'),_0x3112('0x57')]})[_0x3112('0x22')](handleEntityNotFound(_0x4d99a1,null))[_0x3112('0x22')](function(_0x4a40ef){if(_0x4a40ef){_0x104f47=_0x4a40ef[_0x3112('0x56')];var _0x5037b6=_0x104f47[_0x3112('0x58')](-0x1);if(_0x5037b6==='/'){_0x104f47=_0x104f47['substring'](0x0,_0x104f47[_0x3112('0x59')](_0x5037b6));}return rp({'method':'GET','uri':util[_0x3112('0x5a')]('%s/%s',_0x104f47,_0x3112('0x5b')),'headers':{'Authorization':util['format'](_0x3112('0x5c'),new Buffer(util[_0x3112('0x5a')](_0x3112('0x5d'),_0x4a40ef[_0x3112('0x57')]))['toString'](_0x3112('0x5e')))},'json':!![]});}})[_0x3112('0x22')](function(_0x5abb45){if(_0x5abb45){var _0x1e36c8=[_0x3112('0x5f'),'subject',_0x3112('0x60'),'description',_0x3112('0x19'),_0x3112('0x61'),_0x3112('0x62'),_0x3112('0x63'),'ticket_type','group','company'];_['remove'](_0x5abb45,function(_0x3d1e19){return _0x1e36c8[_0x3112('0x64')](_0x3d1e19[_0x3112('0x25')])||!_0x3d1e19[_0x3112('0x65')]&&_0x3d1e19[_0x3112('0x2c')]!==_0x3112('0x66')&&_0x3d1e19[_0x3112('0x2c')]!==_0x3112('0x67');});return{'count':_0x5abb45['length'],'rows':_[_0x3112('0x28')](_0x5abb45,function(_0x5107ec){return{'id':_0x5107ec[_0x3112('0x25')],'name':_0x5107ec[_0x3112('0x68')],'custom':!_0x5107ec['default'],'options':_0x5107ec[_0x3112('0x69')]?_[_0x3112('0x28')](_0x5107ec[_0x3112('0x69')],function(_0x2aca76){return{'name':_[_0x3112('0x6a')](_0x2aca76),'value':_0x2aca76};}):[]};})};}})[_0x3112('0x22')](respondWithResult(_0x4d99a1,null))[_0x3112('0x41')](function(_0x175d73){var _0x4dfa60=_0x12fb73[_0x3112('0x2d')][_0x3112('0x6b')]?0x1f4:_0x175d73[_0x3112('0x6c')]||0x1f4;logger[_0x3112('0x6d')](_0x3112('0x6e'),'getFields',_0x4dfa60,JSON[_0x3112('0x6f')](_0x175d73));delete _0x175d73[_0x3112('0x25')];if(_0x4dfa60===0x191){_0x4dfa60=0x190;}_0x4d99a1[_0x3112('0x19')](_0x4dfa60)[_0x3112('0x26')](_0x12fb73[_0x3112('0x2d')][_0x3112('0x6b')]?{'message':_0x3112('0x70'),'statusCode':_0x175d73[_0x3112('0x6c')]}:_0x175d73);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 876833e..26b1080 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 _0x77cf=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x77cf,0x131));var _0xf77c=function(_0x1c813e,_0x1641bf){_0x1c813e=_0x1c813e-0x0;var _0x10aec3=_0x77cf[_0x1c813e];return _0x10aec3;};'use strict';var _=require(_0xf77c('0x0'));var util=require(_0xf77c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf77c('0x2'));var BPromise=require(_0xf77c('0x3'));var rp=require(_0xf77c('0x4'));var fs=require('fs');var path=require(_0xf77c('0x5'));var rimraf=require(_0xf77c('0x6'));var config=require(_0xf77c('0x7'));var attributes=require(_0xf77c('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x255b0b,_0x22bfc3){return _0x255b0b['define'](_0xf77c('0x9'),attributes,{'tableName':_0xf77c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30cf=['FreshdeskAccount','int_freshdesk_accounts','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x59ee75,_0x304dce){var _0x6b387f=function(_0x24ad3a){while(--_0x24ad3a){_0x59ee75['push'](_0x59ee75['shift']());}};_0x6b387f(++_0x304dce);}(_0x30cf,0x120));var _0xf30c=function(_0x7fa8a1,_0x52c9be){_0x7fa8a1=_0x7fa8a1-0x0;var _0x41fa61=_0x30cf[_0x7fa8a1];return _0x41fa61;};'use strict';var _=require('lodash');var util=require(_0xf30c('0x0'));var logger=require('../../config/logger')(_0xf30c('0x1'));var moment=require('moment');var BPromise=require(_0xf30c('0x2'));var rp=require(_0xf30c('0x3'));var fs=require('fs');var path=require(_0xf30c('0x4'));var rimraf=require(_0xf30c('0x5'));var config=require(_0xf30c('0x6'));var attributes=require(_0xf30c('0x7'));var integrations=require(_0xf30c('0x8'));module[_0xf30c('0x9')]=function(_0x2290e1,_0x7f27e9){return _0x2290e1[_0xf30c('0xa')](_0xf30c('0xb'),attributes,{'tableName':_0xf30c('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 69fbb3e..559d44f 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 _0x83f3=['raw','where','attributes','limit','include','map','model','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options'];(function(_0x39c280,_0xfb1879){var _0x67324f=function(_0x382448){while(--_0x382448){_0x39c280['push'](_0x39c280['shift']());}};_0x67324f(++_0xfb1879);}(_0x83f3,0x15d));var _0x383f=function(_0x38e8a3,_0x29a164){_0x38e8a3=_0x38e8a3-0x0;var _0x1253fb=_0x83f3[_0x38e8a3];return _0x1253fb;};'use strict';var _=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var moment=require(_0x383f('0x2'));var BPromise=require(_0x383f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x383f('0x4'));var logger=require(_0x383f('0x5'))('rpc');var config=require(_0x383f('0x6'));var jayson=require(_0x383f('0x7'));var client=jayson[_0x383f('0x8')][_0x383f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3253f3,_0x460484,_0x1a6458){return new BPromise(function(_0x121839,_0x5e480d){return client['request'](_0x3253f3,_0x1a6458)[_0x383f('0xa')](function(_0x4a9b31){logger[_0x383f('0xb')](_0x383f('0xc'),_0x460484,_0x383f('0xd'));logger[_0x383f('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x460484,_0x383f('0xd'),JSON[_0x383f('0xf')](_0x4a9b31));if(_0x4a9b31[_0x383f('0x10')]){if(_0x4a9b31[_0x383f('0x10')][_0x383f('0x11')]===0x1f4){logger[_0x383f('0x10')](_0x383f('0xc'),_0x460484,_0x4a9b31['error'][_0x383f('0x12')]);return _0x5e480d(_0x4a9b31['error'][_0x383f('0x12')]);}logger['error'](_0x383f('0xc'),_0x460484,_0x4a9b31[_0x383f('0x10')]['message']);return _0x121839(_0x4a9b31[_0x383f('0x10')]['message']);}else{logger[_0x383f('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x460484,'request\x20sent');_0x121839(_0x4a9b31[_0x383f('0x13')][_0x383f('0x12')]);}})[_0x383f('0x14')](function(_0x31c431){logger[_0x383f('0x10')](_0x383f('0xc'),_0x460484,_0x31c431);_0x5e480d(_0x31c431);});});}exports[_0x383f('0x15')]=function(_0x3a6f6c){var _0x30c15a=this;return new Promise(function(_0x14df4b,_0x5e4d16){return db[_0x383f('0x16')][_0x383f('0x17')]({'raw':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x19')]===undefined?!![]:![]:!![],'where':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x1a')]||null:null,'attributes':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x1b')]||null:null,'limit':_0x3a6f6c[_0x383f('0x18')]?_0x3a6f6c['options'][_0x383f('0x1c')]||null:null,'include':_0x3a6f6c['options']?_0x3a6f6c[_0x383f('0x18')][_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x3a6f6c['options']['include'],function(_0x437835){return{'model':db[_0x437835[_0x383f('0x1f')]],'as':_0x437835['as'],'attributes':_0x437835[_0x383f('0x1b')],'include':_0x437835[_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x437835[_0x383f('0x1d')],function(_0x26260a){return{'model':db[_0x26260a['model']],'as':_0x26260a['as'],'attributes':_0x26260a[_0x383f('0x1b')],'include':_0x26260a[_0x383f('0x1d')]?_['map'](_0x26260a[_0x383f('0x1d')],function(_0x48e467){return{'model':db[_0x48e467[_0x383f('0x1f')]],'as':_0x48e467['as'],'attributes':_0x48e467[_0x383f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x383f('0xa')](function(_0x14d01f){logger['info']('GetFreshdeskAccount',_0x3a6f6c);logger[_0x383f('0xe')](_0x383f('0x15'),_0x3a6f6c,JSON[_0x383f('0xf')](_0x14d01f));_0x14df4b(_0x14d01f);})[_0x383f('0x14')](function(_0x55da9a){logger[_0x383f('0x10')](_0x383f('0x15'),_0x55da9a[_0x383f('0x12')],_0x3a6f6c);_0x5e4d16(_0x30c15a[_0x383f('0x10')](0x1f4,_0x55da9a[_0x383f('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x550275){var _0x5b83ab=this;return new Promise(function(_0x2229d8,_0x525669){return db['FreshdeskAccount'][_0x383f('0x20')]({'raw':_0x550275[_0x383f('0x18')]?_0x550275['options']['raw']===undefined?!![]:![]:!![],'where':_0x550275[_0x383f('0x18')]?_0x550275[_0x383f('0x18')][_0x383f('0x1a')]||null:null,'attributes':_0x550275[_0x383f('0x18')]?_0x550275[_0x383f('0x18')][_0x383f('0x1b')]||null:null,'include':_0x550275[_0x383f('0x18')]?_0x550275[_0x383f('0x18')][_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x550275[_0x383f('0x18')][_0x383f('0x1d')],function(_0x59452c){return{'model':db[_0x59452c[_0x383f('0x1f')]],'as':_0x59452c['as'],'attributes':_0x59452c[_0x383f('0x1b')],'include':_0x59452c['include']?_[_0x383f('0x1e')](_0x59452c[_0x383f('0x1d')],function(_0x324f20){return{'model':db[_0x324f20[_0x383f('0x1f')]],'as':_0x324f20['as'],'attributes':_0x324f20[_0x383f('0x1b')],'include':_0x324f20[_0x383f('0x1d')]?_[_0x383f('0x1e')](_0x324f20[_0x383f('0x1d')],function(_0x271bcb){return{'model':db[_0x271bcb[_0x383f('0x1f')]],'as':_0x271bcb['as'],'attributes':_0x271bcb['attributes']};}):[]};}):[]};}):[]:[]})[_0x383f('0xa')](function(_0x456a00){logger['info'](_0x383f('0x21'),_0x550275);logger[_0x383f('0xe')](_0x383f('0x21'),_0x550275,JSON['stringify'](_0x456a00));_0x2229d8(_0x456a00);})['catch'](function(_0x4a697d){logger[_0x383f('0x10')]('ShowFreshdeskAccount',_0x4a697d[_0x383f('0x12')],_0x550275);_0x525669(_0x5b83ab['error'](0x1f4,_0x4a697d['message']));});});}; \ No newline at end of file +var _0xf151=['code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x456f2d,_0x3ff5d8){var _0x18281a=function(_0x503f7d){while(--_0x503f7d){_0x456f2d['push'](_0x456f2d['shift']());}};_0x18281a(++_0x3ff5d8);}(_0xf151,0x1a8));var _0x1f15=function(_0x4c228c,_0x33f21b){_0x4c228c=_0x4c228c-0x0;var _0x569395=_0xf151[_0x4c228c];return _0x569395;};'use strict';var _=require(_0x1f15('0x0'));var util=require('util');var moment=require(_0x1f15('0x1'));var BPromise=require(_0x1f15('0x2'));var rs=require(_0x1f15('0x3'));var fs=require('fs');var Redis=require(_0x1f15('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f15('0x5'));var logger=require(_0x1f15('0x6'))(_0x1f15('0x7'));var config=require(_0x1f15('0x8'));var jayson=require(_0x1f15('0x9'));var client=jayson[_0x1f15('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2615ef,_0x5d57c2,_0x2ebef3){return new BPromise(function(_0x1b34bf,_0x2aaef0){return client[_0x1f15('0xb')](_0x2615ef,_0x2ebef3)[_0x1f15('0xc')](function(_0x41c289){logger[_0x1f15('0xd')](_0x1f15('0xe'),_0x5d57c2,_0x1f15('0xf'));logger[_0x1f15('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5d57c2,_0x1f15('0xf'),JSON['stringify'](_0x41c289));if(_0x41c289[_0x1f15('0x11')]){if(_0x41c289['error'][_0x1f15('0x12')]===0x1f4){logger[_0x1f15('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x5d57c2,_0x41c289[_0x1f15('0x11')][_0x1f15('0x13')]);return _0x2aaef0(_0x41c289[_0x1f15('0x11')][_0x1f15('0x13')]);}logger[_0x1f15('0x11')](_0x1f15('0xe'),_0x5d57c2,_0x41c289[_0x1f15('0x11')][_0x1f15('0x13')]);return _0x1b34bf(_0x41c289[_0x1f15('0x11')]['message']);}else{logger[_0x1f15('0xd')](_0x1f15('0xe'),_0x5d57c2,_0x1f15('0xf'));_0x1b34bf(_0x41c289['result']['message']);}})[_0x1f15('0x14')](function(_0x30929b){logger[_0x1f15('0x11')](_0x1f15('0xe'),_0x5d57c2,_0x30929b);_0x2aaef0(_0x30929b);});});}exports[_0x1f15('0x15')]=function(_0x229df0){var _0x4d922f=this;return new Promise(function(_0x3e87a0,_0xd9f801){return db[_0x1f15('0x16')][_0x1f15('0x17')]({'raw':_0x229df0['options']?_0x229df0[_0x1f15('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x229df0[_0x1f15('0x18')]?_0x229df0['options'][_0x1f15('0x19')]||null:null,'attributes':_0x229df0[_0x1f15('0x18')]?_0x229df0[_0x1f15('0x18')][_0x1f15('0x1a')]||null:null,'limit':_0x229df0[_0x1f15('0x18')]?_0x229df0[_0x1f15('0x18')][_0x1f15('0x1b')]||null:null,'include':_0x229df0[_0x1f15('0x18')]?_0x229df0[_0x1f15('0x18')][_0x1f15('0x1c')]?_[_0x1f15('0x1d')](_0x229df0[_0x1f15('0x18')][_0x1f15('0x1c')],function(_0x3f8ae7){return{'model':db[_0x3f8ae7['model']],'as':_0x3f8ae7['as'],'attributes':_0x3f8ae7[_0x1f15('0x1a')],'include':_0x3f8ae7[_0x1f15('0x1c')]?_[_0x1f15('0x1d')](_0x3f8ae7['include'],function(_0x193331){return{'model':db[_0x193331[_0x1f15('0x1e')]],'as':_0x193331['as'],'attributes':_0x193331[_0x1f15('0x1a')],'include':_0x193331[_0x1f15('0x1c')]?_['map'](_0x193331[_0x1f15('0x1c')],function(_0x2c9aa6){return{'model':db[_0x2c9aa6['model']],'as':_0x2c9aa6['as'],'attributes':_0x2c9aa6[_0x1f15('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50c553){logger[_0x1f15('0xd')](_0x1f15('0x15'),_0x229df0);logger['debug'](_0x1f15('0x15'),_0x229df0,JSON['stringify'](_0x50c553));_0x3e87a0(_0x50c553);})[_0x1f15('0x14')](function(_0x298e48){logger[_0x1f15('0x11')](_0x1f15('0x15'),_0x298e48['message'],_0x229df0);_0xd9f801(_0x4d922f[_0x1f15('0x11')](0x1f4,_0x298e48[_0x1f15('0x13')]));});});};exports[_0x1f15('0x1f')]=function(_0x2f45ef){var _0x3f7927=this;return new Promise(function(_0x41e388,_0x337cf8){return db[_0x1f15('0x16')][_0x1f15('0x20')]({'raw':_0x2f45ef[_0x1f15('0x18')]?_0x2f45ef[_0x1f15('0x18')][_0x1f15('0x21')]===undefined?!![]:![]:!![],'where':_0x2f45ef[_0x1f15('0x18')]?_0x2f45ef[_0x1f15('0x18')][_0x1f15('0x19')]||null:null,'attributes':_0x2f45ef[_0x1f15('0x18')]?_0x2f45ef['options']['attributes']||null:null,'include':_0x2f45ef[_0x1f15('0x18')]?_0x2f45ef['options'][_0x1f15('0x1c')]?_[_0x1f15('0x1d')](_0x2f45ef[_0x1f15('0x18')]['include'],function(_0x3ac934){return{'model':db[_0x3ac934[_0x1f15('0x1e')]],'as':_0x3ac934['as'],'attributes':_0x3ac934[_0x1f15('0x1a')],'include':_0x3ac934[_0x1f15('0x1c')]?_[_0x1f15('0x1d')](_0x3ac934['include'],function(_0x1d6440){return{'model':db[_0x1d6440[_0x1f15('0x1e')]],'as':_0x1d6440['as'],'attributes':_0x1d6440[_0x1f15('0x1a')],'include':_0x1d6440[_0x1f15('0x1c')]?_[_0x1f15('0x1d')](_0x1d6440[_0x1f15('0x1c')],function(_0x1be722){return{'model':db[_0x1be722['model']],'as':_0x1be722['as'],'attributes':_0x1be722[_0x1f15('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1f15('0xc')](function(_0x5b85e2){logger[_0x1f15('0xd')](_0x1f15('0x1f'),_0x2f45ef);logger[_0x1f15('0x10')](_0x1f15('0x1f'),_0x2f45ef,JSON['stringify'](_0x5b85e2));_0x41e388(_0x5b85e2);})[_0x1f15('0x14')](function(_0x41c06d){logger[_0x1f15('0x11')](_0x1f15('0x1f'),_0x41c06d[_0x1f15('0x13')],_0x2f45ef);_0x337cf8(_0x3f7927[_0x1f15('0x11')](0x1f4,_0x41c06d[_0x1f15('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 39e1d2d..b5b8a52 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 _0x9d01=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x9d01,0x1d3));var _0x19d0=function(_0x119474,_0x28b89a){_0x119474=_0x119474-0x0;var _0x4970db=_0x9d01[_0x119474];return _0x4970db;};'use strict';var multer=require('multer');var util=require(_0x19d0('0x0'));var path=require(_0x19d0('0x1'));var timeout=require(_0x19d0('0x2'));var express=require(_0x19d0('0x3'));var router=express['Router']();var fs_extra=require(_0x19d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x19d0('0x5'));var config=require(_0x19d0('0x6'));var controller=require(_0x19d0('0x7'));router['get']('/',auth[_0x19d0('0x8')](),controller[_0x19d0('0x9')]);router[_0x19d0('0xa')](_0x19d0('0xb'),auth[_0x19d0('0x8')](),controller[_0x19d0('0xc')]);router[_0x19d0('0xa')](_0x19d0('0xd'),auth[_0x19d0('0x8')](),controller[_0x19d0('0xe')]);router[_0x19d0('0xa')]('/:id/subjects',auth[_0x19d0('0x8')](),controller[_0x19d0('0xf')]);router[_0x19d0('0xa')](_0x19d0('0x10'),auth['isAuthenticated'](),controller[_0x19d0('0x11')]);router['get'](_0x19d0('0x12'),auth[_0x19d0('0x8')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/tags',auth[_0x19d0('0x8')](),controller[_0x19d0('0x13')]);router[_0x19d0('0x14')](_0x19d0('0xb'),auth[_0x19d0('0x8')](),controller[_0x19d0('0x15')]);router[_0x19d0('0x16')](_0x19d0('0xb'),auth[_0x19d0('0x8')](),controller['destroy']);module[_0x19d0('0x17')]=router; \ No newline at end of file +var _0x6ab9=['./intFreshdeskConfiguration.controller','isAuthenticated','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','create','setTags','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1a4084,_0x25e8dd){var _0x4569ee=function(_0x531547){while(--_0x531547){_0x1a4084['push'](_0x1a4084['shift']());}};_0x4569ee(++_0x25e8dd);}(_0x6ab9,0x1ee));var _0x96ab=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x6ab9[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x96ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x96ab('0x1'));var express=require('express');var router=express[_0x96ab('0x2')]();var fs_extra=require(_0x96ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x96ab('0x4'));var config=require(_0x96ab('0x5'));var controller=require(_0x96ab('0x6'));router['get']('/',auth[_0x96ab('0x7')](),controller['index']);router['get'](_0x96ab('0x8'),auth[_0x96ab('0x7')](),controller[_0x96ab('0x9')]);router[_0x96ab('0xa')](_0x96ab('0xb'),auth[_0x96ab('0x7')](),controller[_0x96ab('0xc')]);router['get'](_0x96ab('0xd'),auth[_0x96ab('0x7')](),controller[_0x96ab('0xe')]);router[_0x96ab('0xa')](_0x96ab('0xf'),auth[_0x96ab('0x7')](),controller['getDescriptions']);router[_0x96ab('0xa')](_0x96ab('0x10'),auth[_0x96ab('0x7')](),controller[_0x96ab('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x96ab('0x12')]);router['post'](_0x96ab('0x10'),auth[_0x96ab('0x7')](),controller[_0x96ab('0x13')]);router[_0x96ab('0x14')](_0x96ab('0x8'),auth['isAuthenticated'](),controller[_0x96ab('0x15')]);router[_0x96ab('0x16')](_0x96ab('0x8'),auth['isAuthenticated'](),controller[_0x96ab('0x17')]);module[_0x96ab('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8a0e9e9..214a50d 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 _0x5147=['STRING','sequelize'];(function(_0x37dcb5,_0x49d0ad){var _0x3c83ae=function(_0x57dcf3){while(--_0x57dcf3){_0x37dcb5['push'](_0x37dcb5['shift']());}};_0x3c83ae(++_0x49d0ad);}(_0x5147,0x16d));var _0x7514=function(_0x3df6d3,_0x592bc5){_0x3df6d3=_0x3df6d3-0x0;var _0x1e3b78=_0x5147[_0x3df6d3];return _0x1e3b78;};'use strict';var Sequelize=require(_0x7514('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7514('0x1')]}}; \ No newline at end of file +var _0xc685=['sequelize','exports','STRING'];(function(_0x57e63e,_0x14eaf4){var _0x5674c=function(_0x4ac42e){while(--_0x4ac42e){_0x57e63e['push'](_0x57e63e['shift']());}};_0x5674c(++_0x14eaf4);}(_0xc685,0x1bf));var _0x5c68=function(_0x2ed48a,_0x966f52){_0x2ed48a=_0x2ed48a-0x0;var _0xb85ae7=_0xc685[_0x2ed48a];return _0xb85ae7;};'use strict';var Sequelize=require(_0x5c68('0x0'));module[_0x5c68('0x1')]={'name':{'type':Sequelize[_0x5c68('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 200b52c..7eab6dd 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 _0x385c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','FreshdeskConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','options','rows','params','fields','includeAll','include','find','catch','create','body','findOne','FreshdeskField','rawAttributes','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x385c,0x1e2));var _0xc385=function(_0x1331aa,_0x1da8fd){_0x1331aa=_0x1331aa-0x0;var _0x2c441b=_0x385c[_0x1331aa];return _0x2c441b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc385('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc385('0x1'));var rp=require(_0xc385('0x2'));var moment=require(_0xc385('0x3'));var BPromise=require(_0xc385('0x4'));var Mustache=require(_0xc385('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc385('0x6'));var csv=require(_0xc385('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc385('0x8'));var _=require(_0xc385('0x9'));var squel=require(_0xc385('0xa'));var crypto=require(_0xc385('0xb'));var jsforce=require(_0xc385('0xc'));var deskjs=require(_0xc385('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc385('0xe'));var Redis=require(_0xc385('0xf'));var authService=require(_0xc385('0x10'));var qs=require(_0xc385('0x11'));var as=require(_0xc385('0x12'));var hardwareService=require(_0xc385('0x13'));var logger=require('../../config/logger')(_0xc385('0x14'));var utils=require(_0xc385('0x15'));var config=require(_0xc385('0x16'));var licenseUtil=require(_0xc385('0x17'));var db=require(_0xc385('0x18'))['db'];function respondWithStatusCode(_0x49bb3f,_0x528409){_0x528409=_0x528409||0xcc;return function(_0x307367){if(_0x307367){return _0x49bb3f['sendStatus'](_0x528409);}return _0x49bb3f[_0xc385('0x19')](_0x528409)[_0xc385('0x1a')]();};}function respondWithResult(_0x3d34ac,_0x489ef2){_0x489ef2=_0x489ef2||0xc8;return function(_0x1cd604){if(_0x1cd604){return _0x3d34ac[_0xc385('0x19')](_0x489ef2)[_0xc385('0x1b')](_0x1cd604);}};}function respondWithFilteredResult(_0x5d0936,_0x385628){return function(_0x4a9c60){if(_0x4a9c60){var _0x1136e=typeof _0x385628[_0xc385('0x1c')]==='undefined'&&typeof _0x385628[_0xc385('0x1d')]===_0xc385('0x1e');var _0x9cac77=_0x4a9c60[_0xc385('0x1f')];var _0x47bc1e=_0x1136e?0x0:_0x385628[_0xc385('0x1c')];var _0x533530=_0x1136e?_0x4a9c60[_0xc385('0x1f')]:_0x385628[_0xc385('0x1c')]+_0x385628[_0xc385('0x1d')];var _0x6aeff9;if(_0x533530>=_0x9cac77){_0x533530=_0x9cac77;_0x6aeff9=0xc8;}else{_0x6aeff9=0xce;}_0x5d0936[_0xc385('0x19')](_0x6aeff9);return _0x5d0936[_0xc385('0x20')](_0xc385('0x21'),_0x47bc1e+'-'+_0x533530+'/'+_0x9cac77)[_0xc385('0x1b')](_0x4a9c60);}return null;};}function patchUpdates(_0x173b5c){return function(_0x1fb0ef){try{jsonpatch['apply'](_0x1fb0ef,_0x173b5c,!![]);}catch(_0x2d4469){return BPromise[_0xc385('0x22')](_0x2d4469);}return _0x1fb0ef[_0xc385('0x23')]();};}function saveUpdates(_0x48533c,_0x567fc1){return function(_0x317ed7){if(_0x317ed7){return _0x317ed7['update'](_0x48533c)[_0xc385('0x24')](function(_0x22c052){return _0x22c052;});}return null;};}function removeEntity(_0x2ab7b5,_0x29bd58){return function(_0x1a3297){if(_0x1a3297){return _0x1a3297[_0xc385('0x25')]()[_0xc385('0x24')](function(){_0x2ab7b5['status'](0xcc)[_0xc385('0x1a')]();});}};}function handleEntityNotFound(_0x4a9202,_0x2fca2c){return function(_0x103287){if(!_0x103287){_0x4a9202[_0xc385('0x26')](0x194);}return _0x103287;};}function handleError(_0x143b88,_0x1c2cad){_0x1c2cad=_0x1c2cad||0x1f4;return function(_0x2bfb6b){logger[_0xc385('0x27')](_0x2bfb6b[_0xc385('0x28')]);if(_0x2bfb6b[_0xc385('0x29')]){delete _0x2bfb6b['name'];}_0x143b88['status'](_0x1c2cad)[_0xc385('0x2a')](_0x2bfb6b);};}exports['index']=function(_0x51127e,_0x432d8b){var _0x46b688={},_0x223d7={},_0x330d8a={'count':0x0,'rows':[]};var _0x519111=_['map'](db[_0xc385('0x2b')]['rawAttributes'],function(_0x25c5f3){return{'name':_0x25c5f3[_0xc385('0x2c')],'type':_0x25c5f3[_0xc385('0x2d')][_0xc385('0x2e')]};});_0x223d7[_0xc385('0x2f')]=_[_0xc385('0x30')](_0x519111,'name');_0x223d7[_0xc385('0x31')]=_[_0xc385('0x32')](_0x51127e[_0xc385('0x31')]);_0x223d7[_0xc385('0x33')]=_[_0xc385('0x34')](_0x223d7[_0xc385('0x2f')],_0x223d7[_0xc385('0x31')]);_0x46b688[_0xc385('0x35')]=_[_0xc385('0x34')](_0x223d7[_0xc385('0x2f')],qs['fields'](_0x51127e[_0xc385('0x31')]['fields']));_0x46b688[_0xc385('0x35')]=_0x46b688[_0xc385('0x35')][_0xc385('0x36')]?_0x46b688[_0xc385('0x35')]:_0x223d7[_0xc385('0x2f')];if(!_0x51127e[_0xc385('0x31')]['hasOwnProperty']('nolimit')){_0x46b688[_0xc385('0x1d')]=qs['limit'](_0x51127e['query']['limit']);_0x46b688['offset']=qs[_0xc385('0x1c')](_0x51127e['query']['offset']);}_0x46b688[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x51127e[_0xc385('0x31')][_0xc385('0x38')]);_0x46b688[_0xc385('0x39')]=qs[_0xc385('0x33')](_[_0xc385('0x3a')](_0x51127e[_0xc385('0x31')],_0x223d7['filters']),_0x519111);if(_0x51127e['query'][_0xc385('0x3b')]){_0x46b688[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x46b688[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x519111,function(_0x123627){if(_0x123627[_0xc385('0x2d')]!=='VIRTUAL'){var _0x198d73={};_0x198d73[_0x123627[_0xc385('0x29')]]={'$like':'%'+_0x51127e[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x198d73;}})});}_0x46b688=_[_0xc385('0x3c')]({},_0x46b688,_0x51127e[_0xc385('0x3d')]);var _0x42fc87={'where':_0x46b688[_0xc385('0x39')]};return db[_0xc385('0x2b')]['count'](_0x42fc87)[_0xc385('0x24')](function(_0x44f23f){_0x330d8a[_0xc385('0x1f')]=_0x44f23f;if(_0x51127e[_0xc385('0x31')]['includeAll']){_0x46b688['include']=[{'all':!![]}];}return db[_0xc385('0x2b')]['findAll'](_0x46b688);})[_0xc385('0x24')](function(_0x46eb4d){_0x330d8a[_0xc385('0x3e')]=_0x46eb4d;return _0x330d8a;})[_0xc385('0x24')](respondWithFilteredResult(_0x432d8b,_0x46b688))['catch'](handleError(_0x432d8b,null));};exports['show']=function(_0x4d69ee,_0x3146b2){var _0x3da23a={'raw':![],'where':{'id':_0x4d69ee[_0xc385('0x3f')]['id']}},_0x2e7dcf={};_0x2e7dcf['model']=_[_0xc385('0x32')](db[_0xc385('0x2b')]['rawAttributes']);_0x2e7dcf[_0xc385('0x31')]=_[_0xc385('0x32')](_0x4d69ee[_0xc385('0x31')]);_0x2e7dcf['filters']=_[_0xc385('0x34')](_0x2e7dcf[_0xc385('0x2f')],_0x2e7dcf['query']);_0x3da23a['attributes']=_[_0xc385('0x34')](_0x2e7dcf[_0xc385('0x2f')],qs['fields'](_0x4d69ee[_0xc385('0x31')][_0xc385('0x40')]));_0x3da23a[_0xc385('0x35')]=_0x3da23a[_0xc385('0x35')]['length']?_0x3da23a[_0xc385('0x35')]:_0x2e7dcf['model'];if(_0x4d69ee['query'][_0xc385('0x41')]){_0x3da23a[_0xc385('0x42')]=[{'all':!![]}];}_0x3da23a=_['merge']({},_0x3da23a,_0x4d69ee[_0xc385('0x3d')]);return db[_0xc385('0x2b')][_0xc385('0x43')](_0x3da23a)[_0xc385('0x24')](handleEntityNotFound(_0x3146b2,null))[_0xc385('0x24')](respondWithResult(_0x3146b2,null))[_0xc385('0x44')](handleError(_0x3146b2,null));};exports[_0xc385('0x45')]=function(_0x25c413,_0x1f797e){return db[_0xc385('0x2b')]['create'](_0x25c413[_0xc385('0x46')],{})[_0xc385('0x24')](respondWithResult(_0x1f797e,0xc9))[_0xc385('0x44')](handleError(_0x1f797e,null));};exports['update']=function(_0x4d32f7,_0x99bc){if(_0x4d32f7[_0xc385('0x46')]['id']){delete _0x4d32f7[_0xc385('0x46')]['id'];}return db[_0xc385('0x2b')][_0xc385('0x43')]({'where':{'id':_0x4d32f7[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x99bc,null))[_0xc385('0x24')](saveUpdates(_0x4d32f7[_0xc385('0x46')],null))[_0xc385('0x24')](respondWithResult(_0x99bc,null))[_0xc385('0x44')](handleError(_0x99bc,null));};exports[_0xc385('0x25')]=function(_0xbdb5b0,_0xcd58d8){return db[_0xc385('0x2b')][_0xc385('0x43')]({'where':{'id':_0xbdb5b0[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0xcd58d8,null))['then'](removeEntity(_0xcd58d8,null))[_0xc385('0x44')](handleError(_0xcd58d8,null));};exports['getFields']=function(_0x148087,_0x5802f9,_0x17d6d2){var _0xfd833f={};var _0x1fcd9e={};var _0x57c23f;var _0x6aa749;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x148087[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x5802f9,null))[_0xc385('0x24')](function(_0x189c1d){if(_0x189c1d){_0x57c23f=_0x189c1d;_0x1fcd9e['model']=_[_0xc385('0x32')](db[_0xc385('0x48')][_0xc385('0x49')]);_0x1fcd9e[_0xc385('0x31')]=_[_0xc385('0x32')](_0x148087[_0xc385('0x31')]);_0x1fcd9e[_0xc385('0x33')]=_['intersection'](_0x1fcd9e['model'],_0x1fcd9e['query']);_0xfd833f[_0xc385('0x35')]=_['intersection'](_0x1fcd9e[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x148087['query']['fields']));_0xfd833f[_0xc385('0x35')]=_0xfd833f[_0xc385('0x35')][_0xc385('0x36')]?_0xfd833f['attributes']:_0x1fcd9e['model'];_0xfd833f[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x148087[_0xc385('0x31')]['sort']);_0xfd833f[_0xc385('0x39')]=qs[_0xc385('0x33')](_[_0xc385('0x3a')](_0x148087[_0xc385('0x31')],_0x1fcd9e[_0xc385('0x33')]));if(_0x148087[_0xc385('0x31')][_0xc385('0x3b')]){_0xfd833f['where']=_[_0xc385('0x3c')](_0xfd833f[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0xfd833f[_0xc385('0x35')],function(_0x4d8520){var _0x2fbbf0={};_0x2fbbf0[_0x4d8520]={'$like':'%'+_0x148087[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x2fbbf0;})});}_0xfd833f=_[_0xc385('0x3c')]({},_0xfd833f,_0x148087[_0xc385('0x3d')]);return _0x57c23f[_0xc385('0x4a')](_0xfd833f);}})[_0xc385('0x24')](function(_0x4595f0){if(_0x4595f0){_0x6aa749=_0x4595f0['length'];if(!_0x148087[_0xc385('0x31')][_0xc385('0x4b')](_0xc385('0x4c'))){_0xfd833f[_0xc385('0x1d')]=qs[_0xc385('0x1d')](_0x148087['query']['limit']);_0xfd833f[_0xc385('0x1c')]=qs['offset'](_0x148087[_0xc385('0x31')][_0xc385('0x1c')]);}return _0x57c23f[_0xc385('0x4a')](_0xfd833f);}})[_0xc385('0x24')](function(_0x214635){if(_0x214635){return _0x214635?{'count':_0x6aa749,'rows':_0x214635}:null;}})['then'](respondWithResult(_0x5802f9,null))[_0xc385('0x44')](handleError(_0x5802f9,null));};exports[_0xc385('0x4d')]=function(_0x4ca349,_0xfc0e97,_0x20f6fc){var _0x38801c={};var _0x53dcd7={};var _0x5117ec;var _0x3b93e1;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x4ca349[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0xfc0e97,null))['then'](function(_0x59438c){if(_0x59438c){_0x5117ec=_0x59438c;_0x53dcd7[_0xc385('0x2f')]=_[_0xc385('0x32')](db[_0xc385('0x48')][_0xc385('0x49')]);_0x53dcd7['query']=_['keys'](_0x4ca349[_0xc385('0x31')]);_0x53dcd7[_0xc385('0x33')]=_[_0xc385('0x34')](_0x53dcd7[_0xc385('0x2f')],_0x53dcd7[_0xc385('0x31')]);_0x38801c[_0xc385('0x35')]=_['intersection'](_0x53dcd7[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x4ca349[_0xc385('0x31')][_0xc385('0x40')]));_0x38801c[_0xc385('0x35')]=_0x38801c[_0xc385('0x35')]['length']?_0x38801c[_0xc385('0x35')]:_0x53dcd7['model'];_0x38801c[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x4ca349[_0xc385('0x31')][_0xc385('0x38')]);_0x38801c[_0xc385('0x39')]=qs['filters'](_[_0xc385('0x3a')](_0x4ca349['query'],_0x53dcd7[_0xc385('0x33')]));if(_0x4ca349[_0xc385('0x31')][_0xc385('0x3b')]){_0x38801c[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x38801c[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x38801c['attributes'],function(_0x38b7af){var _0x1da7c9={};_0x1da7c9[_0x38b7af]={'$like':'%'+_0x4ca349[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x1da7c9;})});}_0x38801c=_[_0xc385('0x3c')]({},_0x38801c,_0x4ca349[_0xc385('0x3d')]);return _0x5117ec['getSubjects'](_0x38801c);}})[_0xc385('0x24')](function(_0x24cc12){if(_0x24cc12){_0x3b93e1=_0x24cc12[_0xc385('0x36')];if(!_0x4ca349[_0xc385('0x31')]['hasOwnProperty'](_0xc385('0x4c'))){_0x38801c[_0xc385('0x1d')]=qs[_0xc385('0x1d')](_0x4ca349[_0xc385('0x31')][_0xc385('0x1d')]);_0x38801c[_0xc385('0x1c')]=qs[_0xc385('0x1c')](_0x4ca349[_0xc385('0x31')][_0xc385('0x1c')]);}return _0x5117ec[_0xc385('0x4d')](_0x38801c);}})['then'](function(_0xa4ea67){if(_0xa4ea67){return _0xa4ea67?{'count':_0x3b93e1,'rows':_0xa4ea67}:null;}})[_0xc385('0x24')](respondWithResult(_0xfc0e97,null))[_0xc385('0x44')](handleError(_0xfc0e97,null));};exports[_0xc385('0x4e')]=function(_0x24e186,_0x5e535f,_0x564d3c){var _0x32ea14={};var _0x3aafe9={};var _0x1d0c95;var _0x328dd9;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x24e186[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x5e535f,null))[_0xc385('0x24')](function(_0xfa205b){if(_0xfa205b){_0x1d0c95=_0xfa205b;_0x3aafe9[_0xc385('0x2f')]=_[_0xc385('0x32')](db[_0xc385('0x48')][_0xc385('0x49')]);_0x3aafe9['query']=_[_0xc385('0x32')](_0x24e186[_0xc385('0x31')]);_0x3aafe9['filters']=_[_0xc385('0x34')](_0x3aafe9[_0xc385('0x2f')],_0x3aafe9[_0xc385('0x31')]);_0x32ea14[_0xc385('0x35')]=_[_0xc385('0x34')](_0x3aafe9[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x24e186[_0xc385('0x31')][_0xc385('0x40')]));_0x32ea14[_0xc385('0x35')]=_0x32ea14[_0xc385('0x35')][_0xc385('0x36')]?_0x32ea14['attributes']:_0x3aafe9[_0xc385('0x2f')];_0x32ea14[_0xc385('0x37')]=qs['sort'](_0x24e186[_0xc385('0x31')][_0xc385('0x38')]);_0x32ea14[_0xc385('0x39')]=qs[_0xc385('0x33')](_[_0xc385('0x3a')](_0x24e186['query'],_0x3aafe9['filters']));if(_0x24e186['query'][_0xc385('0x3b')]){_0x32ea14[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x32ea14[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x32ea14['attributes'],function(_0x44aaaa){var _0x64cbd={};_0x64cbd[_0x44aaaa]={'$like':'%'+_0x24e186[_0xc385('0x31')]['filter']+'%'};return _0x64cbd;})});}_0x32ea14=_['merge']({},_0x32ea14,_0x24e186[_0xc385('0x3d')]);return _0x1d0c95[_0xc385('0x4e')](_0x32ea14);}})[_0xc385('0x24')](function(_0x494e2e){if(_0x494e2e){_0x328dd9=_0x494e2e[_0xc385('0x36')];if(!_0x24e186[_0xc385('0x31')][_0xc385('0x4b')](_0xc385('0x4c'))){_0x32ea14[_0xc385('0x1d')]=qs['limit'](_0x24e186['query'][_0xc385('0x1d')]);_0x32ea14['offset']=qs[_0xc385('0x1c')](_0x24e186[_0xc385('0x31')]['offset']);}return _0x1d0c95[_0xc385('0x4e')](_0x32ea14);}})[_0xc385('0x24')](function(_0x57cdd2){if(_0x57cdd2){return _0x57cdd2?{'count':_0x328dd9,'rows':_0x57cdd2}:null;}})[_0xc385('0x24')](respondWithResult(_0x5e535f,null))[_0xc385('0x44')](handleError(_0x5e535f,null));};exports[_0xc385('0x4f')]=function(_0x112bd7,_0x145757,_0x4e0dae){var _0x1f5bdb={};var _0x2ca091={};var _0x249518;var _0x2d8be3;return db[_0xc385('0x2b')][_0xc385('0x47')]({'where':{'id':_0x112bd7[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x145757,null))[_0xc385('0x24')](function(_0x55f90f){if(_0x55f90f){_0x249518=_0x55f90f;_0x2ca091['model']=_[_0xc385('0x32')](db[_0xc385('0x50')][_0xc385('0x49')]);_0x2ca091[_0xc385('0x31')]=_['keys'](_0x112bd7[_0xc385('0x31')]);_0x2ca091[_0xc385('0x33')]=_[_0xc385('0x34')](_0x2ca091[_0xc385('0x2f')],_0x2ca091[_0xc385('0x31')]);_0x1f5bdb[_0xc385('0x35')]=_[_0xc385('0x34')](_0x2ca091[_0xc385('0x2f')],qs[_0xc385('0x40')](_0x112bd7['query'][_0xc385('0x40')]));_0x1f5bdb['attributes']=_0x1f5bdb[_0xc385('0x35')]['length']?_0x1f5bdb[_0xc385('0x35')]:_0x2ca091[_0xc385('0x2f')];_0x1f5bdb[_0xc385('0x37')]=qs[_0xc385('0x38')](_0x112bd7[_0xc385('0x31')]['sort']);_0x1f5bdb[_0xc385('0x39')]=qs[_0xc385('0x33')](_['pick'](_0x112bd7[_0xc385('0x31')],_0x2ca091['filters']));if(_0x112bd7['query'][_0xc385('0x3b')]){_0x1f5bdb[_0xc385('0x39')]=_[_0xc385('0x3c')](_0x1f5bdb[_0xc385('0x39')],{'$or':_[_0xc385('0x30')](_0x1f5bdb[_0xc385('0x35')],function(_0x1ae322){var _0x4d02f1={};_0x4d02f1[_0x1ae322]={'$like':'%'+_0x112bd7[_0xc385('0x31')][_0xc385('0x3b')]+'%'};return _0x4d02f1;})});}_0x1f5bdb=_[_0xc385('0x3c')]({},_0x1f5bdb,_0x112bd7[_0xc385('0x3d')]);return _0x249518[_0xc385('0x4f')](_0x1f5bdb);}})[_0xc385('0x24')](function(_0x4b6a20){if(_0x4b6a20){_0x2d8be3=_0x4b6a20[_0xc385('0x36')];if(!_0x112bd7[_0xc385('0x31')]['hasOwnProperty']('nolimit')){_0x1f5bdb['limit']=qs[_0xc385('0x1d')](_0x112bd7['query']['limit']);_0x1f5bdb[_0xc385('0x1c')]=qs[_0xc385('0x1c')](_0x112bd7[_0xc385('0x31')]['offset']);}return _0x249518[_0xc385('0x4f')](_0x1f5bdb);}})[_0xc385('0x24')](function(_0x674196){if(_0x674196){return _0x674196?{'count':_0x2d8be3,'rows':_0x674196}:null;}})[_0xc385('0x24')](respondWithResult(_0x145757,null))[_0xc385('0x44')](handleError(_0x145757,null));};exports[_0xc385('0x51')]=function(_0x3da669,_0x2ae95e,_0x17cb90){if(_0x3da669[_0xc385('0x46')]['id']){delete _0x3da669[_0xc385('0x46')]['id'];}return db[_0xc385('0x2b')]['findOne']({'where':{'id':_0x3da669[_0xc385('0x3f')]['id']}})[_0xc385('0x24')](handleEntityNotFound(_0x2ae95e,null))[_0xc385('0x24')](function(_0x29715f){if(_0x29715f){return _0x29715f[_0xc385('0x51')](_0x3da669[_0xc385('0x46')][_0xc385('0x52')]||[]);}return null;})[_0xc385('0x24')](respondWithResult(_0x2ae95e,null))[_0xc385('0x44')](handleError(_0x2ae95e,null));}; \ No newline at end of file +var _0x5e61=['show','keys','include','options','find','create','update','params','body','destroy','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','end','error','stack','name','send','index','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','FreshdeskConfiguration','then','includeAll','findAll','rows','catch'];(function(_0x15a833,_0x5092d6){var _0x371593=function(_0x53b66b){while(--_0x53b66b){_0x15a833['push'](_0x15a833['shift']());}};_0x371593(++_0x5092d6);}(_0x5e61,0x1c1));var _0x15e6=function(_0x2d6610,_0xa884c1){_0x2d6610=_0x2d6610-0x0;var _0x5e65dd=_0x5e61[_0x2d6610];return _0x5e65dd;};'use strict';var emlformat=require(_0x15e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15e6('0x1'));var jsonpatch=require(_0x15e6('0x2'));var rp=require(_0x15e6('0x3'));var moment=require('moment');var BPromise=require(_0x15e6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x15e6('0x5'));var sox=require(_0x15e6('0x6'));var csv=require('to-csv');var ejs=require(_0x15e6('0x7'));var fs=require('fs');var fs_extra=require(_0x15e6('0x8'));var _=require(_0x15e6('0x9'));var squel=require(_0x15e6('0xa'));var crypto=require(_0x15e6('0xb'));var jsforce=require(_0x15e6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x15e6('0xd'));var querystring=require('querystring');var Papa=require(_0x15e6('0xe'));var Redis=require(_0x15e6('0xf'));var authService=require(_0x15e6('0x10'));var qs=require(_0x15e6('0x11'));var as=require(_0x15e6('0x12'));var hardwareService=require(_0x15e6('0x13'));var logger=require(_0x15e6('0x14'))(_0x15e6('0x15'));var utils=require(_0x15e6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x15e6('0x17'));var db=require(_0x15e6('0x18'))['db'];function respondWithStatusCode(_0x5a1dab,_0x3ca2e6){_0x3ca2e6=_0x3ca2e6||0xcc;return function(_0x21c45c){if(_0x21c45c){return _0x5a1dab[_0x15e6('0x19')](_0x3ca2e6);}return _0x5a1dab[_0x15e6('0x1a')](_0x3ca2e6)['end']();};}function respondWithResult(_0x2c1459,_0x293f13){_0x293f13=_0x293f13||0xc8;return function(_0x3a1112){if(_0x3a1112){return _0x2c1459[_0x15e6('0x1a')](_0x293f13)['json'](_0x3a1112);}};}function respondWithFilteredResult(_0x5ee5b8,_0x5ae6c2){return function(_0x5aa891){if(_0x5aa891){var _0x3b304a=typeof _0x5ae6c2[_0x15e6('0x1b')]==='undefined'&&typeof _0x5ae6c2[_0x15e6('0x1c')]==='undefined';var _0x517dbf=_0x5aa891['count'];var _0x688bf=_0x3b304a?0x0:_0x5ae6c2[_0x15e6('0x1b')];var _0x5d17ac=_0x3b304a?_0x5aa891[_0x15e6('0x1d')]:_0x5ae6c2['offset']+_0x5ae6c2[_0x15e6('0x1c')];var _0x1cc9c2;if(_0x5d17ac>=_0x517dbf){_0x5d17ac=_0x517dbf;_0x1cc9c2=0xc8;}else{_0x1cc9c2=0xce;}_0x5ee5b8[_0x15e6('0x1a')](_0x1cc9c2);return _0x5ee5b8[_0x15e6('0x1e')](_0x15e6('0x1f'),_0x688bf+'-'+_0x5d17ac+'/'+_0x517dbf)[_0x15e6('0x20')](_0x5aa891);}return null;};}function patchUpdates(_0x1613d4){return function(_0x2e919a){try{jsonpatch[_0x15e6('0x21')](_0x2e919a,_0x1613d4,!![]);}catch(_0x38057f){return BPromise[_0x15e6('0x22')](_0x38057f);}return _0x2e919a['save']();};}function saveUpdates(_0x293e8d,_0x47a682){return function(_0x3336b4){if(_0x3336b4){return _0x3336b4['update'](_0x293e8d)['then'](function(_0x4645e9){return _0x4645e9;});}return null;};}function removeEntity(_0x39942c,_0xb91732){return function(_0x13ca15){if(_0x13ca15){return _0x13ca15['destroy']()['then'](function(){_0x39942c[_0x15e6('0x1a')](0xcc)[_0x15e6('0x23')]();});}};}function handleEntityNotFound(_0x5cba21,_0x2269d5){return function(_0x328eab){if(!_0x328eab){_0x5cba21[_0x15e6('0x19')](0x194);}return _0x328eab;};}function handleError(_0xbefe78,_0x495e4f){_0x495e4f=_0x495e4f||0x1f4;return function(_0x4f4e4){logger[_0x15e6('0x24')](_0x4f4e4[_0x15e6('0x25')]);if(_0x4f4e4[_0x15e6('0x26')]){delete _0x4f4e4[_0x15e6('0x26')];}_0xbefe78[_0x15e6('0x1a')](_0x495e4f)[_0x15e6('0x27')](_0x4f4e4);};}exports[_0x15e6('0x28')]=function(_0x35ed52,_0x1577e6){var _0x2fb5ee={},_0x14bd6c={},_0x578d5a={'count':0x0,'rows':[]};var _0x57d97f=_['map'](db['FreshdeskConfiguration'][_0x15e6('0x29')],function(_0x1f872f){return{'name':_0x1f872f['fieldName'],'type':_0x1f872f['type'][_0x15e6('0x2a')]};});_0x14bd6c[_0x15e6('0x2b')]=_[_0x15e6('0x2c')](_0x57d97f,_0x15e6('0x26'));_0x14bd6c['query']=_['keys'](_0x35ed52[_0x15e6('0x2d')]);_0x14bd6c[_0x15e6('0x2e')]=_[_0x15e6('0x2f')](_0x14bd6c['model'],_0x14bd6c[_0x15e6('0x2d')]);_0x2fb5ee[_0x15e6('0x30')]=_[_0x15e6('0x2f')](_0x14bd6c['model'],qs['fields'](_0x35ed52[_0x15e6('0x2d')][_0x15e6('0x31')]));_0x2fb5ee['attributes']=_0x2fb5ee[_0x15e6('0x30')][_0x15e6('0x32')]?_0x2fb5ee['attributes']:_0x14bd6c[_0x15e6('0x2b')];if(!_0x35ed52[_0x15e6('0x2d')][_0x15e6('0x33')](_0x15e6('0x34'))){_0x2fb5ee[_0x15e6('0x1c')]=qs['limit'](_0x35ed52[_0x15e6('0x2d')]['limit']);_0x2fb5ee['offset']=qs['offset'](_0x35ed52['query']['offset']);}_0x2fb5ee[_0x15e6('0x35')]=qs[_0x15e6('0x36')](_0x35ed52['query'][_0x15e6('0x36')]);_0x2fb5ee[_0x15e6('0x37')]=qs[_0x15e6('0x2e')](_[_0x15e6('0x38')](_0x35ed52[_0x15e6('0x2d')],_0x14bd6c['filters']),_0x57d97f);if(_0x35ed52[_0x15e6('0x2d')][_0x15e6('0x39')]){_0x2fb5ee[_0x15e6('0x37')]=_['merge'](_0x2fb5ee[_0x15e6('0x37')],{'$or':_[_0x15e6('0x2c')](_0x57d97f,function(_0x1ddadd){if(_0x1ddadd[_0x15e6('0x3a')]!==_0x15e6('0x3b')){var _0x4d44f0={};_0x4d44f0[_0x1ddadd['name']]={'$like':'%'+_0x35ed52[_0x15e6('0x2d')]['filter']+'%'};return _0x4d44f0;}})});}_0x2fb5ee=_[_0x15e6('0x3c')]({},_0x2fb5ee,_0x35ed52['options']);var _0x1b5441={'where':_0x2fb5ee['where']};return db[_0x15e6('0x3d')][_0x15e6('0x1d')](_0x1b5441)[_0x15e6('0x3e')](function(_0xa07afb){_0x578d5a[_0x15e6('0x1d')]=_0xa07afb;if(_0x35ed52['query'][_0x15e6('0x3f')]){_0x2fb5ee['include']=[{'all':!![]}];}return db[_0x15e6('0x3d')][_0x15e6('0x40')](_0x2fb5ee);})[_0x15e6('0x3e')](function(_0x5df436){_0x578d5a[_0x15e6('0x41')]=_0x5df436;return _0x578d5a;})['then'](respondWithFilteredResult(_0x1577e6,_0x2fb5ee))[_0x15e6('0x42')](handleError(_0x1577e6,null));};exports[_0x15e6('0x43')]=function(_0x40ba94,_0x58dc31){var _0x3ab2fe={'raw':![],'where':{'id':_0x40ba94['params']['id']}},_0x3954dc={};_0x3954dc[_0x15e6('0x2b')]=_[_0x15e6('0x44')](db[_0x15e6('0x3d')][_0x15e6('0x29')]);_0x3954dc[_0x15e6('0x2d')]=_['keys'](_0x40ba94[_0x15e6('0x2d')]);_0x3954dc[_0x15e6('0x2e')]=_[_0x15e6('0x2f')](_0x3954dc[_0x15e6('0x2b')],_0x3954dc['query']);_0x3ab2fe[_0x15e6('0x30')]=_[_0x15e6('0x2f')](_0x3954dc['model'],qs['fields'](_0x40ba94[_0x15e6('0x2d')][_0x15e6('0x31')]));_0x3ab2fe[_0x15e6('0x30')]=_0x3ab2fe[_0x15e6('0x30')][_0x15e6('0x32')]?_0x3ab2fe[_0x15e6('0x30')]:_0x3954dc[_0x15e6('0x2b')];if(_0x40ba94['query'][_0x15e6('0x3f')]){_0x3ab2fe[_0x15e6('0x45')]=[{'all':!![]}];}_0x3ab2fe=_['merge']({},_0x3ab2fe,_0x40ba94[_0x15e6('0x46')]);return db[_0x15e6('0x3d')][_0x15e6('0x47')](_0x3ab2fe)['then'](handleEntityNotFound(_0x58dc31,null))[_0x15e6('0x3e')](respondWithResult(_0x58dc31,null))[_0x15e6('0x42')](handleError(_0x58dc31,null));};exports['create']=function(_0x5c8306,_0x531843){return db['FreshdeskConfiguration'][_0x15e6('0x48')](_0x5c8306['body'],{})['then'](respondWithResult(_0x531843,0xc9))[_0x15e6('0x42')](handleError(_0x531843,null));};exports[_0x15e6('0x49')]=function(_0x229ecf,_0x4c2642){if(_0x229ecf['body']['id']){delete _0x229ecf['body']['id'];}return db[_0x15e6('0x3d')][_0x15e6('0x47')]({'where':{'id':_0x229ecf[_0x15e6('0x4a')]['id']}})[_0x15e6('0x3e')](handleEntityNotFound(_0x4c2642,null))[_0x15e6('0x3e')](saveUpdates(_0x229ecf[_0x15e6('0x4b')],null))[_0x15e6('0x3e')](respondWithResult(_0x4c2642,null))[_0x15e6('0x42')](handleError(_0x4c2642,null));};exports[_0x15e6('0x4c')]=function(_0x1e1527,_0xb71492){return db['FreshdeskConfiguration'][_0x15e6('0x47')]({'where':{'id':_0x1e1527['params']['id']}})[_0x15e6('0x3e')](handleEntityNotFound(_0xb71492,null))[_0x15e6('0x3e')](removeEntity(_0xb71492,null))[_0x15e6('0x42')](handleError(_0xb71492,null));};exports[_0x15e6('0x4d')]=function(_0x567b57,_0x4eb878,_0xa882d9){var _0xfe6773={};var _0x28978c={};var _0x30cb11;var _0x40dd32;return db[_0x15e6('0x3d')][_0x15e6('0x4e')]({'where':{'id':_0x567b57[_0x15e6('0x4a')]['id']}})[_0x15e6('0x3e')](handleEntityNotFound(_0x4eb878,null))[_0x15e6('0x3e')](function(_0x52d36f){if(_0x52d36f){_0x30cb11=_0x52d36f;_0x28978c[_0x15e6('0x2b')]=_[_0x15e6('0x44')](db[_0x15e6('0x4f')]['rawAttributes']);_0x28978c['query']=_[_0x15e6('0x44')](_0x567b57[_0x15e6('0x2d')]);_0x28978c[_0x15e6('0x2e')]=_[_0x15e6('0x2f')](_0x28978c['model'],_0x28978c['query']);_0xfe6773[_0x15e6('0x30')]=_[_0x15e6('0x2f')](_0x28978c['model'],qs[_0x15e6('0x31')](_0x567b57[_0x15e6('0x2d')][_0x15e6('0x31')]));_0xfe6773[_0x15e6('0x30')]=_0xfe6773[_0x15e6('0x30')]['length']?_0xfe6773['attributes']:_0x28978c['model'];_0xfe6773[_0x15e6('0x35')]=qs[_0x15e6('0x36')](_0x567b57[_0x15e6('0x2d')][_0x15e6('0x36')]);_0xfe6773['where']=qs[_0x15e6('0x2e')](_[_0x15e6('0x38')](_0x567b57[_0x15e6('0x2d')],_0x28978c['filters']));if(_0x567b57['query'][_0x15e6('0x39')]){_0xfe6773[_0x15e6('0x37')]=_[_0x15e6('0x3c')](_0xfe6773[_0x15e6('0x37')],{'$or':_[_0x15e6('0x2c')](_0xfe6773['attributes'],function(_0x502e04){var _0x169678={};_0x169678[_0x502e04]={'$like':'%'+_0x567b57[_0x15e6('0x2d')][_0x15e6('0x39')]+'%'};return _0x169678;})});}_0xfe6773=_[_0x15e6('0x3c')]({},_0xfe6773,_0x567b57[_0x15e6('0x46')]);return _0x30cb11[_0x15e6('0x4d')](_0xfe6773);}})['then'](function(_0x374f83){if(_0x374f83){_0x40dd32=_0x374f83['length'];if(!_0x567b57[_0x15e6('0x2d')][_0x15e6('0x33')](_0x15e6('0x34'))){_0xfe6773[_0x15e6('0x1c')]=qs[_0x15e6('0x1c')](_0x567b57[_0x15e6('0x2d')][_0x15e6('0x1c')]);_0xfe6773[_0x15e6('0x1b')]=qs[_0x15e6('0x1b')](_0x567b57[_0x15e6('0x2d')]['offset']);}return _0x30cb11['getFields'](_0xfe6773);}})[_0x15e6('0x3e')](function(_0x9a1128){if(_0x9a1128){return _0x9a1128?{'count':_0x40dd32,'rows':_0x9a1128}:null;}})[_0x15e6('0x3e')](respondWithResult(_0x4eb878,null))[_0x15e6('0x42')](handleError(_0x4eb878,null));};exports[_0x15e6('0x50')]=function(_0x3404c7,_0xa4408,_0x1eee5e){var _0x296fa1={};var _0x1e3c34={};var _0x409ebb;var _0x3d70c1;return db[_0x15e6('0x3d')]['findOne']({'where':{'id':_0x3404c7[_0x15e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa4408,null))[_0x15e6('0x3e')](function(_0xa5a4d9){if(_0xa5a4d9){_0x409ebb=_0xa5a4d9;_0x1e3c34[_0x15e6('0x2b')]=_[_0x15e6('0x44')](db[_0x15e6('0x4f')]['rawAttributes']);_0x1e3c34['query']=_[_0x15e6('0x44')](_0x3404c7['query']);_0x1e3c34[_0x15e6('0x2e')]=_['intersection'](_0x1e3c34[_0x15e6('0x2b')],_0x1e3c34[_0x15e6('0x2d')]);_0x296fa1[_0x15e6('0x30')]=_[_0x15e6('0x2f')](_0x1e3c34[_0x15e6('0x2b')],qs['fields'](_0x3404c7[_0x15e6('0x2d')]['fields']));_0x296fa1[_0x15e6('0x30')]=_0x296fa1[_0x15e6('0x30')][_0x15e6('0x32')]?_0x296fa1['attributes']:_0x1e3c34[_0x15e6('0x2b')];_0x296fa1['order']=qs[_0x15e6('0x36')](_0x3404c7['query'][_0x15e6('0x36')]);_0x296fa1[_0x15e6('0x37')]=qs[_0x15e6('0x2e')](_[_0x15e6('0x38')](_0x3404c7[_0x15e6('0x2d')],_0x1e3c34[_0x15e6('0x2e')]));if(_0x3404c7[_0x15e6('0x2d')]['filter']){_0x296fa1[_0x15e6('0x37')]=_[_0x15e6('0x3c')](_0x296fa1[_0x15e6('0x37')],{'$or':_[_0x15e6('0x2c')](_0x296fa1[_0x15e6('0x30')],function(_0x1a789d){var _0x3be7c1={};_0x3be7c1[_0x1a789d]={'$like':'%'+_0x3404c7['query'][_0x15e6('0x39')]+'%'};return _0x3be7c1;})});}_0x296fa1=_[_0x15e6('0x3c')]({},_0x296fa1,_0x3404c7[_0x15e6('0x46')]);return _0x409ebb[_0x15e6('0x50')](_0x296fa1);}})['then'](function(_0x1c4135){if(_0x1c4135){_0x3d70c1=_0x1c4135[_0x15e6('0x32')];if(!_0x3404c7[_0x15e6('0x2d')][_0x15e6('0x33')](_0x15e6('0x34'))){_0x296fa1['limit']=qs[_0x15e6('0x1c')](_0x3404c7[_0x15e6('0x2d')][_0x15e6('0x1c')]);_0x296fa1[_0x15e6('0x1b')]=qs[_0x15e6('0x1b')](_0x3404c7[_0x15e6('0x2d')][_0x15e6('0x1b')]);}return _0x409ebb[_0x15e6('0x50')](_0x296fa1);}})['then'](function(_0x58b12f){if(_0x58b12f){return _0x58b12f?{'count':_0x3d70c1,'rows':_0x58b12f}:null;}})[_0x15e6('0x3e')](respondWithResult(_0xa4408,null))['catch'](handleError(_0xa4408,null));};exports['getDescriptions']=function(_0x230732,_0x1f7d4,_0x191de9){var _0x3b907a={};var _0x45e4af={};var _0x2622ed;var _0x17a72f;return db[_0x15e6('0x3d')][_0x15e6('0x4e')]({'where':{'id':_0x230732[_0x15e6('0x4a')]['id']}})[_0x15e6('0x3e')](handleEntityNotFound(_0x1f7d4,null))[_0x15e6('0x3e')](function(_0x2e3c2b){if(_0x2e3c2b){_0x2622ed=_0x2e3c2b;_0x45e4af[_0x15e6('0x2b')]=_[_0x15e6('0x44')](db['FreshdeskField'][_0x15e6('0x29')]);_0x45e4af[_0x15e6('0x2d')]=_['keys'](_0x230732[_0x15e6('0x2d')]);_0x45e4af['filters']=_['intersection'](_0x45e4af[_0x15e6('0x2b')],_0x45e4af[_0x15e6('0x2d')]);_0x3b907a[_0x15e6('0x30')]=_[_0x15e6('0x2f')](_0x45e4af['model'],qs['fields'](_0x230732[_0x15e6('0x2d')][_0x15e6('0x31')]));_0x3b907a[_0x15e6('0x30')]=_0x3b907a['attributes'][_0x15e6('0x32')]?_0x3b907a[_0x15e6('0x30')]:_0x45e4af[_0x15e6('0x2b')];_0x3b907a[_0x15e6('0x35')]=qs['sort'](_0x230732['query'][_0x15e6('0x36')]);_0x3b907a['where']=qs[_0x15e6('0x2e')](_[_0x15e6('0x38')](_0x230732['query'],_0x45e4af['filters']));if(_0x230732['query'][_0x15e6('0x39')]){_0x3b907a[_0x15e6('0x37')]=_[_0x15e6('0x3c')](_0x3b907a[_0x15e6('0x37')],{'$or':_['map'](_0x3b907a[_0x15e6('0x30')],function(_0x1924bb){var _0x33108e={};_0x33108e[_0x1924bb]={'$like':'%'+_0x230732[_0x15e6('0x2d')][_0x15e6('0x39')]+'%'};return _0x33108e;})});}_0x3b907a=_['merge']({},_0x3b907a,_0x230732[_0x15e6('0x46')]);return _0x2622ed[_0x15e6('0x51')](_0x3b907a);}})[_0x15e6('0x3e')](function(_0x4f509b){if(_0x4f509b){_0x17a72f=_0x4f509b['length'];if(!_0x230732['query'][_0x15e6('0x33')](_0x15e6('0x34'))){_0x3b907a[_0x15e6('0x1c')]=qs[_0x15e6('0x1c')](_0x230732['query']['limit']);_0x3b907a[_0x15e6('0x1b')]=qs[_0x15e6('0x1b')](_0x230732[_0x15e6('0x2d')][_0x15e6('0x1b')]);}return _0x2622ed[_0x15e6('0x51')](_0x3b907a);}})[_0x15e6('0x3e')](function(_0x57fea1){if(_0x57fea1){return _0x57fea1?{'count':_0x17a72f,'rows':_0x57fea1}:null;}})[_0x15e6('0x3e')](respondWithResult(_0x1f7d4,null))[_0x15e6('0x42')](handleError(_0x1f7d4,null));};exports[_0x15e6('0x52')]=function(_0x5d23f6,_0x4d05cc,_0x3af784){var _0x1036bb={};var _0x521898={};var _0x5aba55;var _0x2be088;return db['FreshdeskConfiguration'][_0x15e6('0x4e')]({'where':{'id':_0x5d23f6[_0x15e6('0x4a')]['id']}})[_0x15e6('0x3e')](handleEntityNotFound(_0x4d05cc,null))['then'](function(_0x5e08c3){if(_0x5e08c3){_0x5aba55=_0x5e08c3;_0x521898[_0x15e6('0x2b')]=_[_0x15e6('0x44')](db[_0x15e6('0x53')][_0x15e6('0x29')]);_0x521898[_0x15e6('0x2d')]=_[_0x15e6('0x44')](_0x5d23f6[_0x15e6('0x2d')]);_0x521898[_0x15e6('0x2e')]=_[_0x15e6('0x2f')](_0x521898[_0x15e6('0x2b')],_0x521898[_0x15e6('0x2d')]);_0x1036bb[_0x15e6('0x30')]=_['intersection'](_0x521898['model'],qs['fields'](_0x5d23f6[_0x15e6('0x2d')]['fields']));_0x1036bb[_0x15e6('0x30')]=_0x1036bb['attributes']['length']?_0x1036bb[_0x15e6('0x30')]:_0x521898[_0x15e6('0x2b')];_0x1036bb['order']=qs[_0x15e6('0x36')](_0x5d23f6[_0x15e6('0x2d')][_0x15e6('0x36')]);_0x1036bb[_0x15e6('0x37')]=qs[_0x15e6('0x2e')](_[_0x15e6('0x38')](_0x5d23f6[_0x15e6('0x2d')],_0x521898[_0x15e6('0x2e')]));if(_0x5d23f6[_0x15e6('0x2d')][_0x15e6('0x39')]){_0x1036bb[_0x15e6('0x37')]=_[_0x15e6('0x3c')](_0x1036bb['where'],{'$or':_[_0x15e6('0x2c')](_0x1036bb['attributes'],function(_0x37d029){var _0xbb6cda={};_0xbb6cda[_0x37d029]={'$like':'%'+_0x5d23f6[_0x15e6('0x2d')][_0x15e6('0x39')]+'%'};return _0xbb6cda;})});}_0x1036bb=_[_0x15e6('0x3c')]({},_0x1036bb,_0x5d23f6[_0x15e6('0x46')]);return _0x5aba55['getTags'](_0x1036bb);}})[_0x15e6('0x3e')](function(_0x2fb5fb){if(_0x2fb5fb){_0x2be088=_0x2fb5fb['length'];if(!_0x5d23f6[_0x15e6('0x2d')][_0x15e6('0x33')](_0x15e6('0x34'))){_0x1036bb[_0x15e6('0x1c')]=qs['limit'](_0x5d23f6[_0x15e6('0x2d')]['limit']);_0x1036bb[_0x15e6('0x1b')]=qs['offset'](_0x5d23f6[_0x15e6('0x2d')][_0x15e6('0x1b')]);}return _0x5aba55[_0x15e6('0x52')](_0x1036bb);}})[_0x15e6('0x3e')](function(_0x37eef8){if(_0x37eef8){return _0x37eef8?{'count':_0x2be088,'rows':_0x37eef8}:null;}})[_0x15e6('0x3e')](respondWithResult(_0x4d05cc,null))[_0x15e6('0x42')](handleError(_0x4d05cc,null));};exports['setTags']=function(_0x274d0c,_0x58bbe2,_0x458e3a){if(_0x274d0c[_0x15e6('0x4b')]['id']){delete _0x274d0c[_0x15e6('0x4b')]['id'];}return db[_0x15e6('0x3d')][_0x15e6('0x4e')]({'where':{'id':_0x274d0c[_0x15e6('0x4a')]['id']}})[_0x15e6('0x3e')](handleEntityNotFound(_0x58bbe2,null))['then'](function(_0x2b74f0){if(_0x2b74f0){return _0x2b74f0[_0x15e6('0x54')](_0x274d0c[_0x15e6('0x4b')][_0x15e6('0x55')]||[]);}return null;})['then'](respondWithResult(_0x58bbe2,null))[_0x15e6('0x42')](handleError(_0x58bbe2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b5f731d..3d73a94 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 _0x2a06=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x471273,_0x216ce4){var _0x4a318c=function(_0x61d51b){while(--_0x61d51b){_0x471273['push'](_0x471273['shift']());}};_0x4a318c(++_0x216ce4);}(_0x2a06,0x1af));var _0x62a0=function(_0x3ee827,_0x2c011d){_0x3ee827=_0x3ee827-0x0;var _0x1368dd=_0x2a06[_0x3ee827];return _0x1368dd;};'use strict';var _=require(_0x62a0('0x0'));var util=require(_0x62a0('0x1'));var logger=require(_0x62a0('0x2'))('api');var moment=require(_0x62a0('0x3'));var BPromise=require(_0x62a0('0x4'));var rp=require(_0x62a0('0x5'));var fs=require('fs');var path=require(_0x62a0('0x6'));var rimraf=require(_0x62a0('0x7'));var config=require(_0x62a0('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x62a0('0x9')]=function(_0x255af8,_0x512c78){return _0x255af8[_0x62a0('0xa')](_0x62a0('0xb'),attributes,{'tableName':_0x62a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6d2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0xb6d2,0x13b));var _0x2b6d=function(_0x36043b,_0x1fedf5){_0x36043b=_0x36043b-0x0;var _0x41e08e=_0xb6d2[_0x36043b];return _0x41e08e;};'use strict';var _=require(_0x2b6d('0x0'));var util=require(_0x2b6d('0x1'));var logger=require(_0x2b6d('0x2'))(_0x2b6d('0x3'));var moment=require(_0x2b6d('0x4'));var BPromise=require(_0x2b6d('0x5'));var rp=require(_0x2b6d('0x6'));var fs=require('fs');var path=require(_0x2b6d('0x7'));var rimraf=require(_0x2b6d('0x8'));var config=require(_0x2b6d('0x9'));var attributes=require(_0x2b6d('0xa'));module[_0x2b6d('0xb')]=function(_0x1a2fb5,_0x2261f2){return _0x1a2fb5[_0x2b6d('0xc')](_0x2b6d('0xd'),attributes,{'tableName':_0x2b6d('0xe'),'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 b8acd00..64971f4 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 _0x3ee7=['client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3ee7,0x162));var _0x73ee=function(_0x1e3591,_0x2ce4f7){_0x1e3591=_0x1e3591-0x0;var _0x47c616=_0x3ee7[_0x1e3591];return _0x47c616;};'use strict';var _=require(_0x73ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x73ee('0x1'));var rs=require(_0x73ee('0x2'));var fs=require('fs');var Redis=require(_0x73ee('0x3'));var db=require(_0x73ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ee('0x5'))('rpc');var config=require(_0x73ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x73ee('0x7')][_0x73ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x138809,_0x3bf606,_0x35da71){return new BPromise(function(_0x37b1d4,_0xd4a904){return client[_0x73ee('0x9')](_0x138809,_0x35da71)['then'](function(_0x80b2c9){logger[_0x73ee('0xa')](_0x73ee('0xb'),_0x3bf606,'request\x20sent');logger['debug'](_0x73ee('0xc'),_0x3bf606,_0x73ee('0xd'),JSON[_0x73ee('0xe')](_0x80b2c9));if(_0x80b2c9[_0x73ee('0xf')]){if(_0x80b2c9['error']['code']===0x1f4){logger[_0x73ee('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bf606,_0x80b2c9[_0x73ee('0xf')][_0x73ee('0x10')]);return _0xd4a904(_0x80b2c9[_0x73ee('0xf')][_0x73ee('0x10')]);}logger['error'](_0x73ee('0xb'),_0x3bf606,_0x80b2c9['error'][_0x73ee('0x10')]);return _0x37b1d4(_0x80b2c9['error'][_0x73ee('0x10')]);}else{logger[_0x73ee('0xa')](_0x73ee('0xb'),_0x3bf606,'request\x20sent');_0x37b1d4(_0x80b2c9[_0x73ee('0x11')][_0x73ee('0x10')]);}})[_0x73ee('0x12')](function(_0x3f9a7d){logger['error'](_0x73ee('0xb'),_0x3bf606,_0x3f9a7d);_0xd4a904(_0x3f9a7d);});});} \ No newline at end of file +var _0x83de=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x83de,0x1f4));var _0xe83d=function(_0x51a055,_0x2a38ee){_0x51a055=_0x51a055-0x0;var _0x1a404d=_0x83de[_0x51a055];return _0x1a404d;};'use strict';var _=require(_0xe83d('0x0'));var util=require(_0xe83d('0x1'));var moment=require('moment');var BPromise=require(_0xe83d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe83d('0x3'));var db=require(_0xe83d('0x4'))['db'];var utils=require(_0xe83d('0x5'));var logger=require(_0xe83d('0x6'))(_0xe83d('0x7'));var config=require(_0xe83d('0x8'));var jayson=require(_0xe83d('0x9'));var client=jayson['client'][_0xe83d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3167fe,_0x57d926,_0x348a5a){return new BPromise(function(_0x4a6742,_0x1207c5){return client[_0xe83d('0xb')](_0x3167fe,_0x348a5a)[_0xe83d('0xc')](function(_0x814780){logger[_0xe83d('0xd')](_0xe83d('0xe'),_0x57d926,_0xe83d('0xf'));logger[_0xe83d('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x57d926,'request\x20sent',JSON[_0xe83d('0x11')](_0x814780));if(_0x814780['error']){if(_0x814780['error'][_0xe83d('0x12')]===0x1f4){logger[_0xe83d('0x13')](_0xe83d('0xe'),_0x57d926,_0x814780[_0xe83d('0x13')][_0xe83d('0x14')]);return _0x1207c5(_0x814780[_0xe83d('0x13')]['message']);}logger['error'](_0xe83d('0xe'),_0x57d926,_0x814780[_0xe83d('0x13')]['message']);return _0x4a6742(_0x814780[_0xe83d('0x13')][_0xe83d('0x14')]);}else{logger[_0xe83d('0xd')](_0xe83d('0xe'),_0x57d926,_0xe83d('0xf'));_0x4a6742(_0x814780[_0xe83d('0x15')]['message']);}})[_0xe83d('0x16')](function(_0x3c7566){logger[_0xe83d('0x13')](_0xe83d('0xe'),_0x57d926,_0x3c7566);_0x1207c5(_0x3c7566);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index b174f4c..cf29dac 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 _0x6f2b=['show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x562b80,_0x3412e1){var _0x155034=function(_0x4cbf06){while(--_0x4cbf06){_0x562b80['push'](_0x562b80['shift']());}};_0x155034(++_0x3412e1);}(_0x6f2b,0xe4));var _0xb6f2=function(_0x50ac8e,_0x1e42eb){_0x50ac8e=_0x50ac8e-0x0;var _0x207c88=_0x6f2b[_0x50ac8e];return _0x207c88;};'use strict';var multer=require('multer');var util=require(_0xb6f2('0x0'));var path=require(_0xb6f2('0x1'));var timeout=require(_0xb6f2('0x2'));var express=require(_0xb6f2('0x3'));var router=express[_0xb6f2('0x4')]();var fs_extra=require(_0xb6f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb6f2('0x6'));var config=require(_0xb6f2('0x7'));var controller=require(_0xb6f2('0x8'));router[_0xb6f2('0x9')]('/',auth[_0xb6f2('0xa')](),controller[_0xb6f2('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb6f2('0xc')]);router[_0xb6f2('0xd')]('/',auth['isAuthenticated'](),controller[_0xb6f2('0xe')]);router[_0xb6f2('0xf')](_0xb6f2('0x10'),auth[_0xb6f2('0xa')](),controller[_0xb6f2('0x11')]);router[_0xb6f2('0x12')](_0xb6f2('0x10'),auth[_0xb6f2('0xa')](),controller['destroy']);module[_0xb6f2('0x13')]=router; \ No newline at end of file +var _0xd43e=['isAuthenticated','index','/:id','show','put','update','delete','exports','util','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','get'];(function(_0x5b8fe7,_0x1418d6){var _0x5c9c38=function(_0x30d011){while(--_0x30d011){_0x5b8fe7['push'](_0x5b8fe7['shift']());}};_0x5c9c38(++_0x1418d6);}(_0xd43e,0xe8));var _0xed43=function(_0x216446,_0x28d139){_0x216446=_0x216446-0x0;var _0x4b200b=_0xd43e[_0x216446];return _0x4b200b;};'use strict';var multer=require('multer');var util=require(_0xed43('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xed43('0x1')]();var fs_extra=require(_0xed43('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xed43('0x3'));var config=require('../../config/environment');var controller=require(_0xed43('0x4'));router[_0xed43('0x5')]('/',auth[_0xed43('0x6')](),controller[_0xed43('0x7')]);router['get'](_0xed43('0x8'),auth['isAuthenticated'](),controller[_0xed43('0x9')]);router['post']('/',auth[_0xed43('0x6')](),controller['create']);router[_0xed43('0xa')](_0xed43('0x8'),auth[_0xed43('0x6')](),controller[_0xed43('0xb')]);router[_0xed43('0xc')](_0xed43('0x8'),auth[_0xed43('0x6')](),controller['destroy']);module[_0xed43('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 006ea38..978f6b4 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 _0x6148=['picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x9ddcdf,_0x4369d2){var _0x543f56=function(_0x2a36bb){while(--_0x2a36bb){_0x9ddcdf['push'](_0x9ddcdf['shift']());}};_0x543f56(++_0x4369d2);}(_0x6148,0x1f3));var _0x8614=function(_0x57ac7f,_0x279a48){_0x57ac7f=_0x57ac7f-0x0;var _0x52a15a=_0x6148[_0x57ac7f];return _0x52a15a;};'use strict';var Sequelize=require('sequelize');module[_0x8614('0x0')]={'type':{'type':Sequelize[_0x8614('0x1')]('string',_0x8614('0x2'),_0x8614('0x3'),_0x8614('0x4'),_0x8614('0x5')),'defaultValue':_0x8614('0x6')},'content':{'type':Sequelize[_0x8614('0x7')]},'key':{'type':Sequelize[_0x8614('0x7')]},'keyType':{'type':Sequelize[_0x8614('0x1')](_0x8614('0x6'),_0x8614('0x2'),_0x8614('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8614('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8614('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8614('0x7')]}}; \ No newline at end of file +var _0x08f0=['STRING','ENUM','customVariable','sequelize','exports','string','variable','keyValue'];(function(_0x3492b4,_0x56932a){var _0xff19e9=function(_0x1503e4){while(--_0x1503e4){_0x3492b4['push'](_0x3492b4['shift']());}};_0xff19e9(++_0x56932a);}(_0x08f0,0x1e3));var _0x008f=function(_0x2fd873,_0x51262f){_0x2fd873=_0x2fd873-0x0;var _0x23e544=_0x08f0[_0x2fd873];return _0x23e544;};'use strict';var Sequelize=require(_0x008f('0x0'));module[_0x008f('0x1')]={'type':{'type':Sequelize['ENUM'](_0x008f('0x2'),_0x008f('0x3'),'customVariable',_0x008f('0x4'),'picklist'),'defaultValue':_0x008f('0x2')},'content':{'type':Sequelize[_0x008f('0x5')]},'key':{'type':Sequelize[_0x008f('0x5')]},'keyType':{'type':Sequelize[_0x008f('0x6')]('string',_0x008f('0x3'),_0x008f('0x7'))},'keyContent':{'type':Sequelize[_0x008f('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x008f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ea5f2ff..4102114 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 _0x94d2=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','FreshdeskField','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x30b676,_0x4538aa){var _0x3bec06=function(_0x1fd533){while(--_0x1fd533){_0x30b676['push'](_0x30b676['shift']());}};_0x3bec06(++_0x4538aa);}(_0x94d2,0x1cd));var _0x294d=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x94d2[_0xa45395];return _0x3c83d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x294d('0x0'));var jsonpatch=require(_0x294d('0x1'));var rp=require(_0x294d('0x2'));var moment=require(_0x294d('0x3'));var BPromise=require(_0x294d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x294d('0x5'));var sox=require(_0x294d('0x6'));var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x294d('0xa'));var jsforce=require(_0x294d('0xb'));var deskjs=require(_0x294d('0xc'));var toCsv=require(_0x294d('0x7'));var querystring=require(_0x294d('0xd'));var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x294d('0x12'));var config=require(_0x294d('0x13'));var licenseUtil=require(_0x294d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d44ba,_0x3f0f3a){_0x3f0f3a=_0x3f0f3a||0xcc;return function(_0x4119da){if(_0x4119da){return _0x3d44ba[_0x294d('0x15')](_0x3f0f3a);}return _0x3d44ba['status'](_0x3f0f3a)[_0x294d('0x16')]();};}function respondWithResult(_0x49c38f,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xc8;return function(_0xed0e10){if(_0xed0e10){return _0x49c38f[_0x294d('0x17')](_0x5adc9c)[_0x294d('0x18')](_0xed0e10);}};}function respondWithFilteredResult(_0x28f7f6,_0x4bf3ae){return function(_0x42d290){if(_0x42d290){var _0x4fddfe=typeof _0x4bf3ae['offset']==='undefined'&&typeof _0x4bf3ae['limit']===_0x294d('0x19');var _0x15dce0=_0x42d290[_0x294d('0x1a')];var _0x46d9c5=_0x4fddfe?0x0:_0x4bf3ae[_0x294d('0x1b')];var _0x26563e=_0x4fddfe?_0x42d290[_0x294d('0x1a')]:_0x4bf3ae[_0x294d('0x1b')]+_0x4bf3ae['limit'];var _0x3ccc78;if(_0x26563e>=_0x15dce0){_0x26563e=_0x15dce0;_0x3ccc78=0xc8;}else{_0x3ccc78=0xce;}_0x28f7f6[_0x294d('0x17')](_0x3ccc78);return _0x28f7f6['set'](_0x294d('0x1c'),_0x46d9c5+'-'+_0x26563e+'/'+_0x15dce0)[_0x294d('0x18')](_0x42d290);}return null;};}function patchUpdates(_0x429da3){return function(_0xffe147){try{jsonpatch[_0x294d('0x1d')](_0xffe147,_0x429da3,!![]);}catch(_0x31fd1c){return BPromise[_0x294d('0x1e')](_0x31fd1c);}return _0xffe147[_0x294d('0x1f')]();};}function saveUpdates(_0x82ad78,_0x11df11){return function(_0x419717){if(_0x419717){return _0x419717[_0x294d('0x20')](_0x82ad78)[_0x294d('0x21')](function(_0x2b2a1e){return _0x2b2a1e;});}return null;};}function removeEntity(_0x4aa60,_0x524ff2){return function(_0x546a59){if(_0x546a59){return _0x546a59[_0x294d('0x22')]()[_0x294d('0x21')](function(){_0x4aa60[_0x294d('0x17')](0xcc)[_0x294d('0x16')]();});}};}function handleEntityNotFound(_0x1cf383,_0x1ba06c){return function(_0x4da072){if(!_0x4da072){_0x1cf383[_0x294d('0x15')](0x194);}return _0x4da072;};}function handleError(_0x5cac01,_0x4670ae){_0x4670ae=_0x4670ae||0x1f4;return function(_0x233212){logger[_0x294d('0x23')](_0x233212[_0x294d('0x24')]);if(_0x233212[_0x294d('0x25')]){delete _0x233212[_0x294d('0x25')];}_0x5cac01[_0x294d('0x17')](_0x4670ae)['send'](_0x233212);};}exports[_0x294d('0x26')]=function(_0x2b2072,_0x37cf9f){var _0x340ae5={},_0xdfcde1={},_0x338cc1={'count':0x0,'rows':[]};var _0x21f7d5=_[_0x294d('0x27')](db['FreshdeskField'][_0x294d('0x28')],function(_0x4539d6){return{'name':_0x4539d6[_0x294d('0x29')],'type':_0x4539d6[_0x294d('0x2a')]['key']};});_0xdfcde1['model']=_[_0x294d('0x27')](_0x21f7d5,_0x294d('0x25'));_0xdfcde1[_0x294d('0x2b')]=_[_0x294d('0x2c')](_0x2b2072[_0x294d('0x2b')]);_0xdfcde1[_0x294d('0x2d')]=_[_0x294d('0x2e')](_0xdfcde1[_0x294d('0x2f')],_0xdfcde1[_0x294d('0x2b')]);_0x340ae5['attributes']=_[_0x294d('0x2e')](_0xdfcde1[_0x294d('0x2f')],qs[_0x294d('0x30')](_0x2b2072['query'][_0x294d('0x30')]));_0x340ae5[_0x294d('0x31')]=_0x340ae5['attributes'][_0x294d('0x32')]?_0x340ae5[_0x294d('0x31')]:_0xdfcde1['model'];if(!_0x2b2072['query'][_0x294d('0x33')](_0x294d('0x34'))){_0x340ae5[_0x294d('0x35')]=qs['limit'](_0x2b2072[_0x294d('0x2b')][_0x294d('0x35')]);_0x340ae5[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x2b2072[_0x294d('0x2b')][_0x294d('0x1b')]);}_0x340ae5[_0x294d('0x36')]=qs[_0x294d('0x37')](_0x2b2072[_0x294d('0x2b')][_0x294d('0x37')]);_0x340ae5[_0x294d('0x38')]=qs[_0x294d('0x2d')](_['pick'](_0x2b2072[_0x294d('0x2b')],_0xdfcde1[_0x294d('0x2d')]),_0x21f7d5);if(_0x2b2072[_0x294d('0x2b')]['filter']){_0x340ae5[_0x294d('0x38')]=_[_0x294d('0x39')](_0x340ae5[_0x294d('0x38')],{'$or':_[_0x294d('0x27')](_0x21f7d5,function(_0x4a34f7){if(_0x4a34f7[_0x294d('0x2a')]!==_0x294d('0x3a')){var _0x1b8d9f={};_0x1b8d9f[_0x4a34f7['name']]={'$like':'%'+_0x2b2072[_0x294d('0x2b')][_0x294d('0x3b')]+'%'};return _0x1b8d9f;}})});}_0x340ae5=_[_0x294d('0x39')]({},_0x340ae5,_0x2b2072['options']);var _0xa131c0={'where':_0x340ae5[_0x294d('0x38')]};return db[_0x294d('0x3c')][_0x294d('0x1a')](_0xa131c0)[_0x294d('0x21')](function(_0x3ad313){_0x338cc1[_0x294d('0x1a')]=_0x3ad313;if(_0x2b2072[_0x294d('0x2b')][_0x294d('0x3d')]){_0x340ae5[_0x294d('0x3e')]=[{'all':!![]}];}return db[_0x294d('0x3c')][_0x294d('0x3f')](_0x340ae5);})[_0x294d('0x21')](function(_0xbd48cd){_0x338cc1[_0x294d('0x40')]=_0xbd48cd;return _0x338cc1;})[_0x294d('0x21')](respondWithFilteredResult(_0x37cf9f,_0x340ae5))[_0x294d('0x41')](handleError(_0x37cf9f,null));};exports[_0x294d('0x42')]=function(_0x530766,_0x11b64b){var _0x4648de={'raw':!![],'where':{'id':_0x530766['params']['id']}},_0x2be6fd={};_0x2be6fd[_0x294d('0x2f')]=_[_0x294d('0x2c')](db['FreshdeskField'][_0x294d('0x28')]);_0x2be6fd[_0x294d('0x2b')]=_[_0x294d('0x2c')](_0x530766['query']);_0x2be6fd[_0x294d('0x2d')]=_[_0x294d('0x2e')](_0x2be6fd[_0x294d('0x2f')],_0x2be6fd[_0x294d('0x2b')]);_0x4648de[_0x294d('0x31')]=_[_0x294d('0x2e')](_0x2be6fd['model'],qs['fields'](_0x530766['query'][_0x294d('0x30')]));_0x4648de[_0x294d('0x31')]=_0x4648de[_0x294d('0x31')][_0x294d('0x32')]?_0x4648de[_0x294d('0x31')]:_0x2be6fd['model'];if(_0x530766[_0x294d('0x2b')]['includeAll']){_0x4648de['include']=[{'all':!![]}];}_0x4648de=_[_0x294d('0x39')]({},_0x4648de,_0x530766[_0x294d('0x43')]);return db[_0x294d('0x3c')][_0x294d('0x44')](_0x4648de)[_0x294d('0x21')](handleEntityNotFound(_0x11b64b,null))[_0x294d('0x21')](respondWithResult(_0x11b64b,null))[_0x294d('0x41')](handleError(_0x11b64b,null));};exports['create']=function(_0x56d7ec,_0x4f86c4){return db['FreshdeskField'][_0x294d('0x45')](_0x56d7ec[_0x294d('0x46')],{})[_0x294d('0x21')](respondWithResult(_0x4f86c4,0xc9))[_0x294d('0x41')](handleError(_0x4f86c4,null));};exports[_0x294d('0x20')]=function(_0x82590d,_0x160904){if(_0x82590d[_0x294d('0x46')]['id']){delete _0x82590d[_0x294d('0x46')]['id'];}return db[_0x294d('0x3c')][_0x294d('0x44')]({'where':{'id':_0x82590d['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x160904,null))[_0x294d('0x21')](saveUpdates(_0x82590d[_0x294d('0x46')],null))[_0x294d('0x21')](respondWithResult(_0x160904,null))[_0x294d('0x41')](handleError(_0x160904,null));};exports['destroy']=function(_0x91b2da,_0x26755d){return db[_0x294d('0x3c')]['find']({'where':{'id':_0x91b2da[_0x294d('0x47')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x26755d,null))[_0x294d('0x21')](removeEntity(_0x26755d,null))[_0x294d('0x41')](handleError(_0x26755d,null));}; \ No newline at end of file +var _0xe600=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','include','FreshdeskField','findAll','rows','catch','show','includeAll','create','body','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0x32fb9a,_0x3959a8){var _0x363750=function(_0x29cf49){while(--_0x29cf49){_0x32fb9a['push'](_0x32fb9a['shift']());}};_0x363750(++_0x3959a8);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e60('0x1'));var rp=require(_0x0e60('0x2'));var moment=require(_0x0e60('0x3'));var BPromise=require(_0x0e60('0x4'));var Mustache=require(_0x0e60('0x5'));var util=require(_0x0e60('0x6'));var path=require(_0x0e60('0x7'));var sox=require(_0x0e60('0x8'));var csv=require(_0x0e60('0x9'));var ejs=require(_0x0e60('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e60('0xb'));var squel=require(_0x0e60('0xc'));var crypto=require(_0x0e60('0xd'));var jsforce=require(_0x0e60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e60('0x9'));var querystring=require(_0x0e60('0xf'));var Papa=require(_0x0e60('0x10'));var Redis=require(_0x0e60('0x11'));var authService=require(_0x0e60('0x12'));var qs=require(_0x0e60('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e60('0x14'));var logger=require(_0x0e60('0x15'))(_0x0e60('0x16'));var utils=require(_0x0e60('0x17'));var config=require(_0x0e60('0x18'));var licenseUtil=require(_0x0e60('0x19'));var db=require(_0x0e60('0x1a'))['db'];function respondWithStatusCode(_0x2f5ee4,_0x540411){_0x540411=_0x540411||0xcc;return function(_0x2d848f){if(_0x2d848f){return _0x2f5ee4[_0x0e60('0x1b')](_0x540411);}return _0x2f5ee4[_0x0e60('0x1c')](_0x540411)[_0x0e60('0x1d')]();};}function respondWithResult(_0x45328b,_0x37bf95){_0x37bf95=_0x37bf95||0xc8;return function(_0x5d7f84){if(_0x5d7f84){return _0x45328b[_0x0e60('0x1c')](_0x37bf95)['json'](_0x5d7f84);}};}function respondWithFilteredResult(_0x91cd1,_0x128887){return function(_0x170890){if(_0x170890){var _0x5ab4ba=typeof _0x128887[_0x0e60('0x1e')]===_0x0e60('0x1f')&&typeof _0x128887[_0x0e60('0x20')]===_0x0e60('0x1f');var _0x2e6270=_0x170890['count'];var _0x992490=_0x5ab4ba?0x0:_0x128887[_0x0e60('0x1e')];var _0x599c1d=_0x5ab4ba?_0x170890[_0x0e60('0x21')]:_0x128887[_0x0e60('0x1e')]+_0x128887[_0x0e60('0x20')];var _0x504b31;if(_0x599c1d>=_0x2e6270){_0x599c1d=_0x2e6270;_0x504b31=0xc8;}else{_0x504b31=0xce;}_0x91cd1[_0x0e60('0x1c')](_0x504b31);return _0x91cd1['set'](_0x0e60('0x22'),_0x992490+'-'+_0x599c1d+'/'+_0x2e6270)[_0x0e60('0x23')](_0x170890);}return null;};}function patchUpdates(_0xb9f037){return function(_0xabf953){try{jsonpatch[_0x0e60('0x24')](_0xabf953,_0xb9f037,!![]);}catch(_0x31a63e){return BPromise[_0x0e60('0x25')](_0x31a63e);}return _0xabf953[_0x0e60('0x26')]();};}function saveUpdates(_0x352633,_0x10f875){return function(_0x22c0e0){if(_0x22c0e0){return _0x22c0e0[_0x0e60('0x27')](_0x352633)[_0x0e60('0x28')](function(_0x16985f){return _0x16985f;});}return null;};}function removeEntity(_0x4702f,_0x33f9f3){return function(_0x41642c){if(_0x41642c){return _0x41642c[_0x0e60('0x29')]()[_0x0e60('0x28')](function(){_0x4702f['status'](0xcc)[_0x0e60('0x1d')]();});}};}function handleEntityNotFound(_0x41ad9a,_0x5ea254){return function(_0x10451f){if(!_0x10451f){_0x41ad9a['sendStatus'](0x194);}return _0x10451f;};}function handleError(_0x3ddc19,_0x5665c2){_0x5665c2=_0x5665c2||0x1f4;return function(_0x48d950){logger[_0x0e60('0x2a')](_0x48d950[_0x0e60('0x2b')]);if(_0x48d950['name']){delete _0x48d950['name'];}_0x3ddc19[_0x0e60('0x1c')](_0x5665c2)['send'](_0x48d950);};}exports[_0x0e60('0x2c')]=function(_0x548919,_0x4e6b41){var _0x154478={},_0x3d3c13={},_0x2a282d={'count':0x0,'rows':[]};var _0x4d9b18=_[_0x0e60('0x2d')](db['FreshdeskField'][_0x0e60('0x2e')],function(_0x1d54c0){return{'name':_0x1d54c0[_0x0e60('0x2f')],'type':_0x1d54c0['type'][_0x0e60('0x30')]};});_0x3d3c13[_0x0e60('0x31')]=_[_0x0e60('0x2d')](_0x4d9b18,'name');_0x3d3c13[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x548919[_0x0e60('0x32')]);_0x3d3c13[_0x0e60('0x34')]=_[_0x0e60('0x35')](_0x3d3c13['model'],_0x3d3c13[_0x0e60('0x32')]);_0x154478['attributes']=_[_0x0e60('0x35')](_0x3d3c13['model'],qs[_0x0e60('0x36')](_0x548919[_0x0e60('0x32')][_0x0e60('0x36')]));_0x154478['attributes']=_0x154478[_0x0e60('0x37')][_0x0e60('0x38')]?_0x154478[_0x0e60('0x37')]:_0x3d3c13[_0x0e60('0x31')];if(!_0x548919[_0x0e60('0x32')][_0x0e60('0x39')](_0x0e60('0x3a'))){_0x154478[_0x0e60('0x20')]=qs[_0x0e60('0x20')](_0x548919[_0x0e60('0x32')][_0x0e60('0x20')]);_0x154478[_0x0e60('0x1e')]=qs['offset'](_0x548919[_0x0e60('0x32')][_0x0e60('0x1e')]);}_0x154478[_0x0e60('0x3b')]=qs[_0x0e60('0x3c')](_0x548919['query']['sort']);_0x154478[_0x0e60('0x3d')]=qs['filters'](_[_0x0e60('0x3e')](_0x548919['query'],_0x3d3c13[_0x0e60('0x34')]),_0x4d9b18);if(_0x548919[_0x0e60('0x32')][_0x0e60('0x3f')]){_0x154478[_0x0e60('0x3d')]=_[_0x0e60('0x40')](_0x154478[_0x0e60('0x3d')],{'$or':_[_0x0e60('0x2d')](_0x4d9b18,function(_0x39fac1){if(_0x39fac1[_0x0e60('0x41')]!==_0x0e60('0x42')){var _0xb0a66c={};_0xb0a66c[_0x39fac1[_0x0e60('0x43')]]={'$like':'%'+_0x548919['query'][_0x0e60('0x3f')]+'%'};return _0xb0a66c;}})});}_0x154478=_['merge']({},_0x154478,_0x548919[_0x0e60('0x44')]);var _0x266cae={'where':_0x154478['where']};return db['FreshdeskField'][_0x0e60('0x21')](_0x266cae)[_0x0e60('0x28')](function(_0x50b793){_0x2a282d[_0x0e60('0x21')]=_0x50b793;if(_0x548919[_0x0e60('0x32')]['includeAll']){_0x154478[_0x0e60('0x45')]=[{'all':!![]}];}return db[_0x0e60('0x46')][_0x0e60('0x47')](_0x154478);})[_0x0e60('0x28')](function(_0x3ac0f0){_0x2a282d[_0x0e60('0x48')]=_0x3ac0f0;return _0x2a282d;})[_0x0e60('0x28')](respondWithFilteredResult(_0x4e6b41,_0x154478))[_0x0e60('0x49')](handleError(_0x4e6b41,null));};exports[_0x0e60('0x4a')]=function(_0x4c89b4,_0x4a2a10){var _0x535c06={'raw':!![],'where':{'id':_0x4c89b4['params']['id']}},_0x39c7d4={};_0x39c7d4[_0x0e60('0x31')]=_[_0x0e60('0x33')](db[_0x0e60('0x46')]['rawAttributes']);_0x39c7d4[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x4c89b4['query']);_0x39c7d4['filters']=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],_0x39c7d4[_0x0e60('0x32')]);_0x535c06[_0x0e60('0x37')]=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],qs['fields'](_0x4c89b4[_0x0e60('0x32')][_0x0e60('0x36')]));_0x535c06[_0x0e60('0x37')]=_0x535c06[_0x0e60('0x37')][_0x0e60('0x38')]?_0x535c06['attributes']:_0x39c7d4['model'];if(_0x4c89b4['query'][_0x0e60('0x4b')]){_0x535c06[_0x0e60('0x45')]=[{'all':!![]}];}_0x535c06=_[_0x0e60('0x40')]({},_0x535c06,_0x4c89b4[_0x0e60('0x44')]);return db['FreshdeskField']['find'](_0x535c06)['then'](handleEntityNotFound(_0x4a2a10,null))[_0x0e60('0x28')](respondWithResult(_0x4a2a10,null))[_0x0e60('0x49')](handleError(_0x4a2a10,null));};exports[_0x0e60('0x4c')]=function(_0x5fe304,_0x8777f4){return db['FreshdeskField']['create'](_0x5fe304[_0x0e60('0x4d')],{})[_0x0e60('0x28')](respondWithResult(_0x8777f4,0xc9))[_0x0e60('0x49')](handleError(_0x8777f4,null));};exports[_0x0e60('0x27')]=function(_0x4ad156,_0x36a999){if(_0x4ad156[_0x0e60('0x4d')]['id']){delete _0x4ad156[_0x0e60('0x4d')]['id'];}return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x4ad156[_0x0e60('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36a999,null))[_0x0e60('0x28')](saveUpdates(_0x4ad156['body'],null))[_0x0e60('0x28')](respondWithResult(_0x36a999,null))[_0x0e60('0x49')](handleError(_0x36a999,null));};exports[_0x0e60('0x29')]=function(_0x2e887c,_0x477a99){return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x2e887c[_0x0e60('0x4f')]['id']}})[_0x0e60('0x28')](handleEntityNotFound(_0x477a99,null))[_0x0e60('0x28')](removeEntity(_0x477a99,null))['catch'](handleError(_0x477a99,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4bb5731..4b0e74e 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 _0x85ff=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x110635,_0x12d3a7){var _0x3f1650=function(_0x43ba4f){while(--_0x43ba4f){_0x110635['push'](_0x110635['shift']());}};_0x3f1650(++_0x12d3a7);}(_0x85ff,0x1d1));var _0xf85f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x85ff[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf85f('0x0'));var util=require(_0xf85f('0x1'));var logger=require('../../config/logger')(_0xf85f('0x2'));var moment=require(_0xf85f('0x3'));var BPromise=require(_0xf85f('0x4'));var rp=require(_0xf85f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf85f('0x6'));var config=require(_0xf85f('0x7'));var attributes=require(_0xf85f('0x8'));module[_0xf85f('0x9')]=function(_0x3a9fc8,_0x97760){return _0x3a9fc8[_0xf85f('0xa')]('FreshdeskField',attributes,{'tableName':_0xf85f('0xb'),'paranoid':![],'indexes':[{'name':_0xf85f('0xc'),'fields':[_0xf85f('0xd'),_0xf85f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1306=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x4654d5,_0x55fdf3){var _0x2da3f9=function(_0x8cd30a){while(--_0x8cd30a){_0x4654d5['push'](_0x4654d5['shift']());}};_0x2da3f9(++_0x55fdf3);}(_0x1306,0x17a));var _0x6130=function(_0x3adf6f,_0x11a73c){_0x3adf6f=_0x3adf6f-0x0;var _0x4f2a22=_0x1306[_0x3adf6f];return _0x4f2a22;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var logger=require(_0x6130('0x2'))(_0x6130('0x3'));var moment=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var rp=require(_0x6130('0x6'));var fs=require('fs');var path=require(_0x6130('0x7'));var rimraf=require(_0x6130('0x8'));var config=require(_0x6130('0x9'));var attributes=require(_0x6130('0xa'));module[_0x6130('0xb')]=function(_0x213e6a,_0x2b965d){return _0x213e6a[_0x6130('0xc')](_0x6130('0xd'),attributes,{'tableName':_0x6130('0xe'),'paranoid':![],'indexes':[{'name':_0x6130('0xf'),'fields':[_0x6130('0x10'),_0x6130('0x11')],'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 e825bd7..bc00efe 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 _0x4012=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x360059,_0x182614){var _0x3ab614=function(_0xb14a1b){while(--_0xb14a1b){_0x360059['push'](_0x360059['shift']());}};_0x3ab614(++_0x182614);}(_0x4012,0xde));var _0x2401=function(_0x112a80,_0x21d528){_0x112a80=_0x112a80-0x0;var _0x5dd663=_0x4012[_0x112a80];return _0x5dd663;};'use strict';var _=require('lodash');var util=require(_0x2401('0x0'));var moment=require('moment');var BPromise=require(_0x2401('0x1'));var rs=require(_0x2401('0x2'));var fs=require('fs');var Redis=require(_0x2401('0x3'));var db=require(_0x2401('0x4'))['db'];var utils=require(_0x2401('0x5'));var logger=require('../../config/logger')(_0x2401('0x6'));var config=require(_0x2401('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2401('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd5,_0xa066e7,_0x4c7afe){return new BPromise(function(_0xd21eeb,_0x2f89df){return client[_0x2401('0x9')](_0x1c3bd5,_0x4c7afe)[_0x2401('0xa')](function(_0x130921){logger['info'](_0x2401('0xb'),_0xa066e7,_0x2401('0xc'));logger[_0x2401('0xd')](_0x2401('0xe'),_0xa066e7,_0x2401('0xc'),JSON[_0x2401('0xf')](_0x130921));if(_0x130921[_0x2401('0x10')]){if(_0x130921[_0x2401('0x10')][_0x2401('0x11')]===0x1f4){logger[_0x2401('0x10')](_0x2401('0xb'),_0xa066e7,_0x130921[_0x2401('0x10')][_0x2401('0x12')]);return _0x2f89df(_0x130921[_0x2401('0x10')][_0x2401('0x12')]);}logger[_0x2401('0x10')](_0x2401('0xb'),_0xa066e7,_0x130921[_0x2401('0x10')][_0x2401('0x12')]);return _0xd21eeb(_0x130921[_0x2401('0x10')]['message']);}else{logger[_0x2401('0x13')](_0x2401('0xb'),_0xa066e7,_0x2401('0xc'));_0xd21eeb(_0x130921[_0x2401('0x14')][_0x2401('0x12')]);}})[_0x2401('0x15')](function(_0x276f1){logger['error'](_0x2401('0xb'),_0xa066e7,_0x276f1);_0x2f89df(_0x276f1);});});} \ No newline at end of file +var _0x2833=['../../config/logger','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x11cca1,_0x4a63e3){var _0xe01f78=function(_0x506a8d){while(--_0x506a8d){_0x11cca1['push'](_0x11cca1['shift']());}};_0xe01f78(++_0x4a63e3);}(_0x2833,0x6b));var _0x3283=function(_0x1e1443,_0x328d0e){_0x1e1443=_0x1e1443-0x0;var _0x595406=_0x2833[_0x1e1443];return _0x595406;};'use strict';var _=require(_0x3283('0x0'));var util=require(_0x3283('0x1'));var moment=require(_0x3283('0x2'));var BPromise=require(_0x3283('0x3'));var rs=require(_0x3283('0x4'));var fs=require('fs');var Redis=require(_0x3283('0x5'));var db=require(_0x3283('0x6'))['db'];var utils=require(_0x3283('0x7'));var logger=require(_0x3283('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3283('0x9')][_0x3283('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52b2bd,_0xb8aabf,_0x57fd82){return new BPromise(function(_0x1f6723,_0x50fe68){return client['request'](_0x52b2bd,_0x57fd82)[_0x3283('0xb')](function(_0x402d64){logger[_0x3283('0xc')](_0x3283('0xd'),_0xb8aabf,_0x3283('0xe'));logger[_0x3283('0xf')](_0x3283('0x10'),_0xb8aabf,_0x3283('0xe'),JSON[_0x3283('0x11')](_0x402d64));if(_0x402d64[_0x3283('0x12')]){if(_0x402d64[_0x3283('0x12')][_0x3283('0x13')]===0x1f4){logger['error'](_0x3283('0xd'),_0xb8aabf,_0x402d64[_0x3283('0x12')]['message']);return _0x50fe68(_0x402d64['error']['message']);}logger[_0x3283('0x12')](_0x3283('0xd'),_0xb8aabf,_0x402d64[_0x3283('0x12')][_0x3283('0x14')]);return _0x1f6723(_0x402d64[_0x3283('0x12')][_0x3283('0x14')]);}else{logger[_0x3283('0xc')](_0x3283('0xd'),_0xb8aabf,_0x3283('0xe'));_0x1f6723(_0x402d64[_0x3283('0x15')]['message']);}})[_0x3283('0x16')](function(_0x4cefa4){logger[_0x3283('0x12')](_0x3283('0xd'),_0xb8aabf,_0x4cefa4);_0x50fe68(_0x4cefa4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 8497663..5b0ae42 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 _0x6e6c=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x277b51,_0x571c68){var _0x20200b=function(_0x439525){while(--_0x439525){_0x277b51['push'](_0x277b51['shift']());}};_0x20200b(++_0x571c68);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id/configurations',auth[_0xc6e6('0x7')](),controller['getConfigurations']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')]('/',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xd')]);router[_0xc6e6('0xc')](_0xc6e6('0xe'),auth['isAuthenticated'](),controller[_0xc6e6('0xf')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x10')]);router[_0xc6e6('0x11')]('/:id',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x12')]);module[_0xc6e6('0x13')]=router; \ No newline at end of file +var _0xe605=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','/:id','update','delete'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe605,0x92));var _0x5e60=function(_0x47c5e5,_0x4a4019){_0x47c5e5=_0x47c5e5-0x0;var _0x53b6e9=_0xe605[_0x47c5e5];return _0x53b6e9;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['get']('/:id/configurations',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['post']('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x10')](_0x5e60('0x11'),auth[_0x5e60('0xb')](),controller['addConfiguration']);router[_0x5e60('0x12')](_0x5e60('0x13'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x14')]);router[_0x5e60('0x15')](_0x5e60('0x13'),auth['isAuthenticated'](),controller[_0x5e60('0x16')]);module[_0x5e60('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index d13a5cd..28e8940 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 _0x02ce=['sequelize','exports','STRING','remoteUri'];(function(_0x37e23b,_0x5021c9){var _0x327d8a=function(_0x20e996){while(--_0x20e996){_0x37e23b['push'](_0x37e23b['shift']());}};_0x327d8a(++_0x5021c9);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5ca7b8,_0x1d8f03){_0x5ca7b8=_0x5ca7b8-0x0;var _0x58e84e=_0x02ce[_0x5ca7b8];return _0x58e84e;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x66fa=['exports','STRING','username','remoteUri','sequelize'];(function(_0xd99ca7,_0x1caead){var _0x5d44bd=function(_0x14c3a8){while(--_0x14c3a8){_0xd99ca7['push'](_0xd99ca7['shift']());}};_0x5d44bd(++_0x1caead);}(_0x66fa,0x117));var _0xa66f=function(_0x54bf42,_0x5d9c79){_0x54bf42=_0x54bf42-0x0;var _0x478f46=_0x66fa[_0x54bf42];return _0x478f46;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa66f('0x2')]},'username':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x3')},'apiKey':{'type':Sequelize[_0xa66f('0x2')]},'remoteUri':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x4')},'serverUrl':{'type':Sequelize[_0xa66f('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 5f025f6..4a80a90 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 _0x3009=['json','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','FreshsalesAccount','includeAll','findAll','rows','catch','show','params','length','include','options','create','update','body','find','FreshsalesConfiguration','getConfigurations','hasOwnProperty','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x308ddd,_0x3a8401){var _0x3224c3=function(_0x230424){while(--_0x230424){_0x308ddd['push'](_0x308ddd['shift']());}};_0x3224c3(++_0x3a8401);}(_0x3009,0xaa));var _0x9300=function(_0x2a1e95,_0x560891){_0x2a1e95=_0x2a1e95-0x0;var _0x305548=_0x3009[_0x2a1e95];return _0x305548;};'use strict';var emlformat=require(_0x9300('0x0'));var rimraf=require(_0x9300('0x1'));var zipdir=require(_0x9300('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9300('0x3'));var BPromise=require(_0x9300('0x4'));var Mustache=require(_0x9300('0x5'));var util=require('util');var path=require(_0x9300('0x6'));var sox=require(_0x9300('0x7'));var csv=require(_0x9300('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9300('0x9'));var _=require(_0x9300('0xa'));var squel=require(_0x9300('0xb'));var crypto=require(_0x9300('0xc'));var jsforce=require(_0x9300('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9300('0x8'));var querystring=require('querystring');var Papa=require(_0x9300('0xe'));var Redis=require('ioredis');var authService=require(_0x9300('0xf'));var qs=require(_0x9300('0x10'));var as=require(_0x9300('0x11'));var hardwareService=require(_0x9300('0x12'));var logger=require(_0x9300('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9300('0x14'));var licenseUtil=require(_0x9300('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9300('0x16'));function respondWithStatusCode(_0x440bc6,_0x35e6db){_0x35e6db=_0x35e6db||0xcc;return function(_0x32d7b1){if(_0x32d7b1){return _0x440bc6[_0x9300('0x17')](_0x35e6db);}return _0x440bc6[_0x9300('0x18')](_0x35e6db)['end']();};}function respondWithResult(_0x2e00ab,_0x71c332){_0x71c332=_0x71c332||0xc8;return function(_0xf8baff){if(_0xf8baff){return _0x2e00ab[_0x9300('0x18')](_0x71c332)['json'](_0xf8baff);}};}function respondWithFilteredResult(_0x21d838,_0x1f46a4){return function(_0x197e26){if(_0x197e26){var _0x2de193=typeof _0x1f46a4[_0x9300('0x19')]===_0x9300('0x1a')&&typeof _0x1f46a4[_0x9300('0x1b')]===_0x9300('0x1a');var _0x2a3de6=_0x197e26[_0x9300('0x1c')];var _0x14f1d5=_0x2de193?0x0:_0x1f46a4[_0x9300('0x19')];var _0x562138=_0x2de193?_0x197e26[_0x9300('0x1c')]:_0x1f46a4[_0x9300('0x19')]+_0x1f46a4[_0x9300('0x1b')];var _0x1cd749;if(_0x562138>=_0x2a3de6){_0x562138=_0x2a3de6;_0x1cd749=0xc8;}else{_0x1cd749=0xce;}_0x21d838[_0x9300('0x18')](_0x1cd749);return _0x21d838[_0x9300('0x1d')]('Content-Range',_0x14f1d5+'-'+_0x562138+'/'+_0x2a3de6)[_0x9300('0x1e')](_0x197e26);}return null;};}function patchUpdates(_0x4a8ca9){return function(_0x30dfaf){try{jsonpatch[_0x9300('0x1f')](_0x30dfaf,_0x4a8ca9,!![]);}catch(_0x26a802){return BPromise[_0x9300('0x20')](_0x26a802);}return _0x30dfaf[_0x9300('0x21')]();};}function saveUpdates(_0x2db423,_0x549b89){return function(_0x2a7f80){if(_0x2a7f80){return _0x2a7f80['update'](_0x2db423)[_0x9300('0x22')](function(_0x1c4bbf){return _0x1c4bbf;});}return null;};}function removeEntity(_0x4775f4,_0x22180c){return function(_0x4f4486){if(_0x4f4486){return _0x4f4486['destroy']()[_0x9300('0x22')](function(){_0x4775f4[_0x9300('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5e34,_0x1c9822){return function(_0x29039e){if(!_0x29039e){_0x2a5e34[_0x9300('0x17')](0x194);}return _0x29039e;};}function handleError(_0x25a199,_0xdac33b){_0xdac33b=_0xdac33b||0x1f4;return function(_0x406686){logger[_0x9300('0x23')](_0x406686[_0x9300('0x24')]);if(_0x406686[_0x9300('0x25')]){delete _0x406686[_0x9300('0x25')];}_0x25a199[_0x9300('0x18')](_0xdac33b)[_0x9300('0x26')](_0x406686);};}exports[_0x9300('0x27')]=function(_0x2233fb,_0x1ae0dc){var _0x1b56b={},_0x5de0b9={},_0x52e07a={'count':0x0,'rows':[]};var _0x5f43f9=_[_0x9300('0x28')](db['FreshsalesAccount'][_0x9300('0x29')],function(_0x120c35){return{'name':_0x120c35[_0x9300('0x2a')],'type':_0x120c35[_0x9300('0x2b')][_0x9300('0x2c')]};});_0x5de0b9[_0x9300('0x2d')]=_[_0x9300('0x28')](_0x5f43f9,'name');_0x5de0b9[_0x9300('0x2e')]=_[_0x9300('0x2f')](_0x2233fb['query']);_0x5de0b9[_0x9300('0x30')]=_['intersection'](_0x5de0b9[_0x9300('0x2d')],_0x5de0b9[_0x9300('0x2e')]);_0x1b56b[_0x9300('0x31')]=_[_0x9300('0x32')](_0x5de0b9[_0x9300('0x2d')],qs[_0x9300('0x33')](_0x2233fb[_0x9300('0x2e')]['fields']));_0x1b56b[_0x9300('0x31')]=_0x1b56b[_0x9300('0x31')]['length']?_0x1b56b[_0x9300('0x31')]:_0x5de0b9[_0x9300('0x2d')];if(!_0x2233fb[_0x9300('0x2e')]['hasOwnProperty'](_0x9300('0x34'))){_0x1b56b[_0x9300('0x1b')]=qs['limit'](_0x2233fb['query'][_0x9300('0x1b')]);_0x1b56b[_0x9300('0x19')]=qs['offset'](_0x2233fb[_0x9300('0x2e')][_0x9300('0x19')]);}_0x1b56b[_0x9300('0x35')]=qs[_0x9300('0x36')](_0x2233fb[_0x9300('0x2e')][_0x9300('0x36')]);_0x1b56b['where']=qs[_0x9300('0x30')](_[_0x9300('0x37')](_0x2233fb[_0x9300('0x2e')],_0x5de0b9['filters']),_0x5f43f9);if(_0x2233fb[_0x9300('0x2e')][_0x9300('0x38')]){_0x1b56b[_0x9300('0x39')]=_[_0x9300('0x3a')](_0x1b56b[_0x9300('0x39')],{'$or':_['map'](_0x5f43f9,function(_0x221bec){if(_0x221bec[_0x9300('0x2b')]!==_0x9300('0x3b')){var _0x26d008={};_0x26d008[_0x221bec[_0x9300('0x25')]]={'$like':'%'+_0x2233fb[_0x9300('0x2e')]['filter']+'%'};return _0x26d008;}})});}_0x1b56b=_[_0x9300('0x3a')]({},_0x1b56b,_0x2233fb['options']);var _0x38cc30={'where':_0x1b56b[_0x9300('0x39')]};return db[_0x9300('0x3c')][_0x9300('0x1c')](_0x38cc30)[_0x9300('0x22')](function(_0x114bcf){_0x52e07a['count']=_0x114bcf;if(_0x2233fb[_0x9300('0x2e')][_0x9300('0x3d')]){_0x1b56b['include']=[{'all':!![]}];}return db[_0x9300('0x3c')][_0x9300('0x3e')](_0x1b56b);})['then'](function(_0x159ba1){_0x52e07a[_0x9300('0x3f')]=_0x159ba1;return _0x52e07a;})[_0x9300('0x22')](respondWithFilteredResult(_0x1ae0dc,_0x1b56b))[_0x9300('0x40')](handleError(_0x1ae0dc,null));};exports[_0x9300('0x41')]=function(_0x460b4d,_0x1eb860){var _0x38a66b={'raw':![],'where':{'id':_0x460b4d[_0x9300('0x42')]['id']}},_0x69e70b={};_0x69e70b[_0x9300('0x2d')]=_[_0x9300('0x2f')](db[_0x9300('0x3c')][_0x9300('0x29')]);_0x69e70b['query']=_[_0x9300('0x2f')](_0x460b4d[_0x9300('0x2e')]);_0x69e70b['filters']=_[_0x9300('0x32')](_0x69e70b[_0x9300('0x2d')],_0x69e70b[_0x9300('0x2e')]);_0x38a66b['attributes']=_['intersection'](_0x69e70b[_0x9300('0x2d')],qs['fields'](_0x460b4d['query'][_0x9300('0x33')]));_0x38a66b[_0x9300('0x31')]=_0x38a66b[_0x9300('0x31')][_0x9300('0x43')]?_0x38a66b['attributes']:_0x69e70b[_0x9300('0x2d')];if(_0x460b4d[_0x9300('0x2e')][_0x9300('0x3d')]){_0x38a66b[_0x9300('0x44')]=[{'all':!![]}];}_0x38a66b=_['merge']({},_0x38a66b,_0x460b4d[_0x9300('0x45')]);return db[_0x9300('0x3c')]['find'](_0x38a66b)[_0x9300('0x22')](handleEntityNotFound(_0x1eb860,null))[_0x9300('0x22')](respondWithResult(_0x1eb860,null))[_0x9300('0x40')](handleError(_0x1eb860,null));};exports[_0x9300('0x46')]=function(_0x5f51da,_0x397085){return db[_0x9300('0x3c')][_0x9300('0x46')](_0x5f51da['body'],{})['then'](respondWithResult(_0x397085,0xc9))[_0x9300('0x40')](handleError(_0x397085,null));};exports[_0x9300('0x47')]=function(_0x3f4931,_0x3ebd0a){if(_0x3f4931[_0x9300('0x48')]['id']){delete _0x3f4931[_0x9300('0x48')]['id'];}return db[_0x9300('0x3c')][_0x9300('0x49')]({'where':{'id':_0x3f4931['params']['id']}})[_0x9300('0x22')](handleEntityNotFound(_0x3ebd0a,null))[_0x9300('0x22')](saveUpdates(_0x3f4931['body'],null))[_0x9300('0x22')](respondWithResult(_0x3ebd0a,null))['catch'](handleError(_0x3ebd0a,null));};exports['destroy']=function(_0x555b79,_0x578882){return db['FreshsalesAccount']['find']({'where':{'id':_0x555b79[_0x9300('0x42')]['id']}})['then'](handleEntityNotFound(_0x578882,null))[_0x9300('0x22')](removeEntity(_0x578882,null))[_0x9300('0x40')](handleError(_0x578882,null));};exports['getConfigurations']=function(_0x42cf1f,_0x542db1,_0x3fea29){var _0x5c23b8={};var _0x20ff5b={};var _0x30a13d;var _0x5ac677;return db[_0x9300('0x3c')]['findOne']({'where':{'id':_0x42cf1f[_0x9300('0x42')]['id']}})[_0x9300('0x22')](handleEntityNotFound(_0x542db1,null))[_0x9300('0x22')](function(_0x29472e){if(_0x29472e){_0x30a13d=_0x29472e;_0x20ff5b[_0x9300('0x2d')]=_['keys'](db[_0x9300('0x4a')][_0x9300('0x29')]);_0x20ff5b[_0x9300('0x2e')]=_[_0x9300('0x2f')](_0x42cf1f[_0x9300('0x2e')]);_0x20ff5b['filters']=_[_0x9300('0x32')](_0x20ff5b[_0x9300('0x2d')],_0x20ff5b['query']);_0x5c23b8['attributes']=_[_0x9300('0x32')](_0x20ff5b['model'],qs[_0x9300('0x33')](_0x42cf1f[_0x9300('0x2e')][_0x9300('0x33')]));_0x5c23b8[_0x9300('0x31')]=_0x5c23b8[_0x9300('0x31')][_0x9300('0x43')]?_0x5c23b8[_0x9300('0x31')]:_0x20ff5b['model'];_0x5c23b8[_0x9300('0x35')]=qs[_0x9300('0x36')](_0x42cf1f[_0x9300('0x2e')][_0x9300('0x36')]);_0x5c23b8[_0x9300('0x39')]=qs[_0x9300('0x30')](_[_0x9300('0x37')](_0x42cf1f[_0x9300('0x2e')],_0x20ff5b[_0x9300('0x30')]));if(_0x42cf1f['query'][_0x9300('0x38')]){_0x5c23b8['where']=_[_0x9300('0x3a')](_0x5c23b8[_0x9300('0x39')],{'$or':_[_0x9300('0x28')](_0x5c23b8[_0x9300('0x31')],function(_0x1c0b44){var _0x3e7d21={};_0x3e7d21[_0x1c0b44]={'$like':'%'+_0x42cf1f[_0x9300('0x2e')][_0x9300('0x38')]+'%'};return _0x3e7d21;})});}_0x5c23b8=_['merge']({},_0x5c23b8,_0x42cf1f[_0x9300('0x45')]);return _0x30a13d[_0x9300('0x4b')](_0x5c23b8);}})[_0x9300('0x22')](function(_0x55970f){if(_0x55970f){_0x5ac677=_0x55970f[_0x9300('0x43')];if(!_0x42cf1f['query'][_0x9300('0x4c')](_0x9300('0x34'))){_0x5c23b8[_0x9300('0x1b')]=qs[_0x9300('0x1b')](_0x42cf1f['query'][_0x9300('0x1b')]);_0x5c23b8[_0x9300('0x19')]=qs[_0x9300('0x19')](_0x42cf1f[_0x9300('0x2e')][_0x9300('0x19')]);}return _0x30a13d[_0x9300('0x4b')](_0x5c23b8);}})[_0x9300('0x22')](function(_0x263344){if(_0x263344){return _0x263344?{'count':_0x5ac677,'rows':_0x263344}:null;}})[_0x9300('0x22')](respondWithResult(_0x542db1,null))[_0x9300('0x40')](handleError(_0x542db1,null));};exports['addConfiguration']=function(_0x25403d,_0x4b137c,_0x4ab7ef){if(_0x25403d[_0x9300('0x48')]['id']){delete _0x25403d[_0x9300('0x48')]['id'];}return db['FreshsalesAccount'][_0x9300('0x4d')]({'where':{'id':_0x25403d['params']['id']}})[_0x9300('0x22')](handleEntityNotFound(_0x4b137c,null))[_0x9300('0x22')](function(_0x5c414e){if(_0x5c414e){_0x25403d[_0x9300('0x48')]['AccountId']=_0x5c414e['id'];_0x25403d[_0x9300('0x48')][_0x9300('0x4e')]=integrations[_0x9300('0x4f')](_0x25403d[_0x9300('0x48')]['channel'],_0x25403d[_0x9300('0x48')]['type']);_0x25403d[_0x9300('0x48')][_0x9300('0x50')]=integrations[_0x9300('0x51')](_0x25403d[_0x9300('0x48')][_0x9300('0x52')],_0x25403d[_0x9300('0x48')][_0x9300('0x2b')]);return db[_0x9300('0x4a')][_0x9300('0x46')](_0x25403d[_0x9300('0x48')],{'include':[{'model':db[_0x9300('0x53')],'as':_0x9300('0x4e')},{'model':db['FreshsalesField'],'as':_0x9300('0x50')}]});}return null;})['then'](respondWithResult(_0x4b137c,null))[_0x9300('0x40')](handleError(_0x4b137c,null));};exports[_0x9300('0x54')]=function(_0x49bb1c,_0x4795e3,_0x522ea9){var _0x356234='';var _0x48e660='';return db[_0x9300('0x3c')][_0x9300('0x4d')]({'where':{'id':_0x49bb1c[_0x9300('0x42')]['id']},'attributes':['id',_0x9300('0x55'),'remoteUri',_0x9300('0x56')]})[_0x9300('0x22')](handleEntityNotFound(_0x4795e3,null))['then'](function(_0x5339da){if(_0x5339da){_0x48e660=_0x5339da['username'];_0x356234=_0x5339da[_0x9300('0x57')];var _0x801810=_0x5339da[_0x9300('0x57')][_0x9300('0x58')](-0x1);if(_0x801810==='/'){_0x356234=_0x356234[_0x9300('0x59')](0x0,_0x356234['lastIndexOf'](_0x801810));}return rp({'method':'GET','uri':util[_0x9300('0x5a')](_0x9300('0x5b'),_0x356234,_0x9300('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x5339da[_0x9300('0x56')]},'json':!![]});}})[_0x9300('0x22')](function(_0x2f1a82){if(_0x2f1a82){var _0x5b2b60=_0x2f1a82['users'];var _0x5affc5=![];var _0x3f8e0=null;for(_0x3f8e0=0x0;_0x3f8e0<_0x5b2b60[_0x9300('0x43')];_0x3f8e0++){if(_0x5b2b60[_0x3f8e0][_0x9300('0x5d')]===_0x48e660){_0x5affc5=!![];}}if(_0x5affc5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9300('0x5e')});}}})['then'](respondWithResult(_0x4795e3,null))[_0x9300('0x40')](function(_0x155f94){var _0x11d463=_0x49bb1c['query']['test']?0x1f4:_0x155f94[_0x9300('0x5f')]||0x1f4;logger[_0x9300('0x23')](_0x9300('0x60'),_0x9300('0x54'),_0x11d463,JSON[_0x9300('0x61')](_0x155f94));delete _0x155f94['name'];if(_0x11d463===0x191){_0x11d463=0x190;}_0x4795e3[_0x9300('0x18')](_0x11d463)[_0x9300('0x26')](_0x49bb1c['query'][_0x9300('0x62')]?{'message':_0x9300('0x63'),'statusCode':_0x155f94[_0x9300('0x5f')]}:_0x155f94);});}; \ No newline at end of file +var _0x6511=['order','sort','where','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','merge','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x17d0e5,_0x5b5e4f){var _0x22685b=function(_0x2242f5){while(--_0x2242f5){_0x17d0e5['push'](_0x17d0e5['shift']());}};_0x22685b(++_0x5b5e4f);}(_0x6511,0x8f));var _0x1651=function(_0x10b477,_0x3f5cbf){_0x10b477=_0x10b477-0x0;var _0x311ed4=_0x6511[_0x10b477];return _0x311ed4;};'use strict';var emlformat=require(_0x1651('0x0'));var rimraf=require(_0x1651('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1651('0x2'));var rp=require(_0x1651('0x3'));var moment=require(_0x1651('0x4'));var BPromise=require(_0x1651('0x5'));var Mustache=require(_0x1651('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1651('0x7'));var csv=require(_0x1651('0x8'));var ejs=require(_0x1651('0x9'));var fs=require('fs');var fs_extra=require(_0x1651('0xa'));var _=require(_0x1651('0xb'));var squel=require(_0x1651('0xc'));var crypto=require(_0x1651('0xd'));var jsforce=require(_0x1651('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1651('0x8'));var querystring=require(_0x1651('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1651('0x10'));var as=require(_0x1651('0x11'));var hardwareService=require(_0x1651('0x12'));var logger=require(_0x1651('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1651('0x14'));var licenseUtil=require(_0x1651('0x15'));var db=require(_0x1651('0x16'))['db'];var integrations=require(_0x1651('0x17'));function respondWithStatusCode(_0x318648,_0x12ac3d){_0x12ac3d=_0x12ac3d||0xcc;return function(_0x4570a7){if(_0x4570a7){return _0x318648[_0x1651('0x18')](_0x12ac3d);}return _0x318648[_0x1651('0x19')](_0x12ac3d)[_0x1651('0x1a')]();};}function respondWithResult(_0x4140e1,_0x3ad64a){_0x3ad64a=_0x3ad64a||0xc8;return function(_0x43bea9){if(_0x43bea9){return _0x4140e1['status'](_0x3ad64a)[_0x1651('0x1b')](_0x43bea9);}};}function respondWithFilteredResult(_0x4b2411,_0x420c28){return function(_0x453be2){if(_0x453be2){var _0x18b702=typeof _0x420c28[_0x1651('0x1c')]===_0x1651('0x1d')&&typeof _0x420c28[_0x1651('0x1e')]===_0x1651('0x1d');var _0x5aff55=_0x453be2[_0x1651('0x1f')];var _0x2dcd75=_0x18b702?0x0:_0x420c28[_0x1651('0x1c')];var _0x2863db=_0x18b702?_0x453be2[_0x1651('0x1f')]:_0x420c28[_0x1651('0x1c')]+_0x420c28[_0x1651('0x1e')];var _0x109db7;if(_0x2863db>=_0x5aff55){_0x2863db=_0x5aff55;_0x109db7=0xc8;}else{_0x109db7=0xce;}_0x4b2411[_0x1651('0x19')](_0x109db7);return _0x4b2411[_0x1651('0x20')](_0x1651('0x21'),_0x2dcd75+'-'+_0x2863db+'/'+_0x5aff55)[_0x1651('0x1b')](_0x453be2);}return null;};}function patchUpdates(_0x1ddd50){return function(_0x2e5f96){try{jsonpatch['apply'](_0x2e5f96,_0x1ddd50,!![]);}catch(_0x2fe380){return BPromise['reject'](_0x2fe380);}return _0x2e5f96[_0x1651('0x22')]();};}function saveUpdates(_0x30fbfb,_0x339754){return function(_0x468f35){if(_0x468f35){return _0x468f35[_0x1651('0x23')](_0x30fbfb)[_0x1651('0x24')](function(_0x3eda41){return _0x3eda41;});}return null;};}function removeEntity(_0x2f3d2e,_0x4b8443){return function(_0x5355e5){if(_0x5355e5){return _0x5355e5[_0x1651('0x25')]()[_0x1651('0x24')](function(){_0x2f3d2e[_0x1651('0x19')](0xcc)[_0x1651('0x1a')]();});}};}function handleEntityNotFound(_0x378a5a,_0x2a61f1){return function(_0x5224cf){if(!_0x5224cf){_0x378a5a['sendStatus'](0x194);}return _0x5224cf;};}function handleError(_0x1bb4ef,_0x5ecea0){_0x5ecea0=_0x5ecea0||0x1f4;return function(_0x193e80){logger[_0x1651('0x26')](_0x193e80[_0x1651('0x27')]);if(_0x193e80[_0x1651('0x28')]){delete _0x193e80['name'];}_0x1bb4ef[_0x1651('0x19')](_0x5ecea0)[_0x1651('0x29')](_0x193e80);};}exports[_0x1651('0x2a')]=function(_0x4d6d92,_0x51bf0f){var _0x146db0={},_0x58a27a={},_0x4b59e8={'count':0x0,'rows':[]};var _0x19b2df=_['map'](db[_0x1651('0x2b')][_0x1651('0x2c')],function(_0x7e666d){return{'name':_0x7e666d[_0x1651('0x2d')],'type':_0x7e666d['type'][_0x1651('0x2e')]};});_0x58a27a[_0x1651('0x2f')]=_[_0x1651('0x30')](_0x19b2df,_0x1651('0x28'));_0x58a27a['query']=_[_0x1651('0x31')](_0x4d6d92[_0x1651('0x32')]);_0x58a27a[_0x1651('0x33')]=_[_0x1651('0x34')](_0x58a27a[_0x1651('0x2f')],_0x58a27a[_0x1651('0x32')]);_0x146db0[_0x1651('0x35')]=_[_0x1651('0x34')](_0x58a27a[_0x1651('0x2f')],qs[_0x1651('0x36')](_0x4d6d92['query'][_0x1651('0x36')]));_0x146db0[_0x1651('0x35')]=_0x146db0[_0x1651('0x35')]['length']?_0x146db0[_0x1651('0x35')]:_0x58a27a[_0x1651('0x2f')];if(!_0x4d6d92[_0x1651('0x32')][_0x1651('0x37')](_0x1651('0x38'))){_0x146db0[_0x1651('0x1e')]=qs[_0x1651('0x1e')](_0x4d6d92[_0x1651('0x32')][_0x1651('0x1e')]);_0x146db0[_0x1651('0x1c')]=qs[_0x1651('0x1c')](_0x4d6d92['query']['offset']);}_0x146db0[_0x1651('0x39')]=qs[_0x1651('0x3a')](_0x4d6d92[_0x1651('0x32')][_0x1651('0x3a')]);_0x146db0[_0x1651('0x3b')]=qs['filters'](_['pick'](_0x4d6d92['query'],_0x58a27a['filters']),_0x19b2df);if(_0x4d6d92['query']['filter']){_0x146db0['where']=_['merge'](_0x146db0[_0x1651('0x3b')],{'$or':_[_0x1651('0x30')](_0x19b2df,function(_0x9f81b5){if(_0x9f81b5[_0x1651('0x3c')]!==_0x1651('0x3d')){var _0x36cc54={};_0x36cc54[_0x9f81b5[_0x1651('0x28')]]={'$like':'%'+_0x4d6d92[_0x1651('0x32')][_0x1651('0x3e')]+'%'};return _0x36cc54;}})});}_0x146db0=_['merge']({},_0x146db0,_0x4d6d92[_0x1651('0x3f')]);var _0x23db79={'where':_0x146db0[_0x1651('0x3b')]};return db[_0x1651('0x2b')][_0x1651('0x1f')](_0x23db79)[_0x1651('0x24')](function(_0x699ea){_0x4b59e8[_0x1651('0x1f')]=_0x699ea;if(_0x4d6d92[_0x1651('0x32')][_0x1651('0x40')]){_0x146db0[_0x1651('0x41')]=[{'all':!![]}];}return db[_0x1651('0x2b')]['findAll'](_0x146db0);})[_0x1651('0x24')](function(_0xf5dd78){_0x4b59e8[_0x1651('0x42')]=_0xf5dd78;return _0x4b59e8;})['then'](respondWithFilteredResult(_0x51bf0f,_0x146db0))[_0x1651('0x43')](handleError(_0x51bf0f,null));};exports[_0x1651('0x44')]=function(_0x88e879,_0x30b5bf){var _0x241f66={'raw':![],'where':{'id':_0x88e879[_0x1651('0x45')]['id']}},_0x3ffe7c={};_0x3ffe7c[_0x1651('0x2f')]=_[_0x1651('0x31')](db[_0x1651('0x2b')][_0x1651('0x2c')]);_0x3ffe7c[_0x1651('0x32')]=_[_0x1651('0x31')](_0x88e879[_0x1651('0x32')]);_0x3ffe7c[_0x1651('0x33')]=_[_0x1651('0x34')](_0x3ffe7c[_0x1651('0x2f')],_0x3ffe7c[_0x1651('0x32')]);_0x241f66[_0x1651('0x35')]=_['intersection'](_0x3ffe7c[_0x1651('0x2f')],qs[_0x1651('0x36')](_0x88e879[_0x1651('0x32')][_0x1651('0x36')]));_0x241f66[_0x1651('0x35')]=_0x241f66[_0x1651('0x35')][_0x1651('0x46')]?_0x241f66[_0x1651('0x35')]:_0x3ffe7c[_0x1651('0x2f')];if(_0x88e879['query'][_0x1651('0x40')]){_0x241f66[_0x1651('0x41')]=[{'all':!![]}];}_0x241f66=_[_0x1651('0x47')]({},_0x241f66,_0x88e879[_0x1651('0x3f')]);return db['FreshsalesAccount'][_0x1651('0x48')](_0x241f66)[_0x1651('0x24')](handleEntityNotFound(_0x30b5bf,null))[_0x1651('0x24')](respondWithResult(_0x30b5bf,null))[_0x1651('0x43')](handleError(_0x30b5bf,null));};exports[_0x1651('0x49')]=function(_0x440b75,_0x3e0640){return db[_0x1651('0x2b')][_0x1651('0x49')](_0x440b75[_0x1651('0x4a')],{})[_0x1651('0x24')](respondWithResult(_0x3e0640,0xc9))['catch'](handleError(_0x3e0640,null));};exports[_0x1651('0x23')]=function(_0x47f714,_0x54cd1b){if(_0x47f714[_0x1651('0x4a')]['id']){delete _0x47f714[_0x1651('0x4a')]['id'];}return db['FreshsalesAccount'][_0x1651('0x48')]({'where':{'id':_0x47f714[_0x1651('0x45')]['id']}})[_0x1651('0x24')](handleEntityNotFound(_0x54cd1b,null))[_0x1651('0x24')](saveUpdates(_0x47f714['body'],null))[_0x1651('0x24')](respondWithResult(_0x54cd1b,null))['catch'](handleError(_0x54cd1b,null));};exports[_0x1651('0x25')]=function(_0x123c57,_0x2a817d){return db['FreshsalesAccount']['find']({'where':{'id':_0x123c57[_0x1651('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a817d,null))[_0x1651('0x24')](removeEntity(_0x2a817d,null))['catch'](handleError(_0x2a817d,null));};exports[_0x1651('0x4b')]=function(_0x1ad423,_0xaab0f7,_0xfaee2f){var _0x56ef75={};var _0x816be2={};var _0x107fe3;var _0x93c7d4;return db[_0x1651('0x2b')][_0x1651('0x4c')]({'where':{'id':_0x1ad423[_0x1651('0x45')]['id']}})[_0x1651('0x24')](handleEntityNotFound(_0xaab0f7,null))[_0x1651('0x24')](function(_0x4eae34){if(_0x4eae34){_0x107fe3=_0x4eae34;_0x816be2[_0x1651('0x2f')]=_['keys'](db['FreshsalesConfiguration'][_0x1651('0x2c')]);_0x816be2['query']=_[_0x1651('0x31')](_0x1ad423['query']);_0x816be2['filters']=_[_0x1651('0x34')](_0x816be2['model'],_0x816be2[_0x1651('0x32')]);_0x56ef75[_0x1651('0x35')]=_[_0x1651('0x34')](_0x816be2['model'],qs[_0x1651('0x36')](_0x1ad423['query'][_0x1651('0x36')]));_0x56ef75['attributes']=_0x56ef75[_0x1651('0x35')]['length']?_0x56ef75[_0x1651('0x35')]:_0x816be2[_0x1651('0x2f')];_0x56ef75[_0x1651('0x39')]=qs['sort'](_0x1ad423[_0x1651('0x32')][_0x1651('0x3a')]);_0x56ef75[_0x1651('0x3b')]=qs['filters'](_['pick'](_0x1ad423[_0x1651('0x32')],_0x816be2[_0x1651('0x33')]));if(_0x1ad423[_0x1651('0x32')][_0x1651('0x3e')]){_0x56ef75['where']=_[_0x1651('0x47')](_0x56ef75[_0x1651('0x3b')],{'$or':_['map'](_0x56ef75['attributes'],function(_0x24036c){var _0x5233c3={};_0x5233c3[_0x24036c]={'$like':'%'+_0x1ad423[_0x1651('0x32')][_0x1651('0x3e')]+'%'};return _0x5233c3;})});}_0x56ef75=_['merge']({},_0x56ef75,_0x1ad423[_0x1651('0x3f')]);return _0x107fe3['getConfigurations'](_0x56ef75);}})[_0x1651('0x24')](function(_0x548049){if(_0x548049){_0x93c7d4=_0x548049[_0x1651('0x46')];if(!_0x1ad423[_0x1651('0x32')][_0x1651('0x37')](_0x1651('0x38'))){_0x56ef75[_0x1651('0x1e')]=qs[_0x1651('0x1e')](_0x1ad423[_0x1651('0x32')]['limit']);_0x56ef75[_0x1651('0x1c')]=qs[_0x1651('0x1c')](_0x1ad423[_0x1651('0x32')][_0x1651('0x1c')]);}return _0x107fe3[_0x1651('0x4b')](_0x56ef75);}})[_0x1651('0x24')](function(_0x50afae){if(_0x50afae){return _0x50afae?{'count':_0x93c7d4,'rows':_0x50afae}:null;}})['then'](respondWithResult(_0xaab0f7,null))['catch'](handleError(_0xaab0f7,null));};exports[_0x1651('0x4d')]=function(_0x4b0adf,_0x3f1ca3,_0x28500d){if(_0x4b0adf['body']['id']){delete _0x4b0adf[_0x1651('0x4a')]['id'];}return db['FreshsalesAccount'][_0x1651('0x4c')]({'where':{'id':_0x4b0adf[_0x1651('0x45')]['id']}})[_0x1651('0x24')](handleEntityNotFound(_0x3f1ca3,null))[_0x1651('0x24')](function(_0x19e747){if(_0x19e747){_0x4b0adf[_0x1651('0x4a')][_0x1651('0x4e')]=_0x19e747['id'];_0x4b0adf['body'][_0x1651('0x4f')]=integrations[_0x1651('0x50')](_0x4b0adf[_0x1651('0x4a')]['channel'],_0x4b0adf[_0x1651('0x4a')][_0x1651('0x3c')]);_0x4b0adf[_0x1651('0x4a')][_0x1651('0x51')]=integrations['getDescriptions'](_0x4b0adf[_0x1651('0x4a')][_0x1651('0x52')],_0x4b0adf[_0x1651('0x4a')]['type']);return db[_0x1651('0x53')][_0x1651('0x49')](_0x4b0adf[_0x1651('0x4a')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x1651('0x54')],'as':_0x1651('0x51')}]});}return null;})[_0x1651('0x24')](respondWithResult(_0x3f1ca3,null))['catch'](handleError(_0x3f1ca3,null));};exports[_0x1651('0x55')]=function(_0x47b712,_0x442735,_0x468983){var _0x1a39b5='';var _0x35904e='';return db[_0x1651('0x2b')][_0x1651('0x4c')]({'where':{'id':_0x47b712[_0x1651('0x45')]['id']},'attributes':['id',_0x1651('0x56'),_0x1651('0x57'),_0x1651('0x58')]})[_0x1651('0x24')](handleEntityNotFound(_0x442735,null))[_0x1651('0x24')](function(_0x2396a2){if(_0x2396a2){_0x35904e=_0x2396a2[_0x1651('0x56')];_0x1a39b5=_0x2396a2[_0x1651('0x57')];var _0x2f085b=_0x2396a2[_0x1651('0x57')]['slice'](-0x1);if(_0x2f085b==='/'){_0x1a39b5=_0x1a39b5['substring'](0x0,_0x1a39b5[_0x1651('0x59')](_0x2f085b));}return rp({'method':_0x1651('0x5a'),'uri':util[_0x1651('0x5b')](_0x1651('0x5c'),_0x1a39b5,_0x1651('0x5d')),'headers':{'Authorization':_0x1651('0x5e')+_0x2396a2[_0x1651('0x58')]},'json':!![]});}})[_0x1651('0x24')](function(_0x33f4ce){if(_0x33f4ce){var _0x304796=_0x33f4ce[_0x1651('0x5f')];var _0x1362d9=![];var _0x2d54df=null;for(_0x2d54df=0x0;_0x2d54df<_0x304796[_0x1651('0x46')];_0x2d54df++){if(_0x304796[_0x2d54df]['email']===_0x35904e){_0x1362d9=!![];}}if(_0x1362d9){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1651('0x60')});}}})[_0x1651('0x24')](respondWithResult(_0x442735,null))[_0x1651('0x43')](function(_0x455142){var _0x42401b=_0x47b712['query'][_0x1651('0x61')]?0x1f4:_0x455142[_0x1651('0x62')]||0x1f4;logger[_0x1651('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x42401b,JSON[_0x1651('0x63')](_0x455142));delete _0x455142[_0x1651('0x28')];if(_0x42401b===0x191){_0x42401b=0x190;}_0x442735['status'](_0x42401b)[_0x1651('0x29')](_0x47b712[_0x1651('0x32')][_0x1651('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x455142[_0x1651('0x62')]}:_0x455142);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 1ac078d..48a9ca4 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 _0x77d4=['../../components/integrations/configuration','exports','int_freshsales_accounts','util','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x33b206,_0x49bc99){var _0x34e151=function(_0x6d3c7){while(--_0x6d3c7){_0x33b206['push'](_0x33b206['shift']());}};_0x34e151(++_0x49bc99);}(_0x77d4,0x108));var _0x477d=function(_0x4e3961,_0x4aaaf3){_0x4e3961=_0x4e3961-0x0;var _0x1720ee=_0x77d4[_0x4e3961];return _0x1720ee;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));var integrations=require(_0x477d('0x6'));module[_0x477d('0x7')]=function(_0x2545e5,_0x45ca2d){return _0x2545e5['define']('FreshsalesAccount',attributes,{'tableName':_0x477d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0xd5896e,_0x3784a3){var _0x26bb39=function(_0x500be9){while(--_0x500be9){_0xd5896e['push'](_0xd5896e['shift']());}};_0x26bb39(++_0x3784a3);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));var integrations=require(_0x901d('0xa'));module['exports']=function(_0x1e5d7d,_0x6c9ac8){return _0x1e5d7d[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'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 978c466..3aab17c 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 _0x4137=['stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x517681,_0x105c7c){var _0x336a36=function(_0x50b071){while(--_0x50b071){_0x517681['push'](_0x517681['shift']());}};_0x336a36(++_0x105c7c);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['FreshsalesAccount'][_0x7413('0x18')]({'raw':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1a')]===undefined?!![]:![]:!![],'where':_0x19157f['options']?_0x19157f[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x19')]?_0x19157f[_0x7413('0x19')][_0x7413('0x1d')]||null:null,'include':_0x19157f['options']?_0x19157f['options'][_0x7413('0x1e')]?_['map'](_0x19157f[_0x7413('0x19')][_0x7413('0x1e')],function(_0x3b0c81){return{'model':db[_0x3b0c81[_0x7413('0x1f')]],'as':_0x3b0c81['as'],'attributes':_0x3b0c81[_0x7413('0x1c')],'include':_0x3b0c81[_0x7413('0x1e')]?_[_0x7413('0x20')](_0x3b0c81[_0x7413('0x1e')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x1e')]?_['map'](_0x1d455b[_0x7413('0x1e')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x1f')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7413('0x21')](function(_0x896552){logger[_0x7413('0xe')](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON['stringify'](_0x896552));_0x2a3417(_0x896552);})[_0x7413('0x22')](function(_0x4ed662){logger[_0x7413('0x13')](_0x7413('0x17'),_0x4ed662[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e[_0x7413('0x13')](0x1f4,_0x4ed662[_0x7413('0x16')]));});});};exports[_0x7413('0x23')]=function(_0x5bb3ea){var _0x1ffb6f=this;return new Promise(function(_0x17c342,_0x39db32){return db[_0x7413('0x24')][_0x7413('0x25')]({'raw':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')][_0x7413('0x1b')]||null:null,'attributes':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea[_0x7413('0x19')]['attributes']||null:null,'include':_0x5bb3ea[_0x7413('0x19')]?_0x5bb3ea['options'][_0x7413('0x1e')]?_[_0x7413('0x20')](_0x5bb3ea[_0x7413('0x19')]['include'],function(_0xe6b096){return{'model':db[_0xe6b096['model']],'as':_0xe6b096['as'],'attributes':_0xe6b096[_0x7413('0x1c')],'include':_0xe6b096[_0x7413('0x1e')]?_['map'](_0xe6b096['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x1f')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x1c')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x1e')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ad12d){logger[_0x7413('0xe')](_0x7413('0x23'),_0x5bb3ea);logger[_0x7413('0x10')](_0x7413('0x23'),_0x5bb3ea,JSON['stringify'](_0x3ad12d));_0x17c342(_0x3ad12d);})[_0x7413('0x22')](function(_0x8dc047){logger[_0x7413('0x13')](_0x7413('0x23'),_0x8dc047[_0x7413('0x16')],_0x5bb3ea);_0x39db32(_0x1ffb6f[_0x7413('0x13')](0x1f4,_0x8dc047[_0x7413('0x16')]));});});}; \ No newline at end of file +var _0x4bd3=['where','attributes','limit','include','model','map','stringify','find','ShowFreshsalesAccount','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x4bd3,0x174));var _0x34bd=function(_0x59f924,_0x3a0889){_0x59f924=_0x59f924-0x0;var _0x4d1882=_0x4bd3[_0x59f924];return _0x4d1882;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});}exports[_0x34bd('0x13')]=function(_0x3b4bf8){var _0x72b197=this;return new Promise(function(_0x4b5ebb,_0x48d2ba){return db[_0x34bd('0x14')][_0x34bd('0x15')]({'raw':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options'][_0x34bd('0x19')]||null:null,'limit':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x1a')]||null:null,'include':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options']['include']?_['map'](_0x3b4bf8['options'][_0x34bd('0x1b')],function(_0x503a60){return{'model':db[_0x503a60[_0x34bd('0x1c')]],'as':_0x503a60['as'],'attributes':_0x503a60[_0x34bd('0x19')],'include':_0x503a60[_0x34bd('0x1b')]?_['map'](_0x503a60[_0x34bd('0x1b')],function(_0x14479a){return{'model':db[_0x14479a[_0x34bd('0x1c')]],'as':_0x14479a['as'],'attributes':_0x14479a[_0x34bd('0x19')],'include':_0x14479a['include']?_[_0x34bd('0x1d')](_0x14479a[_0x34bd('0x1b')],function(_0x264c94){return{'model':db[_0x264c94[_0x34bd('0x1c')]],'as':_0x264c94['as'],'attributes':_0x264c94['attributes']};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x3fe8b0){logger['info'](_0x34bd('0x13'),_0x3b4bf8);logger[_0x34bd('0xc')](_0x34bd('0x13'),_0x3b4bf8,JSON[_0x34bd('0x1e')](_0x3fe8b0));_0x4b5ebb(_0x3fe8b0);})[_0x34bd('0x12')](function(_0x4500c8){logger[_0x34bd('0xe')]('GetFreshsalesAccount',_0x4500c8[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x4500c8['message']));});});};exports['ShowFreshsalesAccount']=function(_0x38bdba){var _0xca9897=this;return new Promise(function(_0xd176f7,_0x536b2c){return db['FreshsalesAccount'][_0x34bd('0x1f')]({'raw':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x38bdba['options']?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x19')]||null:null,'include':_0x38bdba[_0x34bd('0x16')]?_0x38bdba['options'][_0x34bd('0x1b')]?_['map'](_0x38bdba[_0x34bd('0x16')][_0x34bd('0x1b')],function(_0xf12ee6){return{'model':db[_0xf12ee6['model']],'as':_0xf12ee6['as'],'attributes':_0xf12ee6[_0x34bd('0x19')],'include':_0xf12ee6[_0x34bd('0x1b')]?_['map'](_0xf12ee6[_0x34bd('0x1b')],function(_0x21c7d6){return{'model':db[_0x21c7d6[_0x34bd('0x1c')]],'as':_0x21c7d6['as'],'attributes':_0x21c7d6['attributes'],'include':_0x21c7d6[_0x34bd('0x1b')]?_[_0x34bd('0x1d')](_0x21c7d6['include'],function(_0x117188){return{'model':db[_0x117188[_0x34bd('0x1c')]],'as':_0x117188['as'],'attributes':_0x117188[_0x34bd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x320643){logger[_0x34bd('0xa')]('ShowFreshsalesAccount',_0x38bdba);logger['debug']('ShowFreshsalesAccount',_0x38bdba,JSON[_0x34bd('0x1e')](_0x320643));_0xd176f7(_0x320643);})[_0x34bd('0x12')](function(_0x5e30c5){logger['error'](_0x34bd('0x20'),_0x5e30c5['message'],_0x38bdba);_0x536b2c(_0xca9897['error'](0x1f4,_0x5e30c5[_0x34bd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 5d8da0c..c5aaab7 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 _0x5bd6=['get','/:id','show','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','index'];(function(_0x202b8e,_0xd9f859){var _0x3beb83=function(_0xefda90){while(--_0xefda90){_0x202b8e['push'](_0x202b8e['shift']());}};_0x3beb83(++_0xd9f859);}(_0x5bd6,0xfd));var _0x65bd=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x5bd6[_0x271537];return _0x19dc22;};'use strict';var multer=require(_0x65bd('0x0'));var util=require(_0x65bd('0x1'));var path=require(_0x65bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x65bd('0x3'));var router=express[_0x65bd('0x4')]();var fs_extra=require(_0x65bd('0x5'));var auth=require(_0x65bd('0x6'));var interaction=require(_0x65bd('0x7'));var config=require('../../config/environment');var controller=require(_0x65bd('0x8'));router['get']('/',auth[_0x65bd('0x9')](),controller[_0x65bd('0xa')]);router[_0x65bd('0xb')](_0x65bd('0xc'),auth[_0x65bd('0x9')](),controller[_0x65bd('0xd')]);router[_0x65bd('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x65bd('0xe')]);router[_0x65bd('0xb')](_0x65bd('0xf'),auth[_0x65bd('0x9')](),controller[_0x65bd('0x10')]);router[_0x65bd('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x65bd('0x9')](),controller[_0x65bd('0x11')]);router[_0x65bd('0x12')](_0x65bd('0xc'),auth[_0x65bd('0x9')](),controller[_0x65bd('0x13')]);router[_0x65bd('0x14')](_0x65bd('0xc'),auth[_0x65bd('0x9')](),controller[_0x65bd('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcc0a=['isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcc0a,0xc0));var _0xacc0=function(_0x148b6a,_0x5f41e3){_0x148b6a=_0x148b6a-0x0;var _0x2a59b8=_0xcc0a[_0x148b6a];return _0x2a59b8;};'use strict';var multer=require('multer');var util=require(_0xacc0('0x0'));var path=require(_0xacc0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xacc0('0x2')]();var fs_extra=require(_0xacc0('0x3'));var auth=require(_0xacc0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xacc0('0x5'));var controller=require(_0xacc0('0x6'));router[_0xacc0('0x7')]('/',auth[_0xacc0('0x8')](),controller[_0xacc0('0x9')]);router[_0xacc0('0x7')](_0xacc0('0xa'),auth[_0xacc0('0x8')](),controller[_0xacc0('0xb')]);router[_0xacc0('0x7')](_0xacc0('0xc'),auth[_0xacc0('0x8')](),controller[_0xacc0('0xd')]);router[_0xacc0('0x7')](_0xacc0('0xe'),auth[_0xacc0('0x8')](),controller[_0xacc0('0xf')]);router[_0xacc0('0x7')](_0xacc0('0x10'),auth[_0xacc0('0x8')](),controller[_0xacc0('0x11')]);router[_0xacc0('0x12')]('/',auth[_0xacc0('0x8')](),controller[_0xacc0('0x13')]);router[_0xacc0('0x14')](_0xacc0('0xa'),auth[_0xacc0('0x8')](),controller[_0xacc0('0x15')]);router[_0xacc0('0x16')](_0xacc0('0xa'),auth[_0xacc0('0x8')](),controller[_0xacc0('0x17')]);module[_0xacc0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index dcd0c91..39604d6 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 _0xfefd=['exports','STRING','sequelize'];(function(_0x1bab58,_0x393c11){var _0xdc323b=function(_0x3e125f){while(--_0x3e125f){_0x1bab58['push'](_0x1bab58['shift']());}};_0xdc323b(++_0x393c11);}(_0xfefd,0x128));var _0xdfef=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xfefd[_0x888385];return _0x22d5c2;};'use strict';var Sequelize=require(_0xdfef('0x0'));module[_0xdfef('0x1')]={'name':{'type':Sequelize[_0xdfef('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe7dd=['exports','STRING','sequelize'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xe7dd,0xd1));var _0xde7d=function(_0x4d7b67,_0x5b3c9f){_0x4d7b67=_0x4d7b67-0x0;var _0x2d85e6=_0xe7dd[_0x4d7b67];return _0x2d85e6;};'use strict';var Sequelize=require(_0xde7d('0x0'));module[_0xde7d('0x1')]={'name':{'type':Sequelize[_0xde7d('0x2')]},'description':{'type':Sequelize[_0xde7d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index cedb140..52c99c1 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 _0x3050=['where','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','destroy','findOne','getSubjects','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','end','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3050,0x69));var _0x0305=function(_0x23e8a2,_0x42cf10){_0x23e8a2=_0x23e8a2-0x0;var _0x3d9fe4=_0x3050[_0x23e8a2];return _0x3d9fe4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0305('0x0'));var zipdir=require(_0x0305('0x1'));var jsonpatch=require(_0x0305('0x2'));var rp=require(_0x0305('0x3'));var moment=require(_0x0305('0x4'));var BPromise=require(_0x0305('0x5'));var Mustache=require(_0x0305('0x6'));var util=require(_0x0305('0x7'));var path=require(_0x0305('0x8'));var sox=require(_0x0305('0x9'));var csv=require(_0x0305('0xa'));var ejs=require(_0x0305('0xb'));var fs=require('fs');var fs_extra=require(_0x0305('0xc'));var _=require(_0x0305('0xd'));var squel=require(_0x0305('0xe'));var crypto=require(_0x0305('0xf'));var jsforce=require(_0x0305('0x10'));var deskjs=require(_0x0305('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0305('0x12'));var Papa=require(_0x0305('0x13'));var Redis=require(_0x0305('0x14'));var authService=require(_0x0305('0x15'));var qs=require(_0x0305('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0305('0x17'));var logger=require(_0x0305('0x18'))(_0x0305('0x19'));var utils=require(_0x0305('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0305('0x1b'))['db'];function respondWithStatusCode(_0x3b3a7d,_0x41b72b){_0x41b72b=_0x41b72b||0xcc;return function(_0x1e80aa){if(_0x1e80aa){return _0x3b3a7d[_0x0305('0x1c')](_0x41b72b);}return _0x3b3a7d['status'](_0x41b72b)['end']();};}function respondWithResult(_0x19f635,_0x35c86f){_0x35c86f=_0x35c86f||0xc8;return function(_0x15b294){if(_0x15b294){return _0x19f635[_0x0305('0x1d')](_0x35c86f)['json'](_0x15b294);}};}function respondWithFilteredResult(_0x260be1,_0x380319){return function(_0x397571){if(_0x397571){var _0x5ae5eb=typeof _0x380319['offset']===_0x0305('0x1e')&&typeof _0x380319[_0x0305('0x1f')]==='undefined';var _0x1df8d4=_0x397571[_0x0305('0x20')];var _0x552e82=_0x5ae5eb?0x0:_0x380319[_0x0305('0x21')];var _0x49d92e=_0x5ae5eb?_0x397571[_0x0305('0x20')]:_0x380319['offset']+_0x380319['limit'];var _0x48f447;if(_0x49d92e>=_0x1df8d4){_0x49d92e=_0x1df8d4;_0x48f447=0xc8;}else{_0x48f447=0xce;}_0x260be1[_0x0305('0x1d')](_0x48f447);return _0x260be1[_0x0305('0x22')](_0x0305('0x23'),_0x552e82+'-'+_0x49d92e+'/'+_0x1df8d4)[_0x0305('0x24')](_0x397571);}return null;};}function patchUpdates(_0x1aa36c){return function(_0x16bd42){try{jsonpatch['apply'](_0x16bd42,_0x1aa36c,!![]);}catch(_0x5dda51){return BPromise[_0x0305('0x25')](_0x5dda51);}return _0x16bd42[_0x0305('0x26')]();};}function saveUpdates(_0x29e919,_0x276d34){return function(_0x45f107){if(_0x45f107){return _0x45f107['update'](_0x29e919)[_0x0305('0x27')](function(_0x51410a){return _0x51410a;});}return null;};}function removeEntity(_0x1c8b4a,_0x21939a){return function(_0x516da2){if(_0x516da2){return _0x516da2['destroy']()[_0x0305('0x27')](function(){_0x1c8b4a[_0x0305('0x1d')](0xcc)[_0x0305('0x28')]();});}};}function handleEntityNotFound(_0x58affd,_0x4bb03b){return function(_0x1ee02c){if(!_0x1ee02c){_0x58affd['sendStatus'](0x194);}return _0x1ee02c;};}function handleError(_0x4bbd05,_0x391495){_0x391495=_0x391495||0x1f4;return function(_0xd46c9c){logger['error'](_0xd46c9c[_0x0305('0x29')]);if(_0xd46c9c[_0x0305('0x2a')]){delete _0xd46c9c[_0x0305('0x2a')];}_0x4bbd05['status'](_0x391495)[_0x0305('0x2b')](_0xd46c9c);};}exports[_0x0305('0x2c')]=function(_0x23c994,_0x5ba8a0){var _0x34cc11={},_0x48e581={},_0x5a2623={'count':0x0,'rows':[]};var _0x1998a2=_[_0x0305('0x2d')](db[_0x0305('0x2e')][_0x0305('0x2f')],function(_0x20c844){return{'name':_0x20c844['fieldName'],'type':_0x20c844[_0x0305('0x30')][_0x0305('0x31')]};});_0x48e581[_0x0305('0x32')]=_[_0x0305('0x2d')](_0x1998a2,_0x0305('0x2a'));_0x48e581[_0x0305('0x33')]=_[_0x0305('0x34')](_0x23c994[_0x0305('0x33')]);_0x48e581[_0x0305('0x35')]=_['intersection'](_0x48e581[_0x0305('0x32')],_0x48e581[_0x0305('0x33')]);_0x34cc11[_0x0305('0x36')]=_[_0x0305('0x37')](_0x48e581['model'],qs[_0x0305('0x38')](_0x23c994[_0x0305('0x33')]['fields']));_0x34cc11[_0x0305('0x36')]=_0x34cc11[_0x0305('0x36')][_0x0305('0x39')]?_0x34cc11[_0x0305('0x36')]:_0x48e581['model'];if(!_0x23c994[_0x0305('0x33')][_0x0305('0x3a')](_0x0305('0x3b'))){_0x34cc11['limit']=qs[_0x0305('0x1f')](_0x23c994['query'][_0x0305('0x1f')]);_0x34cc11[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x23c994[_0x0305('0x33')][_0x0305('0x21')]);}_0x34cc11[_0x0305('0x3c')]=qs['sort'](_0x23c994['query'][_0x0305('0x3d')]);_0x34cc11['where']=qs['filters'](_[_0x0305('0x3e')](_0x23c994[_0x0305('0x33')],_0x48e581[_0x0305('0x35')]),_0x1998a2);if(_0x23c994[_0x0305('0x33')]['filter']){_0x34cc11[_0x0305('0x3f')]=_[_0x0305('0x40')](_0x34cc11[_0x0305('0x3f')],{'$or':_[_0x0305('0x2d')](_0x1998a2,function(_0x31136b){if(_0x31136b[_0x0305('0x30')]!=='VIRTUAL'){var _0x52b99c={};_0x52b99c[_0x31136b['name']]={'$like':'%'+_0x23c994[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x52b99c;}})});}_0x34cc11=_[_0x0305('0x40')]({},_0x34cc11,_0x23c994[_0x0305('0x42')]);var _0x460dd4={'where':_0x34cc11[_0x0305('0x3f')]};return db[_0x0305('0x2e')][_0x0305('0x20')](_0x460dd4)[_0x0305('0x27')](function(_0x73fffc){_0x5a2623['count']=_0x73fffc;if(_0x23c994['query']['includeAll']){_0x34cc11[_0x0305('0x43')]=[{'all':!![]}];}return db[_0x0305('0x2e')][_0x0305('0x44')](_0x34cc11);})['then'](function(_0x58d5f2){_0x5a2623[_0x0305('0x45')]=_0x58d5f2;return _0x5a2623;})[_0x0305('0x27')](respondWithFilteredResult(_0x5ba8a0,_0x34cc11))[_0x0305('0x46')](handleError(_0x5ba8a0,null));};exports[_0x0305('0x47')]=function(_0x4754b8,_0x369a37){var _0x576e14={'raw':![],'where':{'id':_0x4754b8[_0x0305('0x48')]['id']}},_0x37aacc={};_0x37aacc['model']=_['keys'](db['FreshsalesConfiguration'][_0x0305('0x2f')]);_0x37aacc[_0x0305('0x33')]=_['keys'](_0x4754b8[_0x0305('0x33')]);_0x37aacc[_0x0305('0x35')]=_[_0x0305('0x37')](_0x37aacc[_0x0305('0x32')],_0x37aacc['query']);_0x576e14['attributes']=_[_0x0305('0x37')](_0x37aacc[_0x0305('0x32')],qs['fields'](_0x4754b8[_0x0305('0x33')]['fields']));_0x576e14['attributes']=_0x576e14['attributes']['length']?_0x576e14[_0x0305('0x36')]:_0x37aacc[_0x0305('0x32')];if(_0x4754b8[_0x0305('0x33')][_0x0305('0x49')]){_0x576e14[_0x0305('0x43')]=[{'all':!![]}];}_0x576e14=_[_0x0305('0x40')]({},_0x576e14,_0x4754b8[_0x0305('0x42')]);return db[_0x0305('0x2e')][_0x0305('0x4a')](_0x576e14)[_0x0305('0x27')](handleEntityNotFound(_0x369a37,null))[_0x0305('0x27')](respondWithResult(_0x369a37,null))[_0x0305('0x46')](handleError(_0x369a37,null));};exports[_0x0305('0x4b')]=function(_0x17d5bb,_0x94cde0){return db[_0x0305('0x2e')]['create'](_0x17d5bb[_0x0305('0x4c')],{})[_0x0305('0x27')](respondWithResult(_0x94cde0,0xc9))[_0x0305('0x46')](handleError(_0x94cde0,null));};exports[_0x0305('0x4d')]=function(_0x586eea,_0x4a09af){if(_0x586eea['body']['id']){delete _0x586eea[_0x0305('0x4c')]['id'];}return db[_0x0305('0x2e')]['find']({'where':{'id':_0x586eea[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0x4a09af,null))[_0x0305('0x27')](saveUpdates(_0x586eea[_0x0305('0x4c')],null))[_0x0305('0x27')](respondWithResult(_0x4a09af,null))[_0x0305('0x46')](handleError(_0x4a09af,null));};exports[_0x0305('0x4e')]=function(_0x4bc286,_0x31c4ce){return db['FreshsalesConfiguration'][_0x0305('0x4a')]({'where':{'id':_0x4bc286[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0x31c4ce,null))[_0x0305('0x27')](removeEntity(_0x31c4ce,null))['catch'](handleError(_0x31c4ce,null));};exports['getSubjects']=function(_0x5b67d4,_0x30ef64,_0x1d350d){var _0x14340d={};var _0x50b7cb={};var _0x2c19aa;var _0x11d71b;return db[_0x0305('0x2e')][_0x0305('0x4f')]({'where':{'id':_0x5b67d4[_0x0305('0x48')]['id']}})['then'](handleEntityNotFound(_0x30ef64,null))[_0x0305('0x27')](function(_0x489c84){if(_0x489c84){_0x2c19aa=_0x489c84;_0x50b7cb[_0x0305('0x32')]=_['keys'](db['FreshsalesField'][_0x0305('0x2f')]);_0x50b7cb['query']=_['keys'](_0x5b67d4['query']);_0x50b7cb[_0x0305('0x35')]=_[_0x0305('0x37')](_0x50b7cb[_0x0305('0x32')],_0x50b7cb[_0x0305('0x33')]);_0x14340d[_0x0305('0x36')]=_['intersection'](_0x50b7cb['model'],qs[_0x0305('0x38')](_0x5b67d4[_0x0305('0x33')][_0x0305('0x38')]));_0x14340d[_0x0305('0x36')]=_0x14340d[_0x0305('0x36')][_0x0305('0x39')]?_0x14340d['attributes']:_0x50b7cb[_0x0305('0x32')];_0x14340d[_0x0305('0x3c')]=qs['sort'](_0x5b67d4[_0x0305('0x33')][_0x0305('0x3d')]);_0x14340d[_0x0305('0x3f')]=qs[_0x0305('0x35')](_[_0x0305('0x3e')](_0x5b67d4['query'],_0x50b7cb[_0x0305('0x35')]));if(_0x5b67d4[_0x0305('0x33')][_0x0305('0x41')]){_0x14340d[_0x0305('0x3f')]=_[_0x0305('0x40')](_0x14340d[_0x0305('0x3f')],{'$or':_[_0x0305('0x2d')](_0x14340d[_0x0305('0x36')],function(_0x418cc3){var _0x578c33={};_0x578c33[_0x418cc3]={'$like':'%'+_0x5b67d4[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x578c33;})});}_0x14340d=_[_0x0305('0x40')]({},_0x14340d,_0x5b67d4['options']);return _0x2c19aa['getSubjects'](_0x14340d);}})[_0x0305('0x27')](function(_0x384f48){if(_0x384f48){_0x11d71b=_0x384f48[_0x0305('0x39')];if(!_0x5b67d4[_0x0305('0x33')][_0x0305('0x3a')](_0x0305('0x3b'))){_0x14340d[_0x0305('0x1f')]=qs[_0x0305('0x1f')](_0x5b67d4[_0x0305('0x33')][_0x0305('0x1f')]);_0x14340d[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x5b67d4[_0x0305('0x33')][_0x0305('0x21')]);}return _0x2c19aa[_0x0305('0x50')](_0x14340d);}})[_0x0305('0x27')](function(_0x31dd67){if(_0x31dd67){return _0x31dd67?{'count':_0x11d71b,'rows':_0x31dd67}:null;}})[_0x0305('0x27')](respondWithResult(_0x30ef64,null))[_0x0305('0x46')](handleError(_0x30ef64,null));};exports['getDescriptions']=function(_0x45faff,_0xb8218e,_0x75579b){var _0xc1e76={};var _0x3b3bce={};var _0x11cb83;var _0x4a48f;return db['FreshsalesConfiguration'][_0x0305('0x4f')]({'where':{'id':_0x45faff[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0xb8218e,null))[_0x0305('0x27')](function(_0x5b6984){if(_0x5b6984){_0x11cb83=_0x5b6984;_0x3b3bce[_0x0305('0x32')]=_['keys'](db[_0x0305('0x51')][_0x0305('0x2f')]);_0x3b3bce[_0x0305('0x33')]=_[_0x0305('0x34')](_0x45faff[_0x0305('0x33')]);_0x3b3bce['filters']=_[_0x0305('0x37')](_0x3b3bce['model'],_0x3b3bce['query']);_0xc1e76[_0x0305('0x36')]=_[_0x0305('0x37')](_0x3b3bce['model'],qs[_0x0305('0x38')](_0x45faff[_0x0305('0x33')][_0x0305('0x38')]));_0xc1e76[_0x0305('0x36')]=_0xc1e76[_0x0305('0x36')][_0x0305('0x39')]?_0xc1e76[_0x0305('0x36')]:_0x3b3bce[_0x0305('0x32')];_0xc1e76[_0x0305('0x3c')]=qs['sort'](_0x45faff[_0x0305('0x33')][_0x0305('0x3d')]);_0xc1e76[_0x0305('0x3f')]=qs[_0x0305('0x35')](_['pick'](_0x45faff['query'],_0x3b3bce['filters']));if(_0x45faff[_0x0305('0x33')][_0x0305('0x41')]){_0xc1e76['where']=_['merge'](_0xc1e76[_0x0305('0x3f')],{'$or':_['map'](_0xc1e76[_0x0305('0x36')],function(_0x5221a5){var _0x45319d={};_0x45319d[_0x5221a5]={'$like':'%'+_0x45faff[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x45319d;})});}_0xc1e76=_[_0x0305('0x40')]({},_0xc1e76,_0x45faff[_0x0305('0x42')]);return _0x11cb83[_0x0305('0x52')](_0xc1e76);}})[_0x0305('0x27')](function(_0x5f1465){if(_0x5f1465){_0x4a48f=_0x5f1465[_0x0305('0x39')];if(!_0x45faff['query'][_0x0305('0x3a')]('nolimit')){_0xc1e76[_0x0305('0x1f')]=qs[_0x0305('0x1f')](_0x45faff[_0x0305('0x33')][_0x0305('0x1f')]);_0xc1e76[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x45faff[_0x0305('0x33')]['offset']);}return _0x11cb83['getDescriptions'](_0xc1e76);}})['then'](function(_0x3ab6e7){if(_0x3ab6e7){return _0x3ab6e7?{'count':_0x4a48f,'rows':_0x3ab6e7}:null;}})[_0x0305('0x27')](respondWithResult(_0xb8218e,null))[_0x0305('0x46')](handleError(_0xb8218e,null));};exports[_0x0305('0x53')]=function(_0x2109b1,_0x135513,_0x5f1dd9){var _0x3b34ae={};var _0x192711={};var _0x4543a9;var _0x5053d7;return db[_0x0305('0x2e')][_0x0305('0x4f')]({'where':{'id':_0x2109b1[_0x0305('0x48')]['id']}})[_0x0305('0x27')](handleEntityNotFound(_0x135513,null))['then'](function(_0x1d24ec){if(_0x1d24ec){_0x4543a9=_0x1d24ec;_0x192711['model']=_[_0x0305('0x34')](db[_0x0305('0x51')][_0x0305('0x2f')]);_0x192711[_0x0305('0x33')]=_['keys'](_0x2109b1[_0x0305('0x33')]);_0x192711[_0x0305('0x35')]=_[_0x0305('0x37')](_0x192711[_0x0305('0x32')],_0x192711['query']);_0x3b34ae[_0x0305('0x36')]=_[_0x0305('0x37')](_0x192711[_0x0305('0x32')],qs[_0x0305('0x38')](_0x2109b1[_0x0305('0x33')]['fields']));_0x3b34ae[_0x0305('0x36')]=_0x3b34ae[_0x0305('0x36')]['length']?_0x3b34ae[_0x0305('0x36')]:_0x192711[_0x0305('0x32')];_0x3b34ae['order']=qs[_0x0305('0x3d')](_0x2109b1[_0x0305('0x33')][_0x0305('0x3d')]);_0x3b34ae[_0x0305('0x3f')]=qs['filters'](_['pick'](_0x2109b1[_0x0305('0x33')],_0x192711[_0x0305('0x35')]));if(_0x2109b1[_0x0305('0x33')][_0x0305('0x41')]){_0x3b34ae['where']=_[_0x0305('0x40')](_0x3b34ae['where'],{'$or':_['map'](_0x3b34ae['attributes'],function(_0xb2484c){var _0x16ce70={};_0x16ce70[_0xb2484c]={'$like':'%'+_0x2109b1[_0x0305('0x33')][_0x0305('0x41')]+'%'};return _0x16ce70;})});}_0x3b34ae=_[_0x0305('0x40')]({},_0x3b34ae,_0x2109b1[_0x0305('0x42')]);return _0x4543a9['getFields'](_0x3b34ae);}})[_0x0305('0x27')](function(_0x21ec66){if(_0x21ec66){_0x5053d7=_0x21ec66[_0x0305('0x39')];if(!_0x2109b1[_0x0305('0x33')][_0x0305('0x3a')](_0x0305('0x3b'))){_0x3b34ae[_0x0305('0x1f')]=qs[_0x0305('0x1f')](_0x2109b1['query']['limit']);_0x3b34ae[_0x0305('0x21')]=qs[_0x0305('0x21')](_0x2109b1[_0x0305('0x33')][_0x0305('0x21')]);}return _0x4543a9['getFields'](_0x3b34ae);}})[_0x0305('0x27')](function(_0x4eafcf){if(_0x4eafcf){return _0x4eafcf?{'count':_0x5053d7,'rows':_0x4eafcf}:null;}})['then'](respondWithResult(_0x135513,null))[_0x0305('0x46')](handleError(_0x135513,null));}; \ No newline at end of file +var _0xf1d7=['moment','bluebird','util','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/environment','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','destroy','then','end','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','getSubjects','findOne','FreshsalesField','limit','getDescriptions','params','eml-format','rimraf','zip-dir'];(function(_0x4c8600,_0x2bb8f7){var _0x1399a5=function(_0x212e8d){while(--_0x212e8d){_0x4c8600['push'](_0x4c8600['shift']());}};_0x1399a5(++_0x2bb8f7);}(_0xf1d7,0x17e));var _0x7f1d=function(_0x215764,_0x3229cc){_0x215764=_0x215764-0x0;var _0x156ad1=_0xf1d7[_0x215764];return _0x156ad1;};'use strict';var emlformat=require(_0x7f1d('0x0'));var rimraf=require(_0x7f1d('0x1'));var zipdir=require(_0x7f1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7f1d('0x3'));var BPromise=require(_0x7f1d('0x4'));var Mustache=require('mustache');var util=require(_0x7f1d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7f1d('0x6'));var ejs=require(_0x7f1d('0x7'));var fs=require('fs');var fs_extra=require(_0x7f1d('0x8'));var _=require('lodash');var squel=require(_0x7f1d('0x9'));var crypto=require(_0x7f1d('0xa'));var jsforce=require(_0x7f1d('0xb'));var deskjs=require(_0x7f1d('0xc'));var toCsv=require(_0x7f1d('0x6'));var querystring=require('querystring');var Papa=require(_0x7f1d('0xd'));var Redis=require(_0x7f1d('0xe'));var authService=require(_0x7f1d('0xf'));var qs=require(_0x7f1d('0x10'));var as=require(_0x7f1d('0x11'));var hardwareService=require(_0x7f1d('0x12'));var logger=require(_0x7f1d('0x13'))(_0x7f1d('0x14'));var utils=require(_0x7f1d('0x15'));var config=require(_0x7f1d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120977,_0x233c7e){_0x233c7e=_0x233c7e||0xcc;return function(_0x32f617){if(_0x32f617){return _0x120977[_0x7f1d('0x17')](_0x233c7e);}return _0x120977[_0x7f1d('0x18')](_0x233c7e)['end']();};}function respondWithResult(_0x221058,_0x401c81){_0x401c81=_0x401c81||0xc8;return function(_0x4e4602){if(_0x4e4602){return _0x221058['status'](_0x401c81)[_0x7f1d('0x19')](_0x4e4602);}};}function respondWithFilteredResult(_0x4db43c,_0x268214){return function(_0x3cdf3b){if(_0x3cdf3b){var _0x233b9e=typeof _0x268214[_0x7f1d('0x1a')]===_0x7f1d('0x1b')&&typeof _0x268214['limit']==='undefined';var _0x5b8b87=_0x3cdf3b[_0x7f1d('0x1c')];var _0xe8ee=_0x233b9e?0x0:_0x268214['offset'];var _0x2e0fd0=_0x233b9e?_0x3cdf3b['count']:_0x268214['offset']+_0x268214['limit'];var _0x561023;if(_0x2e0fd0>=_0x5b8b87){_0x2e0fd0=_0x5b8b87;_0x561023=0xc8;}else{_0x561023=0xce;}_0x4db43c[_0x7f1d('0x18')](_0x561023);return _0x4db43c['set'](_0x7f1d('0x1d'),_0xe8ee+'-'+_0x2e0fd0+'/'+_0x5b8b87)[_0x7f1d('0x19')](_0x3cdf3b);}return null;};}function patchUpdates(_0x214a36){return function(_0xb04ddc){try{jsonpatch[_0x7f1d('0x1e')](_0xb04ddc,_0x214a36,!![]);}catch(_0x1aef2f){return BPromise[_0x7f1d('0x1f')](_0x1aef2f);}return _0xb04ddc['save']();};}function saveUpdates(_0x3ef891,_0xa91517){return function(_0x55e006){if(_0x55e006){return _0x55e006['update'](_0x3ef891)['then'](function(_0x1599ad){return _0x1599ad;});}return null;};}function removeEntity(_0x4b1134,_0xbfc514){return function(_0x48d181){if(_0x48d181){return _0x48d181[_0x7f1d('0x20')]()[_0x7f1d('0x21')](function(){_0x4b1134[_0x7f1d('0x18')](0xcc)[_0x7f1d('0x22')]();});}};}function handleEntityNotFound(_0x35ac09,_0x2b6f68){return function(_0x446854){if(!_0x446854){_0x35ac09[_0x7f1d('0x17')](0x194);}return _0x446854;};}function handleError(_0x2b853d,_0x389b74){_0x389b74=_0x389b74||0x1f4;return function(_0xecf0e5){logger['error'](_0xecf0e5[_0x7f1d('0x23')]);if(_0xecf0e5[_0x7f1d('0x24')]){delete _0xecf0e5[_0x7f1d('0x24')];}_0x2b853d[_0x7f1d('0x18')](_0x389b74)[_0x7f1d('0x25')](_0xecf0e5);};}exports[_0x7f1d('0x26')]=function(_0x15577e,_0x1d6abf){var _0x5d718f={},_0x42449d={},_0x130178={'count':0x0,'rows':[]};var _0x1c9607=_[_0x7f1d('0x27')](db[_0x7f1d('0x28')][_0x7f1d('0x29')],function(_0x597843){return{'name':_0x597843[_0x7f1d('0x2a')],'type':_0x597843[_0x7f1d('0x2b')][_0x7f1d('0x2c')]};});_0x42449d[_0x7f1d('0x2d')]=_['map'](_0x1c9607,'name');_0x42449d['query']=_[_0x7f1d('0x2e')](_0x15577e[_0x7f1d('0x2f')]);_0x42449d[_0x7f1d('0x30')]=_[_0x7f1d('0x31')](_0x42449d[_0x7f1d('0x2d')],_0x42449d[_0x7f1d('0x2f')]);_0x5d718f['attributes']=_[_0x7f1d('0x31')](_0x42449d[_0x7f1d('0x2d')],qs[_0x7f1d('0x32')](_0x15577e[_0x7f1d('0x2f')][_0x7f1d('0x32')]));_0x5d718f[_0x7f1d('0x33')]=_0x5d718f['attributes'][_0x7f1d('0x34')]?_0x5d718f[_0x7f1d('0x33')]:_0x42449d[_0x7f1d('0x2d')];if(!_0x15577e['query'][_0x7f1d('0x35')](_0x7f1d('0x36'))){_0x5d718f['limit']=qs['limit'](_0x15577e[_0x7f1d('0x2f')]['limit']);_0x5d718f['offset']=qs[_0x7f1d('0x1a')](_0x15577e[_0x7f1d('0x2f')][_0x7f1d('0x1a')]);}_0x5d718f[_0x7f1d('0x37')]=qs['sort'](_0x15577e['query'][_0x7f1d('0x38')]);_0x5d718f[_0x7f1d('0x39')]=qs[_0x7f1d('0x30')](_[_0x7f1d('0x3a')](_0x15577e[_0x7f1d('0x2f')],_0x42449d[_0x7f1d('0x30')]),_0x1c9607);if(_0x15577e[_0x7f1d('0x2f')][_0x7f1d('0x3b')]){_0x5d718f[_0x7f1d('0x39')]=_[_0x7f1d('0x3c')](_0x5d718f[_0x7f1d('0x39')],{'$or':_[_0x7f1d('0x27')](_0x1c9607,function(_0x2a6323){if(_0x2a6323[_0x7f1d('0x2b')]!=='VIRTUAL'){var _0xb4835e={};_0xb4835e[_0x2a6323[_0x7f1d('0x24')]]={'$like':'%'+_0x15577e[_0x7f1d('0x2f')][_0x7f1d('0x3b')]+'%'};return _0xb4835e;}})});}_0x5d718f=_[_0x7f1d('0x3c')]({},_0x5d718f,_0x15577e[_0x7f1d('0x3d')]);var _0x1b57cf={'where':_0x5d718f[_0x7f1d('0x39')]};return db[_0x7f1d('0x28')][_0x7f1d('0x1c')](_0x1b57cf)[_0x7f1d('0x21')](function(_0x515c1a){_0x130178['count']=_0x515c1a;if(_0x15577e[_0x7f1d('0x2f')][_0x7f1d('0x3e')]){_0x5d718f[_0x7f1d('0x3f')]=[{'all':!![]}];}return db[_0x7f1d('0x28')][_0x7f1d('0x40')](_0x5d718f);})['then'](function(_0x31e15d){_0x130178[_0x7f1d('0x41')]=_0x31e15d;return _0x130178;})[_0x7f1d('0x21')](respondWithFilteredResult(_0x1d6abf,_0x5d718f))[_0x7f1d('0x42')](handleError(_0x1d6abf,null));};exports[_0x7f1d('0x43')]=function(_0x4c8045,_0xcde8ff){var _0x1c787b={'raw':![],'where':{'id':_0x4c8045['params']['id']}},_0x101ab8={};_0x101ab8[_0x7f1d('0x2d')]=_[_0x7f1d('0x2e')](db[_0x7f1d('0x28')][_0x7f1d('0x29')]);_0x101ab8[_0x7f1d('0x2f')]=_[_0x7f1d('0x2e')](_0x4c8045['query']);_0x101ab8['filters']=_[_0x7f1d('0x31')](_0x101ab8[_0x7f1d('0x2d')],_0x101ab8[_0x7f1d('0x2f')]);_0x1c787b['attributes']=_[_0x7f1d('0x31')](_0x101ab8['model'],qs['fields'](_0x4c8045['query'][_0x7f1d('0x32')]));_0x1c787b[_0x7f1d('0x33')]=_0x1c787b['attributes']['length']?_0x1c787b[_0x7f1d('0x33')]:_0x101ab8[_0x7f1d('0x2d')];if(_0x4c8045['query'][_0x7f1d('0x3e')]){_0x1c787b[_0x7f1d('0x3f')]=[{'all':!![]}];}_0x1c787b=_[_0x7f1d('0x3c')]({},_0x1c787b,_0x4c8045[_0x7f1d('0x3d')]);return db[_0x7f1d('0x28')]['find'](_0x1c787b)[_0x7f1d('0x21')](handleEntityNotFound(_0xcde8ff,null))[_0x7f1d('0x21')](respondWithResult(_0xcde8ff,null))['catch'](handleError(_0xcde8ff,null));};exports[_0x7f1d('0x44')]=function(_0x3964e1,_0x42146e){return db[_0x7f1d('0x28')][_0x7f1d('0x44')](_0x3964e1['body'],{})[_0x7f1d('0x21')](respondWithResult(_0x42146e,0xc9))[_0x7f1d('0x42')](handleError(_0x42146e,null));};exports['update']=function(_0x2d39a2,_0x3467a5){if(_0x2d39a2['body']['id']){delete _0x2d39a2[_0x7f1d('0x45')]['id'];}return db[_0x7f1d('0x28')]['find']({'where':{'id':_0x2d39a2['params']['id']}})[_0x7f1d('0x21')](handleEntityNotFound(_0x3467a5,null))[_0x7f1d('0x21')](saveUpdates(_0x2d39a2['body'],null))[_0x7f1d('0x21')](respondWithResult(_0x3467a5,null))[_0x7f1d('0x42')](handleError(_0x3467a5,null));};exports[_0x7f1d('0x20')]=function(_0x2b3a09,_0x5b13c8){return db['FreshsalesConfiguration'][_0x7f1d('0x46')]({'where':{'id':_0x2b3a09['params']['id']}})[_0x7f1d('0x21')](handleEntityNotFound(_0x5b13c8,null))['then'](removeEntity(_0x5b13c8,null))[_0x7f1d('0x42')](handleError(_0x5b13c8,null));};exports[_0x7f1d('0x47')]=function(_0x3d6915,_0x5e271f,_0x49c346){var _0x3d69aa={};var _0x5908bc={};var _0x5c8c3e;var _0x43d5ab;return db[_0x7f1d('0x28')][_0x7f1d('0x48')]({'where':{'id':_0x3d6915['params']['id']}})[_0x7f1d('0x21')](handleEntityNotFound(_0x5e271f,null))[_0x7f1d('0x21')](function(_0x1fbc11){if(_0x1fbc11){_0x5c8c3e=_0x1fbc11;_0x5908bc[_0x7f1d('0x2d')]=_[_0x7f1d('0x2e')](db[_0x7f1d('0x49')][_0x7f1d('0x29')]);_0x5908bc[_0x7f1d('0x2f')]=_[_0x7f1d('0x2e')](_0x3d6915['query']);_0x5908bc[_0x7f1d('0x30')]=_['intersection'](_0x5908bc[_0x7f1d('0x2d')],_0x5908bc['query']);_0x3d69aa[_0x7f1d('0x33')]=_[_0x7f1d('0x31')](_0x5908bc[_0x7f1d('0x2d')],qs[_0x7f1d('0x32')](_0x3d6915[_0x7f1d('0x2f')][_0x7f1d('0x32')]));_0x3d69aa[_0x7f1d('0x33')]=_0x3d69aa[_0x7f1d('0x33')][_0x7f1d('0x34')]?_0x3d69aa[_0x7f1d('0x33')]:_0x5908bc[_0x7f1d('0x2d')];_0x3d69aa[_0x7f1d('0x37')]=qs[_0x7f1d('0x38')](_0x3d6915[_0x7f1d('0x2f')][_0x7f1d('0x38')]);_0x3d69aa[_0x7f1d('0x39')]=qs['filters'](_[_0x7f1d('0x3a')](_0x3d6915[_0x7f1d('0x2f')],_0x5908bc[_0x7f1d('0x30')]));if(_0x3d6915[_0x7f1d('0x2f')][_0x7f1d('0x3b')]){_0x3d69aa[_0x7f1d('0x39')]=_['merge'](_0x3d69aa[_0x7f1d('0x39')],{'$or':_[_0x7f1d('0x27')](_0x3d69aa['attributes'],function(_0x25a7cb){var _0x294ee4={};_0x294ee4[_0x25a7cb]={'$like':'%'+_0x3d6915[_0x7f1d('0x2f')]['filter']+'%'};return _0x294ee4;})});}_0x3d69aa=_['merge']({},_0x3d69aa,_0x3d6915[_0x7f1d('0x3d')]);return _0x5c8c3e['getSubjects'](_0x3d69aa);}})[_0x7f1d('0x21')](function(_0x4b1112){if(_0x4b1112){_0x43d5ab=_0x4b1112[_0x7f1d('0x34')];if(!_0x3d6915['query']['hasOwnProperty'](_0x7f1d('0x36'))){_0x3d69aa['limit']=qs[_0x7f1d('0x4a')](_0x3d6915[_0x7f1d('0x2f')][_0x7f1d('0x4a')]);_0x3d69aa['offset']=qs['offset'](_0x3d6915['query']['offset']);}return _0x5c8c3e[_0x7f1d('0x47')](_0x3d69aa);}})[_0x7f1d('0x21')](function(_0x2d80c1){if(_0x2d80c1){return _0x2d80c1?{'count':_0x43d5ab,'rows':_0x2d80c1}:null;}})['then'](respondWithResult(_0x5e271f,null))[_0x7f1d('0x42')](handleError(_0x5e271f,null));};exports[_0x7f1d('0x4b')]=function(_0x1720be,_0x3cdb14,_0x2eaa0a){var _0x473d42={};var _0x531879={};var _0x24f6f5;var _0x57ee23;return db[_0x7f1d('0x28')][_0x7f1d('0x48')]({'where':{'id':_0x1720be[_0x7f1d('0x4c')]['id']}})[_0x7f1d('0x21')](handleEntityNotFound(_0x3cdb14,null))[_0x7f1d('0x21')](function(_0x35e6fe){if(_0x35e6fe){_0x24f6f5=_0x35e6fe;_0x531879['model']=_[_0x7f1d('0x2e')](db[_0x7f1d('0x49')]['rawAttributes']);_0x531879['query']=_['keys'](_0x1720be[_0x7f1d('0x2f')]);_0x531879[_0x7f1d('0x30')]=_[_0x7f1d('0x31')](_0x531879['model'],_0x531879['query']);_0x473d42[_0x7f1d('0x33')]=_['intersection'](_0x531879['model'],qs[_0x7f1d('0x32')](_0x1720be[_0x7f1d('0x2f')][_0x7f1d('0x32')]));_0x473d42[_0x7f1d('0x33')]=_0x473d42[_0x7f1d('0x33')][_0x7f1d('0x34')]?_0x473d42[_0x7f1d('0x33')]:_0x531879[_0x7f1d('0x2d')];_0x473d42[_0x7f1d('0x37')]=qs[_0x7f1d('0x38')](_0x1720be[_0x7f1d('0x2f')][_0x7f1d('0x38')]);_0x473d42[_0x7f1d('0x39')]=qs['filters'](_[_0x7f1d('0x3a')](_0x1720be[_0x7f1d('0x2f')],_0x531879[_0x7f1d('0x30')]));if(_0x1720be['query'][_0x7f1d('0x3b')]){_0x473d42[_0x7f1d('0x39')]=_[_0x7f1d('0x3c')](_0x473d42[_0x7f1d('0x39')],{'$or':_[_0x7f1d('0x27')](_0x473d42[_0x7f1d('0x33')],function(_0x2caec3){var _0x422c45={};_0x422c45[_0x2caec3]={'$like':'%'+_0x1720be[_0x7f1d('0x2f')][_0x7f1d('0x3b')]+'%'};return _0x422c45;})});}_0x473d42=_['merge']({},_0x473d42,_0x1720be[_0x7f1d('0x3d')]);return _0x24f6f5[_0x7f1d('0x4b')](_0x473d42);}})[_0x7f1d('0x21')](function(_0x5398db){if(_0x5398db){_0x57ee23=_0x5398db[_0x7f1d('0x34')];if(!_0x1720be[_0x7f1d('0x2f')][_0x7f1d('0x35')](_0x7f1d('0x36'))){_0x473d42[_0x7f1d('0x4a')]=qs[_0x7f1d('0x4a')](_0x1720be['query'][_0x7f1d('0x4a')]);_0x473d42['offset']=qs[_0x7f1d('0x1a')](_0x1720be[_0x7f1d('0x2f')][_0x7f1d('0x1a')]);}return _0x24f6f5[_0x7f1d('0x4b')](_0x473d42);}})[_0x7f1d('0x21')](function(_0x3374de){if(_0x3374de){return _0x3374de?{'count':_0x57ee23,'rows':_0x3374de}:null;}})['then'](respondWithResult(_0x3cdb14,null))[_0x7f1d('0x42')](handleError(_0x3cdb14,null));};exports['getFields']=function(_0x405a4b,_0x4d84e2,_0x3cd9a0){var _0x3b962b={};var _0x2db247={};var _0x55318c;var _0x1af8c4;return db[_0x7f1d('0x28')][_0x7f1d('0x48')]({'where':{'id':_0x405a4b[_0x7f1d('0x4c')]['id']}})[_0x7f1d('0x21')](handleEntityNotFound(_0x4d84e2,null))[_0x7f1d('0x21')](function(_0x5eb989){if(_0x5eb989){_0x55318c=_0x5eb989;_0x2db247[_0x7f1d('0x2d')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x2db247[_0x7f1d('0x2f')]=_[_0x7f1d('0x2e')](_0x405a4b[_0x7f1d('0x2f')]);_0x2db247[_0x7f1d('0x30')]=_[_0x7f1d('0x31')](_0x2db247[_0x7f1d('0x2d')],_0x2db247[_0x7f1d('0x2f')]);_0x3b962b[_0x7f1d('0x33')]=_[_0x7f1d('0x31')](_0x2db247[_0x7f1d('0x2d')],qs[_0x7f1d('0x32')](_0x405a4b['query']['fields']));_0x3b962b[_0x7f1d('0x33')]=_0x3b962b[_0x7f1d('0x33')][_0x7f1d('0x34')]?_0x3b962b['attributes']:_0x2db247[_0x7f1d('0x2d')];_0x3b962b[_0x7f1d('0x37')]=qs[_0x7f1d('0x38')](_0x405a4b[_0x7f1d('0x2f')][_0x7f1d('0x38')]);_0x3b962b[_0x7f1d('0x39')]=qs[_0x7f1d('0x30')](_[_0x7f1d('0x3a')](_0x405a4b[_0x7f1d('0x2f')],_0x2db247['filters']));if(_0x405a4b[_0x7f1d('0x2f')][_0x7f1d('0x3b')]){_0x3b962b['where']=_[_0x7f1d('0x3c')](_0x3b962b[_0x7f1d('0x39')],{'$or':_[_0x7f1d('0x27')](_0x3b962b['attributes'],function(_0xdf607d){var _0x56f0d8={};_0x56f0d8[_0xdf607d]={'$like':'%'+_0x405a4b['query']['filter']+'%'};return _0x56f0d8;})});}_0x3b962b=_['merge']({},_0x3b962b,_0x405a4b['options']);return _0x55318c['getFields'](_0x3b962b);}})['then'](function(_0x2424b5){if(_0x2424b5){_0x1af8c4=_0x2424b5['length'];if(!_0x405a4b[_0x7f1d('0x2f')][_0x7f1d('0x35')](_0x7f1d('0x36'))){_0x3b962b[_0x7f1d('0x4a')]=qs['limit'](_0x405a4b[_0x7f1d('0x2f')]['limit']);_0x3b962b[_0x7f1d('0x1a')]=qs[_0x7f1d('0x1a')](_0x405a4b[_0x7f1d('0x2f')]['offset']);}return _0x55318c['getFields'](_0x3b962b);}})[_0x7f1d('0x21')](function(_0x23a61d){if(_0x23a61d){return _0x23a61d?{'count':_0x1af8c4,'rows':_0x23a61d}:null;}})['then'](respondWithResult(_0x4d84e2,null))[_0x7f1d('0x42')](handleError(_0x4d84e2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 487ddeb..771648d 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 _0xd176=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','lodash','util','../../config/logger','moment','rimraf'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd176,0x1b4));var _0x6d17=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0xd176[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x6d17('0x0'));var util=require(_0x6d17('0x1'));var logger=require(_0x6d17('0x2'))('api');var moment=require(_0x6d17('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d17('0x4'));var config=require(_0x6d17('0x5'));var attributes=require(_0x6d17('0x6'));module[_0x6d17('0x7')]=function(_0x5fe125,_0xedfd87){return _0x5fe125[_0x6d17('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfda1=['FreshsalesConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesConfiguration.attributes'];(function(_0x22c60a,_0x1e05ea){var _0x5b08aa=function(_0x58405e){while(--_0x58405e){_0x22c60a['push'](_0x22c60a['shift']());}};_0x5b08aa(++_0x1e05ea);}(_0xfda1,0x1c3));var _0x1fda=function(_0x4de2de,_0x2171db){_0x4de2de=_0x4de2de-0x0;var _0x2e3372=_0xfda1[_0x4de2de];return _0x2e3372;};'use strict';var _=require('lodash');var util=require(_0x1fda('0x0'));var logger=require(_0x1fda('0x1'))(_0x1fda('0x2'));var moment=require(_0x1fda('0x3'));var BPromise=require(_0x1fda('0x4'));var rp=require(_0x1fda('0x5'));var fs=require('fs');var path=require(_0x1fda('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1fda('0x7'));module['exports']=function(_0xd68d58,_0x40333d){return _0xd68d58['define'](_0x1fda('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 80704ba..4dd78fb 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 _0x0af5=['request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','../../config/utils','../../config/environment','client','http','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x47a468,_0x333c10){var _0x1306ed=function(_0x59cbfe){while(--_0x59cbfe){_0x47a468['push'](_0x47a468['shift']());}};_0x1306ed(++_0x333c10);}(_0x0af5,0xd6));var _0x50af=function(_0x1a11d8,_0x4ae6e8){_0x1a11d8=_0x1a11d8-0x0;var _0x2100ce=_0x0af5[_0x1a11d8];return _0x2100ce;};'use strict';var _=require(_0x50af('0x0'));var util=require(_0x50af('0x1'));var moment=require('moment');var BPromise=require(_0x50af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50af('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x50af('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x50af('0x5')][_0x50af('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x14e40b,_0x4c94f9,_0x1616a3){return new BPromise(function(_0x170c5d,_0x5ee4f9){return client['request'](_0x14e40b,_0x1616a3)['then'](function(_0x5a603d){logger[_0x50af('0x7')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4c94f9,'request\x20sent');logger[_0x50af('0x8')](_0x50af('0x9'),_0x4c94f9,_0x50af('0xa'),JSON['stringify'](_0x5a603d));if(_0x5a603d[_0x50af('0xb')]){if(_0x5a603d['error'][_0x50af('0xc')]===0x1f4){logger[_0x50af('0xb')](_0x50af('0xd'),_0x4c94f9,_0x5a603d[_0x50af('0xb')][_0x50af('0xe')]);return _0x5ee4f9(_0x5a603d[_0x50af('0xb')][_0x50af('0xe')]);}logger['error'](_0x50af('0xd'),_0x4c94f9,_0x5a603d[_0x50af('0xb')][_0x50af('0xe')]);return _0x170c5d(_0x5a603d['error']['message']);}else{logger[_0x50af('0x7')](_0x50af('0xd'),_0x4c94f9,_0x50af('0xa'));_0x170c5d(_0x5a603d['result']['message']);}})[_0x50af('0xf')](function(_0x565dd6){logger[_0x50af('0xb')](_0x50af('0xd'),_0x4c94f9,_0x565dd6);_0x5ee4f9(_0x565dd6);});});} \ No newline at end of file +var _0x585e=['jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xe56605,_0x150790){var _0x24ab92=function(_0x43a165){while(--_0x43a165){_0xe56605['push'](_0xe56605['shift']());}};_0x24ab92(++_0x150790);}(_0x585e,0x163));var _0xe585=function(_0x43d8b9,_0x95699a){_0x43d8b9=_0x43d8b9-0x0;var _0xd0ece7=_0x585e[_0x43d8b9];return _0xd0ece7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe585('0x0'));var fs=require('fs');var Redis=require(_0xe585('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xe585('0x2'));var logger=require(_0xe585('0x3'))(_0xe585('0x4'));var config=require('../../config/environment');var jayson=require(_0xe585('0x5'));var client=jayson[_0xe585('0x6')][_0xe585('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37026d,_0x280cbf,_0x448681){return new BPromise(function(_0x5ceccd,_0x2facf9){return client['request'](_0x37026d,_0x448681)[_0xe585('0x8')](function(_0x2437c0){logger[_0xe585('0x9')](_0xe585('0xa'),_0x280cbf,_0xe585('0xb'));logger[_0xe585('0xc')](_0xe585('0xd'),_0x280cbf,_0xe585('0xb'),JSON[_0xe585('0xe')](_0x2437c0));if(_0x2437c0['error']){if(_0x2437c0[_0xe585('0xf')][_0xe585('0x10')]===0x1f4){logger[_0xe585('0xf')](_0xe585('0xa'),_0x280cbf,_0x2437c0['error'][_0xe585('0x11')]);return _0x2facf9(_0x2437c0['error'][_0xe585('0x11')]);}logger[_0xe585('0xf')](_0xe585('0xa'),_0x280cbf,_0x2437c0[_0xe585('0xf')][_0xe585('0x11')]);return _0x5ceccd(_0x2437c0[_0xe585('0xf')][_0xe585('0x11')]);}else{logger[_0xe585('0x9')](_0xe585('0xa'),_0x280cbf,_0xe585('0xb'));_0x5ceccd(_0x2437c0[_0xe585('0x12')][_0xe585('0x11')]);}})[_0xe585('0x13')](function(_0xce33ce){logger[_0xe585('0xf')](_0xe585('0xa'),_0x280cbf,_0xce33ce);_0x2facf9(_0xce33ce);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 548a6fc..e01edb2 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 _0x0a12=['index','create','put','/:id','update','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0a12,0xb8));var _0x20a1=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x0a12[_0x3305de];return _0x3b5a84;};'use strict';var multer=require('multer');var util=require(_0x20a1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20a1('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x20a1('0x2'));var interaction=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var controller=require(_0x20a1('0x5'));router[_0x20a1('0x6')]('/',auth[_0x20a1('0x7')](),controller[_0x20a1('0x8')]);router['get']('/:id',auth[_0x20a1('0x7')](),controller['show']);router['post']('/',auth[_0x20a1('0x7')](),controller[_0x20a1('0x9')]);router[_0x20a1('0xa')](_0x20a1('0xb'),auth[_0x20a1('0x7')](),controller[_0x20a1('0xc')]);router[_0x20a1('0xd')]('/:id',auth[_0x20a1('0x7')](),controller[_0x20a1('0xe')]);module[_0x20a1('0xf')]=router; \ No newline at end of file +var _0xe700=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x2aaa60,_0x22258f){var _0x2e3fa5=function(_0x335589){while(--_0x335589){_0x2aaa60['push'](_0x2aaa60['shift']());}};_0x2e3fa5(++_0x22258f);}(_0xe700,0x16a));var _0x0e70=function(_0x38a286,_0x23c7e5){_0x38a286=_0x38a286-0x0;var _0x5705bd=_0xe700[_0x38a286];return _0x5705bd;};'use strict';var multer=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var path=require(_0x0e70('0x2'));var timeout=require(_0x0e70('0x3'));var express=require(_0x0e70('0x4'));var router=express['Router']();var fs_extra=require(_0x0e70('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e70('0x6'));var config=require(_0x0e70('0x7'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0x9')]);router[_0x0e70('0xa')](_0x0e70('0xb'),auth['isAuthenticated'](),controller[_0x0e70('0xc')]);router[_0x0e70('0xd')]('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0xe')]);router[_0x0e70('0xf')](_0x0e70('0xb'),auth[_0x0e70('0x8')](),controller['update']);router[_0x0e70('0x10')](_0x0e70('0xb'),auth[_0x0e70('0x8')](),controller['destroy']);module[_0x0e70('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 652003c..017b610 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 _0xa06c=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x5c5198,_0x2fccc3){var _0x6f1f5f=function(_0x4adb0d){while(--_0x4adb0d){_0x5c5198['push'](_0x5c5198['shift']());}};_0x6f1f5f(++_0x2fccc3);}(_0xa06c,0x1d2));var _0xca06=function(_0x453d7c,_0x118408){_0x453d7c=_0x453d7c-0x0;var _0x4193a5=_0xa06c[_0x453d7c];return _0x4193a5;};'use strict';var Sequelize=require(_0xca06('0x0'));module[_0xca06('0x1')]={'type':{'type':Sequelize[_0xca06('0x2')](_0xca06('0x3'),_0xca06('0x4'),_0xca06('0x5'),_0xca06('0x6'),_0xca06('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xca06('0x2')]('string',_0xca06('0x4'),_0xca06('0x5'))},'keyContent':{'type':Sequelize[_0xca06('0x8')]},'idField':{'type':Sequelize[_0xca06('0x8')]},'nameField':{'type':Sequelize[_0xca06('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca06('0x8')]}}; \ No newline at end of file +var _0xa1d6=['keyValue','picklist','string','STRING','BOOLEAN','ENUM','variable','customVariable'];(function(_0x5e40d8,_0x21782c){var _0x5bcf78=function(_0x47e102){while(--_0x47e102){_0x5e40d8['push'](_0x5e40d8['shift']());}};_0x5bcf78(++_0x21782c);}(_0xa1d6,0xf5));var _0x6a1d=function(_0x296373,_0x4dc0dc){_0x296373=_0x296373-0x0;var _0x448cd6=_0xa1d6[_0x296373];return _0x448cd6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6a1d('0x0')]('string',_0x6a1d('0x1'),_0x6a1d('0x2'),_0x6a1d('0x3'),_0x6a1d('0x4')),'defaultValue':_0x6a1d('0x5')},'content':{'type':Sequelize[_0x6a1d('0x6')]},'key':{'type':Sequelize[_0x6a1d('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6a1d('0x1'),_0x6a1d('0x2'))},'keyContent':{'type':Sequelize[_0x6a1d('0x6')]},'idField':{'type':Sequelize[_0x6a1d('0x6')]},'nameField':{'type':Sequelize[_0x6a1d('0x6')]},'customField':{'type':Sequelize[_0x6a1d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a1d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 8532caf..d645002 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 _0x5c6c=['merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x5c6c,0x197));var _0xc5c6=function(_0xf7a192,_0x35ada8){_0xf7a192=_0xf7a192-0x0;var _0x3985e5=_0x5c6c[_0xf7a192];return _0x3985e5;};'use strict';var emlformat=require(_0xc5c6('0x0'));var rimraf=require(_0xc5c6('0x1'));var zipdir=require(_0xc5c6('0x2'));var jsonpatch=require(_0xc5c6('0x3'));var rp=require(_0xc5c6('0x4'));var moment=require(_0xc5c6('0x5'));var BPromise=require(_0xc5c6('0x6'));var Mustache=require(_0xc5c6('0x7'));var util=require(_0xc5c6('0x8'));var path=require(_0xc5c6('0x9'));var sox=require(_0xc5c6('0xa'));var csv=require(_0xc5c6('0xb'));var ejs=require(_0xc5c6('0xc'));var fs=require('fs');var fs_extra=require(_0xc5c6('0xd'));var _=require(_0xc5c6('0xe'));var squel=require(_0xc5c6('0xf'));var crypto=require(_0xc5c6('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5c6('0xb'));var querystring=require(_0xc5c6('0x11'));var Papa=require(_0xc5c6('0x12'));var Redis=require(_0xc5c6('0x13'));var authService=require(_0xc5c6('0x14'));var qs=require(_0xc5c6('0x15'));var as=require(_0xc5c6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5c6('0x17'))('api');var utils=require(_0xc5c6('0x18'));var config=require(_0xc5c6('0x19'));var licenseUtil=require(_0xc5c6('0x1a'));var db=require(_0xc5c6('0x1b'))['db'];function respondWithStatusCode(_0xff873d,_0x53c1d4){_0x53c1d4=_0x53c1d4||0xcc;return function(_0x5da8b0){if(_0x5da8b0){return _0xff873d[_0xc5c6('0x1c')](_0x53c1d4);}return _0xff873d[_0xc5c6('0x1d')](_0x53c1d4)[_0xc5c6('0x1e')]();};}function respondWithResult(_0x5d843c,_0x4026a7){_0x4026a7=_0x4026a7||0xc8;return function(_0x1245fd){if(_0x1245fd){return _0x5d843c['status'](_0x4026a7)[_0xc5c6('0x1f')](_0x1245fd);}};}function respondWithFilteredResult(_0x12682c,_0x156b4c){return function(_0x43f5f3){if(_0x43f5f3){var _0x25addc=typeof _0x156b4c[_0xc5c6('0x20')]===_0xc5c6('0x21')&&typeof _0x156b4c[_0xc5c6('0x22')]==='undefined';var _0x4ea732=_0x43f5f3[_0xc5c6('0x23')];var _0x2609a2=_0x25addc?0x0:_0x156b4c[_0xc5c6('0x20')];var _0x85f40b=_0x25addc?_0x43f5f3['count']:_0x156b4c['offset']+_0x156b4c[_0xc5c6('0x22')];var _0x87c1e0;if(_0x85f40b>=_0x4ea732){_0x85f40b=_0x4ea732;_0x87c1e0=0xc8;}else{_0x87c1e0=0xce;}_0x12682c['status'](_0x87c1e0);return _0x12682c[_0xc5c6('0x24')](_0xc5c6('0x25'),_0x2609a2+'-'+_0x85f40b+'/'+_0x4ea732)[_0xc5c6('0x1f')](_0x43f5f3);}return null;};}function patchUpdates(_0x1054cd){return function(_0x47de68){try{jsonpatch[_0xc5c6('0x26')](_0x47de68,_0x1054cd,!![]);}catch(_0x36eccb){return BPromise[_0xc5c6('0x27')](_0x36eccb);}return _0x47de68[_0xc5c6('0x28')]();};}function saveUpdates(_0x509fba,_0x583f48){return function(_0x47098a){if(_0x47098a){return _0x47098a[_0xc5c6('0x29')](_0x509fba)[_0xc5c6('0x2a')](function(_0x555faa){return _0x555faa;});}return null;};}function removeEntity(_0x5b8e6d,_0x18311a){return function(_0x125795){if(_0x125795){return _0x125795[_0xc5c6('0x2b')]()[_0xc5c6('0x2a')](function(){_0x5b8e6d[_0xc5c6('0x1d')](0xcc)[_0xc5c6('0x1e')]();});}};}function handleEntityNotFound(_0x52968f,_0x3f888f){return function(_0x11fc27){if(!_0x11fc27){_0x52968f[_0xc5c6('0x1c')](0x194);}return _0x11fc27;};}function handleError(_0x488169,_0x4e3840){_0x4e3840=_0x4e3840||0x1f4;return function(_0x4e47bc){logger[_0xc5c6('0x2c')](_0x4e47bc[_0xc5c6('0x2d')]);if(_0x4e47bc[_0xc5c6('0x2e')]){delete _0x4e47bc[_0xc5c6('0x2e')];}_0x488169[_0xc5c6('0x1d')](_0x4e3840)[_0xc5c6('0x2f')](_0x4e47bc);};}exports['index']=function(_0x56a925,_0x4a5061){var _0x3d6c48={},_0x2841ff={},_0x28b191={'count':0x0,'rows':[]};var _0x3704ad=_[_0xc5c6('0x30')](db[_0xc5c6('0x31')][_0xc5c6('0x32')],function(_0x11c4e4){return{'name':_0x11c4e4['fieldName'],'type':_0x11c4e4[_0xc5c6('0x33')][_0xc5c6('0x34')]};});_0x2841ff[_0xc5c6('0x35')]=_[_0xc5c6('0x30')](_0x3704ad,_0xc5c6('0x2e'));_0x2841ff[_0xc5c6('0x36')]=_[_0xc5c6('0x37')](_0x56a925['query']);_0x2841ff[_0xc5c6('0x38')]=_['intersection'](_0x2841ff['model'],_0x2841ff[_0xc5c6('0x36')]);_0x3d6c48[_0xc5c6('0x39')]=_[_0xc5c6('0x3a')](_0x2841ff[_0xc5c6('0x35')],qs[_0xc5c6('0x3b')](_0x56a925[_0xc5c6('0x36')]['fields']));_0x3d6c48['attributes']=_0x3d6c48['attributes'][_0xc5c6('0x3c')]?_0x3d6c48[_0xc5c6('0x39')]:_0x2841ff[_0xc5c6('0x35')];if(!_0x56a925['query'][_0xc5c6('0x3d')](_0xc5c6('0x3e'))){_0x3d6c48[_0xc5c6('0x22')]=qs[_0xc5c6('0x22')](_0x56a925[_0xc5c6('0x36')]['limit']);_0x3d6c48[_0xc5c6('0x20')]=qs[_0xc5c6('0x20')](_0x56a925[_0xc5c6('0x36')][_0xc5c6('0x20')]);}_0x3d6c48['order']=qs[_0xc5c6('0x3f')](_0x56a925[_0xc5c6('0x36')][_0xc5c6('0x3f')]);_0x3d6c48['where']=qs[_0xc5c6('0x38')](_[_0xc5c6('0x40')](_0x56a925[_0xc5c6('0x36')],_0x2841ff[_0xc5c6('0x38')]),_0x3704ad);if(_0x56a925['query'][_0xc5c6('0x41')]){_0x3d6c48[_0xc5c6('0x42')]=_[_0xc5c6('0x43')](_0x3d6c48[_0xc5c6('0x42')],{'$or':_[_0xc5c6('0x30')](_0x3704ad,function(_0x3e0d14){if(_0x3e0d14['type']!==_0xc5c6('0x44')){var _0x25ca6e={};_0x25ca6e[_0x3e0d14[_0xc5c6('0x2e')]]={'$like':'%'+_0x56a925[_0xc5c6('0x36')][_0xc5c6('0x41')]+'%'};return _0x25ca6e;}})});}_0x3d6c48=_[_0xc5c6('0x43')]({},_0x3d6c48,_0x56a925[_0xc5c6('0x45')]);var _0x14e948={'where':_0x3d6c48[_0xc5c6('0x42')]};return db[_0xc5c6('0x31')][_0xc5c6('0x23')](_0x14e948)[_0xc5c6('0x2a')](function(_0x2899ca){_0x28b191[_0xc5c6('0x23')]=_0x2899ca;if(_0x56a925[_0xc5c6('0x36')]['includeAll']){_0x3d6c48[_0xc5c6('0x46')]=[{'all':!![]}];}return db[_0xc5c6('0x31')][_0xc5c6('0x47')](_0x3d6c48);})['then'](function(_0x1385c5){_0x28b191['rows']=_0x1385c5;return _0x28b191;})['then'](respondWithFilteredResult(_0x4a5061,_0x3d6c48))[_0xc5c6('0x48')](handleError(_0x4a5061,null));};exports[_0xc5c6('0x49')]=function(_0x236fcb,_0x276c30){var _0x290701={'raw':!![],'where':{'id':_0x236fcb[_0xc5c6('0x4a')]['id']}},_0x13339a={};_0x13339a[_0xc5c6('0x35')]=_[_0xc5c6('0x37')](db[_0xc5c6('0x31')][_0xc5c6('0x32')]);_0x13339a['query']=_[_0xc5c6('0x37')](_0x236fcb[_0xc5c6('0x36')]);_0x13339a[_0xc5c6('0x38')]=_[_0xc5c6('0x3a')](_0x13339a['model'],_0x13339a[_0xc5c6('0x36')]);_0x290701[_0xc5c6('0x39')]=_['intersection'](_0x13339a[_0xc5c6('0x35')],qs[_0xc5c6('0x3b')](_0x236fcb['query'][_0xc5c6('0x3b')]));_0x290701[_0xc5c6('0x39')]=_0x290701['attributes'][_0xc5c6('0x3c')]?_0x290701['attributes']:_0x13339a[_0xc5c6('0x35')];if(_0x236fcb['query'][_0xc5c6('0x4b')]){_0x290701[_0xc5c6('0x46')]=[{'all':!![]}];}_0x290701=_['merge']({},_0x290701,_0x236fcb[_0xc5c6('0x45')]);return db['FreshsalesField'][_0xc5c6('0x4c')](_0x290701)[_0xc5c6('0x2a')](handleEntityNotFound(_0x276c30,null))[_0xc5c6('0x2a')](respondWithResult(_0x276c30,null))[_0xc5c6('0x48')](handleError(_0x276c30,null));};exports[_0xc5c6('0x4d')]=function(_0x5c2094,_0x3d1cc1){return db[_0xc5c6('0x31')]['create'](_0x5c2094[_0xc5c6('0x4e')],{})[_0xc5c6('0x2a')](respondWithResult(_0x3d1cc1,0xc9))[_0xc5c6('0x48')](handleError(_0x3d1cc1,null));};exports['update']=function(_0x5cd723,_0x539c62){if(_0x5cd723['body']['id']){delete _0x5cd723[_0xc5c6('0x4e')]['id'];}return db['FreshsalesField'][_0xc5c6('0x4c')]({'where':{'id':_0x5cd723[_0xc5c6('0x4a')]['id']}})[_0xc5c6('0x2a')](handleEntityNotFound(_0x539c62,null))[_0xc5c6('0x2a')](saveUpdates(_0x5cd723[_0xc5c6('0x4e')],null))[_0xc5c6('0x2a')](respondWithResult(_0x539c62,null))['catch'](handleError(_0x539c62,null));};exports[_0xc5c6('0x2b')]=function(_0x3fe81c,_0x3631c9){return db['FreshsalesField']['find']({'where':{'id':_0x3fe81c[_0xc5c6('0x4a')]['id']}})[_0xc5c6('0x2a')](handleEntityNotFound(_0x3631c9,null))[_0xc5c6('0x2a')](removeEntity(_0x3631c9,null))[_0xc5c6('0x48')](handleError(_0x3631c9,null));}; \ No newline at end of file +var _0x74ce=['api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','FreshsalesField','includeAll','findAll','catch','params','length','include','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0x74ce,0x7e));var _0xe74c=function(_0x3ca788,_0x235eab){_0x3ca788=_0x3ca788-0x0;var _0x2657c6=_0x74ce[_0x3ca788];return _0x2657c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe74c('0x0'));var zipdir=require(_0xe74c('0x1'));var jsonpatch=require(_0xe74c('0x2'));var rp=require(_0xe74c('0x3'));var moment=require(_0xe74c('0x4'));var BPromise=require(_0xe74c('0x5'));var Mustache=require('mustache');var util=require(_0xe74c('0x6'));var path=require(_0xe74c('0x7'));var sox=require('sox');var csv=require(_0xe74c('0x8'));var ejs=require(_0xe74c('0x9'));var fs=require('fs');var fs_extra=require(_0xe74c('0xa'));var _=require(_0xe74c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe74c('0xc'));var deskjs=require(_0xe74c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe74c('0xe'));var Papa=require(_0xe74c('0xf'));var Redis=require('ioredis');var authService=require(_0xe74c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe74c('0x11'));var hardwareService=require(_0xe74c('0x12'));var logger=require(_0xe74c('0x13'))(_0xe74c('0x14'));var utils=require('../../config/utils');var config=require(_0xe74c('0x15'));var licenseUtil=require(_0xe74c('0x16'));var db=require(_0xe74c('0x17'))['db'];function respondWithStatusCode(_0x55aead,_0x25f5d5){_0x25f5d5=_0x25f5d5||0xcc;return function(_0x59b859){if(_0x59b859){return _0x55aead['sendStatus'](_0x25f5d5);}return _0x55aead['status'](_0x25f5d5)['end']();};}function respondWithResult(_0x23a37d,_0x38a541){_0x38a541=_0x38a541||0xc8;return function(_0xc10e18){if(_0xc10e18){return _0x23a37d[_0xe74c('0x18')](_0x38a541)['json'](_0xc10e18);}};}function respondWithFilteredResult(_0x31cc77,_0x18eb62){return function(_0x1d66ea){if(_0x1d66ea){var _0x4d6260=typeof _0x18eb62[_0xe74c('0x19')]===_0xe74c('0x1a')&&typeof _0x18eb62['limit']===_0xe74c('0x1a');var _0x463d00=_0x1d66ea[_0xe74c('0x1b')];var _0xfdd364=_0x4d6260?0x0:_0x18eb62[_0xe74c('0x19')];var _0x1e3b74=_0x4d6260?_0x1d66ea[_0xe74c('0x1b')]:_0x18eb62[_0xe74c('0x19')]+_0x18eb62[_0xe74c('0x1c')];var _0x1bd2ca;if(_0x1e3b74>=_0x463d00){_0x1e3b74=_0x463d00;_0x1bd2ca=0xc8;}else{_0x1bd2ca=0xce;}_0x31cc77[_0xe74c('0x18')](_0x1bd2ca);return _0x31cc77['set'](_0xe74c('0x1d'),_0xfdd364+'-'+_0x1e3b74+'/'+_0x463d00)[_0xe74c('0x1e')](_0x1d66ea);}return null;};}function patchUpdates(_0x188af2){return function(_0x588647){try{jsonpatch[_0xe74c('0x1f')](_0x588647,_0x188af2,!![]);}catch(_0x1f8965){return BPromise[_0xe74c('0x20')](_0x1f8965);}return _0x588647[_0xe74c('0x21')]();};}function saveUpdates(_0x59686c,_0x20ec76){return function(_0x4142ba){if(_0x4142ba){return _0x4142ba['update'](_0x59686c)[_0xe74c('0x22')](function(_0x8463eb){return _0x8463eb;});}return null;};}function removeEntity(_0x3cad64,_0x4a5d90){return function(_0x3f1dab){if(_0x3f1dab){return _0x3f1dab[_0xe74c('0x23')]()[_0xe74c('0x22')](function(){_0x3cad64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c1a9,_0x1293c8){return function(_0x16a869){if(!_0x16a869){_0x16c1a9[_0xe74c('0x24')](0x194);}return _0x16a869;};}function handleError(_0x8af205,_0x5099b4){_0x5099b4=_0x5099b4||0x1f4;return function(_0x1a18bf){logger[_0xe74c('0x25')](_0x1a18bf[_0xe74c('0x26')]);if(_0x1a18bf[_0xe74c('0x27')]){delete _0x1a18bf['name'];}_0x8af205[_0xe74c('0x18')](_0x5099b4)[_0xe74c('0x28')](_0x1a18bf);};}exports[_0xe74c('0x29')]=function(_0x1c1eb9,_0x40493e){var _0x212279={},_0x24c067={},_0x557dc6={'count':0x0,'rows':[]};var _0x465789=_[_0xe74c('0x2a')](db['FreshsalesField'][_0xe74c('0x2b')],function(_0x1ab847){return{'name':_0x1ab847[_0xe74c('0x2c')],'type':_0x1ab847[_0xe74c('0x2d')][_0xe74c('0x2e')]};});_0x24c067[_0xe74c('0x2f')]=_[_0xe74c('0x2a')](_0x465789,'name');_0x24c067[_0xe74c('0x30')]=_[_0xe74c('0x31')](_0x1c1eb9[_0xe74c('0x30')]);_0x24c067[_0xe74c('0x32')]=_[_0xe74c('0x33')](_0x24c067['model'],_0x24c067['query']);_0x212279[_0xe74c('0x34')]=_[_0xe74c('0x33')](_0x24c067[_0xe74c('0x2f')],qs[_0xe74c('0x35')](_0x1c1eb9[_0xe74c('0x30')]['fields']));_0x212279[_0xe74c('0x34')]=_0x212279['attributes']['length']?_0x212279[_0xe74c('0x34')]:_0x24c067[_0xe74c('0x2f')];if(!_0x1c1eb9[_0xe74c('0x30')][_0xe74c('0x36')](_0xe74c('0x37'))){_0x212279['limit']=qs[_0xe74c('0x1c')](_0x1c1eb9[_0xe74c('0x30')][_0xe74c('0x1c')]);_0x212279[_0xe74c('0x19')]=qs[_0xe74c('0x19')](_0x1c1eb9[_0xe74c('0x30')]['offset']);}_0x212279[_0xe74c('0x38')]=qs[_0xe74c('0x39')](_0x1c1eb9[_0xe74c('0x30')][_0xe74c('0x39')]);_0x212279['where']=qs[_0xe74c('0x32')](_[_0xe74c('0x3a')](_0x1c1eb9[_0xe74c('0x30')],_0x24c067[_0xe74c('0x32')]),_0x465789);if(_0x1c1eb9[_0xe74c('0x30')][_0xe74c('0x3b')]){_0x212279[_0xe74c('0x3c')]=_[_0xe74c('0x3d')](_0x212279[_0xe74c('0x3c')],{'$or':_[_0xe74c('0x2a')](_0x465789,function(_0x32ee8d){if(_0x32ee8d[_0xe74c('0x2d')]!=='VIRTUAL'){var _0x2d18aa={};_0x2d18aa[_0x32ee8d[_0xe74c('0x27')]]={'$like':'%'+_0x1c1eb9[_0xe74c('0x30')][_0xe74c('0x3b')]+'%'};return _0x2d18aa;}})});}_0x212279=_[_0xe74c('0x3d')]({},_0x212279,_0x1c1eb9['options']);var _0x48105f={'where':_0x212279[_0xe74c('0x3c')]};return db[_0xe74c('0x3e')][_0xe74c('0x1b')](_0x48105f)[_0xe74c('0x22')](function(_0x2776c7){_0x557dc6[_0xe74c('0x1b')]=_0x2776c7;if(_0x1c1eb9[_0xe74c('0x30')][_0xe74c('0x3f')]){_0x212279['include']=[{'all':!![]}];}return db[_0xe74c('0x3e')][_0xe74c('0x40')](_0x212279);})[_0xe74c('0x22')](function(_0x1f752f){_0x557dc6['rows']=_0x1f752f;return _0x557dc6;})[_0xe74c('0x22')](respondWithFilteredResult(_0x40493e,_0x212279))[_0xe74c('0x41')](handleError(_0x40493e,null));};exports['show']=function(_0x12fb0d,_0x493b0d){var _0x1a9f3a={'raw':!![],'where':{'id':_0x12fb0d[_0xe74c('0x42')]['id']}},_0x3e858b={};_0x3e858b[_0xe74c('0x2f')]=_[_0xe74c('0x31')](db['FreshsalesField'][_0xe74c('0x2b')]);_0x3e858b[_0xe74c('0x30')]=_[_0xe74c('0x31')](_0x12fb0d[_0xe74c('0x30')]);_0x3e858b['filters']=_[_0xe74c('0x33')](_0x3e858b['model'],_0x3e858b[_0xe74c('0x30')]);_0x1a9f3a[_0xe74c('0x34')]=_['intersection'](_0x3e858b[_0xe74c('0x2f')],qs[_0xe74c('0x35')](_0x12fb0d['query'][_0xe74c('0x35')]));_0x1a9f3a[_0xe74c('0x34')]=_0x1a9f3a['attributes'][_0xe74c('0x43')]?_0x1a9f3a[_0xe74c('0x34')]:_0x3e858b['model'];if(_0x12fb0d[_0xe74c('0x30')][_0xe74c('0x3f')]){_0x1a9f3a[_0xe74c('0x44')]=[{'all':!![]}];}_0x1a9f3a=_[_0xe74c('0x3d')]({},_0x1a9f3a,_0x12fb0d[_0xe74c('0x45')]);return db[_0xe74c('0x3e')][_0xe74c('0x46')](_0x1a9f3a)[_0xe74c('0x22')](handleEntityNotFound(_0x493b0d,null))[_0xe74c('0x22')](respondWithResult(_0x493b0d,null))['catch'](handleError(_0x493b0d,null));};exports[_0xe74c('0x47')]=function(_0x294043,_0x21909e){return db[_0xe74c('0x3e')][_0xe74c('0x47')](_0x294043[_0xe74c('0x48')],{})[_0xe74c('0x22')](respondWithResult(_0x21909e,0xc9))['catch'](handleError(_0x21909e,null));};exports['update']=function(_0x23bc44,_0xd9419){if(_0x23bc44[_0xe74c('0x48')]['id']){delete _0x23bc44[_0xe74c('0x48')]['id'];}return db['FreshsalesField'][_0xe74c('0x46')]({'where':{'id':_0x23bc44['params']['id']}})[_0xe74c('0x22')](handleEntityNotFound(_0xd9419,null))[_0xe74c('0x22')](saveUpdates(_0x23bc44[_0xe74c('0x48')],null))[_0xe74c('0x22')](respondWithResult(_0xd9419,null))[_0xe74c('0x41')](handleError(_0xd9419,null));};exports['destroy']=function(_0xf42996,_0x4e8ed5){return db[_0xe74c('0x3e')][_0xe74c('0x46')]({'where':{'id':_0xf42996[_0xe74c('0x42')]['id']}})[_0xe74c('0x22')](handleEntityNotFound(_0x4e8ed5,null))['then'](removeEntity(_0x4e8ed5,null))[_0xe74c('0x41')](handleError(_0x4e8ed5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 7761acc..d8a74a5 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 _0xab40=['path','rimraf','../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','lodash','util','bluebird','request-promise'];(function(_0x5b1952,_0x40527a){var _0x4f08d8=function(_0x4d91bf){while(--_0x4d91bf){_0x5b1952['push'](_0x5b1952['shift']());}};_0x4f08d8(++_0x40527a);}(_0xab40,0xcd));var _0x0ab4=function(_0x36ab31,_0x59e080){_0x36ab31=_0x36ab31-0x0;var _0x32f471=_0xab40[_0x36ab31];return _0x32f471;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require(_0x0ab4('0x4'));var rimraf=require(_0x0ab4('0x5'));var config=require(_0x0ab4('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x28b17a,_0x4ba9d2){return _0x28b17a[_0x0ab4('0x7')](_0x0ab4('0x8'),attributes,{'tableName':_0x0ab4('0x9'),'paranoid':![],'indexes':[{'name':_0x0ab4('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0457=['../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0457,0x11f));var _0x7045=function(_0xa85dbd,_0x2838a5){_0xa85dbd=_0xa85dbd-0x0;var _0x3be7aa=_0x0457[_0xa85dbd];return _0x3be7aa;};'use strict';var _=require('lodash');var util=require(_0x7045('0x0'));var logger=require(_0x7045('0x1'))('api');var moment=require(_0x7045('0x2'));var BPromise=require(_0x7045('0x3'));var rp=require(_0x7045('0x4'));var fs=require('fs');var path=require(_0x7045('0x5'));var rimraf=require(_0x7045('0x6'));var config=require(_0x7045('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x7045('0x8')]=function(_0x51e53b,_0x91fb4c){return _0x51e53b[_0x7045('0x9')](_0x7045('0xa'),attributes,{'tableName':_0x7045('0xb'),'paranoid':![],'indexes':[{'name':_0x7045('0xc'),'fields':[_0x7045('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 179033f..8cdc888 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x56dd81,_0x11a149){_0x56dd81=_0x56dd81-0x0;var _0x5605a9=_0x3f8a[_0x56dd81];return _0x5605a9;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x2eb2=['request','then','info','request\x20sent','error','FreshsalesField,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x5d303a,_0x1b6fe9){var _0x49a3c9=function(_0x5f04a0){while(--_0x5f04a0){_0x5d303a['push'](_0x5d303a['shift']());}};_0x49a3c9(++_0x1b6fe9);}(_0x2eb2,0x19f));var _0x22eb=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2eb2[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 262311e..16674a4 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x263c90,_0x51f8bf){var _0x34a66e=function(_0x15c8ed){while(--_0x15c8ed){_0x263c90['push'](_0x263c90['shift']());}};_0x34a66e(++_0x51f8bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1f830c,_0x209533){var _0xb98f82=function(_0x2e2720){while(--_0x2e2720){_0x1f830c['push'](_0x1f830c['shift']());}};_0xb98f82(++_0x209533);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 231fcd3..bdde76b 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 _0x753c=['exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x422f88,_0x40fcd1){var _0x1189c1=function(_0x570a31){while(--_0x570a31){_0x422f88['push'](_0x422f88['shift']());}};_0x1189c1(++_0x40fcd1);}(_0x753c,0x96));var _0xc753=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x753c[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xc753('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc753('0x1')]},'username':{'type':Sequelize[_0xc753('0x1')],'unique':_0xc753('0x2')},'remoteUri':{'type':Sequelize[_0xc753('0x1')]},'password':{'type':Sequelize[_0xc753('0x1')]},'clientId':{'type':Sequelize[_0xc753('0x1')]},'clientSecret':{'type':Sequelize[_0xc753('0x1')]},'securityToken':{'type':Sequelize[_0xc753('0x1')]},'serverUrl':{'type':Sequelize[_0xc753('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc753('0x3')](_0xc753('0x4'),_0xc753('0x5')),'defaultValue':_0xc753('0x4')}}; \ No newline at end of file +var _0x3189=['sequelize','STRING','username','ENUM','integrationTab'];(function(_0x773ebd,_0x8f6f15){var _0x33e9df=function(_0x4f6cbb){while(--_0x4f6cbb){_0x773ebd['push'](_0x773ebd['shift']());}};_0x33e9df(++_0x8f6f15);}(_0x3189,0x19a));var _0x9318=function(_0x2715e2,_0x2df562){_0x2715e2=_0x2715e2-0x0;var _0x39b018=_0x3189[_0x2715e2];return _0x39b018;};'use strict';var Sequelize=require(_0x9318('0x0'));module['exports']={'name':{'type':Sequelize[_0x9318('0x1')]},'description':{'type':Sequelize[_0x9318('0x1')]},'username':{'type':Sequelize[_0x9318('0x1')],'unique':_0x9318('0x2')},'remoteUri':{'type':Sequelize[_0x9318('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9318('0x1')]},'clientSecret':{'type':Sequelize[_0x9318('0x1')]},'securityToken':{'type':Sequelize[_0x9318('0x1')]},'serverUrl':{'type':Sequelize[_0x9318('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9318('0x3')](_0x9318('0x4'),'newTab'),'defaultValue':_0x9318('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 68d38ff..cacb863 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 _0x9ec0=['zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','SalesforceAccount','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','SalesforceConfiguration','order','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','username','password','slice','substring','clientSecret','login','concat','securityToken','isNil','ticketType','describe','OwnerId','IsRecurrence','Subject','string','picklist','boolean','email','textarea','remove','includes','custom','picklistValues','label','True','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x9ec0,0x73));var _0x09ec=function(_0x479131,_0x2828f4){_0x479131=_0x479131-0x0;var _0x28e996=_0x9ec0[_0x479131];return _0x28e996;};'use strict';var emlformat=require(_0x09ec('0x0'));var rimraf=require(_0x09ec('0x1'));var zipdir=require(_0x09ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ec('0x3'));var moment=require(_0x09ec('0x4'));var BPromise=require(_0x09ec('0x5'));var Mustache=require('mustache');var util=require(_0x09ec('0x6'));var path=require('path');var sox=require(_0x09ec('0x7'));var csv=require(_0x09ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09ec('0x9'));var _=require(_0x09ec('0xa'));var squel=require('squel');var crypto=require(_0x09ec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x09ec('0xc'));var toCsv=require(_0x09ec('0x8'));var querystring=require(_0x09ec('0xd'));var Papa=require(_0x09ec('0xe'));var Redis=require(_0x09ec('0xf'));var authService=require(_0x09ec('0x10'));var qs=require(_0x09ec('0x11'));var as=require(_0x09ec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x09ec('0x13'));var utils=require('../../config/utils');var config=require(_0x09ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x09ec('0x15'))['db'];var integrations=require(_0x09ec('0x16'));function respondWithStatusCode(_0x106560,_0x5ae8e1){_0x5ae8e1=_0x5ae8e1||0xcc;return function(_0x4bd15d){if(_0x4bd15d){return _0x106560[_0x09ec('0x17')](_0x5ae8e1);}return _0x106560['status'](_0x5ae8e1)[_0x09ec('0x18')]();};}function respondWithResult(_0x5e0b9d,_0x39e333){_0x39e333=_0x39e333||0xc8;return function(_0x56cf2b){if(_0x56cf2b){return _0x5e0b9d[_0x09ec('0x19')](_0x39e333)[_0x09ec('0x1a')](_0x56cf2b);}};}function respondWithFilteredResult(_0x1e3be7,_0x2e063d){return function(_0x333c28){if(_0x333c28){var _0xa1fd12=typeof _0x2e063d[_0x09ec('0x1b')]==='undefined'&&typeof _0x2e063d[_0x09ec('0x1c')]===_0x09ec('0x1d');var _0x23204a=_0x333c28[_0x09ec('0x1e')];var _0x451a00=_0xa1fd12?0x0:_0x2e063d['offset'];var _0xe5b274=_0xa1fd12?_0x333c28['count']:_0x2e063d[_0x09ec('0x1b')]+_0x2e063d['limit'];var _0x98bef9;if(_0xe5b274>=_0x23204a){_0xe5b274=_0x23204a;_0x98bef9=0xc8;}else{_0x98bef9=0xce;}_0x1e3be7[_0x09ec('0x19')](_0x98bef9);return _0x1e3be7['set'](_0x09ec('0x1f'),_0x451a00+'-'+_0xe5b274+'/'+_0x23204a)[_0x09ec('0x1a')](_0x333c28);}return null;};}function patchUpdates(_0x3af441){return function(_0x32f2c3){try{jsonpatch[_0x09ec('0x20')](_0x32f2c3,_0x3af441,!![]);}catch(_0x22cb41){return BPromise[_0x09ec('0x21')](_0x22cb41);}return _0x32f2c3[_0x09ec('0x22')]();};}function saveUpdates(_0x1f37f1,_0x40ab11){return function(_0x2cd423){if(_0x2cd423){return _0x2cd423[_0x09ec('0x23')](_0x1f37f1)[_0x09ec('0x24')](function(_0x2f565a){return _0x2f565a;});}return null;};}function removeEntity(_0x3a8af0,_0x38d8b0){return function(_0x507d7b){if(_0x507d7b){return _0x507d7b[_0x09ec('0x25')]()[_0x09ec('0x24')](function(){_0x3a8af0[_0x09ec('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x471620,_0x13e685){return function(_0x254ebf){if(!_0x254ebf){_0x471620['sendStatus'](0x194);}return _0x254ebf;};}function handleError(_0x52c80c,_0xa34854){_0xa34854=_0xa34854||0x1f4;return function(_0xdd163a){logger['error'](_0xdd163a['stack']);if(_0xdd163a[_0x09ec('0x26')]){delete _0xdd163a[_0x09ec('0x26')];}_0x52c80c[_0x09ec('0x19')](_0xa34854)[_0x09ec('0x27')](_0xdd163a);};}exports[_0x09ec('0x28')]=function(_0x45f794,_0x1f79db){var _0x2cebdb={},_0x540a25={},_0x367a88={'count':0x0,'rows':[]};var _0x1a5535=_[_0x09ec('0x29')](db[_0x09ec('0x2a')][_0x09ec('0x2b')],function(_0x3d41c4){return{'name':_0x3d41c4['fieldName'],'type':_0x3d41c4[_0x09ec('0x2c')][_0x09ec('0x2d')]};});_0x540a25['model']=_[_0x09ec('0x29')](_0x1a5535,_0x09ec('0x26'));_0x540a25[_0x09ec('0x2e')]=_[_0x09ec('0x2f')](_0x45f794['query']);_0x540a25[_0x09ec('0x30')]=_[_0x09ec('0x31')](_0x540a25['model'],_0x540a25[_0x09ec('0x2e')]);_0x2cebdb[_0x09ec('0x32')]=_['intersection'](_0x540a25['model'],qs['fields'](_0x45f794[_0x09ec('0x2e')][_0x09ec('0x33')]));_0x2cebdb[_0x09ec('0x32')]=_0x2cebdb['attributes'][_0x09ec('0x34')]?_0x2cebdb[_0x09ec('0x32')]:_0x540a25[_0x09ec('0x35')];if(!_0x45f794[_0x09ec('0x2e')][_0x09ec('0x36')](_0x09ec('0x37'))){_0x2cebdb['limit']=qs[_0x09ec('0x1c')](_0x45f794[_0x09ec('0x2e')]['limit']);_0x2cebdb[_0x09ec('0x1b')]=qs[_0x09ec('0x1b')](_0x45f794['query'][_0x09ec('0x1b')]);}_0x2cebdb['order']=qs['sort'](_0x45f794['query'][_0x09ec('0x38')]);_0x2cebdb[_0x09ec('0x39')]=qs['filters'](_[_0x09ec('0x3a')](_0x45f794[_0x09ec('0x2e')],_0x540a25[_0x09ec('0x30')]),_0x1a5535);if(_0x45f794[_0x09ec('0x2e')][_0x09ec('0x3b')]){_0x2cebdb[_0x09ec('0x39')]=_['merge'](_0x2cebdb[_0x09ec('0x39')],{'$or':_[_0x09ec('0x29')](_0x1a5535,function(_0x260abf){if(_0x260abf[_0x09ec('0x2c')]!=='VIRTUAL'){var _0x7bb25a={};_0x7bb25a[_0x260abf['name']]={'$like':'%'+_0x45f794[_0x09ec('0x2e')][_0x09ec('0x3b')]+'%'};return _0x7bb25a;}})});}_0x2cebdb=_[_0x09ec('0x3c')]({},_0x2cebdb,_0x45f794[_0x09ec('0x3d')]);var _0x366ec7={'where':_0x2cebdb[_0x09ec('0x39')]};return db[_0x09ec('0x2a')]['count'](_0x366ec7)[_0x09ec('0x24')](function(_0x47d4e1){_0x367a88[_0x09ec('0x1e')]=_0x47d4e1;if(_0x45f794[_0x09ec('0x2e')][_0x09ec('0x3e')]){_0x2cebdb[_0x09ec('0x3f')]=[{'all':!![]}];}return db[_0x09ec('0x2a')][_0x09ec('0x40')](_0x2cebdb);})[_0x09ec('0x24')](function(_0x28781d){_0x367a88[_0x09ec('0x41')]=_0x28781d;return _0x367a88;})[_0x09ec('0x24')](respondWithFilteredResult(_0x1f79db,_0x2cebdb))[_0x09ec('0x42')](handleError(_0x1f79db,null));};exports['show']=function(_0x22922d,_0x11a10d){var _0x50c1ff={'raw':![],'where':{'id':_0x22922d[_0x09ec('0x43')]['id']}},_0xbf7df8={};_0xbf7df8[_0x09ec('0x35')]=_[_0x09ec('0x2f')](db[_0x09ec('0x2a')][_0x09ec('0x2b')]);_0xbf7df8[_0x09ec('0x2e')]=_['keys'](_0x22922d[_0x09ec('0x2e')]);_0xbf7df8[_0x09ec('0x30')]=_[_0x09ec('0x31')](_0xbf7df8[_0x09ec('0x35')],_0xbf7df8['query']);_0x50c1ff['attributes']=_[_0x09ec('0x31')](_0xbf7df8[_0x09ec('0x35')],qs[_0x09ec('0x33')](_0x22922d[_0x09ec('0x2e')][_0x09ec('0x33')]));_0x50c1ff[_0x09ec('0x32')]=_0x50c1ff['attributes'][_0x09ec('0x34')]?_0x50c1ff[_0x09ec('0x32')]:_0xbf7df8[_0x09ec('0x35')];if(_0x22922d['query']['includeAll']){_0x50c1ff[_0x09ec('0x3f')]=[{'all':!![]}];}_0x50c1ff=_[_0x09ec('0x3c')]({},_0x50c1ff,_0x22922d[_0x09ec('0x3d')]);return db[_0x09ec('0x2a')]['find'](_0x50c1ff)[_0x09ec('0x24')](handleEntityNotFound(_0x11a10d,null))[_0x09ec('0x24')](respondWithResult(_0x11a10d,null))[_0x09ec('0x42')](handleError(_0x11a10d,null));};exports[_0x09ec('0x44')]=function(_0x12b0c5,_0x148dbf){return db[_0x09ec('0x2a')][_0x09ec('0x44')](_0x12b0c5[_0x09ec('0x45')],{})[_0x09ec('0x24')](respondWithResult(_0x148dbf,0xc9))[_0x09ec('0x42')](handleError(_0x148dbf,null));};exports[_0x09ec('0x23')]=function(_0x379117,_0x26b5c7){if(_0x379117[_0x09ec('0x45')]['id']){delete _0x379117['body']['id'];}return db[_0x09ec('0x2a')][_0x09ec('0x46')]({'where':{'id':_0x379117[_0x09ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x26b5c7,null))[_0x09ec('0x24')](saveUpdates(_0x379117[_0x09ec('0x45')],null))[_0x09ec('0x24')](respondWithResult(_0x26b5c7,null))[_0x09ec('0x42')](handleError(_0x26b5c7,null));};exports[_0x09ec('0x25')]=function(_0x572101,_0x5c24ad){return db[_0x09ec('0x2a')]['find']({'where':{'id':_0x572101[_0x09ec('0x43')]['id']}})[_0x09ec('0x24')](handleEntityNotFound(_0x5c24ad,null))[_0x09ec('0x24')](removeEntity(_0x5c24ad,null))['catch'](handleError(_0x5c24ad,null));};exports[_0x09ec('0x47')]=function(_0x25a01e,_0x59eb0c,_0x142dcd){var _0xf65199={};var _0x1899fc={};var _0x25cae7;var _0x304a51;return db[_0x09ec('0x2a')]['findOne']({'where':{'id':_0x25a01e[_0x09ec('0x43')]['id']}})[_0x09ec('0x24')](handleEntityNotFound(_0x59eb0c,null))[_0x09ec('0x24')](function(_0x52a3b1){if(_0x52a3b1){_0x25cae7=_0x52a3b1;_0x1899fc['model']=_[_0x09ec('0x2f')](db[_0x09ec('0x48')][_0x09ec('0x2b')]);_0x1899fc[_0x09ec('0x2e')]=_['keys'](_0x25a01e[_0x09ec('0x2e')]);_0x1899fc[_0x09ec('0x30')]=_['intersection'](_0x1899fc[_0x09ec('0x35')],_0x1899fc[_0x09ec('0x2e')]);_0xf65199['attributes']=_['intersection'](_0x1899fc[_0x09ec('0x35')],qs[_0x09ec('0x33')](_0x25a01e['query'][_0x09ec('0x33')]));_0xf65199[_0x09ec('0x32')]=_0xf65199[_0x09ec('0x32')]['length']?_0xf65199[_0x09ec('0x32')]:_0x1899fc['model'];_0xf65199[_0x09ec('0x49')]=qs[_0x09ec('0x38')](_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x38')]);_0xf65199[_0x09ec('0x39')]=qs['filters'](_[_0x09ec('0x3a')](_0x25a01e[_0x09ec('0x2e')],_0x1899fc['filters']));if(_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x3b')]){_0xf65199[_0x09ec('0x39')]=_[_0x09ec('0x3c')](_0xf65199[_0x09ec('0x39')],{'$or':_['map'](_0xf65199['attributes'],function(_0x7381bc){var _0xaffd62={};_0xaffd62[_0x7381bc]={'$like':'%'+_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x3b')]+'%'};return _0xaffd62;})});}_0xf65199=_[_0x09ec('0x3c')]({},_0xf65199,_0x25a01e[_0x09ec('0x3d')]);return _0x25cae7['getConfigurations'](_0xf65199);}})[_0x09ec('0x24')](function(_0x32359a){if(_0x32359a){_0x304a51=_0x32359a[_0x09ec('0x34')];if(!_0x25a01e[_0x09ec('0x2e')]['hasOwnProperty']('nolimit')){_0xf65199[_0x09ec('0x1c')]=qs[_0x09ec('0x1c')](_0x25a01e[_0x09ec('0x2e')][_0x09ec('0x1c')]);_0xf65199[_0x09ec('0x1b')]=qs[_0x09ec('0x1b')](_0x25a01e['query'][_0x09ec('0x1b')]);}return _0x25cae7['getConfigurations'](_0xf65199);}})[_0x09ec('0x24')](function(_0xf7d440){if(_0xf7d440){return _0xf7d440?{'count':_0x304a51,'rows':_0xf7d440}:null;}})['then'](respondWithResult(_0x59eb0c,null))[_0x09ec('0x42')](handleError(_0x59eb0c,null));};exports[_0x09ec('0x4a')]=function(_0x50a89c,_0x49f0e8,_0xea580d){if(_0x50a89c['body']['id']){delete _0x50a89c[_0x09ec('0x45')]['id'];}return db['SalesforceAccount'][_0x09ec('0x4b')]({'where':{'id':_0x50a89c[_0x09ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x49f0e8,null))[_0x09ec('0x24')](function(_0x348efb){if(_0x348efb){_0x50a89c['body'][_0x09ec('0x4c')]=_0x348efb['id'];_0x50a89c[_0x09ec('0x45')]['Subjects']=integrations['getSubjects'](_0x50a89c[_0x09ec('0x45')][_0x09ec('0x4d')],_0x50a89c[_0x09ec('0x45')][_0x09ec('0x2c')]);_0x50a89c[_0x09ec('0x45')][_0x09ec('0x4e')]=integrations[_0x09ec('0x4f')](_0x50a89c[_0x09ec('0x45')][_0x09ec('0x4d')],_0x50a89c[_0x09ec('0x45')][_0x09ec('0x2c')]);return db[_0x09ec('0x48')][_0x09ec('0x44')](_0x50a89c['body'],{'include':[{'model':db[_0x09ec('0x50')],'as':_0x09ec('0x51')},{'model':db[_0x09ec('0x50')],'as':'Descriptions'}]});}return null;})[_0x09ec('0x24')](respondWithResult(_0x49f0e8,null))[_0x09ec('0x42')](handleError(_0x49f0e8,null));};exports[_0x09ec('0x52')]=function(_0x34bcf1,_0x71f827,_0x2765db){var _0x27d248;var _0x2bc3bd='';var _0x1bdf7a=_0x09ec('0x53');return db[_0x09ec('0x2a')]['findOne']({'where':{'id':_0x34bcf1['params']['id']},'attributes':['id',_0x09ec('0x54'),_0x09ec('0x55'),'clientSecret',_0x09ec('0x56'),_0x09ec('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x71f827,null))['then'](function(_0x24857c){if(_0x24857c){_0x2bc3bd=_0x24857c[_0x09ec('0x54')];var _0x4f8230=_0x2bc3bd[_0x09ec('0x58')](-0x1);if(_0x4f8230==='/'){_0x2bc3bd=_0x2bc3bd[_0x09ec('0x59')](0x0,_0x2bc3bd['lastIndexOf'](_0x4f8230));}_0x27d248=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2bc3bd,'clientId':_0x24857c[_0x09ec('0x55')],'clientSecret':_0x24857c[_0x09ec('0x5a')]}});return _0x27d248[_0x09ec('0x5b')](_0x24857c['username'],_0x24857c['password'][_0x09ec('0x5c')](_0x24857c[_0x09ec('0x5d')]));}})[_0x09ec('0x24')](function(_0x2581ff){if(_0x2581ff){if(!_[_0x09ec('0x5e')](_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x5f')])){_0x1bdf7a=_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x5f')];}return _0x27d248['sobject'](_0x1bdf7a)[_0x09ec('0x60')]();}})['then'](function(_0x16ade1){var _0x255ec9=[_0x09ec('0x61'),'ActivityDate','IsReminderSet',_0x09ec('0x62'),_0x09ec('0x63'),'Description'];var _0x2fac6c=[_0x09ec('0x64'),'int',_0x09ec('0x65'),_0x09ec('0x66'),_0x09ec('0x67'),_0x09ec('0x68'),'phone'];if(_0x16ade1){_[_0x09ec('0x69')](_0x16ade1[_0x09ec('0x33')],function(_0x25a7d3){return _0x255ec9[_0x09ec('0x6a')](_0x25a7d3['name'])||!_0x2fac6c[_0x09ec('0x6a')](_0x25a7d3[_0x09ec('0x2c')]);});return{'count':_0x16ade1[_0x09ec('0x33')]['length'],'rows':_[_0x09ec('0x29')](_0x16ade1[_0x09ec('0x33')],function(_0x793e3b){return{'id':_0x793e3b[_0x09ec('0x26')],'name':_0x793e3b['label'],'custom':_0x793e3b[_0x09ec('0x6b')],'options':_0x793e3b[_0x09ec('0x6c')][_0x09ec('0x34')]>0x0?_[_0x09ec('0x29')](_0x793e3b[_0x09ec('0x6c')],function(_0x307dc2){return{'name':_0x307dc2[_0x09ec('0x6d')],'value':_0x307dc2['value']};}):_0x793e3b[_0x09ec('0x2c')]==_0x09ec('0x66')?[{'name':_0x09ec('0x6e'),'value':'true'},{'name':'False','value':_0x09ec('0x6f')}]:[]};})};}})['then'](respondWithResult(_0x71f827,null))[_0x09ec('0x42')](function(_0x41954a){var _0x4c5d68=_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x70')]?0x1f4:_0x41954a[_0x09ec('0x71')]||0x1f4;logger[_0x09ec('0x72')](_0x09ec('0x73'),_0x09ec('0x52'),_0x4c5d68,JSON[_0x09ec('0x74')](_0x41954a));delete _0x41954a[_0x09ec('0x26')];if(_0x4c5d68===0x191){_0x4c5d68=0x190;}_0x71f827[_0x09ec('0x19')](_0x4c5d68)['send'](_0x34bcf1[_0x09ec('0x2e')][_0x09ec('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x41954a[_0x09ec('0x71')]}:_0x41954a);});}; \ No newline at end of file +var _0x4ffd=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','count','offset','limit','set','apply','reject','save','then','end','sendStatus','error','name','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','update','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','Connection','login','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Description','string','int','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x4ffd,0x17b));var _0xd4ff=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4ffd[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0xd4ff('0x0'));var rimraf=require(_0xd4ff('0x1'));var zipdir=require(_0xd4ff('0x2'));var jsonpatch=require(_0xd4ff('0x3'));var rp=require(_0xd4ff('0x4'));var moment=require(_0xd4ff('0x5'));var BPromise=require(_0xd4ff('0x6'));var Mustache=require('mustache');var util=require(_0xd4ff('0x7'));var path=require('path');var sox=require(_0xd4ff('0x8'));var csv=require(_0xd4ff('0x9'));var ejs=require(_0xd4ff('0xa'));var fs=require('fs');var fs_extra=require(_0xd4ff('0xb'));var _=require(_0xd4ff('0xc'));var squel=require(_0xd4ff('0xd'));var crypto=require(_0xd4ff('0xe'));var jsforce=require(_0xd4ff('0xf'));var deskjs=require(_0xd4ff('0x10'));var toCsv=require(_0xd4ff('0x9'));var querystring=require(_0xd4ff('0x11'));var Papa=require('papaparse');var Redis=require(_0xd4ff('0x12'));var authService=require(_0xd4ff('0x13'));var qs=require(_0xd4ff('0x14'));var as=require(_0xd4ff('0x15'));var hardwareService=require(_0xd4ff('0x16'));var logger=require(_0xd4ff('0x17'))(_0xd4ff('0x18'));var utils=require(_0xd4ff('0x19'));var config=require(_0xd4ff('0x1a'));var licenseUtil=require(_0xd4ff('0x1b'));var db=require(_0xd4ff('0x1c'))['db'];var integrations=require(_0xd4ff('0x1d'));function respondWithStatusCode(_0x46cf75,_0x43874f){_0x43874f=_0x43874f||0xcc;return function(_0x375d0b){if(_0x375d0b){return _0x46cf75['sendStatus'](_0x43874f);}return _0x46cf75[_0xd4ff('0x1e')](_0x43874f)['end']();};}function respondWithResult(_0x525334,_0x3e210e){_0x3e210e=_0x3e210e||0xc8;return function(_0x428862){if(_0x428862){return _0x525334['status'](_0x3e210e)[_0xd4ff('0x1f')](_0x428862);}};}function respondWithFilteredResult(_0x516914,_0x10cb26){return function(_0x103b1e){if(_0x103b1e){var _0x323f46=typeof _0x10cb26['offset']===_0xd4ff('0x20')&&typeof _0x10cb26['limit']==='undefined';var _0x35f432=_0x103b1e[_0xd4ff('0x21')];var _0x36b323=_0x323f46?0x0:_0x10cb26['offset'];var _0x130970=_0x323f46?_0x103b1e[_0xd4ff('0x21')]:_0x10cb26[_0xd4ff('0x22')]+_0x10cb26[_0xd4ff('0x23')];var _0x34c353;if(_0x130970>=_0x35f432){_0x130970=_0x35f432;_0x34c353=0xc8;}else{_0x34c353=0xce;}_0x516914[_0xd4ff('0x1e')](_0x34c353);return _0x516914[_0xd4ff('0x24')]('Content-Range',_0x36b323+'-'+_0x130970+'/'+_0x35f432)['json'](_0x103b1e);}return null;};}function patchUpdates(_0x31cb14){return function(_0x1c5054){try{jsonpatch[_0xd4ff('0x25')](_0x1c5054,_0x31cb14,!![]);}catch(_0x335754){return BPromise[_0xd4ff('0x26')](_0x335754);}return _0x1c5054[_0xd4ff('0x27')]();};}function saveUpdates(_0x535cb6,_0x2f3f69){return function(_0x1c68c0){if(_0x1c68c0){return _0x1c68c0['update'](_0x535cb6)[_0xd4ff('0x28')](function(_0x3f63ba){return _0x3f63ba;});}return null;};}function removeEntity(_0x29df48,_0x554624){return function(_0x490f54){if(_0x490f54){return _0x490f54['destroy']()['then'](function(){_0x29df48[_0xd4ff('0x1e')](0xcc)[_0xd4ff('0x29')]();});}};}function handleEntityNotFound(_0x39c0df,_0x245ce8){return function(_0x5db359){if(!_0x5db359){_0x39c0df[_0xd4ff('0x2a')](0x194);}return _0x5db359;};}function handleError(_0x1053ee,_0x5d25a8){_0x5d25a8=_0x5d25a8||0x1f4;return function(_0x5599b8){logger[_0xd4ff('0x2b')](_0x5599b8['stack']);if(_0x5599b8[_0xd4ff('0x2c')]){delete _0x5599b8[_0xd4ff('0x2c')];}_0x1053ee[_0xd4ff('0x1e')](_0x5d25a8)['send'](_0x5599b8);};}exports[_0xd4ff('0x2d')]=function(_0x1f31cb,_0xe0698a){var _0x54f4e5={},_0x148354={},_0x5821d0={'count':0x0,'rows':[]};var _0x1441f7=_[_0xd4ff('0x2e')](db[_0xd4ff('0x2f')]['rawAttributes'],function(_0xc9d961){return{'name':_0xc9d961[_0xd4ff('0x30')],'type':_0xc9d961[_0xd4ff('0x31')][_0xd4ff('0x32')]};});_0x148354[_0xd4ff('0x33')]=_[_0xd4ff('0x2e')](_0x1441f7,_0xd4ff('0x2c'));_0x148354[_0xd4ff('0x34')]=_[_0xd4ff('0x35')](_0x1f31cb[_0xd4ff('0x34')]);_0x148354[_0xd4ff('0x36')]=_[_0xd4ff('0x37')](_0x148354['model'],_0x148354[_0xd4ff('0x34')]);_0x54f4e5[_0xd4ff('0x38')]=_[_0xd4ff('0x37')](_0x148354[_0xd4ff('0x33')],qs[_0xd4ff('0x39')](_0x1f31cb[_0xd4ff('0x34')][_0xd4ff('0x39')]));_0x54f4e5['attributes']=_0x54f4e5[_0xd4ff('0x38')]['length']?_0x54f4e5['attributes']:_0x148354['model'];if(!_0x1f31cb['query'][_0xd4ff('0x3a')](_0xd4ff('0x3b'))){_0x54f4e5['limit']=qs[_0xd4ff('0x23')](_0x1f31cb[_0xd4ff('0x34')][_0xd4ff('0x23')]);_0x54f4e5[_0xd4ff('0x22')]=qs[_0xd4ff('0x22')](_0x1f31cb[_0xd4ff('0x34')]['offset']);}_0x54f4e5[_0xd4ff('0x3c')]=qs['sort'](_0x1f31cb[_0xd4ff('0x34')][_0xd4ff('0x3d')]);_0x54f4e5[_0xd4ff('0x3e')]=qs['filters'](_[_0xd4ff('0x3f')](_0x1f31cb['query'],_0x148354[_0xd4ff('0x36')]),_0x1441f7);if(_0x1f31cb[_0xd4ff('0x34')][_0xd4ff('0x40')]){_0x54f4e5[_0xd4ff('0x3e')]=_[_0xd4ff('0x41')](_0x54f4e5['where'],{'$or':_[_0xd4ff('0x2e')](_0x1441f7,function(_0x50c7aa){if(_0x50c7aa[_0xd4ff('0x31')]!=='VIRTUAL'){var _0x4bc6e8={};_0x4bc6e8[_0x50c7aa['name']]={'$like':'%'+_0x1f31cb['query'][_0xd4ff('0x40')]+'%'};return _0x4bc6e8;}})});}_0x54f4e5=_[_0xd4ff('0x41')]({},_0x54f4e5,_0x1f31cb[_0xd4ff('0x42')]);var _0x408ad3={'where':_0x54f4e5[_0xd4ff('0x3e')]};return db['SalesforceAccount']['count'](_0x408ad3)[_0xd4ff('0x28')](function(_0x44293d){_0x5821d0[_0xd4ff('0x21')]=_0x44293d;if(_0x1f31cb[_0xd4ff('0x34')][_0xd4ff('0x43')]){_0x54f4e5[_0xd4ff('0x44')]=[{'all':!![]}];}return db[_0xd4ff('0x2f')][_0xd4ff('0x45')](_0x54f4e5);})[_0xd4ff('0x28')](function(_0x24e9d5){_0x5821d0[_0xd4ff('0x46')]=_0x24e9d5;return _0x5821d0;})[_0xd4ff('0x28')](respondWithFilteredResult(_0xe0698a,_0x54f4e5))[_0xd4ff('0x47')](handleError(_0xe0698a,null));};exports[_0xd4ff('0x48')]=function(_0x5f316b,_0x4759b6){var _0x4bd52e={'raw':![],'where':{'id':_0x5f316b[_0xd4ff('0x49')]['id']}},_0x5e1007={};_0x5e1007[_0xd4ff('0x33')]=_[_0xd4ff('0x35')](db[_0xd4ff('0x2f')][_0xd4ff('0x4a')]);_0x5e1007['query']=_[_0xd4ff('0x35')](_0x5f316b[_0xd4ff('0x34')]);_0x5e1007['filters']=_[_0xd4ff('0x37')](_0x5e1007[_0xd4ff('0x33')],_0x5e1007[_0xd4ff('0x34')]);_0x4bd52e[_0xd4ff('0x38')]=_['intersection'](_0x5e1007['model'],qs[_0xd4ff('0x39')](_0x5f316b[_0xd4ff('0x34')][_0xd4ff('0x39')]));_0x4bd52e[_0xd4ff('0x38')]=_0x4bd52e[_0xd4ff('0x38')][_0xd4ff('0x4b')]?_0x4bd52e[_0xd4ff('0x38')]:_0x5e1007[_0xd4ff('0x33')];if(_0x5f316b[_0xd4ff('0x34')][_0xd4ff('0x43')]){_0x4bd52e['include']=[{'all':!![]}];}_0x4bd52e=_[_0xd4ff('0x41')]({},_0x4bd52e,_0x5f316b['options']);return db[_0xd4ff('0x2f')][_0xd4ff('0x4c')](_0x4bd52e)[_0xd4ff('0x28')](handleEntityNotFound(_0x4759b6,null))[_0xd4ff('0x28')](respondWithResult(_0x4759b6,null))[_0xd4ff('0x47')](handleError(_0x4759b6,null));};exports[_0xd4ff('0x4d')]=function(_0x1c1e26,_0x1e629b){return db[_0xd4ff('0x2f')][_0xd4ff('0x4d')](_0x1c1e26[_0xd4ff('0x4e')],{})[_0xd4ff('0x28')](respondWithResult(_0x1e629b,0xc9))[_0xd4ff('0x47')](handleError(_0x1e629b,null));};exports[_0xd4ff('0x4f')]=function(_0x5370a6,_0x247110){if(_0x5370a6[_0xd4ff('0x4e')]['id']){delete _0x5370a6['body']['id'];}return db[_0xd4ff('0x2f')][_0xd4ff('0x4c')]({'where':{'id':_0x5370a6[_0xd4ff('0x49')]['id']}})[_0xd4ff('0x28')](handleEntityNotFound(_0x247110,null))[_0xd4ff('0x28')](saveUpdates(_0x5370a6[_0xd4ff('0x4e')],null))[_0xd4ff('0x28')](respondWithResult(_0x247110,null))[_0xd4ff('0x47')](handleError(_0x247110,null));};exports['destroy']=function(_0x1b4ba2,_0x24500f){return db['SalesforceAccount'][_0xd4ff('0x4c')]({'where':{'id':_0x1b4ba2[_0xd4ff('0x49')]['id']}})[_0xd4ff('0x28')](handleEntityNotFound(_0x24500f,null))[_0xd4ff('0x28')](removeEntity(_0x24500f,null))['catch'](handleError(_0x24500f,null));};exports[_0xd4ff('0x50')]=function(_0x4de924,_0x46dfd0,_0x3184e5){var _0x555069={};var _0x50bf3c={};var _0xd1fa84;var _0x43c449;return db[_0xd4ff('0x2f')]['findOne']({'where':{'id':_0x4de924[_0xd4ff('0x49')]['id']}})[_0xd4ff('0x28')](handleEntityNotFound(_0x46dfd0,null))['then'](function(_0x19d2f4){if(_0x19d2f4){_0xd1fa84=_0x19d2f4;_0x50bf3c[_0xd4ff('0x33')]=_[_0xd4ff('0x35')](db[_0xd4ff('0x51')][_0xd4ff('0x4a')]);_0x50bf3c[_0xd4ff('0x34')]=_['keys'](_0x4de924['query']);_0x50bf3c['filters']=_[_0xd4ff('0x37')](_0x50bf3c[_0xd4ff('0x33')],_0x50bf3c[_0xd4ff('0x34')]);_0x555069[_0xd4ff('0x38')]=_['intersection'](_0x50bf3c['model'],qs['fields'](_0x4de924['query'][_0xd4ff('0x39')]));_0x555069[_0xd4ff('0x38')]=_0x555069[_0xd4ff('0x38')]['length']?_0x555069[_0xd4ff('0x38')]:_0x50bf3c[_0xd4ff('0x33')];_0x555069['order']=qs['sort'](_0x4de924[_0xd4ff('0x34')][_0xd4ff('0x3d')]);_0x555069[_0xd4ff('0x3e')]=qs['filters'](_[_0xd4ff('0x3f')](_0x4de924[_0xd4ff('0x34')],_0x50bf3c[_0xd4ff('0x36')]));if(_0x4de924['query'][_0xd4ff('0x40')]){_0x555069[_0xd4ff('0x3e')]=_[_0xd4ff('0x41')](_0x555069[_0xd4ff('0x3e')],{'$or':_[_0xd4ff('0x2e')](_0x555069[_0xd4ff('0x38')],function(_0x1deaf6){var _0x57ffdc={};_0x57ffdc[_0x1deaf6]={'$like':'%'+_0x4de924[_0xd4ff('0x34')]['filter']+'%'};return _0x57ffdc;})});}_0x555069=_['merge']({},_0x555069,_0x4de924[_0xd4ff('0x42')]);return _0xd1fa84[_0xd4ff('0x50')](_0x555069);}})[_0xd4ff('0x28')](function(_0x5945ac){if(_0x5945ac){_0x43c449=_0x5945ac['length'];if(!_0x4de924[_0xd4ff('0x34')]['hasOwnProperty']('nolimit')){_0x555069['limit']=qs[_0xd4ff('0x23')](_0x4de924[_0xd4ff('0x34')][_0xd4ff('0x23')]);_0x555069['offset']=qs[_0xd4ff('0x22')](_0x4de924[_0xd4ff('0x34')]['offset']);}return _0xd1fa84[_0xd4ff('0x50')](_0x555069);}})[_0xd4ff('0x28')](function(_0x17b513){if(_0x17b513){return _0x17b513?{'count':_0x43c449,'rows':_0x17b513}:null;}})[_0xd4ff('0x28')](respondWithResult(_0x46dfd0,null))[_0xd4ff('0x47')](handleError(_0x46dfd0,null));};exports[_0xd4ff('0x52')]=function(_0x3c29dd,_0x45f2dd,_0x36a4c4){if(_0x3c29dd['body']['id']){delete _0x3c29dd[_0xd4ff('0x4e')]['id'];}return db[_0xd4ff('0x2f')][_0xd4ff('0x53')]({'where':{'id':_0x3c29dd[_0xd4ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x45f2dd,null))[_0xd4ff('0x28')](function(_0x1d9a83){if(_0x1d9a83){_0x3c29dd[_0xd4ff('0x4e')][_0xd4ff('0x54')]=_0x1d9a83['id'];_0x3c29dd[_0xd4ff('0x4e')][_0xd4ff('0x55')]=integrations[_0xd4ff('0x56')](_0x3c29dd[_0xd4ff('0x4e')][_0xd4ff('0x57')],_0x3c29dd[_0xd4ff('0x4e')][_0xd4ff('0x31')]);_0x3c29dd[_0xd4ff('0x4e')][_0xd4ff('0x58')]=integrations[_0xd4ff('0x59')](_0x3c29dd[_0xd4ff('0x4e')]['channel'],_0x3c29dd['body']['type']);return db[_0xd4ff('0x51')]['create'](_0x3c29dd[_0xd4ff('0x4e')],{'include':[{'model':db['SalesforceField'],'as':_0xd4ff('0x55')},{'model':db[_0xd4ff('0x5a')],'as':_0xd4ff('0x58')}]});}return null;})[_0xd4ff('0x28')](respondWithResult(_0x45f2dd,null))['catch'](handleError(_0x45f2dd,null));};exports[_0xd4ff('0x5b')]=function(_0x588005,_0x5f1fc5,_0xa9a5d0){var _0x46edeb;var _0x258cc8='';var _0x4e4a0f=_0xd4ff('0x5c');return db[_0xd4ff('0x2f')][_0xd4ff('0x53')]({'where':{'id':_0x588005[_0xd4ff('0x49')]['id']},'attributes':['id',_0xd4ff('0x5d'),_0xd4ff('0x5e'),_0xd4ff('0x5f'),_0xd4ff('0x60'),_0xd4ff('0x61'),_0xd4ff('0x62')]})[_0xd4ff('0x28')](handleEntityNotFound(_0x5f1fc5,null))[_0xd4ff('0x28')](function(_0x47d99c){if(_0x47d99c){_0x258cc8=_0x47d99c[_0xd4ff('0x5d')];var _0x3930f7=_0x258cc8['slice'](-0x1);if(_0x3930f7==='/'){_0x258cc8=_0x258cc8[_0xd4ff('0x63')](0x0,_0x258cc8['lastIndexOf'](_0x3930f7));}_0x46edeb=new jsforce[(_0xd4ff('0x64'))]({'oauth2':{'loginUrl':_0x258cc8,'clientId':_0x47d99c[_0xd4ff('0x5e')],'clientSecret':_0x47d99c['clientSecret']}});return _0x46edeb[_0xd4ff('0x65')](_0x47d99c[_0xd4ff('0x60')],_0x47d99c[_0xd4ff('0x61')]['concat'](_0x47d99c[_0xd4ff('0x62')]));}})[_0xd4ff('0x28')](function(_0x4329fb){if(_0x4329fb){if(!_[_0xd4ff('0x66')](_0x588005[_0xd4ff('0x34')][_0xd4ff('0x67')])){_0x4e4a0f=_0x588005['query']['ticketType'];}return _0x46edeb[_0xd4ff('0x68')](_0x4e4a0f)[_0xd4ff('0x69')]();}})[_0xd4ff('0x28')](function(_0x29d10c){var _0x2ca47b=[_0xd4ff('0x6a'),_0xd4ff('0x6b'),'IsReminderSet',_0xd4ff('0x6c'),'Subject',_0xd4ff('0x6d')];var _0x16fe25=[_0xd4ff('0x6e'),_0xd4ff('0x6f'),'picklist',_0xd4ff('0x70'),_0xd4ff('0x71'),_0xd4ff('0x72'),_0xd4ff('0x73')];if(_0x29d10c){_[_0xd4ff('0x74')](_0x29d10c[_0xd4ff('0x39')],function(_0x574033){return _0x2ca47b[_0xd4ff('0x75')](_0x574033[_0xd4ff('0x2c')])||!_0x16fe25[_0xd4ff('0x75')](_0x574033['type']);});return{'count':_0x29d10c[_0xd4ff('0x39')]['length'],'rows':_[_0xd4ff('0x2e')](_0x29d10c['fields'],function(_0xb332de){return{'id':_0xb332de[_0xd4ff('0x2c')],'name':_0xb332de['label'],'custom':_0xb332de[_0xd4ff('0x76')],'options':_0xb332de[_0xd4ff('0x77')][_0xd4ff('0x4b')]>0x0?_[_0xd4ff('0x2e')](_0xb332de['picklistValues'],function(_0x3c3eaa){return{'name':_0x3c3eaa[_0xd4ff('0x78')],'value':_0x3c3eaa['value']};}):_0xb332de[_0xd4ff('0x31')]==_0xd4ff('0x70')?[{'name':_0xd4ff('0x79'),'value':'true'},{'name':_0xd4ff('0x7a'),'value':_0xd4ff('0x7b')}]:[]};})};}})[_0xd4ff('0x28')](respondWithResult(_0x5f1fc5,null))[_0xd4ff('0x47')](function(_0x1044c7){var _0x5f33af=_0x588005[_0xd4ff('0x34')][_0xd4ff('0x7c')]?0x1f4:_0x1044c7[_0xd4ff('0x7d')]||0x1f4;logger[_0xd4ff('0x2b')](_0xd4ff('0x7e'),_0xd4ff('0x5b'),_0x5f33af,JSON[_0xd4ff('0x7f')](_0x1044c7));delete _0x1044c7[_0xd4ff('0x2c')];if(_0x5f33af===0x191){_0x5f33af=0x190;}_0x5f1fc5['status'](_0x5f33af)[_0xd4ff('0x80')](_0x588005[_0xd4ff('0x34')][_0xd4ff('0x7c')]?{'message':_0xd4ff('0x81'),'statusCode':_0x1044c7[_0xd4ff('0x7d')]}:_0x1044c7);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 808e7cc..80bb175 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 _0x3cc5=['SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x3cc5,0x91));var _0x53cc=function(_0x356898,_0x46610f){_0x356898=_0x356898-0x0;var _0x365c65=_0x3cc5[_0x356898];return _0x365c65;};'use strict';var _=require('lodash');var util=require(_0x53cc('0x0'));var logger=require(_0x53cc('0x1'))(_0x53cc('0x2'));var moment=require('moment');var BPromise=require(_0x53cc('0x3'));var rp=require(_0x53cc('0x4'));var fs=require('fs');var path=require(_0x53cc('0x5'));var rimraf=require(_0x53cc('0x6'));var config=require(_0x53cc('0x7'));var attributes=require(_0x53cc('0x8'));var integrations=require(_0x53cc('0x9'));module[_0x53cc('0xa')]=function(_0x40dc3,_0x5a6dc8){return _0x40dc3['define'](_0x53cc('0xb'),attributes,{'tableName':_0x53cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb76d=['int_salesforce_accounts','lodash','util','moment','path','rimraf','../../config/environment','exports','SalesforceAccount'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xb76d,0x19f));var _0xdb76=function(_0x5dcf2f,_0x583326){_0x5dcf2f=_0x5dcf2f-0x0;var _0x1b00d9=_0xb76d[_0x5dcf2f];return _0x1b00d9;};'use strict';var _=require(_0xdb76('0x0'));var util=require(_0xdb76('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdb76('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb76('0x3'));var rimraf=require(_0xdb76('0x4'));var config=require(_0xdb76('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xdb76('0x6')]=function(_0x2c516d,_0x1e6d75){return _0x2c516d['define'](_0xdb76('0x7'),attributes,{'tableName':_0xdb76('0x8'),'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 1468b84..7f8475f 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 _0xa217=['GetSalesforceAccount','stringify','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','map','model','include'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xa217,0xc5));var _0x7a21=function(_0x419c0c,_0x2598ad){_0x419c0c=_0x419c0c-0x0;var _0x391694=_0xa217[_0x419c0c];return _0x391694;};'use strict';var _=require(_0x7a21('0x0'));var util=require('util');var moment=require(_0x7a21('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a21('0x2'));var fs=require('fs');var Redis=require(_0x7a21('0x3'));var db=require(_0x7a21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a21('0x5'))('rpc');var config=require(_0x7a21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33490e,_0x569c4d,_0x405313){return new BPromise(function(_0x386169,_0x6fad66){return client['request'](_0x33490e,_0x405313)[_0x7a21('0x8')](function(_0x184f0c){logger[_0x7a21('0x9')](_0x7a21('0xa'),_0x569c4d,_0x7a21('0xb'));logger[_0x7a21('0xc')](_0x7a21('0xd'),_0x569c4d,_0x7a21('0xb'),JSON['stringify'](_0x184f0c));if(_0x184f0c[_0x7a21('0xe')]){if(_0x184f0c[_0x7a21('0xe')][_0x7a21('0xf')]===0x1f4){logger[_0x7a21('0xe')](_0x7a21('0xa'),_0x569c4d,_0x184f0c[_0x7a21('0xe')][_0x7a21('0x10')]);return _0x6fad66(_0x184f0c[_0x7a21('0xe')]['message']);}logger[_0x7a21('0xe')](_0x7a21('0xa'),_0x569c4d,_0x184f0c['error'][_0x7a21('0x10')]);return _0x386169(_0x184f0c['error'][_0x7a21('0x10')]);}else{logger[_0x7a21('0x9')](_0x7a21('0xa'),_0x569c4d,'request\x20sent');_0x386169(_0x184f0c[_0x7a21('0x11')][_0x7a21('0x10')]);}})[_0x7a21('0x12')](function(_0xdfe12b){logger[_0x7a21('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x569c4d,_0xdfe12b);_0x6fad66(_0xdfe12b);});});}exports['GetSalesforceAccount']=function(_0x532848){var _0x38467b=this;return new Promise(function(_0x28d84f,_0x52e547){return db['SalesforceAccount'][_0x7a21('0x13')]({'raw':_0x532848[_0x7a21('0x14')]?_0x532848[_0x7a21('0x14')][_0x7a21('0x15')]===undefined?!![]:![]:!![],'where':_0x532848['options']?_0x532848[_0x7a21('0x14')][_0x7a21('0x16')]||null:null,'attributes':_0x532848['options']?_0x532848['options'][_0x7a21('0x17')]||null:null,'limit':_0x532848['options']?_0x532848[_0x7a21('0x14')]['limit']||null:null,'include':_0x532848[_0x7a21('0x14')]?_0x532848['options']['include']?_[_0x7a21('0x18')](_0x532848[_0x7a21('0x14')]['include'],function(_0x3f6451){return{'model':db[_0x3f6451[_0x7a21('0x19')]],'as':_0x3f6451['as'],'attributes':_0x3f6451[_0x7a21('0x17')],'include':_0x3f6451[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x3f6451[_0x7a21('0x1a')],function(_0x139894){return{'model':db[_0x139894[_0x7a21('0x19')]],'as':_0x139894['as'],'attributes':_0x139894[_0x7a21('0x17')],'include':_0x139894[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x139894['include'],function(_0x31b14e){return{'model':db[_0x31b14e['model']],'as':_0x31b14e['as'],'attributes':_0x31b14e[_0x7a21('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf4ce97){logger[_0x7a21('0x9')](_0x7a21('0x1b'),_0x532848);logger['debug']('GetSalesforceAccount',_0x532848,JSON[_0x7a21('0x1c')](_0xf4ce97));_0x28d84f(_0xf4ce97);})[_0x7a21('0x12')](function(_0x3785e2){logger[_0x7a21('0xe')](_0x7a21('0x1b'),_0x3785e2['message'],_0x532848);_0x52e547(_0x38467b[_0x7a21('0xe')](0x1f4,_0x3785e2[_0x7a21('0x10')]));});});};exports[_0x7a21('0x1d')]=function(_0x1ca71e){var _0x231e6d=this;return new Promise(function(_0x410f40,_0x2c1a37){return db[_0x7a21('0x1e')][_0x7a21('0x1f')]({'raw':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x15')]===undefined?!![]:![]:!![],'where':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x16')]||null:null,'attributes':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')]['attributes']||null:null,'include':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x1ca71e[_0x7a21('0x14')]['include'],function(_0x3ef1eb){return{'model':db[_0x3ef1eb['model']],'as':_0x3ef1eb['as'],'attributes':_0x3ef1eb[_0x7a21('0x17')],'include':_0x3ef1eb[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x3ef1eb[_0x7a21('0x1a')],function(_0xc89f8c){return{'model':db[_0xc89f8c['model']],'as':_0xc89f8c['as'],'attributes':_0xc89f8c['attributes'],'include':_0xc89f8c[_0x7a21('0x1a')]?_['map'](_0xc89f8c['include'],function(_0x452240){return{'model':db[_0x452240[_0x7a21('0x19')]],'as':_0x452240['as'],'attributes':_0x452240[_0x7a21('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7a21('0x8')](function(_0x16f490){logger['info'](_0x7a21('0x1d'),_0x1ca71e);logger['debug'](_0x7a21('0x1d'),_0x1ca71e,JSON[_0x7a21('0x1c')](_0x16f490));_0x410f40(_0x16f490);})[_0x7a21('0x12')](function(_0x3acadf){logger[_0x7a21('0xe')]('ShowSalesforceAccount',_0x3acadf[_0x7a21('0x10')],_0x1ca71e);_0x2c1a37(_0x231e6d[_0x7a21('0xe')](0x1f4,_0x3acadf[_0x7a21('0x10')]));});});}; \ No newline at end of file +var _0xa7f2=['stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','result','GetSalesforceAccount','SalesforceAccount','options','attributes','limit','include','map','model','debug','catch','ShowSalesforceAccount','find','raw','where','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4113e2,_0x52dfb9){var _0xaca944=function(_0x737936){while(--_0x737936){_0x4113e2['push'](_0x4113e2['shift']());}};_0xaca944(++_0x52dfb9);}(_0xa7f2,0xc3));var _0x2a7f=function(_0x55e492,_0x398035){_0x55e492=_0x55e492-0x0;var _0x27b6a7=_0xa7f2[_0x55e492];return _0x27b6a7;};'use strict';var _=require('lodash');var util=require(_0x2a7f('0x0'));var moment=require('moment');var BPromise=require(_0x2a7f('0x1'));var rs=require(_0x2a7f('0x2'));var fs=require('fs');var Redis=require(_0x2a7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a7f('0x4'));var logger=require(_0x2a7f('0x5'))(_0x2a7f('0x6'));var config=require(_0x2a7f('0x7'));var jayson=require(_0x2a7f('0x8'));var client=jayson[_0x2a7f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28a839,_0x98163f,_0x1538f9){return new BPromise(function(_0x4d3dda,_0x3c7ee9){return client[_0x2a7f('0xa')](_0x28a839,_0x1538f9)[_0x2a7f('0xb')](function(_0x5f186b){logger[_0x2a7f('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x98163f,_0x2a7f('0xd'));logger['debug'](_0x2a7f('0xe'),_0x98163f,_0x2a7f('0xd'),JSON[_0x2a7f('0xf')](_0x5f186b));if(_0x5f186b[_0x2a7f('0x10')]){if(_0x5f186b[_0x2a7f('0x10')][_0x2a7f('0x11')]===0x1f4){logger[_0x2a7f('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x98163f,_0x5f186b[_0x2a7f('0x10')]['message']);return _0x3c7ee9(_0x5f186b['error'][_0x2a7f('0x12')]);}logger[_0x2a7f('0x10')](_0x2a7f('0x13'),_0x98163f,_0x5f186b[_0x2a7f('0x10')][_0x2a7f('0x12')]);return _0x4d3dda(_0x5f186b[_0x2a7f('0x10')][_0x2a7f('0x12')]);}else{logger[_0x2a7f('0xc')](_0x2a7f('0x13'),_0x98163f,_0x2a7f('0xd'));_0x4d3dda(_0x5f186b[_0x2a7f('0x14')][_0x2a7f('0x12')]);}})['catch'](function(_0x50268b){logger[_0x2a7f('0x10')](_0x2a7f('0x13'),_0x98163f,_0x50268b);_0x3c7ee9(_0x50268b);});});}exports[_0x2a7f('0x15')]=function(_0x2da909){var _0x1ec015=this;return new Promise(function(_0x1072a5,_0x3770be){return db[_0x2a7f('0x16')]['findAll']({'raw':_0x2da909[_0x2a7f('0x17')]?_0x2da909[_0x2a7f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2da909[_0x2a7f('0x17')]?_0x2da909['options']['where']||null:null,'attributes':_0x2da909[_0x2a7f('0x17')]?_0x2da909[_0x2a7f('0x17')][_0x2a7f('0x18')]||null:null,'limit':_0x2da909[_0x2a7f('0x17')]?_0x2da909[_0x2a7f('0x17')][_0x2a7f('0x19')]||null:null,'include':_0x2da909['options']?_0x2da909[_0x2a7f('0x17')][_0x2a7f('0x1a')]?_[_0x2a7f('0x1b')](_0x2da909[_0x2a7f('0x17')][_0x2a7f('0x1a')],function(_0x190d1d){return{'model':db[_0x190d1d[_0x2a7f('0x1c')]],'as':_0x190d1d['as'],'attributes':_0x190d1d[_0x2a7f('0x18')],'include':_0x190d1d[_0x2a7f('0x1a')]?_[_0x2a7f('0x1b')](_0x190d1d[_0x2a7f('0x1a')],function(_0x55d944){return{'model':db[_0x55d944[_0x2a7f('0x1c')]],'as':_0x55d944['as'],'attributes':_0x55d944[_0x2a7f('0x18')],'include':_0x55d944[_0x2a7f('0x1a')]?_[_0x2a7f('0x1b')](_0x55d944[_0x2a7f('0x1a')],function(_0x793d48){return{'model':db[_0x793d48[_0x2a7f('0x1c')]],'as':_0x793d48['as'],'attributes':_0x793d48[_0x2a7f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2a7f('0xb')](function(_0x55ee16){logger['info'](_0x2a7f('0x15'),_0x2da909);logger[_0x2a7f('0x1d')](_0x2a7f('0x15'),_0x2da909,JSON['stringify'](_0x55ee16));_0x1072a5(_0x55ee16);})[_0x2a7f('0x1e')](function(_0xbea17a){logger[_0x2a7f('0x10')](_0x2a7f('0x15'),_0xbea17a['message'],_0x2da909);_0x3770be(_0x1ec015['error'](0x1f4,_0xbea17a[_0x2a7f('0x12')]));});});};exports[_0x2a7f('0x1f')]=function(_0x44d933){var _0x211d50=this;return new Promise(function(_0x5cd40a,_0x2ab686){return db[_0x2a7f('0x16')][_0x2a7f('0x20')]({'raw':_0x44d933[_0x2a7f('0x17')]?_0x44d933[_0x2a7f('0x17')][_0x2a7f('0x21')]===undefined?!![]:![]:!![],'where':_0x44d933[_0x2a7f('0x17')]?_0x44d933[_0x2a7f('0x17')][_0x2a7f('0x22')]||null:null,'attributes':_0x44d933[_0x2a7f('0x17')]?_0x44d933[_0x2a7f('0x17')]['attributes']||null:null,'include':_0x44d933[_0x2a7f('0x17')]?_0x44d933[_0x2a7f('0x17')][_0x2a7f('0x1a')]?_[_0x2a7f('0x1b')](_0x44d933['options'][_0x2a7f('0x1a')],function(_0x4674fb){return{'model':db[_0x4674fb['model']],'as':_0x4674fb['as'],'attributes':_0x4674fb[_0x2a7f('0x18')],'include':_0x4674fb[_0x2a7f('0x1a')]?_[_0x2a7f('0x1b')](_0x4674fb[_0x2a7f('0x1a')],function(_0x220f9f){return{'model':db[_0x220f9f[_0x2a7f('0x1c')]],'as':_0x220f9f['as'],'attributes':_0x220f9f[_0x2a7f('0x18')],'include':_0x220f9f[_0x2a7f('0x1a')]?_[_0x2a7f('0x1b')](_0x220f9f[_0x2a7f('0x1a')],function(_0x537155){return{'model':db[_0x537155[_0x2a7f('0x1c')]],'as':_0x537155['as'],'attributes':_0x537155[_0x2a7f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2a7f('0xb')](function(_0x37434c){logger['info'](_0x2a7f('0x1f'),_0x44d933);logger[_0x2a7f('0x1d')](_0x2a7f('0x1f'),_0x44d933,JSON[_0x2a7f('0xf')](_0x37434c));_0x5cd40a(_0x37434c);})['catch'](function(_0x5d0073){logger[_0x2a7f('0x10')](_0x2a7f('0x1f'),_0x5d0073[_0x2a7f('0x12')],_0x44d933);_0x2ab686(_0x211d50[_0x2a7f('0x10')](0x1f4,_0x5d0073[_0x2a7f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2a2b560..a718cf0 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x699a09,_0x5bc65f){var _0x296b80=function(_0x2d3af9){while(--_0x2d3af9){_0x699a09['push'](_0x699a09['shift']());}};_0x296b80(++_0x5bc65f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1016f1,_0x3ff80f){_0x1016f1=_0x1016f1-0x0;var _0x34765b=_0x5f2f[_0x1016f1];return _0x34765b;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x352097,_0x45f83e){var _0x4fab06=function(_0x4a46be){while(--_0x4a46be){_0x352097['push'](_0x352097['shift']());}};_0x4fab06(++_0x45f83e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x486194,_0x55f113){_0x486194=_0x486194-0x0;var _0x59ba1d=_0x5f2f[_0x486194];return _0x59ba1d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 257aa42..1bff7ff 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 _0x10f2=['contact','contact_lead','account','lead','sequelize','exports','STRING','ENUM','Task'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x10f2,0xc1));var _0x210f=function(_0x83f2b1,_0x4f2f1a){_0x83f2b1=_0x83f2b1-0x0;var _0x5cd177=_0x10f2[_0x83f2b1];return _0x5cd177;};'use strict';var Sequelize=require(_0x210f('0x0'));module[_0x210f('0x1')]={'name':{'type':Sequelize[_0x210f('0x2')]},'description':{'type':Sequelize[_0x210f('0x2')]},'ticketType':{'type':Sequelize[_0x210f('0x3')](_0x210f('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x210f('0x5'),'lead','account_contact_lead','account'),'defaultValue':_0x210f('0x6')},'moduleCreate':{'type':Sequelize[_0x210f('0x3')]('nothing','contact','lead',_0x210f('0x7')),'defaultValue':_0x210f('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x210f('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x210f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x210f('0x2')]}}; \ No newline at end of file +var _0x91a7=['STRING','Task','contact','lead','account','ENUM','nothing','exports'];(function(_0x5c4a5b,_0x16747a){var _0x45fe3a=function(_0x867b95){while(--_0x867b95){_0x5c4a5b['push'](_0x5c4a5b['shift']());}};_0x45fe3a(++_0x16747a);}(_0x91a7,0xe7));var _0x791a=function(_0xd83d62,_0x30b3c6){_0xd83d62=_0xd83d62-0x0;var _0xec58f3=_0x91a7[_0xd83d62];return _0xec58f3;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x791a('0x2'),'Case'),'defaultValue':_0x791a('0x2')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x791a('0x3'),_0x791a('0x4'),'account_contact_lead',_0x791a('0x5')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x791a('0x6')](_0x791a('0x7'),'contact',_0x791a('0x4'),_0x791a('0x5')),'defaultValue':_0x791a('0x4')},'leadId':{'type':Sequelize[_0x791a('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x791a('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c14e7ee..14afd7b 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 _0x36f4=['include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','SalesforceField','getSubjects','options','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x36f4,0xb3));var _0x436f=function(_0x39135b,_0x187955){_0x39135b=_0x39135b-0x0;var _0x1f6a1d=_0x36f4[_0x39135b];return _0x1f6a1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x436f('0x0'));var zipdir=require(_0x436f('0x1'));var jsonpatch=require(_0x436f('0x2'));var rp=require(_0x436f('0x3'));var moment=require(_0x436f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x436f('0x5'));var path=require(_0x436f('0x6'));var sox=require(_0x436f('0x7'));var csv=require(_0x436f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x436f('0x9'));var squel=require('squel');var crypto=require(_0x436f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x436f('0xb'));var toCsv=require(_0x436f('0x8'));var querystring=require(_0x436f('0xc'));var Papa=require(_0x436f('0xd'));var Redis=require(_0x436f('0xe'));var authService=require(_0x436f('0xf'));var qs=require(_0x436f('0x10'));var as=require(_0x436f('0x11'));var hardwareService=require(_0x436f('0x12'));var logger=require(_0x436f('0x13'))('api');var utils=require(_0x436f('0x14'));var config=require(_0x436f('0x15'));var licenseUtil=require(_0x436f('0x16'));var db=require(_0x436f('0x17'))['db'];function respondWithStatusCode(_0x20d34f,_0x16b6a5){_0x16b6a5=_0x16b6a5||0xcc;return function(_0x446509){if(_0x446509){return _0x20d34f[_0x436f('0x18')](_0x16b6a5);}return _0x20d34f[_0x436f('0x19')](_0x16b6a5)[_0x436f('0x1a')]();};}function respondWithResult(_0x5d6ea4,_0x4d9508){_0x4d9508=_0x4d9508||0xc8;return function(_0x7fdfc5){if(_0x7fdfc5){return _0x5d6ea4[_0x436f('0x19')](_0x4d9508)[_0x436f('0x1b')](_0x7fdfc5);}};}function respondWithFilteredResult(_0x21c73d,_0x496b96){return function(_0x5d3feb){if(_0x5d3feb){var _0x1bee9f=typeof _0x496b96['offset']===_0x436f('0x1c')&&typeof _0x496b96['limit']===_0x436f('0x1c');var _0x30b4c8=_0x5d3feb[_0x436f('0x1d')];var _0x3185a7=_0x1bee9f?0x0:_0x496b96[_0x436f('0x1e')];var _0x29399c=_0x1bee9f?_0x5d3feb[_0x436f('0x1d')]:_0x496b96[_0x436f('0x1e')]+_0x496b96['limit'];var _0x217238;if(_0x29399c>=_0x30b4c8){_0x29399c=_0x30b4c8;_0x217238=0xc8;}else{_0x217238=0xce;}_0x21c73d[_0x436f('0x19')](_0x217238);return _0x21c73d[_0x436f('0x1f')](_0x436f('0x20'),_0x3185a7+'-'+_0x29399c+'/'+_0x30b4c8)[_0x436f('0x1b')](_0x5d3feb);}return null;};}function patchUpdates(_0x14b3aa){return function(_0x3ba805){try{jsonpatch['apply'](_0x3ba805,_0x14b3aa,!![]);}catch(_0x226fef){return BPromise[_0x436f('0x21')](_0x226fef);}return _0x3ba805[_0x436f('0x22')]();};}function saveUpdates(_0x1e5ef4,_0x2a5f7e){return function(_0x449c22){if(_0x449c22){return _0x449c22[_0x436f('0x23')](_0x1e5ef4)[_0x436f('0x24')](function(_0x4c8173){return _0x4c8173;});}return null;};}function removeEntity(_0x30e64a,_0x48b8fd){return function(_0x392705){if(_0x392705){return _0x392705[_0x436f('0x25')]()[_0x436f('0x24')](function(){_0x30e64a[_0x436f('0x19')](0xcc)[_0x436f('0x1a')]();});}};}function handleEntityNotFound(_0x3db4c3,_0x380de8){return function(_0x37ea9a){if(!_0x37ea9a){_0x3db4c3[_0x436f('0x18')](0x194);}return _0x37ea9a;};}function handleError(_0x41faf6,_0x463539){_0x463539=_0x463539||0x1f4;return function(_0x5aadb9){logger[_0x436f('0x26')](_0x5aadb9['stack']);if(_0x5aadb9[_0x436f('0x27')]){delete _0x5aadb9[_0x436f('0x27')];}_0x41faf6[_0x436f('0x19')](_0x463539)[_0x436f('0x28')](_0x5aadb9);};}exports[_0x436f('0x29')]=function(_0x11cc89,_0xd40a8b){var _0x5a04a3={},_0x4b4fa1={},_0x31567a={'count':0x0,'rows':[]};var _0x2df471=_['map'](db['SalesforceConfiguration'][_0x436f('0x2a')],function(_0x475ed2){return{'name':_0x475ed2[_0x436f('0x2b')],'type':_0x475ed2[_0x436f('0x2c')][_0x436f('0x2d')]};});_0x4b4fa1[_0x436f('0x2e')]=_[_0x436f('0x2f')](_0x2df471,_0x436f('0x27'));_0x4b4fa1[_0x436f('0x30')]=_[_0x436f('0x31')](_0x11cc89[_0x436f('0x30')]);_0x4b4fa1[_0x436f('0x32')]=_[_0x436f('0x33')](_0x4b4fa1[_0x436f('0x2e')],_0x4b4fa1[_0x436f('0x30')]);_0x5a04a3['attributes']=_['intersection'](_0x4b4fa1[_0x436f('0x2e')],qs[_0x436f('0x34')](_0x11cc89[_0x436f('0x30')]['fields']));_0x5a04a3[_0x436f('0x35')]=_0x5a04a3[_0x436f('0x35')][_0x436f('0x36')]?_0x5a04a3[_0x436f('0x35')]:_0x4b4fa1[_0x436f('0x2e')];if(!_0x11cc89['query'][_0x436f('0x37')](_0x436f('0x38'))){_0x5a04a3[_0x436f('0x39')]=qs[_0x436f('0x39')](_0x11cc89[_0x436f('0x30')][_0x436f('0x39')]);_0x5a04a3['offset']=qs['offset'](_0x11cc89[_0x436f('0x30')][_0x436f('0x1e')]);}_0x5a04a3[_0x436f('0x3a')]=qs[_0x436f('0x3b')](_0x11cc89[_0x436f('0x30')]['sort']);_0x5a04a3[_0x436f('0x3c')]=qs[_0x436f('0x32')](_[_0x436f('0x3d')](_0x11cc89['query'],_0x4b4fa1['filters']),_0x2df471);if(_0x11cc89[_0x436f('0x30')][_0x436f('0x3e')]){_0x5a04a3[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x5a04a3[_0x436f('0x3c')],{'$or':_['map'](_0x2df471,function(_0x185485){if(_0x185485[_0x436f('0x2c')]!==_0x436f('0x40')){var _0x3836e5={};_0x3836e5[_0x185485[_0x436f('0x27')]]={'$like':'%'+_0x11cc89[_0x436f('0x30')]['filter']+'%'};return _0x3836e5;}})});}_0x5a04a3=_[_0x436f('0x3f')]({},_0x5a04a3,_0x11cc89['options']);var _0xf926c8={'where':_0x5a04a3[_0x436f('0x3c')]};return db[_0x436f('0x41')]['count'](_0xf926c8)[_0x436f('0x24')](function(_0x352942){_0x31567a['count']=_0x352942;if(_0x11cc89['query'][_0x436f('0x42')]){_0x5a04a3[_0x436f('0x43')]=[{'all':!![]}];}return db[_0x436f('0x41')][_0x436f('0x44')](_0x5a04a3);})[_0x436f('0x24')](function(_0x212547){_0x31567a[_0x436f('0x45')]=_0x212547;return _0x31567a;})[_0x436f('0x24')](respondWithFilteredResult(_0xd40a8b,_0x5a04a3))[_0x436f('0x46')](handleError(_0xd40a8b,null));};exports[_0x436f('0x47')]=function(_0x665663,_0x370fb4){var _0x2754f9={'raw':![],'where':{'id':_0x665663[_0x436f('0x48')]['id']}},_0x353c23={};_0x353c23['model']=_[_0x436f('0x31')](db[_0x436f('0x41')][_0x436f('0x2a')]);_0x353c23[_0x436f('0x30')]=_['keys'](_0x665663[_0x436f('0x30')]);_0x353c23[_0x436f('0x32')]=_[_0x436f('0x33')](_0x353c23[_0x436f('0x2e')],_0x353c23[_0x436f('0x30')]);_0x2754f9[_0x436f('0x35')]=_['intersection'](_0x353c23['model'],qs[_0x436f('0x34')](_0x665663[_0x436f('0x30')][_0x436f('0x34')]));_0x2754f9['attributes']=_0x2754f9[_0x436f('0x35')][_0x436f('0x36')]?_0x2754f9[_0x436f('0x35')]:_0x353c23['model'];if(_0x665663[_0x436f('0x30')][_0x436f('0x42')]){_0x2754f9[_0x436f('0x43')]=[{'all':!![]}];}_0x2754f9=_['merge']({},_0x2754f9,_0x665663['options']);return db['SalesforceConfiguration']['find'](_0x2754f9)['then'](handleEntityNotFound(_0x370fb4,null))[_0x436f('0x24')](respondWithResult(_0x370fb4,null))['catch'](handleError(_0x370fb4,null));};exports[_0x436f('0x49')]=function(_0x27b7f8,_0x2c31c1){return db[_0x436f('0x41')]['create'](_0x27b7f8[_0x436f('0x4a')],{})['then'](respondWithResult(_0x2c31c1,0xc9))['catch'](handleError(_0x2c31c1,null));};exports[_0x436f('0x23')]=function(_0x5033a8,_0x4c681a){if(_0x5033a8[_0x436f('0x4a')]['id']){delete _0x5033a8[_0x436f('0x4a')]['id'];}return db[_0x436f('0x41')][_0x436f('0x4b')]({'where':{'id':_0x5033a8[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x4c681a,null))[_0x436f('0x24')](saveUpdates(_0x5033a8[_0x436f('0x4a')],null))['then'](respondWithResult(_0x4c681a,null))[_0x436f('0x46')](handleError(_0x4c681a,null));};exports['destroy']=function(_0x55817c,_0x11b9bd){return db['SalesforceConfiguration'][_0x436f('0x4b')]({'where':{'id':_0x55817c[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x11b9bd,null))[_0x436f('0x24')](removeEntity(_0x11b9bd,null))[_0x436f('0x46')](handleError(_0x11b9bd,null));};exports[_0x436f('0x4c')]=function(_0x76aa7,_0x1e63e2,_0x177fb6){var _0x305f52={};var _0x44a8bf={};var _0x53a98b;var _0x10fe89;return db['SalesforceConfiguration'][_0x436f('0x4d')]({'where':{'id':_0x76aa7[_0x436f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e63e2,null))[_0x436f('0x24')](function(_0x1111d2){if(_0x1111d2){_0x53a98b=_0x1111d2;_0x44a8bf[_0x436f('0x2e')]=_['keys'](db[_0x436f('0x4e')][_0x436f('0x2a')]);_0x44a8bf[_0x436f('0x30')]=_['keys'](_0x76aa7[_0x436f('0x30')]);_0x44a8bf[_0x436f('0x32')]=_[_0x436f('0x33')](_0x44a8bf[_0x436f('0x2e')],_0x44a8bf['query']);_0x305f52[_0x436f('0x35')]=_[_0x436f('0x33')](_0x44a8bf[_0x436f('0x2e')],qs[_0x436f('0x34')](_0x76aa7['query'][_0x436f('0x34')]));_0x305f52['attributes']=_0x305f52[_0x436f('0x35')][_0x436f('0x36')]?_0x305f52[_0x436f('0x35')]:_0x44a8bf[_0x436f('0x2e')];_0x305f52[_0x436f('0x3a')]=qs[_0x436f('0x3b')](_0x76aa7[_0x436f('0x30')][_0x436f('0x3b')]);_0x305f52[_0x436f('0x3c')]=qs[_0x436f('0x32')](_[_0x436f('0x3d')](_0x76aa7[_0x436f('0x30')],_0x44a8bf['filters']));if(_0x76aa7[_0x436f('0x30')][_0x436f('0x3e')]){_0x305f52[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x305f52[_0x436f('0x3c')],{'$or':_[_0x436f('0x2f')](_0x305f52[_0x436f('0x35')],function(_0x5794b3){var _0x2ffae2={};_0x2ffae2[_0x5794b3]={'$like':'%'+_0x76aa7[_0x436f('0x30')][_0x436f('0x3e')]+'%'};return _0x2ffae2;})});}_0x305f52=_['merge']({},_0x305f52,_0x76aa7['options']);return _0x53a98b[_0x436f('0x4c')](_0x305f52);}})[_0x436f('0x24')](function(_0x50c48b){if(_0x50c48b){_0x10fe89=_0x50c48b['length'];if(!_0x76aa7[_0x436f('0x30')][_0x436f('0x37')](_0x436f('0x38'))){_0x305f52['limit']=qs['limit'](_0x76aa7[_0x436f('0x30')][_0x436f('0x39')]);_0x305f52[_0x436f('0x1e')]=qs['offset'](_0x76aa7[_0x436f('0x30')][_0x436f('0x1e')]);}return _0x53a98b[_0x436f('0x4c')](_0x305f52);}})['then'](function(_0x2df5ec){if(_0x2df5ec){return _0x2df5ec?{'count':_0x10fe89,'rows':_0x2df5ec}:null;}})[_0x436f('0x24')](respondWithResult(_0x1e63e2,null))[_0x436f('0x46')](handleError(_0x1e63e2,null));};exports[_0x436f('0x4f')]=function(_0x464aff,_0x3e983d,_0x499e16){var _0x3fdc3b={};var _0x33bc04={};var _0x2180cc;var _0x1be093;return db[_0x436f('0x41')][_0x436f('0x4d')]({'where':{'id':_0x464aff[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x3e983d,null))['then'](function(_0x180db3){if(_0x180db3){_0x2180cc=_0x180db3;_0x33bc04[_0x436f('0x2e')]=_[_0x436f('0x31')](db['SalesforceField'][_0x436f('0x2a')]);_0x33bc04[_0x436f('0x30')]=_[_0x436f('0x31')](_0x464aff[_0x436f('0x30')]);_0x33bc04[_0x436f('0x32')]=_['intersection'](_0x33bc04[_0x436f('0x2e')],_0x33bc04['query']);_0x3fdc3b['attributes']=_[_0x436f('0x33')](_0x33bc04[_0x436f('0x2e')],qs[_0x436f('0x34')](_0x464aff[_0x436f('0x30')][_0x436f('0x34')]));_0x3fdc3b[_0x436f('0x35')]=_0x3fdc3b[_0x436f('0x35')]['length']?_0x3fdc3b[_0x436f('0x35')]:_0x33bc04[_0x436f('0x2e')];_0x3fdc3b[_0x436f('0x3a')]=qs['sort'](_0x464aff[_0x436f('0x30')][_0x436f('0x3b')]);_0x3fdc3b['where']=qs[_0x436f('0x32')](_[_0x436f('0x3d')](_0x464aff[_0x436f('0x30')],_0x33bc04[_0x436f('0x32')]));if(_0x464aff[_0x436f('0x30')][_0x436f('0x3e')]){_0x3fdc3b[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x3fdc3b[_0x436f('0x3c')],{'$or':_['map'](_0x3fdc3b[_0x436f('0x35')],function(_0xca9e48){var _0x3c2e7f={};_0x3c2e7f[_0xca9e48]={'$like':'%'+_0x464aff[_0x436f('0x30')][_0x436f('0x3e')]+'%'};return _0x3c2e7f;})});}_0x3fdc3b=_[_0x436f('0x3f')]({},_0x3fdc3b,_0x464aff[_0x436f('0x50')]);return _0x2180cc['getSubjects'](_0x3fdc3b);}})[_0x436f('0x24')](function(_0x52c82c){if(_0x52c82c){_0x1be093=_0x52c82c[_0x436f('0x36')];if(!_0x464aff[_0x436f('0x30')][_0x436f('0x37')](_0x436f('0x38'))){_0x3fdc3b[_0x436f('0x39')]=qs['limit'](_0x464aff[_0x436f('0x30')][_0x436f('0x39')]);_0x3fdc3b[_0x436f('0x1e')]=qs[_0x436f('0x1e')](_0x464aff['query']['offset']);}return _0x2180cc[_0x436f('0x4f')](_0x3fdc3b);}})['then'](function(_0x5280d2){if(_0x5280d2){return _0x5280d2?{'count':_0x1be093,'rows':_0x5280d2}:null;}})[_0x436f('0x24')](respondWithResult(_0x3e983d,null))[_0x436f('0x46')](handleError(_0x3e983d,null));};exports[_0x436f('0x51')]=function(_0x39ed87,_0x35c1f6,_0x20589e){var _0x431bad={};var _0x572a74={};var _0x53b852;var _0x2f73d3;return db[_0x436f('0x41')][_0x436f('0x4d')]({'where':{'id':_0x39ed87[_0x436f('0x48')]['id']}})[_0x436f('0x24')](handleEntityNotFound(_0x35c1f6,null))[_0x436f('0x24')](function(_0x1f8e66){if(_0x1f8e66){_0x53b852=_0x1f8e66;_0x572a74[_0x436f('0x2e')]=_[_0x436f('0x31')](db[_0x436f('0x4e')][_0x436f('0x2a')]);_0x572a74[_0x436f('0x30')]=_[_0x436f('0x31')](_0x39ed87[_0x436f('0x30')]);_0x572a74[_0x436f('0x32')]=_[_0x436f('0x33')](_0x572a74[_0x436f('0x2e')],_0x572a74[_0x436f('0x30')]);_0x431bad[_0x436f('0x35')]=_[_0x436f('0x33')](_0x572a74['model'],qs[_0x436f('0x34')](_0x39ed87['query'][_0x436f('0x34')]));_0x431bad[_0x436f('0x35')]=_0x431bad[_0x436f('0x35')][_0x436f('0x36')]?_0x431bad[_0x436f('0x35')]:_0x572a74['model'];_0x431bad[_0x436f('0x3a')]=qs[_0x436f('0x3b')](_0x39ed87[_0x436f('0x30')]['sort']);_0x431bad['where']=qs['filters'](_['pick'](_0x39ed87['query'],_0x572a74[_0x436f('0x32')]));if(_0x39ed87[_0x436f('0x30')][_0x436f('0x3e')]){_0x431bad[_0x436f('0x3c')]=_[_0x436f('0x3f')](_0x431bad[_0x436f('0x3c')],{'$or':_['map'](_0x431bad[_0x436f('0x35')],function(_0x256140){var _0x4902a5={};_0x4902a5[_0x256140]={'$like':'%'+_0x39ed87['query'][_0x436f('0x3e')]+'%'};return _0x4902a5;})});}_0x431bad=_[_0x436f('0x3f')]({},_0x431bad,_0x39ed87[_0x436f('0x50')]);return _0x53b852[_0x436f('0x51')](_0x431bad);}})[_0x436f('0x24')](function(_0x27aae1){if(_0x27aae1){_0x2f73d3=_0x27aae1[_0x436f('0x36')];if(!_0x39ed87[_0x436f('0x30')][_0x436f('0x37')](_0x436f('0x38'))){_0x431bad[_0x436f('0x39')]=qs['limit'](_0x39ed87[_0x436f('0x30')][_0x436f('0x39')]);_0x431bad[_0x436f('0x1e')]=qs[_0x436f('0x1e')](_0x39ed87[_0x436f('0x30')]['offset']);}return _0x53b852['getDescriptions'](_0x431bad);}})[_0x436f('0x24')](function(_0x5c979b){if(_0x5c979b){return _0x5c979b?{'count':_0x2f73d3,'rows':_0x5c979b}:null;}})[_0x436f('0x24')](respondWithResult(_0x35c1f6,null))[_0x436f('0x46')](handleError(_0x35c1f6,null));}; \ No newline at end of file +var _0xcfaa=['where','filters','merge','VIRTUAL','filter','include','SalesforceConfiguration','findAll','rows','catch','show','params','options','create','body','update','find','destroy','getFields','findOne','SalesforceField','hasOwnProperty','nolimit','getSubjects','pick','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort'];(function(_0x277492,_0x199fd1){var _0x4b8c46=function(_0x19f8dd){while(--_0x19f8dd){_0x277492['push'](_0x277492['shift']());}};_0x4b8c46(++_0x199fd1);}(_0xcfaa,0x104));var _0xacfa=function(_0x39e8a4,_0x45f64e){_0x39e8a4=_0x39e8a4-0x0;var _0x1793d3=_0xcfaa[_0x39e8a4];return _0x1793d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacfa('0x0'));var zipdir=require(_0xacfa('0x1'));var jsonpatch=require(_0xacfa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xacfa('0x3'));var Mustache=require(_0xacfa('0x4'));var util=require(_0xacfa('0x5'));var path=require(_0xacfa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacfa('0x7'));var _=require(_0xacfa('0x8'));var squel=require('squel');var crypto=require(_0xacfa('0x9'));var jsforce=require(_0xacfa('0xa'));var deskjs=require(_0xacfa('0xb'));var toCsv=require('to-csv');var querystring=require(_0xacfa('0xc'));var Papa=require('papaparse');var Redis=require(_0xacfa('0xd'));var authService=require(_0xacfa('0xe'));var qs=require(_0xacfa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacfa('0x10'));var logger=require('../../config/logger')(_0xacfa('0x11'));var utils=require(_0xacfa('0x12'));var config=require(_0xacfa('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17b15c,_0x3ef5ac){_0x3ef5ac=_0x3ef5ac||0xcc;return function(_0x5bdaee){if(_0x5bdaee){return _0x17b15c[_0xacfa('0x14')](_0x3ef5ac);}return _0x17b15c[_0xacfa('0x15')](_0x3ef5ac)[_0xacfa('0x16')]();};}function respondWithResult(_0x233406,_0x4f8627){_0x4f8627=_0x4f8627||0xc8;return function(_0x562461){if(_0x562461){return _0x233406[_0xacfa('0x15')](_0x4f8627)[_0xacfa('0x17')](_0x562461);}};}function respondWithFilteredResult(_0x91e1b8,_0x34772c){return function(_0x5181bd){if(_0x5181bd){var _0x6c0423=typeof _0x34772c[_0xacfa('0x18')]===_0xacfa('0x19')&&typeof _0x34772c[_0xacfa('0x1a')]===_0xacfa('0x19');var _0x7ba2d6=_0x5181bd[_0xacfa('0x1b')];var _0x369343=_0x6c0423?0x0:_0x34772c[_0xacfa('0x18')];var _0x5e9cf4=_0x6c0423?_0x5181bd['count']:_0x34772c[_0xacfa('0x18')]+_0x34772c[_0xacfa('0x1a')];var _0x5e06b3;if(_0x5e9cf4>=_0x7ba2d6){_0x5e9cf4=_0x7ba2d6;_0x5e06b3=0xc8;}else{_0x5e06b3=0xce;}_0x91e1b8[_0xacfa('0x15')](_0x5e06b3);return _0x91e1b8[_0xacfa('0x1c')](_0xacfa('0x1d'),_0x369343+'-'+_0x5e9cf4+'/'+_0x7ba2d6)[_0xacfa('0x17')](_0x5181bd);}return null;};}function patchUpdates(_0x5c647b){return function(_0x4898e0){try{jsonpatch[_0xacfa('0x1e')](_0x4898e0,_0x5c647b,!![]);}catch(_0xe4fcae){return BPromise[_0xacfa('0x1f')](_0xe4fcae);}return _0x4898e0[_0xacfa('0x20')]();};}function saveUpdates(_0x26830f,_0x472b2d){return function(_0x531d23){if(_0x531d23){return _0x531d23['update'](_0x26830f)[_0xacfa('0x21')](function(_0x4558db){return _0x4558db;});}return null;};}function removeEntity(_0x91b9e4,_0x1a3787){return function(_0xf6d2e){if(_0xf6d2e){return _0xf6d2e['destroy']()[_0xacfa('0x21')](function(){_0x91b9e4[_0xacfa('0x15')](0xcc)[_0xacfa('0x16')]();});}};}function handleEntityNotFound(_0x40416f,_0x3c8d5b){return function(_0x3be648){if(!_0x3be648){_0x40416f[_0xacfa('0x14')](0x194);}return _0x3be648;};}function handleError(_0x2011f1,_0x2dbbf6){_0x2dbbf6=_0x2dbbf6||0x1f4;return function(_0x6c7328){logger[_0xacfa('0x22')](_0x6c7328[_0xacfa('0x23')]);if(_0x6c7328['name']){delete _0x6c7328[_0xacfa('0x24')];}_0x2011f1[_0xacfa('0x15')](_0x2dbbf6)[_0xacfa('0x25')](_0x6c7328);};}exports[_0xacfa('0x26')]=function(_0x45b6b3,_0x50a919){var _0x322c9b={},_0x54f94e={},_0x323b7b={'count':0x0,'rows':[]};var _0x2adcde=_[_0xacfa('0x27')](db['SalesforceConfiguration'][_0xacfa('0x28')],function(_0x448900){return{'name':_0x448900[_0xacfa('0x29')],'type':_0x448900[_0xacfa('0x2a')]['key']};});_0x54f94e[_0xacfa('0x2b')]=_[_0xacfa('0x27')](_0x2adcde,_0xacfa('0x24'));_0x54f94e[_0xacfa('0x2c')]=_[_0xacfa('0x2d')](_0x45b6b3['query']);_0x54f94e['filters']=_[_0xacfa('0x2e')](_0x54f94e['model'],_0x54f94e[_0xacfa('0x2c')]);_0x322c9b[_0xacfa('0x2f')]=_[_0xacfa('0x2e')](_0x54f94e['model'],qs[_0xacfa('0x30')](_0x45b6b3[_0xacfa('0x2c')]['fields']));_0x322c9b[_0xacfa('0x2f')]=_0x322c9b['attributes'][_0xacfa('0x31')]?_0x322c9b['attributes']:_0x54f94e[_0xacfa('0x2b')];if(!_0x45b6b3[_0xacfa('0x2c')]['hasOwnProperty']('nolimit')){_0x322c9b[_0xacfa('0x1a')]=qs[_0xacfa('0x1a')](_0x45b6b3['query']['limit']);_0x322c9b[_0xacfa('0x18')]=qs[_0xacfa('0x18')](_0x45b6b3[_0xacfa('0x2c')]['offset']);}_0x322c9b[_0xacfa('0x32')]=qs[_0xacfa('0x33')](_0x45b6b3[_0xacfa('0x2c')][_0xacfa('0x33')]);_0x322c9b[_0xacfa('0x34')]=qs[_0xacfa('0x35')](_['pick'](_0x45b6b3['query'],_0x54f94e[_0xacfa('0x35')]),_0x2adcde);if(_0x45b6b3[_0xacfa('0x2c')]['filter']){_0x322c9b['where']=_[_0xacfa('0x36')](_0x322c9b['where'],{'$or':_['map'](_0x2adcde,function(_0x174ac1){if(_0x174ac1[_0xacfa('0x2a')]!==_0xacfa('0x37')){var _0x1324bf={};_0x1324bf[_0x174ac1[_0xacfa('0x24')]]={'$like':'%'+_0x45b6b3[_0xacfa('0x2c')][_0xacfa('0x38')]+'%'};return _0x1324bf;}})});}_0x322c9b=_[_0xacfa('0x36')]({},_0x322c9b,_0x45b6b3['options']);var _0x57d0df={'where':_0x322c9b[_0xacfa('0x34')]};return db['SalesforceConfiguration'][_0xacfa('0x1b')](_0x57d0df)[_0xacfa('0x21')](function(_0xa29122){_0x323b7b[_0xacfa('0x1b')]=_0xa29122;if(_0x45b6b3[_0xacfa('0x2c')]['includeAll']){_0x322c9b[_0xacfa('0x39')]=[{'all':!![]}];}return db[_0xacfa('0x3a')][_0xacfa('0x3b')](_0x322c9b);})[_0xacfa('0x21')](function(_0xc398e0){_0x323b7b[_0xacfa('0x3c')]=_0xc398e0;return _0x323b7b;})[_0xacfa('0x21')](respondWithFilteredResult(_0x50a919,_0x322c9b))[_0xacfa('0x3d')](handleError(_0x50a919,null));};exports[_0xacfa('0x3e')]=function(_0x528239,_0x1eddc0){var _0x48f971={'raw':![],'where':{'id':_0x528239[_0xacfa('0x3f')]['id']}},_0x2193ea={};_0x2193ea[_0xacfa('0x2b')]=_[_0xacfa('0x2d')](db[_0xacfa('0x3a')][_0xacfa('0x28')]);_0x2193ea['query']=_[_0xacfa('0x2d')](_0x528239[_0xacfa('0x2c')]);_0x2193ea['filters']=_[_0xacfa('0x2e')](_0x2193ea[_0xacfa('0x2b')],_0x2193ea['query']);_0x48f971[_0xacfa('0x2f')]=_[_0xacfa('0x2e')](_0x2193ea[_0xacfa('0x2b')],qs['fields'](_0x528239[_0xacfa('0x2c')][_0xacfa('0x30')]));_0x48f971[_0xacfa('0x2f')]=_0x48f971[_0xacfa('0x2f')]['length']?_0x48f971['attributes']:_0x2193ea['model'];if(_0x528239[_0xacfa('0x2c')]['includeAll']){_0x48f971[_0xacfa('0x39')]=[{'all':!![]}];}_0x48f971=_['merge']({},_0x48f971,_0x528239[_0xacfa('0x40')]);return db['SalesforceConfiguration']['find'](_0x48f971)[_0xacfa('0x21')](handleEntityNotFound(_0x1eddc0,null))[_0xacfa('0x21')](respondWithResult(_0x1eddc0,null))['catch'](handleError(_0x1eddc0,null));};exports[_0xacfa('0x41')]=function(_0x160904,_0x1a79e6){return db[_0xacfa('0x3a')][_0xacfa('0x41')](_0x160904[_0xacfa('0x42')],{})['then'](respondWithResult(_0x1a79e6,0xc9))[_0xacfa('0x3d')](handleError(_0x1a79e6,null));};exports[_0xacfa('0x43')]=function(_0xf9b9bd,_0x5259b7){if(_0xf9b9bd['body']['id']){delete _0xf9b9bd[_0xacfa('0x42')]['id'];}return db[_0xacfa('0x3a')][_0xacfa('0x44')]({'where':{'id':_0xf9b9bd[_0xacfa('0x3f')]['id']}})[_0xacfa('0x21')](handleEntityNotFound(_0x5259b7,null))[_0xacfa('0x21')](saveUpdates(_0xf9b9bd[_0xacfa('0x42')],null))[_0xacfa('0x21')](respondWithResult(_0x5259b7,null))[_0xacfa('0x3d')](handleError(_0x5259b7,null));};exports[_0xacfa('0x45')]=function(_0x2055cc,_0x32bdda){return db[_0xacfa('0x3a')][_0xacfa('0x44')]({'where':{'id':_0x2055cc['params']['id']}})[_0xacfa('0x21')](handleEntityNotFound(_0x32bdda,null))[_0xacfa('0x21')](removeEntity(_0x32bdda,null))['catch'](handleError(_0x32bdda,null));};exports[_0xacfa('0x46')]=function(_0x3d2266,_0x1c5a89,_0x4036f7){var _0xd964d7={};var _0x4c47d3={};var _0x148e45;var _0x161e71;return db['SalesforceConfiguration'][_0xacfa('0x47')]({'where':{'id':_0x3d2266[_0xacfa('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1c5a89,null))[_0xacfa('0x21')](function(_0x13de98){if(_0x13de98){_0x148e45=_0x13de98;_0x4c47d3[_0xacfa('0x2b')]=_[_0xacfa('0x2d')](db[_0xacfa('0x48')][_0xacfa('0x28')]);_0x4c47d3[_0xacfa('0x2c')]=_[_0xacfa('0x2d')](_0x3d2266['query']);_0x4c47d3[_0xacfa('0x35')]=_[_0xacfa('0x2e')](_0x4c47d3['model'],_0x4c47d3['query']);_0xd964d7[_0xacfa('0x2f')]=_[_0xacfa('0x2e')](_0x4c47d3['model'],qs[_0xacfa('0x30')](_0x3d2266['query'][_0xacfa('0x30')]));_0xd964d7[_0xacfa('0x2f')]=_0xd964d7[_0xacfa('0x2f')][_0xacfa('0x31')]?_0xd964d7[_0xacfa('0x2f')]:_0x4c47d3[_0xacfa('0x2b')];_0xd964d7[_0xacfa('0x32')]=qs[_0xacfa('0x33')](_0x3d2266[_0xacfa('0x2c')]['sort']);_0xd964d7[_0xacfa('0x34')]=qs['filters'](_['pick'](_0x3d2266[_0xacfa('0x2c')],_0x4c47d3[_0xacfa('0x35')]));if(_0x3d2266['query']['filter']){_0xd964d7[_0xacfa('0x34')]=_[_0xacfa('0x36')](_0xd964d7['where'],{'$or':_[_0xacfa('0x27')](_0xd964d7['attributes'],function(_0x2a2852){var _0x351bce={};_0x351bce[_0x2a2852]={'$like':'%'+_0x3d2266[_0xacfa('0x2c')][_0xacfa('0x38')]+'%'};return _0x351bce;})});}_0xd964d7=_['merge']({},_0xd964d7,_0x3d2266['options']);return _0x148e45[_0xacfa('0x46')](_0xd964d7);}})[_0xacfa('0x21')](function(_0x479a47){if(_0x479a47){_0x161e71=_0x479a47[_0xacfa('0x31')];if(!_0x3d2266[_0xacfa('0x2c')][_0xacfa('0x49')](_0xacfa('0x4a'))){_0xd964d7[_0xacfa('0x1a')]=qs[_0xacfa('0x1a')](_0x3d2266[_0xacfa('0x2c')]['limit']);_0xd964d7['offset']=qs['offset'](_0x3d2266[_0xacfa('0x2c')][_0xacfa('0x18')]);}return _0x148e45[_0xacfa('0x46')](_0xd964d7);}})['then'](function(_0x5e5dc8){if(_0x5e5dc8){return _0x5e5dc8?{'count':_0x161e71,'rows':_0x5e5dc8}:null;}})['then'](respondWithResult(_0x1c5a89,null))[_0xacfa('0x3d')](handleError(_0x1c5a89,null));};exports[_0xacfa('0x4b')]=function(_0x3f94e7,_0x2b3c84,_0x408e5e){var _0x2e1fad={};var _0xbb5f87={};var _0xdb2041;var _0x196537;return db[_0xacfa('0x3a')][_0xacfa('0x47')]({'where':{'id':_0x3f94e7[_0xacfa('0x3f')]['id']}})[_0xacfa('0x21')](handleEntityNotFound(_0x2b3c84,null))[_0xacfa('0x21')](function(_0x3e6751){if(_0x3e6751){_0xdb2041=_0x3e6751;_0xbb5f87[_0xacfa('0x2b')]=_[_0xacfa('0x2d')](db[_0xacfa('0x48')]['rawAttributes']);_0xbb5f87[_0xacfa('0x2c')]=_[_0xacfa('0x2d')](_0x3f94e7[_0xacfa('0x2c')]);_0xbb5f87['filters']=_['intersection'](_0xbb5f87[_0xacfa('0x2b')],_0xbb5f87['query']);_0x2e1fad['attributes']=_[_0xacfa('0x2e')](_0xbb5f87[_0xacfa('0x2b')],qs[_0xacfa('0x30')](_0x3f94e7['query'][_0xacfa('0x30')]));_0x2e1fad[_0xacfa('0x2f')]=_0x2e1fad[_0xacfa('0x2f')]['length']?_0x2e1fad[_0xacfa('0x2f')]:_0xbb5f87[_0xacfa('0x2b')];_0x2e1fad[_0xacfa('0x32')]=qs[_0xacfa('0x33')](_0x3f94e7['query'][_0xacfa('0x33')]);_0x2e1fad[_0xacfa('0x34')]=qs['filters'](_[_0xacfa('0x4c')](_0x3f94e7[_0xacfa('0x2c')],_0xbb5f87[_0xacfa('0x35')]));if(_0x3f94e7[_0xacfa('0x2c')][_0xacfa('0x38')]){_0x2e1fad['where']=_['merge'](_0x2e1fad['where'],{'$or':_[_0xacfa('0x27')](_0x2e1fad[_0xacfa('0x2f')],function(_0x3893c9){var _0x3190e5={};_0x3190e5[_0x3893c9]={'$like':'%'+_0x3f94e7[_0xacfa('0x2c')][_0xacfa('0x38')]+'%'};return _0x3190e5;})});}_0x2e1fad=_[_0xacfa('0x36')]({},_0x2e1fad,_0x3f94e7[_0xacfa('0x40')]);return _0xdb2041['getSubjects'](_0x2e1fad);}})[_0xacfa('0x21')](function(_0x3632b7){if(_0x3632b7){_0x196537=_0x3632b7[_0xacfa('0x31')];if(!_0x3f94e7['query'][_0xacfa('0x49')](_0xacfa('0x4a'))){_0x2e1fad[_0xacfa('0x1a')]=qs[_0xacfa('0x1a')](_0x3f94e7[_0xacfa('0x2c')]['limit']);_0x2e1fad[_0xacfa('0x18')]=qs[_0xacfa('0x18')](_0x3f94e7[_0xacfa('0x2c')][_0xacfa('0x18')]);}return _0xdb2041['getSubjects'](_0x2e1fad);}})['then'](function(_0x1a14bb){if(_0x1a14bb){return _0x1a14bb?{'count':_0x196537,'rows':_0x1a14bb}:null;}})['then'](respondWithResult(_0x2b3c84,null))['catch'](handleError(_0x2b3c84,null));};exports[_0xacfa('0x4d')]=function(_0x15c2d6,_0x5d649b,_0x11498d){var _0x4eed0b={};var _0xacd2a4={};var _0x3943a2;var _0x5e3712;return db[_0xacfa('0x3a')][_0xacfa('0x47')]({'where':{'id':_0x15c2d6[_0xacfa('0x3f')]['id']}})[_0xacfa('0x21')](handleEntityNotFound(_0x5d649b,null))['then'](function(_0x176176){if(_0x176176){_0x3943a2=_0x176176;_0xacd2a4[_0xacfa('0x2b')]=_[_0xacfa('0x2d')](db[_0xacfa('0x48')]['rawAttributes']);_0xacd2a4[_0xacfa('0x2c')]=_[_0xacfa('0x2d')](_0x15c2d6['query']);_0xacd2a4[_0xacfa('0x35')]=_['intersection'](_0xacd2a4['model'],_0xacd2a4['query']);_0x4eed0b['attributes']=_['intersection'](_0xacd2a4[_0xacfa('0x2b')],qs[_0xacfa('0x30')](_0x15c2d6['query']['fields']));_0x4eed0b[_0xacfa('0x2f')]=_0x4eed0b[_0xacfa('0x2f')]['length']?_0x4eed0b['attributes']:_0xacd2a4[_0xacfa('0x2b')];_0x4eed0b['order']=qs['sort'](_0x15c2d6[_0xacfa('0x2c')]['sort']);_0x4eed0b[_0xacfa('0x34')]=qs['filters'](_[_0xacfa('0x4c')](_0x15c2d6[_0xacfa('0x2c')],_0xacd2a4[_0xacfa('0x35')]));if(_0x15c2d6[_0xacfa('0x2c')][_0xacfa('0x38')]){_0x4eed0b[_0xacfa('0x34')]=_[_0xacfa('0x36')](_0x4eed0b[_0xacfa('0x34')],{'$or':_['map'](_0x4eed0b[_0xacfa('0x2f')],function(_0x39ef08){var _0x53c9b0={};_0x53c9b0[_0x39ef08]={'$like':'%'+_0x15c2d6[_0xacfa('0x2c')]['filter']+'%'};return _0x53c9b0;})});}_0x4eed0b=_[_0xacfa('0x36')]({},_0x4eed0b,_0x15c2d6['options']);return _0x3943a2[_0xacfa('0x4d')](_0x4eed0b);}})['then'](function(_0x3c02b0){if(_0x3c02b0){_0x5e3712=_0x3c02b0[_0xacfa('0x31')];if(!_0x15c2d6[_0xacfa('0x2c')][_0xacfa('0x49')]('nolimit')){_0x4eed0b[_0xacfa('0x1a')]=qs[_0xacfa('0x1a')](_0x15c2d6[_0xacfa('0x2c')][_0xacfa('0x1a')]);_0x4eed0b[_0xacfa('0x18')]=qs['offset'](_0x15c2d6['query'][_0xacfa('0x18')]);}return _0x3943a2[_0xacfa('0x4d')](_0x4eed0b);}})[_0xacfa('0x21')](function(_0x43ff0b){if(_0x43ff0b){return _0x43ff0b?{'count':_0x5e3712,'rows':_0x43ff0b}:null;}})['then'](respondWithResult(_0x5d649b,null))[_0xacfa('0x3d')](handleError(_0x5d649b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7142bba..894f1cf 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 _0x2333=['exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x4a3b65,_0x40f089){var _0x3b193d=function(_0x39cf79){while(--_0x39cf79){_0x4a3b65['push'](_0x4a3b65['shift']());}};_0x3b193d(++_0x40f089);}(_0x2333,0x174));var _0x3233=function(_0x36f998,_0x31eb60){_0x36f998=_0x36f998-0x0;var _0x3f75eb=_0x2333[_0x36f998];return _0x3f75eb;};'use strict';var _=require(_0x3233('0x0'));var util=require('util');var logger=require(_0x3233('0x1'))(_0x3233('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3233('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3233('0x4'));var config=require(_0x3233('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x3233('0x6')]=function(_0x3fa6f0,_0x3ed8dd){return _0x3fa6f0['define'](_0x3233('0x7'),attributes,{'tableName':_0x3233('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2533=['path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','../../config/logger','api','moment','request-promise'];(function(_0x34882f,_0x601a99){var _0x455929=function(_0x463c7c){while(--_0x463c7c){_0x34882f['push'](_0x34882f['shift']());}};_0x455929(++_0x601a99);}(_0x2533,0x187));var _0x3253=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x2533[_0x9fb081];return _0x43f8b0;};'use strict';var _=require(_0x3253('0x0'));var util=require('util');var logger=require(_0x3253('0x1'))(_0x3253('0x2'));var moment=require(_0x3253('0x3'));var BPromise=require('bluebird');var rp=require(_0x3253('0x4'));var fs=require('fs');var path=require(_0x3253('0x5'));var rimraf=require(_0x3253('0x6'));var config=require('../../config/environment');var attributes=require(_0x3253('0x7'));module[_0x3253('0x8')]=function(_0xbf2c8f,_0x528b4f){return _0xbf2c8f[_0x3253('0x9')](_0x3253('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 d952f0b..b41ac0c 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 _0x4111=['../../config/utils','rpc','../../config/environment','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0xc1fac2,_0x725358){var _0x1a31f8=function(_0x22e4f3){while(--_0x22e4f3){_0xc1fac2['push'](_0xc1fac2['shift']());}};_0x1a31f8(++_0x725358);}(_0x4111,0x199));var _0x1411=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4111[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var moment=require('moment');var BPromise=require(_0x1411('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1411('0x3'));var db=require(_0x1411('0x4'))['db'];var utils=require(_0x1411('0x5'));var logger=require('../../config/logger')(_0x1411('0x6'));var config=require(_0x1411('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1411('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16a63e,_0x14be28,_0xcf2071){return new BPromise(function(_0x5e35d5,_0x3b88f9){return client['request'](_0x16a63e,_0xcf2071)[_0x1411('0x9')](function(_0x4e80b6){logger[_0x1411('0xa')](_0x1411('0xb'),_0x14be28,_0x1411('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x14be28,_0x1411('0xc'),JSON[_0x1411('0xd')](_0x4e80b6));if(_0x4e80b6[_0x1411('0xe')]){if(_0x4e80b6[_0x1411('0xe')][_0x1411('0xf')]===0x1f4){logger[_0x1411('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x4e80b6[_0x1411('0xe')][_0x1411('0x10')]);return _0x3b88f9(_0x4e80b6['error'][_0x1411('0x10')]);}logger[_0x1411('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x4e80b6[_0x1411('0xe')][_0x1411('0x10')]);return _0x5e35d5(_0x4e80b6[_0x1411('0xe')][_0x1411('0x10')]);}else{logger[_0x1411('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x1411('0xc'));_0x5e35d5(_0x4e80b6[_0x1411('0x11')][_0x1411('0x10')]);}})['catch'](function(_0x424b09){logger[_0x1411('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x14be28,_0x424b09);_0x3b88f9(_0x424b09);});});} \ No newline at end of file +var _0x5e7d=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2f7162,_0x2c902d){var _0x3eacc5=function(_0x368931){while(--_0x368931){_0x2f7162['push'](_0x2f7162['shift']());}};_0x3eacc5(++_0x2c902d);}(_0x5e7d,0x136));var _0xd5e7=function(_0x1f9bcc,_0x400cb8){_0x1f9bcc=_0x1f9bcc-0x0;var _0x12831a=_0x5e7d[_0x1f9bcc];return _0x12831a;};'use strict';var _=require(_0xd5e7('0x0'));var util=require(_0xd5e7('0x1'));var moment=require(_0xd5e7('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5e7('0x3'));var fs=require('fs');var Redis=require(_0xd5e7('0x4'));var db=require(_0xd5e7('0x5'))['db'];var utils=require(_0xd5e7('0x6'));var logger=require(_0xd5e7('0x7'))('rpc');var config=require(_0xd5e7('0x8'));var jayson=require(_0xd5e7('0x9'));var client=jayson[_0xd5e7('0xa')][_0xd5e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c2a4e,_0x15d8ba,_0x188d5d){return new BPromise(function(_0x391f44,_0x4fd5df){return client[_0xd5e7('0xc')](_0x5c2a4e,_0x188d5d)[_0xd5e7('0xd')](function(_0x2ac5ba){logger[_0xd5e7('0xe')](_0xd5e7('0xf'),_0x15d8ba,_0xd5e7('0x10'));logger[_0xd5e7('0x11')](_0xd5e7('0x12'),_0x15d8ba,_0xd5e7('0x10'),JSON[_0xd5e7('0x13')](_0x2ac5ba));if(_0x2ac5ba[_0xd5e7('0x14')]){if(_0x2ac5ba[_0xd5e7('0x14')][_0xd5e7('0x15')]===0x1f4){logger[_0xd5e7('0x14')](_0xd5e7('0xf'),_0x15d8ba,_0x2ac5ba[_0xd5e7('0x14')][_0xd5e7('0x16')]);return _0x4fd5df(_0x2ac5ba[_0xd5e7('0x14')][_0xd5e7('0x16')]);}logger[_0xd5e7('0x14')](_0xd5e7('0xf'),_0x15d8ba,_0x2ac5ba[_0xd5e7('0x14')][_0xd5e7('0x16')]);return _0x391f44(_0x2ac5ba['error'][_0xd5e7('0x16')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x15d8ba,'request\x20sent');_0x391f44(_0x2ac5ba['result']['message']);}})['catch'](function(_0x51e4bf){logger[_0xd5e7('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x15d8ba,_0x51e4bf);_0x4fd5df(_0x51e4bf);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2601842..f0a1ae0 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 _0xc89c=['put','update','destroy','exports','multer','path','express','Router','fs-extra','index','get','/:id','post','isAuthenticated'];(function(_0xd45367,_0xfbb0ac){var _0x484e51=function(_0xbdf1fb){while(--_0xbdf1fb){_0xd45367['push'](_0xd45367['shift']());}};_0x484e51(++_0xfbb0ac);}(_0xc89c,0xd6));var _0xcc89=function(_0x2c8fc0,_0x4e2011){_0x2c8fc0=_0x2c8fc0-0x0;var _0x4cd140=_0xc89c[_0x2c8fc0];return _0x4cd140;};'use strict';var multer=require(_0xcc89('0x0'));var util=require('util');var path=require(_0xcc89('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc89('0x2'));var router=express[_0xcc89('0x3')]();var fs_extra=require(_0xcc89('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcc89('0x5')]);router[_0xcc89('0x6')](_0xcc89('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xcc89('0x8')]('/',auth[_0xcc89('0x9')](),controller['create']);router[_0xcc89('0xa')](_0xcc89('0x7'),auth[_0xcc89('0x9')](),controller[_0xcc89('0xb')]);router['delete'](_0xcc89('0x7'),auth[_0xcc89('0x9')](),controller[_0xcc89('0xc')]);module[_0xcc89('0xd')]=router; \ No newline at end of file +var _0x88a9=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x3c3629,_0x233e67){var _0x40a721=function(_0x4b550b){while(--_0x4b550b){_0x3c3629['push'](_0x3c3629['shift']());}};_0x40a721(++_0x233e67);}(_0x88a9,0xa3));var _0x988a=function(_0x2a64c3,_0x1e4539){_0x2a64c3=_0x2a64c3-0x0;var _0x4a2a10=_0x88a9[_0x2a64c3];return _0x4a2a10;};'use strict';var multer=require(_0x988a('0x0'));var util=require(_0x988a('0x1'));var path=require(_0x988a('0x2'));var timeout=require(_0x988a('0x3'));var express=require(_0x988a('0x4'));var router=express[_0x988a('0x5')]();var fs_extra=require(_0x988a('0x6'));var auth=require(_0x988a('0x7'));var interaction=require(_0x988a('0x8'));var config=require(_0x988a('0x9'));var controller=require(_0x988a('0xa'));router[_0x988a('0xb')]('/',auth[_0x988a('0xc')](),controller[_0x988a('0xd')]);router[_0x988a('0xb')](_0x988a('0xe'),auth[_0x988a('0xc')](),controller['show']);router[_0x988a('0xf')]('/',auth[_0x988a('0xc')](),controller[_0x988a('0x10')]);router['put']('/:id',auth[_0x988a('0xc')](),controller[_0x988a('0x11')]);router[_0x988a('0x12')]('/:id',auth[_0x988a('0xc')](),controller['destroy']);module[_0x988a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b15372e..d898ce7 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 _0x675f=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0x175f31,_0x2410d8){var _0xd810c2=function(_0x3b54c8){while(--_0x3b54c8){_0x175f31['push'](_0x175f31['shift']());}};_0xd810c2(++_0x2410d8);}(_0x675f,0x1b6));var _0xf675=function(_0x3e6577,_0x33a147){_0x3e6577=_0x3e6577-0x0;var _0x146358=_0x675f[_0x3e6577];return _0x146358;};'use strict';var Sequelize=require(_0xf675('0x0'));module[_0xf675('0x1')]={'type':{'type':Sequelize[_0xf675('0x2')](_0xf675('0x3'),_0xf675('0x4'),_0xf675('0x5'),'keyValue',_0xf675('0x6')),'defaultValue':_0xf675('0x3')},'content':{'type':Sequelize[_0xf675('0x7')]},'key':{'type':Sequelize[_0xf675('0x7')]},'keyType':{'type':Sequelize[_0xf675('0x2')](_0xf675('0x3'),_0xf675('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf675('0x7')]},'idField':{'type':Sequelize[_0xf675('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1eb2=['ENUM','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0x529ddb,_0x1ceb25){var _0x1efab2=function(_0x5644c2){while(--_0x5644c2){_0x529ddb['push'](_0x529ddb['shift']());}};_0x1efab2(++_0x1ceb25);}(_0x1eb2,0x1e9));var _0x21eb=function(_0x263f30,_0x314919){_0x263f30=_0x263f30-0x0;var _0x2faf1d=_0x1eb2[_0x263f30];return _0x2faf1d;};'use strict';var Sequelize=require(_0x21eb('0x0'));module['exports']={'type':{'type':Sequelize[_0x21eb('0x1')]('string','variable',_0x21eb('0x2'),_0x21eb('0x3'),_0x21eb('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x21eb('0x5')]},'key':{'type':Sequelize[_0x21eb('0x5')]},'keyType':{'type':Sequelize[_0x21eb('0x1')](_0x21eb('0x6'),'variable',_0x21eb('0x2'))},'keyContent':{'type':Sequelize[_0x21eb('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index e9d94bb..182b99e 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 _0x4e1d=['name','send','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','SalesforceField','findAll','rows','catch','show','params','includeAll','include','options','create','update','body','find','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','end','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e1d,0x1c6));var _0xd4e1=function(_0x12b1b7,_0x27b852){_0x12b1b7=_0x12b1b7-0x0;var _0xac0bfb=_0x4e1d[_0x12b1b7];return _0xac0bfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd4e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd4e1('0x1'));var BPromise=require(_0xd4e1('0x2'));var Mustache=require(_0xd4e1('0x3'));var util=require(_0xd4e1('0x4'));var path=require(_0xd4e1('0x5'));var sox=require(_0xd4e1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4e1('0x7'));var squel=require(_0xd4e1('0x8'));var crypto=require('crypto');var jsforce=require(_0xd4e1('0x9'));var deskjs=require(_0xd4e1('0xa'));var toCsv=require(_0xd4e1('0xb'));var querystring=require('querystring');var Papa=require(_0xd4e1('0xc'));var Redis=require(_0xd4e1('0xd'));var authService=require(_0xd4e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd4e1('0xf'));var hardwareService=require(_0xd4e1('0x10'));var logger=require(_0xd4e1('0x11'))('api');var utils=require(_0xd4e1('0x12'));var config=require(_0xd4e1('0x13'));var licenseUtil=require(_0xd4e1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x476f37,_0x18c5f){_0x18c5f=_0x18c5f||0xcc;return function(_0x8956c5){if(_0x8956c5){return _0x476f37[_0xd4e1('0x15')](_0x18c5f);}return _0x476f37[_0xd4e1('0x16')](_0x18c5f)['end']();};}function respondWithResult(_0x32340e,_0x178580){_0x178580=_0x178580||0xc8;return function(_0x5bcc18){if(_0x5bcc18){return _0x32340e[_0xd4e1('0x16')](_0x178580)[_0xd4e1('0x17')](_0x5bcc18);}};}function respondWithFilteredResult(_0x4abc13,_0x182444){return function(_0x4a8fbd){if(_0x4a8fbd){var _0x328455=typeof _0x182444[_0xd4e1('0x18')]===_0xd4e1('0x19')&&typeof _0x182444[_0xd4e1('0x1a')]==='undefined';var _0x4fdda7=_0x4a8fbd['count'];var _0x26dc50=_0x328455?0x0:_0x182444[_0xd4e1('0x18')];var _0x538e5b=_0x328455?_0x4a8fbd[_0xd4e1('0x1b')]:_0x182444[_0xd4e1('0x18')]+_0x182444[_0xd4e1('0x1a')];var _0x3680af;if(_0x538e5b>=_0x4fdda7){_0x538e5b=_0x4fdda7;_0x3680af=0xc8;}else{_0x3680af=0xce;}_0x4abc13[_0xd4e1('0x16')](_0x3680af);return _0x4abc13[_0xd4e1('0x1c')]('Content-Range',_0x26dc50+'-'+_0x538e5b+'/'+_0x4fdda7)['json'](_0x4a8fbd);}return null;};}function patchUpdates(_0x490d0c){return function(_0x23b890){try{jsonpatch[_0xd4e1('0x1d')](_0x23b890,_0x490d0c,!![]);}catch(_0x3aab){return BPromise['reject'](_0x3aab);}return _0x23b890[_0xd4e1('0x1e')]();};}function saveUpdates(_0x41b8bd,_0x1bb36b){return function(_0x3eeac5){if(_0x3eeac5){return _0x3eeac5['update'](_0x41b8bd)[_0xd4e1('0x1f')](function(_0x226d2d){return _0x226d2d;});}return null;};}function removeEntity(_0x2251f9,_0xd3204){return function(_0x52f4f2){if(_0x52f4f2){return _0x52f4f2[_0xd4e1('0x20')]()[_0xd4e1('0x1f')](function(){_0x2251f9[_0xd4e1('0x16')](0xcc)[_0xd4e1('0x21')]();});}};}function handleEntityNotFound(_0x4ada48,_0x33dcb2){return function(_0x1a836d){if(!_0x1a836d){_0x4ada48[_0xd4e1('0x15')](0x194);}return _0x1a836d;};}function handleError(_0x1c6b96,_0x2b8a6e){_0x2b8a6e=_0x2b8a6e||0x1f4;return function(_0x18e5b3){logger[_0xd4e1('0x22')](_0x18e5b3[_0xd4e1('0x23')]);if(_0x18e5b3['name']){delete _0x18e5b3[_0xd4e1('0x24')];}_0x1c6b96[_0xd4e1('0x16')](_0x2b8a6e)[_0xd4e1('0x25')](_0x18e5b3);};}exports['index']=function(_0xd64430,_0x1bed52){var _0x9d4e96={},_0x1bd87a={},_0x271996={'count':0x0,'rows':[]};var _0x3b67b9=_['map'](db['SalesforceField'][_0xd4e1('0x26')],function(_0x534bd3){return{'name':_0x534bd3[_0xd4e1('0x27')],'type':_0x534bd3[_0xd4e1('0x28')]['key']};});_0x1bd87a[_0xd4e1('0x29')]=_[_0xd4e1('0x2a')](_0x3b67b9,_0xd4e1('0x24'));_0x1bd87a[_0xd4e1('0x2b')]=_[_0xd4e1('0x2c')](_0xd64430['query']);_0x1bd87a['filters']=_[_0xd4e1('0x2d')](_0x1bd87a['model'],_0x1bd87a[_0xd4e1('0x2b')]);_0x9d4e96[_0xd4e1('0x2e')]=_['intersection'](_0x1bd87a[_0xd4e1('0x29')],qs[_0xd4e1('0x2f')](_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x2f')]));_0x9d4e96[_0xd4e1('0x2e')]=_0x9d4e96[_0xd4e1('0x2e')][_0xd4e1('0x30')]?_0x9d4e96[_0xd4e1('0x2e')]:_0x1bd87a[_0xd4e1('0x29')];if(!_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x31')](_0xd4e1('0x32'))){_0x9d4e96[_0xd4e1('0x1a')]=qs[_0xd4e1('0x1a')](_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x1a')]);_0x9d4e96[_0xd4e1('0x18')]=qs[_0xd4e1('0x18')](_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x18')]);}_0x9d4e96['order']=qs[_0xd4e1('0x33')](_0xd64430['query'][_0xd4e1('0x33')]);_0x9d4e96[_0xd4e1('0x34')]=qs[_0xd4e1('0x35')](_[_0xd4e1('0x36')](_0xd64430[_0xd4e1('0x2b')],_0x1bd87a[_0xd4e1('0x35')]),_0x3b67b9);if(_0xd64430[_0xd4e1('0x2b')]['filter']){_0x9d4e96[_0xd4e1('0x34')]=_[_0xd4e1('0x37')](_0x9d4e96[_0xd4e1('0x34')],{'$or':_['map'](_0x3b67b9,function(_0x30b392){if(_0x30b392[_0xd4e1('0x28')]!=='VIRTUAL'){var _0x3cdb2d={};_0x3cdb2d[_0x30b392[_0xd4e1('0x24')]]={'$like':'%'+_0xd64430[_0xd4e1('0x2b')][_0xd4e1('0x38')]+'%'};return _0x3cdb2d;}})});}_0x9d4e96=_[_0xd4e1('0x37')]({},_0x9d4e96,_0xd64430['options']);var _0x323e4c={'where':_0x9d4e96[_0xd4e1('0x34')]};return db[_0xd4e1('0x39')]['count'](_0x323e4c)[_0xd4e1('0x1f')](function(_0xb9a4ff){_0x271996[_0xd4e1('0x1b')]=_0xb9a4ff;if(_0xd64430[_0xd4e1('0x2b')]['includeAll']){_0x9d4e96['include']=[{'all':!![]}];}return db[_0xd4e1('0x39')][_0xd4e1('0x3a')](_0x9d4e96);})['then'](function(_0x403501){_0x271996[_0xd4e1('0x3b')]=_0x403501;return _0x271996;})[_0xd4e1('0x1f')](respondWithFilteredResult(_0x1bed52,_0x9d4e96))[_0xd4e1('0x3c')](handleError(_0x1bed52,null));};exports[_0xd4e1('0x3d')]=function(_0x105431,_0x5ac4aa){var _0x446aaa={'raw':!![],'where':{'id':_0x105431[_0xd4e1('0x3e')]['id']}},_0x43354a={};_0x43354a['model']=_[_0xd4e1('0x2c')](db[_0xd4e1('0x39')][_0xd4e1('0x26')]);_0x43354a[_0xd4e1('0x2b')]=_[_0xd4e1('0x2c')](_0x105431[_0xd4e1('0x2b')]);_0x43354a['filters']=_[_0xd4e1('0x2d')](_0x43354a[_0xd4e1('0x29')],_0x43354a[_0xd4e1('0x2b')]);_0x446aaa[_0xd4e1('0x2e')]=_[_0xd4e1('0x2d')](_0x43354a[_0xd4e1('0x29')],qs[_0xd4e1('0x2f')](_0x105431[_0xd4e1('0x2b')][_0xd4e1('0x2f')]));_0x446aaa[_0xd4e1('0x2e')]=_0x446aaa['attributes'][_0xd4e1('0x30')]?_0x446aaa[_0xd4e1('0x2e')]:_0x43354a[_0xd4e1('0x29')];if(_0x105431['query'][_0xd4e1('0x3f')]){_0x446aaa[_0xd4e1('0x40')]=[{'all':!![]}];}_0x446aaa=_['merge']({},_0x446aaa,_0x105431[_0xd4e1('0x41')]);return db[_0xd4e1('0x39')]['find'](_0x446aaa)['then'](handleEntityNotFound(_0x5ac4aa,null))[_0xd4e1('0x1f')](respondWithResult(_0x5ac4aa,null))[_0xd4e1('0x3c')](handleError(_0x5ac4aa,null));};exports[_0xd4e1('0x42')]=function(_0x332b7,_0x5cdb62){return db[_0xd4e1('0x39')]['create'](_0x332b7['body'],{})[_0xd4e1('0x1f')](respondWithResult(_0x5cdb62,0xc9))[_0xd4e1('0x3c')](handleError(_0x5cdb62,null));};exports[_0xd4e1('0x43')]=function(_0x309ff9,_0x258915){if(_0x309ff9[_0xd4e1('0x44')]['id']){delete _0x309ff9[_0xd4e1('0x44')]['id'];}return db[_0xd4e1('0x39')]['find']({'where':{'id':_0x309ff9[_0xd4e1('0x3e')]['id']}})[_0xd4e1('0x1f')](handleEntityNotFound(_0x258915,null))[_0xd4e1('0x1f')](saveUpdates(_0x309ff9[_0xd4e1('0x44')],null))[_0xd4e1('0x1f')](respondWithResult(_0x258915,null))['catch'](handleError(_0x258915,null));};exports['destroy']=function(_0x5499ec,_0x2d470f){return db['SalesforceField'][_0xd4e1('0x45')]({'where':{'id':_0x5499ec['params']['id']}})[_0xd4e1('0x1f')](handleEntityNotFound(_0x2d470f,null))[_0xd4e1('0x1f')](removeEntity(_0x2d470f,null))[_0xd4e1('0x3c')](handleError(_0x2d470f,null));}; \ No newline at end of file +var _0x55cd=['keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','show','params','length','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','query'];(function(_0xf8636f,_0x3f1e84){var _0x58f657=function(_0x3afaad){while(--_0x3afaad){_0xf8636f['push'](_0xf8636f['shift']());}};_0x58f657(++_0x3f1e84);}(_0x55cd,0x1e9));var _0xd55c=function(_0x27cc6b,_0x1f91df){_0x27cc6b=_0x27cc6b-0x0;var _0x195d8f=_0x55cd[_0x27cc6b];return _0x195d8f;};'use strict';var emlformat=require(_0xd55c('0x0'));var rimraf=require(_0xd55c('0x1'));var zipdir=require(_0xd55c('0x2'));var jsonpatch=require(_0xd55c('0x3'));var rp=require(_0xd55c('0x4'));var moment=require(_0xd55c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd55c('0x6'));var util=require(_0xd55c('0x7'));var path=require(_0xd55c('0x8'));var sox=require(_0xd55c('0x9'));var csv=require(_0xd55c('0xa'));var ejs=require(_0xd55c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd55c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd55c('0xd'));var deskjs=require(_0xd55c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd55c('0xf'));var Papa=require(_0xd55c('0x10'));var Redis=require(_0xd55c('0x11'));var authService=require(_0xd55c('0x12'));var qs=require(_0xd55c('0x13'));var as=require(_0xd55c('0x14'));var hardwareService=require(_0xd55c('0x15'));var logger=require(_0xd55c('0x16'))(_0xd55c('0x17'));var utils=require('../../config/utils');var config=require(_0xd55c('0x18'));var licenseUtil=require(_0xd55c('0x19'));var db=require(_0xd55c('0x1a'))['db'];function respondWithStatusCode(_0x77ccbb,_0x1a8baf){_0x1a8baf=_0x1a8baf||0xcc;return function(_0x154d2c){if(_0x154d2c){return _0x77ccbb[_0xd55c('0x1b')](_0x1a8baf);}return _0x77ccbb[_0xd55c('0x1c')](_0x1a8baf)[_0xd55c('0x1d')]();};}function respondWithResult(_0x10f34c,_0x218d5e){_0x218d5e=_0x218d5e||0xc8;return function(_0x4f341f){if(_0x4f341f){return _0x10f34c[_0xd55c('0x1c')](_0x218d5e)['json'](_0x4f341f);}};}function respondWithFilteredResult(_0x38c306,_0x3a114d){return function(_0xa3d78){if(_0xa3d78){var _0x30b19d=typeof _0x3a114d['offset']===_0xd55c('0x1e')&&typeof _0x3a114d[_0xd55c('0x1f')]===_0xd55c('0x1e');var _0x3260fb=_0xa3d78[_0xd55c('0x20')];var _0x50d409=_0x30b19d?0x0:_0x3a114d[_0xd55c('0x21')];var _0x36159e=_0x30b19d?_0xa3d78[_0xd55c('0x20')]:_0x3a114d['offset']+_0x3a114d[_0xd55c('0x1f')];var _0x5d9c03;if(_0x36159e>=_0x3260fb){_0x36159e=_0x3260fb;_0x5d9c03=0xc8;}else{_0x5d9c03=0xce;}_0x38c306[_0xd55c('0x1c')](_0x5d9c03);return _0x38c306[_0xd55c('0x22')](_0xd55c('0x23'),_0x50d409+'-'+_0x36159e+'/'+_0x3260fb)[_0xd55c('0x24')](_0xa3d78);}return null;};}function patchUpdates(_0xfe06d8){return function(_0x542f6f){try{jsonpatch[_0xd55c('0x25')](_0x542f6f,_0xfe06d8,!![]);}catch(_0x155268){return BPromise[_0xd55c('0x26')](_0x155268);}return _0x542f6f['save']();};}function saveUpdates(_0x1d5fe8,_0x1b3e77){return function(_0x1826c0){if(_0x1826c0){return _0x1826c0['update'](_0x1d5fe8)[_0xd55c('0x27')](function(_0x1204e0){return _0x1204e0;});}return null;};}function removeEntity(_0xf30354,_0xb13e83){return function(_0x427532){if(_0x427532){return _0x427532['destroy']()[_0xd55c('0x27')](function(){_0xf30354[_0xd55c('0x1c')](0xcc)[_0xd55c('0x1d')]();});}};}function handleEntityNotFound(_0x44bb48,_0x350570){return function(_0x8782b4){if(!_0x8782b4){_0x44bb48['sendStatus'](0x194);}return _0x8782b4;};}function handleError(_0x35b436,_0x3814b0){_0x3814b0=_0x3814b0||0x1f4;return function(_0x14e20b){logger[_0xd55c('0x28')](_0x14e20b[_0xd55c('0x29')]);if(_0x14e20b[_0xd55c('0x2a')]){delete _0x14e20b[_0xd55c('0x2a')];}_0x35b436[_0xd55c('0x1c')](_0x3814b0)[_0xd55c('0x2b')](_0x14e20b);};}exports[_0xd55c('0x2c')]=function(_0x6897b2,_0x2b96dc){var _0x36b545={},_0xd1f13={},_0x3709a7={'count':0x0,'rows':[]};var _0x122547=_[_0xd55c('0x2d')](db[_0xd55c('0x2e')][_0xd55c('0x2f')],function(_0x324bd6){return{'name':_0x324bd6['fieldName'],'type':_0x324bd6[_0xd55c('0x30')]['key']};});_0xd1f13['model']=_['map'](_0x122547,_0xd55c('0x2a'));_0xd1f13[_0xd55c('0x31')]=_[_0xd55c('0x32')](_0x6897b2[_0xd55c('0x31')]);_0xd1f13[_0xd55c('0x33')]=_[_0xd55c('0x34')](_0xd1f13['model'],_0xd1f13[_0xd55c('0x31')]);_0x36b545[_0xd55c('0x35')]=_[_0xd55c('0x34')](_0xd1f13['model'],qs['fields'](_0x6897b2[_0xd55c('0x31')][_0xd55c('0x36')]));_0x36b545[_0xd55c('0x35')]=_0x36b545['attributes']['length']?_0x36b545[_0xd55c('0x35')]:_0xd1f13[_0xd55c('0x37')];if(!_0x6897b2[_0xd55c('0x31')][_0xd55c('0x38')](_0xd55c('0x39'))){_0x36b545[_0xd55c('0x1f')]=qs[_0xd55c('0x1f')](_0x6897b2[_0xd55c('0x31')][_0xd55c('0x1f')]);_0x36b545['offset']=qs['offset'](_0x6897b2[_0xd55c('0x31')][_0xd55c('0x21')]);}_0x36b545[_0xd55c('0x3a')]=qs['sort'](_0x6897b2['query'][_0xd55c('0x3b')]);_0x36b545['where']=qs[_0xd55c('0x33')](_[_0xd55c('0x3c')](_0x6897b2[_0xd55c('0x31')],_0xd1f13[_0xd55c('0x33')]),_0x122547);if(_0x6897b2['query'][_0xd55c('0x3d')]){_0x36b545['where']=_[_0xd55c('0x3e')](_0x36b545[_0xd55c('0x3f')],{'$or':_[_0xd55c('0x2d')](_0x122547,function(_0xd38d9b){if(_0xd38d9b[_0xd55c('0x30')]!=='VIRTUAL'){var _0x16336d={};_0x16336d[_0xd38d9b[_0xd55c('0x2a')]]={'$like':'%'+_0x6897b2[_0xd55c('0x31')]['filter']+'%'};return _0x16336d;}})});}_0x36b545=_['merge']({},_0x36b545,_0x6897b2[_0xd55c('0x40')]);var _0x37caa0={'where':_0x36b545[_0xd55c('0x3f')]};return db['SalesforceField'][_0xd55c('0x20')](_0x37caa0)[_0xd55c('0x27')](function(_0x1456a4){_0x3709a7[_0xd55c('0x20')]=_0x1456a4;if(_0x6897b2['query'][_0xd55c('0x41')]){_0x36b545['include']=[{'all':!![]}];}return db[_0xd55c('0x2e')][_0xd55c('0x42')](_0x36b545);})[_0xd55c('0x27')](function(_0x40ec49){_0x3709a7['rows']=_0x40ec49;return _0x3709a7;})[_0xd55c('0x27')](respondWithFilteredResult(_0x2b96dc,_0x36b545))['catch'](handleError(_0x2b96dc,null));};exports[_0xd55c('0x43')]=function(_0xbf269c,_0x2395c6){var _0x13c8dd={'raw':!![],'where':{'id':_0xbf269c[_0xd55c('0x44')]['id']}},_0x1acc6c={};_0x1acc6c['model']=_['keys'](db[_0xd55c('0x2e')][_0xd55c('0x2f')]);_0x1acc6c[_0xd55c('0x31')]=_['keys'](_0xbf269c[_0xd55c('0x31')]);_0x1acc6c[_0xd55c('0x33')]=_[_0xd55c('0x34')](_0x1acc6c[_0xd55c('0x37')],_0x1acc6c[_0xd55c('0x31')]);_0x13c8dd[_0xd55c('0x35')]=_[_0xd55c('0x34')](_0x1acc6c[_0xd55c('0x37')],qs[_0xd55c('0x36')](_0xbf269c[_0xd55c('0x31')]['fields']));_0x13c8dd['attributes']=_0x13c8dd['attributes'][_0xd55c('0x45')]?_0x13c8dd[_0xd55c('0x35')]:_0x1acc6c[_0xd55c('0x37')];if(_0xbf269c[_0xd55c('0x31')]['includeAll']){_0x13c8dd[_0xd55c('0x46')]=[{'all':!![]}];}_0x13c8dd=_['merge']({},_0x13c8dd,_0xbf269c[_0xd55c('0x40')]);return db[_0xd55c('0x2e')][_0xd55c('0x47')](_0x13c8dd)[_0xd55c('0x27')](handleEntityNotFound(_0x2395c6,null))[_0xd55c('0x27')](respondWithResult(_0x2395c6,null))[_0xd55c('0x48')](handleError(_0x2395c6,null));};exports[_0xd55c('0x49')]=function(_0x14ba63,_0xa3de1){return db['SalesforceField'][_0xd55c('0x49')](_0x14ba63['body'],{})[_0xd55c('0x27')](respondWithResult(_0xa3de1,0xc9))[_0xd55c('0x48')](handleError(_0xa3de1,null));};exports[_0xd55c('0x4a')]=function(_0x21f74f,_0x32eb6b){if(_0x21f74f[_0xd55c('0x4b')]['id']){delete _0x21f74f[_0xd55c('0x4b')]['id'];}return db[_0xd55c('0x2e')][_0xd55c('0x47')]({'where':{'id':_0x21f74f[_0xd55c('0x44')]['id']}})[_0xd55c('0x27')](handleEntityNotFound(_0x32eb6b,null))[_0xd55c('0x27')](saveUpdates(_0x21f74f[_0xd55c('0x4b')],null))[_0xd55c('0x27')](respondWithResult(_0x32eb6b,null))[_0xd55c('0x48')](handleError(_0x32eb6b,null));};exports[_0xd55c('0x4c')]=function(_0x5524ca,_0x11b6b9){return db['SalesforceField']['find']({'where':{'id':_0x5524ca[_0xd55c('0x44')]['id']}})[_0xd55c('0x27')](handleEntityNotFound(_0x11b6b9,null))[_0xd55c('0x27')](removeEntity(_0x11b6b9,null))['catch'](handleError(_0x11b6b9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2469eb7..4c2be34 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 _0xf109=['rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0xbc284b,_0x532dfe){var _0x4dca6a=function(_0x300fe5){while(--_0x300fe5){_0xbc284b['push'](_0xbc284b['shift']());}};_0x4dca6a(++_0x532dfe);}(_0xf109,0xf9));var _0x9f10=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xf109[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require('../../config/logger')(_0x9f10('0x2'));var moment=require(_0x9f10('0x3'));var BPromise=require(_0x9f10('0x4'));var rp=require(_0x9f10('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x9f10('0x8')]=function(_0x4f8539,_0x23a365){return _0x4f8539[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[{'name':_0x9f10('0xc'),'fields':[_0x9f10('0xd'),_0x9f10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x81d3=['./intSalesforceField.attributes','define','SalesforceField','salesforce_unique_index','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5293cd,_0x1a921f){var _0x21be20=function(_0x5c05b9){while(--_0x5c05b9){_0x5293cd['push'](_0x5293cd['shift']());}};_0x21be20(++_0x1a921f);}(_0x81d3,0x178));var _0x381d=function(_0x390f54,_0x177b82){_0x390f54=_0x390f54-0x0;var _0x342546=_0x81d3[_0x390f54];return _0x342546;};'use strict';var _=require(_0x381d('0x0'));var util=require(_0x381d('0x1'));var logger=require('../../config/logger')(_0x381d('0x2'));var moment=require(_0x381d('0x3'));var BPromise=require('bluebird');var rp=require(_0x381d('0x4'));var fs=require('fs');var path=require(_0x381d('0x5'));var rimraf=require(_0x381d('0x6'));var config=require(_0x381d('0x7'));var attributes=require(_0x381d('0x8'));module['exports']=function(_0x2bea6d,_0x173a95){return _0x2bea6d[_0x381d('0x9')](_0x381d('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x381d('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index ab44843..5bd579b 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 _0x42b1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x357dfe,_0x67923e){var _0x227a62=function(_0x106efb){while(--_0x106efb){_0x357dfe['push'](_0x357dfe['shift']());}};_0x227a62(++_0x67923e);}(_0x42b1,0xa2));var _0x142b=function(_0x596791,_0x36c285){_0x596791=_0x596791-0x0;var _0x3f4bb8=_0x42b1[_0x596791];return _0x3f4bb8;};'use strict';var _=require(_0x142b('0x0'));var util=require('util');var moment=require(_0x142b('0x1'));var BPromise=require(_0x142b('0x2'));var rs=require(_0x142b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x142b('0x4'))['db'];var utils=require(_0x142b('0x5'));var logger=require(_0x142b('0x6'))(_0x142b('0x7'));var config=require(_0x142b('0x8'));var jayson=require(_0x142b('0x9'));var client=jayson[_0x142b('0xa')][_0x142b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5147,_0xd4643,_0x328955){return new BPromise(function(_0x1dc5ef,_0x414fab){return client[_0x142b('0xc')](_0x3c5147,_0x328955)[_0x142b('0xd')](function(_0x480f8d){logger['info'](_0x142b('0xe'),_0xd4643,_0x142b('0xf'));logger[_0x142b('0x10')](_0x142b('0x11'),_0xd4643,_0x142b('0xf'),JSON[_0x142b('0x12')](_0x480f8d));if(_0x480f8d[_0x142b('0x13')]){if(_0x480f8d[_0x142b('0x13')]['code']===0x1f4){logger[_0x142b('0x13')]('SalesforceField,\x20%s,\x20%s',_0xd4643,_0x480f8d[_0x142b('0x13')][_0x142b('0x14')]);return _0x414fab(_0x480f8d[_0x142b('0x13')][_0x142b('0x14')]);}logger['error'](_0x142b('0xe'),_0xd4643,_0x480f8d[_0x142b('0x13')]['message']);return _0x1dc5ef(_0x480f8d[_0x142b('0x13')]['message']);}else{logger[_0x142b('0x15')](_0x142b('0xe'),_0xd4643,_0x142b('0xf'));_0x1dc5ef(_0x480f8d[_0x142b('0x16')]['message']);}})[_0x142b('0x17')](function(_0xeff8f7){logger[_0x142b('0x13')]('SalesforceField,\x20%s,\x20%s',_0xd4643,_0xeff8f7);_0x414fab(_0xeff8f7);});});} \ No newline at end of file +var _0xe481=['jayson/promise','client','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe481,0x8a));var _0x1e48=function(_0x478489,_0x3cdf57){_0x478489=_0x478489-0x0;var _0x544211=_0xe481[_0x478489];return _0x544211;};'use strict';var _=require(_0x1e48('0x0'));var util=require('util');var moment=require(_0x1e48('0x1'));var BPromise=require(_0x1e48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e48('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e48('0x4'))(_0x1e48('0x5'));var config=require('../../config/environment');var jayson=require(_0x1e48('0x6'));var client=jayson[_0x1e48('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14b840,_0x58275e,_0x2c2d2c){return new BPromise(function(_0x16d187,_0x6f26aa){return client['request'](_0x14b840,_0x2c2d2c)['then'](function(_0x30eb68){logger['info'](_0x1e48('0x8'),_0x58275e,'request\x20sent');logger[_0x1e48('0x9')](_0x1e48('0xa'),_0x58275e,_0x1e48('0xb'),JSON[_0x1e48('0xc')](_0x30eb68));if(_0x30eb68[_0x1e48('0xd')]){if(_0x30eb68[_0x1e48('0xd')]['code']===0x1f4){logger[_0x1e48('0xd')]('SalesforceField,\x20%s,\x20%s',_0x58275e,_0x30eb68['error']['message']);return _0x6f26aa(_0x30eb68[_0x1e48('0xd')][_0x1e48('0xe')]);}logger[_0x1e48('0xd')](_0x1e48('0x8'),_0x58275e,_0x30eb68[_0x1e48('0xd')][_0x1e48('0xe')]);return _0x16d187(_0x30eb68[_0x1e48('0xd')]['message']);}else{logger['info'](_0x1e48('0x8'),_0x58275e,_0x1e48('0xb'));_0x16d187(_0x30eb68[_0x1e48('0xf')]['message']);}})['catch'](function(_0x4e8ec8){logger[_0x1e48('0xd')]('SalesforceField,\x20%s,\x20%s',_0x58275e,_0x4e8ec8);_0x6f26aa(_0x4e8ec8);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0e95649..8f702b8 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 _0x9715=['index','/:id','show','/:id/configurations','/:id/fields','getFields','post','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x3a86e1,_0xabf7e3){var _0x562367=function(_0xb993d8){while(--_0xb993d8){_0x3a86e1['push'](_0x3a86e1['shift']());}};_0x562367(++_0xabf7e3);}(_0x9715,0x15f));var _0x5971=function(_0x3c1f0c,_0x46282f){_0x3c1f0c=_0x3c1f0c-0x0;var _0x439f8d=_0x9715[_0x3c1f0c];return _0x439f8d;};'use strict';var multer=require(_0x5971('0x0'));var util=require(_0x5971('0x1'));var path=require(_0x5971('0x2'));var timeout=require(_0x5971('0x3'));var express=require(_0x5971('0x4'));var router=express[_0x5971('0x5')]();var fs_extra=require(_0x5971('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5971('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x5971('0x8')]('/',auth['isAuthenticated'](),controller[_0x5971('0x9')]);router['get'](_0x5971('0xa'),auth['isAuthenticated'](),controller[_0x5971('0xb')]);router[_0x5971('0x8')](_0x5971('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x5971('0x8')](_0x5971('0xd'),auth['isAuthenticated'](),controller[_0x5971('0xe')]);router[_0x5971('0xf')]('/',auth[_0x5971('0x10')](),controller['create']);router[_0x5971('0xf')](_0x5971('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x5971('0x10')](),controller[_0x5971('0x11')]);router[_0x5971('0x12')](_0x5971('0xa'),auth[_0x5971('0x10')](),controller['destroy']);module[_0x5971('0x13')]=router; \ No newline at end of file +var _0x8ff9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','destroy','multer','util','path','express'];(function(_0x5289a9,_0x3346fa){var _0x2407d5=function(_0x13d7fe){while(--_0x13d7fe){_0x5289a9['push'](_0x5289a9['shift']());}};_0x2407d5(++_0x3346fa);}(_0x8ff9,0x188));var _0x98ff=function(_0x4473f6,_0x39a797){_0x4473f6=_0x4473f6-0x0;var _0x7db87e=_0x8ff9[_0x4473f6];return _0x7db87e;};'use strict';var multer=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var path=require(_0x98ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ff('0x3'));var router=express[_0x98ff('0x4')]();var fs_extra=require(_0x98ff('0x5'));var auth=require(_0x98ff('0x6'));var interaction=require(_0x98ff('0x7'));var config=require(_0x98ff('0x8'));var controller=require(_0x98ff('0x9'));router['get']('/',auth[_0x98ff('0xa')](),controller['index']);router[_0x98ff('0xb')](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0xd')]);router[_0x98ff('0xb')](_0x98ff('0xe'),auth[_0x98ff('0xa')](),controller[_0x98ff('0xf')]);router[_0x98ff('0xb')]('/:id/fields',auth[_0x98ff('0xa')](),controller[_0x98ff('0x10')]);router[_0x98ff('0x11')]('/',auth[_0x98ff('0xa')](),controller['create']);router[_0x98ff('0x11')](_0x98ff('0xe'),auth[_0x98ff('0xa')](),controller[_0x98ff('0x12')]);router[_0x98ff('0x13')](_0x98ff('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x98ff('0x14')]('/:id',auth[_0x98ff('0xa')](),controller[_0x98ff('0x15')]);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 dd87639..3df3df9 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 _0xefbc=['exports','STRING'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xefbc,0x182));var _0xcefb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xefbc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xcefb('0x0')]={'name':{'type':Sequelize[_0xcefb('0x1')]},'description':{'type':Sequelize[_0xcefb('0x1')]},'username':{'type':Sequelize[_0xcefb('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xcefb('0x1')]},'email':{'type':Sequelize[_0xcefb('0x1')]},'remoteUri':{'type':Sequelize[_0xcefb('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xcefb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb58b=['sequelize','exports','STRING','username','remoteUri'];(function(_0x398e44,_0x1b273c){var _0x27583c=function(_0x95bb80){while(--_0x95bb80){_0x398e44['push'](_0x398e44['shift']());}};_0x27583c(++_0x1b273c);}(_0xb58b,0x19a));var _0xbb58=function(_0xb2b3ae,_0x5f186d){_0xb2b3ae=_0xb2b3ae-0x0;var _0x2e18a3=_0xb58b[_0xb2b3ae];return _0x2e18a3;};'use strict';var Sequelize=require(_0xbb58('0x0'));module[_0xbb58('0x1')]={'name':{'type':Sequelize[_0xbb58('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbb58('0x2')],'unique':_0xbb58('0x3')},'password':{'type':Sequelize[_0xbb58('0x2')]},'email':{'type':Sequelize[_0xbb58('0x2')]},'remoteUri':{'type':Sequelize[_0xbb58('0x2')],'unique':_0xbb58('0x4')},'serverUrl':{'type':Sequelize[_0xbb58('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 67f249e..1b146c1 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 _0xd03c=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','type','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','order','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','knowledge','subcategory','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','state','closed_at','cmdb_ci','impact','active','work_notes_list','sys_domain_path','time_worked','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','remoteUri','serverUrl','slice','lastIndexOf','format','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','True','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0xd03c,0xb3));var _0xcd03=function(_0xb7934c,_0x327c4a){_0xb7934c=_0xb7934c-0x0;var _0x194641=_0xd03c[_0xb7934c];return _0x194641;};'use strict';var emlformat=require(_0xcd03('0x0'));var rimraf=require(_0xcd03('0x1'));var zipdir=require(_0xcd03('0x2'));var jsonpatch=require(_0xcd03('0x3'));var rp=require(_0xcd03('0x4'));var moment=require(_0xcd03('0x5'));var BPromise=require(_0xcd03('0x6'));var Mustache=require('mustache');var util=require(_0xcd03('0x7'));var path=require(_0xcd03('0x8'));var sox=require(_0xcd03('0x9'));var csv=require(_0xcd03('0xa'));var ejs=require(_0xcd03('0xb'));var fs=require('fs');var fs_extra=require(_0xcd03('0xc'));var _=require(_0xcd03('0xd'));var squel=require(_0xcd03('0xe'));var crypto=require(_0xcd03('0xf'));var jsforce=require(_0xcd03('0x10'));var deskjs=require(_0xcd03('0x11'));var toCsv=require(_0xcd03('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd03('0x12'));var authService=require(_0xcd03('0x13'));var qs=require(_0xcd03('0x14'));var as=require(_0xcd03('0x15'));var hardwareService=require(_0xcd03('0x16'));var logger=require('../../config/logger')(_0xcd03('0x17'));var utils=require(_0xcd03('0x18'));var config=require(_0xcd03('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd03('0x1a'))['db'];var integrations=require(_0xcd03('0x1b'));function respondWithStatusCode(_0x2e4feb,_0x389f83){_0x389f83=_0x389f83||0xcc;return function(_0x96a2fb){if(_0x96a2fb){return _0x2e4feb[_0xcd03('0x1c')](_0x389f83);}return _0x2e4feb[_0xcd03('0x1d')](_0x389f83)[_0xcd03('0x1e')]();};}function respondWithResult(_0x1def10,_0x5c7784){_0x5c7784=_0x5c7784||0xc8;return function(_0x4f637c){if(_0x4f637c){return _0x1def10['status'](_0x5c7784)[_0xcd03('0x1f')](_0x4f637c);}};}function respondWithFilteredResult(_0x22c481,_0x5eec0a){return function(_0x5b110d){if(_0x5b110d){var _0x508a59=typeof _0x5eec0a[_0xcd03('0x20')]===_0xcd03('0x21')&&typeof _0x5eec0a[_0xcd03('0x22')]===_0xcd03('0x21');var _0x235699=_0x5b110d['count'];var _0x2a376c=_0x508a59?0x0:_0x5eec0a[_0xcd03('0x20')];var _0x457fce=_0x508a59?_0x5b110d['count']:_0x5eec0a[_0xcd03('0x20')]+_0x5eec0a[_0xcd03('0x22')];var _0x3b8c45;if(_0x457fce>=_0x235699){_0x457fce=_0x235699;_0x3b8c45=0xc8;}else{_0x3b8c45=0xce;}_0x22c481[_0xcd03('0x1d')](_0x3b8c45);return _0x22c481[_0xcd03('0x23')](_0xcd03('0x24'),_0x2a376c+'-'+_0x457fce+'/'+_0x235699)[_0xcd03('0x1f')](_0x5b110d);}return null;};}function patchUpdates(_0x2fc355){return function(_0x3df1cd){try{jsonpatch[_0xcd03('0x25')](_0x3df1cd,_0x2fc355,!![]);}catch(_0x145f00){return BPromise['reject'](_0x145f00);}return _0x3df1cd[_0xcd03('0x26')]();};}function saveUpdates(_0x520419,_0x3f96cd){return function(_0xa3c9ae){if(_0xa3c9ae){return _0xa3c9ae[_0xcd03('0x27')](_0x520419)[_0xcd03('0x28')](function(_0x547e71){return _0x547e71;});}return null;};}function removeEntity(_0x5b1031,_0x3f23de){return function(_0x4ed756){if(_0x4ed756){return _0x4ed756[_0xcd03('0x29')]()['then'](function(){_0x5b1031[_0xcd03('0x1d')](0xcc)[_0xcd03('0x1e')]();});}};}function handleEntityNotFound(_0x44ba6b,_0x1721ad){return function(_0x49dded){if(!_0x49dded){_0x44ba6b[_0xcd03('0x1c')](0x194);}return _0x49dded;};}function handleError(_0x3aa2a1,_0x508d1d){_0x508d1d=_0x508d1d||0x1f4;return function(_0x19e3e5){logger['error'](_0x19e3e5[_0xcd03('0x2a')]);if(_0x19e3e5[_0xcd03('0x2b')]){delete _0x19e3e5[_0xcd03('0x2b')];}_0x3aa2a1[_0xcd03('0x1d')](_0x508d1d)[_0xcd03('0x2c')](_0x19e3e5);};}exports['index']=function(_0x2064aa,_0x1a64df){var _0x150ce9={},_0x40ce4e={},_0x4028a6={'count':0x0,'rows':[]};var _0x5f09fb=_[_0xcd03('0x2d')](db[_0xcd03('0x2e')][_0xcd03('0x2f')],function(_0x139d13){return{'name':_0x139d13[_0xcd03('0x30')],'type':_0x139d13['type']['key']};});_0x40ce4e[_0xcd03('0x31')]=_[_0xcd03('0x2d')](_0x5f09fb,_0xcd03('0x2b'));_0x40ce4e[_0xcd03('0x32')]=_[_0xcd03('0x33')](_0x2064aa['query']);_0x40ce4e[_0xcd03('0x34')]=_[_0xcd03('0x35')](_0x40ce4e[_0xcd03('0x31')],_0x40ce4e['query']);_0x150ce9[_0xcd03('0x36')]=_[_0xcd03('0x35')](_0x40ce4e['model'],qs[_0xcd03('0x37')](_0x2064aa[_0xcd03('0x32')][_0xcd03('0x37')]));_0x150ce9[_0xcd03('0x36')]=_0x150ce9['attributes'][_0xcd03('0x38')]?_0x150ce9[_0xcd03('0x36')]:_0x40ce4e[_0xcd03('0x31')];if(!_0x2064aa[_0xcd03('0x32')][_0xcd03('0x39')](_0xcd03('0x3a'))){_0x150ce9['limit']=qs[_0xcd03('0x22')](_0x2064aa[_0xcd03('0x32')][_0xcd03('0x22')]);_0x150ce9[_0xcd03('0x20')]=qs[_0xcd03('0x20')](_0x2064aa[_0xcd03('0x32')][_0xcd03('0x20')]);}_0x150ce9['order']=qs['sort'](_0x2064aa[_0xcd03('0x32')]['sort']);_0x150ce9[_0xcd03('0x3b')]=qs[_0xcd03('0x34')](_[_0xcd03('0x3c')](_0x2064aa[_0xcd03('0x32')],_0x40ce4e[_0xcd03('0x34')]),_0x5f09fb);if(_0x2064aa[_0xcd03('0x32')]['filter']){_0x150ce9['where']=_['merge'](_0x150ce9[_0xcd03('0x3b')],{'$or':_[_0xcd03('0x2d')](_0x5f09fb,function(_0xa94bc){if(_0xa94bc[_0xcd03('0x3d')]!=='VIRTUAL'){var _0xf2bb87={};_0xf2bb87[_0xa94bc[_0xcd03('0x2b')]]={'$like':'%'+_0x2064aa[_0xcd03('0x32')][_0xcd03('0x3e')]+'%'};return _0xf2bb87;}})});}_0x150ce9=_[_0xcd03('0x3f')]({},_0x150ce9,_0x2064aa[_0xcd03('0x40')]);var _0x13dee4={'where':_0x150ce9[_0xcd03('0x3b')]};return db['ServicenowAccount'][_0xcd03('0x41')](_0x13dee4)['then'](function(_0x1335a7){_0x4028a6[_0xcd03('0x41')]=_0x1335a7;if(_0x2064aa[_0xcd03('0x32')][_0xcd03('0x42')]){_0x150ce9[_0xcd03('0x43')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xcd03('0x44')](_0x150ce9);})[_0xcd03('0x28')](function(_0xeda48e){_0x4028a6[_0xcd03('0x45')]=_0xeda48e;return _0x4028a6;})['then'](respondWithFilteredResult(_0x1a64df,_0x150ce9))[_0xcd03('0x46')](handleError(_0x1a64df,null));};exports[_0xcd03('0x47')]=function(_0x591a65,_0x5b54c1){var _0x1a768f={'raw':![],'where':{'id':_0x591a65['params']['id']}},_0x71a765={};_0x71a765[_0xcd03('0x31')]=_[_0xcd03('0x33')](db[_0xcd03('0x2e')][_0xcd03('0x2f')]);_0x71a765[_0xcd03('0x32')]=_[_0xcd03('0x33')](_0x591a65[_0xcd03('0x32')]);_0x71a765['filters']=_[_0xcd03('0x35')](_0x71a765[_0xcd03('0x31')],_0x71a765[_0xcd03('0x32')]);_0x1a768f[_0xcd03('0x36')]=_['intersection'](_0x71a765[_0xcd03('0x31')],qs[_0xcd03('0x37')](_0x591a65[_0xcd03('0x32')][_0xcd03('0x37')]));_0x1a768f[_0xcd03('0x36')]=_0x1a768f[_0xcd03('0x36')][_0xcd03('0x38')]?_0x1a768f['attributes']:_0x71a765[_0xcd03('0x31')];if(_0x591a65['query'][_0xcd03('0x42')]){_0x1a768f[_0xcd03('0x43')]=[{'all':!![]}];}_0x1a768f=_[_0xcd03('0x3f')]({},_0x1a768f,_0x591a65[_0xcd03('0x40')]);return db[_0xcd03('0x2e')][_0xcd03('0x48')](_0x1a768f)['then'](handleEntityNotFound(_0x5b54c1,null))['then'](respondWithResult(_0x5b54c1,null))[_0xcd03('0x46')](handleError(_0x5b54c1,null));};exports['create']=function(_0x17c575,_0x22278a){return db[_0xcd03('0x2e')][_0xcd03('0x49')](_0x17c575[_0xcd03('0x4a')],{})[_0xcd03('0x28')](respondWithResult(_0x22278a,0xc9))[_0xcd03('0x46')](handleError(_0x22278a,null));};exports[_0xcd03('0x27')]=function(_0x8e6fdf,_0x1d1b03){if(_0x8e6fdf['body']['id']){delete _0x8e6fdf[_0xcd03('0x4a')]['id'];}return db['ServicenowAccount'][_0xcd03('0x48')]({'where':{'id':_0x8e6fdf['params']['id']}})['then'](handleEntityNotFound(_0x1d1b03,null))[_0xcd03('0x28')](saveUpdates(_0x8e6fdf[_0xcd03('0x4a')],null))['then'](respondWithResult(_0x1d1b03,null))[_0xcd03('0x46')](handleError(_0x1d1b03,null));};exports['destroy']=function(_0x14d8d7,_0x3245c5){return db['ServicenowAccount'][_0xcd03('0x48')]({'where':{'id':_0x14d8d7[_0xcd03('0x4b')]['id']}})[_0xcd03('0x28')](handleEntityNotFound(_0x3245c5,null))[_0xcd03('0x28')](removeEntity(_0x3245c5,null))[_0xcd03('0x46')](handleError(_0x3245c5,null));};exports[_0xcd03('0x4c')]=function(_0x37350d,_0x44f9ce,_0x56eb86){var _0x472591={};var _0x8a947d={};var _0x1d7d46;var _0x3c5334;return db[_0xcd03('0x2e')][_0xcd03('0x4d')]({'where':{'id':_0x37350d['params']['id']}})[_0xcd03('0x28')](handleEntityNotFound(_0x44f9ce,null))['then'](function(_0x173f70){if(_0x173f70){_0x1d7d46=_0x173f70;_0x8a947d[_0xcd03('0x31')]=_[_0xcd03('0x33')](db[_0xcd03('0x4e')][_0xcd03('0x2f')]);_0x8a947d[_0xcd03('0x32')]=_[_0xcd03('0x33')](_0x37350d['query']);_0x8a947d[_0xcd03('0x34')]=_[_0xcd03('0x35')](_0x8a947d[_0xcd03('0x31')],_0x8a947d[_0xcd03('0x32')]);_0x472591[_0xcd03('0x36')]=_['intersection'](_0x8a947d[_0xcd03('0x31')],qs[_0xcd03('0x37')](_0x37350d[_0xcd03('0x32')][_0xcd03('0x37')]));_0x472591[_0xcd03('0x36')]=_0x472591[_0xcd03('0x36')][_0xcd03('0x38')]?_0x472591[_0xcd03('0x36')]:_0x8a947d[_0xcd03('0x31')];_0x472591[_0xcd03('0x4f')]=qs[_0xcd03('0x50')](_0x37350d[_0xcd03('0x32')][_0xcd03('0x50')]);_0x472591[_0xcd03('0x3b')]=qs['filters'](_['pick'](_0x37350d['query'],_0x8a947d[_0xcd03('0x34')]));if(_0x37350d[_0xcd03('0x32')][_0xcd03('0x3e')]){_0x472591['where']=_[_0xcd03('0x3f')](_0x472591[_0xcd03('0x3b')],{'$or':_[_0xcd03('0x2d')](_0x472591[_0xcd03('0x36')],function(_0x46ff3e){var _0x9a8213={};_0x9a8213[_0x46ff3e]={'$like':'%'+_0x37350d[_0xcd03('0x32')][_0xcd03('0x3e')]+'%'};return _0x9a8213;})});}_0x472591=_[_0xcd03('0x3f')]({},_0x472591,_0x37350d[_0xcd03('0x40')]);return _0x1d7d46['getConfigurations'](_0x472591);}})[_0xcd03('0x28')](function(_0x2164a5){if(_0x2164a5){_0x3c5334=_0x2164a5[_0xcd03('0x38')];if(!_0x37350d[_0xcd03('0x32')][_0xcd03('0x39')](_0xcd03('0x3a'))){_0x472591[_0xcd03('0x22')]=qs[_0xcd03('0x22')](_0x37350d[_0xcd03('0x32')]['limit']);_0x472591['offset']=qs['offset'](_0x37350d[_0xcd03('0x32')][_0xcd03('0x20')]);}return _0x1d7d46[_0xcd03('0x4c')](_0x472591);}})[_0xcd03('0x28')](function(_0x3fd12){if(_0x3fd12){return _0x3fd12?{'count':_0x3c5334,'rows':_0x3fd12}:null;}})[_0xcd03('0x28')](respondWithResult(_0x44f9ce,null))[_0xcd03('0x46')](handleError(_0x44f9ce,null));};exports[_0xcd03('0x51')]=function(_0x3921a5,_0x30a63d,_0x10671e){if(_0x3921a5[_0xcd03('0x4a')]['id']){delete _0x3921a5[_0xcd03('0x4a')]['id'];}return db[_0xcd03('0x2e')][_0xcd03('0x4d')]({'where':{'id':_0x3921a5[_0xcd03('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30a63d,null))[_0xcd03('0x28')](function(_0x52c223){if(_0x52c223){_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x52')]=_0x52c223['id'];_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x53')]=integrations[_0xcd03('0x54')](_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x55')],_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x3d')]);_0x3921a5[_0xcd03('0x4a')]['Descriptions']=integrations[_0xcd03('0x56')](_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x55')],_0x3921a5[_0xcd03('0x4a')][_0xcd03('0x3d')]);return db[_0xcd03('0x4e')][_0xcd03('0x49')](_0x3921a5[_0xcd03('0x4a')],{'include':[{'model':db[_0xcd03('0x57')],'as':_0xcd03('0x53')},{'model':db['ServicenowField'],'as':_0xcd03('0x58')}]});}return null;})['then'](respondWithResult(_0x30a63d,null))['catch'](handleError(_0x30a63d,null));};exports[_0xcd03('0x59')]=function(_0x1aabcd,_0x83f203,_0x2ef1c4){var _0x3ae2ce=[_0xcd03('0x5a'),'hold_reason',_0xcd03('0x5b'),_0xcd03('0x5c'),'close_code',_0xcd03('0x5d'),_0xcd03('0x5e'),_0xcd03('0x5f'),_0xcd03('0x60')];var _0x11c36d=['parent','made_sla',_0xcd03('0x61'),_0xcd03('0x62'),_0xcd03('0x63'),_0xcd03('0x64'),_0xcd03('0x65'),_0xcd03('0x66'),_0xcd03('0x67'),'number',_0xcd03('0x68'),'sys_updated_by',_0xcd03('0x69'),_0xcd03('0x6a'),'sys_created_on','sys_domain',_0xcd03('0x6b'),'sys_created_by',_0xcd03('0x5b'),_0xcd03('0x4f'),'calendar_stc',_0xcd03('0x6c'),_0xcd03('0x6d'),'delivery_plan',_0xcd03('0x6e'),_0xcd03('0x6f'),_0xcd03('0x70'),'business_service','priority',_0xcd03('0x71'),'rfc',_0xcd03('0x72'),'expected_start','opened_at','business_duration',_0xcd03('0x73'),_0xcd03('0x74'),_0xcd03('0x75'),_0xcd03('0x76'),_0xcd03('0x77'),_0xcd03('0x78'),_0xcd03('0x5c'),_0xcd03('0x79'),_0xcd03('0x7a'),_0xcd03('0x7b'),_0xcd03('0x7c'),_0xcd03('0x7d'),_0xcd03('0x7e'),_0xcd03('0x7f'),_0xcd03('0x80'),'additional_assignee_list',_0xcd03('0x81'),_0xcd03('0x82'),_0xcd03('0x5d'),_0xcd03('0x83'),_0xcd03('0x84'),_0xcd03('0x85'),_0xcd03('0x86'),_0xcd03('0x87'),_0xcd03('0x88'),_0xcd03('0x89'),'reopened_by',_0xcd03('0x5e'),_0xcd03('0x8a'),_0xcd03('0x8b'),_0xcd03('0x8c'),_0xcd03('0x8d'),_0xcd03('0x8e'),_0xcd03('0x8f'),_0xcd03('0x5f'),_0xcd03('0x90'),_0xcd03('0x91'),_0xcd03('0x92'),_0xcd03('0x93'),_0xcd03('0x94'),_0xcd03('0x95'),_0xcd03('0x96'),_0xcd03('0x97'),_0xcd03('0x98'),'upon_approval',_0xcd03('0x99'),_0xcd03('0x9a'),'category'];var _0x58cbf8='';var _0x6c881f='';var _0x404d95=[];var _0x3b92bd='';var _0x45b224='';var _0x550499=[];var _0x10c793='';var _0x23ea7b='';var _0xc47b0a={};var _0x27091d='';return db[_0xcd03('0x2e')]['findOne']({'where':{'id':_0x1aabcd[_0xcd03('0x4b')]['id']},'attributes':['id','username',_0xcd03('0x9b'),'email',_0xcd03('0x9c'),_0xcd03('0x9d')]})['then'](handleEntityNotFound(_0x83f203,null))[_0xcd03('0x28')](function(_0x4c8190){if(_0x4c8190){_0x27091d=_0x4c8190['remoteUri'];var _0x190faa=_0x27091d[_0xcd03('0x9e')](-0x1);if(_0x190faa==='/'){_0x27091d=_0x27091d['substring'](0x0,_0x27091d[_0xcd03('0x9f')](_0x190faa));}_0x23ea7b=util['format']('%s/api/now/doc/table/schema/',_0x27091d);_0x10c793=util[_0xcd03('0xa0')]('%s/api/now/table/',_0x27091d);_0xc47b0a={'user':_0x4c8190[_0xcd03('0xa1')],'pass':_0x4c8190['password']};var _0x481d48={'method':'GET','uri':_0x23ea7b+_0xcd03('0xa2'),'auth':_0xc47b0a,'json':!![]};return rp(_0x481d48);}})[_0xcd03('0x28')](function(_0x4b42f9){if(_0x4b42f9['result'][_0xcd03('0x38')]>0x0){_0x58cbf8=_0x4b42f9[_0xcd03('0xa3')];}console[_0xcd03('0xa4')](_0xcd03('0xa5'),_0x58cbf8);_0x550499=[];_0x6c881f=Object[_0xcd03('0xa6')]([],_0x58cbf8);_[_0xcd03('0xa7')](_0x6c881f,function(_0x547fa1){return!_0x3ae2ce[_0xcd03('0xa8')](_0x547fa1[_0xcd03('0x2b')]);});_0x6c881f[_0xcd03('0xa9')](function(_0x5d54fb){var _0x28fd53=createFieldObject(_0x10c793,_0xc47b0a,_0x5d54fb[_0xcd03('0xaa')],_0x5d54fb[_0xcd03('0x2b')],_0x5d54fb['label'],![]);_0x550499[_0xcd03('0xab')](_0x28fd53);});return Promise['all'](_0x550499);})[_0xcd03('0x28')](function(_0x2e0860){_0x404d95=_0x2e0860;_0x3b92bd=Object[_0xcd03('0xa6')]([],_0x58cbf8);console[_0xcd03('0xa4')](_0xcd03('0xac'),_0x58cbf8);_[_0xcd03('0xa7')](_0x3b92bd,function(_0xbfff74){return _0x11c36d['includes'](_0xbfff74[_0xcd03('0x2b')]);});console[_0xcd03('0xa4')](_0xcd03('0xad'),_0x3b92bd);_0x550499=[];_0x3b92bd['forEach'](function(_0x345303){var _0x300887=createFieldObject(_0x10c793,_0xc47b0a,_0x345303['internalType'],_0x345303[_0xcd03('0x2b')],_0x345303[_0xcd03('0xae')],!![]);_0x550499['push'](_0x300887);});return Promise[_0xcd03('0xaf')](_0x550499);})[_0xcd03('0x28')](function(_0x53bf13){_0x45b224=_0x53bf13;var _0x208efd=_0x404d95[_0xcd03('0xb0')](_0x45b224);return{'count':_0x208efd[_0xcd03('0x38')],'rows':_0x208efd};})[_0xcd03('0x28')](respondWithResult(_0x83f203,null))[_0xcd03('0x46')](function(_0xd564e0){console[_0xcd03('0xa4')](_0xcd03('0xb1')+_0xd564e0);var _0x572559=_0x1aabcd[_0xcd03('0x32')][_0xcd03('0xb2')]?0x1f4:_0xd564e0[_0xcd03('0xb3')]||0x1f4;logger[_0xcd03('0xb4')](_0xd564e0['stack']);delete _0xd564e0[_0xcd03('0x2b')];if(_0x572559===0x191){_0x572559=0x190;}_0x83f203[_0xcd03('0x1d')](_0x572559)['send'](_0x1aabcd[_0xcd03('0x32')][_0xcd03('0xb2')]?{'message':_0xcd03('0xb5'),'statusCode':_0xd564e0[_0xcd03('0xb3')]}:_0xd564e0);});};function createFieldObject(_0x5d100c,_0x2048af,_0xd03f08,_0x4ca6c3,_0x71cdc0,_0x285d58){return new Promise(function(_0x3be860,_0x2c1aa0){var _0x4ab247={'id':_0x4ca6c3,'name':_0x71cdc0,'custom':_0x285d58};if(_0xd03f08==='boolean'){_0x4ab247[_0xcd03('0x40')]=[{'name':_0xcd03('0xb6'),'value':'true'},{'name':_0xcd03('0xb7'),'value':_0xcd03('0xb8')}];_0x3be860(_0x4ab247);}else{var _0x2a561b={'method':'GET','uri':_0x5d100c+'sys_choice?sysparm_query=name=incident^element='+_0x4ca6c3,'auth':_0x2048af,'json':!![]};return rp(_0x2a561b)['then'](function(_0x59f5ea){var _0x55a19d=[];if(_0x59f5ea['result'][_0xcd03('0x38')]>0x0){_0x59f5ea[_0xcd03('0xa3')][_0xcd03('0xa9')](function(_0x2947f5){if(_0x2947f5[_0xcd03('0xb9')]==='false'){var _0x81761={'name':_0x2947f5['label'],'value':_0x2947f5[_0xcd03('0xba')]};_0x55a19d[_0xcd03('0xab')](_0x81761);}});}_0x4ab247[_0xcd03('0x40')]=_0x55a19d;if(_0x4ab247[_0xcd03('0x40')][_0xcd03('0x38')]>0x0){_0x3be860(_0x4ab247);}else{if(_0x285d58==![]){_0x3be860();}else{_0x3be860(_0x4ab247);}}});}});} \ No newline at end of file +var _0xf651=['correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','closed_by','follow_up','parent_incident','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','log','TCL:\x20_object','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','ServicenowAccount','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','update','body','getConfigurations','findOne','ServicenowConfiguration','nolimit','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','close_code','incident_state','severity','parent','upon_reject','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','delivery_plan','impact','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','short_description'];(function(_0x5a2f3a,_0x4de4f2){var _0xa430f=function(_0x385508){while(--_0x385508){_0x5a2f3a['push'](_0x5a2f3a['shift']());}};_0xa430f(++_0x4de4f2);}(_0xf651,0xf7));var _0x1f65=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf651[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f65('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f65('0x1'));var rp=require(_0x1f65('0x2'));var moment=require(_0x1f65('0x3'));var BPromise=require(_0x1f65('0x4'));var Mustache=require('mustache');var util=require(_0x1f65('0x5'));var path=require(_0x1f65('0x6'));var sox=require(_0x1f65('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f65('0x8'));var _=require('lodash');var squel=require(_0x1f65('0x9'));var crypto=require(_0x1f65('0xa'));var jsforce=require(_0x1f65('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f65('0xc'));var Papa=require(_0x1f65('0xd'));var Redis=require(_0x1f65('0xe'));var authService=require(_0x1f65('0xf'));var qs=require(_0x1f65('0x10'));var as=require(_0x1f65('0x11'));var hardwareService=require(_0x1f65('0x12'));var logger=require(_0x1f65('0x13'))('api');var utils=require(_0x1f65('0x14'));var config=require(_0x1f65('0x15'));var licenseUtil=require(_0x1f65('0x16'));var db=require(_0x1f65('0x17'))['db'];var integrations=require(_0x1f65('0x18'));function respondWithStatusCode(_0x3faab9,_0x9f46db){_0x9f46db=_0x9f46db||0xcc;return function(_0x3c125c){if(_0x3c125c){return _0x3faab9[_0x1f65('0x19')](_0x9f46db);}return _0x3faab9[_0x1f65('0x1a')](_0x9f46db)[_0x1f65('0x1b')]();};}function respondWithResult(_0x512cad,_0x4c7543){_0x4c7543=_0x4c7543||0xc8;return function(_0x3c6946){if(_0x3c6946){return _0x512cad[_0x1f65('0x1a')](_0x4c7543)[_0x1f65('0x1c')](_0x3c6946);}};}function respondWithFilteredResult(_0x19185f,_0x3e27a3){return function(_0x468922){if(_0x468922){var _0x3a3d45=typeof _0x3e27a3['offset']==='undefined'&&typeof _0x3e27a3['limit']===_0x1f65('0x1d');var _0x4e9c09=_0x468922[_0x1f65('0x1e')];var _0x1ceb1d=_0x3a3d45?0x0:_0x3e27a3[_0x1f65('0x1f')];var _0x1da44b=_0x3a3d45?_0x468922[_0x1f65('0x1e')]:_0x3e27a3[_0x1f65('0x1f')]+_0x3e27a3[_0x1f65('0x20')];var _0x154b6e;if(_0x1da44b>=_0x4e9c09){_0x1da44b=_0x4e9c09;_0x154b6e=0xc8;}else{_0x154b6e=0xce;}_0x19185f[_0x1f65('0x1a')](_0x154b6e);return _0x19185f[_0x1f65('0x21')](_0x1f65('0x22'),_0x1ceb1d+'-'+_0x1da44b+'/'+_0x4e9c09)[_0x1f65('0x1c')](_0x468922);}return null;};}function patchUpdates(_0x2f5923){return function(_0x5e4b90){try{jsonpatch[_0x1f65('0x23')](_0x5e4b90,_0x2f5923,!![]);}catch(_0x439fc9){return BPromise[_0x1f65('0x24')](_0x439fc9);}return _0x5e4b90['save']();};}function saveUpdates(_0x24b1cc,_0x1b1d55){return function(_0x4a559c){if(_0x4a559c){return _0x4a559c['update'](_0x24b1cc)[_0x1f65('0x25')](function(_0x4d439b){return _0x4d439b;});}return null;};}function removeEntity(_0x26b585,_0x51cee6){return function(_0x31cdf4){if(_0x31cdf4){return _0x31cdf4[_0x1f65('0x26')]()[_0x1f65('0x25')](function(){_0x26b585[_0x1f65('0x1a')](0xcc)[_0x1f65('0x1b')]();});}};}function handleEntityNotFound(_0x27adce,_0x518ed8){return function(_0x3f8517){if(!_0x3f8517){_0x27adce[_0x1f65('0x19')](0x194);}return _0x3f8517;};}function handleError(_0x52a860,_0x2f7d00){_0x2f7d00=_0x2f7d00||0x1f4;return function(_0x2df21b){logger[_0x1f65('0x27')](_0x2df21b[_0x1f65('0x28')]);if(_0x2df21b[_0x1f65('0x29')]){delete _0x2df21b[_0x1f65('0x29')];}_0x52a860[_0x1f65('0x1a')](_0x2f7d00)[_0x1f65('0x2a')](_0x2df21b);};}exports[_0x1f65('0x2b')]=function(_0x181218,_0x146147){var _0x1baaf4={},_0x11c105={},_0x28abb0={'count':0x0,'rows':[]};var _0x48f020=_[_0x1f65('0x2c')](db['ServicenowAccount']['rawAttributes'],function(_0x42f298){return{'name':_0x42f298['fieldName'],'type':_0x42f298[_0x1f65('0x2d')][_0x1f65('0x2e')]};});_0x11c105['model']=_['map'](_0x48f020,_0x1f65('0x29'));_0x11c105[_0x1f65('0x2f')]=_[_0x1f65('0x30')](_0x181218[_0x1f65('0x2f')]);_0x11c105[_0x1f65('0x31')]=_[_0x1f65('0x32')](_0x11c105[_0x1f65('0x33')],_0x11c105[_0x1f65('0x2f')]);_0x1baaf4[_0x1f65('0x34')]=_[_0x1f65('0x32')](_0x11c105['model'],qs[_0x1f65('0x35')](_0x181218[_0x1f65('0x2f')][_0x1f65('0x35')]));_0x1baaf4[_0x1f65('0x34')]=_0x1baaf4[_0x1f65('0x34')][_0x1f65('0x36')]?_0x1baaf4[_0x1f65('0x34')]:_0x11c105[_0x1f65('0x33')];if(!_0x181218[_0x1f65('0x2f')][_0x1f65('0x37')]('nolimit')){_0x1baaf4[_0x1f65('0x20')]=qs['limit'](_0x181218[_0x1f65('0x2f')][_0x1f65('0x20')]);_0x1baaf4[_0x1f65('0x1f')]=qs[_0x1f65('0x1f')](_0x181218[_0x1f65('0x2f')][_0x1f65('0x1f')]);}_0x1baaf4[_0x1f65('0x38')]=qs[_0x1f65('0x39')](_0x181218['query'][_0x1f65('0x39')]);_0x1baaf4[_0x1f65('0x3a')]=qs[_0x1f65('0x31')](_[_0x1f65('0x3b')](_0x181218['query'],_0x11c105[_0x1f65('0x31')]),_0x48f020);if(_0x181218[_0x1f65('0x2f')]['filter']){_0x1baaf4['where']=_[_0x1f65('0x3c')](_0x1baaf4['where'],{'$or':_[_0x1f65('0x2c')](_0x48f020,function(_0x220044){if(_0x220044[_0x1f65('0x2d')]!=='VIRTUAL'){var _0x1da49a={};_0x1da49a[_0x220044[_0x1f65('0x29')]]={'$like':'%'+_0x181218[_0x1f65('0x2f')][_0x1f65('0x3d')]+'%'};return _0x1da49a;}})});}_0x1baaf4=_[_0x1f65('0x3c')]({},_0x1baaf4,_0x181218['options']);var _0x1895b9={'where':_0x1baaf4[_0x1f65('0x3a')]};return db[_0x1f65('0x3e')]['count'](_0x1895b9)['then'](function(_0x1ba113){_0x28abb0[_0x1f65('0x1e')]=_0x1ba113;if(_0x181218['query'][_0x1f65('0x3f')]){_0x1baaf4['include']=[{'all':!![]}];}return db[_0x1f65('0x3e')][_0x1f65('0x40')](_0x1baaf4);})[_0x1f65('0x25')](function(_0x268a15){_0x28abb0['rows']=_0x268a15;return _0x28abb0;})['then'](respondWithFilteredResult(_0x146147,_0x1baaf4))[_0x1f65('0x41')](handleError(_0x146147,null));};exports[_0x1f65('0x42')]=function(_0x4f24f9,_0x321140){var _0x1599b6={'raw':![],'where':{'id':_0x4f24f9[_0x1f65('0x43')]['id']}},_0x524225={};_0x524225[_0x1f65('0x33')]=_[_0x1f65('0x30')](db[_0x1f65('0x3e')][_0x1f65('0x44')]);_0x524225[_0x1f65('0x2f')]=_['keys'](_0x4f24f9['query']);_0x524225[_0x1f65('0x31')]=_['intersection'](_0x524225[_0x1f65('0x33')],_0x524225[_0x1f65('0x2f')]);_0x1599b6[_0x1f65('0x34')]=_[_0x1f65('0x32')](_0x524225[_0x1f65('0x33')],qs[_0x1f65('0x35')](_0x4f24f9[_0x1f65('0x2f')]['fields']));_0x1599b6[_0x1f65('0x34')]=_0x1599b6['attributes']['length']?_0x1599b6[_0x1f65('0x34')]:_0x524225[_0x1f65('0x33')];if(_0x4f24f9[_0x1f65('0x2f')][_0x1f65('0x3f')]){_0x1599b6[_0x1f65('0x45')]=[{'all':!![]}];}_0x1599b6=_[_0x1f65('0x3c')]({},_0x1599b6,_0x4f24f9[_0x1f65('0x46')]);return db[_0x1f65('0x3e')][_0x1f65('0x47')](_0x1599b6)['then'](handleEntityNotFound(_0x321140,null))[_0x1f65('0x25')](respondWithResult(_0x321140,null))[_0x1f65('0x41')](handleError(_0x321140,null));};exports[_0x1f65('0x48')]=function(_0x2fca19,_0x39ac82){return db[_0x1f65('0x3e')][_0x1f65('0x48')](_0x2fca19['body'],{})['then'](respondWithResult(_0x39ac82,0xc9))['catch'](handleError(_0x39ac82,null));};exports[_0x1f65('0x49')]=function(_0x4028d6,_0x532b0a){if(_0x4028d6[_0x1f65('0x4a')]['id']){delete _0x4028d6[_0x1f65('0x4a')]['id'];}return db[_0x1f65('0x3e')]['find']({'where':{'id':_0x4028d6[_0x1f65('0x43')]['id']}})[_0x1f65('0x25')](handleEntityNotFound(_0x532b0a,null))[_0x1f65('0x25')](saveUpdates(_0x4028d6[_0x1f65('0x4a')],null))['then'](respondWithResult(_0x532b0a,null))['catch'](handleError(_0x532b0a,null));};exports[_0x1f65('0x26')]=function(_0x5441b6,_0x1c50eb){return db[_0x1f65('0x3e')]['find']({'where':{'id':_0x5441b6[_0x1f65('0x43')]['id']}})[_0x1f65('0x25')](handleEntityNotFound(_0x1c50eb,null))['then'](removeEntity(_0x1c50eb,null))[_0x1f65('0x41')](handleError(_0x1c50eb,null));};exports[_0x1f65('0x4b')]=function(_0x394c3e,_0x56c900,_0x3a557b){var _0x20ce04={};var _0x1276ca={};var _0x399e2a;var _0x5ada95;return db[_0x1f65('0x3e')][_0x1f65('0x4c')]({'where':{'id':_0x394c3e[_0x1f65('0x43')]['id']}})[_0x1f65('0x25')](handleEntityNotFound(_0x56c900,null))[_0x1f65('0x25')](function(_0x57451d){if(_0x57451d){_0x399e2a=_0x57451d;_0x1276ca['model']=_[_0x1f65('0x30')](db[_0x1f65('0x4d')][_0x1f65('0x44')]);_0x1276ca['query']=_[_0x1f65('0x30')](_0x394c3e[_0x1f65('0x2f')]);_0x1276ca['filters']=_[_0x1f65('0x32')](_0x1276ca[_0x1f65('0x33')],_0x1276ca[_0x1f65('0x2f')]);_0x20ce04[_0x1f65('0x34')]=_['intersection'](_0x1276ca['model'],qs[_0x1f65('0x35')](_0x394c3e['query']['fields']));_0x20ce04['attributes']=_0x20ce04[_0x1f65('0x34')][_0x1f65('0x36')]?_0x20ce04[_0x1f65('0x34')]:_0x1276ca['model'];_0x20ce04[_0x1f65('0x38')]=qs[_0x1f65('0x39')](_0x394c3e['query'][_0x1f65('0x39')]);_0x20ce04['where']=qs[_0x1f65('0x31')](_[_0x1f65('0x3b')](_0x394c3e[_0x1f65('0x2f')],_0x1276ca[_0x1f65('0x31')]));if(_0x394c3e[_0x1f65('0x2f')][_0x1f65('0x3d')]){_0x20ce04[_0x1f65('0x3a')]=_[_0x1f65('0x3c')](_0x20ce04['where'],{'$or':_[_0x1f65('0x2c')](_0x20ce04[_0x1f65('0x34')],function(_0x1e7ddd){var _0x610218={};_0x610218[_0x1e7ddd]={'$like':'%'+_0x394c3e[_0x1f65('0x2f')][_0x1f65('0x3d')]+'%'};return _0x610218;})});}_0x20ce04=_['merge']({},_0x20ce04,_0x394c3e[_0x1f65('0x46')]);return _0x399e2a[_0x1f65('0x4b')](_0x20ce04);}})[_0x1f65('0x25')](function(_0x4da0e0){if(_0x4da0e0){_0x5ada95=_0x4da0e0[_0x1f65('0x36')];if(!_0x394c3e['query'][_0x1f65('0x37')](_0x1f65('0x4e'))){_0x20ce04[_0x1f65('0x20')]=qs[_0x1f65('0x20')](_0x394c3e[_0x1f65('0x2f')]['limit']);_0x20ce04['offset']=qs[_0x1f65('0x1f')](_0x394c3e['query'][_0x1f65('0x1f')]);}return _0x399e2a[_0x1f65('0x4b')](_0x20ce04);}})[_0x1f65('0x25')](function(_0x1fdec6){if(_0x1fdec6){return _0x1fdec6?{'count':_0x5ada95,'rows':_0x1fdec6}:null;}})['then'](respondWithResult(_0x56c900,null))[_0x1f65('0x41')](handleError(_0x56c900,null));};exports['addConfiguration']=function(_0x576579,_0x46ec0b,_0x124bef){if(_0x576579[_0x1f65('0x4a')]['id']){delete _0x576579[_0x1f65('0x4a')]['id'];}return db['ServicenowAccount'][_0x1f65('0x4c')]({'where':{'id':_0x576579[_0x1f65('0x43')]['id']}})['then'](handleEntityNotFound(_0x46ec0b,null))[_0x1f65('0x25')](function(_0x2d065e){if(_0x2d065e){_0x576579[_0x1f65('0x4a')]['AccountId']=_0x2d065e['id'];_0x576579[_0x1f65('0x4a')][_0x1f65('0x4f')]=integrations[_0x1f65('0x50')](_0x576579['body'][_0x1f65('0x51')],_0x576579['body'][_0x1f65('0x2d')]);_0x576579[_0x1f65('0x4a')][_0x1f65('0x52')]=integrations['getDescriptions'](_0x576579[_0x1f65('0x4a')][_0x1f65('0x51')],_0x576579['body'][_0x1f65('0x2d')]);return db[_0x1f65('0x4d')][_0x1f65('0x48')](_0x576579[_0x1f65('0x4a')],{'include':[{'model':db[_0x1f65('0x53')],'as':_0x1f65('0x4f')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x1f65('0x25')](respondWithResult(_0x46ec0b,null))['catch'](handleError(_0x46ec0b,null));};exports[_0x1f65('0x54')]=function(_0x2bb7b5,_0x2be419,_0x5e8797){var _0xd8ac83=[_0x1f65('0x55'),_0x1f65('0x56'),'knowledge','subcategory',_0x1f65('0x57'),'notify',_0x1f65('0x58'),_0x1f65('0x59'),'category'];var _0x2473be=[_0x1f65('0x5a'),'made_sla','caused_by','watch_list',_0x1f65('0x5b'),'sys_updated_on',_0x1f65('0x5c'),_0x1f65('0x56'),_0x1f65('0x5d'),_0x1f65('0x5e'),_0x1f65('0x5f'),'sys_updated_by',_0x1f65('0x60'),_0x1f65('0x61'),_0x1f65('0x62'),_0x1f65('0x63'),_0x1f65('0x64'),_0x1f65('0x65'),_0x1f65('0x66'),'order',_0x1f65('0x67'),_0x1f65('0x68'),'cmdb_ci',_0x1f65('0x69'),_0x1f65('0x6a'),'active','work_notes_list','business_service',_0x1f65('0x6b'),_0x1f65('0x6c'),_0x1f65('0x6d'),'time_worked',_0x1f65('0x6e'),_0x1f65('0x6f'),_0x1f65('0x70'),_0x1f65('0x71'),_0x1f65('0x72'),_0x1f65('0x73'),_0x1f65('0x74'),_0x1f65('0x75'),_0x1f65('0x76'),_0x1f65('0x77'),'work_notes',_0x1f65('0x78'),_0x1f65('0x57'),_0x1f65('0x79'),_0x1f65('0x7a'),_0x1f65('0x7b'),_0x1f65('0x7c'),_0x1f65('0x7d'),_0x1f65('0x7e'),_0x1f65('0x7f'),_0x1f65('0x80'),_0x1f65('0x81'),'sys_class_name',_0x1f65('0x82'),_0x1f65('0x83'),_0x1f65('0x84'),_0x1f65('0x85'),'sys_id',_0x1f65('0x86'),'reopened_by',_0x1f65('0x58'),_0x1f65('0x87'),_0x1f65('0x88'),_0x1f65('0x89'),_0x1f65('0x8a'),_0x1f65('0x8b'),_0x1f65('0x8c'),_0x1f65('0x59'),_0x1f65('0x8d'),'sla_due',_0x1f65('0x8e'),'comments_and_work_notes',_0x1f65('0x8f'),_0x1f65('0x90'),_0x1f65('0x91'),_0x1f65('0x92'),_0x1f65('0x93'),_0x1f65('0x94'),_0x1f65('0x95'),_0x1f65('0x96'),_0x1f65('0x97')];var _0x365ff9='';var _0x3df85f='';var _0x25704a=[];var _0xacba72='';var _0x28c838='';var _0x15f5d4=[];var _0xd61112='';var _0x50e2b7='';var _0x109f13={};var _0x961b84='';return db[_0x1f65('0x3e')][_0x1f65('0x4c')]({'where':{'id':_0x2bb7b5[_0x1f65('0x43')]['id']},'attributes':['id',_0x1f65('0x98'),_0x1f65('0x99'),'email',_0x1f65('0x9a'),'serverUrl']})[_0x1f65('0x25')](handleEntityNotFound(_0x2be419,null))[_0x1f65('0x25')](function(_0x460c56){if(_0x460c56){_0x961b84=_0x460c56[_0x1f65('0x9a')];var _0x4a773=_0x961b84[_0x1f65('0x9b')](-0x1);if(_0x4a773==='/'){_0x961b84=_0x961b84[_0x1f65('0x9c')](0x0,_0x961b84[_0x1f65('0x9d')](_0x4a773));}_0x50e2b7=util[_0x1f65('0x9e')]('%s/api/now/doc/table/schema/',_0x961b84);_0xd61112=util[_0x1f65('0x9e')](_0x1f65('0x9f'),_0x961b84);_0x109f13={'user':_0x460c56['username'],'pass':_0x460c56[_0x1f65('0x99')]};var _0x17f884={'method':_0x1f65('0xa0'),'uri':_0x50e2b7+_0x1f65('0xa1'),'auth':_0x109f13,'json':!![]};return rp(_0x17f884);}})['then'](function(_0x30bd62){if(_0x30bd62[_0x1f65('0xa2')][_0x1f65('0x36')]>0x0){_0x365ff9=_0x30bd62[_0x1f65('0xa2')];}console['log'](_0x1f65('0xa3'),_0x365ff9);_0x15f5d4=[];_0x3df85f=Object[_0x1f65('0xa4')]([],_0x365ff9);_[_0x1f65('0xa5')](_0x3df85f,function(_0x27c2b8){return!_0xd8ac83[_0x1f65('0xa6')](_0x27c2b8[_0x1f65('0x29')]);});_0x3df85f[_0x1f65('0xa7')](function(_0x5c8465){var _0x3ee30f=createFieldObject(_0xd61112,_0x109f13,_0x5c8465[_0x1f65('0xa8')],_0x5c8465[_0x1f65('0x29')],_0x5c8465[_0x1f65('0xa9')],![]);_0x15f5d4[_0x1f65('0xaa')](_0x3ee30f);});return Promise[_0x1f65('0xab')](_0x15f5d4);})[_0x1f65('0x25')](function(_0x58bcb4){_0x25704a=_0x58bcb4;_0xacba72=Object[_0x1f65('0xa4')]([],_0x365ff9);console[_0x1f65('0xac')](_0x1f65('0xad'),_0x365ff9);_['remove'](_0xacba72,function(_0x41e647){return _0x2473be[_0x1f65('0xa6')](_0x41e647[_0x1f65('0x29')]);});console[_0x1f65('0xac')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xacba72);_0x15f5d4=[];_0xacba72[_0x1f65('0xa7')](function(_0x1f3871){var _0x65d97e=createFieldObject(_0xd61112,_0x109f13,_0x1f3871[_0x1f65('0xa8')],_0x1f3871[_0x1f65('0x29')],_0x1f3871['label'],!![]);_0x15f5d4[_0x1f65('0xaa')](_0x65d97e);});return Promise[_0x1f65('0xab')](_0x15f5d4);})[_0x1f65('0x25')](function(_0x32a18b){_0x28c838=_0x32a18b;var _0x5dcb32=_0x25704a['concat'](_0x28c838);return{'count':_0x5dcb32[_0x1f65('0x36')],'rows':_0x5dcb32};})[_0x1f65('0x25')](respondWithResult(_0x2be419,null))['catch'](function(_0x259a92){console['log'](_0x1f65('0xae')+_0x259a92);var _0x20d5a7=_0x2bb7b5[_0x1f65('0x2f')][_0x1f65('0xaf')]?0x1f4:_0x259a92[_0x1f65('0xb0')]||0x1f4;logger[_0x1f65('0x27')](_0x259a92[_0x1f65('0x28')]);delete _0x259a92[_0x1f65('0x29')];if(_0x20d5a7===0x191){_0x20d5a7=0x190;}_0x2be419['status'](_0x20d5a7)[_0x1f65('0x2a')](_0x2bb7b5[_0x1f65('0x2f')][_0x1f65('0xaf')]?{'message':_0x1f65('0xb1'),'statusCode':_0x259a92[_0x1f65('0xb0')]}:_0x259a92);});};function createFieldObject(_0x2a305d,_0x247f6c,_0x5b7809,_0x30b80f,_0x3e87e6,_0x3b2691){return new Promise(function(_0xf9fe31,_0x55716d){var _0x59c1a5={'id':_0x30b80f,'name':_0x3e87e6,'custom':_0x3b2691};if(_0x5b7809===_0x1f65('0xb2')){_0x59c1a5['options']=[{'name':_0x1f65('0xb3'),'value':'true'},{'name':_0x1f65('0xb4'),'value':_0x1f65('0xb5')}];_0xf9fe31(_0x59c1a5);}else{var _0x2820de={'method':'GET','uri':_0x2a305d+_0x1f65('0xb6')+_0x30b80f,'auth':_0x247f6c,'json':!![]};return rp(_0x2820de)[_0x1f65('0x25')](function(_0x4eb35c){var _0x177be7=[];if(_0x4eb35c[_0x1f65('0xa2')][_0x1f65('0x36')]>0x0){_0x4eb35c[_0x1f65('0xa2')][_0x1f65('0xa7')](function(_0x5407c9){if(_0x5407c9[_0x1f65('0xb7')]===_0x1f65('0xb5')){var _0x47c565={'name':_0x5407c9[_0x1f65('0xa9')],'value':_0x5407c9['value']};_0x177be7[_0x1f65('0xaa')](_0x47c565);}});}_0x59c1a5[_0x1f65('0x46')]=_0x177be7;if(_0x59c1a5[_0x1f65('0x46')]['length']>0x0){_0xf9fe31(_0x59c1a5);}else{if(_0x3b2691==![]){_0xf9fe31();}else{_0xf9fe31(_0x59c1a5);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 6bbd57c..f2b59c0 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x414cef,_0x391211){var _0x2c3ac4=function(_0x7b95d8){while(--_0x7b95d8){_0x414cef['push'](_0x414cef['shift']());}};_0x2c3ac4(++_0x391211);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3b5351,_0x20ea82){_0x3b5351=_0x3b5351-0x0;var _0x30d24e=_0xbd51[_0x3b5351];return _0x30d24e;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['define','int_servicenow_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x40f68f,_0x352e1e){var _0x1d9cff=function(_0x1caf34){while(--_0x1caf34){_0x40f68f['push'](_0x40f68f['shift']());}};_0x1d9cff(++_0x352e1e);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('ServicenowAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 79b0149..404a966 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 _0x3b38=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ServicenowAccount','findAll','options','attributes','limit','include','model','map','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x411631,_0x5cc5c3){var _0x490190=function(_0x19148d){while(--_0x19148d){_0x411631['push'](_0x411631['shift']());}};_0x490190(++_0x5cc5c3);}(_0x3b38,0x125));var _0x83b3=function(_0x3de5fc,_0x1fe70a){_0x3de5fc=_0x3de5fc-0x0;var _0x1b5f88=_0x3b38[_0x3de5fc];return _0x1b5f88;};'use strict';var _=require(_0x83b3('0x0'));var util=require(_0x83b3('0x1'));var moment=require('moment');var BPromise=require(_0x83b3('0x2'));var rs=require(_0x83b3('0x3'));var fs=require('fs');var Redis=require(_0x83b3('0x4'));var db=require(_0x83b3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83b3('0x6'))(_0x83b3('0x7'));var config=require(_0x83b3('0x8'));var jayson=require(_0x83b3('0x9'));var client=jayson['client'][_0x83b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x185d3a,_0x3473c6,_0x472af9){return new BPromise(function(_0x7b5e5a,_0x418dc3){return client[_0x83b3('0xb')](_0x185d3a,_0x472af9)[_0x83b3('0xc')](function(_0x5cd994){logger[_0x83b3('0xd')](_0x83b3('0xe'),_0x3473c6,_0x83b3('0xf'));logger[_0x83b3('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3473c6,'request\x20sent',JSON[_0x83b3('0x11')](_0x5cd994));if(_0x5cd994['error']){if(_0x5cd994[_0x83b3('0x12')][_0x83b3('0x13')]===0x1f4){logger[_0x83b3('0x12')](_0x83b3('0xe'),_0x3473c6,_0x5cd994[_0x83b3('0x12')][_0x83b3('0x14')]);return _0x418dc3(_0x5cd994[_0x83b3('0x12')][_0x83b3('0x14')]);}logger['error'](_0x83b3('0xe'),_0x3473c6,_0x5cd994['error']['message']);return _0x7b5e5a(_0x5cd994[_0x83b3('0x12')][_0x83b3('0x14')]);}else{logger[_0x83b3('0xd')](_0x83b3('0xe'),_0x3473c6,_0x83b3('0xf'));_0x7b5e5a(_0x5cd994['result'][_0x83b3('0x14')]);}})[_0x83b3('0x15')](function(_0x409fde){logger['error'](_0x83b3('0xe'),_0x3473c6,_0x409fde);_0x418dc3(_0x409fde);});});}exports['GetServicenowAccount']=function(_0x611002){var _0x5e0542=this;return new Promise(function(_0x5e68b8,_0x1ce339){return db[_0x83b3('0x16')][_0x83b3('0x17')]({'raw':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')]['where']||null:null,'attributes':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')][_0x83b3('0x19')]||null:null,'limit':_0x611002[_0x83b3('0x18')]?_0x611002['options'][_0x83b3('0x1a')]||null:null,'include':_0x611002[_0x83b3('0x18')]?_0x611002[_0x83b3('0x18')][_0x83b3('0x1b')]?_['map'](_0x611002[_0x83b3('0x18')][_0x83b3('0x1b')],function(_0x1b8e32){return{'model':db[_0x1b8e32[_0x83b3('0x1c')]],'as':_0x1b8e32['as'],'attributes':_0x1b8e32[_0x83b3('0x19')],'include':_0x1b8e32[_0x83b3('0x1b')]?_[_0x83b3('0x1d')](_0x1b8e32[_0x83b3('0x1b')],function(_0x5dbcbd){return{'model':db[_0x5dbcbd[_0x83b3('0x1c')]],'as':_0x5dbcbd['as'],'attributes':_0x5dbcbd[_0x83b3('0x19')],'include':_0x5dbcbd[_0x83b3('0x1b')]?_[_0x83b3('0x1d')](_0x5dbcbd[_0x83b3('0x1b')],function(_0x1f9553){return{'model':db[_0x1f9553[_0x83b3('0x1c')]],'as':_0x1f9553['as'],'attributes':_0x1f9553['attributes']};}):[]};}):[]};}):[]:[]})[_0x83b3('0xc')](function(_0x48cff9){logger['info'](_0x83b3('0x1e'),_0x611002);logger[_0x83b3('0x10')](_0x83b3('0x1e'),_0x611002,JSON[_0x83b3('0x11')](_0x48cff9));_0x5e68b8(_0x48cff9);})[_0x83b3('0x15')](function(_0x684eb3){logger['error'](_0x83b3('0x1e'),_0x684eb3[_0x83b3('0x14')],_0x611002);_0x1ce339(_0x5e0542[_0x83b3('0x12')](0x1f4,_0x684eb3['message']));});});};exports[_0x83b3('0x1f')]=function(_0x136763){var _0xeb1449=this;return new Promise(function(_0x2e94da,_0x483db7){return db[_0x83b3('0x16')][_0x83b3('0x20')]({'raw':_0x136763[_0x83b3('0x18')]?_0x136763[_0x83b3('0x18')][_0x83b3('0x21')]===undefined?!![]:![]:!![],'where':_0x136763[_0x83b3('0x18')]?_0x136763[_0x83b3('0x18')]['where']||null:null,'attributes':_0x136763[_0x83b3('0x18')]?_0x136763['options'][_0x83b3('0x19')]||null:null,'include':_0x136763[_0x83b3('0x18')]?_0x136763['options']['include']?_['map'](_0x136763[_0x83b3('0x18')][_0x83b3('0x1b')],function(_0x518211){return{'model':db[_0x518211[_0x83b3('0x1c')]],'as':_0x518211['as'],'attributes':_0x518211[_0x83b3('0x19')],'include':_0x518211[_0x83b3('0x1b')]?_[_0x83b3('0x1d')](_0x518211['include'],function(_0x2a676f){return{'model':db[_0x2a676f[_0x83b3('0x1c')]],'as':_0x2a676f['as'],'attributes':_0x2a676f['attributes'],'include':_0x2a676f[_0x83b3('0x1b')]?_['map'](_0x2a676f['include'],function(_0x2aa1ef){return{'model':db[_0x2aa1ef[_0x83b3('0x1c')]],'as':_0x2aa1ef['as'],'attributes':_0x2aa1ef[_0x83b3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x83b3('0xc')](function(_0x26dd93){logger[_0x83b3('0xd')](_0x83b3('0x1f'),_0x136763);logger[_0x83b3('0x10')](_0x83b3('0x1f'),_0x136763,JSON['stringify'](_0x26dd93));_0x2e94da(_0x26dd93);})[_0x83b3('0x15')](function(_0x1ab929){logger[_0x83b3('0x12')]('ShowServicenowAccount',_0x1ab929[_0x83b3('0x14')],_0x136763);_0x483db7(_0xeb1449['error'](0x1f4,_0x1ab929[_0x83b3('0x14')]));});});}; \ No newline at end of file +var _0xc368=['rpc','jayson/promise','client','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','ServicenowAccount','findAll','options','where','include','map','model','attributes','GetServicenowAccount','ShowServicenowAccount','find','raw','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc368,0x108));var _0x8c36=function(_0x113f91,_0x25a96d){_0x113f91=_0x113f91-0x0;var _0x1c991d=_0xc368[_0x113f91];return _0x1c991d;};'use strict';var _=require(_0x8c36('0x0'));var util=require(_0x8c36('0x1'));var moment=require(_0x8c36('0x2'));var BPromise=require(_0x8c36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c36('0x4'));var db=require(_0x8c36('0x5'))['db'];var utils=require(_0x8c36('0x6'));var logger=require(_0x8c36('0x7'))(_0x8c36('0x8'));var config=require('../../config/environment');var jayson=require(_0x8c36('0x9'));var client=jayson[_0x8c36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3bf9,_0x4d9918,_0xd39446){return new BPromise(function(_0x33ec14,_0x1c1a1d){return client['request'](_0x4a3bf9,_0xd39446)[_0x8c36('0xb')](function(_0x152677){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4d9918,_0x8c36('0xc'));logger[_0x8c36('0xd')](_0x8c36('0xe'),_0x4d9918,_0x8c36('0xc'),JSON[_0x8c36('0xf')](_0x152677));if(_0x152677['error']){if(_0x152677[_0x8c36('0x10')][_0x8c36('0x11')]===0x1f4){logger[_0x8c36('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4d9918,_0x152677[_0x8c36('0x10')]['message']);return _0x1c1a1d(_0x152677['error']['message']);}logger[_0x8c36('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4d9918,_0x152677[_0x8c36('0x10')][_0x8c36('0x12')]);return _0x33ec14(_0x152677[_0x8c36('0x10')]['message']);}else{logger['info'](_0x8c36('0x13'),_0x4d9918,'request\x20sent');_0x33ec14(_0x152677[_0x8c36('0x14')][_0x8c36('0x12')]);}})['catch'](function(_0x5b7f3e){logger[_0x8c36('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4d9918,_0x5b7f3e);_0x1c1a1d(_0x5b7f3e);});});}exports['GetServicenowAccount']=function(_0x45f1c4){var _0x52531e=this;return new Promise(function(_0x9f9449,_0x416a45){return db[_0x8c36('0x15')][_0x8c36('0x16')]({'raw':_0x45f1c4[_0x8c36('0x17')]?_0x45f1c4[_0x8c36('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x45f1c4[_0x8c36('0x17')]?_0x45f1c4[_0x8c36('0x17')][_0x8c36('0x18')]||null:null,'attributes':_0x45f1c4[_0x8c36('0x17')]?_0x45f1c4[_0x8c36('0x17')]['attributes']||null:null,'limit':_0x45f1c4['options']?_0x45f1c4[_0x8c36('0x17')]['limit']||null:null,'include':_0x45f1c4[_0x8c36('0x17')]?_0x45f1c4['options'][_0x8c36('0x19')]?_[_0x8c36('0x1a')](_0x45f1c4[_0x8c36('0x17')][_0x8c36('0x19')],function(_0xf0cb5f){return{'model':db[_0xf0cb5f[_0x8c36('0x1b')]],'as':_0xf0cb5f['as'],'attributes':_0xf0cb5f[_0x8c36('0x1c')],'include':_0xf0cb5f[_0x8c36('0x19')]?_[_0x8c36('0x1a')](_0xf0cb5f['include'],function(_0x16d016){return{'model':db[_0x16d016[_0x8c36('0x1b')]],'as':_0x16d016['as'],'attributes':_0x16d016['attributes'],'include':_0x16d016[_0x8c36('0x19')]?_['map'](_0x16d016[_0x8c36('0x19')],function(_0x4172ae){return{'model':db[_0x4172ae[_0x8c36('0x1b')]],'as':_0x4172ae['as'],'attributes':_0x4172ae[_0x8c36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8c36('0xb')](function(_0x43d0f1){logger['info'](_0x8c36('0x1d'),_0x45f1c4);logger['debug'](_0x8c36('0x1d'),_0x45f1c4,JSON[_0x8c36('0xf')](_0x43d0f1));_0x9f9449(_0x43d0f1);})['catch'](function(_0x5f116d){logger[_0x8c36('0x10')](_0x8c36('0x1d'),_0x5f116d['message'],_0x45f1c4);_0x416a45(_0x52531e[_0x8c36('0x10')](0x1f4,_0x5f116d['message']));});});};exports[_0x8c36('0x1e')]=function(_0x517068){var _0x5a8b33=this;return new Promise(function(_0x58e546,_0x533516){return db['ServicenowAccount'][_0x8c36('0x1f')]({'raw':_0x517068[_0x8c36('0x17')]?_0x517068[_0x8c36('0x17')][_0x8c36('0x20')]===undefined?!![]:![]:!![],'where':_0x517068[_0x8c36('0x17')]?_0x517068[_0x8c36('0x17')]['where']||null:null,'attributes':_0x517068['options']?_0x517068[_0x8c36('0x17')]['attributes']||null:null,'include':_0x517068['options']?_0x517068[_0x8c36('0x17')]['include']?_[_0x8c36('0x1a')](_0x517068['options']['include'],function(_0x15a178){return{'model':db[_0x15a178[_0x8c36('0x1b')]],'as':_0x15a178['as'],'attributes':_0x15a178[_0x8c36('0x1c')],'include':_0x15a178[_0x8c36('0x19')]?_[_0x8c36('0x1a')](_0x15a178[_0x8c36('0x19')],function(_0x1ebe00){return{'model':db[_0x1ebe00[_0x8c36('0x1b')]],'as':_0x1ebe00['as'],'attributes':_0x1ebe00[_0x8c36('0x1c')],'include':_0x1ebe00[_0x8c36('0x19')]?_['map'](_0x1ebe00[_0x8c36('0x19')],function(_0x5e73ea){return{'model':db[_0x5e73ea[_0x8c36('0x1b')]],'as':_0x5e73ea['as'],'attributes':_0x5e73ea[_0x8c36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8c36('0xb')](function(_0x52c724){logger[_0x8c36('0x21')](_0x8c36('0x1e'),_0x517068);logger[_0x8c36('0xd')](_0x8c36('0x1e'),_0x517068,JSON['stringify'](_0x52c724));_0x58e546(_0x52c724);})['catch'](function(_0xe0c867){logger[_0x8c36('0x10')](_0x8c36('0x1e'),_0xe0c867[_0x8c36('0x12')],_0x517068);_0x533516(_0x5a8b33['error'](0x1f4,_0xe0c867[_0x8c36('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c935e28..6a80724 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 _0xdd93=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x18beac,_0x5cbcb2){var _0x592b90=function(_0x59598c){while(--_0x59598c){_0x18beac['push'](_0x18beac['shift']());}};_0x592b90(++_0x5cbcb2);}(_0xdd93,0xcd));var _0x3dd9=function(_0x5b3dcc,_0x1d052e){_0x5b3dcc=_0x5b3dcc-0x0;var _0x3c0a03=_0xdd93[_0x5b3dcc];return _0x3c0a03;};'use strict';var multer=require('multer');var util=require(_0x3dd9('0x0'));var path=require(_0x3dd9('0x1'));var timeout=require('connect-timeout');var express=require(_0x3dd9('0x2'));var router=express[_0x3dd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3dd9('0x4'));var interaction=require(_0x3dd9('0x5'));var config=require(_0x3dd9('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0x3dd9('0x7')]('/',auth[_0x3dd9('0x8')](),controller[_0x3dd9('0x9')]);router[_0x3dd9('0x7')](_0x3dd9('0xa'),auth['isAuthenticated'](),controller[_0x3dd9('0xb')]);router['get']('/:id/fields',auth[_0x3dd9('0x8')](),controller[_0x3dd9('0xc')]);router[_0x3dd9('0x7')](_0x3dd9('0xd'),auth[_0x3dd9('0x8')](),controller[_0x3dd9('0xe')]);router['get']('/:id/descriptions',auth[_0x3dd9('0x8')](),controller[_0x3dd9('0xf')]);router['post']('/',auth[_0x3dd9('0x8')](),controller['create']);router[_0x3dd9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3dd9('0x11')]);router[_0x3dd9('0x12')](_0x3dd9('0xa'),auth[_0x3dd9('0x8')](),controller[_0x3dd9('0x13')]);module[_0x3dd9('0x14')]=router; \ No newline at end of file +var _0x186e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','exports','multer','util'];(function(_0x4ebcb0,_0xc6b221){var _0x35e423=function(_0x2adc30){while(--_0x2adc30){_0x4ebcb0['push'](_0x4ebcb0['shift']());}};_0x35e423(++_0xc6b221);}(_0x186e,0x6c));var _0xe186=function(_0x3e63cd,_0x7e5793){_0x3e63cd=_0x3e63cd-0x0;var _0x21a363=_0x186e[_0x3e63cd];return _0x21a363;};'use strict';var multer=require(_0xe186('0x0'));var util=require(_0xe186('0x1'));var path=require('path');var timeout=require(_0xe186('0x2'));var express=require('express');var router=express[_0xe186('0x3')]();var fs_extra=require(_0xe186('0x4'));var auth=require(_0xe186('0x5'));var interaction=require(_0xe186('0x6'));var config=require(_0xe186('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xe186('0x8')]('/',auth['isAuthenticated'](),controller[_0xe186('0x9')]);router[_0xe186('0x8')](_0xe186('0xa'),auth[_0xe186('0xb')](),controller[_0xe186('0xc')]);router[_0xe186('0x8')](_0xe186('0xd'),auth['isAuthenticated'](),controller[_0xe186('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xe186('0xf')]);router[_0xe186('0x8')](_0xe186('0x10'),auth['isAuthenticated'](),controller[_0xe186('0x11')]);router[_0xe186('0x12')]('/',auth[_0xe186('0xb')](),controller['create']);router[_0xe186('0x13')](_0xe186('0xa'),auth[_0xe186('0xb')](),controller[_0xe186('0x14')]);router['delete'](_0xe186('0xa'),auth[_0xe186('0xb')](),controller['destroy']);module[_0xe186('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c641d1f..af42895 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 _0x993c=['exports','STRING'];(function(_0x47c169,_0xef525){var _0xeffa1e=function(_0x4cfbf3){while(--_0x4cfbf3){_0x47c169['push'](_0x47c169['shift']());}};_0xeffa1e(++_0xef525);}(_0x993c,0xfc));var _0xc993=function(_0x4c14c7,_0x5008b6){_0x4c14c7=_0x4c14c7-0x0;var _0x557f9a=_0x993c[_0x4c14c7];return _0x557f9a;};'use strict';var Sequelize=require('sequelize');module[_0xc993('0x0')]={'name':{'type':Sequelize[_0xc993('0x1')]},'description':{'type':Sequelize[_0xc993('0x1')]}}; \ No newline at end of file +var _0x3da7=['sequelize','exports','STRING'];(function(_0x5555fd,_0x31b11c){var _0x174889=function(_0x1afb16){while(--_0x1afb16){_0x5555fd['push'](_0x5555fd['shift']());}};_0x174889(++_0x31b11c);}(_0x3da7,0xc6));var _0x73da=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x3da7[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x73da('0x0'));module[_0x73da('0x1')]={'name':{'type':Sequelize[_0x73da('0x2')]},'description':{'type':Sequelize[_0x73da('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e7d72eb..2ee966e 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 _0x3a15=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','count','includeAll','findAll','catch','show','params','include','options','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3b9232,_0x268ee7){var _0x4eee34=function(_0x1a3e72){while(--_0x1a3e72){_0x3b9232['push'](_0x3b9232['shift']());}};_0x4eee34(++_0x268ee7);}(_0x3a15,0x155));var _0x53a1=function(_0x3f2e37,_0x49729a){_0x3f2e37=_0x3f2e37-0x0;var _0x1a468e=_0x3a15[_0x3f2e37];return _0x1a468e;};'use strict';var emlformat=require(_0x53a1('0x0'));var rimraf=require(_0x53a1('0x1'));var zipdir=require(_0x53a1('0x2'));var jsonpatch=require(_0x53a1('0x3'));var rp=require(_0x53a1('0x4'));var moment=require(_0x53a1('0x5'));var BPromise=require(_0x53a1('0x6'));var Mustache=require(_0x53a1('0x7'));var util=require(_0x53a1('0x8'));var path=require(_0x53a1('0x9'));var sox=require(_0x53a1('0xa'));var csv=require(_0x53a1('0xb'));var ejs=require(_0x53a1('0xc'));var fs=require('fs');var fs_extra=require(_0x53a1('0xd'));var _=require(_0x53a1('0xe'));var squel=require(_0x53a1('0xf'));var crypto=require(_0x53a1('0x10'));var jsforce=require(_0x53a1('0x11'));var deskjs=require(_0x53a1('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x53a1('0x13'));var Redis=require(_0x53a1('0x14'));var authService=require(_0x53a1('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x53a1('0x16'));var hardwareService=require(_0x53a1('0x17'));var logger=require(_0x53a1('0x18'))(_0x53a1('0x19'));var utils=require(_0x53a1('0x1a'));var config=require(_0x53a1('0x1b'));var licenseUtil=require(_0x53a1('0x1c'));var db=require(_0x53a1('0x1d'))['db'];function respondWithStatusCode(_0x20c3f1,_0x39f46d){_0x39f46d=_0x39f46d||0xcc;return function(_0x59b06d){if(_0x59b06d){return _0x20c3f1[_0x53a1('0x1e')](_0x39f46d);}return _0x20c3f1[_0x53a1('0x1f')](_0x39f46d)['end']();};}function respondWithResult(_0x2d5a47,_0x3f1435){_0x3f1435=_0x3f1435||0xc8;return function(_0x2215d8){if(_0x2215d8){return _0x2d5a47[_0x53a1('0x1f')](_0x3f1435)[_0x53a1('0x20')](_0x2215d8);}};}function respondWithFilteredResult(_0x486cd0,_0x510d2b){return function(_0x47007d){if(_0x47007d){var _0x198d42=typeof _0x510d2b[_0x53a1('0x21')]==='undefined'&&typeof _0x510d2b[_0x53a1('0x22')]===_0x53a1('0x23');var _0x2f8000=_0x47007d['count'];var _0x294f42=_0x198d42?0x0:_0x510d2b[_0x53a1('0x21')];var _0x62e5d4=_0x198d42?_0x47007d['count']:_0x510d2b[_0x53a1('0x21')]+_0x510d2b[_0x53a1('0x22')];var _0x259bc2;if(_0x62e5d4>=_0x2f8000){_0x62e5d4=_0x2f8000;_0x259bc2=0xc8;}else{_0x259bc2=0xce;}_0x486cd0[_0x53a1('0x1f')](_0x259bc2);return _0x486cd0[_0x53a1('0x24')](_0x53a1('0x25'),_0x294f42+'-'+_0x62e5d4+'/'+_0x2f8000)[_0x53a1('0x20')](_0x47007d);}return null;};}function patchUpdates(_0x1826f1){return function(_0x18ac55){try{jsonpatch['apply'](_0x18ac55,_0x1826f1,!![]);}catch(_0xce53f0){return BPromise[_0x53a1('0x26')](_0xce53f0);}return _0x18ac55[_0x53a1('0x27')]();};}function saveUpdates(_0x352fa2,_0x33d8da){return function(_0x7f9e20){if(_0x7f9e20){return _0x7f9e20[_0x53a1('0x28')](_0x352fa2)[_0x53a1('0x29')](function(_0x5430c3){return _0x5430c3;});}return null;};}function removeEntity(_0x328dff,_0x309663){return function(_0x23108a){if(_0x23108a){return _0x23108a[_0x53a1('0x2a')]()[_0x53a1('0x29')](function(){_0x328dff[_0x53a1('0x1f')](0xcc)[_0x53a1('0x2b')]();});}};}function handleEntityNotFound(_0x1df4b8,_0x5cd628){return function(_0x37a971){if(!_0x37a971){_0x1df4b8[_0x53a1('0x1e')](0x194);}return _0x37a971;};}function handleError(_0x4ae88f,_0x28769e){_0x28769e=_0x28769e||0x1f4;return function(_0x305406){logger[_0x53a1('0x2c')](_0x305406[_0x53a1('0x2d')]);if(_0x305406['name']){delete _0x305406[_0x53a1('0x2e')];}_0x4ae88f[_0x53a1('0x1f')](_0x28769e)[_0x53a1('0x2f')](_0x305406);};}exports[_0x53a1('0x30')]=function(_0x54afe1,_0x223dc1){var _0x46dd7f={},_0x383cfd={},_0x11dae4={'count':0x0,'rows':[]};var _0x284886=_[_0x53a1('0x31')](db[_0x53a1('0x32')][_0x53a1('0x33')],function(_0x281a16){return{'name':_0x281a16[_0x53a1('0x34')],'type':_0x281a16['type'][_0x53a1('0x35')]};});_0x383cfd[_0x53a1('0x36')]=_['map'](_0x284886,_0x53a1('0x2e'));_0x383cfd[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x54afe1[_0x53a1('0x37')]);_0x383cfd['filters']=_[_0x53a1('0x39')](_0x383cfd[_0x53a1('0x36')],_0x383cfd[_0x53a1('0x37')]);_0x46dd7f[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x383cfd[_0x53a1('0x36')],qs[_0x53a1('0x3b')](_0x54afe1[_0x53a1('0x37')]['fields']));_0x46dd7f[_0x53a1('0x3a')]=_0x46dd7f['attributes'][_0x53a1('0x3c')]?_0x46dd7f['attributes']:_0x383cfd[_0x53a1('0x36')];if(!_0x54afe1[_0x53a1('0x37')][_0x53a1('0x3d')](_0x53a1('0x3e'))){_0x46dd7f[_0x53a1('0x22')]=qs['limit'](_0x54afe1[_0x53a1('0x37')][_0x53a1('0x22')]);_0x46dd7f['offset']=qs['offset'](_0x54afe1[_0x53a1('0x37')]['offset']);}_0x46dd7f[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0x54afe1['query']['sort']);_0x46dd7f[_0x53a1('0x41')]=qs[_0x53a1('0x42')](_[_0x53a1('0x43')](_0x54afe1['query'],_0x383cfd[_0x53a1('0x42')]),_0x284886);if(_0x54afe1[_0x53a1('0x37')]['filter']){_0x46dd7f['where']=_['merge'](_0x46dd7f[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x284886,function(_0x3bc284){if(_0x3bc284[_0x53a1('0x44')]!==_0x53a1('0x45')){var _0x515606={};_0x515606[_0x3bc284[_0x53a1('0x2e')]]={'$like':'%'+_0x54afe1[_0x53a1('0x37')][_0x53a1('0x46')]+'%'};return _0x515606;}})});}_0x46dd7f=_[_0x53a1('0x47')]({},_0x46dd7f,_0x54afe1['options']);var _0x576ff0={'where':_0x46dd7f[_0x53a1('0x41')]};return db[_0x53a1('0x32')][_0x53a1('0x48')](_0x576ff0)[_0x53a1('0x29')](function(_0x58a909){_0x11dae4[_0x53a1('0x48')]=_0x58a909;if(_0x54afe1['query'][_0x53a1('0x49')]){_0x46dd7f['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x53a1('0x4a')](_0x46dd7f);})[_0x53a1('0x29')](function(_0x32c890){_0x11dae4['rows']=_0x32c890;return _0x11dae4;})[_0x53a1('0x29')](respondWithFilteredResult(_0x223dc1,_0x46dd7f))[_0x53a1('0x4b')](handleError(_0x223dc1,null));};exports[_0x53a1('0x4c')]=function(_0x21fc41,_0x487632){var _0x186279={'raw':![],'where':{'id':_0x21fc41[_0x53a1('0x4d')]['id']}},_0x2893ed={};_0x2893ed['model']=_[_0x53a1('0x38')](db[_0x53a1('0x32')][_0x53a1('0x33')]);_0x2893ed[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x21fc41['query']);_0x2893ed[_0x53a1('0x42')]=_[_0x53a1('0x39')](_0x2893ed[_0x53a1('0x36')],_0x2893ed['query']);_0x186279[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x2893ed[_0x53a1('0x36')],qs[_0x53a1('0x3b')](_0x21fc41['query'][_0x53a1('0x3b')]));_0x186279['attributes']=_0x186279['attributes'][_0x53a1('0x3c')]?_0x186279[_0x53a1('0x3a')]:_0x2893ed['model'];if(_0x21fc41['query'][_0x53a1('0x49')]){_0x186279[_0x53a1('0x4e')]=[{'all':!![]}];}_0x186279=_[_0x53a1('0x47')]({},_0x186279,_0x21fc41[_0x53a1('0x4f')]);return db[_0x53a1('0x32')][_0x53a1('0x50')](_0x186279)['then'](handleEntityNotFound(_0x487632,null))['then'](respondWithResult(_0x487632,null))[_0x53a1('0x4b')](handleError(_0x487632,null));};exports[_0x53a1('0x51')]=function(_0x297fde,_0x2509de){return db[_0x53a1('0x32')]['create'](_0x297fde[_0x53a1('0x52')],{})['then'](respondWithResult(_0x2509de,0xc9))[_0x53a1('0x4b')](handleError(_0x2509de,null));};exports[_0x53a1('0x28')]=function(_0x5a45f9,_0x125bbc){if(_0x5a45f9['body']['id']){delete _0x5a45f9[_0x53a1('0x52')]['id'];}return db[_0x53a1('0x32')][_0x53a1('0x50')]({'where':{'id':_0x5a45f9[_0x53a1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x125bbc,null))['then'](saveUpdates(_0x5a45f9[_0x53a1('0x52')],null))[_0x53a1('0x29')](respondWithResult(_0x125bbc,null))[_0x53a1('0x4b')](handleError(_0x125bbc,null));};exports['destroy']=function(_0x1bd590,_0x1c83db){return db[_0x53a1('0x32')][_0x53a1('0x50')]({'where':{'id':_0x1bd590['params']['id']}})[_0x53a1('0x29')](handleEntityNotFound(_0x1c83db,null))[_0x53a1('0x29')](removeEntity(_0x1c83db,null))[_0x53a1('0x4b')](handleError(_0x1c83db,null));};exports[_0x53a1('0x53')]=function(_0x5c6ff9,_0x295021,_0x4c7a64){var _0x11c028={};var _0x2eeb24={};var _0x1219be;var _0x3c9a25;return db[_0x53a1('0x32')][_0x53a1('0x54')]({'where':{'id':_0x5c6ff9[_0x53a1('0x4d')]['id']}})[_0x53a1('0x29')](handleEntityNotFound(_0x295021,null))[_0x53a1('0x29')](function(_0x2cdee8){if(_0x2cdee8){_0x1219be=_0x2cdee8;_0x2eeb24[_0x53a1('0x36')]=_[_0x53a1('0x38')](db[_0x53a1('0x55')][_0x53a1('0x33')]);_0x2eeb24[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x5c6ff9['query']);_0x2eeb24[_0x53a1('0x42')]=_[_0x53a1('0x39')](_0x2eeb24['model'],_0x2eeb24[_0x53a1('0x37')]);_0x11c028[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x2eeb24[_0x53a1('0x36')],qs['fields'](_0x5c6ff9['query'][_0x53a1('0x3b')]));_0x11c028[_0x53a1('0x3a')]=_0x11c028[_0x53a1('0x3a')][_0x53a1('0x3c')]?_0x11c028[_0x53a1('0x3a')]:_0x2eeb24[_0x53a1('0x36')];_0x11c028[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0x5c6ff9[_0x53a1('0x37')][_0x53a1('0x40')]);_0x11c028[_0x53a1('0x41')]=qs[_0x53a1('0x42')](_[_0x53a1('0x43')](_0x5c6ff9[_0x53a1('0x37')],_0x2eeb24[_0x53a1('0x42')]));if(_0x5c6ff9['query'][_0x53a1('0x46')]){_0x11c028['where']=_[_0x53a1('0x47')](_0x11c028[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x11c028[_0x53a1('0x3a')],function(_0x56f2ab){var _0x286b8b={};_0x286b8b[_0x56f2ab]={'$like':'%'+_0x5c6ff9['query']['filter']+'%'};return _0x286b8b;})});}_0x11c028=_[_0x53a1('0x47')]({},_0x11c028,_0x5c6ff9[_0x53a1('0x4f')]);return _0x1219be[_0x53a1('0x53')](_0x11c028);}})[_0x53a1('0x29')](function(_0x24c833){if(_0x24c833){_0x3c9a25=_0x24c833[_0x53a1('0x3c')];if(!_0x5c6ff9[_0x53a1('0x37')]['hasOwnProperty'](_0x53a1('0x3e'))){_0x11c028[_0x53a1('0x22')]=qs[_0x53a1('0x22')](_0x5c6ff9[_0x53a1('0x37')]['limit']);_0x11c028[_0x53a1('0x21')]=qs[_0x53a1('0x21')](_0x5c6ff9[_0x53a1('0x37')]['offset']);}return _0x1219be[_0x53a1('0x53')](_0x11c028);}})[_0x53a1('0x29')](function(_0x402af1){if(_0x402af1){return _0x402af1?{'count':_0x3c9a25,'rows':_0x402af1}:null;}})[_0x53a1('0x29')](respondWithResult(_0x295021,null))[_0x53a1('0x4b')](handleError(_0x295021,null));};exports[_0x53a1('0x56')]=function(_0x5d382b,_0x48ca05,_0x2bcd69){var _0x1a3915={};var _0x504608={};var _0xfb1e71;var _0x2ca648;return db[_0x53a1('0x32')][_0x53a1('0x54')]({'where':{'id':_0x5d382b[_0x53a1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x48ca05,null))[_0x53a1('0x29')](function(_0x229ad3){if(_0x229ad3){_0xfb1e71=_0x229ad3;_0x504608[_0x53a1('0x36')]=_[_0x53a1('0x38')](db[_0x53a1('0x55')][_0x53a1('0x33')]);_0x504608[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0x5d382b[_0x53a1('0x37')]);_0x504608[_0x53a1('0x42')]=_[_0x53a1('0x39')](_0x504608[_0x53a1('0x36')],_0x504608[_0x53a1('0x37')]);_0x1a3915[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x504608[_0x53a1('0x36')],qs['fields'](_0x5d382b['query']['fields']));_0x1a3915[_0x53a1('0x3a')]=_0x1a3915['attributes'][_0x53a1('0x3c')]?_0x1a3915[_0x53a1('0x3a')]:_0x504608[_0x53a1('0x36')];_0x1a3915[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0x5d382b[_0x53a1('0x37')][_0x53a1('0x40')]);_0x1a3915[_0x53a1('0x41')]=qs[_0x53a1('0x42')](_[_0x53a1('0x43')](_0x5d382b[_0x53a1('0x37')],_0x504608['filters']));if(_0x5d382b[_0x53a1('0x37')][_0x53a1('0x46')]){_0x1a3915[_0x53a1('0x41')]=_['merge'](_0x1a3915[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x1a3915[_0x53a1('0x3a')],function(_0x70a6c9){var _0x55a135={};_0x55a135[_0x70a6c9]={'$like':'%'+_0x5d382b[_0x53a1('0x37')][_0x53a1('0x46')]+'%'};return _0x55a135;})});}_0x1a3915=_[_0x53a1('0x47')]({},_0x1a3915,_0x5d382b[_0x53a1('0x4f')]);return _0xfb1e71[_0x53a1('0x56')](_0x1a3915);}})[_0x53a1('0x29')](function(_0x1097bc){if(_0x1097bc){_0x2ca648=_0x1097bc[_0x53a1('0x3c')];if(!_0x5d382b['query']['hasOwnProperty'](_0x53a1('0x3e'))){_0x1a3915[_0x53a1('0x22')]=qs[_0x53a1('0x22')](_0x5d382b[_0x53a1('0x37')][_0x53a1('0x22')]);_0x1a3915[_0x53a1('0x21')]=qs[_0x53a1('0x21')](_0x5d382b[_0x53a1('0x37')]['offset']);}return _0xfb1e71[_0x53a1('0x56')](_0x1a3915);}})[_0x53a1('0x29')](function(_0x598df6){if(_0x598df6){return _0x598df6?{'count':_0x2ca648,'rows':_0x598df6}:null;}})[_0x53a1('0x29')](respondWithResult(_0x48ca05,null))['catch'](handleError(_0x48ca05,null));};exports[_0x53a1('0x57')]=function(_0xf93dea,_0xc7c769,_0x546088){var _0x53639d={};var _0x552381={};var _0x3519be;var _0x128266;return db[_0x53a1('0x32')]['findOne']({'where':{'id':_0xf93dea[_0x53a1('0x4d')]['id']}})[_0x53a1('0x29')](handleEntityNotFound(_0xc7c769,null))[_0x53a1('0x29')](function(_0x594b5a){if(_0x594b5a){_0x3519be=_0x594b5a;_0x552381['model']=_[_0x53a1('0x38')](db[_0x53a1('0x55')]['rawAttributes']);_0x552381[_0x53a1('0x37')]=_[_0x53a1('0x38')](_0xf93dea['query']);_0x552381['filters']=_['intersection'](_0x552381[_0x53a1('0x36')],_0x552381[_0x53a1('0x37')]);_0x53639d[_0x53a1('0x3a')]=_[_0x53a1('0x39')](_0x552381[_0x53a1('0x36')],qs[_0x53a1('0x3b')](_0xf93dea[_0x53a1('0x37')][_0x53a1('0x3b')]));_0x53639d[_0x53a1('0x3a')]=_0x53639d[_0x53a1('0x3a')][_0x53a1('0x3c')]?_0x53639d[_0x53a1('0x3a')]:_0x552381['model'];_0x53639d[_0x53a1('0x3f')]=qs[_0x53a1('0x40')](_0xf93dea[_0x53a1('0x37')]['sort']);_0x53639d['where']=qs[_0x53a1('0x42')](_['pick'](_0xf93dea['query'],_0x552381['filters']));if(_0xf93dea[_0x53a1('0x37')][_0x53a1('0x46')]){_0x53639d['where']=_[_0x53a1('0x47')](_0x53639d[_0x53a1('0x41')],{'$or':_[_0x53a1('0x31')](_0x53639d[_0x53a1('0x3a')],function(_0x4e1d02){var _0x2c4de7={};_0x2c4de7[_0x4e1d02]={'$like':'%'+_0xf93dea[_0x53a1('0x37')][_0x53a1('0x46')]+'%'};return _0x2c4de7;})});}_0x53639d=_[_0x53a1('0x47')]({},_0x53639d,_0xf93dea['options']);return _0x3519be[_0x53a1('0x57')](_0x53639d);}})['then'](function(_0x47ff1f){if(_0x47ff1f){_0x128266=_0x47ff1f[_0x53a1('0x3c')];if(!_0xf93dea[_0x53a1('0x37')]['hasOwnProperty'](_0x53a1('0x3e'))){_0x53639d[_0x53a1('0x22')]=qs[_0x53a1('0x22')](_0xf93dea[_0x53a1('0x37')][_0x53a1('0x22')]);_0x53639d['offset']=qs[_0x53a1('0x21')](_0xf93dea[_0x53a1('0x37')][_0x53a1('0x21')]);}return _0x3519be[_0x53a1('0x57')](_0x53639d);}})[_0x53a1('0x29')](function(_0x9ea25e){if(_0x9ea25e){return _0x9ea25e?{'count':_0x128266,'rows':_0x9ea25e}:null;}})[_0x53a1('0x29')](respondWithResult(_0xc7c769,null))[_0x53a1('0x4b')](handleError(_0xc7c769,null));}; \ No newline at end of file +var _0xe0a6=['body','getFields','merge','hasOwnProperty','ServicenowField','getSubjects','length','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','apply','reject','update','then','destroy','end','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0a6,0x185));var _0x6e0a=function(_0x475272,_0x351425){_0x475272=_0x475272-0x0;var _0x2a17ec=_0xe0a6[_0x475272];return _0x2a17ec;};'use strict';var emlformat=require(_0x6e0a('0x0'));var rimraf=require(_0x6e0a('0x1'));var zipdir=require(_0x6e0a('0x2'));var jsonpatch=require(_0x6e0a('0x3'));var rp=require('request-promise');var moment=require(_0x6e0a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6e0a('0x5'));var util=require(_0x6e0a('0x6'));var path=require(_0x6e0a('0x7'));var sox=require(_0x6e0a('0x8'));var csv=require(_0x6e0a('0x9'));var ejs=require(_0x6e0a('0xa'));var fs=require('fs');var fs_extra=require(_0x6e0a('0xb'));var _=require(_0x6e0a('0xc'));var squel=require(_0x6e0a('0xd'));var crypto=require(_0x6e0a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6e0a('0xf'));var toCsv=require(_0x6e0a('0x9'));var querystring=require(_0x6e0a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e0a('0x11'));var qs=require(_0x6e0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e0a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6e0a('0x14'));var config=require(_0x6e0a('0x15'));var licenseUtil=require(_0x6e0a('0x16'));var db=require(_0x6e0a('0x17'))['db'];function respondWithStatusCode(_0x233a29,_0x4db555){_0x4db555=_0x4db555||0xcc;return function(_0x3a4997){if(_0x3a4997){return _0x233a29[_0x6e0a('0x18')](_0x4db555);}return _0x233a29[_0x6e0a('0x19')](_0x4db555)['end']();};}function respondWithResult(_0x62804d,_0x47433d){_0x47433d=_0x47433d||0xc8;return function(_0x800bcd){if(_0x800bcd){return _0x62804d[_0x6e0a('0x19')](_0x47433d)['json'](_0x800bcd);}};}function respondWithFilteredResult(_0xf3c3f9,_0x571217){return function(_0x4198cd){if(_0x4198cd){var _0x33e159=typeof _0x571217[_0x6e0a('0x1a')]==='undefined'&&typeof _0x571217[_0x6e0a('0x1b')]==='undefined';var _0x448b6d=_0x4198cd[_0x6e0a('0x1c')];var _0x4a698c=_0x33e159?0x0:_0x571217['offset'];var _0x128c70=_0x33e159?_0x4198cd[_0x6e0a('0x1c')]:_0x571217[_0x6e0a('0x1a')]+_0x571217[_0x6e0a('0x1b')];var _0x3b45dd;if(_0x128c70>=_0x448b6d){_0x128c70=_0x448b6d;_0x3b45dd=0xc8;}else{_0x3b45dd=0xce;}_0xf3c3f9[_0x6e0a('0x19')](_0x3b45dd);return _0xf3c3f9[_0x6e0a('0x1d')]('Content-Range',_0x4a698c+'-'+_0x128c70+'/'+_0x448b6d)['json'](_0x4198cd);}return null;};}function patchUpdates(_0x3cfcbf){return function(_0xea80d5){try{jsonpatch[_0x6e0a('0x1e')](_0xea80d5,_0x3cfcbf,!![]);}catch(_0x29af0a){return BPromise[_0x6e0a('0x1f')](_0x29af0a);}return _0xea80d5['save']();};}function saveUpdates(_0x18dd30,_0x183bda){return function(_0x2fb7f8){if(_0x2fb7f8){return _0x2fb7f8[_0x6e0a('0x20')](_0x18dd30)[_0x6e0a('0x21')](function(_0x163b43){return _0x163b43;});}return null;};}function removeEntity(_0x45b1cd,_0x4203f0){return function(_0x27eccd){if(_0x27eccd){return _0x27eccd[_0x6e0a('0x22')]()[_0x6e0a('0x21')](function(){_0x45b1cd[_0x6e0a('0x19')](0xcc)[_0x6e0a('0x23')]();});}};}function handleEntityNotFound(_0x13d8d4,_0x26ae4c){return function(_0x109f46){if(!_0x109f46){_0x13d8d4[_0x6e0a('0x18')](0x194);}return _0x109f46;};}function handleError(_0x313f21,_0xd69960){_0xd69960=_0xd69960||0x1f4;return function(_0x240da9){logger['error'](_0x240da9['stack']);if(_0x240da9[_0x6e0a('0x24')]){delete _0x240da9[_0x6e0a('0x24')];}_0x313f21[_0x6e0a('0x19')](_0xd69960)[_0x6e0a('0x25')](_0x240da9);};}exports[_0x6e0a('0x26')]=function(_0x18b330,_0x4e2279){var _0x465f5c={},_0x58614={},_0x3be8a5={'count':0x0,'rows':[]};var _0x5461b0=_['map'](db[_0x6e0a('0x27')][_0x6e0a('0x28')],function(_0x5a08e9){return{'name':_0x5a08e9[_0x6e0a('0x29')],'type':_0x5a08e9['type']['key']};});_0x58614[_0x6e0a('0x2a')]=_[_0x6e0a('0x2b')](_0x5461b0,_0x6e0a('0x24'));_0x58614[_0x6e0a('0x2c')]=_[_0x6e0a('0x2d')](_0x18b330[_0x6e0a('0x2c')]);_0x58614['filters']=_[_0x6e0a('0x2e')](_0x58614['model'],_0x58614[_0x6e0a('0x2c')]);_0x465f5c[_0x6e0a('0x2f')]=_['intersection'](_0x58614['model'],qs['fields'](_0x18b330['query'][_0x6e0a('0x30')]));_0x465f5c[_0x6e0a('0x2f')]=_0x465f5c[_0x6e0a('0x2f')]['length']?_0x465f5c[_0x6e0a('0x2f')]:_0x58614['model'];if(!_0x18b330[_0x6e0a('0x2c')]['hasOwnProperty'](_0x6e0a('0x31'))){_0x465f5c[_0x6e0a('0x1b')]=qs[_0x6e0a('0x1b')](_0x18b330[_0x6e0a('0x2c')][_0x6e0a('0x1b')]);_0x465f5c[_0x6e0a('0x1a')]=qs[_0x6e0a('0x1a')](_0x18b330[_0x6e0a('0x2c')]['offset']);}_0x465f5c[_0x6e0a('0x32')]=qs['sort'](_0x18b330[_0x6e0a('0x2c')][_0x6e0a('0x33')]);_0x465f5c[_0x6e0a('0x34')]=qs[_0x6e0a('0x35')](_[_0x6e0a('0x36')](_0x18b330[_0x6e0a('0x2c')],_0x58614[_0x6e0a('0x35')]),_0x5461b0);if(_0x18b330[_0x6e0a('0x2c')][_0x6e0a('0x37')]){_0x465f5c['where']=_['merge'](_0x465f5c[_0x6e0a('0x34')],{'$or':_['map'](_0x5461b0,function(_0x4aeb99){if(_0x4aeb99['type']!==_0x6e0a('0x38')){var _0x27fd65={};_0x27fd65[_0x4aeb99['name']]={'$like':'%'+_0x18b330[_0x6e0a('0x2c')][_0x6e0a('0x37')]+'%'};return _0x27fd65;}})});}_0x465f5c=_['merge']({},_0x465f5c,_0x18b330['options']);var _0x3cf655={'where':_0x465f5c[_0x6e0a('0x34')]};return db[_0x6e0a('0x27')]['count'](_0x3cf655)[_0x6e0a('0x21')](function(_0x9ca949){_0x3be8a5[_0x6e0a('0x1c')]=_0x9ca949;if(_0x18b330[_0x6e0a('0x2c')][_0x6e0a('0x39')]){_0x465f5c[_0x6e0a('0x3a')]=[{'all':!![]}];}return db[_0x6e0a('0x27')][_0x6e0a('0x3b')](_0x465f5c);})[_0x6e0a('0x21')](function(_0x36ebfa){_0x3be8a5[_0x6e0a('0x3c')]=_0x36ebfa;return _0x3be8a5;})[_0x6e0a('0x21')](respondWithFilteredResult(_0x4e2279,_0x465f5c))[_0x6e0a('0x3d')](handleError(_0x4e2279,null));};exports[_0x6e0a('0x3e')]=function(_0x2b5a69,_0x4df28d){var _0x16fd16={'raw':![],'where':{'id':_0x2b5a69[_0x6e0a('0x3f')]['id']}},_0x249100={};_0x249100['model']=_[_0x6e0a('0x2d')](db['ServicenowConfiguration']['rawAttributes']);_0x249100[_0x6e0a('0x2c')]=_['keys'](_0x2b5a69[_0x6e0a('0x2c')]);_0x249100[_0x6e0a('0x35')]=_[_0x6e0a('0x2e')](_0x249100[_0x6e0a('0x2a')],_0x249100[_0x6e0a('0x2c')]);_0x16fd16[_0x6e0a('0x2f')]=_[_0x6e0a('0x2e')](_0x249100['model'],qs[_0x6e0a('0x30')](_0x2b5a69[_0x6e0a('0x2c')][_0x6e0a('0x30')]));_0x16fd16[_0x6e0a('0x2f')]=_0x16fd16[_0x6e0a('0x2f')]['length']?_0x16fd16[_0x6e0a('0x2f')]:_0x249100['model'];if(_0x2b5a69[_0x6e0a('0x2c')][_0x6e0a('0x39')]){_0x16fd16['include']=[{'all':!![]}];}_0x16fd16=_['merge']({},_0x16fd16,_0x2b5a69[_0x6e0a('0x40')]);return db[_0x6e0a('0x27')][_0x6e0a('0x41')](_0x16fd16)['then'](handleEntityNotFound(_0x4df28d,null))[_0x6e0a('0x21')](respondWithResult(_0x4df28d,null))[_0x6e0a('0x3d')](handleError(_0x4df28d,null));};exports[_0x6e0a('0x42')]=function(_0x44f52f,_0x57043b){return db[_0x6e0a('0x27')][_0x6e0a('0x42')](_0x44f52f[_0x6e0a('0x43')],{})[_0x6e0a('0x21')](respondWithResult(_0x57043b,0xc9))[_0x6e0a('0x3d')](handleError(_0x57043b,null));};exports['update']=function(_0x3989bb,_0x10993c){if(_0x3989bb['body']['id']){delete _0x3989bb[_0x6e0a('0x43')]['id'];}return db['ServicenowConfiguration'][_0x6e0a('0x41')]({'where':{'id':_0x3989bb[_0x6e0a('0x3f')]['id']}})[_0x6e0a('0x21')](handleEntityNotFound(_0x10993c,null))[_0x6e0a('0x21')](saveUpdates(_0x3989bb['body'],null))['then'](respondWithResult(_0x10993c,null))['catch'](handleError(_0x10993c,null));};exports[_0x6e0a('0x22')]=function(_0x268848,_0xa1c047){return db[_0x6e0a('0x27')][_0x6e0a('0x41')]({'where':{'id':_0x268848[_0x6e0a('0x3f')]['id']}})[_0x6e0a('0x21')](handleEntityNotFound(_0xa1c047,null))['then'](removeEntity(_0xa1c047,null))[_0x6e0a('0x3d')](handleError(_0xa1c047,null));};exports[_0x6e0a('0x44')]=function(_0x327f5d,_0x46ae53,_0x325292){var _0x50d9c4={};var _0x327127={};var _0x3a66ac;var _0xbe7e61;return db[_0x6e0a('0x27')]['findOne']({'where':{'id':_0x327f5d[_0x6e0a('0x3f')]['id']}})[_0x6e0a('0x21')](handleEntityNotFound(_0x46ae53,null))['then'](function(_0x138a6a){if(_0x138a6a){_0x3a66ac=_0x138a6a;_0x327127['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x327127[_0x6e0a('0x2c')]=_['keys'](_0x327f5d[_0x6e0a('0x2c')]);_0x327127['filters']=_[_0x6e0a('0x2e')](_0x327127[_0x6e0a('0x2a')],_0x327127[_0x6e0a('0x2c')]);_0x50d9c4[_0x6e0a('0x2f')]=_[_0x6e0a('0x2e')](_0x327127[_0x6e0a('0x2a')],qs[_0x6e0a('0x30')](_0x327f5d['query'][_0x6e0a('0x30')]));_0x50d9c4[_0x6e0a('0x2f')]=_0x50d9c4[_0x6e0a('0x2f')]['length']?_0x50d9c4[_0x6e0a('0x2f')]:_0x327127[_0x6e0a('0x2a')];_0x50d9c4['order']=qs['sort'](_0x327f5d[_0x6e0a('0x2c')][_0x6e0a('0x33')]);_0x50d9c4[_0x6e0a('0x34')]=qs[_0x6e0a('0x35')](_[_0x6e0a('0x36')](_0x327f5d[_0x6e0a('0x2c')],_0x327127['filters']));if(_0x327f5d['query'][_0x6e0a('0x37')]){_0x50d9c4[_0x6e0a('0x34')]=_['merge'](_0x50d9c4[_0x6e0a('0x34')],{'$or':_[_0x6e0a('0x2b')](_0x50d9c4[_0x6e0a('0x2f')],function(_0x30e4b1){var _0x4b6c12={};_0x4b6c12[_0x30e4b1]={'$like':'%'+_0x327f5d[_0x6e0a('0x2c')][_0x6e0a('0x37')]+'%'};return _0x4b6c12;})});}_0x50d9c4=_[_0x6e0a('0x45')]({},_0x50d9c4,_0x327f5d[_0x6e0a('0x40')]);return _0x3a66ac[_0x6e0a('0x44')](_0x50d9c4);}})[_0x6e0a('0x21')](function(_0x405743){if(_0x405743){_0xbe7e61=_0x405743['length'];if(!_0x327f5d[_0x6e0a('0x2c')][_0x6e0a('0x46')](_0x6e0a('0x31'))){_0x50d9c4['limit']=qs[_0x6e0a('0x1b')](_0x327f5d['query']['limit']);_0x50d9c4[_0x6e0a('0x1a')]=qs[_0x6e0a('0x1a')](_0x327f5d[_0x6e0a('0x2c')][_0x6e0a('0x1a')]);}return _0x3a66ac[_0x6e0a('0x44')](_0x50d9c4);}})[_0x6e0a('0x21')](function(_0x47f866){if(_0x47f866){return _0x47f866?{'count':_0xbe7e61,'rows':_0x47f866}:null;}})['then'](respondWithResult(_0x46ae53,null))[_0x6e0a('0x3d')](handleError(_0x46ae53,null));};exports['getSubjects']=function(_0x3bdd6a,_0x1d6eec,_0x1b1cbf){var _0x61ed47={};var _0x4e556e={};var _0x1455c6;var _0x3b66ea;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3bdd6a[_0x6e0a('0x3f')]['id']}})[_0x6e0a('0x21')](handleEntityNotFound(_0x1d6eec,null))[_0x6e0a('0x21')](function(_0x331d6e){if(_0x331d6e){_0x1455c6=_0x331d6e;_0x4e556e[_0x6e0a('0x2a')]=_[_0x6e0a('0x2d')](db[_0x6e0a('0x47')][_0x6e0a('0x28')]);_0x4e556e[_0x6e0a('0x2c')]=_['keys'](_0x3bdd6a[_0x6e0a('0x2c')]);_0x4e556e[_0x6e0a('0x35')]=_[_0x6e0a('0x2e')](_0x4e556e[_0x6e0a('0x2a')],_0x4e556e[_0x6e0a('0x2c')]);_0x61ed47[_0x6e0a('0x2f')]=_['intersection'](_0x4e556e[_0x6e0a('0x2a')],qs['fields'](_0x3bdd6a[_0x6e0a('0x2c')][_0x6e0a('0x30')]));_0x61ed47[_0x6e0a('0x2f')]=_0x61ed47[_0x6e0a('0x2f')]['length']?_0x61ed47[_0x6e0a('0x2f')]:_0x4e556e['model'];_0x61ed47[_0x6e0a('0x32')]=qs[_0x6e0a('0x33')](_0x3bdd6a['query']['sort']);_0x61ed47[_0x6e0a('0x34')]=qs[_0x6e0a('0x35')](_[_0x6e0a('0x36')](_0x3bdd6a[_0x6e0a('0x2c')],_0x4e556e[_0x6e0a('0x35')]));if(_0x3bdd6a['query']['filter']){_0x61ed47[_0x6e0a('0x34')]=_['merge'](_0x61ed47[_0x6e0a('0x34')],{'$or':_[_0x6e0a('0x2b')](_0x61ed47[_0x6e0a('0x2f')],function(_0x1a16c5){var _0x15f6e9={};_0x15f6e9[_0x1a16c5]={'$like':'%'+_0x3bdd6a['query'][_0x6e0a('0x37')]+'%'};return _0x15f6e9;})});}_0x61ed47=_[_0x6e0a('0x45')]({},_0x61ed47,_0x3bdd6a[_0x6e0a('0x40')]);return _0x1455c6[_0x6e0a('0x48')](_0x61ed47);}})[_0x6e0a('0x21')](function(_0x2184aa){if(_0x2184aa){_0x3b66ea=_0x2184aa[_0x6e0a('0x49')];if(!_0x3bdd6a[_0x6e0a('0x2c')][_0x6e0a('0x46')](_0x6e0a('0x31'))){_0x61ed47[_0x6e0a('0x1b')]=qs[_0x6e0a('0x1b')](_0x3bdd6a[_0x6e0a('0x2c')][_0x6e0a('0x1b')]);_0x61ed47[_0x6e0a('0x1a')]=qs[_0x6e0a('0x1a')](_0x3bdd6a[_0x6e0a('0x2c')]['offset']);}return _0x1455c6[_0x6e0a('0x48')](_0x61ed47);}})[_0x6e0a('0x21')](function(_0x49113b){if(_0x49113b){return _0x49113b?{'count':_0x3b66ea,'rows':_0x49113b}:null;}})['then'](respondWithResult(_0x1d6eec,null))[_0x6e0a('0x3d')](handleError(_0x1d6eec,null));};exports['getDescriptions']=function(_0x3f311a,_0x5de40d,_0xa35c84){var _0x4b1622={};var _0xd25a1={};var _0x20ce91;var _0x2de981;return db['ServicenowConfiguration'][_0x6e0a('0x4a')]({'where':{'id':_0x3f311a[_0x6e0a('0x3f')]['id']}})[_0x6e0a('0x21')](handleEntityNotFound(_0x5de40d,null))[_0x6e0a('0x21')](function(_0x2c1c7c){if(_0x2c1c7c){_0x20ce91=_0x2c1c7c;_0xd25a1[_0x6e0a('0x2a')]=_['keys'](db[_0x6e0a('0x47')][_0x6e0a('0x28')]);_0xd25a1[_0x6e0a('0x2c')]=_['keys'](_0x3f311a[_0x6e0a('0x2c')]);_0xd25a1['filters']=_[_0x6e0a('0x2e')](_0xd25a1['model'],_0xd25a1[_0x6e0a('0x2c')]);_0x4b1622[_0x6e0a('0x2f')]=_['intersection'](_0xd25a1[_0x6e0a('0x2a')],qs['fields'](_0x3f311a['query'][_0x6e0a('0x30')]));_0x4b1622[_0x6e0a('0x2f')]=_0x4b1622[_0x6e0a('0x2f')]['length']?_0x4b1622[_0x6e0a('0x2f')]:_0xd25a1['model'];_0x4b1622[_0x6e0a('0x32')]=qs['sort'](_0x3f311a['query']['sort']);_0x4b1622[_0x6e0a('0x34')]=qs[_0x6e0a('0x35')](_[_0x6e0a('0x36')](_0x3f311a[_0x6e0a('0x2c')],_0xd25a1['filters']));if(_0x3f311a[_0x6e0a('0x2c')][_0x6e0a('0x37')]){_0x4b1622[_0x6e0a('0x34')]=_[_0x6e0a('0x45')](_0x4b1622['where'],{'$or':_[_0x6e0a('0x2b')](_0x4b1622['attributes'],function(_0x6833e0){var _0x4a3b48={};_0x4a3b48[_0x6833e0]={'$like':'%'+_0x3f311a[_0x6e0a('0x2c')]['filter']+'%'};return _0x4a3b48;})});}_0x4b1622=_['merge']({},_0x4b1622,_0x3f311a['options']);return _0x20ce91['getDescriptions'](_0x4b1622);}})[_0x6e0a('0x21')](function(_0x3d3ed8){if(_0x3d3ed8){_0x2de981=_0x3d3ed8[_0x6e0a('0x49')];if(!_0x3f311a[_0x6e0a('0x2c')][_0x6e0a('0x46')](_0x6e0a('0x31'))){_0x4b1622['limit']=qs[_0x6e0a('0x1b')](_0x3f311a[_0x6e0a('0x2c')]['limit']);_0x4b1622[_0x6e0a('0x1a')]=qs[_0x6e0a('0x1a')](_0x3f311a[_0x6e0a('0x2c')][_0x6e0a('0x1a')]);}return _0x20ce91[_0x6e0a('0x4b')](_0x4b1622);}})[_0x6e0a('0x21')](function(_0x48e3ea){if(_0x48e3ea){return _0x48e3ea?{'count':_0x2de981,'rows':_0x48e3ea}:null;}})[_0x6e0a('0x21')](respondWithResult(_0x5de40d,null))[_0x6e0a('0x3d')](handleError(_0x5de40d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index d08a8df..30e7d6f 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 _0x19c3=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x48961c,_0x280e9d){var _0x1d895d=function(_0x248ffa){while(--_0x248ffa){_0x48961c['push'](_0x48961c['shift']());}};_0x1d895d(++_0x280e9d);}(_0x19c3,0xf9));var _0x319c=function(_0x5e7572,_0x38b2c6){_0x5e7572=_0x5e7572-0x0;var _0x199427=_0x19c3[_0x5e7572];return _0x199427;};'use strict';var _=require(_0x319c('0x0'));var util=require('util');var logger=require(_0x319c('0x1'))(_0x319c('0x2'));var moment=require('moment');var BPromise=require(_0x319c('0x3'));var rp=require(_0x319c('0x4'));var fs=require('fs');var path=require(_0x319c('0x5'));var rimraf=require(_0x319c('0x6'));var config=require(_0x319c('0x7'));var attributes=require(_0x319c('0x8'));module['exports']=function(_0x20f77e,_0x53a1de){return _0x20f77e[_0x319c('0x9')](_0x319c('0xa'),attributes,{'tableName':_0x319c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87d9=['./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x11f7f1,_0x589933){var _0x13ebfa=function(_0x231d3e){while(--_0x231d3e){_0x11f7f1['push'](_0x11f7f1['shift']());}};_0x13ebfa(++_0x589933);}(_0x87d9,0x143));var _0x987d=function(_0x17749b,_0x4b4e3e){_0x17749b=_0x17749b-0x0;var _0x37ad41=_0x87d9[_0x17749b];return _0x37ad41;};'use strict';var _=require(_0x987d('0x0'));var util=require('util');var logger=require(_0x987d('0x1'))(_0x987d('0x2'));var moment=require(_0x987d('0x3'));var BPromise=require(_0x987d('0x4'));var rp=require(_0x987d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x987d('0x6'));var config=require('../../config/environment');var attributes=require(_0x987d('0x7'));module[_0x987d('0x8')]=function(_0x4b7afc,_0x2abb89){return _0x4b7afc[_0x987d('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x987d('0xa'),'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 7f93ec5..e3c651c 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 _0x7b84=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7b84,0x167));var _0x47b8=function(_0xe2eb40,_0x141a90){_0xe2eb40=_0xe2eb40-0x0;var _0xe84acc=_0x7b84[_0xe2eb40];return _0xe84acc;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47b8('0x3'));var db=require(_0x47b8('0x4'))['db'];var utils=require(_0x47b8('0x5'));var logger=require(_0x47b8('0x6'))(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var jayson=require(_0x47b8('0x9'));var client=jayson[_0x47b8('0xa')][_0x47b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30c35b,_0x81b22f,_0x1ae3b6){return new BPromise(function(_0x129a65,_0x6ad89){return client[_0x47b8('0xc')](_0x30c35b,_0x1ae3b6)[_0x47b8('0xd')](function(_0x46267c){logger[_0x47b8('0xe')](_0x47b8('0xf'),_0x81b22f,'request\x20sent');logger['debug'](_0x47b8('0x10'),_0x81b22f,_0x47b8('0x11'),JSON[_0x47b8('0x12')](_0x46267c));if(_0x46267c[_0x47b8('0x13')]){if(_0x46267c['error'][_0x47b8('0x14')]===0x1f4){logger[_0x47b8('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x81b22f,_0x46267c[_0x47b8('0x13')][_0x47b8('0x15')]);return _0x6ad89(_0x46267c[_0x47b8('0x13')][_0x47b8('0x15')]);}logger[_0x47b8('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x81b22f,_0x46267c['error'][_0x47b8('0x15')]);return _0x129a65(_0x46267c['error'][_0x47b8('0x15')]);}else{logger[_0x47b8('0xe')](_0x47b8('0xf'),_0x81b22f,_0x47b8('0x11'));_0x129a65(_0x46267c[_0x47b8('0x16')][_0x47b8('0x15')]);}})[_0x47b8('0x17')](function(_0x35bb3a){logger[_0x47b8('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x81b22f,_0x35bb3a);_0x6ad89(_0x35bb3a);});});} \ No newline at end of file +var _0x5261=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x3d0944,_0x5b3856){var _0x58cc78=function(_0x226203){while(--_0x226203){_0x3d0944['push'](_0x3d0944['shift']());}};_0x58cc78(++_0x5b3856);}(_0x5261,0x164));var _0x1526=function(_0x19b968,_0x3c94a4){_0x19b968=_0x19b968-0x0;var _0x2ad097=_0x5261[_0x19b968];return _0x2ad097;};'use strict';var _=require(_0x1526('0x0'));var util=require(_0x1526('0x1'));var moment=require(_0x1526('0x2'));var BPromise=require(_0x1526('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1526('0x4'))['db'];var utils=require(_0x1526('0x5'));var logger=require(_0x1526('0x6'))(_0x1526('0x7'));var config=require(_0x1526('0x8'));var jayson=require(_0x1526('0x9'));var client=jayson['client'][_0x1526('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d830,_0x46bf36,_0x584a37){return new BPromise(function(_0x1d768f,_0x4fc838){return client[_0x1526('0xb')](_0x16d830,_0x584a37)[_0x1526('0xc')](function(_0x36e8b2){logger['info'](_0x1526('0xd'),_0x46bf36,_0x1526('0xe'));logger[_0x1526('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x46bf36,_0x1526('0xe'),JSON['stringify'](_0x36e8b2));if(_0x36e8b2[_0x1526('0x10')]){if(_0x36e8b2['error'][_0x1526('0x11')]===0x1f4){logger[_0x1526('0x10')](_0x1526('0xd'),_0x46bf36,_0x36e8b2[_0x1526('0x10')][_0x1526('0x12')]);return _0x4fc838(_0x36e8b2[_0x1526('0x10')][_0x1526('0x12')]);}logger[_0x1526('0x10')](_0x1526('0xd'),_0x46bf36,_0x36e8b2[_0x1526('0x10')][_0x1526('0x12')]);return _0x1d768f(_0x36e8b2[_0x1526('0x10')]['message']);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x46bf36,'request\x20sent');_0x1d768f(_0x36e8b2['result']['message']);}})['catch'](function(_0x4ee5ee){logger[_0x1526('0x10')](_0x1526('0xd'),_0x46bf36,_0x4ee5ee);_0x4fc838(_0x4ee5ee);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f0b363c..dca0d8e 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 _0xc3e3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x21fa3c,_0x2d1a9f){var _0x5b0404=function(_0x4c7f5a){while(--_0x4c7f5a){_0x21fa3c['push'](_0x21fa3c['shift']());}};_0x5b0404(++_0x2d1a9f);}(_0xc3e3,0x68));var _0x3c3e=function(_0x378830,_0xb532d7){_0x378830=_0x378830-0x0;var _0x4e4348=_0xc3e3[_0x378830];return _0x4e4348;};'use strict';var multer=require(_0x3c3e('0x0'));var util=require('util');var path=require(_0x3c3e('0x1'));var timeout=require(_0x3c3e('0x2'));var express=require(_0x3c3e('0x3'));var router=express['Router']();var fs_extra=require(_0x3c3e('0x4'));var auth=require(_0x3c3e('0x5'));var interaction=require(_0x3c3e('0x6'));var config=require(_0x3c3e('0x7'));var controller=require(_0x3c3e('0x8'));router[_0x3c3e('0x9')]('/',auth[_0x3c3e('0xa')](),controller['index']);router['get'](_0x3c3e('0xb'),auth[_0x3c3e('0xa')](),controller[_0x3c3e('0xc')]);router[_0x3c3e('0xd')]('/',auth[_0x3c3e('0xa')](),controller[_0x3c3e('0xe')]);router[_0x3c3e('0xf')](_0x3c3e('0xb'),auth[_0x3c3e('0xa')](),controller['update']);router[_0x3c3e('0x10')](_0x3c3e('0xb'),auth[_0x3c3e('0xa')](),controller[_0x3c3e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa10b=['post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xa10b,0x101));var _0xba10=function(_0x31aef5,_0x3879e6){_0x31aef5=_0x31aef5-0x0;var _0x1b5f22=_0xa10b[_0x31aef5];return _0x1b5f22;};'use strict';var multer=require('multer');var util=require(_0xba10('0x0'));var path=require('path');var timeout=require(_0xba10('0x1'));var express=require(_0xba10('0x2'));var router=express[_0xba10('0x3')]();var fs_extra=require(_0xba10('0x4'));var auth=require(_0xba10('0x5'));var interaction=require(_0xba10('0x6'));var config=require(_0xba10('0x7'));var controller=require('./intServicenowField.controller');router[_0xba10('0x8')]('/',auth[_0xba10('0x9')](),controller[_0xba10('0xa')]);router[_0xba10('0x8')](_0xba10('0xb'),auth[_0xba10('0x9')](),controller[_0xba10('0xc')]);router[_0xba10('0xd')]('/',auth[_0xba10('0x9')](),controller[_0xba10('0xe')]);router['put'](_0xba10('0xb'),auth[_0xba10('0x9')](),controller[_0xba10('0xf')]);router[_0xba10('0x10')](_0xba10('0xb'),auth[_0xba10('0x9')](),controller[_0xba10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 6456601..3a42ed3 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 _0xa08b=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','string'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa08b,0x1e4));var _0xba08=function(_0x230c53,_0x488a8a){_0x230c53=_0x230c53-0x0;var _0x397074=_0xa08b[_0x230c53];return _0x397074;};'use strict';var Sequelize=require(_0xba08('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xba08('0x1'),_0xba08('0x2'),_0xba08('0x3'),_0xba08('0x4'),_0xba08('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba08('0x6')]},'key':{'type':Sequelize[_0xba08('0x6')]},'keyType':{'type':Sequelize[_0xba08('0x7')](_0xba08('0x1'),_0xba08('0x2'),_0xba08('0x3'))},'keyContent':{'type':Sequelize[_0xba08('0x6')]},'idField':{'type':Sequelize[_0xba08('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xba08('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba08('0x6')]}}; \ No newline at end of file +var _0xd7f0=['STRING','ENUM','BOOLEAN','variable','customVariable','keyValue','string'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0xd7f0,0x1df));var _0x0d7f=function(_0x5d1e8e,_0x1afedd){_0x5d1e8e=_0x5d1e8e-0x0;var _0x2bee33=_0xd7f0[_0x5d1e8e];return _0x2bee33;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x0d7f('0x0'),_0x0d7f('0x1'),_0x0d7f('0x2'),'picklist'),'defaultValue':_0x0d7f('0x3')},'content':{'type':Sequelize[_0x0d7f('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0d7f('0x5')](_0x0d7f('0x3'),_0x0d7f('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0x0d7f('0x4')]},'idField':{'type':Sequelize[_0x0d7f('0x4')]},'nameField':{'type':Sequelize[_0x0d7f('0x4')]},'customField':{'type':Sequelize[_0x0d7f('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 0f00993..92d083d 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 _0xa708=['nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','ServicenowField','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x280875,_0x137bcb){var _0x74acfe=function(_0x3b599f){while(--_0x3b599f){_0x280875['push'](_0x280875['shift']());}};_0x74acfe(++_0x137bcb);}(_0xa708,0xf0));var _0x8a70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa708[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8a70('0x0'));var rimraf=require(_0x8a70('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a70('0x2'));var rp=require(_0x8a70('0x3'));var moment=require(_0x8a70('0x4'));var BPromise=require(_0x8a70('0x5'));var Mustache=require('mustache');var util=require(_0x8a70('0x6'));var path=require(_0x8a70('0x7'));var sox=require('sox');var csv=require(_0x8a70('0x8'));var ejs=require(_0x8a70('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a70('0xa'));var deskjs=require(_0x8a70('0xb'));var toCsv=require(_0x8a70('0x8'));var querystring=require(_0x8a70('0xc'));var Papa=require(_0x8a70('0xd'));var Redis=require(_0x8a70('0xe'));var authService=require(_0x8a70('0xf'));var qs=require(_0x8a70('0x10'));var as=require(_0x8a70('0x11'));var hardwareService=require(_0x8a70('0x12'));var logger=require('../../config/logger')(_0x8a70('0x13'));var utils=require('../../config/utils');var config=require(_0x8a70('0x14'));var licenseUtil=require(_0x8a70('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17a247,_0x4fa636){_0x4fa636=_0x4fa636||0xcc;return function(_0x77ceef){if(_0x77ceef){return _0x17a247['sendStatus'](_0x4fa636);}return _0x17a247['status'](_0x4fa636)[_0x8a70('0x16')]();};}function respondWithResult(_0x58fe43,_0x172ec0){_0x172ec0=_0x172ec0||0xc8;return function(_0x8f7a6c){if(_0x8f7a6c){return _0x58fe43[_0x8a70('0x17')](_0x172ec0)[_0x8a70('0x18')](_0x8f7a6c);}};}function respondWithFilteredResult(_0x574fcd,_0x162a9b){return function(_0xab5e94){if(_0xab5e94){var _0x3b1c7e=typeof _0x162a9b[_0x8a70('0x19')]===_0x8a70('0x1a')&&typeof _0x162a9b[_0x8a70('0x1b')]===_0x8a70('0x1a');var _0x1c1285=_0xab5e94[_0x8a70('0x1c')];var _0x2e0769=_0x3b1c7e?0x0:_0x162a9b[_0x8a70('0x19')];var _0x34d80e=_0x3b1c7e?_0xab5e94['count']:_0x162a9b[_0x8a70('0x19')]+_0x162a9b[_0x8a70('0x1b')];var _0x3ebb3e;if(_0x34d80e>=_0x1c1285){_0x34d80e=_0x1c1285;_0x3ebb3e=0xc8;}else{_0x3ebb3e=0xce;}_0x574fcd[_0x8a70('0x17')](_0x3ebb3e);return _0x574fcd[_0x8a70('0x1d')](_0x8a70('0x1e'),_0x2e0769+'-'+_0x34d80e+'/'+_0x1c1285)['json'](_0xab5e94);}return null;};}function patchUpdates(_0x38fd30){return function(_0x4b02b6){try{jsonpatch[_0x8a70('0x1f')](_0x4b02b6,_0x38fd30,!![]);}catch(_0x1d1b11){return BPromise[_0x8a70('0x20')](_0x1d1b11);}return _0x4b02b6[_0x8a70('0x21')]();};}function saveUpdates(_0x426612,_0x3bfed8){return function(_0xad3fac){if(_0xad3fac){return _0xad3fac[_0x8a70('0x22')](_0x426612)[_0x8a70('0x23')](function(_0x31c6ea){return _0x31c6ea;});}return null;};}function removeEntity(_0x1200d3,_0x1af250){return function(_0x3da2ad){if(_0x3da2ad){return _0x3da2ad['destroy']()[_0x8a70('0x23')](function(){_0x1200d3[_0x8a70('0x17')](0xcc)[_0x8a70('0x16')]();});}};}function handleEntityNotFound(_0x395479,_0x4f013f){return function(_0x47586f){if(!_0x47586f){_0x395479[_0x8a70('0x24')](0x194);}return _0x47586f;};}function handleError(_0x25215f,_0x169013){_0x169013=_0x169013||0x1f4;return function(_0x61392c){logger[_0x8a70('0x25')](_0x61392c['stack']);if(_0x61392c[_0x8a70('0x26')]){delete _0x61392c[_0x8a70('0x26')];}_0x25215f['status'](_0x169013)[_0x8a70('0x27')](_0x61392c);};}exports[_0x8a70('0x28')]=function(_0x5b9c60,_0x5d5170){var _0x47f005={},_0x174717={},_0x18a694={'count':0x0,'rows':[]};var _0x23ec77=_[_0x8a70('0x29')](db[_0x8a70('0x2a')]['rawAttributes'],function(_0x755038){return{'name':_0x755038[_0x8a70('0x2b')],'type':_0x755038[_0x8a70('0x2c')]['key']};});_0x174717['model']=_[_0x8a70('0x29')](_0x23ec77,'name');_0x174717[_0x8a70('0x2d')]=_[_0x8a70('0x2e')](_0x5b9c60[_0x8a70('0x2d')]);_0x174717['filters']=_[_0x8a70('0x2f')](_0x174717[_0x8a70('0x30')],_0x174717['query']);_0x47f005[_0x8a70('0x31')]=_[_0x8a70('0x2f')](_0x174717[_0x8a70('0x30')],qs[_0x8a70('0x32')](_0x5b9c60['query'][_0x8a70('0x32')]));_0x47f005[_0x8a70('0x31')]=_0x47f005[_0x8a70('0x31')][_0x8a70('0x33')]?_0x47f005['attributes']:_0x174717[_0x8a70('0x30')];if(!_0x5b9c60['query']['hasOwnProperty'](_0x8a70('0x34'))){_0x47f005[_0x8a70('0x1b')]=qs[_0x8a70('0x1b')](_0x5b9c60[_0x8a70('0x2d')][_0x8a70('0x1b')]);_0x47f005[_0x8a70('0x19')]=qs[_0x8a70('0x19')](_0x5b9c60['query'][_0x8a70('0x19')]);}_0x47f005[_0x8a70('0x35')]=qs[_0x8a70('0x36')](_0x5b9c60['query'][_0x8a70('0x36')]);_0x47f005[_0x8a70('0x37')]=qs[_0x8a70('0x38')](_[_0x8a70('0x39')](_0x5b9c60[_0x8a70('0x2d')],_0x174717[_0x8a70('0x38')]),_0x23ec77);if(_0x5b9c60[_0x8a70('0x2d')][_0x8a70('0x3a')]){_0x47f005[_0x8a70('0x37')]=_['merge'](_0x47f005['where'],{'$or':_[_0x8a70('0x29')](_0x23ec77,function(_0x41137e){if(_0x41137e[_0x8a70('0x2c')]!==_0x8a70('0x3b')){var _0x5d92ea={};_0x5d92ea[_0x41137e['name']]={'$like':'%'+_0x5b9c60['query'][_0x8a70('0x3a')]+'%'};return _0x5d92ea;}})});}_0x47f005=_[_0x8a70('0x3c')]({},_0x47f005,_0x5b9c60[_0x8a70('0x3d')]);var _0x2c8f9f={'where':_0x47f005[_0x8a70('0x37')]};return db[_0x8a70('0x2a')][_0x8a70('0x1c')](_0x2c8f9f)['then'](function(_0x5a4641){_0x18a694['count']=_0x5a4641;if(_0x5b9c60['query'][_0x8a70('0x3e')]){_0x47f005[_0x8a70('0x3f')]=[{'all':!![]}];}return db[_0x8a70('0x2a')][_0x8a70('0x40')](_0x47f005);})[_0x8a70('0x23')](function(_0x39a971){_0x18a694['rows']=_0x39a971;return _0x18a694;})[_0x8a70('0x23')](respondWithFilteredResult(_0x5d5170,_0x47f005))[_0x8a70('0x41')](handleError(_0x5d5170,null));};exports[_0x8a70('0x42')]=function(_0x3c463e,_0x346184){var _0x2ed234={'raw':!![],'where':{'id':_0x3c463e[_0x8a70('0x43')]['id']}},_0x1babf4={};_0x1babf4[_0x8a70('0x30')]=_['keys'](db[_0x8a70('0x2a')][_0x8a70('0x44')]);_0x1babf4[_0x8a70('0x2d')]=_['keys'](_0x3c463e[_0x8a70('0x2d')]);_0x1babf4[_0x8a70('0x38')]=_[_0x8a70('0x2f')](_0x1babf4['model'],_0x1babf4[_0x8a70('0x2d')]);_0x2ed234[_0x8a70('0x31')]=_[_0x8a70('0x2f')](_0x1babf4[_0x8a70('0x30')],qs[_0x8a70('0x32')](_0x3c463e[_0x8a70('0x2d')][_0x8a70('0x32')]));_0x2ed234[_0x8a70('0x31')]=_0x2ed234[_0x8a70('0x31')][_0x8a70('0x33')]?_0x2ed234['attributes']:_0x1babf4['model'];if(_0x3c463e[_0x8a70('0x2d')][_0x8a70('0x3e')]){_0x2ed234[_0x8a70('0x3f')]=[{'all':!![]}];}_0x2ed234=_[_0x8a70('0x3c')]({},_0x2ed234,_0x3c463e[_0x8a70('0x3d')]);return db['ServicenowField'][_0x8a70('0x45')](_0x2ed234)[_0x8a70('0x23')](handleEntityNotFound(_0x346184,null))[_0x8a70('0x23')](respondWithResult(_0x346184,null))[_0x8a70('0x41')](handleError(_0x346184,null));};exports[_0x8a70('0x46')]=function(_0x39095a,_0x27a26e){return db[_0x8a70('0x2a')][_0x8a70('0x46')](_0x39095a[_0x8a70('0x47')],{})[_0x8a70('0x23')](respondWithResult(_0x27a26e,0xc9))[_0x8a70('0x41')](handleError(_0x27a26e,null));};exports[_0x8a70('0x22')]=function(_0x568324,_0x53859c){if(_0x568324[_0x8a70('0x47')]['id']){delete _0x568324[_0x8a70('0x47')]['id'];}return db[_0x8a70('0x2a')]['find']({'where':{'id':_0x568324['params']['id']}})['then'](handleEntityNotFound(_0x53859c,null))['then'](saveUpdates(_0x568324[_0x8a70('0x47')],null))[_0x8a70('0x23')](respondWithResult(_0x53859c,null))[_0x8a70('0x41')](handleError(_0x53859c,null));};exports[_0x8a70('0x48')]=function(_0x4305f4,_0x30288c){return db['ServicenowField'][_0x8a70('0x45')]({'where':{'id':_0x4305f4[_0x8a70('0x43')]['id']}})[_0x8a70('0x23')](handleEntityNotFound(_0x30288c,null))['then'](removeEntity(_0x30288c,null))['catch'](handleError(_0x30288c,null));}; \ No newline at end of file +var _0xccbb=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x2847d0,_0x10a787){var _0x1cc209=function(_0x3863ff){while(--_0x3863ff){_0x2847d0['push'](_0x2847d0['shift']());}};_0x1cc209(++_0x10a787);}(_0xccbb,0x169));var _0xbccb=function(_0x4726c5,_0x289849){_0x4726c5=_0x4726c5-0x0;var _0x475d80=_0xccbb[_0x4726c5];return _0x475d80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbccb('0x0'));var zipdir=require(_0xbccb('0x1'));var jsonpatch=require(_0xbccb('0x2'));var rp=require(_0xbccb('0x3'));var moment=require(_0xbccb('0x4'));var BPromise=require(_0xbccb('0x5'));var Mustache=require(_0xbccb('0x6'));var util=require(_0xbccb('0x7'));var path=require(_0xbccb('0x8'));var sox=require(_0xbccb('0x9'));var csv=require(_0xbccb('0xa'));var ejs=require(_0xbccb('0xb'));var fs=require('fs');var fs_extra=require(_0xbccb('0xc'));var _=require(_0xbccb('0xd'));var squel=require(_0xbccb('0xe'));var crypto=require(_0xbccb('0xf'));var jsforce=require(_0xbccb('0x10'));var deskjs=require(_0xbccb('0x11'));var toCsv=require(_0xbccb('0xa'));var querystring=require(_0xbccb('0x12'));var Papa=require('papaparse');var Redis=require(_0xbccb('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbccb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbccb('0x15'))(_0xbccb('0x16'));var utils=require('../../config/utils');var config=require(_0xbccb('0x17'));var licenseUtil=require(_0xbccb('0x18'));var db=require(_0xbccb('0x19'))['db'];function respondWithStatusCode(_0x1833a2,_0x58203a){_0x58203a=_0x58203a||0xcc;return function(_0x2ca633){if(_0x2ca633){return _0x1833a2[_0xbccb('0x1a')](_0x58203a);}return _0x1833a2[_0xbccb('0x1b')](_0x58203a)[_0xbccb('0x1c')]();};}function respondWithResult(_0x32edc4,_0x166646){_0x166646=_0x166646||0xc8;return function(_0x2bb7af){if(_0x2bb7af){return _0x32edc4[_0xbccb('0x1b')](_0x166646)[_0xbccb('0x1d')](_0x2bb7af);}};}function respondWithFilteredResult(_0xeb3025,_0xd0d786){return function(_0x1fdafd){if(_0x1fdafd){var _0x59d9c7=typeof _0xd0d786[_0xbccb('0x1e')]==='undefined'&&typeof _0xd0d786['limit']===_0xbccb('0x1f');var _0x4d6c94=_0x1fdafd['count'];var _0x13d414=_0x59d9c7?0x0:_0xd0d786[_0xbccb('0x1e')];var _0x12ffe7=_0x59d9c7?_0x1fdafd[_0xbccb('0x20')]:_0xd0d786['offset']+_0xd0d786[_0xbccb('0x21')];var _0x5de27a;if(_0x12ffe7>=_0x4d6c94){_0x12ffe7=_0x4d6c94;_0x5de27a=0xc8;}else{_0x5de27a=0xce;}_0xeb3025[_0xbccb('0x1b')](_0x5de27a);return _0xeb3025[_0xbccb('0x22')](_0xbccb('0x23'),_0x13d414+'-'+_0x12ffe7+'/'+_0x4d6c94)['json'](_0x1fdafd);}return null;};}function patchUpdates(_0x4be698){return function(_0xeafa67){try{jsonpatch[_0xbccb('0x24')](_0xeafa67,_0x4be698,!![]);}catch(_0x52e0f5){return BPromise[_0xbccb('0x25')](_0x52e0f5);}return _0xeafa67[_0xbccb('0x26')]();};}function saveUpdates(_0x4114a6,_0x3db3d2){return function(_0x3b2d82){if(_0x3b2d82){return _0x3b2d82[_0xbccb('0x27')](_0x4114a6)[_0xbccb('0x28')](function(_0x1087fd){return _0x1087fd;});}return null;};}function removeEntity(_0x373a37,_0xdd2e04){return function(_0x23ac6a){if(_0x23ac6a){return _0x23ac6a[_0xbccb('0x29')]()[_0xbccb('0x28')](function(){_0x373a37[_0xbccb('0x1b')](0xcc)[_0xbccb('0x1c')]();});}};}function handleEntityNotFound(_0x57432c,_0x499560){return function(_0x309b9e){if(!_0x309b9e){_0x57432c[_0xbccb('0x1a')](0x194);}return _0x309b9e;};}function handleError(_0x5f2167,_0x442e9d){_0x442e9d=_0x442e9d||0x1f4;return function(_0x557d2d){logger[_0xbccb('0x2a')](_0x557d2d[_0xbccb('0x2b')]);if(_0x557d2d['name']){delete _0x557d2d[_0xbccb('0x2c')];}_0x5f2167[_0xbccb('0x1b')](_0x442e9d)[_0xbccb('0x2d')](_0x557d2d);};}exports[_0xbccb('0x2e')]=function(_0x34e9d4,_0x4b3391){var _0x118384={},_0x808259={},_0xff0be0={'count':0x0,'rows':[]};var _0x3a61ce=_[_0xbccb('0x2f')](db[_0xbccb('0x30')][_0xbccb('0x31')],function(_0x413efb){return{'name':_0x413efb[_0xbccb('0x32')],'type':_0x413efb[_0xbccb('0x33')][_0xbccb('0x34')]};});_0x808259[_0xbccb('0x35')]=_['map'](_0x3a61ce,_0xbccb('0x2c'));_0x808259[_0xbccb('0x36')]=_[_0xbccb('0x37')](_0x34e9d4[_0xbccb('0x36')]);_0x808259['filters']=_[_0xbccb('0x38')](_0x808259[_0xbccb('0x35')],_0x808259[_0xbccb('0x36')]);_0x118384[_0xbccb('0x39')]=_[_0xbccb('0x38')](_0x808259[_0xbccb('0x35')],qs['fields'](_0x34e9d4[_0xbccb('0x36')][_0xbccb('0x3a')]));_0x118384['attributes']=_0x118384[_0xbccb('0x39')][_0xbccb('0x3b')]?_0x118384[_0xbccb('0x39')]:_0x808259[_0xbccb('0x35')];if(!_0x34e9d4[_0xbccb('0x36')][_0xbccb('0x3c')]('nolimit')){_0x118384[_0xbccb('0x21')]=qs[_0xbccb('0x21')](_0x34e9d4['query'][_0xbccb('0x21')]);_0x118384[_0xbccb('0x1e')]=qs[_0xbccb('0x1e')](_0x34e9d4[_0xbccb('0x36')][_0xbccb('0x1e')]);}_0x118384[_0xbccb('0x3d')]=qs[_0xbccb('0x3e')](_0x34e9d4[_0xbccb('0x36')][_0xbccb('0x3e')]);_0x118384[_0xbccb('0x3f')]=qs[_0xbccb('0x40')](_[_0xbccb('0x41')](_0x34e9d4[_0xbccb('0x36')],_0x808259[_0xbccb('0x40')]),_0x3a61ce);if(_0x34e9d4[_0xbccb('0x36')][_0xbccb('0x42')]){_0x118384[_0xbccb('0x3f')]=_[_0xbccb('0x43')](_0x118384[_0xbccb('0x3f')],{'$or':_[_0xbccb('0x2f')](_0x3a61ce,function(_0x5e2373){if(_0x5e2373[_0xbccb('0x33')]!==_0xbccb('0x44')){var _0x3c2a8b={};_0x3c2a8b[_0x5e2373[_0xbccb('0x2c')]]={'$like':'%'+_0x34e9d4['query'][_0xbccb('0x42')]+'%'};return _0x3c2a8b;}})});}_0x118384=_[_0xbccb('0x43')]({},_0x118384,_0x34e9d4[_0xbccb('0x45')]);var _0x4a99fa={'where':_0x118384[_0xbccb('0x3f')]};return db[_0xbccb('0x30')][_0xbccb('0x20')](_0x4a99fa)['then'](function(_0x594747){_0xff0be0['count']=_0x594747;if(_0x34e9d4[_0xbccb('0x36')][_0xbccb('0x46')]){_0x118384[_0xbccb('0x47')]=[{'all':!![]}];}return db[_0xbccb('0x30')][_0xbccb('0x48')](_0x118384);})['then'](function(_0x8ff009){_0xff0be0[_0xbccb('0x49')]=_0x8ff009;return _0xff0be0;})[_0xbccb('0x28')](respondWithFilteredResult(_0x4b3391,_0x118384))[_0xbccb('0x4a')](handleError(_0x4b3391,null));};exports['show']=function(_0x30e7e3,_0x56a404){var _0x2c1116={'raw':!![],'where':{'id':_0x30e7e3[_0xbccb('0x4b')]['id']}},_0x3118b1={};_0x3118b1[_0xbccb('0x35')]=_['keys'](db[_0xbccb('0x30')][_0xbccb('0x31')]);_0x3118b1[_0xbccb('0x36')]=_[_0xbccb('0x37')](_0x30e7e3[_0xbccb('0x36')]);_0x3118b1[_0xbccb('0x40')]=_[_0xbccb('0x38')](_0x3118b1[_0xbccb('0x35')],_0x3118b1[_0xbccb('0x36')]);_0x2c1116[_0xbccb('0x39')]=_['intersection'](_0x3118b1[_0xbccb('0x35')],qs[_0xbccb('0x3a')](_0x30e7e3['query'][_0xbccb('0x3a')]));_0x2c1116['attributes']=_0x2c1116['attributes'][_0xbccb('0x3b')]?_0x2c1116['attributes']:_0x3118b1[_0xbccb('0x35')];if(_0x30e7e3[_0xbccb('0x36')][_0xbccb('0x46')]){_0x2c1116[_0xbccb('0x47')]=[{'all':!![]}];}_0x2c1116=_[_0xbccb('0x43')]({},_0x2c1116,_0x30e7e3[_0xbccb('0x45')]);return db[_0xbccb('0x30')][_0xbccb('0x4c')](_0x2c1116)[_0xbccb('0x28')](handleEntityNotFound(_0x56a404,null))['then'](respondWithResult(_0x56a404,null))['catch'](handleError(_0x56a404,null));};exports[_0xbccb('0x4d')]=function(_0x345934,_0x4b0bb0){return db[_0xbccb('0x30')][_0xbccb('0x4d')](_0x345934[_0xbccb('0x4e')],{})['then'](respondWithResult(_0x4b0bb0,0xc9))[_0xbccb('0x4a')](handleError(_0x4b0bb0,null));};exports[_0xbccb('0x27')]=function(_0x3a3488,_0x5688c1){if(_0x3a3488[_0xbccb('0x4e')]['id']){delete _0x3a3488[_0xbccb('0x4e')]['id'];}return db['ServicenowField'][_0xbccb('0x4c')]({'where':{'id':_0x3a3488[_0xbccb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5688c1,null))['then'](saveUpdates(_0x3a3488[_0xbccb('0x4e')],null))[_0xbccb('0x28')](respondWithResult(_0x5688c1,null))[_0xbccb('0x4a')](handleError(_0x5688c1,null));};exports[_0xbccb('0x29')]=function(_0x3b3fc3,_0x2f7868){return db['ServicenowField'][_0xbccb('0x4c')]({'where':{'id':_0x3b3fc3['params']['id']}})[_0xbccb('0x28')](handleEntityNotFound(_0x2f7868,null))[_0xbccb('0x28')](removeEntity(_0x2f7868,null))[_0xbccb('0x4a')](handleError(_0x2f7868,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index dab219a..6e3af69 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 _0x89bc=['api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','lodash','util','../../config/logger'];(function(_0x30d74b,_0x4e619f){var _0x5c13e5=function(_0x449d8){while(--_0x449d8){_0x30d74b['push'](_0x30d74b['shift']());}};_0x5c13e5(++_0x4e619f);}(_0x89bc,0x1ec));var _0xc89b=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x89bc[_0x399d76];return _0x3b19a1;};'use strict';var _=require(_0xc89b('0x0'));var util=require(_0xc89b('0x1'));var logger=require(_0xc89b('0x2'))(_0xc89b('0x3'));var moment=require(_0xc89b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc89b('0x5'));var fs=require('fs');var path=require(_0xc89b('0x6'));var rimraf=require(_0xc89b('0x7'));var config=require(_0xc89b('0x8'));var attributes=require(_0xc89b('0x9'));module[_0xc89b('0xa')]=function(_0x4019bc,_0xbc4286){return _0x4019bc[_0xc89b('0xb')](_0xc89b('0xc'),attributes,{'tableName':_0xc89b('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xc89b('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x096c=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','idField'];(function(_0x39e1e1,_0xf4f793){var _0x1f3737=function(_0x300bc1){while(--_0x300bc1){_0x39e1e1['push'](_0x39e1e1['shift']());}};_0x1f3737(++_0xf4f793);}(_0x096c,0x1a5));var _0xc096=function(_0x3cb56f,_0x13bfe2){_0x3cb56f=_0x3cb56f-0x0;var _0x4af176=_0x096c[_0x3cb56f];return _0x4af176;};'use strict';var _=require(_0xc096('0x0'));var util=require(_0xc096('0x1'));var logger=require(_0xc096('0x2'))(_0xc096('0x3'));var moment=require(_0xc096('0x4'));var BPromise=require('bluebird');var rp=require(_0xc096('0x5'));var fs=require('fs');var path=require(_0xc096('0x6'));var rimraf=require(_0xc096('0x7'));var config=require('../../config/environment');var attributes=require(_0xc096('0x8'));module[_0xc096('0x9')]=function(_0x3e48ae,_0x4cf4f5){return _0x3e48ae['define'](_0xc096('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc096('0xb'),'fields':[_0xc096('0xc'),_0xc096('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 5b55e42..6114f56 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xc875a,_0x4600fa){var _0x405cce=function(_0x41e4ca){while(--_0x41e4ca){_0xc875a['push'](_0xc875a['shift']());}};_0x405cce(++_0x4600fa);}(_0xe706,0xa3));var _0x6e70=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0xe706[_0x59cda9];return _0x26c18f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x25f0ea,_0xd6d029){var _0x275268=function(_0x35492a){while(--_0x35492a){_0x25f0ea['push'](_0x25f0ea['shift']());}};_0x275268(++_0xd6d029);}(_0xaa88,0x137));var _0x8aa8=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0xaa88[_0x51d71a];return _0xff01f1;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9b82f11..bd7e0b8 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x26b6d6,_0x52b01e){var _0x415253=function(_0x406bb3){while(--_0x406bb3){_0x26b6d6['push'](_0x26b6d6['shift']());}};_0x415253(++_0x52b01e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3f2736,_0x2d3e94){var _0x30338a=function(_0x2c3f8a){while(--_0x2c3f8a){_0x3f2736['push'](_0x3f2736['shift']());}};_0x30338a(++_0x2d3e94);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 02681e6..4a8606f 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(_0x3993cb,_0x286f55){var _0x11fdbb=function(_0x211ace){while(--_0x211ace){_0x3993cb['push'](_0x3993cb['shift']());}};_0x11fdbb(++_0x286f55);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1c5717,_0x1650a2){var _0x4b379f=function(_0x1d3fce){while(--_0x1d3fce){_0x1c5717['push'](_0x1c5717['shift']());}};_0x4b379f(++_0x1650a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 ce334d3..9c70334 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 _0x7f2d=['status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','findOne','SugarcrmConfiguration','length','pick','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_name','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x346ddd,_0x5939a2){var _0x500a63=function(_0x24d7c1){while(--_0x24d7c1){_0x346ddd['push'](_0x346ddd['shift']());}};_0x500a63(++_0x5939a2);}(_0x7f2d,0x157));var _0xd7f2=function(_0x302170,_0x82effd){_0x302170=_0x302170-0x0;var _0x3497c1=_0x7f2d[_0x302170];return _0x3497c1;};'use strict';var emlformat=require(_0xd7f2('0x0'));var rimraf=require(_0xd7f2('0x1'));var zipdir=require(_0xd7f2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7f2('0x3'));var moment=require(_0xd7f2('0x4'));var BPromise=require(_0xd7f2('0x5'));var Mustache=require('mustache');var util=require(_0xd7f2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd7f2('0x7'));var ejs=require(_0xd7f2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7f2('0x9'));var squel=require(_0xd7f2('0xa'));var crypto=require(_0xd7f2('0xb'));var jsforce=require(_0xd7f2('0xc'));var deskjs=require(_0xd7f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd7f2('0xe'));var Papa=require('papaparse');var Redis=require(_0xd7f2('0xf'));var authService=require(_0xd7f2('0x10'));var qs=require(_0xd7f2('0x11'));var as=require(_0xd7f2('0x12'));var hardwareService=require(_0xd7f2('0x13'));var logger=require(_0xd7f2('0x14'))(_0xd7f2('0x15'));var utils=require(_0xd7f2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd7f2('0x17'));var db=require(_0xd7f2('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x264c0b,_0x4a7460){_0x4a7460=_0x4a7460||0xcc;return function(_0x5e9625){if(_0x5e9625){return _0x264c0b[_0xd7f2('0x19')](_0x4a7460);}return _0x264c0b[_0xd7f2('0x1a')](_0x4a7460)['end']();};}function respondWithResult(_0xf2eb89,_0x4471bf){_0x4471bf=_0x4471bf||0xc8;return function(_0x1e9228){if(_0x1e9228){return _0xf2eb89[_0xd7f2('0x1a')](_0x4471bf)['json'](_0x1e9228);}};}function respondWithFilteredResult(_0x3ad748,_0x4f2eab){return function(_0x511f98){if(_0x511f98){var _0x105b01=typeof _0x4f2eab[_0xd7f2('0x1b')]===_0xd7f2('0x1c')&&typeof _0x4f2eab['limit']==='undefined';var _0x2d0711=_0x511f98['count'];var _0x2f7d48=_0x105b01?0x0:_0x4f2eab[_0xd7f2('0x1b')];var _0x91ffbc=_0x105b01?_0x511f98[_0xd7f2('0x1d')]:_0x4f2eab['offset']+_0x4f2eab[_0xd7f2('0x1e')];var _0x43c8fb;if(_0x91ffbc>=_0x2d0711){_0x91ffbc=_0x2d0711;_0x43c8fb=0xc8;}else{_0x43c8fb=0xce;}_0x3ad748['status'](_0x43c8fb);return _0x3ad748[_0xd7f2('0x1f')](_0xd7f2('0x20'),_0x2f7d48+'-'+_0x91ffbc+'/'+_0x2d0711)[_0xd7f2('0x21')](_0x511f98);}return null;};}function patchUpdates(_0x543792){return function(_0x2d67d2){try{jsonpatch[_0xd7f2('0x22')](_0x2d67d2,_0x543792,!![]);}catch(_0x1cfe35){return BPromise[_0xd7f2('0x23')](_0x1cfe35);}return _0x2d67d2[_0xd7f2('0x24')]();};}function saveUpdates(_0x5a1a74,_0x5e4cc1){return function(_0x5ab93b){if(_0x5ab93b){return _0x5ab93b[_0xd7f2('0x25')](_0x5a1a74)[_0xd7f2('0x26')](function(_0x1128de){return _0x1128de;});}return null;};}function removeEntity(_0x29a127,_0x5e6966){return function(_0x1acdeb){if(_0x1acdeb){return _0x1acdeb[_0xd7f2('0x27')]()[_0xd7f2('0x26')](function(){_0x29a127[_0xd7f2('0x1a')](0xcc)[_0xd7f2('0x28')]();});}};}function handleEntityNotFound(_0x23e4e1,_0xc90d82){return function(_0x5bb068){if(!_0x5bb068){_0x23e4e1[_0xd7f2('0x19')](0x194);}return _0x5bb068;};}function handleError(_0x246aec,_0x362a6d){_0x362a6d=_0x362a6d||0x1f4;return function(_0x5ac22e){logger[_0xd7f2('0x29')](_0x5ac22e[_0xd7f2('0x2a')]);if(_0x5ac22e['name']){delete _0x5ac22e[_0xd7f2('0x2b')];}_0x246aec[_0xd7f2('0x1a')](_0x362a6d)[_0xd7f2('0x2c')](_0x5ac22e);};}exports[_0xd7f2('0x2d')]=function(_0x1caa4e,_0x7a0c4a){var _0x5cb12f={},_0x670fa9={},_0x28b09d={'count':0x0,'rows':[]};var _0x52886e=_[_0xd7f2('0x2e')](db[_0xd7f2('0x2f')]['rawAttributes'],function(_0x230f0f){return{'name':_0x230f0f[_0xd7f2('0x30')],'type':_0x230f0f[_0xd7f2('0x31')][_0xd7f2('0x32')]};});_0x670fa9[_0xd7f2('0x33')]=_[_0xd7f2('0x2e')](_0x52886e,_0xd7f2('0x2b'));_0x670fa9[_0xd7f2('0x34')]=_['keys'](_0x1caa4e[_0xd7f2('0x34')]);_0x670fa9[_0xd7f2('0x35')]=_[_0xd7f2('0x36')](_0x670fa9[_0xd7f2('0x33')],_0x670fa9[_0xd7f2('0x34')]);_0x5cb12f['attributes']=_[_0xd7f2('0x36')](_0x670fa9[_0xd7f2('0x33')],qs['fields'](_0x1caa4e[_0xd7f2('0x34')][_0xd7f2('0x37')]));_0x5cb12f[_0xd7f2('0x38')]=_0x5cb12f[_0xd7f2('0x38')]['length']?_0x5cb12f[_0xd7f2('0x38')]:_0x670fa9['model'];if(!_0x1caa4e[_0xd7f2('0x34')]['hasOwnProperty'](_0xd7f2('0x39'))){_0x5cb12f[_0xd7f2('0x1e')]=qs[_0xd7f2('0x1e')](_0x1caa4e['query'][_0xd7f2('0x1e')]);_0x5cb12f[_0xd7f2('0x1b')]=qs[_0xd7f2('0x1b')](_0x1caa4e[_0xd7f2('0x34')]['offset']);}_0x5cb12f[_0xd7f2('0x3a')]=qs[_0xd7f2('0x3b')](_0x1caa4e[_0xd7f2('0x34')][_0xd7f2('0x3b')]);_0x5cb12f[_0xd7f2('0x3c')]=qs['filters'](_['pick'](_0x1caa4e[_0xd7f2('0x34')],_0x670fa9[_0xd7f2('0x35')]),_0x52886e);if(_0x1caa4e['query']['filter']){_0x5cb12f[_0xd7f2('0x3c')]=_[_0xd7f2('0x3d')](_0x5cb12f[_0xd7f2('0x3c')],{'$or':_[_0xd7f2('0x2e')](_0x52886e,function(_0x2c76e7){if(_0x2c76e7[_0xd7f2('0x31')]!==_0xd7f2('0x3e')){var _0x55c481={};_0x55c481[_0x2c76e7[_0xd7f2('0x2b')]]={'$like':'%'+_0x1caa4e[_0xd7f2('0x34')]['filter']+'%'};return _0x55c481;}})});}_0x5cb12f=_[_0xd7f2('0x3d')]({},_0x5cb12f,_0x1caa4e[_0xd7f2('0x3f')]);var _0x57f6bb={'where':_0x5cb12f[_0xd7f2('0x3c')]};return db[_0xd7f2('0x2f')][_0xd7f2('0x1d')](_0x57f6bb)[_0xd7f2('0x26')](function(_0x3ce874){_0x28b09d['count']=_0x3ce874;if(_0x1caa4e['query']['includeAll']){_0x5cb12f[_0xd7f2('0x40')]=[{'all':!![]}];}return db[_0xd7f2('0x2f')][_0xd7f2('0x41')](_0x5cb12f);})['then'](function(_0x557428){_0x28b09d[_0xd7f2('0x42')]=_0x557428;return _0x28b09d;})[_0xd7f2('0x26')](respondWithFilteredResult(_0x7a0c4a,_0x5cb12f))[_0xd7f2('0x43')](handleError(_0x7a0c4a,null));};exports[_0xd7f2('0x44')]=function(_0x4d1069,_0x366f07){var _0x36a7e3={'raw':![],'where':{'id':_0x4d1069[_0xd7f2('0x45')]['id']}},_0x3d87e2={};_0x3d87e2[_0xd7f2('0x33')]=_[_0xd7f2('0x46')](db[_0xd7f2('0x2f')][_0xd7f2('0x47')]);_0x3d87e2[_0xd7f2('0x34')]=_[_0xd7f2('0x46')](_0x4d1069[_0xd7f2('0x34')]);_0x3d87e2[_0xd7f2('0x35')]=_[_0xd7f2('0x36')](_0x3d87e2[_0xd7f2('0x33')],_0x3d87e2[_0xd7f2('0x34')]);_0x36a7e3[_0xd7f2('0x38')]=_['intersection'](_0x3d87e2[_0xd7f2('0x33')],qs[_0xd7f2('0x37')](_0x4d1069[_0xd7f2('0x34')]['fields']));_0x36a7e3[_0xd7f2('0x38')]=_0x36a7e3[_0xd7f2('0x38')]['length']?_0x36a7e3['attributes']:_0x3d87e2[_0xd7f2('0x33')];if(_0x4d1069[_0xd7f2('0x34')][_0xd7f2('0x48')]){_0x36a7e3[_0xd7f2('0x40')]=[{'all':!![]}];}_0x36a7e3=_[_0xd7f2('0x3d')]({},_0x36a7e3,_0x4d1069[_0xd7f2('0x3f')]);return db['SugarcrmAccount'][_0xd7f2('0x49')](_0x36a7e3)[_0xd7f2('0x26')](handleEntityNotFound(_0x366f07,null))[_0xd7f2('0x26')](respondWithResult(_0x366f07,null))[_0xd7f2('0x43')](handleError(_0x366f07,null));};exports[_0xd7f2('0x4a')]=function(_0x2119a6,_0x39aac8){return db['SugarcrmAccount'][_0xd7f2('0x4a')](_0x2119a6[_0xd7f2('0x4b')],{})[_0xd7f2('0x26')](respondWithResult(_0x39aac8,0xc9))[_0xd7f2('0x43')](handleError(_0x39aac8,null));};exports[_0xd7f2('0x25')]=function(_0xc42bdd,_0x17cb55){if(_0xc42bdd[_0xd7f2('0x4b')]['id']){delete _0xc42bdd[_0xd7f2('0x4b')]['id'];}return db[_0xd7f2('0x2f')]['find']({'where':{'id':_0xc42bdd['params']['id']}})[_0xd7f2('0x26')](handleEntityNotFound(_0x17cb55,null))[_0xd7f2('0x26')](saveUpdates(_0xc42bdd[_0xd7f2('0x4b')],null))[_0xd7f2('0x26')](respondWithResult(_0x17cb55,null))[_0xd7f2('0x43')](handleError(_0x17cb55,null));};exports[_0xd7f2('0x27')]=function(_0x2f390c,_0x6bd870){return db['SugarcrmAccount']['find']({'where':{'id':_0x2f390c['params']['id']}})['then'](handleEntityNotFound(_0x6bd870,null))[_0xd7f2('0x26')](removeEntity(_0x6bd870,null))[_0xd7f2('0x43')](handleError(_0x6bd870,null));};exports['getConfigurations']=function(_0xa2725e,_0x5c7473,_0xfc04a8){var _0x35b0a2={};var _0xe5a24c={};var _0x114d6e;var _0x565042;return db[_0xd7f2('0x2f')][_0xd7f2('0x4c')]({'where':{'id':_0xa2725e['params']['id']}})[_0xd7f2('0x26')](handleEntityNotFound(_0x5c7473,null))[_0xd7f2('0x26')](function(_0x2ac3f9){if(_0x2ac3f9){_0x114d6e=_0x2ac3f9;_0xe5a24c[_0xd7f2('0x33')]=_[_0xd7f2('0x46')](db[_0xd7f2('0x4d')][_0xd7f2('0x47')]);_0xe5a24c[_0xd7f2('0x34')]=_[_0xd7f2('0x46')](_0xa2725e[_0xd7f2('0x34')]);_0xe5a24c['filters']=_[_0xd7f2('0x36')](_0xe5a24c[_0xd7f2('0x33')],_0xe5a24c[_0xd7f2('0x34')]);_0x35b0a2[_0xd7f2('0x38')]=_[_0xd7f2('0x36')](_0xe5a24c[_0xd7f2('0x33')],qs[_0xd7f2('0x37')](_0xa2725e[_0xd7f2('0x34')]['fields']));_0x35b0a2['attributes']=_0x35b0a2[_0xd7f2('0x38')][_0xd7f2('0x4e')]?_0x35b0a2['attributes']:_0xe5a24c[_0xd7f2('0x33')];_0x35b0a2[_0xd7f2('0x3a')]=qs['sort'](_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x3b')]);_0x35b0a2[_0xd7f2('0x3c')]=qs[_0xd7f2('0x35')](_[_0xd7f2('0x4f')](_0xa2725e[_0xd7f2('0x34')],_0xe5a24c[_0xd7f2('0x35')]));if(_0xa2725e[_0xd7f2('0x34')]['filter']){_0x35b0a2['where']=_[_0xd7f2('0x3d')](_0x35b0a2[_0xd7f2('0x3c')],{'$or':_[_0xd7f2('0x2e')](_0x35b0a2['attributes'],function(_0x30ebdb){var _0x1e8a8e={};_0x1e8a8e[_0x30ebdb]={'$like':'%'+_0xa2725e['query'][_0xd7f2('0x50')]+'%'};return _0x1e8a8e;})});}_0x35b0a2=_[_0xd7f2('0x3d')]({},_0x35b0a2,_0xa2725e[_0xd7f2('0x3f')]);return _0x114d6e['getConfigurations'](_0x35b0a2);}})[_0xd7f2('0x26')](function(_0x3402d3){if(_0x3402d3){_0x565042=_0x3402d3['length'];if(!_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x51')](_0xd7f2('0x39'))){_0x35b0a2[_0xd7f2('0x1e')]=qs[_0xd7f2('0x1e')](_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x1e')]);_0x35b0a2['offset']=qs[_0xd7f2('0x1b')](_0xa2725e[_0xd7f2('0x34')][_0xd7f2('0x1b')]);}return _0x114d6e['getConfigurations'](_0x35b0a2);}})[_0xd7f2('0x26')](function(_0x2a94bb){if(_0x2a94bb){return _0x2a94bb?{'count':_0x565042,'rows':_0x2a94bb}:null;}})['then'](respondWithResult(_0x5c7473,null))[_0xd7f2('0x43')](handleError(_0x5c7473,null));};exports[_0xd7f2('0x52')]=function(_0x5b9711,_0x4e6f96,_0x265450){if(_0x5b9711[_0xd7f2('0x4b')]['id']){delete _0x5b9711[_0xd7f2('0x4b')]['id'];}return db[_0xd7f2('0x2f')]['findOne']({'where':{'id':_0x5b9711[_0xd7f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e6f96,null))[_0xd7f2('0x26')](function(_0x267691){if(_0x267691){_0x5b9711['body'][_0xd7f2('0x53')]=_0x267691['id'];_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x54')]=integrations[_0xd7f2('0x55')](_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x56')],_0x5b9711[_0xd7f2('0x4b')]['type']);_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x57')]=integrations[_0xd7f2('0x58')](_0x5b9711[_0xd7f2('0x4b')][_0xd7f2('0x56')],_0x5b9711['body'][_0xd7f2('0x31')]);return db[_0xd7f2('0x4d')][_0xd7f2('0x4a')](_0x5b9711[_0xd7f2('0x4b')],{'include':[{'model':db[_0xd7f2('0x59')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xd7f2('0x57')}]});}return null;})[_0xd7f2('0x26')](respondWithResult(_0x4e6f96,null))[_0xd7f2('0x43')](handleError(_0x4e6f96,null));};exports[_0xd7f2('0x5a')]=function(_0xac9529,_0x2ee5ce,_0x517096){var _0x3c88a9='';var _0x34887c=['id',_0xd7f2('0x2b'),'assigned_user_id',_0xd7f2('0x5b'),_0xd7f2('0x5c'),_0xd7f2('0x5d'),_0xd7f2('0x5e'),_0xd7f2('0x5f'),'parent_id','parent_type',_0xd7f2('0x60'),'direction'];return db[_0xd7f2('0x2f')][_0xd7f2('0x4c')]({'where':{'id':_0xac9529[_0xd7f2('0x45')]['id']},'attributes':['id','username',_0xd7f2('0x61'),_0xd7f2('0x62')]})[_0xd7f2('0x26')](handleEntityNotFound(_0x2ee5ce,null))[_0xd7f2('0x26')](function(_0xcb4505){if(_0xcb4505){_0x3c88a9=_0xcb4505[_0xd7f2('0x62')];var _0x297463=_0x3c88a9['slice'](-0x1);if(_0x297463==='/'){_0x3c88a9=_0x3c88a9[_0xd7f2('0x63')](0x0,_0x3c88a9['lastIndexOf'](_0x297463));}return rp({'method':_0xd7f2('0x64'),'uri':util[_0xd7f2('0x65')](_0xd7f2('0x66'),_0x3c88a9,_0xd7f2('0x67')),'json':!![],'form':{'method':'login','input_type':_0xd7f2('0x68'),'response_type':_0xd7f2('0x68'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xcb4505[_0xd7f2('0x69')],'password':_0xcb4505[_0xd7f2('0x61')],'encryption':_0xd7f2('0x6a')},'application':_0xd7f2('0x6b')})}});}})[_0xd7f2('0x26')](function(_0x4c79de){if(_0x4c79de&&_0x4c79de[_0xd7f2('0x2b')]!==_0xd7f2('0x6c')&&_0x4c79de[_0xd7f2('0x2b')]!==_0xd7f2('0x6d')){return rp({'method':'POST','uri':util[_0xd7f2('0x65')](_0xd7f2('0x66'),_0x3c88a9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd7f2('0x6e'),'input_type':_0xd7f2('0x68'),'response_type':_0xd7f2('0x68'),'rest_data':JSON[_0xd7f2('0x6f')]({'session':_0x4c79de['id'],'module_name':_0xd7f2('0x70')})}})[_0xd7f2('0x26')](function(_0x295fe5){if(_0x295fe5){var _0x4974e7=_[_0xd7f2('0x71')](_0x295fe5[_0xd7f2('0x72')]);_[_0xd7f2('0x73')](_0x4974e7,function(_0x28002a){return _0x34887c[_0xd7f2('0x74')](_0x28002a[_0xd7f2('0x2b')]);});return{'count':_0x4974e7['length'],'rows':_['map'](_0x4974e7,function(_0x4e8a55){return{'id':_0x4e8a55[_0xd7f2('0x2b')],'name':_0x4e8a55[_0xd7f2('0x75')],'custom':_[_0xd7f2('0x76')](_0x4e8a55['name'],'_c')?!![]:![],'options':_0x4e8a55[_0xd7f2('0x3f')]?_['map'](_[_0xd7f2('0x71')](_0x4e8a55[_0xd7f2('0x3f')]),function(_0x328bec){return{'name':_0x328bec[_0xd7f2('0x77')],'value':_0x328bec[_0xd7f2('0x2b')]};}):[]};})};}})[_0xd7f2('0x26')](respondWithResult(_0x2ee5ce,null))[_0xd7f2('0x43')](function(_0x5b0fab){var _0x444828=_0xac9529[_0xd7f2('0x34')][_0xd7f2('0x78')]?0x1f4:_0x5b0fab[_0xd7f2('0x79')]||0x1f4;logger[_0xd7f2('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd7f2('0x5a'),_0x444828,JSON['stringify'](_0x5b0fab));delete _0x5b0fab['name'];if(_0x444828===0x191){_0x444828=0x190;}_0x2ee5ce[_0xd7f2('0x1a')](_0x444828)['send'](_0xac9529[_0xd7f2('0x34')][_0xd7f2('0x78')]?{'message':_0xd7f2('0x7a'),'statusCode':_0x5b0fab[_0xd7f2('0x79')]}:_0x5b0fab);});}else{var _0x8f7b52=0x1f4;_0x2ee5ce[_0xd7f2('0x1a')](_0x8f7b52)[_0xd7f2('0x2c')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xf98a=['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/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','sendStatus','error','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','getSubjects','channel','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','format','%s%s','login','JSON','stringify','POST','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x78c672,_0x252c61){var _0x3c9232=function(_0x3901fd){while(--_0x3901fd){_0x78c672['push'](_0x78c672['shift']());}};_0x3c9232(++_0x252c61);}(_0xf98a,0x162));var _0xaf98=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0xf98a[_0x5e6bec];return _0x5dc5cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf98('0x0'));var jsonpatch=require(_0xaf98('0x1'));var rp=require(_0xaf98('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaf98('0x3'));var util=require('util');var path=require(_0xaf98('0x4'));var sox=require(_0xaf98('0x5'));var csv=require(_0xaf98('0x6'));var ejs=require(_0xaf98('0x7'));var fs=require('fs');var fs_extra=require(_0xaf98('0x8'));var _=require(_0xaf98('0x9'));var squel=require(_0xaf98('0xa'));var crypto=require(_0xaf98('0xb'));var jsforce=require(_0xaf98('0xc'));var deskjs=require(_0xaf98('0xd'));var toCsv=require(_0xaf98('0x6'));var querystring=require(_0xaf98('0xe'));var Papa=require(_0xaf98('0xf'));var Redis=require('ioredis');var authService=require(_0xaf98('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaf98('0x11'));var hardwareService=require(_0xaf98('0x12'));var logger=require(_0xaf98('0x13'))(_0xaf98('0x14'));var utils=require(_0xaf98('0x15'));var config=require(_0xaf98('0x16'));var licenseUtil=require(_0xaf98('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xaf98('0x18'));function respondWithStatusCode(_0x3e1477,_0x5d54ca){_0x5d54ca=_0x5d54ca||0xcc;return function(_0xe8dc40){if(_0xe8dc40){return _0x3e1477['sendStatus'](_0x5d54ca);}return _0x3e1477['status'](_0x5d54ca)['end']();};}function respondWithResult(_0x5cb3b4,_0x20e7ba){_0x20e7ba=_0x20e7ba||0xc8;return function(_0x553fe1){if(_0x553fe1){return _0x5cb3b4[_0xaf98('0x19')](_0x20e7ba)[_0xaf98('0x1a')](_0x553fe1);}};}function respondWithFilteredResult(_0x29f233,_0x9d153d){return function(_0x30b745){if(_0x30b745){var _0x1ec909=typeof _0x9d153d['offset']===_0xaf98('0x1b')&&typeof _0x9d153d[_0xaf98('0x1c')]==='undefined';var _0x2d6700=_0x30b745[_0xaf98('0x1d')];var _0xbd96=_0x1ec909?0x0:_0x9d153d['offset'];var _0x479284=_0x1ec909?_0x30b745[_0xaf98('0x1d')]:_0x9d153d[_0xaf98('0x1e')]+_0x9d153d[_0xaf98('0x1c')];var _0x11a12b;if(_0x479284>=_0x2d6700){_0x479284=_0x2d6700;_0x11a12b=0xc8;}else{_0x11a12b=0xce;}_0x29f233['status'](_0x11a12b);return _0x29f233[_0xaf98('0x1f')](_0xaf98('0x20'),_0xbd96+'-'+_0x479284+'/'+_0x2d6700)['json'](_0x30b745);}return null;};}function patchUpdates(_0x5d3296){return function(_0x4341f4){try{jsonpatch[_0xaf98('0x21')](_0x4341f4,_0x5d3296,!![]);}catch(_0x2d0f09){return BPromise['reject'](_0x2d0f09);}return _0x4341f4[_0xaf98('0x22')]();};}function saveUpdates(_0x15e63f,_0x53e96e){return function(_0x5199a2){if(_0x5199a2){return _0x5199a2['update'](_0x15e63f)[_0xaf98('0x23')](function(_0x336c89){return _0x336c89;});}return null;};}function removeEntity(_0x1af81d,_0x413c8b){return function(_0x36225b){if(_0x36225b){return _0x36225b[_0xaf98('0x24')]()[_0xaf98('0x23')](function(){_0x1af81d['status'](0xcc)[_0xaf98('0x25')]();});}};}function handleEntityNotFound(_0x5c0435,_0x1a9626){return function(_0x48dc1d){if(!_0x48dc1d){_0x5c0435[_0xaf98('0x26')](0x194);}return _0x48dc1d;};}function handleError(_0x45396,_0x59a416){_0x59a416=_0x59a416||0x1f4;return function(_0x2b724c){logger[_0xaf98('0x27')](_0x2b724c['stack']);if(_0x2b724c[_0xaf98('0x28')]){delete _0x2b724c[_0xaf98('0x28')];}_0x45396[_0xaf98('0x19')](_0x59a416)[_0xaf98('0x29')](_0x2b724c);};}exports[_0xaf98('0x2a')]=function(_0x3aa8d0,_0x27af52){var _0x4bfd15={},_0x4b6303={},_0x562484={'count':0x0,'rows':[]};var _0x45af19=_['map'](db[_0xaf98('0x2b')][_0xaf98('0x2c')],function(_0x3ced32){return{'name':_0x3ced32[_0xaf98('0x2d')],'type':_0x3ced32[_0xaf98('0x2e')]['key']};});_0x4b6303[_0xaf98('0x2f')]=_[_0xaf98('0x30')](_0x45af19,_0xaf98('0x28'));_0x4b6303['query']=_[_0xaf98('0x31')](_0x3aa8d0['query']);_0x4b6303[_0xaf98('0x32')]=_[_0xaf98('0x33')](_0x4b6303[_0xaf98('0x2f')],_0x4b6303[_0xaf98('0x34')]);_0x4bfd15[_0xaf98('0x35')]=_[_0xaf98('0x33')](_0x4b6303[_0xaf98('0x2f')],qs['fields'](_0x3aa8d0[_0xaf98('0x34')][_0xaf98('0x36')]));_0x4bfd15[_0xaf98('0x35')]=_0x4bfd15[_0xaf98('0x35')]['length']?_0x4bfd15[_0xaf98('0x35')]:_0x4b6303[_0xaf98('0x2f')];if(!_0x3aa8d0['query'][_0xaf98('0x37')](_0xaf98('0x38'))){_0x4bfd15[_0xaf98('0x1c')]=qs[_0xaf98('0x1c')](_0x3aa8d0[_0xaf98('0x34')][_0xaf98('0x1c')]);_0x4bfd15[_0xaf98('0x1e')]=qs['offset'](_0x3aa8d0[_0xaf98('0x34')][_0xaf98('0x1e')]);}_0x4bfd15['order']=qs[_0xaf98('0x39')](_0x3aa8d0['query'][_0xaf98('0x39')]);_0x4bfd15[_0xaf98('0x3a')]=qs[_0xaf98('0x32')](_[_0xaf98('0x3b')](_0x3aa8d0[_0xaf98('0x34')],_0x4b6303[_0xaf98('0x32')]),_0x45af19);if(_0x3aa8d0[_0xaf98('0x34')]['filter']){_0x4bfd15[_0xaf98('0x3a')]=_[_0xaf98('0x3c')](_0x4bfd15[_0xaf98('0x3a')],{'$or':_[_0xaf98('0x30')](_0x45af19,function(_0x59dac0){if(_0x59dac0[_0xaf98('0x2e')]!==_0xaf98('0x3d')){var _0x5015b9={};_0x5015b9[_0x59dac0[_0xaf98('0x28')]]={'$like':'%'+_0x3aa8d0[_0xaf98('0x34')][_0xaf98('0x3e')]+'%'};return _0x5015b9;}})});}_0x4bfd15=_['merge']({},_0x4bfd15,_0x3aa8d0[_0xaf98('0x3f')]);var _0x373a71={'where':_0x4bfd15[_0xaf98('0x3a')]};return db[_0xaf98('0x2b')][_0xaf98('0x1d')](_0x373a71)[_0xaf98('0x23')](function(_0x10a948){_0x562484[_0xaf98('0x1d')]=_0x10a948;if(_0x3aa8d0[_0xaf98('0x34')][_0xaf98('0x40')]){_0x4bfd15[_0xaf98('0x41')]=[{'all':!![]}];}return db[_0xaf98('0x2b')][_0xaf98('0x42')](_0x4bfd15);})['then'](function(_0x1f0fa7){_0x562484[_0xaf98('0x43')]=_0x1f0fa7;return _0x562484;})[_0xaf98('0x23')](respondWithFilteredResult(_0x27af52,_0x4bfd15))[_0xaf98('0x44')](handleError(_0x27af52,null));};exports[_0xaf98('0x45')]=function(_0x13dda3,_0x32bdc6){var _0x52d576={'raw':![],'where':{'id':_0x13dda3[_0xaf98('0x46')]['id']}},_0x39b5fd={};_0x39b5fd[_0xaf98('0x2f')]=_['keys'](db[_0xaf98('0x2b')][_0xaf98('0x2c')]);_0x39b5fd[_0xaf98('0x34')]=_[_0xaf98('0x31')](_0x13dda3[_0xaf98('0x34')]);_0x39b5fd['filters']=_['intersection'](_0x39b5fd[_0xaf98('0x2f')],_0x39b5fd[_0xaf98('0x34')]);_0x52d576[_0xaf98('0x35')]=_[_0xaf98('0x33')](_0x39b5fd[_0xaf98('0x2f')],qs['fields'](_0x13dda3[_0xaf98('0x34')][_0xaf98('0x36')]));_0x52d576[_0xaf98('0x35')]=_0x52d576[_0xaf98('0x35')][_0xaf98('0x47')]?_0x52d576[_0xaf98('0x35')]:_0x39b5fd[_0xaf98('0x2f')];if(_0x13dda3[_0xaf98('0x34')][_0xaf98('0x40')]){_0x52d576['include']=[{'all':!![]}];}_0x52d576=_[_0xaf98('0x3c')]({},_0x52d576,_0x13dda3[_0xaf98('0x3f')]);return db[_0xaf98('0x2b')][_0xaf98('0x48')](_0x52d576)[_0xaf98('0x23')](handleEntityNotFound(_0x32bdc6,null))[_0xaf98('0x23')](respondWithResult(_0x32bdc6,null))[_0xaf98('0x44')](handleError(_0x32bdc6,null));};exports[_0xaf98('0x49')]=function(_0x35bb6a,_0x53534b){return db[_0xaf98('0x2b')]['create'](_0x35bb6a[_0xaf98('0x4a')],{})[_0xaf98('0x23')](respondWithResult(_0x53534b,0xc9))[_0xaf98('0x44')](handleError(_0x53534b,null));};exports['update']=function(_0x3592ed,_0x3299e5){if(_0x3592ed[_0xaf98('0x4a')]['id']){delete _0x3592ed[_0xaf98('0x4a')]['id'];}return db['SugarcrmAccount'][_0xaf98('0x48')]({'where':{'id':_0x3592ed[_0xaf98('0x46')]['id']}})[_0xaf98('0x23')](handleEntityNotFound(_0x3299e5,null))[_0xaf98('0x23')](saveUpdates(_0x3592ed[_0xaf98('0x4a')],null))['then'](respondWithResult(_0x3299e5,null))['catch'](handleError(_0x3299e5,null));};exports[_0xaf98('0x24')]=function(_0x15b602,_0x560202){return db['SugarcrmAccount'][_0xaf98('0x48')]({'where':{'id':_0x15b602[_0xaf98('0x46')]['id']}})['then'](handleEntityNotFound(_0x560202,null))['then'](removeEntity(_0x560202,null))['catch'](handleError(_0x560202,null));};exports[_0xaf98('0x4b')]=function(_0xd8b4e2,_0x10ae5d,_0x4da766){var _0x31929d={};var _0x3658c6={};var _0x313a57;var _0x461f1c;return db['SugarcrmAccount'][_0xaf98('0x4c')]({'where':{'id':_0xd8b4e2['params']['id']}})['then'](handleEntityNotFound(_0x10ae5d,null))['then'](function(_0x26cfaa){if(_0x26cfaa){_0x313a57=_0x26cfaa;_0x3658c6[_0xaf98('0x2f')]=_[_0xaf98('0x31')](db[_0xaf98('0x4d')][_0xaf98('0x2c')]);_0x3658c6[_0xaf98('0x34')]=_['keys'](_0xd8b4e2[_0xaf98('0x34')]);_0x3658c6[_0xaf98('0x32')]=_['intersection'](_0x3658c6[_0xaf98('0x2f')],_0x3658c6[_0xaf98('0x34')]);_0x31929d['attributes']=_['intersection'](_0x3658c6[_0xaf98('0x2f')],qs[_0xaf98('0x36')](_0xd8b4e2[_0xaf98('0x34')][_0xaf98('0x36')]));_0x31929d['attributes']=_0x31929d['attributes'][_0xaf98('0x47')]?_0x31929d[_0xaf98('0x35')]:_0x3658c6[_0xaf98('0x2f')];_0x31929d[_0xaf98('0x4e')]=qs['sort'](_0xd8b4e2[_0xaf98('0x34')]['sort']);_0x31929d[_0xaf98('0x3a')]=qs['filters'](_[_0xaf98('0x3b')](_0xd8b4e2[_0xaf98('0x34')],_0x3658c6['filters']));if(_0xd8b4e2[_0xaf98('0x34')][_0xaf98('0x3e')]){_0x31929d['where']=_[_0xaf98('0x3c')](_0x31929d[_0xaf98('0x3a')],{'$or':_[_0xaf98('0x30')](_0x31929d[_0xaf98('0x35')],function(_0x716142){var _0x4cd2e2={};_0x4cd2e2[_0x716142]={'$like':'%'+_0xd8b4e2['query'][_0xaf98('0x3e')]+'%'};return _0x4cd2e2;})});}_0x31929d=_[_0xaf98('0x3c')]({},_0x31929d,_0xd8b4e2[_0xaf98('0x3f')]);return _0x313a57[_0xaf98('0x4b')](_0x31929d);}})['then'](function(_0x51e322){if(_0x51e322){_0x461f1c=_0x51e322['length'];if(!_0xd8b4e2['query'][_0xaf98('0x37')](_0xaf98('0x38'))){_0x31929d[_0xaf98('0x1c')]=qs['limit'](_0xd8b4e2[_0xaf98('0x34')]['limit']);_0x31929d[_0xaf98('0x1e')]=qs[_0xaf98('0x1e')](_0xd8b4e2[_0xaf98('0x34')][_0xaf98('0x1e')]);}return _0x313a57['getConfigurations'](_0x31929d);}})[_0xaf98('0x23')](function(_0x4bff98){if(_0x4bff98){return _0x4bff98?{'count':_0x461f1c,'rows':_0x4bff98}:null;}})['then'](respondWithResult(_0x10ae5d,null))[_0xaf98('0x44')](handleError(_0x10ae5d,null));};exports[_0xaf98('0x4f')]=function(_0x316684,_0x3280a1,_0x488d3){if(_0x316684[_0xaf98('0x4a')]['id']){delete _0x316684[_0xaf98('0x4a')]['id'];}return db[_0xaf98('0x2b')][_0xaf98('0x4c')]({'where':{'id':_0x316684[_0xaf98('0x46')]['id']}})['then'](handleEntityNotFound(_0x3280a1,null))['then'](function(_0x9bb19){if(_0x9bb19){_0x316684[_0xaf98('0x4a')]['AccountId']=_0x9bb19['id'];_0x316684[_0xaf98('0x4a')]['Subjects']=integrations[_0xaf98('0x50')](_0x316684[_0xaf98('0x4a')]['channel'],_0x316684['body'][_0xaf98('0x2e')]);_0x316684[_0xaf98('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x316684['body'][_0xaf98('0x51')],_0x316684[_0xaf98('0x4a')][_0xaf98('0x2e')]);return db['SugarcrmConfiguration'][_0xaf98('0x49')](_0x316684[_0xaf98('0x4a')],{'include':[{'model':db[_0xaf98('0x52')],'as':_0xaf98('0x53')},{'model':db[_0xaf98('0x52')],'as':_0xaf98('0x54')}]});}return null;})[_0xaf98('0x23')](respondWithResult(_0x3280a1,null))[_0xaf98('0x44')](handleError(_0x3280a1,null));};exports[_0xaf98('0x55')]=function(_0xc8c9d8,_0x48bdf8,_0x3d5592){var _0x27e2e4='';var _0x1f1fa5=['id','name',_0xaf98('0x56'),_0xaf98('0x57'),_0xaf98('0x58'),_0xaf98('0x59'),_0xaf98('0x5a'),'duration_minutes',_0xaf98('0x5b'),_0xaf98('0x5c'),_0xaf98('0x5d'),_0xaf98('0x5e')];return db['SugarcrmAccount'][_0xaf98('0x4c')]({'where':{'id':_0xc8c9d8[_0xaf98('0x46')]['id']},'attributes':['id',_0xaf98('0x5f'),_0xaf98('0x60'),_0xaf98('0x61')]})['then'](handleEntityNotFound(_0x48bdf8,null))[_0xaf98('0x23')](function(_0x5495ff){if(_0x5495ff){_0x27e2e4=_0x5495ff[_0xaf98('0x61')];var _0x14bbd2=_0x27e2e4[_0xaf98('0x62')](-0x1);if(_0x14bbd2==='/'){_0x27e2e4=_0x27e2e4['substring'](0x0,_0x27e2e4[_0xaf98('0x63')](_0x14bbd2));}return rp({'method':'POST','uri':util[_0xaf98('0x64')](_0xaf98('0x65'),_0x27e2e4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xaf98('0x66'),'input_type':_0xaf98('0x67'),'response_type':_0xaf98('0x67'),'rest_data':JSON[_0xaf98('0x68')]({'user_auth':{'user_name':_0x5495ff[_0xaf98('0x5f')],'password':_0x5495ff[_0xaf98('0x60')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0xec4acc){if(_0xec4acc&&_0xec4acc[_0xaf98('0x28')]!=='Invalid\x20Login'&&_0xec4acc[_0xaf98('0x28')]!=='Password\x20Expired'){return rp({'method':_0xaf98('0x69'),'uri':util[_0xaf98('0x64')](_0xaf98('0x65'),_0x27e2e4,_0xaf98('0x6a')),'json':!![],'form':{'method':_0xaf98('0x6b'),'input_type':'JSON','response_type':_0xaf98('0x67'),'rest_data':JSON[_0xaf98('0x68')]({'session':_0xec4acc['id'],'module_name':_0xaf98('0x6c')})}})[_0xaf98('0x23')](function(_0x47d78c){if(_0x47d78c){var _0x3e96eb=_[_0xaf98('0x6d')](_0x47d78c[_0xaf98('0x6e')]);_[_0xaf98('0x6f')](_0x3e96eb,function(_0x3a433f){return _0x1f1fa5[_0xaf98('0x70')](_0x3a433f['name']);});return{'count':_0x3e96eb[_0xaf98('0x47')],'rows':_['map'](_0x3e96eb,function(_0x41be72){return{'id':_0x41be72['name'],'name':_0x41be72[_0xaf98('0x71')],'custom':_[_0xaf98('0x72')](_0x41be72[_0xaf98('0x28')],'_c')?!![]:![],'options':_0x41be72[_0xaf98('0x3f')]?_['map'](_[_0xaf98('0x6d')](_0x41be72[_0xaf98('0x3f')]),function(_0x3eebc9){return{'name':_0x3eebc9[_0xaf98('0x73')],'value':_0x3eebc9['name']};}):[]};})};}})[_0xaf98('0x23')](respondWithResult(_0x48bdf8,null))[_0xaf98('0x44')](function(_0x3bb3f9){var _0x5f21a0=_0xc8c9d8['query'][_0xaf98('0x74')]?0x1f4:_0x3bb3f9['statusCode']||0x1f4;logger[_0xaf98('0x27')](_0xaf98('0x75'),_0xaf98('0x55'),_0x5f21a0,JSON[_0xaf98('0x68')](_0x3bb3f9));delete _0x3bb3f9[_0xaf98('0x28')];if(_0x5f21a0===0x191){_0x5f21a0=0x190;}_0x48bdf8[_0xaf98('0x19')](_0x5f21a0)[_0xaf98('0x29')](_0xc8c9d8['query'][_0xaf98('0x74')]?{'message':_0xaf98('0x76'),'statusCode':_0x3bb3f9[_0xaf98('0x77')]}:_0x3bb3f9);});}else{var _0xd8a139=0x1f4;_0x48bdf8[_0xaf98('0x19')](_0xd8a139)[_0xaf98('0x29')]({'message':_0xaf98('0x76'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 5dc9f9f..cd05344 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 _0xdb01=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x44e417,_0x5a32f5){var _0x41456c=function(_0x2949fc){while(--_0x2949fc){_0x44e417['push'](_0x44e417['shift']());}};_0x41456c(++_0x5a32f5);}(_0xdb01,0x16d));var _0x1db0=function(_0x2ace72,_0x814809){_0x2ace72=_0x2ace72-0x0;var _0x33d102=_0xdb01[_0x2ace72];return _0x33d102;};'use strict';var _=require(_0x1db0('0x0'));var util=require(_0x1db0('0x1'));var logger=require(_0x1db0('0x2'))(_0x1db0('0x3'));var moment=require(_0x1db0('0x4'));var BPromise=require(_0x1db0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1db0('0x6'));var rimraf=require(_0x1db0('0x7'));var config=require(_0x1db0('0x8'));var attributes=require(_0x1db0('0x9'));var integrations=require(_0x1db0('0xa'));module[_0x1db0('0xb')]=function(_0x8c7d5d,_0x168ac5){return _0x8c7d5d[_0x1db0('0xc')]('SugarcrmAccount',attributes,{'tableName':_0x1db0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a52=['int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount'];(function(_0x5d4510,_0x5aa2c8){var _0x3dfae0=function(_0x5d5587){while(--_0x5d5587){_0x5d4510['push'](_0x5d4510['shift']());}};_0x3dfae0(++_0x5aa2c8);}(_0x3a52,0x182));var _0x23a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a52[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x23a5('0x0'));var util=require('util');var logger=require(_0x23a5('0x1'))(_0x23a5('0x2'));var moment=require(_0x23a5('0x3'));var BPromise=require(_0x23a5('0x4'));var rp=require(_0x23a5('0x5'));var fs=require('fs');var path=require(_0x23a5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23a5('0x7'));var integrations=require(_0x23a5('0x8'));module['exports']=function(_0x39a369,_0x20ddc8){return _0x39a369['define'](_0x23a5('0x9'),attributes,{'tableName':_0x23a5('0xa'),'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 475c91a..8c852e4 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 _0x675a=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','include','map','model','debug','ShowSugarcrmAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x675a,0x199));var _0xa675=function(_0x27438b,_0x978ecd){_0x27438b=_0x27438b-0x0;var _0xec6b=_0x675a[_0x27438b];return _0xec6b;};'use strict';var _=require(_0xa675('0x0'));var util=require(_0xa675('0x1'));var moment=require('moment');var BPromise=require(_0xa675('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa675('0x3'));var db=require(_0xa675('0x4'))['db'];var utils=require(_0xa675('0x5'));var logger=require(_0xa675('0x6'))(_0xa675('0x7'));var config=require('../../config/environment');var jayson=require(_0xa675('0x8'));var client=jayson[_0xa675('0x9')][_0xa675('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc37642,_0x244607,_0x1cbf1c){return new BPromise(function(_0x290a03,_0x4cf774){return client[_0xa675('0xb')](_0xc37642,_0x1cbf1c)[_0xa675('0xc')](function(_0x4b2a3b){logger[_0xa675('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x244607,'request\x20sent');logger['debug'](_0xa675('0xe'),_0x244607,_0xa675('0xf'),JSON[_0xa675('0x10')](_0x4b2a3b));if(_0x4b2a3b['error']){if(_0x4b2a3b[_0xa675('0x11')]['code']===0x1f4){logger[_0xa675('0x11')](_0xa675('0x12'),_0x244607,_0x4b2a3b[_0xa675('0x11')][_0xa675('0x13')]);return _0x4cf774(_0x4b2a3b[_0xa675('0x11')]['message']);}logger['error'](_0xa675('0x12'),_0x244607,_0x4b2a3b['error'][_0xa675('0x13')]);return _0x290a03(_0x4b2a3b[_0xa675('0x11')][_0xa675('0x13')]);}else{logger[_0xa675('0xd')](_0xa675('0x12'),_0x244607,_0xa675('0xf'));_0x290a03(_0x4b2a3b[_0xa675('0x14')][_0xa675('0x13')]);}})[_0xa675('0x15')](function(_0x1bba48){logger[_0xa675('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x244607,_0x1bba48);_0x4cf774(_0x1bba48);});});}exports[_0xa675('0x16')]=function(_0x1bbc79){var _0x3b6bd6=this;return new Promise(function(_0x80dd7c,_0x1dee02){return db[_0xa675('0x17')][_0xa675('0x18')]({'raw':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')][_0xa675('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')]['where']||null:null,'attributes':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')][_0xa675('0x1b')]||null:null,'limit':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')]['limit']||null:null,'include':_0x1bbc79[_0xa675('0x19')]?_0x1bbc79[_0xa675('0x19')][_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x1bbc79[_0xa675('0x19')][_0xa675('0x1c')],function(_0x1a55ca){return{'model':db[_0x1a55ca['model']],'as':_0x1a55ca['as'],'attributes':_0x1a55ca[_0xa675('0x1b')],'include':_0x1a55ca[_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x1a55ca['include'],function(_0x428586){return{'model':db[_0x428586[_0xa675('0x1e')]],'as':_0x428586['as'],'attributes':_0x428586[_0xa675('0x1b')],'include':_0x428586[_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x428586['include'],function(_0x5a4554){return{'model':db[_0x5a4554['model']],'as':_0x5a4554['as'],'attributes':_0x5a4554['attributes']};}):[]};}):[]};}):[]:[]})[_0xa675('0xc')](function(_0x257977){logger[_0xa675('0xd')](_0xa675('0x16'),_0x1bbc79);logger[_0xa675('0x1f')](_0xa675('0x16'),_0x1bbc79,JSON['stringify'](_0x257977));_0x80dd7c(_0x257977);})[_0xa675('0x15')](function(_0x1b1993){logger['error']('GetSugarcrmAccount',_0x1b1993['message'],_0x1bbc79);_0x1dee02(_0x3b6bd6[_0xa675('0x11')](0x1f4,_0x1b1993['message']));});});};exports[_0xa675('0x20')]=function(_0x1683ca){var _0x21753f=this;return new Promise(function(_0x3ca5cd,_0x13004c){return db[_0xa675('0x17')]['find']({'raw':_0x1683ca[_0xa675('0x19')]?_0x1683ca[_0xa675('0x19')][_0xa675('0x1a')]===undefined?!![]:![]:!![],'where':_0x1683ca[_0xa675('0x19')]?_0x1683ca[_0xa675('0x19')]['where']||null:null,'attributes':_0x1683ca['options']?_0x1683ca[_0xa675('0x19')][_0xa675('0x1b')]||null:null,'include':_0x1683ca[_0xa675('0x19')]?_0x1683ca['options'][_0xa675('0x1c')]?_[_0xa675('0x1d')](_0x1683ca[_0xa675('0x19')][_0xa675('0x1c')],function(_0xb8a4dc){return{'model':db[_0xb8a4dc[_0xa675('0x1e')]],'as':_0xb8a4dc['as'],'attributes':_0xb8a4dc[_0xa675('0x1b')],'include':_0xb8a4dc[_0xa675('0x1c')]?_[_0xa675('0x1d')](_0xb8a4dc[_0xa675('0x1c')],function(_0x1ef067){return{'model':db[_0x1ef067[_0xa675('0x1e')]],'as':_0x1ef067['as'],'attributes':_0x1ef067[_0xa675('0x1b')],'include':_0x1ef067['include']?_[_0xa675('0x1d')](_0x1ef067['include'],function(_0x27723a){return{'model':db[_0x27723a['model']],'as':_0x27723a['as'],'attributes':_0x27723a[_0xa675('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa675('0xc')](function(_0x40ebe6){logger[_0xa675('0xd')](_0xa675('0x20'),_0x1683ca);logger[_0xa675('0x1f')](_0xa675('0x20'),_0x1683ca,JSON[_0xa675('0x10')](_0x40ebe6));_0x3ca5cd(_0x40ebe6);})[_0xa675('0x15')](function(_0x5d15ae){logger['error'](_0xa675('0x20'),_0x5d15ae[_0xa675('0x13')],_0x1683ca);_0x13004c(_0x21753f[_0xa675('0x11')](0x1f4,_0x5d15ae['message']));});});}; \ No newline at end of file +var _0x539f=['where','limit','include','model','map','attributes','stringify','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','http','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','raw','options'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x539f,0x89));var _0xf539=function(_0x23eefd,_0x2ebce5){_0x23eefd=_0x23eefd-0x0;var _0x3aa7cb=_0x539f[_0x23eefd];return _0x3aa7cb;};'use strict';var _=require(_0xf539('0x0'));var util=require(_0xf539('0x1'));var moment=require(_0xf539('0x2'));var BPromise=require(_0xf539('0x3'));var rs=require(_0xf539('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf539('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf539('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf539('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d05ca,_0x41cc9f,_0x23d606){return new BPromise(function(_0x4dbaf2,_0x29b314){return client['request'](_0x3d05ca,_0x23d606)[_0xf539('0x8')](function(_0x41a265){logger[_0xf539('0x9')](_0xf539('0xa'),_0x41cc9f,'request\x20sent');logger[_0xf539('0xb')](_0xf539('0xc'),_0x41cc9f,_0xf539('0xd'),JSON['stringify'](_0x41a265));if(_0x41a265[_0xf539('0xe')]){if(_0x41a265[_0xf539('0xe')][_0xf539('0xf')]===0x1f4){logger[_0xf539('0xe')](_0xf539('0xa'),_0x41cc9f,_0x41a265['error']['message']);return _0x29b314(_0x41a265['error'][_0xf539('0x10')]);}logger[_0xf539('0xe')](_0xf539('0xa'),_0x41cc9f,_0x41a265[_0xf539('0xe')][_0xf539('0x10')]);return _0x4dbaf2(_0x41a265[_0xf539('0xe')][_0xf539('0x10')]);}else{logger['info'](_0xf539('0xa'),_0x41cc9f,_0xf539('0xd'));_0x4dbaf2(_0x41a265['result'][_0xf539('0x10')]);}})[_0xf539('0x11')](function(_0x2b432e){logger[_0xf539('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x41cc9f,_0x2b432e);_0x29b314(_0x2b432e);});});}exports[_0xf539('0x12')]=function(_0x1b67cd){var _0x4cd73d=this;return new Promise(function(_0x541484,_0x3731b4){return db[_0xf539('0x13')][_0xf539('0x14')]({'raw':_0x1b67cd['options']?_0x1b67cd['options'][_0xf539('0x15')]===undefined?!![]:![]:!![],'where':_0x1b67cd[_0xf539('0x16')]?_0x1b67cd[_0xf539('0x16')][_0xf539('0x17')]||null:null,'attributes':_0x1b67cd[_0xf539('0x16')]?_0x1b67cd[_0xf539('0x16')]['attributes']||null:null,'limit':_0x1b67cd[_0xf539('0x16')]?_0x1b67cd[_0xf539('0x16')][_0xf539('0x18')]||null:null,'include':_0x1b67cd[_0xf539('0x16')]?_0x1b67cd[_0xf539('0x16')][_0xf539('0x19')]?_['map'](_0x1b67cd[_0xf539('0x16')][_0xf539('0x19')],function(_0x3c05e2){return{'model':db[_0x3c05e2[_0xf539('0x1a')]],'as':_0x3c05e2['as'],'attributes':_0x3c05e2['attributes'],'include':_0x3c05e2[_0xf539('0x19')]?_[_0xf539('0x1b')](_0x3c05e2[_0xf539('0x19')],function(_0x24ba38){return{'model':db[_0x24ba38[_0xf539('0x1a')]],'as':_0x24ba38['as'],'attributes':_0x24ba38[_0xf539('0x1c')],'include':_0x24ba38['include']?_[_0xf539('0x1b')](_0x24ba38[_0xf539('0x19')],function(_0x182dfd){return{'model':db[_0x182dfd[_0xf539('0x1a')]],'as':_0x182dfd['as'],'attributes':_0x182dfd[_0xf539('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf539('0x8')](function(_0x19b826){logger[_0xf539('0x9')]('GetSugarcrmAccount',_0x1b67cd);logger[_0xf539('0xb')](_0xf539('0x12'),_0x1b67cd,JSON[_0xf539('0x1d')](_0x19b826));_0x541484(_0x19b826);})[_0xf539('0x11')](function(_0x25fbc7){logger['error'](_0xf539('0x12'),_0x25fbc7[_0xf539('0x10')],_0x1b67cd);_0x3731b4(_0x4cd73d[_0xf539('0xe')](0x1f4,_0x25fbc7[_0xf539('0x10')]));});});};exports[_0xf539('0x1e')]=function(_0xfbb750){var _0x367e08=this;return new Promise(function(_0x28f8a6,_0xc28ae8){return db[_0xf539('0x13')][_0xf539('0x1f')]({'raw':_0xfbb750[_0xf539('0x16')]?_0xfbb750[_0xf539('0x16')][_0xf539('0x15')]===undefined?!![]:![]:!![],'where':_0xfbb750[_0xf539('0x16')]?_0xfbb750[_0xf539('0x16')]['where']||null:null,'attributes':_0xfbb750[_0xf539('0x16')]?_0xfbb750[_0xf539('0x16')][_0xf539('0x1c')]||null:null,'include':_0xfbb750[_0xf539('0x16')]?_0xfbb750[_0xf539('0x16')][_0xf539('0x19')]?_[_0xf539('0x1b')](_0xfbb750[_0xf539('0x16')][_0xf539('0x19')],function(_0x16e218){return{'model':db[_0x16e218[_0xf539('0x1a')]],'as':_0x16e218['as'],'attributes':_0x16e218[_0xf539('0x1c')],'include':_0x16e218[_0xf539('0x19')]?_[_0xf539('0x1b')](_0x16e218[_0xf539('0x19')],function(_0x542c27){return{'model':db[_0x542c27[_0xf539('0x1a')]],'as':_0x542c27['as'],'attributes':_0x542c27[_0xf539('0x1c')],'include':_0x542c27['include']?_[_0xf539('0x1b')](_0x542c27[_0xf539('0x19')],function(_0x4de8d7){return{'model':db[_0x4de8d7['model']],'as':_0x4de8d7['as'],'attributes':_0x4de8d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f7f33){logger[_0xf539('0x9')](_0xf539('0x1e'),_0xfbb750);logger[_0xf539('0xb')](_0xf539('0x1e'),_0xfbb750,JSON['stringify'](_0x3f7f33));_0x28f8a6(_0x3f7f33);})[_0xf539('0x11')](function(_0x49e57d){logger['error']('ShowSugarcrmAccount',_0x49e57d[_0xf539('0x10')],_0xfbb750);_0xc28ae8(_0x367e08[_0xf539('0xe')](0x1f4,_0x49e57d[_0xf539('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 895be74..4bc6ef5 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 _0x87c6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','multer','util','connect-timeout','express'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x87c6,0x104));var _0x687c=function(_0x478c25,_0x35cf71){_0x478c25=_0x478c25-0x0;var _0x638553=_0x87c6[_0x478c25];return _0x638553;};'use strict';var multer=require(_0x687c('0x0'));var util=require(_0x687c('0x1'));var path=require('path');var timeout=require(_0x687c('0x2'));var express=require(_0x687c('0x3'));var router=express[_0x687c('0x4')]();var fs_extra=require(_0x687c('0x5'));var auth=require(_0x687c('0x6'));var interaction=require(_0x687c('0x7'));var config=require(_0x687c('0x8'));var controller=require(_0x687c('0x9'));router[_0x687c('0xa')]('/',auth[_0x687c('0xb')](),controller[_0x687c('0xc')]);router['get'](_0x687c('0xd'),auth[_0x687c('0xb')](),controller[_0x687c('0xe')]);router[_0x687c('0xa')](_0x687c('0xf'),auth[_0x687c('0xb')](),controller[_0x687c('0x10')]);router['get'](_0x687c('0x11'),auth[_0x687c('0xb')](),controller[_0x687c('0x12')]);router[_0x687c('0xa')]('/:id/descriptions',auth[_0x687c('0xb')](),controller[_0x687c('0x13')]);router[_0x687c('0x14')]('/',auth[_0x687c('0xb')](),controller[_0x687c('0x15')]);router['put'](_0x687c('0xd'),auth[_0x687c('0xb')](),controller[_0x687c('0x16')]);router['delete']('/:id',auth[_0x687c('0xb')](),controller[_0x687c('0x17')]);module['exports']=router; \ No newline at end of file +var _0x4cdf=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','/:id','update','destroy','exports'];(function(_0x33de47,_0xd91e63){var _0x102d23=function(_0x1268b){while(--_0x1268b){_0x33de47['push'](_0x33de47['shift']());}};_0x102d23(++_0xd91e63);}(_0x4cdf,0x180));var _0xf4cd=function(_0x4abdcd,_0x52dcc3){_0x4abdcd=_0x4abdcd-0x0;var _0x1aef0c=_0x4cdf[_0x4abdcd];return _0x1aef0c;};'use strict';var multer=require(_0xf4cd('0x0'));var util=require(_0xf4cd('0x1'));var path=require(_0xf4cd('0x2'));var timeout=require(_0xf4cd('0x3'));var express=require(_0xf4cd('0x4'));var router=express[_0xf4cd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4cd('0x6'));var interaction=require(_0xf4cd('0x7'));var config=require('../../config/environment');var controller=require(_0xf4cd('0x8'));router[_0xf4cd('0x9')]('/',auth[_0xf4cd('0xa')](),controller[_0xf4cd('0xb')]);router[_0xf4cd('0x9')]('/:id',auth[_0xf4cd('0xa')](),controller[_0xf4cd('0xc')]);router[_0xf4cd('0x9')](_0xf4cd('0xd'),auth['isAuthenticated'](),controller[_0xf4cd('0xe')]);router[_0xf4cd('0x9')](_0xf4cd('0xf'),auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x10')]);router[_0xf4cd('0x9')](_0xf4cd('0x11'),auth['isAuthenticated'](),controller[_0xf4cd('0x12')]);router[_0xf4cd('0x13')]('/',auth[_0xf4cd('0xa')](),controller['create']);router['put'](_0xf4cd('0x14'),auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x15')]);router['delete'](_0xf4cd('0x14'),auth[_0xf4cd('0xa')](),controller[_0xf4cd('0x16')]);module[_0xf4cd('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 5572e01..140ef7d 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 _0x9b51=['sequelize','exports','STRING'];(function(_0x4d4150,_0x457770){var _0x2fff47=function(_0x3bf624){while(--_0x3bf624){_0x4d4150['push'](_0x4d4150['shift']());}};_0x2fff47(++_0x457770);}(_0x9b51,0x1c5));var _0x19b5=function(_0x3959f2,_0x80ed23){_0x3959f2=_0x3959f2-0x0;var _0x4e68d7=_0x9b51[_0x3959f2];return _0x4e68d7;};'use strict';var Sequelize=require(_0x19b5('0x0'));module[_0x19b5('0x1')]={'name':{'type':Sequelize[_0x19b5('0x2')]},'description':{'type':Sequelize[_0x19b5('0x2')]}}; \ No newline at end of file +var _0x412b=['STRING'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x412b,0xae));var _0xb412=function(_0x21d27e,_0x34f6fe){_0x21d27e=_0x21d27e-0x0;var _0x20837e=_0x412b[_0x21d27e];return _0x20837e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb412('0x0')]},'description':{'type':Sequelize[_0xb412('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 09405be..fc5fb20 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 _0xa981=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','findOne','getFields','getSubjects','getDescriptions','SugarcrmField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto'];(function(_0x1932fe,_0x2ed263){var _0x49c8b2=function(_0x564358){while(--_0x564358){_0x1932fe['push'](_0x1932fe['shift']());}};_0x49c8b2(++_0x2ed263);}(_0xa981,0x13b));var _0x1a98=function(_0x5ea7a8,_0x257068){_0x5ea7a8=_0x5ea7a8-0x0;var _0x1b2e3a=_0xa981[_0x5ea7a8];return _0x1b2e3a;};'use strict';var emlformat=require(_0x1a98('0x0'));var rimraf=require(_0x1a98('0x1'));var zipdir=require(_0x1a98('0x2'));var jsonpatch=require(_0x1a98('0x3'));var rp=require(_0x1a98('0x4'));var moment=require(_0x1a98('0x5'));var BPromise=require(_0x1a98('0x6'));var Mustache=require(_0x1a98('0x7'));var util=require('util');var path=require(_0x1a98('0x8'));var sox=require('sox');var csv=require(_0x1a98('0x9'));var ejs=require(_0x1a98('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a98('0xb'));var crypto=require(_0x1a98('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a98('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a98('0xe'));var Redis=require(_0x1a98('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1a98('0x10'));var as=require(_0x1a98('0x11'));var hardwareService=require(_0x1a98('0x12'));var logger=require(_0x1a98('0x13'))(_0x1a98('0x14'));var utils=require(_0x1a98('0x15'));var config=require(_0x1a98('0x16'));var licenseUtil=require(_0x1a98('0x17'));var db=require(_0x1a98('0x18'))['db'];function respondWithStatusCode(_0x687947,_0x459ffb){_0x459ffb=_0x459ffb||0xcc;return function(_0x22f5fb){if(_0x22f5fb){return _0x687947['sendStatus'](_0x459ffb);}return _0x687947[_0x1a98('0x19')](_0x459ffb)['end']();};}function respondWithResult(_0x15a823,_0x10be1c){_0x10be1c=_0x10be1c||0xc8;return function(_0x52b652){if(_0x52b652){return _0x15a823['status'](_0x10be1c)[_0x1a98('0x1a')](_0x52b652);}};}function respondWithFilteredResult(_0x7f0605,_0x553981){return function(_0xbdcc3e){if(_0xbdcc3e){var _0x10995e=typeof _0x553981[_0x1a98('0x1b')]===_0x1a98('0x1c')&&typeof _0x553981[_0x1a98('0x1d')]===_0x1a98('0x1c');var _0x2758da=_0xbdcc3e[_0x1a98('0x1e')];var _0x4df19e=_0x10995e?0x0:_0x553981[_0x1a98('0x1b')];var _0x1cc4e3=_0x10995e?_0xbdcc3e[_0x1a98('0x1e')]:_0x553981[_0x1a98('0x1b')]+_0x553981[_0x1a98('0x1d')];var _0x5acd92;if(_0x1cc4e3>=_0x2758da){_0x1cc4e3=_0x2758da;_0x5acd92=0xc8;}else{_0x5acd92=0xce;}_0x7f0605['status'](_0x5acd92);return _0x7f0605['set']('Content-Range',_0x4df19e+'-'+_0x1cc4e3+'/'+_0x2758da)[_0x1a98('0x1a')](_0xbdcc3e);}return null;};}function patchUpdates(_0x14c6a8){return function(_0x34edb5){try{jsonpatch[_0x1a98('0x1f')](_0x34edb5,_0x14c6a8,!![]);}catch(_0x3a1eb4){return BPromise['reject'](_0x3a1eb4);}return _0x34edb5[_0x1a98('0x20')]();};}function saveUpdates(_0x4b81f2,_0x201dc4){return function(_0x111dfd){if(_0x111dfd){return _0x111dfd[_0x1a98('0x21')](_0x4b81f2)['then'](function(_0x31c85f){return _0x31c85f;});}return null;};}function removeEntity(_0x259c68,_0x5609a1){return function(_0x4d8cf9){if(_0x4d8cf9){return _0x4d8cf9[_0x1a98('0x22')]()[_0x1a98('0x23')](function(){_0x259c68[_0x1a98('0x19')](0xcc)[_0x1a98('0x24')]();});}};}function handleEntityNotFound(_0x4392dc,_0x2e4d75){return function(_0x388da1){if(!_0x388da1){_0x4392dc[_0x1a98('0x25')](0x194);}return _0x388da1;};}function handleError(_0x322fcf,_0x445a18){_0x445a18=_0x445a18||0x1f4;return function(_0x3d6f24){logger[_0x1a98('0x26')](_0x3d6f24[_0x1a98('0x27')]);if(_0x3d6f24[_0x1a98('0x28')]){delete _0x3d6f24[_0x1a98('0x28')];}_0x322fcf[_0x1a98('0x19')](_0x445a18)[_0x1a98('0x29')](_0x3d6f24);};}exports[_0x1a98('0x2a')]=function(_0x4f834a,_0x57660f){var _0x5d5bd4={},_0x4cfd9d={},_0xdec4c5={'count':0x0,'rows':[]};var _0x119055=_[_0x1a98('0x2b')](db[_0x1a98('0x2c')]['rawAttributes'],function(_0x600db1){return{'name':_0x600db1[_0x1a98('0x2d')],'type':_0x600db1[_0x1a98('0x2e')][_0x1a98('0x2f')]};});_0x4cfd9d[_0x1a98('0x30')]=_[_0x1a98('0x2b')](_0x119055,'name');_0x4cfd9d['query']=_[_0x1a98('0x31')](_0x4f834a[_0x1a98('0x32')]);_0x4cfd9d[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x4cfd9d[_0x1a98('0x30')],_0x4cfd9d['query']);_0x5d5bd4[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x4cfd9d[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x4f834a['query']['fields']));_0x5d5bd4[_0x1a98('0x35')]=_0x5d5bd4[_0x1a98('0x35')][_0x1a98('0x37')]?_0x5d5bd4[_0x1a98('0x35')]:_0x4cfd9d[_0x1a98('0x30')];if(!_0x4f834a[_0x1a98('0x32')][_0x1a98('0x38')](_0x1a98('0x39'))){_0x5d5bd4[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x4f834a[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x5d5bd4['offset']=qs['offset'](_0x4f834a['query'][_0x1a98('0x1b')]);}_0x5d5bd4[_0x1a98('0x3a')]=qs[_0x1a98('0x3b')](_0x4f834a[_0x1a98('0x32')]['sort']);_0x5d5bd4[_0x1a98('0x3c')]=qs[_0x1a98('0x33')](_[_0x1a98('0x3d')](_0x4f834a['query'],_0x4cfd9d[_0x1a98('0x33')]),_0x119055);if(_0x4f834a['query'][_0x1a98('0x3e')]){_0x5d5bd4[_0x1a98('0x3c')]=_[_0x1a98('0x3f')](_0x5d5bd4[_0x1a98('0x3c')],{'$or':_[_0x1a98('0x2b')](_0x119055,function(_0x1058e4){if(_0x1058e4[_0x1a98('0x2e')]!==_0x1a98('0x40')){var _0x43d6bd={};_0x43d6bd[_0x1058e4[_0x1a98('0x28')]]={'$like':'%'+_0x4f834a[_0x1a98('0x32')]['filter']+'%'};return _0x43d6bd;}})});}_0x5d5bd4=_[_0x1a98('0x3f')]({},_0x5d5bd4,_0x4f834a['options']);var _0x44c64c={'where':_0x5d5bd4[_0x1a98('0x3c')]};return db[_0x1a98('0x2c')][_0x1a98('0x1e')](_0x44c64c)[_0x1a98('0x23')](function(_0x3e8c94){_0xdec4c5[_0x1a98('0x1e')]=_0x3e8c94;if(_0x4f834a['query'][_0x1a98('0x41')]){_0x5d5bd4[_0x1a98('0x42')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1a98('0x43')](_0x5d5bd4);})['then'](function(_0x4e24b0){_0xdec4c5[_0x1a98('0x44')]=_0x4e24b0;return _0xdec4c5;})['then'](respondWithFilteredResult(_0x57660f,_0x5d5bd4))[_0x1a98('0x45')](handleError(_0x57660f,null));};exports[_0x1a98('0x46')]=function(_0x2df9b9,_0xf575ba){var _0x96c968={'raw':![],'where':{'id':_0x2df9b9[_0x1a98('0x47')]['id']}},_0x13e88d={};_0x13e88d[_0x1a98('0x30')]=_[_0x1a98('0x31')](db[_0x1a98('0x2c')][_0x1a98('0x48')]);_0x13e88d[_0x1a98('0x32')]=_['keys'](_0x2df9b9[_0x1a98('0x32')]);_0x13e88d[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x13e88d['model'],_0x13e88d[_0x1a98('0x32')]);_0x96c968[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x13e88d['model'],qs[_0x1a98('0x36')](_0x2df9b9['query']['fields']));_0x96c968['attributes']=_0x96c968[_0x1a98('0x35')][_0x1a98('0x37')]?_0x96c968[_0x1a98('0x35')]:_0x13e88d[_0x1a98('0x30')];if(_0x2df9b9['query'][_0x1a98('0x41')]){_0x96c968['include']=[{'all':!![]}];}_0x96c968=_[_0x1a98('0x3f')]({},_0x96c968,_0x2df9b9[_0x1a98('0x49')]);return db['SugarcrmConfiguration']['find'](_0x96c968)[_0x1a98('0x23')](handleEntityNotFound(_0xf575ba,null))['then'](respondWithResult(_0xf575ba,null))[_0x1a98('0x45')](handleError(_0xf575ba,null));};exports[_0x1a98('0x4a')]=function(_0x4e2636,_0x46a282){return db[_0x1a98('0x2c')][_0x1a98('0x4a')](_0x4e2636[_0x1a98('0x4b')],{})[_0x1a98('0x23')](respondWithResult(_0x46a282,0xc9))['catch'](handleError(_0x46a282,null));};exports[_0x1a98('0x21')]=function(_0x421f92,_0x15dcd3){if(_0x421f92['body']['id']){delete _0x421f92[_0x1a98('0x4b')]['id'];}return db['SugarcrmConfiguration'][_0x1a98('0x4c')]({'where':{'id':_0x421f92[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0x15dcd3,null))['then'](saveUpdates(_0x421f92[_0x1a98('0x4b')],null))[_0x1a98('0x23')](respondWithResult(_0x15dcd3,null))[_0x1a98('0x45')](handleError(_0x15dcd3,null));};exports[_0x1a98('0x22')]=function(_0x15dbde,_0x57ca59){return db[_0x1a98('0x2c')][_0x1a98('0x4c')]({'where':{'id':_0x15dbde[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0x57ca59,null))[_0x1a98('0x23')](removeEntity(_0x57ca59,null))[_0x1a98('0x45')](handleError(_0x57ca59,null));};exports['getFields']=function(_0x51dc25,_0xd43693,_0x10a8aa){var _0x3b46ea={};var _0x257fc4={};var _0x1071a8;var _0x426e3a;return db['SugarcrmConfiguration'][_0x1a98('0x4d')]({'where':{'id':_0x51dc25[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0xd43693,null))[_0x1a98('0x23')](function(_0x4f24c6){if(_0x4f24c6){_0x1071a8=_0x4f24c6;_0x257fc4[_0x1a98('0x30')]=_['keys'](db['SugarcrmField'][_0x1a98('0x48')]);_0x257fc4[_0x1a98('0x32')]=_[_0x1a98('0x31')](_0x51dc25[_0x1a98('0x32')]);_0x257fc4[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x257fc4[_0x1a98('0x30')],_0x257fc4[_0x1a98('0x32')]);_0x3b46ea[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x257fc4[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x36')]));_0x3b46ea[_0x1a98('0x35')]=_0x3b46ea['attributes']['length']?_0x3b46ea[_0x1a98('0x35')]:_0x257fc4['model'];_0x3b46ea[_0x1a98('0x3a')]=qs[_0x1a98('0x3b')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x3b')]);_0x3b46ea[_0x1a98('0x3c')]=qs['filters'](_[_0x1a98('0x3d')](_0x51dc25[_0x1a98('0x32')],_0x257fc4['filters']));if(_0x51dc25[_0x1a98('0x32')]['filter']){_0x3b46ea[_0x1a98('0x3c')]=_[_0x1a98('0x3f')](_0x3b46ea[_0x1a98('0x3c')],{'$or':_[_0x1a98('0x2b')](_0x3b46ea[_0x1a98('0x35')],function(_0x2e412e){var _0x494a30={};_0x494a30[_0x2e412e]={'$like':'%'+_0x51dc25['query'][_0x1a98('0x3e')]+'%'};return _0x494a30;})});}_0x3b46ea=_[_0x1a98('0x3f')]({},_0x3b46ea,_0x51dc25[_0x1a98('0x49')]);return _0x1071a8[_0x1a98('0x4e')](_0x3b46ea);}})[_0x1a98('0x23')](function(_0x1e031e){if(_0x1e031e){_0x426e3a=_0x1e031e[_0x1a98('0x37')];if(!_0x51dc25[_0x1a98('0x32')]['hasOwnProperty'](_0x1a98('0x39'))){_0x3b46ea[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x3b46ea[_0x1a98('0x1b')]=qs[_0x1a98('0x1b')](_0x51dc25[_0x1a98('0x32')][_0x1a98('0x1b')]);}return _0x1071a8[_0x1a98('0x4e')](_0x3b46ea);}})[_0x1a98('0x23')](function(_0x37b30a){if(_0x37b30a){return _0x37b30a?{'count':_0x426e3a,'rows':_0x37b30a}:null;}})[_0x1a98('0x23')](respondWithResult(_0xd43693,null))[_0x1a98('0x45')](handleError(_0xd43693,null));};exports[_0x1a98('0x4f')]=function(_0x472550,_0x339769,_0x51f23d){var _0x2ffe6d={};var _0x11a5a5={};var _0x559b16;var _0x3601e7;return db[_0x1a98('0x2c')][_0x1a98('0x4d')]({'where':{'id':_0x472550['params']['id']}})['then'](handleEntityNotFound(_0x339769,null))[_0x1a98('0x23')](function(_0x29cbac){if(_0x29cbac){_0x559b16=_0x29cbac;_0x11a5a5[_0x1a98('0x30')]=_[_0x1a98('0x31')](db['SugarcrmField'][_0x1a98('0x48')]);_0x11a5a5[_0x1a98('0x32')]=_['keys'](_0x472550['query']);_0x11a5a5[_0x1a98('0x33')]=_[_0x1a98('0x34')](_0x11a5a5[_0x1a98('0x30')],_0x11a5a5[_0x1a98('0x32')]);_0x2ffe6d['attributes']=_[_0x1a98('0x34')](_0x11a5a5[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x472550[_0x1a98('0x32')]['fields']));_0x2ffe6d[_0x1a98('0x35')]=_0x2ffe6d[_0x1a98('0x35')][_0x1a98('0x37')]?_0x2ffe6d[_0x1a98('0x35')]:_0x11a5a5[_0x1a98('0x30')];_0x2ffe6d[_0x1a98('0x3a')]=qs['sort'](_0x472550[_0x1a98('0x32')][_0x1a98('0x3b')]);_0x2ffe6d[_0x1a98('0x3c')]=qs[_0x1a98('0x33')](_[_0x1a98('0x3d')](_0x472550[_0x1a98('0x32')],_0x11a5a5[_0x1a98('0x33')]));if(_0x472550[_0x1a98('0x32')][_0x1a98('0x3e')]){_0x2ffe6d[_0x1a98('0x3c')]=_[_0x1a98('0x3f')](_0x2ffe6d['where'],{'$or':_['map'](_0x2ffe6d[_0x1a98('0x35')],function(_0x95a577){var _0x235482={};_0x235482[_0x95a577]={'$like':'%'+_0x472550[_0x1a98('0x32')][_0x1a98('0x3e')]+'%'};return _0x235482;})});}_0x2ffe6d=_[_0x1a98('0x3f')]({},_0x2ffe6d,_0x472550[_0x1a98('0x49')]);return _0x559b16['getSubjects'](_0x2ffe6d);}})[_0x1a98('0x23')](function(_0x276e33){if(_0x276e33){_0x3601e7=_0x276e33['length'];if(!_0x472550[_0x1a98('0x32')][_0x1a98('0x38')](_0x1a98('0x39'))){_0x2ffe6d[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x472550[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x2ffe6d[_0x1a98('0x1b')]=qs['offset'](_0x472550[_0x1a98('0x32')][_0x1a98('0x1b')]);}return _0x559b16[_0x1a98('0x4f')](_0x2ffe6d);}})[_0x1a98('0x23')](function(_0x209ea9){if(_0x209ea9){return _0x209ea9?{'count':_0x3601e7,'rows':_0x209ea9}:null;}})[_0x1a98('0x23')](respondWithResult(_0x339769,null))[_0x1a98('0x45')](handleError(_0x339769,null));};exports[_0x1a98('0x50')]=function(_0x36b76a,_0x23b046,_0x7f239a){var _0x32cf60={};var _0x3d2e69={};var _0x270d04;var _0x5b9799;return db[_0x1a98('0x2c')]['findOne']({'where':{'id':_0x36b76a[_0x1a98('0x47')]['id']}})[_0x1a98('0x23')](handleEntityNotFound(_0x23b046,null))[_0x1a98('0x23')](function(_0x421987){if(_0x421987){_0x270d04=_0x421987;_0x3d2e69[_0x1a98('0x30')]=_['keys'](db[_0x1a98('0x51')][_0x1a98('0x48')]);_0x3d2e69['query']=_[_0x1a98('0x31')](_0x36b76a[_0x1a98('0x32')]);_0x3d2e69['filters']=_[_0x1a98('0x34')](_0x3d2e69['model'],_0x3d2e69[_0x1a98('0x32')]);_0x32cf60[_0x1a98('0x35')]=_[_0x1a98('0x34')](_0x3d2e69[_0x1a98('0x30')],qs[_0x1a98('0x36')](_0x36b76a[_0x1a98('0x32')]['fields']));_0x32cf60[_0x1a98('0x35')]=_0x32cf60['attributes'][_0x1a98('0x37')]?_0x32cf60[_0x1a98('0x35')]:_0x3d2e69[_0x1a98('0x30')];_0x32cf60['order']=qs[_0x1a98('0x3b')](_0x36b76a[_0x1a98('0x32')][_0x1a98('0x3b')]);_0x32cf60['where']=qs[_0x1a98('0x33')](_[_0x1a98('0x3d')](_0x36b76a['query'],_0x3d2e69[_0x1a98('0x33')]));if(_0x36b76a[_0x1a98('0x32')][_0x1a98('0x3e')]){_0x32cf60['where']=_[_0x1a98('0x3f')](_0x32cf60[_0x1a98('0x3c')],{'$or':_[_0x1a98('0x2b')](_0x32cf60[_0x1a98('0x35')],function(_0x2ef9fe){var _0x5e6a55={};_0x5e6a55[_0x2ef9fe]={'$like':'%'+_0x36b76a[_0x1a98('0x32')][_0x1a98('0x3e')]+'%'};return _0x5e6a55;})});}_0x32cf60=_[_0x1a98('0x3f')]({},_0x32cf60,_0x36b76a[_0x1a98('0x49')]);return _0x270d04[_0x1a98('0x50')](_0x32cf60);}})[_0x1a98('0x23')](function(_0x5c5b5c){if(_0x5c5b5c){_0x5b9799=_0x5c5b5c[_0x1a98('0x37')];if(!_0x36b76a[_0x1a98('0x32')][_0x1a98('0x38')](_0x1a98('0x39'))){_0x32cf60[_0x1a98('0x1d')]=qs[_0x1a98('0x1d')](_0x36b76a[_0x1a98('0x32')][_0x1a98('0x1d')]);_0x32cf60['offset']=qs[_0x1a98('0x1b')](_0x36b76a[_0x1a98('0x32')][_0x1a98('0x1b')]);}return _0x270d04[_0x1a98('0x50')](_0x32cf60);}})[_0x1a98('0x23')](function(_0x357692){if(_0x357692){return _0x357692?{'count':_0x5b9799,'rows':_0x357692}:null;}})[_0x1a98('0x23')](respondWithResult(_0x23b046,null))[_0x1a98('0x45')](handleError(_0x23b046,null));}; \ No newline at end of file +var _0x1eb0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','options','SugarcrmConfiguration','include','findAll','rows','catch','params','includeAll','create','body','find','findOne','SugarcrmField','merge','getFields','hasOwnProperty','getSubjects','getDescriptions','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x3683ec,_0x59069c){var _0x2e5c29=function(_0x3658cb){while(--_0x3658cb){_0x3683ec['push'](_0x3683ec['shift']());}};_0x2e5c29(++_0x59069c);}(_0x1eb0,0xdb));var _0x01eb=function(_0x29f0fd,_0x27e131){_0x29f0fd=_0x29f0fd-0x0;var _0x4492b1=_0x1eb0[_0x29f0fd];return _0x4492b1;};'use strict';var emlformat=require(_0x01eb('0x0'));var rimraf=require(_0x01eb('0x1'));var zipdir=require(_0x01eb('0x2'));var jsonpatch=require(_0x01eb('0x3'));var rp=require(_0x01eb('0x4'));var moment=require(_0x01eb('0x5'));var BPromise=require(_0x01eb('0x6'));var Mustache=require('mustache');var util=require(_0x01eb('0x7'));var path=require('path');var sox=require(_0x01eb('0x8'));var csv=require(_0x01eb('0x9'));var ejs=require(_0x01eb('0xa'));var fs=require('fs');var fs_extra=require(_0x01eb('0xb'));var _=require('lodash');var squel=require(_0x01eb('0xc'));var crypto=require(_0x01eb('0xd'));var jsforce=require(_0x01eb('0xe'));var deskjs=require(_0x01eb('0xf'));var toCsv=require(_0x01eb('0x9'));var querystring=require('querystring');var Papa=require(_0x01eb('0x10'));var Redis=require(_0x01eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x01eb('0x12'));var as=require(_0x01eb('0x13'));var hardwareService=require(_0x01eb('0x14'));var logger=require('../../config/logger')(_0x01eb('0x15'));var utils=require(_0x01eb('0x16'));var config=require(_0x01eb('0x17'));var licenseUtil=require(_0x01eb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d190e,_0xc4df17){_0xc4df17=_0xc4df17||0xcc;return function(_0x223ad0){if(_0x223ad0){return _0x1d190e['sendStatus'](_0xc4df17);}return _0x1d190e[_0x01eb('0x19')](_0xc4df17)['end']();};}function respondWithResult(_0x25ab51,_0x21f4b8){_0x21f4b8=_0x21f4b8||0xc8;return function(_0x4dd582){if(_0x4dd582){return _0x25ab51[_0x01eb('0x19')](_0x21f4b8)[_0x01eb('0x1a')](_0x4dd582);}};}function respondWithFilteredResult(_0x419ce6,_0x45c315){return function(_0x476846){if(_0x476846){var _0xab431=typeof _0x45c315['offset']===_0x01eb('0x1b')&&typeof _0x45c315[_0x01eb('0x1c')]===_0x01eb('0x1b');var _0x143ea9=_0x476846['count'];var _0x2399b7=_0xab431?0x0:_0x45c315[_0x01eb('0x1d')];var _0x157d58=_0xab431?_0x476846[_0x01eb('0x1e')]:_0x45c315[_0x01eb('0x1d')]+_0x45c315['limit'];var _0x1d4c74;if(_0x157d58>=_0x143ea9){_0x157d58=_0x143ea9;_0x1d4c74=0xc8;}else{_0x1d4c74=0xce;}_0x419ce6['status'](_0x1d4c74);return _0x419ce6[_0x01eb('0x1f')](_0x01eb('0x20'),_0x2399b7+'-'+_0x157d58+'/'+_0x143ea9)['json'](_0x476846);}return null;};}function patchUpdates(_0xd0dd83){return function(_0x245021){try{jsonpatch['apply'](_0x245021,_0xd0dd83,!![]);}catch(_0x328a2f){return BPromise[_0x01eb('0x21')](_0x328a2f);}return _0x245021['save']();};}function saveUpdates(_0x5742af,_0x54f393){return function(_0x3d04d4){if(_0x3d04d4){return _0x3d04d4[_0x01eb('0x22')](_0x5742af)[_0x01eb('0x23')](function(_0x4ceb91){return _0x4ceb91;});}return null;};}function removeEntity(_0x5c0d82,_0x430f91){return function(_0x5b0e2a){if(_0x5b0e2a){return _0x5b0e2a[_0x01eb('0x24')]()[_0x01eb('0x23')](function(){_0x5c0d82[_0x01eb('0x19')](0xcc)[_0x01eb('0x25')]();});}};}function handleEntityNotFound(_0x3b2632,_0x355275){return function(_0x599ad7){if(!_0x599ad7){_0x3b2632['sendStatus'](0x194);}return _0x599ad7;};}function handleError(_0x5519e7,_0x7c5bf){_0x7c5bf=_0x7c5bf||0x1f4;return function(_0x91b585){logger[_0x01eb('0x26')](_0x91b585['stack']);if(_0x91b585[_0x01eb('0x27')]){delete _0x91b585[_0x01eb('0x27')];}_0x5519e7[_0x01eb('0x19')](_0x7c5bf)[_0x01eb('0x28')](_0x91b585);};}exports['index']=function(_0x3044f3,_0x56e624){var _0x4eda36={},_0x2a83ed={},_0x7a1019={'count':0x0,'rows':[]};var _0xffd092=_[_0x01eb('0x29')](db['SugarcrmConfiguration'][_0x01eb('0x2a')],function(_0xf3eea4){return{'name':_0xf3eea4[_0x01eb('0x2b')],'type':_0xf3eea4[_0x01eb('0x2c')][_0x01eb('0x2d')]};});_0x2a83ed['model']=_['map'](_0xffd092,'name');_0x2a83ed[_0x01eb('0x2e')]=_[_0x01eb('0x2f')](_0x3044f3[_0x01eb('0x2e')]);_0x2a83ed[_0x01eb('0x30')]=_[_0x01eb('0x31')](_0x2a83ed[_0x01eb('0x32')],_0x2a83ed['query']);_0x4eda36[_0x01eb('0x33')]=_[_0x01eb('0x31')](_0x2a83ed[_0x01eb('0x32')],qs['fields'](_0x3044f3['query'][_0x01eb('0x34')]));_0x4eda36['attributes']=_0x4eda36[_0x01eb('0x33')][_0x01eb('0x35')]?_0x4eda36['attributes']:_0x2a83ed[_0x01eb('0x32')];if(!_0x3044f3[_0x01eb('0x2e')]['hasOwnProperty'](_0x01eb('0x36'))){_0x4eda36['limit']=qs[_0x01eb('0x1c')](_0x3044f3[_0x01eb('0x2e')][_0x01eb('0x1c')]);_0x4eda36[_0x01eb('0x1d')]=qs[_0x01eb('0x1d')](_0x3044f3[_0x01eb('0x2e')]['offset']);}_0x4eda36['order']=qs[_0x01eb('0x37')](_0x3044f3['query'][_0x01eb('0x37')]);_0x4eda36['where']=qs[_0x01eb('0x30')](_[_0x01eb('0x38')](_0x3044f3['query'],_0x2a83ed[_0x01eb('0x30')]),_0xffd092);if(_0x3044f3[_0x01eb('0x2e')][_0x01eb('0x39')]){_0x4eda36['where']=_['merge'](_0x4eda36[_0x01eb('0x3a')],{'$or':_[_0x01eb('0x29')](_0xffd092,function(_0x523562){if(_0x523562[_0x01eb('0x2c')]!==_0x01eb('0x3b')){var _0x24dd1f={};_0x24dd1f[_0x523562[_0x01eb('0x27')]]={'$like':'%'+_0x3044f3[_0x01eb('0x2e')][_0x01eb('0x39')]+'%'};return _0x24dd1f;}})});}_0x4eda36=_['merge']({},_0x4eda36,_0x3044f3[_0x01eb('0x3c')]);var _0x423b2f={'where':_0x4eda36[_0x01eb('0x3a')]};return db[_0x01eb('0x3d')][_0x01eb('0x1e')](_0x423b2f)[_0x01eb('0x23')](function(_0x42847d){_0x7a1019[_0x01eb('0x1e')]=_0x42847d;if(_0x3044f3[_0x01eb('0x2e')]['includeAll']){_0x4eda36[_0x01eb('0x3e')]=[{'all':!![]}];}return db[_0x01eb('0x3d')][_0x01eb('0x3f')](_0x4eda36);})[_0x01eb('0x23')](function(_0x4b3732){_0x7a1019[_0x01eb('0x40')]=_0x4b3732;return _0x7a1019;})['then'](respondWithFilteredResult(_0x56e624,_0x4eda36))[_0x01eb('0x41')](handleError(_0x56e624,null));};exports['show']=function(_0x408102,_0x2eda79){var _0x29d702={'raw':![],'where':{'id':_0x408102[_0x01eb('0x42')]['id']}},_0x551ffc={};_0x551ffc[_0x01eb('0x32')]=_[_0x01eb('0x2f')](db[_0x01eb('0x3d')][_0x01eb('0x2a')]);_0x551ffc[_0x01eb('0x2e')]=_[_0x01eb('0x2f')](_0x408102[_0x01eb('0x2e')]);_0x551ffc[_0x01eb('0x30')]=_[_0x01eb('0x31')](_0x551ffc[_0x01eb('0x32')],_0x551ffc[_0x01eb('0x2e')]);_0x29d702[_0x01eb('0x33')]=_[_0x01eb('0x31')](_0x551ffc[_0x01eb('0x32')],qs[_0x01eb('0x34')](_0x408102['query'][_0x01eb('0x34')]));_0x29d702['attributes']=_0x29d702[_0x01eb('0x33')][_0x01eb('0x35')]?_0x29d702[_0x01eb('0x33')]:_0x551ffc['model'];if(_0x408102[_0x01eb('0x2e')][_0x01eb('0x43')]){_0x29d702[_0x01eb('0x3e')]=[{'all':!![]}];}_0x29d702=_['merge']({},_0x29d702,_0x408102[_0x01eb('0x3c')]);return db['SugarcrmConfiguration']['find'](_0x29d702)[_0x01eb('0x23')](handleEntityNotFound(_0x2eda79,null))[_0x01eb('0x23')](respondWithResult(_0x2eda79,null))['catch'](handleError(_0x2eda79,null));};exports[_0x01eb('0x44')]=function(_0x20900c,_0x5bbbf1){return db['SugarcrmConfiguration']['create'](_0x20900c['body'],{})[_0x01eb('0x23')](respondWithResult(_0x5bbbf1,0xc9))[_0x01eb('0x41')](handleError(_0x5bbbf1,null));};exports['update']=function(_0x1e0d3b,_0x2e9949){if(_0x1e0d3b[_0x01eb('0x45')]['id']){delete _0x1e0d3b[_0x01eb('0x45')]['id'];}return db[_0x01eb('0x3d')][_0x01eb('0x46')]({'where':{'id':_0x1e0d3b[_0x01eb('0x42')]['id']}})[_0x01eb('0x23')](handleEntityNotFound(_0x2e9949,null))[_0x01eb('0x23')](saveUpdates(_0x1e0d3b[_0x01eb('0x45')],null))[_0x01eb('0x23')](respondWithResult(_0x2e9949,null))['catch'](handleError(_0x2e9949,null));};exports['destroy']=function(_0xfa376b,_0x3f7b4f){return db[_0x01eb('0x3d')][_0x01eb('0x46')]({'where':{'id':_0xfa376b[_0x01eb('0x42')]['id']}})[_0x01eb('0x23')](handleEntityNotFound(_0x3f7b4f,null))[_0x01eb('0x23')](removeEntity(_0x3f7b4f,null))['catch'](handleError(_0x3f7b4f,null));};exports['getFields']=function(_0x270777,_0x53de05,_0x52d3d6){var _0x1b8943={};var _0x530b6e={};var _0x45b92c;var _0x290c54;return db[_0x01eb('0x3d')][_0x01eb('0x47')]({'where':{'id':_0x270777['params']['id']}})['then'](handleEntityNotFound(_0x53de05,null))['then'](function(_0x18fed6){if(_0x18fed6){_0x45b92c=_0x18fed6;_0x530b6e[_0x01eb('0x32')]=_[_0x01eb('0x2f')](db[_0x01eb('0x48')][_0x01eb('0x2a')]);_0x530b6e['query']=_[_0x01eb('0x2f')](_0x270777[_0x01eb('0x2e')]);_0x530b6e['filters']=_['intersection'](_0x530b6e[_0x01eb('0x32')],_0x530b6e[_0x01eb('0x2e')]);_0x1b8943['attributes']=_[_0x01eb('0x31')](_0x530b6e[_0x01eb('0x32')],qs['fields'](_0x270777['query'][_0x01eb('0x34')]));_0x1b8943[_0x01eb('0x33')]=_0x1b8943[_0x01eb('0x33')][_0x01eb('0x35')]?_0x1b8943[_0x01eb('0x33')]:_0x530b6e[_0x01eb('0x32')];_0x1b8943['order']=qs['sort'](_0x270777[_0x01eb('0x2e')][_0x01eb('0x37')]);_0x1b8943[_0x01eb('0x3a')]=qs[_0x01eb('0x30')](_[_0x01eb('0x38')](_0x270777['query'],_0x530b6e['filters']));if(_0x270777['query']['filter']){_0x1b8943[_0x01eb('0x3a')]=_[_0x01eb('0x49')](_0x1b8943[_0x01eb('0x3a')],{'$or':_['map'](_0x1b8943['attributes'],function(_0x510444){var _0x6a88c={};_0x6a88c[_0x510444]={'$like':'%'+_0x270777[_0x01eb('0x2e')][_0x01eb('0x39')]+'%'};return _0x6a88c;})});}_0x1b8943=_[_0x01eb('0x49')]({},_0x1b8943,_0x270777[_0x01eb('0x3c')]);return _0x45b92c[_0x01eb('0x4a')](_0x1b8943);}})[_0x01eb('0x23')](function(_0x262546){if(_0x262546){_0x290c54=_0x262546[_0x01eb('0x35')];if(!_0x270777['query'][_0x01eb('0x4b')](_0x01eb('0x36'))){_0x1b8943[_0x01eb('0x1c')]=qs[_0x01eb('0x1c')](_0x270777[_0x01eb('0x2e')][_0x01eb('0x1c')]);_0x1b8943[_0x01eb('0x1d')]=qs[_0x01eb('0x1d')](_0x270777[_0x01eb('0x2e')]['offset']);}return _0x45b92c[_0x01eb('0x4a')](_0x1b8943);}})['then'](function(_0x32c9ff){if(_0x32c9ff){return _0x32c9ff?{'count':_0x290c54,'rows':_0x32c9ff}:null;}})['then'](respondWithResult(_0x53de05,null))[_0x01eb('0x41')](handleError(_0x53de05,null));};exports['getSubjects']=function(_0x39ecae,_0x21380f,_0x203509){var _0x2696f9={};var _0x135597={};var _0x4b426d;var _0x2840b7;return db[_0x01eb('0x3d')]['findOne']({'where':{'id':_0x39ecae[_0x01eb('0x42')]['id']}})[_0x01eb('0x23')](handleEntityNotFound(_0x21380f,null))['then'](function(_0x28c335){if(_0x28c335){_0x4b426d=_0x28c335;_0x135597['model']=_[_0x01eb('0x2f')](db[_0x01eb('0x48')][_0x01eb('0x2a')]);_0x135597[_0x01eb('0x2e')]=_[_0x01eb('0x2f')](_0x39ecae[_0x01eb('0x2e')]);_0x135597[_0x01eb('0x30')]=_[_0x01eb('0x31')](_0x135597['model'],_0x135597[_0x01eb('0x2e')]);_0x2696f9['attributes']=_[_0x01eb('0x31')](_0x135597[_0x01eb('0x32')],qs[_0x01eb('0x34')](_0x39ecae[_0x01eb('0x2e')][_0x01eb('0x34')]));_0x2696f9[_0x01eb('0x33')]=_0x2696f9[_0x01eb('0x33')]['length']?_0x2696f9[_0x01eb('0x33')]:_0x135597[_0x01eb('0x32')];_0x2696f9['order']=qs['sort'](_0x39ecae[_0x01eb('0x2e')][_0x01eb('0x37')]);_0x2696f9[_0x01eb('0x3a')]=qs[_0x01eb('0x30')](_[_0x01eb('0x38')](_0x39ecae['query'],_0x135597['filters']));if(_0x39ecae['query'][_0x01eb('0x39')]){_0x2696f9[_0x01eb('0x3a')]=_[_0x01eb('0x49')](_0x2696f9['where'],{'$or':_['map'](_0x2696f9[_0x01eb('0x33')],function(_0x5eaedb){var _0xcabf={};_0xcabf[_0x5eaedb]={'$like':'%'+_0x39ecae['query']['filter']+'%'};return _0xcabf;})});}_0x2696f9=_[_0x01eb('0x49')]({},_0x2696f9,_0x39ecae[_0x01eb('0x3c')]);return _0x4b426d[_0x01eb('0x4c')](_0x2696f9);}})[_0x01eb('0x23')](function(_0x535a64){if(_0x535a64){_0x2840b7=_0x535a64[_0x01eb('0x35')];if(!_0x39ecae[_0x01eb('0x2e')]['hasOwnProperty']('nolimit')){_0x2696f9['limit']=qs['limit'](_0x39ecae[_0x01eb('0x2e')][_0x01eb('0x1c')]);_0x2696f9[_0x01eb('0x1d')]=qs['offset'](_0x39ecae['query'][_0x01eb('0x1d')]);}return _0x4b426d[_0x01eb('0x4c')](_0x2696f9);}})[_0x01eb('0x23')](function(_0xe7bad4){if(_0xe7bad4){return _0xe7bad4?{'count':_0x2840b7,'rows':_0xe7bad4}:null;}})[_0x01eb('0x23')](respondWithResult(_0x21380f,null))[_0x01eb('0x41')](handleError(_0x21380f,null));};exports[_0x01eb('0x4d')]=function(_0x15dea3,_0x1fde8c,_0x2c93e9){var _0x27107d={};var _0x4c2d95={};var _0x369b43;var _0x7931cc;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x15dea3[_0x01eb('0x42')]['id']}})['then'](handleEntityNotFound(_0x1fde8c,null))['then'](function(_0x21ca05){if(_0x21ca05){_0x369b43=_0x21ca05;_0x4c2d95[_0x01eb('0x32')]=_[_0x01eb('0x2f')](db[_0x01eb('0x48')]['rawAttributes']);_0x4c2d95[_0x01eb('0x2e')]=_[_0x01eb('0x2f')](_0x15dea3[_0x01eb('0x2e')]);_0x4c2d95[_0x01eb('0x30')]=_[_0x01eb('0x31')](_0x4c2d95[_0x01eb('0x32')],_0x4c2d95['query']);_0x27107d['attributes']=_[_0x01eb('0x31')](_0x4c2d95[_0x01eb('0x32')],qs[_0x01eb('0x34')](_0x15dea3['query'][_0x01eb('0x34')]));_0x27107d[_0x01eb('0x33')]=_0x27107d[_0x01eb('0x33')][_0x01eb('0x35')]?_0x27107d[_0x01eb('0x33')]:_0x4c2d95['model'];_0x27107d[_0x01eb('0x4e')]=qs[_0x01eb('0x37')](_0x15dea3[_0x01eb('0x2e')][_0x01eb('0x37')]);_0x27107d[_0x01eb('0x3a')]=qs[_0x01eb('0x30')](_[_0x01eb('0x38')](_0x15dea3[_0x01eb('0x2e')],_0x4c2d95[_0x01eb('0x30')]));if(_0x15dea3['query'][_0x01eb('0x39')]){_0x27107d[_0x01eb('0x3a')]=_[_0x01eb('0x49')](_0x27107d['where'],{'$or':_[_0x01eb('0x29')](_0x27107d['attributes'],function(_0x4baf9e){var _0x26ab8a={};_0x26ab8a[_0x4baf9e]={'$like':'%'+_0x15dea3[_0x01eb('0x2e')][_0x01eb('0x39')]+'%'};return _0x26ab8a;})});}_0x27107d=_['merge']({},_0x27107d,_0x15dea3[_0x01eb('0x3c')]);return _0x369b43['getDescriptions'](_0x27107d);}})[_0x01eb('0x23')](function(_0x540d65){if(_0x540d65){_0x7931cc=_0x540d65[_0x01eb('0x35')];if(!_0x15dea3[_0x01eb('0x2e')][_0x01eb('0x4b')](_0x01eb('0x36'))){_0x27107d[_0x01eb('0x1c')]=qs[_0x01eb('0x1c')](_0x15dea3[_0x01eb('0x2e')][_0x01eb('0x1c')]);_0x27107d[_0x01eb('0x1d')]=qs[_0x01eb('0x1d')](_0x15dea3[_0x01eb('0x2e')][_0x01eb('0x1d')]);}return _0x369b43[_0x01eb('0x4d')](_0x27107d);}})[_0x01eb('0x23')](function(_0x447c7f){if(_0x447c7f){return _0x447c7f?{'count':_0x7931cc,'rows':_0x447c7f}:null;}})[_0x01eb('0x23')](respondWithResult(_0x1fde8c,null))[_0x01eb('0x41')](handleError(_0x1fde8c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index db48165..44c8904 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 _0x8788=['int_sugarcrm_configurations','util','api','moment','bluebird','path','../../config/environment','define'];(function(_0x55b12c,_0x3cb64c){var _0x533da6=function(_0xfc808d){while(--_0xfc808d){_0x55b12c['push'](_0x55b12c['shift']());}};_0x533da6(++_0x3cb64c);}(_0x8788,0x169));var _0x8878=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x8788[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require('lodash');var util=require(_0x8878('0x0'));var logger=require('../../config/logger')(_0x8878('0x1'));var moment=require(_0x8878('0x2'));var BPromise=require(_0x8878('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8878('0x4'));var rimraf=require('rimraf');var config=require(_0x8878('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x96d06f,_0x46d602){return _0x96d06f[_0x8878('0x6')]('SugarcrmConfiguration',attributes,{'tableName':_0x8878('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0c1=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3b79a1,_0x84a315){var _0x211b0a=function(_0x1e876e){while(--_0x1e876e){_0x3b79a1['push'](_0x3b79a1['shift']());}};_0x211b0a(++_0x84a315);}(_0xe0c1,0xa3));var _0x1e0c=function(_0x493298,_0x5cbd42){_0x493298=_0x493298-0x0;var _0x50b0dd=_0xe0c1[_0x493298];return _0x50b0dd;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var logger=require(_0x1e0c('0x2'))('api');var moment=require(_0x1e0c('0x3'));var BPromise=require(_0x1e0c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e0c('0x5'));var config=require(_0x1e0c('0x6'));var attributes=require(_0x1e0c('0x7'));module[_0x1e0c('0x8')]=function(_0x5beba0,_0xda5c0a){return _0x5beba0[_0x1e0c('0x9')](_0x1e0c('0xa'),attributes,{'tableName':_0x1e0c('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 7604f33..6757b56 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 _0xd8ec=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x804aa7,_0x5252d1){var _0x4e148f=function(_0x9a9238){while(--_0x9a9238){_0x804aa7['push'](_0x804aa7['shift']());}};_0x4e148f(++_0x5252d1);}(_0xd8ec,0x1c4));var _0xcd8e=function(_0x43d66d,_0x3c2c83){_0x43d66d=_0x43d66d-0x0;var _0x3cb9e2=_0xd8ec[_0x43d66d];return _0x3cb9e2;};'use strict';var _=require('lodash');var util=require(_0xcd8e('0x0'));var moment=require(_0xcd8e('0x1'));var BPromise=require(_0xcd8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd8e('0x3'))(_0xcd8e('0x4'));var config=require(_0xcd8e('0x5'));var jayson=require(_0xcd8e('0x6'));var client=jayson[_0xcd8e('0x7')][_0xcd8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f318f,_0xda646,_0xd01d1e){return new BPromise(function(_0x3861af,_0x31606d){return client['request'](_0x3f318f,_0xd01d1e)[_0xcd8e('0x9')](function(_0x16d94d){logger[_0xcd8e('0xa')](_0xcd8e('0xb'),_0xda646,_0xcd8e('0xc'));logger[_0xcd8e('0xd')](_0xcd8e('0xe'),_0xda646,_0xcd8e('0xc'),JSON[_0xcd8e('0xf')](_0x16d94d));if(_0x16d94d[_0xcd8e('0x10')]){if(_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x11')]===0x1f4){logger[_0xcd8e('0x10')](_0xcd8e('0xb'),_0xda646,_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);return _0x31606d(_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);}logger['error'](_0xcd8e('0xb'),_0xda646,_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);return _0x3861af(_0x16d94d[_0xcd8e('0x10')][_0xcd8e('0x12')]);}else{logger[_0xcd8e('0xa')](_0xcd8e('0xb'),_0xda646,_0xcd8e('0xc'));_0x3861af(_0x16d94d[_0xcd8e('0x13')][_0xcd8e('0x12')]);}})[_0xcd8e('0x14')](function(_0x3c9a6a){logger['error'](_0xcd8e('0xb'),_0xda646,_0x3c9a6a);_0x31606d(_0x3c9a6a);});});} \ No newline at end of file +var _0x84a1=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x211f03,_0x4132a4){var _0x3e2d0c=function(_0x4a4e01){while(--_0x4a4e01){_0x211f03['push'](_0x211f03['shift']());}};_0x3e2d0c(++_0x4132a4);}(_0x84a1,0x192));var _0x184a=function(_0x378fab,_0x836728){_0x378fab=_0x378fab-0x0;var _0x226090=_0x84a1[_0x378fab];return _0x226090;};'use strict';var _=require(_0x184a('0x0'));var util=require(_0x184a('0x1'));var moment=require('moment');var BPromise=require(_0x184a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x184a('0x3'));var db=require(_0x184a('0x4'))['db'];var utils=require(_0x184a('0x5'));var logger=require(_0x184a('0x6'))('rpc');var config=require(_0x184a('0x7'));var jayson=require(_0x184a('0x8'));var client=jayson[_0x184a('0x9')][_0x184a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d784d,_0x3db1a7,_0x1f2b6b){return new BPromise(function(_0x1a2503,_0x250838){return client[_0x184a('0xb')](_0x1d784d,_0x1f2b6b)[_0x184a('0xc')](function(_0x441b0b){logger[_0x184a('0xd')](_0x184a('0xe'),_0x3db1a7,'request\x20sent');logger[_0x184a('0xf')](_0x184a('0x10'),_0x3db1a7,'request\x20sent',JSON[_0x184a('0x11')](_0x441b0b));if(_0x441b0b[_0x184a('0x12')]){if(_0x441b0b[_0x184a('0x12')][_0x184a('0x13')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3db1a7,_0x441b0b[_0x184a('0x12')][_0x184a('0x14')]);return _0x250838(_0x441b0b['error'][_0x184a('0x14')]);}logger[_0x184a('0x12')](_0x184a('0xe'),_0x3db1a7,_0x441b0b[_0x184a('0x12')][_0x184a('0x14')]);return _0x1a2503(_0x441b0b[_0x184a('0x12')][_0x184a('0x14')]);}else{logger[_0x184a('0xd')](_0x184a('0xe'),_0x3db1a7,_0x184a('0x15'));_0x1a2503(_0x441b0b['result']['message']);}})[_0x184a('0x16')](function(_0x44038e){logger['error'](_0x184a('0xe'),_0x3db1a7,_0x44038e);_0x250838(_0x44038e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index c53bfb8..3621b26 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 _0xaa17=['get','/:id','show','post','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x2d1b20,_0x456025){var _0x14f5d1=function(_0x14775a){while(--_0x14775a){_0x2d1b20['push'](_0x2d1b20['shift']());}};_0x14f5d1(++_0x456025);}(_0xaa17,0x135));var _0x7aa1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa17[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7aa1('0x0'));var util=require(_0x7aa1('0x1'));var path=require(_0x7aa1('0x2'));var timeout=require(_0x7aa1('0x3'));var express=require(_0x7aa1('0x4'));var router=express[_0x7aa1('0x5')]();var fs_extra=require(_0x7aa1('0x6'));var auth=require(_0x7aa1('0x7'));var interaction=require(_0x7aa1('0x8'));var config=require(_0x7aa1('0x9'));var controller=require(_0x7aa1('0xa'));router[_0x7aa1('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7aa1('0xc'),auth['isAuthenticated'](),controller[_0x7aa1('0xd')]);router[_0x7aa1('0xe')]('/',auth[_0x7aa1('0xf')](),controller['create']);router[_0x7aa1('0x10')]('/:id',auth[_0x7aa1('0xf')](),controller[_0x7aa1('0x11')]);router['delete'](_0x7aa1('0xc'),auth[_0x7aa1('0xf')](),controller[_0x7aa1('0x12')]);module[_0x7aa1('0x13')]=router; \ No newline at end of file +var _0x3c6f=['create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post'];(function(_0x49d34a,_0x1dafc0){var _0x164371=function(_0x4bc78a){while(--_0x4bc78a){_0x49d34a['push'](_0x49d34a['shift']());}};_0x164371(++_0x1dafc0);}(_0x3c6f,0xcc));var _0xf3c6=function(_0x368c12,_0x426301){_0x368c12=_0x368c12-0x0;var _0x31b26c=_0x3c6f[_0x368c12];return _0x31b26c;};'use strict';var multer=require(_0xf3c6('0x0'));var util=require(_0xf3c6('0x1'));var path=require(_0xf3c6('0x2'));var timeout=require(_0xf3c6('0x3'));var express=require('express');var router=express[_0xf3c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf3c6('0x5'));var config=require(_0xf3c6('0x6'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xf3c6('0x7')](),controller[_0xf3c6('0x8')]);router[_0xf3c6('0x9')]('/:id',auth[_0xf3c6('0x7')](),controller[_0xf3c6('0xa')]);router[_0xf3c6('0xb')]('/',auth[_0xf3c6('0x7')](),controller[_0xf3c6('0xc')]);router[_0xf3c6('0xd')](_0xf3c6('0xe'),auth['isAuthenticated'](),controller[_0xf3c6('0xf')]);router[_0xf3c6('0x10')](_0xf3c6('0xe'),auth[_0xf3c6('0x7')](),controller[_0xf3c6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index adc4e49..71daedd 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 _0x7da1=['variable','keyValue','picklist','STRING','string','customVariable','sequelize','exports','ENUM'];(function(_0x2170b1,_0x5c99e9){var _0x4be2c3=function(_0x790566){while(--_0x790566){_0x2170b1['push'](_0x2170b1['shift']());}};_0x4be2c3(++_0x5c99e9);}(_0x7da1,0x177));var _0x17da=function(_0x38966c,_0x1f8b84){_0x38966c=_0x38966c-0x0;var _0x569f45=_0x7da1[_0x38966c];return _0x569f45;};'use strict';var Sequelize=require(_0x17da('0x0'));module[_0x17da('0x1')]={'type':{'type':Sequelize[_0x17da('0x2')]('string',_0x17da('0x3'),'customVariable',_0x17da('0x4'),_0x17da('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x17da('0x6')]},'key':{'type':Sequelize[_0x17da('0x6')]},'keyType':{'type':Sequelize[_0x17da('0x2')](_0x17da('0x7'),_0x17da('0x3'),_0x17da('0x8'))},'keyContent':{'type':Sequelize[_0x17da('0x6')]},'idField':{'type':Sequelize[_0x17da('0x6')]},'nameField':{'type':Sequelize[_0x17da('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17da('0x6')]}}; \ No newline at end of file +var _0x8a96=['picklist','STRING','variable','customVariable','exports','ENUM','string'];(function(_0x52d8da,_0x4609b1){var _0x2db5f0=function(_0xe302da){while(--_0xe302da){_0x52d8da['push'](_0x52d8da['shift']());}};_0x2db5f0(++_0x4609b1);}(_0x8a96,0xa5));var _0x68a9=function(_0x19af0d,_0x1d2771){_0x19af0d=_0x19af0d-0x0;var _0x89ba34=_0x8a96[_0x19af0d];return _0x89ba34;};'use strict';var Sequelize=require('sequelize');module[_0x68a9('0x0')]={'type':{'type':Sequelize[_0x68a9('0x1')](_0x68a9('0x2'),'variable','customVariable','keyValue',_0x68a9('0x3')),'defaultValue':_0x68a9('0x2')},'content':{'type':Sequelize[_0x68a9('0x4')]},'key':{'type':Sequelize[_0x68a9('0x4')]},'keyType':{'type':Sequelize[_0x68a9('0x1')]('string',_0x68a9('0x5'),_0x68a9('0x6'))},'keyContent':{'type':Sequelize[_0x68a9('0x4')]},'idField':{'type':Sequelize[_0x68a9('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x68a9('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ddd7200..d16c2bf 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 _0x06c0=['update','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3d1f57,_0x43582e){var _0x38bc5f=function(_0x4b49c0){while(--_0x4b49c0){_0x3d1f57['push'](_0x3d1f57['shift']());}};_0x38bc5f(++_0x43582e);}(_0x06c0,0x115));var _0x006c=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x06c0[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0x006c('0x0'));var rimraf=require(_0x006c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x006c('0x2'));var moment=require(_0x006c('0x3'));var BPromise=require(_0x006c('0x4'));var Mustache=require('mustache');var util=require(_0x006c('0x5'));var path=require(_0x006c('0x6'));var sox=require('sox');var csv=require(_0x006c('0x7'));var ejs=require(_0x006c('0x8'));var fs=require('fs');var fs_extra=require(_0x006c('0x9'));var _=require(_0x006c('0xa'));var squel=require(_0x006c('0xb'));var crypto=require(_0x006c('0xc'));var jsforce=require(_0x006c('0xd'));var deskjs=require(_0x006c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x006c('0xf'));var Papa=require(_0x006c('0x10'));var Redis=require(_0x006c('0x11'));var authService=require(_0x006c('0x12'));var qs=require(_0x006c('0x13'));var as=require(_0x006c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x006c('0x15'))(_0x006c('0x16'));var utils=require(_0x006c('0x17'));var config=require(_0x006c('0x18'));var licenseUtil=require(_0x006c('0x19'));var db=require(_0x006c('0x1a'))['db'];function respondWithStatusCode(_0x166015,_0x3e684e){_0x3e684e=_0x3e684e||0xcc;return function(_0x5d4a32){if(_0x5d4a32){return _0x166015[_0x006c('0x1b')](_0x3e684e);}return _0x166015[_0x006c('0x1c')](_0x3e684e)[_0x006c('0x1d')]();};}function respondWithResult(_0x37e2d8,_0x622f85){_0x622f85=_0x622f85||0xc8;return function(_0x5d9149){if(_0x5d9149){return _0x37e2d8['status'](_0x622f85)[_0x006c('0x1e')](_0x5d9149);}};}function respondWithFilteredResult(_0x230bf1,_0x4e2f5e){return function(_0x3f3517){if(_0x3f3517){var _0x3950a8=typeof _0x4e2f5e[_0x006c('0x1f')]===_0x006c('0x20')&&typeof _0x4e2f5e[_0x006c('0x21')]===_0x006c('0x20');var _0x292ae0=_0x3f3517[_0x006c('0x22')];var _0x9bd37d=_0x3950a8?0x0:_0x4e2f5e['offset'];var _0x340816=_0x3950a8?_0x3f3517[_0x006c('0x22')]:_0x4e2f5e[_0x006c('0x1f')]+_0x4e2f5e[_0x006c('0x21')];var _0x30b01d;if(_0x340816>=_0x292ae0){_0x340816=_0x292ae0;_0x30b01d=0xc8;}else{_0x30b01d=0xce;}_0x230bf1[_0x006c('0x1c')](_0x30b01d);return _0x230bf1[_0x006c('0x23')](_0x006c('0x24'),_0x9bd37d+'-'+_0x340816+'/'+_0x292ae0)['json'](_0x3f3517);}return null;};}function patchUpdates(_0x59af7e){return function(_0x238545){try{jsonpatch[_0x006c('0x25')](_0x238545,_0x59af7e,!![]);}catch(_0x4625cb){return BPromise[_0x006c('0x26')](_0x4625cb);}return _0x238545['save']();};}function saveUpdates(_0x194164,_0x59b2ff){return function(_0x1f6a43){if(_0x1f6a43){return _0x1f6a43[_0x006c('0x27')](_0x194164)['then'](function(_0x4b4e67){return _0x4b4e67;});}return null;};}function removeEntity(_0xa67424,_0x3439d4){return function(_0x2cb93d){if(_0x2cb93d){return _0x2cb93d['destroy']()[_0x006c('0x28')](function(){_0xa67424[_0x006c('0x1c')](0xcc)[_0x006c('0x1d')]();});}};}function handleEntityNotFound(_0x20f5c3,_0x2a4a18){return function(_0x3e1923){if(!_0x3e1923){_0x20f5c3[_0x006c('0x1b')](0x194);}return _0x3e1923;};}function handleError(_0x14600f,_0x40e666){_0x40e666=_0x40e666||0x1f4;return function(_0x1d3ebd){logger[_0x006c('0x29')](_0x1d3ebd[_0x006c('0x2a')]);if(_0x1d3ebd['name']){delete _0x1d3ebd[_0x006c('0x2b')];}_0x14600f[_0x006c('0x1c')](_0x40e666)[_0x006c('0x2c')](_0x1d3ebd);};}exports[_0x006c('0x2d')]=function(_0x7d1148,_0x49d096){var _0x1c4013={},_0x47ae51={},_0x4645a5={'count':0x0,'rows':[]};var _0xbd73d0=_[_0x006c('0x2e')](db[_0x006c('0x2f')][_0x006c('0x30')],function(_0x320054){return{'name':_0x320054[_0x006c('0x31')],'type':_0x320054['type'][_0x006c('0x32')]};});_0x47ae51[_0x006c('0x33')]=_['map'](_0xbd73d0,_0x006c('0x2b'));_0x47ae51[_0x006c('0x34')]=_[_0x006c('0x35')](_0x7d1148[_0x006c('0x34')]);_0x47ae51['filters']=_[_0x006c('0x36')](_0x47ae51[_0x006c('0x33')],_0x47ae51[_0x006c('0x34')]);_0x1c4013['attributes']=_[_0x006c('0x36')](_0x47ae51[_0x006c('0x33')],qs[_0x006c('0x37')](_0x7d1148['query'][_0x006c('0x37')]));_0x1c4013[_0x006c('0x38')]=_0x1c4013['attributes'][_0x006c('0x39')]?_0x1c4013[_0x006c('0x38')]:_0x47ae51['model'];if(!_0x7d1148[_0x006c('0x34')][_0x006c('0x3a')](_0x006c('0x3b'))){_0x1c4013[_0x006c('0x21')]=qs['limit'](_0x7d1148['query']['limit']);_0x1c4013[_0x006c('0x1f')]=qs[_0x006c('0x1f')](_0x7d1148[_0x006c('0x34')][_0x006c('0x1f')]);}_0x1c4013[_0x006c('0x3c')]=qs['sort'](_0x7d1148['query']['sort']);_0x1c4013[_0x006c('0x3d')]=qs[_0x006c('0x3e')](_[_0x006c('0x3f')](_0x7d1148['query'],_0x47ae51[_0x006c('0x3e')]),_0xbd73d0);if(_0x7d1148[_0x006c('0x34')][_0x006c('0x40')]){_0x1c4013[_0x006c('0x3d')]=_[_0x006c('0x41')](_0x1c4013[_0x006c('0x3d')],{'$or':_['map'](_0xbd73d0,function(_0x3652f3){if(_0x3652f3[_0x006c('0x42')]!==_0x006c('0x43')){var _0x1b8e01={};_0x1b8e01[_0x3652f3[_0x006c('0x2b')]]={'$like':'%'+_0x7d1148[_0x006c('0x34')][_0x006c('0x40')]+'%'};return _0x1b8e01;}})});}_0x1c4013=_['merge']({},_0x1c4013,_0x7d1148[_0x006c('0x44')]);var _0x33ca24={'where':_0x1c4013[_0x006c('0x3d')]};return db[_0x006c('0x2f')][_0x006c('0x22')](_0x33ca24)[_0x006c('0x28')](function(_0x4e5feb){_0x4645a5[_0x006c('0x22')]=_0x4e5feb;if(_0x7d1148[_0x006c('0x34')][_0x006c('0x45')]){_0x1c4013[_0x006c('0x46')]=[{'all':!![]}];}return db['SugarcrmField'][_0x006c('0x47')](_0x1c4013);})['then'](function(_0x2c33d8){_0x4645a5[_0x006c('0x48')]=_0x2c33d8;return _0x4645a5;})['then'](respondWithFilteredResult(_0x49d096,_0x1c4013))[_0x006c('0x49')](handleError(_0x49d096,null));};exports['show']=function(_0x5b67ba,_0x4f8e6c){var _0x152941={'raw':!![],'where':{'id':_0x5b67ba[_0x006c('0x4a')]['id']}},_0x1046d2={};_0x1046d2[_0x006c('0x33')]=_['keys'](db['SugarcrmField'][_0x006c('0x30')]);_0x1046d2['query']=_[_0x006c('0x35')](_0x5b67ba[_0x006c('0x34')]);_0x1046d2['filters']=_['intersection'](_0x1046d2[_0x006c('0x33')],_0x1046d2[_0x006c('0x34')]);_0x152941[_0x006c('0x38')]=_[_0x006c('0x36')](_0x1046d2[_0x006c('0x33')],qs['fields'](_0x5b67ba[_0x006c('0x34')][_0x006c('0x37')]));_0x152941[_0x006c('0x38')]=_0x152941[_0x006c('0x38')][_0x006c('0x39')]?_0x152941[_0x006c('0x38')]:_0x1046d2['model'];if(_0x5b67ba[_0x006c('0x34')][_0x006c('0x45')]){_0x152941[_0x006c('0x46')]=[{'all':!![]}];}_0x152941=_[_0x006c('0x41')]({},_0x152941,_0x5b67ba[_0x006c('0x44')]);return db[_0x006c('0x2f')][_0x006c('0x4b')](_0x152941)[_0x006c('0x28')](handleEntityNotFound(_0x4f8e6c,null))[_0x006c('0x28')](respondWithResult(_0x4f8e6c,null))[_0x006c('0x49')](handleError(_0x4f8e6c,null));};exports[_0x006c('0x4c')]=function(_0x21ca93,_0x285048){return db['SugarcrmField'][_0x006c('0x4c')](_0x21ca93[_0x006c('0x4d')],{})[_0x006c('0x28')](respondWithResult(_0x285048,0xc9))[_0x006c('0x49')](handleError(_0x285048,null));};exports[_0x006c('0x27')]=function(_0x103d1f,_0x354aff){if(_0x103d1f[_0x006c('0x4d')]['id']){delete _0x103d1f[_0x006c('0x4d')]['id'];}return db[_0x006c('0x2f')][_0x006c('0x4b')]({'where':{'id':_0x103d1f[_0x006c('0x4a')]['id']}})[_0x006c('0x28')](handleEntityNotFound(_0x354aff,null))[_0x006c('0x28')](saveUpdates(_0x103d1f['body'],null))['then'](respondWithResult(_0x354aff,null))['catch'](handleError(_0x354aff,null));};exports[_0x006c('0x4e')]=function(_0x482fe7,_0x32a529){return db[_0x006c('0x2f')][_0x006c('0x4b')]({'where':{'id':_0x482fe7[_0x006c('0x4a')]['id']}})[_0x006c('0x28')](handleEntityNotFound(_0x32a529,null))['then'](removeEntity(_0x32a529,null))[_0x006c('0x49')](handleError(_0x32a529,null));}; \ No newline at end of file +var _0xca6e=['keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','length','include','options','find','catch','create','body','params','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query'];(function(_0x11c6dc,_0x356447){var _0x2e2abf=function(_0xf33f16){while(--_0xf33f16){_0x11c6dc['push'](_0x11c6dc['shift']());}};_0x2e2abf(++_0x356447);}(_0xca6e,0x106));var _0xeca6=function(_0x579d85,_0x3a88e9){_0x579d85=_0x579d85-0x0;var _0x4368ad=_0xca6e[_0x579d85];return _0x4368ad;};'use strict';var emlformat=require(_0xeca6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeca6('0x1'));var rp=require(_0xeca6('0x2'));var moment=require(_0xeca6('0x3'));var BPromise=require(_0xeca6('0x4'));var Mustache=require(_0xeca6('0x5'));var util=require(_0xeca6('0x6'));var path=require('path');var sox=require(_0xeca6('0x7'));var csv=require(_0xeca6('0x8'));var ejs=require(_0xeca6('0x9'));var fs=require('fs');var fs_extra=require(_0xeca6('0xa'));var _=require(_0xeca6('0xb'));var squel=require(_0xeca6('0xc'));var crypto=require(_0xeca6('0xd'));var jsforce=require(_0xeca6('0xe'));var deskjs=require(_0xeca6('0xf'));var toCsv=require(_0xeca6('0x8'));var querystring=require(_0xeca6('0x10'));var Papa=require(_0xeca6('0x11'));var Redis=require('ioredis');var authService=require(_0xeca6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeca6('0x13'));var hardwareService=require(_0xeca6('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xeca6('0x15'));var config=require(_0xeca6('0x16'));var licenseUtil=require(_0xeca6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1be98a,_0x5a3e6c){_0x5a3e6c=_0x5a3e6c||0xcc;return function(_0x50e925){if(_0x50e925){return _0x1be98a[_0xeca6('0x18')](_0x5a3e6c);}return _0x1be98a['status'](_0x5a3e6c)['end']();};}function respondWithResult(_0x128d86,_0x393e25){_0x393e25=_0x393e25||0xc8;return function(_0xb32db0){if(_0xb32db0){return _0x128d86[_0xeca6('0x19')](_0x393e25)[_0xeca6('0x1a')](_0xb32db0);}};}function respondWithFilteredResult(_0xe949a5,_0x5eb175){return function(_0x11fa5c){if(_0x11fa5c){var _0x2b1020=typeof _0x5eb175[_0xeca6('0x1b')]===_0xeca6('0x1c')&&typeof _0x5eb175[_0xeca6('0x1d')]==='undefined';var _0x1240f5=_0x11fa5c[_0xeca6('0x1e')];var _0x53fac5=_0x2b1020?0x0:_0x5eb175[_0xeca6('0x1b')];var _0x256c91=_0x2b1020?_0x11fa5c[_0xeca6('0x1e')]:_0x5eb175['offset']+_0x5eb175[_0xeca6('0x1d')];var _0x2af538;if(_0x256c91>=_0x1240f5){_0x256c91=_0x1240f5;_0x2af538=0xc8;}else{_0x2af538=0xce;}_0xe949a5[_0xeca6('0x19')](_0x2af538);return _0xe949a5[_0xeca6('0x1f')](_0xeca6('0x20'),_0x53fac5+'-'+_0x256c91+'/'+_0x1240f5)['json'](_0x11fa5c);}return null;};}function patchUpdates(_0x139b75){return function(_0x457089){try{jsonpatch[_0xeca6('0x21')](_0x457089,_0x139b75,!![]);}catch(_0x1ebdf7){return BPromise[_0xeca6('0x22')](_0x1ebdf7);}return _0x457089[_0xeca6('0x23')]();};}function saveUpdates(_0x29bf14,_0x5b3d5d){return function(_0x4f8839){if(_0x4f8839){return _0x4f8839[_0xeca6('0x24')](_0x29bf14)[_0xeca6('0x25')](function(_0x3ee0c0){return _0x3ee0c0;});}return null;};}function removeEntity(_0x17ecff,_0x888a44){return function(_0x104c26){if(_0x104c26){return _0x104c26['destroy']()[_0xeca6('0x25')](function(){_0x17ecff[_0xeca6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac818,_0x2d639f){return function(_0x2da946){if(!_0x2da946){_0x2ac818[_0xeca6('0x18')](0x194);}return _0x2da946;};}function handleError(_0x2abd50,_0x5cdcf3){_0x5cdcf3=_0x5cdcf3||0x1f4;return function(_0x21d752){logger[_0xeca6('0x26')](_0x21d752[_0xeca6('0x27')]);if(_0x21d752[_0xeca6('0x28')]){delete _0x21d752[_0xeca6('0x28')];}_0x2abd50[_0xeca6('0x19')](_0x5cdcf3)[_0xeca6('0x29')](_0x21d752);};}exports[_0xeca6('0x2a')]=function(_0x3d2adb,_0x350b3e){var _0x5de409={},_0x322db5={},_0x15d473={'count':0x0,'rows':[]};var _0x93bd62=_[_0xeca6('0x2b')](db[_0xeca6('0x2c')][_0xeca6('0x2d')],function(_0xf2138f){return{'name':_0xf2138f[_0xeca6('0x2e')],'type':_0xf2138f['type'][_0xeca6('0x2f')]};});_0x322db5[_0xeca6('0x30')]=_[_0xeca6('0x2b')](_0x93bd62,_0xeca6('0x28'));_0x322db5[_0xeca6('0x31')]=_[_0xeca6('0x32')](_0x3d2adb[_0xeca6('0x31')]);_0x322db5[_0xeca6('0x33')]=_['intersection'](_0x322db5['model'],_0x322db5['query']);_0x5de409[_0xeca6('0x34')]=_[_0xeca6('0x35')](_0x322db5[_0xeca6('0x30')],qs['fields'](_0x3d2adb[_0xeca6('0x31')][_0xeca6('0x36')]));_0x5de409[_0xeca6('0x34')]=_0x5de409[_0xeca6('0x34')]['length']?_0x5de409[_0xeca6('0x34')]:_0x322db5['model'];if(!_0x3d2adb['query'][_0xeca6('0x37')](_0xeca6('0x38'))){_0x5de409[_0xeca6('0x1d')]=qs[_0xeca6('0x1d')](_0x3d2adb[_0xeca6('0x31')]['limit']);_0x5de409[_0xeca6('0x1b')]=qs[_0xeca6('0x1b')](_0x3d2adb['query']['offset']);}_0x5de409[_0xeca6('0x39')]=qs[_0xeca6('0x3a')](_0x3d2adb[_0xeca6('0x31')][_0xeca6('0x3a')]);_0x5de409[_0xeca6('0x3b')]=qs[_0xeca6('0x33')](_[_0xeca6('0x3c')](_0x3d2adb['query'],_0x322db5[_0xeca6('0x33')]),_0x93bd62);if(_0x3d2adb['query'][_0xeca6('0x3d')]){_0x5de409[_0xeca6('0x3b')]=_[_0xeca6('0x3e')](_0x5de409[_0xeca6('0x3b')],{'$or':_[_0xeca6('0x2b')](_0x93bd62,function(_0x31c645){if(_0x31c645[_0xeca6('0x3f')]!==_0xeca6('0x40')){var _0x11119a={};_0x11119a[_0x31c645['name']]={'$like':'%'+_0x3d2adb['query'][_0xeca6('0x3d')]+'%'};return _0x11119a;}})});}_0x5de409=_['merge']({},_0x5de409,_0x3d2adb['options']);var _0x5ae51f={'where':_0x5de409[_0xeca6('0x3b')]};return db[_0xeca6('0x2c')]['count'](_0x5ae51f)[_0xeca6('0x25')](function(_0x361be6){_0x15d473[_0xeca6('0x1e')]=_0x361be6;if(_0x3d2adb['query'][_0xeca6('0x41')]){_0x5de409['include']=[{'all':!![]}];}return db['SugarcrmField'][_0xeca6('0x42')](_0x5de409);})['then'](function(_0x353fb9){_0x15d473[_0xeca6('0x43')]=_0x353fb9;return _0x15d473;})[_0xeca6('0x25')](respondWithFilteredResult(_0x350b3e,_0x5de409))['catch'](handleError(_0x350b3e,null));};exports[_0xeca6('0x44')]=function(_0x280069,_0x33de36){var _0x16083d={'raw':!![],'where':{'id':_0x280069['params']['id']}},_0x1ae131={};_0x1ae131[_0xeca6('0x30')]=_[_0xeca6('0x32')](db['SugarcrmField'][_0xeca6('0x2d')]);_0x1ae131['query']=_[_0xeca6('0x32')](_0x280069[_0xeca6('0x31')]);_0x1ae131['filters']=_[_0xeca6('0x35')](_0x1ae131[_0xeca6('0x30')],_0x1ae131[_0xeca6('0x31')]);_0x16083d[_0xeca6('0x34')]=_[_0xeca6('0x35')](_0x1ae131[_0xeca6('0x30')],qs[_0xeca6('0x36')](_0x280069[_0xeca6('0x31')][_0xeca6('0x36')]));_0x16083d[_0xeca6('0x34')]=_0x16083d[_0xeca6('0x34')][_0xeca6('0x45')]?_0x16083d[_0xeca6('0x34')]:_0x1ae131[_0xeca6('0x30')];if(_0x280069[_0xeca6('0x31')][_0xeca6('0x41')]){_0x16083d[_0xeca6('0x46')]=[{'all':!![]}];}_0x16083d=_['merge']({},_0x16083d,_0x280069[_0xeca6('0x47')]);return db['SugarcrmField'][_0xeca6('0x48')](_0x16083d)[_0xeca6('0x25')](handleEntityNotFound(_0x33de36,null))[_0xeca6('0x25')](respondWithResult(_0x33de36,null))[_0xeca6('0x49')](handleError(_0x33de36,null));};exports[_0xeca6('0x4a')]=function(_0x4d329c,_0x53adb3){return db[_0xeca6('0x2c')][_0xeca6('0x4a')](_0x4d329c['body'],{})['then'](respondWithResult(_0x53adb3,0xc9))['catch'](handleError(_0x53adb3,null));};exports['update']=function(_0x10201f,_0x178186){if(_0x10201f[_0xeca6('0x4b')]['id']){delete _0x10201f[_0xeca6('0x4b')]['id'];}return db['SugarcrmField'][_0xeca6('0x48')]({'where':{'id':_0x10201f[_0xeca6('0x4c')]['id']}})[_0xeca6('0x25')](handleEntityNotFound(_0x178186,null))[_0xeca6('0x25')](saveUpdates(_0x10201f['body'],null))['then'](respondWithResult(_0x178186,null))[_0xeca6('0x49')](handleError(_0x178186,null));};exports[_0xeca6('0x4d')]=function(_0x182b04,_0x590a5a){return db[_0xeca6('0x2c')][_0xeca6('0x48')]({'where':{'id':_0x182b04[_0xeca6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x590a5a,null))[_0xeca6('0x25')](removeEntity(_0x590a5a,null))['catch'](handleError(_0x590a5a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 102c7d4..a7b3dde 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 _0x7a27=['../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','api','moment','rimraf'];(function(_0x347b61,_0x4e69bc){var _0x254aa7=function(_0x480a5f){while(--_0x480a5f){_0x347b61['push'](_0x347b61['shift']());}};_0x254aa7(++_0x4e69bc);}(_0x7a27,0x103));var _0x77a2=function(_0x123260,_0x2a4db0){_0x123260=_0x123260-0x0;var _0x4ff8b0=_0x7a27[_0x123260];return _0x4ff8b0;};'use strict';var _=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var logger=require('../../config/logger')(_0x77a2('0x2'));var moment=require(_0x77a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x77a2('0x4'));var config=require(_0x77a2('0x5'));var attributes=require(_0x77a2('0x6'));module[_0x77a2('0x7')]=function(_0x9a79d6,_0x74a3d1){return _0x9a79d6['define'](_0x77a2('0x8'),attributes,{'tableName':_0x77a2('0x9'),'paranoid':![],'indexes':[{'name':_0x77a2('0xa'),'fields':['idField',_0x77a2('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x443e=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','idField','FieldId','util','../../config/logger','bluebird','request-promise'];(function(_0x2c6075,_0x50c95b){var _0x1ec271=function(_0x4507a6){while(--_0x4507a6){_0x2c6075['push'](_0x2c6075['shift']());}};_0x1ec271(++_0x50c95b);}(_0x443e,0x7e));var _0xe443=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0x443e[_0x4fa291];return _0x506d9b;};'use strict';var _=require('lodash');var util=require(_0xe443('0x0'));var logger=require(_0xe443('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe443('0x2'));var rp=require(_0xe443('0x3'));var fs=require('fs');var path=require(_0xe443('0x4'));var rimraf=require(_0xe443('0x5'));var config=require(_0xe443('0x6'));var attributes=require(_0xe443('0x7'));module[_0xe443('0x8')]=function(_0x37c9aa,_0x124b95){return _0x37c9aa['define'](_0xe443('0x9'),attributes,{'tableName':_0xe443('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xe443('0xb'),_0xe443('0xc')],'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 e3884a9..6aa5803 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 _0x6342=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x501959,_0x4fc0ae){var _0x895a9=function(_0x2f5669){while(--_0x2f5669){_0x501959['push'](_0x501959['shift']());}};_0x895a9(++_0x4fc0ae);}(_0x6342,0xa6));var _0x2634=function(_0x8bf471,_0x2e9da0){_0x8bf471=_0x8bf471-0x0;var _0x3d93d7=_0x6342[_0x8bf471];return _0x3d93d7;};'use strict';var _=require('lodash');var util=require(_0x2634('0x0'));var moment=require(_0x2634('0x1'));var BPromise=require(_0x2634('0x2'));var rs=require(_0x2634('0x3'));var fs=require('fs');var Redis=require(_0x2634('0x4'));var db=require(_0x2634('0x5'))['db'];var utils=require(_0x2634('0x6'));var logger=require(_0x2634('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2634('0x8'));var client=jayson[_0x2634('0x9')][_0x2634('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c92a3,_0x3296b5,_0xb88068){return new BPromise(function(_0x557b3c,_0x42530e){return client['request'](_0x5c92a3,_0xb88068)[_0x2634('0xb')](function(_0x2f6cc8){logger[_0x2634('0xc')](_0x2634('0xd'),_0x3296b5,_0x2634('0xe'));logger[_0x2634('0xf')](_0x2634('0x10'),_0x3296b5,'request\x20sent',JSON[_0x2634('0x11')](_0x2f6cc8));if(_0x2f6cc8[_0x2634('0x12')]){if(_0x2f6cc8[_0x2634('0x12')][_0x2634('0x13')]===0x1f4){logger[_0x2634('0x12')](_0x2634('0xd'),_0x3296b5,_0x2f6cc8[_0x2634('0x12')][_0x2634('0x14')]);return _0x42530e(_0x2f6cc8[_0x2634('0x12')][_0x2634('0x14')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x3296b5,_0x2f6cc8[_0x2634('0x12')]['message']);return _0x557b3c(_0x2f6cc8[_0x2634('0x12')]['message']);}else{logger[_0x2634('0xc')](_0x2634('0xd'),_0x3296b5,_0x2634('0xe'));_0x557b3c(_0x2f6cc8[_0x2634('0x15')][_0x2634('0x14')]);}})[_0x2634('0x16')](function(_0x38829d){logger[_0x2634('0x12')](_0x2634('0xd'),_0x3296b5,_0x38829d);_0x42530e(_0x38829d);});});} \ No newline at end of file +var _0x4c84=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x4c84,0x13f));var _0x44c8=function(_0x160412,_0x5640a7){_0x160412=_0x160412-0x0;var _0x3c8a1b=_0x4c84[_0x160412];return _0x3c8a1b;};'use strict';var _=require(_0x44c8('0x0'));var util=require(_0x44c8('0x1'));var moment=require(_0x44c8('0x2'));var BPromise=require(_0x44c8('0x3'));var rs=require(_0x44c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44c8('0x5'))['db'];var utils=require(_0x44c8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x44c8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x44c8('0x8')][_0x44c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x584195,_0x5da1d1,_0x372358){return new BPromise(function(_0x2c9d6e,_0x1d100e){return client[_0x44c8('0xa')](_0x584195,_0x372358)[_0x44c8('0xb')](function(_0x5162c0){logger[_0x44c8('0xc')](_0x44c8('0xd'),_0x5da1d1,_0x44c8('0xe'));logger[_0x44c8('0xf')](_0x44c8('0x10'),_0x5da1d1,_0x44c8('0xe'),JSON['stringify'](_0x5162c0));if(_0x5162c0[_0x44c8('0x11')]){if(_0x5162c0[_0x44c8('0x11')][_0x44c8('0x12')]===0x1f4){logger['error'](_0x44c8('0xd'),_0x5da1d1,_0x5162c0['error'][_0x44c8('0x13')]);return _0x1d100e(_0x5162c0['error'][_0x44c8('0x13')]);}logger[_0x44c8('0x11')](_0x44c8('0xd'),_0x5da1d1,_0x5162c0[_0x44c8('0x11')][_0x44c8('0x13')]);return _0x2c9d6e(_0x5162c0['error'][_0x44c8('0x13')]);}else{logger['info'](_0x44c8('0xd'),_0x5da1d1,_0x44c8('0xe'));_0x2c9d6e(_0x5162c0['result'][_0x44c8('0x13')]);}})[_0x44c8('0x14')](function(_0x4a11eb){logger[_0x44c8('0x11')](_0x44c8('0xd'),_0x5da1d1,_0x4a11eb);_0x1d100e(_0x4a11eb);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 7020e5b..b37147d 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 _0xf6c1=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','update','delete','destroy','exports','path'];(function(_0x574205,_0x880478){var _0x460fa0=function(_0x103d1d){while(--_0x103d1d){_0x574205['push'](_0x574205['shift']());}};_0x460fa0(++_0x880478);}(_0xf6c1,0x99));var _0x1f6c=function(_0x38c672,_0x36d51e){_0x38c672=_0x38c672-0x0;var _0x32f551=_0xf6c1[_0x38c672];return _0x32f551;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f6c('0x0'));var timeout=require(_0x1f6c('0x1'));var express=require(_0x1f6c('0x2'));var router=express['Router']();var fs_extra=require(_0x1f6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var controller=require(_0x1f6c('0x6'));router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router['get'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xb')]);router[_0x1f6c('0x7')](_0x1f6c('0xc'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xd')]);router[_0x1f6c('0x7')](_0x1f6c('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xf')]);router[_0x1f6c('0x10')](_0x1f6c('0xc'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x11')]);router['put'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x12')]);router[_0x1f6c('0x13')](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x14')]);module[_0x1f6c('0x15')]=router; \ No newline at end of file +var _0xb647=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x4e40c4,_0x3ba615){var _0x3b5a22=function(_0x355593){while(--_0x355593){_0x4e40c4['push'](_0x4e40c4['shift']());}};_0x3b5a22(++_0x3ba615);}(_0xb647,0xdb));var _0x7b64=function(_0x12b664,_0x589fae){_0x12b664=_0x12b664-0x0;var _0x12d102=_0xb647[_0x12b664];return _0x12d102;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0x9')](_0x7b64('0xe'),auth['isAuthenticated'](),controller[_0x7b64('0xf')]);router['get'](_0x7b64('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x7b64('0x11')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0x11')](_0x7b64('0xe'),auth[_0x7b64('0xa')](),controller[_0x7b64('0x12')]);router[_0x7b64('0x13')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller['update']);router[_0x7b64('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7b64('0x15')]);module[_0x7b64('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index ae92c25..7e856a0 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 _0x10a9=['exports','STRING','HelpDesk','sequelize'];(function(_0x141f74,_0x420286){var _0x3a462f=function(_0x4e0c27){while(--_0x4e0c27){_0x141f74['push'](_0x141f74['shift']());}};_0x3a462f(++_0x420286);}(_0x10a9,0x113));var _0x910a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x10a9[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x910a('0x0'));module[_0x910a('0x1')]={'name':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x910a('0x2')],'allowNull':![],'defaultValue':_0x910a('0x3')},'remoteUri':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x910a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9545=['exports','STRING','HelpDesk','sequelize'];(function(_0x5a7c7c,_0x361d68){var _0xcf11da=function(_0x4b3f7c){while(--_0x4b3f7c){_0x5a7c7c['push'](_0x5a7c7c['shift']());}};_0xcf11da(++_0x361d68);}(_0x9545,0x13b));var _0x5954=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x9545[_0x2074db];return _0x27324c;};'use strict';var Sequelize=require(_0x5954('0x0'));module[_0x5954('0x1')]={'name':{'type':Sequelize[_0x5954('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5954('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5954('0x2')],'allowNull':![],'defaultValue':_0x5954('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5954('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5954('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 a0ac5e1..c37ef43 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 _0xf79c=['describe','result','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','error','stringify','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','name','send','index','map','VtigerAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','options','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','token','GET'];(function(_0x1e13be,_0x5ee235){var _0x1c4f47=function(_0x1d1099){while(--_0x1d1099){_0x1e13be['push'](_0x1e13be['shift']());}};_0x1c4f47(++_0x5ee235);}(_0xf79c,0xfb));var _0xcf79=function(_0x5565bf,_0x262624){_0x5565bf=_0x5565bf-0x0;var _0x23b593=_0xf79c[_0x5565bf];return _0x23b593;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf79('0x0'));var jsonpatch=require(_0xcf79('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcf79('0x2'));var Mustache=require(_0xcf79('0x3'));var util=require(_0xcf79('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xcf79('0x5'));var ejs=require(_0xcf79('0x6'));var fs=require('fs');var fs_extra=require(_0xcf79('0x7'));var _=require(_0xcf79('0x8'));var squel=require('squel');var crypto=require(_0xcf79('0x9'));var jsforce=require(_0xcf79('0xa'));var deskjs=require(_0xcf79('0xb'));var toCsv=require(_0xcf79('0x5'));var querystring=require('querystring');var Papa=require(_0xcf79('0xc'));var Redis=require(_0xcf79('0xd'));var authService=require(_0xcf79('0xe'));var qs=require(_0xcf79('0xf'));var as=require(_0xcf79('0x10'));var hardwareService=require(_0xcf79('0x11'));var logger=require('../../config/logger')(_0xcf79('0x12'));var utils=require(_0xcf79('0x13'));var config=require(_0xcf79('0x14'));var licenseUtil=require(_0xcf79('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcf79('0x16'));function respondWithStatusCode(_0x61cc80,_0x4713af){_0x4713af=_0x4713af||0xcc;return function(_0x6a69a2){if(_0x6a69a2){return _0x61cc80[_0xcf79('0x17')](_0x4713af);}return _0x61cc80['status'](_0x4713af)[_0xcf79('0x18')]();};}function respondWithResult(_0x14a0a4,_0x29540a){_0x29540a=_0x29540a||0xc8;return function(_0x76a7c0){if(_0x76a7c0){return _0x14a0a4[_0xcf79('0x19')](_0x29540a)[_0xcf79('0x1a')](_0x76a7c0);}};}function respondWithFilteredResult(_0x5038c9,_0x32c8f9){return function(_0x130697){if(_0x130697){var _0x2b1a24=typeof _0x32c8f9[_0xcf79('0x1b')]===_0xcf79('0x1c')&&typeof _0x32c8f9[_0xcf79('0x1d')]===_0xcf79('0x1c');var _0x1e5b94=_0x130697['count'];var _0x50defe=_0x2b1a24?0x0:_0x32c8f9[_0xcf79('0x1b')];var _0x2f86a4=_0x2b1a24?_0x130697['count']:_0x32c8f9[_0xcf79('0x1b')]+_0x32c8f9[_0xcf79('0x1d')];var _0x348d1e;if(_0x2f86a4>=_0x1e5b94){_0x2f86a4=_0x1e5b94;_0x348d1e=0xc8;}else{_0x348d1e=0xce;}_0x5038c9['status'](_0x348d1e);return _0x5038c9[_0xcf79('0x1e')]('Content-Range',_0x50defe+'-'+_0x2f86a4+'/'+_0x1e5b94)[_0xcf79('0x1a')](_0x130697);}return null;};}function patchUpdates(_0x348780){return function(_0x25d543){try{jsonpatch[_0xcf79('0x1f')](_0x25d543,_0x348780,!![]);}catch(_0x4fa7b5){return BPromise[_0xcf79('0x20')](_0x4fa7b5);}return _0x25d543['save']();};}function saveUpdates(_0x14ed8a,_0x1dd1a2){return function(_0x183ce6){if(_0x183ce6){return _0x183ce6[_0xcf79('0x21')](_0x14ed8a)[_0xcf79('0x22')](function(_0x4e36b7){return _0x4e36b7;});}return null;};}function removeEntity(_0x45dfe8,_0x34dd83){return function(_0x2f6d73){if(_0x2f6d73){return _0x2f6d73[_0xcf79('0x23')]()[_0xcf79('0x22')](function(){_0x45dfe8[_0xcf79('0x19')](0xcc)[_0xcf79('0x18')]();});}};}function handleEntityNotFound(_0x2b97f9,_0x200e79){return function(_0xffc7a0){if(!_0xffc7a0){_0x2b97f9[_0xcf79('0x17')](0x194);}return _0xffc7a0;};}function handleError(_0x44ccda,_0x12bc36){_0x12bc36=_0x12bc36||0x1f4;return function(_0x356bbb){logger['error'](_0x356bbb['stack']);if(_0x356bbb['name']){delete _0x356bbb[_0xcf79('0x24')];}_0x44ccda[_0xcf79('0x19')](_0x12bc36)[_0xcf79('0x25')](_0x356bbb);};}exports[_0xcf79('0x26')]=function(_0x26f0f5,_0x3e9fee){var _0x155936={},_0x10ee39={},_0x1a520e={'count':0x0,'rows':[]};var _0x2fb596=_[_0xcf79('0x27')](db[_0xcf79('0x28')][_0xcf79('0x29')],function(_0xe726f){return{'name':_0xe726f['fieldName'],'type':_0xe726f[_0xcf79('0x2a')][_0xcf79('0x2b')]};});_0x10ee39['model']=_[_0xcf79('0x27')](_0x2fb596,'name');_0x10ee39[_0xcf79('0x2c')]=_['keys'](_0x26f0f5[_0xcf79('0x2c')]);_0x10ee39[_0xcf79('0x2d')]=_[_0xcf79('0x2e')](_0x10ee39[_0xcf79('0x2f')],_0x10ee39[_0xcf79('0x2c')]);_0x155936[_0xcf79('0x30')]=_[_0xcf79('0x2e')](_0x10ee39[_0xcf79('0x2f')],qs['fields'](_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x31')]));_0x155936[_0xcf79('0x30')]=_0x155936[_0xcf79('0x30')][_0xcf79('0x32')]?_0x155936['attributes']:_0x10ee39[_0xcf79('0x2f')];if(!_0x26f0f5[_0xcf79('0x2c')]['hasOwnProperty'](_0xcf79('0x33'))){_0x155936[_0xcf79('0x1d')]=qs[_0xcf79('0x1d')](_0x26f0f5['query'][_0xcf79('0x1d')]);_0x155936[_0xcf79('0x1b')]=qs[_0xcf79('0x1b')](_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x1b')]);}_0x155936[_0xcf79('0x34')]=qs['sort'](_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x35')]);_0x155936[_0xcf79('0x36')]=qs[_0xcf79('0x2d')](_['pick'](_0x26f0f5['query'],_0x10ee39[_0xcf79('0x2d')]),_0x2fb596);if(_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x37')]){_0x155936['where']=_[_0xcf79('0x38')](_0x155936[_0xcf79('0x36')],{'$or':_[_0xcf79('0x27')](_0x2fb596,function(_0x4010fc){if(_0x4010fc[_0xcf79('0x2a')]!=='VIRTUAL'){var _0x27ca69={};_0x27ca69[_0x4010fc[_0xcf79('0x24')]]={'$like':'%'+_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x37')]+'%'};return _0x27ca69;}})});}_0x155936=_[_0xcf79('0x38')]({},_0x155936,_0x26f0f5['options']);var _0x47739f={'where':_0x155936['where']};return db[_0xcf79('0x28')]['count'](_0x47739f)['then'](function(_0x124a07){_0x1a520e['count']=_0x124a07;if(_0x26f0f5[_0xcf79('0x2c')][_0xcf79('0x39')]){_0x155936['include']=[{'all':!![]}];}return db[_0xcf79('0x28')][_0xcf79('0x3a')](_0x155936);})[_0xcf79('0x22')](function(_0x2ad74c){_0x1a520e[_0xcf79('0x3b')]=_0x2ad74c;return _0x1a520e;})[_0xcf79('0x22')](respondWithFilteredResult(_0x3e9fee,_0x155936))[_0xcf79('0x3c')](handleError(_0x3e9fee,null));};exports[_0xcf79('0x3d')]=function(_0x567e3e,_0x34059d){var _0x3c4ae6={'raw':![],'where':{'id':_0x567e3e[_0xcf79('0x3e')]['id']}},_0x3a5422={};_0x3a5422[_0xcf79('0x2f')]=_[_0xcf79('0x3f')](db[_0xcf79('0x28')][_0xcf79('0x29')]);_0x3a5422[_0xcf79('0x2c')]=_[_0xcf79('0x3f')](_0x567e3e['query']);_0x3a5422[_0xcf79('0x2d')]=_[_0xcf79('0x2e')](_0x3a5422['model'],_0x3a5422['query']);_0x3c4ae6[_0xcf79('0x30')]=_[_0xcf79('0x2e')](_0x3a5422[_0xcf79('0x2f')],qs[_0xcf79('0x31')](_0x567e3e[_0xcf79('0x2c')]['fields']));_0x3c4ae6[_0xcf79('0x30')]=_0x3c4ae6[_0xcf79('0x30')][_0xcf79('0x32')]?_0x3c4ae6[_0xcf79('0x30')]:_0x3a5422['model'];if(_0x567e3e[_0xcf79('0x2c')][_0xcf79('0x39')]){_0x3c4ae6[_0xcf79('0x40')]=[{'all':!![]}];}_0x3c4ae6=_['merge']({},_0x3c4ae6,_0x567e3e['options']);return db[_0xcf79('0x28')][_0xcf79('0x41')](_0x3c4ae6)['then'](handleEntityNotFound(_0x34059d,null))[_0xcf79('0x22')](respondWithResult(_0x34059d,null))[_0xcf79('0x3c')](handleError(_0x34059d,null));};exports[_0xcf79('0x42')]=function(_0x9d82c7,_0x6edc25){return db['VtigerAccount']['create'](_0x9d82c7[_0xcf79('0x43')],{})[_0xcf79('0x22')](respondWithResult(_0x6edc25,0xc9))['catch'](handleError(_0x6edc25,null));};exports[_0xcf79('0x21')]=function(_0x416847,_0x3f6bda){if(_0x416847[_0xcf79('0x43')]['id']){delete _0x416847[_0xcf79('0x43')]['id'];}return db[_0xcf79('0x28')][_0xcf79('0x41')]({'where':{'id':_0x416847[_0xcf79('0x3e')]['id']}})[_0xcf79('0x22')](handleEntityNotFound(_0x3f6bda,null))[_0xcf79('0x22')](saveUpdates(_0x416847[_0xcf79('0x43')],null))[_0xcf79('0x22')](respondWithResult(_0x3f6bda,null))['catch'](handleError(_0x3f6bda,null));};exports[_0xcf79('0x23')]=function(_0x44118d,_0x4f2da3){return db[_0xcf79('0x28')][_0xcf79('0x41')]({'where':{'id':_0x44118d[_0xcf79('0x3e')]['id']}})[_0xcf79('0x22')](handleEntityNotFound(_0x4f2da3,null))[_0xcf79('0x22')](removeEntity(_0x4f2da3,null))[_0xcf79('0x3c')](handleError(_0x4f2da3,null));};exports[_0xcf79('0x44')]=function(_0x373ecc,_0x38b16b,_0x3bf977){var _0xa9befe={};var _0x3781c8={};var _0x46721d;var _0x590543;return db['VtigerAccount'][_0xcf79('0x45')]({'where':{'id':_0x373ecc[_0xcf79('0x3e')]['id']}})['then'](handleEntityNotFound(_0x38b16b,null))[_0xcf79('0x22')](function(_0x460e10){if(_0x460e10){_0x46721d=_0x460e10;_0x3781c8[_0xcf79('0x2f')]=_[_0xcf79('0x3f')](db[_0xcf79('0x46')][_0xcf79('0x29')]);_0x3781c8[_0xcf79('0x2c')]=_['keys'](_0x373ecc[_0xcf79('0x2c')]);_0x3781c8['filters']=_[_0xcf79('0x2e')](_0x3781c8['model'],_0x3781c8[_0xcf79('0x2c')]);_0xa9befe[_0xcf79('0x30')]=_['intersection'](_0x3781c8['model'],qs['fields'](_0x373ecc[_0xcf79('0x2c')]['fields']));_0xa9befe[_0xcf79('0x30')]=_0xa9befe[_0xcf79('0x30')]['length']?_0xa9befe[_0xcf79('0x30')]:_0x3781c8['model'];_0xa9befe[_0xcf79('0x34')]=qs[_0xcf79('0x35')](_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x35')]);_0xa9befe[_0xcf79('0x36')]=qs['filters'](_[_0xcf79('0x47')](_0x373ecc[_0xcf79('0x2c')],_0x3781c8[_0xcf79('0x2d')]));if(_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x37')]){_0xa9befe[_0xcf79('0x36')]=_['merge'](_0xa9befe['where'],{'$or':_[_0xcf79('0x27')](_0xa9befe['attributes'],function(_0x22e365){var _0x21091d={};_0x21091d[_0x22e365]={'$like':'%'+_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x37')]+'%'};return _0x21091d;})});}_0xa9befe=_[_0xcf79('0x38')]({},_0xa9befe,_0x373ecc[_0xcf79('0x48')]);return _0x46721d['getConfigurations'](_0xa9befe);}})['then'](function(_0x20067e){if(_0x20067e){_0x590543=_0x20067e['length'];if(!_0x373ecc[_0xcf79('0x2c')][_0xcf79('0x49')]('nolimit')){_0xa9befe[_0xcf79('0x1d')]=qs['limit'](_0x373ecc['query']['limit']);_0xa9befe[_0xcf79('0x1b')]=qs['offset'](_0x373ecc['query'][_0xcf79('0x1b')]);}return _0x46721d['getConfigurations'](_0xa9befe);}})['then'](function(_0x7c984b){if(_0x7c984b){return _0x7c984b?{'count':_0x590543,'rows':_0x7c984b}:null;}})[_0xcf79('0x22')](respondWithResult(_0x38b16b,null))['catch'](handleError(_0x38b16b,null));};exports[_0xcf79('0x4a')]=function(_0x4a2fa1,_0x38c6cd,_0x3de39f){if(_0x4a2fa1[_0xcf79('0x43')]['id']){delete _0x4a2fa1[_0xcf79('0x43')]['id'];}return db[_0xcf79('0x28')][_0xcf79('0x45')]({'where':{'id':_0x4a2fa1[_0xcf79('0x3e')]['id']}})[_0xcf79('0x22')](handleEntityNotFound(_0x38c6cd,null))[_0xcf79('0x22')](function(_0x49e37b){if(_0x49e37b){_0x4a2fa1[_0xcf79('0x43')]['AccountId']=_0x49e37b['id'];_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x4b')]=integrations[_0xcf79('0x4c')](_0x4a2fa1['body'][_0xcf79('0x4d')],_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x2a')]);_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x4e')]=integrations['getDescriptions'](_0x4a2fa1['body'][_0xcf79('0x4d')],_0x4a2fa1[_0xcf79('0x43')][_0xcf79('0x2a')]);return db[_0xcf79('0x46')][_0xcf79('0x42')](_0x4a2fa1['body'],{'include':[{'model':db[_0xcf79('0x4f')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0xcf79('0x4e')}]});}return null;})[_0xcf79('0x22')](respondWithResult(_0x38c6cd,null))['catch'](handleError(_0x38c6cd,null));};var md5=require('md5');exports[_0xcf79('0x50')]=function(_0x4b0d7d,_0x34223b,_0x4229b9){var _0x50e3b6=null;var _0x40e33f=null;var _0x167b96=null;var _0x2f2e99=null;var _0x3292f4='';return db[_0xcf79('0x28')][_0xcf79('0x45')]({'where':{'id':_0x4b0d7d[_0xcf79('0x3e')]['id']},'attributes':['id','name',_0xcf79('0x51'),_0xcf79('0x52'),_0xcf79('0x53'),'remoteUri',_0xcf79('0x54'),_0xcf79('0x55')]})['then'](handleEntityNotFound(_0x34223b,null))[_0xcf79('0x22')](function(_0x49102d){if(_0x49102d){_0x50e3b6=_0x49102d['username'];_0x40e33f=_0x49102d[_0xcf79('0x55')];_0x167b96=_0x49102d[_0xcf79('0x53')];_0x3292f4=_0x49102d[_0xcf79('0x56')];var _0x4fc36e=_0x3292f4['slice'](-0x1);if(_0x4fc36e==='/'){_0x3292f4=_0x3292f4[_0xcf79('0x57')](0x0,_0x3292f4[_0xcf79('0x58')](_0x4fc36e));}_0x2f2e99=util[_0xcf79('0x59')](_0xcf79('0x5a'),_0x3292f4);var _0x391b75={'method':'GET','uri':_0x2f2e99,'qs':{'operation':_0xcf79('0x5b'),'username':_0x49102d[_0xcf79('0x51')]},'json':!![]};return rp(_0x391b75);}})[_0xcf79('0x22')](function(_0x5696ff){if(_0x5696ff[_0xcf79('0x5c')]){var _0x9dd574={'method':_0xcf79('0x5d'),'uri':_0x2f2e99,'form':{'operation':_0xcf79('0x5e'),'username':_0x50e3b6,'accessKey':md5(_0x5696ff['result'][_0xcf79('0x5f')]+_0x40e33f)},'json':!![]};return rp(_0x9dd574);}})[_0xcf79('0x22')](function(_0x217462){if(_0x217462[_0xcf79('0x5c')]){var _0x1a8e2d={'method':_0xcf79('0x60'),'uri':_0x2f2e99,'qs':{'operation':_0xcf79('0x61'),'username':_0x50e3b6,'sessionName':_0x217462[_0xcf79('0x62')]['sessionName'],'elementType':_0x167b96},'json':!![]};return rp(_0x1a8e2d);}})[_0xcf79('0x22')](function(_0x431dfb){if(_0x431dfb[_0xcf79('0x5c')]){var _0x1fd083=[_0xcf79('0x63'),'reference',_0xcf79('0x64')];_[_0xcf79('0x65')](_0x431dfb['result'][_0xcf79('0x31')],function(_0x54087f){return _0x1fd083[_0xcf79('0x66')](_0x54087f[_0xcf79('0x2a')][_0xcf79('0x24')]);});_['remove'](_0x431dfb[_0xcf79('0x62')][_0xcf79('0x31')],function(_0x42a615){return _0x42a615[_0xcf79('0x67')]===_0xcf79('0x68');});return{'count':_0x431dfb[_0xcf79('0x62')][_0xcf79('0x31')][_0xcf79('0x32')],'rows':_['map'](_0x431dfb[_0xcf79('0x62')][_0xcf79('0x31')],function(_0x3b7ae0){return{'id':_0x3b7ae0[_0xcf79('0x24')],'name':_0x3b7ae0[_0xcf79('0x69')],'custom':_[_0xcf79('0x6a')](_0x3b7ae0[_0xcf79('0x24')],_0xcf79('0x6b'))?!![]:![],'options':_0x3b7ae0['type'][_0xcf79('0x24')]===_0xcf79('0x6c')&&_0x3b7ae0[_0xcf79('0x2a')][_0xcf79('0x6d')][_0xcf79('0x32')]>0x0?_[_0xcf79('0x27')](_0x3b7ae0[_0xcf79('0x2a')][_0xcf79('0x6d')],function(_0x281293){return{'name':_0x281293[_0xcf79('0x69')],'value':_0x281293[_0xcf79('0x6e')]};}):[]};})};}})[_0xcf79('0x22')](respondWithResult(_0x34223b,null))[_0xcf79('0x3c')](function(_0x61feda){console['log'](_0xcf79('0x6f')+_0x61feda);var _0x5ce340=_0x4b0d7d[_0xcf79('0x2c')][_0xcf79('0x70')]?0x1f4:_0x61feda[_0xcf79('0x71')]||0x1f4;logger[_0xcf79('0x72')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5ce340,JSON[_0xcf79('0x73')](_0x61feda));delete _0x61feda['name'];if(_0x5ce340===0x191){_0x5ce340=0x190;}_0x34223b['status'](_0x5ce340)[_0xcf79('0x25')](_0x4b0d7d[_0xcf79('0x2c')][_0xcf79('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x61feda[_0xcf79('0x71')]}:_0x61feda);});}; \ No newline at end of file +var _0x2feb=['sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','VtigerAccount','rawAttributes','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','GET','result','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x245574,_0x3815a5){var _0x3ae7e0=function(_0x6c2c01){while(--_0x6c2c01){_0x245574['push'](_0x245574['shift']());}};_0x3ae7e0(++_0x3815a5);}(_0x2feb,0x12f));var _0xb2fe=function(_0x428dbd,_0x30eeb5){_0x428dbd=_0x428dbd-0x0;var _0xc411d8=_0x2feb[_0x428dbd];return _0xc411d8;};'use strict';var emlformat=require(_0xb2fe('0x0'));var rimraf=require(_0xb2fe('0x1'));var zipdir=require(_0xb2fe('0x2'));var jsonpatch=require(_0xb2fe('0x3'));var rp=require('request-promise');var moment=require(_0xb2fe('0x4'));var BPromise=require(_0xb2fe('0x5'));var Mustache=require(_0xb2fe('0x6'));var util=require('util');var path=require(_0xb2fe('0x7'));var sox=require(_0xb2fe('0x8'));var csv=require(_0xb2fe('0x9'));var ejs=require(_0xb2fe('0xa'));var fs=require('fs');var fs_extra=require(_0xb2fe('0xb'));var _=require('lodash');var squel=require(_0xb2fe('0xc'));var crypto=require(_0xb2fe('0xd'));var jsforce=require(_0xb2fe('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb2fe('0xf'));var Redis=require(_0xb2fe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb2fe('0x11'));var as=require(_0xb2fe('0x12'));var hardwareService=require(_0xb2fe('0x13'));var logger=require(_0xb2fe('0x14'))(_0xb2fe('0x15'));var utils=require('../../config/utils');var config=require(_0xb2fe('0x16'));var licenseUtil=require(_0xb2fe('0x17'));var db=require(_0xb2fe('0x18'))['db'];var integrations=require(_0xb2fe('0x19'));function respondWithStatusCode(_0x454374,_0x3af4ce){_0x3af4ce=_0x3af4ce||0xcc;return function(_0x30517d){if(_0x30517d){return _0x454374[_0xb2fe('0x1a')](_0x3af4ce);}return _0x454374[_0xb2fe('0x1b')](_0x3af4ce)[_0xb2fe('0x1c')]();};}function respondWithResult(_0x161d8e,_0x25655b){_0x25655b=_0x25655b||0xc8;return function(_0xd4b21d){if(_0xd4b21d){return _0x161d8e[_0xb2fe('0x1b')](_0x25655b)[_0xb2fe('0x1d')](_0xd4b21d);}};}function respondWithFilteredResult(_0x40ec92,_0x318324){return function(_0x40708c){if(_0x40708c){var _0x49a4e8=typeof _0x318324[_0xb2fe('0x1e')]===_0xb2fe('0x1f')&&typeof _0x318324[_0xb2fe('0x20')]===_0xb2fe('0x1f');var _0x321335=_0x40708c[_0xb2fe('0x21')];var _0x56d8d2=_0x49a4e8?0x0:_0x318324[_0xb2fe('0x1e')];var _0x580706=_0x49a4e8?_0x40708c[_0xb2fe('0x21')]:_0x318324[_0xb2fe('0x1e')]+_0x318324[_0xb2fe('0x20')];var _0x14eddc;if(_0x580706>=_0x321335){_0x580706=_0x321335;_0x14eddc=0xc8;}else{_0x14eddc=0xce;}_0x40ec92[_0xb2fe('0x1b')](_0x14eddc);return _0x40ec92['set']('Content-Range',_0x56d8d2+'-'+_0x580706+'/'+_0x321335)['json'](_0x40708c);}return null;};}function patchUpdates(_0x42d6c5){return function(_0x4fb6ec){try{jsonpatch[_0xb2fe('0x22')](_0x4fb6ec,_0x42d6c5,!![]);}catch(_0xee1cdc){return BPromise[_0xb2fe('0x23')](_0xee1cdc);}return _0x4fb6ec[_0xb2fe('0x24')]();};}function saveUpdates(_0x15be26,_0x42709b){return function(_0x35d845){if(_0x35d845){return _0x35d845[_0xb2fe('0x25')](_0x15be26)[_0xb2fe('0x26')](function(_0x29d848){return _0x29d848;});}return null;};}function removeEntity(_0x2c1157,_0x3d2f78){return function(_0x4f4cac){if(_0x4f4cac){return _0x4f4cac[_0xb2fe('0x27')]()[_0xb2fe('0x26')](function(){_0x2c1157[_0xb2fe('0x1b')](0xcc)[_0xb2fe('0x1c')]();});}};}function handleEntityNotFound(_0x4e7c32,_0x2195c8){return function(_0x35430d){if(!_0x35430d){_0x4e7c32['sendStatus'](0x194);}return _0x35430d;};}function handleError(_0x4a1729,_0x1e12b9){_0x1e12b9=_0x1e12b9||0x1f4;return function(_0x3550d3){logger[_0xb2fe('0x28')](_0x3550d3[_0xb2fe('0x29')]);if(_0x3550d3[_0xb2fe('0x2a')]){delete _0x3550d3[_0xb2fe('0x2a')];}_0x4a1729[_0xb2fe('0x1b')](_0x1e12b9)['send'](_0x3550d3);};}exports['index']=function(_0x321695,_0x39f8fb){var _0x449de4={},_0x4fc254={},_0x3cd10e={'count':0x0,'rows':[]};var _0xd939de=_[_0xb2fe('0x2b')](db['VtigerAccount']['rawAttributes'],function(_0xc8f96b){return{'name':_0xc8f96b['fieldName'],'type':_0xc8f96b[_0xb2fe('0x2c')]['key']};});_0x4fc254['model']=_[_0xb2fe('0x2b')](_0xd939de,_0xb2fe('0x2a'));_0x4fc254[_0xb2fe('0x2d')]=_[_0xb2fe('0x2e')](_0x321695[_0xb2fe('0x2d')]);_0x4fc254['filters']=_[_0xb2fe('0x2f')](_0x4fc254[_0xb2fe('0x30')],_0x4fc254[_0xb2fe('0x2d')]);_0x449de4['attributes']=_[_0xb2fe('0x2f')](_0x4fc254['model'],qs['fields'](_0x321695[_0xb2fe('0x2d')][_0xb2fe('0x31')]));_0x449de4['attributes']=_0x449de4[_0xb2fe('0x32')]['length']?_0x449de4[_0xb2fe('0x32')]:_0x4fc254[_0xb2fe('0x30')];if(!_0x321695[_0xb2fe('0x2d')][_0xb2fe('0x33')](_0xb2fe('0x34'))){_0x449de4[_0xb2fe('0x20')]=qs[_0xb2fe('0x20')](_0x321695[_0xb2fe('0x2d')][_0xb2fe('0x20')]);_0x449de4['offset']=qs[_0xb2fe('0x1e')](_0x321695[_0xb2fe('0x2d')][_0xb2fe('0x1e')]);}_0x449de4[_0xb2fe('0x35')]=qs['sort'](_0x321695[_0xb2fe('0x2d')][_0xb2fe('0x36')]);_0x449de4[_0xb2fe('0x37')]=qs[_0xb2fe('0x38')](_[_0xb2fe('0x39')](_0x321695[_0xb2fe('0x2d')],_0x4fc254[_0xb2fe('0x38')]),_0xd939de);if(_0x321695['query']['filter']){_0x449de4[_0xb2fe('0x37')]=_[_0xb2fe('0x3a')](_0x449de4['where'],{'$or':_['map'](_0xd939de,function(_0x20d01a){if(_0x20d01a[_0xb2fe('0x2c')]!=='VIRTUAL'){var _0x3cf121={};_0x3cf121[_0x20d01a[_0xb2fe('0x2a')]]={'$like':'%'+_0x321695['query'][_0xb2fe('0x3b')]+'%'};return _0x3cf121;}})});}_0x449de4=_[_0xb2fe('0x3a')]({},_0x449de4,_0x321695[_0xb2fe('0x3c')]);var _0xd164d3={'where':_0x449de4['where']};return db['VtigerAccount'][_0xb2fe('0x21')](_0xd164d3)['then'](function(_0x3c0aeb){_0x3cd10e['count']=_0x3c0aeb;if(_0x321695[_0xb2fe('0x2d')][_0xb2fe('0x3d')]){_0x449de4[_0xb2fe('0x3e')]=[{'all':!![]}];}return db['VtigerAccount'][_0xb2fe('0x3f')](_0x449de4);})[_0xb2fe('0x26')](function(_0x28f5f4){_0x3cd10e[_0xb2fe('0x40')]=_0x28f5f4;return _0x3cd10e;})[_0xb2fe('0x26')](respondWithFilteredResult(_0x39f8fb,_0x449de4))[_0xb2fe('0x41')](handleError(_0x39f8fb,null));};exports['show']=function(_0x32c798,_0xd1abbd){var _0x4a26d8={'raw':![],'where':{'id':_0x32c798[_0xb2fe('0x42')]['id']}},_0x437221={};_0x437221[_0xb2fe('0x30')]=_[_0xb2fe('0x2e')](db[_0xb2fe('0x43')][_0xb2fe('0x44')]);_0x437221[_0xb2fe('0x2d')]=_['keys'](_0x32c798[_0xb2fe('0x2d')]);_0x437221[_0xb2fe('0x38')]=_[_0xb2fe('0x2f')](_0x437221[_0xb2fe('0x30')],_0x437221[_0xb2fe('0x2d')]);_0x4a26d8[_0xb2fe('0x32')]=_['intersection'](_0x437221[_0xb2fe('0x30')],qs[_0xb2fe('0x31')](_0x32c798['query'][_0xb2fe('0x31')]));_0x4a26d8[_0xb2fe('0x32')]=_0x4a26d8[_0xb2fe('0x32')][_0xb2fe('0x45')]?_0x4a26d8['attributes']:_0x437221[_0xb2fe('0x30')];if(_0x32c798[_0xb2fe('0x2d')][_0xb2fe('0x3d')]){_0x4a26d8['include']=[{'all':!![]}];}_0x4a26d8=_[_0xb2fe('0x3a')]({},_0x4a26d8,_0x32c798[_0xb2fe('0x3c')]);return db['VtigerAccount'][_0xb2fe('0x46')](_0x4a26d8)[_0xb2fe('0x26')](handleEntityNotFound(_0xd1abbd,null))[_0xb2fe('0x26')](respondWithResult(_0xd1abbd,null))[_0xb2fe('0x41')](handleError(_0xd1abbd,null));};exports[_0xb2fe('0x47')]=function(_0x57f122,_0xfec9b){return db[_0xb2fe('0x43')][_0xb2fe('0x47')](_0x57f122[_0xb2fe('0x48')],{})['then'](respondWithResult(_0xfec9b,0xc9))[_0xb2fe('0x41')](handleError(_0xfec9b,null));};exports[_0xb2fe('0x25')]=function(_0x3892e9,_0x31ad43){if(_0x3892e9['body']['id']){delete _0x3892e9[_0xb2fe('0x48')]['id'];}return db[_0xb2fe('0x43')]['find']({'where':{'id':_0x3892e9['params']['id']}})['then'](handleEntityNotFound(_0x31ad43,null))[_0xb2fe('0x26')](saveUpdates(_0x3892e9['body'],null))['then'](respondWithResult(_0x31ad43,null))[_0xb2fe('0x41')](handleError(_0x31ad43,null));};exports[_0xb2fe('0x27')]=function(_0x56f1b9,_0x5d20d6){return db['VtigerAccount'][_0xb2fe('0x46')]({'where':{'id':_0x56f1b9[_0xb2fe('0x42')]['id']}})[_0xb2fe('0x26')](handleEntityNotFound(_0x5d20d6,null))[_0xb2fe('0x26')](removeEntity(_0x5d20d6,null))[_0xb2fe('0x41')](handleError(_0x5d20d6,null));};exports[_0xb2fe('0x49')]=function(_0x399538,_0x4ea378,_0x14ceaa){var _0x1c7e8c={};var _0x3af626={};var _0x16e099;var _0x1e4c1c;return db['VtigerAccount'][_0xb2fe('0x4a')]({'where':{'id':_0x399538[_0xb2fe('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ea378,null))[_0xb2fe('0x26')](function(_0x34fa22){if(_0x34fa22){_0x16e099=_0x34fa22;_0x3af626[_0xb2fe('0x30')]=_[_0xb2fe('0x2e')](db[_0xb2fe('0x4b')][_0xb2fe('0x44')]);_0x3af626[_0xb2fe('0x2d')]=_['keys'](_0x399538['query']);_0x3af626[_0xb2fe('0x38')]=_[_0xb2fe('0x2f')](_0x3af626['model'],_0x3af626[_0xb2fe('0x2d')]);_0x1c7e8c[_0xb2fe('0x32')]=_[_0xb2fe('0x2f')](_0x3af626[_0xb2fe('0x30')],qs[_0xb2fe('0x31')](_0x399538[_0xb2fe('0x2d')][_0xb2fe('0x31')]));_0x1c7e8c[_0xb2fe('0x32')]=_0x1c7e8c[_0xb2fe('0x32')][_0xb2fe('0x45')]?_0x1c7e8c['attributes']:_0x3af626[_0xb2fe('0x30')];_0x1c7e8c[_0xb2fe('0x35')]=qs[_0xb2fe('0x36')](_0x399538[_0xb2fe('0x2d')][_0xb2fe('0x36')]);_0x1c7e8c[_0xb2fe('0x37')]=qs[_0xb2fe('0x38')](_[_0xb2fe('0x39')](_0x399538[_0xb2fe('0x2d')],_0x3af626[_0xb2fe('0x38')]));if(_0x399538[_0xb2fe('0x2d')][_0xb2fe('0x3b')]){_0x1c7e8c['where']=_[_0xb2fe('0x3a')](_0x1c7e8c[_0xb2fe('0x37')],{'$or':_[_0xb2fe('0x2b')](_0x1c7e8c['attributes'],function(_0x169bed){var _0x4875e2={};_0x4875e2[_0x169bed]={'$like':'%'+_0x399538[_0xb2fe('0x2d')][_0xb2fe('0x3b')]+'%'};return _0x4875e2;})});}_0x1c7e8c=_[_0xb2fe('0x3a')]({},_0x1c7e8c,_0x399538[_0xb2fe('0x3c')]);return _0x16e099[_0xb2fe('0x49')](_0x1c7e8c);}})[_0xb2fe('0x26')](function(_0x3a53f1){if(_0x3a53f1){_0x1e4c1c=_0x3a53f1[_0xb2fe('0x45')];if(!_0x399538[_0xb2fe('0x2d')][_0xb2fe('0x33')](_0xb2fe('0x34'))){_0x1c7e8c[_0xb2fe('0x20')]=qs[_0xb2fe('0x20')](_0x399538[_0xb2fe('0x2d')]['limit']);_0x1c7e8c['offset']=qs[_0xb2fe('0x1e')](_0x399538[_0xb2fe('0x2d')][_0xb2fe('0x1e')]);}return _0x16e099['getConfigurations'](_0x1c7e8c);}})[_0xb2fe('0x26')](function(_0x5dba22){if(_0x5dba22){return _0x5dba22?{'count':_0x1e4c1c,'rows':_0x5dba22}:null;}})[_0xb2fe('0x26')](respondWithResult(_0x4ea378,null))[_0xb2fe('0x41')](handleError(_0x4ea378,null));};exports[_0xb2fe('0x4c')]=function(_0x364abd,_0x576aed,_0x432cfa){if(_0x364abd[_0xb2fe('0x48')]['id']){delete _0x364abd['body']['id'];}return db[_0xb2fe('0x43')][_0xb2fe('0x4a')]({'where':{'id':_0x364abd[_0xb2fe('0x42')]['id']}})[_0xb2fe('0x26')](handleEntityNotFound(_0x576aed,null))[_0xb2fe('0x26')](function(_0xd01f6b){if(_0xd01f6b){_0x364abd[_0xb2fe('0x48')][_0xb2fe('0x4d')]=_0xd01f6b['id'];_0x364abd[_0xb2fe('0x48')][_0xb2fe('0x4e')]=integrations[_0xb2fe('0x4f')](_0x364abd['body'][_0xb2fe('0x50')],_0x364abd[_0xb2fe('0x48')][_0xb2fe('0x2c')]);_0x364abd[_0xb2fe('0x48')][_0xb2fe('0x51')]=integrations[_0xb2fe('0x52')](_0x364abd[_0xb2fe('0x48')][_0xb2fe('0x50')],_0x364abd['body']['type']);return db[_0xb2fe('0x4b')][_0xb2fe('0x47')](_0x364abd['body'],{'include':[{'model':db[_0xb2fe('0x53')],'as':_0xb2fe('0x4e')},{'model':db[_0xb2fe('0x53')],'as':_0xb2fe('0x51')}]});}return null;})['then'](respondWithResult(_0x576aed,null))[_0xb2fe('0x41')](handleError(_0x576aed,null));};var md5=require(_0xb2fe('0x54'));exports[_0xb2fe('0x55')]=function(_0xa050de,_0x172351,_0x19ec41){var _0x2f567b=null;var _0x3765b4=null;var _0x3a59e7=null;var _0x109e63=null;var _0x284d76='';return db[_0xb2fe('0x43')][_0xb2fe('0x4a')]({'where':{'id':_0xa050de[_0xb2fe('0x42')]['id']},'attributes':['id',_0xb2fe('0x2a'),_0xb2fe('0x56'),_0xb2fe('0x57'),_0xb2fe('0x58'),'remoteUri',_0xb2fe('0x59'),_0xb2fe('0x5a')]})[_0xb2fe('0x26')](handleEntityNotFound(_0x172351,null))[_0xb2fe('0x26')](function(_0x386e49){if(_0x386e49){_0x2f567b=_0x386e49['username'];_0x3765b4=_0x386e49[_0xb2fe('0x5a')];_0x3a59e7=_0x386e49['moduleName'];_0x284d76=_0x386e49[_0xb2fe('0x5b')];var _0x1d9495=_0x284d76[_0xb2fe('0x5c')](-0x1);if(_0x1d9495==='/'){_0x284d76=_0x284d76[_0xb2fe('0x5d')](0x0,_0x284d76[_0xb2fe('0x5e')](_0x1d9495));}_0x109e63=util['format'](_0xb2fe('0x5f'),_0x284d76);var _0x23e82c={'method':'GET','uri':_0x109e63,'qs':{'operation':_0xb2fe('0x60'),'username':_0x386e49[_0xb2fe('0x56')]},'json':!![]};return rp(_0x23e82c);}})['then'](function(_0x4fbf88){if(_0x4fbf88[_0xb2fe('0x61')]){var _0x392ed6={'method':'POST','uri':_0x109e63,'form':{'operation':'login','username':_0x2f567b,'accessKey':md5(_0x4fbf88['result']['token']+_0x3765b4)},'json':!![]};return rp(_0x392ed6);}})[_0xb2fe('0x26')](function(_0x1583c8){if(_0x1583c8[_0xb2fe('0x61')]){var _0x302464={'method':_0xb2fe('0x62'),'uri':_0x109e63,'qs':{'operation':'describe','username':_0x2f567b,'sessionName':_0x1583c8[_0xb2fe('0x63')][_0xb2fe('0x64')],'elementType':_0x3a59e7},'json':!![]};return rp(_0x302464);}})['then'](function(_0x283fa8){if(_0x283fa8[_0xb2fe('0x61')]){var _0x551ee6=[_0xb2fe('0x65'),_0xb2fe('0x66'),_0xb2fe('0x67')];_['remove'](_0x283fa8[_0xb2fe('0x63')]['fields'],function(_0x583561){return _0x551ee6['includes'](_0x583561[_0xb2fe('0x2c')][_0xb2fe('0x2a')]);});_[_0xb2fe('0x68')](_0x283fa8[_0xb2fe('0x63')]['fields'],function(_0x6f21d9){return _0x6f21d9[_0xb2fe('0x69')]===_0xb2fe('0x6a');});return{'count':_0x283fa8['result'][_0xb2fe('0x31')]['length'],'rows':_[_0xb2fe('0x2b')](_0x283fa8[_0xb2fe('0x63')][_0xb2fe('0x31')],function(_0x449255){return{'id':_0x449255[_0xb2fe('0x2a')],'name':_0x449255[_0xb2fe('0x6b')],'custom':_[_0xb2fe('0x6c')](_0x449255[_0xb2fe('0x2a')],_0xb2fe('0x6d'))?!![]:![],'options':_0x449255[_0xb2fe('0x2c')]['name']==='picklist'&&_0x449255[_0xb2fe('0x2c')][_0xb2fe('0x6e')][_0xb2fe('0x45')]>0x0?_[_0xb2fe('0x2b')](_0x449255['type']['picklistValues'],function(_0x3cd3e0){return{'name':_0x3cd3e0[_0xb2fe('0x6b')],'value':_0x3cd3e0[_0xb2fe('0x6f')]};}):[]};})};}})[_0xb2fe('0x26')](respondWithResult(_0x172351,null))[_0xb2fe('0x41')](function(_0x3976bc){console[_0xb2fe('0x70')](_0xb2fe('0x71')+_0x3976bc);var _0x60a655=_0xa050de['query'][_0xb2fe('0x72')]?0x1f4:_0x3976bc[_0xb2fe('0x73')]||0x1f4;logger[_0xb2fe('0x28')](_0xb2fe('0x74'),_0xb2fe('0x55'),_0x60a655,JSON[_0xb2fe('0x75')](_0x3976bc));delete _0x3976bc['name'];if(_0x60a655===0x191){_0x60a655=0x190;}_0x172351[_0xb2fe('0x1b')](_0x60a655)[_0xb2fe('0x76')](_0xa050de['query'][_0xb2fe('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x3976bc['statusCode']}:_0x3976bc);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 038895b..99e3c92 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 _0x028a=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','bluebird','request-promise'];(function(_0x88c0ba,_0x332814){var _0x5af3bc=function(_0x325e13){while(--_0x325e13){_0x88c0ba['push'](_0x88c0ba['shift']());}};_0x5af3bc(++_0x332814);}(_0x028a,0x1b5));var _0xa028=function(_0x56bd3c,_0x5cc83c){_0x56bd3c=_0x56bd3c-0x0;var _0x2c52bb=_0x028a[_0x56bd3c];return _0x2c52bb;};'use strict';var _=require('lodash');var util=require(_0xa028('0x0'));var logger=require(_0xa028('0x1'))(_0xa028('0x2'));var moment=require('moment');var BPromise=require(_0xa028('0x3'));var rp=require(_0xa028('0x4'));var fs=require('fs');var path=require(_0xa028('0x5'));var rimraf=require(_0xa028('0x6'));var config=require(_0xa028('0x7'));var attributes=require(_0xa028('0x8'));var integrations=require(_0xa028('0x9'));module['exports']=function(_0x499cbb,_0x31ed94){return _0x499cbb[_0xa028('0xa')](_0xa028('0xb'),attributes,{'tableName':_0xa028('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0956=['moment','rimraf','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0xf9e76,_0x2e6b9a){var _0x119a9b=function(_0x146396){while(--_0x146396){_0xf9e76['push'](_0xf9e76['shift']());}};_0x119a9b(++_0x2e6b9a);}(_0x0956,0x130));var _0x6095=function(_0x3a4f5d,_0x26e471){_0x3a4f5d=_0x3a4f5d-0x0;var _0x5ec484=_0x0956[_0x3a4f5d];return _0x5ec484;};'use strict';var _=require(_0x6095('0x0'));var util=require(_0x6095('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6095('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6095('0x3'));var config=require('../../config/environment');var attributes=require(_0x6095('0x4'));var integrations=require('../../components/integrations/configuration');module[_0x6095('0x5')]=function(_0x4be339,_0x36379c){return _0x4be339[_0x6095('0x6')](_0x6095('0x7'),attributes,{'tableName':_0x6095('0x8'),'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 8ae679c..cbcf652 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 _0xed3c=['catch','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed3c,0x1a6));var _0xced3=function(_0x1938f4,_0x5c0c98){_0x1938f4=_0x1938f4-0x0;var _0x37f4db=_0xed3c[_0x1938f4];return _0x37f4db;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['GetVtigerAccount']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')]({'raw':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x4569af[_0xced3('0x17')]?_0x4569af[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x4569af[_0xced3('0x17')]?_0x4569af['options']['attributes']||null:null,'limit':_0x4569af['options']?_0x4569af[_0xced3('0x17')][_0xced3('0x1a')]||null:null,'include':_0x4569af[_0xced3('0x17')]?_0x4569af['options'][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x4569af['options']['include'],function(_0x3adf14){return{'model':db[_0x3adf14[_0xced3('0x1d')]],'as':_0x3adf14['as'],'attributes':_0x3adf14[_0xced3('0x1e')],'include':_0x3adf14[_0xced3('0x1b')]?_['map'](_0x3adf14[_0xced3('0x1b')],function(_0x23f92b){return{'model':db[_0x23f92b['model']],'as':_0x23f92b['as'],'attributes':_0x23f92b[_0xced3('0x1e')],'include':_0x23f92b['include']?_[_0xced3('0x1c')](_0x23f92b[_0xced3('0x1b')],function(_0x3b728d){return{'model':db[_0x3b728d[_0xced3('0x1d')]],'as':_0x3b728d['as'],'attributes':_0x3b728d[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5454c0){logger[_0xced3('0xb')]('GetVtigerAccount',_0x4569af);logger[_0xced3('0xe')](_0xced3('0x1f'),_0x4569af,JSON['stringify'](_0x5454c0));_0x353580(_0x5454c0);})[_0xced3('0x14')](function(_0x4024fa){logger[_0xced3('0x10')](_0xced3('0x1f'),_0x4024fa[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe[_0xced3('0x10')](0x1f4,_0x4024fa[_0xced3('0x12')]));});});};exports[_0xced3('0x20')]=function(_0x116cc7){var _0x559b8e=this;return new Promise(function(_0xa78899,_0x1b8baa){return db[_0xced3('0x15')][_0xced3('0x21')]({'raw':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x18')]===undefined?!![]:![]:!![],'where':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x19')]||null:null,'attributes':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1e')]||null:null,'include':_0x116cc7[_0xced3('0x17')]?_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x116cc7[_0xced3('0x17')][_0xced3('0x1b')],function(_0xcd0fe3){return{'model':db[_0xcd0fe3[_0xced3('0x1d')]],'as':_0xcd0fe3['as'],'attributes':_0xcd0fe3['attributes'],'include':_0xcd0fe3[_0xced3('0x1b')]?_['map'](_0xcd0fe3[_0xced3('0x1b')],function(_0x28f674){return{'model':db[_0x28f674[_0xced3('0x1d')]],'as':_0x28f674['as'],'attributes':_0x28f674[_0xced3('0x1e')],'include':_0x28f674[_0xced3('0x1b')]?_[_0xced3('0x1c')](_0x28f674[_0xced3('0x1b')],function(_0x340be1){return{'model':db[_0x340be1[_0xced3('0x1d')]],'as':_0x340be1['as'],'attributes':_0x340be1[_0xced3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x342c11){logger[_0xced3('0xb')]('ShowVtigerAccount',_0x116cc7);logger[_0xced3('0xe')](_0xced3('0x20'),_0x116cc7,JSON[_0xced3('0xf')](_0x342c11));_0xa78899(_0x342c11);})['catch'](function(_0x59c3aa){logger[_0xced3('0x10')]('ShowVtigerAccount',_0x59c3aa[_0xced3('0x12')],_0x116cc7);_0x1b8baa(_0x559b8e[_0xced3('0x10')](0x1f4,_0x59c3aa['message']));});});}; \ No newline at end of file +var _0xe5b5=['GetVtigerAccount','VtigerAccount','options','where','attributes','include','map','model','debug','ShowVtigerAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x5426d0,_0x4a4f10){var _0x37be89=function(_0x1fc9e1){while(--_0x1fc9e1){_0x5426d0['push'](_0x5426d0['shift']());}};_0x37be89(++_0x4a4f10);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xe5b5[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});}exports[_0x5e5b('0x19')]=function(_0x45a091){var _0x4c5f9a=this;return new Promise(function(_0xe5aa6b,_0x1560e1){return db[_0x5e5b('0x1a')]['findAll']({'raw':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1c')]||null:null,'attributes':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1d')]||null:null,'limit':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['limit']||null:null,'include':_0x45a091['options']?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x28cd95){return{'model':db[_0x28cd95[_0x5e5b('0x20')]],'as':_0x28cd95['as'],'attributes':_0x28cd95[_0x5e5b('0x1d')],'include':_0x28cd95[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x28cd95[_0x5e5b('0x1e')],function(_0x4da321){return{'model':db[_0x4da321[_0x5e5b('0x20')]],'as':_0x4da321['as'],'attributes':_0x4da321[_0x5e5b('0x1d')],'include':_0x4da321[_0x5e5b('0x1e')]?_['map'](_0x4da321[_0x5e5b('0x1e')],function(_0xdb2863){return{'model':db[_0xdb2863['model']],'as':_0xdb2863['as'],'attributes':_0xdb2863[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x39ce16){logger[_0x5e5b('0x10')](_0x5e5b('0x19'),_0x45a091);logger[_0x5e5b('0x21')](_0x5e5b('0x19'),_0x45a091,JSON[_0x5e5b('0x13')](_0x39ce16));_0xe5aa6b(_0x39ce16);})[_0x5e5b('0x18')](function(_0x42da3b){logger[_0x5e5b('0x14')](_0x5e5b('0x19'),_0x42da3b['message'],_0x45a091);_0x1560e1(_0x4c5f9a['error'](0x1f4,_0x42da3b[_0x5e5b('0x16')]));});});};exports[_0x5e5b('0x22')]=function(_0xb68419){var _0x3dcdab=this;return new Promise(function(_0x12f1ee,_0x4b9be8){return db[_0x5e5b('0x1a')]['find']({'raw':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1c')]||null:null,'attributes':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1d')]||null:null,'include':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x317451){return{'model':db[_0x317451['model']],'as':_0x317451['as'],'attributes':_0x317451[_0x5e5b('0x1d')],'include':_0x317451[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x317451[_0x5e5b('0x1e')],function(_0x7da7a5){return{'model':db[_0x7da7a5[_0x5e5b('0x20')]],'as':_0x7da7a5['as'],'attributes':_0x7da7a5['attributes'],'include':_0x7da7a5['include']?_[_0x5e5b('0x1f')](_0x7da7a5[_0x5e5b('0x1e')],function(_0x8ec651){return{'model':db[_0x8ec651['model']],'as':_0x8ec651['as'],'attributes':_0x8ec651[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x18f5ba){logger[_0x5e5b('0x10')]('ShowVtigerAccount',_0xb68419);logger[_0x5e5b('0x21')](_0x5e5b('0x22'),_0xb68419,JSON['stringify'](_0x18f5ba));_0x12f1ee(_0x18f5ba);})['catch'](function(_0xe9c586){logger[_0x5e5b('0x14')](_0x5e5b('0x22'),_0xe9c586['message'],_0xb68419);_0x4b9be8(_0x3dcdab[_0x5e5b('0x14')](0x1f4,_0xe9c586['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f644a77..501fc15 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 _0x3e1c=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x165ca9,_0x36e359){var _0x25f49a=function(_0x3da5e5){while(--_0x3da5e5){_0x165ca9['push'](_0x165ca9['shift']());}};_0x25f49a(++_0x36e359);}(_0x3e1c,0xeb));var _0xc3e1=function(_0x37b454,_0x4e5678){_0x37b454=_0x37b454-0x0;var _0x30c2a2=_0x3e1c[_0x37b454];return _0x30c2a2;};'use strict';var multer=require(_0xc3e1('0x0'));var util=require(_0xc3e1('0x1'));var path=require(_0xc3e1('0x2'));var timeout=require(_0xc3e1('0x3'));var express=require(_0xc3e1('0x4'));var router=express[_0xc3e1('0x5')]();var fs_extra=require(_0xc3e1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc3e1('0x7'));var config=require(_0xc3e1('0x8'));var controller=require(_0xc3e1('0x9'));router[_0xc3e1('0xa')]('/',auth[_0xc3e1('0xb')](),controller[_0xc3e1('0xc')]);router[_0xc3e1('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc3e1('0xd')]);router['get'](_0xc3e1('0xe'),auth[_0xc3e1('0xb')](),controller[_0xc3e1('0xf')]);router['get'](_0xc3e1('0x10'),auth[_0xc3e1('0xb')](),controller['getSubjects']);router[_0xc3e1('0xa')](_0xc3e1('0x11'),auth[_0xc3e1('0xb')](),controller['getDescriptions']);router[_0xc3e1('0x12')]('/',auth[_0xc3e1('0xb')](),controller[_0xc3e1('0x13')]);router[_0xc3e1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc3e1('0x15')]);router[_0xc3e1('0x16')]('/:id',auth[_0xc3e1('0xb')](),controller[_0xc3e1('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5cda=['../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3b91d3,_0x56f013){var _0x4b96d2=function(_0x23aba8){while(--_0x23aba8){_0x3b91d3['push'](_0x3b91d3['shift']());}};_0x4b96d2(++_0x56f013);}(_0x5cda,0x149));var _0xa5cd=function(_0x2ca21c,_0x3e1037){_0x2ca21c=_0x2ca21c-0x0;var _0x3879b0=_0x5cda[_0x2ca21c];return _0x3879b0;};'use strict';var multer=require(_0xa5cd('0x0'));var util=require(_0xa5cd('0x1'));var path=require(_0xa5cd('0x2'));var timeout=require('connect-timeout');var express=require(_0xa5cd('0x3'));var router=express[_0xa5cd('0x4')]();var fs_extra=require(_0xa5cd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa5cd('0x6'));var config=require(_0xa5cd('0x7'));var controller=require(_0xa5cd('0x8'));router[_0xa5cd('0x9')]('/',auth['isAuthenticated'](),controller[_0xa5cd('0xa')]);router[_0xa5cd('0x9')](_0xa5cd('0xb'),auth['isAuthenticated'](),controller[_0xa5cd('0xc')]);router[_0xa5cd('0x9')](_0xa5cd('0xd'),auth[_0xa5cd('0xe')](),controller[_0xa5cd('0xf')]);router[_0xa5cd('0x9')](_0xa5cd('0x10'),auth[_0xa5cd('0xe')](),controller[_0xa5cd('0x11')]);router[_0xa5cd('0x9')]('/:id/descriptions',auth[_0xa5cd('0xe')](),controller[_0xa5cd('0x12')]);router['post']('/',auth[_0xa5cd('0xe')](),controller[_0xa5cd('0x13')]);router[_0xa5cd('0x14')]('/:id',auth[_0xa5cd('0xe')](),controller[_0xa5cd('0x15')]);router['delete'](_0xa5cd('0xb'),auth[_0xa5cd('0xe')](),controller[_0xa5cd('0x16')]);module[_0xa5cd('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3e1c3c4..3ce8956 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 _0x6608=['exports','STRING','sequelize'];(function(_0x195812,_0x2b2bc6){var _0x4c34bf=function(_0x15070c){while(--_0x15070c){_0x195812['push'](_0x195812['shift']());}};_0x4c34bf(++_0x2b2bc6);}(_0x6608,0xad));var _0x8660=function(_0x17cbbd,_0x3f9d58){_0x17cbbd=_0x17cbbd-0x0;var _0x4c63eb=_0x6608[_0x17cbbd];return _0x4c63eb;};'use strict';var Sequelize=require(_0x8660('0x0'));module[_0x8660('0x1')]={'name':{'type':Sequelize[_0x8660('0x2')]},'description':{'type':Sequelize[_0x8660('0x2')]}}; \ No newline at end of file +var _0x9d39=['exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9d39,0x1b4));var _0x99d3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9d39[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x99d3('0x0')]={'name':{'type':Sequelize[_0x99d3('0x1')]},'description':{'type':Sequelize[_0x99d3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index c70e459..b821379 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 _0x1dbd=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','VtigerConfiguration','rawAttributes','type','key','map','query','keys','attributes','intersection','fields','model','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','length','getDescriptions','nolimit','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x438f65,_0x50ad4b){var _0x5dad47=function(_0x18fe8b){while(--_0x18fe8b){_0x438f65['push'](_0x438f65['shift']());}};_0x5dad47(++_0x50ad4b);}(_0x1dbd,0x1d7));var _0xd1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1db('0x1'));var rp=require(_0xd1db('0x2'));var moment=require(_0xd1db('0x3'));var BPromise=require(_0xd1db('0x4'));var Mustache=require(_0xd1db('0x5'));var util=require('util');var path=require(_0xd1db('0x6'));var sox=require(_0xd1db('0x7'));var csv=require(_0xd1db('0x8'));var ejs=require(_0xd1db('0x9'));var fs=require('fs');var fs_extra=require(_0xd1db('0xa'));var _=require(_0xd1db('0xb'));var squel=require(_0xd1db('0xc'));var crypto=require(_0xd1db('0xd'));var jsforce=require(_0xd1db('0xe'));var deskjs=require(_0xd1db('0xf'));var toCsv=require(_0xd1db('0x8'));var querystring=require('querystring');var Papa=require(_0xd1db('0x10'));var Redis=require(_0xd1db('0x11'));var authService=require(_0xd1db('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1db('0x13'));var hardwareService=require(_0xd1db('0x14'));var logger=require(_0xd1db('0x15'))(_0xd1db('0x16'));var utils=require(_0xd1db('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd1db('0x18'))['db'];function respondWithStatusCode(_0x3c21b9,_0x25f760){_0x25f760=_0x25f760||0xcc;return function(_0xe1df23){if(_0xe1df23){return _0x3c21b9[_0xd1db('0x19')](_0x25f760);}return _0x3c21b9[_0xd1db('0x1a')](_0x25f760)[_0xd1db('0x1b')]();};}function respondWithResult(_0x118595,_0x1b934c){_0x1b934c=_0x1b934c||0xc8;return function(_0x521fa4){if(_0x521fa4){return _0x118595[_0xd1db('0x1a')](_0x1b934c)[_0xd1db('0x1c')](_0x521fa4);}};}function respondWithFilteredResult(_0xd2376e,_0x20c6dc){return function(_0x2d178f){if(_0x2d178f){var _0x2c13c9=typeof _0x20c6dc[_0xd1db('0x1d')]==='undefined'&&typeof _0x20c6dc[_0xd1db('0x1e')]==='undefined';var _0x15373c=_0x2d178f['count'];var _0x4884fa=_0x2c13c9?0x0:_0x20c6dc['offset'];var _0x30c83b=_0x2c13c9?_0x2d178f[_0xd1db('0x1f')]:_0x20c6dc[_0xd1db('0x1d')]+_0x20c6dc[_0xd1db('0x1e')];var _0x3e3c2a;if(_0x30c83b>=_0x15373c){_0x30c83b=_0x15373c;_0x3e3c2a=0xc8;}else{_0x3e3c2a=0xce;}_0xd2376e[_0xd1db('0x1a')](_0x3e3c2a);return _0xd2376e[_0xd1db('0x20')](_0xd1db('0x21'),_0x4884fa+'-'+_0x30c83b+'/'+_0x15373c)[_0xd1db('0x1c')](_0x2d178f);}return null;};}function patchUpdates(_0x22e38e){return function(_0x590f69){try{jsonpatch[_0xd1db('0x22')](_0x590f69,_0x22e38e,!![]);}catch(_0x305d50){return BPromise['reject'](_0x305d50);}return _0x590f69[_0xd1db('0x23')]();};}function saveUpdates(_0x1cf397,_0x1a2b50){return function(_0x379c72){if(_0x379c72){return _0x379c72[_0xd1db('0x24')](_0x1cf397)[_0xd1db('0x25')](function(_0x255d6a){return _0x255d6a;});}return null;};}function removeEntity(_0x2d2722,_0x235b68){return function(_0x36e045){if(_0x36e045){return _0x36e045['destroy']()[_0xd1db('0x25')](function(){_0x2d2722[_0xd1db('0x1a')](0xcc)[_0xd1db('0x1b')]();});}};}function handleEntityNotFound(_0x40103e,_0x2d6c17){return function(_0x3d39b8){if(!_0x3d39b8){_0x40103e[_0xd1db('0x19')](0x194);}return _0x3d39b8;};}function handleError(_0x367559,_0x2bb167){_0x2bb167=_0x2bb167||0x1f4;return function(_0x13883d){logger[_0xd1db('0x26')](_0x13883d[_0xd1db('0x27')]);if(_0x13883d[_0xd1db('0x28')]){delete _0x13883d[_0xd1db('0x28')];}_0x367559[_0xd1db('0x1a')](_0x2bb167)[_0xd1db('0x29')](_0x13883d);};}exports[_0xd1db('0x2a')]=function(_0x41aaa5,_0x24af55){var _0x5a6fb4={},_0xd4d1f4={},_0x446da7={'count':0x0,'rows':[]};var _0x33a91c=_['map'](db[_0xd1db('0x2b')][_0xd1db('0x2c')],function(_0x29e984){return{'name':_0x29e984['fieldName'],'type':_0x29e984[_0xd1db('0x2d')][_0xd1db('0x2e')]};});_0xd4d1f4['model']=_[_0xd1db('0x2f')](_0x33a91c,_0xd1db('0x28'));_0xd4d1f4[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x41aaa5[_0xd1db('0x30')]);_0xd4d1f4['filters']=_['intersection'](_0xd4d1f4['model'],_0xd4d1f4[_0xd1db('0x30')]);_0x5a6fb4[_0xd1db('0x32')]=_[_0xd1db('0x33')](_0xd4d1f4['model'],qs[_0xd1db('0x34')](_0x41aaa5['query'][_0xd1db('0x34')]));_0x5a6fb4[_0xd1db('0x32')]=_0x5a6fb4[_0xd1db('0x32')]['length']?_0x5a6fb4['attributes']:_0xd4d1f4[_0xd1db('0x35')];if(!_0x41aaa5['query']['hasOwnProperty']('nolimit')){_0x5a6fb4['limit']=qs[_0xd1db('0x1e')](_0x41aaa5[_0xd1db('0x30')][_0xd1db('0x1e')]);_0x5a6fb4[_0xd1db('0x1d')]=qs[_0xd1db('0x1d')](_0x41aaa5['query']['offset']);}_0x5a6fb4[_0xd1db('0x36')]=qs['sort'](_0x41aaa5['query'][_0xd1db('0x37')]);_0x5a6fb4['where']=qs[_0xd1db('0x38')](_[_0xd1db('0x39')](_0x41aaa5[_0xd1db('0x30')],_0xd4d1f4[_0xd1db('0x38')]),_0x33a91c);if(_0x41aaa5['query'][_0xd1db('0x3a')]){_0x5a6fb4[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x5a6fb4[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x33a91c,function(_0x6b3720){if(_0x6b3720[_0xd1db('0x2d')]!==_0xd1db('0x3d')){var _0x1f7117={};_0x1f7117[_0x6b3720['name']]={'$like':'%'+_0x41aaa5[_0xd1db('0x30')]['filter']+'%'};return _0x1f7117;}})});}_0x5a6fb4=_['merge']({},_0x5a6fb4,_0x41aaa5[_0xd1db('0x3e')]);var _0x1b2672={'where':_0x5a6fb4['where']};return db[_0xd1db('0x2b')]['count'](_0x1b2672)['then'](function(_0x4438d8){_0x446da7[_0xd1db('0x1f')]=_0x4438d8;if(_0x41aaa5[_0xd1db('0x30')][_0xd1db('0x3f')]){_0x5a6fb4[_0xd1db('0x40')]=[{'all':!![]}];}return db[_0xd1db('0x2b')][_0xd1db('0x41')](_0x5a6fb4);})[_0xd1db('0x25')](function(_0x1c4cab){_0x446da7[_0xd1db('0x42')]=_0x1c4cab;return _0x446da7;})[_0xd1db('0x25')](respondWithFilteredResult(_0x24af55,_0x5a6fb4))[_0xd1db('0x43')](handleError(_0x24af55,null));};exports['show']=function(_0x123fd5,_0x2e0bdd){var _0x1375da={'raw':![],'where':{'id':_0x123fd5[_0xd1db('0x44')]['id']}},_0xc847cc={};_0xc847cc[_0xd1db('0x35')]=_[_0xd1db('0x31')](db[_0xd1db('0x2b')][_0xd1db('0x2c')]);_0xc847cc[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x123fd5[_0xd1db('0x30')]);_0xc847cc[_0xd1db('0x38')]=_['intersection'](_0xc847cc[_0xd1db('0x35')],_0xc847cc[_0xd1db('0x30')]);_0x1375da[_0xd1db('0x32')]=_['intersection'](_0xc847cc[_0xd1db('0x35')],qs[_0xd1db('0x34')](_0x123fd5[_0xd1db('0x30')][_0xd1db('0x34')]));_0x1375da[_0xd1db('0x32')]=_0x1375da['attributes']['length']?_0x1375da[_0xd1db('0x32')]:_0xc847cc['model'];if(_0x123fd5['query'][_0xd1db('0x3f')]){_0x1375da['include']=[{'all':!![]}];}_0x1375da=_['merge']({},_0x1375da,_0x123fd5[_0xd1db('0x3e')]);return db[_0xd1db('0x2b')][_0xd1db('0x45')](_0x1375da)[_0xd1db('0x25')](handleEntityNotFound(_0x2e0bdd,null))[_0xd1db('0x25')](respondWithResult(_0x2e0bdd,null))[_0xd1db('0x43')](handleError(_0x2e0bdd,null));};exports[_0xd1db('0x46')]=function(_0x200837,_0x5db8df){return db[_0xd1db('0x2b')][_0xd1db('0x46')](_0x200837[_0xd1db('0x47')],{})[_0xd1db('0x25')](respondWithResult(_0x5db8df,0xc9))['catch'](handleError(_0x5db8df,null));};exports['update']=function(_0x43efa4,_0x57e9c7){if(_0x43efa4['body']['id']){delete _0x43efa4['body']['id'];}return db[_0xd1db('0x2b')]['find']({'where':{'id':_0x43efa4[_0xd1db('0x44')]['id']}})[_0xd1db('0x25')](handleEntityNotFound(_0x57e9c7,null))[_0xd1db('0x25')](saveUpdates(_0x43efa4['body'],null))[_0xd1db('0x25')](respondWithResult(_0x57e9c7,null))[_0xd1db('0x43')](handleError(_0x57e9c7,null));};exports['destroy']=function(_0x43a288,_0x96d25d){return db[_0xd1db('0x2b')][_0xd1db('0x45')]({'where':{'id':_0x43a288[_0xd1db('0x44')]['id']}})[_0xd1db('0x25')](handleEntityNotFound(_0x96d25d,null))[_0xd1db('0x25')](removeEntity(_0x96d25d,null))[_0xd1db('0x43')](handleError(_0x96d25d,null));};exports[_0xd1db('0x48')]=function(_0x2db47a,_0x328e1b,_0x17b772){var _0x20b8c3={};var _0x35143a={};var _0x49af79;var _0x4ec630;return db['VtigerConfiguration'][_0xd1db('0x49')]({'where':{'id':_0x2db47a[_0xd1db('0x44')]['id']}})['then'](handleEntityNotFound(_0x328e1b,null))[_0xd1db('0x25')](function(_0x164e42){if(_0x164e42){_0x49af79=_0x164e42;_0x35143a['model']=_[_0xd1db('0x31')](db[_0xd1db('0x4a')][_0xd1db('0x2c')]);_0x35143a['query']=_[_0xd1db('0x31')](_0x2db47a[_0xd1db('0x30')]);_0x35143a[_0xd1db('0x38')]=_[_0xd1db('0x33')](_0x35143a[_0xd1db('0x35')],_0x35143a['query']);_0x20b8c3['attributes']=_[_0xd1db('0x33')](_0x35143a[_0xd1db('0x35')],qs[_0xd1db('0x34')](_0x2db47a[_0xd1db('0x30')]['fields']));_0x20b8c3[_0xd1db('0x32')]=_0x20b8c3[_0xd1db('0x32')]['length']?_0x20b8c3[_0xd1db('0x32')]:_0x35143a[_0xd1db('0x35')];_0x20b8c3[_0xd1db('0x36')]=qs['sort'](_0x2db47a[_0xd1db('0x30')][_0xd1db('0x37')]);_0x20b8c3[_0xd1db('0x3b')]=qs[_0xd1db('0x38')](_[_0xd1db('0x39')](_0x2db47a['query'],_0x35143a[_0xd1db('0x38')]));if(_0x2db47a[_0xd1db('0x30')]['filter']){_0x20b8c3[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x20b8c3[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x20b8c3[_0xd1db('0x32')],function(_0x69b161){var _0x132a46={};_0x132a46[_0x69b161]={'$like':'%'+_0x2db47a[_0xd1db('0x30')][_0xd1db('0x3a')]+'%'};return _0x132a46;})});}_0x20b8c3=_['merge']({},_0x20b8c3,_0x2db47a[_0xd1db('0x3e')]);return _0x49af79['getFields'](_0x20b8c3);}})[_0xd1db('0x25')](function(_0x117a65){if(_0x117a65){_0x4ec630=_0x117a65['length'];if(!_0x2db47a['query'][_0xd1db('0x4b')]('nolimit')){_0x20b8c3[_0xd1db('0x1e')]=qs['limit'](_0x2db47a[_0xd1db('0x30')][_0xd1db('0x1e')]);_0x20b8c3[_0xd1db('0x1d')]=qs[_0xd1db('0x1d')](_0x2db47a['query'][_0xd1db('0x1d')]);}return _0x49af79[_0xd1db('0x48')](_0x20b8c3);}})[_0xd1db('0x25')](function(_0x11447a){if(_0x11447a){return _0x11447a?{'count':_0x4ec630,'rows':_0x11447a}:null;}})['then'](respondWithResult(_0x328e1b,null))[_0xd1db('0x43')](handleError(_0x328e1b,null));};exports[_0xd1db('0x4c')]=function(_0x54d126,_0xee16bd,_0x511dbb){var _0x543ad3={};var _0x19634b={};var _0x49ce0d;var _0x246a86;return db[_0xd1db('0x2b')]['findOne']({'where':{'id':_0x54d126['params']['id']}})[_0xd1db('0x25')](handleEntityNotFound(_0xee16bd,null))[_0xd1db('0x25')](function(_0x10cb25){if(_0x10cb25){_0x49ce0d=_0x10cb25;_0x19634b['model']=_[_0xd1db('0x31')](db['VtigerField'][_0xd1db('0x2c')]);_0x19634b[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x54d126[_0xd1db('0x30')]);_0x19634b['filters']=_['intersection'](_0x19634b['model'],_0x19634b['query']);_0x543ad3[_0xd1db('0x32')]=_[_0xd1db('0x33')](_0x19634b[_0xd1db('0x35')],qs[_0xd1db('0x34')](_0x54d126['query'][_0xd1db('0x34')]));_0x543ad3[_0xd1db('0x32')]=_0x543ad3[_0xd1db('0x32')][_0xd1db('0x4d')]?_0x543ad3['attributes']:_0x19634b[_0xd1db('0x35')];_0x543ad3[_0xd1db('0x36')]=qs[_0xd1db('0x37')](_0x54d126[_0xd1db('0x30')][_0xd1db('0x37')]);_0x543ad3[_0xd1db('0x3b')]=qs['filters'](_[_0xd1db('0x39')](_0x54d126['query'],_0x19634b[_0xd1db('0x38')]));if(_0x54d126['query'][_0xd1db('0x3a')]){_0x543ad3[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x543ad3[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x543ad3[_0xd1db('0x32')],function(_0x3d1180){var _0x3d9989={};_0x3d9989[_0x3d1180]={'$like':'%'+_0x54d126['query'][_0xd1db('0x3a')]+'%'};return _0x3d9989;})});}_0x543ad3=_[_0xd1db('0x3c')]({},_0x543ad3,_0x54d126[_0xd1db('0x3e')]);return _0x49ce0d[_0xd1db('0x4c')](_0x543ad3);}})['then'](function(_0x53e290){if(_0x53e290){_0x246a86=_0x53e290[_0xd1db('0x4d')];if(!_0x54d126['query'][_0xd1db('0x4b')]('nolimit')){_0x543ad3[_0xd1db('0x1e')]=qs['limit'](_0x54d126[_0xd1db('0x30')][_0xd1db('0x1e')]);_0x543ad3[_0xd1db('0x1d')]=qs[_0xd1db('0x1d')](_0x54d126[_0xd1db('0x30')][_0xd1db('0x1d')]);}return _0x49ce0d[_0xd1db('0x4c')](_0x543ad3);}})[_0xd1db('0x25')](function(_0x166808){if(_0x166808){return _0x166808?{'count':_0x246a86,'rows':_0x166808}:null;}})['then'](respondWithResult(_0xee16bd,null))[_0xd1db('0x43')](handleError(_0xee16bd,null));};exports[_0xd1db('0x4e')]=function(_0x4e1561,_0x58ecf5,_0x455538){var _0x5c85d7={};var _0x85fa89={};var _0x277cd8;var _0x34b0bc;return db[_0xd1db('0x2b')][_0xd1db('0x49')]({'where':{'id':_0x4e1561[_0xd1db('0x44')]['id']}})['then'](handleEntityNotFound(_0x58ecf5,null))[_0xd1db('0x25')](function(_0x32df30){if(_0x32df30){_0x277cd8=_0x32df30;_0x85fa89[_0xd1db('0x35')]=_[_0xd1db('0x31')](db[_0xd1db('0x4a')][_0xd1db('0x2c')]);_0x85fa89[_0xd1db('0x30')]=_[_0xd1db('0x31')](_0x4e1561[_0xd1db('0x30')]);_0x85fa89[_0xd1db('0x38')]=_[_0xd1db('0x33')](_0x85fa89[_0xd1db('0x35')],_0x85fa89[_0xd1db('0x30')]);_0x5c85d7['attributes']=_[_0xd1db('0x33')](_0x85fa89['model'],qs[_0xd1db('0x34')](_0x4e1561[_0xd1db('0x30')][_0xd1db('0x34')]));_0x5c85d7[_0xd1db('0x32')]=_0x5c85d7['attributes'][_0xd1db('0x4d')]?_0x5c85d7[_0xd1db('0x32')]:_0x85fa89[_0xd1db('0x35')];_0x5c85d7[_0xd1db('0x36')]=qs[_0xd1db('0x37')](_0x4e1561['query'][_0xd1db('0x37')]);_0x5c85d7[_0xd1db('0x3b')]=qs[_0xd1db('0x38')](_[_0xd1db('0x39')](_0x4e1561[_0xd1db('0x30')],_0x85fa89[_0xd1db('0x38')]));if(_0x4e1561[_0xd1db('0x30')][_0xd1db('0x3a')]){_0x5c85d7[_0xd1db('0x3b')]=_[_0xd1db('0x3c')](_0x5c85d7[_0xd1db('0x3b')],{'$or':_[_0xd1db('0x2f')](_0x5c85d7[_0xd1db('0x32')],function(_0x1c45ca){var _0x2cae9c={};_0x2cae9c[_0x1c45ca]={'$like':'%'+_0x4e1561['query'][_0xd1db('0x3a')]+'%'};return _0x2cae9c;})});}_0x5c85d7=_[_0xd1db('0x3c')]({},_0x5c85d7,_0x4e1561[_0xd1db('0x3e')]);return _0x277cd8[_0xd1db('0x4e')](_0x5c85d7);}})[_0xd1db('0x25')](function(_0x2d6b55){if(_0x2d6b55){_0x34b0bc=_0x2d6b55['length'];if(!_0x4e1561[_0xd1db('0x30')]['hasOwnProperty'](_0xd1db('0x4f'))){_0x5c85d7[_0xd1db('0x1e')]=qs[_0xd1db('0x1e')](_0x4e1561['query'][_0xd1db('0x1e')]);_0x5c85d7['offset']=qs[_0xd1db('0x1d')](_0x4e1561[_0xd1db('0x30')][_0xd1db('0x1d')]);}return _0x277cd8[_0xd1db('0x4e')](_0x5c85d7);}})[_0xd1db('0x25')](function(_0x1f8268){if(_0x1f8268){return _0x1f8268?{'count':_0x34b0bc,'rows':_0x1f8268}:null;}})[_0xd1db('0x25')](respondWithResult(_0x58ecf5,null))['catch'](handleError(_0x58ecf5,null));}; \ No newline at end of file +var _0xe51b=['attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','getFields','findOne','VtigerField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','query','filters','model'];(function(_0x50b45a,_0x47e5ef){var _0xff0f85=function(_0x177fc2){while(--_0x177fc2){_0x50b45a['push'](_0x50b45a['shift']());}};_0xff0f85(++_0x47e5ef);}(_0xe51b,0x177));var _0xbe51=function(_0x71e27f,_0x58d37d){_0x71e27f=_0x71e27f-0x0;var _0x27ccfb=_0xe51b[_0x71e27f];return _0x27ccfb;};'use strict';var emlformat=require(_0xbe51('0x0'));var rimraf=require(_0xbe51('0x1'));var zipdir=require(_0xbe51('0x2'));var jsonpatch=require(_0xbe51('0x3'));var rp=require(_0xbe51('0x4'));var moment=require(_0xbe51('0x5'));var BPromise=require(_0xbe51('0x6'));var Mustache=require(_0xbe51('0x7'));var util=require(_0xbe51('0x8'));var path=require(_0xbe51('0x9'));var sox=require(_0xbe51('0xa'));var csv=require(_0xbe51('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe51('0xc'));var _=require(_0xbe51('0xd'));var squel=require(_0xbe51('0xe'));var crypto=require(_0xbe51('0xf'));var jsforce=require(_0xbe51('0x10'));var deskjs=require(_0xbe51('0x11'));var toCsv=require(_0xbe51('0xb'));var querystring=require(_0xbe51('0x12'));var Papa=require(_0xbe51('0x13'));var Redis=require(_0xbe51('0x14'));var authService=require(_0xbe51('0x15'));var qs=require(_0xbe51('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe51('0x17'));var logger=require(_0xbe51('0x18'))(_0xbe51('0x19'));var utils=require(_0xbe51('0x1a'));var config=require(_0xbe51('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe51('0x1c'))['db'];function respondWithStatusCode(_0x1d0d06,_0x356acd){_0x356acd=_0x356acd||0xcc;return function(_0x5709dc){if(_0x5709dc){return _0x1d0d06[_0xbe51('0x1d')](_0x356acd);}return _0x1d0d06[_0xbe51('0x1e')](_0x356acd)['end']();};}function respondWithResult(_0x285466,_0xebcb41){_0xebcb41=_0xebcb41||0xc8;return function(_0x29c82c){if(_0x29c82c){return _0x285466['status'](_0xebcb41)[_0xbe51('0x1f')](_0x29c82c);}};}function respondWithFilteredResult(_0x45f98a,_0x2f1eb2){return function(_0x498abf){if(_0x498abf){var _0x532571=typeof _0x2f1eb2[_0xbe51('0x20')]===_0xbe51('0x21')&&typeof _0x2f1eb2[_0xbe51('0x22')]===_0xbe51('0x21');var _0x25e651=_0x498abf[_0xbe51('0x23')];var _0x3940c7=_0x532571?0x0:_0x2f1eb2[_0xbe51('0x20')];var _0x2bc8e8=_0x532571?_0x498abf[_0xbe51('0x23')]:_0x2f1eb2[_0xbe51('0x20')]+_0x2f1eb2[_0xbe51('0x22')];var _0x5115ce;if(_0x2bc8e8>=_0x25e651){_0x2bc8e8=_0x25e651;_0x5115ce=0xc8;}else{_0x5115ce=0xce;}_0x45f98a[_0xbe51('0x1e')](_0x5115ce);return _0x45f98a[_0xbe51('0x24')](_0xbe51('0x25'),_0x3940c7+'-'+_0x2bc8e8+'/'+_0x25e651)[_0xbe51('0x1f')](_0x498abf);}return null;};}function patchUpdates(_0x5b2ea8){return function(_0x1da81e){try{jsonpatch[_0xbe51('0x26')](_0x1da81e,_0x5b2ea8,!![]);}catch(_0xc2a617){return BPromise[_0xbe51('0x27')](_0xc2a617);}return _0x1da81e['save']();};}function saveUpdates(_0x12e055,_0x3696b5){return function(_0x2806dd){if(_0x2806dd){return _0x2806dd[_0xbe51('0x28')](_0x12e055)[_0xbe51('0x29')](function(_0x2ce111){return _0x2ce111;});}return null;};}function removeEntity(_0x1210a0,_0x539cdb){return function(_0x10fbc5){if(_0x10fbc5){return _0x10fbc5['destroy']()[_0xbe51('0x29')](function(){_0x1210a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb139e,_0x2edd03){return function(_0x149572){if(!_0x149572){_0xdb139e[_0xbe51('0x1d')](0x194);}return _0x149572;};}function handleError(_0x529a81,_0x16caf3){_0x16caf3=_0x16caf3||0x1f4;return function(_0x2cfaf4){logger[_0xbe51('0x2a')](_0x2cfaf4[_0xbe51('0x2b')]);if(_0x2cfaf4[_0xbe51('0x2c')]){delete _0x2cfaf4[_0xbe51('0x2c')];}_0x529a81[_0xbe51('0x1e')](_0x16caf3)[_0xbe51('0x2d')](_0x2cfaf4);};}exports[_0xbe51('0x2e')]=function(_0x3ad733,_0x2df460){var _0xef5865={},_0x561c84={},_0x12bbf6={'count':0x0,'rows':[]};var _0x88e4cd=_[_0xbe51('0x2f')](db[_0xbe51('0x30')][_0xbe51('0x31')],function(_0x4fe8e2){return{'name':_0x4fe8e2[_0xbe51('0x32')],'type':_0x4fe8e2[_0xbe51('0x33')]['key']};});_0x561c84['model']=_[_0xbe51('0x2f')](_0x88e4cd,_0xbe51('0x2c'));_0x561c84[_0xbe51('0x34')]=_['keys'](_0x3ad733[_0xbe51('0x34')]);_0x561c84[_0xbe51('0x35')]=_['intersection'](_0x561c84[_0xbe51('0x36')],_0x561c84[_0xbe51('0x34')]);_0xef5865[_0xbe51('0x37')]=_[_0xbe51('0x38')](_0x561c84[_0xbe51('0x36')],qs[_0xbe51('0x39')](_0x3ad733[_0xbe51('0x34')][_0xbe51('0x39')]));_0xef5865[_0xbe51('0x37')]=_0xef5865[_0xbe51('0x37')][_0xbe51('0x3a')]?_0xef5865['attributes']:_0x561c84[_0xbe51('0x36')];if(!_0x3ad733[_0xbe51('0x34')]['hasOwnProperty'](_0xbe51('0x3b'))){_0xef5865[_0xbe51('0x22')]=qs['limit'](_0x3ad733[_0xbe51('0x34')][_0xbe51('0x22')]);_0xef5865[_0xbe51('0x20')]=qs[_0xbe51('0x20')](_0x3ad733[_0xbe51('0x34')]['offset']);}_0xef5865['order']=qs[_0xbe51('0x3c')](_0x3ad733[_0xbe51('0x34')][_0xbe51('0x3c')]);_0xef5865[_0xbe51('0x3d')]=qs[_0xbe51('0x35')](_[_0xbe51('0x3e')](_0x3ad733[_0xbe51('0x34')],_0x561c84[_0xbe51('0x35')]),_0x88e4cd);if(_0x3ad733['query'][_0xbe51('0x3f')]){_0xef5865[_0xbe51('0x3d')]=_['merge'](_0xef5865[_0xbe51('0x3d')],{'$or':_[_0xbe51('0x2f')](_0x88e4cd,function(_0x4941fb){if(_0x4941fb[_0xbe51('0x33')]!==_0xbe51('0x40')){var _0x56775f={};_0x56775f[_0x4941fb[_0xbe51('0x2c')]]={'$like':'%'+_0x3ad733[_0xbe51('0x34')]['filter']+'%'};return _0x56775f;}})});}_0xef5865=_[_0xbe51('0x41')]({},_0xef5865,_0x3ad733['options']);var _0x390555={'where':_0xef5865[_0xbe51('0x3d')]};return db[_0xbe51('0x30')][_0xbe51('0x23')](_0x390555)[_0xbe51('0x29')](function(_0x554442){_0x12bbf6[_0xbe51('0x23')]=_0x554442;if(_0x3ad733[_0xbe51('0x34')][_0xbe51('0x42')]){_0xef5865[_0xbe51('0x43')]=[{'all':!![]}];}return db[_0xbe51('0x30')][_0xbe51('0x44')](_0xef5865);})['then'](function(_0x1b523e){_0x12bbf6[_0xbe51('0x45')]=_0x1b523e;return _0x12bbf6;})[_0xbe51('0x29')](respondWithFilteredResult(_0x2df460,_0xef5865))[_0xbe51('0x46')](handleError(_0x2df460,null));};exports[_0xbe51('0x47')]=function(_0x290f8b,_0x20b5e2){var _0x1e2af7={'raw':![],'where':{'id':_0x290f8b[_0xbe51('0x48')]['id']}},_0x51fd22={};_0x51fd22[_0xbe51('0x36')]=_[_0xbe51('0x49')](db['VtigerConfiguration'][_0xbe51('0x31')]);_0x51fd22[_0xbe51('0x34')]=_['keys'](_0x290f8b[_0xbe51('0x34')]);_0x51fd22[_0xbe51('0x35')]=_['intersection'](_0x51fd22['model'],_0x51fd22[_0xbe51('0x34')]);_0x1e2af7[_0xbe51('0x37')]=_[_0xbe51('0x38')](_0x51fd22[_0xbe51('0x36')],qs[_0xbe51('0x39')](_0x290f8b['query'][_0xbe51('0x39')]));_0x1e2af7[_0xbe51('0x37')]=_0x1e2af7[_0xbe51('0x37')][_0xbe51('0x3a')]?_0x1e2af7[_0xbe51('0x37')]:_0x51fd22[_0xbe51('0x36')];if(_0x290f8b['query'][_0xbe51('0x42')]){_0x1e2af7[_0xbe51('0x43')]=[{'all':!![]}];}_0x1e2af7=_['merge']({},_0x1e2af7,_0x290f8b[_0xbe51('0x4a')]);return db[_0xbe51('0x30')][_0xbe51('0x4b')](_0x1e2af7)[_0xbe51('0x29')](handleEntityNotFound(_0x20b5e2,null))[_0xbe51('0x29')](respondWithResult(_0x20b5e2,null))['catch'](handleError(_0x20b5e2,null));};exports[_0xbe51('0x4c')]=function(_0x5f462c,_0x25c382){return db[_0xbe51('0x30')][_0xbe51('0x4c')](_0x5f462c[_0xbe51('0x4d')],{})[_0xbe51('0x29')](respondWithResult(_0x25c382,0xc9))[_0xbe51('0x46')](handleError(_0x25c382,null));};exports['update']=function(_0x2b7ac7,_0x1a6081){if(_0x2b7ac7[_0xbe51('0x4d')]['id']){delete _0x2b7ac7[_0xbe51('0x4d')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x2b7ac7[_0xbe51('0x48')]['id']}})[_0xbe51('0x29')](handleEntityNotFound(_0x1a6081,null))['then'](saveUpdates(_0x2b7ac7[_0xbe51('0x4d')],null))[_0xbe51('0x29')](respondWithResult(_0x1a6081,null))[_0xbe51('0x46')](handleError(_0x1a6081,null));};exports[_0xbe51('0x4e')]=function(_0x37d780,_0x1bc7f1){return db[_0xbe51('0x30')][_0xbe51('0x4b')]({'where':{'id':_0x37d780[_0xbe51('0x48')]['id']}})[_0xbe51('0x29')](handleEntityNotFound(_0x1bc7f1,null))[_0xbe51('0x29')](removeEntity(_0x1bc7f1,null))[_0xbe51('0x46')](handleError(_0x1bc7f1,null));};exports[_0xbe51('0x4f')]=function(_0x30493b,_0x209269,_0x18e4aa){var _0x275ebb={};var _0x5bd7ad={};var _0x46e169;var _0x23d810;return db[_0xbe51('0x30')][_0xbe51('0x50')]({'where':{'id':_0x30493b['params']['id']}})[_0xbe51('0x29')](handleEntityNotFound(_0x209269,null))[_0xbe51('0x29')](function(_0x12b5bf){if(_0x12b5bf){_0x46e169=_0x12b5bf;_0x5bd7ad[_0xbe51('0x36')]=_['keys'](db[_0xbe51('0x51')][_0xbe51('0x31')]);_0x5bd7ad[_0xbe51('0x34')]=_['keys'](_0x30493b[_0xbe51('0x34')]);_0x5bd7ad[_0xbe51('0x35')]=_[_0xbe51('0x38')](_0x5bd7ad['model'],_0x5bd7ad[_0xbe51('0x34')]);_0x275ebb[_0xbe51('0x37')]=_['intersection'](_0x5bd7ad[_0xbe51('0x36')],qs[_0xbe51('0x39')](_0x30493b[_0xbe51('0x34')][_0xbe51('0x39')]));_0x275ebb[_0xbe51('0x37')]=_0x275ebb[_0xbe51('0x37')][_0xbe51('0x3a')]?_0x275ebb[_0xbe51('0x37')]:_0x5bd7ad[_0xbe51('0x36')];_0x275ebb[_0xbe51('0x52')]=qs[_0xbe51('0x3c')](_0x30493b[_0xbe51('0x34')][_0xbe51('0x3c')]);_0x275ebb[_0xbe51('0x3d')]=qs[_0xbe51('0x35')](_[_0xbe51('0x3e')](_0x30493b[_0xbe51('0x34')],_0x5bd7ad[_0xbe51('0x35')]));if(_0x30493b[_0xbe51('0x34')][_0xbe51('0x3f')]){_0x275ebb[_0xbe51('0x3d')]=_[_0xbe51('0x41')](_0x275ebb[_0xbe51('0x3d')],{'$or':_['map'](_0x275ebb[_0xbe51('0x37')],function(_0x55322a){var _0x1563da={};_0x1563da[_0x55322a]={'$like':'%'+_0x30493b['query'][_0xbe51('0x3f')]+'%'};return _0x1563da;})});}_0x275ebb=_[_0xbe51('0x41')]({},_0x275ebb,_0x30493b[_0xbe51('0x4a')]);return _0x46e169['getFields'](_0x275ebb);}})[_0xbe51('0x29')](function(_0x1ff8ad){if(_0x1ff8ad){_0x23d810=_0x1ff8ad[_0xbe51('0x3a')];if(!_0x30493b[_0xbe51('0x34')][_0xbe51('0x53')](_0xbe51('0x3b'))){_0x275ebb[_0xbe51('0x22')]=qs[_0xbe51('0x22')](_0x30493b[_0xbe51('0x34')][_0xbe51('0x22')]);_0x275ebb['offset']=qs['offset'](_0x30493b['query']['offset']);}return _0x46e169[_0xbe51('0x4f')](_0x275ebb);}})[_0xbe51('0x29')](function(_0x1b4587){if(_0x1b4587){return _0x1b4587?{'count':_0x23d810,'rows':_0x1b4587}:null;}})[_0xbe51('0x29')](respondWithResult(_0x209269,null))[_0xbe51('0x46')](handleError(_0x209269,null));};exports[_0xbe51('0x54')]=function(_0xb819c0,_0x3215de,_0x18b7d6){var _0x25b357={};var _0x1a1d46={};var _0x2cbf26;var _0x1a7d63;return db[_0xbe51('0x30')]['findOne']({'where':{'id':_0xb819c0[_0xbe51('0x48')]['id']}})[_0xbe51('0x29')](handleEntityNotFound(_0x3215de,null))[_0xbe51('0x29')](function(_0x5f18ef){if(_0x5f18ef){_0x2cbf26=_0x5f18ef;_0x1a1d46[_0xbe51('0x36')]=_[_0xbe51('0x49')](db[_0xbe51('0x51')][_0xbe51('0x31')]);_0x1a1d46[_0xbe51('0x34')]=_[_0xbe51('0x49')](_0xb819c0[_0xbe51('0x34')]);_0x1a1d46[_0xbe51('0x35')]=_[_0xbe51('0x38')](_0x1a1d46[_0xbe51('0x36')],_0x1a1d46[_0xbe51('0x34')]);_0x25b357[_0xbe51('0x37')]=_['intersection'](_0x1a1d46[_0xbe51('0x36')],qs[_0xbe51('0x39')](_0xb819c0['query'][_0xbe51('0x39')]));_0x25b357[_0xbe51('0x37')]=_0x25b357['attributes'][_0xbe51('0x3a')]?_0x25b357[_0xbe51('0x37')]:_0x1a1d46[_0xbe51('0x36')];_0x25b357[_0xbe51('0x52')]=qs[_0xbe51('0x3c')](_0xb819c0[_0xbe51('0x34')][_0xbe51('0x3c')]);_0x25b357[_0xbe51('0x3d')]=qs[_0xbe51('0x35')](_['pick'](_0xb819c0['query'],_0x1a1d46['filters']));if(_0xb819c0[_0xbe51('0x34')][_0xbe51('0x3f')]){_0x25b357['where']=_[_0xbe51('0x41')](_0x25b357['where'],{'$or':_[_0xbe51('0x2f')](_0x25b357['attributes'],function(_0x430f24){var _0x2f28a6={};_0x2f28a6[_0x430f24]={'$like':'%'+_0xb819c0[_0xbe51('0x34')]['filter']+'%'};return _0x2f28a6;})});}_0x25b357=_[_0xbe51('0x41')]({},_0x25b357,_0xb819c0['options']);return _0x2cbf26[_0xbe51('0x54')](_0x25b357);}})[_0xbe51('0x29')](function(_0x4763d8){if(_0x4763d8){_0x1a7d63=_0x4763d8[_0xbe51('0x3a')];if(!_0xb819c0[_0xbe51('0x34')][_0xbe51('0x53')](_0xbe51('0x3b'))){_0x25b357['limit']=qs[_0xbe51('0x22')](_0xb819c0[_0xbe51('0x34')]['limit']);_0x25b357['offset']=qs[_0xbe51('0x20')](_0xb819c0[_0xbe51('0x34')]['offset']);}return _0x2cbf26['getSubjects'](_0x25b357);}})[_0xbe51('0x29')](function(_0x17df01){if(_0x17df01){return _0x17df01?{'count':_0x1a7d63,'rows':_0x17df01}:null;}})[_0xbe51('0x29')](respondWithResult(_0x3215de,null))[_0xbe51('0x46')](handleError(_0x3215de,null));};exports['getDescriptions']=function(_0x29647d,_0x1351dd,_0x1b2598){var _0x845a6a={};var _0x141c53={};var _0x4f8634;var _0x4f6433;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x29647d['params']['id']}})[_0xbe51('0x29')](handleEntityNotFound(_0x1351dd,null))[_0xbe51('0x29')](function(_0x20d21d){if(_0x20d21d){_0x4f8634=_0x20d21d;_0x141c53[_0xbe51('0x36')]=_[_0xbe51('0x49')](db[_0xbe51('0x51')][_0xbe51('0x31')]);_0x141c53[_0xbe51('0x34')]=_[_0xbe51('0x49')](_0x29647d[_0xbe51('0x34')]);_0x141c53[_0xbe51('0x35')]=_[_0xbe51('0x38')](_0x141c53[_0xbe51('0x36')],_0x141c53['query']);_0x845a6a[_0xbe51('0x37')]=_[_0xbe51('0x38')](_0x141c53[_0xbe51('0x36')],qs[_0xbe51('0x39')](_0x29647d[_0xbe51('0x34')][_0xbe51('0x39')]));_0x845a6a['attributes']=_0x845a6a[_0xbe51('0x37')][_0xbe51('0x3a')]?_0x845a6a['attributes']:_0x141c53[_0xbe51('0x36')];_0x845a6a[_0xbe51('0x52')]=qs['sort'](_0x29647d[_0xbe51('0x34')][_0xbe51('0x3c')]);_0x845a6a[_0xbe51('0x3d')]=qs[_0xbe51('0x35')](_['pick'](_0x29647d['query'],_0x141c53[_0xbe51('0x35')]));if(_0x29647d[_0xbe51('0x34')][_0xbe51('0x3f')]){_0x845a6a[_0xbe51('0x3d')]=_[_0xbe51('0x41')](_0x845a6a[_0xbe51('0x3d')],{'$or':_[_0xbe51('0x2f')](_0x845a6a[_0xbe51('0x37')],function(_0x5ddcce){var _0xc23ec2={};_0xc23ec2[_0x5ddcce]={'$like':'%'+_0x29647d[_0xbe51('0x34')]['filter']+'%'};return _0xc23ec2;})});}_0x845a6a=_['merge']({},_0x845a6a,_0x29647d[_0xbe51('0x4a')]);return _0x4f8634[_0xbe51('0x55')](_0x845a6a);}})[_0xbe51('0x29')](function(_0x29ee24){if(_0x29ee24){_0x4f6433=_0x29ee24['length'];if(!_0x29647d[_0xbe51('0x34')][_0xbe51('0x53')](_0xbe51('0x3b'))){_0x845a6a[_0xbe51('0x22')]=qs[_0xbe51('0x22')](_0x29647d[_0xbe51('0x34')]['limit']);_0x845a6a[_0xbe51('0x20')]=qs[_0xbe51('0x20')](_0x29647d[_0xbe51('0x34')][_0xbe51('0x20')]);}return _0x4f8634[_0xbe51('0x55')](_0x845a6a);}})[_0xbe51('0x29')](function(_0xd40a61){if(_0xd40a61){return _0xd40a61?{'count':_0x4f6433,'rows':_0xd40a61}:null;}})[_0xbe51('0x29')](respondWithResult(_0x1351dd,null))[_0xbe51('0x46')](handleError(_0x1351dd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ee96ec7..dc81dec 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 _0x3a56=['lodash','../../config/logger','api','request-promise','rimraf','./intVtigerConfiguration.attributes','define','int_vtiger_configurations'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x3a56,0x90));var _0x63a5=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x3a56[_0x21c6b8];return _0x39d474;};'use strict';var _=require(_0x63a5('0x0'));var util=require('util');var logger=require(_0x63a5('0x1'))(_0x63a5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x63a5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63a5('0x4'));var config=require('../../config/environment');var attributes=require(_0x63a5('0x5'));module['exports']=function(_0x3d3498,_0xeebeeb){return _0x3d3498[_0x63a5('0x6')]('VtigerConfiguration',attributes,{'tableName':_0x63a5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f63=['path','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6f63,0x7d));var _0x36f6=function(_0x251f08,_0x1e09e5){_0x251f08=_0x251f08-0x0;var _0x1771e8=_0x6f63[_0x251f08];return _0x1771e8;};'use strict';var _=require(_0x36f6('0x0'));var util=require(_0x36f6('0x1'));var logger=require(_0x36f6('0x2'))(_0x36f6('0x3'));var moment=require(_0x36f6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f6('0x5'));var rimraf=require('rimraf');var config=require(_0x36f6('0x6'));var attributes=require(_0x36f6('0x7'));module['exports']=function(_0x265b38,_0xce429b){return _0x265b38['define'](_0x36f6('0x8'),attributes,{'tableName':_0x36f6('0x9'),'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 a5e54a6..72cfe57 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 _0x7fcd=['result','catch','lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fcd,0x17e));var _0xd7fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7fcd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7fc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd7fc('0x1'));var rs=require(_0xd7fc('0x2'));var fs=require('fs');var Redis=require(_0xd7fc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd7fc('0x4'));var config=require(_0xd7fc('0x5'));var jayson=require(_0xd7fc('0x6'));var client=jayson['client'][_0xd7fc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c56ca,_0x198d11,_0x2a5984){return new BPromise(function(_0x1cb36e,_0x53ebca){return client['request'](_0x3c56ca,_0x2a5984)[_0xd7fc('0x8')](function(_0x4af13d){logger[_0xd7fc('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x198d11,'request\x20sent');logger[_0xd7fc('0xa')](_0xd7fc('0xb'),_0x198d11,'request\x20sent',JSON['stringify'](_0x4af13d));if(_0x4af13d[_0xd7fc('0xc')]){if(_0x4af13d['error'][_0xd7fc('0xd')]===0x1f4){logger[_0xd7fc('0xc')](_0xd7fc('0xe'),_0x198d11,_0x4af13d['error']['message']);return _0x53ebca(_0x4af13d[_0xd7fc('0xc')][_0xd7fc('0xf')]);}logger[_0xd7fc('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x198d11,_0x4af13d[_0xd7fc('0xc')]['message']);return _0x1cb36e(_0x4af13d['error']['message']);}else{logger[_0xd7fc('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x198d11,_0xd7fc('0x10'));_0x1cb36e(_0x4af13d[_0xd7fc('0x11')]['message']);}})[_0xd7fc('0x12')](function(_0x22664e){logger[_0xd7fc('0xc')](_0xd7fc('0xe'),_0x198d11,_0x22664e);_0x53ebca(_0x22664e);});});} \ No newline at end of file +var _0xb3db=['stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xae099d,_0x2355bb){var _0x6ed1a1=function(_0x31e0c7){while(--_0x31e0c7){_0xae099d['push'](_0xae099d['shift']());}};_0x6ed1a1(++_0x2355bb);}(_0xb3db,0x103));var _0xbb3d=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xb3db[_0x1f7201];return _0x289fd2;};'use strict';var _=require(_0xbb3d('0x0'));var util=require(_0xbb3d('0x1'));var moment=require(_0xbb3d('0x2'));var BPromise=require(_0xbb3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb3d('0x4'));var db=require(_0xbb3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb3d('0x6'))(_0xbb3d('0x7'));var config=require(_0xbb3d('0x8'));var jayson=require(_0xbb3d('0x9'));var client=jayson[_0xbb3d('0xa')][_0xbb3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x377b44,_0x54571a,_0xa467f8){return new BPromise(function(_0x54c81e,_0x14cc44){return client['request'](_0x377b44,_0xa467f8)[_0xbb3d('0xc')](function(_0x37419b){logger[_0xbb3d('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x54571a,_0xbb3d('0xe'));logger[_0xbb3d('0xf')](_0xbb3d('0x10'),_0x54571a,_0xbb3d('0xe'),JSON[_0xbb3d('0x11')](_0x37419b));if(_0x37419b[_0xbb3d('0x12')]){if(_0x37419b[_0xbb3d('0x12')][_0xbb3d('0x13')]===0x1f4){logger[_0xbb3d('0x12')](_0xbb3d('0x14'),_0x54571a,_0x37419b[_0xbb3d('0x12')][_0xbb3d('0x15')]);return _0x14cc44(_0x37419b[_0xbb3d('0x12')][_0xbb3d('0x15')]);}logger[_0xbb3d('0x12')](_0xbb3d('0x14'),_0x54571a,_0x37419b['error'][_0xbb3d('0x15')]);return _0x54c81e(_0x37419b[_0xbb3d('0x12')]['message']);}else{logger['info'](_0xbb3d('0x14'),_0x54571a,_0xbb3d('0xe'));_0x54c81e(_0x37419b[_0xbb3d('0x16')][_0xbb3d('0x15')]);}})['catch'](function(_0x146b67){logger[_0xbb3d('0x12')](_0xbb3d('0x14'),_0x54571a,_0x146b67);_0x14cc44(_0x146b67);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0b93405..2c4bb84 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 _0x2b0a=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x417558,_0x5475ce){var _0x1d74df=function(_0x555b54){while(--_0x555b54){_0x417558['push'](_0x417558['shift']());}};_0x1d74df(++_0x5475ce);}(_0x2b0a,0xb1));var _0xa2b0=function(_0x360ca2,_0x42aec7){_0x360ca2=_0x360ca2-0x0;var _0x4b18e3=_0x2b0a[_0x360ca2];return _0x4b18e3;};'use strict';var multer=require(_0xa2b0('0x0'));var util=require(_0xa2b0('0x1'));var path=require(_0xa2b0('0x2'));var timeout=require(_0xa2b0('0x3'));var express=require(_0xa2b0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa2b0('0x5'));var interaction=require(_0xa2b0('0x6'));var config=require(_0xa2b0('0x7'));var controller=require('./intVtigerField.controller');router[_0xa2b0('0x8')]('/',auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xa')]);router[_0xa2b0('0x8')](_0xa2b0('0xb'),auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xc')]);router[_0xa2b0('0xd')]('/',auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xe')]);router['put'](_0xa2b0('0xb'),auth[_0xa2b0('0x9')](),controller[_0xa2b0('0xf')]);router[_0xa2b0('0x10')](_0xa2b0('0xb'),auth[_0xa2b0('0x9')](),controller[_0xa2b0('0x11')]);module[_0xa2b0('0x12')]=router; \ No newline at end of file +var _0xa045=['isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1dd17c,_0x4a1023){var _0x27d9b3=function(_0x143298){while(--_0x143298){_0x1dd17c['push'](_0x1dd17c['shift']());}};_0x27d9b3(++_0x4a1023);}(_0xa045,0xaa));var _0x5a04=function(_0x868bf8,_0x290a75){_0x868bf8=_0x868bf8-0x0;var _0x57b04b=_0xa045[_0x868bf8];return _0x57b04b;};'use strict';var multer=require(_0x5a04('0x0'));var util=require(_0x5a04('0x1'));var path=require(_0x5a04('0x2'));var timeout=require(_0x5a04('0x3'));var express=require(_0x5a04('0x4'));var router=express[_0x5a04('0x5')]();var fs_extra=require(_0x5a04('0x6'));var auth=require(_0x5a04('0x7'));var interaction=require(_0x5a04('0x8'));var config=require(_0x5a04('0x9'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x5a04('0xa')](),controller[_0x5a04('0xb')]);router['get'](_0x5a04('0xc'),auth['isAuthenticated'](),controller[_0x5a04('0xd')]);router['post']('/',auth[_0x5a04('0xa')](),controller['create']);router[_0x5a04('0xe')](_0x5a04('0xc'),auth['isAuthenticated'](),controller[_0x5a04('0xf')]);router['delete'](_0x5a04('0xc'),auth[_0x5a04('0xa')](),controller[_0x5a04('0x10')]);module[_0x5a04('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 f983441..f539960 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 _0x03f9=['ENUM','string','customVariable','STRING','variable','BOOLEAN','sequelize'];(function(_0x52e7ee,_0x34a838){var _0x2520b3=function(_0x26b4c5){while(--_0x26b4c5){_0x52e7ee['push'](_0x52e7ee['shift']());}};_0x2520b3(++_0x34a838);}(_0x03f9,0x1b8));var _0x903f=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x03f9[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x903f('0x0'));module['exports']={'type':{'type':Sequelize[_0x903f('0x1')](_0x903f('0x2'),'variable',_0x903f('0x3'),'keyValue','picklist'),'defaultValue':_0x903f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x903f('0x4')]},'keyType':{'type':Sequelize[_0x903f('0x1')]('string',_0x903f('0x5'),_0x903f('0x3'))},'keyContent':{'type':Sequelize[_0x903f('0x4')]},'idField':{'type':Sequelize[_0x903f('0x4')]},'nameField':{'type':Sequelize[_0x903f('0x4')]},'customField':{'type':Sequelize[_0x903f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x903f('0x4')]}}; \ No newline at end of file +var _0x3797=['variable','keyValue','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x3797,0x165));var _0x7379=function(_0x5e37f6,_0x508bde){_0x5e37f6=_0x5e37f6-0x0;var _0x1a5c73=_0x3797[_0x5e37f6];return _0x1a5c73;};'use strict';var Sequelize=require(_0x7379('0x0'));module[_0x7379('0x1')]={'type':{'type':Sequelize[_0x7379('0x2')]('string',_0x7379('0x3'),'customVariable',_0x7379('0x4'),'picklist'),'defaultValue':_0x7379('0x5')},'content':{'type':Sequelize[_0x7379('0x6')]},'key':{'type':Sequelize[_0x7379('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x7379('0x5'),_0x7379('0x3'),_0x7379('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7379('0x6')]},'nameField':{'type':Sequelize[_0x7379('0x6')]},'customField':{'type':Sequelize[_0x7379('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7379('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9e4faf3..e2facd2 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 _0x5ab2=['hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','count','include','findAll','rows','show','params','keys','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','offset','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes'];(function(_0x115805,_0x2c5271){var _0x4ece77=function(_0x29e3c7){while(--_0x29e3c7){_0x115805['push'](_0x115805['shift']());}};_0x4ece77(++_0x2c5271);}(_0x5ab2,0x146));var _0x25ab=function(_0x1e8740,_0x4e0c8e){_0x1e8740=_0x1e8740-0x0;var _0x57d2a9=_0x5ab2[_0x1e8740];return _0x57d2a9;};'use strict';var emlformat=require(_0x25ab('0x0'));var rimraf=require(_0x25ab('0x1'));var zipdir=require(_0x25ab('0x2'));var jsonpatch=require(_0x25ab('0x3'));var rp=require(_0x25ab('0x4'));var moment=require(_0x25ab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x25ab('0x6'));var util=require(_0x25ab('0x7'));var path=require(_0x25ab('0x8'));var sox=require('sox');var csv=require(_0x25ab('0x9'));var ejs=require(_0x25ab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25ab('0xb'));var squel=require(_0x25ab('0xc'));var crypto=require(_0x25ab('0xd'));var jsforce=require(_0x25ab('0xe'));var deskjs=require(_0x25ab('0xf'));var toCsv=require(_0x25ab('0x9'));var querystring=require(_0x25ab('0x10'));var Papa=require(_0x25ab('0x11'));var Redis=require(_0x25ab('0x12'));var authService=require(_0x25ab('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x25ab('0x14'));var hardwareService=require(_0x25ab('0x15'));var logger=require(_0x25ab('0x16'))(_0x25ab('0x17'));var utils=require(_0x25ab('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eaa61,_0x44e49d){_0x44e49d=_0x44e49d||0xcc;return function(_0x39bdae){if(_0x39bdae){return _0x2eaa61[_0x25ab('0x19')](_0x44e49d);}return _0x2eaa61[_0x25ab('0x1a')](_0x44e49d)['end']();};}function respondWithResult(_0x4acc9b,_0xa16ee7){_0xa16ee7=_0xa16ee7||0xc8;return function(_0x10a3bf){if(_0x10a3bf){return _0x4acc9b[_0x25ab('0x1a')](_0xa16ee7)[_0x25ab('0x1b')](_0x10a3bf);}};}function respondWithFilteredResult(_0x2823d1,_0x453329){return function(_0x1ba219){if(_0x1ba219){var _0x99df94=typeof _0x453329['offset']===_0x25ab('0x1c')&&typeof _0x453329['limit']===_0x25ab('0x1c');var _0x12780d=_0x1ba219['count'];var _0x3a96d1=_0x99df94?0x0:_0x453329[_0x25ab('0x1d')];var _0x18ffd9=_0x99df94?_0x1ba219['count']:_0x453329[_0x25ab('0x1d')]+_0x453329['limit'];var _0x1b23fe;if(_0x18ffd9>=_0x12780d){_0x18ffd9=_0x12780d;_0x1b23fe=0xc8;}else{_0x1b23fe=0xce;}_0x2823d1[_0x25ab('0x1a')](_0x1b23fe);return _0x2823d1[_0x25ab('0x1e')]('Content-Range',_0x3a96d1+'-'+_0x18ffd9+'/'+_0x12780d)[_0x25ab('0x1b')](_0x1ba219);}return null;};}function patchUpdates(_0x5e5e4e){return function(_0x36ac33){try{jsonpatch[_0x25ab('0x1f')](_0x36ac33,_0x5e5e4e,!![]);}catch(_0x1f5e8f){return BPromise[_0x25ab('0x20')](_0x1f5e8f);}return _0x36ac33[_0x25ab('0x21')]();};}function saveUpdates(_0x109762,_0x153d3a){return function(_0x12913f){if(_0x12913f){return _0x12913f[_0x25ab('0x22')](_0x109762)['then'](function(_0xcd0b59){return _0xcd0b59;});}return null;};}function removeEntity(_0x1d1bf6,_0x53f413){return function(_0x207934){if(_0x207934){return _0x207934[_0x25ab('0x23')]()[_0x25ab('0x24')](function(){_0x1d1bf6['status'](0xcc)[_0x25ab('0x25')]();});}};}function handleEntityNotFound(_0xe7250b,_0x1aea54){return function(_0x597acb){if(!_0x597acb){_0xe7250b[_0x25ab('0x19')](0x194);}return _0x597acb;};}function handleError(_0x125fe0,_0x3769c7){_0x3769c7=_0x3769c7||0x1f4;return function(_0x2426f8){logger[_0x25ab('0x26')](_0x2426f8[_0x25ab('0x27')]);if(_0x2426f8[_0x25ab('0x28')]){delete _0x2426f8['name'];}_0x125fe0[_0x25ab('0x1a')](_0x3769c7)[_0x25ab('0x29')](_0x2426f8);};}exports['index']=function(_0x459a13,_0x11455b){var _0x4ef5c3={},_0x3c8b2c={},_0x2a7992={'count':0x0,'rows':[]};var _0x40df31=_['map'](db[_0x25ab('0x2a')][_0x25ab('0x2b')],function(_0x3503ab){return{'name':_0x3503ab[_0x25ab('0x2c')],'type':_0x3503ab[_0x25ab('0x2d')][_0x25ab('0x2e')]};});_0x3c8b2c[_0x25ab('0x2f')]=_[_0x25ab('0x30')](_0x40df31,'name');_0x3c8b2c[_0x25ab('0x31')]=_['keys'](_0x459a13[_0x25ab('0x31')]);_0x3c8b2c[_0x25ab('0x32')]=_[_0x25ab('0x33')](_0x3c8b2c[_0x25ab('0x2f')],_0x3c8b2c[_0x25ab('0x31')]);_0x4ef5c3['attributes']=_['intersection'](_0x3c8b2c[_0x25ab('0x2f')],qs[_0x25ab('0x34')](_0x459a13[_0x25ab('0x31')]['fields']));_0x4ef5c3[_0x25ab('0x35')]=_0x4ef5c3[_0x25ab('0x35')]['length']?_0x4ef5c3[_0x25ab('0x35')]:_0x3c8b2c['model'];if(!_0x459a13[_0x25ab('0x31')][_0x25ab('0x36')](_0x25ab('0x37'))){_0x4ef5c3['limit']=qs[_0x25ab('0x38')](_0x459a13[_0x25ab('0x31')][_0x25ab('0x38')]);_0x4ef5c3[_0x25ab('0x1d')]=qs[_0x25ab('0x1d')](_0x459a13['query'][_0x25ab('0x1d')]);}_0x4ef5c3[_0x25ab('0x39')]=qs['sort'](_0x459a13[_0x25ab('0x31')][_0x25ab('0x3a')]);_0x4ef5c3[_0x25ab('0x3b')]=qs[_0x25ab('0x32')](_['pick'](_0x459a13['query'],_0x3c8b2c['filters']),_0x40df31);if(_0x459a13['query'][_0x25ab('0x3c')]){_0x4ef5c3[_0x25ab('0x3b')]=_[_0x25ab('0x3d')](_0x4ef5c3[_0x25ab('0x3b')],{'$or':_[_0x25ab('0x30')](_0x40df31,function(_0x4e404c){if(_0x4e404c[_0x25ab('0x2d')]!=='VIRTUAL'){var _0x50a6f9={};_0x50a6f9[_0x4e404c['name']]={'$like':'%'+_0x459a13[_0x25ab('0x31')][_0x25ab('0x3c')]+'%'};return _0x50a6f9;}})});}_0x4ef5c3=_['merge']({},_0x4ef5c3,_0x459a13[_0x25ab('0x3e')]);var _0xb2b483={'where':_0x4ef5c3[_0x25ab('0x3b')]};return db[_0x25ab('0x2a')][_0x25ab('0x3f')](_0xb2b483)[_0x25ab('0x24')](function(_0x29c05e){_0x2a7992[_0x25ab('0x3f')]=_0x29c05e;if(_0x459a13[_0x25ab('0x31')]['includeAll']){_0x4ef5c3[_0x25ab('0x40')]=[{'all':!![]}];}return db[_0x25ab('0x2a')][_0x25ab('0x41')](_0x4ef5c3);})[_0x25ab('0x24')](function(_0x417fcd){_0x2a7992[_0x25ab('0x42')]=_0x417fcd;return _0x2a7992;})[_0x25ab('0x24')](respondWithFilteredResult(_0x11455b,_0x4ef5c3))['catch'](handleError(_0x11455b,null));};exports[_0x25ab('0x43')]=function(_0x44aba7,_0x3c38b8){var _0x4f874d={'raw':!![],'where':{'id':_0x44aba7[_0x25ab('0x44')]['id']}},_0x16cde7={};_0x16cde7[_0x25ab('0x2f')]=_[_0x25ab('0x45')](db['VtigerField'][_0x25ab('0x2b')]);_0x16cde7[_0x25ab('0x31')]=_[_0x25ab('0x45')](_0x44aba7[_0x25ab('0x31')]);_0x16cde7['filters']=_[_0x25ab('0x33')](_0x16cde7[_0x25ab('0x2f')],_0x16cde7[_0x25ab('0x31')]);_0x4f874d[_0x25ab('0x35')]=_[_0x25ab('0x33')](_0x16cde7[_0x25ab('0x2f')],qs[_0x25ab('0x34')](_0x44aba7['query'][_0x25ab('0x34')]));_0x4f874d['attributes']=_0x4f874d['attributes'][_0x25ab('0x46')]?_0x4f874d['attributes']:_0x16cde7[_0x25ab('0x2f')];if(_0x44aba7[_0x25ab('0x31')][_0x25ab('0x47')]){_0x4f874d[_0x25ab('0x40')]=[{'all':!![]}];}_0x4f874d=_['merge']({},_0x4f874d,_0x44aba7[_0x25ab('0x3e')]);return db[_0x25ab('0x2a')][_0x25ab('0x48')](_0x4f874d)[_0x25ab('0x24')](handleEntityNotFound(_0x3c38b8,null))[_0x25ab('0x24')](respondWithResult(_0x3c38b8,null))[_0x25ab('0x49')](handleError(_0x3c38b8,null));};exports[_0x25ab('0x4a')]=function(_0x4a7a24,_0x201ef8){return db[_0x25ab('0x2a')][_0x25ab('0x4a')](_0x4a7a24[_0x25ab('0x4b')],{})[_0x25ab('0x24')](respondWithResult(_0x201ef8,0xc9))[_0x25ab('0x49')](handleError(_0x201ef8,null));};exports[_0x25ab('0x22')]=function(_0x180088,_0x2ace9d){if(_0x180088['body']['id']){delete _0x180088[_0x25ab('0x4b')]['id'];}return db[_0x25ab('0x2a')][_0x25ab('0x48')]({'where':{'id':_0x180088[_0x25ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ace9d,null))[_0x25ab('0x24')](saveUpdates(_0x180088[_0x25ab('0x4b')],null))[_0x25ab('0x24')](respondWithResult(_0x2ace9d,null))[_0x25ab('0x49')](handleError(_0x2ace9d,null));};exports[_0x25ab('0x23')]=function(_0x3289bc,_0x304fbe){return db[_0x25ab('0x2a')][_0x25ab('0x48')]({'where':{'id':_0x3289bc[_0x25ab('0x44')]['id']}})[_0x25ab('0x24')](handleEntityNotFound(_0x304fbe,null))['then'](removeEntity(_0x304fbe,null))['catch'](handleError(_0x304fbe,null));}; \ No newline at end of file +var _0x3290=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../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','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','find'];(function(_0x401e62,_0x53bfd6){var _0x39c0e5=function(_0x1589e1){while(--_0x1589e1){_0x401e62['push'](_0x401e62['shift']());}};_0x39c0e5(++_0x53bfd6);}(_0x3290,0xe6));var _0x0329=function(_0xb3761d,_0x5bd58f){_0xb3761d=_0xb3761d-0x0;var _0x1e28ee=_0x3290[_0xb3761d];return _0x1e28ee;};'use strict';var emlformat=require(_0x0329('0x0'));var rimraf=require(_0x0329('0x1'));var zipdir=require(_0x0329('0x2'));var jsonpatch=require(_0x0329('0x3'));var rp=require(_0x0329('0x4'));var moment=require(_0x0329('0x5'));var BPromise=require(_0x0329('0x6'));var Mustache=require(_0x0329('0x7'));var util=require('util');var path=require(_0x0329('0x8'));var sox=require(_0x0329('0x9'));var csv=require(_0x0329('0xa'));var ejs=require(_0x0329('0xb'));var fs=require('fs');var fs_extra=require(_0x0329('0xc'));var _=require('lodash');var squel=require(_0x0329('0xd'));var crypto=require(_0x0329('0xe'));var jsforce=require(_0x0329('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0329('0xa'));var querystring=require('querystring');var Papa=require(_0x0329('0x10'));var Redis=require(_0x0329('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0329('0x12'));var as=require(_0x0329('0x13'));var hardwareService=require(_0x0329('0x14'));var logger=require(_0x0329('0x15'))('api');var utils=require(_0x0329('0x16'));var config=require(_0x0329('0x17'));var licenseUtil=require(_0x0329('0x18'));var db=require(_0x0329('0x19'))['db'];function respondWithStatusCode(_0x3866ba,_0x37e7e5){_0x37e7e5=_0x37e7e5||0xcc;return function(_0x30594f){if(_0x30594f){return _0x3866ba[_0x0329('0x1a')](_0x37e7e5);}return _0x3866ba[_0x0329('0x1b')](_0x37e7e5)['end']();};}function respondWithResult(_0x38c4d9,_0x131be2){_0x131be2=_0x131be2||0xc8;return function(_0x1ccc62){if(_0x1ccc62){return _0x38c4d9[_0x0329('0x1b')](_0x131be2)[_0x0329('0x1c')](_0x1ccc62);}};}function respondWithFilteredResult(_0x3e539c,_0x5ae31f){return function(_0x2f67ee){if(_0x2f67ee){var _0x4c0ad6=typeof _0x5ae31f[_0x0329('0x1d')]===_0x0329('0x1e')&&typeof _0x5ae31f[_0x0329('0x1f')]===_0x0329('0x1e');var _0x4df502=_0x2f67ee[_0x0329('0x20')];var _0x26ff39=_0x4c0ad6?0x0:_0x5ae31f[_0x0329('0x1d')];var _0x3c8934=_0x4c0ad6?_0x2f67ee[_0x0329('0x20')]:_0x5ae31f['offset']+_0x5ae31f['limit'];var _0x4446d9;if(_0x3c8934>=_0x4df502){_0x3c8934=_0x4df502;_0x4446d9=0xc8;}else{_0x4446d9=0xce;}_0x3e539c['status'](_0x4446d9);return _0x3e539c[_0x0329('0x21')](_0x0329('0x22'),_0x26ff39+'-'+_0x3c8934+'/'+_0x4df502)[_0x0329('0x1c')](_0x2f67ee);}return null;};}function patchUpdates(_0x38b569){return function(_0x277341){try{jsonpatch[_0x0329('0x23')](_0x277341,_0x38b569,!![]);}catch(_0x5848e1){return BPromise['reject'](_0x5848e1);}return _0x277341[_0x0329('0x24')]();};}function saveUpdates(_0x3c35c1,_0x3c7de7){return function(_0x37b643){if(_0x37b643){return _0x37b643[_0x0329('0x25')](_0x3c35c1)[_0x0329('0x26')](function(_0x292a32){return _0x292a32;});}return null;};}function removeEntity(_0x199754,_0x2358e0){return function(_0x32ca8a){if(_0x32ca8a){return _0x32ca8a[_0x0329('0x27')]()['then'](function(){_0x199754[_0x0329('0x1b')](0xcc)[_0x0329('0x28')]();});}};}function handleEntityNotFound(_0x4a071f,_0x3b2b7e){return function(_0x5e1325){if(!_0x5e1325){_0x4a071f[_0x0329('0x1a')](0x194);}return _0x5e1325;};}function handleError(_0x5956e5,_0x137565){_0x137565=_0x137565||0x1f4;return function(_0x34a732){logger[_0x0329('0x29')](_0x34a732[_0x0329('0x2a')]);if(_0x34a732[_0x0329('0x2b')]){delete _0x34a732[_0x0329('0x2b')];}_0x5956e5[_0x0329('0x1b')](_0x137565)['send'](_0x34a732);};}exports[_0x0329('0x2c')]=function(_0xe1d7d3,_0x1a3d17){var _0x11c622={},_0x58c183={},_0x114e69={'count':0x0,'rows':[]};var _0x298c4f=_[_0x0329('0x2d')](db[_0x0329('0x2e')][_0x0329('0x2f')],function(_0x30805b){return{'name':_0x30805b[_0x0329('0x30')],'type':_0x30805b['type'][_0x0329('0x31')]};});_0x58c183[_0x0329('0x32')]=_['map'](_0x298c4f,_0x0329('0x2b'));_0x58c183['query']=_[_0x0329('0x33')](_0xe1d7d3[_0x0329('0x34')]);_0x58c183['filters']=_[_0x0329('0x35')](_0x58c183[_0x0329('0x32')],_0x58c183['query']);_0x11c622[_0x0329('0x36')]=_[_0x0329('0x35')](_0x58c183[_0x0329('0x32')],qs[_0x0329('0x37')](_0xe1d7d3[_0x0329('0x34')][_0x0329('0x37')]));_0x11c622['attributes']=_0x11c622[_0x0329('0x36')][_0x0329('0x38')]?_0x11c622[_0x0329('0x36')]:_0x58c183[_0x0329('0x32')];if(!_0xe1d7d3[_0x0329('0x34')][_0x0329('0x39')](_0x0329('0x3a'))){_0x11c622[_0x0329('0x1f')]=qs[_0x0329('0x1f')](_0xe1d7d3[_0x0329('0x34')][_0x0329('0x1f')]);_0x11c622[_0x0329('0x1d')]=qs[_0x0329('0x1d')](_0xe1d7d3[_0x0329('0x34')]['offset']);}_0x11c622['order']=qs[_0x0329('0x3b')](_0xe1d7d3[_0x0329('0x34')][_0x0329('0x3b')]);_0x11c622[_0x0329('0x3c')]=qs[_0x0329('0x3d')](_['pick'](_0xe1d7d3['query'],_0x58c183[_0x0329('0x3d')]),_0x298c4f);if(_0xe1d7d3[_0x0329('0x34')]['filter']){_0x11c622[_0x0329('0x3c')]=_[_0x0329('0x3e')](_0x11c622[_0x0329('0x3c')],{'$or':_[_0x0329('0x2d')](_0x298c4f,function(_0x524ffa){if(_0x524ffa[_0x0329('0x3f')]!==_0x0329('0x40')){var _0x12aba1={};_0x12aba1[_0x524ffa[_0x0329('0x2b')]]={'$like':'%'+_0xe1d7d3['query'][_0x0329('0x41')]+'%'};return _0x12aba1;}})});}_0x11c622=_[_0x0329('0x3e')]({},_0x11c622,_0xe1d7d3['options']);var _0x3c8cee={'where':_0x11c622[_0x0329('0x3c')]};return db['VtigerField'][_0x0329('0x20')](_0x3c8cee)[_0x0329('0x26')](function(_0xb2b3fe){_0x114e69['count']=_0xb2b3fe;if(_0xe1d7d3[_0x0329('0x34')][_0x0329('0x42')]){_0x11c622[_0x0329('0x43')]=[{'all':!![]}];}return db[_0x0329('0x2e')][_0x0329('0x44')](_0x11c622);})[_0x0329('0x26')](function(_0x4250d0){_0x114e69[_0x0329('0x45')]=_0x4250d0;return _0x114e69;})[_0x0329('0x26')](respondWithFilteredResult(_0x1a3d17,_0x11c622))[_0x0329('0x46')](handleError(_0x1a3d17,null));};exports['show']=function(_0x27173a,_0x5450d5){var _0x128e15={'raw':!![],'where':{'id':_0x27173a[_0x0329('0x47')]['id']}},_0x3b98f3={};_0x3b98f3[_0x0329('0x32')]=_[_0x0329('0x33')](db[_0x0329('0x2e')]['rawAttributes']);_0x3b98f3['query']=_[_0x0329('0x33')](_0x27173a[_0x0329('0x34')]);_0x3b98f3[_0x0329('0x3d')]=_['intersection'](_0x3b98f3[_0x0329('0x32')],_0x3b98f3[_0x0329('0x34')]);_0x128e15['attributes']=_['intersection'](_0x3b98f3[_0x0329('0x32')],qs['fields'](_0x27173a['query'][_0x0329('0x37')]));_0x128e15[_0x0329('0x36')]=_0x128e15[_0x0329('0x36')]['length']?_0x128e15['attributes']:_0x3b98f3['model'];if(_0x27173a[_0x0329('0x34')][_0x0329('0x42')]){_0x128e15['include']=[{'all':!![]}];}_0x128e15=_['merge']({},_0x128e15,_0x27173a[_0x0329('0x48')]);return db['VtigerField'][_0x0329('0x49')](_0x128e15)[_0x0329('0x26')](handleEntityNotFound(_0x5450d5,null))['then'](respondWithResult(_0x5450d5,null))[_0x0329('0x46')](handleError(_0x5450d5,null));};exports['create']=function(_0x5c494c,_0x1454c2){return db[_0x0329('0x2e')][_0x0329('0x4a')](_0x5c494c['body'],{})[_0x0329('0x26')](respondWithResult(_0x1454c2,0xc9))[_0x0329('0x46')](handleError(_0x1454c2,null));};exports[_0x0329('0x25')]=function(_0x23de57,_0x2bd982){if(_0x23de57['body']['id']){delete _0x23de57[_0x0329('0x4b')]['id'];}return db[_0x0329('0x2e')]['find']({'where':{'id':_0x23de57[_0x0329('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bd982,null))[_0x0329('0x26')](saveUpdates(_0x23de57['body'],null))[_0x0329('0x26')](respondWithResult(_0x2bd982,null))[_0x0329('0x46')](handleError(_0x2bd982,null));};exports[_0x0329('0x27')]=function(_0x24bb76,_0x161566){return db[_0x0329('0x2e')][_0x0329('0x49')]({'where':{'id':_0x24bb76[_0x0329('0x47')]['id']}})[_0x0329('0x26')](handleEntityNotFound(_0x161566,null))[_0x0329('0x26')](removeEntity(_0x161566,null))[_0x0329('0x46')](handleError(_0x161566,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 902588e..7a9b1bc 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 _0xc6a5=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','int_vtiger_fields','vtiger_unique_index'];(function(_0x2bc8ca,_0x38576d){var _0x19d471=function(_0x141b76){while(--_0x141b76){_0x2bc8ca['push'](_0x2bc8ca['shift']());}};_0x19d471(++_0x38576d);}(_0xc6a5,0xe2));var _0x5c6a=function(_0x1783e3,_0x839348){_0x1783e3=_0x1783e3-0x0;var _0x12d2aa=_0xc6a5[_0x1783e3];return _0x12d2aa;};'use strict';var _=require(_0x5c6a('0x0'));var util=require(_0x5c6a('0x1'));var logger=require(_0x5c6a('0x2'))(_0x5c6a('0x3'));var moment=require(_0x5c6a('0x4'));var BPromise=require(_0x5c6a('0x5'));var rp=require(_0x5c6a('0x6'));var fs=require('fs');var path=require(_0x5c6a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x5c6a('0x8')]=function(_0x47a119,_0x4beb8e){return _0x47a119[_0x5c6a('0x9')]('VtigerField',attributes,{'tableName':_0x5c6a('0xa'),'paranoid':![],'indexes':[{'name':_0x5c6a('0xb'),'fields':[_0x5c6a('0xc'),_0x5c6a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9860=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0xefd4a8,_0x2e1c3d){var _0x49f44a=function(_0x58ef8f){while(--_0x58ef8f){_0xefd4a8['push'](_0xefd4a8['shift']());}};_0x49f44a(++_0x2e1c3d);}(_0x9860,0x12d));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0986('0x0'));var logger=require(_0x0986('0x1'))(_0x0986('0x2'));var moment=require(_0x0986('0x3'));var BPromise=require(_0x0986('0x4'));var rp=require(_0x0986('0x5'));var fs=require('fs');var path=require(_0x0986('0x6'));var rimraf=require(_0x0986('0x7'));var config=require(_0x0986('0x8'));var attributes=require(_0x0986('0x9'));module[_0x0986('0xa')]=function(_0x4de5eb,_0x3b1dcd){return _0x4de5eb[_0x0986('0xb')]('VtigerField',attributes,{'tableName':_0x0986('0xc'),'paranoid':![],'indexes':[{'name':_0x0986('0xd'),'fields':[_0x0986('0xe'),_0x0986('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 0429a89..7939493 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 _0x6f2e=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x469bce,_0x9b72){var _0x489a35=function(_0x532357){while(--_0x532357){_0x469bce['push'](_0x469bce['shift']());}};_0x489a35(++_0x9b72);}(_0x6f2e,0xb1));var _0xe6f2=function(_0x3676ee,_0x5df798){_0x3676ee=_0x3676ee-0x0;var _0x66ec17=_0x6f2e[_0x3676ee];return _0x66ec17;};'use strict';var _=require('lodash');var util=require(_0xe6f2('0x0'));var moment=require(_0xe6f2('0x1'));var BPromise=require(_0xe6f2('0x2'));var rs=require(_0xe6f2('0x3'));var fs=require('fs');var Redis=require(_0xe6f2('0x4'));var db=require(_0xe6f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6f2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe6f2('0x7'));var client=jayson[_0xe6f2('0x8')][_0xe6f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d20bf,_0x13b324,_0x406826){return new BPromise(function(_0x178afa,_0x21c18a){return client[_0xe6f2('0xa')](_0x2d20bf,_0x406826)[_0xe6f2('0xb')](function(_0x5bfa1e){logger[_0xe6f2('0xc')](_0xe6f2('0xd'),_0x13b324,_0xe6f2('0xe'));logger[_0xe6f2('0xf')](_0xe6f2('0x10'),_0x13b324,'request\x20sent',JSON[_0xe6f2('0x11')](_0x5bfa1e));if(_0x5bfa1e[_0xe6f2('0x12')]){if(_0x5bfa1e[_0xe6f2('0x12')]['code']===0x1f4){logger[_0xe6f2('0x12')](_0xe6f2('0xd'),_0x13b324,_0x5bfa1e['error']['message']);return _0x21c18a(_0x5bfa1e[_0xe6f2('0x12')]['message']);}logger[_0xe6f2('0x12')]('VtigerField,\x20%s,\x20%s',_0x13b324,_0x5bfa1e[_0xe6f2('0x12')][_0xe6f2('0x13')]);return _0x178afa(_0x5bfa1e[_0xe6f2('0x12')][_0xe6f2('0x13')]);}else{logger[_0xe6f2('0xc')]('VtigerField,\x20%s,\x20%s',_0x13b324,_0xe6f2('0xe'));_0x178afa(_0x5bfa1e[_0xe6f2('0x14')][_0xe6f2('0x13')]);}})[_0xe6f2('0x15')](function(_0x59120d){logger[_0xe6f2('0x12')](_0xe6f2('0xd'),_0x13b324,_0x59120d);_0x21c18a(_0x59120d);});});} \ No newline at end of file +var _0x7468=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3677d6,_0xe1071a){var _0x41e72c=function(_0x76433a){while(--_0x76433a){_0x3677d6['push'](_0x3677d6['shift']());}};_0x41e72c(++_0xe1071a);}(_0x7468,0xfe));var _0x8746=function(_0xcacd97,_0x75304b){_0xcacd97=_0xcacd97-0x0;var _0x3c750a=_0x7468[_0xcacd97];return _0x3c750a;};'use strict';var _=require(_0x8746('0x0'));var util=require(_0x8746('0x1'));var moment=require(_0x8746('0x2'));var BPromise=require('bluebird');var rs=require(_0x8746('0x3'));var fs=require('fs');var Redis=require(_0x8746('0x4'));var db=require(_0x8746('0x5'))['db'];var utils=require(_0x8746('0x6'));var logger=require(_0x8746('0x7'))(_0x8746('0x8'));var config=require(_0x8746('0x9'));var jayson=require(_0x8746('0xa'));var client=jayson[_0x8746('0xb')][_0x8746('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d2268,_0x302ebb,_0x21986f){return new BPromise(function(_0x18fd40,_0x3a0128){return client[_0x8746('0xd')](_0x4d2268,_0x21986f)[_0x8746('0xe')](function(_0x24d60e){logger[_0x8746('0xf')](_0x8746('0x10'),_0x302ebb,_0x8746('0x11'));logger[_0x8746('0x12')](_0x8746('0x13'),_0x302ebb,_0x8746('0x11'),JSON[_0x8746('0x14')](_0x24d60e));if(_0x24d60e[_0x8746('0x15')]){if(_0x24d60e[_0x8746('0x15')][_0x8746('0x16')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x302ebb,_0x24d60e[_0x8746('0x15')][_0x8746('0x17')]);return _0x3a0128(_0x24d60e['error'][_0x8746('0x17')]);}logger[_0x8746('0x15')]('VtigerField,\x20%s,\x20%s',_0x302ebb,_0x24d60e['error'][_0x8746('0x17')]);return _0x18fd40(_0x24d60e[_0x8746('0x15')][_0x8746('0x17')]);}else{logger['info'](_0x8746('0x10'),_0x302ebb,_0x8746('0x11'));_0x18fd40(_0x24d60e['result'][_0x8746('0x17')]);}})['catch'](function(_0x3ac663){logger[_0x8746('0x15')](_0x8746('0x10'),_0x302ebb,_0x3ac663);_0x3a0128(_0x3ac663);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 7ef6e6f..dddfab9 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 _0xb540=['getConfigurations','/:id/fields','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb540,0x179));var _0x0b54=function(_0x362158,_0x917ac5){_0x362158=_0x362158-0x0;var _0x1691e7=_0xb540[_0x362158];return _0x1691e7;};'use strict';var multer=require(_0x0b54('0x0'));var util=require(_0x0b54('0x1'));var path=require(_0x0b54('0x2'));var timeout=require(_0x0b54('0x3'));var express=require(_0x0b54('0x4'));var router=express[_0x0b54('0x5')]();var fs_extra=require(_0x0b54('0x6'));var auth=require(_0x0b54('0x7'));var interaction=require(_0x0b54('0x8'));var config=require(_0x0b54('0x9'));var controller=require(_0x0b54('0xa'));router[_0x0b54('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x0b54('0xc')](),controller['show']);router[_0x0b54('0xb')](_0x0b54('0xd'),auth[_0x0b54('0xc')](),controller[_0x0b54('0xe')]);router[_0x0b54('0xb')](_0x0b54('0xf'),auth[_0x0b54('0xc')](),controller['getFields']);router[_0x0b54('0x10')]('/',auth[_0x0b54('0xc')](),controller[_0x0b54('0x11')]);router[_0x0b54('0x10')](_0x0b54('0xd'),auth[_0x0b54('0xc')](),controller['addConfiguration']);router[_0x0b54('0x12')](_0x0b54('0x13'),auth['isAuthenticated'](),controller[_0x0b54('0x14')]);router[_0x0b54('0x15')](_0x0b54('0x13'),auth['isAuthenticated'](),controller[_0x0b54('0x16')]);module['exports']=router; \ No newline at end of file +var _0x143a=['getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x23b276,_0x39230b){var _0x19205f=function(_0x23bbcb){while(--_0x23bbcb){_0x23b276['push'](_0x23b276['shift']());}};_0x19205f(++_0x39230b);}(_0x143a,0x1c1));var _0xa143=function(_0x58c065,_0x15f2db){_0x58c065=_0x58c065-0x0;var _0x20c168=_0x143a[_0x58c065];return _0x20c168;};'use strict';var multer=require(_0xa143('0x0'));var util=require('util');var path=require(_0xa143('0x1'));var timeout=require(_0xa143('0x2'));var express=require(_0xa143('0x3'));var router=express[_0xa143('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa143('0x5'));var config=require(_0xa143('0x6'));var controller=require('./intZendeskAccount.controller');router[_0xa143('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa143('0x7')](_0xa143('0x8'),auth[_0xa143('0x9')](),controller['show']);router['get'](_0xa143('0xa'),auth[_0xa143('0x9')](),controller[_0xa143('0xb')]);router[_0xa143('0x7')](_0xa143('0xc'),auth['isAuthenticated'](),controller[_0xa143('0xd')]);router[_0xa143('0xe')]('/',auth[_0xa143('0x9')](),controller[_0xa143('0xf')]);router[_0xa143('0xe')](_0xa143('0xa'),auth[_0xa143('0x9')](),controller[_0xa143('0x10')]);router[_0xa143('0x11')](_0xa143('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xa143('0x12')](_0xa143('0x8'),auth[_0xa143('0x9')](),controller[_0xa143('0x13')]);module[_0xa143('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index f997bce..1c408b2 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 _0x8af6=['newTab','sequelize','exports','STRING','username','remoteUri','password','ENUM','integrationTab'];(function(_0x53790d,_0x3ee974){var _0x554d2f=function(_0x1bf8e6){while(--_0x1bf8e6){_0x53790d['push'](_0x53790d['shift']());}};_0x554d2f(++_0x3ee974);}(_0x8af6,0x76));var _0x68af=function(_0x3aab6a,_0x44298c){_0x3aab6a=_0x3aab6a-0x0;var _0x4f47d2=_0x8af6[_0x3aab6a];return _0x4f47d2;};'use strict';var Sequelize=require(_0x68af('0x0'));module[_0x68af('0x1')]={'name':{'type':Sequelize[_0x68af('0x2')]},'description':{'type':Sequelize[_0x68af('0x2')]},'username':{'type':Sequelize[_0x68af('0x2')],'unique':_0x68af('0x3')},'password':{'type':Sequelize[_0x68af('0x2')]},'token':{'type':Sequelize[_0x68af('0x2')]},'remoteUri':{'type':Sequelize[_0x68af('0x2')],'unique':_0x68af('0x4')},'authType':{'type':Sequelize['ENUM'](_0x68af('0x5'),'token'),'defaultValue':_0x68af('0x5')},'serverUrl':{'type':Sequelize[_0x68af('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x68af('0x6')](_0x68af('0x7'),_0x68af('0x8')),'defaultValue':_0x68af('0x7')}}; \ No newline at end of file +var _0x8f9d=['token','password','integrationTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x572b7e,_0xf883e3){var _0x37c748=function(_0x5b3e51){while(--_0x5b3e51){_0x572b7e['push'](_0x572b7e['shift']());}};_0x37c748(++_0xf883e3);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8f9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd8f9('0x1')],'unique':_0xd8f9('0x2')},'password':{'type':Sequelize[_0xd8f9('0x1')]},'token':{'type':Sequelize[_0xd8f9('0x1')]},'remoteUri':{'type':Sequelize[_0xd8f9('0x1')],'unique':_0xd8f9('0x3')},'authType':{'type':Sequelize[_0xd8f9('0x4')]('password',_0xd8f9('0x5')),'defaultValue':_0xd8f9('0x6')},'serverUrl':{'type':Sequelize[_0xd8f9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd8f9('0x4')](_0xd8f9('0x7'),'newTab'),'defaultValue':_0xd8f9('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 8a2e5f0..8b98eb1 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 _0xdb94=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','password','authType','remoteUri','slice','substring','%s/%s','ticket_fields','format','%s:%s','username','toString','base64','token','Basic\x20%s','Sequelize','includes','position','title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','key','model'];(function(_0x4d7d33,_0x575510){var _0x19407b=function(_0x24a723){while(--_0x24a723){_0x4d7d33['push'](_0x4d7d33['shift']());}};_0x19407b(++_0x575510);}(_0xdb94,0xab));var _0x4db9=function(_0x4270a7,_0x21a575){_0x4270a7=_0x4270a7-0x0;var _0x1e4821=_0xdb94[_0x4270a7];return _0x1e4821;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4db9('0x17'));function respondWithStatusCode(_0x5e644c,_0x571685){_0x571685=_0x571685||0xcc;return function(_0x34fc7d){if(_0x34fc7d){return _0x5e644c[_0x4db9('0x18')](_0x571685);}return _0x5e644c['status'](_0x571685)[_0x4db9('0x19')]();};}function respondWithResult(_0x1f9638,_0x452896){_0x452896=_0x452896||0xc8;return function(_0x22667c){if(_0x22667c){return _0x1f9638['status'](_0x452896)['json'](_0x22667c);}};}function respondWithFilteredResult(_0x102274,_0x34de1a){return function(_0x4a037f){if(_0x4a037f){var _0xadc104=typeof _0x34de1a[_0x4db9('0x1a')]==='undefined'&&typeof _0x34de1a['limit']===_0x4db9('0x1b');var _0x143b88=_0x4a037f[_0x4db9('0x1c')];var _0xa693c4=_0xadc104?0x0:_0x34de1a[_0x4db9('0x1a')];var _0x55494a=_0xadc104?_0x4a037f[_0x4db9('0x1c')]:_0x34de1a[_0x4db9('0x1a')]+_0x34de1a[_0x4db9('0x1d')];var _0x5e3b36;if(_0x55494a>=_0x143b88){_0x55494a=_0x143b88;_0x5e3b36=0xc8;}else{_0x5e3b36=0xce;}_0x102274[_0x4db9('0x1e')](_0x5e3b36);return _0x102274[_0x4db9('0x1f')](_0x4db9('0x20'),_0xa693c4+'-'+_0x55494a+'/'+_0x143b88)['json'](_0x4a037f);}return null;};}function patchUpdates(_0x46b522){return function(_0x2e8f95){try{jsonpatch[_0x4db9('0x21')](_0x2e8f95,_0x46b522,!![]);}catch(_0x46fc3d){return BPromise[_0x4db9('0x22')](_0x46fc3d);}return _0x2e8f95[_0x4db9('0x23')]();};}function saveUpdates(_0x3585d5,_0x5aef3b){return function(_0x4ceb0c){if(_0x4ceb0c){return _0x4ceb0c[_0x4db9('0x24')](_0x3585d5)[_0x4db9('0x25')](function(_0x319475){return _0x319475;});}return null;};}function removeEntity(_0x4aaa84,_0x213daa){return function(_0xdac966){if(_0xdac966){return _0xdac966['destroy']()[_0x4db9('0x25')](function(){_0x4aaa84[_0x4db9('0x1e')](0xcc)[_0x4db9('0x19')]();});}};}function handleEntityNotFound(_0x4dbb1b,_0x3c8237){return function(_0xd250c5){if(!_0xd250c5){_0x4dbb1b[_0x4db9('0x18')](0x194);}return _0xd250c5;};}function handleError(_0x2d330e,_0x3f9f7e){_0x3f9f7e=_0x3f9f7e||0x1f4;return function(_0x385e22){logger[_0x4db9('0x26')](_0x385e22[_0x4db9('0x27')]);if(_0x385e22[_0x4db9('0x28')]){delete _0x385e22[_0x4db9('0x28')];}_0x2d330e[_0x4db9('0x1e')](_0x3f9f7e)[_0x4db9('0x29')](_0x385e22);};}exports[_0x4db9('0x2a')]=function(_0x20f133,_0x583861){var _0x5031fe={},_0x3951b2={},_0x331279={'count':0x0,'rows':[]};var _0x119371=_[_0x4db9('0x2b')](db[_0x4db9('0x2c')][_0x4db9('0x2d')],function(_0x4dc946){return{'name':_0x4dc946[_0x4db9('0x2e')],'type':_0x4dc946['type'][_0x4db9('0x2f')]};});_0x3951b2[_0x4db9('0x30')]=_[_0x4db9('0x2b')](_0x119371,_0x4db9('0x28'));_0x3951b2[_0x4db9('0x31')]=_['keys'](_0x20f133['query']);_0x3951b2[_0x4db9('0x32')]=_['intersection'](_0x3951b2[_0x4db9('0x30')],_0x3951b2[_0x4db9('0x31')]);_0x5031fe['attributes']=_[_0x4db9('0x33')](_0x3951b2[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0x20f133['query'][_0x4db9('0x34')]));_0x5031fe['attributes']=_0x5031fe[_0x4db9('0x35')][_0x4db9('0x36')]?_0x5031fe[_0x4db9('0x35')]:_0x3951b2['model'];if(!_0x20f133['query'][_0x4db9('0x37')](_0x4db9('0x38'))){_0x5031fe[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x20f133[_0x4db9('0x31')][_0x4db9('0x1d')]);_0x5031fe[_0x4db9('0x1a')]=qs[_0x4db9('0x1a')](_0x20f133[_0x4db9('0x31')]['offset']);}_0x5031fe[_0x4db9('0x39')]=qs[_0x4db9('0x3a')](_0x20f133[_0x4db9('0x31')][_0x4db9('0x3a')]);_0x5031fe['where']=qs[_0x4db9('0x32')](_[_0x4db9('0x3b')](_0x20f133[_0x4db9('0x31')],_0x3951b2['filters']),_0x119371);if(_0x20f133[_0x4db9('0x31')][_0x4db9('0x3c')]){_0x5031fe[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x5031fe['where'],{'$or':_['map'](_0x119371,function(_0x41da52){if(_0x41da52[_0x4db9('0x3f')]!==_0x4db9('0x40')){var _0x8bc540={};_0x8bc540[_0x41da52[_0x4db9('0x28')]]={'$like':'%'+_0x20f133['query'][_0x4db9('0x3c')]+'%'};return _0x8bc540;}})});}_0x5031fe=_[_0x4db9('0x3e')]({},_0x5031fe,_0x20f133[_0x4db9('0x41')]);var _0x367c4c={'where':_0x5031fe[_0x4db9('0x3d')]};return db['ZendeskAccount'][_0x4db9('0x1c')](_0x367c4c)[_0x4db9('0x25')](function(_0x38a727){_0x331279['count']=_0x38a727;if(_0x20f133[_0x4db9('0x31')][_0x4db9('0x42')]){_0x5031fe[_0x4db9('0x43')]=[{'all':!![]}];}return db[_0x4db9('0x2c')][_0x4db9('0x44')](_0x5031fe);})[_0x4db9('0x25')](function(_0x412aab){_0x331279[_0x4db9('0x45')]=_0x412aab;return _0x331279;})[_0x4db9('0x25')](respondWithFilteredResult(_0x583861,_0x5031fe))[_0x4db9('0x46')](handleError(_0x583861,null));};exports['show']=function(_0x56bd68,_0x48aaf5){var _0x22a021={'raw':![],'where':{'id':_0x56bd68['params']['id']}},_0x28a3ef={};_0x28a3ef[_0x4db9('0x30')]=_[_0x4db9('0x47')](db['ZendeskAccount']['rawAttributes']);_0x28a3ef[_0x4db9('0x31')]=_['keys'](_0x56bd68[_0x4db9('0x31')]);_0x28a3ef[_0x4db9('0x32')]=_['intersection'](_0x28a3ef[_0x4db9('0x30')],_0x28a3ef[_0x4db9('0x31')]);_0x22a021['attributes']=_[_0x4db9('0x33')](_0x28a3ef[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0x56bd68['query']['fields']));_0x22a021[_0x4db9('0x35')]=_0x22a021[_0x4db9('0x35')][_0x4db9('0x36')]?_0x22a021[_0x4db9('0x35')]:_0x28a3ef[_0x4db9('0x30')];if(_0x56bd68[_0x4db9('0x31')][_0x4db9('0x42')]){_0x22a021[_0x4db9('0x43')]=[{'all':!![]}];}_0x22a021=_[_0x4db9('0x3e')]({},_0x22a021,_0x56bd68[_0x4db9('0x41')]);return db[_0x4db9('0x2c')][_0x4db9('0x48')](_0x22a021)[_0x4db9('0x25')](handleEntityNotFound(_0x48aaf5,null))['then'](respondWithResult(_0x48aaf5,null))[_0x4db9('0x46')](handleError(_0x48aaf5,null));};exports[_0x4db9('0x49')]=function(_0x3852f0,_0xba27c0){return db[_0x4db9('0x2c')][_0x4db9('0x49')](_0x3852f0[_0x4db9('0x4a')],{})[_0x4db9('0x25')](respondWithResult(_0xba27c0,0xc9))[_0x4db9('0x46')](handleError(_0xba27c0,null));};exports[_0x4db9('0x24')]=function(_0x10dccb,_0x49ea0c){if(_0x10dccb['body']['id']){delete _0x10dccb[_0x4db9('0x4a')]['id'];}return db[_0x4db9('0x2c')][_0x4db9('0x48')]({'where':{'id':_0x10dccb[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x49ea0c,null))[_0x4db9('0x25')](saveUpdates(_0x10dccb[_0x4db9('0x4a')],null))[_0x4db9('0x25')](respondWithResult(_0x49ea0c,null))['catch'](handleError(_0x49ea0c,null));};exports[_0x4db9('0x4c')]=function(_0xcb832e,_0x121225){return db[_0x4db9('0x2c')][_0x4db9('0x48')]({'where':{'id':_0xcb832e[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x121225,null))[_0x4db9('0x25')](removeEntity(_0x121225,null))['catch'](handleError(_0x121225,null));};exports[_0x4db9('0x4d')]=function(_0xd6701a,_0x216696,_0x3a1f0e){var _0x15486f={};var _0x2d7fa2={};var _0x4e88c2;var _0x188663;return db['ZendeskAccount'][_0x4db9('0x4e')]({'where':{'id':_0xd6701a['params']['id']}})['then'](handleEntityNotFound(_0x216696,null))[_0x4db9('0x25')](function(_0x5996f2){if(_0x5996f2){_0x4e88c2=_0x5996f2;_0x2d7fa2[_0x4db9('0x30')]=_[_0x4db9('0x47')](db[_0x4db9('0x4f')][_0x4db9('0x2d')]);_0x2d7fa2['query']=_[_0x4db9('0x47')](_0xd6701a['query']);_0x2d7fa2[_0x4db9('0x32')]=_[_0x4db9('0x33')](_0x2d7fa2['model'],_0x2d7fa2[_0x4db9('0x31')]);_0x15486f['attributes']=_[_0x4db9('0x33')](_0x2d7fa2[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0xd6701a[_0x4db9('0x31')][_0x4db9('0x34')]));_0x15486f[_0x4db9('0x35')]=_0x15486f[_0x4db9('0x35')][_0x4db9('0x36')]?_0x15486f[_0x4db9('0x35')]:_0x2d7fa2[_0x4db9('0x30')];_0x15486f[_0x4db9('0x39')]=qs[_0x4db9('0x3a')](_0xd6701a[_0x4db9('0x31')][_0x4db9('0x3a')]);_0x15486f[_0x4db9('0x3d')]=qs['filters'](_[_0x4db9('0x3b')](_0xd6701a[_0x4db9('0x31')],_0x2d7fa2['filters']));if(_0xd6701a[_0x4db9('0x31')][_0x4db9('0x3c')]){_0x15486f[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x15486f[_0x4db9('0x3d')],{'$or':_[_0x4db9('0x2b')](_0x15486f[_0x4db9('0x35')],function(_0x355083){var _0x215538={};_0x215538[_0x355083]={'$like':'%'+_0xd6701a['query']['filter']+'%'};return _0x215538;})});}_0x15486f=_[_0x4db9('0x3e')]({},_0x15486f,_0xd6701a[_0x4db9('0x41')]);return _0x4e88c2[_0x4db9('0x4d')](_0x15486f);}})[_0x4db9('0x25')](function(_0x35e822){if(_0x35e822){_0x188663=_0x35e822[_0x4db9('0x36')];if(!_0xd6701a[_0x4db9('0x31')][_0x4db9('0x37')](_0x4db9('0x38'))){_0x15486f[_0x4db9('0x1d')]=qs['limit'](_0xd6701a[_0x4db9('0x31')]['limit']);_0x15486f['offset']=qs['offset'](_0xd6701a['query'][_0x4db9('0x1a')]);}return _0x4e88c2['getConfigurations'](_0x15486f);}})['then'](function(_0x7aea3a){if(_0x7aea3a){return _0x7aea3a?{'count':_0x188663,'rows':_0x7aea3a}:null;}})[_0x4db9('0x25')](respondWithResult(_0x216696,null))[_0x4db9('0x46')](handleError(_0x216696,null));};exports[_0x4db9('0x50')]=function(_0x2d91d9,_0x3e833d,_0xaea8ff){if(_0x2d91d9[_0x4db9('0x4a')]['id']){delete _0x2d91d9[_0x4db9('0x4a')]['id'];}return db[_0x4db9('0x2c')][_0x4db9('0x4e')]({'where':{'id':_0x2d91d9[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x3e833d,null))[_0x4db9('0x25')](function(_0xd84c6c){if(_0xd84c6c){_0x2d91d9[_0x4db9('0x4a')]['AccountId']=_0xd84c6c['id'];_0x2d91d9['body']['Subjects']=integrations[_0x4db9('0x51')](_0x2d91d9['body'][_0x4db9('0x52')],_0x2d91d9[_0x4db9('0x4a')][_0x4db9('0x3f')]);_0x2d91d9['body']['Descriptions']=integrations[_0x4db9('0x53')](_0x2d91d9['body'][_0x4db9('0x52')],_0x2d91d9[_0x4db9('0x4a')][_0x4db9('0x3f')]);return db[_0x4db9('0x4f')][_0x4db9('0x49')](_0x2d91d9['body'],{'include':[{'model':db[_0x4db9('0x54')],'as':'Subjects'},{'model':db[_0x4db9('0x54')],'as':_0x4db9('0x55')}]});}return null;})[_0x4db9('0x25')](respondWithResult(_0x3e833d,null))[_0x4db9('0x46')](handleError(_0x3e833d,null));};exports[_0x4db9('0x56')]=function(_0x543d35,_0x524d82,_0x3901b5){var _0xd8a34='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x543d35[_0x4db9('0x4b')]['id']},'attributes':['id','username',_0x4db9('0x57'),'token',_0x4db9('0x58'),_0x4db9('0x59')]})['then'](handleEntityNotFound(_0x524d82,null))['then'](function(_0x3de95c){if(_0x3de95c){_0xd8a34=_0x3de95c[_0x4db9('0x59')];var _0x294111=_0xd8a34[_0x4db9('0x5a')](-0x1);if(_0x294111==='/'){_0xd8a34=_0xd8a34[_0x4db9('0x5b')](0x0,_0xd8a34['lastIndexOf'](_0x294111));}var _0x593497={'method':'GET','uri':util['format'](_0x4db9('0x5c'),_0xd8a34,_0x4db9('0x5d')),'json':!![]};switch(_0x3de95c[_0x4db9('0x58')]){case _0x4db9('0x57'):_0x593497['headers']={'Authorization':util[_0x4db9('0x5e')]('Basic\x20%s',new Buffer(util[_0x4db9('0x5e')](_0x4db9('0x5f'),_0x3de95c[_0x4db9('0x60')],_0x3de95c[_0x4db9('0x57')]))[_0x4db9('0x61')](_0x4db9('0x62')))};break;case _0x4db9('0x63'):_0x593497['headers']={'Authorization':util[_0x4db9('0x5e')](_0x4db9('0x64'),new Buffer(util[_0x4db9('0x5e')]('%s/token:%s',_0x3de95c[_0x4db9('0x60')],_0x3de95c[_0x4db9('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x4db9('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x593497);}})[_0x4db9('0x25')](function(_0x30ba05){if(_0x30ba05){var _0x190e38=['subject','description','group','assignee'];_['remove'](_0x30ba05[_0x4db9('0x5d')],function(_0x3f4cb6){return _0x190e38[_0x4db9('0x66')](_0x3f4cb6[_0x4db9('0x3f')]);});return{'count':_0x30ba05[_0x4db9('0x5d')][_0x4db9('0x36')],'rows':_[_0x4db9('0x2b')](_0x30ba05[_0x4db9('0x5d')],function(_0x4c5be0){return{'id':_0x4c5be0['id'],'name':_0x4c5be0[_0x4db9('0x67')]>0x7?_0x4c5be0[_0x4db9('0x68')]:_0x4c5be0[_0x4db9('0x3f')],'custom':_0x4c5be0[_0x4db9('0x67')]>0x7?!![]:![],'options':_0x4c5be0[_0x4db9('0x69')]?_0x4c5be0[_0x4db9('0x69')]:_0x4c5be0[_0x4db9('0x6a')]?_0x4c5be0[_0x4db9('0x6a')]:[]};})};}})['then'](respondWithResult(_0x524d82,null))[_0x4db9('0x46')](function(_0x4a7e8b){var _0x17bbcb=_0x543d35[_0x4db9('0x31')][_0x4db9('0x6b')]?0x1f4:_0x4a7e8b[_0x4db9('0x6c')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4db9('0x56'),_0x17bbcb,JSON['stringify'](_0x4a7e8b));delete _0x4a7e8b[_0x4db9('0x28')];if(_0x17bbcb===0x191){_0x17bbcb=0x190;}_0x524d82[_0x4db9('0x1e')](_0x17bbcb)[_0x4db9('0x29')](_0x543d35[_0x4db9('0x31')][_0x4db9('0x6b')]?{'message':_0x4db9('0x6d'),'statusCode':_0x4a7e8b[_0x4db9('0x6c')]}:_0x4a7e8b);});}; \ No newline at end of file +var _0x7334=['params','keys','rawAttributes','includeAll','options','find','create','body','destroy','ZendeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','findOne','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','toString','base64','ValidationError','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','index','map','fieldName','model','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','ZendeskAccount','include','findAll','rows','catch','show'];(function(_0x2d393f,_0x4b84d9){var _0x4fd9ef=function(_0x12f76e){while(--_0x12f76e){_0x2d393f['push'](_0x2d393f['shift']());}};_0x4fd9ef(++_0x4b84d9);}(_0x7334,0x184));var _0x4733=function(_0x240abf,_0x22fb79){_0x240abf=_0x240abf-0x0;var _0xd2b890=_0x7334[_0x240abf];return _0xd2b890;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];var integrations=require(_0x4733('0x1a'));function respondWithStatusCode(_0x100ecd,_0x1c146c){_0x1c146c=_0x1c146c||0xcc;return function(_0x2c0f6b){if(_0x2c0f6b){return _0x100ecd['sendStatus'](_0x1c146c);}return _0x100ecd[_0x4733('0x1b')](_0x1c146c)['end']();};}function respondWithResult(_0x4327f3,_0x1a22e4){_0x1a22e4=_0x1a22e4||0xc8;return function(_0x2e5b1b){if(_0x2e5b1b){return _0x4327f3[_0x4733('0x1b')](_0x1a22e4)[_0x4733('0x1c')](_0x2e5b1b);}};}function respondWithFilteredResult(_0x167016,_0x12f111){return function(_0x9fff){if(_0x9fff){var _0x1920ce=typeof _0x12f111['offset']===_0x4733('0x1d')&&typeof _0x12f111[_0x4733('0x1e')]==='undefined';var _0x444824=_0x9fff[_0x4733('0x1f')];var _0x2aa223=_0x1920ce?0x0:_0x12f111[_0x4733('0x20')];var _0x579f67=_0x1920ce?_0x9fff['count']:_0x12f111[_0x4733('0x20')]+_0x12f111[_0x4733('0x1e')];var _0x50c585;if(_0x579f67>=_0x444824){_0x579f67=_0x444824;_0x50c585=0xc8;}else{_0x50c585=0xce;}_0x167016[_0x4733('0x1b')](_0x50c585);return _0x167016[_0x4733('0x21')](_0x4733('0x22'),_0x2aa223+'-'+_0x579f67+'/'+_0x444824)[_0x4733('0x1c')](_0x9fff);}return null;};}function patchUpdates(_0x493cd3){return function(_0x1232e5){try{jsonpatch[_0x4733('0x23')](_0x1232e5,_0x493cd3,!![]);}catch(_0x5d058d){return BPromise[_0x4733('0x24')](_0x5d058d);}return _0x1232e5[_0x4733('0x25')]();};}function saveUpdates(_0x478e34,_0x15a291){return function(_0x115ce4){if(_0x115ce4){return _0x115ce4[_0x4733('0x26')](_0x478e34)[_0x4733('0x27')](function(_0x3a2542){return _0x3a2542;});}return null;};}function removeEntity(_0x24db74,_0x180049){return function(_0x2bb78f){if(_0x2bb78f){return _0x2bb78f['destroy']()[_0x4733('0x27')](function(){_0x24db74[_0x4733('0x1b')](0xcc)[_0x4733('0x28')]();});}};}function handleEntityNotFound(_0x2cb247,_0x30ee9b){return function(_0x3bd683){if(!_0x3bd683){_0x2cb247[_0x4733('0x29')](0x194);}return _0x3bd683;};}function handleError(_0xc3ab0a,_0x13bc12){_0x13bc12=_0x13bc12||0x1f4;return function(_0x23fe6c){logger['error'](_0x23fe6c[_0x4733('0x2a')]);if(_0x23fe6c['name']){delete _0x23fe6c['name'];}_0xc3ab0a[_0x4733('0x1b')](_0x13bc12)['send'](_0x23fe6c);};}exports[_0x4733('0x2b')]=function(_0x479989,_0x4abc0d){var _0x517c73={},_0x2976b0={},_0x3bfe53={'count':0x0,'rows':[]};var _0x29621e=_[_0x4733('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x50f67e){return{'name':_0x50f67e[_0x4733('0x2d')],'type':_0x50f67e['type']['key']};});_0x2976b0[_0x4733('0x2e')]=_[_0x4733('0x2c')](_0x29621e,_0x4733('0x2f'));_0x2976b0['query']=_['keys'](_0x479989[_0x4733('0x30')]);_0x2976b0[_0x4733('0x31')]=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],_0x2976b0[_0x4733('0x30')]);_0x517c73['attributes']=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x479989[_0x4733('0x30')][_0x4733('0x33')]));_0x517c73['attributes']=_0x517c73['attributes'][_0x4733('0x34')]?_0x517c73[_0x4733('0x35')]:_0x2976b0[_0x4733('0x2e')];if(!_0x479989[_0x4733('0x30')][_0x4733('0x36')]('nolimit')){_0x517c73[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x479989[_0x4733('0x30')]['limit']);_0x517c73[_0x4733('0x20')]=qs[_0x4733('0x20')](_0x479989[_0x4733('0x30')][_0x4733('0x20')]);}_0x517c73[_0x4733('0x37')]=qs[_0x4733('0x38')](_0x479989[_0x4733('0x30')][_0x4733('0x38')]);_0x517c73['where']=qs[_0x4733('0x31')](_['pick'](_0x479989[_0x4733('0x30')],_0x2976b0[_0x4733('0x31')]),_0x29621e);if(_0x479989[_0x4733('0x30')][_0x4733('0x39')]){_0x517c73[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x517c73[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x29621e,function(_0x592fc2){if(_0x592fc2[_0x4733('0x3c')]!==_0x4733('0x3d')){var _0x5e12c3={};_0x5e12c3[_0x592fc2[_0x4733('0x2f')]]={'$like':'%'+_0x479989[_0x4733('0x30')]['filter']+'%'};return _0x5e12c3;}})});}_0x517c73=_[_0x4733('0x3b')]({},_0x517c73,_0x479989['options']);var _0x43ac2d={'where':_0x517c73['where']};return db[_0x4733('0x3e')][_0x4733('0x1f')](_0x43ac2d)['then'](function(_0x515720){_0x3bfe53[_0x4733('0x1f')]=_0x515720;if(_0x479989[_0x4733('0x30')]['includeAll']){_0x517c73[_0x4733('0x3f')]=[{'all':!![]}];}return db[_0x4733('0x3e')][_0x4733('0x40')](_0x517c73);})[_0x4733('0x27')](function(_0x3ae58c){_0x3bfe53[_0x4733('0x41')]=_0x3ae58c;return _0x3bfe53;})[_0x4733('0x27')](respondWithFilteredResult(_0x4abc0d,_0x517c73))[_0x4733('0x42')](handleError(_0x4abc0d,null));};exports[_0x4733('0x43')]=function(_0x42e055,_0x444471){var _0x1d32df={'raw':![],'where':{'id':_0x42e055[_0x4733('0x44')]['id']}},_0x191c04={};_0x191c04[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x3e')][_0x4733('0x46')]);_0x191c04['query']=_[_0x4733('0x45')](_0x42e055[_0x4733('0x30')]);_0x191c04[_0x4733('0x31')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],_0x191c04[_0x4733('0x30')]);_0x1d32df[_0x4733('0x35')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x42e055[_0x4733('0x30')][_0x4733('0x33')]));_0x1d32df[_0x4733('0x35')]=_0x1d32df[_0x4733('0x35')]['length']?_0x1d32df['attributes']:_0x191c04[_0x4733('0x2e')];if(_0x42e055[_0x4733('0x30')][_0x4733('0x47')]){_0x1d32df[_0x4733('0x3f')]=[{'all':!![]}];}_0x1d32df=_[_0x4733('0x3b')]({},_0x1d32df,_0x42e055[_0x4733('0x48')]);return db[_0x4733('0x3e')][_0x4733('0x49')](_0x1d32df)[_0x4733('0x27')](handleEntityNotFound(_0x444471,null))[_0x4733('0x27')](respondWithResult(_0x444471,null))['catch'](handleError(_0x444471,null));};exports['create']=function(_0x51e201,_0x521ad3){return db[_0x4733('0x3e')][_0x4733('0x4a')](_0x51e201[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x521ad3,0xc9))[_0x4733('0x42')](handleError(_0x521ad3,null));};exports[_0x4733('0x26')]=function(_0x1c6abf,_0x2484f4){if(_0x1c6abf[_0x4733('0x4b')]['id']){delete _0x1c6abf[_0x4733('0x4b')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x1c6abf[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0x2484f4,null))[_0x4733('0x27')](saveUpdates(_0x1c6abf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x2484f4,null))['catch'](handleError(_0x2484f4,null));};exports[_0x4733('0x4c')]=function(_0x45c9ad,_0x31ae69){return db[_0x4733('0x3e')][_0x4733('0x49')]({'where':{'id':_0x45c9ad[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x31ae69,null))[_0x4733('0x27')](removeEntity(_0x31ae69,null))[_0x4733('0x42')](handleError(_0x31ae69,null));};exports['getConfigurations']=function(_0x31fb69,_0xdb1561,_0x899344){var _0x491fa5={};var _0x2effd2={};var _0x130aee;var _0xafb3f8;return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x31fb69[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0xdb1561,null))[_0x4733('0x27')](function(_0x3b8165){if(_0x3b8165){_0x130aee=_0x3b8165;_0x2effd2[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x4d')]['rawAttributes']);_0x2effd2[_0x4733('0x30')]=_[_0x4733('0x45')](_0x31fb69['query']);_0x2effd2['filters']=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],_0x2effd2[_0x4733('0x30')]);_0x491fa5[_0x4733('0x35')]=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x31fb69[_0x4733('0x30')]['fields']));_0x491fa5['attributes']=_0x491fa5[_0x4733('0x35')]['length']?_0x491fa5[_0x4733('0x35')]:_0x2effd2[_0x4733('0x2e')];_0x491fa5[_0x4733('0x37')]=qs['sort'](_0x31fb69['query']['sort']);_0x491fa5[_0x4733('0x3a')]=qs[_0x4733('0x31')](_[_0x4733('0x4e')](_0x31fb69['query'],_0x2effd2[_0x4733('0x31')]));if(_0x31fb69[_0x4733('0x30')][_0x4733('0x39')]){_0x491fa5[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x491fa5[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x491fa5['attributes'],function(_0x1ed9eb){var _0x2b5eec={};_0x2b5eec[_0x1ed9eb]={'$like':'%'+_0x31fb69['query']['filter']+'%'};return _0x2b5eec;})});}_0x491fa5=_[_0x4733('0x3b')]({},_0x491fa5,_0x31fb69[_0x4733('0x48')]);return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x475dad){if(_0x475dad){_0xafb3f8=_0x475dad[_0x4733('0x34')];if(!_0x31fb69[_0x4733('0x30')][_0x4733('0x36')](_0x4733('0x50'))){_0x491fa5['limit']=qs[_0x4733('0x1e')](_0x31fb69[_0x4733('0x30')][_0x4733('0x1e')]);_0x491fa5['offset']=qs[_0x4733('0x20')](_0x31fb69['query'][_0x4733('0x20')]);}return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x3696d6){if(_0x3696d6){return _0x3696d6?{'count':_0xafb3f8,'rows':_0x3696d6}:null;}})[_0x4733('0x27')](respondWithResult(_0xdb1561,null))[_0x4733('0x42')](handleError(_0xdb1561,null));};exports['addConfiguration']=function(_0x137793,_0x574787,_0x15552d){if(_0x137793[_0x4733('0x4b')]['id']){delete _0x137793['body']['id'];}return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x137793['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x574787,null))[_0x4733('0x27')](function(_0x1a0ebf){if(_0x1a0ebf){_0x137793[_0x4733('0x4b')][_0x4733('0x51')]=_0x1a0ebf['id'];_0x137793[_0x4733('0x4b')][_0x4733('0x52')]=integrations[_0x4733('0x53')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793['body']['type']);_0x137793[_0x4733('0x4b')][_0x4733('0x54')]=integrations[_0x4733('0x55')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793[_0x4733('0x4b')][_0x4733('0x3c')]);return db[_0x4733('0x4d')]['create'](_0x137793[_0x4733('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x4733('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4733('0x27')](respondWithResult(_0x574787,null))['catch'](handleError(_0x574787,null));};exports[_0x4733('0x56')]=function(_0x523498,_0x4e835b,_0x1a7baf){var _0x5c6083='';return db['ZendeskAccount'][_0x4733('0x57')]({'where':{'id':_0x523498[_0x4733('0x44')]['id']},'attributes':['id',_0x4733('0x58'),'password',_0x4733('0x59'),_0x4733('0x5a'),_0x4733('0x5b')]})[_0x4733('0x27')](handleEntityNotFound(_0x4e835b,null))[_0x4733('0x27')](function(_0x29f4e8){if(_0x29f4e8){_0x5c6083=_0x29f4e8['remoteUri'];var _0x3c9e3b=_0x5c6083[_0x4733('0x5c')](-0x1);if(_0x3c9e3b==='/'){_0x5c6083=_0x5c6083[_0x4733('0x5d')](0x0,_0x5c6083['lastIndexOf'](_0x3c9e3b));}var _0x2c0377={'method':_0x4733('0x5e'),'uri':util[_0x4733('0x5f')](_0x4733('0x60'),_0x5c6083,_0x4733('0x61')),'json':!![]};switch(_0x29f4e8[_0x4733('0x5a')]){case _0x4733('0x62'):_0x2c0377[_0x4733('0x63')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x62')]))[_0x4733('0x64')](_0x4733('0x65')))};break;case _0x4733('0x59'):_0x2c0377['headers']={'Authorization':util[_0x4733('0x5f')]('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s/token:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x59')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x4733('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x2c0377);}})[_0x4733('0x27')](function(_0x2fe1d3){if(_0x2fe1d3){var _0x59cc5b=[_0x4733('0x67'),'description','group',_0x4733('0x68')];_[_0x4733('0x69')](_0x2fe1d3[_0x4733('0x61')],function(_0x5a067b){return _0x59cc5b['includes'](_0x5a067b[_0x4733('0x3c')]);});return{'count':_0x2fe1d3['ticket_fields'][_0x4733('0x34')],'rows':_[_0x4733('0x2c')](_0x2fe1d3[_0x4733('0x61')],function(_0x42657b){return{'id':_0x42657b['id'],'name':_0x42657b[_0x4733('0x6a')]>0x7?_0x42657b[_0x4733('0x6b')]:_0x42657b['type'],'custom':_0x42657b[_0x4733('0x6a')]>0x7?!![]:![],'options':_0x42657b[_0x4733('0x6c')]?_0x42657b[_0x4733('0x6c')]:_0x42657b[_0x4733('0x6d')]?_0x42657b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x4e835b,null))[_0x4733('0x42')](function(_0x4d87c1){var _0x131595=_0x523498[_0x4733('0x30')][_0x4733('0x6e')]?0x1f4:_0x4d87c1[_0x4733('0x6f')]||0x1f4;logger[_0x4733('0x70')](_0x4733('0x71'),_0x4733('0x56'),_0x131595,JSON['stringify'](_0x4d87c1));delete _0x4d87c1[_0x4733('0x2f')];if(_0x131595===0x191){_0x131595=0x190;}_0x4e835b[_0x4733('0x1b')](_0x131595)['send'](_0x523498['query'][_0x4733('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d87c1[_0x4733('0x6f')]}:_0x4d87c1);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 079548b..e3aeea3 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 _0x1cbe=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','ZendeskAccount'];(function(_0x39867f,_0x7336c1){var _0x3f1542=function(_0x37f502){while(--_0x37f502){_0x39867f['push'](_0x39867f['shift']());}};_0x3f1542(++_0x7336c1);}(_0x1cbe,0x109));var _0xe1cb=function(_0x22ecfe,_0x195b50){_0x22ecfe=_0x22ecfe-0x0;var _0x196366=_0x1cbe[_0x22ecfe];return _0x196366;};'use strict';var _=require(_0xe1cb('0x0'));var util=require(_0xe1cb('0x1'));var logger=require(_0xe1cb('0x2'))(_0xe1cb('0x3'));var moment=require(_0xe1cb('0x4'));var BPromise=require(_0xe1cb('0x5'));var rp=require(_0xe1cb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1cb('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe1cb('0x8')]=function(_0x560deb,_0x190b0f){return _0x560deb['define'](_0xe1cb('0x9'),attributes,{'tableName':_0xe1cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b0b=['define','ZendeskAccount','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x4cdecc,_0x321d1a){var _0x3948a9=function(_0x2a247d){while(--_0x2a247d){_0x4cdecc['push'](_0x4cdecc['shift']());}};_0x3948a9(++_0x321d1a);}(_0x9b0b,0xff));var _0xb9b0=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x9b0b[_0x53c256];return _0x25feb6;};'use strict';var _=require('lodash');var util=require(_0xb9b0('0x0'));var logger=require(_0xb9b0('0x1'))(_0xb9b0('0x2'));var moment=require('moment');var BPromise=require(_0xb9b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9b0('0x4'));var rimraf=require(_0xb9b0('0x5'));var config=require(_0xb9b0('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xb9b0('0x7'));module[_0xb9b0('0x8')]=function(_0x1c5ecb,_0x195206){return _0x1c5ecb[_0xb9b0('0x9')](_0xb9b0('0xa'),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 8f20655..5961335 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 _0xe826=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','stringify','ShowZendeskAccount','find','map','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe826,0x14e));var _0x6e82=function(_0x34532b,_0x5a61e){_0x34532b=_0x34532b-0x0;var _0x560ef4=_0xe826[_0x34532b];return _0x560ef4;};'use strict';var _=require(_0x6e82('0x0'));var util=require(_0x6e82('0x1'));var moment=require(_0x6e82('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e82('0x3'));var fs=require('fs');var Redis=require(_0x6e82('0x4'));var db=require(_0x6e82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e82('0x6'))(_0x6e82('0x7'));var config=require(_0x6e82('0x8'));var jayson=require(_0x6e82('0x9'));var client=jayson[_0x6e82('0xa')][_0x6e82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14df8f,_0x30d952,_0x41e9b0){return new BPromise(function(_0x3ebce2,_0x18c7d2){return client['request'](_0x14df8f,_0x41e9b0)[_0x6e82('0xc')](function(_0x1fc4d2){logger[_0x6e82('0xd')](_0x6e82('0xe'),_0x30d952,_0x6e82('0xf'));logger[_0x6e82('0x10')](_0x6e82('0x11'),_0x30d952,_0x6e82('0xf'),JSON['stringify'](_0x1fc4d2));if(_0x1fc4d2[_0x6e82('0x12')]){if(_0x1fc4d2[_0x6e82('0x12')]['code']===0x1f4){logger[_0x6e82('0x12')](_0x6e82('0xe'),_0x30d952,_0x1fc4d2[_0x6e82('0x12')]['message']);return _0x18c7d2(_0x1fc4d2[_0x6e82('0x12')][_0x6e82('0x13')]);}logger[_0x6e82('0x12')](_0x6e82('0xe'),_0x30d952,_0x1fc4d2['error'][_0x6e82('0x13')]);return _0x3ebce2(_0x1fc4d2['error'][_0x6e82('0x13')]);}else{logger['info'](_0x6e82('0xe'),_0x30d952,_0x6e82('0xf'));_0x3ebce2(_0x1fc4d2[_0x6e82('0x14')]['message']);}})['catch'](function(_0x4c1f9a){logger[_0x6e82('0x12')](_0x6e82('0xe'),_0x30d952,_0x4c1f9a);_0x18c7d2(_0x4c1f9a);});});}exports[_0x6e82('0x15')]=function(_0x5b468a){var _0x2f4a48=this;return new Promise(function(_0x46217c,_0x4496fe){return db['ZendeskAccount'][_0x6e82('0x16')]({'raw':_0x5b468a[_0x6e82('0x17')]?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x18')]===undefined?!![]:![]:!![],'where':_0x5b468a[_0x6e82('0x17')]?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x19')]||null:null,'attributes':_0x5b468a[_0x6e82('0x17')]?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x1a')]||null:null,'limit':_0x5b468a['options']?_0x5b468a['options'][_0x6e82('0x1b')]||null:null,'include':_0x5b468a['options']?_0x5b468a[_0x6e82('0x17')][_0x6e82('0x1c')]?_['map'](_0x5b468a[_0x6e82('0x17')]['include'],function(_0x350d2f){return{'model':db[_0x350d2f[_0x6e82('0x1d')]],'as':_0x350d2f['as'],'attributes':_0x350d2f[_0x6e82('0x1a')],'include':_0x350d2f[_0x6e82('0x1c')]?_['map'](_0x350d2f[_0x6e82('0x1c')],function(_0x18d693){return{'model':db[_0x18d693['model']],'as':_0x18d693['as'],'attributes':_0x18d693['attributes'],'include':_0x18d693[_0x6e82('0x1c')]?_['map'](_0x18d693[_0x6e82('0x1c')],function(_0x44af19){return{'model':db[_0x44af19[_0x6e82('0x1d')]],'as':_0x44af19['as'],'attributes':_0x44af19['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e82('0xc')](function(_0x33609f){logger[_0x6e82('0xd')](_0x6e82('0x15'),_0x5b468a);logger[_0x6e82('0x10')](_0x6e82('0x15'),_0x5b468a,JSON[_0x6e82('0x1e')](_0x33609f));_0x46217c(_0x33609f);})['catch'](function(_0x2928fa){logger['error'](_0x6e82('0x15'),_0x2928fa[_0x6e82('0x13')],_0x5b468a);_0x4496fe(_0x2f4a48[_0x6e82('0x12')](0x1f4,_0x2928fa['message']));});});};exports[_0x6e82('0x1f')]=function(_0x1aaecb){var _0xa8d8de=this;return new Promise(function(_0x2940c5,_0x5bef14){return db['ZendeskAccount'][_0x6e82('0x20')]({'raw':_0x1aaecb[_0x6e82('0x17')]?_0x1aaecb['options']['raw']===undefined?!![]:![]:!![],'where':_0x1aaecb[_0x6e82('0x17')]?_0x1aaecb[_0x6e82('0x17')][_0x6e82('0x19')]||null:null,'attributes':_0x1aaecb[_0x6e82('0x17')]?_0x1aaecb[_0x6e82('0x17')][_0x6e82('0x1a')]||null:null,'include':_0x1aaecb['options']?_0x1aaecb[_0x6e82('0x17')][_0x6e82('0x1c')]?_['map'](_0x1aaecb[_0x6e82('0x17')]['include'],function(_0x282a34){return{'model':db[_0x282a34[_0x6e82('0x1d')]],'as':_0x282a34['as'],'attributes':_0x282a34['attributes'],'include':_0x282a34[_0x6e82('0x1c')]?_['map'](_0x282a34['include'],function(_0x378dad){return{'model':db[_0x378dad[_0x6e82('0x1d')]],'as':_0x378dad['as'],'attributes':_0x378dad['attributes'],'include':_0x378dad[_0x6e82('0x1c')]?_[_0x6e82('0x21')](_0x378dad[_0x6e82('0x1c')],function(_0x31095a){return{'model':db[_0x31095a[_0x6e82('0x1d')]],'as':_0x31095a['as'],'attributes':_0x31095a[_0x6e82('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6e82('0xc')](function(_0x4b68ba){logger[_0x6e82('0xd')](_0x6e82('0x1f'),_0x1aaecb);logger[_0x6e82('0x10')](_0x6e82('0x1f'),_0x1aaecb,JSON['stringify'](_0x4b68ba));_0x2940c5(_0x4b68ba);})[_0x6e82('0x22')](function(_0x4321dd){logger[_0x6e82('0x12')](_0x6e82('0x1f'),_0x4321dd[_0x6e82('0x13')],_0x1aaecb);_0x5bef14(_0xa8d8de[_0x6e82('0x12')](0x1f4,_0x4321dd[_0x6e82('0x13')]));});});}; \ No newline at end of file +var _0x5844=['request','info','ZendeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','ZendeskAccount','findAll','options','raw','include','map','attributes','model','then','GetZendeskAccount','ShowZendeskAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3732a2,_0x2d068c){var _0x42b217=function(_0xad58f0){while(--_0xad58f0){_0x3732a2['push'](_0x3732a2['shift']());}};_0x42b217(++_0x2d068c);}(_0x5844,0x10d));var _0x4584=function(_0x5ba676,_0x2b7e1e){_0x5ba676=_0x5ba676-0x0;var _0x107aba=_0x5844[_0x5ba676];return _0x107aba;};'use strict';var _=require(_0x4584('0x0'));var util=require(_0x4584('0x1'));var moment=require(_0x4584('0x2'));var BPromise=require(_0x4584('0x3'));var rs=require(_0x4584('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4584('0x5'))['db'];var utils=require(_0x4584('0x6'));var logger=require(_0x4584('0x7'))(_0x4584('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4584('0x9')][_0x4584('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x63747f,_0xee6aeb,_0x3ee4c8){return new BPromise(function(_0xdcbc2d,_0x24b6e7){return client[_0x4584('0xb')](_0x63747f,_0x3ee4c8)['then'](function(_0x244815){logger[_0x4584('0xc')](_0x4584('0xd'),_0xee6aeb,'request\x20sent');logger[_0x4584('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xee6aeb,'request\x20sent',JSON[_0x4584('0xf')](_0x244815));if(_0x244815[_0x4584('0x10')]){if(_0x244815['error'][_0x4584('0x11')]===0x1f4){logger[_0x4584('0x10')](_0x4584('0xd'),_0xee6aeb,_0x244815[_0x4584('0x10')][_0x4584('0x12')]);return _0x24b6e7(_0x244815[_0x4584('0x10')][_0x4584('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0xee6aeb,_0x244815[_0x4584('0x10')][_0x4584('0x12')]);return _0xdcbc2d(_0x244815[_0x4584('0x10')][_0x4584('0x12')]);}else{logger[_0x4584('0xc')](_0x4584('0xd'),_0xee6aeb,_0x4584('0x13'));_0xdcbc2d(_0x244815[_0x4584('0x14')][_0x4584('0x12')]);}})[_0x4584('0x15')](function(_0x425bc0){logger[_0x4584('0x10')](_0x4584('0xd'),_0xee6aeb,_0x425bc0);_0x24b6e7(_0x425bc0);});});}exports['GetZendeskAccount']=function(_0xb282d3){var _0x31e4e0=this;return new Promise(function(_0x1efa10,_0x3c4050){return db[_0x4584('0x16')][_0x4584('0x17')]({'raw':_0xb282d3[_0x4584('0x18')]?_0xb282d3[_0x4584('0x18')][_0x4584('0x19')]===undefined?!![]:![]:!![],'where':_0xb282d3['options']?_0xb282d3['options']['where']||null:null,'attributes':_0xb282d3[_0x4584('0x18')]?_0xb282d3['options']['attributes']||null:null,'limit':_0xb282d3[_0x4584('0x18')]?_0xb282d3[_0x4584('0x18')]['limit']||null:null,'include':_0xb282d3[_0x4584('0x18')]?_0xb282d3[_0x4584('0x18')][_0x4584('0x1a')]?_[_0x4584('0x1b')](_0xb282d3[_0x4584('0x18')][_0x4584('0x1a')],function(_0xf90617){return{'model':db[_0xf90617['model']],'as':_0xf90617['as'],'attributes':_0xf90617[_0x4584('0x1c')],'include':_0xf90617[_0x4584('0x1a')]?_[_0x4584('0x1b')](_0xf90617[_0x4584('0x1a')],function(_0x207186){return{'model':db[_0x207186['model']],'as':_0x207186['as'],'attributes':_0x207186[_0x4584('0x1c')],'include':_0x207186[_0x4584('0x1a')]?_[_0x4584('0x1b')](_0x207186[_0x4584('0x1a')],function(_0x28c4dc){return{'model':db[_0x28c4dc[_0x4584('0x1d')]],'as':_0x28c4dc['as'],'attributes':_0x28c4dc[_0x4584('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4584('0x1e')](function(_0x55ef56){logger[_0x4584('0xc')](_0x4584('0x1f'),_0xb282d3);logger[_0x4584('0xe')]('GetZendeskAccount',_0xb282d3,JSON[_0x4584('0xf')](_0x55ef56));_0x1efa10(_0x55ef56);})[_0x4584('0x15')](function(_0x2d866d){logger[_0x4584('0x10')](_0x4584('0x1f'),_0x2d866d[_0x4584('0x12')],_0xb282d3);_0x3c4050(_0x31e4e0[_0x4584('0x10')](0x1f4,_0x2d866d[_0x4584('0x12')]));});});};exports[_0x4584('0x20')]=function(_0x2b6d1e){var _0x317c05=this;return new Promise(function(_0x36a03e,_0x3da509){return db[_0x4584('0x16')][_0x4584('0x21')]({'raw':_0x2b6d1e[_0x4584('0x18')]?_0x2b6d1e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b6d1e['options']?_0x2b6d1e[_0x4584('0x18')][_0x4584('0x22')]||null:null,'attributes':_0x2b6d1e[_0x4584('0x18')]?_0x2b6d1e[_0x4584('0x18')]['attributes']||null:null,'include':_0x2b6d1e['options']?_0x2b6d1e['options']['include']?_[_0x4584('0x1b')](_0x2b6d1e[_0x4584('0x18')][_0x4584('0x1a')],function(_0x1230c7){return{'model':db[_0x1230c7[_0x4584('0x1d')]],'as':_0x1230c7['as'],'attributes':_0x1230c7['attributes'],'include':_0x1230c7[_0x4584('0x1a')]?_[_0x4584('0x1b')](_0x1230c7[_0x4584('0x1a')],function(_0xbf4d02){return{'model':db[_0xbf4d02[_0x4584('0x1d')]],'as':_0xbf4d02['as'],'attributes':_0xbf4d02[_0x4584('0x1c')],'include':_0xbf4d02[_0x4584('0x1a')]?_[_0x4584('0x1b')](_0xbf4d02[_0x4584('0x1a')],function(_0x12c6cf){return{'model':db[_0x12c6cf[_0x4584('0x1d')]],'as':_0x12c6cf['as'],'attributes':_0x12c6cf[_0x4584('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4584('0x1e')](function(_0x39fa49){logger[_0x4584('0xc')](_0x4584('0x20'),_0x2b6d1e);logger['debug']('ShowZendeskAccount',_0x2b6d1e,JSON[_0x4584('0xf')](_0x39fa49));_0x36a03e(_0x39fa49);})[_0x4584('0x15')](function(_0xf83af1){logger['error']('ShowZendeskAccount',_0xf83af1['message'],_0x2b6d1e);_0x3da509(_0x317c05[_0x4584('0x10')](0x1f4,_0xf83af1['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 092ecb6..87660e4 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 _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0x4483,0x1a3));var _0x3448=function(_0x49c3f0,_0x4bb280){_0x49c3f0=_0x49c3f0-0x0;var _0x25689e=_0x4483[_0x49c3f0];return _0x25689e;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x23b946,_0x2653e1){_0x23b946=_0x23b946-0x0;var _0xcfad4f=_0xbdb7[_0x23b946];return _0xcfad4f;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 71e95aa..4015a71 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 _0xbf23=['exports','STRING','sequelize'];(function(_0x25a9b7,_0x2e0a9a){var _0x451897=function(_0x56c3d4){while(--_0x56c3d4){_0x25a9b7['push'](_0x25a9b7['shift']());}};_0x451897(++_0x2e0a9a);}(_0xbf23,0x18e));var _0x3bf2=function(_0x1722bf,_0x2fa7f4){_0x1722bf=_0x1722bf-0x0;var _0x58c607=_0xbf23[_0x1722bf];return _0x58c607;};'use strict';var Sequelize=require(_0x3bf2('0x0'));module[_0x3bf2('0x1')]={'name':{'type':Sequelize[_0x3bf2('0x2')]},'description':{'type':Sequelize[_0x3bf2('0x2')]}}; \ No newline at end of file +var _0x9733=['sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9733,0xfc));var _0x3973=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9733[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3973('0x0'));module[_0x3973('0x1')]={'name':{'type':Sequelize[_0x3973('0x2')]},'description':{'type':Sequelize[_0x3973('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e81f0ff..d9daeea 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 _0x6083=['fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','create','body','find','getFields','pick','getSubjects','findOne','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','ZendeskConfiguration','rawAttributes'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x6083,0x1b5));var _0x3608=function(_0x50244b,_0x1421dd){_0x50244b=_0x50244b-0x0;var _0x426eba=_0x6083[_0x50244b];return _0x426eba;};'use strict';var emlformat=require(_0x3608('0x0'));var rimraf=require(_0x3608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3608('0x2'));var moment=require(_0x3608('0x3'));var BPromise=require(_0x3608('0x4'));var Mustache=require(_0x3608('0x5'));var util=require(_0x3608('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3608('0x7'));var ejs=require(_0x3608('0x8'));var fs=require('fs');var fs_extra=require(_0x3608('0x9'));var _=require(_0x3608('0xa'));var squel=require(_0x3608('0xb'));var crypto=require('crypto');var jsforce=require(_0x3608('0xc'));var deskjs=require(_0x3608('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3608('0xe'));var Papa=require(_0x3608('0xf'));var Redis=require('ioredis');var authService=require(_0x3608('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3608('0x11'));var hardwareService=require(_0x3608('0x12'));var logger=require(_0x3608('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3608('0x14'));var licenseUtil=require(_0x3608('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e98c4,_0x241170){_0x241170=_0x241170||0xcc;return function(_0x37c863){if(_0x37c863){return _0x4e98c4[_0x3608('0x16')](_0x241170);}return _0x4e98c4[_0x3608('0x17')](_0x241170)[_0x3608('0x18')]();};}function respondWithResult(_0x418add,_0x220226){_0x220226=_0x220226||0xc8;return function(_0xb8cc21){if(_0xb8cc21){return _0x418add['status'](_0x220226)[_0x3608('0x19')](_0xb8cc21);}};}function respondWithFilteredResult(_0x2cc96d,_0x21b737){return function(_0x88d0a2){if(_0x88d0a2){var _0x3967a3=typeof _0x21b737[_0x3608('0x1a')]===_0x3608('0x1b')&&typeof _0x21b737[_0x3608('0x1c')]==='undefined';var _0x345a07=_0x88d0a2[_0x3608('0x1d')];var _0x1cd586=_0x3967a3?0x0:_0x21b737[_0x3608('0x1a')];var _0x233ec4=_0x3967a3?_0x88d0a2['count']:_0x21b737['offset']+_0x21b737[_0x3608('0x1c')];var _0x148f15;if(_0x233ec4>=_0x345a07){_0x233ec4=_0x345a07;_0x148f15=0xc8;}else{_0x148f15=0xce;}_0x2cc96d[_0x3608('0x17')](_0x148f15);return _0x2cc96d[_0x3608('0x1e')](_0x3608('0x1f'),_0x1cd586+'-'+_0x233ec4+'/'+_0x345a07)[_0x3608('0x19')](_0x88d0a2);}return null;};}function patchUpdates(_0x1ee79d){return function(_0x4c4f4f){try{jsonpatch[_0x3608('0x20')](_0x4c4f4f,_0x1ee79d,!![]);}catch(_0xb343a7){return BPromise[_0x3608('0x21')](_0xb343a7);}return _0x4c4f4f[_0x3608('0x22')]();};}function saveUpdates(_0x1edb75,_0x3bce25){return function(_0x23e47b){if(_0x23e47b){return _0x23e47b[_0x3608('0x23')](_0x1edb75)['then'](function(_0x20432f){return _0x20432f;});}return null;};}function removeEntity(_0x2dc53a,_0x3c3de1){return function(_0x23c81e){if(_0x23c81e){return _0x23c81e['destroy']()[_0x3608('0x24')](function(){_0x2dc53a[_0x3608('0x17')](0xcc)[_0x3608('0x18')]();});}};}function handleEntityNotFound(_0x4bbaa5,_0x5aaf69){return function(_0x10237c){if(!_0x10237c){_0x4bbaa5[_0x3608('0x16')](0x194);}return _0x10237c;};}function handleError(_0x3b5baa,_0x19bc7e){_0x19bc7e=_0x19bc7e||0x1f4;return function(_0x9f63dc){logger[_0x3608('0x25')](_0x9f63dc[_0x3608('0x26')]);if(_0x9f63dc[_0x3608('0x27')]){delete _0x9f63dc['name'];}_0x3b5baa[_0x3608('0x17')](_0x19bc7e)['send'](_0x9f63dc);};}exports[_0x3608('0x28')]=function(_0x2394f1,_0x44f4a1){var _0x5899ef={},_0x5733e7={},_0x5b007e={'count':0x0,'rows':[]};var _0x245801=_['map'](db[_0x3608('0x29')][_0x3608('0x2a')],function(_0x53f3f3){return{'name':_0x53f3f3[_0x3608('0x2b')],'type':_0x53f3f3[_0x3608('0x2c')]['key']};});_0x5733e7[_0x3608('0x2d')]=_[_0x3608('0x2e')](_0x245801,_0x3608('0x27'));_0x5733e7[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x2394f1['query']);_0x5733e7[_0x3608('0x31')]=_[_0x3608('0x32')](_0x5733e7[_0x3608('0x2d')],_0x5733e7[_0x3608('0x2f')]);_0x5899ef['attributes']=_[_0x3608('0x32')](_0x5733e7[_0x3608('0x2d')],qs['fields'](_0x2394f1['query'][_0x3608('0x33')]));_0x5899ef['attributes']=_0x5899ef[_0x3608('0x34')][_0x3608('0x35')]?_0x5899ef[_0x3608('0x34')]:_0x5733e7[_0x3608('0x2d')];if(!_0x2394f1[_0x3608('0x2f')][_0x3608('0x36')](_0x3608('0x37'))){_0x5899ef[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x2394f1[_0x3608('0x2f')]['limit']);_0x5899ef[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x2394f1[_0x3608('0x2f')]['offset']);}_0x5899ef[_0x3608('0x38')]=qs[_0x3608('0x39')](_0x2394f1[_0x3608('0x2f')][_0x3608('0x39')]);_0x5899ef[_0x3608('0x3a')]=qs[_0x3608('0x31')](_['pick'](_0x2394f1[_0x3608('0x2f')],_0x5733e7[_0x3608('0x31')]),_0x245801);if(_0x2394f1[_0x3608('0x2f')][_0x3608('0x3b')]){_0x5899ef[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x5899ef[_0x3608('0x3a')],{'$or':_['map'](_0x245801,function(_0x169990){if(_0x169990[_0x3608('0x2c')]!=='VIRTUAL'){var _0x3de4f8={};_0x3de4f8[_0x169990[_0x3608('0x27')]]={'$like':'%'+_0x2394f1[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x3de4f8;}})});}_0x5899ef=_[_0x3608('0x3c')]({},_0x5899ef,_0x2394f1[_0x3608('0x3d')]);var _0x152db4={'where':_0x5899ef['where']};return db[_0x3608('0x29')][_0x3608('0x1d')](_0x152db4)[_0x3608('0x24')](function(_0x106fa5){_0x5b007e[_0x3608('0x1d')]=_0x106fa5;if(_0x2394f1[_0x3608('0x2f')]['includeAll']){_0x5899ef[_0x3608('0x3e')]=[{'all':!![]}];}return db[_0x3608('0x29')][_0x3608('0x3f')](_0x5899ef);})[_0x3608('0x24')](function(_0x2ebcf4){_0x5b007e['rows']=_0x2ebcf4;return _0x5b007e;})[_0x3608('0x24')](respondWithFilteredResult(_0x44f4a1,_0x5899ef))[_0x3608('0x40')](handleError(_0x44f4a1,null));};exports[_0x3608('0x41')]=function(_0x16196a,_0x56ed1d){var _0x4e6e9d={'raw':![],'where':{'id':_0x16196a[_0x3608('0x42')]['id']}},_0x390100={};_0x390100[_0x3608('0x2d')]=_['keys'](db[_0x3608('0x29')]['rawAttributes']);_0x390100[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x16196a[_0x3608('0x2f')]);_0x390100[_0x3608('0x31')]=_[_0x3608('0x32')](_0x390100[_0x3608('0x2d')],_0x390100[_0x3608('0x2f')]);_0x4e6e9d['attributes']=_[_0x3608('0x32')](_0x390100[_0x3608('0x2d')],qs[_0x3608('0x33')](_0x16196a['query'][_0x3608('0x33')]));_0x4e6e9d[_0x3608('0x34')]=_0x4e6e9d[_0x3608('0x34')][_0x3608('0x35')]?_0x4e6e9d[_0x3608('0x34')]:_0x390100['model'];if(_0x16196a[_0x3608('0x2f')]['includeAll']){_0x4e6e9d[_0x3608('0x3e')]=[{'all':!![]}];}_0x4e6e9d=_[_0x3608('0x3c')]({},_0x4e6e9d,_0x16196a[_0x3608('0x3d')]);return db[_0x3608('0x29')]['find'](_0x4e6e9d)[_0x3608('0x24')](handleEntityNotFound(_0x56ed1d,null))[_0x3608('0x24')](respondWithResult(_0x56ed1d,null))[_0x3608('0x40')](handleError(_0x56ed1d,null));};exports[_0x3608('0x43')]=function(_0x5afb3a,_0x42f081){return db[_0x3608('0x29')]['create'](_0x5afb3a[_0x3608('0x44')],{})[_0x3608('0x24')](respondWithResult(_0x42f081,0xc9))[_0x3608('0x40')](handleError(_0x42f081,null));};exports[_0x3608('0x23')]=function(_0x3c6fa7,_0x5deaa7){if(_0x3c6fa7[_0x3608('0x44')]['id']){delete _0x3c6fa7[_0x3608('0x44')]['id'];}return db[_0x3608('0x29')][_0x3608('0x45')]({'where':{'id':_0x3c6fa7[_0x3608('0x42')]['id']}})[_0x3608('0x24')](handleEntityNotFound(_0x5deaa7,null))[_0x3608('0x24')](saveUpdates(_0x3c6fa7[_0x3608('0x44')],null))['then'](respondWithResult(_0x5deaa7,null))[_0x3608('0x40')](handleError(_0x5deaa7,null));};exports['destroy']=function(_0x22c521,_0xc0229d){return db[_0x3608('0x29')][_0x3608('0x45')]({'where':{'id':_0x22c521[_0x3608('0x42')]['id']}})[_0x3608('0x24')](handleEntityNotFound(_0xc0229d,null))[_0x3608('0x24')](removeEntity(_0xc0229d,null))[_0x3608('0x40')](handleError(_0xc0229d,null));};exports[_0x3608('0x46')]=function(_0x3780df,_0x1941b5,_0x38b92f){var _0x938bae={};var _0xe0f03b={};var _0x1cbfa4;var _0x36ef39;return db[_0x3608('0x29')]['findOne']({'where':{'id':_0x3780df[_0x3608('0x42')]['id']}})[_0x3608('0x24')](handleEntityNotFound(_0x1941b5,null))[_0x3608('0x24')](function(_0x2f228a){if(_0x2f228a){_0x1cbfa4=_0x2f228a;_0xe0f03b[_0x3608('0x2d')]=_[_0x3608('0x30')](db['ZendeskField'][_0x3608('0x2a')]);_0xe0f03b[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x3780df[_0x3608('0x2f')]);_0xe0f03b[_0x3608('0x31')]=_['intersection'](_0xe0f03b[_0x3608('0x2d')],_0xe0f03b[_0x3608('0x2f')]);_0x938bae['attributes']=_[_0x3608('0x32')](_0xe0f03b[_0x3608('0x2d')],qs[_0x3608('0x33')](_0x3780df[_0x3608('0x2f')][_0x3608('0x33')]));_0x938bae['attributes']=_0x938bae['attributes'][_0x3608('0x35')]?_0x938bae[_0x3608('0x34')]:_0xe0f03b[_0x3608('0x2d')];_0x938bae['order']=qs[_0x3608('0x39')](_0x3780df[_0x3608('0x2f')][_0x3608('0x39')]);_0x938bae['where']=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x3780df['query'],_0xe0f03b[_0x3608('0x31')]));if(_0x3780df[_0x3608('0x2f')][_0x3608('0x3b')]){_0x938bae[_0x3608('0x3a')]=_['merge'](_0x938bae[_0x3608('0x3a')],{'$or':_[_0x3608('0x2e')](_0x938bae[_0x3608('0x34')],function(_0x4ce4dc){var _0x564440={};_0x564440[_0x4ce4dc]={'$like':'%'+_0x3780df[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x564440;})});}_0x938bae=_['merge']({},_0x938bae,_0x3780df[_0x3608('0x3d')]);return _0x1cbfa4['getFields'](_0x938bae);}})[_0x3608('0x24')](function(_0x1f3305){if(_0x1f3305){_0x36ef39=_0x1f3305[_0x3608('0x35')];if(!_0x3780df[_0x3608('0x2f')]['hasOwnProperty'](_0x3608('0x37'))){_0x938bae[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x3780df[_0x3608('0x2f')]['limit']);_0x938bae[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x3780df[_0x3608('0x2f')][_0x3608('0x1a')]);}return _0x1cbfa4['getFields'](_0x938bae);}})[_0x3608('0x24')](function(_0x2f0b3e){if(_0x2f0b3e){return _0x2f0b3e?{'count':_0x36ef39,'rows':_0x2f0b3e}:null;}})[_0x3608('0x24')](respondWithResult(_0x1941b5,null))[_0x3608('0x40')](handleError(_0x1941b5,null));};exports[_0x3608('0x48')]=function(_0x26159b,_0x9343ec,_0x49b6d8){var _0x429295={};var _0x2f4992={};var _0x5dfac1;var _0x37f4ba;return db[_0x3608('0x29')][_0x3608('0x49')]({'where':{'id':_0x26159b['params']['id']}})['then'](handleEntityNotFound(_0x9343ec,null))[_0x3608('0x24')](function(_0x4b34bd){if(_0x4b34bd){_0x5dfac1=_0x4b34bd;_0x2f4992['model']=_[_0x3608('0x30')](db[_0x3608('0x4a')][_0x3608('0x2a')]);_0x2f4992[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x26159b[_0x3608('0x2f')]);_0x2f4992[_0x3608('0x31')]=_[_0x3608('0x32')](_0x2f4992[_0x3608('0x2d')],_0x2f4992[_0x3608('0x2f')]);_0x429295[_0x3608('0x34')]=_[_0x3608('0x32')](_0x2f4992[_0x3608('0x2d')],qs[_0x3608('0x33')](_0x26159b['query']['fields']));_0x429295[_0x3608('0x34')]=_0x429295[_0x3608('0x34')][_0x3608('0x35')]?_0x429295[_0x3608('0x34')]:_0x2f4992[_0x3608('0x2d')];_0x429295['order']=qs[_0x3608('0x39')](_0x26159b[_0x3608('0x2f')][_0x3608('0x39')]);_0x429295[_0x3608('0x3a')]=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x26159b[_0x3608('0x2f')],_0x2f4992['filters']));if(_0x26159b['query'][_0x3608('0x3b')]){_0x429295[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x429295[_0x3608('0x3a')],{'$or':_[_0x3608('0x2e')](_0x429295[_0x3608('0x34')],function(_0x3968d9){var _0x33aa9c={};_0x33aa9c[_0x3968d9]={'$like':'%'+_0x26159b[_0x3608('0x2f')]['filter']+'%'};return _0x33aa9c;})});}_0x429295=_[_0x3608('0x3c')]({},_0x429295,_0x26159b['options']);return _0x5dfac1[_0x3608('0x48')](_0x429295);}})[_0x3608('0x24')](function(_0x338fdb){if(_0x338fdb){_0x37f4ba=_0x338fdb['length'];if(!_0x26159b[_0x3608('0x2f')]['hasOwnProperty'](_0x3608('0x37'))){_0x429295['limit']=qs[_0x3608('0x1c')](_0x26159b['query'][_0x3608('0x1c')]);_0x429295[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x26159b[_0x3608('0x2f')]['offset']);}return _0x5dfac1['getSubjects'](_0x429295);}})[_0x3608('0x24')](function(_0x4cbeb1){if(_0x4cbeb1){return _0x4cbeb1?{'count':_0x37f4ba,'rows':_0x4cbeb1}:null;}})[_0x3608('0x24')](respondWithResult(_0x9343ec,null))[_0x3608('0x40')](handleError(_0x9343ec,null));};exports[_0x3608('0x4b')]=function(_0x1e678f,_0x437b7a,_0x1c8918){var _0x1e0fc2={};var _0x547607={};var _0x3b72c9;var _0x45a26b;return db[_0x3608('0x29')][_0x3608('0x49')]({'where':{'id':_0x1e678f['params']['id']}})[_0x3608('0x24')](handleEntityNotFound(_0x437b7a,null))[_0x3608('0x24')](function(_0x404bb8){if(_0x404bb8){_0x3b72c9=_0x404bb8;_0x547607[_0x3608('0x2d')]=_[_0x3608('0x30')](db[_0x3608('0x4a')][_0x3608('0x2a')]);_0x547607['query']=_[_0x3608('0x30')](_0x1e678f[_0x3608('0x2f')]);_0x547607[_0x3608('0x31')]=_[_0x3608('0x32')](_0x547607[_0x3608('0x2d')],_0x547607[_0x3608('0x2f')]);_0x1e0fc2[_0x3608('0x34')]=_[_0x3608('0x32')](_0x547607['model'],qs[_0x3608('0x33')](_0x1e678f['query']['fields']));_0x1e0fc2[_0x3608('0x34')]=_0x1e0fc2['attributes']['length']?_0x1e0fc2['attributes']:_0x547607[_0x3608('0x2d')];_0x1e0fc2['order']=qs[_0x3608('0x39')](_0x1e678f[_0x3608('0x2f')][_0x3608('0x39')]);_0x1e0fc2[_0x3608('0x3a')]=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x1e678f[_0x3608('0x2f')],_0x547607[_0x3608('0x31')]));if(_0x1e678f[_0x3608('0x2f')]['filter']){_0x1e0fc2[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x1e0fc2['where'],{'$or':_[_0x3608('0x2e')](_0x1e0fc2[_0x3608('0x34')],function(_0x7c6259){var _0x5d0e7c={};_0x5d0e7c[_0x7c6259]={'$like':'%'+_0x1e678f[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x5d0e7c;})});}_0x1e0fc2=_['merge']({},_0x1e0fc2,_0x1e678f[_0x3608('0x3d')]);return _0x3b72c9[_0x3608('0x4b')](_0x1e0fc2);}})[_0x3608('0x24')](function(_0x264a57){if(_0x264a57){_0x45a26b=_0x264a57['length'];if(!_0x1e678f['query']['hasOwnProperty']('nolimit')){_0x1e0fc2[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x1e678f[_0x3608('0x2f')][_0x3608('0x1c')]);_0x1e0fc2['offset']=qs[_0x3608('0x1a')](_0x1e678f[_0x3608('0x2f')][_0x3608('0x1a')]);}return _0x3b72c9[_0x3608('0x4b')](_0x1e0fc2);}})[_0x3608('0x24')](function(_0x360c7f){if(_0x360c7f){return _0x360c7f?{'count':_0x45a26b,'rows':_0x360c7f}:null;}})['then'](respondWithResult(_0x437b7a,null))['catch'](handleError(_0x437b7a,null));};exports['getTags']=function(_0x8eaf37,_0x1c7e60,_0x68bbb){var _0x546abb={};var _0x19fd65={};var _0x59b3c5;var _0x333d5b;return db[_0x3608('0x29')][_0x3608('0x49')]({'where':{'id':_0x8eaf37[_0x3608('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c7e60,null))['then'](function(_0x169468){if(_0x169468){_0x59b3c5=_0x169468;_0x19fd65[_0x3608('0x2d')]=_['keys'](db[_0x3608('0x4c')]['rawAttributes']);_0x19fd65[_0x3608('0x2f')]=_[_0x3608('0x30')](_0x8eaf37[_0x3608('0x2f')]);_0x19fd65[_0x3608('0x31')]=_[_0x3608('0x32')](_0x19fd65['model'],_0x19fd65['query']);_0x546abb[_0x3608('0x34')]=_['intersection'](_0x19fd65['model'],qs[_0x3608('0x33')](_0x8eaf37[_0x3608('0x2f')][_0x3608('0x33')]));_0x546abb[_0x3608('0x34')]=_0x546abb['attributes']['length']?_0x546abb['attributes']:_0x19fd65[_0x3608('0x2d')];_0x546abb['order']=qs[_0x3608('0x39')](_0x8eaf37[_0x3608('0x2f')][_0x3608('0x39')]);_0x546abb[_0x3608('0x3a')]=qs[_0x3608('0x31')](_[_0x3608('0x47')](_0x8eaf37[_0x3608('0x2f')],_0x19fd65['filters']));if(_0x8eaf37[_0x3608('0x2f')]['filter']){_0x546abb[_0x3608('0x3a')]=_[_0x3608('0x3c')](_0x546abb[_0x3608('0x3a')],{'$or':_['map'](_0x546abb[_0x3608('0x34')],function(_0x52209a){var _0x372cdd={};_0x372cdd[_0x52209a]={'$like':'%'+_0x8eaf37[_0x3608('0x2f')][_0x3608('0x3b')]+'%'};return _0x372cdd;})});}_0x546abb=_[_0x3608('0x3c')]({},_0x546abb,_0x8eaf37[_0x3608('0x3d')]);return _0x59b3c5['getTags'](_0x546abb);}})[_0x3608('0x24')](function(_0x56b9cc){if(_0x56b9cc){_0x333d5b=_0x56b9cc[_0x3608('0x35')];if(!_0x8eaf37[_0x3608('0x2f')][_0x3608('0x36')](_0x3608('0x37'))){_0x546abb[_0x3608('0x1c')]=qs[_0x3608('0x1c')](_0x8eaf37[_0x3608('0x2f')]['limit']);_0x546abb[_0x3608('0x1a')]=qs[_0x3608('0x1a')](_0x8eaf37['query'][_0x3608('0x1a')]);}return _0x59b3c5[_0x3608('0x4d')](_0x546abb);}})[_0x3608('0x24')](function(_0x31808e){if(_0x31808e){return _0x31808e?{'count':_0x333d5b,'rows':_0x31808e}:null;}})[_0x3608('0x24')](respondWithResult(_0x1c7e60,null))[_0x3608('0x40')](handleError(_0x1c7e60,null));};exports[_0x3608('0x4e')]=function(_0x1c4909,_0x37b1da,_0x2d4d7e){if(_0x1c4909['body']['id']){delete _0x1c4909[_0x3608('0x44')]['id'];}return db[_0x3608('0x29')]['findOne']({'where':{'id':_0x1c4909[_0x3608('0x42')]['id']}})['then'](handleEntityNotFound(_0x37b1da,null))[_0x3608('0x24')](function(_0x35e637){if(_0x35e637){return _0x35e637[_0x3608('0x4e')](_0x1c4909['body'][_0x3608('0x4f')]||[]);}return null;})[_0x3608('0x24')](respondWithResult(_0x37b1da,null))['catch'](handleError(_0x37b1da,null));}; \ No newline at end of file +var _0x2e6c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','index','ZendeskConfiguration','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','include','rows','catch','keys','rawAttributes','length','find','create','body','params','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x2e6c,0x144));var _0xc2e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2e6c[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xc2e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2e6('0x1'));var jsonpatch=require(_0xc2e6('0x2'));var rp=require(_0xc2e6('0x3'));var moment=require(_0xc2e6('0x4'));var BPromise=require(_0xc2e6('0x5'));var Mustache=require(_0xc2e6('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc2e6('0x7'));var csv=require(_0xc2e6('0x8'));var ejs=require(_0xc2e6('0x9'));var fs=require('fs');var fs_extra=require(_0xc2e6('0xa'));var _=require(_0xc2e6('0xb'));var squel=require(_0xc2e6('0xc'));var crypto=require(_0xc2e6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc2e6('0xe'));var toCsv=require(_0xc2e6('0x8'));var querystring=require(_0xc2e6('0xf'));var Papa=require(_0xc2e6('0x10'));var Redis=require(_0xc2e6('0x11'));var authService=require(_0xc2e6('0x12'));var qs=require(_0xc2e6('0x13'));var as=require(_0xc2e6('0x14'));var hardwareService=require(_0xc2e6('0x15'));var logger=require(_0xc2e6('0x16'))(_0xc2e6('0x17'));var utils=require(_0xc2e6('0x18'));var config=require(_0xc2e6('0x19'));var licenseUtil=require(_0xc2e6('0x1a'));var db=require(_0xc2e6('0x1b'))['db'];function respondWithStatusCode(_0x36e54b,_0xed06df){_0xed06df=_0xed06df||0xcc;return function(_0x18445e){if(_0x18445e){return _0x36e54b['sendStatus'](_0xed06df);}return _0x36e54b[_0xc2e6('0x1c')](_0xed06df)[_0xc2e6('0x1d')]();};}function respondWithResult(_0x596934,_0x5c792c){_0x5c792c=_0x5c792c||0xc8;return function(_0x1c694d){if(_0x1c694d){return _0x596934[_0xc2e6('0x1c')](_0x5c792c)[_0xc2e6('0x1e')](_0x1c694d);}};}function respondWithFilteredResult(_0x1a55d0,_0x11d284){return function(_0x53a482){if(_0x53a482){var _0x5222d8=typeof _0x11d284['offset']===_0xc2e6('0x1f')&&typeof _0x11d284[_0xc2e6('0x20')]===_0xc2e6('0x1f');var _0x3a8737=_0x53a482[_0xc2e6('0x21')];var _0x209811=_0x5222d8?0x0:_0x11d284[_0xc2e6('0x22')];var _0x51cbe=_0x5222d8?_0x53a482[_0xc2e6('0x21')]:_0x11d284[_0xc2e6('0x22')]+_0x11d284[_0xc2e6('0x20')];var _0x2cec49;if(_0x51cbe>=_0x3a8737){_0x51cbe=_0x3a8737;_0x2cec49=0xc8;}else{_0x2cec49=0xce;}_0x1a55d0[_0xc2e6('0x1c')](_0x2cec49);return _0x1a55d0[_0xc2e6('0x23')](_0xc2e6('0x24'),_0x209811+'-'+_0x51cbe+'/'+_0x3a8737)[_0xc2e6('0x1e')](_0x53a482);}return null;};}function patchUpdates(_0x1bf057){return function(_0x248aa5){try{jsonpatch[_0xc2e6('0x25')](_0x248aa5,_0x1bf057,!![]);}catch(_0x54c04c){return BPromise['reject'](_0x54c04c);}return _0x248aa5['save']();};}function saveUpdates(_0x1861ae,_0x145a78){return function(_0x4d358b){if(_0x4d358b){return _0x4d358b[_0xc2e6('0x26')](_0x1861ae)[_0xc2e6('0x27')](function(_0x988fe0){return _0x988fe0;});}return null;};}function removeEntity(_0x221858,_0x328f3c){return function(_0xfd4e8e){if(_0xfd4e8e){return _0xfd4e8e[_0xc2e6('0x28')]()[_0xc2e6('0x27')](function(){_0x221858['status'](0xcc)[_0xc2e6('0x1d')]();});}};}function handleEntityNotFound(_0x5b192b,_0x2fc353){return function(_0x44b7c1){if(!_0x44b7c1){_0x5b192b[_0xc2e6('0x29')](0x194);}return _0x44b7c1;};}function handleError(_0x404455,_0x35da11){_0x35da11=_0x35da11||0x1f4;return function(_0x33f961){logger[_0xc2e6('0x2a')](_0x33f961[_0xc2e6('0x2b')]);if(_0x33f961[_0xc2e6('0x2c')]){delete _0x33f961[_0xc2e6('0x2c')];}_0x404455[_0xc2e6('0x1c')](_0x35da11)['send'](_0x33f961);};}exports[_0xc2e6('0x2d')]=function(_0xa152da,_0x20f95b){var _0x3f43f8={},_0x3c3b0a={},_0x2cbad0={'count':0x0,'rows':[]};var _0x4563f3=_['map'](db[_0xc2e6('0x2e')]['rawAttributes'],function(_0x2c767d){return{'name':_0x2c767d[_0xc2e6('0x2f')],'type':_0x2c767d[_0xc2e6('0x30')][_0xc2e6('0x31')]};});_0x3c3b0a[_0xc2e6('0x32')]=_[_0xc2e6('0x33')](_0x4563f3,_0xc2e6('0x2c'));_0x3c3b0a['query']=_['keys'](_0xa152da[_0xc2e6('0x34')]);_0x3c3b0a['filters']=_[_0xc2e6('0x35')](_0x3c3b0a[_0xc2e6('0x32')],_0x3c3b0a['query']);_0x3f43f8[_0xc2e6('0x36')]=_[_0xc2e6('0x35')](_0x3c3b0a[_0xc2e6('0x32')],qs['fields'](_0xa152da[_0xc2e6('0x34')][_0xc2e6('0x37')]));_0x3f43f8[_0xc2e6('0x36')]=_0x3f43f8[_0xc2e6('0x36')]['length']?_0x3f43f8['attributes']:_0x3c3b0a[_0xc2e6('0x32')];if(!_0xa152da[_0xc2e6('0x34')][_0xc2e6('0x38')](_0xc2e6('0x39'))){_0x3f43f8[_0xc2e6('0x20')]=qs[_0xc2e6('0x20')](_0xa152da[_0xc2e6('0x34')][_0xc2e6('0x20')]);_0x3f43f8[_0xc2e6('0x22')]=qs[_0xc2e6('0x22')](_0xa152da[_0xc2e6('0x34')][_0xc2e6('0x22')]);}_0x3f43f8[_0xc2e6('0x3a')]=qs[_0xc2e6('0x3b')](_0xa152da[_0xc2e6('0x34')][_0xc2e6('0x3b')]);_0x3f43f8[_0xc2e6('0x3c')]=qs[_0xc2e6('0x3d')](_['pick'](_0xa152da['query'],_0x3c3b0a[_0xc2e6('0x3d')]),_0x4563f3);if(_0xa152da['query']['filter']){_0x3f43f8[_0xc2e6('0x3c')]=_[_0xc2e6('0x3e')](_0x3f43f8['where'],{'$or':_['map'](_0x4563f3,function(_0x14efcf){if(_0x14efcf[_0xc2e6('0x30')]!==_0xc2e6('0x3f')){var _0xf218a6={};_0xf218a6[_0x14efcf[_0xc2e6('0x2c')]]={'$like':'%'+_0xa152da[_0xc2e6('0x34')][_0xc2e6('0x40')]+'%'};return _0xf218a6;}})});}_0x3f43f8=_[_0xc2e6('0x3e')]({},_0x3f43f8,_0xa152da[_0xc2e6('0x41')]);var _0x5ce53d={'where':_0x3f43f8['where']};return db[_0xc2e6('0x2e')][_0xc2e6('0x21')](_0x5ce53d)[_0xc2e6('0x27')](function(_0x41f83d){_0x2cbad0['count']=_0x41f83d;if(_0xa152da[_0xc2e6('0x34')]['includeAll']){_0x3f43f8[_0xc2e6('0x42')]=[{'all':!![]}];}return db[_0xc2e6('0x2e')]['findAll'](_0x3f43f8);})[_0xc2e6('0x27')](function(_0x5b8294){_0x2cbad0[_0xc2e6('0x43')]=_0x5b8294;return _0x2cbad0;})[_0xc2e6('0x27')](respondWithFilteredResult(_0x20f95b,_0x3f43f8))[_0xc2e6('0x44')](handleError(_0x20f95b,null));};exports['show']=function(_0x3b137e,_0x47185f){var _0x5c7035={'raw':![],'where':{'id':_0x3b137e['params']['id']}},_0x42de36={};_0x42de36[_0xc2e6('0x32')]=_[_0xc2e6('0x45')](db[_0xc2e6('0x2e')][_0xc2e6('0x46')]);_0x42de36['query']=_[_0xc2e6('0x45')](_0x3b137e['query']);_0x42de36[_0xc2e6('0x3d')]=_[_0xc2e6('0x35')](_0x42de36[_0xc2e6('0x32')],_0x42de36[_0xc2e6('0x34')]);_0x5c7035[_0xc2e6('0x36')]=_['intersection'](_0x42de36[_0xc2e6('0x32')],qs['fields'](_0x3b137e[_0xc2e6('0x34')]['fields']));_0x5c7035[_0xc2e6('0x36')]=_0x5c7035[_0xc2e6('0x36')][_0xc2e6('0x47')]?_0x5c7035[_0xc2e6('0x36')]:_0x42de36[_0xc2e6('0x32')];if(_0x3b137e[_0xc2e6('0x34')]['includeAll']){_0x5c7035[_0xc2e6('0x42')]=[{'all':!![]}];}_0x5c7035=_['merge']({},_0x5c7035,_0x3b137e[_0xc2e6('0x41')]);return db[_0xc2e6('0x2e')][_0xc2e6('0x48')](_0x5c7035)[_0xc2e6('0x27')](handleEntityNotFound(_0x47185f,null))['then'](respondWithResult(_0x47185f,null))[_0xc2e6('0x44')](handleError(_0x47185f,null));};exports[_0xc2e6('0x49')]=function(_0x4ccf98,_0x1928a4){return db[_0xc2e6('0x2e')][_0xc2e6('0x49')](_0x4ccf98[_0xc2e6('0x4a')],{})[_0xc2e6('0x27')](respondWithResult(_0x1928a4,0xc9))[_0xc2e6('0x44')](handleError(_0x1928a4,null));};exports[_0xc2e6('0x26')]=function(_0x1b7866,_0x3c227a){if(_0x1b7866[_0xc2e6('0x4a')]['id']){delete _0x1b7866[_0xc2e6('0x4a')]['id'];}return db[_0xc2e6('0x2e')][_0xc2e6('0x48')]({'where':{'id':_0x1b7866[_0xc2e6('0x4b')]['id']}})[_0xc2e6('0x27')](handleEntityNotFound(_0x3c227a,null))[_0xc2e6('0x27')](saveUpdates(_0x1b7866[_0xc2e6('0x4a')],null))[_0xc2e6('0x27')](respondWithResult(_0x3c227a,null))[_0xc2e6('0x44')](handleError(_0x3c227a,null));};exports[_0xc2e6('0x28')]=function(_0x5e09c2,_0x5e1df0){return db[_0xc2e6('0x2e')][_0xc2e6('0x48')]({'where':{'id':_0x5e09c2[_0xc2e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e1df0,null))[_0xc2e6('0x27')](removeEntity(_0x5e1df0,null))['catch'](handleError(_0x5e1df0,null));};exports[_0xc2e6('0x4c')]=function(_0x27d1b3,_0xde1c57,_0xb26218){var _0x44537e={};var _0x2c70b3={};var _0xde1e6e;var _0x1e8c36;return db['ZendeskConfiguration'][_0xc2e6('0x4d')]({'where':{'id':_0x27d1b3[_0xc2e6('0x4b')]['id']}})[_0xc2e6('0x27')](handleEntityNotFound(_0xde1c57,null))[_0xc2e6('0x27')](function(_0x26b0a3){if(_0x26b0a3){_0xde1e6e=_0x26b0a3;_0x2c70b3[_0xc2e6('0x32')]=_[_0xc2e6('0x45')](db[_0xc2e6('0x4e')][_0xc2e6('0x46')]);_0x2c70b3[_0xc2e6('0x34')]=_[_0xc2e6('0x45')](_0x27d1b3[_0xc2e6('0x34')]);_0x2c70b3[_0xc2e6('0x3d')]=_[_0xc2e6('0x35')](_0x2c70b3['model'],_0x2c70b3['query']);_0x44537e['attributes']=_[_0xc2e6('0x35')](_0x2c70b3[_0xc2e6('0x32')],qs[_0xc2e6('0x37')](_0x27d1b3[_0xc2e6('0x34')]['fields']));_0x44537e[_0xc2e6('0x36')]=_0x44537e[_0xc2e6('0x36')][_0xc2e6('0x47')]?_0x44537e['attributes']:_0x2c70b3[_0xc2e6('0x32')];_0x44537e['order']=qs[_0xc2e6('0x3b')](_0x27d1b3[_0xc2e6('0x34')][_0xc2e6('0x3b')]);_0x44537e[_0xc2e6('0x3c')]=qs['filters'](_['pick'](_0x27d1b3[_0xc2e6('0x34')],_0x2c70b3[_0xc2e6('0x3d')]));if(_0x27d1b3[_0xc2e6('0x34')][_0xc2e6('0x40')]){_0x44537e[_0xc2e6('0x3c')]=_['merge'](_0x44537e[_0xc2e6('0x3c')],{'$or':_[_0xc2e6('0x33')](_0x44537e[_0xc2e6('0x36')],function(_0x38e79e){var _0x476eb7={};_0x476eb7[_0x38e79e]={'$like':'%'+_0x27d1b3['query']['filter']+'%'};return _0x476eb7;})});}_0x44537e=_[_0xc2e6('0x3e')]({},_0x44537e,_0x27d1b3[_0xc2e6('0x41')]);return _0xde1e6e['getFields'](_0x44537e);}})[_0xc2e6('0x27')](function(_0x5a7ec9){if(_0x5a7ec9){_0x1e8c36=_0x5a7ec9[_0xc2e6('0x47')];if(!_0x27d1b3[_0xc2e6('0x34')][_0xc2e6('0x38')](_0xc2e6('0x39'))){_0x44537e[_0xc2e6('0x20')]=qs[_0xc2e6('0x20')](_0x27d1b3[_0xc2e6('0x34')][_0xc2e6('0x20')]);_0x44537e[_0xc2e6('0x22')]=qs[_0xc2e6('0x22')](_0x27d1b3['query']['offset']);}return _0xde1e6e[_0xc2e6('0x4c')](_0x44537e);}})['then'](function(_0x2ef4f9){if(_0x2ef4f9){return _0x2ef4f9?{'count':_0x1e8c36,'rows':_0x2ef4f9}:null;}})[_0xc2e6('0x27')](respondWithResult(_0xde1c57,null))[_0xc2e6('0x44')](handleError(_0xde1c57,null));};exports['getSubjects']=function(_0x565ef3,_0x520617,_0x3ebde8){var _0xeb36f0={};var _0x3c7270={};var _0x44615d;var _0x47dff4;return db[_0xc2e6('0x2e')]['findOne']({'where':{'id':_0x565ef3['params']['id']}})[_0xc2e6('0x27')](handleEntityNotFound(_0x520617,null))['then'](function(_0x6eced2){if(_0x6eced2){_0x44615d=_0x6eced2;_0x3c7270[_0xc2e6('0x32')]=_[_0xc2e6('0x45')](db[_0xc2e6('0x4e')]['rawAttributes']);_0x3c7270[_0xc2e6('0x34')]=_[_0xc2e6('0x45')](_0x565ef3[_0xc2e6('0x34')]);_0x3c7270[_0xc2e6('0x3d')]=_['intersection'](_0x3c7270[_0xc2e6('0x32')],_0x3c7270[_0xc2e6('0x34')]);_0xeb36f0[_0xc2e6('0x36')]=_[_0xc2e6('0x35')](_0x3c7270[_0xc2e6('0x32')],qs[_0xc2e6('0x37')](_0x565ef3[_0xc2e6('0x34')][_0xc2e6('0x37')]));_0xeb36f0[_0xc2e6('0x36')]=_0xeb36f0[_0xc2e6('0x36')][_0xc2e6('0x47')]?_0xeb36f0['attributes']:_0x3c7270[_0xc2e6('0x32')];_0xeb36f0[_0xc2e6('0x3a')]=qs['sort'](_0x565ef3[_0xc2e6('0x34')][_0xc2e6('0x3b')]);_0xeb36f0['where']=qs[_0xc2e6('0x3d')](_[_0xc2e6('0x4f')](_0x565ef3[_0xc2e6('0x34')],_0x3c7270[_0xc2e6('0x3d')]));if(_0x565ef3[_0xc2e6('0x34')][_0xc2e6('0x40')]){_0xeb36f0[_0xc2e6('0x3c')]=_[_0xc2e6('0x3e')](_0xeb36f0[_0xc2e6('0x3c')],{'$or':_[_0xc2e6('0x33')](_0xeb36f0['attributes'],function(_0x45c0e1){var _0x3b3b8a={};_0x3b3b8a[_0x45c0e1]={'$like':'%'+_0x565ef3[_0xc2e6('0x34')][_0xc2e6('0x40')]+'%'};return _0x3b3b8a;})});}_0xeb36f0=_[_0xc2e6('0x3e')]({},_0xeb36f0,_0x565ef3['options']);return _0x44615d['getSubjects'](_0xeb36f0);}})[_0xc2e6('0x27')](function(_0x57b01c){if(_0x57b01c){_0x47dff4=_0x57b01c['length'];if(!_0x565ef3['query']['hasOwnProperty'](_0xc2e6('0x39'))){_0xeb36f0[_0xc2e6('0x20')]=qs['limit'](_0x565ef3['query'][_0xc2e6('0x20')]);_0xeb36f0['offset']=qs[_0xc2e6('0x22')](_0x565ef3[_0xc2e6('0x34')][_0xc2e6('0x22')]);}return _0x44615d[_0xc2e6('0x50')](_0xeb36f0);}})[_0xc2e6('0x27')](function(_0x30eb54){if(_0x30eb54){return _0x30eb54?{'count':_0x47dff4,'rows':_0x30eb54}:null;}})['then'](respondWithResult(_0x520617,null))[_0xc2e6('0x44')](handleError(_0x520617,null));};exports[_0xc2e6('0x51')]=function(_0x38e5f9,_0x349721,_0x515337){var _0x358a4e={};var _0x4a366c={};var _0x3fb645;var _0x397529;return db[_0xc2e6('0x2e')][_0xc2e6('0x4d')]({'where':{'id':_0x38e5f9[_0xc2e6('0x4b')]['id']}})[_0xc2e6('0x27')](handleEntityNotFound(_0x349721,null))[_0xc2e6('0x27')](function(_0x4e109d){if(_0x4e109d){_0x3fb645=_0x4e109d;_0x4a366c[_0xc2e6('0x32')]=_[_0xc2e6('0x45')](db[_0xc2e6('0x4e')][_0xc2e6('0x46')]);_0x4a366c[_0xc2e6('0x34')]=_['keys'](_0x38e5f9['query']);_0x4a366c[_0xc2e6('0x3d')]=_[_0xc2e6('0x35')](_0x4a366c[_0xc2e6('0x32')],_0x4a366c[_0xc2e6('0x34')]);_0x358a4e[_0xc2e6('0x36')]=_['intersection'](_0x4a366c['model'],qs[_0xc2e6('0x37')](_0x38e5f9['query']['fields']));_0x358a4e[_0xc2e6('0x36')]=_0x358a4e[_0xc2e6('0x36')]['length']?_0x358a4e[_0xc2e6('0x36')]:_0x4a366c[_0xc2e6('0x32')];_0x358a4e[_0xc2e6('0x3a')]=qs[_0xc2e6('0x3b')](_0x38e5f9[_0xc2e6('0x34')][_0xc2e6('0x3b')]);_0x358a4e[_0xc2e6('0x3c')]=qs[_0xc2e6('0x3d')](_[_0xc2e6('0x4f')](_0x38e5f9[_0xc2e6('0x34')],_0x4a366c[_0xc2e6('0x3d')]));if(_0x38e5f9['query']['filter']){_0x358a4e[_0xc2e6('0x3c')]=_[_0xc2e6('0x3e')](_0x358a4e['where'],{'$or':_[_0xc2e6('0x33')](_0x358a4e[_0xc2e6('0x36')],function(_0x4559dd){var _0x3c8ed4={};_0x3c8ed4[_0x4559dd]={'$like':'%'+_0x38e5f9[_0xc2e6('0x34')][_0xc2e6('0x40')]+'%'};return _0x3c8ed4;})});}_0x358a4e=_['merge']({},_0x358a4e,_0x38e5f9['options']);return _0x3fb645['getDescriptions'](_0x358a4e);}})[_0xc2e6('0x27')](function(_0x1c347c){if(_0x1c347c){_0x397529=_0x1c347c['length'];if(!_0x38e5f9[_0xc2e6('0x34')]['hasOwnProperty'](_0xc2e6('0x39'))){_0x358a4e[_0xc2e6('0x20')]=qs[_0xc2e6('0x20')](_0x38e5f9['query'][_0xc2e6('0x20')]);_0x358a4e[_0xc2e6('0x22')]=qs[_0xc2e6('0x22')](_0x38e5f9[_0xc2e6('0x34')][_0xc2e6('0x22')]);}return _0x3fb645[_0xc2e6('0x51')](_0x358a4e);}})[_0xc2e6('0x27')](function(_0x2707a8){if(_0x2707a8){return _0x2707a8?{'count':_0x397529,'rows':_0x2707a8}:null;}})[_0xc2e6('0x27')](respondWithResult(_0x349721,null))['catch'](handleError(_0x349721,null));};exports['getTags']=function(_0x533c90,_0x5b59ba,_0x3f89de){var _0x1e8677={};var _0x128a94={};var _0x3cb499;var _0x20e736;return db['ZendeskConfiguration'][_0xc2e6('0x4d')]({'where':{'id':_0x533c90['params']['id']}})[_0xc2e6('0x27')](handleEntityNotFound(_0x5b59ba,null))[_0xc2e6('0x27')](function(_0x112628){if(_0x112628){_0x3cb499=_0x112628;_0x128a94[_0xc2e6('0x32')]=_[_0xc2e6('0x45')](db[_0xc2e6('0x52')]['rawAttributes']);_0x128a94['query']=_[_0xc2e6('0x45')](_0x533c90[_0xc2e6('0x34')]);_0x128a94[_0xc2e6('0x3d')]=_[_0xc2e6('0x35')](_0x128a94[_0xc2e6('0x32')],_0x128a94[_0xc2e6('0x34')]);_0x1e8677[_0xc2e6('0x36')]=_[_0xc2e6('0x35')](_0x128a94[_0xc2e6('0x32')],qs[_0xc2e6('0x37')](_0x533c90[_0xc2e6('0x34')][_0xc2e6('0x37')]));_0x1e8677[_0xc2e6('0x36')]=_0x1e8677[_0xc2e6('0x36')][_0xc2e6('0x47')]?_0x1e8677[_0xc2e6('0x36')]:_0x128a94[_0xc2e6('0x32')];_0x1e8677['order']=qs['sort'](_0x533c90[_0xc2e6('0x34')]['sort']);_0x1e8677[_0xc2e6('0x3c')]=qs[_0xc2e6('0x3d')](_[_0xc2e6('0x4f')](_0x533c90['query'],_0x128a94['filters']));if(_0x533c90[_0xc2e6('0x34')]['filter']){_0x1e8677[_0xc2e6('0x3c')]=_[_0xc2e6('0x3e')](_0x1e8677[_0xc2e6('0x3c')],{'$or':_[_0xc2e6('0x33')](_0x1e8677['attributes'],function(_0x335def){var _0x3eb6f8={};_0x3eb6f8[_0x335def]={'$like':'%'+_0x533c90[_0xc2e6('0x34')]['filter']+'%'};return _0x3eb6f8;})});}_0x1e8677=_[_0xc2e6('0x3e')]({},_0x1e8677,_0x533c90[_0xc2e6('0x41')]);return _0x3cb499['getTags'](_0x1e8677);}})[_0xc2e6('0x27')](function(_0x21c585){if(_0x21c585){_0x20e736=_0x21c585[_0xc2e6('0x47')];if(!_0x533c90['query'][_0xc2e6('0x38')](_0xc2e6('0x39'))){_0x1e8677[_0xc2e6('0x20')]=qs[_0xc2e6('0x20')](_0x533c90[_0xc2e6('0x34')]['limit']);_0x1e8677[_0xc2e6('0x22')]=qs['offset'](_0x533c90[_0xc2e6('0x34')][_0xc2e6('0x22')]);}return _0x3cb499[_0xc2e6('0x53')](_0x1e8677);}})[_0xc2e6('0x27')](function(_0x2228e8){if(_0x2228e8){return _0x2228e8?{'count':_0x20e736,'rows':_0x2228e8}:null;}})[_0xc2e6('0x27')](respondWithResult(_0x5b59ba,null))[_0xc2e6('0x44')](handleError(_0x5b59ba,null));};exports[_0xc2e6('0x54')]=function(_0x2eaef3,_0x5bf311,_0x3bf184){if(_0x2eaef3['body']['id']){delete _0x2eaef3['body']['id'];}return db[_0xc2e6('0x2e')]['findOne']({'where':{'id':_0x2eaef3['params']['id']}})['then'](handleEntityNotFound(_0x5bf311,null))[_0xc2e6('0x27')](function(_0x1a765a){if(_0x1a765a){return _0x1a765a[_0xc2e6('0x54')](_0x2eaef3[_0xc2e6('0x4a')][_0xc2e6('0x55')]||[]);}return null;})['then'](respondWithResult(_0x5bf311,null))['catch'](handleError(_0x5bf311,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 84a7560..adc1279 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 _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x8fc976,_0x4a8b06){var _0x5c4f9d=function(_0x4170e7){while(--_0x4170e7){_0x8fc976['push'](_0x8fc976['shift']());}};_0x5c4f9d(++_0x4a8b06);}(_0x93e9,0xcc));var _0x993e=function(_0x29c530,_0x28b04b){_0x29c530=_0x29c530-0x0;var _0x567205=_0x93e9[_0x29c530];return _0x567205;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb8=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','../../config/logger','api','moment','bluebird'];(function(_0x5785c4,_0x300576){var _0x3bc66e=function(_0x4bddc7){while(--_0x4bddc7){_0x5785c4['push'](_0x5785c4['shift']());}};_0x3bc66e(++_0x300576);}(_0x5eb8,0xb0));var _0x85eb=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x5eb8[_0x255ac0];return _0x437bf1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'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 06990f4..9b5de6b 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 _0x7d16=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x461d7a,_0x555a95){var _0x43905e=function(_0x27c578){while(--_0x27c578){_0x461d7a['push'](_0x461d7a['shift']());}};_0x43905e(++_0x555a95);}(_0x7d16,0x1e2));var _0x67d1=function(_0x2489f2,_0x4189ce){_0x2489f2=_0x2489f2-0x0;var _0x3af61b=_0x7d16[_0x2489f2];return _0x3af61b;};'use strict';var _=require(_0x67d1('0x0'));var util=require(_0x67d1('0x1'));var moment=require(_0x67d1('0x2'));var BPromise=require(_0x67d1('0x3'));var rs=require(_0x67d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67d1('0x6'))(_0x67d1('0x7'));var config=require(_0x67d1('0x8'));var jayson=require(_0x67d1('0x9'));var client=jayson[_0x67d1('0xa')][_0x67d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bd16f,_0x29f17b,_0x43b899){return new BPromise(function(_0x1ceb55,_0x91c6fe){return client[_0x67d1('0xc')](_0x3bd16f,_0x43b899)[_0x67d1('0xd')](function(_0xb493cb){logger[_0x67d1('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29f17b,_0x67d1('0xf'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x29f17b,_0x67d1('0xf'),JSON[_0x67d1('0x10')](_0xb493cb));if(_0xb493cb[_0x67d1('0x11')]){if(_0xb493cb[_0x67d1('0x11')]['code']===0x1f4){logger[_0x67d1('0x11')](_0x67d1('0x12'),_0x29f17b,_0xb493cb[_0x67d1('0x11')][_0x67d1('0x13')]);return _0x91c6fe(_0xb493cb[_0x67d1('0x11')]['message']);}logger['error'](_0x67d1('0x12'),_0x29f17b,_0xb493cb[_0x67d1('0x11')][_0x67d1('0x13')]);return _0x1ceb55(_0xb493cb[_0x67d1('0x11')][_0x67d1('0x13')]);}else{logger[_0x67d1('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29f17b,_0x67d1('0xf'));_0x1ceb55(_0xb493cb[_0x67d1('0x14')][_0x67d1('0x13')]);}})[_0x67d1('0x15')](function(_0x5e23e7){logger[_0x67d1('0x11')](_0x67d1('0x12'),_0x29f17b,_0x5e23e7);_0x91c6fe(_0x5e23e7);});});} \ No newline at end of file +var _0x0ff1=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ff1,0x19b));var _0x10ff=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x0ff1[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x10ff('0x0'));var util=require(_0x10ff('0x1'));var moment=require(_0x10ff('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10ff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x10ff('0x4'));var logger=require(_0x10ff('0x5'))('rpc');var config=require(_0x10ff('0x6'));var jayson=require(_0x10ff('0x7'));var client=jayson[_0x10ff('0x8')][_0x10ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20c74e,_0x7e1754,_0x44ea8b){return new BPromise(function(_0x34c81b,_0x3b9244){return client[_0x10ff('0xa')](_0x20c74e,_0x44ea8b)[_0x10ff('0xb')](function(_0x433168){logger[_0x10ff('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x7e1754,_0x10ff('0xd'));logger[_0x10ff('0xe')](_0x10ff('0xf'),_0x7e1754,'request\x20sent',JSON['stringify'](_0x433168));if(_0x433168[_0x10ff('0x10')]){if(_0x433168[_0x10ff('0x10')][_0x10ff('0x11')]===0x1f4){logger[_0x10ff('0x10')](_0x10ff('0x12'),_0x7e1754,_0x433168[_0x10ff('0x10')][_0x10ff('0x13')]);return _0x3b9244(_0x433168['error'][_0x10ff('0x13')]);}logger['error'](_0x10ff('0x12'),_0x7e1754,_0x433168[_0x10ff('0x10')][_0x10ff('0x13')]);return _0x34c81b(_0x433168[_0x10ff('0x10')][_0x10ff('0x13')]);}else{logger[_0x10ff('0xc')](_0x10ff('0x12'),_0x7e1754,_0x10ff('0xd'));_0x34c81b(_0x433168[_0x10ff('0x14')]['message']);}})[_0x10ff('0x15')](function(_0x44aea1){logger[_0x10ff('0x10')](_0x10ff('0x12'),_0x7e1754,_0x44aea1);_0x3b9244(_0x44aea1);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c59e474..919d665 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 _0xc839=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','delete','path','express','fs-extra'];(function(_0x32e306,_0x5f17e7){var _0x431a42=function(_0x430b05){while(--_0x430b05){_0x32e306['push'](_0x32e306['shift']());}};_0x431a42(++_0x5f17e7);}(_0xc839,0x1eb));var _0x9c83=function(_0x19a86e,_0x4ddc85){_0x19a86e=_0x19a86e-0x0;var _0x56837e=_0xc839[_0x19a86e];return _0x56837e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c83('0x0'));var timeout=require('connect-timeout');var express=require(_0x9c83('0x1'));var router=express['Router']();var fs_extra=require(_0x9c83('0x2'));var auth=require(_0x9c83('0x3'));var interaction=require(_0x9c83('0x4'));var config=require(_0x9c83('0x5'));var controller=require('./intZendeskField.controller');router[_0x9c83('0x6')]('/',auth[_0x9c83('0x7')](),controller['index']);router[_0x9c83('0x6')](_0x9c83('0x8'),auth[_0x9c83('0x7')](),controller[_0x9c83('0x9')]);router[_0x9c83('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9c83('0xb')](_0x9c83('0x8'),auth[_0x9c83('0x7')](),controller['update']);router[_0x9c83('0xc')](_0x9c83('0x8'),auth[_0x9c83('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf7d6=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x803915,_0x5525bc){var _0x57bdb4=function(_0x203ba2){while(--_0x203ba2){_0x803915['push'](_0x803915['shift']());}};_0x57bdb4(++_0x5525bc);}(_0xf7d6,0x1ab));var _0x6f7d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf7d6[_0x2a6809];return _0x11c371;};'use strict';var multer=require('multer');var util=require(_0x6f7d('0x0'));var path=require(_0x6f7d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f7d('0x2')]();var fs_extra=require(_0x6f7d('0x3'));var auth=require(_0x6f7d('0x4'));var interaction=require(_0x6f7d('0x5'));var config=require(_0x6f7d('0x6'));var controller=require(_0x6f7d('0x7'));router[_0x6f7d('0x8')]('/',auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xa')]);router[_0x6f7d('0x8')](_0x6f7d('0xb'),auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xc')]);router[_0x6f7d('0xd')]('/',auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xe')]);router['put'](_0x6f7d('0xb'),auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xf')]);router[_0x6f7d('0x10')](_0x6f7d('0xb'),auth[_0x6f7d('0x9')](),controller['destroy']);module[_0x6f7d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 88d38b6..d0fefc3 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 _0xa8fe=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x4688f3,_0x36fa36){var _0x3cb0b9=function(_0x50daea){while(--_0x50daea){_0x4688f3['push'](_0x4688f3['shift']());}};_0x3cb0b9(++_0x36fa36);}(_0xa8fe,0xf5));var _0xea8f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa8fe[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xea8f('0x0'));module[_0xea8f('0x1')]={'type':{'type':Sequelize[_0xea8f('0x2')](_0xea8f('0x3'),'variable',_0xea8f('0x4'),_0xea8f('0x5'),_0xea8f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xea8f('0x7')]},'key':{'type':Sequelize[_0xea8f('0x7')]},'keyType':{'type':Sequelize[_0xea8f('0x2')](_0xea8f('0x3'),'variable',_0xea8f('0x4'))},'keyContent':{'type':Sequelize[_0xea8f('0x7')]},'idField':{'type':Sequelize[_0xea8f('0x7')]},'nameField':{'type':Sequelize[_0xea8f('0x7')]},'customField':{'type':Sequelize[_0xea8f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea8f('0x7')]}}; \ No newline at end of file +var _0x223e=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3721ac,_0x2c1ec2){var _0x524337=function(_0x33018a){while(--_0x33018a){_0x3721ac['push'](_0x3721ac['shift']());}};_0x524337(++_0x2c1ec2);}(_0x223e,0x1da));var _0xe223=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x223e[_0x5f0501];return _0x3c2c45;};'use strict';var Sequelize=require('sequelize');module[_0xe223('0x0')]={'type':{'type':Sequelize[_0xe223('0x1')](_0xe223('0x2'),_0xe223('0x3'),_0xe223('0x4'),'keyValue',_0xe223('0x5')),'defaultValue':_0xe223('0x2')},'content':{'type':Sequelize[_0xe223('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe223('0x1')](_0xe223('0x2'),_0xe223('0x3'),_0xe223('0x4'))},'keyContent':{'type':Sequelize[_0xe223('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe223('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe223('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 141df69..46c4aad 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 _0x5ffd=['params','catch','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','save','update','then','error','stack','name','send','index','map','ZendeskField','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','create','body'];(function(_0xc2869e,_0x105457){var _0x243be2=function(_0x4876b6){while(--_0x4876b6){_0xc2869e['push'](_0xc2869e['shift']());}};_0x243be2(++_0x105457);}(_0x5ffd,0xdf));var _0xd5ff=function(_0xee93b,_0x43cdca){_0xee93b=_0xee93b-0x0;var _0x4405e6=_0x5ffd[_0xee93b];return _0x4405e6;};'use strict';var emlformat=require(_0xd5ff('0x0'));var rimraf=require(_0xd5ff('0x1'));var zipdir=require(_0xd5ff('0x2'));var jsonpatch=require(_0xd5ff('0x3'));var rp=require(_0xd5ff('0x4'));var moment=require(_0xd5ff('0x5'));var BPromise=require(_0xd5ff('0x6'));var Mustache=require(_0xd5ff('0x7'));var util=require(_0xd5ff('0x8'));var path=require(_0xd5ff('0x9'));var sox=require(_0xd5ff('0xa'));var csv=require('to-csv');var ejs=require(_0xd5ff('0xb'));var fs=require('fs');var fs_extra=require(_0xd5ff('0xc'));var _=require(_0xd5ff('0xd'));var squel=require('squel');var crypto=require(_0xd5ff('0xe'));var jsforce=require(_0xd5ff('0xf'));var deskjs=require(_0xd5ff('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5ff('0x11'));var authService=require(_0xd5ff('0x12'));var qs=require(_0xd5ff('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5ff('0x14'));var logger=require('../../config/logger')(_0xd5ff('0x15'));var utils=require('../../config/utils');var config=require(_0xd5ff('0x16'));var licenseUtil=require(_0xd5ff('0x17'));var db=require(_0xd5ff('0x18'))['db'];function respondWithStatusCode(_0x2761cc,_0x4b706b){_0x4b706b=_0x4b706b||0xcc;return function(_0x3d8d58){if(_0x3d8d58){return _0x2761cc[_0xd5ff('0x19')](_0x4b706b);}return _0x2761cc[_0xd5ff('0x1a')](_0x4b706b)[_0xd5ff('0x1b')]();};}function respondWithResult(_0x27bb1c,_0x517eab){_0x517eab=_0x517eab||0xc8;return function(_0x476796){if(_0x476796){return _0x27bb1c[_0xd5ff('0x1a')](_0x517eab)['json'](_0x476796);}};}function respondWithFilteredResult(_0x422721,_0x3509f6){return function(_0x421f64){if(_0x421f64){var _0x59fcca=typeof _0x3509f6[_0xd5ff('0x1c')]===_0xd5ff('0x1d')&&typeof _0x3509f6['limit']===_0xd5ff('0x1d');var _0x396ccf=_0x421f64[_0xd5ff('0x1e')];var _0x531c86=_0x59fcca?0x0:_0x3509f6['offset'];var _0x14ddf5=_0x59fcca?_0x421f64[_0xd5ff('0x1e')]:_0x3509f6[_0xd5ff('0x1c')]+_0x3509f6[_0xd5ff('0x1f')];var _0x5319cc;if(_0x14ddf5>=_0x396ccf){_0x14ddf5=_0x396ccf;_0x5319cc=0xc8;}else{_0x5319cc=0xce;}_0x422721['status'](_0x5319cc);return _0x422721[_0xd5ff('0x20')]('Content-Range',_0x531c86+'-'+_0x14ddf5+'/'+_0x396ccf)[_0xd5ff('0x21')](_0x421f64);}return null;};}function patchUpdates(_0x513a20){return function(_0x357736){try{jsonpatch['apply'](_0x357736,_0x513a20,!![]);}catch(_0x48feb7){return BPromise['reject'](_0x48feb7);}return _0x357736[_0xd5ff('0x22')]();};}function saveUpdates(_0x24bb2,_0x103f9a){return function(_0x770c51){if(_0x770c51){return _0x770c51[_0xd5ff('0x23')](_0x24bb2)['then'](function(_0x3555d7){return _0x3555d7;});}return null;};}function removeEntity(_0x323d09,_0x16e7ca){return function(_0x3e462b){if(_0x3e462b){return _0x3e462b['destroy']()[_0xd5ff('0x24')](function(){_0x323d09['status'](0xcc)[_0xd5ff('0x1b')]();});}};}function handleEntityNotFound(_0x2603c9,_0x15071e){return function(_0x1556bc){if(!_0x1556bc){_0x2603c9['sendStatus'](0x194);}return _0x1556bc;};}function handleError(_0x2174ae,_0x21a811){_0x21a811=_0x21a811||0x1f4;return function(_0x2e1601){logger[_0xd5ff('0x25')](_0x2e1601[_0xd5ff('0x26')]);if(_0x2e1601[_0xd5ff('0x27')]){delete _0x2e1601[_0xd5ff('0x27')];}_0x2174ae[_0xd5ff('0x1a')](_0x21a811)[_0xd5ff('0x28')](_0x2e1601);};}exports[_0xd5ff('0x29')]=function(_0xfb2705,_0x5857f8){var _0x5a4de7={},_0xee5c5b={},_0x4cb91d={'count':0x0,'rows':[]};var _0x1c89c4=_[_0xd5ff('0x2a')](db[_0xd5ff('0x2b')]['rawAttributes'],function(_0x51a65f){return{'name':_0x51a65f[_0xd5ff('0x2c')],'type':_0x51a65f[_0xd5ff('0x2d')]['key']};});_0xee5c5b[_0xd5ff('0x2e')]=_['map'](_0x1c89c4,_0xd5ff('0x27'));_0xee5c5b[_0xd5ff('0x2f')]=_['keys'](_0xfb2705[_0xd5ff('0x2f')]);_0xee5c5b['filters']=_[_0xd5ff('0x30')](_0xee5c5b[_0xd5ff('0x2e')],_0xee5c5b['query']);_0x5a4de7[_0xd5ff('0x31')]=_['intersection'](_0xee5c5b[_0xd5ff('0x2e')],qs['fields'](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x32')]));_0x5a4de7['attributes']=_0x5a4de7[_0xd5ff('0x31')][_0xd5ff('0x33')]?_0x5a4de7[_0xd5ff('0x31')]:_0xee5c5b[_0xd5ff('0x2e')];if(!_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x34')](_0xd5ff('0x35'))){_0x5a4de7[_0xd5ff('0x1f')]=qs[_0xd5ff('0x1f')](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x1f')]);_0x5a4de7['offset']=qs[_0xd5ff('0x1c')](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x1c')]);}_0x5a4de7['order']=qs[_0xd5ff('0x36')](_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x36')]);_0x5a4de7[_0xd5ff('0x37')]=qs[_0xd5ff('0x38')](_['pick'](_0xfb2705[_0xd5ff('0x2f')],_0xee5c5b['filters']),_0x1c89c4);if(_0xfb2705[_0xd5ff('0x2f')]['filter']){_0x5a4de7[_0xd5ff('0x37')]=_['merge'](_0x5a4de7[_0xd5ff('0x37')],{'$or':_[_0xd5ff('0x2a')](_0x1c89c4,function(_0x58be45){if(_0x58be45['type']!==_0xd5ff('0x39')){var _0x55629b={};_0x55629b[_0x58be45[_0xd5ff('0x27')]]={'$like':'%'+_0xfb2705[_0xd5ff('0x2f')]['filter']+'%'};return _0x55629b;}})});}_0x5a4de7=_[_0xd5ff('0x3a')]({},_0x5a4de7,_0xfb2705[_0xd5ff('0x3b')]);var _0x29735b={'where':_0x5a4de7[_0xd5ff('0x37')]};return db[_0xd5ff('0x2b')]['count'](_0x29735b)[_0xd5ff('0x24')](function(_0x3b554e){_0x4cb91d[_0xd5ff('0x1e')]=_0x3b554e;if(_0xfb2705[_0xd5ff('0x2f')][_0xd5ff('0x3c')]){_0x5a4de7[_0xd5ff('0x3d')]=[{'all':!![]}];}return db[_0xd5ff('0x2b')][_0xd5ff('0x3e')](_0x5a4de7);})['then'](function(_0x28a131){_0x4cb91d[_0xd5ff('0x3f')]=_0x28a131;return _0x4cb91d;})[_0xd5ff('0x24')](respondWithFilteredResult(_0x5857f8,_0x5a4de7))['catch'](handleError(_0x5857f8,null));};exports[_0xd5ff('0x40')]=function(_0x146277,_0x1d33dc){var _0x3892ff={'raw':!![],'where':{'id':_0x146277['params']['id']}},_0x3e1e9c={};_0x3e1e9c[_0xd5ff('0x2e')]=_[_0xd5ff('0x41')](db[_0xd5ff('0x2b')][_0xd5ff('0x42')]);_0x3e1e9c[_0xd5ff('0x2f')]=_[_0xd5ff('0x41')](_0x146277[_0xd5ff('0x2f')]);_0x3e1e9c['filters']=_['intersection'](_0x3e1e9c['model'],_0x3e1e9c['query']);_0x3892ff[_0xd5ff('0x31')]=_[_0xd5ff('0x30')](_0x3e1e9c[_0xd5ff('0x2e')],qs[_0xd5ff('0x32')](_0x146277['query']['fields']));_0x3892ff[_0xd5ff('0x31')]=_0x3892ff['attributes'][_0xd5ff('0x33')]?_0x3892ff[_0xd5ff('0x31')]:_0x3e1e9c[_0xd5ff('0x2e')];if(_0x146277[_0xd5ff('0x2f')][_0xd5ff('0x3c')]){_0x3892ff[_0xd5ff('0x3d')]=[{'all':!![]}];}_0x3892ff=_[_0xd5ff('0x3a')]({},_0x3892ff,_0x146277[_0xd5ff('0x3b')]);return db['ZendeskField']['find'](_0x3892ff)[_0xd5ff('0x24')](handleEntityNotFound(_0x1d33dc,null))[_0xd5ff('0x24')](respondWithResult(_0x1d33dc,null))['catch'](handleError(_0x1d33dc,null));};exports[_0xd5ff('0x43')]=function(_0x4e223a,_0x153f5d){return db[_0xd5ff('0x2b')][_0xd5ff('0x43')](_0x4e223a['body'],{})[_0xd5ff('0x24')](respondWithResult(_0x153f5d,0xc9))['catch'](handleError(_0x153f5d,null));};exports[_0xd5ff('0x23')]=function(_0x19a7fe,_0x9358c8){if(_0x19a7fe['body']['id']){delete _0x19a7fe[_0xd5ff('0x44')]['id'];}return db[_0xd5ff('0x2b')]['find']({'where':{'id':_0x19a7fe[_0xd5ff('0x45')]['id']}})[_0xd5ff('0x24')](handleEntityNotFound(_0x9358c8,null))[_0xd5ff('0x24')](saveUpdates(_0x19a7fe[_0xd5ff('0x44')],null))[_0xd5ff('0x24')](respondWithResult(_0x9358c8,null))[_0xd5ff('0x46')](handleError(_0x9358c8,null));};exports[_0xd5ff('0x47')]=function(_0x14fca0,_0x303f45){return db[_0xd5ff('0x2b')][_0xd5ff('0x48')]({'where':{'id':_0x14fca0[_0xd5ff('0x45')]['id']}})['then'](handleEntityNotFound(_0x303f45,null))[_0xd5ff('0x24')](removeEntity(_0x303f45,null))[_0xd5ff('0x46')](handleError(_0x303f45,null));}; \ No newline at end of file +var _0x14f8=['../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','then','includeAll','findAll','rows','catch','params','ZendeskField','include','merge','find','create','body','eml-format','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(_0x4aa348,_0x1659bd){var _0x3d1670=function(_0x45d86f){while(--_0x45d86f){_0x4aa348['push'](_0x4aa348['shift']());}};_0x3d1670(++_0x1659bd);}(_0x14f8,0x193));var _0x814f=function(_0x2bdd5d,_0x2e0bda){_0x2bdd5d=_0x2bdd5d-0x0;var _0x257c00=_0x14f8[_0x2bdd5d];return _0x257c00;};'use strict';var emlformat=require(_0x814f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x814f('0x1'));var jsonpatch=require(_0x814f('0x2'));var rp=require(_0x814f('0x3'));var moment=require('moment');var BPromise=require(_0x814f('0x4'));var Mustache=require(_0x814f('0x5'));var util=require(_0x814f('0x6'));var path=require(_0x814f('0x7'));var sox=require('sox');var csv=require(_0x814f('0x8'));var ejs=require(_0x814f('0x9'));var fs=require('fs');var fs_extra=require(_0x814f('0xa'));var _=require(_0x814f('0xb'));var squel=require('squel');var crypto=require(_0x814f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x814f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x814f('0xe'));var Papa=require('papaparse');var Redis=require(_0x814f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x814f('0x10'));var as=require(_0x814f('0x11'));var hardwareService=require(_0x814f('0x12'));var logger=require(_0x814f('0x13'))(_0x814f('0x14'));var utils=require(_0x814f('0x15'));var config=require(_0x814f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x814f('0x17'))['db'];function respondWithStatusCode(_0x3b2d48,_0xfd9e05){_0xfd9e05=_0xfd9e05||0xcc;return function(_0x53a6a8){if(_0x53a6a8){return _0x3b2d48['sendStatus'](_0xfd9e05);}return _0x3b2d48[_0x814f('0x18')](_0xfd9e05)[_0x814f('0x19')]();};}function respondWithResult(_0x417d3b,_0x2af5fb){_0x2af5fb=_0x2af5fb||0xc8;return function(_0x1fea24){if(_0x1fea24){return _0x417d3b[_0x814f('0x18')](_0x2af5fb)[_0x814f('0x1a')](_0x1fea24);}};}function respondWithFilteredResult(_0x444aee,_0x49c7e6){return function(_0x171ab4){if(_0x171ab4){var _0x10b981=typeof _0x49c7e6[_0x814f('0x1b')]===_0x814f('0x1c')&&typeof _0x49c7e6[_0x814f('0x1d')]===_0x814f('0x1c');var _0x41179a=_0x171ab4['count'];var _0x24c03c=_0x10b981?0x0:_0x49c7e6['offset'];var _0x351f3d=_0x10b981?_0x171ab4[_0x814f('0x1e')]:_0x49c7e6['offset']+_0x49c7e6['limit'];var _0x627fe1;if(_0x351f3d>=_0x41179a){_0x351f3d=_0x41179a;_0x627fe1=0xc8;}else{_0x627fe1=0xce;}_0x444aee['status'](_0x627fe1);return _0x444aee['set']('Content-Range',_0x24c03c+'-'+_0x351f3d+'/'+_0x41179a)['json'](_0x171ab4);}return null;};}function patchUpdates(_0x3722ef){return function(_0x4ece43){try{jsonpatch['apply'](_0x4ece43,_0x3722ef,!![]);}catch(_0x3b792e){return BPromise[_0x814f('0x1f')](_0x3b792e);}return _0x4ece43[_0x814f('0x20')]();};}function saveUpdates(_0x5be5ca,_0x10d18c){return function(_0x67d119){if(_0x67d119){return _0x67d119[_0x814f('0x21')](_0x5be5ca)['then'](function(_0x160e6c){return _0x160e6c;});}return null;};}function removeEntity(_0x3c6144,_0x5a6465){return function(_0x35bbe3){if(_0x35bbe3){return _0x35bbe3[_0x814f('0x22')]()['then'](function(){_0x3c6144[_0x814f('0x18')](0xcc)[_0x814f('0x19')]();});}};}function handleEntityNotFound(_0xc162af,_0x418ca8){return function(_0x48c4ca){if(!_0x48c4ca){_0xc162af['sendStatus'](0x194);}return _0x48c4ca;};}function handleError(_0x5d7582,_0x2f6693){_0x2f6693=_0x2f6693||0x1f4;return function(_0x3704e7){logger[_0x814f('0x23')](_0x3704e7[_0x814f('0x24')]);if(_0x3704e7[_0x814f('0x25')]){delete _0x3704e7[_0x814f('0x25')];}_0x5d7582[_0x814f('0x18')](_0x2f6693)[_0x814f('0x26')](_0x3704e7);};}exports[_0x814f('0x27')]=function(_0x555aa0,_0x4cb3d9){var _0x583ad8={},_0x1e3bc6={},_0x204f64={'count':0x0,'rows':[]};var _0x5041ea=_['map'](db['ZendeskField'][_0x814f('0x28')],function(_0x317e52){return{'name':_0x317e52[_0x814f('0x29')],'type':_0x317e52[_0x814f('0x2a')][_0x814f('0x2b')]};});_0x1e3bc6[_0x814f('0x2c')]=_['map'](_0x5041ea,_0x814f('0x25'));_0x1e3bc6[_0x814f('0x2d')]=_[_0x814f('0x2e')](_0x555aa0[_0x814f('0x2d')]);_0x1e3bc6[_0x814f('0x2f')]=_[_0x814f('0x30')](_0x1e3bc6[_0x814f('0x2c')],_0x1e3bc6['query']);_0x583ad8['attributes']=_[_0x814f('0x30')](_0x1e3bc6[_0x814f('0x2c')],qs[_0x814f('0x31')](_0x555aa0[_0x814f('0x2d')][_0x814f('0x31')]));_0x583ad8[_0x814f('0x32')]=_0x583ad8[_0x814f('0x32')][_0x814f('0x33')]?_0x583ad8[_0x814f('0x32')]:_0x1e3bc6['model'];if(!_0x555aa0[_0x814f('0x2d')][_0x814f('0x34')](_0x814f('0x35'))){_0x583ad8['limit']=qs[_0x814f('0x1d')](_0x555aa0['query'][_0x814f('0x1d')]);_0x583ad8[_0x814f('0x1b')]=qs[_0x814f('0x1b')](_0x555aa0['query']['offset']);}_0x583ad8['order']=qs[_0x814f('0x36')](_0x555aa0['query'][_0x814f('0x36')]);_0x583ad8['where']=qs['filters'](_[_0x814f('0x37')](_0x555aa0[_0x814f('0x2d')],_0x1e3bc6[_0x814f('0x2f')]),_0x5041ea);if(_0x555aa0[_0x814f('0x2d')][_0x814f('0x38')]){_0x583ad8['where']=_['merge'](_0x583ad8[_0x814f('0x39')],{'$or':_['map'](_0x5041ea,function(_0x1f16c2){if(_0x1f16c2[_0x814f('0x2a')]!==_0x814f('0x3a')){var _0x26aa08={};_0x26aa08[_0x1f16c2[_0x814f('0x25')]]={'$like':'%'+_0x555aa0[_0x814f('0x2d')][_0x814f('0x38')]+'%'};return _0x26aa08;}})});}_0x583ad8=_['merge']({},_0x583ad8,_0x555aa0['options']);var _0x330b11={'where':_0x583ad8['where']};return db['ZendeskField'][_0x814f('0x1e')](_0x330b11)[_0x814f('0x3b')](function(_0x21fe7a){_0x204f64[_0x814f('0x1e')]=_0x21fe7a;if(_0x555aa0[_0x814f('0x2d')][_0x814f('0x3c')]){_0x583ad8['include']=[{'all':!![]}];}return db['ZendeskField'][_0x814f('0x3d')](_0x583ad8);})[_0x814f('0x3b')](function(_0x441bc4){_0x204f64[_0x814f('0x3e')]=_0x441bc4;return _0x204f64;})[_0x814f('0x3b')](respondWithFilteredResult(_0x4cb3d9,_0x583ad8))[_0x814f('0x3f')](handleError(_0x4cb3d9,null));};exports['show']=function(_0x3c8286,_0x2e6e7a){var _0x42e1a3={'raw':!![],'where':{'id':_0x3c8286[_0x814f('0x40')]['id']}},_0x44ceef={};_0x44ceef[_0x814f('0x2c')]=_[_0x814f('0x2e')](db[_0x814f('0x41')][_0x814f('0x28')]);_0x44ceef[_0x814f('0x2d')]=_[_0x814f('0x2e')](_0x3c8286[_0x814f('0x2d')]);_0x44ceef[_0x814f('0x2f')]=_[_0x814f('0x30')](_0x44ceef[_0x814f('0x2c')],_0x44ceef[_0x814f('0x2d')]);_0x42e1a3[_0x814f('0x32')]=_[_0x814f('0x30')](_0x44ceef[_0x814f('0x2c')],qs[_0x814f('0x31')](_0x3c8286[_0x814f('0x2d')][_0x814f('0x31')]));_0x42e1a3[_0x814f('0x32')]=_0x42e1a3['attributes']['length']?_0x42e1a3[_0x814f('0x32')]:_0x44ceef[_0x814f('0x2c')];if(_0x3c8286[_0x814f('0x2d')]['includeAll']){_0x42e1a3[_0x814f('0x42')]=[{'all':!![]}];}_0x42e1a3=_[_0x814f('0x43')]({},_0x42e1a3,_0x3c8286['options']);return db[_0x814f('0x41')][_0x814f('0x44')](_0x42e1a3)[_0x814f('0x3b')](handleEntityNotFound(_0x2e6e7a,null))['then'](respondWithResult(_0x2e6e7a,null))['catch'](handleError(_0x2e6e7a,null));};exports[_0x814f('0x45')]=function(_0xbe9a19,_0x597573){return db[_0x814f('0x41')][_0x814f('0x45')](_0xbe9a19[_0x814f('0x46')],{})[_0x814f('0x3b')](respondWithResult(_0x597573,0xc9))[_0x814f('0x3f')](handleError(_0x597573,null));};exports[_0x814f('0x21')]=function(_0x376d25,_0x289b30){if(_0x376d25[_0x814f('0x46')]['id']){delete _0x376d25[_0x814f('0x46')]['id'];}return db[_0x814f('0x41')][_0x814f('0x44')]({'where':{'id':_0x376d25[_0x814f('0x40')]['id']}})[_0x814f('0x3b')](handleEntityNotFound(_0x289b30,null))[_0x814f('0x3b')](saveUpdates(_0x376d25[_0x814f('0x46')],null))[_0x814f('0x3b')](respondWithResult(_0x289b30,null))[_0x814f('0x3f')](handleError(_0x289b30,null));};exports[_0x814f('0x22')]=function(_0x261f23,_0x5e682f){return db['ZendeskField'][_0x814f('0x44')]({'where':{'id':_0x261f23[_0x814f('0x40')]['id']}})[_0x814f('0x3b')](handleEntityNotFound(_0x5e682f,null))[_0x814f('0x3b')](removeEntity(_0x5e682f,null))['catch'](handleError(_0x5e682f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5bf343c..9430ec3 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 _0x445f=['exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x5de9ef,_0x44f1b6){var _0x2bd196=function(_0x1e67a2){while(--_0x1e67a2){_0x5de9ef['push'](_0x5de9ef['shift']());}};_0x2bd196(++_0x44f1b6);}(_0x445f,0x1b8));var _0xf445=function(_0x5833a5,_0x1c05f9){_0x5833a5=_0x5833a5-0x0;var _0x2f4e5b=_0x445f[_0x5833a5];return _0x2f4e5b;};'use strict';var _=require(_0xf445('0x0'));var util=require(_0xf445('0x1'));var logger=require(_0xf445('0x2'))(_0xf445('0x3'));var moment=require(_0xf445('0x4'));var BPromise=require('bluebird');var rp=require(_0xf445('0x5'));var fs=require('fs');var path=require(_0xf445('0x6'));var rimraf=require(_0xf445('0x7'));var config=require(_0xf445('0x8'));var attributes=require(_0xf445('0x9'));module[_0xf445('0xa')]=function(_0x413450,_0x3e0849){return _0x413450['define'](_0xf445('0xb'),attributes,{'tableName':_0xf445('0xc'),'paranoid':![],'indexes':[{'name':_0xf445('0xd'),'fields':[_0xf445('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5922=['moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x327afd,_0x1ecb90){var _0x15384f=function(_0xfcb49d){while(--_0xfcb49d){_0x327afd['push'](_0x327afd['shift']());}};_0x15384f(++_0x1ecb90);}(_0x5922,0xcd));var _0x2592=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x5922[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require(_0x2592('0x0'));var logger=require(_0x2592('0x1'))(_0x2592('0x2'));var moment=require(_0x2592('0x3'));var BPromise=require('bluebird');var rp=require(_0x2592('0x4'));var fs=require('fs');var path=require(_0x2592('0x5'));var rimraf=require(_0x2592('0x6'));var config=require(_0x2592('0x7'));var attributes=require(_0x2592('0x8'));module[_0x2592('0x9')]=function(_0x8c828d,_0x310505){return _0x8c828d[_0x2592('0xa')](_0x2592('0xb'),attributes,{'tableName':_0x2592('0xc'),'paranoid':![],'indexes':[{'name':_0x2592('0xd'),'fields':[_0x2592('0xe'),_0x2592('0xf')],'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 269465f..81d9e51 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 _0xa016=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0xcb0eb2,_0x3906bf){var _0xbab9b8=function(_0x24fa8a){while(--_0x24fa8a){_0xcb0eb2['push'](_0xcb0eb2['shift']());}};_0xbab9b8(++_0x3906bf);}(_0xa016,0xc7));var _0x6a01=function(_0x39c8b4,_0x2d3464){_0x39c8b4=_0x39c8b4-0x0;var _0x54af79=_0xa016[_0x39c8b4];return _0x54af79;};'use strict';var _=require(_0x6a01('0x0'));var util=require(_0x6a01('0x1'));var moment=require('moment');var BPromise=require(_0x6a01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a01('0x3'));var db=require(_0x6a01('0x4'))['db'];var utils=require(_0x6a01('0x5'));var logger=require(_0x6a01('0x6'))(_0x6a01('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a01('0x8'));var client=jayson['client'][_0x6a01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x203c93,_0x4b4276,_0x1758ee){return new BPromise(function(_0x121aaa,_0x22c938){return client[_0x6a01('0xa')](_0x203c93,_0x1758ee)[_0x6a01('0xb')](function(_0x5ebf8e){logger[_0x6a01('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4b4276,_0x6a01('0xd'));logger[_0x6a01('0xe')](_0x6a01('0xf'),_0x4b4276,_0x6a01('0xd'),JSON['stringify'](_0x5ebf8e));if(_0x5ebf8e[_0x6a01('0x10')]){if(_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x11')]===0x1f4){logger[_0x6a01('0x10')](_0x6a01('0x12'),_0x4b4276,_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x13')]);return _0x22c938(_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x13')]);}logger[_0x6a01('0x10')]('ZendeskField,\x20%s,\x20%s',_0x4b4276,_0x5ebf8e[_0x6a01('0x10')][_0x6a01('0x13')]);return _0x121aaa(_0x5ebf8e[_0x6a01('0x10')]['message']);}else{logger[_0x6a01('0xc')](_0x6a01('0x12'),_0x4b4276,_0x6a01('0xd'));_0x121aaa(_0x5ebf8e[_0x6a01('0x14')][_0x6a01('0x13')]);}})[_0x6a01('0x15')](function(_0x2c8261){logger[_0x6a01('0x10')](_0x6a01('0x12'),_0x4b4276,_0x2c8261);_0x22c938(_0x2c8261);});});} \ No newline at end of file +var _0x9c50=['jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x4c54a6,_0x26208b){var _0x5038d7=function(_0x1360b6){while(--_0x1360b6){_0x4c54a6['push'](_0x4c54a6['shift']());}};_0x5038d7(++_0x26208b);}(_0x9c50,0xf6));var _0x09c5=function(_0x21976e,_0x136cdd){_0x21976e=_0x21976e-0x0;var _0x3efa3c=_0x9c50[_0x21976e];return _0x3efa3c;};'use strict';var _=require(_0x09c5('0x0'));var util=require('util');var moment=require(_0x09c5('0x1'));var BPromise=require(_0x09c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c5('0x4'));var logger=require('../../config/logger')(_0x09c5('0x5'));var config=require(_0x09c5('0x6'));var jayson=require(_0x09c5('0x7'));var client=jayson[_0x09c5('0x8')][_0x09c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x548d54,_0x119d35,_0x219f32){return new BPromise(function(_0x3f8368,_0x3abbbc){return client[_0x09c5('0xa')](_0x548d54,_0x219f32)[_0x09c5('0xb')](function(_0x5524d4){logger[_0x09c5('0xc')](_0x09c5('0xd'),_0x119d35,_0x09c5('0xe'));logger[_0x09c5('0xf')](_0x09c5('0x10'),_0x119d35,'request\x20sent',JSON[_0x09c5('0x11')](_0x5524d4));if(_0x5524d4['error']){if(_0x5524d4[_0x09c5('0x12')][_0x09c5('0x13')]===0x1f4){logger[_0x09c5('0x12')](_0x09c5('0xd'),_0x119d35,_0x5524d4[_0x09c5('0x12')][_0x09c5('0x14')]);return _0x3abbbc(_0x5524d4['error'][_0x09c5('0x14')]);}logger[_0x09c5('0x12')]('ZendeskField,\x20%s,\x20%s',_0x119d35,_0x5524d4[_0x09c5('0x12')]['message']);return _0x3f8368(_0x5524d4['error']['message']);}else{logger[_0x09c5('0xc')]('ZendeskField,\x20%s,\x20%s',_0x119d35,_0x09c5('0xe'));_0x3f8368(_0x5524d4[_0x09c5('0x15')][_0x09c5('0x14')]);}})[_0x09c5('0x16')](function(_0x3bec66){logger[_0x09c5('0x12')]('ZendeskField,\x20%s,\x20%s',_0x119d35,_0x3bec66);_0x3abbbc(_0x3bec66);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 65e6d4d..bb02a1d 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 _0xfec2=['/:id/fields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','getConfigurations'];(function(_0x59b2cd,_0x2c7556){var _0x3c63b5=function(_0x3bec2e){while(--_0x3bec2e){_0x59b2cd['push'](_0x59b2cd['shift']());}};_0x3c63b5(++_0x2c7556);}(_0xfec2,0x193));var _0x2fec=function(_0x163172,_0x341012){_0x163172=_0x163172-0x0;var _0x4099f7=_0xfec2[_0x163172];return _0x4099f7;};'use strict';var multer=require(_0x2fec('0x0'));var util=require(_0x2fec('0x1'));var path=require(_0x2fec('0x2'));var timeout=require(_0x2fec('0x3'));var express=require(_0x2fec('0x4'));var router=express[_0x2fec('0x5')]();var fs_extra=require(_0x2fec('0x6'));var auth=require(_0x2fec('0x7'));var interaction=require(_0x2fec('0x8'));var config=require(_0x2fec('0x9'));var controller=require(_0x2fec('0xa'));router[_0x2fec('0xb')]('/',auth[_0x2fec('0xc')](),controller['index']);router[_0x2fec('0xb')](_0x2fec('0xd'),auth[_0x2fec('0xc')](),controller['show']);router[_0x2fec('0xb')]('/:id/configurations',auth[_0x2fec('0xc')](),controller[_0x2fec('0xe')]);router[_0x2fec('0xb')](_0x2fec('0xf'),auth[_0x2fec('0xc')](),controller['getFields']);router[_0x2fec('0x10')]('/',auth[_0x2fec('0xc')](),controller['create']);router[_0x2fec('0x10')]('/:id/configurations',auth[_0x2fec('0xc')](),controller[_0x2fec('0x11')]);router[_0x2fec('0x12')](_0x2fec('0xd'),auth[_0x2fec('0xc')](),controller['update']);router[_0x2fec('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2fec('0x14')]);module[_0x2fec('0x15')]=router; \ No newline at end of file +var _0x0da5=['/:id/configurations','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x2dd615,_0x18099c){var _0x5255a4=function(_0x3f4c54){while(--_0x3f4c54){_0x2dd615['push'](_0x2dd615['shift']());}};_0x5255a4(++_0x18099c);}(_0x0da5,0x1d4));var _0x50da=function(_0x52c251,_0x222728){_0x52c251=_0x52c251-0x0;var _0x30ef67=_0x0da5[_0x52c251];return _0x30ef67;};'use strict';var multer=require(_0x50da('0x0'));var util=require(_0x50da('0x1'));var path=require(_0x50da('0x2'));var timeout=require(_0x50da('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x50da('0x4'));var auth=require(_0x50da('0x5'));var interaction=require(_0x50da('0x6'));var config=require('../../config/environment');var controller=require(_0x50da('0x7'));router[_0x50da('0x8')]('/',auth[_0x50da('0x9')](),controller[_0x50da('0xa')]);router[_0x50da('0x8')](_0x50da('0xb'),auth[_0x50da('0x9')](),controller[_0x50da('0xc')]);router[_0x50da('0x8')]('/:id/configurations',auth[_0x50da('0x9')](),controller[_0x50da('0xd')]);router[_0x50da('0x8')](_0x50da('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x50da('0x9')](),controller['create']);router['post'](_0x50da('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x50da('0x10')](_0x50da('0xb'),auth[_0x50da('0x9')](),controller[_0x50da('0x11')]);router[_0x50da('0x12')](_0x50da('0xb'),auth[_0x50da('0x9')](),controller[_0x50da('0x13')]);module[_0x50da('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 8368167..8d9fbda 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 _0x4c4e=['sequelize','STRING'];(function(_0x7675b9,_0x56b807){var _0x3256db=function(_0xb67f7a){while(--_0xb67f7a){_0x7675b9['push'](_0x7675b9['shift']());}};_0x3256db(++_0x56b807);}(_0x4c4e,0x152));var _0xe4c4=function(_0xe275e8,_0x5dcf6c){_0xe275e8=_0xe275e8-0x0;var _0x2d3584=_0x4c4e[_0xe275e8];return _0x2d3584;};'use strict';var Sequelize=require(_0xe4c4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4c4('0x1')]},'description':{'type':Sequelize[_0xe4c4('0x1')]},'host':{'type':Sequelize[_0xe4c4('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe4c4('0x1')]},'clientSecret':{'type':Sequelize[_0xe4c4('0x1')]},'serverUrl':{'type':Sequelize[_0xe4c4('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xe4c4('0x1')]}}; \ No newline at end of file +var _0xfd28=['exports','STRING'];(function(_0x3f078b,_0x281b59){var _0x1b75a7=function(_0x52f4ac){while(--_0x52f4ac){_0x3f078b['push'](_0x3f078b['shift']());}};_0x1b75a7(++_0x281b59);}(_0xfd28,0x148));var _0x8fd2=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0xfd28[_0x12ca5f];return _0xfc3ae9;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'name':{'type':Sequelize[_0x8fd2('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x8fd2('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x8fd2('0x1')]},'clientSecret':{'type':Sequelize[_0x8fd2('0x1')]},'serverUrl':{'type':Sequelize[_0x8fd2('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x8fd2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a8d76d3..2c7161d 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 _0xa646=['merge','include','rows','catch','params','options','create','body','find','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','destroy','then','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa646,0xc7));var _0x6a64=function(_0x51cc45,_0x909fb0){_0x51cc45=_0x51cc45-0x0;var _0x412d9e=_0xa646[_0x51cc45];return _0x412d9e;};'use strict';var emlformat=require(_0x6a64('0x0'));var rimraf=require(_0x6a64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a64('0x2'));var rp=require(_0x6a64('0x3'));var moment=require(_0x6a64('0x4'));var BPromise=require(_0x6a64('0x5'));var Mustache=require(_0x6a64('0x6'));var util=require(_0x6a64('0x7'));var path=require(_0x6a64('0x8'));var sox=require(_0x6a64('0x9'));var csv=require(_0x6a64('0xa'));var ejs=require(_0x6a64('0xb'));var fs=require('fs');var fs_extra=require(_0x6a64('0xc'));var _=require('lodash');var squel=require(_0x6a64('0xd'));var crypto=require('crypto');var jsforce=require(_0x6a64('0xe'));var deskjs=require(_0x6a64('0xf'));var toCsv=require(_0x6a64('0xa'));var querystring=require(_0x6a64('0x10'));var Papa=require(_0x6a64('0x11'));var Redis=require(_0x6a64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6a64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a64('0x14'));var logger=require(_0x6a64('0x15'))(_0x6a64('0x16'));var utils=require(_0x6a64('0x17'));var config=require(_0x6a64('0x18'));var licenseUtil=require(_0x6a64('0x19'));var db=require(_0x6a64('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f2e22,_0x5ed0b0){_0x5ed0b0=_0x5ed0b0||0xcc;return function(_0x7ba368){if(_0x7ba368){return _0x1f2e22[_0x6a64('0x1b')](_0x5ed0b0);}return _0x1f2e22['status'](_0x5ed0b0)[_0x6a64('0x1c')]();};}function respondWithResult(_0x3d3c5a,_0x3d6c2b){_0x3d6c2b=_0x3d6c2b||0xc8;return function(_0x3fd505){if(_0x3fd505){return _0x3d3c5a[_0x6a64('0x1d')](_0x3d6c2b)[_0x6a64('0x1e')](_0x3fd505);}};}function respondWithFilteredResult(_0x593133,_0x5249f9){return function(_0x5db172){if(_0x5db172){var _0xccec85=typeof _0x5249f9[_0x6a64('0x1f')]===_0x6a64('0x20')&&typeof _0x5249f9['limit']===_0x6a64('0x20');var _0x1f48e6=_0x5db172[_0x6a64('0x21')];var _0xe84374=_0xccec85?0x0:_0x5249f9['offset'];var _0x20c5d5=_0xccec85?_0x5db172['count']:_0x5249f9[_0x6a64('0x1f')]+_0x5249f9[_0x6a64('0x22')];var _0x331971;if(_0x20c5d5>=_0x1f48e6){_0x20c5d5=_0x1f48e6;_0x331971=0xc8;}else{_0x331971=0xce;}_0x593133['status'](_0x331971);return _0x593133[_0x6a64('0x23')]('Content-Range',_0xe84374+'-'+_0x20c5d5+'/'+_0x1f48e6)[_0x6a64('0x1e')](_0x5db172);}return null;};}function patchUpdates(_0x2fc063){return function(_0x2f199a){try{jsonpatch[_0x6a64('0x24')](_0x2f199a,_0x2fc063,!![]);}catch(_0xfbc373){return BPromise['reject'](_0xfbc373);}return _0x2f199a['save']();};}function saveUpdates(_0x3d7b9c,_0x265637){return function(_0x1e4bd5){if(_0x1e4bd5){return _0x1e4bd5[_0x6a64('0x25')](_0x3d7b9c)['then'](function(_0x1a8df6){return _0x1a8df6;});}return null;};}function removeEntity(_0x915d4c,_0x2e6d5d){return function(_0x17eabc){if(_0x17eabc){return _0x17eabc[_0x6a64('0x26')]()[_0x6a64('0x27')](function(){_0x915d4c[_0x6a64('0x1d')](0xcc)[_0x6a64('0x1c')]();});}};}function handleEntityNotFound(_0xc4dda8,_0x1bb651){return function(_0x422d4f){if(!_0x422d4f){_0xc4dda8[_0x6a64('0x1b')](0x194);}return _0x422d4f;};}function handleError(_0x367000,_0x68c8f){_0x68c8f=_0x68c8f||0x1f4;return function(_0x2573f9){logger[_0x6a64('0x28')](_0x2573f9[_0x6a64('0x29')]);if(_0x2573f9[_0x6a64('0x2a')]){delete _0x2573f9[_0x6a64('0x2a')];}_0x367000[_0x6a64('0x1d')](_0x68c8f)[_0x6a64('0x2b')](_0x2573f9);};}exports[_0x6a64('0x2c')]=function(_0x5ae5c5,_0x58eb39){var _0x2fbecb={},_0x780142={},_0xcc3113={'count':0x0,'rows':[]};var _0x50e981=_['map'](db[_0x6a64('0x2d')][_0x6a64('0x2e')],function(_0x1dcf52){return{'name':_0x1dcf52[_0x6a64('0x2f')],'type':_0x1dcf52[_0x6a64('0x30')][_0x6a64('0x31')]};});_0x780142[_0x6a64('0x32')]=_[_0x6a64('0x33')](_0x50e981,'name');_0x780142['query']=_[_0x6a64('0x34')](_0x5ae5c5['query']);_0x780142['filters']=_[_0x6a64('0x35')](_0x780142[_0x6a64('0x32')],_0x780142[_0x6a64('0x36')]);_0x2fbecb[_0x6a64('0x37')]=_[_0x6a64('0x35')](_0x780142[_0x6a64('0x32')],qs[_0x6a64('0x38')](_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x38')]));_0x2fbecb[_0x6a64('0x37')]=_0x2fbecb[_0x6a64('0x37')][_0x6a64('0x39')]?_0x2fbecb[_0x6a64('0x37')]:_0x780142[_0x6a64('0x32')];if(!_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x3a')]('nolimit')){_0x2fbecb[_0x6a64('0x22')]=qs['limit'](_0x5ae5c5['query'][_0x6a64('0x22')]);_0x2fbecb['offset']=qs[_0x6a64('0x1f')](_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x1f')]);}_0x2fbecb[_0x6a64('0x3b')]=qs[_0x6a64('0x3c')](_0x5ae5c5['query'][_0x6a64('0x3c')]);_0x2fbecb['where']=qs[_0x6a64('0x3d')](_['pick'](_0x5ae5c5[_0x6a64('0x36')],_0x780142[_0x6a64('0x3d')]),_0x50e981);if(_0x5ae5c5['query'][_0x6a64('0x3e')]){_0x2fbecb[_0x6a64('0x3f')]=_['merge'](_0x2fbecb[_0x6a64('0x3f')],{'$or':_['map'](_0x50e981,function(_0x1f2557){if(_0x1f2557[_0x6a64('0x30')]!==_0x6a64('0x40')){var _0x5992f2={};_0x5992f2[_0x1f2557[_0x6a64('0x2a')]]={'$like':'%'+_0x5ae5c5[_0x6a64('0x36')][_0x6a64('0x3e')]+'%'};return _0x5992f2;}})});}_0x2fbecb=_[_0x6a64('0x41')]({},_0x2fbecb,_0x5ae5c5['options']);var _0x58c67a={'where':_0x2fbecb['where']};return db['ZohoAccount'][_0x6a64('0x21')](_0x58c67a)[_0x6a64('0x27')](function(_0x10f253){_0xcc3113['count']=_0x10f253;if(_0x5ae5c5[_0x6a64('0x36')]['includeAll']){_0x2fbecb[_0x6a64('0x42')]=[{'all':!![]}];}return db[_0x6a64('0x2d')]['findAll'](_0x2fbecb);})[_0x6a64('0x27')](function(_0x1eaef3){_0xcc3113[_0x6a64('0x43')]=_0x1eaef3;return _0xcc3113;})['then'](respondWithFilteredResult(_0x58eb39,_0x2fbecb))[_0x6a64('0x44')](handleError(_0x58eb39,null));};exports['show']=function(_0x36698a,_0x401afd){var _0x4127c8={'raw':![],'where':{'id':_0x36698a[_0x6a64('0x45')]['id']}},_0x30e0c4={};_0x30e0c4['model']=_['keys'](db['ZohoAccount']['rawAttributes']);_0x30e0c4[_0x6a64('0x36')]=_['keys'](_0x36698a[_0x6a64('0x36')]);_0x30e0c4['filters']=_[_0x6a64('0x35')](_0x30e0c4[_0x6a64('0x32')],_0x30e0c4['query']);_0x4127c8[_0x6a64('0x37')]=_[_0x6a64('0x35')](_0x30e0c4['model'],qs[_0x6a64('0x38')](_0x36698a[_0x6a64('0x36')][_0x6a64('0x38')]));_0x4127c8[_0x6a64('0x37')]=_0x4127c8[_0x6a64('0x37')]['length']?_0x4127c8[_0x6a64('0x37')]:_0x30e0c4['model'];if(_0x36698a['query']['includeAll']){_0x4127c8[_0x6a64('0x42')]=[{'all':!![]}];}_0x4127c8=_[_0x6a64('0x41')]({},_0x4127c8,_0x36698a[_0x6a64('0x46')]);return db['ZohoAccount']['find'](_0x4127c8)[_0x6a64('0x27')](handleEntityNotFound(_0x401afd,null))[_0x6a64('0x27')](respondWithResult(_0x401afd,null))[_0x6a64('0x44')](handleError(_0x401afd,null));};exports[_0x6a64('0x47')]=function(_0x84568b,_0x454302){return db[_0x6a64('0x2d')]['create'](_0x84568b[_0x6a64('0x48')],{})[_0x6a64('0x27')](respondWithResult(_0x454302,0xc9))[_0x6a64('0x44')](handleError(_0x454302,null));};exports[_0x6a64('0x25')]=function(_0x10957e,_0x2836a4){if(_0x10957e[_0x6a64('0x48')]['id']){delete _0x10957e['body']['id'];}return db[_0x6a64('0x2d')][_0x6a64('0x49')]({'where':{'id':_0x10957e[_0x6a64('0x45')]['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x2836a4,null))[_0x6a64('0x27')](saveUpdates(_0x10957e[_0x6a64('0x48')],null))['then'](respondWithResult(_0x2836a4,null))[_0x6a64('0x44')](handleError(_0x2836a4,null));};exports[_0x6a64('0x26')]=function(_0x58074e,_0x4090d0){return db['ZohoAccount'][_0x6a64('0x49')]({'where':{'id':_0x58074e['params']['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x4090d0,null))['then'](removeEntity(_0x4090d0,null))[_0x6a64('0x44')](handleError(_0x4090d0,null));};exports['getConfigurations']=function(_0x2c56eb,_0x13b5fa,_0x481aa0){var _0x4be240={};var _0x22b191={};var _0x2b1cc9;var _0x23e704;return db[_0x6a64('0x2d')][_0x6a64('0x4a')]({'where':{'id':_0x2c56eb[_0x6a64('0x45')]['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x13b5fa,null))[_0x6a64('0x27')](function(_0x11768a){if(_0x11768a){_0x2b1cc9=_0x11768a;_0x22b191[_0x6a64('0x32')]=_[_0x6a64('0x34')](db[_0x6a64('0x4b')]['rawAttributes']);_0x22b191[_0x6a64('0x36')]=_[_0x6a64('0x34')](_0x2c56eb[_0x6a64('0x36')]);_0x22b191['filters']=_[_0x6a64('0x35')](_0x22b191[_0x6a64('0x32')],_0x22b191[_0x6a64('0x36')]);_0x4be240[_0x6a64('0x37')]=_[_0x6a64('0x35')](_0x22b191['model'],qs['fields'](_0x2c56eb['query'][_0x6a64('0x38')]));_0x4be240['attributes']=_0x4be240[_0x6a64('0x37')][_0x6a64('0x39')]?_0x4be240[_0x6a64('0x37')]:_0x22b191['model'];_0x4be240[_0x6a64('0x3b')]=qs[_0x6a64('0x3c')](_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x3c')]);_0x4be240[_0x6a64('0x3f')]=qs[_0x6a64('0x3d')](_['pick'](_0x2c56eb[_0x6a64('0x36')],_0x22b191['filters']));if(_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x3e')]){_0x4be240['where']=_[_0x6a64('0x41')](_0x4be240[_0x6a64('0x3f')],{'$or':_[_0x6a64('0x33')](_0x4be240['attributes'],function(_0x271bf6){var _0x5d97f5={};_0x5d97f5[_0x271bf6]={'$like':'%'+_0x2c56eb['query']['filter']+'%'};return _0x5d97f5;})});}_0x4be240=_[_0x6a64('0x41')]({},_0x4be240,_0x2c56eb[_0x6a64('0x46')]);return _0x2b1cc9[_0x6a64('0x4c')](_0x4be240);}})[_0x6a64('0x27')](function(_0x51309e){if(_0x51309e){_0x23e704=_0x51309e['length'];if(!_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x3a')]('nolimit')){_0x4be240['limit']=qs['limit'](_0x2c56eb['query'][_0x6a64('0x22')]);_0x4be240[_0x6a64('0x1f')]=qs[_0x6a64('0x1f')](_0x2c56eb[_0x6a64('0x36')][_0x6a64('0x1f')]);}return _0x2b1cc9[_0x6a64('0x4c')](_0x4be240);}})[_0x6a64('0x27')](function(_0x5dd69a){if(_0x5dd69a){return _0x5dd69a?{'count':_0x23e704,'rows':_0x5dd69a}:null;}})['then'](respondWithResult(_0x13b5fa,null))[_0x6a64('0x44')](handleError(_0x13b5fa,null));};exports[_0x6a64('0x4d')]=function(_0x311a64,_0x51c542,_0x512ecc){if(_0x311a64[_0x6a64('0x48')]['id']){delete _0x311a64[_0x6a64('0x48')]['id'];}return db[_0x6a64('0x2d')][_0x6a64('0x4a')]({'where':{'id':_0x311a64['params']['id']}})[_0x6a64('0x27')](handleEntityNotFound(_0x51c542,null))[_0x6a64('0x27')](function(_0xea53fe){if(_0xea53fe){_0x311a64[_0x6a64('0x48')][_0x6a64('0x4e')]=_0xea53fe['id'];_0x311a64[_0x6a64('0x48')][_0x6a64('0x4f')]=integrations[_0x6a64('0x50')](_0x311a64['body'][_0x6a64('0x51')],_0x311a64['body'][_0x6a64('0x30')]);_0x311a64[_0x6a64('0x48')][_0x6a64('0x52')]=integrations[_0x6a64('0x53')](_0x311a64[_0x6a64('0x48')][_0x6a64('0x51')],_0x311a64['body'][_0x6a64('0x30')]);return db[_0x6a64('0x4b')]['create'](_0x311a64[_0x6a64('0x48')],{'include':[{'model':db['ZohoField'],'as':_0x6a64('0x4f')},{'model':db['ZohoField'],'as':_0x6a64('0x52')}]});}return null;})[_0x6a64('0x27')](respondWithResult(_0x51c542,null))[_0x6a64('0x44')](handleError(_0x51c542,null));};function getAccessToken(_0x3d33b8){return new Promise(function(_0x3512b3,_0x2959a2){var _0x375673;switch(_0x3d33b8['zone']){case'US':_0x375673=_0x6a64('0x54');break;case'AU':_0x375673='https://accounts.zoho.com.au';break;case'EU':_0x375673=_0x6a64('0x55');break;case'IN':_0x375673=_0x6a64('0x56');break;case'CN':_0x375673=_0x6a64('0x57');break;default:_0x375673=_0x6a64('0x55');break;}var _0xf6f168={'method':'POST','uri':_0x375673+'/oauth/v2/token','qs':{'refresh_token':_0x3d33b8[_0x6a64('0x58')],'client_id':_0x3d33b8[_0x6a64('0x59')],'client_secret':_0x3d33b8[_0x6a64('0x5a')],'grant_type':_0x6a64('0x5b')},'json':!![]};return rp(_0xf6f168)[_0x6a64('0x27')](function(_0x45763e){if(_0x45763e[_0x6a64('0x5c')]){_0x3512b3(_0x45763e[_0x6a64('0x5c')]);}else{_0x2959a2(_0x6a64('0x5d'));}})[_0x6a64('0x44')](function(_0x41c53e){_0x2959a2(_0x41c53e);});});}exports[_0x6a64('0x5e')]=function(_0x5e2eb8,_0x1c439c,_0x2ab643){var _0x79309a,_0x5a0e1f,_0x55d070,_0x471fbc,_0x259fd4;return db[_0x6a64('0x2d')][_0x6a64('0x4a')]({'where':{'id':_0x5e2eb8[_0x6a64('0x45')]['id']},'attributes':['id',_0x6a64('0x5f'),_0x6a64('0x60'),_0x6a64('0x59'),_0x6a64('0x5a'),'serverUrl',_0x6a64('0x61'),'refreshToken']})[_0x6a64('0x27')](handleEntityNotFound(_0x1c439c,null))[_0x6a64('0x27')](function(_0x369c32){_0x259fd4=_0x369c32;_0x79309a=_0x259fd4[_0x6a64('0x5f')];_0x5a0e1f=_0x79309a===_0x6a64('0x62')?'eu':_0x6a64('0x63');_0x55d070=_0x259fd4[_0x6a64('0x64')];var _0x4273ea=_0x55d070[_0x6a64('0x65')](-0x1);if(_0x4273ea==='/'||_0x4273ea==='\x5c'||_0x4273ea===':'){_0x55d070=_0x55d070[_0x6a64('0x66')](0x0,_0x55d070[_0x6a64('0x67')](_0x4273ea));}if(!_0x259fd4[_0x6a64('0x58')]){throw new Error(_0x6a64('0x68'));}return getAccessToken(_0x259fd4);})['then'](function(_0x425878){if(_0x425878){return rp({'method':_0x6a64('0x69'),'uri':util[_0x6a64('0x6a')](_0x6a64('0x6b'),_0x5a0e1f),'qs':{'module':_0x6a64('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x425878},'json':!![]});}})['then'](function(_0x2a1e43){if(_0x2a1e43){if(_0x2a1e43[_0x6a64('0x6d')]&&_0x2a1e43[_0x6a64('0x6d')][_0x6a64('0x28')]){throw new Error(_0x2a1e43[_0x6a64('0x6d')][_0x6a64('0x28')][_0x6a64('0x6e')]);}var _0x262356=[];var _0x41f590=[];var _0x5c1986=[_0x6a64('0x6f'),_0x6a64('0x70'),_0x6a64('0x71'),_0x6a64('0x72'),_0x6a64('0x73'),_0x6a64('0x74'),_0x6a64('0x75'),_0x6a64('0x76')];_0x41f590=_[_0x6a64('0x77')](_0x2a1e43[_0x6a64('0x38')],function(_0x13e836){return _0x5c1986[_0x6a64('0x78')](_0x13e836[_0x6a64('0x79')]);});for(var _0x3df577=0x0;_0x3df577<_0x41f590[_0x6a64('0x39')];_0x3df577++){if(_0x41f590[_0x3df577][_0x6a64('0x7a')]===![]){_0x262356['push']({'id':_0x41f590[_0x3df577]['id'],'name':_0x41f590[_0x3df577][_0x6a64('0x7b')],'custom':_0x41f590[_0x3df577][_0x6a64('0x7c')],'options':_0x41f590[_0x3df577][_0x6a64('0x7d')]===_0x6a64('0x7e')&&_0x41f590[_0x3df577][_0x6a64('0x7f')][_0x6a64('0x39')]>-0x1?_[_0x6a64('0x33')](_0x41f590[_0x3df577][_0x6a64('0x7f')],function(_0x31f10d){return{'name':_0x31f10d,'value':_0x31f10d};}):[]});}}return{'count':_0x262356[_0x6a64('0x39')],'rows':_0x262356};}else{return{'count':0x0,'rows':[]};}})[_0x6a64('0x27')](respondWithResult(_0x1c439c,null))['catch'](function(_0x28c766){var _0xff14a8=_0x5e2eb8[_0x6a64('0x36')][_0x6a64('0x80')]?0x1f4:_0x28c766[_0x6a64('0x81')]||0x1f4;logger[_0x6a64('0x28')](_0x6a64('0x82'),_0x6a64('0x5e'),_0xff14a8,JSON['stringify'](_0x28c766));delete _0x28c766['name'];if(_0xff14a8===0x191){_0xff14a8=0x190;}_0x1c439c[_0x6a64('0x1d')](_0xff14a8)['send'](_0x5e2eb8[_0x6a64('0x36')][_0x6a64('0x80')]?{'message':_0x6a64('0x83'),'statusCode':_0x28c766[_0x6a64('0x81')]}:_0x28c766);});}; \ No newline at end of file +var _0xd4a3=['pick','filter','where','merge','VIRTUAL','options','ZohoAccount','includeAll','include','rows','catch','show','params','length','create','body','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','Descriptions','getDescriptions','channel','ZohoField','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','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','data_type','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd4a3,0x1c1));var _0x3d4a=function(_0xbe4add,_0xa37530){_0xbe4add=_0xbe4add-0x0;var _0x2aa84c=_0xd4a3[_0xbe4add];return _0x2aa84c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d4a('0x0'));var zipdir=require(_0x3d4a('0x1'));var jsonpatch=require(_0x3d4a('0x2'));var rp=require(_0x3d4a('0x3'));var moment=require(_0x3d4a('0x4'));var BPromise=require(_0x3d4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3d4a('0x6'));var sox=require('sox');var csv=require(_0x3d4a('0x7'));var ejs=require(_0x3d4a('0x8'));var fs=require('fs');var fs_extra=require(_0x3d4a('0x9'));var _=require(_0x3d4a('0xa'));var squel=require(_0x3d4a('0xb'));var crypto=require(_0x3d4a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3d4a('0x7'));var querystring=require(_0x3d4a('0xd'));var Papa=require(_0x3d4a('0xe'));var Redis=require('ioredis');var authService=require(_0x3d4a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d4a('0x10'));var hardwareService=require(_0x3d4a('0x11'));var logger=require(_0x3d4a('0x12'))('api');var utils=require(_0x3d4a('0x13'));var config=require(_0x3d4a('0x14'));var licenseUtil=require(_0x3d4a('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3d4a('0x16'));function respondWithStatusCode(_0x473813,_0x2e8f34){_0x2e8f34=_0x2e8f34||0xcc;return function(_0x382770){if(_0x382770){return _0x473813[_0x3d4a('0x17')](_0x2e8f34);}return _0x473813['status'](_0x2e8f34)[_0x3d4a('0x18')]();};}function respondWithResult(_0x3b7374,_0x58b5d3){_0x58b5d3=_0x58b5d3||0xc8;return function(_0x18c99e){if(_0x18c99e){return _0x3b7374[_0x3d4a('0x19')](_0x58b5d3)['json'](_0x18c99e);}};}function respondWithFilteredResult(_0x17cf23,_0x4e106f){return function(_0x2b1384){if(_0x2b1384){var _0x326d78=typeof _0x4e106f[_0x3d4a('0x1a')]===_0x3d4a('0x1b')&&typeof _0x4e106f[_0x3d4a('0x1c')]===_0x3d4a('0x1b');var _0x3d1e52=_0x2b1384['count'];var _0x38a0cc=_0x326d78?0x0:_0x4e106f[_0x3d4a('0x1a')];var _0x55e5b1=_0x326d78?_0x2b1384[_0x3d4a('0x1d')]:_0x4e106f['offset']+_0x4e106f[_0x3d4a('0x1c')];var _0x1cc37d;if(_0x55e5b1>=_0x3d1e52){_0x55e5b1=_0x3d1e52;_0x1cc37d=0xc8;}else{_0x1cc37d=0xce;}_0x17cf23[_0x3d4a('0x19')](_0x1cc37d);return _0x17cf23[_0x3d4a('0x1e')](_0x3d4a('0x1f'),_0x38a0cc+'-'+_0x55e5b1+'/'+_0x3d1e52)[_0x3d4a('0x20')](_0x2b1384);}return null;};}function patchUpdates(_0x752685){return function(_0x285318){try{jsonpatch['apply'](_0x285318,_0x752685,!![]);}catch(_0x153897){return BPromise[_0x3d4a('0x21')](_0x153897);}return _0x285318[_0x3d4a('0x22')]();};}function saveUpdates(_0x1bed35,_0x13cd64){return function(_0x4e596c){if(_0x4e596c){return _0x4e596c[_0x3d4a('0x23')](_0x1bed35)['then'](function(_0x4ea4e8){return _0x4ea4e8;});}return null;};}function removeEntity(_0x224b25,_0x10049b){return function(_0x476fac){if(_0x476fac){return _0x476fac[_0x3d4a('0x24')]()[_0x3d4a('0x25')](function(){_0x224b25['status'](0xcc)[_0x3d4a('0x18')]();});}};}function handleEntityNotFound(_0xb4b628,_0x32ca57){return function(_0x1b3c71){if(!_0x1b3c71){_0xb4b628[_0x3d4a('0x17')](0x194);}return _0x1b3c71;};}function handleError(_0x24f984,_0x2a636c){_0x2a636c=_0x2a636c||0x1f4;return function(_0x3a7ca8){logger[_0x3d4a('0x26')](_0x3a7ca8[_0x3d4a('0x27')]);if(_0x3a7ca8[_0x3d4a('0x28')]){delete _0x3a7ca8[_0x3d4a('0x28')];}_0x24f984['status'](_0x2a636c)[_0x3d4a('0x29')](_0x3a7ca8);};}exports[_0x3d4a('0x2a')]=function(_0x147208,_0x48d4ea){var _0x319ccb={},_0x3c326d={},_0x2300ba={'count':0x0,'rows':[]};var _0x2168d9=_[_0x3d4a('0x2b')](db['ZohoAccount'][_0x3d4a('0x2c')],function(_0x3f676b){return{'name':_0x3f676b[_0x3d4a('0x2d')],'type':_0x3f676b[_0x3d4a('0x2e')][_0x3d4a('0x2f')]};});_0x3c326d[_0x3d4a('0x30')]=_[_0x3d4a('0x2b')](_0x2168d9,_0x3d4a('0x28'));_0x3c326d['query']=_[_0x3d4a('0x31')](_0x147208['query']);_0x3c326d[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x3c326d['model'],_0x3c326d[_0x3d4a('0x34')]);_0x319ccb[_0x3d4a('0x35')]=_[_0x3d4a('0x33')](_0x3c326d['model'],qs[_0x3d4a('0x36')](_0x147208[_0x3d4a('0x34')][_0x3d4a('0x36')]));_0x319ccb['attributes']=_0x319ccb[_0x3d4a('0x35')]['length']?_0x319ccb['attributes']:_0x3c326d[_0x3d4a('0x30')];if(!_0x147208[_0x3d4a('0x34')][_0x3d4a('0x37')](_0x3d4a('0x38'))){_0x319ccb[_0x3d4a('0x1c')]=qs[_0x3d4a('0x1c')](_0x147208[_0x3d4a('0x34')][_0x3d4a('0x1c')]);_0x319ccb[_0x3d4a('0x1a')]=qs['offset'](_0x147208[_0x3d4a('0x34')][_0x3d4a('0x1a')]);}_0x319ccb[_0x3d4a('0x39')]=qs[_0x3d4a('0x3a')](_0x147208[_0x3d4a('0x34')][_0x3d4a('0x3a')]);_0x319ccb['where']=qs['filters'](_[_0x3d4a('0x3b')](_0x147208['query'],_0x3c326d[_0x3d4a('0x32')]),_0x2168d9);if(_0x147208[_0x3d4a('0x34')][_0x3d4a('0x3c')]){_0x319ccb[_0x3d4a('0x3d')]=_[_0x3d4a('0x3e')](_0x319ccb['where'],{'$or':_[_0x3d4a('0x2b')](_0x2168d9,function(_0x8b850){if(_0x8b850[_0x3d4a('0x2e')]!==_0x3d4a('0x3f')){var _0x43b6bc={};_0x43b6bc[_0x8b850[_0x3d4a('0x28')]]={'$like':'%'+_0x147208[_0x3d4a('0x34')]['filter']+'%'};return _0x43b6bc;}})});}_0x319ccb=_['merge']({},_0x319ccb,_0x147208[_0x3d4a('0x40')]);var _0x4e5607={'where':_0x319ccb[_0x3d4a('0x3d')]};return db[_0x3d4a('0x41')][_0x3d4a('0x1d')](_0x4e5607)[_0x3d4a('0x25')](function(_0xee2428){_0x2300ba[_0x3d4a('0x1d')]=_0xee2428;if(_0x147208[_0x3d4a('0x34')][_0x3d4a('0x42')]){_0x319ccb[_0x3d4a('0x43')]=[{'all':!![]}];}return db[_0x3d4a('0x41')]['findAll'](_0x319ccb);})[_0x3d4a('0x25')](function(_0x3cb387){_0x2300ba[_0x3d4a('0x44')]=_0x3cb387;return _0x2300ba;})[_0x3d4a('0x25')](respondWithFilteredResult(_0x48d4ea,_0x319ccb))[_0x3d4a('0x45')](handleError(_0x48d4ea,null));};exports[_0x3d4a('0x46')]=function(_0x491d09,_0x28ed31){var _0x1344a8={'raw':![],'where':{'id':_0x491d09[_0x3d4a('0x47')]['id']}},_0x469cfb={};_0x469cfb['model']=_[_0x3d4a('0x31')](db[_0x3d4a('0x41')][_0x3d4a('0x2c')]);_0x469cfb[_0x3d4a('0x34')]=_[_0x3d4a('0x31')](_0x491d09['query']);_0x469cfb['filters']=_[_0x3d4a('0x33')](_0x469cfb[_0x3d4a('0x30')],_0x469cfb['query']);_0x1344a8[_0x3d4a('0x35')]=_[_0x3d4a('0x33')](_0x469cfb['model'],qs['fields'](_0x491d09[_0x3d4a('0x34')][_0x3d4a('0x36')]));_0x1344a8[_0x3d4a('0x35')]=_0x1344a8[_0x3d4a('0x35')][_0x3d4a('0x48')]?_0x1344a8[_0x3d4a('0x35')]:_0x469cfb[_0x3d4a('0x30')];if(_0x491d09[_0x3d4a('0x34')][_0x3d4a('0x42')]){_0x1344a8['include']=[{'all':!![]}];}_0x1344a8=_[_0x3d4a('0x3e')]({},_0x1344a8,_0x491d09[_0x3d4a('0x40')]);return db[_0x3d4a('0x41')]['find'](_0x1344a8)[_0x3d4a('0x25')](handleEntityNotFound(_0x28ed31,null))['then'](respondWithResult(_0x28ed31,null))[_0x3d4a('0x45')](handleError(_0x28ed31,null));};exports[_0x3d4a('0x49')]=function(_0x101788,_0x28afba){return db[_0x3d4a('0x41')][_0x3d4a('0x49')](_0x101788[_0x3d4a('0x4a')],{})[_0x3d4a('0x25')](respondWithResult(_0x28afba,0xc9))['catch'](handleError(_0x28afba,null));};exports[_0x3d4a('0x23')]=function(_0x313c70,_0x3f1656){if(_0x313c70['body']['id']){delete _0x313c70[_0x3d4a('0x4a')]['id'];}return db['ZohoAccount'][_0x3d4a('0x4b')]({'where':{'id':_0x313c70[_0x3d4a('0x47')]['id']}})[_0x3d4a('0x25')](handleEntityNotFound(_0x3f1656,null))['then'](saveUpdates(_0x313c70['body'],null))['then'](respondWithResult(_0x3f1656,null))[_0x3d4a('0x45')](handleError(_0x3f1656,null));};exports[_0x3d4a('0x24')]=function(_0x24ea72,_0x56317e){return db[_0x3d4a('0x41')][_0x3d4a('0x4b')]({'where':{'id':_0x24ea72[_0x3d4a('0x47')]['id']}})[_0x3d4a('0x25')](handleEntityNotFound(_0x56317e,null))[_0x3d4a('0x25')](removeEntity(_0x56317e,null))[_0x3d4a('0x45')](handleError(_0x56317e,null));};exports[_0x3d4a('0x4c')]=function(_0x3380f3,_0x5a6a9a,_0x2507bf){var _0x1d3729={};var _0x3f02cf={};var _0x17dc82;var _0x506385;return db[_0x3d4a('0x41')][_0x3d4a('0x4d')]({'where':{'id':_0x3380f3[_0x3d4a('0x47')]['id']}})[_0x3d4a('0x25')](handleEntityNotFound(_0x5a6a9a,null))['then'](function(_0x240e1f){if(_0x240e1f){_0x17dc82=_0x240e1f;_0x3f02cf[_0x3d4a('0x30')]=_[_0x3d4a('0x31')](db[_0x3d4a('0x4e')]['rawAttributes']);_0x3f02cf[_0x3d4a('0x34')]=_[_0x3d4a('0x31')](_0x3380f3[_0x3d4a('0x34')]);_0x3f02cf[_0x3d4a('0x32')]=_[_0x3d4a('0x33')](_0x3f02cf[_0x3d4a('0x30')],_0x3f02cf[_0x3d4a('0x34')]);_0x1d3729['attributes']=_[_0x3d4a('0x33')](_0x3f02cf['model'],qs[_0x3d4a('0x36')](_0x3380f3[_0x3d4a('0x34')][_0x3d4a('0x36')]));_0x1d3729[_0x3d4a('0x35')]=_0x1d3729['attributes']['length']?_0x1d3729[_0x3d4a('0x35')]:_0x3f02cf[_0x3d4a('0x30')];_0x1d3729[_0x3d4a('0x39')]=qs[_0x3d4a('0x3a')](_0x3380f3[_0x3d4a('0x34')]['sort']);_0x1d3729[_0x3d4a('0x3d')]=qs[_0x3d4a('0x32')](_['pick'](_0x3380f3['query'],_0x3f02cf[_0x3d4a('0x32')]));if(_0x3380f3[_0x3d4a('0x34')][_0x3d4a('0x3c')]){_0x1d3729[_0x3d4a('0x3d')]=_[_0x3d4a('0x3e')](_0x1d3729['where'],{'$or':_[_0x3d4a('0x2b')](_0x1d3729[_0x3d4a('0x35')],function(_0x5bbd5b){var _0x13997d={};_0x13997d[_0x5bbd5b]={'$like':'%'+_0x3380f3[_0x3d4a('0x34')][_0x3d4a('0x3c')]+'%'};return _0x13997d;})});}_0x1d3729=_[_0x3d4a('0x3e')]({},_0x1d3729,_0x3380f3[_0x3d4a('0x40')]);return _0x17dc82[_0x3d4a('0x4c')](_0x1d3729);}})[_0x3d4a('0x25')](function(_0xe5de72){if(_0xe5de72){_0x506385=_0xe5de72[_0x3d4a('0x48')];if(!_0x3380f3['query']['hasOwnProperty'](_0x3d4a('0x38'))){_0x1d3729[_0x3d4a('0x1c')]=qs['limit'](_0x3380f3[_0x3d4a('0x34')]['limit']);_0x1d3729[_0x3d4a('0x1a')]=qs[_0x3d4a('0x1a')](_0x3380f3['query'][_0x3d4a('0x1a')]);}return _0x17dc82[_0x3d4a('0x4c')](_0x1d3729);}})[_0x3d4a('0x25')](function(_0x5ce7d1){if(_0x5ce7d1){return _0x5ce7d1?{'count':_0x506385,'rows':_0x5ce7d1}:null;}})['then'](respondWithResult(_0x5a6a9a,null))[_0x3d4a('0x45')](handleError(_0x5a6a9a,null));};exports[_0x3d4a('0x4f')]=function(_0x9e9eba,_0x5aff07,_0x126872){if(_0x9e9eba[_0x3d4a('0x4a')]['id']){delete _0x9e9eba['body']['id'];}return db[_0x3d4a('0x41')][_0x3d4a('0x4d')]({'where':{'id':_0x9e9eba[_0x3d4a('0x47')]['id']}})[_0x3d4a('0x25')](handleEntityNotFound(_0x5aff07,null))[_0x3d4a('0x25')](function(_0x4b3817){if(_0x4b3817){_0x9e9eba[_0x3d4a('0x4a')]['AccountId']=_0x4b3817['id'];_0x9e9eba[_0x3d4a('0x4a')][_0x3d4a('0x50')]=integrations['getSubjects'](_0x9e9eba[_0x3d4a('0x4a')]['channel'],_0x9e9eba[_0x3d4a('0x4a')][_0x3d4a('0x2e')]);_0x9e9eba[_0x3d4a('0x4a')][_0x3d4a('0x51')]=integrations[_0x3d4a('0x52')](_0x9e9eba[_0x3d4a('0x4a')][_0x3d4a('0x53')],_0x9e9eba['body'][_0x3d4a('0x2e')]);return db[_0x3d4a('0x4e')][_0x3d4a('0x49')](_0x9e9eba[_0x3d4a('0x4a')],{'include':[{'model':db[_0x3d4a('0x54')],'as':_0x3d4a('0x50')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5aff07,null))[_0x3d4a('0x45')](handleError(_0x5aff07,null));};function getAccessToken(_0x424a82){return new Promise(function(_0x205535,_0x2b111b){var _0x1c913c;switch(_0x424a82['zone']){case'US':_0x1c913c=_0x3d4a('0x55');break;case'AU':_0x1c913c=_0x3d4a('0x56');break;case'EU':_0x1c913c=_0x3d4a('0x57');break;case'IN':_0x1c913c=_0x3d4a('0x58');break;case'CN':_0x1c913c=_0x3d4a('0x59');break;default:_0x1c913c=_0x3d4a('0x57');break;}var _0x51d9e6={'method':_0x3d4a('0x5a'),'uri':_0x1c913c+_0x3d4a('0x5b'),'qs':{'refresh_token':_0x424a82[_0x3d4a('0x5c')],'client_id':_0x424a82[_0x3d4a('0x5d')],'client_secret':_0x424a82['clientSecret'],'grant_type':_0x3d4a('0x5e')},'json':!![]};return rp(_0x51d9e6)[_0x3d4a('0x25')](function(_0x2f85de){if(_0x2f85de[_0x3d4a('0x5f')]){_0x205535(_0x2f85de[_0x3d4a('0x5f')]);}else{_0x2b111b(_0x3d4a('0x60'));}})[_0x3d4a('0x45')](function(_0xd38f2e){_0x2b111b(_0xd38f2e);});});}exports[_0x3d4a('0x61')]=function(_0x104a4f,_0x1dc770,_0x3a8927){var _0x3d9eb2,_0x379b23,_0x41a7a1,_0x3adfbd,_0x3bc34a;return db['ZohoAccount'][_0x3d4a('0x4d')]({'where':{'id':_0x104a4f[_0x3d4a('0x47')]['id']},'attributes':['id',_0x3d4a('0x62'),_0x3d4a('0x63'),_0x3d4a('0x5d'),_0x3d4a('0x64'),_0x3d4a('0x65'),_0x3d4a('0x66'),_0x3d4a('0x5c')]})['then'](handleEntityNotFound(_0x1dc770,null))[_0x3d4a('0x25')](function(_0x70f112){_0x3bc34a=_0x70f112;_0x3d9eb2=_0x3bc34a[_0x3d4a('0x62')];_0x379b23=_0x3d9eb2===_0x3d4a('0x67')?'eu':_0x3d4a('0x68');_0x41a7a1=_0x3bc34a['serverUrl'];var _0x421777=_0x41a7a1['slice'](-0x1);if(_0x421777==='/'||_0x421777==='\x5c'||_0x421777===':'){_0x41a7a1=_0x41a7a1[_0x3d4a('0x69')](0x0,_0x41a7a1[_0x3d4a('0x6a')](_0x421777));}if(!_0x3bc34a[_0x3d4a('0x5c')]){throw new Error(_0x3d4a('0x6b'));}return getAccessToken(_0x3bc34a);})[_0x3d4a('0x25')](function(_0x4d8988){if(_0x4d8988){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x379b23),'qs':{'module':_0x3d4a('0x6c')},'headers':{'Authorization':_0x3d4a('0x6d')+_0x4d8988},'json':!![]});}})[_0x3d4a('0x25')](function(_0x9d14fd){if(_0x9d14fd){if(_0x9d14fd[_0x3d4a('0x6e')]&&_0x9d14fd[_0x3d4a('0x6e')][_0x3d4a('0x26')]){throw new Error(_0x9d14fd[_0x3d4a('0x6e')][_0x3d4a('0x26')]['message']);}var _0x20ef85=[];var _0x22a75b=[];var _0x5217fa=[_0x3d4a('0x6f'),'Subject',_0x3d4a('0x70'),_0x3d4a('0x71'),'Call_Duration','Call_Result',_0x3d4a('0x72'),'Call_Type'];_0x22a75b=_[_0x3d4a('0x73')](_0x9d14fd[_0x3d4a('0x36')],function(_0x129490){return _0x5217fa[_0x3d4a('0x74')](_0x129490[_0x3d4a('0x75')]);});for(var _0x46ddb6=0x0;_0x46ddb6<_0x22a75b[_0x3d4a('0x48')];_0x46ddb6++){if(_0x22a75b[_0x46ddb6][_0x3d4a('0x76')]===![]){_0x20ef85[_0x3d4a('0x77')]({'id':_0x22a75b[_0x46ddb6]['id'],'name':_0x22a75b[_0x46ddb6][_0x3d4a('0x78')],'custom':_0x22a75b[_0x46ddb6]['custom_field'],'options':_0x22a75b[_0x46ddb6][_0x3d4a('0x79')]==='picklist'&&_0x22a75b[_0x46ddb6]['pick_list_values'][_0x3d4a('0x48')]>-0x1?_[_0x3d4a('0x2b')](_0x22a75b[_0x46ddb6]['pick_list_values'],function(_0x360b84){return{'name':_0x360b84,'value':_0x360b84};}):[]});}}return{'count':_0x20ef85[_0x3d4a('0x48')],'rows':_0x20ef85};}else{return{'count':0x0,'rows':[]};}})[_0x3d4a('0x25')](respondWithResult(_0x1dc770,null))[_0x3d4a('0x45')](function(_0x57241a){var _0x6bfd44=_0x104a4f[_0x3d4a('0x34')][_0x3d4a('0x7a')]?0x1f4:_0x57241a[_0x3d4a('0x7b')]||0x1f4;logger[_0x3d4a('0x26')](_0x3d4a('0x7c'),'getFields',_0x6bfd44,JSON[_0x3d4a('0x7d')](_0x57241a));delete _0x57241a['name'];if(_0x6bfd44===0x191){_0x6bfd44=0x190;}_0x1dc770[_0x3d4a('0x19')](_0x6bfd44)[_0x3d4a('0x29')](_0x104a4f[_0x3d4a('0x34')][_0x3d4a('0x7a')]?{'message':_0x3d4a('0x7e'),'statusCode':_0x57241a[_0x3d4a('0x7b')]}:_0x57241a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 816fcb5..9dbfcb7 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 _0xaa0a=['inspect','zone','code','slice','https://accounts.zoho.com','parse','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','refresh_token','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x5873f6,_0x32ad29){var _0x1da8ea=function(_0x32d5be){while(--_0x32d5be){_0x5873f6['push'](_0x5873f6['shift']());}};_0x1da8ea(++_0x32ad29);}(_0xaa0a,0x100));var _0xaaa0=function(_0x3266d4,_0xf3a96e){_0x3266d4=_0x3266d4-0x0;var _0x2b2e38=_0xaa0a[_0x3266d4];return _0x2b2e38;};'use strict';var _=require(_0xaaa0('0x0'));var util=require(_0xaaa0('0x1'));var logger=require(_0xaaa0('0x2'))('api');var moment=require(_0xaaa0('0x3'));var BPromise=require(_0xaaa0('0x4'));var rp=require(_0xaaa0('0x5'));var fs=require('fs');var path=require(_0xaaa0('0x6'));var rimraf=require(_0xaaa0('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xaaa0('0x8')]=function(_0x3dc198,_0x3609e4){return _0x3dc198['define'](_0xaaa0('0x9'),attributes,{'tableName':_0xaaa0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27851e,_0x4942dc,_0x757b60){if(_0x27851e[_0xaaa0('0xb')]('zone')||_0x27851e[_0xaaa0('0xb')]('serverUrl')||_0x27851e['changed'](_0xaaa0('0xc'))||_0x27851e[_0xaaa0('0xb')](_0xaaa0('0xd'))||_0x27851e[_0xaaa0('0xb')]('code')||_0x27851e['changed'](_0xaaa0('0xe'))){var _0xa936d3,_0x28ed88;_0xa936d3=_0x27851e[_0xaaa0('0xf')];var _0x2307c1=_0xa936d3['slice'](-0x1);if(_0x2307c1==='/'||_0x2307c1==='\x5c'||_0x2307c1===':'){_0xa936d3=_0xa936d3[_0xaaa0('0x10')](0x0,_0xa936d3[_0xaaa0('0x11')](_0x2307c1));}switch(_0x27851e['zone']){case'US':_0x28ed88='https://accounts.zoho.com';break;case'AU':_0x28ed88=_0xaaa0('0x12');break;case'IN':_0x28ed88=_0xaaa0('0x13');break;case'CN':_0x28ed88=_0xaaa0('0x14');break;default:_0x28ed88=_0xaaa0('0x15');break;}var _0x4a70d2={'method':_0xaaa0('0x16'),'uri':_0x28ed88+'/oauth/v2/token','form':{'grant_type':_0xaaa0('0x17'),'client_id':_0x27851e['clientId'],'client_secret':_0x27851e[_0xaaa0('0xd')],'redirect_uri':_0x27851e['serverUrl'],'code':_0x27851e['code']},'headers':{'Content-Type':_0xaaa0('0x18')}};return rp(_0x4a70d2)[_0xaaa0('0x19')](function(_0x3da33c){var _0x2d723d=JSON['parse'](_0x3da33c);if(_0x2d723d[_0xaaa0('0x1a')]){_0x27851e['refreshToken']=_0x2d723d[_0xaaa0('0x1a')];logger['info'](util[_0xaaa0('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x27851e[_0xaaa0('0x1c')],_0x27851e['id']));}else{logger[_0xaaa0('0x1d')](util[_0xaaa0('0x1b')](_0xaaa0('0x1e'),_0x27851e[_0xaaa0('0x1c')],_0x27851e['id']),util[_0xaaa0('0x1f')](_0x2d723d,{'showHidden':![],'depth':null}));}return _0x757b60(null,_0x4942dc);})['catch'](function(_0x2ca15b){logger[_0xaaa0('0x1d')](util['format'](_0xaaa0('0x1e'),_0x27851e[_0xaaa0('0x1c')],_0x27851e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x757b60(_0x2ca15b);});}else{return _0x757b60(null,_0x4942dc);}},'beforeUpdate':function(_0x554b8d,_0x3673ef,_0x205ed6){if(_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0x20'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xf'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xc'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xd'))||_0x554b8d['changed'](_0xaaa0('0x21'))||_0x554b8d[_0xaaa0('0xb')](_0xaaa0('0xe'))){var _0x24372d,_0x510afd;_0x24372d=_0x554b8d[_0xaaa0('0xf')];var _0x4b67f7=_0x24372d[_0xaaa0('0x22')](-0x1);if(_0x4b67f7==='/'||_0x4b67f7==='\x5c'||_0x4b67f7===':'){_0x24372d=_0x24372d['substring'](0x0,_0x24372d['lastIndexOf'](_0x4b67f7));}switch(_0x554b8d[_0xaaa0('0x20')]){case'US':_0x510afd=_0xaaa0('0x23');break;case'AU':_0x510afd=_0xaaa0('0x12');break;case'IN':_0x510afd=_0xaaa0('0x13');break;case'CN':_0x510afd=_0xaaa0('0x14');break;default:_0x510afd='https://accounts.zoho.eu';break;}var _0x344220={'method':_0xaaa0('0x16'),'uri':_0x510afd+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x554b8d[_0xaaa0('0xc')],'client_secret':_0x554b8d[_0xaaa0('0xd')],'redirect_uri':_0x554b8d['serverUrl'],'code':_0x554b8d[_0xaaa0('0x21')]},'headers':{'Content-Type':_0xaaa0('0x18')}};return rp(_0x344220)[_0xaaa0('0x19')](function(_0x785848){var _0x4d63fa=JSON[_0xaaa0('0x24')](_0x785848);if(_0x4d63fa[_0xaaa0('0x1a')]){_0x554b8d[_0xaaa0('0x25')]=_0x4d63fa[_0xaaa0('0x1a')];logger[_0xaaa0('0x26')](util[_0xaaa0('0x1b')](_0xaaa0('0x27'),_0x554b8d[_0xaaa0('0x1c')],_0x554b8d['id']));}else{logger[_0xaaa0('0x1d')](util['format'](_0xaaa0('0x1e'),_0x554b8d[_0xaaa0('0x1c')],_0x554b8d['id']),util[_0xaaa0('0x1f')](_0x4d63fa,{'showHidden':![],'depth':null}));}return _0x205ed6(null,_0x3673ef);})[_0xaaa0('0x28')](function(_0x2d3c55){logger['error'](util['format'](_0xaaa0('0x1e'),_0x554b8d[_0xaaa0('0x1c')],_0x554b8d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x205ed6(_0x2d3c55);});}else{return _0x205ed6(null,_0x3673ef);}}}});}; \ No newline at end of file +var _0xbe88=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','api','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','substring','https://accounts.zoho.in','then','parse'];(function(_0x149cbe,_0x343453){var _0x1ccebd=function(_0x5b41a2){while(--_0x5b41a2){_0x149cbe['push'](_0x149cbe['shift']());}};_0x1ccebd(++_0x343453);}(_0xbe88,0x17c));var _0x8be8=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xbe88[_0x213ed5];return _0x191514;};'use strict';var _=require(_0x8be8('0x0'));var util=require(_0x8be8('0x1'));var logger=require('../../config/logger')(_0x8be8('0x2'));var moment=require(_0x8be8('0x3'));var BPromise=require(_0x8be8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8be8('0x5'));var rimraf=require('rimraf');var config=require(_0x8be8('0x6'));var attributes=require(_0x8be8('0x7'));var integrations=require(_0x8be8('0x8'));module[_0x8be8('0x9')]=function(_0xcfe9fc,_0x57e9a3){return _0xcfe9fc['define'](_0x8be8('0xa'),attributes,{'tableName':_0x8be8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3992a5,_0x9301eb,_0x938ee2){if(_0x3992a5[_0x8be8('0xc')](_0x8be8('0xd'))||_0x3992a5[_0x8be8('0xc')](_0x8be8('0xe'))||_0x3992a5[_0x8be8('0xc')](_0x8be8('0xf'))||_0x3992a5[_0x8be8('0xc')](_0x8be8('0x10'))||_0x3992a5[_0x8be8('0xc')](_0x8be8('0x11'))||_0x3992a5['changed'](_0x8be8('0x12'))){var _0x4d2e22,_0x540711;_0x4d2e22=_0x3992a5[_0x8be8('0xe')];var _0x1312a1=_0x4d2e22[_0x8be8('0x13')](-0x1);if(_0x1312a1==='/'||_0x1312a1==='\x5c'||_0x1312a1===':'){_0x4d2e22=_0x4d2e22['substring'](0x0,_0x4d2e22[_0x8be8('0x14')](_0x1312a1));}switch(_0x3992a5['zone']){case'US':_0x540711=_0x8be8('0x15');break;case'AU':_0x540711=_0x8be8('0x16');break;case'IN':_0x540711='https://accounts.zoho.in';break;case'CN':_0x540711=_0x8be8('0x17');break;default:_0x540711='https://accounts.zoho.eu';break;}var _0x45074b={'method':_0x8be8('0x18'),'uri':_0x540711+_0x8be8('0x19'),'form':{'grant_type':_0x8be8('0x1a'),'client_id':_0x3992a5[_0x8be8('0xf')],'client_secret':_0x3992a5['clientSecret'],'redirect_uri':_0x3992a5[_0x8be8('0xe')],'code':_0x3992a5[_0x8be8('0x11')]},'headers':{'Content-Type':_0x8be8('0x1b')}};return rp(_0x45074b)['then'](function(_0x88f83c){var _0xd3dbf3=JSON['parse'](_0x88f83c);if(_0xd3dbf3[_0x8be8('0x1c')]){_0x3992a5[_0x8be8('0x1d')]=_0xd3dbf3[_0x8be8('0x1c')];logger[_0x8be8('0x1e')](util[_0x8be8('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3992a5[_0x8be8('0x20')],_0x3992a5['id']));}else{logger[_0x8be8('0x21')](util[_0x8be8('0x1f')](_0x8be8('0x22'),_0x3992a5[_0x8be8('0x20')],_0x3992a5['id']),util[_0x8be8('0x23')](_0xd3dbf3,{'showHidden':![],'depth':null}));}return _0x938ee2(null,_0x9301eb);})['catch'](function(_0x70f11d){logger[_0x8be8('0x21')](util[_0x8be8('0x1f')](_0x8be8('0x22'),_0x3992a5[_0x8be8('0x20')],_0x3992a5['id']),util[_0x8be8('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x938ee2(_0x70f11d);});}else{return _0x938ee2(null,_0x9301eb);}},'beforeUpdate':function(_0x1977ef,_0x5bbb21,_0x266dd2){if(_0x1977ef[_0x8be8('0xc')](_0x8be8('0xd'))||_0x1977ef['changed'](_0x8be8('0xe'))||_0x1977ef['changed']('clientId')||_0x1977ef[_0x8be8('0xc')](_0x8be8('0x10'))||_0x1977ef[_0x8be8('0xc')](_0x8be8('0x11'))||_0x1977ef['changed']('host')){var _0x249752,_0xf0dc15;_0x249752=_0x1977ef[_0x8be8('0xe')];var _0x3c8e0f=_0x249752[_0x8be8('0x13')](-0x1);if(_0x3c8e0f==='/'||_0x3c8e0f==='\x5c'||_0x3c8e0f===':'){_0x249752=_0x249752[_0x8be8('0x24')](0x0,_0x249752[_0x8be8('0x14')](_0x3c8e0f));}switch(_0x1977ef[_0x8be8('0xd')]){case'US':_0xf0dc15=_0x8be8('0x15');break;case'AU':_0xf0dc15=_0x8be8('0x16');break;case'IN':_0xf0dc15=_0x8be8('0x25');break;case'CN':_0xf0dc15='https://accounts.zoho.com.cn';break;default:_0xf0dc15='https://accounts.zoho.eu';break;}var _0x1c73c0={'method':_0x8be8('0x18'),'uri':_0xf0dc15+_0x8be8('0x19'),'form':{'grant_type':_0x8be8('0x1a'),'client_id':_0x1977ef[_0x8be8('0xf')],'client_secret':_0x1977ef[_0x8be8('0x10')],'redirect_uri':_0x1977ef[_0x8be8('0xe')],'code':_0x1977ef['code']},'headers':{'Content-Type':_0x8be8('0x1b')}};return rp(_0x1c73c0)[_0x8be8('0x26')](function(_0x173513){var _0x5c90e4=JSON[_0x8be8('0x27')](_0x173513);if(_0x5c90e4[_0x8be8('0x1c')]){_0x1977ef['refreshToken']=_0x5c90e4[_0x8be8('0x1c')];logger['info'](util[_0x8be8('0x1f')](_0x8be8('0x28'),_0x1977ef[_0x8be8('0x20')],_0x1977ef['id']));}else{logger[_0x8be8('0x21')](util['format'](_0x8be8('0x22'),_0x1977ef[_0x8be8('0x20')],_0x1977ef['id']),util['inspect'](_0x5c90e4,{'showHidden':![],'depth':null}));}return _0x266dd2(null,_0x5bbb21);})[_0x8be8('0x29')](function(_0x221873){logger[_0x8be8('0x21')](util['format'](_0x8be8('0x22'),_0x1977ef[_0x8be8('0x20')],_0x1977ef['id']),util[_0x8be8('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x266dd2(_0x221873);});}else{return _0x266dd2(null,_0x5bbb21);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index dedfd3f..838abfe 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 _0x4d68=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','limit','include','attributes','map','model','ShowZohoAccount','find','raw','then','lodash','util','moment','bluebird'];(function(_0xe402c4,_0x2b8ed5){var _0x5b0ef7=function(_0xbe0a8d){while(--_0xbe0a8d){_0xe402c4['push'](_0xe402c4['shift']());}};_0x5b0ef7(++_0x2b8ed5);}(_0x4d68,0x1c3));var _0x84d6=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x4d68[_0x528497];return _0x392d59;};'use strict';var _=require(_0x84d6('0x0'));var util=require(_0x84d6('0x1'));var moment=require(_0x84d6('0x2'));var BPromise=require(_0x84d6('0x3'));var rs=require(_0x84d6('0x4'));var fs=require('fs');var Redis=require(_0x84d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84d6('0x6'));var logger=require('../../config/logger')(_0x84d6('0x7'));var config=require('../../config/environment');var jayson=require(_0x84d6('0x8'));var client=jayson[_0x84d6('0x9')][_0x84d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539e34,_0x561dd8,_0x218daf){return new BPromise(function(_0xa64ed3,_0x260859){return client[_0x84d6('0xb')](_0x539e34,_0x218daf)['then'](function(_0x411c7f){logger['info'](_0x84d6('0xc'),_0x561dd8,_0x84d6('0xd'));logger[_0x84d6('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x561dd8,'request\x20sent',JSON[_0x84d6('0xf')](_0x411c7f));if(_0x411c7f['error']){if(_0x411c7f[_0x84d6('0x10')][_0x84d6('0x11')]===0x1f4){logger[_0x84d6('0x10')](_0x84d6('0xc'),_0x561dd8,_0x411c7f[_0x84d6('0x10')]['message']);return _0x260859(_0x411c7f[_0x84d6('0x10')]['message']);}logger[_0x84d6('0x10')](_0x84d6('0xc'),_0x561dd8,_0x411c7f[_0x84d6('0x10')][_0x84d6('0x12')]);return _0xa64ed3(_0x411c7f[_0x84d6('0x10')][_0x84d6('0x12')]);}else{logger[_0x84d6('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x561dd8,_0x84d6('0xd'));_0xa64ed3(_0x411c7f[_0x84d6('0x14')][_0x84d6('0x12')]);}})[_0x84d6('0x15')](function(_0x385e2b){logger['error'](_0x84d6('0xc'),_0x561dd8,_0x385e2b);_0x260859(_0x385e2b);});});}exports[_0x84d6('0x16')]=function(_0x579aa8){var _0x1bd84a=this;return new Promise(function(_0x47a884,_0x309f26){return db[_0x84d6('0x17')][_0x84d6('0x18')]({'raw':_0x579aa8[_0x84d6('0x19')]?_0x579aa8[_0x84d6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x579aa8[_0x84d6('0x19')]?_0x579aa8[_0x84d6('0x19')]['where']||null:null,'attributes':_0x579aa8['options']?_0x579aa8[_0x84d6('0x19')]['attributes']||null:null,'limit':_0x579aa8['options']?_0x579aa8[_0x84d6('0x19')][_0x84d6('0x1a')]||null:null,'include':_0x579aa8[_0x84d6('0x19')]?_0x579aa8['options'][_0x84d6('0x1b')]?_['map'](_0x579aa8['options'][_0x84d6('0x1b')],function(_0x1b86f2){return{'model':db[_0x1b86f2['model']],'as':_0x1b86f2['as'],'attributes':_0x1b86f2[_0x84d6('0x1c')],'include':_0x1b86f2[_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x1b86f2[_0x84d6('0x1b')],function(_0x5deaa5){return{'model':db[_0x5deaa5[_0x84d6('0x1e')]],'as':_0x5deaa5['as'],'attributes':_0x5deaa5['attributes'],'include':_0x5deaa5[_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x5deaa5['include'],function(_0x500a81){return{'model':db[_0x500a81[_0x84d6('0x1e')]],'as':_0x500a81['as'],'attributes':_0x500a81['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14eec8){logger['info'](_0x84d6('0x16'),_0x579aa8);logger['debug'](_0x84d6('0x16'),_0x579aa8,JSON[_0x84d6('0xf')](_0x14eec8));_0x47a884(_0x14eec8);})[_0x84d6('0x15')](function(_0x37adf9){logger[_0x84d6('0x10')](_0x84d6('0x16'),_0x37adf9[_0x84d6('0x12')],_0x579aa8);_0x309f26(_0x1bd84a[_0x84d6('0x10')](0x1f4,_0x37adf9[_0x84d6('0x12')]));});});};exports[_0x84d6('0x1f')]=function(_0x20c27b){var _0x1fa278=this;return new Promise(function(_0x56bc23,_0x2f60f1){return db[_0x84d6('0x17')][_0x84d6('0x20')]({'raw':_0x20c27b[_0x84d6('0x19')]?_0x20c27b[_0x84d6('0x19')][_0x84d6('0x21')]===undefined?!![]:![]:!![],'where':_0x20c27b[_0x84d6('0x19')]?_0x20c27b[_0x84d6('0x19')]['where']||null:null,'attributes':_0x20c27b[_0x84d6('0x19')]?_0x20c27b['options'][_0x84d6('0x1c')]||null:null,'include':_0x20c27b[_0x84d6('0x19')]?_0x20c27b['options'][_0x84d6('0x1b')]?_[_0x84d6('0x1d')](_0x20c27b['options'][_0x84d6('0x1b')],function(_0x6c3a2a){return{'model':db[_0x6c3a2a[_0x84d6('0x1e')]],'as':_0x6c3a2a['as'],'attributes':_0x6c3a2a[_0x84d6('0x1c')],'include':_0x6c3a2a[_0x84d6('0x1b')]?_['map'](_0x6c3a2a[_0x84d6('0x1b')],function(_0xf8d313){return{'model':db[_0xf8d313[_0x84d6('0x1e')]],'as':_0xf8d313['as'],'attributes':_0xf8d313['attributes'],'include':_0xf8d313[_0x84d6('0x1b')]?_['map'](_0xf8d313[_0x84d6('0x1b')],function(_0x525b56){return{'model':db[_0x525b56['model']],'as':_0x525b56['as'],'attributes':_0x525b56[_0x84d6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x84d6('0x22')](function(_0x45b55f){logger['info'](_0x84d6('0x1f'),_0x20c27b);logger[_0x84d6('0xe')](_0x84d6('0x1f'),_0x20c27b,JSON['stringify'](_0x45b55f));_0x56bc23(_0x45b55f);})['catch'](function(_0x531a49){logger[_0x84d6('0x10')](_0x84d6('0x1f'),_0x531a49[_0x84d6('0x12')],_0x20c27b);_0x2f60f1(_0x1fa278[_0x84d6('0x10')](0x1f4,_0x531a49[_0x84d6('0x12')]));});});}; \ No newline at end of file +var _0x7880=['http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','find','ShowZohoAccount','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x27c2fd,_0x3b665d){var _0x3604ee=function(_0x2cf361){while(--_0x2cf361){_0x27c2fd['push'](_0x27c2fd['shift']());}};_0x3604ee(++_0x3b665d);}(_0x7880,0x10f));var _0x0788=function(_0x3760f1,_0x498373){_0x3760f1=_0x3760f1-0x0;var _0x14d886=_0x7880[_0x3760f1];return _0x14d886;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');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('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});}exports['GetZohoAccount']=function(_0x5e9ea6){var _0x1700b5=this;return new Promise(function(_0xf82fbc,_0x5ce32d){return db[_0x0788('0x15')][_0x0788('0x16')]({'raw':_0x5e9ea6[_0x0788('0x17')]?_0x5e9ea6[_0x0788('0x17')][_0x0788('0x18')]===undefined?!![]:![]:!![],'where':_0x5e9ea6[_0x0788('0x17')]?_0x5e9ea6[_0x0788('0x17')][_0x0788('0x19')]||null:null,'attributes':_0x5e9ea6['options']?_0x5e9ea6[_0x0788('0x17')][_0x0788('0x1a')]||null:null,'limit':_0x5e9ea6[_0x0788('0x17')]?_0x5e9ea6[_0x0788('0x17')][_0x0788('0x1b')]||null:null,'include':_0x5e9ea6[_0x0788('0x17')]?_0x5e9ea6[_0x0788('0x17')]['include']?_[_0x0788('0x1c')](_0x5e9ea6[_0x0788('0x17')][_0x0788('0x1d')],function(_0xefb51d){return{'model':db[_0xefb51d['model']],'as':_0xefb51d['as'],'attributes':_0xefb51d['attributes'],'include':_0xefb51d[_0x0788('0x1d')]?_[_0x0788('0x1c')](_0xefb51d['include'],function(_0xac4f64){return{'model':db[_0xac4f64[_0x0788('0x1e')]],'as':_0xac4f64['as'],'attributes':_0xac4f64['attributes'],'include':_0xac4f64[_0x0788('0x1d')]?_[_0x0788('0x1c')](_0xac4f64[_0x0788('0x1d')],function(_0x20da9f){return{'model':db[_0x20da9f['model']],'as':_0x20da9f['as'],'attributes':_0x20da9f[_0x0788('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x497af4){logger[_0x0788('0xc')](_0x0788('0x1f'),_0x5e9ea6);logger[_0x0788('0xf')](_0x0788('0x1f'),_0x5e9ea6,JSON['stringify'](_0x497af4));_0xf82fbc(_0x497af4);})['catch'](function(_0x5b3352){logger[_0x0788('0x12')](_0x0788('0x1f'),_0x5b3352['message'],_0x5e9ea6);_0x5ce32d(_0x1700b5[_0x0788('0x12')](0x1f4,_0x5b3352[_0x0788('0x13')]));});});};exports['ShowZohoAccount']=function(_0x29c442){var _0x5584a5=this;return new Promise(function(_0x7dd5b9,_0x4a08b2){return db[_0x0788('0x15')][_0x0788('0x20')]({'raw':_0x29c442[_0x0788('0x17')]?_0x29c442['options']['raw']===undefined?!![]:![]:!![],'where':_0x29c442[_0x0788('0x17')]?_0x29c442[_0x0788('0x17')][_0x0788('0x19')]||null:null,'attributes':_0x29c442['options']?_0x29c442[_0x0788('0x17')]['attributes']||null:null,'include':_0x29c442[_0x0788('0x17')]?_0x29c442[_0x0788('0x17')][_0x0788('0x1d')]?_[_0x0788('0x1c')](_0x29c442[_0x0788('0x17')][_0x0788('0x1d')],function(_0x4831be){return{'model':db[_0x4831be[_0x0788('0x1e')]],'as':_0x4831be['as'],'attributes':_0x4831be[_0x0788('0x1a')],'include':_0x4831be[_0x0788('0x1d')]?_[_0x0788('0x1c')](_0x4831be[_0x0788('0x1d')],function(_0x296b8d){return{'model':db[_0x296b8d[_0x0788('0x1e')]],'as':_0x296b8d['as'],'attributes':_0x296b8d[_0x0788('0x1a')],'include':_0x296b8d[_0x0788('0x1d')]?_[_0x0788('0x1c')](_0x296b8d[_0x0788('0x1d')],function(_0x5f5a35){return{'model':db[_0x5f5a35[_0x0788('0x1e')]],'as':_0x5f5a35['as'],'attributes':_0x5f5a35[_0x0788('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0788('0xb')](function(_0x17c6c3){logger[_0x0788('0xc')](_0x0788('0x21'),_0x29c442);logger['debug'](_0x0788('0x21'),_0x29c442,JSON['stringify'](_0x17c6c3));_0x7dd5b9(_0x17c6c3);})[_0x0788('0x22')](function(_0x14ccf8){logger[_0x0788('0x12')]('ShowZohoAccount',_0x14ccf8[_0x0788('0x13')],_0x29c442);_0x4a08b2(_0x5584a5[_0x0788('0x12')](0x1f4,_0x14ccf8['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9f04f39..ab91bd0 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 _0x8761=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy'];(function(_0x272f27,_0x2ad9cd){var _0x121e7a=function(_0x2f5838){while(--_0x2f5838){_0x272f27['push'](_0x272f27['shift']());}};_0x121e7a(++_0x2ad9cd);}(_0x8761,0xb7));var _0x1876=function(_0x394699,_0x2292e6){_0x394699=_0x394699-0x0;var _0x275359=_0x8761[_0x394699];return _0x275359;};'use strict';var multer=require(_0x1876('0x0'));var util=require(_0x1876('0x1'));var path=require('path');var timeout=require(_0x1876('0x2'));var express=require(_0x1876('0x3'));var router=express[_0x1876('0x4')]();var fs_extra=require(_0x1876('0x5'));var auth=require(_0x1876('0x6'));var interaction=require(_0x1876('0x7'));var config=require(_0x1876('0x8'));var controller=require(_0x1876('0x9'));router['get']('/',auth[_0x1876('0xa')](),controller[_0x1876('0xb')]);router[_0x1876('0xc')](_0x1876('0xd'),auth[_0x1876('0xa')](),controller[_0x1876('0xe')]);router['get'](_0x1876('0xf'),auth[_0x1876('0xa')](),controller[_0x1876('0x10')]);router[_0x1876('0xc')]('/:id/subjects',auth[_0x1876('0xa')](),controller[_0x1876('0x11')]);router[_0x1876('0xc')](_0x1876('0x12'),auth['isAuthenticated'](),controller[_0x1876('0x13')]);router[_0x1876('0x14')]('/',auth[_0x1876('0xa')](),controller['create']);router[_0x1876('0x15')](_0x1876('0xd'),auth[_0x1876('0xa')](),controller[_0x1876('0x16')]);router[_0x1876('0x17')](_0x1876('0xd'),auth[_0x1876('0xa')](),controller[_0x1876('0x18')]);module[_0x1876('0x19')]=router; \ No newline at end of file +var _0x631f=['util','path','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports'];(function(_0x5978c1,_0x5d5da8){var _0x31c591=function(_0x8c9e25){while(--_0x8c9e25){_0x5978c1['push'](_0x5978c1['shift']());}};_0x31c591(++_0x5d5da8);}(_0x631f,0x19e));var _0xf631=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x631f[_0x54a9e3];return _0x247cce;};'use strict';var multer=require('multer');var util=require(_0xf631('0x0'));var path=require(_0xf631('0x1'));var timeout=require('connect-timeout');var express=require(_0xf631('0x2'));var router=express[_0xf631('0x3')]();var fs_extra=require(_0xf631('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf631('0x5'));var config=require('../../config/environment');var controller=require(_0xf631('0x6'));router[_0xf631('0x7')]('/',auth['isAuthenticated'](),controller[_0xf631('0x8')]);router[_0xf631('0x7')](_0xf631('0x9'),auth[_0xf631('0xa')](),controller['show']);router[_0xf631('0x7')](_0xf631('0xb'),auth['isAuthenticated'](),controller[_0xf631('0xc')]);router[_0xf631('0x7')](_0xf631('0xd'),auth[_0xf631('0xa')](),controller[_0xf631('0xe')]);router[_0xf631('0x7')](_0xf631('0xf'),auth[_0xf631('0xa')](),controller['getDescriptions']);router[_0xf631('0x10')]('/',auth[_0xf631('0xa')](),controller[_0xf631('0x11')]);router[_0xf631('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf631('0x13')]);router[_0xf631('0x14')](_0xf631('0x9'),auth[_0xf631('0xa')](),controller[_0xf631('0x15')]);module[_0xf631('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index c487127..6d8db7f 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 _0x2498=['sequelize','exports','STRING','ENUM','lead','contact','contact_lead'];(function(_0x471257,_0x1b872c){var _0x464acb=function(_0x2102e5){while(--_0x2102e5){_0x471257['push'](_0x471257['shift']());}};_0x464acb(++_0x1b872c);}(_0x2498,0x1a4));var _0x8249=function(_0x289f76,_0x42163e){_0x289f76=_0x289f76-0x0;var _0x5af847=_0x2498[_0x289f76];return _0x5af847;};'use strict';var Sequelize=require(_0x8249('0x0'));module[_0x8249('0x1')]={'name':{'type':Sequelize[_0x8249('0x2')]},'moduleCreate':{'type':Sequelize[_0x8249('0x3')](_0x8249('0x4'),_0x8249('0x5'),'nothing'),'defaultValue':_0x8249('0x4')},'moduleSearch':{'type':Sequelize[_0x8249('0x3')](_0x8249('0x6'),_0x8249('0x5'),_0x8249('0x4')),'defaultValue':_0x8249('0x6')},'description':{'type':Sequelize[_0x8249('0x2')]}}; \ No newline at end of file +var _0x14c7=['ENUM','contact_lead','sequelize','exports','STRING','lead','contact'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x14c7,0x1d0));var _0x714c=function(_0xb6007a,_0x39a034){_0xb6007a=_0xb6007a-0x0;var _0xfae8f3=_0x14c7[_0xb6007a];return _0xfae8f3;};'use strict';var Sequelize=require(_0x714c('0x0'));module[_0x714c('0x1')]={'name':{'type':Sequelize[_0x714c('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x714c('0x3'),_0x714c('0x4'),'nothing'),'defaultValue':_0x714c('0x3')},'moduleSearch':{'type':Sequelize[_0x714c('0x5')](_0x714c('0x6'),_0x714c('0x4'),_0x714c('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index eff14c4..c97fd04 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 _0x614f=['count','offset','set','Content-Range','apply','then','destroy','end','error','name','send','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','catch','params','rawAttributes','includeAll','include','find','create','body','update','getFields','hasOwnProperty','getSubjects','ZohoField','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x614f,0xd5));var _0xf614=function(_0x2fc491,_0xd072c5){_0x2fc491=_0x2fc491-0x0;var _0x461a07=_0x614f[_0x2fc491];return _0x461a07;};'use strict';var emlformat=require(_0xf614('0x0'));var rimraf=require(_0xf614('0x1'));var zipdir=require(_0xf614('0x2'));var jsonpatch=require(_0xf614('0x3'));var rp=require(_0xf614('0x4'));var moment=require(_0xf614('0x5'));var BPromise=require(_0xf614('0x6'));var Mustache=require(_0xf614('0x7'));var util=require(_0xf614('0x8'));var path=require(_0xf614('0x9'));var sox=require(_0xf614('0xa'));var csv=require(_0xf614('0xb'));var ejs=require(_0xf614('0xc'));var fs=require('fs');var fs_extra=require(_0xf614('0xd'));var _=require('lodash');var squel=require(_0xf614('0xe'));var crypto=require(_0xf614('0xf'));var jsforce=require(_0xf614('0x10'));var deskjs=require(_0xf614('0x11'));var toCsv=require(_0xf614('0xb'));var querystring=require(_0xf614('0x12'));var Papa=require(_0xf614('0x13'));var Redis=require('ioredis');var authService=require(_0xf614('0x14'));var qs=require(_0xf614('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf614('0x16'));var logger=require(_0xf614('0x17'))(_0xf614('0x18'));var utils=require(_0xf614('0x19'));var config=require(_0xf614('0x1a'));var licenseUtil=require(_0xf614('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249022,_0x1f0754){_0x1f0754=_0x1f0754||0xcc;return function(_0x3e9091){if(_0x3e9091){return _0x249022[_0xf614('0x1c')](_0x1f0754);}return _0x249022[_0xf614('0x1d')](_0x1f0754)['end']();};}function respondWithResult(_0xb3f74c,_0x424e44){_0x424e44=_0x424e44||0xc8;return function(_0x3d143f){if(_0x3d143f){return _0xb3f74c[_0xf614('0x1d')](_0x424e44)[_0xf614('0x1e')](_0x3d143f);}};}function respondWithFilteredResult(_0x1cd12d,_0x3558a8){return function(_0xb97853){if(_0xb97853){var _0x4d306f=typeof _0x3558a8['offset']===_0xf614('0x1f')&&typeof _0x3558a8[_0xf614('0x20')]===_0xf614('0x1f');var _0x287e38=_0xb97853[_0xf614('0x21')];var _0x38a71b=_0x4d306f?0x0:_0x3558a8[_0xf614('0x22')];var _0xf95032=_0x4d306f?_0xb97853[_0xf614('0x21')]:_0x3558a8[_0xf614('0x22')]+_0x3558a8['limit'];var _0x5c7843;if(_0xf95032>=_0x287e38){_0xf95032=_0x287e38;_0x5c7843=0xc8;}else{_0x5c7843=0xce;}_0x1cd12d[_0xf614('0x1d')](_0x5c7843);return _0x1cd12d[_0xf614('0x23')](_0xf614('0x24'),_0x38a71b+'-'+_0xf95032+'/'+_0x287e38)[_0xf614('0x1e')](_0xb97853);}return null;};}function patchUpdates(_0x429b68){return function(_0x5a8a6c){try{jsonpatch[_0xf614('0x25')](_0x5a8a6c,_0x429b68,!![]);}catch(_0x30095c){return BPromise['reject'](_0x30095c);}return _0x5a8a6c['save']();};}function saveUpdates(_0x55c18b,_0x1121f6){return function(_0xafbd8d){if(_0xafbd8d){return _0xafbd8d['update'](_0x55c18b)[_0xf614('0x26')](function(_0x127707){return _0x127707;});}return null;};}function removeEntity(_0x1ea59a,_0x278fdf){return function(_0x571624){if(_0x571624){return _0x571624[_0xf614('0x27')]()[_0xf614('0x26')](function(){_0x1ea59a['status'](0xcc)[_0xf614('0x28')]();});}};}function handleEntityNotFound(_0x943b4d,_0x1fe8d){return function(_0x288820){if(!_0x288820){_0x943b4d[_0xf614('0x1c')](0x194);}return _0x288820;};}function handleError(_0x37fecd,_0xaf98a3){_0xaf98a3=_0xaf98a3||0x1f4;return function(_0x2e0b8e){logger[_0xf614('0x29')](_0x2e0b8e['stack']);if(_0x2e0b8e[_0xf614('0x2a')]){delete _0x2e0b8e[_0xf614('0x2a')];}_0x37fecd[_0xf614('0x1d')](_0xaf98a3)[_0xf614('0x2b')](_0x2e0b8e);};}exports['index']=function(_0x4ec155,_0x3ee14c){var _0x332ec8={},_0x2bb7bd={},_0x164449={'count':0x0,'rows':[]};var _0x478071=_[_0xf614('0x2c')](db[_0xf614('0x2d')]['rawAttributes'],function(_0x1a8621){return{'name':_0x1a8621[_0xf614('0x2e')],'type':_0x1a8621[_0xf614('0x2f')][_0xf614('0x30')]};});_0x2bb7bd[_0xf614('0x31')]=_[_0xf614('0x2c')](_0x478071,'name');_0x2bb7bd[_0xf614('0x32')]=_[_0xf614('0x33')](_0x4ec155[_0xf614('0x32')]);_0x2bb7bd[_0xf614('0x34')]=_['intersection'](_0x2bb7bd[_0xf614('0x31')],_0x2bb7bd[_0xf614('0x32')]);_0x332ec8[_0xf614('0x35')]=_[_0xf614('0x36')](_0x2bb7bd[_0xf614('0x31')],qs[_0xf614('0x37')](_0x4ec155[_0xf614('0x32')][_0xf614('0x37')]));_0x332ec8[_0xf614('0x35')]=_0x332ec8[_0xf614('0x35')][_0xf614('0x38')]?_0x332ec8[_0xf614('0x35')]:_0x2bb7bd[_0xf614('0x31')];if(!_0x4ec155[_0xf614('0x32')]['hasOwnProperty'](_0xf614('0x39'))){_0x332ec8[_0xf614('0x20')]=qs['limit'](_0x4ec155[_0xf614('0x32')][_0xf614('0x20')]);_0x332ec8[_0xf614('0x22')]=qs['offset'](_0x4ec155[_0xf614('0x32')]['offset']);}_0x332ec8[_0xf614('0x3a')]=qs['sort'](_0x4ec155['query'][_0xf614('0x3b')]);_0x332ec8[_0xf614('0x3c')]=qs[_0xf614('0x34')](_[_0xf614('0x3d')](_0x4ec155[_0xf614('0x32')],_0x2bb7bd['filters']),_0x478071);if(_0x4ec155[_0xf614('0x32')]['filter']){_0x332ec8[_0xf614('0x3c')]=_[_0xf614('0x3e')](_0x332ec8[_0xf614('0x3c')],{'$or':_[_0xf614('0x2c')](_0x478071,function(_0x5dd2c1){if(_0x5dd2c1[_0xf614('0x2f')]!==_0xf614('0x3f')){var _0x3c53c9={};_0x3c53c9[_0x5dd2c1[_0xf614('0x2a')]]={'$like':'%'+_0x4ec155[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x3c53c9;}})});}_0x332ec8=_[_0xf614('0x3e')]({},_0x332ec8,_0x4ec155[_0xf614('0x41')]);var _0x4ac631={'where':_0x332ec8['where']};return db['ZohoConfiguration']['count'](_0x4ac631)[_0xf614('0x26')](function(_0x4c5f6e){_0x164449[_0xf614('0x21')]=_0x4c5f6e;if(_0x4ec155[_0xf614('0x32')]['includeAll']){_0x332ec8['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0xf614('0x42')](_0x332ec8);})[_0xf614('0x26')](function(_0x5641d2){_0x164449['rows']=_0x5641d2;return _0x164449;})[_0xf614('0x26')](respondWithFilteredResult(_0x3ee14c,_0x332ec8))[_0xf614('0x43')](handleError(_0x3ee14c,null));};exports['show']=function(_0x2134f6,_0x5c2a7f){var _0x17748b={'raw':![],'where':{'id':_0x2134f6[_0xf614('0x44')]['id']}},_0x310e7b={};_0x310e7b[_0xf614('0x31')]=_[_0xf614('0x33')](db[_0xf614('0x2d')][_0xf614('0x45')]);_0x310e7b[_0xf614('0x32')]=_['keys'](_0x2134f6[_0xf614('0x32')]);_0x310e7b[_0xf614('0x34')]=_['intersection'](_0x310e7b[_0xf614('0x31')],_0x310e7b['query']);_0x17748b[_0xf614('0x35')]=_[_0xf614('0x36')](_0x310e7b['model'],qs[_0xf614('0x37')](_0x2134f6['query'][_0xf614('0x37')]));_0x17748b[_0xf614('0x35')]=_0x17748b[_0xf614('0x35')][_0xf614('0x38')]?_0x17748b[_0xf614('0x35')]:_0x310e7b['model'];if(_0x2134f6[_0xf614('0x32')][_0xf614('0x46')]){_0x17748b[_0xf614('0x47')]=[{'all':!![]}];}_0x17748b=_[_0xf614('0x3e')]({},_0x17748b,_0x2134f6[_0xf614('0x41')]);return db[_0xf614('0x2d')][_0xf614('0x48')](_0x17748b)['then'](handleEntityNotFound(_0x5c2a7f,null))[_0xf614('0x26')](respondWithResult(_0x5c2a7f,null))[_0xf614('0x43')](handleError(_0x5c2a7f,null));};exports[_0xf614('0x49')]=function(_0x7ddc36,_0x42ae10){return db[_0xf614('0x2d')][_0xf614('0x49')](_0x7ddc36[_0xf614('0x4a')],{})[_0xf614('0x26')](respondWithResult(_0x42ae10,0xc9))[_0xf614('0x43')](handleError(_0x42ae10,null));};exports[_0xf614('0x4b')]=function(_0x27706c,_0x5cefc7){if(_0x27706c[_0xf614('0x4a')]['id']){delete _0x27706c[_0xf614('0x4a')]['id'];}return db[_0xf614('0x2d')][_0xf614('0x48')]({'where':{'id':_0x27706c[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x5cefc7,null))[_0xf614('0x26')](saveUpdates(_0x27706c[_0xf614('0x4a')],null))['then'](respondWithResult(_0x5cefc7,null))['catch'](handleError(_0x5cefc7,null));};exports[_0xf614('0x27')]=function(_0x4048f3,_0x53c379){return db['ZohoConfiguration'][_0xf614('0x48')]({'where':{'id':_0x4048f3[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x53c379,null))[_0xf614('0x26')](removeEntity(_0x53c379,null))[_0xf614('0x43')](handleError(_0x53c379,null));};exports['getFields']=function(_0x503b97,_0x45c22d,_0x2f0413){var _0x9b2cb2={};var _0x6076e9={};var _0x4ef607;var _0x42c349;return db[_0xf614('0x2d')]['findOne']({'where':{'id':_0x503b97[_0xf614('0x44')]['id']}})['then'](handleEntityNotFound(_0x45c22d,null))[_0xf614('0x26')](function(_0x232a92){if(_0x232a92){_0x4ef607=_0x232a92;_0x6076e9[_0xf614('0x31')]=_['keys'](db['ZohoField'][_0xf614('0x45')]);_0x6076e9[_0xf614('0x32')]=_[_0xf614('0x33')](_0x503b97['query']);_0x6076e9['filters']=_[_0xf614('0x36')](_0x6076e9['model'],_0x6076e9[_0xf614('0x32')]);_0x9b2cb2[_0xf614('0x35')]=_[_0xf614('0x36')](_0x6076e9['model'],qs[_0xf614('0x37')](_0x503b97[_0xf614('0x32')][_0xf614('0x37')]));_0x9b2cb2[_0xf614('0x35')]=_0x9b2cb2[_0xf614('0x35')]['length']?_0x9b2cb2[_0xf614('0x35')]:_0x6076e9[_0xf614('0x31')];_0x9b2cb2[_0xf614('0x3a')]=qs[_0xf614('0x3b')](_0x503b97[_0xf614('0x32')][_0xf614('0x3b')]);_0x9b2cb2[_0xf614('0x3c')]=qs['filters'](_['pick'](_0x503b97[_0xf614('0x32')],_0x6076e9[_0xf614('0x34')]));if(_0x503b97['query'][_0xf614('0x40')]){_0x9b2cb2[_0xf614('0x3c')]=_[_0xf614('0x3e')](_0x9b2cb2[_0xf614('0x3c')],{'$or':_[_0xf614('0x2c')](_0x9b2cb2[_0xf614('0x35')],function(_0xd4d378){var _0x320873={};_0x320873[_0xd4d378]={'$like':'%'+_0x503b97[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x320873;})});}_0x9b2cb2=_[_0xf614('0x3e')]({},_0x9b2cb2,_0x503b97[_0xf614('0x41')]);return _0x4ef607[_0xf614('0x4c')](_0x9b2cb2);}})[_0xf614('0x26')](function(_0x467530){if(_0x467530){_0x42c349=_0x467530[_0xf614('0x38')];if(!_0x503b97['query'][_0xf614('0x4d')](_0xf614('0x39'))){_0x9b2cb2[_0xf614('0x20')]=qs[_0xf614('0x20')](_0x503b97[_0xf614('0x32')]['limit']);_0x9b2cb2['offset']=qs[_0xf614('0x22')](_0x503b97[_0xf614('0x32')][_0xf614('0x22')]);}return _0x4ef607[_0xf614('0x4c')](_0x9b2cb2);}})['then'](function(_0x6952ad){if(_0x6952ad){return _0x6952ad?{'count':_0x42c349,'rows':_0x6952ad}:null;}})[_0xf614('0x26')](respondWithResult(_0x45c22d,null))[_0xf614('0x43')](handleError(_0x45c22d,null));};exports[_0xf614('0x4e')]=function(_0x273f91,_0x411d3e,_0x1b0bc3){var _0x41c73d={};var _0x3c3c86={};var _0x26ee72;var _0x5b69aa;return db[_0xf614('0x2d')]['findOne']({'where':{'id':_0x273f91[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x411d3e,null))[_0xf614('0x26')](function(_0x2eb219){if(_0x2eb219){_0x26ee72=_0x2eb219;_0x3c3c86['model']=_[_0xf614('0x33')](db[_0xf614('0x4f')]['rawAttributes']);_0x3c3c86[_0xf614('0x32')]=_[_0xf614('0x33')](_0x273f91['query']);_0x3c3c86[_0xf614('0x34')]=_[_0xf614('0x36')](_0x3c3c86[_0xf614('0x31')],_0x3c3c86['query']);_0x41c73d[_0xf614('0x35')]=_['intersection'](_0x3c3c86['model'],qs[_0xf614('0x37')](_0x273f91['query']['fields']));_0x41c73d[_0xf614('0x35')]=_0x41c73d[_0xf614('0x35')][_0xf614('0x38')]?_0x41c73d[_0xf614('0x35')]:_0x3c3c86[_0xf614('0x31')];_0x41c73d[_0xf614('0x3a')]=qs['sort'](_0x273f91['query'][_0xf614('0x3b')]);_0x41c73d[_0xf614('0x3c')]=qs['filters'](_[_0xf614('0x3d')](_0x273f91[_0xf614('0x32')],_0x3c3c86['filters']));if(_0x273f91[_0xf614('0x32')][_0xf614('0x40')]){_0x41c73d[_0xf614('0x3c')]=_['merge'](_0x41c73d[_0xf614('0x3c')],{'$or':_[_0xf614('0x2c')](_0x41c73d[_0xf614('0x35')],function(_0x50cfa6){var _0x4b2feb={};_0x4b2feb[_0x50cfa6]={'$like':'%'+_0x273f91[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x4b2feb;})});}_0x41c73d=_['merge']({},_0x41c73d,_0x273f91[_0xf614('0x41')]);return _0x26ee72['getSubjects'](_0x41c73d);}})[_0xf614('0x26')](function(_0x46b036){if(_0x46b036){_0x5b69aa=_0x46b036['length'];if(!_0x273f91[_0xf614('0x32')]['hasOwnProperty']('nolimit')){_0x41c73d[_0xf614('0x20')]=qs[_0xf614('0x20')](_0x273f91[_0xf614('0x32')][_0xf614('0x20')]);_0x41c73d['offset']=qs[_0xf614('0x22')](_0x273f91['query']['offset']);}return _0x26ee72[_0xf614('0x4e')](_0x41c73d);}})['then'](function(_0x20fe82){if(_0x20fe82){return _0x20fe82?{'count':_0x5b69aa,'rows':_0x20fe82}:null;}})[_0xf614('0x26')](respondWithResult(_0x411d3e,null))[_0xf614('0x43')](handleError(_0x411d3e,null));};exports[_0xf614('0x50')]=function(_0x565361,_0x2a5231,_0x23aaa6){var _0x30af10={};var _0x6f2595={};var _0xbae5af;var _0x494d55;return db['ZohoConfiguration'][_0xf614('0x51')]({'where':{'id':_0x565361[_0xf614('0x44')]['id']}})[_0xf614('0x26')](handleEntityNotFound(_0x2a5231,null))[_0xf614('0x26')](function(_0x1dbdbf){if(_0x1dbdbf){_0xbae5af=_0x1dbdbf;_0x6f2595['model']=_['keys'](db[_0xf614('0x4f')][_0xf614('0x45')]);_0x6f2595[_0xf614('0x32')]=_[_0xf614('0x33')](_0x565361[_0xf614('0x32')]);_0x6f2595[_0xf614('0x34')]=_[_0xf614('0x36')](_0x6f2595['model'],_0x6f2595[_0xf614('0x32')]);_0x30af10[_0xf614('0x35')]=_[_0xf614('0x36')](_0x6f2595[_0xf614('0x31')],qs['fields'](_0x565361[_0xf614('0x32')][_0xf614('0x37')]));_0x30af10[_0xf614('0x35')]=_0x30af10[_0xf614('0x35')][_0xf614('0x38')]?_0x30af10[_0xf614('0x35')]:_0x6f2595[_0xf614('0x31')];_0x30af10[_0xf614('0x3a')]=qs[_0xf614('0x3b')](_0x565361['query'][_0xf614('0x3b')]);_0x30af10['where']=qs[_0xf614('0x34')](_[_0xf614('0x3d')](_0x565361['query'],_0x6f2595['filters']));if(_0x565361[_0xf614('0x32')][_0xf614('0x40')]){_0x30af10[_0xf614('0x3c')]=_[_0xf614('0x3e')](_0x30af10[_0xf614('0x3c')],{'$or':_['map'](_0x30af10['attributes'],function(_0x19c86e){var _0x6fa673={};_0x6fa673[_0x19c86e]={'$like':'%'+_0x565361[_0xf614('0x32')][_0xf614('0x40')]+'%'};return _0x6fa673;})});}_0x30af10=_[_0xf614('0x3e')]({},_0x30af10,_0x565361[_0xf614('0x41')]);return _0xbae5af[_0xf614('0x50')](_0x30af10);}})[_0xf614('0x26')](function(_0x32b450){if(_0x32b450){_0x494d55=_0x32b450['length'];if(!_0x565361[_0xf614('0x32')][_0xf614('0x4d')]('nolimit')){_0x30af10['limit']=qs['limit'](_0x565361[_0xf614('0x32')][_0xf614('0x20')]);_0x30af10[_0xf614('0x22')]=qs['offset'](_0x565361[_0xf614('0x32')][_0xf614('0x22')]);}return _0xbae5af['getDescriptions'](_0x30af10);}})[_0xf614('0x26')](function(_0x14b143){if(_0x14b143){return _0x14b143?{'count':_0x494d55,'rows':_0x14b143}:null;}})[_0xf614('0x26')](respondWithResult(_0x2a5231,null))['catch'](handleError(_0x2a5231,null));}; \ No newline at end of file +var _0x054b=['key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','count','findAll','params','keys','includeAll','include','catch','create','body','find','getFields','ZohoField','hasOwnProperty','getSubjects','findOne','getDescriptions','sort','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x054b,0xc4));var _0xb054=function(_0x5ce2dc,_0x1b9db0){_0x5ce2dc=_0x5ce2dc-0x0;var _0x3009cc=_0x054b[_0x5ce2dc];return _0x3009cc;};'use strict';var emlformat=require(_0xb054('0x0'));var rimraf=require(_0xb054('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb054('0x2'));var rp=require('request-promise');var moment=require(_0xb054('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb054('0x4'));var util=require(_0xb054('0x5'));var path=require(_0xb054('0x6'));var sox=require('sox');var csv=require(_0xb054('0x7'));var ejs=require(_0xb054('0x8'));var fs=require('fs');var fs_extra=require(_0xb054('0x9'));var _=require(_0xb054('0xa'));var squel=require('squel');var crypto=require(_0xb054('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb054('0xc'));var toCsv=require(_0xb054('0x7'));var querystring=require(_0xb054('0xd'));var Papa=require(_0xb054('0xe'));var Redis=require(_0xb054('0xf'));var authService=require(_0xb054('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb054('0x11'));var hardwareService=require(_0xb054('0x12'));var logger=require(_0xb054('0x13'))(_0xb054('0x14'));var utils=require(_0xb054('0x15'));var config=require(_0xb054('0x16'));var licenseUtil=require(_0xb054('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ddc70,_0x4d8e68){_0x4d8e68=_0x4d8e68||0xcc;return function(_0x632b43){if(_0x632b43){return _0x1ddc70[_0xb054('0x18')](_0x4d8e68);}return _0x1ddc70[_0xb054('0x19')](_0x4d8e68)[_0xb054('0x1a')]();};}function respondWithResult(_0x3d2b93,_0x4c2480){_0x4c2480=_0x4c2480||0xc8;return function(_0x5241e4){if(_0x5241e4){return _0x3d2b93[_0xb054('0x19')](_0x4c2480)[_0xb054('0x1b')](_0x5241e4);}};}function respondWithFilteredResult(_0x4c4b2e,_0x3ee449){return function(_0x11b720){if(_0x11b720){var _0x25156d=typeof _0x3ee449[_0xb054('0x1c')]===_0xb054('0x1d')&&typeof _0x3ee449[_0xb054('0x1e')]===_0xb054('0x1d');var _0xc5ad57=_0x11b720['count'];var _0x3f001f=_0x25156d?0x0:_0x3ee449['offset'];var _0x2d0462=_0x25156d?_0x11b720['count']:_0x3ee449[_0xb054('0x1c')]+_0x3ee449['limit'];var _0x74f931;if(_0x2d0462>=_0xc5ad57){_0x2d0462=_0xc5ad57;_0x74f931=0xc8;}else{_0x74f931=0xce;}_0x4c4b2e[_0xb054('0x19')](_0x74f931);return _0x4c4b2e[_0xb054('0x1f')](_0xb054('0x20'),_0x3f001f+'-'+_0x2d0462+'/'+_0xc5ad57)['json'](_0x11b720);}return null;};}function patchUpdates(_0x335754){return function(_0x271b32){try{jsonpatch[_0xb054('0x21')](_0x271b32,_0x335754,!![]);}catch(_0x528c04){return BPromise[_0xb054('0x22')](_0x528c04);}return _0x271b32[_0xb054('0x23')]();};}function saveUpdates(_0x550a80,_0x5c491a){return function(_0x66acb2){if(_0x66acb2){return _0x66acb2[_0xb054('0x24')](_0x550a80)[_0xb054('0x25')](function(_0x4a590f){return _0x4a590f;});}return null;};}function removeEntity(_0x16f4e1,_0x2e8494){return function(_0xd00332){if(_0xd00332){return _0xd00332[_0xb054('0x26')]()['then'](function(){_0x16f4e1[_0xb054('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x183a24,_0x546cdd){return function(_0x22c5d5){if(!_0x22c5d5){_0x183a24['sendStatus'](0x194);}return _0x22c5d5;};}function handleError(_0x4fb32b,_0x53ff3b){_0x53ff3b=_0x53ff3b||0x1f4;return function(_0x42ca9d){logger[_0xb054('0x27')](_0x42ca9d[_0xb054('0x28')]);if(_0x42ca9d[_0xb054('0x29')]){delete _0x42ca9d[_0xb054('0x29')];}_0x4fb32b[_0xb054('0x19')](_0x53ff3b)['send'](_0x42ca9d);};}exports[_0xb054('0x2a')]=function(_0x25c70e,_0x118392){var _0xa8a0b6={},_0x3b292e={},_0x55cdf7={'count':0x0,'rows':[]};var _0x1b12a6=_[_0xb054('0x2b')](db[_0xb054('0x2c')][_0xb054('0x2d')],function(_0x321582){return{'name':_0x321582[_0xb054('0x2e')],'type':_0x321582['type'][_0xb054('0x2f')]};});_0x3b292e[_0xb054('0x30')]=_[_0xb054('0x2b')](_0x1b12a6,_0xb054('0x29'));_0x3b292e[_0xb054('0x31')]=_['keys'](_0x25c70e['query']);_0x3b292e[_0xb054('0x32')]=_[_0xb054('0x33')](_0x3b292e['model'],_0x3b292e[_0xb054('0x31')]);_0xa8a0b6['attributes']=_[_0xb054('0x33')](_0x3b292e[_0xb054('0x30')],qs['fields'](_0x25c70e[_0xb054('0x31')][_0xb054('0x34')]));_0xa8a0b6[_0xb054('0x35')]=_0xa8a0b6['attributes'][_0xb054('0x36')]?_0xa8a0b6[_0xb054('0x35')]:_0x3b292e[_0xb054('0x30')];if(!_0x25c70e[_0xb054('0x31')]['hasOwnProperty'](_0xb054('0x37'))){_0xa8a0b6['limit']=qs[_0xb054('0x1e')](_0x25c70e[_0xb054('0x31')][_0xb054('0x1e')]);_0xa8a0b6[_0xb054('0x1c')]=qs[_0xb054('0x1c')](_0x25c70e['query'][_0xb054('0x1c')]);}_0xa8a0b6[_0xb054('0x38')]=qs['sort'](_0x25c70e[_0xb054('0x31')]['sort']);_0xa8a0b6[_0xb054('0x39')]=qs[_0xb054('0x32')](_[_0xb054('0x3a')](_0x25c70e['query'],_0x3b292e[_0xb054('0x32')]),_0x1b12a6);if(_0x25c70e[_0xb054('0x31')]['filter']){_0xa8a0b6[_0xb054('0x39')]=_[_0xb054('0x3b')](_0xa8a0b6[_0xb054('0x39')],{'$or':_[_0xb054('0x2b')](_0x1b12a6,function(_0x4c082d){if(_0x4c082d[_0xb054('0x3c')]!==_0xb054('0x3d')){var _0x3cda3a={};_0x3cda3a[_0x4c082d['name']]={'$like':'%'+_0x25c70e[_0xb054('0x31')][_0xb054('0x3e')]+'%'};return _0x3cda3a;}})});}_0xa8a0b6=_[_0xb054('0x3b')]({},_0xa8a0b6,_0x25c70e[_0xb054('0x3f')]);var _0x184e22={'where':_0xa8a0b6[_0xb054('0x39')]};return db[_0xb054('0x2c')][_0xb054('0x40')](_0x184e22)[_0xb054('0x25')](function(_0x3df696){_0x55cdf7[_0xb054('0x40')]=_0x3df696;if(_0x25c70e['query']['includeAll']){_0xa8a0b6['include']=[{'all':!![]}];}return db[_0xb054('0x2c')][_0xb054('0x41')](_0xa8a0b6);})[_0xb054('0x25')](function(_0x524bf8){_0x55cdf7['rows']=_0x524bf8;return _0x55cdf7;})[_0xb054('0x25')](respondWithFilteredResult(_0x118392,_0xa8a0b6))['catch'](handleError(_0x118392,null));};exports['show']=function(_0x46d868,_0x5f3a9c){var _0x379874={'raw':![],'where':{'id':_0x46d868[_0xb054('0x42')]['id']}},_0x591277={};_0x591277[_0xb054('0x30')]=_['keys'](db[_0xb054('0x2c')]['rawAttributes']);_0x591277[_0xb054('0x31')]=_[_0xb054('0x43')](_0x46d868[_0xb054('0x31')]);_0x591277[_0xb054('0x32')]=_[_0xb054('0x33')](_0x591277[_0xb054('0x30')],_0x591277[_0xb054('0x31')]);_0x379874[_0xb054('0x35')]=_[_0xb054('0x33')](_0x591277[_0xb054('0x30')],qs['fields'](_0x46d868[_0xb054('0x31')][_0xb054('0x34')]));_0x379874[_0xb054('0x35')]=_0x379874[_0xb054('0x35')][_0xb054('0x36')]?_0x379874[_0xb054('0x35')]:_0x591277['model'];if(_0x46d868[_0xb054('0x31')][_0xb054('0x44')]){_0x379874[_0xb054('0x45')]=[{'all':!![]}];}_0x379874=_[_0xb054('0x3b')]({},_0x379874,_0x46d868[_0xb054('0x3f')]);return db[_0xb054('0x2c')]['find'](_0x379874)['then'](handleEntityNotFound(_0x5f3a9c,null))[_0xb054('0x25')](respondWithResult(_0x5f3a9c,null))[_0xb054('0x46')](handleError(_0x5f3a9c,null));};exports[_0xb054('0x47')]=function(_0x4bfc40,_0x3df466){return db[_0xb054('0x2c')][_0xb054('0x47')](_0x4bfc40['body'],{})[_0xb054('0x25')](respondWithResult(_0x3df466,0xc9))[_0xb054('0x46')](handleError(_0x3df466,null));};exports[_0xb054('0x24')]=function(_0x1e0441,_0x5b4bc9){if(_0x1e0441[_0xb054('0x48')]['id']){delete _0x1e0441[_0xb054('0x48')]['id'];}return db[_0xb054('0x2c')][_0xb054('0x49')]({'where':{'id':_0x1e0441['params']['id']}})['then'](handleEntityNotFound(_0x5b4bc9,null))['then'](saveUpdates(_0x1e0441[_0xb054('0x48')],null))[_0xb054('0x25')](respondWithResult(_0x5b4bc9,null))[_0xb054('0x46')](handleError(_0x5b4bc9,null));};exports['destroy']=function(_0x2a9e87,_0x3fd28c){return db[_0xb054('0x2c')][_0xb054('0x49')]({'where':{'id':_0x2a9e87[_0xb054('0x42')]['id']}})[_0xb054('0x25')](handleEntityNotFound(_0x3fd28c,null))[_0xb054('0x25')](removeEntity(_0x3fd28c,null))[_0xb054('0x46')](handleError(_0x3fd28c,null));};exports[_0xb054('0x4a')]=function(_0x8f203c,_0x3be119,_0x1cbc5f){var _0x258e8d={};var _0x2d2ee6={};var _0x269f4b;var _0x789ec5;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x8f203c['params']['id']}})[_0xb054('0x25')](handleEntityNotFound(_0x3be119,null))[_0xb054('0x25')](function(_0x8a5d6a){if(_0x8a5d6a){_0x269f4b=_0x8a5d6a;_0x2d2ee6[_0xb054('0x30')]=_[_0xb054('0x43')](db[_0xb054('0x4b')][_0xb054('0x2d')]);_0x2d2ee6[_0xb054('0x31')]=_[_0xb054('0x43')](_0x8f203c[_0xb054('0x31')]);_0x2d2ee6['filters']=_['intersection'](_0x2d2ee6[_0xb054('0x30')],_0x2d2ee6['query']);_0x258e8d[_0xb054('0x35')]=_['intersection'](_0x2d2ee6[_0xb054('0x30')],qs['fields'](_0x8f203c['query']['fields']));_0x258e8d[_0xb054('0x35')]=_0x258e8d[_0xb054('0x35')][_0xb054('0x36')]?_0x258e8d[_0xb054('0x35')]:_0x2d2ee6[_0xb054('0x30')];_0x258e8d[_0xb054('0x38')]=qs['sort'](_0x8f203c[_0xb054('0x31')]['sort']);_0x258e8d[_0xb054('0x39')]=qs[_0xb054('0x32')](_[_0xb054('0x3a')](_0x8f203c[_0xb054('0x31')],_0x2d2ee6[_0xb054('0x32')]));if(_0x8f203c[_0xb054('0x31')][_0xb054('0x3e')]){_0x258e8d[_0xb054('0x39')]=_[_0xb054('0x3b')](_0x258e8d['where'],{'$or':_[_0xb054('0x2b')](_0x258e8d[_0xb054('0x35')],function(_0x8d7063){var _0x228b02={};_0x228b02[_0x8d7063]={'$like':'%'+_0x8f203c[_0xb054('0x31')][_0xb054('0x3e')]+'%'};return _0x228b02;})});}_0x258e8d=_[_0xb054('0x3b')]({},_0x258e8d,_0x8f203c[_0xb054('0x3f')]);return _0x269f4b['getFields'](_0x258e8d);}})['then'](function(_0x460f1b){if(_0x460f1b){_0x789ec5=_0x460f1b['length'];if(!_0x8f203c[_0xb054('0x31')][_0xb054('0x4c')](_0xb054('0x37'))){_0x258e8d['limit']=qs[_0xb054('0x1e')](_0x8f203c[_0xb054('0x31')]['limit']);_0x258e8d[_0xb054('0x1c')]=qs[_0xb054('0x1c')](_0x8f203c[_0xb054('0x31')][_0xb054('0x1c')]);}return _0x269f4b['getFields'](_0x258e8d);}})[_0xb054('0x25')](function(_0x10a103){if(_0x10a103){return _0x10a103?{'count':_0x789ec5,'rows':_0x10a103}:null;}})[_0xb054('0x25')](respondWithResult(_0x3be119,null))['catch'](handleError(_0x3be119,null));};exports[_0xb054('0x4d')]=function(_0x182e60,_0x113fb5,_0x279bea){var _0x21d011={};var _0xf1c31f={};var _0x25109d;var _0x592885;return db['ZohoConfiguration'][_0xb054('0x4e')]({'where':{'id':_0x182e60['params']['id']}})[_0xb054('0x25')](handleEntityNotFound(_0x113fb5,null))['then'](function(_0x202e1b){if(_0x202e1b){_0x25109d=_0x202e1b;_0xf1c31f[_0xb054('0x30')]=_[_0xb054('0x43')](db[_0xb054('0x4b')][_0xb054('0x2d')]);_0xf1c31f[_0xb054('0x31')]=_[_0xb054('0x43')](_0x182e60[_0xb054('0x31')]);_0xf1c31f[_0xb054('0x32')]=_['intersection'](_0xf1c31f[_0xb054('0x30')],_0xf1c31f['query']);_0x21d011[_0xb054('0x35')]=_[_0xb054('0x33')](_0xf1c31f[_0xb054('0x30')],qs[_0xb054('0x34')](_0x182e60[_0xb054('0x31')]['fields']));_0x21d011['attributes']=_0x21d011[_0xb054('0x35')][_0xb054('0x36')]?_0x21d011[_0xb054('0x35')]:_0xf1c31f[_0xb054('0x30')];_0x21d011[_0xb054('0x38')]=qs['sort'](_0x182e60[_0xb054('0x31')]['sort']);_0x21d011[_0xb054('0x39')]=qs[_0xb054('0x32')](_['pick'](_0x182e60[_0xb054('0x31')],_0xf1c31f[_0xb054('0x32')]));if(_0x182e60['query'][_0xb054('0x3e')]){_0x21d011[_0xb054('0x39')]=_['merge'](_0x21d011['where'],{'$or':_[_0xb054('0x2b')](_0x21d011[_0xb054('0x35')],function(_0xdc5f15){var _0x54ab1b={};_0x54ab1b[_0xdc5f15]={'$like':'%'+_0x182e60['query'][_0xb054('0x3e')]+'%'};return _0x54ab1b;})});}_0x21d011=_[_0xb054('0x3b')]({},_0x21d011,_0x182e60[_0xb054('0x3f')]);return _0x25109d[_0xb054('0x4d')](_0x21d011);}})[_0xb054('0x25')](function(_0x44d0ab){if(_0x44d0ab){_0x592885=_0x44d0ab['length'];if(!_0x182e60[_0xb054('0x31')][_0xb054('0x4c')](_0xb054('0x37'))){_0x21d011['limit']=qs[_0xb054('0x1e')](_0x182e60['query']['limit']);_0x21d011[_0xb054('0x1c')]=qs[_0xb054('0x1c')](_0x182e60['query'][_0xb054('0x1c')]);}return _0x25109d['getSubjects'](_0x21d011);}})[_0xb054('0x25')](function(_0x4a6357){if(_0x4a6357){return _0x4a6357?{'count':_0x592885,'rows':_0x4a6357}:null;}})[_0xb054('0x25')](respondWithResult(_0x113fb5,null))[_0xb054('0x46')](handleError(_0x113fb5,null));};exports[_0xb054('0x4f')]=function(_0x34ce9e,_0x74e264,_0x3663ab){var _0x53cc8c={};var _0x2bffe9={};var _0x5aa8d6;var _0x254ffc;return db[_0xb054('0x2c')][_0xb054('0x4e')]({'where':{'id':_0x34ce9e[_0xb054('0x42')]['id']}})[_0xb054('0x25')](handleEntityNotFound(_0x74e264,null))['then'](function(_0x57523a){if(_0x57523a){_0x5aa8d6=_0x57523a;_0x2bffe9[_0xb054('0x30')]=_['keys'](db[_0xb054('0x4b')]['rawAttributes']);_0x2bffe9['query']=_[_0xb054('0x43')](_0x34ce9e[_0xb054('0x31')]);_0x2bffe9['filters']=_[_0xb054('0x33')](_0x2bffe9[_0xb054('0x30')],_0x2bffe9['query']);_0x53cc8c[_0xb054('0x35')]=_[_0xb054('0x33')](_0x2bffe9[_0xb054('0x30')],qs[_0xb054('0x34')](_0x34ce9e[_0xb054('0x31')]['fields']));_0x53cc8c[_0xb054('0x35')]=_0x53cc8c[_0xb054('0x35')]['length']?_0x53cc8c[_0xb054('0x35')]:_0x2bffe9[_0xb054('0x30')];_0x53cc8c['order']=qs[_0xb054('0x50')](_0x34ce9e[_0xb054('0x31')][_0xb054('0x50')]);_0x53cc8c[_0xb054('0x39')]=qs['filters'](_[_0xb054('0x3a')](_0x34ce9e[_0xb054('0x31')],_0x2bffe9[_0xb054('0x32')]));if(_0x34ce9e[_0xb054('0x31')]['filter']){_0x53cc8c['where']=_[_0xb054('0x3b')](_0x53cc8c[_0xb054('0x39')],{'$or':_[_0xb054('0x2b')](_0x53cc8c[_0xb054('0x35')],function(_0x2c6d5d){var _0x53feac={};_0x53feac[_0x2c6d5d]={'$like':'%'+_0x34ce9e[_0xb054('0x31')][_0xb054('0x3e')]+'%'};return _0x53feac;})});}_0x53cc8c=_[_0xb054('0x3b')]({},_0x53cc8c,_0x34ce9e['options']);return _0x5aa8d6[_0xb054('0x4f')](_0x53cc8c);}})[_0xb054('0x25')](function(_0x27a0ab){if(_0x27a0ab){_0x254ffc=_0x27a0ab[_0xb054('0x36')];if(!_0x34ce9e[_0xb054('0x31')]['hasOwnProperty'](_0xb054('0x37'))){_0x53cc8c[_0xb054('0x1e')]=qs[_0xb054('0x1e')](_0x34ce9e[_0xb054('0x31')][_0xb054('0x1e')]);_0x53cc8c[_0xb054('0x1c')]=qs['offset'](_0x34ce9e[_0xb054('0x31')][_0xb054('0x1c')]);}return _0x5aa8d6[_0xb054('0x4f')](_0x53cc8c);}})[_0xb054('0x25')](function(_0xebffcf){if(_0xebffcf){return _0xebffcf?{'count':_0x254ffc,'rows':_0xebffcf}:null;}})['then'](respondWithResult(_0x74e264,null))[_0xb054('0x46')](handleError(_0x74e264,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 09ba84b..7c832d7 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 _0x3ab0=['bluebird','request-promise','rimraf','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x3ab0,0x1eb));var _0x03ab=function(_0x469a16,_0x14f570){_0x469a16=_0x469a16-0x0;var _0x4785ab=_0x3ab0[_0x469a16];return _0x4785ab;};'use strict';var _=require(_0x03ab('0x0'));var util=require(_0x03ab('0x1'));var logger=require('../../config/logger')(_0x03ab('0x2'));var moment=require(_0x03ab('0x3'));var BPromise=require(_0x03ab('0x4'));var rp=require(_0x03ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03ab('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x03ab('0x7')]=function(_0x18b378,_0x1b17fe){return _0x18b378[_0x03ab('0x8')](_0x03ab('0x9'),attributes,{'tableName':_0x03ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eff=['util','api','bluebird','path','rimraf','../../config/environment','ZohoConfiguration','int_zoho_configurations'];(function(_0x4c2788,_0xddfe19){var _0x543c64=function(_0x4e7920){while(--_0x4e7920){_0x4c2788['push'](_0x4c2788['shift']());}};_0x543c64(++_0xddfe19);}(_0x6eff,0xe8));var _0xf6ef=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x6eff[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require(_0xf6ef('0x0'));var logger=require('../../config/logger')(_0xf6ef('0x1'));var moment=require('moment');var BPromise=require(_0xf6ef('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6ef('0x3'));var rimraf=require(_0xf6ef('0x4'));var config=require(_0xf6ef('0x5'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x1dcba3,_0x40962f){return _0x1dcba3['define'](_0xf6ef('0x6'),attributes,{'tableName':_0xf6ef('0x7'),'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 fbf1eb1..1426be5 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 _0xc064=['request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x297d90,_0x27666f){var _0xb673c2=function(_0x3e1a14){while(--_0x3e1a14){_0x297d90['push'](_0x297d90['shift']());}};_0xb673c2(++_0x27666f);}(_0xc064,0x1ab));var _0x4c06=function(_0x1f37f4,_0x3f7786){_0x1f37f4=_0x1f37f4-0x0;var _0x40acfb=_0xc064[_0x1f37f4];return _0x40acfb;};'use strict';var _=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var moment=require(_0x4c06('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c06('0x4'))(_0x4c06('0x5'));var config=require(_0x4c06('0x6'));var jayson=require(_0x4c06('0x7'));var client=jayson[_0x4c06('0x8')][_0x4c06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d15b8,_0x5889e2,_0xbea186){return new BPromise(function(_0x39bdd0,_0x47bb41){return client[_0x4c06('0xa')](_0x3d15b8,_0xbea186)[_0x4c06('0xb')](function(_0x188f3f){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x5889e2,'request\x20sent');logger['debug'](_0x4c06('0xc'),_0x5889e2,_0x4c06('0xd'),JSON[_0x4c06('0xe')](_0x188f3f));if(_0x188f3f[_0x4c06('0xf')]){if(_0x188f3f[_0x4c06('0xf')][_0x4c06('0x10')]===0x1f4){logger['error'](_0x4c06('0x11'),_0x5889e2,_0x188f3f['error'][_0x4c06('0x12')]);return _0x47bb41(_0x188f3f[_0x4c06('0xf')][_0x4c06('0x12')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x5889e2,_0x188f3f['error']['message']);return _0x39bdd0(_0x188f3f[_0x4c06('0xf')][_0x4c06('0x12')]);}else{logger['info'](_0x4c06('0x11'),_0x5889e2,_0x4c06('0xd'));_0x39bdd0(_0x188f3f['result'][_0x4c06('0x12')]);}})[_0x4c06('0x13')](function(_0x4a9f92){logger[_0x4c06('0xf')](_0x4c06('0x11'),_0x5889e2,_0x4a9f92);_0x47bb41(_0x4a9f92);});});} \ No newline at end of file +var _0x0e56=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x0e56,0x84));var _0x60e5=function(_0x275d85,_0x5a883e){_0x275d85=_0x275d85-0x0;var _0x3cd754=_0x0e56[_0x275d85];return _0x3cd754;};'use strict';var _=require('lodash');var util=require(_0x60e5('0x0'));var moment=require(_0x60e5('0x1'));var BPromise=require(_0x60e5('0x2'));var rs=require(_0x60e5('0x3'));var fs=require('fs');var Redis=require(_0x60e5('0x4'));var db=require(_0x60e5('0x5'))['db'];var utils=require(_0x60e5('0x6'));var logger=require(_0x60e5('0x7'))(_0x60e5('0x8'));var config=require(_0x60e5('0x9'));var jayson=require(_0x60e5('0xa'));var client=jayson[_0x60e5('0xb')][_0x60e5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6dfcff,_0x2a1980,_0x56772b){return new BPromise(function(_0x319be8,_0xae0d0){return client[_0x60e5('0xd')](_0x6dfcff,_0x56772b)[_0x60e5('0xe')](function(_0x1274e6){logger['info'](_0x60e5('0xf'),_0x2a1980,_0x60e5('0x10'));logger[_0x60e5('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2a1980,_0x60e5('0x10'),JSON[_0x60e5('0x12')](_0x1274e6));if(_0x1274e6[_0x60e5('0x13')]){if(_0x1274e6[_0x60e5('0x13')]['code']===0x1f4){logger['error'](_0x60e5('0xf'),_0x2a1980,_0x1274e6['error'][_0x60e5('0x14')]);return _0xae0d0(_0x1274e6[_0x60e5('0x13')][_0x60e5('0x14')]);}logger[_0x60e5('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x2a1980,_0x1274e6[_0x60e5('0x13')][_0x60e5('0x14')]);return _0x319be8(_0x1274e6[_0x60e5('0x13')][_0x60e5('0x14')]);}else{logger[_0x60e5('0x15')]('ZohoConfiguration,\x20%s,\x20%s',_0x2a1980,_0x60e5('0x10'));_0x319be8(_0x1274e6['result'][_0x60e5('0x14')]);}})[_0x60e5('0x16')](function(_0x3a847a){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2a1980,_0x3a847a);_0xae0d0(_0x3a847a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 9ece6b9..c73c1df 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 _0xcc89=['show','create','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','/:id'];(function(_0x2d9342,_0x16a510){var _0x2237d5=function(_0x13d5b3){while(--_0x13d5b3){_0x2d9342['push'](_0x2d9342['shift']());}};_0x2237d5(++_0x16a510);}(_0xcc89,0x12a));var _0x9cc8=function(_0x1ecd04,_0x55bd8c){_0x1ecd04=_0x1ecd04-0x0;var _0x224282=_0xcc89[_0x1ecd04];return _0x224282;};'use strict';var multer=require('multer');var util=require(_0x9cc8('0x0'));var path=require(_0x9cc8('0x1'));var timeout=require('connect-timeout');var express=require(_0x9cc8('0x2'));var router=express['Router']();var fs_extra=require(_0x9cc8('0x3'));var auth=require(_0x9cc8('0x4'));var interaction=require(_0x9cc8('0x5'));var config=require('../../config/environment');var controller=require(_0x9cc8('0x6'));router['get']('/',auth[_0x9cc8('0x7')](),controller[_0x9cc8('0x8')]);router['get'](_0x9cc8('0x9'),auth[_0x9cc8('0x7')](),controller[_0x9cc8('0xa')]);router['post']('/',auth[_0x9cc8('0x7')](),controller[_0x9cc8('0xb')]);router['put'](_0x9cc8('0x9'),auth[_0x9cc8('0x7')](),controller[_0x9cc8('0xc')]);router[_0x9cc8('0xd')](_0x9cc8('0x9'),auth[_0x9cc8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3d38=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x376b04,_0x332bc5){var _0x32036c=function(_0x22c4e0){while(--_0x22c4e0){_0x376b04['push'](_0x376b04['shift']());}};_0x32036c(++_0x332bc5);}(_0x3d38,0xb9));var _0x83d3=function(_0x5967c0,_0x452377){_0x5967c0=_0x5967c0-0x0;var _0x2ad249=_0x3d38[_0x5967c0];return _0x2ad249;};'use strict';var multer=require(_0x83d3('0x0'));var util=require(_0x83d3('0x1'));var path=require(_0x83d3('0x2'));var timeout=require(_0x83d3('0x3'));var express=require(_0x83d3('0x4'));var router=express['Router']();var fs_extra=require(_0x83d3('0x5'));var auth=require(_0x83d3('0x6'));var interaction=require(_0x83d3('0x7'));var config=require(_0x83d3('0x8'));var controller=require(_0x83d3('0x9'));router[_0x83d3('0xa')]('/',auth[_0x83d3('0xb')](),controller[_0x83d3('0xc')]);router['get']('/:id',auth[_0x83d3('0xb')](),controller['show']);router['post']('/',auth[_0x83d3('0xb')](),controller[_0x83d3('0xd')]);router[_0x83d3('0xe')](_0x83d3('0xf'),auth[_0x83d3('0xb')](),controller[_0x83d3('0x10')]);router['delete'](_0x83d3('0xf'),auth['isAuthenticated'](),controller[_0x83d3('0x11')]);module[_0x83d3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index dc0594d..404ebb1 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 _0xfb42=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x149ed7,_0x548ab5){var _0x5bfe42=function(_0x42c2c2){while(--_0x42c2c2){_0x149ed7['push'](_0x149ed7['shift']());}};_0x5bfe42(++_0x548ab5);}(_0xfb42,0x90));var _0x2fb4=function(_0x126264,_0x6eb855){_0x126264=_0x126264-0x0;var _0x5774ae=_0xfb42[_0x126264];return _0x5774ae;};'use strict';var Sequelize=require('sequelize');module[_0x2fb4('0x0')]={'type':{'type':Sequelize[_0x2fb4('0x1')](_0x2fb4('0x2'),_0x2fb4('0x3'),_0x2fb4('0x4'),_0x2fb4('0x5'),_0x2fb4('0x6')),'defaultValue':_0x2fb4('0x2')},'content':{'type':Sequelize[_0x2fb4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2fb4('0x1')]('string','variable',_0x2fb4('0x4'))},'keyContent':{'type':Sequelize[_0x2fb4('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2fb4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fb4('0x7')]}}; \ No newline at end of file +var _0x0928=['customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0928,0x101));var _0x8092=function(_0x29968c,_0x2988b0){_0x29968c=_0x29968c-0x0;var _0xe1efcf=_0x0928[_0x29968c];return _0xe1efcf;};'use strict';var Sequelize=require(_0x8092('0x0'));module[_0x8092('0x1')]={'type':{'type':Sequelize[_0x8092('0x2')](_0x8092('0x3'),'variable',_0x8092('0x4'),'keyValue',_0x8092('0x5')),'defaultValue':_0x8092('0x3')},'content':{'type':Sequelize[_0x8092('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8092('0x2')](_0x8092('0x3'),_0x8092('0x7'),_0x8092('0x4'))},'keyContent':{'type':Sequelize[_0x8092('0x6')]},'idField':{'type':Sequelize[_0x8092('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8092('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8092('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 5be7613..f61a47a 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 _0x6b39=['stack','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','rows','catch','show','params','length','includeAll','include','find','create','body','destroy','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error'];(function(_0x48a2de,_0xc061f3){var _0x2c305f=function(_0x2ea7ea){while(--_0x2ea7ea){_0x48a2de['push'](_0x48a2de['shift']());}};_0x2c305f(++_0xc061f3);}(_0x6b39,0x1cf));var _0x96b3=function(_0x37f8ad,_0x5c3a37){_0x37f8ad=_0x37f8ad-0x0;var _0x12bd86=_0x6b39[_0x37f8ad];return _0x12bd86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x96b3('0x0'));var rp=require('request-promise');var moment=require(_0x96b3('0x1'));var BPromise=require(_0x96b3('0x2'));var Mustache=require(_0x96b3('0x3'));var util=require(_0x96b3('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x96b3('0x5'));var fs=require('fs');var fs_extra=require(_0x96b3('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x96b3('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x96b3('0x8'));var querystring=require(_0x96b3('0x9'));var Papa=require(_0x96b3('0xa'));var Redis=require(_0x96b3('0xb'));var authService=require(_0x96b3('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x96b3('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96b3('0xe'))(_0x96b3('0xf'));var utils=require(_0x96b3('0x10'));var config=require(_0x96b3('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbb050d,_0x42e868){_0x42e868=_0x42e868||0xcc;return function(_0x309215){if(_0x309215){return _0xbb050d[_0x96b3('0x12')](_0x42e868);}return _0xbb050d[_0x96b3('0x13')](_0x42e868)[_0x96b3('0x14')]();};}function respondWithResult(_0x30f59d,_0x27690c){_0x27690c=_0x27690c||0xc8;return function(_0x391c42){if(_0x391c42){return _0x30f59d[_0x96b3('0x13')](_0x27690c)['json'](_0x391c42);}};}function respondWithFilteredResult(_0x3b966f,_0x1dd250){return function(_0x444329){if(_0x444329){var _0xd77a93=typeof _0x1dd250[_0x96b3('0x15')]===_0x96b3('0x16')&&typeof _0x1dd250[_0x96b3('0x17')]==='undefined';var _0x1e662c=_0x444329[_0x96b3('0x18')];var _0x4bb23c=_0xd77a93?0x0:_0x1dd250[_0x96b3('0x15')];var _0x22b167=_0xd77a93?_0x444329['count']:_0x1dd250['offset']+_0x1dd250[_0x96b3('0x17')];var _0xde5ea;if(_0x22b167>=_0x1e662c){_0x22b167=_0x1e662c;_0xde5ea=0xc8;}else{_0xde5ea=0xce;}_0x3b966f['status'](_0xde5ea);return _0x3b966f[_0x96b3('0x19')](_0x96b3('0x1a'),_0x4bb23c+'-'+_0x22b167+'/'+_0x1e662c)[_0x96b3('0x1b')](_0x444329);}return null;};}function patchUpdates(_0x363dd4){return function(_0x3a7427){try{jsonpatch[_0x96b3('0x1c')](_0x3a7427,_0x363dd4,!![]);}catch(_0x29f22f){return BPromise[_0x96b3('0x1d')](_0x29f22f);}return _0x3a7427[_0x96b3('0x1e')]();};}function saveUpdates(_0x1da2b8,_0x4ccb38){return function(_0x58dfdc){if(_0x58dfdc){return _0x58dfdc[_0x96b3('0x1f')](_0x1da2b8)[_0x96b3('0x20')](function(_0x5b8184){return _0x5b8184;});}return null;};}function removeEntity(_0x3566b9,_0x4052ed){return function(_0x3f2390){if(_0x3f2390){return _0x3f2390['destroy']()['then'](function(){_0x3566b9['status'](0xcc)[_0x96b3('0x14')]();});}};}function handleEntityNotFound(_0x10c99e,_0xf2b602){return function(_0x609c35){if(!_0x609c35){_0x10c99e[_0x96b3('0x12')](0x194);}return _0x609c35;};}function handleError(_0x5b18ec,_0x224d88){_0x224d88=_0x224d88||0x1f4;return function(_0x380622){logger[_0x96b3('0x21')](_0x380622[_0x96b3('0x22')]);if(_0x380622['name']){delete _0x380622['name'];}_0x5b18ec['status'](_0x224d88)[_0x96b3('0x23')](_0x380622);};}exports[_0x96b3('0x24')]=function(_0x117309,_0x52af64){var _0x467364={},_0x4ad135={},_0x3d7d6a={'count':0x0,'rows':[]};var _0xd36f75=_[_0x96b3('0x25')](db[_0x96b3('0x26')][_0x96b3('0x27')],function(_0x2d5cb8){return{'name':_0x2d5cb8[_0x96b3('0x28')],'type':_0x2d5cb8[_0x96b3('0x29')][_0x96b3('0x2a')]};});_0x4ad135[_0x96b3('0x2b')]=_[_0x96b3('0x25')](_0xd36f75,_0x96b3('0x2c'));_0x4ad135['query']=_[_0x96b3('0x2d')](_0x117309[_0x96b3('0x2e')]);_0x4ad135[_0x96b3('0x2f')]=_['intersection'](_0x4ad135[_0x96b3('0x2b')],_0x4ad135[_0x96b3('0x2e')]);_0x467364[_0x96b3('0x30')]=_[_0x96b3('0x31')](_0x4ad135[_0x96b3('0x2b')],qs[_0x96b3('0x32')](_0x117309['query'][_0x96b3('0x32')]));_0x467364[_0x96b3('0x30')]=_0x467364[_0x96b3('0x30')]['length']?_0x467364[_0x96b3('0x30')]:_0x4ad135['model'];if(!_0x117309[_0x96b3('0x2e')][_0x96b3('0x33')](_0x96b3('0x34'))){_0x467364[_0x96b3('0x17')]=qs[_0x96b3('0x17')](_0x117309[_0x96b3('0x2e')][_0x96b3('0x17')]);_0x467364[_0x96b3('0x15')]=qs[_0x96b3('0x15')](_0x117309[_0x96b3('0x2e')][_0x96b3('0x15')]);}_0x467364[_0x96b3('0x35')]=qs[_0x96b3('0x36')](_0x117309[_0x96b3('0x2e')][_0x96b3('0x36')]);_0x467364['where']=qs[_0x96b3('0x2f')](_['pick'](_0x117309['query'],_0x4ad135['filters']),_0xd36f75);if(_0x117309[_0x96b3('0x2e')][_0x96b3('0x37')]){_0x467364[_0x96b3('0x38')]=_['merge'](_0x467364[_0x96b3('0x38')],{'$or':_[_0x96b3('0x25')](_0xd36f75,function(_0x486602){if(_0x486602['type']!==_0x96b3('0x39')){var _0x4e81f5={};_0x4e81f5[_0x486602[_0x96b3('0x2c')]]={'$like':'%'+_0x117309[_0x96b3('0x2e')][_0x96b3('0x37')]+'%'};return _0x4e81f5;}})});}_0x467364=_[_0x96b3('0x3a')]({},_0x467364,_0x117309[_0x96b3('0x3b')]);var _0x347072={'where':_0x467364[_0x96b3('0x38')]};return db['ZohoField'][_0x96b3('0x18')](_0x347072)[_0x96b3('0x20')](function(_0x13ad99){_0x3d7d6a[_0x96b3('0x18')]=_0x13ad99;if(_0x117309['query']['includeAll']){_0x467364['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x467364);})['then'](function(_0x225162){_0x3d7d6a[_0x96b3('0x3c')]=_0x225162;return _0x3d7d6a;})[_0x96b3('0x20')](respondWithFilteredResult(_0x52af64,_0x467364))[_0x96b3('0x3d')](handleError(_0x52af64,null));};exports[_0x96b3('0x3e')]=function(_0x244020,_0x32d4de){var _0x266493={'raw':!![],'where':{'id':_0x244020[_0x96b3('0x3f')]['id']}},_0x12e00d={};_0x12e00d[_0x96b3('0x2b')]=_[_0x96b3('0x2d')](db[_0x96b3('0x26')]['rawAttributes']);_0x12e00d[_0x96b3('0x2e')]=_[_0x96b3('0x2d')](_0x244020[_0x96b3('0x2e')]);_0x12e00d['filters']=_[_0x96b3('0x31')](_0x12e00d[_0x96b3('0x2b')],_0x12e00d[_0x96b3('0x2e')]);_0x266493[_0x96b3('0x30')]=_[_0x96b3('0x31')](_0x12e00d[_0x96b3('0x2b')],qs[_0x96b3('0x32')](_0x244020[_0x96b3('0x2e')][_0x96b3('0x32')]));_0x266493[_0x96b3('0x30')]=_0x266493['attributes'][_0x96b3('0x40')]?_0x266493['attributes']:_0x12e00d[_0x96b3('0x2b')];if(_0x244020[_0x96b3('0x2e')][_0x96b3('0x41')]){_0x266493[_0x96b3('0x42')]=[{'all':!![]}];}_0x266493=_[_0x96b3('0x3a')]({},_0x266493,_0x244020[_0x96b3('0x3b')]);return db[_0x96b3('0x26')][_0x96b3('0x43')](_0x266493)['then'](handleEntityNotFound(_0x32d4de,null))[_0x96b3('0x20')](respondWithResult(_0x32d4de,null))[_0x96b3('0x3d')](handleError(_0x32d4de,null));};exports[_0x96b3('0x44')]=function(_0x335a57,_0x30dc58){return db[_0x96b3('0x26')][_0x96b3('0x44')](_0x335a57[_0x96b3('0x45')],{})[_0x96b3('0x20')](respondWithResult(_0x30dc58,0xc9))[_0x96b3('0x3d')](handleError(_0x30dc58,null));};exports[_0x96b3('0x1f')]=function(_0x289348,_0x6ef584){if(_0x289348[_0x96b3('0x45')]['id']){delete _0x289348['body']['id'];}return db[_0x96b3('0x26')]['find']({'where':{'id':_0x289348[_0x96b3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x6ef584,null))['then'](saveUpdates(_0x289348[_0x96b3('0x45')],null))[_0x96b3('0x20')](respondWithResult(_0x6ef584,null))[_0x96b3('0x3d')](handleError(_0x6ef584,null));};exports[_0x96b3('0x46')]=function(_0x591000,_0x2561bc){return db[_0x96b3('0x26')]['find']({'where':{'id':_0x591000[_0x96b3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2561bc,null))['then'](removeEntity(_0x2561bc,null))[_0x96b3('0x3d')](handleError(_0x2561bc,null));}; \ No newline at end of file +var _0x160a=['sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','length','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x13be87,_0xebc47c){var _0x15334b=function(_0x20ba31){while(--_0x20ba31){_0x13be87['push'](_0x13be87['shift']());}};_0x15334b(++_0xebc47c);}(_0x160a,0x79));var _0xa160=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x160a[_0x10dfdf];return _0x4d857d;};'use strict';var emlformat=require(_0xa160('0x0'));var rimraf=require(_0xa160('0x1'));var zipdir=require(_0xa160('0x2'));var jsonpatch=require(_0xa160('0x3'));var rp=require(_0xa160('0x4'));var moment=require('moment');var BPromise=require(_0xa160('0x5'));var Mustache=require(_0xa160('0x6'));var util=require(_0xa160('0x7'));var path=require(_0xa160('0x8'));var sox=require(_0xa160('0x9'));var csv=require(_0xa160('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa160('0xb'));var _=require(_0xa160('0xc'));var squel=require('squel');var crypto=require(_0xa160('0xd'));var jsforce=require(_0xa160('0xe'));var deskjs=require(_0xa160('0xf'));var toCsv=require(_0xa160('0xa'));var querystring=require(_0xa160('0x10'));var Papa=require(_0xa160('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa160('0x12'));var as=require(_0xa160('0x13'));var hardwareService=require(_0xa160('0x14'));var logger=require(_0xa160('0x15'))(_0xa160('0x16'));var utils=require(_0xa160('0x17'));var config=require(_0xa160('0x18'));var licenseUtil=require(_0xa160('0x19'));var db=require(_0xa160('0x1a'))['db'];function respondWithStatusCode(_0x4fa923,_0x3148a7){_0x3148a7=_0x3148a7||0xcc;return function(_0x7d0c52){if(_0x7d0c52){return _0x4fa923[_0xa160('0x1b')](_0x3148a7);}return _0x4fa923[_0xa160('0x1c')](_0x3148a7)[_0xa160('0x1d')]();};}function respondWithResult(_0x5f4107,_0x4aff94){_0x4aff94=_0x4aff94||0xc8;return function(_0x13d8de){if(_0x13d8de){return _0x5f4107['status'](_0x4aff94)[_0xa160('0x1e')](_0x13d8de);}};}function respondWithFilteredResult(_0x3dbfe5,_0x516e0b){return function(_0x38c80c){if(_0x38c80c){var _0x47155c=typeof _0x516e0b[_0xa160('0x1f')]==='undefined'&&typeof _0x516e0b[_0xa160('0x20')]==='undefined';var _0x3d54f=_0x38c80c[_0xa160('0x21')];var _0x48f8c2=_0x47155c?0x0:_0x516e0b['offset'];var _0x19dabf=_0x47155c?_0x38c80c[_0xa160('0x21')]:_0x516e0b[_0xa160('0x1f')]+_0x516e0b[_0xa160('0x20')];var _0x18047b;if(_0x19dabf>=_0x3d54f){_0x19dabf=_0x3d54f;_0x18047b=0xc8;}else{_0x18047b=0xce;}_0x3dbfe5[_0xa160('0x1c')](_0x18047b);return _0x3dbfe5['set'](_0xa160('0x22'),_0x48f8c2+'-'+_0x19dabf+'/'+_0x3d54f)[_0xa160('0x1e')](_0x38c80c);}return null;};}function patchUpdates(_0x226f84){return function(_0x4036df){try{jsonpatch[_0xa160('0x23')](_0x4036df,_0x226f84,!![]);}catch(_0x2b2057){return BPromise[_0xa160('0x24')](_0x2b2057);}return _0x4036df[_0xa160('0x25')]();};}function saveUpdates(_0x418ace,_0x2794bf){return function(_0x338bbc){if(_0x338bbc){return _0x338bbc[_0xa160('0x26')](_0x418ace)[_0xa160('0x27')](function(_0x8ffb4f){return _0x8ffb4f;});}return null;};}function removeEntity(_0x4d66f6,_0xa46a03){return function(_0x2d5a85){if(_0x2d5a85){return _0x2d5a85[_0xa160('0x28')]()[_0xa160('0x27')](function(){_0x4d66f6[_0xa160('0x1c')](0xcc)[_0xa160('0x1d')]();});}};}function handleEntityNotFound(_0x4069de,_0x4bd0c3){return function(_0x21697d){if(!_0x21697d){_0x4069de[_0xa160('0x1b')](0x194);}return _0x21697d;};}function handleError(_0x41d219,_0xdae508){_0xdae508=_0xdae508||0x1f4;return function(_0x469175){logger[_0xa160('0x29')](_0x469175[_0xa160('0x2a')]);if(_0x469175[_0xa160('0x2b')]){delete _0x469175[_0xa160('0x2b')];}_0x41d219[_0xa160('0x1c')](_0xdae508)['send'](_0x469175);};}exports['index']=function(_0xd5d6d2,_0x539d5b){var _0x50d0d7={},_0x3b7f49={},_0x50c56a={'count':0x0,'rows':[]};var _0xaa30a9=_[_0xa160('0x2c')](db[_0xa160('0x2d')][_0xa160('0x2e')],function(_0x295c3a){return{'name':_0x295c3a[_0xa160('0x2f')],'type':_0x295c3a[_0xa160('0x30')]['key']};});_0x3b7f49[_0xa160('0x31')]=_[_0xa160('0x2c')](_0xaa30a9,_0xa160('0x2b'));_0x3b7f49[_0xa160('0x32')]=_[_0xa160('0x33')](_0xd5d6d2[_0xa160('0x32')]);_0x3b7f49[_0xa160('0x34')]=_[_0xa160('0x35')](_0x3b7f49['model'],_0x3b7f49[_0xa160('0x32')]);_0x50d0d7[_0xa160('0x36')]=_[_0xa160('0x35')](_0x3b7f49[_0xa160('0x31')],qs[_0xa160('0x37')](_0xd5d6d2[_0xa160('0x32')][_0xa160('0x37')]));_0x50d0d7[_0xa160('0x36')]=_0x50d0d7[_0xa160('0x36')]['length']?_0x50d0d7[_0xa160('0x36')]:_0x3b7f49[_0xa160('0x31')];if(!_0xd5d6d2[_0xa160('0x32')][_0xa160('0x38')](_0xa160('0x39'))){_0x50d0d7[_0xa160('0x20')]=qs['limit'](_0xd5d6d2['query'][_0xa160('0x20')]);_0x50d0d7['offset']=qs[_0xa160('0x1f')](_0xd5d6d2[_0xa160('0x32')][_0xa160('0x1f')]);}_0x50d0d7[_0xa160('0x3a')]=qs['sort'](_0xd5d6d2['query']['sort']);_0x50d0d7[_0xa160('0x3b')]=qs[_0xa160('0x34')](_[_0xa160('0x3c')](_0xd5d6d2[_0xa160('0x32')],_0x3b7f49[_0xa160('0x34')]),_0xaa30a9);if(_0xd5d6d2[_0xa160('0x32')]['filter']){_0x50d0d7[_0xa160('0x3b')]=_['merge'](_0x50d0d7[_0xa160('0x3b')],{'$or':_['map'](_0xaa30a9,function(_0x534e38){if(_0x534e38[_0xa160('0x30')]!==_0xa160('0x3d')){var _0x1a33ad={};_0x1a33ad[_0x534e38[_0xa160('0x2b')]]={'$like':'%'+_0xd5d6d2[_0xa160('0x32')][_0xa160('0x3e')]+'%'};return _0x1a33ad;}})});}_0x50d0d7=_['merge']({},_0x50d0d7,_0xd5d6d2[_0xa160('0x3f')]);var _0x248246={'where':_0x50d0d7[_0xa160('0x3b')]};return db['ZohoField'][_0xa160('0x21')](_0x248246)[_0xa160('0x27')](function(_0x43845e){_0x50c56a[_0xa160('0x21')]=_0x43845e;if(_0xd5d6d2[_0xa160('0x32')][_0xa160('0x40')]){_0x50d0d7[_0xa160('0x41')]=[{'all':!![]}];}return db[_0xa160('0x2d')][_0xa160('0x42')](_0x50d0d7);})[_0xa160('0x27')](function(_0x34ed24){_0x50c56a['rows']=_0x34ed24;return _0x50c56a;})[_0xa160('0x27')](respondWithFilteredResult(_0x539d5b,_0x50d0d7))[_0xa160('0x43')](handleError(_0x539d5b,null));};exports['show']=function(_0x581a95,_0x22c4b6){var _0x46b2bd={'raw':!![],'where':{'id':_0x581a95[_0xa160('0x44')]['id']}},_0x59c8df={};_0x59c8df[_0xa160('0x31')]=_['keys'](db[_0xa160('0x2d')]['rawAttributes']);_0x59c8df[_0xa160('0x32')]=_['keys'](_0x581a95['query']);_0x59c8df['filters']=_[_0xa160('0x35')](_0x59c8df[_0xa160('0x31')],_0x59c8df[_0xa160('0x32')]);_0x46b2bd[_0xa160('0x36')]=_[_0xa160('0x35')](_0x59c8df['model'],qs[_0xa160('0x37')](_0x581a95['query'][_0xa160('0x37')]));_0x46b2bd['attributes']=_0x46b2bd[_0xa160('0x36')][_0xa160('0x45')]?_0x46b2bd['attributes']:_0x59c8df[_0xa160('0x31')];if(_0x581a95[_0xa160('0x32')][_0xa160('0x40')]){_0x46b2bd[_0xa160('0x41')]=[{'all':!![]}];}_0x46b2bd=_[_0xa160('0x46')]({},_0x46b2bd,_0x581a95[_0xa160('0x3f')]);return db[_0xa160('0x2d')][_0xa160('0x47')](_0x46b2bd)[_0xa160('0x27')](handleEntityNotFound(_0x22c4b6,null))['then'](respondWithResult(_0x22c4b6,null))[_0xa160('0x43')](handleError(_0x22c4b6,null));};exports[_0xa160('0x48')]=function(_0x162f7b,_0x444630){return db[_0xa160('0x2d')][_0xa160('0x48')](_0x162f7b['body'],{})[_0xa160('0x27')](respondWithResult(_0x444630,0xc9))[_0xa160('0x43')](handleError(_0x444630,null));};exports['update']=function(_0x19b8df,_0x10811f){if(_0x19b8df[_0xa160('0x49')]['id']){delete _0x19b8df[_0xa160('0x49')]['id'];}return db[_0xa160('0x2d')][_0xa160('0x47')]({'where':{'id':_0x19b8df['params']['id']}})[_0xa160('0x27')](handleEntityNotFound(_0x10811f,null))[_0xa160('0x27')](saveUpdates(_0x19b8df[_0xa160('0x49')],null))[_0xa160('0x27')](respondWithResult(_0x10811f,null))[_0xa160('0x43')](handleError(_0x10811f,null));};exports[_0xa160('0x28')]=function(_0x208bff,_0x4448dd){return db[_0xa160('0x2d')][_0xa160('0x47')]({'where':{'id':_0x208bff[_0xa160('0x44')]['id']}})[_0xa160('0x27')](handleEntityNotFound(_0x4448dd,null))[_0xa160('0x27')](removeEntity(_0x4448dd,null))[_0xa160('0x43')](handleError(_0x4448dd,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index feaadce..91ce3ba 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 _0xdb28=['../../config/environment','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1c839c,_0x3f80e4){var _0x2a912c=function(_0x256c47){while(--_0x256c47){_0x1c839c['push'](_0x1c839c['shift']());}};_0x2a912c(++_0x3f80e4);}(_0xdb28,0x106));var _0x8db2=function(_0x8e1bbd,_0x2a58ee){_0x8e1bbd=_0x8e1bbd-0x0;var _0x2d5768=_0xdb28[_0x8e1bbd];return _0x2d5768;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intZohoField.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'name':_0x8db2('0xc'),'fields':[_0x8db2('0xd'),_0x8db2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4137=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c08cb,_0x456960){var _0x147907=function(_0x1da1be){while(--_0x1da1be){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x147907(++_0x456960);}(_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 logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));module[_0x7413('0xb')]=function(_0x4fbade,_0xc808cd){return _0x4fbade[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':_0x7413('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x7413('0xf'),_0x7413('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index fd485fd..8619d7a 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 _0xa47b=['info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2f80f7,_0xaa774c){var _0x198a88=function(_0x33820e){while(--_0x33820e){_0x2f80f7['push'](_0x2f80f7['shift']());}};_0x198a88(++_0xaa774c);}(_0xa47b,0x99));var _0xba47=function(_0x5d40e7,_0x40df86){_0x5d40e7=_0x5d40e7-0x0;var _0x26c408=_0xa47b[_0x5d40e7];return _0x26c408;};'use strict';var _=require(_0xba47('0x0'));var util=require('util');var moment=require(_0xba47('0x1'));var BPromise=require(_0xba47('0x2'));var rs=require(_0xba47('0x3'));var fs=require('fs');var Redis=require(_0xba47('0x4'));var db=require(_0xba47('0x5'))['db'];var utils=require(_0xba47('0x6'));var logger=require(_0xba47('0x7'))(_0xba47('0x8'));var config=require(_0xba47('0x9'));var jayson=require(_0xba47('0xa'));var client=jayson[_0xba47('0xb')][_0xba47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b0ee2,_0x1badae,_0x5f0081){return new BPromise(function(_0xe755f7,_0x1f4e1b){return client[_0xba47('0xd')](_0x5b0ee2,_0x5f0081)[_0xba47('0xe')](function(_0x21ed17){logger[_0xba47('0xf')]('ZohoField,\x20%s,\x20%s',_0x1badae,_0xba47('0x10'));logger[_0xba47('0x11')](_0xba47('0x12'),_0x1badae,_0xba47('0x10'),JSON['stringify'](_0x21ed17));if(_0x21ed17[_0xba47('0x13')]){if(_0x21ed17[_0xba47('0x13')]['code']===0x1f4){logger['error'](_0xba47('0x14'),_0x1badae,_0x21ed17['error'][_0xba47('0x15')]);return _0x1f4e1b(_0x21ed17[_0xba47('0x13')][_0xba47('0x15')]);}logger[_0xba47('0x13')]('ZohoField,\x20%s,\x20%s',_0x1badae,_0x21ed17[_0xba47('0x13')][_0xba47('0x15')]);return _0xe755f7(_0x21ed17[_0xba47('0x13')]['message']);}else{logger[_0xba47('0xf')](_0xba47('0x14'),_0x1badae,_0xba47('0x10'));_0xe755f7(_0x21ed17[_0xba47('0x16')][_0xba47('0x15')]);}})[_0xba47('0x17')](function(_0x450975){logger[_0xba47('0x13')](_0xba47('0x14'),_0x1badae,_0x450975);_0x1f4e1b(_0x450975);});});} \ No newline at end of file +var _0xe45e=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x39ccd6,_0x1bd838){var _0x4165a4=function(_0x8998e4){while(--_0x8998e4){_0x39ccd6['push'](_0x39ccd6['shift']());}};_0x4165a4(++_0x1bd838);}(_0xe45e,0xfe));var _0xee45=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xe45e[_0x2a0738];return _0x159679;};'use strict';var _=require(_0xee45('0x0'));var util=require(_0xee45('0x1'));var moment=require(_0xee45('0x2'));var BPromise=require(_0xee45('0x3'));var rs=require(_0xee45('0x4'));var fs=require('fs');var Redis=require(_0xee45('0x5'));var db=require(_0xee45('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xee45('0x7'))('rpc');var config=require(_0xee45('0x8'));var jayson=require(_0xee45('0x9'));var client=jayson[_0xee45('0xa')][_0xee45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20aad4,_0x5504e7,_0x5710f2){return new BPromise(function(_0x2acf9e,_0x1fd583){return client['request'](_0x20aad4,_0x5710f2)['then'](function(_0x5b1884){logger[_0xee45('0xc')](_0xee45('0xd'),_0x5504e7,_0xee45('0xe'));logger[_0xee45('0xf')](_0xee45('0x10'),_0x5504e7,'request\x20sent',JSON[_0xee45('0x11')](_0x5b1884));if(_0x5b1884['error']){if(_0x5b1884[_0xee45('0x12')]['code']===0x1f4){logger[_0xee45('0x12')](_0xee45('0xd'),_0x5504e7,_0x5b1884['error'][_0xee45('0x13')]);return _0x1fd583(_0x5b1884[_0xee45('0x12')]['message']);}logger[_0xee45('0x12')](_0xee45('0xd'),_0x5504e7,_0x5b1884['error'][_0xee45('0x13')]);return _0x2acf9e(_0x5b1884['error'][_0xee45('0x13')]);}else{logger[_0xee45('0xc')](_0xee45('0xd'),_0x5504e7,'request\x20sent');_0x2acf9e(_0x5b1884[_0xee45('0x14')][_0xee45('0x13')]);}})['catch'](function(_0x53acc2){logger[_0xee45('0x12')](_0xee45('0xd'),_0x5504e7,_0x53acc2);_0x1fd583(_0x53acc2);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2770730..7e9400b 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(_0x48fcb1,_0x4317bd){var _0x3ec22a=function(_0x10dfb5){while(--_0x10dfb5){_0x48fcb1['push'](_0x48fcb1['shift']());}};_0x3ec22a(++_0x4317bd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1c8e1c,_0x2b9486){var _0x590279=function(_0x11d213){while(--_0x11d213){_0x1c8e1c['push'](_0x1c8e1c['shift']());}};_0x590279(++_0x2b9486);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index d4d7759..0109af1 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 _0xe7a3=['app.js','BOOLEAN','state','exports','unique_name_and_version','STRING'];(function(_0x3e4002,_0x39d440){var _0x315278=function(_0x1e7aa2){while(--_0x1e7aa2){_0x3e4002['push'](_0x3e4002['shift']());}};_0x315278(++_0x39d440);}(_0xe7a3,0x1bf));var _0x3e7a=function(_0x426a60,_0x337d7a){_0x426a60=_0x426a60-0x0;var _0x324bd3=_0xe7a3[_0x426a60];return _0x324bd3;};'use strict';var Sequelize=require('sequelize');module[_0x3e7a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3e7a('0x1')},'version':{'type':Sequelize[_0x3e7a('0x2')],'allowNull':![],'unique':_0x3e7a('0x1')},'main':{'type':Sequelize[_0x3e7a('0x2')],'defaultValue':_0x3e7a('0x3')},'filename':{'type':Sequelize[_0x3e7a('0x2')]},'path':{'type':Sequelize[_0x3e7a('0x2')]},'type':{'type':Sequelize[_0x3e7a('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3e7a('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x3e7a('0x2')]},'logo':{'type':Sequelize[_0x3e7a('0x2')]},'state':{'type':Sequelize[_0x3e7a('0x2')],'unique':_0x3e7a('0x5')},'description':{'type':Sequelize[_0x3e7a('0x2')]},'title':{'type':Sequelize[_0x3e7a('0x2')]},'remoteUri':{'type':Sequelize[_0x3e7a('0x2')]},'link':{'type':Sequelize[_0x3e7a('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xebff=['unique_name_and_version','app.js','state','sequelize','STRING'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xebff,0xf8));var _0xfebf=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xebff[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require(_0xfebf('0x0'));module['exports']={'name':{'type':Sequelize[_0xfebf('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xfebf('0x1')],'allowNull':![],'unique':_0xfebf('0x2')},'main':{'type':Sequelize[_0xfebf('0x1')],'defaultValue':_0xfebf('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xfebf('0x1')]},'type':{'type':Sequelize[_0xfebf('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xfebf('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xfebf('0x4')},'description':{'type':Sequelize[_0xfebf('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index daf2711..f8463c8 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 _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x146edd,_0x2be255){var _0x46079b=function(_0x20ad8c){while(--_0x20ad8c){_0x146edd['push'](_0x146edd['shift']());}};_0x46079b(++_0x2be255);}(_0x4888,0x198));var _0x8488=function(_0x22aabe,_0x1667d4){_0x22aabe=_0x22aabe-0x0;var _0x7ae05=_0x4888[_0x22aabe];return _0x7ae05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));}; \ No newline at end of file +var _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x9582,0x95));var _0x2958=function(_0x58fa2b,_0x20f70e){_0x58fa2b=_0x58fa2b-0x0;var _0x11bd23=_0x9582[_0x58fa2b];return _0x11bd23;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b7bb117..838a84c 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 _0x3ec7=['integrations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x7d244c,_0x6fe6c1){var _0x1107ad=function(_0x333aea){while(--_0x333aea){_0x7d244c['push'](_0x7d244c['shift']());}};_0x1107ad(++_0x6fe6c1);}(_0x3ec7,0x1e2));var _0x73ec=function(_0x178f9f,_0xff3a22){_0x178f9f=_0x178f9f-0x0;var _0x175457=_0x3ec7[_0x178f9f];return _0x175457;};'use strict';var _=require('lodash');var util=require(_0x73ec('0x0'));var logger=require(_0x73ec('0x1'))(_0x73ec('0x2'));var moment=require(_0x73ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x73ec('0x4'));var fs=require('fs');var path=require(_0x73ec('0x5'));var rimraf=require(_0x73ec('0x6'));var config=require(_0x73ec('0x7'));var attributes=require(_0x73ec('0x8'));module[_0x73ec('0x9')]=function(_0x4b8bc9,_0x356a19){return _0x4b8bc9[_0x73ec('0xa')](_0x73ec('0xb'),attributes,{'tableName':_0x73ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87b5=['./integration.attributes','exports','Integration','integrations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x8c68b4,_0x4e32b7){var _0x22c99f=function(_0xc6aefe){while(--_0xc6aefe){_0x8c68b4['push'](_0x8c68b4['shift']());}};_0x22c99f(++_0x4e32b7);}(_0x87b5,0x67));var _0x587b=function(_0x527122,_0x596ead){_0x527122=_0x527122-0x0;var _0x4ab2d4=_0x87b5[_0x527122];return _0x4ab2d4;};'use strict';var _=require('lodash');var util=require(_0x587b('0x0'));var logger=require(_0x587b('0x1'))(_0x587b('0x2'));var moment=require(_0x587b('0x3'));var BPromise=require(_0x587b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x587b('0x5'));var rimraf=require(_0x587b('0x6'));var config=require('../../config/environment');var attributes=require(_0x587b('0x7'));module[_0x587b('0x8')]=function(_0x421909,_0x1cb516){return _0x421909['define'](_0x587b('0x9'),attributes,{'tableName':_0x587b('0xa'),'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 dc92167..708d543 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x875dc1,_0x580b7f){var _0x2077ae=function(_0x28c708){while(--_0x28c708){_0x875dc1['push'](_0x875dc1['shift']());}};_0x2077ae(++_0x580b7f);}(_0x2542,0x169));var _0x2254=function(_0x414f96,_0x396f5f){_0x414f96=_0x414f96-0x0;var _0x431985=_0x2542[_0x414f96];return _0x431985;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x27e336,_0x1ac35d){var _0xdb7dac=function(_0x3481ab){while(--_0x3481ab){_0x27e336['push'](_0x27e336['shift']());}};_0xdb7dac(++_0x1ac35d);}(_0x7880,0x1f4));var _0x0788=function(_0x5333ba,_0x22e1bb){_0x5333ba=_0x5333ba-0x0;var _0x20f9dc=_0x7880[_0x5333ba];return _0x20f9dc;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8f9f843..2b99830 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 _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x161b60,_0x539e02){var _0x4fffdd=function(_0x195d78){while(--_0x195d78){_0x161b60['push'](_0x161b60['shift']());}};_0x4fffdd(++_0x539e02);}(_0x1a85,0x178));var _0x51a8=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x1a85[_0x297c55];return _0x120389;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x44558a,_0x3404d5){var _0xe5cef4=function(_0x3e50a4){while(--_0x3e50a4){_0x44558a['push'](_0x44558a['shift']());}};_0xe5cef4(++_0x3404d5);}(_0x955f,0x1eb));var _0xf955=function(_0x20d022,_0x18d565){_0x20d022=_0x20d022-0x0;var _0x32552b=_0x955f[_0x20d022];return _0x32552b;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);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 2ce9af0..7464bbf 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 _0xafdc=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','RECEIVED'];(function(_0x1057a9,_0x30ac5d){var _0x1cc6a9=function(_0x411779){while(--_0x411779){_0x1057a9['push'](_0x1057a9['shift']());}};_0x1cc6a9(++_0x30ac5d);}(_0xafdc,0x18c));var _0xcafd=function(_0x3b7ee5,_0x16d7a2){_0x3b7ee5=_0x3b7ee5-0x0;var _0x3b6e15=_0xafdc[_0x3b7ee5];return _0x3b6e15;};'use strict';var Sequelize=require(_0xcafd('0x0'));module[_0xcafd('0x1')]={'integration':{'type':Sequelize[_0xcafd('0x2')]},'eventChannel':{'type':Sequelize[_0xcafd('0x2')]},'exitStatus':{'type':Sequelize[_0xcafd('0x2')]},'ticketId':{'type':Sequelize[_0xcafd('0x2')]},'integrationId':{'type':Sequelize[_0xcafd('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcafd('0x2')]},'calleridnum':{'type':Sequelize[_0xcafd('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xcafd('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xcafd('0x2')]},'agentcalledAt':{'type':Sequelize[_0xcafd('0x4')]},'agentconnectAt':{'type':Sequelize[_0xcafd('0x4')]},'holdtime':{'type':Sequelize[_0xcafd('0x3')]},'agentcomplete':{'type':Sequelize[_0xcafd('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcafd('0x4')]},'talktime':{'type':Sequelize[_0xcafd('0x3')]},'agentacw':{'type':Sequelize[_0xcafd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcafd('0x3')]},'reason':{'type':Sequelize[_0xcafd('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xcafd('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcafd('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcafd('0x4')]},'lastevent':{'type':Sequelize[_0xcafd('0x2')]},'channel':{'type':Sequelize[_0xcafd('0x2')]},'channelstate':{'type':Sequelize[_0xcafd('0x3')]},'channelstatedesc':{'type':Sequelize[_0xcafd('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcafd('0x2')]},'context':{'type':Sequelize[_0xcafd('0x2')]},'exten':{'type':Sequelize[_0xcafd('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xcafd('0x2')]},'destchannelstate':{'type':Sequelize[_0xcafd('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xcafd('0x2')]},'destcalleridnum':{'type':Sequelize[_0xcafd('0x2')]},'destcalleridname':{'type':Sequelize[_0xcafd('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xcafd('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xcafd('0x2')]},'destlanguage':{'type':Sequelize[_0xcafd('0x2')]},'destaccountcode':{'type':Sequelize[_0xcafd('0x2')]},'destcontext':{'type':Sequelize[_0xcafd('0x2')]},'destexten':{'type':Sequelize[_0xcafd('0x2')]},'destpriority':{'type':Sequelize[_0xcafd('0x2')]},'destuniqueid':{'type':Sequelize[_0xcafd('0x2')]},'messageId':{'type':Sequelize[_0xcafd('0x2')]},'inReplyTo':{'type':Sequelize[_0xcafd('0x2')]},'subject':{'type':Sequelize[_0xcafd('0x2')]},'from':{'type':Sequelize[_0xcafd('0x2')]},'to':{'type':Sequelize[_0xcafd('0x2')]},'cc':{'type':Sequelize[_0xcafd('0x2')]},'attachment':{'type':Sequelize[_0xcafd('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xcafd('0x6')]},'status':{'type':Sequelize['ENUM'](_0xcafd('0x7'),'SENDING',_0xcafd('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xcafd('0x2')]},'appdata':{'type':Sequelize[_0xcafd('0x2')]},'projectId':{'type':Sequelize[_0xcafd('0x3')]}}; \ No newline at end of file +var _0x74f9=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x33c49c,_0x51219a){var _0x3dceeb=function(_0x455219){while(--_0x455219){_0x33c49c['push'](_0x33c49c['shift']());}};_0x3dceeb(++_0x51219a);}(_0x74f9,0x11e));var _0x974f=function(_0x48d56a,_0x2e9164){_0x48d56a=_0x48d56a-0x0;var _0x271fe3=_0x74f9[_0x48d56a];return _0x271fe3;};'use strict';var Sequelize=require(_0x974f('0x0'));module[_0x974f('0x1')]={'integration':{'type':Sequelize[_0x974f('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x974f('0x2')]},'ticketId':{'type':Sequelize[_0x974f('0x2')]},'integrationId':{'type':Sequelize[_0x974f('0x3')]},'contacts':{'type':Sequelize[_0x974f('0x2')]},'uniqueid':{'type':Sequelize[_0x974f('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x974f('0x2')]},'queue':{'type':Sequelize[_0x974f('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x974f('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x974f('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x974f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x974f('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x974f('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x974f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x974f('0x4')]},'lastevent':{'type':Sequelize[_0x974f('0x2')]},'channel':{'type':Sequelize[_0x974f('0x2')]},'channelstate':{'type':Sequelize[_0x974f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x974f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x974f('0x2')]},'connectedlinename':{'type':Sequelize[_0x974f('0x2')]},'language':{'type':Sequelize[_0x974f('0x2')]},'accountcode':{'type':Sequelize[_0x974f('0x2')]},'context':{'type':Sequelize[_0x974f('0x2')]},'exten':{'type':Sequelize[_0x974f('0x2')]},'priority':{'type':Sequelize[_0x974f('0x2')]},'destchannel':{'type':Sequelize[_0x974f('0x2')]},'destchannelstate':{'type':Sequelize[_0x974f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x974f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x974f('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x974f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x974f('0x2')]},'destlanguage':{'type':Sequelize[_0x974f('0x2')]},'destaccountcode':{'type':Sequelize[_0x974f('0x2')]},'destcontext':{'type':Sequelize[_0x974f('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x974f('0x2')]},'messageId':{'type':Sequelize[_0x974f('0x2')]},'inReplyTo':{'type':Sequelize[_0x974f('0x2')]},'subject':{'type':Sequelize[_0x974f('0x2')]},'from':{'type':Sequelize[_0x974f('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x974f('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x974f('0x6')]},'status':{'type':Sequelize[_0x974f('0x7')](_0x974f('0x8'),_0x974f('0x9'),_0x974f('0xa'),_0x974f('0xb'))},'url':{'type':Sequelize[_0x974f('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x974f('0x2')]},'projectId':{'type':Sequelize[_0x974f('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 6fd85fb..4fad255 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 _0x31e3=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','IntegrationReport','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x31e3,0x1c8));var _0x331e=function(_0x2cb236,_0x257fcf){_0x2cb236=_0x2cb236-0x0;var _0x480032=_0x31e3[_0x2cb236];return _0x480032;};'use strict';var emlformat=require(_0x331e('0x0'));var rimraf=require(_0x331e('0x1'));var zipdir=require(_0x331e('0x2'));var jsonpatch=require(_0x331e('0x3'));var rp=require(_0x331e('0x4'));var moment=require('moment');var BPromise=require(_0x331e('0x5'));var Mustache=require(_0x331e('0x6'));var util=require(_0x331e('0x7'));var path=require(_0x331e('0x8'));var sox=require(_0x331e('0x9'));var csv=require(_0x331e('0xa'));var ejs=require(_0x331e('0xb'));var fs=require('fs');var fs_extra=require(_0x331e('0xc'));var _=require(_0x331e('0xd'));var squel=require('squel');var crypto=require(_0x331e('0xe'));var jsforce=require(_0x331e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x331e('0xa'));var querystring=require(_0x331e('0x10'));var Papa=require(_0x331e('0x11'));var Redis=require(_0x331e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x331e('0x13'));var as=require(_0x331e('0x14'));var hardwareService=require(_0x331e('0x15'));var logger=require(_0x331e('0x16'))(_0x331e('0x17'));var utils=require(_0x331e('0x18'));var config=require(_0x331e('0x19'));var licenseUtil=require(_0x331e('0x1a'));var db=require(_0x331e('0x1b'))['db'];function respondWithStatusCode(_0x2972cb,_0x513ead){_0x513ead=_0x513ead||0xcc;return function(_0x248463){if(_0x248463){return _0x2972cb['sendStatus'](_0x513ead);}return _0x2972cb[_0x331e('0x1c')](_0x513ead)[_0x331e('0x1d')]();};}function respondWithResult(_0xde0057,_0x546079){_0x546079=_0x546079||0xc8;return function(_0x35e2d4){if(_0x35e2d4){return _0xde0057['status'](_0x546079)[_0x331e('0x1e')](_0x35e2d4);}};}function respondWithFilteredResult(_0x4f284c,_0x1d658c){return function(_0x47662f){if(_0x47662f){var _0x5d8303=typeof _0x1d658c[_0x331e('0x1f')]==='undefined'&&typeof _0x1d658c[_0x331e('0x20')]===_0x331e('0x21');var _0x164971=_0x47662f[_0x331e('0x22')];var _0x5149a2=_0x5d8303?0x0:_0x1d658c[_0x331e('0x1f')];var _0x332e36=_0x5d8303?_0x47662f[_0x331e('0x22')]:_0x1d658c[_0x331e('0x1f')]+_0x1d658c[_0x331e('0x20')];var _0x41d621;if(_0x332e36>=_0x164971){_0x332e36=_0x164971;_0x41d621=0xc8;}else{_0x41d621=0xce;}_0x4f284c[_0x331e('0x1c')](_0x41d621);return _0x4f284c[_0x331e('0x23')](_0x331e('0x24'),_0x5149a2+'-'+_0x332e36+'/'+_0x164971)[_0x331e('0x1e')](_0x47662f);}return null;};}function patchUpdates(_0x2d4515){return function(_0x2fc41d){try{jsonpatch[_0x331e('0x25')](_0x2fc41d,_0x2d4515,!![]);}catch(_0x3c6d59){return BPromise[_0x331e('0x26')](_0x3c6d59);}return _0x2fc41d[_0x331e('0x27')]();};}function saveUpdates(_0x14df81,_0x9c657){return function(_0x444fe8){if(_0x444fe8){return _0x444fe8[_0x331e('0x28')](_0x14df81)['then'](function(_0x3f4e62){return _0x3f4e62;});}return null;};}function removeEntity(_0x45ff0f,_0x1d0184){return function(_0x4c3773){if(_0x4c3773){return _0x4c3773[_0x331e('0x29')]()[_0x331e('0x2a')](function(){_0x45ff0f[_0x331e('0x1c')](0xcc)[_0x331e('0x1d')]();});}};}function handleEntityNotFound(_0x20c0b8,_0xa08c4f){return function(_0x1aded0){if(!_0x1aded0){_0x20c0b8[_0x331e('0x2b')](0x194);}return _0x1aded0;};}function handleError(_0x5590a9,_0x23d7ae){_0x23d7ae=_0x23d7ae||0x1f4;return function(_0x4919cf){logger[_0x331e('0x2c')](_0x4919cf[_0x331e('0x2d')]);if(_0x4919cf[_0x331e('0x2e')]){delete _0x4919cf[_0x331e('0x2e')];}_0x5590a9[_0x331e('0x1c')](_0x23d7ae)[_0x331e('0x2f')](_0x4919cf);};}exports['index']=function(_0x47a43d,_0x37ae2e){var _0x2ad31c={},_0xd9472b={},_0x4462b7={'count':0x0,'rows':[]};var _0x55fe07=_[_0x331e('0x30')](db[_0x331e('0x31')]['rawAttributes'],function(_0xc8c2a3){return{'name':_0xc8c2a3[_0x331e('0x32')],'type':_0xc8c2a3['type'][_0x331e('0x33')]};});_0xd9472b['model']=_['map'](_0x55fe07,'name');_0xd9472b[_0x331e('0x34')]=_['keys'](_0x47a43d['query']);_0xd9472b[_0x331e('0x35')]=_[_0x331e('0x36')](_0xd9472b[_0x331e('0x37')],_0xd9472b[_0x331e('0x34')]);_0x2ad31c['attributes']=_[_0x331e('0x36')](_0xd9472b[_0x331e('0x37')],qs[_0x331e('0x38')](_0x47a43d[_0x331e('0x34')]['fields']));_0x2ad31c[_0x331e('0x39')]=_0x2ad31c[_0x331e('0x39')][_0x331e('0x3a')]?_0x2ad31c[_0x331e('0x39')]:_0xd9472b[_0x331e('0x37')];if(!_0x47a43d['query'][_0x331e('0x3b')]('nolimit')){_0x2ad31c['limit']=qs[_0x331e('0x20')](_0x47a43d[_0x331e('0x34')][_0x331e('0x20')]);_0x2ad31c[_0x331e('0x1f')]=qs[_0x331e('0x1f')](_0x47a43d['query'][_0x331e('0x1f')]);}_0x2ad31c[_0x331e('0x3c')]=qs[_0x331e('0x3d')](_0x47a43d[_0x331e('0x34')]['sort']);_0x2ad31c[_0x331e('0x3e')]=qs[_0x331e('0x35')](_[_0x331e('0x3f')](_0x47a43d[_0x331e('0x34')],_0xd9472b[_0x331e('0x35')]),_0x55fe07);if(_0x47a43d[_0x331e('0x34')][_0x331e('0x40')]){_0x2ad31c[_0x331e('0x3e')]=_[_0x331e('0x41')](_0x2ad31c['where'],{'$or':_['map'](_0x55fe07,function(_0x330c0c){if(_0x330c0c['type']!==_0x331e('0x42')){var _0x2e8757={};_0x2e8757[_0x330c0c['name']]={'$like':'%'+_0x47a43d['query'][_0x331e('0x40')]+'%'};return _0x2e8757;}})});}_0x2ad31c=_[_0x331e('0x41')]({},_0x2ad31c,_0x47a43d[_0x331e('0x43')]);var _0x4bc387={'where':_0x2ad31c['where']};return db[_0x331e('0x31')]['count'](_0x4bc387)['then'](function(_0x49ee99){_0x4462b7[_0x331e('0x22')]=_0x49ee99;if(_0x47a43d[_0x331e('0x34')]['includeAll']){_0x2ad31c[_0x331e('0x44')]=[{'all':!![]}];}return db['IntegrationReport'][_0x331e('0x45')](_0x2ad31c);})[_0x331e('0x2a')](function(_0x3742fb){_0x4462b7[_0x331e('0x46')]=_0x3742fb;return _0x4462b7;})[_0x331e('0x2a')](respondWithFilteredResult(_0x37ae2e,_0x2ad31c))[_0x331e('0x47')](handleError(_0x37ae2e,null));};exports[_0x331e('0x48')]=function(_0x303ec8,_0x844799){var _0x4cad7c={'raw':![],'where':{'id':_0x303ec8[_0x331e('0x49')]['id']}},_0x21b1d7={};_0x21b1d7['model']=_['keys'](db['IntegrationReport'][_0x331e('0x4a')]);_0x21b1d7[_0x331e('0x34')]=_[_0x331e('0x4b')](_0x303ec8['query']);_0x21b1d7[_0x331e('0x35')]=_[_0x331e('0x36')](_0x21b1d7[_0x331e('0x37')],_0x21b1d7[_0x331e('0x34')]);_0x4cad7c[_0x331e('0x39')]=_[_0x331e('0x36')](_0x21b1d7[_0x331e('0x37')],qs[_0x331e('0x38')](_0x303ec8[_0x331e('0x34')][_0x331e('0x38')]));_0x4cad7c[_0x331e('0x39')]=_0x4cad7c[_0x331e('0x39')][_0x331e('0x3a')]?_0x4cad7c['attributes']:_0x21b1d7[_0x331e('0x37')];if(_0x303ec8[_0x331e('0x34')][_0x331e('0x4c')]){_0x4cad7c['include']=[{'all':!![]}];}_0x4cad7c=_['merge']({},_0x4cad7c,_0x303ec8[_0x331e('0x43')]);return db[_0x331e('0x31')][_0x331e('0x4d')](_0x4cad7c)['then'](handleEntityNotFound(_0x844799,null))[_0x331e('0x2a')](respondWithResult(_0x844799,null))[_0x331e('0x47')](handleError(_0x844799,null));};exports[_0x331e('0x4e')]=function(_0x2b33b9,_0x581abf){return db[_0x331e('0x31')][_0x331e('0x4e')](_0x2b33b9[_0x331e('0x4f')],{})[_0x331e('0x2a')](respondWithResult(_0x581abf,0xc9))[_0x331e('0x47')](handleError(_0x581abf,null));};exports[_0x331e('0x28')]=function(_0x5814aa,_0x274383){if(_0x5814aa[_0x331e('0x4f')]['id']){delete _0x5814aa[_0x331e('0x4f')]['id'];}return db['IntegrationReport'][_0x331e('0x4d')]({'where':{'id':_0x5814aa['params']['id']}})['then'](handleEntityNotFound(_0x274383,null))['then'](saveUpdates(_0x5814aa[_0x331e('0x4f')],null))[_0x331e('0x2a')](respondWithResult(_0x274383,null))[_0x331e('0x47')](handleError(_0x274383,null));};exports[_0x331e('0x29')]=function(_0x11b8d4,_0x4c7566){return db[_0x331e('0x31')][_0x331e('0x4d')]({'where':{'id':_0x11b8d4[_0x331e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c7566,null))['then'](removeEntity(_0x4c7566,null))[_0x331e('0x47')](handleError(_0x4c7566,null));};exports[_0x331e('0x50')]=function(_0xf164e7,_0x3ff05f){return db['IntegrationReport'][_0x331e('0x50')]()[_0x331e('0x2a')](respondWithResult(_0x3ff05f,null))[_0x331e('0x47')](handleError(_0x3ff05f,null));}; \ No newline at end of file +var _0x590f=['nolimit','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','keys','IntegrationReport','rawAttributes','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','querystring','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','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5a08f9,_0x2633c4){var _0x49dc98=function(_0x353c30){while(--_0x353c30){_0x5a08f9['push'](_0x5a08f9['shift']());}};_0x49dc98(++_0x2633c4);}(_0x590f,0x133));var _0xf590=function(_0x496464,_0x523e05){_0x496464=_0x496464-0x0;var _0x2f86f4=_0x590f[_0x496464];return _0x2f86f4;};'use strict';var emlformat=require(_0xf590('0x0'));var rimraf=require(_0xf590('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf590('0x2'));var rp=require(_0xf590('0x3'));var moment=require(_0xf590('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf590('0x5'));var util=require(_0xf590('0x6'));var path=require('path');var sox=require(_0xf590('0x7'));var csv=require('to-csv');var ejs=require(_0xf590('0x8'));var fs=require('fs');var fs_extra=require(_0xf590('0x9'));var _=require(_0xf590('0xa'));var squel=require(_0xf590('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf590('0xc'));var Papa=require('papaparse');var Redis=require(_0xf590('0xd'));var authService=require(_0xf590('0xe'));var qs=require(_0xf590('0xf'));var as=require(_0xf590('0x10'));var hardwareService=require(_0xf590('0x11'));var logger=require(_0xf590('0x12'))('api');var utils=require(_0xf590('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf590('0x14'));var db=require(_0xf590('0x15'))['db'];function respondWithStatusCode(_0x315c64,_0xca83d5){_0xca83d5=_0xca83d5||0xcc;return function(_0x474ff9){if(_0x474ff9){return _0x315c64[_0xf590('0x16')](_0xca83d5);}return _0x315c64[_0xf590('0x17')](_0xca83d5)[_0xf590('0x18')]();};}function respondWithResult(_0x4cdaf1,_0x2b5e24){_0x2b5e24=_0x2b5e24||0xc8;return function(_0xb7c4f){if(_0xb7c4f){return _0x4cdaf1[_0xf590('0x17')](_0x2b5e24)[_0xf590('0x19')](_0xb7c4f);}};}function respondWithFilteredResult(_0x92fc02,_0x150d6f){return function(_0x2267aa){if(_0x2267aa){var _0x5f063e=typeof _0x150d6f[_0xf590('0x1a')]===_0xf590('0x1b')&&typeof _0x150d6f['limit']===_0xf590('0x1b');var _0x3d7892=_0x2267aa[_0xf590('0x1c')];var _0x53f57e=_0x5f063e?0x0:_0x150d6f['offset'];var _0x47ed0e=_0x5f063e?_0x2267aa[_0xf590('0x1c')]:_0x150d6f[_0xf590('0x1a')]+_0x150d6f[_0xf590('0x1d')];var _0x27eb08;if(_0x47ed0e>=_0x3d7892){_0x47ed0e=_0x3d7892;_0x27eb08=0xc8;}else{_0x27eb08=0xce;}_0x92fc02[_0xf590('0x17')](_0x27eb08);return _0x92fc02[_0xf590('0x1e')](_0xf590('0x1f'),_0x53f57e+'-'+_0x47ed0e+'/'+_0x3d7892)[_0xf590('0x19')](_0x2267aa);}return null;};}function patchUpdates(_0x45f9f6){return function(_0xfa1103){try{jsonpatch[_0xf590('0x20')](_0xfa1103,_0x45f9f6,!![]);}catch(_0xedce07){return BPromise['reject'](_0xedce07);}return _0xfa1103[_0xf590('0x21')]();};}function saveUpdates(_0xb0745,_0x1a0a3e){return function(_0xa4f699){if(_0xa4f699){return _0xa4f699[_0xf590('0x22')](_0xb0745)['then'](function(_0x29e1b7){return _0x29e1b7;});}return null;};}function removeEntity(_0x48b9d3,_0x585993){return function(_0xf1c511){if(_0xf1c511){return _0xf1c511['destroy']()[_0xf590('0x23')](function(){_0x48b9d3['status'](0xcc)[_0xf590('0x18')]();});}};}function handleEntityNotFound(_0x1caebc,_0x1b3398){return function(_0x4dfce6){if(!_0x4dfce6){_0x1caebc[_0xf590('0x16')](0x194);}return _0x4dfce6;};}function handleError(_0x35c325,_0x3a7009){_0x3a7009=_0x3a7009||0x1f4;return function(_0x2bfb84){logger[_0xf590('0x24')](_0x2bfb84[_0xf590('0x25')]);if(_0x2bfb84[_0xf590('0x26')]){delete _0x2bfb84[_0xf590('0x26')];}_0x35c325[_0xf590('0x17')](_0x3a7009)[_0xf590('0x27')](_0x2bfb84);};}exports[_0xf590('0x28')]=function(_0x4123b1,_0x5a7e0d){var _0x317070={},_0x128830={},_0x459304={'count':0x0,'rows':[]};var _0x4dd2e9=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x2f622c){return{'name':_0x2f622c[_0xf590('0x29')],'type':_0x2f622c[_0xf590('0x2a')][_0xf590('0x2b')]};});_0x128830[_0xf590('0x2c')]=_[_0xf590('0x2d')](_0x4dd2e9,_0xf590('0x26'));_0x128830[_0xf590('0x2e')]=_['keys'](_0x4123b1[_0xf590('0x2e')]);_0x128830[_0xf590('0x2f')]=_[_0xf590('0x30')](_0x128830[_0xf590('0x2c')],_0x128830[_0xf590('0x2e')]);_0x317070[_0xf590('0x31')]=_[_0xf590('0x30')](_0x128830[_0xf590('0x2c')],qs['fields'](_0x4123b1[_0xf590('0x2e')][_0xf590('0x32')]));_0x317070['attributes']=_0x317070[_0xf590('0x31')][_0xf590('0x33')]?_0x317070[_0xf590('0x31')]:_0x128830['model'];if(!_0x4123b1[_0xf590('0x2e')][_0xf590('0x34')](_0xf590('0x35'))){_0x317070[_0xf590('0x1d')]=qs[_0xf590('0x1d')](_0x4123b1[_0xf590('0x2e')]['limit']);_0x317070[_0xf590('0x1a')]=qs[_0xf590('0x1a')](_0x4123b1[_0xf590('0x2e')][_0xf590('0x1a')]);}_0x317070['order']=qs[_0xf590('0x36')](_0x4123b1[_0xf590('0x2e')][_0xf590('0x36')]);_0x317070[_0xf590('0x37')]=qs[_0xf590('0x2f')](_[_0xf590('0x38')](_0x4123b1[_0xf590('0x2e')],_0x128830['filters']),_0x4dd2e9);if(_0x4123b1[_0xf590('0x2e')]['filter']){_0x317070['where']=_[_0xf590('0x39')](_0x317070[_0xf590('0x37')],{'$or':_['map'](_0x4dd2e9,function(_0x8213b5){if(_0x8213b5[_0xf590('0x2a')]!=='VIRTUAL'){var _0x263c47={};_0x263c47[_0x8213b5[_0xf590('0x26')]]={'$like':'%'+_0x4123b1[_0xf590('0x2e')]['filter']+'%'};return _0x263c47;}})});}_0x317070=_['merge']({},_0x317070,_0x4123b1[_0xf590('0x3a')]);var _0x3464d5={'where':_0x317070[_0xf590('0x37')]};return db['IntegrationReport'][_0xf590('0x1c')](_0x3464d5)[_0xf590('0x23')](function(_0x5847d5){_0x459304[_0xf590('0x1c')]=_0x5847d5;if(_0x4123b1[_0xf590('0x2e')][_0xf590('0x3b')]){_0x317070['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xf590('0x3c')](_0x317070);})[_0xf590('0x23')](function(_0x1be844){_0x459304[_0xf590('0x3d')]=_0x1be844;return _0x459304;})[_0xf590('0x23')](respondWithFilteredResult(_0x5a7e0d,_0x317070))[_0xf590('0x3e')](handleError(_0x5a7e0d,null));};exports[_0xf590('0x3f')]=function(_0x32557b,_0x4ed71a){var _0x4cf842={'raw':![],'where':{'id':_0x32557b['params']['id']}},_0x4d69b7={};_0x4d69b7[_0xf590('0x2c')]=_[_0xf590('0x40')](db[_0xf590('0x41')][_0xf590('0x42')]);_0x4d69b7[_0xf590('0x2e')]=_[_0xf590('0x40')](_0x32557b[_0xf590('0x2e')]);_0x4d69b7['filters']=_[_0xf590('0x30')](_0x4d69b7[_0xf590('0x2c')],_0x4d69b7[_0xf590('0x2e')]);_0x4cf842[_0xf590('0x31')]=_[_0xf590('0x30')](_0x4d69b7[_0xf590('0x2c')],qs[_0xf590('0x32')](_0x32557b[_0xf590('0x2e')][_0xf590('0x32')]));_0x4cf842[_0xf590('0x31')]=_0x4cf842['attributes'][_0xf590('0x33')]?_0x4cf842['attributes']:_0x4d69b7[_0xf590('0x2c')];if(_0x32557b['query'][_0xf590('0x3b')]){_0x4cf842['include']=[{'all':!![]}];}_0x4cf842=_[_0xf590('0x39')]({},_0x4cf842,_0x32557b[_0xf590('0x3a')]);return db[_0xf590('0x41')][_0xf590('0x43')](_0x4cf842)[_0xf590('0x23')](handleEntityNotFound(_0x4ed71a,null))[_0xf590('0x23')](respondWithResult(_0x4ed71a,null))['catch'](handleError(_0x4ed71a,null));};exports[_0xf590('0x44')]=function(_0x143ee7,_0x4914b8){return db[_0xf590('0x41')][_0xf590('0x44')](_0x143ee7['body'],{})[_0xf590('0x23')](respondWithResult(_0x4914b8,0xc9))[_0xf590('0x3e')](handleError(_0x4914b8,null));};exports[_0xf590('0x22')]=function(_0x2cabed,_0x3a2ac2){if(_0x2cabed[_0xf590('0x45')]['id']){delete _0x2cabed['body']['id'];}return db[_0xf590('0x41')][_0xf590('0x43')]({'where':{'id':_0x2cabed[_0xf590('0x46')]['id']}})[_0xf590('0x23')](handleEntityNotFound(_0x3a2ac2,null))[_0xf590('0x23')](saveUpdates(_0x2cabed[_0xf590('0x45')],null))[_0xf590('0x23')](respondWithResult(_0x3a2ac2,null))[_0xf590('0x3e')](handleError(_0x3a2ac2,null));};exports['destroy']=function(_0x4681c5,_0x565633){return db[_0xf590('0x41')][_0xf590('0x43')]({'where':{'id':_0x4681c5[_0xf590('0x46')]['id']}})[_0xf590('0x23')](handleEntityNotFound(_0x565633,null))[_0xf590('0x23')](removeEntity(_0x565633,null))['catch'](handleError(_0x565633,null));};exports[_0xf590('0x47')]=function(_0x53563e,_0x4a3460){return db[_0xf590('0x41')][_0xf590('0x47')]()['then'](respondWithResult(_0x4a3460,null))['catch'](handleError(_0x4a3460,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 5157114..9d0869f 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 _0x45b0=['define','IntegrationReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x5e6c43,_0x132a12){var _0x23d90e=function(_0x279b49){while(--_0x279b49){_0x5e6c43['push'](_0x5e6c43['shift']());}};_0x23d90e(++_0x132a12);}(_0x45b0,0x1a2));var _0x045b=function(_0x5892b2,_0xeb5018){_0x5892b2=_0x5892b2-0x0;var _0x3d7ed1=_0x45b0[_0x5892b2];return _0x3d7ed1;};'use strict';var _=require(_0x045b('0x0'));var util=require(_0x045b('0x1'));var logger=require('../../config/logger')(_0x045b('0x2'));var moment=require(_0x045b('0x3'));var BPromise=require(_0x045b('0x4'));var rp=require(_0x045b('0x5'));var fs=require('fs');var path=require(_0x045b('0x6'));var rimraf=require(_0x045b('0x7'));var config=require(_0x045b('0x8'));var attributes=require(_0x045b('0x9'));module[_0x045b('0xa')]=function(_0x308858,_0x106ce0){return _0x308858[_0x045b('0xb')](_0x045b('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb01a=['report_integration','lodash','util','../../config/logger','api','moment','../../config/environment','IntegrationReport'];(function(_0x169a8a,_0x3526b1){var _0x2e8502=function(_0x4c37f3){while(--_0x4c37f3){_0x169a8a['push'](_0x169a8a['shift']());}};_0x2e8502(++_0x3526b1);}(_0xb01a,0x129));var _0xab01=function(_0x16e4c4,_0x1e67a1){_0x16e4c4=_0x16e4c4-0x0;var _0x2896fe=_0xb01a[_0x16e4c4];return _0x2896fe;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var logger=require(_0xab01('0x2'))(_0xab01('0x3'));var moment=require(_0xab01('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xab01('0x5'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x318cb7,_0x41cd55){return _0x318cb7['define'](_0xab01('0x6'),attributes,{'tableName':_0xab01('0x7'),'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 dcb0000..4985666 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x23c901,_0x2e5c70){var _0x2b02ce=function(_0x3772db){while(--_0x3772db){_0x23c901['push'](_0x23c901['shift']());}};_0x2b02ce(++_0x2e5c70);}(_0x2675,0x75));var _0x5267=function(_0x53625f,_0x368a6a){_0x53625f=_0x53625f-0x0;var _0x5aa604=_0x2675[_0x53625f];return _0x5aa604;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +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(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'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 diff --git a/server/api/interval/index.js b/server/api/interval/index.js index af39532..aaadf3b 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 _0x5fed=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x104377,_0x54b94c){var _0x1fac22=function(_0xfd1f7f){while(--_0xfd1f7f){_0x104377['push'](_0x104377['shift']());}};_0x1fac22(++_0x54b94c);}(_0x5fed,0xed));var _0xd5fe=function(_0x280a2e,_0x244c6f){_0x280a2e=_0x280a2e-0x0;var _0x286f67=_0x5fed[_0x280a2e];return _0x286f67;};'use strict';var multer=require(_0xd5fe('0x0'));var util=require(_0xd5fe('0x1'));var path=require(_0xd5fe('0x2'));var timeout=require(_0xd5fe('0x3'));var express=require(_0xd5fe('0x4'));var router=express[_0xd5fe('0x5')]();var fs_extra=require(_0xd5fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd5fe('0x7'));var config=require(_0xd5fe('0x8'));var controller=require('./interval.controller');router[_0xd5fe('0x9')]('/',auth[_0xd5fe('0xa')](),controller[_0xd5fe('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd5fe('0xc')]);router[_0xd5fe('0x9')]('/:id/sub_intervals',auth[_0xd5fe('0xa')](),controller[_0xd5fe('0xd')]);router[_0xd5fe('0xe')]('/',auth['isAuthenticated'](),controller[_0xd5fe('0xf')]);router[_0xd5fe('0xe')](_0xd5fe('0x10'),auth[_0xd5fe('0xa')](),controller[_0xd5fe('0x11')]);router[_0xd5fe('0xe')](_0xd5fe('0x12'),auth[_0xd5fe('0xa')](),controller['addIntervals']);router['put'](_0xd5fe('0x13'),auth[_0xd5fe('0xa')](),controller[_0xd5fe('0x14')]);router[_0xd5fe('0x15')](_0xd5fe('0x13'),auth[_0xd5fe('0xa')](),controller[_0xd5fe('0x16')]);module[_0xd5fe('0x17')]=router; \ No newline at end of file +var _0x308a=['create','/:id/sub_intervals/create_many','addIntervals','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','post'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa308('0x0'));var util=require('util');var path=require(_0xa308('0x1'));var timeout=require(_0xa308('0x2'));var express=require(_0xa308('0x3'));var router=express[_0xa308('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa308('0x5'));var config=require(_0xa308('0x6'));var controller=require(_0xa308('0x7'));router[_0xa308('0x8')]('/',auth[_0xa308('0x9')](),controller[_0xa308('0xa')]);router[_0xa308('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa308('0xb')]);router[_0xa308('0x8')]('/:id/sub_intervals',auth[_0xa308('0x9')](),controller['getIntervals']);router[_0xa308('0xc')]('/',auth['isAuthenticated'](),controller[_0xa308('0xd')]);router[_0xa308('0xc')]('/:id/sub_intervals',auth[_0xa308('0x9')](),controller['addInterval']);router['post'](_0xa308('0xe'),auth[_0xa308('0x9')](),controller[_0xa308('0xf')]);router[_0xa308('0x10')](_0xa308('0x11'),auth[_0xa308('0x9')](),controller['update']);router[_0xa308('0x12')](_0xa308('0x11'),auth[_0xa308('0x9')](),controller[_0xa308('0x13')]);module[_0xa308('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4f95fdb..1f1d951 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 _0xa073=['STRING','sequelize','exports'];(function(_0x332308,_0x530040){var _0x4a15b2=function(_0x3c09bc){while(--_0x3c09bc){_0x332308['push'](_0x332308['shift']());}};_0x4a15b2(++_0x530040);}(_0xa073,0xdc));var _0x3a07=function(_0xc074a4,_0x29b618){_0xc074a4=_0xc074a4-0x0;var _0x19a114=_0xa073[_0xc074a4];return _0x19a114;};'use strict';var Sequelize=require(_0x3a07('0x0'));module[_0x3a07('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3a07('0x2')]},'interval':{'type':Sequelize[_0x3a07('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x0092=['STRING'];(function(_0x125c4c,_0x2704cc){var _0x21e21c=function(_0x1b3685){while(--_0x1b3685){_0x125c4c['push'](_0x125c4c['shift']());}};_0x21e21c(++_0x2704cc);}(_0x0092,0x1b1));var _0x2009=function(_0x11f418,_0x16283a){_0x11f418=_0x11f418-0x0;var _0x5d7f70=_0x0092[_0x11f418];return _0x5d7f70;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2009('0x0')]},'description':{'type':Sequelize[_0x2009('0x0')]},'interval':{'type':Sequelize[_0x2009('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8e8dd3d..16239c9 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 _0xea5f=['get','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','options','catch','create','body','user','role','Intervals','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','addIntervals','transaction','IntervalId','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','then','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea5f,0x90));var _0xfea5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xea5f[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfea5('0x0'));var zipdir=require(_0xfea5('0x1'));var jsonpatch=require(_0xfea5('0x2'));var rp=require(_0xfea5('0x3'));var moment=require(_0xfea5('0x4'));var BPromise=require(_0xfea5('0x5'));var Mustache=require(_0xfea5('0x6'));var util=require(_0xfea5('0x7'));var path=require(_0xfea5('0x8'));var sox=require(_0xfea5('0x9'));var csv=require('to-csv');var ejs=require(_0xfea5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfea5('0xb'));var squel=require(_0xfea5('0xc'));var crypto=require(_0xfea5('0xd'));var jsforce=require(_0xfea5('0xe'));var deskjs=require(_0xfea5('0xf'));var toCsv=require(_0xfea5('0x10'));var querystring=require(_0xfea5('0x11'));var Papa=require('papaparse');var Redis=require(_0xfea5('0x12'));var authService=require(_0xfea5('0x13'));var qs=require(_0xfea5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfea5('0x15'))(_0xfea5('0x16'));var utils=require(_0xfea5('0x17'));var config=require(_0xfea5('0x18'));var licenseUtil=require(_0xfea5('0x19'));var db=require(_0xfea5('0x1a'))['db'];var extensions=require(_0xfea5('0x1b'));function respondWithStatusCode(_0xc9f59a,_0x216e63){_0x216e63=_0x216e63||0xcc;return function(_0x143d29){if(_0x143d29){return _0xc9f59a[_0xfea5('0x1c')](_0x216e63);}return _0xc9f59a['status'](_0x216e63)[_0xfea5('0x1d')]();};}function respondWithResult(_0x472323,_0x56e6e5){_0x56e6e5=_0x56e6e5||0xc8;return function(_0x137831){if(_0x137831){return _0x472323['status'](_0x56e6e5)[_0xfea5('0x1e')](_0x137831);}};}function respondWithFilteredResult(_0x1ae97a,_0x378631){return function(_0xb87c00){if(_0xb87c00){var _0x4d9b9d=typeof _0x378631[_0xfea5('0x1f')]==='undefined'&&typeof _0x378631['limit']===_0xfea5('0x20');var _0x75599f=_0xb87c00[_0xfea5('0x21')];var _0x502493=_0x4d9b9d?0x0:_0x378631['offset'];var _0x33e407=_0x4d9b9d?_0xb87c00['count']:_0x378631[_0xfea5('0x1f')]+_0x378631[_0xfea5('0x22')];var _0x4966ad;if(_0x33e407>=_0x75599f){_0x33e407=_0x75599f;_0x4966ad=0xc8;}else{_0x4966ad=0xce;}_0x1ae97a[_0xfea5('0x23')](_0x4966ad);return _0x1ae97a[_0xfea5('0x24')](_0xfea5('0x25'),_0x502493+'-'+_0x33e407+'/'+_0x75599f)[_0xfea5('0x1e')](_0xb87c00);}return null;};}function patchUpdates(_0x15cc12){return function(_0x1d7464){try{jsonpatch['apply'](_0x1d7464,_0x15cc12,!![]);}catch(_0x197d6f){return BPromise['reject'](_0x197d6f);}return _0x1d7464[_0xfea5('0x26')]();};}function saveUpdates(_0x4bd5d2,_0x3b5a7d){return function(_0x3f96c5){if(_0x3f96c5){return _0x3f96c5[_0xfea5('0x27')](_0x4bd5d2)[_0xfea5('0x28')](function(_0x29c5fb){return _0x29c5fb;});}return null;};}function removeEntity(_0x12c8e4,_0x310adb){return function(_0x2160df){if(_0x2160df){return _0x2160df[_0xfea5('0x29')]()[_0xfea5('0x28')](function(){var _0x35aeec=_0x2160df[_0xfea5('0x2a')]({'plain':!![]});var _0x1a7345='Intervals';return db[_0xfea5('0x2b')][_0xfea5('0x29')]({'where':{'type':_0x1a7345,'resourceId':_0x35aeec['id']}})[_0xfea5('0x28')](function(){return _0x2160df;});})[_0xfea5('0x28')](function(){_0x12c8e4[_0xfea5('0x23')](0xcc)[_0xfea5('0x1d')]();});}};}function handleEntityNotFound(_0x588365,_0xaa7a5e){return function(_0x55f2a0){if(!_0x55f2a0){_0x588365[_0xfea5('0x1c')](0x194);}return _0x55f2a0;};}function handleError(_0x5e128e,_0x2da0a3){_0x2da0a3=_0x2da0a3||0x1f4;return function(_0x98d649){logger[_0xfea5('0x2c')](_0x98d649[_0xfea5('0x2d')]);if(_0x98d649['name']){delete _0x98d649[_0xfea5('0x2e')];}_0x5e128e[_0xfea5('0x23')](_0x2da0a3)['send'](_0x98d649);};}exports[_0xfea5('0x2f')]=function(_0x5a4ecb,_0x1a03f1){var _0x442a53={},_0x51d360={},_0x140301={'count':0x0,'rows':[]};var _0x7471de=_[_0xfea5('0x30')](db[_0xfea5('0x31')][_0xfea5('0x32')],function(_0x4a1101){return{'name':_0x4a1101['fieldName'],'type':_0x4a1101[_0xfea5('0x33')][_0xfea5('0x34')]};});_0x51d360[_0xfea5('0x35')]=_[_0xfea5('0x30')](_0x7471de,_0xfea5('0x2e'));_0x51d360[_0xfea5('0x36')]=_[_0xfea5('0x37')](_0x5a4ecb[_0xfea5('0x36')]);_0x51d360[_0xfea5('0x38')]=_[_0xfea5('0x39')](_0x51d360[_0xfea5('0x35')],_0x51d360[_0xfea5('0x36')]);_0x442a53[_0xfea5('0x3a')]=_[_0xfea5('0x39')](_0x51d360[_0xfea5('0x35')],qs[_0xfea5('0x3b')](_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x3b')]));_0x442a53[_0xfea5('0x3a')]=_0x442a53[_0xfea5('0x3a')][_0xfea5('0x3c')]?_0x442a53[_0xfea5('0x3a')]:_0x51d360[_0xfea5('0x35')];if(!_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x3d')](_0xfea5('0x3e'))){_0x442a53[_0xfea5('0x22')]=qs[_0xfea5('0x22')](_0x5a4ecb[_0xfea5('0x36')]['limit']);_0x442a53[_0xfea5('0x1f')]=qs['offset'](_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x1f')]);}_0x442a53[_0xfea5('0x3f')]=qs[_0xfea5('0x40')](_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x40')]);_0x442a53[_0xfea5('0x41')]=qs['filters'](_[_0xfea5('0x42')](_0x5a4ecb[_0xfea5('0x36')],_0x51d360[_0xfea5('0x38')]),_0x7471de);if(_0x5a4ecb[_0xfea5('0x36')]['filter']){_0x442a53['where']=_[_0xfea5('0x43')](_0x442a53[_0xfea5('0x41')],{'$or':_['map'](_0x7471de,function(_0x772079){if(_0x772079[_0xfea5('0x33')]!==_0xfea5('0x44')){var _0x51d52c={};_0x51d52c[_0x772079['name']]={'$like':'%'+_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x45')]+'%'};return _0x51d52c;}})});}_0x442a53=_[_0xfea5('0x43')]({},_0x442a53,_0x5a4ecb['options']);var _0x10f29c={'where':_0x442a53[_0xfea5('0x41')]};return db[_0xfea5('0x31')]['count'](_0x10f29c)[_0xfea5('0x28')](function(_0x296668){_0x140301[_0xfea5('0x21')]=_0x296668;if(_0x5a4ecb[_0xfea5('0x36')][_0xfea5('0x46')]){_0x442a53[_0xfea5('0x47')]=[{'all':!![]}];}return db['Interval'][_0xfea5('0x48')](_0x442a53);})[_0xfea5('0x28')](function(_0x5b7f0a){_0x140301['rows']=_0x5b7f0a;return _0x140301;})[_0xfea5('0x28')](respondWithFilteredResult(_0x1a03f1,_0x442a53))['catch'](handleError(_0x1a03f1,null));};exports[_0xfea5('0x49')]=function(_0x4bb6e3,_0x1ac4f3){var _0x3165cc={'raw':!![],'where':{'id':_0x4bb6e3[_0xfea5('0x4a')]['id']}},_0x52d2a5={};_0x52d2a5[_0xfea5('0x35')]=_[_0xfea5('0x37')](db[_0xfea5('0x31')][_0xfea5('0x32')]);_0x52d2a5['query']=_[_0xfea5('0x37')](_0x4bb6e3['query']);_0x52d2a5[_0xfea5('0x38')]=_['intersection'](_0x52d2a5[_0xfea5('0x35')],_0x52d2a5[_0xfea5('0x36')]);_0x3165cc['attributes']=_[_0xfea5('0x39')](_0x52d2a5[_0xfea5('0x35')],qs[_0xfea5('0x3b')](_0x4bb6e3[_0xfea5('0x36')][_0xfea5('0x3b')]));_0x3165cc[_0xfea5('0x3a')]=_0x3165cc[_0xfea5('0x3a')][_0xfea5('0x3c')]?_0x3165cc['attributes']:_0x52d2a5['model'];if(_0x4bb6e3[_0xfea5('0x36')]['includeAll']){_0x3165cc['include']=[{'all':!![]}];}_0x3165cc=_[_0xfea5('0x43')]({},_0x3165cc,_0x4bb6e3[_0xfea5('0x4b')]);return db['Interval']['find'](_0x3165cc)['then'](handleEntityNotFound(_0x1ac4f3,null))['then'](respondWithResult(_0x1ac4f3,null))[_0xfea5('0x4c')](handleError(_0x1ac4f3,null));};exports[_0xfea5('0x4d')]=function(_0x3149b7,_0x29af27){return db[_0xfea5('0x31')][_0xfea5('0x4d')](_0x3149b7[_0xfea5('0x4e')],{})[_0xfea5('0x28')](function(_0x144041){var _0x27c751=_0x3149b7[_0xfea5('0x4f')][_0xfea5('0x2a')]({'plain':!![]});if(!_0x27c751)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27c751[_0xfea5('0x50')]===_0xfea5('0x4f')){var _0x152412=_0x144041[_0xfea5('0x2a')]({'plain':!![]});var _0x3b2069=_0xfea5('0x51');return db['UserProfileSection'][_0xfea5('0x52')]({'where':{'name':_0x3b2069,'userProfileId':_0x27c751[_0xfea5('0x53')]},'raw':!![]})[_0xfea5('0x28')](function(_0xc724fc){if(_0xc724fc&&_0xc724fc[_0xfea5('0x54')]===0x0){return db[_0xfea5('0x2b')]['create']({'name':_0x152412[_0xfea5('0x2e')],'resourceId':_0x152412['id'],'type':_0xc724fc['name'],'sectionId':_0xc724fc['id']},{})[_0xfea5('0x28')](function(){return _0x144041;});}else{return _0x144041;}})[_0xfea5('0x4c')](function(_0x4bc1e5){logger[_0xfea5('0x2c')](_0xfea5('0x55'),_0x4bc1e5);throw _0x4bc1e5;});}return _0x144041;})['then'](respondWithResult(_0x29af27,0xc9))[_0xfea5('0x4c')](handleError(_0x29af27,null));};exports[_0xfea5('0x27')]=function(_0x5b8988,_0x44a727){if(_0x5b8988[_0xfea5('0x4e')]['id']){delete _0x5b8988[_0xfea5('0x4e')]['id'];}return db[_0xfea5('0x31')][_0xfea5('0x52')]({'where':{'id':_0x5b8988[_0xfea5('0x4a')]['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x44a727,null))['then'](saveUpdates(_0x5b8988[_0xfea5('0x4e')],null))[_0xfea5('0x28')](respondWithResult(_0x44a727,null))[_0xfea5('0x4c')](handleError(_0x44a727,null));};exports['destroy']=function(_0x25fee3,_0x2fc54e){return db['Interval'][_0xfea5('0x52')]({'where':{'id':_0x25fee3['params']['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x2fc54e,null))['then'](removeEntity(_0x2fc54e,null))[_0xfea5('0x4c')](handleError(_0x2fc54e,null));};exports[_0xfea5('0x56')]=function(_0x159c03,_0x5442c2,_0x3671a7){if(_0x159c03['body']['id']){delete _0x159c03[_0xfea5('0x4e')]['id'];}return db[_0xfea5('0x31')][_0xfea5('0x52')]({'where':{'id':_0x159c03[_0xfea5('0x4a')]['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x5442c2,null))[_0xfea5('0x28')](function(_0x30ab66){if(_0x30ab66){_0x159c03[_0xfea5('0x4e')]['IntervalId']=_0x30ab66['id'];return db[_0xfea5('0x31')][_0xfea5('0x4d')](_0x159c03[_0xfea5('0x4e')]);}})['then'](respondWithResult(_0x5442c2,null))[_0xfea5('0x4c')](handleError(_0x5442c2,null));};exports[_0xfea5('0x57')]=function(_0x5bb208,_0x453e4b,_0x52f4a5){var _0x4900cb={};var _0x51b398={};var _0x2e6dc;var _0x3bbdd2;return db[_0xfea5('0x31')][_0xfea5('0x58')]({'where':{'id':_0x5bb208['params']['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x453e4b,null))[_0xfea5('0x28')](function(_0x477876){if(_0x477876){_0x2e6dc=_0x477876;_0x51b398['model']=_[_0xfea5('0x37')](db['Interval'][_0xfea5('0x32')]);_0x51b398['query']=_['keys'](_0x5bb208['query']);_0x51b398[_0xfea5('0x38')]=_[_0xfea5('0x39')](_0x51b398[_0xfea5('0x35')],_0x51b398[_0xfea5('0x36')]);_0x4900cb[_0xfea5('0x3a')]=_[_0xfea5('0x39')](_0x51b398['model'],qs['fields'](_0x5bb208['query'][_0xfea5('0x3b')]));_0x4900cb[_0xfea5('0x3a')]=_0x4900cb[_0xfea5('0x3a')][_0xfea5('0x3c')]?_0x4900cb[_0xfea5('0x3a')]:_0x51b398[_0xfea5('0x35')];_0x4900cb[_0xfea5('0x3f')]=qs[_0xfea5('0x40')](_0x5bb208[_0xfea5('0x36')][_0xfea5('0x40')]);_0x4900cb[_0xfea5('0x41')]=qs['filters'](_[_0xfea5('0x42')](_0x5bb208[_0xfea5('0x36')],_0x51b398[_0xfea5('0x38')]));if(_0x5bb208['query'][_0xfea5('0x45')]){_0x4900cb[_0xfea5('0x41')]=_[_0xfea5('0x43')](_0x4900cb[_0xfea5('0x41')],{'$or':_['map'](_0x4900cb[_0xfea5('0x3a')],function(_0x281369){var _0x53ed43={};_0x53ed43[_0x281369]={'$like':'%'+_0x5bb208[_0xfea5('0x36')]['filter']+'%'};return _0x53ed43;})});}_0x4900cb=_[_0xfea5('0x43')]({},_0x4900cb,_0x5bb208[_0xfea5('0x4b')]);return _0x2e6dc[_0xfea5('0x57')](_0x4900cb);}})[_0xfea5('0x28')](function(_0x5c1edd){if(_0x5c1edd){_0x3bbdd2=_0x5c1edd[_0xfea5('0x3c')];if(!_0x5bb208[_0xfea5('0x36')][_0xfea5('0x3d')](_0xfea5('0x3e'))){_0x4900cb['limit']=qs['limit'](_0x5bb208[_0xfea5('0x36')][_0xfea5('0x22')]);_0x4900cb[_0xfea5('0x1f')]=qs[_0xfea5('0x1f')](_0x5bb208[_0xfea5('0x36')]['offset']);}return _0x2e6dc[_0xfea5('0x57')](_0x4900cb);}})['then'](function(_0x20519a){if(_0x20519a){return _0x20519a?{'count':_0x3bbdd2,'rows':_0x20519a}:null;}})[_0xfea5('0x28')](respondWithResult(_0x453e4b,null))[_0xfea5('0x4c')](handleError(_0x453e4b,null));};exports[_0xfea5('0x59')]=function(_0x5e1aa7,_0x2e5942,_0x180948){return db[_0xfea5('0x31')]['findOne']({'where':{'id':_0x5e1aa7['params']['id']}})[_0xfea5('0x28')](handleEntityNotFound(_0x2e5942,null))[_0xfea5('0x28')](function(_0x10c78f){if(_0x10c78f){return db['sequelize'][_0xfea5('0x5a')](function(_0x2dd4fb){return db['Interval'][_0xfea5('0x29')]({'where':{'IntervalId':_0x5e1aa7[_0xfea5('0x4a')]['id']},'transaction':_0x2dd4fb})[_0xfea5('0x28')](function(_0x153f7a){var _0x28b657=_[_0xfea5('0x30')](_0x5e1aa7['body'],function(_0x3607cf){delete _0x3607cf['id'];_0x3607cf[_0xfea5('0x5b')]=_0x5e1aa7[_0xfea5('0x4a')]['id'];return _0x3607cf;});return db['Interval'][_0xfea5('0x5c')](_0x28b657,{'transaction':_0x2dd4fb});});})['then'](function(){return db[_0xfea5('0x31')][_0xfea5('0x48')]({'where':{'IntervalId':_0x5e1aa7[_0xfea5('0x4a')]['id']}});});}})[_0xfea5('0x28')](respondWithResult(_0x2e5942,null))[_0xfea5('0x4c')](handleError(_0x2e5942,null));}; \ No newline at end of file +var _0xd668=['path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','map','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x3bc7f5,_0x292824){var _0x14fe99=function(_0x4db81d){while(--_0x4db81d){_0x3bc7f5['push'](_0x3bc7f5['shift']());}};_0x14fe99(++_0x292824);}(_0xd668,0x1bf));var _0x8d66=function(_0x2aaaf3,_0x136e41){_0x2aaaf3=_0x2aaaf3-0x0;var _0x4afb4b=_0xd668[_0x2aaaf3];return _0x4afb4b;};'use strict';var emlformat=require(_0x8d66('0x0'));var rimraf=require(_0x8d66('0x1'));var zipdir=require(_0x8d66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d66('0x3'));var moment=require(_0x8d66('0x4'));var BPromise=require(_0x8d66('0x5'));var Mustache=require(_0x8d66('0x6'));var util=require(_0x8d66('0x7'));var path=require(_0x8d66('0x8'));var sox=require(_0x8d66('0x9'));var csv=require(_0x8d66('0xa'));var ejs=require(_0x8d66('0xb'));var fs=require('fs');var fs_extra=require(_0x8d66('0xc'));var _=require('lodash');var squel=require(_0x8d66('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8d66('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8d66('0xf'));var Papa=require('papaparse');var Redis=require(_0x8d66('0x10'));var authService=require(_0x8d66('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8d66('0x12'));var hardwareService=require(_0x8d66('0x13'));var logger=require(_0x8d66('0x14'))('api');var utils=require(_0x8d66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8d66('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0x8d66('0x17'));function respondWithStatusCode(_0x528f30,_0x29697b){_0x29697b=_0x29697b||0xcc;return function(_0x15ec16){if(_0x15ec16){return _0x528f30[_0x8d66('0x18')](_0x29697b);}return _0x528f30[_0x8d66('0x19')](_0x29697b)[_0x8d66('0x1a')]();};}function respondWithResult(_0x1987f7,_0x36f0be){_0x36f0be=_0x36f0be||0xc8;return function(_0x7001f0){if(_0x7001f0){return _0x1987f7['status'](_0x36f0be)[_0x8d66('0x1b')](_0x7001f0);}};}function respondWithFilteredResult(_0x398412,_0x36bbb4){return function(_0x104a35){if(_0x104a35){var _0x357404=typeof _0x36bbb4['offset']==='undefined'&&typeof _0x36bbb4[_0x8d66('0x1c')]===_0x8d66('0x1d');var _0x171ae5=_0x104a35[_0x8d66('0x1e')];var _0x35e46b=_0x357404?0x0:_0x36bbb4['offset'];var _0x57a508=_0x357404?_0x104a35['count']:_0x36bbb4['offset']+_0x36bbb4[_0x8d66('0x1c')];var _0x1d3886;if(_0x57a508>=_0x171ae5){_0x57a508=_0x171ae5;_0x1d3886=0xc8;}else{_0x1d3886=0xce;}_0x398412[_0x8d66('0x19')](_0x1d3886);return _0x398412['set'](_0x8d66('0x1f'),_0x35e46b+'-'+_0x57a508+'/'+_0x171ae5)['json'](_0x104a35);}return null;};}function patchUpdates(_0xd6d0f7){return function(_0x1b1fa4){try{jsonpatch[_0x8d66('0x20')](_0x1b1fa4,_0xd6d0f7,!![]);}catch(_0x19970e){return BPromise[_0x8d66('0x21')](_0x19970e);}return _0x1b1fa4['save']();};}function saveUpdates(_0x4f0cf2,_0x30fccb){return function(_0x11f31c){if(_0x11f31c){return _0x11f31c['update'](_0x4f0cf2)[_0x8d66('0x22')](function(_0x1bab06){return _0x1bab06;});}return null;};}function removeEntity(_0x102dbf,_0x5d93c6){return function(_0x500b55){if(_0x500b55){return _0x500b55[_0x8d66('0x23')]()['then'](function(){var _0x21673d=_0x500b55[_0x8d66('0x24')]({'plain':!![]});var _0x44ef68=_0x8d66('0x25');return db[_0x8d66('0x26')][_0x8d66('0x23')]({'where':{'type':_0x44ef68,'resourceId':_0x21673d['id']}})[_0x8d66('0x22')](function(){return _0x500b55;});})[_0x8d66('0x22')](function(){_0x102dbf['status'](0xcc)[_0x8d66('0x1a')]();});}};}function handleEntityNotFound(_0x344408,_0x1ebe76){return function(_0x2fe868){if(!_0x2fe868){_0x344408[_0x8d66('0x18')](0x194);}return _0x2fe868;};}function handleError(_0x5530fc,_0x526b43){_0x526b43=_0x526b43||0x1f4;return function(_0xdb1d93){logger[_0x8d66('0x27')](_0xdb1d93[_0x8d66('0x28')]);if(_0xdb1d93[_0x8d66('0x29')]){delete _0xdb1d93[_0x8d66('0x29')];}_0x5530fc['status'](_0x526b43)[_0x8d66('0x2a')](_0xdb1d93);};}exports['index']=function(_0x214e4a,_0x35269c){var _0x3035b3={},_0x4ad0a3={},_0x74eb36={'count':0x0,'rows':[]};var _0x3d9e49=_['map'](db[_0x8d66('0x2b')][_0x8d66('0x2c')],function(_0xd6e5e){return{'name':_0xd6e5e[_0x8d66('0x2d')],'type':_0xd6e5e[_0x8d66('0x2e')][_0x8d66('0x2f')]};});_0x4ad0a3[_0x8d66('0x30')]=_['map'](_0x3d9e49,_0x8d66('0x29'));_0x4ad0a3[_0x8d66('0x31')]=_[_0x8d66('0x32')](_0x214e4a[_0x8d66('0x31')]);_0x4ad0a3[_0x8d66('0x33')]=_[_0x8d66('0x34')](_0x4ad0a3[_0x8d66('0x30')],_0x4ad0a3[_0x8d66('0x31')]);_0x3035b3[_0x8d66('0x35')]=_[_0x8d66('0x34')](_0x4ad0a3[_0x8d66('0x30')],qs[_0x8d66('0x36')](_0x214e4a['query'][_0x8d66('0x36')]));_0x3035b3[_0x8d66('0x35')]=_0x3035b3[_0x8d66('0x35')][_0x8d66('0x37')]?_0x3035b3[_0x8d66('0x35')]:_0x4ad0a3[_0x8d66('0x30')];if(!_0x214e4a[_0x8d66('0x31')][_0x8d66('0x38')](_0x8d66('0x39'))){_0x3035b3[_0x8d66('0x1c')]=qs[_0x8d66('0x1c')](_0x214e4a['query'][_0x8d66('0x1c')]);_0x3035b3[_0x8d66('0x3a')]=qs['offset'](_0x214e4a[_0x8d66('0x31')][_0x8d66('0x3a')]);}_0x3035b3[_0x8d66('0x3b')]=qs[_0x8d66('0x3c')](_0x214e4a['query'][_0x8d66('0x3c')]);_0x3035b3[_0x8d66('0x3d')]=qs[_0x8d66('0x33')](_[_0x8d66('0x3e')](_0x214e4a['query'],_0x4ad0a3['filters']),_0x3d9e49);if(_0x214e4a[_0x8d66('0x31')][_0x8d66('0x3f')]){_0x3035b3[_0x8d66('0x3d')]=_['merge'](_0x3035b3[_0x8d66('0x3d')],{'$or':_['map'](_0x3d9e49,function(_0x531fb6){if(_0x531fb6[_0x8d66('0x2e')]!=='VIRTUAL'){var _0x142418={};_0x142418[_0x531fb6['name']]={'$like':'%'+_0x214e4a[_0x8d66('0x31')]['filter']+'%'};return _0x142418;}})});}_0x3035b3=_[_0x8d66('0x40')]({},_0x3035b3,_0x214e4a[_0x8d66('0x41')]);var _0x2a4e90={'where':_0x3035b3[_0x8d66('0x3d')]};return db[_0x8d66('0x2b')]['count'](_0x2a4e90)['then'](function(_0x3b816e){_0x74eb36[_0x8d66('0x1e')]=_0x3b816e;if(_0x214e4a[_0x8d66('0x31')][_0x8d66('0x42')]){_0x3035b3[_0x8d66('0x43')]=[{'all':!![]}];}return db[_0x8d66('0x2b')]['findAll'](_0x3035b3);})[_0x8d66('0x22')](function(_0xab9237){_0x74eb36[_0x8d66('0x44')]=_0xab9237;return _0x74eb36;})[_0x8d66('0x22')](respondWithFilteredResult(_0x35269c,_0x3035b3))['catch'](handleError(_0x35269c,null));};exports[_0x8d66('0x45')]=function(_0x5563c2,_0x986c21){var _0x19aeab={'raw':!![],'where':{'id':_0x5563c2['params']['id']}},_0x3f523={};_0x3f523[_0x8d66('0x30')]=_['keys'](db[_0x8d66('0x2b')][_0x8d66('0x2c')]);_0x3f523[_0x8d66('0x31')]=_['keys'](_0x5563c2[_0x8d66('0x31')]);_0x3f523[_0x8d66('0x33')]=_[_0x8d66('0x34')](_0x3f523['model'],_0x3f523[_0x8d66('0x31')]);_0x19aeab[_0x8d66('0x35')]=_[_0x8d66('0x34')](_0x3f523[_0x8d66('0x30')],qs[_0x8d66('0x36')](_0x5563c2['query'][_0x8d66('0x36')]));_0x19aeab[_0x8d66('0x35')]=_0x19aeab[_0x8d66('0x35')][_0x8d66('0x37')]?_0x19aeab[_0x8d66('0x35')]:_0x3f523[_0x8d66('0x30')];if(_0x5563c2['query'][_0x8d66('0x42')]){_0x19aeab[_0x8d66('0x43')]=[{'all':!![]}];}_0x19aeab=_['merge']({},_0x19aeab,_0x5563c2[_0x8d66('0x41')]);return db[_0x8d66('0x2b')]['find'](_0x19aeab)[_0x8d66('0x22')](handleEntityNotFound(_0x986c21,null))['then'](respondWithResult(_0x986c21,null))[_0x8d66('0x46')](handleError(_0x986c21,null));};exports['create']=function(_0x515cef,_0x580a36){return db[_0x8d66('0x2b')][_0x8d66('0x47')](_0x515cef[_0x8d66('0x48')],{})[_0x8d66('0x22')](function(_0x32cad1){var _0xb03e84=_0x515cef['user'][_0x8d66('0x24')]({'plain':!![]});if(!_0xb03e84)throw new Error(_0x8d66('0x49'));if(_0xb03e84[_0x8d66('0x4a')]===_0x8d66('0x4b')){var _0x18ef02=_0x32cad1[_0x8d66('0x24')]({'plain':!![]});var _0x34db7f=_0x8d66('0x25');return db[_0x8d66('0x4c')][_0x8d66('0x4d')]({'where':{'name':_0x34db7f,'userProfileId':_0xb03e84[_0x8d66('0x4e')]},'raw':!![]})[_0x8d66('0x22')](function(_0x4694e4){if(_0x4694e4&&_0x4694e4['autoAssociation']===0x0){return db[_0x8d66('0x26')][_0x8d66('0x47')]({'name':_0x18ef02[_0x8d66('0x29')],'resourceId':_0x18ef02['id'],'type':_0x4694e4[_0x8d66('0x29')],'sectionId':_0x4694e4['id']},{})[_0x8d66('0x22')](function(){return _0x32cad1;});}else{return _0x32cad1;}})[_0x8d66('0x46')](function(_0x11df39){logger[_0x8d66('0x27')](_0x8d66('0x4f'),_0x11df39);throw _0x11df39;});}return _0x32cad1;})[_0x8d66('0x22')](respondWithResult(_0x580a36,0xc9))[_0x8d66('0x46')](handleError(_0x580a36,null));};exports[_0x8d66('0x50')]=function(_0x4b4f6c,_0x4d958e){if(_0x4b4f6c[_0x8d66('0x48')]['id']){delete _0x4b4f6c[_0x8d66('0x48')]['id'];}return db[_0x8d66('0x2b')][_0x8d66('0x4d')]({'where':{'id':_0x4b4f6c[_0x8d66('0x51')]['id']}})[_0x8d66('0x22')](handleEntityNotFound(_0x4d958e,null))[_0x8d66('0x22')](saveUpdates(_0x4b4f6c[_0x8d66('0x48')],null))[_0x8d66('0x22')](respondWithResult(_0x4d958e,null))['catch'](handleError(_0x4d958e,null));};exports[_0x8d66('0x23')]=function(_0x434f54,_0xed46a1){return db[_0x8d66('0x2b')]['find']({'where':{'id':_0x434f54[_0x8d66('0x51')]['id']}})['then'](handleEntityNotFound(_0xed46a1,null))[_0x8d66('0x22')](removeEntity(_0xed46a1,null))[_0x8d66('0x46')](handleError(_0xed46a1,null));};exports[_0x8d66('0x52')]=function(_0x3d814e,_0x1f989a,_0x254167){if(_0x3d814e[_0x8d66('0x48')]['id']){delete _0x3d814e[_0x8d66('0x48')]['id'];}return db[_0x8d66('0x2b')][_0x8d66('0x4d')]({'where':{'id':_0x3d814e[_0x8d66('0x51')]['id']}})[_0x8d66('0x22')](handleEntityNotFound(_0x1f989a,null))['then'](function(_0x4e8203){if(_0x4e8203){_0x3d814e[_0x8d66('0x48')][_0x8d66('0x53')]=_0x4e8203['id'];return db[_0x8d66('0x2b')]['create'](_0x3d814e['body']);}})[_0x8d66('0x22')](respondWithResult(_0x1f989a,null))['catch'](handleError(_0x1f989a,null));};exports['getIntervals']=function(_0x414178,_0x4cf958,_0x19d9af){var _0x23af07={};var _0x5ca52f={};var _0x4679e1;var _0x2f3537;return db[_0x8d66('0x2b')]['findOne']({'where':{'id':_0x414178[_0x8d66('0x51')]['id']}})[_0x8d66('0x22')](handleEntityNotFound(_0x4cf958,null))[_0x8d66('0x22')](function(_0x290f33){if(_0x290f33){_0x4679e1=_0x290f33;_0x5ca52f[_0x8d66('0x30')]=_[_0x8d66('0x32')](db[_0x8d66('0x2b')]['rawAttributes']);_0x5ca52f[_0x8d66('0x31')]=_[_0x8d66('0x32')](_0x414178[_0x8d66('0x31')]);_0x5ca52f[_0x8d66('0x33')]=_[_0x8d66('0x34')](_0x5ca52f[_0x8d66('0x30')],_0x5ca52f[_0x8d66('0x31')]);_0x23af07[_0x8d66('0x35')]=_[_0x8d66('0x34')](_0x5ca52f[_0x8d66('0x30')],qs[_0x8d66('0x36')](_0x414178[_0x8d66('0x31')]['fields']));_0x23af07[_0x8d66('0x35')]=_0x23af07[_0x8d66('0x35')][_0x8d66('0x37')]?_0x23af07['attributes']:_0x5ca52f[_0x8d66('0x30')];_0x23af07['order']=qs[_0x8d66('0x3c')](_0x414178[_0x8d66('0x31')][_0x8d66('0x3c')]);_0x23af07[_0x8d66('0x3d')]=qs[_0x8d66('0x33')](_['pick'](_0x414178[_0x8d66('0x31')],_0x5ca52f[_0x8d66('0x33')]));if(_0x414178[_0x8d66('0x31')][_0x8d66('0x3f')]){_0x23af07[_0x8d66('0x3d')]=_[_0x8d66('0x40')](_0x23af07[_0x8d66('0x3d')],{'$or':_['map'](_0x23af07[_0x8d66('0x35')],function(_0x3d9ebd){var _0x148b5e={};_0x148b5e[_0x3d9ebd]={'$like':'%'+_0x414178[_0x8d66('0x31')][_0x8d66('0x3f')]+'%'};return _0x148b5e;})});}_0x23af07=_[_0x8d66('0x40')]({},_0x23af07,_0x414178[_0x8d66('0x41')]);return _0x4679e1[_0x8d66('0x54')](_0x23af07);}})['then'](function(_0x5129dc){if(_0x5129dc){_0x2f3537=_0x5129dc[_0x8d66('0x37')];if(!_0x414178['query'][_0x8d66('0x38')](_0x8d66('0x39'))){_0x23af07[_0x8d66('0x1c')]=qs[_0x8d66('0x1c')](_0x414178[_0x8d66('0x31')][_0x8d66('0x1c')]);_0x23af07['offset']=qs['offset'](_0x414178[_0x8d66('0x31')][_0x8d66('0x3a')]);}return _0x4679e1[_0x8d66('0x54')](_0x23af07);}})[_0x8d66('0x22')](function(_0x2a9718){if(_0x2a9718){return _0x2a9718?{'count':_0x2f3537,'rows':_0x2a9718}:null;}})[_0x8d66('0x22')](respondWithResult(_0x4cf958,null))[_0x8d66('0x46')](handleError(_0x4cf958,null));};exports[_0x8d66('0x55')]=function(_0x1fcaa5,_0x496231,_0x18105f){return db[_0x8d66('0x2b')][_0x8d66('0x56')]({'where':{'id':_0x1fcaa5['params']['id']}})[_0x8d66('0x22')](handleEntityNotFound(_0x496231,null))['then'](function(_0x2ba4c2){if(_0x2ba4c2){return db[_0x8d66('0x57')][_0x8d66('0x58')](function(_0xdb2d37){return db['Interval'][_0x8d66('0x23')]({'where':{'IntervalId':_0x1fcaa5[_0x8d66('0x51')]['id']},'transaction':_0xdb2d37})[_0x8d66('0x22')](function(_0x1c0940){var _0x437933=_[_0x8d66('0x59')](_0x1fcaa5[_0x8d66('0x48')],function(_0x4bf7a6){delete _0x4bf7a6['id'];_0x4bf7a6['IntervalId']=_0x1fcaa5[_0x8d66('0x51')]['id'];return _0x4bf7a6;});return db[_0x8d66('0x2b')][_0x8d66('0x5a')](_0x437933,{'transaction':_0xdb2d37});});})[_0x8d66('0x22')](function(){return db[_0x8d66('0x2b')]['findAll']({'where':{'IntervalId':_0x1fcaa5[_0x8d66('0x51')]['id']}});});}})[_0x8d66('0x22')](respondWithResult(_0x496231,null))['catch'](handleError(_0x496231,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 26174fe..7f92544 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 _0xd50e=['util','../../config/logger','api','moment','request-promise','path','rimraf','./interval.attributes','exports','define','tools_intervals','rewrite'];(function(_0x5a4707,_0x1bade0){var _0x23db91=function(_0x2eb9b7){while(--_0x2eb9b7){_0x5a4707['push'](_0x5a4707['shift']());}};_0x23db91(++_0x1bade0);}(_0xd50e,0x120));var _0xed50=function(_0x2be08e,_0x3283fc){_0x2be08e=_0x2be08e-0x0;var _0x269ffc=_0xd50e[_0x2be08e];return _0x269ffc;};'use strict';var _=require('lodash');var util=require(_0xed50('0x0'));var logger=require(_0xed50('0x1'))(_0xed50('0x2'));var moment=require(_0xed50('0x3'));var BPromise=require('bluebird');var rp=require(_0xed50('0x4'));var fs=require('fs');var path=require(_0xed50('0x5'));var rimraf=require(_0xed50('0x6'));var config=require('../../config/environment');var attributes=require(_0xed50('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0xed50('0x8')]=function(_0x4590a6,_0x5f321b){return _0x4590a6[_0xed50('0x9')]('Interval',attributes,{'tableName':_0xed50('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f1d74,_0x12c94f){extensions['rewrite'](_0x4590a6,_0x5f1d74);},'afterBulkCreate':function(_0x27f19d,_0x986e1,_0x4088f){_0x4088f();extensions[_0xed50('0xb')](_0x4590a6,_0x27f19d[0x0]);},'afterUpdate':function(_0x4cfffa,_0x1d9773){extensions['rewrite'](_0x4590a6,_0x4cfffa);},'afterDestroy':function(_0x42939d,_0x5e4ac2){extensions['rewrite'](_0x4590a6,_0x42939d);}}});}; \ No newline at end of file +var _0x9cc3=['api','bluebird','path','rimraf','../../config/environment','./interval.attributes','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger'];(function(_0x5bdebb,_0xfe4f65){var _0x3053c7=function(_0xfb87de){while(--_0xfb87de){_0x5bdebb['push'](_0x5bdebb['shift']());}};_0x3053c7(++_0xfe4f65);}(_0x9cc3,0xeb));var _0x39cc=function(_0x497ae4,_0x44559e){_0x497ae4=_0x497ae4-0x0;var _0x4141df=_0x9cc3[_0x497ae4];return _0x4141df;};'use strict';var _=require(_0x39cc('0x0'));var util=require(_0x39cc('0x1'));var logger=require(_0x39cc('0x2'))(_0x39cc('0x3'));var moment=require('moment');var BPromise=require(_0x39cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39cc('0x5'));var rimraf=require(_0x39cc('0x6'));var config=require(_0x39cc('0x7'));var attributes=require(_0x39cc('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0x39cc('0x9')]=function(_0x34ead3,_0x207d08){return _0x34ead3[_0x39cc('0xa')](_0x39cc('0xb'),attributes,{'tableName':_0x39cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xbebd69,_0x1a2103){extensions[_0x39cc('0xd')](_0x34ead3,_0xbebd69);},'afterBulkCreate':function(_0x2a214f,_0x29675f,_0x350e4c){_0x350e4c();extensions[_0x39cc('0xd')](_0x34ead3,_0x2a214f[0x0]);},'afterUpdate':function(_0x1eb160,_0x439c79){extensions[_0x39cc('0xd')](_0x34ead3,_0x1eb160);},'afterDestroy':function(_0xe4d6c2,_0x63083){extensions[_0x39cc('0xd')](_0x34ead3,_0xe4d6c2);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index cd44794..213c636 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(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +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(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 d60a47d..dc12f61 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x583e1c,_0x473848){var _0x4a21b4=function(_0x3a974c){while(--_0x3a974c){_0x583e1c['push'](_0x583e1c['shift']());}};_0x4a21b4(++_0x473848);}(_0x2ef3,0xba));var _0x32ef=function(_0x34f478,_0x3ca318){_0x34f478=_0x34f478-0x0;var _0x2f3174=_0x2ef3[_0x34f478];return _0x2f3174;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x4fe7e1,_0x136936){var _0x17bec9=function(_0x2212cd){while(--_0x2212cd){_0x4fe7e1['push'](_0x4fe7e1['shift']());}};_0x17bec9(++_0x136936);}(_0x2ef3,0xba));var _0x32ef=function(_0x6ae4d8,_0x2f2a09){_0x6ae4d8=_0x6ae4d8-0x0;var _0x2b1de1=_0x2ef3[_0x6ae4d8];return _0x2b1de1;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6d97842..0cc1029 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 _0x3c21=['parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11504','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','end','status','statusCode','json'];(function(_0x1b637b,_0x18155b){var _0x456ee3=function(_0x59ac87){while(--_0x59ac87){_0x1b637b['push'](_0x1b637b['shift']());}};_0x456ee3(++_0x18155b);}(_0x3c21,0x1cd));var _0x13c2=function(_0x4fb35e,_0x5db0b3){_0x4fb35e=_0x4fb35e-0x0;var _0x3eec86=_0x3c21[_0x4fb35e];return _0x3eec86;};'use strict';var BPromise=require(_0x13c2('0x0'));var https=require(_0x13c2('0x1'));var logger=require(_0x13c2('0x2'))(_0x13c2('0x3'));var USERNAME=_0x13c2('0x4');var PASSWORD=_0x13c2('0x5');function openIssue(_0x4acb93,_0x4903f3){var _0x102eb1={'fields':{'project':{'key':_0x4acb93[_0x13c2('0x6')]||_0x13c2('0x7')},'summary':(_0x4acb93[_0x13c2('0x8')]||'Report')+_0x13c2('0x9')+_0x4acb93['ip'],'description':_0x4acb93['description']||JSON['stringify'](_0x4acb93),'issuetype':{'name':_0x4acb93[_0x13c2('0xa')]||_0x13c2('0xb')}}};_0x102eb1[_0x13c2('0xc')][_0x13c2('0xd')]=_0x4acb93['email'];_0x102eb1[_0x13c2('0xc')][_0x13c2('0xe')]=_0x4acb93[_0x13c2('0xf')];_0x102eb1[_0x13c2('0xc')]['customfield_11502']=_0x4acb93['newToken'];_0x102eb1[_0x13c2('0xc')]['customfield_11503']=_0x4acb93['name'];_0x102eb1[_0x13c2('0xc')][_0x13c2('0x10')]=_0x4acb93['reason'];_0x102eb1[_0x13c2('0xc')]['customfield_10102']=_0x4acb93['ip'];var _0x19c95d={'host':_0x13c2('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x13c2('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x13c2('0x13'),'Authorization':_0x13c2('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x13c2('0x15')](_0x13c2('0x16'))}};var _0x647b7c=JSON[_0x13c2('0x17')](_0x102eb1);var _0x382b57=https[_0x13c2('0x18')](_0x19c95d,function(_0x2285a5){_0x2285a5[_0x13c2('0x19')](_0x13c2('0x1a'));var _0x17234f='';_0x2285a5['on']('data',function(_0x5095f1){_0x17234f+=_0x5095f1;});_0x2285a5['on'](_0x13c2('0x1b'),function(){if(_0x4903f3){return _0x4903f3[_0x13c2('0x1c')](_0x2285a5[_0x13c2('0x1d')])[_0x13c2('0x1e')](JSON[_0x13c2('0x1f')](_0x17234f));}});});_0x382b57['on']('error',function(_0x2626d2){if(_0x4903f3){return _0x4903f3[_0x13c2('0x1c')](0x1f4)['json']({'errors':[{'message':_0x13c2('0x20'),'type':'api.jira'}]});}});_0x382b57['write'](_0x647b7c);_0x382b57[_0x13c2('0x1b')]();}exports[_0x13c2('0x21')]=openIssue;exports[_0x13c2('0x22')]=function(_0xa32e17,_0x393c74){_0xa32e17[_0x13c2('0x23')]['ip']=_0xa32e17[_0x13c2('0x24')][_0x13c2('0x25')]||_0xa32e17[_0x13c2('0x26')]['remoteAddress']||_0xa32e17['socket'][_0x13c2('0x27')]||_0xa32e17[_0x13c2('0x26')][_0x13c2('0x28')]['remoteAddress'];return openIssue(_0xa32e17[_0x13c2('0x23')],_0x393c74);}; \ No newline at end of file +var _0x0d3a=['x-forwarded-for','remoteAddress','connection','socket','body','https','../../config/logger','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','/rest/api/2/issue','POST','application/json','toString','base64','stringify','request','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send'];(function(_0x5ce945,_0x3ccfd4){var _0x144dd9=function(_0x8bbb45){while(--_0x8bbb45){_0x5ce945['push'](_0x5ce945['shift']());}};_0x144dd9(++_0x3ccfd4);}(_0x0d3a,0x155));var _0xa0d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d3a[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var https=require(_0xa0d3('0x0'));var logger=require(_0xa0d3('0x1'))('api');var USERNAME=_0xa0d3('0x2');var PASSWORD=_0xa0d3('0x3');function openIssue(_0x3a54e5,_0x4641d3){var _0x481ab0={'fields':{'project':{'key':_0x3a54e5[_0xa0d3('0x4')]||'MOTGUI'},'summary':(_0x3a54e5[_0xa0d3('0x5')]||_0xa0d3('0x6'))+_0xa0d3('0x7')+_0x3a54e5['ip'],'description':_0x3a54e5[_0xa0d3('0x8')]||JSON['stringify'](_0x3a54e5),'issuetype':{'name':_0x3a54e5[_0xa0d3('0x9')]||_0xa0d3('0xa')}}};_0x481ab0[_0xa0d3('0xb')][_0xa0d3('0xc')]=_0x3a54e5[_0xa0d3('0xd')];_0x481ab0['fields'][_0xa0d3('0xe')]=_0x3a54e5[_0xa0d3('0xf')];_0x481ab0[_0xa0d3('0xb')][_0xa0d3('0x10')]=_0x3a54e5[_0xa0d3('0x11')];_0x481ab0[_0xa0d3('0xb')]['customfield_11503']=_0x3a54e5['name'];_0x481ab0[_0xa0d3('0xb')][_0xa0d3('0x12')]=_0x3a54e5[_0xa0d3('0x13')];_0x481ab0[_0xa0d3('0xb')]['customfield_10102']=_0x3a54e5['ip'];var _0x43f96d={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xa0d3('0x14'),'method':_0xa0d3('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xa0d3('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xa0d3('0x17')](_0xa0d3('0x18'))}};var _0x1f2c06=JSON[_0xa0d3('0x19')](_0x481ab0);var _0x2b4769=https[_0xa0d3('0x1a')](_0x43f96d,function(_0x1a2a8a){_0x1a2a8a['setEncoding']('utf8');var _0x2e1519='';_0x1a2a8a['on']('data',function(_0x4fabe2){_0x2e1519+=_0x4fabe2;});_0x1a2a8a['on'](_0xa0d3('0x1b'),function(){if(_0x4641d3){return _0x4641d3['status'](_0x1a2a8a[_0xa0d3('0x1c')])[_0xa0d3('0x1d')](JSON[_0xa0d3('0x1e')](_0x2e1519));}});});_0x2b4769['on'](_0xa0d3('0x1f'),function(_0x53d7ad){if(_0x4641d3){return _0x4641d3[_0xa0d3('0x20')](0x1f4)['json']({'errors':[{'message':_0xa0d3('0x21'),'type':_0xa0d3('0x22')}]});}});_0x2b4769['write'](_0x1f2c06);_0x2b4769[_0xa0d3('0x1b')]();}exports[_0xa0d3('0x23')]=openIssue;exports[_0xa0d3('0x24')]=function(_0x2bccbd,_0x409904){_0x2bccbd['body']['ip']=_0x2bccbd['headers'][_0xa0d3('0x25')]||_0x2bccbd['connection'][_0xa0d3('0x26')]||_0x2bccbd['socket'][_0xa0d3('0x26')]||_0x2bccbd[_0xa0d3('0x27')][_0xa0d3('0x28')]['remoteAddress'];return openIssue(_0x2bccbd[_0xa0d3('0x29')],_0x409904);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 29f3e4f..c778284 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(_0x26a43d,_0x5311d4){var _0xccbea9=function(_0x170195){while(--_0x170195){_0x26a43d['push'](_0x26a43d['shift']());}};_0xccbea9(++_0x5311d4);}(_0xb821,0xa7));var _0x1b82=function(_0x3e8a42,_0x571c1c){_0x3e8a42=_0x3e8a42-0x0;var _0x2e30f6=_0xb821[_0x3e8a42];return _0x2e30f6;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x6')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router['post']('/',auth[_0x1b82('0x9')](),controller[_0x1b82('0xd')]);router[_0x1b82('0xe')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xf')]);router[_0x1b82('0x10')](_0x1b82('0xb'),auth['isAuthenticated'](),controller[_0x1b82('0x11')]);module[_0x1b82('0x12')]=router; \ No newline at end of file +var _0x5b02=['destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x3e8c76,_0x554863){var _0x275b17=function(_0x7ef411){while(--_0x7ef411){_0x3e8c76['push'](_0x3e8c76['shift']());}};_0x275b17(++_0x554863);}(_0x5b02,0xe9));var _0x25b0=function(_0xc2c604,_0xf6ffc3){_0xc2c604=_0xc2c604-0x0;var _0x3ec252=_0x5b02[_0xc2c604];return _0x3ec252;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0xd')]('/',auth['isAuthenticated'](),controller[_0x25b0('0xe')]);router[_0x25b0('0xf')](_0x25b0('0x10'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x11')]);router[_0x25b0('0x12')](_0x25b0('0x10'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x13')]);module[_0x25b0('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 5cc14e3..c6a0a7d 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(_0x5ac84a,_0x44f6d3){_0x5ac84a=_0x5ac84a-0x0;var _0x55e1fa=_0x7a54[_0x5ac84a];return _0x55e1fa;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x502a7b,_0x2b2654){_0x502a7b=_0x502a7b-0x0;var _0xeb23c8=_0x7a54[_0x502a7b];return _0xeb23c8;};'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 9a34dba..7b8e5d0 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 _0x6bac=['destroy','end','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','JscriptyAnswerReport','count','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then'];(function(_0x1c22ca,_0x62e3f2){var _0x3a73e1=function(_0x1f639b){while(--_0x1f639b){_0x1c22ca['push'](_0x1c22ca['shift']());}};_0x3a73e1(++_0x62e3f2);}(_0x6bac,0xa5));var _0xc6ba=function(_0x10cd1f,_0x16f96e){_0x10cd1f=_0x10cd1f-0x0;var _0x3282fd=_0x6bac[_0x10cd1f];return _0x3282fd;};'use strict';var emlformat=require(_0xc6ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6ba('0x1'));var jsonpatch=require(_0xc6ba('0x2'));var rp=require(_0xc6ba('0x3'));var moment=require(_0xc6ba('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc6ba('0x5'));var sox=require(_0xc6ba('0x6'));var csv=require('to-csv');var ejs=require(_0xc6ba('0x7'));var fs=require('fs');var fs_extra=require(_0xc6ba('0x8'));var _=require(_0xc6ba('0x9'));var squel=require(_0xc6ba('0xa'));var crypto=require(_0xc6ba('0xb'));var jsforce=require(_0xc6ba('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc6ba('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6ba('0xe'));var logger=require(_0xc6ba('0xf'))(_0xc6ba('0x10'));var utils=require(_0xc6ba('0x11'));var config=require(_0xc6ba('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e7642,_0x2cfa3d){_0x2cfa3d=_0x2cfa3d||0xcc;return function(_0x31def2){if(_0x31def2){return _0x3e7642[_0xc6ba('0x13')](_0x2cfa3d);}return _0x3e7642[_0xc6ba('0x14')](_0x2cfa3d)['end']();};}function respondWithResult(_0x498aa1,_0x595561){_0x595561=_0x595561||0xc8;return function(_0x2f6e76){if(_0x2f6e76){return _0x498aa1[_0xc6ba('0x14')](_0x595561)[_0xc6ba('0x15')](_0x2f6e76);}};}function respondWithFilteredResult(_0x342007,_0x425cec){return function(_0x29f0b7){if(_0x29f0b7){var _0x1be8ef=typeof _0x425cec[_0xc6ba('0x16')]==='undefined'&&typeof _0x425cec['limit']==='undefined';var _0x488fb4=_0x29f0b7['count'];var _0x494d17=_0x1be8ef?0x0:_0x425cec[_0xc6ba('0x16')];var _0x15a135=_0x1be8ef?_0x29f0b7['count']:_0x425cec['offset']+_0x425cec[_0xc6ba('0x17')];var _0x5d1f4e;if(_0x15a135>=_0x488fb4){_0x15a135=_0x488fb4;_0x5d1f4e=0xc8;}else{_0x5d1f4e=0xce;}_0x342007[_0xc6ba('0x14')](_0x5d1f4e);return _0x342007[_0xc6ba('0x18')]('Content-Range',_0x494d17+'-'+_0x15a135+'/'+_0x488fb4)[_0xc6ba('0x15')](_0x29f0b7);}return null;};}function patchUpdates(_0x362f68){return function(_0x4a463e){try{jsonpatch[_0xc6ba('0x19')](_0x4a463e,_0x362f68,!![]);}catch(_0x459dfa){return BPromise[_0xc6ba('0x1a')](_0x459dfa);}return _0x4a463e[_0xc6ba('0x1b')]();};}function saveUpdates(_0x28f8ba,_0x3f7082){return function(_0xc2de63){if(_0xc2de63){return _0xc2de63[_0xc6ba('0x1c')](_0x28f8ba)[_0xc6ba('0x1d')](function(_0x3c7edd){return _0x3c7edd;});}return null;};}function removeEntity(_0x280ab0,_0xf326f9){return function(_0x4a2082){if(_0x4a2082){return _0x4a2082[_0xc6ba('0x1e')]()[_0xc6ba('0x1d')](function(){_0x280ab0['status'](0xcc)[_0xc6ba('0x1f')]();});}};}function handleEntityNotFound(_0x29a175,_0x2946f0){return function(_0xcfb503){if(!_0xcfb503){_0x29a175[_0xc6ba('0x13')](0x194);}return _0xcfb503;};}function handleError(_0x3b5ed7,_0x47998c){_0x47998c=_0x47998c||0x1f4;return function(_0x447407){logger[_0xc6ba('0x20')](_0x447407['stack']);if(_0x447407[_0xc6ba('0x21')]){delete _0x447407[_0xc6ba('0x21')];}_0x3b5ed7['status'](_0x47998c)[_0xc6ba('0x22')](_0x447407);};}exports['index']=function(_0x3fea76,_0x2dd085){var _0x111ce4={},_0x393d4d={},_0x5ac5dd={'count':0x0,'rows':[]};var _0x4fe380=_[_0xc6ba('0x23')](db['JscriptyAnswerReport'][_0xc6ba('0x24')],function(_0x5d5ebe){return{'name':_0x5d5ebe[_0xc6ba('0x25')],'type':_0x5d5ebe[_0xc6ba('0x26')]['key']};});_0x393d4d[_0xc6ba('0x27')]=_[_0xc6ba('0x23')](_0x4fe380,_0xc6ba('0x21'));_0x393d4d[_0xc6ba('0x28')]=_[_0xc6ba('0x29')](_0x3fea76[_0xc6ba('0x28')]);_0x393d4d['filters']=_[_0xc6ba('0x2a')](_0x393d4d[_0xc6ba('0x27')],_0x393d4d['query']);_0x111ce4[_0xc6ba('0x2b')]=_[_0xc6ba('0x2a')](_0x393d4d['model'],qs[_0xc6ba('0x2c')](_0x3fea76[_0xc6ba('0x28')]['fields']));_0x111ce4[_0xc6ba('0x2b')]=_0x111ce4[_0xc6ba('0x2b')][_0xc6ba('0x2d')]?_0x111ce4[_0xc6ba('0x2b')]:_0x393d4d[_0xc6ba('0x27')];if(!_0x3fea76[_0xc6ba('0x28')]['hasOwnProperty'](_0xc6ba('0x2e'))){_0x111ce4[_0xc6ba('0x17')]=qs[_0xc6ba('0x17')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x17')]);_0x111ce4[_0xc6ba('0x16')]=qs[_0xc6ba('0x16')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x16')]);}_0x111ce4[_0xc6ba('0x2f')]=qs[_0xc6ba('0x30')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x30')]);_0x111ce4[_0xc6ba('0x31')]=qs['filters'](_[_0xc6ba('0x32')](_0x3fea76[_0xc6ba('0x28')],_0x393d4d[_0xc6ba('0x33')]),_0x4fe380);if(_0x3fea76['query'][_0xc6ba('0x34')]){_0x111ce4['where']=_[_0xc6ba('0x35')](_0x111ce4['where'],{'$or':_[_0xc6ba('0x23')](_0x4fe380,function(_0x57d2fb){if(_0x57d2fb[_0xc6ba('0x26')]!=='VIRTUAL'){var _0x4d92cf={};_0x4d92cf[_0x57d2fb[_0xc6ba('0x21')]]={'$like':'%'+_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x34')]+'%'};return _0x4d92cf;}})});}_0x111ce4=_[_0xc6ba('0x35')]({},_0x111ce4,_0x3fea76['options']);var _0x2f8c39={'where':_0x111ce4[_0xc6ba('0x31')]};return db[_0xc6ba('0x36')][_0xc6ba('0x37')](_0x2f8c39)[_0xc6ba('0x1d')](function(_0x3273f4){_0x5ac5dd[_0xc6ba('0x37')]=_0x3273f4;if(_0x3fea76['query'][_0xc6ba('0x38')]){_0x111ce4[_0xc6ba('0x39')]=[{'all':!![]}];}return db[_0xc6ba('0x36')][_0xc6ba('0x3a')](_0x111ce4);})[_0xc6ba('0x1d')](function(_0x4985f8){_0x5ac5dd['rows']=_0x4985f8;return _0x5ac5dd;})[_0xc6ba('0x1d')](respondWithFilteredResult(_0x2dd085,_0x111ce4))[_0xc6ba('0x3b')](handleError(_0x2dd085,null));};exports['show']=function(_0x2d3d5a,_0x23e2d1){var _0x35f1fc={'raw':!![],'where':{'id':_0x2d3d5a[_0xc6ba('0x3c')]['id']}},_0x279d89={};_0x279d89[_0xc6ba('0x27')]=_['keys'](db['JscriptyAnswerReport'][_0xc6ba('0x24')]);_0x279d89[_0xc6ba('0x28')]=_[_0xc6ba('0x29')](_0x2d3d5a['query']);_0x279d89['filters']=_[_0xc6ba('0x2a')](_0x279d89[_0xc6ba('0x27')],_0x279d89[_0xc6ba('0x28')]);_0x35f1fc[_0xc6ba('0x2b')]=_[_0xc6ba('0x2a')](_0x279d89['model'],qs[_0xc6ba('0x2c')](_0x2d3d5a[_0xc6ba('0x28')][_0xc6ba('0x2c')]));_0x35f1fc[_0xc6ba('0x2b')]=_0x35f1fc[_0xc6ba('0x2b')][_0xc6ba('0x2d')]?_0x35f1fc[_0xc6ba('0x2b')]:_0x279d89[_0xc6ba('0x27')];if(_0x2d3d5a['query'][_0xc6ba('0x38')]){_0x35f1fc[_0xc6ba('0x39')]=[{'all':!![]}];}_0x35f1fc=_[_0xc6ba('0x35')]({},_0x35f1fc,_0x2d3d5a['options']);return db[_0xc6ba('0x36')][_0xc6ba('0x3d')](_0x35f1fc)[_0xc6ba('0x1d')](handleEntityNotFound(_0x23e2d1,null))['then'](respondWithResult(_0x23e2d1,null))['catch'](handleError(_0x23e2d1,null));};exports[_0xc6ba('0x3e')]=function(_0xe4747e,_0x56add1){return db[_0xc6ba('0x36')][_0xc6ba('0x3e')](_0xe4747e[_0xc6ba('0x3f')],{})[_0xc6ba('0x1d')](respondWithResult(_0x56add1,0xc9))[_0xc6ba('0x3b')](handleError(_0x56add1,null));};exports[_0xc6ba('0x1c')]=function(_0x36e159,_0x283dac){if(_0x36e159['body']['id']){delete _0x36e159[_0xc6ba('0x3f')]['id'];}return db['JscriptyAnswerReport'][_0xc6ba('0x3d')]({'where':{'id':_0x36e159[_0xc6ba('0x3c')]['id']}})[_0xc6ba('0x1d')](handleEntityNotFound(_0x283dac,null))[_0xc6ba('0x1d')](saveUpdates(_0x36e159[_0xc6ba('0x3f')],null))['then'](respondWithResult(_0x283dac,null))['catch'](handleError(_0x283dac,null));};exports['destroy']=function(_0x47a4ee,_0x2c71f7){return db['JscriptyAnswerReport'][_0xc6ba('0x3d')]({'where':{'id':_0x47a4ee[_0xc6ba('0x3c')]['id']}})[_0xc6ba('0x1d')](handleEntityNotFound(_0x2c71f7,null))[_0xc6ba('0x1d')](removeEntity(_0x2c71f7,null))['catch'](handleError(_0x2c71f7,null));};exports['describe']=function(_0x121fa6,_0x2ab774){return db['JscriptyAnswerReport'][_0xc6ba('0x40')]()[_0xc6ba('0x1d')](respondWithResult(_0x2ab774,null))[_0xc6ba('0x3b')](handleError(_0x2ab774,null));}; \ No newline at end of file +var _0x8c46=['filter','VIRTUAL','merge','options','include','JscriptyAnswerReport','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0x4ff317,_0x187e20){var _0x1ee505=function(_0x4b58d4){while(--_0x4b58d4){_0x4ff317['push'](_0x4ff317['shift']());}};_0x1ee505(++_0x187e20);}(_0x8c46,0x171));var _0x68c4=function(_0x43bb6e,_0x2209d8){_0x43bb6e=_0x43bb6e-0x0;var _0x4361b5=_0x8c46[_0x43bb6e];return _0x4361b5;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['JscriptyAnswerReport'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['JscriptyAnswerReport']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 91d4032..56b7234 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 _0x533e=['rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x124eb9,_0x1fb931){var _0x5c10b8=function(_0x36e6b2){while(--_0x36e6b2){_0x124eb9['push'](_0x124eb9['shift']());}};_0x5c10b8(++_0x1fb931);}(_0x533e,0x19d));var _0xe533=function(_0x3d021c,_0x1d5398){_0x3d021c=_0x3d021c-0x0;var _0xf527c9=_0x533e[_0x3d021c];return _0xf527c9;};'use strict';var _=require(_0xe533('0x0'));var util=require('util');var logger=require(_0xe533('0x1'))(_0xe533('0x2'));var moment=require('moment');var BPromise=require(_0xe533('0x3'));var rp=require(_0xe533('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe533('0x5'));var config=require('../../config/environment');var attributes=require(_0xe533('0x6'));module[_0xe533('0x7')]=function(_0x4619bf,_0x5d1311){return _0x4619bf[_0xe533('0x8')](_0xe533('0x9'),attributes,{'tableName':_0xe533('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a15=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x35a14d,_0x147792){var _0x5ceaf0=function(_0x5203d9){while(--_0x5203d9){_0x35a14d['push'](_0x35a14d['shift']());}};_0x5ceaf0(++_0x147792);}(_0x4a15,0x1e1));var _0x54a1=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x4a15[_0x4409e7];return _0x24c751;};'use strict';var _=require(_0x54a1('0x0'));var util=require(_0x54a1('0x1'));var logger=require('../../config/logger')(_0x54a1('0x2'));var moment=require(_0x54a1('0x3'));var BPromise=require(_0x54a1('0x4'));var rp=require(_0x54a1('0x5'));var fs=require('fs');var path=require(_0x54a1('0x6'));var rimraf=require(_0x54a1('0x7'));var config=require(_0x54a1('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x54a1('0x9')]=function(_0xfb9f9a,_0x41b536){return _0xfb9f9a[_0x54a1('0xa')](_0x54a1('0xb'),attributes,{'tableName':_0x54a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index c8bdc93..b03c9a5 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 _0x5ae9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x47bd3e,_0x2a54d9){var _0x22b740=function(_0x2f7353){while(--_0x2f7353){_0x47bd3e['push'](_0x47bd3e['shift']());}};_0x22b740(++_0x2a54d9);}(_0x5ae9,0x1de));var _0x95ae=function(_0x42676f,_0x4c3299){_0x42676f=_0x42676f-0x0;var _0x2b884e=_0x5ae9[_0x42676f];return _0x2b884e;};'use strict';var _=require(_0x95ae('0x0'));var util=require(_0x95ae('0x1'));var moment=require(_0x95ae('0x2'));var BPromise=require(_0x95ae('0x3'));var rs=require(_0x95ae('0x4'));var fs=require('fs');var Redis=require(_0x95ae('0x5'));var db=require(_0x95ae('0x6'))['db'];var utils=require(_0x95ae('0x7'));var logger=require('../../config/logger')(_0x95ae('0x8'));var config=require(_0x95ae('0x9'));var jayson=require(_0x95ae('0xa'));var client=jayson[_0x95ae('0xb')][_0x95ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa2f1a5,_0x2094ba,_0x4ed097){return new BPromise(function(_0x10c50b,_0x522181){return client['request'](_0xa2f1a5,_0x4ed097)[_0x95ae('0xd')](function(_0x442a9a){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2094ba,_0x95ae('0xe'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2094ba,_0x95ae('0xe'),JSON[_0x95ae('0xf')](_0x442a9a));if(_0x442a9a[_0x95ae('0x10')]){if(_0x442a9a[_0x95ae('0x10')][_0x95ae('0x11')]===0x1f4){logger[_0x95ae('0x10')](_0x95ae('0x12'),_0x2094ba,_0x442a9a[_0x95ae('0x10')][_0x95ae('0x13')]);return _0x522181(_0x442a9a['error'][_0x95ae('0x13')]);}logger[_0x95ae('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2094ba,_0x442a9a[_0x95ae('0x10')]['message']);return _0x10c50b(_0x442a9a['error'][_0x95ae('0x13')]);}else{logger['info'](_0x95ae('0x12'),_0x2094ba,_0x95ae('0xe'));_0x10c50b(_0x442a9a[_0x95ae('0x14')][_0x95ae('0x13')]);}})[_0x95ae('0x15')](function(_0x72584b){logger['error'](_0x95ae('0x12'),_0x2094ba,_0x72584b);_0x522181(_0x72584b);});});} \ No newline at end of file +var _0x1d7a=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','moment','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d7a,0x189));var _0xa1d7=function(_0x28019c,_0x67743){_0x28019c=_0x28019c-0x0;var _0x48ca39=_0x1d7a[_0x28019c];return _0x48ca39;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa1d7('0x0'));var BPromise=require(_0xa1d7('0x1'));var rs=require(_0xa1d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1d7('0x3'))['db'];var utils=require(_0xa1d7('0x4'));var logger=require(_0xa1d7('0x5'))(_0xa1d7('0x6'));var config=require('../../config/environment');var jayson=require(_0xa1d7('0x7'));var client=jayson[_0xa1d7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1459eb,_0x3cf6ba,_0x2b8a24){return new BPromise(function(_0x748702,_0x1289cb){return client[_0xa1d7('0x9')](_0x1459eb,_0x2b8a24)[_0xa1d7('0xa')](function(_0x3422b6){logger['info'](_0xa1d7('0xb'),_0x3cf6ba,'request\x20sent');logger[_0xa1d7('0xc')](_0xa1d7('0xd'),_0x3cf6ba,_0xa1d7('0xe'),JSON[_0xa1d7('0xf')](_0x3422b6));if(_0x3422b6['error']){if(_0x3422b6['error'][_0xa1d7('0x10')]===0x1f4){logger[_0xa1d7('0x11')](_0xa1d7('0xb'),_0x3cf6ba,_0x3422b6[_0xa1d7('0x11')]['message']);return _0x1289cb(_0x3422b6[_0xa1d7('0x11')][_0xa1d7('0x12')]);}logger[_0xa1d7('0x11')](_0xa1d7('0xb'),_0x3cf6ba,_0x3422b6[_0xa1d7('0x11')][_0xa1d7('0x12')]);return _0x748702(_0x3422b6[_0xa1d7('0x11')][_0xa1d7('0x12')]);}else{logger[_0xa1d7('0x13')](_0xa1d7('0xb'),_0x3cf6ba,_0xa1d7('0xe'));_0x748702(_0x3422b6[_0xa1d7('0x14')][_0xa1d7('0x12')]);}})[_0xa1d7('0x15')](function(_0x1226b6){logger[_0xa1d7('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3cf6ba,_0x1226b6);_0x1289cb(_0x1226b6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 5aa6d56..5deba52 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 _0x9038=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/sessions','getAnswers','30s','post','create','/:id/clone','clone','put','update','delete','exports','multer','util','path'];(function(_0x543b6a,_0x40f6ae){var _0x2c2372=function(_0x10f2ed){while(--_0x10f2ed){_0x543b6a['push'](_0x543b6a['shift']());}};_0x2c2372(++_0x40f6ae);}(_0x9038,0x174));var _0x8903=function(_0x3a6e53,_0x184193){_0x3a6e53=_0x3a6e53-0x0;var _0x5c2354=_0x9038[_0x3a6e53];return _0x5c2354;};'use strict';var multer=require(_0x8903('0x0'));var util=require(_0x8903('0x1'));var path=require(_0x8903('0x2'));var timeout=require(_0x8903('0x3'));var express=require(_0x8903('0x4'));var router=express['Router']();var fs_extra=require(_0x8903('0x5'));var auth=require(_0x8903('0x6'));var interaction=require(_0x8903('0x7'));var config=require(_0x8903('0x8'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x8903('0x9')](),controller[_0x8903('0xa')]);router[_0x8903('0xb')](_0x8903('0xc'),auth[_0x8903('0x9')](),controller[_0x8903('0xd')]);router[_0x8903('0xb')](_0x8903('0xe'),auth[_0x8903('0x9')](),controller['getSessions']);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0x8903('0xf')]);router['get']('/:id/summary',auth[_0x8903('0x9')](),timeout(_0x8903('0x10')),controller['getSummary']);router[_0x8903('0x11')]('/',auth[_0x8903('0x9')](),controller[_0x8903('0x12')]);router[_0x8903('0x11')](_0x8903('0x13'),auth['isAuthenticated'](),controller[_0x8903('0x14')]);router[_0x8903('0x15')]('/:id',auth[_0x8903('0x9')](),controller[_0x8903('0x16')]);router[_0x8903('0x17')]('/:id',auth[_0x8903('0x9')](),controller['destroy']);module[_0x8903('0x18')]=router; \ No newline at end of file +var _0x3633=['/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','get','/:id','isAuthenticated','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3633,0x65));var _0x3363=function(_0x1dc967,_0x5668df){_0x1dc967=_0x1dc967-0x0;var _0x33d0a6=_0x3633[_0x1dc967];return _0x33d0a6;};'use strict';var multer=require(_0x3363('0x0'));var util=require(_0x3363('0x1'));var path=require(_0x3363('0x2'));var timeout=require(_0x3363('0x3'));var express=require(_0x3363('0x4'));var router=express[_0x3363('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3363('0x6'));var interaction=require(_0x3363('0x7'));var config=require(_0x3363('0x8'));var controller=require(_0x3363('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3363('0xa')]);router[_0x3363('0xb')](_0x3363('0xc'),auth[_0x3363('0xd')](),controller[_0x3363('0xe')]);router[_0x3363('0xb')](_0x3363('0xf'),auth['isAuthenticated'](),controller[_0x3363('0x10')]);router[_0x3363('0xb')](_0x3363('0x11'),auth[_0x3363('0xd')](),controller['getAnswers']);router[_0x3363('0xb')](_0x3363('0x12'),auth[_0x3363('0xd')](),timeout(_0x3363('0x13')),controller[_0x3363('0x14')]);router[_0x3363('0x15')]('/',auth[_0x3363('0xd')](),controller[_0x3363('0x16')]);router[_0x3363('0x15')](_0x3363('0x17'),auth[_0x3363('0xd')](),controller[_0x3363('0x18')]);router['put'](_0x3363('0xc'),auth[_0x3363('0xd')](),controller[_0x3363('0x19')]);router[_0x3363('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x3363('0x1b')]);module[_0x3363('0x1c')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cbb71fc..4e8144a 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 _0x5dff=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5dff,0x138));var _0xf5df=function(_0xa7fb1f,_0x1c49bc){_0xa7fb1f=_0xa7fb1f-0x0;var _0x32e057=_0x5dff[_0xa7fb1f];return _0x32e057;};'use strict';var Sequelize=require(_0xf5df('0x0'));var _=require(_0xf5df('0x1'));var util=require('util');module[_0xf5df('0x2')]={'name':{'type':Sequelize[_0xf5df('0x3')],'unique':_0xf5df('0x4')},'description':{'type':Sequelize[_0xf5df('0x3')]},'formData':{'type':Sequelize[_0xf5df('0x5')](_0xf5df('0x6')),'set':function(_0x1e37ee){if(_[_0xf5df('0x7')](_0x1e37ee)){this[_0xf5df('0x8')](_0xf5df('0x9'),JSON['stringify'](_0x1e37ee));}else if(_[_0xf5df('0xa')](_0x1e37ee)){this[_0xf5df('0x8')](_0xf5df('0x9'),_0x1e37ee);}else{this['setDataValue'](_0xf5df('0x9'),util[_0xf5df('0xb')](_0xf5df('0xc'),this[_0xf5df('0xd')](_0xf5df('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xeac6=['BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','stringify','isString','formData','setDataValue','format','getDataValue','name'];(function(_0x23477b,_0x4bcd1c){var _0xd6d2e2=function(_0xed3d35){while(--_0xed3d35){_0x23477b['push'](_0x23477b['shift']());}};_0xd6d2e2(++_0x4bcd1c);}(_0xeac6,0xc5));var _0x6eac=function(_0xeebcf3,_0x119794){_0xeebcf3=_0xeebcf3-0x0;var _0x2dda52=_0xeac6[_0xeebcf3];return _0x2dda52;};'use strict';var Sequelize=require(_0x6eac('0x0'));var _=require(_0x6eac('0x1'));var util=require(_0x6eac('0x2'));module[_0x6eac('0x3')]={'name':{'type':Sequelize[_0x6eac('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x6eac('0x4')]},'formData':{'type':Sequelize[_0x6eac('0x5')]('long'),'set':function(_0x444d70){if(_['isObjectLike'](_0x444d70)){this['setDataValue']('formData',JSON[_0x6eac('0x6')](_0x444d70));}else if(_[_0x6eac('0x7')](_0x444d70)){this['setDataValue'](_0x6eac('0x8'),_0x444d70);}else{this[_0x6eac('0x9')](_0x6eac('0x8'),util[_0x6eac('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x6eac('0xb')](_0x6eac('0xc'))||'',this[_0x6eac('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6eac('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6eac('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 ed5aef9..2ff7899 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 _0xd004=['findOne','JscriptySessionReport','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','update'];(function(_0x3ee2d2,_0x468998){var _0x5c49ee=function(_0x1872f3){while(--_0x1872f3){_0x3ee2d2['push'](_0x3ee2d2['shift']());}};_0x5c49ee(++_0x468998);}(_0xd004,0x181));var _0x4d00=function(_0x273fd1,_0x388bbe){_0x273fd1=_0x273fd1-0x0;var _0x5d3dbf=_0xd004[_0x273fd1];return _0x5d3dbf;};'use strict';var emlformat=require(_0x4d00('0x0'));var rimraf=require(_0x4d00('0x1'));var zipdir=require(_0x4d00('0x2'));var jsonpatch=require(_0x4d00('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d00('0x4'));var Mustache=require(_0x4d00('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4d00('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d00('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4d00('0x8'));var deskjs=require(_0x4d00('0x9'));var toCsv=require(_0x4d00('0x6'));var querystring=require(_0x4d00('0xa'));var Papa=require(_0x4d00('0xb'));var Redis=require('ioredis');var authService=require(_0x4d00('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x4d00('0xd'));var hardwareService=require(_0x4d00('0xe'));var logger=require('../../config/logger')(_0x4d00('0xf'));var utils=require(_0x4d00('0x10'));var config=require(_0x4d00('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eaeac,_0x38ff0e){_0x38ff0e=_0x38ff0e||0xcc;return function(_0x47726e){if(_0x47726e){return _0x3eaeac[_0x4d00('0x12')](_0x38ff0e);}return _0x3eaeac['status'](_0x38ff0e)[_0x4d00('0x13')]();};}function respondWithResult(_0x39d68c,_0x5124c3){_0x5124c3=_0x5124c3||0xc8;return function(_0x588c31){if(_0x588c31){return _0x39d68c['status'](_0x5124c3)[_0x4d00('0x14')](_0x588c31);}};}function respondWithFilteredResult(_0x233de3,_0x30f3f4){return function(_0x58d56a){if(_0x58d56a){var _0x433a7b=typeof _0x30f3f4[_0x4d00('0x15')]===_0x4d00('0x16')&&typeof _0x30f3f4[_0x4d00('0x17')]===_0x4d00('0x16');var _0x433b1b=_0x58d56a[_0x4d00('0x18')];var _0x398a08=_0x433a7b?0x0:_0x30f3f4[_0x4d00('0x15')];var _0x2bf553=_0x433a7b?_0x58d56a[_0x4d00('0x18')]:_0x30f3f4[_0x4d00('0x15')]+_0x30f3f4[_0x4d00('0x17')];var _0x827890;if(_0x2bf553>=_0x433b1b){_0x2bf553=_0x433b1b;_0x827890=0xc8;}else{_0x827890=0xce;}_0x233de3[_0x4d00('0x19')](_0x827890);return _0x233de3[_0x4d00('0x1a')](_0x4d00('0x1b'),_0x398a08+'-'+_0x2bf553+'/'+_0x433b1b)['json'](_0x58d56a);}return null;};}function patchUpdates(_0x522066){return function(_0x17877b){try{jsonpatch[_0x4d00('0x1c')](_0x17877b,_0x522066,!![]);}catch(_0x38b460){return BPromise[_0x4d00('0x1d')](_0x38b460);}return _0x17877b[_0x4d00('0x1e')]();};}function saveUpdates(_0x102213,_0x58c7c7){return function(_0x4bf02e){if(_0x4bf02e){return _0x4bf02e['update'](_0x102213)[_0x4d00('0x1f')](function(_0xf70e8e){return _0xf70e8e;});}return null;};}function removeEntity(_0x2a2c74,_0x32a910){return function(_0x3e3d7f){if(_0x3e3d7f){return _0x3e3d7f[_0x4d00('0x20')]()[_0x4d00('0x1f')](function(){var _0x38b95e=_0x3e3d7f[_0x4d00('0x21')]({'plain':!![]});var _0x1a4553='Projects';return db[_0x4d00('0x22')][_0x4d00('0x20')]({'where':{'type':_0x1a4553,'resourceId':_0x38b95e['id']}})['then'](function(){return _0x3e3d7f;});})[_0x4d00('0x1f')](function(){_0x2a2c74[_0x4d00('0x19')](0xcc)[_0x4d00('0x13')]();});}};}function handleEntityNotFound(_0x3640ab,_0x6b106c){return function(_0x6df58c){if(!_0x6df58c){_0x3640ab[_0x4d00('0x12')](0x194);}return _0x6df58c;};}function handleError(_0x29a045,_0x85a5dd){_0x85a5dd=_0x85a5dd||0x1f4;return function(_0x7ae64d){logger['error'](_0x7ae64d['stack']);if(_0x7ae64d[_0x4d00('0x23')]){delete _0x7ae64d[_0x4d00('0x23')];}_0x29a045[_0x4d00('0x19')](_0x85a5dd)[_0x4d00('0x24')](_0x7ae64d);};}exports[_0x4d00('0x25')]=function(_0x1de92d,_0x703ce1){var _0x1b7adf={},_0x2649c2={},_0x461b6a={'count':0x0,'rows':[]};var _0x16e714=_[_0x4d00('0x26')](db[_0x4d00('0x27')][_0x4d00('0x28')],function(_0x4f4e9a){return{'name':_0x4f4e9a[_0x4d00('0x29')],'type':_0x4f4e9a[_0x4d00('0x2a')]['key']};});_0x2649c2['model']=_['map'](_0x16e714,_0x4d00('0x23'));_0x2649c2['query']=_[_0x4d00('0x2b')](_0x1de92d[_0x4d00('0x2c')]);_0x2649c2['filters']=_[_0x4d00('0x2d')](_0x2649c2['model'],_0x2649c2[_0x4d00('0x2c')]);_0x1b7adf[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x2649c2[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x1de92d[_0x4d00('0x2c')]['fields']));_0x1b7adf['attributes']=_0x1b7adf[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x1b7adf['attributes']:_0x2649c2['model'];if(!_0x1de92d['query'][_0x4d00('0x32')](_0x4d00('0x33'))){_0x1b7adf[_0x4d00('0x17')]=qs[_0x4d00('0x17')](_0x1de92d['query'][_0x4d00('0x17')]);_0x1b7adf['offset']=qs[_0x4d00('0x15')](_0x1de92d[_0x4d00('0x2c')][_0x4d00('0x15')]);}_0x1b7adf[_0x4d00('0x34')]=qs['sort'](_0x1de92d[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x1b7adf['where']=qs['filters'](_[_0x4d00('0x36')](_0x1de92d[_0x4d00('0x2c')],_0x2649c2[_0x4d00('0x37')]),_0x16e714);if(_0x1de92d['query']['filter']){_0x1b7adf[_0x4d00('0x38')]=_['merge'](_0x1b7adf[_0x4d00('0x38')],{'$or':_[_0x4d00('0x26')](_0x16e714,function(_0x248d0e){if(_0x248d0e[_0x4d00('0x2a')]!==_0x4d00('0x39')){var _0x5291ed={};_0x5291ed[_0x248d0e['name']]={'$like':'%'+_0x1de92d['query'][_0x4d00('0x3a')]+'%'};return _0x5291ed;}})});}_0x1b7adf=_[_0x4d00('0x3b')]({},_0x1b7adf,_0x1de92d[_0x4d00('0x3c')]);var _0xdaebc8={'where':_0x1b7adf[_0x4d00('0x38')]};return db[_0x4d00('0x27')][_0x4d00('0x18')](_0xdaebc8)[_0x4d00('0x1f')](function(_0x341ee7){_0x461b6a[_0x4d00('0x18')]=_0x341ee7;if(_0x1de92d[_0x4d00('0x2c')]['includeAll']){_0x1b7adf[_0x4d00('0x3d')]=[{'all':!![]}];}return db[_0x4d00('0x27')][_0x4d00('0x3e')](_0x1b7adf);})['then'](function(_0x2162cc){_0x461b6a['rows']=_0x2162cc;return _0x461b6a;})[_0x4d00('0x1f')](respondWithFilteredResult(_0x703ce1,_0x1b7adf))[_0x4d00('0x3f')](handleError(_0x703ce1,null));};exports[_0x4d00('0x40')]=function(_0x3b08f5,_0x140864){var _0x30143f={'raw':![],'where':{'id':_0x3b08f5[_0x4d00('0x41')]['id']}},_0x4be1b2={};_0x4be1b2[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x27')][_0x4d00('0x28')]);_0x4be1b2[_0x4d00('0x2c')]=_['keys'](_0x3b08f5[_0x4d00('0x2c')]);_0x4be1b2[_0x4d00('0x37')]=_[_0x4d00('0x2d')](_0x4be1b2[_0x4d00('0x2f')],_0x4be1b2[_0x4d00('0x2c')]);_0x30143f[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x4be1b2[_0x4d00('0x2f')],qs['fields'](_0x3b08f5[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x30143f[_0x4d00('0x2e')]=_0x30143f['attributes'][_0x4d00('0x31')]?_0x30143f[_0x4d00('0x2e')]:_0x4be1b2['model'];if(_0x3b08f5[_0x4d00('0x2c')]['includeAll']){_0x30143f[_0x4d00('0x3d')]=[{'all':!![]}];}_0x30143f=_[_0x4d00('0x3b')]({},_0x30143f,_0x3b08f5['options']);return db['JscriptyProject'][_0x4d00('0x42')](_0x30143f)[_0x4d00('0x1f')](handleEntityNotFound(_0x140864,null))[_0x4d00('0x1f')](respondWithResult(_0x140864,null))[_0x4d00('0x3f')](handleError(_0x140864,null));};exports[_0x4d00('0x43')]=function(_0x316136,_0x5b29e5){return db['JscriptyProject']['create'](_0x316136[_0x4d00('0x44')],{})[_0x4d00('0x1f')](function(_0x5ed0d2){var _0x13bf4f=_0x316136[_0x4d00('0x45')][_0x4d00('0x21')]({'plain':!![]});if(!_0x13bf4f)throw new Error(_0x4d00('0x46'));if(_0x13bf4f[_0x4d00('0x47')]===_0x4d00('0x45')){var _0x3ee807=_0x5ed0d2[_0x4d00('0x21')]({'plain':!![]});var _0x8cf582=_0x4d00('0x48');return db[_0x4d00('0x49')][_0x4d00('0x42')]({'where':{'name':_0x8cf582,'userProfileId':_0x13bf4f[_0x4d00('0x4a')]},'raw':!![]})['then'](function(_0x3110d9){if(_0x3110d9&&_0x3110d9[_0x4d00('0x4b')]===0x0){return db[_0x4d00('0x22')]['create']({'name':_0x3ee807[_0x4d00('0x23')],'resourceId':_0x3ee807['id'],'type':_0x3110d9[_0x4d00('0x23')],'sectionId':_0x3110d9['id']},{})['then'](function(){return _0x5ed0d2;});}else{return _0x5ed0d2;}})[_0x4d00('0x3f')](function(_0x533bcb){logger[_0x4d00('0x4c')](_0x4d00('0x4d'),_0x533bcb);throw _0x533bcb;});}return _0x5ed0d2;})[_0x4d00('0x1f')](respondWithResult(_0x5b29e5,0xc9))[_0x4d00('0x3f')](handleError(_0x5b29e5,null));};exports[_0x4d00('0x4e')]=function(_0x1a6943,_0xffb7b2){var _0x671e6d={'where':{'id':_0x1a6943[_0x4d00('0x41')]['id']}},_0x42959b={};_0x42959b['model']=_[_0x4d00('0x2b')](db[_0x4d00('0x27')]['rawAttributes']);_0x671e6d[_0x4d00('0x2e')]=_[_0x4d00('0x2d')](_0x42959b['model'],qs['fields'](_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x671e6d[_0x4d00('0x2e')]=_0x671e6d[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x671e6d[_0x4d00('0x2e')]:_0x42959b['model'];if(_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x671e6d[_0x4d00('0x3d')]=[{'all':!![]}];}_0x671e6d=_['merge']({},_0x671e6d,_0x1a6943[_0x4d00('0x3c')]);return db[_0x4d00('0x27')]['find'](_0x671e6d)[_0x4d00('0x1f')](handleEntityNotFound(_0xffb7b2,null))[_0x4d00('0x1f')](function(_0x4eb78c){if(_0x4eb78c){var _0x3ae133=_0x4eb78c[_0x4d00('0x21')]({'plain':!![]});_0x3ae133=qs['omit'](_0x3ae133,['id','createdAt','updatedAt']);_0x1a6943[_0x4d00('0x44')]=_[_0x4d00('0x50')](_0x1a6943[_0x4d00('0x44')],['id',_0x4d00('0x51'),'updatedAt']);return db[_0x4d00('0x27')]['create'](_[_0x4d00('0x3b')](_0x3ae133,_0x1a6943[_0x4d00('0x44')]),{'include':_0x1a6943[_0x4d00('0x2c')][_0x4d00('0x4f')]?[{'all':!![]}]:undefined})[_0x4d00('0x1f')](function(_0x5710f6){var _0x1756df=_0x1a6943[_0x4d00('0x45')][_0x4d00('0x21')]({'plain':!![]});if(!_0x1756df)throw new Error(_0x4d00('0x46'));if(_0x1756df[_0x4d00('0x47')]===_0x4d00('0x45')){var _0x5df86b=_0x5710f6[_0x4d00('0x21')]({'plain':!![]});var _0x2f206d=_0x4d00('0x48');return db['UserProfileSection'][_0x4d00('0x42')]({'where':{'name':_0x2f206d,'userProfileId':_0x1756df[_0x4d00('0x4a')]},'raw':!![]})[_0x4d00('0x1f')](function(_0x95567d){if(_0x95567d&&_0x95567d['autoAssociation']===0x0){return db[_0x4d00('0x22')]['create']({'name':_0x5df86b[_0x4d00('0x23')],'resourceId':_0x5df86b['id'],'type':_0x95567d[_0x4d00('0x23')],'sectionId':_0x95567d['id']},{})[_0x4d00('0x1f')](function(){return _0x5710f6;});}else{return _0x5710f6;}})['catch'](function(_0x15aeeb){logger[_0x4d00('0x4c')](_0x4d00('0x4d'),_0x15aeeb);throw _0x15aeeb;});}return _0x5710f6;});}})[_0x4d00('0x1f')](respondWithResult(_0xffb7b2,0xc9))[_0x4d00('0x3f')](handleError(_0xffb7b2,null));};exports[_0x4d00('0x52')]=function(_0x271fac,_0x843471){if(_0x271fac[_0x4d00('0x44')]['id']){delete _0x271fac['body']['id'];}return db[_0x4d00('0x27')]['find']({'where':{'id':_0x271fac['params']['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x843471,null))['then'](saveUpdates(_0x271fac[_0x4d00('0x44')],null))['then'](respondWithResult(_0x843471,null))[_0x4d00('0x3f')](handleError(_0x843471,null));};exports[_0x4d00('0x20')]=function(_0x1065b5,_0x4c6958){return db[_0x4d00('0x27')][_0x4d00('0x42')]({'where':{'id':_0x1065b5[_0x4d00('0x41')]['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x4c6958,null))['then'](removeEntity(_0x4c6958,null))[_0x4d00('0x3f')](handleError(_0x4c6958,null));};exports['getSessions']=function(_0x456eaa,_0x5e2ee2,_0x1a7a64){var _0x539790={'raw':!![],'where':{}};var _0x3aa893={};var _0x1cfb25={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4d00('0x53')]({'where':{'id':_0x456eaa[_0x4d00('0x41')]['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x5e2ee2,null))[_0x4d00('0x1f')](function(_0xb12a37){if(_0xb12a37){_0x3aa893[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x54')][_0x4d00('0x28')]);_0x3aa893[_0x4d00('0x2c')]=_[_0x4d00('0x2b')](_0x456eaa[_0x4d00('0x2c')]);_0x3aa893['filters']=_[_0x4d00('0x2d')](_0x3aa893[_0x4d00('0x2f')],_0x3aa893[_0x4d00('0x2c')]);_0x539790[_0x4d00('0x2e')]=_['intersection'](_0x3aa893[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x539790[_0x4d00('0x2e')]=_0x539790[_0x4d00('0x2e')][_0x4d00('0x31')]?_0x539790[_0x4d00('0x2e')]:_0x3aa893[_0x4d00('0x2f')];if(!_0x456eaa[_0x4d00('0x2c')]['hasOwnProperty'](_0x4d00('0x33'))){_0x539790['limit']=qs['limit'](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x17')]);_0x539790[_0x4d00('0x15')]=qs[_0x4d00('0x15')](_0x456eaa[_0x4d00('0x2c')]['offset']);}_0x539790[_0x4d00('0x34')]=qs[_0x4d00('0x35')](_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x539790[_0x4d00('0x38')]=qs['filters'](_[_0x4d00('0x36')](_0x456eaa[_0x4d00('0x2c')],_0x3aa893['filters']));_0x539790[_0x4d00('0x38')][_0x4d00('0x55')]=_0xb12a37['id'];if(_0x456eaa['query'][_0x4d00('0x3a')]){_0x539790['where']=_[_0x4d00('0x3b')](_0x539790['where'],{'$or':_[_0x4d00('0x26')](_0x539790[_0x4d00('0x2e')],function(_0x32b109){var _0x13b511={};_0x13b511[_0x32b109]={'$like':'%'+_0x456eaa['query'][_0x4d00('0x3a')]+'%'};return _0x13b511;})});}_0x539790=_[_0x4d00('0x3b')]({},_0x539790,_0x456eaa['options']);return db['JscriptySessionReport'][_0x4d00('0x18')]({'where':_0x539790[_0x4d00('0x38')]})['then'](function(_0x2add61){_0x1cfb25[_0x4d00('0x18')]=_0x2add61;if(_0x456eaa[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x539790[_0x4d00('0x3d')]=[{'all':!![]}];}return db[_0x4d00('0x54')][_0x4d00('0x3e')](_0x539790);})[_0x4d00('0x1f')](function(_0x1473a3){_0x1cfb25[_0x4d00('0x56')]=_0x1473a3;return _0x1cfb25;});}})[_0x4d00('0x1f')](respondWithFilteredResult(_0x5e2ee2,_0x539790))[_0x4d00('0x3f')](handleError(_0x5e2ee2,null));};exports[_0x4d00('0x57')]=function(_0x5a6da4,_0x446039,_0x3a64c5){var _0x4f3e2c={'raw':!![],'where':{}};var _0x5a2a74={};var _0x4f2791={'count':0x0,'rows':[]};return db[_0x4d00('0x27')]['findOne']({'where':{'id':_0x5a6da4['params']['id']}})[_0x4d00('0x1f')](handleEntityNotFound(_0x446039,null))[_0x4d00('0x1f')](function(_0x14df34){if(_0x14df34){_0x5a2a74[_0x4d00('0x2f')]=_[_0x4d00('0x2b')](db[_0x4d00('0x58')][_0x4d00('0x28')]);_0x5a2a74[_0x4d00('0x2c')]=_['keys'](_0x5a6da4[_0x4d00('0x2c')]);_0x5a2a74[_0x4d00('0x37')]=_[_0x4d00('0x2d')](_0x5a2a74[_0x4d00('0x2f')],_0x5a2a74[_0x4d00('0x2c')]);_0x4f3e2c[_0x4d00('0x2e')]=_['intersection'](_0x5a2a74[_0x4d00('0x2f')],qs[_0x4d00('0x30')](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x30')]));_0x4f3e2c[_0x4d00('0x2e')]=_0x4f3e2c['attributes'][_0x4d00('0x31')]?_0x4f3e2c[_0x4d00('0x2e')]:_0x5a2a74[_0x4d00('0x2f')];if(!_0x5a6da4['query']['hasOwnProperty'](_0x4d00('0x33'))){_0x4f3e2c[_0x4d00('0x17')]=qs['limit'](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x17')]);_0x4f3e2c[_0x4d00('0x15')]=qs['offset'](_0x5a6da4['query'][_0x4d00('0x15')]);}_0x4f3e2c[_0x4d00('0x34')]=qs[_0x4d00('0x35')](_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x35')]);_0x4f3e2c[_0x4d00('0x38')]=qs[_0x4d00('0x37')](_[_0x4d00('0x36')](_0x5a6da4[_0x4d00('0x2c')],_0x5a2a74[_0x4d00('0x37')]));_0x4f3e2c[_0x4d00('0x38')]['ProjectId']=_0x14df34['id'];if(_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x3a')]){_0x4f3e2c[_0x4d00('0x38')]=_[_0x4d00('0x3b')](_0x4f3e2c[_0x4d00('0x38')],{'$or':_[_0x4d00('0x26')](_0x4f3e2c[_0x4d00('0x2e')],function(_0x2c99c4){var _0x52b938={};_0x52b938[_0x2c99c4]={'$like':'%'+_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x3a')]+'%'};return _0x52b938;})});}_0x4f3e2c=_[_0x4d00('0x3b')]({},_0x4f3e2c,_0x5a6da4[_0x4d00('0x3c')]);return db[_0x4d00('0x58')][_0x4d00('0x18')]({'where':_0x4f3e2c[_0x4d00('0x38')]})[_0x4d00('0x1f')](function(_0xfc9e0f){_0x4f2791['count']=_0xfc9e0f;if(_0x5a6da4[_0x4d00('0x2c')][_0x4d00('0x4f')]){_0x4f3e2c[_0x4d00('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4d00('0x3e')](_0x4f3e2c);})[_0x4d00('0x1f')](function(_0x213554){_0x4f2791[_0x4d00('0x56')]=_0x213554;return _0x4f2791;});}})['then'](respondWithFilteredResult(_0x446039,_0x4f3e2c))[_0x4d00('0x3f')](handleError(_0x446039,null));};function char(_0x106dc1){return _0x4d00('0x59')===typeof _0x106dc1?String[_0x4d00('0x5a')][_0x4d00('0x1c')](null,arguments):_0x106dc1;}function needsEncapsulation(_0x515ae6){return!!_0x515ae6&&(_0x515ae6[_0x4d00('0x5b')]()[_0x4d00('0x5c')](char(0xd))>=0x0||_0x515ae6[_0x4d00('0x5b')]()['indexOf'](char(0xa))>=0x0||_0x515ae6[_0x4d00('0x5b')]()['indexOf'](char(0x2c))>=0x0||_0x515ae6[_0x4d00('0x5b')]()[_0x4d00('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x547f65){var _0x366e32=char(0x22),_0x3822a0='\x5c'+char(0x22),_0x9bac0b=_0x547f65[_0x4d00('0x5b')]()[_0x4d00('0x5d')](new RegExp(_0x366e32,'g'),_0x3822a0);return _0x366e32+_0x9bac0b+_0x366e32;}exports['getSummary']=function(_0x325dc5,_0x40a8c4,_0x95d9aa){var _0x5914c5,_0x162170;var _0x535a02={'where':{'ProjectId':_0x325dc5[_0x4d00('0x41')]['id']}};if(_0x325dc5[_0x4d00('0x2c')][_0x4d00('0x5e')]){_0x535a02[_0x4d00('0x38')][_0x4d00('0x5f')]=JSON[_0x4d00('0x60')](_0x325dc5[_0x4d00('0x2c')][_0x4d00('0x5e')]);}return db[_0x4d00('0x54')][_0x4d00('0x3e')](_0x535a02)[_0x4d00('0x1f')](handleEntityNotFound(_0x40a8c4,null))[_0x4d00('0x1f')](function(_0x6780df){if(_0x6780df){_0x5914c5=_0x6780df;return db[_0x4d00('0x61')][_0x4d00('0x3e')]({'where':{'SessionId':{'$in':_[_0x4d00('0x26')](_0x5914c5,'id')},'ProjectId':_0x325dc5[_0x4d00('0x41')]['id']},'order':_0x4d00('0x62')});}})[_0x4d00('0x1f')](handleEntityNotFound(_0x40a8c4,null))[_0x4d00('0x1f')](function(_0x1cf577){if(_0x1cf577){_0x162170=_0x1cf577;var _0x499ce4={};for(var _0x4e801c=0x0,_0x3beeeb=_0x162170['length'];_0x4e801c<_0x3beeeb;_0x4e801c++){if(!_0x499ce4['hasOwnProperty'](_0x162170[_0x4e801c]['questionId'])){_0x499ce4[_0x162170[_0x4e801c][_0x4d00('0x63')]]=needsEncapsulation(_0x162170[_0x4e801c]['question'])?encapsulate(_0x162170[_0x4e801c][_0x4d00('0x64')]):_0x162170[_0x4e801c][_0x4d00('0x64')];}}var _0x1f5e4c=[],_0x594397={};for(var _0x34eda6=0x0,_0x50a2fb=_0x5914c5['length'];_0x34eda6<_0x50a2fb;_0x34eda6++){_0x594397={'ProjectId':_0x325dc5[_0x4d00('0x41')]['id'],'SessionId':_0x5914c5[_0x34eda6]['id'],'StartTime':moment(_0x5914c5[_0x34eda6][_0x4d00('0x5f')])[_0x4d00('0x65')](_0x4d00('0x66'))};for(var _0x4af27b=0x0,_0x26a803=_0x162170[_0x4d00('0x31')];_0x4af27b<_0x26a803;_0x4af27b++){if(_0x162170[_0x4af27b][_0x4d00('0x67')]==_0x5914c5[_0x34eda6]['id']&&_0x499ce4[_0x4d00('0x32')](_0x162170[_0x4af27b]['questionId'])){_0x594397[_0x499ce4[_0x162170[_0x4af27b][_0x4d00('0x63')]]]=_0x162170[_0x4af27b][_0x4d00('0x68')];}}for(var _0x74dce4 in _0x499ce4){if(!_0x594397[_0x4d00('0x32')](_0x499ce4[_0x74dce4])){_0x594397[_0x499ce4[_0x74dce4]]=null;}}_0x1f5e4c[_0x4d00('0x69')](_0x594397);}return _0x1f5e4c;}})[_0x4d00('0x1f')](function(_0x597aff){if(!_[_0x4d00('0x6a')](_0x597aff)){var _0x80c016=toCsv(_0x597aff);var _0x4b933a=Date[_0x4d00('0x6b')]();fs[_0x4d00('0x6c')](util[_0x4d00('0x65')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a),_0x80c016);_0x40a8c4[_0x4d00('0x6d')](_0x4d00('0x6e'),_0x4d00('0x6f')+util[_0x4d00('0x65')](_0x4d00('0x70'),_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a));_0x40a8c4[_0x4d00('0x6d')](_0x4d00('0x71'),_0x4d00('0x72'));return _0x40a8c4[_0x4d00('0x73')](util[_0x4d00('0x65')](_0x4d00('0x74'),_0x325dc5[_0x4d00('0x41')]['id'],_0x4b933a));}else{return _0x40a8c4['sendStatus'](0xcc);}})[_0x4d00('0x3f')](handleError(_0x40a8c4,null));}; \ No newline at end of file +var _0x8d62=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Projects','UserProfileResource','sendStatus','error','stack','name','send','index','JscriptyProject','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','include','find','omit','updatedAt','body','update','getSessions','findOne','JscriptySessionReport','ProjectId','map','getAnswers','JscriptyAnswerReport','number','indexOf','toString','replace','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','rimraf','zip-dir'];(function(_0x3d07a8,_0x46d1f0){var _0x5bf605=function(_0x2c7274){while(--_0x2c7274){_0x3d07a8['push'](_0x3d07a8['shift']());}};_0x5bf605(++_0x46d1f0);}(_0x8d62,0xf8));var _0x28d6=function(_0x12e6ef,_0x554b17){_0x12e6ef=_0x12e6ef-0x0;var _0x4a4895=_0x8d62[_0x12e6ef];return _0x4a4895;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28d6('0x0'));var zipdir=require(_0x28d6('0x1'));var jsonpatch=require(_0x28d6('0x2'));var rp=require(_0x28d6('0x3'));var moment=require(_0x28d6('0x4'));var BPromise=require(_0x28d6('0x5'));var Mustache=require(_0x28d6('0x6'));var util=require(_0x28d6('0x7'));var path=require(_0x28d6('0x8'));var sox=require(_0x28d6('0x9'));var csv=require(_0x28d6('0xa'));var ejs=require(_0x28d6('0xb'));var fs=require('fs');var fs_extra=require(_0x28d6('0xc'));var _=require(_0x28d6('0xd'));var squel=require('squel');var crypto=require(_0x28d6('0xe'));var jsforce=require(_0x28d6('0xf'));var deskjs=require(_0x28d6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x28d6('0x11'));var Papa=require('papaparse');var Redis=require(_0x28d6('0x12'));var authService=require(_0x28d6('0x13'));var qs=require(_0x28d6('0x14'));var as=require(_0x28d6('0x15'));var hardwareService=require(_0x28d6('0x16'));var logger=require('../../config/logger')(_0x28d6('0x17'));var utils=require(_0x28d6('0x18'));var config=require(_0x28d6('0x19'));var licenseUtil=require(_0x28d6('0x1a'));var db=require(_0x28d6('0x1b'))['db'];function respondWithStatusCode(_0x240839,_0x2c29bd){_0x2c29bd=_0x2c29bd||0xcc;return function(_0x43d460){if(_0x43d460){return _0x240839['sendStatus'](_0x2c29bd);}return _0x240839[_0x28d6('0x1c')](_0x2c29bd)[_0x28d6('0x1d')]();};}function respondWithResult(_0x33ba38,_0x549b39){_0x549b39=_0x549b39||0xc8;return function(_0x1621ee){if(_0x1621ee){return _0x33ba38['status'](_0x549b39)[_0x28d6('0x1e')](_0x1621ee);}};}function respondWithFilteredResult(_0x425ffb,_0x4b82e2){return function(_0x1881a8){if(_0x1881a8){var _0x159d2a=typeof _0x4b82e2[_0x28d6('0x1f')]===_0x28d6('0x20')&&typeof _0x4b82e2[_0x28d6('0x21')]==='undefined';var _0x35317d=_0x1881a8['count'];var _0x44db1a=_0x159d2a?0x0:_0x4b82e2[_0x28d6('0x1f')];var _0x2824bd=_0x159d2a?_0x1881a8[_0x28d6('0x22')]:_0x4b82e2[_0x28d6('0x1f')]+_0x4b82e2[_0x28d6('0x21')];var _0x2d521d;if(_0x2824bd>=_0x35317d){_0x2824bd=_0x35317d;_0x2d521d=0xc8;}else{_0x2d521d=0xce;}_0x425ffb['status'](_0x2d521d);return _0x425ffb[_0x28d6('0x23')](_0x28d6('0x24'),_0x44db1a+'-'+_0x2824bd+'/'+_0x35317d)['json'](_0x1881a8);}return null;};}function patchUpdates(_0x26362e){return function(_0x24f764){try{jsonpatch[_0x28d6('0x25')](_0x24f764,_0x26362e,!![]);}catch(_0x252c1d){return BPromise[_0x28d6('0x26')](_0x252c1d);}return _0x24f764[_0x28d6('0x27')]();};}function saveUpdates(_0x376a64,_0x506be6){return function(_0xcf8fa0){if(_0xcf8fa0){return _0xcf8fa0['update'](_0x376a64)[_0x28d6('0x28')](function(_0x2288eb){return _0x2288eb;});}return null;};}function removeEntity(_0x455dd6,_0x3d128b){return function(_0x26809d){if(_0x26809d){return _0x26809d[_0x28d6('0x29')]()['then'](function(){var _0x5c4909=_0x26809d[_0x28d6('0x2a')]({'plain':!![]});var _0x2fb6f7=_0x28d6('0x2b');return db[_0x28d6('0x2c')]['destroy']({'where':{'type':_0x2fb6f7,'resourceId':_0x5c4909['id']}})[_0x28d6('0x28')](function(){return _0x26809d;});})[_0x28d6('0x28')](function(){_0x455dd6[_0x28d6('0x1c')](0xcc)[_0x28d6('0x1d')]();});}};}function handleEntityNotFound(_0x4757b1,_0x6a76a){return function(_0x60ded0){if(!_0x60ded0){_0x4757b1[_0x28d6('0x2d')](0x194);}return _0x60ded0;};}function handleError(_0x23ef1c,_0x12f77e){_0x12f77e=_0x12f77e||0x1f4;return function(_0x28aaa6){logger[_0x28d6('0x2e')](_0x28aaa6[_0x28d6('0x2f')]);if(_0x28aaa6[_0x28d6('0x30')]){delete _0x28aaa6['name'];}_0x23ef1c['status'](_0x12f77e)[_0x28d6('0x31')](_0x28aaa6);};}exports[_0x28d6('0x32')]=function(_0x3f4dd1,_0x124404){var _0x324cff={},_0x6b156e={},_0x5dfaaf={'count':0x0,'rows':[]};var _0x146a62=_['map'](db[_0x28d6('0x33')]['rawAttributes'],function(_0x1fc791){return{'name':_0x1fc791[_0x28d6('0x34')],'type':_0x1fc791[_0x28d6('0x35')][_0x28d6('0x36')]};});_0x6b156e[_0x28d6('0x37')]=_['map'](_0x146a62,'name');_0x6b156e[_0x28d6('0x38')]=_[_0x28d6('0x39')](_0x3f4dd1['query']);_0x6b156e[_0x28d6('0x3a')]=_['intersection'](_0x6b156e[_0x28d6('0x37')],_0x6b156e['query']);_0x324cff[_0x28d6('0x3b')]=_['intersection'](_0x6b156e[_0x28d6('0x37')],qs[_0x28d6('0x3c')](_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x3c')]));_0x324cff[_0x28d6('0x3b')]=_0x324cff[_0x28d6('0x3b')][_0x28d6('0x3d')]?_0x324cff['attributes']:_0x6b156e[_0x28d6('0x37')];if(!_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x3e')](_0x28d6('0x3f'))){_0x324cff['limit']=qs[_0x28d6('0x21')](_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x21')]);_0x324cff[_0x28d6('0x1f')]=qs['offset'](_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x1f')]);}_0x324cff[_0x28d6('0x40')]=qs[_0x28d6('0x41')](_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x41')]);_0x324cff[_0x28d6('0x42')]=qs[_0x28d6('0x3a')](_[_0x28d6('0x43')](_0x3f4dd1[_0x28d6('0x38')],_0x6b156e[_0x28d6('0x3a')]),_0x146a62);if(_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x44')]){_0x324cff[_0x28d6('0x42')]=_[_0x28d6('0x45')](_0x324cff[_0x28d6('0x42')],{'$or':_['map'](_0x146a62,function(_0x5eff10){if(_0x5eff10['type']!==_0x28d6('0x46')){var _0x4914d2={};_0x4914d2[_0x5eff10['name']]={'$like':'%'+_0x3f4dd1[_0x28d6('0x38')]['filter']+'%'};return _0x4914d2;}})});}_0x324cff=_[_0x28d6('0x45')]({},_0x324cff,_0x3f4dd1[_0x28d6('0x47')]);var _0x53362d={'where':_0x324cff[_0x28d6('0x42')]};return db[_0x28d6('0x33')][_0x28d6('0x22')](_0x53362d)[_0x28d6('0x28')](function(_0x3388dc){_0x5dfaaf[_0x28d6('0x22')]=_0x3388dc;if(_0x3f4dd1[_0x28d6('0x38')][_0x28d6('0x48')]){_0x324cff['include']=[{'all':!![]}];}return db[_0x28d6('0x33')][_0x28d6('0x49')](_0x324cff);})['then'](function(_0x25ac32){_0x5dfaaf[_0x28d6('0x4a')]=_0x25ac32;return _0x5dfaaf;})[_0x28d6('0x28')](respondWithFilteredResult(_0x124404,_0x324cff))['catch'](handleError(_0x124404,null));};exports[_0x28d6('0x4b')]=function(_0x5b407e,_0x2a89ec){var _0x1538ef={'raw':![],'where':{'id':_0x5b407e[_0x28d6('0x4c')]['id']}},_0x48ff48={};_0x48ff48[_0x28d6('0x37')]=_[_0x28d6('0x39')](db['JscriptyProject'][_0x28d6('0x4d')]);_0x48ff48[_0x28d6('0x38')]=_[_0x28d6('0x39')](_0x5b407e[_0x28d6('0x38')]);_0x48ff48['filters']=_[_0x28d6('0x4e')](_0x48ff48[_0x28d6('0x37')],_0x48ff48[_0x28d6('0x38')]);_0x1538ef[_0x28d6('0x3b')]=_[_0x28d6('0x4e')](_0x48ff48['model'],qs[_0x28d6('0x3c')](_0x5b407e[_0x28d6('0x38')][_0x28d6('0x3c')]));_0x1538ef[_0x28d6('0x3b')]=_0x1538ef[_0x28d6('0x3b')][_0x28d6('0x3d')]?_0x1538ef[_0x28d6('0x3b')]:_0x48ff48[_0x28d6('0x37')];if(_0x5b407e[_0x28d6('0x38')][_0x28d6('0x48')]){_0x1538ef['include']=[{'all':!![]}];}_0x1538ef=_['merge']({},_0x1538ef,_0x5b407e[_0x28d6('0x47')]);return db['JscriptyProject']['find'](_0x1538ef)['then'](handleEntityNotFound(_0x2a89ec,null))[_0x28d6('0x28')](respondWithResult(_0x2a89ec,null))['catch'](handleError(_0x2a89ec,null));};exports[_0x28d6('0x4f')]=function(_0x543f58,_0x1cfe1f){return db[_0x28d6('0x33')][_0x28d6('0x4f')](_0x543f58['body'],{})['then'](function(_0x4f9000){var _0x2720b1=_0x543f58[_0x28d6('0x50')]['get']({'plain':!![]});if(!_0x2720b1)throw new Error(_0x28d6('0x51'));if(_0x2720b1[_0x28d6('0x52')]===_0x28d6('0x50')){var _0x27e8e6=_0x4f9000[_0x28d6('0x2a')]({'plain':!![]});var _0x20e8cb=_0x28d6('0x2b');return db[_0x28d6('0x53')]['find']({'where':{'name':_0x20e8cb,'userProfileId':_0x2720b1[_0x28d6('0x54')]},'raw':!![]})[_0x28d6('0x28')](function(_0x9fbbe2){if(_0x9fbbe2&&_0x9fbbe2[_0x28d6('0x55')]===0x0){return db[_0x28d6('0x2c')][_0x28d6('0x4f')]({'name':_0x27e8e6[_0x28d6('0x30')],'resourceId':_0x27e8e6['id'],'type':_0x9fbbe2['name'],'sectionId':_0x9fbbe2['id']},{})[_0x28d6('0x28')](function(){return _0x4f9000;});}else{return _0x4f9000;}})['catch'](function(_0x39b2f3){logger[_0x28d6('0x2e')](_0x28d6('0x56'),_0x39b2f3);throw _0x39b2f3;});}return _0x4f9000;})[_0x28d6('0x28')](respondWithResult(_0x1cfe1f,0xc9))[_0x28d6('0x57')](handleError(_0x1cfe1f,null));};exports[_0x28d6('0x58')]=function(_0x5abffc,_0x30e0a3){var _0x5794ae={'where':{'id':_0x5abffc['params']['id']}},_0x22a140={};_0x22a140[_0x28d6('0x37')]=_[_0x28d6('0x39')](db[_0x28d6('0x33')][_0x28d6('0x4d')]);_0x5794ae['attributes']=_[_0x28d6('0x4e')](_0x22a140[_0x28d6('0x37')],qs[_0x28d6('0x3c')](_0x5abffc[_0x28d6('0x38')][_0x28d6('0x3c')]));_0x5794ae[_0x28d6('0x3b')]=_0x5794ae[_0x28d6('0x3b')][_0x28d6('0x3d')]?_0x5794ae[_0x28d6('0x3b')]:_0x22a140[_0x28d6('0x37')];if(_0x5abffc[_0x28d6('0x38')]['includeAll']){_0x5794ae[_0x28d6('0x59')]=[{'all':!![]}];}_0x5794ae=_[_0x28d6('0x45')]({},_0x5794ae,_0x5abffc[_0x28d6('0x47')]);return db[_0x28d6('0x33')][_0x28d6('0x5a')](_0x5794ae)['then'](handleEntityNotFound(_0x30e0a3,null))[_0x28d6('0x28')](function(_0x219967){if(_0x219967){var _0x40cd58=_0x219967[_0x28d6('0x2a')]({'plain':!![]});_0x40cd58=qs[_0x28d6('0x5b')](_0x40cd58,['id','createdAt',_0x28d6('0x5c')]);_0x5abffc[_0x28d6('0x5d')]=_[_0x28d6('0x5b')](_0x5abffc[_0x28d6('0x5d')],['id','createdAt',_0x28d6('0x5c')]);return db['JscriptyProject'][_0x28d6('0x4f')](_[_0x28d6('0x45')](_0x40cd58,_0x5abffc[_0x28d6('0x5d')]),{'include':_0x5abffc['query'][_0x28d6('0x48')]?[{'all':!![]}]:undefined})[_0x28d6('0x28')](function(_0x2fad72){var _0x16ced4=_0x5abffc[_0x28d6('0x50')][_0x28d6('0x2a')]({'plain':!![]});if(!_0x16ced4)throw new Error(_0x28d6('0x51'));if(_0x16ced4['role']===_0x28d6('0x50')){var _0x3daecc=_0x2fad72[_0x28d6('0x2a')]({'plain':!![]});var _0x2cfd63=_0x28d6('0x2b');return db[_0x28d6('0x53')][_0x28d6('0x5a')]({'where':{'name':_0x2cfd63,'userProfileId':_0x16ced4[_0x28d6('0x54')]},'raw':!![]})[_0x28d6('0x28')](function(_0x18d57e){if(_0x18d57e&&_0x18d57e['autoAssociation']===0x0){return db[_0x28d6('0x2c')][_0x28d6('0x4f')]({'name':_0x3daecc[_0x28d6('0x30')],'resourceId':_0x3daecc['id'],'type':_0x18d57e[_0x28d6('0x30')],'sectionId':_0x18d57e['id']},{})[_0x28d6('0x28')](function(){return _0x2fad72;});}else{return _0x2fad72;}})['catch'](function(_0x2322c6){logger[_0x28d6('0x2e')](_0x28d6('0x56'),_0x2322c6);throw _0x2322c6;});}return _0x2fad72;});}})[_0x28d6('0x28')](respondWithResult(_0x30e0a3,0xc9))[_0x28d6('0x57')](handleError(_0x30e0a3,null));};exports[_0x28d6('0x5e')]=function(_0x3341d,_0x534bf5){if(_0x3341d['body']['id']){delete _0x3341d[_0x28d6('0x5d')]['id'];}return db[_0x28d6('0x33')][_0x28d6('0x5a')]({'where':{'id':_0x3341d['params']['id']}})[_0x28d6('0x28')](handleEntityNotFound(_0x534bf5,null))['then'](saveUpdates(_0x3341d['body'],null))[_0x28d6('0x28')](respondWithResult(_0x534bf5,null))[_0x28d6('0x57')](handleError(_0x534bf5,null));};exports[_0x28d6('0x29')]=function(_0x2f0580,_0x45245a){return db[_0x28d6('0x33')][_0x28d6('0x5a')]({'where':{'id':_0x2f0580['params']['id']}})['then'](handleEntityNotFound(_0x45245a,null))['then'](removeEntity(_0x45245a,null))[_0x28d6('0x57')](handleError(_0x45245a,null));};exports[_0x28d6('0x5f')]=function(_0x3b2753,_0x3d80c7,_0xc851a8){var _0x1ad787={'raw':!![],'where':{}};var _0xb37a0a={};var _0xe3745e={'count':0x0,'rows':[]};return db[_0x28d6('0x33')][_0x28d6('0x60')]({'where':{'id':_0x3b2753['params']['id']}})[_0x28d6('0x28')](handleEntityNotFound(_0x3d80c7,null))[_0x28d6('0x28')](function(_0x1d9978){if(_0x1d9978){_0xb37a0a[_0x28d6('0x37')]=_[_0x28d6('0x39')](db[_0x28d6('0x61')][_0x28d6('0x4d')]);_0xb37a0a[_0x28d6('0x38')]=_[_0x28d6('0x39')](_0x3b2753['query']);_0xb37a0a['filters']=_[_0x28d6('0x4e')](_0xb37a0a[_0x28d6('0x37')],_0xb37a0a[_0x28d6('0x38')]);_0x1ad787['attributes']=_[_0x28d6('0x4e')](_0xb37a0a[_0x28d6('0x37')],qs[_0x28d6('0x3c')](_0x3b2753[_0x28d6('0x38')][_0x28d6('0x3c')]));_0x1ad787[_0x28d6('0x3b')]=_0x1ad787[_0x28d6('0x3b')][_0x28d6('0x3d')]?_0x1ad787[_0x28d6('0x3b')]:_0xb37a0a[_0x28d6('0x37')];if(!_0x3b2753[_0x28d6('0x38')][_0x28d6('0x3e')](_0x28d6('0x3f'))){_0x1ad787[_0x28d6('0x21')]=qs[_0x28d6('0x21')](_0x3b2753['query'][_0x28d6('0x21')]);_0x1ad787[_0x28d6('0x1f')]=qs[_0x28d6('0x1f')](_0x3b2753[_0x28d6('0x38')]['offset']);}_0x1ad787[_0x28d6('0x40')]=qs['sort'](_0x3b2753[_0x28d6('0x38')][_0x28d6('0x41')]);_0x1ad787['where']=qs[_0x28d6('0x3a')](_['pick'](_0x3b2753[_0x28d6('0x38')],_0xb37a0a[_0x28d6('0x3a')]));_0x1ad787[_0x28d6('0x42')][_0x28d6('0x62')]=_0x1d9978['id'];if(_0x3b2753[_0x28d6('0x38')][_0x28d6('0x44')]){_0x1ad787['where']=_[_0x28d6('0x45')](_0x1ad787[_0x28d6('0x42')],{'$or':_[_0x28d6('0x63')](_0x1ad787[_0x28d6('0x3b')],function(_0x3d5bd2){var _0x41ac7d={};_0x41ac7d[_0x3d5bd2]={'$like':'%'+_0x3b2753[_0x28d6('0x38')][_0x28d6('0x44')]+'%'};return _0x41ac7d;})});}_0x1ad787=_['merge']({},_0x1ad787,_0x3b2753[_0x28d6('0x47')]);return db[_0x28d6('0x61')][_0x28d6('0x22')]({'where':_0x1ad787['where']})[_0x28d6('0x28')](function(_0xc7bb3b){_0xe3745e[_0x28d6('0x22')]=_0xc7bb3b;if(_0x3b2753[_0x28d6('0x38')]['includeAll']){_0x1ad787['include']=[{'all':!![]}];}return db[_0x28d6('0x61')][_0x28d6('0x49')](_0x1ad787);})['then'](function(_0x15b53a){_0xe3745e['rows']=_0x15b53a;return _0xe3745e;});}})[_0x28d6('0x28')](respondWithFilteredResult(_0x3d80c7,_0x1ad787))[_0x28d6('0x57')](handleError(_0x3d80c7,null));};exports[_0x28d6('0x64')]=function(_0xca226b,_0x55f12c,_0x47dc3e){var _0x2a1f0b={'raw':!![],'where':{}};var _0x5e1ce0={};var _0x261cfb={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x28d6('0x60')]({'where':{'id':_0xca226b[_0x28d6('0x4c')]['id']}})[_0x28d6('0x28')](handleEntityNotFound(_0x55f12c,null))['then'](function(_0x1a615f){if(_0x1a615f){_0x5e1ce0['model']=_[_0x28d6('0x39')](db[_0x28d6('0x65')]['rawAttributes']);_0x5e1ce0[_0x28d6('0x38')]=_[_0x28d6('0x39')](_0xca226b[_0x28d6('0x38')]);_0x5e1ce0['filters']=_[_0x28d6('0x4e')](_0x5e1ce0['model'],_0x5e1ce0[_0x28d6('0x38')]);_0x2a1f0b['attributes']=_[_0x28d6('0x4e')](_0x5e1ce0['model'],qs[_0x28d6('0x3c')](_0xca226b['query'][_0x28d6('0x3c')]));_0x2a1f0b[_0x28d6('0x3b')]=_0x2a1f0b[_0x28d6('0x3b')][_0x28d6('0x3d')]?_0x2a1f0b[_0x28d6('0x3b')]:_0x5e1ce0['model'];if(!_0xca226b[_0x28d6('0x38')][_0x28d6('0x3e')]('nolimit')){_0x2a1f0b[_0x28d6('0x21')]=qs['limit'](_0xca226b[_0x28d6('0x38')][_0x28d6('0x21')]);_0x2a1f0b['offset']=qs[_0x28d6('0x1f')](_0xca226b['query'][_0x28d6('0x1f')]);}_0x2a1f0b[_0x28d6('0x40')]=qs[_0x28d6('0x41')](_0xca226b['query'][_0x28d6('0x41')]);_0x2a1f0b['where']=qs[_0x28d6('0x3a')](_[_0x28d6('0x43')](_0xca226b['query'],_0x5e1ce0[_0x28d6('0x3a')]));_0x2a1f0b[_0x28d6('0x42')][_0x28d6('0x62')]=_0x1a615f['id'];if(_0xca226b[_0x28d6('0x38')][_0x28d6('0x44')]){_0x2a1f0b['where']=_[_0x28d6('0x45')](_0x2a1f0b['where'],{'$or':_['map'](_0x2a1f0b[_0x28d6('0x3b')],function(_0x3ebbcd){var _0x1c6850={};_0x1c6850[_0x3ebbcd]={'$like':'%'+_0xca226b[_0x28d6('0x38')][_0x28d6('0x44')]+'%'};return _0x1c6850;})});}_0x2a1f0b=_[_0x28d6('0x45')]({},_0x2a1f0b,_0xca226b['options']);return db[_0x28d6('0x65')][_0x28d6('0x22')]({'where':_0x2a1f0b['where']})[_0x28d6('0x28')](function(_0x21143d){_0x261cfb[_0x28d6('0x22')]=_0x21143d;if(_0xca226b[_0x28d6('0x38')]['includeAll']){_0x2a1f0b[_0x28d6('0x59')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x28d6('0x49')](_0x2a1f0b);})[_0x28d6('0x28')](function(_0x31e000){_0x261cfb[_0x28d6('0x4a')]=_0x31e000;return _0x261cfb;});}})['then'](respondWithFilteredResult(_0x55f12c,_0x2a1f0b))[_0x28d6('0x57')](handleError(_0x55f12c,null));};function char(_0x15f2c9){return _0x28d6('0x66')===typeof _0x15f2c9?String['fromCharCode'][_0x28d6('0x25')](null,arguments):_0x15f2c9;}function needsEncapsulation(_0x3be657){return!!_0x3be657&&(_0x3be657['toString']()[_0x28d6('0x67')](char(0xd))>=0x0||_0x3be657[_0x28d6('0x68')]()[_0x28d6('0x67')](char(0xa))>=0x0||_0x3be657[_0x28d6('0x68')]()['indexOf'](char(0x2c))>=0x0||_0x3be657[_0x28d6('0x68')]()[_0x28d6('0x67')](char(0x22))>=0x0);}function encapsulate(_0x429563){var _0x9ff014=char(0x22),_0x23cd3e='\x5c'+char(0x22),_0x50e289=_0x429563[_0x28d6('0x68')]()[_0x28d6('0x69')](new RegExp(_0x9ff014,'g'),_0x23cd3e);return _0x9ff014+_0x50e289+_0x9ff014;}exports['getSummary']=function(_0x29c8cd,_0xc09ad7,_0x3bd614){var _0x3a44ae,_0x3b0c05;var _0x933217={'where':{'ProjectId':_0x29c8cd['params']['id']}};if(_0x29c8cd['query']['startTime']){_0x933217[_0x28d6('0x42')]['starttime']=JSON[_0x28d6('0x6a')](_0x29c8cd[_0x28d6('0x38')][_0x28d6('0x6b')]);}return db[_0x28d6('0x61')]['findAll'](_0x933217)[_0x28d6('0x28')](handleEntityNotFound(_0xc09ad7,null))[_0x28d6('0x28')](function(_0x1e91ce){if(_0x1e91ce){_0x3a44ae=_0x1e91ce;return db[_0x28d6('0x6c')][_0x28d6('0x49')]({'where':{'SessionId':{'$in':_[_0x28d6('0x63')](_0x3a44ae,'id')},'ProjectId':_0x29c8cd[_0x28d6('0x4c')]['id']},'order':_0x28d6('0x6d')});}})[_0x28d6('0x28')](handleEntityNotFound(_0xc09ad7,null))[_0x28d6('0x28')](function(_0x184f70){if(_0x184f70){_0x3b0c05=_0x184f70;var _0x17e923={};for(var _0x13b288=0x0,_0x329c8a=_0x3b0c05['length'];_0x13b288<_0x329c8a;_0x13b288++){if(!_0x17e923[_0x28d6('0x3e')](_0x3b0c05[_0x13b288]['questionId'])){_0x17e923[_0x3b0c05[_0x13b288][_0x28d6('0x6e')]]=needsEncapsulation(_0x3b0c05[_0x13b288][_0x28d6('0x6f')])?encapsulate(_0x3b0c05[_0x13b288][_0x28d6('0x6f')]):_0x3b0c05[_0x13b288][_0x28d6('0x6f')];}}var _0x1dabc3=[],_0xad0e98={};for(var _0x260738=0x0,_0x4658c3=_0x3a44ae[_0x28d6('0x3d')];_0x260738<_0x4658c3;_0x260738++){_0xad0e98={'ProjectId':_0x29c8cd[_0x28d6('0x4c')]['id'],'SessionId':_0x3a44ae[_0x260738]['id'],'StartTime':moment(_0x3a44ae[_0x260738][_0x28d6('0x70')])[_0x28d6('0x71')](_0x28d6('0x72'))};for(var _0x4cb4c7=0x0,_0x55e688=_0x3b0c05[_0x28d6('0x3d')];_0x4cb4c7<_0x55e688;_0x4cb4c7++){if(_0x3b0c05[_0x4cb4c7]['SessionId']==_0x3a44ae[_0x260738]['id']&&_0x17e923['hasOwnProperty'](_0x3b0c05[_0x4cb4c7][_0x28d6('0x6e')])){_0xad0e98[_0x17e923[_0x3b0c05[_0x4cb4c7][_0x28d6('0x6e')]]]=_0x3b0c05[_0x4cb4c7][_0x28d6('0x73')];}}for(var _0x2deca4 in _0x17e923){if(!_0xad0e98[_0x28d6('0x3e')](_0x17e923[_0x2deca4])){_0xad0e98[_0x17e923[_0x2deca4]]=null;}}_0x1dabc3['push'](_0xad0e98);}return _0x1dabc3;}})['then'](function(_0x46b411){if(!_[_0x28d6('0x74')](_0x46b411)){var _0xd02fdf=toCsv(_0x46b411);var _0x4edaf8=Date[_0x28d6('0x75')]();fs[_0x28d6('0x76')](util['format'](_0x28d6('0x77'),_0x29c8cd[_0x28d6('0x4c')]['id'],_0x4edaf8),_0xd02fdf);_0xc09ad7['setHeader'](_0x28d6('0x78'),_0x28d6('0x79')+util[_0x28d6('0x71')]('Jscripty_Project_%d_Summary_%s.csv',_0x29c8cd[_0x28d6('0x4c')]['id'],_0x4edaf8));_0xc09ad7[_0x28d6('0x7a')](_0x28d6('0x7b'),_0x28d6('0x7c'));return _0xc09ad7['download'](util[_0x28d6('0x71')](_0x28d6('0x77'),_0x29c8cd[_0x28d6('0x4c')]['id'],_0x4edaf8));}else{return _0xc09ad7[_0x28d6('0x2d')](0xcc);}})[_0x28d6('0x57')](handleError(_0xc09ad7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 06f171e..bc04bc7 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 _0x41d9=['../../config/environment','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x15f6a4,_0x133a91){var _0x1e403f=function(_0x327596){while(--_0x327596){_0x15f6a4['push'](_0x15f6a4['shift']());}};_0x1e403f(++_0x133a91);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var logger=require(_0x941d('0x2'))(_0x941d('0x3'));var moment=require(_0x941d('0x4'));var BPromise=require(_0x941d('0x5'));var rp=require(_0x941d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x941d('0x7'));var config=require(_0x941d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x941d('0x9')]=function(_0x19dd41,_0x56e384){return _0x19dd41[_0x941d('0xa')]('JscriptyProject',attributes,{'tableName':_0x941d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x089f=['../../config/environment','exports','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x40696a,_0x110176){var _0x56b95a=function(_0x5c9eb2){while(--_0x5c9eb2){_0x40696a['push'](_0x40696a['shift']());}};_0x56b95a(++_0x110176);}(_0x089f,0x1c7));var _0xf089=function(_0x2e4e26,_0x4ee241){_0x2e4e26=_0x2e4e26-0x0;var _0x4d45cb=_0x089f[_0x2e4e26];return _0x4d45cb;};'use strict';var _=require('lodash');var util=require(_0xf089('0x0'));var logger=require(_0xf089('0x1'))(_0xf089('0x2'));var moment=require(_0xf089('0x3'));var BPromise=require(_0xf089('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf089('0x5'));var rimraf=require(_0xf089('0x6'));var config=require(_0xf089('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0xf089('0x8')]=function(_0x126d3d,_0x21bce2){return _0x126d3d['define'](_0xf089('0x9'),attributes,{'tableName':_0xf089('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 a6a0213..360fdaa 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5e7cdf,_0xdeff97){var _0x1ab319=function(_0x37b2ed){while(--_0x37b2ed){_0x5e7cdf['push'](_0x5e7cdf['shift']());}};_0x1ab319(++_0xdeff97);}(_0xb43b,0x1b2));var _0xbb43=function(_0xda3748,_0x5b2a30){_0xda3748=_0xda3748-0x0;var _0x569eb1=_0xb43b[_0xda3748];return _0x569eb1;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +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(_0x203713,_0x436643){var _0x2c694d=function(_0x2fc5a0){while(--_0x2fc5a0){_0x203713['push'](_0x203713['shift']());}};_0x2c694d(++_0x436643);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 367d2e3..941d12c 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 _0x5d73=['delete','/:id','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','create','put','update'];(function(_0x83b36f,_0x36f797){var _0x3a2c15=function(_0x5d2788){while(--_0x5d2788){_0x83b36f['push'](_0x83b36f['shift']());}};_0x3a2c15(++_0x36f797);}(_0x5d73,0x1a2));var _0x35d7=function(_0xdb7f0b,_0x5dafae){_0xdb7f0b=_0xdb7f0b-0x0;var _0x279d9e=_0x5d73[_0xdb7f0b];return _0x279d9e;};'use strict';var multer=require('multer');var util=require(_0x35d7('0x0'));var path=require(_0x35d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x35d7('0x2'));var router=express[_0x35d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x35d7('0x4'));var interaction=require(_0x35d7('0x5'));var config=require('../../config/environment');var controller=require(_0x35d7('0x6'));router[_0x35d7('0x7')]('/',auth[_0x35d7('0x8')](),controller[_0x35d7('0x9')]);router[_0x35d7('0x7')](_0x35d7('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x35d7('0x7')]('/:id',auth[_0x35d7('0x8')](),controller['show']);router['post']('/',auth[_0x35d7('0x8')](),controller[_0x35d7('0xb')]);router[_0x35d7('0xc')]('/:id',auth[_0x35d7('0x8')](),controller[_0x35d7('0xd')]);router[_0x35d7('0xe')](_0x35d7('0xf'),auth[_0x35d7('0x8')](),controller[_0x35d7('0x10')]);module[_0x35d7('0x11')]=router; \ No newline at end of file +var _0x21be=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5be652,_0x129d44){var _0x3c89da=function(_0x2f01ac){while(--_0x2f01ac){_0x5be652['push'](_0x5be652['shift']());}};_0x3c89da(++_0x129d44);}(_0x21be,0xaa));var _0xe21b=function(_0x353598,_0x33e234){_0x353598=_0x353598-0x0;var _0x4cf82e=_0x21be[_0x353598];return _0x4cf82e;};'use strict';var multer=require(_0xe21b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe21b('0x1'));var express=require(_0xe21b('0x2'));var router=express[_0xe21b('0x3')]();var fs_extra=require(_0xe21b('0x4'));var auth=require(_0xe21b('0x5'));var interaction=require(_0xe21b('0x6'));var config=require(_0xe21b('0x7'));var controller=require(_0xe21b('0x8'));router['get']('/',auth[_0xe21b('0x9')](),controller[_0xe21b('0xa')]);router[_0xe21b('0xb')]('/describe',auth[_0xe21b('0x9')](),controller[_0xe21b('0xc')]);router['get'](_0xe21b('0xd'),auth['isAuthenticated'](),controller[_0xe21b('0xe')]);router[_0xe21b('0xf')]('/',auth['isAuthenticated'](),controller[_0xe21b('0x10')]);router[_0xe21b('0x11')](_0xe21b('0xd'),auth[_0xe21b('0x9')](),controller[_0xe21b('0x12')]);router['delete'](_0xe21b('0xd'),auth[_0xe21b('0x9')](),controller[_0xe21b('0x13')]);module[_0xe21b('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index da2d8fb..9f54a69 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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x63b26d,_0x4e8967){_0x63b26d=_0x63b26d-0x0;var _0x20ae62=_0x7a54[_0x63b26d];return _0x20ae62;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x3edd94,_0x2524c8){_0x3edd94=_0x3edd94-0x0;var _0x2b677f=_0x7a54[_0x3edd94];return _0x2b677f;};'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 2cd3613..ae57d25 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 _0x00e5=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x2eb03e,_0x78c7b0){var _0x30773c=function(_0x55c6dc){while(--_0x55c6dc){_0x2eb03e['push'](_0x2eb03e['shift']());}};_0x30773c(++_0x78c7b0);}(_0x00e5,0x8d));var _0x500e=function(_0x3f637c,_0x2f6cc0){_0x3f637c=_0x3f637c-0x0;var _0xfae5d9=_0x00e5[_0x3f637c];return _0xfae5d9;};'use strict';var emlformat=require(_0x500e('0x0'));var rimraf=require(_0x500e('0x1'));var zipdir=require(_0x500e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x500e('0x3'));var moment=require(_0x500e('0x4'));var BPromise=require(_0x500e('0x5'));var Mustache=require(_0x500e('0x6'));var util=require(_0x500e('0x7'));var path=require(_0x500e('0x8'));var sox=require(_0x500e('0x9'));var csv=require(_0x500e('0xa'));var ejs=require(_0x500e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x500e('0xc'));var crypto=require(_0x500e('0xd'));var jsforce=require(_0x500e('0xe'));var deskjs=require(_0x500e('0xf'));var toCsv=require(_0x500e('0xa'));var querystring=require(_0x500e('0x10'));var Papa=require('papaparse');var Redis=require(_0x500e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x500e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x500e('0x13'));var utils=require('../../config/utils');var config=require(_0x500e('0x14'));var licenseUtil=require(_0x500e('0x15'));var db=require(_0x500e('0x16'))['db'];function respondWithStatusCode(_0x3845d0,_0x30a261){_0x30a261=_0x30a261||0xcc;return function(_0x1f0efb){if(_0x1f0efb){return _0x3845d0['sendStatus'](_0x30a261);}return _0x3845d0[_0x500e('0x17')](_0x30a261)['end']();};}function respondWithResult(_0x380bf1,_0x3fe113){_0x3fe113=_0x3fe113||0xc8;return function(_0x36c9b8){if(_0x36c9b8){return _0x380bf1[_0x500e('0x17')](_0x3fe113)[_0x500e('0x18')](_0x36c9b8);}};}function respondWithFilteredResult(_0x118beb,_0xd06cb1){return function(_0x17016a){if(_0x17016a){var _0x3275b1=typeof _0xd06cb1[_0x500e('0x19')]==='undefined'&&typeof _0xd06cb1[_0x500e('0x1a')]==='undefined';var _0x2d621d=_0x17016a['count'];var _0x5b7362=_0x3275b1?0x0:_0xd06cb1[_0x500e('0x19')];var _0x2f256c=_0x3275b1?_0x17016a[_0x500e('0x1b')]:_0xd06cb1[_0x500e('0x19')]+_0xd06cb1[_0x500e('0x1a')];var _0x455053;if(_0x2f256c>=_0x2d621d){_0x2f256c=_0x2d621d;_0x455053=0xc8;}else{_0x455053=0xce;}_0x118beb[_0x500e('0x17')](_0x455053);return _0x118beb['set'](_0x500e('0x1c'),_0x5b7362+'-'+_0x2f256c+'/'+_0x2d621d)['json'](_0x17016a);}return null;};}function patchUpdates(_0x101731){return function(_0x36e69c){try{jsonpatch[_0x500e('0x1d')](_0x36e69c,_0x101731,!![]);}catch(_0x14866a){return BPromise['reject'](_0x14866a);}return _0x36e69c[_0x500e('0x1e')]();};}function saveUpdates(_0x2cb7b5,_0x484664){return function(_0x366b17){if(_0x366b17){return _0x366b17[_0x500e('0x1f')](_0x2cb7b5)['then'](function(_0x3ed53f){return _0x3ed53f;});}return null;};}function removeEntity(_0x280999,_0x1fa28b){return function(_0x40028f){if(_0x40028f){return _0x40028f[_0x500e('0x20')]()[_0x500e('0x21')](function(){_0x280999[_0x500e('0x17')](0xcc)[_0x500e('0x22')]();});}};}function handleEntityNotFound(_0x562591,_0x1346a3){return function(_0x57ae48){if(!_0x57ae48){_0x562591[_0x500e('0x23')](0x194);}return _0x57ae48;};}function handleError(_0x4b8d4c,_0x3dc7ce){_0x3dc7ce=_0x3dc7ce||0x1f4;return function(_0x4ca271){logger[_0x500e('0x24')](_0x4ca271[_0x500e('0x25')]);if(_0x4ca271[_0x500e('0x26')]){delete _0x4ca271[_0x500e('0x26')];}_0x4b8d4c['status'](_0x3dc7ce)['send'](_0x4ca271);};}exports[_0x500e('0x27')]=function(_0x413170,_0x5c07ae){var _0x48d7ed={},_0x3d6ed5={},_0x1dfe4={'count':0x0,'rows':[]};var _0x10ecf4=_[_0x500e('0x28')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x339bfd){return{'name':_0x339bfd[_0x500e('0x29')],'type':_0x339bfd[_0x500e('0x2a')][_0x500e('0x2b')]};});_0x3d6ed5[_0x500e('0x2c')]=_[_0x500e('0x28')](_0x10ecf4,'name');_0x3d6ed5[_0x500e('0x2d')]=_[_0x500e('0x2e')](_0x413170['query']);_0x3d6ed5[_0x500e('0x2f')]=_[_0x500e('0x30')](_0x3d6ed5[_0x500e('0x2c')],_0x3d6ed5[_0x500e('0x2d')]);_0x48d7ed['attributes']=_['intersection'](_0x3d6ed5[_0x500e('0x2c')],qs[_0x500e('0x31')](_0x413170['query']['fields']));_0x48d7ed[_0x500e('0x32')]=_0x48d7ed[_0x500e('0x32')][_0x500e('0x33')]?_0x48d7ed['attributes']:_0x3d6ed5['model'];if(!_0x413170[_0x500e('0x2d')][_0x500e('0x34')](_0x500e('0x35'))){_0x48d7ed[_0x500e('0x1a')]=qs[_0x500e('0x1a')](_0x413170['query'][_0x500e('0x1a')]);_0x48d7ed['offset']=qs[_0x500e('0x19')](_0x413170[_0x500e('0x2d')][_0x500e('0x19')]);}_0x48d7ed[_0x500e('0x36')]=qs[_0x500e('0x37')](_0x413170[_0x500e('0x2d')]['sort']);_0x48d7ed[_0x500e('0x38')]=qs[_0x500e('0x2f')](_[_0x500e('0x39')](_0x413170[_0x500e('0x2d')],_0x3d6ed5[_0x500e('0x2f')]),_0x10ecf4);if(_0x413170[_0x500e('0x2d')][_0x500e('0x3a')]){_0x48d7ed[_0x500e('0x38')]=_[_0x500e('0x3b')](_0x48d7ed['where'],{'$or':_[_0x500e('0x28')](_0x10ecf4,function(_0x59ed54){if(_0x59ed54['type']!=='VIRTUAL'){var _0xf0855a={};_0xf0855a[_0x59ed54[_0x500e('0x26')]]={'$like':'%'+_0x413170[_0x500e('0x2d')][_0x500e('0x3a')]+'%'};return _0xf0855a;}})});}_0x48d7ed=_[_0x500e('0x3b')]({},_0x48d7ed,_0x413170['options']);var _0x189f49={'where':_0x48d7ed[_0x500e('0x38')]};return db[_0x500e('0x3c')][_0x500e('0x1b')](_0x189f49)[_0x500e('0x21')](function(_0x280e57){_0x1dfe4[_0x500e('0x1b')]=_0x280e57;if(_0x413170[_0x500e('0x2d')][_0x500e('0x3d')]){_0x48d7ed[_0x500e('0x3e')]=[{'all':!![]}];}return db[_0x500e('0x3c')][_0x500e('0x3f')](_0x48d7ed);})['then'](function(_0x109627){_0x1dfe4[_0x500e('0x40')]=_0x109627;return _0x1dfe4;})[_0x500e('0x21')](respondWithFilteredResult(_0x5c07ae,_0x48d7ed))[_0x500e('0x41')](handleError(_0x5c07ae,null));};exports[_0x500e('0x42')]=function(_0x68712d,_0x310f19){var _0x1c3673={'raw':!![],'where':{'id':_0x68712d[_0x500e('0x43')]['id']}},_0x72332f={};_0x72332f[_0x500e('0x2c')]=_[_0x500e('0x2e')](db[_0x500e('0x3c')]['rawAttributes']);_0x72332f[_0x500e('0x2d')]=_['keys'](_0x68712d[_0x500e('0x2d')]);_0x72332f[_0x500e('0x2f')]=_[_0x500e('0x30')](_0x72332f[_0x500e('0x2c')],_0x72332f[_0x500e('0x2d')]);_0x1c3673[_0x500e('0x32')]=_[_0x500e('0x30')](_0x72332f[_0x500e('0x2c')],qs[_0x500e('0x31')](_0x68712d['query'][_0x500e('0x31')]));_0x1c3673['attributes']=_0x1c3673[_0x500e('0x32')][_0x500e('0x33')]?_0x1c3673[_0x500e('0x32')]:_0x72332f[_0x500e('0x2c')];if(_0x68712d[_0x500e('0x2d')]['includeAll']){_0x1c3673[_0x500e('0x3e')]=[{'all':!![]}];}_0x1c3673=_[_0x500e('0x3b')]({},_0x1c3673,_0x68712d['options']);return db[_0x500e('0x3c')]['find'](_0x1c3673)['then'](handleEntityNotFound(_0x310f19,null))[_0x500e('0x21')](respondWithResult(_0x310f19,null))[_0x500e('0x41')](handleError(_0x310f19,null));};exports[_0x500e('0x44')]=function(_0x43d2e0,_0x563957){return db[_0x500e('0x3c')][_0x500e('0x44')](_0x43d2e0[_0x500e('0x45')],{})['then'](respondWithResult(_0x563957,0xc9))[_0x500e('0x41')](handleError(_0x563957,null));};exports[_0x500e('0x1f')]=function(_0x4f1bf8,_0x1fdb75){if(_0x4f1bf8[_0x500e('0x45')]['id']){delete _0x4f1bf8[_0x500e('0x45')]['id'];}return db[_0x500e('0x3c')][_0x500e('0x46')]({'where':{'id':_0x4f1bf8[_0x500e('0x43')]['id']}})[_0x500e('0x21')](handleEntityNotFound(_0x1fdb75,null))[_0x500e('0x21')](saveUpdates(_0x4f1bf8['body'],null))[_0x500e('0x21')](respondWithResult(_0x1fdb75,null))['catch'](handleError(_0x1fdb75,null));};exports['destroy']=function(_0x3a658d,_0x13e01a){return db[_0x500e('0x3c')][_0x500e('0x46')]({'where':{'id':_0x3a658d[_0x500e('0x43')]['id']}})[_0x500e('0x21')](handleEntityNotFound(_0x13e01a,null))[_0x500e('0x21')](removeEntity(_0x13e01a,null))[_0x500e('0x41')](handleError(_0x13e01a,null));};exports[_0x500e('0x47')]=function(_0x421251,_0x199c2a){return db[_0x500e('0x3c')][_0x500e('0x47')]()['then'](respondWithResult(_0x199c2a,null))[_0x500e('0x41')](handleError(_0x199c2a,null));}; \ No newline at end of file +var _0x8036=['to-csv','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','then','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','JscriptyQuestionReport','include','findAll','rows','show','params','fields','catch','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox'];(function(_0x198aff,_0x5c37f2){var _0x3ca67b=function(_0x290373){while(--_0x290373){_0x198aff['push'](_0x198aff['shift']());}};_0x3ca67b(++_0x5c37f2);}(_0x8036,0x108));var _0x6803=function(_0x1c9f04,_0x48b590){_0x1c9f04=_0x1c9f04-0x0;var _0x44da1d=_0x8036[_0x1c9f04];return _0x44da1d;};'use strict';var emlformat=require(_0x6803('0x0'));var rimraf=require(_0x6803('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6803('0x2'));var rp=require('request-promise');var moment=require(_0x6803('0x3'));var BPromise=require(_0x6803('0x4'));var Mustache=require(_0x6803('0x5'));var util=require(_0x6803('0x6'));var path=require('path');var sox=require(_0x6803('0x7'));var csv=require(_0x6803('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6803('0x9'));var _=require(_0x6803('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6803('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6803('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6803('0xc'));var authService=require(_0x6803('0xd'));var qs=require(_0x6803('0xe'));var as=require(_0x6803('0xf'));var hardwareService=require(_0x6803('0x10'));var logger=require('../../config/logger')(_0x6803('0x11'));var utils=require(_0x6803('0x12'));var config=require(_0x6803('0x13'));var licenseUtil=require(_0x6803('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x475fd1,_0x94a6b5){_0x94a6b5=_0x94a6b5||0xcc;return function(_0x58470d){if(_0x58470d){return _0x475fd1[_0x6803('0x15')](_0x94a6b5);}return _0x475fd1[_0x6803('0x16')](_0x94a6b5)[_0x6803('0x17')]();};}function respondWithResult(_0xec333f,_0x3554c8){_0x3554c8=_0x3554c8||0xc8;return function(_0x221afd){if(_0x221afd){return _0xec333f['status'](_0x3554c8)[_0x6803('0x18')](_0x221afd);}};}function respondWithFilteredResult(_0x1d7a90,_0x3c8530){return function(_0x35850a){if(_0x35850a){var _0x16b995=typeof _0x3c8530['offset']===_0x6803('0x19')&&typeof _0x3c8530[_0x6803('0x1a')]===_0x6803('0x19');var _0x50fd71=_0x35850a[_0x6803('0x1b')];var _0x2a4f68=_0x16b995?0x0:_0x3c8530[_0x6803('0x1c')];var _0x4e2f69=_0x16b995?_0x35850a[_0x6803('0x1b')]:_0x3c8530[_0x6803('0x1c')]+_0x3c8530[_0x6803('0x1a')];var _0x1cd5d6;if(_0x4e2f69>=_0x50fd71){_0x4e2f69=_0x50fd71;_0x1cd5d6=0xc8;}else{_0x1cd5d6=0xce;}_0x1d7a90['status'](_0x1cd5d6);return _0x1d7a90[_0x6803('0x1d')]('Content-Range',_0x2a4f68+'-'+_0x4e2f69+'/'+_0x50fd71)['json'](_0x35850a);}return null;};}function patchUpdates(_0x4f7e17){return function(_0x827296){try{jsonpatch['apply'](_0x827296,_0x4f7e17,!![]);}catch(_0x241def){return BPromise[_0x6803('0x1e')](_0x241def);}return _0x827296['save']();};}function saveUpdates(_0x30032c,_0x14fec8){return function(_0x49ec87){if(_0x49ec87){return _0x49ec87[_0x6803('0x1f')](_0x30032c)[_0x6803('0x20')](function(_0x44e52d){return _0x44e52d;});}return null;};}function removeEntity(_0x2eb30b,_0x581ae9){return function(_0x3584aa){if(_0x3584aa){return _0x3584aa['destroy']()[_0x6803('0x20')](function(){_0x2eb30b[_0x6803('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f73f7,_0xe0b36c){return function(_0x340e46){if(!_0x340e46){_0x2f73f7[_0x6803('0x15')](0x194);}return _0x340e46;};}function handleError(_0x56bb46,_0x782cf9){_0x782cf9=_0x782cf9||0x1f4;return function(_0x528df6){logger['error'](_0x528df6['stack']);if(_0x528df6[_0x6803('0x21')]){delete _0x528df6[_0x6803('0x21')];}_0x56bb46[_0x6803('0x16')](_0x782cf9)[_0x6803('0x22')](_0x528df6);};}exports['index']=function(_0x199f94,_0x4269c6){var _0x7be6cb={},_0x3d5b1d={},_0xaf2139={'count':0x0,'rows':[]};var _0x3453cb=_[_0x6803('0x23')](db['JscriptyQuestionReport'][_0x6803('0x24')],function(_0x2ce105){return{'name':_0x2ce105[_0x6803('0x25')],'type':_0x2ce105[_0x6803('0x26')][_0x6803('0x27')]};});_0x3d5b1d[_0x6803('0x28')]=_['map'](_0x3453cb,_0x6803('0x21'));_0x3d5b1d['query']=_[_0x6803('0x29')](_0x199f94[_0x6803('0x2a')]);_0x3d5b1d[_0x6803('0x2b')]=_[_0x6803('0x2c')](_0x3d5b1d[_0x6803('0x28')],_0x3d5b1d[_0x6803('0x2a')]);_0x7be6cb[_0x6803('0x2d')]=_[_0x6803('0x2c')](_0x3d5b1d[_0x6803('0x28')],qs['fields'](_0x199f94[_0x6803('0x2a')]['fields']));_0x7be6cb[_0x6803('0x2d')]=_0x7be6cb[_0x6803('0x2d')][_0x6803('0x2e')]?_0x7be6cb[_0x6803('0x2d')]:_0x3d5b1d['model'];if(!_0x199f94['query'][_0x6803('0x2f')](_0x6803('0x30'))){_0x7be6cb[_0x6803('0x1a')]=qs['limit'](_0x199f94['query'][_0x6803('0x1a')]);_0x7be6cb[_0x6803('0x1c')]=qs[_0x6803('0x1c')](_0x199f94[_0x6803('0x2a')][_0x6803('0x1c')]);}_0x7be6cb['order']=qs[_0x6803('0x31')](_0x199f94[_0x6803('0x2a')][_0x6803('0x31')]);_0x7be6cb['where']=qs['filters'](_[_0x6803('0x32')](_0x199f94[_0x6803('0x2a')],_0x3d5b1d[_0x6803('0x2b')]),_0x3453cb);if(_0x199f94['query'][_0x6803('0x33')]){_0x7be6cb['where']=_[_0x6803('0x34')](_0x7be6cb[_0x6803('0x35')],{'$or':_['map'](_0x3453cb,function(_0xf8d342){if(_0xf8d342[_0x6803('0x26')]!==_0x6803('0x36')){var _0x15ca06={};_0x15ca06[_0xf8d342[_0x6803('0x21')]]={'$like':'%'+_0x199f94[_0x6803('0x2a')][_0x6803('0x33')]+'%'};return _0x15ca06;}})});}_0x7be6cb=_[_0x6803('0x34')]({},_0x7be6cb,_0x199f94[_0x6803('0x37')]);var _0x3ca0d0={'where':_0x7be6cb[_0x6803('0x35')]};return db[_0x6803('0x38')][_0x6803('0x1b')](_0x3ca0d0)['then'](function(_0x201204){_0xaf2139[_0x6803('0x1b')]=_0x201204;if(_0x199f94[_0x6803('0x2a')]['includeAll']){_0x7be6cb[_0x6803('0x39')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x6803('0x3a')](_0x7be6cb);})['then'](function(_0x291bc2){_0xaf2139[_0x6803('0x3b')]=_0x291bc2;return _0xaf2139;})[_0x6803('0x20')](respondWithFilteredResult(_0x4269c6,_0x7be6cb))['catch'](handleError(_0x4269c6,null));};exports[_0x6803('0x3c')]=function(_0x539a99,_0x382db3){var _0x513a20={'raw':!![],'where':{'id':_0x539a99[_0x6803('0x3d')]['id']}},_0x48feeb={};_0x48feeb[_0x6803('0x28')]=_[_0x6803('0x29')](db[_0x6803('0x38')][_0x6803('0x24')]);_0x48feeb[_0x6803('0x2a')]=_['keys'](_0x539a99[_0x6803('0x2a')]);_0x48feeb[_0x6803('0x2b')]=_[_0x6803('0x2c')](_0x48feeb[_0x6803('0x28')],_0x48feeb['query']);_0x513a20[_0x6803('0x2d')]=_['intersection'](_0x48feeb[_0x6803('0x28')],qs[_0x6803('0x3e')](_0x539a99[_0x6803('0x2a')][_0x6803('0x3e')]));_0x513a20['attributes']=_0x513a20[_0x6803('0x2d')][_0x6803('0x2e')]?_0x513a20[_0x6803('0x2d')]:_0x48feeb[_0x6803('0x28')];if(_0x539a99[_0x6803('0x2a')]['includeAll']){_0x513a20[_0x6803('0x39')]=[{'all':!![]}];}_0x513a20=_[_0x6803('0x34')]({},_0x513a20,_0x539a99[_0x6803('0x37')]);return db[_0x6803('0x38')]['find'](_0x513a20)[_0x6803('0x20')](handleEntityNotFound(_0x382db3,null))['then'](respondWithResult(_0x382db3,null))[_0x6803('0x3f')](handleError(_0x382db3,null));};exports['create']=function(_0x5bdc8f,_0x44a211){return db[_0x6803('0x38')]['create'](_0x5bdc8f[_0x6803('0x40')],{})[_0x6803('0x20')](respondWithResult(_0x44a211,0xc9))[_0x6803('0x3f')](handleError(_0x44a211,null));};exports[_0x6803('0x1f')]=function(_0x17ed86,_0x368fbf){if(_0x17ed86[_0x6803('0x40')]['id']){delete _0x17ed86[_0x6803('0x40')]['id'];}return db[_0x6803('0x38')][_0x6803('0x41')]({'where':{'id':_0x17ed86['params']['id']}})[_0x6803('0x20')](handleEntityNotFound(_0x368fbf,null))[_0x6803('0x20')](saveUpdates(_0x17ed86['body'],null))[_0x6803('0x20')](respondWithResult(_0x368fbf,null))[_0x6803('0x3f')](handleError(_0x368fbf,null));};exports[_0x6803('0x42')]=function(_0x176ce2,_0x3dc174){return db[_0x6803('0x38')]['find']({'where':{'id':_0x176ce2[_0x6803('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3dc174,null))[_0x6803('0x20')](removeEntity(_0x3dc174,null))[_0x6803('0x3f')](handleError(_0x3dc174,null));};exports[_0x6803('0x43')]=function(_0x16e9b4,_0x55dcc2){return db['JscriptyQuestionReport']['describe']()[_0x6803('0x20')](respondWithResult(_0x55dcc2,null))['catch'](handleError(_0x55dcc2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3248fbb..026c565 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 _0x90ac=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x1ce800,_0xc790de){var _0x34c576=function(_0x2998cd){while(--_0x2998cd){_0x1ce800['push'](_0x1ce800['shift']());}};_0x34c576(++_0xc790de);}(_0x90ac,0x15b));var _0xc90a=function(_0x3c4171,_0x18c1bb){_0x3c4171=_0x3c4171-0x0;var _0x1afa85=_0x90ac[_0x3c4171];return _0x1afa85;};'use strict';var _=require(_0xc90a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc90a('0x1'));var BPromise=require(_0xc90a('0x2'));var rp=require(_0xc90a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc90a('0x4'));var config=require(_0xc90a('0x5'));var attributes=require(_0xc90a('0x6'));module[_0xc90a('0x7')]=function(_0x10ec13,_0x2b341d){return _0x10ec13[_0xc90a('0x8')](_0xc90a('0x9'),attributes,{'tableName':_0xc90a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0dc5=['JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x22d204,_0x42940a){var _0x13be8e=function(_0x2da994){while(--_0x2da994){_0x22d204['push'](_0x22d204['shift']());}};_0x13be8e(++_0x42940a);}(_0x0dc5,0x136));var _0x50dc=function(_0x4248a3,_0x6da3a7){_0x4248a3=_0x4248a3-0x0;var _0xda2fa1=_0x0dc5[_0x4248a3];return _0xda2fa1;};'use strict';var _=require('lodash');var util=require(_0x50dc('0x0'));var logger=require(_0x50dc('0x1'))(_0x50dc('0x2'));var moment=require(_0x50dc('0x3'));var BPromise=require(_0x50dc('0x4'));var rp=require(_0x50dc('0x5'));var fs=require('fs');var path=require(_0x50dc('0x6'));var rimraf=require(_0x50dc('0x7'));var config=require(_0x50dc('0x8'));var attributes=require(_0x50dc('0x9'));module[_0x50dc('0xa')]=function(_0xfb7820,_0x5d9af5){return _0xfb7820[_0x50dc('0xb')](_0x50dc('0xc'),attributes,{'tableName':_0x50dc('0xd'),'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 37e2f12..630d707 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 _0xedc7=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2cfe01,_0x7b24ea){var _0x1faa10=function(_0x2e30e0){while(--_0x2e30e0){_0x2cfe01['push'](_0x2cfe01['shift']());}};_0x1faa10(++_0x7b24ea);}(_0xedc7,0x1c4));var _0x7edc=function(_0x4bb689,_0x9741eb){_0x4bb689=_0x4bb689-0x0;var _0x4cd033=_0xedc7[_0x4bb689];return _0x4cd033;};'use strict';var _=require(_0x7edc('0x0'));var util=require(_0x7edc('0x1'));var moment=require(_0x7edc('0x2'));var BPromise=require(_0x7edc('0x3'));var rs=require(_0x7edc('0x4'));var fs=require('fs');var Redis=require(_0x7edc('0x5'));var db=require(_0x7edc('0x6'))['db'];var utils=require(_0x7edc('0x7'));var logger=require(_0x7edc('0x8'))(_0x7edc('0x9'));var config=require(_0x7edc('0xa'));var jayson=require(_0x7edc('0xb'));var client=jayson[_0x7edc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b73f,_0x2587ee,_0x35370f){return new BPromise(function(_0x515102,_0x53c413){return client[_0x7edc('0xd')](_0x45b73f,_0x35370f)[_0x7edc('0xe')](function(_0x4513f7){logger[_0x7edc('0xf')](_0x7edc('0x10'),_0x2587ee,'request\x20sent');logger[_0x7edc('0x11')](_0x7edc('0x12'),_0x2587ee,'request\x20sent',JSON[_0x7edc('0x13')](_0x4513f7));if(_0x4513f7[_0x7edc('0x14')]){if(_0x4513f7[_0x7edc('0x14')][_0x7edc('0x15')]===0x1f4){logger[_0x7edc('0x14')](_0x7edc('0x10'),_0x2587ee,_0x4513f7[_0x7edc('0x14')][_0x7edc('0x16')]);return _0x53c413(_0x4513f7['error']['message']);}logger['error'](_0x7edc('0x10'),_0x2587ee,_0x4513f7[_0x7edc('0x14')][_0x7edc('0x16')]);return _0x515102(_0x4513f7['error'][_0x7edc('0x16')]);}else{logger['info'](_0x7edc('0x10'),_0x2587ee,_0x7edc('0x17'));_0x515102(_0x4513f7['result'][_0x7edc('0x16')]);}})[_0x7edc('0x18')](function(_0x185fcd){logger[_0x7edc('0x14')](_0x7edc('0x10'),_0x2587ee,_0x185fcd);_0x53c413(_0x185fcd);});});} \ No newline at end of file +var _0xbe13=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbe13,0x141));var _0x3be1=function(_0x2ccc7f,_0x3b6af3){_0x2ccc7f=_0x2ccc7f-0x0;var _0x22fc54=_0xbe13[_0x2ccc7f];return _0x22fc54;};'use strict';var _=require(_0x3be1('0x0'));var util=require(_0x3be1('0x1'));var moment=require('moment');var BPromise=require(_0x3be1('0x2'));var rs=require(_0x3be1('0x3'));var fs=require('fs');var Redis=require(_0x3be1('0x4'));var db=require(_0x3be1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3be1('0x6'))(_0x3be1('0x7'));var config=require(_0x3be1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3be1('0x9')][_0x3be1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34abeb,_0xf55ff5,_0x37e87c){return new BPromise(function(_0x5ebf2f,_0x5e96c4){return client['request'](_0x34abeb,_0x37e87c)['then'](function(_0x568083){logger[_0x3be1('0xb')](_0x3be1('0xc'),_0xf55ff5,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0xf55ff5,_0x3be1('0xd'),JSON[_0x3be1('0xe')](_0x568083));if(_0x568083[_0x3be1('0xf')]){if(_0x568083[_0x3be1('0xf')][_0x3be1('0x10')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0xf55ff5,_0x568083[_0x3be1('0xf')][_0x3be1('0x11')]);return _0x5e96c4(_0x568083[_0x3be1('0xf')][_0x3be1('0x11')]);}logger[_0x3be1('0xf')](_0x3be1('0xc'),_0xf55ff5,_0x568083['error'][_0x3be1('0x11')]);return _0x5ebf2f(_0x568083[_0x3be1('0xf')]['message']);}else{logger[_0x3be1('0xb')](_0x3be1('0xc'),_0xf55ff5,_0x3be1('0xd'));_0x5ebf2f(_0x568083[_0x3be1('0x12')][_0x3be1('0x11')]);}})[_0x3be1('0x13')](function(_0x3a62a1){logger['error'](_0x3be1('0xc'),_0xf55ff5,_0x3a62a1);_0x5e96c4(_0x3a62a1);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index d25b1ac..f26174a 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 _0x2e56=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show','/:id/questions','getQuestions','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x2e56,0x92));var _0x62e5=function(_0x2efe86,_0x4b6c3f){_0x2efe86=_0x2efe86-0x0;var _0x48e01c=_0x2e56[_0x2efe86];return _0x48e01c;};'use strict';var multer=require(_0x62e5('0x0'));var util=require(_0x62e5('0x1'));var path=require(_0x62e5('0x2'));var timeout=require(_0x62e5('0x3'));var express=require(_0x62e5('0x4'));var router=express[_0x62e5('0x5')]();var fs_extra=require(_0x62e5('0x6'));var auth=require(_0x62e5('0x7'));var interaction=require(_0x62e5('0x8'));var config=require(_0x62e5('0x9'));var controller=require(_0x62e5('0xa'));router[_0x62e5('0xb')]('/',auth[_0x62e5('0xc')](),controller[_0x62e5('0xd')]);router[_0x62e5('0xb')](_0x62e5('0xe'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x62e5('0xf')]);router['get'](_0x62e5('0x10'),auth[_0x62e5('0xc')](),controller[_0x62e5('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x62e5('0x12')]);router[_0x62e5('0x13')]('/:id',auth[_0x62e5('0xc')](),controller[_0x62e5('0x14')]);router[_0x62e5('0x15')](_0x62e5('0x16'),auth['isAuthenticated'](),controller[_0x62e5('0x17')]);module[_0x62e5('0x18')]=router; \ No newline at end of file +var _0x9930=['create','put','update','delete','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getQuestions'];(function(_0xa822a0,_0x38e2cc){var _0xaf7e66=function(_0x349fce){while(--_0x349fce){_0xa822a0['push'](_0xa822a0['shift']());}};_0xaf7e66(++_0x38e2cc);}(_0x9930,0x15a));var _0x0993=function(_0xf8b390,_0x342656){_0xf8b390=_0xf8b390-0x0;var _0x1a11e2=_0x9930[_0xf8b390];return _0x1a11e2;};'use strict';var multer=require(_0x0993('0x0'));var util=require(_0x0993('0x1'));var path=require(_0x0993('0x2'));var timeout=require('connect-timeout');var express=require(_0x0993('0x3'));var router=express['Router']();var fs_extra=require(_0x0993('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0993('0x5'));var config=require(_0x0993('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x0993('0x7')]('/',auth[_0x0993('0x8')](),controller[_0x0993('0x9')]);router[_0x0993('0x7')](_0x0993('0xa'),auth[_0x0993('0x8')](),controller[_0x0993('0xb')]);router[_0x0993('0x7')](_0x0993('0xc'),auth['isAuthenticated'](),controller[_0x0993('0xd')]);router[_0x0993('0x7')]('/:id/questions',auth[_0x0993('0x8')](),controller[_0x0993('0xe')]);router['post']('/',auth[_0x0993('0x8')](),controller[_0x0993('0xf')]);router[_0x0993('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0993('0x11')]);router[_0x0993('0x12')](_0x0993('0xc'),auth[_0x0993('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index df040fd..3b9980d 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 _0xb838=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x5a93b9,_0x120370){var _0x478ecb=function(_0x439c96){while(--_0x439c96){_0x5a93b9['push'](_0x5a93b9['shift']());}};_0x478ecb(++_0x120370);}(_0xb838,0x14b));var _0x8b83=function(_0xb75783,_0x4966e5){_0xb75783=_0xb75783-0x0;var _0x538881=_0xb838[_0xb75783];return _0x538881;};'use strict';var moment=require(_0x8b83('0x0'));var Sequelize=require(_0x8b83('0x1'));module[_0x8b83('0x2')]={'starttime':{'type':Sequelize[_0x8b83('0x3')],'set':function(_0x35fb99){this[_0x8b83('0x4')](_0x8b83('0x5'),_0x35fb99);this[_0x8b83('0x4')](_0x8b83('0x6'),moment()[_0x8b83('0x7')](_0x8b83('0x8')));}},'endtime':{'type':Sequelize[_0x8b83('0x3')]},'membername':{'type':Sequelize[_0x8b83('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8b83('0x9')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8b83('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x8b83('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x93ab=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue'];(function(_0xd68a7d,_0x59af94){var _0x143847=function(_0x5a4772){while(--_0x5a4772){_0xd68a7d['push'](_0xd68a7d['shift']());}};_0x143847(++_0x59af94);}(_0x93ab,0x17f));var _0xb93a=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x93ab[_0x187279];return _0x3da59d;};'use strict';var moment=require(_0xb93a('0x0'));var Sequelize=require('sequelize');module[_0xb93a('0x1')]={'starttime':{'type':Sequelize[_0xb93a('0x2')],'set':function(_0xee2555){this[_0xb93a('0x3')](_0xb93a('0x4'),_0xee2555);this[_0xb93a('0x3')]('endtime',moment()[_0xb93a('0x5')](_0xb93a('0x6')));}},'endtime':{'type':Sequelize[_0xb93a('0x2')]},'membername':{'type':Sequelize[_0xb93a('0x7')]},'projectname':{'type':Sequelize[_0xb93a('0x7')]},'queue':{'type':Sequelize[_0xb93a('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb93a('0x7')]},'calleridnum':{'type':Sequelize[_0xb93a('0x7')]},'completed':{'type':Sequelize[_0xb93a('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index e82d5ba..3475285 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 _0x6f11=['catch','show','params','keys','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','filter','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','index','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','nolimit','sort','filters','pick','merge','where','options','JscriptySessionReport','includeAll','rows'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x6f11,0x1e9));var _0x16f1=function(_0xa517f5,_0xb4b21a){_0xa517f5=_0xa517f5-0x0;var _0x1c8c60=_0x6f11[_0xa517f5];return _0x1c8c60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16f1('0x0'));var zipdir=require(_0x16f1('0x1'));var jsonpatch=require(_0x16f1('0x2'));var rp=require('request-promise');var moment=require(_0x16f1('0x3'));var BPromise=require(_0x16f1('0x4'));var Mustache=require('mustache');var util=require(_0x16f1('0x5'));var path=require(_0x16f1('0x6'));var sox=require('sox');var csv=require(_0x16f1('0x7'));var ejs=require(_0x16f1('0x8'));var fs=require('fs');var fs_extra=require(_0x16f1('0x9'));var _=require('lodash');var squel=require(_0x16f1('0xa'));var crypto=require(_0x16f1('0xb'));var jsforce=require(_0x16f1('0xc'));var deskjs=require(_0x16f1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16f1('0xe'));var Redis=require(_0x16f1('0xf'));var authService=require(_0x16f1('0x10'));var qs=require(_0x16f1('0x11'));var as=require(_0x16f1('0x12'));var hardwareService=require(_0x16f1('0x13'));var logger=require(_0x16f1('0x14'))(_0x16f1('0x15'));var utils=require(_0x16f1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x16f1('0x17'));var db=require(_0x16f1('0x18'))['db'];function respondWithStatusCode(_0x2ea47e,_0x36aace){_0x36aace=_0x36aace||0xcc;return function(_0x1458ea){if(_0x1458ea){return _0x2ea47e[_0x16f1('0x19')](_0x36aace);}return _0x2ea47e[_0x16f1('0x1a')](_0x36aace)[_0x16f1('0x1b')]();};}function respondWithResult(_0x4d6fdc,_0x410680){_0x410680=_0x410680||0xc8;return function(_0x2cb5fe){if(_0x2cb5fe){return _0x4d6fdc[_0x16f1('0x1a')](_0x410680)[_0x16f1('0x1c')](_0x2cb5fe);}};}function respondWithFilteredResult(_0x47bee2,_0x5f0b69){return function(_0x1c9cca){if(_0x1c9cca){var _0xecef0a=typeof _0x5f0b69[_0x16f1('0x1d')]===_0x16f1('0x1e')&&typeof _0x5f0b69[_0x16f1('0x1f')]===_0x16f1('0x1e');var _0x87006c=_0x1c9cca[_0x16f1('0x20')];var _0x3df24c=_0xecef0a?0x0:_0x5f0b69[_0x16f1('0x1d')];var _0x5cc921=_0xecef0a?_0x1c9cca['count']:_0x5f0b69['offset']+_0x5f0b69[_0x16f1('0x1f')];var _0x3f93e9;if(_0x5cc921>=_0x87006c){_0x5cc921=_0x87006c;_0x3f93e9=0xc8;}else{_0x3f93e9=0xce;}_0x47bee2['status'](_0x3f93e9);return _0x47bee2[_0x16f1('0x21')](_0x16f1('0x22'),_0x3df24c+'-'+_0x5cc921+'/'+_0x87006c)['json'](_0x1c9cca);}return null;};}function patchUpdates(_0x154163){return function(_0x4145e7){try{jsonpatch[_0x16f1('0x23')](_0x4145e7,_0x154163,!![]);}catch(_0x44516a){return BPromise[_0x16f1('0x24')](_0x44516a);}return _0x4145e7['save']();};}function saveUpdates(_0x1ae9ef,_0x503aa8){return function(_0x569eed){if(_0x569eed){return _0x569eed[_0x16f1('0x25')](_0x1ae9ef)['then'](function(_0x1d7493){return _0x1d7493;});}return null;};}function removeEntity(_0x5a00af,_0x102070){return function(_0x541b39){if(_0x541b39){return _0x541b39[_0x16f1('0x26')]()[_0x16f1('0x27')](function(){_0x5a00af[_0x16f1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x573111,_0x18fa82){return function(_0x5689ff){if(!_0x5689ff){_0x573111['sendStatus'](0x194);}return _0x5689ff;};}function handleError(_0x36626d,_0xc5f6fc){_0xc5f6fc=_0xc5f6fc||0x1f4;return function(_0x587d2a){logger[_0x16f1('0x28')](_0x587d2a['stack']);if(_0x587d2a['name']){delete _0x587d2a[_0x16f1('0x29')];}_0x36626d[_0x16f1('0x1a')](_0xc5f6fc)['send'](_0x587d2a);};}exports[_0x16f1('0x2a')]=function(_0x1de0ea,_0x5d7dc0){var _0x2a18cc={},_0xf7b585={},_0x5b6e85={'count':0x0,'rows':[]};var _0x284ee7=_['map'](db['JscriptySessionReport'][_0x16f1('0x2b')],function(_0x3e4f2a){return{'name':_0x3e4f2a[_0x16f1('0x2c')],'type':_0x3e4f2a[_0x16f1('0x2d')][_0x16f1('0x2e')]};});_0xf7b585[_0x16f1('0x2f')]=_[_0x16f1('0x30')](_0x284ee7,_0x16f1('0x29'));_0xf7b585[_0x16f1('0x31')]=_['keys'](_0x1de0ea[_0x16f1('0x31')]);_0xf7b585['filters']=_['intersection'](_0xf7b585['model'],_0xf7b585[_0x16f1('0x31')]);_0x2a18cc[_0x16f1('0x32')]=_[_0x16f1('0x33')](_0xf7b585['model'],qs[_0x16f1('0x34')](_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x34')]));_0x2a18cc[_0x16f1('0x32')]=_0x2a18cc[_0x16f1('0x32')][_0x16f1('0x35')]?_0x2a18cc[_0x16f1('0x32')]:_0xf7b585[_0x16f1('0x2f')];if(!_0x1de0ea[_0x16f1('0x31')]['hasOwnProperty'](_0x16f1('0x36'))){_0x2a18cc[_0x16f1('0x1f')]=qs[_0x16f1('0x1f')](_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x1f')]);_0x2a18cc[_0x16f1('0x1d')]=qs['offset'](_0x1de0ea['query'][_0x16f1('0x1d')]);}_0x2a18cc['order']=qs[_0x16f1('0x37')](_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x37')]);_0x2a18cc['where']=qs[_0x16f1('0x38')](_[_0x16f1('0x39')](_0x1de0ea['query'],_0xf7b585[_0x16f1('0x38')]),_0x284ee7);if(_0x1de0ea[_0x16f1('0x31')]['filter']){_0x2a18cc['where']=_[_0x16f1('0x3a')](_0x2a18cc[_0x16f1('0x3b')],{'$or':_['map'](_0x284ee7,function(_0x27a664){if(_0x27a664['type']!=='VIRTUAL'){var _0x2f85d9={};_0x2f85d9[_0x27a664['name']]={'$like':'%'+_0x1de0ea['query']['filter']+'%'};return _0x2f85d9;}})});}_0x2a18cc=_['merge']({},_0x2a18cc,_0x1de0ea[_0x16f1('0x3c')]);var _0x69551={'where':_0x2a18cc[_0x16f1('0x3b')]};return db[_0x16f1('0x3d')][_0x16f1('0x20')](_0x69551)['then'](function(_0x65e39b){_0x5b6e85[_0x16f1('0x20')]=_0x65e39b;if(_0x1de0ea[_0x16f1('0x31')][_0x16f1('0x3e')]){_0x2a18cc['include']=[{'all':!![]}];}return db[_0x16f1('0x3d')]['findAll'](_0x2a18cc);})[_0x16f1('0x27')](function(_0x474652){_0x5b6e85[_0x16f1('0x3f')]=_0x474652;return _0x5b6e85;})[_0x16f1('0x27')](respondWithFilteredResult(_0x5d7dc0,_0x2a18cc))[_0x16f1('0x40')](handleError(_0x5d7dc0,null));};exports[_0x16f1('0x41')]=function(_0x5b7632,_0x10ceda){var _0xe335f9={'raw':!![],'where':{'id':_0x5b7632[_0x16f1('0x42')]['id']}},_0x590f5c={};_0x590f5c['model']=_[_0x16f1('0x43')](db['JscriptySessionReport'][_0x16f1('0x2b')]);_0x590f5c[_0x16f1('0x31')]=_['keys'](_0x5b7632[_0x16f1('0x31')]);_0x590f5c[_0x16f1('0x38')]=_['intersection'](_0x590f5c['model'],_0x590f5c[_0x16f1('0x31')]);_0xe335f9[_0x16f1('0x32')]=_['intersection'](_0x590f5c['model'],qs[_0x16f1('0x34')](_0x5b7632[_0x16f1('0x31')][_0x16f1('0x34')]));_0xe335f9[_0x16f1('0x32')]=_0xe335f9[_0x16f1('0x32')][_0x16f1('0x35')]?_0xe335f9[_0x16f1('0x32')]:_0x590f5c[_0x16f1('0x2f')];if(_0x5b7632['query']['includeAll']){_0xe335f9[_0x16f1('0x44')]=[{'all':!![]}];}_0xe335f9=_['merge']({},_0xe335f9,_0x5b7632[_0x16f1('0x3c')]);return db[_0x16f1('0x3d')][_0x16f1('0x45')](_0xe335f9)['then'](handleEntityNotFound(_0x10ceda,null))[_0x16f1('0x27')](respondWithResult(_0x10ceda,null))[_0x16f1('0x40')](handleError(_0x10ceda,null));};exports[_0x16f1('0x46')]=function(_0x327b86,_0x4a8daa){return db['JscriptySessionReport'][_0x16f1('0x46')](_0x327b86[_0x16f1('0x47')],{})['then'](respondWithResult(_0x4a8daa,0xc9))[_0x16f1('0x40')](handleError(_0x4a8daa,null));};exports[_0x16f1('0x25')]=function(_0x449de8,_0x47e93b){if(_0x449de8[_0x16f1('0x47')]['id']){delete _0x449de8[_0x16f1('0x47')]['id'];}return db['JscriptySessionReport'][_0x16f1('0x45')]({'where':{'id':_0x449de8[_0x16f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x47e93b,null))[_0x16f1('0x27')](saveUpdates(_0x449de8[_0x16f1('0x47')],null))[_0x16f1('0x27')](respondWithResult(_0x47e93b,null))[_0x16f1('0x40')](handleError(_0x47e93b,null));};exports[_0x16f1('0x26')]=function(_0x1c4255,_0x17afda){return db['JscriptySessionReport'][_0x16f1('0x45')]({'where':{'id':_0x1c4255[_0x16f1('0x42')]['id']}})[_0x16f1('0x27')](handleEntityNotFound(_0x17afda,null))[_0x16f1('0x27')](removeEntity(_0x17afda,null))[_0x16f1('0x40')](handleError(_0x17afda,null));};exports[_0x16f1('0x48')]=function(_0x5a4d61,_0x2538d6){return db[_0x16f1('0x3d')]['describe']()[_0x16f1('0x27')](respondWithResult(_0x2538d6,null))[_0x16f1('0x40')](handleError(_0x2538d6,null));};exports[_0x16f1('0x49')]=function(_0x1a34d6,_0xd2ce33,_0x3d498d){var _0x340b78={'raw':!![],'where':{}};var _0x78bf99={};var _0x27b2c5={'count':0x0,'rows':[]};return db[_0x16f1('0x3d')][_0x16f1('0x4a')]({'where':{'id':_0x1a34d6[_0x16f1('0x42')]['id']}})[_0x16f1('0x27')](handleEntityNotFound(_0xd2ce33,null))[_0x16f1('0x27')](function(_0x3463f3){if(_0x3463f3){_0x78bf99['model']=_[_0x16f1('0x43')](db[_0x16f1('0x4b')][_0x16f1('0x2b')]);_0x78bf99[_0x16f1('0x31')]=_[_0x16f1('0x43')](_0x1a34d6[_0x16f1('0x31')]);_0x78bf99[_0x16f1('0x38')]=_[_0x16f1('0x33')](_0x78bf99[_0x16f1('0x2f')],_0x78bf99[_0x16f1('0x31')]);_0x340b78[_0x16f1('0x32')]=_[_0x16f1('0x33')](_0x78bf99[_0x16f1('0x2f')],qs[_0x16f1('0x34')](_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x34')]));_0x340b78[_0x16f1('0x32')]=_0x340b78[_0x16f1('0x32')][_0x16f1('0x35')]?_0x340b78['attributes']:_0x78bf99[_0x16f1('0x2f')];if(!_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x4c')]('nolimit')){_0x340b78[_0x16f1('0x1f')]=qs[_0x16f1('0x1f')](_0x1a34d6['query'][_0x16f1('0x1f')]);_0x340b78[_0x16f1('0x1d')]=qs[_0x16f1('0x1d')](_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x1d')]);}_0x340b78['order']=qs[_0x16f1('0x37')](_0x1a34d6['query'][_0x16f1('0x37')]);_0x340b78[_0x16f1('0x3b')]=qs[_0x16f1('0x38')](_[_0x16f1('0x39')](_0x1a34d6[_0x16f1('0x31')],_0x78bf99[_0x16f1('0x38')]));_0x340b78['where'][_0x16f1('0x4d')]=_0x3463f3['id'];if(_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x4e')]){_0x340b78[_0x16f1('0x3b')]=_['merge'](_0x340b78[_0x16f1('0x3b')],{'$or':_[_0x16f1('0x30')](_0x340b78[_0x16f1('0x32')],function(_0x109c57){var _0x4cd8d3={};_0x4cd8d3[_0x109c57]={'$like':'%'+_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x4e')]+'%'};return _0x4cd8d3;})});}_0x340b78=_[_0x16f1('0x3a')]({},_0x340b78,_0x1a34d6[_0x16f1('0x3c')]);return db[_0x16f1('0x4b')]['count']({'where':_0x340b78[_0x16f1('0x3b')]})[_0x16f1('0x27')](function(_0x383187){_0x27b2c5['count']=_0x383187;if(_0x1a34d6[_0x16f1('0x31')][_0x16f1('0x3e')]){_0x340b78[_0x16f1('0x44')]=[{'all':!![]}];}return db[_0x16f1('0x4b')]['findAll'](_0x340b78);})[_0x16f1('0x27')](function(_0x535bdf){_0x27b2c5[_0x16f1('0x3f')]=_0x535bdf;return _0x27b2c5;});}})[_0x16f1('0x27')](respondWithFilteredResult(_0xd2ce33,_0x340b78))[_0x16f1('0x40')](handleError(_0xd2ce33,null));}; \ No newline at end of file +var _0x6e55=['order','where','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getQuestions','findOne','JscriptyQuestionReport','sort','SessionId','rows','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','error','stack','name','index','map','JscriptySessionReport','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6e55,0x1a7));var _0x56e5=function(_0x1c3844,_0x145508){_0x1c3844=_0x1c3844-0x0;var _0x2f229f=_0x6e55[_0x1c3844];return _0x2f229f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56e5('0x0'));var zipdir=require(_0x56e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x56e5('0x2'));var Mustache=require(_0x56e5('0x3'));var util=require('util');var path=require('path');var sox=require(_0x56e5('0x4'));var csv=require(_0x56e5('0x5'));var ejs=require(_0x56e5('0x6'));var fs=require('fs');var fs_extra=require(_0x56e5('0x7'));var _=require(_0x56e5('0x8'));var squel=require(_0x56e5('0x9'));var crypto=require(_0x56e5('0xa'));var jsforce=require(_0x56e5('0xb'));var deskjs=require(_0x56e5('0xc'));var toCsv=require(_0x56e5('0x5'));var querystring=require(_0x56e5('0xd'));var Papa=require(_0x56e5('0xe'));var Redis=require(_0x56e5('0xf'));var authService=require(_0x56e5('0x10'));var qs=require(_0x56e5('0x11'));var as=require(_0x56e5('0x12'));var hardwareService=require(_0x56e5('0x13'));var logger=require(_0x56e5('0x14'))(_0x56e5('0x15'));var utils=require(_0x56e5('0x16'));var config=require(_0x56e5('0x17'));var licenseUtil=require(_0x56e5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11bfab,_0xbefa41){_0xbefa41=_0xbefa41||0xcc;return function(_0x5954a3){if(_0x5954a3){return _0x11bfab[_0x56e5('0x19')](_0xbefa41);}return _0x11bfab[_0x56e5('0x1a')](_0xbefa41)[_0x56e5('0x1b')]();};}function respondWithResult(_0x407f23,_0x1462fc){_0x1462fc=_0x1462fc||0xc8;return function(_0x441033){if(_0x441033){return _0x407f23[_0x56e5('0x1a')](_0x1462fc)[_0x56e5('0x1c')](_0x441033);}};}function respondWithFilteredResult(_0x9b9591,_0x4ef9e7){return function(_0x21340a){if(_0x21340a){var _0x108942=typeof _0x4ef9e7[_0x56e5('0x1d')]==='undefined'&&typeof _0x4ef9e7[_0x56e5('0x1e')]===_0x56e5('0x1f');var _0x2a70b8=_0x21340a[_0x56e5('0x20')];var _0x4ed38d=_0x108942?0x0:_0x4ef9e7[_0x56e5('0x1d')];var _0xbf3f01=_0x108942?_0x21340a[_0x56e5('0x20')]:_0x4ef9e7[_0x56e5('0x1d')]+_0x4ef9e7[_0x56e5('0x1e')];var _0x1ac5c2;if(_0xbf3f01>=_0x2a70b8){_0xbf3f01=_0x2a70b8;_0x1ac5c2=0xc8;}else{_0x1ac5c2=0xce;}_0x9b9591[_0x56e5('0x1a')](_0x1ac5c2);return _0x9b9591[_0x56e5('0x21')](_0x56e5('0x22'),_0x4ed38d+'-'+_0xbf3f01+'/'+_0x2a70b8)[_0x56e5('0x1c')](_0x21340a);}return null;};}function patchUpdates(_0x5cd915){return function(_0x24c0c3){try{jsonpatch['apply'](_0x24c0c3,_0x5cd915,!![]);}catch(_0x35f502){return BPromise[_0x56e5('0x23')](_0x35f502);}return _0x24c0c3['save']();};}function saveUpdates(_0x573251,_0x5e9c67){return function(_0xca3a69){if(_0xca3a69){return _0xca3a69[_0x56e5('0x24')](_0x573251)['then'](function(_0x36acf6){return _0x36acf6;});}return null;};}function removeEntity(_0x2dc000,_0x3e8524){return function(_0x1fcba7){if(_0x1fcba7){return _0x1fcba7[_0x56e5('0x25')]()['then'](function(){_0x2dc000[_0x56e5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37cfb0,_0x442a43){return function(_0x2ff1f1){if(!_0x2ff1f1){_0x37cfb0[_0x56e5('0x19')](0x194);}return _0x2ff1f1;};}function handleError(_0x97dddd,_0x3ae4dc){_0x3ae4dc=_0x3ae4dc||0x1f4;return function(_0x3720c4){logger[_0x56e5('0x26')](_0x3720c4[_0x56e5('0x27')]);if(_0x3720c4[_0x56e5('0x28')]){delete _0x3720c4[_0x56e5('0x28')];}_0x97dddd[_0x56e5('0x1a')](_0x3ae4dc)['send'](_0x3720c4);};}exports[_0x56e5('0x29')]=function(_0x255b69,_0x39ef3e){var _0x3ef534={},_0x5028df={},_0x57651a={'count':0x0,'rows':[]};var _0x2603a4=_[_0x56e5('0x2a')](db[_0x56e5('0x2b')]['rawAttributes'],function(_0x2bb80a){return{'name':_0x2bb80a[_0x56e5('0x2c')],'type':_0x2bb80a[_0x56e5('0x2d')][_0x56e5('0x2e')]};});_0x5028df[_0x56e5('0x2f')]=_['map'](_0x2603a4,'name');_0x5028df['query']=_[_0x56e5('0x30')](_0x255b69['query']);_0x5028df[_0x56e5('0x31')]=_[_0x56e5('0x32')](_0x5028df['model'],_0x5028df['query']);_0x3ef534[_0x56e5('0x33')]=_[_0x56e5('0x32')](_0x5028df[_0x56e5('0x2f')],qs[_0x56e5('0x34')](_0x255b69[_0x56e5('0x35')][_0x56e5('0x34')]));_0x3ef534['attributes']=_0x3ef534[_0x56e5('0x33')][_0x56e5('0x36')]?_0x3ef534[_0x56e5('0x33')]:_0x5028df[_0x56e5('0x2f')];if(!_0x255b69['query'][_0x56e5('0x37')](_0x56e5('0x38'))){_0x3ef534[_0x56e5('0x1e')]=qs[_0x56e5('0x1e')](_0x255b69[_0x56e5('0x35')][_0x56e5('0x1e')]);_0x3ef534[_0x56e5('0x1d')]=qs[_0x56e5('0x1d')](_0x255b69['query'][_0x56e5('0x1d')]);}_0x3ef534[_0x56e5('0x39')]=qs['sort'](_0x255b69[_0x56e5('0x35')]['sort']);_0x3ef534[_0x56e5('0x3a')]=qs[_0x56e5('0x31')](_['pick'](_0x255b69[_0x56e5('0x35')],_0x5028df[_0x56e5('0x31')]),_0x2603a4);if(_0x255b69[_0x56e5('0x35')][_0x56e5('0x3b')]){_0x3ef534[_0x56e5('0x3a')]=_['merge'](_0x3ef534[_0x56e5('0x3a')],{'$or':_[_0x56e5('0x2a')](_0x2603a4,function(_0x446d20){if(_0x446d20[_0x56e5('0x2d')]!==_0x56e5('0x3c')){var _0x2324bd={};_0x2324bd[_0x446d20['name']]={'$like':'%'+_0x255b69[_0x56e5('0x35')][_0x56e5('0x3b')]+'%'};return _0x2324bd;}})});}_0x3ef534=_[_0x56e5('0x3d')]({},_0x3ef534,_0x255b69[_0x56e5('0x3e')]);var _0x2daff3={'where':_0x3ef534[_0x56e5('0x3a')]};return db[_0x56e5('0x2b')][_0x56e5('0x20')](_0x2daff3)[_0x56e5('0x3f')](function(_0x1e9c91){_0x57651a[_0x56e5('0x20')]=_0x1e9c91;if(_0x255b69[_0x56e5('0x35')][_0x56e5('0x40')]){_0x3ef534[_0x56e5('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x56e5('0x42')](_0x3ef534);})[_0x56e5('0x3f')](function(_0x2d436b){_0x57651a['rows']=_0x2d436b;return _0x57651a;})[_0x56e5('0x3f')](respondWithFilteredResult(_0x39ef3e,_0x3ef534))[_0x56e5('0x43')](handleError(_0x39ef3e,null));};exports[_0x56e5('0x44')]=function(_0x10b241,_0x5d031f){var _0x1c3a94={'raw':!![],'where':{'id':_0x10b241[_0x56e5('0x45')]['id']}},_0x5799a5={};_0x5799a5['model']=_[_0x56e5('0x30')](db[_0x56e5('0x2b')][_0x56e5('0x46')]);_0x5799a5[_0x56e5('0x35')]=_['keys'](_0x10b241[_0x56e5('0x35')]);_0x5799a5[_0x56e5('0x31')]=_[_0x56e5('0x32')](_0x5799a5[_0x56e5('0x2f')],_0x5799a5['query']);_0x1c3a94[_0x56e5('0x33')]=_[_0x56e5('0x32')](_0x5799a5['model'],qs[_0x56e5('0x34')](_0x10b241['query'][_0x56e5('0x34')]));_0x1c3a94[_0x56e5('0x33')]=_0x1c3a94[_0x56e5('0x33')]['length']?_0x1c3a94[_0x56e5('0x33')]:_0x5799a5[_0x56e5('0x2f')];if(_0x10b241['query']['includeAll']){_0x1c3a94[_0x56e5('0x41')]=[{'all':!![]}];}_0x1c3a94=_[_0x56e5('0x3d')]({},_0x1c3a94,_0x10b241[_0x56e5('0x3e')]);return db['JscriptySessionReport'][_0x56e5('0x47')](_0x1c3a94)[_0x56e5('0x3f')](handleEntityNotFound(_0x5d031f,null))[_0x56e5('0x3f')](respondWithResult(_0x5d031f,null))[_0x56e5('0x43')](handleError(_0x5d031f,null));};exports[_0x56e5('0x48')]=function(_0x31e5d5,_0x332ed6){return db[_0x56e5('0x2b')][_0x56e5('0x48')](_0x31e5d5['body'],{})[_0x56e5('0x3f')](respondWithResult(_0x332ed6,0xc9))[_0x56e5('0x43')](handleError(_0x332ed6,null));};exports[_0x56e5('0x24')]=function(_0x381faa,_0x1ec021){if(_0x381faa[_0x56e5('0x49')]['id']){delete _0x381faa[_0x56e5('0x49')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x381faa[_0x56e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ec021,null))[_0x56e5('0x3f')](saveUpdates(_0x381faa[_0x56e5('0x49')],null))[_0x56e5('0x3f')](respondWithResult(_0x1ec021,null))[_0x56e5('0x43')](handleError(_0x1ec021,null));};exports['destroy']=function(_0x1eb9ab,_0x222ea2){return db[_0x56e5('0x2b')][_0x56e5('0x47')]({'where':{'id':_0x1eb9ab[_0x56e5('0x45')]['id']}})[_0x56e5('0x3f')](handleEntityNotFound(_0x222ea2,null))[_0x56e5('0x3f')](removeEntity(_0x222ea2,null))[_0x56e5('0x43')](handleError(_0x222ea2,null));};exports['describe']=function(_0xd8edf8,_0x46ccf0){return db[_0x56e5('0x2b')]['describe']()[_0x56e5('0x3f')](respondWithResult(_0x46ccf0,null))[_0x56e5('0x43')](handleError(_0x46ccf0,null));};exports[_0x56e5('0x4a')]=function(_0x3ce7fd,_0x3a78a5,_0x37bc52){var _0x2a89aa={'raw':!![],'where':{}};var _0x46a804={};var _0x56e510={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x56e5('0x4b')]({'where':{'id':_0x3ce7fd[_0x56e5('0x45')]['id']}})[_0x56e5('0x3f')](handleEntityNotFound(_0x3a78a5,null))[_0x56e5('0x3f')](function(_0x51a170){if(_0x51a170){_0x46a804[_0x56e5('0x2f')]=_[_0x56e5('0x30')](db[_0x56e5('0x4c')]['rawAttributes']);_0x46a804['query']=_[_0x56e5('0x30')](_0x3ce7fd[_0x56e5('0x35')]);_0x46a804[_0x56e5('0x31')]=_[_0x56e5('0x32')](_0x46a804['model'],_0x46a804['query']);_0x2a89aa[_0x56e5('0x33')]=_[_0x56e5('0x32')](_0x46a804['model'],qs[_0x56e5('0x34')](_0x3ce7fd[_0x56e5('0x35')][_0x56e5('0x34')]));_0x2a89aa[_0x56e5('0x33')]=_0x2a89aa[_0x56e5('0x33')][_0x56e5('0x36')]?_0x2a89aa[_0x56e5('0x33')]:_0x46a804[_0x56e5('0x2f')];if(!_0x3ce7fd[_0x56e5('0x35')]['hasOwnProperty'](_0x56e5('0x38'))){_0x2a89aa[_0x56e5('0x1e')]=qs[_0x56e5('0x1e')](_0x3ce7fd['query'][_0x56e5('0x1e')]);_0x2a89aa[_0x56e5('0x1d')]=qs['offset'](_0x3ce7fd[_0x56e5('0x35')][_0x56e5('0x1d')]);}_0x2a89aa[_0x56e5('0x39')]=qs[_0x56e5('0x4d')](_0x3ce7fd['query'][_0x56e5('0x4d')]);_0x2a89aa[_0x56e5('0x3a')]=qs[_0x56e5('0x31')](_['pick'](_0x3ce7fd[_0x56e5('0x35')],_0x46a804[_0x56e5('0x31')]));_0x2a89aa[_0x56e5('0x3a')][_0x56e5('0x4e')]=_0x51a170['id'];if(_0x3ce7fd[_0x56e5('0x35')][_0x56e5('0x3b')]){_0x2a89aa['where']=_[_0x56e5('0x3d')](_0x2a89aa[_0x56e5('0x3a')],{'$or':_[_0x56e5('0x2a')](_0x2a89aa['attributes'],function(_0x27d8d0){var _0x571665={};_0x571665[_0x27d8d0]={'$like':'%'+_0x3ce7fd[_0x56e5('0x35')][_0x56e5('0x3b')]+'%'};return _0x571665;})});}_0x2a89aa=_['merge']({},_0x2a89aa,_0x3ce7fd[_0x56e5('0x3e')]);return db[_0x56e5('0x4c')]['count']({'where':_0x2a89aa['where']})['then'](function(_0x44d14a){_0x56e510[_0x56e5('0x20')]=_0x44d14a;if(_0x3ce7fd[_0x56e5('0x35')]['includeAll']){_0x2a89aa['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x56e5('0x42')](_0x2a89aa);})[_0x56e5('0x3f')](function(_0x164c7c){_0x56e510[_0x56e5('0x4f')]=_0x164c7c;return _0x56e510;});}})[_0x56e5('0x3f')](respondWithFilteredResult(_0x3a78a5,_0x2a89aa))[_0x56e5('0x43')](handleError(_0x3a78a5,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 38cdbec..39cd915 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 _0xe015=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','report_jscripty_sessions'];(function(_0x4fa43c,_0xf2f8fc){var _0x5bc7ac=function(_0x158b18){while(--_0x158b18){_0x4fa43c['push'](_0x4fa43c['shift']());}};_0x5bc7ac(++_0xf2f8fc);}(_0xe015,0x13b));var _0x5e01=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe015[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('JscriptySessionReport',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['report_jscripty_sessions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport'];(function(_0x11abdf,_0x124f07){var _0x9806d9=function(_0x4132a3){while(--_0x4132a3){_0x11abdf['push'](_0x11abdf['shift']());}};_0x9806d9(++_0x124f07);}(_0x4819,0xcd));var _0x9481=function(_0x4cc198,_0x11a598){_0x4cc198=_0x4cc198-0x0;var _0x3e8858=_0x4819[_0x4cc198];return _0x3e8858;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 8fcde04..e4d37ea 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 _0x1261=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x8245c3,_0x5efc3d){var _0x3adb44=function(_0x3616d){while(--_0x3616d){_0x8245c3['push'](_0x8245c3['shift']());}};_0x3adb44(++_0x5efc3d);}(_0x1261,0x144));var _0x1126=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0x1261[_0x5a709c];return _0x719025;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x32f4=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x1a8396,_0x280126){var _0x29ce3=function(_0x2a205a){while(--_0x2a205a){_0x1a8396['push'](_0x1a8396['shift']());}};_0x29ce3(++_0x280126);}(_0x32f4,0x154));var _0x432f=function(_0x31193d,_0x220a47){_0x31193d=_0x31193d-0x0;var _0x1cb029=_0x32f4[_0x31193d];return _0x1cb029;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 2249324..d959f3c 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 _0xfa12=['exports','multer','util','path','Router','fs-extra','../../config/environment','./license.controller','get','put','isAuthenticated','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa12,0x1bd));var _0x2fa1=function(_0xb95095,_0xad32dd){_0xb95095=_0xb95095-0x0;var _0x38e16b=_0xfa12[_0xb95095];return _0x38e16b;};'use strict';var multer=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var path=require(_0x2fa1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2fa1('0x3')]();var fs_extra=require(_0x2fa1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fa1('0x5'));var controller=require(_0x2fa1('0x6'));router[_0x2fa1('0x7')]('/',controller['index']);router[_0x2fa1('0x8')]('/:id',auth[_0x2fa1('0x9')](),controller[_0x2fa1('0xa')]);module[_0x2fa1('0xb')]=router; \ No newline at end of file +var _0xc949=['./license.controller','get','index','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5a984d,_0x14b91f){var _0x44a167=function(_0x185392){while(--_0x185392){_0x5a984d['push'](_0x5a984d['shift']());}};_0x44a167(++_0x14b91f);}(_0xc949,0x181));var _0x9c94=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xc949[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',controller[_0x9c94('0x9')]);router[_0x9c94('0xa')]('/:id',auth[_0x9c94('0xb')](),controller[_0x9c94('0xc')]);module[_0x9c94('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 a799525..b310aa7 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 _0xa576=['INTEGER','sequelize','STRING'];(function(_0x5769e1,_0x57029a){var _0xa63053=function(_0x49feb1){while(--_0x49feb1){_0x5769e1['push'](_0x5769e1['shift']());}};_0xa63053(++_0x57029a);}(_0xa576,0x106));var _0x6a57=function(_0x4631f3,_0x30f039){_0x4631f3=_0x4631f3-0x0;var _0x48beb5=_0xa576[_0x4631f3];return _0x48beb5;};'use strict';var Sequelize=require(_0x6a57('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6a57('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x6a57('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ea6=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x3a7d84,_0x35498d){var _0xf335a1=function(_0x4d3e95){while(--_0x4d3e95){_0x3a7d84['push'](_0x3a7d84['shift']());}};_0xf335a1(++_0x35498d);}(_0x4ea6,0x18b));var _0x64ea=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x4ea6[_0x2a56ad];return _0x425175;};'use strict';var Sequelize=require(_0x64ea('0x0'));module[_0x64ea('0x1')]={'license':{'type':Sequelize[_0x64ea('0x2')]},'data1':{'type':Sequelize[_0x64ea('0x3')]},'data2':{'type':Sequelize[_0x64ea('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x64ea('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index c1a61fb..ddefe5d 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 _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf494,0x1c6));var _0x4f49=function(_0x2870a6,_0xd2d6e3){_0x2870a6=_0x2870a6-0x0;var _0x4114ba=_0xf494[_0x2870a6];return _0x4114ba;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file +var _0x5fc3=['mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','model','keys','License','query','intersection','attributes','fields','merge','options','getLicense','catch','body','find','params','checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x5fc3[_0x2ec2bf];return _0x2c279c;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}var utilLicense=require('../../config/license/util');exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={'raw':!![],'where':{'id':0x1}},_0x3735da={};_0x3735da[_0x35fc('0x29')]=_[_0x35fc('0x2a')](db[_0x35fc('0x2b')]['rawAttributes']);_0x3735da[_0x35fc('0x2c')]=_[_0x35fc('0x2a')](_0x645eac[_0x35fc('0x2c')]);_0x3735da['filters']=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],_0x3735da[_0x35fc('0x2c')]);_0x9f3c8a[_0x35fc('0x2e')]=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],qs[_0x35fc('0x2f')](_0x645eac[_0x35fc('0x2c')][_0x35fc('0x2f')]));_0x9f3c8a[_0x35fc('0x2e')]=_0x9f3c8a['attributes']['length']?_0x9f3c8a[_0x35fc('0x2e')]:_0x3735da['model'];_0x9f3c8a=_[_0x35fc('0x30')]({},_0x9f3c8a,_0x645eac[_0x35fc('0x31')]);return utilLicense[_0x35fc('0x32')](_0x9f3c8a)[_0x35fc('0x24')](respondWithResult(_0x383837,null))[_0x35fc('0x33')](handleError(_0x383837,null));};exports[_0x35fc('0x23')]=function(_0x4e43b4,_0x3fe193){if(_0x4e43b4[_0x35fc('0x34')]['id']){delete _0x4e43b4[_0x35fc('0x34')]['id'];}return db[_0x35fc('0x2b')][_0x35fc('0x35')]({'where':{'id':_0x4e43b4[_0x35fc('0x36')]['id']}})['then'](handleEntityNotFound(_0x3fe193,null))[_0x35fc('0x24')](function(_0x38193d){var _0x1fecdf=_0x38193d['get']({'plain':!![]});return utilLicense[_0x35fc('0x37')](_0x1fecdf,_0x4e43b4['body'][_0x35fc('0x38')]);})[_0x35fc('0x24')](function(_0x266a11){if(!_0x266a11[_0x35fc('0x39')]){return saveUpdates(_0x4e43b4['body'],null);}return _0x266a11;})['then'](respondWithResult(_0x3fe193,null))['catch'](handleError(_0x3fe193,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a73fb44..768880d 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 _0x7584=['define','License','license','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x58dfe6,_0x110bde){var _0x4933e5=function(_0xca86a5){while(--_0xca86a5){_0x58dfe6['push'](_0x58dfe6['shift']());}};_0x4933e5(++_0x110bde);}(_0x7584,0xb7));var _0x4758=function(_0x3e5457,_0x342cc){_0x3e5457=_0x3e5457-0x0;var _0x3120cc=_0x7584[_0x3e5457];return _0x3120cc;};'use strict';var _=require(_0x4758('0x0'));var util=require(_0x4758('0x1'));var logger=require(_0x4758('0x2'))(_0x4758('0x3'));var moment=require('moment');var BPromise=require(_0x4758('0x4'));var rp=require(_0x4758('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4758('0x6'));var config=require(_0x4758('0x7'));var attributes=require('./license.attributes');module[_0x4758('0x8')]=function(_0x1e187a,_0xa99191){return _0x1e187a[_0x4758('0x9')](_0x4758('0xa'),attributes,{'tableName':_0x4758('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6347=['define','license','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x28ade3,_0x3849b9){var _0x20ca87=function(_0x47515f){while(--_0x47515f){_0x28ade3['push'](_0x28ade3['shift']());}};_0x20ca87(++_0x3849b9);}(_0x6347,0x15e));var _0x7634=function(_0x44ffe8,_0x1c8534){_0x44ffe8=_0x44ffe8-0x0;var _0x5ca756=_0x6347[_0x44ffe8];return _0x5ca756;};'use strict';var _=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7634('0x2'));var BPromise=require(_0x7634('0x3'));var rp=require(_0x7634('0x4'));var fs=require('fs');var path=require(_0x7634('0x5'));var rimraf=require(_0x7634('0x6'));var config=require(_0x7634('0x7'));var attributes=require(_0x7634('0x8'));module[_0x7634('0x9')]=function(_0x8fb446,_0x10c8d7){return _0x8fb446[_0x7634('0xa')]('License',attributes,{'tableName':_0x7634('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index cff0d5a..09650ff 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 _0x29f3=['request','info','License,\x20%s,\x20%s','debug','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x433f54,_0x371b89){var _0x1010cb=function(_0x3f8d81){while(--_0x3f8d81){_0x433f54['push'](_0x433f54['shift']());}};_0x1010cb(++_0x371b89);}(_0x29f3,0x16f));var _0x329f=function(_0x259f68,_0x6f74bc){_0x259f68=_0x259f68-0x0;var _0xf005eb=_0x29f3[_0x259f68];return _0xf005eb;};'use strict';var _=require(_0x329f('0x0'));var util=require(_0x329f('0x1'));var moment=require(_0x329f('0x2'));var BPromise=require('bluebird');var rs=require(_0x329f('0x3'));var fs=require('fs');var Redis=require(_0x329f('0x4'));var db=require(_0x329f('0x5'))['db'];var utils=require(_0x329f('0x6'));var logger=require(_0x329f('0x7'))(_0x329f('0x8'));var config=require(_0x329f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x329f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468cf2,_0x375176,_0x89c6fa){return new BPromise(function(_0x21a9e0,_0x3e1908){return client[_0x329f('0xb')](_0x468cf2,_0x89c6fa)['then'](function(_0x4c5dbc){logger[_0x329f('0xc')](_0x329f('0xd'),_0x375176,'request\x20sent');logger[_0x329f('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x375176,'request\x20sent',JSON['stringify'](_0x4c5dbc));if(_0x4c5dbc[_0x329f('0xf')]){if(_0x4c5dbc['error']['code']===0x1f4){logger[_0x329f('0xf')](_0x329f('0xd'),_0x375176,_0x4c5dbc[_0x329f('0xf')]['message']);return _0x3e1908(_0x4c5dbc[_0x329f('0xf')]['message']);}logger[_0x329f('0xf')]('License,\x20%s,\x20%s',_0x375176,_0x4c5dbc[_0x329f('0xf')][_0x329f('0x10')]);return _0x21a9e0(_0x4c5dbc[_0x329f('0xf')]['message']);}else{logger[_0x329f('0xc')](_0x329f('0xd'),_0x375176,'request\x20sent');_0x21a9e0(_0x4c5dbc[_0x329f('0x11')][_0x329f('0x10')]);}})['catch'](function(_0x9ded0){logger[_0x329f('0xf')](_0x329f('0xd'),_0x375176,_0x9ded0);_0x3e1908(_0x9ded0);});});} \ No newline at end of file +var _0x7f5c=['http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x7f5c,0x19c));var _0xc7f5=function(_0x59db67,_0x1d9a35){_0x59db67=_0x59db67-0x0;var _0x4dbc65=_0x7f5c[_0x59db67];return _0x4dbc65;};'use strict';var _=require(_0xc7f5('0x0'));var util=require(_0xc7f5('0x1'));var moment=require(_0xc7f5('0x2'));var BPromise=require(_0xc7f5('0x3'));var rs=require(_0xc7f5('0x4'));var fs=require('fs');var Redis=require(_0xc7f5('0x5'));var db=require(_0xc7f5('0x6'))['db'];var utils=require(_0xc7f5('0x7'));var logger=require(_0xc7f5('0x8'))(_0xc7f5('0x9'));var config=require(_0xc7f5('0xa'));var jayson=require(_0xc7f5('0xb'));var client=jayson[_0xc7f5('0xc')][_0xc7f5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x416460,_0x4a9ee4,_0x324dc7){return new BPromise(function(_0x15d2df,_0x2b0662){return client[_0xc7f5('0xe')](_0x416460,_0x324dc7)[_0xc7f5('0xf')](function(_0x2fa8fd){logger[_0xc7f5('0x10')](_0xc7f5('0x11'),_0x4a9ee4,_0xc7f5('0x12'));logger[_0xc7f5('0x13')](_0xc7f5('0x14'),_0x4a9ee4,_0xc7f5('0x12'),JSON['stringify'](_0x2fa8fd));if(_0x2fa8fd[_0xc7f5('0x15')]){if(_0x2fa8fd[_0xc7f5('0x15')][_0xc7f5('0x16')]===0x1f4){logger[_0xc7f5('0x15')](_0xc7f5('0x11'),_0x4a9ee4,_0x2fa8fd[_0xc7f5('0x15')][_0xc7f5('0x17')]);return _0x2b0662(_0x2fa8fd['error']['message']);}logger[_0xc7f5('0x15')](_0xc7f5('0x11'),_0x4a9ee4,_0x2fa8fd[_0xc7f5('0x15')][_0xc7f5('0x17')]);return _0x15d2df(_0x2fa8fd[_0xc7f5('0x15')]['message']);}else{logger[_0xc7f5('0x10')](_0xc7f5('0x11'),_0x4a9ee4,_0xc7f5('0x12'));_0x15d2df(_0x2fa8fd['result']['message']);}})[_0xc7f5('0x18')](function(_0x43553c){logger[_0xc7f5('0x15')](_0xc7f5('0x11'),_0x4a9ee4,_0x43553c);_0x2b0662(_0x43553c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index ada74d0..c9669b9 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 _0xcfbc=['show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','delete','removeSmtp','removeAgents','exports','util','path','express','Router','fs-extra','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x59855f,_0x48b8a7){var _0x3d2d25=function(_0x5a053c){while(--_0x5a053c){_0x59855f['push'](_0x59855f['shift']());}};_0x3d2d25(++_0x48b8a7);}(_0xcfbc,0x75));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xccfb('0x0'));var path=require(_0xccfb('0x1'));var timeout=require('connect-timeout');var express=require(_0xccfb('0x2'));var router=express[_0xccfb('0x3')]();var fs_extra=require(_0xccfb('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xccfb('0x5'));var controller=require(_0xccfb('0x6'));router[_0xccfb('0x7')]('/',auth[_0xccfb('0x8')](),controller[_0xccfb('0x9')]);router[_0xccfb('0x7')](_0xccfb('0xa'),auth[_0xccfb('0x8')](),controller['describe']);router[_0xccfb('0x7')](_0xccfb('0xb'),auth[_0xccfb('0x8')](),controller[_0xccfb('0xc')]);router[_0xccfb('0x7')]('/:id/dispositions',auth[_0xccfb('0x8')](),controller['getDispositions']);router[_0xccfb('0x7')](_0xccfb('0xd'),auth[_0xccfb('0x8')](),controller[_0xccfb('0xe')]);router[_0xccfb('0x7')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x10')]);router[_0xccfb('0x7')](_0xccfb('0x11'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x12')]);router['get'](_0xccfb('0x13'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x14')]);router[_0xccfb('0x7')](_0xccfb('0x15'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x16')]);router[_0xccfb('0x7')]('/:id/messages',auth[_0xccfb('0x8')](),controller[_0xccfb('0x17')]);router[_0xccfb('0x7')]('/:id/verify',auth[_0xccfb('0x8')](),controller[_0xccfb('0x18')]);router['get'](_0xccfb('0x19'),auth['isAuthenticated'](),controller[_0xccfb('0x1a')]);router[_0xccfb('0x1b')](_0xccfb('0x1c'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x1d')]);router[_0xccfb('0x1b')](_0xccfb('0xd'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x1e')]);router[_0xccfb('0x1b')]('/',auth[_0xccfb('0x8')](),controller[_0xccfb('0x1f')]);router[_0xccfb('0x1b')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x20')]);router[_0xccfb('0x1b')](_0xccfb('0x11'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x21')]);router[_0xccfb('0x1b')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xccfb('0x22')]);router['post'](_0xccfb('0x15'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x23')]);router[_0xccfb('0x1b')]('/:id/send',auth[_0xccfb('0x8')](),controller[_0xccfb('0x24')]);router[_0xccfb('0x1b')](_0xccfb('0x19'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x25')]);router[_0xccfb('0x26')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xccfb('0x27')](_0xccfb('0x1c'),auth[_0xccfb('0x8')](),controller['removeDispositions']);router[_0xccfb('0x27')](_0xccfb('0xd'),auth[_0xccfb('0x8')](),controller['removeAnswers']);router[_0xccfb('0x27')](_0xccfb('0xf'),auth[_0xccfb('0x8')](),controller['removeImap']);router[_0xccfb('0x27')](_0xccfb('0x11'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x28')]);router['delete'](_0xccfb('0xb'),auth[_0xccfb('0x8')](),controller['destroy']);router['delete'](_0xccfb('0x19'),auth[_0xccfb('0x8')](),controller[_0xccfb('0x29')]);module[_0xccfb('0x2a')]=router; \ No newline at end of file +var _0xf9c6=['getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getMessages','/:id/verify','post','/:id/dispositions','addDisposition','addAnswer','/:id/in_servers','addImap','addSmtp','addApplications','/:id/send','send','/:id/users','addAgents','put','delete','removeImap','removeSmtp','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0xe033e7,_0x561a6d){var _0x63031f=function(_0x246e1f){while(--_0x246e1f){_0xe033e7['push'](_0xe033e7['shift']());}};_0x63031f(++_0x561a6d);}(_0xf9c6,0x118));var _0x6f9c=function(_0x139bde,_0x9ded43){_0x139bde=_0x139bde-0x0;var _0x5bd03e=_0xf9c6[_0x139bde];return _0x5bd03e;};'use strict';var multer=require(_0x6f9c('0x0'));var util=require('util');var path=require(_0x6f9c('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f9c('0x2'));var router=express[_0x6f9c('0x3')]();var fs_extra=require(_0x6f9c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6f9c('0x5'));var config=require(_0x6f9c('0x6'));var controller=require('./mailAccount.controller');router[_0x6f9c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f9c('0x8')]);router['get'](_0x6f9c('0x9'),auth[_0x6f9c('0xa')](),controller[_0x6f9c('0xb')]);router[_0x6f9c('0x7')](_0x6f9c('0xc'),auth['isAuthenticated'](),controller[_0x6f9c('0xd')]);router[_0x6f9c('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6f9c('0xe')]);router[_0x6f9c('0x7')](_0x6f9c('0xf'),auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x10')]);router[_0x6f9c('0x7')]('/:id/in_servers',auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x11')]);router['get'](_0x6f9c('0x12'),auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x13')]);router['get'](_0x6f9c('0x14'),auth['isAuthenticated'](),controller[_0x6f9c('0x15')]);router['get']('/:id/applications',auth[_0x6f9c('0xa')](),controller['getApplications']);router[_0x6f9c('0x7')]('/:id/messages',auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x16')]);router[_0x6f9c('0x7')](_0x6f9c('0x17'),auth[_0x6f9c('0xa')](),controller['verifySmtp']);router['get']('/:id/users',auth[_0x6f9c('0xa')](),controller['getAgents']);router[_0x6f9c('0x18')](_0x6f9c('0x19'),auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x1a')]);router[_0x6f9c('0x18')](_0x6f9c('0xf'),auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x1b')]);router[_0x6f9c('0x18')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6f9c('0x1c'),auth['isAuthenticated'](),controller[_0x6f9c('0x1d')]);router[_0x6f9c('0x18')]('/:id/out_servers',auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x1e')]);router[_0x6f9c('0x18')](_0x6f9c('0x14'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x6f9c('0x18')]('/:id/applications',auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x1f')]);router[_0x6f9c('0x18')](_0x6f9c('0x20'),auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x21')]);router[_0x6f9c('0x18')](_0x6f9c('0x22'),auth['isAuthenticated'](),controller[_0x6f9c('0x23')]);router[_0x6f9c('0x24')]('/:id',auth[_0x6f9c('0xa')](),controller['update']);router[_0x6f9c('0x25')]('/:id/dispositions',auth[_0x6f9c('0xa')](),controller['removeDispositions']);router[_0x6f9c('0x25')](_0x6f9c('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x6f9c('0x25')]('/:id/in_servers',auth[_0x6f9c('0xa')](),controller[_0x6f9c('0x26')]);router[_0x6f9c('0x25')](_0x6f9c('0x12'),auth['isAuthenticated'](),controller[_0x6f9c('0x27')]);router[_0x6f9c('0x25')](_0x6f9c('0xc'),auth[_0x6f9c('0xa')](),controller['destroy']);router[_0x6f9c('0x25')](_0x6f9c('0x22'),auth['isAuthenticated'](),controller[_0x6f9c('0x28')]);module[_0x6f9c('0x29')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 158f313..f56a99b 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 _0xf987=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x6080d0,_0x2b9b56){var _0x45cdce=function(_0x426818){while(--_0x426818){_0x6080d0['push'](_0x6080d0['shift']());}};_0x45cdce(++_0x2b9b56);}(_0xf987,0x18a));var _0x7f98=function(_0x2331b3,_0xb26fd1){_0x2331b3=_0x2331b3-0x0;var _0x3e5b15=_0xf987[_0x2331b3];return _0x3e5b15;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7f98('0x0')]},'name':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7f98('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x7f98('0x2')]},'markAsUnread':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7f98('0x0')],'allowNull':![],'defaultValue':_0x7f98('0x3')},'fontSize':{'type':Sequelize[_0x7f98('0x4')](0x2)[_0x7f98('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7f98('0x2')],'defaultValue':function(){return _0x7f98('0x6');}},'notificationSound':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f98('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f98('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f98('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x7f98('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b425d){if(!_0x2b425d)this[_0x7f98('0x8')](_0x7f98('0x9'),null);this[_0x7f98('0x8')]('mandatoryDisposition',_0x2b425d);}}}; \ No newline at end of file +var _0xeedf=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x2bd4d9,_0x53b8f1){var _0x5aa078=function(_0x1f9fa3){while(--_0x1f9fa3){_0x2bd4d9['push'](_0x2bd4d9['shift']());}};_0x5aa078(++_0x53b8f1);}(_0xeedf,0x12c));var _0xfeed=function(_0x58aa37,_0x262b5c){_0x58aa37=_0x58aa37-0x0;var _0x41b164=_0xeedf[_0x58aa37];return _0x41b164;};'use strict';var Sequelize=require(_0xfeed('0x0'));module[_0xfeed('0x1')]={'description':{'type':Sequelize[_0xfeed('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xfeed('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xfeed('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xfeed('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xfeed('0x4')]},'markAsUnread':{'type':Sequelize[_0xfeed('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfeed('0x5')},'fontSize':{'type':Sequelize[_0xfeed('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xfeed('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xfeed('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfeed('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfeed('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfeed('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xfeed('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xfeed('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1e39c8){if(!_0x1e39c8)this[_0xfeed('0x8')](_0xfeed('0x9'),null);this[_0xfeed('0x8')]('mandatoryDisposition',_0x1e39c8);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2f4eb56..0ab25b7 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 _0x220b=['papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','jayson/promise','http','request','then','info','request\x20sent','stringify','error','MailAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','send','index','MailServerIn','Imap','Smtp','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','show','params','MailServerOut','Pause','rawAttributes','find','mandatoryDispositionPause','body','describe','addDisposition','MailAccountId','Disposition','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','findOne','removeAnswers','name','key','email','ListId','active','description','cservice','cauthentication','user','password','pass','authentication','host','port','service','cuser','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','setSmtp','MailInteraction','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','priority','getApplications','$gte','split','format','MailMessage','inlineCss','CmList','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','secure','List\x20not\x20found','List','Contacts','defaults','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','auth','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','squel','crypto','jsforce','desk.js'];(function(_0x5347e3,_0x20d2be){var _0x227474=function(_0xd43102){while(--_0xd43102){_0x5347e3['push'](_0x5347e3['shift']());}};_0x227474(++_0x20d2be);}(_0x220b,0xad));var _0xb220=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x220b[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0xb220('0x0'));var rimraf=require(_0xb220('0x1'));var zipdir=require(_0xb220('0x2'));var jsonpatch=require(_0xb220('0x3'));var rp=require(_0xb220('0x4'));var moment=require(_0xb220('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb220('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb220('0x7'));var csv=require(_0xb220('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb220('0x9'));var crypto=require(_0xb220('0xa'));var jsforce=require(_0xb220('0xb'));var deskjs=require(_0xb220('0xc'));var toCsv=require(_0xb220('0x8'));var querystring=require('querystring');var Papa=require(_0xb220('0xd'));var htmlToText=require(_0xb220('0xe'));var juice=require('juice');var Redis=require(_0xb220('0xf'));var authService=require(_0xb220('0x10'));var qs=require(_0xb220('0x11'));var as=require(_0xb220('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb220('0x13'));var utils=require(_0xb220('0x14'));var config=require(_0xb220('0x15'));var licenseUtil=require(_0xb220('0x16'));var db=require(_0xb220('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb220('0x18'))(new Redis(config[_0xb220('0x19')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xb220('0x1a'));var client=jayson['client'][_0xb220('0x1b')]({'port':0x232b});function respondWithRpcPromise(_0x282981,_0x27ecd5,_0x51e550,_0x47d70b){return new BPromise(function(_0x5cb5bc,_0x38ac2b){var _0x56b168=_0x47d70b||client;return _0x56b168[_0xb220('0x1c')](_0x282981,_0x51e550)[_0xb220('0x1d')](function(_0x2ecc79){logger[_0xb220('0x1e')]('MailAccount,\x20%s,\x20%s',_0x27ecd5,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x27ecd5,_0xb220('0x1f'),JSON[_0xb220('0x20')](_0x2ecc79));if(_0x2ecc79['error']){if(_0x2ecc79[_0xb220('0x21')]['code']===0x1f4){logger[_0xb220('0x21')](_0xb220('0x22'),_0x27ecd5,_0x2ecc79[_0xb220('0x21')][_0xb220('0x23')]);return _0x38ac2b(_0x2ecc79[_0xb220('0x21')]['message']);}logger['error'](_0xb220('0x22'),_0x27ecd5,_0x2ecc79['error']['message']);return _0x5cb5bc(_0x2ecc79[_0xb220('0x21')][_0xb220('0x23')]);}else{logger[_0xb220('0x1e')](_0xb220('0x22'),_0x27ecd5,_0xb220('0x1f'));_0x5cb5bc(_0x2ecc79['result'][_0xb220('0x23')]);}})[_0xb220('0x24')](function(_0x3a2312){logger[_0xb220('0x21')]('MailAccount,\x20%s,\x20%s',_0x27ecd5,_0x3a2312);_0x38ac2b(_0x3a2312);});});}function respondWithStatusCode(_0x1ee855,_0x4c7e9b){_0x4c7e9b=_0x4c7e9b||0xcc;return function(_0x3e9107){if(_0x3e9107){return _0x1ee855[_0xb220('0x25')](_0x4c7e9b);}return _0x1ee855[_0xb220('0x26')](_0x4c7e9b)[_0xb220('0x27')]();};}function respondWithResult(_0x185c4b,_0x64714e){_0x64714e=_0x64714e||0xc8;return function(_0x2d9d61){if(_0x2d9d61){return _0x185c4b[_0xb220('0x26')](_0x64714e)[_0xb220('0x28')](_0x2d9d61);}};}function respondWithFilteredResult(_0xb0fc1,_0x51e1ac){return function(_0x35f330){if(_0x35f330){var _0x2c9195=typeof _0x51e1ac[_0xb220('0x29')]===_0xb220('0x2a')&&typeof _0x51e1ac[_0xb220('0x2b')]==='undefined';var _0x37bd8c=_0x35f330[_0xb220('0x2c')];var _0x2f285c=_0x2c9195?0x0:_0x51e1ac[_0xb220('0x29')];var _0xa74712=_0x2c9195?_0x35f330[_0xb220('0x2c')]:_0x51e1ac[_0xb220('0x29')]+_0x51e1ac[_0xb220('0x2b')];var _0x7fa12f;if(_0xa74712>=_0x37bd8c){_0xa74712=_0x37bd8c;_0x7fa12f=0xc8;}else{_0x7fa12f=0xce;}_0xb0fc1['status'](_0x7fa12f);return _0xb0fc1['set'](_0xb220('0x2d'),_0x2f285c+'-'+_0xa74712+'/'+_0x37bd8c)[_0xb220('0x28')](_0x35f330);}return null;};}function patchUpdates(_0x112a83){return function(_0xbe6e6){try{jsonpatch[_0xb220('0x2e')](_0xbe6e6,_0x112a83,!![]);}catch(_0x444f79){return BPromise[_0xb220('0x2f')](_0x444f79);}return _0xbe6e6[_0xb220('0x30')]();};}function saveUpdates(_0x2d7746,_0x5da3d8){return function(_0x51fc9a){if(_0x51fc9a){return _0x51fc9a[_0xb220('0x31')](_0x2d7746)[_0xb220('0x1d')](function(_0x32fce2){return _0x32fce2;});}return null;};}function removeEntity(_0x1e8c4f,_0x4a1d90){return function(_0x710270){if(_0x710270){return _0x710270[_0xb220('0x32')]()[_0xb220('0x1d')](function(){var _0x11ecaa=_0x710270[_0xb220('0x33')]({'plain':!![]});var _0x35da90=_0xb220('0x34');return db[_0xb220('0x35')][_0xb220('0x32')]({'where':{'type':_0x35da90,'resourceId':_0x11ecaa['id']}})[_0xb220('0x1d')](function(){return _0x710270;});})[_0xb220('0x1d')](function(){_0x1e8c4f[_0xb220('0x26')](0xcc)[_0xb220('0x27')]();});}};}function handleEntityNotFound(_0x565eca,_0x3ef812){return function(_0x1e7703){if(!_0x1e7703){_0x565eca['sendStatus'](0x194);}return _0x1e7703;};}function handleError(_0x3b3daa,_0x5391cd){_0x5391cd=_0x5391cd||0x1f4;return function(_0x256002){logger['error'](_0x256002[_0xb220('0x36')]);if(_0x256002['name']){delete _0x256002['name'];}_0x3b3daa['status'](_0x5391cd)[_0xb220('0x37')](_0x256002);};}exports[_0xb220('0x38')]=function(_0x2a3a54,_0x5c927f){var _0x5d5fab={'include':[{'model':db[_0xb220('0x39')],'as':_0xb220('0x3a')},{'model':db['MailServerOut'],'as':_0xb220('0x3b')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x18bc83={},_0x454b68={'count':0x0,'rows':[]};var _0x5e0441=_[_0xb220('0x3c')](db['MailAccount']['rawAttributes'],function(_0x5442f4){return{'name':_0x5442f4['fieldName'],'type':_0x5442f4[_0xb220('0x3d')]['key']};});_0x18bc83[_0xb220('0x3e')]=_['map'](_0x5e0441,'name');_0x18bc83[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x2a3a54[_0xb220('0x3f')]);_0x18bc83[_0xb220('0x41')]=_[_0xb220('0x42')](_0x18bc83['model'],_0x18bc83[_0xb220('0x3f')]);_0x5d5fab[_0xb220('0x43')]=_[_0xb220('0x42')](_0x18bc83['model'],qs[_0xb220('0x44')](_0x2a3a54[_0xb220('0x3f')][_0xb220('0x44')]));_0x5d5fab['attributes']=_0x5d5fab[_0xb220('0x43')][_0xb220('0x45')]?_0x5d5fab[_0xb220('0x43')]:_0x18bc83['model'];if(!_0x2a3a54[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0x5d5fab['limit']=qs[_0xb220('0x2b')](_0x2a3a54[_0xb220('0x3f')][_0xb220('0x2b')]);_0x5d5fab[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x2a3a54['query'][_0xb220('0x29')]);}_0x5d5fab[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x2a3a54[_0xb220('0x3f')][_0xb220('0x49')]);_0x5d5fab[_0xb220('0x4a')]=qs[_0xb220('0x41')](_['pick'](_0x2a3a54[_0xb220('0x3f')],_0x18bc83[_0xb220('0x41')]),_0x5e0441);if(_0x2a3a54[_0xb220('0x3f')][_0xb220('0x4b')]){_0x5d5fab[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x5d5fab[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x5e0441,function(_0x57753a){if(_0x57753a[_0xb220('0x3d')]!==_0xb220('0x4d')){var _0x4aa2e2={};_0x4aa2e2[_0x57753a['name']]={'$like':'%'+_0x2a3a54[_0xb220('0x3f')]['filter']+'%'};return _0x4aa2e2;}})});}_0x5d5fab=_['merge']({},_0x5d5fab,_0x2a3a54[_0xb220('0x4e')]);var _0x5c1202={'where':_0x5d5fab[_0xb220('0x4a')]};return db[_0xb220('0x4f')][_0xb220('0x2c')](_0x5c1202)['then'](function(_0x258e79){_0x454b68[_0xb220('0x2c')]=_0x258e79;if(_0x2a3a54[_0xb220('0x3f')][_0xb220('0x50')]){_0x5d5fab[_0xb220('0x51')]=[{'all':!![]}];}return db[_0xb220('0x4f')][_0xb220('0x52')](_0x5d5fab);})[_0xb220('0x1d')](function(_0x379545){_0x454b68['rows']=_0x379545;return _0x454b68;})[_0xb220('0x1d')](respondWithFilteredResult(_0x5c927f,_0x5d5fab))['catch'](handleError(_0x5c927f,null));};exports[_0xb220('0x53')]=function(_0x43ac95,_0x7b6983){var _0x2c7b4f={'raw':![],'where':{'id':_0x43ac95[_0xb220('0x54')]['id']},'include':[{'model':db[_0xb220('0x39')],'as':'Imap'},{'model':db[_0xb220('0x55')],'as':'Smtp'},{'model':db[_0xb220('0x56')],'as':'mandatoryDispositionPause'}]},_0x3ae611={};_0x3ae611[_0xb220('0x3e')]=_[_0xb220('0x40')](db['MailAccount'][_0xb220('0x57')]);_0x3ae611[_0xb220('0x3f')]=_['keys'](_0x43ac95['query']);_0x3ae611[_0xb220('0x41')]=_[_0xb220('0x42')](_0x3ae611[_0xb220('0x3e')],_0x3ae611['query']);_0x2c7b4f[_0xb220('0x43')]=_[_0xb220('0x42')](_0x3ae611['model'],qs[_0xb220('0x44')](_0x43ac95[_0xb220('0x3f')][_0xb220('0x44')]));_0x2c7b4f[_0xb220('0x43')]=_0x2c7b4f['attributes'][_0xb220('0x45')]?_0x2c7b4f[_0xb220('0x43')]:_0x3ae611[_0xb220('0x3e')];if(_0x43ac95[_0xb220('0x3f')][_0xb220('0x50')]){_0x2c7b4f[_0xb220('0x51')]=[{'all':!![]}];}_0x2c7b4f=_[_0xb220('0x4c')]({},_0x2c7b4f,_0x43ac95[_0xb220('0x4e')]);return db[_0xb220('0x4f')]['find'](_0x2c7b4f)[_0xb220('0x1d')](handleEntityNotFound(_0x7b6983,null))[_0xb220('0x1d')](respondWithResult(_0x7b6983,null))['catch'](handleError(_0x7b6983,null));};exports[_0xb220('0x31')]=function(_0x1ec7f5,_0x5ebf18){if(_0x1ec7f5['body']['id']){delete _0x1ec7f5['body']['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x1ec7f5[_0xb220('0x54')]['id']},'include':[{'model':db[_0xb220('0x39')],'as':'Imap'},{'model':db[_0xb220('0x55')],'as':_0xb220('0x3b')},{'model':db['Pause'],'as':_0xb220('0x59')}]})['then'](handleEntityNotFound(_0x5ebf18,null))[_0xb220('0x1d')](saveUpdates(_0x1ec7f5['body'],null))[_0xb220('0x1d')](function(_0x1e30df){if(_0x1e30df&&_0x1ec7f5['body']['Imap']){return db['MailServerIn'][_0xb220('0x31')](_0x1ec7f5[_0xb220('0x5a')][_0xb220('0x3a')],{'where':{'MailAccountId':_0x1e30df['id']}})[_0xb220('0x1d')](function(){return _0x1e30df;});}return _0x1e30df;})[_0xb220('0x1d')](function(_0x388f16){if(_0x388f16&&_0x1ec7f5['body'][_0xb220('0x3b')]){return db['MailServerOut'][_0xb220('0x31')](_0x1ec7f5[_0xb220('0x5a')][_0xb220('0x3b')],{'where':{'MailAccountId':_0x388f16['id']}})['then'](function(){return _0x388f16;});}return _0x388f16;})[_0xb220('0x1d')](respondWithResult(_0x5ebf18,null))[_0xb220('0x24')](handleError(_0x5ebf18,null));};exports[_0xb220('0x5b')]=function(_0x23766b,_0x288125){return db[_0xb220('0x4f')][_0xb220('0x5b')]()[_0xb220('0x1d')](respondWithResult(_0x288125,null))[_0xb220('0x24')](handleError(_0x288125,null));};exports[_0xb220('0x5c')]=function(_0x11f755,_0x1e9b24,_0x4256f6){if(_0x11f755['body']['id']){delete _0x11f755[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')]['find']({'where':{'id':_0x11f755[_0xb220('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e9b24,null))[_0xb220('0x1d')](function(_0x1f6161){if(_0x1f6161){_0x11f755[_0xb220('0x5a')][_0xb220('0x5d')]=_0x1f6161['id'];return db[_0xb220('0x5e')]['create'](_0x11f755[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x1e9b24,null))[_0xb220('0x24')](handleError(_0x1e9b24,null));};exports['getDispositions']=function(_0x1988dc,_0x40dc2a,_0x6c6d72){var _0x13a6bf={'raw':![],'where':{}};var _0x54727a={};var _0x1706dc={'count':0x0,'rows':[]};return db[_0xb220('0x4f')]['findOne']({'where':{'id':_0x1988dc[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x40dc2a,null))['then'](function(_0x171b6b){if(_0x171b6b){_0x54727a[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x5e')][_0xb220('0x57')]);_0x54727a['query']=_[_0xb220('0x40')](_0x1988dc[_0xb220('0x3f')]);_0x54727a[_0xb220('0x41')]=_['intersection'](_0x54727a[_0xb220('0x3e')],_0x54727a[_0xb220('0x3f')]);_0x13a6bf[_0xb220('0x43')]=_[_0xb220('0x42')](_0x54727a['model'],qs['fields'](_0x1988dc['query'][_0xb220('0x44')]));_0x13a6bf[_0xb220('0x43')]=_0x13a6bf['attributes'][_0xb220('0x45')]?_0x13a6bf[_0xb220('0x43')]:_0x54727a[_0xb220('0x3e')];if(!_0x1988dc[_0xb220('0x3f')]['hasOwnProperty']('nolimit')){_0x13a6bf[_0xb220('0x2b')]=qs['limit'](_0x1988dc[_0xb220('0x3f')][_0xb220('0x2b')]);_0x13a6bf[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x1988dc[_0xb220('0x3f')]['offset']);}_0x13a6bf[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x1988dc['query']['sort']);_0x13a6bf[_0xb220('0x4a')]=qs[_0xb220('0x41')](_[_0xb220('0x5f')](_0x1988dc[_0xb220('0x3f')],_0x54727a[_0xb220('0x41')]));_0x13a6bf[_0xb220('0x4a')][_0xb220('0x5d')]=_0x171b6b['id'];if(_0x1988dc['query']['filter']){_0x13a6bf[_0xb220('0x4a')]=_['merge'](_0x13a6bf[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x13a6bf[_0xb220('0x43')],function(_0x9bf8af){var _0x37f61e={};_0x37f61e[_0x9bf8af]={'$like':'%'+_0x1988dc[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x37f61e;})});}_0x13a6bf=_[_0xb220('0x4c')]({},_0x13a6bf,_0x1988dc[_0xb220('0x4e')]);return db[_0xb220('0x5e')][_0xb220('0x2c')]({'where':_0x13a6bf[_0xb220('0x4a')]})[_0xb220('0x1d')](function(_0x4f5276){_0x1706dc[_0xb220('0x2c')]=_0x4f5276;if(_0x1988dc[_0xb220('0x3f')][_0xb220('0x50')]){_0x13a6bf[_0xb220('0x51')]=[{'all':!![]}];}return db[_0xb220('0x5e')]['findAll'](_0x13a6bf);})[_0xb220('0x1d')](function(_0x3f74e0){_0x1706dc[_0xb220('0x60')]=_0x3f74e0;return _0x1706dc;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x40dc2a,_0x13a6bf))[_0xb220('0x24')](handleError(_0x40dc2a,null));};exports[_0xb220('0x61')]=function(_0x2c0e21,_0x4f6a54,_0x1fb187){return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x2c0e21['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x4f6a54,null))[_0xb220('0x1d')](function(_0x49d8ff){if(_0x49d8ff){return _0x49d8ff[_0xb220('0x61')](_0x2c0e21[_0xb220('0x3f')][_0xb220('0x62')]);}})['then'](respondWithStatusCode(_0x4f6a54,null))[_0xb220('0x24')](handleError(_0x4f6a54,null));};exports[_0xb220('0x63')]=function(_0x3b2e12,_0x5be81b,_0x1677b5){if(_0x3b2e12[_0xb220('0x5a')]['id']){delete _0x3b2e12[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x3b2e12[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x5be81b,null))[_0xb220('0x1d')](function(_0x14e4f7){if(_0x14e4f7){_0x3b2e12[_0xb220('0x5a')][_0xb220('0x5d')]=_0x14e4f7['id'];return db[_0xb220('0x64')][_0xb220('0x65')](_0x3b2e12[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x5be81b,null))[_0xb220('0x24')](handleError(_0x5be81b,null));};exports[_0xb220('0x66')]=function(_0x2e762c,_0x33b28d,_0x2f1aed){var _0xad42d={'raw':![],'where':{}};var _0x16e0c2={};var _0x5c0c25={'count':0x0,'rows':[]};return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x2e762c['params']['id']}})['then'](handleEntityNotFound(_0x33b28d,null))[_0xb220('0x1d')](function(_0x372a63){if(_0x372a63){_0x16e0c2[_0xb220('0x3e')]=_[_0xb220('0x40')](db['CannedAnswer'][_0xb220('0x57')]);_0x16e0c2[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x2e762c['query']);_0x16e0c2[_0xb220('0x41')]=_[_0xb220('0x42')](_0x16e0c2[_0xb220('0x3e')],_0x16e0c2[_0xb220('0x3f')]);_0xad42d[_0xb220('0x43')]=_[_0xb220('0x42')](_0x16e0c2[_0xb220('0x3e')],qs[_0xb220('0x44')](_0x2e762c['query'][_0xb220('0x44')]));_0xad42d[_0xb220('0x43')]=_0xad42d[_0xb220('0x43')]['length']?_0xad42d[_0xb220('0x43')]:_0x16e0c2['model'];if(!_0x2e762c[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0xad42d[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x2e762c[_0xb220('0x3f')][_0xb220('0x2b')]);_0xad42d[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x2e762c[_0xb220('0x3f')][_0xb220('0x29')]);}_0xad42d[_0xb220('0x48')]=qs['sort'](_0x2e762c['query']['sort']);_0xad42d[_0xb220('0x4a')]=qs['filters'](_[_0xb220('0x5f')](_0x2e762c[_0xb220('0x3f')],_0x16e0c2[_0xb220('0x41')]));_0xad42d['where'][_0xb220('0x5d')]=_0x372a63['id'];if(_0x2e762c[_0xb220('0x3f')][_0xb220('0x4b')]){_0xad42d[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0xad42d[_0xb220('0x4a')],{'$or':_['map'](_0xad42d[_0xb220('0x43')],function(_0x466a2b){var _0x2c66fb={};_0x2c66fb[_0x466a2b]={'$like':'%'+_0x2e762c[_0xb220('0x3f')]['filter']+'%'};return _0x2c66fb;})});}_0xad42d=_[_0xb220('0x4c')]({},_0xad42d,_0x2e762c[_0xb220('0x4e')]);return db['CannedAnswer'][_0xb220('0x2c')]({'where':_0xad42d[_0xb220('0x4a')]})[_0xb220('0x1d')](function(_0x3c77f0){_0x5c0c25[_0xb220('0x2c')]=_0x3c77f0;if(_0x2e762c[_0xb220('0x3f')][_0xb220('0x50')]){_0xad42d[_0xb220('0x51')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xad42d);})[_0xb220('0x1d')](function(_0x212f33){_0x5c0c25['rows']=_0x212f33;return _0x5c0c25;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x33b28d,_0xad42d))[_0xb220('0x24')](handleError(_0x33b28d,null));};exports[_0xb220('0x68')]=function(_0x572251,_0x305e9c,_0x23a5e6){return db['MailAccount'][_0xb220('0x58')]({'where':{'id':_0x572251[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x305e9c,null))[_0xb220('0x1d')](function(_0x53ce85){if(_0x53ce85){return _0x53ce85[_0xb220('0x68')](_0x572251[_0xb220('0x3f')][_0xb220('0x62')]);}})[_0xb220('0x1d')](respondWithStatusCode(_0x305e9c,null))[_0xb220('0x24')](handleError(_0x305e9c,null));};exports[_0xb220('0x65')]=function(_0x580650,_0x445a81){var _0xff055b={'name':_0x580650[_0xb220('0x5a')][_0xb220('0x69')],'key':_0x580650['body'][_0xb220('0x6a')],'email':_0x580650['body'][_0xb220('0x6b')],'ListId':_0x580650[_0xb220('0x5a')][_0xb220('0x6c')],'active':!_['isNil'](_0x580650[_0xb220('0x5a')]['active'])?_0x580650['body'][_0xb220('0x6d')]:!![],'description':_0x580650[_0xb220('0x5a')][_0xb220('0x6e')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x580650[_0xb220('0x5a')][_0xb220('0x6f')])){if(_0x580650[_0xb220('0x5a')][_0xb220('0x70')]){_0xff055b['Imap'][_0xb220('0x71')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x71')]=_0x580650['body']['cuser'];_0xff055b['Imap'][_0xb220('0x72')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x73')]=_0x580650[_0xb220('0x5a')]['cpassword'];}else{_0xff055b[_0xb220('0x3a')][_0xb220('0x74')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x74')]=![];}_0xff055b[_0xb220('0x3a')][_0xb220('0x75')]=_0x580650['body'][_0xb220('0x3a')][_0xb220('0x75')];_0xff055b[_0xb220('0x3a')][_0xb220('0x76')]=_0x580650['body'][_0xb220('0x3a')]['port'];_0xff055b[_0xb220('0x3b')][_0xb220('0x75')]=_0x580650[_0xb220('0x5a')][_0xb220('0x3b')][_0xb220('0x75')];_0xff055b['Smtp'][_0xb220('0x76')]=_0x580650[_0xb220('0x5a')][_0xb220('0x3b')][_0xb220('0x76')];}else{_0xff055b['Imap'][_0xb220('0x77')]=_0xff055b[_0xb220('0x3b')][_0xb220('0x77')]=_0x580650[_0xb220('0x5a')][_0xb220('0x6f')];_0xff055b[_0xb220('0x3a')]['user']=_0xff055b['Smtp'][_0xb220('0x71')]=_0x580650['body'][_0xb220('0x78')];_0xff055b['Imap']['password']=_0xff055b[_0xb220('0x3b')][_0xb220('0x73')]=_0x580650['body'][_0xb220('0x79')];}return db['MailAccount'][_0xb220('0x65')](_0xff055b,{'include':[{'model':db[_0xb220('0x55')],'as':_0xb220('0x3b')},{'model':db[_0xb220('0x39')],'as':_0xb220('0x3a')}]})[_0xb220('0x1d')](function(_0x4ab2ea){var _0x27fc20=_0x580650[_0xb220('0x71')][_0xb220('0x33')]({'plain':!![]});if(!_0x27fc20)throw new Error(_0xb220('0x7a'));if(_0x27fc20[_0xb220('0x7b')]===_0xb220('0x71')){var _0x4c1b14=_0x4ab2ea['get']({'plain':!![]});return db[_0xb220('0x7c')][_0xb220('0x58')]({'where':{'name':'MailAccounts','userProfileId':_0x27fc20[_0xb220('0x7d')]},'raw':!![]})[_0xb220('0x1d')](function(_0x3b8d08){if(_0x3b8d08&&_0x3b8d08[_0xb220('0x7e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c1b14[_0xb220('0x69')],'resourceId':_0x4c1b14['id'],'type':_0x3b8d08['name'],'sectionId':_0x3b8d08['id']},{})[_0xb220('0x1d')](function(){return _0x4ab2ea;});}else{return _0x4ab2ea;}})[_0xb220('0x24')](function(_0x14914e){logger[_0xb220('0x21')](_0xb220('0x7f'),_0x14914e);throw _0x14914e;});}return _0x4ab2ea;})[_0xb220('0x1d')](respondWithResult(_0x445a81,0xc9))[_0xb220('0x24')](handleError(_0x445a81,null));};exports[_0xb220('0x80')]=function(_0x265932,_0x14c7ff,_0x1eb789){return db[_0xb220('0x4f')]['findOne']({'where':{'id':_0x265932['params']['id']}})['then'](handleEntityNotFound(_0x14c7ff,null))[_0xb220('0x1d')](function(_0x5b5e9d){if(_0x5b5e9d){return _0x5b5e9d[_0xb220('0x80')]();}return null;})[_0xb220('0x1d')](respondWithResult(_0x14c7ff,null))[_0xb220('0x24')](handleError(_0x14c7ff,null));};exports[_0xb220('0x81')]=function(_0x2c6bcf,_0x1a24e3,_0x456596){if(_0x2c6bcf[_0xb220('0x5a')]['id']){delete _0x2c6bcf[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x2c6bcf[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x1a24e3,null))[_0xb220('0x1d')](function(_0x34b8e4){if(_0x34b8e4){_0x2c6bcf['body'][_0xb220('0x5d')]=_0x34b8e4['id'];return db[_0xb220('0x39')][_0xb220('0x65')](_0x2c6bcf[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x1a24e3,null))[_0xb220('0x24')](handleError(_0x1a24e3,null));};exports['removeImap']=function(_0x5f21b0,_0x46f6bc,_0x35c4c3){return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x5f21b0[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x46f6bc,null))[_0xb220('0x1d')](function(_0xf4d54d){if(_0xf4d54d){return _0xf4d54d[_0xb220('0x82')](null);}return null;})[_0xb220('0x1d')](respondWithStatusCode(_0x46f6bc,null))[_0xb220('0x24')](handleError(_0x46f6bc,null));};exports[_0xb220('0x83')]=function(_0x17c60b,_0x686f01,_0x611566){return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x17c60b['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x686f01,null))[_0xb220('0x1d')](function(_0x806352){if(_0x806352){return _0x806352[_0xb220('0x83')]();}return null;})['then'](respondWithResult(_0x686f01,null))[_0xb220('0x24')](handleError(_0x686f01,null));};exports['addSmtp']=function(_0x2bb8fe,_0x3a534a,_0x41ee03){if(_0x2bb8fe[_0xb220('0x5a')]['id']){delete _0x2bb8fe[_0xb220('0x5a')]['id'];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x2bb8fe['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x3a534a,null))[_0xb220('0x1d')](function(_0x400947){if(_0x400947){_0x2bb8fe['body'][_0xb220('0x5d')]=_0x400947['id'];return db[_0xb220('0x55')][_0xb220('0x65')](_0x2bb8fe[_0xb220('0x5a')]);}})[_0xb220('0x1d')](respondWithResult(_0x3a534a,null))[_0xb220('0x24')](handleError(_0x3a534a,null));};exports['removeSmtp']=function(_0x4060c9,_0x320b9b,_0x2b0795){return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x4060c9['params']['id']}})['then'](handleEntityNotFound(_0x320b9b,null))[_0xb220('0x1d')](function(_0x2eef5b){if(_0x2eef5b){return _0x2eef5b[_0xb220('0x84')](null);}return null;})[_0xb220('0x1d')](respondWithStatusCode(_0x320b9b,null))['catch'](handleError(_0x320b9b,null));};exports['addInteraction']=function(_0x39693f,_0x2882c8,_0xa347cb){return db['MailInteraction'][_0xb220('0x58')]({'where':{'id':_0x39693f[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x2882c8,null))['then'](function(_0x4554f2){if(_0x4554f2){return _0x4554f2['addInteraction'](_0x39693f[_0xb220('0x5a')][_0xb220('0x62')],_['omit'](_0x39693f[_0xb220('0x5a')],['ids','id'])||{});}})[_0xb220('0x1d')](respondWithResult(_0x2882c8,null))[_0xb220('0x24')](handleError(_0x2882c8,null));};exports['getInteractions']=function(_0x5a70ef,_0x3044c2,_0x493ebf){var _0x50988a={'raw':![],'where':{}};var _0x20d384={};var _0x370202={'count':0x0,'rows':[]};return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x5a70ef[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x3044c2,null))[_0xb220('0x1d')](function(_0x1a62a2){if(_0x1a62a2){_0x20d384[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x85')][_0xb220('0x57')]);_0x20d384[_0xb220('0x3f')]=_['keys'](_0x5a70ef[_0xb220('0x3f')]);_0x20d384[_0xb220('0x41')]=_[_0xb220('0x42')](_0x20d384[_0xb220('0x3e')],_0x20d384['query']);_0x50988a[_0xb220('0x43')]=_[_0xb220('0x42')](_0x20d384[_0xb220('0x3e')],qs['fields'](_0x5a70ef[_0xb220('0x3f')][_0xb220('0x44')]));_0x50988a['attributes']=_0x50988a['attributes']['length']?_0x50988a['attributes']:_0x20d384['model'];if(!_0x5a70ef[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0x50988a[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x5a70ef[_0xb220('0x3f')][_0xb220('0x2b')]);_0x50988a[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x5a70ef[_0xb220('0x3f')][_0xb220('0x29')]);}_0x50988a['order']=qs[_0xb220('0x49')](_0x5a70ef[_0xb220('0x3f')]['sort']);_0x50988a[_0xb220('0x4a')]=qs[_0xb220('0x41')](_[_0xb220('0x5f')](_0x5a70ef[_0xb220('0x3f')],_0x20d384['filters']));_0x50988a[_0xb220('0x4a')]['MailAccountId']=_0x1a62a2['id'];if(_0x5a70ef['query'][_0xb220('0x4b')]){_0x50988a[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x50988a[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x50988a[_0xb220('0x43')],function(_0x3b4a36){var _0x36ed05={};_0x36ed05[_0x3b4a36]={'$like':'%'+_0x5a70ef['query'][_0xb220('0x4b')]+'%'};return _0x36ed05;})});}_0x50988a=_[_0xb220('0x4c')]({},_0x50988a,_0x5a70ef['options']);return db[_0xb220('0x85')][_0xb220('0x2c')]({'where':_0x50988a['where']})[_0xb220('0x1d')](function(_0x402481){_0x370202['count']=_0x402481;if(_0x5a70ef[_0xb220('0x3f')][_0xb220('0x50')]){_0x50988a[_0xb220('0x51')]=[{'model':db[_0xb220('0x86')],'as':'Contact','required':![]},{'model':db[_0xb220('0x87')],'as':_0xb220('0x88'),'attributes':['name',_0xb220('0x89'),_0xb220('0x8a')],'required':![]},{'model':db['Tag'],'as':_0xb220('0x8b'),'attributes':['id',_0xb220('0x69'),_0xb220('0x8c')],'where':_0x5a70ef[_0xb220('0x3f')][_0xb220('0x8d')]?{'id':_0x5a70ef[_0xb220('0x3f')][_0xb220('0x8d')]}:undefined,'required':_0x5a70ef[_0xb220('0x3f')][_0xb220('0x8d')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x50988a);})['then'](function(_0x59885d){_0x370202['rows']=_0x59885d;return _0x370202;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x3044c2,_0x50988a))[_0xb220('0x24')](handleError(_0x3044c2,null));};exports[_0xb220('0x8e')]=function(_0xf90c10,_0x4a48ca,_0x1acc58){return db[_0xb220('0x4f')]['findOne']({'where':{'id':_0xf90c10[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x4a48ca,null))['then'](function(_0x4e50c4){if(_0x4e50c4){return db[_0xb220('0x8f')][_0xb220('0x90')](function(_0x1ec56a){return db[_0xb220('0x91')]['destroy']({'where':{'MailAccountId':_0xf90c10['params']['id']},'transaction':_0x1ec56a})[_0xb220('0x1d')](function(_0xc91fdf){var _0x435572=_[_0xb220('0x3c')](_0xf90c10['body'],function(_0x4c527f){_0x4c527f[_0xb220('0x5d')]=_0xf90c10[_0xb220('0x54')]['id'];return _0x4c527f;});return db[_0xb220('0x91')]['bulkCreate'](_0x435572,{'transaction':_0x1ec56a});});})[_0xb220('0x1d')](function(){return db[_0xb220('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0xf90c10[_0xb220('0x54')]['id']},'order':_0xb220('0x92')});});}})[_0xb220('0x1d')](respondWithResult(_0x4a48ca,null))[_0xb220('0x24')](handleError(_0x4a48ca,null));};exports[_0xb220('0x93')]=function(_0x170da1,_0x395fee,_0x42d23a){var _0x182113={};var _0x36b058={};var _0x4608bf;var _0x23d13f;return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x170da1[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x395fee,null))[_0xb220('0x1d')](function(_0x5b1c07){if(_0x5b1c07){_0x4608bf=_0x5b1c07;_0x36b058[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x91')][_0xb220('0x57')]);_0x36b058[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x170da1[_0xb220('0x3f')]);_0x36b058['filters']=_[_0xb220('0x42')](_0x36b058[_0xb220('0x3e')],_0x36b058[_0xb220('0x3f')]);_0x182113['attributes']=_[_0xb220('0x42')](_0x36b058[_0xb220('0x3e')],qs['fields'](_0x170da1['query'][_0xb220('0x44')]));_0x182113['attributes']=_0x182113[_0xb220('0x43')][_0xb220('0x45')]?_0x182113[_0xb220('0x43')]:_0x36b058[_0xb220('0x3e')];_0x182113[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x170da1['query'][_0xb220('0x49')]);_0x182113['where']=qs[_0xb220('0x41')](_['pick'](_0x170da1['query'],_0x36b058[_0xb220('0x41')]));if(_0x170da1[_0xb220('0x3f')][_0xb220('0x4b')]){_0x182113['where']=_['merge'](_0x182113[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x182113[_0xb220('0x43')],function(_0x40bf21){var _0x383057={};_0x383057[_0x40bf21]={'$like':'%'+_0x170da1[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x383057;})});}_0x182113=_['merge']({},_0x182113,_0x170da1['options']);return _0x4608bf[_0xb220('0x93')](_0x182113);}})[_0xb220('0x1d')](function(_0x315e6b){if(_0x315e6b){_0x23d13f=_0x315e6b[_0xb220('0x45')];if(!_0x170da1['query'][_0xb220('0x46')]('nolimit')){_0x182113['limit']=qs[_0xb220('0x2b')](_0x170da1[_0xb220('0x3f')][_0xb220('0x2b')]);_0x182113[_0xb220('0x29')]=qs['offset'](_0x170da1['query'][_0xb220('0x29')]);}return _0x4608bf[_0xb220('0x93')](_0x182113);}})[_0xb220('0x1d')](function(_0x4c471d){if(_0x4c471d){return _0x4c471d?{'count':_0x23d13f,'rows':_0x4c471d}:null;}})['then'](respondWithResult(_0x395fee,null))[_0xb220('0x24')](handleError(_0x395fee,null));};exports['getMessages']=function(_0x1692ec,_0x30b3a8,_0xd3a767){var _0x54d419={'raw':!![],'where':{}};var _0x49d315={};var _0x4f56f3={'count':0x0,'rows':[]};return db['MailAccount'][_0xb220('0x67')]({'where':{'id':_0x1692ec[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x30b3a8,null))[_0xb220('0x1d')](function(_0x4cd6df){if(_0x4cd6df){_0x49d315['model']=_[_0xb220('0x40')](db['MailMessage'][_0xb220('0x57')]);_0x49d315[_0xb220('0x3f')]=_['keys'](_0x1692ec['query']);_0x49d315[_0xb220('0x41')]=_[_0xb220('0x42')](_0x49d315['model'],_0x49d315[_0xb220('0x3f')]);_0x54d419[_0xb220('0x43')]=_[_0xb220('0x42')](_0x49d315[_0xb220('0x3e')],qs[_0xb220('0x44')](_0x1692ec[_0xb220('0x3f')][_0xb220('0x44')]));_0x54d419[_0xb220('0x43')]=_0x54d419[_0xb220('0x43')][_0xb220('0x45')]?_0x54d419[_0xb220('0x43')]:_0x49d315[_0xb220('0x3e')];if(!_0x1692ec[_0xb220('0x3f')][_0xb220('0x46')](_0xb220('0x47'))){_0x54d419[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x1692ec[_0xb220('0x3f')][_0xb220('0x2b')]);_0x54d419[_0xb220('0x29')]=qs[_0xb220('0x29')](_0x1692ec[_0xb220('0x3f')][_0xb220('0x29')]);}_0x54d419[_0xb220('0x48')]=qs['sort'](_0x1692ec[_0xb220('0x3f')]['sort']);_0x54d419[_0xb220('0x4a')]=qs[_0xb220('0x41')](_[_0xb220('0x5f')](_0x1692ec[_0xb220('0x3f')],_0x49d315[_0xb220('0x41')]));_0x54d419[_0xb220('0x4a')][_0xb220('0x5d')]=_0x4cd6df['id'];if(_0x1692ec[_0xb220('0x3f')][_0xb220('0x4b')]){_0x54d419['where']=_[_0xb220('0x4c')](_0x54d419['where'],{'$or':_[_0xb220('0x3c')](_0x54d419[_0xb220('0x43')],function(_0x4bb24c){var _0x6a382b={};_0x6a382b[_0x4bb24c]={'$like':'%'+_0x1692ec[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x6a382b;})});}if(_0x1692ec[_0xb220('0x3f')][_0xb220('0x94')]){var _0x4d8dd9=_0x1692ec['query'][_0xb220('0x94')][_0xb220('0x95')](',');var _0x491a1d={};_0x491a1d[_0x4d8dd9[0x0]]={'$gte':moment(_0x4d8dd9[0x1])[_0xb220('0x96')]('YYYY-MM-DD\x20HH:mm:ss')};_0x54d419[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x54d419[_0xb220('0x4a')],_0x491a1d);}_0x54d419=_[_0xb220('0x4c')]({},_0x54d419,_0x1692ec[_0xb220('0x4e')]);return db[_0xb220('0x97')]['count']({'where':_0x54d419['where']})[_0xb220('0x1d')](function(_0x2c214c){_0x4f56f3[_0xb220('0x2c')]=_0x2c214c;if(_0x1692ec[_0xb220('0x3f')][_0xb220('0x50')]){_0x54d419[_0xb220('0x51')]=[{'all':!![]}];}return db[_0xb220('0x97')][_0xb220('0x52')](_0x54d419);})[_0xb220('0x1d')](function(_0x2edd30){if(_0x1692ec['query'][_0xb220('0x98')]==='true'){for(var _0x37e023=0x0;_0x37e023<_0x2edd30[_0xb220('0x45')];_0x37e023++){_0x2edd30[_0x37e023]['body']=juice(_0x2edd30[_0x37e023][_0xb220('0x5a')]);}}_0x4f56f3['rows']=_0x2edd30;return _0x4f56f3;});}})[_0xb220('0x1d')](respondWithFilteredResult(_0x30b3a8,_0x54d419))[_0xb220('0x24')](handleError(_0x30b3a8,null));};exports[_0xb220('0x37')]=function(_0x3ddf7b,_0x1660dd,_0x2a3c59){var _0xf55af0,_0x143315={},_0x284864;if(_0x3ddf7b[_0xb220('0x5a')]['to']){_0x284864=_0x3ddf7b['body']['to']['split'](',')[0x0];}return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x3ddf7b[_0xb220('0x54')]['id']},'include':[{'model':db[_0xb220('0x99')],'as':'List','include':[{'model':db[_0xb220('0x86')],'as':'Contacts','where':{'email':_0x284864},'limit':0x1,'order':[[_0xb220('0x9a'),_0xb220('0x9b')]]}]},{'model':db[_0xb220('0x55')],'as':_0xb220('0x3b'),'raw':!![]}]})[_0xb220('0x1d')](handleEntityNotFound(_0x1660dd,null))[_0xb220('0x1d')](function(_0x1c5ae5){if(_0x1c5ae5){_0xf55af0=_0x1c5ae5;if(_0x1c5ae5[_0xb220('0x3b')]){if(_['isNil'](_0x3ddf7b[_0xb220('0x5a')]['from'])){_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9c')]=util[_0xb220('0x96')]('%s\x20<%s>',_0x1c5ae5[_0xb220('0x69')],_0x1c5ae5[_0xb220('0x6b')]||_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x71')]);}if(_0x3ddf7b[_0xb220('0x5a')]['attachments']&&_0x3ddf7b['body']['attachments'][_0xb220('0x45')]){for(var _0x2b5ee3=0x0;_0x2b5ee3<_0x3ddf7b[_0xb220('0x5a')]['attachments']['length'];_0x2b5ee3+=0x1){_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9d')][_0x2b5ee3]={'filename':_0x3ddf7b[_0xb220('0x5a')]['attachments'][_0x2b5ee3][_0xb220('0x69')],'path':path[_0xb220('0x9e')](config[_0xb220('0x9f')],_0xb220('0xa0'),_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9d')][_0x2b5ee3][_0xb220('0xa1')])};}}var _0xe3bc43={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x77')])){if(_0x1c5ae5['Smtp'][_0xb220('0x74')]){_0xe3bc43['auth']={'user':_0x1c5ae5['Smtp'][_0xb220('0x71')],'pass':_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x73')]};}_0xe3bc43[_0xb220('0x75')]=_0x1c5ae5['Smtp'][_0xb220('0x75')];_0xe3bc43['port']=_0x1c5ae5['Smtp'][_0xb220('0x76')];_0xe3bc43['secure']=_0x1c5ae5[_0xb220('0x3b')][_0xb220('0xa2')];}else{_0xe3bc43[_0xb220('0x77')]=_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x77')];_0xe3bc43['auth']={'user':_0x1c5ae5[_0xb220('0x3b')][_0xb220('0x71')],'pass':_0x1c5ae5[_0xb220('0x3b')]['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0xe3bc43,'message':_0x3ddf7b[_0xb220('0x5a')]});}else{throw new Error(_0xb220('0xa3'));}}})[_0xb220('0x1d')](function(_0x542c80){if(_0x542c80){_0x143315=_0x542c80;if(_0xf55af0[_0xb220('0xa4')]){if(_0xf55af0[_0xb220('0xa4')][_0xb220('0xa5')][_0xb220('0x45')]){return _0xf55af0['List'][_0xb220('0xa5')][0x0];}else{return db['CmContact']['create'](_[_0xb220('0xa6')](_0x3ddf7b[_0xb220('0x5a')],{'firstName':_0x3ddf7b['body']['to'],'email':_0x3ddf7b[_0xb220('0x5a')]['to'],'phone':_0x3ddf7b[_0xb220('0x5a')]['to'],'ListId':_0xf55af0[_0xb220('0x6c')]}));}}else{throw new Error(_0xb220('0xa3'));}}})[_0xb220('0x1d')](function(_0x5affc6){if(_0x5affc6){var _0x15e5ea={'UserId':_0x3ddf7b[_0xb220('0x71')]['id'],'ContactId':_0x5affc6['id'],'MailAccountId':_0xf55af0['id'],'inReplyTo':_0x143315[_0xb220('0xa7')],'to':_0x3ddf7b[_0xb220('0x5a')][_0xb220('0x9c')],'cc':_0x3ddf7b[_0xb220('0x5a')]['cc'],'subject':_0x3ddf7b['body'][_0xb220('0xa8')],'attach':_0x3ddf7b[_0xb220('0x5a')][_0xb220('0xa9')],'firstMsgDirection':_0xb220('0xaa'),'lastMsgAt':moment()['format'](_0xb220('0xab')),'lastMsgDirection':_0xb220('0xaa'),'Messages':[_[_0xb220('0x4c')](_0x3ddf7b[_0xb220('0x5a')],{'messageId':_0x143315[_0xb220('0xa7')],'sentAt':moment()['format'](_0xb220('0xab')),'read':!![],'MailAccountId':_0xf55af0['id'],'UserId':_0x3ddf7b[_0xb220('0x71')]['id'],'ContactId':_0x5affc6['id']})]};if(_0x3ddf7b[_0xb220('0x5a')]['Interaction']){_0x15e5ea=_[_0xb220('0x4c')](_0x15e5ea,_0x3ddf7b[_0xb220('0x5a')][_0xb220('0xac')]);}return db[_0xb220('0x85')]['create'](_0x15e5ea,{'include':[{'model':db[_0xb220('0x97')],'as':'Messages'}]});}})[_0xb220('0x1d')](respondWithResult(_0x1660dd,null))['catch'](handleError(_0x1660dd,null));};exports[_0xb220('0xad')]=function(_0x4cd25b,_0x1d5927,_0x42fbd1){return db['MailAccount'][_0xb220('0x58')]({'where':{'id':_0x4cd25b['params']['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xb220('0x1d')](handleEntityNotFound(_0x1d5927,null))[_0xb220('0x1d')](function(_0x3478ee){if(_0x3478ee&&_0x3478ee[_0xb220('0x3b')]){var _0x57bdad={'id':_0x3478ee['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3478ee[_0xb220('0x3b')][_0xb220('0x77')]){_0x57bdad[_0xb220('0x77')]=_0x3478ee[_0xb220('0x3b')][_0xb220('0x77')];}else{_0x57bdad[_0xb220('0x75')]=_0x3478ee['Smtp'][_0xb220('0x75')];_0x57bdad[_0xb220('0x76')]=_0x3478ee[_0xb220('0x3b')]['port'];_0x57bdad[_0xb220('0xa2')]=_0x3478ee[_0xb220('0x3b')]['secure'];}if(_0x3478ee[_0xb220('0x3b')][_0xb220('0x74')]){_0x57bdad[_0xb220('0xae')]={'user':_0x3478ee[_0xb220('0x3b')][_0xb220('0x71')],'pass':_0x3478ee[_0xb220('0x3b')][_0xb220('0x73')]};}return respondWithRpcPromise('VerifySmtp',_0xb220('0xad'),{'account':_0x57bdad});}})[_0xb220('0x1d')](respondWithResult(_0x1d5927,null))[_0xb220('0x24')](handleError(_0x1d5927,null));};exports['destroy']=function(_0x4134c7,_0x26462d){return db[_0xb220('0x4f')][_0xb220('0x58')]({'where':{'id':_0x4134c7['params']['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x26462d,null))[_0xb220('0x1d')](function(_0x460f14){if(_0x460f14&&_0x460f14[_0xb220('0x77')]){throw new db[(_0xb220('0xaf'))][(_0xb220('0xb0'))](_0xb220('0xb1'));}return _0x460f14;})[_0xb220('0x1d')](removeEntity(_0x26462d,null))[_0xb220('0x24')](handleError(_0x26462d,null));};exports[_0xb220('0xb2')]=function(_0x27ceeb,_0xd0c06f,_0x3f945f){return db[_0xb220('0x4f')]['find']({'where':{'id':_0x27ceeb[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0xd0c06f,null))[_0xb220('0x1d')](function(_0x4c1abe){if(_0x4c1abe){return _0x4c1abe[_0xb220('0xb2')](_0x27ceeb['body'][_0xb220('0x62')],_[_0xb220('0xb3')](_0x27ceeb[_0xb220('0x5a')],[_0xb220('0x62'),'id'])||{})[_0xb220('0xb4')](function(_0x26e738){for(var _0x2fe76f=0x0;_0x2fe76f<_0x27ceeb[_0xb220('0x5a')][_0xb220('0x62')]['length'];_0x2fe76f+=0x1){socket[_0xb220('0xb5')](_0xb220('0xb6'),{'UserId':Number(_0x27ceeb['body'][_0xb220('0x62')][_0x2fe76f]),'MailAccountId':Number(_0x27ceeb[_0xb220('0x54')]['id'])});}return _0x26e738;});}})[_0xb220('0x1d')](respondWithResult(_0xd0c06f,null))['catch'](handleError(_0xd0c06f,null));};exports['removeAgents']=function(_0x51a54f,_0x4d3d49,_0x50505d){return db[_0xb220('0x4f')]['find']({'where':{'id':_0x51a54f[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x4d3d49,null))['then'](function(_0x4097c8){if(_0x4097c8){return _0x4097c8[_0xb220('0xb7')](_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')])[_0xb220('0x1d')](function(){if(_['isArray'](_0x51a54f['query'][_0xb220('0x62')])){for(var _0x3fb55f=0x0;_0x3fb55f<_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')][_0xb220('0x45')];_0x3fb55f+=0x1){socket['emit'](_0xb220('0xb8'),{'UserId':Number(_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')][_0x3fb55f]),'MailAccountId':Number(_0x51a54f[_0xb220('0x54')]['id'])});}}else{socket[_0xb220('0xb5')](_0xb220('0xb8'),{'UserId':Number(_0x51a54f[_0xb220('0x3f')][_0xb220('0x62')]),'MailAccountId':Number(_0x51a54f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4d3d49,null))[_0xb220('0x24')](handleError(_0x4d3d49,null));};exports['getAgents']=function(_0x3f11e1,_0x15b2a8,_0x758a3c){var _0x3fa8f6={};var _0x146d16={};var _0x1a230d;var _0x3495ee;return db[_0xb220('0x4f')][_0xb220('0x67')]({'where':{'id':_0x3f11e1[_0xb220('0x54')]['id']}})[_0xb220('0x1d')](handleEntityNotFound(_0x15b2a8,null))[_0xb220('0x1d')](function(_0x22c8c6){if(_0x22c8c6){_0x1a230d=_0x22c8c6;_0x146d16[_0xb220('0x3e')]=_[_0xb220('0x40')](db[_0xb220('0x87')]['rawAttributes']);_0x146d16[_0xb220('0x3f')]=_[_0xb220('0x40')](_0x3f11e1[_0xb220('0x3f')]);_0x146d16['filters']=_['intersection'](_0x146d16[_0xb220('0x3e')],_0x146d16[_0xb220('0x3f')]);_0x3fa8f6[_0xb220('0x43')]=_['intersection'](_0x146d16[_0xb220('0x3e')],qs[_0xb220('0x44')](_0x3f11e1[_0xb220('0x3f')][_0xb220('0x44')]));_0x3fa8f6['attributes']=_0x3fa8f6['attributes'][_0xb220('0x45')]?_0x3fa8f6[_0xb220('0x43')]:_0x146d16[_0xb220('0x3e')];_0x3fa8f6[_0xb220('0x48')]=qs[_0xb220('0x49')](_0x3f11e1[_0xb220('0x3f')][_0xb220('0x49')]);_0x3fa8f6[_0xb220('0x4a')]=qs[_0xb220('0x41')](_['pick'](_0x3f11e1[_0xb220('0x3f')],_0x146d16[_0xb220('0x41')]));if(_0x3f11e1['query'][_0xb220('0x4b')]){_0x3fa8f6[_0xb220('0x4a')]=_[_0xb220('0x4c')](_0x3fa8f6[_0xb220('0x4a')],{'$or':_[_0xb220('0x3c')](_0x3fa8f6[_0xb220('0x43')],function(_0x30aa5a){var _0x45f9ea={};_0x45f9ea[_0x30aa5a]={'$like':'%'+_0x3f11e1[_0xb220('0x3f')][_0xb220('0x4b')]+'%'};return _0x45f9ea;})});}_0x3fa8f6=_[_0xb220('0x4c')]({},_0x3fa8f6,_0x3f11e1[_0xb220('0x4e')]);return _0x1a230d[_0xb220('0xb9')](_0x3fa8f6);}})[_0xb220('0x1d')](function(_0x10f82c){if(_0x10f82c){_0x3495ee=_0x10f82c[_0xb220('0x45')];if(!_0x3f11e1[_0xb220('0x3f')][_0xb220('0x46')]('nolimit')){_0x3fa8f6[_0xb220('0x2b')]=qs[_0xb220('0x2b')](_0x3f11e1[_0xb220('0x3f')]['limit']);_0x3fa8f6['offset']=qs[_0xb220('0x29')](_0x3f11e1[_0xb220('0x3f')][_0xb220('0x29')]);}return _0x1a230d[_0xb220('0xb9')](_0x3fa8f6);}})[_0xb220('0x1d')](function(_0x17a5c7){if(_0x17a5c7){return _0x17a5c7?{'count':_0x3495ee,'rows':_0x17a5c7}:null;}})[_0xb220('0x1d')](respondWithResult(_0x15b2a8,null))[_0xb220('0x24')](handleError(_0x15b2a8,null));}; \ No newline at end of file +var _0x8ced=['emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','MailAccounts','status','stack','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','length','body','params','Pause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','hasOwnProperty','include','removeDispositions','find','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','email','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','port','host','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','getSmtp','setSmtp','addInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','ListId','List\x20not\x20found','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread'];(function(_0xd8b2aa,_0x3b5e2c){var _0x5255c5=function(_0x2dce14){while(--_0x2dce14){_0xd8b2aa['push'](_0xd8b2aa['shift']());}};_0x5255c5(++_0x3b5e2c);}(_0x8ced,0xc7));var _0xd8ce=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x8ced[_0x4d07cc];return _0x42de3b;};'use strict';var emlformat=require(_0xd8ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8ce('0x1'));var jsonpatch=require(_0xd8ce('0x2'));var rp=require(_0xd8ce('0x3'));var moment=require(_0xd8ce('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd8ce('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8ce('0x6'));var fs=require('fs');var fs_extra=require(_0xd8ce('0x7'));var _=require(_0xd8ce('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd8ce('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd8ce('0xa'));var querystring=require(_0xd8ce('0xb'));var Papa=require('papaparse');var htmlToText=require(_0xd8ce('0xc'));var juice=require(_0xd8ce('0xd'));var Redis=require(_0xd8ce('0xe'));var authService=require(_0xd8ce('0xf'));var qs=require(_0xd8ce('0x10'));var as=require(_0xd8ce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8ce('0x12'))(_0xd8ce('0x13'));var utils=require('../../config/utils');var config=require(_0xd8ce('0x14'));var licenseUtil=require(_0xd8ce('0x15'));var db=require(_0xd8ce('0x16'))['db'];config[_0xd8ce('0x17')]=_[_0xd8ce('0x18')](config[_0xd8ce('0x17')],{'host':_0xd8ce('0x19'),'port':0x18eb});var socket=require(_0xd8ce('0x1a'))(new Redis(config[_0xd8ce('0x17')]));require('./mailAccount.socket')[_0xd8ce('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd8ce('0x1c')][_0xd8ce('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x364d9c,_0x3fd350,_0x5827a0,_0x1ee1a3){return new BPromise(function(_0x422cd1,_0x54bb4f){var _0x209b92=_0x1ee1a3||client;return _0x209b92['request'](_0x364d9c,_0x5827a0)[_0xd8ce('0x1e')](function(_0x6c6d57){logger[_0xd8ce('0x1f')]('MailAccount,\x20%s,\x20%s',_0x3fd350,_0xd8ce('0x20'));logger[_0xd8ce('0x21')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3fd350,'request\x20sent',JSON[_0xd8ce('0x22')](_0x6c6d57));if(_0x6c6d57[_0xd8ce('0x23')]){if(_0x6c6d57[_0xd8ce('0x23')]['code']===0x1f4){logger[_0xd8ce('0x23')](_0xd8ce('0x24'),_0x3fd350,_0x6c6d57[_0xd8ce('0x23')]['message']);return _0x54bb4f(_0x6c6d57['error'][_0xd8ce('0x25')]);}logger[_0xd8ce('0x23')](_0xd8ce('0x24'),_0x3fd350,_0x6c6d57[_0xd8ce('0x23')][_0xd8ce('0x25')]);return _0x422cd1(_0x6c6d57[_0xd8ce('0x23')][_0xd8ce('0x25')]);}else{logger[_0xd8ce('0x1f')](_0xd8ce('0x24'),_0x3fd350,_0xd8ce('0x20'));_0x422cd1(_0x6c6d57[_0xd8ce('0x26')]['message']);}})[_0xd8ce('0x27')](function(_0x47ac73){logger[_0xd8ce('0x23')](_0xd8ce('0x24'),_0x3fd350,_0x47ac73);_0x54bb4f(_0x47ac73);});});}function respondWithStatusCode(_0x5a321b,_0x30999a){_0x30999a=_0x30999a||0xcc;return function(_0x4e9965){if(_0x4e9965){return _0x5a321b[_0xd8ce('0x28')](_0x30999a);}return _0x5a321b['status'](_0x30999a)[_0xd8ce('0x29')]();};}function respondWithResult(_0x3109d1,_0x90fc04){_0x90fc04=_0x90fc04||0xc8;return function(_0x5d2eff){if(_0x5d2eff){return _0x3109d1['status'](_0x90fc04)[_0xd8ce('0x2a')](_0x5d2eff);}};}function respondWithFilteredResult(_0xb9acbc,_0x1f6a7d){return function(_0x4020c6){if(_0x4020c6){var _0x133160=typeof _0x1f6a7d[_0xd8ce('0x2b')]===_0xd8ce('0x2c')&&typeof _0x1f6a7d[_0xd8ce('0x2d')]===_0xd8ce('0x2c');var _0x2993f8=_0x4020c6[_0xd8ce('0x2e')];var _0xbfd281=_0x133160?0x0:_0x1f6a7d[_0xd8ce('0x2b')];var _0x50431f=_0x133160?_0x4020c6[_0xd8ce('0x2e')]:_0x1f6a7d[_0xd8ce('0x2b')]+_0x1f6a7d['limit'];var _0x27e588;if(_0x50431f>=_0x2993f8){_0x50431f=_0x2993f8;_0x27e588=0xc8;}else{_0x27e588=0xce;}_0xb9acbc['status'](_0x27e588);return _0xb9acbc[_0xd8ce('0x2f')](_0xd8ce('0x30'),_0xbfd281+'-'+_0x50431f+'/'+_0x2993f8)[_0xd8ce('0x2a')](_0x4020c6);}return null;};}function patchUpdates(_0x1c6edc){return function(_0x2504ac){try{jsonpatch[_0xd8ce('0x31')](_0x2504ac,_0x1c6edc,!![]);}catch(_0x1fe22a){return BPromise[_0xd8ce('0x32')](_0x1fe22a);}return _0x2504ac[_0xd8ce('0x33')]();};}function saveUpdates(_0x5fcac8,_0x32e4a6){return function(_0x2298aa){if(_0x2298aa){return _0x2298aa[_0xd8ce('0x34')](_0x5fcac8)[_0xd8ce('0x1e')](function(_0x51da67){return _0x51da67;});}return null;};}function removeEntity(_0x515b85,_0xd9fcb0){return function(_0xd7ab9c){if(_0xd7ab9c){return _0xd7ab9c[_0xd8ce('0x35')]()['then'](function(){var _0x37526a=_0xd7ab9c['get']({'plain':!![]});var _0x28e891=_0xd8ce('0x36');return db['UserProfileResource'][_0xd8ce('0x35')]({'where':{'type':_0x28e891,'resourceId':_0x37526a['id']}})['then'](function(){return _0xd7ab9c;});})[_0xd8ce('0x1e')](function(){_0x515b85[_0xd8ce('0x37')](0xcc)[_0xd8ce('0x29')]();});}};}function handleEntityNotFound(_0x220622,_0x2e27dd){return function(_0x5f1e6d){if(!_0x5f1e6d){_0x220622['sendStatus'](0x194);}return _0x5f1e6d;};}function handleError(_0x28e4be,_0x378af7){_0x378af7=_0x378af7||0x1f4;return function(_0x15b75b){logger[_0xd8ce('0x23')](_0x15b75b[_0xd8ce('0x38')]);if(_0x15b75b['name']){delete _0x15b75b['name'];}_0x28e4be['status'](_0x378af7)[_0xd8ce('0x39')](_0x15b75b);};}exports[_0xd8ce('0x3a')]=function(_0x4b39eb,_0x1e4543){var _0x46065c={'include':[{'model':db[_0xd8ce('0x3b')],'as':_0xd8ce('0x3c')},{'model':db[_0xd8ce('0x3d')],'as':_0xd8ce('0x3e')},{'model':db['Pause'],'as':_0xd8ce('0x3f')}]},_0x1f68c7={},_0x2daece={'count':0x0,'rows':[]};var _0x39570e=_[_0xd8ce('0x40')](db[_0xd8ce('0x41')][_0xd8ce('0x42')],function(_0x4e6d08){return{'name':_0x4e6d08[_0xd8ce('0x43')],'type':_0x4e6d08[_0xd8ce('0x44')]['key']};});_0x1f68c7[_0xd8ce('0x45')]=_[_0xd8ce('0x40')](_0x39570e,_0xd8ce('0x46'));_0x1f68c7[_0xd8ce('0x47')]=_[_0xd8ce('0x48')](_0x4b39eb[_0xd8ce('0x47')]);_0x1f68c7['filters']=_[_0xd8ce('0x49')](_0x1f68c7[_0xd8ce('0x45')],_0x1f68c7[_0xd8ce('0x47')]);_0x46065c[_0xd8ce('0x4a')]=_[_0xd8ce('0x49')](_0x1f68c7[_0xd8ce('0x45')],qs[_0xd8ce('0x4b')](_0x4b39eb[_0xd8ce('0x47')]['fields']));_0x46065c[_0xd8ce('0x4a')]=_0x46065c[_0xd8ce('0x4a')]['length']?_0x46065c['attributes']:_0x1f68c7[_0xd8ce('0x45')];if(!_0x4b39eb[_0xd8ce('0x47')]['hasOwnProperty'](_0xd8ce('0x4c'))){_0x46065c[_0xd8ce('0x2d')]=qs['limit'](_0x4b39eb[_0xd8ce('0x47')][_0xd8ce('0x2d')]);_0x46065c[_0xd8ce('0x2b')]=qs[_0xd8ce('0x2b')](_0x4b39eb['query'][_0xd8ce('0x2b')]);}_0x46065c[_0xd8ce('0x4d')]=qs['sort'](_0x4b39eb['query'][_0xd8ce('0x4e')]);_0x46065c[_0xd8ce('0x4f')]=qs[_0xd8ce('0x50')](_[_0xd8ce('0x51')](_0x4b39eb[_0xd8ce('0x47')],_0x1f68c7[_0xd8ce('0x50')]),_0x39570e);if(_0x4b39eb[_0xd8ce('0x47')][_0xd8ce('0x52')]){_0x46065c[_0xd8ce('0x4f')]=_[_0xd8ce('0x53')](_0x46065c[_0xd8ce('0x4f')],{'$or':_[_0xd8ce('0x40')](_0x39570e,function(_0x45a260){if(_0x45a260['type']!==_0xd8ce('0x54')){var _0xf154e1={};_0xf154e1[_0x45a260[_0xd8ce('0x46')]]={'$like':'%'+_0x4b39eb[_0xd8ce('0x47')][_0xd8ce('0x52')]+'%'};return _0xf154e1;}})});}_0x46065c=_['merge']({},_0x46065c,_0x4b39eb[_0xd8ce('0x55')]);var _0xf8b316={'where':_0x46065c[_0xd8ce('0x4f')]};return db['MailAccount'][_0xd8ce('0x2e')](_0xf8b316)[_0xd8ce('0x1e')](function(_0x3827b1){_0x2daece['count']=_0x3827b1;if(_0x4b39eb[_0xd8ce('0x47')][_0xd8ce('0x56')]){_0x46065c['include']=[{'all':!![]}];}return db['MailAccount'][_0xd8ce('0x57')](_0x46065c);})['then'](function(_0x726531){_0x2daece[_0xd8ce('0x58')]=_0x726531;return _0x2daece;})[_0xd8ce('0x1e')](respondWithFilteredResult(_0x1e4543,_0x46065c))[_0xd8ce('0x27')](handleError(_0x1e4543,null));};exports[_0xd8ce('0x59')]=function(_0x54c65f,_0x4482c6){var _0x50036e={'raw':![],'where':{'id':_0x54c65f['params']['id']},'include':[{'model':db[_0xd8ce('0x3b')],'as':_0xd8ce('0x3c')},{'model':db['MailServerOut'],'as':_0xd8ce('0x3e')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x247a60={};_0x247a60[_0xd8ce('0x45')]=_['keys'](db[_0xd8ce('0x41')][_0xd8ce('0x42')]);_0x247a60[_0xd8ce('0x47')]=_[_0xd8ce('0x48')](_0x54c65f['query']);_0x247a60[_0xd8ce('0x50')]=_['intersection'](_0x247a60[_0xd8ce('0x45')],_0x247a60[_0xd8ce('0x47')]);_0x50036e[_0xd8ce('0x4a')]=_[_0xd8ce('0x49')](_0x247a60[_0xd8ce('0x45')],qs[_0xd8ce('0x4b')](_0x54c65f[_0xd8ce('0x47')][_0xd8ce('0x4b')]));_0x50036e[_0xd8ce('0x4a')]=_0x50036e[_0xd8ce('0x4a')][_0xd8ce('0x5a')]?_0x50036e['attributes']:_0x247a60[_0xd8ce('0x45')];if(_0x54c65f[_0xd8ce('0x47')][_0xd8ce('0x56')]){_0x50036e['include']=[{'all':!![]}];}_0x50036e=_[_0xd8ce('0x53')]({},_0x50036e,_0x54c65f[_0xd8ce('0x55')]);return db[_0xd8ce('0x41')]['find'](_0x50036e)[_0xd8ce('0x1e')](handleEntityNotFound(_0x4482c6,null))[_0xd8ce('0x1e')](respondWithResult(_0x4482c6,null))[_0xd8ce('0x27')](handleError(_0x4482c6,null));};exports['update']=function(_0x48ba34,_0x389d33){if(_0x48ba34['body']['id']){delete _0x48ba34[_0xd8ce('0x5b')]['id'];}return db[_0xd8ce('0x41')]['find']({'where':{'id':_0x48ba34[_0xd8ce('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xd8ce('0x3c')},{'model':db[_0xd8ce('0x3d')],'as':_0xd8ce('0x3e')},{'model':db[_0xd8ce('0x5d')],'as':_0xd8ce('0x3f')}]})[_0xd8ce('0x1e')](handleEntityNotFound(_0x389d33,null))['then'](saveUpdates(_0x48ba34[_0xd8ce('0x5b')],null))[_0xd8ce('0x1e')](function(_0x4f1cbb){if(_0x4f1cbb&&_0x48ba34[_0xd8ce('0x5b')][_0xd8ce('0x3c')]){return db[_0xd8ce('0x3b')][_0xd8ce('0x34')](_0x48ba34[_0xd8ce('0x5b')][_0xd8ce('0x3c')],{'where':{'MailAccountId':_0x4f1cbb['id']}})[_0xd8ce('0x1e')](function(){return _0x4f1cbb;});}return _0x4f1cbb;})['then'](function(_0x30ad5e){if(_0x30ad5e&&_0x48ba34[_0xd8ce('0x5b')][_0xd8ce('0x3e')]){return db['MailServerOut'][_0xd8ce('0x34')](_0x48ba34['body'][_0xd8ce('0x3e')],{'where':{'MailAccountId':_0x30ad5e['id']}})['then'](function(){return _0x30ad5e;});}return _0x30ad5e;})[_0xd8ce('0x1e')](respondWithResult(_0x389d33,null))[_0xd8ce('0x27')](handleError(_0x389d33,null));};exports[_0xd8ce('0x5e')]=function(_0x94a905,_0x2f6c82){return db['MailAccount'][_0xd8ce('0x5e')]()[_0xd8ce('0x1e')](respondWithResult(_0x2f6c82,null))[_0xd8ce('0x27')](handleError(_0x2f6c82,null));};exports[_0xd8ce('0x5f')]=function(_0xfb064f,_0x223545,_0x39ee24){if(_0xfb064f[_0xd8ce('0x5b')]['id']){delete _0xfb064f[_0xd8ce('0x5b')]['id'];}return db[_0xd8ce('0x41')]['find']({'where':{'id':_0xfb064f[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x223545,null))['then'](function(_0x55480d){if(_0x55480d){_0xfb064f[_0xd8ce('0x5b')][_0xd8ce('0x60')]=_0x55480d['id'];return db[_0xd8ce('0x61')][_0xd8ce('0x62')](_0xfb064f['body']);}})[_0xd8ce('0x1e')](respondWithResult(_0x223545,null))[_0xd8ce('0x27')](handleError(_0x223545,null));};exports[_0xd8ce('0x63')]=function(_0x40991a,_0x1d2ef3,_0x40c463){var _0x51ad70={'raw':![],'where':{}};var _0x4ebd0a={};var _0x26db72={'count':0x0,'rows':[]};return db[_0xd8ce('0x41')]['findOne']({'where':{'id':_0x40991a['params']['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x1d2ef3,null))['then'](function(_0x4a92bf){if(_0x4a92bf){_0x4ebd0a['model']=_['keys'](db[_0xd8ce('0x61')][_0xd8ce('0x42')]);_0x4ebd0a[_0xd8ce('0x47')]=_[_0xd8ce('0x48')](_0x40991a[_0xd8ce('0x47')]);_0x4ebd0a[_0xd8ce('0x50')]=_['intersection'](_0x4ebd0a[_0xd8ce('0x45')],_0x4ebd0a[_0xd8ce('0x47')]);_0x51ad70['attributes']=_[_0xd8ce('0x49')](_0x4ebd0a[_0xd8ce('0x45')],qs['fields'](_0x40991a[_0xd8ce('0x47')]['fields']));_0x51ad70[_0xd8ce('0x4a')]=_0x51ad70['attributes'][_0xd8ce('0x5a')]?_0x51ad70[_0xd8ce('0x4a')]:_0x4ebd0a['model'];if(!_0x40991a[_0xd8ce('0x47')][_0xd8ce('0x64')](_0xd8ce('0x4c'))){_0x51ad70[_0xd8ce('0x2d')]=qs[_0xd8ce('0x2d')](_0x40991a[_0xd8ce('0x47')][_0xd8ce('0x2d')]);_0x51ad70[_0xd8ce('0x2b')]=qs[_0xd8ce('0x2b')](_0x40991a['query'][_0xd8ce('0x2b')]);}_0x51ad70['order']=qs[_0xd8ce('0x4e')](_0x40991a[_0xd8ce('0x47')][_0xd8ce('0x4e')]);_0x51ad70[_0xd8ce('0x4f')]=qs['filters'](_[_0xd8ce('0x51')](_0x40991a[_0xd8ce('0x47')],_0x4ebd0a['filters']));_0x51ad70[_0xd8ce('0x4f')][_0xd8ce('0x60')]=_0x4a92bf['id'];if(_0x40991a['query'][_0xd8ce('0x52')]){_0x51ad70['where']=_[_0xd8ce('0x53')](_0x51ad70[_0xd8ce('0x4f')],{'$or':_[_0xd8ce('0x40')](_0x51ad70['attributes'],function(_0xa658e5){var _0x248ca3={};_0x248ca3[_0xa658e5]={'$like':'%'+_0x40991a[_0xd8ce('0x47')][_0xd8ce('0x52')]+'%'};return _0x248ca3;})});}_0x51ad70=_[_0xd8ce('0x53')]({},_0x51ad70,_0x40991a['options']);return db['Disposition'][_0xd8ce('0x2e')]({'where':_0x51ad70['where']})[_0xd8ce('0x1e')](function(_0x2fde3f){_0x26db72[_0xd8ce('0x2e')]=_0x2fde3f;if(_0x40991a['query']['includeAll']){_0x51ad70[_0xd8ce('0x65')]=[{'all':!![]}];}return db[_0xd8ce('0x61')]['findAll'](_0x51ad70);})['then'](function(_0x4bacfb){_0x26db72[_0xd8ce('0x58')]=_0x4bacfb;return _0x26db72;});}})[_0xd8ce('0x1e')](respondWithFilteredResult(_0x1d2ef3,_0x51ad70))['catch'](handleError(_0x1d2ef3,null));};exports[_0xd8ce('0x66')]=function(_0x1bafa3,_0x2a7a20,_0x4a2a96){return db[_0xd8ce('0x41')][_0xd8ce('0x67')]({'where':{'id':_0x1bafa3[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x2a7a20,null))['then'](function(_0x30c8f2){if(_0x30c8f2){return _0x30c8f2[_0xd8ce('0x66')](_0x1bafa3[_0xd8ce('0x47')][_0xd8ce('0x68')]);}})['then'](respondWithStatusCode(_0x2a7a20,null))['catch'](handleError(_0x2a7a20,null));};exports[_0xd8ce('0x69')]=function(_0x597771,_0x50d34e,_0x1cd273){if(_0x597771['body']['id']){delete _0x597771[_0xd8ce('0x5b')]['id'];}return db[_0xd8ce('0x41')][_0xd8ce('0x67')]({'where':{'id':_0x597771[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x50d34e,null))['then'](function(_0xe55eca){if(_0xe55eca){_0x597771['body'][_0xd8ce('0x60')]=_0xe55eca['id'];return db[_0xd8ce('0x6a')][_0xd8ce('0x62')](_0x597771[_0xd8ce('0x5b')]);}})[_0xd8ce('0x1e')](respondWithResult(_0x50d34e,null))['catch'](handleError(_0x50d34e,null));};exports[_0xd8ce('0x6b')]=function(_0x870536,_0x122fc0,_0x618fc4){var _0x47308b={'raw':![],'where':{}};var _0xac5aec={};var _0xa60581={'count':0x0,'rows':[]};return db[_0xd8ce('0x41')]['findOne']({'where':{'id':_0x870536[_0xd8ce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x122fc0,null))[_0xd8ce('0x1e')](function(_0x30e59b){if(_0x30e59b){_0xac5aec['model']=_[_0xd8ce('0x48')](db[_0xd8ce('0x6a')]['rawAttributes']);_0xac5aec['query']=_['keys'](_0x870536['query']);_0xac5aec['filters']=_['intersection'](_0xac5aec[_0xd8ce('0x45')],_0xac5aec['query']);_0x47308b[_0xd8ce('0x4a')]=_[_0xd8ce('0x49')](_0xac5aec[_0xd8ce('0x45')],qs[_0xd8ce('0x4b')](_0x870536[_0xd8ce('0x47')][_0xd8ce('0x4b')]));_0x47308b['attributes']=_0x47308b[_0xd8ce('0x4a')][_0xd8ce('0x5a')]?_0x47308b[_0xd8ce('0x4a')]:_0xac5aec[_0xd8ce('0x45')];if(!_0x870536[_0xd8ce('0x47')][_0xd8ce('0x64')](_0xd8ce('0x4c'))){_0x47308b[_0xd8ce('0x2d')]=qs[_0xd8ce('0x2d')](_0x870536[_0xd8ce('0x47')][_0xd8ce('0x2d')]);_0x47308b[_0xd8ce('0x2b')]=qs[_0xd8ce('0x2b')](_0x870536[_0xd8ce('0x47')][_0xd8ce('0x2b')]);}_0x47308b['order']=qs[_0xd8ce('0x4e')](_0x870536[_0xd8ce('0x47')]['sort']);_0x47308b['where']=qs[_0xd8ce('0x50')](_[_0xd8ce('0x51')](_0x870536[_0xd8ce('0x47')],_0xac5aec[_0xd8ce('0x50')]));_0x47308b['where'][_0xd8ce('0x60')]=_0x30e59b['id'];if(_0x870536[_0xd8ce('0x47')][_0xd8ce('0x52')]){_0x47308b[_0xd8ce('0x4f')]=_[_0xd8ce('0x53')](_0x47308b[_0xd8ce('0x4f')],{'$or':_[_0xd8ce('0x40')](_0x47308b['attributes'],function(_0x333397){var _0x3d5227={};_0x3d5227[_0x333397]={'$like':'%'+_0x870536['query']['filter']+'%'};return _0x3d5227;})});}_0x47308b=_[_0xd8ce('0x53')]({},_0x47308b,_0x870536[_0xd8ce('0x55')]);return db[_0xd8ce('0x6a')][_0xd8ce('0x2e')]({'where':_0x47308b[_0xd8ce('0x4f')]})[_0xd8ce('0x1e')](function(_0x396fcf){_0xa60581[_0xd8ce('0x2e')]=_0x396fcf;if(_0x870536['query'][_0xd8ce('0x56')]){_0x47308b[_0xd8ce('0x65')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd8ce('0x57')](_0x47308b);})[_0xd8ce('0x1e')](function(_0x4a6296){_0xa60581['rows']=_0x4a6296;return _0xa60581;});}})['then'](respondWithFilteredResult(_0x122fc0,_0x47308b))[_0xd8ce('0x27')](handleError(_0x122fc0,null));};exports[_0xd8ce('0x6c')]=function(_0x369412,_0x1012da,_0x2e0edf){return db[_0xd8ce('0x41')]['find']({'where':{'id':_0x369412[_0xd8ce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1012da,null))[_0xd8ce('0x1e')](function(_0x284a60){if(_0x284a60){return _0x284a60[_0xd8ce('0x6c')](_0x369412['query'][_0xd8ce('0x68')]);}})[_0xd8ce('0x1e')](respondWithStatusCode(_0x1012da,null))[_0xd8ce('0x27')](handleError(_0x1012da,null));};exports[_0xd8ce('0x62')]=function(_0x5231cc,_0x1bd82f){var _0x6883e1={'name':_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x46')],'key':_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x6d')],'email':_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x6e')],'ListId':_0x5231cc[_0xd8ce('0x5b')]['ListId'],'active':!_[_0xd8ce('0x6f')](_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x70')])?_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x70')]:!![],'description':_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xd8ce('0x6f')](_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x72')])){if(_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x73')]){_0x6883e1[_0xd8ce('0x3c')][_0xd8ce('0x74')]=_0x6883e1['Smtp']['user']=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x75')];_0x6883e1[_0xd8ce('0x3c')]['password']=_0x6883e1[_0xd8ce('0x3e')][_0xd8ce('0x76')]=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x77')];}else{_0x6883e1[_0xd8ce('0x3c')][_0xd8ce('0x78')]=_0x6883e1[_0xd8ce('0x3e')]['authentication']=![];}_0x6883e1[_0xd8ce('0x3c')]['host']=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x3c')]['host'];_0x6883e1[_0xd8ce('0x3c')][_0xd8ce('0x79')]=_0x5231cc[_0xd8ce('0x5b')]['Imap']['port'];_0x6883e1[_0xd8ce('0x3e')]['host']=_0x5231cc['body']['Smtp'][_0xd8ce('0x7a')];_0x6883e1[_0xd8ce('0x3e')][_0xd8ce('0x79')]=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x3e')][_0xd8ce('0x79')];}else{_0x6883e1[_0xd8ce('0x3c')][_0xd8ce('0x7b')]=_0x6883e1['Smtp'][_0xd8ce('0x7b')]=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x72')];_0x6883e1['Imap']['user']=_0x6883e1[_0xd8ce('0x3e')][_0xd8ce('0x74')]=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x75')];_0x6883e1[_0xd8ce('0x3c')]['password']=_0x6883e1[_0xd8ce('0x3e')][_0xd8ce('0x76')]=_0x5231cc[_0xd8ce('0x5b')][_0xd8ce('0x77')];}return db['MailAccount'][_0xd8ce('0x62')](_0x6883e1,{'include':[{'model':db[_0xd8ce('0x3d')],'as':_0xd8ce('0x3e')},{'model':db['MailServerIn'],'as':_0xd8ce('0x3c')}]})[_0xd8ce('0x1e')](function(_0x37f420){var _0x299afa=_0x5231cc[_0xd8ce('0x74')][_0xd8ce('0x7c')]({'plain':!![]});if(!_0x299afa)throw new Error(_0xd8ce('0x7d'));if(_0x299afa['role']==='user'){var _0x49c2b8=_0x37f420['get']({'plain':!![]});return db[_0xd8ce('0x7e')][_0xd8ce('0x67')]({'where':{'name':_0xd8ce('0x36'),'userProfileId':_0x299afa[_0xd8ce('0x7f')]},'raw':!![]})[_0xd8ce('0x1e')](function(_0x3f360a){if(_0x3f360a&&_0x3f360a[_0xd8ce('0x80')]===0x0){return db[_0xd8ce('0x81')][_0xd8ce('0x62')]({'name':_0x49c2b8[_0xd8ce('0x46')],'resourceId':_0x49c2b8['id'],'type':_0x3f360a[_0xd8ce('0x46')],'sectionId':_0x3f360a['id']},{})[_0xd8ce('0x1e')](function(){return _0x37f420;});}else{return _0x37f420;}})[_0xd8ce('0x27')](function(_0x2e0aeb){logger[_0xd8ce('0x23')](_0xd8ce('0x82'),_0x2e0aeb);throw _0x2e0aeb;});}return _0x37f420;})[_0xd8ce('0x1e')](respondWithResult(_0x1bd82f,0xc9))[_0xd8ce('0x27')](handleError(_0x1bd82f,null));};exports[_0xd8ce('0x83')]=function(_0x500960,_0x4720d6,_0x56a151){return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x500960[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x4720d6,null))[_0xd8ce('0x1e')](function(_0x1a9aa1){if(_0x1a9aa1){return _0x1a9aa1[_0xd8ce('0x83')]();}return null;})[_0xd8ce('0x1e')](respondWithResult(_0x4720d6,null))[_0xd8ce('0x27')](handleError(_0x4720d6,null));};exports[_0xd8ce('0x85')]=function(_0x11dff6,_0x2c8c63,_0x2ffcb9){if(_0x11dff6[_0xd8ce('0x5b')]['id']){delete _0x11dff6[_0xd8ce('0x5b')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x11dff6[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x2c8c63,null))[_0xd8ce('0x1e')](function(_0x272a5e){if(_0x272a5e){_0x11dff6['body'][_0xd8ce('0x60')]=_0x272a5e['id'];return db[_0xd8ce('0x3b')][_0xd8ce('0x62')](_0x11dff6[_0xd8ce('0x5b')]);}})['then'](respondWithResult(_0x2c8c63,null))[_0xd8ce('0x27')](handleError(_0x2c8c63,null));};exports[_0xd8ce('0x86')]=function(_0x72df9a,_0x48ae56,_0x51a534){return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x72df9a[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x48ae56,null))[_0xd8ce('0x1e')](function(_0x56062d){if(_0x56062d){return _0x56062d['setImap'](null);}return null;})[_0xd8ce('0x1e')](respondWithStatusCode(_0x48ae56,null))[_0xd8ce('0x27')](handleError(_0x48ae56,null));};exports[_0xd8ce('0x87')]=function(_0x7fc7cb,_0x33e507,_0x4d2ed5){return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x7fc7cb['params']['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x33e507,null))[_0xd8ce('0x1e')](function(_0x5b05a7){if(_0x5b05a7){return _0x5b05a7['getSmtp']();}return null;})[_0xd8ce('0x1e')](respondWithResult(_0x33e507,null))[_0xd8ce('0x27')](handleError(_0x33e507,null));};exports['addSmtp']=function(_0x4a1d87,_0x16ef09,_0x5c3248){if(_0x4a1d87[_0xd8ce('0x5b')]['id']){delete _0x4a1d87[_0xd8ce('0x5b')]['id'];}return db[_0xd8ce('0x41')][_0xd8ce('0x67')]({'where':{'id':_0x4a1d87[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x16ef09,null))[_0xd8ce('0x1e')](function(_0x5b674c){if(_0x5b674c){_0x4a1d87['body'][_0xd8ce('0x60')]=_0x5b674c['id'];return db[_0xd8ce('0x3d')][_0xd8ce('0x62')](_0x4a1d87[_0xd8ce('0x5b')]);}})['then'](respondWithResult(_0x16ef09,null))[_0xd8ce('0x27')](handleError(_0x16ef09,null));};exports['removeSmtp']=function(_0x2d0fc6,_0x5896ba,_0x2301aa){return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x2d0fc6['params']['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x5896ba,null))[_0xd8ce('0x1e')](function(_0x561d62){if(_0x561d62){return _0x561d62[_0xd8ce('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x5896ba,null))[_0xd8ce('0x27')](handleError(_0x5896ba,null));};exports[_0xd8ce('0x89')]=function(_0x172adf,_0x2f5fc9,_0x179b8e){return db['MailInteraction'][_0xd8ce('0x67')]({'where':{'id':_0x172adf[_0xd8ce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f5fc9,null))[_0xd8ce('0x1e')](function(_0x10edf8){if(_0x10edf8){return _0x10edf8[_0xd8ce('0x89')](_0x172adf[_0xd8ce('0x5b')]['ids'],_['omit'](_0x172adf[_0xd8ce('0x5b')],[_0xd8ce('0x68'),'id'])||{});}})[_0xd8ce('0x1e')](respondWithResult(_0x2f5fc9,null))[_0xd8ce('0x27')](handleError(_0x2f5fc9,null));};exports[_0xd8ce('0x8a')]=function(_0x376318,_0x122c3e,_0x536cf8){var _0x278c0a={'raw':![],'where':{}};var _0x66626e={};var _0x200869={'count':0x0,'rows':[]};return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x376318[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x122c3e,null))[_0xd8ce('0x1e')](function(_0x1be5cd){if(_0x1be5cd){_0x66626e[_0xd8ce('0x45')]=_[_0xd8ce('0x48')](db['MailInteraction'][_0xd8ce('0x42')]);_0x66626e[_0xd8ce('0x47')]=_['keys'](_0x376318[_0xd8ce('0x47')]);_0x66626e[_0xd8ce('0x50')]=_[_0xd8ce('0x49')](_0x66626e['model'],_0x66626e['query']);_0x278c0a[_0xd8ce('0x4a')]=_[_0xd8ce('0x49')](_0x66626e[_0xd8ce('0x45')],qs['fields'](_0x376318[_0xd8ce('0x47')][_0xd8ce('0x4b')]));_0x278c0a[_0xd8ce('0x4a')]=_0x278c0a[_0xd8ce('0x4a')][_0xd8ce('0x5a')]?_0x278c0a[_0xd8ce('0x4a')]:_0x66626e['model'];if(!_0x376318[_0xd8ce('0x47')][_0xd8ce('0x64')]('nolimit')){_0x278c0a[_0xd8ce('0x2d')]=qs[_0xd8ce('0x2d')](_0x376318[_0xd8ce('0x47')][_0xd8ce('0x2d')]);_0x278c0a[_0xd8ce('0x2b')]=qs[_0xd8ce('0x2b')](_0x376318[_0xd8ce('0x47')]['offset']);}_0x278c0a[_0xd8ce('0x4d')]=qs[_0xd8ce('0x4e')](_0x376318[_0xd8ce('0x47')][_0xd8ce('0x4e')]);_0x278c0a['where']=qs[_0xd8ce('0x50')](_[_0xd8ce('0x51')](_0x376318[_0xd8ce('0x47')],_0x66626e[_0xd8ce('0x50')]));_0x278c0a[_0xd8ce('0x4f')][_0xd8ce('0x60')]=_0x1be5cd['id'];if(_0x376318[_0xd8ce('0x47')][_0xd8ce('0x52')]){_0x278c0a['where']=_['merge'](_0x278c0a[_0xd8ce('0x4f')],{'$or':_[_0xd8ce('0x40')](_0x278c0a[_0xd8ce('0x4a')],function(_0x4c1fe5){var _0x6f8315={};_0x6f8315[_0x4c1fe5]={'$like':'%'+_0x376318[_0xd8ce('0x47')][_0xd8ce('0x52')]+'%'};return _0x6f8315;})});}_0x278c0a=_[_0xd8ce('0x53')]({},_0x278c0a,_0x376318[_0xd8ce('0x55')]);return db['MailInteraction'][_0xd8ce('0x2e')]({'where':_0x278c0a[_0xd8ce('0x4f')]})[_0xd8ce('0x1e')](function(_0x1e3cee){_0x200869[_0xd8ce('0x2e')]=_0x1e3cee;if(_0x376318[_0xd8ce('0x47')][_0xd8ce('0x56')]){_0x278c0a[_0xd8ce('0x65')]=[{'model':db[_0xd8ce('0x8b')],'as':_0xd8ce('0x8c'),'required':![]},{'model':db[_0xd8ce('0x8d')],'as':_0xd8ce('0x8e'),'attributes':[_0xd8ce('0x46'),'fullname',_0xd8ce('0x8f')],'required':![]},{'model':db[_0xd8ce('0x90')],'as':_0xd8ce('0x91'),'attributes':['id',_0xd8ce('0x46'),_0xd8ce('0x92')],'where':_0x376318[_0xd8ce('0x47')][_0xd8ce('0x93')]?{'id':_0x376318[_0xd8ce('0x47')]['tag']}:undefined,'required':_0x376318[_0xd8ce('0x47')][_0xd8ce('0x93')]?!![]:![]}];}return db['MailInteraction'][_0xd8ce('0x57')](_0x278c0a);})[_0xd8ce('0x1e')](function(_0x2a637d){_0x200869['rows']=_0x2a637d;return _0x200869;});}})[_0xd8ce('0x1e')](respondWithFilteredResult(_0x122c3e,_0x278c0a))[_0xd8ce('0x27')](handleError(_0x122c3e,null));};exports[_0xd8ce('0x94')]=function(_0x2282ea,_0x6bd304,_0x5e389d){return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x2282ea[_0xd8ce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x6bd304,null))[_0xd8ce('0x1e')](function(_0x161ef0){if(_0x161ef0){return db[_0xd8ce('0x95')][_0xd8ce('0x96')](function(_0x563d05){return db[_0xd8ce('0x97')][_0xd8ce('0x35')]({'where':{'MailAccountId':_0x2282ea[_0xd8ce('0x5c')]['id']},'transaction':_0x563d05})[_0xd8ce('0x1e')](function(_0x4ed058){var _0x4af91d=_[_0xd8ce('0x40')](_0x2282ea[_0xd8ce('0x5b')],function(_0x5aabfd){_0x5aabfd[_0xd8ce('0x60')]=_0x2282ea[_0xd8ce('0x5c')]['id'];return _0x5aabfd;});return db[_0xd8ce('0x97')][_0xd8ce('0x98')](_0x4af91d,{'transaction':_0x563d05});});})[_0xd8ce('0x1e')](function(){return db[_0xd8ce('0x97')][_0xd8ce('0x99')]({'where':{'MailAccountId':_0x2282ea['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x6bd304,null))[_0xd8ce('0x27')](handleError(_0x6bd304,null));};exports[_0xd8ce('0x9a')]=function(_0x514c66,_0x103e6a,_0x3aa369){var _0xe047b0={};var _0x1bfccf={};var _0xa92547;var _0x485571;return db[_0xd8ce('0x41')]['findOne']({'where':{'id':_0x514c66['params']['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x103e6a,null))[_0xd8ce('0x1e')](function(_0x28552d){if(_0x28552d){_0xa92547=_0x28552d;_0x1bfccf[_0xd8ce('0x45')]=_['keys'](db['MailApplication']['rawAttributes']);_0x1bfccf[_0xd8ce('0x47')]=_[_0xd8ce('0x48')](_0x514c66['query']);_0x1bfccf['filters']=_[_0xd8ce('0x49')](_0x1bfccf[_0xd8ce('0x45')],_0x1bfccf[_0xd8ce('0x47')]);_0xe047b0[_0xd8ce('0x4a')]=_[_0xd8ce('0x49')](_0x1bfccf[_0xd8ce('0x45')],qs[_0xd8ce('0x4b')](_0x514c66[_0xd8ce('0x47')][_0xd8ce('0x4b')]));_0xe047b0[_0xd8ce('0x4a')]=_0xe047b0[_0xd8ce('0x4a')][_0xd8ce('0x5a')]?_0xe047b0[_0xd8ce('0x4a')]:_0x1bfccf[_0xd8ce('0x45')];_0xe047b0[_0xd8ce('0x4d')]=qs['sort'](_0x514c66[_0xd8ce('0x47')][_0xd8ce('0x4e')]);_0xe047b0[_0xd8ce('0x4f')]=qs['filters'](_[_0xd8ce('0x51')](_0x514c66[_0xd8ce('0x47')],_0x1bfccf[_0xd8ce('0x50')]));if(_0x514c66[_0xd8ce('0x47')]['filter']){_0xe047b0['where']=_[_0xd8ce('0x53')](_0xe047b0['where'],{'$or':_['map'](_0xe047b0[_0xd8ce('0x4a')],function(_0x261d4a){var _0x31a84d={};_0x31a84d[_0x261d4a]={'$like':'%'+_0x514c66[_0xd8ce('0x47')]['filter']+'%'};return _0x31a84d;})});}_0xe047b0=_[_0xd8ce('0x53')]({},_0xe047b0,_0x514c66[_0xd8ce('0x55')]);return _0xa92547[_0xd8ce('0x9a')](_0xe047b0);}})['then'](function(_0x2cfe3b){if(_0x2cfe3b){_0x485571=_0x2cfe3b[_0xd8ce('0x5a')];if(!_0x514c66[_0xd8ce('0x47')][_0xd8ce('0x64')](_0xd8ce('0x4c'))){_0xe047b0[_0xd8ce('0x2d')]=qs[_0xd8ce('0x2d')](_0x514c66['query'][_0xd8ce('0x2d')]);_0xe047b0[_0xd8ce('0x2b')]=qs[_0xd8ce('0x2b')](_0x514c66[_0xd8ce('0x47')][_0xd8ce('0x2b')]);}return _0xa92547['getApplications'](_0xe047b0);}})['then'](function(_0x5f0d54){if(_0x5f0d54){return _0x5f0d54?{'count':_0x485571,'rows':_0x5f0d54}:null;}})['then'](respondWithResult(_0x103e6a,null))['catch'](handleError(_0x103e6a,null));};exports[_0xd8ce('0x9b')]=function(_0x162d39,_0x13cedb,_0x45960c){var _0x56cbeb={'raw':!![],'where':{}};var _0x140637={};var _0x529ccc={'count':0x0,'rows':[]};return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x162d39[_0xd8ce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x13cedb,null))[_0xd8ce('0x1e')](function(_0xba0d99){if(_0xba0d99){_0x140637[_0xd8ce('0x45')]=_[_0xd8ce('0x48')](db['MailMessage']['rawAttributes']);_0x140637[_0xd8ce('0x47')]=_[_0xd8ce('0x48')](_0x162d39[_0xd8ce('0x47')]);_0x140637[_0xd8ce('0x50')]=_[_0xd8ce('0x49')](_0x140637[_0xd8ce('0x45')],_0x140637[_0xd8ce('0x47')]);_0x56cbeb['attributes']=_[_0xd8ce('0x49')](_0x140637[_0xd8ce('0x45')],qs[_0xd8ce('0x4b')](_0x162d39[_0xd8ce('0x47')][_0xd8ce('0x4b')]));_0x56cbeb[_0xd8ce('0x4a')]=_0x56cbeb['attributes'][_0xd8ce('0x5a')]?_0x56cbeb[_0xd8ce('0x4a')]:_0x140637['model'];if(!_0x162d39[_0xd8ce('0x47')]['hasOwnProperty'](_0xd8ce('0x4c'))){_0x56cbeb[_0xd8ce('0x2d')]=qs['limit'](_0x162d39['query'][_0xd8ce('0x2d')]);_0x56cbeb['offset']=qs['offset'](_0x162d39[_0xd8ce('0x47')][_0xd8ce('0x2b')]);}_0x56cbeb['order']=qs[_0xd8ce('0x4e')](_0x162d39[_0xd8ce('0x47')][_0xd8ce('0x4e')]);_0x56cbeb[_0xd8ce('0x4f')]=qs['filters'](_['pick'](_0x162d39[_0xd8ce('0x47')],_0x140637[_0xd8ce('0x50')]));_0x56cbeb[_0xd8ce('0x4f')]['MailAccountId']=_0xba0d99['id'];if(_0x162d39[_0xd8ce('0x47')]['filter']){_0x56cbeb[_0xd8ce('0x4f')]=_['merge'](_0x56cbeb[_0xd8ce('0x4f')],{'$or':_[_0xd8ce('0x40')](_0x56cbeb[_0xd8ce('0x4a')],function(_0x5c0619){var _0x239b8={};_0x239b8[_0x5c0619]={'$like':'%'+_0x162d39['query'][_0xd8ce('0x52')]+'%'};return _0x239b8;})});}if(_0x162d39[_0xd8ce('0x47')][_0xd8ce('0x9c')]){var _0x5d2cc6=_0x162d39[_0xd8ce('0x47')][_0xd8ce('0x9c')]['split'](',');var _0x498c72={};_0x498c72[_0x5d2cc6[0x0]]={'$gte':moment(_0x5d2cc6[0x1])[_0xd8ce('0x9d')](_0xd8ce('0x9e'))};_0x56cbeb[_0xd8ce('0x4f')]=_[_0xd8ce('0x53')](_0x56cbeb[_0xd8ce('0x4f')],_0x498c72);}_0x56cbeb=_[_0xd8ce('0x53')]({},_0x56cbeb,_0x162d39[_0xd8ce('0x55')]);return db[_0xd8ce('0x9f')][_0xd8ce('0x2e')]({'where':_0x56cbeb['where']})['then'](function(_0x4a5dc4){_0x529ccc[_0xd8ce('0x2e')]=_0x4a5dc4;if(_0x162d39[_0xd8ce('0x47')]['includeAll']){_0x56cbeb['include']=[{'all':!![]}];}return db[_0xd8ce('0x9f')][_0xd8ce('0x57')](_0x56cbeb);})[_0xd8ce('0x1e')](function(_0x11e373){if(_0x162d39[_0xd8ce('0x47')][_0xd8ce('0xa0')]===_0xd8ce('0xa1')){for(var _0x3a8d6d=0x0;_0x3a8d6d<_0x11e373['length'];_0x3a8d6d++){_0x11e373[_0x3a8d6d][_0xd8ce('0x5b')]=juice(_0x11e373[_0x3a8d6d][_0xd8ce('0x5b')]);}}_0x529ccc[_0xd8ce('0x58')]=_0x11e373;return _0x529ccc;});}})[_0xd8ce('0x1e')](respondWithFilteredResult(_0x13cedb,_0x56cbeb))[_0xd8ce('0x27')](handleError(_0x13cedb,null));};exports['send']=function(_0x4a1da2,_0x154a46,_0x4421c1){var _0x2bba7b,_0x14e1a2={},_0x36cf70;if(_0x4a1da2[_0xd8ce('0x5b')]['to']){_0x36cf70=_0x4a1da2[_0xd8ce('0x5b')]['to']['split'](',')[0x0];}return db[_0xd8ce('0x41')][_0xd8ce('0x67')]({'where':{'id':_0x4a1da2[_0xd8ce('0x5c')]['id']},'include':[{'model':db[_0xd8ce('0xa2')],'as':_0xd8ce('0xa3'),'include':[{'model':db[_0xd8ce('0x8b')],'as':_0xd8ce('0xa4'),'where':{'email':_0x36cf70},'limit':0x1,'order':[[_0xd8ce('0xa5'),'DESC']]}]},{'model':db[_0xd8ce('0x3d')],'as':'Smtp','raw':!![]}]})[_0xd8ce('0x1e')](handleEntityNotFound(_0x154a46,null))[_0xd8ce('0x1e')](function(_0xa71a95){if(_0xa71a95){_0x2bba7b=_0xa71a95;if(_0xa71a95[_0xd8ce('0x3e')]){if(_['isNil'](_0x4a1da2['body'][_0xd8ce('0xa6')])){_0x4a1da2[_0xd8ce('0x5b')]['from']=util[_0xd8ce('0x9d')](_0xd8ce('0xa7'),_0xa71a95['name'],_0xa71a95[_0xd8ce('0x6e')]||_0xa71a95[_0xd8ce('0x3e')][_0xd8ce('0x74')]);}if(_0x4a1da2[_0xd8ce('0x5b')]['attachments']&&_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xa8')][_0xd8ce('0x5a')]){for(var _0x459737=0x0;_0x459737<_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xa8')][_0xd8ce('0x5a')];_0x459737+=0x1){_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xa8')][_0x459737]={'filename':_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xa8')][_0x459737][_0xd8ce('0x46')],'path':path[_0xd8ce('0xa9')](config[_0xd8ce('0xaa')],_0xd8ce('0xab'),_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xa8')][_0x459737][_0xd8ce('0xac')])};}}var _0x20f01c={'tls':{'rejectUnauthorized':![]}};if(_[_0xd8ce('0x6f')](_0xa71a95['Smtp'][_0xd8ce('0x7b')])){if(_0xa71a95[_0xd8ce('0x3e')][_0xd8ce('0x78')]){_0x20f01c[_0xd8ce('0xad')]={'user':_0xa71a95[_0xd8ce('0x3e')][_0xd8ce('0x74')],'pass':_0xa71a95['Smtp']['pass']};}_0x20f01c[_0xd8ce('0x7a')]=_0xa71a95[_0xd8ce('0x3e')][_0xd8ce('0x7a')];_0x20f01c['port']=_0xa71a95['Smtp'][_0xd8ce('0x79')];_0x20f01c[_0xd8ce('0xae')]=_0xa71a95[_0xd8ce('0x3e')]['secure'];}else{_0x20f01c[_0xd8ce('0x7b')]=_0xa71a95['Smtp']['service'];_0x20f01c[_0xd8ce('0xad')]={'user':_0xa71a95['Smtp'][_0xd8ce('0x74')],'pass':_0xa71a95['Smtp'][_0xd8ce('0x76')]};}return respondWithRpcPromise('SendMail',_0xd8ce('0xaf'),{'account':_0x20f01c,'message':_0x4a1da2[_0xd8ce('0x5b')]});}else{throw new Error('List\x20not\x20found');}}})[_0xd8ce('0x1e')](function(_0x295fe3){if(_0x295fe3){_0x14e1a2=_0x295fe3;if(_0x2bba7b['List']){if(_0x2bba7b[_0xd8ce('0xa3')]['Contacts'][_0xd8ce('0x5a')]){return _0x2bba7b[_0xd8ce('0xa3')][_0xd8ce('0xa4')][0x0];}else{return db[_0xd8ce('0x8b')][_0xd8ce('0x62')](_[_0xd8ce('0x18')](_0x4a1da2[_0xd8ce('0x5b')],{'firstName':_0x4a1da2[_0xd8ce('0x5b')]['to'],'email':_0x4a1da2['body']['to'],'phone':_0x4a1da2[_0xd8ce('0x5b')]['to'],'ListId':_0x2bba7b[_0xd8ce('0xb0')]}));}}else{throw new Error(_0xd8ce('0xb1'));}}})[_0xd8ce('0x1e')](function(_0x10e56e){if(_0x10e56e){var _0x32a2cd={'UserId':_0x4a1da2[_0xd8ce('0x74')]['id'],'ContactId':_0x10e56e['id'],'MailAccountId':_0x2bba7b['id'],'inReplyTo':_0x14e1a2[_0xd8ce('0xb2')],'to':_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xa6')],'cc':_0x4a1da2[_0xd8ce('0x5b')]['cc'],'subject':_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xb3')],'attach':_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xb4')],'firstMsgDirection':_0xd8ce('0xb5'),'lastMsgAt':moment()[_0xd8ce('0x9d')](_0xd8ce('0x9e')),'lastMsgDirection':_0xd8ce('0xb5'),'Messages':[_[_0xd8ce('0x53')](_0x4a1da2['body'],{'messageId':_0x14e1a2[_0xd8ce('0xb2')],'sentAt':moment()[_0xd8ce('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2bba7b['id'],'UserId':_0x4a1da2[_0xd8ce('0x74')]['id'],'ContactId':_0x10e56e['id']})]};if(_0x4a1da2[_0xd8ce('0x5b')][_0xd8ce('0xb6')]){_0x32a2cd=_[_0xd8ce('0x53')](_0x32a2cd,_0x4a1da2['body'][_0xd8ce('0xb6')]);}return db['MailInteraction']['create'](_0x32a2cd,{'include':[{'model':db[_0xd8ce('0x9f')],'as':'Messages'}]});}})['then'](respondWithResult(_0x154a46,null))[_0xd8ce('0x27')](handleError(_0x154a46,null));};exports[_0xd8ce('0xb7')]=function(_0xa3e271,_0x42aa59,_0xd81f73){return db[_0xd8ce('0x41')][_0xd8ce('0x67')]({'where':{'id':_0xa3e271[_0xd8ce('0x5c')]['id']},'include':[{'model':db[_0xd8ce('0x3d')],'as':_0xd8ce('0x3e'),'raw':!![]}]})[_0xd8ce('0x1e')](handleEntityNotFound(_0x42aa59,null))[_0xd8ce('0x1e')](function(_0x38ab04){if(_0x38ab04&&_0x38ab04[_0xd8ce('0x3e')]){var _0x1d9bba={'id':_0x38ab04['id'],'tls':{'rejectUnauthorized':![]}};if(_0x38ab04['Smtp']['service']){_0x1d9bba['service']=_0x38ab04['Smtp']['service'];}else{_0x1d9bba[_0xd8ce('0x7a')]=_0x38ab04[_0xd8ce('0x3e')]['host'];_0x1d9bba[_0xd8ce('0x79')]=_0x38ab04[_0xd8ce('0x3e')]['port'];_0x1d9bba['secure']=_0x38ab04[_0xd8ce('0x3e')]['secure'];}if(_0x38ab04[_0xd8ce('0x3e')][_0xd8ce('0x78')]){_0x1d9bba[_0xd8ce('0xad')]={'user':_0x38ab04[_0xd8ce('0x3e')]['user'],'pass':_0x38ab04['Smtp'][_0xd8ce('0x76')]};}return respondWithRpcPromise(_0xd8ce('0xb8'),_0xd8ce('0xb7'),{'account':_0x1d9bba});}})[_0xd8ce('0x1e')](respondWithResult(_0x42aa59,null))[_0xd8ce('0x27')](handleError(_0x42aa59,null));};exports['destroy']=function(_0x38e69f,_0x12044a){return db[_0xd8ce('0x41')][_0xd8ce('0x67')]({'where':{'id':_0x38e69f['params']['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x12044a,null))['then'](function(_0x5c4b25){if(_0x5c4b25&&_0x5c4b25[_0xd8ce('0x7b')]){throw new db[(_0xd8ce('0xb9'))]['ValidationError'](_0xd8ce('0xba'));}return _0x5c4b25;})[_0xd8ce('0x1e')](removeEntity(_0x12044a,null))[_0xd8ce('0x27')](handleError(_0x12044a,null));};exports[_0xd8ce('0xbb')]=function(_0x5c76a1,_0x3f4154,_0x3ef1ae){return db['MailAccount'][_0xd8ce('0x67')]({'where':{'id':_0x5c76a1[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x3f4154,null))[_0xd8ce('0x1e')](function(_0x2f7654){if(_0x2f7654){return _0x2f7654['addAgents'](_0x5c76a1[_0xd8ce('0x5b')][_0xd8ce('0x68')],_['omit'](_0x5c76a1['body'],[_0xd8ce('0x68'),'id'])||{})[_0xd8ce('0xbc')](function(_0x6edbeb){for(var _0x188595=0x0;_0x188595<_0x5c76a1['body'][_0xd8ce('0x68')][_0xd8ce('0x5a')];_0x188595+=0x1){socket[_0xd8ce('0xbd')](_0xd8ce('0xbe'),{'UserId':Number(_0x5c76a1[_0xd8ce('0x5b')][_0xd8ce('0x68')][_0x188595]),'MailAccountId':Number(_0x5c76a1[_0xd8ce('0x5c')]['id'])});}return _0x6edbeb;});}})[_0xd8ce('0x1e')](respondWithResult(_0x3f4154,null))[_0xd8ce('0x27')](handleError(_0x3f4154,null));};exports['removeAgents']=function(_0x517c36,_0x221344,_0x5680e2){return db[_0xd8ce('0x41')]['find']({'where':{'id':_0x517c36[_0xd8ce('0x5c')]['id']}})[_0xd8ce('0x1e')](handleEntityNotFound(_0x221344,null))[_0xd8ce('0x1e')](function(_0x2f5a7a){if(_0x2f5a7a){return _0x2f5a7a['removeAgents'](_0x517c36[_0xd8ce('0x47')][_0xd8ce('0x68')])['then'](function(){if(_[_0xd8ce('0xbf')](_0x517c36[_0xd8ce('0x47')][_0xd8ce('0x68')])){for(var _0x2ebe60=0x0;_0x2ebe60<_0x517c36[_0xd8ce('0x47')]['ids'][_0xd8ce('0x5a')];_0x2ebe60+=0x1){socket[_0xd8ce('0xbd')](_0xd8ce('0xc0'),{'UserId':Number(_0x517c36['query']['ids'][_0x2ebe60]),'MailAccountId':Number(_0x517c36[_0xd8ce('0x5c')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x517c36[_0xd8ce('0x47')][_0xd8ce('0x68')]),'MailAccountId':Number(_0x517c36[_0xd8ce('0x5c')]['id'])});}});}})[_0xd8ce('0x1e')](respondWithStatusCode(_0x221344,null))[_0xd8ce('0x27')](handleError(_0x221344,null));};exports[_0xd8ce('0xc1')]=function(_0x336bee,_0x26c1e8,_0x58d705){var _0x41837d={};var _0x493bea={};var _0x4189ac;var _0x5e21dd;return db[_0xd8ce('0x41')][_0xd8ce('0x84')]({'where':{'id':_0x336bee[_0xd8ce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x26c1e8,null))[_0xd8ce('0x1e')](function(_0x1e32c4){if(_0x1e32c4){_0x4189ac=_0x1e32c4;_0x493bea[_0xd8ce('0x45')]=_[_0xd8ce('0x48')](db[_0xd8ce('0x8d')][_0xd8ce('0x42')]);_0x493bea[_0xd8ce('0x47')]=_[_0xd8ce('0x48')](_0x336bee['query']);_0x493bea[_0xd8ce('0x50')]=_[_0xd8ce('0x49')](_0x493bea['model'],_0x493bea[_0xd8ce('0x47')]);_0x41837d[_0xd8ce('0x4a')]=_[_0xd8ce('0x49')](_0x493bea[_0xd8ce('0x45')],qs[_0xd8ce('0x4b')](_0x336bee[_0xd8ce('0x47')][_0xd8ce('0x4b')]));_0x41837d[_0xd8ce('0x4a')]=_0x41837d[_0xd8ce('0x4a')]['length']?_0x41837d[_0xd8ce('0x4a')]:_0x493bea['model'];_0x41837d[_0xd8ce('0x4d')]=qs[_0xd8ce('0x4e')](_0x336bee[_0xd8ce('0x47')]['sort']);_0x41837d[_0xd8ce('0x4f')]=qs[_0xd8ce('0x50')](_[_0xd8ce('0x51')](_0x336bee[_0xd8ce('0x47')],_0x493bea[_0xd8ce('0x50')]));if(_0x336bee[_0xd8ce('0x47')][_0xd8ce('0x52')]){_0x41837d[_0xd8ce('0x4f')]=_[_0xd8ce('0x53')](_0x41837d[_0xd8ce('0x4f')],{'$or':_[_0xd8ce('0x40')](_0x41837d[_0xd8ce('0x4a')],function(_0x2cd5e9){var _0x232371={};_0x232371[_0x2cd5e9]={'$like':'%'+_0x336bee['query']['filter']+'%'};return _0x232371;})});}_0x41837d=_['merge']({},_0x41837d,_0x336bee[_0xd8ce('0x55')]);return _0x4189ac[_0xd8ce('0xc1')](_0x41837d);}})[_0xd8ce('0x1e')](function(_0x3c6a09){if(_0x3c6a09){_0x5e21dd=_0x3c6a09['length'];if(!_0x336bee[_0xd8ce('0x47')]['hasOwnProperty'](_0xd8ce('0x4c'))){_0x41837d[_0xd8ce('0x2d')]=qs[_0xd8ce('0x2d')](_0x336bee[_0xd8ce('0x47')][_0xd8ce('0x2d')]);_0x41837d[_0xd8ce('0x2b')]=qs['offset'](_0x336bee[_0xd8ce('0x47')][_0xd8ce('0x2b')]);}return _0x4189ac[_0xd8ce('0xc1')](_0x41837d);}})[_0xd8ce('0x1e')](function(_0x4e0bd9){if(_0x4e0bd9){return _0x4e0bd9?{'count':_0x5e21dd,'rows':_0x4e0bd9}:null;}})['then'](respondWithResult(_0x26c1e8,null))[_0xd8ce('0x27')](handleError(_0x26c1e8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 6e4dbdf..24b7fc9 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 _0xe585=['exports','events','MailAccount','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xbf698b,_0x2bfdfb){var _0x250e0d=function(_0x27febe){while(--_0x27febe){_0xbf698b['push'](_0xbf698b['shift']());}};_0x250e0d(++_0x2bfdfb);}(_0xe585,0x9a));var _0x5e58=function(_0x41f878,_0x33db90){_0x41f878=_0x41f878-0x0;var _0x38c421=_0xe585[_0x41f878];return _0x38c421;};'use strict';var EventEmitter=require(_0x5e58('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x5e58('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e58('0x2'),'afterUpdate':_0x5e58('0x3'),'afterDestroy':_0x5e58('0x4')};function emitEvent(_0xa30ab8){return function(_0x2bb284,_0x12797c,_0xa1e973){MailAccountEvents['emit'](_0xa30ab8+':'+_0x2bb284['id'],_0x2bb284);MailAccountEvents[_0x5e58('0x5')](_0xa30ab8,_0x2bb284);_0xa1e973(null);};}for(var e in events){if(events[_0x5e58('0x6')](e)){var event=events[e];MailAccount[_0x5e58('0x7')](e,emitEvent(event));}}module[_0x5e58('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xe091=['../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x247fe1,_0x46cec4){var _0x217740=function(_0x1a01c9){while(--_0x1a01c9){_0x247fe1['push'](_0x247fe1['shift']());}};_0x217740(++_0x46cec4);}(_0xe091,0x1ad));var _0x1e09=function(_0x45f1b3,_0x2300fa){_0x45f1b3=_0x45f1b3-0x0;var _0x5744d6=_0xe091[_0x45f1b3];return _0x5744d6;};'use strict';var EventEmitter=require(_0x1e09('0x0'));var MailAccount=require(_0x1e09('0x1'))['db'][_0x1e09('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e09('0x3'),'afterUpdate':_0x1e09('0x4'),'afterDestroy':_0x1e09('0x5')};function emitEvent(_0x4e0879){return function(_0x1a43af,_0x110900,_0x1d9cc4){MailAccountEvents[_0x1e09('0x6')](_0x4e0879+':'+_0x1a43af['id'],_0x1a43af);MailAccountEvents[_0x1e09('0x6')](_0x4e0879,_0x1a43af);_0x1d9cc4(null);};}for(var e in events){if(events[_0x1e09('0x7')](e)){var event=events[e];MailAccount[_0x1e09('0x8')](e,emitEvent(event));}}module[_0x1e09('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cf6a2a2..f551265 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 _0x7a94=['exports','define','MailAccount','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0x7a94,0x1d1));var _0x47a9=function(_0x4b86c9,_0x5d2422){_0x4b86c9=_0x4b86c9-0x0;var _0x4991a3=_0x7a94[_0x4b86c9];return _0x4991a3;};'use strict';var _=require('lodash');var util=require(_0x47a9('0x0'));var logger=require(_0x47a9('0x1'))('api');var moment=require(_0x47a9('0x2'));var BPromise=require(_0x47a9('0x3'));var rp=require(_0x47a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47a9('0x5'));var config=require(_0x47a9('0x6'));var attributes=require(_0x47a9('0x7'));module[_0x47a9('0x8')]=function(_0x1fbacf,_0x5073f9){return _0x1fbacf[_0x47a9('0x9')](_0x47a9('0xa'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f39=['bluebird','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash','util','api','moment'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x9f39,0xd8));var _0x99f3=function(_0x16351c,_0x56e09a){_0x16351c=_0x16351c-0x0;var _0x52efc2=_0x9f39[_0x16351c];return _0x52efc2;};'use strict';var _=require(_0x99f3('0x0'));var util=require(_0x99f3('0x1'));var logger=require('../../config/logger')(_0x99f3('0x2'));var moment=require(_0x99f3('0x3'));var BPromise=require(_0x99f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x99f3('0x5'));var config=require(_0x99f3('0x6'));var attributes=require(_0x99f3('0x7'));module[_0x99f3('0x8')]=function(_0x504afe,_0x3d6ead){return _0x504afe[_0x99f3('0x9')](_0x99f3('0xa'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index b26504d..a26597f 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 _0x1383=['limit','include','map','model','then','info','catch','ShowMailAccount','find','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','priority','autoclose','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','interaction','created','MailMessage','attachments','originTo','bcc','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes'];(function(_0x2207ea,_0x16690b){var _0x2d04a6=function(_0x564d6c){while(--_0x564d6c){_0x2207ea['push'](_0x2207ea['shift']());}};_0x2d04a6(++_0x16690b);}(_0x1383,0x1c7));var _0x3138=function(_0xc7f601,_0x2f5ed5){_0xc7f601=_0xc7f601-0x0;var _0x57f083=_0x1383[_0xc7f601];return _0x57f083;};'use strict';var _=require(_0x3138('0x0'));var util=require('util');var moment=require(_0x3138('0x1'));var BPromise=require(_0x3138('0x2'));var rs=require(_0x3138('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3138('0x4'))['db'];var utils=require(_0x3138('0x5'));var logger=require(_0x3138('0x6'))(_0x3138('0x7'));var config=require(_0x3138('0x8'));var jayson=require(_0x3138('0x9'));var client=jayson['client'][_0x3138('0xa')]({'port':0x232c});config[_0x3138('0xb')]=_[_0x3138('0xc')](config[_0x3138('0xb')],{'host':_0x3138('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3138('0xb')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3833b4,_0x541c94,_0x260fae){return new BPromise(function(_0x265eed,_0x5a3772){return client[_0x3138('0xe')](_0x3833b4,_0x260fae)['then'](function(_0x201b44){logger['info'](_0x3138('0xf'),_0x541c94,'request\x20sent');logger[_0x3138('0x10')](_0x3138('0x11'),_0x541c94,_0x3138('0x12'),JSON[_0x3138('0x13')](_0x201b44));if(_0x201b44['error']){if(_0x201b44[_0x3138('0x14')]['code']===0x1f4){logger[_0x3138('0x14')](_0x3138('0xf'),_0x541c94,_0x201b44[_0x3138('0x14')][_0x3138('0x15')]);return _0x5a3772(_0x201b44[_0x3138('0x14')]['message']);}logger[_0x3138('0x14')](_0x3138('0xf'),_0x541c94,_0x201b44['error'][_0x3138('0x15')]);return _0x265eed(_0x201b44[_0x3138('0x14')]['message']);}else{logger['info'](_0x3138('0xf'),_0x541c94,_0x3138('0x12'));_0x265eed(_0x201b44[_0x3138('0x16')]['message']);}})['catch'](function(_0x3a2014){logger[_0x3138('0x14')](_0x3138('0xf'),_0x541c94,_0x3a2014);_0x5a3772(_0x3a2014);});});}exports[_0x3138('0x17')]=function(_0x3305e6){var _0x4f78bb=this;return new Promise(function(_0x47c7f4,_0x5db22b){return db[_0x3138('0x18')][_0x3138('0x19')]({'raw':_0x3305e6[_0x3138('0x1a')]?_0x3305e6[_0x3138('0x1a')][_0x3138('0x1b')]===undefined?!![]:![]:!![],'where':_0x3305e6[_0x3138('0x1a')]?_0x3305e6[_0x3138('0x1a')][_0x3138('0x1c')]||null:null,'attributes':_0x3305e6['options']?_0x3305e6['options'][_0x3138('0x1d')]||null:null,'limit':_0x3305e6[_0x3138('0x1a')]?_0x3305e6['options'][_0x3138('0x1e')]||null:null,'include':_0x3305e6[_0x3138('0x1a')]?_0x3305e6[_0x3138('0x1a')][_0x3138('0x1f')]?_[_0x3138('0x20')](_0x3305e6[_0x3138('0x1a')][_0x3138('0x1f')],function(_0x2e1439){return{'model':db[_0x2e1439[_0x3138('0x21')]],'as':_0x2e1439['as'],'attributes':_0x2e1439[_0x3138('0x1d')],'include':_0x2e1439[_0x3138('0x1f')]?_['map'](_0x2e1439['include'],function(_0x589e1c){return{'model':db[_0x589e1c[_0x3138('0x21')]],'as':_0x589e1c['as'],'attributes':_0x589e1c[_0x3138('0x1d')],'include':_0x589e1c['include']?_['map'](_0x589e1c[_0x3138('0x1f')],function(_0x93be56){return{'model':db[_0x93be56['model']],'as':_0x93be56['as'],'attributes':_0x93be56[_0x3138('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3138('0x22')](function(_0x2931f0){logger[_0x3138('0x23')](_0x3138('0x17'),_0x3305e6);logger[_0x3138('0x10')](_0x3138('0x17'),_0x3305e6,JSON[_0x3138('0x13')](_0x2931f0));_0x47c7f4(_0x2931f0);})[_0x3138('0x24')](function(_0x1939a5){logger[_0x3138('0x14')]('GetMailAccount',_0x1939a5[_0x3138('0x15')],_0x3305e6);_0x5db22b(_0x4f78bb[_0x3138('0x14')](0x1f4,_0x1939a5[_0x3138('0x15')]));});});};exports[_0x3138('0x25')]=function(_0x53ecee){var _0x1f848f=this;return new Promise(function(_0x3d90f6,_0x513aea){return db[_0x3138('0x18')][_0x3138('0x26')]({'raw':_0x53ecee[_0x3138('0x1a')]?_0x53ecee[_0x3138('0x1a')][_0x3138('0x1b')]===undefined?!![]:![]:!![],'where':_0x53ecee[_0x3138('0x1a')]?_0x53ecee['options'][_0x3138('0x1c')]||null:null,'attributes':_0x53ecee[_0x3138('0x1a')]?_0x53ecee['options']['attributes']||null:null,'include':_0x53ecee[_0x3138('0x1a')]?_0x53ecee[_0x3138('0x1a')][_0x3138('0x1f')]?_[_0x3138('0x20')](_0x53ecee['options'][_0x3138('0x1f')],function(_0x516428){return{'model':db[_0x516428[_0x3138('0x21')]],'as':_0x516428['as'],'attributes':_0x516428['attributes'],'include':_0x516428['include']?_[_0x3138('0x20')](_0x516428[_0x3138('0x1f')],function(_0x816cdf){return{'model':db[_0x816cdf[_0x3138('0x21')]],'as':_0x816cdf['as'],'attributes':_0x816cdf[_0x3138('0x1d')],'include':_0x816cdf[_0x3138('0x1f')]?_[_0x3138('0x20')](_0x816cdf[_0x3138('0x1f')],function(_0x2ce697){return{'model':db[_0x2ce697[_0x3138('0x21')]],'as':_0x2ce697['as'],'attributes':_0x2ce697[_0x3138('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3138('0x22')](function(_0x1875cd){logger[_0x3138('0x23')](_0x3138('0x25'),_0x53ecee);logger[_0x3138('0x10')](_0x3138('0x25'),_0x53ecee,JSON['stringify'](_0x1875cd));_0x3d90f6(_0x1875cd);})[_0x3138('0x24')](function(_0x341d4b){logger['error']('ShowMailAccount',_0x341d4b['message'],_0x53ecee);_0x513aea(_0x1f848f['error'](0x1f4,_0x341d4b[_0x3138('0x15')]));});});};exports[_0x3138('0x27')]=function(_0xa8bef5){var _0x35cf35=this;return new Promise(function(_0x322f37,_0x14b232){var _0x4734c1={'body':_0xa8bef5[_0x3138('0x28')],'channel':_0x3138('0x29')};var _0x29e442=_['difference'](_['keys'](db[_0x3138('0x2a')][_0x3138('0x2b')]),[_0x3138('0x2c'),_0x3138('0x2d'),_0x3138('0x2e'),_0x3138('0x2f')]);var _0x1e45fc=![];if(_0xa8bef5[_0x3138('0x28')]['id']){delete _0xa8bef5[_0x3138('0x28')]['id'];}if(_[_0x3138('0x30')](_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')])){return _0x14b232(_0x35cf35['error'](0x1f4,_0x3138('0x32')));}if(_[_0x3138('0x30')](_0xa8bef5[_0x3138('0x28')][_0x3138('0x28')])||_0xa8bef5[_0x3138('0x28')][_0x3138('0x28')]===''){return _0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x3138('0x33')));}if(_[_0x3138('0x30')](_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')])){return _0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x3138('0x35')+_0x29e442));}if(!_['includes'](_0x29e442,_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')])){return _0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x3138('0x36')+_0x29e442));}var _0x25b4d3={};_0x25b4d3[_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')]]=_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')];return db[_0x3138('0x18')]['find']({'where':{'id':_0xa8bef5[_0x3138('0x37')]['id']},'include':[{'model':db[_0x3138('0x38')],'as':_0x3138('0x39'),'include':[{'model':db[_0x3138('0x2a')],'as':_0x3138('0x3a'),'where':_0x25b4d3,'limit':0x1,'order':[['updatedAt',_0x3138('0x3b')]]}]},{'model':db['MailApplication'],'as':_0x3138('0x3c')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x3138('0x22')](function(_0x99cbe){if(_0x99cbe&&_0x99cbe['List']){var _0xf4ab5e=_0x99cbe[_0x3138('0x3d')]({'plain':!![]});_0x4734c1[_0x3138('0x37')]=_['omit'](_0xf4ab5e,[_0x3138('0x3c'),_0x3138('0x39')]);_0x4734c1[_0x3138('0x3e')]=_0xf4ab5e['Applications'];_0x4734c1[_0x3138('0x3f')]=_0xf4ab5e[_0x3138('0x39')];_0x4734c1[_0x3138('0x3e')]=_[_0x3138('0x40')](_0x4734c1[_0x3138('0x3e')],[_0x3138('0x41')],['asc']);if(_0x4734c1[_0x3138('0x37')]&&_0x4734c1['account'][_0x3138('0x42')]){_0x4734c1['applications']['push']({'id':0x0,'priority':_0x4734c1[_0x3138('0x3e')][_0x3138('0x43')]+0x1,'app':'close','appdata':'autoclose','interval':_0x3138('0x44')});}if(_0x4734c1['account']['Applications']){delete _0x4734c1[_0x3138('0x37')][_0x3138('0x3c')];}if(_0x4734c1[_0x3138('0x37')]['List']){delete _0x4734c1['account'][_0x3138('0x39')];}if(_0xf4ab5e[_0x3138('0x39')][_0x3138('0x3a')]['length']){return _0xf4ab5e['List'][_0x3138('0x3a')][0x0];}var _0x3c8c39=_[_0x3138('0xc')](_0xa8bef5[_0x3138('0x28')],{'firstName':_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')],'ListId':_0xf4ab5e[_0x3138('0x2f')]});_0x3c8c39[_0xa8bef5[_0x3138('0x28')][_0x3138('0x34')]]=_0xa8bef5[_0x3138('0x28')][_0x3138('0x31')];return db['CmContact'][_0x3138('0x45')](_0x3c8c39);}else{throw new Error(_0x3138('0x46'));}})[_0x3138('0x22')](function(_0x4d750d){_0x4734c1[_0x3138('0x47')]=_0x4d750d;if(_0x4d750d){if(!_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['messageId']){_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x48')]=rs[_0x3138('0x49')]()+'\x20'+_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x31')];}var _0x5e58e8={'ContactId':_0x4d750d['id'],'MailAccountId':_0xa8bef5[_0x3138('0x37')]['id'],'inReplyTo':_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x48')],'to':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x31')],'cc':_0xa8bef5['body'][_0x3138('0x15')]['cc'],'subject':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x4a')],'attach':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x4b')],'lastMsgAt':moment()[_0x3138('0x4c')](_0x3138('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0xa8bef5['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x3138('0x48')],'where':{'messageId':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['inReplyTo']}}]})[_0x3138('0x22')](function(_0x104e6c){if(_0x104e6c){return[_0x104e6c,![]];}return db[_0x3138('0x4e')][_0x3138('0x45')](_0x5e58e8)[_0x3138('0x22')](function(_0x2974fb){return[_0x2974fb,!![]];});});}else{throw new Error(_0x3138('0x4f'));}})[_0x3138('0x50')](function(_0x5b0516,_0x301328){if(_0x5b0516){_0x1e45fc=_0x301328;if(!_0x301328){return _0x5b0516['update']({'inReplyTo':_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x48')],'to':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x31')],'cc':_0xa8bef5['body'][_0x3138('0x15')]['cc'],'subject':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x4a')],'attach':_0x5b0516[_0x3138('0x4b')]?_0x5b0516['attach']:_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x4b')],'substatus':null,'substatusAt':moment()[_0x3138('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x3138('0x4c')](_0x3138('0x4d')),'lastMsgDirection':'in'});}else{return _0x5b0516;}}})['then'](function(_0x3a00f1){_0x4734c1[_0x3138('0x51')]=_0x3a00f1['get']({'plain':!![]});_0x4734c1['interaction'][_0x3138('0x52')]=_0x1e45fc;return db[_0x3138('0x53')]['create']({'body':_0xa8bef5['body'][_0x3138('0x28')],'MailAccountId':_0xa8bef5[_0x3138('0x37')]['id'],'MailInteractionId':_0x3a00f1['id'],'direction':'in','ContactId':_0x4734c1[_0x3138('0x47')]['id'],'messageId':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x48')],'from':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x31')],'to':_0xa8bef5['body'][_0x3138('0x15')]['to'],'cc':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['cc'],'subject':_0xa8bef5[_0x3138('0x28')]['message']['subject'],'attach':_0xa8bef5[_0x3138('0x28')]['message']['attach'],'Attachments':_0xa8bef5[_0x3138('0x28')]['message'][_0x3138('0x54')],'originTo':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x55')],'originCc':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['originCc'],'bcc':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')][_0x3138('0x56')],'ChatWebsiteId':_0xa8bef5['body'][_0x3138('0x15')]['ChatWebsiteId']||null,'originChannel':_0xa8bef5[_0x3138('0x28')][_0x3138('0x15')]['originChannel']||_0x3138('0x57'),'ChatOfflineMessageId':_0xa8bef5['body'][_0x3138('0x15')][_0x3138('0x58')]||null},{'include':[{'model':db[_0x3138('0x59')],'as':_0x3138('0x5a')}]});})[_0x3138('0x22')](function(_0x3ce2c4){_0x4734c1[_0x3138('0x15')]=_0x3ce2c4;if(_0x4734c1[_0x3138('0x51')]['UserId']){return db[_0x3138('0x5b')][_0x3138('0x26')]({'attributes':['id',_0x3138('0x5c')],'where':{'id':_0x4734c1[_0x3138('0x51')]['UserId']}})[_0x3138('0x22')](function(_0x4e0cba){if(_0x4e0cba){_0x4734c1[_0x3138('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3138('0x5d'),'appdata':_0x4e0cba[_0x3138('0x5c')]+','+(_0x4734c1['account'][_0x3138('0x5e')]||0xa),'interval':_0x3138('0x44')});}return respondWithRpcPromise(_0x3138('0x5f'),_0x3138('0x60'),_0x4734c1);});}return respondWithRpcPromise(_0x3138('0x5f'),_0x3138('0x60'),_0x4734c1);})[_0x3138('0x22')](function(_0x10c70f){_0x322f37(_0x10c70f);})[_0x3138('0x24')](function(_0x2feea6){_0x14b232(_0x35cf35[_0x3138('0x14')](0x1f4,_0x2feea6[_0x3138('0x15')]));});});}; \ No newline at end of file +var _0x36d8=['MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','include','map','attributes','model','then','info','ShowMailAccount','find','body','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','List','orderBy','asc','autoclose','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format'];(function(_0xa96b73,_0x5d4c0c){var _0x4aacc7=function(_0x2b4e29){while(--_0x2b4e29){_0xa96b73['push'](_0xa96b73['shift']());}};_0x4aacc7(++_0x5d4c0c);}(_0x36d8,0x1ba));var _0x836d=function(_0x4a5aa1,_0x498901){_0x4a5aa1=_0x4a5aa1-0x0;var _0x330afc=_0x36d8[_0x4a5aa1];return _0x330afc;};'use strict';var _=require('lodash');var util=require(_0x836d('0x0'));var moment=require('moment');var BPromise=require(_0x836d('0x1'));var rs=require(_0x836d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x836d('0x3'))['db'];var utils=require(_0x836d('0x4'));var logger=require('../../config/logger')(_0x836d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x836d('0x6')][_0x836d('0x7')]({'port':0x232c});config[_0x836d('0x8')]=_[_0x836d('0x9')](config['redis'],{'host':_0x836d('0xa'),'port':0x18eb});var socket=require(_0x836d('0xb'))(new Redis(config[_0x836d('0x8')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x311628,_0x61b256,_0x4fe5cc){return new BPromise(function(_0x25955e,_0x39068b){return client['request'](_0x311628,_0x4fe5cc)['then'](function(_0x989215){logger['info'](_0x836d('0xc'),_0x61b256,'request\x20sent');logger[_0x836d('0xd')](_0x836d('0xe'),_0x61b256,_0x836d('0xf'),JSON[_0x836d('0x10')](_0x989215));if(_0x989215[_0x836d('0x11')]){if(_0x989215[_0x836d('0x11')][_0x836d('0x12')]===0x1f4){logger[_0x836d('0x11')](_0x836d('0xc'),_0x61b256,_0x989215[_0x836d('0x11')][_0x836d('0x13')]);return _0x39068b(_0x989215[_0x836d('0x11')][_0x836d('0x13')]);}logger[_0x836d('0x11')]('MailAccount,\x20%s,\x20%s',_0x61b256,_0x989215[_0x836d('0x11')][_0x836d('0x13')]);return _0x25955e(_0x989215[_0x836d('0x11')][_0x836d('0x13')]);}else{logger['info'](_0x836d('0xc'),_0x61b256,_0x836d('0xf'));_0x25955e(_0x989215[_0x836d('0x14')][_0x836d('0x13')]);}})[_0x836d('0x15')](function(_0x21d39d){logger[_0x836d('0x11')](_0x836d('0xc'),_0x61b256,_0x21d39d);_0x39068b(_0x21d39d);});});}exports[_0x836d('0x16')]=function(_0x5a4af3){var _0x379d89=this;return new Promise(function(_0x48f9d3,_0x7d934){return db[_0x836d('0x17')][_0x836d('0x18')]({'raw':_0x5a4af3[_0x836d('0x19')]?_0x5a4af3[_0x836d('0x19')][_0x836d('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a4af3[_0x836d('0x19')]?_0x5a4af3[_0x836d('0x19')][_0x836d('0x1b')]||null:null,'attributes':_0x5a4af3[_0x836d('0x19')]?_0x5a4af3[_0x836d('0x19')]['attributes']||null:null,'limit':_0x5a4af3['options']?_0x5a4af3[_0x836d('0x19')]['limit']||null:null,'include':_0x5a4af3[_0x836d('0x19')]?_0x5a4af3[_0x836d('0x19')][_0x836d('0x1c')]?_[_0x836d('0x1d')](_0x5a4af3['options'][_0x836d('0x1c')],function(_0x57b7dc){return{'model':db[_0x57b7dc['model']],'as':_0x57b7dc['as'],'attributes':_0x57b7dc[_0x836d('0x1e')],'include':_0x57b7dc[_0x836d('0x1c')]?_['map'](_0x57b7dc['include'],function(_0x4879f1){return{'model':db[_0x4879f1[_0x836d('0x1f')]],'as':_0x4879f1['as'],'attributes':_0x4879f1[_0x836d('0x1e')],'include':_0x4879f1[_0x836d('0x1c')]?_[_0x836d('0x1d')](_0x4879f1[_0x836d('0x1c')],function(_0x5211fb){return{'model':db[_0x5211fb[_0x836d('0x1f')]],'as':_0x5211fb['as'],'attributes':_0x5211fb[_0x836d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x836d('0x20')](function(_0x17d3a8){logger[_0x836d('0x21')](_0x836d('0x16'),_0x5a4af3);logger['debug'](_0x836d('0x16'),_0x5a4af3,JSON[_0x836d('0x10')](_0x17d3a8));_0x48f9d3(_0x17d3a8);})['catch'](function(_0x3b64f6){logger[_0x836d('0x11')](_0x836d('0x16'),_0x3b64f6['message'],_0x5a4af3);_0x7d934(_0x379d89['error'](0x1f4,_0x3b64f6[_0x836d('0x13')]));});});};exports[_0x836d('0x22')]=function(_0x12f230){var _0x24e542=this;return new Promise(function(_0x27257e,_0x1550bf){return db['MailAccount'][_0x836d('0x23')]({'raw':_0x12f230[_0x836d('0x19')]?_0x12f230[_0x836d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x12f230[_0x836d('0x19')]?_0x12f230[_0x836d('0x19')][_0x836d('0x1b')]||null:null,'attributes':_0x12f230['options']?_0x12f230[_0x836d('0x19')][_0x836d('0x1e')]||null:null,'include':_0x12f230['options']?_0x12f230['options'][_0x836d('0x1c')]?_[_0x836d('0x1d')](_0x12f230[_0x836d('0x19')][_0x836d('0x1c')],function(_0x5238e6){return{'model':db[_0x5238e6[_0x836d('0x1f')]],'as':_0x5238e6['as'],'attributes':_0x5238e6[_0x836d('0x1e')],'include':_0x5238e6[_0x836d('0x1c')]?_['map'](_0x5238e6[_0x836d('0x1c')],function(_0x4b1870){return{'model':db[_0x4b1870[_0x836d('0x1f')]],'as':_0x4b1870['as'],'attributes':_0x4b1870[_0x836d('0x1e')],'include':_0x4b1870[_0x836d('0x1c')]?_[_0x836d('0x1d')](_0x4b1870[_0x836d('0x1c')],function(_0x946397){return{'model':db[_0x946397['model']],'as':_0x946397['as'],'attributes':_0x946397['attributes']};}):[]};}):[]};}):[]:[]})[_0x836d('0x20')](function(_0xa63708){logger['info']('ShowMailAccount',_0x12f230);logger[_0x836d('0xd')](_0x836d('0x22'),_0x12f230,JSON['stringify'](_0xa63708));_0x27257e(_0xa63708);})[_0x836d('0x15')](function(_0x3ca77c){logger[_0x836d('0x11')](_0x836d('0x22'),_0x3ca77c[_0x836d('0x13')],_0x12f230);_0x1550bf(_0x24e542['error'](0x1f4,_0x3ca77c['message']));});});};exports['NotifyMailAccount']=function(_0x2d03bc){var _0x2f9c42=this;return new Promise(function(_0xe45fa1,_0xf17295){var _0x3f8e44={'body':_0x2d03bc[_0x836d('0x24')],'channel':_0x836d('0x25')};var _0xf7ef8a=_['difference'](_[_0x836d('0x26')](db[_0x836d('0x27')][_0x836d('0x28')]),[_0x836d('0x29'),_0x836d('0x2a'),_0x836d('0x2b'),_0x836d('0x2c')]);var _0x20b8e8=![];if(_0x2d03bc[_0x836d('0x24')]['id']){delete _0x2d03bc[_0x836d('0x24')]['id'];}if(_[_0x836d('0x2d')](_0x2d03bc[_0x836d('0x24')][_0x836d('0x2e')])){return _0xf17295(_0x2f9c42[_0x836d('0x11')](0x1f4,_0x836d('0x2f')));}if(_['isNil'](_0x2d03bc[_0x836d('0x24')][_0x836d('0x24')])||_0x2d03bc[_0x836d('0x24')][_0x836d('0x24')]===''){return _0xf17295(_0x2f9c42[_0x836d('0x11')](0x1f4,_0x836d('0x30')));}if(_['isNil'](_0x2d03bc[_0x836d('0x24')]['mapKey'])){return _0xf17295(_0x2f9c42[_0x836d('0x11')](0x1f4,_0x836d('0x31')+_0xf7ef8a));}if(!_['includes'](_0xf7ef8a,_0x2d03bc['body'][_0x836d('0x32')])){return _0xf17295(_0x2f9c42['error'](0x1f4,_0x836d('0x33')+_0xf7ef8a));}var _0x21a5bf={};_0x21a5bf[_0x2d03bc['body'][_0x836d('0x32')]]=_0x2d03bc[_0x836d('0x24')][_0x836d('0x2e')];return db[_0x836d('0x17')]['find']({'where':{'id':_0x2d03bc[_0x836d('0x34')]['id']},'include':[{'model':db[_0x836d('0x35')],'as':'List','include':[{'model':db[_0x836d('0x27')],'as':_0x836d('0x36'),'where':_0x21a5bf,'limit':0x1,'order':[[_0x836d('0x2a'),_0x836d('0x37')]]}]},{'model':db[_0x836d('0x38')],'as':_0x836d('0x39')},{'model':db[_0x836d('0x3a')],'as':_0x836d('0x3b')}]})[_0x836d('0x20')](function(_0x43a6a2){if(_0x43a6a2&&_0x43a6a2['List']){var _0x12cbe9=_0x43a6a2[_0x836d('0x3c')]({'plain':!![]});_0x3f8e44[_0x836d('0x34')]=_[_0x836d('0x3d')](_0x12cbe9,[_0x836d('0x39'),'List']);_0x3f8e44[_0x836d('0x3e')]=_0x12cbe9[_0x836d('0x39')];_0x3f8e44[_0x836d('0x3f')]=_0x12cbe9[_0x836d('0x40')];_0x3f8e44[_0x836d('0x3e')]=_[_0x836d('0x41')](_0x3f8e44[_0x836d('0x3e')],['priority'],[_0x836d('0x42')]);if(_0x3f8e44[_0x836d('0x34')]&&_0x3f8e44[_0x836d('0x34')][_0x836d('0x43')]){_0x3f8e44[_0x836d('0x3e')]['push']({'id':0x0,'priority':_0x3f8e44[_0x836d('0x3e')]['length']+0x1,'app':'close','appdata':_0x836d('0x43'),'interval':_0x836d('0x44')});}if(_0x3f8e44[_0x836d('0x34')][_0x836d('0x39')]){delete _0x3f8e44[_0x836d('0x34')]['Applications'];}if(_0x3f8e44[_0x836d('0x34')][_0x836d('0x40')]){delete _0x3f8e44[_0x836d('0x34')][_0x836d('0x40')];}if(_0x12cbe9['List'][_0x836d('0x36')][_0x836d('0x45')]){return _0x12cbe9[_0x836d('0x40')][_0x836d('0x36')][0x0];}var _0x3716c7=_[_0x836d('0x9')](_0x2d03bc[_0x836d('0x24')],{'firstName':_0x2d03bc[_0x836d('0x24')][_0x836d('0x2e')],'ListId':_0x12cbe9[_0x836d('0x2c')]});_0x3716c7[_0x2d03bc[_0x836d('0x24')]['mapKey']]=_0x2d03bc[_0x836d('0x24')][_0x836d('0x2e')];return db['CmContact'][_0x836d('0x46')](_0x3716c7);}else{throw new Error(_0x836d('0x47'));}})[_0x836d('0x20')](function(_0x2e83e5){_0x3f8e44[_0x836d('0x48')]=_0x2e83e5;if(_0x2e83e5){if(!_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x49')]){_0x2d03bc['body'][_0x836d('0x13')]['messageId']=rs[_0x836d('0x4a')]()+'\x20'+_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')]['from'];}var _0x59a899={'ContactId':_0x2e83e5['id'],'MailAccountId':_0x2d03bc[_0x836d('0x34')]['id'],'inReplyTo':_0x2d03bc['body'][_0x836d('0x13')]['messageId'],'to':_0x2d03bc[_0x836d('0x24')]['message'][_0x836d('0x2e')],'cc':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')]['cc'],'subject':_0x2d03bc[_0x836d('0x24')]['message'][_0x836d('0x4b')],'attach':_0x2d03bc[_0x836d('0x24')]['message'][_0x836d('0x4c')],'lastMsgAt':moment()[_0x836d('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x836d('0x4e')][_0x836d('0x23')]({'where':{'closed':![],'MailAccountId':_0x2d03bc[_0x836d('0x34')]['id']},'include':[{'model':db[_0x836d('0x4f')],'as':'Messages','attributes':[_0x836d('0x49')],'where':{'messageId':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x50')]}}]})[_0x836d('0x20')](function(_0x186e38){if(_0x186e38){return[_0x186e38,![]];}return db['MailInteraction'][_0x836d('0x46')](_0x59a899)[_0x836d('0x20')](function(_0x17dc1b){return[_0x17dc1b,!![]];});});}else{throw new Error(_0x836d('0x51'));}})[_0x836d('0x52')](function(_0x27342e,_0x23872e){if(_0x27342e){_0x20b8e8=_0x23872e;if(!_0x23872e){return _0x27342e[_0x836d('0x53')]({'inReplyTo':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x49')],'to':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x2e')],'cc':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')]['cc'],'subject':_0x2d03bc['body'][_0x836d('0x13')]['subject'],'attach':_0x27342e[_0x836d('0x4c')]?_0x27342e['attach']:_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0x836d('0x4d')](_0x836d('0x54')),'lastMsgAt':moment()[_0x836d('0x4d')](_0x836d('0x54')),'lastMsgDirection':'in'});}else{return _0x27342e;}}})['then'](function(_0xa20527){_0x3f8e44[_0x836d('0x55')]=_0xa20527[_0x836d('0x3c')]({'plain':!![]});_0x3f8e44['interaction'][_0x836d('0x56')]=_0x20b8e8;return db[_0x836d('0x4f')][_0x836d('0x46')]({'body':_0x2d03bc[_0x836d('0x24')][_0x836d('0x24')],'MailAccountId':_0x2d03bc[_0x836d('0x34')]['id'],'MailInteractionId':_0xa20527['id'],'direction':'in','ContactId':_0x3f8e44[_0x836d('0x48')]['id'],'messageId':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x49')],'from':_0x2d03bc[_0x836d('0x24')]['message'][_0x836d('0x2e')],'to':_0x2d03bc[_0x836d('0x24')]['message']['to'],'cc':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')]['cc'],'subject':_0x2d03bc[_0x836d('0x24')]['message']['subject'],'attach':_0x2d03bc['body'][_0x836d('0x13')][_0x836d('0x4c')],'Attachments':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x57')],'originTo':_0x2d03bc[_0x836d('0x24')]['message'][_0x836d('0x58')],'originCc':_0x2d03bc[_0x836d('0x24')]['message'][_0x836d('0x59')],'bcc':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x5a')],'ChatWebsiteId':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')][_0x836d('0x5b')]||null,'originChannel':_0x2d03bc['body'][_0x836d('0x13')][_0x836d('0x5c')]||_0x836d('0x5d'),'ChatOfflineMessageId':_0x2d03bc[_0x836d('0x24')][_0x836d('0x13')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x836d('0x5e')],'as':_0x836d('0x5f')}]});})[_0x836d('0x20')](function(_0x11e219){_0x3f8e44[_0x836d('0x13')]=_0x11e219;if(_0x3f8e44[_0x836d('0x55')][_0x836d('0x60')]){return db[_0x836d('0x61')][_0x836d('0x23')]({'attributes':['id',_0x836d('0x62')],'where':{'id':_0x3f8e44[_0x836d('0x55')][_0x836d('0x60')]}})[_0x836d('0x20')](function(_0x55884e){if(_0x55884e){_0x3f8e44[_0x836d('0x3e')][_0x836d('0x63')]({'id':0x0,'priority':0x0,'app':_0x836d('0x64'),'appdata':_0x55884e[_0x836d('0x62')]+','+(_0x3f8e44[_0x836d('0x34')][_0x836d('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x3f8e44);});}return respondWithRpcPromise(_0x836d('0x66'),_0x836d('0x67'),_0x3f8e44);})['then'](function(_0x21a027){_0xe45fa1(_0x21a027);})['catch'](function(_0x18668a){_0xf17295(_0x2f9c42[_0x836d('0x11')](0x1f4,_0x18668a[_0x836d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 79d65ff..928da31 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 _0xb5b0=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x2d12ff,_0x33a77e){var _0x4e8399=function(_0x4b755c){while(--_0x4b755c){_0x2d12ff['push'](_0x2d12ff['shift']());}};_0x4e8399(++_0x33a77e);}(_0xb5b0,0x17e));var _0x0b5b=function(_0x23cb3b,_0x5126d9){_0x23cb3b=_0x23cb3b-0x0;var _0x1ef8e8=_0xb5b0[_0x23cb3b];return _0x1ef8e8;};'use strict';var MailAccountEvents=require(_0x0b5b('0x0'));var events=[_0x0b5b('0x1'),'remove',_0x0b5b('0x2')];function createListener(_0x29551a,_0x3e2fcf){return function(_0x255697){_0x3e2fcf[_0x0b5b('0x3')](_0x29551a,_0x255697);};}function removeListener(_0x188f2e,_0x371e64){return function(){MailAccountEvents[_0x0b5b('0x4')](_0x188f2e,_0x371e64);};}exports[_0x0b5b('0x5')]=function(_0x5edaa0){for(var _0x2680cf=0x0,_0xec7429=events[_0x0b5b('0x6')];_0x2680cf<_0xec7429;_0x2680cf++){var _0x3d81bc=events[_0x2680cf];var _0x1e64a3=createListener(_0x0b5b('0x7')+_0x3d81bc,_0x5edaa0);MailAccountEvents['on'](_0x3d81bc,_0x1e64a3);}}; \ No newline at end of file +var _0xe203=['register','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x3dd60f,_0x4566bd){var _0x2cb70e=function(_0x43112b){while(--_0x43112b){_0x3dd60f['push'](_0x3dd60f['shift']());}};_0x2cb70e(++_0x4566bd);}(_0xe203,0x1be));var _0x3e20=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe203[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0x3e20('0x0'));var events=[_0x3e20('0x1'),_0x3e20('0x2'),_0x3e20('0x3')];function createListener(_0x48c31b,_0x2c2963){return function(_0x5703c6){_0x2c2963['emit'](_0x48c31b,_0x5703c6);};}function removeListener(_0x409b11,_0x3d433b){return function(){MailAccountEvents['removeListener'](_0x409b11,_0x3d433b);};}exports[_0x3e20('0x4')]=function(_0x5c00a8){for(var _0x39e0d9=0x0,_0x57249a=events['length'];_0x39e0d9<_0x57249a;_0x39e0d9++){var _0x3e384e=events[_0x39e0d9];var _0x467332=createListener(_0x3e20('0x5')+_0x3e384e,_0x5c00a8);MailAccountEvents['on'](_0x3e384e,_0x467332);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2201099..f6e256c 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 _0x4d93=['connect-timeout','express','Router','../../config/environment','./mailApplication.controller','get','/:id','show','update','isAuthenticated','multer','util','path'];(function(_0x6b2c74,_0x54896f){var _0x3db323=function(_0x1ebd74){while(--_0x1ebd74){_0x6b2c74['push'](_0x6b2c74['shift']());}};_0x3db323(++_0x54896f);}(_0x4d93,0x15c));var _0x34d9=function(_0x2a44e6,_0x32d142){_0x2a44e6=_0x2a44e6-0x0;var _0xf9323f=_0x4d93[_0x2a44e6];return _0xf9323f;};'use strict';var multer=require(_0x34d9('0x0'));var util=require(_0x34d9('0x1'));var path=require(_0x34d9('0x2'));var timeout=require(_0x34d9('0x3'));var express=require(_0x34d9('0x4'));var router=express[_0x34d9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x34d9('0x6'));var controller=require(_0x34d9('0x7'));router[_0x34d9('0x8')](_0x34d9('0x9'),auth['isAuthenticated'](),controller[_0x34d9('0xa')]);router['put'](_0x34d9('0x9'),auth['isAuthenticated'](),controller[_0x34d9('0xb')]);router['delete'](_0x34d9('0x9'),auth[_0x34d9('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa435=['/:id','isAuthenticated','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0xb7fe61,_0x25b304){var _0xe78a0a=function(_0x39f57d){while(--_0x39f57d){_0xb7fe61['push'](_0xb7fe61['shift']());}};_0xe78a0a(++_0x25b304);}(_0xa435,0x75));var _0x5a43=function(_0x1abaf1,_0x27bc15){_0x1abaf1=_0x1abaf1-0x0;var _0x2b511f=_0xa435[_0x1abaf1];return _0x2b511f;};'use strict';var multer=require(_0x5a43('0x0'));var util=require('util');var path=require(_0x5a43('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a43('0x2'));var router=express[_0x5a43('0x3')]();var fs_extra=require(_0x5a43('0x4'));var auth=require(_0x5a43('0x5'));var interaction=require(_0x5a43('0x6'));var config=require(_0x5a43('0x7'));var controller=require(_0x5a43('0x8'));router['get'](_0x5a43('0x9'),auth['isAuthenticated'](),controller['show']);router['put'](_0x5a43('0x9'),auth[_0x5a43('0xa')](),controller[_0x5a43('0xb')]);router[_0x5a43('0xc')](_0x5a43('0x9'),auth[_0x5a43('0xa')](),controller[_0x5a43('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 95d6a53..f843607 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 _0x5ef9=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x5ef9,0x12c));var _0x95ef=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x5ef9[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require('sequelize');module[_0x95ef('0x0')]={'priority':{'type':Sequelize[_0x95ef('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x95ef('0x2')],'allowNull':![],'defaultValue':_0x95ef('0x3')},'appdata':{'type':Sequelize[_0x95ef('0x4')]()},'description':{'type':Sequelize[_0x95ef('0x2')]},'interval':{'type':Sequelize[_0x95ef('0x2')],'defaultValue':_0x95ef('0x5')}}; \ No newline at end of file +var _0x8329=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8329,0xda));var _0x9832=function(_0x1bf480,_0x48964b){_0x1bf480=_0x1bf480-0x0;var _0x4aef81=_0x8329[_0x1bf480];return _0x4aef81;};'use strict';var Sequelize=require(_0x9832('0x0'));module[_0x9832('0x1')]={'priority':{'type':Sequelize[_0x9832('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9832('0x3')],'allowNull':![],'defaultValue':_0x9832('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9832('0x3')]},'interval':{'type':Sequelize[_0x9832('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 765ee6c..a25a982 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x12c7c4,_0x445b21){var _0x30bbdb=function(_0x3b9a58){while(--_0x3b9a58){_0x12c7c4['push'](_0x12c7c4['shift']());}};_0x30bbdb(++_0x445b21);}(_0x70e0,0x17b));var _0x070e=function(_0x442c61,_0x1bf5f8){_0x442c61=_0x442c61-0x0;var _0x3a412b=_0x70e0[_0x442c61];return _0x3a412b;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +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(_0xade8bc,_0x570901){var _0x8461a3=function(_0x5e7aac){while(--_0x5e7aac){_0xade8bc['push'](_0xade8bc['shift']());}};_0x8461a3(++_0x570901);}(_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 ef4839c..7eb3a0d 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 _0x40f4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x58f57f,_0x23028c){var _0x318b7f=function(_0x1f239b){while(--_0x1f239b){_0x58f57f['push'](_0x58f57f['shift']());}};_0x318b7f(++_0x23028c);}(_0x40f4,0x1b0));var _0x440f=function(_0x4b4d88,_0x4240de){_0x4b4d88=_0x4b4d88-0x0;var _0x47f369=_0x40f4[_0x4b4d88];return _0x47f369;};'use strict';var _=require(_0x440f('0x0'));var util=require(_0x440f('0x1'));var logger=require(_0x440f('0x2'))(_0x440f('0x3'));var moment=require(_0x440f('0x4'));var BPromise=require(_0x440f('0x5'));var rp=require(_0x440f('0x6'));var fs=require('fs');var path=require(_0x440f('0x7'));var rimraf=require(_0x440f('0x8'));var config=require(_0x440f('0x9'));var attributes=require(_0x440f('0xa'));module['exports']=function(_0x1ceb57,_0x5457b4){return _0x1ceb57[_0x440f('0xb')](_0x440f('0xc'),attributes,{'tableName':_0x440f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x440f('0xe'),'collate':_0x440f('0xf')});}; \ No newline at end of file +var _0x418e=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x3ebff4,_0x5efe9a){var _0x6331b7=function(_0x4860d6){while(--_0x4860d6){_0x3ebff4['push'](_0x3ebff4['shift']());}};_0x6331b7(++_0x5efe9a);}(_0x418e,0xbf));var _0xe418=function(_0x17dad4,_0x50b0b3){_0x17dad4=_0x17dad4-0x0;var _0x14374e=_0x418e[_0x17dad4];return _0x14374e;};'use strict';var _=require(_0xe418('0x0'));var util=require(_0xe418('0x1'));var logger=require(_0xe418('0x2'))(_0xe418('0x3'));var moment=require('moment');var BPromise=require(_0xe418('0x4'));var rp=require(_0xe418('0x5'));var fs=require('fs');var path=require(_0xe418('0x6'));var rimraf=require(_0xe418('0x7'));var config=require(_0xe418('0x8'));var attributes=require(_0xe418('0x9'));module['exports']=function(_0x1af16a,_0xe63dea){return _0x1af16a[_0xe418('0xa')](_0xe418('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe418('0xc'),'collate':_0xe418('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index ac2ea5f..698bc2a 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 _0xdaa4=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','info','MailApplication','update','body','options','raw','where','limit','UpdateMailApplication','stringify'];(function(_0xcd56da,_0x315299){var _0x37a5a5=function(_0x3acc02){while(--_0x3acc02){_0xcd56da['push'](_0xcd56da['shift']());}};_0x37a5a5(++_0x315299);}(_0xdaa4,0x1d0));var _0x4daa=function(_0xc527f5,_0x1f7c5c){_0xc527f5=_0xc527f5-0x0;var _0x41f85c=_0xdaa4[_0xc527f5];return _0x41f85c;};'use strict';var _=require(_0x4daa('0x0'));var util=require(_0x4daa('0x1'));var moment=require('moment');var BPromise=require(_0x4daa('0x2'));var rs=require(_0x4daa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4daa('0x4'))['db'];var utils=require(_0x4daa('0x5'));var logger=require('../../config/logger')(_0x4daa('0x6'));var config=require(_0x4daa('0x7'));var jayson=require(_0x4daa('0x8'));var client=jayson[_0x4daa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a92ba,_0x439106,_0x341f44){return new BPromise(function(_0x1e3ffe,_0xb4aa35){return client[_0x4daa('0xa')](_0x2a92ba,_0x341f44)[_0x4daa('0xb')](function(_0x2247ba){logger['info']('MailApplication,\x20%s,\x20%s',_0x439106,_0x4daa('0xc'));logger[_0x4daa('0xd')](_0x4daa('0xe'),_0x439106,_0x4daa('0xc'),JSON['stringify'](_0x2247ba));if(_0x2247ba[_0x4daa('0xf')]){if(_0x2247ba[_0x4daa('0xf')][_0x4daa('0x10')]===0x1f4){logger[_0x4daa('0xf')](_0x4daa('0x11'),_0x439106,_0x2247ba[_0x4daa('0xf')][_0x4daa('0x12')]);return _0xb4aa35(_0x2247ba['error'][_0x4daa('0x12')]);}logger['error'](_0x4daa('0x11'),_0x439106,_0x2247ba[_0x4daa('0xf')]['message']);return _0x1e3ffe(_0x2247ba[_0x4daa('0xf')][_0x4daa('0x12')]);}else{logger[_0x4daa('0x13')](_0x4daa('0x11'),_0x439106,_0x4daa('0xc'));_0x1e3ffe(_0x2247ba['result'][_0x4daa('0x12')]);}})['catch'](function(_0x5a4420){logger['error'](_0x4daa('0x11'),_0x439106,_0x5a4420);_0xb4aa35(_0x5a4420);});});}exports['UpdateMailApplication']=function(_0x32d5f1){var _0x550ab7=this;return new Promise(function(_0x354e02,_0x11b7ae){return db[_0x4daa('0x14')][_0x4daa('0x15')](_0x32d5f1[_0x4daa('0x16')],{'raw':_0x32d5f1['options']?_0x32d5f1[_0x4daa('0x17')][_0x4daa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32d5f1[_0x4daa('0x17')]?_0x32d5f1[_0x4daa('0x17')][_0x4daa('0x19')]||null:null,'attributes':_0x32d5f1[_0x4daa('0x17')]?_0x32d5f1[_0x4daa('0x17')]['attributes']||null:null,'limit':_0x32d5f1[_0x4daa('0x17')]?_0x32d5f1[_0x4daa('0x17')][_0x4daa('0x1a')]||null:null})['then'](function(_0x4ba048){logger[_0x4daa('0x13')](_0x4daa('0x1b'),_0x32d5f1);logger[_0x4daa('0xd')](_0x4daa('0x1b'),_0x32d5f1,JSON[_0x4daa('0x1c')](_0x4ba048));_0x354e02(_0x4ba048);})['catch'](function(_0xce66b9){logger[_0x4daa('0xf')]('UpdateMailApplication',_0xce66b9[_0x4daa('0x12')],_0x32d5f1);_0x11b7ae(_0x550ab7[_0x4daa('0xf')](0x1f4,_0xce66b9[_0x4daa('0x12')]));});});}; \ No newline at end of file +var _0xbc3c=['options','attributes','limit','stringify','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateMailApplication','MailApplication','update','body'];(function(_0x1edf3f,_0x4c288b){var _0x34a0e3=function(_0x54e66b){while(--_0x54e66b){_0x1edf3f['push'](_0x1edf3f['shift']());}};_0x34a0e3(++_0x4c288b);}(_0xbc3c,0x1b4));var _0xcbc3=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xbc3c[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcbc3('0x0'));var BPromise=require('bluebird');var rs=require(_0xcbc3('0x1'));var fs=require('fs');var Redis=require(_0xcbc3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbc3('0x3'))('rpc');var config=require(_0xcbc3('0x4'));var jayson=require(_0xcbc3('0x5'));var client=jayson[_0xcbc3('0x6')][_0xcbc3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1116fd,_0x5a1e6d,_0x288d52){return new BPromise(function(_0x4ee101,_0x5247d1){return client[_0xcbc3('0x8')](_0x1116fd,_0x288d52)[_0xcbc3('0x9')](function(_0x21d1d0){logger['info'](_0xcbc3('0xa'),_0x5a1e6d,_0xcbc3('0xb'));logger[_0xcbc3('0xc')](_0xcbc3('0xd'),_0x5a1e6d,'request\x20sent',JSON['stringify'](_0x21d1d0));if(_0x21d1d0['error']){if(_0x21d1d0[_0xcbc3('0xe')][_0xcbc3('0xf')]===0x1f4){logger['error'](_0xcbc3('0xa'),_0x5a1e6d,_0x21d1d0['error'][_0xcbc3('0x10')]);return _0x5247d1(_0x21d1d0[_0xcbc3('0xe')][_0xcbc3('0x10')]);}logger[_0xcbc3('0xe')](_0xcbc3('0xa'),_0x5a1e6d,_0x21d1d0[_0xcbc3('0xe')][_0xcbc3('0x10')]);return _0x4ee101(_0x21d1d0[_0xcbc3('0xe')][_0xcbc3('0x10')]);}else{logger[_0xcbc3('0x11')](_0xcbc3('0xa'),_0x5a1e6d,'request\x20sent');_0x4ee101(_0x21d1d0['result'][_0xcbc3('0x10')]);}})[_0xcbc3('0x12')](function(_0x10ab6b){logger[_0xcbc3('0xe')]('MailApplication,\x20%s,\x20%s',_0x5a1e6d,_0x10ab6b);_0x5247d1(_0x10ab6b);});});}exports[_0xcbc3('0x13')]=function(_0xa5d5a9){var _0x4c984d=this;return new Promise(function(_0x42e303,_0x30b5cd){return db[_0xcbc3('0x14')][_0xcbc3('0x15')](_0xa5d5a9[_0xcbc3('0x16')],{'raw':_0xa5d5a9[_0xcbc3('0x17')]?_0xa5d5a9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa5d5a9[_0xcbc3('0x17')]?_0xa5d5a9['options']['where']||null:null,'attributes':_0xa5d5a9[_0xcbc3('0x17')]?_0xa5d5a9[_0xcbc3('0x17')][_0xcbc3('0x18')]||null:null,'limit':_0xa5d5a9['options']?_0xa5d5a9['options'][_0xcbc3('0x19')]||null:null})[_0xcbc3('0x9')](function(_0x131d00){logger[_0xcbc3('0x11')](_0xcbc3('0x13'),_0xa5d5a9);logger[_0xcbc3('0xc')]('UpdateMailApplication',_0xa5d5a9,JSON[_0xcbc3('0x1a')](_0x131d00));_0x42e303(_0x131d00);})[_0xcbc3('0x12')](function(_0x7af15a){logger[_0xcbc3('0xe')](_0xcbc3('0x13'),_0x7af15a[_0xcbc3('0x10')],_0xa5d5a9);_0x30b5cd(_0x4c984d[_0xcbc3('0xe')](0x1f4,_0x7af15a[_0xcbc3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5ce72ee..8448cc0 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 _0x694d=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports'];(function(_0x59e570,_0x402b94){var _0x2ad87f=function(_0x3733b0){while(--_0x3733b0){_0x59e570['push'](_0x59e570['shift']());}};_0x2ad87f(++_0x402b94);}(_0x694d,0x16c));var _0xd694=function(_0x25bce1,_0x5560cf){_0x25bce1=_0x25bce1-0x0;var _0x31d160=_0x694d[_0x25bce1];return _0x31d160;};'use strict';var express=require(_0xd694('0x0'));var router=express[_0xd694('0x1')]();var auth=require(_0xd694('0x2'));var interaction=require(_0xd694('0x3'));var controller=require('./mailInteraction.controller');router[_0xd694('0x4')]('/',auth[_0xd694('0x5')](),controller['index']);router['get'](_0xd694('0x6'),auth['isAuthenticated'](),controller[_0xd694('0x7')]);router[_0xd694('0x4')](_0xd694('0x8'),auth[_0xd694('0x5')](),controller[_0xd694('0x9')]);router['get'](_0xd694('0xa'),auth[_0xd694('0x5')](),controller[_0xd694('0xb')]);router['get'](_0xd694('0xc'),auth[_0xd694('0x5')](),controller['download']);router['post']('/',auth[_0xd694('0x5')](),controller[_0xd694('0xd')]);router[_0xd694('0xe')](_0xd694('0xa'),auth[_0xd694('0x5')](),controller['addMessage']);router[_0xd694('0xe')](_0xd694('0xf'),auth['isAuthenticated'](),interaction[_0xd694('0x10')](_0xd694('0x11'),_0xd694('0x12')),controller['addTags']);router[_0xd694('0x13')](_0xd694('0x8'),auth[_0xd694('0x5')](),interaction[_0xd694('0x10')](_0xd694('0x11'),_0xd694('0x14')),controller[_0xd694('0x15')]);router[_0xd694('0x16')](_0xd694('0x8'),auth[_0xd694('0x5')](),interaction[_0xd694('0x10')]('mail',_0xd694('0x17')),controller['destroy']);router[_0xd694('0x16')](_0xd694('0xf'),auth[_0xd694('0x5')](),controller[_0xd694('0x18')]);module[_0xd694('0x19')]=router; \ No newline at end of file +var _0x5305=['mailinteraction:update','update','mailinteraction:destroy','destroy','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','addTags','put'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x5305,0x194));var _0x5530=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5305[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x5530('0x0'));var router=express[_0x5530('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x5530('0x2'));var controller=require('./mailInteraction.controller');router[_0x5530('0x3')]('/',auth[_0x5530('0x4')](),controller[_0x5530('0x5')]);router['get'](_0x5530('0x6'),auth[_0x5530('0x4')](),controller['describe']);router[_0x5530('0x3')](_0x5530('0x7'),auth[_0x5530('0x4')](),controller[_0x5530('0x8')]);router[_0x5530('0x3')](_0x5530('0x9'),auth[_0x5530('0x4')](),controller[_0x5530('0xa')]);router['get'](_0x5530('0xb'),auth[_0x5530('0x4')](),controller[_0x5530('0xc')]);router['post']('/',auth[_0x5530('0x4')](),controller[_0x5530('0xd')]);router[_0x5530('0xe')](_0x5530('0x9'),auth['isAuthenticated'](),controller[_0x5530('0xf')]);router[_0x5530('0xe')](_0x5530('0x10'),auth[_0x5530('0x4')](),interaction[_0x5530('0x11')](_0x5530('0x12'),'mailinteraction:addtags'),controller[_0x5530('0x13')]);router[_0x5530('0x14')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x5530('0x12'),_0x5530('0x15')),controller[_0x5530('0x16')]);router['delete']('/:id',auth[_0x5530('0x4')](),interaction[_0x5530('0x11')](_0x5530('0x12'),_0x5530('0x17')),controller[_0x5530('0x18')]);router['delete']('/:id/tags',auth[_0x5530('0x4')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 23e1640..ede28ec 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 _0xf120=['exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','iconv'];(function(_0x3a7391,_0x4baf7f){var _0x2792d6=function(_0x488845){while(--_0x488845){_0x3a7391['push'](_0x3a7391['shift']());}};_0x2792d6(++_0x4baf7f);}(_0xf120,0x179));var _0x0f12=function(_0x14c745,_0x23ccb6){_0x14c745=_0x14c745-0x0;var _0x57bc93=_0xf120[_0x14c745];return _0x57bc93;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x0f12('0x0'));module[_0x0f12('0x1')]={'closed':{'type':Sequelize[_0x0f12('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0f12('0x3')]},'secondDisposition':{'type':Sequelize[_0x0f12('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0f12('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0f12('0x3')](0x1fe)},'to':{'type':Sequelize[_0x0f12('0x3')]},'cc':{'type':Sequelize[_0x0f12('0x4')](_0x0f12('0x5'))},'subject':{'type':Sequelize[_0x0f12('0x4')]()},'attach':{'type':Sequelize[_0x0f12('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0f12('0x6')]},'substatus':{'type':Sequelize[_0x0f12('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0f12('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f12('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0f12('0x7')]('in',_0x0f12('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc991=['sequelize','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xc991,0x1d4));var _0x1c99=function(_0x5d38c8,_0x35285a){_0x5d38c8=_0x5d38c8-0x0;var _0x3800e1=_0xc991[_0x5d38c8];return _0x3800e1;};'use strict';var Sequelize=require(_0x1c99('0x0'));var iconv=require('iconv');module[_0x1c99('0x1')]={'closed':{'type':Sequelize[_0x1c99('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1c99('0x3')]},'secondDisposition':{'type':Sequelize[_0x1c99('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1c99('0x3')]},'note':{'type':Sequelize[_0x1c99('0x3')]},'inReplyTo':{'type':Sequelize[_0x1c99('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1c99('0x4')](_0x1c99('0x5'))},'subject':{'type':Sequelize[_0x1c99('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x1c99('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x1c99('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x1c99('0x7')]('in',_0x1c99('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1c99('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1c99('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1c99('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 39c17f5..3527a4e 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 _0x2149=['\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','role','sequelize','keyBy','merge','Account.mandatoryDisposition','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','toString','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','all','show','params','includeAll','include','options','create','body','describe','addMessage','ids','getMessages','format','findAll','inlineCss','true','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','ioredis','../../config/logger','api','../../config/environment','html-entities','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','MailMessage','out','plainBody','lastMsgText','trimStart','catch','map','MailInteraction','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','cm_contacts','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','some','compact','isEmpty','MailAccountId','concat','createdAt','$gte','parse','$lte','null'];(function(_0x211180,_0x12bf83){var _0x18840d=function(_0x367efa){while(--_0x367efa){_0x211180['push'](_0x211180['shift']());}};_0x18840d(++_0x12bf83);}(_0x2149,0x146));var _0x9214=function(_0x3e6a83,_0x356349){_0x3e6a83=_0x3e6a83-0x0;var _0x315131=_0x2149[_0x3e6a83];return _0x315131;};'use strict';var emlformat=require(_0x9214('0x0'));var rimraf=require(_0x9214('0x1'));var zipdir=require(_0x9214('0x2'));var moment=require(_0x9214('0x3'));var BPromise=require(_0x9214('0x4'));var util=require(_0x9214('0x5'));var path=require(_0x9214('0x6'));var fs=require('fs');var _=require(_0x9214('0x7'));var squel=require(_0x9214('0x8'));var juice=require('juice');var Redis=require(_0x9214('0x9'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x9214('0xa'))(_0x9214('0xb'));var config=require(_0x9214('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x9214('0xd'));config['redis']=_[_0x9214('0xe')](config[_0x9214('0xf')],{'host':_0x9214('0x10'),'port':0x18eb});var socket=require(_0x9214('0x11'))(new Redis(config[_0x9214('0xf')]));require('./mailInteraction.socket')[_0x9214('0x12')](socket);function respondWithStatusCode(_0x239fa7,_0x142b13){_0x142b13=_0x142b13||0xcc;return function(_0x6afea3){if(_0x6afea3){return _0x239fa7[_0x9214('0x13')](_0x142b13);}return _0x239fa7[_0x9214('0x14')](_0x142b13)['end']();};}function respondWithResult(_0x41133f,_0x531c2a){_0x531c2a=_0x531c2a||0xc8;return function(_0x1822d6){if(_0x1822d6){return _0x41133f[_0x9214('0x14')](_0x531c2a)[_0x9214('0x15')](_0x1822d6);}};}function respondWithFilteredResult(_0x9c7021,_0x34750b){return function(_0x1e2c61){if(_0x1e2c61){var _0x134296=typeof _0x34750b[_0x9214('0x16')]===_0x9214('0x17')&&typeof _0x34750b[_0x9214('0x18')]==='undefined';var _0x4e8b69=_0x1e2c61['count'];var _0x9269ad=_0x134296?0x0:_0x34750b['offset'];var _0x1d79bc=_0x134296?_0x1e2c61[_0x9214('0x19')]:_0x34750b[_0x9214('0x16')]+_0x34750b['limit'];var _0x4fa812;if(_0x1d79bc>=_0x4e8b69){_0x1d79bc=_0x4e8b69;_0x4fa812=0xc8;}else{_0x4fa812=0xce;}_0x9c7021[_0x9214('0x14')](_0x4fa812);return _0x9c7021[_0x9214('0x1a')](_0x9214('0x1b'),_0x9269ad+'-'+_0x1d79bc+'/'+_0x4e8b69)[_0x9214('0x15')](_0x1e2c61);}return null;};}function saveUpdates(_0x53ec2b){return function(_0x2f3504){if(_0x2f3504){return _0x2f3504[_0x9214('0x1c')](_0x53ec2b)[_0x9214('0x1d')](function(_0x2aba58){return _0x2aba58;});}return null;};}function removeEntity(_0x299241){return function(_0x524d7){if(_0x524d7){return _0x524d7[_0x9214('0x1e')]()['then'](function(){_0x299241[_0x9214('0x14')](0xcc)[_0x9214('0x1f')]();});}};}function handleEntityNotFound(_0xeacccf){return function(_0x453bdb){if(!_0x453bdb){_0xeacccf[_0x9214('0x13')](0x194);}return _0x453bdb;};}function handleError(_0x43b9b8,_0x33b52b){_0x33b52b=_0x33b52b||0x1f4;return function(_0xaa9eb4){logger[_0x9214('0x20')](_0xaa9eb4[_0x9214('0x21')]);if(_0xaa9eb4[_0x9214('0x22')]){delete _0xaa9eb4[_0x9214('0x22')];}_0x43b9b8[_0x9214('0x14')](_0x33b52b)[_0x9214('0x23')](_0xaa9eb4);};}function getInteractionUsers(_0x113c29,_0x3782e4){return new BPromise(function(_0x27d9d2,_0x34508e){try{if(_0x3782e4[_0x113c29['id']]){_0x113c29[_0x9214('0x24')]=_['map'](_0x3782e4[_0x113c29['id']],function(_0x2c8ebd){return{'id':_0x2c8ebd['id'],'fullname':_0x2c8ebd['fullname']};});}}catch(_0x4bcaae){_0x34508e(_0x4bcaae);}_0x27d9d2(_0x113c29);});}function getInteractionTags(_0x3faf55,_0x344a99){return new BPromise(function(_0x4f9035,_0xb3666b){try{if(_0x3faf55[_0x9214('0x25')]){_0x3faf55[_0x9214('0x26')]=[];_0x3faf55['TagIds'][_0x9214('0x27')](',')[_0x9214('0x28')](function(_0x1b4d16){_0x3faf55[_0x9214('0x26')][_0x9214('0x29')](_0x344a99[_0x1b4d16]);});}delete _0x3faf55[_0x9214('0x25')];}catch(_0x55bc6a){_0xb3666b(_0x55bc6a);}_0x4f9035(_0x3faf55);});}function getLastMessageText(_0x5311d4){return new BPromise(function(_0x15985d,_0x4fc31b){return db[_0x9214('0x2a')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x5311d4['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9214('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9214('0x2c')],'order':'-id','raw':!![]})[_0x9214('0x1d')](function(_0x784072){if(_0x784072&&_0x784072['plainBody']){_0x5311d4[_0x9214('0x2d')]=_[_0x9214('0x2e')](_0x784072[_0x9214('0x2c')]);}_0x15985d(_0x5311d4);})[_0x9214('0x2f')](function(_0xca4a28){_0x4fc31b(_0xca4a28);});});}function updateMailInteraction(_0x27f904,_0x169a75,_0x1a5dc3,_0x1251b0){return new BPromise(function(_0x39683a,_0x6c510c){return getInteractionUsers(_0x27f904,_0x1a5dc3)['then'](function(_0x28e882){return getInteractionTags(_0x28e882,_0x169a75);})[_0x9214('0x1d')](function(_0x385732){if(_0x1251b0){_0x39683a(getLastMessageText(_0x385732));}else{_0x39683a(_0x385732);}})[_0x9214('0x2f')](function(_0x5044d3){_0x6c510c(_0x5044d3);});});}exports['index']=function(_0xdc3d9a,_0x1d9d72){var _0x3c3e55={},_0x1393bf={},_0x4a4d67={'count':0x0,'rows':[]};var _0x4968ee=_[_0x9214('0x30')](db[_0x9214('0x31')][_0x9214('0x32')],function(_0x2ac8ee){return{'name':_0x2ac8ee['fieldName'],'type':_0x2ac8ee[_0x9214('0x33')]['key']};});_0x1393bf['model']=_['map'](_0x4968ee,_0x9214('0x22'));_0x1393bf[_0x9214('0x34')]=_[_0x9214('0x35')](_0xdc3d9a[_0x9214('0x34')]);_0x1393bf[_0x9214('0x36')]=_['intersection'](_0x1393bf[_0x9214('0x37')],_0x1393bf[_0x9214('0x34')]);_0x3c3e55[_0x9214('0x38')]=_[_0x9214('0x39')](_0x1393bf[_0x9214('0x37')],qs[_0x9214('0x3a')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3a')]));_0x3c3e55[_0x9214('0x38')]=_0x3c3e55['attributes'][_0x9214('0x3b')]?_0x3c3e55[_0x9214('0x38')]:_0x1393bf[_0x9214('0x37')];if(!_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3c')](_0x9214('0x3d'))){_0x3c3e55['limit']=qs[_0x9214('0x18')](_0xdc3d9a[_0x9214('0x34')]['limit']);_0x3c3e55[_0x9214('0x16')]=qs[_0x9214('0x16')](_0xdc3d9a[_0x9214('0x34')]['offset']);}_0x3c3e55[_0x9214('0x3e')]=qs[_0x9214('0x3f')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3f')]);_0x3c3e55[_0x9214('0x40')]=qs[_0x9214('0x36')](_[_0x9214('0x41')](_0xdc3d9a[_0x9214('0x34')],_0x1393bf['filters']),_0x4968ee);var _0x4280a4=[];var _0x4c75cd=squel[_0x9214('0x42')]()[_0x9214('0x43')]('id')[_0x9214('0x43')](_0x9214('0x22'))[_0x9214('0x43')]('color')['from'](_0x9214('0x44'));var _0x1e3a04=squel[_0x9214('0x42')]()['field'](_0x9214('0x45'))[_0x9214('0x43')](_0x9214('0x46'))[_0x9214('0x43')](_0x9214('0x47'))[_0x9214('0x48')](_0x9214('0x49'),'ui')[_0x9214('0x4a')](_0x9214('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x3e42b5=squel[_0x9214('0x42')]()[_0x9214('0x48')]('mail_interactions','i')[_0x9214('0x4a')](_0x9214('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x9214('0x4a')](_0x9214('0x4d'),'a',_0x9214('0x4e'))[_0x9214('0x4a')](_0x9214('0x4f'),'me',_0x9214('0x50'))[_0x9214('0x4a')]('mail_interaction_has_tags','it',_0x9214('0x51'))[_0x9214('0x4a')](_0x9214('0x44'),'t','t.id\x20=\x20it.TagId');var _0x3cdb52=squel[_0x9214('0x52')]();var _0x34fc32=[];var _0x4ddcb1=squel[_0x9214('0x52')]();var _0x4bc17e;if(_0xdc3d9a[_0x9214('0x34')]['search']){_0x4bc17e=as[_0x9214('0x53')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x54')]);var _0x281f0c=_0x4bc17e['sqlOperator'];for(var _0x4638=0x0;_0x4638<_0x4bc17e[_0x9214('0x55')]['length'];_0x4638++){var _0x1b199c=_0x4bc17e[_0x9214('0x55')][_0x4638];var _0x49fe02='i';var _0x72fe38=_[_0x9214('0x56')](_0x4968ee,['name',_0x1b199c['field']]);if(!_0x72fe38){switch(_0x1b199c[_0x9214('0x43')]){case _0x9214('0x57'):if(_0x1b199c[_0x9214('0x58')]==0x1){_0x3e42b5[_0x9214('0x59')]('`'+_0x1b199c[_0x9214('0x43')]+'`\x20=\x200');}else{_0x3e42b5[_0x9214('0x59')]('`'+_0x1b199c[_0x9214('0x43')]+_0x9214('0x5a'));}break;case _0x9214('0x5b'):if(_0x1b199c[_0x9214('0x5c')]===_0x9214('0x5d')){if(_0x1b199c['value'][_0x9214('0x27')]('\x20')['length']>0x1){_0x3cdb52[_0x281f0c](_0x9214('0x5e'),qs[_0x9214('0x5f')](_0x1b199c[_0x9214('0x58')]),null);}else{var _0x1e08c8='%'+_0x1b199c[_0x9214('0x58')]+'%';_0x3cdb52[_0x281f0c](_0x9214('0x60'),_0x1e08c8,_0x1e08c8,_0x1e08c8);}}else{_0x72fe38=_[_0x9214('0x56')](_0x4968ee,['name',_0x9214('0x61')]);_0x1b199c[_0x9214('0x43')]='ContactId';_0x4e7c3a=as[_0x9214('0x62')](_0x49fe02,_0x72fe38[_0x9214('0x33')],_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a['text'],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x63')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x1f')]);}break;case _0x9214('0x64'):var _0x7ac00e=_0x1b199c[_0x9214('0x58')][_0x9214('0x27')](',')['map'](function(_0x1f4247){return Number(_0x1f4247);});_0x7ac00e[_0x9214('0x28')](function(_0x412e8e){_0x4ddcb1['or'](_0x9214('0x65'),'%,'+_0x412e8e+',%');});_0x34fc32=_[_0x9214('0x66')](_0x34fc32,_0x7ac00e);break;case _0x9214('0x67'):if(_0x1b199c[_0x9214('0x5c')]==='$substring'){_0x3cdb52[_0x281f0c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1b199c[_0x9214('0x58')]+'%',null);}else{_0x72fe38=_[_0x9214('0x56')](_0x4968ee,[_0x9214('0x22'),'UserId']);_0x1b199c[_0x9214('0x43')]=_0x9214('0x68');_0x4e7c3a=as[_0x9214('0x62')](_0x49fe02,_0x72fe38[_0x9214('0x33')],_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a[_0x9214('0x69')],_0x4e7c3a['value'][_0x9214('0x63')],_0x4e7c3a['value'][_0x9214('0x1f')]);}break;case _0x9214('0x2c'):_0x4e7c3a=as[_0x9214('0x62')]('me',null,_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a[_0x9214('0x69')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x63')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x1f')]);break;}}else{var _0x4e7c3a=as['buildExpression'](_0x49fe02,_0x72fe38[_0x9214('0x33')],_0x1b199c);_0x3cdb52[_0x281f0c](_0x4e7c3a[_0x9214('0x69')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x63')],_0x4e7c3a[_0x9214('0x58')][_0x9214('0x1f')]);}}}else{var _0x21c072=_(_0xdc3d9a[_0x9214('0x34')])[_0x9214('0x35')]()[_0x9214('0x30')](function(_0x4436c6){return _[_0x9214('0x6a')](_0x4968ee,[_0x9214('0x22'),_0x4436c6])?_0x4436c6:undefined;})[_0x9214('0x6b')]()['value']();if(!_[_0x9214('0x6c')](_0x21c072)){_0x21c072[_0x9214('0x28')](function(_0x16c360){if(_0x16c360===_0x9214('0x6d')){_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IN\x20?',[][_0x9214('0x6e')](_0xdc3d9a[_0x9214('0x34')][_0x16c360]));}else if(_0x16c360===_0x9214('0x6f')){var _0x1bbd8c=JSON['parse'](_0xdc3d9a['query'][_0x16c360])[_0x9214('0x70')];var _0x45ddbe=JSON[_0x9214('0x71')](_0xdc3d9a[_0x9214('0x34')][_0x16c360])[_0x9214('0x72')];_0x3e42b5[_0x9214('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1bbd8c,_0x45ddbe);}else{if(_0xdc3d9a[_0x9214('0x34')][_0x16c360]===_0x9214('0x73')){_0x3e42b5[_0x9214('0x40')]('i.'+_0x16c360+'\x20IS\x20NULL');}else{_0x3e42b5['where']('i.'+_0x16c360+_0x9214('0x74'),_0xdc3d9a[_0x9214('0x34')][_0x16c360]);}}});}if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x75')]){if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x75')]==0x1){_0x3e42b5[_0x9214('0x59')](_0x9214('0x76'));}else{_0x3e42b5[_0x9214('0x59')](_0x9214('0x77'));}}if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x78')]){_0x34fc32=_[_0x9214('0x79')](_0xdc3d9a[_0x9214('0x34')][_0x9214('0x78')])?_0xdc3d9a['query'][_0x9214('0x78')]:new Array(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x78')]);_0x34fc32['forEach'](function(_0x4623a1){_0x4ddcb1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4623a1+',%');});}if(_0xdc3d9a['query']['filter']){var _0x144db8=_0xdc3d9a['query'][_0x9214('0x7a')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x144db8)){_0x3cdb52['or']('i.id\x20LIKE\x20?',_0x144db8+'%');}else if(qs[_0x9214('0x7b')](_0x144db8)){_0x3cdb52['or']('c.email\x20LIKE\x20?',_0x144db8+'%');}else{_0x3cdb52['or'](_0x9214('0x7c'),qs[_0x9214('0x5f')](_0x144db8))['or'](_0x9214('0x7d'),qs['getFullTextValue'](_0x144db8));}}}_0x3e42b5[_0x9214('0x40')](_0x3cdb52);_0x3e42b5[_0x9214('0x7e')](_0x9214('0x7f'));var _0x30ea35={'type':db[_0x9214('0x80')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5913c1=_0x3e42b5[_0x9214('0x81')]();_0x5913c1[_0x9214('0x43')](_0x9214('0x7f'));_0x5913c1[_0x9214('0x43')](_0x9214('0x82'),_0x9214('0x57'));if(_0x3c3e55[_0x9214('0x3e')]){_0x3c3e55[_0x9214('0x3e')]['forEach'](function(_0x35e1eb){var _0x46da21=_0x35e1eb[0x0]==='contactName'?_0x35e1eb[0x0]:'i.'+_0x35e1eb[0x0];_0x3e42b5['order'](_0x46da21,_0x35e1eb[0x1]===_0x9214('0x83')?![]:!![]);});}if(!_['isEmpty'](_0x34fc32)){_0x3e42b5['having'](_0x4ddcb1);_0x5913c1[_0x9214('0x40')]('t.id\x20IN\x20?',_0x34fc32);}BPromise[_0x9214('0x84')]()[_0x9214('0x1d')](function(){if(!_0x4bc17e){if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x6d')])return;_0x5913c1[_0x9214('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xdc3d9a[_0x9214('0x85')]['role']!==_0x9214('0x86'))return;return _0xdc3d9a[_0x9214('0x85')][_0x9214('0x87')]({'attributes':['id'],'raw':!![]})[_0x9214('0x1d')](function(_0x453ecf){if(_['isEmpty'](_0x453ecf)){_0x5913c1[_0x9214('0x40')](_0x9214('0x88'));_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IS\x20NULL');}else{_0x5913c1['where'](_0x9214('0x89'),_[_0x9214('0x30')](_0x453ecf,'id'));_0x3e42b5[_0x9214('0x40')]('i.MailAccountId\x20IN\x20?',_[_0x9214('0x30')](_0x453ecf,'id'));}});})[_0x9214('0x1d')](function(){if(_0xdc3d9a[_0x9214('0x85')][_0x9214('0x8a')]===_0x9214('0x86')&&!_0x4bc17e&&!_0xdc3d9a[_0x9214('0x34')]['MailAccountId'])return[];return db[_0x9214('0x8b')][_0x9214('0x34')](_0x5913c1['toString'](),_0x30ea35);})[_0x9214('0x1d')](function(_0x2a9794){_0x4a4d67[_0x9214('0x19')]=_0x2a9794[_0x9214('0x3b')];if(_0x4a4d67['count']===0x0)return[];return db[_0x9214('0x8b')]['query'](_0x4c75cd['toString'](),_0x30ea35)[_0x9214('0x1d')](function(_0x23b7b6){_0x4280a4=_[_0x9214('0x8c')](_0x23b7b6,'id');_0x30ea35=_[_0x9214('0x8d')](_0x30ea35,{'model':db[_0x9214('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xdc3d9a[_0x9214('0x34')][_0x9214('0x3a')]){_0x3c3e55['attributes'][_0x9214('0x28')](function(_0x23c466){_0x3e42b5['field']('i.'+_0x23c466);});}else{_0x3e42b5[_0x9214('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9214('0x57'));_0x3e42b5[_0x9214('0x43')]('a.key','Account.key');_0x3e42b5[_0x9214('0x43')]('a.mandatoryDisposition',_0x9214('0x8e'));_0x3e42b5[_0x9214('0x43')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x9214('0x8f'));_0x3e42b5[_0x9214('0x43')]('i.id');_0x3e42b5[_0x9214('0x43')](_0x9214('0x90'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x91'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x92'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x93'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x94'));_0x3e42b5['field'](_0x9214('0x95'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x96'));_0x3e42b5[_0x9214('0x43')]('i.subject');_0x3e42b5['field'](_0x9214('0x97'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x98'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x99'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9a'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9b'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9c'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9d'));_0x3e42b5[_0x9214('0x43')](_0x9214('0x9e'));_0x3e42b5[_0x9214('0x43')]('c.firstName',_0x9214('0x9f'));_0x3e42b5[_0x9214('0x43')](_0x9214('0xa0'),_0x9214('0xa1'));_0x3e42b5['field'](_0x9214('0xa2'),_0x9214('0xa3'));_0x3e42b5['field'](_0x9214('0xa4'),_0x9214('0xa5'));_0x3e42b5[_0x9214('0x43')](_0x9214('0xa6'),_0x9214('0xa7'));_0x3e42b5[_0x9214('0x43')]('c.fax',_0x9214('0xa8'));_0x3e42b5['field']('o.fullname',_0x9214('0xa9'));_0x3e42b5[_0x9214('0x43')](_0x9214('0xaa'),_0x9214('0xab'));_0x3e42b5[_0x9214('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9214('0x25'));}if(_0x3c3e55[_0x9214('0x18')])_0x3e42b5['limit'](_0x3c3e55[_0x9214('0x18')]);if(_0x3c3e55[_0x9214('0x16')])_0x3e42b5[_0x9214('0x16')](_0x3c3e55['offset']);return db[_0x9214('0x8b')][_0x9214('0x34')](_0x3e42b5[_0x9214('0xac')](),_0x30ea35);})[_0x9214('0x1d')](function(_0x3b5df4){if(_0x3b5df4[_0x9214('0x3b')]>0x0)_0x1e3a04[_0x9214('0x40')](_0x9214('0xad'),_[_0x9214('0x30')](_0x3b5df4,'id'));return db[_0x9214('0x8b')][_0x9214('0x34')](_0x1e3a04[_0x9214('0xac')](),_0x30ea35)[_0x9214('0x1d')](function(_0x432557){var _0x4b3a3d=_['groupBy'](_0x432557,_0x9214('0xae'));var _0x52ab00=[];return db[_0x9214('0xaf')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]})[_0x9214('0x1d')](function(_0x5d8f4f){var _0x4f9fe3=_0x5d8f4f['enableEmailPreview'];_0x3b5df4['forEach'](function(_0x4038e8){_0x52ab00[_0x9214('0x29')](updateMailInteraction(_0x4038e8,_0x4280a4,_0x4b3a3d,_0x4f9fe3));});return BPromise[_0x9214('0xb0')](_0x52ab00);});});});})[_0x9214('0x1d')](function(_0x2af582){_0x4a4d67['rows']=_0x2af582;return _0x4a4d67;})['then'](respondWithFilteredResult(_0x1d9d72,_0x3c3e55))['catch'](handleError(_0x1d9d72,null));};exports[_0x9214('0xb1')]=function(_0x52af0b,_0x38a628){var _0x25b508={'raw':![],'where':{'id':_0x52af0b[_0x9214('0xb2')]['id']}},_0x42337f={};_0x42337f['model']=_[_0x9214('0x35')](db['MailInteraction'][_0x9214('0x32')]);_0x42337f[_0x9214('0x34')]=_[_0x9214('0x35')](_0x52af0b[_0x9214('0x34')]);_0x42337f[_0x9214('0x36')]=_['intersection'](_0x42337f[_0x9214('0x37')],_0x42337f[_0x9214('0x34')]);_0x25b508[_0x9214('0x38')]=_['intersection'](_0x42337f['model'],qs['fields'](_0x52af0b['query'][_0x9214('0x3a')]));_0x25b508[_0x9214('0x38')]=_0x25b508['attributes'][_0x9214('0x3b')]?_0x25b508[_0x9214('0x38')]:_0x42337f['model'];if(_0x52af0b[_0x9214('0x34')][_0x9214('0xb3')]){_0x25b508[_0x9214('0xb4')]=[{'all':!![]}];}_0x25b508=_[_0x9214('0x8d')]({},_0x25b508,_0x52af0b[_0x9214('0xb5')]);return db['MailInteraction']['find'](_0x25b508)[_0x9214('0x1d')](handleEntityNotFound(_0x38a628,null))['then'](respondWithResult(_0x38a628,null))[_0x9214('0x2f')](handleError(_0x38a628,null));};exports[_0x9214('0xb6')]=function(_0x52269c,_0x18473a){return db[_0x9214('0x31')][_0x9214('0xb6')](_0x52269c[_0x9214('0xb7')],{})[_0x9214('0x1d')](respondWithResult(_0x18473a,0xc9))[_0x9214('0x2f')](handleError(_0x18473a,null));};exports[_0x9214('0x1c')]=function(_0x4518d8,_0x5c5571){if(_0x4518d8[_0x9214('0xb7')]['id']){delete _0x4518d8[_0x9214('0xb7')]['id'];}return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x4518d8[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x5c5571,null))[_0x9214('0x1d')](saveUpdates(_0x4518d8[_0x9214('0xb7')],null))['then'](respondWithResult(_0x5c5571,null))['catch'](handleError(_0x5c5571,null));};exports[_0x9214('0x1e')]=function(_0x4b88fa,_0x22868e){return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x4b88fa[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x22868e,null))[_0x9214('0x1d')](removeEntity(_0x22868e,null))[_0x9214('0x2f')](handleError(_0x22868e,null));};exports[_0x9214('0xb8')]=function(_0x4bcd78,_0x4d048a){return db[_0x9214('0x31')][_0x9214('0xb8')]()[_0x9214('0x1d')](respondWithResult(_0x4d048a,null))[_0x9214('0x2f')](handleError(_0x4d048a,null));};exports[_0x9214('0xb9')]=function(_0x1cd308,_0x1ae6fd){return db[_0x9214('0x2a')]['find']({'where':{'id':_0x1cd308[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x1ae6fd,null))[_0x9214('0x1d')](function(_0xa114a2){if(_0xa114a2){return _0xa114a2[_0x9214('0xb9')](_0x1cd308[_0x9214('0xb7')][_0x9214('0xba')],_['omit'](_0x1cd308['body'],[_0x9214('0xba'),'id'])||{});}})[_0x9214('0x1d')](respondWithResult(_0x1ae6fd,null))[_0x9214('0x2f')](handleError(_0x1ae6fd,null));};exports[_0x9214('0xbb')]=function(_0x392de7,_0x20ac52){var _0x17a2e8={'raw':![],'where':{}};var _0x9d069d={};var _0x2c39de={'count':0x0,'rows':[]};return db[_0x9214('0x31')]['findOne']({'where':{'id':_0x392de7[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x20ac52,null))[_0x9214('0x1d')](function(_0x573df6){if(_0x573df6){_0x9d069d['model']=_['keys'](db[_0x9214('0x2a')][_0x9214('0x32')]);_0x9d069d[_0x9214('0x34')]=_[_0x9214('0x35')](_0x392de7['query']);_0x9d069d[_0x9214('0x36')]=_[_0x9214('0x39')](_0x9d069d[_0x9214('0x37')],_0x9d069d[_0x9214('0x34')]);_0x17a2e8['attributes']=_[_0x9214('0x39')](_0x9d069d[_0x9214('0x37')],qs[_0x9214('0x3a')](_0x392de7['query'][_0x9214('0x3a')]));_0x17a2e8[_0x9214('0x38')]=_0x17a2e8[_0x9214('0x38')][_0x9214('0x3b')]?_0x17a2e8[_0x9214('0x38')]:_0x9d069d[_0x9214('0x37')];if(!_0x392de7[_0x9214('0x34')]['hasOwnProperty'](_0x9214('0x3d'))){_0x17a2e8[_0x9214('0x18')]=qs[_0x9214('0x18')](_0x392de7[_0x9214('0x34')][_0x9214('0x18')]);_0x17a2e8[_0x9214('0x16')]=qs[_0x9214('0x16')](_0x392de7[_0x9214('0x34')][_0x9214('0x16')]);}_0x17a2e8[_0x9214('0x3e')]=qs['sort'](_0x392de7[_0x9214('0x34')][_0x9214('0x3f')]);_0x17a2e8[_0x9214('0x40')]=qs[_0x9214('0x36')](_[_0x9214('0x41')](_0x392de7[_0x9214('0x34')],_0x9d069d[_0x9214('0x36')]));_0x17a2e8[_0x9214('0x40')][_0x9214('0xae')]=_0x573df6['id'];if(_0x392de7[_0x9214('0x34')][_0x9214('0x7a')]){_0x17a2e8[_0x9214('0x40')]=_[_0x9214('0x8d')](_0x17a2e8[_0x9214('0x40')],{'$or':_['map'](_0x17a2e8[_0x9214('0x38')],function(_0x57eba4){var _0x29bcb4={};_0x29bcb4[_0x57eba4]={'$like':'%'+_0x392de7[_0x9214('0x34')]['filter']+'%'};return _0x29bcb4;})});}if(_0x392de7[_0x9214('0x34')][_0x9214('0x70')]){var _0x32c10b=_0x392de7[_0x9214('0x34')][_0x9214('0x70')][_0x9214('0x27')](',');var _0xa5c8d9={};_0xa5c8d9[_0x32c10b[0x0]]={'$gte':moment(_0x32c10b[0x1])[_0x9214('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x17a2e8['where']=_['merge'](_0x17a2e8[_0x9214('0x40')],_0xa5c8d9);}_0x17a2e8=_['merge']({},_0x17a2e8,_0x392de7[_0x9214('0xb5')]);return db[_0x9214('0x2a')]['count']({'where':_0x17a2e8[_0x9214('0x40')]})[_0x9214('0x1d')](function(_0x1f40a9){_0x2c39de[_0x9214('0x19')]=_0x1f40a9;if(_0x392de7['query']['includeAll']){_0x17a2e8['include']=[{'all':!![]}];}return db[_0x9214('0x2a')][_0x9214('0xbd')](_0x17a2e8);})[_0x9214('0x1d')](function(_0x4e4bc6){if(_0x392de7[_0x9214('0x34')][_0x9214('0xbe')]===_0x9214('0xbf')){for(var _0x3d4bc7=0x0;_0x3d4bc7<_0x4e4bc6['length'];_0x3d4bc7++){_0x4e4bc6[_0x3d4bc7][_0x9214('0xb7')]=juice(_0x4e4bc6[_0x3d4bc7][_0x9214('0xb7')]);}}_0x2c39de['rows']=_0x4e4bc6;return _0x2c39de;});}})[_0x9214('0x1d')](respondWithFilteredResult(_0x20ac52,_0x17a2e8))[_0x9214('0x2f')](handleError(_0x20ac52,null));};exports['addTags']=function(_0x5406ed,_0x23eac7){return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x5406ed['params']['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x23eac7,null))[_0x9214('0x1d')](function(_0x3893f6){if(_0x3893f6){return _0x3893f6[_0x9214('0xc0')](_0x5406ed[_0x9214('0xb7')][_0x9214('0xba')],_[_0x9214('0xc1')](_0x5406ed[_0x9214('0xb7')],[_0x9214('0xba'),'id'])||{})[_0x9214('0xc2')](function(){return db[_0x9214('0x64')][_0x9214('0xbd')]({'attributes':['id','name','color'],'where':{'id':_0x5406ed['body'][_0x9214('0xba')]}});})[_0x9214('0x1d')](function(_0x27cb5f){socket[_0x9214('0xc3')](_0x9214('0xc4'),{'id':Number(_0x5406ed[_0x9214('0xb2')]['id']),'tags':_0x27cb5f||[]});return{'id':Number(_0x5406ed[_0x9214('0xb2')]['id']),'tags':_0x27cb5f||[]};});}})[_0x9214('0x1d')](respondWithResult(_0x23eac7,null))[_0x9214('0x2f')](handleError(_0x23eac7,null));};exports[_0x9214('0xc5')]=function(_0x1b7884,_0x2ecbbf){return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x1b7884[_0x9214('0xb2')]['id']}})[_0x9214('0x1d')](handleEntityNotFound(_0x2ecbbf,null))['then'](function(_0x3e46b3){if(_0x3e46b3){return _0x3e46b3[_0x9214('0xc5')](_0x1b7884['query']['ids']);}})[_0x9214('0x1d')](respondWithStatusCode(_0x2ecbbf,null))[_0x9214('0x2f')](handleError(_0x2ecbbf,null));};exports[_0x9214('0xc6')]=function(_0x412871,_0xeda76d){var _0x1ef6ea=moment()['unix']()['toString']();var _0x394735=path[_0x9214('0xc7')](config[_0x9214('0xc8')],'server',_0x9214('0xc9'),_0x9214('0xca'));var _0x2aa315=path[_0x9214('0xc7')](config[_0x9214('0xc8')],_0x9214('0xcb'),_0x9214('0xc9'),_0x9214('0xcc'));var _0x5c7b8c=path[_0x9214('0xc7')](_0x394735,_0x1ef6ea);var _0x39aec2=util[_0x9214('0xbc')](_0x9214('0xcd'),_0x412871['params']['id'],_0x1ef6ea);var _0x442d81=path[_0x9214('0xc7')](_0x394735,_0x39aec2);var _0x18f079=[];if(_0x412871['query'][_0x9214('0xcc')]){_0x18f079['push']({'model':db[_0x9214('0xce')],'as':'Attachments','raw':!![]});}var _0xdc9ed=[{'model':db[_0x9214('0x2a')],'as':_0x9214('0xcf'),'attributes':['id',_0x9214('0xb7'),'from','to','cc',_0x9214('0xd0'),_0x9214('0xd1'),_0x9214('0x6f')],'where':{'secret':![]},'order':qs[_0x9214('0x3f')]('id'),'include':_0x18f079}];return db[_0x9214('0x31')][_0x9214('0x56')]({'where':{'id':_0x412871[_0x9214('0xb2')]['id']},'include':_0xdc9ed})[_0x9214('0x1d')](handleEntityNotFound(_0xeda76d,null))[_0x9214('0x1d')](function(_0x42c150){if(_0x42c150&&_0x42c150[_0x9214('0xcf')]){var _0x258c29=_0x42c150[_0x9214('0xd2')]({'plain':!![]});fs[_0x9214('0xd3')](_0x5c7b8c);return BPromise[_0x9214('0xd4')](_0x258c29['Messages'],function(_0x3fa2b0,_0x442c6d){var _0x165622={'from':_0x3fa2b0[_0x9214('0x48')],'to':_0x3fa2b0['to'],'subject':_0x3fa2b0['subject'],'html':htmlEntities['decode'](_0x3fa2b0[_0x9214('0xb7')]),'headers':{'Date':moment(_0x3fa2b0[_0x9214('0x6f')])[_0x9214('0xbc')](_0x9214('0xd5'))},'attachments':[]};if(_0x3fa2b0['cc']){_0x165622[_0x9214('0xd6')]['Cc']=_0x3fa2b0['cc'];}if(_0x3fa2b0['bcc']){_0x165622[_0x9214('0xd6')][_0x9214('0xd7')]=_0x3fa2b0[_0x9214('0xd0')];}return new BPromise(function(_0x4258a8,_0x1b5d72){if(_0x3fa2b0[_0x9214('0xd8')]){for(var _0x57940f=0x0;_0x57940f<_0x3fa2b0['Attachments'][_0x9214('0x3b')];_0x57940f++){var _0x1f0018=_0x3fa2b0[_0x9214('0xd8')][_0x57940f];var _0x3750a7=path[_0x9214('0xc7')](_0x2aa315,_0x1f0018[_0x9214('0xd9')]);if(fs['existsSync'](_0x3750a7)){_0x165622[_0x9214('0xcc')][_0x9214('0x29')]({'name':_0x1f0018[_0x9214('0x22')],'contentType':_0x1f0018[_0x9214('0x33')],'data':fs['readFileSync'](_0x3750a7)});}}}emlformat[_0x9214('0xda')](_0x165622,function(_0x54890e,_0x20d835){if(_0x54890e)return _0x1b5d72(_0x54890e);fs[_0x9214('0xdb')](path['join'](_0x5c7b8c,util['format']('message%d.eml',_0x442c6d)),_0x20d835);return _0x4258a8(_0x20d835);});});})[_0x9214('0x1d')](function(){return new BPromise(function(_0x496ad5,_0x1a3715){zipdir(_0x5c7b8c,{'saveTo':_0x442d81},function(_0x58407f,_0x52880f){if(_0x58407f)return _0x1a3715(_0x58407f);return _0x496ad5(_0x52880f);});})['then'](function(){return new BPromise(function(_0x124d98,_0x30132b){rimraf(_0x5c7b8c,function(_0x2971d9){if(_0x2971d9)_0x30132b(_0x2971d9);return _0x124d98();});});})[_0x9214('0x1d')](function(){return _0xeda76d['download'](_0x442d81,_0x39aec2,function(_0x3cb7c5){if(!_0x3cb7c5)fs[_0x9214('0xdc')](_0x442d81);});});});}else{return _0xeda76d[_0x9214('0x13')](0xc8);}})['catch'](handleError(_0xeda76d,null));}; \ No newline at end of file +var _0x8b9c=['setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Messages','bcc','subject','get','each','decode','headers','Bcc','Attachments','basename','readFileSync','build','writeFileSync','eml-format','rimraf','zip-dir','moment','bluebird','util','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','offset','undefined','limit','count','set','then','destroy','error','stack','send','Users','map','fullname','Tags','TagIds','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isEmail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','show','includeAll','include','merge','options','create','update','body','params','describe','addMessage','ids','getMessages','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','true'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x8b9c,0x1e6));var _0xc8b9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8b9c[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xc8b9('0x0'));var rimraf=require(_0xc8b9('0x1'));var zipdir=require(_0xc8b9('0x2'));var moment=require(_0xc8b9('0x3'));var BPromise=require(_0xc8b9('0x4'));var util=require(_0xc8b9('0x5'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xc8b9('0x6'));var juice=require(_0xc8b9('0x7'));var Redis=require(_0xc8b9('0x8'));var qs=require(_0xc8b9('0x9'));var as=require(_0xc8b9('0xa'));var logger=require(_0xc8b9('0xb'))(_0xc8b9('0xc'));var config=require(_0xc8b9('0xd'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xc8b9('0xe'));config[_0xc8b9('0xf')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc8b9('0x10'))(new Redis(config[_0xc8b9('0xf')]));require(_0xc8b9('0x11'))['register'](socket);function respondWithStatusCode(_0x3626d4,_0x42cb84){_0x42cb84=_0x42cb84||0xcc;return function(_0x2159bf){if(_0x2159bf){return _0x3626d4[_0xc8b9('0x12')](_0x42cb84);}return _0x3626d4[_0xc8b9('0x13')](_0x42cb84)[_0xc8b9('0x14')]();};}function respondWithResult(_0x43a735,_0x103cce){_0x103cce=_0x103cce||0xc8;return function(_0x5a8faa){if(_0x5a8faa){return _0x43a735[_0xc8b9('0x13')](_0x103cce)['json'](_0x5a8faa);}};}function respondWithFilteredResult(_0xf6bf65,_0x12c441){return function(_0x16185b){if(_0x16185b){var _0x4954d0=typeof _0x12c441[_0xc8b9('0x15')]===_0xc8b9('0x16')&&typeof _0x12c441[_0xc8b9('0x17')]==='undefined';var _0x5a239b=_0x16185b[_0xc8b9('0x18')];var _0xe30509=_0x4954d0?0x0:_0x12c441[_0xc8b9('0x15')];var _0x4183ba=_0x4954d0?_0x16185b['count']:_0x12c441['offset']+_0x12c441[_0xc8b9('0x17')];var _0x2151ff;if(_0x4183ba>=_0x5a239b){_0x4183ba=_0x5a239b;_0x2151ff=0xc8;}else{_0x2151ff=0xce;}_0xf6bf65['status'](_0x2151ff);return _0xf6bf65[_0xc8b9('0x19')]('Content-Range',_0xe30509+'-'+_0x4183ba+'/'+_0x5a239b)['json'](_0x16185b);}return null;};}function saveUpdates(_0x416524){return function(_0x1d63c2){if(_0x1d63c2){return _0x1d63c2['update'](_0x416524)[_0xc8b9('0x1a')](function(_0x5efca5){return _0x5efca5;});}return null;};}function removeEntity(_0x4d6932){return function(_0xb5067c){if(_0xb5067c){return _0xb5067c[_0xc8b9('0x1b')]()[_0xc8b9('0x1a')](function(){_0x4d6932[_0xc8b9('0x13')](0xcc)[_0xc8b9('0x14')]();});}};}function handleEntityNotFound(_0x2fe9e4){return function(_0x3e3cbd){if(!_0x3e3cbd){_0x2fe9e4[_0xc8b9('0x12')](0x194);}return _0x3e3cbd;};}function handleError(_0x4cf67a,_0x3c1776){_0x3c1776=_0x3c1776||0x1f4;return function(_0x12e145){logger[_0xc8b9('0x1c')](_0x12e145[_0xc8b9('0x1d')]);if(_0x12e145['name']){delete _0x12e145['name'];}_0x4cf67a['status'](_0x3c1776)[_0xc8b9('0x1e')](_0x12e145);};}function getInteractionUsers(_0x45e736,_0x7cac5f){return new BPromise(function(_0xafc777,_0x1c4cd4){try{if(_0x7cac5f[_0x45e736['id']]){_0x45e736[_0xc8b9('0x1f')]=_[_0xc8b9('0x20')](_0x7cac5f[_0x45e736['id']],function(_0x25ebca){return{'id':_0x25ebca['id'],'fullname':_0x25ebca[_0xc8b9('0x21')]};});}}catch(_0x37ed6b){_0x1c4cd4(_0x37ed6b);}_0xafc777(_0x45e736);});}function getInteractionTags(_0x21f6a2,_0x3138fc){return new BPromise(function(_0x4b3861,_0xfe4bca){try{if(_0x21f6a2['TagIds']){_0x21f6a2[_0xc8b9('0x22')]=[];_0x21f6a2[_0xc8b9('0x23')][_0xc8b9('0x24')](',')[_0xc8b9('0x25')](function(_0x1dc283){_0x21f6a2[_0xc8b9('0x22')][_0xc8b9('0x26')](_0x3138fc[_0x1dc283]);});}delete _0x21f6a2[_0xc8b9('0x23')];}catch(_0x40d74c){_0xfe4bca(_0x40d74c);}_0x4b3861(_0x21f6a2);});}function getLastMessageText(_0x5e7f9a){return new BPromise(function(_0x26b575,_0x4cb8d8){return db[_0xc8b9('0x27')][_0xc8b9('0x28')]({'where':{'$and':[{'MailInteractionId':_0x5e7f9a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xc8b9('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc8b9('0x2a')],'order':_0xc8b9('0x2b'),'raw':!![]})[_0xc8b9('0x1a')](function(_0xa7bc2e){if(_0xa7bc2e&&_0xa7bc2e[_0xc8b9('0x2a')]){_0x5e7f9a[_0xc8b9('0x2c')]=_[_0xc8b9('0x2d')](_0xa7bc2e[_0xc8b9('0x2a')]);}_0x26b575(_0x5e7f9a);})[_0xc8b9('0x2e')](function(_0x43fc90){_0x4cb8d8(_0x43fc90);});});}function updateMailInteraction(_0x3a07f2,_0x13f1cb,_0x4f0265,_0x35ecf2){return new BPromise(function(_0x191c7a,_0x4088d9){return getInteractionUsers(_0x3a07f2,_0x4f0265)[_0xc8b9('0x1a')](function(_0x503799){return getInteractionTags(_0x503799,_0x13f1cb);})[_0xc8b9('0x1a')](function(_0x5799e6){if(_0x35ecf2){_0x191c7a(getLastMessageText(_0x5799e6));}else{_0x191c7a(_0x5799e6);}})['catch'](function(_0xfaea62){_0x4088d9(_0xfaea62);});});}exports[_0xc8b9('0x2f')]=function(_0x5200e4,_0x1b15b4){var _0x5107e7={},_0x48a1da={},_0x2938a3={'count':0x0,'rows':[]};var _0x5e0088=_['map'](db[_0xc8b9('0x30')][_0xc8b9('0x31')],function(_0x569221){return{'name':_0x569221[_0xc8b9('0x32')],'type':_0x569221[_0xc8b9('0x33')][_0xc8b9('0x34')]};});_0x48a1da[_0xc8b9('0x35')]=_['map'](_0x5e0088,_0xc8b9('0x36'));_0x48a1da[_0xc8b9('0x37')]=_[_0xc8b9('0x38')](_0x5200e4[_0xc8b9('0x37')]);_0x48a1da['filters']=_['intersection'](_0x48a1da[_0xc8b9('0x35')],_0x48a1da[_0xc8b9('0x37')]);_0x5107e7[_0xc8b9('0x39')]=_[_0xc8b9('0x3a')](_0x48a1da[_0xc8b9('0x35')],qs[_0xc8b9('0x3b')](_0x5200e4['query']['fields']));_0x5107e7[_0xc8b9('0x39')]=_0x5107e7[_0xc8b9('0x39')][_0xc8b9('0x3c')]?_0x5107e7['attributes']:_0x48a1da[_0xc8b9('0x35')];if(!_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x3d')](_0xc8b9('0x3e'))){_0x5107e7[_0xc8b9('0x17')]=qs[_0xc8b9('0x17')](_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x17')]);_0x5107e7[_0xc8b9('0x15')]=qs[_0xc8b9('0x15')](_0x5200e4[_0xc8b9('0x37')]['offset']);}_0x5107e7[_0xc8b9('0x3f')]=qs[_0xc8b9('0x40')](_0x5200e4['query'][_0xc8b9('0x40')]);_0x5107e7[_0xc8b9('0x41')]=qs[_0xc8b9('0x42')](_['pick'](_0x5200e4[_0xc8b9('0x37')],_0x48a1da['filters']),_0x5e0088);var _0x5805e0=[];var _0x3cb68a=squel[_0xc8b9('0x43')]()[_0xc8b9('0x44')]('id')[_0xc8b9('0x44')](_0xc8b9('0x36'))[_0xc8b9('0x44')](_0xc8b9('0x45'))[_0xc8b9('0x46')]('tools_tags');var _0x2184d4=squel[_0xc8b9('0x43')]()[_0xc8b9('0x44')]('u.id')[_0xc8b9('0x44')](_0xc8b9('0x47'))['field'](_0xc8b9('0x48'))[_0xc8b9('0x46')](_0xc8b9('0x49'),'ui')[_0xc8b9('0x4a')]('users','u',_0xc8b9('0x4b'));var _0x324c74=squel[_0xc8b9('0x43')]()[_0xc8b9('0x46')](_0xc8b9('0x4c'),'i')[_0xc8b9('0x4a')](_0xc8b9('0x4d'),'c',_0xc8b9('0x4e'))[_0xc8b9('0x4a')]('users','o',_0xc8b9('0x4f'))[_0xc8b9('0x4a')](_0xc8b9('0x50'),'a',_0xc8b9('0x51'))[_0xc8b9('0x4a')](_0xc8b9('0x52'),'me','me.MailInteractionId\x20=\x20i.id')[_0xc8b9('0x4a')](_0xc8b9('0x53'),'it',_0xc8b9('0x54'))[_0xc8b9('0x4a')](_0xc8b9('0x55'),'t',_0xc8b9('0x56'));var _0x40ae3e=squel['expr']();var _0x303068=[];var _0x28f812=squel[_0xc8b9('0x57')]();var _0x34cd15;if(_0x5200e4[_0xc8b9('0x37')]['search']){_0x34cd15=as[_0xc8b9('0x58')](_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x59')]);var _0x299920=_0x34cd15[_0xc8b9('0x5a')];for(var _0x507592=0x0;_0x507592<_0x34cd15[_0xc8b9('0x5b')]['length'];_0x507592++){var _0x1ac013=_0x34cd15['conditions'][_0x507592];var _0x1d8113='i';var _0x5d46bf=_[_0xc8b9('0x5c')](_0x5e0088,[_0xc8b9('0x36'),_0x1ac013['field']]);if(!_0x5d46bf){switch(_0x1ac013[_0xc8b9('0x44')]){case _0xc8b9('0x5d'):if(_0x1ac013[_0xc8b9('0x5e')]==0x1){_0x324c74[_0xc8b9('0x5f')]('`'+_0x1ac013[_0xc8b9('0x44')]+'`\x20=\x200');}else{_0x324c74['having']('`'+_0x1ac013['field']+_0xc8b9('0x60'));}break;case _0xc8b9('0x61'):if(_0x1ac013[_0xc8b9('0x62')]===_0xc8b9('0x63')){if(_0x1ac013[_0xc8b9('0x5e')][_0xc8b9('0x24')]('\x20')[_0xc8b9('0x3c')]>0x1){_0x40ae3e[_0x299920](_0xc8b9('0x64'),qs['getFullTextValue'](_0x1ac013['value']),null);}else{var _0x2e785f='%'+_0x1ac013['value']+'%';_0x40ae3e[_0x299920](_0xc8b9('0x65'),_0x2e785f,_0x2e785f,_0x2e785f);}}else{_0x5d46bf=_[_0xc8b9('0x5c')](_0x5e0088,[_0xc8b9('0x36'),_0xc8b9('0x66')]);_0x1ac013['field']=_0xc8b9('0x66');_0x2ee46c=as[_0xc8b9('0x67')](_0x1d8113,_0x5d46bf[_0xc8b9('0x33')],_0x1ac013);_0x40ae3e[_0x299920](_0x2ee46c[_0xc8b9('0x68')],_0x2ee46c[_0xc8b9('0x5e')][_0xc8b9('0x69')],_0x2ee46c[_0xc8b9('0x5e')]['end']);}break;case'Tag':var _0x31feee=_0x1ac013[_0xc8b9('0x5e')][_0xc8b9('0x24')](',')[_0xc8b9('0x20')](function(_0x587ad6){return Number(_0x587ad6);});_0x31feee[_0xc8b9('0x25')](function(_0x4391fb){_0x28f812['or'](_0xc8b9('0x6a'),'%,'+_0x4391fb+',%');});_0x303068=_[_0xc8b9('0x6b')](_0x303068,_0x31feee);break;case _0xc8b9('0x6c'):if(_0x1ac013['operator']===_0xc8b9('0x63')){_0x40ae3e[_0x299920](_0xc8b9('0x6d'),'%'+_0x1ac013[_0xc8b9('0x5e')]+'%',null);}else{_0x5d46bf=_[_0xc8b9('0x5c')](_0x5e0088,[_0xc8b9('0x36'),_0xc8b9('0x6e')]);_0x1ac013[_0xc8b9('0x44')]=_0xc8b9('0x6e');_0x2ee46c=as[_0xc8b9('0x67')](_0x1d8113,_0x5d46bf[_0xc8b9('0x33')],_0x1ac013);_0x40ae3e[_0x299920](_0x2ee46c[_0xc8b9('0x68')],_0x2ee46c[_0xc8b9('0x5e')][_0xc8b9('0x69')],_0x2ee46c[_0xc8b9('0x5e')]['end']);}break;case _0xc8b9('0x2a'):_0x2ee46c=as['buildExpression']('me',null,_0x1ac013);_0x40ae3e[_0x299920](_0x2ee46c[_0xc8b9('0x68')],_0x2ee46c[_0xc8b9('0x5e')]['start'],_0x2ee46c[_0xc8b9('0x5e')]['end']);break;}}else{var _0x2ee46c=as[_0xc8b9('0x67')](_0x1d8113,_0x5d46bf['type'],_0x1ac013);_0x40ae3e[_0x299920](_0x2ee46c[_0xc8b9('0x68')],_0x2ee46c['value'][_0xc8b9('0x69')],_0x2ee46c[_0xc8b9('0x5e')][_0xc8b9('0x14')]);}}}else{var _0x3767aa=_(_0x5200e4[_0xc8b9('0x37')])[_0xc8b9('0x38')]()[_0xc8b9('0x20')](function(_0x3d3a45){return _[_0xc8b9('0x6f')](_0x5e0088,[_0xc8b9('0x36'),_0x3d3a45])?_0x3d3a45:undefined;})[_0xc8b9('0x70')]()[_0xc8b9('0x5e')]();if(!_[_0xc8b9('0x71')](_0x3767aa)){_0x3767aa['forEach'](function(_0x5225b6){if(_0x5225b6===_0xc8b9('0x72')){_0x324c74['where'](_0xc8b9('0x73'),[][_0xc8b9('0x74')](_0x5200e4[_0xc8b9('0x37')][_0x5225b6]));}else if(_0x5225b6===_0xc8b9('0x75')){var _0x49819b=JSON[_0xc8b9('0x76')](_0x5200e4[_0xc8b9('0x37')][_0x5225b6])[_0xc8b9('0x77')];var _0x2785da=JSON[_0xc8b9('0x76')](_0x5200e4['query'][_0x5225b6])[_0xc8b9('0x78')];_0x324c74[_0xc8b9('0x41')](_0xc8b9('0x79'),_0x49819b,_0x2785da);}else{if(_0x5200e4[_0xc8b9('0x37')][_0x5225b6]===_0xc8b9('0x7a')){_0x324c74[_0xc8b9('0x41')]('i.'+_0x5225b6+_0xc8b9('0x7b'));}else{_0x324c74[_0xc8b9('0x41')]('i.'+_0x5225b6+'\x20=\x20?',_0x5200e4[_0xc8b9('0x37')][_0x5225b6]);}}});}if(_0x5200e4['query'][_0xc8b9('0x7c')]){if(_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x7c')]==0x1){_0x324c74[_0xc8b9('0x5f')](_0xc8b9('0x7d'));}else{_0x324c74[_0xc8b9('0x5f')](_0xc8b9('0x7e'));}}if(_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x7f')]){_0x303068=_[_0xc8b9('0x80')](_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x7f')])?_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x7f')]:new Array(_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x7f')]);_0x303068['forEach'](function(_0x434537){_0x28f812['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x434537+',%');});}if(_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x81')]){var _0x29b2ee=_0x5200e4['query'][_0xc8b9('0x81')][_0xc8b9('0x82')]('\x5c','\x5c\x5c')[_0xc8b9('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x29b2ee)){_0x40ae3e['or']('i.id\x20LIKE\x20?',_0x29b2ee+'%');}else if(qs[_0xc8b9('0x83')](_0x29b2ee)){_0x40ae3e['or']('c.email\x20LIKE\x20?',_0x29b2ee+'%');}else{_0x40ae3e['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc8b9('0x84')](_0x29b2ee))['or'](_0xc8b9('0x85'),qs[_0xc8b9('0x84')](_0x29b2ee));}}}_0x324c74[_0xc8b9('0x41')](_0x40ae3e);_0x324c74[_0xc8b9('0x86')](_0xc8b9('0x87'));var _0x21367b={'type':db[_0xc8b9('0x88')][_0xc8b9('0x89')][_0xc8b9('0x8a')],'raw':!![]};var _0x2d6682=_0x324c74[_0xc8b9('0x8b')]();_0x2d6682['field']('i.id');_0x2d6682[_0xc8b9('0x44')](_0xc8b9('0x8c'),_0xc8b9('0x5d'));if(_0x5107e7['order']){_0x5107e7['order'][_0xc8b9('0x25')](function(_0x1bf59e){var _0x349ffd=_0x1bf59e[0x0]==='contactName'?_0x1bf59e[0x0]:'i.'+_0x1bf59e[0x0];_0x324c74['order'](_0x349ffd,_0x1bf59e[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc8b9('0x71')](_0x303068)){_0x324c74[_0xc8b9('0x5f')](_0x28f812);_0x2d6682[_0xc8b9('0x41')](_0xc8b9('0x8d'),_0x303068);}BPromise['resolve']()[_0xc8b9('0x1a')](function(){if(!_0x34cd15){if(_0x5200e4[_0xc8b9('0x37')]['MailAccountId'])return;_0x2d6682['where'](_0xc8b9('0x8e'));_0x324c74[_0xc8b9('0x41')](_0xc8b9('0x8e'));return;}if(_0x5200e4[_0xc8b9('0x8f')][_0xc8b9('0x90')]!==_0xc8b9('0x91'))return;return _0x5200e4[_0xc8b9('0x8f')][_0xc8b9('0x92')]({'attributes':['id'],'raw':!![]})[_0xc8b9('0x1a')](function(_0x52b5d3){if(_[_0xc8b9('0x71')](_0x52b5d3)){_0x2d6682[_0xc8b9('0x41')](_0xc8b9('0x93'));_0x324c74['where'](_0xc8b9('0x93'));}else{_0x2d6682[_0xc8b9('0x41')]('i.MailAccountId\x20IN\x20?',_[_0xc8b9('0x20')](_0x52b5d3,'id'));_0x324c74[_0xc8b9('0x41')](_0xc8b9('0x73'),_[_0xc8b9('0x20')](_0x52b5d3,'id'));}});})['then'](function(){if(_0x5200e4[_0xc8b9('0x8f')][_0xc8b9('0x90')]===_0xc8b9('0x91')&&!_0x34cd15&&!_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x72')])return[];return db['sequelize']['query'](_0x2d6682['toString'](),_0x21367b);})['then'](function(_0x9c5044){_0x2938a3[_0xc8b9('0x18')]=_0x9c5044[_0xc8b9('0x3c')];if(_0x2938a3[_0xc8b9('0x18')]===0x0)return[];return db[_0xc8b9('0x94')][_0xc8b9('0x37')](_0x3cb68a[_0xc8b9('0x95')](),_0x21367b)['then'](function(_0x1b21e0){_0x5805e0=_['keyBy'](_0x1b21e0,'id');_0x21367b=_['merge'](_0x21367b,{'model':db[_0xc8b9('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5200e4[_0xc8b9('0x37')][_0xc8b9('0x3b')]){_0x5107e7[_0xc8b9('0x39')][_0xc8b9('0x25')](function(_0x486674){_0x324c74[_0xc8b9('0x44')]('i.'+_0x486674);});}else{_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x8c'),_0xc8b9('0x5d'));_0x324c74[_0xc8b9('0x44')]('a.key',_0xc8b9('0x96'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x97'),_0xc8b9('0x98'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x99'),_0xc8b9('0x9a'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x87'));_0x324c74[_0xc8b9('0x44')]('i.createdAt');_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x9b'));_0x324c74[_0xc8b9('0x44')]('i.closed');_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x9c'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x9d'));_0x324c74['field']('i.lastMsgAt');_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x9e'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0x9f'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa0'));_0x324c74['field']('i.secondDisposition');_0x324c74[_0xc8b9('0x44')]('i.thirdDisposition');_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa1'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa2'));_0x324c74[_0xc8b9('0x44')]('i.ContactId');_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa3'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa4'));_0x324c74[_0xc8b9('0x44')]('c.firstName',_0xc8b9('0xa5'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa6'),_0xc8b9('0xa7'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xa8'),'Contact.email');_0x324c74[_0xc8b9('0x44')]('c.phone',_0xc8b9('0xa9'));_0x324c74['field']('c.mobile',_0xc8b9('0xaa'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xab'),_0xc8b9('0xac'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xad'),_0xc8b9('0xae'));_0x324c74[_0xc8b9('0x44')](_0xc8b9('0xaf'),'Owner.internal');_0x324c74['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x5107e7['limit'])_0x324c74[_0xc8b9('0x17')](_0x5107e7['limit']);if(_0x5107e7['offset'])_0x324c74[_0xc8b9('0x15')](_0x5107e7[_0xc8b9('0x15')]);return db['sequelize'][_0xc8b9('0x37')](_0x324c74[_0xc8b9('0x95')](),_0x21367b);})[_0xc8b9('0x1a')](function(_0x10cc22){if(_0x10cc22['length']>0x0)_0x2184d4[_0xc8b9('0x41')](_0xc8b9('0xb0'),_['map'](_0x10cc22,'id'));return db['sequelize'][_0xc8b9('0x37')](_0x2184d4[_0xc8b9('0x95')](),_0x21367b)[_0xc8b9('0x1a')](function(_0x2ca982){var _0x15164e=_[_0xc8b9('0xb1')](_0x2ca982,'MailInteractionId');var _0x5576f1=[];return db[_0xc8b9('0xb2')]['findOne']({'attributes':[_0xc8b9('0xb3')],'raw':!![]})[_0xc8b9('0x1a')](function(_0x2c3400){var _0x59f9e6=_0x2c3400['enableEmailPreview'];_0x10cc22[_0xc8b9('0x25')](function(_0x7045d8){_0x5576f1[_0xc8b9('0x26')](updateMailInteraction(_0x7045d8,_0x5805e0,_0x15164e,_0x59f9e6));});return BPromise[_0xc8b9('0xb4')](_0x5576f1);});});});})[_0xc8b9('0x1a')](function(_0x78089c){_0x2938a3[_0xc8b9('0xb5')]=_0x78089c;return _0x2938a3;})[_0xc8b9('0x1a')](respondWithFilteredResult(_0x1b15b4,_0x5107e7))[_0xc8b9('0x2e')](handleError(_0x1b15b4,null));};exports[_0xc8b9('0xb6')]=function(_0xe04cdd,_0x59e3f8){var _0x2f9040={'raw':![],'where':{'id':_0xe04cdd['params']['id']}},_0x1b6788={};_0x1b6788[_0xc8b9('0x35')]=_[_0xc8b9('0x38')](db[_0xc8b9('0x30')][_0xc8b9('0x31')]);_0x1b6788['query']=_[_0xc8b9('0x38')](_0xe04cdd[_0xc8b9('0x37')]);_0x1b6788[_0xc8b9('0x42')]=_[_0xc8b9('0x3a')](_0x1b6788['model'],_0x1b6788[_0xc8b9('0x37')]);_0x2f9040[_0xc8b9('0x39')]=_[_0xc8b9('0x3a')](_0x1b6788['model'],qs[_0xc8b9('0x3b')](_0xe04cdd[_0xc8b9('0x37')]['fields']));_0x2f9040[_0xc8b9('0x39')]=_0x2f9040[_0xc8b9('0x39')][_0xc8b9('0x3c')]?_0x2f9040['attributes']:_0x1b6788[_0xc8b9('0x35')];if(_0xe04cdd[_0xc8b9('0x37')][_0xc8b9('0xb7')]){_0x2f9040[_0xc8b9('0xb8')]=[{'all':!![]}];}_0x2f9040=_[_0xc8b9('0xb9')]({},_0x2f9040,_0xe04cdd[_0xc8b9('0xba')]);return db['MailInteraction'][_0xc8b9('0x5c')](_0x2f9040)['then'](handleEntityNotFound(_0x59e3f8,null))[_0xc8b9('0x1a')](respondWithResult(_0x59e3f8,null))['catch'](handleError(_0x59e3f8,null));};exports[_0xc8b9('0xbb')]=function(_0x5b33ef,_0x2782fa){return db['MailInteraction'][_0xc8b9('0xbb')](_0x5b33ef['body'],{})['then'](respondWithResult(_0x2782fa,0xc9))[_0xc8b9('0x2e')](handleError(_0x2782fa,null));};exports[_0xc8b9('0xbc')]=function(_0x2e7ea2,_0x55fe26){if(_0x2e7ea2[_0xc8b9('0xbd')]['id']){delete _0x2e7ea2[_0xc8b9('0xbd')]['id'];}return db[_0xc8b9('0x30')][_0xc8b9('0x5c')]({'where':{'id':_0x2e7ea2['params']['id']}})['then'](handleEntityNotFound(_0x55fe26,null))['then'](saveUpdates(_0x2e7ea2['body'],null))['then'](respondWithResult(_0x55fe26,null))[_0xc8b9('0x2e')](handleError(_0x55fe26,null));};exports[_0xc8b9('0x1b')]=function(_0x1846b1,_0x34c657){return db[_0xc8b9('0x30')]['find']({'where':{'id':_0x1846b1[_0xc8b9('0xbe')]['id']}})[_0xc8b9('0x1a')](handleEntityNotFound(_0x34c657,null))[_0xc8b9('0x1a')](removeEntity(_0x34c657,null))[_0xc8b9('0x2e')](handleError(_0x34c657,null));};exports[_0xc8b9('0xbf')]=function(_0x4a21d8,_0x1bd58b){return db[_0xc8b9('0x30')]['describe']()[_0xc8b9('0x1a')](respondWithResult(_0x1bd58b,null))[_0xc8b9('0x2e')](handleError(_0x1bd58b,null));};exports['addMessage']=function(_0x2e3f29,_0x326bca){return db[_0xc8b9('0x27')][_0xc8b9('0x5c')]({'where':{'id':_0x2e3f29[_0xc8b9('0xbe')]['id']}})[_0xc8b9('0x1a')](handleEntityNotFound(_0x326bca,null))[_0xc8b9('0x1a')](function(_0xf14294){if(_0xf14294){return _0xf14294[_0xc8b9('0xc0')](_0x2e3f29[_0xc8b9('0xbd')][_0xc8b9('0xc1')],_['omit'](_0x2e3f29[_0xc8b9('0xbd')],[_0xc8b9('0xc1'),'id'])||{});}})[_0xc8b9('0x1a')](respondWithResult(_0x326bca,null))[_0xc8b9('0x2e')](handleError(_0x326bca,null));};exports[_0xc8b9('0xc2')]=function(_0x402d82,_0x3585ef){var _0x450525={'raw':![],'where':{}};var _0x56a07a={};var _0x50db80={'count':0x0,'rows':[]};return db[_0xc8b9('0x30')][_0xc8b9('0x28')]({'where':{'id':_0x402d82['params']['id']}})[_0xc8b9('0x1a')](handleEntityNotFound(_0x3585ef,null))[_0xc8b9('0x1a')](function(_0x5ac87c){if(_0x5ac87c){_0x56a07a[_0xc8b9('0x35')]=_[_0xc8b9('0x38')](db[_0xc8b9('0x27')]['rawAttributes']);_0x56a07a[_0xc8b9('0x37')]=_[_0xc8b9('0x38')](_0x402d82['query']);_0x56a07a[_0xc8b9('0x42')]=_[_0xc8b9('0x3a')](_0x56a07a[_0xc8b9('0x35')],_0x56a07a[_0xc8b9('0x37')]);_0x450525[_0xc8b9('0x39')]=_[_0xc8b9('0x3a')](_0x56a07a['model'],qs['fields'](_0x402d82[_0xc8b9('0x37')][_0xc8b9('0x3b')]));_0x450525[_0xc8b9('0x39')]=_0x450525[_0xc8b9('0x39')][_0xc8b9('0x3c')]?_0x450525[_0xc8b9('0x39')]:_0x56a07a[_0xc8b9('0x35')];if(!_0x402d82[_0xc8b9('0x37')][_0xc8b9('0x3d')](_0xc8b9('0x3e'))){_0x450525[_0xc8b9('0x17')]=qs[_0xc8b9('0x17')](_0x402d82[_0xc8b9('0x37')][_0xc8b9('0x17')]);_0x450525[_0xc8b9('0x15')]=qs[_0xc8b9('0x15')](_0x402d82[_0xc8b9('0x37')][_0xc8b9('0x15')]);}_0x450525[_0xc8b9('0x3f')]=qs[_0xc8b9('0x40')](_0x402d82['query'][_0xc8b9('0x40')]);_0x450525[_0xc8b9('0x41')]=qs[_0xc8b9('0x42')](_[_0xc8b9('0xc3')](_0x402d82[_0xc8b9('0x37')],_0x56a07a[_0xc8b9('0x42')]));_0x450525['where'][_0xc8b9('0xc4')]=_0x5ac87c['id'];if(_0x402d82[_0xc8b9('0x37')]['filter']){_0x450525['where']=_[_0xc8b9('0xb9')](_0x450525[_0xc8b9('0x41')],{'$or':_['map'](_0x450525[_0xc8b9('0x39')],function(_0x38e4b0){var _0x4da787={};_0x4da787[_0x38e4b0]={'$like':'%'+_0x402d82[_0xc8b9('0x37')][_0xc8b9('0x81')]+'%'};return _0x4da787;})});}if(_0x402d82[_0xc8b9('0x37')]['$gte']){var _0x1c0ce9=_0x402d82[_0xc8b9('0x37')][_0xc8b9('0x77')][_0xc8b9('0x24')](',');var _0x1a7616={};_0x1a7616[_0x1c0ce9[0x0]]={'$gte':moment(_0x1c0ce9[0x1])[_0xc8b9('0xc5')](_0xc8b9('0xc6'))};_0x450525[_0xc8b9('0x41')]=_[_0xc8b9('0xb9')](_0x450525[_0xc8b9('0x41')],_0x1a7616);}_0x450525=_[_0xc8b9('0xb9')]({},_0x450525,_0x402d82['options']);return db[_0xc8b9('0x27')][_0xc8b9('0x18')]({'where':_0x450525[_0xc8b9('0x41')]})[_0xc8b9('0x1a')](function(_0x5e5f21){_0x50db80[_0xc8b9('0x18')]=_0x5e5f21;if(_0x402d82[_0xc8b9('0x37')][_0xc8b9('0xb7')]){_0x450525[_0xc8b9('0xb8')]=[{'all':!![]}];}return db[_0xc8b9('0x27')][_0xc8b9('0xc7')](_0x450525);})[_0xc8b9('0x1a')](function(_0xd63bb9){if(_0x402d82[_0xc8b9('0x37')]['inlineCss']===_0xc8b9('0xc8')){for(var _0x528a58=0x0;_0x528a58<_0xd63bb9['length'];_0x528a58++){_0xd63bb9[_0x528a58][_0xc8b9('0xbd')]=juice(_0xd63bb9[_0x528a58][_0xc8b9('0xbd')]);}}_0x50db80[_0xc8b9('0xb5')]=_0xd63bb9;return _0x50db80;});}})['then'](respondWithFilteredResult(_0x3585ef,_0x450525))['catch'](handleError(_0x3585ef,null));};exports['addTags']=function(_0x300f72,_0x3a2d08){return db[_0xc8b9('0x30')][_0xc8b9('0x5c')]({'where':{'id':_0x300f72['params']['id']}})['then'](handleEntityNotFound(_0x3a2d08,null))[_0xc8b9('0x1a')](function(_0x5e777a){if(_0x5e777a){return _0x5e777a[_0xc8b9('0xc9')](_0x300f72[_0xc8b9('0xbd')][_0xc8b9('0xc1')],_['omit'](_0x300f72[_0xc8b9('0xbd')],[_0xc8b9('0xc1'),'id'])||{})[_0xc8b9('0xca')](function(){return db[_0xc8b9('0xcb')]['findAll']({'attributes':['id',_0xc8b9('0x36'),_0xc8b9('0x45')],'where':{'id':_0x300f72['body'][_0xc8b9('0xc1')]}});})[_0xc8b9('0x1a')](function(_0x1fd337){socket[_0xc8b9('0xcc')](_0xc8b9('0xcd'),{'id':Number(_0x300f72[_0xc8b9('0xbe')]['id']),'tags':_0x1fd337||[]});return{'id':Number(_0x300f72[_0xc8b9('0xbe')]['id']),'tags':_0x1fd337||[]};});}})[_0xc8b9('0x1a')](respondWithResult(_0x3a2d08,null))[_0xc8b9('0x2e')](handleError(_0x3a2d08,null));};exports[_0xc8b9('0xce')]=function(_0x106ffa,_0x236389){return db['MailInteraction'][_0xc8b9('0x5c')]({'where':{'id':_0x106ffa[_0xc8b9('0xbe')]['id']}})['then'](handleEntityNotFound(_0x236389,null))['then'](function(_0x2706b3){if(_0x2706b3){return _0x2706b3[_0xc8b9('0xce')](_0x106ffa[_0xc8b9('0x37')][_0xc8b9('0xc1')]);}})[_0xc8b9('0x1a')](respondWithStatusCode(_0x236389,null))[_0xc8b9('0x2e')](handleError(_0x236389,null));};exports[_0xc8b9('0xcf')]=function(_0x1ff75e,_0xf9ca24){var _0x43e5ba=moment()[_0xc8b9('0xd0')]()[_0xc8b9('0x95')]();var _0x198437=path[_0xc8b9('0xd1')](config['root'],_0xc8b9('0xd2'),'files',_0xc8b9('0xd3'));var _0x21fdf4=path['join'](config[_0xc8b9('0xd4')],_0xc8b9('0xd2'),_0xc8b9('0xd5'),_0xc8b9('0xd6'));var _0x22d02d=path['join'](_0x198437,_0x43e5ba);var _0x35b28b=util[_0xc8b9('0xc5')](_0xc8b9('0xd7'),_0x1ff75e[_0xc8b9('0xbe')]['id'],_0x43e5ba);var _0x2a3007=path['join'](_0x198437,_0x35b28b);var _0x9fce98=[];if(_0x1ff75e[_0xc8b9('0x37')][_0xc8b9('0xd6')]){_0x9fce98[_0xc8b9('0x26')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x4066d4=[{'model':db[_0xc8b9('0x27')],'as':_0xc8b9('0xd8'),'attributes':['id',_0xc8b9('0xbd'),_0xc8b9('0x46'),'to','cc',_0xc8b9('0xd9'),_0xc8b9('0xda'),_0xc8b9('0x75')],'where':{'secret':![]},'order':qs[_0xc8b9('0x40')]('id'),'include':_0x9fce98}];return db[_0xc8b9('0x30')]['find']({'where':{'id':_0x1ff75e[_0xc8b9('0xbe')]['id']},'include':_0x4066d4})[_0xc8b9('0x1a')](handleEntityNotFound(_0xf9ca24,null))[_0xc8b9('0x1a')](function(_0x3a3f99){if(_0x3a3f99&&_0x3a3f99['Messages']){var _0x5ab028=_0x3a3f99[_0xc8b9('0xdb')]({'plain':!![]});fs['mkdirSync'](_0x22d02d);return BPromise[_0xc8b9('0xdc')](_0x5ab028[_0xc8b9('0xd8')],function(_0x4e4fd1,_0xdc48de){var _0x765bb7={'from':_0x4e4fd1['from'],'to':_0x4e4fd1['to'],'subject':_0x4e4fd1[_0xc8b9('0xda')],'html':htmlEntities[_0xc8b9('0xdd')](_0x4e4fd1[_0xc8b9('0xbd')]),'headers':{'Date':moment(_0x4e4fd1['createdAt'])[_0xc8b9('0xc5')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4e4fd1['cc']){_0x765bb7[_0xc8b9('0xde')]['Cc']=_0x4e4fd1['cc'];}if(_0x4e4fd1[_0xc8b9('0xd9')]){_0x765bb7[_0xc8b9('0xde')][_0xc8b9('0xdf')]=_0x4e4fd1[_0xc8b9('0xd9')];}return new BPromise(function(_0x41bc0b,_0x2690c9){if(_0x4e4fd1[_0xc8b9('0xe0')]){for(var _0x215a5e=0x0;_0x215a5e<_0x4e4fd1[_0xc8b9('0xe0')]['length'];_0x215a5e++){var _0x12356d=_0x4e4fd1[_0xc8b9('0xe0')][_0x215a5e];var _0x50a55a=path[_0xc8b9('0xd1')](_0x21fdf4,_0x12356d[_0xc8b9('0xe1')]);if(fs['existsSync'](_0x50a55a)){_0x765bb7['attachments']['push']({'name':_0x12356d[_0xc8b9('0x36')],'contentType':_0x12356d[_0xc8b9('0x33')],'data':fs[_0xc8b9('0xe2')](_0x50a55a)});}}}emlformat[_0xc8b9('0xe3')](_0x765bb7,function(_0xcf2420,_0x52546d){if(_0xcf2420)return _0x2690c9(_0xcf2420);fs[_0xc8b9('0xe4')](path[_0xc8b9('0xd1')](_0x22d02d,util[_0xc8b9('0xc5')]('message%d.eml',_0xdc48de)),_0x52546d);return _0x41bc0b(_0x52546d);});});})['then'](function(){return new BPromise(function(_0x11c46f,_0x568d9e){zipdir(_0x22d02d,{'saveTo':_0x2a3007},function(_0x208475,_0x112a8a){if(_0x208475)return _0x568d9e(_0x208475);return _0x11c46f(_0x112a8a);});})[_0xc8b9('0x1a')](function(){return new BPromise(function(_0x4e1212,_0x137069){rimraf(_0x22d02d,function(_0x48c92a){if(_0x48c92a)_0x137069(_0x48c92a);return _0x4e1212();});});})[_0xc8b9('0x1a')](function(){return _0xf9ca24['download'](_0x2a3007,_0x35b28b,function(_0x4e9a76){if(!_0x4e9a76)fs['unlinkSync'](_0x2a3007);});});});}else{return _0xf9ca24[_0xc8b9('0x12')](0xc8);}})[_0xc8b9('0x2e')](handleError(_0xf9ca24,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8d0f8fd..83f7dc3 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 _0x3fa8=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x406385,_0xfdac3c){var _0xe94047=function(_0x1fb1fd){while(--_0x1fb1fd){_0x406385['push'](_0x406385['shift']());}};_0xe94047(++_0xfdac3c);}(_0x3fa8,0x183));var _0x83fa=function(_0x230471,_0x10441f){_0x230471=_0x230471-0x0;var _0x5dd908=_0x3fa8[_0x230471];return _0x5dd908;};'use strict';var EventEmitter=require(_0x83fa('0x0'));var MailInteraction=require(_0x83fa('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x83fa('0x1'))['db'][_0x83fa('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x83fa('0x3')](0x0);var events={'afterCreate':_0x83fa('0x4'),'afterUpdate':_0x83fa('0x5'),'afterDestroy':_0x83fa('0x6')};function emitEvent(_0x23a58e){return function(_0x521e9e,_0x4a8c06,_0x17b1e8){_0x521e9e[_0x83fa('0x7')]({'attributes':['id'],'raw':!![]})[_0x83fa('0x8')](function(_0x36b8e7){_0x521e9e[_0x83fa('0x9')](_0x83fa('0xa'),_0x36b8e7[_0x83fa('0xb')](function(_0xaa9a08){return{'id':_0xaa9a08['id']};}));return MailMessage[_0x83fa('0xc')]({'where':{'MailInteractionId':_0x521e9e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x83fa('0x8')](function(_0x5ef870){_0x521e9e[_0x83fa('0x9')](_0x83fa('0xd'),_0x5ef870[_0x83fa('0xe')]);MailInteractionEvents[_0x83fa('0xf')](_0x23a58e+':'+_0x521e9e['id'],_0x521e9e);MailInteractionEvents['emit'](_0x23a58e,_0x521e9e);_0x17b1e8(null);})[_0x83fa('0x10')](_0x17b1e8(null));};}for(var e in events){if(events[_0x83fa('0x11')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x83fa('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x002a=['setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage'];(function(_0x59d1fb,_0x39ed2d){var _0x37ab20=function(_0x5c955e){while(--_0x5c955e){_0x59d1fb['push'](_0x59d1fb['shift']());}};_0x37ab20(++_0x39ed2d);}(_0x002a,0x130));var _0xa002=function(_0x4ee602,_0x3c24e3){_0x4ee602=_0x4ee602-0x0;var _0x39c747=_0x002a[_0x4ee602];return _0x39c747;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0xa002('0x0'))['db'][_0xa002('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa002('0x2')](0x0);var events={'afterCreate':_0xa002('0x3'),'afterUpdate':_0xa002('0x4'),'afterDestroy':_0xa002('0x5')};function emitEvent(_0x5982d3){return function(_0x10735f,_0x196d07,_0x394186){_0x10735f[_0xa002('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xbef3c3){_0x10735f['setDataValue'](_0xa002('0x7'),_0xbef3c3[_0xa002('0x8')](function(_0x1540df){return{'id':_0x1540df['id']};}));return MailMessage[_0xa002('0x9')]({'where':{'MailInteractionId':_0x10735f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa002('0xa')](function(_0x3bd83a){_0x10735f['setDataValue'](_0xa002('0xb'),_0x3bd83a[_0xa002('0xc')]);MailInteractionEvents[_0xa002('0xd')](_0x5982d3+':'+_0x10735f['id'],_0x10735f);MailInteractionEvents['emit'](_0x5982d3,_0x10735f);_0x394186(null);})[_0xa002('0xe')](_0x394186(null));};}for(var e in events){if(events[_0xa002('0xf')](e)){var event=events[e];MailInteraction[_0xa002('0x10')](e,emitEvent(event));}}module[_0xa002('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2e1dcd6..510bdef 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 _0x5769=['FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','subject'];(function(_0x107502,_0x302aba){var _0x22b9af=function(_0x231bb8){while(--_0x231bb8){_0x107502['push'](_0x107502['shift']());}};_0x22b9af(++_0x302aba);}(_0x5769,0x85));var _0x9576=function(_0x2b285c,_0x4682cd){_0x2b285c=_0x2b285c-0x0;var _0x5a38cf=_0x5769[_0x2b285c];return _0x5a38cf;};'use strict';var _=require(_0x9576('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9576('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9576('0x2'));var rimraf=require(_0x9576('0x3'));var config=require(_0x9576('0x4'));var attributes=require(_0x9576('0x5'));module[_0x9576('0x6')]=function(_0x8d27e6,_0x11115a){return _0x8d27e6[_0x9576('0x7')](_0x9576('0x8'),attributes,{'tableName':_0x9576('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x9576('0xa'),'to'],'type':_0x9576('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17b06d,_0x2d70c7,_0x4d9008){if(_0x17b06d[_0x9576('0xc')]){_0x17b06d[_0x9576('0xd')]=moment()[_0x9576('0xe')](_0x9576('0xf'));}if(_0x17b06d['closed']){_0x17b06d[_0x9576('0x10')]=moment()[_0x9576('0xe')](_0x9576('0xf'));}_0x4d9008(null,_0x2d70c7);},'beforeUpdate':function(_0x5a38cb,_0x31991e,_0x52b4ac){if(_0x5a38cb[_0x9576('0x11')](_0x9576('0xc'))){_0x5a38cb[_0x9576('0xd')]=_0x5a38cb['substatus']?moment()[_0x9576('0xe')](_0x9576('0xf')):null;}if(_0x5a38cb[_0x9576('0x11')](_0x9576('0x12'))){_0x5a38cb[_0x9576('0x10')]=moment()[_0x9576('0xe')](_0x9576('0xf'));_0x5a38cb[_0x9576('0xc')]=null;_0x5a38cb[_0x9576('0xd')]=null;}_0x52b4ac(null,_0x5a38cb);},'afterUpdate':function(_0x4173b5,_0xd29e8a,_0x2b7397){var _0x2eba6b=_0x8d27e6['models'];var _0xffcd05=_0x4173b5['get']({'plain':!![]});if(_0xffcd05[_0x9576('0x12')]){return _0x2eba6b[_0x9576('0x13')][_0x9576('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0xffcd05['id']}})[_0x9576('0x15')](function(){_0x2b7397();})['catch'](function(_0x3bbce0){_0x2b7397(_0x3bbce0);});}else{_0x2b7397();}}},'charset':_0x9576('0x16'),'collate':_0x9576('0x17')});}; \ No newline at end of file +var _0x75ed=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','closed','models','get','MailMessage','update','catch'];(function(_0x4dd656,_0x1dba9a){var _0x4217b3=function(_0x5d7c8c){while(--_0x5d7c8c){_0x4dd656['push'](_0x4dd656['shift']());}};_0x4217b3(++_0x1dba9a);}(_0x75ed,0x188));var _0xd75e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x75ed[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd75e('0x0'));var util=require(_0xd75e('0x1'));var logger=require(_0xd75e('0x2'))(_0xd75e('0x3'));var moment=require(_0xd75e('0x4'));var BPromise=require('bluebird');var rp=require(_0xd75e('0x5'));var fs=require('fs');var path=require(_0xd75e('0x6'));var rimraf=require(_0xd75e('0x7'));var config=require(_0xd75e('0x8'));var attributes=require(_0xd75e('0x9'));module[_0xd75e('0xa')]=function(_0x3052da,_0x12da4e){return _0x3052da['define'](_0xd75e('0xb'),attributes,{'tableName':_0xd75e('0xc'),'paranoid':![],'indexes':[{'name':_0xd75e('0xd'),'fields':[_0xd75e('0xe'),'to'],'type':_0xd75e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1bcb77,_0x25ba42,_0x5a6690){if(_0x1bcb77[_0xd75e('0x10')]){_0x1bcb77[_0xd75e('0x11')]=moment()['format'](_0xd75e('0x12'));}if(_0x1bcb77['closed']){_0x1bcb77[_0xd75e('0x13')]=moment()[_0xd75e('0x14')](_0xd75e('0x12'));}_0x5a6690(null,_0x25ba42);},'beforeUpdate':function(_0x5be1b6,_0x2e23b0,_0x2b79e6){if(_0x5be1b6[_0xd75e('0x15')](_0xd75e('0x10'))){_0x5be1b6[_0xd75e('0x11')]=_0x5be1b6[_0xd75e('0x10')]?moment()[_0xd75e('0x14')](_0xd75e('0x12')):null;}if(_0x5be1b6[_0xd75e('0x15')](_0xd75e('0x16'))){_0x5be1b6['closedAt']=moment()[_0xd75e('0x14')](_0xd75e('0x12'));_0x5be1b6[_0xd75e('0x10')]=null;_0x5be1b6[_0xd75e('0x11')]=null;}_0x2b79e6(null,_0x5be1b6);},'afterUpdate':function(_0x4bd3df,_0x3131a6,_0x534293){var _0x30004c=_0x3052da[_0xd75e('0x17')];var _0x48b951=_0x4bd3df[_0xd75e('0x18')]({'plain':!![]});if(_0x48b951['closed']){return _0x30004c[_0xd75e('0x19')][_0xd75e('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x48b951['id']}})['then'](function(){_0x534293();})[_0xd75e('0x1b')](function(_0x29d627){_0x534293(_0x29d627);});}else{_0x534293();}}},'charset':_0xd75e('0x1c'),'collate':_0xd75e('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c6fbed8..56e0f22 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 _0x4d49=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','limit','stringify','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ff5cb,_0x256a51){var _0x4b93e3=function(_0x154f90){while(--_0x154f90){_0x1ff5cb['push'](_0x1ff5cb['shift']());}};_0x4b93e3(++_0x256a51);}(_0x4d49,0x141));var _0x94d4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d49[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x94d4('0x0'));var moment=require('moment');var BPromise=require(_0x94d4('0x1'));var rs=require(_0x94d4('0x2'));var fs=require('fs');var Redis=require(_0x94d4('0x3'));var db=require(_0x94d4('0x4'))['db'];var utils=require(_0x94d4('0x5'));var logger=require(_0x94d4('0x6'))(_0x94d4('0x7'));var config=require(_0x94d4('0x8'));var jayson=require(_0x94d4('0x9'));var client=jayson['client'][_0x94d4('0xa')]({'port':0x232a});config[_0x94d4('0xb')]=_[_0x94d4('0xc')](config[_0x94d4('0xb')],{'host':_0x94d4('0xd'),'port':0x18eb});var socket=require(_0x94d4('0xe'))(new Redis(config['redis']));require(_0x94d4('0xf'))[_0x94d4('0x10')](socket);function respondWithRpcPromise(_0x562265,_0x23ef86,_0x283f63){return new BPromise(function(_0xd7820d,_0x2720dd){return client['request'](_0x562265,_0x283f63)[_0x94d4('0x11')](function(_0xe7f878){logger[_0x94d4('0x12')](_0x94d4('0x13'),_0x23ef86,_0x94d4('0x14'));logger[_0x94d4('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x23ef86,'request\x20sent',JSON['stringify'](_0xe7f878));if(_0xe7f878[_0x94d4('0x16')]){if(_0xe7f878[_0x94d4('0x16')]['code']===0x1f4){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0x2720dd(_0xe7f878['error'][_0x94d4('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0xd7820d(_0xe7f878[_0x94d4('0x16')][_0x94d4('0x17')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x23ef86,'request\x20sent');_0xd7820d(_0xe7f878[_0x94d4('0x18')][_0x94d4('0x17')]);}})[_0x94d4('0x19')](function(_0x47b760){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0x47b760);_0x2720dd(_0x47b760);});});}exports[_0x94d4('0x1a')]=function(_0x58fbb2){var _0x1d61b7=this;return new Promise(function(_0x3e1482,_0x38486e){return db[_0x94d4('0x1b')]['update'](_0x58fbb2[_0x94d4('0x1c')],{'raw':_0x58fbb2['options']?_0x58fbb2[_0x94d4('0x1d')][_0x94d4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58fbb2[_0x94d4('0x1d')]?_0x58fbb2[_0x94d4('0x1d')]['where']||null:null,'attributes':_0x58fbb2[_0x94d4('0x1d')]?_0x58fbb2[_0x94d4('0x1d')]['attributes']||null:null,'limit':_0x58fbb2['options']?_0x58fbb2[_0x94d4('0x1d')][_0x94d4('0x1f')]||null:null})[_0x94d4('0x11')](function(_0x4af43d){logger[_0x94d4('0x12')]('UpdateMailInteraction',_0x58fbb2);logger[_0x94d4('0x15')]('UpdateMailInteraction',_0x58fbb2,JSON[_0x94d4('0x20')](_0x4af43d));_0x3e1482(_0x4af43d);})[_0x94d4('0x19')](function(_0x22f926){logger[_0x94d4('0x16')](_0x94d4('0x1a'),_0x22f926[_0x94d4('0x17')],_0x58fbb2);_0x38486e(_0x1d61b7['error'](0x1f4,_0x22f926[_0x94d4('0x17')]));});});};exports[_0x94d4('0x21')]=function(_0x36efa4){return new Promise(function(_0x36215d,_0x2c22c0){return db[_0x94d4('0x1b')][_0x94d4('0x22')]({'where':_0x36efa4[_0x94d4('0x1d')]?_0x36efa4[_0x94d4('0x1d')][_0x94d4('0x23')]||null:null})['then'](function(_0x27aa72){if(_0x27aa72){return _0x27aa72[_0x94d4('0x24')](_0x36efa4['body'][_0x94d4('0x25')],_[_0x94d4('0x26')](_0x36efa4[_0x94d4('0x1c')],[_0x94d4('0x25'),'id'])||{});}})[_0x94d4('0x27')](function(_0x397891){logger[_0x94d4('0x12')](_0x94d4('0x28'),_0x36efa4);logger[_0x94d4('0x15')](_0x94d4('0x28'),_0x36efa4,JSON[_0x94d4('0x20')](_0x397891));_0x36215d(_0x397891);})[_0x94d4('0x19')](function(_0x3ec6b1){logger[_0x94d4('0x16')](_0x94d4('0x28'),_0x3ec6b1[_0x94d4('0x17')],_0x36efa4);_0x2c22c0(_this[_0x94d4('0x16')](0x1f4,_0x3ec6b1[_0x94d4('0x17')]));});});}; \ No newline at end of file +var _0xe774=['where','addTags','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailInteraction','update','body','options','attributes','limit','then','AddTagsToMailInteraction','find'];(function(_0x54d301,_0x1bea35){var _0x546df7=function(_0x3d09ec){while(--_0x3d09ec){_0x54d301['push'](_0x54d301['shift']());}};_0x546df7(++_0x1bea35);}(_0xe774,0x135));var _0x4e77=function(_0xc30612,_0x5387bb){_0xc30612=_0xc30612-0x0;var _0x318ec5=_0xe774[_0xc30612];return _0x318ec5;};'use strict';var _=require(_0x4e77('0x0'));var util=require(_0x4e77('0x1'));var moment=require(_0x4e77('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e77('0x3'));var fs=require('fs');var Redis=require(_0x4e77('0x4'));var db=require(_0x4e77('0x5'))['db'];var utils=require(_0x4e77('0x6'));var logger=require(_0x4e77('0x7'))(_0x4e77('0x8'));var config=require(_0x4e77('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4e77('0xa')][_0x4e77('0xb')]({'port':0x232a});config[_0x4e77('0xc')]=_['defaults'](config['redis'],{'host':_0x4e77('0xd'),'port':0x18eb});var socket=require(_0x4e77('0xe'))(new Redis(config[_0x4e77('0xc')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x948797,_0x2519ed,_0x5027f4){return new BPromise(function(_0x216add,_0x56312c){return client['request'](_0x948797,_0x5027f4)['then'](function(_0x3d3bcc){logger[_0x4e77('0xf')](_0x4e77('0x10'),_0x2519ed,_0x4e77('0x11'));logger[_0x4e77('0x12')](_0x4e77('0x13'),_0x2519ed,'request\x20sent',JSON[_0x4e77('0x14')](_0x3d3bcc));if(_0x3d3bcc[_0x4e77('0x15')]){if(_0x3d3bcc[_0x4e77('0x15')][_0x4e77('0x16')]===0x1f4){logger[_0x4e77('0x15')](_0x4e77('0x10'),_0x2519ed,_0x3d3bcc[_0x4e77('0x15')][_0x4e77('0x17')]);return _0x56312c(_0x3d3bcc[_0x4e77('0x15')][_0x4e77('0x17')]);}logger[_0x4e77('0x15')]('MailInteraction,\x20%s,\x20%s',_0x2519ed,_0x3d3bcc[_0x4e77('0x15')][_0x4e77('0x17')]);return _0x216add(_0x3d3bcc['error'][_0x4e77('0x17')]);}else{logger[_0x4e77('0xf')](_0x4e77('0x10'),_0x2519ed,_0x4e77('0x11'));_0x216add(_0x3d3bcc['result'][_0x4e77('0x17')]);}})['catch'](function(_0x318993){logger[_0x4e77('0x15')](_0x4e77('0x10'),_0x2519ed,_0x318993);_0x56312c(_0x318993);});});}exports[_0x4e77('0x18')]=function(_0x468d59){var _0x11bfe5=this;return new Promise(function(_0x3e58e5,_0xd68760){return db['MailInteraction'][_0x4e77('0x19')](_0x468d59[_0x4e77('0x1a')],{'raw':_0x468d59[_0x4e77('0x1b')]?_0x468d59[_0x4e77('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x468d59[_0x4e77('0x1b')]?_0x468d59[_0x4e77('0x1b')]['where']||null:null,'attributes':_0x468d59[_0x4e77('0x1b')]?_0x468d59[_0x4e77('0x1b')][_0x4e77('0x1c')]||null:null,'limit':_0x468d59[_0x4e77('0x1b')]?_0x468d59[_0x4e77('0x1b')][_0x4e77('0x1d')]||null:null})[_0x4e77('0x1e')](function(_0x11f1ef){logger['info']('UpdateMailInteraction',_0x468d59);logger[_0x4e77('0x12')](_0x4e77('0x18'),_0x468d59,JSON[_0x4e77('0x14')](_0x11f1ef));_0x3e58e5(_0x11f1ef);})['catch'](function(_0x3360de){logger['error'](_0x4e77('0x18'),_0x3360de['message'],_0x468d59);_0xd68760(_0x11bfe5['error'](0x1f4,_0x3360de[_0x4e77('0x17')]));});});};exports[_0x4e77('0x1f')]=function(_0x76a51e){return new Promise(function(_0x25e86f,_0x4a32d8){return db['MailInteraction'][_0x4e77('0x20')]({'where':_0x76a51e[_0x4e77('0x1b')]?_0x76a51e[_0x4e77('0x1b')][_0x4e77('0x21')]||null:null})['then'](function(_0x17acc4){if(_0x17acc4){return _0x17acc4[_0x4e77('0x22')](_0x76a51e[_0x4e77('0x1a')]['ids'],_[_0x4e77('0x23')](_0x76a51e['body'],['ids','id'])||{});}})[_0x4e77('0x24')](function(_0x29affe){logger[_0x4e77('0xf')](_0x4e77('0x25'),_0x76a51e);logger[_0x4e77('0x12')](_0x4e77('0x25'),_0x76a51e,JSON[_0x4e77('0x14')](_0x29affe));_0x25e86f(_0x29affe);})['catch'](function(_0x22d351){logger[_0x4e77('0x15')](_0x4e77('0x25'),_0x22d351[_0x4e77('0x17')],_0x76a51e);_0x4a32d8(_this[_0x4e77('0x15')](0x1f4,_0x22d351[_0x4e77('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 4031034..83f8c92 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 _0x6ed3=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x6ed3,0xd3));var _0x36ed=function(_0x246779,_0x290e3e){_0x246779=_0x246779-0x0;var _0x4d1c02=_0x6ed3[_0x246779];return _0x4d1c02;};'use strict';var MailInteractionEvents=require(_0x36ed('0x0'));var events=[_0x36ed('0x1'),_0x36ed('0x2'),_0x36ed('0x3')];function createListener(_0x1a7cb4,_0x46ccac){return function(_0x2e7cf0){_0x46ccac[_0x36ed('0x4')](_0x1a7cb4,_0x2e7cf0);};}function removeListener(_0x5a2557,_0xa752e8){return function(){MailInteractionEvents['removeListener'](_0x5a2557,_0xa752e8);};}exports[_0x36ed('0x5')]=function(_0x3c7779){for(var _0x2f929a=0x0,_0x35db55=events[_0x36ed('0x6')];_0x2f929a<_0x35db55;_0x2f929a++){var _0x3c1807=events[_0x2f929a];var _0x16a6cb=createListener(_0x36ed('0x7')+_0x3c1807,_0x3c7779);MailInteractionEvents['on'](_0x3c1807,_0x16a6cb);}}; \ No newline at end of file +var _0xa5a5=['register','mailInteraction:','update'];(function(_0x59ff09,_0x6f9e1){var _0x4f5dab=function(_0x4f011a){while(--_0x4f011a){_0x59ff09['push'](_0x59ff09['shift']());}};_0x4f5dab(++_0x6f9e1);}(_0xa5a5,0x173));var _0x5a5a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xa5a5[_0x4f9b18];return _0x29f20c;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x5a5a('0x0')];function createListener(_0x519ba6,_0x2f84b3){return function(_0x50d0a6){_0x2f84b3['emit'](_0x519ba6,_0x50d0a6);};}function removeListener(_0x1eb73a,_0x237c52){return function(){MailInteractionEvents['removeListener'](_0x1eb73a,_0x237c52);};}exports[_0x5a5a('0x1')]=function(_0x4daf09){for(var _0x1e58f4=0x0,_0x4be37e=events['length'];_0x1e58f4<_0x4be37e;_0x1e58f4++){var _0x43ae9f=events[_0x1e58f4];var _0x33189c=createListener(_0x5a5a('0x2')+_0x43ae9f,_0x4daf09);MailInteractionEvents['on'](_0x43ae9f,_0x33189c);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index eeb7ed5..6e2e135 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 _0xbde2=['/:id/download','download','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xbde2,0x7a));var _0x2bde=function(_0x6881cb,_0x4e9921){_0x6881cb=_0x6881cb-0x0;var _0x1c4db9=_0xbde2[_0x6881cb];return _0x1c4db9;};'use strict';var multer=require('multer');var util=require(_0x2bde('0x0'));var path=require(_0x2bde('0x1'));var timeout=require(_0x2bde('0x2'));var express=require('express');var router=express[_0x2bde('0x3')]();var fs_extra=require(_0x2bde('0x4'));var auth=require(_0x2bde('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2bde('0x6'));var controller=require(_0x2bde('0x7'));router[_0x2bde('0x8')]('/',auth[_0x2bde('0x9')](),controller['index']);router[_0x2bde('0x8')](_0x2bde('0xa'),auth[_0x2bde('0x9')](),controller[_0x2bde('0xb')]);router[_0x2bde('0x8')](_0x2bde('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2bde('0xd'),auth[_0x2bde('0x9')](),controller[_0x2bde('0xe')]);router['post']('/',auth[_0x2bde('0x9')](),interaction[_0x2bde('0xf')](_0x2bde('0x10'),_0x2bde('0x11')),controller[_0x2bde('0x12')]);router[_0x2bde('0x13')]('/:id',auth[_0x2bde('0x9')](),controller['update']);router[_0x2bde('0x13')](_0x2bde('0x14'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x15')]);router[_0x2bde('0x13')](_0x2bde('0x16'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x17')]);router[_0x2bde('0x18')](_0x2bde('0xc'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x19')]);module[_0x2bde('0x1a')]=router; \ No newline at end of file +var _0x2242=['../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','tracked','create','put','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2242,0x1a3));var _0x2224=function(_0x572ab7,_0x2bdfb1){_0x572ab7=_0x572ab7-0x0;var _0x174a7c=_0x2242[_0x572ab7];return _0x174a7c;};'use strict';var multer=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var path=require(_0x2224('0x2'));var timeout=require('connect-timeout');var express=require(_0x2224('0x3'));var router=express[_0x2224('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2224('0x5'));var interaction=require(_0x2224('0x6'));var config=require('../../config/environment');var controller=require(_0x2224('0x7'));router[_0x2224('0x8')]('/',auth[_0x2224('0x9')](),controller['index']);router[_0x2224('0x8')](_0x2224('0xa'),auth[_0x2224('0x9')](),controller[_0x2224('0xb')]);router[_0x2224('0x8')](_0x2224('0xc'),auth[_0x2224('0x9')](),controller[_0x2224('0xd')]);router[_0x2224('0x8')](_0x2224('0xe'),auth[_0x2224('0x9')](),controller[_0x2224('0xf')]);router[_0x2224('0x10')]('/',auth[_0x2224('0x9')](),interaction[_0x2224('0x11')]('mail','mailmessage:create'),controller[_0x2224('0x12')]);router[_0x2224('0x13')](_0x2224('0xc'),auth[_0x2224('0x9')](),controller['update']);router[_0x2224('0x13')](_0x2224('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0x2224('0x13')](_0x2224('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0x2224('0x16')](_0x2224('0xc'),auth[_0x2224('0x9')](),controller[_0x2224('0x17')]);module[_0x2224('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index d70e7d9..366f294 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 _0x367e=['DATE','INTEGER','ENUM','Chat','Email','sequelize','lodash','TEXT','long','medium','BOOLEAN','out','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x367e,0xa1));var _0xe367=function(_0x479d3d,_0x32d023){_0x479d3d=_0x479d3d-0x0;var _0x3e614d=_0x367e[_0x479d3d];return _0x3e614d;};'use strict';var Sequelize=require(_0xe367('0x0'));var _=require(_0xe367('0x1'));module['exports']={'body':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x4'))},'read':{'type':Sequelize[_0xe367('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe367('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe367('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'cc':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'bcc':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'subject':{'type':Sequelize[_0xe367('0x2')]},'sentAt':{'type':Sequelize[_0xe367('0x8')]},'attach':{'type':Sequelize[_0xe367('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe367('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe367('0x8')]},'originTo':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'originCc':{'type':Sequelize[_0xe367('0x2')](_0xe367('0x3'))},'originChannel':{'type':Sequelize[_0xe367('0xa')]('Email',_0xe367('0xb')),'defaultValue':_0xe367('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x77d3=['out','STRING','long','DATE','INTEGER','Chat','Email','sequelize','exports','TEXT','medium','ENUM'];(function(_0x38786d,_0x39d47e){var _0x5053fc=function(_0x1a30df){while(--_0x1a30df){_0x38786d['push'](_0x38786d['shift']());}};_0x5053fc(++_0x39d47e);}(_0x77d3,0x1f3));var _0x377d=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x77d3[_0x2ec461];return _0x28603d;};'use strict';var Sequelize=require(_0x377d('0x0'));var _=require('lodash');module[_0x377d('0x1')]={'body':{'type':Sequelize[_0x377d('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x377d('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x377d('0x4')]('in',_0x377d('0x5')),'defaultValue':_0x377d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x377d('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x377d('0x2')](_0x377d('0x7'))},'cc':{'type':Sequelize[_0x377d('0x2')](_0x377d('0x7'))},'bcc':{'type':Sequelize[_0x377d('0x2')]('long')},'subject':{'type':Sequelize[_0x377d('0x2')]},'sentAt':{'type':Sequelize[_0x377d('0x8')]},'attach':{'type':Sequelize[_0x377d('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x377d('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x377d('0x7'))},'originCc':{'type':Sequelize['TEXT'](_0x377d('0x7'))},'originChannel':{'type':Sequelize['ENUM']('Email',_0x377d('0xa')),'defaultValue':_0x377d('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 6dc1106..6588094 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 _0xba0e=['eml-format','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','offset','undefined','count','set','Content-Range','destroy','end','sendStatus','name','send','index','MailMessage','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','where','merge','VIRTUAL','options','include','rows','show','params','update','body','find','describe','create','direction','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','server/files/attachments','basename','Contacts','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','null','RejectMessage','rejectMessage','ContactId','contact','fullname','email','rejectmessage','download','unix','join','root','server','files','tmp','from','bcc','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','readFileSync','build'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xba0e,0xa0));var _0xeba0=function(_0x526f50,_0x4c7e95){_0x526f50=_0x526f50-0x0;var _0x5e0f91=_0xba0e[_0x526f50];return _0x5e0f91;};'use strict';var emlformat=require(_0xeba0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xeba0('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xeba0('0x2'));var Redis=require(_0xeba0('0x3'));var htmlToText=require(_0xeba0('0x4'));var qs=require(_0xeba0('0x5'));var logger=require(_0xeba0('0x6'))(_0xeba0('0x7'));var interaction_log=require(_0xeba0('0x6'))(_0xeba0('0x8'));var config=require('../../config/environment');var db=require(_0xeba0('0x9'))['db'];config['redis']=_[_0xeba0('0xa')](config[_0xeba0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xeba0('0xc'))(new Redis(config[_0xeba0('0xb')]));var htmlEntities=require('html-entities');require(_0xeba0('0xd'))[_0xeba0('0xe')](socket);var jayson=require(_0xeba0('0xf'));var client=jayson['client'][_0xeba0('0x10')]({'port':0x232c});var client9003=jayson[_0xeba0('0x11')][_0xeba0('0x10')]({'port':0x232b});var client9002=jayson[_0xeba0('0x11')][_0xeba0('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x4cf15c,_0x478f2b,_0x1cad88,_0x2f4819){return new BPromise(function(_0x131263,_0x3c0621){var _0x59ac02=_0x2f4819||client;return _0x59ac02[_0xeba0('0x12')](_0x4cf15c,_0x1cad88)[_0xeba0('0x13')](function(_0x123842){logger[_0xeba0('0x14')](_0xeba0('0x15'),_0x478f2b,_0xeba0('0x16'));logger[_0xeba0('0x17')](_0xeba0('0x18'),_0x478f2b,_0xeba0('0x16'),JSON[_0xeba0('0x19')](_0x123842));if(_0x123842[_0xeba0('0x1a')]){if(_0x123842['error']['code']===0x1f4){logger[_0xeba0('0x1a')](_0xeba0('0x15'),_0x478f2b,_0x123842[_0xeba0('0x1a')][_0xeba0('0x1b')]);return _0x3c0621(_0x123842[_0xeba0('0x1a')][_0xeba0('0x1b')]);}logger[_0xeba0('0x1a')](_0xeba0('0x15'),_0x478f2b,_0x123842['error'][_0xeba0('0x1b')]);return _0x131263(_0x123842['error'][_0xeba0('0x1b')]);}else{logger[_0xeba0('0x14')](_0xeba0('0x15'),_0x478f2b,_0xeba0('0x16'));_0x131263(_0x123842['result'][_0xeba0('0x1b')]);}})[_0xeba0('0x1c')](function(_0x5da266){logger[_0xeba0('0x1a')](_0xeba0('0x15'),_0x478f2b,_0x5da266);_0x3c0621(_0x5da266);});});}function respondWithResult(_0x5873c5,_0x5624ea){_0x5624ea=_0x5624ea||0xc8;return function(_0x5ac964){if(_0x5ac964){return _0x5873c5[_0xeba0('0x1d')](_0x5624ea)[_0xeba0('0x1e')](_0x5ac964);}};}function respondWithFilteredResult(_0x1ac3e7,_0x2889a8){return function(_0x473dfb){if(_0x473dfb){var _0x5e48c4=typeof _0x2889a8[_0xeba0('0x1f')]===_0xeba0('0x20')&&typeof _0x2889a8['limit']==='undefined';var _0x17d44d=_0x473dfb[_0xeba0('0x21')];var _0x56f343=_0x5e48c4?0x0:_0x2889a8[_0xeba0('0x1f')];var _0x25982d=_0x5e48c4?_0x473dfb[_0xeba0('0x21')]:_0x2889a8[_0xeba0('0x1f')]+_0x2889a8['limit'];var _0x3d9ee9;if(_0x25982d>=_0x17d44d){_0x25982d=_0x17d44d;_0x3d9ee9=0xc8;}else{_0x3d9ee9=0xce;}_0x1ac3e7['status'](_0x3d9ee9);return _0x1ac3e7[_0xeba0('0x22')](_0xeba0('0x23'),_0x56f343+'-'+_0x25982d+'/'+_0x17d44d)['json'](_0x473dfb);}return null;};}function saveUpdates(_0x5f1c87){return function(_0x5052f7){if(_0x5052f7){return _0x5052f7['update'](_0x5f1c87)[_0xeba0('0x13')](function(_0x55cd7a){return _0x55cd7a;});}return null;};}function removeEntity(_0x2e3bff){return function(_0x5bdc26){if(_0x5bdc26){return _0x5bdc26[_0xeba0('0x24')]()[_0xeba0('0x13')](function(){_0x2e3bff[_0xeba0('0x1d')](0xcc)[_0xeba0('0x25')]();});}};}function handleEntityNotFound(_0x2394ad){return function(_0x4d204d){if(!_0x4d204d){_0x2394ad[_0xeba0('0x26')](0x194);}return _0x4d204d;};}function handleError(_0x589469,_0x3a8a56){_0x3a8a56=_0x3a8a56||0x1f4;return function(_0x1e441e){logger[_0xeba0('0x1a')](_0x1e441e['stack']);if(_0x1e441e[_0xeba0('0x27')]){delete _0x1e441e[_0xeba0('0x27')];}_0x589469[_0xeba0('0x1d')](_0x3a8a56)[_0xeba0('0x28')](_0x1e441e);};}exports[_0xeba0('0x29')]=function(_0x213480,_0x251c7c){var _0x4aa000={},_0x5810bc={},_0xf4e29b={'count':0x0,'rows':[]};var _0x5aa86f=_['map'](db[_0xeba0('0x2a')][_0xeba0('0x2b')],function(_0x451864){return{'name':_0x451864[_0xeba0('0x2c')],'type':_0x451864[_0xeba0('0x2d')][_0xeba0('0x2e')]};});_0x5810bc[_0xeba0('0x2f')]=_[_0xeba0('0x30')](_0x5aa86f,'name');_0x5810bc['query']=_[_0xeba0('0x31')](_0x213480['query']);_0x5810bc['filters']=_[_0xeba0('0x32')](_0x5810bc[_0xeba0('0x2f')],_0x5810bc[_0xeba0('0x33')]);_0x4aa000[_0xeba0('0x34')]=_['intersection'](_0x5810bc[_0xeba0('0x2f')],qs[_0xeba0('0x35')](_0x213480[_0xeba0('0x33')][_0xeba0('0x35')]));_0x4aa000[_0xeba0('0x34')]=_0x4aa000[_0xeba0('0x34')][_0xeba0('0x36')]?_0x4aa000[_0xeba0('0x34')]:_0x5810bc[_0xeba0('0x2f')];if(!_0x213480[_0xeba0('0x33')][_0xeba0('0x37')]('nolimit')){_0x4aa000[_0xeba0('0x38')]=qs[_0xeba0('0x38')](_0x213480[_0xeba0('0x33')][_0xeba0('0x38')]);_0x4aa000[_0xeba0('0x1f')]=qs['offset'](_0x213480[_0xeba0('0x33')][_0xeba0('0x1f')]);}_0x4aa000[_0xeba0('0x39')]=qs[_0xeba0('0x3a')](_0x213480['query'][_0xeba0('0x3a')]);_0x4aa000['where']=qs[_0xeba0('0x3b')](_[_0xeba0('0x3c')](_0x213480[_0xeba0('0x33')],_0x5810bc['filters']),_0x5aa86f);if(_0x213480[_0xeba0('0x33')]['filter']){_0x4aa000[_0xeba0('0x3d')]=_[_0xeba0('0x3e')](_0x4aa000[_0xeba0('0x3d')],{'$or':_['map'](_0x5aa86f,function(_0x266288){if(_0x266288[_0xeba0('0x2d')]!==_0xeba0('0x3f')){var _0x4fcd52={};_0x4fcd52[_0x266288[_0xeba0('0x27')]]={'$like':'%'+_0x213480[_0xeba0('0x33')]['filter']+'%'};return _0x4fcd52;}})});}_0x4aa000=_['merge']({},_0x4aa000,_0x213480[_0xeba0('0x40')]);var _0x2e9ed9={'where':_0x4aa000[_0xeba0('0x3d')]};return db[_0xeba0('0x2a')][_0xeba0('0x21')](_0x2e9ed9)[_0xeba0('0x13')](function(_0x86053a){_0xf4e29b[_0xeba0('0x21')]=_0x86053a;if(_0x213480[_0xeba0('0x33')]['includeAll']){_0x4aa000[_0xeba0('0x41')]=[{'all':!![]}];}return db[_0xeba0('0x2a')]['findAll'](_0x4aa000);})[_0xeba0('0x13')](function(_0x56891c){_0xf4e29b[_0xeba0('0x42')]=_0x56891c;return _0xf4e29b;})['then'](respondWithFilteredResult(_0x251c7c,_0x4aa000))[_0xeba0('0x1c')](handleError(_0x251c7c,null));};exports[_0xeba0('0x43')]=function(_0x58e45a,_0x449453){var _0x5cb6dc={'raw':!![],'where':{'id':_0x58e45a[_0xeba0('0x44')]['id']}},_0x56106c={};_0x56106c[_0xeba0('0x2f')]=_[_0xeba0('0x31')](db['MailMessage'][_0xeba0('0x2b')]);_0x56106c[_0xeba0('0x33')]=_[_0xeba0('0x31')](_0x58e45a[_0xeba0('0x33')]);_0x56106c[_0xeba0('0x3b')]=_['intersection'](_0x56106c[_0xeba0('0x2f')],_0x56106c['query']);_0x5cb6dc[_0xeba0('0x34')]=_[_0xeba0('0x32')](_0x56106c[_0xeba0('0x2f')],qs[_0xeba0('0x35')](_0x58e45a[_0xeba0('0x33')][_0xeba0('0x35')]));_0x5cb6dc[_0xeba0('0x34')]=_0x5cb6dc[_0xeba0('0x34')][_0xeba0('0x36')]?_0x5cb6dc[_0xeba0('0x34')]:_0x56106c['model'];if(_0x58e45a['query']['includeAll']){_0x5cb6dc[_0xeba0('0x41')]=[{'all':!![]}];}_0x5cb6dc=_[_0xeba0('0x3e')]({},_0x5cb6dc,_0x58e45a['options']);return db[_0xeba0('0x2a')]['find'](_0x5cb6dc)[_0xeba0('0x13')](handleEntityNotFound(_0x449453,null))['then'](respondWithResult(_0x449453,null))[_0xeba0('0x1c')](handleError(_0x449453,null));};exports[_0xeba0('0x45')]=function(_0x283532,_0x28b7b1){if(_0x283532[_0xeba0('0x46')]['id']){delete _0x283532[_0xeba0('0x46')]['id'];}return db[_0xeba0('0x2a')]['find']({'where':{'id':_0x283532['params']['id']}})[_0xeba0('0x13')](handleEntityNotFound(_0x28b7b1,null))[_0xeba0('0x13')](saveUpdates(_0x283532[_0xeba0('0x46')],null))['then'](respondWithResult(_0x28b7b1,null))[_0xeba0('0x1c')](handleError(_0x28b7b1,null));};exports[_0xeba0('0x24')]=function(_0x1df5fc,_0x490f1a){return db[_0xeba0('0x2a')][_0xeba0('0x47')]({'where':{'id':_0x1df5fc[_0xeba0('0x44')]['id']}})[_0xeba0('0x13')](handleEntityNotFound(_0x490f1a,null))[_0xeba0('0x13')](removeEntity(_0x490f1a,null))[_0xeba0('0x1c')](handleError(_0x490f1a,null));};exports[_0xeba0('0x48')]=function(_0x31f993,_0x2d0183){return db['MailMessage']['describe']()[_0xeba0('0x13')](respondWithResult(_0x2d0183,null))['catch'](handleError(_0x2d0183,null));};exports[_0xeba0('0x49')]=function(_0x4127bf,_0x3c7d49){return db[_0xeba0('0x2a')][_0xeba0('0x49')](_0x4127bf['body'])['then'](function(_0x3a9d04){if(_0x3a9d04){if(_0x3a9d04[_0xeba0('0x4a')]==='out'&&!_0x3a9d04[_0xeba0('0x4b')]){var _0x3b28ba,_0x564362,_0x44f833;if(_0x4127bf[_0xeba0('0x46')]['to']){_0x564362=_0x4127bf['body']['to'][_0xeba0('0x4c')](',')[0x0];}return db[_0xeba0('0x4d')]['findOne']({'where':{'id':_0x3a9d04[_0xeba0('0x4e')]},'include':[{'model':db[_0xeba0('0x4f')],'as':_0xeba0('0x50'),'include':[{'model':db[_0xeba0('0x51')],'as':'Contacts','where':{'email':_0x564362},'limit':0x1,'order':[[_0xeba0('0x52'),_0xeba0('0x53')]]}]},{'model':db[_0xeba0('0x54')],'as':_0xeba0('0x55'),'raw':!![]}]})[_0xeba0('0x13')](function(_0x1a9f67){_0x3b28ba=_0x1a9f67;if(_0x3b28ba&&_0x3b28ba['Smtp']){var _0x55179d={'tls':{'rejectUnauthorized':![]}};if(_[_0xeba0('0x56')](_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x57')])){_0x55179d['host']=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x58')];_0x55179d[_0xeba0('0x59')]=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x59')];_0x55179d['secure']=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5a')];if(_0x3b28ba['Smtp'][_0xeba0('0x5b')]){_0x55179d[_0xeba0('0x5c')]={'user':_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5d')],'pass':_0x3b28ba[_0xeba0('0x55')]['pass']};}}else{_0x55179d[_0xeba0('0x57')]=_0x3b28ba[_0xeba0('0x55')]['service'];_0x55179d[_0xeba0('0x5c')]={'user':_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5d')],'pass':_0x3b28ba['Smtp'][_0xeba0('0x5e')]};_0x55179d[_0xeba0('0x5a')]=_0x3b28ba[_0xeba0('0x55')][_0xeba0('0x5a')];}if(_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')]&&_0x4127bf['body'][_0xeba0('0x5f')][_0xeba0('0x36')]){for(var _0x50c967=0x0;_0x50c967<_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')][_0xeba0('0x36')];_0x50c967+=0x1){_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')][_0x50c967]={'filename':_0x4127bf[_0xeba0('0x46')][_0xeba0('0x5f')][_0x50c967][_0xeba0('0x27')],'path':path['join'](config['root'],_0xeba0('0x60'),_0x4127bf[_0xeba0('0x46')]['attachments'][_0x50c967][_0xeba0('0x61')])};}}_0x44f833={'account':_0x55179d,'message':_0x4127bf[_0xeba0('0x46')]};return;}})[_0xeba0('0x13')](function(){if(_0x3b28ba['List']){if(_0x3b28ba['List'][_0xeba0('0x62')][_0xeba0('0x36')]){return _0x3b28ba[_0xeba0('0x50')]['Contacts'][0x0];}else{return db[_0xeba0('0x51')][_0xeba0('0x49')](_['defaults'](_0x4127bf['body'],{'firstName':_0x4127bf['body']['to'],'email':_0x4127bf[_0xeba0('0x46')]['to'],'phone':_0x4127bf[_0xeba0('0x46')]['to'],'ListId':_0x3b28ba[_0xeba0('0x63')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x44f833){return respondWithRpcPromise(_0xeba0('0x64'),_0xeba0('0x65'),_0x44f833,client9003)[_0xeba0('0x13')](function(_0x4b0a69){return _0x3a9d04[_0xeba0('0x45')]({'read':!![],'messageId':_0x4b0a69[_0xeba0('0x66')],'sentAt':moment()[_0xeba0('0x67')](_0xeba0('0x68'))});})[_0xeba0('0x1c')](function(_0x5a80bd){logger[_0xeba0('0x1a')]('%s',JSON[_0xeba0('0x19')](_0x5a80bd));return _0x3a9d04;});}return _0x3a9d04;});}return _0x3a9d04;}})[_0xeba0('0x13')](respondWithResult(_0x3c7d49,0xc9))['catch'](handleError(_0x3c7d49,null));};exports[_0xeba0('0x69')]=function(_0x40ec63,_0x544d12){var _0x1a959c={'agent':{},'channel':_0xeba0('0x6a')};if(_0x40ec63[_0xeba0('0x46')]['id']){delete _0x40ec63[_0xeba0('0x46')]['id'];}_0x40ec63['body'][_0xeba0('0x6b')]=!![];_0x40ec63[_0xeba0('0x46')][_0xeba0('0x6c')]=moment()[_0xeba0('0x67')](_0xeba0('0x68'));_0x40ec63[_0xeba0('0x46')]['UserId']=_0x40ec63['body'][_0xeba0('0x6d')]||_0x40ec63[_0xeba0('0x5d')]['id'];_0x1a959c[_0xeba0('0x6e')]['id']=_0x40ec63['body']['UserId'];return db[_0xeba0('0x2a')]['find']({'where':{'id':_0x40ec63['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x544d12,null))['then'](saveUpdates(_0x40ec63['body'],null))[_0xeba0('0x13')](function(_0x4e97ef){if(_0x4e97ef){_0x1a959c['message']=_0x4e97ef[_0xeba0('0x6f')]({'plain':!![]});return db['MailInteraction'][_0xeba0('0x47')]({'where':{'id':_0x4e97ef[_0xeba0('0x70')]}});}return null;})[_0xeba0('0x13')](handleEntityNotFound(_0x544d12,null))[_0xeba0('0x13')](function(_0x5b5aee){if(_0x5b5aee){return _0x5b5aee[_0xeba0('0x45')]({'UserId':_0x40ec63['body'][_0xeba0('0x6d')],'read1stAt':_[_0xeba0('0x56')](_0x5b5aee['read1stAt'])?moment()[_0xeba0('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xeba0('0x13')](function(_0x35458a){if(_0x35458a){_0x1a959c[_0xeba0('0x71')]=_0x35458a[_0xeba0('0x6f')]({'plain':!![]});interaction_log[_0xeba0('0x14')](_0xeba0('0x72'),_0x40ec63['user']['id'],_0x40ec63[_0xeba0('0x5d')][_0xeba0('0x27')],_0x40ec63[_0xeba0('0x5d')][_0xeba0('0x73')],_0x1a959c[_0xeba0('0x71')]['id'],_0x40ec63['body']?JSON[_0xeba0('0x19')](_0x40ec63[_0xeba0('0x46')]):'null');return respondWithRpcPromise(_0xeba0('0x74'),_0xeba0('0x75'),_0x1a959c);}return null;})['then'](function(_0x3e115c){var _0x7bd933=_0xeba0('0x76')+_0x3e115c[_0xeba0('0x1b')]['ContactId'];return db[_0xeba0('0x77')][_0xeba0('0x33')](_0x7bd933,{'type':db[_0xeba0('0x78')][_0xeba0('0x79')][_0xeba0('0x7a')],'raw':!![]})[_0xeba0('0x13')](function(_0x543c2d){return _0x543c2d;});})[_0xeba0('0x13')](function(_0x5ef1c4){if(_0x5ef1c4){_0x1a959c[_0xeba0('0x1b')]['contact']=_0x5ef1c4[0x0];if(!_0x40ec63[_0xeba0('0x46')][_0xeba0('0x6d')])return;return db[_0xeba0('0x7b')][_0xeba0('0x47')]({'where':{'id':_0x40ec63['body'][_0xeba0('0x6d')],'role':_0xeba0('0x6e')},'attributes':['id',_0xeba0('0x27'),'fullname','email',_0xeba0('0x7c')],'raw':!![]});}return null;})[_0xeba0('0x13')](function(_0x14c83e){if(!_0x14c83e)return null;_0x1a959c[_0xeba0('0x1b')]['agent']=_0x14c83e;return _0x1a959c;})[_0xeba0('0x13')](function(_0x3104f6){if(_0x3104f6){if(_0x40ec63[_0xeba0('0x46')]['manual']){_0x1a959c['message'][_0xeba0('0x7d')]=util['format'](_0xeba0('0x7e'),_0x40ec63['user'][_0xeba0('0x27')]);_0x1a959c[_0xeba0('0x1b')][_0xeba0('0x7f')]=_0x1a959c[_0xeba0('0x7f')];_0x1a959c['message'][_0xeba0('0x80')]=_0x1a959c[_0xeba0('0x7f')];_0x1a959c['message'][_0xeba0('0x81')]='accept';_0x1a959c[_0xeba0('0x1b')][_0xeba0('0x46')]=htmlToText[_0xeba0('0x82')](_0x1a959c[_0xeba0('0x1b')][_0xeba0('0x46')]);return respondWithRpcPromise(_0xeba0('0x83'),'EventManager',{'event':_0xeba0('0x84'),'message':_0x1a959c[_0xeba0('0x1b')]},client9002)[_0xeba0('0x13')](function(){return _0x1a959c;});}return _0x1a959c;}return null;})[_0xeba0('0x13')](respondWithResult(_0x544d12,null))[_0xeba0('0x1c')](handleError(_0x544d12,null));};exports[_0xeba0('0x85')]=function(_0x4cdf1d,_0x535e18){var _0x3bc340={'agent':{},'channel':_0xeba0('0x6a')};if(_0x4cdf1d['body']['id']){delete _0x4cdf1d[_0xeba0('0x46')]['id'];}_0x4cdf1d[_0xeba0('0x46')][_0xeba0('0x6d')]=_0x4cdf1d[_0xeba0('0x46')][_0xeba0('0x6d')]||_0x4cdf1d['user']['id'];_0x3bc340[_0xeba0('0x6e')]['id']=_0x4cdf1d[_0xeba0('0x46')][_0xeba0('0x6d')];return db[_0xeba0('0x2a')][_0xeba0('0x47')]({'where':{'id':_0x4cdf1d['params']['id'],'UserId':null}})[_0xeba0('0x13')](handleEntityNotFound(_0x535e18,null))['then'](function(_0x2ae865){if(_0x2ae865){_0x3bc340['message']=_0x2ae865[_0xeba0('0x6f')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2ae865[_0xeba0('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x535e18,null))[_0xeba0('0x13')](function(_0x397bdc){if(_0x397bdc){_0x3bc340[_0xeba0('0x71')]=_0x397bdc['get']({'plain':!![]});interaction_log[_0xeba0('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cdf1d[_0xeba0('0x5d')]['id'],_0x4cdf1d['user'][_0xeba0('0x27')],_0x4cdf1d[_0xeba0('0x5d')][_0xeba0('0x73')],_0x3bc340[_0xeba0('0x71')]['id'],_0x4cdf1d[_0xeba0('0x46')]?JSON['stringify'](_0x4cdf1d['body']):_0xeba0('0x86'));return respondWithRpcPromise(_0xeba0('0x87'),_0xeba0('0x88'),_0x3bc340);}return null;})[_0xeba0('0x13')](function(_0x6b6efb){var _0x5ca984=_0xeba0('0x76')+_0x6b6efb[_0xeba0('0x1b')][_0xeba0('0x89')];return db[_0xeba0('0x77')]['query'](_0x5ca984,{'type':db[_0xeba0('0x78')][_0xeba0('0x79')]['SELECT'],'raw':!![]})[_0xeba0('0x13')](function(_0x330337){return _0x330337;});})[_0xeba0('0x13')](function(_0x51e0f3){if(_0x51e0f3){_0x3bc340['message'][_0xeba0('0x8a')]=_0x51e0f3[0x0];if(!_0x4cdf1d[_0xeba0('0x46')]['UserId'])return;return db[_0xeba0('0x7b')][_0xeba0('0x47')]({'where':{'id':_0x4cdf1d[_0xeba0('0x46')]['UserId'],'role':_0xeba0('0x6e')},'attributes':['id','name',_0xeba0('0x8b'),_0xeba0('0x8c'),_0xeba0('0x7c')],'raw':!![]});}return null;})['then'](function(_0x343092){if(!_0x343092)return null;_0x3bc340[_0xeba0('0x1b')][_0xeba0('0x6e')]=_0x343092;return _0x3bc340;})[_0xeba0('0x13')](function(_0x14edb3){if(_0x14edb3){_0x14edb3[_0xeba0('0x1b')][_0xeba0('0x7d')]=util['format'](_0xeba0('0x7e'),_0x4cdf1d['user'][_0xeba0('0x27')]);_0x14edb3['message']['channel']=_0x3bc340[_0xeba0('0x7f')];_0x14edb3[_0xeba0('0x1b')][_0xeba0('0x80')]=_0x3bc340[_0xeba0('0x7f')];_0x14edb3[_0xeba0('0x1b')][_0xeba0('0x81')]=_0xeba0('0x85');_0x14edb3['message'][_0xeba0('0x46')]=htmlToText[_0xeba0('0x82')](_0x3bc340[_0xeba0('0x1b')][_0xeba0('0x46')]);respondWithRpcPromise(_0xeba0('0x83'),_0xeba0('0x83'),{'event':_0xeba0('0x8d'),'message':_0x14edb3[_0xeba0('0x1b')]},client9002);return _0x3bc340;}return null;})[_0xeba0('0x13')](respondWithResult(_0x535e18,null))[_0xeba0('0x1c')](handleError(_0x535e18,null));};exports[_0xeba0('0x8e')]=function(_0x1a0b3a,_0x2272df){var _0x5b4a9c=moment()[_0xeba0('0x8f')]()['toString']();var _0x3eca5a=path[_0xeba0('0x90')](config[_0xeba0('0x91')],_0xeba0('0x92'),_0xeba0('0x93'),_0xeba0('0x94'));var _0x48dfd2=path[_0xeba0('0x90')](config[_0xeba0('0x91')],_0xeba0('0x92'),'files',_0xeba0('0x5f'));var _0x2ef406=util['format']('message-%s.eml',_0x5b4a9c);return db[_0xeba0('0x2a')][_0xeba0('0x47')]({'where':{'id':_0x1a0b3a[_0xeba0('0x44')]['id']},'attributes':['id','body',_0xeba0('0x95'),'to','cc',_0xeba0('0x96'),_0xeba0('0x97'),'createdAt'],'include':_0x1a0b3a[_0xeba0('0x33')][_0xeba0('0x5f')]?[{'model':db[_0xeba0('0x98')],'as':_0xeba0('0x99')}]:undefined})[_0xeba0('0x13')](handleEntityNotFound(_0x2272df,null))['then'](function(_0x72b078){if(_0x72b078){var _0x1c8cf2=_0x72b078;var _0x130013={'from':_0x1c8cf2[_0xeba0('0x95')],'to':_0x1c8cf2['to'],'subject':_0x1c8cf2['subject'],'html':htmlEntities[_0xeba0('0x9a')](_0x1c8cf2['body']),'headers':{'Date':moment(_0x1c8cf2[_0xeba0('0x9b')])[_0xeba0('0x67')](_0xeba0('0x9c'))},'attachments':[]};if(_0x72b078['cc']){_0x130013[_0xeba0('0x9d')]['Cc']=_0x72b078['cc'];}if(_0x72b078[_0xeba0('0x96')]){_0x130013['headers']['Bcc']=_0x72b078[_0xeba0('0x96')];}return new BPromise(function(_0x5e3b3e,_0x5c4f8b){if(_0x72b078[_0xeba0('0x99')]){for(var _0x5dfded=0x0;_0x5dfded<_0x72b078[_0xeba0('0x99')]['length'];_0x5dfded++){var _0x53563f=_0x72b078['Attachments'][_0x5dfded];var _0x24df88=path[_0xeba0('0x90')](_0x48dfd2,_0x53563f[_0xeba0('0x61')]);if(fs['existsSync'](_0x24df88)){_0x130013[_0xeba0('0x5f')]['push']({'name':_0x53563f['name'],'contentType':_0x53563f[_0xeba0('0x2d')],'data':fs[_0xeba0('0x9e')](_0x24df88)});}}}emlformat[_0xeba0('0x9f')](_0x130013,function(_0x2e7203,_0x5bc31d){if(_0x2e7203)return _0x5c4f8b(_0x2e7203);fs['writeFileSync'](path[_0xeba0('0x90')](_0x3eca5a,_0x2ef406),_0x5bc31d);return _0x5e3b3e(_0x5bc31d);});});}})[_0xeba0('0x13')](function(_0x168aa1){if(_0x168aa1){return _0x2272df['download'](path[_0xeba0('0x90')](_0x3eca5a,_0x2ef406),_0x2ef406,function(_0x4f0ac3){if(!_0x4f0ac3)fs['unlinkSync'](path['join'](_0x3eca5a,_0x2ef406));});}})[_0xeba0('0x1c')](handleError(_0x2272df,null));}; \ No newline at end of file +var _0x747b=['MailInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','acceptmessage','reject','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','User','EventManager','rejectmessage','download','unix','toString','join','root','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','decode','createdAt','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','stack','name','send','index','MailMessage','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','server/files/attachments','ListId','List\x20not\x20found','SendMail','accept','mail','read','readAt','format','UserId','agent','get','MailInteraction'];(function(_0x26cdd8,_0x3c3136){var _0x4687aa=function(_0x58aa46){while(--_0x58aa46){_0x26cdd8['push'](_0x26cdd8['shift']());}};_0x4687aa(++_0x3c3136);}(_0x747b,0xe2));var _0xb747=function(_0x4f21c4,_0x960024){_0x4f21c4=_0x4f21c4-0x0;var _0x2f9fa6=_0x747b[_0x4f21c4];return _0x2f9fa6;};'use strict';var emlformat=require(_0xb747('0x0'));var moment=require(_0xb747('0x1'));var BPromise=require(_0xb747('0x2'));var util=require(_0xb747('0x3'));var path=require(_0xb747('0x4'));var fs=require('fs');var _=require(_0xb747('0x5'));var Redis=require('ioredis');var htmlToText=require(_0xb747('0x6'));var qs=require(_0xb747('0x7'));var logger=require(_0xb747('0x8'))(_0xb747('0x9'));var interaction_log=require(_0xb747('0x8'))(_0xb747('0xa'));var config=require(_0xb747('0xb'));var db=require('../../mysqldb')['db'];config[_0xb747('0xc')]=_[_0xb747('0xd')](config['redis'],{'host':_0xb747('0xe'),'port':0x18eb});var socket=require(_0xb747('0xf'))(new Redis(config[_0xb747('0xc')]));var htmlEntities=require(_0xb747('0x10'));require(_0xb747('0x11'))[_0xb747('0x12')](socket);var jayson=require(_0xb747('0x13'));var client=jayson[_0xb747('0x14')][_0xb747('0x15')]({'port':0x232c});var client9003=jayson[_0xb747('0x14')][_0xb747('0x15')]({'port':0x232b});var client9002=jayson[_0xb747('0x14')][_0xb747('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x5e74b6,_0x36262e,_0x4b9c02,_0x2e82bd){return new BPromise(function(_0xbdda68,_0x27ce79){var _0x43603f=_0x2e82bd||client;return _0x43603f['request'](_0x5e74b6,_0x4b9c02)['then'](function(_0x3c62b7){logger[_0xb747('0x16')](_0xb747('0x17'),_0x36262e,'request\x20sent');logger[_0xb747('0x18')](_0xb747('0x19'),_0x36262e,_0xb747('0x1a'),JSON[_0xb747('0x1b')](_0x3c62b7));if(_0x3c62b7[_0xb747('0x1c')]){if(_0x3c62b7['error']['code']===0x1f4){logger[_0xb747('0x1c')](_0xb747('0x17'),_0x36262e,_0x3c62b7[_0xb747('0x1c')][_0xb747('0x1d')]);return _0x27ce79(_0x3c62b7[_0xb747('0x1c')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x36262e,_0x3c62b7[_0xb747('0x1c')][_0xb747('0x1d')]);return _0xbdda68(_0x3c62b7['error']['message']);}else{logger[_0xb747('0x16')]('MailMessage,\x20%s,\x20%s',_0x36262e,_0xb747('0x1a'));_0xbdda68(_0x3c62b7['result'][_0xb747('0x1d')]);}})['catch'](function(_0x59a765){logger[_0xb747('0x1c')](_0xb747('0x17'),_0x36262e,_0x59a765);_0x27ce79(_0x59a765);});});}function respondWithResult(_0x20273a,_0x512982){_0x512982=_0x512982||0xc8;return function(_0x30225b){if(_0x30225b){return _0x20273a[_0xb747('0x1e')](_0x512982)[_0xb747('0x1f')](_0x30225b);}};}function respondWithFilteredResult(_0x2a6e5e,_0x1fce65){return function(_0x3e36f7){if(_0x3e36f7){var _0x400b04=typeof _0x1fce65[_0xb747('0x20')]===_0xb747('0x21')&&typeof _0x1fce65[_0xb747('0x22')]===_0xb747('0x21');var _0x342740=_0x3e36f7[_0xb747('0x23')];var _0x26cb49=_0x400b04?0x0:_0x1fce65[_0xb747('0x20')];var _0x57abde=_0x400b04?_0x3e36f7[_0xb747('0x23')]:_0x1fce65['offset']+_0x1fce65[_0xb747('0x22')];var _0x5d2622;if(_0x57abde>=_0x342740){_0x57abde=_0x342740;_0x5d2622=0xc8;}else{_0x5d2622=0xce;}_0x2a6e5e['status'](_0x5d2622);return _0x2a6e5e[_0xb747('0x24')]('Content-Range',_0x26cb49+'-'+_0x57abde+'/'+_0x342740)['json'](_0x3e36f7);}return null;};}function saveUpdates(_0xcf1d2f){return function(_0x529273){if(_0x529273){return _0x529273[_0xb747('0x25')](_0xcf1d2f)[_0xb747('0x26')](function(_0x4a3c91){return _0x4a3c91;});}return null;};}function removeEntity(_0x584fc2){return function(_0x2cc053){if(_0x2cc053){return _0x2cc053[_0xb747('0x27')]()[_0xb747('0x26')](function(){_0x584fc2[_0xb747('0x1e')](0xcc)[_0xb747('0x28')]();});}};}function handleEntityNotFound(_0x3375d4){return function(_0xa4d031){if(!_0xa4d031){_0x3375d4[_0xb747('0x29')](0x194);}return _0xa4d031;};}function handleError(_0x47ce1c,_0x7f4300){_0x7f4300=_0x7f4300||0x1f4;return function(_0x43227a){logger[_0xb747('0x1c')](_0x43227a[_0xb747('0x2a')]);if(_0x43227a[_0xb747('0x2b')]){delete _0x43227a['name'];}_0x47ce1c[_0xb747('0x1e')](_0x7f4300)[_0xb747('0x2c')](_0x43227a);};}exports[_0xb747('0x2d')]=function(_0x5e3a56,_0x43bc33){var _0x1dc356={},_0x46cfcc={},_0x5acce8={'count':0x0,'rows':[]};var _0x1b5853=_['map'](db[_0xb747('0x2e')]['rawAttributes'],function(_0x2dba98){return{'name':_0x2dba98[_0xb747('0x2f')],'type':_0x2dba98['type'][_0xb747('0x30')]};});_0x46cfcc['model']=_['map'](_0x1b5853,_0xb747('0x2b'));_0x46cfcc[_0xb747('0x31')]=_[_0xb747('0x32')](_0x5e3a56['query']);_0x46cfcc['filters']=_['intersection'](_0x46cfcc[_0xb747('0x33')],_0x46cfcc['query']);_0x1dc356[_0xb747('0x34')]=_[_0xb747('0x35')](_0x46cfcc[_0xb747('0x33')],qs[_0xb747('0x36')](_0x5e3a56[_0xb747('0x31')]['fields']));_0x1dc356[_0xb747('0x34')]=_0x1dc356[_0xb747('0x34')][_0xb747('0x37')]?_0x1dc356[_0xb747('0x34')]:_0x46cfcc[_0xb747('0x33')];if(!_0x5e3a56['query'][_0xb747('0x38')](_0xb747('0x39'))){_0x1dc356['limit']=qs[_0xb747('0x22')](_0x5e3a56[_0xb747('0x31')]['limit']);_0x1dc356[_0xb747('0x20')]=qs[_0xb747('0x20')](_0x5e3a56[_0xb747('0x31')][_0xb747('0x20')]);}_0x1dc356[_0xb747('0x3a')]=qs[_0xb747('0x3b')](_0x5e3a56['query']['sort']);_0x1dc356['where']=qs[_0xb747('0x3c')](_[_0xb747('0x3d')](_0x5e3a56[_0xb747('0x31')],_0x46cfcc[_0xb747('0x3c')]),_0x1b5853);if(_0x5e3a56['query'][_0xb747('0x3e')]){_0x1dc356[_0xb747('0x3f')]=_[_0xb747('0x40')](_0x1dc356[_0xb747('0x3f')],{'$or':_[_0xb747('0x41')](_0x1b5853,function(_0x2d0516){if(_0x2d0516[_0xb747('0x42')]!==_0xb747('0x43')){var _0x42c4d9={};_0x42c4d9[_0x2d0516[_0xb747('0x2b')]]={'$like':'%'+_0x5e3a56['query'][_0xb747('0x3e')]+'%'};return _0x42c4d9;}})});}_0x1dc356=_['merge']({},_0x1dc356,_0x5e3a56[_0xb747('0x44')]);var _0x16a811={'where':_0x1dc356[_0xb747('0x3f')]};return db[_0xb747('0x2e')][_0xb747('0x23')](_0x16a811)[_0xb747('0x26')](function(_0x2be435){_0x5acce8[_0xb747('0x23')]=_0x2be435;if(_0x5e3a56[_0xb747('0x31')][_0xb747('0x45')]){_0x1dc356[_0xb747('0x46')]=[{'all':!![]}];}return db[_0xb747('0x2e')][_0xb747('0x47')](_0x1dc356);})['then'](function(_0xb34af4){_0x5acce8['rows']=_0xb34af4;return _0x5acce8;})[_0xb747('0x26')](respondWithFilteredResult(_0x43bc33,_0x1dc356))[_0xb747('0x48')](handleError(_0x43bc33,null));};exports[_0xb747('0x49')]=function(_0xdfd1b9,_0x1052ea){var _0x22c619={'raw':!![],'where':{'id':_0xdfd1b9[_0xb747('0x4a')]['id']}},_0x8b344c={};_0x8b344c[_0xb747('0x33')]=_['keys'](db[_0xb747('0x2e')][_0xb747('0x4b')]);_0x8b344c['query']=_[_0xb747('0x32')](_0xdfd1b9[_0xb747('0x31')]);_0x8b344c[_0xb747('0x3c')]=_[_0xb747('0x35')](_0x8b344c[_0xb747('0x33')],_0x8b344c['query']);_0x22c619[_0xb747('0x34')]=_[_0xb747('0x35')](_0x8b344c['model'],qs[_0xb747('0x36')](_0xdfd1b9[_0xb747('0x31')][_0xb747('0x36')]));_0x22c619[_0xb747('0x34')]=_0x22c619[_0xb747('0x34')][_0xb747('0x37')]?_0x22c619['attributes']:_0x8b344c[_0xb747('0x33')];if(_0xdfd1b9[_0xb747('0x31')][_0xb747('0x45')]){_0x22c619[_0xb747('0x46')]=[{'all':!![]}];}_0x22c619=_['merge']({},_0x22c619,_0xdfd1b9[_0xb747('0x44')]);return db[_0xb747('0x2e')][_0xb747('0x4c')](_0x22c619)[_0xb747('0x26')](handleEntityNotFound(_0x1052ea,null))['then'](respondWithResult(_0x1052ea,null))[_0xb747('0x48')](handleError(_0x1052ea,null));};exports[_0xb747('0x25')]=function(_0x34407c,_0xc0444a){if(_0x34407c[_0xb747('0x4d')]['id']){delete _0x34407c['body']['id'];}return db['MailMessage']['find']({'where':{'id':_0x34407c[_0xb747('0x4a')]['id']}})[_0xb747('0x26')](handleEntityNotFound(_0xc0444a,null))[_0xb747('0x26')](saveUpdates(_0x34407c[_0xb747('0x4d')],null))[_0xb747('0x26')](respondWithResult(_0xc0444a,null))[_0xb747('0x48')](handleError(_0xc0444a,null));};exports['destroy']=function(_0x55e8ee,_0x337f2c){return db[_0xb747('0x2e')][_0xb747('0x4c')]({'where':{'id':_0x55e8ee[_0xb747('0x4a')]['id']}})[_0xb747('0x26')](handleEntityNotFound(_0x337f2c,null))[_0xb747('0x26')](removeEntity(_0x337f2c,null))[_0xb747('0x48')](handleError(_0x337f2c,null));};exports[_0xb747('0x4e')]=function(_0x14821f,_0xc6d821){return db[_0xb747('0x2e')][_0xb747('0x4e')]()['then'](respondWithResult(_0xc6d821,null))[_0xb747('0x48')](handleError(_0xc6d821,null));};exports[_0xb747('0x4f')]=function(_0x4abe53,_0x1665f0){return db[_0xb747('0x2e')][_0xb747('0x4f')](_0x4abe53[_0xb747('0x4d')])[_0xb747('0x26')](function(_0x2734e7){if(_0x2734e7){if(_0x2734e7[_0xb747('0x50')]===_0xb747('0x51')&&!_0x2734e7[_0xb747('0x52')]){var _0x25d4a4,_0x3ee70e,_0xbf9b13;if(_0x4abe53[_0xb747('0x4d')]['to']){_0x3ee70e=_0x4abe53[_0xb747('0x4d')]['to']['split'](',')[0x0];}return db[_0xb747('0x53')][_0xb747('0x54')]({'where':{'id':_0x2734e7[_0xb747('0x55')]},'include':[{'model':db[_0xb747('0x56')],'as':_0xb747('0x57'),'include':[{'model':db[_0xb747('0x58')],'as':_0xb747('0x59'),'where':{'email':_0x3ee70e},'limit':0x1,'order':[['updatedAt',_0xb747('0x5a')]]}]},{'model':db[_0xb747('0x5b')],'as':_0xb747('0x5c'),'raw':!![]}]})[_0xb747('0x26')](function(_0xe39e9b){_0x25d4a4=_0xe39e9b;if(_0x25d4a4&&_0x25d4a4['Smtp']){var _0x576584={'tls':{'rejectUnauthorized':![]}};if(_[_0xb747('0x5d')](_0x25d4a4['Smtp'][_0xb747('0x5e')])){_0x576584[_0xb747('0x5f')]=_0x25d4a4[_0xb747('0x5c')][_0xb747('0x5f')];_0x576584['port']=_0x25d4a4['Smtp'][_0xb747('0x60')];_0x576584[_0xb747('0x61')]=_0x25d4a4['Smtp']['secure'];if(_0x25d4a4[_0xb747('0x5c')][_0xb747('0x62')]){_0x576584[_0xb747('0x63')]={'user':_0x25d4a4[_0xb747('0x5c')][_0xb747('0x64')],'pass':_0x25d4a4[_0xb747('0x5c')][_0xb747('0x65')]};}}else{_0x576584['service']=_0x25d4a4[_0xb747('0x5c')]['service'];_0x576584['auth']={'user':_0x25d4a4[_0xb747('0x5c')][_0xb747('0x64')],'pass':_0x25d4a4[_0xb747('0x5c')][_0xb747('0x65')]};_0x576584[_0xb747('0x61')]=_0x25d4a4[_0xb747('0x5c')][_0xb747('0x61')];}if(_0x4abe53[_0xb747('0x4d')][_0xb747('0x66')]&&_0x4abe53[_0xb747('0x4d')]['attachments'][_0xb747('0x37')]){for(var _0x3fca6c=0x0;_0x3fca6c<_0x4abe53[_0xb747('0x4d')][_0xb747('0x66')][_0xb747('0x37')];_0x3fca6c+=0x1){_0x4abe53[_0xb747('0x4d')][_0xb747('0x66')][_0x3fca6c]={'filename':_0x4abe53[_0xb747('0x4d')][_0xb747('0x66')][_0x3fca6c][_0xb747('0x2b')],'path':path['join'](config['root'],_0xb747('0x67'),_0x4abe53['body']['attachments'][_0x3fca6c]['basename'])};}}_0xbf9b13={'account':_0x576584,'message':_0x4abe53[_0xb747('0x4d')]};return;}})[_0xb747('0x26')](function(){if(_0x25d4a4[_0xb747('0x57')]){if(_0x25d4a4[_0xb747('0x57')]['Contacts']['length']){return _0x25d4a4['List'][_0xb747('0x59')][0x0];}else{return db[_0xb747('0x58')][_0xb747('0x4f')](_[_0xb747('0xd')](_0x4abe53['body'],{'firstName':_0x4abe53[_0xb747('0x4d')]['to'],'email':_0x4abe53[_0xb747('0x4d')]['to'],'phone':_0x4abe53['body']['to'],'ListId':_0x25d4a4[_0xb747('0x68')]}));}}else{throw new Error(_0xb747('0x69'));}})[_0xb747('0x26')](function(){if(_0xbf9b13){return respondWithRpcPromise(_0xb747('0x6a'),'sendMail',_0xbf9b13,client9003)[_0xb747('0x26')](function(_0x531103){return _0x2734e7['update']({'read':!![],'messageId':_0x531103['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb747('0x48')](function(_0x568330){logger[_0xb747('0x1c')]('%s',JSON[_0xb747('0x1b')](_0x568330));return _0x2734e7;});}return _0x2734e7;});}return _0x2734e7;}})[_0xb747('0x26')](respondWithResult(_0x1665f0,0xc9))[_0xb747('0x48')](handleError(_0x1665f0,null));};exports[_0xb747('0x6b')]=function(_0x52a276,_0x51c42f){var _0x57e704={'agent':{},'channel':_0xb747('0x6c')};if(_0x52a276[_0xb747('0x4d')]['id']){delete _0x52a276[_0xb747('0x4d')]['id'];}_0x52a276[_0xb747('0x4d')][_0xb747('0x6d')]=!![];_0x52a276[_0xb747('0x4d')][_0xb747('0x6e')]=moment()[_0xb747('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');_0x52a276[_0xb747('0x4d')][_0xb747('0x70')]=_0x52a276['body'][_0xb747('0x70')]||_0x52a276['user']['id'];_0x57e704[_0xb747('0x71')]['id']=_0x52a276['body'][_0xb747('0x70')];return db[_0xb747('0x2e')]['find']({'where':{'id':_0x52a276[_0xb747('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51c42f,null))[_0xb747('0x26')](saveUpdates(_0x52a276[_0xb747('0x4d')],null))['then'](function(_0xbf03bc){if(_0xbf03bc){_0x57e704[_0xb747('0x1d')]=_0xbf03bc[_0xb747('0x72')]({'plain':!![]});return db[_0xb747('0x73')][_0xb747('0x4c')]({'where':{'id':_0xbf03bc[_0xb747('0x74')]}});}return null;})[_0xb747('0x26')](handleEntityNotFound(_0x51c42f,null))[_0xb747('0x26')](function(_0x165ac9){if(_0x165ac9){return _0x165ac9[_0xb747('0x25')]({'UserId':_0x52a276[_0xb747('0x4d')][_0xb747('0x70')],'read1stAt':_['isNil'](_0x165ac9[_0xb747('0x75')])?moment()[_0xb747('0x6f')](_0xb747('0x76')):undefined});}return null;})['then'](function(_0x646023){if(_0x646023){_0x57e704['interaction']=_0x646023[_0xb747('0x72')]({'plain':!![]});interaction_log[_0xb747('0x16')](_0xb747('0x77'),_0x52a276['user']['id'],_0x52a276[_0xb747('0x64')][_0xb747('0x2b')],_0x52a276[_0xb747('0x64')][_0xb747('0x78')],_0x57e704['interaction']['id'],_0x52a276[_0xb747('0x4d')]?JSON[_0xb747('0x1b')](_0x52a276['body']):'null');return respondWithRpcPromise(_0xb747('0x79'),'acceptMessage',_0x57e704);}return null;})[_0xb747('0x26')](function(_0x11def7){var _0x5f2ad2=_0xb747('0x7a')+_0x11def7['message'][_0xb747('0x7b')];return db['sequelize'][_0xb747('0x31')](_0x5f2ad2,{'type':db[_0xb747('0x7c')][_0xb747('0x7d')][_0xb747('0x7e')],'raw':!![]})[_0xb747('0x26')](function(_0x6cf1bf){return _0x6cf1bf;});})[_0xb747('0x26')](function(_0x33a024){if(_0x33a024){_0x57e704[_0xb747('0x1d')][_0xb747('0x7f')]=_0x33a024[0x0];if(!_0x52a276[_0xb747('0x4d')][_0xb747('0x70')])return;return db['User'][_0xb747('0x4c')]({'where':{'id':_0x52a276[_0xb747('0x4d')][_0xb747('0x70')],'role':_0xb747('0x71')},'attributes':['id',_0xb747('0x2b'),_0xb747('0x80'),_0xb747('0x81'),_0xb747('0x82')],'raw':!![]});}return null;})[_0xb747('0x26')](function(_0x5efe11){if(!_0x5efe11)return null;_0x57e704[_0xb747('0x1d')][_0xb747('0x71')]=_0x5efe11;return _0x57e704;})[_0xb747('0x26')](function(_0x19e292){if(_0x19e292){if(_0x52a276[_0xb747('0x4d')][_0xb747('0x83')]){_0x57e704[_0xb747('0x1d')][_0xb747('0x84')]=util[_0xb747('0x6f')](_0xb747('0x85'),_0x52a276['user'][_0xb747('0x2b')]);_0x57e704['message'][_0xb747('0x86')]=_0x57e704[_0xb747('0x86')];_0x57e704['message'][_0xb747('0x87')]=_0x57e704[_0xb747('0x86')];_0x57e704['message'][_0xb747('0x88')]=_0xb747('0x6b');_0x57e704['message'][_0xb747('0x4d')]=htmlToText[_0xb747('0x89')](_0x57e704['message'][_0xb747('0x4d')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb747('0x8a'),'message':_0x57e704[_0xb747('0x1d')]},client9002)[_0xb747('0x26')](function(){return _0x57e704;});}return _0x57e704;}return null;})[_0xb747('0x26')](respondWithResult(_0x51c42f,null))[_0xb747('0x48')](handleError(_0x51c42f,null));};exports[_0xb747('0x8b')]=function(_0x51468e,_0x55f9f3){var _0xf363bd={'agent':{},'channel':'mail'};if(_0x51468e[_0xb747('0x4d')]['id']){delete _0x51468e[_0xb747('0x4d')]['id'];}_0x51468e['body'][_0xb747('0x70')]=_0x51468e[_0xb747('0x4d')]['UserId']||_0x51468e['user']['id'];_0xf363bd[_0xb747('0x71')]['id']=_0x51468e[_0xb747('0x4d')][_0xb747('0x70')];return db[_0xb747('0x2e')][_0xb747('0x4c')]({'where':{'id':_0x51468e['params']['id'],'UserId':null}})[_0xb747('0x26')](handleEntityNotFound(_0x55f9f3,null))[_0xb747('0x26')](function(_0x3924b0){if(_0x3924b0){_0xf363bd[_0xb747('0x1d')]=_0x3924b0[_0xb747('0x72')]({'plain':!![]});return db[_0xb747('0x73')][_0xb747('0x4c')]({'where':{'id':_0x3924b0['MailInteractionId']}});}return null;})[_0xb747('0x26')](handleEntityNotFound(_0x55f9f3,null))['then'](function(_0xd47ebc){if(_0xd47ebc){_0xf363bd[_0xb747('0x8c')]=_0xd47ebc[_0xb747('0x72')]({'plain':!![]});interaction_log[_0xb747('0x16')](_0xb747('0x8d'),_0x51468e[_0xb747('0x64')]['id'],_0x51468e[_0xb747('0x64')][_0xb747('0x2b')],_0x51468e['user'][_0xb747('0x78')],_0xf363bd[_0xb747('0x8c')]['id'],_0x51468e[_0xb747('0x4d')]?JSON['stringify'](_0x51468e['body']):'null');return respondWithRpcPromise(_0xb747('0x8e'),'rejectMessage',_0xf363bd);}return null;})['then'](function(_0x5d47a3){var _0x2acb3e=_0xb747('0x7a')+_0x5d47a3[_0xb747('0x1d')][_0xb747('0x7b')];return db[_0xb747('0x8f')][_0xb747('0x31')](_0x2acb3e,{'type':db[_0xb747('0x7c')][_0xb747('0x7d')][_0xb747('0x7e')],'raw':!![]})[_0xb747('0x26')](function(_0x90a1dc){return _0x90a1dc;});})['then'](function(_0x2be236){if(_0x2be236){_0xf363bd['message'][_0xb747('0x7f')]=_0x2be236[0x0];if(!_0x51468e[_0xb747('0x4d')][_0xb747('0x70')])return;return db[_0xb747('0x90')][_0xb747('0x4c')]({'where':{'id':_0x51468e['body'][_0xb747('0x70')],'role':_0xb747('0x71')},'attributes':['id','name','fullname',_0xb747('0x81'),'internal'],'raw':!![]});}return null;})[_0xb747('0x26')](function(_0xe44dcd){if(!_0xe44dcd)return null;_0xf363bd[_0xb747('0x1d')][_0xb747('0x71')]=_0xe44dcd;return _0xf363bd;})[_0xb747('0x26')](function(_0x21d259){if(_0x21d259){_0x21d259['message'][_0xb747('0x84')]=util['format'](_0xb747('0x85'),_0x51468e[_0xb747('0x64')]['name']);_0x21d259['message']['channel']=_0xf363bd[_0xb747('0x86')];_0x21d259[_0xb747('0x1d')]['motionChannel']=_0xf363bd['channel'];_0x21d259[_0xb747('0x1d')][_0xb747('0x88')]='reject';_0x21d259[_0xb747('0x1d')][_0xb747('0x4d')]=htmlToText['fromString'](_0xf363bd['message'][_0xb747('0x4d')]);respondWithRpcPromise(_0xb747('0x91'),_0xb747('0x91'),{'event':_0xb747('0x92'),'message':_0x21d259['message']},client9002);return _0xf363bd;}return null;})[_0xb747('0x26')](respondWithResult(_0x55f9f3,null))[_0xb747('0x48')](handleError(_0x55f9f3,null));};exports[_0xb747('0x93')]=function(_0x12a852,_0x26b6f9){var _0x27f52c=moment()[_0xb747('0x94')]()[_0xb747('0x95')]();var _0x3721db=path[_0xb747('0x96')](config[_0xb747('0x97')],_0xb747('0x98'),_0xb747('0x99'),_0xb747('0x9a'));var _0x16e1f7=path['join'](config[_0xb747('0x97')],_0xb747('0x98'),'files',_0xb747('0x66'));var _0x34dc0d=util[_0xb747('0x6f')](_0xb747('0x9b'),_0x27f52c);return db[_0xb747('0x2e')][_0xb747('0x4c')]({'where':{'id':_0x12a852[_0xb747('0x4a')]['id']},'attributes':['id','body',_0xb747('0x9c'),'to','cc',_0xb747('0x9d'),_0xb747('0x9e'),'createdAt'],'include':_0x12a852[_0xb747('0x31')][_0xb747('0x66')]?[{'model':db[_0xb747('0x9f')],'as':'Attachments'}]:undefined})[_0xb747('0x26')](handleEntityNotFound(_0x26b6f9,null))['then'](function(_0x2d5122){if(_0x2d5122){var _0x19b64e=_0x2d5122;var _0x3153da={'from':_0x19b64e[_0xb747('0x9c')],'to':_0x19b64e['to'],'subject':_0x19b64e[_0xb747('0x9e')],'html':htmlEntities[_0xb747('0xa0')](_0x19b64e['body']),'headers':{'Date':moment(_0x19b64e[_0xb747('0xa1')])[_0xb747('0x6f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2d5122['cc']){_0x3153da[_0xb747('0xa2')]['Cc']=_0x2d5122['cc'];}if(_0x2d5122['bcc']){_0x3153da['headers'][_0xb747('0xa3')]=_0x2d5122['bcc'];}return new BPromise(function(_0x52dd88,_0x4697ce){if(_0x2d5122[_0xb747('0xa4')]){for(var _0x191f6b=0x0;_0x191f6b<_0x2d5122[_0xb747('0xa4')]['length'];_0x191f6b++){var _0x1ba4fd=_0x2d5122[_0xb747('0xa4')][_0x191f6b];var _0x6071cd=path[_0xb747('0x96')](_0x16e1f7,_0x1ba4fd[_0xb747('0xa5')]);if(fs[_0xb747('0xa6')](_0x6071cd)){_0x3153da['attachments']['push']({'name':_0x1ba4fd[_0xb747('0x2b')],'contentType':_0x1ba4fd['type'],'data':fs[_0xb747('0xa7')](_0x6071cd)});}}}emlformat[_0xb747('0xa8')](_0x3153da,function(_0x3d51ce,_0x29472b){if(_0x3d51ce)return _0x4697ce(_0x3d51ce);fs[_0xb747('0xa9')](path[_0xb747('0x96')](_0x3721db,_0x34dc0d),_0x29472b);return _0x52dd88(_0x29472b);});});}})[_0xb747('0x26')](function(_0x247340){if(_0x247340){return _0x26b6f9[_0xb747('0x93')](path[_0xb747('0x96')](_0x3721db,_0x34dc0d),_0x34dc0d,function(_0x14af75){if(!_0x14af75)fs[_0xb747('0xaa')](path[_0xb747('0x96')](_0x3721db,_0x34dc0d));});}})[_0xb747('0x48')](handleError(_0x26b6f9,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 188aaa7..0373201 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 _0xecf1=['save','remove','emit','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x88d2fd,_0x1a6bbb){var _0x37ca48=function(_0xfb5896){while(--_0xfb5896){_0x88d2fd['push'](_0x88d2fd['shift']());}};_0x37ca48(++_0x1a6bbb);}(_0xecf1,0x8d));var _0x1ecf=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xecf1[_0x2a0738];return _0x159679;};'use strict';var EventEmitter=require(_0x1ecf('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x1ecf('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1ecf('0x2')](0x0);var events={'afterCreate':_0x1ecf('0x3'),'afterUpdate':'update','afterDestroy':_0x1ecf('0x4')};function emitEvent(_0x43780c){return function(_0x36faf8,_0x15c986,_0x5df2f6){MailMessageEvents[_0x1ecf('0x5')](_0x43780c+':'+_0x36faf8['id'],_0x36faf8);MailMessageEvents['emit'](_0x43780c,_0x36faf8);_0x5df2f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x1ecf('0x6')](e,emitEvent(event));}}module[_0x1ecf('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xdfbc=['update','remove','emit','hook','exports','MailMessage','setMaxListeners','save'];(function(_0x4c3982,_0x99acc8){var _0x33801c=function(_0x586e52){while(--_0x586e52){_0x4c3982['push'](_0x4c3982['shift']());}};_0x33801c(++_0x99acc8);}(_0xdfbc,0x16d));var _0xcdfb=function(_0x531510,_0x2ad435){_0x531510=_0x531510-0x0;var _0x44a745=_0xdfbc[_0x531510];return _0x44a745;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xcdfb('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcdfb('0x1')](0x0);var events={'afterCreate':_0xcdfb('0x2'),'afterUpdate':_0xcdfb('0x3'),'afterDestroy':_0xcdfb('0x4')};function emitEvent(_0x413e05){return function(_0x3102e8,_0x1b0dca,_0x4b3047){MailMessageEvents[_0xcdfb('0x5')](_0x413e05+':'+_0x3102e8['id'],_0x3102e8);MailMessageEvents[_0xcdfb('0x5')](_0x413e05,_0x3102e8);_0x4b3047(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xcdfb('0x6')](e,emitEvent(event));}}module[_0xcdfb('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 8612da8..664240d 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 _0xce6a=['get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0xce6a,0xa0));var _0xace6=function(_0x2bb70e,_0x65f470){_0x2bb70e=_0x2bb70e-0x0;var _0x41adca=_0xce6a[_0x2bb70e];return _0x41adca;};'use strict';var _=require('lodash');var util=require(_0xace6('0x0'));var logger=require(_0xace6('0x1'))(_0xace6('0x2'));var moment=require(_0xace6('0x3'));var BPromise=require(_0xace6('0x4'));var rp=require(_0xace6('0x5'));var htmlToText=require(_0xace6('0x6'));var fs=require('fs');var path=require(_0xace6('0x7'));var rimraf=require(_0xace6('0x8'));var config=require(_0xace6('0x9'));var attributes=require(_0xace6('0xa'));module[_0xace6('0xb')]=function(_0x45f4fc,_0xd2a39b){return _0x45f4fc[_0xace6('0xc')]('MailMessage',attributes,{'tableName':_0xace6('0xd'),'paranoid':![],'indexes':[{'name':_0xace6('0xe'),'fields':[_0xace6('0xe')]},{'name':_0xace6('0xf'),'fields':[_0xace6('0x10'),_0xace6('0x11')],'type':_0xace6('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcbaefe,_0x48cb82,_0x18b6e2){if(_0xcbaefe['body']){_0xcbaefe['plainBody']=htmlToText['fromString'](_0xcbaefe[_0xace6('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x18b6e2(null,_0x48cb82);},'afterCreate':function(_0x25a972,_0x72e35,_0x3961f4){var _0x41131b=_0x45f4fc['models'];var _0x51901f=_0x25a972[_0xace6('0x14')]({'plain':!![]});if(_0x51901f[_0xace6('0x15')][_0xace6('0x16')]()==='in'||_0x51901f['direction'][_0xace6('0x16')]()===_0xace6('0x17')&&!_0x51901f[_0xace6('0x18')]&&!_[_0xace6('0x19')](_0x51901f[_0xace6('0x1a')])){_0x41131b[_0xace6('0x1b')][_0xace6('0x1c')]({'where':{'id':_0x51901f[_0xace6('0x1d')]}})[_0xace6('0x1e')](function(_0x4c4a43){if(_0x4c4a43){_0x4c4a43[_0xace6('0x1f')]({'lastMsgAt':_0x51901f[_0xace6('0x20')],'lastMsgDirection':_0x51901f[_0xace6('0x15')]['toLowerCase']()});}})['catch'](function(_0x9c6667){console[_0xace6('0x21')](_0x9c6667);});}_0x3961f4();}},'charset':_0xace6('0x22'),'collate':_0xace6('0x23')});}; \ No newline at end of file +var _0xcb03=['MailInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','out','secret','UserId','findOne'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xcb03,0x144));var _0x3cb0=function(_0x3787e4,_0x1332d2){_0x3787e4=_0x3787e4-0x0;var _0x4824e1=_0xcb03[_0x3787e4];return _0x4824e1;};'use strict';var _=require(_0x3cb0('0x0'));var util=require(_0x3cb0('0x1'));var logger=require(_0x3cb0('0x2'))(_0x3cb0('0x3'));var moment=require(_0x3cb0('0x4'));var BPromise=require(_0x3cb0('0x5'));var rp=require(_0x3cb0('0x6'));var htmlToText=require(_0x3cb0('0x7'));var fs=require('fs');var path=require(_0x3cb0('0x8'));var rimraf=require(_0x3cb0('0x9'));var config=require(_0x3cb0('0xa'));var attributes=require(_0x3cb0('0xb'));module[_0x3cb0('0xc')]=function(_0x4d84ea,_0x11277e){return _0x4d84ea['define'](_0x3cb0('0xd'),attributes,{'tableName':_0x3cb0('0xe'),'paranoid':![],'indexes':[{'name':_0x3cb0('0xf'),'fields':['messageId']},{'name':_0x3cb0('0x10'),'fields':[_0x3cb0('0x11'),'subject'],'type':_0x3cb0('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e98f3,_0x48a787,_0x3fa507){if(_0x2e98f3[_0x3cb0('0x13')]){_0x2e98f3[_0x3cb0('0x11')]=htmlToText['fromString'](_0x2e98f3[_0x3cb0('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3fa507(null,_0x48a787);},'afterCreate':function(_0x1a4e6f,_0x120489,_0x4829d9){var _0x2920bc=_0x4d84ea[_0x3cb0('0x14')];var _0x3984e3=_0x1a4e6f[_0x3cb0('0x15')]({'plain':!![]});if(_0x3984e3['direction']['toLowerCase']()==='in'||_0x3984e3['direction']['toLowerCase']()===_0x3cb0('0x16')&&!_0x3984e3[_0x3cb0('0x17')]&&!_['isNil'](_0x3984e3[_0x3cb0('0x18')])){_0x2920bc['MailInteraction'][_0x3cb0('0x19')]({'where':{'id':_0x3984e3[_0x3cb0('0x1a')]}})[_0x3cb0('0x1b')](function(_0x275b55){if(_0x275b55){_0x275b55[_0x3cb0('0x1c')]({'lastMsgAt':_0x3984e3[_0x3cb0('0x1d')],'lastMsgDirection':_0x3984e3['direction'][_0x3cb0('0x1e')]()});}})[_0x3cb0('0x1f')](function(_0x53ae12){console[_0x3cb0('0x20')](_0x53ae12);});}_0x4829d9();}},'charset':_0x3cb0('0x21'),'collate':_0x3cb0('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index d71a1f9..36362ba 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 _0x36ee=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateMailMessage','MailMessage','create','body','options','debug'];(function(_0xee6bd0,_0x27979f){var _0x48fd8d=function(_0x25422d){while(--_0x25422d){_0xee6bd0['push'](_0xee6bd0['shift']());}};_0x48fd8d(++_0x27979f);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});config[_0xe36e('0xb')]=_[_0xe36e('0xc')](config['redis'],{'host':_0xe36e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0xb')]));require(_0xe36e('0xe'))[_0xe36e('0xf')](socket);function respondWithRpcPromise(_0x47ce3a,_0xf119e4,_0x48981b){return new BPromise(function(_0x2e968d,_0x2133cf){return client[_0xe36e('0x10')](_0x47ce3a,_0x48981b)[_0xe36e('0x11')](function(_0xce0110){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));logger['debug'](_0xe36e('0x15'),_0xf119e4,_0xe36e('0x14'),JSON[_0xe36e('0x16')](_0xce0110));if(_0xce0110[_0xe36e('0x17')]){if(_0xce0110['error'][_0xe36e('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2133cf(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}logger[_0xe36e('0x17')](_0xe36e('0x13'),_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2e968d(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}else{logger['info'](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));_0x2e968d(_0xce0110['result'][_0xe36e('0x19')]);}})['catch'](function(_0x471400){logger[_0xe36e('0x17')]('MailMessage,\x20%s,\x20%s',_0xf119e4,_0x471400);_0x2133cf(_0x471400);});});}exports[_0xe36e('0x1a')]=function(_0x6aa186){var _0x21efe7=this;return new Promise(function(_0x597331,_0x21e95e){return db[_0xe36e('0x1b')][_0xe36e('0x1c')](_0x6aa186[_0xe36e('0x1d')],{'raw':_0x6aa186[_0xe36e('0x1e')]?_0x6aa186[_0xe36e('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe36e('0x11')](function(_0x4f214a){logger[_0xe36e('0x12')](_0xe36e('0x1a'),_0x6aa186);logger[_0xe36e('0x1f')]('CreateMailMessage',_0x6aa186,JSON['stringify'](_0x4f214a));_0x597331(_0x4f214a);})[_0xe36e('0x20')](function(_0x10818d){logger[_0xe36e('0x17')](_0xe36e('0x1a'),_0x10818d[_0xe36e('0x19')],_0x6aa186);_0x21e95e(_0x21efe7[_0xe36e('0x17')](0x1f4,_0x10818d[_0xe36e('0x19')]));});});}; \ No newline at end of file +var _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x319d26,_0x3a0aa6){var _0x27eea0=function(_0x30f39e){while(--_0x30f39e){_0x319d26['push'](_0x319d26['shift']());}};_0x27eea0(++_0x3a0aa6);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x5c3c[_0x1f9f37];return _0x21c080;};'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});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index dc87a60..bd98871 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 _0x220b=['remove','update','emit','mailMessage:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x220b,0x1b7));var _0xb220=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x220b[_0x3042c5];return _0x7cd140;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xb220('0x0'),_0xb220('0x1'),_0xb220('0x2')];function createListener(_0x659ee1,_0x2c8e01){return function(_0x227960){_0x2c8e01[_0xb220('0x3')](_0x659ee1,_0x227960);};}function removeListener(_0x287097,_0x4b01ea){return function(){MailMessageEvents['removeListener'](_0x287097,_0x4b01ea);};}exports['register']=function(_0x5719c9){for(var _0x477aaf=0x0,_0x5943d3=events['length'];_0x477aaf<_0x5943d3;_0x477aaf++){var _0x4bde5e=events[_0x477aaf];var _0x49c4ea=createListener(_0xb220('0x4')+_0x4bde5e,_0x5719c9);MailMessageEvents['on'](_0x4bde5e,_0x49c4ea);}}; \ No newline at end of file +var _0x86b6=['mailMessage:','./mailMessage.events','save','remove','update','register'];(function(_0x86e30c,_0x3b0d1b){var _0x3caba0=function(_0x3c71fc){while(--_0x3c71fc){_0x86e30c['push'](_0x86e30c['shift']());}};_0x3caba0(++_0x3b0d1b);}(_0x86b6,0x157));var _0x686b=function(_0x59e21c,_0x4d77b9){_0x59e21c=_0x59e21c-0x0;var _0x199b4c=_0x86b6[_0x59e21c];return _0x199b4c;};'use strict';var MailMessageEvents=require(_0x686b('0x0'));var events=[_0x686b('0x1'),_0x686b('0x2'),_0x686b('0x3')];function createListener(_0x51d849,_0x2a94ac){return function(_0x3a3b28){_0x2a94ac['emit'](_0x51d849,_0x3a3b28);};}function removeListener(_0x27a32f,_0x3e2048){return function(){MailMessageEvents['removeListener'](_0x27a32f,_0x3e2048);};}exports[_0x686b('0x4')]=function(_0xb2f371){for(var _0x388e70=0x0,_0x4cd47d=events['length'];_0x388e70<_0x4cd47d;_0x388e70++){var _0x1dd04c=events[_0x388e70];var _0x3d1388=createListener(_0x686b('0x5')+_0x1dd04c,_0xb2f371);MailMessageEvents['on'](_0x1dd04c,_0x3d1388);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 37ac0dc..9b4cd19 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 _0x823d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','/:id','show','getMembers','getTeams','getAgents','post','create','/:id/teams','/:id/users','put','delete','destroy','removeAgents','multer'];(function(_0x550b0f,_0x197dcc){var _0x1bf8ef=function(_0x338742){while(--_0x338742){_0x550b0f['push'](_0x550b0f['shift']());}};_0x1bf8ef(++_0x197dcc);}(_0x823d,0x137));var _0xd823=function(_0xd60031,_0x5efb93){_0xd60031=_0xd60031-0x0;var _0x43d00a=_0x823d[_0xd60031];return _0x43d00a;};'use strict';var multer=require(_0xd823('0x0'));var util=require(_0xd823('0x1'));var path=require(_0xd823('0x2'));var timeout=require(_0xd823('0x3'));var express=require(_0xd823('0x4'));var router=express['Router']();var fs_extra=require(_0xd823('0x5'));var auth=require(_0xd823('0x6'));var interaction=require(_0xd823('0x7'));var config=require('../../config/environment');var controller=require(_0xd823('0x8'));router['get']('/',auth[_0xd823('0x9')](),controller[_0xd823('0xa')]);router[_0xd823('0xb')](_0xd823('0xc'),auth[_0xd823('0x9')](),controller['describe']);router[_0xd823('0xb')](_0xd823('0xd'),auth[_0xd823('0x9')](),controller[_0xd823('0xe')]);router[_0xd823('0xb')]('/:id/members',auth[_0xd823('0x9')](),controller[_0xd823('0xf')]);router['get']('/:id/teams',auth[_0xd823('0x9')](),controller[_0xd823('0x10')]);router[_0xd823('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xd823('0x11')]);router[_0xd823('0x12')]('/',auth['isAuthenticated'](),controller[_0xd823('0x13')]);router[_0xd823('0x12')](_0xd823('0x14'),auth[_0xd823('0x9')](),controller['addTeams']);router['post'](_0xd823('0x15'),auth[_0xd823('0x9')](),controller['addAgents']);router[_0xd823('0x16')]('/:id',auth[_0xd823('0x9')](),controller['update']);router[_0xd823('0x17')](_0xd823('0xd'),auth['isAuthenticated'](),controller[_0xd823('0x18')]);router['delete'](_0xd823('0x14'),auth[_0xd823('0x9')](),controller['removeTeams']);router[_0xd823('0x17')](_0xd823('0x15'),auth[_0xd823('0x9')](),controller[_0xd823('0x19')]);module['exports']=router; \ No newline at end of file +var _0x8388=['post','addTeams','addAgents','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create'];(function(_0x35cb3a,_0x3302c6){var _0x9a73f8=function(_0x2d1ad1){while(--_0x2d1ad1){_0x35cb3a['push'](_0x35cb3a['shift']());}};_0x9a73f8(++_0x3302c6);}(_0x8388,0x1ba));var _0x8838=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x8388[_0x1c0f41];return _0x369a9f;};'use strict';var multer=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var path=require(_0x8838('0x2'));var timeout=require('connect-timeout');var express=require(_0x8838('0x3'));var router=express['Router']();var fs_extra=require(_0x8838('0x4'));var auth=require(_0x8838('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8838('0x6'));router[_0x8838('0x7')]('/',auth[_0x8838('0x8')](),controller[_0x8838('0x9')]);router[_0x8838('0x7')]('/describe',auth[_0x8838('0x8')](),controller['describe']);router[_0x8838('0x7')]('/:id',auth[_0x8838('0x8')](),controller[_0x8838('0xa')]);router['get'](_0x8838('0xb'),auth[_0x8838('0x8')](),controller[_0x8838('0xc')]);router[_0x8838('0x7')](_0x8838('0xd'),auth['isAuthenticated'](),controller[_0x8838('0xe')]);router['get'](_0x8838('0xf'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x8838('0x8')](),controller[_0x8838('0x10')]);router[_0x8838('0x11')](_0x8838('0xd'),auth[_0x8838('0x8')](),controller[_0x8838('0x12')]);router[_0x8838('0x11')](_0x8838('0xf'),auth[_0x8838('0x8')](),controller[_0x8838('0x13')]);router['put'](_0x8838('0x14'),auth[_0x8838('0x8')](),controller[_0x8838('0x15')]);router['delete']('/:id',auth[_0x8838('0x8')](),controller[_0x8838('0x16')]);router[_0x8838('0x17')]('/:id/teams',auth[_0x8838('0x8')](),controller[_0x8838('0x18')]);router[_0x8838('0x17')](_0x8838('0xf'),auth[_0x8838('0x8')](),controller[_0x8838('0x19')]);module[_0x8838('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 abf1ce8..0e6a052 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 _0xbd5e=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3f171b,_0x7af153){var _0x1f1893=function(_0x12684b){while(--_0x12684b){_0x3f171b['push'](_0x3f171b['shift']());}};_0x1f1893(++_0x7af153);}(_0xbd5e,0xcf));var _0xebd5=function(_0x391342,_0x35b0aa){_0x391342=_0x391342-0x0;var _0x352751=_0xbd5e[_0x391342];return _0x352751;};'use strict';var Sequelize=require(_0xebd5('0x0'));module[_0xebd5('0x1')]={'name':{'type':Sequelize[_0xebd5('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xebd5('0x2')]},'timeout':{'type':Sequelize[_0xebd5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xebd5('0x4')]('rrmemory',_0xebd5('0x5'),_0xebd5('0x6'))}}; \ No newline at end of file +var _0xb711=['name','INTEGER','ENUM','roundrobin','sequelize','STRING'];(function(_0x58b14f,_0x50833f){var _0x10ce5a=function(_0x43fea6){while(--_0x43fea6){_0x58b14f['push'](_0x58b14f['shift']());}};_0x10ce5a(++_0x50833f);}(_0xb711,0x12a));var _0x1b71=function(_0x98d384,_0x5c5d13){_0x98d384=_0x98d384-0x0;var _0xd95ed5=_0xb711[_0x98d384];return _0xd95ed5;};'use strict';var Sequelize=require(_0x1b71('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b71('0x1')],'unique':_0x1b71('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1b71('0x1')]},'timeout':{'type':Sequelize[_0x1b71('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b71('0x4')]('rrmemory','beepall',_0x1b71('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 3afa248..5e7bfcc 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 _0xca07=['addTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','userMailQueue:save','removeAgents','isArray','getAgents','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','sendStatus','stack','name','map','MailQueue','rawAttributes','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','find','create','body','user','UserProfileSection','autoAssociation','params','describe','getMembers','keys','UserMailQueue','nolimit','MailQueueId','User','findAndCountAll','createdAt','format','SIP','mailPause','getTeams','findOne','Team'];(function(_0x14311a,_0x4fa562){var _0x4b798b=function(_0x5b3a89){while(--_0x5b3a89){_0x14311a['push'](_0x14311a['shift']());}};_0x4b798b(++_0x4fa562);}(_0xca07,0xb1));var _0x7ca0=function(_0x1a5eb0,_0x1f8fbb){_0x1a5eb0=_0x1a5eb0-0x0;var _0x30f9ba=_0xca07[_0x1a5eb0];return _0x30f9ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ca0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ca0('0x1'));var rp=require('request-promise');var moment=require(_0x7ca0('0x2'));var BPromise=require(_0x7ca0('0x3'));var Mustache=require(_0x7ca0('0x4'));var util=require('util');var path=require(_0x7ca0('0x5'));var sox=require(_0x7ca0('0x6'));var csv=require(_0x7ca0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7ca0('0x8'));var crypto=require(_0x7ca0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7ca0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7ca0('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ca0('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7ca0('0xd'));var hardwareService=require(_0x7ca0('0xe'));var logger=require(_0x7ca0('0xf'))(_0x7ca0('0x10'));var utils=require(_0x7ca0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7ca0('0x12'));var db=require(_0x7ca0('0x13'))['db'];config[_0x7ca0('0x14')]=_[_0x7ca0('0x15')](config[_0x7ca0('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ca0('0x16'))(new Redis(config[_0x7ca0('0x14')]));require(_0x7ca0('0x17'))[_0x7ca0('0x18')](socket);function respondWithStatusCode(_0x358f60,_0x472c00){_0x472c00=_0x472c00||0xcc;return function(_0x365773){if(_0x365773){return _0x358f60['sendStatus'](_0x472c00);}return _0x358f60['status'](_0x472c00)['end']();};}function respondWithResult(_0xcb51e2,_0x108a28){_0x108a28=_0x108a28||0xc8;return function(_0x1fd121){if(_0x1fd121){return _0xcb51e2[_0x7ca0('0x19')](_0x108a28)[_0x7ca0('0x1a')](_0x1fd121);}};}function respondWithFilteredResult(_0x3e94a3,_0x1da32f){return function(_0x59e466){if(_0x59e466){var _0x2da9e3=typeof _0x1da32f[_0x7ca0('0x1b')]==='undefined'&&typeof _0x1da32f[_0x7ca0('0x1c')]===_0x7ca0('0x1d');var _0x2a6718=_0x59e466[_0x7ca0('0x1e')];var _0x50357e=_0x2da9e3?0x0:_0x1da32f[_0x7ca0('0x1b')];var _0x240ea2=_0x2da9e3?_0x59e466[_0x7ca0('0x1e')]:_0x1da32f['offset']+_0x1da32f[_0x7ca0('0x1c')];var _0x309cd2;if(_0x240ea2>=_0x2a6718){_0x240ea2=_0x2a6718;_0x309cd2=0xc8;}else{_0x309cd2=0xce;}_0x3e94a3[_0x7ca0('0x19')](_0x309cd2);return _0x3e94a3[_0x7ca0('0x1f')](_0x7ca0('0x20'),_0x50357e+'-'+_0x240ea2+'/'+_0x2a6718)[_0x7ca0('0x1a')](_0x59e466);}return null;};}function patchUpdates(_0x4f9f6f){return function(_0x5b0fea){try{jsonpatch['apply'](_0x5b0fea,_0x4f9f6f,!![]);}catch(_0x298326){return BPromise[_0x7ca0('0x21')](_0x298326);}return _0x5b0fea[_0x7ca0('0x22')]();};}function saveUpdates(_0x44aa04,_0x3d8ecd){return function(_0x86456c){if(_0x86456c){return _0x86456c[_0x7ca0('0x23')](_0x44aa04)[_0x7ca0('0x24')](function(_0x54e547){return _0x54e547;});}return null;};}function removeEntity(_0x5d1bd2,_0x2a3719){return function(_0x23b18a){if(_0x23b18a){return _0x23b18a[_0x7ca0('0x25')]()['then'](function(){var _0x4272ea=_0x23b18a[_0x7ca0('0x26')]({'plain':!![]});var _0x24a56d=_0x7ca0('0x27');return db[_0x7ca0('0x28')]['destroy']({'where':{'type':_0x24a56d,'resourceId':_0x4272ea['id']}})[_0x7ca0('0x24')](function(){return _0x23b18a;});})[_0x7ca0('0x24')](function(){_0x5d1bd2[_0x7ca0('0x19')](0xcc)[_0x7ca0('0x29')]();});}};}function handleEntityNotFound(_0x3e6598,_0x4d487f){return function(_0x13087e){if(!_0x13087e){_0x3e6598[_0x7ca0('0x2a')](0x194);}return _0x13087e;};}function handleError(_0x288c24,_0x8da68d){_0x8da68d=_0x8da68d||0x1f4;return function(_0x57cc77){logger['error'](_0x57cc77[_0x7ca0('0x2b')]);if(_0x57cc77[_0x7ca0('0x2c')]){delete _0x57cc77[_0x7ca0('0x2c')];}_0x288c24[_0x7ca0('0x19')](_0x8da68d)['send'](_0x57cc77);};}exports['index']=function(_0x30718d,_0x1bc620){var _0x563a58={},_0x22d087={},_0x37bda4={'count':0x0,'rows':[]};var _0x46c833=_[_0x7ca0('0x2d')](db[_0x7ca0('0x2e')][_0x7ca0('0x2f')],function(_0x54d71c){return{'name':_0x54d71c['fieldName'],'type':_0x54d71c[_0x7ca0('0x30')]['key']};});_0x22d087['model']=_[_0x7ca0('0x2d')](_0x46c833,_0x7ca0('0x2c'));_0x22d087[_0x7ca0('0x31')]=_['keys'](_0x30718d[_0x7ca0('0x31')]);_0x22d087[_0x7ca0('0x32')]=_[_0x7ca0('0x33')](_0x22d087['model'],_0x22d087[_0x7ca0('0x31')]);_0x563a58[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x22d087[_0x7ca0('0x35')],qs[_0x7ca0('0x36')](_0x30718d['query']['fields']));_0x563a58[_0x7ca0('0x34')]=_0x563a58[_0x7ca0('0x34')]['length']?_0x563a58[_0x7ca0('0x34')]:_0x22d087[_0x7ca0('0x35')];if(!_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x37')]('nolimit')){_0x563a58[_0x7ca0('0x1c')]=qs['limit'](_0x30718d[_0x7ca0('0x31')]['limit']);_0x563a58[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0x30718d[_0x7ca0('0x31')]['offset']);}_0x563a58[_0x7ca0('0x38')]=qs['sort'](_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x39')]);_0x563a58[_0x7ca0('0x3a')]=qs[_0x7ca0('0x32')](_[_0x7ca0('0x3b')](_0x30718d[_0x7ca0('0x31')],_0x22d087['filters']),_0x46c833);if(_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x3c')]){_0x563a58['where']=_[_0x7ca0('0x3d')](_0x563a58[_0x7ca0('0x3a')],{'$or':_['map'](_0x46c833,function(_0x28547d){if(_0x28547d[_0x7ca0('0x30')]!==_0x7ca0('0x3e')){var _0x972d43={};_0x972d43[_0x28547d[_0x7ca0('0x2c')]]={'$like':'%'+_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x972d43;}})});}_0x563a58=_['merge']({},_0x563a58,_0x30718d[_0x7ca0('0x3f')]);var _0x312348={'where':_0x563a58[_0x7ca0('0x3a')]};return db['MailQueue']['count'](_0x312348)[_0x7ca0('0x24')](function(_0x296bde){_0x37bda4[_0x7ca0('0x1e')]=_0x296bde;if(_0x30718d[_0x7ca0('0x31')][_0x7ca0('0x40')]){_0x563a58['include']=[{'all':!![]}];}return db[_0x7ca0('0x2e')]['findAll'](_0x563a58);})[_0x7ca0('0x24')](function(_0x3fc9a7){_0x37bda4[_0x7ca0('0x41')]=_0x3fc9a7;return _0x37bda4;})[_0x7ca0('0x24')](respondWithFilteredResult(_0x1bc620,_0x563a58))[_0x7ca0('0x42')](handleError(_0x1bc620,null));};exports[_0x7ca0('0x43')]=function(_0x1bd7c7,_0x19d32e){var _0x593551={'raw':!![],'where':{'id':_0x1bd7c7['params']['id']}},_0x3b0ece={};_0x3b0ece['model']=_['keys'](db[_0x7ca0('0x2e')][_0x7ca0('0x2f')]);_0x3b0ece['query']=_['keys'](_0x1bd7c7[_0x7ca0('0x31')]);_0x3b0ece['filters']=_[_0x7ca0('0x33')](_0x3b0ece[_0x7ca0('0x35')],_0x3b0ece['query']);_0x593551[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x3b0ece['model'],qs[_0x7ca0('0x36')](_0x1bd7c7[_0x7ca0('0x31')]['fields']));_0x593551[_0x7ca0('0x34')]=_0x593551[_0x7ca0('0x34')][_0x7ca0('0x44')]?_0x593551[_0x7ca0('0x34')]:_0x3b0ece[_0x7ca0('0x35')];if(_0x1bd7c7['query'][_0x7ca0('0x40')]){_0x593551['include']=[{'all':!![]}];}_0x593551=_[_0x7ca0('0x3d')]({},_0x593551,_0x1bd7c7['options']);return db[_0x7ca0('0x2e')][_0x7ca0('0x45')](_0x593551)[_0x7ca0('0x24')](handleEntityNotFound(_0x19d32e,null))['then'](respondWithResult(_0x19d32e,null))[_0x7ca0('0x42')](handleError(_0x19d32e,null));};exports[_0x7ca0('0x46')]=function(_0x3fc1e0,_0x212a0f){return db['MailQueue'][_0x7ca0('0x46')](_0x3fc1e0[_0x7ca0('0x47')],{})[_0x7ca0('0x24')](function(_0x488c16){var _0x7f2eff=_0x3fc1e0['user'][_0x7ca0('0x26')]({'plain':!![]});if(!_0x7f2eff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7f2eff['role']===_0x7ca0('0x48')){var _0xe41497=_0x488c16[_0x7ca0('0x26')]({'plain':!![]});var _0x417f96=_0x7ca0('0x27');return db[_0x7ca0('0x49')][_0x7ca0('0x45')]({'where':{'name':_0x417f96,'userProfileId':_0x7f2eff['userProfileId']},'raw':!![]})[_0x7ca0('0x24')](function(_0x458ad1){if(_0x458ad1&&_0x458ad1[_0x7ca0('0x4a')]===0x0){return db[_0x7ca0('0x28')]['create']({'name':_0xe41497[_0x7ca0('0x2c')],'resourceId':_0xe41497['id'],'type':_0x458ad1[_0x7ca0('0x2c')],'sectionId':_0x458ad1['id']},{})[_0x7ca0('0x24')](function(){return _0x488c16;});}else{return _0x488c16;}})['catch'](function(_0x500c21){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x500c21);throw _0x500c21;});}return _0x488c16;})[_0x7ca0('0x24')](respondWithResult(_0x212a0f,0xc9))[_0x7ca0('0x42')](handleError(_0x212a0f,null));};exports['update']=function(_0x4343b2,_0x51d3cf){if(_0x4343b2['body']['id']){delete _0x4343b2[_0x7ca0('0x47')]['id'];}return db[_0x7ca0('0x2e')]['find']({'where':{'id':_0x4343b2[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x51d3cf,null))[_0x7ca0('0x24')](saveUpdates(_0x4343b2['body'],null))[_0x7ca0('0x24')](respondWithResult(_0x51d3cf,null))[_0x7ca0('0x42')](handleError(_0x51d3cf,null));};exports[_0x7ca0('0x25')]=function(_0x42e3b3,_0x1b31e0){return db[_0x7ca0('0x2e')][_0x7ca0('0x45')]({'where':{'id':_0x42e3b3[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x1b31e0,null))[_0x7ca0('0x24')](removeEntity(_0x1b31e0,null))[_0x7ca0('0x42')](handleError(_0x1b31e0,null));};exports['describe']=function(_0x2844bf,_0x5e1559){return db[_0x7ca0('0x2e')][_0x7ca0('0x4c')]()['then'](respondWithResult(_0x5e1559,null))[_0x7ca0('0x42')](handleError(_0x5e1559,null));};exports[_0x7ca0('0x4d')]=function(_0xf38398,_0x132c8a,_0x4a6f3d){var _0x342c60={'raw':!![],'where':{}},_0x6ce08d={},_0x5f47e8;return db[_0x7ca0('0x2e')]['findOne']({'where':{'id':_0xf38398[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x132c8a,null))[_0x7ca0('0x24')](function(_0x465c03){if(_0x465c03){_0x5f47e8=_0x465c03[_0x7ca0('0x26')]({'plain':!![]});_0x6ce08d['model']=_[_0x7ca0('0x4e')](db[_0x7ca0('0x4f')]['rawAttributes']);_0x6ce08d[_0x7ca0('0x31')]=_[_0x7ca0('0x4e')](_0xf38398[_0x7ca0('0x31')]);_0x6ce08d[_0x7ca0('0x32')]=_[_0x7ca0('0x33')](_0x6ce08d[_0x7ca0('0x35')],_0x6ce08d[_0x7ca0('0x31')]);_0x342c60[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x6ce08d[_0x7ca0('0x35')],qs['fields'](_0xf38398['query']['fields']));_0x342c60[_0x7ca0('0x34')]=_0x342c60[_0x7ca0('0x34')]['length']?_0x342c60[_0x7ca0('0x34')]:_0x6ce08d[_0x7ca0('0x35')];if(!_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x37')](_0x7ca0('0x50'))){_0x342c60[_0x7ca0('0x1c')]=qs[_0x7ca0('0x1c')](_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x1c')]);_0x342c60[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x1b')]);}_0x342c60[_0x7ca0('0x38')]=qs[_0x7ca0('0x39')](_0xf38398['query'][_0x7ca0('0x39')]);_0x342c60[_0x7ca0('0x3a')]=qs['filters'](_[_0x7ca0('0x3b')](_0xf38398[_0x7ca0('0x31')],_0x6ce08d['filters']));_0x342c60['where'][_0x7ca0('0x51')]=_0x465c03['id'];if(_0xf38398['query'][_0x7ca0('0x3c')]){_0x342c60['where']=_[_0x7ca0('0x3d')](_0x342c60[_0x7ca0('0x3a')],{'$or':_['map'](_0x342c60[_0x7ca0('0x34')],function(_0x189380){var _0x1c2321={};_0x1c2321[_0x189380]={'$like':'%'+_0xf38398[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x1c2321;})});}_0x342c60=_[_0x7ca0('0x3d')]({},_0x342c60,_0xf38398[_0x7ca0('0x3f')]);return db[_0x7ca0('0x4f')]['findAll'](_0x342c60);}})['then'](function(_0x5210c1){if(_0x5210c1){return db[_0x7ca0('0x52')][_0x7ca0('0x53')]({'where':{'id':_['map'](_0x5210c1,'UserId'),'role':'agent'},'attributes':['id',_0x7ca0('0x2c'),'mailPause','updatedAt',_0x7ca0('0x54')]});}})['then'](function(_0x5b69bf){if(_0x5b69bf){return{'count':_0x5b69bf[_0x7ca0('0x1e')],'rows':_[_0x7ca0('0x2d')](_0x5b69bf[_0x7ca0('0x41')],function(_0x5413ca){return{'membername':_0x5413ca[_0x7ca0('0x2c')],'UserId':_0x5413ca['id'],'queue_name':_0x5f47e8[_0x7ca0('0x2c')],'MailQueueId':_0x5f47e8['id'],'interface':util[_0x7ca0('0x55')]('%s/%s',_0x7ca0('0x56'),_0x5413ca[_0x7ca0('0x2c')]),'penalty':0x0,'paused':_0x5413ca[_0x7ca0('0x57')],'createdAt':_0x5413ca['createdAt'],'updatedAt':_0x5413ca['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ca0('0x24')](respondWithFilteredResult(_0x132c8a,_0x342c60))[_0x7ca0('0x42')](handleError(_0x132c8a,null));};exports[_0x7ca0('0x58')]=function(_0x2b20a4,_0x1b451c,_0x133950){var _0x3517b5={};var _0x533a07={};var _0xd9a6a8;var _0x319c9e;return db[_0x7ca0('0x2e')][_0x7ca0('0x59')]({'where':{'id':_0x2b20a4[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x1b451c,null))[_0x7ca0('0x24')](function(_0x62ce55){if(_0x62ce55){_0xd9a6a8=_0x62ce55;_0x533a07[_0x7ca0('0x35')]=_['keys'](db[_0x7ca0('0x5a')][_0x7ca0('0x2f')]);_0x533a07[_0x7ca0('0x31')]=_[_0x7ca0('0x4e')](_0x2b20a4[_0x7ca0('0x31')]);_0x533a07[_0x7ca0('0x32')]=_['intersection'](_0x533a07[_0x7ca0('0x35')],_0x533a07[_0x7ca0('0x31')]);_0x3517b5[_0x7ca0('0x34')]=_['intersection'](_0x533a07[_0x7ca0('0x35')],qs[_0x7ca0('0x36')](_0x2b20a4[_0x7ca0('0x31')]['fields']));_0x3517b5[_0x7ca0('0x34')]=_0x3517b5[_0x7ca0('0x34')]['length']?_0x3517b5[_0x7ca0('0x34')]:_0x533a07[_0x7ca0('0x35')];_0x3517b5[_0x7ca0('0x38')]=qs['sort'](_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x39')]);_0x3517b5[_0x7ca0('0x3a')]=qs[_0x7ca0('0x32')](_[_0x7ca0('0x3b')](_0x2b20a4['query'],_0x533a07['filters']));if(_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x3c')]){_0x3517b5[_0x7ca0('0x3a')]=_['merge'](_0x3517b5[_0x7ca0('0x3a')],{'$or':_[_0x7ca0('0x2d')](_0x3517b5[_0x7ca0('0x34')],function(_0x274853){var _0x10a348={};_0x10a348[_0x274853]={'$like':'%'+_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x10a348;})});}_0x3517b5=_[_0x7ca0('0x3d')]({},_0x3517b5,_0x2b20a4[_0x7ca0('0x3f')]);return _0xd9a6a8[_0x7ca0('0x58')](_0x3517b5);}})[_0x7ca0('0x24')](function(_0x294f27){if(_0x294f27){_0x319c9e=_0x294f27[_0x7ca0('0x44')];if(!_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x37')]('nolimit')){_0x3517b5[_0x7ca0('0x1c')]=qs[_0x7ca0('0x1c')](_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x1c')]);_0x3517b5[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0x2b20a4[_0x7ca0('0x31')][_0x7ca0('0x1b')]);}return _0xd9a6a8['getTeams'](_0x3517b5);}})[_0x7ca0('0x24')](function(_0x4df975){if(_0x4df975){return _0x4df975?{'count':_0x319c9e,'rows':_0x4df975}:null;}})['then'](respondWithResult(_0x1b451c,null))['catch'](handleError(_0x1b451c,null));};exports[_0x7ca0('0x5b')]=function(_0x134fa8,_0x49102d,_0x741750){var _0x344f7e=_0x134fa8['body']['ids'];return db[_0x7ca0('0x5a')][_0x7ca0('0x5c')]({'where':{'id':_0x344f7e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ca0('0x5d'),'attributes':['id',_0x7ca0('0x2c'),_0x7ca0('0x5e'),_0x7ca0('0x5f'),_0x7ca0('0x60')],'raw':!![]}]})[_0x7ca0('0x24')](function(_0x2cb018){if(_0x2cb018){var _0x4fafdb=_[_0x7ca0('0x61')](_0x2cb018,function(_0x537aad){var _0x1dbe4a=_0x537aad[_0x7ca0('0x26')]({'plain':!![]});return _0x1dbe4a[_0x7ca0('0x5d')];});return db[_0x7ca0('0x2e')]['find']({'where':{'id':_0x134fa8['params']['id']}})[_0x7ca0('0x24')](function(_0x5b89d0){return db['sequelize'][_0x7ca0('0x62')](function(_0x17ff6c){return _0x5b89d0[_0x7ca0('0x5b')](_0x344f7e,{'transaction':_0x17ff6c})[_0x7ca0('0x24')](function(){return BPromise[_0x7ca0('0x63')](_0x4fafdb,function(_0x3bf012){return db[_0x7ca0('0x4f')][_0x7ca0('0x64')]({'where':{'UserId':_0x3bf012['id'],'MailQueueId':_0x134fa8[_0x7ca0('0x4b')]['id']},'transaction':_0x17ff6c});});})[_0x7ca0('0x24')](function(){_0x4fafdb[_0x7ca0('0x65')](function(_0x2ba453){socket[_0x7ca0('0x66')]('userMailQueue:save',{'UserId':_0x2ba453['id'],'MailQueueId':_0x5b89d0['id']});});});});});}})['then'](respondWithStatusCode(_0x49102d,null))[_0x7ca0('0x42')](handleError(_0x49102d,null));};exports[_0x7ca0('0x67')]=function(_0xde0a6a,_0x4df4e6,_0x3660bf){return db[_0x7ca0('0x5a')][_0x7ca0('0x5c')]({'where':{'id':_0xde0a6a[_0x7ca0('0x31')][_0x7ca0('0x68')]},'attributes':['id'],'include':[{'model':db[_0x7ca0('0x52')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7ca0('0x24')](handleEntityNotFound(_0x4df4e6,null))[_0x7ca0('0x24')](function(_0x529963){var _0x5f28f8=_[_0x7ca0('0x2d')](_0x529963,'id');var _0x29d9c7=[];var _0x286d07=[];var _0x7ebb1b=squel[_0x7ca0('0x69')]();_0x7ebb1b['field']('tq.TeamId')[_0x7ca0('0x6a')](_0x7ca0('0x6b'),'tq')[_0x7ca0('0x6c')](_0x7ca0('0x6d'),'ut',_0x7ca0('0x6e'))[_0x7ca0('0x3a')](_0x7ca0('0x6f'),_0xde0a6a[_0x7ca0('0x4b')]['id']);for(var _0x32c4a5=0x0;_0x32c4a5<_0x529963['length'];_0x32c4a5+=0x1){let _0x48533f=_0x529963[_0x32c4a5];for(var _0x17083f=0x0;_0x17083f<_0x48533f[_0x7ca0('0x5d')][_0x7ca0('0x44')];_0x17083f+=0x1){let _0x36da8d=_0x48533f['Agents'][_0x17083f];var _0x4dce53=_0x7ebb1b[_0x7ca0('0x70')]();_0x4dce53[_0x7ca0('0x3a')](_0x7ca0('0x71'),_0x36da8d['id']);_0x286d07[_0x7ca0('0x72')](db[_0x7ca0('0x73')][_0x7ca0('0x31')](_0x4dce53[_0x7ca0('0x74')](),{'type':db[_0x7ca0('0x73')][_0x7ca0('0x75')][_0x7ca0('0x76')]})[_0x7ca0('0x24')](function(_0x1d4d7a){if(_0x1d4d7a[_0x7ca0('0x44')]===0x1){return _0x36da8d['id'];}else{var _0x210290=_[_0x7ca0('0x77')](_['map'](_0x1d4d7a,_0x7ca0('0x78')),function(_0x276def){return _[_0x7ca0('0x79')](_0x5f28f8,_0x276def);});if(_0x210290){return _0x36da8d['id'];}}}));}}return BPromise[_0x7ca0('0x7a')](_0x286d07)['then'](function(_0x2758b8){_0x29d9c7=_(_0x29d9c7)[_0x7ca0('0x7b')](_0x2758b8)[_0x7ca0('0x7c')]()[_0x7ca0('0x7d')]();return db[_0x7ca0('0x2e')][_0x7ca0('0x45')]({'where':{'id':_0xde0a6a[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](function(_0x40b37d){return db['sequelize'][_0x7ca0('0x62')](function(_0x2e6ed8){return _0x40b37d[_0x7ca0('0x67')](_0xde0a6a[_0x7ca0('0x31')]['ids'],{'transaction':_0x2e6ed8})[_0x7ca0('0x24')](function(){if(!_[_0x7ca0('0x7e')](_0x29d9c7)){return _0x40b37d['removeAgents'](_0x29d9c7,{'transaction':_0x2e6ed8});}})[_0x7ca0('0x24')](function(){_0x29d9c7['forEach'](function(_0x3e0c6a){socket['emit'](_0x7ca0('0x7f'),{'UserId':_0x3e0c6a,'MailQueueId':_0x40b37d['id']});});});});});});})[_0x7ca0('0x24')](respondWithStatusCode(_0x4df4e6,null))[_0x7ca0('0x42')](handleError(_0x4df4e6,null));};exports['addAgents']=function(_0x144e49,_0x1af396,_0x116d66){return db[_0x7ca0('0x2e')][_0x7ca0('0x45')]({'where':{'id':_0x144e49[_0x7ca0('0x4b')]['id']}})[_0x7ca0('0x24')](handleEntityNotFound(_0x1af396,null))['then'](function(_0x2e6c01){if(_0x2e6c01){return _0x2e6c01[_0x7ca0('0x80')](_0x144e49[_0x7ca0('0x47')]['ids'],_[_0x7ca0('0x81')](_0x144e49[_0x7ca0('0x47')],[_0x7ca0('0x68'),'id'])||{})['spread'](function(_0x19d265){for(var _0x445430=0x0;_0x445430<_0x144e49['body'][_0x7ca0('0x68')][_0x7ca0('0x44')];_0x445430+=0x1){socket[_0x7ca0('0x66')](_0x7ca0('0x82'),{'UserId':Number(_0x144e49[_0x7ca0('0x47')][_0x7ca0('0x68')][_0x445430]),'MailQueueId':Number(_0x144e49['params']['id'])});}return _0x19d265;});}})[_0x7ca0('0x24')](respondWithResult(_0x1af396,null))[_0x7ca0('0x42')](handleError(_0x1af396,null));};exports[_0x7ca0('0x83')]=function(_0x1d5405,_0x3d668f,_0x440275){return db[_0x7ca0('0x2e')]['find']({'where':{'id':_0x1d5405[_0x7ca0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d668f,null))[_0x7ca0('0x24')](function(_0x24c635){if(_0x24c635){return _0x24c635[_0x7ca0('0x83')](_0x1d5405[_0x7ca0('0x31')][_0x7ca0('0x68')])[_0x7ca0('0x24')](function(){if(_[_0x7ca0('0x84')](_0x1d5405[_0x7ca0('0x31')][_0x7ca0('0x68')])){for(var _0x160d4f=0x0;_0x160d4f<_0x1d5405['query'][_0x7ca0('0x68')][_0x7ca0('0x44')];_0x160d4f+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x1d5405[_0x7ca0('0x31')]['ids'][_0x160d4f]),'MailQueueId':Number(_0x1d5405[_0x7ca0('0x4b')]['id'])});}}else{socket['emit'](_0x7ca0('0x7f'),{'UserId':Number(_0x1d5405[_0x7ca0('0x31')]['ids']),'MailQueueId':Number(_0x1d5405['params']['id'])});}});}})[_0x7ca0('0x24')](respondWithStatusCode(_0x3d668f,null))['catch'](handleError(_0x3d668f,null));};exports[_0x7ca0('0x85')]=function(_0x51fad3,_0x192055,_0x18c073){var _0x5798d8={};var _0x3c1825={};var _0x237627;var _0x1eb807;return db[_0x7ca0('0x2e')][_0x7ca0('0x59')]({'where':{'id':_0x51fad3[_0x7ca0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x192055,null))[_0x7ca0('0x24')](function(_0x30e024){if(_0x30e024){_0x237627=_0x30e024;_0x3c1825[_0x7ca0('0x35')]=_[_0x7ca0('0x4e')](db[_0x7ca0('0x52')][_0x7ca0('0x2f')]);_0x3c1825[_0x7ca0('0x31')]=_[_0x7ca0('0x4e')](_0x51fad3[_0x7ca0('0x31')]);_0x3c1825[_0x7ca0('0x32')]=_[_0x7ca0('0x33')](_0x3c1825[_0x7ca0('0x35')],_0x3c1825['query']);_0x5798d8[_0x7ca0('0x34')]=_[_0x7ca0('0x33')](_0x3c1825[_0x7ca0('0x35')],qs[_0x7ca0('0x36')](_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x36')]));_0x5798d8[_0x7ca0('0x34')]=_0x5798d8[_0x7ca0('0x34')][_0x7ca0('0x44')]?_0x5798d8['attributes']:_0x3c1825['model'];_0x5798d8[_0x7ca0('0x38')]=qs['sort'](_0x51fad3[_0x7ca0('0x31')]['sort']);_0x5798d8[_0x7ca0('0x3a')]=qs['filters'](_[_0x7ca0('0x3b')](_0x51fad3[_0x7ca0('0x31')],_0x3c1825[_0x7ca0('0x32')]));if(_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x3c')]){_0x5798d8[_0x7ca0('0x3a')]=_[_0x7ca0('0x3d')](_0x5798d8[_0x7ca0('0x3a')],{'$or':_['map'](_0x5798d8[_0x7ca0('0x34')],function(_0x5bcfef){var _0x3ae2e8={};_0x3ae2e8[_0x5bcfef]={'$like':'%'+_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x3c')]+'%'};return _0x3ae2e8;})});}_0x5798d8=_['merge']({},_0x5798d8,_0x51fad3['options']);return _0x237627['getAgents'](_0x5798d8);}})['then'](function(_0x4e5d40){if(_0x4e5d40){_0x1eb807=_0x4e5d40[_0x7ca0('0x44')];if(!_0x51fad3['query'][_0x7ca0('0x37')](_0x7ca0('0x50'))){_0x5798d8[_0x7ca0('0x1c')]=qs[_0x7ca0('0x1c')](_0x51fad3[_0x7ca0('0x31')][_0x7ca0('0x1c')]);_0x5798d8[_0x7ca0('0x1b')]=qs[_0x7ca0('0x1b')](_0x51fad3[_0x7ca0('0x31')]['offset']);}return _0x237627['getAgents'](_0x5798d8);}})[_0x7ca0('0x24')](function(_0x2bae63){if(_0x2bae63){return _0x2bae63?{'count':_0x1eb807,'rows':_0x2bae63}:null;}})[_0x7ca0('0x24')](respondWithResult(_0x192055,null))[_0x7ca0('0x42')](handleError(_0x192055,null));}; \ No newline at end of file +var _0x16c1=['count','set','Content-Range','apply','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','fieldName','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','findOne','UserMailQueue','rawAttributes','length','hasOwnProperty','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','includes','all','union','value','isEmpty','forEach','omit','spread','removeAgents','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x118eca,_0x28bc0a){var _0xe507c8=function(_0x493527){while(--_0x493527){_0x118eca['push'](_0x118eca['shift']());}};_0xe507c8(++_0x28bc0a);}(_0x16c1,0x66));var _0x116c=function(_0x5da65e,_0x37c881){_0x5da65e=_0x5da65e-0x0;var _0x4f1ea3=_0x16c1[_0x5da65e];return _0x4f1ea3;};'use strict';var emlformat=require(_0x116c('0x0'));var rimraf=require(_0x116c('0x1'));var zipdir=require(_0x116c('0x2'));var jsonpatch=require(_0x116c('0x3'));var rp=require(_0x116c('0x4'));var moment=require(_0x116c('0x5'));var BPromise=require(_0x116c('0x6'));var Mustache=require(_0x116c('0x7'));var util=require(_0x116c('0x8'));var path=require('path');var sox=require(_0x116c('0x9'));var csv=require('to-csv');var ejs=require(_0x116c('0xa'));var fs=require('fs');var fs_extra=require(_0x116c('0xb'));var _=require(_0x116c('0xc'));var squel=require(_0x116c('0xd'));var crypto=require(_0x116c('0xe'));var jsforce=require(_0x116c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x116c('0x10'));var querystring=require(_0x116c('0x11'));var Papa=require(_0x116c('0x12'));var Redis=require(_0x116c('0x13'));var authService=require(_0x116c('0x14'));var qs=require(_0x116c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x116c('0x16'));var logger=require(_0x116c('0x17'))(_0x116c('0x18'));var utils=require(_0x116c('0x19'));var config=require(_0x116c('0x1a'));var licenseUtil=require(_0x116c('0x1b'));var db=require(_0x116c('0x1c'))['db'];config[_0x116c('0x1d')]=_[_0x116c('0x1e')](config['redis'],{'host':_0x116c('0x1f'),'port':0x18eb});var socket=require(_0x116c('0x20'))(new Redis(config[_0x116c('0x1d')]));require(_0x116c('0x21'))['register'](socket);function respondWithStatusCode(_0x2da2d7,_0x1a4646){_0x1a4646=_0x1a4646||0xcc;return function(_0x22c1f9){if(_0x22c1f9){return _0x2da2d7[_0x116c('0x22')](_0x1a4646);}return _0x2da2d7[_0x116c('0x23')](_0x1a4646)[_0x116c('0x24')]();};}function respondWithResult(_0x5e5d06,_0x493aa7){_0x493aa7=_0x493aa7||0xc8;return function(_0x357d9f){if(_0x357d9f){return _0x5e5d06[_0x116c('0x23')](_0x493aa7)[_0x116c('0x25')](_0x357d9f);}};}function respondWithFilteredResult(_0x1d026c,_0x2a890e){return function(_0x29b75e){if(_0x29b75e){var _0x5c198f=typeof _0x2a890e[_0x116c('0x26')]===_0x116c('0x27')&&typeof _0x2a890e[_0x116c('0x28')]===_0x116c('0x27');var _0x288eb2=_0x29b75e[_0x116c('0x29')];var _0x320bdc=_0x5c198f?0x0:_0x2a890e[_0x116c('0x26')];var _0x53110e=_0x5c198f?_0x29b75e[_0x116c('0x29')]:_0x2a890e['offset']+_0x2a890e[_0x116c('0x28')];var _0x3b7f9e;if(_0x53110e>=_0x288eb2){_0x53110e=_0x288eb2;_0x3b7f9e=0xc8;}else{_0x3b7f9e=0xce;}_0x1d026c['status'](_0x3b7f9e);return _0x1d026c[_0x116c('0x2a')](_0x116c('0x2b'),_0x320bdc+'-'+_0x53110e+'/'+_0x288eb2)['json'](_0x29b75e);}return null;};}function patchUpdates(_0x330ed9){return function(_0x5a68ec){try{jsonpatch[_0x116c('0x2c')](_0x5a68ec,_0x330ed9,!![]);}catch(_0x538ce0){return BPromise['reject'](_0x538ce0);}return _0x5a68ec[_0x116c('0x2d')]();};}function saveUpdates(_0x4ad2c5,_0x46a3bd){return function(_0x35ba32){if(_0x35ba32){return _0x35ba32[_0x116c('0x2e')](_0x4ad2c5)[_0x116c('0x2f')](function(_0x5a879b){return _0x5a879b;});}return null;};}function removeEntity(_0x432cac,_0x40b219){return function(_0x34a39e){if(_0x34a39e){return _0x34a39e[_0x116c('0x30')]()[_0x116c('0x2f')](function(){var _0x101d19=_0x34a39e['get']({'plain':!![]});var _0x5c255a=_0x116c('0x31');return db[_0x116c('0x32')][_0x116c('0x30')]({'where':{'type':_0x5c255a,'resourceId':_0x101d19['id']}})[_0x116c('0x2f')](function(){return _0x34a39e;});})[_0x116c('0x2f')](function(){_0x432cac[_0x116c('0x23')](0xcc)[_0x116c('0x24')]();});}};}function handleEntityNotFound(_0x2ba6b4,_0x2a1140){return function(_0x4330fd){if(!_0x4330fd){_0x2ba6b4[_0x116c('0x22')](0x194);}return _0x4330fd;};}function handleError(_0x433906,_0x11b75f){_0x11b75f=_0x11b75f||0x1f4;return function(_0x20b3e7){logger[_0x116c('0x33')](_0x20b3e7[_0x116c('0x34')]);if(_0x20b3e7[_0x116c('0x35')]){delete _0x20b3e7[_0x116c('0x35')];}_0x433906[_0x116c('0x23')](_0x11b75f)[_0x116c('0x36')](_0x20b3e7);};}exports[_0x116c('0x37')]=function(_0x10493d,_0x3e5826){var _0x408f43={},_0x5adba7={},_0x2046bc={'count':0x0,'rows':[]};var _0x500222=_[_0x116c('0x38')](db[_0x116c('0x39')]['rawAttributes'],function(_0x21a274){return{'name':_0x21a274[_0x116c('0x3a')],'type':_0x21a274['type']['key']};});_0x5adba7[_0x116c('0x3b')]=_[_0x116c('0x38')](_0x500222,_0x116c('0x35'));_0x5adba7[_0x116c('0x3c')]=_[_0x116c('0x3d')](_0x10493d[_0x116c('0x3c')]);_0x5adba7[_0x116c('0x3e')]=_['intersection'](_0x5adba7[_0x116c('0x3b')],_0x5adba7[_0x116c('0x3c')]);_0x408f43[_0x116c('0x3f')]=_[_0x116c('0x40')](_0x5adba7[_0x116c('0x3b')],qs[_0x116c('0x41')](_0x10493d[_0x116c('0x3c')][_0x116c('0x41')]));_0x408f43['attributes']=_0x408f43[_0x116c('0x3f')]['length']?_0x408f43[_0x116c('0x3f')]:_0x5adba7[_0x116c('0x3b')];if(!_0x10493d[_0x116c('0x3c')]['hasOwnProperty'](_0x116c('0x42'))){_0x408f43[_0x116c('0x28')]=qs[_0x116c('0x28')](_0x10493d[_0x116c('0x3c')]['limit']);_0x408f43[_0x116c('0x26')]=qs[_0x116c('0x26')](_0x10493d[_0x116c('0x3c')][_0x116c('0x26')]);}_0x408f43['order']=qs[_0x116c('0x43')](_0x10493d['query']['sort']);_0x408f43['where']=qs[_0x116c('0x3e')](_[_0x116c('0x44')](_0x10493d[_0x116c('0x3c')],_0x5adba7[_0x116c('0x3e')]),_0x500222);if(_0x10493d[_0x116c('0x3c')]['filter']){_0x408f43[_0x116c('0x45')]=_[_0x116c('0x46')](_0x408f43[_0x116c('0x45')],{'$or':_[_0x116c('0x38')](_0x500222,function(_0x194eb3){if(_0x194eb3[_0x116c('0x47')]!==_0x116c('0x48')){var _0xba8ee={};_0xba8ee[_0x194eb3[_0x116c('0x35')]]={'$like':'%'+_0x10493d[_0x116c('0x3c')][_0x116c('0x49')]+'%'};return _0xba8ee;}})});}_0x408f43=_[_0x116c('0x46')]({},_0x408f43,_0x10493d[_0x116c('0x4a')]);var _0x33e5df={'where':_0x408f43[_0x116c('0x45')]};return db[_0x116c('0x39')]['count'](_0x33e5df)[_0x116c('0x2f')](function(_0x1e6419){_0x2046bc[_0x116c('0x29')]=_0x1e6419;if(_0x10493d['query']['includeAll']){_0x408f43[_0x116c('0x4b')]=[{'all':!![]}];}return db[_0x116c('0x39')][_0x116c('0x4c')](_0x408f43);})['then'](function(_0xe751bd){_0x2046bc[_0x116c('0x4d')]=_0xe751bd;return _0x2046bc;})['then'](respondWithFilteredResult(_0x3e5826,_0x408f43))[_0x116c('0x4e')](handleError(_0x3e5826,null));};exports[_0x116c('0x4f')]=function(_0x4e48e6,_0x1416b7){var _0x4e471f={'raw':!![],'where':{'id':_0x4e48e6[_0x116c('0x50')]['id']}},_0x3a5b9f={};_0x3a5b9f[_0x116c('0x3b')]=_[_0x116c('0x3d')](db[_0x116c('0x39')]['rawAttributes']);_0x3a5b9f[_0x116c('0x3c')]=_[_0x116c('0x3d')](_0x4e48e6[_0x116c('0x3c')]);_0x3a5b9f[_0x116c('0x3e')]=_['intersection'](_0x3a5b9f[_0x116c('0x3b')],_0x3a5b9f[_0x116c('0x3c')]);_0x4e471f[_0x116c('0x3f')]=_[_0x116c('0x40')](_0x3a5b9f[_0x116c('0x3b')],qs[_0x116c('0x41')](_0x4e48e6[_0x116c('0x3c')][_0x116c('0x41')]));_0x4e471f['attributes']=_0x4e471f['attributes']['length']?_0x4e471f[_0x116c('0x3f')]:_0x3a5b9f[_0x116c('0x3b')];if(_0x4e48e6[_0x116c('0x3c')][_0x116c('0x51')]){_0x4e471f[_0x116c('0x4b')]=[{'all':!![]}];}_0x4e471f=_[_0x116c('0x46')]({},_0x4e471f,_0x4e48e6[_0x116c('0x4a')]);return db['MailQueue'][_0x116c('0x52')](_0x4e471f)[_0x116c('0x2f')](handleEntityNotFound(_0x1416b7,null))[_0x116c('0x2f')](respondWithResult(_0x1416b7,null))[_0x116c('0x4e')](handleError(_0x1416b7,null));};exports[_0x116c('0x53')]=function(_0x244653,_0x38820e){return db[_0x116c('0x39')][_0x116c('0x53')](_0x244653[_0x116c('0x54')],{})['then'](function(_0x34eac2){var _0x105856=_0x244653['user'][_0x116c('0x55')]({'plain':!![]});if(!_0x105856)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x105856[_0x116c('0x56')]===_0x116c('0x57')){var _0x5c2249=_0x34eac2['get']({'plain':!![]});var _0x5f4a5e=_0x116c('0x31');return db[_0x116c('0x58')][_0x116c('0x52')]({'where':{'name':_0x5f4a5e,'userProfileId':_0x105856[_0x116c('0x59')]},'raw':!![]})['then'](function(_0x199272){if(_0x199272&&_0x199272[_0x116c('0x5a')]===0x0){return db[_0x116c('0x32')]['create']({'name':_0x5c2249[_0x116c('0x35')],'resourceId':_0x5c2249['id'],'type':_0x199272['name'],'sectionId':_0x199272['id']},{})[_0x116c('0x2f')](function(){return _0x34eac2;});}else{return _0x34eac2;}})[_0x116c('0x4e')](function(_0x3a916d){logger[_0x116c('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a916d);throw _0x3a916d;});}return _0x34eac2;})[_0x116c('0x2f')](respondWithResult(_0x38820e,0xc9))[_0x116c('0x4e')](handleError(_0x38820e,null));};exports['update']=function(_0x271ee5,_0x29096f){if(_0x271ee5[_0x116c('0x54')]['id']){delete _0x271ee5[_0x116c('0x54')]['id'];}return db[_0x116c('0x39')][_0x116c('0x52')]({'where':{'id':_0x271ee5[_0x116c('0x50')]['id']}})['then'](handleEntityNotFound(_0x29096f,null))[_0x116c('0x2f')](saveUpdates(_0x271ee5[_0x116c('0x54')],null))['then'](respondWithResult(_0x29096f,null))['catch'](handleError(_0x29096f,null));};exports[_0x116c('0x30')]=function(_0x579461,_0x1ca7a0){return db[_0x116c('0x39')][_0x116c('0x52')]({'where':{'id':_0x579461[_0x116c('0x50')]['id']}})[_0x116c('0x2f')](handleEntityNotFound(_0x1ca7a0,null))[_0x116c('0x2f')](removeEntity(_0x1ca7a0,null))[_0x116c('0x4e')](handleError(_0x1ca7a0,null));};exports['describe']=function(_0x44f4dc,_0x38b8ff){return db[_0x116c('0x39')]['describe']()[_0x116c('0x2f')](respondWithResult(_0x38b8ff,null))['catch'](handleError(_0x38b8ff,null));};exports['getMembers']=function(_0xeca4b,_0x21dd58,_0x4d99d6){var _0x4d5fbd={'raw':!![],'where':{}},_0x548cb3={},_0x9552dd;return db[_0x116c('0x39')][_0x116c('0x5b')]({'where':{'id':_0xeca4b[_0x116c('0x50')]['id']}})[_0x116c('0x2f')](handleEntityNotFound(_0x21dd58,null))[_0x116c('0x2f')](function(_0x3860c8){if(_0x3860c8){_0x9552dd=_0x3860c8[_0x116c('0x55')]({'plain':!![]});_0x548cb3[_0x116c('0x3b')]=_[_0x116c('0x3d')](db[_0x116c('0x5c')][_0x116c('0x5d')]);_0x548cb3[_0x116c('0x3c')]=_[_0x116c('0x3d')](_0xeca4b[_0x116c('0x3c')]);_0x548cb3['filters']=_[_0x116c('0x40')](_0x548cb3['model'],_0x548cb3[_0x116c('0x3c')]);_0x4d5fbd[_0x116c('0x3f')]=_[_0x116c('0x40')](_0x548cb3[_0x116c('0x3b')],qs[_0x116c('0x41')](_0xeca4b['query'][_0x116c('0x41')]));_0x4d5fbd[_0x116c('0x3f')]=_0x4d5fbd['attributes'][_0x116c('0x5e')]?_0x4d5fbd[_0x116c('0x3f')]:_0x548cb3[_0x116c('0x3b')];if(!_0xeca4b[_0x116c('0x3c')][_0x116c('0x5f')](_0x116c('0x42'))){_0x4d5fbd['limit']=qs['limit'](_0xeca4b['query'][_0x116c('0x28')]);_0x4d5fbd[_0x116c('0x26')]=qs['offset'](_0xeca4b[_0x116c('0x3c')][_0x116c('0x26')]);}_0x4d5fbd['order']=qs[_0x116c('0x43')](_0xeca4b[_0x116c('0x3c')][_0x116c('0x43')]);_0x4d5fbd[_0x116c('0x45')]=qs[_0x116c('0x3e')](_[_0x116c('0x44')](_0xeca4b['query'],_0x548cb3[_0x116c('0x3e')]));_0x4d5fbd[_0x116c('0x45')]['MailQueueId']=_0x3860c8['id'];if(_0xeca4b[_0x116c('0x3c')][_0x116c('0x49')]){_0x4d5fbd[_0x116c('0x45')]=_[_0x116c('0x46')](_0x4d5fbd['where'],{'$or':_[_0x116c('0x38')](_0x4d5fbd['attributes'],function(_0x385da3){var _0x180584={};_0x180584[_0x385da3]={'$like':'%'+_0xeca4b[_0x116c('0x3c')][_0x116c('0x49')]+'%'};return _0x180584;})});}_0x4d5fbd=_[_0x116c('0x46')]({},_0x4d5fbd,_0xeca4b[_0x116c('0x4a')]);return db['UserMailQueue'][_0x116c('0x4c')](_0x4d5fbd);}})['then'](function(_0x2c58e0){if(_0x2c58e0){return db['User']['findAndCountAll']({'where':{'id':_[_0x116c('0x38')](_0x2c58e0,_0x116c('0x60')),'role':_0x116c('0x61')},'attributes':['id',_0x116c('0x35'),_0x116c('0x62'),_0x116c('0x63'),_0x116c('0x64')]});}})[_0x116c('0x2f')](function(_0x1b7780){if(_0x1b7780){return{'count':_0x1b7780['count'],'rows':_['map'](_0x1b7780['rows'],function(_0x245b91){return{'membername':_0x245b91[_0x116c('0x35')],'UserId':_0x245b91['id'],'queue_name':_0x9552dd[_0x116c('0x35')],'MailQueueId':_0x9552dd['id'],'interface':util[_0x116c('0x65')](_0x116c('0x66'),_0x116c('0x67'),_0x245b91[_0x116c('0x35')]),'penalty':0x0,'paused':_0x245b91[_0x116c('0x62')],'createdAt':_0x245b91[_0x116c('0x64')],'updatedAt':_0x245b91[_0x116c('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x116c('0x2f')](respondWithFilteredResult(_0x21dd58,_0x4d5fbd))['catch'](handleError(_0x21dd58,null));};exports[_0x116c('0x68')]=function(_0x320e28,_0x50b192,_0x548378){var _0x49cf22={};var _0x40b745={};var _0x266bf1;var _0x5a1748;return db[_0x116c('0x39')][_0x116c('0x5b')]({'where':{'id':_0x320e28[_0x116c('0x50')]['id']}})[_0x116c('0x2f')](handleEntityNotFound(_0x50b192,null))[_0x116c('0x2f')](function(_0x13acf7){if(_0x13acf7){_0x266bf1=_0x13acf7;_0x40b745[_0x116c('0x3b')]=_[_0x116c('0x3d')](db[_0x116c('0x69')]['rawAttributes']);_0x40b745[_0x116c('0x3c')]=_[_0x116c('0x3d')](_0x320e28[_0x116c('0x3c')]);_0x40b745[_0x116c('0x3e')]=_[_0x116c('0x40')](_0x40b745[_0x116c('0x3b')],_0x40b745['query']);_0x49cf22['attributes']=_[_0x116c('0x40')](_0x40b745[_0x116c('0x3b')],qs[_0x116c('0x41')](_0x320e28[_0x116c('0x3c')][_0x116c('0x41')]));_0x49cf22[_0x116c('0x3f')]=_0x49cf22['attributes'][_0x116c('0x5e')]?_0x49cf22['attributes']:_0x40b745[_0x116c('0x3b')];_0x49cf22[_0x116c('0x6a')]=qs[_0x116c('0x43')](_0x320e28[_0x116c('0x3c')][_0x116c('0x43')]);_0x49cf22[_0x116c('0x45')]=qs[_0x116c('0x3e')](_[_0x116c('0x44')](_0x320e28[_0x116c('0x3c')],_0x40b745['filters']));if(_0x320e28[_0x116c('0x3c')]['filter']){_0x49cf22[_0x116c('0x45')]=_[_0x116c('0x46')](_0x49cf22['where'],{'$or':_[_0x116c('0x38')](_0x49cf22[_0x116c('0x3f')],function(_0x3f2a16){var _0xf1cc75={};_0xf1cc75[_0x3f2a16]={'$like':'%'+_0x320e28[_0x116c('0x3c')][_0x116c('0x49')]+'%'};return _0xf1cc75;})});}_0x49cf22=_[_0x116c('0x46')]({},_0x49cf22,_0x320e28[_0x116c('0x4a')]);return _0x266bf1[_0x116c('0x68')](_0x49cf22);}})['then'](function(_0x442462){if(_0x442462){_0x5a1748=_0x442462[_0x116c('0x5e')];if(!_0x320e28[_0x116c('0x3c')][_0x116c('0x5f')](_0x116c('0x42'))){_0x49cf22['limit']=qs[_0x116c('0x28')](_0x320e28[_0x116c('0x3c')][_0x116c('0x28')]);_0x49cf22[_0x116c('0x26')]=qs[_0x116c('0x26')](_0x320e28['query'][_0x116c('0x26')]);}return _0x266bf1[_0x116c('0x68')](_0x49cf22);}})[_0x116c('0x2f')](function(_0x2e48d2){if(_0x2e48d2){return _0x2e48d2?{'count':_0x5a1748,'rows':_0x2e48d2}:null;}})['then'](respondWithResult(_0x50b192,null))['catch'](handleError(_0x50b192,null));};exports[_0x116c('0x6b')]=function(_0x1b928e,_0x44cdd9,_0x1e698c){var _0x562022=_0x1b928e[_0x116c('0x54')][_0x116c('0x6c')];return db['Team'][_0x116c('0x4c')]({'where':{'id':_0x562022},'attributes':['id'],'include':[{'model':db[_0x116c('0x6d')],'as':_0x116c('0x6e'),'attributes':['id',_0x116c('0x35'),_0x116c('0x6f'),_0x116c('0x70'),'interface'],'raw':!![]}]})['then'](function(_0x19f4e5){if(_0x19f4e5){var _0x1ef93b=_[_0x116c('0x71')](_0x19f4e5,function(_0x472a8e){var _0x43801b=_0x472a8e[_0x116c('0x55')]({'plain':!![]});return _0x43801b[_0x116c('0x6e')];});return db['MailQueue'][_0x116c('0x52')]({'where':{'id':_0x1b928e[_0x116c('0x50')]['id']}})['then'](function(_0x1ba07a){return db[_0x116c('0x72')][_0x116c('0x73')](function(_0x3455ac){return _0x1ba07a['addTeams'](_0x562022,{'transaction':_0x3455ac})[_0x116c('0x2f')](function(){return BPromise[_0x116c('0x74')](_0x1ef93b,function(_0x4516bf){return db[_0x116c('0x5c')][_0x116c('0x75')]({'where':{'UserId':_0x4516bf['id'],'MailQueueId':_0x1b928e[_0x116c('0x50')]['id']},'transaction':_0x3455ac});});})[_0x116c('0x2f')](function(){_0x1ef93b['forEach'](function(_0x5469bc){socket[_0x116c('0x76')](_0x116c('0x77'),{'UserId':_0x5469bc['id'],'MailQueueId':_0x1ba07a['id']});});});});});}})['then'](respondWithStatusCode(_0x44cdd9,null))[_0x116c('0x4e')](handleError(_0x44cdd9,null));};exports[_0x116c('0x78')]=function(_0x15d457,_0x4b6315,_0x242ade){return db[_0x116c('0x69')][_0x116c('0x4c')]({'where':{'id':_0x15d457['query'][_0x116c('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x116c('0x6d')],'as':_0x116c('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x116c('0x2f')](handleEntityNotFound(_0x4b6315,null))[_0x116c('0x2f')](function(_0x5da792){var _0x139ac4=_['map'](_0x5da792,'id');var _0x180348=[];var _0x3dba4a=[];var _0x2ab64a=squel[_0x116c('0x79')]();_0x2ab64a['field'](_0x116c('0x7a'))['from'](_0x116c('0x7b'),'tq')[_0x116c('0x7c')](_0x116c('0x7d'),'ut',_0x116c('0x7e'))['where'](_0x116c('0x7f'),_0x15d457['params']['id']);for(var _0x46fffc=0x0;_0x46fffc<_0x5da792[_0x116c('0x5e')];_0x46fffc+=0x1){let _0x5b2ae6=_0x5da792[_0x46fffc];for(var _0x4cc7fb=0x0;_0x4cc7fb<_0x5b2ae6['Agents'][_0x116c('0x5e')];_0x4cc7fb+=0x1){let _0x2f9d43=_0x5b2ae6[_0x116c('0x6e')][_0x4cc7fb];var _0x144564=_0x2ab64a[_0x116c('0x80')]();_0x144564[_0x116c('0x45')](_0x116c('0x81'),_0x2f9d43['id']);_0x3dba4a['push'](db['sequelize'][_0x116c('0x3c')](_0x144564['toString'](),{'type':db[_0x116c('0x72')]['QueryTypes'][_0x116c('0x82')]})[_0x116c('0x2f')](function(_0x2ebc99){if(_0x2ebc99['length']===0x1){return _0x2f9d43['id'];}else{var _0x14cb26=_['every'](_[_0x116c('0x38')](_0x2ebc99,'TeamId'),function(_0x449eae){return _[_0x116c('0x83')](_0x139ac4,_0x449eae);});if(_0x14cb26){return _0x2f9d43['id'];}}}));}}return BPromise[_0x116c('0x84')](_0x3dba4a)[_0x116c('0x2f')](function(_0x324218){_0x180348=_(_0x180348)[_0x116c('0x85')](_0x324218)['compact']()[_0x116c('0x86')]();return db['MailQueue'][_0x116c('0x52')]({'where':{'id':_0x15d457[_0x116c('0x50')]['id']}})[_0x116c('0x2f')](function(_0xfb27e3){return db[_0x116c('0x72')]['transaction'](function(_0x5e740f){return _0xfb27e3[_0x116c('0x78')](_0x15d457[_0x116c('0x3c')][_0x116c('0x6c')],{'transaction':_0x5e740f})['then'](function(){if(!_[_0x116c('0x87')](_0x180348)){return _0xfb27e3['removeAgents'](_0x180348,{'transaction':_0x5e740f});}})[_0x116c('0x2f')](function(){_0x180348[_0x116c('0x88')](function(_0x9a8302){socket[_0x116c('0x76')]('userMailQueue:remove',{'UserId':_0x9a8302,'MailQueueId':_0xfb27e3['id']});});});});});});})[_0x116c('0x2f')](respondWithStatusCode(_0x4b6315,null))['catch'](handleError(_0x4b6315,null));};exports['addAgents']=function(_0x4e4f69,_0x116b2f,_0x5d4e68){return db[_0x116c('0x39')]['find']({'where':{'id':_0x4e4f69['params']['id']}})[_0x116c('0x2f')](handleEntityNotFound(_0x116b2f,null))[_0x116c('0x2f')](function(_0x579823){if(_0x579823){return _0x579823['addAgents'](_0x4e4f69['body'][_0x116c('0x6c')],_[_0x116c('0x89')](_0x4e4f69[_0x116c('0x54')],[_0x116c('0x6c'),'id'])||{})[_0x116c('0x8a')](function(_0x31367b){for(var _0x48a048=0x0;_0x48a048<_0x4e4f69['body'][_0x116c('0x6c')][_0x116c('0x5e')];_0x48a048+=0x1){socket['emit'](_0x116c('0x77'),{'UserId':Number(_0x4e4f69['body'][_0x116c('0x6c')][_0x48a048]),'MailQueueId':Number(_0x4e4f69[_0x116c('0x50')]['id'])});}return _0x31367b;});}})['then'](respondWithResult(_0x116b2f,null))[_0x116c('0x4e')](handleError(_0x116b2f,null));};exports[_0x116c('0x8b')]=function(_0x1cc352,_0x29d5f7,_0x44ce3a){return db[_0x116c('0x39')][_0x116c('0x52')]({'where':{'id':_0x1cc352[_0x116c('0x50')]['id']}})[_0x116c('0x2f')](handleEntityNotFound(_0x29d5f7,null))[_0x116c('0x2f')](function(_0x45fc5a){if(_0x45fc5a){return _0x45fc5a[_0x116c('0x8b')](_0x1cc352[_0x116c('0x3c')][_0x116c('0x6c')])[_0x116c('0x2f')](function(){if(_[_0x116c('0x8c')](_0x1cc352['query'][_0x116c('0x6c')])){for(var _0x546bde=0x0;_0x546bde<_0x1cc352[_0x116c('0x3c')][_0x116c('0x6c')][_0x116c('0x5e')];_0x546bde+=0x1){socket[_0x116c('0x76')](_0x116c('0x8d'),{'UserId':Number(_0x1cc352['query'][_0x116c('0x6c')][_0x546bde]),'MailQueueId':Number(_0x1cc352[_0x116c('0x50')]['id'])});}}else{socket[_0x116c('0x76')]('userMailQueue:remove',{'UserId':Number(_0x1cc352[_0x116c('0x3c')][_0x116c('0x6c')]),'MailQueueId':Number(_0x1cc352[_0x116c('0x50')]['id'])});}});}})[_0x116c('0x2f')](respondWithStatusCode(_0x29d5f7,null))['catch'](handleError(_0x29d5f7,null));};exports[_0x116c('0x8e')]=function(_0x5a9e02,_0x1aaa4f,_0x5d8a48){var _0x3fe99c={};var _0x1ef3bf={};var _0x3e5041;var _0x3ecaa4;return db['MailQueue'][_0x116c('0x5b')]({'where':{'id':_0x5a9e02[_0x116c('0x50')]['id']}})[_0x116c('0x2f')](handleEntityNotFound(_0x1aaa4f,null))['then'](function(_0x253cf1){if(_0x253cf1){_0x3e5041=_0x253cf1;_0x1ef3bf[_0x116c('0x3b')]=_[_0x116c('0x3d')](db[_0x116c('0x6d')][_0x116c('0x5d')]);_0x1ef3bf['query']=_[_0x116c('0x3d')](_0x5a9e02['query']);_0x1ef3bf['filters']=_['intersection'](_0x1ef3bf[_0x116c('0x3b')],_0x1ef3bf[_0x116c('0x3c')]);_0x3fe99c[_0x116c('0x3f')]=_[_0x116c('0x40')](_0x1ef3bf[_0x116c('0x3b')],qs[_0x116c('0x41')](_0x5a9e02[_0x116c('0x3c')][_0x116c('0x41')]));_0x3fe99c[_0x116c('0x3f')]=_0x3fe99c[_0x116c('0x3f')][_0x116c('0x5e')]?_0x3fe99c['attributes']:_0x1ef3bf[_0x116c('0x3b')];_0x3fe99c[_0x116c('0x6a')]=qs[_0x116c('0x43')](_0x5a9e02[_0x116c('0x3c')][_0x116c('0x43')]);_0x3fe99c['where']=qs['filters'](_['pick'](_0x5a9e02['query'],_0x1ef3bf[_0x116c('0x3e')]));if(_0x5a9e02['query']['filter']){_0x3fe99c[_0x116c('0x45')]=_['merge'](_0x3fe99c[_0x116c('0x45')],{'$or':_[_0x116c('0x38')](_0x3fe99c[_0x116c('0x3f')],function(_0x333f81){var _0x5c0191={};_0x5c0191[_0x333f81]={'$like':'%'+_0x5a9e02[_0x116c('0x3c')][_0x116c('0x49')]+'%'};return _0x5c0191;})});}_0x3fe99c=_[_0x116c('0x46')]({},_0x3fe99c,_0x5a9e02['options']);return _0x3e5041['getAgents'](_0x3fe99c);}})[_0x116c('0x2f')](function(_0x348b52){if(_0x348b52){_0x3ecaa4=_0x348b52[_0x116c('0x5e')];if(!_0x5a9e02[_0x116c('0x3c')][_0x116c('0x5f')](_0x116c('0x42'))){_0x3fe99c[_0x116c('0x28')]=qs['limit'](_0x5a9e02[_0x116c('0x3c')][_0x116c('0x28')]);_0x3fe99c['offset']=qs[_0x116c('0x26')](_0x5a9e02['query'][_0x116c('0x26')]);}return _0x3e5041[_0x116c('0x8e')](_0x3fe99c);}})[_0x116c('0x2f')](function(_0x454e93){if(_0x454e93){return _0x454e93?{'count':_0x3ecaa4,'rows':_0x454e93}:null;}})[_0x116c('0x2f')](respondWithResult(_0x1aaa4f,null))['catch'](handleError(_0x1aaa4f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 5848871..1d5ed7f 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 _0x3215=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save'];(function(_0x2862a3,_0x279026){var _0xe8edd0=function(_0x36d73f){while(--_0x36d73f){_0x2862a3['push'](_0x2862a3['shift']());}};_0xe8edd0(++_0x279026);}(_0x3215,0x146));var _0x5321=function(_0x1ffcdd,_0x29fa39){_0x1ffcdd=_0x1ffcdd-0x0;var _0x10d702=_0x3215[_0x1ffcdd];return _0x10d702;};'use strict';var EventEmitter=require(_0x5321('0x0'));var MailQueue=require(_0x5321('0x1'))['db'][_0x5321('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5321('0x3'),'afterUpdate':_0x5321('0x4'),'afterDestroy':_0x5321('0x5')};function emitEvent(_0x598e40){return function(_0x11c111,_0x58c991,_0x1b87e4){MailQueueEvents[_0x5321('0x6')](_0x598e40+':'+_0x11c111['id'],_0x11c111);MailQueueEvents[_0x5321('0x6')](_0x598e40,_0x11c111);_0x1b87e4(null);};}for(var e in events){if(events[_0x5321('0x7')](e)){var event=events[e];MailQueue[_0x5321('0x8')](e,emitEvent(event));}}module[_0x5321('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x4745=['save','update','remove','emit','hasOwnProperty','hook','exports','events','MailQueue'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_0x4745,0xd6));var _0x5474=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x4745[_0x13ea00];return _0x1f7347;};'use strict';var EventEmitter=require(_0x5474('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x5474('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5474('0x2'),'afterUpdate':_0x5474('0x3'),'afterDestroy':_0x5474('0x4')};function emitEvent(_0x298344){return function(_0x9b503,_0x48419d,_0x33e7df){MailQueueEvents[_0x5474('0x5')](_0x298344+':'+_0x9b503['id'],_0x9b503);MailQueueEvents[_0x5474('0x5')](_0x298344,_0x9b503);_0x33e7df(null);};}for(var e in events){if(events[_0x5474('0x6')](e)){var event=events[e];MailQueue[_0x5474('0x7')](e,emitEvent(event));}}module[_0x5474('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f1a831a..071c7e5 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 _0x875c=['moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','mail_queues','lodash','../../config/logger'];(function(_0x406664,_0x2c92d2){var _0x506a0e=function(_0x21dbcf){while(--_0x21dbcf){_0x406664['push'](_0x406664['shift']());}};_0x506a0e(++_0x2c92d2);}(_0x875c,0x7e));var _0xc875=function(_0x3921e9,_0x7aa7a8){_0x3921e9=_0x3921e9-0x0;var _0x2c963f=_0x875c[_0x3921e9];return _0x2c963f;};'use strict';var _=require(_0xc875('0x0'));var util=require('util');var logger=require(_0xc875('0x1'))('api');var moment=require(_0xc875('0x2'));var BPromise=require('bluebird');var rp=require(_0xc875('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc875('0x4'));var config=require(_0xc875('0x5'));var attributes=require(_0xc875('0x6'));module['exports']=function(_0x257b44,_0x6711cf){return _0x257b44['define']('MailQueue',attributes,{'tableName':_0xc875('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb47d=['moment','bluebird','path','rimraf','../../config/environment','define','util'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xb47d,0x1e9));var _0xdb47=function(_0x1d943f,_0x10d69e){_0x1d943f=_0x1d943f-0x0;var _0x35e828=_0xb47d[_0x1d943f];return _0x35e828;};'use strict';var _=require('lodash');var util=require(_0xdb47('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdb47('0x1'));var BPromise=require(_0xdb47('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb47('0x3'));var rimraf=require(_0xdb47('0x4'));var config=require(_0xdb47('0x5'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x24c62f,_0x5a4fcf){return _0x24c62f[_0xdb47('0x6')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 8546fec..687d29d 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 _0xe12f=['stringify','error','code','message','info','catch','GetMailQueue','findAll','options','raw','where','attributes','include','model','map','then','debug','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults','redis','register','request','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2144df,_0x44549b){var _0x11a2eb=function(_0x4dc17a){while(--_0x4dc17a){_0x2144df['push'](_0x2144df['shift']());}};_0x11a2eb(++_0x44549b);}(_0xe12f,0x83));var _0xfe12=function(_0x55cc37,_0x145f61){_0x55cc37=_0x55cc37-0x0;var _0x42e3a0=_0xe12f[_0x55cc37];return _0x42e3a0;};'use strict';var _=require(_0xfe12('0x0'));var util=require(_0xfe12('0x1'));var moment=require(_0xfe12('0x2'));var BPromise=require(_0xfe12('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe12('0x4'));var db=require(_0xfe12('0x5'))['db'];var utils=require(_0xfe12('0x6'));var logger=require('../../config/logger')(_0xfe12('0x7'));var config=require(_0xfe12('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe12('0x9')]({'port':0x232a});config['redis']=_[_0xfe12('0xa')](config[_0xfe12('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe12('0xb')]));require('./mailQueue.socket')[_0xfe12('0xc')](socket);function respondWithRpcPromise(_0x4c13f6,_0x23f9a6,_0x10f3b1){return new BPromise(function(_0x25f4eb,_0x276c9b){return client[_0xfe12('0xd')](_0x4c13f6,_0x10f3b1)['then'](function(_0x3c20a1){logger['info'](_0xfe12('0xe'),_0x23f9a6,'request\x20sent');logger['debug'](_0xfe12('0xf'),_0x23f9a6,_0xfe12('0x10'),JSON[_0xfe12('0x11')](_0x3c20a1));if(_0x3c20a1[_0xfe12('0x12')]){if(_0x3c20a1['error'][_0xfe12('0x13')]===0x1f4){logger[_0xfe12('0x12')]('MailQueue,\x20%s,\x20%s',_0x23f9a6,_0x3c20a1[_0xfe12('0x12')][_0xfe12('0x14')]);return _0x276c9b(_0x3c20a1['error'][_0xfe12('0x14')]);}logger[_0xfe12('0x12')](_0xfe12('0xe'),_0x23f9a6,_0x3c20a1[_0xfe12('0x12')][_0xfe12('0x14')]);return _0x25f4eb(_0x3c20a1[_0xfe12('0x12')]['message']);}else{logger[_0xfe12('0x15')]('MailQueue,\x20%s,\x20%s',_0x23f9a6,_0xfe12('0x10'));_0x25f4eb(_0x3c20a1['result']['message']);}})[_0xfe12('0x16')](function(_0x4ae563){logger[_0xfe12('0x12')](_0xfe12('0xe'),_0x23f9a6,_0x4ae563);_0x276c9b(_0x4ae563);});});}exports[_0xfe12('0x17')]=function(_0x5a570e){var _0x421567=this;return new Promise(function(_0x12853d,_0x1c988f){return db['MailQueue'][_0xfe12('0x18')]({'raw':_0x5a570e['options']?_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1a')]===undefined?!![]:![]:!![],'where':_0x5a570e[_0xfe12('0x19')]?_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1b')]||null:null,'attributes':_0x5a570e[_0xfe12('0x19')]?_0x5a570e['options'][_0xfe12('0x1c')]||null:null,'limit':_0x5a570e[_0xfe12('0x19')]?_0x5a570e[_0xfe12('0x19')]['limit']||null:null,'include':_0x5a570e[_0xfe12('0x19')]?_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1d')]?_['map'](_0x5a570e[_0xfe12('0x19')][_0xfe12('0x1d')],function(_0x1816a8){return{'model':db[_0x1816a8[_0xfe12('0x1e')]],'as':_0x1816a8['as'],'attributes':_0x1816a8[_0xfe12('0x1c')],'include':_0x1816a8[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x1816a8['include'],function(_0x22f8b8){return{'model':db[_0x22f8b8[_0xfe12('0x1e')]],'as':_0x22f8b8['as'],'attributes':_0x22f8b8[_0xfe12('0x1c')],'include':_0x22f8b8[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x22f8b8['include'],function(_0x427d36){return{'model':db[_0x427d36['model']],'as':_0x427d36['as'],'attributes':_0x427d36[_0xfe12('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfe12('0x20')](function(_0x5bb60e){logger['info']('GetMailQueue',_0x5a570e);logger[_0xfe12('0x21')](_0xfe12('0x17'),_0x5a570e,JSON[_0xfe12('0x11')](_0x5bb60e));_0x12853d(_0x5bb60e);})[_0xfe12('0x16')](function(_0x2f6877){logger[_0xfe12('0x12')](_0xfe12('0x17'),_0x2f6877[_0xfe12('0x14')],_0x5a570e);_0x1c988f(_0x421567['error'](0x1f4,_0x2f6877['message']));});});};exports[_0xfe12('0x22')]=function(_0xf37c00){var _0x1e4df1=this;return new Promise(function(_0xf12eec,_0x42fd64){return db[_0xfe12('0x23')][_0xfe12('0x24')]({'raw':_0xf37c00['options']?_0xf37c00['options']['raw']===undefined?!![]:![]:!![],'where':_0xf37c00['options']?_0xf37c00['options']['where']||null:null,'attributes':_0xf37c00[_0xfe12('0x19')]?_0xf37c00[_0xfe12('0x19')][_0xfe12('0x1c')]||null:null,'include':_0xf37c00[_0xfe12('0x19')]?_0xf37c00[_0xfe12('0x19')][_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0xf37c00[_0xfe12('0x19')]['include'],function(_0x3646bb){return{'model':db[_0x3646bb[_0xfe12('0x1e')]],'as':_0x3646bb['as'],'attributes':_0x3646bb[_0xfe12('0x1c')],'include':_0x3646bb[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x3646bb[_0xfe12('0x1d')],function(_0x4e3522){return{'model':db[_0x4e3522['model']],'as':_0x4e3522['as'],'attributes':_0x4e3522[_0xfe12('0x1c')],'include':_0x4e3522[_0xfe12('0x1d')]?_[_0xfe12('0x1f')](_0x4e3522['include'],function(_0x3dd75d){return{'model':db[_0x3dd75d[_0xfe12('0x1e')]],'as':_0x3dd75d['as'],'attributes':_0x3dd75d['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe12('0x20')](function(_0x431f1c){logger[_0xfe12('0x15')]('ShowMailQueue',_0xf37c00);logger[_0xfe12('0x21')](_0xfe12('0x22'),_0xf37c00,JSON[_0xfe12('0x11')](_0x431f1c));_0xf12eec(_0x431f1c);})[_0xfe12('0x16')](function(_0x229e76){logger[_0xfe12('0x12')](_0xfe12('0x22'),_0x229e76[_0xfe12('0x14')],_0xf37c00);_0x42fd64(_0x1e4df1[_0xfe12('0x12')](0x1f4,_0x229e76['message']));});});}; \ No newline at end of file +var _0x6e37=['MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','findAll','raw','options','where','limit','include','map','model','attributes','stringify','ShowMailQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x6e37,0xee));var _0x76e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e37[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x76e3('0x0'));var util=require(_0x76e3('0x1'));var moment=require(_0x76e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x76e3('0x3'));var fs=require('fs');var Redis=require(_0x76e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76e3('0x5'));var logger=require(_0x76e3('0x6'))(_0x76e3('0x7'));var config=require(_0x76e3('0x8'));var jayson=require(_0x76e3('0x9'));var client=jayson[_0x76e3('0xa')][_0x76e3('0xb')]({'port':0x232a});config[_0x76e3('0xc')]=_[_0x76e3('0xd')](config[_0x76e3('0xc')],{'host':_0x76e3('0xe'),'port':0x18eb});var socket=require(_0x76e3('0xf'))(new Redis(config['redis']));require(_0x76e3('0x10'))[_0x76e3('0x11')](socket);function respondWithRpcPromise(_0x25ee27,_0x2b19c1,_0x2c3a35){return new BPromise(function(_0x62712b,_0x3a53e9){return client[_0x76e3('0x12')](_0x25ee27,_0x2c3a35)[_0x76e3('0x13')](function(_0x497339){logger[_0x76e3('0x14')]('MailQueue,\x20%s,\x20%s',_0x2b19c1,_0x76e3('0x15'));logger[_0x76e3('0x16')](_0x76e3('0x17'),_0x2b19c1,_0x76e3('0x15'),JSON['stringify'](_0x497339));if(_0x497339[_0x76e3('0x18')]){if(_0x497339[_0x76e3('0x18')][_0x76e3('0x19')]===0x1f4){logger['error'](_0x76e3('0x1a'),_0x2b19c1,_0x497339[_0x76e3('0x18')][_0x76e3('0x1b')]);return _0x3a53e9(_0x497339[_0x76e3('0x18')][_0x76e3('0x1b')]);}logger[_0x76e3('0x18')]('MailQueue,\x20%s,\x20%s',_0x2b19c1,_0x497339[_0x76e3('0x18')][_0x76e3('0x1b')]);return _0x62712b(_0x497339[_0x76e3('0x18')]['message']);}else{logger[_0x76e3('0x14')](_0x76e3('0x1a'),_0x2b19c1,_0x76e3('0x15'));_0x62712b(_0x497339[_0x76e3('0x1c')][_0x76e3('0x1b')]);}})[_0x76e3('0x1d')](function(_0x3f32a){logger[_0x76e3('0x18')]('MailQueue,\x20%s,\x20%s',_0x2b19c1,_0x3f32a);_0x3a53e9(_0x3f32a);});});}exports[_0x76e3('0x1e')]=function(_0x2c7ac0){var _0x51d7d3=this;return new Promise(function(_0x5bbfd8,_0x34a09f){return db[_0x76e3('0x1f')][_0x76e3('0x20')]({'raw':_0x2c7ac0['options']?_0x2c7ac0['options'][_0x76e3('0x21')]===undefined?!![]:![]:!![],'where':_0x2c7ac0[_0x76e3('0x22')]?_0x2c7ac0['options'][_0x76e3('0x23')]||null:null,'attributes':_0x2c7ac0[_0x76e3('0x22')]?_0x2c7ac0[_0x76e3('0x22')]['attributes']||null:null,'limit':_0x2c7ac0[_0x76e3('0x22')]?_0x2c7ac0['options'][_0x76e3('0x24')]||null:null,'include':_0x2c7ac0[_0x76e3('0x22')]?_0x2c7ac0[_0x76e3('0x22')][_0x76e3('0x25')]?_[_0x76e3('0x26')](_0x2c7ac0[_0x76e3('0x22')][_0x76e3('0x25')],function(_0x22b89b){return{'model':db[_0x22b89b[_0x76e3('0x27')]],'as':_0x22b89b['as'],'attributes':_0x22b89b[_0x76e3('0x28')],'include':_0x22b89b[_0x76e3('0x25')]?_[_0x76e3('0x26')](_0x22b89b[_0x76e3('0x25')],function(_0x5f0af3){return{'model':db[_0x5f0af3[_0x76e3('0x27')]],'as':_0x5f0af3['as'],'attributes':_0x5f0af3[_0x76e3('0x28')],'include':_0x5f0af3['include']?_['map'](_0x5f0af3[_0x76e3('0x25')],function(_0xb34713){return{'model':db[_0xb34713['model']],'as':_0xb34713['as'],'attributes':_0xb34713['attributes']};}):[]};}):[]};}):[]:[]})[_0x76e3('0x13')](function(_0x188604){logger['info'](_0x76e3('0x1e'),_0x2c7ac0);logger[_0x76e3('0x16')](_0x76e3('0x1e'),_0x2c7ac0,JSON[_0x76e3('0x29')](_0x188604));_0x5bbfd8(_0x188604);})[_0x76e3('0x1d')](function(_0x109b2f){logger[_0x76e3('0x18')](_0x76e3('0x1e'),_0x109b2f[_0x76e3('0x1b')],_0x2c7ac0);_0x34a09f(_0x51d7d3[_0x76e3('0x18')](0x1f4,_0x109b2f[_0x76e3('0x1b')]));});});};exports[_0x76e3('0x2a')]=function(_0x5952f7){var _0x3108d9=this;return new Promise(function(_0x59665f,_0x1efe93){return db[_0x76e3('0x1f')][_0x76e3('0x2b')]({'raw':_0x5952f7[_0x76e3('0x22')]?_0x5952f7[_0x76e3('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x5952f7[_0x76e3('0x22')]?_0x5952f7['options']['where']||null:null,'attributes':_0x5952f7[_0x76e3('0x22')]?_0x5952f7[_0x76e3('0x22')]['attributes']||null:null,'include':_0x5952f7['options']?_0x5952f7[_0x76e3('0x22')]['include']?_[_0x76e3('0x26')](_0x5952f7[_0x76e3('0x22')][_0x76e3('0x25')],function(_0x4d8138){return{'model':db[_0x4d8138[_0x76e3('0x27')]],'as':_0x4d8138['as'],'attributes':_0x4d8138[_0x76e3('0x28')],'include':_0x4d8138[_0x76e3('0x25')]?_['map'](_0x4d8138[_0x76e3('0x25')],function(_0x46d55a){return{'model':db[_0x46d55a[_0x76e3('0x27')]],'as':_0x46d55a['as'],'attributes':_0x46d55a[_0x76e3('0x28')],'include':_0x46d55a[_0x76e3('0x25')]?_[_0x76e3('0x26')](_0x46d55a[_0x76e3('0x25')],function(_0x3cf9a6){return{'model':db[_0x3cf9a6[_0x76e3('0x27')]],'as':_0x3cf9a6['as'],'attributes':_0x3cf9a6[_0x76e3('0x28')]};}):[]};}):[]};}):[]:[]})[_0x76e3('0x13')](function(_0x32676a){logger[_0x76e3('0x14')](_0x76e3('0x2a'),_0x5952f7);logger[_0x76e3('0x16')]('ShowMailQueue',_0x5952f7,JSON[_0x76e3('0x29')](_0x32676a));_0x59665f(_0x32676a);})[_0x76e3('0x1d')](function(_0x3c3c35){logger[_0x76e3('0x18')](_0x76e3('0x2a'),_0x3c3c35[_0x76e3('0x1b')],_0x5952f7);_0x1efe93(_0x3108d9['error'](0x1f4,_0x3c3c35[_0x76e3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index bf8db79..178dd2d 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 _0x782e=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','emit'];(function(_0x4e9559,_0x324346){var _0x13d630=function(_0x35fd5a){while(--_0x35fd5a){_0x4e9559['push'](_0x4e9559['shift']());}};_0x13d630(++_0x324346);}(_0x782e,0x1d4));var _0xe782=function(_0x2a5f2f,_0x8204ca){_0x2a5f2f=_0x2a5f2f-0x0;var _0x205145=_0x782e[_0x2a5f2f];return _0x205145;};'use strict';var MailQueueEvents=require(_0xe782('0x0'));var events=[_0xe782('0x1'),_0xe782('0x2'),'update'];function createListener(_0x500c71,_0x38802e){return function(_0x13e20d){_0x38802e[_0xe782('0x3')](_0x500c71,_0x13e20d);};}function removeListener(_0x35540c,_0x357e69){return function(){MailQueueEvents[_0xe782('0x4')](_0x35540c,_0x357e69);};}exports[_0xe782('0x5')]=function(_0x2183d8){for(var _0x2f9f5d=0x0,_0x286374=events[_0xe782('0x6')];_0x2f9f5d<_0x286374;_0x2f9f5d++){var _0x831385=events[_0x2f9f5d];var _0x383667=createListener(_0xe782('0x7')+_0x831385,_0x2183d8);MailQueueEvents['on'](_0x831385,_0x383667);}}; \ No newline at end of file +var _0x0c71=['update','removeListener','register','length','mailQueue:','save'];(function(_0x5e7d10,_0x4308e2){var _0x59dbbf=function(_0x3a24f5){while(--_0x3a24f5){_0x5e7d10['push'](_0x5e7d10['shift']());}};_0x59dbbf(++_0x4308e2);}(_0x0c71,0xfb));var _0x10c7=function(_0x87d86f,_0x3f753e){_0x87d86f=_0x87d86f-0x0;var _0x51ea58=_0x0c71[_0x87d86f];return _0x51ea58;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x10c7('0x0'),'remove',_0x10c7('0x1')];function createListener(_0xac267a,_0x1dfbb9){return function(_0x4858c1){_0x1dfbb9['emit'](_0xac267a,_0x4858c1);};}function removeListener(_0xa72176,_0x57f92f){return function(){MailQueueEvents[_0x10c7('0x2')](_0xa72176,_0x57f92f);};}exports[_0x10c7('0x3')]=function(_0x21da60){for(var _0x4480c2=0x0,_0x2dbe32=events[_0x10c7('0x4')];_0x4480c2<_0x2dbe32;_0x4480c2++){var _0x4d8fc8=events[_0x4480c2];var _0x3cbcd7=createListener(_0x10c7('0x5')+_0x4d8fc8,_0x21da60);MailQueueEvents['on'](_0x4d8fc8,_0x3cbcd7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e73d31d..44e705d 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 _0x6f66=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','multer','util','path'];(function(_0x1199ae,_0x4d3766){var _0x211782=function(_0x1c7877){while(--_0x1c7877){_0x1199ae['push'](_0x1199ae['shift']());}};_0x211782(++_0x4d3766);}(_0x6f66,0x10b));var _0x66f6=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x6f66[_0x10791d];return _0x1b4f9c;};'use strict';var multer=require(_0x66f6('0x0'));var util=require(_0x66f6('0x1'));var path=require(_0x66f6('0x2'));var timeout=require('connect-timeout');var express=require(_0x66f6('0x3'));var router=express[_0x66f6('0x4')]();var fs_extra=require(_0x66f6('0x5'));var auth=require(_0x66f6('0x6'));var interaction=require(_0x66f6('0x7'));var config=require(_0x66f6('0x8'));var controller=require('./mailQueueReport.controller');router[_0x66f6('0x9')]('/',auth['isAuthenticated'](),controller[_0x66f6('0xa')]);router[_0x66f6('0x9')](_0x66f6('0xb'),auth[_0x66f6('0xc')](),controller[_0x66f6('0xd')]);router[_0x66f6('0x9')](_0x66f6('0xe'),auth[_0x66f6('0xc')](),controller[_0x66f6('0xf')]);router['post']('/',auth[_0x66f6('0xc')](),controller['create']);router[_0x66f6('0x10')](_0x66f6('0xe'),auth['isAuthenticated'](),controller[_0x66f6('0x11')]);router['delete']('/:id',auth[_0x66f6('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcada=['./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcada,0x1e6));var _0xacad=function(_0x844747,_0xa7332a){_0x844747=_0x844747-0x0;var _0x56ffe6=_0xcada[_0x844747];return _0x56ffe6;};'use strict';var multer=require(_0xacad('0x0'));var util=require(_0xacad('0x1'));var path=require(_0xacad('0x2'));var timeout=require(_0xacad('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xacad('0x4'));var auth=require(_0xacad('0x5'));var interaction=require(_0xacad('0x6'));var config=require(_0xacad('0x7'));var controller=require(_0xacad('0x8'));router[_0xacad('0x9')]('/',auth['isAuthenticated'](),controller[_0xacad('0xa')]);router[_0xacad('0x9')](_0xacad('0xb'),auth[_0xacad('0xc')](),controller[_0xacad('0xd')]);router['get'](_0xacad('0xe'),auth['isAuthenticated'](),controller[_0xacad('0xf')]);router[_0xacad('0x10')]('/',auth[_0xacad('0xc')](),controller[_0xacad('0x11')]);router['put'](_0xacad('0xe'),auth[_0xacad('0xc')](),controller['update']);router[_0xacad('0x12')](_0xacad('0xe'),auth[_0xacad('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 8ef4d34..b43989c 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 _0x84c7=['STRING','DATE','sequelize','exports'];(function(_0x373723,_0x1fe596){var _0x526eba=function(_0x1ab293){while(--_0x1ab293){_0x373723['push'](_0x373723['shift']());}};_0x526eba(++_0x1fe596);}(_0x84c7,0x10e));var _0x784c=function(_0x5be130,_0x8e014a){_0x5be130=_0x5be130-0x0;var _0x32e401=_0x84c7[_0x5be130];return _0x32e401;};'use strict';var moment=require('moment');var Sequelize=require(_0x784c('0x0'));module[_0x784c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x784c('0x2')]},'joinAt':{'type':Sequelize[_0x784c('0x3')]},'leaveAt':{'type':Sequelize[_0x784c('0x3')]},'acceptAt':{'type':Sequelize[_0x784c('0x3')]},'exitAt':{'type':Sequelize[_0x784c('0x3')]},'reason':{'type':Sequelize[_0x784c('0x2')]}}; \ No newline at end of file +var _0x2eb2=['exports','STRING','DATE','sequelize'];(function(_0x2c7ef7,_0x327a9d){var _0x226600=function(_0x19a827){while(--_0x19a827){_0x2c7ef7['push'](_0x2c7ef7['shift']());}};_0x226600(++_0x327a9d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x2eb2[_0x2160a9];return _0xa88cf7;};'use strict';var moment=require('moment');var Sequelize=require(_0x22eb('0x0'));module[_0x22eb('0x1')]={'uniqueid':{'type':Sequelize[_0x22eb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x22eb('0x2')]},'joinAt':{'type':Sequelize[_0x22eb('0x3')]},'leaveAt':{'type':Sequelize[_0x22eb('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x22eb('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 30e182e..0cd7494 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 _0xb44a=['options','rows','catch','show','params','includeAll','merge','create','body','find','destroy','describe','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','MailQueueReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL'];(function(_0x1bb455,_0x1b8d69){var _0x1b2515=function(_0xa017d8){while(--_0xa017d8){_0x1bb455['push'](_0x1bb455['shift']());}};_0x1b2515(++_0x1b8d69);}(_0xb44a,0x1c2));var _0xab44=function(_0x44e50a,_0x1cc4a2){_0x44e50a=_0x44e50a-0x0;var _0x1b5994=_0xb44a[_0x44e50a];return _0x1b5994;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){_0x11f0b[_0xab44('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2439f3,_0x5a7269){return function(_0x2a1bbc){if(!_0x2a1bbc){_0x2439f3['sendStatus'](0x194);}return _0x2a1bbc;};}function handleError(_0x531583,_0x8e60fa){_0x8e60fa=_0x8e60fa||0x1f4;return function(_0x25287b){logger[_0xab44('0x24')](_0x25287b[_0xab44('0x25')]);if(_0x25287b[_0xab44('0x26')]){delete _0x25287b['name'];}_0x531583[_0xab44('0x18')](_0x8e60fa)[_0xab44('0x27')](_0x25287b);};}exports['index']=function(_0x887b0d,_0xebb7d1){var _0x21131e={},_0x1cd486={},_0x4550c8={'count':0x0,'rows':[]};var _0xdc50a1=_['map'](db[_0xab44('0x28')][_0xab44('0x29')],function(_0x36f9b6){return{'name':_0x36f9b6['fieldName'],'type':_0x36f9b6['type'][_0xab44('0x2a')]};});_0x1cd486['model']=_['map'](_0xdc50a1,_0xab44('0x26'));_0x1cd486[_0xab44('0x2b')]=_[_0xab44('0x2c')](_0x887b0d[_0xab44('0x2b')]);_0x1cd486[_0xab44('0x2d')]=_[_0xab44('0x2e')](_0x1cd486[_0xab44('0x2f')],_0x1cd486[_0xab44('0x2b')]);_0x21131e[_0xab44('0x30')]=_[_0xab44('0x2e')](_0x1cd486[_0xab44('0x2f')],qs[_0xab44('0x31')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x31')]));_0x21131e['attributes']=_0x21131e['attributes'][_0xab44('0x32')]?_0x21131e[_0xab44('0x30')]:_0x1cd486['model'];if(!_0x887b0d[_0xab44('0x2b')][_0xab44('0x33')](_0xab44('0x34'))){_0x21131e[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x1c')]);_0x21131e[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x1a')]);}_0x21131e[_0xab44('0x35')]=qs[_0xab44('0x36')](_0x887b0d[_0xab44('0x2b')][_0xab44('0x36')]);_0x21131e[_0xab44('0x37')]=qs[_0xab44('0x2d')](_[_0xab44('0x38')](_0x887b0d['query'],_0x1cd486[_0xab44('0x2d')]),_0xdc50a1);if(_0x887b0d[_0xab44('0x2b')][_0xab44('0x39')]){_0x21131e[_0xab44('0x37')]=_['merge'](_0x21131e[_0xab44('0x37')],{'$or':_[_0xab44('0x3a')](_0xdc50a1,function(_0xcd077a){if(_0xcd077a[_0xab44('0x3b')]!==_0xab44('0x3c')){var _0x4f5cf3={};_0x4f5cf3[_0xcd077a[_0xab44('0x26')]]={'$like':'%'+_0x887b0d[_0xab44('0x2b')][_0xab44('0x39')]+'%'};return _0x4f5cf3;}})});}_0x21131e=_['merge']({},_0x21131e,_0x887b0d[_0xab44('0x3d')]);var _0x1e26de={'where':_0x21131e[_0xab44('0x37')]};return db[_0xab44('0x28')][_0xab44('0x1d')](_0x1e26de)['then'](function(_0x1de52d){_0x4550c8['count']=_0x1de52d;if(_0x887b0d[_0xab44('0x2b')]['includeAll']){_0x21131e['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x21131e);})['then'](function(_0x120585){_0x4550c8[_0xab44('0x3e')]=_0x120585;return _0x4550c8;})[_0xab44('0x23')](respondWithFilteredResult(_0xebb7d1,_0x21131e))[_0xab44('0x3f')](handleError(_0xebb7d1,null));};exports[_0xab44('0x40')]=function(_0xf3f37a,_0x19d20d){var _0x33641e={'raw':!![],'where':{'id':_0xf3f37a[_0xab44('0x41')]['id']}},_0x4429e6={};_0x4429e6['model']=_[_0xab44('0x2c')](db[_0xab44('0x28')][_0xab44('0x29')]);_0x4429e6[_0xab44('0x2b')]=_['keys'](_0xf3f37a[_0xab44('0x2b')]);_0x4429e6[_0xab44('0x2d')]=_[_0xab44('0x2e')](_0x4429e6[_0xab44('0x2f')],_0x4429e6[_0xab44('0x2b')]);_0x33641e[_0xab44('0x30')]=_['intersection'](_0x4429e6['model'],qs[_0xab44('0x31')](_0xf3f37a[_0xab44('0x2b')][_0xab44('0x31')]));_0x33641e[_0xab44('0x30')]=_0x33641e[_0xab44('0x30')]['length']?_0x33641e[_0xab44('0x30')]:_0x4429e6[_0xab44('0x2f')];if(_0xf3f37a[_0xab44('0x2b')][_0xab44('0x42')]){_0x33641e['include']=[{'all':!![]}];}_0x33641e=_[_0xab44('0x43')]({},_0x33641e,_0xf3f37a[_0xab44('0x3d')]);return db[_0xab44('0x28')]['find'](_0x33641e)[_0xab44('0x23')](handleEntityNotFound(_0x19d20d,null))[_0xab44('0x23')](respondWithResult(_0x19d20d,null))[_0xab44('0x3f')](handleError(_0x19d20d,null));};exports[_0xab44('0x44')]=function(_0x4eeb65,_0x13892d){return db['MailQueueReport'][_0xab44('0x44')](_0x4eeb65[_0xab44('0x45')],{})[_0xab44('0x23')](respondWithResult(_0x13892d,0xc9))[_0xab44('0x3f')](handleError(_0x13892d,null));};exports['update']=function(_0x328891,_0x5497a3){if(_0x328891[_0xab44('0x45')]['id']){delete _0x328891[_0xab44('0x45')]['id'];}return db[_0xab44('0x28')][_0xab44('0x46')]({'where':{'id':_0x328891[_0xab44('0x41')]['id']}})['then'](handleEntityNotFound(_0x5497a3,null))[_0xab44('0x23')](saveUpdates(_0x328891['body'],null))[_0xab44('0x23')](respondWithResult(_0x5497a3,null))[_0xab44('0x3f')](handleError(_0x5497a3,null));};exports[_0xab44('0x47')]=function(_0x50b705,_0x4463f1){return db[_0xab44('0x28')][_0xab44('0x46')]({'where':{'id':_0x50b705[_0xab44('0x41')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x4463f1,null))['then'](removeEntity(_0x4463f1,null))['catch'](handleError(_0x4463f1,null));};exports[_0xab44('0x48')]=function(_0x1b18fb,_0xaa00a1){return db['MailQueueReport'][_0xab44('0x48')]()[_0xab44('0x23')](respondWithResult(_0xaa00a1,null))[_0xab44('0x3f')](handleError(_0xaa00a1,null));}; \ No newline at end of file +var _0x3d04=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0xfe0ab7,_0x554514){var _0x431c21=function(_0x334173){while(--_0x334173){_0xfe0ab7['push'](_0xfe0ab7['shift']());}};_0x431c21(++_0x554514);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c111,_0x44497b){return function(_0x5dd310){if(!_0x5dd310){_0x29c111[_0x43d0('0x16')](0x194);}return _0x5dd310;};}function handleError(_0x238c64,_0x5ac4c0){_0x5ac4c0=_0x5ac4c0||0x1f4;return function(_0x12df30){logger[_0x43d0('0x24')](_0x12df30[_0x43d0('0x25')]);if(_0x12df30['name']){delete _0x12df30[_0x43d0('0x26')];}_0x238c64[_0x43d0('0x17')](_0x5ac4c0)[_0x43d0('0x27')](_0x12df30);};}exports[_0x43d0('0x28')]=function(_0x37d78f,_0x440ecb){var _0x31a057={},_0x4a3cd4={},_0x2b0784={'count':0x0,'rows':[]};var _0x2f5bc5=_[_0x43d0('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x52c37b){return{'name':_0x52c37b[_0x43d0('0x2a')],'type':_0x52c37b[_0x43d0('0x2b')][_0x43d0('0x2c')]};});_0x4a3cd4[_0x43d0('0x2d')]=_[_0x43d0('0x29')](_0x2f5bc5,_0x43d0('0x26'));_0x4a3cd4['query']=_[_0x43d0('0x2e')](_0x37d78f[_0x43d0('0x2f')]);_0x4a3cd4[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],_0x4a3cd4[_0x43d0('0x2f')]);_0x31a057[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x37d78f[_0x43d0('0x2f')]['fields']));_0x31a057[_0x43d0('0x32')]=_0x31a057[_0x43d0('0x32')][_0x43d0('0x34')]?_0x31a057[_0x43d0('0x32')]:_0x4a3cd4['model'];if(!_0x37d78f[_0x43d0('0x2f')]['hasOwnProperty'](_0x43d0('0x35'))){_0x31a057[_0x43d0('0x19')]=qs['limit'](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x19')]);_0x31a057[_0x43d0('0x1c')]=qs[_0x43d0('0x1c')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x1c')]);}_0x31a057[_0x43d0('0x36')]=qs[_0x43d0('0x37')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x37')]);_0x31a057[_0x43d0('0x38')]=qs['filters'](_[_0x43d0('0x39')](_0x37d78f[_0x43d0('0x2f')],_0x4a3cd4[_0x43d0('0x30')]),_0x2f5bc5);if(_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x3a')]){_0x31a057[_0x43d0('0x38')]=_[_0x43d0('0x3b')](_0x31a057[_0x43d0('0x38')],{'$or':_[_0x43d0('0x29')](_0x2f5bc5,function(_0x43bcc5){if(_0x43bcc5[_0x43d0('0x2b')]!==_0x43d0('0x3c')){var _0x19843c={};_0x19843c[_0x43bcc5[_0x43d0('0x26')]]={'$like':'%'+_0x37d78f['query'][_0x43d0('0x3a')]+'%'};return _0x19843c;}})});}_0x31a057=_[_0x43d0('0x3b')]({},_0x31a057,_0x37d78f[_0x43d0('0x3d')]);var _0xc3f9c7={'where':_0x31a057[_0x43d0('0x38')]};return db[_0x43d0('0x3e')][_0x43d0('0x1b')](_0xc3f9c7)[_0x43d0('0x22')](function(_0x4ae965){_0x2b0784['count']=_0x4ae965;if(_0x37d78f[_0x43d0('0x2f')]['includeAll']){_0x31a057['include']=[{'all':!![]}];}return db[_0x43d0('0x3e')]['findAll'](_0x31a057);})[_0x43d0('0x22')](function(_0x5027d0){_0x2b0784[_0x43d0('0x3f')]=_0x5027d0;return _0x2b0784;})['then'](respondWithFilteredResult(_0x440ecb,_0x31a057))[_0x43d0('0x40')](handleError(_0x440ecb,null));};exports[_0x43d0('0x41')]=function(_0x468b32,_0x4e817e){var _0x3eb2e9={'raw':!![],'where':{'id':_0x468b32[_0x43d0('0x42')]['id']}},_0x520406={};_0x520406['model']=_['keys'](db[_0x43d0('0x3e')][_0x43d0('0x43')]);_0x520406['query']=_[_0x43d0('0x2e')](_0x468b32[_0x43d0('0x2f')]);_0x520406[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],_0x520406['query']);_0x3eb2e9[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x468b32['query'][_0x43d0('0x33')]));_0x3eb2e9[_0x43d0('0x32')]=_0x3eb2e9[_0x43d0('0x32')][_0x43d0('0x34')]?_0x3eb2e9[_0x43d0('0x32')]:_0x520406['model'];if(_0x468b32[_0x43d0('0x2f')][_0x43d0('0x44')]){_0x3eb2e9['include']=[{'all':!![]}];}_0x3eb2e9=_[_0x43d0('0x3b')]({},_0x3eb2e9,_0x468b32[_0x43d0('0x3d')]);return db[_0x43d0('0x3e')]['find'](_0x3eb2e9)[_0x43d0('0x22')](handleEntityNotFound(_0x4e817e,null))['then'](respondWithResult(_0x4e817e,null))[_0x43d0('0x40')](handleError(_0x4e817e,null));};exports['create']=function(_0x1f55e9,_0x269d99){return db[_0x43d0('0x3e')][_0x43d0('0x45')](_0x1f55e9[_0x43d0('0x46')],{})['then'](respondWithResult(_0x269d99,0xc9))[_0x43d0('0x40')](handleError(_0x269d99,null));};exports['update']=function(_0x5a6364,_0x3e7392){if(_0x5a6364[_0x43d0('0x46')]['id']){delete _0x5a6364[_0x43d0('0x46')]['id'];}return db[_0x43d0('0x3e')][_0x43d0('0x47')]({'where':{'id':_0x5a6364[_0x43d0('0x42')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3e7392,null))[_0x43d0('0x22')](saveUpdates(_0x5a6364[_0x43d0('0x46')],null))[_0x43d0('0x22')](respondWithResult(_0x3e7392,null))[_0x43d0('0x40')](handleError(_0x3e7392,null));};exports['destroy']=function(_0x338203,_0xd78af1){return db[_0x43d0('0x3e')]['find']({'where':{'id':_0x338203[_0x43d0('0x42')]['id']}})['then'](handleEntityNotFound(_0xd78af1,null))['then'](removeEntity(_0xd78af1,null))[_0x43d0('0x40')](handleError(_0xd78af1,null));};exports[_0x43d0('0x48')]=function(_0x234571,_0x127815){return db[_0x43d0('0x3e')]['describe']()['then'](respondWithResult(_0x127815,null))[_0x43d0('0x40')](handleError(_0x127815,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 12d6519..3dea7bf 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 _0x08c9=['api','request-promise','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger'];(function(_0x99ba67,_0x10eae9){var _0x5c4f7d=function(_0x2962f6){while(--_0x2962f6){_0x99ba67['push'](_0x99ba67['shift']());}};_0x5c4f7d(++_0x10eae9);}(_0x08c9,0x15e));var _0x908c=function(_0x5d23a9,_0x30373b){_0x5d23a9=_0x5d23a9-0x0;var _0x8d150a=_0x08c9[_0x5d23a9];return _0x8d150a;};'use strict';var _=require('lodash');var util=require(_0x908c('0x0'));var logger=require(_0x908c('0x1'))(_0x908c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x908c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x908c('0x4'));var config=require('../../config/environment');var attributes=require(_0x908c('0x5'));module[_0x908c('0x6')]=function(_0x854b50,_0x318f62){return _0x854b50[_0x908c('0x7')](_0x908c('0x8'),attributes,{'tableName':_0x908c('0x9'),'paranoid':![],'indexes':[{'name':_0x908c('0xa'),'fields':[_0x908c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc269=['../../config/environment','./mailQueueReport.attributes','define','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x1e2da5,_0x40bce6){var _0x1eb655=function(_0x3dd2eb){while(--_0x3dd2eb){_0x1e2da5['push'](_0x1e2da5['shift']());}};_0x1eb655(++_0x40bce6);}(_0xc269,0x194));var _0x9c26=function(_0x461c94,_0x483844){_0x461c94=_0x461c94-0x0;var _0x47f99e=_0xc269[_0x461c94];return _0x47f99e;};'use strict';var _=require(_0x9c26('0x0'));var util=require(_0x9c26('0x1'));var logger=require(_0x9c26('0x2'))('api');var moment=require(_0x9c26('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c26('0x4'));var fs=require('fs');var path=require(_0x9c26('0x5'));var rimraf=require('rimraf');var config=require(_0x9c26('0x6'));var attributes=require(_0x9c26('0x7'));module['exports']=function(_0x32b398,_0x727102){return _0x32b398[_0x9c26('0x8')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x9c26('0x9'),'fields':[_0x9c26('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 6fc77d6..c3bb339 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(_0x461dca,_0x30367e){var _0x5ebb6a=function(_0x7cc63e){while(--_0x7cc63e){_0x461dca['push'](_0x461dca['shift']());}};_0x5ebb6a(++_0x30367e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2e0976,_0x18ccc5){var _0x5bf61c=function(_0x4be6cc){while(--_0x4be6cc){_0x2e0976['push'](_0x2e0976['shift']());}};_0x5bf61c(++_0x18ccc5);}(_0xadb5,0xad));var _0x5adb=function(_0x2022ca,_0x5354c8){_0x2022ca=_0x2022ca-0x0;var _0x1441a8=_0xadb5[_0x2022ca];return _0x1441a8;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index fc9073a..cc8644a 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(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4036d4,_0x5994ab){var _0x3bc2a4=function(_0x4303f7){while(--_0x4303f7){_0x4036d4['push'](_0x4036d4['shift']());}};_0x3bc2a4(++_0x5994ab);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b16fbc2..b68d61d 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 _0x5c00=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x103a71,_0x1aa85d){var _0x4ec77=function(_0x32a0df){while(--_0x32a0df){_0x103a71['push'](_0x103a71['shift']());}};_0x4ec77(++_0x1aa85d);}(_0x5c00,0x17e));var _0x05c0=function(_0x423797,_0x3d393b){_0x423797=_0x423797-0x0;var _0x57ec0c=_0x5c00[_0x423797];return _0x57ec0c;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'description':{'type':Sequelize[_0x05c0('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x05c0('0x2')]},'port':{'type':Sequelize[_0x05c0('0x4')]},'tls':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file +var _0xc788=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xc788,0xc4));var _0x8c78=function(_0x19616a,_0x545c46){_0x19616a=_0x19616a-0x0;var _0x57bfb4=_0xc788[_0x19616a];return _0x57bfb4;};'use strict';var Sequelize=require(_0x8c78('0x0'));module[_0x8c78('0x1')]={'description':{'type':Sequelize[_0x8c78('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x8c78('0x2')]},'password':{'type':Sequelize[_0x8c78('0x2')]},'port':{'type':Sequelize[_0x8c78('0x3')]},'tls':{'type':Sequelize[_0x8c78('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8c78('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8c78('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8c78('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8c78('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5b4609c..3da2264 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 _0x1242=['bluebird','request-promise','path','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','moment'];(function(_0x2ebc52,_0x496030){var _0x5aefde=function(_0x42b319){while(--_0x42b319){_0x2ebc52['push'](_0x2ebc52['shift']());}};_0x5aefde(++_0x496030);}(_0x1242,0x1e1));var _0x2124=function(_0x3ca501,_0x5cb5ab){_0x3ca501=_0x3ca501-0x0;var _0x313356=_0x1242[_0x3ca501];return _0x313356;};'use strict';var _=require(_0x2124('0x0'));var util=require('util');var logger=require(_0x2124('0x1'))('api');var moment=require(_0x2124('0x2'));var BPromise=require(_0x2124('0x3'));var rp=require(_0x2124('0x4'));var fs=require('fs');var path=require(_0x2124('0x5'));var rimraf=require('rimraf');var config=require(_0x2124('0x6'));var attributes=require('./mailServerIn.attributes');module[_0x2124('0x7')]=function(_0x5e9d75,_0x2bb036){return _0x5e9d75[_0x2124('0x8')](_0x2124('0x9'),attributes,{'tableName':_0x2124('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d6f=['rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6d6f,0x1aa));var _0xf6d6=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0x6d6f[_0x199c03];return _0x11a7d4;};'use strict';var _=require(_0xf6d6('0x0'));var util=require(_0xf6d6('0x1'));var logger=require(_0xf6d6('0x2'))(_0xf6d6('0x3'));var moment=require(_0xf6d6('0x4'));var BPromise=require(_0xf6d6('0x5'));var rp=require(_0xf6d6('0x6'));var fs=require('fs');var path=require(_0xf6d6('0x7'));var rimraf=require(_0xf6d6('0x8'));var config=require(_0xf6d6('0x9'));var attributes=require(_0xf6d6('0xa'));module[_0xf6d6('0xb')]=function(_0x46b21e,_0x30432d){return _0x46b21e['define'](_0xf6d6('0xc'),attributes,{'tableName':_0xf6d6('0xd'),'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 1376e53..c5e7b41 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 _0x345e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','bluebird'];(function(_0x1a957b,_0x3a5dca){var _0x2b79f4=function(_0x113582){while(--_0x113582){_0x1a957b['push'](_0x1a957b['shift']());}};_0x2b79f4(++_0x3a5dca);}(_0x345e,0x168));var _0xe345=function(_0xc35e79,_0x37df8f){_0xc35e79=_0xc35e79-0x0;var _0x2f2750=_0x345e[_0xc35e79];return _0x2f2750;};'use strict';var _=require(_0xe345('0x0'));var util=require(_0xe345('0x1'));var moment=require('moment');var BPromise=require(_0xe345('0x2'));var rs=require(_0xe345('0x3'));var fs=require('fs');var Redis=require(_0xe345('0x4'));var db=require(_0xe345('0x5'))['db'];var utils=require(_0xe345('0x6'));var logger=require(_0xe345('0x7'))(_0xe345('0x8'));var config=require(_0xe345('0x9'));var jayson=require(_0xe345('0xa'));var client=jayson['client'][_0xe345('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38cc87,_0x27fc55,_0x246b2f){return new BPromise(function(_0x24f14f,_0x18f9a3){return client['request'](_0x38cc87,_0x246b2f)['then'](function(_0x41bd55){logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));logger[_0xe345('0xf')](_0xe345('0x10'),_0x27fc55,_0xe345('0xe'),JSON[_0xe345('0x11')](_0x41bd55));if(_0x41bd55[_0xe345('0x12')]){if(_0x41bd55[_0xe345('0x12')]['code']===0x1f4){logger[_0xe345('0x12')](_0xe345('0xd'),_0x27fc55,_0x41bd55['error']['message']);return _0x18f9a3(_0x41bd55[_0xe345('0x12')]['message']);}logger[_0xe345('0x12')]('MailServerIn,\x20%s,\x20%s',_0x27fc55,_0x41bd55['error'][_0xe345('0x13')]);return _0x24f14f(_0x41bd55[_0xe345('0x12')][_0xe345('0x13')]);}else{logger[_0xe345('0xc')](_0xe345('0xd'),_0x27fc55,_0xe345('0xe'));_0x24f14f(_0x41bd55[_0xe345('0x14')][_0xe345('0x13')]);}})[_0xe345('0x15')](function(_0x1f983c){logger['error']('MailServerIn,\x20%s,\x20%s',_0x27fc55,_0x1f983c);_0x18f9a3(_0x1f983c);});});}exports[_0xe345('0x16')]=function(_0x21f20a){var _0x2000c5=this;return new Promise(function(_0x11332c,_0x412bfa){return db['MailServerIn'][_0xe345('0x17')]({'raw':_0x21f20a[_0xe345('0x18')]?_0x21f20a['options'][_0xe345('0x19')]===undefined?!![]:![]:!![],'where':_0x21f20a[_0xe345('0x18')]?_0x21f20a[_0xe345('0x18')][_0xe345('0x1a')]||null:null,'attributes':_0x21f20a[_0xe345('0x18')]?_0x21f20a[_0xe345('0x18')]['attributes']||null:null,'limit':_0x21f20a[_0xe345('0x18')]?_0x21f20a['options'][_0xe345('0x1b')]||null:null,'include':_0x21f20a['options']?_0x21f20a[_0xe345('0x18')][_0xe345('0x1c')]?_[_0xe345('0x1d')](_0x21f20a[_0xe345('0x18')]['include'],function(_0x5f2641){return{'model':db[_0x5f2641[_0xe345('0x1e')]],'as':_0x5f2641['as'],'attributes':_0x5f2641[_0xe345('0x1f')],'include':_0x5f2641['include']?_['map'](_0x5f2641['include'],function(_0x3dac93){return{'model':db[_0x3dac93[_0xe345('0x1e')]],'as':_0x3dac93['as'],'attributes':_0x3dac93[_0xe345('0x1f')],'include':_0x3dac93['include']?_['map'](_0x3dac93[_0xe345('0x1c')],function(_0x4e017b){return{'model':db[_0x4e017b[_0xe345('0x1e')]],'as':_0x4e017b['as'],'attributes':_0x4e017b[_0xe345('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe345('0x20')](function(_0x517ffa){logger[_0xe345('0xc')]('GetMailServerIn',_0x21f20a);logger[_0xe345('0xf')](_0xe345('0x16'),_0x21f20a,JSON[_0xe345('0x11')](_0x517ffa));_0x11332c(_0x517ffa);})['catch'](function(_0x536c3a){logger[_0xe345('0x12')](_0xe345('0x16'),_0x536c3a[_0xe345('0x13')],_0x21f20a);_0x412bfa(_0x2000c5[_0xe345('0x12')](0x1f4,_0x536c3a[_0xe345('0x13')]));});});}; \ No newline at end of file +var _0x7dfc=['../../config/environment','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','findAll','raw','options','attributes','limit','map','model','include','then','GetMailServerIn','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf3f65d,_0x50a11f){var _0x4107f8=function(_0x18f3da){while(--_0x18f3da){_0xf3f65d['push'](_0xf3f65d['shift']());}};_0x4107f8(++_0x50a11f);}(_0x7dfc,0x19b));var _0xc7df=function(_0x4e76ae,_0x714614){_0x4e76ae=_0x4e76ae-0x0;var _0x3ffb1b=_0x7dfc[_0x4e76ae];return _0x3ffb1b;};'use strict';var _=require(_0xc7df('0x0'));var util=require(_0xc7df('0x1'));var moment=require('moment');var BPromise=require(_0xc7df('0x2'));var rs=require(_0xc7df('0x3'));var fs=require('fs');var Redis=require(_0xc7df('0x4'));var db=require(_0xc7df('0x5'))['db'];var utils=require(_0xc7df('0x6'));var logger=require(_0xc7df('0x7'))(_0xc7df('0x8'));var config=require(_0xc7df('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc7df('0xa')][_0xc7df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x288e4e,_0x2d142c,_0x2fbf63){return new BPromise(function(_0x491233,_0x69cedb){return client[_0xc7df('0xc')](_0x288e4e,_0x2fbf63)['then'](function(_0x4c81f9){logger[_0xc7df('0xd')]('MailServerIn,\x20%s,\x20%s',_0x2d142c,_0xc7df('0xe'));logger[_0xc7df('0xf')](_0xc7df('0x10'),_0x2d142c,_0xc7df('0xe'),JSON['stringify'](_0x4c81f9));if(_0x4c81f9['error']){if(_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x12')]===0x1f4){logger[_0xc7df('0x11')](_0xc7df('0x13'),_0x2d142c,_0x4c81f9['error'][_0xc7df('0x14')]);return _0x69cedb(_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x14')]);}logger[_0xc7df('0x11')]('MailServerIn,\x20%s,\x20%s',_0x2d142c,_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x14')]);return _0x491233(_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x14')]);}else{logger[_0xc7df('0xd')](_0xc7df('0x13'),_0x2d142c,'request\x20sent');_0x491233(_0x4c81f9[_0xc7df('0x15')][_0xc7df('0x14')]);}})[_0xc7df('0x16')](function(_0x3c580b){logger['error'](_0xc7df('0x13'),_0x2d142c,_0x3c580b);_0x69cedb(_0x3c580b);});});}exports['GetMailServerIn']=function(_0x548b20){var _0x43a869=this;return new Promise(function(_0x242fe3,_0x2d6932){return db[_0xc7df('0x17')][_0xc7df('0x18')]({'raw':_0x548b20['options']?_0x548b20['options'][_0xc7df('0x19')]===undefined?!![]:![]:!![],'where':_0x548b20['options']?_0x548b20['options']['where']||null:null,'attributes':_0x548b20[_0xc7df('0x1a')]?_0x548b20['options'][_0xc7df('0x1b')]||null:null,'limit':_0x548b20['options']?_0x548b20['options'][_0xc7df('0x1c')]||null:null,'include':_0x548b20['options']?_0x548b20[_0xc7df('0x1a')]['include']?_[_0xc7df('0x1d')](_0x548b20['options']['include'],function(_0x5840bf){return{'model':db[_0x5840bf[_0xc7df('0x1e')]],'as':_0x5840bf['as'],'attributes':_0x5840bf[_0xc7df('0x1b')],'include':_0x5840bf[_0xc7df('0x1f')]?_[_0xc7df('0x1d')](_0x5840bf['include'],function(_0x131bde){return{'model':db[_0x131bde[_0xc7df('0x1e')]],'as':_0x131bde['as'],'attributes':_0x131bde[_0xc7df('0x1b')],'include':_0x131bde[_0xc7df('0x1f')]?_['map'](_0x131bde[_0xc7df('0x1f')],function(_0x1c33e5){return{'model':db[_0x1c33e5[_0xc7df('0x1e')]],'as':_0x1c33e5['as'],'attributes':_0x1c33e5['attributes']};}):[]};}):[]};}):[]:[]})[_0xc7df('0x20')](function(_0x141282){logger[_0xc7df('0xd')](_0xc7df('0x21'),_0x548b20);logger[_0xc7df('0xf')](_0xc7df('0x21'),_0x548b20,JSON[_0xc7df('0x22')](_0x141282));_0x242fe3(_0x141282);})[_0xc7df('0x16')](function(_0x5c418c){logger['error'](_0xc7df('0x21'),_0x5c418c[_0xc7df('0x14')],_0x548b20);_0x2d6932(_0x43a869[_0xc7df('0x11')](0x1f4,_0x5c418c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index abf036c..b15d930 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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x36d942,_0xe09138){_0x36d942=_0x36d942-0x0;var _0x2ff4fe=_0x7a54[_0x36d942];return _0x2ff4fe;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +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(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7a54,0x106));var _0x47a5=function(_0x2ce0e3,_0x655e45){_0x2ce0e3=_0x2ce0e3-0x0;var _0x7ae9df=_0x7a54[_0x2ce0e3];return _0x7ae9df;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 149b625..b074bf0 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 _0x8d2f=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x416265,_0x28953c){var _0x940c48=function(_0x57725d){while(--_0x57725d){_0x416265['push'](_0x416265['shift']());}};_0x940c48(++_0x28953c);}(_0x8d2f,0xb8));var _0xf8d2=function(_0x5086be,_0x1a9d70){_0x5086be=_0x5086be-0x0;var _0x211fc7=_0x8d2f[_0x5086be];return _0x211fc7;};'use strict';var Sequelize=require('sequelize');module[_0xf8d2('0x0')]={'description':{'type':Sequelize[_0xf8d2('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xf8d2('0x1')]},'pass':{'type':Sequelize[_0xf8d2('0x1')]},'port':{'type':Sequelize[_0xf8d2('0x2')]},'secure':{'type':Sequelize[_0xf8d2('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xf8d2('0x1')]},'authentication':{'type':Sequelize[_0xf8d2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x541e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1c1080,_0x3f4ddd){var _0x3bdb51=function(_0x1a23f3){while(--_0x1a23f3){_0x1c1080['push'](_0x1c1080['shift']());}};_0x3bdb51(++_0x3f4ddd);}(_0x541e,0x1b5));var _0xe541=function(_0x2a45ed,_0x5d09df){_0x2a45ed=_0x2a45ed-0x0;var _0x59e079=_0x541e[_0x2a45ed];return _0x59e079;};'use strict';var Sequelize=require(_0xe541('0x0'));module[_0xe541('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe541('0x2')]},'user':{'type':Sequelize[_0xe541('0x2')]},'pass':{'type':Sequelize[_0xe541('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xe541('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xe541('0x2')]},'authentication':{'type':Sequelize[_0xe541('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 99439a5..b014595 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 _0x7307=['filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','rawAttributes','fields','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','MailServerOut','fieldName','type','key','query','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters'];(function(_0x530b31,_0x17e87d){var _0x48bd71=function(_0x2ba6d5){while(--_0x2ba6d5){_0x530b31['push'](_0x530b31['shift']());}};_0x48bd71(++_0x17e87d);}(_0x7307,0x187));var _0x7730=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x7307[_0x16771d];return _0x386f11;};'use strict';var emlformat=require(_0x7730('0x0'));var rimraf=require(_0x7730('0x1'));var zipdir=require(_0x7730('0x2'));var jsonpatch=require(_0x7730('0x3'));var rp=require(_0x7730('0x4'));var moment=require(_0x7730('0x5'));var BPromise=require(_0x7730('0x6'));var Mustache=require(_0x7730('0x7'));var util=require(_0x7730('0x8'));var path=require('path');var sox=require(_0x7730('0x9'));var csv=require(_0x7730('0xa'));var ejs=require(_0x7730('0xb'));var fs=require('fs');var fs_extra=require(_0x7730('0xc'));var _=require('lodash');var squel=require(_0x7730('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7730('0xa'));var querystring=require(_0x7730('0xe'));var Papa=require(_0x7730('0xf'));var Redis=require(_0x7730('0x10'));var authService=require(_0x7730('0x11'));var qs=require(_0x7730('0x12'));var as=require(_0x7730('0x13'));var hardwareService=require(_0x7730('0x14'));var logger=require(_0x7730('0x15'))(_0x7730('0x16'));var utils=require(_0x7730('0x17'));var config=require(_0x7730('0x18'));var licenseUtil=require(_0x7730('0x19'));var db=require(_0x7730('0x1a'))['db'];function respondWithStatusCode(_0x145933,_0x38c20c){_0x38c20c=_0x38c20c||0xcc;return function(_0x4ebf1a){if(_0x4ebf1a){return _0x145933[_0x7730('0x1b')](_0x38c20c);}return _0x145933[_0x7730('0x1c')](_0x38c20c)['end']();};}function respondWithResult(_0x3922d2,_0x35f06c){_0x35f06c=_0x35f06c||0xc8;return function(_0x363ed5){if(_0x363ed5){return _0x3922d2['status'](_0x35f06c)[_0x7730('0x1d')](_0x363ed5);}};}function respondWithFilteredResult(_0x5e5356,_0x4053b0){return function(_0x4a80c4){if(_0x4a80c4){var _0x3d9846=typeof _0x4053b0[_0x7730('0x1e')]==='undefined'&&typeof _0x4053b0['limit']===_0x7730('0x1f');var _0x541c0a=_0x4a80c4[_0x7730('0x20')];var _0x11376b=_0x3d9846?0x0:_0x4053b0[_0x7730('0x1e')];var _0x41866f=_0x3d9846?_0x4a80c4['count']:_0x4053b0[_0x7730('0x1e')]+_0x4053b0['limit'];var _0x599a7f;if(_0x41866f>=_0x541c0a){_0x41866f=_0x541c0a;_0x599a7f=0xc8;}else{_0x599a7f=0xce;}_0x5e5356[_0x7730('0x1c')](_0x599a7f);return _0x5e5356[_0x7730('0x21')](_0x7730('0x22'),_0x11376b+'-'+_0x41866f+'/'+_0x541c0a)['json'](_0x4a80c4);}return null;};}function patchUpdates(_0x82e01a){return function(_0x561dcb){try{jsonpatch[_0x7730('0x23')](_0x561dcb,_0x82e01a,!![]);}catch(_0x1d7d2d){return BPromise['reject'](_0x1d7d2d);}return _0x561dcb[_0x7730('0x24')]();};}function saveUpdates(_0x38f107,_0x402b52){return function(_0x2b12a8){if(_0x2b12a8){return _0x2b12a8[_0x7730('0x25')](_0x38f107)[_0x7730('0x26')](function(_0x5d5403){return _0x5d5403;});}return null;};}function removeEntity(_0x42f4c4,_0x4a065c){return function(_0x81e922){if(_0x81e922){return _0x81e922[_0x7730('0x27')]()[_0x7730('0x26')](function(){_0x42f4c4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x291149,_0x2cca93){return function(_0x21b1ff){if(!_0x21b1ff){_0x291149[_0x7730('0x1b')](0x194);}return _0x21b1ff;};}function handleError(_0xee354b,_0x3f67cb){_0x3f67cb=_0x3f67cb||0x1f4;return function(_0x40ad21){logger['error'](_0x40ad21['stack']);if(_0x40ad21[_0x7730('0x28')]){delete _0x40ad21[_0x7730('0x28')];}_0xee354b[_0x7730('0x1c')](_0x3f67cb)[_0x7730('0x29')](_0x40ad21);};}exports[_0x7730('0x2a')]=function(_0x2d19ed,_0x32146d){var _0x55e9ae={},_0x3bc2c3={},_0x58686b={'count':0x0,'rows':[]};var _0x169f99=_[_0x7730('0x2b')](db[_0x7730('0x2c')]['rawAttributes'],function(_0x3f6b06){return{'name':_0x3f6b06[_0x7730('0x2d')],'type':_0x3f6b06[_0x7730('0x2e')][_0x7730('0x2f')]};});_0x3bc2c3['model']=_[_0x7730('0x2b')](_0x169f99,'name');_0x3bc2c3['query']=_['keys'](_0x2d19ed[_0x7730('0x30')]);_0x3bc2c3['filters']=_[_0x7730('0x31')](_0x3bc2c3[_0x7730('0x32')],_0x3bc2c3[_0x7730('0x30')]);_0x55e9ae[_0x7730('0x33')]=_['intersection'](_0x3bc2c3[_0x7730('0x32')],qs['fields'](_0x2d19ed[_0x7730('0x30')]['fields']));_0x55e9ae[_0x7730('0x33')]=_0x55e9ae[_0x7730('0x33')][_0x7730('0x34')]?_0x55e9ae['attributes']:_0x3bc2c3[_0x7730('0x32')];if(!_0x2d19ed[_0x7730('0x30')][_0x7730('0x35')](_0x7730('0x36'))){_0x55e9ae[_0x7730('0x37')]=qs[_0x7730('0x37')](_0x2d19ed[_0x7730('0x30')][_0x7730('0x37')]);_0x55e9ae[_0x7730('0x1e')]=qs[_0x7730('0x1e')](_0x2d19ed[_0x7730('0x30')][_0x7730('0x1e')]);}_0x55e9ae['order']=qs[_0x7730('0x38')](_0x2d19ed[_0x7730('0x30')]['sort']);_0x55e9ae[_0x7730('0x39')]=qs[_0x7730('0x3a')](_['pick'](_0x2d19ed[_0x7730('0x30')],_0x3bc2c3['filters']),_0x169f99);if(_0x2d19ed['query'][_0x7730('0x3b')]){_0x55e9ae[_0x7730('0x39')]=_[_0x7730('0x3c')](_0x55e9ae[_0x7730('0x39')],{'$or':_[_0x7730('0x2b')](_0x169f99,function(_0x373ba4){if(_0x373ba4[_0x7730('0x2e')]!==_0x7730('0x3d')){var _0x1a001d={};_0x1a001d[_0x373ba4[_0x7730('0x28')]]={'$like':'%'+_0x2d19ed[_0x7730('0x30')][_0x7730('0x3b')]+'%'};return _0x1a001d;}})});}_0x55e9ae=_[_0x7730('0x3c')]({},_0x55e9ae,_0x2d19ed[_0x7730('0x3e')]);var _0x440911={'where':_0x55e9ae[_0x7730('0x39')]};return db['MailServerOut'][_0x7730('0x20')](_0x440911)[_0x7730('0x26')](function(_0x3fc8bd){_0x58686b[_0x7730('0x20')]=_0x3fc8bd;if(_0x2d19ed['query'][_0x7730('0x3f')]){_0x55e9ae[_0x7730('0x40')]=[{'all':!![]}];}return db[_0x7730('0x2c')][_0x7730('0x41')](_0x55e9ae);})[_0x7730('0x26')](function(_0x1e1eda){_0x58686b['rows']=_0x1e1eda;return _0x58686b;})[_0x7730('0x26')](respondWithFilteredResult(_0x32146d,_0x55e9ae))[_0x7730('0x42')](handleError(_0x32146d,null));};exports[_0x7730('0x43')]=function(_0x1d9cfc,_0x181d4a){var _0x2c431f={'raw':!![],'where':{'id':_0x1d9cfc['params']['id']}},_0x2b6652={};_0x2b6652[_0x7730('0x32')]=_[_0x7730('0x44')](db['MailServerOut'][_0x7730('0x45')]);_0x2b6652[_0x7730('0x30')]=_['keys'](_0x1d9cfc[_0x7730('0x30')]);_0x2b6652['filters']=_[_0x7730('0x31')](_0x2b6652[_0x7730('0x32')],_0x2b6652['query']);_0x2c431f[_0x7730('0x33')]=_['intersection'](_0x2b6652[_0x7730('0x32')],qs[_0x7730('0x46')](_0x1d9cfc[_0x7730('0x30')][_0x7730('0x46')]));_0x2c431f[_0x7730('0x33')]=_0x2c431f[_0x7730('0x33')][_0x7730('0x34')]?_0x2c431f[_0x7730('0x33')]:_0x2b6652[_0x7730('0x32')];if(_0x1d9cfc['query'][_0x7730('0x3f')]){_0x2c431f[_0x7730('0x40')]=[{'all':!![]}];}_0x2c431f=_[_0x7730('0x3c')]({},_0x2c431f,_0x1d9cfc[_0x7730('0x3e')]);return db[_0x7730('0x2c')][_0x7730('0x47')](_0x2c431f)['then'](handleEntityNotFound(_0x181d4a,null))[_0x7730('0x26')](respondWithResult(_0x181d4a,null))['catch'](handleError(_0x181d4a,null));};exports[_0x7730('0x48')]=function(_0x13ad51,_0x5dd2ef){return db[_0x7730('0x2c')]['create'](_0x13ad51['body'],{})['then'](respondWithResult(_0x5dd2ef,0xc9))[_0x7730('0x42')](handleError(_0x5dd2ef,null));};exports[_0x7730('0x25')]=function(_0x4e1d9b,_0x31ad9e){if(_0x4e1d9b[_0x7730('0x49')]['id']){delete _0x4e1d9b[_0x7730('0x49')]['id'];}return db['MailServerOut'][_0x7730('0x47')]({'where':{'id':_0x4e1d9b[_0x7730('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31ad9e,null))['then'](saveUpdates(_0x4e1d9b[_0x7730('0x49')],null))['then'](respondWithResult(_0x31ad9e,null))[_0x7730('0x42')](handleError(_0x31ad9e,null));};exports[_0x7730('0x27')]=function(_0x1ddc8d,_0x1f44f3){return db[_0x7730('0x2c')][_0x7730('0x47')]({'where':{'id':_0x1ddc8d[_0x7730('0x4a')]['id']}})[_0x7730('0x26')](handleEntityNotFound(_0x1f44f3,null))[_0x7730('0x26')](removeEntity(_0x1f44f3,null))[_0x7730('0x42')](handleError(_0x1f44f3,null));}; \ No newline at end of file +var _0x0522=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x0522,0xc5));var _0x2052=function(_0x433557,_0x24c4a4){_0x433557=_0x433557-0x0;var _0x18dd55=_0x0522[_0x433557];return _0x18dd55;};'use strict';var emlformat=require(_0x2052('0x0'));var rimraf=require(_0x2052('0x1'));var zipdir=require(_0x2052('0x2'));var jsonpatch=require(_0x2052('0x3'));var rp=require('request-promise');var moment=require(_0x2052('0x4'));var BPromise=require(_0x2052('0x5'));var Mustache=require(_0x2052('0x6'));var util=require(_0x2052('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2052('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2052('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2052('0xa'));var jsforce=require(_0x2052('0xb'));var deskjs=require(_0x2052('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2052('0xd'));var Papa=require(_0x2052('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2052('0xf'));var as=require(_0x2052('0x10'));var hardwareService=require(_0x2052('0x11'));var logger=require(_0x2052('0x12'))(_0x2052('0x13'));var utils=require(_0x2052('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2052('0x15'))['db'];function respondWithStatusCode(_0x7dc4b,_0x55d014){_0x55d014=_0x55d014||0xcc;return function(_0x28dcea){if(_0x28dcea){return _0x7dc4b['sendStatus'](_0x55d014);}return _0x7dc4b[_0x2052('0x16')](_0x55d014)[_0x2052('0x17')]();};}function respondWithResult(_0x376e69,_0x9a1e03){_0x9a1e03=_0x9a1e03||0xc8;return function(_0x289981){if(_0x289981){return _0x376e69[_0x2052('0x16')](_0x9a1e03)[_0x2052('0x18')](_0x289981);}};}function respondWithFilteredResult(_0x367c8d,_0x1f3f1e){return function(_0x3ea319){if(_0x3ea319){var _0x3dc398=typeof _0x1f3f1e[_0x2052('0x19')]===_0x2052('0x1a')&&typeof _0x1f3f1e[_0x2052('0x1b')]===_0x2052('0x1a');var _0x5eb853=_0x3ea319[_0x2052('0x1c')];var _0x416f4d=_0x3dc398?0x0:_0x1f3f1e['offset'];var _0x2eb24c=_0x3dc398?_0x3ea319[_0x2052('0x1c')]:_0x1f3f1e[_0x2052('0x19')]+_0x1f3f1e[_0x2052('0x1b')];var _0x417a86;if(_0x2eb24c>=_0x5eb853){_0x2eb24c=_0x5eb853;_0x417a86=0xc8;}else{_0x417a86=0xce;}_0x367c8d[_0x2052('0x16')](_0x417a86);return _0x367c8d[_0x2052('0x1d')]('Content-Range',_0x416f4d+'-'+_0x2eb24c+'/'+_0x5eb853)[_0x2052('0x18')](_0x3ea319);}return null;};}function patchUpdates(_0x2193a9){return function(_0x4527c5){try{jsonpatch['apply'](_0x4527c5,_0x2193a9,!![]);}catch(_0x831547){return BPromise['reject'](_0x831547);}return _0x4527c5[_0x2052('0x1e')]();};}function saveUpdates(_0x16e1af,_0x148578){return function(_0x24ab1b){if(_0x24ab1b){return _0x24ab1b[_0x2052('0x1f')](_0x16e1af)[_0x2052('0x20')](function(_0xcf62e){return _0xcf62e;});}return null;};}function removeEntity(_0x5bb3f3,_0x16bd61){return function(_0xfcd464){if(_0xfcd464){return _0xfcd464[_0x2052('0x21')]()[_0x2052('0x20')](function(){_0x5bb3f3[_0x2052('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c3ca8,_0x3ed92d){return function(_0x4414a5){if(!_0x4414a5){_0x4c3ca8[_0x2052('0x22')](0x194);}return _0x4414a5;};}function handleError(_0x346cba,_0x43cb30){_0x43cb30=_0x43cb30||0x1f4;return function(_0x44dee9){logger[_0x2052('0x23')](_0x44dee9[_0x2052('0x24')]);if(_0x44dee9[_0x2052('0x25')]){delete _0x44dee9[_0x2052('0x25')];}_0x346cba[_0x2052('0x16')](_0x43cb30)[_0x2052('0x26')](_0x44dee9);};}exports[_0x2052('0x27')]=function(_0x4257b5,_0x2d363a){var _0x36f58e={},_0x4da8ff={},_0x17e3b8={'count':0x0,'rows':[]};var _0x494e97=_[_0x2052('0x28')](db[_0x2052('0x29')][_0x2052('0x2a')],function(_0x55750c){return{'name':_0x55750c[_0x2052('0x2b')],'type':_0x55750c[_0x2052('0x2c')]['key']};});_0x4da8ff[_0x2052('0x2d')]=_['map'](_0x494e97,_0x2052('0x25'));_0x4da8ff['query']=_[_0x2052('0x2e')](_0x4257b5[_0x2052('0x2f')]);_0x4da8ff[_0x2052('0x30')]=_[_0x2052('0x31')](_0x4da8ff[_0x2052('0x2d')],_0x4da8ff[_0x2052('0x2f')]);_0x36f58e[_0x2052('0x32')]=_[_0x2052('0x31')](_0x4da8ff[_0x2052('0x2d')],qs[_0x2052('0x33')](_0x4257b5['query'][_0x2052('0x33')]));_0x36f58e['attributes']=_0x36f58e[_0x2052('0x32')][_0x2052('0x34')]?_0x36f58e[_0x2052('0x32')]:_0x4da8ff[_0x2052('0x2d')];if(!_0x4257b5['query']['hasOwnProperty']('nolimit')){_0x36f58e['limit']=qs['limit'](_0x4257b5[_0x2052('0x2f')][_0x2052('0x1b')]);_0x36f58e[_0x2052('0x19')]=qs[_0x2052('0x19')](_0x4257b5[_0x2052('0x2f')]['offset']);}_0x36f58e[_0x2052('0x35')]=qs[_0x2052('0x36')](_0x4257b5[_0x2052('0x2f')]['sort']);_0x36f58e[_0x2052('0x37')]=qs['filters'](_[_0x2052('0x38')](_0x4257b5[_0x2052('0x2f')],_0x4da8ff[_0x2052('0x30')]),_0x494e97);if(_0x4257b5[_0x2052('0x2f')]['filter']){_0x36f58e[_0x2052('0x37')]=_[_0x2052('0x39')](_0x36f58e[_0x2052('0x37')],{'$or':_[_0x2052('0x28')](_0x494e97,function(_0x4abdf3){if(_0x4abdf3[_0x2052('0x2c')]!==_0x2052('0x3a')){var _0x257b9e={};_0x257b9e[_0x4abdf3[_0x2052('0x25')]]={'$like':'%'+_0x4257b5[_0x2052('0x2f')]['filter']+'%'};return _0x257b9e;}})});}_0x36f58e=_['merge']({},_0x36f58e,_0x4257b5[_0x2052('0x3b')]);var _0x368801={'where':_0x36f58e['where']};return db['MailServerOut']['count'](_0x368801)[_0x2052('0x20')](function(_0x6ea5e8){_0x17e3b8[_0x2052('0x1c')]=_0x6ea5e8;if(_0x4257b5[_0x2052('0x2f')][_0x2052('0x3c')]){_0x36f58e[_0x2052('0x3d')]=[{'all':!![]}];}return db[_0x2052('0x29')][_0x2052('0x3e')](_0x36f58e);})[_0x2052('0x20')](function(_0x484059){_0x17e3b8[_0x2052('0x3f')]=_0x484059;return _0x17e3b8;})[_0x2052('0x20')](respondWithFilteredResult(_0x2d363a,_0x36f58e))[_0x2052('0x40')](handleError(_0x2d363a,null));};exports[_0x2052('0x41')]=function(_0x46638c,_0x21d814){var _0x443f94={'raw':!![],'where':{'id':_0x46638c[_0x2052('0x42')]['id']}},_0x5327af={};_0x5327af['model']=_['keys'](db['MailServerOut'][_0x2052('0x2a')]);_0x5327af['query']=_[_0x2052('0x2e')](_0x46638c['query']);_0x5327af[_0x2052('0x30')]=_[_0x2052('0x31')](_0x5327af[_0x2052('0x2d')],_0x5327af[_0x2052('0x2f')]);_0x443f94[_0x2052('0x32')]=_['intersection'](_0x5327af['model'],qs['fields'](_0x46638c[_0x2052('0x2f')]['fields']));_0x443f94[_0x2052('0x32')]=_0x443f94[_0x2052('0x32')][_0x2052('0x34')]?_0x443f94['attributes']:_0x5327af[_0x2052('0x2d')];if(_0x46638c[_0x2052('0x2f')][_0x2052('0x3c')]){_0x443f94['include']=[{'all':!![]}];}_0x443f94=_[_0x2052('0x39')]({},_0x443f94,_0x46638c[_0x2052('0x3b')]);return db[_0x2052('0x29')]['find'](_0x443f94)[_0x2052('0x20')](handleEntityNotFound(_0x21d814,null))['then'](respondWithResult(_0x21d814,null))[_0x2052('0x40')](handleError(_0x21d814,null));};exports[_0x2052('0x43')]=function(_0x55efb5,_0x3a8182){return db[_0x2052('0x29')][_0x2052('0x43')](_0x55efb5['body'],{})['then'](respondWithResult(_0x3a8182,0xc9))[_0x2052('0x40')](handleError(_0x3a8182,null));};exports[_0x2052('0x1f')]=function(_0x5013db,_0x2e7247){if(_0x5013db['body']['id']){delete _0x5013db['body']['id'];}return db['MailServerOut']['find']({'where':{'id':_0x5013db['params']['id']}})[_0x2052('0x20')](handleEntityNotFound(_0x2e7247,null))[_0x2052('0x20')](saveUpdates(_0x5013db[_0x2052('0x44')],null))[_0x2052('0x20')](respondWithResult(_0x2e7247,null))[_0x2052('0x40')](handleError(_0x2e7247,null));};exports['destroy']=function(_0x20a23b,_0x4ab8d4){return db[_0x2052('0x29')][_0x2052('0x45')]({'where':{'id':_0x20a23b[_0x2052('0x42')]['id']}})[_0x2052('0x20')](handleEntityNotFound(_0x4ab8d4,null))[_0x2052('0x20')](removeEntity(_0x4ab8d4,null))[_0x2052('0x40')](handleError(_0x4ab8d4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 69df37b..e639a51 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 _0xf916=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x293c7f,_0x22d7fb){var _0x20e797=function(_0xbea800){while(--_0xbea800){_0x293c7f['push'](_0x293c7f['shift']());}};_0x20e797(++_0x22d7fb);}(_0xf916,0x1e6));var _0x6f91=function(_0x57ccfc,_0x111942){_0x57ccfc=_0x57ccfc-0x0;var _0x600578=_0xf916[_0x57ccfc];return _0x600578;};'use strict';var _=require(_0x6f91('0x0'));var util=require('util');var logger=require(_0x6f91('0x1'))(_0x6f91('0x2'));var moment=require(_0x6f91('0x3'));var BPromise=require(_0x6f91('0x4'));var rp=require(_0x6f91('0x5'));var fs=require('fs');var path=require(_0x6f91('0x6'));var rimraf=require(_0x6f91('0x7'));var config=require(_0x6f91('0x8'));var attributes=require(_0x6f91('0x9'));module[_0x6f91('0xa')]=function(_0x589563,_0x5bfb67){return _0x589563[_0x6f91('0xb')](_0x6f91('0xc'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe302=['MailServerOut','util','../../config/logger','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x323c9a,_0x2e06c3){var _0x1c8f0d=function(_0x42ec63){while(--_0x42ec63){_0x323c9a['push'](_0x323c9a['shift']());}};_0x1c8f0d(++_0x2e06c3);}(_0xe302,0x149));var _0x2e30=function(_0x247cb6,_0x136177){_0x247cb6=_0x247cb6-0x0;var _0x554363=_0xe302[_0x247cb6];return _0x554363;};'use strict';var _=require('lodash');var util=require(_0x2e30('0x0'));var logger=require(_0x2e30('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2e30('0x2'));var rp=require(_0x2e30('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2e30('0x4'));var attributes=require('./mailServerOut.attributes');module[_0x2e30('0x5')]=function(_0x264411,_0x2a0997){return _0x264411[_0x2e30('0x6')](_0x2e30('0x7'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 32b3abd..8361865 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4d52f2,_0x16b716){var _0x2eb3ba=function(_0x1d9058){while(--_0x1d9058){_0x4d52f2['push'](_0x4d52f2['shift']());}};_0x2eb3ba(++_0x16b716);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2d2fdd,_0x3f30d3){var _0x3a3c66=function(_0x2aff35){while(--_0x2aff35){_0x2d2fdd['push'](_0x2d2fdd['shift']());}};_0x3a3c66(++_0x3f30d3);}(_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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 1f1f42b..ae42434 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 _0xdcec=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','show','create'];(function(_0x2729b0,_0x4fd119){var _0x176a9c=function(_0x4c47e4){while(--_0x4c47e4){_0x2729b0['push'](_0x2729b0['shift']());}};_0x176a9c(++_0x4fd119);}(_0xdcec,0x90));var _0xcdce=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xdcec[_0x2b0bc2];return _0x56e5b9;};'use strict';var multer=require(_0xcdce('0x0'));var util=require(_0xcdce('0x1'));var path=require(_0xcdce('0x2'));var timeout=require(_0xcdce('0x3'));var express=require(_0xcdce('0x4'));var router=express[_0xcdce('0x5')]();var fs_extra=require(_0xcdce('0x6'));var auth=require(_0xcdce('0x7'));var interaction=require(_0xcdce('0x8'));var config=require(_0xcdce('0x9'));var controller=require(_0xcdce('0xa'));router[_0xcdce('0xb')]('/',auth[_0xcdce('0xc')](),controller['index']);router[_0xcdce('0xb')](_0xcdce('0xd'),auth['isAuthenticated'](),controller[_0xcdce('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcdce('0xf')]);router['post']('/',auth[_0xcdce('0xc')](),controller[_0xcdce('0x10')]);router[_0xcdce('0x11')](_0xcdce('0x12'),auth[_0xcdce('0xc')](),controller[_0xcdce('0x13')]);router[_0xcdce('0x14')](_0xcdce('0x12'),auth[_0xcdce('0xc')](),controller[_0xcdce('0x15')]);module[_0xcdce('0x16')]=router; \ No newline at end of file +var _0xa6ab=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports'];(function(_0x3fa3e4,_0x27f723){var _0x2b144b=function(_0x1f8c6e){while(--_0x1f8c6e){_0x3fa3e4['push'](_0x3fa3e4['shift']());}};_0x2b144b(++_0x27f723);}(_0xa6ab,0x18c));var _0xba6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa6ab[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xba6a('0x0'));var util=require(_0xba6a('0x1'));var path=require(_0xba6a('0x2'));var timeout=require(_0xba6a('0x3'));var express=require(_0xba6a('0x4'));var router=express['Router']();var fs_extra=require(_0xba6a('0x5'));var auth=require(_0xba6a('0x6'));var interaction=require(_0xba6a('0x7'));var config=require(_0xba6a('0x8'));var controller=require(_0xba6a('0x9'));router[_0xba6a('0xa')]('/',auth[_0xba6a('0xb')](),controller[_0xba6a('0xc')]);router['get'](_0xba6a('0xd'),auth[_0xba6a('0xb')](),controller[_0xba6a('0xe')]);router[_0xba6a('0xa')](_0xba6a('0xf'),auth[_0xba6a('0xb')](),controller[_0xba6a('0x10')]);router[_0xba6a('0x11')]('/',auth[_0xba6a('0xb')](),controller['create']);router['put'](_0xba6a('0xf'),auth[_0xba6a('0xb')](),controller[_0xba6a('0x12')]);router[_0xba6a('0x13')](_0xba6a('0xf'),auth[_0xba6a('0xb')](),controller[_0xba6a('0x14')]);module[_0xba6a('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 2c43ce6..a5fb045 100644 --- a/server/api/mailSubstatus/mailSubstatus.attributes.js +++ b/server/api/mailSubstatus/mailSubstatus.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b20=['exports','STRING'];(function(_0x272ebb,_0x1f87e0){var _0x3559de=function(_0x4cff59){while(--_0x4cff59){_0x272ebb['push'](_0x272ebb['shift']());}};_0x3559de(++_0x1f87e0);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0x01b2('0x0')]={'name':{'type':Sequelize[_0x01b2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xba18=['STRING','name','sequelize','exports'];(function(_0x8b247d,_0x9401a9){var _0x4e10a3=function(_0x176b53){while(--_0x176b53){_0x8b247d['push'](_0x8b247d['shift']());}};_0x4e10a3(++_0x9401a9);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));module[_0x8ba1('0x1')]={'name':{'type':Sequelize[_0x8ba1('0x2')],'unique':_0x8ba1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8ba1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b7ea97c..063afac 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 _0x1c8e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','length','options','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x14642e,_0x3116c7){var _0xb899a4=function(_0x254bad){while(--_0x254bad){_0x14642e['push'](_0x14642e['shift']());}};_0xb899a4(++_0x3116c7);}(_0x1c8e,0x175));var _0xe1c8=function(_0x1b826f,_0x51d08a){_0x1b826f=_0x1b826f-0x0;var _0x4bcfe5=_0x1c8e[_0x1b826f];return _0x4bcfe5;};'use strict';var emlformat=require(_0xe1c8('0x0'));var rimraf=require(_0xe1c8('0x1'));var zipdir=require(_0xe1c8('0x2'));var jsonpatch=require(_0xe1c8('0x3'));var rp=require(_0xe1c8('0x4'));var moment=require('moment');var BPromise=require(_0xe1c8('0x5'));var Mustache=require('mustache');var util=require(_0xe1c8('0x6'));var path=require(_0xe1c8('0x7'));var sox=require('sox');var csv=require(_0xe1c8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe1c8('0x9'));var _=require(_0xe1c8('0xa'));var squel=require('squel');var crypto=require(_0xe1c8('0xb'));var jsforce=require(_0xe1c8('0xc'));var deskjs=require(_0xe1c8('0xd'));var toCsv=require(_0xe1c8('0x8'));var querystring=require(_0xe1c8('0xe'));var Papa=require(_0xe1c8('0xf'));var Redis=require(_0xe1c8('0x10'));var authService=require(_0xe1c8('0x11'));var qs=require(_0xe1c8('0x12'));var as=require(_0xe1c8('0x13'));var hardwareService=require(_0xe1c8('0x14'));var logger=require(_0xe1c8('0x15'))(_0xe1c8('0x16'));var utils=require(_0xe1c8('0x17'));var config=require(_0xe1c8('0x18'));var licenseUtil=require(_0xe1c8('0x19'));var db=require(_0xe1c8('0x1a'))['db'];function respondWithStatusCode(_0x25d982,_0x33968b){_0x33968b=_0x33968b||0xcc;return function(_0x3b0767){if(_0x3b0767){return _0x25d982[_0xe1c8('0x1b')](_0x33968b);}return _0x25d982[_0xe1c8('0x1c')](_0x33968b)[_0xe1c8('0x1d')]();};}function respondWithResult(_0x1eca05,_0x129b77){_0x129b77=_0x129b77||0xc8;return function(_0x376804){if(_0x376804){return _0x1eca05[_0xe1c8('0x1c')](_0x129b77)[_0xe1c8('0x1e')](_0x376804);}};}function respondWithFilteredResult(_0x3a30a0,_0x449b67){return function(_0x49d9ca){if(_0x49d9ca){var _0x2117ce=typeof _0x449b67[_0xe1c8('0x1f')]==='undefined'&&typeof _0x449b67[_0xe1c8('0x20')]===_0xe1c8('0x21');var _0x2ef0cb=_0x49d9ca[_0xe1c8('0x22')];var _0x330177=_0x2117ce?0x0:_0x449b67['offset'];var _0x5f5bcd=_0x2117ce?_0x49d9ca[_0xe1c8('0x22')]:_0x449b67[_0xe1c8('0x1f')]+_0x449b67[_0xe1c8('0x20')];var _0x269b7a;if(_0x5f5bcd>=_0x2ef0cb){_0x5f5bcd=_0x2ef0cb;_0x269b7a=0xc8;}else{_0x269b7a=0xce;}_0x3a30a0[_0xe1c8('0x1c')](_0x269b7a);return _0x3a30a0[_0xe1c8('0x23')](_0xe1c8('0x24'),_0x330177+'-'+_0x5f5bcd+'/'+_0x2ef0cb)[_0xe1c8('0x1e')](_0x49d9ca);}return null;};}function patchUpdates(_0x5f59c8){return function(_0x4cfca4){try{jsonpatch[_0xe1c8('0x25')](_0x4cfca4,_0x5f59c8,!![]);}catch(_0x55a502){return BPromise[_0xe1c8('0x26')](_0x55a502);}return _0x4cfca4[_0xe1c8('0x27')]();};}function saveUpdates(_0x385366,_0x1f115d){return function(_0x2982bf){if(_0x2982bf){return _0x2982bf[_0xe1c8('0x28')](_0x385366)['then'](function(_0x1b68e5){return _0x1b68e5;});}return null;};}function removeEntity(_0x56edb6,_0x46062b){return function(_0x4c23a4){if(_0x4c23a4){return _0x4c23a4['destroy']()[_0xe1c8('0x29')](function(){_0x56edb6[_0xe1c8('0x1c')](0xcc)[_0xe1c8('0x1d')]();});}};}function handleEntityNotFound(_0x523332,_0x57bce0){return function(_0x3ddfde){if(!_0x3ddfde){_0x523332['sendStatus'](0x194);}return _0x3ddfde;};}function handleError(_0xee0f67,_0x1e5eaf){_0x1e5eaf=_0x1e5eaf||0x1f4;return function(_0x353832){logger[_0xe1c8('0x2a')](_0x353832[_0xe1c8('0x2b')]);if(_0x353832['name']){delete _0x353832[_0xe1c8('0x2c')];}_0xee0f67['status'](_0x1e5eaf)[_0xe1c8('0x2d')](_0x353832);};}exports[_0xe1c8('0x2e')]=function(_0x1cd9a3,_0x518799){var _0x25fab7={},_0x412aaf={},_0x368af5={'count':0x0,'rows':[]};var _0x19d8bb=_[_0xe1c8('0x2f')](db[_0xe1c8('0x30')][_0xe1c8('0x31')],function(_0x15f28d){return{'name':_0x15f28d[_0xe1c8('0x32')],'type':_0x15f28d[_0xe1c8('0x33')]['key']};});_0x412aaf[_0xe1c8('0x34')]=_['map'](_0x19d8bb,_0xe1c8('0x2c'));_0x412aaf[_0xe1c8('0x35')]=_['keys'](_0x1cd9a3[_0xe1c8('0x35')]);_0x412aaf[_0xe1c8('0x36')]=_[_0xe1c8('0x37')](_0x412aaf[_0xe1c8('0x34')],_0x412aaf[_0xe1c8('0x35')]);_0x25fab7['attributes']=_['intersection'](_0x412aaf[_0xe1c8('0x34')],qs[_0xe1c8('0x38')](_0x1cd9a3['query']['fields']));_0x25fab7[_0xe1c8('0x39')]=_0x25fab7[_0xe1c8('0x39')]['length']?_0x25fab7['attributes']:_0x412aaf[_0xe1c8('0x34')];if(!_0x1cd9a3['query']['hasOwnProperty']('nolimit')){_0x25fab7[_0xe1c8('0x20')]=qs[_0xe1c8('0x20')](_0x1cd9a3['query'][_0xe1c8('0x20')]);_0x25fab7['offset']=qs['offset'](_0x1cd9a3['query'][_0xe1c8('0x1f')]);}_0x25fab7[_0xe1c8('0x3a')]=qs[_0xe1c8('0x3b')](_0x1cd9a3[_0xe1c8('0x35')]['sort']);_0x25fab7[_0xe1c8('0x3c')]=qs[_0xe1c8('0x36')](_[_0xe1c8('0x3d')](_0x1cd9a3[_0xe1c8('0x35')],_0x412aaf[_0xe1c8('0x36')]),_0x19d8bb);if(_0x1cd9a3[_0xe1c8('0x35')][_0xe1c8('0x3e')]){_0x25fab7[_0xe1c8('0x3c')]=_[_0xe1c8('0x3f')](_0x25fab7['where'],{'$or':_[_0xe1c8('0x2f')](_0x19d8bb,function(_0x29ee5f){if(_0x29ee5f[_0xe1c8('0x33')]!==_0xe1c8('0x40')){var _0x4e284e={};_0x4e284e[_0x29ee5f['name']]={'$like':'%'+_0x1cd9a3[_0xe1c8('0x35')]['filter']+'%'};return _0x4e284e;}})});}_0x25fab7=_[_0xe1c8('0x3f')]({},_0x25fab7,_0x1cd9a3['options']);var _0x1d9ccd={'where':_0x25fab7[_0xe1c8('0x3c')]};return db[_0xe1c8('0x30')][_0xe1c8('0x22')](_0x1d9ccd)[_0xe1c8('0x29')](function(_0x2c28df){_0x368af5[_0xe1c8('0x22')]=_0x2c28df;if(_0x1cd9a3[_0xe1c8('0x35')][_0xe1c8('0x41')]){_0x25fab7[_0xe1c8('0x42')]=[{'all':!![]}];}return db['MailSubstatus'][_0xe1c8('0x43')](_0x25fab7);})[_0xe1c8('0x29')](function(_0x20e5d1){_0x368af5[_0xe1c8('0x44')]=_0x20e5d1;return _0x368af5;})[_0xe1c8('0x29')](respondWithFilteredResult(_0x518799,_0x25fab7))[_0xe1c8('0x45')](handleError(_0x518799,null));};exports[_0xe1c8('0x46')]=function(_0x2b81b6,_0x4b3e09){var _0x7f51dd={'raw':!![],'where':{'id':_0x2b81b6['params']['id']}},_0x2457ad={};_0x2457ad[_0xe1c8('0x34')]=_[_0xe1c8('0x47')](db['MailSubstatus'][_0xe1c8('0x31')]);_0x2457ad[_0xe1c8('0x35')]=_['keys'](_0x2b81b6['query']);_0x2457ad[_0xe1c8('0x36')]=_[_0xe1c8('0x37')](_0x2457ad['model'],_0x2457ad['query']);_0x7f51dd[_0xe1c8('0x39')]=_[_0xe1c8('0x37')](_0x2457ad[_0xe1c8('0x34')],qs['fields'](_0x2b81b6['query'][_0xe1c8('0x38')]));_0x7f51dd[_0xe1c8('0x39')]=_0x7f51dd[_0xe1c8('0x39')][_0xe1c8('0x48')]?_0x7f51dd[_0xe1c8('0x39')]:_0x2457ad['model'];if(_0x2b81b6[_0xe1c8('0x35')]['includeAll']){_0x7f51dd['include']=[{'all':!![]}];}_0x7f51dd=_[_0xe1c8('0x3f')]({},_0x7f51dd,_0x2b81b6[_0xe1c8('0x49')]);return db[_0xe1c8('0x30')][_0xe1c8('0x4a')](_0x7f51dd)[_0xe1c8('0x29')](handleEntityNotFound(_0x4b3e09,null))[_0xe1c8('0x29')](respondWithResult(_0x4b3e09,null))[_0xe1c8('0x45')](handleError(_0x4b3e09,null));};exports['create']=function(_0x3effba,_0x3355c1){return db['MailSubstatus']['create'](_0x3effba['body'],{})[_0xe1c8('0x29')](respondWithResult(_0x3355c1,0xc9))[_0xe1c8('0x45')](handleError(_0x3355c1,null));};exports[_0xe1c8('0x28')]=function(_0x5b892d,_0x407e6e){if(_0x5b892d['body']['id']){delete _0x5b892d[_0xe1c8('0x4b')]['id'];}return db[_0xe1c8('0x30')]['find']({'where':{'id':_0x5b892d[_0xe1c8('0x4c')]['id']}})[_0xe1c8('0x29')](handleEntityNotFound(_0x407e6e,null))[_0xe1c8('0x29')](saveUpdates(_0x5b892d[_0xe1c8('0x4b')],null))[_0xe1c8('0x29')](respondWithResult(_0x407e6e,null))[_0xe1c8('0x45')](handleError(_0x407e6e,null));};exports['destroy']=function(_0x1f16c5,_0x5a33b1){return db[_0xe1c8('0x30')][_0xe1c8('0x4a')]({'where':{'id':_0x1f16c5[_0xe1c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a33b1,null))['then'](removeEntity(_0x5a33b1,null))['catch'](handleError(_0x5a33b1,null));};exports[_0xe1c8('0x4d')]=function(_0x41a9dd,_0x392579){return db['MailSubstatus'][_0xe1c8('0x4d')]()[_0xe1c8('0x29')](respondWithResult(_0x392579,null))[_0xe1c8('0x45')](handleError(_0x392579,null));}; \ No newline at end of file +var _0x6d7e=['merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter'];(function(_0x38f823,_0x3cee3c){var _0x310838=function(_0x2c69b7){while(--_0x2c69b7){_0x38f823['push'](_0x38f823['shift']());}};_0x310838(++_0x3cee3c);}(_0x6d7e,0x1bc));var _0xe6d7=function(_0x30d679,_0x63fb68){_0x30d679=_0x30d679-0x0;var _0x1d3fcf=_0x6d7e[_0x30d679];return _0x1d3fcf;};'use strict';var emlformat=require(_0xe6d7('0x0'));var rimraf=require(_0xe6d7('0x1'));var zipdir=require(_0xe6d7('0x2'));var jsonpatch=require(_0xe6d7('0x3'));var rp=require(_0xe6d7('0x4'));var moment=require(_0xe6d7('0x5'));var BPromise=require(_0xe6d7('0x6'));var Mustache=require(_0xe6d7('0x7'));var util=require('util');var path=require(_0xe6d7('0x8'));var sox=require('sox');var csv=require(_0xe6d7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6d7('0xa'));var _=require('lodash');var squel=require(_0xe6d7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6d7('0xc'));var toCsv=require(_0xe6d7('0x9'));var querystring=require('querystring');var Papa=require(_0xe6d7('0xd'));var Redis=require('ioredis');var authService=require(_0xe6d7('0xe'));var qs=require(_0xe6d7('0xf'));var as=require(_0xe6d7('0x10'));var hardwareService=require(_0xe6d7('0x11'));var logger=require(_0xe6d7('0x12'))(_0xe6d7('0x13'));var utils=require('../../config/utils');var config=require(_0xe6d7('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xced2ac,_0x4e5362){_0x4e5362=_0x4e5362||0xcc;return function(_0x1b43f2){if(_0x1b43f2){return _0xced2ac[_0xe6d7('0x15')](_0x4e5362);}return _0xced2ac[_0xe6d7('0x16')](_0x4e5362)[_0xe6d7('0x17')]();};}function respondWithResult(_0x2d7067,_0x32a4d1){_0x32a4d1=_0x32a4d1||0xc8;return function(_0xaa044b){if(_0xaa044b){return _0x2d7067[_0xe6d7('0x16')](_0x32a4d1)[_0xe6d7('0x18')](_0xaa044b);}};}function respondWithFilteredResult(_0x3f402b,_0x1520bc){return function(_0x4c7b24){if(_0x4c7b24){var _0x50e566=typeof _0x1520bc[_0xe6d7('0x19')]==='undefined'&&typeof _0x1520bc[_0xe6d7('0x1a')]===_0xe6d7('0x1b');var _0x488e83=_0x4c7b24[_0xe6d7('0x1c')];var _0x1b7c92=_0x50e566?0x0:_0x1520bc[_0xe6d7('0x19')];var _0x3028b3=_0x50e566?_0x4c7b24['count']:_0x1520bc[_0xe6d7('0x19')]+_0x1520bc[_0xe6d7('0x1a')];var _0x5caaf4;if(_0x3028b3>=_0x488e83){_0x3028b3=_0x488e83;_0x5caaf4=0xc8;}else{_0x5caaf4=0xce;}_0x3f402b['status'](_0x5caaf4);return _0x3f402b[_0xe6d7('0x1d')](_0xe6d7('0x1e'),_0x1b7c92+'-'+_0x3028b3+'/'+_0x488e83)[_0xe6d7('0x18')](_0x4c7b24);}return null;};}function patchUpdates(_0x58f4a0){return function(_0x3800a9){try{jsonpatch[_0xe6d7('0x1f')](_0x3800a9,_0x58f4a0,!![]);}catch(_0x3a626d){return BPromise[_0xe6d7('0x20')](_0x3a626d);}return _0x3800a9['save']();};}function saveUpdates(_0x507c79,_0x126601){return function(_0x4dd7d4){if(_0x4dd7d4){return _0x4dd7d4[_0xe6d7('0x21')](_0x507c79)['then'](function(_0x899ce){return _0x899ce;});}return null;};}function removeEntity(_0x208baf,_0x2cee06){return function(_0x3663c1){if(_0x3663c1){return _0x3663c1[_0xe6d7('0x22')]()[_0xe6d7('0x23')](function(){_0x208baf[_0xe6d7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd99d,_0x172e49){return function(_0x18af44){if(!_0x18af44){_0x1bd99d[_0xe6d7('0x15')](0x194);}return _0x18af44;};}function handleError(_0x3de292,_0x100449){_0x100449=_0x100449||0x1f4;return function(_0x53917a){logger[_0xe6d7('0x24')](_0x53917a[_0xe6d7('0x25')]);if(_0x53917a[_0xe6d7('0x26')]){delete _0x53917a[_0xe6d7('0x26')];}_0x3de292[_0xe6d7('0x16')](_0x100449)['send'](_0x53917a);};}exports[_0xe6d7('0x27')]=function(_0x1f7437,_0x5c9efd){var _0x59b414={},_0xc50a57={},_0x6f6c6a={'count':0x0,'rows':[]};var _0x55fe08=_[_0xe6d7('0x28')](db[_0xe6d7('0x29')][_0xe6d7('0x2a')],function(_0x45b2e1){return{'name':_0x45b2e1[_0xe6d7('0x2b')],'type':_0x45b2e1[_0xe6d7('0x2c')][_0xe6d7('0x2d')]};});_0xc50a57[_0xe6d7('0x2e')]=_[_0xe6d7('0x28')](_0x55fe08,_0xe6d7('0x26'));_0xc50a57[_0xe6d7('0x2f')]=_[_0xe6d7('0x30')](_0x1f7437[_0xe6d7('0x2f')]);_0xc50a57['filters']=_['intersection'](_0xc50a57[_0xe6d7('0x2e')],_0xc50a57[_0xe6d7('0x2f')]);_0x59b414['attributes']=_[_0xe6d7('0x31')](_0xc50a57[_0xe6d7('0x2e')],qs['fields'](_0x1f7437['query'][_0xe6d7('0x32')]));_0x59b414[_0xe6d7('0x33')]=_0x59b414['attributes'][_0xe6d7('0x34')]?_0x59b414['attributes']:_0xc50a57[_0xe6d7('0x2e')];if(!_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x35')]('nolimit')){_0x59b414['limit']=qs[_0xe6d7('0x1a')](_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x1a')]);_0x59b414[_0xe6d7('0x19')]=qs[_0xe6d7('0x19')](_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x19')]);}_0x59b414[_0xe6d7('0x36')]=qs['sort'](_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x37')]);_0x59b414[_0xe6d7('0x38')]=qs[_0xe6d7('0x39')](_[_0xe6d7('0x3a')](_0x1f7437[_0xe6d7('0x2f')],_0xc50a57[_0xe6d7('0x39')]),_0x55fe08);if(_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x3b')]){_0x59b414[_0xe6d7('0x38')]=_['merge'](_0x59b414[_0xe6d7('0x38')],{'$or':_[_0xe6d7('0x28')](_0x55fe08,function(_0x195fab){if(_0x195fab[_0xe6d7('0x2c')]!=='VIRTUAL'){var _0x4e7d0b={};_0x4e7d0b[_0x195fab[_0xe6d7('0x26')]]={'$like':'%'+_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x3b')]+'%'};return _0x4e7d0b;}})});}_0x59b414=_[_0xe6d7('0x3c')]({},_0x59b414,_0x1f7437[_0xe6d7('0x3d')]);var _0x3aec6d={'where':_0x59b414[_0xe6d7('0x38')]};return db[_0xe6d7('0x29')][_0xe6d7('0x1c')](_0x3aec6d)[_0xe6d7('0x23')](function(_0x228ca5){_0x6f6c6a[_0xe6d7('0x1c')]=_0x228ca5;if(_0x1f7437[_0xe6d7('0x2f')][_0xe6d7('0x3e')]){_0x59b414[_0xe6d7('0x3f')]=[{'all':!![]}];}return db[_0xe6d7('0x29')][_0xe6d7('0x40')](_0x59b414);})[_0xe6d7('0x23')](function(_0xd3e621){_0x6f6c6a['rows']=_0xd3e621;return _0x6f6c6a;})['then'](respondWithFilteredResult(_0x5c9efd,_0x59b414))[_0xe6d7('0x41')](handleError(_0x5c9efd,null));};exports[_0xe6d7('0x42')]=function(_0x42357c,_0x284fb5){var _0x22cd13={'raw':!![],'where':{'id':_0x42357c[_0xe6d7('0x43')]['id']}},_0x1c78b5={};_0x1c78b5[_0xe6d7('0x2e')]=_['keys'](db[_0xe6d7('0x29')][_0xe6d7('0x2a')]);_0x1c78b5[_0xe6d7('0x2f')]=_['keys'](_0x42357c['query']);_0x1c78b5['filters']=_['intersection'](_0x1c78b5[_0xe6d7('0x2e')],_0x1c78b5[_0xe6d7('0x2f')]);_0x22cd13[_0xe6d7('0x33')]=_[_0xe6d7('0x31')](_0x1c78b5['model'],qs[_0xe6d7('0x32')](_0x42357c['query'][_0xe6d7('0x32')]));_0x22cd13[_0xe6d7('0x33')]=_0x22cd13[_0xe6d7('0x33')][_0xe6d7('0x34')]?_0x22cd13['attributes']:_0x1c78b5[_0xe6d7('0x2e')];if(_0x42357c['query'][_0xe6d7('0x3e')]){_0x22cd13[_0xe6d7('0x3f')]=[{'all':!![]}];}_0x22cd13=_['merge']({},_0x22cd13,_0x42357c[_0xe6d7('0x3d')]);return db[_0xe6d7('0x29')][_0xe6d7('0x44')](_0x22cd13)[_0xe6d7('0x23')](handleEntityNotFound(_0x284fb5,null))['then'](respondWithResult(_0x284fb5,null))[_0xe6d7('0x41')](handleError(_0x284fb5,null));};exports['create']=function(_0x1f1ec8,_0x7ae004){return db['MailSubstatus'][_0xe6d7('0x45')](_0x1f1ec8[_0xe6d7('0x46')],{})[_0xe6d7('0x23')](respondWithResult(_0x7ae004,0xc9))['catch'](handleError(_0x7ae004,null));};exports[_0xe6d7('0x21')]=function(_0x854358,_0x357025){if(_0x854358[_0xe6d7('0x46')]['id']){delete _0x854358[_0xe6d7('0x46')]['id'];}return db[_0xe6d7('0x29')][_0xe6d7('0x44')]({'where':{'id':_0x854358[_0xe6d7('0x43')]['id']}})[_0xe6d7('0x23')](handleEntityNotFound(_0x357025,null))[_0xe6d7('0x23')](saveUpdates(_0x854358['body'],null))[_0xe6d7('0x23')](respondWithResult(_0x357025,null))['catch'](handleError(_0x357025,null));};exports[_0xe6d7('0x22')]=function(_0x41f7b5,_0x3da70a){return db[_0xe6d7('0x29')][_0xe6d7('0x44')]({'where':{'id':_0x41f7b5[_0xe6d7('0x43')]['id']}})['then'](handleEntityNotFound(_0x3da70a,null))['then'](removeEntity(_0x3da70a,null))['catch'](handleError(_0x3da70a,null));};exports[_0xe6d7('0x47')]=function(_0x345dc7,_0x4c93ec){return db[_0xe6d7('0x29')][_0xe6d7('0x47')]()[_0xe6d7('0x23')](respondWithResult(_0x4c93ec,null))[_0xe6d7('0x41')](handleError(_0x4c93ec,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b855a7c..9db80b1 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 _0xd406=['request-promise','path','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4220a0,_0x31349f){var _0x1e58c9=function(_0xdb5236){while(--_0xdb5236){_0x4220a0['push'](_0x4220a0['shift']());}};_0x1e58c9(++_0x31349f);}(_0xd406,0x14a));var _0x6d40=function(_0x422ed8,_0x4ea6e9){_0x422ed8=_0x422ed8-0x0;var _0x5c01ae=_0xd406[_0x422ed8];return _0x5c01ae;};'use strict';var _=require(_0x6d40('0x0'));var util=require(_0x6d40('0x1'));var logger=require(_0x6d40('0x2'))(_0x6d40('0x3'));var moment=require(_0x6d40('0x4'));var BPromise=require(_0x6d40('0x5'));var rp=require(_0x6d40('0x6'));var fs=require('fs');var path=require(_0x6d40('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d40('0x8'));module['exports']=function(_0xbde2f4,_0x4ec23c){return _0xbde2f4[_0x6d40('0x9')](_0x6d40('0xa'),attributes,{'tableName':_0x6d40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfebc=['util','api','moment','bluebird','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash'];(function(_0x1e9df3,_0x3ec5ea){var _0x4ae252=function(_0x2ac97e){while(--_0x2ac97e){_0x1e9df3['push'](_0x1e9df3['shift']());}};_0x4ae252(++_0x3ec5ea);}(_0xfebc,0x6b));var _0xcfeb=function(_0x3a5fdd,_0x410065){_0x3a5fdd=_0x3a5fdd-0x0;var _0x46fcd6=_0xfebc[_0x3a5fdd];return _0x46fcd6;};'use strict';var _=require(_0xcfeb('0x0'));var util=require(_0xcfeb('0x1'));var logger=require('../../config/logger')(_0xcfeb('0x2'));var moment=require(_0xcfeb('0x3'));var BPromise=require(_0xcfeb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfeb('0x5'));var rimraf=require(_0xcfeb('0x6'));var config=require(_0xcfeb('0x7'));var attributes=require(_0xcfeb('0x8'));module[_0xcfeb('0x9')]=function(_0x5e3dda,_0x537593){return _0x5e3dda[_0xcfeb('0xa')](_0xcfeb('0xb'),attributes,{'tableName':'mail_substatuses','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 1bcee9e..ee1efc8 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 _0xb36e=['request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x454708,_0x496e63){var _0x327a3a=function(_0x26d749){while(--_0x26d749){_0x454708['push'](_0x454708['shift']());}};_0x327a3a(++_0x496e63);}(_0xb36e,0xc3));var _0xeb36=function(_0x480d08,_0x34080f){_0x480d08=_0x480d08-0x0;var _0x5a8037=_0xb36e[_0x480d08];return _0x5a8037;};'use strict';var _=require(_0xeb36('0x0'));var util=require(_0xeb36('0x1'));var moment=require(_0xeb36('0x2'));var BPromise=require(_0xeb36('0x3'));var rs=require(_0xeb36('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb36('0x5'))['db'];var utils=require(_0xeb36('0x6'));var logger=require(_0xeb36('0x7'))(_0xeb36('0x8'));var config=require(_0xeb36('0x9'));var jayson=require(_0xeb36('0xa'));var client=jayson[_0xeb36('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1891fc,_0x538f44,_0x175a2b){return new BPromise(function(_0x2c573c,_0x2eb224){return client['request'](_0x1891fc,_0x175a2b)['then'](function(_0x20a646){logger[_0xeb36('0xc')](_0xeb36('0xd'),_0x538f44,_0xeb36('0xe'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x538f44,_0xeb36('0xe'),JSON['stringify'](_0x20a646));if(_0x20a646[_0xeb36('0xf')]){if(_0x20a646['error'][_0xeb36('0x10')]===0x1f4){logger[_0xeb36('0xf')](_0xeb36('0xd'),_0x538f44,_0x20a646[_0xeb36('0xf')][_0xeb36('0x11')]);return _0x2eb224(_0x20a646[_0xeb36('0xf')][_0xeb36('0x11')]);}logger['error'](_0xeb36('0xd'),_0x538f44,_0x20a646['error'][_0xeb36('0x11')]);return _0x2c573c(_0x20a646[_0xeb36('0xf')][_0xeb36('0x11')]);}else{logger[_0xeb36('0xc')](_0xeb36('0xd'),_0x538f44,'request\x20sent');_0x2c573c(_0x20a646[_0xeb36('0x12')][_0xeb36('0x11')]);}})['catch'](function(_0x55316a){logger[_0xeb36('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x538f44,_0x55316a);_0x2eb224(_0x55316a);});});} \ No newline at end of file +var _0xe527=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5bb207,_0x157700){var _0x4b198e=function(_0x4d6c36){while(--_0x4d6c36){_0x5bb207['push'](_0x5bb207['shift']());}};_0x4b198e(++_0x157700);}(_0xe527,0xaa));var _0x7e52=function(_0x139eb2,_0x5b8ced){_0x139eb2=_0x139eb2-0x0;var _0x3e6086=_0xe527[_0x139eb2];return _0x3e6086;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e52('0x0'));var BPromise=require('bluebird');var rs=require(_0x7e52('0x1'));var fs=require('fs');var Redis=require(_0x7e52('0x2'));var db=require(_0x7e52('0x3'))['db'];var utils=require(_0x7e52('0x4'));var logger=require(_0x7e52('0x5'))('rpc');var config=require(_0x7e52('0x6'));var jayson=require(_0x7e52('0x7'));var client=jayson[_0x7e52('0x8')][_0x7e52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22b817,_0x43b76d,_0x39ad03){return new BPromise(function(_0xd4f14e,_0x2474d0){return client['request'](_0x22b817,_0x39ad03)[_0x7e52('0xa')](function(_0xa51327){logger[_0x7e52('0xb')](_0x7e52('0xc'),_0x43b76d,_0x7e52('0xd'));logger[_0x7e52('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x43b76d,'request\x20sent',JSON[_0x7e52('0xf')](_0xa51327));if(_0xa51327['error']){if(_0xa51327[_0x7e52('0x10')]['code']===0x1f4){logger[_0x7e52('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x43b76d,_0xa51327[_0x7e52('0x10')][_0x7e52('0x11')]);return _0x2474d0(_0xa51327[_0x7e52('0x10')][_0x7e52('0x11')]);}logger[_0x7e52('0x10')](_0x7e52('0xc'),_0x43b76d,_0xa51327[_0x7e52('0x10')]['message']);return _0xd4f14e(_0xa51327[_0x7e52('0x10')][_0x7e52('0x11')]);}else{logger[_0x7e52('0xb')](_0x7e52('0xc'),_0x43b76d,_0x7e52('0xd'));_0xd4f14e(_0xa51327[_0x7e52('0x12')]['message']);}})[_0x7e52('0x13')](function(_0x11e737){logger[_0x7e52('0x10')](_0x7e52('0xc'),_0x43b76d,_0x11e737);_0x2474d0(_0x11e737);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 8810939..6b3ca4b 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 _0x44d4=['post','create','/:id','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x44d4,0x18d));var _0x444d=function(_0x25b6a6,_0x2dd1ce){_0x25b6a6=_0x25b6a6-0x0;var _0x3e0d14=_0x44d4[_0x25b6a6];return _0x3e0d14;};'use strict';var multer=require(_0x444d('0x0'));var util=require(_0x444d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x444d('0x2'));var router=express['Router']();var fs_extra=require(_0x444d('0x3'));var auth=require(_0x444d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x444d('0x5'));router[_0x444d('0x6')]('/',auth[_0x444d('0x7')](),controller['index']);router[_0x444d('0x6')](_0x444d('0x8'),auth[_0x444d('0x7')](),controller[_0x444d('0x9')]);router[_0x444d('0x6')]('/:id',auth[_0x444d('0x7')](),controller[_0x444d('0xa')]);router[_0x444d('0xb')]('/',auth[_0x444d('0x7')](),controller[_0x444d('0xc')]);router['put'](_0x444d('0xd'),auth[_0x444d('0x7')](),controller[_0x444d('0xe')]);router[_0x444d('0xf')](_0x444d('0xd'),auth[_0x444d('0x7')](),controller[_0x444d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0ad3=['../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b8524,_0x1bb669){var _0x81418d=function(_0x5f5795){while(--_0x5f5795){_0x1b8524['push'](_0x1b8524['shift']());}};_0x81418d(++_0x1bb669);}(_0x0ad3,0x161));var _0x30ad=function(_0x680b65,_0x5b2e9c){_0x680b65=_0x680b65-0x0;var _0x1c2053=_0x0ad3[_0x680b65];return _0x1c2053;};'use strict';var multer=require(_0x30ad('0x0'));var util=require('util');var path=require(_0x30ad('0x1'));var timeout=require(_0x30ad('0x2'));var express=require(_0x30ad('0x3'));var router=express['Router']();var fs_extra=require(_0x30ad('0x4'));var auth=require(_0x30ad('0x5'));var interaction=require(_0x30ad('0x6'));var config=require(_0x30ad('0x7'));var controller=require(_0x30ad('0x8'));router['get']('/',auth[_0x30ad('0x9')](),controller['index']);router[_0x30ad('0xa')](_0x30ad('0xb'),auth[_0x30ad('0x9')](),controller[_0x30ad('0xc')]);router[_0x30ad('0xa')](_0x30ad('0xd'),auth[_0x30ad('0x9')](),controller['show']);router[_0x30ad('0xe')]('/',auth[_0x30ad('0x9')](),controller['create']);router[_0x30ad('0xf')]('/:id',auth[_0x30ad('0x9')](),controller[_0x30ad('0x10')]);router[_0x30ad('0x11')](_0x30ad('0xd'),auth[_0x30ad('0x9')](),controller[_0x30ad('0x12')]);module[_0x30ad('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 3669635..4f0df7a 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2f8db7,_0x5a7566){var _0x5c1d7e=function(_0x5910a6){while(--_0x5910a6){_0x2f8db7['push'](_0x2f8db7['shift']());}};_0x5c1d7e(++_0x5a7566);}(_0x34e8,0x12c));var _0x834e=function(_0x1c560d,_0x5ce590){_0x1c560d=_0x1c560d-0x0;var _0x3e7198=_0x34e8[_0x1c560d];return _0x3e7198;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x333bc7,_0x4a50fd){var _0x5c2ea3=function(_0x2359e0){while(--_0x2359e0){_0x333bc7['push'](_0x333bc7['shift']());}};_0x5c2ea3(++_0x4a50fd);}(_0xaa88,0x137));var _0x8aa8=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xaa88[_0x3ee55a];return _0x581800;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index dd988fa..42a1e11 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 _0x26c4=['filter','options','includeAll','findAll','filters','fields','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','reject','save','update','then','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','order','sort','where','pick','merge','VIRTUAL'];(function(_0x209c05,_0x111ae4){var _0x289583=function(_0x12e0cf){while(--_0x12e0cf){_0x209c05['push'](_0x209c05['shift']());}};_0x289583(++_0x111ae4);}(_0x26c4,0x175));var _0x426c=function(_0x11ae7e,_0x5a2095){_0x11ae7e=_0x11ae7e-0x0;var _0x44c743=_0x26c4[_0x11ae7e];return _0x44c743;};'use strict';var emlformat=require(_0x426c('0x0'));var rimraf=require(_0x426c('0x1'));var zipdir=require(_0x426c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x426c('0x3'));var moment=require(_0x426c('0x4'));var BPromise=require(_0x426c('0x5'));var Mustache=require(_0x426c('0x6'));var util=require(_0x426c('0x7'));var path=require(_0x426c('0x8'));var sox=require('sox');var csv=require(_0x426c('0x9'));var ejs=require(_0x426c('0xa'));var fs=require('fs');var fs_extra=require(_0x426c('0xb'));var _=require(_0x426c('0xc'));var squel=require(_0x426c('0xd'));var crypto=require(_0x426c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x426c('0xf'));var toCsv=require(_0x426c('0x9'));var querystring=require(_0x426c('0x10'));var Papa=require('papaparse');var Redis=require(_0x426c('0x11'));var authService=require(_0x426c('0x12'));var qs=require(_0x426c('0x13'));var as=require(_0x426c('0x14'));var hardwareService=require(_0x426c('0x15'));var logger=require(_0x426c('0x16'))(_0x426c('0x17'));var utils=require('../../config/utils');var config=require(_0x426c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x426c('0x19'))['db'];function respondWithStatusCode(_0x42743d,_0x9c5e8f){_0x9c5e8f=_0x9c5e8f||0xcc;return function(_0x3cd51e){if(_0x3cd51e){return _0x42743d[_0x426c('0x1a')](_0x9c5e8f);}return _0x42743d[_0x426c('0x1b')](_0x9c5e8f)['end']();};}function respondWithResult(_0x3d138c,_0x5ef748){_0x5ef748=_0x5ef748||0xc8;return function(_0x28b4dd){if(_0x28b4dd){return _0x3d138c[_0x426c('0x1b')](_0x5ef748)['json'](_0x28b4dd);}};}function respondWithFilteredResult(_0x3d73de,_0x1161dd){return function(_0x1465e8){if(_0x1465e8){var _0x5c7945=typeof _0x1161dd['offset']===_0x426c('0x1c')&&typeof _0x1161dd[_0x426c('0x1d')]===_0x426c('0x1c');var _0xb3a7ab=_0x1465e8[_0x426c('0x1e')];var _0x34551f=_0x5c7945?0x0:_0x1161dd[_0x426c('0x1f')];var _0x2f6d51=_0x5c7945?_0x1465e8['count']:_0x1161dd[_0x426c('0x1f')]+_0x1161dd[_0x426c('0x1d')];var _0x5e267c;if(_0x2f6d51>=_0xb3a7ab){_0x2f6d51=_0xb3a7ab;_0x5e267c=0xc8;}else{_0x5e267c=0xce;}_0x3d73de[_0x426c('0x1b')](_0x5e267c);return _0x3d73de[_0x426c('0x20')]('Content-Range',_0x34551f+'-'+_0x2f6d51+'/'+_0xb3a7ab)['json'](_0x1465e8);}return null;};}function patchUpdates(_0x17bb1c){return function(_0x370873){try{jsonpatch['apply'](_0x370873,_0x17bb1c,!![]);}catch(_0x11e9fe){return BPromise[_0x426c('0x21')](_0x11e9fe);}return _0x370873[_0x426c('0x22')]();};}function saveUpdates(_0x1ce61d,_0x219701){return function(_0xc1f68b){if(_0xc1f68b){return _0xc1f68b[_0x426c('0x23')](_0x1ce61d)[_0x426c('0x24')](function(_0x2ade4c){return _0x2ade4c;});}return null;};}function removeEntity(_0x276c16,_0x363a61){return function(_0x2daeb5){if(_0x2daeb5){return _0x2daeb5['destroy']()['then'](function(){_0x276c16[_0x426c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4100ed,_0x77106d){return function(_0x3b9d7d){if(!_0x3b9d7d){_0x4100ed[_0x426c('0x1a')](0x194);}return _0x3b9d7d;};}function handleError(_0x33ae14,_0xbe4c4c){_0xbe4c4c=_0xbe4c4c||0x1f4;return function(_0x2df12c){logger[_0x426c('0x25')](_0x2df12c[_0x426c('0x26')]);if(_0x2df12c[_0x426c('0x27')]){delete _0x2df12c[_0x426c('0x27')];}_0x33ae14[_0x426c('0x1b')](_0xbe4c4c)[_0x426c('0x28')](_0x2df12c);};}exports['index']=function(_0x4e0582,_0x446ae4){var _0x2f7d63={},_0x18f3d2={},_0x5744a7={'count':0x0,'rows':[]};var _0x379c1f=_[_0x426c('0x29')](db[_0x426c('0x2a')][_0x426c('0x2b')],function(_0x88bd7f){return{'name':_0x88bd7f[_0x426c('0x2c')],'type':_0x88bd7f[_0x426c('0x2d')][_0x426c('0x2e')]};});_0x18f3d2['model']=_['map'](_0x379c1f,_0x426c('0x27'));_0x18f3d2[_0x426c('0x2f')]=_[_0x426c('0x30')](_0x4e0582[_0x426c('0x2f')]);_0x18f3d2['filters']=_[_0x426c('0x31')](_0x18f3d2[_0x426c('0x32')],_0x18f3d2[_0x426c('0x2f')]);_0x2f7d63['attributes']=_[_0x426c('0x31')](_0x18f3d2[_0x426c('0x32')],qs['fields'](_0x4e0582['query']['fields']));_0x2f7d63[_0x426c('0x33')]=_0x2f7d63[_0x426c('0x33')][_0x426c('0x34')]?_0x2f7d63[_0x426c('0x33')]:_0x18f3d2[_0x426c('0x32')];if(!_0x4e0582[_0x426c('0x2f')]['hasOwnProperty']('nolimit')){_0x2f7d63[_0x426c('0x1d')]=qs[_0x426c('0x1d')](_0x4e0582[_0x426c('0x2f')][_0x426c('0x1d')]);_0x2f7d63[_0x426c('0x1f')]=qs[_0x426c('0x1f')](_0x4e0582[_0x426c('0x2f')][_0x426c('0x1f')]);}_0x2f7d63[_0x426c('0x35')]=qs[_0x426c('0x36')](_0x4e0582['query'][_0x426c('0x36')]);_0x2f7d63[_0x426c('0x37')]=qs['filters'](_[_0x426c('0x38')](_0x4e0582['query'],_0x18f3d2['filters']),_0x379c1f);if(_0x4e0582[_0x426c('0x2f')]['filter']){_0x2f7d63[_0x426c('0x37')]=_[_0x426c('0x39')](_0x2f7d63[_0x426c('0x37')],{'$or':_[_0x426c('0x29')](_0x379c1f,function(_0x100cba){if(_0x100cba[_0x426c('0x2d')]!==_0x426c('0x3a')){var _0x42a0f0={};_0x42a0f0[_0x100cba[_0x426c('0x27')]]={'$like':'%'+_0x4e0582[_0x426c('0x2f')][_0x426c('0x3b')]+'%'};return _0x42a0f0;}})});}_0x2f7d63=_['merge']({},_0x2f7d63,_0x4e0582[_0x426c('0x3c')]);var _0x1521c5={'where':_0x2f7d63['where']};return db[_0x426c('0x2a')]['count'](_0x1521c5)[_0x426c('0x24')](function(_0x2f9092){_0x5744a7[_0x426c('0x1e')]=_0x2f9092;if(_0x4e0582[_0x426c('0x2f')][_0x426c('0x3d')]){_0x2f7d63['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x426c('0x3e')](_0x2f7d63);})[_0x426c('0x24')](function(_0x11f9f1){_0x5744a7['rows']=_0x11f9f1;return _0x5744a7;})['then'](respondWithFilteredResult(_0x446ae4,_0x2f7d63))['catch'](handleError(_0x446ae4,null));};exports['show']=function(_0xd0a553,_0x3cf3cc){var _0x19d816={'raw':!![],'where':{'id':_0xd0a553['params']['id']}},_0x54e58c={};_0x54e58c[_0x426c('0x32')]=_[_0x426c('0x30')](db['MailTransferReport'][_0x426c('0x2b')]);_0x54e58c[_0x426c('0x2f')]=_[_0x426c('0x30')](_0xd0a553['query']);_0x54e58c[_0x426c('0x3f')]=_[_0x426c('0x31')](_0x54e58c['model'],_0x54e58c['query']);_0x19d816[_0x426c('0x33')]=_[_0x426c('0x31')](_0x54e58c['model'],qs['fields'](_0xd0a553[_0x426c('0x2f')][_0x426c('0x40')]));_0x19d816[_0x426c('0x33')]=_0x19d816[_0x426c('0x33')][_0x426c('0x34')]?_0x19d816['attributes']:_0x54e58c[_0x426c('0x32')];if(_0xd0a553['query']['includeAll']){_0x19d816['include']=[{'all':!![]}];}_0x19d816=_[_0x426c('0x39')]({},_0x19d816,_0xd0a553[_0x426c('0x3c')]);return db[_0x426c('0x2a')][_0x426c('0x41')](_0x19d816)[_0x426c('0x24')](handleEntityNotFound(_0x3cf3cc,null))[_0x426c('0x24')](respondWithResult(_0x3cf3cc,null))[_0x426c('0x42')](handleError(_0x3cf3cc,null));};exports['create']=function(_0x34baa4,_0x510f08){return db['MailTransferReport'][_0x426c('0x43')](_0x34baa4[_0x426c('0x44')],{})['then'](respondWithResult(_0x510f08,0xc9))[_0x426c('0x42')](handleError(_0x510f08,null));};exports[_0x426c('0x23')]=function(_0x40efbf,_0x3bf44a){if(_0x40efbf['body']['id']){delete _0x40efbf[_0x426c('0x44')]['id'];}return db['MailTransferReport'][_0x426c('0x41')]({'where':{'id':_0x40efbf[_0x426c('0x45')]['id']}})[_0x426c('0x24')](handleEntityNotFound(_0x3bf44a,null))['then'](saveUpdates(_0x40efbf['body'],null))[_0x426c('0x24')](respondWithResult(_0x3bf44a,null))[_0x426c('0x42')](handleError(_0x3bf44a,null));};exports[_0x426c('0x46')]=function(_0x55c83a,_0x173fe1){return db['MailTransferReport'][_0x426c('0x41')]({'where':{'id':_0x55c83a[_0x426c('0x45')]['id']}})[_0x426c('0x24')](handleEntityNotFound(_0x173fe1,null))[_0x426c('0x24')](removeEntity(_0x173fe1,null))['catch'](handleError(_0x173fe1,null));};exports[_0x426c('0x47')]=function(_0x30c4ec,_0x1befe9){return db['MailTransferReport'][_0x426c('0x47')]()['then'](respondWithResult(_0x1befe9,null))[_0x426c('0x42')](handleError(_0x1befe9,null));}; \ No newline at end of file +var _0xe903=['order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','MailTransferReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0xe903,0x1e1));var _0x3e90=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xe903[_0x455c6c];return _0x488242;};'use strict';var emlformat=require(_0x3e90('0x0'));var rimraf=require(_0x3e90('0x1'));var zipdir=require(_0x3e90('0x2'));var jsonpatch=require(_0x3e90('0x3'));var rp=require(_0x3e90('0x4'));var moment=require('moment');var BPromise=require(_0x3e90('0x5'));var Mustache=require(_0x3e90('0x6'));var util=require(_0x3e90('0x7'));var path=require(_0x3e90('0x8'));var sox=require(_0x3e90('0x9'));var csv=require(_0x3e90('0xa'));var ejs=require(_0x3e90('0xb'));var fs=require('fs');var fs_extra=require(_0x3e90('0xc'));var _=require(_0x3e90('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3e90('0xe'));var deskjs=require(_0x3e90('0xf'));var toCsv=require(_0x3e90('0xa'));var querystring=require(_0x3e90('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e90('0x11'));var qs=require(_0x3e90('0x12'));var as=require(_0x3e90('0x13'));var hardwareService=require(_0x3e90('0x14'));var logger=require('../../config/logger')(_0x3e90('0x15'));var utils=require('../../config/utils');var config=require(_0x3e90('0x16'));var licenseUtil=require(_0x3e90('0x17'));var db=require(_0x3e90('0x18'))['db'];function respondWithStatusCode(_0x5602aa,_0x2e7dd8){_0x2e7dd8=_0x2e7dd8||0xcc;return function(_0x3bfa17){if(_0x3bfa17){return _0x5602aa[_0x3e90('0x19')](_0x2e7dd8);}return _0x5602aa[_0x3e90('0x1a')](_0x2e7dd8)[_0x3e90('0x1b')]();};}function respondWithResult(_0x1e76ed,_0x559bd4){_0x559bd4=_0x559bd4||0xc8;return function(_0x5c6c35){if(_0x5c6c35){return _0x1e76ed[_0x3e90('0x1a')](_0x559bd4)['json'](_0x5c6c35);}};}function respondWithFilteredResult(_0xba33ba,_0x390a99){return function(_0x67125d){if(_0x67125d){var _0x4ee436=typeof _0x390a99[_0x3e90('0x1c')]===_0x3e90('0x1d')&&typeof _0x390a99['limit']===_0x3e90('0x1d');var _0x5ced59=_0x67125d[_0x3e90('0x1e')];var _0x2cb9c5=_0x4ee436?0x0:_0x390a99[_0x3e90('0x1c')];var _0x2d01f4=_0x4ee436?_0x67125d[_0x3e90('0x1e')]:_0x390a99[_0x3e90('0x1c')]+_0x390a99['limit'];var _0xd69c2b;if(_0x2d01f4>=_0x5ced59){_0x2d01f4=_0x5ced59;_0xd69c2b=0xc8;}else{_0xd69c2b=0xce;}_0xba33ba['status'](_0xd69c2b);return _0xba33ba[_0x3e90('0x1f')](_0x3e90('0x20'),_0x2cb9c5+'-'+_0x2d01f4+'/'+_0x5ced59)[_0x3e90('0x21')](_0x67125d);}return null;};}function patchUpdates(_0x3ba0d1){return function(_0x2c3e0d){try{jsonpatch['apply'](_0x2c3e0d,_0x3ba0d1,!![]);}catch(_0x254467){return BPromise[_0x3e90('0x22')](_0x254467);}return _0x2c3e0d[_0x3e90('0x23')]();};}function saveUpdates(_0x36cf14,_0x29ea2e){return function(_0x2f6db0){if(_0x2f6db0){return _0x2f6db0[_0x3e90('0x24')](_0x36cf14)[_0x3e90('0x25')](function(_0x4bf58f){return _0x4bf58f;});}return null;};}function removeEntity(_0x2911a0,_0x239c3c){return function(_0x547938){if(_0x547938){return _0x547938['destroy']()[_0x3e90('0x25')](function(){_0x2911a0[_0x3e90('0x1a')](0xcc)[_0x3e90('0x1b')]();});}};}function handleEntityNotFound(_0x50b7af,_0x3d2754){return function(_0x5b4d7a){if(!_0x5b4d7a){_0x50b7af[_0x3e90('0x19')](0x194);}return _0x5b4d7a;};}function handleError(_0x556008,_0xd0dee0){_0xd0dee0=_0xd0dee0||0x1f4;return function(_0x588ea9){logger[_0x3e90('0x26')](_0x588ea9[_0x3e90('0x27')]);if(_0x588ea9[_0x3e90('0x28')]){delete _0x588ea9[_0x3e90('0x28')];}_0x556008['status'](_0xd0dee0)[_0x3e90('0x29')](_0x588ea9);};}exports['index']=function(_0x12d0ad,_0x38890e){var _0x3745dc={},_0x198054={},_0x459c32={'count':0x0,'rows':[]};var _0x2c84b3=_['map'](db[_0x3e90('0x2a')][_0x3e90('0x2b')],function(_0x26a485){return{'name':_0x26a485['fieldName'],'type':_0x26a485[_0x3e90('0x2c')][_0x3e90('0x2d')]};});_0x198054[_0x3e90('0x2e')]=_[_0x3e90('0x2f')](_0x2c84b3,'name');_0x198054['query']=_[_0x3e90('0x30')](_0x12d0ad[_0x3e90('0x31')]);_0x198054[_0x3e90('0x32')]=_[_0x3e90('0x33')](_0x198054[_0x3e90('0x2e')],_0x198054[_0x3e90('0x31')]);_0x3745dc[_0x3e90('0x34')]=_[_0x3e90('0x33')](_0x198054[_0x3e90('0x2e')],qs[_0x3e90('0x35')](_0x12d0ad[_0x3e90('0x31')]['fields']));_0x3745dc[_0x3e90('0x34')]=_0x3745dc['attributes'][_0x3e90('0x36')]?_0x3745dc[_0x3e90('0x34')]:_0x198054[_0x3e90('0x2e')];if(!_0x12d0ad['query'][_0x3e90('0x37')](_0x3e90('0x38'))){_0x3745dc[_0x3e90('0x39')]=qs['limit'](_0x12d0ad['query'][_0x3e90('0x39')]);_0x3745dc[_0x3e90('0x1c')]=qs[_0x3e90('0x1c')](_0x12d0ad[_0x3e90('0x31')][_0x3e90('0x1c')]);}_0x3745dc[_0x3e90('0x3a')]=qs['sort'](_0x12d0ad[_0x3e90('0x31')][_0x3e90('0x3b')]);_0x3745dc['where']=qs['filters'](_[_0x3e90('0x3c')](_0x12d0ad[_0x3e90('0x31')],_0x198054['filters']),_0x2c84b3);if(_0x12d0ad[_0x3e90('0x31')][_0x3e90('0x3d')]){_0x3745dc[_0x3e90('0x3e')]=_[_0x3e90('0x3f')](_0x3745dc[_0x3e90('0x3e')],{'$or':_[_0x3e90('0x2f')](_0x2c84b3,function(_0x1caff2){if(_0x1caff2['type']!==_0x3e90('0x40')){var _0x19d392={};_0x19d392[_0x1caff2['name']]={'$like':'%'+_0x12d0ad[_0x3e90('0x31')][_0x3e90('0x3d')]+'%'};return _0x19d392;}})});}_0x3745dc=_[_0x3e90('0x3f')]({},_0x3745dc,_0x12d0ad[_0x3e90('0x41')]);var _0x305747={'where':_0x3745dc[_0x3e90('0x3e')]};return db[_0x3e90('0x2a')][_0x3e90('0x1e')](_0x305747)[_0x3e90('0x25')](function(_0x2832dc){_0x459c32[_0x3e90('0x1e')]=_0x2832dc;if(_0x12d0ad['query']['includeAll']){_0x3745dc['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x3e90('0x42')](_0x3745dc);})['then'](function(_0xdc6cd7){_0x459c32[_0x3e90('0x43')]=_0xdc6cd7;return _0x459c32;})[_0x3e90('0x25')](respondWithFilteredResult(_0x38890e,_0x3745dc))[_0x3e90('0x44')](handleError(_0x38890e,null));};exports[_0x3e90('0x45')]=function(_0x21286b,_0x2cfb8e){var _0x9539ec={'raw':!![],'where':{'id':_0x21286b['params']['id']}},_0x3068ca={};_0x3068ca[_0x3e90('0x2e')]=_[_0x3e90('0x30')](db[_0x3e90('0x2a')][_0x3e90('0x2b')]);_0x3068ca[_0x3e90('0x31')]=_[_0x3e90('0x30')](_0x21286b[_0x3e90('0x31')]);_0x3068ca['filters']=_[_0x3e90('0x33')](_0x3068ca[_0x3e90('0x2e')],_0x3068ca[_0x3e90('0x31')]);_0x9539ec[_0x3e90('0x34')]=_['intersection'](_0x3068ca[_0x3e90('0x2e')],qs[_0x3e90('0x35')](_0x21286b[_0x3e90('0x31')][_0x3e90('0x35')]));_0x9539ec[_0x3e90('0x34')]=_0x9539ec[_0x3e90('0x34')]['length']?_0x9539ec[_0x3e90('0x34')]:_0x3068ca[_0x3e90('0x2e')];if(_0x21286b[_0x3e90('0x31')][_0x3e90('0x46')]){_0x9539ec[_0x3e90('0x47')]=[{'all':!![]}];}_0x9539ec=_[_0x3e90('0x3f')]({},_0x9539ec,_0x21286b['options']);return db[_0x3e90('0x2a')][_0x3e90('0x48')](_0x9539ec)['then'](handleEntityNotFound(_0x2cfb8e,null))[_0x3e90('0x25')](respondWithResult(_0x2cfb8e,null))[_0x3e90('0x44')](handleError(_0x2cfb8e,null));};exports[_0x3e90('0x49')]=function(_0x4dfa1c,_0x116edf){return db[_0x3e90('0x2a')][_0x3e90('0x49')](_0x4dfa1c['body'],{})[_0x3e90('0x25')](respondWithResult(_0x116edf,0xc9))[_0x3e90('0x44')](handleError(_0x116edf,null));};exports[_0x3e90('0x24')]=function(_0xdca136,_0x67bd13){if(_0xdca136[_0x3e90('0x4a')]['id']){delete _0xdca136[_0x3e90('0x4a')]['id'];}return db[_0x3e90('0x2a')][_0x3e90('0x48')]({'where':{'id':_0xdca136[_0x3e90('0x4b')]['id']}})['then'](handleEntityNotFound(_0x67bd13,null))[_0x3e90('0x25')](saveUpdates(_0xdca136['body'],null))[_0x3e90('0x25')](respondWithResult(_0x67bd13,null))['catch'](handleError(_0x67bd13,null));};exports['destroy']=function(_0x2c1f7d,_0x297cba){return db['MailTransferReport']['find']({'where':{'id':_0x2c1f7d[_0x3e90('0x4b')]['id']}})[_0x3e90('0x25')](handleEntityNotFound(_0x297cba,null))[_0x3e90('0x25')](removeEntity(_0x297cba,null))[_0x3e90('0x44')](handleError(_0x297cba,null));};exports[_0x3e90('0x4c')]=function(_0x4edd7f,_0x2fed30){return db['MailTransferReport'][_0x3e90('0x4c')]()['then'](respondWithResult(_0x2fed30,null))[_0x3e90('0x44')](handleError(_0x2fed30,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5b20bf1..034619c 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 _0x4b0c=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x425af8,_0x366c35){var _0x5c2eb1=function(_0x44785f){while(--_0x44785f){_0x425af8['push'](_0x425af8['shift']());}};_0x5c2eb1(++_0x366c35);}(_0x4b0c,0x138));var _0xc4b0=function(_0x39d4e1,_0x57ca19){_0x39d4e1=_0x39d4e1-0x0;var _0x451c9e=_0x4b0c[_0x39d4e1];return _0x451c9e;};'use strict';var _=require(_0xc4b0('0x0'));var util=require('util');var logger=require(_0xc4b0('0x1'))(_0xc4b0('0x2'));var moment=require('moment');var BPromise=require(_0xc4b0('0x3'));var rp=require(_0xc4b0('0x4'));var fs=require('fs');var path=require(_0xc4b0('0x5'));var rimraf=require(_0xc4b0('0x6'));var config=require(_0xc4b0('0x7'));var attributes=require(_0xc4b0('0x8'));module[_0xc4b0('0x9')]=function(_0x138527,_0x563c49){return _0x138527[_0xc4b0('0xa')](_0xc4b0('0xb'),attributes,{'tableName':_0xc4b0('0xc'),'paranoid':![],'indexes':[{'name':_0xc4b0('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xeb3a=['exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x514e1a,_0x61e551){var _0x3c3ee1=function(_0x32ee9e){while(--_0x32ee9e){_0x514e1a['push'](_0x514e1a['shift']());}};_0x3c3ee1(++_0x61e551);}(_0xeb3a,0x12f));var _0xaeb3=function(_0x5baa08,_0x99a3e4){_0x5baa08=_0x5baa08-0x0;var _0x553691=_0xeb3a[_0x5baa08];return _0x553691;};'use strict';var _=require(_0xaeb3('0x0'));var util=require(_0xaeb3('0x1'));var logger=require(_0xaeb3('0x2'))(_0xaeb3('0x3'));var moment=require(_0xaeb3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb3('0x5'));var rimraf=require(_0xaeb3('0x6'));var config=require(_0xaeb3('0x7'));var attributes=require(_0xaeb3('0x8'));module[_0xaeb3('0x9')]=function(_0x45d14c,_0x1fdc7c){return _0x45d14c[_0xaeb3('0xa')]('MailTransferReport',attributes,{'tableName':_0xaeb3('0xb'),'paranoid':![],'indexes':[{'name':_0xaeb3('0xc'),'fields':[_0xaeb3('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 1458cca..39177cb 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 _0xbe64=['stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','http','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3180f5,_0x35a5f1){var _0x49bb78=function(_0x5bd1f7){while(--_0x5bd1f7){_0x3180f5['push'](_0x3180f5['shift']());}};_0x49bb78(++_0x35a5f1);}(_0xbe64,0x123));var _0x4be6=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xbe64[_0x421196];return _0x2738af;};'use strict';var _=require(_0x4be6('0x0'));var util=require(_0x4be6('0x1'));var moment=require(_0x4be6('0x2'));var BPromise=require(_0x4be6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4be6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4be6('0x5'));var logger=require('../../config/logger')(_0x4be6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4be6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x229f83,_0x48423b,_0x2310c6){return new BPromise(function(_0x376db4,_0x4829df){return client['request'](_0x229f83,_0x2310c6)[_0x4be6('0x8')](function(_0x389153){logger[_0x4be6('0x9')]('MailTransferReport,\x20%s,\x20%s',_0x48423b,_0x4be6('0xa'));logger[_0x4be6('0xb')](_0x4be6('0xc'),_0x48423b,_0x4be6('0xa'),JSON[_0x4be6('0xd')](_0x389153));if(_0x389153[_0x4be6('0xe')]){if(_0x389153[_0x4be6('0xe')][_0x4be6('0xf')]===0x1f4){logger[_0x4be6('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x48423b,_0x389153['error'][_0x4be6('0x10')]);return _0x4829df(_0x389153[_0x4be6('0xe')][_0x4be6('0x10')]);}logger[_0x4be6('0xe')](_0x4be6('0x11'),_0x48423b,_0x389153[_0x4be6('0xe')]['message']);return _0x376db4(_0x389153['error']['message']);}else{logger[_0x4be6('0x9')](_0x4be6('0x11'),_0x48423b,_0x4be6('0xa'));_0x376db4(_0x389153['result'][_0x4be6('0x10')]);}})[_0x4be6('0x12')](function(_0x4d6ea4){logger[_0x4be6('0xe')](_0x4be6('0x11'),_0x48423b,_0x4d6ea4);_0x4829df(_0x4d6ea4);});});} \ No newline at end of file +var _0xcbbf=['client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30a5b5,_0x21e05e){var _0x58e1c4=function(_0x67af6f){while(--_0x67af6f){_0x30a5b5['push'](_0x30a5b5['shift']());}};_0x58e1c4(++_0x21e05e);}(_0xcbbf,0x14e));var _0xfcbb=function(_0x3af78f,_0x424e4f){_0x3af78f=_0x3af78f-0x0;var _0x4d3637=_0xcbbf[_0x3af78f];return _0x4d3637;};'use strict';var _=require(_0xfcbb('0x0'));var util=require(_0xfcbb('0x1'));var moment=require(_0xfcbb('0x2'));var BPromise=require(_0xfcbb('0x3'));var rs=require(_0xfcbb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcbb('0x5'))['db'];var utils=require(_0xfcbb('0x6'));var logger=require(_0xfcbb('0x7'))(_0xfcbb('0x8'));var config=require(_0xfcbb('0x9'));var jayson=require(_0xfcbb('0xa'));var client=jayson[_0xfcbb('0xb')][_0xfcbb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d8313,_0x22ae2b,_0x18f606){return new BPromise(function(_0x4346ad,_0x263b2f){return client[_0xfcbb('0xd')](_0x5d8313,_0x18f606)[_0xfcbb('0xe')](function(_0x44c923){logger[_0xfcbb('0xf')](_0xfcbb('0x10'),_0x22ae2b,_0xfcbb('0x11'));logger[_0xfcbb('0x12')](_0xfcbb('0x13'),_0x22ae2b,_0xfcbb('0x11'),JSON[_0xfcbb('0x14')](_0x44c923));if(_0x44c923[_0xfcbb('0x15')]){if(_0x44c923[_0xfcbb('0x15')]['code']===0x1f4){logger[_0xfcbb('0x15')](_0xfcbb('0x10'),_0x22ae2b,_0x44c923[_0xfcbb('0x15')][_0xfcbb('0x16')]);return _0x263b2f(_0x44c923[_0xfcbb('0x15')][_0xfcbb('0x16')]);}logger[_0xfcbb('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x22ae2b,_0x44c923[_0xfcbb('0x15')][_0xfcbb('0x16')]);return _0x4346ad(_0x44c923[_0xfcbb('0x15')][_0xfcbb('0x16')]);}else{logger[_0xfcbb('0xf')](_0xfcbb('0x10'),_0x22ae2b,_0xfcbb('0x11'));_0x4346ad(_0x44c923['result'][_0xfcbb('0x16')]);}})['catch'](function(_0x8e0bbe){logger[_0xfcbb('0x15')](_0xfcbb('0x10'),_0x22ae2b,_0x8e0bbe);_0x263b2f(_0x8e0bbe);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 9cac8d8..897975e 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 _0x207c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','put','update','delete','util'];(function(_0x1a9abe,_0x4c4dcd){var _0x583d81=function(_0x237269){while(--_0x237269){_0x1a9abe['push'](_0x1a9abe['shift']());}};_0x583d81(++_0x4c4dcd);}(_0x207c,0x17b));var _0xc207=function(_0x51f5f7,_0x4e1492){_0x51f5f7=_0x51f5f7-0x0;var _0x6afaa=_0x207c[_0x51f5f7];return _0x6afaa;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require('path');var timeout=require(_0xc207('0x1'));var express=require(_0xc207('0x2'));var router=express[_0xc207('0x3')]();var fs_extra=require(_0xc207('0x4'));var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require(_0xc207('0x7'));var controller=require('./memberReport.controller');router['get']('/',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router['get'](_0xc207('0xa'),auth[_0xc207('0x8')](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')]('/',auth[_0xc207('0x8')](),controller['create']);router[_0xc207('0x10')]('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x11')]);router[_0xc207('0x12')]('/:id',auth[_0xc207('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x532f=['show','post','isAuthenticated','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','index','/describe','get','/:id'];(function(_0x3e20cb,_0x4b8ca3){var _0x1ec7aa=function(_0xb41a5e){while(--_0xb41a5e){_0x3e20cb['push'](_0x3e20cb['shift']());}};_0x1ec7aa(++_0x4b8ca3);}(_0x532f,0x1a9));var _0xf532=function(_0x479e82,_0xe6a054){_0x479e82=_0x479e82-0x0;var _0x4bfe85=_0x532f[_0x479e82];return _0x4bfe85;};'use strict';var multer=require(_0xf532('0x0'));var util=require(_0xf532('0x1'));var path=require(_0xf532('0x2'));var timeout=require(_0xf532('0x3'));var express=require(_0xf532('0x4'));var router=express[_0xf532('0x5')]();var fs_extra=require(_0xf532('0x6'));var auth=require(_0xf532('0x7'));var interaction=require(_0xf532('0x8'));var config=require(_0xf532('0x9'));var controller=require(_0xf532('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xf532('0xb')]);router['get'](_0xf532('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xf532('0xd')](_0xf532('0xe'),auth['isAuthenticated'](),controller[_0xf532('0xf')]);router[_0xf532('0x10')]('/',auth[_0xf532('0x11')](),controller[_0xf532('0x12')]);router['put'](_0xf532('0xe'),auth[_0xf532('0x11')](),controller[_0xf532('0x13')]);router[_0xf532('0x14')](_0xf532('0xe'),auth[_0xf532('0x11')](),controller['destroy']);module[_0xf532('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 72860f4..3d28df4 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 _0xe2cc=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x4c3de9,_0x36c480){var _0x207428=function(_0x4c52fa){while(--_0x4c52fa){_0x4c3de9['push'](_0x4c3de9['shift']());}};_0x207428(++_0x36c480);}(_0xe2cc,0x69));var _0xce2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2cc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xce2c('0x0'));var moment=require(_0xce2c('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xce2c('0x2')]},'interface':{'type':Sequelize[_0xce2c('0x2')]},'type':{'type':Sequelize[_0xce2c('0x2')],'defaultValue':_0xce2c('0x3'),'comment':_0xce2c('0x4')},'duration':{'type':Sequelize[_0xce2c('0x5')]},'enterAt':{'type':Sequelize[_0xce2c('0x6')]},'exitAt':{'type':Sequelize[_0xce2c('0x6')],'set':function(_0x592e10){var _0x51e5d0=moment(_0x592e10);var _0x14bb4e=moment(this[_0xce2c('0x7')](_0xce2c('0x8')));var _0x29632b=_0x51e5d0[_0xce2c('0x9')](_0x14bb4e,_0xce2c('0xa'));this['setDataValue'](_0xce2c('0xb'),_0x592e10);this[_0xce2c('0xc')](_0xce2c('0xd'),_0x29632b||null);}},'data1':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0xe')},'data2':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0xf')},'data3':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0x10')},'data4':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0x11')},'data5':{'type':Sequelize[_0xce2c('0x2')],'comment':_0xce2c('0x12')},'role':{'type':Sequelize[_0xce2c('0x2')]},'internal':{'type':Sequelize[_0xce2c('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x48ea=['INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x2e8889,_0xcd72f9){var _0x19dae6=function(_0x4a7100){while(--_0x4a7100){_0x2e8889['push'](_0x2e8889['shift']());}};_0x19dae6(++_0xcd72f9);}(_0x48ea,0x9c));var _0xa48e=function(_0x380085,_0x228a75){_0x380085=_0x380085-0x0;var _0x43b7b4=_0x48ea[_0x380085];return _0x43b7b4;};'use strict';var Sequelize=require(_0xa48e('0x0'));var moment=require('moment');module[_0xa48e('0x1')]={'channel':{'type':Sequelize[_0xa48e('0x2')]},'membername':{'type':Sequelize[_0xa48e('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xa48e('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xa48e('0x4')]},'enterAt':{'type':Sequelize[_0xa48e('0x5')]},'exitAt':{'type':Sequelize[_0xa48e('0x5')],'set':function(_0x4387b5){var _0x2b058d=moment(_0x4387b5);var _0x405033=moment(this[_0xa48e('0x6')](_0xa48e('0x7')));var _0x3bdc25=_0x2b058d[_0xa48e('0x8')](_0x405033,_0xa48e('0x9'));this[_0xa48e('0xa')](_0xa48e('0xb'),_0x4387b5);this[_0xa48e('0xa')](_0xa48e('0xc'),_0x3bdc25||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xa48e('0xd')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xa48e('0xe')},'data4':{'type':Sequelize[_0xa48e('0x2')],'comment':_0xa48e('0xf')},'data5':{'type':Sequelize[_0xa48e('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xa48e('0x2')]},'internal':{'type':Sequelize[_0xa48e('0x4')]},'uniqueid':{'type':Sequelize[_0xa48e('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 9715ea9..76f3c11 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1af71a,_0x1d18ee){var _0x3acd6a=function(_0x3b7233){while(--_0x3b7233){_0x1af71a['push'](_0x1af71a['shift']());}};_0x3acd6a(++_0x1d18ee);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xedd9,0xfc));var _0x9edd=function(_0x10751e,_0x1e937d){_0x10751e=_0x10751e-0x0;var _0x2d04fc=_0xedd9[_0x10751e];return _0x2d04fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 5521408..97e1876 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 _0x63bd=['membername_interface','membername','interface','api','moment','bluebird','request-promise','../../config/environment','./memberReport.attributes','MemberReport','report_member'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63bd,0x163));var _0xd63b=function(_0x10fda4,_0x4cab62){_0x10fda4=_0x10fda4-0x0;var _0x29b671=_0x63bd[_0x10fda4];return _0x29b671;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd63b('0x0'));var moment=require(_0xd63b('0x1'));var BPromise=require(_0xd63b('0x2'));var rp=require(_0xd63b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd63b('0x4'));var attributes=require(_0xd63b('0x5'));module['exports']=function(_0x204d0d,_0x5b6bbb){return _0x204d0d['define'](_0xd63b('0x6'),attributes,{'tableName':_0xd63b('0x7'),'paranoid':![],'indexes':[{'name':_0xd63b('0x8'),'fields':[_0xd63b('0x9'),_0xd63b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f04=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8f04,0xbc));var _0x48f0=function(_0x2cf7aa,_0xdc5b6a){_0x2cf7aa=_0x2cf7aa-0x0;var _0xd7ec9b=_0x8f04[_0x2cf7aa];return _0xd7ec9b;};'use strict';var _=require(_0x48f0('0x0'));var util=require(_0x48f0('0x1'));var logger=require(_0x48f0('0x2'))(_0x48f0('0x3'));var moment=require('moment');var BPromise=require(_0x48f0('0x4'));var rp=require(_0x48f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x48f0('0x6'));var attributes=require('./memberReport.attributes');module[_0x48f0('0x7')]=function(_0x36553a,_0x2a1f98){return _0x36553a[_0x48f0('0x8')](_0x48f0('0x9'),attributes,{'tableName':_0x48f0('0xa'),'paranoid':![],'indexes':[{'name':_0x48f0('0xb'),'fields':[_0x48f0('0xc'),_0x48f0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 2473a67..0f32623 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 _0xf603=['message','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x4b4b04,_0x14d717){var _0x30bb5b=function(_0x514ded){while(--_0x514ded){_0x4b4b04['push'](_0x4b4b04['shift']());}};_0x30bb5b(++_0x14d717);}(_0xf603,0x124));var _0x3f60=function(_0x87386f,_0x444aac){_0x87386f=_0x87386f-0x0;var _0x34c0fd=_0xf603[_0x87386f];return _0x34c0fd;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require('moment');var BPromise=require(_0x3f60('0x2'));var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))(_0x3f60('0x8'));var config=require(_0x3f60('0x9'));var jayson=require(_0x3f60('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49a08c,_0x413b11,_0x43ec55){return new BPromise(function(_0x75bb34,_0x297c05){return client[_0x3f60('0xb')](_0x49a08c,_0x43ec55)[_0x3f60('0xc')](function(_0xb49f89){logger[_0x3f60('0xd')](_0x3f60('0xe'),_0x413b11,_0x3f60('0xf'));logger[_0x3f60('0x10')](_0x3f60('0x11'),_0x413b11,_0x3f60('0xf'),JSON['stringify'](_0xb49f89));if(_0xb49f89['error']){if(_0xb49f89['error'][_0x3f60('0x12')]===0x1f4){logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0xb49f89['error'][_0x3f60('0x14')]);return _0x297c05(_0xb49f89[_0x3f60('0x13')]['message']);}logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0xb49f89['error'][_0x3f60('0x14')]);return _0x75bb34(_0xb49f89['error'][_0x3f60('0x14')]);}else{logger[_0x3f60('0xd')]('MemberReport,\x20%s,\x20%s',_0x413b11,_0x3f60('0xf'));_0x75bb34(_0xb49f89['result'][_0x3f60('0x14')]);}})['catch'](function(_0x219f16){logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0x219f16);_0x297c05(_0x219f16);});});}exports[_0x3f60('0x15')]=function(_0x3ae771){var _0xe64a00=this;return new Promise(function(_0x52aa44,_0xb803f5){return db[_0x3f60('0x16')][_0x3f60('0x17')]({'raw':_0x3ae771[_0x3f60('0x18')]?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x19')]===undefined?!![]:![]:!![],'where':_0x3ae771['options']?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1a')]||null:null,'attributes':_0x3ae771['options']?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1b')]||null:null,'limit':_0x3ae771[_0x3f60('0x18')]?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1c')]||null:null,'include':_0x3ae771[_0x3f60('0x18')]?_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1d')]?_[_0x3f60('0x1e')](_0x3ae771[_0x3f60('0x18')][_0x3f60('0x1d')],function(_0x35b8f6){return{'model':db[_0x35b8f6[_0x3f60('0x1f')]],'as':_0x35b8f6['as'],'attributes':_0x35b8f6[_0x3f60('0x1b')],'include':_0x35b8f6[_0x3f60('0x1d')]?_['map'](_0x35b8f6[_0x3f60('0x1d')],function(_0x3cdef4){return{'model':db[_0x3cdef4[_0x3f60('0x1f')]],'as':_0x3cdef4['as'],'attributes':_0x3cdef4[_0x3f60('0x1b')],'include':_0x3cdef4[_0x3f60('0x1d')]?_[_0x3f60('0x1e')](_0x3cdef4[_0x3f60('0x1d')],function(_0x23e265){return{'model':db[_0x23e265['model']],'as':_0x23e265['as'],'attributes':_0x23e265[_0x3f60('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f60('0xc')](function(_0x20ef1c){logger[_0x3f60('0xd')](_0x3f60('0x15'),_0x3ae771);logger[_0x3f60('0x10')](_0x3f60('0x15'),_0x3ae771,JSON[_0x3f60('0x20')](_0x20ef1c));_0x52aa44(_0x20ef1c);})[_0x3f60('0x21')](function(_0x3cd0a7){logger[_0x3f60('0x13')](_0x3f60('0x15'),_0x3cd0a7[_0x3f60('0x14')],_0x3ae771);_0xb803f5(_0xe64a00[_0x3f60('0x13')](0x1f4,_0x3cd0a7[_0x3f60('0x14')]));});});};exports[_0x3f60('0x22')]=function(_0x10a861){var _0x3dd647=this;return new Promise(function(_0x19a3a5,_0x169bd3){return db[_0x3f60('0x16')][_0x3f60('0x23')](_0x10a861[_0x3f60('0x24')],{'raw':_0x10a861[_0x3f60('0x18')]?_0x10a861[_0x3f60('0x18')][_0x3f60('0x19')]===undefined?!![]:![]:!![]})[_0x3f60('0xc')](function(_0xd3882a){logger[_0x3f60('0xd')](_0x3f60('0x22'),_0x10a861);logger[_0x3f60('0x10')]('CreateMemberReport',_0x10a861,JSON[_0x3f60('0x20')](_0xd3882a));_0x19a3a5(_0xd3882a);})[_0x3f60('0x21')](function(_0x4a0a25){logger[_0x3f60('0x13')](_0x3f60('0x22'),_0x4a0a25[_0x3f60('0x14')],_0x10a861);_0x169bd3(_0x3dd647[_0x3f60('0x13')](0x1f4,_0x4a0a25['message']));});});};exports[_0x3f60('0x25')]=function(_0x14292c){var _0x5e6bb4=this;return new Promise(function(_0x5c6685,_0x261210){return db['MemberReport'][_0x3f60('0x26')](_0x14292c[_0x3f60('0x24')],{'raw':_0x14292c[_0x3f60('0x18')]?_0x14292c[_0x3f60('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14292c['options']?_0x14292c[_0x3f60('0x18')][_0x3f60('0x1a')]||null:null,'attributes':_0x14292c[_0x3f60('0x18')]?_0x14292c[_0x3f60('0x18')][_0x3f60('0x1b')]||null:null,'limit':_0x14292c[_0x3f60('0x18')]?_0x14292c['options'][_0x3f60('0x1c')]||null:null})['then'](function(_0x217660){logger['info'](_0x3f60('0x25'),_0x14292c);logger[_0x3f60('0x10')](_0x3f60('0x25'),_0x14292c,JSON[_0x3f60('0x20')](_0x217660));_0x5c6685(_0x217660);})[_0x3f60('0x21')](function(_0x4cef5a){logger['error'](_0x3f60('0x25'),_0x4cef5a[_0x3f60('0x14')],_0x14292c);_0x261210(_0x5e6bb4[_0x3f60('0x13')](0x1f4,_0x4cef5a['message']));});});}; \ No newline at end of file +var _0x2c8f=['result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateMemberReport','create','body','update','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x5cf162,_0x293cb7){var _0x229102=function(_0x5b59e0){while(--_0x5b59e0){_0x5cf162['push'](_0x5cf162['shift']());}};_0x229102(++_0x293cb7);}(_0x2c8f,0x192));var _0xf2c8=function(_0x40f25f,_0x259a31){_0x40f25f=_0x40f25f-0x0;var _0x7e2449=_0x2c8f[_0x40f25f];return _0x7e2449;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c8('0x1'));var db=require(_0xf2c8('0x2'))['db'];var utils=require(_0xf2c8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf2c8('0x4'));var jayson=require(_0xf2c8('0x5'));var client=jayson[_0xf2c8('0x6')][_0xf2c8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2785ee,_0x4eae22,_0x475616){return new BPromise(function(_0x28cc0d,_0x4e3109){return client[_0xf2c8('0x8')](_0x2785ee,_0x475616)[_0xf2c8('0x9')](function(_0x2112fc){logger['info'](_0xf2c8('0xa'),_0x4eae22,_0xf2c8('0xb'));logger[_0xf2c8('0xc')](_0xf2c8('0xd'),_0x4eae22,_0xf2c8('0xb'),JSON[_0xf2c8('0xe')](_0x2112fc));if(_0x2112fc[_0xf2c8('0xf')]){if(_0x2112fc[_0xf2c8('0xf')]['code']===0x1f4){logger[_0xf2c8('0xf')]('MemberReport,\x20%s,\x20%s',_0x4eae22,_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);return _0x4e3109(_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);}logger[_0xf2c8('0xf')](_0xf2c8('0xa'),_0x4eae22,_0x2112fc['error'][_0xf2c8('0x10')]);return _0x28cc0d(_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);}else{logger[_0xf2c8('0x11')](_0xf2c8('0xa'),_0x4eae22,_0xf2c8('0xb'));_0x28cc0d(_0x2112fc[_0xf2c8('0x12')]['message']);}})[_0xf2c8('0x13')](function(_0x3cbc33){logger[_0xf2c8('0xf')](_0xf2c8('0xa'),_0x4eae22,_0x3cbc33);_0x4e3109(_0x3cbc33);});});}exports[_0xf2c8('0x14')]=function(_0x52e9d0){var _0x49a07c=this;return new Promise(function(_0x104d9d,_0x290953){return db[_0xf2c8('0x15')][_0xf2c8('0x16')]({'raw':_0x52e9d0['options']?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x18')]===undefined?!![]:![]:!![],'where':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0['options'][_0xf2c8('0x19')]||null:null,'attributes':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0['options']['attributes']||null:null,'limit':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x1a')]||null:null,'include':_0x52e9d0['options']?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x52e9d0[_0xf2c8('0x17')]['include'],function(_0x17956f){return{'model':db[_0x17956f[_0xf2c8('0x1d')]],'as':_0x17956f['as'],'attributes':_0x17956f[_0xf2c8('0x1e')],'include':_0x17956f[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x17956f['include'],function(_0x93707c){return{'model':db[_0x93707c['model']],'as':_0x93707c['as'],'attributes':_0x93707c[_0xf2c8('0x1e')],'include':_0x93707c[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x93707c[_0xf2c8('0x1b')],function(_0x1d2e74){return{'model':db[_0x1d2e74[_0xf2c8('0x1d')]],'as':_0x1d2e74['as'],'attributes':_0x1d2e74[_0xf2c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf2c8('0x9')](function(_0x33f1b0){logger[_0xf2c8('0x11')](_0xf2c8('0x14'),_0x52e9d0);logger[_0xf2c8('0xc')](_0xf2c8('0x14'),_0x52e9d0,JSON['stringify'](_0x33f1b0));_0x104d9d(_0x33f1b0);})[_0xf2c8('0x13')](function(_0x5146e4){logger['error'](_0xf2c8('0x14'),_0x5146e4['message'],_0x52e9d0);_0x290953(_0x49a07c[_0xf2c8('0xf')](0x1f4,_0x5146e4[_0xf2c8('0x10')]));});});};exports[_0xf2c8('0x1f')]=function(_0x10c825){var _0x123b45=this;return new Promise(function(_0x12a547,_0x27a7dc){return db['MemberReport'][_0xf2c8('0x20')](_0x10c825[_0xf2c8('0x21')],{'raw':_0x10c825[_0xf2c8('0x17')]?_0x10c825[_0xf2c8('0x17')][_0xf2c8('0x18')]===undefined?!![]:![]:!![]})[_0xf2c8('0x9')](function(_0x5e0b43){logger[_0xf2c8('0x11')]('CreateMemberReport',_0x10c825);logger[_0xf2c8('0xc')]('CreateMemberReport',_0x10c825,JSON[_0xf2c8('0xe')](_0x5e0b43));_0x12a547(_0x5e0b43);})[_0xf2c8('0x13')](function(_0x8ea71a){logger[_0xf2c8('0xf')](_0xf2c8('0x1f'),_0x8ea71a['message'],_0x10c825);_0x27a7dc(_0x123b45[_0xf2c8('0xf')](0x1f4,_0x8ea71a[_0xf2c8('0x10')]));});});};exports['UpdateMemberReport']=function(_0x309232){var _0x23f6be=this;return new Promise(function(_0x4a24e8,_0x1935c7){return db[_0xf2c8('0x15')][_0xf2c8('0x22')](_0x309232[_0xf2c8('0x21')],{'raw':_0x309232[_0xf2c8('0x17')]?_0x309232['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309232[_0xf2c8('0x17')]?_0x309232[_0xf2c8('0x17')][_0xf2c8('0x19')]||null:null,'attributes':_0x309232[_0xf2c8('0x17')]?_0x309232[_0xf2c8('0x17')][_0xf2c8('0x1e')]||null:null,'limit':_0x309232[_0xf2c8('0x17')]?_0x309232[_0xf2c8('0x17')]['limit']||null:null})[_0xf2c8('0x9')](function(_0x4775c6){logger[_0xf2c8('0x11')]('UpdateMemberReport',_0x309232);logger['debug']('UpdateMemberReport',_0x309232,JSON['stringify'](_0x4775c6));_0x4a24e8(_0x4775c6);})[_0xf2c8('0x13')](function(_0x49ac22){logger[_0xf2c8('0xf')]('UpdateMemberReport',_0x49ac22[_0xf2c8('0x10')],_0x309232);_0x1935c7(_0x23f6be['error'](0x1f4,_0x49ac22['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index db27a3c..bbc7785 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 _0x7499=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x619fcc,_0x3bd756){var _0x4737a6=function(_0x49311c){while(--_0x49311c){_0x619fcc['push'](_0x619fcc['shift']());}};_0x4737a6(++_0x3bd756);}(_0x7499,0x162));var _0x9749=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x7499[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var path=require('path');var timeout=require(_0x9749('0x2'));var express=require(_0x9749('0x3'));var router=express[_0x9749('0x4')]();var fs_extra=require(_0x9749('0x5'));var auth=require(_0x9749('0x6'));var interaction=require(_0x9749('0x7'));var config=require(_0x9749('0x8'));var controller=require('./migration.controller');router[_0x9749('0x9')]('/',controller[_0x9749('0xa')]);module[_0x9749('0xb')]=router; \ No newline at end of file +var _0x9a14=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c7386,_0x298a93){var _0x2b6b71=function(_0x3dfaf0){while(--_0x3dfaf0){_0x1c7386['push'](_0x1c7386['shift']());}};_0x2b6b71(++_0x298a93);}(_0x9a14,0xa8));var _0x49a1=function(_0x1dcef5,_0x3bf0ad){_0x1dcef5=_0x1dcef5-0x0;var _0x3b121f=_0x9a14[_0x1dcef5];return _0x3b121f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49a1('0x0'));var timeout=require(_0x49a1('0x1'));var express=require(_0x49a1('0x2'));var router=express[_0x49a1('0x3')]();var fs_extra=require(_0x49a1('0x4'));var auth=require(_0x49a1('0x5'));var interaction=require(_0x49a1('0x6'));var config=require(_0x49a1('0x7'));var controller=require('./migration.controller');router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 472ffa4..2088d0c 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 _0x44a3=['STRING','version','sequelize'];(function(_0x2bb970,_0x4afccc){var _0x3fbdaa=function(_0x583d01){while(--_0x583d01){_0x2bb970['push'](_0x2bb970['shift']());}};_0x3fbdaa(++_0x4afccc);}(_0x44a3,0xb0));var _0x344a=function(_0xd46227,_0x18477f){_0xd46227=_0xd46227-0x0;var _0x2a980d=_0x44a3[_0xd46227];return _0x2a980d;};'use strict';var Sequelize=require(_0x344a('0x0'));module['exports']={'version':{'type':Sequelize[_0x344a('0x1')],'unique':_0x344a('0x2')}}; \ No newline at end of file +var _0x914e=['STRING','sequelize'];(function(_0x6f0460,_0x2526f4){var _0x6dcdb6=function(_0x5d5244){while(--_0x5d5244){_0x6f0460['push'](_0x6f0460['shift']());}};_0x6dcdb6(++_0x2526f4);}(_0x914e,0xd5));var _0xe914=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x914e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe914('0x0'));module['exports']={'version':{'type':Sequelize[_0xe914('0x1')],'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 927395b..39a5866 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 _0xbbc2=['hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','index','map','Migration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0xdc03a,_0x218f69){var _0x2c4197=function(_0x5b7302){while(--_0x5b7302){_0xdc03a['push'](_0xdc03a['shift']());}};_0x2c4197(++_0x218f69);}(_0xbbc2,0xa0));var _0x2bbc=function(_0x5bcece,_0x53286d){_0x5bcece=_0x5bcece-0x0;var _0x1cab81=_0xbbc2[_0x5bcece];return _0x1cab81;};'use strict';var emlformat=require(_0x2bbc('0x0'));var rimraf=require(_0x2bbc('0x1'));var zipdir=require(_0x2bbc('0x2'));var jsonpatch=require(_0x2bbc('0x3'));var rp=require(_0x2bbc('0x4'));var moment=require(_0x2bbc('0x5'));var BPromise=require(_0x2bbc('0x6'));var Mustache=require(_0x2bbc('0x7'));var util=require(_0x2bbc('0x8'));var path=require(_0x2bbc('0x9'));var sox=require('sox');var csv=require(_0x2bbc('0xa'));var ejs=require(_0x2bbc('0xb'));var fs=require('fs');var fs_extra=require(_0x2bbc('0xc'));var _=require(_0x2bbc('0xd'));var squel=require(_0x2bbc('0xe'));var crypto=require(_0x2bbc('0xf'));var jsforce=require(_0x2bbc('0x10'));var deskjs=require(_0x2bbc('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2bbc('0x12'));var Papa=require(_0x2bbc('0x13'));var Redis=require(_0x2bbc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2bbc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bbc('0x16'));var logger=require(_0x2bbc('0x17'))(_0x2bbc('0x18'));var utils=require(_0x2bbc('0x19'));var config=require(_0x2bbc('0x1a'));var licenseUtil=require(_0x2bbc('0x1b'));var db=require(_0x2bbc('0x1c'))['db'];function respondWithStatusCode(_0x4f83dc,_0x2ae601){_0x2ae601=_0x2ae601||0xcc;return function(_0x1d264f){if(_0x1d264f){return _0x4f83dc[_0x2bbc('0x1d')](_0x2ae601);}return _0x4f83dc[_0x2bbc('0x1e')](_0x2ae601)['end']();};}function respondWithResult(_0x59059,_0x8ed736){_0x8ed736=_0x8ed736||0xc8;return function(_0x4c1f6b){if(_0x4c1f6b){return _0x59059['status'](_0x8ed736)['json'](_0x4c1f6b);}};}function respondWithFilteredResult(_0x15acf7,_0x26fb86){return function(_0x4357bf){if(_0x4357bf){var _0x5c3bb5=typeof _0x26fb86[_0x2bbc('0x1f')]===_0x2bbc('0x20')&&typeof _0x26fb86['limit']===_0x2bbc('0x20');var _0x29cdf3=_0x4357bf[_0x2bbc('0x21')];var _0x4c3549=_0x5c3bb5?0x0:_0x26fb86['offset'];var _0x3e3dd6=_0x5c3bb5?_0x4357bf[_0x2bbc('0x21')]:_0x26fb86[_0x2bbc('0x1f')]+_0x26fb86['limit'];var _0x1fce40;if(_0x3e3dd6>=_0x29cdf3){_0x3e3dd6=_0x29cdf3;_0x1fce40=0xc8;}else{_0x1fce40=0xce;}_0x15acf7[_0x2bbc('0x1e')](_0x1fce40);return _0x15acf7[_0x2bbc('0x22')](_0x2bbc('0x23'),_0x4c3549+'-'+_0x3e3dd6+'/'+_0x29cdf3)[_0x2bbc('0x24')](_0x4357bf);}return null;};}function patchUpdates(_0x308633){return function(_0x26477d){try{jsonpatch[_0x2bbc('0x25')](_0x26477d,_0x308633,!![]);}catch(_0x40c3bd){return BPromise[_0x2bbc('0x26')](_0x40c3bd);}return _0x26477d[_0x2bbc('0x27')]();};}function saveUpdates(_0x2228e4,_0x99fce4){return function(_0x4cbe7a){if(_0x4cbe7a){return _0x4cbe7a[_0x2bbc('0x28')](_0x2228e4)[_0x2bbc('0x29')](function(_0x13ca99){return _0x13ca99;});}return null;};}function removeEntity(_0x11c71b,_0x5d73cb){return function(_0x3a2255){if(_0x3a2255){return _0x3a2255[_0x2bbc('0x2a')]()[_0x2bbc('0x29')](function(){_0x11c71b[_0x2bbc('0x1e')](0xcc)[_0x2bbc('0x2b')]();});}};}function handleEntityNotFound(_0x5abbd0,_0x5a5d52){return function(_0x3f6bcb){if(!_0x3f6bcb){_0x5abbd0[_0x2bbc('0x1d')](0x194);}return _0x3f6bcb;};}function handleError(_0xe0bbe,_0xedc9f9){_0xedc9f9=_0xedc9f9||0x1f4;return function(_0x3c30eb){logger['error'](_0x3c30eb[_0x2bbc('0x2c')]);if(_0x3c30eb[_0x2bbc('0x2d')]){delete _0x3c30eb['name'];}_0xe0bbe['status'](_0xedc9f9)['send'](_0x3c30eb);};}exports[_0x2bbc('0x2e')]=function(_0x18929b,_0x287b5f){var _0x449983={},_0x206a07={},_0x58670b={'count':0x0,'rows':[]};var _0x9178cf=_[_0x2bbc('0x2f')](db[_0x2bbc('0x30')][_0x2bbc('0x31')],function(_0x398dcd){return{'name':_0x398dcd[_0x2bbc('0x32')],'type':_0x398dcd[_0x2bbc('0x33')]['key']};});_0x206a07[_0x2bbc('0x34')]=_['map'](_0x9178cf,_0x2bbc('0x2d'));_0x206a07[_0x2bbc('0x35')]=_['keys'](_0x18929b[_0x2bbc('0x35')]);_0x206a07[_0x2bbc('0x36')]=_[_0x2bbc('0x37')](_0x206a07['model'],_0x206a07[_0x2bbc('0x35')]);_0x449983[_0x2bbc('0x38')]=_[_0x2bbc('0x37')](_0x206a07['model'],qs['fields'](_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x39')]));_0x449983[_0x2bbc('0x38')]=_0x449983[_0x2bbc('0x38')][_0x2bbc('0x3a')]?_0x449983[_0x2bbc('0x38')]:_0x206a07[_0x2bbc('0x34')];if(!_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x3b')]('nolimit')){_0x449983[_0x2bbc('0x3c')]=qs[_0x2bbc('0x3c')](_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x3c')]);_0x449983[_0x2bbc('0x1f')]=qs[_0x2bbc('0x1f')](_0x18929b['query']['offset']);}_0x449983[_0x2bbc('0x3d')]=qs[_0x2bbc('0x3e')](_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x3e')]);_0x449983[_0x2bbc('0x3f')]=qs['filters'](_[_0x2bbc('0x40')](_0x18929b[_0x2bbc('0x35')],_0x206a07[_0x2bbc('0x36')]),_0x9178cf);if(_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x41')]){_0x449983[_0x2bbc('0x3f')]=_[_0x2bbc('0x42')](_0x449983[_0x2bbc('0x3f')],{'$or':_[_0x2bbc('0x2f')](_0x9178cf,function(_0x4f4b0c){if(_0x4f4b0c[_0x2bbc('0x33')]!==_0x2bbc('0x43')){var _0x1d302b={};_0x1d302b[_0x4f4b0c[_0x2bbc('0x2d')]]={'$like':'%'+_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x41')]+'%'};return _0x1d302b;}})});}_0x449983=_[_0x2bbc('0x42')]({},_0x449983,_0x18929b['options']);var _0x114300={'where':_0x449983[_0x2bbc('0x3f')]};return db[_0x2bbc('0x30')][_0x2bbc('0x21')](_0x114300)[_0x2bbc('0x29')](function(_0x3bc07d){_0x58670b[_0x2bbc('0x21')]=_0x3bc07d;if(_0x18929b[_0x2bbc('0x35')][_0x2bbc('0x44')]){_0x449983[_0x2bbc('0x45')]=[{'all':!![]}];}return db['Migration'][_0x2bbc('0x46')](_0x449983);})[_0x2bbc('0x29')](function(_0x5e34f5){_0x58670b[_0x2bbc('0x47')]=_0x5e34f5;return _0x58670b;})[_0x2bbc('0x29')](respondWithFilteredResult(_0x287b5f,_0x449983))[_0x2bbc('0x48')](handleError(_0x287b5f,null));}; \ No newline at end of file +var _0xce68=['sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','name','send','index','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','map','type','merge','options','then','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xce68,0x10c));var _0x8ce6=function(_0x481b93,_0x58b946){_0x481b93=_0x481b93-0x0;var _0x5d8ff1=_0xce68[_0x481b93];return _0x5d8ff1;};'use strict';var emlformat=require(_0x8ce6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ce6('0x1'));var jsonpatch=require(_0x8ce6('0x2'));var rp=require(_0x8ce6('0x3'));var moment=require(_0x8ce6('0x4'));var BPromise=require(_0x8ce6('0x5'));var Mustache=require('mustache');var util=require(_0x8ce6('0x6'));var path=require(_0x8ce6('0x7'));var sox=require(_0x8ce6('0x8'));var csv=require('to-csv');var ejs=require(_0x8ce6('0x9'));var fs=require('fs');var fs_extra=require(_0x8ce6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ce6('0xb'));var jsforce=require(_0x8ce6('0xc'));var deskjs=require(_0x8ce6('0xd'));var toCsv=require(_0x8ce6('0xe'));var querystring=require('querystring');var Papa=require(_0x8ce6('0xf'));var Redis=require(_0x8ce6('0x10'));var authService=require(_0x8ce6('0x11'));var qs=require(_0x8ce6('0x12'));var as=require(_0x8ce6('0x13'));var hardwareService=require(_0x8ce6('0x14'));var logger=require(_0x8ce6('0x15'))(_0x8ce6('0x16'));var utils=require(_0x8ce6('0x17'));var config=require(_0x8ce6('0x18'));var licenseUtil=require(_0x8ce6('0x19'));var db=require(_0x8ce6('0x1a'))['db'];function respondWithStatusCode(_0x301a9b,_0x40e7ab){_0x40e7ab=_0x40e7ab||0xcc;return function(_0x1e8b85){if(_0x1e8b85){return _0x301a9b[_0x8ce6('0x1b')](_0x40e7ab);}return _0x301a9b[_0x8ce6('0x1c')](_0x40e7ab)[_0x8ce6('0x1d')]();};}function respondWithResult(_0x4a68fd,_0x20752c){_0x20752c=_0x20752c||0xc8;return function(_0x5f0ff5){if(_0x5f0ff5){return _0x4a68fd[_0x8ce6('0x1c')](_0x20752c)[_0x8ce6('0x1e')](_0x5f0ff5);}};}function respondWithFilteredResult(_0x150f89,_0x2ac4b3){return function(_0x2c2d7e){if(_0x2c2d7e){var _0x34cce2=typeof _0x2ac4b3[_0x8ce6('0x1f')]===_0x8ce6('0x20')&&typeof _0x2ac4b3[_0x8ce6('0x21')]===_0x8ce6('0x20');var _0x4fd6a6=_0x2c2d7e[_0x8ce6('0x22')];var _0x4ba248=_0x34cce2?0x0:_0x2ac4b3[_0x8ce6('0x1f')];var _0x175a74=_0x34cce2?_0x2c2d7e[_0x8ce6('0x22')]:_0x2ac4b3['offset']+_0x2ac4b3['limit'];var _0x30e233;if(_0x175a74>=_0x4fd6a6){_0x175a74=_0x4fd6a6;_0x30e233=0xc8;}else{_0x30e233=0xce;}_0x150f89[_0x8ce6('0x1c')](_0x30e233);return _0x150f89['set'](_0x8ce6('0x23'),_0x4ba248+'-'+_0x175a74+'/'+_0x4fd6a6)[_0x8ce6('0x1e')](_0x2c2d7e);}return null;};}function patchUpdates(_0x444cba){return function(_0x5c5cff){try{jsonpatch[_0x8ce6('0x24')](_0x5c5cff,_0x444cba,!![]);}catch(_0x1b2b91){return BPromise[_0x8ce6('0x25')](_0x1b2b91);}return _0x5c5cff[_0x8ce6('0x26')]();};}function saveUpdates(_0x2fef1c,_0x3427f8){return function(_0x2c4043){if(_0x2c4043){return _0x2c4043[_0x8ce6('0x27')](_0x2fef1c)['then'](function(_0x462c8b){return _0x462c8b;});}return null;};}function removeEntity(_0x5e5702,_0xdf5830){return function(_0x28c639){if(_0x28c639){return _0x28c639[_0x8ce6('0x28')]()['then'](function(){_0x5e5702['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2b61,_0x3a8325){return function(_0x1e95cb){if(!_0x1e95cb){_0x5c2b61[_0x8ce6('0x1b')](0x194);}return _0x1e95cb;};}function handleError(_0xed5ae7,_0x35c2d6){_0x35c2d6=_0x35c2d6||0x1f4;return function(_0xadc624){logger['error'](_0xadc624['stack']);if(_0xadc624[_0x8ce6('0x29')]){delete _0xadc624[_0x8ce6('0x29')];}_0xed5ae7[_0x8ce6('0x1c')](_0x35c2d6)[_0x8ce6('0x2a')](_0xadc624);};}exports[_0x8ce6('0x2b')]=function(_0x10a3f9,_0x552251){var _0x4c5a7e={},_0x1eabc8={},_0xb35316={'count':0x0,'rows':[]};var _0x3ebbbc=_['map'](db[_0x8ce6('0x2c')][_0x8ce6('0x2d')],function(_0x3abed8){return{'name':_0x3abed8[_0x8ce6('0x2e')],'type':_0x3abed8['type'][_0x8ce6('0x2f')]};});_0x1eabc8[_0x8ce6('0x30')]=_['map'](_0x3ebbbc,'name');_0x1eabc8[_0x8ce6('0x31')]=_[_0x8ce6('0x32')](_0x10a3f9[_0x8ce6('0x31')]);_0x1eabc8[_0x8ce6('0x33')]=_[_0x8ce6('0x34')](_0x1eabc8[_0x8ce6('0x30')],_0x1eabc8[_0x8ce6('0x31')]);_0x4c5a7e[_0x8ce6('0x35')]=_[_0x8ce6('0x34')](_0x1eabc8[_0x8ce6('0x30')],qs[_0x8ce6('0x36')](_0x10a3f9[_0x8ce6('0x31')][_0x8ce6('0x36')]));_0x4c5a7e[_0x8ce6('0x35')]=_0x4c5a7e[_0x8ce6('0x35')][_0x8ce6('0x37')]?_0x4c5a7e[_0x8ce6('0x35')]:_0x1eabc8[_0x8ce6('0x30')];if(!_0x10a3f9[_0x8ce6('0x31')]['hasOwnProperty'](_0x8ce6('0x38'))){_0x4c5a7e[_0x8ce6('0x21')]=qs[_0x8ce6('0x21')](_0x10a3f9[_0x8ce6('0x31')][_0x8ce6('0x21')]);_0x4c5a7e['offset']=qs['offset'](_0x10a3f9[_0x8ce6('0x31')][_0x8ce6('0x1f')]);}_0x4c5a7e['order']=qs['sort'](_0x10a3f9[_0x8ce6('0x31')][_0x8ce6('0x39')]);_0x4c5a7e[_0x8ce6('0x3a')]=qs[_0x8ce6('0x33')](_[_0x8ce6('0x3b')](_0x10a3f9[_0x8ce6('0x31')],_0x1eabc8['filters']),_0x3ebbbc);if(_0x10a3f9[_0x8ce6('0x31')]['filter']){_0x4c5a7e[_0x8ce6('0x3a')]=_['merge'](_0x4c5a7e[_0x8ce6('0x3a')],{'$or':_[_0x8ce6('0x3c')](_0x3ebbbc,function(_0x118db5){if(_0x118db5[_0x8ce6('0x3d')]!=='VIRTUAL'){var _0x2d0775={};_0x2d0775[_0x118db5['name']]={'$like':'%'+_0x10a3f9[_0x8ce6('0x31')]['filter']+'%'};return _0x2d0775;}})});}_0x4c5a7e=_[_0x8ce6('0x3e')]({},_0x4c5a7e,_0x10a3f9[_0x8ce6('0x3f')]);var _0x265495={'where':_0x4c5a7e['where']};return db[_0x8ce6('0x2c')][_0x8ce6('0x22')](_0x265495)[_0x8ce6('0x40')](function(_0x4f0e3f){_0xb35316[_0x8ce6('0x22')]=_0x4f0e3f;if(_0x10a3f9[_0x8ce6('0x31')]['includeAll']){_0x4c5a7e[_0x8ce6('0x41')]=[{'all':!![]}];}return db[_0x8ce6('0x2c')][_0x8ce6('0x42')](_0x4c5a7e);})['then'](function(_0x2e36f8){_0xb35316[_0x8ce6('0x43')]=_0x2e36f8;return _0xb35316;})[_0x8ce6('0x40')](respondWithFilteredResult(_0x552251,_0x4c5a7e))[_0x8ce6('0x44')](handleError(_0x552251,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index d188e07..b12243a 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 _0x7454=['./migration.attributes','define','migrations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4117ae,_0x1e7f51){var _0x4a1035=function(_0x660a45){while(--_0x660a45){_0x4117ae['push'](_0x4117ae['shift']());}};_0x4a1035(++_0x1e7f51);}(_0x7454,0xc1));var _0x4745=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x7454[_0x31e5cb];return _0x4170df;};'use strict';var _=require('lodash');var util=require(_0x4745('0x0'));var logger=require(_0x4745('0x1'))('api');var moment=require(_0x4745('0x2'));var BPromise=require(_0x4745('0x3'));var rp=require(_0x4745('0x4'));var fs=require('fs');var path=require(_0x4745('0x5'));var rimraf=require(_0x4745('0x6'));var config=require('../../config/environment');var attributes=require(_0x4745('0x7'));module['exports']=function(_0xaf97e5,_0x52c917){return _0xaf97e5[_0x4745('0x8')]('Migration',attributes,{'tableName':_0x4745('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bbf=['request-promise','path','rimraf','../../config/environment','exports','define','Migration','util','../../config/logger','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5bbf,0x10f));var _0xf5bb=function(_0x11160d,_0x413adc){_0x11160d=_0x11160d-0x0;var _0x21520a=_0x5bbf[_0x11160d];return _0x21520a;};'use strict';var _=require('lodash');var util=require(_0xf5bb('0x0'));var logger=require(_0xf5bb('0x1'))('api');var moment=require(_0xf5bb('0x2'));var BPromise=require(_0xf5bb('0x3'));var rp=require(_0xf5bb('0x4'));var fs=require('fs');var path=require(_0xf5bb('0x5'));var rimraf=require(_0xf5bb('0x6'));var config=require(_0xf5bb('0x7'));var attributes=require('./migration.attributes');module[_0xf5bb('0x8')]=function(_0x517178,_0xc6c4ba){return _0x517178[_0xf5bb('0x9')](_0xf5bb('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index bedf56c..55573fa 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 _0xce25=['../../config/utils','rpc','../../config/environment','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','../../mysqldb'];(function(_0x1dd24c,_0x3c3ab3){var _0x1cf3e0=function(_0x5aa52d){while(--_0x5aa52d){_0x1dd24c['push'](_0x1dd24c['shift']());}};_0x1cf3e0(++_0x3c3ab3);}(_0xce25,0x196));var _0x5ce2=function(_0x1bfe6a,_0x348e16){_0x1bfe6a=_0x1bfe6a-0x0;var _0x225557=_0xce25[_0x1bfe6a];return _0x225557;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce2('0x1'))['db'];var utils=require(_0x5ce2('0x2'));var logger=require('../../config/logger')(_0x5ce2('0x3'));var config=require(_0x5ce2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ce2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x417149,_0x1ab2e7,_0xcb80ee){return new BPromise(function(_0x4a57a6,_0x2ccf81){return client[_0x5ce2('0x6')](_0x417149,_0xcb80ee)[_0x5ce2('0x7')](function(_0x49ede4){logger[_0x5ce2('0x8')](_0x5ce2('0x9'),_0x1ab2e7,_0x5ce2('0xa'));logger[_0x5ce2('0xb')](_0x5ce2('0xc'),_0x1ab2e7,_0x5ce2('0xa'),JSON['stringify'](_0x49ede4));if(_0x49ede4[_0x5ce2('0xd')]){if(_0x49ede4['error'][_0x5ce2('0xe')]===0x1f4){logger[_0x5ce2('0xd')]('Migration,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4['error']['message']);return _0x2ccf81(_0x49ede4['error'][_0x5ce2('0xf')]);}logger['error']('Migration,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4[_0x5ce2('0xd')]['message']);return _0x4a57a6(_0x49ede4[_0x5ce2('0xd')][_0x5ce2('0xf')]);}else{logger[_0x5ce2('0x8')]('Migration,\x20%s,\x20%s',_0x1ab2e7,_0x5ce2('0xa'));_0x4a57a6(_0x49ede4[_0x5ce2('0x10')][_0x5ce2('0xf')]);}})['catch'](function(_0x4b89d3){logger[_0x5ce2('0xd')](_0x5ce2('0x9'),_0x1ab2e7,_0x4b89d3);_0x2ccf81(_0x4b89d3);});});} \ No newline at end of file +var _0x25a3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x1fe5a1,_0x261860){var _0x1f5842=function(_0x5eab22){while(--_0x5eab22){_0x1fe5a1['push'](_0x1fe5a1['shift']());}};_0x1f5842(++_0x261860);}(_0x25a3,0x121));var _0x325a=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0x25a3[_0x8be9fb];return _0x3b41ac;};'use strict';var _=require(_0x325a('0x0'));var util=require(_0x325a('0x1'));var moment=require(_0x325a('0x2'));var BPromise=require('bluebird');var rs=require(_0x325a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x325a('0x4'))['db'];var utils=require(_0x325a('0x5'));var logger=require(_0x325a('0x6'))('rpc');var config=require(_0x325a('0x7'));var jayson=require(_0x325a('0x8'));var client=jayson[_0x325a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533867,_0x3bb82f,_0x209f5e){return new BPromise(function(_0x43bd79,_0x33f09a){return client['request'](_0x533867,_0x209f5e)['then'](function(_0x37e954){logger[_0x325a('0xa')](_0x325a('0xb'),_0x3bb82f,_0x325a('0xc'));logger[_0x325a('0xd')](_0x325a('0xe'),_0x3bb82f,'request\x20sent',JSON[_0x325a('0xf')](_0x37e954));if(_0x37e954[_0x325a('0x10')]){if(_0x37e954['error'][_0x325a('0x11')]===0x1f4){logger[_0x325a('0x10')](_0x325a('0xb'),_0x3bb82f,_0x37e954[_0x325a('0x10')]['message']);return _0x33f09a(_0x37e954['error'][_0x325a('0x12')]);}logger['error'](_0x325a('0xb'),_0x3bb82f,_0x37e954[_0x325a('0x10')][_0x325a('0x12')]);return _0x43bd79(_0x37e954[_0x325a('0x10')][_0x325a('0x12')]);}else{logger[_0x325a('0xa')](_0x325a('0xb'),_0x3bb82f,_0x325a('0xc'));_0x43bd79(_0x37e954[_0x325a('0x13')][_0x325a('0x12')]);}})[_0x325a('0x14')](function(_0x21315f){logger[_0x325a('0x10')](_0x325a('0xb'),_0x3bb82f,_0x21315f);_0x33f09a(_0x21315f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index fd8d0c5..05fabc5 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 _0x41d0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41d0,0x1c6));var _0x041d=function(_0x4c6f7e,_0xad2dfa){_0x4c6f7e=_0x4c6f7e-0x0;var _0x49ba40=_0x41d0[_0x4c6f7e];return _0x49ba40;};'use strict';var multer=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var path=require(_0x041d('0x2'));var timeout=require(_0x041d('0x3'));var express=require('express');var router=express[_0x041d('0x4')]();var fs_extra=require(_0x041d('0x5'));var auth=require(_0x041d('0x6'));var interaction=require(_0x041d('0x7'));var config=require(_0x041d('0x8'));var controller=require(_0x041d('0x9'));router[_0x041d('0xa')]('/',auth[_0x041d('0xb')](),controller[_0x041d('0xc')]);router['get'](_0x041d('0xd'),auth['isAuthenticated'](),controller[_0x041d('0xe')]);router['post']('/',auth[_0x041d('0xb')](),controller[_0x041d('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x041d('0x10')]);router['delete'](_0x041d('0xd'),auth['isAuthenticated'](),controller[_0x041d('0x11')]);module[_0x041d('0x12')]=router; \ No newline at end of file +var _0x1173=['show','create','put','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0xf74372,_0x51fe82){var _0x36bb65=function(_0x499b7a){while(--_0x499b7a){_0xf74372['push'](_0xf74372['shift']());}};_0x36bb65(++_0x51fe82);}(_0x1173,0x138));var _0x3117=function(_0x23fe4a,_0x5e6044){_0x23fe4a=_0x23fe4a-0x0;var _0x13ff94=_0x1173[_0x23fe4a];return _0x13ff94;};'use strict';var multer=require('multer');var util=require(_0x3117('0x0'));var path=require(_0x3117('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3117('0x2')]();var fs_extra=require(_0x3117('0x3'));var auth=require(_0x3117('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3117('0x5'));var controller=require(_0x3117('0x6'));router[_0x3117('0x7')]('/',auth[_0x3117('0x8')](),controller[_0x3117('0x9')]);router[_0x3117('0x7')](_0x3117('0xa'),auth[_0x3117('0x8')](),controller[_0x3117('0xb')]);router['post']('/',auth[_0x3117('0x8')](),controller[_0x3117('0xc')]);router[_0x3117('0xd')](_0x3117('0xa'),auth[_0x3117('0x8')](),controller['update']);router[_0x3117('0xe')](_0x3117('0xa'),auth[_0x3117('0x8')](),controller[_0x3117('0xf')]);module[_0x3117('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index ed28a60..9253aaa 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 _0x38d0=['localnet','externip','stun','STRING','sequelize','ENUM'];(function(_0x56a7bb,_0xbc8866){var _0x152cb3=function(_0x2756b6){while(--_0x2756b6){_0x56a7bb['push'](_0x56a7bb['shift']());}};_0x152cb3(++_0xbc8866);}(_0x38d0,0x1ba));var _0x038d=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x38d0[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0x038d('0x0'));module['exports']={'type':{'type':Sequelize[_0x038d('0x1')](_0x038d('0x2'),_0x038d('0x3'),_0x038d('0x4'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x038d('0x5')]},'password':{'type':Sequelize[_0x038d('0x5')]}}; \ No newline at end of file +var _0xb958=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x4f5557,_0x2aee40){var _0x374d03=function(_0x14fe02){while(--_0x14fe02){_0x4f5557['push'](_0x4f5557['shift']());}};_0x374d03(++_0x2aee40);}(_0xb958,0xdc));var _0x8b95=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0xb958[_0x5280f4];return _0xba93e7;};'use strict';var Sequelize=require(_0x8b95('0x0'));module[_0x8b95('0x1')]={'type':{'type':Sequelize[_0x8b95('0x2')](_0x8b95('0x3'),_0x8b95('0x4'),_0x8b95('0x5'),_0x8b95('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8b95('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 211ab3b..f4b3ee9 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 _0x84cf=['name','send','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','options','includeAll','include','Network','rows','catch','params','create','body','findAll','toUpperCase','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','join','root','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','transaction','STUN','format','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','end','stack'];(function(_0x3a64ca,_0x2549b5){var _0x4775cc=function(_0x584df8){while(--_0x584df8){_0x3a64ca['push'](_0x3a64ca['shift']());}};_0x4775cc(++_0x2549b5);}(_0x84cf,0x176));var _0xf84c=function(_0x2c0abe,_0x1b4c6b){_0x2c0abe=_0x2c0abe-0x0;var _0x566ac1=_0x84cf[_0x2c0abe];return _0x566ac1;};'use strict';var emlformat=require(_0xf84c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf84c('0x1'));var jsonpatch=require(_0xf84c('0x2'));var rp=require(_0xf84c('0x3'));var moment=require(_0xf84c('0x4'));var BPromise=require(_0xf84c('0x5'));var Mustache=require(_0xf84c('0x6'));var util=require(_0xf84c('0x7'));var path=require(_0xf84c('0x8'));var sox=require('sox');var csv=require(_0xf84c('0x9'));var ejs=require(_0xf84c('0xa'));var fs=require('fs');var fs_extra=require(_0xf84c('0xb'));var _=require(_0xf84c('0xc'));var squel=require('squel');var crypto=require(_0xf84c('0xd'));var jsforce=require(_0xf84c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf84c('0x9'));var querystring=require(_0xf84c('0xf'));var Papa=require(_0xf84c('0x10'));var Redis=require(_0xf84c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf84c('0x12'));var as=require(_0xf84c('0x13'));var hardwareService=require(_0xf84c('0x14'));var logger=require(_0xf84c('0x15'))('api');var utils=require(_0xf84c('0x16'));var config=require(_0xf84c('0x17'));var licenseUtil=require(_0xf84c('0x18'));var db=require(_0xf84c('0x19'))['db'];var jayson=require(_0xf84c('0x1a'));var client=jayson[_0xf84c('0x1b')][_0xf84c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5eeaa5,_0x38ebfa,_0x4d90e3,_0x11beea){return new BPromise(function(_0x2f20c5,_0x2bcf70){var _0x2baf6f=_0x11beea||client;return _0x2baf6f[_0xf84c('0x1d')](_0x5eeaa5,_0x4d90e3)[_0xf84c('0x1e')](function(_0x5d0788){logger[_0xf84c('0x1f')](_0xf84c('0x20'),_0x38ebfa,_0xf84c('0x21'));logger[_0xf84c('0x22')]('Network,\x20%s,\x20%s,\x20%s',_0x38ebfa,_0xf84c('0x21'),JSON[_0xf84c('0x23')](_0x5d0788));if(_0x5d0788[_0xf84c('0x24')]){if(_0x5d0788[_0xf84c('0x24')][_0xf84c('0x25')]===0x1f4){logger[_0xf84c('0x24')](_0xf84c('0x20'),_0x38ebfa,_0x5d0788[_0xf84c('0x24')]['message']);return _0x2bcf70(_0x5d0788[_0xf84c('0x24')][_0xf84c('0x26')]);}logger[_0xf84c('0x24')](_0xf84c('0x20'),_0x38ebfa,_0x5d0788[_0xf84c('0x24')][_0xf84c('0x26')]);return _0x2f20c5(_0x5d0788[_0xf84c('0x24')][_0xf84c('0x26')]);}else{logger[_0xf84c('0x1f')](_0xf84c('0x20'),_0x38ebfa,_0xf84c('0x21'));_0x2f20c5(_0x5d0788[_0xf84c('0x27')][_0xf84c('0x26')]);}})['catch'](function(_0x474132){logger[_0xf84c('0x24')]('Network,\x20%s,\x20%s',_0x38ebfa,_0x474132);_0x2bcf70(_0x474132);});});}function respondWithStatusCode(_0x5d8a0e,_0x1f1bca){_0x1f1bca=_0x1f1bca||0xcc;return function(_0x39fe1d){if(_0x39fe1d){return _0x5d8a0e[_0xf84c('0x28')](_0x1f1bca);}return _0x5d8a0e[_0xf84c('0x29')](_0x1f1bca)['end']();};}function respondWithResult(_0x497388,_0x44f80a){_0x44f80a=_0x44f80a||0xc8;return function(_0x1c790e){if(_0x1c790e){return _0x497388[_0xf84c('0x29')](_0x44f80a)[_0xf84c('0x2a')](_0x1c790e);}};}function respondWithFilteredResult(_0x40168d,_0x36ab95){return function(_0x5aae8f){if(_0x5aae8f){var _0x831278=typeof _0x36ab95[_0xf84c('0x2b')]===_0xf84c('0x2c')&&typeof _0x36ab95[_0xf84c('0x2d')]===_0xf84c('0x2c');var _0x5c8541=_0x5aae8f[_0xf84c('0x2e')];var _0x55961e=_0x831278?0x0:_0x36ab95[_0xf84c('0x2b')];var _0x2ceab9=_0x831278?_0x5aae8f['count']:_0x36ab95[_0xf84c('0x2b')]+_0x36ab95[_0xf84c('0x2d')];var _0x4c0d84;if(_0x2ceab9>=_0x5c8541){_0x2ceab9=_0x5c8541;_0x4c0d84=0xc8;}else{_0x4c0d84=0xce;}_0x40168d[_0xf84c('0x29')](_0x4c0d84);return _0x40168d[_0xf84c('0x2f')]('Content-Range',_0x55961e+'-'+_0x2ceab9+'/'+_0x5c8541)['json'](_0x5aae8f);}return null;};}function patchUpdates(_0x51567a){return function(_0x97be38){try{jsonpatch[_0xf84c('0x30')](_0x97be38,_0x51567a,!![]);}catch(_0x2ced88){return BPromise[_0xf84c('0x31')](_0x2ced88);}return _0x97be38['save']();};}function saveUpdates(_0x55aa56,_0x97f041){return function(_0x2b3df3){if(_0x2b3df3){return _0x2b3df3[_0xf84c('0x32')](_0x55aa56)[_0xf84c('0x1e')](function(_0x52c77f){return _0x52c77f;});}return null;};}function removeEntity(_0x494db3,_0x167830){return function(_0x4949da){if(_0x4949da){return _0x4949da[_0xf84c('0x33')]()[_0xf84c('0x1e')](function(){_0x494db3[_0xf84c('0x29')](0xcc)[_0xf84c('0x34')]();});}};}function handleEntityNotFound(_0x2f7d0c,_0x2de985){return function(_0x425aa1){if(!_0x425aa1){_0x2f7d0c[_0xf84c('0x28')](0x194);}return _0x425aa1;};}function handleError(_0x243d53,_0x59abea){_0x59abea=_0x59abea||0x1f4;return function(_0x170cf1){logger[_0xf84c('0x24')](_0x170cf1[_0xf84c('0x35')]);if(_0x170cf1[_0xf84c('0x36')]){delete _0x170cf1['name'];}_0x243d53['status'](_0x59abea)[_0xf84c('0x37')](_0x170cf1);};}exports['index']=function(_0x56d37b,_0x269eee){var _0x1173b2={},_0x32529c={},_0x265bbd={'count':0x0,'rows':[]};var _0x2aa05a=_['map'](db['Network'][_0xf84c('0x38')],function(_0x3abae9){return{'name':_0x3abae9[_0xf84c('0x39')],'type':_0x3abae9[_0xf84c('0x3a')][_0xf84c('0x3b')]};});_0x32529c[_0xf84c('0x3c')]=_[_0xf84c('0x3d')](_0x2aa05a,'name');_0x32529c['query']=_[_0xf84c('0x3e')](_0x56d37b[_0xf84c('0x3f')]);_0x32529c['filters']=_[_0xf84c('0x40')](_0x32529c[_0xf84c('0x3c')],_0x32529c['query']);_0x1173b2['attributes']=_[_0xf84c('0x40')](_0x32529c[_0xf84c('0x3c')],qs['fields'](_0x56d37b['query'][_0xf84c('0x41')]));_0x1173b2[_0xf84c('0x42')]=_0x1173b2['attributes'][_0xf84c('0x43')]?_0x1173b2['attributes']:_0x32529c[_0xf84c('0x3c')];if(!_0x56d37b[_0xf84c('0x3f')][_0xf84c('0x44')]('nolimit')){_0x1173b2['limit']=qs[_0xf84c('0x2d')](_0x56d37b[_0xf84c('0x3f')]['limit']);_0x1173b2[_0xf84c('0x2b')]=qs[_0xf84c('0x2b')](_0x56d37b[_0xf84c('0x3f')][_0xf84c('0x2b')]);}_0x1173b2['order']=qs[_0xf84c('0x45')](_0x56d37b[_0xf84c('0x3f')]['sort']);_0x1173b2[_0xf84c('0x46')]=qs[_0xf84c('0x47')](_['pick'](_0x56d37b['query'],_0x32529c['filters']),_0x2aa05a);if(_0x56d37b['query']['filter']){_0x1173b2[_0xf84c('0x46')]=_[_0xf84c('0x48')](_0x1173b2[_0xf84c('0x46')],{'$or':_['map'](_0x2aa05a,function(_0x27cfca){if(_0x27cfca[_0xf84c('0x3a')]!==_0xf84c('0x49')){var _0x22b9b0={};_0x22b9b0[_0x27cfca[_0xf84c('0x36')]]={'$like':'%'+_0x56d37b[_0xf84c('0x3f')]['filter']+'%'};return _0x22b9b0;}})});}_0x1173b2=_[_0xf84c('0x48')]({},_0x1173b2,_0x56d37b[_0xf84c('0x4a')]);var _0xa68abf={'where':_0x1173b2[_0xf84c('0x46')]};return db['Network'][_0xf84c('0x2e')](_0xa68abf)[_0xf84c('0x1e')](function(_0x1e9ca1){_0x265bbd[_0xf84c('0x2e')]=_0x1e9ca1;if(_0x56d37b[_0xf84c('0x3f')][_0xf84c('0x4b')]){_0x1173b2[_0xf84c('0x4c')]=[{'all':!![]}];}return db[_0xf84c('0x4d')]['findAll'](_0x1173b2);})[_0xf84c('0x1e')](function(_0x39b80f){_0x265bbd[_0xf84c('0x4e')]=_0x39b80f;return _0x265bbd;})['then'](respondWithFilteredResult(_0x269eee,_0x1173b2))[_0xf84c('0x4f')](handleError(_0x269eee,null));};exports['show']=function(_0x47d256,_0x48d540){var _0x5873e5={'raw':!![],'where':{'id':_0x47d256[_0xf84c('0x50')]['id']}},_0x4c2ac1={};_0x4c2ac1[_0xf84c('0x3c')]=_['keys'](db['Network'][_0xf84c('0x38')]);_0x4c2ac1[_0xf84c('0x3f')]=_['keys'](_0x47d256[_0xf84c('0x3f')]);_0x4c2ac1[_0xf84c('0x47')]=_[_0xf84c('0x40')](_0x4c2ac1[_0xf84c('0x3c')],_0x4c2ac1[_0xf84c('0x3f')]);_0x5873e5['attributes']=_[_0xf84c('0x40')](_0x4c2ac1[_0xf84c('0x3c')],qs['fields'](_0x47d256[_0xf84c('0x3f')][_0xf84c('0x41')]));_0x5873e5[_0xf84c('0x42')]=_0x5873e5[_0xf84c('0x42')][_0xf84c('0x43')]?_0x5873e5[_0xf84c('0x42')]:_0x4c2ac1[_0xf84c('0x3c')];if(_0x47d256[_0xf84c('0x3f')]['includeAll']){_0x5873e5[_0xf84c('0x4c')]=[{'all':!![]}];}_0x5873e5=_[_0xf84c('0x48')]({},_0x5873e5,_0x47d256['options']);return db['Network']['find'](_0x5873e5)[_0xf84c('0x1e')](handleEntityNotFound(_0x48d540,null))[_0xf84c('0x1e')](respondWithResult(_0x48d540,null))[_0xf84c('0x4f')](handleError(_0x48d540,null));};exports[_0xf84c('0x51')]=function(_0x2a792e,_0x4056bd,_0x31651d){var _0x1bb246;return db['sequelize']['transaction'](function(_0x40ed28){return db['Network'][_0xf84c('0x51')](_0x2a792e[_0xf84c('0x52')],{'raw':!![]})[_0xf84c('0x1e')](function(_0x2e29fa){_0x1bb246=_0x2e29fa;return db['Network'][_0xf84c('0x53')]({'where':{'type':_0x2a792e[_0xf84c('0x52')][_0xf84c('0x3a')]},'raw':!![]});})[_0xf84c('0x1e')](function(_0x59a89a){if(_0x1bb246[_0xf84c('0x3a')][_0xf84c('0x54')]()=='STUN'){var _0x51133c=fs['readFileSync'](path['join'](config['root'],_0xf84c('0x55')),'utf8');var _0x33354c=ejs[_0xf84c('0x56')](_0x51133c,{'networks':_0x59a89a||[]});fs[_0xf84c('0x57')](_0xf84c('0x58'),_0x33354c);return respondWithRpcPromise(_0xf84c('0x59'),'create',{'module':_0xf84c('0x5a')});}else if(_0x1bb246[_0xf84c('0x3a')][_0xf84c('0x54')]()==_0xf84c('0x5b')){var _0x57718e=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x5f')),_0xf84c('0x60'));var _0x430d07=ejs[_0xf84c('0x56')](_0x57718e,{'networks':_0x59a89a||[]});fs['writeFileSync'](_0xf84c('0x61'),_0x430d07);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x51'),{'module':_0xf84c('0x5a')});}else{var _0xcacf28=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x62')),_0xf84c('0x60'));var _0x2a77b8=ejs[_0xf84c('0x56')](_0xcacf28,{'networks':_0x59a89a||[]});fs[_0xf84c('0x57')](util['format'](_0xf84c('0x63'),_0x2a792e[_0xf84c('0x52')][_0xf84c('0x3a')][_0xf84c('0x64')]()),_0x2a77b8);return respondWithRpcPromise(_0xf84c('0x59'),'create',{'module':_0xf84c('0x65')});}return null;})[_0xf84c('0x1e')](function(){return _0x1bb246;});})[_0xf84c('0x1e')](respondWithResult(_0x4056bd,0xc9))[_0xf84c('0x4f')](handleError(_0x4056bd,null));};exports[_0xf84c('0x32')]=function(_0x1d9b65,_0x620747,_0x3a6df3){var _0x170d19;return db[_0xf84c('0x66')][_0xf84c('0x67')](function(_0x2d2cda){return db['Network']['find']({'where':{'id':_0x1d9b65[_0xf84c('0x50')]['id']}})[_0xf84c('0x1e')](handleEntityNotFound(_0x620747,null))[_0xf84c('0x1e')](saveUpdates(_0x1d9b65['body'],null))[_0xf84c('0x1e')](function(_0x100237){if(_0x100237){_0x170d19=_0x100237;return db[_0xf84c('0x4d')][_0xf84c('0x53')]({'where':{'type':_0x170d19[_0xf84c('0x3a')]},'raw':!![]});}return null;})[_0xf84c('0x1e')](function(_0x344b1e){if(_0x170d19['type'][_0xf84c('0x54')]()==_0xf84c('0x68')){var _0x819c65=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x55')),_0xf84c('0x60'));var _0x23a97f=ejs['render'](_0x819c65,{'networks':_0x344b1e||[]});fs[_0xf84c('0x57')]('/etc/asterisk/stun_xcally.conf',_0x23a97f);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x32'),{'module':_0xf84c('0x5a')});}else if(_0x170d19[_0xf84c('0x3a')][_0xf84c('0x54')]()==_0xf84c('0x5b')){var _0x34bf3e=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x5f')),_0xf84c('0x60'));var _0x3e9d77=ejs[_0xf84c('0x56')](_0x34bf3e,{'networks':_0x344b1e||[]});fs[_0xf84c('0x57')](_0xf84c('0x61'),_0x3e9d77);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x32'),{'module':_0xf84c('0x5a')});}else{var _0x3a466b=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],'server/files/templates/network.ejs'),_0xf84c('0x60'));var _0x3740fb=ejs[_0xf84c('0x56')](_0x3a466b,{'networks':_0x344b1e||[]});fs['writeFileSync'](util[_0xf84c('0x69')](_0xf84c('0x63'),_0x1d9b65[_0xf84c('0x52')][_0xf84c('0x3a')][_0xf84c('0x64')]()),_0x3740fb);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x32'),{'module':_0xf84c('0x65')});}return null;})[_0xf84c('0x1e')](function(_0x5831a0){if(_0x5831a0){return _0x170d19;}return null;});})[_0xf84c('0x1e')](respondWithResult(_0x620747,null))[_0xf84c('0x4f')](handleError(_0x620747,null));};exports[_0xf84c('0x33')]=function(_0x517e14,_0x2df2f8,_0x119ab5){var _0x21ac5e;return db['Network'][_0xf84c('0x6a')]({'where':{'id':_0x517e14[_0xf84c('0x50')]['id']}})[_0xf84c('0x1e')](function(_0x950e91){_0x21ac5e=_0x950e91;return _0x950e91;})['then'](handleEntityNotFound(_0x2df2f8,null))['then'](removeEntity(_0x2df2f8,null))[_0xf84c('0x1e')](function(){if(_0x21ac5e){return db[_0xf84c('0x4d')][_0xf84c('0x53')]({'where':{'type':_0x21ac5e[_0xf84c('0x3a')]},'raw':!![]});}})[_0xf84c('0x1e')](function(_0x1d43bd){if(_0x21ac5e[_0xf84c('0x3a')]['toUpperCase']()==_0xf84c('0x68')){var _0x122b73=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x55')),_0xf84c('0x60'));var _0x117c3b=ejs[_0xf84c('0x56')](_0x122b73,{'networks':_0x1d43bd||[]});fs[_0xf84c('0x57')](_0xf84c('0x58'),_0x117c3b);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x21ac5e[_0xf84c('0x3a')][_0xf84c('0x54')]()==_0xf84c('0x5b')){var _0x3f3af0=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x5f')),_0xf84c('0x60'));var _0x2cf858=ejs[_0xf84c('0x56')](_0x3f3af0,{'networks':_0x1d43bd||[]});fs[_0xf84c('0x57')]('/etc/asterisk/turn_xcally.conf',_0x2cf858);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x33'),{'module':_0xf84c('0x5a')});}else{var _0x13edab=fs[_0xf84c('0x5c')](path[_0xf84c('0x5d')](config[_0xf84c('0x5e')],_0xf84c('0x62')),'utf8');var _0x3c655b=ejs['render'](_0x13edab,{'networks':_0x1d43bd||[]});fs[_0xf84c('0x57')](util[_0xf84c('0x69')](_0xf84c('0x63'),_0x517e14[_0xf84c('0x52')]['type'][_0xf84c('0x64')]()),_0x3c655b);return respondWithRpcPromise(_0xf84c('0x59'),_0xf84c('0x33'),{'module':_0xf84c('0x65')});}return null;})['catch'](handleError(_0x2df2f8,null));}; \ No newline at end of file +var _0xfe11=['order','sort','pick','filter','where','merge','options','Network','includeAll','include','findAll','rows','show','find','create','sequelize','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','join','writeFileSync','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','transaction','params','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfe11,0x94));var _0x1fe1=function(_0x2a26da,_0x3dfca3){_0x2a26da=_0x2a26da-0x0;var _0x59fc7f=_0xfe11[_0x2a26da];return _0x59fc7f;};'use strict';var emlformat=require(_0x1fe1('0x0'));var rimraf=require(_0x1fe1('0x1'));var zipdir=require(_0x1fe1('0x2'));var jsonpatch=require(_0x1fe1('0x3'));var rp=require(_0x1fe1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1fe1('0x5'));var util=require(_0x1fe1('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(_0x1fe1('0x7'));var _=require(_0x1fe1('0x8'));var squel=require(_0x1fe1('0x9'));var crypto=require(_0x1fe1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1fe1('0xb'));var toCsv=require(_0x1fe1('0xc'));var querystring=require(_0x1fe1('0xd'));var Papa=require(_0x1fe1('0xe'));var Redis=require(_0x1fe1('0xf'));var authService=require(_0x1fe1('0x10'));var qs=require(_0x1fe1('0x11'));var as=require(_0x1fe1('0x12'));var hardwareService=require(_0x1fe1('0x13'));var logger=require(_0x1fe1('0x14'))('api');var utils=require(_0x1fe1('0x15'));var config=require(_0x1fe1('0x16'));var licenseUtil=require(_0x1fe1('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x1fe1('0x18')][_0x1fe1('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x10a5cd,_0x205a46,_0x20c967,_0x4320e0){return new BPromise(function(_0x19bc68,_0x3fe105){var _0x45db0a=_0x4320e0||client;return _0x45db0a[_0x1fe1('0x1a')](_0x10a5cd,_0x20c967)[_0x1fe1('0x1b')](function(_0x405e77){logger['info'](_0x1fe1('0x1c'),_0x205a46,_0x1fe1('0x1d'));logger[_0x1fe1('0x1e')](_0x1fe1('0x1f'),_0x205a46,_0x1fe1('0x1d'),JSON[_0x1fe1('0x20')](_0x405e77));if(_0x405e77['error']){if(_0x405e77[_0x1fe1('0x21')][_0x1fe1('0x22')]===0x1f4){logger[_0x1fe1('0x21')](_0x1fe1('0x1c'),_0x205a46,_0x405e77[_0x1fe1('0x21')][_0x1fe1('0x23')]);return _0x3fe105(_0x405e77[_0x1fe1('0x21')]['message']);}logger[_0x1fe1('0x21')](_0x1fe1('0x1c'),_0x205a46,_0x405e77[_0x1fe1('0x21')]['message']);return _0x19bc68(_0x405e77[_0x1fe1('0x21')][_0x1fe1('0x23')]);}else{logger[_0x1fe1('0x24')](_0x1fe1('0x1c'),_0x205a46,'request\x20sent');_0x19bc68(_0x405e77[_0x1fe1('0x25')][_0x1fe1('0x23')]);}})[_0x1fe1('0x26')](function(_0x5af052){logger[_0x1fe1('0x21')](_0x1fe1('0x1c'),_0x205a46,_0x5af052);_0x3fe105(_0x5af052);});});}function respondWithStatusCode(_0x5e9aee,_0x1fc074){_0x1fc074=_0x1fc074||0xcc;return function(_0x2da3fa){if(_0x2da3fa){return _0x5e9aee[_0x1fe1('0x27')](_0x1fc074);}return _0x5e9aee[_0x1fe1('0x28')](_0x1fc074)[_0x1fe1('0x29')]();};}function respondWithResult(_0x5eb7aa,_0x191940){_0x191940=_0x191940||0xc8;return function(_0x18a457){if(_0x18a457){return _0x5eb7aa['status'](_0x191940)[_0x1fe1('0x2a')](_0x18a457);}};}function respondWithFilteredResult(_0x1d685b,_0x2b89e0){return function(_0x20c1e4){if(_0x20c1e4){var _0x477d3a=typeof _0x2b89e0['offset']===_0x1fe1('0x2b')&&typeof _0x2b89e0[_0x1fe1('0x2c')]===_0x1fe1('0x2b');var _0x40a1bf=_0x20c1e4[_0x1fe1('0x2d')];var _0x4877af=_0x477d3a?0x0:_0x2b89e0[_0x1fe1('0x2e')];var _0x13d2bf=_0x477d3a?_0x20c1e4['count']:_0x2b89e0[_0x1fe1('0x2e')]+_0x2b89e0['limit'];var _0x4c4d2f;if(_0x13d2bf>=_0x40a1bf){_0x13d2bf=_0x40a1bf;_0x4c4d2f=0xc8;}else{_0x4c4d2f=0xce;}_0x1d685b[_0x1fe1('0x28')](_0x4c4d2f);return _0x1d685b[_0x1fe1('0x2f')](_0x1fe1('0x30'),_0x4877af+'-'+_0x13d2bf+'/'+_0x40a1bf)[_0x1fe1('0x2a')](_0x20c1e4);}return null;};}function patchUpdates(_0x3efe9c){return function(_0x5a31a7){try{jsonpatch[_0x1fe1('0x31')](_0x5a31a7,_0x3efe9c,!![]);}catch(_0x581e02){return BPromise[_0x1fe1('0x32')](_0x581e02);}return _0x5a31a7[_0x1fe1('0x33')]();};}function saveUpdates(_0xf1ffb,_0x631f34){return function(_0x2ecfb7){if(_0x2ecfb7){return _0x2ecfb7[_0x1fe1('0x34')](_0xf1ffb)[_0x1fe1('0x1b')](function(_0x3d0dbd){return _0x3d0dbd;});}return null;};}function removeEntity(_0x4e6b79,_0x1fc4fb){return function(_0x1c811d){if(_0x1c811d){return _0x1c811d[_0x1fe1('0x35')]()[_0x1fe1('0x1b')](function(){_0x4e6b79[_0x1fe1('0x28')](0xcc)[_0x1fe1('0x29')]();});}};}function handleEntityNotFound(_0x4d64ea,_0x4e03b7){return function(_0x39292c){if(!_0x39292c){_0x4d64ea[_0x1fe1('0x27')](0x194);}return _0x39292c;};}function handleError(_0x429cb6,_0x3be60d){_0x3be60d=_0x3be60d||0x1f4;return function(_0x241dc7){logger[_0x1fe1('0x21')](_0x241dc7['stack']);if(_0x241dc7[_0x1fe1('0x36')]){delete _0x241dc7['name'];}_0x429cb6[_0x1fe1('0x28')](_0x3be60d)[_0x1fe1('0x37')](_0x241dc7);};}exports[_0x1fe1('0x38')]=function(_0x23f09d,_0x30597f){var _0x3cb239={},_0x3114c9={},_0x4a3e81={'count':0x0,'rows':[]};var _0x3397b8=_[_0x1fe1('0x39')](db['Network'][_0x1fe1('0x3a')],function(_0x17e517){return{'name':_0x17e517[_0x1fe1('0x3b')],'type':_0x17e517[_0x1fe1('0x3c')]['key']};});_0x3114c9[_0x1fe1('0x3d')]=_['map'](_0x3397b8,_0x1fe1('0x36'));_0x3114c9[_0x1fe1('0x3e')]=_[_0x1fe1('0x3f')](_0x23f09d[_0x1fe1('0x3e')]);_0x3114c9[_0x1fe1('0x40')]=_[_0x1fe1('0x41')](_0x3114c9[_0x1fe1('0x3d')],_0x3114c9[_0x1fe1('0x3e')]);_0x3cb239[_0x1fe1('0x42')]=_[_0x1fe1('0x41')](_0x3114c9[_0x1fe1('0x3d')],qs[_0x1fe1('0x43')](_0x23f09d[_0x1fe1('0x3e')]['fields']));_0x3cb239[_0x1fe1('0x42')]=_0x3cb239[_0x1fe1('0x42')][_0x1fe1('0x44')]?_0x3cb239[_0x1fe1('0x42')]:_0x3114c9['model'];if(!_0x23f09d[_0x1fe1('0x3e')][_0x1fe1('0x45')]('nolimit')){_0x3cb239['limit']=qs[_0x1fe1('0x2c')](_0x23f09d[_0x1fe1('0x3e')][_0x1fe1('0x2c')]);_0x3cb239[_0x1fe1('0x2e')]=qs['offset'](_0x23f09d[_0x1fe1('0x3e')]['offset']);}_0x3cb239[_0x1fe1('0x46')]=qs[_0x1fe1('0x47')](_0x23f09d[_0x1fe1('0x3e')]['sort']);_0x3cb239['where']=qs[_0x1fe1('0x40')](_[_0x1fe1('0x48')](_0x23f09d['query'],_0x3114c9[_0x1fe1('0x40')]),_0x3397b8);if(_0x23f09d[_0x1fe1('0x3e')][_0x1fe1('0x49')]){_0x3cb239[_0x1fe1('0x4a')]=_[_0x1fe1('0x4b')](_0x3cb239['where'],{'$or':_[_0x1fe1('0x39')](_0x3397b8,function(_0x1516f0){if(_0x1516f0['type']!=='VIRTUAL'){var _0x16274f={};_0x16274f[_0x1516f0[_0x1fe1('0x36')]]={'$like':'%'+_0x23f09d[_0x1fe1('0x3e')]['filter']+'%'};return _0x16274f;}})});}_0x3cb239=_[_0x1fe1('0x4b')]({},_0x3cb239,_0x23f09d[_0x1fe1('0x4c')]);var _0x4c92={'where':_0x3cb239[_0x1fe1('0x4a')]};return db[_0x1fe1('0x4d')][_0x1fe1('0x2d')](_0x4c92)[_0x1fe1('0x1b')](function(_0x16b6d4){_0x4a3e81[_0x1fe1('0x2d')]=_0x16b6d4;if(_0x23f09d[_0x1fe1('0x3e')][_0x1fe1('0x4e')]){_0x3cb239[_0x1fe1('0x4f')]=[{'all':!![]}];}return db['Network'][_0x1fe1('0x50')](_0x3cb239);})[_0x1fe1('0x1b')](function(_0x5c7c1d){_0x4a3e81[_0x1fe1('0x51')]=_0x5c7c1d;return _0x4a3e81;})[_0x1fe1('0x1b')](respondWithFilteredResult(_0x30597f,_0x3cb239))[_0x1fe1('0x26')](handleError(_0x30597f,null));};exports[_0x1fe1('0x52')]=function(_0x261bfb,_0x128dc7){var _0x13d7db={'raw':!![],'where':{'id':_0x261bfb['params']['id']}},_0x54343e={};_0x54343e[_0x1fe1('0x3d')]=_[_0x1fe1('0x3f')](db[_0x1fe1('0x4d')][_0x1fe1('0x3a')]);_0x54343e['query']=_[_0x1fe1('0x3f')](_0x261bfb[_0x1fe1('0x3e')]);_0x54343e['filters']=_[_0x1fe1('0x41')](_0x54343e[_0x1fe1('0x3d')],_0x54343e[_0x1fe1('0x3e')]);_0x13d7db['attributes']=_[_0x1fe1('0x41')](_0x54343e[_0x1fe1('0x3d')],qs[_0x1fe1('0x43')](_0x261bfb[_0x1fe1('0x3e')][_0x1fe1('0x43')]));_0x13d7db[_0x1fe1('0x42')]=_0x13d7db[_0x1fe1('0x42')]['length']?_0x13d7db[_0x1fe1('0x42')]:_0x54343e['model'];if(_0x261bfb[_0x1fe1('0x3e')][_0x1fe1('0x4e')]){_0x13d7db[_0x1fe1('0x4f')]=[{'all':!![]}];}_0x13d7db=_[_0x1fe1('0x4b')]({},_0x13d7db,_0x261bfb[_0x1fe1('0x4c')]);return db[_0x1fe1('0x4d')][_0x1fe1('0x53')](_0x13d7db)[_0x1fe1('0x1b')](handleEntityNotFound(_0x128dc7,null))['then'](respondWithResult(_0x128dc7,null))['catch'](handleError(_0x128dc7,null));};exports[_0x1fe1('0x54')]=function(_0x12508f,_0x1af533,_0x59a0f1){var _0x6dc73e;return db[_0x1fe1('0x55')]['transaction'](function(_0x266448){return db[_0x1fe1('0x4d')]['create'](_0x12508f['body'],{'raw':!![]})[_0x1fe1('0x1b')](function(_0x5ef4ab){_0x6dc73e=_0x5ef4ab;return db[_0x1fe1('0x4d')][_0x1fe1('0x50')]({'where':{'type':_0x12508f[_0x1fe1('0x56')][_0x1fe1('0x3c')]},'raw':!![]});})[_0x1fe1('0x1b')](function(_0x52bdc1){if(_0x6dc73e[_0x1fe1('0x3c')][_0x1fe1('0x57')]()==_0x1fe1('0x58')){var _0x444fac=fs[_0x1fe1('0x59')](path['join'](config[_0x1fe1('0x5a')],_0x1fe1('0x5b')),_0x1fe1('0x5c'));var _0x55705f=ejs[_0x1fe1('0x5d')](_0x444fac,{'networks':_0x52bdc1||[]});fs['writeFileSync'](_0x1fe1('0x5e'),_0x55705f);return respondWithRpcPromise('Reload',_0x1fe1('0x54'),{'module':_0x1fe1('0x5f')});}else if(_0x6dc73e[_0x1fe1('0x3c')][_0x1fe1('0x57')]()==_0x1fe1('0x60')){var _0xdd6bd6=fs['readFileSync'](path[_0x1fe1('0x61')](config[_0x1fe1('0x5a')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x553363=ejs[_0x1fe1('0x5d')](_0xdd6bd6,{'networks':_0x52bdc1||[]});fs[_0x1fe1('0x62')](_0x1fe1('0x63'),_0x553363);return respondWithRpcPromise('Reload',_0x1fe1('0x54'),{'module':_0x1fe1('0x5f')});}else{var _0x53b189=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config[_0x1fe1('0x5a')],'server/files/templates/network.ejs'),_0x1fe1('0x5c'));var _0x1c14bc=ejs[_0x1fe1('0x5d')](_0x53b189,{'networks':_0x52bdc1||[]});fs[_0x1fe1('0x62')](util[_0x1fe1('0x64')](_0x1fe1('0x65'),_0x12508f[_0x1fe1('0x56')][_0x1fe1('0x3c')][_0x1fe1('0x66')]()),_0x1c14bc);return respondWithRpcPromise(_0x1fe1('0x67'),_0x1fe1('0x54'),{'module':'chan_sip.so'});}return null;})[_0x1fe1('0x1b')](function(){return _0x6dc73e;});})['then'](respondWithResult(_0x1af533,0xc9))['catch'](handleError(_0x1af533,null));};exports[_0x1fe1('0x34')]=function(_0x26e1a2,_0x1f2f3a,_0x3f212a){var _0x37ddab;return db[_0x1fe1('0x55')][_0x1fe1('0x68')](function(_0x3ef595){return db[_0x1fe1('0x4d')][_0x1fe1('0x53')]({'where':{'id':_0x26e1a2[_0x1fe1('0x69')]['id']}})['then'](handleEntityNotFound(_0x1f2f3a,null))[_0x1fe1('0x1b')](saveUpdates(_0x26e1a2['body'],null))[_0x1fe1('0x1b')](function(_0x184cff){if(_0x184cff){_0x37ddab=_0x184cff;return db['Network'][_0x1fe1('0x50')]({'where':{'type':_0x37ddab['type']},'raw':!![]});}return null;})[_0x1fe1('0x1b')](function(_0x27cadd){if(_0x37ddab[_0x1fe1('0x3c')][_0x1fe1('0x57')]()==_0x1fe1('0x58')){var _0x57875e=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config[_0x1fe1('0x5a')],_0x1fe1('0x5b')),_0x1fe1('0x5c'));var _0x161070=ejs[_0x1fe1('0x5d')](_0x57875e,{'networks':_0x27cadd||[]});fs[_0x1fe1('0x62')]('/etc/asterisk/stun_xcally.conf',_0x161070);return respondWithRpcPromise(_0x1fe1('0x67'),_0x1fe1('0x34'),{'module':_0x1fe1('0x5f')});}else if(_0x37ddab[_0x1fe1('0x3c')][_0x1fe1('0x57')]()=='TURN'){var _0x1df5ca=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config['root'],_0x1fe1('0x6a')),_0x1fe1('0x5c'));var _0x21fd6c=ejs[_0x1fe1('0x5d')](_0x1df5ca,{'networks':_0x27cadd||[]});fs[_0x1fe1('0x62')]('/etc/asterisk/turn_xcally.conf',_0x21fd6c);return respondWithRpcPromise('Reload','update',{'module':_0x1fe1('0x5f')});}else{var _0x53702d=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config['root'],_0x1fe1('0x6b')),_0x1fe1('0x5c'));var _0x399e1b=ejs[_0x1fe1('0x5d')](_0x53702d,{'networks':_0x27cadd||[]});fs[_0x1fe1('0x62')](util[_0x1fe1('0x64')](_0x1fe1('0x65'),_0x26e1a2[_0x1fe1('0x56')][_0x1fe1('0x3c')][_0x1fe1('0x66')]()),_0x399e1b);return respondWithRpcPromise(_0x1fe1('0x67'),'update',{'module':'chan_sip.so'});}return null;})[_0x1fe1('0x1b')](function(_0x4f4d81){if(_0x4f4d81){return _0x37ddab;}return null;});})['then'](respondWithResult(_0x1f2f3a,null))['catch'](handleError(_0x1f2f3a,null));};exports[_0x1fe1('0x35')]=function(_0x3d5084,_0x36f502,_0x33dde4){var _0x1e51b9;return db[_0x1fe1('0x4d')]['find']({'where':{'id':_0x3d5084[_0x1fe1('0x69')]['id']}})['then'](function(_0x27cd7f){_0x1e51b9=_0x27cd7f;return _0x27cd7f;})[_0x1fe1('0x1b')](handleEntityNotFound(_0x36f502,null))[_0x1fe1('0x1b')](removeEntity(_0x36f502,null))[_0x1fe1('0x1b')](function(){if(_0x1e51b9){return db[_0x1fe1('0x4d')][_0x1fe1('0x50')]({'where':{'type':_0x1e51b9[_0x1fe1('0x3c')]},'raw':!![]});}})['then'](function(_0x586707){if(_0x1e51b9[_0x1fe1('0x3c')][_0x1fe1('0x57')]()==_0x1fe1('0x58')){var _0x459bbb=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config[_0x1fe1('0x5a')],_0x1fe1('0x5b')),'utf8');var _0x43e382=ejs[_0x1fe1('0x5d')](_0x459bbb,{'networks':_0x586707||[]});fs['writeFileSync'](_0x1fe1('0x5e'),_0x43e382);return respondWithRpcPromise(_0x1fe1('0x67'),'destroy',{'module':_0x1fe1('0x5f')});}else if(_0x1e51b9[_0x1fe1('0x3c')][_0x1fe1('0x57')]()==_0x1fe1('0x60')){var _0x83ac1=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x1fe1('0x5c'));var _0x4822f9=ejs[_0x1fe1('0x5d')](_0x83ac1,{'networks':_0x586707||[]});fs[_0x1fe1('0x62')](_0x1fe1('0x63'),_0x4822f9);return respondWithRpcPromise(_0x1fe1('0x67'),_0x1fe1('0x35'),{'module':_0x1fe1('0x5f')});}else{var _0x33f457=fs[_0x1fe1('0x59')](path[_0x1fe1('0x61')](config['root'],'server/files/templates/network.ejs'),_0x1fe1('0x5c'));var _0x2d748d=ejs['render'](_0x33f457,{'networks':_0x586707||[]});fs['writeFileSync'](util[_0x1fe1('0x64')](_0x1fe1('0x65'),_0x3d5084['body']['type']['toLowerCase']()),_0x2d748d);return respondWithRpcPromise(_0x1fe1('0x67'),_0x1fe1('0x35'),{'module':_0x1fe1('0x6c')});}return null;})[_0x1fe1('0x26')](handleError(_0x36f502,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 260a65f..59a5801 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 _0xd8b0=['define','network','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4887a9,_0x4b0d83){var _0x23c160=function(_0x526746){while(--_0x526746){_0x4887a9['push'](_0x4887a9['shift']());}};_0x23c160(++_0x4b0d83);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('Network',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf93=['bluebird','path','rimraf','../../config/environment','./network.attributes','exports','Network','lodash','util','moment'];(function(_0x608943,_0x4c0dcf){var _0x4d8f8f=function(_0x482b7a){while(--_0x482b7a){_0x608943['push'](_0x608943['shift']());}};_0x4d8f8f(++_0x4c0dcf);}(_0xaf93,0x151));var _0x3af9=function(_0x316923,_0x435111){_0x316923=_0x316923-0x0;var _0x1ce888=_0xaf93[_0x316923];return _0x1ce888;};'use strict';var _=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3af9('0x2'));var BPromise=require(_0x3af9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3af9('0x4'));var rimraf=require(_0x3af9('0x5'));var config=require(_0x3af9('0x6'));var attributes=require(_0x3af9('0x7'));module[_0x3af9('0x8')]=function(_0x1ad446,_0x333abb){return _0x1ad446['define'](_0x3af9('0x9'),attributes,{'tableName':'network','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 df519ef..ec95f9e 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x51ea6b,_0x43b50f){_0x51ea6b=_0x51ea6b-0x0;var _0x3d1e39=_0x7a54[_0x51ea6b];return _0x3d1e39;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +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(_0x5f1d51,_0x132709){var _0x27e871=function(_0x2bbdfd){while(--_0x2bbdfd){_0x5f1d51['push'](_0x5f1d51['shift']());}};_0x27e871(++_0x132709);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 79adebf..57851df 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 _0xb34c=['describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','create','post','/:id/notify','notify','addAgents','/:id/send','put','/:id','update','destroy','delete','removeDispositions','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/describe'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb34c,0x1a4));var _0xcb34=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb34c[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb34('0x0'));var timeout=require(_0xcb34('0x1'));var express=require(_0xcb34('0x2'));var router=express[_0xcb34('0x3')]();var fs_extra=require(_0xcb34('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb34('0x5'));var controller=require('./openchannelAccount.controller');router[_0xcb34('0x6')]('/',auth[_0xcb34('0x7')](),controller['index']);router[_0xcb34('0x6')](_0xcb34('0x8'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x9')]);router[_0xcb34('0x6')]('/:id',auth[_0xcb34('0x7')](),controller[_0xcb34('0xa')]);router['get'](_0xcb34('0xb'),auth[_0xcb34('0x7')](),controller[_0xcb34('0xc')]);router[_0xcb34('0x6')](_0xcb34('0xd'),auth[_0xcb34('0x7')](),controller[_0xcb34('0xe')]);router[_0xcb34('0x6')](_0xcb34('0xf'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x10')]);router[_0xcb34('0x6')](_0xcb34('0x11'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x12')]);router['get'](_0xcb34('0x13'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xcb34('0x7')](),controller[_0xcb34('0x14')]);router[_0xcb34('0x15')]('/:id/dispositions',auth[_0xcb34('0x7')](),controller['addDisposition']);router[_0xcb34('0x15')](_0xcb34('0xd'),auth[_0xcb34('0x7')](),controller['addAnswer']);router[_0xcb34('0x15')](_0xcb34('0x16'),controller[_0xcb34('0x17')]);router[_0xcb34('0x15')](_0xcb34('0xf'),auth['isAuthenticated'](),controller['addApplications']);router['post']('/:id/users',auth[_0xcb34('0x7')](),controller[_0xcb34('0x18')]);router[_0xcb34('0x15')](_0xcb34('0x19'),auth[_0xcb34('0x7')](),controller['send']);router[_0xcb34('0x1a')](_0xcb34('0x1b'),auth['isAuthenticated'](),controller[_0xcb34('0x1c')]);router['delete']('/:id',auth[_0xcb34('0x7')](),controller[_0xcb34('0x1d')]);router[_0xcb34('0x1e')](_0xcb34('0xb'),auth[_0xcb34('0x7')](),controller[_0xcb34('0x1f')]);router[_0xcb34('0x1e')](_0xcb34('0xd'),auth[_0xcb34('0x7')](),controller['removeAnswers']);router[_0xcb34('0x1e')]('/:id/users',auth[_0xcb34('0x7')](),controller['removeAgents']);module[_0xcb34('0x20')]=router; \ No newline at end of file +var _0x4045=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','/:id/applications','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4045,0x1ac));var _0x5404=function(_0x581181,_0xc683a0){_0x581181=_0x581181-0x0;var _0x1f2025=_0x4045[_0x581181];return _0x1f2025;};'use strict';var multer=require(_0x5404('0x0'));var util=require('util');var path=require(_0x5404('0x1'));var timeout=require(_0x5404('0x2'));var express=require(_0x5404('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5404('0x4'));var interaction=require(_0x5404('0x5'));var config=require(_0x5404('0x6'));var controller=require('./openchannelAccount.controller');router[_0x5404('0x7')]('/',auth['isAuthenticated'](),controller[_0x5404('0x8')]);router[_0x5404('0x7')]('/describe',auth[_0x5404('0x9')](),controller[_0x5404('0xa')]);router[_0x5404('0x7')](_0x5404('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5404('0xc'),auth[_0x5404('0x9')](),controller[_0x5404('0xd')]);router[_0x5404('0x7')](_0x5404('0xe'),auth[_0x5404('0x9')](),controller[_0x5404('0xf')]);router[_0x5404('0x7')]('/:id/applications',auth[_0x5404('0x9')](),controller[_0x5404('0x10')]);router[_0x5404('0x7')](_0x5404('0x11'),auth[_0x5404('0x9')](),controller['getInteractions']);router['get'](_0x5404('0x12'),auth[_0x5404('0x9')](),controller[_0x5404('0x13')]);router[_0x5404('0x14')]('/',auth[_0x5404('0x9')](),controller[_0x5404('0x15')]);router[_0x5404('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x5404('0x14')](_0x5404('0xe'),auth[_0x5404('0x9')](),controller[_0x5404('0x16')]);router['post'](_0x5404('0x17'),controller['notify']);router['post'](_0x5404('0x18'),auth[_0x5404('0x9')](),controller[_0x5404('0x19')]);router[_0x5404('0x14')](_0x5404('0x12'),auth[_0x5404('0x9')](),controller[_0x5404('0x1a')]);router[_0x5404('0x14')]('/:id/send',auth[_0x5404('0x9')](),controller[_0x5404('0x1b')]);router[_0x5404('0x1c')](_0x5404('0xb'),auth['isAuthenticated'](),controller[_0x5404('0x1d')]);router[_0x5404('0x1e')](_0x5404('0xb'),auth['isAuthenticated'](),controller[_0x5404('0x1f')]);router[_0x5404('0x1e')]('/:id/dispositions',auth[_0x5404('0x9')](),controller[_0x5404('0x20')]);router['delete'](_0x5404('0xe'),auth['isAuthenticated'](),controller[_0x5404('0x21')]);router[_0x5404('0x1e')](_0x5404('0x12'),auth[_0x5404('0x9')](),controller[_0x5404('0x22')]);module[_0x5404('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2abab4f..275a73c 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 _0x9b90=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate'];(function(_0x91f14d,_0x3fb045){var _0x5afda6=function(_0x397230){while(--_0x397230){_0x91f14d['push'](_0x91f14d['shift']());}};_0x5afda6(++_0x3fb045);}(_0x9b90,0x1a9));var _0x09b9=function(_0x578415,_0x4229bd){_0x578415=_0x578415-0x0;var _0x171c0d=_0x9b90[_0x578415];return _0x171c0d;};'use strict';var Sequelize=require(_0x09b9('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x09b9('0x1')],'unique':_0x09b9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x09b9('0x1')]},'token':{'type':Sequelize[_0x09b9('0x1')],'defaultValue':function(){return rs[_0x09b9('0x3')]();}},'replyUri':{'type':Sequelize[_0x09b9('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x09b9('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x09b9('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x09b9('0x1')]},'queueTransfer':{'type':Sequelize[_0x09b9('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x09b9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x09b9('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x09b9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x09b9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x09b9('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x144526){if(!_0x144526)this[_0x09b9('0x8')](_0x09b9('0x9'),null);this[_0x09b9('0x8')](_0x09b9('0xa'),_0x144526);}}}; \ No newline at end of file +var _0xe901=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0xbbc3d8,_0x13c839){var _0x45c0a3=function(_0x40845b){while(--_0x40845b){_0xbbc3d8['push'](_0xbbc3d8['shift']());}};_0x45c0a3(++_0x13c839);}(_0xe901,0x109));var _0x1e90=function(_0x37f5a1,_0x461925){_0x37f5a1=_0x37f5a1-0x0;var _0x3a97a5=_0xe901[_0x37f5a1];return _0x3a97a5;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1e90('0x0'));module[_0x1e90('0x1')]={'name':{'type':Sequelize[_0x1e90('0x2')],'unique':_0x1e90('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1e90('0x2')]},'token':{'type':Sequelize[_0x1e90('0x2')],'defaultValue':function(){return rs[_0x1e90('0x4')]();}},'replyUri':{'type':Sequelize[_0x1e90('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1e90('0x5');}},'notificationSound':{'type':Sequelize[_0x1e90('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1e90('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e90('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1e90('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1e90('0x6')],'defaultValue':![],'comment':_0x1e90('0x9'),'set':function(_0x1718e1){if(!_0x1718e1)this[_0x1e90('0xa')](_0x1e90('0xb'),null);this['setDataValue'](_0x1e90('0xc'),_0x1718e1);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1266ef5..89e2acc 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 _0x0789=['sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','Pause','mandatoryDispositionPause','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','rows','ids','addAnswer','getAnswers','CannedAnswer','length','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','findOne','getApplications','hasOwnProperty','getInteractions','Contact','fullname','internal','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','OpenchannelAccounts','stack','name','send','index','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0789,0x132));var _0x9078=function(_0x5b3d9c,_0x40421a){_0x5b3d9c=_0x5b3d9c-0x0;var _0x5cdb6f=_0x0789[_0x5b3d9c];return _0x5cdb6f;};'use strict';var emlformat=require(_0x9078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9078('0x1'));var jsonpatch=require(_0x9078('0x2'));var rp=require(_0x9078('0x3'));var moment=require('moment');var BPromise=require(_0x9078('0x4'));var Mustache=require(_0x9078('0x5'));var util=require(_0x9078('0x6'));var path=require(_0x9078('0x7'));var sox=require(_0x9078('0x8'));var csv=require('to-csv');var ejs=require(_0x9078('0x9'));var fs=require('fs');var fs_extra=require(_0x9078('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9078('0xb'));var deskjs=require(_0x9078('0xc'));var toCsv=require(_0x9078('0xd'));var querystring=require(_0x9078('0xe'));var Papa=require(_0x9078('0xf'));var Redis=require('ioredis');var authService=require(_0x9078('0x10'));var qs=require(_0x9078('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9078('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9078('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9078('0x14'));var db=require(_0x9078('0x15'))['db'];config['redis']=_[_0x9078('0x16')](config[_0x9078('0x17')],{'host':_0x9078('0x18'),'port':0x18eb});var socket=require(_0x9078('0x19'))(new Redis(config[_0x9078('0x17')]));require(_0x9078('0x1a'))[_0x9078('0x1b')](socket);var jayson=require(_0x9078('0x1c'));var client=jayson[_0x9078('0x1d')][_0x9078('0x1e')]({'port':0x232c});var client9002=jayson[_0x9078('0x1d')][_0x9078('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x221c3e,_0x3bd04c,_0x31b46e,_0x12290d){return new BPromise(function(_0x263634,_0x9d35e8){var _0x4e2085=_0x12290d||client;return _0x4e2085[_0x9078('0x1f')](_0x221c3e,_0x31b46e)['then'](function(_0xe8bc62){logger[_0x9078('0x20')](_0x9078('0x21'),_0x3bd04c,_0x9078('0x22'));logger[_0x9078('0x23')](_0x9078('0x24'),_0x3bd04c,'request\x20sent',JSON['stringify'](_0xe8bc62));if(_0xe8bc62[_0x9078('0x25')]){if(_0xe8bc62[_0x9078('0x25')]['code']===0x1f4){logger[_0x9078('0x25')](_0x9078('0x21'),_0x3bd04c,_0xe8bc62[_0x9078('0x25')][_0x9078('0x26')]);return _0x9d35e8(_0xe8bc62[_0x9078('0x25')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3bd04c,_0xe8bc62[_0x9078('0x25')][_0x9078('0x26')]);return _0x263634(_0xe8bc62['error'][_0x9078('0x26')]);}else{logger[_0x9078('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x3bd04c,'request\x20sent');_0x263634(_0xe8bc62[_0x9078('0x27')][_0x9078('0x26')]);}})['catch'](function(_0x47183c){logger[_0x9078('0x25')](_0x9078('0x21'),_0x3bd04c,_0x47183c);_0x9d35e8(_0x47183c);});});}function respondWithStatusCode(_0xd5a1b9,_0x590484){_0x590484=_0x590484||0xcc;return function(_0x2f8157){if(_0x2f8157){return _0xd5a1b9[_0x9078('0x28')](_0x590484);}return _0xd5a1b9[_0x9078('0x29')](_0x590484)[_0x9078('0x2a')]();};}function respondWithResult(_0x48fb28,_0x15cd6e){_0x15cd6e=_0x15cd6e||0xc8;return function(_0x1a9a6e){if(_0x1a9a6e){return _0x48fb28[_0x9078('0x29')](_0x15cd6e)[_0x9078('0x2b')](_0x1a9a6e);}};}function respondWithFilteredResult(_0x5b271d,_0xee391f){return function(_0x4889db){if(_0x4889db){var _0x3b0e87=typeof _0xee391f['offset']===_0x9078('0x2c')&&typeof _0xee391f['limit']==='undefined';var _0x4415f4=_0x4889db[_0x9078('0x2d')];var _0x4244f6=_0x3b0e87?0x0:_0xee391f[_0x9078('0x2e')];var _0x519b8a=_0x3b0e87?_0x4889db[_0x9078('0x2d')]:_0xee391f[_0x9078('0x2e')]+_0xee391f[_0x9078('0x2f')];var _0x2246cc;if(_0x519b8a>=_0x4415f4){_0x519b8a=_0x4415f4;_0x2246cc=0xc8;}else{_0x2246cc=0xce;}_0x5b271d[_0x9078('0x29')](_0x2246cc);return _0x5b271d[_0x9078('0x30')](_0x9078('0x31'),_0x4244f6+'-'+_0x519b8a+'/'+_0x4415f4)[_0x9078('0x2b')](_0x4889db);}return null;};}function patchUpdates(_0x588266){return function(_0x4bb7b0){try{jsonpatch[_0x9078('0x32')](_0x4bb7b0,_0x588266,!![]);}catch(_0x55c738){return BPromise['reject'](_0x55c738);}return _0x4bb7b0['save']();};}function saveUpdates(_0x1f775b,_0x330a74){return function(_0x5540c0){if(_0x5540c0){return _0x5540c0[_0x9078('0x33')](_0x1f775b)[_0x9078('0x34')](function(_0x9cc5f3){return _0x9cc5f3;});}return null;};}function removeEntity(_0x18f0e5,_0x29c5a7){return function(_0x202629){if(_0x202629){return _0x202629[_0x9078('0x35')]()[_0x9078('0x34')](function(){var _0x4f802c=_0x202629[_0x9078('0x36')]({'plain':!![]});var _0x11a63c=_0x9078('0x37');return db['UserProfileResource'][_0x9078('0x35')]({'where':{'type':_0x11a63c,'resourceId':_0x4f802c['id']}})[_0x9078('0x34')](function(){return _0x202629;});})[_0x9078('0x34')](function(){_0x18f0e5[_0x9078('0x29')](0xcc)[_0x9078('0x2a')]();});}};}function handleEntityNotFound(_0x1b316a,_0x431694){return function(_0x3fddb6){if(!_0x3fddb6){_0x1b316a[_0x9078('0x28')](0x194);}return _0x3fddb6;};}function handleError(_0x5816ae,_0x2c73f9){_0x2c73f9=_0x2c73f9||0x1f4;return function(_0x536afc){logger[_0x9078('0x25')](_0x536afc[_0x9078('0x38')]);if(_0x536afc[_0x9078('0x39')]){delete _0x536afc['name'];}_0x5816ae[_0x9078('0x29')](_0x2c73f9)[_0x9078('0x3a')](_0x536afc);};}exports[_0x9078('0x3b')]=function(_0x35fc30,_0x2d09ae){var _0x34e444={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x9d341={},_0x3bf169={'count':0x0,'rows':[]};var _0x34f2c0=_['map'](db[_0x9078('0x3c')][_0x9078('0x3d')],function(_0x1d3edd){return{'name':_0x1d3edd[_0x9078('0x3e')],'type':_0x1d3edd[_0x9078('0x3f')][_0x9078('0x40')]};});_0x9d341[_0x9078('0x41')]=_[_0x9078('0x42')](_0x34f2c0,_0x9078('0x39'));_0x9d341[_0x9078('0x43')]=_['keys'](_0x35fc30['query']);_0x9d341[_0x9078('0x44')]=_[_0x9078('0x45')](_0x9d341[_0x9078('0x41')],_0x9d341[_0x9078('0x43')]);_0x34e444['attributes']=_[_0x9078('0x45')](_0x9d341[_0x9078('0x41')],qs[_0x9078('0x46')](_0x35fc30[_0x9078('0x43')]['fields']));_0x34e444[_0x9078('0x47')]=_0x34e444[_0x9078('0x47')]['length']?_0x34e444[_0x9078('0x47')]:_0x9d341[_0x9078('0x41')];if(!_0x35fc30[_0x9078('0x43')]['hasOwnProperty'](_0x9078('0x48'))){_0x34e444[_0x9078('0x2f')]=qs[_0x9078('0x2f')](_0x35fc30[_0x9078('0x43')]['limit']);_0x34e444[_0x9078('0x2e')]=qs['offset'](_0x35fc30[_0x9078('0x43')][_0x9078('0x2e')]);}_0x34e444[_0x9078('0x49')]=qs[_0x9078('0x4a')](_0x35fc30[_0x9078('0x43')][_0x9078('0x4a')]);_0x34e444[_0x9078('0x4b')]=qs[_0x9078('0x44')](_[_0x9078('0x4c')](_0x35fc30[_0x9078('0x43')],_0x9d341[_0x9078('0x44')]),_0x34f2c0);if(_0x35fc30[_0x9078('0x43')]['filter']){_0x34e444[_0x9078('0x4b')]=_[_0x9078('0x4d')](_0x34e444[_0x9078('0x4b')],{'$or':_['map'](_0x34f2c0,function(_0x2c1cce){if(_0x2c1cce[_0x9078('0x3f')]!==_0x9078('0x4e')){var _0x597d15={};_0x597d15[_0x2c1cce[_0x9078('0x39')]]={'$like':'%'+_0x35fc30[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0x597d15;}})});}_0x34e444=_['merge']({},_0x34e444,_0x35fc30[_0x9078('0x50')]);var _0x4daecc={'where':_0x34e444[_0x9078('0x4b')]};return db[_0x9078('0x3c')]['count'](_0x4daecc)[_0x9078('0x34')](function(_0x47d1f3){_0x3bf169[_0x9078('0x2d')]=_0x47d1f3;if(_0x35fc30['query'][_0x9078('0x51')]){_0x34e444['include']=[{'all':!![]}];}return db[_0x9078('0x3c')][_0x9078('0x52')](_0x34e444);})['then'](function(_0x40a9f5){_0x3bf169['rows']=_0x40a9f5;return _0x3bf169;})[_0x9078('0x34')](respondWithFilteredResult(_0x2d09ae,_0x34e444))[_0x9078('0x53')](handleError(_0x2d09ae,null));};exports[_0x9078('0x54')]=function(_0x30acb2,_0xaf50d4){var _0x104f18={'raw':![],'where':{'id':_0x30acb2[_0x9078('0x55')]['id']},'include':[{'model':db[_0x9078('0x56')],'as':_0x9078('0x57')}]},_0x3469eb={};_0x3469eb[_0x9078('0x41')]=_[_0x9078('0x58')](db['OpenchannelAccount']['rawAttributes']);_0x3469eb[_0x9078('0x43')]=_[_0x9078('0x58')](_0x30acb2[_0x9078('0x43')]);_0x3469eb['filters']=_[_0x9078('0x45')](_0x3469eb[_0x9078('0x41')],_0x3469eb['query']);_0x104f18[_0x9078('0x47')]=_[_0x9078('0x45')](_0x3469eb['model'],qs[_0x9078('0x46')](_0x30acb2[_0x9078('0x43')]['fields']));_0x104f18[_0x9078('0x47')]=_0x104f18[_0x9078('0x47')]['length']?_0x104f18[_0x9078('0x47')]:_0x3469eb['model'];if(_0x30acb2[_0x9078('0x43')][_0x9078('0x51')]){_0x104f18[_0x9078('0x59')]=[{'all':!![]}];}_0x104f18=_['merge']({},_0x104f18,_0x30acb2[_0x9078('0x50')]);return db[_0x9078('0x3c')][_0x9078('0x5a')](_0x104f18)[_0x9078('0x34')](handleEntityNotFound(_0xaf50d4,null))[_0x9078('0x34')](respondWithResult(_0xaf50d4,null))[_0x9078('0x53')](handleError(_0xaf50d4,null));};exports[_0x9078('0x5b')]=function(_0x418f7b,_0x39f048){return db[_0x9078('0x3c')]['create'](_0x418f7b[_0x9078('0x5c')],{})[_0x9078('0x34')](function(_0x39af05){var _0x1f0c87=_0x418f7b[_0x9078('0x5d')][_0x9078('0x36')]({'plain':!![]});if(!_0x1f0c87)throw new Error(_0x9078('0x5e'));if(_0x1f0c87[_0x9078('0x5f')]===_0x9078('0x5d')){var _0x4da46a=_0x39af05['get']({'plain':!![]});var _0x4b8284=_0x9078('0x37');return db[_0x9078('0x60')][_0x9078('0x5a')]({'where':{'name':_0x4b8284,'userProfileId':_0x1f0c87[_0x9078('0x61')]},'raw':!![]})['then'](function(_0x27ef54){if(_0x27ef54&&_0x27ef54[_0x9078('0x62')]===0x0){return db[_0x9078('0x63')][_0x9078('0x5b')]({'name':_0x4da46a[_0x9078('0x39')],'resourceId':_0x4da46a['id'],'type':_0x27ef54['name'],'sectionId':_0x27ef54['id']},{})[_0x9078('0x34')](function(){return _0x39af05;});}else{return _0x39af05;}})['catch'](function(_0x410ec6){logger[_0x9078('0x25')](_0x9078('0x64'),_0x410ec6);throw _0x410ec6;});}return _0x39af05;})[_0x9078('0x34')](respondWithResult(_0x39f048,0xc9))[_0x9078('0x53')](handleError(_0x39f048,null));};exports[_0x9078('0x33')]=function(_0x148b06,_0x4a4cc5){if(_0x148b06[_0x9078('0x5c')]['id']){delete _0x148b06[_0x9078('0x5c')]['id'];}return db['OpenchannelAccount'][_0x9078('0x5a')]({'where':{'id':_0x148b06[_0x9078('0x55')]['id']},'include':[{'model':db[_0x9078('0x56')],'as':_0x9078('0x57')}]})['then'](handleEntityNotFound(_0x4a4cc5,null))[_0x9078('0x34')](saveUpdates(_0x148b06[_0x9078('0x5c')],null))[_0x9078('0x34')](respondWithResult(_0x4a4cc5,null))[_0x9078('0x53')](handleError(_0x4a4cc5,null));};exports[_0x9078('0x35')]=function(_0x3ed41e,_0x164cd4){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x3ed41e['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x164cd4,null))[_0x9078('0x34')](removeEntity(_0x164cd4,null))[_0x9078('0x53')](handleError(_0x164cd4,null));};exports[_0x9078('0x65')]=function(_0x9bb78c,_0x3efd2a){return db['OpenchannelAccount'][_0x9078('0x65')]()[_0x9078('0x34')](respondWithResult(_0x3efd2a,null))['catch'](handleError(_0x3efd2a,null));};exports[_0x9078('0x66')]=function(_0x17d8f3,_0x5f1027,_0xeae8c5){if(_0x17d8f3[_0x9078('0x5c')]['id']){delete _0x17d8f3[_0x9078('0x5c')]['id'];}return db['OpenchannelAccount'][_0x9078('0x5a')]({'where':{'id':_0x17d8f3['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x5f1027,null))['then'](function(_0x114b25){if(_0x114b25){_0x17d8f3[_0x9078('0x5c')][_0x9078('0x67')]=_0x114b25['id'];return db[_0x9078('0x68')][_0x9078('0x5b')](_0x17d8f3[_0x9078('0x5c')]);}})[_0x9078('0x34')](respondWithResult(_0x5f1027,null))[_0x9078('0x53')](handleError(_0x5f1027,null));};exports[_0x9078('0x69')]=function(_0xcfce5f,_0x2273ae,_0x4c54a1){var _0x13eb0a={'raw':![],'where':{}};var _0x14b771={};var _0x45a408={'count':0x0,'rows':[]};return db[_0x9078('0x3c')]['findOne']({'where':{'id':_0xcfce5f[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x2273ae,null))['then'](function(_0x3ac308){if(_0x3ac308){_0x14b771['model']=_[_0x9078('0x58')](db[_0x9078('0x68')][_0x9078('0x3d')]);_0x14b771[_0x9078('0x43')]=_[_0x9078('0x58')](_0xcfce5f[_0x9078('0x43')]);_0x14b771[_0x9078('0x44')]=_['intersection'](_0x14b771[_0x9078('0x41')],_0x14b771[_0x9078('0x43')]);_0x13eb0a['attributes']=_[_0x9078('0x45')](_0x14b771[_0x9078('0x41')],qs['fields'](_0xcfce5f[_0x9078('0x43')][_0x9078('0x46')]));_0x13eb0a[_0x9078('0x47')]=_0x13eb0a[_0x9078('0x47')]['length']?_0x13eb0a[_0x9078('0x47')]:_0x14b771['model'];if(!_0xcfce5f[_0x9078('0x43')]['hasOwnProperty']('nolimit')){_0x13eb0a['limit']=qs[_0x9078('0x2f')](_0xcfce5f[_0x9078('0x43')][_0x9078('0x2f')]);_0x13eb0a[_0x9078('0x2e')]=qs[_0x9078('0x2e')](_0xcfce5f[_0x9078('0x43')][_0x9078('0x2e')]);}_0x13eb0a['order']=qs[_0x9078('0x4a')](_0xcfce5f['query'][_0x9078('0x4a')]);_0x13eb0a[_0x9078('0x4b')]=qs[_0x9078('0x44')](_[_0x9078('0x4c')](_0xcfce5f[_0x9078('0x43')],_0x14b771[_0x9078('0x44')]));_0x13eb0a['where']['OpenchannelAccountId']=_0x3ac308['id'];if(_0xcfce5f['query'][_0x9078('0x4f')]){_0x13eb0a[_0x9078('0x4b')]=_[_0x9078('0x4d')](_0x13eb0a[_0x9078('0x4b')],{'$or':_['map'](_0x13eb0a[_0x9078('0x47')],function(_0x2cf84c){var _0x2e640c={};_0x2e640c[_0x2cf84c]={'$like':'%'+_0xcfce5f['query'][_0x9078('0x4f')]+'%'};return _0x2e640c;})});}_0x13eb0a=_[_0x9078('0x4d')]({},_0x13eb0a,_0xcfce5f[_0x9078('0x50')]);return db[_0x9078('0x68')][_0x9078('0x2d')]({'where':_0x13eb0a[_0x9078('0x4b')]})[_0x9078('0x34')](function(_0x1562d7){_0x45a408[_0x9078('0x2d')]=_0x1562d7;if(_0xcfce5f[_0x9078('0x43')][_0x9078('0x51')]){_0x13eb0a['include']=[{'all':!![]}];}return db[_0x9078('0x68')][_0x9078('0x52')](_0x13eb0a);})[_0x9078('0x34')](function(_0x8e2afb){_0x45a408[_0x9078('0x6a')]=_0x8e2afb;return _0x45a408;});}})[_0x9078('0x34')](respondWithFilteredResult(_0x2273ae,_0x13eb0a))[_0x9078('0x53')](handleError(_0x2273ae,null));};exports['removeDispositions']=function(_0x50fe7b,_0x245a4f,_0x5880bf){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x50fe7b[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x245a4f,null))['then'](function(_0x561ce6){if(_0x561ce6){return _0x561ce6['removeDispositions'](_0x50fe7b[_0x9078('0x43')][_0x9078('0x6b')]);}})[_0x9078('0x34')](respondWithStatusCode(_0x245a4f,null))[_0x9078('0x53')](handleError(_0x245a4f,null));};exports[_0x9078('0x6c')]=function(_0x1448a5,_0x30b1da,_0x46eb0f){if(_0x1448a5[_0x9078('0x5c')]['id']){delete _0x1448a5[_0x9078('0x5c')]['id'];}return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x1448a5[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x30b1da,null))[_0x9078('0x34')](function(_0x44ba1e){if(_0x44ba1e){_0x1448a5[_0x9078('0x5c')][_0x9078('0x67')]=_0x44ba1e['id'];return db['CannedAnswer']['create'](_0x1448a5[_0x9078('0x5c')]);}})[_0x9078('0x34')](respondWithResult(_0x30b1da,null))[_0x9078('0x53')](handleError(_0x30b1da,null));};exports[_0x9078('0x6d')]=function(_0x563bd6,_0x4ce448,_0x510995){var _0x2e4013={'raw':![],'where':{}};var _0x253c49={};var _0x3d913a={'count':0x0,'rows':[]};return db[_0x9078('0x3c')]['findOne']({'where':{'id':_0x563bd6[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x4ce448,null))['then'](function(_0xd117aa){if(_0xd117aa){_0x253c49[_0x9078('0x41')]=_[_0x9078('0x58')](db[_0x9078('0x6e')]['rawAttributes']);_0x253c49[_0x9078('0x43')]=_[_0x9078('0x58')](_0x563bd6[_0x9078('0x43')]);_0x253c49[_0x9078('0x44')]=_[_0x9078('0x45')](_0x253c49['model'],_0x253c49[_0x9078('0x43')]);_0x2e4013[_0x9078('0x47')]=_[_0x9078('0x45')](_0x253c49[_0x9078('0x41')],qs[_0x9078('0x46')](_0x563bd6[_0x9078('0x43')][_0x9078('0x46')]));_0x2e4013[_0x9078('0x47')]=_0x2e4013['attributes'][_0x9078('0x6f')]?_0x2e4013['attributes']:_0x253c49[_0x9078('0x41')];if(!_0x563bd6[_0x9078('0x43')]['hasOwnProperty'](_0x9078('0x48'))){_0x2e4013['limit']=qs[_0x9078('0x2f')](_0x563bd6[_0x9078('0x43')]['limit']);_0x2e4013['offset']=qs[_0x9078('0x2e')](_0x563bd6[_0x9078('0x43')][_0x9078('0x2e')]);}_0x2e4013['order']=qs['sort'](_0x563bd6[_0x9078('0x43')]['sort']);_0x2e4013[_0x9078('0x4b')]=qs[_0x9078('0x44')](_[_0x9078('0x4c')](_0x563bd6['query'],_0x253c49['filters']));_0x2e4013[_0x9078('0x4b')]['OpenchannelAccountId']=_0xd117aa['id'];if(_0x563bd6[_0x9078('0x43')][_0x9078('0x4f')]){_0x2e4013['where']=_[_0x9078('0x4d')](_0x2e4013['where'],{'$or':_[_0x9078('0x42')](_0x2e4013['attributes'],function(_0x52e8cc){var _0xc810d4={};_0xc810d4[_0x52e8cc]={'$like':'%'+_0x563bd6[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0xc810d4;})});}_0x2e4013=_[_0x9078('0x4d')]({},_0x2e4013,_0x563bd6['options']);return db[_0x9078('0x6e')]['count']({'where':_0x2e4013['where']})[_0x9078('0x34')](function(_0x4a09aa){_0x3d913a['count']=_0x4a09aa;if(_0x563bd6[_0x9078('0x43')][_0x9078('0x51')]){_0x2e4013[_0x9078('0x59')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2e4013);})['then'](function(_0x49e82d){_0x3d913a[_0x9078('0x6a')]=_0x49e82d;return _0x3d913a;});}})[_0x9078('0x34')](respondWithFilteredResult(_0x4ce448,_0x2e4013))[_0x9078('0x53')](handleError(_0x4ce448,null));};exports[_0x9078('0x70')]=function(_0x45b05b,_0x2e759c,_0x380930){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x45b05b['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x2e759c,null))['then'](function(_0x5bebc1){if(_0x5bebc1){return _0x5bebc1[_0x9078('0x70')](_0x45b05b[_0x9078('0x43')]['ids']);}})[_0x9078('0x34')](respondWithStatusCode(_0x2e759c,null))[_0x9078('0x53')](handleError(_0x2e759c,null));};exports[_0x9078('0x71')]=function(_0x42a9dc,_0x5961fb,_0x5ae456){var _0x165f2e={'body':_0x42a9dc[_0x9078('0x5c')],'channel':'openchannel'};var _0x51f0fa=[];var _0x18084e=[];var _0x3047f1={};var _0x32c563=![];return db[_0x9078('0x72')][_0x9078('0x65')]()['then'](function(_0x58d9db){if(!_0x58d9db){throw new db[(_0x9078('0x73'))]['ValidationError'](_0x9078('0x74'));}_0x51f0fa=_[_0x9078('0x75')](_[_0x9078('0x58')](_0x58d9db),[_0x9078('0x76'),_0x9078('0x77')]);_0x18084e=_[_0x9078('0x75')](_[_0x9078('0x58')](_0x58d9db),[_0x9078('0x76'),_0x9078('0x77'),_0x9078('0x78'),_0x9078('0x79')]);if(_0x42a9dc[_0x9078('0x5c')]['id']){delete _0x42a9dc[_0x9078('0x5c')]['id'];}if(_['isNil'](_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7a')])){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x7c'));}if(_[_0x9078('0x7d')](_0x42a9dc[_0x9078('0x5c')][_0x9078('0x5c')])||_0x42a9dc[_0x9078('0x5c')][_0x9078('0x5c')]===''){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x7e'));}if(_[_0x9078('0x7d')](_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7f')])){throw new db['Sequelize'][(_0x9078('0x7b'))](_0x9078('0x80')+_0x18084e);}if(!_[_0x9078('0x81')](_0x18084e,_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7f')])){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x82')+_0x18084e);}_0x3047f1[_0x42a9dc['body'][_0x9078('0x7f')]]=_0x42a9dc[_0x9078('0x5c')]['from'];})[_0x9078('0x34')](function(){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x42a9dc[_0x9078('0x55')]['id']},'include':[{'model':db[_0x9078('0x83')],'as':_0x9078('0x84'),'include':[{'model':db[_0x9078('0x72')],'as':'Contacts','where':_0x3047f1,'limit':0x1,'order':[[_0x9078('0x77'),_0x9078('0x85')]]}]},{'model':db[_0x9078('0x86')],'as':_0x9078('0x87')}]});})[_0x9078('0x34')](handleEntityNotFound(_0x5961fb,null))[_0x9078('0x34')](function(_0x4f956b){if(_0x4f956b&&_0x4f956b[_0x9078('0x84')]){_0x165f2e[_0x9078('0x88')]=_0x4f956b;_0x165f2e['applications']=_0x4f956b[_0x9078('0x87')];_0x165f2e[_0x9078('0x89')]=_0x4f956b[_0x9078('0x84')];_0x165f2e[_0x9078('0x8a')]=_[_0x9078('0x8b')](_0x165f2e[_0x9078('0x8a')],[_0x9078('0x8c')],[_0x9078('0x8d')]);if(_0x165f2e[_0x9078('0x88')][_0x9078('0x87')]){delete _0x165f2e['account'][_0x9078('0x87')];}if(_0x165f2e[_0x9078('0x88')][_0x9078('0x84')]&&_0x165f2e['account'][_0x9078('0x84')][_0x9078('0x8e')]['length']){return _0x165f2e['account'][_0x9078('0x84')]['Contacts'][0x0];}var _0x8d9208=_[_0x9078('0x16')](_0x42a9dc[_0x9078('0x5c')],{'firstName':_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7a')],'ListId':_0x4f956b[_0x9078('0x79')]});_0x8d9208[_0x42a9dc['body'][_0x9078('0x7f')]]=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x7a')];return db[_0x9078('0x72')][_0x9078('0x5b')](_0x8d9208,{'fields':_0x51f0fa,'raw':!![]});}})[_0x9078('0x34')](handleEntityNotFound(_0x5961fb,null))[_0x9078('0x34')](function(_0x122eb0){_0x165f2e[_0x9078('0x8f')]=_0x122eb0;if(_0x122eb0){var _0x100e47={'ContactId':_0x122eb0['id'],'OpenchannelAccountId':_0x42a9dc['params']['id'],'from':(_0x122eb0[_0x9078('0x90')]||'')+'\x20'+(_0x122eb0[_0x9078('0x91')]||'')};var _0x19e36c={'OpenchannelAccountId':_0x42a9dc[_0x9078('0x55')]['id'],'closed':![]};if(_0x42a9dc[_0x9078('0x5c')][_0x9078('0x92')]){_0x19e36c[_0x9078('0x92')]=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x92')];return db[_0x9078('0x93')][_0x9078('0x5a')]({'where':_0x19e36c})[_0x9078('0x34')](function(_0x260746){if(_0x260746){return[_0x260746,![]];}_0x100e47[_0x9078('0x92')]=_0x42a9dc['body'][_0x9078('0x92')];_0x100e47['externalUrl']=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x94')];return db[_0x9078('0x93')][_0x9078('0x5b')](_0x100e47)['then'](function(_0x494aad){return[_0x494aad,!![]];});});}else{_0x19e36c['threadId']=null;}_0x19e36c[_0x9078('0x95')]=_0x122eb0['id'];return db[_0x9078('0x93')][_0x9078('0x5a')]({'where':_0x19e36c})[_0x9078('0x34')](function(_0x244ca6){if(_0x244ca6){return[_0x244ca6,![]];}return db[_0x9078('0x93')]['create'](_0x100e47)[_0x9078('0x34')](function(_0x13b9cb){return[_0x13b9cb,!![]];});});}})['spread'](function(_0x422151,_0xf10a51){if(_0x422151){_0x32c563=_0xf10a51;if(!_0xf10a51){var _0x54fd58={'from':(_0x165f2e['contact'][_0x9078('0x90')]||'')+'\x20'+(_0x165f2e['contact'][_0x9078('0x91')]||'')};if(_0x42a9dc['body']['threadId']&&_0x42a9dc[_0x9078('0x5c')][_0x9078('0x96')]&&_0x42a9dc['body']['threadId']!=_0x42a9dc[_0x9078('0x5c')][_0x9078('0x96')]){_0x54fd58['threadId']=_0x42a9dc['body'][_0x9078('0x96')];}return _0x422151['update'](_0x54fd58);}else{return _0x422151;}}})[_0x9078('0x34')](function(_0x291866){_0x165f2e[_0x9078('0x97')]=_0x291866[_0x9078('0x36')]({'plain':!![]});_0x165f2e['interaction'][_0x9078('0x98')]=_0x32c563;if(_0x165f2e[_0x9078('0x97')][_0x9078('0x98')]){if(_0x165f2e[_0x9078('0x88')]['autoclose']){_0x165f2e[_0x9078('0x8a')][_0x9078('0x99')]({'id':0x0,'priority':_0x165f2e[_0x9078('0x8a')]['length']+0x1,'app':_0x9078('0x9a'),'appdata':'unmanaged','interval':_0x9078('0x9b')});}}return db[_0x9078('0x9c')][_0x9078('0x5b')]({'body':_0x42a9dc[_0x9078('0x5c')][_0x9078('0x5c')],'OpenchannelAccountId':_0x42a9dc[_0x9078('0x55')]['id'],'OpenchannelInteractionId':_0x291866['id'],'direction':'in','ContactId':_0x165f2e[_0x9078('0x8f')]['id'],'AttachmentId':_0x42a9dc[_0x9078('0x5c')][_0x9078('0x9d')]});})[_0x9078('0x34')](function(_0x41d6cd){_0x165f2e[_0x9078('0x26')]=_0x41d6cd;if(_0x165f2e[_0x9078('0x97')]['UserId']){return db['User'][_0x9078('0x5a')]({'attributes':['id','name'],'where':{'id':_0x165f2e[_0x9078('0x97')]['UserId']}})[_0x9078('0x34')](function(_0x306b45){if(_0x306b45){_0x165f2e['applications'][_0x9078('0x9e')]({'id':0x0,'priority':0x0,'app':_0x9078('0x9f'),'appdata':_0x306b45[_0x9078('0x39')]+','+(_0x165f2e[_0x9078('0x88')][_0x9078('0xa0')]||0xa),'interval':_0x9078('0x9b')});_0x165f2e[_0x9078('0xa1')]=![];}return respondWithRpcPromise('Start',_0x9078('0xa2'),_0x165f2e);});}return respondWithRpcPromise(_0x9078('0xa3'),_0x9078('0xa2'),_0x165f2e);})[_0x9078('0x34')](function(_0x2a3016){respondWithRpcPromise(_0x9078('0xa4'),_0x9078('0xa4'),{'event':_0x9078('0x71'),'message':_0x2a3016},client9002);return _0x2a3016;})[_0x9078('0x34')](respondWithResult(_0x5961fb,null))[_0x9078('0x53')](handleError(_0x5961fb,null));};exports[_0x9078('0xa5')]=function(_0x243a31,_0x56b995,_0xe4b7b4){return db[_0x9078('0x3c')]['findOne']({'where':{'id':_0x243a31[_0x9078('0x55')]['id']}})['then'](handleEntityNotFound(_0x56b995,null))[_0x9078('0x34')](function(_0x55c9ad){if(_0x55c9ad){return db[_0x9078('0xa6')][_0x9078('0xa7')](function(_0x4141ff){return db[_0x9078('0x86')][_0x9078('0x35')]({'where':{'OpenchannelAccountId':_0x243a31[_0x9078('0x55')]['id']},'transaction':_0x4141ff})['then'](function(_0x8747dd){var _0x1688d6=_[_0x9078('0x42')](_0x243a31[_0x9078('0x5c')],function(_0x1bc514){_0x1bc514[_0x9078('0x67')]=_0x243a31[_0x9078('0x55')]['id'];return _0x1bc514;});return db[_0x9078('0x86')][_0x9078('0xa8')](_0x1688d6,{'transaction':_0x4141ff});});})[_0x9078('0x34')](function(){return db[_0x9078('0x86')][_0x9078('0xa9')]({'where':{'OpenchannelAccountId':_0x243a31['params']['id']},'order':_0x9078('0x8c')});});}})[_0x9078('0x34')](respondWithResult(_0x56b995,null))[_0x9078('0x53')](handleError(_0x56b995,null));};exports['getApplications']=function(_0x3a86d7,_0xf5c71f,_0x2647ce){var _0x33d57d={};var _0x3e81ea={};var _0x2592d0;var _0x2ae526;return db[_0x9078('0x3c')][_0x9078('0xaa')]({'where':{'id':_0x3a86d7['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0xf5c71f,null))[_0x9078('0x34')](function(_0x3d7d63){if(_0x3d7d63){_0x2592d0=_0x3d7d63;_0x3e81ea['model']=_[_0x9078('0x58')](db[_0x9078('0x86')][_0x9078('0x3d')]);_0x3e81ea[_0x9078('0x43')]=_[_0x9078('0x58')](_0x3a86d7[_0x9078('0x43')]);_0x3e81ea[_0x9078('0x44')]=_[_0x9078('0x45')](_0x3e81ea[_0x9078('0x41')],_0x3e81ea[_0x9078('0x43')]);_0x33d57d[_0x9078('0x47')]=_['intersection'](_0x3e81ea[_0x9078('0x41')],qs[_0x9078('0x46')](_0x3a86d7[_0x9078('0x43')][_0x9078('0x46')]));_0x33d57d['attributes']=_0x33d57d[_0x9078('0x47')][_0x9078('0x6f')]?_0x33d57d[_0x9078('0x47')]:_0x3e81ea[_0x9078('0x41')];_0x33d57d['order']=qs[_0x9078('0x4a')](_0x3a86d7[_0x9078('0x43')]['sort']);_0x33d57d['where']=qs[_0x9078('0x44')](_['pick'](_0x3a86d7[_0x9078('0x43')],_0x3e81ea[_0x9078('0x44')]));if(_0x3a86d7[_0x9078('0x43')][_0x9078('0x4f')]){_0x33d57d['where']=_[_0x9078('0x4d')](_0x33d57d[_0x9078('0x4b')],{'$or':_[_0x9078('0x42')](_0x33d57d[_0x9078('0x47')],function(_0x411fa6){var _0x499299={};_0x499299[_0x411fa6]={'$like':'%'+_0x3a86d7['query']['filter']+'%'};return _0x499299;})});}_0x33d57d=_[_0x9078('0x4d')]({},_0x33d57d,_0x3a86d7['options']);return _0x2592d0[_0x9078('0xab')](_0x33d57d);}})[_0x9078('0x34')](function(_0x96fa21){if(_0x96fa21){_0x2ae526=_0x96fa21['length'];if(!_0x3a86d7[_0x9078('0x43')][_0x9078('0xac')]('nolimit')){_0x33d57d['limit']=qs['limit'](_0x3a86d7[_0x9078('0x43')][_0x9078('0x2f')]);_0x33d57d[_0x9078('0x2e')]=qs[_0x9078('0x2e')](_0x3a86d7['query'][_0x9078('0x2e')]);}return _0x2592d0[_0x9078('0xab')](_0x33d57d);}})[_0x9078('0x34')](function(_0xd4238a){if(_0xd4238a){return _0xd4238a?{'count':_0x2ae526,'rows':_0xd4238a}:null;}})[_0x9078('0x34')](respondWithResult(_0xf5c71f,null))[_0x9078('0x53')](handleError(_0xf5c71f,null));};exports[_0x9078('0xad')]=function(_0x281bdd,_0x1d78a8,_0x33cd2d){var _0x612dff={'raw':![],'where':{}};var _0xf96325={};var _0x5eae18={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9078('0xaa')]({'where':{'id':_0x281bdd[_0x9078('0x55')]['id']}})['then'](handleEntityNotFound(_0x1d78a8,null))[_0x9078('0x34')](function(_0x2006c2){if(_0x2006c2){_0xf96325['model']=_[_0x9078('0x58')](db[_0x9078('0x93')][_0x9078('0x3d')]);_0xf96325[_0x9078('0x43')]=_['keys'](_0x281bdd[_0x9078('0x43')]);_0xf96325[_0x9078('0x44')]=_[_0x9078('0x45')](_0xf96325[_0x9078('0x41')],_0xf96325['query']);_0x612dff['attributes']=_[_0x9078('0x45')](_0xf96325[_0x9078('0x41')],qs[_0x9078('0x46')](_0x281bdd['query']['fields']));_0x612dff['attributes']=_0x612dff[_0x9078('0x47')][_0x9078('0x6f')]?_0x612dff[_0x9078('0x47')]:_0xf96325[_0x9078('0x41')];if(!_0x281bdd['query'][_0x9078('0xac')]('nolimit')){_0x612dff[_0x9078('0x2f')]=qs[_0x9078('0x2f')](_0x281bdd[_0x9078('0x43')][_0x9078('0x2f')]);_0x612dff[_0x9078('0x2e')]=qs['offset'](_0x281bdd[_0x9078('0x43')][_0x9078('0x2e')]);}_0x612dff['order']=qs[_0x9078('0x4a')](_0x281bdd[_0x9078('0x43')][_0x9078('0x4a')]);_0x612dff[_0x9078('0x4b')]=qs['filters'](_[_0x9078('0x4c')](_0x281bdd[_0x9078('0x43')],_0xf96325[_0x9078('0x44')]));_0x612dff['where']['OpenchannelAccountId']=_0x2006c2['id'];if(_0x281bdd['query'][_0x9078('0x4f')]){_0x612dff[_0x9078('0x4b')]=_['merge'](_0x612dff[_0x9078('0x4b')],{'$or':_['map'](_0x612dff[_0x9078('0x47')],function(_0x53a138){var _0x301864={};_0x301864[_0x53a138]={'$like':'%'+_0x281bdd[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0x301864;})});}_0x612dff=_[_0x9078('0x4d')]({},_0x612dff,_0x281bdd['options']);return db[_0x9078('0x93')]['count']({'where':_0x612dff[_0x9078('0x4b')]})[_0x9078('0x34')](function(_0x224cc8){_0x5eae18[_0x9078('0x2d')]=_0x224cc8;if(_0x281bdd['query']['includeAll']){_0x612dff[_0x9078('0x59')]=[{'model':db[_0x9078('0x72')],'as':_0x9078('0xae'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9078('0x39'),_0x9078('0xaf'),_0x9078('0xb0')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9078('0x39'),_0x9078('0xb1')],'where':_0x281bdd[_0x9078('0x43')][_0x9078('0xb2')]?{'id':_0x281bdd[_0x9078('0x43')]['tag']}:undefined,'required':_0x281bdd[_0x9078('0x43')]['tag']?!![]:![]}];}return db[_0x9078('0x93')]['findAll'](_0x612dff);})[_0x9078('0x34')](function(_0x3bbaf0){_0x5eae18['rows']=_0x3bbaf0;return _0x5eae18;});}})[_0x9078('0x34')](respondWithFilteredResult(_0x1d78a8,_0x612dff))[_0x9078('0x53')](handleError(_0x1d78a8,null));};exports[_0x9078('0xb3')]=function(_0x3c5ba8,_0x4d3539,_0xb5a09e){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x3c5ba8['params']['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x4d3539,null))[_0x9078('0x34')](function(_0x1b98ac){if(_0x1b98ac){return _0x1b98ac[_0x9078('0xb3')](_0x3c5ba8[_0x9078('0x5c')][_0x9078('0x6b')],_[_0x9078('0xb4')](_0x3c5ba8[_0x9078('0x5c')],[_0x9078('0x6b'),'id'])||{})[_0x9078('0xb5')](function(_0x4d8f90){for(var _0x1d5a4e=0x0;_0x1d5a4e<_0x3c5ba8[_0x9078('0x5c')]['ids']['length'];_0x1d5a4e+=0x1){socket[_0x9078('0xb6')](_0x9078('0xb7'),{'UserId':Number(_0x3c5ba8['body']['ids'][_0x1d5a4e]),'OpenchannelAccountId':Number(_0x3c5ba8[_0x9078('0x55')]['id'])});}return _0x4d8f90;});}})['then'](respondWithResult(_0x4d3539,null))[_0x9078('0x53')](handleError(_0x4d3539,null));};exports[_0x9078('0xb8')]=function(_0x1f22da,_0x3424d8,_0x142322){return db[_0x9078('0x3c')][_0x9078('0x5a')]({'where':{'id':_0x1f22da[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x3424d8,null))['then'](function(_0x498eb5){if(_0x498eb5){return _0x498eb5[_0x9078('0xb8')](_0x1f22da[_0x9078('0x43')][_0x9078('0x6b')])[_0x9078('0x34')](function(){if(_[_0x9078('0xb9')](_0x1f22da['query'][_0x9078('0x6b')])){for(var _0x4ca211=0x0;_0x4ca211<_0x1f22da['query'][_0x9078('0x6b')][_0x9078('0x6f')];_0x4ca211+=0x1){socket[_0x9078('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1f22da['query']['ids'][_0x4ca211]),'OpenchannelAccountId':Number(_0x1f22da[_0x9078('0x55')]['id'])});}}else{socket[_0x9078('0xb6')](_0x9078('0xba'),{'UserId':Number(_0x1f22da[_0x9078('0x43')]['ids']),'OpenchannelAccountId':Number(_0x1f22da[_0x9078('0x55')]['id'])});}});}})[_0x9078('0x34')](respondWithStatusCode(_0x3424d8,null))[_0x9078('0x53')](handleError(_0x3424d8,null));};exports['getAgents']=function(_0x5e4bd2,_0x185320,_0x31f414){var _0x37490f={};var _0x1d349a={};var _0x289e6e;var _0x276592;return db[_0x9078('0x3c')][_0x9078('0xaa')]({'where':{'id':_0x5e4bd2[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x185320,null))[_0x9078('0x34')](function(_0x1f790a){if(_0x1f790a){_0x289e6e=_0x1f790a;_0x1d349a['model']=_[_0x9078('0x58')](db['User'][_0x9078('0x3d')]);_0x1d349a['query']=_['keys'](_0x5e4bd2[_0x9078('0x43')]);_0x1d349a[_0x9078('0x44')]=_[_0x9078('0x45')](_0x1d349a[_0x9078('0x41')],_0x1d349a[_0x9078('0x43')]);_0x37490f[_0x9078('0x47')]=_[_0x9078('0x45')](_0x1d349a['model'],qs[_0x9078('0x46')](_0x5e4bd2[_0x9078('0x43')][_0x9078('0x46')]));_0x37490f['attributes']=_0x37490f[_0x9078('0x47')]['length']?_0x37490f[_0x9078('0x47')]:_0x1d349a[_0x9078('0x41')];_0x37490f[_0x9078('0x49')]=qs['sort'](_0x5e4bd2[_0x9078('0x43')][_0x9078('0x4a')]);_0x37490f['where']=qs[_0x9078('0x44')](_['pick'](_0x5e4bd2[_0x9078('0x43')],_0x1d349a[_0x9078('0x44')]));if(_0x5e4bd2[_0x9078('0x43')][_0x9078('0x4f')]){_0x37490f[_0x9078('0x4b')]=_['merge'](_0x37490f[_0x9078('0x4b')],{'$or':_[_0x9078('0x42')](_0x37490f[_0x9078('0x47')],function(_0x35c8d0){var _0x4c3711={};_0x4c3711[_0x35c8d0]={'$like':'%'+_0x5e4bd2[_0x9078('0x43')][_0x9078('0x4f')]+'%'};return _0x4c3711;})});}_0x37490f=_['merge']({},_0x37490f,_0x5e4bd2[_0x9078('0x50')]);return _0x289e6e[_0x9078('0xbb')](_0x37490f);}})[_0x9078('0x34')](function(_0x3c7c7b){if(_0x3c7c7b){_0x276592=_0x3c7c7b['length'];if(!_0x5e4bd2[_0x9078('0x43')][_0x9078('0xac')](_0x9078('0x48'))){_0x37490f[_0x9078('0x2f')]=qs[_0x9078('0x2f')](_0x5e4bd2[_0x9078('0x43')]['limit']);_0x37490f[_0x9078('0x2e')]=qs['offset'](_0x5e4bd2[_0x9078('0x43')]['offset']);}return _0x289e6e[_0x9078('0xbb')](_0x37490f);}})[_0x9078('0x34')](function(_0x5451a8){if(_0x5451a8){return _0x5451a8?{'count':_0x276592,'rows':_0x5451a8}:null;}})['then'](respondWithResult(_0x185320,null))[_0x9078('0x53')](handleError(_0x185320,null));};exports[_0x9078('0x3a')]=function(_0x8586b5,_0x4d5240,_0x576f8d){var _0x144e1c,_0x1c971e,_0x1e948b;if(_['isNil'](_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')])||_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')]===''){throw new db[(_0x9078('0x73'))][(_0x9078('0x7b'))](_0x9078('0x7e'));}if(_[_0x9078('0x7d')](_0x8586b5[_0x9078('0x5c')]['to'])){}_0x144e1c=_0x8586b5['body']['to'];return db['OpenchannelAccount'][_0x9078('0xaa')]({'where':{'id':_0x8586b5[_0x9078('0x55')]['id']}})[_0x9078('0x34')](handleEntityNotFound(_0x4d5240,null))[_0x9078('0x34')](function(_0x41fe4c){if(_0x41fe4c){return db['OpenchannelAccount'][_0x9078('0x5a')]({'where':{'id':_0x41fe4c['id']},'include':[{'model':db[_0x9078('0x83')],'as':_0x9078('0x84'),'include':[{'model':db[_0x9078('0x72')],'as':_0x9078('0x8e'),'where':{[_0x41fe4c[_0x9078('0x7f')]]:_0x144e1c},'limit':0x1,'order':[['updatedAt',_0x9078('0x85')]]}]}]})[_0x9078('0x34')](handleEntityNotFound(_0x4d5240,null))[_0x9078('0x34')](function(_0x41120d){if(_0x41120d&&_0x41120d[_0x9078('0x84')]){_0x1c971e=_0x41120d[_0x9078('0x36')]({'plain':!![]});if(_0x1c971e[_0x9078('0x84')]&&_0x1c971e['List']['Contacts'][_0x9078('0x6f')]){return _0x1c971e[_0x9078('0x84')]['Contacts'][0x0];}return db[_0x9078('0x72')]['create'](_['defaults'](_0x8586b5[_0x9078('0x5c')],{'firstName':_0x144e1c,[_0x41120d[_0x9078('0x7f')]]:_0x144e1c,'phone':_0x144e1c,'ListId':_0x1c971e['ListId']}));}})[_0x9078('0x34')](handleEntityNotFound(_0x4d5240,null))[_0x9078('0x34')](function(_0x423fcd){if(_0x423fcd){_0x1e948b=_0x423fcd;return db['OpenchannelInteraction'][_0x9078('0x5a')]({'where':{'ContactId':_0x1e948b['id'],'closed':![],'OpenchannelAccountId':_0x1c971e['id']}})[_0x9078('0x34')](function(_0x267172){if(_0x267172){return[_0x267172,![]];}return db['OpenchannelInteraction'][_0x9078('0x5b')]({'UserId':_0x8586b5[_0x9078('0x5d')]['id'],'ContactId':_0x1e948b['id'],'OpenchannelAccountId':_0x1c971e['id'],'lastMsgDirection':'out','Messages':[_[_0x9078('0x4d')](_0x8586b5['body'],{'read':![],'body':_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')],'OpenchannelAccountId':_0x1c971e['id'],'UserId':_0x8586b5['user']['id'],'ContactId':_0x1e948b['id']})]},{'include':[{'model':db[_0x9078('0x9c')],'as':_0x9078('0xbc')}]})[_0x9078('0x34')](function(_0x2c2967){return[_0x2c2967,!![]];});});}})['spread'](function(_0x3fd94e,_0x2141f5){if(_0x2141f5){return _0x3fd94e;}return db[_0x9078('0x9c')][_0x9078('0x5b')](_[_0x9078('0x4d')](_0x8586b5[_0x9078('0x5c')],{'read':![],'body':_0x8586b5[_0x9078('0x5c')][_0x9078('0x5c')],'OpenchannelAccountId':_0x1c971e['id'],'OpenchannelInteractionId':_0x3fd94e['id'],'UserId':_0x8586b5[_0x9078('0x5d')]['id'],'ContactId':_0x1e948b['id']}))[_0x9078('0x34')](function(_0x1cdb74){_0x3fd94e[_0x9078('0xbd')][_0x9078('0xbc')]=[];_0x3fd94e[_0x9078('0xbd')]['Messages']['push'](_0x1cdb74[_0x9078('0xbd')]);return _0x3fd94e;});});}})['then'](respondWithResult(_0x4d5240,null))[_0x9078('0x53')](handleError(_0x4d5240,null));}; \ No newline at end of file +var _0xa89b=['list','applications','orderBy','priority','asc','Contacts','defaults','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','update','interaction','created','push','close','unmanaged','OpenchannelMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','User','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','OpenchannelAccounts','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','include','rows','show','params','Pause','keys','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account'];(function(_0x1d4297,_0x3cf1f9){var _0x3ba0c9=function(_0x23685d){while(--_0x23685d){_0x1d4297['push'](_0x1d4297['shift']());}};_0x3ba0c9(++_0x3cf1f9);}(_0xa89b,0x1a5));var _0xba89=function(_0x1e9992,_0x24a7db){_0x1e9992=_0x1e9992-0x0;var _0x4204e2=_0xa89b[_0x1e9992];return _0x4204e2;};'use strict';var emlformat=require(_0xba89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba89('0x1'));var rp=require('request-promise');var moment=require(_0xba89('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba89('0x3'));var path=require(_0xba89('0x4'));var sox=require(_0xba89('0x5'));var csv=require(_0xba89('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba89('0x7'));var _=require(_0xba89('0x8'));var squel=require(_0xba89('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba89('0xa'));var toCsv=require(_0xba89('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba89('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba89('0xc'));var logger=require('../../config/logger')('api');var utils=require(_0xba89('0xd'));var config=require('../../config/environment');var licenseUtil=require(_0xba89('0xe'));var db=require('../../mysqldb')['db'];config[_0xba89('0xf')]=_['defaults'](config[_0xba89('0xf')],{'host':_0xba89('0x10'),'port':0x18eb});var socket=require(_0xba89('0x11'))(new Redis(config[_0xba89('0xf')]));require(_0xba89('0x12'))[_0xba89('0x13')](socket);var jayson=require(_0xba89('0x14'));var client=jayson[_0xba89('0x15')]['http']({'port':0x232c});var client9002=jayson[_0xba89('0x15')][_0xba89('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x36839b,_0x2db2c7,_0x1241ad,_0x4321d0){return new BPromise(function(_0x1e5665,_0xc2d646){var _0x2a3adb=_0x4321d0||client;return _0x2a3adb[_0xba89('0x17')](_0x36839b,_0x1241ad)[_0xba89('0x18')](function(_0x32fb40){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2db2c7,_0xba89('0x19'));logger[_0xba89('0x1a')](_0xba89('0x1b'),_0x2db2c7,_0xba89('0x19'),JSON[_0xba89('0x1c')](_0x32fb40));if(_0x32fb40[_0xba89('0x1d')]){if(_0x32fb40[_0xba89('0x1d')]['code']===0x1f4){logger[_0xba89('0x1d')](_0xba89('0x1e'),_0x2db2c7,_0x32fb40[_0xba89('0x1d')][_0xba89('0x1f')]);return _0xc2d646(_0x32fb40[_0xba89('0x1d')][_0xba89('0x1f')]);}logger[_0xba89('0x1d')](_0xba89('0x1e'),_0x2db2c7,_0x32fb40[_0xba89('0x1d')]['message']);return _0x1e5665(_0x32fb40['error'][_0xba89('0x1f')]);}else{logger['info'](_0xba89('0x1e'),_0x2db2c7,_0xba89('0x19'));_0x1e5665(_0x32fb40[_0xba89('0x20')][_0xba89('0x1f')]);}})[_0xba89('0x21')](function(_0x506bae){logger[_0xba89('0x1d')](_0xba89('0x1e'),_0x2db2c7,_0x506bae);_0xc2d646(_0x506bae);});});}function respondWithStatusCode(_0x3b8c25,_0x5d798f){_0x5d798f=_0x5d798f||0xcc;return function(_0x4b6207){if(_0x4b6207){return _0x3b8c25[_0xba89('0x22')](_0x5d798f);}return _0x3b8c25[_0xba89('0x23')](_0x5d798f)[_0xba89('0x24')]();};}function respondWithResult(_0x25b5e8,_0x5bd930){_0x5bd930=_0x5bd930||0xc8;return function(_0x126fa9){if(_0x126fa9){return _0x25b5e8[_0xba89('0x23')](_0x5bd930)[_0xba89('0x25')](_0x126fa9);}};}function respondWithFilteredResult(_0x3f9ba3,_0x21d615){return function(_0x2efc8e){if(_0x2efc8e){var _0x55d2ea=typeof _0x21d615[_0xba89('0x26')]===_0xba89('0x27')&&typeof _0x21d615[_0xba89('0x28')]===_0xba89('0x27');var _0x36a2ff=_0x2efc8e[_0xba89('0x29')];var _0x40e4e4=_0x55d2ea?0x0:_0x21d615['offset'];var _0x4a5023=_0x55d2ea?_0x2efc8e[_0xba89('0x29')]:_0x21d615[_0xba89('0x26')]+_0x21d615['limit'];var _0x3fecac;if(_0x4a5023>=_0x36a2ff){_0x4a5023=_0x36a2ff;_0x3fecac=0xc8;}else{_0x3fecac=0xce;}_0x3f9ba3[_0xba89('0x23')](_0x3fecac);return _0x3f9ba3['set'](_0xba89('0x2a'),_0x40e4e4+'-'+_0x4a5023+'/'+_0x36a2ff)[_0xba89('0x25')](_0x2efc8e);}return null;};}function patchUpdates(_0x4c60ab){return function(_0x5a172b){try{jsonpatch[_0xba89('0x2b')](_0x5a172b,_0x4c60ab,!![]);}catch(_0x20272e){return BPromise[_0xba89('0x2c')](_0x20272e);}return _0x5a172b[_0xba89('0x2d')]();};}function saveUpdates(_0x5b1e7a,_0x477ce6){return function(_0x1bc7cd){if(_0x1bc7cd){return _0x1bc7cd['update'](_0x5b1e7a)['then'](function(_0x5e3981){return _0x5e3981;});}return null;};}function removeEntity(_0x29a9fa,_0x3cfca2){return function(_0x3a2f85){if(_0x3a2f85){return _0x3a2f85[_0xba89('0x2e')]()[_0xba89('0x18')](function(){var _0x5c7e5e=_0x3a2f85['get']({'plain':!![]});var _0x3e2519=_0xba89('0x2f');return db['UserProfileResource'][_0xba89('0x2e')]({'where':{'type':_0x3e2519,'resourceId':_0x5c7e5e['id']}})[_0xba89('0x18')](function(){return _0x3a2f85;});})['then'](function(){_0x29a9fa[_0xba89('0x23')](0xcc)[_0xba89('0x24')]();});}};}function handleEntityNotFound(_0x5e4f47,_0x45eee3){return function(_0xc85121){if(!_0xc85121){_0x5e4f47[_0xba89('0x22')](0x194);}return _0xc85121;};}function handleError(_0x1fe4fa,_0x336beb){_0x336beb=_0x336beb||0x1f4;return function(_0x53ab37){logger[_0xba89('0x1d')](_0x53ab37['stack']);if(_0x53ab37[_0xba89('0x30')]){delete _0x53ab37[_0xba89('0x30')];}_0x1fe4fa['status'](_0x336beb)[_0xba89('0x31')](_0x53ab37);};}exports[_0xba89('0x32')]=function(_0x276450,_0x211143){var _0x103b9d={'include':[{'model':db['Pause'],'as':_0xba89('0x33')}]},_0x324bb4={},_0x368ab0={'count':0x0,'rows':[]};var _0x4a4f21=_[_0xba89('0x34')](db[_0xba89('0x35')][_0xba89('0x36')],function(_0x597404){return{'name':_0x597404['fieldName'],'type':_0x597404['type']['key']};});_0x324bb4[_0xba89('0x37')]=_['map'](_0x4a4f21,'name');_0x324bb4[_0xba89('0x38')]=_['keys'](_0x276450[_0xba89('0x38')]);_0x324bb4[_0xba89('0x39')]=_['intersection'](_0x324bb4['model'],_0x324bb4['query']);_0x103b9d[_0xba89('0x3a')]=_[_0xba89('0x3b')](_0x324bb4['model'],qs['fields'](_0x276450[_0xba89('0x38')][_0xba89('0x3c')]));_0x103b9d[_0xba89('0x3a')]=_0x103b9d[_0xba89('0x3a')][_0xba89('0x3d')]?_0x103b9d['attributes']:_0x324bb4[_0xba89('0x37')];if(!_0x276450[_0xba89('0x38')][_0xba89('0x3e')](_0xba89('0x3f'))){_0x103b9d[_0xba89('0x28')]=qs[_0xba89('0x28')](_0x276450['query']['limit']);_0x103b9d[_0xba89('0x26')]=qs[_0xba89('0x26')](_0x276450[_0xba89('0x38')][_0xba89('0x26')]);}_0x103b9d[_0xba89('0x40')]=qs['sort'](_0x276450['query'][_0xba89('0x41')]);_0x103b9d[_0xba89('0x42')]=qs['filters'](_[_0xba89('0x43')](_0x276450[_0xba89('0x38')],_0x324bb4[_0xba89('0x39')]),_0x4a4f21);if(_0x276450[_0xba89('0x38')][_0xba89('0x44')]){_0x103b9d['where']=_['merge'](_0x103b9d['where'],{'$or':_[_0xba89('0x34')](_0x4a4f21,function(_0x133f42){if(_0x133f42[_0xba89('0x45')]!==_0xba89('0x46')){var _0x14e7e3={};_0x14e7e3[_0x133f42[_0xba89('0x30')]]={'$like':'%'+_0x276450[_0xba89('0x38')][_0xba89('0x44')]+'%'};return _0x14e7e3;}})});}_0x103b9d=_[_0xba89('0x47')]({},_0x103b9d,_0x276450['options']);var _0xcc1ca9={'where':_0x103b9d[_0xba89('0x42')]};return db[_0xba89('0x35')][_0xba89('0x29')](_0xcc1ca9)[_0xba89('0x18')](function(_0x404ea9){_0x368ab0[_0xba89('0x29')]=_0x404ea9;if(_0x276450[_0xba89('0x38')]['includeAll']){_0x103b9d[_0xba89('0x48')]=[{'all':!![]}];}return db[_0xba89('0x35')]['findAll'](_0x103b9d);})[_0xba89('0x18')](function(_0x17a419){_0x368ab0[_0xba89('0x49')]=_0x17a419;return _0x368ab0;})[_0xba89('0x18')](respondWithFilteredResult(_0x211143,_0x103b9d))[_0xba89('0x21')](handleError(_0x211143,null));};exports[_0xba89('0x4a')]=function(_0x12ea1b,_0xcf1a1a){var _0x1c77e0={'raw':![],'where':{'id':_0x12ea1b[_0xba89('0x4b')]['id']},'include':[{'model':db[_0xba89('0x4c')],'as':'mandatoryDispositionPause'}]},_0x535744={};_0x535744[_0xba89('0x37')]=_[_0xba89('0x4d')](db[_0xba89('0x35')]['rawAttributes']);_0x535744[_0xba89('0x38')]=_[_0xba89('0x4d')](_0x12ea1b[_0xba89('0x38')]);_0x535744['filters']=_[_0xba89('0x3b')](_0x535744[_0xba89('0x37')],_0x535744[_0xba89('0x38')]);_0x1c77e0[_0xba89('0x3a')]=_[_0xba89('0x3b')](_0x535744[_0xba89('0x37')],qs['fields'](_0x12ea1b[_0xba89('0x38')][_0xba89('0x3c')]));_0x1c77e0['attributes']=_0x1c77e0[_0xba89('0x3a')][_0xba89('0x3d')]?_0x1c77e0['attributes']:_0x535744[_0xba89('0x37')];if(_0x12ea1b[_0xba89('0x38')][_0xba89('0x4e')]){_0x1c77e0[_0xba89('0x48')]=[{'all':!![]}];}_0x1c77e0=_[_0xba89('0x47')]({},_0x1c77e0,_0x12ea1b[_0xba89('0x4f')]);return db['OpenchannelAccount'][_0xba89('0x50')](_0x1c77e0)[_0xba89('0x18')](handleEntityNotFound(_0xcf1a1a,null))[_0xba89('0x18')](respondWithResult(_0xcf1a1a,null))['catch'](handleError(_0xcf1a1a,null));};exports['create']=function(_0x4caeb4,_0x492b21){return db[_0xba89('0x35')][_0xba89('0x51')](_0x4caeb4['body'],{})[_0xba89('0x18')](function(_0x135264){var _0x49fbf6=_0x4caeb4[_0xba89('0x52')][_0xba89('0x53')]({'plain':!![]});if(!_0x49fbf6)throw new Error(_0xba89('0x54'));if(_0x49fbf6[_0xba89('0x55')]===_0xba89('0x52')){var _0xaac0d7=_0x135264['get']({'plain':!![]});var _0x1059fa=_0xba89('0x2f');return db['UserProfileSection'][_0xba89('0x50')]({'where':{'name':_0x1059fa,'userProfileId':_0x49fbf6[_0xba89('0x56')]},'raw':!![]})[_0xba89('0x18')](function(_0x1d0e9f){if(_0x1d0e9f&&_0x1d0e9f['autoAssociation']===0x0){return db[_0xba89('0x57')][_0xba89('0x51')]({'name':_0xaac0d7['name'],'resourceId':_0xaac0d7['id'],'type':_0x1d0e9f[_0xba89('0x30')],'sectionId':_0x1d0e9f['id']},{})['then'](function(){return _0x135264;});}else{return _0x135264;}})[_0xba89('0x21')](function(_0x145388){logger[_0xba89('0x1d')](_0xba89('0x58'),_0x145388);throw _0x145388;});}return _0x135264;})['then'](respondWithResult(_0x492b21,0xc9))[_0xba89('0x21')](handleError(_0x492b21,null));};exports['update']=function(_0x2e858d,_0x37d28e){if(_0x2e858d[_0xba89('0x59')]['id']){delete _0x2e858d['body']['id'];}return db['OpenchannelAccount'][_0xba89('0x50')]({'where':{'id':_0x2e858d['params']['id']},'include':[{'model':db[_0xba89('0x4c')],'as':_0xba89('0x33')}]})[_0xba89('0x18')](handleEntityNotFound(_0x37d28e,null))[_0xba89('0x18')](saveUpdates(_0x2e858d[_0xba89('0x59')],null))[_0xba89('0x18')](respondWithResult(_0x37d28e,null))['catch'](handleError(_0x37d28e,null));};exports[_0xba89('0x2e')]=function(_0x476e25,_0x28be00){return db[_0xba89('0x35')][_0xba89('0x50')]({'where':{'id':_0x476e25['params']['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x28be00,null))['then'](removeEntity(_0x28be00,null))[_0xba89('0x21')](handleError(_0x28be00,null));};exports[_0xba89('0x5a')]=function(_0x133f24,_0x31f746){return db['OpenchannelAccount']['describe']()[_0xba89('0x18')](respondWithResult(_0x31f746,null))['catch'](handleError(_0x31f746,null));};exports['addDisposition']=function(_0x7522a2,_0x146893,_0x539833){if(_0x7522a2[_0xba89('0x59')]['id']){delete _0x7522a2[_0xba89('0x59')]['id'];}return db[_0xba89('0x35')][_0xba89('0x50')]({'where':{'id':_0x7522a2[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x146893,null))['then'](function(_0x45f071){if(_0x45f071){_0x7522a2['body'][_0xba89('0x5b')]=_0x45f071['id'];return db[_0xba89('0x5c')][_0xba89('0x51')](_0x7522a2[_0xba89('0x59')]);}})[_0xba89('0x18')](respondWithResult(_0x146893,null))[_0xba89('0x21')](handleError(_0x146893,null));};exports[_0xba89('0x5d')]=function(_0x2b01f9,_0x3df629,_0x54ccbb){var _0x1b1340={'raw':![],'where':{}};var _0x4771d8={};var _0x109057={'count':0x0,'rows':[]};return db[_0xba89('0x35')][_0xba89('0x5e')]({'where':{'id':_0x2b01f9[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x3df629,null))['then'](function(_0x3c2cd4){if(_0x3c2cd4){_0x4771d8[_0xba89('0x37')]=_['keys'](db['Disposition'][_0xba89('0x36')]);_0x4771d8['query']=_[_0xba89('0x4d')](_0x2b01f9[_0xba89('0x38')]);_0x4771d8[_0xba89('0x39')]=_[_0xba89('0x3b')](_0x4771d8['model'],_0x4771d8['query']);_0x1b1340[_0xba89('0x3a')]=_[_0xba89('0x3b')](_0x4771d8[_0xba89('0x37')],qs[_0xba89('0x3c')](_0x2b01f9[_0xba89('0x38')][_0xba89('0x3c')]));_0x1b1340[_0xba89('0x3a')]=_0x1b1340[_0xba89('0x3a')][_0xba89('0x3d')]?_0x1b1340[_0xba89('0x3a')]:_0x4771d8[_0xba89('0x37')];if(!_0x2b01f9[_0xba89('0x38')][_0xba89('0x3e')](_0xba89('0x3f'))){_0x1b1340[_0xba89('0x28')]=qs['limit'](_0x2b01f9[_0xba89('0x38')][_0xba89('0x28')]);_0x1b1340[_0xba89('0x26')]=qs[_0xba89('0x26')](_0x2b01f9[_0xba89('0x38')][_0xba89('0x26')]);}_0x1b1340['order']=qs[_0xba89('0x41')](_0x2b01f9[_0xba89('0x38')][_0xba89('0x41')]);_0x1b1340[_0xba89('0x42')]=qs['filters'](_[_0xba89('0x43')](_0x2b01f9['query'],_0x4771d8[_0xba89('0x39')]));_0x1b1340[_0xba89('0x42')][_0xba89('0x5b')]=_0x3c2cd4['id'];if(_0x2b01f9[_0xba89('0x38')][_0xba89('0x44')]){_0x1b1340[_0xba89('0x42')]=_[_0xba89('0x47')](_0x1b1340[_0xba89('0x42')],{'$or':_[_0xba89('0x34')](_0x1b1340[_0xba89('0x3a')],function(_0x55a970){var _0x176390={};_0x176390[_0x55a970]={'$like':'%'+_0x2b01f9['query'][_0xba89('0x44')]+'%'};return _0x176390;})});}_0x1b1340=_['merge']({},_0x1b1340,_0x2b01f9[_0xba89('0x4f')]);return db['Disposition'][_0xba89('0x29')]({'where':_0x1b1340[_0xba89('0x42')]})[_0xba89('0x18')](function(_0x423523){_0x109057['count']=_0x423523;if(_0x2b01f9[_0xba89('0x38')][_0xba89('0x4e')]){_0x1b1340[_0xba89('0x48')]=[{'all':!![]}];}return db[_0xba89('0x5c')][_0xba89('0x5f')](_0x1b1340);})[_0xba89('0x18')](function(_0x4f3934){_0x109057[_0xba89('0x49')]=_0x4f3934;return _0x109057;});}})[_0xba89('0x18')](respondWithFilteredResult(_0x3df629,_0x1b1340))['catch'](handleError(_0x3df629,null));};exports['removeDispositions']=function(_0xe2b812,_0x29c09d,_0x27cd94){return db['OpenchannelAccount'][_0xba89('0x50')]({'where':{'id':_0xe2b812[_0xba89('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29c09d,null))[_0xba89('0x18')](function(_0x16a95d){if(_0x16a95d){return _0x16a95d[_0xba89('0x60')](_0xe2b812[_0xba89('0x38')]['ids']);}})[_0xba89('0x18')](respondWithStatusCode(_0x29c09d,null))[_0xba89('0x21')](handleError(_0x29c09d,null));};exports[_0xba89('0x61')]=function(_0x2038ba,_0x566e21,_0x1ac052){if(_0x2038ba[_0xba89('0x59')]['id']){delete _0x2038ba[_0xba89('0x59')]['id'];}return db[_0xba89('0x35')][_0xba89('0x50')]({'where':{'id':_0x2038ba['params']['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x566e21,null))['then'](function(_0x408da0){if(_0x408da0){_0x2038ba[_0xba89('0x59')][_0xba89('0x5b')]=_0x408da0['id'];return db[_0xba89('0x62')][_0xba89('0x51')](_0x2038ba[_0xba89('0x59')]);}})[_0xba89('0x18')](respondWithResult(_0x566e21,null))[_0xba89('0x21')](handleError(_0x566e21,null));};exports[_0xba89('0x63')]=function(_0xa4da4c,_0x69911b,_0x56e7d3){var _0x2b6ba7={'raw':![],'where':{}};var _0xc21a55={};var _0xe34166={'count':0x0,'rows':[]};return db[_0xba89('0x35')][_0xba89('0x5e')]({'where':{'id':_0xa4da4c[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x69911b,null))[_0xba89('0x18')](function(_0x2b4003){if(_0x2b4003){_0xc21a55[_0xba89('0x37')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0xc21a55[_0xba89('0x38')]=_[_0xba89('0x4d')](_0xa4da4c[_0xba89('0x38')]);_0xc21a55[_0xba89('0x39')]=_[_0xba89('0x3b')](_0xc21a55[_0xba89('0x37')],_0xc21a55[_0xba89('0x38')]);_0x2b6ba7['attributes']=_[_0xba89('0x3b')](_0xc21a55[_0xba89('0x37')],qs[_0xba89('0x3c')](_0xa4da4c[_0xba89('0x38')][_0xba89('0x3c')]));_0x2b6ba7['attributes']=_0x2b6ba7['attributes'][_0xba89('0x3d')]?_0x2b6ba7['attributes']:_0xc21a55[_0xba89('0x37')];if(!_0xa4da4c[_0xba89('0x38')][_0xba89('0x3e')](_0xba89('0x3f'))){_0x2b6ba7[_0xba89('0x28')]=qs[_0xba89('0x28')](_0xa4da4c[_0xba89('0x38')][_0xba89('0x28')]);_0x2b6ba7['offset']=qs['offset'](_0xa4da4c[_0xba89('0x38')]['offset']);}_0x2b6ba7['order']=qs['sort'](_0xa4da4c[_0xba89('0x38')][_0xba89('0x41')]);_0x2b6ba7[_0xba89('0x42')]=qs['filters'](_[_0xba89('0x43')](_0xa4da4c[_0xba89('0x38')],_0xc21a55['filters']));_0x2b6ba7[_0xba89('0x42')][_0xba89('0x5b')]=_0x2b4003['id'];if(_0xa4da4c[_0xba89('0x38')][_0xba89('0x44')]){_0x2b6ba7[_0xba89('0x42')]=_[_0xba89('0x47')](_0x2b6ba7[_0xba89('0x42')],{'$or':_[_0xba89('0x34')](_0x2b6ba7[_0xba89('0x3a')],function(_0x3d8b2e){var _0x1d47cd={};_0x1d47cd[_0x3d8b2e]={'$like':'%'+_0xa4da4c[_0xba89('0x38')][_0xba89('0x44')]+'%'};return _0x1d47cd;})});}_0x2b6ba7=_['merge']({},_0x2b6ba7,_0xa4da4c[_0xba89('0x4f')]);return db[_0xba89('0x62')]['count']({'where':_0x2b6ba7[_0xba89('0x42')]})[_0xba89('0x18')](function(_0x235b65){_0xe34166[_0xba89('0x29')]=_0x235b65;if(_0xa4da4c[_0xba89('0x38')]['includeAll']){_0x2b6ba7[_0xba89('0x48')]=[{'all':!![]}];}return db[_0xba89('0x62')][_0xba89('0x5f')](_0x2b6ba7);})[_0xba89('0x18')](function(_0x157b77){_0xe34166['rows']=_0x157b77;return _0xe34166;});}})['then'](respondWithFilteredResult(_0x69911b,_0x2b6ba7))[_0xba89('0x21')](handleError(_0x69911b,null));};exports[_0xba89('0x64')]=function(_0x53f96a,_0x21ad0b,_0x1f997d){return db[_0xba89('0x35')][_0xba89('0x50')]({'where':{'id':_0x53f96a[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x21ad0b,null))['then'](function(_0x33c838){if(_0x33c838){return _0x33c838['removeAnswers'](_0x53f96a['query'][_0xba89('0x65')]);}})['then'](respondWithStatusCode(_0x21ad0b,null))[_0xba89('0x21')](handleError(_0x21ad0b,null));};exports[_0xba89('0x66')]=function(_0x3df58c,_0x17f31e,_0x3fc28d){var _0x4cd7af={'body':_0x3df58c[_0xba89('0x59')],'channel':_0xba89('0x67')};var _0x1ea595=[];var _0x45b7f1=[];var _0x27c6bb={};var _0x19b318=![];return db[_0xba89('0x68')][_0xba89('0x5a')]()[_0xba89('0x18')](function(_0x428327){if(!_0x428327){throw new db['Sequelize'][(_0xba89('0x69'))](_0xba89('0x6a'));}_0x1ea595=_[_0xba89('0x6b')](_[_0xba89('0x4d')](_0x428327),[_0xba89('0x6c'),_0xba89('0x6d')]);_0x45b7f1=_['difference'](_[_0xba89('0x4d')](_0x428327),[_0xba89('0x6c'),_0xba89('0x6d'),_0xba89('0x6e'),'ListId']);if(_0x3df58c[_0xba89('0x59')]['id']){delete _0x3df58c[_0xba89('0x59')]['id'];}if(_[_0xba89('0x6f')](_0x3df58c[_0xba89('0x59')][_0xba89('0x70')])){throw new db[(_0xba89('0x71'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xba89('0x6f')](_0x3df58c[_0xba89('0x59')][_0xba89('0x59')])||_0x3df58c[_0xba89('0x59')][_0xba89('0x59')]===''){throw new db[(_0xba89('0x71'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xba89('0x6f')](_0x3df58c[_0xba89('0x59')][_0xba89('0x72')])){throw new db[(_0xba89('0x71'))][(_0xba89('0x69'))](_0xba89('0x73')+_0x45b7f1);}if(!_['includes'](_0x45b7f1,_0x3df58c[_0xba89('0x59')][_0xba89('0x72')])){throw new db[(_0xba89('0x71'))][(_0xba89('0x69'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x45b7f1);}_0x27c6bb[_0x3df58c[_0xba89('0x59')][_0xba89('0x72')]]=_0x3df58c['body'][_0xba89('0x70')];})[_0xba89('0x18')](function(){return db['OpenchannelAccount'][_0xba89('0x50')]({'where':{'id':_0x3df58c[_0xba89('0x4b')]['id']},'include':[{'model':db[_0xba89('0x74')],'as':_0xba89('0x75'),'include':[{'model':db[_0xba89('0x68')],'as':'Contacts','where':_0x27c6bb,'limit':0x1,'order':[[_0xba89('0x6d'),_0xba89('0x76')]]}]},{'model':db[_0xba89('0x77')],'as':_0xba89('0x78')}]});})[_0xba89('0x18')](handleEntityNotFound(_0x17f31e,null))[_0xba89('0x18')](function(_0x55917e){if(_0x55917e&&_0x55917e[_0xba89('0x75')]){_0x4cd7af[_0xba89('0x79')]=_0x55917e;_0x4cd7af['applications']=_0x55917e['Applications'];_0x4cd7af[_0xba89('0x7a')]=_0x55917e[_0xba89('0x75')];_0x4cd7af[_0xba89('0x7b')]=_[_0xba89('0x7c')](_0x4cd7af[_0xba89('0x7b')],[_0xba89('0x7d')],[_0xba89('0x7e')]);if(_0x4cd7af['account'][_0xba89('0x78')]){delete _0x4cd7af[_0xba89('0x79')][_0xba89('0x78')];}if(_0x4cd7af[_0xba89('0x79')]['List']&&_0x4cd7af[_0xba89('0x79')][_0xba89('0x75')][_0xba89('0x7f')][_0xba89('0x3d')]){return _0x4cd7af[_0xba89('0x79')][_0xba89('0x75')][_0xba89('0x7f')][0x0];}var _0x3b4fec=_[_0xba89('0x80')](_0x3df58c[_0xba89('0x59')],{'firstName':_0x3df58c['body'][_0xba89('0x70')],'ListId':_0x55917e[_0xba89('0x81')]});_0x3b4fec[_0x3df58c[_0xba89('0x59')][_0xba89('0x72')]]=_0x3df58c[_0xba89('0x59')]['from'];return db[_0xba89('0x68')]['create'](_0x3b4fec,{'fields':_0x1ea595,'raw':!![]});}})[_0xba89('0x18')](handleEntityNotFound(_0x17f31e,null))[_0xba89('0x18')](function(_0x197b01){_0x4cd7af[_0xba89('0x82')]=_0x197b01;if(_0x197b01){var _0x4bbf71={'ContactId':_0x197b01['id'],'OpenchannelAccountId':_0x3df58c[_0xba89('0x4b')]['id'],'from':(_0x197b01[_0xba89('0x83')]||'')+'\x20'+(_0x197b01[_0xba89('0x84')]||'')};var _0x5964cf={'OpenchannelAccountId':_0x3df58c[_0xba89('0x4b')]['id'],'closed':![]};if(_0x3df58c[_0xba89('0x59')][_0xba89('0x85')]){_0x5964cf[_0xba89('0x85')]=_0x3df58c['body'][_0xba89('0x85')];return db[_0xba89('0x86')][_0xba89('0x50')]({'where':_0x5964cf})[_0xba89('0x18')](function(_0x1edc0b){if(_0x1edc0b){return[_0x1edc0b,![]];}_0x4bbf71['threadId']=_0x3df58c[_0xba89('0x59')][_0xba89('0x85')];_0x4bbf71[_0xba89('0x87')]=_0x3df58c[_0xba89('0x59')][_0xba89('0x87')];return db[_0xba89('0x86')][_0xba89('0x51')](_0x4bbf71)['then'](function(_0x2b1640){return[_0x2b1640,!![]];});});}else{_0x5964cf[_0xba89('0x85')]=null;}_0x5964cf[_0xba89('0x88')]=_0x197b01['id'];return db[_0xba89('0x86')]['find']({'where':_0x5964cf})['then'](function(_0x234c7a){if(_0x234c7a){return[_0x234c7a,![]];}return db[_0xba89('0x86')][_0xba89('0x51')](_0x4bbf71)[_0xba89('0x18')](function(_0x470232){return[_0x470232,!![]];});});}})[_0xba89('0x89')](function(_0x4f79e1,_0x252311){if(_0x4f79e1){_0x19b318=_0x252311;if(!_0x252311){var _0x221d5b={'from':(_0x4cd7af[_0xba89('0x82')][_0xba89('0x83')]||'')+'\x20'+(_0x4cd7af['contact'][_0xba89('0x84')]||'')};if(_0x3df58c[_0xba89('0x59')]['threadId']&&_0x3df58c[_0xba89('0x59')]['messageId']&&_0x3df58c[_0xba89('0x59')][_0xba89('0x85')]!=_0x3df58c[_0xba89('0x59')][_0xba89('0x8a')]){_0x221d5b[_0xba89('0x85')]=_0x3df58c[_0xba89('0x59')][_0xba89('0x8a')];}return _0x4f79e1[_0xba89('0x8b')](_0x221d5b);}else{return _0x4f79e1;}}})[_0xba89('0x18')](function(_0x46c45b){_0x4cd7af['interaction']=_0x46c45b['get']({'plain':!![]});_0x4cd7af[_0xba89('0x8c')]['created']=_0x19b318;if(_0x4cd7af[_0xba89('0x8c')][_0xba89('0x8d')]){if(_0x4cd7af[_0xba89('0x79')]['autoclose']){_0x4cd7af[_0xba89('0x7b')][_0xba89('0x8e')]({'id':0x0,'priority':_0x4cd7af['applications']['length']+0x1,'app':_0xba89('0x8f'),'appdata':_0xba89('0x90'),'interval':'*,*,*,*'});}}return db[_0xba89('0x91')]['create']({'body':_0x3df58c[_0xba89('0x59')][_0xba89('0x59')],'OpenchannelAccountId':_0x3df58c['params']['id'],'OpenchannelInteractionId':_0x46c45b['id'],'direction':'in','ContactId':_0x4cd7af['contact']['id'],'AttachmentId':_0x3df58c[_0xba89('0x59')][_0xba89('0x92')]});})['then'](function(_0x19fe05){_0x4cd7af['message']=_0x19fe05;if(_0x4cd7af[_0xba89('0x8c')]['UserId']){return db['User'][_0xba89('0x50')]({'attributes':['id',_0xba89('0x30')],'where':{'id':_0x4cd7af[_0xba89('0x8c')]['UserId']}})['then'](function(_0x86be8f){if(_0x86be8f){_0x4cd7af[_0xba89('0x7b')][_0xba89('0x93')]({'id':0x0,'priority':0x0,'app':_0xba89('0x94'),'appdata':_0x86be8f[_0xba89('0x30')]+','+(_0x4cd7af[_0xba89('0x79')][_0xba89('0x95')]||0xa),'interval':_0xba89('0x96')});_0x4cd7af[_0xba89('0x97')]=![];}return respondWithRpcPromise(_0xba89('0x98'),_0xba89('0x99'),_0x4cd7af);});}return respondWithRpcPromise(_0xba89('0x98'),_0xba89('0x99'),_0x4cd7af);})[_0xba89('0x18')](function(_0x1e16b2){respondWithRpcPromise(_0xba89('0x9a'),_0xba89('0x9a'),{'event':_0xba89('0x66'),'message':_0x1e16b2},client9002);return _0x1e16b2;})[_0xba89('0x18')](respondWithResult(_0x17f31e,null))['catch'](handleError(_0x17f31e,null));};exports[_0xba89('0x9b')]=function(_0x4c20b6,_0x24c787,_0x31a397){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4c20b6[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x24c787,null))[_0xba89('0x18')](function(_0x2efd0e){if(_0x2efd0e){return db[_0xba89('0x9c')][_0xba89('0x9d')](function(_0x81ec9b){return db[_0xba89('0x77')][_0xba89('0x2e')]({'where':{'OpenchannelAccountId':_0x4c20b6[_0xba89('0x4b')]['id']},'transaction':_0x81ec9b})[_0xba89('0x18')](function(_0x24087a){var _0x526da7=_[_0xba89('0x34')](_0x4c20b6[_0xba89('0x59')],function(_0x50df32){_0x50df32[_0xba89('0x5b')]=_0x4c20b6[_0xba89('0x4b')]['id'];return _0x50df32;});return db[_0xba89('0x77')][_0xba89('0x9e')](_0x526da7,{'transaction':_0x81ec9b});});})[_0xba89('0x18')](function(){return db[_0xba89('0x77')][_0xba89('0x9f')]({'where':{'OpenchannelAccountId':_0x4c20b6[_0xba89('0x4b')]['id']},'order':'priority'});});}})[_0xba89('0x18')](respondWithResult(_0x24c787,null))[_0xba89('0x21')](handleError(_0x24c787,null));};exports[_0xba89('0xa0')]=function(_0x51a825,_0x4487ee,_0x59b4f3){var _0x42e5af={};var _0x36d13f={};var _0x320b33;var _0x4e73b5;return db['OpenchannelAccount'][_0xba89('0x5e')]({'where':{'id':_0x51a825['params']['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x4487ee,null))[_0xba89('0x18')](function(_0x5a103e){if(_0x5a103e){_0x320b33=_0x5a103e;_0x36d13f[_0xba89('0x37')]=_['keys'](db[_0xba89('0x77')]['rawAttributes']);_0x36d13f[_0xba89('0x38')]=_['keys'](_0x51a825[_0xba89('0x38')]);_0x36d13f[_0xba89('0x39')]=_[_0xba89('0x3b')](_0x36d13f['model'],_0x36d13f['query']);_0x42e5af['attributes']=_[_0xba89('0x3b')](_0x36d13f[_0xba89('0x37')],qs['fields'](_0x51a825['query']['fields']));_0x42e5af['attributes']=_0x42e5af[_0xba89('0x3a')][_0xba89('0x3d')]?_0x42e5af['attributes']:_0x36d13f[_0xba89('0x37')];_0x42e5af['order']=qs[_0xba89('0x41')](_0x51a825[_0xba89('0x38')][_0xba89('0x41')]);_0x42e5af['where']=qs[_0xba89('0x39')](_['pick'](_0x51a825[_0xba89('0x38')],_0x36d13f[_0xba89('0x39')]));if(_0x51a825[_0xba89('0x38')][_0xba89('0x44')]){_0x42e5af[_0xba89('0x42')]=_[_0xba89('0x47')](_0x42e5af['where'],{'$or':_['map'](_0x42e5af['attributes'],function(_0x5cf386){var _0x53308a={};_0x53308a[_0x5cf386]={'$like':'%'+_0x51a825['query'][_0xba89('0x44')]+'%'};return _0x53308a;})});}_0x42e5af=_[_0xba89('0x47')]({},_0x42e5af,_0x51a825['options']);return _0x320b33[_0xba89('0xa0')](_0x42e5af);}})['then'](function(_0xe4d5d2){if(_0xe4d5d2){_0x4e73b5=_0xe4d5d2[_0xba89('0x3d')];if(!_0x51a825[_0xba89('0x38')][_0xba89('0x3e')]('nolimit')){_0x42e5af[_0xba89('0x28')]=qs[_0xba89('0x28')](_0x51a825[_0xba89('0x38')][_0xba89('0x28')]);_0x42e5af['offset']=qs[_0xba89('0x26')](_0x51a825[_0xba89('0x38')]['offset']);}return _0x320b33['getApplications'](_0x42e5af);}})[_0xba89('0x18')](function(_0x24a123){if(_0x24a123){return _0x24a123?{'count':_0x4e73b5,'rows':_0x24a123}:null;}})[_0xba89('0x18')](respondWithResult(_0x4487ee,null))[_0xba89('0x21')](handleError(_0x4487ee,null));};exports[_0xba89('0xa1')]=function(_0xd6871e,_0x1055ac,_0x6e60f9){var _0x20dad1={'raw':![],'where':{}};var _0x4d126d={};var _0x12709b={'count':0x0,'rows':[]};return db[_0xba89('0x35')][_0xba89('0x5e')]({'where':{'id':_0xd6871e[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x1055ac,null))['then'](function(_0x4dcec5){if(_0x4dcec5){_0x4d126d[_0xba89('0x37')]=_[_0xba89('0x4d')](db[_0xba89('0x86')][_0xba89('0x36')]);_0x4d126d[_0xba89('0x38')]=_[_0xba89('0x4d')](_0xd6871e[_0xba89('0x38')]);_0x4d126d[_0xba89('0x39')]=_['intersection'](_0x4d126d['model'],_0x4d126d[_0xba89('0x38')]);_0x20dad1[_0xba89('0x3a')]=_['intersection'](_0x4d126d['model'],qs[_0xba89('0x3c')](_0xd6871e[_0xba89('0x38')][_0xba89('0x3c')]));_0x20dad1[_0xba89('0x3a')]=_0x20dad1[_0xba89('0x3a')][_0xba89('0x3d')]?_0x20dad1['attributes']:_0x4d126d[_0xba89('0x37')];if(!_0xd6871e['query'][_0xba89('0x3e')](_0xba89('0x3f'))){_0x20dad1[_0xba89('0x28')]=qs[_0xba89('0x28')](_0xd6871e['query']['limit']);_0x20dad1[_0xba89('0x26')]=qs[_0xba89('0x26')](_0xd6871e[_0xba89('0x38')][_0xba89('0x26')]);}_0x20dad1[_0xba89('0x40')]=qs[_0xba89('0x41')](_0xd6871e[_0xba89('0x38')][_0xba89('0x41')]);_0x20dad1[_0xba89('0x42')]=qs['filters'](_[_0xba89('0x43')](_0xd6871e['query'],_0x4d126d[_0xba89('0x39')]));_0x20dad1[_0xba89('0x42')]['OpenchannelAccountId']=_0x4dcec5['id'];if(_0xd6871e[_0xba89('0x38')][_0xba89('0x44')]){_0x20dad1[_0xba89('0x42')]=_[_0xba89('0x47')](_0x20dad1['where'],{'$or':_[_0xba89('0x34')](_0x20dad1[_0xba89('0x3a')],function(_0x84e112){var _0x560950={};_0x560950[_0x84e112]={'$like':'%'+_0xd6871e[_0xba89('0x38')][_0xba89('0x44')]+'%'};return _0x560950;})});}_0x20dad1=_[_0xba89('0x47')]({},_0x20dad1,_0xd6871e[_0xba89('0x4f')]);return db[_0xba89('0x86')]['count']({'where':_0x20dad1['where']})[_0xba89('0x18')](function(_0x533e8c){_0x12709b[_0xba89('0x29')]=_0x533e8c;if(_0xd6871e['query']['includeAll']){_0x20dad1[_0xba89('0x48')]=[{'model':db[_0xba89('0x68')],'as':_0xba89('0xa2'),'required':![]},{'model':db['User'],'as':_0xba89('0xa3'),'attributes':[_0xba89('0x30'),'fullname',_0xba89('0xa4')],'required':![]},{'model':db[_0xba89('0xa5')],'as':_0xba89('0xa6'),'attributes':['id',_0xba89('0x30'),'color'],'where':_0xd6871e[_0xba89('0x38')][_0xba89('0xa7')]?{'id':_0xd6871e[_0xba89('0x38')][_0xba89('0xa7')]}:undefined,'required':_0xd6871e[_0xba89('0x38')][_0xba89('0xa7')]?!![]:![]}];}return db[_0xba89('0x86')]['findAll'](_0x20dad1);})['then'](function(_0x32a071){_0x12709b['rows']=_0x32a071;return _0x12709b;});}})[_0xba89('0x18')](respondWithFilteredResult(_0x1055ac,_0x20dad1))[_0xba89('0x21')](handleError(_0x1055ac,null));};exports[_0xba89('0xa8')]=function(_0x3c99f7,_0x2247a5,_0x4d9e4d){return db['OpenchannelAccount'][_0xba89('0x50')]({'where':{'id':_0x3c99f7[_0xba89('0x4b')]['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x2247a5,null))['then'](function(_0x399b64){if(_0x399b64){return _0x399b64['addAgents'](_0x3c99f7[_0xba89('0x59')]['ids'],_[_0xba89('0xa9')](_0x3c99f7['body'],[_0xba89('0x65'),'id'])||{})[_0xba89('0x89')](function(_0x3fe3e1){for(var _0x123962=0x0;_0x123962<_0x3c99f7[_0xba89('0x59')]['ids']['length'];_0x123962+=0x1){socket[_0xba89('0xaa')](_0xba89('0xab'),{'UserId':Number(_0x3c99f7[_0xba89('0x59')][_0xba89('0x65')][_0x123962]),'OpenchannelAccountId':Number(_0x3c99f7[_0xba89('0x4b')]['id'])});}return _0x3fe3e1;});}})[_0xba89('0x18')](respondWithResult(_0x2247a5,null))[_0xba89('0x21')](handleError(_0x2247a5,null));};exports[_0xba89('0xac')]=function(_0xe9992d,_0x1a5abf,_0x1e3940){return db['OpenchannelAccount']['find']({'where':{'id':_0xe9992d['params']['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x1a5abf,null))[_0xba89('0x18')](function(_0x3d8460){if(_0x3d8460){return _0x3d8460['removeAgents'](_0xe9992d[_0xba89('0x38')][_0xba89('0x65')])[_0xba89('0x18')](function(){if(_[_0xba89('0xad')](_0xe9992d['query'][_0xba89('0x65')])){for(var _0x222885=0x0;_0x222885<_0xe9992d[_0xba89('0x38')][_0xba89('0x65')][_0xba89('0x3d')];_0x222885+=0x1){socket[_0xba89('0xaa')]('userOpenchannelAccount:remove',{'UserId':Number(_0xe9992d[_0xba89('0x38')][_0xba89('0x65')][_0x222885]),'OpenchannelAccountId':Number(_0xe9992d['params']['id'])});}}else{socket[_0xba89('0xaa')](_0xba89('0xae'),{'UserId':Number(_0xe9992d[_0xba89('0x38')][_0xba89('0x65')]),'OpenchannelAccountId':Number(_0xe9992d[_0xba89('0x4b')]['id'])});}});}})[_0xba89('0x18')](respondWithStatusCode(_0x1a5abf,null))[_0xba89('0x21')](handleError(_0x1a5abf,null));};exports[_0xba89('0xaf')]=function(_0xa78fe1,_0x325919,_0x4d97ff){var _0x23e049={};var _0x837afa={};var _0x34926d;var _0xaabe96;return db[_0xba89('0x35')][_0xba89('0x5e')]({'where':{'id':_0xa78fe1[_0xba89('0x4b')]['id']}})['then'](handleEntityNotFound(_0x325919,null))[_0xba89('0x18')](function(_0x515b96){if(_0x515b96){_0x34926d=_0x515b96;_0x837afa[_0xba89('0x37')]=_[_0xba89('0x4d')](db[_0xba89('0xb0')]['rawAttributes']);_0x837afa[_0xba89('0x38')]=_[_0xba89('0x4d')](_0xa78fe1[_0xba89('0x38')]);_0x837afa[_0xba89('0x39')]=_[_0xba89('0x3b')](_0x837afa[_0xba89('0x37')],_0x837afa[_0xba89('0x38')]);_0x23e049[_0xba89('0x3a')]=_[_0xba89('0x3b')](_0x837afa[_0xba89('0x37')],qs[_0xba89('0x3c')](_0xa78fe1[_0xba89('0x38')][_0xba89('0x3c')]));_0x23e049[_0xba89('0x3a')]=_0x23e049[_0xba89('0x3a')][_0xba89('0x3d')]?_0x23e049['attributes']:_0x837afa[_0xba89('0x37')];_0x23e049[_0xba89('0x40')]=qs['sort'](_0xa78fe1['query']['sort']);_0x23e049[_0xba89('0x42')]=qs[_0xba89('0x39')](_[_0xba89('0x43')](_0xa78fe1[_0xba89('0x38')],_0x837afa[_0xba89('0x39')]));if(_0xa78fe1['query']['filter']){_0x23e049['where']=_['merge'](_0x23e049[_0xba89('0x42')],{'$or':_[_0xba89('0x34')](_0x23e049[_0xba89('0x3a')],function(_0x22a559){var _0xc0b9cb={};_0xc0b9cb[_0x22a559]={'$like':'%'+_0xa78fe1[_0xba89('0x38')][_0xba89('0x44')]+'%'};return _0xc0b9cb;})});}_0x23e049=_[_0xba89('0x47')]({},_0x23e049,_0xa78fe1[_0xba89('0x4f')]);return _0x34926d[_0xba89('0xaf')](_0x23e049);}})[_0xba89('0x18')](function(_0x30625e){if(_0x30625e){_0xaabe96=_0x30625e[_0xba89('0x3d')];if(!_0xa78fe1[_0xba89('0x38')]['hasOwnProperty'](_0xba89('0x3f'))){_0x23e049['limit']=qs['limit'](_0xa78fe1[_0xba89('0x38')][_0xba89('0x28')]);_0x23e049[_0xba89('0x26')]=qs[_0xba89('0x26')](_0xa78fe1['query'][_0xba89('0x26')]);}return _0x34926d['getAgents'](_0x23e049);}})[_0xba89('0x18')](function(_0x4a156b){if(_0x4a156b){return _0x4a156b?{'count':_0xaabe96,'rows':_0x4a156b}:null;}})[_0xba89('0x18')](respondWithResult(_0x325919,null))[_0xba89('0x21')](handleError(_0x325919,null));};exports['send']=function(_0xb83d8e,_0x43e133,_0x3e72bd){var _0x15c750,_0x760902,_0x33480e;if(_[_0xba89('0x6f')](_0xb83d8e[_0xba89('0x59')][_0xba89('0x59')])||_0xb83d8e[_0xba89('0x59')][_0xba89('0x59')]===''){throw new db[(_0xba89('0x71'))][(_0xba89('0x69'))](_0xba89('0xb1'));}if(_[_0xba89('0x6f')](_0xb83d8e[_0xba89('0x59')]['to'])){}_0x15c750=_0xb83d8e['body']['to'];return db[_0xba89('0x35')][_0xba89('0x5e')]({'where':{'id':_0xb83d8e['params']['id']}})[_0xba89('0x18')](handleEntityNotFound(_0x43e133,null))[_0xba89('0x18')](function(_0x4a5bf4){if(_0x4a5bf4){return db[_0xba89('0x35')][_0xba89('0x50')]({'where':{'id':_0x4a5bf4['id']},'include':[{'model':db[_0xba89('0x74')],'as':_0xba89('0x75'),'include':[{'model':db[_0xba89('0x68')],'as':_0xba89('0x7f'),'where':{[_0x4a5bf4[_0xba89('0x72')]]:_0x15c750},'limit':0x1,'order':[[_0xba89('0x6d'),_0xba89('0x76')]]}]}]})['then'](handleEntityNotFound(_0x43e133,null))['then'](function(_0x2223d2){if(_0x2223d2&&_0x2223d2[_0xba89('0x75')]){_0x760902=_0x2223d2[_0xba89('0x53')]({'plain':!![]});if(_0x760902[_0xba89('0x75')]&&_0x760902['List'][_0xba89('0x7f')][_0xba89('0x3d')]){return _0x760902[_0xba89('0x75')][_0xba89('0x7f')][0x0];}return db[_0xba89('0x68')][_0xba89('0x51')](_['defaults'](_0xb83d8e[_0xba89('0x59')],{'firstName':_0x15c750,[_0x2223d2[_0xba89('0x72')]]:_0x15c750,'phone':_0x15c750,'ListId':_0x760902[_0xba89('0x81')]}));}})[_0xba89('0x18')](handleEntityNotFound(_0x43e133,null))[_0xba89('0x18')](function(_0x4cb9d4){if(_0x4cb9d4){_0x33480e=_0x4cb9d4;return db[_0xba89('0x86')][_0xba89('0x50')]({'where':{'ContactId':_0x33480e['id'],'closed':![],'OpenchannelAccountId':_0x760902['id']}})[_0xba89('0x18')](function(_0x20dccd){if(_0x20dccd){return[_0x20dccd,![]];}return db[_0xba89('0x86')][_0xba89('0x51')]({'UserId':_0xb83d8e[_0xba89('0x52')]['id'],'ContactId':_0x33480e['id'],'OpenchannelAccountId':_0x760902['id'],'lastMsgDirection':_0xba89('0xb2'),'Messages':[_[_0xba89('0x47')](_0xb83d8e[_0xba89('0x59')],{'read':![],'body':_0xb83d8e[_0xba89('0x59')][_0xba89('0x59')],'OpenchannelAccountId':_0x760902['id'],'UserId':_0xb83d8e['user']['id'],'ContactId':_0x33480e['id']})]},{'include':[{'model':db[_0xba89('0x91')],'as':_0xba89('0xb3')}]})[_0xba89('0x18')](function(_0x387ac2){return[_0x387ac2,!![]];});});}})[_0xba89('0x89')](function(_0x59801f,_0x1997cf){if(_0x1997cf){return _0x59801f;}return db['OpenchannelMessage']['create'](_[_0xba89('0x47')](_0xb83d8e[_0xba89('0x59')],{'read':![],'body':_0xb83d8e[_0xba89('0x59')][_0xba89('0x59')],'OpenchannelAccountId':_0x760902['id'],'OpenchannelInteractionId':_0x59801f['id'],'UserId':_0xb83d8e['user']['id'],'ContactId':_0x33480e['id']}))[_0xba89('0x18')](function(_0x5078f4){_0x59801f[_0xba89('0xb4')][_0xba89('0xb3')]=[];_0x59801f[_0xba89('0xb4')][_0xba89('0xb3')][_0xba89('0x8e')](_0x5078f4[_0xba89('0xb4')]);return _0x59801f;});});}})[_0xba89('0x18')](respondWithResult(_0x43e133,null))['catch'](handleError(_0x43e133,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1642e23..123a4d5 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 _0x2547=['hasOwnProperty','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x67714a,_0x550d17){var _0x468499=function(_0x4a272a){while(--_0x4a272a){_0x67714a['push'](_0x67714a['shift']());}};_0x468499(++_0x550d17);}(_0x2547,0x1cd));var _0x7254=function(_0x3bddc6,_0x217f85){_0x3bddc6=_0x3bddc6-0x0;var _0x34d646=_0x2547[_0x3bddc6];return _0x34d646;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){OpenchannelAccountEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);OpenchannelAccountEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x4ea3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0xd2c332,_0x1b5f38){var _0x4efc6f=function(_0x56d70c){while(--_0x56d70c){_0xd2c332['push'](_0xd2c332['shift']());}};_0x4efc6f(++_0x1b5f38);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x34ea('0x0'));var OpenchannelAccount=require(_0x34ea('0x1'))['db'][_0x34ea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x34ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x269d4c){return function(_0x571f1b,_0x5e5a84,_0x2ce955){OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c+':'+_0x571f1b['id'],_0x571f1b);OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c,_0x571f1b);_0x2ce955(null);};}for(var e in events){if(events[_0x34ea('0x6')](e)){var event=events[e];OpenchannelAccount[_0x34ea('0x7')](e,emitEvent(event));}}module[_0x34ea('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index df98b94..b661527 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(_0x1b8278,_0x59d5ba){var _0xa9cacd=function(_0x231108){while(--_0x231108){_0x1b8278['push'](_0x1b8278['shift']());}};_0xa9cacd(++_0x59d5ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x29d2a8,_0x102796){var _0x442be2=function(_0x2d586a){while(--_0x2d586a){_0x29d2a8['push'](_0x29d2a8['shift']());}};_0x442be2(++_0x102796);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 27af821..93fd634 100644 --- a/server/api/openchannelAccount/openchannelAccount.rpc.js +++ b/server/api/openchannelAccount/openchannelAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf7b4,0x152));var _0x4f7b=function(_0x346797,_0x2d92e2){_0x346797=_0x346797-0x0;var _0x4f1b71=_0xf7b4[_0x346797];return _0x4f1b71;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./openchannelAccount.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});} \ No newline at end of file +var _0xc901=['info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register'];(function(_0x55ba2a,_0x4df633){var _0x3a41ee=function(_0x241916){while(--_0x241916){_0x55ba2a['push'](_0x55ba2a['shift']());}};_0x3a41ee(++_0x4df633);}(_0xc901,0x142));var _0x1c90=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc901[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});config[_0x1c90('0x9')]=_[_0x1c90('0xa')](config[_0x1c90('0x9')],{'host':_0x1c90('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c90('0x9')]));require(_0x1c90('0xc'))[_0x1c90('0xd')](socket);function respondWithRpcPromise(_0x1f2c61,_0x374852,_0x66c02){return new BPromise(function(_0x616ad0,_0x3890e1){return client['request'](_0x1f2c61,_0x66c02)['then'](function(_0x17d8ae){logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x374852,'request\x20sent');logger['debug'](_0x1c90('0x10'),_0x374852,_0x1c90('0x11'),JSON['stringify'](_0x17d8ae));if(_0x17d8ae[_0x1c90('0x12')]){if(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x13')]===0x1f4){logger['error'](_0x1c90('0xf'),_0x374852,_0x17d8ae['error'][_0x1c90('0x14')]);return _0x3890e1(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x14')]);}logger[_0x1c90('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x374852,_0x17d8ae[_0x1c90('0x12')]['message']);return _0x616ad0(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x14')]);}else{logger['info'](_0x1c90('0xf'),_0x374852,'request\x20sent');_0x616ad0(_0x17d8ae['result'][_0x1c90('0x14')]);}})['catch'](function(_0x341228){logger[_0x1c90('0x12')](_0x1c90('0xf'),_0x374852,_0x341228);_0x3890e1(_0x341228);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6294825..e7c8b4a 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 _0x1c8a=['removeListener','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c8a,0x140));var _0xa1c8=function(_0x2ac0d2,_0x2a2125){_0x2ac0d2=_0x2ac0d2-0x0;var _0x4ea9a9=_0x1c8a[_0x2ac0d2];return _0x4ea9a9;};'use strict';var OpenchannelAccountEvents=require(_0xa1c8('0x0'));var events=[_0xa1c8('0x1'),_0xa1c8('0x2'),_0xa1c8('0x3')];function createListener(_0x2eb128,_0x50af02){return function(_0x250aa9){_0x50af02['emit'](_0x2eb128,_0x250aa9);};}function removeListener(_0x122813,_0x1cdee0){return function(){OpenchannelAccountEvents[_0xa1c8('0x4')](_0x122813,_0x1cdee0);};}exports['register']=function(_0x331282){for(var _0x14b85c=0x0,_0x14d2f0=events['length'];_0x14b85c<_0x14d2f0;_0x14b85c++){var _0x32993e=events[_0x14b85c];var _0xf93962=createListener(_0xa1c8('0x5')+_0x32993e,_0x331282);OpenchannelAccountEvents['on'](_0x32993e,_0xf93962);}}; \ No newline at end of file +var _0xaefc=['./openchannelAccount.events','save','remove','length','openchannelAccount:'];(function(_0xa61bdc,_0x1d9fc0){var _0x5d25c9=function(_0x465591){while(--_0x465591){_0xa61bdc['push'](_0xa61bdc['shift']());}};_0x5d25c9(++_0x1d9fc0);}(_0xaefc,0xc8));var _0xcaef=function(_0x13b7d2,_0x46c7c5){_0x13b7d2=_0x13b7d2-0x0;var _0x279e13=_0xaefc[_0x13b7d2];return _0x279e13;};'use strict';var OpenchannelAccountEvents=require(_0xcaef('0x0'));var events=[_0xcaef('0x1'),_0xcaef('0x2'),'update'];function createListener(_0x1da249,_0xd60229){return function(_0x49cc54){_0xd60229['emit'](_0x1da249,_0x49cc54);};}function removeListener(_0x37a134,_0x46a35e){return function(){OpenchannelAccountEvents['removeListener'](_0x37a134,_0x46a35e);};}exports['register']=function(_0x47457d){for(var _0x4471a1=0x0,_0x567a8f=events[_0xcaef('0x3')];_0x4471a1<_0x567a8f;_0x4471a1++){var _0x538f22=events[_0x4471a1];var _0x49d64c=createListener(_0xcaef('0x4')+_0x538f22,_0x47457d);OpenchannelAccountEvents['on'](_0x538f22,_0x49d64c);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e9da329..847aac8 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 _0xc232=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x482c43,_0x1b2cd8){var _0x3babc6=function(_0x93aa9e){while(--_0x93aa9e){_0x482c43['push'](_0x482c43['shift']());}};_0x3babc6(++_0x1b2cd8);}(_0xc232,0x1ab));var _0x2c23=function(_0x19d1f1,_0x15098b){_0x19d1f1=_0x19d1f1-0x0;var _0x394fcc=_0xc232[_0x19d1f1];return _0x394fcc;};'use strict';var multer=require(_0x2c23('0x0'));var util=require(_0x2c23('0x1'));var path=require('path');var timeout=require(_0x2c23('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c23('0x3'));var auth=require(_0x2c23('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2c23('0x5'));var controller=require(_0x2c23('0x6'));router[_0x2c23('0x7')]('/',auth[_0x2c23('0x8')](),controller[_0x2c23('0x9')]);router[_0x2c23('0x7')](_0x2c23('0xa'),auth[_0x2c23('0x8')](),controller[_0x2c23('0xb')]);router['post']('/',auth[_0x2c23('0x8')](),controller['create']);router[_0x2c23('0xc')](_0x2c23('0xa'),auth[_0x2c23('0x8')](),controller['update']);router[_0x2c23('0xd')](_0x2c23('0xa'),auth[_0x2c23('0x8')](),controller[_0x2c23('0xe')]);module[_0x2c23('0xf')]=router; \ No newline at end of file +var _0x10d3=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x327c69,_0x27e755){var _0x49c1af=function(_0x21f59e){while(--_0x21f59e){_0x327c69['push'](_0x327c69['shift']());}};_0x49c1af(++_0x27e755);}(_0x10d3,0xff));var _0x310d=function(_0x5babe6,_0x3b7b70){_0x5babe6=_0x5babe6-0x0;var _0x40f6af=_0x10d3[_0x5babe6];return _0x40f6af;};'use strict';var multer=require(_0x310d('0x0'));var util=require(_0x310d('0x1'));var path=require('path');var timeout=require(_0x310d('0x2'));var express=require('express');var router=express[_0x310d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x310d('0x4'));var interaction=require(_0x310d('0x5'));var config=require(_0x310d('0x6'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x310d('0x7')](),controller['index']);router[_0x310d('0x8')](_0x310d('0x9'),auth[_0x310d('0x7')](),controller[_0x310d('0xa')]);router['post']('/',auth[_0x310d('0x7')](),controller[_0x310d('0xb')]);router['put'](_0x310d('0x9'),auth[_0x310d('0x7')](),controller[_0x310d('0xc')]);router[_0x310d('0xd')]('/:id',auth[_0x310d('0x7')](),controller[_0x310d('0xe')]);module[_0x310d('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 7cb47d7..220e176 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 _0x2a98=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x43b9b6,_0x57fb71){var _0xdb5eab=function(_0x5e47ca){while(--_0x5e47ca){_0x43b9b6['push'](_0x43b9b6['shift']());}};_0xdb5eab(++_0x57fb71);}(_0x2a98,0x87));var _0x82a9=function(_0x2310a3,_0x4268a0){_0x2310a3=_0x2310a3-0x0;var _0x5262dc=_0x2a98[_0x2310a3];return _0x5262dc;};'use strict';var Sequelize=require(_0x82a9('0x0'));module[_0x82a9('0x1')]={'priority':{'type':Sequelize[_0x82a9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82a9('0x3')},'appdata':{'type':Sequelize[_0x82a9('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x82a9('0x5')],'defaultValue':_0x82a9('0x6')}}; \ No newline at end of file +var _0x65b0=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x676335,_0x187b50){var _0x3b3628=function(_0x31d5eb){while(--_0x31d5eb){_0x676335['push'](_0x676335['shift']());}};_0x3b3628(++_0x187b50);}(_0x65b0,0x8a));var _0x065b=function(_0x1ca998,_0x581ddc){_0x1ca998=_0x1ca998-0x0;var _0x13f9ca=_0x65b0[_0x1ca998];return _0x13f9ca;};'use strict';var Sequelize=require(_0x065b('0x0'));module[_0x065b('0x1')]={'priority':{'type':Sequelize[_0x065b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x065b('0x3')],'allowNull':![],'defaultValue':_0x065b('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x065b('0x3')]},'interval':{'type':Sequelize[_0x065b('0x3')],'defaultValue':_0x065b('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9cc1aa7..ed89732 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 _0xe360=['request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','find','create','body','params','rimraf','zip-dir','fast-json-patch'];(function(_0x2ebb82,_0x1ec439){var _0xbe36fb=function(_0x17e41f){while(--_0x17e41f){_0x2ebb82['push'](_0x2ebb82['shift']());}};_0xbe36fb(++_0x1ec439);}(_0xe360,0x15b));var _0x0e36=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xe360[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e36('0x0'));var zipdir=require(_0x0e36('0x1'));var jsonpatch=require(_0x0e36('0x2'));var rp=require(_0x0e36('0x3'));var moment=require(_0x0e36('0x4'));var BPromise=require(_0x0e36('0x5'));var Mustache=require(_0x0e36('0x6'));var util=require(_0x0e36('0x7'));var path=require('path');var sox=require(_0x0e36('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e36('0x9'));var _=require(_0x0e36('0xa'));var squel=require(_0x0e36('0xb'));var crypto=require('crypto');var jsforce=require(_0x0e36('0xc'));var deskjs=require(_0x0e36('0xd'));var toCsv=require(_0x0e36('0xe'));var querystring=require(_0x0e36('0xf'));var Papa=require(_0x0e36('0x10'));var Redis=require(_0x0e36('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e36('0x12'));var db=require(_0x0e36('0x13'))['db'];function respondWithStatusCode(_0x3a45d3,_0x2d98c7){_0x2d98c7=_0x2d98c7||0xcc;return function(_0x5c7914){if(_0x5c7914){return _0x3a45d3[_0x0e36('0x14')](_0x2d98c7);}return _0x3a45d3[_0x0e36('0x15')](_0x2d98c7)['end']();};}function respondWithResult(_0x562dda,_0x4a829c){_0x4a829c=_0x4a829c||0xc8;return function(_0x1c7424){if(_0x1c7424){return _0x562dda[_0x0e36('0x15')](_0x4a829c)[_0x0e36('0x16')](_0x1c7424);}};}function respondWithFilteredResult(_0x2364b3,_0x1dd3ea){return function(_0x2e607a){if(_0x2e607a){var _0x4889ea=typeof _0x1dd3ea['offset']===_0x0e36('0x17')&&typeof _0x1dd3ea[_0x0e36('0x18')]==='undefined';var _0x1a3473=_0x2e607a[_0x0e36('0x19')];var _0x420333=_0x4889ea?0x0:_0x1dd3ea['offset'];var _0x31731e=_0x4889ea?_0x2e607a[_0x0e36('0x19')]:_0x1dd3ea[_0x0e36('0x1a')]+_0x1dd3ea[_0x0e36('0x18')];var _0x4412e1;if(_0x31731e>=_0x1a3473){_0x31731e=_0x1a3473;_0x4412e1=0xc8;}else{_0x4412e1=0xce;}_0x2364b3['status'](_0x4412e1);return _0x2364b3['set'](_0x0e36('0x1b'),_0x420333+'-'+_0x31731e+'/'+_0x1a3473)[_0x0e36('0x16')](_0x2e607a);}return null;};}function patchUpdates(_0x49c375){return function(_0x31829d){try{jsonpatch[_0x0e36('0x1c')](_0x31829d,_0x49c375,!![]);}catch(_0x3c5e2f){return BPromise[_0x0e36('0x1d')](_0x3c5e2f);}return _0x31829d[_0x0e36('0x1e')]();};}function saveUpdates(_0x5b92fc,_0x15902d){return function(_0x4a3c68){if(_0x4a3c68){return _0x4a3c68[_0x0e36('0x1f')](_0x5b92fc)[_0x0e36('0x20')](function(_0x2f1c36){return _0x2f1c36;});}return null;};}function removeEntity(_0x42f66c,_0x4aedec){return function(_0x3eaba5){if(_0x3eaba5){return _0x3eaba5[_0x0e36('0x21')]()['then'](function(){_0x42f66c['status'](0xcc)[_0x0e36('0x22')]();});}};}function handleEntityNotFound(_0x5b94db,_0xab73b){return function(_0x559de3){if(!_0x559de3){_0x5b94db['sendStatus'](0x194);}return _0x559de3;};}function handleError(_0x5c59df,_0x24da49){_0x24da49=_0x24da49||0x1f4;return function(_0x1a1434){logger['error'](_0x1a1434[_0x0e36('0x23')]);if(_0x1a1434[_0x0e36('0x24')]){delete _0x1a1434[_0x0e36('0x24')];}_0x5c59df['status'](_0x24da49)[_0x0e36('0x25')](_0x1a1434);};}exports[_0x0e36('0x26')]=function(_0x2fdbae,_0x5d3959){var _0x49dc97={},_0x259cfa={},_0x2a0a19={'count':0x0,'rows':[]};var _0x22cffb=_[_0x0e36('0x27')](db[_0x0e36('0x28')][_0x0e36('0x29')],function(_0x1ccdd2){return{'name':_0x1ccdd2[_0x0e36('0x2a')],'type':_0x1ccdd2['type'][_0x0e36('0x2b')]};});_0x259cfa[_0x0e36('0x2c')]=_[_0x0e36('0x27')](_0x22cffb,_0x0e36('0x24'));_0x259cfa['query']=_[_0x0e36('0x2d')](_0x2fdbae[_0x0e36('0x2e')]);_0x259cfa[_0x0e36('0x2f')]=_['intersection'](_0x259cfa[_0x0e36('0x2c')],_0x259cfa[_0x0e36('0x2e')]);_0x49dc97[_0x0e36('0x30')]=_[_0x0e36('0x31')](_0x259cfa['model'],qs[_0x0e36('0x32')](_0x2fdbae[_0x0e36('0x2e')]['fields']));_0x49dc97[_0x0e36('0x30')]=_0x49dc97[_0x0e36('0x30')][_0x0e36('0x33')]?_0x49dc97[_0x0e36('0x30')]:_0x259cfa[_0x0e36('0x2c')];if(!_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x34')](_0x0e36('0x35'))){_0x49dc97[_0x0e36('0x18')]=qs['limit'](_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x18')]);_0x49dc97[_0x0e36('0x1a')]=qs['offset'](_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x1a')]);}_0x49dc97['order']=qs[_0x0e36('0x36')](_0x2fdbae['query']['sort']);_0x49dc97[_0x0e36('0x37')]=qs['filters'](_[_0x0e36('0x38')](_0x2fdbae[_0x0e36('0x2e')],_0x259cfa['filters']),_0x22cffb);if(_0x2fdbae[_0x0e36('0x2e')]['filter']){_0x49dc97[_0x0e36('0x37')]=_[_0x0e36('0x39')](_0x49dc97[_0x0e36('0x37')],{'$or':_[_0x0e36('0x27')](_0x22cffb,function(_0x1d5a1b){if(_0x1d5a1b[_0x0e36('0x3a')]!==_0x0e36('0x3b')){var _0xaf65b4={};_0xaf65b4[_0x1d5a1b[_0x0e36('0x24')]]={'$like':'%'+_0x2fdbae[_0x0e36('0x2e')][_0x0e36('0x3c')]+'%'};return _0xaf65b4;}})});}_0x49dc97=_['merge']({},_0x49dc97,_0x2fdbae[_0x0e36('0x3d')]);var _0x2d22b2={'where':_0x49dc97[_0x0e36('0x37')]};return db[_0x0e36('0x28')][_0x0e36('0x19')](_0x2d22b2)['then'](function(_0x48065a){_0x2a0a19[_0x0e36('0x19')]=_0x48065a;if(_0x2fdbae['query'][_0x0e36('0x3e')]){_0x49dc97[_0x0e36('0x3f')]=[{'all':!![]}];}return db[_0x0e36('0x28')][_0x0e36('0x40')](_0x49dc97);})['then'](function(_0x3bbba3){_0x2a0a19['rows']=_0x3bbba3;return _0x2a0a19;})['then'](respondWithFilteredResult(_0x5d3959,_0x49dc97))[_0x0e36('0x41')](handleError(_0x5d3959,null));};exports['show']=function(_0x2509b3,_0x4b9561){var _0xaea43={'raw':!![],'where':{'id':_0x2509b3['params']['id']}},_0xb259fe={};_0xb259fe[_0x0e36('0x2c')]=_['keys'](db['OpenchannelApplication'][_0x0e36('0x29')]);_0xb259fe[_0x0e36('0x2e')]=_[_0x0e36('0x2d')](_0x2509b3['query']);_0xb259fe[_0x0e36('0x2f')]=_[_0x0e36('0x31')](_0xb259fe['model'],_0xb259fe[_0x0e36('0x2e')]);_0xaea43['attributes']=_[_0x0e36('0x31')](_0xb259fe['model'],qs[_0x0e36('0x32')](_0x2509b3[_0x0e36('0x2e')][_0x0e36('0x32')]));_0xaea43['attributes']=_0xaea43[_0x0e36('0x30')][_0x0e36('0x33')]?_0xaea43[_0x0e36('0x30')]:_0xb259fe[_0x0e36('0x2c')];if(_0x2509b3['query'][_0x0e36('0x3e')]){_0xaea43[_0x0e36('0x3f')]=[{'all':!![]}];}_0xaea43=_['merge']({},_0xaea43,_0x2509b3[_0x0e36('0x3d')]);return db[_0x0e36('0x28')][_0x0e36('0x42')](_0xaea43)[_0x0e36('0x20')](handleEntityNotFound(_0x4b9561,null))['then'](respondWithResult(_0x4b9561,null))[_0x0e36('0x41')](handleError(_0x4b9561,null));};exports['create']=function(_0x554acb,_0x1ed9d3){return db[_0x0e36('0x28')][_0x0e36('0x43')](_0x554acb['body'],{})[_0x0e36('0x20')](respondWithResult(_0x1ed9d3,0xc9))[_0x0e36('0x41')](handleError(_0x1ed9d3,null));};exports['update']=function(_0xf0673e,_0x1a5d84){if(_0xf0673e[_0x0e36('0x44')]['id']){delete _0xf0673e['body']['id'];}return db['OpenchannelApplication'][_0x0e36('0x42')]({'where':{'id':_0xf0673e[_0x0e36('0x45')]['id']}})[_0x0e36('0x20')](handleEntityNotFound(_0x1a5d84,null))[_0x0e36('0x20')](saveUpdates(_0xf0673e[_0x0e36('0x44')],null))['then'](respondWithResult(_0x1a5d84,null))[_0x0e36('0x41')](handleError(_0x1a5d84,null));};exports[_0x0e36('0x21')]=function(_0x526796,_0x30d258){return db[_0x0e36('0x28')][_0x0e36('0x42')]({'where':{'id':_0x526796[_0x0e36('0x45')]['id']}})[_0x0e36('0x20')](handleEntityNotFound(_0x30d258,null))[_0x0e36('0x20')](removeEntity(_0x30d258,null))['catch'](handleError(_0x30d258,null));}; \ No newline at end of file +var _0x3d53=['nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','OpenchannelApplication','fieldName','key','model','keys','query','intersection','attributes','fields','length'];(function(_0x371a32,_0x2886d3){var _0x2077da=function(_0x2655e6){while(--_0x2655e6){_0x371a32['push'](_0x371a32['shift']());}};_0x2077da(++_0x2886d3);}(_0x3d53,0xf3));var _0x33d5=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x3d53[_0x4bf96c];return _0x281d09;};'use strict';var emlformat=require(_0x33d5('0x0'));var rimraf=require(_0x33d5('0x1'));var zipdir=require(_0x33d5('0x2'));var jsonpatch=require(_0x33d5('0x3'));var rp=require('request-promise');var moment=require(_0x33d5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x33d5('0x5'));var path=require(_0x33d5('0x6'));var sox=require(_0x33d5('0x7'));var csv=require(_0x33d5('0x8'));var ejs=require(_0x33d5('0x9'));var fs=require('fs');var fs_extra=require(_0x33d5('0xa'));var _=require(_0x33d5('0xb'));var squel=require(_0x33d5('0xc'));var crypto=require(_0x33d5('0xd'));var jsforce=require(_0x33d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x33d5('0x8'));var querystring=require(_0x33d5('0xf'));var Papa=require(_0x33d5('0x10'));var Redis=require(_0x33d5('0x11'));var authService=require(_0x33d5('0x12'));var qs=require(_0x33d5('0x13'));var as=require(_0x33d5('0x14'));var hardwareService=require(_0x33d5('0x15'));var logger=require(_0x33d5('0x16'))(_0x33d5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x33d5('0x18'));var db=require(_0x33d5('0x19'))['db'];function respondWithStatusCode(_0x36aae4,_0x25a029){_0x25a029=_0x25a029||0xcc;return function(_0x3dd0b5){if(_0x3dd0b5){return _0x36aae4[_0x33d5('0x1a')](_0x25a029);}return _0x36aae4['status'](_0x25a029)[_0x33d5('0x1b')]();};}function respondWithResult(_0x239d3e,_0xda8b1d){_0xda8b1d=_0xda8b1d||0xc8;return function(_0x462f63){if(_0x462f63){return _0x239d3e[_0x33d5('0x1c')](_0xda8b1d)[_0x33d5('0x1d')](_0x462f63);}};}function respondWithFilteredResult(_0x5f48cd,_0x213620){return function(_0x452252){if(_0x452252){var _0xe205aa=typeof _0x213620[_0x33d5('0x1e')]===_0x33d5('0x1f')&&typeof _0x213620['limit']===_0x33d5('0x1f');var _0x3e1263=_0x452252['count'];var _0x1f94bd=_0xe205aa?0x0:_0x213620['offset'];var _0x37c602=_0xe205aa?_0x452252[_0x33d5('0x20')]:_0x213620[_0x33d5('0x1e')]+_0x213620['limit'];var _0x80f39;if(_0x37c602>=_0x3e1263){_0x37c602=_0x3e1263;_0x80f39=0xc8;}else{_0x80f39=0xce;}_0x5f48cd[_0x33d5('0x1c')](_0x80f39);return _0x5f48cd[_0x33d5('0x21')](_0x33d5('0x22'),_0x1f94bd+'-'+_0x37c602+'/'+_0x3e1263)[_0x33d5('0x1d')](_0x452252);}return null;};}function patchUpdates(_0x5dc9d6){return function(_0x58e43d){try{jsonpatch[_0x33d5('0x23')](_0x58e43d,_0x5dc9d6,!![]);}catch(_0x36e68e){return BPromise[_0x33d5('0x24')](_0x36e68e);}return _0x58e43d['save']();};}function saveUpdates(_0x5dee82,_0x2093bb){return function(_0x2591fa){if(_0x2591fa){return _0x2591fa['update'](_0x5dee82)[_0x33d5('0x25')](function(_0x13a845){return _0x13a845;});}return null;};}function removeEntity(_0x499fc7,_0x4bc8d8){return function(_0x4e17fc){if(_0x4e17fc){return _0x4e17fc[_0x33d5('0x26')]()['then'](function(){_0x499fc7[_0x33d5('0x1c')](0xcc)[_0x33d5('0x1b')]();});}};}function handleEntityNotFound(_0x42cc14,_0x3d8ebc){return function(_0x1ce811){if(!_0x1ce811){_0x42cc14['sendStatus'](0x194);}return _0x1ce811;};}function handleError(_0x3e256e,_0x28887a){_0x28887a=_0x28887a||0x1f4;return function(_0x205c25){logger[_0x33d5('0x27')](_0x205c25['stack']);if(_0x205c25[_0x33d5('0x28')]){delete _0x205c25['name'];}_0x3e256e[_0x33d5('0x1c')](_0x28887a)[_0x33d5('0x29')](_0x205c25);};}exports['index']=function(_0x45b06a,_0x3c15ac){var _0x5620f5={},_0x53e327={},_0x1d4972={'count':0x0,'rows':[]};var _0x24bf11=_[_0x33d5('0x2a')](db[_0x33d5('0x2b')]['rawAttributes'],function(_0x3b3f7a){return{'name':_0x3b3f7a[_0x33d5('0x2c')],'type':_0x3b3f7a['type'][_0x33d5('0x2d')]};});_0x53e327[_0x33d5('0x2e')]=_[_0x33d5('0x2a')](_0x24bf11,'name');_0x53e327['query']=_[_0x33d5('0x2f')](_0x45b06a[_0x33d5('0x30')]);_0x53e327['filters']=_[_0x33d5('0x31')](_0x53e327[_0x33d5('0x2e')],_0x53e327[_0x33d5('0x30')]);_0x5620f5[_0x33d5('0x32')]=_['intersection'](_0x53e327[_0x33d5('0x2e')],qs[_0x33d5('0x33')](_0x45b06a[_0x33d5('0x30')][_0x33d5('0x33')]));_0x5620f5[_0x33d5('0x32')]=_0x5620f5[_0x33d5('0x32')][_0x33d5('0x34')]?_0x5620f5[_0x33d5('0x32')]:_0x53e327[_0x33d5('0x2e')];if(!_0x45b06a['query']['hasOwnProperty'](_0x33d5('0x35'))){_0x5620f5[_0x33d5('0x36')]=qs[_0x33d5('0x36')](_0x45b06a[_0x33d5('0x30')]['limit']);_0x5620f5['offset']=qs[_0x33d5('0x1e')](_0x45b06a[_0x33d5('0x30')][_0x33d5('0x1e')]);}_0x5620f5[_0x33d5('0x37')]=qs[_0x33d5('0x38')](_0x45b06a[_0x33d5('0x30')][_0x33d5('0x38')]);_0x5620f5[_0x33d5('0x39')]=qs[_0x33d5('0x3a')](_[_0x33d5('0x3b')](_0x45b06a[_0x33d5('0x30')],_0x53e327['filters']),_0x24bf11);if(_0x45b06a[_0x33d5('0x30')][_0x33d5('0x3c')]){_0x5620f5['where']=_[_0x33d5('0x3d')](_0x5620f5[_0x33d5('0x39')],{'$or':_[_0x33d5('0x2a')](_0x24bf11,function(_0x3ce595){if(_0x3ce595['type']!==_0x33d5('0x3e')){var _0x372016={};_0x372016[_0x3ce595[_0x33d5('0x28')]]={'$like':'%'+_0x45b06a[_0x33d5('0x30')]['filter']+'%'};return _0x372016;}})});}_0x5620f5=_[_0x33d5('0x3d')]({},_0x5620f5,_0x45b06a[_0x33d5('0x3f')]);var _0x34095b={'where':_0x5620f5[_0x33d5('0x39')]};return db[_0x33d5('0x2b')]['count'](_0x34095b)['then'](function(_0x15c8a4){_0x1d4972[_0x33d5('0x20')]=_0x15c8a4;if(_0x45b06a[_0x33d5('0x30')]['includeAll']){_0x5620f5[_0x33d5('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x5620f5);})['then'](function(_0xaf7bed){_0x1d4972[_0x33d5('0x41')]=_0xaf7bed;return _0x1d4972;})[_0x33d5('0x25')](respondWithFilteredResult(_0x3c15ac,_0x5620f5))['catch'](handleError(_0x3c15ac,null));};exports[_0x33d5('0x42')]=function(_0x1a1e06,_0x32d8d9){var _0x25e9a2={'raw':!![],'where':{'id':_0x1a1e06[_0x33d5('0x43')]['id']}},_0x1931f5={};_0x1931f5[_0x33d5('0x2e')]=_[_0x33d5('0x2f')](db['OpenchannelApplication'][_0x33d5('0x44')]);_0x1931f5[_0x33d5('0x30')]=_['keys'](_0x1a1e06[_0x33d5('0x30')]);_0x1931f5[_0x33d5('0x3a')]=_[_0x33d5('0x31')](_0x1931f5[_0x33d5('0x2e')],_0x1931f5['query']);_0x25e9a2[_0x33d5('0x32')]=_[_0x33d5('0x31')](_0x1931f5[_0x33d5('0x2e')],qs[_0x33d5('0x33')](_0x1a1e06['query'][_0x33d5('0x33')]));_0x25e9a2[_0x33d5('0x32')]=_0x25e9a2[_0x33d5('0x32')][_0x33d5('0x34')]?_0x25e9a2[_0x33d5('0x32')]:_0x1931f5['model'];if(_0x1a1e06['query']['includeAll']){_0x25e9a2['include']=[{'all':!![]}];}_0x25e9a2=_[_0x33d5('0x3d')]({},_0x25e9a2,_0x1a1e06[_0x33d5('0x3f')]);return db[_0x33d5('0x2b')][_0x33d5('0x45')](_0x25e9a2)['then'](handleEntityNotFound(_0x32d8d9,null))[_0x33d5('0x25')](respondWithResult(_0x32d8d9,null))[_0x33d5('0x46')](handleError(_0x32d8d9,null));};exports['create']=function(_0x3c2de4,_0x4e9af6){return db[_0x33d5('0x2b')][_0x33d5('0x47')](_0x3c2de4[_0x33d5('0x48')],{})['then'](respondWithResult(_0x4e9af6,0xc9))['catch'](handleError(_0x4e9af6,null));};exports[_0x33d5('0x49')]=function(_0x48ec2d,_0x2c1381){if(_0x48ec2d[_0x33d5('0x48')]['id']){delete _0x48ec2d['body']['id'];}return db[_0x33d5('0x2b')]['find']({'where':{'id':_0x48ec2d[_0x33d5('0x43')]['id']}})[_0x33d5('0x25')](handleEntityNotFound(_0x2c1381,null))['then'](saveUpdates(_0x48ec2d[_0x33d5('0x48')],null))['then'](respondWithResult(_0x2c1381,null))[_0x33d5('0x46')](handleError(_0x2c1381,null));};exports[_0x33d5('0x26')]=function(_0x51709,_0x37927b){return db[_0x33d5('0x2b')]['find']({'where':{'id':_0x51709[_0x33d5('0x43')]['id']}})['then'](handleEntityNotFound(_0x37927b,null))[_0x33d5('0x25')](removeEntity(_0x37927b,null))[_0x33d5('0x46')](handleError(_0x37927b,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 54c1bb4..5cfd370 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 _0xb801=['define','OpenchannelApplication','openchannel_applications','utf8mb4','util','../../config/logger','api','moment','request-promise','path','./openchannelApplication.attributes'];(function(_0x17208f,_0x4d14fb){var _0x28cbe6=function(_0xb203bb){while(--_0xb203bb){_0x17208f['push'](_0x17208f['shift']());}};_0x28cbe6(++_0x4d14fb);}(_0xb801,0x72));var _0x1b80=function(_0xd53e10,_0xcdea82){_0xd53e10=_0xd53e10-0x0;var _0x1f4b56=_0xb801[_0xd53e10];return _0x1f4b56;};'use strict';var _=require('lodash');var util=require(_0x1b80('0x0'));var logger=require(_0x1b80('0x1'))(_0x1b80('0x2'));var moment=require(_0x1b80('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b80('0x4'));var fs=require('fs');var path=require(_0x1b80('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b80('0x6'));module['exports']=function(_0x290dfa,_0x21a00e){return _0x290dfa[_0x1b80('0x7')](_0x1b80('0x8'),attributes,{'tableName':_0x1b80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b80('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x882f=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci'];(function(_0x13991c,_0x207424){var _0x55ab8f=function(_0x5b512a){while(--_0x5b512a){_0x13991c['push'](_0x13991c['shift']());}};_0x55ab8f(++_0x207424);}(_0x882f,0xa8));var _0xf882=function(_0x34b863,_0x572731){_0x34b863=_0x34b863-0x0;var _0x42e135=_0x882f[_0x34b863];return _0x42e135;};'use strict';var _=require(_0xf882('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf882('0x1'));var moment=require(_0xf882('0x2'));var BPromise=require(_0xf882('0x3'));var rp=require(_0xf882('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf882('0x5'));var config=require(_0xf882('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xf882('0x7')]=function(_0x3f08da,_0xe545ff){return _0x3f08da[_0xf882('0x8')](_0xf882('0x9'),attributes,{'tableName':_0xf882('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf882('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f2c2f06..1b73e44 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 _0x70af=['message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70af,0xfc));var _0xf70a=function(_0x4e65ea,_0x538229){_0x4e65ea=_0x4e65ea-0x0;var _0x351f9b=_0x70af[_0x4e65ea];return _0x351f9b;};'use strict';var _=require(_0xf70a('0x0'));var util=require(_0xf70a('0x1'));var moment=require(_0xf70a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf70a('0x3'));var fs=require('fs');var Redis=require(_0xf70a('0x4'));var db=require(_0xf70a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf70a('0x6'))(_0xf70a('0x7'));var config=require(_0xf70a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf70a('0x9')][_0xf70a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e4691,_0x24ae7b,_0x4c01aa){return new BPromise(function(_0x3614e3,_0x1abaf9){return client['request'](_0x3e4691,_0x4c01aa)[_0xf70a('0xb')](function(_0x113f8d){logger['info'](_0xf70a('0xc'),_0x24ae7b,_0xf70a('0xd'));logger[_0xf70a('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x24ae7b,_0xf70a('0xd'),JSON[_0xf70a('0xf')](_0x113f8d));if(_0x113f8d[_0xf70a('0x10')]){if(_0x113f8d['error'][_0xf70a('0x11')]===0x1f4){logger[_0xf70a('0x10')](_0xf70a('0xc'),_0x24ae7b,_0x113f8d['error']['message']);return _0x1abaf9(_0x113f8d[_0xf70a('0x10')][_0xf70a('0x12')]);}logger[_0xf70a('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x24ae7b,_0x113f8d[_0xf70a('0x10')][_0xf70a('0x12')]);return _0x3614e3(_0x113f8d[_0xf70a('0x10')][_0xf70a('0x12')]);}else{logger['info'](_0xf70a('0xc'),_0x24ae7b,_0xf70a('0xd'));_0x3614e3(_0x113f8d[_0xf70a('0x13')][_0xf70a('0x12')]);}})[_0xf70a('0x14')](function(_0x49eadd){logger[_0xf70a('0x10')](_0xf70a('0xc'),_0x24ae7b,_0x49eadd);_0x1abaf9(_0x49eadd);});});}exports[_0xf70a('0x15')]=function(_0x1d77e0){var _0x2ffd7a=this;return new Promise(function(_0x21c93d,_0x92d01a){return db[_0xf70a('0x16')][_0xf70a('0x17')](_0x1d77e0[_0xf70a('0x18')],{'raw':_0x1d77e0[_0xf70a('0x19')]?_0x1d77e0[_0xf70a('0x19')][_0xf70a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d77e0['options']?_0x1d77e0[_0xf70a('0x19')][_0xf70a('0x1b')]||null:null,'attributes':_0x1d77e0[_0xf70a('0x19')]?_0x1d77e0[_0xf70a('0x19')][_0xf70a('0x1c')]||null:null,'limit':_0x1d77e0[_0xf70a('0x19')]?_0x1d77e0[_0xf70a('0x19')]['limit']||null:null})[_0xf70a('0xb')](function(_0x1e36da){logger[_0xf70a('0x1d')](_0xf70a('0x15'),_0x1d77e0);logger['debug'](_0xf70a('0x15'),_0x1d77e0,JSON['stringify'](_0x1e36da));_0x21c93d(_0x1e36da);})['catch'](function(_0x434733){logger[_0xf70a('0x10')](_0xf70a('0x15'),_0x434733[_0xf70a('0x12')],_0x1d77e0);_0x92d01a(_0x2ffd7a['error'](0x1f4,_0x434733[_0xf70a('0x12')]));});});}; \ No newline at end of file +var _0x9971=['result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','attributes','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3b709d,_0x178ad6){var _0x5905ff=function(_0x50a113){while(--_0x50a113){_0x3b709d['push'](_0x3b709d['shift']());}};_0x5905ff(++_0x178ad6);}(_0x9971,0x79));var _0x1997=function(_0x32c050,_0x39cae4){_0x32c050=_0x32c050-0x0;var _0x155ece=_0x9971[_0x32c050];return _0x155ece;};'use strict';var _=require(_0x1997('0x0'));var util=require(_0x1997('0x1'));var moment=require(_0x1997('0x2'));var BPromise=require('bluebird');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('../../config/logger')('rpc');var config=require(_0x1997('0x7'));var jayson=require(_0x1997('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x539e0b,_0x3518ab,_0x117cab){return new BPromise(function(_0x35864d,_0x2116af){return client[_0x1997('0x9')](_0x539e0b,_0x117cab)['then'](function(_0x816523){logger['info'](_0x1997('0xa'),_0x3518ab,_0x1997('0xb'));logger[_0x1997('0xc')](_0x1997('0xd'),_0x3518ab,'request\x20sent',JSON[_0x1997('0xe')](_0x816523));if(_0x816523['error']){if(_0x816523[_0x1997('0xf')][_0x1997('0x10')]===0x1f4){logger[_0x1997('0xf')](_0x1997('0xa'),_0x3518ab,_0x816523[_0x1997('0xf')]['message']);return _0x2116af(_0x816523['error'][_0x1997('0x11')]);}logger[_0x1997('0xf')](_0x1997('0xa'),_0x3518ab,_0x816523[_0x1997('0xf')][_0x1997('0x11')]);return _0x35864d(_0x816523['error']['message']);}else{logger[_0x1997('0x12')](_0x1997('0xa'),_0x3518ab,'request\x20sent');_0x35864d(_0x816523[_0x1997('0x13')][_0x1997('0x11')]);}})[_0x1997('0x14')](function(_0x4de098){logger[_0x1997('0xf')](_0x1997('0xa'),_0x3518ab,_0x4de098);_0x2116af(_0x4de098);});});}exports[_0x1997('0x15')]=function(_0xcdebcb){var _0x59c2d9=this;return new Promise(function(_0x122896,_0x4352cf){return db[_0x1997('0x16')]['update'](_0xcdebcb[_0x1997('0x17')],{'raw':_0xcdebcb[_0x1997('0x18')]?_0xcdebcb[_0x1997('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcdebcb['options']?_0xcdebcb[_0x1997('0x18')][_0x1997('0x19')]||null:null,'attributes':_0xcdebcb[_0x1997('0x18')]?_0xcdebcb['options'][_0x1997('0x1a')]||null:null,'limit':_0xcdebcb[_0x1997('0x18')]?_0xcdebcb['options']['limit']||null:null})[_0x1997('0x1b')](function(_0x297372){logger[_0x1997('0x12')]('UpdateOpenchannelApplication',_0xcdebcb);logger[_0x1997('0xc')](_0x1997('0x15'),_0xcdebcb,JSON[_0x1997('0xe')](_0x297372));_0x122896(_0x297372);})[_0x1997('0x14')](function(_0x5a61d0){logger['error'](_0x1997('0x15'),_0x5a61d0[_0x1997('0x11')],_0xcdebcb);_0x4352cf(_0x59c2d9[_0x1997('0xf')](0x1f4,_0x5a61d0[_0x1997('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index afa9001..21f183d 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 _0x97ab=['isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x97ab,0xf6));var _0xb97a=function(_0x5945ad,_0xddc347){_0x5945ad=_0x5945ad-0x0;var _0x26944b=_0x97ab[_0x5945ad];return _0x26944b;};'use strict';var multer=require(_0xb97a('0x0'));var util=require(_0xb97a('0x1'));var path=require(_0xb97a('0x2'));var timeout=require(_0xb97a('0x3'));var express=require(_0xb97a('0x4'));var router=express['Router']();var fs_extra=require(_0xb97a('0x5'));var auth=require(_0xb97a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb97a('0x7'));var controller=require(_0xb97a('0x8'));router[_0xb97a('0x9')]('/',auth[_0xb97a('0xa')](),controller[_0xb97a('0xb')]);router[_0xb97a('0x9')]('/describe',auth[_0xb97a('0xa')](),controller[_0xb97a('0xc')]);router[_0xb97a('0x9')](_0xb97a('0xd'),auth[_0xb97a('0xa')](),controller[_0xb97a('0xe')]);router[_0xb97a('0x9')](_0xb97a('0xf'),auth[_0xb97a('0xa')](),controller[_0xb97a('0x10')]);router['get'](_0xb97a('0x11'),auth[_0xb97a('0xa')](),controller[_0xb97a('0x12')]);router[_0xb97a('0x13')]('/',auth[_0xb97a('0xa')](),controller['create']);router['post'](_0xb97a('0xf'),auth['isAuthenticated'](),controller[_0xb97a('0x14')]);router[_0xb97a('0x13')](_0xb97a('0x15'),auth[_0xb97a('0xa')](),interaction[_0xb97a('0x16')](_0xb97a('0x17'),_0xb97a('0x18')),controller[_0xb97a('0x19')]);router['put']('/:id',auth[_0xb97a('0xa')](),interaction['tracked'](_0xb97a('0x17'),_0xb97a('0x1a')),controller[_0xb97a('0x1b')]);router['delete']('/:id',auth[_0xb97a('0xa')](),interaction[_0xb97a('0x16')](_0xb97a('0x17'),_0xb97a('0x1c')),controller[_0xb97a('0x1d')]);router[_0xb97a('0x1e')](_0xb97a('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xb97a('0x1f')]=router; \ No newline at end of file +var _0x71fc=['put','openchannelinteraction:update','update','delete','/:id/tags','removeTags','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','openchannel','addTags'];(function(_0x2a78d9,_0x51231e){var _0x5505cc=function(_0x1d4be7){while(--_0x1d4be7){_0x2a78d9['push'](_0x2a78d9['shift']());}};_0x5505cc(++_0x51231e);}(_0x71fc,0xba));var _0xc71f=function(_0xd12357,_0x3ae637){_0xd12357=_0xd12357-0x0;var _0x23bdce=_0x71fc[_0xd12357];return _0x23bdce;};'use strict';var multer=require(_0xc71f('0x0'));var util=require(_0xc71f('0x1'));var path=require('path');var timeout=require(_0xc71f('0x2'));var express=require('express');var router=express[_0xc71f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc71f('0x4'));var interaction=require(_0xc71f('0x5'));var config=require(_0xc71f('0x6'));var controller=require(_0xc71f('0x7'));router[_0xc71f('0x8')]('/',auth[_0xc71f('0x9')](),controller[_0xc71f('0xa')]);router['get']('/describe',auth[_0xc71f('0x9')](),controller[_0xc71f('0xb')]);router[_0xc71f('0x8')](_0xc71f('0xc'),auth[_0xc71f('0x9')](),controller[_0xc71f('0xd')]);router['get']('/:id/messages',auth[_0xc71f('0x9')](),controller[_0xc71f('0xe')]);router[_0xc71f('0x8')](_0xc71f('0xf'),auth[_0xc71f('0x9')](),controller[_0xc71f('0x10')]);router[_0xc71f('0x11')]('/',auth['isAuthenticated'](),controller[_0xc71f('0x12')]);router[_0xc71f('0x11')](_0xc71f('0x13'),auth[_0xc71f('0x9')](),controller[_0xc71f('0x14')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xc71f('0x15')](_0xc71f('0x16'),'openchannelinteraction:addtags'),controller[_0xc71f('0x17')]);router[_0xc71f('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0xc71f('0x15')](_0xc71f('0x16'),_0xc71f('0x19')),controller[_0xc71f('0x1a')]);router[_0xc71f('0x1b')]('/:id',auth[_0xc71f('0x9')](),interaction[_0xc71f('0x15')]('openchannel','openchannelinteraction:destroy'),controller['destroy']);router[_0xc71f('0x1b')](_0xc71f('0x1c'),auth[_0xc71f('0x9')](),controller[_0xc71f('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 ed603d1..a22c76c 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 _0xe1f0=['exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x52f14b,_0xa6b793){var _0x866eb0=function(_0x3a40f1){while(--_0x3a40f1){_0x52f14b['push'](_0x52f14b['shift']());}};_0x866eb0(++_0xa6b793);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x4a6a67,_0x4bada2){_0x4a6a67=_0x4a6a67-0x0;var _0x3f67ac=_0xe1f0[_0x4a6a67];return _0x3f67ac;};'use strict';var Sequelize=require('sequelize');module[_0x0e1f('0x0')]={'closed':{'type':Sequelize[_0x0e1f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0e1f('0x2')]},'secondDisposition':{'type':Sequelize[_0x0e1f('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0e1f('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0e1f('0x3')]},'threadId':{'type':Sequelize[_0x0e1f('0x2')]},'externalUrl':{'type':Sequelize[_0x0e1f('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0e1f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0e1f('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x0e1f('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x99e9=['exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x15d9c6,_0x1d4651){var _0xa658e=function(_0x18efb4){while(--_0x18efb4){_0x15d9c6['push'](_0x15d9c6['shift']());}};_0xa658e(++_0x1d4651);}(_0x99e9,0xb4));var _0x999e=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0x99e9[_0x1bb6aa];return _0x2ef28e;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'closed':{'type':Sequelize[_0x999e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x999e('0x2')]},'disposition':{'type':Sequelize[_0x999e('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x999e('0x3')]},'note':{'type':Sequelize[_0x999e('0x3')]},'read1stAt':{'type':Sequelize[_0x999e('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x999e('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x999e('0x4')]('in',_0x999e('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x999e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x999e('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 68ff07a..c79a5ed 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 _0x2c98=['join','root','files','attachments','fullname','firstName','lastName','Attachment','Messages','direction','secret','Account','get','Openchannel','Owner','N.A.','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','createWriteStream','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','TagIds','split','Tags','index','OpenchannelInteraction','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','buildExpression','body','some','compact','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','catch','params','filters','includeAll','include','options','create','describe','addMessage','omit','ids','getMessages','rawAttributes','hasOwnProperty','OpenchannelInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','rows','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','server'];(function(_0x326bce,_0x1b0c53){var _0x29e9e2=function(_0x34e568){while(--_0x34e568){_0x326bce['push'](_0x326bce['shift']());}};_0x29e9e2(++_0x1b0c53);}(_0x2c98,0x110));var _0x82c9=function(_0x53fe41,_0xfd7e0d){_0x53fe41=_0x53fe41-0x0;var _0x4d7d13=_0x2c98[_0x53fe41];return _0x4d7d13;};'use strict';var emlformat=require(_0x82c9('0x0'));var rimraf=require(_0x82c9('0x1'));var zipdir=require(_0x82c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x82c9('0x3'));var BPromise=require(_0x82c9('0x4'));var Mustache=require(_0x82c9('0x5'));var util=require(_0x82c9('0x6'));var path=require(_0x82c9('0x7'));var sox=require(_0x82c9('0x8'));var csv=require(_0x82c9('0x9'));var ejs=require(_0x82c9('0xa'));var fs=require('fs');var fs_extra=require(_0x82c9('0xb'));var _=require(_0x82c9('0xc'));var squel=require('squel');var crypto=require(_0x82c9('0xd'));var jsforce=require(_0x82c9('0xe'));var deskjs=require(_0x82c9('0xf'));var toCsv=require(_0x82c9('0x9'));var querystring=require(_0x82c9('0x10'));var Papa=require(_0x82c9('0x11'));var Redis=require(_0x82c9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x82c9('0x13'));var as=require(_0x82c9('0x14'));var pdf=require(_0x82c9('0x15'));var hardwareService=require(_0x82c9('0x16'));var logger=require(_0x82c9('0x17'))(_0x82c9('0x18'));var utils=require(_0x82c9('0x19'));var config=require(_0x82c9('0x1a'));var licenseUtil=require(_0x82c9('0x1b'));var db=require(_0x82c9('0x1c'))['db'];config[_0x82c9('0x1d')]=_['defaults'](config[_0x82c9('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x82c9('0x1e'))(new Redis(config[_0x82c9('0x1d')]));require(_0x82c9('0x1f'))['register'](socket);function respondWithStatusCode(_0x4a1e91,_0x1d0491){_0x1d0491=_0x1d0491||0xcc;return function(_0xd59638){if(_0xd59638){return _0x4a1e91[_0x82c9('0x20')](_0x1d0491);}return _0x4a1e91[_0x82c9('0x21')](_0x1d0491)['end']();};}function respondWithResult(_0x1f8c81,_0x4d6625){_0x4d6625=_0x4d6625||0xc8;return function(_0x3a978f){if(_0x3a978f){return _0x1f8c81[_0x82c9('0x21')](_0x4d6625)[_0x82c9('0x22')](_0x3a978f);}};}function respondWithFilteredResult(_0x3433d0,_0x58c57d){return function(_0x518e0d){if(_0x518e0d){var _0xa16a9c=typeof _0x58c57d[_0x82c9('0x23')]===_0x82c9('0x24')&&typeof _0x58c57d[_0x82c9('0x25')]==='undefined';var _0x29ac81=_0x518e0d['count'];var _0x4298f3=_0xa16a9c?0x0:_0x58c57d[_0x82c9('0x23')];var _0x470861=_0xa16a9c?_0x518e0d[_0x82c9('0x26')]:_0x58c57d[_0x82c9('0x23')]+_0x58c57d['limit'];var _0x2197c7;if(_0x470861>=_0x29ac81){_0x470861=_0x29ac81;_0x2197c7=0xc8;}else{_0x2197c7=0xce;}_0x3433d0[_0x82c9('0x21')](_0x2197c7);return _0x3433d0[_0x82c9('0x27')](_0x82c9('0x28'),_0x4298f3+'-'+_0x470861+'/'+_0x29ac81)[_0x82c9('0x22')](_0x518e0d);}return null;};}function patchUpdates(_0x20acf7){return function(_0x502109){try{jsonpatch[_0x82c9('0x29')](_0x502109,_0x20acf7,!![]);}catch(_0x41c382){return BPromise[_0x82c9('0x2a')](_0x41c382);}return _0x502109['save']();};}function saveUpdates(_0x567f77,_0x2ccedc){return function(_0x5c6186){if(_0x5c6186){return _0x5c6186[_0x82c9('0x2b')](_0x567f77)[_0x82c9('0x2c')](function(_0x59bdd6){return _0x59bdd6;});}return null;};}function removeEntity(_0x206960,_0x31ae97){return function(_0x74c110){if(_0x74c110){return _0x74c110[_0x82c9('0x2d')]()[_0x82c9('0x2c')](function(){_0x206960['status'](0xcc)[_0x82c9('0x2e')]();});}};}function handleEntityNotFound(_0x4e04a6,_0x244e79){return function(_0x690f5f){if(!_0x690f5f){_0x4e04a6['sendStatus'](0x194);}return _0x690f5f;};}function handleError(_0xe096a7,_0x4acde8){_0x4acde8=_0x4acde8||0x1f4;return function(_0x4bcd12){logger[_0x82c9('0x2f')](_0x4bcd12[_0x82c9('0x30')]);if(_0x4bcd12[_0x82c9('0x31')]){delete _0x4bcd12[_0x82c9('0x31')];}_0xe096a7[_0x82c9('0x21')](_0x4acde8)[_0x82c9('0x32')](_0x4bcd12);};}function getInteractionUsers(_0x384462,_0x450bcf){return new BPromise(function(_0xba049d,_0x10b72e){try{if(_0x450bcf[_0x384462['id']]){_0x384462['Users']=_[_0x82c9('0x33')](_0x450bcf[_0x384462['id']],function(_0x54c1e1){return{'id':_0x54c1e1['id'],'fullname':_0x54c1e1['fullname']};});}}catch(_0x22649d){_0x10b72e(_0x22649d);}_0xba049d(_0x384462);});}function getInteractionTags(_0x533ae7,_0x2749c3){return new BPromise(function(_0x422735,_0x5e1716){try{if(_0x533ae7[_0x82c9('0x34')]){_0x533ae7['Tags']=[];_0x533ae7[_0x82c9('0x34')][_0x82c9('0x35')](',')['forEach'](function(_0x466054){_0x533ae7[_0x82c9('0x36')]['push'](_0x2749c3[_0x466054]);});}delete _0x533ae7[_0x82c9('0x34')];}catch(_0x1df9f1){_0x5e1716(_0x1df9f1);}_0x422735(_0x533ae7);});}function updateOpenchannelInteraction(_0x177e22,_0x413984,_0xc6cc2e){return new BPromise(function(_0x56e654,_0x31d1bb){return getInteractionUsers(_0x177e22,_0xc6cc2e)['then'](function(_0x288cfd){return getInteractionTags(_0x288cfd,_0x413984);})['then'](function(_0x3014c9){_0x56e654(_0x3014c9);})['catch'](function(_0x420b52){_0x31d1bb(_0x420b52);});});}exports[_0x82c9('0x37')]=function(_0x1c0476,_0x4212b4){var _0x33f2de={},_0x1ac8cb={},_0x21eabd={'count':0x0,'rows':[]};var _0x4a88bc=_['map'](db[_0x82c9('0x38')]['rawAttributes'],function(_0x18bd39){return{'name':_0x18bd39['fieldName'],'type':_0x18bd39[_0x82c9('0x39')]['key']};});_0x1ac8cb[_0x82c9('0x3a')]=_['map'](_0x4a88bc,'name');_0x1ac8cb['query']=_[_0x82c9('0x3b')](_0x1c0476[_0x82c9('0x3c')]);_0x1ac8cb['filters']=_[_0x82c9('0x3d')](_0x1ac8cb[_0x82c9('0x3a')],_0x1ac8cb[_0x82c9('0x3c')]);_0x33f2de['attributes']=_[_0x82c9('0x3d')](_0x1ac8cb[_0x82c9('0x3a')],qs[_0x82c9('0x3e')](_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x3e')]));_0x33f2de[_0x82c9('0x3f')]=_0x33f2de[_0x82c9('0x3f')][_0x82c9('0x40')]?_0x33f2de['attributes']:_0x1ac8cb[_0x82c9('0x3a')];if(!_0x1c0476[_0x82c9('0x3c')]['hasOwnProperty'](_0x82c9('0x41'))){_0x33f2de[_0x82c9('0x25')]=qs[_0x82c9('0x25')](_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x25')]);_0x33f2de[_0x82c9('0x23')]=qs[_0x82c9('0x23')](_0x1c0476[_0x82c9('0x3c')]['offset']);}_0x33f2de['order']=qs[_0x82c9('0x42')](_0x1c0476[_0x82c9('0x3c')]['sort']);_0x33f2de[_0x82c9('0x43')]=qs['filters'](_[_0x82c9('0x44')](_0x1c0476[_0x82c9('0x3c')],_0x1ac8cb['filters']),_0x4a88bc);var _0x57c3a7=[];var _0x4f4ddd=squel['select']()[_0x82c9('0x45')]('id')[_0x82c9('0x45')]('name')[_0x82c9('0x45')](_0x82c9('0x46'))[_0x82c9('0x47')](_0x82c9('0x48'));var _0x1cd52e=squel[_0x82c9('0x49')]()['field'](_0x82c9('0x4a'))[_0x82c9('0x45')](_0x82c9('0x4b'))[_0x82c9('0x45')](_0x82c9('0x4c'))[_0x82c9('0x47')](_0x82c9('0x4d'),'ui')[_0x82c9('0x4e')](_0x82c9('0x4f'),'u',_0x82c9('0x50'));var _0xfb2885=squel['select']()[_0x82c9('0x47')](_0x82c9('0x51'),'i')['left_join'](_0x82c9('0x52'),'c',_0x82c9('0x53'))[_0x82c9('0x4e')](_0x82c9('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x82c9('0x4e')](_0x82c9('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x82c9('0x4e')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x82c9('0x4e')](_0x82c9('0x55'),'it',_0x82c9('0x56'))[_0x82c9('0x4e')](_0x82c9('0x48'),'t','t.id\x20=\x20it.TagId');var _0xf2f5de=squel[_0x82c9('0x57')]();var _0x39e167=[];var _0x22c712=squel[_0x82c9('0x57')]();var _0x32b828;if(_0x1c0476['query'][_0x82c9('0x58')]){_0x32b828=as[_0x82c9('0x59')](_0x1c0476['query'][_0x82c9('0x58')]);var _0x1ee724=_0x32b828[_0x82c9('0x5a')];for(var _0x187161=0x0;_0x187161<_0x32b828['conditions'][_0x82c9('0x40')];_0x187161++){var _0x2a85e7=_0x32b828[_0x82c9('0x5b')][_0x187161];var _0x1ded47='i';var _0x189251=_['find'](_0x4a88bc,[_0x82c9('0x31'),_0x2a85e7[_0x82c9('0x45')]]);if(!_0x189251){switch(_0x2a85e7[_0x82c9('0x45')]){case _0x82c9('0x5c'):if(_0x2a85e7[_0x82c9('0x5d')]==0x1){_0xfb2885['having']('`'+_0x2a85e7[_0x82c9('0x45')]+'`\x20=\x200');}else{_0xfb2885[_0x82c9('0x5e')]('`'+_0x2a85e7['field']+'`\x20>\x200');}break;case _0x82c9('0x5f'):if(_0x2a85e7[_0x82c9('0x60')]===_0x82c9('0x61')){if(_0x2a85e7[_0x82c9('0x5d')][_0x82c9('0x35')]('\x20')[_0x82c9('0x40')]>0x1){_0xf2f5de[_0x1ee724](_0x82c9('0x62'),qs[_0x82c9('0x63')](_0x2a85e7['value']),null);}else{var _0x442ec8='%'+_0x2a85e7[_0x82c9('0x5d')]+'%';_0xf2f5de[_0x1ee724](_0x82c9('0x64'),_0x442ec8,_0x442ec8,_0x442ec8);}}else{_0x189251=_['find'](_0x4a88bc,['name',_0x82c9('0x65')]);_0x2a85e7[_0x82c9('0x45')]=_0x82c9('0x65');_0xcd90bd=as['buildExpression'](_0x1ded47,_0x189251['type'],_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x67')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x2e')]);}break;case _0x82c9('0x68'):var _0x4b1088=_0x2a85e7['value'][_0x82c9('0x35')](',')['map'](function(_0x5b06b2){return Number(_0x5b06b2);});_0x4b1088[_0x82c9('0x69')](function(_0x4ec9aa){_0x22c712['or'](_0x82c9('0x6a'),'%,'+_0x4ec9aa+',%');});_0x39e167=_['union'](_0x39e167,_0x4b1088);break;case _0x82c9('0x6b'):if(_0x2a85e7['operator']===_0x82c9('0x61')){_0xf2f5de[_0x1ee724](_0x82c9('0x6c'),'%'+_0x2a85e7[_0x82c9('0x5d')]+'%',null);}else{_0x189251=_[_0x82c9('0x6d')](_0x4a88bc,['name',_0x82c9('0x6e')]);_0x2a85e7[_0x82c9('0x45')]='UserId';_0xcd90bd=as[_0x82c9('0x6f')](_0x1ded47,_0x189251[_0x82c9('0x39')],_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd['value']['start'],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x2e')]);}break;case _0x82c9('0x70'):_0xcd90bd=as[_0x82c9('0x6f')]('me',null,_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd[_0x82c9('0x5d')]['start'],_0xcd90bd[_0x82c9('0x5d')]['end']);break;}}else{var _0xcd90bd=as[_0x82c9('0x6f')](_0x1ded47,_0x189251['type'],_0x2a85e7);_0xf2f5de[_0x1ee724](_0xcd90bd[_0x82c9('0x66')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x67')],_0xcd90bd[_0x82c9('0x5d')][_0x82c9('0x2e')]);}}}else{var _0x195997=_(_0x1c0476['query'])['keys']()[_0x82c9('0x33')](function(_0x44e5e7){return _[_0x82c9('0x71')](_0x4a88bc,['name',_0x44e5e7])?_0x44e5e7:undefined;})[_0x82c9('0x72')]()[_0x82c9('0x5d')]();if(!_['isEmpty'](_0x195997)){_0x195997[_0x82c9('0x69')](function(_0x2e092f){if(_0x2e092f==='OpenchannelAccountId'){_0xfb2885[_0x82c9('0x43')](_0x82c9('0x73'),[][_0x82c9('0x74')](_0x1c0476[_0x82c9('0x3c')][_0x2e092f]));}else if(_0x2e092f===_0x82c9('0x75')){var _0x19ff4e=JSON[_0x82c9('0x76')](_0x1c0476[_0x82c9('0x3c')][_0x2e092f])['$gte'];var _0x3d1a12=JSON[_0x82c9('0x76')](_0x1c0476[_0x82c9('0x3c')][_0x2e092f])[_0x82c9('0x77')];_0xfb2885[_0x82c9('0x43')](_0x82c9('0x78'),_0x19ff4e,_0x3d1a12);}else{if(_0x1c0476[_0x82c9('0x3c')][_0x2e092f]===_0x82c9('0x79')){_0xfb2885[_0x82c9('0x43')]('i.'+_0x2e092f+_0x82c9('0x7a'));}else{_0xfb2885[_0x82c9('0x43')]('i.'+_0x2e092f+_0x82c9('0x7b'),_0x1c0476[_0x82c9('0x3c')][_0x2e092f]);}}});}if(_0x1c0476[_0x82c9('0x3c')]['read']){if(_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x7c')]==0x1){_0xfb2885[_0x82c9('0x5e')]('`unreadMessages`\x20=\x200');}else{_0xfb2885['having'](_0x82c9('0x7d'));}}if(_0x1c0476['query'][_0x82c9('0x7e')]){_0x39e167=_['isArray'](_0x1c0476[_0x82c9('0x3c')]['tag'])?_0x1c0476['query']['tag']:new Array(_0x1c0476['query'][_0x82c9('0x7e')]);_0x39e167['forEach'](function(_0x3829ae){_0x22c712['or'](_0x82c9('0x6a'),'%,'+_0x3829ae+',%');});}if(_0x1c0476['query']['filter']){var _0x5bab33=_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x7f')][_0x82c9('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x82c9('0x81')](_0x5bab33)){_0xf2f5de['or'](_0x82c9('0x82'),_0x5bab33+'%');}else{_0xf2f5de['or'](_0x82c9('0x83'),qs['getFullTextValue'](_0x5bab33))['or'](_0x82c9('0x84'),_0x5bab33+'%')['or'](_0x82c9('0x85'),_0x5bab33+'%');}}}_0xfb2885[_0x82c9('0x43')](_0xf2f5de);_0xfb2885[_0x82c9('0x86')](_0x82c9('0x87'));var _0x396a4b={'type':db['Sequelize'][_0x82c9('0x88')]['SELECT'],'raw':!![]};var _0x322c34=_0xfb2885[_0x82c9('0x89')]();_0x322c34['field'](_0x82c9('0x87'));_0x322c34[_0x82c9('0x45')](_0x82c9('0x8a'),_0x82c9('0x5c'));if(_0x33f2de[_0x82c9('0x8b')]){_0x33f2de['order']['forEach'](function(_0x6459a1){var _0x2131f5=_0x6459a1[0x0]===_0x82c9('0x8c')?_0x6459a1[0x0]:'i.'+_0x6459a1[0x0];_0xfb2885[_0x82c9('0x8b')](_0x2131f5,_0x6459a1[0x1]===_0x82c9('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x39e167)){_0xfb2885[_0x82c9('0x5e')](_0x22c712);_0x322c34[_0x82c9('0x43')](_0x82c9('0x8e'),_0x39e167);}BPromise[_0x82c9('0x8f')]()[_0x82c9('0x2c')](function(){if(!_0x32b828){if(_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x90')])return;_0x322c34[_0x82c9('0x43')](_0x82c9('0x91'));_0xfb2885['where'](_0x82c9('0x91'));return;}if(_0x1c0476['user'][_0x82c9('0x92')]!==_0x82c9('0x93'))return;return _0x1c0476[_0x82c9('0x94')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x521d81){if(_[_0x82c9('0x95')](_0x521d81)){_0x322c34[_0x82c9('0x43')](_0x82c9('0x96'));_0xfb2885['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x322c34[_0x82c9('0x43')](_0x82c9('0x73'),_[_0x82c9('0x33')](_0x521d81,'id'));_0xfb2885[_0x82c9('0x43')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x521d81,'id'));}});})[_0x82c9('0x2c')](function(){if(_0x1c0476[_0x82c9('0x94')]['role']===_0x82c9('0x93')&&!_0x32b828&&!_0x1c0476[_0x82c9('0x3c')]['OpenchannelAccountId'])return[];return db[_0x82c9('0x97')][_0x82c9('0x3c')](_0x322c34[_0x82c9('0x98')](),_0x396a4b);})['then'](function(_0x361162){_0x21eabd['count']=_0x361162[_0x82c9('0x40')];if(_0x21eabd[_0x82c9('0x26')]===0x0)return[];return db[_0x82c9('0x97')][_0x82c9('0x3c')](_0x4f4ddd[_0x82c9('0x98')](),_0x396a4b)[_0x82c9('0x2c')](function(_0x174d04){_0x57c3a7=_[_0x82c9('0x99')](_0x174d04,'id');_0x396a4b=_[_0x82c9('0x9a')](_0x396a4b,{'model':db[_0x82c9('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c0476[_0x82c9('0x3c')][_0x82c9('0x3e')]){_0x33f2de[_0x82c9('0x3f')][_0x82c9('0x69')](function(_0x3b30cd){_0xfb2885[_0x82c9('0x45')]('i.'+_0x3b30cd);});}else{_0xfb2885[_0x82c9('0x45')](_0x82c9('0x8a'),'unreadMessages');_0xfb2885[_0x82c9('0x45')](_0x82c9('0x9b'),_0x82c9('0x9c'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0x9d'),_0x82c9('0x9e'));_0xfb2885['field'](_0x82c9('0x9f'),_0x82c9('0x8c'));_0xfb2885[_0x82c9('0x45')]('i.*');_0xfb2885['field'](_0x82c9('0xa0'),_0x82c9('0xa1'));_0xfb2885[_0x82c9('0x45')]('c.lastName',_0x82c9('0xa2'));_0xfb2885['field']('c.email',_0x82c9('0xa3'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa4'),'Contact.phone');_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa5'),'Contact.mobile');_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa6'),'Contact.fax');_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa7'),_0x82c9('0xa8'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0xa9'),_0x82c9('0xaa'));_0xfb2885[_0x82c9('0x45')](_0x82c9('0xab'),_0x82c9('0x34'));}if(_0x33f2de[_0x82c9('0x25')])_0xfb2885['limit'](_0x33f2de['limit']);if(_0x33f2de['offset'])_0xfb2885[_0x82c9('0x23')](_0x33f2de[_0x82c9('0x23')]);return db[_0x82c9('0x97')][_0x82c9('0x3c')](_0xfb2885[_0x82c9('0x98')](),_0x396a4b);})[_0x82c9('0x2c')](function(_0xdb3aa2){if(_0xdb3aa2['length']>0x0)_0x1cd52e[_0x82c9('0x43')](_0x82c9('0xac'),_[_0x82c9('0x33')](_0xdb3aa2,'id'));return db['sequelize']['query'](_0x1cd52e[_0x82c9('0x98')](),_0x396a4b)[_0x82c9('0x2c')](function(_0x56ffce){var _0x2f4b9a=_[_0x82c9('0xad')](_0x56ffce,'OpenchannelInteractionId');var _0x31d8bc=[];_0xdb3aa2[_0x82c9('0x69')](function(_0x558b16){_0x31d8bc[_0x82c9('0xae')](updateOpenchannelInteraction(_0x558b16,_0x57c3a7,_0x2f4b9a));});return BPromise[_0x82c9('0xaf')](_0x31d8bc);});});})[_0x82c9('0x2c')](function(_0x2ea5c5){_0x21eabd['rows']=_0x2ea5c5;return _0x21eabd;})[_0x82c9('0x2c')](respondWithFilteredResult(_0x4212b4,_0x33f2de))[_0x82c9('0xb0')](handleError(_0x4212b4,null));};exports['show']=function(_0x59f8d8,_0xa80792){var _0x595986={};if(_0x59f8d8['query']['type']&&_0x59f8d8[_0x82c9('0x3c')][_0x82c9('0x39')]===_0x82c9('0x47')){_0x595986[_0x82c9('0x47')]=_0x59f8d8[_0x82c9('0xb1')]['id'];}else{_0x595986['id']=_0x59f8d8[_0x82c9('0xb1')]['id'];}var _0x3dccf8={'raw':![],'where':_0x595986},_0x565cf2={};_0x565cf2[_0x82c9('0x3a')]=_['keys'](db[_0x82c9('0x38')]['rawAttributes']);_0x565cf2[_0x82c9('0x3c')]=_[_0x82c9('0x3b')](_0x59f8d8['query']);_0x565cf2[_0x82c9('0xb2')]=_[_0x82c9('0x3d')](_0x565cf2[_0x82c9('0x3a')],_0x565cf2[_0x82c9('0x3c')]);_0x3dccf8[_0x82c9('0x3f')]=_[_0x82c9('0x3d')](_0x565cf2[_0x82c9('0x3a')],qs[_0x82c9('0x3e')](_0x59f8d8['query'][_0x82c9('0x3e')]));_0x3dccf8['attributes']=_0x3dccf8[_0x82c9('0x3f')][_0x82c9('0x40')]?_0x3dccf8['attributes']:_0x565cf2[_0x82c9('0x3a')];if(_0x59f8d8[_0x82c9('0x3c')][_0x82c9('0xb3')]){_0x3dccf8[_0x82c9('0xb4')]=[{'all':!![]}];}_0x3dccf8=_[_0x82c9('0x9a')]({},_0x3dccf8,_0x59f8d8[_0x82c9('0xb5')]);return db['OpenchannelInteraction'][_0x82c9('0x6d')](_0x3dccf8)[_0x82c9('0x2c')](handleEntityNotFound(_0xa80792,null))['then'](respondWithResult(_0xa80792,null))['catch'](handleError(_0xa80792,null));};exports[_0x82c9('0xb6')]=function(_0x56a23f,_0xd5be95){return db[_0x82c9('0x38')][_0x82c9('0xb6')](_0x56a23f[_0x82c9('0x70')],{})['then'](respondWithResult(_0xd5be95,0xc9))['catch'](handleError(_0xd5be95,null));};exports[_0x82c9('0x2b')]=function(_0x51d2ad,_0x43a255){if(_0x51d2ad[_0x82c9('0x70')]['id']){delete _0x51d2ad[_0x82c9('0x70')]['id'];}return db[_0x82c9('0x38')][_0x82c9('0x6d')]({'where':{'id':_0x51d2ad[_0x82c9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x43a255,null))[_0x82c9('0x2c')](saveUpdates(_0x51d2ad[_0x82c9('0x70')],null))[_0x82c9('0x2c')](respondWithResult(_0x43a255,null))[_0x82c9('0xb0')](handleError(_0x43a255,null));};exports[_0x82c9('0x2d')]=function(_0xfbb307,_0x25433a){return db['OpenchannelInteraction'][_0x82c9('0x6d')]({'where':{'id':_0xfbb307['params']['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x25433a,null))[_0x82c9('0x2c')](removeEntity(_0x25433a,null))[_0x82c9('0xb0')](handleError(_0x25433a,null));};exports[_0x82c9('0xb7')]=function(_0x475e04,_0x482b58){return db[_0x82c9('0x38')][_0x82c9('0xb7')]()[_0x82c9('0x2c')](respondWithResult(_0x482b58,null))[_0x82c9('0xb0')](handleError(_0x482b58,null));};exports[_0x82c9('0xb8')]=function(_0x762928,_0x40d60a,_0x12c613){return db['OpenchannelMessage']['find']({'where':{'id':_0x762928[_0x82c9('0xb1')]['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x40d60a,null))[_0x82c9('0x2c')](function(_0x598fe2){if(_0x598fe2){return _0x598fe2[_0x82c9('0xb8')](_0x762928[_0x82c9('0x70')]['ids'],_[_0x82c9('0xb9')](_0x762928[_0x82c9('0x70')],[_0x82c9('0xba'),'id'])||{});}})[_0x82c9('0x2c')](respondWithResult(_0x40d60a,null))[_0x82c9('0xb0')](handleError(_0x40d60a,null));};exports[_0x82c9('0xbb')]=function(_0x2609b1,_0x52b8a8,_0x3567aa){var _0x441d7e={'raw':![],'where':{}};var _0x273766={};var _0x51f31e={'count':0x0,'rows':[]};return db[_0x82c9('0x38')]['findOne']({'where':{'id':_0x2609b1[_0x82c9('0xb1')]['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x52b8a8,null))[_0x82c9('0x2c')](function(_0x112a9a){if(_0x112a9a){_0x273766[_0x82c9('0x3a')]=_['keys'](db['OpenchannelMessage'][_0x82c9('0xbc')]);_0x273766[_0x82c9('0x3c')]=_[_0x82c9('0x3b')](_0x2609b1[_0x82c9('0x3c')]);_0x273766['filters']=_[_0x82c9('0x3d')](_0x273766[_0x82c9('0x3a')],_0x273766[_0x82c9('0x3c')]);_0x441d7e[_0x82c9('0x3f')]=_['intersection'](_0x273766[_0x82c9('0x3a')],qs[_0x82c9('0x3e')](_0x2609b1[_0x82c9('0x3c')][_0x82c9('0x3e')]));_0x441d7e[_0x82c9('0x3f')]=_0x441d7e[_0x82c9('0x3f')]['length']?_0x441d7e[_0x82c9('0x3f')]:_0x273766[_0x82c9('0x3a')];if(!_0x2609b1[_0x82c9('0x3c')][_0x82c9('0xbd')]('nolimit')){_0x441d7e['limit']=qs[_0x82c9('0x25')](_0x2609b1['query'][_0x82c9('0x25')]);_0x441d7e[_0x82c9('0x23')]=qs[_0x82c9('0x23')](_0x2609b1[_0x82c9('0x3c')]['offset']);}_0x441d7e[_0x82c9('0x8b')]=qs['sort'](_0x2609b1[_0x82c9('0x3c')][_0x82c9('0x42')]);_0x441d7e[_0x82c9('0x43')]=qs['filters'](_['pick'](_0x2609b1[_0x82c9('0x3c')],_0x273766['filters']));_0x441d7e[_0x82c9('0x43')][_0x82c9('0xbe')]=_0x112a9a['id'];if(_0x2609b1[_0x82c9('0x3c')]['filter']){_0x441d7e[_0x82c9('0x43')]=_[_0x82c9('0x9a')](_0x441d7e['where'],{'$or':_[_0x82c9('0x33')](_0x441d7e[_0x82c9('0x3f')],function(_0x498cb5){var _0x2abd30={};_0x2abd30[_0x498cb5]={'$like':'%'+_0x2609b1['query']['filter']+'%'};return _0x2abd30;})});}if(_0x2609b1[_0x82c9('0x3c')][_0x82c9('0xbf')]){var _0x35a61f=_0x2609b1['query'][_0x82c9('0xbf')]['split'](',');var _0x211985={};_0x211985[_0x35a61f[0x0]]={'$gte':moment(_0x35a61f[0x1])[_0x82c9('0xc0')](_0x82c9('0xc1'))};_0x441d7e[_0x82c9('0x43')]=_[_0x82c9('0x9a')](_0x441d7e['where'],_0x211985);}_0x441d7e=_[_0x82c9('0x9a')]({},_0x441d7e,_0x2609b1[_0x82c9('0xb5')]);return db[_0x82c9('0xc2')][_0x82c9('0x26')]({'where':_0x441d7e['where']})[_0x82c9('0x2c')](function(_0x33bf1){_0x51f31e['count']=_0x33bf1;if(_0x2609b1[_0x82c9('0x3c')][_0x82c9('0xb3')]){_0x441d7e[_0x82c9('0xb4')]=[{'all':!![]}];}return db[_0x82c9('0xc2')]['findAll'](_0x441d7e);})[_0x82c9('0x2c')](function(_0x171976){_0x51f31e[_0x82c9('0xc3')]=_0x171976;return _0x51f31e;});}})[_0x82c9('0x2c')](respondWithFilteredResult(_0x52b8a8,_0x441d7e))[_0x82c9('0xb0')](handleError(_0x52b8a8,null));};exports['addTags']=function(_0x1f6cfb,_0x44c560,_0x28c2e4){return db['OpenchannelInteraction'][_0x82c9('0x6d')]({'where':{'id':_0x1f6cfb[_0x82c9('0xb1')]['id']}})['then'](handleEntityNotFound(_0x44c560,null))['then'](function(_0x6283f4){if(_0x6283f4){return _0x6283f4[_0x82c9('0xc4')](_0x1f6cfb[_0x82c9('0x70')]['ids'],_[_0x82c9('0xb9')](_0x1f6cfb[_0x82c9('0x70')],['ids','id'])||{})[_0x82c9('0xc5')](function(){return db[_0x82c9('0x68')]['findAll']({'attributes':['id',_0x82c9('0x31'),_0x82c9('0x46')],'where':{'id':_0x1f6cfb[_0x82c9('0x70')][_0x82c9('0xba')]}});})[_0x82c9('0x2c')](function(_0x359025){socket[_0x82c9('0xc6')](_0x82c9('0xc7'),{'id':Number(_0x1f6cfb[_0x82c9('0xb1')]['id']),'tags':_0x359025||[]});return{'id':Number(_0x1f6cfb['params']['id']),'tags':_0x359025||[]};});}})[_0x82c9('0x2c')](respondWithResult(_0x44c560,null))[_0x82c9('0xb0')](handleError(_0x44c560,null));};exports[_0x82c9('0xc8')]=function(_0x71ac70,_0x5e05ee,_0x1295d2){return db[_0x82c9('0x38')][_0x82c9('0x6d')]({'where':{'id':_0x71ac70['params']['id']}})[_0x82c9('0x2c')](handleEntityNotFound(_0x5e05ee,null))['then'](function(_0x591582){if(_0x591582){return _0x591582['removeTags'](_0x71ac70[_0x82c9('0x3c')]['ids']);}})[_0x82c9('0x2c')](respondWithStatusCode(_0x5e05ee,null))[_0x82c9('0xb0')](handleError(_0x5e05ee,null));};exports[_0x82c9('0xc9')]=function(_0x42b9dd,_0x464f58){var _0x58f214=moment()[_0x82c9('0xca')]()['toString']();var _0x5d09e4=path['join'](config['root'],_0x82c9('0xcb'),'files','tmp');var _0x187f97=path[_0x82c9('0xcc')](config[_0x82c9('0xcd')],_0x82c9('0xcb'),_0x82c9('0xce'),_0x82c9('0xcf'));var _0x1c1f39=path['join'](_0x5d09e4,_0x58f214);var _0x46486a=util[_0x82c9('0xc0')]('transcript-%d-%s.zip',_0x42b9dd[_0x82c9('0xb1')]['id'],_0x58f214);var _0x515a80=path[_0x82c9('0xcc')](_0x5d09e4,_0x46486a);var _0x3b880c=[];_0x3b880c[_0x82c9('0xae')]({'model':db[_0x82c9('0x6b')],'as':_0x82c9('0x6b'),'attributes':['id',_0x82c9('0xd0')],'raw':!![]});_0x3b880c[_0x82c9('0xae')]({'model':db['CmContact'],'as':_0x82c9('0x5f'),'attributes':['id',_0x82c9('0xd1'),_0x82c9('0xd2')],'raw':!![]});if(_0x42b9dd['query']['attachments']){_0x3b880c[_0x82c9('0xae')]({'model':db[_0x82c9('0xd3')],'as':_0x82c9('0xd3'),'raw':!![]});}var _0x3a3fd9=[{'model':db['OpenchannelMessage'],'as':_0x82c9('0xd4'),'attributes':['id',_0x82c9('0x70'),'createdAt',_0x82c9('0xd5'),_0x82c9('0xd6'),_0x82c9('0x7c')],'include':_0x3b880c}];_0x3a3fd9['push']({'model':db['OpenchannelAccount'],'as':_0x82c9('0xd7'),'attributes':['id','name']});_0x3a3fd9['push']({'model':db[_0x82c9('0x6b')],'as':'Owner','attributes':['id',_0x82c9('0xd0')]});return db[_0x82c9('0x38')][_0x82c9('0x6d')]({'where':{'id':_0x42b9dd[_0x82c9('0xb1')]['id']},'include':_0x3a3fd9})[_0x82c9('0x2c')](handleEntityNotFound(_0x464f58,null))['then'](function(_0x393489){if(_0x393489){var _0x10381a=_0x393489[_0x82c9('0xd8')]({'plain':!![]});fs['mkdirSync'](_0x1c1f39);var _0x5f4644={'channel':_0x82c9('0xd9'),'account':_0x10381a['Account']['name'],'agent':_0x10381a[_0x82c9('0xda')]?_0x10381a[_0x82c9('0xda')]['fullname']:_0x82c9('0xdb'),'createdAt':moment(_0x10381a[_0x82c9('0x75')])[_0x82c9('0xc0')](_0x82c9('0xc1'))[_0x82c9('0x98')](),'closedAt':_0x10381a['closed']?moment(_0x10381a[_0x82c9('0xdc')])[_0x82c9('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x10381a[_0x82c9('0xdd')],'visibility':_0x10381a[_0x82c9('0xde')]?'Public':_0x82c9('0xdf'),'messages':_(_0x10381a['Messages'])[_0x82c9('0x7f')]({'secret':![]})[_0x82c9('0x33')](function(_0x3d7f8a){if(_0x3d7f8a[_0x82c9('0xd3')]){var _0xc225df=path['join'](_0x187f97,_0x3d7f8a[_0x82c9('0xd3')][_0x82c9('0xe0')]);if(fs[_0x82c9('0xe1')](_0xc225df)){fs[_0x82c9('0xe2')](_0xc225df)['pipe'](fs[_0x82c9('0xe3')](path[_0x82c9('0xcc')](_0x1c1f39,_0x3d7f8a[_0x82c9('0xd3')]['basename'])));}}return{'date':moment(_0x3d7f8a[_0x82c9('0x75')])[_0x82c9('0xc0')](_0x82c9('0xc1'))[_0x82c9('0x98')](),'sender':_0x3d7f8a[_0x82c9('0xd5')]===_0x82c9('0xe4')?_0x3d7f8a[_0x82c9('0x6b')]?_0x3d7f8a[_0x82c9('0x6b')]['fullname']:_0x82c9('0xe5'):_0x3d7f8a[_0x82c9('0x5f')]['firstName']+(_0x3d7f8a[_0x82c9('0x5f')][_0x82c9('0xd2')]?'\x20'+_0x3d7f8a['Contact']['lastName']:''),'body':_0x3d7f8a[_0x82c9('0xd3')]?_0x3d7f8a[_0x82c9('0xd3')][_0x82c9('0xe0')]:_0x3d7f8a[_0x82c9('0x70')],'direction':_0x3d7f8a['direction']===_0x82c9('0xe4')?'A':'C','secret':_0x3d7f8a[_0x82c9('0xd6')],'read':_0x3d7f8a[_0x82c9('0x7c')],'attachment':_0x3d7f8a[_0x82c9('0xd3')]};})[_0x82c9('0x5d')]()};return ejs[_0x82c9('0xe6')](path[_0x82c9('0xcc')](config['root'],_0x82c9('0xcb'),'views',_0x82c9('0xe7')),{'interaction':_0x5f4644})['then'](function(_0x19ff7d){var _0x3e8b36=path['join'](_0x1c1f39,_0x82c9('0xe8')+_0x10381a['id']+'-'+_0x58f214+_0x82c9('0xe9'));var _0x40a51c={'path':_0x3e8b36,'channel':_0x82c9('0xd9'),'interactionId':_0x10381a['id']};return pdf[_0x82c9('0xea')](_0x19ff7d,_0x40a51c);})[_0x82c9('0x2c')](function(){return new BPromise(function(_0x4a5e86,_0x479688){zipdir(_0x1c1f39,{'saveTo':_0x515a80},function(_0x3a1a21,_0x469ca5){if(_0x3a1a21)return _0x479688(_0x3a1a21);return _0x4a5e86(_0x469ca5);});})[_0x82c9('0x2c')](function(){return new BPromise(function(_0x13e46f,_0x1cecc3){rimraf(_0x1c1f39,function(_0x159611){if(_0x159611)_0x1cecc3(_0x159611);return _0x13e46f();});});})['then'](function(){return _0x464f58['download'](_0x515a80,_0x46486a,function(_0xd2dba4){if(_0xd2dba4){console[_0x82c9('0xeb')](_0x82c9('0xec'),_0xd2dba4);}else{fs[_0x82c9('0xed')](_0x515a80);}});});});}else{return _0x464f58[_0x82c9('0x20')](0xc8);}})[_0x82c9('0xb0')](handleError(_0x464f58,null));}; \ No newline at end of file +var _0x1127=['threadId','Private','Messages','existsSync','createReadStream','createWriteStream','basename','out','System','firstName','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','length','find','`\x20=\x200','having','`\x20>\x200','operator','$substring','getFullTextValue','value','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','body','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','replace','isNumeric','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','show','params','OpenchannelInteraction','include','merge','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','filter','format','options','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Contact','Attachment','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition'];(function(_0x49e2f4,_0x10ad67){var _0x361887=function(_0x5365a6){while(--_0x5365a6){_0x49e2f4['push'](_0x49e2f4['shift']());}};_0x361887(++_0x10ad67);}(_0x1127,0xff));var _0x7112=function(_0x5bdf8e,_0x45d970){_0x5bdf8e=_0x5bdf8e-0x0;var _0x3e0750=_0x1127[_0x5bdf8e];return _0x3e0750;};'use strict';var emlformat=require(_0x7112('0x0'));var rimraf=require(_0x7112('0x1'));var zipdir=require(_0x7112('0x2'));var jsonpatch=require(_0x7112('0x3'));var rp=require('request-promise');var moment=require(_0x7112('0x4'));var BPromise=require(_0x7112('0x5'));var Mustache=require('mustache');var util=require(_0x7112('0x6'));var path=require('path');var sox=require(_0x7112('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7112('0x8'));var _=require(_0x7112('0x9'));var squel=require(_0x7112('0xa'));var crypto=require(_0x7112('0xb'));var jsforce=require(_0x7112('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7112('0xd'));var Papa=require(_0x7112('0xe'));var Redis=require(_0x7112('0xf'));var authService=require(_0x7112('0x10'));var qs=require(_0x7112('0x11'));var as=require(_0x7112('0x12'));var pdf=require(_0x7112('0x13'));var hardwareService=require(_0x7112('0x14'));var logger=require('../../config/logger')(_0x7112('0x15'));var utils=require('../../config/utils');var config=require(_0x7112('0x16'));var licenseUtil=require(_0x7112('0x17'));var db=require(_0x7112('0x18'))['db'];config['redis']=_['defaults'](config[_0x7112('0x19')],{'host':_0x7112('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7112('0x19')]));require(_0x7112('0x1b'))[_0x7112('0x1c')](socket);function respondWithStatusCode(_0x3cd860,_0x176f7b){_0x176f7b=_0x176f7b||0xcc;return function(_0x33382a){if(_0x33382a){return _0x3cd860[_0x7112('0x1d')](_0x176f7b);}return _0x3cd860[_0x7112('0x1e')](_0x176f7b)[_0x7112('0x1f')]();};}function respondWithResult(_0x21b733,_0x817216){_0x817216=_0x817216||0xc8;return function(_0x1b0879){if(_0x1b0879){return _0x21b733[_0x7112('0x1e')](_0x817216)['json'](_0x1b0879);}};}function respondWithFilteredResult(_0xc957bc,_0x495804){return function(_0x1ae416){if(_0x1ae416){var _0x21a314=typeof _0x495804[_0x7112('0x20')]===_0x7112('0x21')&&typeof _0x495804[_0x7112('0x22')]===_0x7112('0x21');var _0x1fe148=_0x1ae416['count'];var _0x197ba3=_0x21a314?0x0:_0x495804[_0x7112('0x20')];var _0x1fd1d6=_0x21a314?_0x1ae416[_0x7112('0x23')]:_0x495804[_0x7112('0x20')]+_0x495804[_0x7112('0x22')];var _0x1f38ae;if(_0x1fd1d6>=_0x1fe148){_0x1fd1d6=_0x1fe148;_0x1f38ae=0xc8;}else{_0x1f38ae=0xce;}_0xc957bc[_0x7112('0x1e')](_0x1f38ae);return _0xc957bc[_0x7112('0x24')]('Content-Range',_0x197ba3+'-'+_0x1fd1d6+'/'+_0x1fe148)[_0x7112('0x25')](_0x1ae416);}return null;};}function patchUpdates(_0x1235c6){return function(_0x1a9775){try{jsonpatch[_0x7112('0x26')](_0x1a9775,_0x1235c6,!![]);}catch(_0x3a6097){return BPromise[_0x7112('0x27')](_0x3a6097);}return _0x1a9775[_0x7112('0x28')]();};}function saveUpdates(_0x19dd0c,_0x2cd0b7){return function(_0x33d3f2){if(_0x33d3f2){return _0x33d3f2[_0x7112('0x29')](_0x19dd0c)[_0x7112('0x2a')](function(_0x2ba9d3){return _0x2ba9d3;});}return null;};}function removeEntity(_0x54e1f7,_0x15cee4){return function(_0x3b7c3f){if(_0x3b7c3f){return _0x3b7c3f[_0x7112('0x2b')]()[_0x7112('0x2a')](function(){_0x54e1f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x176ace,_0x1e81a1){return function(_0xf06fa7){if(!_0xf06fa7){_0x176ace[_0x7112('0x1d')](0x194);}return _0xf06fa7;};}function handleError(_0x2415c5,_0x51f6f0){_0x51f6f0=_0x51f6f0||0x1f4;return function(_0x260084){logger['error'](_0x260084[_0x7112('0x2c')]);if(_0x260084[_0x7112('0x2d')]){delete _0x260084['name'];}_0x2415c5[_0x7112('0x1e')](_0x51f6f0)[_0x7112('0x2e')](_0x260084);};}function getInteractionUsers(_0x473c9f,_0x170c5e){return new BPromise(function(_0x549e8e,_0x5946df){try{if(_0x170c5e[_0x473c9f['id']]){_0x473c9f[_0x7112('0x2f')]=_[_0x7112('0x30')](_0x170c5e[_0x473c9f['id']],function(_0x28d78e){return{'id':_0x28d78e['id'],'fullname':_0x28d78e[_0x7112('0x31')]};});}}catch(_0x3b0ce6){_0x5946df(_0x3b0ce6);}_0x549e8e(_0x473c9f);});}function getInteractionTags(_0x140a90,_0x5df64d){return new BPromise(function(_0x1c856d,_0xd570da){try{if(_0x140a90[_0x7112('0x32')]){_0x140a90[_0x7112('0x33')]=[];_0x140a90['TagIds'][_0x7112('0x34')](',')[_0x7112('0x35')](function(_0x274cb5){_0x140a90['Tags'][_0x7112('0x36')](_0x5df64d[_0x274cb5]);});}delete _0x140a90[_0x7112('0x32')];}catch(_0x38ab8b){_0xd570da(_0x38ab8b);}_0x1c856d(_0x140a90);});}function updateOpenchannelInteraction(_0x22bfd5,_0x21929c,_0x5d377e){return new BPromise(function(_0x27dbce,_0x50f526){return getInteractionUsers(_0x22bfd5,_0x5d377e)['then'](function(_0x1ef3ca){return getInteractionTags(_0x1ef3ca,_0x21929c);})['then'](function(_0x18cd33){_0x27dbce(_0x18cd33);})[_0x7112('0x37')](function(_0x3c8e76){_0x50f526(_0x3c8e76);});});}exports[_0x7112('0x38')]=function(_0x1a1be7,_0x4a61b3){var _0x519cd4={},_0x197a98={},_0x526c66={'count':0x0,'rows':[]};var _0x569c03=_[_0x7112('0x30')](db['OpenchannelInteraction'][_0x7112('0x39')],function(_0xb402aa){return{'name':_0xb402aa['fieldName'],'type':_0xb402aa['type'][_0x7112('0x3a')]};});_0x197a98[_0x7112('0x3b')]=_[_0x7112('0x30')](_0x569c03,'name');_0x197a98['query']=_[_0x7112('0x3c')](_0x1a1be7[_0x7112('0x3d')]);_0x197a98[_0x7112('0x3e')]=_[_0x7112('0x3f')](_0x197a98[_0x7112('0x3b')],_0x197a98[_0x7112('0x3d')]);_0x519cd4['attributes']=_[_0x7112('0x3f')](_0x197a98[_0x7112('0x3b')],qs[_0x7112('0x40')](_0x1a1be7[_0x7112('0x3d')]['fields']));_0x519cd4[_0x7112('0x41')]=_0x519cd4[_0x7112('0x41')]['length']?_0x519cd4[_0x7112('0x41')]:_0x197a98[_0x7112('0x3b')];if(!_0x1a1be7[_0x7112('0x3d')][_0x7112('0x42')](_0x7112('0x43'))){_0x519cd4[_0x7112('0x22')]=qs[_0x7112('0x22')](_0x1a1be7[_0x7112('0x3d')]['limit']);_0x519cd4['offset']=qs[_0x7112('0x20')](_0x1a1be7[_0x7112('0x3d')][_0x7112('0x20')]);}_0x519cd4[_0x7112('0x44')]=qs[_0x7112('0x45')](_0x1a1be7[_0x7112('0x3d')][_0x7112('0x45')]);_0x519cd4[_0x7112('0x46')]=qs[_0x7112('0x3e')](_[_0x7112('0x47')](_0x1a1be7[_0x7112('0x3d')],_0x197a98[_0x7112('0x3e')]),_0x569c03);var _0x5b1b77=[];var _0x5084ed=squel['select']()[_0x7112('0x48')]('id')[_0x7112('0x48')]('name')[_0x7112('0x48')]('color')[_0x7112('0x49')](_0x7112('0x4a'));var _0x13e47f=squel[_0x7112('0x4b')]()[_0x7112('0x48')](_0x7112('0x4c'))[_0x7112('0x48')](_0x7112('0x4d'))[_0x7112('0x48')]('ui.OpenchannelInteractionId')[_0x7112('0x49')]('user_has_openchannel_interactions','ui')[_0x7112('0x4e')](_0x7112('0x4f'),'u',_0x7112('0x50'));var _0x5616f3=squel['select']()['from'](_0x7112('0x51'),'i')[_0x7112('0x4e')](_0x7112('0x52'),'c',_0x7112('0x53'))[_0x7112('0x4e')](_0x7112('0x4f'),'o',_0x7112('0x54'))[_0x7112('0x4e')](_0x7112('0x55'),'a',_0x7112('0x56'))[_0x7112('0x4e')](_0x7112('0x57'),'me',_0x7112('0x58'))[_0x7112('0x4e')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x7112('0x4e')](_0x7112('0x4a'),'t',_0x7112('0x59'));var _0x49a9e7=squel[_0x7112('0x5a')]();var _0x3496ea=[];var _0x17f1fe=squel[_0x7112('0x5a')]();var _0x227f2e;if(_0x1a1be7[_0x7112('0x3d')][_0x7112('0x5b')]){_0x227f2e=as['parseSearch'](_0x1a1be7['query'][_0x7112('0x5b')]);var _0x430d26=_0x227f2e[_0x7112('0x5c')];for(var _0x3b3fdc=0x0;_0x3b3fdc<_0x227f2e['conditions'][_0x7112('0x5d')];_0x3b3fdc++){var _0x1491cf=_0x227f2e['conditions'][_0x3b3fdc];var _0xe4fcf8='i';var _0x3039a5=_[_0x7112('0x5e')](_0x569c03,[_0x7112('0x2d'),_0x1491cf[_0x7112('0x48')]]);if(!_0x3039a5){switch(_0x1491cf[_0x7112('0x48')]){case'unreadMessages':if(_0x1491cf['value']==0x1){_0x5616f3['having']('`'+_0x1491cf[_0x7112('0x48')]+_0x7112('0x5f'));}else{_0x5616f3[_0x7112('0x60')]('`'+_0x1491cf['field']+_0x7112('0x61'));}break;case'Contact':if(_0x1491cf[_0x7112('0x62')]===_0x7112('0x63')){if(_0x1491cf['value'][_0x7112('0x34')]('\x20')[_0x7112('0x5d')]>0x1){_0x49a9e7[_0x430d26]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7112('0x64')](_0x1491cf[_0x7112('0x65')]),null);}else{var _0x329b6b='%'+_0x1491cf[_0x7112('0x65')]+'%';_0x49a9e7[_0x430d26]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x329b6b,_0x329b6b,_0x329b6b);}}else{_0x3039a5=_[_0x7112('0x5e')](_0x569c03,[_0x7112('0x2d'),'ContactId']);_0x1491cf['field']=_0x7112('0x66');_0x3c697c=as[_0x7112('0x67')](_0xe4fcf8,_0x3039a5[_0x7112('0x68')],_0x1491cf);_0x49a9e7[_0x430d26](_0x3c697c[_0x7112('0x69')],_0x3c697c[_0x7112('0x65')][_0x7112('0x6a')],_0x3c697c[_0x7112('0x65')][_0x7112('0x1f')]);}break;case _0x7112('0x6b'):var _0x20126c=_0x1491cf['value'][_0x7112('0x34')](',')['map'](function(_0x327b33){return Number(_0x327b33);});_0x20126c[_0x7112('0x35')](function(_0x3d2e9e){_0x17f1fe['or'](_0x7112('0x6c'),'%,'+_0x3d2e9e+',%');});_0x3496ea=_['union'](_0x3496ea,_0x20126c);break;case _0x7112('0x6d'):if(_0x1491cf['operator']==='$substring'){_0x49a9e7[_0x430d26]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1491cf['value']+'%',null);}else{_0x3039a5=_[_0x7112('0x5e')](_0x569c03,[_0x7112('0x2d'),_0x7112('0x6e')]);_0x1491cf['field']='UserId';_0x3c697c=as[_0x7112('0x67')](_0xe4fcf8,_0x3039a5['type'],_0x1491cf);_0x49a9e7[_0x430d26](_0x3c697c['text'],_0x3c697c['value'][_0x7112('0x6a')],_0x3c697c[_0x7112('0x65')][_0x7112('0x1f')]);}break;case _0x7112('0x6f'):_0x3c697c=as[_0x7112('0x67')]('me',null,_0x1491cf);_0x49a9e7[_0x430d26](_0x3c697c[_0x7112('0x69')],_0x3c697c[_0x7112('0x65')][_0x7112('0x6a')],_0x3c697c['value'][_0x7112('0x1f')]);break;}}else{var _0x3c697c=as['buildExpression'](_0xe4fcf8,_0x3039a5[_0x7112('0x68')],_0x1491cf);_0x49a9e7[_0x430d26](_0x3c697c['text'],_0x3c697c['value'][_0x7112('0x6a')],_0x3c697c[_0x7112('0x65')][_0x7112('0x1f')]);}}}else{var _0x30919a=_(_0x1a1be7[_0x7112('0x3d')])[_0x7112('0x3c')]()[_0x7112('0x30')](function(_0x24f93b){return _['some'](_0x569c03,[_0x7112('0x2d'),_0x24f93b])?_0x24f93b:undefined;})['compact']()['value']();if(!_[_0x7112('0x70')](_0x30919a)){_0x30919a[_0x7112('0x35')](function(_0x1cf0e3){if(_0x1cf0e3===_0x7112('0x71')){_0x5616f3[_0x7112('0x46')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x7112('0x72')](_0x1a1be7['query'][_0x1cf0e3]));}else if(_0x1cf0e3===_0x7112('0x73')){var _0x20083e=JSON[_0x7112('0x74')](_0x1a1be7['query'][_0x1cf0e3])[_0x7112('0x75')];var _0x1cd585=JSON[_0x7112('0x74')](_0x1a1be7['query'][_0x1cf0e3])[_0x7112('0x76')];_0x5616f3[_0x7112('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x20083e,_0x1cd585);}else{if(_0x1a1be7[_0x7112('0x3d')][_0x1cf0e3]===_0x7112('0x77')){_0x5616f3[_0x7112('0x46')]('i.'+_0x1cf0e3+_0x7112('0x78'));}else{_0x5616f3[_0x7112('0x46')]('i.'+_0x1cf0e3+_0x7112('0x79'),_0x1a1be7['query'][_0x1cf0e3]);}}});}if(_0x1a1be7[_0x7112('0x3d')][_0x7112('0x7a')]){if(_0x1a1be7[_0x7112('0x3d')][_0x7112('0x7a')]==0x1){_0x5616f3['having']('`unreadMessages`\x20=\x200');}else{_0x5616f3[_0x7112('0x60')]('`unreadMessages`\x20>\x200');}}if(_0x1a1be7[_0x7112('0x3d')][_0x7112('0x7b')]){_0x3496ea=_[_0x7112('0x7c')](_0x1a1be7['query'][_0x7112('0x7b')])?_0x1a1be7[_0x7112('0x3d')][_0x7112('0x7b')]:new Array(_0x1a1be7[_0x7112('0x3d')][_0x7112('0x7b')]);_0x3496ea[_0x7112('0x35')](function(_0x52ad66){_0x17f1fe['or'](_0x7112('0x6c'),'%,'+_0x52ad66+',%');});}if(_0x1a1be7['query']['filter']){var _0x153230=_0x1a1be7['query']['filter'][_0x7112('0x7d')]('\x5c','\x5c\x5c')[_0x7112('0x7d')](/'/g,'\x27\x27');if(qs[_0x7112('0x7e')](_0x153230)){_0x49a9e7['or']('i.id\x20LIKE\x20?',_0x153230+'%');}else{_0x49a9e7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7112('0x64')](_0x153230))['or'](_0x7112('0x7f'),_0x153230+'%')['or'](_0x7112('0x80'),_0x153230+'%');}}}_0x5616f3[_0x7112('0x46')](_0x49a9e7);_0x5616f3[_0x7112('0x81')](_0x7112('0x82'));var _0x23c6d1={'type':db[_0x7112('0x83')][_0x7112('0x84')][_0x7112('0x85')],'raw':!![]};var _0x40ca5c=_0x5616f3[_0x7112('0x86')]();_0x40ca5c[_0x7112('0x48')](_0x7112('0x82'));_0x40ca5c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7112('0x87'));if(_0x519cd4[_0x7112('0x44')]){_0x519cd4[_0x7112('0x44')]['forEach'](function(_0x530cf1){var _0xfb6b3e=_0x530cf1[0x0]===_0x7112('0x88')?_0x530cf1[0x0]:'i.'+_0x530cf1[0x0];_0x5616f3[_0x7112('0x44')](_0xfb6b3e,_0x530cf1[0x1]===_0x7112('0x89')?![]:!![]);});}if(!_[_0x7112('0x70')](_0x3496ea)){_0x5616f3[_0x7112('0x60')](_0x17f1fe);_0x40ca5c[_0x7112('0x46')](_0x7112('0x8a'),_0x3496ea);}BPromise[_0x7112('0x8b')]()[_0x7112('0x2a')](function(){if(!_0x227f2e){if(_0x1a1be7[_0x7112('0x3d')]['OpenchannelAccountId'])return;_0x40ca5c[_0x7112('0x46')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x5616f3[_0x7112('0x46')](_0x7112('0x8c'));return;}if(_0x1a1be7[_0x7112('0x8d')][_0x7112('0x8e')]!==_0x7112('0x8f'))return;return _0x1a1be7[_0x7112('0x8d')][_0x7112('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ca5cc){if(_[_0x7112('0x70')](_0x3ca5cc)){_0x40ca5c[_0x7112('0x46')](_0x7112('0x91'));_0x5616f3[_0x7112('0x46')](_0x7112('0x91'));}else{_0x40ca5c['where'](_0x7112('0x92'),_[_0x7112('0x30')](_0x3ca5cc,'id'));_0x5616f3[_0x7112('0x46')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x7112('0x30')](_0x3ca5cc,'id'));}});})[_0x7112('0x2a')](function(){if(_0x1a1be7[_0x7112('0x8d')]['role']===_0x7112('0x8f')&&!_0x227f2e&&!_0x1a1be7[_0x7112('0x3d')][_0x7112('0x71')])return[];return db[_0x7112('0x93')][_0x7112('0x3d')](_0x40ca5c[_0x7112('0x94')](),_0x23c6d1);})[_0x7112('0x2a')](function(_0x4c3f48){_0x526c66[_0x7112('0x23')]=_0x4c3f48[_0x7112('0x5d')];if(_0x526c66['count']===0x0)return[];return db[_0x7112('0x93')][_0x7112('0x3d')](_0x5084ed[_0x7112('0x94')](),_0x23c6d1)[_0x7112('0x2a')](function(_0x16901d){_0x5b1b77=_[_0x7112('0x95')](_0x16901d,'id');_0x23c6d1=_['merge'](_0x23c6d1,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a1be7[_0x7112('0x3d')][_0x7112('0x40')]){_0x519cd4[_0x7112('0x41')][_0x7112('0x35')](function(_0x558f5b){_0x5616f3[_0x7112('0x48')]('i.'+_0x558f5b);});}else{_0x5616f3[_0x7112('0x48')](_0x7112('0x96'),_0x7112('0x87'));_0x5616f3[_0x7112('0x48')](_0x7112('0x97'),'Account.key');_0x5616f3[_0x7112('0x48')](_0x7112('0x98'),_0x7112('0x99'));_0x5616f3[_0x7112('0x48')](_0x7112('0x9a'),_0x7112('0x88'));_0x5616f3[_0x7112('0x48')](_0x7112('0x9b'));_0x5616f3['field'](_0x7112('0x9c'),_0x7112('0x9d'));_0x5616f3[_0x7112('0x48')](_0x7112('0x9e'),_0x7112('0x9f'));_0x5616f3['field'](_0x7112('0xa0'),_0x7112('0xa1'));_0x5616f3[_0x7112('0x48')](_0x7112('0xa2'),_0x7112('0xa3'));_0x5616f3[_0x7112('0x48')](_0x7112('0xa4'),_0x7112('0xa5'));_0x5616f3[_0x7112('0x48')](_0x7112('0xa6'),'Contact.fax');_0x5616f3[_0x7112('0x48')](_0x7112('0xa7'),_0x7112('0xa8'));_0x5616f3[_0x7112('0x48')](_0x7112('0xa9'),'Owner.internal');_0x5616f3[_0x7112('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7112('0x32'));}if(_0x519cd4[_0x7112('0x22')])_0x5616f3[_0x7112('0x22')](_0x519cd4['limit']);if(_0x519cd4[_0x7112('0x20')])_0x5616f3[_0x7112('0x20')](_0x519cd4[_0x7112('0x20')]);return db[_0x7112('0x93')]['query'](_0x5616f3[_0x7112('0x94')](),_0x23c6d1);})['then'](function(_0x282cd0){if(_0x282cd0[_0x7112('0x5d')]>0x0)_0x13e47f[_0x7112('0x46')](_0x7112('0xaa'),_[_0x7112('0x30')](_0x282cd0,'id'));return db[_0x7112('0x93')][_0x7112('0x3d')](_0x13e47f[_0x7112('0x94')](),_0x23c6d1)[_0x7112('0x2a')](function(_0x27824f){var _0x556ff3=_[_0x7112('0xab')](_0x27824f,'OpenchannelInteractionId');var _0x40004b=[];_0x282cd0[_0x7112('0x35')](function(_0x55a2fa){_0x40004b[_0x7112('0x36')](updateOpenchannelInteraction(_0x55a2fa,_0x5b1b77,_0x556ff3));});return BPromise[_0x7112('0xac')](_0x40004b);});});})[_0x7112('0x2a')](function(_0x48a25a){_0x526c66[_0x7112('0xad')]=_0x48a25a;return _0x526c66;})[_0x7112('0x2a')](respondWithFilteredResult(_0x4a61b3,_0x519cd4))[_0x7112('0x37')](handleError(_0x4a61b3,null));};exports[_0x7112('0xae')]=function(_0x3562c2,_0x189a87){var _0x307b75={};if(_0x3562c2['query'][_0x7112('0x68')]&&_0x3562c2[_0x7112('0x3d')][_0x7112('0x68')]===_0x7112('0x49')){_0x307b75[_0x7112('0x49')]=_0x3562c2[_0x7112('0xaf')]['id'];}else{_0x307b75['id']=_0x3562c2[_0x7112('0xaf')]['id'];}var _0x5aea34={'raw':![],'where':_0x307b75},_0x3fd924={};_0x3fd924[_0x7112('0x3b')]=_[_0x7112('0x3c')](db[_0x7112('0xb0')][_0x7112('0x39')]);_0x3fd924[_0x7112('0x3d')]=_[_0x7112('0x3c')](_0x3562c2[_0x7112('0x3d')]);_0x3fd924[_0x7112('0x3e')]=_[_0x7112('0x3f')](_0x3fd924[_0x7112('0x3b')],_0x3fd924[_0x7112('0x3d')]);_0x5aea34[_0x7112('0x41')]=_[_0x7112('0x3f')](_0x3fd924[_0x7112('0x3b')],qs[_0x7112('0x40')](_0x3562c2[_0x7112('0x3d')][_0x7112('0x40')]));_0x5aea34[_0x7112('0x41')]=_0x5aea34[_0x7112('0x41')]['length']?_0x5aea34[_0x7112('0x41')]:_0x3fd924[_0x7112('0x3b')];if(_0x3562c2['query']['includeAll']){_0x5aea34[_0x7112('0xb1')]=[{'all':!![]}];}_0x5aea34=_[_0x7112('0xb2')]({},_0x5aea34,_0x3562c2['options']);return db[_0x7112('0xb0')][_0x7112('0x5e')](_0x5aea34)[_0x7112('0x2a')](handleEntityNotFound(_0x189a87,null))[_0x7112('0x2a')](respondWithResult(_0x189a87,null))[_0x7112('0x37')](handleError(_0x189a87,null));};exports[_0x7112('0xb3')]=function(_0x3f4cf9,_0x4a3b62){return db[_0x7112('0xb0')][_0x7112('0xb3')](_0x3f4cf9['body'],{})[_0x7112('0x2a')](respondWithResult(_0x4a3b62,0xc9))[_0x7112('0x37')](handleError(_0x4a3b62,null));};exports[_0x7112('0x29')]=function(_0x53d823,_0x399217){if(_0x53d823[_0x7112('0x6f')]['id']){delete _0x53d823[_0x7112('0x6f')]['id'];}return db[_0x7112('0xb0')][_0x7112('0x5e')]({'where':{'id':_0x53d823[_0x7112('0xaf')]['id']}})[_0x7112('0x2a')](handleEntityNotFound(_0x399217,null))[_0x7112('0x2a')](saveUpdates(_0x53d823[_0x7112('0x6f')],null))[_0x7112('0x2a')](respondWithResult(_0x399217,null))[_0x7112('0x37')](handleError(_0x399217,null));};exports[_0x7112('0x2b')]=function(_0x4d0af2,_0xb3d508){return db['OpenchannelInteraction'][_0x7112('0x5e')]({'where':{'id':_0x4d0af2[_0x7112('0xaf')]['id']}})[_0x7112('0x2a')](handleEntityNotFound(_0xb3d508,null))['then'](removeEntity(_0xb3d508,null))[_0x7112('0x37')](handleError(_0xb3d508,null));};exports[_0x7112('0xb4')]=function(_0x43ce33,_0x3cad6a){return db['OpenchannelInteraction'][_0x7112('0xb4')]()[_0x7112('0x2a')](respondWithResult(_0x3cad6a,null))[_0x7112('0x37')](handleError(_0x3cad6a,null));};exports[_0x7112('0xb5')]=function(_0x38e23a,_0x1e2787,_0x199279){return db[_0x7112('0xb6')][_0x7112('0x5e')]({'where':{'id':_0x38e23a[_0x7112('0xaf')]['id']}})['then'](handleEntityNotFound(_0x1e2787,null))[_0x7112('0x2a')](function(_0x496da4){if(_0x496da4){return _0x496da4[_0x7112('0xb5')](_0x38e23a[_0x7112('0x6f')][_0x7112('0xb7')],_[_0x7112('0xb8')](_0x38e23a[_0x7112('0x6f')],[_0x7112('0xb7'),'id'])||{});}})[_0x7112('0x2a')](respondWithResult(_0x1e2787,null))['catch'](handleError(_0x1e2787,null));};exports[_0x7112('0xb9')]=function(_0x2cb1e8,_0x252086,_0x5bcc25){var _0x371ee1={'raw':![],'where':{}};var _0x2f72b9={};var _0x511b93={'count':0x0,'rows':[]};return db[_0x7112('0xb0')]['findOne']({'where':{'id':_0x2cb1e8[_0x7112('0xaf')]['id']}})[_0x7112('0x2a')](handleEntityNotFound(_0x252086,null))[_0x7112('0x2a')](function(_0x16d17b){if(_0x16d17b){_0x2f72b9[_0x7112('0x3b')]=_[_0x7112('0x3c')](db[_0x7112('0xb6')][_0x7112('0x39')]);_0x2f72b9[_0x7112('0x3d')]=_[_0x7112('0x3c')](_0x2cb1e8['query']);_0x2f72b9[_0x7112('0x3e')]=_['intersection'](_0x2f72b9[_0x7112('0x3b')],_0x2f72b9['query']);_0x371ee1['attributes']=_[_0x7112('0x3f')](_0x2f72b9[_0x7112('0x3b')],qs[_0x7112('0x40')](_0x2cb1e8[_0x7112('0x3d')][_0x7112('0x40')]));_0x371ee1[_0x7112('0x41')]=_0x371ee1[_0x7112('0x41')][_0x7112('0x5d')]?_0x371ee1[_0x7112('0x41')]:_0x2f72b9['model'];if(!_0x2cb1e8[_0x7112('0x3d')][_0x7112('0x42')](_0x7112('0x43'))){_0x371ee1[_0x7112('0x22')]=qs[_0x7112('0x22')](_0x2cb1e8[_0x7112('0x3d')][_0x7112('0x22')]);_0x371ee1[_0x7112('0x20')]=qs[_0x7112('0x20')](_0x2cb1e8[_0x7112('0x3d')][_0x7112('0x20')]);}_0x371ee1[_0x7112('0x44')]=qs['sort'](_0x2cb1e8['query'][_0x7112('0x45')]);_0x371ee1['where']=qs[_0x7112('0x3e')](_[_0x7112('0x47')](_0x2cb1e8[_0x7112('0x3d')],_0x2f72b9[_0x7112('0x3e')]));_0x371ee1[_0x7112('0x46')]['OpenchannelInteractionId']=_0x16d17b['id'];if(_0x2cb1e8[_0x7112('0x3d')]['filter']){_0x371ee1[_0x7112('0x46')]=_[_0x7112('0xb2')](_0x371ee1[_0x7112('0x46')],{'$or':_[_0x7112('0x30')](_0x371ee1[_0x7112('0x41')],function(_0x5598f5){var _0x44aab4={};_0x44aab4[_0x5598f5]={'$like':'%'+_0x2cb1e8[_0x7112('0x3d')][_0x7112('0xba')]+'%'};return _0x44aab4;})});}if(_0x2cb1e8[_0x7112('0x3d')][_0x7112('0x75')]){var _0x205ba9=_0x2cb1e8['query'][_0x7112('0x75')][_0x7112('0x34')](',');var _0xe62df7={};_0xe62df7[_0x205ba9[0x0]]={'$gte':moment(_0x205ba9[0x1])[_0x7112('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x371ee1['where']=_[_0x7112('0xb2')](_0x371ee1['where'],_0xe62df7);}_0x371ee1=_[_0x7112('0xb2')]({},_0x371ee1,_0x2cb1e8[_0x7112('0xbc')]);return db[_0x7112('0xb6')][_0x7112('0x23')]({'where':_0x371ee1['where']})[_0x7112('0x2a')](function(_0x3ab778){_0x511b93['count']=_0x3ab778;if(_0x2cb1e8[_0x7112('0x3d')]['includeAll']){_0x371ee1[_0x7112('0xb1')]=[{'all':!![]}];}return db[_0x7112('0xb6')][_0x7112('0xbd')](_0x371ee1);})[_0x7112('0x2a')](function(_0x2b39ed){_0x511b93['rows']=_0x2b39ed;return _0x511b93;});}})[_0x7112('0x2a')](respondWithFilteredResult(_0x252086,_0x371ee1))[_0x7112('0x37')](handleError(_0x252086,null));};exports[_0x7112('0xbe')]=function(_0x44eb06,_0x161d33,_0xb9180b){return db[_0x7112('0xb0')][_0x7112('0x5e')]({'where':{'id':_0x44eb06[_0x7112('0xaf')]['id']}})['then'](handleEntityNotFound(_0x161d33,null))['then'](function(_0x7c5abd){if(_0x7c5abd){return _0x7c5abd['setTags'](_0x44eb06[_0x7112('0x6f')][_0x7112('0xb7')],_['omit'](_0x44eb06[_0x7112('0x6f')],[_0x7112('0xb7'),'id'])||{})[_0x7112('0xbf')](function(){return db[_0x7112('0x6b')][_0x7112('0xbd')]({'attributes':['id','name','color'],'where':{'id':_0x44eb06[_0x7112('0x6f')][_0x7112('0xb7')]}});})[_0x7112('0x2a')](function(_0x410326){socket[_0x7112('0xc0')](_0x7112('0xc1'),{'id':Number(_0x44eb06[_0x7112('0xaf')]['id']),'tags':_0x410326||[]});return{'id':Number(_0x44eb06[_0x7112('0xaf')]['id']),'tags':_0x410326||[]};});}})[_0x7112('0x2a')](respondWithResult(_0x161d33,null))['catch'](handleError(_0x161d33,null));};exports[_0x7112('0xc2')]=function(_0x5cfb86,_0x403319,_0x2c50b6){return db[_0x7112('0xb0')][_0x7112('0x5e')]({'where':{'id':_0x5cfb86[_0x7112('0xaf')]['id']}})['then'](handleEntityNotFound(_0x403319,null))['then'](function(_0x30c42e){if(_0x30c42e){return _0x30c42e[_0x7112('0xc2')](_0x5cfb86[_0x7112('0x3d')][_0x7112('0xb7')]);}})[_0x7112('0x2a')](respondWithStatusCode(_0x403319,null))[_0x7112('0x37')](handleError(_0x403319,null));};exports[_0x7112('0xc3')]=function(_0xaaac23,_0x1366dc){var _0x351ea2=moment()[_0x7112('0xc4')]()['toString']();var _0x4bceaf=path['join'](config[_0x7112('0xc5')],_0x7112('0xc6'),'files',_0x7112('0xc7'));var _0x5509a6=path[_0x7112('0xc8')](config[_0x7112('0xc5')],_0x7112('0xc6'),_0x7112('0xc9'),_0x7112('0xca'));var _0x546cbf=path[_0x7112('0xc8')](_0x4bceaf,_0x351ea2);var _0x1af44b=util[_0x7112('0xbb')](_0x7112('0xcb'),_0xaaac23[_0x7112('0xaf')]['id'],_0x351ea2);var _0x4a8917=path[_0x7112('0xc8')](_0x4bceaf,_0x1af44b);var _0x47e9ce=[];_0x47e9ce[_0x7112('0x36')]({'model':db[_0x7112('0x6d')],'as':_0x7112('0x6d'),'attributes':['id',_0x7112('0x31')],'raw':!![]});_0x47e9ce[_0x7112('0x36')]({'model':db['CmContact'],'as':_0x7112('0xcc'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0xaaac23[_0x7112('0x3d')][_0x7112('0xca')]){_0x47e9ce[_0x7112('0x36')]({'model':db['Attachment'],'as':_0x7112('0xcd'),'raw':!![]});}var _0x541d8e=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body',_0x7112('0x73'),_0x7112('0xce'),_0x7112('0xcf'),_0x7112('0x7a')],'include':_0x47e9ce}];_0x541d8e[_0x7112('0x36')]({'model':db[_0x7112('0xd0')],'as':'Account','attributes':['id',_0x7112('0x2d')]});_0x541d8e['push']({'model':db['User'],'as':_0x7112('0xd1'),'attributes':['id',_0x7112('0x31')]});return db[_0x7112('0xb0')]['find']({'where':{'id':_0xaaac23['params']['id']},'include':_0x541d8e})[_0x7112('0x2a')](handleEntityNotFound(_0x1366dc,null))[_0x7112('0x2a')](function(_0xd13ca0){if(_0xd13ca0){var _0x15a30=_0xd13ca0[_0x7112('0xd2')]({'plain':!![]});fs[_0x7112('0xd3')](_0x546cbf);var _0xff4b53={'channel':_0x7112('0xd4'),'account':_0x15a30[_0x7112('0xd5')]['name'],'agent':_0x15a30[_0x7112('0xd1')]?_0x15a30[_0x7112('0xd1')][_0x7112('0x31')]:_0x7112('0xd6'),'createdAt':moment(_0x15a30[_0x7112('0x73')])[_0x7112('0xbb')](_0x7112('0xd7'))[_0x7112('0x94')](),'closedAt':_0x15a30[_0x7112('0xd8')]?moment(_0x15a30[_0x7112('0xd9')])[_0x7112('0xbb')](_0x7112('0xd7'))[_0x7112('0x94')]():'','disposition':_0x15a30[_0x7112('0xda')],'visibility':_0x15a30[_0x7112('0xdb')]?'Public':_0x7112('0xdc'),'messages':_(_0x15a30[_0x7112('0xdd')])['filter']({'secret':![]})['map'](function(_0xb3f855){if(_0xb3f855['Attachment']){var _0x44a3de=path['join'](_0x5509a6,_0xb3f855[_0x7112('0xcd')]['basename']);if(fs[_0x7112('0xde')](_0x44a3de)){fs[_0x7112('0xdf')](_0x44a3de)['pipe'](fs[_0x7112('0xe0')](path['join'](_0x546cbf,_0xb3f855['Attachment'][_0x7112('0xe1')])));}}return{'date':moment(_0xb3f855[_0x7112('0x73')])['format'](_0x7112('0xd7'))[_0x7112('0x94')](),'sender':_0xb3f855[_0x7112('0xce')]===_0x7112('0xe2')?_0xb3f855[_0x7112('0x6d')]?_0xb3f855[_0x7112('0x6d')]['fullname']:_0x7112('0xe3'):_0xb3f855[_0x7112('0xcc')][_0x7112('0xe4')]+(_0xb3f855['Contact'][_0x7112('0xe5')]?'\x20'+_0xb3f855[_0x7112('0xcc')][_0x7112('0xe5')]:''),'body':_0xb3f855[_0x7112('0xcd')]?_0xb3f855[_0x7112('0xcd')]['basename']:_0xb3f855['body'],'direction':_0xb3f855[_0x7112('0xce')]===_0x7112('0xe2')?'A':'C','secret':_0xb3f855[_0x7112('0xcf')],'read':_0xb3f855['read'],'attachment':_0xb3f855[_0x7112('0xcd')]};})[_0x7112('0x65')]()};return ejs[_0x7112('0xe6')](path['join'](config[_0x7112('0xc5')],_0x7112('0xc6'),_0x7112('0xe7'),_0x7112('0xe8')),{'interaction':_0xff4b53})[_0x7112('0x2a')](function(_0x1c4770){var _0x27093c=path['join'](_0x546cbf,_0x7112('0xe9')+_0x15a30['id']+'-'+_0x351ea2+_0x7112('0xea'));var _0x35e254={'path':_0x27093c,'channel':_0x7112('0xd4'),'interactionId':_0x15a30['id']};return pdf['createPdfFromHTML'](_0x1c4770,_0x35e254);})[_0x7112('0x2a')](function(){return new BPromise(function(_0x53b1b6,_0x455514){zipdir(_0x546cbf,{'saveTo':_0x4a8917},function(_0x57a20f,_0x753e16){if(_0x57a20f)return _0x455514(_0x57a20f);return _0x53b1b6(_0x753e16);});})['then'](function(){return new BPromise(function(_0x3bf841,_0xfeb90){rimraf(_0x546cbf,function(_0xe69f85){if(_0xe69f85)_0xfeb90(_0xe69f85);return _0x3bf841();});});})[_0x7112('0x2a')](function(){return _0x1366dc[_0x7112('0xc3')](_0x4a8917,_0x1af44b,function(_0x27ea6a){if(_0x27ea6a){console[_0x7112('0xeb')](_0x7112('0xec'),_0x27ea6a);}else{fs['unlinkSync'](_0x4a8917);}});});});}else{return _0x1366dc[_0x7112('0x1d')](0xc8);}})[_0x7112('0x37')](handleError(_0x1366dc,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 72a7e2d..1d30d68 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 _0x3912=['Users','setDataValue','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x3e23bf,_0x287f22){var _0x423f00=function(_0x3748e0){while(--_0x3748e0){_0x3e23bf['push'](_0x3e23bf['shift']());}};_0x423f00(++_0x287f22);}(_0x3912,0x160));var _0x2391=function(_0x3c92db,_0x54ae6c){_0x3c92db=_0x3c92db-0x0;var _0x52f22a=_0x3912[_0x3c92db];return _0x52f22a;};'use strict';var EventEmitter=require(_0x2391('0x0'));var OpenchannelInteraction=require(_0x2391('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x2391('0x1'))['db'][_0x2391('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2391('0x3')](0x0);var events={'afterCreate':_0x2391('0x4'),'afterUpdate':'update','afterDestroy':_0x2391('0x5')};function emitEvent(_0x56ac07){return function(_0x1eb327,_0x201661,_0x564542){_0x1eb327[_0x2391('0x6')]({'attributes':['id'],'raw':!![]})[_0x2391('0x7')](function(_0xa0b3ff){_0x1eb327['setDataValue'](_0x2391('0x8'),_0xa0b3ff['map'](function(_0x252de9){return{'id':_0x252de9['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1eb327['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2391('0x7')](function(_0x58c37e){_0x1eb327[_0x2391('0x9')](_0x2391('0xa'),_0x58c37e[_0x2391('0xb')]);OpenchannelInteractionEvents['emit'](_0x56ac07+':'+_0x1eb327['id'],_0x1eb327);OpenchannelInteractionEvents[_0x2391('0xc')](_0x56ac07,_0x1eb327);_0x564542(null);})['catch'](_0x564542(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x2391('0xd')](e,emitEvent(event));}}module[_0x2391('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x666f=['then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll'];(function(_0x2498b5,_0x514ddb){var _0x5c48d8=function(_0xee9bb5){while(--_0xee9bb5){_0x2498b5['push'](_0x2498b5['shift']());}};_0x5c48d8(++_0x514ddb);}(_0x666f,0x1ab));var _0xf666=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x666f[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xf666('0x0'));var OpenchannelInteraction=require(_0xf666('0x1'))['db'][_0xf666('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xf666('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf666('0x4')](0x0);var events={'afterCreate':_0xf666('0x5'),'afterUpdate':_0xf666('0x6'),'afterDestroy':_0xf666('0x7')};function emitEvent(_0x23bdba){return function(_0x27a413,_0x4aebd9,_0x4da6c5){_0x27a413[_0xf666('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x306804){_0x27a413[_0xf666('0x9')](_0xf666('0xa'),_0x306804[_0xf666('0xb')](function(_0xe9a17c){return{'id':_0xe9a17c['id']};}));return OpenchannelMessage[_0xf666('0xc')]({'where':{'OpenchannelInteractionId':_0x27a413['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf666('0xd')](function(_0x58c665){_0x27a413['setDataValue'](_0xf666('0xe'),_0x58c665[_0xf666('0xf')]);OpenchannelInteractionEvents[_0xf666('0x10')](_0x23bdba+':'+_0x27a413['id'],_0x27a413);OpenchannelInteractionEvents[_0xf666('0x10')](_0x23bdba,_0x27a413);_0x4da6c5(null);})[_0xf666('0x11')](_0x4da6c5(null));};}for(var e in events){if(events[_0xf666('0x12')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xf666('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 32213e6..6c31027 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 _0x1dda=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x269456,_0x5980ef){var _0x52c201=function(_0x3ffb86){while(--_0x3ffb86){_0x269456['push'](_0x269456['shift']());}};_0x52c201(++_0x5980ef);}(_0x1dda,0x139));var _0xa1dd=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x1dda[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0xa1dd('0x0'));var util=require(_0xa1dd('0x1'));var logger=require(_0xa1dd('0x2'))('api');var moment=require(_0xa1dd('0x3'));var BPromise=require(_0xa1dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1dd('0x5'));var rimraf=require(_0xa1dd('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xa1dd('0x7')]=function(_0x597071,_0x52c86d){return _0x597071[_0xa1dd('0x8')](_0xa1dd('0x9'),attributes,{'tableName':_0xa1dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1dd('0xb'),'collate':_0xa1dd('0xc'),'hooks':{'beforeUpdate':function(_0x231949,_0x102d56,_0x18d6a2){if(_0x231949[_0xa1dd('0xd')](_0xa1dd('0xe'))){_0x231949['closedAt']=moment()['format'](_0xa1dd('0xf'));}_0x18d6a2(null,_0x231949);}}});}; \ No newline at end of file +var _0x8caf=['utf8mb4_unicode_ci','changed','format','lodash','util','api','moment','bluebird','request-promise','path','rimraf','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x211786,_0xf52e6b){var _0x5ec5fb=function(_0x4b1eb4){while(--_0x4b1eb4){_0x211786['push'](_0x211786['shift']());}};_0x5ec5fb(++_0xf52e6b);}(_0x8caf,0x16f));var _0xf8ca=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8caf[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xf8ca('0x0'));var util=require(_0xf8ca('0x1'));var logger=require('../../config/logger')(_0xf8ca('0x2'));var moment=require(_0xf8ca('0x3'));var BPromise=require(_0xf8ca('0x4'));var rp=require(_0xf8ca('0x5'));var fs=require('fs');var path=require(_0xf8ca('0x6'));var rimraf=require(_0xf8ca('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x5808d5,_0x1ebd7e){return _0x5808d5['define'](_0xf8ca('0x8'),attributes,{'tableName':_0xf8ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf8ca('0xa'),'collate':_0xf8ca('0xb'),'hooks':{'beforeUpdate':function(_0x565270,_0x13c556,_0x288464){if(_0x565270[_0xf8ca('0xc')]('closed')){_0x565270['closedAt']=moment()[_0xf8ca('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x288464(null,_0x565270);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index aeb4cad..a3962f2 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 _0x578a=['redis','socket.io-emitter','./openchannelInteraction.socket','register','then','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2efeb7,_0x403fce){var _0x191e25=function(_0x25c3ac){while(--_0x25c3ac){_0x2efeb7['push'](_0x2efeb7['shift']());}};_0x191e25(++_0x403fce);}(_0x578a,0x7a));var _0xa578=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x578a[_0x430459];return _0x3a2439;};'use strict';var _=require(_0xa578('0x0'));var util=require('util');var moment=require(_0xa578('0x1'));var BPromise=require(_0xa578('0x2'));var rs=require(_0xa578('0x3'));var fs=require('fs');var Redis=require(_0xa578('0x4'));var db=require(_0xa578('0x5'))['db'];var utils=require(_0xa578('0x6'));var logger=require(_0xa578('0x7'))(_0xa578('0x8'));var config=require(_0xa578('0x9'));var jayson=require(_0xa578('0xa'));var client=jayson[_0xa578('0xb')][_0xa578('0xc')]({'port':0x232a});config[_0xa578('0xd')]=_['defaults'](config[_0xa578('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa578('0xe'))(new Redis(config[_0xa578('0xd')]));require(_0xa578('0xf'))[_0xa578('0x10')](socket);function respondWithRpcPromise(_0x5bf778,_0x6c4d0d,_0x160266){return new BPromise(function(_0x5e1a7b,_0x3484f4){return client['request'](_0x5bf778,_0x160266)[_0xa578('0x11')](function(_0x35f02c){logger[_0xa578('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x6c4d0d,'request\x20sent');logger[_0xa578('0x13')](_0xa578('0x14'),_0x6c4d0d,_0xa578('0x15'),JSON[_0xa578('0x16')](_0x35f02c));if(_0x35f02c[_0xa578('0x17')]){if(_0x35f02c['error'][_0xa578('0x18')]===0x1f4){logger[_0xa578('0x17')](_0xa578('0x19'),_0x6c4d0d,_0x35f02c[_0xa578('0x17')][_0xa578('0x1a')]);return _0x3484f4(_0x35f02c[_0xa578('0x17')][_0xa578('0x1a')]);}logger[_0xa578('0x17')](_0xa578('0x19'),_0x6c4d0d,_0x35f02c[_0xa578('0x17')][_0xa578('0x1a')]);return _0x5e1a7b(_0x35f02c[_0xa578('0x17')]['message']);}else{logger['info'](_0xa578('0x19'),_0x6c4d0d,_0xa578('0x15'));_0x5e1a7b(_0x35f02c[_0xa578('0x1b')][_0xa578('0x1a')]);}})[_0xa578('0x1c')](function(_0x168ad3){logger[_0xa578('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x6c4d0d,_0x168ad3);_0x3484f4(_0x168ad3);});});}exports[_0xa578('0x1d')]=function(_0x291477){var _0x10bcc9=this;return new Promise(function(_0x2ee22f,_0xf20a85){return db['OpenchannelInteraction'][_0xa578('0x1e')](_0x291477[_0xa578('0x1f')],{'raw':_0x291477['options']?_0x291477[_0xa578('0x20')][_0xa578('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291477[_0xa578('0x20')]?_0x291477['options'][_0xa578('0x22')]||null:null,'attributes':_0x291477[_0xa578('0x20')]?_0x291477[_0xa578('0x20')][_0xa578('0x23')]||null:null,'limit':_0x291477[_0xa578('0x20')]?_0x291477['options'][_0xa578('0x24')]||null:null})['then'](function(_0xa0013a){logger['info']('UpdateOpenchannelInteraction',_0x291477);logger['debug'](_0xa578('0x1d'),_0x291477,JSON[_0xa578('0x16')](_0xa0013a));_0x2ee22f(_0xa0013a);})[_0xa578('0x1c')](function(_0x4be9f5){logger[_0xa578('0x17')](_0xa578('0x1d'),_0x4be9f5['message'],_0x291477);_0xf20a85(_0x10bcc9[_0xa578('0x17')](0x1f4,_0x4be9f5[_0xa578('0x1a')]));});});};exports[_0xa578('0x25')]=function(_0x5d94bd){return new Promise(function(_0x4fde47,_0x21adf8){return db[_0xa578('0x26')][_0xa578('0x27')]({'where':_0x5d94bd[_0xa578('0x20')]?_0x5d94bd[_0xa578('0x20')][_0xa578('0x22')]||null:null})[_0xa578('0x11')](function(_0x502e11){if(_0x502e11){return _0x502e11[_0xa578('0x28')](_0x5d94bd[_0xa578('0x1f')][_0xa578('0x29')],_[_0xa578('0x2a')](_0x5d94bd[_0xa578('0x1f')],[_0xa578('0x29'),'id'])||{});}})[_0xa578('0x2b')](function(_0xfd80af){logger[_0xa578('0x12')](_0xa578('0x2c'),_0x5d94bd);logger[_0xa578('0x13')]('AddTags',_0x5d94bd,JSON['stringify'](_0xfd80af));_0x4fde47(_0xfd80af);})['catch'](function(_0x4b6ff6){logger[_0xa578('0x17')](_0xa578('0x2c'),_0x4b6ff6[_0xa578('0x1a')],_0x5d94bd);_0x21adf8(_this['error'](0x1f4,_0x4b6ff6['message']));});});}; \ No newline at end of file +var _0x0dd6=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelInteraction','options','where','attributes','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','addTags','body','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5f2a7c,_0x4c4b4a){var _0x5c8983=function(_0x564655){while(--_0x564655){_0x5f2a7c['push'](_0x5f2a7c['shift']());}};_0x5c8983(++_0x4c4b4a);}(_0x0dd6,0x6f));var _0x60dd=function(_0x270061,_0x4e41e1){_0x270061=_0x270061-0x0;var _0x329604=_0x0dd6[_0x270061];return _0x329604;};'use strict';var _=require(_0x60dd('0x0'));var util=require(_0x60dd('0x1'));var moment=require('moment');var BPromise=require(_0x60dd('0x2'));var rs=require(_0x60dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60dd('0x4'))['db'];var utils=require(_0x60dd('0x5'));var logger=require('../../config/logger')(_0x60dd('0x6'));var config=require(_0x60dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x60dd('0x8')][_0x60dd('0x9')]({'port':0x232a});config[_0x60dd('0xa')]=_[_0x60dd('0xb')](config[_0x60dd('0xa')],{'host':_0x60dd('0xc'),'port':0x18eb});var socket=require(_0x60dd('0xd'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x60dd('0xe')](socket);function respondWithRpcPromise(_0x1b0784,_0x11c745,_0x53868d){return new BPromise(function(_0xd3dc96,_0x4bf239){return client[_0x60dd('0xf')](_0x1b0784,_0x53868d)[_0x60dd('0x10')](function(_0x4c4f5f){logger[_0x60dd('0x11')](_0x60dd('0x12'),_0x11c745,'request\x20sent');logger[_0x60dd('0x13')](_0x60dd('0x14'),_0x11c745,'request\x20sent',JSON['stringify'](_0x4c4f5f));if(_0x4c4f5f[_0x60dd('0x15')]){if(_0x4c4f5f[_0x60dd('0x15')][_0x60dd('0x16')]===0x1f4){logger[_0x60dd('0x15')](_0x60dd('0x12'),_0x11c745,_0x4c4f5f[_0x60dd('0x15')][_0x60dd('0x17')]);return _0x4bf239(_0x4c4f5f[_0x60dd('0x15')][_0x60dd('0x17')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x11c745,_0x4c4f5f[_0x60dd('0x15')][_0x60dd('0x17')]);return _0xd3dc96(_0x4c4f5f[_0x60dd('0x15')][_0x60dd('0x17')]);}else{logger[_0x60dd('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x11c745,'request\x20sent');_0xd3dc96(_0x4c4f5f[_0x60dd('0x18')][_0x60dd('0x17')]);}})[_0x60dd('0x19')](function(_0x333d0d){logger[_0x60dd('0x15')](_0x60dd('0x12'),_0x11c745,_0x333d0d);_0x4bf239(_0x333d0d);});});}exports['UpdateOpenchannelInteraction']=function(_0x5acaa4){var _0x70b3a8=this;return new Promise(function(_0x104b63,_0x214854){return db[_0x60dd('0x1a')]['update'](_0x5acaa4['body'],{'raw':_0x5acaa4[_0x60dd('0x1b')]?_0x5acaa4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5acaa4[_0x60dd('0x1b')]?_0x5acaa4[_0x60dd('0x1b')][_0x60dd('0x1c')]||null:null,'attributes':_0x5acaa4[_0x60dd('0x1b')]?_0x5acaa4['options'][_0x60dd('0x1d')]||null:null,'limit':_0x5acaa4['options']?_0x5acaa4['options'][_0x60dd('0x1e')]||null:null})['then'](function(_0x22a7da){logger[_0x60dd('0x11')](_0x60dd('0x1f'),_0x5acaa4);logger[_0x60dd('0x13')](_0x60dd('0x1f'),_0x5acaa4,JSON[_0x60dd('0x20')](_0x22a7da));_0x104b63(_0x22a7da);})[_0x60dd('0x19')](function(_0x39c784){logger['error'](_0x60dd('0x1f'),_0x39c784[_0x60dd('0x17')],_0x5acaa4);_0x214854(_0x70b3a8[_0x60dd('0x15')](0x1f4,_0x39c784[_0x60dd('0x17')]));});});};exports[_0x60dd('0x21')]=function(_0x44df74){return new Promise(function(_0x43b770,_0x134e36){return db[_0x60dd('0x1a')]['find']({'where':_0x44df74[_0x60dd('0x1b')]?_0x44df74[_0x60dd('0x1b')][_0x60dd('0x1c')]||null:null})[_0x60dd('0x10')](function(_0x59af81){if(_0x59af81){return _0x59af81[_0x60dd('0x22')](_0x44df74[_0x60dd('0x23')][_0x60dd('0x24')],_['omit'](_0x44df74['body'],['ids','id'])||{});}})[_0x60dd('0x25')](function(_0x1be510){logger['info'](_0x60dd('0x26'),_0x44df74);logger[_0x60dd('0x13')](_0x60dd('0x26'),_0x44df74,JSON[_0x60dd('0x20')](_0x1be510));_0x43b770(_0x1be510);})[_0x60dd('0x19')](function(_0x278b01){logger[_0x60dd('0x15')](_0x60dd('0x26'),_0x278b01[_0x60dd('0x17')],_0x44df74);_0x134e36(_this[_0x60dd('0x15')](0x1f4,_0x278b01['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 65a8a8d..c61cdac 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 _0x7a64=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x29932d,_0x1425e9){var _0x15524f=function(_0x1c9732){while(--_0x1c9732){_0x29932d['push'](_0x29932d['shift']());}};_0x15524f(++_0x1425e9);}(_0x7a64,0x15d));var _0x47a6=function(_0x159005,_0x5d336d){_0x159005=_0x159005-0x0;var _0x3da39b=_0x7a64[_0x159005];return _0x3da39b;};'use strict';var OpenchannelInteractionEvents=require(_0x47a6('0x0'));var events=[_0x47a6('0x1'),_0x47a6('0x2'),'update'];function createListener(_0xb52ac7,_0x5ba9bf){return function(_0x2d0219){_0x5ba9bf[_0x47a6('0x3')](_0xb52ac7,_0x2d0219);};}function removeListener(_0x46337c,_0x1d46fa){return function(){OpenchannelInteractionEvents[_0x47a6('0x4')](_0x46337c,_0x1d46fa);};}exports[_0x47a6('0x5')]=function(_0x1d49e5){for(var _0x39d1de=0x0,_0x973bef=events[_0x47a6('0x6')];_0x39d1de<_0x973bef;_0x39d1de++){var _0x3a646d=events[_0x39d1de];var _0x6a6a9b=createListener(_0x47a6('0x7')+_0x3a646d,_0x1d49e5);OpenchannelInteractionEvents['on'](_0x3a646d,_0x6a6a9b);}}; \ No newline at end of file +var _0xf79d=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x493a7b,_0x316a7f){var _0x4e4153=function(_0x2744fe){while(--_0x2744fe){_0x493a7b['push'](_0x493a7b['shift']());}};_0x4e4153(++_0x316a7f);}(_0xf79d,0x106));var _0xdf79=function(_0x263863,_0x28da3e){_0x263863=_0x263863-0x0;var _0x3e88f1=_0xf79d[_0x263863];return _0x3e88f1;};'use strict';var OpenchannelInteractionEvents=require(_0xdf79('0x0'));var events=[_0xdf79('0x1'),_0xdf79('0x2'),_0xdf79('0x3')];function createListener(_0x13d25f,_0x4f167f){return function(_0xe35eda){_0x4f167f[_0xdf79('0x4')](_0x13d25f,_0xe35eda);};}function removeListener(_0x56d2ef,_0x27abf3){return function(){OpenchannelInteractionEvents[_0xdf79('0x5')](_0x56d2ef,_0x27abf3);};}exports[_0xdf79('0x6')]=function(_0x296275){for(var _0x46ec43=0x0,_0x5cf220=events[_0xdf79('0x7')];_0x46ec43<_0x5cf220;_0x46ec43++){var _0x3a71d6=events[_0x46ec43];var _0x6d038c=createListener(_0xdf79('0x8')+_0x3a71d6,_0x296275);OpenchannelInteractionEvents['on'](_0x3a71d6,_0x6d038c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 42d884c..6a5eb1e 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x58622a,_0x4ad356){var _0x2888db=function(_0x794b69){while(--_0x794b69){_0x58622a['push'](_0x58622a['shift']());}};_0x2888db(++_0x4ad356);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 42d7335..2732bfe 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 _0xbc87=['STRING','TEXT','sequelize','medium','BOOLEAN','out','DATE'];(function(_0x459a5c,_0xf310e5){var _0xe9f02d=function(_0x50dbfc){while(--_0x50dbfc){_0x459a5c['push'](_0x459a5c['shift']());}};_0xe9f02d(++_0xf310e5);}(_0xbc87,0x144));var _0x7bc8=function(_0x3d5cd3,_0x1e8caa){_0x3d5cd3=_0x3d5cd3-0x0;var _0x576889=_0xbc87[_0x3d5cd3];return _0x576889;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7bc8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7bc8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7bc8('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7bc8('0x4')]},'providerName':{'type':Sequelize[_0x7bc8('0x5')]},'providerResponse':{'type':Sequelize[_0x7bc8('0x6')]}}; \ No newline at end of file +var _0xd4a2=['sequelize','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xd4a2,0x173));var _0x2d4a=function(_0x45d796,_0x5ccda6){_0x45d796=_0x45d796-0x0;var _0x2d5803=_0xd4a2[_0x45d796];return _0x2d5803;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2d4a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2d4a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2d4a('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x2d4a('0x4')]},'providerName':{'type':Sequelize[_0x2d4a('0x5')]},'providerResponse':{'type':Sequelize[_0x2d4a('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 6db3fe5..bef8a05 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 _0x53eb=['nolimit','order','sort','filter','where','merge','VIRTUAL','OpenchannelMessage','includeAll','findAll','rows','show','include','options','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','user','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length'];(function(_0x5b45cd,_0x2c84f4){var _0x49a830=function(_0x614c40){while(--_0x614c40){_0x5b45cd['push'](_0x5b45cd['shift']());}};_0x49a830(++_0x2c84f4);}(_0x53eb,0x14b));var _0xb53e=function(_0x150949,_0x6fdad2){_0x150949=_0x150949-0x0;var _0x235e29=_0x53eb[_0x150949];return _0x235e29;};'use strict';var emlformat=require(_0xb53e('0x0'));var rimraf=require(_0xb53e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb53e('0x2'));var rp=require(_0xb53e('0x3'));var moment=require(_0xb53e('0x4'));var BPromise=require(_0xb53e('0x5'));var Mustache=require(_0xb53e('0x6'));var util=require(_0xb53e('0x7'));var path=require(_0xb53e('0x8'));var sox=require(_0xb53e('0x9'));var csv=require(_0xb53e('0xa'));var ejs=require(_0xb53e('0xb'));var fs=require('fs');var fs_extra=require(_0xb53e('0xc'));var _=require(_0xb53e('0xd'));var squel=require(_0xb53e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb53e('0xa'));var querystring=require(_0xb53e('0xf'));var Papa=require('papaparse');var Redis=require(_0xb53e('0x10'));var authService=require(_0xb53e('0x11'));var qs=require(_0xb53e('0x12'));var as=require(_0xb53e('0x13'));var hardwareService=require(_0xb53e('0x14'));var logger=require(_0xb53e('0x15'))(_0xb53e('0x16'));var utils=require(_0xb53e('0x17'));var config=require(_0xb53e('0x18'));var licenseUtil=require(_0xb53e('0x19'));var db=require(_0xb53e('0x1a'))['db'];config['redis']=_[_0xb53e('0x1b')](config[_0xb53e('0x1c')],{'host':_0xb53e('0x1d'),'port':0x18eb});var socket=require(_0xb53e('0x1e'))(new Redis(config[_0xb53e('0x1c')]));require(_0xb53e('0x1f'))[_0xb53e('0x20')](socket);var jayson=require(_0xb53e('0x21'));var client=jayson[_0xb53e('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xb53e('0x22')][_0xb53e('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5ac534,_0x1db3ac,_0x26785a,_0x3350cf){return new BPromise(function(_0x295620,_0x59bf4e){var _0x2830aa=_0x3350cf||client;return _0x2830aa[_0xb53e('0x24')](_0x5ac534,_0x26785a)[_0xb53e('0x25')](function(_0x2abf6f){logger[_0xb53e('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x1db3ac,'request\x20sent');logger[_0xb53e('0x27')](_0xb53e('0x28'),_0x1db3ac,_0xb53e('0x29'),JSON[_0xb53e('0x2a')](_0x2abf6f));if(_0x2abf6f[_0xb53e('0x2b')]){if(_0x2abf6f['error']['code']===0x1f4){logger[_0xb53e('0x2b')](_0xb53e('0x2c'),_0x1db3ac,_0x2abf6f[_0xb53e('0x2b')][_0xb53e('0x2d')]);return _0x59bf4e(_0x2abf6f[_0xb53e('0x2b')][_0xb53e('0x2d')]);}logger[_0xb53e('0x2b')]('OpenchannelMessage,\x20%s,\x20%s',_0x1db3ac,_0x2abf6f[_0xb53e('0x2b')][_0xb53e('0x2d')]);return _0x295620(_0x2abf6f['error'][_0xb53e('0x2d')]);}else{logger['info'](_0xb53e('0x2c'),_0x1db3ac,'request\x20sent');_0x295620(_0x2abf6f['result'][_0xb53e('0x2d')]);}})[_0xb53e('0x2e')](function(_0x5e3347){logger[_0xb53e('0x2b')](_0xb53e('0x2c'),_0x1db3ac,_0x5e3347);_0x59bf4e(_0x5e3347);});});}function respondWithStatusCode(_0x17e274,_0x5924c4){_0x5924c4=_0x5924c4||0xcc;return function(_0x22e5c4){if(_0x22e5c4){return _0x17e274[_0xb53e('0x2f')](_0x5924c4);}return _0x17e274[_0xb53e('0x30')](_0x5924c4)[_0xb53e('0x31')]();};}function respondWithResult(_0x50e35d,_0x55c066){_0x55c066=_0x55c066||0xc8;return function(_0xaa6a20){if(_0xaa6a20){return _0x50e35d['status'](_0x55c066)[_0xb53e('0x32')](_0xaa6a20);}};}function respondWithFilteredResult(_0x79fc3e,_0x5282de){return function(_0x26ac09){if(_0x26ac09){var _0x58317c=typeof _0x5282de['offset']===_0xb53e('0x33')&&typeof _0x5282de[_0xb53e('0x34')]===_0xb53e('0x33');var _0x39f3b4=_0x26ac09[_0xb53e('0x35')];var _0x1c9224=_0x58317c?0x0:_0x5282de[_0xb53e('0x36')];var _0x3ea349=_0x58317c?_0x26ac09[_0xb53e('0x35')]:_0x5282de[_0xb53e('0x36')]+_0x5282de[_0xb53e('0x34')];var _0x543ef2;if(_0x3ea349>=_0x39f3b4){_0x3ea349=_0x39f3b4;_0x543ef2=0xc8;}else{_0x543ef2=0xce;}_0x79fc3e[_0xb53e('0x30')](_0x543ef2);return _0x79fc3e[_0xb53e('0x37')](_0xb53e('0x38'),_0x1c9224+'-'+_0x3ea349+'/'+_0x39f3b4)[_0xb53e('0x32')](_0x26ac09);}return null;};}function patchUpdates(_0x423048){return function(_0x2c9f5f){try{jsonpatch[_0xb53e('0x39')](_0x2c9f5f,_0x423048,!![]);}catch(_0x44e16d){return BPromise['reject'](_0x44e16d);}return _0x2c9f5f[_0xb53e('0x3a')]();};}function saveUpdates(_0x5a4041,_0x4c1720){return function(_0x533b74){if(_0x533b74){return _0x533b74[_0xb53e('0x3b')](_0x5a4041)[_0xb53e('0x25')](function(_0x1faf3a){return _0x1faf3a;});}return null;};}function removeEntity(_0x48645c,_0x3f4f46){return function(_0x3c9752){if(_0x3c9752){return _0x3c9752['destroy']()[_0xb53e('0x25')](function(){_0x48645c[_0xb53e('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bdc7e,_0x17c532){return function(_0x225c63){if(!_0x225c63){_0x5bdc7e[_0xb53e('0x2f')](0x194);}return _0x225c63;};}function handleError(_0x55c79c,_0x46983a){_0x46983a=_0x46983a||0x1f4;return function(_0x191dc2){logger[_0xb53e('0x2b')](_0x191dc2[_0xb53e('0x3c')]);if(_0x191dc2[_0xb53e('0x3d')]){delete _0x191dc2['name'];}_0x55c79c[_0xb53e('0x30')](_0x46983a)[_0xb53e('0x3e')](_0x191dc2);};}exports[_0xb53e('0x3f')]=function(_0x3d996e,_0xbd1a7c){var _0x3cf0a2={},_0x338ca6={},_0x11b27d={'count':0x0,'rows':[]};var _0x23ca29=_['map'](db['OpenchannelMessage'][_0xb53e('0x40')],function(_0x2cca60){return{'name':_0x2cca60[_0xb53e('0x41')],'type':_0x2cca60[_0xb53e('0x42')][_0xb53e('0x43')]};});_0x338ca6['model']=_[_0xb53e('0x44')](_0x23ca29,_0xb53e('0x3d'));_0x338ca6[_0xb53e('0x45')]=_[_0xb53e('0x46')](_0x3d996e[_0xb53e('0x45')]);_0x338ca6[_0xb53e('0x47')]=_[_0xb53e('0x48')](_0x338ca6['model'],_0x338ca6[_0xb53e('0x45')]);_0x3cf0a2[_0xb53e('0x49')]=_['intersection'](_0x338ca6[_0xb53e('0x4a')],qs[_0xb53e('0x4b')](_0x3d996e[_0xb53e('0x45')][_0xb53e('0x4b')]));_0x3cf0a2[_0xb53e('0x49')]=_0x3cf0a2[_0xb53e('0x49')][_0xb53e('0x4c')]?_0x3cf0a2[_0xb53e('0x49')]:_0x338ca6[_0xb53e('0x4a')];if(!_0x3d996e[_0xb53e('0x45')]['hasOwnProperty'](_0xb53e('0x4d'))){_0x3cf0a2['limit']=qs[_0xb53e('0x34')](_0x3d996e['query'][_0xb53e('0x34')]);_0x3cf0a2['offset']=qs[_0xb53e('0x36')](_0x3d996e[_0xb53e('0x45')][_0xb53e('0x36')]);}_0x3cf0a2[_0xb53e('0x4e')]=qs[_0xb53e('0x4f')](_0x3d996e[_0xb53e('0x45')]['sort']);_0x3cf0a2['where']=qs[_0xb53e('0x47')](_['pick'](_0x3d996e[_0xb53e('0x45')],_0x338ca6[_0xb53e('0x47')]),_0x23ca29);if(_0x3d996e[_0xb53e('0x45')][_0xb53e('0x50')]){_0x3cf0a2[_0xb53e('0x51')]=_[_0xb53e('0x52')](_0x3cf0a2[_0xb53e('0x51')],{'$or':_['map'](_0x23ca29,function(_0x58be8a){if(_0x58be8a['type']!==_0xb53e('0x53')){var _0x5bb3bd={};_0x5bb3bd[_0x58be8a['name']]={'$like':'%'+_0x3d996e[_0xb53e('0x45')]['filter']+'%'};return _0x5bb3bd;}})});}_0x3cf0a2=_[_0xb53e('0x52')]({},_0x3cf0a2,_0x3d996e['options']);var _0x16e192={'where':_0x3cf0a2[_0xb53e('0x51')]};return db[_0xb53e('0x54')]['count'](_0x16e192)[_0xb53e('0x25')](function(_0x22bc5f){_0x11b27d[_0xb53e('0x35')]=_0x22bc5f;if(_0x3d996e[_0xb53e('0x45')][_0xb53e('0x55')]){_0x3cf0a2['include']=[{'all':!![]}];}return db[_0xb53e('0x54')][_0xb53e('0x56')](_0x3cf0a2);})[_0xb53e('0x25')](function(_0x1f6295){_0x11b27d[_0xb53e('0x57')]=_0x1f6295;return _0x11b27d;})[_0xb53e('0x25')](respondWithFilteredResult(_0xbd1a7c,_0x3cf0a2))[_0xb53e('0x2e')](handleError(_0xbd1a7c,null));};exports[_0xb53e('0x58')]=function(_0x3edee8,_0x198d9a){var _0x12ed5b={'raw':!![],'where':{'id':_0x3edee8['params']['id']}},_0x542bc3={};_0x542bc3['model']=_[_0xb53e('0x46')](db[_0xb53e('0x54')][_0xb53e('0x40')]);_0x542bc3['query']=_[_0xb53e('0x46')](_0x3edee8[_0xb53e('0x45')]);_0x542bc3['filters']=_[_0xb53e('0x48')](_0x542bc3[_0xb53e('0x4a')],_0x542bc3['query']);_0x12ed5b[_0xb53e('0x49')]=_[_0xb53e('0x48')](_0x542bc3['model'],qs[_0xb53e('0x4b')](_0x3edee8[_0xb53e('0x45')][_0xb53e('0x4b')]));_0x12ed5b[_0xb53e('0x49')]=_0x12ed5b[_0xb53e('0x49')][_0xb53e('0x4c')]?_0x12ed5b['attributes']:_0x542bc3[_0xb53e('0x4a')];if(_0x3edee8[_0xb53e('0x45')]['includeAll']){_0x12ed5b[_0xb53e('0x59')]=[{'all':!![]}];}_0x12ed5b=_['merge']({},_0x12ed5b,_0x3edee8[_0xb53e('0x5a')]);return db[_0xb53e('0x54')][_0xb53e('0x5b')](_0x12ed5b)[_0xb53e('0x25')](handleEntityNotFound(_0x198d9a,null))[_0xb53e('0x25')](respondWithResult(_0x198d9a,null))[_0xb53e('0x2e')](handleError(_0x198d9a,null));};exports['create']=function(_0x258ac6,_0x538784){return db['OpenchannelMessage'][_0xb53e('0x5c')](_0x258ac6[_0xb53e('0x5d')],{})[_0xb53e('0x25')](respondWithResult(_0x538784,0xc9))['catch'](handleError(_0x538784,null));};exports[_0xb53e('0x3b')]=function(_0x33a5dd,_0x25c233){if(_0x33a5dd['body']['id']){delete _0x33a5dd[_0xb53e('0x5d')]['id'];}return db[_0xb53e('0x54')][_0xb53e('0x5b')]({'where':{'id':_0x33a5dd[_0xb53e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25c233,null))[_0xb53e('0x25')](saveUpdates(_0x33a5dd['body'],null))[_0xb53e('0x25')](respondWithResult(_0x25c233,null))['catch'](handleError(_0x25c233,null));};exports['destroy']=function(_0x1fe108,_0x5091b7){return db[_0xb53e('0x54')]['find']({'where':{'id':_0x1fe108['params']['id']}})[_0xb53e('0x25')](handleEntityNotFound(_0x5091b7,null))['then'](removeEntity(_0x5091b7,null))[_0xb53e('0x2e')](handleError(_0x5091b7,null));};exports[_0xb53e('0x5f')]=function(_0x58e7b4,_0x3f151b){return db[_0xb53e('0x54')][_0xb53e('0x5f')]()[_0xb53e('0x25')](respondWithResult(_0x3f151b,null))['catch'](handleError(_0x3f151b,null));};var interaction_log=require('../../config/logger')(_0xb53e('0x60'));exports[_0xb53e('0x61')]=function(_0x268807,_0x15ce5b,_0x45adb4){var _0x1db76b={'agent':{},'channel':_0xb53e('0x62')};if(_0x268807[_0xb53e('0x5d')]['id']){delete _0x268807['body']['id'];}_0x268807['body'][_0xb53e('0x63')]=!![];_0x268807['body'][_0xb53e('0x64')]=moment()[_0xb53e('0x65')](_0xb53e('0x66'));_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')]=_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')]||_0x268807['user']['id'];_0x1db76b['agent']['id']=_0x268807[_0xb53e('0x5d')]['UserId'];return db['OpenchannelMessage'][_0xb53e('0x5b')]({'where':{'id':_0x268807['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x15ce5b,null))[_0xb53e('0x25')](saveUpdates(_0x268807[_0xb53e('0x5d')],null))['then'](function(_0x47a4f0){if(_0x47a4f0){_0x1db76b[_0xb53e('0x2d')]=_0x47a4f0[_0xb53e('0x68')]({'plain':!![]});return db[_0xb53e('0x69')]['find']({'where':{'id':_0x47a4f0[_0xb53e('0x6a')]}});}return null;})[_0xb53e('0x25')](handleEntityNotFound(_0x15ce5b,null))[_0xb53e('0x25')](function(_0x10cc44){if(_0x10cc44){return _0x10cc44[_0xb53e('0x3b')]({'UserId':_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')],'read1stAt':_['isNil'](_0x10cc44[_0xb53e('0x6b')])?moment()['format'](_0xb53e('0x66')):undefined});}return null;})[_0xb53e('0x25')](function(_0x23315f){if(_0x23315f){_0x1db76b['interaction']=_0x23315f[_0xb53e('0x68')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x268807[_0xb53e('0x6c')]['id'],_0x268807[_0xb53e('0x6c')][_0xb53e('0x3d')],_0x268807['user']['role'],_0x1db76b[_0xb53e('0x6d')]['id'],_0x268807[_0xb53e('0x5d')]?JSON['stringify'](_0x268807[_0xb53e('0x5d')]):_0xb53e('0x6e'));return respondWithRpcPromise(_0xb53e('0x6f'),'acceptMessage',_0x1db76b);}return null;})['then'](function(_0x302b5b){var _0x494369=_0xb53e('0x70')+_0x302b5b['message'][_0xb53e('0x71')];return db[_0xb53e('0x72')][_0xb53e('0x45')](_0x494369,{'type':db[_0xb53e('0x73')][_0xb53e('0x74')]['SELECT'],'raw':!![]})[_0xb53e('0x25')](function(_0x2c3b16){return _0x2c3b16;});})[_0xb53e('0x25')](function(_0x19eb82){if(_0x19eb82){_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x75')]=_0x19eb82[0x0];if(!_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')])return;return db[_0xb53e('0x76')]['find']({'where':{'id':_0x268807[_0xb53e('0x5d')][_0xb53e('0x67')],'role':_0xb53e('0x77')},'attributes':['id',_0xb53e('0x3d'),_0xb53e('0x78'),_0xb53e('0x79'),_0xb53e('0x7a')],'raw':!![]});}return null;})[_0xb53e('0x25')](function(_0x41123b){if(!_0x41123b)return null;_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x77')]=_0x41123b;return _0x1db76b;})['then'](function(_0x397b56){if(_0x397b56){if(_0x268807[_0xb53e('0x5d')][_0xb53e('0x7b')]){_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x7c')]=util['format'](_0xb53e('0x7d'),_0x268807[_0xb53e('0x6c')][_0xb53e('0x3d')]);_0x1db76b['message'][_0xb53e('0x7e')]=_0x1db76b[_0xb53e('0x7e')];_0x1db76b[_0xb53e('0x2d')]['motionChannel']=_0x1db76b[_0xb53e('0x7e')];_0x1db76b[_0xb53e('0x2d')][_0xb53e('0x7f')]='accept';return respondWithRpcPromise(_0xb53e('0x80'),_0xb53e('0x80'),{'event':_0xb53e('0x81'),'message':_0x1db76b[_0xb53e('0x2d')]},client9002)[_0xb53e('0x25')](function(){return _0x1db76b;});}return _0x1db76b;}return null;})['then'](respondWithResult(_0x15ce5b,null))['catch'](handleError(_0x15ce5b,null));};var interaction_log=require('../../config/logger')(_0xb53e('0x60'));exports[_0xb53e('0x82')]=function(_0x5baaff,_0x9516d2,_0x550832){var _0x5e8e76={'agent':{},'channel':_0xb53e('0x62')};if(_0x5baaff[_0xb53e('0x5d')]['id']){delete _0x5baaff['body']['id'];}_0x5baaff[_0xb53e('0x5d')][_0xb53e('0x67')]=_0x5baaff[_0xb53e('0x5d')][_0xb53e('0x67')]||_0x5baaff[_0xb53e('0x6c')]['id'];_0x5e8e76[_0xb53e('0x77')]['id']=_0x5baaff[_0xb53e('0x5d')][_0xb53e('0x67')];return db[_0xb53e('0x54')][_0xb53e('0x5b')]({'where':{'id':_0x5baaff[_0xb53e('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x9516d2,null))['then'](function(_0xf60962){if(_0xf60962){_0x5e8e76[_0xb53e('0x2d')]=_0xf60962[_0xb53e('0x68')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb53e('0x5b')]({'where':{'id':_0xf60962[_0xb53e('0x6a')]}});}return null;})[_0xb53e('0x25')](handleEntityNotFound(_0x9516d2,null))[_0xb53e('0x25')](function(_0x504c41){if(_0x504c41){_0x5e8e76[_0xb53e('0x6d')]=_0x504c41[_0xb53e('0x68')]({'plain':!![]});interaction_log[_0xb53e('0x26')](_0xb53e('0x83'),_0x5baaff['user']['id'],_0x5baaff[_0xb53e('0x6c')][_0xb53e('0x3d')],_0x5baaff['user'][_0xb53e('0x84')],_0x5e8e76[_0xb53e('0x6d')]['id'],_0x5baaff[_0xb53e('0x5d')]?JSON[_0xb53e('0x2a')](_0x5baaff[_0xb53e('0x5d')]):_0xb53e('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5e8e76);}return null;})[_0xb53e('0x25')](function(_0x5a7ab6){var _0x3c8e04=_0xb53e('0x70')+_0x5a7ab6['message'][_0xb53e('0x71')];return db['sequelize'][_0xb53e('0x45')](_0x3c8e04,{'type':db[_0xb53e('0x73')]['QueryTypes'][_0xb53e('0x85')],'raw':!![]})[_0xb53e('0x25')](function(_0x4e33d6){return _0x4e33d6;});})[_0xb53e('0x25')](function(_0x2ff3da){if(_0x2ff3da){_0x5e8e76['message'][_0xb53e('0x75')]=_0x2ff3da[0x0];if(!_0x5baaff[_0xb53e('0x5d')]['UserId'])return;return db[_0xb53e('0x76')][_0xb53e('0x5b')]({'where':{'id':_0x5baaff[_0xb53e('0x5d')]['UserId'],'role':_0xb53e('0x77')},'attributes':['id',_0xb53e('0x3d'),'fullname',_0xb53e('0x79'),_0xb53e('0x7a')],'raw':!![]});}return null;})['then'](function(_0x5e4d28){if(!_0x5e4d28)return null;_0x5e8e76[_0xb53e('0x2d')][_0xb53e('0x77')]=_0x5e4d28;return _0x5e8e76;})[_0xb53e('0x25')](function(_0x62f2c3){if(_0x62f2c3){_0x62f2c3[_0xb53e('0x2d')][_0xb53e('0x7c')]=util[_0xb53e('0x65')](_0xb53e('0x7d'),_0x5baaff[_0xb53e('0x6c')][_0xb53e('0x3d')]);_0x62f2c3['message'][_0xb53e('0x7e')]=_0x5e8e76[_0xb53e('0x7e')];_0x62f2c3[_0xb53e('0x2d')][_0xb53e('0x86')]=_0x5e8e76[_0xb53e('0x7e')];_0x62f2c3['message'][_0xb53e('0x7f')]='reject';respondWithRpcPromise(_0xb53e('0x80'),_0xb53e('0x80'),{'event':_0xb53e('0x87'),'message':_0x62f2c3[_0xb53e('0x2d')]},client9002);return _0x5e8e76;}return null;})[_0xb53e('0x25')](respondWithResult(_0x9516d2,null))[_0xb53e('0x2e')](handleError(_0x9516d2,null));}; \ No newline at end of file +var _0xe27b=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','describe','openchannel-interactions','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','User','internal','SIP/%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xe27b,0xf9));var _0xbe27=function(_0x545b01,_0x2e66bf){_0x545b01=_0x545b01-0x0;var _0x1a1dd6=_0xe27b[_0x545b01];return _0x1a1dd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe27('0x0'));var zipdir=require(_0xbe27('0x1'));var jsonpatch=require(_0xbe27('0x2'));var rp=require(_0xbe27('0x3'));var moment=require(_0xbe27('0x4'));var BPromise=require(_0xbe27('0x5'));var Mustache=require('mustache');var util=require(_0xbe27('0x6'));var path=require(_0xbe27('0x7'));var sox=require(_0xbe27('0x8'));var csv=require('to-csv');var ejs=require(_0xbe27('0x9'));var fs=require('fs');var fs_extra=require(_0xbe27('0xa'));var _=require(_0xbe27('0xb'));var squel=require(_0xbe27('0xc'));var crypto=require(_0xbe27('0xd'));var jsforce=require(_0xbe27('0xe'));var deskjs=require(_0xbe27('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbe27('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe27('0x11'));var authService=require(_0xbe27('0x12'));var qs=require(_0xbe27('0x13'));var as=require(_0xbe27('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe27('0x15'))(_0xbe27('0x16'));var utils=require('../../config/utils');var config=require(_0xbe27('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbe27('0x18')]=_['defaults'](config[_0xbe27('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe27('0x18')]));require('./openchannelMessage.socket')[_0xbe27('0x19')](socket);var jayson=require(_0xbe27('0x1a'));var client=jayson[_0xbe27('0x1b')][_0xbe27('0x1c')]({'port':0x232c});var client9002=jayson[_0xbe27('0x1b')][_0xbe27('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x456128,_0x3e6b2d,_0x124aed,_0x16ffa0){return new BPromise(function(_0x362ec0,_0x244486){var _0x420a0e=_0x16ffa0||client;return _0x420a0e[_0xbe27('0x1d')](_0x456128,_0x124aed)[_0xbe27('0x1e')](function(_0x3ed77e){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3e6b2d,_0xbe27('0x1f'));logger[_0xbe27('0x20')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3e6b2d,_0xbe27('0x1f'),JSON[_0xbe27('0x21')](_0x3ed77e));if(_0x3ed77e[_0xbe27('0x22')]){if(_0x3ed77e['error'][_0xbe27('0x23')]===0x1f4){logger[_0xbe27('0x22')](_0xbe27('0x24'),_0x3e6b2d,_0x3ed77e[_0xbe27('0x22')][_0xbe27('0x25')]);return _0x244486(_0x3ed77e[_0xbe27('0x22')]['message']);}logger['error'](_0xbe27('0x24'),_0x3e6b2d,_0x3ed77e[_0xbe27('0x22')][_0xbe27('0x25')]);return _0x362ec0(_0x3ed77e[_0xbe27('0x22')][_0xbe27('0x25')]);}else{logger[_0xbe27('0x26')](_0xbe27('0x24'),_0x3e6b2d,_0xbe27('0x1f'));_0x362ec0(_0x3ed77e[_0xbe27('0x27')]['message']);}})[_0xbe27('0x28')](function(_0xa43431){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3e6b2d,_0xa43431);_0x244486(_0xa43431);});});}function respondWithStatusCode(_0x397a8c,_0x2e4521){_0x2e4521=_0x2e4521||0xcc;return function(_0x59ffc0){if(_0x59ffc0){return _0x397a8c[_0xbe27('0x29')](_0x2e4521);}return _0x397a8c[_0xbe27('0x2a')](_0x2e4521)['end']();};}function respondWithResult(_0x32532d,_0x4cd3bc){_0x4cd3bc=_0x4cd3bc||0xc8;return function(_0x43cca5){if(_0x43cca5){return _0x32532d[_0xbe27('0x2a')](_0x4cd3bc)[_0xbe27('0x2b')](_0x43cca5);}};}function respondWithFilteredResult(_0x2aa1a3,_0x2397e6){return function(_0x14bc1c){if(_0x14bc1c){var _0xa9266f=typeof _0x2397e6[_0xbe27('0x2c')]===_0xbe27('0x2d')&&typeof _0x2397e6[_0xbe27('0x2e')]===_0xbe27('0x2d');var _0x593e70=_0x14bc1c['count'];var _0x3158fd=_0xa9266f?0x0:_0x2397e6['offset'];var _0x132dfa=_0xa9266f?_0x14bc1c[_0xbe27('0x2f')]:_0x2397e6[_0xbe27('0x2c')]+_0x2397e6[_0xbe27('0x2e')];var _0x3506de;if(_0x132dfa>=_0x593e70){_0x132dfa=_0x593e70;_0x3506de=0xc8;}else{_0x3506de=0xce;}_0x2aa1a3[_0xbe27('0x2a')](_0x3506de);return _0x2aa1a3[_0xbe27('0x30')]('Content-Range',_0x3158fd+'-'+_0x132dfa+'/'+_0x593e70)[_0xbe27('0x2b')](_0x14bc1c);}return null;};}function patchUpdates(_0x2b1f06){return function(_0x44228d){try{jsonpatch['apply'](_0x44228d,_0x2b1f06,!![]);}catch(_0xeb3284){return BPromise[_0xbe27('0x31')](_0xeb3284);}return _0x44228d[_0xbe27('0x32')]();};}function saveUpdates(_0x65a7d1,_0x5d4eab){return function(_0x5b17b5){if(_0x5b17b5){return _0x5b17b5['update'](_0x65a7d1)['then'](function(_0x40cb7a){return _0x40cb7a;});}return null;};}function removeEntity(_0x4a0b25,_0xa5c040){return function(_0x381f64){if(_0x381f64){return _0x381f64[_0xbe27('0x33')]()[_0xbe27('0x1e')](function(){_0x4a0b25[_0xbe27('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35634b,_0x1cb2e5){return function(_0x53042f){if(!_0x53042f){_0x35634b[_0xbe27('0x29')](0x194);}return _0x53042f;};}function handleError(_0x13811f,_0x2651b8){_0x2651b8=_0x2651b8||0x1f4;return function(_0x30670b){logger[_0xbe27('0x22')](_0x30670b[_0xbe27('0x34')]);if(_0x30670b[_0xbe27('0x35')]){delete _0x30670b[_0xbe27('0x35')];}_0x13811f['status'](_0x2651b8)[_0xbe27('0x36')](_0x30670b);};}exports[_0xbe27('0x37')]=function(_0x3437d3,_0x32569a){var _0x187257={},_0x4e144e={},_0xd6a389={'count':0x0,'rows':[]};var _0x5d5f51=_[_0xbe27('0x38')](db[_0xbe27('0x39')]['rawAttributes'],function(_0x3d847d){return{'name':_0x3d847d[_0xbe27('0x3a')],'type':_0x3d847d[_0xbe27('0x3b')][_0xbe27('0x3c')]};});_0x4e144e[_0xbe27('0x3d')]=_['map'](_0x5d5f51,_0xbe27('0x35'));_0x4e144e['query']=_[_0xbe27('0x3e')](_0x3437d3[_0xbe27('0x3f')]);_0x4e144e[_0xbe27('0x40')]=_[_0xbe27('0x41')](_0x4e144e[_0xbe27('0x3d')],_0x4e144e['query']);_0x187257[_0xbe27('0x42')]=_['intersection'](_0x4e144e['model'],qs[_0xbe27('0x43')](_0x3437d3[_0xbe27('0x3f')][_0xbe27('0x43')]));_0x187257[_0xbe27('0x42')]=_0x187257[_0xbe27('0x42')][_0xbe27('0x44')]?_0x187257[_0xbe27('0x42')]:_0x4e144e[_0xbe27('0x3d')];if(!_0x3437d3['query'][_0xbe27('0x45')](_0xbe27('0x46'))){_0x187257[_0xbe27('0x2e')]=qs[_0xbe27('0x2e')](_0x3437d3['query']['limit']);_0x187257['offset']=qs['offset'](_0x3437d3[_0xbe27('0x3f')][_0xbe27('0x2c')]);}_0x187257[_0xbe27('0x47')]=qs[_0xbe27('0x48')](_0x3437d3[_0xbe27('0x3f')][_0xbe27('0x48')]);_0x187257[_0xbe27('0x49')]=qs['filters'](_['pick'](_0x3437d3[_0xbe27('0x3f')],_0x4e144e['filters']),_0x5d5f51);if(_0x3437d3['query'][_0xbe27('0x4a')]){_0x187257[_0xbe27('0x49')]=_[_0xbe27('0x4b')](_0x187257[_0xbe27('0x49')],{'$or':_[_0xbe27('0x38')](_0x5d5f51,function(_0x4153c4){if(_0x4153c4[_0xbe27('0x3b')]!==_0xbe27('0x4c')){var _0x31b273={};_0x31b273[_0x4153c4['name']]={'$like':'%'+_0x3437d3['query'][_0xbe27('0x4a')]+'%'};return _0x31b273;}})});}_0x187257=_[_0xbe27('0x4b')]({},_0x187257,_0x3437d3[_0xbe27('0x4d')]);var _0x38daa7={'where':_0x187257[_0xbe27('0x49')]};return db[_0xbe27('0x39')]['count'](_0x38daa7)[_0xbe27('0x1e')](function(_0x42f053){_0xd6a389[_0xbe27('0x2f')]=_0x42f053;if(_0x3437d3['query'][_0xbe27('0x4e')]){_0x187257[_0xbe27('0x4f')]=[{'all':!![]}];}return db[_0xbe27('0x39')][_0xbe27('0x50')](_0x187257);})[_0xbe27('0x1e')](function(_0x4bf1b3){_0xd6a389[_0xbe27('0x51')]=_0x4bf1b3;return _0xd6a389;})[_0xbe27('0x1e')](respondWithFilteredResult(_0x32569a,_0x187257))[_0xbe27('0x28')](handleError(_0x32569a,null));};exports['show']=function(_0x44c120,_0x3046ea){var _0x57dd97={'raw':!![],'where':{'id':_0x44c120[_0xbe27('0x52')]['id']}},_0x18e0b4={};_0x18e0b4[_0xbe27('0x3d')]=_[_0xbe27('0x3e')](db['OpenchannelMessage'][_0xbe27('0x53')]);_0x18e0b4[_0xbe27('0x3f')]=_[_0xbe27('0x3e')](_0x44c120[_0xbe27('0x3f')]);_0x18e0b4['filters']=_[_0xbe27('0x41')](_0x18e0b4[_0xbe27('0x3d')],_0x18e0b4[_0xbe27('0x3f')]);_0x57dd97['attributes']=_[_0xbe27('0x41')](_0x18e0b4[_0xbe27('0x3d')],qs[_0xbe27('0x43')](_0x44c120[_0xbe27('0x3f')][_0xbe27('0x43')]));_0x57dd97[_0xbe27('0x42')]=_0x57dd97[_0xbe27('0x42')][_0xbe27('0x44')]?_0x57dd97[_0xbe27('0x42')]:_0x18e0b4[_0xbe27('0x3d')];if(_0x44c120[_0xbe27('0x3f')][_0xbe27('0x4e')]){_0x57dd97[_0xbe27('0x4f')]=[{'all':!![]}];}_0x57dd97=_[_0xbe27('0x4b')]({},_0x57dd97,_0x44c120[_0xbe27('0x4d')]);return db[_0xbe27('0x39')][_0xbe27('0x54')](_0x57dd97)['then'](handleEntityNotFound(_0x3046ea,null))[_0xbe27('0x1e')](respondWithResult(_0x3046ea,null))[_0xbe27('0x28')](handleError(_0x3046ea,null));};exports['create']=function(_0x5c3619,_0x5ae182){return db['OpenchannelMessage'][_0xbe27('0x55')](_0x5c3619[_0xbe27('0x56')],{})[_0xbe27('0x1e')](respondWithResult(_0x5ae182,0xc9))[_0xbe27('0x28')](handleError(_0x5ae182,null));};exports['update']=function(_0x4fe0b8,_0xe19252){if(_0x4fe0b8[_0xbe27('0x56')]['id']){delete _0x4fe0b8['body']['id'];}return db[_0xbe27('0x39')][_0xbe27('0x54')]({'where':{'id':_0x4fe0b8[_0xbe27('0x52')]['id']}})[_0xbe27('0x1e')](handleEntityNotFound(_0xe19252,null))[_0xbe27('0x1e')](saveUpdates(_0x4fe0b8['body'],null))['then'](respondWithResult(_0xe19252,null))[_0xbe27('0x28')](handleError(_0xe19252,null));};exports[_0xbe27('0x33')]=function(_0x4cea66,_0x828193){return db[_0xbe27('0x39')][_0xbe27('0x54')]({'where':{'id':_0x4cea66[_0xbe27('0x52')]['id']}})[_0xbe27('0x1e')](handleEntityNotFound(_0x828193,null))[_0xbe27('0x1e')](removeEntity(_0x828193,null))[_0xbe27('0x28')](handleError(_0x828193,null));};exports[_0xbe27('0x57')]=function(_0x1c8571,_0x457281){return db['OpenchannelMessage'][_0xbe27('0x57')]()[_0xbe27('0x1e')](respondWithResult(_0x457281,null))['catch'](handleError(_0x457281,null));};var interaction_log=require(_0xbe27('0x15'))(_0xbe27('0x58'));exports[_0xbe27('0x59')]=function(_0x12fba6,_0x542d52,_0x539146){var _0x447dcb={'agent':{},'channel':_0xbe27('0x5a')};if(_0x12fba6[_0xbe27('0x56')]['id']){delete _0x12fba6[_0xbe27('0x56')]['id'];}_0x12fba6[_0xbe27('0x56')][_0xbe27('0x5b')]=!![];_0x12fba6['body']['readAt']=moment()['format'](_0xbe27('0x5c'));_0x12fba6['body'][_0xbe27('0x5d')]=_0x12fba6[_0xbe27('0x56')][_0xbe27('0x5d')]||_0x12fba6[_0xbe27('0x5e')]['id'];_0x447dcb[_0xbe27('0x5f')]['id']=_0x12fba6[_0xbe27('0x56')][_0xbe27('0x5d')];return db[_0xbe27('0x39')][_0xbe27('0x54')]({'where':{'id':_0x12fba6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x542d52,null))['then'](saveUpdates(_0x12fba6[_0xbe27('0x56')],null))[_0xbe27('0x1e')](function(_0x593574){if(_0x593574){_0x447dcb[_0xbe27('0x25')]=_0x593574[_0xbe27('0x60')]({'plain':!![]});return db[_0xbe27('0x61')][_0xbe27('0x54')]({'where':{'id':_0x593574['OpenchannelInteractionId']}});}return null;})[_0xbe27('0x1e')](handleEntityNotFound(_0x542d52,null))['then'](function(_0x9daafe){if(_0x9daafe){return _0x9daafe['update']({'UserId':_0x12fba6['body'][_0xbe27('0x5d')],'read1stAt':_[_0xbe27('0x62')](_0x9daafe[_0xbe27('0x63')])?moment()[_0xbe27('0x64')](_0xbe27('0x5c')):undefined});}return null;})['then'](function(_0x332a06){if(_0x332a06){_0x447dcb[_0xbe27('0x65')]=_0x332a06[_0xbe27('0x60')]({'plain':!![]});interaction_log[_0xbe27('0x26')](_0xbe27('0x66'),_0x12fba6[_0xbe27('0x5e')]['id'],_0x12fba6[_0xbe27('0x5e')][_0xbe27('0x35')],_0x12fba6[_0xbe27('0x5e')]['role'],_0x447dcb[_0xbe27('0x65')]['id'],_0x12fba6['body']?JSON[_0xbe27('0x21')](_0x12fba6[_0xbe27('0x56')]):_0xbe27('0x67'));return respondWithRpcPromise(_0xbe27('0x68'),_0xbe27('0x69'),_0x447dcb);}return null;})['then'](function(_0x22dda2){var _0x2b60f1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x22dda2[_0xbe27('0x25')][_0xbe27('0x6a')];return db['sequelize'][_0xbe27('0x3f')](_0x2b60f1,{'type':db[_0xbe27('0x6b')][_0xbe27('0x6c')][_0xbe27('0x6d')],'raw':!![]})[_0xbe27('0x1e')](function(_0x289167){return _0x289167;});})[_0xbe27('0x1e')](function(_0x834ca3){if(_0x834ca3){_0x447dcb['message'][_0xbe27('0x6e')]=_0x834ca3[0x0];if(!_0x12fba6['body'][_0xbe27('0x5d')])return;return db['User'][_0xbe27('0x54')]({'where':{'id':_0x12fba6[_0xbe27('0x56')][_0xbe27('0x5d')],'role':_0xbe27('0x5f')},'attributes':['id',_0xbe27('0x35'),_0xbe27('0x6f'),_0xbe27('0x70'),'internal'],'raw':!![]});}return null;})[_0xbe27('0x1e')](function(_0x3da0c0){if(!_0x3da0c0)return null;_0x447dcb['message'][_0xbe27('0x5f')]=_0x3da0c0;return _0x447dcb;})[_0xbe27('0x1e')](function(_0x2d02a0){if(_0x2d02a0){if(_0x12fba6[_0xbe27('0x56')]['manual']){_0x447dcb[_0xbe27('0x25')][_0xbe27('0x71')]=util[_0xbe27('0x64')]('SIP/%s',_0x12fba6[_0xbe27('0x5e')]['name']);_0x447dcb[_0xbe27('0x25')]['channel']=_0x447dcb[_0xbe27('0x72')];_0x447dcb['message'][_0xbe27('0x73')]=_0x447dcb[_0xbe27('0x72')];_0x447dcb['message'][_0xbe27('0x74')]=_0xbe27('0x59');return respondWithRpcPromise(_0xbe27('0x75'),'EventManager',{'event':_0xbe27('0x76'),'message':_0x447dcb[_0xbe27('0x25')]},client9002)[_0xbe27('0x1e')](function(){return _0x447dcb;});}return _0x447dcb;}return null;})[_0xbe27('0x1e')](respondWithResult(_0x542d52,null))[_0xbe27('0x28')](handleError(_0x542d52,null));};var interaction_log=require(_0xbe27('0x15'))('openchannel-interactions');exports[_0xbe27('0x31')]=function(_0x4c2067,_0x18eb68,_0x1cc029){var _0x3e10a4={'agent':{},'channel':_0xbe27('0x5a')};if(_0x4c2067[_0xbe27('0x56')]['id']){delete _0x4c2067['body']['id'];}_0x4c2067[_0xbe27('0x56')][_0xbe27('0x5d')]=_0x4c2067[_0xbe27('0x56')][_0xbe27('0x5d')]||_0x4c2067['user']['id'];_0x3e10a4[_0xbe27('0x5f')]['id']=_0x4c2067[_0xbe27('0x56')]['UserId'];return db[_0xbe27('0x39')]['find']({'where':{'id':_0x4c2067['params']['id'],'UserId':null}})[_0xbe27('0x1e')](handleEntityNotFound(_0x18eb68,null))['then'](function(_0x5dccb5){if(_0x5dccb5){_0x3e10a4[_0xbe27('0x25')]=_0x5dccb5[_0xbe27('0x60')]({'plain':!![]});return db[_0xbe27('0x61')]['find']({'where':{'id':_0x5dccb5[_0xbe27('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x18eb68,null))[_0xbe27('0x1e')](function(_0x51399c){if(_0x51399c){_0x3e10a4[_0xbe27('0x65')]=_0x51399c[_0xbe27('0x60')]({'plain':!![]});interaction_log[_0xbe27('0x26')](_0xbe27('0x78'),_0x4c2067[_0xbe27('0x5e')]['id'],_0x4c2067[_0xbe27('0x5e')][_0xbe27('0x35')],_0x4c2067[_0xbe27('0x5e')][_0xbe27('0x79')],_0x3e10a4[_0xbe27('0x65')]['id'],_0x4c2067['body']?JSON[_0xbe27('0x21')](_0x4c2067[_0xbe27('0x56')]):_0xbe27('0x67'));return respondWithRpcPromise(_0xbe27('0x7a'),_0xbe27('0x7b'),_0x3e10a4);}return null;})[_0xbe27('0x1e')](function(_0x354034){var _0x11ace7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x354034[_0xbe27('0x25')][_0xbe27('0x6a')];return db[_0xbe27('0x7c')][_0xbe27('0x3f')](_0x11ace7,{'type':db['Sequelize'][_0xbe27('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x23dfe8){return _0x23dfe8;});})[_0xbe27('0x1e')](function(_0x3aa0ed){if(_0x3aa0ed){_0x3e10a4[_0xbe27('0x25')]['contact']=_0x3aa0ed[0x0];if(!_0x4c2067['body']['UserId'])return;return db[_0xbe27('0x7d')]['find']({'where':{'id':_0x4c2067[_0xbe27('0x56')][_0xbe27('0x5d')],'role':_0xbe27('0x5f')},'attributes':['id',_0xbe27('0x35'),'fullname','email',_0xbe27('0x7e')],'raw':!![]});}return null;})[_0xbe27('0x1e')](function(_0x15785c){if(!_0x15785c)return null;_0x3e10a4[_0xbe27('0x25')][_0xbe27('0x5f')]=_0x15785c;return _0x3e10a4;})[_0xbe27('0x1e')](function(_0x4d7f3c){if(_0x4d7f3c){_0x4d7f3c[_0xbe27('0x25')][_0xbe27('0x71')]=util[_0xbe27('0x64')](_0xbe27('0x7f'),_0x4c2067[_0xbe27('0x5e')]['name']);_0x4d7f3c['message'][_0xbe27('0x72')]=_0x3e10a4[_0xbe27('0x72')];_0x4d7f3c[_0xbe27('0x25')]['motionChannel']=_0x3e10a4[_0xbe27('0x72')];_0x4d7f3c[_0xbe27('0x25')][_0xbe27('0x74')]='reject';respondWithRpcPromise(_0xbe27('0x75'),_0xbe27('0x75'),{'event':'rejectmessage','message':_0x4d7f3c[_0xbe27('0x25')]},client9002);return _0x3e10a4;}return null;})['then'](respondWithResult(_0x18eb68,null))[_0xbe27('0x28')](handleError(_0x18eb68,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c05d19c..c7083d1 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 _0x3ad5=['setMaxListeners','save','update','emit','events','OpenchannelMessage'];(function(_0x235636,_0x432467){var _0x48c727=function(_0x3b57de){while(--_0x3b57de){_0x235636['push'](_0x235636['shift']());}};_0x48c727(++_0x432467);}(_0x3ad5,0x130));var _0x53ad=function(_0x3b91c2,_0x100920){_0x3b91c2=_0x3b91c2-0x0;var _0x49ef2f=_0x3ad5[_0x3b91c2];return _0x49ef2f;};'use strict';var EventEmitter=require(_0x53ad('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x53ad('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x53ad('0x2')](0x0);var events={'afterCreate':_0x53ad('0x3'),'afterUpdate':_0x53ad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ca27c){return function(_0x53c5f6,_0x5f28c3,_0x2b23fe){OpenchannelMessageEvents[_0x53ad('0x5')](_0x1ca27c+':'+_0x53c5f6['id'],_0x53c5f6);OpenchannelMessageEvents[_0x53ad('0x5')](_0x1ca27c,_0x53c5f6);_0x2b23fe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x2aec=['OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x2aec,0x187));var _0xc2ae=function(_0x588c40,_0x254367){_0x588c40=_0x588c40-0x0;var _0x5016ad=_0x2aec[_0x588c40];return _0x5016ad;};'use strict';var EventEmitter=require(_0xc2ae('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xc2ae('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc2ae('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc2ae('0x3'),'afterDestroy':_0xc2ae('0x4')};function emitEvent(_0x52cb5b){return function(_0x916ee2,_0x548536,_0x36da1d){OpenchannelMessageEvents['emit'](_0x52cb5b+':'+_0x916ee2['id'],_0x916ee2);OpenchannelMessageEvents[_0xc2ae('0x5')](_0x52cb5b,_0x916ee2);_0x36da1d(null);};}for(var e in events){if(events[_0xc2ae('0x6')](e)){var event=events[e];OpenchannelMessage[_0xc2ae('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index bae7de9..5ea48e3 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 _0x8603=['secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','describe','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','method','body','threadId','inspect','finally','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','models','get','direction','toLowerCase'];(function(_0x5c6c01,_0x478a31){var _0x59860e=function(_0x4d308f){while(--_0x4d308f){_0x5c6c01['push'](_0x5c6c01['shift']());}};_0x59860e(++_0x478a31);}(_0x8603,0x190));var _0x3860=function(_0x15bcf8,_0x38b21d){_0x15bcf8=_0x15bcf8-0x0;var _0xc6c79c=_0x8603[_0x15bcf8];return _0xc6c79c;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var fs=require('fs');var path=require(_0x3860('0x4'));var rimraf=require(_0x3860('0x5'));var config=require('../../config/environment');var attributes=require(_0x3860('0x6'));module['exports']=function(_0xb0fc24,_0x40739b){return _0xb0fc24[_0x3860('0x7')](_0x3860('0x8'),attributes,{'tableName':_0x3860('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ad015,_0x441dc4,_0x52c277){var _0x2fb169=_0xb0fc24[_0x3860('0xa')];var _0x5909b8=_0x1ad015[_0x3860('0xb')]({'plain':!![]});if(_0x5909b8[_0x3860('0xc')]['toLowerCase']()==='in'||_0x5909b8[_0x3860('0xc')][_0x3860('0xd')]()==='out'&&!_0x5909b8[_0x3860('0xe')]&&!_[_0x3860('0xf')](_0x5909b8[_0x3860('0x10')])){_0x2fb169[_0x3860('0x11')][_0x3860('0x12')]({'where':{'id':_0x5909b8[_0x3860('0x13')]}})[_0x3860('0x14')](function(_0x12b23b){if(_0x12b23b){_0x12b23b[_0x3860('0x15')]({'lastMsgAt':_0x5909b8[_0x3860('0x16')],'lastMsgDirection':_0x5909b8['direction'][_0x3860('0xd')]()});}})[_0x3860('0x17')](function(_0x122e40){console[_0x3860('0x18')](_0x122e40);});}if(_0x5909b8[_0x3860('0xc')]===_0x3860('0x19')&&!_0x5909b8[_0x3860('0xe')]){var _0x378305;_0x2fb169[_0x3860('0x1a')][_0x3860('0x1b')]()[_0x3860('0x14')](function(_0x45b799){return _0x2fb169['OpenchannelAccount']['find']({'where':{'id':_0x5909b8[_0x3860('0x1c')]},'include':[{'model':_0x2fb169[_0x3860('0x11')],'as':_0x3860('0x1d'),'where':{'id':_0x5909b8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2fb169[_0x3860('0x1a')],'as':_0x3860('0x1e'),'attributes':_[_0x3860('0x1f')](_0x45b799)}]}]});})[_0x3860('0x14')](function(_0x20a5b0){_0x378305=_0x20a5b0[_0x3860('0xb')]({'plain':!![]});if(_0x378305&&_0x378305[_0x3860('0x20')]){logger[_0x3860('0x21')](_0x3860('0x22'),_0x3860('0x23'),util[_0x3860('0x24')](_0x3860('0x25'),_0x5909b8['id'],_0x378305[_0x3860('0x20')]));if(_0x378305[_0x3860('0x1d')]&&_0x378305[_0x3860('0x1d')]['length']){_0x5909b8[_0x3860('0x26')]=_[_0x3860('0x27')](_0x378305[_0x3860('0x1d')][0x0],_0x3860('0x1e'));_0x5909b8[_0x3860('0x1e')]=_0x378305['Interactions'][0x0][_0x3860('0x1e')];}var _0x441dc4={'method':'POST','uri':encodeURI(_0x378305[_0x3860('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x441dc4[_0x3860('0x28')]){case'GET':_0x441dc4['qs']=_0x5909b8;break;case'POST':_0x441dc4['body']=_0x5909b8;break;}return rp(_0x441dc4)[_0x3860('0x14')](function(_0x3ebc5b){logger[_0x3860('0x21')](_0x3860('0x22'),_0x3860('0x23'),util[_0x3860('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5909b8['id'],_0x378305['replyUri']));if(_0x3ebc5b[_0x3860('0x29')][_0x3860('0x2a')]&&_0x3ebc5b['body'][_0x3860('0x2a')]!=_0x5909b8[_0x3860('0x26')][_0x3860('0x2a')]){return _0x2fb169[_0x3860('0x11')][_0x3860('0x15')]({'threadId':_0x3ebc5b['body'][_0x3860('0x2a')]},{'logging':!![],'where':{'id':_0x5909b8[_0x3860('0x26')]['id']}});}else{return;}})[_0x3860('0x14')](function(){return _0x1ad015['update']({'read':!![]});})[_0x3860('0x17')](function(_0x5e25ce){logger[_0x3860('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x3860('0x23'),util[_0x3860('0x2b')](_0x5e25ce,{'showHidden':![],'depth':null}));_0x52c277();});}else{_0x52c277();}})[_0x3860('0x2c')](function(){_0x52c277();});}else{_0x52c277();}}},'charset':'utf8mb4','collate':_0x3860('0x2d')});}; \ No newline at end of file +var _0x36ee=['request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','error','CmContact','then','find','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','POST','method','GET','body','format','threadId','update','Interaction','inspect','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x216803,_0x1e4791){var _0x11e87b=function(_0x396842){while(--_0x396842){_0x216803['push'](_0x216803['shift']());}};_0x11e87b(++_0x1e4791);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe36e('0x0'))('api');var moment=require(_0xe36e('0x1'));var BPromise=require(_0xe36e('0x2'));var rp=require(_0xe36e('0x3'));var fs=require('fs');var path=require(_0xe36e('0x4'));var rimraf=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var attributes=require(_0xe36e('0x7'));module[_0xe36e('0x8')]=function(_0x25a07d,_0x190404){return _0x25a07d[_0xe36e('0x9')](_0xe36e('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe36e('0xb'),'fields':['body'],'type':_0xe36e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x123c16,_0x46f239,_0x47ce3a){var _0xf119e4=_0x25a07d['models'];var _0x2e968d=_0x123c16[_0xe36e('0xd')]({'plain':!![]});if(_0x2e968d[_0xe36e('0xe')][_0xe36e('0xf')]()==='in'||_0x2e968d[_0xe36e('0xe')][_0xe36e('0xf')]()===_0xe36e('0x10')&&!_0x2e968d[_0xe36e('0x11')]&&!_['isNil'](_0x2e968d[_0xe36e('0x12')])){_0xf119e4[_0xe36e('0x13')][_0xe36e('0x14')]({'where':{'id':_0x2e968d[_0xe36e('0x15')]}})['then'](function(_0x3e264a){if(_0x3e264a){_0x3e264a['update']({'lastMsgAt':_0x2e968d['createdAt'],'lastMsgDirection':_0x2e968d[_0xe36e('0xe')][_0xe36e('0xf')]()});}})[_0xe36e('0x16')](function(_0x278135){console[_0xe36e('0x17')](_0x278135);});}if(_0x2e968d[_0xe36e('0xe')]===_0xe36e('0x10')&&!_0x2e968d[_0xe36e('0x11')]){var _0x387c37;_0xf119e4[_0xe36e('0x18')]['describe']()[_0xe36e('0x19')](function(_0x2184ae){return _0xf119e4['OpenchannelAccount'][_0xe36e('0x1a')]({'where':{'id':_0x2e968d['OpenchannelAccountId']},'include':[{'model':_0xf119e4[_0xe36e('0x13')],'as':_0xe36e('0x1b'),'where':{'id':_0x2e968d['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xf119e4[_0xe36e('0x18')],'as':_0xe36e('0x1c'),'attributes':_[_0xe36e('0x1d')](_0x2184ae)}]}]});})['then'](function(_0x21e95e){_0x387c37=_0x21e95e[_0xe36e('0xd')]({'plain':!![]});if(_0x387c37&&_0x387c37[_0xe36e('0x1e')]){logger[_0xe36e('0x1f')](_0xe36e('0x20'),_0xe36e('0x21'),util['format'](_0xe36e('0x22'),_0x2e968d['id'],_0x387c37[_0xe36e('0x1e')]));if(_0x387c37[_0xe36e('0x1b')]&&_0x387c37[_0xe36e('0x1b')][_0xe36e('0x23')]){_0x2e968d['Interaction']=_['omit'](_0x387c37[_0xe36e('0x1b')][0x0],_0xe36e('0x1c'));_0x2e968d[_0xe36e('0x1c')]=_0x387c37[_0xe36e('0x1b')][0x0][_0xe36e('0x1c')];}var _0x46f239={'method':_0xe36e('0x24'),'uri':encodeURI(_0x387c37['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46f239[_0xe36e('0x25')]){case _0xe36e('0x26'):_0x46f239['qs']=_0x2e968d;break;case _0xe36e('0x24'):_0x46f239[_0xe36e('0x27')]=_0x2e968d;break;}return rp(_0x46f239)['then'](function(_0x2d757c){logger['info'](_0xe36e('0x20'),'afterCreate',util[_0xe36e('0x28')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2e968d['id'],_0x387c37[_0xe36e('0x1e')]));if(_0x2d757c['body'][_0xe36e('0x29')]&&_0x2d757c['body']['threadId']!=_0x2e968d['Interaction']['threadId']){return _0xf119e4[_0xe36e('0x13')][_0xe36e('0x2a')]({'threadId':_0x2d757c['body']['threadId']},{'logging':!![],'where':{'id':_0x2e968d[_0xe36e('0x2b')]['id']}});}else{return;}})[_0xe36e('0x19')](function(){return _0x123c16[_0xe36e('0x2a')]({'read':!![]});})[_0xe36e('0x16')](function(_0x3d826e){logger[_0xe36e('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xe36e('0x21'),util[_0xe36e('0x2c')](_0x3d826e,{'showHidden':![],'depth':null}));_0x47ce3a();});}else{_0x47ce3a();}})['finally'](function(){_0x47ce3a();});}else{_0x47ce3a();}}},'charset':_0xe36e('0x2d'),'collate':_0xe36e('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 5640bf0..ad15d34 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4a9954,_0x6d8ebd){var _0x47f1da=function(_0x548eb0){while(--_0x548eb0){_0x4a9954['push'](_0x4a9954['shift']());}};_0x47f1da(++_0x6d8ebd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3d5af9,_0x196049){var _0x23936e=function(_0x405238){while(--_0x405238){_0x3d5af9['push'](_0x3d5af9['shift']());}};_0x23936e(++_0x196049);}(_0xadb5,0xad));var _0x5adb=function(_0x8c30d2,_0x4e45f0){_0x8c30d2=_0x8c30d2-0x0;var _0x1ad441=_0xadb5[_0x8c30d2];return _0x1ad441;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index fd4a611..cc772ea 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 _0x2ba6=['register','length','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ba6,0x1ea));var _0x62ba=function(_0x3b8bff,_0x441914){_0x3b8bff=_0x3b8bff-0x0;var _0x2a0301=_0x2ba6[_0x3b8bff];return _0x2a0301;};'use strict';var OpenchannelMessageEvents=require(_0x62ba('0x0'));var events=[_0x62ba('0x1'),_0x62ba('0x2'),_0x62ba('0x3')];function createListener(_0x44c939,_0x49a26c){return function(_0xf21fcc){_0x49a26c[_0x62ba('0x4')](_0x44c939,_0xf21fcc);};}function removeListener(_0x19316d,_0x362f2c){return function(){OpenchannelMessageEvents[_0x62ba('0x5')](_0x19316d,_0x362f2c);};}exports[_0x62ba('0x6')]=function(_0x57d9f9){for(var _0x304c4b=0x0,_0x24c78a=events[_0x62ba('0x7')];_0x304c4b<_0x24c78a;_0x304c4b++){var _0x4c1b10=events[_0x304c4b];var _0xa8dec7=createListener('openchannelMessage:'+_0x4c1b10,_0x57d9f9);OpenchannelMessageEvents['on'](_0x4c1b10,_0xa8dec7);}}; \ No newline at end of file +var _0x4491=['remove','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x5c96dd,_0x3017af){var _0x20416f=function(_0x30a54e){while(--_0x30a54e){_0x5c96dd['push'](_0x5c96dd['shift']());}};_0x20416f(++_0x3017af);}(_0x4491,0x1bb));var _0x1449=function(_0xe8194,_0xc7ec76){_0xe8194=_0xe8194-0x0;var _0x1cb195=_0x4491[_0xe8194];return _0x1cb195;};'use strict';var OpenchannelMessageEvents=require(_0x1449('0x0'));var events=['save',_0x1449('0x1'),'update'];function createListener(_0x4273ee,_0x176880){return function(_0x45474c){_0x176880[_0x1449('0x2')](_0x4273ee,_0x45474c);};}function removeListener(_0x1ff47f,_0x1b2870){return function(){OpenchannelMessageEvents['removeListener'](_0x1ff47f,_0x1b2870);};}exports[_0x1449('0x3')]=function(_0x557482){for(var _0x1d45eb=0x0,_0x5dfe4c=events[_0x1449('0x4')];_0x1d45eb<_0x5dfe4c;_0x1d45eb++){var _0x2f4189=events[_0x1d45eb];var _0x10e119=createListener(_0x1449('0x5')+_0x2f4189,_0x557482);OpenchannelMessageEvents['on'](_0x2f4189,_0x10e119);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 78f54c8..88d71cc 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 _0x6b69=['describe','/:id','show','/:id/members','getTeams','create','post','/:id/teams','/:id/users','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x2f4d1b,_0x1f65be){var _0x5da6c2=function(_0x5cd4a2){while(--_0x5cd4a2){_0x2f4d1b['push'](_0x2f4d1b['shift']());}};_0x5da6c2(++_0x1f65be);}(_0x6b69,0x1c8));var _0x96b6=function(_0x1701de,_0x586ae9){_0x1701de=_0x1701de-0x0;var _0x259d37=_0x6b69[_0x1701de];return _0x259d37;};'use strict';var multer=require(_0x96b6('0x0'));var util=require(_0x96b6('0x1'));var path=require(_0x96b6('0x2'));var timeout=require(_0x96b6('0x3'));var express=require(_0x96b6('0x4'));var router=express[_0x96b6('0x5')]();var fs_extra=require(_0x96b6('0x6'));var auth=require(_0x96b6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x96b6('0x8'));var controller=require(_0x96b6('0x9'));router[_0x96b6('0xa')]('/',auth[_0x96b6('0xb')](),controller['index']);router[_0x96b6('0xa')]('/describe',auth[_0x96b6('0xb')](),controller[_0x96b6('0xc')]);router[_0x96b6('0xa')](_0x96b6('0xd'),auth['isAuthenticated'](),controller[_0x96b6('0xe')]);router[_0x96b6('0xa')](_0x96b6('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x96b6('0xa')]('/:id/teams',auth[_0x96b6('0xb')](),controller[_0x96b6('0x10')]);router[_0x96b6('0xa')]('/:id/users',auth[_0x96b6('0xb')](),controller['getAgents']);router['post']('/',auth[_0x96b6('0xb')](),controller[_0x96b6('0x11')]);router[_0x96b6('0x12')](_0x96b6('0x13'),auth[_0x96b6('0xb')](),controller['addTeams']);router[_0x96b6('0x12')](_0x96b6('0x14'),auth[_0x96b6('0xb')](),controller['addAgents']);router['put'](_0x96b6('0xd'),auth['isAuthenticated'](),controller[_0x96b6('0x15')]);router[_0x96b6('0x16')](_0x96b6('0xd'),auth[_0x96b6('0xb')](),controller[_0x96b6('0x17')]);router[_0x96b6('0x16')](_0x96b6('0x13'),auth['isAuthenticated'](),controller[_0x96b6('0x18')]);router['delete'](_0x96b6('0x14'),auth[_0x96b6('0xb')](),controller['removeAgents']);module[_0x96b6('0x19')]=router; \ No newline at end of file +var _0x23f9=['show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x3cf39f,_0x506e67){var _0x39c202=function(_0x27dcad){while(--_0x27dcad){_0x3cf39f['push'](_0x3cf39f['shift']());}};_0x39c202(++_0x506e67);}(_0x23f9,0x116));var _0x923f=function(_0x27c071,_0x51f1cc){_0x27c071=_0x27c071-0x0;var _0x450cba=_0x23f9[_0x27c071];return _0x450cba;};'use strict';var multer=require(_0x923f('0x0'));var util=require('util');var path=require(_0x923f('0x1'));var timeout=require(_0x923f('0x2'));var express=require(_0x923f('0x3'));var router=express[_0x923f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x923f('0x5'));var interaction=require(_0x923f('0x6'));var config=require(_0x923f('0x7'));var controller=require('./openchannelQueue.controller');router[_0x923f('0x8')]('/',auth[_0x923f('0x9')](),controller[_0x923f('0xa')]);router[_0x923f('0x8')]('/describe',auth[_0x923f('0x9')](),controller[_0x923f('0xb')]);router[_0x923f('0x8')]('/:id',auth[_0x923f('0x9')](),controller[_0x923f('0xc')]);router[_0x923f('0x8')](_0x923f('0xd'),auth['isAuthenticated'](),controller[_0x923f('0xe')]);router[_0x923f('0x8')](_0x923f('0xf'),auth[_0x923f('0x9')](),controller[_0x923f('0x10')]);router[_0x923f('0x8')](_0x923f('0x11'),auth[_0x923f('0x9')](),controller[_0x923f('0x12')]);router[_0x923f('0x13')]('/',auth[_0x923f('0x9')](),controller[_0x923f('0x14')]);router[_0x923f('0x13')](_0x923f('0xf'),auth['isAuthenticated'](),controller[_0x923f('0x15')]);router['post'](_0x923f('0x11'),auth['isAuthenticated'](),controller[_0x923f('0x16')]);router[_0x923f('0x17')]('/:id',auth[_0x923f('0x9')](),controller[_0x923f('0x18')]);router[_0x923f('0x19')]('/:id',auth[_0x923f('0x9')](),controller[_0x923f('0x1a')]);router[_0x923f('0x19')](_0x923f('0xf'),auth[_0x923f('0x9')](),controller[_0x923f('0x1b')]);router[_0x923f('0x19')]('/:id/users',auth[_0x923f('0x9')](),controller['removeAgents']);module[_0x923f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index be65fcc..5e4cded 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 _0x834e=['beepall','roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x4e9fc2,_0x89538e){var _0x53c1b4=function(_0x513caf){while(--_0x513caf){_0x4e9fc2['push'](_0x4e9fc2['shift']());}};_0x53c1b4(++_0x89538e);}(_0x834e,0x1de));var _0xe834=function(_0x50e3af,_0x3913a8){_0x50e3af=_0x50e3af-0x0;var _0x49e34d=_0x834e[_0x50e3af];return _0x49e34d;};'use strict';var Sequelize=require(_0xe834('0x0'));module['exports']={'name':{'type':Sequelize[_0xe834('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe834('0x1')]},'timeout':{'type':Sequelize[_0xe834('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe834('0x3')](_0xe834('0x4'),_0xe834('0x5'),_0xe834('0x6'))}}; \ No newline at end of file +var _0x58bd=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x3dd23c,_0x18c32f){var _0x520bf8=function(_0x462f87){while(--_0x462f87){_0x3dd23c['push'](_0x3dd23c['shift']());}};_0x520bf8(++_0x18c32f);}(_0x58bd,0x182));var _0xd58b=function(_0x3135b8,_0x302bfb){_0x3135b8=_0x3135b8-0x0;var _0xddeb0f=_0x58bd[_0x3135b8];return _0xddeb0f;};'use strict';var Sequelize=require(_0xd58b('0x0'));module[_0xd58b('0x1')]={'name':{'type':Sequelize[_0xd58b('0x2')],'unique':_0xd58b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd58b('0x4')](_0xd58b('0x5'),_0xd58b('0x6'),_0xd58b('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 500be38..ca7d3c1 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 _0x122c=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','end','error','stack','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','openchannelPause','createdAt','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','team_has_openchannel_queues'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x122c,0xa6));var _0xc122=function(_0x3bc306,_0x32948e){_0x3bc306=_0x3bc306-0x0;var _0x356bc0=_0x122c[_0x3bc306];return _0x356bc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc122('0x0'));var zipdir=require(_0xc122('0x1'));var jsonpatch=require(_0xc122('0x2'));var rp=require(_0xc122('0x3'));var moment=require(_0xc122('0x4'));var BPromise=require(_0xc122('0x5'));var Mustache=require(_0xc122('0x6'));var util=require(_0xc122('0x7'));var path=require('path');var sox=require(_0xc122('0x8'));var csv=require(_0xc122('0x9'));var ejs=require(_0xc122('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc122('0xb'));var squel=require(_0xc122('0xc'));var crypto=require('crypto');var jsforce=require(_0xc122('0xd'));var deskjs=require(_0xc122('0xe'));var toCsv=require(_0xc122('0x9'));var querystring=require(_0xc122('0xf'));var Papa=require(_0xc122('0x10'));var Redis=require(_0xc122('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc122('0x12'));var as=require(_0xc122('0x13'));var hardwareService=require(_0xc122('0x14'));var logger=require(_0xc122('0x15'))(_0xc122('0x16'));var utils=require(_0xc122('0x17'));var config=require(_0xc122('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc122('0x19'))['db'];config['redis']=_['defaults'](config[_0xc122('0x1a')],{'host':_0xc122('0x1b'),'port':0x18eb});var socket=require(_0xc122('0x1c'))(new Redis(config[_0xc122('0x1a')]));require('./openchannelQueue.socket')[_0xc122('0x1d')](socket);function respondWithStatusCode(_0x461327,_0xf997db){_0xf997db=_0xf997db||0xcc;return function(_0x1df4b0){if(_0x1df4b0){return _0x461327[_0xc122('0x1e')](_0xf997db);}return _0x461327[_0xc122('0x1f')](_0xf997db)['end']();};}function respondWithResult(_0x716e93,_0x237893){_0x237893=_0x237893||0xc8;return function(_0x56c8ec){if(_0x56c8ec){return _0x716e93[_0xc122('0x1f')](_0x237893)[_0xc122('0x20')](_0x56c8ec);}};}function respondWithFilteredResult(_0x58f28e,_0x241348){return function(_0x36bffb){if(_0x36bffb){var _0x5f00e1=typeof _0x241348[_0xc122('0x21')]===_0xc122('0x22')&&typeof _0x241348[_0xc122('0x23')]===_0xc122('0x22');var _0x12a211=_0x36bffb[_0xc122('0x24')];var _0x51c356=_0x5f00e1?0x0:_0x241348['offset'];var _0x179bf3=_0x5f00e1?_0x36bffb[_0xc122('0x24')]:_0x241348[_0xc122('0x21')]+_0x241348[_0xc122('0x23')];var _0x37d88e;if(_0x179bf3>=_0x12a211){_0x179bf3=_0x12a211;_0x37d88e=0xc8;}else{_0x37d88e=0xce;}_0x58f28e[_0xc122('0x1f')](_0x37d88e);return _0x58f28e[_0xc122('0x25')](_0xc122('0x26'),_0x51c356+'-'+_0x179bf3+'/'+_0x12a211)[_0xc122('0x20')](_0x36bffb);}return null;};}function patchUpdates(_0x40c148){return function(_0xef1ae2){try{jsonpatch[_0xc122('0x27')](_0xef1ae2,_0x40c148,!![]);}catch(_0xdd5f3c){return BPromise['reject'](_0xdd5f3c);}return _0xef1ae2[_0xc122('0x28')]();};}function saveUpdates(_0x2e4cb9,_0xa01a09){return function(_0x377073){if(_0x377073){return _0x377073[_0xc122('0x29')](_0x2e4cb9)[_0xc122('0x2a')](function(_0x544198){return _0x544198;});}return null;};}function removeEntity(_0x5ba416,_0x190883){return function(_0x1f02bd){if(_0x1f02bd){return _0x1f02bd[_0xc122('0x2b')]()[_0xc122('0x2a')](function(){var _0x4d087f=_0x1f02bd['get']({'plain':!![]});var _0x58a454=_0xc122('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x58a454,'resourceId':_0x4d087f['id']}})[_0xc122('0x2a')](function(){return _0x1f02bd;});})['then'](function(){_0x5ba416[_0xc122('0x1f')](0xcc)[_0xc122('0x2d')]();});}};}function handleEntityNotFound(_0x39c946,_0x2b88cd){return function(_0x4a9c19){if(!_0x4a9c19){_0x39c946[_0xc122('0x1e')](0x194);}return _0x4a9c19;};}function handleError(_0x361d4f,_0xe2ad10){_0xe2ad10=_0xe2ad10||0x1f4;return function(_0x4ef454){logger[_0xc122('0x2e')](_0x4ef454[_0xc122('0x2f')]);if(_0x4ef454['name']){delete _0x4ef454['name'];}_0x361d4f[_0xc122('0x1f')](_0xe2ad10)[_0xc122('0x30')](_0x4ef454);};}exports[_0xc122('0x31')]=function(_0x302946,_0x4dfaad){var _0xa26177={},_0x38a472={},_0xb0c1a7={'count':0x0,'rows':[]};var _0x5005f3=_[_0xc122('0x32')](db[_0xc122('0x33')][_0xc122('0x34')],function(_0x6379d7){return{'name':_0x6379d7[_0xc122('0x35')],'type':_0x6379d7[_0xc122('0x36')][_0xc122('0x37')]};});_0x38a472[_0xc122('0x38')]=_[_0xc122('0x32')](_0x5005f3,_0xc122('0x39'));_0x38a472['query']=_[_0xc122('0x3a')](_0x302946[_0xc122('0x3b')]);_0x38a472[_0xc122('0x3c')]=_[_0xc122('0x3d')](_0x38a472['model'],_0x38a472['query']);_0xa26177[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x38a472[_0xc122('0x38')],qs['fields'](_0x302946[_0xc122('0x3b')][_0xc122('0x3f')]));_0xa26177[_0xc122('0x3e')]=_0xa26177['attributes']['length']?_0xa26177[_0xc122('0x3e')]:_0x38a472[_0xc122('0x38')];if(!_0x302946[_0xc122('0x3b')][_0xc122('0x40')](_0xc122('0x41'))){_0xa26177[_0xc122('0x23')]=qs['limit'](_0x302946['query'][_0xc122('0x23')]);_0xa26177['offset']=qs[_0xc122('0x21')](_0x302946[_0xc122('0x3b')][_0xc122('0x21')]);}_0xa26177['order']=qs[_0xc122('0x42')](_0x302946[_0xc122('0x3b')][_0xc122('0x42')]);_0xa26177[_0xc122('0x43')]=qs[_0xc122('0x3c')](_[_0xc122('0x44')](_0x302946[_0xc122('0x3b')],_0x38a472[_0xc122('0x3c')]),_0x5005f3);if(_0x302946['query'][_0xc122('0x45')]){_0xa26177['where']=_[_0xc122('0x46')](_0xa26177[_0xc122('0x43')],{'$or':_['map'](_0x5005f3,function(_0x3b4247){if(_0x3b4247[_0xc122('0x36')]!==_0xc122('0x47')){var _0x1cdf63={};_0x1cdf63[_0x3b4247['name']]={'$like':'%'+_0x302946[_0xc122('0x3b')]['filter']+'%'};return _0x1cdf63;}})});}_0xa26177=_['merge']({},_0xa26177,_0x302946[_0xc122('0x48')]);var _0x2b3876={'where':_0xa26177[_0xc122('0x43')]};return db[_0xc122('0x33')]['count'](_0x2b3876)[_0xc122('0x2a')](function(_0x1ce71c){_0xb0c1a7[_0xc122('0x24')]=_0x1ce71c;if(_0x302946[_0xc122('0x3b')][_0xc122('0x49')]){_0xa26177[_0xc122('0x4a')]=[{'all':!![]}];}return db[_0xc122('0x33')][_0xc122('0x4b')](_0xa26177);})[_0xc122('0x2a')](function(_0x26ba52){_0xb0c1a7[_0xc122('0x4c')]=_0x26ba52;return _0xb0c1a7;})[_0xc122('0x2a')](respondWithFilteredResult(_0x4dfaad,_0xa26177))[_0xc122('0x4d')](handleError(_0x4dfaad,null));};exports[_0xc122('0x4e')]=function(_0x3652e0,_0x2373e0){var _0x35b103={'raw':!![],'where':{'id':_0x3652e0[_0xc122('0x4f')]['id']}},_0x4b1aae={};_0x4b1aae[_0xc122('0x38')]=_[_0xc122('0x3a')](db[_0xc122('0x33')]['rawAttributes']);_0x4b1aae['query']=_['keys'](_0x3652e0[_0xc122('0x3b')]);_0x4b1aae[_0xc122('0x3c')]=_['intersection'](_0x4b1aae[_0xc122('0x38')],_0x4b1aae[_0xc122('0x3b')]);_0x35b103[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x4b1aae['model'],qs[_0xc122('0x3f')](_0x3652e0[_0xc122('0x3b')][_0xc122('0x3f')]));_0x35b103['attributes']=_0x35b103[_0xc122('0x3e')][_0xc122('0x50')]?_0x35b103['attributes']:_0x4b1aae[_0xc122('0x38')];if(_0x3652e0['query'][_0xc122('0x49')]){_0x35b103['include']=[{'all':!![]}];}_0x35b103=_['merge']({},_0x35b103,_0x3652e0[_0xc122('0x48')]);return db[_0xc122('0x33')][_0xc122('0x51')](_0x35b103)[_0xc122('0x2a')](handleEntityNotFound(_0x2373e0,null))[_0xc122('0x2a')](respondWithResult(_0x2373e0,null))[_0xc122('0x4d')](handleError(_0x2373e0,null));};exports[_0xc122('0x52')]=function(_0x3efcae,_0x458519){return db[_0xc122('0x33')][_0xc122('0x52')](_0x3efcae[_0xc122('0x53')],{})[_0xc122('0x2a')](function(_0x15662f){var _0x5a873b=_0x3efcae[_0xc122('0x54')][_0xc122('0x55')]({'plain':!![]});if(!_0x5a873b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a873b[_0xc122('0x56')]===_0xc122('0x54')){var _0x1ca004=_0x15662f[_0xc122('0x55')]({'plain':!![]});var _0x563f15=_0xc122('0x2c');return db['UserProfileSection'][_0xc122('0x51')]({'where':{'name':_0x563f15,'userProfileId':_0x5a873b[_0xc122('0x57')]},'raw':!![]})[_0xc122('0x2a')](function(_0xa88754){if(_0xa88754&&_0xa88754[_0xc122('0x58')]===0x0){return db['UserProfileResource'][_0xc122('0x52')]({'name':_0x1ca004[_0xc122('0x39')],'resourceId':_0x1ca004['id'],'type':_0xa88754['name'],'sectionId':_0xa88754['id']},{})['then'](function(){return _0x15662f;});}else{return _0x15662f;}})[_0xc122('0x4d')](function(_0x2f2621){logger[_0xc122('0x2e')](_0xc122('0x59'),_0x2f2621);throw _0x2f2621;});}return _0x15662f;})[_0xc122('0x2a')](respondWithResult(_0x458519,0xc9))[_0xc122('0x4d')](handleError(_0x458519,null));};exports[_0xc122('0x29')]=function(_0x4c229e,_0x410e30){if(_0x4c229e[_0xc122('0x53')]['id']){delete _0x4c229e[_0xc122('0x53')]['id'];}return db['OpenchannelQueue'][_0xc122('0x51')]({'where':{'id':_0x4c229e['params']['id']}})['then'](handleEntityNotFound(_0x410e30,null))[_0xc122('0x2a')](saveUpdates(_0x4c229e[_0xc122('0x53')],null))['then'](respondWithResult(_0x410e30,null))[_0xc122('0x4d')](handleError(_0x410e30,null));};exports[_0xc122('0x2b')]=function(_0x5a4c5a,_0x102aec){return db['OpenchannelQueue'][_0xc122('0x51')]({'where':{'id':_0x5a4c5a['params']['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x102aec,null))[_0xc122('0x2a')](removeEntity(_0x102aec,null))[_0xc122('0x4d')](handleError(_0x102aec,null));};exports[_0xc122('0x5a')]=function(_0x381dcf,_0x323ec9){return db['OpenchannelQueue']['describe']()[_0xc122('0x2a')](respondWithResult(_0x323ec9,null))['catch'](handleError(_0x323ec9,null));};exports[_0xc122('0x5b')]=function(_0x514413,_0x2d3b8e,_0x1a343d){var _0x52b123={'raw':!![],'where':{}},_0x4c7c27={},_0x36ed8b;return db[_0xc122('0x33')][_0xc122('0x5c')]({'where':{'id':_0x514413[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x2d3b8e,null))[_0xc122('0x2a')](function(_0x31d809){if(_0x31d809){_0x36ed8b=_0x31d809['get']({'plain':!![]});_0x4c7c27['model']=_[_0xc122('0x3a')](db[_0xc122('0x5d')][_0xc122('0x34')]);_0x4c7c27['query']=_[_0xc122('0x3a')](_0x514413[_0xc122('0x3b')]);_0x4c7c27[_0xc122('0x3c')]=_['intersection'](_0x4c7c27[_0xc122('0x38')],_0x4c7c27[_0xc122('0x3b')]);_0x52b123[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x4c7c27[_0xc122('0x38')],qs[_0xc122('0x3f')](_0x514413[_0xc122('0x3b')][_0xc122('0x3f')]));_0x52b123[_0xc122('0x3e')]=_0x52b123[_0xc122('0x3e')][_0xc122('0x50')]?_0x52b123['attributes']:_0x4c7c27[_0xc122('0x38')];if(!_0x514413[_0xc122('0x3b')][_0xc122('0x40')]('nolimit')){_0x52b123['limit']=qs['limit'](_0x514413['query']['limit']);_0x52b123[_0xc122('0x21')]=qs[_0xc122('0x21')](_0x514413[_0xc122('0x3b')]['offset']);}_0x52b123['order']=qs['sort'](_0x514413[_0xc122('0x3b')][_0xc122('0x42')]);_0x52b123[_0xc122('0x43')]=qs[_0xc122('0x3c')](_[_0xc122('0x44')](_0x514413[_0xc122('0x3b')],_0x4c7c27[_0xc122('0x3c')]));_0x52b123[_0xc122('0x43')]['OpenchannelQueueId']=_0x31d809['id'];if(_0x514413['query']['filter']){_0x52b123[_0xc122('0x43')]=_[_0xc122('0x46')](_0x52b123[_0xc122('0x43')],{'$or':_[_0xc122('0x32')](_0x52b123['attributes'],function(_0x45d542){var _0x61522e={};_0x61522e[_0x45d542]={'$like':'%'+_0x514413[_0xc122('0x3b')]['filter']+'%'};return _0x61522e;})});}_0x52b123=_[_0xc122('0x46')]({},_0x52b123,_0x514413[_0xc122('0x48')]);return db[_0xc122('0x5d')][_0xc122('0x4b')](_0x52b123);}})[_0xc122('0x2a')](function(_0x2a9ed5){if(_0x2a9ed5){return db[_0xc122('0x5e')][_0xc122('0x5f')]({'where':{'id':_[_0xc122('0x32')](_0x2a9ed5,_0xc122('0x60')),'role':_0xc122('0x61')},'attributes':['id',_0xc122('0x39'),'openchannelPause',_0xc122('0x62'),'createdAt']});}})[_0xc122('0x2a')](function(_0x5cbd69){if(_0x5cbd69){return{'count':_0x5cbd69[_0xc122('0x24')],'rows':_[_0xc122('0x32')](_0x5cbd69[_0xc122('0x4c')],function(_0x24283d){return{'membername':_0x24283d[_0xc122('0x39')],'UserId':_0x24283d['id'],'queue_name':_0x36ed8b[_0xc122('0x39')],'OpenchannelQueueId':_0x36ed8b['id'],'interface':util[_0xc122('0x63')]('%s/%s',_0xc122('0x64'),_0x24283d[_0xc122('0x39')]),'penalty':0x0,'paused':_0x24283d[_0xc122('0x65')],'createdAt':_0x24283d[_0xc122('0x66')],'updatedAt':_0x24283d[_0xc122('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2d3b8e,_0x52b123))['catch'](handleError(_0x2d3b8e,null));};exports[_0xc122('0x67')]=function(_0x30c1a4,_0x45e0d5,_0x476dac){var _0x585f0d={};var _0x4da2bb={};var _0x27627f;var _0x206d12;return db[_0xc122('0x33')][_0xc122('0x5c')]({'where':{'id':_0x30c1a4[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x45e0d5,null))['then'](function(_0x2117d6){if(_0x2117d6){_0x27627f=_0x2117d6;_0x4da2bb[_0xc122('0x38')]=_[_0xc122('0x3a')](db[_0xc122('0x68')][_0xc122('0x34')]);_0x4da2bb[_0xc122('0x3b')]=_[_0xc122('0x3a')](_0x30c1a4['query']);_0x4da2bb[_0xc122('0x3c')]=_[_0xc122('0x3d')](_0x4da2bb['model'],_0x4da2bb[_0xc122('0x3b')]);_0x585f0d[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x4da2bb['model'],qs['fields'](_0x30c1a4[_0xc122('0x3b')][_0xc122('0x3f')]));_0x585f0d[_0xc122('0x3e')]=_0x585f0d[_0xc122('0x3e')][_0xc122('0x50')]?_0x585f0d[_0xc122('0x3e')]:_0x4da2bb[_0xc122('0x38')];_0x585f0d[_0xc122('0x69')]=qs[_0xc122('0x42')](_0x30c1a4['query'][_0xc122('0x42')]);_0x585f0d['where']=qs[_0xc122('0x3c')](_[_0xc122('0x44')](_0x30c1a4[_0xc122('0x3b')],_0x4da2bb[_0xc122('0x3c')]));if(_0x30c1a4[_0xc122('0x3b')][_0xc122('0x45')]){_0x585f0d['where']=_[_0xc122('0x46')](_0x585f0d[_0xc122('0x43')],{'$or':_[_0xc122('0x32')](_0x585f0d[_0xc122('0x3e')],function(_0x4583c4){var _0x2ccab6={};_0x2ccab6[_0x4583c4]={'$like':'%'+_0x30c1a4[_0xc122('0x3b')][_0xc122('0x45')]+'%'};return _0x2ccab6;})});}_0x585f0d=_[_0xc122('0x46')]({},_0x585f0d,_0x30c1a4[_0xc122('0x48')]);return _0x27627f[_0xc122('0x67')](_0x585f0d);}})[_0xc122('0x2a')](function(_0x101bcb){if(_0x101bcb){_0x206d12=_0x101bcb[_0xc122('0x50')];if(!_0x30c1a4[_0xc122('0x3b')][_0xc122('0x40')]('nolimit')){_0x585f0d[_0xc122('0x23')]=qs[_0xc122('0x23')](_0x30c1a4[_0xc122('0x3b')]['limit']);_0x585f0d['offset']=qs[_0xc122('0x21')](_0x30c1a4['query'][_0xc122('0x21')]);}return _0x27627f[_0xc122('0x67')](_0x585f0d);}})[_0xc122('0x2a')](function(_0x2b8000){if(_0x2b8000){return _0x2b8000?{'count':_0x206d12,'rows':_0x2b8000}:null;}})[_0xc122('0x2a')](respondWithResult(_0x45e0d5,null))[_0xc122('0x4d')](handleError(_0x45e0d5,null));};exports[_0xc122('0x6a')]=function(_0x11a0b9,_0x16a853,_0x32ac59){var _0x270793=_0x11a0b9[_0xc122('0x53')][_0xc122('0x6b')];return db[_0xc122('0x68')][_0xc122('0x4b')]({'where':{'id':_0x270793},'attributes':['id'],'include':[{'model':db[_0xc122('0x5e')],'as':_0xc122('0x6c'),'attributes':['id',_0xc122('0x39'),_0xc122('0x6d'),_0xc122('0x6e'),'interface'],'raw':!![]}]})[_0xc122('0x2a')](function(_0x3d2cc1){if(_0x3d2cc1){var _0x1c5ec3=_[_0xc122('0x6f')](_0x3d2cc1,function(_0x6b1ff4){var _0x34b981=_0x6b1ff4[_0xc122('0x55')]({'plain':!![]});return _0x34b981[_0xc122('0x6c')];});return db[_0xc122('0x33')][_0xc122('0x51')]({'where':{'id':_0x11a0b9['params']['id']}})[_0xc122('0x2a')](function(_0x5559f5){return db[_0xc122('0x70')]['transaction'](function(_0x32971d){return _0x5559f5[_0xc122('0x6a')](_0x270793,{'transaction':_0x32971d})[_0xc122('0x2a')](function(){return BPromise[_0xc122('0x71')](_0x1c5ec3,function(_0x417fe8){return db['UserOpenchannelQueue'][_0xc122('0x72')]({'where':{'UserId':_0x417fe8['id'],'OpenchannelQueueId':_0x11a0b9[_0xc122('0x4f')]['id']},'transaction':_0x32971d});});})[_0xc122('0x2a')](function(){_0x1c5ec3[_0xc122('0x73')](function(_0x5bc64){socket[_0xc122('0x74')]('userOpenchannelQueue:save',{'UserId':_0x5bc64['id'],'OpenchannelQueueId':_0x5559f5['id']});});});});});}})['then'](respondWithStatusCode(_0x16a853,null))[_0xc122('0x4d')](handleError(_0x16a853,null));};exports[_0xc122('0x75')]=function(_0x1e0276,_0x493390,_0x1bcf1d){return db[_0xc122('0x68')][_0xc122('0x4b')]({'where':{'id':_0x1e0276['query'][_0xc122('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x493390,null))[_0xc122('0x2a')](function(_0x2fcec9){var _0xb9c9e9=_[_0xc122('0x32')](_0x2fcec9,'id');var _0x2849f6=[];var _0x204398=[];var _0x35b9b0=squel[_0xc122('0x76')]();_0x35b9b0['field']('tq.TeamId')['from'](_0xc122('0x77'),'tq')['join'](_0xc122('0x78'),'ut',_0xc122('0x79'))['where'](_0xc122('0x7a'),_0x1e0276['params']['id']);for(var _0xf93afa=0x0;_0xf93afa<_0x2fcec9[_0xc122('0x50')];_0xf93afa+=0x1){let _0x13b8f6=_0x2fcec9[_0xf93afa];for(var _0x6d6dd0=0x0;_0x6d6dd0<_0x13b8f6[_0xc122('0x6c')][_0xc122('0x50')];_0x6d6dd0+=0x1){let _0xb38360=_0x13b8f6[_0xc122('0x6c')][_0x6d6dd0];var _0xf90cfb=_0x35b9b0[_0xc122('0x7b')]();_0xf90cfb[_0xc122('0x43')](_0xc122('0x7c'),_0xb38360['id']);_0x204398[_0xc122('0x7d')](db[_0xc122('0x70')][_0xc122('0x3b')](_0xf90cfb[_0xc122('0x7e')](),{'type':db[_0xc122('0x70')][_0xc122('0x7f')][_0xc122('0x80')]})[_0xc122('0x2a')](function(_0x564d49){if(_0x564d49['length']===0x1){return _0xb38360['id'];}else{var _0x3c5c8e=_[_0xc122('0x81')](_['map'](_0x564d49,_0xc122('0x82')),function(_0x4f4c17){return _['includes'](_0xb9c9e9,_0x4f4c17);});if(_0x3c5c8e){return _0xb38360['id'];}}}));}}return BPromise[_0xc122('0x83')](_0x204398)[_0xc122('0x2a')](function(_0x33b902){_0x2849f6=_(_0x2849f6)[_0xc122('0x84')](_0x33b902)[_0xc122('0x85')]()[_0xc122('0x86')]();return db[_0xc122('0x33')][_0xc122('0x51')]({'where':{'id':_0x1e0276[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](function(_0x15a218){return db['sequelize'][_0xc122('0x87')](function(_0x1475f2){return _0x15a218['removeTeams'](_0x1e0276[_0xc122('0x3b')]['ids'],{'transaction':_0x1475f2})[_0xc122('0x2a')](function(){if(!_[_0xc122('0x88')](_0x2849f6)){return _0x15a218[_0xc122('0x89')](_0x2849f6,{'transaction':_0x1475f2});}})[_0xc122('0x2a')](function(){_0x2849f6['forEach'](function(_0x686ba2){socket[_0xc122('0x74')](_0xc122('0x8a'),{'UserId':_0x686ba2,'OpenchannelQueueId':_0x15a218['id']});});});});});});})[_0xc122('0x2a')](respondWithStatusCode(_0x493390,null))[_0xc122('0x4d')](handleError(_0x493390,null));};exports['addAgents']=function(_0x41940e,_0x17c031,_0x29f137){return db[_0xc122('0x33')][_0xc122('0x51')]({'where':{'id':_0x41940e['params']['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0x17c031,null))[_0xc122('0x2a')](function(_0x355a0b){if(_0x355a0b){return _0x355a0b[_0xc122('0x8b')](_0x41940e[_0xc122('0x53')][_0xc122('0x6b')],_['omit'](_0x41940e['body'],[_0xc122('0x6b'),'id'])||{})[_0xc122('0x8c')](function(_0x439f7e){for(var _0x1ffe58=0x0;_0x1ffe58<_0x41940e['body'][_0xc122('0x6b')]['length'];_0x1ffe58+=0x1){socket[_0xc122('0x74')](_0xc122('0x8d'),{'UserId':Number(_0x41940e['body'][_0xc122('0x6b')][_0x1ffe58]),'OpenchannelQueueId':Number(_0x41940e[_0xc122('0x4f')]['id'])});}return _0x439f7e;});}})[_0xc122('0x2a')](respondWithResult(_0x17c031,null))[_0xc122('0x4d')](handleError(_0x17c031,null));};exports[_0xc122('0x89')]=function(_0xc84d7,_0xf9b558,_0x13af2e){return db[_0xc122('0x33')]['find']({'where':{'id':_0xc84d7[_0xc122('0x4f')]['id']}})[_0xc122('0x2a')](handleEntityNotFound(_0xf9b558,null))[_0xc122('0x2a')](function(_0x3a76ff){if(_0x3a76ff){return _0x3a76ff[_0xc122('0x89')](_0xc84d7[_0xc122('0x3b')][_0xc122('0x6b')])[_0xc122('0x2a')](function(){if(_['isArray'](_0xc84d7[_0xc122('0x3b')][_0xc122('0x6b')])){for(var _0x695127=0x0;_0x695127<_0xc84d7[_0xc122('0x3b')]['ids']['length'];_0x695127+=0x1){socket['emit'](_0xc122('0x8a'),{'UserId':Number(_0xc84d7[_0xc122('0x3b')][_0xc122('0x6b')][_0x695127]),'OpenchannelQueueId':Number(_0xc84d7[_0xc122('0x4f')]['id'])});}}else{socket[_0xc122('0x74')](_0xc122('0x8a'),{'UserId':Number(_0xc84d7[_0xc122('0x3b')]['ids']),'OpenchannelQueueId':Number(_0xc84d7['params']['id'])});}});}})['then'](respondWithStatusCode(_0xf9b558,null))[_0xc122('0x4d')](handleError(_0xf9b558,null));};exports[_0xc122('0x8e')]=function(_0x591b72,_0x3490c0,_0x4ba12f){var _0x272698={};var _0x21463f={};var _0x52aabd;var _0x1bc3dc;return db[_0xc122('0x33')]['findOne']({'where':{'id':_0x591b72[_0xc122('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3490c0,null))[_0xc122('0x2a')](function(_0x4d7324){if(_0x4d7324){_0x52aabd=_0x4d7324;_0x21463f[_0xc122('0x38')]=_[_0xc122('0x3a')](db[_0xc122('0x5e')][_0xc122('0x34')]);_0x21463f[_0xc122('0x3b')]=_[_0xc122('0x3a')](_0x591b72[_0xc122('0x3b')]);_0x21463f[_0xc122('0x3c')]=_[_0xc122('0x3d')](_0x21463f['model'],_0x21463f[_0xc122('0x3b')]);_0x272698[_0xc122('0x3e')]=_[_0xc122('0x3d')](_0x21463f[_0xc122('0x38')],qs['fields'](_0x591b72[_0xc122('0x3b')][_0xc122('0x3f')]));_0x272698[_0xc122('0x3e')]=_0x272698[_0xc122('0x3e')]['length']?_0x272698[_0xc122('0x3e')]:_0x21463f['model'];_0x272698[_0xc122('0x69')]=qs['sort'](_0x591b72[_0xc122('0x3b')]['sort']);_0x272698[_0xc122('0x43')]=qs['filters'](_[_0xc122('0x44')](_0x591b72[_0xc122('0x3b')],_0x21463f[_0xc122('0x3c')]));if(_0x591b72['query']['filter']){_0x272698[_0xc122('0x43')]=_[_0xc122('0x46')](_0x272698[_0xc122('0x43')],{'$or':_[_0xc122('0x32')](_0x272698['attributes'],function(_0x17dae6){var _0x2d9f38={};_0x2d9f38[_0x17dae6]={'$like':'%'+_0x591b72[_0xc122('0x3b')][_0xc122('0x45')]+'%'};return _0x2d9f38;})});}_0x272698=_[_0xc122('0x46')]({},_0x272698,_0x591b72[_0xc122('0x48')]);return _0x52aabd[_0xc122('0x8e')](_0x272698);}})['then'](function(_0x4c5100){if(_0x4c5100){_0x1bc3dc=_0x4c5100[_0xc122('0x50')];if(!_0x591b72[_0xc122('0x3b')][_0xc122('0x40')](_0xc122('0x41'))){_0x272698[_0xc122('0x23')]=qs[_0xc122('0x23')](_0x591b72[_0xc122('0x3b')][_0xc122('0x23')]);_0x272698[_0xc122('0x21')]=qs[_0xc122('0x21')](_0x591b72[_0xc122('0x3b')][_0xc122('0x21')]);}return _0x52aabd[_0xc122('0x8e')](_0x272698);}})[_0xc122('0x2a')](function(_0x54e0d4){if(_0x54e0d4){return _0x54e0d4?{'count':_0x1bc3dc,'rows':_0x54e0d4}:null;}})[_0xc122('0x2a')](respondWithResult(_0x3490c0,null))['catch'](handleError(_0x3490c0,null));}; \ No newline at end of file +var _0x9da5=['union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','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','defaults','redis','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','name','send','index','OpenchannelQueue','rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x9da5,0x9d));var _0x59da=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x9da5[_0x1bfe2b];return _0x1477d4;};'use strict';var emlformat=require(_0x59da('0x0'));var rimraf=require(_0x59da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59da('0x2'));var rp=require(_0x59da('0x3'));var moment=require(_0x59da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x59da('0x5'));var util=require(_0x59da('0x6'));var path=require('path');var sox=require(_0x59da('0x7'));var csv=require(_0x59da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59da('0x9'));var _=require(_0x59da('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x59da('0xb'));var deskjs=require(_0x59da('0xc'));var toCsv=require(_0x59da('0x8'));var querystring=require(_0x59da('0xd'));var Papa=require('papaparse');var Redis=require(_0x59da('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x59da('0xf'));var as=require(_0x59da('0x10'));var hardwareService=require(_0x59da('0x11'));var logger=require(_0x59da('0x12'))(_0x59da('0x13'));var utils=require(_0x59da('0x14'));var config=require(_0x59da('0x15'));var licenseUtil=require(_0x59da('0x16'));var db=require(_0x59da('0x17'))['db'];config['redis']=_[_0x59da('0x18')](config[_0x59da('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x59da('0x1a'))(new Redis(config[_0x59da('0x19')]));require(_0x59da('0x1b'))['register'](socket);function respondWithStatusCode(_0x2bd02b,_0x4b1431){_0x4b1431=_0x4b1431||0xcc;return function(_0x2b60a4){if(_0x2b60a4){return _0x2bd02b[_0x59da('0x1c')](_0x4b1431);}return _0x2bd02b[_0x59da('0x1d')](_0x4b1431)[_0x59da('0x1e')]();};}function respondWithResult(_0x3a5832,_0x50da39){_0x50da39=_0x50da39||0xc8;return function(_0x5c0132){if(_0x5c0132){return _0x3a5832[_0x59da('0x1d')](_0x50da39)[_0x59da('0x1f')](_0x5c0132);}};}function respondWithFilteredResult(_0x375ea9,_0x2941cd){return function(_0x3efd55){if(_0x3efd55){var _0x4d845a=typeof _0x2941cd[_0x59da('0x20')]==='undefined'&&typeof _0x2941cd[_0x59da('0x21')]===_0x59da('0x22');var _0xd12297=_0x3efd55['count'];var _0x227691=_0x4d845a?0x0:_0x2941cd['offset'];var _0x130a1a=_0x4d845a?_0x3efd55['count']:_0x2941cd['offset']+_0x2941cd[_0x59da('0x21')];var _0x3582b1;if(_0x130a1a>=_0xd12297){_0x130a1a=_0xd12297;_0x3582b1=0xc8;}else{_0x3582b1=0xce;}_0x375ea9[_0x59da('0x1d')](_0x3582b1);return _0x375ea9[_0x59da('0x23')](_0x59da('0x24'),_0x227691+'-'+_0x130a1a+'/'+_0xd12297)[_0x59da('0x1f')](_0x3efd55);}return null;};}function patchUpdates(_0x34f8c6){return function(_0x5de872){try{jsonpatch[_0x59da('0x25')](_0x5de872,_0x34f8c6,!![]);}catch(_0x1b61ac){return BPromise[_0x59da('0x26')](_0x1b61ac);}return _0x5de872[_0x59da('0x27')]();};}function saveUpdates(_0x154ddd,_0xa9d16d){return function(_0x5bbe11){if(_0x5bbe11){return _0x5bbe11[_0x59da('0x28')](_0x154ddd)[_0x59da('0x29')](function(_0x3ca408){return _0x3ca408;});}return null;};}function removeEntity(_0x1ab375,_0x67bbf0){return function(_0x53472a){if(_0x53472a){return _0x53472a[_0x59da('0x2a')]()[_0x59da('0x29')](function(){var _0x1c5630=_0x53472a[_0x59da('0x2b')]({'plain':!![]});var _0x59ef54=_0x59da('0x2c');return db[_0x59da('0x2d')][_0x59da('0x2a')]({'where':{'type':_0x59ef54,'resourceId':_0x1c5630['id']}})[_0x59da('0x29')](function(){return _0x53472a;});})[_0x59da('0x29')](function(){_0x1ab375[_0x59da('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bb54f,_0x4ae651){return function(_0x2770e8){if(!_0x2770e8){_0x1bb54f[_0x59da('0x1c')](0x194);}return _0x2770e8;};}function handleError(_0x1d1c7b,_0x1a4ca9){_0x1a4ca9=_0x1a4ca9||0x1f4;return function(_0x3e217f){logger['error'](_0x3e217f['stack']);if(_0x3e217f[_0x59da('0x2e')]){delete _0x3e217f[_0x59da('0x2e')];}_0x1d1c7b[_0x59da('0x1d')](_0x1a4ca9)[_0x59da('0x2f')](_0x3e217f);};}exports[_0x59da('0x30')]=function(_0x307b4c,_0x12389b){var _0xc70930={},_0x33edd4={},_0x37e6b0={'count':0x0,'rows':[]};var _0x492971=_['map'](db[_0x59da('0x31')][_0x59da('0x32')],function(_0xe61c93){return{'name':_0xe61c93[_0x59da('0x33')],'type':_0xe61c93['type'][_0x59da('0x34')]};});_0x33edd4[_0x59da('0x35')]=_[_0x59da('0x36')](_0x492971,_0x59da('0x2e'));_0x33edd4[_0x59da('0x37')]=_['keys'](_0x307b4c[_0x59da('0x37')]);_0x33edd4['filters']=_['intersection'](_0x33edd4[_0x59da('0x35')],_0x33edd4[_0x59da('0x37')]);_0xc70930['attributes']=_[_0x59da('0x38')](_0x33edd4['model'],qs[_0x59da('0x39')](_0x307b4c[_0x59da('0x37')][_0x59da('0x39')]));_0xc70930['attributes']=_0xc70930[_0x59da('0x3a')][_0x59da('0x3b')]?_0xc70930['attributes']:_0x33edd4['model'];if(!_0x307b4c[_0x59da('0x37')][_0x59da('0x3c')]('nolimit')){_0xc70930[_0x59da('0x21')]=qs[_0x59da('0x21')](_0x307b4c[_0x59da('0x37')][_0x59da('0x21')]);_0xc70930['offset']=qs[_0x59da('0x20')](_0x307b4c[_0x59da('0x37')][_0x59da('0x20')]);}_0xc70930[_0x59da('0x3d')]=qs[_0x59da('0x3e')](_0x307b4c[_0x59da('0x37')][_0x59da('0x3e')]);_0xc70930['where']=qs['filters'](_[_0x59da('0x3f')](_0x307b4c['query'],_0x33edd4[_0x59da('0x40')]),_0x492971);if(_0x307b4c[_0x59da('0x37')][_0x59da('0x41')]){_0xc70930['where']=_[_0x59da('0x42')](_0xc70930[_0x59da('0x43')],{'$or':_[_0x59da('0x36')](_0x492971,function(_0x5b97be){if(_0x5b97be[_0x59da('0x44')]!==_0x59da('0x45')){var _0x3d623e={};_0x3d623e[_0x5b97be[_0x59da('0x2e')]]={'$like':'%'+_0x307b4c[_0x59da('0x37')][_0x59da('0x41')]+'%'};return _0x3d623e;}})});}_0xc70930=_[_0x59da('0x42')]({},_0xc70930,_0x307b4c[_0x59da('0x46')]);var _0x280c1f={'where':_0xc70930['where']};return db[_0x59da('0x31')]['count'](_0x280c1f)[_0x59da('0x29')](function(_0x2aedf6){_0x37e6b0[_0x59da('0x47')]=_0x2aedf6;if(_0x307b4c[_0x59da('0x37')][_0x59da('0x48')]){_0xc70930[_0x59da('0x49')]=[{'all':!![]}];}return db[_0x59da('0x31')][_0x59da('0x4a')](_0xc70930);})[_0x59da('0x29')](function(_0x3aacbd){_0x37e6b0[_0x59da('0x4b')]=_0x3aacbd;return _0x37e6b0;})['then'](respondWithFilteredResult(_0x12389b,_0xc70930))['catch'](handleError(_0x12389b,null));};exports[_0x59da('0x4c')]=function(_0x416313,_0x9b34a0){var _0x56fa75={'raw':!![],'where':{'id':_0x416313[_0x59da('0x4d')]['id']}},_0x4198d4={};_0x4198d4[_0x59da('0x35')]=_[_0x59da('0x4e')](db['OpenchannelQueue']['rawAttributes']);_0x4198d4[_0x59da('0x37')]=_[_0x59da('0x4e')](_0x416313[_0x59da('0x37')]);_0x4198d4[_0x59da('0x40')]=_[_0x59da('0x38')](_0x4198d4['model'],_0x4198d4[_0x59da('0x37')]);_0x56fa75['attributes']=_['intersection'](_0x4198d4[_0x59da('0x35')],qs[_0x59da('0x39')](_0x416313[_0x59da('0x37')]['fields']));_0x56fa75[_0x59da('0x3a')]=_0x56fa75[_0x59da('0x3a')][_0x59da('0x3b')]?_0x56fa75['attributes']:_0x4198d4[_0x59da('0x35')];if(_0x416313[_0x59da('0x37')][_0x59da('0x48')]){_0x56fa75[_0x59da('0x49')]=[{'all':!![]}];}_0x56fa75=_['merge']({},_0x56fa75,_0x416313[_0x59da('0x46')]);return db[_0x59da('0x31')]['find'](_0x56fa75)[_0x59da('0x29')](handleEntityNotFound(_0x9b34a0,null))[_0x59da('0x29')](respondWithResult(_0x9b34a0,null))[_0x59da('0x4f')](handleError(_0x9b34a0,null));};exports[_0x59da('0x50')]=function(_0x26cb6c,_0x249652){return db[_0x59da('0x31')]['create'](_0x26cb6c[_0x59da('0x51')],{})[_0x59da('0x29')](function(_0x1f9e54){var _0x48367c=_0x26cb6c[_0x59da('0x52')][_0x59da('0x2b')]({'plain':!![]});if(!_0x48367c)throw new Error(_0x59da('0x53'));if(_0x48367c[_0x59da('0x54')]===_0x59da('0x52')){var _0x23aa13=_0x1f9e54[_0x59da('0x2b')]({'plain':!![]});var _0x2c6331='OpenchannelQueues';return db['UserProfileSection'][_0x59da('0x55')]({'where':{'name':_0x2c6331,'userProfileId':_0x48367c[_0x59da('0x56')]},'raw':!![]})[_0x59da('0x29')](function(_0x2a221d){if(_0x2a221d&&_0x2a221d[_0x59da('0x57')]===0x0){return db[_0x59da('0x2d')][_0x59da('0x50')]({'name':_0x23aa13[_0x59da('0x2e')],'resourceId':_0x23aa13['id'],'type':_0x2a221d[_0x59da('0x2e')],'sectionId':_0x2a221d['id']},{})[_0x59da('0x29')](function(){return _0x1f9e54;});}else{return _0x1f9e54;}})['catch'](function(_0x52c68a){logger[_0x59da('0x58')](_0x59da('0x59'),_0x52c68a);throw _0x52c68a;});}return _0x1f9e54;})['then'](respondWithResult(_0x249652,0xc9))[_0x59da('0x4f')](handleError(_0x249652,null));};exports[_0x59da('0x28')]=function(_0x2e44b9,_0x3e08d4){if(_0x2e44b9[_0x59da('0x51')]['id']){delete _0x2e44b9['body']['id'];}return db[_0x59da('0x31')][_0x59da('0x55')]({'where':{'id':_0x2e44b9[_0x59da('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e08d4,null))[_0x59da('0x29')](saveUpdates(_0x2e44b9['body'],null))[_0x59da('0x29')](respondWithResult(_0x3e08d4,null))[_0x59da('0x4f')](handleError(_0x3e08d4,null));};exports[_0x59da('0x2a')]=function(_0x4663fb,_0x248a0c){return db[_0x59da('0x31')]['find']({'where':{'id':_0x4663fb['params']['id']}})['then'](handleEntityNotFound(_0x248a0c,null))['then'](removeEntity(_0x248a0c,null))[_0x59da('0x4f')](handleError(_0x248a0c,null));};exports[_0x59da('0x5a')]=function(_0x4dba40,_0x41aba3){return db[_0x59da('0x31')][_0x59da('0x5a')]()[_0x59da('0x29')](respondWithResult(_0x41aba3,null))['catch'](handleError(_0x41aba3,null));};exports['getMembers']=function(_0x505515,_0x1a7704,_0x568f98){var _0x4fe8d6={'raw':!![],'where':{}},_0x33a9b7={},_0xcb7f5b;return db['OpenchannelQueue'][_0x59da('0x5b')]({'where':{'id':_0x505515['params']['id']}})[_0x59da('0x29')](handleEntityNotFound(_0x1a7704,null))[_0x59da('0x29')](function(_0x2e9921){if(_0x2e9921){_0xcb7f5b=_0x2e9921[_0x59da('0x2b')]({'plain':!![]});_0x33a9b7['model']=_['keys'](db['UserOpenchannelQueue'][_0x59da('0x32')]);_0x33a9b7[_0x59da('0x37')]=_[_0x59da('0x4e')](_0x505515['query']);_0x33a9b7[_0x59da('0x40')]=_['intersection'](_0x33a9b7[_0x59da('0x35')],_0x33a9b7[_0x59da('0x37')]);_0x4fe8d6[_0x59da('0x3a')]=_[_0x59da('0x38')](_0x33a9b7[_0x59da('0x35')],qs[_0x59da('0x39')](_0x505515[_0x59da('0x37')]['fields']));_0x4fe8d6['attributes']=_0x4fe8d6[_0x59da('0x3a')]['length']?_0x4fe8d6[_0x59da('0x3a')]:_0x33a9b7[_0x59da('0x35')];if(!_0x505515['query'][_0x59da('0x3c')]('nolimit')){_0x4fe8d6['limit']=qs[_0x59da('0x21')](_0x505515[_0x59da('0x37')][_0x59da('0x21')]);_0x4fe8d6[_0x59da('0x20')]=qs[_0x59da('0x20')](_0x505515[_0x59da('0x37')]['offset']);}_0x4fe8d6[_0x59da('0x3d')]=qs[_0x59da('0x3e')](_0x505515['query']['sort']);_0x4fe8d6[_0x59da('0x43')]=qs[_0x59da('0x40')](_['pick'](_0x505515[_0x59da('0x37')],_0x33a9b7[_0x59da('0x40')]));_0x4fe8d6['where'][_0x59da('0x5c')]=_0x2e9921['id'];if(_0x505515[_0x59da('0x37')][_0x59da('0x41')]){_0x4fe8d6[_0x59da('0x43')]=_[_0x59da('0x42')](_0x4fe8d6['where'],{'$or':_[_0x59da('0x36')](_0x4fe8d6[_0x59da('0x3a')],function(_0x360dda){var _0x159b56={};_0x159b56[_0x360dda]={'$like':'%'+_0x505515['query'][_0x59da('0x41')]+'%'};return _0x159b56;})});}_0x4fe8d6=_[_0x59da('0x42')]({},_0x4fe8d6,_0x505515[_0x59da('0x46')]);return db[_0x59da('0x5d')]['findAll'](_0x4fe8d6);}})['then'](function(_0x1cae89){if(_0x1cae89){return db[_0x59da('0x5e')][_0x59da('0x5f')]({'where':{'id':_[_0x59da('0x36')](_0x1cae89,_0x59da('0x60')),'role':_0x59da('0x61')},'attributes':['id','name',_0x59da('0x62'),_0x59da('0x63'),_0x59da('0x64')]});}})['then'](function(_0x30dcc2){if(_0x30dcc2){return{'count':_0x30dcc2['count'],'rows':_['map'](_0x30dcc2[_0x59da('0x4b')],function(_0x31ba44){return{'membername':_0x31ba44[_0x59da('0x2e')],'UserId':_0x31ba44['id'],'queue_name':_0xcb7f5b[_0x59da('0x2e')],'OpenchannelQueueId':_0xcb7f5b['id'],'interface':util['format']('%s/%s',_0x59da('0x65'),_0x31ba44['name']),'penalty':0x0,'paused':_0x31ba44[_0x59da('0x62')],'createdAt':_0x31ba44[_0x59da('0x64')],'updatedAt':_0x31ba44['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x59da('0x29')](respondWithFilteredResult(_0x1a7704,_0x4fe8d6))[_0x59da('0x4f')](handleError(_0x1a7704,null));};exports[_0x59da('0x66')]=function(_0xe86af4,_0x2c90b7,_0x5a9a2e){var _0x1c9ed4={};var _0x367c99={};var _0x16085b;var _0x48de68;return db[_0x59da('0x31')][_0x59da('0x5b')]({'where':{'id':_0xe86af4['params']['id']}})['then'](handleEntityNotFound(_0x2c90b7,null))['then'](function(_0x36544c){if(_0x36544c){_0x16085b=_0x36544c;_0x367c99['model']=_[_0x59da('0x4e')](db['Team'][_0x59da('0x32')]);_0x367c99[_0x59da('0x37')]=_[_0x59da('0x4e')](_0xe86af4['query']);_0x367c99[_0x59da('0x40')]=_[_0x59da('0x38')](_0x367c99[_0x59da('0x35')],_0x367c99['query']);_0x1c9ed4[_0x59da('0x3a')]=_[_0x59da('0x38')](_0x367c99[_0x59da('0x35')],qs[_0x59da('0x39')](_0xe86af4['query'][_0x59da('0x39')]));_0x1c9ed4[_0x59da('0x3a')]=_0x1c9ed4[_0x59da('0x3a')][_0x59da('0x3b')]?_0x1c9ed4[_0x59da('0x3a')]:_0x367c99[_0x59da('0x35')];_0x1c9ed4[_0x59da('0x3d')]=qs[_0x59da('0x3e')](_0xe86af4[_0x59da('0x37')][_0x59da('0x3e')]);_0x1c9ed4[_0x59da('0x43')]=qs[_0x59da('0x40')](_[_0x59da('0x3f')](_0xe86af4['query'],_0x367c99[_0x59da('0x40')]));if(_0xe86af4[_0x59da('0x37')][_0x59da('0x41')]){_0x1c9ed4[_0x59da('0x43')]=_['merge'](_0x1c9ed4[_0x59da('0x43')],{'$or':_['map'](_0x1c9ed4[_0x59da('0x3a')],function(_0x5d9937){var _0x263880={};_0x263880[_0x5d9937]={'$like':'%'+_0xe86af4[_0x59da('0x37')]['filter']+'%'};return _0x263880;})});}_0x1c9ed4=_['merge']({},_0x1c9ed4,_0xe86af4[_0x59da('0x46')]);return _0x16085b[_0x59da('0x66')](_0x1c9ed4);}})['then'](function(_0x42d9e3){if(_0x42d9e3){_0x48de68=_0x42d9e3[_0x59da('0x3b')];if(!_0xe86af4[_0x59da('0x37')]['hasOwnProperty']('nolimit')){_0x1c9ed4['limit']=qs['limit'](_0xe86af4[_0x59da('0x37')][_0x59da('0x21')]);_0x1c9ed4[_0x59da('0x20')]=qs[_0x59da('0x20')](_0xe86af4[_0x59da('0x37')][_0x59da('0x20')]);}return _0x16085b['getTeams'](_0x1c9ed4);}})[_0x59da('0x29')](function(_0x19da39){if(_0x19da39){return _0x19da39?{'count':_0x48de68,'rows':_0x19da39}:null;}})[_0x59da('0x29')](respondWithResult(_0x2c90b7,null))[_0x59da('0x4f')](handleError(_0x2c90b7,null));};exports[_0x59da('0x67')]=function(_0x5a28fe,_0xa1de3c,_0x2f5840){var _0x30fd08=_0x5a28fe[_0x59da('0x51')][_0x59da('0x68')];return db[_0x59da('0x69')][_0x59da('0x4a')]({'where':{'id':_0x30fd08},'attributes':['id'],'include':[{'model':db[_0x59da('0x5e')],'as':_0x59da('0x6a'),'attributes':['id','name',_0x59da('0x6b'),_0x59da('0x6c'),_0x59da('0x6d')],'raw':!![]}]})['then'](function(_0x144002){if(_0x144002){var _0x48014d=_[_0x59da('0x6e')](_0x144002,function(_0x22897b){var _0x5bca04=_0x22897b[_0x59da('0x2b')]({'plain':!![]});return _0x5bca04[_0x59da('0x6a')];});return db[_0x59da('0x31')][_0x59da('0x55')]({'where':{'id':_0x5a28fe[_0x59da('0x4d')]['id']}})['then'](function(_0x3a629d){return db[_0x59da('0x6f')][_0x59da('0x70')](function(_0x57a671){return _0x3a629d[_0x59da('0x67')](_0x30fd08,{'transaction':_0x57a671})[_0x59da('0x29')](function(){return BPromise[_0x59da('0x71')](_0x48014d,function(_0x3b616c){return db[_0x59da('0x5d')][_0x59da('0x72')]({'where':{'UserId':_0x3b616c['id'],'OpenchannelQueueId':_0x5a28fe[_0x59da('0x4d')]['id']},'transaction':_0x57a671});});})[_0x59da('0x29')](function(){_0x48014d[_0x59da('0x73')](function(_0x5ae207){socket[_0x59da('0x74')](_0x59da('0x75'),{'UserId':_0x5ae207['id'],'OpenchannelQueueId':_0x3a629d['id']});});});});});}})[_0x59da('0x29')](respondWithStatusCode(_0xa1de3c,null))[_0x59da('0x4f')](handleError(_0xa1de3c,null));};exports[_0x59da('0x76')]=function(_0x3a2cf5,_0x1c6092,_0x37e7cb){return db[_0x59da('0x69')][_0x59da('0x4a')]({'where':{'id':_0x3a2cf5[_0x59da('0x37')][_0x59da('0x68')]},'attributes':['id'],'include':[{'model':db[_0x59da('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1c6092,null))[_0x59da('0x29')](function(_0x323848){var _0x24386c=_[_0x59da('0x36')](_0x323848,'id');var _0x23edb2=[];var _0x90e282=[];var _0x25ba7d=squel[_0x59da('0x77')]();_0x25ba7d[_0x59da('0x78')](_0x59da('0x79'))[_0x59da('0x7a')]('team_has_openchannel_queues','tq')[_0x59da('0x7b')](_0x59da('0x7c'),'ut',_0x59da('0x7d'))[_0x59da('0x43')](_0x59da('0x7e'),_0x3a2cf5[_0x59da('0x4d')]['id']);for(var _0x38ea67=0x0;_0x38ea67<_0x323848['length'];_0x38ea67+=0x1){let _0xd980a3=_0x323848[_0x38ea67];for(var _0xe8ee0=0x0;_0xe8ee0<_0xd980a3['Agents'][_0x59da('0x3b')];_0xe8ee0+=0x1){let _0x5a3e06=_0xd980a3[_0x59da('0x6a')][_0xe8ee0];var _0x338546=_0x25ba7d[_0x59da('0x7f')]();_0x338546[_0x59da('0x43')](_0x59da('0x80'),_0x5a3e06['id']);_0x90e282['push'](db[_0x59da('0x6f')][_0x59da('0x37')](_0x338546[_0x59da('0x81')](),{'type':db[_0x59da('0x6f')][_0x59da('0x82')][_0x59da('0x83')]})['then'](function(_0x2f18d2){if(_0x2f18d2['length']===0x1){return _0x5a3e06['id'];}else{var _0x5e2c2c=_[_0x59da('0x84')](_['map'](_0x2f18d2,'TeamId'),function(_0xdc7800){return _[_0x59da('0x85')](_0x24386c,_0xdc7800);});if(_0x5e2c2c){return _0x5a3e06['id'];}}}));}}return BPromise[_0x59da('0x86')](_0x90e282)['then'](function(_0x4f5612){_0x23edb2=_(_0x23edb2)[_0x59da('0x87')](_0x4f5612)[_0x59da('0x88')]()[_0x59da('0x89')]();return db[_0x59da('0x31')][_0x59da('0x55')]({'where':{'id':_0x3a2cf5['params']['id']}})[_0x59da('0x29')](function(_0x5df381){return db['sequelize'][_0x59da('0x70')](function(_0x18c429){return _0x5df381[_0x59da('0x76')](_0x3a2cf5[_0x59da('0x37')][_0x59da('0x68')],{'transaction':_0x18c429})[_0x59da('0x29')](function(){if(!_[_0x59da('0x8a')](_0x23edb2)){return _0x5df381[_0x59da('0x8b')](_0x23edb2,{'transaction':_0x18c429});}})[_0x59da('0x29')](function(){_0x23edb2[_0x59da('0x73')](function(_0x32640b){socket[_0x59da('0x74')](_0x59da('0x8c'),{'UserId':_0x32640b,'OpenchannelQueueId':_0x5df381['id']});});});});});});})['then'](respondWithStatusCode(_0x1c6092,null))[_0x59da('0x4f')](handleError(_0x1c6092,null));};exports[_0x59da('0x8d')]=function(_0x2a82f4,_0x11b9b5,_0x18724a){return db[_0x59da('0x31')][_0x59da('0x55')]({'where':{'id':_0x2a82f4['params']['id']}})[_0x59da('0x29')](handleEntityNotFound(_0x11b9b5,null))[_0x59da('0x29')](function(_0x5a0b61){if(_0x5a0b61){return _0x5a0b61['addAgents'](_0x2a82f4[_0x59da('0x51')][_0x59da('0x68')],_['omit'](_0x2a82f4[_0x59da('0x51')],[_0x59da('0x68'),'id'])||{})[_0x59da('0x8e')](function(_0x1537f0){for(var _0x2a19fc=0x0;_0x2a19fc<_0x2a82f4[_0x59da('0x51')][_0x59da('0x68')]['length'];_0x2a19fc+=0x1){socket[_0x59da('0x74')](_0x59da('0x75'),{'UserId':Number(_0x2a82f4['body']['ids'][_0x2a19fc]),'OpenchannelQueueId':Number(_0x2a82f4[_0x59da('0x4d')]['id'])});}return _0x1537f0;});}})[_0x59da('0x29')](respondWithResult(_0x11b9b5,null))[_0x59da('0x4f')](handleError(_0x11b9b5,null));};exports[_0x59da('0x8b')]=function(_0x5885f5,_0x4235fb,_0x32ab1d){return db['OpenchannelQueue'][_0x59da('0x55')]({'where':{'id':_0x5885f5[_0x59da('0x4d')]['id']}})[_0x59da('0x29')](handleEntityNotFound(_0x4235fb,null))[_0x59da('0x29')](function(_0x7cfb05){if(_0x7cfb05){return _0x7cfb05[_0x59da('0x8b')](_0x5885f5[_0x59da('0x37')]['ids'])[_0x59da('0x29')](function(){if(_[_0x59da('0x8f')](_0x5885f5[_0x59da('0x37')]['ids'])){for(var _0x2f981f=0x0;_0x2f981f<_0x5885f5[_0x59da('0x37')][_0x59da('0x68')][_0x59da('0x3b')];_0x2f981f+=0x1){socket['emit'](_0x59da('0x8c'),{'UserId':Number(_0x5885f5[_0x59da('0x37')][_0x59da('0x68')][_0x2f981f]),'OpenchannelQueueId':Number(_0x5885f5['params']['id'])});}}else{socket['emit'](_0x59da('0x8c'),{'UserId':Number(_0x5885f5[_0x59da('0x37')][_0x59da('0x68')]),'OpenchannelQueueId':Number(_0x5885f5['params']['id'])});}});}})[_0x59da('0x29')](respondWithStatusCode(_0x4235fb,null))[_0x59da('0x4f')](handleError(_0x4235fb,null));};exports[_0x59da('0x90')]=function(_0x4b1b41,_0x4b64b4,_0x253274){var _0x737c4={};var _0x5d6e6b={};var _0x305a6f;var _0x1bc389;return db[_0x59da('0x31')][_0x59da('0x5b')]({'where':{'id':_0x4b1b41[_0x59da('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b64b4,null))[_0x59da('0x29')](function(_0xf1759e){if(_0xf1759e){_0x305a6f=_0xf1759e;_0x5d6e6b[_0x59da('0x35')]=_['keys'](db[_0x59da('0x5e')]['rawAttributes']);_0x5d6e6b[_0x59da('0x37')]=_[_0x59da('0x4e')](_0x4b1b41[_0x59da('0x37')]);_0x5d6e6b[_0x59da('0x40')]=_[_0x59da('0x38')](_0x5d6e6b[_0x59da('0x35')],_0x5d6e6b[_0x59da('0x37')]);_0x737c4['attributes']=_[_0x59da('0x38')](_0x5d6e6b[_0x59da('0x35')],qs['fields'](_0x4b1b41[_0x59da('0x37')][_0x59da('0x39')]));_0x737c4[_0x59da('0x3a')]=_0x737c4[_0x59da('0x3a')][_0x59da('0x3b')]?_0x737c4[_0x59da('0x3a')]:_0x5d6e6b[_0x59da('0x35')];_0x737c4[_0x59da('0x3d')]=qs[_0x59da('0x3e')](_0x4b1b41[_0x59da('0x37')]['sort']);_0x737c4[_0x59da('0x43')]=qs[_0x59da('0x40')](_[_0x59da('0x3f')](_0x4b1b41[_0x59da('0x37')],_0x5d6e6b[_0x59da('0x40')]));if(_0x4b1b41[_0x59da('0x37')]['filter']){_0x737c4[_0x59da('0x43')]=_[_0x59da('0x42')](_0x737c4[_0x59da('0x43')],{'$or':_[_0x59da('0x36')](_0x737c4['attributes'],function(_0x1b9fca){var _0x294f19={};_0x294f19[_0x1b9fca]={'$like':'%'+_0x4b1b41[_0x59da('0x37')][_0x59da('0x41')]+'%'};return _0x294f19;})});}_0x737c4=_['merge']({},_0x737c4,_0x4b1b41[_0x59da('0x46')]);return _0x305a6f[_0x59da('0x90')](_0x737c4);}})[_0x59da('0x29')](function(_0x81dc32){if(_0x81dc32){_0x1bc389=_0x81dc32[_0x59da('0x3b')];if(!_0x4b1b41[_0x59da('0x37')][_0x59da('0x3c')](_0x59da('0x91'))){_0x737c4[_0x59da('0x21')]=qs[_0x59da('0x21')](_0x4b1b41['query'][_0x59da('0x21')]);_0x737c4[_0x59da('0x20')]=qs[_0x59da('0x20')](_0x4b1b41[_0x59da('0x37')][_0x59da('0x20')]);}return _0x305a6f[_0x59da('0x90')](_0x737c4);}})[_0x59da('0x29')](function(_0x18f74c){if(_0x18f74c){return _0x18f74c?{'count':_0x1bc389,'rows':_0x18f74c}:null;}})[_0x59da('0x29')](respondWithResult(_0x4b64b4,null))[_0x59da('0x4f')](handleError(_0x4b64b4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e35b0e0..6eab674 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 _0xc285=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x5bd7ea,_0xabc85f){var _0x40b84d=function(_0x156338){while(--_0x156338){_0x5bd7ea['push'](_0x5bd7ea['shift']());}};_0x40b84d(++_0xabc85f);}(_0xc285,0xd8));var _0x5c28=function(_0x1bc750,_0x23f442){_0x1bc750=_0x1bc750-0x0;var _0xcd51da=_0xc285[_0x1bc750];return _0xcd51da;};'use strict';var EventEmitter=require(_0x5c28('0x0'));var OpenchannelQueue=require(_0x5c28('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5c28('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c28('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd72f18){return function(_0x3bf1de,_0x4f6468,_0xd2f679){OpenchannelQueueEvents[_0x5c28('0x4')](_0xd72f18+':'+_0x3bf1de['id'],_0x3bf1de);OpenchannelQueueEvents[_0x5c28('0x4')](_0xd72f18,_0x3bf1de);_0xd2f679(null);};}for(var e in events){if(events[_0x5c28('0x5')](e)){var event=events[e];OpenchannelQueue[_0x5c28('0x6')](e,emitEvent(event));}}module[_0x5c28('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xb692=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x276506,_0x103190){var _0x1ee03e=function(_0x2cdc9e){while(--_0x2cdc9e){_0x276506['push'](_0x276506['shift']());}};_0x1ee03e(++_0x103190);}(_0xb692,0x183));var _0x2b69=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0xb692[_0xef4cf0];return _0x497ad2;};'use strict';var EventEmitter=require(_0x2b69('0x0'));var OpenchannelQueue=require(_0x2b69('0x1'))['db'][_0x2b69('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2b69('0x3')](0x0);var events={'afterCreate':_0x2b69('0x4'),'afterUpdate':_0x2b69('0x5'),'afterDestroy':_0x2b69('0x6')};function emitEvent(_0x354b27){return function(_0x396c6b,_0x3d371d,_0x343c8c){OpenchannelQueueEvents['emit'](_0x354b27+':'+_0x396c6b['id'],_0x396c6b);OpenchannelQueueEvents[_0x2b69('0x7')](_0x354b27,_0x396c6b);_0x343c8c(null);};}for(var e in events){if(events[_0x2b69('0x8')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x2b69('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 fe77de9..0401fc6 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 _0xbbbb=['openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xbbbb,0xfd));var _0xbbbb=function(_0x1ca5b4,_0x315446){_0x1ca5b4=_0x1ca5b4-0x0;var _0x361c1a=_0xbbbb[_0x1ca5b4];return _0x361c1a;};'use strict';var _=require(_0xbbbb('0x0'));var util=require(_0xbbbb('0x1'));var logger=require(_0xbbbb('0x2'))(_0xbbbb('0x3'));var moment=require(_0xbbbb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbbb('0x5'));var fs=require('fs');var path=require(_0xbbbb('0x6'));var rimraf=require('rimraf');var config=require(_0xbbbb('0x7'));var attributes=require(_0xbbbb('0x8'));module[_0xbbbb('0x9')]=function(_0x466aae,_0x8d12ac){return _0x466aae[_0xbbbb('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xbbbb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5384=['define','openchannel_queues','util','api','bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x2e107c,_0x31ed8e){var _0x3a69a6=function(_0x15679a){while(--_0x15679a){_0x2e107c['push'](_0x2e107c['shift']());}};_0x3a69a6(++_0x31ed8e);}(_0x5384,0x1a9));var _0x4538=function(_0x396587,_0x231d16){_0x396587=_0x396587-0x0;var _0x3cab9d=_0x5384[_0x396587];return _0x3cab9d;};'use strict';var _=require('lodash');var util=require(_0x4538('0x0'));var logger=require('../../config/logger')(_0x4538('0x1'));var moment=require('moment');var BPromise=require(_0x4538('0x2'));var rp=require(_0x4538('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4538('0x4'));var attributes=require(_0x4538('0x5'));module[_0x4538('0x6')]=function(_0x2ded7c,_0x143a48){return _0x2ded7c[_0x4538('0x7')]('OpenchannelQueue',attributes,{'tableName':_0x4538('0x8'),'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 0985999..445b738 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 _0x0155=['register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','model','map','stringify','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket'];(function(_0x1daac8,_0x2e1db4){var _0x45b253=function(_0x523af5){while(--_0x523af5){_0x1daac8['push'](_0x1daac8['shift']());}};_0x45b253(++_0x2e1db4);}(_0x0155,0x158));var _0x5015=function(_0x4ff28a,_0x42164c){_0x4ff28a=_0x4ff28a-0x0;var _0x4ee5e4=_0x0155[_0x4ff28a];return _0x4ee5e4;};'use strict';var _=require(_0x5015('0x0'));var util=require(_0x5015('0x1'));var moment=require(_0x5015('0x2'));var BPromise=require(_0x5015('0x3'));var rs=require(_0x5015('0x4'));var fs=require('fs');var Redis=require(_0x5015('0x5'));var db=require(_0x5015('0x6'))['db'];var utils=require(_0x5015('0x7'));var logger=require(_0x5015('0x8'))('rpc');var config=require(_0x5015('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5015('0xa')]['http']({'port':0x232a});config[_0x5015('0xb')]=_[_0x5015('0xc')](config[_0x5015('0xb')],{'host':_0x5015('0xd'),'port':0x18eb});var socket=require(_0x5015('0xe'))(new Redis(config['redis']));require(_0x5015('0xf'))[_0x5015('0x10')](socket);function respondWithRpcPromise(_0x579394,_0x4420d9,_0x335046){return new BPromise(function(_0x203226,_0x587baa){return client[_0x5015('0x11')](_0x579394,_0x335046)[_0x5015('0x12')](function(_0x160d94){logger[_0x5015('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4420d9,_0x5015('0x14'));logger[_0x5015('0x15')](_0x5015('0x16'),_0x4420d9,_0x5015('0x14'),JSON['stringify'](_0x160d94));if(_0x160d94[_0x5015('0x17')]){if(_0x160d94['error'][_0x5015('0x18')]===0x1f4){logger[_0x5015('0x17')](_0x5015('0x19'),_0x4420d9,_0x160d94[_0x5015('0x17')][_0x5015('0x1a')]);return _0x587baa(_0x160d94[_0x5015('0x17')]['message']);}logger[_0x5015('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4420d9,_0x160d94[_0x5015('0x17')]['message']);return _0x203226(_0x160d94[_0x5015('0x17')]['message']);}else{logger[_0x5015('0x13')](_0x5015('0x19'),_0x4420d9,'request\x20sent');_0x203226(_0x160d94['result']['message']);}})[_0x5015('0x1b')](function(_0x52b6f6){logger[_0x5015('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x4420d9,_0x52b6f6);_0x587baa(_0x52b6f6);});});}exports[_0x5015('0x1c')]=function(_0xc72771){var _0x389f0a=this;return new Promise(function(_0xba411c,_0x1e0313){return db[_0x5015('0x1d')][_0x5015('0x1e')]({'raw':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')][_0x5015('0x20')]===undefined?!![]:![]:!![],'where':_0xc72771[_0x5015('0x1f')]?_0xc72771['options']['where']||null:null,'attributes':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')][_0x5015('0x21')]||null:null,'limit':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')]['limit']||null:null,'include':_0xc72771[_0x5015('0x1f')]?_0xc72771[_0x5015('0x1f')][_0x5015('0x22')]?_['map'](_0xc72771[_0x5015('0x1f')]['include'],function(_0x558b39){return{'model':db[_0x558b39[_0x5015('0x23')]],'as':_0x558b39['as'],'attributes':_0x558b39['attributes'],'include':_0x558b39[_0x5015('0x22')]?_[_0x5015('0x24')](_0x558b39[_0x5015('0x22')],function(_0x53b30d){return{'model':db[_0x53b30d[_0x5015('0x23')]],'as':_0x53b30d['as'],'attributes':_0x53b30d['attributes'],'include':_0x53b30d[_0x5015('0x22')]?_[_0x5015('0x24')](_0x53b30d[_0x5015('0x22')],function(_0x2012ae){return{'model':db[_0x2012ae[_0x5015('0x23')]],'as':_0x2012ae['as'],'attributes':_0x2012ae[_0x5015('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5015('0x12')](function(_0x5b6f4d){logger[_0x5015('0x13')](_0x5015('0x1c'),_0xc72771);logger[_0x5015('0x15')]('GetOpenchannelQueue',_0xc72771,JSON[_0x5015('0x25')](_0x5b6f4d));_0xba411c(_0x5b6f4d);})[_0x5015('0x1b')](function(_0x18f4e1){logger['error'](_0x5015('0x1c'),_0x18f4e1[_0x5015('0x1a')],_0xc72771);_0x1e0313(_0x389f0a[_0x5015('0x17')](0x1f4,_0x18f4e1[_0x5015('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x1e931f){var _0x170ced=this;return new Promise(function(_0x10578c,_0x16234a){return db[_0x5015('0x1d')][_0x5015('0x26')]({'raw':_0x1e931f['options']?_0x1e931f['options'][_0x5015('0x20')]===undefined?!![]:![]:!![],'where':_0x1e931f[_0x5015('0x1f')]?_0x1e931f['options']['where']||null:null,'attributes':_0x1e931f['options']?_0x1e931f[_0x5015('0x1f')][_0x5015('0x21')]||null:null,'include':_0x1e931f[_0x5015('0x1f')]?_0x1e931f[_0x5015('0x1f')]['include']?_[_0x5015('0x24')](_0x1e931f[_0x5015('0x1f')][_0x5015('0x22')],function(_0x3377d6){return{'model':db[_0x3377d6[_0x5015('0x23')]],'as':_0x3377d6['as'],'attributes':_0x3377d6[_0x5015('0x21')],'include':_0x3377d6['include']?_['map'](_0x3377d6[_0x5015('0x22')],function(_0x147ecb){return{'model':db[_0x147ecb['model']],'as':_0x147ecb['as'],'attributes':_0x147ecb[_0x5015('0x21')],'include':_0x147ecb[_0x5015('0x22')]?_[_0x5015('0x24')](_0x147ecb[_0x5015('0x22')],function(_0x89900b){return{'model':db[_0x89900b[_0x5015('0x23')]],'as':_0x89900b['as'],'attributes':_0x89900b[_0x5015('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5015('0x12')](function(_0x3d1437){logger[_0x5015('0x13')](_0x5015('0x27'),_0x1e931f);logger[_0x5015('0x15')]('ShowOpenchannelQueue',_0x1e931f,JSON[_0x5015('0x25')](_0x3d1437));_0x10578c(_0x3d1437);})[_0x5015('0x1b')](function(_0x4d664b){logger[_0x5015('0x17')](_0x5015('0x27'),_0x4d664b['message'],_0x1e931f);_0x16234a(_0x170ced[_0x5015('0x17')](0x1f4,_0x4d664b[_0x5015('0x1a')]));});});}; \ No newline at end of file +var _0xd2d2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','then','catch','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xd2d2,0x15a));var _0x2d2d=function(_0x4e5c1b,_0x142748){_0x4e5c1b=_0x4e5c1b-0x0;var _0x488c3e=_0xd2d2[_0x4e5c1b];return _0x488c3e;};'use strict';var _=require(_0x2d2d('0x0'));var util=require(_0x2d2d('0x1'));var moment=require('moment');var BPromise=require(_0x2d2d('0x2'));var rs=require(_0x2d2d('0x3'));var fs=require('fs');var Redis=require(_0x2d2d('0x4'));var db=require(_0x2d2d('0x5'))['db'];var utils=require(_0x2d2d('0x6'));var logger=require(_0x2d2d('0x7'))(_0x2d2d('0x8'));var config=require(_0x2d2d('0x9'));var jayson=require(_0x2d2d('0xa'));var client=jayson[_0x2d2d('0xb')]['http']({'port':0x232a});config[_0x2d2d('0xc')]=_['defaults'](config[_0x2d2d('0xc')],{'host':_0x2d2d('0xd'),'port':0x18eb});var socket=require(_0x2d2d('0xe'))(new Redis(config['redis']));require(_0x2d2d('0xf'))['register'](socket);function respondWithRpcPromise(_0x3efd2e,_0x1aeefa,_0x3232eb){return new BPromise(function(_0x30d345,_0x1f254d){return client['request'](_0x3efd2e,_0x3232eb)['then'](function(_0x29bc21){logger[_0x2d2d('0x10')](_0x2d2d('0x11'),_0x1aeefa,'request\x20sent');logger[_0x2d2d('0x12')](_0x2d2d('0x13'),_0x1aeefa,_0x2d2d('0x14'),JSON[_0x2d2d('0x15')](_0x29bc21));if(_0x29bc21['error']){if(_0x29bc21['error']['code']===0x1f4){logger[_0x2d2d('0x16')](_0x2d2d('0x11'),_0x1aeefa,_0x29bc21[_0x2d2d('0x16')][_0x2d2d('0x17')]);return _0x1f254d(_0x29bc21[_0x2d2d('0x16')][_0x2d2d('0x17')]);}logger[_0x2d2d('0x16')](_0x2d2d('0x11'),_0x1aeefa,_0x29bc21[_0x2d2d('0x16')][_0x2d2d('0x17')]);return _0x30d345(_0x29bc21[_0x2d2d('0x16')][_0x2d2d('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x1aeefa,'request\x20sent');_0x30d345(_0x29bc21[_0x2d2d('0x18')][_0x2d2d('0x17')]);}})['catch'](function(_0x24dc48){logger[_0x2d2d('0x16')](_0x2d2d('0x11'),_0x1aeefa,_0x24dc48);_0x1f254d(_0x24dc48);});});}exports[_0x2d2d('0x19')]=function(_0x1e9f66){var _0x17ac04=this;return new Promise(function(_0x1d1f98,_0x3ae785){return db[_0x2d2d('0x1a')][_0x2d2d('0x1b')]({'raw':_0x1e9f66[_0x2d2d('0x1c')]?_0x1e9f66[_0x2d2d('0x1c')][_0x2d2d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1e9f66['options']?_0x1e9f66['options'][_0x2d2d('0x1e')]||null:null,'attributes':_0x1e9f66[_0x2d2d('0x1c')]?_0x1e9f66[_0x2d2d('0x1c')][_0x2d2d('0x1f')]||null:null,'limit':_0x1e9f66[_0x2d2d('0x1c')]?_0x1e9f66[_0x2d2d('0x1c')]['limit']||null:null,'include':_0x1e9f66[_0x2d2d('0x1c')]?_0x1e9f66[_0x2d2d('0x1c')]['include']?_['map'](_0x1e9f66[_0x2d2d('0x1c')]['include'],function(_0x59e165){return{'model':db[_0x59e165['model']],'as':_0x59e165['as'],'attributes':_0x59e165[_0x2d2d('0x1f')],'include':_0x59e165[_0x2d2d('0x20')]?_[_0x2d2d('0x21')](_0x59e165[_0x2d2d('0x20')],function(_0x8efe41){return{'model':db[_0x8efe41['model']],'as':_0x8efe41['as'],'attributes':_0x8efe41[_0x2d2d('0x1f')],'include':_0x8efe41[_0x2d2d('0x20')]?_[_0x2d2d('0x21')](_0x8efe41[_0x2d2d('0x20')],function(_0x5ae7ca){return{'model':db[_0x5ae7ca[_0x2d2d('0x22')]],'as':_0x5ae7ca['as'],'attributes':_0x5ae7ca[_0x2d2d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2d2d('0x23')](function(_0x5975f4){logger[_0x2d2d('0x10')]('GetOpenchannelQueue',_0x1e9f66);logger[_0x2d2d('0x12')]('GetOpenchannelQueue',_0x1e9f66,JSON[_0x2d2d('0x15')](_0x5975f4));_0x1d1f98(_0x5975f4);})[_0x2d2d('0x24')](function(_0x1fc928){logger[_0x2d2d('0x16')](_0x2d2d('0x19'),_0x1fc928['message'],_0x1e9f66);_0x3ae785(_0x17ac04[_0x2d2d('0x16')](0x1f4,_0x1fc928['message']));});});};exports[_0x2d2d('0x25')]=function(_0x237f9c){var _0x82d981=this;return new Promise(function(_0x342d99,_0xfa100f){return db[_0x2d2d('0x1a')][_0x2d2d('0x26')]({'raw':_0x237f9c['options']?_0x237f9c[_0x2d2d('0x1c')][_0x2d2d('0x1d')]===undefined?!![]:![]:!![],'where':_0x237f9c[_0x2d2d('0x1c')]?_0x237f9c['options'][_0x2d2d('0x1e')]||null:null,'attributes':_0x237f9c[_0x2d2d('0x1c')]?_0x237f9c['options'][_0x2d2d('0x1f')]||null:null,'include':_0x237f9c['options']?_0x237f9c[_0x2d2d('0x1c')][_0x2d2d('0x20')]?_['map'](_0x237f9c[_0x2d2d('0x1c')][_0x2d2d('0x20')],function(_0x4aedf8){return{'model':db[_0x4aedf8[_0x2d2d('0x22')]],'as':_0x4aedf8['as'],'attributes':_0x4aedf8[_0x2d2d('0x1f')],'include':_0x4aedf8[_0x2d2d('0x20')]?_[_0x2d2d('0x21')](_0x4aedf8[_0x2d2d('0x20')],function(_0x1390e5){return{'model':db[_0x1390e5[_0x2d2d('0x22')]],'as':_0x1390e5['as'],'attributes':_0x1390e5[_0x2d2d('0x1f')],'include':_0x1390e5[_0x2d2d('0x20')]?_['map'](_0x1390e5[_0x2d2d('0x20')],function(_0x55d665){return{'model':db[_0x55d665['model']],'as':_0x55d665['as'],'attributes':_0x55d665[_0x2d2d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2d2d('0x23')](function(_0xb293ee){logger[_0x2d2d('0x10')](_0x2d2d('0x25'),_0x237f9c);logger[_0x2d2d('0x12')](_0x2d2d('0x25'),_0x237f9c,JSON[_0x2d2d('0x15')](_0xb293ee));_0x342d99(_0xb293ee);})[_0x2d2d('0x24')](function(_0x4dade2){logger[_0x2d2d('0x16')]('ShowOpenchannelQueue',_0x4dade2[_0x2d2d('0x17')],_0x237f9c);_0xfa100f(_0x82d981[_0x2d2d('0x16')](0x1f4,_0x4dade2[_0x2d2d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f3f647c..a844309 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 _0x69a2=['openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x177fb8,_0x41bb55){var _0xa52dc2=function(_0x421c8f){while(--_0x421c8f){_0x177fb8['push'](_0x177fb8['shift']());}};_0xa52dc2(++_0x41bb55);}(_0x69a2,0x1a1));var _0x269a=function(_0x281d47,_0x3aef47){_0x281d47=_0x281d47-0x0;var _0x396c51=_0x69a2[_0x281d47];return _0x396c51;};'use strict';var OpenchannelQueueEvents=require(_0x269a('0x0'));var events=['save',_0x269a('0x1'),_0x269a('0x2')];function createListener(_0x4345dc,_0x3481b2){return function(_0x4ed938){_0x3481b2[_0x269a('0x3')](_0x4345dc,_0x4ed938);};}function removeListener(_0x4729eb,_0x2a1630){return function(){OpenchannelQueueEvents[_0x269a('0x4')](_0x4729eb,_0x2a1630);};}exports[_0x269a('0x5')]=function(_0x20f512){for(var _0x592a71=0x0,_0x26392f=events[_0x269a('0x6')];_0x592a71<_0x26392f;_0x592a71++){var _0x3d2d60=events[_0x592a71];var _0x12003a=createListener(_0x269a('0x7')+_0x3d2d60,_0x20f512);OpenchannelQueueEvents['on'](_0x3d2d60,_0x12003a);}}; \ No newline at end of file +var _0x74c1=['removeListener','register','openchannelQueue:','./openchannelQueue.events','remove','update'];(function(_0x56bc94,_0x12ef5d){var _0x3b771b=function(_0x1986ea){while(--_0x1986ea){_0x56bc94['push'](_0x56bc94['shift']());}};_0x3b771b(++_0x12ef5d);}(_0x74c1,0x16b));var _0x174c=function(_0x1c889e,_0x652b56){_0x1c889e=_0x1c889e-0x0;var _0x2fb2b7=_0x74c1[_0x1c889e];return _0x2fb2b7;};'use strict';var OpenchannelQueueEvents=require(_0x174c('0x0'));var events=['save',_0x174c('0x1'),_0x174c('0x2')];function createListener(_0x156d12,_0x469c04){return function(_0x1bd34f){_0x469c04['emit'](_0x156d12,_0x1bd34f);};}function removeListener(_0x2754ad,_0x38fc98){return function(){OpenchannelQueueEvents[_0x174c('0x3')](_0x2754ad,_0x38fc98);};}exports[_0x174c('0x4')]=function(_0x47447d){for(var _0x51e926=0x0,_0xa78c03=events['length'];_0x51e926<_0xa78c03;_0x51e926++){var _0x2eb4b9=events[_0x51e926];var _0x46c61c=createListener(_0x174c('0x5')+_0x2eb4b9,_0x47447d);OpenchannelQueueEvents['on'](_0x2eb4b9,_0x46c61c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 816e464..c6929e9 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 _0x1de8=['isAuthenticated','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','describe','show','post'];(function(_0x2a098b,_0x190126){var _0x47397c=function(_0x555e0f){while(--_0x555e0f){_0x2a098b['push'](_0x2a098b['shift']());}};_0x47397c(++_0x190126);}(_0x1de8,0x118));var _0x81de=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x1de8[_0x368e09];return _0x14b7df;};'use strict';var multer=require(_0x81de('0x0'));var util=require(_0x81de('0x1'));var path=require(_0x81de('0x2'));var timeout=require(_0x81de('0x3'));var express=require(_0x81de('0x4'));var router=express[_0x81de('0x5')]();var fs_extra=require(_0x81de('0x6'));var auth=require(_0x81de('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x81de('0x8'));var controller=require(_0x81de('0x9'));router[_0x81de('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x81de('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x81de('0xb')]);router[_0x81de('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x81de('0xc')]);router[_0x81de('0xd')]('/',auth[_0x81de('0xe')](),controller[_0x81de('0xf')]);router[_0x81de('0x10')](_0x81de('0x11'),auth[_0x81de('0xe')](),controller['update']);router[_0x81de('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x81de('0x13')]);module[_0x81de('0x14')]=router; \ No newline at end of file +var _0x86fc=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x86fc,0x1a4));var _0xc86f=function(_0x211b1e,_0x4c7e93){_0x211b1e=_0x211b1e-0x0;var _0x39571a=_0x86fc[_0x211b1e];return _0x39571a;};'use strict';var multer=require(_0xc86f('0x0'));var util=require(_0xc86f('0x1'));var path=require(_0xc86f('0x2'));var timeout=require(_0xc86f('0x3'));var express=require(_0xc86f('0x4'));var router=express[_0xc86f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc86f('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0xc86f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc86f('0x7')](_0xc86f('0x8'),auth[_0xc86f('0x9')](),controller[_0xc86f('0xa')]);router[_0xc86f('0x7')](_0xc86f('0xb'),auth[_0xc86f('0x9')](),controller['show']);router[_0xc86f('0xc')]('/',auth[_0xc86f('0x9')](),controller[_0xc86f('0xd')]);router[_0xc86f('0xe')](_0xc86f('0xb'),auth[_0xc86f('0x9')](),controller[_0xc86f('0xf')]);router[_0xc86f('0x10')](_0xc86f('0xb'),auth['isAuthenticated'](),controller[_0xc86f('0x11')]);module[_0xc86f('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 90f8a81..f1185e9 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 _0xe1b1=['sequelize','exports','DATE','STRING'];(function(_0x3ec4e3,_0x15aab4){var _0x38ee8c=function(_0x439303){while(--_0x439303){_0x3ec4e3['push'](_0x3ec4e3['shift']());}};_0x38ee8c(++_0x15aab4);}(_0xe1b1,0x138));var _0x1e1b=function(_0x12315b,_0x42c96c){_0x12315b=_0x12315b-0x0;var _0x39eb7a=_0xe1b1[_0x12315b];return _0x39eb7a;};'use strict';var moment=require('moment');var Sequelize=require(_0x1e1b('0x0'));module[_0x1e1b('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1e1b('0x2')]},'leaveAt':{'type':Sequelize[_0x1e1b('0x2')]},'acceptAt':{'type':Sequelize[_0x1e1b('0x2')]},'exitAt':{'type':Sequelize[_0x1e1b('0x2')]},'reason':{'type':Sequelize[_0x1e1b('0x3')]}}; \ No newline at end of file +var _0xd7ba=['sequelize','exports','STRING','DATE','moment'];(function(_0x32cc05,_0x106d41){var _0x445e74=function(_0x5209d0){while(--_0x5209d0){_0x32cc05['push'](_0x32cc05['shift']());}};_0x445e74(++_0x106d41);}(_0xd7ba,0xef));var _0xad7b=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd7ba[_0x13d07a];return _0x5ee0ee;};'use strict';var moment=require(_0xad7b('0x0'));var Sequelize=require(_0xad7b('0x1'));module[_0xad7b('0x2')]={'uniqueid':{'type':Sequelize[_0xad7b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xad7b('0x3')]},'joinAt':{'type':Sequelize[_0xad7b('0x4')]},'leaveAt':{'type':Sequelize[_0xad7b('0x4')]},'acceptAt':{'type':Sequelize[_0xad7b('0x4')]},'exitAt':{'type':Sequelize[_0xad7b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b435f51..30144d4 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 _0x1291=['send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','apply','save','update','then','destroy','end','error','stack','name'];(function(_0x20a74e,_0x26c09d){var _0x513e0f=function(_0x4abe92){while(--_0x4abe92){_0x20a74e['push'](_0x20a74e['shift']());}};_0x513e0f(++_0x26c09d);}(_0x1291,0x140));var _0x1129=function(_0x264971,_0xebef3a){_0x264971=_0x264971-0x0;var _0x211ce1=_0x1291[_0x264971];return _0x211ce1;};'use strict';var emlformat=require(_0x1129('0x0'));var rimraf=require(_0x1129('0x1'));var zipdir=require(_0x1129('0x2'));var jsonpatch=require(_0x1129('0x3'));var rp=require(_0x1129('0x4'));var moment=require(_0x1129('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1129('0x6'));var path=require('path');var sox=require(_0x1129('0x7'));var csv=require(_0x1129('0x8'));var ejs=require(_0x1129('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1129('0xa'));var squel=require(_0x1129('0xb'));var crypto=require(_0x1129('0xc'));var jsforce=require(_0x1129('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1129('0x8'));var querystring=require(_0x1129('0xe'));var Papa=require(_0x1129('0xf'));var Redis=require(_0x1129('0x10'));var authService=require(_0x1129('0x11'));var qs=require(_0x1129('0x12'));var as=require(_0x1129('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1129('0x14'));var utils=require('../../config/utils');var config=require(_0x1129('0x15'));var licenseUtil=require(_0x1129('0x16'));var db=require(_0x1129('0x17'))['db'];function respondWithStatusCode(_0x3782b4,_0x1defe7){_0x1defe7=_0x1defe7||0xcc;return function(_0x2e284a){if(_0x2e284a){return _0x3782b4['sendStatus'](_0x1defe7);}return _0x3782b4[_0x1129('0x18')](_0x1defe7)['end']();};}function respondWithResult(_0x236fb6,_0x4a56f8){_0x4a56f8=_0x4a56f8||0xc8;return function(_0x1ef165){if(_0x1ef165){return _0x236fb6[_0x1129('0x18')](_0x4a56f8)[_0x1129('0x19')](_0x1ef165);}};}function respondWithFilteredResult(_0x49a994,_0x690b9){return function(_0x51b1f0){if(_0x51b1f0){var _0x5de13d=typeof _0x690b9['offset']==='undefined'&&typeof _0x690b9[_0x1129('0x1a')]===_0x1129('0x1b');var _0xf4672b=_0x51b1f0['count'];var _0x3719ea=_0x5de13d?0x0:_0x690b9[_0x1129('0x1c')];var _0x18da24=_0x5de13d?_0x51b1f0[_0x1129('0x1d')]:_0x690b9[_0x1129('0x1c')]+_0x690b9[_0x1129('0x1a')];var _0x538ff8;if(_0x18da24>=_0xf4672b){_0x18da24=_0xf4672b;_0x538ff8=0xc8;}else{_0x538ff8=0xce;}_0x49a994['status'](_0x538ff8);return _0x49a994[_0x1129('0x1e')]('Content-Range',_0x3719ea+'-'+_0x18da24+'/'+_0xf4672b)['json'](_0x51b1f0);}return null;};}function patchUpdates(_0xf43126){return function(_0x4f2dc3){try{jsonpatch[_0x1129('0x1f')](_0x4f2dc3,_0xf43126,!![]);}catch(_0xeee423){return BPromise['reject'](_0xeee423);}return _0x4f2dc3[_0x1129('0x20')]();};}function saveUpdates(_0x2c5359,_0x2df8ce){return function(_0x36e929){if(_0x36e929){return _0x36e929[_0x1129('0x21')](_0x2c5359)[_0x1129('0x22')](function(_0x2a2b21){return _0x2a2b21;});}return null;};}function removeEntity(_0x5814b1,_0x37e212){return function(_0x3c959a){if(_0x3c959a){return _0x3c959a[_0x1129('0x23')]()[_0x1129('0x22')](function(){_0x5814b1['status'](0xcc)[_0x1129('0x24')]();});}};}function handleEntityNotFound(_0x37c75d,_0x24ecb1){return function(_0x30233b){if(!_0x30233b){_0x37c75d['sendStatus'](0x194);}return _0x30233b;};}function handleError(_0x9409e0,_0x2e3b6e){_0x2e3b6e=_0x2e3b6e||0x1f4;return function(_0x325694){logger[_0x1129('0x25')](_0x325694[_0x1129('0x26')]);if(_0x325694[_0x1129('0x27')]){delete _0x325694[_0x1129('0x27')];}_0x9409e0[_0x1129('0x18')](_0x2e3b6e)[_0x1129('0x28')](_0x325694);};}exports['index']=function(_0x268f8f,_0x5e655c){var _0x1f64be={},_0x5b2113={},_0x135b7e={'count':0x0,'rows':[]};var _0x54c98d=_[_0x1129('0x29')](db[_0x1129('0x2a')][_0x1129('0x2b')],function(_0x222de4){return{'name':_0x222de4[_0x1129('0x2c')],'type':_0x222de4[_0x1129('0x2d')][_0x1129('0x2e')]};});_0x5b2113[_0x1129('0x2f')]=_[_0x1129('0x29')](_0x54c98d,_0x1129('0x27'));_0x5b2113[_0x1129('0x30')]=_[_0x1129('0x31')](_0x268f8f[_0x1129('0x30')]);_0x5b2113[_0x1129('0x32')]=_[_0x1129('0x33')](_0x5b2113[_0x1129('0x2f')],_0x5b2113['query']);_0x1f64be[_0x1129('0x34')]=_[_0x1129('0x33')](_0x5b2113[_0x1129('0x2f')],qs[_0x1129('0x35')](_0x268f8f[_0x1129('0x30')]['fields']));_0x1f64be[_0x1129('0x34')]=_0x1f64be[_0x1129('0x34')][_0x1129('0x36')]?_0x1f64be['attributes']:_0x5b2113[_0x1129('0x2f')];if(!_0x268f8f[_0x1129('0x30')]['hasOwnProperty'](_0x1129('0x37'))){_0x1f64be[_0x1129('0x1a')]=qs[_0x1129('0x1a')](_0x268f8f[_0x1129('0x30')][_0x1129('0x1a')]);_0x1f64be['offset']=qs['offset'](_0x268f8f[_0x1129('0x30')][_0x1129('0x1c')]);}_0x1f64be['order']=qs['sort'](_0x268f8f[_0x1129('0x30')]['sort']);_0x1f64be['where']=qs['filters'](_[_0x1129('0x38')](_0x268f8f['query'],_0x5b2113[_0x1129('0x32')]),_0x54c98d);if(_0x268f8f[_0x1129('0x30')]['filter']){_0x1f64be[_0x1129('0x39')]=_[_0x1129('0x3a')](_0x1f64be['where'],{'$or':_[_0x1129('0x29')](_0x54c98d,function(_0x40ae15){if(_0x40ae15[_0x1129('0x2d')]!=='VIRTUAL'){var _0x5c60aa={};_0x5c60aa[_0x40ae15[_0x1129('0x27')]]={'$like':'%'+_0x268f8f[_0x1129('0x30')][_0x1129('0x3b')]+'%'};return _0x5c60aa;}})});}_0x1f64be=_['merge']({},_0x1f64be,_0x268f8f['options']);var _0xd399f7={'where':_0x1f64be[_0x1129('0x39')]};return db['OpenchannelQueueReport']['count'](_0xd399f7)[_0x1129('0x22')](function(_0x2fd1ef){_0x135b7e['count']=_0x2fd1ef;if(_0x268f8f[_0x1129('0x30')][_0x1129('0x3c')]){_0x1f64be[_0x1129('0x3d')]=[{'all':!![]}];}return db[_0x1129('0x2a')][_0x1129('0x3e')](_0x1f64be);})[_0x1129('0x22')](function(_0x27afb6){_0x135b7e[_0x1129('0x3f')]=_0x27afb6;return _0x135b7e;})[_0x1129('0x22')](respondWithFilteredResult(_0x5e655c,_0x1f64be))[_0x1129('0x40')](handleError(_0x5e655c,null));};exports[_0x1129('0x41')]=function(_0x16c973,_0xee63b4){var _0x5493a2={'raw':!![],'where':{'id':_0x16c973['params']['id']}},_0x1c43c6={};_0x1c43c6[_0x1129('0x2f')]=_[_0x1129('0x31')](db[_0x1129('0x2a')][_0x1129('0x2b')]);_0x1c43c6['query']=_[_0x1129('0x31')](_0x16c973[_0x1129('0x30')]);_0x1c43c6[_0x1129('0x32')]=_[_0x1129('0x33')](_0x1c43c6[_0x1129('0x2f')],_0x1c43c6[_0x1129('0x30')]);_0x5493a2[_0x1129('0x34')]=_[_0x1129('0x33')](_0x1c43c6[_0x1129('0x2f')],qs['fields'](_0x16c973[_0x1129('0x30')]['fields']));_0x5493a2[_0x1129('0x34')]=_0x5493a2[_0x1129('0x34')][_0x1129('0x36')]?_0x5493a2[_0x1129('0x34')]:_0x1c43c6[_0x1129('0x2f')];if(_0x16c973[_0x1129('0x30')][_0x1129('0x3c')]){_0x5493a2[_0x1129('0x3d')]=[{'all':!![]}];}_0x5493a2=_[_0x1129('0x3a')]({},_0x5493a2,_0x16c973[_0x1129('0x42')]);return db[_0x1129('0x2a')][_0x1129('0x43')](_0x5493a2)[_0x1129('0x22')](handleEntityNotFound(_0xee63b4,null))['then'](respondWithResult(_0xee63b4,null))['catch'](handleError(_0xee63b4,null));};exports[_0x1129('0x44')]=function(_0x5c3a83,_0x37afef){return db[_0x1129('0x2a')][_0x1129('0x44')](_0x5c3a83[_0x1129('0x45')],{})[_0x1129('0x22')](respondWithResult(_0x37afef,0xc9))[_0x1129('0x40')](handleError(_0x37afef,null));};exports[_0x1129('0x21')]=function(_0x2f57ea,_0x18a409){if(_0x2f57ea['body']['id']){delete _0x2f57ea[_0x1129('0x45')]['id'];}return db[_0x1129('0x2a')][_0x1129('0x43')]({'where':{'id':_0x2f57ea[_0x1129('0x46')]['id']}})[_0x1129('0x22')](handleEntityNotFound(_0x18a409,null))[_0x1129('0x22')](saveUpdates(_0x2f57ea['body'],null))['then'](respondWithResult(_0x18a409,null))['catch'](handleError(_0x18a409,null));};exports[_0x1129('0x23')]=function(_0x511d49,_0x2a45dc){return db[_0x1129('0x2a')][_0x1129('0x43')]({'where':{'id':_0x511d49['params']['id']}})[_0x1129('0x22')](handleEntityNotFound(_0x2a45dc,null))[_0x1129('0x22')](removeEntity(_0x2a45dc,null))['catch'](handleError(_0x2a45dc,null));};exports['describe']=function(_0x472955,_0x12bba4){return db[_0x1129('0x2a')][_0x1129('0x47')]()[_0x1129('0x22')](respondWithResult(_0x12bba4,null))['catch'](handleError(_0x12bba4,null));}; \ No newline at end of file +var _0xf044=['Content-Range','reject','save','update','then','destroy','end','error','name','index','OpenchannelQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','show','params','includeAll','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf044,0x111));var _0x4f04=function(_0x54ce9f,_0x483b1a){_0x54ce9f=_0x54ce9f-0x0;var _0x1ecf83=_0xf044[_0x54ce9f];return _0x1ecf83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f04('0x0'));var zipdir=require(_0x4f04('0x1'));var jsonpatch=require(_0x4f04('0x2'));var rp=require('request-promise');var moment=require(_0x4f04('0x3'));var BPromise=require(_0x4f04('0x4'));var Mustache=require(_0x4f04('0x5'));var util=require(_0x4f04('0x6'));var path=require(_0x4f04('0x7'));var sox=require(_0x4f04('0x8'));var csv=require(_0x4f04('0x9'));var ejs=require(_0x4f04('0xa'));var fs=require('fs');var fs_extra=require(_0x4f04('0xb'));var _=require(_0x4f04('0xc'));var squel=require(_0x4f04('0xd'));var crypto=require(_0x4f04('0xe'));var jsforce=require(_0x4f04('0xf'));var deskjs=require(_0x4f04('0x10'));var toCsv=require(_0x4f04('0x9'));var querystring=require(_0x4f04('0x11'));var Papa=require(_0x4f04('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4f04('0x13'));var as=require(_0x4f04('0x14'));var hardwareService=require(_0x4f04('0x15'));var logger=require(_0x4f04('0x16'))(_0x4f04('0x17'));var utils=require(_0x4f04('0x18'));var config=require(_0x4f04('0x19'));var licenseUtil=require(_0x4f04('0x1a'));var db=require(_0x4f04('0x1b'))['db'];function respondWithStatusCode(_0x16e7ad,_0x1f8901){_0x1f8901=_0x1f8901||0xcc;return function(_0x3d6daf){if(_0x3d6daf){return _0x16e7ad[_0x4f04('0x1c')](_0x1f8901);}return _0x16e7ad[_0x4f04('0x1d')](_0x1f8901)['end']();};}function respondWithResult(_0x4c0067,_0x40250d){_0x40250d=_0x40250d||0xc8;return function(_0x44e78a){if(_0x44e78a){return _0x4c0067['status'](_0x40250d)[_0x4f04('0x1e')](_0x44e78a);}};}function respondWithFilteredResult(_0x32f468,_0x144ee3){return function(_0x546b68){if(_0x546b68){var _0x4c61e4=typeof _0x144ee3[_0x4f04('0x1f')]===_0x4f04('0x20')&&typeof _0x144ee3[_0x4f04('0x21')]===_0x4f04('0x20');var _0x22a9f5=_0x546b68['count'];var _0x5d8f1e=_0x4c61e4?0x0:_0x144ee3['offset'];var _0x15e666=_0x4c61e4?_0x546b68['count']:_0x144ee3[_0x4f04('0x1f')]+_0x144ee3['limit'];var _0x3ce586;if(_0x15e666>=_0x22a9f5){_0x15e666=_0x22a9f5;_0x3ce586=0xc8;}else{_0x3ce586=0xce;}_0x32f468[_0x4f04('0x1d')](_0x3ce586);return _0x32f468[_0x4f04('0x22')](_0x4f04('0x23'),_0x5d8f1e+'-'+_0x15e666+'/'+_0x22a9f5)['json'](_0x546b68);}return null;};}function patchUpdates(_0x466d07){return function(_0x48668e){try{jsonpatch['apply'](_0x48668e,_0x466d07,!![]);}catch(_0xda63bd){return BPromise[_0x4f04('0x24')](_0xda63bd);}return _0x48668e[_0x4f04('0x25')]();};}function saveUpdates(_0x3e188c,_0x5998fb){return function(_0x5d46fc){if(_0x5d46fc){return _0x5d46fc[_0x4f04('0x26')](_0x3e188c)[_0x4f04('0x27')](function(_0x3fb565){return _0x3fb565;});}return null;};}function removeEntity(_0x377b72,_0x298208){return function(_0x24eb1f){if(_0x24eb1f){return _0x24eb1f[_0x4f04('0x28')]()[_0x4f04('0x27')](function(){_0x377b72[_0x4f04('0x1d')](0xcc)[_0x4f04('0x29')]();});}};}function handleEntityNotFound(_0x21d7d4,_0x57f08d){return function(_0x44ff5a){if(!_0x44ff5a){_0x21d7d4[_0x4f04('0x1c')](0x194);}return _0x44ff5a;};}function handleError(_0x480b3c,_0x578bf8){_0x578bf8=_0x578bf8||0x1f4;return function(_0x79916f){logger[_0x4f04('0x2a')](_0x79916f['stack']);if(_0x79916f[_0x4f04('0x2b')]){delete _0x79916f['name'];}_0x480b3c[_0x4f04('0x1d')](_0x578bf8)['send'](_0x79916f);};}exports[_0x4f04('0x2c')]=function(_0x3fb4f7,_0x4b59b7){var _0x105fa1={},_0x51ed13={},_0x47afaa={'count':0x0,'rows':[]};var _0x26977e=_['map'](db[_0x4f04('0x2d')][_0x4f04('0x2e')],function(_0x2923b9){return{'name':_0x2923b9[_0x4f04('0x2f')],'type':_0x2923b9[_0x4f04('0x30')][_0x4f04('0x31')]};});_0x51ed13['model']=_[_0x4f04('0x32')](_0x26977e,'name');_0x51ed13[_0x4f04('0x33')]=_[_0x4f04('0x34')](_0x3fb4f7[_0x4f04('0x33')]);_0x51ed13[_0x4f04('0x35')]=_[_0x4f04('0x36')](_0x51ed13[_0x4f04('0x37')],_0x51ed13[_0x4f04('0x33')]);_0x105fa1[_0x4f04('0x38')]=_[_0x4f04('0x36')](_0x51ed13['model'],qs[_0x4f04('0x39')](_0x3fb4f7[_0x4f04('0x33')][_0x4f04('0x39')]));_0x105fa1[_0x4f04('0x38')]=_0x105fa1['attributes'][_0x4f04('0x3a')]?_0x105fa1['attributes']:_0x51ed13[_0x4f04('0x37')];if(!_0x3fb4f7[_0x4f04('0x33')][_0x4f04('0x3b')](_0x4f04('0x3c'))){_0x105fa1[_0x4f04('0x21')]=qs[_0x4f04('0x21')](_0x3fb4f7[_0x4f04('0x33')][_0x4f04('0x21')]);_0x105fa1[_0x4f04('0x1f')]=qs[_0x4f04('0x1f')](_0x3fb4f7[_0x4f04('0x33')][_0x4f04('0x1f')]);}_0x105fa1['order']=qs['sort'](_0x3fb4f7['query'][_0x4f04('0x3d')]);_0x105fa1[_0x4f04('0x3e')]=qs['filters'](_[_0x4f04('0x3f')](_0x3fb4f7[_0x4f04('0x33')],_0x51ed13[_0x4f04('0x35')]),_0x26977e);if(_0x3fb4f7[_0x4f04('0x33')][_0x4f04('0x40')]){_0x105fa1[_0x4f04('0x3e')]=_[_0x4f04('0x41')](_0x105fa1[_0x4f04('0x3e')],{'$or':_['map'](_0x26977e,function(_0x15a9e3){if(_0x15a9e3[_0x4f04('0x30')]!==_0x4f04('0x42')){var _0x2d775e={};_0x2d775e[_0x15a9e3[_0x4f04('0x2b')]]={'$like':'%'+_0x3fb4f7[_0x4f04('0x33')]['filter']+'%'};return _0x2d775e;}})});}_0x105fa1=_[_0x4f04('0x41')]({},_0x105fa1,_0x3fb4f7['options']);var _0x5e4f66={'where':_0x105fa1[_0x4f04('0x3e')]};return db[_0x4f04('0x2d')][_0x4f04('0x43')](_0x5e4f66)[_0x4f04('0x27')](function(_0x26a2b7){_0x47afaa['count']=_0x26a2b7;if(_0x3fb4f7[_0x4f04('0x33')]['includeAll']){_0x105fa1[_0x4f04('0x44')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x4f04('0x45')](_0x105fa1);})[_0x4f04('0x27')](function(_0x46107f){_0x47afaa['rows']=_0x46107f;return _0x47afaa;})[_0x4f04('0x27')](respondWithFilteredResult(_0x4b59b7,_0x105fa1))['catch'](handleError(_0x4b59b7,null));};exports[_0x4f04('0x46')]=function(_0x392954,_0x38ac39){var _0x3f1855={'raw':!![],'where':{'id':_0x392954[_0x4f04('0x47')]['id']}},_0x144616={};_0x144616[_0x4f04('0x37')]=_['keys'](db[_0x4f04('0x2d')][_0x4f04('0x2e')]);_0x144616['query']=_[_0x4f04('0x34')](_0x392954[_0x4f04('0x33')]);_0x144616[_0x4f04('0x35')]=_[_0x4f04('0x36')](_0x144616[_0x4f04('0x37')],_0x144616[_0x4f04('0x33')]);_0x3f1855['attributes']=_['intersection'](_0x144616[_0x4f04('0x37')],qs[_0x4f04('0x39')](_0x392954[_0x4f04('0x33')][_0x4f04('0x39')]));_0x3f1855['attributes']=_0x3f1855[_0x4f04('0x38')][_0x4f04('0x3a')]?_0x3f1855['attributes']:_0x144616['model'];if(_0x392954['query'][_0x4f04('0x48')]){_0x3f1855['include']=[{'all':!![]}];}_0x3f1855=_[_0x4f04('0x41')]({},_0x3f1855,_0x392954['options']);return db[_0x4f04('0x2d')][_0x4f04('0x49')](_0x3f1855)['then'](handleEntityNotFound(_0x38ac39,null))[_0x4f04('0x27')](respondWithResult(_0x38ac39,null))[_0x4f04('0x4a')](handleError(_0x38ac39,null));};exports[_0x4f04('0x4b')]=function(_0x32162c,_0x4f18fb){return db[_0x4f04('0x2d')][_0x4f04('0x4b')](_0x32162c[_0x4f04('0x4c')],{})[_0x4f04('0x27')](respondWithResult(_0x4f18fb,0xc9))[_0x4f04('0x4a')](handleError(_0x4f18fb,null));};exports[_0x4f04('0x26')]=function(_0x10a5eb,_0x415077){if(_0x10a5eb[_0x4f04('0x4c')]['id']){delete _0x10a5eb[_0x4f04('0x4c')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x10a5eb['params']['id']}})[_0x4f04('0x27')](handleEntityNotFound(_0x415077,null))[_0x4f04('0x27')](saveUpdates(_0x10a5eb['body'],null))['then'](respondWithResult(_0x415077,null))[_0x4f04('0x4a')](handleError(_0x415077,null));};exports[_0x4f04('0x28')]=function(_0x26977c,_0x520cb7){return db[_0x4f04('0x2d')][_0x4f04('0x49')]({'where':{'id':_0x26977c[_0x4f04('0x47')]['id']}})[_0x4f04('0x27')](handleEntityNotFound(_0x520cb7,null))[_0x4f04('0x27')](removeEntity(_0x520cb7,null))[_0x4f04('0x4a')](handleError(_0x520cb7,null));};exports['describe']=function(_0xb6b04,_0x24b40c){return db[_0x4f04('0x2d')]['describe']()[_0x4f04('0x27')](respondWithResult(_0x24b40c,null))[_0x4f04('0x4a')](handleError(_0x24b40c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index e7f4692..2930aba 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(_0x55dc16,_0x255db8){var _0x31504b=function(_0x128967){while(--_0x128967){_0x55dc16['push'](_0x55dc16['shift']());}};_0x31504b(++_0x255db8);}(_0xe14b,0x93));var _0xbe14=function(_0x1c102c,_0x5d3105){_0x1c102c=_0x1c102c-0x0;var _0x4165a6=_0xe14b[_0x1c102c];return _0x4165a6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x11a925,_0x2e1580){var _0x19a704=function(_0x125dae){while(--_0x125dae){_0x11a925['push'](_0x11a925['shift']());}};_0x19a704(++_0x2e1580);}(_0x326f,0xd1));var _0xf326=function(_0x387c55,_0x447ca2){_0x387c55=_0x387c55-0x0;var _0x5ac07e=_0x326f[_0x387c55];return _0x5ac07e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 96954b9..94e4e8f 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 _0x056b=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','debug','update','body','where','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x9df392,_0xc910c7){var _0x965d1b=function(_0x256374){while(--_0x256374){_0x9df392['push'](_0x9df392['shift']());}};_0x965d1b(++_0xc910c7);}(_0x056b,0xb6));var _0xb056=function(_0x3baa05,_0x207228){_0x3baa05=_0x3baa05-0x0;var _0x3b2b8d=_0x056b[_0x3baa05];return _0x3b2b8d;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateOpenchannelQueueReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateOpenchannelQueueReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1016da){var _0x18a3f2=this;return new Promise(function(_0x341544,_0x1bd6ac){return db['OpenchannelQueueReport'][_0xb056('0x1d')](_0x1016da[_0xb056('0x1e')],{'raw':_0x1016da['options']?_0x1016da[_0xb056('0x19')][_0xb056('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x1f')]||null:null,'attributes':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x20')]||null:null,'limit':_0x1016da['options']?_0x1016da[_0xb056('0x19')]['limit']||null:null})[_0xb056('0x1b')](function(_0x9c6f4a){logger[_0xb056('0xc')]('UpdateOpenchannelQueueReport',_0x1016da);logger[_0xb056('0x1c')](_0xb056('0x21'),_0x1016da,JSON['stringify'](_0x9c6f4a));_0x341544(_0x9c6f4a);})[_0xb056('0x15')](function(_0x43aa63){logger[_0xb056('0x11')](_0xb056('0x21'),_0x43aa63[_0xb056('0x13')],_0x1016da);_0x1bd6ac(_0x18a3f2['error'](0x1f4,_0x43aa63[_0xb056('0x13')]));});});}; \ No newline at end of file +var _0x4fc2=['limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x4fc2,0x111));var _0x24fc=function(_0x2d2885,_0x667d70){_0x2d2885=_0x2d2885-0x0;var _0x2cea6=_0x4fc2[_0x2d2885];return _0x2cea6;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['CreateOpenchannelQueueReport']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['OpenchannelQueueReport'][_0x24fc('0x17')](_0x23873c[_0x24fc('0x18')],{'raw':_0x23873c[_0x24fc('0x19')]?_0x23873c['options'][_0x24fc('0x1a')]===undefined?!![]:![]:!![]})[_0x24fc('0xc')](function(_0xbf1d6b){logger[_0x24fc('0xd')]('CreateOpenchannelQueueReport',_0x23873c);logger[_0x24fc('0x10')]('CreateOpenchannelQueueReport',_0x23873c,JSON[_0x24fc('0x12')](_0xbf1d6b));_0x6cfa0a(_0xbf1d6b);})['catch'](function(_0x3ed464){logger[_0x24fc('0x13')](_0x24fc('0x1b'),_0x3ed464['message'],_0x23873c);_0x8ac114(_0x1cb3d0[_0x24fc('0x13')](0x1f4,_0x3ed464['message']));});});};exports[_0x24fc('0x1c')]=function(_0x2bb93a){var _0x36a9b4=this;return new Promise(function(_0x34b5b2,_0x3296fc){return db[_0x24fc('0x1d')][_0x24fc('0x1e')](_0x2bb93a[_0x24fc('0x18')],{'raw':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':_0x2bb93a['options']?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x20')]||null:null,'limit':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x21')]||null:null})[_0x24fc('0xc')](function(_0x5ac1f2){logger[_0x24fc('0xd')](_0x24fc('0x1c'),_0x2bb93a);logger[_0x24fc('0x10')](_0x24fc('0x1c'),_0x2bb93a,JSON[_0x24fc('0x12')](_0x5ac1f2));_0x34b5b2(_0x5ac1f2);})['catch'](function(_0x55c27f){logger['error'](_0x24fc('0x1c'),_0x55c27f['message'],_0x2bb93a);_0x3296fc(_0x36a9b4[_0x24fc('0x13')](0x1f4,_0x55c27f[_0x24fc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 21f219b..b6b6423 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 _0x2272=['describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./openchannelTransferReport.controller','get','index','/describe'];(function(_0x29fdc2,_0x587b41){var _0x5ed737=function(_0x2b9ad6){while(--_0x2b9ad6){_0x29fdc2['push'](_0x29fdc2['shift']());}};_0x5ed737(++_0x587b41);}(_0x2272,0x129));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var path=require(_0x2227('0x2'));var timeout=require(_0x2227('0x3'));var express=require(_0x2227('0x4'));var router=express[_0x2227('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2227('0x6'));var controller=require(_0x2227('0x7'));router[_0x2227('0x8')]('/',auth['isAuthenticated'](),controller[_0x2227('0x9')]);router[_0x2227('0x8')](_0x2227('0xa'),auth['isAuthenticated'](),controller[_0x2227('0xb')]);router['get'](_0x2227('0xc'),auth[_0x2227('0xd')](),controller[_0x2227('0xe')]);router[_0x2227('0xf')]('/',auth['isAuthenticated'](),controller[_0x2227('0x10')]);router[_0x2227('0x11')]('/:id',auth[_0x2227('0xd')](),controller[_0x2227('0x12')]);router[_0x2227('0x13')](_0x2227('0xc'),auth[_0x2227('0xd')](),controller[_0x2227('0x14')]);module[_0x2227('0x15')]=router; \ No newline at end of file +var _0x6b67=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0x6b67,0x13a));var _0x76b6=function(_0x195686,_0xd329df){_0x195686=_0x195686-0x0;var _0xaf27a1=_0x6b67[_0x195686];return _0xaf27a1;};'use strict';var multer=require(_0x76b6('0x0'));var util=require(_0x76b6('0x1'));var path=require(_0x76b6('0x2'));var timeout=require(_0x76b6('0x3'));var express=require('express');var router=express[_0x76b6('0x4')]();var fs_extra=require(_0x76b6('0x5'));var auth=require(_0x76b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76b6('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x76b6('0x8')]('/',auth[_0x76b6('0x9')](),controller[_0x76b6('0xa')]);router['get'](_0x76b6('0xb'),auth[_0x76b6('0x9')](),controller[_0x76b6('0xc')]);router[_0x76b6('0x8')](_0x76b6('0xd'),auth['isAuthenticated'](),controller[_0x76b6('0xe')]);router[_0x76b6('0xf')]('/',auth['isAuthenticated'](),controller[_0x76b6('0x10')]);router[_0x76b6('0x11')](_0x76b6('0xd'),auth['isAuthenticated'](),controller[_0x76b6('0x12')]);router[_0x76b6('0x13')]('/:id',auth[_0x76b6('0x9')](),controller[_0x76b6('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 17273a7..1860e15 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0x54ef,0x112));var _0xf54e=function(_0x5cce96,_0x37d376){_0x5cce96=_0x5cce96-0x0;var _0x1d1409=_0x54ef[_0x5cce96];return _0x1d1409;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1662b5,_0x20d5ed){var _0x13da1c=function(_0x1b29b9){while(--_0x1b29b9){_0x1662b5['push'](_0x1662b5['shift']());}};_0x13da1c(++_0x20d5ed);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xcb91[_0x5f1391];return _0x50ebe3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 1b5b3af..aa7af3c 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 _0xa575=['desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','include','catch','show','params','length','includeAll','merge','options','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce'];(function(_0x11fdf3,_0x4d7e31){var _0x27dbb2=function(_0x2af1b0){while(--_0x2af1b0){_0x11fdf3['push'](_0x11fdf3['shift']());}};_0x27dbb2(++_0x4d7e31);}(_0xa575,0x1ae));var _0x5a57=function(_0x5454a1,_0x3714bd){_0x5454a1=_0x5454a1-0x0;var _0x305b4c=_0xa575[_0x5454a1];return _0x305b4c;};'use strict';var emlformat=require(_0x5a57('0x0'));var rimraf=require(_0x5a57('0x1'));var zipdir=require(_0x5a57('0x2'));var jsonpatch=require(_0x5a57('0x3'));var rp=require(_0x5a57('0x4'));var moment=require(_0x5a57('0x5'));var BPromise=require(_0x5a57('0x6'));var Mustache=require(_0x5a57('0x7'));var util=require(_0x5a57('0x8'));var path=require('path');var sox=require(_0x5a57('0x9'));var csv=require('to-csv');var ejs=require(_0x5a57('0xa'));var fs=require('fs');var fs_extra=require(_0x5a57('0xb'));var _=require(_0x5a57('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a57('0xd'));var deskjs=require(_0x5a57('0xe'));var toCsv=require(_0x5a57('0xf'));var querystring=require(_0x5a57('0x10'));var Papa=require('papaparse');var Redis=require(_0x5a57('0x11'));var authService=require(_0x5a57('0x12'));var qs=require(_0x5a57('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a57('0x14'));var logger=require('../../config/logger')(_0x5a57('0x15'));var utils=require('../../config/utils');var config=require(_0x5a57('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a57('0x17'))['db'];function respondWithStatusCode(_0x339133,_0x5a9beb){_0x5a9beb=_0x5a9beb||0xcc;return function(_0x315f97){if(_0x315f97){return _0x339133[_0x5a57('0x18')](_0x5a9beb);}return _0x339133[_0x5a57('0x19')](_0x5a9beb)[_0x5a57('0x1a')]();};}function respondWithResult(_0x36644a,_0x3bc905){_0x3bc905=_0x3bc905||0xc8;return function(_0x3bac78){if(_0x3bac78){return _0x36644a[_0x5a57('0x19')](_0x3bc905)[_0x5a57('0x1b')](_0x3bac78);}};}function respondWithFilteredResult(_0x1b2c72,_0x3ae948){return function(_0x373d69){if(_0x373d69){var _0x49aef6=typeof _0x3ae948[_0x5a57('0x1c')]===_0x5a57('0x1d')&&typeof _0x3ae948[_0x5a57('0x1e')]===_0x5a57('0x1d');var _0x1f16be=_0x373d69[_0x5a57('0x1f')];var _0x5b9297=_0x49aef6?0x0:_0x3ae948['offset'];var _0x145625=_0x49aef6?_0x373d69[_0x5a57('0x1f')]:_0x3ae948[_0x5a57('0x1c')]+_0x3ae948['limit'];var _0x4b243f;if(_0x145625>=_0x1f16be){_0x145625=_0x1f16be;_0x4b243f=0xc8;}else{_0x4b243f=0xce;}_0x1b2c72[_0x5a57('0x19')](_0x4b243f);return _0x1b2c72['set'](_0x5a57('0x20'),_0x5b9297+'-'+_0x145625+'/'+_0x1f16be)[_0x5a57('0x1b')](_0x373d69);}return null;};}function patchUpdates(_0x4eb11f){return function(_0x5c1ddb){try{jsonpatch[_0x5a57('0x21')](_0x5c1ddb,_0x4eb11f,!![]);}catch(_0xb54043){return BPromise['reject'](_0xb54043);}return _0x5c1ddb[_0x5a57('0x22')]();};}function saveUpdates(_0x59a2ce,_0x54adb3){return function(_0x4eb811){if(_0x4eb811){return _0x4eb811['update'](_0x59a2ce)[_0x5a57('0x23')](function(_0x27339e){return _0x27339e;});}return null;};}function removeEntity(_0x806425,_0x192610){return function(_0x3165f9){if(_0x3165f9){return _0x3165f9[_0x5a57('0x24')]()['then'](function(){_0x806425[_0x5a57('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ea34,_0x246723){return function(_0x225f8a){if(!_0x225f8a){_0x32ea34[_0x5a57('0x18')](0x194);}return _0x225f8a;};}function handleError(_0x4a6807,_0x28a4bf){_0x28a4bf=_0x28a4bf||0x1f4;return function(_0x3f9a76){logger[_0x5a57('0x25')](_0x3f9a76[_0x5a57('0x26')]);if(_0x3f9a76[_0x5a57('0x27')]){delete _0x3f9a76[_0x5a57('0x27')];}_0x4a6807[_0x5a57('0x19')](_0x28a4bf)[_0x5a57('0x28')](_0x3f9a76);};}exports['index']=function(_0x1ec63e,_0x479145){var _0x279d74={},_0xa99111={},_0x114dca={'count':0x0,'rows':[]};var _0x5c3aa3=_['map'](db[_0x5a57('0x29')][_0x5a57('0x2a')],function(_0x5641bd){return{'name':_0x5641bd[_0x5a57('0x2b')],'type':_0x5641bd[_0x5a57('0x2c')][_0x5a57('0x2d')]};});_0xa99111[_0x5a57('0x2e')]=_['map'](_0x5c3aa3,_0x5a57('0x27'));_0xa99111['query']=_[_0x5a57('0x2f')](_0x1ec63e[_0x5a57('0x30')]);_0xa99111[_0x5a57('0x31')]=_[_0x5a57('0x32')](_0xa99111[_0x5a57('0x2e')],_0xa99111[_0x5a57('0x30')]);_0x279d74[_0x5a57('0x33')]=_[_0x5a57('0x32')](_0xa99111[_0x5a57('0x2e')],qs[_0x5a57('0x34')](_0x1ec63e[_0x5a57('0x30')]['fields']));_0x279d74['attributes']=_0x279d74['attributes']['length']?_0x279d74['attributes']:_0xa99111[_0x5a57('0x2e')];if(!_0x1ec63e['query'][_0x5a57('0x35')](_0x5a57('0x36'))){_0x279d74[_0x5a57('0x1e')]=qs['limit'](_0x1ec63e[_0x5a57('0x30')][_0x5a57('0x1e')]);_0x279d74[_0x5a57('0x1c')]=qs[_0x5a57('0x1c')](_0x1ec63e['query'][_0x5a57('0x1c')]);}_0x279d74[_0x5a57('0x37')]=qs[_0x5a57('0x38')](_0x1ec63e['query'][_0x5a57('0x38')]);_0x279d74['where']=qs[_0x5a57('0x31')](_[_0x5a57('0x39')](_0x1ec63e[_0x5a57('0x30')],_0xa99111[_0x5a57('0x31')]),_0x5c3aa3);if(_0x1ec63e[_0x5a57('0x30')][_0x5a57('0x3a')]){_0x279d74[_0x5a57('0x3b')]=_['merge'](_0x279d74[_0x5a57('0x3b')],{'$or':_['map'](_0x5c3aa3,function(_0x5e8d37){if(_0x5e8d37[_0x5a57('0x2c')]!==_0x5a57('0x3c')){var _0x3ebe14={};_0x3ebe14[_0x5e8d37['name']]={'$like':'%'+_0x1ec63e[_0x5a57('0x30')][_0x5a57('0x3a')]+'%'};return _0x3ebe14;}})});}_0x279d74=_['merge']({},_0x279d74,_0x1ec63e['options']);var _0xe91512={'where':_0x279d74[_0x5a57('0x3b')]};return db['OpenchannelTransferReport'][_0x5a57('0x1f')](_0xe91512)[_0x5a57('0x23')](function(_0xcc617){_0x114dca[_0x5a57('0x1f')]=_0xcc617;if(_0x1ec63e['query']['includeAll']){_0x279d74[_0x5a57('0x3d')]=[{'all':!![]}];}return db[_0x5a57('0x29')]['findAll'](_0x279d74);})['then'](function(_0x5ed478){_0x114dca['rows']=_0x5ed478;return _0x114dca;})[_0x5a57('0x23')](respondWithFilteredResult(_0x479145,_0x279d74))[_0x5a57('0x3e')](handleError(_0x479145,null));};exports[_0x5a57('0x3f')]=function(_0x1c3601,_0x1f982d){var _0x53e07b={'raw':!![],'where':{'id':_0x1c3601[_0x5a57('0x40')]['id']}},_0x30ab63={};_0x30ab63[_0x5a57('0x2e')]=_[_0x5a57('0x2f')](db[_0x5a57('0x29')][_0x5a57('0x2a')]);_0x30ab63[_0x5a57('0x30')]=_[_0x5a57('0x2f')](_0x1c3601[_0x5a57('0x30')]);_0x30ab63[_0x5a57('0x31')]=_[_0x5a57('0x32')](_0x30ab63[_0x5a57('0x2e')],_0x30ab63['query']);_0x53e07b['attributes']=_[_0x5a57('0x32')](_0x30ab63[_0x5a57('0x2e')],qs[_0x5a57('0x34')](_0x1c3601[_0x5a57('0x30')]['fields']));_0x53e07b[_0x5a57('0x33')]=_0x53e07b[_0x5a57('0x33')][_0x5a57('0x41')]?_0x53e07b[_0x5a57('0x33')]:_0x30ab63[_0x5a57('0x2e')];if(_0x1c3601[_0x5a57('0x30')][_0x5a57('0x42')]){_0x53e07b['include']=[{'all':!![]}];}_0x53e07b=_[_0x5a57('0x43')]({},_0x53e07b,_0x1c3601[_0x5a57('0x44')]);return db[_0x5a57('0x29')]['find'](_0x53e07b)['then'](handleEntityNotFound(_0x1f982d,null))['then'](respondWithResult(_0x1f982d,null))[_0x5a57('0x3e')](handleError(_0x1f982d,null));};exports[_0x5a57('0x45')]=function(_0x36981d,_0x5dc705){return db['OpenchannelTransferReport'][_0x5a57('0x45')](_0x36981d['body'],{})[_0x5a57('0x23')](respondWithResult(_0x5dc705,0xc9))[_0x5a57('0x3e')](handleError(_0x5dc705,null));};exports[_0x5a57('0x46')]=function(_0x271cb3,_0x15f0b7){if(_0x271cb3[_0x5a57('0x47')]['id']){delete _0x271cb3[_0x5a57('0x47')]['id'];}return db[_0x5a57('0x29')][_0x5a57('0x48')]({'where':{'id':_0x271cb3[_0x5a57('0x40')]['id']}})['then'](handleEntityNotFound(_0x15f0b7,null))[_0x5a57('0x23')](saveUpdates(_0x271cb3[_0x5a57('0x47')],null))['then'](respondWithResult(_0x15f0b7,null))[_0x5a57('0x3e')](handleError(_0x15f0b7,null));};exports[_0x5a57('0x24')]=function(_0x3fb5f1,_0x4600a6){return db[_0x5a57('0x29')][_0x5a57('0x48')]({'where':{'id':_0x3fb5f1[_0x5a57('0x40')]['id']}})[_0x5a57('0x23')](handleEntityNotFound(_0x4600a6,null))[_0x5a57('0x23')](removeEntity(_0x4600a6,null))[_0x5a57('0x3e')](handleError(_0x4600a6,null));};exports[_0x5a57('0x49')]=function(_0x2764a1,_0xd81e09){return db[_0x5a57('0x29')][_0x5a57('0x49')]()[_0x5a57('0x23')](respondWithResult(_0xd81e09,null))[_0x5a57('0x3e')](handleError(_0xd81e09,null));}; \ No newline at end of file +var _0xbdec=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','where','pick','merge','filter','findAll','show','params','includeAll','include','options','catch','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3c077f,_0x3d8cee){var _0x4783da=function(_0x18dbb2){while(--_0x18dbb2){_0x3c077f['push'](_0x3c077f['shift']());}};_0x4783da(++_0x3d8cee);}(_0xbdec,0x93));var _0xcbde=function(_0x2e723a,_0x5590f5){_0x2e723a=_0x2e723a-0x0;var _0x15a487=_0xbdec[_0x2e723a];return _0x15a487;};'use strict';var emlformat=require(_0xcbde('0x0'));var rimraf=require(_0xcbde('0x1'));var zipdir=require(_0xcbde('0x2'));var jsonpatch=require(_0xcbde('0x3'));var rp=require(_0xcbde('0x4'));var moment=require(_0xcbde('0x5'));var BPromise=require(_0xcbde('0x6'));var Mustache=require(_0xcbde('0x7'));var util=require(_0xcbde('0x8'));var path=require(_0xcbde('0x9'));var sox=require(_0xcbde('0xa'));var csv=require(_0xcbde('0xb'));var ejs=require(_0xcbde('0xc'));var fs=require('fs');var fs_extra=require(_0xcbde('0xd'));var _=require(_0xcbde('0xe'));var squel=require(_0xcbde('0xf'));var crypto=require(_0xcbde('0x10'));var jsforce=require(_0xcbde('0x11'));var deskjs=require(_0xcbde('0x12'));var toCsv=require(_0xcbde('0xb'));var querystring=require(_0xcbde('0x13'));var Papa=require(_0xcbde('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcbde('0x15'));var as=require(_0xcbde('0x16'));var hardwareService=require(_0xcbde('0x17'));var logger=require(_0xcbde('0x18'))(_0xcbde('0x19'));var utils=require(_0xcbde('0x1a'));var config=require(_0xcbde('0x1b'));var licenseUtil=require(_0xcbde('0x1c'));var db=require(_0xcbde('0x1d'))['db'];function respondWithStatusCode(_0x39b6fc,_0x17f7a9){_0x17f7a9=_0x17f7a9||0xcc;return function(_0xaeab55){if(_0xaeab55){return _0x39b6fc[_0xcbde('0x1e')](_0x17f7a9);}return _0x39b6fc[_0xcbde('0x1f')](_0x17f7a9)['end']();};}function respondWithResult(_0x214d54,_0x3ad5c2){_0x3ad5c2=_0x3ad5c2||0xc8;return function(_0x5ae8c2){if(_0x5ae8c2){return _0x214d54['status'](_0x3ad5c2)[_0xcbde('0x20')](_0x5ae8c2);}};}function respondWithFilteredResult(_0x206ce8,_0x5652d7){return function(_0x458b7d){if(_0x458b7d){var _0x5aa24d=typeof _0x5652d7[_0xcbde('0x21')]===_0xcbde('0x22')&&typeof _0x5652d7[_0xcbde('0x23')]===_0xcbde('0x22');var _0x36b8a7=_0x458b7d[_0xcbde('0x24')];var _0x221cc2=_0x5aa24d?0x0:_0x5652d7[_0xcbde('0x21')];var _0x54af3c=_0x5aa24d?_0x458b7d['count']:_0x5652d7[_0xcbde('0x21')]+_0x5652d7[_0xcbde('0x23')];var _0x2fb641;if(_0x54af3c>=_0x36b8a7){_0x54af3c=_0x36b8a7;_0x2fb641=0xc8;}else{_0x2fb641=0xce;}_0x206ce8[_0xcbde('0x1f')](_0x2fb641);return _0x206ce8['set'](_0xcbde('0x25'),_0x221cc2+'-'+_0x54af3c+'/'+_0x36b8a7)[_0xcbde('0x20')](_0x458b7d);}return null;};}function patchUpdates(_0x3a62c1){return function(_0x5c9ef3){try{jsonpatch[_0xcbde('0x26')](_0x5c9ef3,_0x3a62c1,!![]);}catch(_0x177a7e){return BPromise[_0xcbde('0x27')](_0x177a7e);}return _0x5c9ef3['save']();};}function saveUpdates(_0x45bdcb,_0x476c4){return function(_0x27355a){if(_0x27355a){return _0x27355a['update'](_0x45bdcb)[_0xcbde('0x28')](function(_0x1db05){return _0x1db05;});}return null;};}function removeEntity(_0x1468ed,_0x4106c6){return function(_0x41aaec){if(_0x41aaec){return _0x41aaec[_0xcbde('0x29')]()[_0xcbde('0x28')](function(){_0x1468ed['status'](0xcc)[_0xcbde('0x2a')]();});}};}function handleEntityNotFound(_0x456d13,_0x13b2b5){return function(_0x4cf758){if(!_0x4cf758){_0x456d13[_0xcbde('0x1e')](0x194);}return _0x4cf758;};}function handleError(_0x33e7a1,_0x4f746f){_0x4f746f=_0x4f746f||0x1f4;return function(_0x4bfc89){logger[_0xcbde('0x2b')](_0x4bfc89[_0xcbde('0x2c')]);if(_0x4bfc89[_0xcbde('0x2d')]){delete _0x4bfc89['name'];}_0x33e7a1[_0xcbde('0x1f')](_0x4f746f)[_0xcbde('0x2e')](_0x4bfc89);};}exports[_0xcbde('0x2f')]=function(_0x4383b1,_0x3f4af1){var _0x33919c={},_0x392723={},_0x261b57={'count':0x0,'rows':[]};var _0x417f1d=_[_0xcbde('0x30')](db[_0xcbde('0x31')][_0xcbde('0x32')],function(_0x458ce2){return{'name':_0x458ce2[_0xcbde('0x33')],'type':_0x458ce2[_0xcbde('0x34')]['key']};});_0x392723['model']=_['map'](_0x417f1d,_0xcbde('0x2d'));_0x392723[_0xcbde('0x35')]=_[_0xcbde('0x36')](_0x4383b1[_0xcbde('0x35')]);_0x392723[_0xcbde('0x37')]=_[_0xcbde('0x38')](_0x392723[_0xcbde('0x39')],_0x392723['query']);_0x33919c[_0xcbde('0x3a')]=_['intersection'](_0x392723['model'],qs[_0xcbde('0x3b')](_0x4383b1[_0xcbde('0x35')][_0xcbde('0x3b')]));_0x33919c[_0xcbde('0x3a')]=_0x33919c[_0xcbde('0x3a')][_0xcbde('0x3c')]?_0x33919c['attributes']:_0x392723[_0xcbde('0x39')];if(!_0x4383b1[_0xcbde('0x35')]['hasOwnProperty']('nolimit')){_0x33919c[_0xcbde('0x23')]=qs[_0xcbde('0x23')](_0x4383b1[_0xcbde('0x35')]['limit']);_0x33919c[_0xcbde('0x21')]=qs[_0xcbde('0x21')](_0x4383b1[_0xcbde('0x35')]['offset']);}_0x33919c[_0xcbde('0x3d')]=qs['sort'](_0x4383b1['query']['sort']);_0x33919c[_0xcbde('0x3e')]=qs[_0xcbde('0x37')](_[_0xcbde('0x3f')](_0x4383b1['query'],_0x392723['filters']),_0x417f1d);if(_0x4383b1[_0xcbde('0x35')]['filter']){_0x33919c['where']=_[_0xcbde('0x40')](_0x33919c[_0xcbde('0x3e')],{'$or':_[_0xcbde('0x30')](_0x417f1d,function(_0x6d08b2){if(_0x6d08b2[_0xcbde('0x34')]!=='VIRTUAL'){var _0x302c99={};_0x302c99[_0x6d08b2['name']]={'$like':'%'+_0x4383b1[_0xcbde('0x35')][_0xcbde('0x41')]+'%'};return _0x302c99;}})});}_0x33919c=_[_0xcbde('0x40')]({},_0x33919c,_0x4383b1['options']);var _0xd483a={'where':_0x33919c[_0xcbde('0x3e')]};return db['OpenchannelTransferReport'][_0xcbde('0x24')](_0xd483a)[_0xcbde('0x28')](function(_0x414319){_0x261b57[_0xcbde('0x24')]=_0x414319;if(_0x4383b1['query']['includeAll']){_0x33919c['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xcbde('0x42')](_0x33919c);})[_0xcbde('0x28')](function(_0x3e5c76){_0x261b57['rows']=_0x3e5c76;return _0x261b57;})['then'](respondWithFilteredResult(_0x3f4af1,_0x33919c))['catch'](handleError(_0x3f4af1,null));};exports[_0xcbde('0x43')]=function(_0x1f4223,_0xba0081){var _0x1aa947={'raw':!![],'where':{'id':_0x1f4223[_0xcbde('0x44')]['id']}},_0x3b6c20={};_0x3b6c20['model']=_[_0xcbde('0x36')](db[_0xcbde('0x31')][_0xcbde('0x32')]);_0x3b6c20[_0xcbde('0x35')]=_[_0xcbde('0x36')](_0x1f4223['query']);_0x3b6c20[_0xcbde('0x37')]=_['intersection'](_0x3b6c20[_0xcbde('0x39')],_0x3b6c20[_0xcbde('0x35')]);_0x1aa947[_0xcbde('0x3a')]=_[_0xcbde('0x38')](_0x3b6c20[_0xcbde('0x39')],qs[_0xcbde('0x3b')](_0x1f4223[_0xcbde('0x35')][_0xcbde('0x3b')]));_0x1aa947[_0xcbde('0x3a')]=_0x1aa947['attributes']['length']?_0x1aa947[_0xcbde('0x3a')]:_0x3b6c20[_0xcbde('0x39')];if(_0x1f4223['query'][_0xcbde('0x45')]){_0x1aa947[_0xcbde('0x46')]=[{'all':!![]}];}_0x1aa947=_[_0xcbde('0x40')]({},_0x1aa947,_0x1f4223[_0xcbde('0x47')]);return db[_0xcbde('0x31')]['find'](_0x1aa947)[_0xcbde('0x28')](handleEntityNotFound(_0xba0081,null))[_0xcbde('0x28')](respondWithResult(_0xba0081,null))[_0xcbde('0x48')](handleError(_0xba0081,null));};exports[_0xcbde('0x49')]=function(_0x36a98f,_0x4e69c8){return db[_0xcbde('0x31')][_0xcbde('0x49')](_0x36a98f['body'],{})[_0xcbde('0x28')](respondWithResult(_0x4e69c8,0xc9))['catch'](handleError(_0x4e69c8,null));};exports[_0xcbde('0x4a')]=function(_0x584a21,_0x4481f5){if(_0x584a21[_0xcbde('0x4b')]['id']){delete _0x584a21[_0xcbde('0x4b')]['id'];}return db[_0xcbde('0x31')][_0xcbde('0x4c')]({'where':{'id':_0x584a21['params']['id']}})['then'](handleEntityNotFound(_0x4481f5,null))['then'](saveUpdates(_0x584a21[_0xcbde('0x4b')],null))[_0xcbde('0x28')](respondWithResult(_0x4481f5,null))[_0xcbde('0x48')](handleError(_0x4481f5,null));};exports[_0xcbde('0x29')]=function(_0x2e1f2,_0x50544d){return db[_0xcbde('0x31')][_0xcbde('0x4c')]({'where':{'id':_0x2e1f2[_0xcbde('0x44')]['id']}})['then'](handleEntityNotFound(_0x50544d,null))[_0xcbde('0x28')](removeEntity(_0x50544d,null))[_0xcbde('0x48')](handleError(_0x50544d,null));};exports[_0xcbde('0x4d')]=function(_0x12af2e,_0x60906b){return db['OpenchannelTransferReport'][_0xcbde('0x4d')]()[_0xcbde('0x28')](respondWithResult(_0x60906b,null))[_0xcbde('0x48')](handleError(_0x60906b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e74f930..1a4c891 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 _0x9629=['bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xd56d70,_0x3748cb){var _0xf7fee4=function(_0x6623fd){while(--_0x6623fd){_0xd56d70['push'](_0xd56d70['shift']());}};_0xf7fee4(++_0x3748cb);}(_0x9629,0xf2));var _0x9962=function(_0xe92eee,_0x41959c){_0xe92eee=_0xe92eee-0x0;var _0x1216c6=_0x9629[_0xe92eee];return _0x1216c6;};'use strict';var _=require(_0x9962('0x0'));var util=require(_0x9962('0x1'));var logger=require(_0x9962('0x2'))(_0x9962('0x3'));var moment=require(_0x9962('0x4'));var BPromise=require(_0x9962('0x5'));var rp=require(_0x9962('0x6'));var fs=require('fs');var path=require(_0x9962('0x7'));var rimraf=require(_0x9962('0x8'));var config=require('../../config/environment');var attributes=require(_0x9962('0x9'));module['exports']=function(_0x3697a1,_0x3da037){return _0x3697a1[_0x9962('0xa')](_0x9962('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x9962('0xc'),'fields':[_0x9962('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef24=['OpenchannelTransferReport','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x1e4296,_0x47b40c){var _0x36fae6=function(_0x57f86b){while(--_0x57f86b){_0x1e4296['push'](_0x1e4296['shift']());}};_0x36fae6(++_0x47b40c);}(_0xef24,0x1b2));var _0x4ef2=function(_0x38c8ef,_0x223a33){_0x38c8ef=_0x38c8ef-0x0;var _0x379dad=_0xef24[_0x38c8ef];return _0x379dad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ef2('0x0'))(_0x4ef2('0x1'));var moment=require(_0x4ef2('0x2'));var BPromise=require(_0x4ef2('0x3'));var rp=require(_0x4ef2('0x4'));var fs=require('fs');var path=require(_0x4ef2('0x5'));var rimraf=require('rimraf');var config=require(_0x4ef2('0x6'));var attributes=require(_0x4ef2('0x7'));module[_0x4ef2('0x8')]=function(_0x419c29,_0x409e09){return _0x419c29[_0x4ef2('0x9')](_0x4ef2('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x4ef2('0xb'),'fields':[_0x4ef2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0c22a50..914f983 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 _0x4f0d=['ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x574189,_0x466535){var _0xefcee6=function(_0x2cfd6e){while(--_0x2cfd6e){_0x574189['push'](_0x574189['shift']());}};_0xefcee6(++_0x466535);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x40a0a4,_0x4269e1){_0x40a0a4=_0x40a0a4-0x0;var _0x115c37=_0x4f0d[_0x40a0a4];return _0x115c37;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4f0('0x0'));var db=require(_0xd4f0('0x1'))['db'];var utils=require(_0xd4f0('0x2'));var logger=require('../../config/logger')(_0xd4f0('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd4f0('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16da18,_0x4dd938,_0x50e79f){return new BPromise(function(_0x19a779,_0x69309d){return client[_0xd4f0('0x5')](_0x16da18,_0x50e79f)[_0xd4f0('0x6')](function(_0x9b959f){logger['info'](_0xd4f0('0x7'),_0x4dd938,_0xd4f0('0x8'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4dd938,_0xd4f0('0x8'),JSON[_0xd4f0('0x9')](_0x9b959f));if(_0x9b959f['error']){if(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xb')]===0x1f4){logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x9b959f[_0xd4f0('0xa')]['message']);return _0x69309d(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);}logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);return _0x19a779(_0x9b959f[_0xd4f0('0xa')][_0xd4f0('0xc')]);}else{logger[_0xd4f0('0xd')](_0xd4f0('0x7'),_0x4dd938,_0xd4f0('0x8'));_0x19a779(_0x9b959f[_0xd4f0('0xe')]['message']);}})['catch'](function(_0x169443){logger[_0xd4f0('0xa')](_0xd4f0('0x7'),_0x4dd938,_0x169443);_0x69309d(_0x169443);});});} \ No newline at end of file +var _0x91c6=['request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x23224c,_0x482d9b){var _0xa86d0d=function(_0x4cfa72){while(--_0x4cfa72){_0x23224c['push'](_0x23224c['shift']());}};_0xa86d0d(++_0x482d9b);}(_0x91c6,0xf9));var _0x691c=function(_0x4dac0f,_0x57c3ac){_0x4dac0f=_0x4dac0f-0x0;var _0x4b245e=_0x91c6[_0x4dac0f];return _0x4b245e;};'use strict';var _=require(_0x691c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x691c('0x1'));var rs=require(_0x691c('0x2'));var fs=require('fs');var Redis=require(_0x691c('0x3'));var db=require(_0x691c('0x4'))['db'];var utils=require(_0x691c('0x5'));var logger=require('../../config/logger')(_0x691c('0x6'));var config=require(_0x691c('0x7'));var jayson=require(_0x691c('0x8'));var client=jayson[_0x691c('0x9')][_0x691c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29876a,_0x5ccbe0,_0x93b7b0){return new BPromise(function(_0x40629a,_0xda904f){return client[_0x691c('0xb')](_0x29876a,_0x93b7b0)['then'](function(_0x2cfa1f){logger[_0x691c('0xc')](_0x691c('0xd'),_0x5ccbe0,'request\x20sent');logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5ccbe0,_0x691c('0xe'),JSON[_0x691c('0xf')](_0x2cfa1f));if(_0x2cfa1f[_0x691c('0x10')]){if(_0x2cfa1f[_0x691c('0x10')]['code']===0x1f4){logger['error'](_0x691c('0xd'),_0x5ccbe0,_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);return _0xda904f(_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);}logger[_0x691c('0x10')](_0x691c('0xd'),_0x5ccbe0,_0x2cfa1f[_0x691c('0x10')]['message']);return _0x40629a(_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);}else{logger[_0x691c('0xc')](_0x691c('0xd'),_0x5ccbe0,_0x691c('0xe'));_0x40629a(_0x2cfa1f[_0x691c('0x12')][_0x691c('0x11')]);}})[_0x691c('0x13')](function(_0x482351){logger[_0x691c('0x10')](_0x691c('0xd'),_0x5ccbe0,_0x482351);_0xda904f(_0x482351);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index fe3a2f8..d19943b 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 _0x6fc5=['update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x6fc5,0x93));var _0x56fc=function(_0x924a42,_0x1f466f){_0x924a42=_0x924a42-0x0;var _0x4c552f=_0x6fc5[_0x924a42];return _0x4c552f;};'use strict';var multer=require(_0x56fc('0x0'));var util=require('util');var path=require(_0x56fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x56fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x56fc('0x3'));var interaction=require(_0x56fc('0x4'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x56fc('0x5')]('/',auth[_0x56fc('0x6')](),controller[_0x56fc('0x7')]);router[_0x56fc('0x5')](_0x56fc('0x8'),auth[_0x56fc('0x6')](),controller[_0x56fc('0x9')]);router[_0x56fc('0xa')]('/',auth[_0x56fc('0x6')](),controller[_0x56fc('0xb')]);router[_0x56fc('0xc')](_0x56fc('0x8'),auth[_0x56fc('0x6')](),controller[_0x56fc('0xd')]);router['delete'](_0x56fc('0x8'),auth['isAuthenticated'](),controller[_0x56fc('0xe')]);module[_0x56fc('0xf')]=router; \ No newline at end of file +var _0x780d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','post','create','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5c0944,_0x1eae68){var _0x17fa50=function(_0x4df239){while(--_0x4df239){_0x5c0944['push'](_0x5c0944['shift']());}};_0x17fa50(++_0x1eae68);}(_0x780d,0x10a));var _0xd780=function(_0x227543,_0x417820){_0x227543=_0x227543-0x0;var _0x156565=_0x780d[_0x227543];return _0x156565;};'use strict';var multer=require(_0xd780('0x0'));var util=require(_0xd780('0x1'));var path=require('path');var timeout=require(_0xd780('0x2'));var express=require(_0xd780('0x3'));var router=express[_0xd780('0x4')]();var fs_extra=require(_0xd780('0x5'));var auth=require(_0xd780('0x6'));var interaction=require(_0xd780('0x7'));var config=require(_0xd780('0x8'));var controller=require(_0xd780('0x9'));router[_0xd780('0xa')]('/',auth[_0xd780('0xb')](),controller['index']);router[_0xd780('0xa')](_0xd780('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd780('0xd')]('/',auth[_0xd780('0xb')](),controller[_0xd780('0xe')]);router['put'](_0xd780('0xc'),auth[_0xd780('0xb')](),controller['update']);router['delete'](_0xd780('0xc'),auth[_0xd780('0xb')](),controller['destroy']);module[_0xd780('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 6d58224..4d8e94b 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 _0x2171=['STRING','sequelize','name'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x2171,0x70));var _0x1217=function(_0x5da059,_0x22a596){_0x5da059=_0x5da059-0x0;var _0x4f5e90=_0x2171[_0x5da059];return _0x4f5e90;};'use strict';var Sequelize=require(_0x1217('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1217('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x1217('0x2')]}}; \ No newline at end of file +var _0xdb14=['STRING','sequelize','exports','name'];(function(_0x110fcd,_0x1cbd47){var _0x13fd87=function(_0x4c0ce5){while(--_0x4c0ce5){_0x110fcd['push'](_0x110fcd['shift']());}};_0x13fd87(++_0x1cbd47);}(_0xdb14,0x18d));var _0x4db1=function(_0x55b9dc,_0x2c7227){_0x55b9dc=_0x55b9dc-0x0;var _0x15d404=_0xdb14[_0x55b9dc];return _0x15d404;};'use strict';var Sequelize=require(_0x4db1('0x0'));module[_0x4db1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4db1('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4db1('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 57c6ba0..29e9301 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 _0x0ef1=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','set','Content-Range','reject','then','get','Pauses','UserProfileResource','destroy','sendStatus','error','name','send','Pause','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x226879,_0x30a56b){var _0x20964c=function(_0x4a1ea6){while(--_0x4a1ea6){_0x226879['push'](_0x226879['shift']());}};_0x20964c(++_0x30a56b);}(_0x0ef1,0x108));var _0x10ef=function(_0x4838e5,_0x4fba21){_0x4838e5=_0x4838e5-0x0;var _0x257561=_0x0ef1[_0x4838e5];return _0x257561;};'use strict';var emlformat=require(_0x10ef('0x0'));var rimraf=require(_0x10ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10ef('0x2'));var rp=require(_0x10ef('0x3'));var moment=require(_0x10ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x10ef('0x5'));var util=require(_0x10ef('0x6'));var path=require(_0x10ef('0x7'));var sox=require(_0x10ef('0x8'));var csv=require('to-csv');var ejs=require(_0x10ef('0x9'));var fs=require('fs');var fs_extra=require(_0x10ef('0xa'));var _=require(_0x10ef('0xb'));var squel=require(_0x10ef('0xc'));var crypto=require(_0x10ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x10ef('0xe'));var toCsv=require(_0x10ef('0xf'));var querystring=require(_0x10ef('0x10'));var Papa=require(_0x10ef('0x11'));var Redis=require(_0x10ef('0x12'));var authService=require(_0x10ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10ef('0x14'));var logger=require(_0x10ef('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10ef('0x16'));var db=require(_0x10ef('0x17'))['db'];function respondWithStatusCode(_0x2bf142,_0x4d6563){_0x4d6563=_0x4d6563||0xcc;return function(_0x376e66){if(_0x376e66){return _0x2bf142['sendStatus'](_0x4d6563);}return _0x2bf142['status'](_0x4d6563)[_0x10ef('0x18')]();};}function respondWithResult(_0x1bb5d0,_0x2eafbe){_0x2eafbe=_0x2eafbe||0xc8;return function(_0x296520){if(_0x296520){return _0x1bb5d0['status'](_0x2eafbe)[_0x10ef('0x19')](_0x296520);}};}function respondWithFilteredResult(_0x196d4f,_0x56c076){return function(_0x538f41){if(_0x538f41){var _0xcf6797=typeof _0x56c076[_0x10ef('0x1a')]===_0x10ef('0x1b')&&typeof _0x56c076['limit']===_0x10ef('0x1b');var _0x127ba7=_0x538f41[_0x10ef('0x1c')];var _0x54d4bb=_0xcf6797?0x0:_0x56c076['offset'];var _0x25cb4c=_0xcf6797?_0x538f41[_0x10ef('0x1c')]:_0x56c076[_0x10ef('0x1a')]+_0x56c076['limit'];var _0x2f0796;if(_0x25cb4c>=_0x127ba7){_0x25cb4c=_0x127ba7;_0x2f0796=0xc8;}else{_0x2f0796=0xce;}_0x196d4f[_0x10ef('0x1d')](_0x2f0796);return _0x196d4f[_0x10ef('0x1e')](_0x10ef('0x1f'),_0x54d4bb+'-'+_0x25cb4c+'/'+_0x127ba7)[_0x10ef('0x19')](_0x538f41);}return null;};}function patchUpdates(_0xbb3592){return function(_0x292549){try{jsonpatch['apply'](_0x292549,_0xbb3592,!![]);}catch(_0x43d3a0){return BPromise[_0x10ef('0x20')](_0x43d3a0);}return _0x292549['save']();};}function saveUpdates(_0x3b3374,_0x4c47d2){return function(_0x508d39){if(_0x508d39){return _0x508d39['update'](_0x3b3374)[_0x10ef('0x21')](function(_0x465135){return _0x465135;});}return null;};}function removeEntity(_0x13c081,_0x17e648){return function(_0x47ad3a){if(_0x47ad3a){return _0x47ad3a['destroy']()[_0x10ef('0x21')](function(){var _0x4169b0=_0x47ad3a[_0x10ef('0x22')]({'plain':!![]});var _0x3bd0f2=_0x10ef('0x23');return db[_0x10ef('0x24')][_0x10ef('0x25')]({'where':{'type':_0x3bd0f2,'resourceId':_0x4169b0['id']}})[_0x10ef('0x21')](function(){return _0x47ad3a;});})[_0x10ef('0x21')](function(){_0x13c081[_0x10ef('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b13f8,_0x5954a6){return function(_0x20e2bb){if(!_0x20e2bb){_0x1b13f8[_0x10ef('0x26')](0x194);}return _0x20e2bb;};}function handleError(_0x30a55f,_0x45feac){_0x45feac=_0x45feac||0x1f4;return function(_0x48a0ca){logger[_0x10ef('0x27')](_0x48a0ca['stack']);if(_0x48a0ca['name']){delete _0x48a0ca[_0x10ef('0x28')];}_0x30a55f[_0x10ef('0x1d')](_0x45feac)[_0x10ef('0x29')](_0x48a0ca);};}exports['index']=function(_0x223bae,_0x2cbc67){var _0x37f608={},_0x26fd48={},_0x21a594={'count':0x0,'rows':[]};var _0x36a0ed=_['map'](db[_0x10ef('0x2a')][_0x10ef('0x2b')],function(_0xbaae99){return{'name':_0xbaae99[_0x10ef('0x2c')],'type':_0xbaae99[_0x10ef('0x2d')]['key']};});_0x26fd48['model']=_[_0x10ef('0x2e')](_0x36a0ed,_0x10ef('0x28'));_0x26fd48[_0x10ef('0x2f')]=_[_0x10ef('0x30')](_0x223bae[_0x10ef('0x2f')]);_0x26fd48[_0x10ef('0x31')]=_[_0x10ef('0x32')](_0x26fd48[_0x10ef('0x33')],_0x26fd48[_0x10ef('0x2f')]);_0x37f608[_0x10ef('0x34')]=_[_0x10ef('0x32')](_0x26fd48[_0x10ef('0x33')],qs[_0x10ef('0x35')](_0x223bae['query']['fields']));_0x37f608[_0x10ef('0x34')]=_0x37f608[_0x10ef('0x34')][_0x10ef('0x36')]?_0x37f608['attributes']:_0x26fd48['model'];if(!_0x223bae[_0x10ef('0x2f')][_0x10ef('0x37')](_0x10ef('0x38'))){_0x37f608[_0x10ef('0x39')]=qs['limit'](_0x223bae['query']['limit']);_0x37f608['offset']=qs[_0x10ef('0x1a')](_0x223bae[_0x10ef('0x2f')]['offset']);}_0x37f608[_0x10ef('0x3a')]=qs[_0x10ef('0x3b')](_0x223bae['query']['sort']);_0x37f608[_0x10ef('0x3c')]=qs[_0x10ef('0x31')](_[_0x10ef('0x3d')](_0x223bae[_0x10ef('0x2f')],_0x26fd48['filters']),_0x36a0ed);if(_0x223bae[_0x10ef('0x2f')][_0x10ef('0x3e')]){_0x37f608[_0x10ef('0x3c')]=_['merge'](_0x37f608['where'],{'$or':_[_0x10ef('0x2e')](_0x36a0ed,function(_0x2475af){if(_0x2475af[_0x10ef('0x2d')]!==_0x10ef('0x3f')){var _0xc68172={};_0xc68172[_0x2475af[_0x10ef('0x28')]]={'$like':'%'+_0x223bae[_0x10ef('0x2f')][_0x10ef('0x3e')]+'%'};return _0xc68172;}})});}_0x37f608=_[_0x10ef('0x40')]({},_0x37f608,_0x223bae[_0x10ef('0x41')]);var _0x12c692={'where':_0x37f608[_0x10ef('0x3c')]};return db[_0x10ef('0x2a')][_0x10ef('0x1c')](_0x12c692)[_0x10ef('0x21')](function(_0x28ae1f){_0x21a594['count']=_0x28ae1f;if(_0x223bae[_0x10ef('0x2f')][_0x10ef('0x42')]){_0x37f608[_0x10ef('0x43')]=[{'all':!![]}];}return db['Pause'][_0x10ef('0x44')](_0x37f608);})[_0x10ef('0x21')](function(_0x47c099){_0x21a594[_0x10ef('0x45')]=_0x47c099;return _0x21a594;})[_0x10ef('0x21')](respondWithFilteredResult(_0x2cbc67,_0x37f608))[_0x10ef('0x46')](handleError(_0x2cbc67,null));};exports[_0x10ef('0x47')]=function(_0x4ad411,_0x356e4f){var _0x29aca9={'raw':!![],'where':{'id':_0x4ad411[_0x10ef('0x48')]['id']}},_0x22f2d8={};_0x22f2d8['model']=_['keys'](db[_0x10ef('0x2a')][_0x10ef('0x2b')]);_0x22f2d8[_0x10ef('0x2f')]=_[_0x10ef('0x30')](_0x4ad411[_0x10ef('0x2f')]);_0x22f2d8[_0x10ef('0x31')]=_['intersection'](_0x22f2d8[_0x10ef('0x33')],_0x22f2d8[_0x10ef('0x2f')]);_0x29aca9[_0x10ef('0x34')]=_[_0x10ef('0x32')](_0x22f2d8[_0x10ef('0x33')],qs[_0x10ef('0x35')](_0x4ad411[_0x10ef('0x2f')]['fields']));_0x29aca9[_0x10ef('0x34')]=_0x29aca9[_0x10ef('0x34')][_0x10ef('0x36')]?_0x29aca9['attributes']:_0x22f2d8[_0x10ef('0x33')];if(_0x4ad411[_0x10ef('0x2f')]['includeAll']){_0x29aca9[_0x10ef('0x43')]=[{'all':!![]}];}_0x29aca9=_[_0x10ef('0x40')]({},_0x29aca9,_0x4ad411['options']);return db[_0x10ef('0x2a')]['find'](_0x29aca9)[_0x10ef('0x21')](handleEntityNotFound(_0x356e4f,null))[_0x10ef('0x21')](respondWithResult(_0x356e4f,null))['catch'](handleError(_0x356e4f,null));};exports[_0x10ef('0x49')]=function(_0x23bd7c,_0x37c6df){return db['Pause'][_0x10ef('0x49')](_0x23bd7c['body'],{})[_0x10ef('0x21')](function(_0x319627){var _0x8df633=_0x23bd7c[_0x10ef('0x4a')]['get']({'plain':!![]});if(!_0x8df633)throw new Error(_0x10ef('0x4b'));if(_0x8df633['role']===_0x10ef('0x4a')){var _0xdd5781=_0x319627[_0x10ef('0x22')]({'plain':!![]});var _0x20343c=_0x10ef('0x23');return db[_0x10ef('0x4c')][_0x10ef('0x4d')]({'where':{'name':_0x20343c,'userProfileId':_0x8df633['userProfileId']},'raw':!![]})[_0x10ef('0x21')](function(_0x2cd6cf){if(_0x2cd6cf&&_0x2cd6cf[_0x10ef('0x4e')]===0x0){return db[_0x10ef('0x24')][_0x10ef('0x49')]({'name':_0xdd5781[_0x10ef('0x28')],'resourceId':_0xdd5781['id'],'type':_0x2cd6cf['name'],'sectionId':_0x2cd6cf['id']},{})['then'](function(){return _0x319627;});}else{return _0x319627;}})[_0x10ef('0x46')](function(_0x4a555f){logger['error'](_0x10ef('0x4f'),_0x4a555f);throw _0x4a555f;});}return _0x319627;})[_0x10ef('0x21')](respondWithResult(_0x37c6df,0xc9))[_0x10ef('0x46')](handleError(_0x37c6df,null));};exports['update']=function(_0x5abb04,_0x8a7bee){if(_0x5abb04[_0x10ef('0x50')]['id']){delete _0x5abb04[_0x10ef('0x50')]['id'];}return db[_0x10ef('0x2a')]['find']({'where':{'id':_0x5abb04[_0x10ef('0x48')]['id']}})[_0x10ef('0x21')](handleEntityNotFound(_0x8a7bee,null))[_0x10ef('0x21')](saveUpdates(_0x5abb04[_0x10ef('0x50')],null))[_0x10ef('0x21')](respondWithResult(_0x8a7bee,null))['catch'](handleError(_0x8a7bee,null));};exports[_0x10ef('0x25')]=function(_0x3b00d6,_0x634484){return db['Pause'][_0x10ef('0x4d')]({'where':{'id':_0x3b00d6[_0x10ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x634484,null))[_0x10ef('0x21')](removeEntity(_0x634484,null))[_0x10ef('0x46')](handleError(_0x634484,null));}; \ No newline at end of file +var _0xb5da=['UserProfileResource','error','stack','name','send','map','Pause','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','Pauses'];(function(_0x3ebd13,_0x48e271){var _0x527ef6=function(_0x373a85){while(--_0x373a85){_0x3ebd13['push'](_0x3ebd13['shift']());}};_0x527ef6(++_0x48e271);}(_0xb5da,0xd7));var _0xab5d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb5da[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab5d('0x0'));var zipdir=require(_0xab5d('0x1'));var jsonpatch=require(_0xab5d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab5d('0x3'));var Mustache=require('mustache');var util=require(_0xab5d('0x4'));var path=require(_0xab5d('0x5'));var sox=require(_0xab5d('0x6'));var csv=require(_0xab5d('0x7'));var ejs=require(_0xab5d('0x8'));var fs=require('fs');var fs_extra=require(_0xab5d('0x9'));var _=require('lodash');var squel=require(_0xab5d('0xa'));var crypto=require('crypto');var jsforce=require(_0xab5d('0xb'));var deskjs=require(_0xab5d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab5d('0xd'));var Redis=require(_0xab5d('0xe'));var authService=require(_0xab5d('0xf'));var qs=require(_0xab5d('0x10'));var as=require(_0xab5d('0x11'));var hardwareService=require(_0xab5d('0x12'));var logger=require(_0xab5d('0x13'))(_0xab5d('0x14'));var utils=require('../../config/utils');var config=require(_0xab5d('0x15'));var licenseUtil=require(_0xab5d('0x16'));var db=require(_0xab5d('0x17'))['db'];function respondWithStatusCode(_0x9ea2df,_0x3a87df){_0x3a87df=_0x3a87df||0xcc;return function(_0x571584){if(_0x571584){return _0x9ea2df[_0xab5d('0x18')](_0x3a87df);}return _0x9ea2df[_0xab5d('0x19')](_0x3a87df)[_0xab5d('0x1a')]();};}function respondWithResult(_0x1015ef,_0x471430){_0x471430=_0x471430||0xc8;return function(_0x21f472){if(_0x21f472){return _0x1015ef['status'](_0x471430)[_0xab5d('0x1b')](_0x21f472);}};}function respondWithFilteredResult(_0x47e607,_0x4a1bb9){return function(_0x532a52){if(_0x532a52){var _0x58babb=typeof _0x4a1bb9[_0xab5d('0x1c')]==='undefined'&&typeof _0x4a1bb9[_0xab5d('0x1d')]===_0xab5d('0x1e');var _0x10bc8d=_0x532a52['count'];var _0x28a825=_0x58babb?0x0:_0x4a1bb9['offset'];var _0x4116d1=_0x58babb?_0x532a52['count']:_0x4a1bb9[_0xab5d('0x1c')]+_0x4a1bb9[_0xab5d('0x1d')];var _0x3129ac;if(_0x4116d1>=_0x10bc8d){_0x4116d1=_0x10bc8d;_0x3129ac=0xc8;}else{_0x3129ac=0xce;}_0x47e607[_0xab5d('0x19')](_0x3129ac);return _0x47e607[_0xab5d('0x1f')](_0xab5d('0x20'),_0x28a825+'-'+_0x4116d1+'/'+_0x10bc8d)[_0xab5d('0x1b')](_0x532a52);}return null;};}function patchUpdates(_0x17e4e6){return function(_0x9dc1d2){try{jsonpatch[_0xab5d('0x21')](_0x9dc1d2,_0x17e4e6,!![]);}catch(_0x3fed3c){return BPromise[_0xab5d('0x22')](_0x3fed3c);}return _0x9dc1d2[_0xab5d('0x23')]();};}function saveUpdates(_0x467ba7,_0x3f4373){return function(_0x425e79){if(_0x425e79){return _0x425e79[_0xab5d('0x24')](_0x467ba7)[_0xab5d('0x25')](function(_0x2b69a8){return _0x2b69a8;});}return null;};}function removeEntity(_0xd6e9c7,_0x59efe2){return function(_0x151f6a){if(_0x151f6a){return _0x151f6a[_0xab5d('0x26')]()[_0xab5d('0x25')](function(){var _0x45300d=_0x151f6a['get']({'plain':!![]});var _0x59f9e6=_0xab5d('0x27');return db[_0xab5d('0x28')][_0xab5d('0x26')]({'where':{'type':_0x59f9e6,'resourceId':_0x45300d['id']}})[_0xab5d('0x25')](function(){return _0x151f6a;});})['then'](function(){_0xd6e9c7[_0xab5d('0x19')](0xcc)[_0xab5d('0x1a')]();});}};}function handleEntityNotFound(_0x2f538f,_0x2fa232){return function(_0x195aef){if(!_0x195aef){_0x2f538f[_0xab5d('0x18')](0x194);}return _0x195aef;};}function handleError(_0x278406,_0x3b1bd1){_0x3b1bd1=_0x3b1bd1||0x1f4;return function(_0x4d69ba){logger[_0xab5d('0x29')](_0x4d69ba[_0xab5d('0x2a')]);if(_0x4d69ba[_0xab5d('0x2b')]){delete _0x4d69ba[_0xab5d('0x2b')];}_0x278406[_0xab5d('0x19')](_0x3b1bd1)[_0xab5d('0x2c')](_0x4d69ba);};}exports['index']=function(_0x4d2875,_0x28b736){var _0x124134={},_0x1af9ac={},_0x309253={'count':0x0,'rows':[]};var _0x4a7905=_[_0xab5d('0x2d')](db[_0xab5d('0x2e')][_0xab5d('0x2f')],function(_0x4054bf){return{'name':_0x4054bf['fieldName'],'type':_0x4054bf['type'][_0xab5d('0x30')]};});_0x1af9ac[_0xab5d('0x31')]=_['map'](_0x4a7905,_0xab5d('0x2b'));_0x1af9ac[_0xab5d('0x32')]=_[_0xab5d('0x33')](_0x4d2875[_0xab5d('0x32')]);_0x1af9ac[_0xab5d('0x34')]=_['intersection'](_0x1af9ac[_0xab5d('0x31')],_0x1af9ac[_0xab5d('0x32')]);_0x124134[_0xab5d('0x35')]=_[_0xab5d('0x36')](_0x1af9ac['model'],qs['fields'](_0x4d2875[_0xab5d('0x32')][_0xab5d('0x37')]));_0x124134[_0xab5d('0x35')]=_0x124134['attributes'][_0xab5d('0x38')]?_0x124134[_0xab5d('0x35')]:_0x1af9ac[_0xab5d('0x31')];if(!_0x4d2875[_0xab5d('0x32')]['hasOwnProperty'](_0xab5d('0x39'))){_0x124134['limit']=qs['limit'](_0x4d2875[_0xab5d('0x32')][_0xab5d('0x1d')]);_0x124134[_0xab5d('0x1c')]=qs[_0xab5d('0x1c')](_0x4d2875[_0xab5d('0x32')]['offset']);}_0x124134[_0xab5d('0x3a')]=qs['sort'](_0x4d2875[_0xab5d('0x32')][_0xab5d('0x3b')]);_0x124134[_0xab5d('0x3c')]=qs[_0xab5d('0x34')](_[_0xab5d('0x3d')](_0x4d2875['query'],_0x1af9ac[_0xab5d('0x34')]),_0x4a7905);if(_0x4d2875[_0xab5d('0x32')][_0xab5d('0x3e')]){_0x124134[_0xab5d('0x3c')]=_[_0xab5d('0x3f')](_0x124134[_0xab5d('0x3c')],{'$or':_['map'](_0x4a7905,function(_0x318861){if(_0x318861[_0xab5d('0x40')]!==_0xab5d('0x41')){var _0x991746={};_0x991746[_0x318861[_0xab5d('0x2b')]]={'$like':'%'+_0x4d2875[_0xab5d('0x32')][_0xab5d('0x3e')]+'%'};return _0x991746;}})});}_0x124134=_[_0xab5d('0x3f')]({},_0x124134,_0x4d2875[_0xab5d('0x42')]);var _0x4ddaf5={'where':_0x124134[_0xab5d('0x3c')]};return db[_0xab5d('0x2e')][_0xab5d('0x43')](_0x4ddaf5)[_0xab5d('0x25')](function(_0x16aec8){_0x309253[_0xab5d('0x43')]=_0x16aec8;if(_0x4d2875['query'][_0xab5d('0x44')]){_0x124134['include']=[{'all':!![]}];}return db[_0xab5d('0x2e')][_0xab5d('0x45')](_0x124134);})[_0xab5d('0x25')](function(_0x4999ef){_0x309253[_0xab5d('0x46')]=_0x4999ef;return _0x309253;})['then'](respondWithFilteredResult(_0x28b736,_0x124134))[_0xab5d('0x47')](handleError(_0x28b736,null));};exports[_0xab5d('0x48')]=function(_0x5a1934,_0x1c2e19){var _0x5bbeab={'raw':!![],'where':{'id':_0x5a1934[_0xab5d('0x49')]['id']}},_0x41768b={};_0x41768b[_0xab5d('0x31')]=_[_0xab5d('0x33')](db[_0xab5d('0x2e')][_0xab5d('0x2f')]);_0x41768b[_0xab5d('0x32')]=_[_0xab5d('0x33')](_0x5a1934[_0xab5d('0x32')]);_0x41768b[_0xab5d('0x34')]=_[_0xab5d('0x36')](_0x41768b[_0xab5d('0x31')],_0x41768b[_0xab5d('0x32')]);_0x5bbeab[_0xab5d('0x35')]=_[_0xab5d('0x36')](_0x41768b[_0xab5d('0x31')],qs[_0xab5d('0x37')](_0x5a1934[_0xab5d('0x32')]['fields']));_0x5bbeab['attributes']=_0x5bbeab[_0xab5d('0x35')][_0xab5d('0x38')]?_0x5bbeab[_0xab5d('0x35')]:_0x41768b['model'];if(_0x5a1934[_0xab5d('0x32')]['includeAll']){_0x5bbeab[_0xab5d('0x4a')]=[{'all':!![]}];}_0x5bbeab=_[_0xab5d('0x3f')]({},_0x5bbeab,_0x5a1934[_0xab5d('0x42')]);return db[_0xab5d('0x2e')][_0xab5d('0x4b')](_0x5bbeab)['then'](handleEntityNotFound(_0x1c2e19,null))[_0xab5d('0x25')](respondWithResult(_0x1c2e19,null))[_0xab5d('0x47')](handleError(_0x1c2e19,null));};exports[_0xab5d('0x4c')]=function(_0x3eeaf7,_0x1131b5){return db['Pause'][_0xab5d('0x4c')](_0x3eeaf7[_0xab5d('0x4d')],{})[_0xab5d('0x25')](function(_0x1621a6){var _0x37bc83=_0x3eeaf7['user'][_0xab5d('0x4e')]({'plain':!![]});if(!_0x37bc83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37bc83[_0xab5d('0x4f')]===_0xab5d('0x50')){var _0x37b790=_0x1621a6[_0xab5d('0x4e')]({'plain':!![]});var _0x16c160='Pauses';return db[_0xab5d('0x51')][_0xab5d('0x4b')]({'where':{'name':_0x16c160,'userProfileId':_0x37bc83[_0xab5d('0x52')]},'raw':!![]})[_0xab5d('0x25')](function(_0x45d993){if(_0x45d993&&_0x45d993[_0xab5d('0x53')]===0x0){return db['UserProfileResource'][_0xab5d('0x4c')]({'name':_0x37b790[_0xab5d('0x2b')],'resourceId':_0x37b790['id'],'type':_0x45d993['name'],'sectionId':_0x45d993['id']},{})[_0xab5d('0x25')](function(){return _0x1621a6;});}else{return _0x1621a6;}})[_0xab5d('0x47')](function(_0x216c66){logger[_0xab5d('0x29')](_0xab5d('0x54'),_0x216c66);throw _0x216c66;});}return _0x1621a6;})[_0xab5d('0x25')](respondWithResult(_0x1131b5,0xc9))[_0xab5d('0x47')](handleError(_0x1131b5,null));};exports['update']=function(_0x19e409,_0x47667a){if(_0x19e409['body']['id']){delete _0x19e409[_0xab5d('0x4d')]['id'];}return db[_0xab5d('0x2e')][_0xab5d('0x4b')]({'where':{'id':_0x19e409[_0xab5d('0x49')]['id']}})[_0xab5d('0x25')](handleEntityNotFound(_0x47667a,null))['then'](saveUpdates(_0x19e409['body'],null))['then'](respondWithResult(_0x47667a,null))['catch'](handleError(_0x47667a,null));};exports['destroy']=function(_0x2701c1,_0x14ec53){return db[_0xab5d('0x2e')][_0xab5d('0x4b')]({'where':{'id':_0x2701c1[_0xab5d('0x49')]['id']}})[_0xab5d('0x25')](handleEntityNotFound(_0x14ec53,null))['then'](removeEntity(_0x14ec53,null))['catch'](handleError(_0x14ec53,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e76a922..437c9c7 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6aa7,0x178));var _0x76aa=function(_0x59a8ae,_0x34b47d){_0x59a8ae=_0x59a8ae-0x0;var _0xce1243=_0x6aa7[_0x59a8ae];return _0xce1243;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x395896,_0xd38f7a){var _0xa7dadd=function(_0x54537c){while(--_0x54537c){_0x395896['push'](_0x395896['shift']());}};_0xa7dadd(++_0xd38f7a);}(_0x814b,0x1a2));var _0xb814=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x814b[_0x24392f];return _0x591e33;};'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 759d8be..19eaffe 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(_0x1aa12d,_0x559817){var _0x3f01f5=function(_0x2524b4){while(--_0x2524b4){_0x1aa12d['push'](_0x1aa12d['shift']());}};_0x3f01f5(++_0x559817);}(_0xb10b,0x12a));var _0xbb10=function(_0xe6164f,_0x47e826){_0xe6164f=_0xe6164f-0x0;var _0x557c61=_0xb10b[_0xe6164f];return _0x557c61;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +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(_0x4375a1,_0x36bc26){var _0xe68e65=function(_0x34f23d){while(--_0x34f23d){_0x4375a1['push'](_0x4375a1['shift']());}};_0xe68e65(++_0x36bc26);}(_0xb10b,0x12a));var _0xbb10=function(_0x16ca4a,_0x1ed3e7){_0x16ca4a=_0x16ca4a-0x0;var _0x48f844=_0xb10b[_0x16ca4a];return _0x48f844;};'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 da96a77..57ae79e 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 _0x4fdb=['server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','/webhook','webhookGet','get','show','/:id/download','download','diskStorage','root'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1beed1,_0x166e72){_0x1beed1=_0x1beed1-0x0;var _0x248552=_0x4fdb[_0x1beed1];return _0x248552;};'use strict';var multer=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var path=require(_0xb4fd('0x2'));var timeout=require(_0xb4fd('0x3'));var express=require(_0xb4fd('0x4'));var router=express[_0xb4fd('0x5')]();var fs_extra=require(_0xb4fd('0x6'));var auth=require(_0xb4fd('0x7'));var interaction=require(_0xb4fd('0x8'));var config=require('../../config/environment');var controller=require(_0xb4fd('0x9'));router['get']('/',auth[_0xb4fd('0xa')](),controller['index']);router['get'](_0xb4fd('0xb'),controller[_0xb4fd('0xc')]);router[_0xb4fd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb4fd('0xe')]);router[_0xb4fd('0xd')](_0xb4fd('0xf'),auth['isAuthenticated'](),controller[_0xb4fd('0x10')]);var upload=multer({'storage':multer[_0xb4fd('0x11')]({'destination':function(_0x2148db,_0x23b08f,_0x306bd4){_0x306bd4(null,path['join'](config[_0xb4fd('0x12')],_0xb4fd('0x13')));},'filename':function(_0x2e8ee1,_0x120c2e,_0x5ba7e1){_0x120c2e[_0xb4fd('0x14')]=_0x120c2e[_0xb4fd('0x14')][_0xb4fd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ba7e1(null,util['format'](_0xb4fd('0x16'),path[_0xb4fd('0x17')](_0x120c2e[_0xb4fd('0x14')],path[_0xb4fd('0x18')](_0x120c2e[_0xb4fd('0x14')])),Date[_0xb4fd('0x19')](),path[_0xb4fd('0x18')](_0x120c2e['originalname'])));}})});router[_0xb4fd('0x1a')]('/',upload[_0xb4fd('0x1b')](_0xb4fd('0x1c')),controller[_0xb4fd('0x1d')]);router[_0xb4fd('0x1a')](_0xb4fd('0xb'),controller[_0xb4fd('0x1e')]);router[_0xb4fd('0x1f')](_0xb4fd('0x20'),auth[_0xb4fd('0xa')](),controller[_0xb4fd('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module[_0xb4fd('0x22')]=router; \ No newline at end of file +var _0x29d4=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','show','download','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','file','webhookPost','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x29d4,0x1a1));var _0x429d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x29d4[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x429d('0x0'));var util=require('util');var path=require(_0x429d('0x1'));var timeout=require(_0x429d('0x2'));var express=require(_0x429d('0x3'));var router=express[_0x429d('0x4')]();var fs_extra=require(_0x429d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require(_0x429d('0x8'));router[_0x429d('0x9')]('/',auth[_0x429d('0xa')](),controller[_0x429d('0xb')]);router[_0x429d('0x9')](_0x429d('0xc'),controller['webhookGet']);router[_0x429d('0x9')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0xd')]);router[_0x429d('0x9')]('/:id/download',auth[_0x429d('0xa')](),controller[_0x429d('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31ff87,_0x2fd1ca,_0x417f77){_0x417f77(null,path['join'](config[_0x429d('0xf')],_0x429d('0x10')));},'filename':function(_0x1d933b,_0x1cb1cf,_0x4843af){_0x1cb1cf[_0x429d('0x11')]=_0x1cb1cf[_0x429d('0x11')][_0x429d('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4843af(null,util['format'](_0x429d('0x13'),path[_0x429d('0x14')](_0x1cb1cf['originalname'],path[_0x429d('0x15')](_0x1cb1cf[_0x429d('0x11')])),Date[_0x429d('0x16')](),path[_0x429d('0x15')](_0x1cb1cf[_0x429d('0x11')])));}})});router[_0x429d('0x17')]('/',upload['single'](_0x429d('0x18')),controller['upload']);router[_0x429d('0x17')](_0x429d('0xc'),controller[_0x429d('0x19')]);router[_0x429d('0x1a')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0x1b')]);router[_0x429d('0x1c')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0x1c')]);module[_0x429d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ffe789d..13442e0 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 _0xf382=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf382,0xfe));var _0x2f38=function(_0x4d610a,_0x8891ef){_0x4d610a=_0x4d610a-0x0;var _0x831be7=_0xf382[_0x4d610a];return _0x831be7;};'use strict';var Sequelize=require(_0x2f38('0x0'));module[_0x2f38('0x1')]={'name':{'type':Sequelize[_0x2f38('0x2')]},'type':{'type':Sequelize[_0x2f38('0x3')](_0x2f38('0x4'),_0x2f38('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2f38('0x6')]},'path':{'type':Sequelize[_0x2f38('0x2')],'comment':_0x2f38('0x7')},'active':{'type':Sequelize[_0x2f38('0x8')],'defaultValue':0x0,'comment':_0x2f38('0x9')},'sidebar':{'type':Sequelize[_0x2f38('0x3')](_0x2f38('0xa'),_0x2f38('0xb'),_0x2f38('0xc'),'never'),'defaultValue':_0x2f38('0xc'),'comment':_0x2f38('0xd')},'icon':{'type':Sequelize[_0x2f38('0x2')]},'adminUrl':{'type':Sequelize[_0x2f38('0x2')]},'agentUrl':{'type':Sequelize[_0x2f38('0x2')]},'scriptName':{'type':Sequelize[_0x2f38('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfad7=['adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','script','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0xfad7,0xbb));var _0x7fad=function(_0x5a37cb,_0x22ed30){_0x5a37cb=_0x5a37cb-0x0;var _0x2942c8=_0xfad7[_0x5a37cb];return _0x2942c8;};'use strict';var Sequelize=require(_0x7fad('0x0'));module[_0x7fad('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7fad('0x2')]('html',_0x7fad('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x7fad('0x4')],'comment':_0x7fad('0x5')},'active':{'type':Sequelize[_0x7fad('0x6')],'defaultValue':0x0,'comment':_0x7fad('0x7')},'sidebar':{'type':Sequelize[_0x7fad('0x2')](_0x7fad('0x8'),_0x7fad('0x9'),'always',_0x7fad('0xa')),'defaultValue':_0x7fad('0xb'),'comment':_0x7fad('0xc')},'icon':{'type':Sequelize[_0x7fad('0x4')]},'adminUrl':{'type':Sequelize[_0x7fad('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x7fad('0x4')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1c4fac0..b6a3e61 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 _0xd0ac=['end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Plugins','destroy','sendStatus','error','stack','name','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','options','include','Plugin','findAll','rows','catch','show','params','keys','includeAll','merge','find','download','path','root','server/files/plugins','format','%s.zip','basename','createWriteStream','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Sequelize','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','manifest.json','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','admin','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xd0ac,0x130));var _0xcd0a=function(_0x4f2a47,_0x42d97f){_0x4f2a47=_0x4f2a47-0x0;var _0x4e80cc=_0xd0ac[_0x4f2a47];return _0x4e80cc;};'use strict';var emlformat=require(_0xcd0a('0x0'));var rimraf=require(_0xcd0a('0x1'));var zipdir=require(_0xcd0a('0x2'));var jsonpatch=require(_0xcd0a('0x3'));var rp=require(_0xcd0a('0x4'));var moment=require('moment');var BPromise=require(_0xcd0a('0x5'));var Mustache=require(_0xcd0a('0x6'));var util=require(_0xcd0a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcd0a('0x8'));var ejs=require(_0xcd0a('0x9'));var fs=require('fs');var fs_extra=require(_0xcd0a('0xa'));var _=require(_0xcd0a('0xb'));var squel=require(_0xcd0a('0xc'));var crypto=require('crypto');var jsforce=require(_0xcd0a('0xd'));var deskjs=require(_0xcd0a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd0a('0xf'));var Papa=require('papaparse');var extract=require(_0xcd0a('0x10'));var rimraf=require(_0xcd0a('0x1'));var archiver=require(_0xcd0a('0x11'));var Redis=require(_0xcd0a('0x12'));var authService=require(_0xcd0a('0x13'));var qs=require(_0xcd0a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd0a('0x15'))(_0xcd0a('0x16'));var utils=require(_0xcd0a('0x17'));var config=require(_0xcd0a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd0a('0x19'))['db'];config[_0xcd0a('0x1a')]=_[_0xcd0a('0x1b')](config[_0xcd0a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd0a('0x1c'))(new Redis(config[_0xcd0a('0x1a')]));require(_0xcd0a('0x1d'))[_0xcd0a('0x1e')](socket);function respondWithStatusCode(_0x1a1702,_0xa1451a){_0xa1451a=_0xa1451a||0xcc;return function(_0x1535e1){if(_0x1535e1){return _0x1a1702['sendStatus'](_0xa1451a);}return _0x1a1702[_0xcd0a('0x1f')](_0xa1451a)[_0xcd0a('0x20')]();};}function respondWithResult(_0x2e2fb5,_0x5ce101){_0x5ce101=_0x5ce101||0xc8;return function(_0x2b3168){if(_0x2b3168){return _0x2e2fb5['status'](_0x5ce101)['json'](_0x2b3168);}};}function respondWithFilteredResult(_0x5a5259,_0x543d31){return function(_0x24558d){if(_0x24558d){var _0x44ec5e=typeof _0x543d31[_0xcd0a('0x21')]==='undefined'&&typeof _0x543d31['limit']===_0xcd0a('0x22');var _0x324266=_0x24558d[_0xcd0a('0x23')];var _0x4be87a=_0x44ec5e?0x0:_0x543d31[_0xcd0a('0x21')];var _0x29c438=_0x44ec5e?_0x24558d[_0xcd0a('0x23')]:_0x543d31[_0xcd0a('0x21')]+_0x543d31[_0xcd0a('0x24')];var _0x6a0b2d;if(_0x29c438>=_0x324266){_0x29c438=_0x324266;_0x6a0b2d=0xc8;}else{_0x6a0b2d=0xce;}_0x5a5259[_0xcd0a('0x1f')](_0x6a0b2d);return _0x5a5259[_0xcd0a('0x25')](_0xcd0a('0x26'),_0x4be87a+'-'+_0x29c438+'/'+_0x324266)['json'](_0x24558d);}return null;};}function patchUpdates(_0x65f191){return function(_0x188b93){try{jsonpatch[_0xcd0a('0x27')](_0x188b93,_0x65f191,!![]);}catch(_0x1555b7){return BPromise[_0xcd0a('0x28')](_0x1555b7);}return _0x188b93[_0xcd0a('0x29')]();};}function saveUpdates(_0x1225a1,_0x50a2ca){return function(_0x4c1ce9){if(_0x4c1ce9){return _0x4c1ce9[_0xcd0a('0x2a')](_0x1225a1)[_0xcd0a('0x2b')](function(_0x21ae33){return _0x21ae33;});}return null;};}function removeEntity(_0x36a375,_0x20dbdb){return function(_0x32f500){if(_0x32f500){return _0x32f500['destroy']()[_0xcd0a('0x2b')](function(){var _0x30d577=_0x32f500[_0xcd0a('0x2c')]({'plain':!![]});var _0x38edeb=_0xcd0a('0x2d');return db['UserProfileResource'][_0xcd0a('0x2e')]({'where':{'type':_0x38edeb,'resourceId':_0x30d577['id']}})[_0xcd0a('0x2b')](function(){return _0x32f500;});})[_0xcd0a('0x2b')](function(){_0x36a375['status'](0xcc)[_0xcd0a('0x20')]();});}};}function handleEntityNotFound(_0xbdb1ce,_0x175578){return function(_0x30868c){if(!_0x30868c){_0xbdb1ce[_0xcd0a('0x2f')](0x194);}return _0x30868c;};}function handleError(_0x34b164,_0x3c4017){_0x3c4017=_0x3c4017||0x1f4;return function(_0x6d3e66){logger[_0xcd0a('0x30')](_0x6d3e66[_0xcd0a('0x31')]);if(_0x6d3e66[_0xcd0a('0x32')]){delete _0x6d3e66['name'];}_0x34b164[_0xcd0a('0x1f')](_0x3c4017)['send'](_0x6d3e66);};}exports[_0xcd0a('0x33')]=function(_0x1f885c,_0xf8b963){var _0x41b83c={},_0x6c0aa1={},_0x293bf6={'count':0x0,'rows':[]};var _0x471bbc=_['map'](db['Plugin'][_0xcd0a('0x34')],function(_0x49b744){return{'name':_0x49b744['fieldName'],'type':_0x49b744[_0xcd0a('0x35')][_0xcd0a('0x36')]};});_0x6c0aa1['model']=_[_0xcd0a('0x37')](_0x471bbc,_0xcd0a('0x32'));_0x6c0aa1[_0xcd0a('0x38')]=_['keys'](_0x1f885c['query']);_0x6c0aa1[_0xcd0a('0x39')]=_[_0xcd0a('0x3a')](_0x6c0aa1[_0xcd0a('0x3b')],_0x6c0aa1[_0xcd0a('0x38')]);_0x41b83c[_0xcd0a('0x3c')]=_['intersection'](_0x6c0aa1[_0xcd0a('0x3b')],qs[_0xcd0a('0x3d')](_0x1f885c[_0xcd0a('0x38')]['fields']));_0x41b83c[_0xcd0a('0x3c')]=_0x41b83c[_0xcd0a('0x3c')][_0xcd0a('0x3e')]?_0x41b83c[_0xcd0a('0x3c')]:_0x6c0aa1[_0xcd0a('0x3b')];if(!_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x3f')]('nolimit')){_0x41b83c[_0xcd0a('0x24')]=qs['limit'](_0x1f885c['query'][_0xcd0a('0x24')]);_0x41b83c[_0xcd0a('0x21')]=qs['offset'](_0x1f885c[_0xcd0a('0x38')]['offset']);}_0x41b83c['order']=qs[_0xcd0a('0x40')](_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x40')]);_0x41b83c[_0xcd0a('0x41')]=qs[_0xcd0a('0x39')](_['pick'](_0x1f885c[_0xcd0a('0x38')],_0x6c0aa1[_0xcd0a('0x39')]),_0x471bbc);if(_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x42')]){_0x41b83c[_0xcd0a('0x41')]=_['merge'](_0x41b83c[_0xcd0a('0x41')],{'$or':_[_0xcd0a('0x37')](_0x471bbc,function(_0x8bbca1){if(_0x8bbca1[_0xcd0a('0x35')]!==_0xcd0a('0x43')){var _0x32fa95={};_0x32fa95[_0x8bbca1[_0xcd0a('0x32')]]={'$like':'%'+_0x1f885c[_0xcd0a('0x38')][_0xcd0a('0x42')]+'%'};return _0x32fa95;}})});}_0x41b83c=_['merge']({},_0x41b83c,_0x1f885c[_0xcd0a('0x44')]);var _0x5301a6={'where':_0x41b83c[_0xcd0a('0x41')]};return db['Plugin'][_0xcd0a('0x23')](_0x5301a6)[_0xcd0a('0x2b')](function(_0x5df35d){_0x293bf6[_0xcd0a('0x23')]=_0x5df35d;if(_0x1f885c[_0xcd0a('0x38')]['includeAll']){_0x41b83c[_0xcd0a('0x45')]=[{'all':!![]}];}return db[_0xcd0a('0x46')][_0xcd0a('0x47')](_0x41b83c);})[_0xcd0a('0x2b')](function(_0x231eae){_0x293bf6[_0xcd0a('0x48')]=_0x231eae;return _0x293bf6;})[_0xcd0a('0x2b')](respondWithFilteredResult(_0xf8b963,_0x41b83c))[_0xcd0a('0x49')](handleError(_0xf8b963,null));};exports[_0xcd0a('0x4a')]=function(_0x3bc0a5,_0x49a65){var _0x98ead7={'raw':!![],'where':{'id':_0x3bc0a5[_0xcd0a('0x4b')]['id']}},_0x14a94f={};_0x14a94f[_0xcd0a('0x3b')]=_[_0xcd0a('0x4c')](db[_0xcd0a('0x46')][_0xcd0a('0x34')]);_0x14a94f[_0xcd0a('0x38')]=_[_0xcd0a('0x4c')](_0x3bc0a5[_0xcd0a('0x38')]);_0x14a94f['filters']=_['intersection'](_0x14a94f[_0xcd0a('0x3b')],_0x14a94f['query']);_0x98ead7[_0xcd0a('0x3c')]=_[_0xcd0a('0x3a')](_0x14a94f['model'],qs[_0xcd0a('0x3d')](_0x3bc0a5[_0xcd0a('0x38')]['fields']));_0x98ead7['attributes']=_0x98ead7['attributes'][_0xcd0a('0x3e')]?_0x98ead7[_0xcd0a('0x3c')]:_0x14a94f[_0xcd0a('0x3b')];if(_0x3bc0a5[_0xcd0a('0x38')][_0xcd0a('0x4d')]){_0x98ead7['include']=[{'all':!![]}];}_0x98ead7=_[_0xcd0a('0x4e')]({},_0x98ead7,_0x3bc0a5[_0xcd0a('0x44')]);return db[_0xcd0a('0x46')][_0xcd0a('0x4f')](_0x98ead7)[_0xcd0a('0x2b')](handleEntityNotFound(_0x49a65,null))[_0xcd0a('0x2b')](respondWithResult(_0x49a65,null))[_0xcd0a('0x49')](handleError(_0x49a65,null));};exports[_0xcd0a('0x50')]=function(_0x42ec2c,_0x515865,_0x2a4d81){return db['Plugin'][_0xcd0a('0x4f')]({'where':{'id':_0x42ec2c[_0xcd0a('0x4b')]['id']},'attributes':[_0xcd0a('0x32'),_0xcd0a('0x51')],'raw':!![]})[_0xcd0a('0x2b')](handleEntityNotFound(_0x515865,null))[_0xcd0a('0x2b')](function(_0x37c485){if(_0x37c485){var _0x4ed45f=path['join'](config[_0xcd0a('0x52')],_0xcd0a('0x53'),util[_0xcd0a('0x54')](_0xcd0a('0x55'),path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')])));var _0x34af84=fs[_0xcd0a('0x57')](_0x4ed45f);var _0x4caaa6=archiver('zip',{'zlib':{'level':0x9}});_0x4caaa6['on']('warning',function(_0x11e5f1){if(_0x11e5f1[_0xcd0a('0x58')]==='ENOENT'){logger[_0xcd0a('0x30')](_0x11e5f1);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4caaa6['on']('error',function(_0x4fba04){throw new db['Sequelize'][(_0xcd0a('0x59'))](_0xcd0a('0x5a'));});_0x4caaa6[_0xcd0a('0x5b')](_0x34af84);_0x4caaa6[_0xcd0a('0x5c')]('**/*',{'cwd':path['join'](config[_0xcd0a('0x52')],'server/files/plugins',path[_0xcd0a('0x5d')](_0x37c485[_0xcd0a('0x51')])),'ignore':[path[_0xcd0a('0x5e')](path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')]),_0xcd0a('0x5f')),path[_0xcd0a('0x5e')](path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')]),_0xcd0a('0x60'))],'nodir':!![]})[_0xcd0a('0x61')]();_0x34af84['on'](_0xcd0a('0x62'),function(){if(!fs[_0xcd0a('0x63')](_0x4ed45f)){throw new db['Sequelize']['Error'](_0xcd0a('0x64'));}return _0x515865[_0xcd0a('0x50')](_0x4ed45f,util[_0xcd0a('0x54')](_0xcd0a('0x55'),path[_0xcd0a('0x56')](_0x37c485[_0xcd0a('0x51')])),function(_0x2fc428){if(_0x2fc428){throw new db[(_0xcd0a('0x65'))][(_0xcd0a('0x59'))](_0xcd0a('0x66'));}fs['unlinkSync'](_0x4ed45f);logger[_0xcd0a('0x67')](_0xcd0a('0x68'));logger[_0xcd0a('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0xcd0a('0x49')](handleError(_0x515865,null));};exports[_0xcd0a('0x69')]=function(_0x4a2d99,_0x3425ba,_0x150674){var _0x5bb555=path[_0xcd0a('0x56')](_0x4a2d99[_0xcd0a('0x6a')][_0xcd0a('0x6b')],path['extname'](_0x4a2d99[_0xcd0a('0x6a')][_0xcd0a('0x6b')]));var _0x3e4d80=path[_0xcd0a('0x5e')](config[_0xcd0a('0x52')],_0xcd0a('0x53'),_0x4a2d99[_0xcd0a('0x6a')][_0xcd0a('0x6b')]);var _0x17f88a=path['join'](config[_0xcd0a('0x52')],'server/files/plugins',_0x5bb555);logger[_0xcd0a('0x67')](_0xcd0a('0x6c'),_0x3e4d80);logger[_0xcd0a('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x17f88a);try{fs['chmodSync'](_0x3e4d80,parseInt(_0xcd0a('0x6d'),0x8));extract(_0x3e4d80,{'dir':_0x17f88a},function(_0x2f8b9f){if(_0x2f8b9f){logger['error'](_0x2f8b9f);handleError(_0x2f8b9f,!![]);};var _0x3773b1=fs[_0xcd0a('0x6e')](_0x17f88a);if(_0x3773b1['length']>0x1){removeReferences(_0x3e4d80,_0x17f88a);logger[_0xcd0a('0x30')]('Invalid\x20plugin\x20structure');return _0x150674(new Error(_0xcd0a('0x6f')));}var _0xeaa054=fs[_0xcd0a('0x70')](path[_0xcd0a('0x5e')](_0x17f88a,_0x3773b1[0x0]));if(_0xeaa054['isFile']()){removeReferences(_0x3e4d80,_0x17f88a);logger[_0xcd0a('0x30')](_0xcd0a('0x6f'));return _0x150674(new Error('Invalid\x20plugin\x20structure'));}if(_0xeaa054['isDirectory']()){var _0x2d02d6=fs[_0xcd0a('0x6e')](path[_0xcd0a('0x5e')](_0x17f88a,_0x3773b1[0x0]));if(_0x2d02d6[_0xcd0a('0x3e')]===0x0){removeReferences(_0x3e4d80,_0x17f88a);logger[_0xcd0a('0x30')](_0xcd0a('0x6f'));return _0x150674(new Error(_0xcd0a('0x6f')));}var _0x20938e=_0x2d02d6['some'](function(_0x209a66){return _0x209a66===_0xcd0a('0x71');});if(!_0x20938e){return _0x150674(new Error('Plugin\x20manifest\x20missing'));}var _0x340c77=fs[_0xcd0a('0x72')](path[_0xcd0a('0x5e')](_0x17f88a,_0x3773b1[0x0],_0xcd0a('0x71')));var _0x503229=JSON['parse'](_0x340c77);if(_0xcd0a('0x22')==typeof _0x503229['name']){return _0x150674(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x35')]){return _0x150674(new Error(_0xcd0a('0x73')));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x74')]){return _0x150674(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')]){return _0x150674(new Error(_0xcd0a('0x76')));}if(_0x503229[_0xcd0a('0x35')]===_0xcd0a('0x77')){if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')]){return _0x150674(new Error(_0xcd0a('0x79')));}if(_0xcd0a('0x22')==typeof _0x503229['parameters'][_0xcd0a('0x78')]['admin']&&'undefined'==typeof _0x503229[_0xcd0a('0x75')]['views'][_0xcd0a('0x7a')]){return _0x150674(new Error(_0xcd0a('0x7b')));}}else if(_0x503229[_0xcd0a('0x35')]===_0xcd0a('0x7c')){if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x7d')]){return _0x150674(new Error(_0xcd0a('0x7e')));}if(_0xcd0a('0x22')==typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x7f')]){return _0x150674(new Error(_0xcd0a('0x80')));}}else{return _0x150674(new Error(_0xcd0a('0x81')));}var _0x538e94=_0x503229[_0xcd0a('0x32')];var _0x192f51=_0x503229[_0xcd0a('0x82')];var _0x36932c=_0x503229[_0xcd0a('0x35')];var _0x4c9ce9=_0x503229[_0xcd0a('0x83')]?_0x503229[_0xcd0a('0x83')]:'always';var _0x179651=_0x503229['icon']?_0x503229[_0xcd0a('0x84')]:_0xcd0a('0x85');var _0x406323='';var _0x213213='';var _0x5783c7='';var _0x9c26df='';var _0x40e61f=_0x503229[_0xcd0a('0x74')];if(_0x36932c==='html'){if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x86')]){var _0x1148c7=_0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0x1148c7)){_0x406323=path['join']('plugins',_0x5bb555,_0x3773b1[0x0],_0x1148c7);}else{_0x406323=_0x1148c7;}}else{logger[_0xcd0a('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')]['agent']){var _0xbc89b3=_0x503229[_0xcd0a('0x75')]['views'][_0xcd0a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0xbc89b3)){_0x213213=path[_0xcd0a('0x5e')](_0xcd0a('0x88'),_0x5bb555,_0x3773b1[0x0],_0xbc89b3);}else{_0x213213=_0xbc89b3;}}else{logger['info'](_0xcd0a('0x89'));}}else if(_0x36932c===_0xcd0a('0x7c')){_0x5783c7=_0x503229[_0xcd0a('0x75')][_0xcd0a('0x7d')];_0x9c26df=_0x503229['parameters'][_0xcd0a('0x7f')];if(_0xcd0a('0x22')!=typeof _0x503229['parameters'][_0xcd0a('0x78')]){if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x86')]){var _0x1148c7=_0x503229[_0xcd0a('0x75')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0x1148c7)){_0x406323=path[_0xcd0a('0x5e')]('plugins',_0x5bb555,_0x3773b1[0x0],_0x1148c7);}else{_0x406323=_0x1148c7;}}if(_0xcd0a('0x22')!=typeof _0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')][_0xcd0a('0x7a')]){var _0xbc89b3=_0x503229[_0xcd0a('0x75')][_0xcd0a('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xcd0a('0x87')](_0xbc89b3)){_0x213213=path[_0xcd0a('0x5e')](_0xcd0a('0x88'),_0x5bb555,_0x3773b1[0x0],_0xbc89b3);}else{_0x213213=_0xbc89b3;}}}}var _0x453baa={'name':_0x538e94,'description':_0x192f51,'path':path[_0xcd0a('0x5e')](_0x5bb555,_0x3773b1[0x0]),'type':_0x36932c,'sidebar':_0x4c9ce9,'icon':_0x179651,'adminUrl':_0x406323,'agentUrl':_0x213213,'scriptName':_0x5783c7,'scriptPath':_0x9c26df,'version':_0x40e61f};removeReferences(_0x3e4d80,null);return db[_0xcd0a('0x46')][_0xcd0a('0x8a')](_0x453baa)[_0xcd0a('0x2b')](function(_0x5e567f){var _0x2dac50={'role':_0x4a2d99[_0xcd0a('0x8b')][_0xcd0a('0x8c')],'userProfileId':_0x4a2d99[_0xcd0a('0x8b')]['userProfileId']};if(!_0x2dac50)throw new Error(_0xcd0a('0x8d'));if(_0x2dac50[_0xcd0a('0x8c')]==='user'){var _0x5a0ccf=_0x5e567f[_0xcd0a('0x2c')]({'plain':!![]});return db[_0xcd0a('0x8e')][_0xcd0a('0x4f')]({'where':{'name':_0xcd0a('0x2d'),'userProfileId':_0x2dac50[_0xcd0a('0x8f')]},'raw':!![]})[_0xcd0a('0x2b')](function(_0xe17256){if(_0xe17256&&_0xe17256[_0xcd0a('0x90')]===0x0){return db[_0xcd0a('0x91')][_0xcd0a('0x8a')]({'name':_0x5a0ccf['name'],'resourceId':_0x5a0ccf['id'],'type':_0xe17256[_0xcd0a('0x32')],'sectionId':_0xe17256['id']},{})['then'](function(){return _0x5e567f;});}else{return _0x5e567f;}})[_0xcd0a('0x49')](function(_0x41d508){logger['error'](_0xcd0a('0x92'),_0x41d508);throw _0x41d508;});}return _0x5e567f;})[_0xcd0a('0x2b')](respondWithResult(_0x3425ba,null))[_0xcd0a('0x49')](handleError(_0x3425ba,null));}});}catch(_0x255fa5){_0x3425ba[_0xcd0a('0x1f')](0x1f4)[_0xcd0a('0x93')](_0x255fa5);}};function removeReferences(_0xd4bf4a,_0x4ac61a){try{if(_0xd4bf4a){fs[_0xcd0a('0x94')](_0xd4bf4a);logger['info'](_0xcd0a('0x95'));}if(_0x4ac61a){rimraf(_0x4ac61a,function(){});logger[_0xcd0a('0x67')](_0xcd0a('0x96'));}}catch(_0x2dde78){logger[_0xcd0a('0x30')](_0x2dde78);}}exports['update']=function(_0x458f4a,_0x3f5396,_0x5a9fa7){return db['Plugin']['find']({'where':{'id':_0x458f4a['params']['id']}})['then'](handleEntityNotFound(_0x3f5396,null))[_0xcd0a('0x2b')](saveUpdates(_0x458f4a['body'],null))['then'](respondWithResult(_0x3f5396,null))['catch'](handleError(_0x3f5396,null));};exports['delete']=function(_0x552dbc,_0x51f1e2,_0x7a0ad2){return db[_0xcd0a('0x46')][_0xcd0a('0x4f')]({'where':{'id':_0x552dbc[_0xcd0a('0x4b')]['id']}})[_0xcd0a('0x2b')](function(_0x700456){if(_0x700456){return _0x700456[_0xcd0a('0x2e')]();}})['then'](function(_0x281645){rimraf(path['join'](config[_0xcd0a('0x52')],'server/files/plugins',path[_0xcd0a('0x5d')](_0x281645['path'])),function(){});return _0x281645;})[_0xcd0a('0x2b')](handleEntityNotFound(_0x51f1e2,null))['then'](respondWithStatusCode(_0x51f1e2,null))[_0xcd0a('0x49')](handleError(_0x51f1e2,null));};exports[_0xcd0a('0x97')]=function(_0x552262,_0x2f5d94,_0x1aeffe){return BPromise[_0xcd0a('0x98')]()[_0xcd0a('0x2b')](function(){if(!_0x552262[_0xcd0a('0x38')][_0xcd0a('0x51')]){throw new Error(_0xcd0a('0x99'));}if(!_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9a')]){throw new Error(_0xcd0a('0x9b'));}var _0x180b96=_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9c')]?_0x552262['query'][_0xcd0a('0x9c')]+':'+_0x552262[_0xcd0a('0x38')]['port']:_0xcd0a('0x9d')+_0x552262['query'][_0xcd0a('0x9a')];var _0x2f4d89=_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9e')]?_0x552262['query'][_0xcd0a('0x9e')]:!![];var _0x2984d6=_0x552262[_0xcd0a('0x38')]['encoding']?_0x552262[_0xcd0a('0x38')][_0xcd0a('0x9f')]:null;var _0x559e53={'method':_0x552262[_0xcd0a('0xa0')],'uri':util[_0xcd0a('0x54')](_0xcd0a('0xa1'),_0x180b96,_0x552262['query'][_0xcd0a('0x51')]),'json':_0x2f4d89,'resolveWithFullResponse':!![],'encoding':_0x2984d6,'qs':_0x552262[_0xcd0a('0x38')]};if(_0x552262[_0xcd0a('0xa2')]){_0x559e53[_0xcd0a('0xa2')]=_0x552262[_0xcd0a('0xa2')];if(_0x559e53[_0xcd0a('0xa2')][_0xcd0a('0xa3')]){delete _0x559e53[_0xcd0a('0xa2')][_0xcd0a('0xa3')];}}if(_0x559e53['headers'][_0xcd0a('0xa4')]){delete _0x559e53[_0xcd0a('0xa2')][_0xcd0a('0xa4')];}return rp(_0x559e53);})[_0xcd0a('0x2b')](function(_0x37d4ba){if(_0x37d4ba){_0x2f5d94['set'](_0x37d4ba[_0xcd0a('0xa2')]);logger['info'](_0x37d4ba[_0xcd0a('0x8b')]);if(_[_0xcd0a('0xa5')](_0x552262['query']['path'],_0xcd0a('0x50'))&&_0x37d4ba[_0xcd0a('0xa6')]==0x1f4){return _0x2f5d94[_0xcd0a('0x2f')](_0x37d4ba['statusCode']);}else{return _0x2f5d94[_0xcd0a('0x1f')](_0x37d4ba['statusCode'])['send'](_0x37d4ba[_0xcd0a('0x8b')]);}}else{return _0x2f5d94['sendStatus'](0xc8);}})[_0xcd0a('0x49')](handleError(_0x2f5d94,null));};exports[_0xcd0a('0xa7')]=function(_0xc1567d,_0x5b92dc,_0x5d4540){return BPromise[_0xcd0a('0x98')]()[_0xcd0a('0x2b')](function(){if(!_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x51')]){throw new Error(_0xcd0a('0x99'));}if(!_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9a')]){throw new Error(_0xcd0a('0x9b'));}var _0x2122ff=_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9c')]?_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9c')]+':'+_0xc1567d['query']['port']:'http://localhost:'+_0xc1567d['query']['port'];var _0x2369d2=_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9e')]?_0xc1567d['query']['json']:!![];var _0x5b8215=_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x9f')]?_0xc1567d[_0xcd0a('0x38')]['encoding']:null;var _0xdd7a84={'method':_0xc1567d['method'],'uri':util[_0xcd0a('0x54')](_0xcd0a('0xa1'),_0x2122ff,_0xc1567d[_0xcd0a('0x38')][_0xcd0a('0x51')]),'json':_0x2369d2,'resolveWithFullResponse':!![],'encoding':_0x5b8215,'body':_0xc1567d[_0xcd0a('0x8b')]};if(_0xc1567d[_0xcd0a('0xa2')]){_0xdd7a84[_0xcd0a('0xa2')]=_0xc1567d[_0xcd0a('0xa2')];if(_0xdd7a84['headers'][_0xcd0a('0xa3')]){delete _0xdd7a84[_0xcd0a('0xa2')][_0xcd0a('0xa3')];}}if(_0xdd7a84[_0xcd0a('0xa2')][_0xcd0a('0xa4')]){delete _0xdd7a84['headers'][_0xcd0a('0xa4')];}return rp(_0xdd7a84);})[_0xcd0a('0x2b')](function(_0xc5be07){if(_0xc5be07){_0x5b92dc['set'](_0xc5be07[_0xcd0a('0xa2')]);logger[_0xcd0a('0x67')](_0xc5be07[_0xcd0a('0x8b')]);return _0x5b92dc[_0xcd0a('0x1f')](_0xc5be07[_0xcd0a('0xa6')])[_0xcd0a('0x93')](_0xc5be07[_0xcd0a('0x8b')]);}else{return _0x5b92dc[_0xcd0a('0x2f')](0xc8);}})[_0xcd0a('0x49')](handleError(_0x5b92dc,null));}; \ No newline at end of file +var _0x2899=['options','includeAll','include','show','params','find','catch','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','info','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','content-type','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','sendStatus','stack','name','send','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','map','VIRTUAL','merge'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x2899,0x107));var _0x9289=function(_0x4723d3,_0x429390){_0x4723d3=_0x4723d3-0x0;var _0x1a41da=_0x2899[_0x4723d3];return _0x1a41da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9289('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9289('0x1'));var rp=require('request-promise');var moment=require(_0x9289('0x2'));var BPromise=require(_0x9289('0x3'));var Mustache=require(_0x9289('0x4'));var util=require(_0x9289('0x5'));var path=require(_0x9289('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9289('0x7'));var fs=require('fs');var fs_extra=require(_0x9289('0x8'));var _=require(_0x9289('0x9'));var squel=require(_0x9289('0xa'));var crypto=require(_0x9289('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9289('0xc'));var Papa=require(_0x9289('0xd'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x9289('0xe'));var authService=require(_0x9289('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9289('0x10'));var logger=require('../../config/logger')(_0x9289('0x11'));var utils=require(_0x9289('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9289('0x13'));var db=require(_0x9289('0x14'))['db'];config['redis']=_[_0x9289('0x15')](config[_0x9289('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9289('0x17'))(new Redis(config['redis']));require('./plugin.socket')[_0x9289('0x18')](socket);function respondWithStatusCode(_0x42a903,_0x9de36e){_0x9de36e=_0x9de36e||0xcc;return function(_0x5a6fb2){if(_0x5a6fb2){return _0x42a903['sendStatus'](_0x9de36e);}return _0x42a903[_0x9289('0x19')](_0x9de36e)[_0x9289('0x1a')]();};}function respondWithResult(_0x1dbf29,_0x591ca3){_0x591ca3=_0x591ca3||0xc8;return function(_0x32ed54){if(_0x32ed54){return _0x1dbf29['status'](_0x591ca3)['json'](_0x32ed54);}};}function respondWithFilteredResult(_0x24a026,_0x296991){return function(_0x3a256a){if(_0x3a256a){var _0x2a1f85=typeof _0x296991[_0x9289('0x1b')]===_0x9289('0x1c')&&typeof _0x296991['limit']===_0x9289('0x1c');var _0x178ecf=_0x3a256a[_0x9289('0x1d')];var _0x23eb7d=_0x2a1f85?0x0:_0x296991[_0x9289('0x1b')];var _0x57c88c=_0x2a1f85?_0x3a256a[_0x9289('0x1d')]:_0x296991['offset']+_0x296991[_0x9289('0x1e')];var _0x4bb47d;if(_0x57c88c>=_0x178ecf){_0x57c88c=_0x178ecf;_0x4bb47d=0xc8;}else{_0x4bb47d=0xce;}_0x24a026['status'](_0x4bb47d);return _0x24a026[_0x9289('0x1f')](_0x9289('0x20'),_0x23eb7d+'-'+_0x57c88c+'/'+_0x178ecf)['json'](_0x3a256a);}return null;};}function patchUpdates(_0x485be7){return function(_0x3c2fc4){try{jsonpatch[_0x9289('0x21')](_0x3c2fc4,_0x485be7,!![]);}catch(_0x2ddaf0){return BPromise[_0x9289('0x22')](_0x2ddaf0);}return _0x3c2fc4[_0x9289('0x23')]();};}function saveUpdates(_0x5689d8,_0x55e746){return function(_0x2f7d90){if(_0x2f7d90){return _0x2f7d90[_0x9289('0x24')](_0x5689d8)['then'](function(_0x3f2822){return _0x3f2822;});}return null;};}function removeEntity(_0x13d808,_0x4fa7f8){return function(_0x441380){if(_0x441380){return _0x441380[_0x9289('0x25')]()[_0x9289('0x26')](function(){var _0x458f91=_0x441380[_0x9289('0x27')]({'plain':!![]});var _0x1f3ed5=_0x9289('0x28');return db[_0x9289('0x29')][_0x9289('0x25')]({'where':{'type':_0x1f3ed5,'resourceId':_0x458f91['id']}})['then'](function(){return _0x441380;});})['then'](function(){_0x13d808['status'](0xcc)[_0x9289('0x1a')]();});}};}function handleEntityNotFound(_0x4392eb,_0x76bb1f){return function(_0x399ddf){if(!_0x399ddf){_0x4392eb[_0x9289('0x2a')](0x194);}return _0x399ddf;};}function handleError(_0x1c49aa,_0x2765fb){_0x2765fb=_0x2765fb||0x1f4;return function(_0x17ae7c){logger['error'](_0x17ae7c[_0x9289('0x2b')]);if(_0x17ae7c[_0x9289('0x2c')]){delete _0x17ae7c[_0x9289('0x2c')];}_0x1c49aa[_0x9289('0x19')](_0x2765fb)[_0x9289('0x2d')](_0x17ae7c);};}exports['index']=function(_0x54fac4,_0x157e85){var _0x21b6c7={},_0x29241a={},_0x4f2e89={'count':0x0,'rows':[]};var _0x286191=_['map'](db[_0x9289('0x2e')][_0x9289('0x2f')],function(_0x177b77){return{'name':_0x177b77[_0x9289('0x30')],'type':_0x177b77[_0x9289('0x31')][_0x9289('0x32')]};});_0x29241a[_0x9289('0x33')]=_['map'](_0x286191,_0x9289('0x2c'));_0x29241a[_0x9289('0x34')]=_[_0x9289('0x35')](_0x54fac4['query']);_0x29241a[_0x9289('0x36')]=_[_0x9289('0x37')](_0x29241a['model'],_0x29241a[_0x9289('0x34')]);_0x21b6c7[_0x9289('0x38')]=_[_0x9289('0x37')](_0x29241a[_0x9289('0x33')],qs[_0x9289('0x39')](_0x54fac4[_0x9289('0x34')]['fields']));_0x21b6c7['attributes']=_0x21b6c7[_0x9289('0x38')][_0x9289('0x3a')]?_0x21b6c7[_0x9289('0x38')]:_0x29241a[_0x9289('0x33')];if(!_0x54fac4['query']['hasOwnProperty']('nolimit')){_0x21b6c7[_0x9289('0x1e')]=qs[_0x9289('0x1e')](_0x54fac4[_0x9289('0x34')][_0x9289('0x1e')]);_0x21b6c7[_0x9289('0x1b')]=qs['offset'](_0x54fac4[_0x9289('0x34')][_0x9289('0x1b')]);}_0x21b6c7[_0x9289('0x3b')]=qs[_0x9289('0x3c')](_0x54fac4[_0x9289('0x34')]['sort']);_0x21b6c7[_0x9289('0x3d')]=qs[_0x9289('0x36')](_[_0x9289('0x3e')](_0x54fac4[_0x9289('0x34')],_0x29241a[_0x9289('0x36')]),_0x286191);if(_0x54fac4[_0x9289('0x34')][_0x9289('0x3f')]){_0x21b6c7[_0x9289('0x3d')]=_['merge'](_0x21b6c7['where'],{'$or':_[_0x9289('0x40')](_0x286191,function(_0x13ff1f){if(_0x13ff1f[_0x9289('0x31')]!==_0x9289('0x41')){var _0x531b42={};_0x531b42[_0x13ff1f[_0x9289('0x2c')]]={'$like':'%'+_0x54fac4['query'][_0x9289('0x3f')]+'%'};return _0x531b42;}})});}_0x21b6c7=_[_0x9289('0x42')]({},_0x21b6c7,_0x54fac4[_0x9289('0x43')]);var _0x3d5d35={'where':_0x21b6c7[_0x9289('0x3d')]};return db[_0x9289('0x2e')]['count'](_0x3d5d35)[_0x9289('0x26')](function(_0x219104){_0x4f2e89[_0x9289('0x1d')]=_0x219104;if(_0x54fac4[_0x9289('0x34')][_0x9289('0x44')]){_0x21b6c7[_0x9289('0x45')]=[{'all':!![]}];}return db[_0x9289('0x2e')]['findAll'](_0x21b6c7);})[_0x9289('0x26')](function(_0x73fa58){_0x4f2e89['rows']=_0x73fa58;return _0x4f2e89;})['then'](respondWithFilteredResult(_0x157e85,_0x21b6c7))['catch'](handleError(_0x157e85,null));};exports[_0x9289('0x46')]=function(_0x91ce36,_0x3e2eaf){var _0x30a43b={'raw':!![],'where':{'id':_0x91ce36[_0x9289('0x47')]['id']}},_0x420884={};_0x420884[_0x9289('0x33')]=_[_0x9289('0x35')](db[_0x9289('0x2e')][_0x9289('0x2f')]);_0x420884[_0x9289('0x34')]=_[_0x9289('0x35')](_0x91ce36['query']);_0x420884['filters']=_[_0x9289('0x37')](_0x420884[_0x9289('0x33')],_0x420884[_0x9289('0x34')]);_0x30a43b[_0x9289('0x38')]=_[_0x9289('0x37')](_0x420884[_0x9289('0x33')],qs[_0x9289('0x39')](_0x91ce36['query'][_0x9289('0x39')]));_0x30a43b[_0x9289('0x38')]=_0x30a43b[_0x9289('0x38')][_0x9289('0x3a')]?_0x30a43b[_0x9289('0x38')]:_0x420884['model'];if(_0x91ce36[_0x9289('0x34')][_0x9289('0x44')]){_0x30a43b[_0x9289('0x45')]=[{'all':!![]}];}_0x30a43b=_[_0x9289('0x42')]({},_0x30a43b,_0x91ce36['options']);return db[_0x9289('0x2e')][_0x9289('0x48')](_0x30a43b)[_0x9289('0x26')](handleEntityNotFound(_0x3e2eaf,null))[_0x9289('0x26')](respondWithResult(_0x3e2eaf,null))[_0x9289('0x49')](handleError(_0x3e2eaf,null));};exports[_0x9289('0x4a')]=function(_0x3dfa4c,_0x459f93,_0x13ebfd){return db[_0x9289('0x2e')][_0x9289('0x48')]({'where':{'id':_0x3dfa4c[_0x9289('0x47')]['id']},'attributes':['name',_0x9289('0x6')],'raw':!![]})[_0x9289('0x26')](handleEntityNotFound(_0x459f93,null))[_0x9289('0x26')](function(_0x234c32){if(_0x234c32){var _0x3bd1ae=path[_0x9289('0x4b')](config[_0x9289('0x4c')],_0x9289('0x4d'),util[_0x9289('0x4e')](_0x9289('0x4f'),path[_0x9289('0x50')](_0x234c32[_0x9289('0x6')])));var _0xf94fa6=fs[_0x9289('0x51')](_0x3bd1ae);var _0x5ba0be=archiver(_0x9289('0x52'),{'zlib':{'level':0x9}});_0x5ba0be['on']('warning',function(_0x21f90e){if(_0x21f90e['code']===_0x9289('0x53')){logger[_0x9289('0x54')](_0x21f90e);}else{throw new db[(_0x9289('0x55'))][(_0x9289('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x5ba0be['on'](_0x9289('0x54'),function(_0x1d57e9){throw new db[(_0x9289('0x55'))][(_0x9289('0x56'))](_0x9289('0x57'));});_0x5ba0be['pipe'](_0xf94fa6);_0x5ba0be[_0x9289('0x58')](_0x9289('0x59'),{'cwd':path[_0x9289('0x4b')](config['root'],_0x9289('0x4d'),path[_0x9289('0x5a')](_0x234c32[_0x9289('0x6')])),'ignore':[path[_0x9289('0x4b')](path[_0x9289('0x50')](_0x234c32['path']),_0x9289('0x5b')),path[_0x9289('0x4b')](path[_0x9289('0x50')](_0x234c32[_0x9289('0x6')]),'attachments/**/*')],'nodir':!![]})[_0x9289('0x5c')]();_0xf94fa6['on'](_0x9289('0x5d'),function(){if(!fs['existsSync'](_0x3bd1ae)){throw new db['Sequelize'][(_0x9289('0x56'))](_0x9289('0x5e'));}return _0x459f93[_0x9289('0x4a')](_0x3bd1ae,util[_0x9289('0x4e')](_0x9289('0x4f'),path[_0x9289('0x50')](_0x234c32['path'])),function(_0x37b572){if(_0x37b572){throw new db[(_0x9289('0x55'))][(_0x9289('0x56'))](_0x9289('0x5f'));}fs[_0x9289('0x60')](_0x3bd1ae);logger['info'](_0x9289('0x61'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x9289('0x49')](handleError(_0x459f93,null));};exports[_0x9289('0x62')]=function(_0x374cf8,_0x4fe785,_0x422d4b){var _0x18296f=path[_0x9289('0x50')](_0x374cf8[_0x9289('0x63')]['filename'],path[_0x9289('0x64')](_0x374cf8['file'][_0x9289('0x65')]));var _0x183d36=path[_0x9289('0x4b')](config[_0x9289('0x4c')],'server/files/plugins',_0x374cf8[_0x9289('0x63')][_0x9289('0x65')]);var _0x178464=path[_0x9289('0x4b')](config[_0x9289('0x4c')],_0x9289('0x4d'),_0x18296f);logger['info'](_0x9289('0x66'),_0x183d36);logger[_0x9289('0x67')](_0x9289('0x68'),_0x178464);try{fs[_0x9289('0x69')](_0x183d36,parseInt(_0x9289('0x6a'),0x8));extract(_0x183d36,{'dir':_0x178464},function(_0x3f84a6){if(_0x3f84a6){logger[_0x9289('0x54')](_0x3f84a6);handleError(_0x3f84a6,!![]);};var _0x295ef9=fs[_0x9289('0x6b')](_0x178464);if(_0x295ef9[_0x9289('0x3a')]>0x1){removeReferences(_0x183d36,_0x178464);logger[_0x9289('0x54')](_0x9289('0x6c'));return _0x422d4b(new Error(_0x9289('0x6c')));}var _0x3d05bb=fs[_0x9289('0x6d')](path[_0x9289('0x4b')](_0x178464,_0x295ef9[0x0]));if(_0x3d05bb['isFile']()){removeReferences(_0x183d36,_0x178464);logger[_0x9289('0x54')](_0x9289('0x6c'));return _0x422d4b(new Error(_0x9289('0x6c')));}if(_0x3d05bb[_0x9289('0x6e')]()){var _0x5c03fb=fs[_0x9289('0x6b')](path[_0x9289('0x4b')](_0x178464,_0x295ef9[0x0]));if(_0x5c03fb[_0x9289('0x3a')]===0x0){removeReferences(_0x183d36,_0x178464);logger['error']('Invalid\x20plugin\x20structure');return _0x422d4b(new Error(_0x9289('0x6c')));}var _0x39367d=_0x5c03fb['some'](function(_0x1af746){return _0x1af746===_0x9289('0x6f');});if(!_0x39367d){return _0x422d4b(new Error(_0x9289('0x70')));}var _0x3ba452=fs[_0x9289('0x71')](path['join'](_0x178464,_0x295ef9[0x0],_0x9289('0x6f')));var _0x48af6d=JSON[_0x9289('0x72')](_0x3ba452);if(_0x9289('0x1c')==typeof _0x48af6d['name']){return _0x422d4b(new Error(_0x9289('0x73')));}if(_0x9289('0x1c')==typeof _0x48af6d[_0x9289('0x31')]){return _0x422d4b(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x9289('0x1c')==typeof _0x48af6d[_0x9289('0x74')]){return _0x422d4b(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x9289('0x1c')==typeof _0x48af6d[_0x9289('0x75')]){return _0x422d4b(new Error(_0x9289('0x76')));}if(_0x48af6d[_0x9289('0x31')]===_0x9289('0x77')){if(_0x9289('0x1c')==typeof _0x48af6d[_0x9289('0x75')]['views']){return _0x422d4b(new Error(_0x9289('0x78')));}if(_0x9289('0x1c')==typeof _0x48af6d[_0x9289('0x75')]['views']['admin']&&'undefined'==typeof _0x48af6d[_0x9289('0x75')][_0x9289('0x79')][_0x9289('0x7a')]){return _0x422d4b(new Error(_0x9289('0x7b')));}}else if(_0x48af6d[_0x9289('0x31')]===_0x9289('0x7c')){if('undefined'==typeof _0x48af6d[_0x9289('0x75')]['scriptName']){return _0x422d4b(new Error(_0x9289('0x7d')));}if(_0x9289('0x1c')==typeof _0x48af6d[_0x9289('0x75')][_0x9289('0x7e')]){return _0x422d4b(new Error(_0x9289('0x7f')));}}else{return _0x422d4b(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x30b72e=_0x48af6d[_0x9289('0x2c')];var _0x5142dc=_0x48af6d['description'];var _0x3a7078=_0x48af6d['type'];var _0x1b5fac=_0x48af6d[_0x9289('0x80')]?_0x48af6d[_0x9289('0x80')]:_0x9289('0x81');var _0x2518d3=_0x48af6d[_0x9289('0x82')]?_0x48af6d['icon']:_0x9289('0x83');var _0x1129bf='';var _0x344d30='';var _0xde29a8='';var _0x28c03d='';var _0xc79679=_0x48af6d[_0x9289('0x74')];if(_0x3a7078===_0x9289('0x77')){if(_0x9289('0x1c')!=typeof _0x48af6d[_0x9289('0x75')]['views']['admin']){var _0x1201f3=_0x48af6d['parameters'][_0x9289('0x79')][_0x9289('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x9289('0x85')](_0x1201f3)){_0x1129bf=path[_0x9289('0x4b')](_0x9289('0x86'),_0x18296f,_0x295ef9[0x0],_0x1201f3);}else{_0x1129bf=_0x1201f3;}}else{logger['info'](_0x9289('0x87'));}if(_0x9289('0x1c')!=typeof _0x48af6d[_0x9289('0x75')][_0x9289('0x79')]['agent']){var _0x5cedf7=_0x48af6d[_0x9289('0x75')][_0x9289('0x79')][_0x9289('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x9289('0x85')](_0x5cedf7)){_0x344d30=path[_0x9289('0x4b')](_0x9289('0x86'),_0x18296f,_0x295ef9[0x0],_0x5cedf7);}else{_0x344d30=_0x5cedf7;}}else{logger['info'](_0x9289('0x88'));}}else if(_0x3a7078===_0x9289('0x7c')){_0xde29a8=_0x48af6d[_0x9289('0x75')][_0x9289('0x89')];_0x28c03d=_0x48af6d['parameters'][_0x9289('0x7e')];if('undefined'!=typeof _0x48af6d[_0x9289('0x75')][_0x9289('0x79')]){if('undefined'!=typeof _0x48af6d[_0x9289('0x75')][_0x9289('0x79')]['admin']){var _0x1201f3=_0x48af6d['parameters'][_0x9289('0x79')][_0x9289('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x9289('0x85')](_0x1201f3)){_0x1129bf=path['join'](_0x9289('0x86'),_0x18296f,_0x295ef9[0x0],_0x1201f3);}else{_0x1129bf=_0x1201f3;}}if(_0x9289('0x1c')!=typeof _0x48af6d[_0x9289('0x75')][_0x9289('0x79')][_0x9289('0x7a')]){var _0x5cedf7=_0x48af6d[_0x9289('0x75')][_0x9289('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9289('0x85')](_0x5cedf7)){_0x344d30=path[_0x9289('0x4b')](_0x9289('0x86'),_0x18296f,_0x295ef9[0x0],_0x5cedf7);}else{_0x344d30=_0x5cedf7;}}}}var _0x155518={'name':_0x30b72e,'description':_0x5142dc,'path':path[_0x9289('0x4b')](_0x18296f,_0x295ef9[0x0]),'type':_0x3a7078,'sidebar':_0x1b5fac,'icon':_0x2518d3,'adminUrl':_0x1129bf,'agentUrl':_0x344d30,'scriptName':_0xde29a8,'scriptPath':_0x28c03d,'version':_0xc79679};removeReferences(_0x183d36,null);return db[_0x9289('0x2e')][_0x9289('0x8a')](_0x155518)['then'](function(_0x133635){var _0x2a7618={'role':_0x374cf8[_0x9289('0x8b')][_0x9289('0x8c')],'userProfileId':_0x374cf8[_0x9289('0x8b')][_0x9289('0x8d')]};if(!_0x2a7618)throw new Error(_0x9289('0x8e'));if(_0x2a7618[_0x9289('0x8c')]===_0x9289('0x8f')){var _0x43ed29=_0x133635[_0x9289('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x9289('0x28'),'userProfileId':_0x2a7618['userProfileId']},'raw':!![]})[_0x9289('0x26')](function(_0x2a6ce7){if(_0x2a6ce7&&_0x2a6ce7['autoAssociation']===0x0){return db[_0x9289('0x29')][_0x9289('0x8a')]({'name':_0x43ed29['name'],'resourceId':_0x43ed29['id'],'type':_0x2a6ce7[_0x9289('0x2c')],'sectionId':_0x2a6ce7['id']},{})[_0x9289('0x26')](function(){return _0x133635;});}else{return _0x133635;}})[_0x9289('0x49')](function(_0x11b92f){logger['error'](_0x9289('0x90'),_0x11b92f);throw _0x11b92f;});}return _0x133635;})[_0x9289('0x26')](respondWithResult(_0x4fe785,null))[_0x9289('0x49')](handleError(_0x4fe785,null));}});}catch(_0x392cf9){_0x4fe785[_0x9289('0x19')](0x1f4)['send'](_0x392cf9);}};function removeReferences(_0x313bd3,_0x5958d6){try{if(_0x313bd3){fs['unlinkSync'](_0x313bd3);logger[_0x9289('0x67')](_0x9289('0x91'));}if(_0x5958d6){rimraf(_0x5958d6,function(){});logger[_0x9289('0x67')](_0x9289('0x92'));}}catch(_0x55236b){logger[_0x9289('0x54')](_0x55236b);}}exports[_0x9289('0x24')]=function(_0x1fc9a3,_0x28d1b8,_0x45f0a6){return db[_0x9289('0x2e')][_0x9289('0x48')]({'where':{'id':_0x1fc9a3[_0x9289('0x47')]['id']}})['then'](handleEntityNotFound(_0x28d1b8,null))['then'](saveUpdates(_0x1fc9a3[_0x9289('0x8b')],null))[_0x9289('0x26')](respondWithResult(_0x28d1b8,null))['catch'](handleError(_0x28d1b8,null));};exports[_0x9289('0x93')]=function(_0x3bedca,_0x54a8e3,_0x586278){return db[_0x9289('0x2e')]['find']({'where':{'id':_0x3bedca[_0x9289('0x47')]['id']}})[_0x9289('0x26')](function(_0x46e0d7){if(_0x46e0d7){return _0x46e0d7[_0x9289('0x25')]();}})[_0x9289('0x26')](function(_0x1e73eb){rimraf(path[_0x9289('0x4b')](config[_0x9289('0x4c')],_0x9289('0x4d'),path[_0x9289('0x5a')](_0x1e73eb[_0x9289('0x6')])),function(){});return _0x1e73eb;})[_0x9289('0x26')](handleEntityNotFound(_0x54a8e3,null))[_0x9289('0x26')](respondWithStatusCode(_0x54a8e3,null))[_0x9289('0x49')](handleError(_0x54a8e3,null));};exports[_0x9289('0x94')]=function(_0x5ca6fa,_0x32a138,_0x9a66e3){return BPromise[_0x9289('0x95')]()[_0x9289('0x26')](function(){if(!_0x5ca6fa['query'][_0x9289('0x6')]){throw new Error(_0x9289('0x96'));}if(!_0x5ca6fa[_0x9289('0x34')][_0x9289('0x97')]){throw new Error(_0x9289('0x98'));}var _0x542844=_0x5ca6fa[_0x9289('0x34')][_0x9289('0x99')]?_0x5ca6fa[_0x9289('0x34')][_0x9289('0x99')]+':'+_0x5ca6fa[_0x9289('0x34')][_0x9289('0x97')]:_0x9289('0x9a')+_0x5ca6fa['query'][_0x9289('0x97')];var _0x1c4ef8=_0x5ca6fa['query']['json']?_0x5ca6fa[_0x9289('0x34')][_0x9289('0x9b')]:!![];var _0x5bf019=_0x5ca6fa[_0x9289('0x34')]['encoding']?_0x5ca6fa['query'][_0x9289('0x9c')]:null;var _0x3f4fc9={'method':_0x5ca6fa[_0x9289('0x9d')],'uri':util['format'](_0x9289('0x9e'),_0x542844,_0x5ca6fa[_0x9289('0x34')][_0x9289('0x6')]),'json':_0x1c4ef8,'resolveWithFullResponse':!![],'encoding':_0x5bf019,'qs':_0x5ca6fa[_0x9289('0x34')]};if(_0x5ca6fa['headers']){_0x3f4fc9[_0x9289('0x9f')]=_0x5ca6fa[_0x9289('0x9f')];if(_0x3f4fc9[_0x9289('0x9f')][_0x9289('0xa0')]){delete _0x3f4fc9[_0x9289('0x9f')]['content-length'];}}if(_0x3f4fc9[_0x9289('0x9f')]['content-type']){delete _0x3f4fc9[_0x9289('0x9f')]['content-type'];}return rp(_0x3f4fc9);})['then'](function(_0x3a05fc){if(_0x3a05fc){_0x32a138[_0x9289('0x1f')](_0x3a05fc[_0x9289('0x9f')]);logger['info'](_0x3a05fc[_0x9289('0x8b')]);if(_[_0x9289('0xa1')](_0x5ca6fa[_0x9289('0x34')][_0x9289('0x6')],_0x9289('0x4a'))&&_0x3a05fc[_0x9289('0xa2')]==0x1f4){return _0x32a138[_0x9289('0x2a')](_0x3a05fc[_0x9289('0xa2')]);}else{return _0x32a138[_0x9289('0x19')](_0x3a05fc[_0x9289('0xa2')])[_0x9289('0x2d')](_0x3a05fc['body']);}}else{return _0x32a138[_0x9289('0x2a')](0xc8);}})[_0x9289('0x49')](handleError(_0x32a138,null));};exports[_0x9289('0xa3')]=function(_0x3e9df9,_0x39c9ea,_0x4d550c){return BPromise[_0x9289('0x95')]()[_0x9289('0x26')](function(){if(!_0x3e9df9[_0x9289('0x34')][_0x9289('0x6')]){throw new Error(_0x9289('0x96'));}if(!_0x3e9df9[_0x9289('0x34')]['port']){throw new Error(_0x9289('0x98'));}var _0x3b0f60=_0x3e9df9[_0x9289('0x34')][_0x9289('0x99')]?_0x3e9df9['query'][_0x9289('0x99')]+':'+_0x3e9df9[_0x9289('0x34')][_0x9289('0x97')]:_0x9289('0x9a')+_0x3e9df9[_0x9289('0x34')][_0x9289('0x97')];var _0x2bb8ee=_0x3e9df9[_0x9289('0x34')][_0x9289('0x9b')]?_0x3e9df9[_0x9289('0x34')][_0x9289('0x9b')]:!![];var _0x17813b=_0x3e9df9[_0x9289('0x34')][_0x9289('0x9c')]?_0x3e9df9[_0x9289('0x34')][_0x9289('0x9c')]:null;var _0x241175={'method':_0x3e9df9[_0x9289('0x9d')],'uri':util['format']('%s%s',_0x3b0f60,_0x3e9df9[_0x9289('0x34')]['path']),'json':_0x2bb8ee,'resolveWithFullResponse':!![],'encoding':_0x17813b,'body':_0x3e9df9[_0x9289('0x8b')]};if(_0x3e9df9['headers']){_0x241175[_0x9289('0x9f')]=_0x3e9df9[_0x9289('0x9f')];if(_0x241175[_0x9289('0x9f')][_0x9289('0xa0')]){delete _0x241175[_0x9289('0x9f')][_0x9289('0xa0')];}}if(_0x241175[_0x9289('0x9f')]['content-type']){delete _0x241175['headers'][_0x9289('0xa4')];}return rp(_0x241175);})[_0x9289('0x26')](function(_0xc2aec3){if(_0xc2aec3){_0x39c9ea[_0x9289('0x1f')](_0xc2aec3['headers']);logger['info'](_0xc2aec3[_0x9289('0x8b')]);return _0x39c9ea['status'](_0xc2aec3['statusCode'])[_0x9289('0x2d')](_0xc2aec3[_0x9289('0x8b')]);}else{return _0x39c9ea[_0x9289('0x2a')](0xc8);}})[_0x9289('0x49')](handleError(_0x39c9ea,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 23b5410..56953c2 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 _0x3837=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x3837,0x1d1));var _0x7383=function(_0x18fecc,_0x12ac76){_0x18fecc=_0x18fecc-0x0;var _0x4d066e=_0x3837[_0x18fecc];return _0x4d066e;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x7383('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x7383('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7383('0x2'),'afterDestroy':_0x7383('0x3')};function emitEvent(_0x49878d){return function(_0x227ab2,_0xf57468,_0x53485d){PluginEvents['emit'](_0x49878d+':'+_0x227ab2['id'],_0x227ab2);PluginEvents[_0x7383('0x4')](_0x49878d,_0x227ab2);_0x53485d(null);};}for(var e in events){if(events[_0x7383('0x5')](e)){var event=events[e];Plugin[_0x7383('0x6')](e,emitEvent(event));}}module[_0x7383('0x7')]=PluginEvents; \ No newline at end of file +var _0x0324=['../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0xc5c1ac,_0xfe1ed2){var _0x5bc58c=function(_0x52b2b9){while(--_0x52b2b9){_0xc5c1ac['push'](_0xc5c1ac['shift']());}};_0x5bc58c(++_0xfe1ed2);}(_0x0324,0x90));var _0x4032=function(_0x1608d7,_0x44bcbe){_0x1608d7=_0x1608d7-0x0;var _0x2cfd80=_0x0324[_0x1608d7];return _0x2cfd80;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x4032('0x0'))['db'][_0x4032('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x4032('0x2')](0x0);var events={'afterCreate':_0x4032('0x3'),'afterUpdate':_0x4032('0x4'),'afterDestroy':_0x4032('0x5')};function emitEvent(_0x4fbc08){return function(_0x17e87f,_0x23bfd7,_0x297bc9){PluginEvents[_0x4032('0x6')](_0x4fbc08+':'+_0x17e87f['id'],_0x17e87f);PluginEvents[_0x4032('0x6')](_0x4fbc08,_0x17e87f);_0x297bc9(null);};}for(var e in events){if(events[_0x4032('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x4032('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 887f46f..977879c 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 _0x7eed=['moment','request-promise','path','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','util','../../config/logger','api'];(function(_0x356132,_0x32a258){var _0x52e5d4=function(_0x126fe9){while(--_0x126fe9){_0x356132['push'](_0x356132['shift']());}};_0x52e5d4(++_0x32a258);}(_0x7eed,0xcc));var _0xd7ee=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x7eed[_0x1f83a5];return _0x45edf0;};'use strict';var _=require(_0xd7ee('0x0'));var util=require(_0xd7ee('0x1'));var logger=require(_0xd7ee('0x2'))(_0xd7ee('0x3'));var moment=require(_0xd7ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xd7ee('0x5'));var fs=require('fs');var path=require(_0xd7ee('0x6'));var rimraf=require(_0xd7ee('0x7'));var config=require(_0xd7ee('0x8'));var attributes=require('./plugin.attributes');module[_0xd7ee('0x9')]=function(_0x347d92,_0x3e286f){return _0x347d92[_0xd7ee('0xa')](_0xd7ee('0xb'),attributes,{'tableName':_0xd7ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2cb=['path','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x261ebb,_0x52f159){var _0x5397fc=function(_0x5b86c4){while(--_0x5b86c4){_0x261ebb['push'](_0x261ebb['shift']());}};_0x5397fc(++_0x52f159);}(_0xb2cb,0x8a));var _0xbb2c=function(_0xf34895,_0x21fb70){_0xf34895=_0xf34895-0x0;var _0x143f44=_0xb2cb[_0xf34895];return _0x143f44;};'use strict';var _=require(_0xbb2c('0x0'));var util=require(_0xbb2c('0x1'));var logger=require(_0xbb2c('0x2'))(_0xbb2c('0x3'));var moment=require('moment');var BPromise=require(_0xbb2c('0x4'));var rp=require(_0xbb2c('0x5'));var fs=require('fs');var path=require(_0xbb2c('0x6'));var rimraf=require('rimraf');var config=require(_0xbb2c('0x7'));var attributes=require(_0xbb2c('0x8'));module[_0xbb2c('0x9')]=function(_0x23340d,_0x4c3cad){return _0x23340d[_0xbb2c('0xa')](_0xbb2c('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 4b3090a..baefd55 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 _0x1339=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreatePlugin','Plugin','body','stringify','moment','bluebird','randomstring'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1339,0x1ed));var _0x9133=function(_0x450c9f,_0x32c163){_0x450c9f=_0x450c9f-0x0;var _0xcfba17=_0x1339[_0x450c9f];return _0xcfba17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});config['redis']=_[_0x9133('0xb')](config[_0x9133('0xc')],{'host':_0x9133('0xd'),'port':0x18eb});var socket=require(_0x9133('0xe'))(new Redis(config[_0x9133('0xc')]));require(_0x9133('0xf'))[_0x9133('0x10')](socket);function respondWithRpcPromise(_0x245134,_0x10a9e4,_0xd588c){return new BPromise(function(_0x4c4517,_0x3f9650){return client[_0x9133('0x11')](_0x245134,_0xd588c)[_0x9133('0x12')](function(_0x452481){logger[_0x9133('0x13')](_0x9133('0x14'),_0x10a9e4,'request\x20sent');logger[_0x9133('0x15')](_0x9133('0x16'),_0x10a9e4,'request\x20sent',JSON['stringify'](_0x452481));if(_0x452481[_0x9133('0x17')]){if(_0x452481['error'][_0x9133('0x18')]===0x1f4){logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481[_0x9133('0x17')][_0x9133('0x19')]);return _0x3f9650(_0x452481[_0x9133('0x17')]['message']);}logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481['error'][_0x9133('0x19')]);return _0x4c4517(_0x452481[_0x9133('0x17')][_0x9133('0x19')]);}else{logger[_0x9133('0x13')]('Plugin,\x20%s,\x20%s',_0x10a9e4,_0x9133('0x1a'));_0x4c4517(_0x452481['result'][_0x9133('0x19')]);}})['catch'](function(_0x115ee8){logger[_0x9133('0x17')]('Plugin,\x20%s,\x20%s',_0x10a9e4,_0x115ee8);_0x3f9650(_0x115ee8);});});}exports[_0x9133('0x1b')]=function(_0x4b940b){var _0x2f91f8=this;return new Promise(function(_0x57af5e,_0x5e4f0c){return db[_0x9133('0x1c')]['create'](_0x4b940b[_0x9133('0x1d')],{'raw':_0x4b940b['options']?_0x4b940b['options']['raw']===undefined?!![]:![]:!![]})[_0x9133('0x12')](function(_0x2dcfb8){logger['info'](_0x9133('0x1b'),_0x4b940b);logger[_0x9133('0x15')](_0x9133('0x1b'),_0x4b940b,JSON[_0x9133('0x1e')](_0x2dcfb8));_0x57af5e(_0x2dcfb8);})['catch'](function(_0xdb7a98){logger['error'](_0x9133('0x1b'),_0xdb7a98[_0x9133('0x19')],_0x4b940b);_0x5e4f0c(_0x2f91f8[_0x9133('0x17')](0x1f4,_0xdb7a98[_0x9133('0x19')]));});});}; \ No newline at end of file +var _0x2531=['options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin','Plugin','body'];(function(_0x58930b,_0x326c01){var _0x311416=function(_0x5bb674){while(--_0x5bb674){_0x58930b['push'](_0x58930b['shift']());}};_0x311416(++_0x326c01);}(_0x2531,0x1d1));var _0x1253=function(_0x2f9dea,_0x4fa8b4){_0x2f9dea=_0x2f9dea-0x0;var _0x256542=_0x2531[_0x2f9dea];return _0x256542;};'use strict';var _=require(_0x1253('0x0'));var util=require(_0x1253('0x1'));var moment=require(_0x1253('0x2'));var BPromise=require('bluebird');var rs=require(_0x1253('0x3'));var fs=require('fs');var Redis=require(_0x1253('0x4'));var db=require(_0x1253('0x5'))['db'];var utils=require(_0x1253('0x6'));var logger=require(_0x1253('0x7'))(_0x1253('0x8'));var config=require('../../config/environment');var jayson=require(_0x1253('0x9'));var client=jayson[_0x1253('0xa')][_0x1253('0xb')]({'port':0x232a});config[_0x1253('0xc')]=_[_0x1253('0xd')](config[_0x1253('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1253('0xe'))(new Redis(config[_0x1253('0xc')]));require('./plugin.socket')[_0x1253('0xf')](socket);function respondWithRpcPromise(_0x4396ba,_0x38eb6e,_0xdc361f){return new BPromise(function(_0x48e602,_0x329a70){return client[_0x1253('0x10')](_0x4396ba,_0xdc361f)['then'](function(_0x168581){logger[_0x1253('0x11')](_0x1253('0x12'),_0x38eb6e,_0x1253('0x13'));logger[_0x1253('0x14')](_0x1253('0x15'),_0x38eb6e,_0x1253('0x13'),JSON[_0x1253('0x16')](_0x168581));if(_0x168581[_0x1253('0x17')]){if(_0x168581[_0x1253('0x17')]['code']===0x1f4){logger[_0x1253('0x17')]('Plugin,\x20%s,\x20%s',_0x38eb6e,_0x168581[_0x1253('0x17')]['message']);return _0x329a70(_0x168581[_0x1253('0x17')][_0x1253('0x18')]);}logger[_0x1253('0x17')](_0x1253('0x12'),_0x38eb6e,_0x168581[_0x1253('0x17')][_0x1253('0x18')]);return _0x48e602(_0x168581[_0x1253('0x17')][_0x1253('0x18')]);}else{logger['info'](_0x1253('0x12'),_0x38eb6e,'request\x20sent');_0x48e602(_0x168581[_0x1253('0x19')][_0x1253('0x18')]);}})[_0x1253('0x1a')](function(_0x1a55ae){logger['error'](_0x1253('0x12'),_0x38eb6e,_0x1a55ae);_0x329a70(_0x1a55ae);});});}exports[_0x1253('0x1b')]=function(_0x4ce9fc){var _0x11c04d=this;return new Promise(function(_0x4ad630,_0x93f372){return db[_0x1253('0x1c')]['create'](_0x4ce9fc[_0x1253('0x1d')],{'raw':_0x4ce9fc[_0x1253('0x1e')]?_0x4ce9fc['options'][_0x1253('0x1f')]===undefined?!![]:![]:!![]})[_0x1253('0x20')](function(_0xd6073){logger[_0x1253('0x11')](_0x1253('0x1b'),_0x4ce9fc);logger[_0x1253('0x14')](_0x1253('0x1b'),_0x4ce9fc,JSON[_0x1253('0x16')](_0xd6073));_0x4ad630(_0xd6073);})['catch'](function(_0x4fa6cd){logger[_0x1253('0x17')](_0x1253('0x1b'),_0x4fa6cd[_0x1253('0x18')],_0x4ce9fc);_0x93f372(_0x11c04d[_0x1253('0x17')](0x1f4,_0x4fa6cd['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5476cef..b4f3157 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 _0x8c47=['length','emit','removeListener'];(function(_0x1bf36c,_0x1fa239){var _0x3b9b18=function(_0x3984ff){while(--_0x3984ff){_0x1bf36c['push'](_0x1bf36c['shift']());}};_0x3b9b18(++_0x1fa239);}(_0x8c47,0x1cf));var _0x78c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x8c47[_0x3511d3];return _0x5d6321;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove','update'];function createListener(_0x418066,_0x226187){return function(_0x5bf1ad){_0x226187[_0x78c4('0x0')](_0x418066,_0x5bf1ad);};}function removeListener(_0x4dbcf9,_0x365fef){return function(){PluginEvents[_0x78c4('0x1')](_0x4dbcf9,_0x365fef);};}exports['register']=function(_0x401035){for(var _0x4a8b65=0x0,_0x195e37=events[_0x78c4('0x2')];_0x4a8b65<_0x195e37;_0x4a8b65++){var _0x4eff46=events[_0x4a8b65];var _0x3ca6d7=createListener('plugin:'+_0x4eff46,_0x401035);PluginEvents['on'](_0x4eff46,_0x3ca6d7);}}; \ No newline at end of file +var _0x4f2b=['removeListener','length','plugin:','./plugin.events','save','update'];(function(_0x1ad2d9,_0xb23fcf){var _0x4f73d9=function(_0xa858ca){while(--_0xa858ca){_0x1ad2d9['push'](_0x1ad2d9['shift']());}};_0x4f73d9(++_0xb23fcf);}(_0x4f2b,0x1b3));var _0xb4f2=function(_0x25b20e,_0x32d483){_0x25b20e=_0x25b20e-0x0;var _0x115dfd=_0x4f2b[_0x25b20e];return _0x115dfd;};'use strict';var PluginEvents=require(_0xb4f2('0x0'));var events=[_0xb4f2('0x1'),'remove',_0xb4f2('0x2')];function createListener(_0x40b083,_0x82a247){return function(_0x4a7796){_0x82a247['emit'](_0x40b083,_0x4a7796);};}function removeListener(_0x47be28,_0x1040d6){return function(){PluginEvents[_0xb4f2('0x3')](_0x47be28,_0x1040d6);};}exports['register']=function(_0x35bb34){for(var _0x1d8028=0x0,_0x2edb1f=events[_0xb4f2('0x4')];_0x1d8028<_0x2edb1f;_0x1d8028++){var _0x2fc792=events[_0x1d8028];var _0x1869f4=createListener(_0xb4f2('0x5')+_0x2fc792,_0x35bb34);PluginEvents['on'](_0x2fc792,_0x1869f4);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 25e6c67..00900fe 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(_0x397f2e,_0x42c7cb){var _0x5ec4a9=function(_0x1da322){while(--_0x1da322){_0x397f2e['push'](_0x397f2e['shift']());}};_0x5ec4a9(++_0x42c7cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x12a997,_0x1d9635){var _0x2a6822=function(_0x1d2c00){while(--_0x1d2c00){_0x12a997['push'](_0x12a997['shift']());}};_0x2a6822(++_0x1d9635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 545a109..f11569b 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 _0x2e54=['exec','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','api','path','child_process'];(function(_0x5731c0,_0x233b7a){var _0x4cb844=function(_0x3c99b7){while(--_0x3c99b7){_0x5731c0['push'](_0x5731c0['shift']());}};_0x4cb844(++_0x233b7a);}(_0x2e54,0x1dd));var _0x42e5=function(_0xeeacd,_0x42954c){_0xeeacd=_0xeeacd-0x0;var _0x58754a=_0x2e54[_0xeeacd];return _0x58754a;};'use strict';var _=require(_0x42e5('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x42e5('0x1'));var path=require(_0x42e5('0x2'));var exec=require(_0x42e5('0x3'))[_0x42e5('0x4')];var BPromise=require(_0x42e5('0x5'));function handleEntityNotFound(_0x153440,_0x42736b){return function(_0x528772){if(!_0x528772){_0x153440[_0x42e5('0x6')](0x194);;}return _0x528772;};}function respondWithResult(_0x455f48,_0x38cb1b){_0x38cb1b=_0x38cb1b||0xc8;return function(_0x4bed10){if(_0x4bed10){return _0x455f48[_0x42e5('0x7')](_0x38cb1b)['json'](_0x4bed10);}return null;};}function handleError(_0x335b92,_0x490b99){_0x490b99=_0x490b99||0x1f4;return function(_0x3a8494){logger[_0x42e5('0x8')](_0x3a8494[_0x42e5('0x9')]);if(_0x3a8494[_0x42e5('0xa')]){delete _0x3a8494[_0x42e5('0xa')];}_0x335b92[_0x42e5('0x7')](_0x490b99)[_0x42e5('0xb')](_0x3a8494);};}function execChildProcess(){return new BPromise(function(_0x2fa2f0,_0x197752){exec('npm\x20install',function(_0x456298,_0x28b3b3,_0x5d57f4){logger[_0x42e5('0xc')](_0x28b3b3);logger[_0x42e5('0xc')](_0x5d57f4);if(_0x456298){logger[_0x42e5('0x8')](_0x456298);return _0x197752(_0x456298);}return _0x2fa2f0(_0x28b3b3);});});}exports[_0x42e5('0xd')]=function(_0x144fb4,_0x1faafc){return pm2[_0x42e5('0xe')]()[_0x42e5('0xf')](function(_0x447648){if(_0x447648){var _0x23957f=_['reject'](_0x447648,function(_0x3b3dd9){return _0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x10')||_0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x11');});return{'rows':_0x23957f,'count':_0x23957f[_0x42e5('0x12')]};}return null;})[_0x42e5('0xf')](respondWithResult(_0x1faafc,null))[_0x42e5('0x13')](handleError(_0x1faafc,null));};exports[_0x42e5('0x14')]=function(_0x3c7b79,_0x22655f){return pm2[_0x42e5('0x15')](_0x3c7b79[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x22655f,null))['then'](handleEntityNotFound(_0x22655f,null))[_0x42e5('0x13')](handleError(_0x22655f,null));};exports['create']=function(_0x5f4428,_0x14d16d){if(_0x5f4428[_0x42e5('0x17')]['name']&&_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]){var _0x1c2169=path[_0x42e5('0x19')](__dirname,_0x42e5('0x1a'),_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]);var _0x58eee5=process['cwd']();process[_0x42e5('0x1b')](path['dirname'](_0x1c2169));return execChildProcess()[_0x42e5('0xf')](function(_0x2e9574){process[_0x42e5('0x1b')](_0x58eee5);return pm2[_0x42e5('0x1c')]({'name':_0x5f4428[_0x42e5('0x17')]['name'],'script':_0x1c2169});})[_0x42e5('0xf')](function(_0xf29221){pm2[_0x42e5('0x1d')]();return _0xf29221[0x0];})[_0x42e5('0xf')](respondWithResult(_0x14d16d,0xc9))[_0x42e5('0x13')](handleError(_0x14d16d,null));}else{return _0x14d16d['status'](0x1f4)['send']({'message':_0x42e5('0x1e')});}};exports['update']=function(_0x56f812,_0x1b60be){if(_0x56f812['body']['id']){delete _0x56f812[_0x42e5('0x17')]['id'];}var _0x2d9e65={'online':_0x42e5('0x1f'),'stopped':_0x42e5('0x20')};if(_0x2d9e65[_0x42e5('0x21')](_0x56f812[_0x42e5('0x17')]['status'])){return pm2[_0x2d9e65[_0x56f812[_0x42e5('0x17')][_0x42e5('0x7')]]](_0x56f812[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x1b60be,0xc8))[_0x42e5('0x13')](handleError(_0x1b60be,null));}else{return _0x1b60be[_0x42e5('0x7')](0x1f4)[_0x42e5('0xb')]({'message':_0x42e5('0x22')});}};exports[_0x42e5('0x23')]=function(_0x2ba9ef,_0x2c7542){if(_0x2ba9ef[_0x42e5('0x17')]['id']){delete _0x2ba9ef[_0x42e5('0x17')]['id'];}if(_0x2ba9ef['params']['id']){return pm2[_0x42e5('0x24')](_0x2ba9ef[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](function(_0x156e73){pm2['dump']();return _0x156e73[0x0];})['then'](respondWithResult(_0x2c7542,null))[_0x42e5('0x13')](handleError(_0x2c7542,null));}else{return _0x2c7542['status'](0x1f4)[_0x42e5('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x4483=['error','stack','name','send','npm\x20install','info','list','express','motion2','length','then','catch','show','describe','body','script','join','../../files/plugins','chdir','dirname','start','dump','update','restart','stop','hasOwnProperty','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json'];(function(_0xa4fe9f,_0x2944c1){var _0x9f0e3e=function(_0x44dbf8){while(--_0x44dbf8){_0xa4fe9f['push'](_0xa4fe9f['shift']());}};_0x9f0e3e(++_0x2944c1);}(_0x4483,0x1a3));var _0x3448=function(_0xb47bc9,_0x1f9b7d){_0xb47bc9=_0xb47bc9-0x0;var _0xf631b8=_0x4483[_0xb47bc9];return _0xf631b8;};'use strict';var _=require(_0x3448('0x0'));var pm2=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var path=require(_0x3448('0x3'));var exec=require(_0x3448('0x4'))[_0x3448('0x5')];var BPromise=require(_0x3448('0x6'));function handleEntityNotFound(_0xef1a93,_0x5f5163){return function(_0xeb5b8){if(!_0xeb5b8){_0xef1a93[_0x3448('0x7')](0x194);;}return _0xeb5b8;};}function respondWithResult(_0x1b05db,_0xd3606d){_0xd3606d=_0xd3606d||0xc8;return function(_0x1bb7e5){if(_0x1bb7e5){return _0x1b05db[_0x3448('0x8')](_0xd3606d)[_0x3448('0x9')](_0x1bb7e5);}return null;};}function handleError(_0x34b926,_0x5923ee){_0x5923ee=_0x5923ee||0x1f4;return function(_0x5c82c6){logger[_0x3448('0xa')](_0x5c82c6[_0x3448('0xb')]);if(_0x5c82c6[_0x3448('0xc')]){delete _0x5c82c6[_0x3448('0xc')];}_0x34b926[_0x3448('0x8')](_0x5923ee)[_0x3448('0xd')](_0x5c82c6);};}function execChildProcess(){return new BPromise(function(_0x2bdf02,_0x32cd61){exec(_0x3448('0xe'),function(_0x35bb7b,_0x2a6048,_0x481a6f){logger['info'](_0x2a6048);logger[_0x3448('0xf')](_0x481a6f);if(_0x35bb7b){logger[_0x3448('0xa')](_0x35bb7b);return _0x32cd61(_0x35bb7b);}return _0x2bdf02(_0x2a6048);});});}exports['index']=function(_0x2661e1,_0xdfb89d){return pm2[_0x3448('0x10')]()['then'](function(_0x14104c){if(_0x14104c){var _0x2952a6=_['reject'](_0x14104c,function(_0x2387a3){return _0x2387a3[_0x3448('0xc')]===_0x3448('0x11')||_0x2387a3['name']===_0x3448('0x12');});return{'rows':_0x2952a6,'count':_0x2952a6[_0x3448('0x13')]};}return null;})[_0x3448('0x14')](respondWithResult(_0xdfb89d,null))[_0x3448('0x15')](handleError(_0xdfb89d,null));};exports[_0x3448('0x16')]=function(_0x1b2081,_0x247d1a){return pm2[_0x3448('0x17')](_0x1b2081['params']['id'])[_0x3448('0x14')](respondWithResult(_0x247d1a,null))['then'](handleEntityNotFound(_0x247d1a,null))['catch'](handleError(_0x247d1a,null));};exports['create']=function(_0x1e9774,_0x278736){if(_0x1e9774[_0x3448('0x18')]['name']&&_0x1e9774[_0x3448('0x18')][_0x3448('0x19')]){var _0x317de6=path[_0x3448('0x1a')](__dirname,_0x3448('0x1b'),_0x1e9774[_0x3448('0x18')]['script']);var _0x54c7ee=process['cwd']();process[_0x3448('0x1c')](path[_0x3448('0x1d')](_0x317de6));return execChildProcess()['then'](function(_0x5b1f7c){process[_0x3448('0x1c')](_0x54c7ee);return pm2[_0x3448('0x1e')]({'name':_0x1e9774[_0x3448('0x18')][_0x3448('0xc')],'script':_0x317de6});})[_0x3448('0x14')](function(_0x566ff5){pm2[_0x3448('0x1f')]();return _0x566ff5[0x0];})[_0x3448('0x14')](respondWithResult(_0x278736,0xc9))[_0x3448('0x15')](handleError(_0x278736,null));}else{return _0x278736[_0x3448('0x8')](0x1f4)[_0x3448('0xd')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x3448('0x20')]=function(_0x393081,_0x52c163){if(_0x393081[_0x3448('0x18')]['id']){delete _0x393081[_0x3448('0x18')]['id'];}var _0x310912={'online':_0x3448('0x21'),'stopped':_0x3448('0x22')};if(_0x310912[_0x3448('0x23')](_0x393081[_0x3448('0x18')][_0x3448('0x8')])){return pm2[_0x310912[_0x393081['body'][_0x3448('0x8')]]](_0x393081[_0x3448('0x24')]['id'])[_0x3448('0x14')](respondWithResult(_0x52c163,0xc8))['catch'](handleError(_0x52c163,null));}else{return _0x52c163[_0x3448('0x8')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x52fb48,_0xff6513){if(_0x52fb48['body']['id']){delete _0x52fb48['body']['id'];}if(_0x52fb48[_0x3448('0x24')]['id']){return pm2[_0x3448('0x25')](_0x52fb48[_0x3448('0x24')]['id'])[_0x3448('0x14')](function(_0x4f4f32){pm2[_0x3448('0x1f')]();return _0x4f4f32[0x0];})[_0x3448('0x14')](respondWithResult(_0xff6513,null))[_0x3448('0x15')](handleError(_0xff6513,null));}else{return _0xff6513['status'](0x1f4)[_0x3448('0xd')]({'message':_0x3448('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d4d6f88..1098c0a 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 _0xa5c9=['Router','../../components/auth/service','./realtime.controller','isAuthenticated','getQueues','express'];(function(_0x538df0,_0x2d2167){var _0x4db070=function(_0x1ba965){while(--_0x1ba965){_0x538df0['push'](_0x538df0['shift']());}};_0x4db070(++_0x2d2167);}(_0xa5c9,0x143));var _0x9a5c=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xa5c9[_0x59bcb1];return _0x4a737f;};'use strict';var express=require(_0x9a5c('0x0'));var router=express[_0x9a5c('0x1')]();var auth=require(_0x9a5c('0x2'));var controller=require(_0x9a5c('0x3'));router['get']('/queues',auth[_0x9a5c('0x4')](),controller[_0x9a5c('0x5')]);module['exports']=router; \ No newline at end of file +var _0x285b=['./realtime.controller','/queues','isAuthenticated','getQueues','exports','express','../../components/auth/service'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x285b,0x171));var _0xb285=function(_0x1659fa,_0x58982c){_0x1659fa=_0x1659fa-0x0;var _0x1c2eb4=_0x285b[_0x1659fa];return _0x1c2eb4;};'use strict';var express=require(_0xb285('0x0'));var router=express['Router']();var auth=require(_0xb285('0x1'));var controller=require(_0xb285('0x2'));router['get'](_0xb285('0x3'),auth[_0xb285('0x4')](),controller[_0xb285('0x5')]);module[_0xb285('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 568e794..ec18f2c 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 _0xacf4=['fax','then','query','channel','includes','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','voice','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','paused','push','pTalking','originated','message','dialMethod','Trunk','startProgressive','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','waiting','agents','merge','online','length','find','UserId','loggedInDb','Pause','findAll','User','agent','all','catch','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','Content-Range','error','stack','name','status','send','getQueues','mail','sms','openchannel'];(function(_0x512f16,_0x311fbd){var _0x152880=function(_0xbe2a2a){while(--_0xbe2a2a){_0x512f16['push'](_0x512f16['shift']());}};_0x152880(++_0x311fbd);}(_0xacf4,0xe7));var _0x4acf=function(_0x42fb06,_0xc8e815){_0x42fb06=_0x42fb06-0x0;var _0x5580ad=_0xacf4[_0x42fb06];return _0x5580ad;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0x4acf('0x0'));var qs=require(_0x4acf('0x1'));var logger=require(_0x4acf('0x2'))(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var client=jayson[_0x4acf('0x5')][_0x4acf('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x4acf('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x2124c8,_0x4e0c43){return function(_0x24bf24){if(_0x24bf24){var _0x2ba08a=typeof _0x4e0c43[_0x4acf('0x7')]===_0x4acf('0x8')&&typeof _0x4e0c43[_0x4acf('0x9')]==='undefined';var _0x55f61d=_0x24bf24[_0x4acf('0xa')];var _0x59f559=_0x2ba08a?0x0:_0x4e0c43[_0x4acf('0x7')];var _0x2c2cb4=_0x2ba08a?_0x24bf24[_0x4acf('0xa')]:_0x4e0c43['offset']+_0x4e0c43[_0x4acf('0x9')];var _0x57f6cb;if(_0x2c2cb4>=_0x55f61d){_0x2c2cb4=_0x55f61d;_0x57f6cb=0xc8;}else{_0x57f6cb=0xce;}_0x2124c8['status'](_0x57f6cb);return _0x2124c8['set'](_0x4acf('0xb'),_0x59f559+'-'+_0x2c2cb4+'/'+_0x55f61d)['json'](_0x24bf24);}return null;};}function handleError(_0x5bca4e,_0x1783d2){_0x1783d2=_0x1783d2||0x1f4;return function(_0x979f49){logger[_0x4acf('0xc')](_0x979f49[_0x4acf('0xd')]);if(_0x979f49[_0x4acf('0xe')]){delete _0x979f49[_0x4acf('0xe')];}_0x5bca4e[_0x4acf('0xf')](_0x1783d2)[_0x4acf('0x10')](_0x979f49);};}exports[_0x4acf('0x11')]=function(_0x312bb5,_0x2741d3){var _0x5f0260=[_0x4acf('0x12'),'chat',_0x4acf('0x13'),_0x4acf('0x14'),_0x4acf('0x15'),'whatsapp','voice'];var _0x13d10e={'count':0x0,'rows':[]},_0x40cb8d={},_0x240c00;Promise['resolve']()[_0x4acf('0x16')](function(){if(_0x312bb5[_0x4acf('0x17')][_0x4acf('0x18')]){if(!_[_0x4acf('0x19')](_0x5f0260,_0x312bb5[_0x4acf('0x17')][_0x4acf('0x18')][_0x4acf('0x1a')]()))throw new Error(_0x4acf('0x1b'));_0x240c00=_0x312bb5[_0x4acf('0x17')][_0x4acf('0x18')][_0x4acf('0x1a')]();}var _0x5f0284=_[_0x4acf('0x1c')](_0x240c00)+_0x4acf('0x1d');var _0x57ea46=_[_0x4acf('0x1e')](db[_0x5f0284][_0x4acf('0x1f')],function(_0x569d9e){return{'name':_0x569d9e[_0x4acf('0x20')],'type':_0x569d9e[_0x4acf('0x21')][_0x4acf('0x22')]};});_0x40cb8d=qs[_0x4acf('0x23')](_0x57ea46,_0x312bb5);if(_0x312bb5['user'][_0x4acf('0x24')]===_0x4acf('0x25')){var _0x57e595={'params':{'id':_0x312bb5[_0x4acf('0x25')][_0x4acf('0x26')]},'query':{'section':_0x240c00==='voice'&&_0x312bb5[_0x4acf('0x17')][_0x4acf('0x21')]===_0x4acf('0x27')?_0x4acf('0x28'):_['startCase'](_0x240c00)+'Queues','type':_0x312bb5[_0x4acf('0x17')][_0x4acf('0x21')],'nolimit':!![],'sort':_0x4acf('0xe'),'filter':_0x312bb5[_0x4acf('0x17')][_0x4acf('0x29')]}};return db[_0x4acf('0x2a')][_0x4acf('0x2b')](_0x57e595);}return db[_0x5f0284][_0x4acf('0x2c')](_0x40cb8d);})[_0x4acf('0x16')](function(_0x2a3830){_0x13d10e['count']=_0x2a3830[_0x4acf('0xa')];var _0x3f5614=_0x240c00===_0x4acf('0x2d')?client:routingClient;return _0x3f5614[_0x4acf('0x2e')](_[_0x4acf('0x1c')](_0x240c00)+_0x4acf('0x2f'),_0x312bb5)[_0x4acf('0x16')](function(_0x5d862f){if(_0x5d862f[_0x4acf('0xc')])throw new Error(util[_0x4acf('0x30')](_0x4acf('0x31'),_0x240c00));var _0x50dced=_0x5d862f[_0x4acf('0x32')];var _0x18d0bf=[_0x4acf('0x33'),_0x4acf('0x34'),'waiting',_0x4acf('0x35'),_0x4acf('0x36')];if(_0x240c00===_0x4acf('0x2d')&&_0x312bb5['query'][_0x4acf('0x21')]===_0x4acf('0x27')){_0x18d0bf[_0x4acf('0x37')](_0x4acf('0x38'),_0x4acf('0x39'),_0x4acf('0x3a'),'dialActive',_0x4acf('0x3b'),_0x4acf('0x3c'),'startPredictive',_0x4acf('0x3d'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x4acf('0x3e'),_0x4acf('0x3f'),'predictiveIntervalAnsweredCalls',_0x4acf('0x40'),_0x4acf('0x41'),_0x4acf('0x42'),_0x4acf('0x43'));}var _0x1cbb67=_0x2a3830[_0x4acf('0x44')][_0x4acf('0x1e')](function(_0x29dc65){var _0x24465b=_0x29dc65[_0x4acf('0x45')]({'plain':!![]});_0x24465b['paused']=0x0;_0x24465b['loggedInDb']=0x0;_0x24465b[_0x4acf('0x33')]=0x0;_0x24465b[_0x4acf('0x34')]=0x0;_0x24465b['paused']=0x0;_0x24465b[_0x4acf('0x46')]=0x0;if(_0x240c00===_0x4acf('0x2d')){_0x24465b[_0x4acf('0x35')]=0x0;if(_0x312bb5[_0x4acf('0x17')]['type']==='outbound'){_0x24465b[_0x4acf('0x38')]=0x0;_0x24465b[_0x4acf('0x39')]=0x0;}}_0x24465b[_0x4acf('0x47')]=[];var _0x44b567=_['find'](_0x50dced[_0x4acf('0x44')],['id',_0x24465b['id']]);if(_0x44b567)_[_0x4acf('0x48')](_0x24465b,_['pick'](_0x44b567,_0x18d0bf));if(_0x240c00==='voice'){return _0x29dc65['getAgents']({'attributes':['id','name',_0x4acf('0x49')],'joinTableAttributes':[],'raw':!![]})[_0x4acf('0x16')](function(_0x208af3){return _0x29dc65['getMembers']({'raw':!![]})[_0x4acf('0x16')](function(_0x3b6574){for(var _0x19e94a=0x0;_0x19e94a<_0x208af3[_0x4acf('0x4a')];_0x19e94a++){var _0x14d92b=_[_0x4acf('0x4b')](_0x3b6574,[_0x4acf('0x4c'),_0x208af3[_0x19e94a]['id']]);var _0x17d5e9={'id':_0x208af3[_0x19e94a]['id'],'name':_0x208af3[_0x19e94a][_0x4acf('0xe')],'online':Boolean(_0x208af3[_0x19e94a][_0x4acf('0x49')]),'paused':_0x14d92b?Boolean(_0x14d92b[_0x4acf('0x36')]):![]};if(_0x17d5e9['online'])_0x24465b[_0x4acf('0x4d')]++;if(_0x17d5e9[_0x4acf('0x36')])_0x24465b[_0x4acf('0x36')]++;_0x24465b[_0x4acf('0x47')][_0x4acf('0x37')](_0x17d5e9);}return _0x24465b;});});}else{var _0x58bc5d='User'+_[_0x4acf('0x1c')](_0x240c00)+_0x4acf('0x1d');var _0xeee54a=_0x240c00+_0x4acf('0x4e');return db[_0x58bc5d][_0x4acf('0x4f')]({'where':{[_[_0x4acf('0x1c')](_0x240c00)+'QueueId']:_0x29dc65['id']},'raw':!![]})[_0x4acf('0x16')](function(_0x5735fc){return db[_0x4acf('0x50')][_0x4acf('0x4f')]({'attributes':['id','name','online',_0xeee54a],'where':{'id':_[_0x4acf('0x1e')](_0x5735fc,_0x4acf('0x4c')),'role':_0x4acf('0x51')},'raw':!![]});})[_0x4acf('0x16')](function(_0x52584a){for(var _0x2f1d23=0x0;_0x2f1d23<_0x52584a[_0x4acf('0x4a')];_0x2f1d23++){var _0x2378c6={'id':_0x52584a[_0x2f1d23]['id'],'name':_0x52584a[_0x2f1d23][_0x4acf('0xe')],'online':Boolean(_0x52584a[_0x2f1d23][_0x4acf('0x49')]),'paused':Boolean(_0x52584a[_0x2f1d23][_0xeee54a])};if(_0x2378c6[_0x4acf('0x49')])_0x24465b[_0x4acf('0x4d')]++;if(_0x2378c6[_0x4acf('0x36')])_0x24465b['paused']++;_0x24465b['agents'][_0x4acf('0x37')](_0x2378c6);}return _0x24465b;});}});return Promise[_0x4acf('0x52')](_0x1cbb67);});})[_0x4acf('0x16')](function(_0x33bc52){_0x13d10e[_0x4acf('0x44')]=_0x33bc52;return _0x13d10e;})[_0x4acf('0x16')](respondWithFilteredResult(_0x2741d3,_0x40cb8d))[_0x4acf('0x53')](handleError(_0x2741d3,null));}; \ No newline at end of file +var _0xbd51=['offset','undefined','limit','count','set','json','error','stack','name','send','getQueues','chat','sms','openchannel','fax','whatsapp','voice','query','channel','includes','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','key','user','role','type','outbound','Queues','filter','UserProfile','getResources','findAndCountAll','then','request','result','loggedIn','available','waiting','talking','push','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','rows','get','paused','loggedInDb','agents','find','merge','pick','getAgents','online','User','Pause','findAll','QueueId','agent','all','catch','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','http'];(function(_0x4cb11f,_0x5b59a8){var _0x10581c=function(_0x138636){while(--_0x138636){_0x4cb11f['push'](_0x4cb11f['shift']());}};_0x10581c(++_0x5b59a8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1de839,_0x1e2b40){_0x1de839=_0x1de839-0x0;var _0x4678cf=_0xbd51[_0x1de839];return _0x4678cf;};'use strict';var util=require(_0x1bd5('0x0'));var _=require('lodash');var jayson=require(_0x1bd5('0x1'));var qs=require(_0x1bd5('0x2'));var logger=require(_0x1bd5('0x3'))(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var client=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client'][_0x1bd5('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x362b24,_0x43e6b6){return function(_0x59ddfb){if(_0x59ddfb){var _0x29abea=typeof _0x43e6b6[_0x1bd5('0x6')]===_0x1bd5('0x7')&&typeof _0x43e6b6[_0x1bd5('0x8')]===_0x1bd5('0x7');var _0x4a7f90=_0x59ddfb[_0x1bd5('0x9')];var _0x5c8e0d=_0x29abea?0x0:_0x43e6b6[_0x1bd5('0x6')];var _0x28df8e=_0x29abea?_0x59ddfb[_0x1bd5('0x9')]:_0x43e6b6[_0x1bd5('0x6')]+_0x43e6b6[_0x1bd5('0x8')];var _0x3e3d06;if(_0x28df8e>=_0x4a7f90){_0x28df8e=_0x4a7f90;_0x3e3d06=0xc8;}else{_0x3e3d06=0xce;}_0x362b24['status'](_0x3e3d06);return _0x362b24[_0x1bd5('0xa')]('Content-Range',_0x5c8e0d+'-'+_0x28df8e+'/'+_0x4a7f90)[_0x1bd5('0xb')](_0x59ddfb);}return null;};}function handleError(_0x24e38c,_0x37e8e1){_0x37e8e1=_0x37e8e1||0x1f4;return function(_0x14606b){logger[_0x1bd5('0xc')](_0x14606b[_0x1bd5('0xd')]);if(_0x14606b[_0x1bd5('0xe')]){delete _0x14606b['name'];}_0x24e38c['status'](_0x37e8e1)[_0x1bd5('0xf')](_0x14606b);};}exports[_0x1bd5('0x10')]=function(_0x33f82a,_0x39c44b){var _0x48d048=['mail',_0x1bd5('0x11'),_0x1bd5('0x12'),_0x1bd5('0x13'),_0x1bd5('0x14'),_0x1bd5('0x15'),_0x1bd5('0x16')];var _0x13cf34={'count':0x0,'rows':[]},_0x3afc4a={},_0x4670b5;Promise['resolve']()['then'](function(){if(_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x18')]){if(!_[_0x1bd5('0x19')](_0x48d048,_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x18')][_0x1bd5('0x1a')]()))throw new Error(_0x1bd5('0x1b'));_0x4670b5=_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x18')][_0x1bd5('0x1a')]();}var _0x34bd6a=_[_0x1bd5('0x1c')](_0x4670b5)+_0x1bd5('0x1d');var _0x7ff933=_[_0x1bd5('0x1e')](db[_0x34bd6a][_0x1bd5('0x1f')],function(_0x1f13e7){return{'name':_0x1f13e7[_0x1bd5('0x20')],'type':_0x1f13e7['type'][_0x1bd5('0x21')]};});_0x3afc4a=qs['getOptions'](_0x7ff933,_0x33f82a);if(_0x33f82a[_0x1bd5('0x22')][_0x1bd5('0x23')]===_0x1bd5('0x22')){var _0x48316b={'params':{'id':_0x33f82a[_0x1bd5('0x22')]['userProfileId']},'query':{'section':_0x4670b5===_0x1bd5('0x16')&&_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x24')]===_0x1bd5('0x25')?'QueueCampaigns':_[_0x1bd5('0x1c')](_0x4670b5)+_0x1bd5('0x26'),'type':_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x24')],'nolimit':!![],'sort':'name','filter':_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x27')]}};return db[_0x1bd5('0x28')][_0x1bd5('0x29')](_0x48316b);}return db[_0x34bd6a][_0x1bd5('0x2a')](_0x3afc4a);})[_0x1bd5('0x2b')](function(_0x4e72b2){_0x13cf34[_0x1bd5('0x9')]=_0x4e72b2[_0x1bd5('0x9')];var _0x8d53ba=_0x4670b5==='voice'?client:routingClient;return _0x8d53ba[_0x1bd5('0x2c')](_[_0x1bd5('0x1c')](_0x4670b5)+_0x1bd5('0x26'),_0x33f82a)[_0x1bd5('0x2b')](function(_0x1f4456){if(_0x1f4456[_0x1bd5('0xc')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4670b5));var _0x26be8e=_0x1f4456[_0x1bd5('0x2d')];var _0x5542aa=[_0x1bd5('0x2e'),_0x1bd5('0x2f'),_0x1bd5('0x30'),_0x1bd5('0x31'),'paused'];if(_0x4670b5===_0x1bd5('0x16')&&_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x24')]===_0x1bd5('0x25')){_0x5542aa[_0x1bd5('0x32')](_0x1bd5('0x33'),_0x1bd5('0x34'),_0x1bd5('0x35'),'dialActive',_0x1bd5('0x36'),_0x1bd5('0x37'),_0x1bd5('0x38'),_0x1bd5('0x39'),_0x1bd5('0x3a'),_0x1bd5('0x3b'),_0x1bd5('0x3c'),'erlangBusyFactor',_0x1bd5('0x3d'),_0x1bd5('0x3e'),_0x1bd5('0x3f'),_0x1bd5('0x40'),_0x1bd5('0x41'),_0x1bd5('0x42'),_0x1bd5('0x43'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x1bd5('0x44'));}var _0x2f8897=_0x4e72b2[_0x1bd5('0x45')]['map'](function(_0x4595a0){var _0x5af974=_0x4595a0[_0x1bd5('0x46')]({'plain':!![]});_0x5af974[_0x1bd5('0x47')]=0x0;_0x5af974[_0x1bd5('0x48')]=0x0;_0x5af974[_0x1bd5('0x2e')]=0x0;_0x5af974[_0x1bd5('0x2f')]=0x0;_0x5af974[_0x1bd5('0x47')]=0x0;_0x5af974[_0x1bd5('0x30')]=0x0;if(_0x4670b5===_0x1bd5('0x16')){_0x5af974['talking']=0x0;if(_0x33f82a[_0x1bd5('0x17')][_0x1bd5('0x24')]==='outbound'){_0x5af974[_0x1bd5('0x33')]=0x0;_0x5af974[_0x1bd5('0x34')]=0x0;}}_0x5af974[_0x1bd5('0x49')]=[];var _0x5c3b08=_[_0x1bd5('0x4a')](_0x26be8e[_0x1bd5('0x45')],['id',_0x5af974['id']]);if(_0x5c3b08)_[_0x1bd5('0x4b')](_0x5af974,_[_0x1bd5('0x4c')](_0x5c3b08,_0x5542aa));if(_0x4670b5==='voice'){return _0x4595a0[_0x1bd5('0x4d')]({'attributes':['id',_0x1bd5('0xe'),_0x1bd5('0x4e')],'joinTableAttributes':[],'raw':!![]})[_0x1bd5('0x2b')](function(_0x4de69a){return _0x4595a0['getMembers']({'raw':!![]})[_0x1bd5('0x2b')](function(_0x35afc7){for(var _0x453544=0x0;_0x453544<_0x4de69a['length'];_0x453544++){var _0x2a28c6=_[_0x1bd5('0x4a')](_0x35afc7,['UserId',_0x4de69a[_0x453544]['id']]);var _0x1eacac={'id':_0x4de69a[_0x453544]['id'],'name':_0x4de69a[_0x453544]['name'],'online':Boolean(_0x4de69a[_0x453544][_0x1bd5('0x4e')]),'paused':_0x2a28c6?Boolean(_0x2a28c6[_0x1bd5('0x47')]):![]};if(_0x1eacac['online'])_0x5af974[_0x1bd5('0x48')]++;if(_0x1eacac[_0x1bd5('0x47')])_0x5af974[_0x1bd5('0x47')]++;_0x5af974[_0x1bd5('0x49')][_0x1bd5('0x32')](_0x1eacac);}return _0x5af974;});});}else{var _0x25b35a=_0x1bd5('0x4f')+_[_0x1bd5('0x1c')](_0x4670b5)+_0x1bd5('0x1d');var _0x3e31d3=_0x4670b5+_0x1bd5('0x50');return db[_0x25b35a][_0x1bd5('0x51')]({'where':{[_['startCase'](_0x4670b5)+_0x1bd5('0x52')]:_0x4595a0['id']},'raw':!![]})[_0x1bd5('0x2b')](function(_0x335125){return db['User'][_0x1bd5('0x51')]({'attributes':['id',_0x1bd5('0xe'),'online',_0x3e31d3],'where':{'id':_[_0x1bd5('0x1e')](_0x335125,'UserId'),'role':_0x1bd5('0x53')},'raw':!![]});})['then'](function(_0x35a876){for(var _0xdd6c1a=0x0;_0xdd6c1a<_0x35a876['length'];_0xdd6c1a++){var _0xea034c={'id':_0x35a876[_0xdd6c1a]['id'],'name':_0x35a876[_0xdd6c1a]['name'],'online':Boolean(_0x35a876[_0xdd6c1a][_0x1bd5('0x4e')]),'paused':Boolean(_0x35a876[_0xdd6c1a][_0x3e31d3])};if(_0xea034c[_0x1bd5('0x4e')])_0x5af974[_0x1bd5('0x48')]++;if(_0xea034c[_0x1bd5('0x47')])_0x5af974[_0x1bd5('0x47')]++;_0x5af974[_0x1bd5('0x49')][_0x1bd5('0x32')](_0xea034c);}return _0x5af974;});}});return Promise[_0x1bd5('0x54')](_0x2f8897);});})['then'](function(_0x13985e){_0x13cf34[_0x1bd5('0x45')]=_0x13985e;return _0x13cf34;})[_0x1bd5('0x2b')](respondWithFilteredResult(_0x39c44b,_0x3afc4a))[_0x1bd5('0x55')](handleError(_0x39c44b,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f481dd3..b84a227 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5001b4,_0x362ed5){var _0x44ffa7=function(_0x3a0a8e){while(--_0x3a0a8e){_0x5001b4['push'](_0x5001b4['shift']());}};_0x44ffa7(++_0x362ed5);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x44e75a,_0x1a0a06){var _0x261782=function(_0x3686b5){while(--_0x3686b5){_0x44e75a['push'](_0x44e75a['shift']());}};_0x261782(++_0x1a0a06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 0148511..04e35d2 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 _0x363e=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x528281,_0x2917c9){var _0x1f74b6=function(_0x15a273){while(--_0x15a273){_0x528281['push'](_0x528281['shift']());}};_0x1f74b6(++_0x2917c9);}(_0x363e,0x179));var _0xe363=function(_0x4151f4,_0x4c6cba){_0x4151f4=_0x4151f4-0x0;var _0xdeed0b=_0x363e[_0x4151f4];return _0xdeed0b;};'use strict';var Sequelize=require(_0xe363('0x0'));module[_0xe363('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe363('0x2')]},'scheduledat':{'type':Sequelize[_0xe363('0x3')]},'uniqueid':{'type':Sequelize[_0xe363('0x2')]},'starttime':{'type':Sequelize[_0xe363('0x3')]},'responsetime':{'type':Sequelize[_0xe363('0x3')]},'ringtime':{'type':Sequelize[_0xe363('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe363('0x2')]},'campaigntype':{'type':Sequelize[_0xe363('0x2')]},'membername':{'type':Sequelize[_0xe363('0x2')]}}; \ No newline at end of file +var _0xa786=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x144337,_0x31044f){var _0x27c2d4=function(_0x4ec4d8){while(--_0x4ec4d8){_0x144337['push'](_0x144337['shift']());}};_0x27c2d4(++_0x31044f);}(_0xa786,0x71));var _0x6a78=function(_0x72b3b7,_0x5a5949){_0x72b3b7=_0x72b3b7-0x0;var _0x431d19=_0xa786[_0x72b3b7];return _0x431d19;};'use strict';var Sequelize=require(_0x6a78('0x0'));module[_0x6a78('0x1')]={'state':{'type':Sequelize[_0x6a78('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6a78('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6a78('0x3')]},'ringtime':{'type':Sequelize[_0x6a78('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6a78('0x4')]},'campaigntype':{'type':Sequelize[_0x6a78('0x4')]},'membername':{'type':Sequelize[_0x6a78('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 79045f2..4d405cf 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 _0xeb36=['rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5d98e8,_0x1b7a31){var _0x28923a=function(_0x5f73ea){while(--_0x5f73ea){_0x5d98e8['push'](_0x5d98e8['shift']());}};_0x28923a(++_0x1b7a31);}(_0xeb36,0x123));var _0x6eb3=function(_0x5d426d,_0x463b3b){_0x5d426d=_0x5d426d-0x0;var _0x343059=_0xeb36[_0x5d426d];return _0x343059;};'use strict';var _=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var logger=require(_0x6eb3('0x2'))(_0x6eb3('0x3'));var moment=require(_0x6eb3('0x4'));var BPromise=require('bluebird');var rp=require(_0x6eb3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6eb3('0x6'));var config=require('../../config/environment');var attributes=require(_0x6eb3('0x7'));module[_0x6eb3('0x8')]=function(_0x39a087,_0x445cb2){return _0x39a087[_0x6eb3('0x9')](_0x6eb3('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4eb=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x16da03,_0x2b276e){var _0x598215=function(_0x5366c0){while(--_0x5366c0){_0x16da03['push'](_0x16da03['shift']());}};_0x598215(++_0x2b276e);}(_0xe4eb,0xaf));var _0xbe4e=function(_0x3377ef,_0xcd2120){_0x3377ef=_0x3377ef-0x0;var _0x3d2638=_0xe4eb[_0x3377ef];return _0x3d2638;};'use strict';var _=require(_0xbe4e('0x0'));var util=require(_0xbe4e('0x1'));var logger=require(_0xbe4e('0x2'))(_0xbe4e('0x3'));var moment=require(_0xbe4e('0x4'));var BPromise=require(_0xbe4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe4e('0x6'));var rimraf=require(_0xbe4e('0x7'));var config=require(_0xbe4e('0x8'));var attributes=require(_0xbe4e('0x9'));module[_0xbe4e('0xa')]=function(_0x4659fb,_0x4e25c9){return _0x4659fb[_0xbe4e('0xb')](_0xbe4e('0xc'),attributes,{'tableName':_0xbe4e('0xd'),'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 e1696a2..a3d25f2 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 _0x56e5=['../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x2148ad,_0x2cc73f){var _0xa54f3=function(_0x30151f){while(--_0x30151f){_0x2148ad['push'](_0x2148ad['shift']());}};_0xa54f3(++_0x2cc73f);}(_0x56e5,0x174));var _0x556e=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x56e5[_0x12d6c2];return _0x1c9825;};'use strict';var _=require('lodash');var util=require(_0x556e('0x0'));var moment=require('moment');var BPromise=require(_0x556e('0x1'));var rs=require(_0x556e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x556e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x556e('0x4'))(_0x556e('0x5'));var config=require(_0x556e('0x6'));var jayson=require(_0x556e('0x7'));var client=jayson[_0x556e('0x8')][_0x556e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x417ebf,_0x390341,_0x5c7d24){return new BPromise(function(_0x4e4586,_0x883741){return client[_0x556e('0xa')](_0x417ebf,_0x5c7d24)[_0x556e('0xb')](function(_0x747667){logger['info'](_0x556e('0xc'),_0x390341,_0x556e('0xd'));logger[_0x556e('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x390341,_0x556e('0xd'),JSON[_0x556e('0xf')](_0x747667));if(_0x747667[_0x556e('0x10')]){if(_0x747667['error'][_0x556e('0x11')]===0x1f4){logger[_0x556e('0x10')](_0x556e('0xc'),_0x390341,_0x747667[_0x556e('0x10')]['message']);return _0x883741(_0x747667[_0x556e('0x10')][_0x556e('0x12')]);}logger[_0x556e('0x10')](_0x556e('0xc'),_0x390341,_0x747667[_0x556e('0x10')][_0x556e('0x12')]);return _0x4e4586(_0x747667[_0x556e('0x10')]['message']);}else{logger[_0x556e('0x13')](_0x556e('0xc'),_0x390341,_0x556e('0xd'));_0x4e4586(_0x747667[_0x556e('0x14')][_0x556e('0x12')]);}})[_0x556e('0x15')](function(_0x4d8375){logger[_0x556e('0x10')](_0x556e('0xc'),_0x390341,_0x4d8375);_0x883741(_0x4d8375);});});}exports[_0x556e('0x16')]=function(_0x5461af){var _0x293a9d=this;return new Promise(function(_0x56f80a,_0x545469){return db[_0x556e('0x17')][_0x556e('0x18')](_0x5461af['body'],{'raw':_0x5461af[_0x556e('0x19')]?_0x5461af[_0x556e('0x19')][_0x556e('0x1a')]===undefined?!![]:![]:!![]})[_0x556e('0xb')](function(_0x476718){logger[_0x556e('0x13')](_0x556e('0x16'),_0x5461af);logger['debug'](_0x556e('0x16'),_0x5461af,JSON[_0x556e('0xf')](_0x476718));_0x56f80a(_0x476718);})[_0x556e('0x15')](function(_0xd80a3f){logger['error'](_0x556e('0x16'),_0xd80a3f[_0x556e('0x12')],_0x5461af);_0x545469(_0x293a9d['error'](0x1f4,_0xd80a3f[_0x556e('0x12')]));});});}; \ No newline at end of file +var _0xd109=['http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','catch','CreateReportAgentPreview','create','body','options','raw','stringify','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client'];(function(_0x576f07,_0x200fb4){var _0x3c85e3=function(_0x5e8db7){while(--_0x5e8db7){_0x576f07['push'](_0x576f07['shift']());}};_0x3c85e3(++_0x200fb4);}(_0xd109,0x10b));var _0x9d10=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd109[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x9d10('0x0'));var moment=require(_0x9d10('0x1'));var BPromise=require('bluebird');var rs=require(_0x9d10('0x2'));var fs=require('fs');var Redis=require(_0x9d10('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d10('0x4'))(_0x9d10('0x5'));var config=require(_0x9d10('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9d10('0x7')][_0x9d10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5505d7,_0x13927e,_0x34b5a2){return new BPromise(function(_0x1af00e,_0x3a68d2){return client[_0x9d10('0x9')](_0x5505d7,_0x34b5a2)[_0x9d10('0xa')](function(_0x5ab23c){logger[_0x9d10('0xb')](_0x9d10('0xc'),_0x13927e,_0x9d10('0xd'));logger[_0x9d10('0xe')](_0x9d10('0xf'),_0x13927e,_0x9d10('0xd'),JSON['stringify'](_0x5ab23c));if(_0x5ab23c[_0x9d10('0x10')]){if(_0x5ab23c[_0x9d10('0x10')]['code']===0x1f4){logger[_0x9d10('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x13927e,_0x5ab23c[_0x9d10('0x10')][_0x9d10('0x11')]);return _0x3a68d2(_0x5ab23c['error']['message']);}logger[_0x9d10('0x10')](_0x9d10('0xc'),_0x13927e,_0x5ab23c[_0x9d10('0x10')][_0x9d10('0x11')]);return _0x1af00e(_0x5ab23c['error'][_0x9d10('0x11')]);}else{logger[_0x9d10('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x13927e,_0x9d10('0xd'));_0x1af00e(_0x5ab23c['result'][_0x9d10('0x11')]);}})[_0x9d10('0x12')](function(_0x477662){logger[_0x9d10('0x10')](_0x9d10('0xc'),_0x13927e,_0x477662);_0x3a68d2(_0x477662);});});}exports[_0x9d10('0x13')]=function(_0x440150){var _0x342f25=this;return new Promise(function(_0x365a0b,_0x189e66){return db['ReportAgentPreview'][_0x9d10('0x14')](_0x440150[_0x9d10('0x15')],{'raw':_0x440150[_0x9d10('0x16')]?_0x440150[_0x9d10('0x16')][_0x9d10('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3c40af){logger[_0x9d10('0xb')](_0x9d10('0x13'),_0x440150);logger[_0x9d10('0xe')](_0x9d10('0x13'),_0x440150,JSON[_0x9d10('0x18')](_0x3c40af));_0x365a0b(_0x3c40af);})['catch'](function(_0xdd8c43){logger[_0x9d10('0x10')](_0x9d10('0x13'),_0xdd8c43[_0x9d10('0x11')],_0x440150);_0x189e66(_0x342f25[_0x9d10('0x10')](0x1f4,_0xdd8c43[_0x9d10('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 183057f..98ad3c8 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 _0xe12d=['telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones'];(function(_0x5bc8d1,_0x5800fe){var _0x5db7d0=function(_0x5a9756){while(--_0x5a9756){_0x5bc8d1['push'](_0x5bc8d1['shift']());}};_0x5db7d0(++_0x5800fe);}(_0xe12d,0xc8));var _0xde12=function(_0x45c846,_0x444500){_0x45c846=_0x45c846-0x0;var _0x2fec58=_0xe12d[_0x45c846];return _0x2fec58;};'use strict';var multer=require(_0xde12('0x0'));var util=require(_0xde12('0x1'));var path=require(_0xde12('0x2'));var express=require(_0xde12('0x3'));var router=express[_0xde12('0x4')]();var auth=require(_0xde12('0x5'));var controller=require(_0xde12('0x6'));router[_0xde12('0x7')](_0xde12('0x8'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xde12('0x7')](_0xde12('0x9'),auth[_0xde12('0xa')](),controller[_0xde12('0xb')]);router[_0xde12('0x7')](_0xde12('0xc'),auth[_0xde12('0xa')](),controller['voiceChannelStopMixMonitor']);router[_0xde12('0x7')]('/voice/queues',auth[_0xde12('0xa')](),controller[_0xde12('0xd')]);router[_0xde12('0x7')](_0xde12('0xe'),auth[_0xde12('0xa')](),controller[_0xde12('0xf')]);router[_0xde12('0x7')]('/mail/queues',auth[_0xde12('0xa')](),controller[_0xde12('0x10')]);router[_0xde12('0x7')](_0xde12('0x11'),auth[_0xde12('0xa')](),controller[_0xde12('0x12')]);router[_0xde12('0x7')]('/openchannel/queues',auth[_0xde12('0xa')](),controller[_0xde12('0x13')]);router[_0xde12('0x7')](_0xde12('0x14'),auth['isAuthenticated'](),controller[_0xde12('0x15')]);router[_0xde12('0x7')](_0xde12('0x16'),auth[_0xde12('0xa')](),controller[_0xde12('0x17')]);router[_0xde12('0x7')]('/fax/queues',auth[_0xde12('0xa')](),controller[_0xde12('0x18')]);router[_0xde12('0x7')]('/voice/queues/preview/:id',auth[_0xde12('0xa')](),controller[_0xde12('0x19')]);router[_0xde12('0x7')]('/voice/queues/channels',auth[_0xde12('0xa')](),controller['voiceQueuesChannels']);router[_0xde12('0x7')](_0xde12('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xde12('0x7')](_0xde12('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router['get'](_0xde12('0x1c'),auth[_0xde12('0xa')](),controller[_0xde12('0x1d')]);router[_0xde12('0x7')](_0xde12('0x1e'),auth[_0xde12('0xa')](),controller['showVoiceQueues']);router[_0xde12('0x1f')](_0xde12('0x1e'),auth['isAuthenticated'](),controller[_0xde12('0x20')]);router[_0xde12('0x7')](_0xde12('0x21'),auth[_0xde12('0xa')](),controller['outbound']);router[_0xde12('0x7')](_0xde12('0x22'),auth[_0xde12('0xa')](),controller[_0xde12('0x23')]);router[_0xde12('0x7')]('/agents',auth[_0xde12('0xa')](),controller[_0xde12('0x24')]);router[_0xde12('0x1f')](_0xde12('0x25'),auth[_0xde12('0xa')](),controller[_0xde12('0x26')]);router['get'](_0xde12('0x27'),auth[_0xde12('0xa')](),controller[_0xde12('0x28')]);router[_0xde12('0x7')](_0xde12('0x29'),auth[_0xde12('0xa')](),controller[_0xde12('0x2a')]);router['get'](_0xde12('0x2b'),auth[_0xde12('0xa')](),controller['campaigns']);router['get'](_0xde12('0x2c'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0xde12('0x7')](_0xde12('0x2d'),auth['isAuthenticated'](),controller[_0xde12('0x2e')]);router['get'](_0xde12('0x2f'),auth[_0xde12('0xa')](),controller[_0xde12('0x30')]);router[_0xde12('0x7')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xde12('0x7')](_0xde12('0x31'),auth[_0xde12('0xa')](),controller[_0xde12('0x32')]);router['get'](_0xde12('0x33'),auth[_0xde12('0xa')](),controller[_0xde12('0x34')]);router[_0xde12('0x7')](_0xde12('0x35'),auth['isAuthenticated'](),controller[_0xde12('0x36')]);router['get'](_0xde12('0x37'),auth[_0xde12('0xa')](),controller[_0xde12('0x38')]);router[_0xde12('0x39')](_0xde12('0x3a'),auth[_0xde12('0xa')](),controller[_0xde12('0x3b')]('mail'));router[_0xde12('0x7')]('/mail/queues/:id',auth[_0xde12('0xa')](),controller[_0xde12('0x3c')]);router[_0xde12('0x39')](_0xde12('0x3d'),auth['isAuthenticated'](),controller[_0xde12('0x3b')]('chat'));router[_0xde12('0x7')](_0xde12('0x3e'),auth[_0xde12('0xa')](),controller[_0xde12('0x3f')]);router[_0xde12('0x39')](_0xde12('0x40'),auth['isAuthenticated'](),controller[_0xde12('0x3b')](_0xde12('0x41')));router['get'](_0xde12('0x42'),auth[_0xde12('0xa')](),controller['showFaxQueues']);router['post'](_0xde12('0x43'),auth[_0xde12('0xa')](),controller[_0xde12('0x3b')](_0xde12('0x44')));router[_0xde12('0x7')](_0xde12('0x45'),auth['isAuthenticated'](),controller[_0xde12('0x46')]);router[_0xde12('0x39')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xde12('0x3b')]('sms'));router['post'](_0xde12('0x47'),auth[_0xde12('0xa')](),controller['queueNotify'](_0xde12('0x48')));router['get'](_0xde12('0x49'),auth[_0xde12('0xa')](),controller[_0xde12('0x4a')]);router[_0xde12('0x7')](_0xde12('0x4b'),auth['isAuthenticated'](),controller[_0xde12('0x4c')]);router[_0xde12('0x39')](_0xde12('0x4d'),auth['isAuthenticated'](),controller[_0xde12('0x4e')]);module[_0xde12('0x4f')]=router; \ No newline at end of file +var _0x182e=['outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','whatsappQueues','faxQueues','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels'];(function(_0x441dd4,_0x582db9){var _0x54ea8b=function(_0x308f42){while(--_0x308f42){_0x441dd4['push'](_0x441dd4['shift']());}};_0x54ea8b(++_0x582db9);}(_0x182e,0x116));var _0xe182=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x182e[_0x1bc0ae];return _0x501104;};'use strict';var multer=require(_0xe182('0x0'));var util=require(_0xe182('0x1'));var path=require(_0xe182('0x2'));var express=require(_0xe182('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0xe182('0x4')]('/voice/channels',auth[_0xe182('0x5')](),controller[_0xe182('0x6')]);router[_0xe182('0x4')](_0xe182('0x7'),auth[_0xe182('0x5')](),controller[_0xe182('0x8')]);router[_0xe182('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xe182('0x5')](),controller[_0xe182('0x9')]);router[_0xe182('0x4')](_0xe182('0xa'),auth['isAuthenticated'](),controller[_0xe182('0xb')]);router[_0xe182('0x4')]('/chat/queues',auth['isAuthenticated'](),controller[_0xe182('0xc')]);router[_0xe182('0x4')](_0xe182('0xd'),auth[_0xe182('0x5')](),controller[_0xe182('0xe')]);router[_0xe182('0x4')](_0xe182('0xf'),auth['isAuthenticated'](),controller[_0xe182('0x10')]);router['get'](_0xe182('0x11'),auth[_0xe182('0x5')](),controller[_0xe182('0x12')]);router['get']('/sms/queues',auth[_0xe182('0x5')](),controller['smsQueues']);router[_0xe182('0x4')]('/whatsapp/queues',auth[_0xe182('0x5')](),controller[_0xe182('0x13')]);router['get']('/fax/queues',auth[_0xe182('0x5')](),controller[_0xe182('0x14')]);router[_0xe182('0x4')]('/voice/queues/preview/:id',auth[_0xe182('0x5')](),controller['voiceQueuesPreview']);router[_0xe182('0x4')]('/voice/queues/channels',auth[_0xe182('0x5')](),controller[_0xe182('0x15')]);router[_0xe182('0x4')](_0xe182('0x16'),auth[_0xe182('0x5')](),controller[_0xe182('0x17')]);router[_0xe182('0x4')](_0xe182('0x18'),auth['isAuthenticated'](),controller[_0xe182('0x19')]);router['get'](_0xe182('0x1a'),auth[_0xe182('0x5')](),controller[_0xe182('0x1b')]);router[_0xe182('0x4')](_0xe182('0x1c'),auth[_0xe182('0x5')](),controller['showVoiceQueues']);router[_0xe182('0x1d')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xe182('0x1e')]);router[_0xe182('0x4')](_0xe182('0x1f'),auth[_0xe182('0x5')](),controller[_0xe182('0x20')]);router[_0xe182('0x4')](_0xe182('0x21'),auth['isAuthenticated'](),controller[_0xe182('0x22')]);router['get']('/agents',auth['isAuthenticated'](),controller[_0xe182('0x23')]);router['put'](_0xe182('0x24'),auth['isAuthenticated'](),controller[_0xe182('0x25')]);router[_0xe182('0x4')](_0xe182('0x26'),auth['isAuthenticated'](),controller[_0xe182('0x27')]);router['get']('/trunks',auth[_0xe182('0x5')](),controller['trunks']);router[_0xe182('0x4')]('/campaigns',auth['isAuthenticated'](),controller['campaigns']);router[_0xe182('0x4')](_0xe182('0x28'),auth[_0xe182('0x5')](),controller[_0xe182('0x29')]);router[_0xe182('0x4')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xe182('0x2a')]);router[_0xe182('0x4')](_0xe182('0x2b'),auth[_0xe182('0x5')](),controller[_0xe182('0x2c')]);router[_0xe182('0x4')](_0xe182('0x2d'),auth[_0xe182('0x5')](),controller[_0xe182('0x2e')]);router[_0xe182('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0xe182('0x5')](),controller[_0xe182('0x2f')]);router['get']('/sms/queues/waitinginteractions',auth[_0xe182('0x5')](),controller[_0xe182('0x30')]);router[_0xe182('0x4')](_0xe182('0x31'),auth[_0xe182('0x5')](),controller[_0xe182('0x32')]);router[_0xe182('0x4')](_0xe182('0x33'),auth[_0xe182('0x5')](),controller[_0xe182('0x34')]);router[_0xe182('0x35')](_0xe182('0x36'),auth[_0xe182('0x5')](),controller[_0xe182('0x37')](_0xe182('0x38')));router[_0xe182('0x4')](_0xe182('0x39'),auth[_0xe182('0x5')](),controller[_0xe182('0x3a')]);router[_0xe182('0x35')](_0xe182('0x3b'),auth['isAuthenticated'](),controller[_0xe182('0x37')]('chat'));router[_0xe182('0x4')]('/chat/queues/:id',auth[_0xe182('0x5')](),controller[_0xe182('0x3c')]);router[_0xe182('0x35')](_0xe182('0x3d'),auth[_0xe182('0x5')](),controller['queueNotify'](_0xe182('0x3e')));router['get'](_0xe182('0x3f'),auth[_0xe182('0x5')](),controller[_0xe182('0x40')]);router[_0xe182('0x35')](_0xe182('0x41'),auth['isAuthenticated'](),controller[_0xe182('0x37')](_0xe182('0x42')));router[_0xe182('0x4')](_0xe182('0x43'),auth[_0xe182('0x5')](),controller[_0xe182('0x44')]);router['post'](_0xe182('0x45'),auth[_0xe182('0x5')](),controller[_0xe182('0x37')]('sms'));router[_0xe182('0x35')](_0xe182('0x46'),auth[_0xe182('0x5')](),controller[_0xe182('0x37')](_0xe182('0x47')));router['get']('/sms/queues/:id',auth[_0xe182('0x5')](),controller[_0xe182('0x48')]);router[_0xe182('0x4')](_0xe182('0x49'),auth[_0xe182('0x5')](),controller[_0xe182('0x4a')]);router[_0xe182('0x35')](_0xe182('0x4b'),auth['isAuthenticated'](),controller[_0xe182('0x4c')]);module[_0xe182('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 74ebf14..5d6f292 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 _0x032e=['MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','uniq','value','filter','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','Interaction','update','queue','MessageId','InteractionId','From','TransferReport','agentNotify','Channel\x20field\x20is\x20mandatory','channel','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','create','Start','bluebird','lodash','util','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var BPromise=require(_0xe032('0x0'));var moment=require('moment');var _=require(_0xe032('0x1'));var util=require(_0xe032('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe032('0x3'));var jayson=require(_0xe032('0x4'));var amiClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232a});var mailClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232b});var routingClient=jayson[_0xe032('0x5')][_0xe032('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){var _0x3b0ef8=_0x3289b0?_0x3289b0:amiClient;return _0x3b0ef8[_0xe032('0x7')](_0x37432f,_0x1576c8)[_0xe032('0x8')](function(_0x2dc9e5){if(_0x2dc9e5[_0xe032('0x9')]){if(_0x2dc9e5['error'][_0xe032('0xa')]===0x1f4){return _0xaf3907(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}return _0xd84027(_0x2dc9e5[_0xe032('0x9')][_0xe032('0xb')]);}else{_0xd84027(_0x2dc9e5[_0xe032('0xc')]);}})[_0xe032('0xd')](function(_0x5bcb5b){_0xaf3907(_0x5bcb5b);});});}function respondWithResult(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xc8;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0xe')](_0x266d71)['json'](_0x28c2b6);}return _0x646979[_0xe032('0xf')](0x194);};}function handleError(_0x2e267b,_0x176547){_0x176547=_0x176547||0x1f4;return function(_0x422e96){logger[_0xe032('0x9')](_0x422e96[_0xe032('0x10')]);if(_0x422e96[_0xe032('0x11')]){delete _0x422e96['name'];}_0x2e267b[_0xe032('0xe')](_0x176547)[_0xe032('0x12')](_0x422e96);};}function findById(_0x36fb7c){return function(_0x3b57d3){if(!_[_0xe032('0x13')](_0x36fb7c)&&!_[_0xe032('0x13')](_0x3b57d3)&&!_['isNil'](_0x3b57d3[_0xe032('0x14')])){return _[_0xe032('0x15')](_0x3b57d3[_0xe032('0x14')],function(_0x41d2a5){return _0x41d2a5['id']==_0x36fb7c;});}return null;};}exports[_0xe032('0x16')]=function(_0x5721ce,_0x4b644b){return respondWithRpcPromise('VoiceChannels',_0x5721ce[_0xe032('0x17')])['then'](respondWithResult(_0x4b644b,null))[_0xe032('0xd')](handleError(_0x4b644b,null));};exports[_0xe032('0x18')]=function(_0x3f0257,_0x2aa342){return respondWithRpcPromise(_0xe032('0x19'),_[_0xe032('0x1a')](_0x3f0257[_0xe032('0x17')],_0x3f0257['params']))[_0xe032('0x8')](respondWithResult(_0x2aa342,null))[_0xe032('0xd')](handleError(_0x2aa342,null));};exports[_0xe032('0x1b')]=function(_0x2be433,_0x2ca592){return respondWithRpcPromise(_0xe032('0x1c'),_[_0xe032('0x1a')](_0x2be433[_0xe032('0x17')],_0x2be433['params']))['then'](respondWithResult(_0x2ca592,null))['catch'](handleError(_0x2ca592,null));};exports[_0xe032('0x1d')]=function(_0x2568ce,_0x302559){return respondWithRpcPromise(_0xe032('0x1e'),_0x2568ce[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x302559,null))[_0xe032('0xd')](handleError(_0x302559,null));};exports[_0xe032('0x1f')]=function(_0x4dcbf1,_0x1ac20b){return respondWithRpcPromise('VoiceQueues',_0x4dcbf1[_0xe032('0x17')])[_0xe032('0x8')](findById(_0x4dcbf1[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x1ac20b,null))['catch'](handleError(_0x1ac20b,null));};exports['updateVoiceQueue']=function(_0x3e2575,_0x38e7ea){return respondWithRpcPromise(_0xe032('0x21'),_[_0xe032('0x1a')](_0x3e2575['body'],_0x3e2575['params']))['then'](respondWithResult(_0x38e7ea,null))[_0xe032('0xd')](handleError(_0x38e7ea,null));};exports[_0xe032('0x22')]=function(_0x5518ac,_0x707b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xe032('0x1a')](_0x5518ac[_0xe032('0x17')],_0x5518ac[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x707b,null))[_0xe032('0xd')](handleError(_0x707b,null));};exports['voiceQueuesChannels']=function(_0xd90bd5,_0x33634c){return respondWithRpcPromise(_0xe032('0x23'),_0xd90bd5[_0xe032('0x17')])['then'](respondWithResult(_0x33634c,null))[_0xe032('0xd')](handleError(_0x33634c,null));};exports['voiceQueuesChannel']=function(_0x2f3e59,_0x53df28){return respondWithRpcPromise(_0xe032('0x24'),_['merge'](_0x2f3e59[_0xe032('0x17')],_0x2f3e59['params']))[_0xe032('0x8')](respondWithResult(_0x53df28,null))[_0xe032('0xd')](handleError(_0x53df28,null));};exports['voiceQueuesChannelHangup']=function(_0x3e3598,_0x2fdf41){return respondWithRpcPromise(_0xe032('0x25'),_[_0xe032('0x1a')](_0x3e3598['query'],_0x3e3598[_0xe032('0x20')]))['then'](respondWithResult(_0x2fdf41,null))[_0xe032('0xd')](handleError(_0x2fdf41,null));};exports[_0xe032('0x26')]=function(_0x5d02c1,_0x450ba4){return respondWithRpcPromise(_0xe032('0x27'),_['merge'](_0x5d02c1[_0xe032('0x17')],_0x5d02c1[_0xe032('0x20')]))[_0xe032('0x8')](respondWithResult(_0x450ba4,null))[_0xe032('0xd')](handleError(_0x450ba4,null));};exports[_0xe032('0x28')]=function(_0x42f58a,_0x19ee0a){return respondWithRpcPromise(_0xe032('0x29'),_0x42f58a[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x19ee0a,null))[_0xe032('0xd')](handleError(_0x19ee0a,null));};exports[_0xe032('0x2a')]=function(_0x30571c,_0x28ba5d){return respondWithRpcPromise(_0xe032('0x2b'),_0x30571c[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x28ba5d,null))['catch'](handleError(_0x28ba5d,null));};exports[_0xe032('0x2c')]=function(_0x536c76,_0x3d02c1){var _0x2bcfb4;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76[_0xe032('0x17')])[_0xe032('0x8')](function(_0x5eccad){_0x2bcfb4=_0x5eccad;return respondWithRpcPromise(_0xe032('0x2d'),_0x536c76['query'],routingClient);})[_0xe032('0x8')](function(_0x590be2){return _[_0xe032('0x1a')]({},_0x590be2,_0x2bcfb4);})[_0xe032('0x8')](respondWithResult(_0x3d02c1,null))[_0xe032('0xd')](handleError(_0x3d02c1,null));};exports[_0xe032('0x2e')]=function(_0x4dc836,_0x477360){if(_0x4dc836['body']&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]&&_0x4dc836[_0xe032('0x31')]&&_0x4dc836[_0xe032('0x31')]['name']){for(var _0x513b0c in _0x4dc836[_0xe032('0x2f')][_0xe032('0x30')]){if(_0x4dc836['body'][_0xe032('0x30')][_0xe032('0x32')](_0x513b0c)){db[_0xe032('0x33')][_0xe032('0x34')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'type':_0xe032('0x35'),'exitAt':null,'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]&&_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')]?{'$notIn':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c]}:{'$ne':null}}})['then'](function(_0x535f34){var _0x1b0e28=moment()['format'](_0xe032('0x37'));for(var _0x277207=0x0,_0x1873a6=_0x535f34[_0xe032('0x36')];_0x277207<_0x1873a6;_0x277207+=0x1){_0x535f34[_0x277207][_0xe032('0x38')]({'exitAt':_0x1b0e28});}});for(var _0x3dfb51=0x0;_0x3dfb51<_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0xe032('0x36')];_0x3dfb51+=0x1){db['MemberReport'][_0xe032('0x39')]({'where':{'channel':_0x513b0c,'membername':_0x4dc836['user']['name'],'type':_0xe032('0x35'),'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51],'exitAt':null},'defaults':{'channel':_0x513b0c,'membername':_0x4dc836[_0xe032('0x31')]['name'],'interface':_[_0xe032('0x13')](_0x4dc836[_0xe032('0x31')][_0xe032('0x3a')])?util[_0xe032('0x3b')](_0xe032('0x3c'),_0x4dc836[_0xe032('0x31')][_0xe032('0x11')]):_0x4dc836['user'][_0xe032('0x3a')],'type':_0xe032('0x35'),'enterAt':moment()['format'](_0xe032('0x37')),'role':_0xe032('0x3d'),'internal':_0x4dc836[_0xe032('0x31')][_0xe032('0x3e')],'uniqueid':_0x4dc836[_0xe032('0x2f')][_0xe032('0x30')][_0x513b0c][_0x3dfb51]}});}}}}return respondWithRpcPromise(_0xe032('0x3f'),{'id':_0x4dc836[_0xe032('0x20')]['id'],'capacity':_0x4dc836[_0xe032('0x2f')][_0xe032('0x40')]},routingClient)[_0xe032('0x8')](respondWithResult(_0x477360,null))[_0xe032('0xd')](handleError(_0x477360,null));};exports[_0xe032('0x41')]=function(_0x2f8114,_0x4eabfc){return respondWithRpcPromise(_0xe032('0x42'),_0x2f8114['query'])[_0xe032('0x8')](respondWithResult(_0x4eabfc,null))[_0xe032('0xd')](handleError(_0x4eabfc,null));};exports[_0xe032('0x43')]=function(_0x11ae58,_0x41289d){return respondWithRpcPromise(_0xe032('0x44'),_0x11ae58[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x41289d,null))[_0xe032('0xd')](handleError(_0x41289d,null));};exports[_0xe032('0x45')]=function(_0x1b9012,_0x564fe0){return respondWithRpcPromise(_0xe032('0x46'),_0x1b9012[_0xe032('0x17')])['then'](respondWithResult(_0x564fe0,null))[_0xe032('0xd')](handleError(_0x564fe0,null));};exports['chatQueues']=function(_0x39b878,_0x1f2422){return respondWithRpcPromise(_0xe032('0x47'),_0x39b878[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1f2422,null))['catch'](handleError(_0x1f2422,null));};exports[_0xe032('0x48')]=function(_0x2dbc33,_0x1e1277){return respondWithRpcPromise(_0xe032('0x47'),_0x2dbc33[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x2dbc33[_0xe032('0x20')]['id']))['then'](respondWithResult(_0x1e1277,null))[_0xe032('0xd')](handleError(_0x1e1277,null));};exports[_0xe032('0x49')]=function(_0x454b29,_0x15325e){return respondWithRpcPromise(_0xe032('0x4a'),_0x454b29[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x15325e,null))[_0xe032('0xd')](handleError(_0x15325e,null));};exports[_0xe032('0x4b')]=function(_0x54c0b0,_0x795a58){return respondWithRpcPromise(_0xe032('0x4a'),_0x54c0b0[_0xe032('0x17')],routingClient)['then'](findById(_0x54c0b0[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x795a58,null))['catch'](handleError(_0x795a58,null));};exports[_0xe032('0x4c')]=function(_0x29dfa7,_0x43ad0d){return respondWithRpcPromise(_0xe032('0x4d'),_0x29dfa7[_0xe032('0x17')],mailClient)[_0xe032('0x8')](respondWithResult(_0x43ad0d,null))[_0xe032('0xd')](handleError(_0x43ad0d,null));};exports[_0xe032('0x4e')]=function(_0x1aa18e,_0x19ce2b){return respondWithRpcPromise(_0xe032('0x4f'),_0x1aa18e['query'],routingClient)[_0xe032('0x8')](respondWithResult(_0x19ce2b,null))[_0xe032('0xd')](handleError(_0x19ce2b,null));};exports[_0xe032('0x50')]=function(_0xd5cf55,_0x3d7a3f){return respondWithRpcPromise('OpenchannelQueues',_0xd5cf55[_0xe032('0x17')],routingClient)['then'](findById(_0xd5cf55[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x3d7a3f,null))[_0xe032('0xd')](handleError(_0x3d7a3f,null));};exports[_0xe032('0x51')]=function(_0x3c5eb8,_0x1ddb11){return respondWithRpcPromise(_0xe032('0x52'),_0x3c5eb8[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1ddb11,null))['catch'](handleError(_0x1ddb11,null));};exports['showSmsQueues']=function(_0x5c516a,_0x221473){return respondWithRpcPromise(_0xe032('0x52'),_0x5c516a[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x5c516a[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x221473,null))['catch'](handleError(_0x221473,null));};exports[_0xe032('0x53')]=function(_0x1d66c3,_0x1018d4){return respondWithRpcPromise('WhatsappQueues',_0x1d66c3[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x1018d4,null))[_0xe032('0xd')](handleError(_0x1018d4,null));};exports[_0xe032('0x54')]=function(_0x48063d,_0x590905){return respondWithRpcPromise('WhatsappQueues',_0x48063d[_0xe032('0x17')],routingClient)['then'](findById(_0x48063d['params']['id']))[_0xe032('0x8')](respondWithResult(_0x590905,null))[_0xe032('0xd')](handleError(_0x590905,null));};exports[_0xe032('0x55')]=function(_0x4ed078,_0x193a0f){return respondWithRpcPromise('FaxQueues',_0x4ed078[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x193a0f,null))[_0xe032('0xd')](handleError(_0x193a0f,null));};exports[_0xe032('0x56')]=function(_0x1f24ec,_0x2b987b){return respondWithRpcPromise(_0xe032('0x57'),_0x1f24ec[_0xe032('0x17')],routingClient)[_0xe032('0x8')](findById(_0x1f24ec[_0xe032('0x20')]['id']))[_0xe032('0x8')](respondWithResult(_0x2b987b,null))['catch'](handleError(_0x2b987b,null));};exports[_0xe032('0x58')]=function(_0x338ef2,_0x5aa7a6){return respondWithRpcPromise('FaxAccounts',_0x338ef2[_0xe032('0x17')])[_0xe032('0x8')](respondWithResult(_0x5aa7a6,null))[_0xe032('0xd')](handleError(_0x5aa7a6,null));};exports[_0xe032('0x59')]=function(_0x1e38bd,_0x23922e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1e38bd[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x23922e,null))['catch'](handleError(_0x23922e,null));};exports[_0xe032('0x5a')]=function(_0x2ea4a5,_0x1c3601){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2ea4a5[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0x1c3601,null))[_0xe032('0xd')](handleError(_0x1c3601,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52dfa0,_0xdd691c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52dfa0[_0xe032('0x17')],routingClient)[_0xe032('0x8')](respondWithResult(_0xdd691c,null))[_0xe032('0xd')](handleError(_0xdd691c,null));};exports[_0xe032('0x5b')]=function(_0x37af62,_0x443fcc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37af62[_0xe032('0x17')],routingClient)[_0xe032('0x8')](function(_0x33e7c3){if(_0x37af62['query'][_0xe032('0x5c')]!==undefined){var _0x48e9c9=_(_0x33e7c3[_0xe032('0x14')])['filter']([_0x37af62[_0xe032('0x17')][_0xe032('0x5c')],_0x37af62[_0xe032('0x20')]['id']])['map'](_0xe032('0x5d'))[_0xe032('0x5e')]()[_0xe032('0x5f')]();return _0x33e7c3[_0xe032('0x14')][_0xe032('0x60')](function(_0x2a2c98){return _0x48e9c9['indexOf'](_0x2a2c98[_0xe032('0x5d')])>-0x1;});}else{return _0x33e7c3[_0xe032('0x14')]['filter'](function(_0x50fd01){return _0x50fd01[_0xe032('0x5d')]===parseInt(_0x37af62[_0xe032('0x20')]['id']);});}})[_0xe032('0x8')](respondWithResult(_0x443fcc,null))[_0xe032('0xd')](handleError(_0x443fcc,null));};exports[_0xe032('0x61')]=function(_0x54803e,_0x3a04b9){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x54803e[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x3a04b9,null))[_0xe032('0xd')](handleError(_0x3a04b9,null));};exports[_0xe032('0x62')]=function(_0x36137b,_0x2ecdc7){return respondWithRpcPromise(_0xe032('0x63'),_0x36137b[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x2ecdc7,null))[_0xe032('0xd')](handleError(_0x2ecdc7,null));};exports['faxQueuesWaitingInteractions']=function(_0x4ee54a,_0x485458){return respondWithRpcPromise(_0xe032('0x64'),_0x4ee54a[_0xe032('0x17')],routingClient)['then'](respondWithResult(_0x485458,null))[_0xe032('0xd')](handleError(_0x485458,null));};exports['queueNotify']=function(_0x5f42b1){return function(_0x2f2b74,_0x10873b){var _0x577f56,_0x4ab179;var _0x45e28d=_[_0xe032('0x65')](_0x5f42b1);var _0x51d89a=_0x5f42b1===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db[_0x45e28d+_0xe032('0x69')]['findOne']({'raw':!![],'where':{'id':_0x2f2b74[_0xe032('0x20')]['id']}})['then'](function(_0x1caebf){if(_[_0xe032('0x13')](_0x1caebf)){throw new Error(_0x45e28d+_0xe032('0x6a'));}_0x577f56=_0x1caebf;return db[_0x45e28d+'Message'][_0xe032('0x6b')]({'where':{'id':_0x2f2b74[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x45e28d+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x45e28d+_0x51d89a],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3c1b08){if(_[_0xe032('0x13')](_0x3c1b08)){throw new Error(_0x45e28d+'\x20Message\x20not\x20found');}_0x4ab179=_0x3c1b08;return _0x3c1b08[_0xe032('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe032('0x8')](function(){var _0x27eb0c={'uniqueid':_0x5f42b1+'.'+_0x4ab179['id']+'.'+_0x4ab179[_0xe032('0x6c')]['id'],'FromUserId':_0x2f2b74[_0xe032('0x31')]['id'],'type':_0xe032('0x6e')};_0x27eb0c[_0x45e28d+_0xe032('0x6f')]=_0x4ab179['id'];_0x27eb0c[_0x45e28d+_0xe032('0x70')]=_0x4ab179[_0xe032('0x6c')]['id'];_0x27eb0c[_0xe032('0x71')+_0x45e28d+_0x51d89a+'Id']=_0x4ab179[_0xe032('0x68')]['id'];_0x27eb0c['To'+_0x45e28d+'QueueId']=_0x577f56['id'];return db[_0x45e28d+_0xe032('0x72')]['create'](_0x27eb0c);})[_0xe032('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x5f42b1,'interaction':_0x4ab179[_0xe032('0x6c')],'message':_0x4ab179,'account':_0x4ab179[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x577f56[_0xe032('0x11')]+','+(_0x4ab179['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe032('0x8')](respondWithResult(_0x10873b,null))[_0xe032('0xd')](handleError(_0x10873b,null));};};exports[_0xe032('0x73')]=function(_0x4e9f83,_0x210e7a){var _0x2e6dad,_0x2d68aa;if(_['isNil'](_0x4e9f83[_0xe032('0x2f')]['channel'])){throw new Error(_0xe032('0x74'));}var _0x868fad=_0x4e9f83[_0xe032('0x2f')][_0xe032('0x75')];var _0x3ee725=_[_0xe032('0x65')](_0x868fad);var _0x205058=_0x868fad===_0xe032('0x66')?_0xe032('0x67'):_0xe032('0x68');return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e9f83[_0xe032('0x20')]['id'],'role':_0xe032('0x3d')}})[_0xe032('0x8')](function(_0x1d9498){if(_['isNil'](_0x1d9498)){throw new Error(_0xe032('0x76'));}_0x2e6dad=_0x1d9498;return db[_0x3ee725+_0xe032('0x77')][_0xe032('0x6b')]({'where':{'id':_0x4e9f83[_0xe032('0x2f')]['messageId']},'include':[{'model':db[_0x3ee725+_0xe032('0x6c')],'as':_0xe032('0x6c')},{'model':db[_0x3ee725+_0x205058],'as':_0xe032('0x68')}]});})[_0xe032('0x8')](function(_0x3cf0bc){if(_[_0xe032('0x13')](_0x3cf0bc)){throw new Error(_0x3ee725+_0xe032('0x78'));}_0x2d68aa=_0x3cf0bc;return _0x3cf0bc['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x56523f={'uniqueid':_0x868fad+'.'+_0x2d68aa['id']+'.'+_0x2d68aa['Interaction']['id'],'FromUserId':_0x4e9f83['user']['id'],'type':_0xe032('0x6e'),'ToUserId':_0x2e6dad['id']};_0x56523f[_0x3ee725+_0xe032('0x6f')]=_0x2d68aa['id'];_0x56523f[_0x3ee725+_0xe032('0x70')]=_0x2d68aa[_0xe032('0x6c')]['id'];_0x56523f[_0xe032('0x71')+_0x3ee725+_0x205058+'Id']=_0x2d68aa['Account']['id'];return db[_0x3ee725+_0xe032('0x72')][_0xe032('0x79')](_0x56523f);})[_0xe032('0x8')](function(){return respondWithRpcPromise(_0xe032('0x7a'),{'channel':_0x868fad,'interaction':_0x2d68aa[_0xe032('0x6c')],'message':_0x2d68aa,'account':_0x2d68aa[_0xe032('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe032('0x3d'),'appdata':_0x2e6dad[_0xe032('0x11')]+','+(_0x2d68aa[_0xe032('0x68')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x210e7a,null))[_0xe032('0xd')](handleError(_0x210e7a,null));}; \ No newline at end of file +var _0x0e85=['util','../../mysqldb','client','http','request','error','code','message','status','json','sendStatus','stack','send','isNil','find','rows','voiceChannels','VoiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','catch','voiceQueues','VoiceQueues','query','showVoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','name','hasOwnProperty','MemberReport','findAll','format','length','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','update','queue','From','QueueId','TransferReport','Start','queueTransferTimeout','channel','Channel\x20field\x20is\x20mandatory','capitalize','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','MessageId','InteractionId','create','*,*,*,*','bluebird','moment'];(function(_0x2e2a9c,_0xc9041){var _0x521c07=function(_0x1bd957){while(--_0x1bd957){_0x2e2a9c['push'](_0x2e2a9c['shift']());}};_0x521c07(++_0xc9041);}(_0x0e85,0x7c));var _0x50e8=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x0e85[_0x4b7895];return _0x264180;};'use strict';var BPromise=require(_0x50e8('0x0'));var moment=require(_0x50e8('0x1'));var _=require('lodash');var util=require(_0x50e8('0x2'));var db=require(_0x50e8('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require('jayson/promise');var amiClient=jayson[_0x50e8('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x50e8('0x4')][_0x50e8('0x5')]({'port':0x232b});var routingClient=jayson[_0x50e8('0x4')][_0x50e8('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x5e8b01,_0x3ce904,_0x108edc){return new BPromise(function(_0x42665e,_0x988da0){var _0x1fafb0=_0x108edc?_0x108edc:amiClient;return _0x1fafb0[_0x50e8('0x6')](_0x5e8b01,_0x3ce904)['then'](function(_0x11717c){if(_0x11717c[_0x50e8('0x7')]){if(_0x11717c[_0x50e8('0x7')][_0x50e8('0x8')]===0x1f4){return _0x988da0(_0x11717c[_0x50e8('0x7')][_0x50e8('0x9')]);}return _0x42665e(_0x11717c[_0x50e8('0x7')][_0x50e8('0x9')]);}else{_0x42665e(_0x11717c['result']);}})['catch'](function(_0xfc6bb9){_0x988da0(_0xfc6bb9);});});}function respondWithResult(_0x24d381,_0x508377){_0x508377=_0x508377||0xc8;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0xa')](_0x508377)[_0x50e8('0xb')](_0x49e02f);}return _0x24d381[_0x50e8('0xc')](0x194);};}function handleError(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0x1f4;return function(_0x18596f){logger[_0x50e8('0x7')](_0x18596f[_0x50e8('0xd')]);if(_0x18596f['name']){delete _0x18596f['name'];}_0x473aa7[_0x50e8('0xa')](_0x54efd3)[_0x50e8('0xe')](_0x18596f);};}function findById(_0x40c184){return function(_0x291fb7){if(!_[_0x50e8('0xf')](_0x40c184)&&!_[_0x50e8('0xf')](_0x291fb7)&&!_['isNil'](_0x291fb7['rows'])){return _[_0x50e8('0x10')](_0x291fb7[_0x50e8('0x11')],function(_0x40d060){return _0x40d060['id']==_0x40c184;});}return null;};}exports[_0x50e8('0x12')]=function(_0x5dae4e,_0x90c54c){return respondWithRpcPromise(_0x50e8('0x13'),_0x5dae4e['query'])[_0x50e8('0x14')](respondWithResult(_0x90c54c,null))['catch'](handleError(_0x90c54c,null));};exports[_0x50e8('0x15')]=function(_0xe04a5c,_0xd263d){return respondWithRpcPromise(_0x50e8('0x16'),_[_0x50e8('0x17')](_0xe04a5c['query'],_0xe04a5c[_0x50e8('0x18')]))[_0x50e8('0x14')](respondWithResult(_0xd263d,null))['catch'](handleError(_0xd263d,null));};exports[_0x50e8('0x19')]=function(_0x41500f,_0x5691b2){return respondWithRpcPromise(_0x50e8('0x1a'),_[_0x50e8('0x17')](_0x41500f['query'],_0x41500f['params']))['then'](respondWithResult(_0x5691b2,null))[_0x50e8('0x1b')](handleError(_0x5691b2,null));};exports[_0x50e8('0x1c')]=function(_0x124402,_0x371a1f){return respondWithRpcPromise(_0x50e8('0x1d'),_0x124402[_0x50e8('0x1e')])['then'](respondWithResult(_0x371a1f,null))[_0x50e8('0x1b')](handleError(_0x371a1f,null));};exports[_0x50e8('0x1f')]=function(_0x4b3a09,_0x177201){return respondWithRpcPromise(_0x50e8('0x1d'),_0x4b3a09[_0x50e8('0x1e')])[_0x50e8('0x14')](findById(_0x4b3a09['params']['id']))[_0x50e8('0x14')](respondWithResult(_0x177201,null))['catch'](handleError(_0x177201,null));};exports[_0x50e8('0x20')]=function(_0x39c0c6,_0x42bbef){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x50e8('0x17')](_0x39c0c6[_0x50e8('0x21')],_0x39c0c6[_0x50e8('0x18')]))[_0x50e8('0x14')](respondWithResult(_0x42bbef,null))[_0x50e8('0x1b')](handleError(_0x42bbef,null));};exports[_0x50e8('0x22')]=function(_0x2c6fb3,_0x54d81d){return respondWithRpcPromise(_0x50e8('0x23'),_[_0x50e8('0x17')](_0x2c6fb3['query'],_0x2c6fb3['params']))[_0x50e8('0x14')](respondWithResult(_0x54d81d,null))[_0x50e8('0x1b')](handleError(_0x54d81d,null));};exports[_0x50e8('0x24')]=function(_0x47ace2,_0x594187){return respondWithRpcPromise(_0x50e8('0x25'),_0x47ace2[_0x50e8('0x1e')])['then'](respondWithResult(_0x594187,null))[_0x50e8('0x1b')](handleError(_0x594187,null));};exports[_0x50e8('0x26')]=function(_0x38df5a,_0x40e09d){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x50e8('0x17')](_0x38df5a['query'],_0x38df5a[_0x50e8('0x18')]))[_0x50e8('0x14')](respondWithResult(_0x40e09d,null))[_0x50e8('0x1b')](handleError(_0x40e09d,null));};exports['voiceQueuesChannelHangup']=function(_0x306816,_0x40f566){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x50e8('0x17')](_0x306816[_0x50e8('0x1e')],_0x306816[_0x50e8('0x18')]))[_0x50e8('0x14')](respondWithResult(_0x40f566,null))['catch'](handleError(_0x40f566,null));};exports[_0x50e8('0x27')]=function(_0x40dbe8,_0x24d3ea){return respondWithRpcPromise(_0x50e8('0x28'),_['merge'](_0x40dbe8[_0x50e8('0x1e')],_0x40dbe8[_0x50e8('0x18')]))[_0x50e8('0x14')](respondWithResult(_0x24d3ea,null))['catch'](handleError(_0x24d3ea,null));};exports['outbound']=function(_0x5dff99,_0xd39553){return respondWithRpcPromise(_0x50e8('0x29'),_0x5dff99[_0x50e8('0x1e')])[_0x50e8('0x14')](respondWithResult(_0xd39553,null))[_0x50e8('0x1b')](handleError(_0xd39553,null));};exports[_0x50e8('0x2a')]=function(_0xb566c2,_0x40b57c){return respondWithRpcPromise(_0x50e8('0x2b'),_0xb566c2[_0x50e8('0x1e')])['then'](respondWithResult(_0x40b57c,null))[_0x50e8('0x1b')](handleError(_0x40b57c,null));};exports[_0x50e8('0x2c')]=function(_0x2379cf,_0x2bf413){var _0x5dbbe1;return respondWithRpcPromise(_0x50e8('0x2d'),_0x2379cf[_0x50e8('0x1e')])[_0x50e8('0x14')](function(_0x169b4f){_0x5dbbe1=_0x169b4f;return respondWithRpcPromise(_0x50e8('0x2d'),_0x2379cf['query'],routingClient);})['then'](function(_0x81e6f3){return _[_0x50e8('0x17')]({},_0x81e6f3,_0x5dbbe1);})['then'](respondWithResult(_0x2bf413,null))[_0x50e8('0x1b')](handleError(_0x2bf413,null));};exports[_0x50e8('0x2e')]=function(_0x3db1ab,_0x3179a0){if(_0x3db1ab[_0x50e8('0x21')]&&_0x3db1ab[_0x50e8('0x21')][_0x50e8('0x2f')]&&_0x3db1ab[_0x50e8('0x30')]&&_0x3db1ab['user'][_0x50e8('0x31')]){for(var _0x44e0ca in _0x3db1ab[_0x50e8('0x21')][_0x50e8('0x2f')]){if(_0x3db1ab['body'][_0x50e8('0x2f')][_0x50e8('0x32')](_0x44e0ca)){db[_0x50e8('0x33')][_0x50e8('0x34')]({'where':{'channel':_0x44e0ca,'membername':_0x3db1ab['user'][_0x50e8('0x31')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3db1ab['body']['interaction'][_0x44e0ca]&&_0x3db1ab[_0x50e8('0x21')][_0x50e8('0x2f')][_0x44e0ca]['length']?{'$notIn':_0x3db1ab[_0x50e8('0x21')][_0x50e8('0x2f')][_0x44e0ca]}:{'$ne':null}}})[_0x50e8('0x14')](function(_0x6e37ad){var _0x387481=moment()[_0x50e8('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x16fdf6=0x0,_0x596f62=_0x6e37ad[_0x50e8('0x36')];_0x16fdf6<_0x596f62;_0x16fdf6+=0x1){_0x6e37ad[_0x16fdf6][_0x50e8('0x37')]({'exitAt':_0x387481});}});for(var _0x537762=0x0;_0x537762<_0x3db1ab[_0x50e8('0x21')]['interaction'][_0x44e0ca][_0x50e8('0x36')];_0x537762+=0x1){db[_0x50e8('0x33')][_0x50e8('0x38')]({'where':{'channel':_0x44e0ca,'membername':_0x3db1ab[_0x50e8('0x30')][_0x50e8('0x31')],'type':_0x50e8('0x39'),'uniqueid':_0x3db1ab[_0x50e8('0x21')][_0x50e8('0x2f')][_0x44e0ca][_0x537762],'exitAt':null},'defaults':{'channel':_0x44e0ca,'membername':_0x3db1ab[_0x50e8('0x30')][_0x50e8('0x31')],'interface':_[_0x50e8('0xf')](_0x3db1ab['user'][_0x50e8('0x3a')])?util[_0x50e8('0x35')]('SIP/%s',_0x3db1ab[_0x50e8('0x30')]['name']):_0x3db1ab[_0x50e8('0x30')]['interface'],'type':_0x50e8('0x39'),'enterAt':moment()[_0x50e8('0x35')](_0x50e8('0x3b')),'role':_0x50e8('0x3c'),'internal':_0x3db1ab[_0x50e8('0x30')][_0x50e8('0x3d')],'uniqueid':_0x3db1ab[_0x50e8('0x21')]['interaction'][_0x44e0ca][_0x537762]}});}}}}return respondWithRpcPromise(_0x50e8('0x3e'),{'id':_0x3db1ab[_0x50e8('0x18')]['id'],'capacity':_0x3db1ab[_0x50e8('0x21')][_0x50e8('0x3f')]},routingClient)[_0x50e8('0x14')](respondWithResult(_0x3179a0,null))[_0x50e8('0x1b')](handleError(_0x3179a0,null));};exports['telephones']=function(_0x5122a2,_0x250b28){return respondWithRpcPromise(_0x50e8('0x40'),_0x5122a2[_0x50e8('0x1e')])['then'](respondWithResult(_0x250b28,null))[_0x50e8('0x1b')](handleError(_0x250b28,null));};exports[_0x50e8('0x41')]=function(_0x3476c5,_0x15db71){return respondWithRpcPromise(_0x50e8('0x42'),_0x3476c5[_0x50e8('0x1e')])[_0x50e8('0x14')](respondWithResult(_0x15db71,null))['catch'](handleError(_0x15db71,null));};exports['campaigns']=function(_0x55083e,_0x2b54ad){return respondWithRpcPromise(_0x50e8('0x43'),_0x55083e[_0x50e8('0x1e')])[_0x50e8('0x14')](respondWithResult(_0x2b54ad,null))[_0x50e8('0x1b')](handleError(_0x2b54ad,null));};exports[_0x50e8('0x44')]=function(_0x566723,_0x2f2154){return respondWithRpcPromise(_0x50e8('0x45'),_0x566723[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](respondWithResult(_0x2f2154,null))['catch'](handleError(_0x2f2154,null));};exports[_0x50e8('0x46')]=function(_0xf773fd,_0x373b41){return respondWithRpcPromise(_0x50e8('0x45'),_0xf773fd[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](findById(_0xf773fd['params']['id']))[_0x50e8('0x14')](respondWithResult(_0x373b41,null))['catch'](handleError(_0x373b41,null));};exports['mailQueues']=function(_0x5af2a4,_0x23216a){return respondWithRpcPromise('MailQueues',_0x5af2a4[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](respondWithResult(_0x23216a,null))[_0x50e8('0x1b')](handleError(_0x23216a,null));};exports[_0x50e8('0x47')]=function(_0x279cf4,_0x12224d){return respondWithRpcPromise(_0x50e8('0x48'),_0x279cf4['query'],routingClient)[_0x50e8('0x14')](findById(_0x279cf4[_0x50e8('0x18')]['id']))[_0x50e8('0x14')](respondWithResult(_0x12224d,null))['catch'](handleError(_0x12224d,null));};exports['mailAccounts']=function(_0x53dcdc,_0x3d7311){return respondWithRpcPromise(_0x50e8('0x49'),_0x53dcdc[_0x50e8('0x1e')],mailClient)[_0x50e8('0x14')](respondWithResult(_0x3d7311,null))[_0x50e8('0x1b')](handleError(_0x3d7311,null));};exports[_0x50e8('0x4a')]=function(_0x583d6a,_0x42c2d0){return respondWithRpcPromise('OpenchannelQueues',_0x583d6a[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](respondWithResult(_0x42c2d0,null))['catch'](handleError(_0x42c2d0,null));};exports['showOpenchannelQueues']=function(_0x51775a,_0x2eed72){return respondWithRpcPromise(_0x50e8('0x4b'),_0x51775a['query'],routingClient)[_0x50e8('0x14')](findById(_0x51775a[_0x50e8('0x18')]['id']))[_0x50e8('0x14')](respondWithResult(_0x2eed72,null))[_0x50e8('0x1b')](handleError(_0x2eed72,null));};exports[_0x50e8('0x4c')]=function(_0x47b428,_0x125e92){return respondWithRpcPromise(_0x50e8('0x4d'),_0x47b428[_0x50e8('0x1e')],routingClient)['then'](respondWithResult(_0x125e92,null))['catch'](handleError(_0x125e92,null));};exports[_0x50e8('0x4e')]=function(_0x44e9a2,_0xd21879){return respondWithRpcPromise(_0x50e8('0x4d'),_0x44e9a2[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](findById(_0x44e9a2['params']['id']))['then'](respondWithResult(_0xd21879,null))[_0x50e8('0x1b')](handleError(_0xd21879,null));};exports['whatsappQueues']=function(_0x1fc530,_0x36a288){return respondWithRpcPromise('WhatsappQueues',_0x1fc530[_0x50e8('0x1e')],routingClient)['then'](respondWithResult(_0x36a288,null))['catch'](handleError(_0x36a288,null));};exports['showWhatsappQueues']=function(_0x22b6f3,_0x2d4fe8){return respondWithRpcPromise(_0x50e8('0x4f'),_0x22b6f3[_0x50e8('0x1e')],routingClient)['then'](findById(_0x22b6f3['params']['id']))[_0x50e8('0x14')](respondWithResult(_0x2d4fe8,null))[_0x50e8('0x1b')](handleError(_0x2d4fe8,null));};exports[_0x50e8('0x50')]=function(_0x3ac7cc,_0x20c5e8){return respondWithRpcPromise(_0x50e8('0x51'),_0x3ac7cc[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](respondWithResult(_0x20c5e8,null))[_0x50e8('0x1b')](handleError(_0x20c5e8,null));};exports[_0x50e8('0x52')]=function(_0x109920,_0x38b535){return respondWithRpcPromise(_0x50e8('0x51'),_0x109920[_0x50e8('0x1e')],routingClient)[_0x50e8('0x14')](findById(_0x109920[_0x50e8('0x18')]['id']))[_0x50e8('0x14')](respondWithResult(_0x38b535,null))[_0x50e8('0x1b')](handleError(_0x38b535,null));};exports['faxAccounts']=function(_0x35a382,_0x474978){return respondWithRpcPromise(_0x50e8('0x53'),_0x35a382[_0x50e8('0x1e')])['then'](respondWithResult(_0x474978,null))[_0x50e8('0x1b')](handleError(_0x474978,null));};exports[_0x50e8('0x54')]=function(_0x26c505,_0x161a07){return respondWithRpcPromise(_0x50e8('0x55'),_0x26c505[_0x50e8('0x1e')],routingClient)['then'](respondWithResult(_0x161a07,null))[_0x50e8('0x1b')](handleError(_0x161a07,null));};exports[_0x50e8('0x56')]=function(_0x19e44c,_0x13667e){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19e44c[_0x50e8('0x1e')],routingClient)['then'](respondWithResult(_0x13667e,null))[_0x50e8('0x1b')](handleError(_0x13667e,null));};exports[_0x50e8('0x57')]=function(_0x365c9e,_0x1637b2){return respondWithRpcPromise(_0x50e8('0x58'),_0x365c9e['query'],routingClient)[_0x50e8('0x14')](respondWithResult(_0x1637b2,null))[_0x50e8('0x1b')](handleError(_0x1637b2,null));};exports[_0x50e8('0x59')]=function(_0x309015,_0x3a3820){return respondWithRpcPromise(_0x50e8('0x58'),_0x309015['query'],routingClient)[_0x50e8('0x14')](function(_0x1cc566){if(_0x309015['query'][_0x50e8('0x5a')]!==undefined){var _0x2fc1b6=_(_0x1cc566['rows'])[_0x50e8('0x5b')]([_0x309015['query'][_0x50e8('0x5a')],_0x309015[_0x50e8('0x18')]['id']])['map'](_0x50e8('0x5c'))[_0x50e8('0x5d')]()[_0x50e8('0x5e')]();return _0x1cc566[_0x50e8('0x11')]['filter'](function(_0xf21b2f){return _0x2fc1b6['indexOf'](_0xf21b2f[_0x50e8('0x5c')])>-0x1;});}else{return _0x1cc566[_0x50e8('0x11')]['filter'](function(_0x68342){return _0x68342[_0x50e8('0x5c')]===parseInt(_0x309015[_0x50e8('0x18')]['id']);});}})[_0x50e8('0x14')](respondWithResult(_0x3a3820,null))[_0x50e8('0x1b')](handleError(_0x3a3820,null));};exports[_0x50e8('0x5f')]=function(_0x2c85a6,_0x410e7b){return respondWithRpcPromise(_0x50e8('0x60'),_0x2c85a6['query'],routingClient)[_0x50e8('0x14')](respondWithResult(_0x410e7b,null))[_0x50e8('0x1b')](handleError(_0x410e7b,null));};exports[_0x50e8('0x61')]=function(_0x5a79c4,_0x7d64e0){return respondWithRpcPromise(_0x50e8('0x62'),_0x5a79c4[_0x50e8('0x1e')],routingClient)['then'](respondWithResult(_0x7d64e0,null))['catch'](handleError(_0x7d64e0,null));};exports[_0x50e8('0x63')]=function(_0x440fc7,_0x5d922b){return respondWithRpcPromise(_0x50e8('0x64'),_0x440fc7['query'],routingClient)[_0x50e8('0x14')](respondWithResult(_0x5d922b,null))[_0x50e8('0x1b')](handleError(_0x5d922b,null));};exports[_0x50e8('0x65')]=function(_0x157b27){return function(_0x49828b,_0x22d2e){var _0x4ac008,_0x29af7b;var _0x51ea2a=_['capitalize'](_0x157b27);var _0x368d17=_0x157b27===_0x50e8('0x66')?'Website':_0x50e8('0x67');return db[_0x51ea2a+'Queue'][_0x50e8('0x68')]({'raw':!![],'where':{'id':_0x49828b['params']['id']}})['then'](function(_0x27dae3){if(_[_0x50e8('0xf')](_0x27dae3)){throw new Error(_0x51ea2a+_0x50e8('0x69'));}_0x4ac008=_0x27dae3;return db[_0x51ea2a+_0x50e8('0x6a')]['findOne']({'where':{'id':_0x49828b[_0x50e8('0x21')]['messageId']},'include':[{'model':db[_0x51ea2a+'Interaction'],'as':_0x50e8('0x6b')},{'model':db[_0x51ea2a+_0x368d17],'as':_0x50e8('0x67')}]});})[_0x50e8('0x14')](function(_0x50d925){if(_['isNil'](_0x50d925)){throw new Error(_0x51ea2a+'\x20Message\x20not\x20found');}_0x29af7b=_0x50d925;return _0x50d925[_0x50e8('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x50e8('0x14')](function(){var _0x1decc9={'uniqueid':_0x157b27+'.'+_0x29af7b['id']+'.'+_0x29af7b[_0x50e8('0x6b')]['id'],'FromUserId':_0x49828b[_0x50e8('0x30')]['id'],'type':_0x50e8('0x6d')};_0x1decc9[_0x51ea2a+'MessageId']=_0x29af7b['id'];_0x1decc9[_0x51ea2a+'InteractionId']=_0x29af7b[_0x50e8('0x6b')]['id'];_0x1decc9[_0x50e8('0x6e')+_0x51ea2a+_0x368d17+'Id']=_0x29af7b[_0x50e8('0x67')]['id'];_0x1decc9['To'+_0x51ea2a+_0x50e8('0x6f')]=_0x4ac008['id'];return db[_0x51ea2a+_0x50e8('0x70')]['create'](_0x1decc9);})[_0x50e8('0x14')](function(){return respondWithRpcPromise(_0x50e8('0x71'),{'channel':_0x157b27,'interaction':_0x29af7b[_0x50e8('0x6b')],'message':_0x29af7b,'account':_0x29af7b['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4ac008[_0x50e8('0x31')]+','+(_0x29af7b[_0x50e8('0x67')][_0x50e8('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x50e8('0x14')](respondWithResult(_0x22d2e,null))[_0x50e8('0x1b')](handleError(_0x22d2e,null));};};exports['agentNotify']=function(_0x29e664,_0x52929f){var _0x306fc0,_0x1e38ea;if(_[_0x50e8('0xf')](_0x29e664[_0x50e8('0x21')][_0x50e8('0x73')])){throw new Error(_0x50e8('0x74'));}var _0x1c4f8f=_0x29e664[_0x50e8('0x21')][_0x50e8('0x73')];var _0x5b4032=_[_0x50e8('0x75')](_0x1c4f8f);var _0x4e431e=_0x1c4f8f===_0x50e8('0x66')?_0x50e8('0x76'):_0x50e8('0x67');return db[_0x50e8('0x77')][_0x50e8('0x68')]({'raw':!![],'where':{'id':_0x29e664[_0x50e8('0x18')]['id'],'role':'agent'}})[_0x50e8('0x14')](function(_0xe57ebc){if(_[_0x50e8('0xf')](_0xe57ebc)){throw new Error(_0x50e8('0x78'));}_0x306fc0=_0xe57ebc;return db[_0x5b4032+_0x50e8('0x6a')][_0x50e8('0x68')]({'where':{'id':_0x29e664[_0x50e8('0x21')]['messageId']},'include':[{'model':db[_0x5b4032+_0x50e8('0x6b')],'as':_0x50e8('0x6b')},{'model':db[_0x5b4032+_0x4e431e],'as':_0x50e8('0x67')}]});})[_0x50e8('0x14')](function(_0x28ce03){if(_[_0x50e8('0xf')](_0x28ce03)){throw new Error(_0x5b4032+_0x50e8('0x79'));}_0x1e38ea=_0x28ce03;return _0x28ce03[_0x50e8('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4e67ca={'uniqueid':_0x1c4f8f+'.'+_0x1e38ea['id']+'.'+_0x1e38ea['Interaction']['id'],'FromUserId':_0x29e664[_0x50e8('0x30')]['id'],'type':'queue','ToUserId':_0x306fc0['id']};_0x4e67ca[_0x5b4032+_0x50e8('0x7a')]=_0x1e38ea['id'];_0x4e67ca[_0x5b4032+_0x50e8('0x7b')]=_0x1e38ea[_0x50e8('0x6b')]['id'];_0x4e67ca[_0x50e8('0x6e')+_0x5b4032+_0x4e431e+'Id']=_0x1e38ea[_0x50e8('0x67')]['id'];return db[_0x5b4032+_0x50e8('0x70')][_0x50e8('0x7c')](_0x4e67ca);})[_0x50e8('0x14')](function(){return respondWithRpcPromise(_0x50e8('0x71'),{'channel':_0x1c4f8f,'interaction':_0x1e38ea[_0x50e8('0x6b')],'message':_0x1e38ea,'account':_0x1e38ea[_0x50e8('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x306fc0[_0x50e8('0x31')]+','+(_0x1e38ea[_0x50e8('0x67')]['agentTransferTimeout']||0x12c),'interval':_0x50e8('0x7d')}]},routingClient);})[_0x50e8('0x14')](respondWithResult(_0x52929f,null))[_0x50e8('0x1b')](handleError(_0x52929f,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 60ef15d..393478b 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 _0x9be9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','run','post','put','update','util','path','express','Router','fs-extra'];(function(_0x1a1dd7,_0x9e586a){var _0x5e5ac6=function(_0x6b7c37){while(--_0x6b7c37){_0x1a1dd7['push'](_0x1a1dd7['shift']());}};_0x5e5ac6(++_0x9e586a);}(_0x9be9,0x1e8));var _0x99be=function(_0x367c4b,_0x8120e2){_0x367c4b=_0x367c4b-0x0;var _0x240198=_0x9be9[_0x367c4b];return _0x240198;};'use strict';var multer=require('multer');var util=require(_0x99be('0x0'));var path=require(_0x99be('0x1'));var timeout=require('connect-timeout');var express=require(_0x99be('0x2'));var router=express[_0x99be('0x3')]();var fs_extra=require(_0x99be('0x4'));var auth=require(_0x99be('0x5'));var interaction=require(_0x99be('0x6'));var config=require(_0x99be('0x7'));var controller=require(_0x99be('0x8'));router[_0x99be('0x9')]('/',auth[_0x99be('0xa')](),controller['index']);router[_0x99be('0x9')](_0x99be('0xb'),auth[_0x99be('0xa')](),controller[_0x99be('0xc')]);router[_0x99be('0x9')]('/:id/run',auth[_0x99be('0xa')](),controller[_0x99be('0xd')]);router[_0x99be('0xe')]('/',auth[_0x99be('0xa')](),controller['create']);router[_0x99be('0xf')](_0x99be('0xb'),auth[_0x99be('0xa')](),controller[_0x99be('0x10')]);router['delete'](_0x99be('0xb'),auth[_0x99be('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5b8d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update','destroy','exports'];(function(_0x205ed2,_0x248ed0){var _0x540c3b=function(_0x9a7918){while(--_0x9a7918){_0x205ed2['push'](_0x205ed2['shift']());}};_0x540c3b(++_0x248ed0);}(_0x5b8d,0x142));var _0xd5b8=function(_0x456185,_0x421fe8){_0x456185=_0x456185-0x0;var _0x48c928=_0x5b8d[_0x456185];return _0x48c928;};'use strict';var multer=require(_0xd5b8('0x0'));var util=require(_0xd5b8('0x1'));var path=require(_0xd5b8('0x2'));var timeout=require(_0xd5b8('0x3'));var express=require('express');var router=express[_0xd5b8('0x4')]();var fs_extra=require(_0xd5b8('0x5'));var auth=require(_0xd5b8('0x6'));var interaction=require(_0xd5b8('0x7'));var config=require(_0xd5b8('0x8'));var controller=require(_0xd5b8('0x9'));router[_0xd5b8('0xa')]('/',auth[_0xd5b8('0xb')](),controller[_0xd5b8('0xc')]);router['get'](_0xd5b8('0xd'),auth['isAuthenticated'](),controller[_0xd5b8('0xe')]);router[_0xd5b8('0xa')](_0xd5b8('0xf'),auth[_0xd5b8('0xb')](),controller[_0xd5b8('0x10')]);router[_0xd5b8('0x11')]('/',auth[_0xd5b8('0xb')](),controller[_0xd5b8('0x12')]);router[_0xd5b8('0x13')](_0xd5b8('0xd'),auth['isAuthenticated'](),controller[_0xd5b8('0x14')]);router['delete'](_0xd5b8('0xd'),auth['isAuthenticated'](),controller[_0xd5b8('0x15')]);module[_0xd5b8('0x16')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 3fc3999..5006692 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 _0xc26a=['pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','ENUM','days','minutes'];(function(_0x2b9ee9,_0x973945){var _0x44867a=function(_0x1e6abf){while(--_0x1e6abf){_0x2b9ee9['push'](_0x2b9ee9['shift']());}};_0x44867a(++_0x973945);}(_0xc26a,0x179));var _0xac26=function(_0x4f3522,_0x3e9fb){_0x4f3522=_0x4f3522-0x0;var _0x5b4de7=_0xc26a[_0x4f3522];return _0x5b4de7;};'use strict';var Sequelize=require(_0xac26('0x0'));module[_0xac26('0x1')]={'name':{'type':Sequelize[_0xac26('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xac26('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xac26('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xac26('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xac26('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xac26('0x5')]('years','quarters','months','weeks',_0xac26('0x6'),'hours',_0xac26('0x7')),'allowNull':![],'defaultValue':_0xac26('0x6')},'output':{'type':Sequelize[_0xac26('0x5')]('csv',_0xac26('0x8'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xac26('0x5')](_0xac26('0x9'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xac26('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xac26('0x2')]},'cc':{'type':Sequelize[_0xac26('0xa')]},'bcc':{'type':Sequelize[_0xac26('0xa')]},'sendIfEmpty':{'type':Sequelize[_0xac26('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd6f0=['pdf','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','csv'];(function(_0x2e7a35,_0x485b21){var _0x3d8264=function(_0x9d1512){while(--_0x9d1512){_0x2e7a35['push'](_0x2e7a35['shift']());}};_0x3d8264(++_0x485b21);}(_0xd6f0,0x194));var _0x0d6f=function(_0x548aea,_0x363013){_0x548aea=_0x548aea-0x0;var _0x17b16c=_0xd6f0[_0x548aea];return _0x17b16c;};'use strict';var Sequelize=require(_0x0d6f('0x0'));module[_0x0d6f('0x1')]={'name':{'type':Sequelize[_0x0d6f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0d6f('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0d6f('0x2')],'allowNull':![],'defaultValue':_0x0d6f('0x3')},'startAt':{'type':Sequelize[_0x0d6f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0d6f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0d6f('0x6')](_0x0d6f('0x7'),_0x0d6f('0x8'),_0x0d6f('0x9'),_0x0d6f('0xa'),_0x0d6f('0xb'),_0x0d6f('0xc'),'minutes'),'allowNull':![],'defaultValue':_0x0d6f('0xb')},'output':{'type':Sequelize['ENUM'](_0x0d6f('0xd'),_0x0d6f('0xe'),_0x0d6f('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x0d6f('0x10'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x0d6f('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x0d6f('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x0d6f('0x11')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 14c87c1..69c8bf6 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 _0x5220=['Schedule','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','../../config/schedule','run','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x5220,0x79));var _0x0522=function(_0x1c2a65,_0x4450f2){_0x1c2a65=_0x1c2a65-0x0;var _0x9b7e31=_0x5220[_0x1c2a65];return _0x9b7e31;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0522('0x0'));var jsonpatch=require(_0x0522('0x1'));var rp=require('request-promise');var moment=require(_0x0522('0x2'));var BPromise=require(_0x0522('0x3'));var Mustache=require(_0x0522('0x4'));var util=require('util');var path=require(_0x0522('0x5'));var sox=require(_0x0522('0x6'));var csv=require(_0x0522('0x7'));var ejs=require(_0x0522('0x8'));var fs=require('fs');var fs_extra=require(_0x0522('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0522('0xa'));var deskjs=require(_0x0522('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0522('0xc'));var Papa=require(_0x0522('0xd'));var Redis=require(_0x0522('0xe'));var authService=require(_0x0522('0xf'));var qs=require(_0x0522('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0522('0x11'));var logger=require(_0x0522('0x12'))(_0x0522('0x13'));var utils=require('../../config/utils');var config=require(_0x0522('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f0f9,_0x21dfa2){_0x21dfa2=_0x21dfa2||0xcc;return function(_0xe0b69){if(_0xe0b69){return _0x14f0f9[_0x0522('0x15')](_0x21dfa2);}return _0x14f0f9[_0x0522('0x16')](_0x21dfa2)[_0x0522('0x17')]();};}function respondWithResult(_0x13990e,_0x1da1d8){_0x1da1d8=_0x1da1d8||0xc8;return function(_0x549176){if(_0x549176){return _0x13990e[_0x0522('0x16')](_0x1da1d8)[_0x0522('0x18')](_0x549176);}};}function respondWithFilteredResult(_0x2edc3d,_0x135a48){return function(_0x13e50d){if(_0x13e50d){var _0x52a864=typeof _0x135a48['offset']===_0x0522('0x19')&&typeof _0x135a48[_0x0522('0x1a')]===_0x0522('0x19');var _0x2697d8=_0x13e50d[_0x0522('0x1b')];var _0x25d868=_0x52a864?0x0:_0x135a48['offset'];var _0x55b495=_0x52a864?_0x13e50d[_0x0522('0x1b')]:_0x135a48[_0x0522('0x1c')]+_0x135a48[_0x0522('0x1a')];var _0x26a507;if(_0x55b495>=_0x2697d8){_0x55b495=_0x2697d8;_0x26a507=0xc8;}else{_0x26a507=0xce;}_0x2edc3d['status'](_0x26a507);return _0x2edc3d[_0x0522('0x1d')](_0x0522('0x1e'),_0x25d868+'-'+_0x55b495+'/'+_0x2697d8)['json'](_0x13e50d);}return null;};}function patchUpdates(_0x2d1403){return function(_0x2ace33){try{jsonpatch[_0x0522('0x1f')](_0x2ace33,_0x2d1403,!![]);}catch(_0x4a1596){return BPromise['reject'](_0x4a1596);}return _0x2ace33[_0x0522('0x20')]();};}function saveUpdates(_0x8c035d,_0x88276){return function(_0x9d9b73){if(_0x9d9b73){return _0x9d9b73['update'](_0x8c035d)[_0x0522('0x21')](function(_0x3d2e19){return _0x3d2e19;});}return null;};}function removeEntity(_0x9470d2,_0x1e9839){return function(_0x18c25e){if(_0x18c25e){return _0x18c25e[_0x0522('0x22')]()['then'](function(){var _0x45ba45=_0x18c25e[_0x0522('0x23')]({'plain':!![]});var _0x4c0c8e=_0x0522('0x24');return db[_0x0522('0x25')][_0x0522('0x22')]({'where':{'type':_0x4c0c8e,'resourceId':_0x45ba45['id']}})['then'](function(){return _0x18c25e;});})[_0x0522('0x21')](function(){_0x9470d2['status'](0xcc)[_0x0522('0x17')]();});}};}function handleEntityNotFound(_0x193771,_0x2b7372){return function(_0x9dcf3c){if(!_0x9dcf3c){_0x193771['sendStatus'](0x194);}return _0x9dcf3c;};}function handleError(_0x126c75,_0x402aef){_0x402aef=_0x402aef||0x1f4;return function(_0x3b8a4e){logger[_0x0522('0x26')](_0x3b8a4e[_0x0522('0x27')]);if(_0x3b8a4e[_0x0522('0x28')]){delete _0x3b8a4e[_0x0522('0x28')];}_0x126c75[_0x0522('0x16')](_0x402aef)[_0x0522('0x29')](_0x3b8a4e);};}exports['index']=function(_0x124c7b,_0x1f01bf){var _0x337294={},_0x5b1e42={},_0x5b8cf3={'count':0x0,'rows':[]};var _0x67b2cf=_[_0x0522('0x2a')](db[_0x0522('0x2b')][_0x0522('0x2c')],function(_0x17aefc){return{'name':_0x17aefc['fieldName'],'type':_0x17aefc[_0x0522('0x2d')]['key']};});_0x5b1e42['model']=_[_0x0522('0x2a')](_0x67b2cf,_0x0522('0x28'));_0x5b1e42[_0x0522('0x2e')]=_[_0x0522('0x2f')](_0x124c7b[_0x0522('0x2e')]);_0x5b1e42[_0x0522('0x30')]=_[_0x0522('0x31')](_0x5b1e42['model'],_0x5b1e42[_0x0522('0x2e')]);_0x337294['attributes']=_[_0x0522('0x31')](_0x5b1e42[_0x0522('0x32')],qs[_0x0522('0x33')](_0x124c7b[_0x0522('0x2e')]['fields']));_0x337294[_0x0522('0x34')]=_0x337294['attributes'][_0x0522('0x35')]?_0x337294[_0x0522('0x34')]:_0x5b1e42[_0x0522('0x32')];if(!_0x124c7b[_0x0522('0x2e')][_0x0522('0x36')]('nolimit')){_0x337294[_0x0522('0x1a')]=qs[_0x0522('0x1a')](_0x124c7b[_0x0522('0x2e')][_0x0522('0x1a')]);_0x337294[_0x0522('0x1c')]=qs['offset'](_0x124c7b[_0x0522('0x2e')][_0x0522('0x1c')]);}_0x337294[_0x0522('0x37')]=qs[_0x0522('0x38')](_0x124c7b[_0x0522('0x2e')][_0x0522('0x38')]);_0x337294[_0x0522('0x39')]=qs[_0x0522('0x30')](_[_0x0522('0x3a')](_0x124c7b[_0x0522('0x2e')],_0x5b1e42[_0x0522('0x30')]),_0x67b2cf);if(_0x124c7b[_0x0522('0x2e')][_0x0522('0x3b')]){_0x337294[_0x0522('0x39')]=_[_0x0522('0x3c')](_0x337294[_0x0522('0x39')],{'$or':_[_0x0522('0x2a')](_0x67b2cf,function(_0x685cdd){if(_0x685cdd[_0x0522('0x2d')]!==_0x0522('0x3d')){var _0x3580c6={};_0x3580c6[_0x685cdd[_0x0522('0x28')]]={'$like':'%'+_0x124c7b[_0x0522('0x2e')][_0x0522('0x3b')]+'%'};return _0x3580c6;}})});}_0x337294=_['merge']({},_0x337294,_0x124c7b['options']);var _0x1f6691={'where':_0x337294[_0x0522('0x39')]};return db[_0x0522('0x2b')]['count'](_0x1f6691)[_0x0522('0x21')](function(_0x3ed955){_0x5b8cf3[_0x0522('0x1b')]=_0x3ed955;if(_0x124c7b['query'][_0x0522('0x3e')]){_0x337294['include']=[{'all':!![]}];}return db[_0x0522('0x2b')][_0x0522('0x3f')](_0x337294);})['then'](function(_0x27965f){_0x5b8cf3[_0x0522('0x40')]=_0x27965f;return _0x5b8cf3;})['then'](respondWithFilteredResult(_0x1f01bf,_0x337294))[_0x0522('0x41')](handleError(_0x1f01bf,null));};exports[_0x0522('0x42')]=function(_0x27775d,_0x15d98a){var _0x2a6435={'raw':![],'where':{'id':_0x27775d[_0x0522('0x43')]['id']}},_0x13e708={};_0x13e708[_0x0522('0x32')]=_['keys'](db[_0x0522('0x2b')][_0x0522('0x2c')]);_0x13e708[_0x0522('0x2e')]=_[_0x0522('0x2f')](_0x27775d['query']);_0x13e708[_0x0522('0x30')]=_[_0x0522('0x31')](_0x13e708[_0x0522('0x32')],_0x13e708[_0x0522('0x2e')]);_0x2a6435['attributes']=_[_0x0522('0x31')](_0x13e708[_0x0522('0x32')],qs[_0x0522('0x33')](_0x27775d[_0x0522('0x2e')][_0x0522('0x33')]));_0x2a6435[_0x0522('0x34')]=_0x2a6435[_0x0522('0x34')][_0x0522('0x35')]?_0x2a6435[_0x0522('0x34')]:_0x13e708[_0x0522('0x32')];if(_0x27775d[_0x0522('0x2e')]['includeAll']){_0x2a6435[_0x0522('0x44')]=[{'all':!![]}];}_0x2a6435=_[_0x0522('0x3c')]({},_0x2a6435,_0x27775d[_0x0522('0x45')]);return db[_0x0522('0x2b')][_0x0522('0x46')](_0x2a6435)[_0x0522('0x21')](handleEntityNotFound(_0x15d98a,null))[_0x0522('0x21')](respondWithResult(_0x15d98a,null))['catch'](handleError(_0x15d98a,null));};exports[_0x0522('0x47')]=function(_0x3c4a3b,_0x447107){return db[_0x0522('0x2b')][_0x0522('0x47')](_0x3c4a3b['body'],{})['then'](function(_0x2ee4d1){var _0x4c3cf2=_0x3c4a3b['user'][_0x0522('0x23')]({'plain':!![]});if(!_0x4c3cf2)throw new Error(_0x0522('0x48'));if(_0x4c3cf2[_0x0522('0x49')]===_0x0522('0x4a')){var _0x362c11=_0x2ee4d1[_0x0522('0x23')]({'plain':!![]});var _0x29c781=_0x0522('0x24');return db[_0x0522('0x4b')]['find']({'where':{'name':_0x29c781,'userProfileId':_0x4c3cf2[_0x0522('0x4c')]},'raw':!![]})[_0x0522('0x21')](function(_0xed3f45){if(_0xed3f45&&_0xed3f45['autoAssociation']===0x0){return db[_0x0522('0x25')][_0x0522('0x47')]({'name':_0x362c11['name'],'resourceId':_0x362c11['id'],'type':_0xed3f45[_0x0522('0x28')],'sectionId':_0xed3f45['id']},{})['then'](function(){return _0x2ee4d1;});}else{return _0x2ee4d1;}})['catch'](function(_0x8f4097){logger[_0x0522('0x26')](_0x0522('0x4d'),_0x8f4097);throw _0x8f4097;});}return _0x2ee4d1;})[_0x0522('0x21')](respondWithResult(_0x447107,0xc9))[_0x0522('0x41')](handleError(_0x447107,null));};exports[_0x0522('0x4e')]=function(_0x700fad,_0x3a7eb9){if(_0x700fad[_0x0522('0x4f')]['id']){delete _0x700fad[_0x0522('0x4f')]['id'];}return db['Schedule'][_0x0522('0x46')]({'where':{'id':_0x700fad[_0x0522('0x43')]['id']}})[_0x0522('0x21')](handleEntityNotFound(_0x3a7eb9,null))[_0x0522('0x21')](saveUpdates(_0x700fad['body'],null))[_0x0522('0x21')](respondWithResult(_0x3a7eb9,null))[_0x0522('0x41')](handleError(_0x3a7eb9,null));};exports[_0x0522('0x22')]=function(_0x5cb236,_0x1beefd){return db['Schedule'][_0x0522('0x46')]({'where':{'id':_0x5cb236[_0x0522('0x43')]['id']}})[_0x0522('0x21')](handleEntityNotFound(_0x1beefd,null))[_0x0522('0x21')](removeEntity(_0x1beefd,null))[_0x0522('0x41')](handleError(_0x1beefd,null));};exports['run']=function(_0x14e890,_0x4a36b8,_0x3c294f){var _0x32392a=require(_0x0522('0x50'));return db['Schedule'][_0x0522('0x46')]({'where':{'id':_0x14e890[_0x0522('0x43')]['id']},'raw':!![]})[_0x0522('0x21')](handleEntityNotFound(_0x4a36b8,null))[_0x0522('0x21')](function(){_0x32392a[_0x0522('0x51')](_0x14e890['params']['id']);})[_0x0522('0x21')](respondWithStatusCode(_0x4a36b8,null))[_0x0522('0x41')](handleError(_0x4a36b8,null));}; \ No newline at end of file +var _0xb3ab=['Content-Range','apply','reject','update','destroy','get','Scheduler','UserProfileResource','then','error','index','Schedule','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','length','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xb3ab,0x86));var _0xbb3a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb3ab[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xbb3a('0x0'));var rimraf=require(_0xbb3a('0x1'));var zipdir=require(_0xbb3a('0x2'));var jsonpatch=require(_0xbb3a('0x3'));var rp=require(_0xbb3a('0x4'));var moment=require('moment');var BPromise=require(_0xbb3a('0x5'));var Mustache=require(_0xbb3a('0x6'));var util=require('util');var path=require(_0xbb3a('0x7'));var sox=require(_0xbb3a('0x8'));var csv=require(_0xbb3a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb3a('0xa'));var _=require(_0xbb3a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb3a('0xc'));var deskjs=require(_0xbb3a('0xd'));var toCsv=require(_0xbb3a('0x9'));var querystring=require('querystring');var Papa=require(_0xbb3a('0xe'));var Redis=require(_0xbb3a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbb3a('0x10'));var as=require(_0xbb3a('0x11'));var hardwareService=require(_0xbb3a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbb3a('0x13'));var config=require(_0xbb3a('0x14'));var licenseUtil=require(_0xbb3a('0x15'));var db=require(_0xbb3a('0x16'))['db'];function respondWithStatusCode(_0x9871f3,_0xcf4c8b){_0xcf4c8b=_0xcf4c8b||0xcc;return function(_0x422843){if(_0x422843){return _0x9871f3['sendStatus'](_0xcf4c8b);}return _0x9871f3['status'](_0xcf4c8b)[_0xbb3a('0x17')]();};}function respondWithResult(_0x340896,_0x55a9b6){_0x55a9b6=_0x55a9b6||0xc8;return function(_0x52ace5){if(_0x52ace5){return _0x340896[_0xbb3a('0x18')](_0x55a9b6)['json'](_0x52ace5);}};}function respondWithFilteredResult(_0x22ecd5,_0x38fedd){return function(_0x5870ea){if(_0x5870ea){var _0xc2cca8=typeof _0x38fedd[_0xbb3a('0x19')]===_0xbb3a('0x1a')&&typeof _0x38fedd['limit']===_0xbb3a('0x1a');var _0x143f46=_0x5870ea[_0xbb3a('0x1b')];var _0x4666dc=_0xc2cca8?0x0:_0x38fedd[_0xbb3a('0x19')];var _0x4cb690=_0xc2cca8?_0x5870ea[_0xbb3a('0x1b')]:_0x38fedd[_0xbb3a('0x19')]+_0x38fedd[_0xbb3a('0x1c')];var _0x37d6ac;if(_0x4cb690>=_0x143f46){_0x4cb690=_0x143f46;_0x37d6ac=0xc8;}else{_0x37d6ac=0xce;}_0x22ecd5['status'](_0x37d6ac);return _0x22ecd5[_0xbb3a('0x1d')](_0xbb3a('0x1e'),_0x4666dc+'-'+_0x4cb690+'/'+_0x143f46)['json'](_0x5870ea);}return null;};}function patchUpdates(_0x138a71){return function(_0x79f5a6){try{jsonpatch[_0xbb3a('0x1f')](_0x79f5a6,_0x138a71,!![]);}catch(_0x4e0c43){return BPromise[_0xbb3a('0x20')](_0x4e0c43);}return _0x79f5a6['save']();};}function saveUpdates(_0x5c304f,_0xc56f65){return function(_0x467bd8){if(_0x467bd8){return _0x467bd8[_0xbb3a('0x21')](_0x5c304f)['then'](function(_0x34fb28){return _0x34fb28;});}return null;};}function removeEntity(_0x11eff9,_0x56e7c4){return function(_0x24df10){if(_0x24df10){return _0x24df10[_0xbb3a('0x22')]()['then'](function(){var _0xd7a34d=_0x24df10[_0xbb3a('0x23')]({'plain':!![]});var _0x25ddba=_0xbb3a('0x24');return db[_0xbb3a('0x25')][_0xbb3a('0x22')]({'where':{'type':_0x25ddba,'resourceId':_0xd7a34d['id']}})[_0xbb3a('0x26')](function(){return _0x24df10;});})[_0xbb3a('0x26')](function(){_0x11eff9['status'](0xcc)[_0xbb3a('0x17')]();});}};}function handleEntityNotFound(_0x31d3e0,_0x1de30f){return function(_0x33e68f){if(!_0x33e68f){_0x31d3e0['sendStatus'](0x194);}return _0x33e68f;};}function handleError(_0x2c281a,_0x12c5cc){_0x12c5cc=_0x12c5cc||0x1f4;return function(_0x32fa05){logger[_0xbb3a('0x27')](_0x32fa05['stack']);if(_0x32fa05['name']){delete _0x32fa05['name'];}_0x2c281a[_0xbb3a('0x18')](_0x12c5cc)['send'](_0x32fa05);};}exports[_0xbb3a('0x28')]=function(_0x3c6580,_0x7ac71){var _0x2b034c={},_0x3f7b4a={},_0x41e439={'count':0x0,'rows':[]};var _0x5f5666=_['map'](db[_0xbb3a('0x29')][_0xbb3a('0x2a')],function(_0x173a1a){return{'name':_0x173a1a[_0xbb3a('0x2b')],'type':_0x173a1a[_0xbb3a('0x2c')]['key']};});_0x3f7b4a[_0xbb3a('0x2d')]=_[_0xbb3a('0x2e')](_0x5f5666,_0xbb3a('0x2f'));_0x3f7b4a[_0xbb3a('0x30')]=_[_0xbb3a('0x31')](_0x3c6580[_0xbb3a('0x30')]);_0x3f7b4a[_0xbb3a('0x32')]=_[_0xbb3a('0x33')](_0x3f7b4a['model'],_0x3f7b4a[_0xbb3a('0x30')]);_0x2b034c[_0xbb3a('0x34')]=_[_0xbb3a('0x33')](_0x3f7b4a['model'],qs[_0xbb3a('0x35')](_0x3c6580[_0xbb3a('0x30')][_0xbb3a('0x35')]));_0x2b034c[_0xbb3a('0x34')]=_0x2b034c[_0xbb3a('0x34')]['length']?_0x2b034c[_0xbb3a('0x34')]:_0x3f7b4a[_0xbb3a('0x2d')];if(!_0x3c6580[_0xbb3a('0x30')][_0xbb3a('0x36')](_0xbb3a('0x37'))){_0x2b034c[_0xbb3a('0x1c')]=qs[_0xbb3a('0x1c')](_0x3c6580[_0xbb3a('0x30')][_0xbb3a('0x1c')]);_0x2b034c[_0xbb3a('0x19')]=qs[_0xbb3a('0x19')](_0x3c6580['query'][_0xbb3a('0x19')]);}_0x2b034c['order']=qs[_0xbb3a('0x38')](_0x3c6580[_0xbb3a('0x30')][_0xbb3a('0x38')]);_0x2b034c[_0xbb3a('0x39')]=qs['filters'](_[_0xbb3a('0x3a')](_0x3c6580[_0xbb3a('0x30')],_0x3f7b4a['filters']),_0x5f5666);if(_0x3c6580[_0xbb3a('0x30')][_0xbb3a('0x3b')]){_0x2b034c[_0xbb3a('0x39')]=_[_0xbb3a('0x3c')](_0x2b034c['where'],{'$or':_[_0xbb3a('0x2e')](_0x5f5666,function(_0x5deabc){if(_0x5deabc['type']!==_0xbb3a('0x3d')){var _0x1d943b={};_0x1d943b[_0x5deabc[_0xbb3a('0x2f')]]={'$like':'%'+_0x3c6580[_0xbb3a('0x30')][_0xbb3a('0x3b')]+'%'};return _0x1d943b;}})});}_0x2b034c=_[_0xbb3a('0x3c')]({},_0x2b034c,_0x3c6580['options']);var _0x314a5a={'where':_0x2b034c[_0xbb3a('0x39')]};return db[_0xbb3a('0x29')][_0xbb3a('0x1b')](_0x314a5a)[_0xbb3a('0x26')](function(_0x451e83){_0x41e439[_0xbb3a('0x1b')]=_0x451e83;if(_0x3c6580[_0xbb3a('0x30')]['includeAll']){_0x2b034c['include']=[{'all':!![]}];}return db['Schedule'][_0xbb3a('0x3e')](_0x2b034c);})[_0xbb3a('0x26')](function(_0x24890f){_0x41e439[_0xbb3a('0x3f')]=_0x24890f;return _0x41e439;})[_0xbb3a('0x26')](respondWithFilteredResult(_0x7ac71,_0x2b034c))['catch'](handleError(_0x7ac71,null));};exports[_0xbb3a('0x40')]=function(_0x2bde32,_0x1f9c83){var _0x1d796b={'raw':![],'where':{'id':_0x2bde32[_0xbb3a('0x41')]['id']}},_0x225a82={};_0x225a82['model']=_['keys'](db[_0xbb3a('0x29')][_0xbb3a('0x2a')]);_0x225a82['query']=_['keys'](_0x2bde32[_0xbb3a('0x30')]);_0x225a82[_0xbb3a('0x32')]=_[_0xbb3a('0x33')](_0x225a82[_0xbb3a('0x2d')],_0x225a82['query']);_0x1d796b[_0xbb3a('0x34')]=_[_0xbb3a('0x33')](_0x225a82[_0xbb3a('0x2d')],qs[_0xbb3a('0x35')](_0x2bde32[_0xbb3a('0x30')]['fields']));_0x1d796b[_0xbb3a('0x34')]=_0x1d796b['attributes'][_0xbb3a('0x42')]?_0x1d796b[_0xbb3a('0x34')]:_0x225a82[_0xbb3a('0x2d')];if(_0x2bde32[_0xbb3a('0x30')]['includeAll']){_0x1d796b[_0xbb3a('0x43')]=[{'all':!![]}];}_0x1d796b=_[_0xbb3a('0x3c')]({},_0x1d796b,_0x2bde32[_0xbb3a('0x44')]);return db[_0xbb3a('0x29')][_0xbb3a('0x45')](_0x1d796b)['then'](handleEntityNotFound(_0x1f9c83,null))[_0xbb3a('0x26')](respondWithResult(_0x1f9c83,null))[_0xbb3a('0x46')](handleError(_0x1f9c83,null));};exports[_0xbb3a('0x47')]=function(_0x3d89e1,_0x38756b){return db[_0xbb3a('0x29')][_0xbb3a('0x47')](_0x3d89e1[_0xbb3a('0x48')],{})[_0xbb3a('0x26')](function(_0x3d953e){var _0x2e890d=_0x3d89e1[_0xbb3a('0x49')][_0xbb3a('0x23')]({'plain':!![]});if(!_0x2e890d)throw new Error(_0xbb3a('0x4a'));if(_0x2e890d[_0xbb3a('0x4b')]==='user'){var _0x40be0f=_0x3d953e[_0xbb3a('0x23')]({'plain':!![]});var _0x4f38f6=_0xbb3a('0x24');return db[_0xbb3a('0x4c')][_0xbb3a('0x45')]({'where':{'name':_0x4f38f6,'userProfileId':_0x2e890d[_0xbb3a('0x4d')]},'raw':!![]})[_0xbb3a('0x26')](function(_0x54430f){if(_0x54430f&&_0x54430f[_0xbb3a('0x4e')]===0x0){return db[_0xbb3a('0x25')][_0xbb3a('0x47')]({'name':_0x40be0f[_0xbb3a('0x2f')],'resourceId':_0x40be0f['id'],'type':_0x54430f[_0xbb3a('0x2f')],'sectionId':_0x54430f['id']},{})[_0xbb3a('0x26')](function(){return _0x3d953e;});}else{return _0x3d953e;}})[_0xbb3a('0x46')](function(_0x6ed6ec){logger['error'](_0xbb3a('0x4f'),_0x6ed6ec);throw _0x6ed6ec;});}return _0x3d953e;})['then'](respondWithResult(_0x38756b,0xc9))['catch'](handleError(_0x38756b,null));};exports['update']=function(_0x41eb7d,_0x327f2f){if(_0x41eb7d[_0xbb3a('0x48')]['id']){delete _0x41eb7d['body']['id'];}return db[_0xbb3a('0x29')][_0xbb3a('0x45')]({'where':{'id':_0x41eb7d[_0xbb3a('0x41')]['id']}})['then'](handleEntityNotFound(_0x327f2f,null))[_0xbb3a('0x26')](saveUpdates(_0x41eb7d[_0xbb3a('0x48')],null))[_0xbb3a('0x26')](respondWithResult(_0x327f2f,null))[_0xbb3a('0x46')](handleError(_0x327f2f,null));};exports[_0xbb3a('0x22')]=function(_0x321b87,_0x1fb1fc){return db[_0xbb3a('0x29')][_0xbb3a('0x45')]({'where':{'id':_0x321b87['params']['id']}})[_0xbb3a('0x26')](handleEntityNotFound(_0x1fb1fc,null))[_0xbb3a('0x26')](removeEntity(_0x1fb1fc,null))[_0xbb3a('0x46')](handleError(_0x1fb1fc,null));};exports[_0xbb3a('0x50')]=function(_0x2eaeb4,_0x43de7b,_0x2bdfee){var _0x2a1c4e=require(_0xbb3a('0x51'));return db[_0xbb3a('0x29')]['find']({'where':{'id':_0x2eaeb4[_0xbb3a('0x41')]['id']},'raw':!![]})[_0xbb3a('0x26')](handleEntityNotFound(_0x43de7b,null))[_0xbb3a('0x26')](function(){_0x2a1c4e[_0xbb3a('0x50')](_0x2eaeb4[_0xbb3a('0x41')]['id']);})['then'](respondWithStatusCode(_0x43de7b,null))[_0xbb3a('0x46')](handleError(_0x43de7b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 5b9a147..52fceaa 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 _0x28dc=['util','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x426b63,_0x3b4c07){var _0x1adcc0=function(_0x638c80){while(--_0x638c80){_0x426b63['push'](_0x426b63['shift']());}};_0x1adcc0(++_0x3b4c07);}(_0x28dc,0x136));var _0xc28d=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x28dc[_0x1c289a];return _0x28d68e;};'use strict';var _=require('lodash');var util=require(_0xc28d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc28d('0x1'));var rp=require(_0xc28d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc28d('0x3'));var config=require(_0xc28d('0x4'));var attributes=require(_0xc28d('0x5'));module[_0xc28d('0x6')]=function(_0xd05f0d,_0xce067d){return _0xd05f0d[_0xc28d('0x7')](_0xc28d('0x8'),attributes,{'tableName':_0xc28d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79d6=['moment','bluebird','path','rimraf','./schedule.attributes','exports','Schedule','tools_schedules','lodash','../../config/logger'];(function(_0x42b79e,_0x383ea1){var _0x4b599c=function(_0x422cf7){while(--_0x422cf7){_0x42b79e['push'](_0x42b79e['shift']());}};_0x4b599c(++_0x383ea1);}(_0x79d6,0xa8));var _0x679d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x79d6[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x679d('0x0'));var util=require('util');var logger=require(_0x679d('0x1'))('api');var moment=require(_0x679d('0x2'));var BPromise=require(_0x679d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x679d('0x4'));var rimraf=require(_0x679d('0x5'));var config=require('../../config/environment');var attributes=require(_0x679d('0x6'));module[_0x679d('0x7')]=function(_0x28fa25,_0x5cfe09){return _0x28fa25['define'](_0x679d('0x8'),attributes,{'tableName':_0x679d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1925858..df86401 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 _0xe930=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0xdc920e,_0xa8e481){var _0x1dd989=function(_0x594cc0){while(--_0x594cc0){_0xdc920e['push'](_0xdc920e['shift']());}};_0x1dd989(++_0xa8e481);}(_0xe930,0x107));var _0x0e93=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xe930[_0x4179e2];return _0x24cb50;};'use strict';var _=require(_0x0e93('0x0'));var util=require(_0x0e93('0x1'));var moment=require('moment');var BPromise=require(_0x0e93('0x2'));var rs=require(_0x0e93('0x3'));var fs=require('fs');var Redis=require(_0x0e93('0x4'));var db=require(_0x0e93('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e93('0x6'))(_0x0e93('0x7'));var config=require(_0x0e93('0x8'));var jayson=require(_0x0e93('0x9'));var client=jayson[_0x0e93('0xa')][_0x0e93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x203f6a,_0x43bff2,_0x2dd4ba){return new BPromise(function(_0xd83867,_0x4c086d){return client[_0x0e93('0xc')](_0x203f6a,_0x2dd4ba)[_0x0e93('0xd')](function(_0x9c7002){logger[_0x0e93('0xe')]('Schedule,\x20%s,\x20%s',_0x43bff2,_0x0e93('0xf'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x43bff2,_0x0e93('0xf'),JSON[_0x0e93('0x10')](_0x9c7002));if(_0x9c7002['error']){if(_0x9c7002[_0x0e93('0x11')]['code']===0x1f4){logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x43bff2,_0x9c7002[_0x0e93('0x11')]['message']);return _0x4c086d(_0x9c7002['error'][_0x0e93('0x13')]);}logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x43bff2,_0x9c7002['error'][_0x0e93('0x13')]);return _0xd83867(_0x9c7002[_0x0e93('0x11')][_0x0e93('0x13')]);}else{logger[_0x0e93('0xe')](_0x0e93('0x12'),_0x43bff2,_0x0e93('0xf'));_0xd83867(_0x9c7002[_0x0e93('0x14')]['message']);}})[_0x0e93('0x15')](function(_0x52a933){logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x43bff2,_0x52a933);_0x4c086d(_0x52a933);});});} \ No newline at end of file +var _0xdebc=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3cc7c2,_0x3c0e00){var _0x30fb86=function(_0x27fff7){while(--_0x27fff7){_0x3cc7c2['push'](_0x3cc7c2['shift']());}};_0x30fb86(++_0x3c0e00);}(_0xdebc,0xc1));var _0xcdeb=function(_0x5e946d,_0x4d1d22){_0x5e946d=_0x5e946d-0x0;var _0x3ceb9b=_0xdebc[_0x5e946d];return _0x3ceb9b;};'use strict';var _=require(_0xcdeb('0x0'));var util=require(_0xcdeb('0x1'));var moment=require(_0xcdeb('0x2'));var BPromise=require('bluebird');var rs=require(_0xcdeb('0x3'));var fs=require('fs');var Redis=require(_0xcdeb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdeb('0x5'));var logger=require('../../config/logger')(_0xcdeb('0x6'));var config=require(_0xcdeb('0x7'));var jayson=require(_0xcdeb('0x8'));var client=jayson['client'][_0xcdeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47af2e,_0x46967a,_0x3419e1){return new BPromise(function(_0x1dcad3,_0x232f3f){return client['request'](_0x47af2e,_0x3419e1)[_0xcdeb('0xa')](function(_0x230ed8){logger[_0xcdeb('0xb')](_0xcdeb('0xc'),_0x46967a,_0xcdeb('0xd'));logger[_0xcdeb('0xe')](_0xcdeb('0xf'),_0x46967a,_0xcdeb('0xd'),JSON[_0xcdeb('0x10')](_0x230ed8));if(_0x230ed8[_0xcdeb('0x11')]){if(_0x230ed8['error']['code']===0x1f4){logger[_0xcdeb('0x11')](_0xcdeb('0xc'),_0x46967a,_0x230ed8[_0xcdeb('0x11')][_0xcdeb('0x12')]);return _0x232f3f(_0x230ed8['error'][_0xcdeb('0x12')]);}logger[_0xcdeb('0x11')](_0xcdeb('0xc'),_0x46967a,_0x230ed8[_0xcdeb('0x11')]['message']);return _0x1dcad3(_0x230ed8[_0xcdeb('0x11')][_0xcdeb('0x12')]);}else{logger[_0xcdeb('0xb')]('Schedule,\x20%s,\x20%s',_0x46967a,'request\x20sent');_0x1dcad3(_0x230ed8[_0xcdeb('0x13')][_0xcdeb('0x12')]);}})[_0xcdeb('0x14')](function(_0x1c45cf){logger[_0xcdeb('0x11')](_0xcdeb('0xc'),_0x46967a,_0x1c45cf);_0x232f3f(_0x1c45cf);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 82245e1..b1daa6d 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 _0xf187=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/download','download','post','create','put'];(function(_0x544ddc,_0x1d1b9a){var _0x1855f2=function(_0x283125){while(--_0x283125){_0x544ddc['push'](_0x544ddc['shift']());}};_0x1855f2(++_0x1d1b9a);}(_0xf187,0x13c));var _0x7f18=function(_0x1242e5,_0x43a562){_0x1242e5=_0x1242e5-0x0;var _0x1f4d32=_0xf187[_0x1242e5];return _0x1f4d32;};'use strict';var multer=require('multer');var util=require(_0x7f18('0x0'));var path=require(_0x7f18('0x1'));var timeout=require(_0x7f18('0x2'));var express=require('express');var router=express[_0x7f18('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f18('0x4'));var interaction=require(_0x7f18('0x5'));var config=require(_0x7f18('0x6'));var controller=require(_0x7f18('0x7'));router['get']('/',auth[_0x7f18('0x8')](),controller[_0x7f18('0x9')]);router['get'](_0x7f18('0xa'),auth[_0x7f18('0x8')](),controller[_0x7f18('0xb')]);router['get'](_0x7f18('0xc'),auth[_0x7f18('0x8')](),controller[_0x7f18('0xd')]);router[_0x7f18('0xe')](_0x7f18('0xf'),auth[_0x7f18('0x8')](),controller[_0x7f18('0x10')]);router[_0x7f18('0x11')]('/',auth['isAuthenticated'](),controller[_0x7f18('0x12')]);router[_0x7f18('0x13')](_0x7f18('0xc'),auth[_0x7f18('0x8')](),controller[_0x7f18('0x14')]);router[_0x7f18('0x15')](_0x7f18('0xc'),auth[_0x7f18('0x8')](),controller[_0x7f18('0x16')]);module[_0x7f18('0x17')]=router; \ No newline at end of file +var _0xc86d=['/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x32663d,_0x454b23){var _0x1a4ad0=function(_0x53dabc){while(--_0x53dabc){_0x32663d['push'](_0x32663d['shift']());}};_0x1a4ad0(++_0x454b23);}(_0xc86d,0x10a));var _0xdc86=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xc86d[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0xdc86('0x0'));var util=require(_0xdc86('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc86('0x2'));var router=express['Router']();var fs_extra=require(_0xdc86('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdc86('0x4'));var config=require(_0xdc86('0x5'));var controller=require(_0xdc86('0x6'));router[_0xdc86('0x7')]('/',auth[_0xdc86('0x8')](),controller[_0xdc86('0x9')]);router[_0xdc86('0x7')](_0xdc86('0xa'),auth[_0xdc86('0x8')](),controller[_0xdc86('0xb')]);router[_0xdc86('0x7')](_0xdc86('0xc'),auth['isAuthenticated'](),controller[_0xdc86('0xd')]);router[_0xdc86('0x7')](_0xdc86('0xe'),auth[_0xdc86('0x8')](),controller[_0xdc86('0xf')]);router[_0xdc86('0x10')]('/',auth['isAuthenticated'](),controller[_0xdc86('0x11')]);router[_0xdc86('0x12')](_0xdc86('0xc'),auth[_0xdc86('0x8')](),controller[_0xdc86('0x13')]);router[_0xdc86('0x14')](_0xdc86('0xc'),auth[_0xdc86('0x8')](),controller[_0xdc86('0x15')]);module[_0xdc86('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 26b443e..0e88331 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 _0xbbbc=['format','toString','closedAt','createdAt','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','DATE'];(function(_0x6503ff,_0x2b169a){var _0x22e638=function(_0x53e4c4){while(--_0x53e4c4){_0x6503ff['push'](_0x6503ff['shift']());}};_0x22e638(++_0x2b169a);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x47be61,_0x199d0a){_0x47be61=_0x47be61-0x0;var _0x5d2ec5=_0xbbbc[_0x47be61];return _0x5d2ec5;};'use strict';var Sequelize=require(_0xcbbb('0x0'));var moment=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var config=require(_0xcbbb('0x3'));module[_0xcbbb('0x4')]={'format':{'type':Sequelize[_0xcbbb('0x5')],'get':function(){return this[_0xcbbb('0x6')]('value')?path[_0xcbbb('0x7')](this[_0xcbbb('0x6')](_0xcbbb('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0xcbbb('0x9')]},'channel':{'type':Sequelize[_0xcbbb('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x388197){var _0x1796b4=_0x388197[_0xcbbb('0xa')](/\\/g,'/');this[_0xcbbb('0xb')](_0xcbbb('0x8'),_0x1796b4);}},'rating':{'type':Sequelize[_0xcbbb('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xcbbb('0xc')],'set':function(_0x4ec90a){this[_0xcbbb('0xb')]('startedAt',moment()['subtract'](_0x4ec90a,'ms'));this[_0xcbbb('0xb')]('closedAt',moment());this[_0xcbbb('0xb')]('duration',_0x4ec90a);}},'startedAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')]('startedAt'))[_0xcbbb('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x10')))[_0xcbbb('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'createdAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0xcbbb('0xf')]();}},'updatedAt':{'type':Sequelize[_0xcbbb('0xd')],'get':function(){return moment(this[_0xcbbb('0x6')](_0xcbbb('0x12')))['format'](_0xcbbb('0x13'))['toString']();}}}; \ No newline at end of file +var _0x5532=['INTEGER','startedAt','subtract','duration','DATE','format','closedAt','MM-DD-YYYY\x20HH:mm','createdAt','toString','updatedAt','sequelize','moment','path','exports','getDataValue','value','extname','STRING','replace','setDataValue'];(function(_0x3701c8,_0x5b0b4f){var _0x11397c=function(_0x11919b){while(--_0x11919b){_0x3701c8['push'](_0x3701c8['shift']());}};_0x11397c(++_0x5b0b4f);}(_0x5532,0x19a));var _0x2553=function(_0x189b62,_0xe44b06){_0x189b62=_0x189b62-0x0;var _0xcd1405=_0x5532[_0x189b62];return _0xcd1405;};'use strict';var Sequelize=require(_0x2553('0x0'));var moment=require(_0x2553('0x1'));var path=require(_0x2553('0x2'));var config=require('../../config/environment');module[_0x2553('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2553('0x4')](_0x2553('0x5'))?path[_0x2553('0x6')](this['getDataValue'](_0x2553('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x2553('0x7')],'set':function(_0x2d718e){var _0x568778=_0x2d718e[_0x2553('0x8')](/\\/g,'/');this[_0x2553('0x9')](_0x2553('0x5'),_0x568778);}},'rating':{'type':Sequelize[_0x2553('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2553('0xa')],'set':function(_0x183d20){this[_0x2553('0x9')](_0x2553('0xb'),moment()[_0x2553('0xc')](_0x183d20,'ms'));this[_0x2553('0x9')]('closedAt',moment());this[_0x2553('0x9')](_0x2553('0xd'),_0x183d20);}},'startedAt':{'type':Sequelize[_0x2553('0xe')],'get':function(){return moment(this['getDataValue'](_0x2553('0xb')))[_0x2553('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x2553('0xe')],'get':function(){return moment(this['getDataValue'](_0x2553('0x10')))[_0x2553('0xf')](_0x2553('0x11'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2553('0x4')](_0x2553('0x12')))[_0x2553('0xf')](_0x2553('0x11'))[_0x2553('0x13')]();}},'updatedAt':{'type':Sequelize[_0x2553('0xe')],'get':function(){return moment(this['getDataValue'](_0x2553('0x14')))[_0x2553('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x2553('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 47331f1..af67c6f 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 _0xdc97=['join','root','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','ScreenRecording','includeAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid'];(function(_0x19e859,_0x333efb){var _0x481f06=function(_0x5736ee){while(--_0x5736ee){_0x19e859['push'](_0x19e859['shift']());}};_0x481f06(++_0x333efb);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4e3e01,_0x318dc5){_0x4e3e01=_0x4e3e01-0x0;var _0x69379c=_0xdc97[_0x4e3e01];return _0x69379c;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['ScreenRecording']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['differenceBy'](_[_0x7dc9('0x27')](_0x14083d,_0x7dc9('0x24')),[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x450124[_0x7dc9('0x29')]);_0x1fcf0e['filters']=_['intersection'](_0x1fcf0e['model'],_0x1fcf0e[_0x7dc9('0x29')]);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e[_0x7dc9('0x2c')],qs[_0x7dc9('0x2d')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x229f8e[_0x7dc9('0x2e')]=_0x229f8e[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x229f8e['attributes']:_0x1fcf0e[_0x7dc9('0x2c')];if(!_0x450124['query'][_0x7dc9('0x30')](_0x7dc9('0x31'))){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124['query'][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query']['offset']);}_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x33')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x33')]);_0x229f8e['where']=qs[_0x7dc9('0x34')](_[_0x7dc9('0x35')](_0x450124[_0x7dc9('0x29')],_0x1fcf0e[_0x7dc9('0x34')]),_0x14083d);if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]){_0x229f8e[_0x7dc9('0x37')]=_[_0x7dc9('0x38')](_0x229f8e[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x452aed){if(_0x452aed[_0x7dc9('0x39')]!=='VIRTUAL'){var _0x34b5c9={};_0x34b5c9[_0x452aed[_0x7dc9('0x24')]]={'$like':'%'+_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]+'%'};return _0x34b5c9;}})});}_0x229f8e=_['merge']({},_0x229f8e,_0x450124[_0x7dc9('0x3a')]);var _0x89db0e={'where':_0x229f8e[_0x7dc9('0x37')]};return db[_0x7dc9('0x3b')][_0x7dc9('0x1b')](_0x89db0e)[_0x7dc9('0x21')](function(_0x5a1201){_0x3c4379['count']=_0x5a1201;if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x3c')]){_0x229f8e['include']=[{'all':!![]}];}return db[_0x7dc9('0x3b')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x2a91fe){_0x3c4379[_0x7dc9('0x3d')]=_0x2a91fe;return _0x3c4379;})['then'](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3e')](handleError(_0x236d42,null));};exports[_0x7dc9('0x3f')]=function(_0x1929b6,_0x95513c){var _0x28ffc0={'raw':![],'where':{'id':_0x1929b6[_0x7dc9('0x40')]['id']}},_0x23499a={};_0x23499a['model']=_[_0x7dc9('0x2a')](db['ScreenRecording']['rawAttributes']);_0x23499a[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x1929b6[_0x7dc9('0x29')]);_0x23499a[_0x7dc9('0x34')]=_[_0x7dc9('0x2b')](_0x23499a[_0x7dc9('0x2c')],_0x23499a[_0x7dc9('0x29')]);_0x28ffc0[_0x7dc9('0x2e')]=_[_0x7dc9('0x2b')](_0x23499a['model'],qs[_0x7dc9('0x2d')](_0x1929b6[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x28ffc0[_0x7dc9('0x2e')]=_0x28ffc0[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x28ffc0['attributes']:_0x23499a[_0x7dc9('0x2c')];if(_0x1929b6[_0x7dc9('0x29')]['includeAll']){_0x28ffc0[_0x7dc9('0x41')]=[{'all':!![]}];}_0x28ffc0=_[_0x7dc9('0x38')]({},_0x28ffc0,_0x1929b6[_0x7dc9('0x3a')]);return db['ScreenRecording'][_0x7dc9('0x42')](_0x28ffc0)['then'](handleEntityNotFound(_0x95513c,null))['then'](respondWithResult(_0x95513c,null))[_0x7dc9('0x3e')](handleError(_0x95513c,null));};exports[_0x7dc9('0x43')]=function(_0x36d591,_0x5e0dc5){return db['ScreenRecording'][_0x7dc9('0x43')](_0x36d591['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5e0dc5,0xc9))[_0x7dc9('0x3e')](handleError(_0x5e0dc5,null));};exports['update']=function(_0x24ccce,_0x1d6c0a){if(_0x24ccce[_0x7dc9('0x44')]['id']){delete _0x24ccce[_0x7dc9('0x44')]['id'];}delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x45')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x46')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x47')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x48')];return db[_0x7dc9('0x3b')]['find']({'where':{'id':_0x24ccce[_0x7dc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d6c0a,null))['then'](saveUpdates(_0x24ccce[_0x7dc9('0x44')],null))[_0x7dc9('0x21')](respondWithResult(_0x1d6c0a,null))[_0x7dc9('0x3e')](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x49')]=function(_0x346d27,_0x510e2a){return db[_0x7dc9('0x3b')][_0x7dc9('0x49')]()[_0x7dc9('0x21')](respondWithResult(_0x510e2a,null))['catch'](handleError(_0x510e2a,null));};exports[_0x7dc9('0x4a')]=function(_0x3fc164,_0x2cf133,_0x32bc31){var _0xf41b8c=require(_0x7dc9('0x4b'));var _0x593132=![];var _0x366b8b={};if(_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]&&_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]===_0x7dc9('0x4c')){_0x366b8b[_0x7dc9('0x4c')]=_0x3fc164[_0x7dc9('0x40')]['id'];}else{_0x366b8b['id']=_0x3fc164[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':_0x366b8b,'attributes':['id',_0x7dc9('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x2cf133,null))[_0x7dc9('0x21')](function(_0x39be46){if(_0x39be46){var _0x38df9a=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x39be46[_0x7dc9('0x48')]);var _0xd8d327=util[_0x7dc9('0x28')](_0x7dc9('0x4f'),_0x38df9a);if(fs[_0x7dc9('0x50')](_0xd8d327)){_0x593132=!![];return _0xf41b8c[_0x7dc9('0x51')](_0xd8d327,_0x38df9a,config['secrets']['recording'])['then'](function(){return _0x39be46;});}return _0x39be46;}})[_0x7dc9('0x21')](function(_0x3daf33){if(_0x3daf33){var _0x32a64f=path[_0x7dc9('0x4d')](config['root'],'server/files/screen_recordings',_0x3daf33[_0x7dc9('0x48')]);if(!fs[_0x7dc9('0x50')](_0x32a64f)){throw new db[(_0x7dc9('0x52'))][(_0x7dc9('0x53'))](_0x7dc9('0x54'));}if(_0x3daf33[_0x7dc9('0x55')]){return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,_0x3daf33['filename']+path[_0x7dc9('0x56')](_0x32a64f),function(){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}else{return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,function(_0x1dad95){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}}})['catch'](function(_0x175858){if(_0x175858[_0x7dc9('0x58')]===_0x7dc9('0x54')){_0x2cf133[_0x7dc9('0x16')](0x194)[_0x7dc9('0x25')](_0x7dc9('0x59'));}else{return handleError(_0x2cf133,null);}});};exports[_0x7dc9('0x5a')]=function(_0x2a02ed,_0x3463e4){return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':{'id':_0x2a02ed[_0x7dc9('0x40')]['id']}})[_0x7dc9('0x21')](function(_0x5eee27){if(_[_0x7dc9('0x5b')](_0x5eee27)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5eee27;})[_0x7dc9('0x21')](function(_0x15cf19){var _0x48ea37=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x15cf19[_0x7dc9('0x48')]);logger[_0x7dc9('0x5c')](_0x7dc9('0x5d'),_0x48ea37);if(!_['isNil'](_0x15cf19['value'])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger[_0x7dc9('0x5c')](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}_0x48ea37=_0x48ea37+_0x7dc9('0x61');if(!_[_0x7dc9('0x5b')](_0x15cf19[_0x7dc9('0x48')])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger['info'](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}return _0x15cf19;})['then'](function(_0x4f80bd){if(!_0x4f80bd)throw new InternalError();return _0x4f80bd[_0x7dc9('0x5a')]();})[_0x7dc9('0x21')](function(){_0x3463e4[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();})['catch'](handleError(_0x3463e4,null));}; \ No newline at end of file +var _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2777c6,_0x4dd533){_0x2777c6=_0x2777c6-0x0;var _0x511622=_0xb4c7[_0x2777c6];return _0x511622;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3d6ecd1..3e3e614 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 _0xf5ee=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','interactionid'];(function(_0x5783aa,_0x2aa482){var _0x3a3fe1=function(_0x568e89){while(--_0x568e89){_0x5783aa['push'](_0x5783aa['shift']());}};_0x3a3fe1(++_0x2aa482);}(_0xf5ee,0x1e0));var _0xef5e=function(_0x3e6401,_0x12ef0e){_0x3e6401=_0x3e6401-0x0;var _0x3b1f5a=_0xf5ee[_0x3e6401];return _0x3b1f5a;};'use strict';var _=require('lodash');var util=require(_0xef5e('0x0'));var logger=require(_0xef5e('0x1'))(_0xef5e('0x2'));var moment=require(_0xef5e('0x3'));var BPromise=require(_0xef5e('0x4'));var rp=require(_0xef5e('0x5'));var fs=require('fs');var path=require(_0xef5e('0x6'));var rimraf=require('rimraf');var config=require(_0xef5e('0x7'));var attributes=require(_0xef5e('0x8'));module[_0xef5e('0x9')]=function(_0x13d8e0,_0x18358e){return _0x13d8e0[_0xef5e('0xa')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xef5e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8615=['define','ScreenRecording','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e271e,_0x42e44d){var _0x5ac70b=function(_0x451766){while(--_0x451766){_0x3e271e['push'](_0x3e271e['shift']());}};_0x5ac70b(++_0x42e44d);}(_0x8615,0x15f));var _0x5861=function(_0xdd27d1,_0xb6f0da){_0xdd27d1=_0xdd27d1-0x0;var _0x58220e=_0x8615[_0xdd27d1];return _0x58220e;};'use strict';var _=require(_0x5861('0x0'));var util=require(_0x5861('0x1'));var logger=require('../../config/logger')(_0x5861('0x2'));var moment=require(_0x5861('0x3'));var BPromise=require(_0x5861('0x4'));var rp=require(_0x5861('0x5'));var fs=require('fs');var path=require(_0x5861('0x6'));var rimraf=require(_0x5861('0x7'));var config=require(_0x5861('0x8'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x24b31e,_0x51d64b){return _0x24b31e[_0x5861('0x9')](_0x5861('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x5861('0xb'),'fields':[_0x5861('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 213b6d1..40a0e5c 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 _0x1862=['debug','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x12b1a6,_0x22df2d){var _0x5813d3=function(_0x57773e){while(--_0x57773e){_0x12b1a6['push'](_0x12b1a6['shift']());}};_0x5813d3(++_0x22df2d);}(_0x1862,0x1ce));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2186('0x0'));var util=require('util');var moment=require(_0x2186('0x1'));var BPromise=require(_0x2186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2186('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2186('0x4'))(_0x2186('0x5'));var config=require(_0x2186('0x6'));var jayson=require(_0x2186('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f49ae,_0x5c30af,_0x556749){return new BPromise(function(_0x29b090,_0x1f6868){return client[_0x2186('0x8')](_0x1f49ae,_0x556749)[_0x2186('0x9')](function(_0x35e56e){logger[_0x2186('0xa')](_0x2186('0xb'),_0x5c30af,_0x2186('0xc'));logger[_0x2186('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x5c30af,_0x2186('0xc'),JSON['stringify'](_0x35e56e));if(_0x35e56e[_0x2186('0xe')]){if(_0x35e56e['error'][_0x2186('0xf')]===0x1f4){logger['error'](_0x2186('0xb'),_0x5c30af,_0x35e56e[_0x2186('0xe')][_0x2186('0x10')]);return _0x1f6868(_0x35e56e[_0x2186('0xe')][_0x2186('0x10')]);}logger[_0x2186('0xe')](_0x2186('0xb'),_0x5c30af,_0x35e56e['error'][_0x2186('0x10')]);return _0x29b090(_0x35e56e['error']['message']);}else{logger[_0x2186('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x5c30af,_0x2186('0xc'));_0x29b090(_0x35e56e[_0x2186('0x11')][_0x2186('0x10')]);}})[_0x2186('0x12')](function(_0x323780){logger[_0x2186('0xe')](_0x2186('0xb'),_0x5c30af,_0x323780);_0x1f6868(_0x323780);});});} \ No newline at end of file +var _0x203a=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x1e82af,_0x17f514){var _0x20e8aa=function(_0x533fb0){while(--_0x533fb0){_0x1e82af['push'](_0x1e82af['shift']());}};_0x20e8aa(++_0x17f514);}(_0x203a,0x95));var _0xa203=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x203a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xa203('0x0'));var util=require(_0xa203('0x1'));var moment=require(_0xa203('0x2'));var BPromise=require('bluebird');var rs=require(_0xa203('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa203('0x4'))['db'];var utils=require(_0xa203('0x5'));var logger=require(_0xa203('0x6'))('rpc');var config=require(_0xa203('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa203('0x8')][_0xa203('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f310e,_0x134a03,_0x14610a){return new BPromise(function(_0xe3559a,_0x10dff7){return client[_0xa203('0xa')](_0x4f310e,_0x14610a)[_0xa203('0xb')](function(_0x12c277){logger[_0xa203('0xc')](_0xa203('0xd'),_0x134a03,'request\x20sent');logger[_0xa203('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x134a03,_0xa203('0xf'),JSON[_0xa203('0x10')](_0x12c277));if(_0x12c277[_0xa203('0x11')]){if(_0x12c277['error'][_0xa203('0x12')]===0x1f4){logger['error'](_0xa203('0xd'),_0x134a03,_0x12c277['error'][_0xa203('0x13')]);return _0x10dff7(_0x12c277[_0xa203('0x11')]['message']);}logger[_0xa203('0x11')](_0xa203('0xd'),_0x134a03,_0x12c277[_0xa203('0x11')]['message']);return _0xe3559a(_0x12c277[_0xa203('0x11')][_0xa203('0x13')]);}else{logger[_0xa203('0xc')](_0xa203('0xd'),_0x134a03,_0xa203('0xf'));_0xe3559a(_0x12c277['result'][_0xa203('0x13')]);}})[_0xa203('0x14')](function(_0x4e7e39){logger['error'](_0xa203('0xd'),_0x134a03,_0x4e7e39);_0x10dff7(_0x4e7e39);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index b55b00f..75f6095 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 _0x57fd=['addLogoLogin','addPreferred','server/files/images/logos/','addFavicon','put','isAuthenticated','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','index','get','/now','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','format','logo','extname','post','/:id/logo','single','file','addLogo','join','root','%s%s','logologin','originalname'];(function(_0x409e33,_0xe16891){var _0x550815=function(_0x5d5a7f){while(--_0x5d5a7f){_0x409e33['push'](_0x409e33['shift']());}};_0x550815(++_0xe16891);}(_0x57fd,0xaf));var _0xd57f=function(_0x1563d1,_0x17e733){_0x1563d1=_0x1563d1-0x0;var _0x12c7cd=_0x57fd[_0x1563d1];return _0x12c7cd;};'use strict';var multer=require(_0xd57f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd57f('0x1'));var express=require(_0xd57f('0x2'));var router=express[_0xd57f('0x3')]();var fs_extra=require(_0xd57f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd57f('0x5'));var config=require(_0xd57f('0x6'));var controller=require(_0xd57f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd57f('0x8')]);router[_0xd57f('0x9')](_0xd57f('0xa'),controller['getDate']);router[_0xd57f('0x9')](_0xd57f('0xb'),controller['show']);router[_0xd57f('0x9')]('/:id/logo',controller[_0xd57f('0xc')]);router[_0xd57f('0x9')](_0xd57f('0xd'),controller[_0xd57f('0xe')]);router[_0xd57f('0x9')](_0xd57f('0xf'),controller[_0xd57f('0x10')]);router['get'](_0xd57f('0x11'),controller[_0xd57f('0x12')]);router[_0xd57f('0x9')](_0xd57f('0x13'),controller[_0xd57f('0x14')]);var upload=multer({'storage':multer[_0xd57f('0x15')]({'destination':function(_0x2b0764,_0x66a8f0,_0xa6d35f){_0xa6d35f(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x147ef6,_0xe9558a,_0xb80081){_0xb80081(null,util[_0xd57f('0x16')]('%s%s',_0xd57f('0x17'),path[_0xd57f('0x18')](_0xe9558a['originalname'])));}})});router[_0xd57f('0x19')](_0xd57f('0x1a'),upload[_0xd57f('0x1b')](_0xd57f('0x1c')),controller[_0xd57f('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ca676,_0x4bb80b,_0x54b8ac){_0x54b8ac(null,path[_0xd57f('0x1e')](config[_0xd57f('0x1f')],'server/files/images/logos/'));},'filename':function(_0x2bbd3a,_0x3a3eae,_0xae082c){_0xae082c(null,util[_0xd57f('0x16')](_0xd57f('0x20'),_0xd57f('0x21'),path[_0xd57f('0x18')](_0x3a3eae[_0xd57f('0x22')])));}})});router[_0xd57f('0x19')](_0xd57f('0xd'),upload[_0xd57f('0x1b')](_0xd57f('0x1c')),controller[_0xd57f('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x216313,_0x3f1be3,_0x9421){_0x9421(null,path[_0xd57f('0x1e')](config[_0xd57f('0x1f')],'server/files/images/logos/'));},'filename':function(_0x13763f,_0x22dc7b,_0x1e1126){_0x1e1126(null,util[_0xd57f('0x16')](_0xd57f('0x20'),'preferred',path[_0xd57f('0x18')](_0x22dc7b[_0xd57f('0x22')])));}})});router[_0xd57f('0x19')](_0xd57f('0x11'),upload[_0xd57f('0x1b')](_0xd57f('0x1c')),controller[_0xd57f('0x24')]);var upload=multer({'storage':multer[_0xd57f('0x15')]({'destination':function(_0x5d8c10,_0x2127f3,_0x12b536){_0x12b536(null,path[_0xd57f('0x1e')](config[_0xd57f('0x1f')],_0xd57f('0x25')));},'filename':function(_0x31d99a,_0x2b0dad,_0x5185b4){_0x5185b4(null,util['format'](_0xd57f('0x20'),'favicon',path[_0xd57f('0x18')](_0x2b0dad[_0xd57f('0x22')])));}})});router['post'](_0xd57f('0x13'),upload['single'](_0xd57f('0x1c')),controller[_0xd57f('0x26')]);router[_0xd57f('0x27')]('/:id',auth[_0xd57f('0x28')](),controller['update']);module[_0xd57f('0x29')]=router; \ No newline at end of file +var _0xb7de=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','format','%s%s','originalname','post','file','addLogo','server/files/images/logos/','extname','single','diskStorage','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer'];(function(_0x483f0,_0x329df8){var _0x59a8eb=function(_0x369025){while(--_0x369025){_0x483f0['push'](_0x483f0['shift']());}};_0x59a8eb(++_0x329df8);}(_0xb7de,0xc7));var _0xeb7d=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xb7de[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var path=require(_0xeb7d('0x2'));var timeout=require('connect-timeout');var express=require(_0xeb7d('0x3'));var router=express[_0xeb7d('0x4')]();var fs_extra=require(_0xeb7d('0x5'));var auth=require(_0xeb7d('0x6'));var interaction=require(_0xeb7d('0x7'));var config=require('../../config/environment');var controller=require(_0xeb7d('0x8'));router[_0xeb7d('0x9')]('/',auth[_0xeb7d('0xa')](),controller[_0xeb7d('0xb')]);router[_0xeb7d('0x9')]('/now',controller['getDate']);router[_0xeb7d('0x9')](_0xeb7d('0xc'),controller[_0xeb7d('0xd')]);router[_0xeb7d('0x9')]('/:id/logo',controller[_0xeb7d('0xe')]);router[_0xeb7d('0x9')](_0xeb7d('0xf'),controller['getLogoLogin']);router['get'](_0xeb7d('0x10'),controller['gdpr']);router[_0xeb7d('0x9')](_0xeb7d('0x11'),controller[_0xeb7d('0x12')]);router[_0xeb7d('0x9')](_0xeb7d('0x13'),controller[_0xeb7d('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2defe5,_0x2fabf1,_0x296355){_0x296355(null,path[_0xeb7d('0x15')](config[_0xeb7d('0x16')],'server/files/images/logos/'));},'filename':function(_0xdc94e7,_0x598da2,_0x284575){_0x284575(null,util[_0xeb7d('0x17')](_0xeb7d('0x18'),'logo',path['extname'](_0x598da2[_0xeb7d('0x19')])));}})});router[_0xeb7d('0x1a')]('/:id/logo',upload['single'](_0xeb7d('0x1b')),controller[_0xeb7d('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bfa8a,_0x4584c2,_0x32fb0b){_0x32fb0b(null,path[_0xeb7d('0x15')](config[_0xeb7d('0x16')],_0xeb7d('0x1d')));},'filename':function(_0xa47b92,_0x38d591,_0x4023ff){_0x4023ff(null,util['format'](_0xeb7d('0x18'),'logologin',path[_0xeb7d('0x1e')](_0x38d591[_0xeb7d('0x19')])));}})});router[_0xeb7d('0x1a')]('/:id/logo_login',upload[_0xeb7d('0x1f')](_0xeb7d('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xeb7d('0x20')]({'destination':function(_0x374f35,_0x431dc0,_0x3666db){_0x3666db(null,path[_0xeb7d('0x15')](config[_0xeb7d('0x16')],_0xeb7d('0x1d')));},'filename':function(_0x4833b6,_0x3ac528,_0x392ba1){_0x392ba1(null,util[_0xeb7d('0x17')](_0xeb7d('0x18'),_0xeb7d('0x21'),path[_0xeb7d('0x1e')](_0x3ac528[_0xeb7d('0x19')])));}})});router['post'](_0xeb7d('0x11'),upload[_0xeb7d('0x1f')](_0xeb7d('0x1b')),controller[_0xeb7d('0x22')]);var upload=multer({'storage':multer[_0xeb7d('0x20')]({'destination':function(_0x32c518,_0x58ba4f,_0x310f25){_0x310f25(null,path[_0xeb7d('0x15')](config['root'],_0xeb7d('0x1d')));},'filename':function(_0x3fcff4,_0x9abd4b,_0xc1c4c6){_0xc1c4c6(null,util[_0xeb7d('0x17')](_0xeb7d('0x18'),_0xeb7d('0x23'),path[_0xeb7d('0x1e')](_0x9abd4b[_0xeb7d('0x19')])));}})});router[_0xeb7d('0x1a')](_0xeb7d('0x13'),upload[_0xeb7d('0x1f')](_0xeb7d('0x1b')),controller[_0xeb7d('0x24')]);router[_0xeb7d('0x25')](_0xeb7d('0xc'),auth[_0xeb7d('0xa')](),controller[_0xeb7d('0x26')]);module[_0xeb7d('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8e68c06..0733f33 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0xdadd07,_0x367d87){var _0x507886=function(_0x34d79a){while(--_0x34d79a){_0xdadd07['push'](_0xdadd07['shift']());}};_0x507886(++_0x367d87);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a42ca,_0x4beefe){_0x4a42ca=_0x4a42ca-0x0;var _0x23a3f6=_0x5f2f[_0x4a42ca];return _0x23a3f6;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x5f66=['STRING','BOOLEAN','UNSIGNED','exports','min_internal','INTEGER','min_mailbox'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x65f6('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x65f6('0x2')](0xb),'unique':_0x65f6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x65f6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x65f6('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x65f6('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x65f6('0x4')]},'turnaddr':{'type':Sequelize[_0x65f6('0x4')]},'turnusername':{'type':Sequelize[_0x65f6('0x4')]},'turnpassword':{'type':Sequelize[_0x65f6('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x65f6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x65f6('0x4')]},'defaultPreferred':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x65f6('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x65f6('0x4')]},'defaultFavicon':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x65f6('0x4')]},'sentiment':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x65f6('0x2')]},'sentimentRegion':{'type':Sequelize[_0x65f6('0x4')]},'language':{'type':Sequelize[_0x65f6('0x4')]},'bucket':{'type':Sequelize[_0x65f6('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x65f6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x65f6('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 5904b7b..7909922 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 _0x394f=['default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','map','Setting','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','intersection','length','include','body','find','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg'];(function(_0x125dfa,_0x2cace0){var _0x2ded9b=function(_0x44a2ad){while(--_0x44a2ad){_0x125dfa['push'](_0x125dfa['shift']());}};_0x2ded9b(++_0x2cace0);}(_0x394f,0x8f));var _0xf394=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x394f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf394('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf394('0x1'));var jsonpatch=require(_0xf394('0x2'));var rp=require(_0xf394('0x3'));var moment=require(_0xf394('0x4'));var BPromise=require(_0xf394('0x5'));var Mustache=require(_0xf394('0x6'));var util=require(_0xf394('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf394('0x8'));var squel=require(_0xf394('0x9'));var crypto=require(_0xf394('0xa'));var jsforce=require(_0xf394('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf394('0xc'));var Redis=require(_0xf394('0xd'));var authService=require(_0xf394('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf394('0xf'));var hardwareService=require(_0xf394('0x10'));var logger=require('../../config/logger')(_0xf394('0x11'));var utils=require(_0xf394('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf394('0x13'))['db'];var jayson=require(_0xf394('0x14'));var client=jayson[_0xf394('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2668ce,_0x509d8a,_0x5eb3a2,_0x457117){return new BPromise(function(_0x56bfa0,_0xad56c9){var _0x25c4cd=_0x457117||client;return _0x25c4cd[_0xf394('0x16')](_0x2668ce,_0x5eb3a2)[_0xf394('0x17')](function(_0x2374a9){logger[_0xf394('0x18')](_0xf394('0x19'),_0x509d8a,'request\x20sent');logger[_0xf394('0x1a')]('Setting,\x20%s,\x20%s,\x20%s',_0x509d8a,'request\x20sent',JSON[_0xf394('0x1b')](_0x2374a9));if(_0x2374a9[_0xf394('0x1c')]){if(_0x2374a9[_0xf394('0x1c')]['code']===0x1f4){logger[_0xf394('0x1c')]('Setting,\x20%s,\x20%s',_0x509d8a,_0x2374a9[_0xf394('0x1c')]['message']);return _0xad56c9(_0x2374a9['error'][_0xf394('0x1d')]);}logger[_0xf394('0x1c')](_0xf394('0x19'),_0x509d8a,_0x2374a9['error'][_0xf394('0x1d')]);return _0x56bfa0(_0x2374a9[_0xf394('0x1c')][_0xf394('0x1d')]);}else{logger[_0xf394('0x18')](_0xf394('0x19'),_0x509d8a,'request\x20sent');_0x56bfa0(_0x2374a9['result'][_0xf394('0x1d')]);}})[_0xf394('0x1e')](function(_0x4a59bf){logger[_0xf394('0x1c')](_0xf394('0x19'),_0x509d8a,_0x4a59bf);_0xad56c9(_0x4a59bf);});});}function respondWithStatusCode(_0x310157,_0xf2985e){_0xf2985e=_0xf2985e||0xcc;return function(_0x4abe18){if(_0x4abe18){return _0x310157[_0xf394('0x1f')](_0xf2985e);}return _0x310157[_0xf394('0x20')](_0xf2985e)[_0xf394('0x21')]();};}function respondWithResult(_0x13797a,_0x2a30b6){_0x2a30b6=_0x2a30b6||0xc8;return function(_0x4fc8f8){if(_0x4fc8f8){return _0x13797a[_0xf394('0x20')](_0x2a30b6)[_0xf394('0x22')](_0x4fc8f8);}};}function respondWithFilteredResult(_0x593277,_0x1bf372){return function(_0x2e4cba){if(_0x2e4cba){var _0x53e2fc=typeof _0x1bf372[_0xf394('0x23')]===_0xf394('0x24')&&typeof _0x1bf372[_0xf394('0x25')]===_0xf394('0x24');var _0x229c8c=_0x2e4cba[_0xf394('0x26')];var _0x294a3c=_0x53e2fc?0x0:_0x1bf372[_0xf394('0x23')];var _0x224aa2=_0x53e2fc?_0x2e4cba['count']:_0x1bf372[_0xf394('0x23')]+_0x1bf372[_0xf394('0x25')];var _0x205d40;if(_0x224aa2>=_0x229c8c){_0x224aa2=_0x229c8c;_0x205d40=0xc8;}else{_0x205d40=0xce;}_0x593277['status'](_0x205d40);return _0x593277[_0xf394('0x27')](_0xf394('0x28'),_0x294a3c+'-'+_0x224aa2+'/'+_0x229c8c)['json'](_0x2e4cba);}return null;};}function patchUpdates(_0x21f5f8){return function(_0x264f94){try{jsonpatch[_0xf394('0x29')](_0x264f94,_0x21f5f8,!![]);}catch(_0xfe7df2){return BPromise[_0xf394('0x2a')](_0xfe7df2);}return _0x264f94['save']();};}function saveUpdates(_0x438a95,_0x5d5aa1){return function(_0x2e7382){if(_0x2e7382){return _0x2e7382[_0xf394('0x2b')](_0x438a95)[_0xf394('0x17')](function(_0x5ab843){return _0x5ab843;});}return null;};}function removeEntity(_0x3f6b47,_0x3e8d6a){return function(_0x3f3660){if(_0x3f3660){return _0x3f3660[_0xf394('0x2c')]()[_0xf394('0x17')](function(){_0x3f6b47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1acba6,_0x3e7fd1){return function(_0x250520){if(!_0x250520){_0x1acba6[_0xf394('0x1f')](0x194);}return _0x250520;};}function handleError(_0x1fdec7,_0x94adf9){_0x94adf9=_0x94adf9||0x1f4;return function(_0x5c1686){logger[_0xf394('0x1c')](_0x5c1686[_0xf394('0x2d')]);if(_0x5c1686[_0xf394('0x2e')]){delete _0x5c1686[_0xf394('0x2e')];}_0x1fdec7[_0xf394('0x20')](_0x94adf9)['send'](_0x5c1686);};}exports['index']=function(_0x2267d1,_0x5dfb96){var _0x1c6be2={},_0x98796b={},_0x221184={'count':0x0,'rows':[]};var _0x4186d9=_[_0xf394('0x2f')](db[_0xf394('0x30')]['rawAttributes'],function(_0x1f3e97){return{'name':_0x1f3e97[_0xf394('0x31')],'type':_0x1f3e97[_0xf394('0x32')][_0xf394('0x33')]};});_0x98796b[_0xf394('0x34')]=_[_0xf394('0x2f')](_0x4186d9,_0xf394('0x2e'));_0x98796b[_0xf394('0x35')]=_[_0xf394('0x36')](_0x2267d1['query']);_0x98796b[_0xf394('0x37')]=_['intersection'](_0x98796b[_0xf394('0x34')],_0x98796b[_0xf394('0x35')]);_0x1c6be2['attributes']=_['intersection'](_0x98796b[_0xf394('0x34')],qs[_0xf394('0x38')](_0x2267d1[_0xf394('0x35')][_0xf394('0x38')]));_0x1c6be2[_0xf394('0x39')]=_0x1c6be2[_0xf394('0x39')]['length']?_0x1c6be2[_0xf394('0x39')]:_0x98796b['model'];if(!_0x2267d1[_0xf394('0x35')][_0xf394('0x3a')](_0xf394('0x3b'))){_0x1c6be2[_0xf394('0x25')]=qs[_0xf394('0x25')](_0x2267d1['query']['limit']);_0x1c6be2[_0xf394('0x23')]=qs[_0xf394('0x23')](_0x2267d1[_0xf394('0x35')]['offset']);}_0x1c6be2[_0xf394('0x3c')]=qs[_0xf394('0x3d')](_0x2267d1['query'][_0xf394('0x3d')]);_0x1c6be2['where']=qs[_0xf394('0x37')](_['pick'](_0x2267d1[_0xf394('0x35')],_0x98796b['filters']),_0x4186d9);if(_0x2267d1['query'][_0xf394('0x3e')]){_0x1c6be2['where']=_[_0xf394('0x3f')](_0x1c6be2[_0xf394('0x40')],{'$or':_[_0xf394('0x2f')](_0x4186d9,function(_0xc77d2d){if(_0xc77d2d[_0xf394('0x32')]!==_0xf394('0x41')){var _0x18e73e={};_0x18e73e[_0xc77d2d[_0xf394('0x2e')]]={'$like':'%'+_0x2267d1[_0xf394('0x35')][_0xf394('0x3e')]+'%'};return _0x18e73e;}})});}_0x1c6be2=_[_0xf394('0x3f')]({},_0x1c6be2,_0x2267d1[_0xf394('0x42')]);var _0x51c719={'where':_0x1c6be2[_0xf394('0x40')]};return db['Setting'][_0xf394('0x26')](_0x51c719)['then'](function(_0x2736a3){_0x221184['count']=_0x2736a3;if(_0x2267d1['query'][_0xf394('0x43')]){_0x1c6be2['include']=[{'all':!![]}];}return db[_0xf394('0x30')][_0xf394('0x44')](_0x1c6be2);})[_0xf394('0x17')](function(_0x17e537){_0x221184[_0xf394('0x45')]=_0x17e537;return _0x221184;})[_0xf394('0x17')](respondWithFilteredResult(_0x5dfb96,_0x1c6be2))[_0xf394('0x1e')](handleError(_0x5dfb96,null));};exports[_0xf394('0x46')]=function(_0x29c23d,_0x3f6c62){var _0x9a8862={'raw':![],'where':{'id':_0x29c23d['params']['id']}},_0x42f1ba={};_0x42f1ba[_0xf394('0x34')]=_['keys'](db['Setting']['rawAttributes']);_0x42f1ba['query']=_[_0xf394('0x36')](_0x29c23d[_0xf394('0x35')]);_0x42f1ba['filters']=_[_0xf394('0x47')](_0x42f1ba[_0xf394('0x34')],_0x42f1ba[_0xf394('0x35')]);_0x9a8862['attributes']=_[_0xf394('0x47')](_0x42f1ba[_0xf394('0x34')],qs[_0xf394('0x38')](_0x29c23d[_0xf394('0x35')]['fields']));_0x9a8862[_0xf394('0x39')]=_0x9a8862['attributes'][_0xf394('0x48')]?_0x9a8862[_0xf394('0x39')]:_0x42f1ba['model'];if(_0x29c23d['query'][_0xf394('0x43')]){_0x9a8862[_0xf394('0x49')]=[{'all':!![]}];}_0x9a8862=_['merge']({},_0x9a8862,_0x29c23d[_0xf394('0x42')]);return db[_0xf394('0x30')]['find'](_0x9a8862)[_0xf394('0x17')](handleEntityNotFound(_0x3f6c62,null))[_0xf394('0x17')](respondWithResult(_0x3f6c62,null))['catch'](handleError(_0x3f6c62,null));};exports[_0xf394('0x2b')]=function(_0x3ce93b,_0x36a33e){if(_0x3ce93b['body']['id']){delete _0x3ce93b[_0xf394('0x4a')]['id'];}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x3ce93b[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36a33e,null))['then'](saveUpdates(_0x3ce93b[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x36a33e,null))['catch'](handleError(_0x36a33e,null));};exports[_0xf394('0x4d')]=function(_0x486fe1,_0xcfbf09,_0x3073b4){if(_0x486fe1[_0xf394('0x4e')]&&_0x486fe1[_0xf394('0x4e')][_0xf394('0x4f')]){_0x486fe1['body'][_0xf394('0x50')]=_0x486fe1[_0xf394('0x4e')][_0xf394('0x4f')];}return db['Setting'][_0xf394('0x4b')]({'where':{'id':_0x486fe1[_0xf394('0x4c')]['id']}})[_0xf394('0x17')](handleEntityNotFound(_0xcfbf09,null))[_0xf394('0x17')](saveUpdates(_0x486fe1[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0xcfbf09,null))[_0xf394('0x1e')](handleError(_0xcfbf09,null));};exports[_0xf394('0x51')]=function(_0x1b3c8b,_0x37019e,_0x4641f9){if(_0x1b3c8b[_0xf394('0x4e')]&&_0x1b3c8b[_0xf394('0x4e')][_0xf394('0x4f')]){_0x1b3c8b[_0xf394('0x4a')][_0xf394('0x52')]=_0x1b3c8b['file'][_0xf394('0x4f')];}return db['Setting'][_0xf394('0x4b')]({'where':{'id':_0x1b3c8b[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37019e,null))['then'](saveUpdates(_0x1b3c8b[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x37019e,null))['catch'](handleError(_0x37019e,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x1b8cd2,_0x15050b,_0x5c83d8){var _0x4cb2ff='server/files/images/logos';var _0x2c2a02={'custom':![]};return utilLicense[_0xf394('0x53')]()[_0xf394('0x17')](function(_0x1b4091){if(_0x1b4091){_0x2c2a02=_0x1b4091;}return db[_0xf394('0x30')]['find']({'where':{'id':_0x1b8cd2[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),'loginLogo',_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),_0xf394('0x57'),_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x15050b,null))[_0xf394('0x17')](function(_0x232c52){if(_0x232c52){var _0x2bf8e0=_0x232c52[_0xf394('0x50')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0x232c52['logo'])))?path['join'](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0x232c52[_0xf394('0x50')])):path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x4cb2ff,_[_0xf394('0x5c')](_0xf394('0x5e')));var _0xaf657d=_0xf394('0x5f')+_[_0xf394('0x60')]('logo');if(_0x232c52[_0xaf657d]||!_0x2c2a02[_0xf394('0x61')]){_0x2bf8e0=path['join'](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0xf394('0x5e')));}if(!fs['existsSync'](_0x2bf8e0)){throw new db[(_0xf394('0x62'))][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x50'))+_0xf394('0x64'));}return _0x15050b['download'](_0x2bf8e0);}})['catch'](handleError(_0x15050b,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x66')]=function(_0x1a6c6c,_0x2d1aa9,_0x3a59d0){var _0x20d088=_0xf394('0x67');var _0x357e5f={'custom':![]};return utilLicense[_0xf394('0x53')]()[_0xf394('0x17')](function(_0x2d7417){if(_0x2d7417){_0x357e5f=_0x2d7417;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x1a6c6c[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),'loginLogo','preferred','favicon','defaultLogo',_0xf394('0x57'),'defaultPreferred',_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x2d1aa9,null))[_0xf394('0x17')](function(_0x20ddf3){if(_0x20ddf3){var _0xf64963=_0x20ddf3['loginLogo']&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x20d088,_[_0xf394('0x5c')](_0x20ddf3[_0xf394('0x52')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x20d088,_[_0xf394('0x5c')](_0x20ddf3[_0xf394('0x52')])):path[_0xf394('0x5b')](config['root'],_0x20d088,_[_0xf394('0x5c')](_0xf394('0x68')));var _0x4cae1a=_0xf394('0x5f')+_[_0xf394('0x60')]('loginLogo');if(_0x20ddf3[_0x4cae1a]||!_0x357e5f['custom']){_0xf64963=path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x20d088,_[_0xf394('0x5c')](_0xf394('0x68')));}if(!fs[_0xf394('0x5a')](_0xf64963)){throw new db[(_0xf394('0x62'))]['ValidationError'](_[_0xf394('0x60')](_0xf394('0x52'))+'\x20not\x20found');}return _0x2d1aa9[_0xf394('0x69')](_0xf64963);}})[_0xf394('0x1e')](handleError(_0x2d1aa9,null));};exports[_0xf394('0x6a')]=function(_0x200738,_0x59fcba){return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x200738[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x6b')]})[_0xf394('0x17')](respondWithResult(_0x59fcba,null))[_0xf394('0x1e')](handleError(_0x59fcba,null));};exports[_0xf394('0x6c')]=function(_0x4d94a5,_0x4e4de7,_0x89ecc2){if(_0x4d94a5['file']&&_0x4d94a5[_0xf394('0x4e')][_0xf394('0x4f')]){_0x4d94a5['body'][_0xf394('0x54')]=_0x4d94a5['file'][_0xf394('0x4f')];}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x4d94a5[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e4de7,null))[_0xf394('0x17')](saveUpdates(_0x4d94a5[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x4e4de7,null))[_0xf394('0x1e')](handleError(_0x4e4de7,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x6d')]=function(_0x30a56e,_0x33c725,_0x4a2bb9){var _0x2d1932='server/files/images/logos';var _0x49f612={'custom':![]};return utilLicense['getLicense']()[_0xf394('0x17')](function(_0x56680b){if(_0x56680b){_0x49f612=_0x56680b;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x30a56e[_0xf394('0x4c')]['id']},'attributes':['logo','loginLogo',_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),'defaultLoginLogo',_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x33c725,null))['then'](function(_0x1344a5){if(_0x1344a5){var _0x2a1c7b=_0x1344a5[_0xf394('0x54')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_[_0xf394('0x5c')](_0x1344a5[_0xf394('0x54')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_[_0xf394('0x5c')](_0x1344a5['preferred'])):path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_['toLower'](_0xf394('0x6e')));var _0xe101d2='default'+_['upperFirst'](_0xf394('0x54'));if(_0x1344a5[_0xe101d2]||!_0x49f612[_0xf394('0x61')]||!_0x49f612[_0xf394('0x54')]){_0x2a1c7b=path['join'](config[_0xf394('0x5d')],_0x2d1932,_['toLower'](_0xf394('0x6e')));}if(!fs[_0xf394('0x5a')](_0x2a1c7b)){throw new db[(_0xf394('0x62'))][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x54'))+_0xf394('0x64'));}return _0x33c725[_0xf394('0x69')](_0x2a1c7b);}})[_0xf394('0x1e')](handleError(_0x33c725,null));};exports[_0xf394('0x6f')]=function(_0x1f78e8,_0x26b5dc,_0x1444e1){if(_0x1f78e8[_0xf394('0x4e')]&&_0x1f78e8[_0xf394('0x4e')][_0xf394('0x4f')]){_0x1f78e8[_0xf394('0x4a')]['favicon']=_0x1f78e8['file'][_0xf394('0x4f')];}return db['Setting']['find']({'where':{'id':_0x1f78e8['params']['id']}})[_0xf394('0x17')](handleEntityNotFound(_0x26b5dc,null))[_0xf394('0x17')](saveUpdates(_0x1f78e8[_0xf394('0x4a')],null))['then'](respondWithResult(_0x26b5dc,null))['catch'](handleError(_0x26b5dc,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x70')]=function(_0x364f32,_0x327b7e,_0x48faac){var _0x482008=_0xf394('0x67');var _0x5cd1a6={'custom':![]};return utilLicense['getLicense']()[_0xf394('0x17')](function(_0x5db4f3){if(_0x5db4f3){_0x5cd1a6=_0x5db4f3;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x364f32[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),_0xf394('0x52'),_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),'defaultLoginLogo',_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x327b7e,null))['then'](function(_0x963d9e){if(_0x963d9e){var _0x488da4=_0x963d9e[_0xf394('0x55')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x482008,_[_0xf394('0x5c')](_0x963d9e[_0xf394('0x55')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x482008,_[_0xf394('0x5c')](_0x963d9e[_0xf394('0x55')])):path['join'](config['root'],_0x482008,_[_0xf394('0x5c')]('default_favicon.ico'));var _0x40d161=_0xf394('0x5f')+_[_0xf394('0x60')]('favicon');if(_0x963d9e[_0x40d161]||!_0x5cd1a6[_0xf394('0x61')]){_0x488da4=path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x482008,_['toLower'](_0xf394('0x71')));}if(!fs[_0xf394('0x5a')](_0x488da4)){throw new db['Sequelize'][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x55'))+_0xf394('0x64'));}return _0x327b7e[_0xf394('0x69')](_0x488da4);}})[_0xf394('0x1e')](handleError(_0x327b7e,null));};exports[_0xf394('0x72')]=function(_0xb0e659,_0x281380){var _0x5ab54d={'offset':moment()[_0xf394('0x73')]()};_0x5ab54d[_0xf394('0x74')]=moment()[_0xf394('0x73')](_0x5ab54d['offset'])[_0xf394('0x75')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x281380[_0xf394('0x20')](0xc8)[_0xf394('0x76')](_0x5ab54d);}; \ No newline at end of file +var _0xa671=['query','filters','attributes','intersection','fields','length','nolimit','offset','sort','where','pick','filter','VIRTUAL','merge','options','Setting','includeAll','include','rows','params','body','find','addLogo','file','filename','logo','addLogoLogin','getLogo','loginLogo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','upperFirst','Sequelize','download','getLogoLogin','server/files/images/logos','getLicense','defaultPreferred','default_loginLogo.svg','default','ValidationError','gdpr','securePassword','addPreferred','default_preferred.png','defaultLoginLogo','default_favicon.ico','custom','\x20not\x20found','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','model','keys'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0xa671,0x1a4));var _0x1a67=function(_0x2720d4,_0x4d10c3){_0x2720d4=_0x2720d4-0x0;var _0x1b0f29=_0xa671[_0x2720d4];return _0x1b0f29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a67('0x0'));var zipdir=require(_0x1a67('0x1'));var jsonpatch=require(_0x1a67('0x2'));var rp=require(_0x1a67('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a67('0x4'));var util=require('util');var path=require(_0x1a67('0x5'));var sox=require(_0x1a67('0x6'));var csv=require(_0x1a67('0x7'));var ejs=require(_0x1a67('0x8'));var fs=require('fs');var fs_extra=require(_0x1a67('0x9'));var _=require('lodash');var squel=require(_0x1a67('0xa'));var crypto=require(_0x1a67('0xb'));var jsforce=require(_0x1a67('0xc'));var deskjs=require(_0x1a67('0xd'));var toCsv=require(_0x1a67('0x7'));var querystring=require(_0x1a67('0xe'));var Papa=require(_0x1a67('0xf'));var Redis=require(_0x1a67('0x10'));var authService=require(_0x1a67('0x11'));var qs=require(_0x1a67('0x12'));var as=require(_0x1a67('0x13'));var hardwareService=require(_0x1a67('0x14'));var logger=require(_0x1a67('0x15'))(_0x1a67('0x16'));var utils=require('../../config/utils');var config=require(_0x1a67('0x17'));var licenseUtil=require(_0x1a67('0x18'));var db=require(_0x1a67('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x1a67('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5b4365,_0x162640,_0x4b985a,_0x28c5d0){return new BPromise(function(_0x499416,_0x1b81d7){var _0x5a71b4=_0x28c5d0||client;return _0x5a71b4[_0x1a67('0x1b')](_0x5b4365,_0x4b985a)[_0x1a67('0x1c')](function(_0x592278){logger['info']('Setting,\x20%s,\x20%s',_0x162640,_0x1a67('0x1d'));logger[_0x1a67('0x1e')](_0x1a67('0x1f'),_0x162640,_0x1a67('0x1d'),JSON['stringify'](_0x592278));if(_0x592278[_0x1a67('0x20')]){if(_0x592278['error']['code']===0x1f4){logger[_0x1a67('0x20')](_0x1a67('0x21'),_0x162640,_0x592278[_0x1a67('0x20')]['message']);return _0x1b81d7(_0x592278['error'][_0x1a67('0x22')]);}logger[_0x1a67('0x20')](_0x1a67('0x21'),_0x162640,_0x592278[_0x1a67('0x20')][_0x1a67('0x22')]);return _0x499416(_0x592278[_0x1a67('0x20')][_0x1a67('0x22')]);}else{logger[_0x1a67('0x23')](_0x1a67('0x21'),_0x162640,_0x1a67('0x1d'));_0x499416(_0x592278[_0x1a67('0x24')]['message']);}})[_0x1a67('0x25')](function(_0x41068a){logger['error'](_0x1a67('0x21'),_0x162640,_0x41068a);_0x1b81d7(_0x41068a);});});}function respondWithStatusCode(_0x2ee67b,_0x4d04dd){_0x4d04dd=_0x4d04dd||0xcc;return function(_0x1addf1){if(_0x1addf1){return _0x2ee67b[_0x1a67('0x26')](_0x4d04dd);}return _0x2ee67b[_0x1a67('0x27')](_0x4d04dd)[_0x1a67('0x28')]();};}function respondWithResult(_0x4cc706,_0x501a28){_0x501a28=_0x501a28||0xc8;return function(_0x19c8da){if(_0x19c8da){return _0x4cc706[_0x1a67('0x27')](_0x501a28)[_0x1a67('0x29')](_0x19c8da);}};}function respondWithFilteredResult(_0x710e5e,_0x4ae97a){return function(_0x44b19d){if(_0x44b19d){var _0x1feda2=typeof _0x4ae97a['offset']===_0x1a67('0x2a')&&typeof _0x4ae97a[_0x1a67('0x2b')]===_0x1a67('0x2a');var _0x9af90e=_0x44b19d[_0x1a67('0x2c')];var _0x3633fb=_0x1feda2?0x0:_0x4ae97a['offset'];var _0x6b4816=_0x1feda2?_0x44b19d['count']:_0x4ae97a['offset']+_0x4ae97a[_0x1a67('0x2b')];var _0x1f86b0;if(_0x6b4816>=_0x9af90e){_0x6b4816=_0x9af90e;_0x1f86b0=0xc8;}else{_0x1f86b0=0xce;}_0x710e5e[_0x1a67('0x27')](_0x1f86b0);return _0x710e5e[_0x1a67('0x2d')](_0x1a67('0x2e'),_0x3633fb+'-'+_0x6b4816+'/'+_0x9af90e)['json'](_0x44b19d);}return null;};}function patchUpdates(_0x5bb462){return function(_0x18ba79){try{jsonpatch[_0x1a67('0x2f')](_0x18ba79,_0x5bb462,!![]);}catch(_0x56f455){return BPromise[_0x1a67('0x30')](_0x56f455);}return _0x18ba79[_0x1a67('0x31')]();};}function saveUpdates(_0x5a0db4,_0x2c2a3f){return function(_0x271365){if(_0x271365){return _0x271365[_0x1a67('0x32')](_0x5a0db4)[_0x1a67('0x1c')](function(_0x312e10){return _0x312e10;});}return null;};}function removeEntity(_0x51f0fa,_0xedb6dd){return function(_0x56f38b){if(_0x56f38b){return _0x56f38b[_0x1a67('0x33')]()[_0x1a67('0x1c')](function(){_0x51f0fa[_0x1a67('0x27')](0xcc)[_0x1a67('0x28')]();});}};}function handleEntityNotFound(_0x2e6b49,_0xd75949){return function(_0xb4de2){if(!_0xb4de2){_0x2e6b49['sendStatus'](0x194);}return _0xb4de2;};}function handleError(_0x369733,_0x1ef413){_0x1ef413=_0x1ef413||0x1f4;return function(_0x5ca2ba){logger[_0x1a67('0x20')](_0x5ca2ba[_0x1a67('0x34')]);if(_0x5ca2ba[_0x1a67('0x35')]){delete _0x5ca2ba['name'];}_0x369733['status'](_0x1ef413)[_0x1a67('0x36')](_0x5ca2ba);};}exports['index']=function(_0x1a1713,_0x5e3a51){var _0x3fd361={},_0x12c512={},_0x4668cf={'count':0x0,'rows':[]};var _0x42f721=_[_0x1a67('0x37')](db['Setting'][_0x1a67('0x38')],function(_0x2b23d5){return{'name':_0x2b23d5[_0x1a67('0x39')],'type':_0x2b23d5['type']['key']};});_0x12c512[_0x1a67('0x3a')]=_[_0x1a67('0x37')](_0x42f721,'name');_0x12c512['query']=_[_0x1a67('0x3b')](_0x1a1713[_0x1a67('0x3c')]);_0x12c512[_0x1a67('0x3d')]=_['intersection'](_0x12c512[_0x1a67('0x3a')],_0x12c512['query']);_0x3fd361[_0x1a67('0x3e')]=_[_0x1a67('0x3f')](_0x12c512[_0x1a67('0x3a')],qs[_0x1a67('0x40')](_0x1a1713['query']['fields']));_0x3fd361[_0x1a67('0x3e')]=_0x3fd361[_0x1a67('0x3e')][_0x1a67('0x41')]?_0x3fd361[_0x1a67('0x3e')]:_0x12c512[_0x1a67('0x3a')];if(!_0x1a1713[_0x1a67('0x3c')]['hasOwnProperty'](_0x1a67('0x42'))){_0x3fd361['limit']=qs['limit'](_0x1a1713['query'][_0x1a67('0x2b')]);_0x3fd361['offset']=qs[_0x1a67('0x43')](_0x1a1713[_0x1a67('0x3c')]['offset']);}_0x3fd361['order']=qs[_0x1a67('0x44')](_0x1a1713[_0x1a67('0x3c')][_0x1a67('0x44')]);_0x3fd361[_0x1a67('0x45')]=qs[_0x1a67('0x3d')](_[_0x1a67('0x46')](_0x1a1713['query'],_0x12c512[_0x1a67('0x3d')]),_0x42f721);if(_0x1a1713['query'][_0x1a67('0x47')]){_0x3fd361[_0x1a67('0x45')]=_['merge'](_0x3fd361[_0x1a67('0x45')],{'$or':_['map'](_0x42f721,function(_0x293473){if(_0x293473['type']!==_0x1a67('0x48')){var _0x13f29a={};_0x13f29a[_0x293473[_0x1a67('0x35')]]={'$like':'%'+_0x1a1713['query'][_0x1a67('0x47')]+'%'};return _0x13f29a;}})});}_0x3fd361=_[_0x1a67('0x49')]({},_0x3fd361,_0x1a1713[_0x1a67('0x4a')]);var _0x2ed539={'where':_0x3fd361['where']};return db[_0x1a67('0x4b')]['count'](_0x2ed539)[_0x1a67('0x1c')](function(_0x3b8158){_0x4668cf[_0x1a67('0x2c')]=_0x3b8158;if(_0x1a1713[_0x1a67('0x3c')][_0x1a67('0x4c')]){_0x3fd361[_0x1a67('0x4d')]=[{'all':!![]}];}return db[_0x1a67('0x4b')]['findAll'](_0x3fd361);})[_0x1a67('0x1c')](function(_0x44c88e){_0x4668cf[_0x1a67('0x4e')]=_0x44c88e;return _0x4668cf;})[_0x1a67('0x1c')](respondWithFilteredResult(_0x5e3a51,_0x3fd361))[_0x1a67('0x25')](handleError(_0x5e3a51,null));};exports['show']=function(_0xa17168,_0x4dd65a){var _0x4e7539={'raw':![],'where':{'id':_0xa17168[_0x1a67('0x4f')]['id']}},_0x2f4f3c={};_0x2f4f3c[_0x1a67('0x3a')]=_[_0x1a67('0x3b')](db[_0x1a67('0x4b')][_0x1a67('0x38')]);_0x2f4f3c[_0x1a67('0x3c')]=_[_0x1a67('0x3b')](_0xa17168[_0x1a67('0x3c')]);_0x2f4f3c[_0x1a67('0x3d')]=_[_0x1a67('0x3f')](_0x2f4f3c['model'],_0x2f4f3c['query']);_0x4e7539[_0x1a67('0x3e')]=_[_0x1a67('0x3f')](_0x2f4f3c[_0x1a67('0x3a')],qs[_0x1a67('0x40')](_0xa17168[_0x1a67('0x3c')][_0x1a67('0x40')]));_0x4e7539[_0x1a67('0x3e')]=_0x4e7539['attributes'][_0x1a67('0x41')]?_0x4e7539[_0x1a67('0x3e')]:_0x2f4f3c[_0x1a67('0x3a')];if(_0xa17168[_0x1a67('0x3c')][_0x1a67('0x4c')]){_0x4e7539[_0x1a67('0x4d')]=[{'all':!![]}];}_0x4e7539=_[_0x1a67('0x49')]({},_0x4e7539,_0xa17168[_0x1a67('0x4a')]);return db[_0x1a67('0x4b')]['find'](_0x4e7539)[_0x1a67('0x1c')](handleEntityNotFound(_0x4dd65a,null))[_0x1a67('0x1c')](respondWithResult(_0x4dd65a,null))[_0x1a67('0x25')](handleError(_0x4dd65a,null));};exports[_0x1a67('0x32')]=function(_0x132a3f,_0x4a5e5b){if(_0x132a3f[_0x1a67('0x50')]['id']){delete _0x132a3f[_0x1a67('0x50')]['id'];}return db['Setting'][_0x1a67('0x51')]({'where':{'id':_0x132a3f[_0x1a67('0x4f')]['id']}})[_0x1a67('0x1c')](handleEntityNotFound(_0x4a5e5b,null))[_0x1a67('0x1c')](saveUpdates(_0x132a3f[_0x1a67('0x50')],null))[_0x1a67('0x1c')](respondWithResult(_0x4a5e5b,null))[_0x1a67('0x25')](handleError(_0x4a5e5b,null));};exports[_0x1a67('0x52')]=function(_0x3493ec,_0x35af7f,_0xa398bb){if(_0x3493ec[_0x1a67('0x53')]&&_0x3493ec['file'][_0x1a67('0x54')]){_0x3493ec[_0x1a67('0x50')][_0x1a67('0x55')]=_0x3493ec[_0x1a67('0x53')][_0x1a67('0x54')];}return db[_0x1a67('0x4b')]['find']({'where':{'id':_0x3493ec['params']['id']}})['then'](handleEntityNotFound(_0x35af7f,null))['then'](saveUpdates(_0x3493ec[_0x1a67('0x50')],null))[_0x1a67('0x1c')](respondWithResult(_0x35af7f,null))[_0x1a67('0x25')](handleError(_0x35af7f,null));};exports[_0x1a67('0x56')]=function(_0xebe965,_0x3425af,_0x36984e){if(_0xebe965[_0x1a67('0x53')]&&_0xebe965[_0x1a67('0x53')][_0x1a67('0x54')]){_0xebe965['body']['loginLogo']=_0xebe965[_0x1a67('0x53')][_0x1a67('0x54')];}return db[_0x1a67('0x4b')][_0x1a67('0x51')]({'where':{'id':_0xebe965['params']['id']}})[_0x1a67('0x1c')](handleEntityNotFound(_0x3425af,null))[_0x1a67('0x1c')](saveUpdates(_0xebe965[_0x1a67('0x50')],null))[_0x1a67('0x1c')](respondWithResult(_0x3425af,null))[_0x1a67('0x25')](handleError(_0x3425af,null));};var utilLicense=require(_0x1a67('0x18'));exports[_0x1a67('0x57')]=function(_0x3100c4,_0x5bcd6a,_0xcc295d){var _0xe37876='server/files/images/logos';var _0x1a8fe4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5b304a){if(_0x5b304a){_0x1a8fe4=_0x5b304a;}return db[_0x1a67('0x4b')]['find']({'where':{'id':_0x3100c4[_0x1a67('0x4f')]['id']},'attributes':[_0x1a67('0x55'),_0x1a67('0x58'),_0x1a67('0x59'),_0x1a67('0x5a'),_0x1a67('0x5b'),'defaultLoginLogo','defaultPreferred',_0x1a67('0x5c')],'raw':!![]});})[_0x1a67('0x1c')](handleEntityNotFound(_0x5bcd6a,null))['then'](function(_0x3a5dd8){if(_0x3a5dd8){var _0x158a4d=_0x3a5dd8['logo']&&fs[_0x1a67('0x5d')](path[_0x1a67('0x5e')](config[_0x1a67('0x5f')],_0xe37876,_[_0x1a67('0x60')](_0x3a5dd8[_0x1a67('0x55')])))?path['join'](config[_0x1a67('0x5f')],_0xe37876,_[_0x1a67('0x60')](_0x3a5dd8[_0x1a67('0x55')])):path[_0x1a67('0x5e')](config[_0x1a67('0x5f')],_0xe37876,_['toLower']('default_logo.svg'));var _0xed58c8='default'+_[_0x1a67('0x61')](_0x1a67('0x55'));if(_0x3a5dd8[_0xed58c8]||!_0x1a8fe4['custom']){_0x158a4d=path[_0x1a67('0x5e')](config['root'],_0xe37876,_[_0x1a67('0x60')]('default_logo.svg'));}if(!fs['existsSync'](_0x158a4d)){throw new db[(_0x1a67('0x62'))]['ValidationError'](_[_0x1a67('0x61')]('logo')+'\x20not\x20found');}return _0x5bcd6a[_0x1a67('0x63')](_0x158a4d);}})[_0x1a67('0x25')](handleError(_0x5bcd6a,null));};var utilLicense=require(_0x1a67('0x18'));exports[_0x1a67('0x64')]=function(_0x57c4ea,_0x476155,_0x5d5db3){var _0x10ccf9=_0x1a67('0x65');var _0x3ae0cf={'custom':![]};return utilLicense[_0x1a67('0x66')]()[_0x1a67('0x1c')](function(_0x8ce313){if(_0x8ce313){_0x3ae0cf=_0x8ce313;}return db[_0x1a67('0x4b')][_0x1a67('0x51')]({'where':{'id':_0x57c4ea[_0x1a67('0x4f')]['id']},'attributes':[_0x1a67('0x55'),_0x1a67('0x58'),_0x1a67('0x59'),_0x1a67('0x5a'),'defaultLogo','defaultLoginLogo',_0x1a67('0x67'),_0x1a67('0x5c')],'raw':!![]});})[_0x1a67('0x1c')](handleEntityNotFound(_0x476155,null))[_0x1a67('0x1c')](function(_0x2efa36){if(_0x2efa36){var _0x270c03=_0x2efa36[_0x1a67('0x58')]&&fs[_0x1a67('0x5d')](path['join'](config['root'],_0x10ccf9,_[_0x1a67('0x60')](_0x2efa36[_0x1a67('0x58')])))?path['join'](config[_0x1a67('0x5f')],_0x10ccf9,_['toLower'](_0x2efa36['loginLogo'])):path['join'](config[_0x1a67('0x5f')],_0x10ccf9,_[_0x1a67('0x60')](_0x1a67('0x68')));var _0x210d68=_0x1a67('0x69')+_[_0x1a67('0x61')](_0x1a67('0x58'));if(_0x2efa36[_0x210d68]||!_0x3ae0cf['custom']){_0x270c03=path['join'](config[_0x1a67('0x5f')],_0x10ccf9,_[_0x1a67('0x60')](_0x1a67('0x68')));}if(!fs[_0x1a67('0x5d')](_0x270c03)){throw new db[(_0x1a67('0x62'))][(_0x1a67('0x6a'))](_['upperFirst'](_0x1a67('0x58'))+'\x20not\x20found');}return _0x476155[_0x1a67('0x63')](_0x270c03);}})[_0x1a67('0x25')](handleError(_0x476155,null));};exports[_0x1a67('0x6b')]=function(_0x48a304,_0x462d4f){return db[_0x1a67('0x4b')]['find']({'where':{'id':_0x48a304[_0x1a67('0x4f')]['id']},'attributes':[_0x1a67('0x6c')]})[_0x1a67('0x1c')](respondWithResult(_0x462d4f,null))[_0x1a67('0x25')](handleError(_0x462d4f,null));};exports[_0x1a67('0x6d')]=function(_0x335796,_0x3e990f,_0x104e7a){if(_0x335796[_0x1a67('0x53')]&&_0x335796['file'][_0x1a67('0x54')]){_0x335796[_0x1a67('0x50')][_0x1a67('0x59')]=_0x335796[_0x1a67('0x53')][_0x1a67('0x54')];}return db[_0x1a67('0x4b')][_0x1a67('0x51')]({'where':{'id':_0x335796[_0x1a67('0x4f')]['id']}})[_0x1a67('0x1c')](handleEntityNotFound(_0x3e990f,null))['then'](saveUpdates(_0x335796['body'],null))['then'](respondWithResult(_0x3e990f,null))[_0x1a67('0x25')](handleError(_0x3e990f,null));};var utilLicense=require(_0x1a67('0x18'));exports['getPreferred']=function(_0x2506eb,_0x4451bc,_0x291f25){var _0x4c0b96=_0x1a67('0x65');var _0x151b26={'custom':![]};return utilLicense[_0x1a67('0x66')]()[_0x1a67('0x1c')](function(_0x5d5bcb){if(_0x5d5bcb){_0x151b26=_0x5d5bcb;}return db['Setting'][_0x1a67('0x51')]({'where':{'id':_0x2506eb[_0x1a67('0x4f')]['id']},'attributes':['logo',_0x1a67('0x58'),_0x1a67('0x59'),_0x1a67('0x5a'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x1a67('0x5c')],'raw':!![]});})[_0x1a67('0x1c')](handleEntityNotFound(_0x4451bc,null))[_0x1a67('0x1c')](function(_0x36a146){if(_0x36a146){var _0x701fcf=_0x36a146[_0x1a67('0x59')]&&fs['existsSync'](path['join'](config[_0x1a67('0x5f')],_0x4c0b96,_[_0x1a67('0x60')](_0x36a146[_0x1a67('0x59')])))?path[_0x1a67('0x5e')](config[_0x1a67('0x5f')],_0x4c0b96,_[_0x1a67('0x60')](_0x36a146[_0x1a67('0x59')])):path[_0x1a67('0x5e')](config[_0x1a67('0x5f')],_0x4c0b96,_[_0x1a67('0x60')]('default_preferred.png'));var _0xa99f8e=_0x1a67('0x69')+_['upperFirst'](_0x1a67('0x59'));if(_0x36a146[_0xa99f8e]||!_0x151b26['custom']||!_0x151b26[_0x1a67('0x59')]){_0x701fcf=path['join'](config[_0x1a67('0x5f')],_0x4c0b96,_['toLower'](_0x1a67('0x6e')));}if(!fs[_0x1a67('0x5d')](_0x701fcf)){throw new db['Sequelize']['ValidationError'](_[_0x1a67('0x61')]('preferred')+'\x20not\x20found');}return _0x4451bc[_0x1a67('0x63')](_0x701fcf);}})[_0x1a67('0x25')](handleError(_0x4451bc,null));};exports['addFavicon']=function(_0x108a13,_0xd31717,_0x17a3df){if(_0x108a13[_0x1a67('0x53')]&&_0x108a13['file'][_0x1a67('0x54')]){_0x108a13['body'][_0x1a67('0x5a')]=_0x108a13[_0x1a67('0x53')][_0x1a67('0x54')];}return db[_0x1a67('0x4b')][_0x1a67('0x51')]({'where':{'id':_0x108a13[_0x1a67('0x4f')]['id']}})[_0x1a67('0x1c')](handleEntityNotFound(_0xd31717,null))[_0x1a67('0x1c')](saveUpdates(_0x108a13[_0x1a67('0x50')],null))[_0x1a67('0x1c')](respondWithResult(_0xd31717,null))['catch'](handleError(_0xd31717,null));};var utilLicense=require(_0x1a67('0x18'));exports['getFavicon']=function(_0x2ea929,_0x3696f1,_0x2c1ac3){var _0x3c24c5='server/files/images/logos';var _0xd02ac1={'custom':![]};return utilLicense[_0x1a67('0x66')]()[_0x1a67('0x1c')](function(_0x3c9954){if(_0x3c9954){_0xd02ac1=_0x3c9954;}return db['Setting'][_0x1a67('0x51')]({'where':{'id':_0x2ea929[_0x1a67('0x4f')]['id']},'attributes':[_0x1a67('0x55'),'loginLogo',_0x1a67('0x59'),_0x1a67('0x5a'),_0x1a67('0x5b'),_0x1a67('0x6f'),_0x1a67('0x67'),_0x1a67('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x3696f1,null))[_0x1a67('0x1c')](function(_0x193fb3){if(_0x193fb3){var _0x335143=_0x193fb3['favicon']&&fs['existsSync'](path[_0x1a67('0x5e')](config[_0x1a67('0x5f')],_0x3c24c5,_[_0x1a67('0x60')](_0x193fb3[_0x1a67('0x5a')])))?path[_0x1a67('0x5e')](config['root'],_0x3c24c5,_[_0x1a67('0x60')](_0x193fb3[_0x1a67('0x5a')])):path['join'](config[_0x1a67('0x5f')],_0x3c24c5,_[_0x1a67('0x60')](_0x1a67('0x70')));var _0x49c892=_0x1a67('0x69')+_[_0x1a67('0x61')](_0x1a67('0x5a'));if(_0x193fb3[_0x49c892]||!_0xd02ac1[_0x1a67('0x71')]){_0x335143=path[_0x1a67('0x5e')](config[_0x1a67('0x5f')],_0x3c24c5,_['toLower'](_0x1a67('0x70')));}if(!fs[_0x1a67('0x5d')](_0x335143)){throw new db['Sequelize']['ValidationError'](_[_0x1a67('0x61')](_0x1a67('0x5a'))+_0x1a67('0x72'));}return _0x3696f1[_0x1a67('0x63')](_0x335143);}})[_0x1a67('0x25')](handleError(_0x3696f1,null));};exports[_0x1a67('0x73')]=function(_0x3a0da8,_0x7b9b1a){var _0x3f673d={'offset':moment()['utcOffset']()};_0x3f673d[_0x1a67('0x74')]=moment()[_0x1a67('0x75')](_0x3f673d[_0x1a67('0x43')])[_0x1a67('0x76')](_0x1a67('0x77'));return _0x7b9b1a['status'](0xc8)['send'](_0x3f673d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 7075ca4..bad41bf 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x7217,0x19e));var _0x7721=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7217[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7888fa7..5702345 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 _0x0512=['include','model','map','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSetting','Setting','options','raw','where','attributes'];(function(_0x58f5d5,_0x5fbadd){var _0xe138ae=function(_0x3f030a){while(--_0x3f030a){_0x58f5d5['push'](_0x58f5d5['shift']());}};_0xe138ae(++_0x5fbadd);}(_0x0512,0x1c3));var _0x2051=function(_0x4f667f,_0x26a037){_0x4f667f=_0x4f667f-0x0;var _0x2cfff0=_0x0512[_0x4f667f];return _0x2cfff0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2051('0x0'));var BPromise=require(_0x2051('0x1'));var rs=require(_0x2051('0x2'));var fs=require('fs');var Redis=require(_0x2051('0x3'));var db=require(_0x2051('0x4'))['db'];var utils=require(_0x2051('0x5'));var logger=require(_0x2051('0x6'))(_0x2051('0x7'));var config=require(_0x2051('0x8'));var jayson=require(_0x2051('0x9'));var client=jayson[_0x2051('0xa')][_0x2051('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39caf4,_0x39a8e4,_0x18d41c){return new BPromise(function(_0xa55dfa,_0x278e7a){return client[_0x2051('0xc')](_0x39caf4,_0x18d41c)[_0x2051('0xd')](function(_0x57c880){logger[_0x2051('0xe')](_0x2051('0xf'),_0x39a8e4,_0x2051('0x10'));logger[_0x2051('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x39a8e4,_0x2051('0x10'),JSON[_0x2051('0x12')](_0x57c880));if(_0x57c880['error']){if(_0x57c880[_0x2051('0x13')][_0x2051('0x14')]===0x1f4){logger['error'](_0x2051('0xf'),_0x39a8e4,_0x57c880['error'][_0x2051('0x15')]);return _0x278e7a(_0x57c880[_0x2051('0x13')][_0x2051('0x15')]);}logger[_0x2051('0x13')](_0x2051('0xf'),_0x39a8e4,_0x57c880[_0x2051('0x13')][_0x2051('0x15')]);return _0xa55dfa(_0x57c880['error'][_0x2051('0x15')]);}else{logger[_0x2051('0xe')](_0x2051('0xf'),_0x39a8e4,_0x2051('0x10'));_0xa55dfa(_0x57c880['result'][_0x2051('0x15')]);}})[_0x2051('0x16')](function(_0x469e3a){logger[_0x2051('0x13')](_0x2051('0xf'),_0x39a8e4,_0x469e3a);_0x278e7a(_0x469e3a);});});}exports[_0x2051('0x17')]=function(_0x128eee){var _0x4b29bb=this;return new Promise(function(_0x52fd8c,_0x4fbb4c){return db[_0x2051('0x18')]['find']({'raw':_0x128eee[_0x2051('0x19')]?_0x128eee[_0x2051('0x19')][_0x2051('0x1a')]===undefined?!![]:![]:!![],'where':_0x128eee['options']?_0x128eee['options'][_0x2051('0x1b')]||null:null,'attributes':_0x128eee[_0x2051('0x19')]?_0x128eee[_0x2051('0x19')][_0x2051('0x1c')]||null:null,'include':_0x128eee['options']?_0x128eee['options'][_0x2051('0x1d')]?_['map'](_0x128eee[_0x2051('0x19')][_0x2051('0x1d')],function(_0x441dbf){return{'model':db[_0x441dbf[_0x2051('0x1e')]],'as':_0x441dbf['as'],'attributes':_0x441dbf[_0x2051('0x1c')],'include':_0x441dbf[_0x2051('0x1d')]?_['map'](_0x441dbf[_0x2051('0x1d')],function(_0x394ea2){return{'model':db[_0x394ea2[_0x2051('0x1e')]],'as':_0x394ea2['as'],'attributes':_0x394ea2[_0x2051('0x1c')],'include':_0x394ea2[_0x2051('0x1d')]?_[_0x2051('0x1f')](_0x394ea2[_0x2051('0x1d')],function(_0x2a4471){return{'model':db[_0x2a4471['model']],'as':_0x2a4471['as'],'attributes':_0x2a4471[_0x2051('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2051('0xd')](function(_0x25e529){logger[_0x2051('0xe')](_0x2051('0x17'),_0x128eee);logger[_0x2051('0x11')](_0x2051('0x17'),_0x128eee,JSON[_0x2051('0x12')](_0x25e529));_0x52fd8c(_0x25e529);})['catch'](function(_0x4e0d9d){logger[_0x2051('0x13')](_0x2051('0x17'),_0x4e0d9d[_0x2051('0x15')],_0x128eee);_0x4fbb4c(_0x4b29bb[_0x2051('0x13')](0x1f4,_0x4e0d9d[_0x2051('0x15')]));});});}; \ No newline at end of file +var _0x2fd0=['Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','Setting','find','options','raw','where','include','model','attributes','map','ShowSetting','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x391c2b,_0x4f6068){var _0x3ce26b=function(_0x386a3e){while(--_0x386a3e){_0x391c2b['push'](_0x391c2b['shift']());}};_0x3ce26b(++_0x4f6068);}(_0x2fd0,0x102));var _0x02fd=function(_0x43fb15,_0x4b3f5b){_0x43fb15=_0x43fb15-0x0;var _0x42d47a=_0x2fd0[_0x43fb15];return _0x42d47a;};'use strict';var _=require(_0x02fd('0x0'));var util=require(_0x02fd('0x1'));var moment=require(_0x02fd('0x2'));var BPromise=require(_0x02fd('0x3'));var rs=require(_0x02fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02fd('0x5'))['db'];var utils=require(_0x02fd('0x6'));var logger=require('../../config/logger')(_0x02fd('0x7'));var config=require(_0x02fd('0x8'));var jayson=require(_0x02fd('0x9'));var client=jayson['client'][_0x02fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5457b6,_0x3c0dba,_0x635a8e){return new BPromise(function(_0x93baa4,_0x2c4de2){return client[_0x02fd('0xb')](_0x5457b6,_0x635a8e)[_0x02fd('0xc')](function(_0xc2fcb3){logger[_0x02fd('0xd')](_0x02fd('0xe'),_0x3c0dba,_0x02fd('0xf'));logger[_0x02fd('0x10')](_0x02fd('0x11'),_0x3c0dba,_0x02fd('0xf'),JSON['stringify'](_0xc2fcb3));if(_0xc2fcb3[_0x02fd('0x12')]){if(_0xc2fcb3['error'][_0x02fd('0x13')]===0x1f4){logger[_0x02fd('0x12')](_0x02fd('0xe'),_0x3c0dba,_0xc2fcb3[_0x02fd('0x12')][_0x02fd('0x14')]);return _0x2c4de2(_0xc2fcb3[_0x02fd('0x12')][_0x02fd('0x14')]);}logger[_0x02fd('0x12')](_0x02fd('0xe'),_0x3c0dba,_0xc2fcb3[_0x02fd('0x12')]['message']);return _0x93baa4(_0xc2fcb3[_0x02fd('0x12')][_0x02fd('0x14')]);}else{logger[_0x02fd('0xd')]('Setting,\x20%s,\x20%s',_0x3c0dba,'request\x20sent');_0x93baa4(_0xc2fcb3[_0x02fd('0x15')][_0x02fd('0x14')]);}})['catch'](function(_0x5636b1){logger[_0x02fd('0x12')](_0x02fd('0xe'),_0x3c0dba,_0x5636b1);_0x2c4de2(_0x5636b1);});});}exports['ShowSetting']=function(_0x425193){var _0x16d7b1=this;return new Promise(function(_0x589b7c,_0x1007a3){return db[_0x02fd('0x16')][_0x02fd('0x17')]({'raw':_0x425193['options']?_0x425193[_0x02fd('0x18')][_0x02fd('0x19')]===undefined?!![]:![]:!![],'where':_0x425193[_0x02fd('0x18')]?_0x425193[_0x02fd('0x18')][_0x02fd('0x1a')]||null:null,'attributes':_0x425193[_0x02fd('0x18')]?_0x425193[_0x02fd('0x18')]['attributes']||null:null,'include':_0x425193[_0x02fd('0x18')]?_0x425193[_0x02fd('0x18')][_0x02fd('0x1b')]?_['map'](_0x425193[_0x02fd('0x18')][_0x02fd('0x1b')],function(_0x3a1004){return{'model':db[_0x3a1004[_0x02fd('0x1c')]],'as':_0x3a1004['as'],'attributes':_0x3a1004[_0x02fd('0x1d')],'include':_0x3a1004['include']?_[_0x02fd('0x1e')](_0x3a1004[_0x02fd('0x1b')],function(_0x51875d){return{'model':db[_0x51875d[_0x02fd('0x1c')]],'as':_0x51875d['as'],'attributes':_0x51875d[_0x02fd('0x1d')],'include':_0x51875d[_0x02fd('0x1b')]?_[_0x02fd('0x1e')](_0x51875d[_0x02fd('0x1b')],function(_0x291cec){return{'model':db[_0x291cec[_0x02fd('0x1c')]],'as':_0x291cec['as'],'attributes':_0x291cec[_0x02fd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcc7c8a){logger[_0x02fd('0xd')](_0x02fd('0x1f'),_0x425193);logger[_0x02fd('0x10')]('ShowSetting',_0x425193,JSON[_0x02fd('0x20')](_0xcc7c8a));_0x589b7c(_0xcc7c8a);})[_0x02fd('0x21')](function(_0x308c3f){logger[_0x02fd('0x12')]('ShowSetting',_0x308c3f[_0x02fd('0x14')],_0x425193);_0x1007a3(_0x16d7b1[_0x02fd('0x12')](0x1f4,_0x308c3f[_0x02fd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8c29ecc..83fb09c 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(_0x55066b,_0x42b3a2){_0x55066b=_0x55066b-0x0;var _0x33edd0=_0x1cb9[_0x55066b];return _0x33edd0;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x364222,_0x299a9f){_0x364222=_0x364222-0x0;var _0x5e1715=_0xf494[_0x364222];return _0x5e1715;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index de2da5e..6334110 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 _0x1760=['setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1ab495,_0x25af34){var _0x152da6=function(_0x6ec06e){while(--_0x6ec06e){_0x1ab495['push'](_0x1ab495['shift']());}};_0x152da6(++_0x25af34);}(_0x1760,0x1ce));var _0x0176=function(_0x3397cb,_0x3974e5){_0x3397cb=_0x3397cb-0x0;var _0x16a82f=_0x1760[_0x3397cb];return _0x16a82f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0176('0x0'));module[_0x0176('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0176('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0176('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0176('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0176('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x0176('0x3')]},'type':{'type':Sequelize['ENUM'](_0x0176('0x4'),_0x0176('0x5'),_0x0176('0x6'),'clicksend',_0x0176('0x7'),_0x0176('0x8'),_0x0176('0x9'),_0x0176('0xa'),_0x0176('0xb'),_0x0176('0xc'))},'accountSid':{'type':Sequelize[_0x0176('0x3')]},'authId':{'type':Sequelize[_0x0176('0x3')]},'authToken':{'type':Sequelize[_0x0176('0x3')]},'smsMethod':{'type':Sequelize[_0x0176('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0176('0x3')]},'password':{'type':Sequelize[_0x0176('0x3')]},'apiKey':{'type':Sequelize[_0x0176('0x3')]},'applicationId':{'type':Sequelize[_0x0176('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x0176('0x3')]},'deliveryReport':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x0176('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0176('0xf')],'defaultValue':function(){return _0x0176('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0176('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0176('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0176('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0176('0x11')],'comment':_0x0176('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x0176('0xe')],'defaultValue':![],'comment':_0x0176('0x13'),'set':function(_0x41f533){if(!_0x41f533)this['setDataValue'](_0x0176('0x14'),null);this[_0x0176('0x15')](_0x0176('0x16'),_0x41f533);}}}; \ No newline at end of file +var _0xef82=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','connectel','clicksend','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x1334d5,_0x3f368c){var _0x14146b=function(_0x5cb035){while(--_0x5cb035){_0x1334d5['push'](_0x1334d5['shift']());}};_0x14146b(++_0x3f368c);}(_0xef82,0x124));var _0x2ef8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xef82[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x2ef8('0x0'));var rs=require(_0x2ef8('0x1'));module[_0x2ef8('0x2')]={'name':{'type':Sequelize[_0x2ef8('0x3')],'unique':_0x2ef8('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x2ef8('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x2ef8('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x2ef8('0x3')]},'type':{'type':Sequelize[_0x2ef8('0x5')](_0x2ef8('0x6'),_0x2ef8('0x7'),_0x2ef8('0x8'),_0x2ef8('0x9'),'plivo','clickatell','bandwidth','csc','infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x2ef8('0x3')]},'authId':{'type':Sequelize[_0x2ef8('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x2ef8('0x3')]},'password':{'type':Sequelize[_0x2ef8('0x3')]},'apiKey':{'type':Sequelize[_0x2ef8('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x2ef8('0x3')]},'senderString':{'type':Sequelize[_0x2ef8('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x2ef8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2ef8('0xa')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2ef8('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ef8('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2ef8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ef8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ef8('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2ef8('0xb')],'defaultValue':![],'comment':_0x2ef8('0xd'),'set':function(_0x4e929f){if(!_0x4e929f)this[_0x2ef8('0xe')](_0x2ef8('0xf'),null);this[_0x2ef8('0xe')](_0x2ef8('0x10'),_0x4e929f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 91914b6..285274a 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 _0xd886=['userSmsAccount:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','merge','where','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','sms','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','Body','MessageSid','skebby','sender','connectel','from','clicksend','messageId','plivo','From','MessageUUID','infobip','results','text','segmentedMessage','fromNumber','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','clickatell','bandwidth','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','addAgents','omit','emit'];(function(_0x359bf5,_0x20c418){var _0x2ebad8=function(_0x1cdbf2){while(--_0x1cdbf2){_0x359bf5['push'](_0x359bf5['shift']());}};_0x2ebad8(++_0x20c418);}(_0xd886,0xeb));var _0x6d88=function(_0x34e868,_0x8f70){_0x34e868=_0x34e868-0x0;var _0x2e90a6=_0xd886[_0x34e868];return _0x2e90a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d88('0x0'));var zipdir=require(_0x6d88('0x1'));var jsonpatch=require(_0x6d88('0x2'));var rp=require(_0x6d88('0x3'));var moment=require(_0x6d88('0x4'));var BPromise=require(_0x6d88('0x5'));var Mustache=require(_0x6d88('0x6'));var util=require(_0x6d88('0x7'));var path=require(_0x6d88('0x8'));var sox=require(_0x6d88('0x9'));var csv=require(_0x6d88('0xa'));var ejs=require(_0x6d88('0xb'));var fs=require('fs');var fs_extra=require(_0x6d88('0xc'));var _=require(_0x6d88('0xd'));var squel=require(_0x6d88('0xe'));var crypto=require(_0x6d88('0xf'));var jsforce=require(_0x6d88('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6d88('0xa'));var querystring=require('querystring');var Papa=require(_0x6d88('0x11'));var Redis=require(_0x6d88('0x12'));var authService=require(_0x6d88('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d88('0x14'));var logger=require(_0x6d88('0x15'))(_0x6d88('0x16'));var utils=require(_0x6d88('0x17'));var config=require(_0x6d88('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d88('0x19'))['db'];config['redis']=_['defaults'](config[_0x6d88('0x1a')],{'host':_0x6d88('0x1b'),'port':0x18eb});var socket=require(_0x6d88('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x6d88('0x1d')][_0x6d88('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4d05f4,_0x4cadd5,_0x2afa08,_0x362732){return new BPromise(function(_0x558b99,_0xeca92a){var _0x4a6aa6=_0x362732||client;return _0x4a6aa6[_0x6d88('0x1f')](_0x4d05f4,_0x2afa08)[_0x6d88('0x20')](function(_0x2b6af8){logger[_0x6d88('0x21')]('SmsAccount,\x20%s,\x20%s',_0x4cadd5,'request\x20sent');logger[_0x6d88('0x22')](_0x6d88('0x23'),_0x4cadd5,_0x6d88('0x24'),JSON[_0x6d88('0x25')](_0x2b6af8));if(_0x2b6af8['error']){if(_0x2b6af8['error'][_0x6d88('0x26')]===0x1f4){logger[_0x6d88('0x27')](_0x6d88('0x28'),_0x4cadd5,_0x2b6af8[_0x6d88('0x27')][_0x6d88('0x29')]);return _0xeca92a(_0x2b6af8[_0x6d88('0x27')][_0x6d88('0x29')]);}logger['error'](_0x6d88('0x28'),_0x4cadd5,_0x2b6af8[_0x6d88('0x27')]['message']);return _0x558b99(_0x2b6af8['error']['message']);}else{logger['info'](_0x6d88('0x28'),_0x4cadd5,_0x6d88('0x24'));_0x558b99(_0x2b6af8[_0x6d88('0x2a')][_0x6d88('0x29')]);}})['catch'](function(_0x5f063c){logger[_0x6d88('0x27')](_0x6d88('0x28'),_0x4cadd5,_0x5f063c);_0xeca92a(_0x5f063c);});});}function respondWithStatusCode(_0xe9edc4,_0x39fa13){_0x39fa13=_0x39fa13||0xcc;return function(_0x14f066){if(_0x14f066){return _0xe9edc4[_0x6d88('0x2b')](_0x39fa13);}return _0xe9edc4[_0x6d88('0x2c')](_0x39fa13)['end']();};}function respondWithResult(_0x1c0552,_0x3bb72a){_0x3bb72a=_0x3bb72a||0xc8;return function(_0x492c6f){if(_0x492c6f){return _0x1c0552['status'](_0x3bb72a)[_0x6d88('0x2d')](_0x492c6f);}};}function respondWithFilteredResult(_0x683348,_0x1ec792){return function(_0x4f806b){if(_0x4f806b){var _0x32e886=typeof _0x1ec792[_0x6d88('0x2e')]===_0x6d88('0x2f')&&typeof _0x1ec792[_0x6d88('0x30')]===_0x6d88('0x2f');var _0x5be9e0=_0x4f806b[_0x6d88('0x31')];var _0x252d4e=_0x32e886?0x0:_0x1ec792[_0x6d88('0x2e')];var _0x2a6f07=_0x32e886?_0x4f806b[_0x6d88('0x31')]:_0x1ec792['offset']+_0x1ec792[_0x6d88('0x30')];var _0x3c3ae4;if(_0x2a6f07>=_0x5be9e0){_0x2a6f07=_0x5be9e0;_0x3c3ae4=0xc8;}else{_0x3c3ae4=0xce;}_0x683348[_0x6d88('0x2c')](_0x3c3ae4);return _0x683348[_0x6d88('0x32')](_0x6d88('0x33'),_0x252d4e+'-'+_0x2a6f07+'/'+_0x5be9e0)[_0x6d88('0x2d')](_0x4f806b);}return null;};}function patchUpdates(_0x37400c){return function(_0xdd42a0){try{jsonpatch['apply'](_0xdd42a0,_0x37400c,!![]);}catch(_0x550b5a){return BPromise['reject'](_0x550b5a);}return _0xdd42a0[_0x6d88('0x34')]();};}function saveUpdates(_0x4f2b91,_0x5a9a83){return function(_0x2e4f40){if(_0x2e4f40){return _0x2e4f40[_0x6d88('0x35')](_0x4f2b91)[_0x6d88('0x20')](function(_0x16c7e6){return _0x16c7e6;});}return null;};}function removeEntity(_0x4cc0b0,_0x985366){return function(_0x23c6d5){if(_0x23c6d5){return _0x23c6d5[_0x6d88('0x36')]()['then'](function(){var _0x342ed5=_0x23c6d5[_0x6d88('0x37')]({'plain':!![]});var _0x581554=_0x6d88('0x38');return db[_0x6d88('0x39')][_0x6d88('0x36')]({'where':{'type':_0x581554,'resourceId':_0x342ed5['id']}})['then'](function(){return _0x23c6d5;});})[_0x6d88('0x20')](function(){_0x4cc0b0[_0x6d88('0x2c')](0xcc)[_0x6d88('0x3a')]();});}};}function handleEntityNotFound(_0x213e5e,_0x466373){return function(_0xa6093c){if(!_0xa6093c){_0x213e5e[_0x6d88('0x2b')](0x194);}return _0xa6093c;};}function handleError(_0x99b7f5,_0x49a686){_0x49a686=_0x49a686||0x1f4;return function(_0x5e2510){logger['error'](_0x5e2510[_0x6d88('0x3b')]);if(_0x5e2510[_0x6d88('0x3c')]){delete _0x5e2510['name'];}_0x99b7f5[_0x6d88('0x2c')](_0x49a686)[_0x6d88('0x3d')](_0x5e2510);};}exports[_0x6d88('0x3e')]=function(_0x55874f,_0x57f180){var _0x22d4be={'include':[{'model':db['Pause'],'as':_0x6d88('0x3f')}]},_0x46d1c3={},_0x28edd5={'count':0x0,'rows':[]};var _0x57303a=_[_0x6d88('0x40')](db[_0x6d88('0x41')]['rawAttributes'],function(_0x4495b9){return{'name':_0x4495b9[_0x6d88('0x42')],'type':_0x4495b9[_0x6d88('0x43')][_0x6d88('0x44')]};});_0x46d1c3[_0x6d88('0x45')]=_['map'](_0x57303a,_0x6d88('0x3c'));_0x46d1c3[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x55874f[_0x6d88('0x46')]);_0x46d1c3['filters']=_[_0x6d88('0x48')](_0x46d1c3[_0x6d88('0x45')],_0x46d1c3[_0x6d88('0x46')]);_0x22d4be[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x46d1c3[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x55874f[_0x6d88('0x46')]['fields']));_0x22d4be[_0x6d88('0x49')]=_0x22d4be[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x22d4be[_0x6d88('0x49')]:_0x46d1c3[_0x6d88('0x45')];if(!_0x55874f[_0x6d88('0x46')][_0x6d88('0x4c')]('nolimit')){_0x22d4be[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x55874f['query'][_0x6d88('0x30')]);_0x22d4be[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x55874f[_0x6d88('0x46')][_0x6d88('0x2e')]);}_0x22d4be[_0x6d88('0x4d')]=qs[_0x6d88('0x4e')](_0x55874f[_0x6d88('0x46')][_0x6d88('0x4e')]);_0x22d4be['where']=qs['filters'](_['pick'](_0x55874f[_0x6d88('0x46')],_0x46d1c3[_0x6d88('0x4f')]),_0x57303a);if(_0x55874f[_0x6d88('0x46')]['filter']){_0x22d4be['where']=_[_0x6d88('0x50')](_0x22d4be[_0x6d88('0x51')],{'$or':_['map'](_0x57303a,function(_0x3389ef){if(_0x3389ef['type']!=='VIRTUAL'){var _0x40743e={};_0x40743e[_0x3389ef[_0x6d88('0x3c')]]={'$like':'%'+_0x55874f[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x40743e;}})});}_0x22d4be=_[_0x6d88('0x50')]({},_0x22d4be,_0x55874f[_0x6d88('0x53')]);var _0x29c410={'where':_0x22d4be[_0x6d88('0x51')]};return db['SmsAccount'][_0x6d88('0x31')](_0x29c410)[_0x6d88('0x20')](function(_0x49a078){_0x28edd5[_0x6d88('0x31')]=_0x49a078;if(_0x55874f[_0x6d88('0x46')][_0x6d88('0x54')]){_0x22d4be[_0x6d88('0x55')]=[{'all':!![]}];}return db[_0x6d88('0x41')][_0x6d88('0x56')](_0x22d4be);})[_0x6d88('0x20')](function(_0x59e721){_0x28edd5[_0x6d88('0x57')]=_0x59e721;return _0x28edd5;})['then'](respondWithFilteredResult(_0x57f180,_0x22d4be))[_0x6d88('0x58')](handleError(_0x57f180,null));};exports['show']=function(_0x3dbb4a,_0x30efd7){var _0x314a6f={'raw':![],'where':{'id':_0x3dbb4a['params']['id']},'include':[{'model':db['Pause'],'as':_0x6d88('0x3f')}]},_0x12e233={};_0x12e233['model']=_[_0x6d88('0x47')](db[_0x6d88('0x41')][_0x6d88('0x59')]);_0x12e233[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x3dbb4a[_0x6d88('0x46')]);_0x12e233[_0x6d88('0x4f')]=_[_0x6d88('0x48')](_0x12e233[_0x6d88('0x45')],_0x12e233[_0x6d88('0x46')]);_0x314a6f[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x12e233['model'],qs[_0x6d88('0x4a')](_0x3dbb4a[_0x6d88('0x46')]['fields']));_0x314a6f['attributes']=_0x314a6f[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x314a6f[_0x6d88('0x49')]:_0x12e233[_0x6d88('0x45')];if(_0x3dbb4a['query'][_0x6d88('0x54')]){_0x314a6f[_0x6d88('0x55')]=[{'all':!![]}];}_0x314a6f=_[_0x6d88('0x50')]({},_0x314a6f,_0x3dbb4a[_0x6d88('0x53')]);return db[_0x6d88('0x41')]['find'](_0x314a6f)['then'](handleEntityNotFound(_0x30efd7,null))[_0x6d88('0x20')](respondWithResult(_0x30efd7,null))['catch'](handleError(_0x30efd7,null));};exports[_0x6d88('0x5a')]=function(_0x2fab98,_0x5b0537){return db[_0x6d88('0x41')][_0x6d88('0x5a')](_0x2fab98[_0x6d88('0x5b')],{})[_0x6d88('0x20')](function(_0x10121f){var _0x55b4b8=_0x2fab98[_0x6d88('0x5c')][_0x6d88('0x37')]({'plain':!![]});if(!_0x55b4b8)throw new Error(_0x6d88('0x5d'));if(_0x55b4b8['role']===_0x6d88('0x5c')){var _0x3b83c9=_0x10121f['get']({'plain':!![]});var _0x458ba8='SmsAccounts';return db[_0x6d88('0x5e')]['find']({'where':{'name':_0x458ba8,'userProfileId':_0x55b4b8[_0x6d88('0x5f')]},'raw':!![]})[_0x6d88('0x20')](function(_0x20f3b9){if(_0x20f3b9&&_0x20f3b9[_0x6d88('0x60')]===0x0){return db[_0x6d88('0x39')][_0x6d88('0x5a')]({'name':_0x3b83c9['name'],'resourceId':_0x3b83c9['id'],'type':_0x20f3b9[_0x6d88('0x3c')],'sectionId':_0x20f3b9['id']},{})[_0x6d88('0x20')](function(){return _0x10121f;});}else{return _0x10121f;}})[_0x6d88('0x58')](function(_0x2e55fe){logger[_0x6d88('0x27')](_0x6d88('0x61'),_0x2e55fe);throw _0x2e55fe;});}return _0x10121f;})['then'](respondWithResult(_0x5b0537,0xc9))[_0x6d88('0x58')](handleError(_0x5b0537,null));};exports[_0x6d88('0x35')]=function(_0x29db2a,_0x42c4d4){if(_0x29db2a[_0x6d88('0x5b')]['id']){delete _0x29db2a['body']['id'];}return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x29db2a[_0x6d88('0x63')]['id']},'include':[{'model':db[_0x6d88('0x64')],'as':_0x6d88('0x3f')}]})[_0x6d88('0x20')](handleEntityNotFound(_0x42c4d4,null))[_0x6d88('0x20')](saveUpdates(_0x29db2a[_0x6d88('0x5b')],null))[_0x6d88('0x20')](respondWithResult(_0x42c4d4,null))['catch'](handleError(_0x42c4d4,null));};exports[_0x6d88('0x36')]=function(_0x5c102d,_0x4d11cb){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x5c102d[_0x6d88('0x63')]['id']}})['then'](handleEntityNotFound(_0x4d11cb,null))[_0x6d88('0x20')](removeEntity(_0x4d11cb,null))[_0x6d88('0x58')](handleError(_0x4d11cb,null));};exports[_0x6d88('0x65')]=function(_0x30cb3b,_0x2be494){return db[_0x6d88('0x41')]['describe']()[_0x6d88('0x20')](respondWithResult(_0x2be494,null))[_0x6d88('0x58')](handleError(_0x2be494,null));};exports[_0x6d88('0x66')]=function(_0x1ce8d0,_0x5c2070,_0x26819d){if(_0x1ce8d0['body']['id']){delete _0x1ce8d0[_0x6d88('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x1ce8d0[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x5c2070,null))['then'](function(_0x344120){if(_0x344120){_0x1ce8d0[_0x6d88('0x5b')][_0x6d88('0x67')]=_0x344120['id'];return db[_0x6d88('0x68')][_0x6d88('0x5a')](_0x1ce8d0[_0x6d88('0x5b')]);}})[_0x6d88('0x20')](respondWithResult(_0x5c2070,null))['catch'](handleError(_0x5c2070,null));};exports[_0x6d88('0x69')]=function(_0x5e4a9d,_0xf16279,_0x6ae2c){var _0x372b97={'raw':![],'where':{}};var _0x71f1ad={};var _0x1fe1f2={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6d88('0x6a')]({'where':{'id':_0x5e4a9d[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0xf16279,null))['then'](function(_0x555b42){if(_0x555b42){_0x71f1ad['model']=_[_0x6d88('0x47')](db[_0x6d88('0x68')][_0x6d88('0x59')]);_0x71f1ad['query']=_[_0x6d88('0x47')](_0x5e4a9d[_0x6d88('0x46')]);_0x71f1ad[_0x6d88('0x4f')]=_[_0x6d88('0x48')](_0x71f1ad[_0x6d88('0x45')],_0x71f1ad[_0x6d88('0x46')]);_0x372b97[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x71f1ad[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x5e4a9d[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x372b97['attributes']=_0x372b97[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x372b97['attributes']:_0x71f1ad[_0x6d88('0x45')];if(!_0x5e4a9d[_0x6d88('0x46')]['hasOwnProperty']('nolimit')){_0x372b97[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x5e4a9d['query'][_0x6d88('0x30')]);_0x372b97[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x5e4a9d[_0x6d88('0x46')][_0x6d88('0x2e')]);}_0x372b97['order']=qs[_0x6d88('0x4e')](_0x5e4a9d[_0x6d88('0x46')]['sort']);_0x372b97['where']=qs['filters'](_[_0x6d88('0x6b')](_0x5e4a9d[_0x6d88('0x46')],_0x71f1ad[_0x6d88('0x4f')]));_0x372b97[_0x6d88('0x51')][_0x6d88('0x67')]=_0x555b42['id'];if(_0x5e4a9d['query'][_0x6d88('0x52')]){_0x372b97[_0x6d88('0x51')]=_[_0x6d88('0x50')](_0x372b97[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x372b97[_0x6d88('0x49')],function(_0x48bdf8){var _0x2fb0d7={};_0x2fb0d7[_0x48bdf8]={'$like':'%'+_0x5e4a9d[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x2fb0d7;})});}_0x372b97=_[_0x6d88('0x50')]({},_0x372b97,_0x5e4a9d[_0x6d88('0x53')]);return db[_0x6d88('0x68')]['count']({'where':_0x372b97[_0x6d88('0x51')]})[_0x6d88('0x20')](function(_0xe181b1){_0x1fe1f2[_0x6d88('0x31')]=_0xe181b1;if(_0x5e4a9d['query']['includeAll']){_0x372b97['include']=[{'all':!![]}];}return db['Disposition'][_0x6d88('0x56')](_0x372b97);})[_0x6d88('0x20')](function(_0x583db2){_0x1fe1f2[_0x6d88('0x57')]=_0x583db2;return _0x1fe1f2;});}})[_0x6d88('0x20')](respondWithFilteredResult(_0xf16279,_0x372b97))['catch'](handleError(_0xf16279,null));};exports[_0x6d88('0x6c')]=function(_0x48ba54,_0xf1d79c,_0x1236f2){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x48ba54[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0xf1d79c,null))[_0x6d88('0x20')](function(_0x5b5603){if(_0x5b5603){return _0x5b5603['removeDispositions'](_0x48ba54[_0x6d88('0x46')][_0x6d88('0x6d')]);}})['then'](respondWithStatusCode(_0xf1d79c,null))['catch'](handleError(_0xf1d79c,null));};exports[_0x6d88('0x6e')]=function(_0x2aab3b,_0x53e73c,_0xf59e1c){if(_0x2aab3b[_0x6d88('0x5b')]['id']){delete _0x2aab3b[_0x6d88('0x5b')]['id'];}return db['SmsAccount'][_0x6d88('0x62')]({'where':{'id':_0x2aab3b[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x53e73c,null))[_0x6d88('0x20')](function(_0x23624f){if(_0x23624f){_0x2aab3b[_0x6d88('0x5b')][_0x6d88('0x67')]=_0x23624f['id'];return db[_0x6d88('0x6f')][_0x6d88('0x5a')](_0x2aab3b[_0x6d88('0x5b')]);}})[_0x6d88('0x20')](respondWithResult(_0x53e73c,null))[_0x6d88('0x58')](handleError(_0x53e73c,null));};exports[_0x6d88('0x70')]=function(_0x199d3c,_0x9e67fc,_0x473795){var _0x28b28d={'raw':![],'where':{}};var _0xc517e6={};var _0x4959fa={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x199d3c[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x9e67fc,null))[_0x6d88('0x20')](function(_0x490bf1){if(_0x490bf1){_0xc517e6['model']=_[_0x6d88('0x47')](db[_0x6d88('0x6f')][_0x6d88('0x59')]);_0xc517e6[_0x6d88('0x46')]=_['keys'](_0x199d3c[_0x6d88('0x46')]);_0xc517e6[_0x6d88('0x4f')]=_['intersection'](_0xc517e6['model'],_0xc517e6[_0x6d88('0x46')]);_0x28b28d[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0xc517e6['model'],qs[_0x6d88('0x4a')](_0x199d3c['query'][_0x6d88('0x4a')]));_0x28b28d[_0x6d88('0x49')]=_0x28b28d[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x28b28d[_0x6d88('0x49')]:_0xc517e6[_0x6d88('0x45')];if(!_0x199d3c[_0x6d88('0x46')][_0x6d88('0x4c')](_0x6d88('0x71'))){_0x28b28d[_0x6d88('0x30')]=qs['limit'](_0x199d3c[_0x6d88('0x46')][_0x6d88('0x30')]);_0x28b28d[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x199d3c[_0x6d88('0x46')]['offset']);}_0x28b28d[_0x6d88('0x4d')]=qs[_0x6d88('0x4e')](_0x199d3c[_0x6d88('0x46')][_0x6d88('0x4e')]);_0x28b28d[_0x6d88('0x51')]=qs[_0x6d88('0x4f')](_[_0x6d88('0x6b')](_0x199d3c[_0x6d88('0x46')],_0xc517e6[_0x6d88('0x4f')]));_0x28b28d[_0x6d88('0x51')][_0x6d88('0x67')]=_0x490bf1['id'];if(_0x199d3c[_0x6d88('0x46')][_0x6d88('0x52')]){_0x28b28d['where']=_[_0x6d88('0x50')](_0x28b28d[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x28b28d[_0x6d88('0x49')],function(_0x53f81f){var _0x24d0d9={};_0x24d0d9[_0x53f81f]={'$like':'%'+_0x199d3c[_0x6d88('0x46')]['filter']+'%'};return _0x24d0d9;})});}_0x28b28d=_[_0x6d88('0x50')]({},_0x28b28d,_0x199d3c['options']);return db['CannedAnswer'][_0x6d88('0x31')]({'where':_0x28b28d['where']})[_0x6d88('0x20')](function(_0x196f2b){_0x4959fa['count']=_0x196f2b;if(_0x199d3c[_0x6d88('0x46')][_0x6d88('0x54')]){_0x28b28d[_0x6d88('0x55')]=[{'all':!![]}];}return db[_0x6d88('0x6f')][_0x6d88('0x56')](_0x28b28d);})['then'](function(_0x2768e2){_0x4959fa['rows']=_0x2768e2;return _0x4959fa;});}})[_0x6d88('0x20')](respondWithFilteredResult(_0x9e67fc,_0x28b28d))[_0x6d88('0x58')](handleError(_0x9e67fc,null));};exports[_0x6d88('0x72')]=function(_0x141f16,_0x2a36dc,_0x3ebaee){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x141f16[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x2a36dc,null))[_0x6d88('0x20')](function(_0x233ef6){if(_0x233ef6){return _0x233ef6[_0x6d88('0x72')](_0x141f16['query'][_0x6d88('0x6d')]);}})[_0x6d88('0x20')](respondWithStatusCode(_0x2a36dc,null))['catch'](handleError(_0x2a36dc,null));};exports[_0x6d88('0x73')]=function(_0x107ea2,_0x2fae20,_0x3ce97c){var _0x5dcfee={'channel':_0x6d88('0x74')};var _0x574a98=[];var _0x2c646e=[];var _0x3b92b4={};return db[_0x6d88('0x41')]['find']({'where':{'id':_0x107ea2[_0x6d88('0x63')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x6d88('0x20')](handleEntityNotFound(_0x2fae20,null))[_0x6d88('0x20')](function(_0x3a10c6){_0x5dcfee[_0x6d88('0x75')]=_0x3a10c6;_0x5dcfee[_0x6d88('0x76')]=_[_0x6d88('0x77')](_0x3a10c6[_0x6d88('0x78')],[_0x6d88('0x79')],[_0x6d88('0x7a')]);if(_0x5dcfee[_0x6d88('0x75')][_0x6d88('0x78')]){delete _0x5dcfee[_0x6d88('0x75')][_0x6d88('0x78')];}return db[_0x6d88('0x7b')][_0x6d88('0x65')]();})[_0x6d88('0x20')](function(_0x5d4550){if(!_0x5d4550){throw new db[(_0x6d88('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x574a98=_[_0x6d88('0x7d')](_[_0x6d88('0x47')](_0x5d4550),[_0x6d88('0x7e'),_0x6d88('0x7f')]);_0x2c646e=_[_0x6d88('0x7d')](_[_0x6d88('0x47')](_0x5d4550),[_0x6d88('0x7e'),_0x6d88('0x7f'),_0x6d88('0x80'),_0x6d88('0x81')]);_0x5dcfee[_0x6d88('0x5b')]={'mapKey':_0x6d88('0x82')};if(_0x5dcfee[_0x6d88('0x75')][_0x6d88('0x43')]){switch(_0x5dcfee['account']['type']){case _0x6d88('0x83'):_0x5dcfee[_0x6d88('0x5b')]['from']=_0x107ea2[_0x6d88('0x5b')]['From'];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x84')];_0x5dcfee['body']['messageId']=_0x107ea2['body'][_0x6d88('0x85')];break;case _0x6d88('0x86'):_0x5dcfee['body']['from']='+'+_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x87')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2['body']['text'];break;case _0x6d88('0x88'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x89')];_0x5dcfee['body'][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x29')];break;case _0x6d88('0x8a'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2['body'][_0x6d88('0x89')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x5b')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x8b')]=_0x107ea2['body']['message_id'];break;case _0x6d88('0x8c'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x8d')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')]['Text'];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x8e')];break;case _0x6d88('0x8f'):_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]='+'+_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x90')][0x0]['from'];_0x5dcfee[_0x6d88('0x5b')]['body']=_0x107ea2[_0x6d88('0x5b')]['results'][0x0][_0x6d88('0x91')];_0x5dcfee['body'][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x90')][0x0][_0x6d88('0x8b')];break;case'csc':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')]['originatingAddress'];_0x5dcfee[_0x6d88('0x5b')]['body']=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x92')][_0x6d88('0x29')];break;case'clickatell':_0x5dcfee[_0x6d88('0x5b')]['from']=_0x107ea2['body'][_0x6d88('0x93')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x91')];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')]['replyMessageId'];break;case'bandwidth':_0x5dcfee['body'][_0x6d88('0x8b')]=_0x107ea2[_0x6d88('0x5b')][0x0]['message']['id'];_0x5dcfee['body'][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')][0x0][_0x6d88('0x29')]['from'];_0x5dcfee['body'][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][0x0]['message'][_0x6d88('0x91')];break;case'intelepeer':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')]=_0x107ea2[_0x6d88('0x5b')]['from'];_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x29')];_0x5dcfee[_0x6d88('0x5b')]['messageId']=_0x107ea2[_0x6d88('0x5b')][_0x6d88('0x94')];break;}}if(_0x5dcfee[_0x6d88('0x5b')]['id']){delete _0x5dcfee[_0x6d88('0x5b')]['id'];}if(_[_0x6d88('0x95')](_0x5dcfee['body'][_0x6d88('0x89')])){throw new db[(_0x6d88('0x7c'))][(_0x6d88('0x96'))](_0x6d88('0x97'));}if(_['isNil'](_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')])||_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')]===''){throw new db[(_0x6d88('0x7c'))][(_0x6d88('0x96'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6d88('0x95')](_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x98')])){throw new db[(_0x6d88('0x7c'))]['ValidationError'](_0x6d88('0x99')+_0x2c646e);}if(!_[_0x6d88('0x9a')](_0x2c646e,_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x98')])){throw new db[(_0x6d88('0x7c'))]['ValidationError'](_0x6d88('0x9b')+_0x2c646e);}_0x3b92b4[_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x98')]]=_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')];return db['CmList'][_0x6d88('0x62')]({'where':{'id':_0x5dcfee[_0x6d88('0x75')][_0x6d88('0x81')]},'include':[{'model':db['CmContact'],'as':_0x6d88('0x9c'),'where':_0x3b92b4,'limit':0x1,'order':[[_0x6d88('0x7f'),_0x6d88('0x9d')]]}]});})[_0x6d88('0x20')](handleEntityNotFound(_0x2fae20,null))['then'](function(_0x433e18){if(_0x433e18){_0x5dcfee[_0x6d88('0x9e')]=_['omit'](_0x433e18,[_0x6d88('0x9c')]);if(_0x433e18[_0x6d88('0x9c')][_0x6d88('0x4b')]){return _0x433e18[_0x6d88('0x9c')][0x0];}var _0x3c504a=_[_0x6d88('0x9f')](_0x5dcfee[_0x6d88('0x5b')],{'firstName':_0x5dcfee[_0x6d88('0x5b')]['from'],'ListId':_0x433e18['id']});_0x3c504a[_0x5dcfee['body'][_0x6d88('0x98')]]=_0x5dcfee[_0x6d88('0x5b')]['from'];return db[_0x6d88('0x7b')][_0x6d88('0x5a')](_0x3c504a,{'fields':_0x574a98,'raw':!![]});}})[_0x6d88('0x20')](handleEntityNotFound(_0x2fae20,null))['then'](function(_0x1abe89){if(_0x1abe89){_0x5dcfee[_0x6d88('0xa0')]=_0x1abe89;var _0x587f9e={'ContactId':_0x1abe89['id'],'phone':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x89')],'SmsAccountId':_0x107ea2[_0x6d88('0x63')]['id']};var _0x35ab84={'ContactId':_0x1abe89['id'],'SmsAccountId':_0x107ea2[_0x6d88('0x63')]['id'],'closed':![]};return db[_0x6d88('0xa1')][_0x6d88('0x62')]({'where':_0x35ab84})[_0x6d88('0x20')](function(_0x59c844){if(_0x59c844){return[_0x59c844,![]];}return db[_0x6d88('0xa1')]['create'](_0x587f9e)[_0x6d88('0x20')](function(_0x79fd80){return[_0x79fd80,!![]];});});}})[_0x6d88('0xa2')](function(_0x409322,_0xe123cc){_0x5dcfee['interaction']=_0x409322[_0x6d88('0x37')]({'plain':!![]});_0x5dcfee[_0x6d88('0xa3')]['created']=![];if(_0xe123cc){if(_0x5dcfee[_0x6d88('0x75')][_0x6d88('0xa4')]){_0x5dcfee[_0x6d88('0x76')]['push']({'id':0x0,'priority':_0x5dcfee['applications']['length']+0x1,'app':_0x6d88('0xa5'),'appdata':_0x6d88('0xa6'),'interval':'*,*,*,*'});}_0x5dcfee[_0x6d88('0xa3')][_0x6d88('0xa7')]=!![];}return db[_0x6d88('0xa8')]['create']({'phone':_0x5dcfee[_0x6d88('0x5b')]['from'],'messageId':_0x5dcfee[_0x6d88('0x5b')]['messageId'],'body':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0x5b')],'SmsAccountId':_0x107ea2[_0x6d88('0x63')]['id'],'SmsInteractionId':_0x409322['id'],'direction':'in','ContactId':_0x409322[_0x6d88('0xa9')],'AttachmentId':_0x5dcfee[_0x6d88('0x5b')][_0x6d88('0xaa')]});})['then'](function(_0x739b22){_0x5dcfee[_0x6d88('0x29')]=_0x739b22;if(_0x5dcfee[_0x6d88('0xa3')][_0x6d88('0xab')]){return db[_0x6d88('0xac')][_0x6d88('0x62')]({'attributes':['id',_0x6d88('0x3c')],'where':{'id':_0x5dcfee['interaction'][_0x6d88('0xab')]}})[_0x6d88('0x20')](function(_0x2e8cd6){if(_0x2e8cd6){_0x5dcfee['applications'][_0x6d88('0xad')]({'id':0x0,'priority':0x0,'app':_0x6d88('0xae'),'appdata':_0x2e8cd6[_0x6d88('0x3c')]+','+(_0x5dcfee[_0x6d88('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x6d88('0xaf')});}return respondWithRpcPromise(_0x6d88('0xb0'),_0x6d88('0xb1'),_0x5dcfee);});}return respondWithRpcPromise(_0x6d88('0xb0'),'startRouting',_0x5dcfee);})[_0x6d88('0x20')](function(_0x267cdb){if(_0x267cdb){var _0x517ef1=0xc8;var _0x21a3ff=_0x6d88('0xb2');logger[_0x6d88('0x21')](_0x6d88('0x23'),_0x21a3ff,_0x517ef1,_0x6d88('0xb3'));logger['debug'](_0x6d88('0xb4'),_0x21a3ff,_0x517ef1,_0x6d88('0xb3'),JSON[_0x6d88('0x25')](_0x267cdb));if(_0x5dcfee['account'][_0x6d88('0x43')]===_0x6d88('0x83')){return _0x2fae20[_0x6d88('0x2c')](_0x517ef1)[_0x6d88('0x32')]('Content-Type',_0x6d88('0xb5'))['send'](_0x6d88('0xb6'));}else{return _0x2fae20['status'](_0x517ef1)[_0x6d88('0x2d')](_0x267cdb);}}})['catch'](handleError(_0x2fae20,null));};exports['addApplications']=function(_0x11cd0f,_0x28c274,_0x12d7a3){return db[_0x6d88('0x41')][_0x6d88('0x6a')]({'where':{'id':_0x11cd0f[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x28c274,null))['then'](function(_0x39ac87){if(_0x39ac87){return db[_0x6d88('0xb7')][_0x6d88('0xb8')](function(_0x3d4cd7){return db[_0x6d88('0xb9')]['destroy']({'where':{'SmsAccountId':_0x11cd0f[_0x6d88('0x63')]['id']},'transaction':_0x3d4cd7})[_0x6d88('0x20')](function(_0xc15d66){var _0x5c77c0=_[_0x6d88('0x40')](_0x11cd0f[_0x6d88('0x5b')],function(_0x3d1880){_0x3d1880[_0x6d88('0x67')]=_0x11cd0f['params']['id'];return _0x3d1880;});return db[_0x6d88('0xb9')][_0x6d88('0xba')](_0x5c77c0,{'transaction':_0x3d4cd7});});})[_0x6d88('0x20')](function(){return db['SmsApplication'][_0x6d88('0xbb')]({'where':{'SmsAccountId':_0x11cd0f['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x28c274,null))[_0x6d88('0x58')](handleError(_0x28c274,null));};exports[_0x6d88('0xbc')]=function(_0x28dda2,_0x3927d8,_0x27db17){var _0x36ba1d={};var _0x14c259={};var _0x26bfc0;var _0x1d95b8;return db[_0x6d88('0x41')][_0x6d88('0x6a')]({'where':{'id':_0x28dda2[_0x6d88('0x63')]['id']}})['then'](handleEntityNotFound(_0x3927d8,null))[_0x6d88('0x20')](function(_0x50f1a0){if(_0x50f1a0){_0x26bfc0=_0x50f1a0;_0x14c259[_0x6d88('0x45')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x14c259[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x28dda2[_0x6d88('0x46')]);_0x14c259['filters']=_['intersection'](_0x14c259[_0x6d88('0x45')],_0x14c259['query']);_0x36ba1d['attributes']=_['intersection'](_0x14c259[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x28dda2[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x36ba1d[_0x6d88('0x49')]=_0x36ba1d[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x36ba1d[_0x6d88('0x49')]:_0x14c259[_0x6d88('0x45')];_0x36ba1d[_0x6d88('0x4d')]=qs['sort'](_0x28dda2[_0x6d88('0x46')][_0x6d88('0x4e')]);_0x36ba1d[_0x6d88('0x51')]=qs[_0x6d88('0x4f')](_[_0x6d88('0x6b')](_0x28dda2[_0x6d88('0x46')],_0x14c259[_0x6d88('0x4f')]));if(_0x28dda2[_0x6d88('0x46')][_0x6d88('0x52')]){_0x36ba1d[_0x6d88('0x51')]=_[_0x6d88('0x50')](_0x36ba1d[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x36ba1d['attributes'],function(_0x4bc5cb){var _0xc1ca95={};_0xc1ca95[_0x4bc5cb]={'$like':'%'+_0x28dda2[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0xc1ca95;})});}_0x36ba1d=_[_0x6d88('0x50')]({},_0x36ba1d,_0x28dda2[_0x6d88('0x53')]);return _0x26bfc0['getApplications'](_0x36ba1d);}})[_0x6d88('0x20')](function(_0x1fce15){if(_0x1fce15){_0x1d95b8=_0x1fce15[_0x6d88('0x4b')];if(!_0x28dda2[_0x6d88('0x46')][_0x6d88('0x4c')]('nolimit')){_0x36ba1d[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x28dda2[_0x6d88('0x46')]['limit']);_0x36ba1d[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x28dda2['query'][_0x6d88('0x2e')]);}return _0x26bfc0[_0x6d88('0xbc')](_0x36ba1d);}})[_0x6d88('0x20')](function(_0x630b4b){if(_0x630b4b){return _0x630b4b?{'count':_0x1d95b8,'rows':_0x630b4b}:null;}})[_0x6d88('0x20')](respondWithResult(_0x3927d8,null))['catch'](handleError(_0x3927d8,null));};exports[_0x6d88('0xbd')]=function(_0x3c8197,_0x59a0eb,_0x1977cd){var _0x19f900={'raw':![],'where':{}};var _0x11adb2={};var _0x1ba388={'count':0x0,'rows':[]};return db[_0x6d88('0x41')]['findOne']({'where':{'id':_0x3c8197['params']['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x59a0eb,null))[_0x6d88('0x20')](function(_0x308f33){if(_0x308f33){_0x11adb2[_0x6d88('0x45')]=_[_0x6d88('0x47')](db[_0x6d88('0xa1')]['rawAttributes']);_0x11adb2[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x3c8197['query']);_0x11adb2[_0x6d88('0x4f')]=_[_0x6d88('0x48')](_0x11adb2[_0x6d88('0x45')],_0x11adb2['query']);_0x19f900[_0x6d88('0x49')]=_[_0x6d88('0x48')](_0x11adb2[_0x6d88('0x45')],qs[_0x6d88('0x4a')](_0x3c8197[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x19f900[_0x6d88('0x49')]=_0x19f900[_0x6d88('0x49')][_0x6d88('0x4b')]?_0x19f900[_0x6d88('0x49')]:_0x11adb2[_0x6d88('0x45')];if(!_0x3c8197[_0x6d88('0x46')][_0x6d88('0x4c')](_0x6d88('0x71'))){_0x19f900[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x3c8197['query'][_0x6d88('0x30')]);_0x19f900[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x3c8197[_0x6d88('0x46')]['offset']);}_0x19f900['order']=qs['sort'](_0x3c8197['query']['sort']);_0x19f900[_0x6d88('0x51')]=qs['filters'](_[_0x6d88('0x6b')](_0x3c8197[_0x6d88('0x46')],_0x11adb2[_0x6d88('0x4f')]));_0x19f900[_0x6d88('0x51')][_0x6d88('0x67')]=_0x308f33['id'];if(_0x3c8197[_0x6d88('0x46')][_0x6d88('0x52')]){_0x19f900[_0x6d88('0x51')]=_[_0x6d88('0x50')](_0x19f900['where'],{'$or':_[_0x6d88('0x40')](_0x19f900[_0x6d88('0x49')],function(_0x4d56e3){var _0x4a15d2={};_0x4a15d2[_0x4d56e3]={'$like':'%'+_0x3c8197[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x4a15d2;})});}_0x19f900=_[_0x6d88('0x50')]({},_0x19f900,_0x3c8197[_0x6d88('0x53')]);return db[_0x6d88('0xa1')][_0x6d88('0x31')]({'where':_0x19f900[_0x6d88('0x51')]})[_0x6d88('0x20')](function(_0x5bbc42){_0x1ba388['count']=_0x5bbc42;if(_0x3c8197['query'][_0x6d88('0x54')]){_0x19f900[_0x6d88('0x55')]=[{'model':db['CmContact'],'as':_0x6d88('0xbe'),'required':![]},{'model':db[_0x6d88('0xac')],'as':_0x6d88('0xbf'),'attributes':[_0x6d88('0x3c'),_0x6d88('0xc0'),'internal'],'required':![]},{'model':db[_0x6d88('0xc1')],'as':_0x6d88('0xc2'),'attributes':['id',_0x6d88('0x3c'),_0x6d88('0xc3')],'where':_0x3c8197[_0x6d88('0x46')]['tag']?{'id':_0x3c8197[_0x6d88('0x46')][_0x6d88('0xc4')]}:undefined,'required':_0x3c8197['query'][_0x6d88('0xc4')]?!![]:![]}];}return db[_0x6d88('0xa1')][_0x6d88('0x56')](_0x19f900);})[_0x6d88('0x20')](function(_0x14f2d5){_0x1ba388[_0x6d88('0x57')]=_0x14f2d5;return _0x1ba388;});}})['then'](respondWithFilteredResult(_0x59a0eb,_0x19f900))[_0x6d88('0x58')](handleError(_0x59a0eb,null));};exports[_0x6d88('0x3d')]=function(_0x34a0c5,_0x207299,_0x21b212){var _0x74e810,_0x585a84,_0x31a7ae;if(_[_0x6d88('0x95')](_0x34a0c5[_0x6d88('0x5b')]['body'])||_0x34a0c5[_0x6d88('0x5b')][_0x6d88('0x5b')]===''){throw new db[(_0x6d88('0x7c'))][(_0x6d88('0x96'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x34a0c5[_0x6d88('0x5b')]['to'])){throw new db['Sequelize'][(_0x6d88('0x96'))](_0x6d88('0xc5'));}_0x74e810=_0x34a0c5[_0x6d88('0x5b')]['to'];return db[_0x6d88('0x41')]['find']({'where':{'id':_0x34a0c5[_0x6d88('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x6d88('0xc6'),'include':[{'model':db[_0x6d88('0x7b')],'as':_0x6d88('0x9c'),'where':{'mobile':_0x74e810},'limit':0x1,'order':[[_0x6d88('0x7f'),_0x6d88('0x9d')]]}]}]})[_0x6d88('0x20')](handleEntityNotFound(_0x207299,null))[_0x6d88('0x20')](function(_0x1790b2){if(_0x1790b2&&_0x1790b2[_0x6d88('0xc6')]){_0x585a84=_0x1790b2['get']({'plain':!![]});if(_0x585a84[_0x6d88('0xc6')]&&_0x585a84[_0x6d88('0xc6')][_0x6d88('0x9c')][_0x6d88('0x4b')]){return _0x585a84[_0x6d88('0xc6')][_0x6d88('0x9c')][0x0];}return db[_0x6d88('0x7b')][_0x6d88('0x5a')](_['defaults'](_0x34a0c5[_0x6d88('0x5b')],{'firstName':_0x74e810,'mobile':_0x74e810,'phone':_0x74e810,'ListId':_0x585a84[_0x6d88('0x81')]}));}})['then'](handleEntityNotFound(_0x207299,null))['then'](function(_0x4b201c){if(_0x4b201c){_0x31a7ae=_0x4b201c;return db[_0x6d88('0xa1')]['find']({'where':{'ContactId':_0x31a7ae['id'],'closed':![],'SmsAccountId':_0x585a84['id']}})[_0x6d88('0x20')](function(_0x323378){if(_0x323378){return[_0x323378,![]];}return db['SmsInteraction'][_0x6d88('0x5a')]({'UserId':_0x34a0c5[_0x6d88('0x5c')]['id'],'ContactId':_0x31a7ae['id'],'SmsAccountId':_0x585a84['id'],'phone':_0x74e810,'firstMsgDirection':_0x6d88('0xc7'),'Messages':[_[_0x6d88('0x50')](_0x34a0c5[_0x6d88('0x5b')],{'read':![],'body':_0x34a0c5['body'][_0x6d88('0x5b')],'phone':_0x74e810,'SmsAccountId':_0x585a84['id'],'UserId':_0x34a0c5[_0x6d88('0x5c')]['id'],'ContactId':_0x31a7ae['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x6d88('0xc8')}]})[_0x6d88('0x20')](function(_0x5afb82){return[_0x5afb82,!![]];});});}})[_0x6d88('0xa2')](function(_0x260fbd,_0x3ba6b6){if(_0x3ba6b6){return _0x260fbd;}return db[_0x6d88('0xa8')][_0x6d88('0x5a')](_[_0x6d88('0x50')](_0x34a0c5[_0x6d88('0x5b')],{'read':![],'body':_0x34a0c5['body'][_0x6d88('0x5b')],'phone':_0x74e810,'SmsAccountId':_0x585a84['id'],'SmsInteractionId':_0x260fbd['id'],'UserId':_0x34a0c5[_0x6d88('0x5c')]['id'],'ContactId':_0x31a7ae['id']}))[_0x6d88('0x20')](function(_0x3dfb3b){_0x260fbd['dataValues'][_0x6d88('0xc8')]=[];_0x260fbd[_0x6d88('0xc9')][_0x6d88('0xc8')][_0x6d88('0xca')](_0x3dfb3b[_0x6d88('0xc9')]);return _0x260fbd;});})[_0x6d88('0x20')](respondWithResult(_0x207299,null))[_0x6d88('0x58')](handleError(_0x207299,null));};exports[_0x6d88('0x2c')]=function(_0x1e1528,_0x5ece6b,_0x407ac5){if(_0x1e1528['body']['id']){delete _0x1e1528[_0x6d88('0x5b')]['id'];}var _0x5ebe19,_0x5ba023,_0xaab3fc;return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x1e1528['params']['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x5ece6b,null))[_0x6d88('0x20')](function(_0x2d9b4c){if(_0x2d9b4c){_0xaab3fc=_0x2d9b4c;logger[_0x6d88('0x22')](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0xcb'),_0x2d9b4c[_0x6d88('0x43')],util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2d9b4c[_0x6d88('0x43')]){case _0x6d88('0x86'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xcd')]&&_0x1e1528['body'][_0x6d88('0x2c')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x2c')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528['body']['skebby_dispatch_id']}});}break;case _0x6d88('0x88'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xce')]&&_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xcf')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xcf')];return db[_0x6d88('0xa8')]['find']({'where':{'messageId':_0x1e1528['body'][_0x6d88('0xce')]}});}break;case'clicksend':if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd0')]&&_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd1')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd1')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528[_0x6d88('0x5b')]['message_id']}});}break;case'infobip':var _0x3ff669=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x90')][0x0];if(_0x3ff669['messageId']&&_0x3ff669[_0x6d88('0x2c')][_0x6d88('0xd2')]===_0x6d88('0xd3')){_0x5ba023=_0x3ff669['status']['groupName'];return db['SmsMessage'][_0x6d88('0x62')]({'where':{'messageId':_0x3ff669['messageId']}});}break;case _0x6d88('0xd4'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x8b')]&&_0x1e1528[_0x6d88('0x5b')]['status']){_0x5ba023=_0x1e1528['body'][_0x6d88('0x2c')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528['body'][_0x6d88('0x8b')]}});}break;case _0x6d88('0xd5'):if(_0x1e1528[_0x6d88('0x5b')][0x0]['message']['id']){_0x5ba023=_0x1e1528['body'][0x0][_0x6d88('0x43')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528[_0x6d88('0x5b')][0x0][_0x6d88('0x29')]['id']}});}break;case _0x6d88('0xd6'):if(_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd7')]&&_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x2c')]){_0x5ba023=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x2c')];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x1e1528['body'][_0x6d88('0xd7')]}});}break;}}})[_0x6d88('0x20')](handleEntityNotFound(_0x5ece6b,null))[_0x6d88('0x20')](function(_0x4d3b14){if(_0x4d3b14){_0x5ebe19=_0x4d3b14;switch(_0xaab3fc[_0x6d88('0x43')]){case _0x6d88('0x86'):if(_0x5ba023===_0x6d88('0xd3')){return _0x5ebe19['update']({'read':!![]});}else{logger['error'](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0x86'),util['inspect'](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5ba023==='1'){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0x86'),util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x6d88('0x8a'):if(!_0x1e1528[_0x6d88('0x5b')][_0x6d88('0xd8')]&&_0x5ba023>=0xc8&&_0x5ba023<=0xce){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger['error'](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0x8a'),util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xd08180=_0x1e1528[_0x6d88('0x5b')][_0x6d88('0x90')][0x0];if(_0xd08180[_0x6d88('0x2c')]['groupName']===_0x6d88('0xd3')){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),'infobip',util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x6d88('0xd4'):if(_0x5ba023==_0x6d88('0xd9')||_0x5ba023=='RECEIVED_BY_RECIPIENT'){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),'clickatell',util[_0x6d88('0xcc')](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5ba023==_0x6d88('0xda')){return _0x5ebe19[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),'status',_0x6d88('0xd5'),util[_0x6d88('0xcc')](_0x1e1528['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x5ba023===_0x6d88('0xdb')||_0x5ba023===_0x6d88('0xdc')){return _0x5ebe19['update']({'read':!![]});}else{logger[_0x6d88('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6d88('0x2c'),_0x6d88('0xd6'),util['inspect'](_0x1e1528[_0x6d88('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x5ebe19;}})[_0x6d88('0x20')](respondWithResult(_0x5ece6b,null))[_0x6d88('0x58')](handleError(_0x5ece6b,null));};exports[_0x6d88('0xdd')]=function(_0x31a187,_0x149504,_0x30d6c1){var _0x122cfc,_0x5d6feb,_0x37c9df;return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x31a187[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x149504,null))[_0x6d88('0x20')](function(_0x1233a7){if(_0x1233a7){_0x37c9df=_0x1233a7;logger[_0x6d88('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6d88('0x2c'),_0x6d88('0xcb'),_0x1233a7['type'],util[_0x6d88('0xcc')](_0x31a187['query'],{'showHidden':![],'depth':null}));switch(_0x1233a7[_0x6d88('0x43')]){case _0x6d88('0xde'):if(_0x31a187['query'][_0x6d88('0xdf')]&&_0x31a187[_0x6d88('0x46')]['state']){_0x5d6feb=_0x31a187[_0x6d88('0x46')]['state'];return db[_0x6d88('0xa8')][_0x6d88('0x62')]({'where':{'messageId':_0x31a187[_0x6d88('0x46')][_0x6d88('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x149504,null))[_0x6d88('0x20')](function(_0x5a59a5){if(_0x5a59a5){_0x122cfc=_0x5a59a5;switch(_0x37c9df[_0x6d88('0x43')]){case _0x6d88('0xde'):if(_0x5d6feb==='2'||_0x5d6feb==='6'){return _0x122cfc[_0x6d88('0x35')]({'read':!![]});}else{logger[_0x6d88('0x27')](_0x6d88('0x23'),_0x6d88('0x2c'),_0x6d88('0xde'),util['inspect'](_0x31a187[_0x6d88('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x122cfc;}})['then'](respondWithResult(_0x149504,null))[_0x6d88('0x58')](handleError(_0x149504,null));};exports[_0x6d88('0xe0')]=function(_0x2ec1f7,_0x38b93f,_0x179316){return db['SmsAccount']['find']({'where':{'id':_0x2ec1f7['params']['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x38b93f,null))['then'](function(_0x5f57d4){if(_0x5f57d4){return _0x5f57d4[_0x6d88('0xe0')](_0x2ec1f7[_0x6d88('0x5b')][_0x6d88('0x6d')],_[_0x6d88('0xe1')](_0x2ec1f7[_0x6d88('0x5b')],[_0x6d88('0x6d'),'id'])||{})[_0x6d88('0xa2')](function(_0x590f21){for(var _0x262526=0x0;_0x262526<_0x2ec1f7[_0x6d88('0x5b')][_0x6d88('0x6d')][_0x6d88('0x4b')];_0x262526+=0x1){socket[_0x6d88('0xe2')](_0x6d88('0xe3'),{'UserId':Number(_0x2ec1f7[_0x6d88('0x5b')]['ids'][_0x262526]),'SmsAccountId':Number(_0x2ec1f7[_0x6d88('0x63')]['id'])});}return _0x590f21;});}})[_0x6d88('0x20')](respondWithResult(_0x38b93f,null))['catch'](handleError(_0x38b93f,null));};exports[_0x6d88('0xe4')]=function(_0x39be18,_0x27fbe0,_0x34cf98){return db[_0x6d88('0x41')][_0x6d88('0x62')]({'where':{'id':_0x39be18[_0x6d88('0x63')]['id']}})[_0x6d88('0x20')](handleEntityNotFound(_0x27fbe0,null))[_0x6d88('0x20')](function(_0x518dec){if(_0x518dec){return _0x518dec[_0x6d88('0xe4')](_0x39be18['query'][_0x6d88('0x6d')])[_0x6d88('0x20')](function(){if(_[_0x6d88('0xe5')](_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')])){for(var _0x5348f6=0x0;_0x5348f6<_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')][_0x6d88('0x4b')];_0x5348f6+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')][_0x5348f6]),'SmsAccountId':Number(_0x39be18[_0x6d88('0x63')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x39be18[_0x6d88('0x46')][_0x6d88('0x6d')]),'SmsAccountId':Number(_0x39be18[_0x6d88('0x63')]['id'])});}});}})[_0x6d88('0x20')](respondWithStatusCode(_0x27fbe0,null))['catch'](handleError(_0x27fbe0,null));};exports[_0x6d88('0xe6')]=function(_0x373bcf,_0x52f3de,_0x499e3c){var _0x8af6c0={};var _0x21236c={};var _0x17afa9;var _0x4fd032;return db[_0x6d88('0x41')]['findOne']({'where':{'id':_0x373bcf[_0x6d88('0x63')]['id']}})['then'](handleEntityNotFound(_0x52f3de,null))[_0x6d88('0x20')](function(_0xff286d){if(_0xff286d){_0x17afa9=_0xff286d;_0x21236c[_0x6d88('0x45')]=_[_0x6d88('0x47')](db[_0x6d88('0xac')][_0x6d88('0x59')]);_0x21236c[_0x6d88('0x46')]=_[_0x6d88('0x47')](_0x373bcf['query']);_0x21236c[_0x6d88('0x4f')]=_['intersection'](_0x21236c[_0x6d88('0x45')],_0x21236c[_0x6d88('0x46')]);_0x8af6c0['attributes']=_['intersection'](_0x21236c[_0x6d88('0x45')],qs['fields'](_0x373bcf[_0x6d88('0x46')][_0x6d88('0x4a')]));_0x8af6c0['attributes']=_0x8af6c0[_0x6d88('0x49')]['length']?_0x8af6c0[_0x6d88('0x49')]:_0x21236c[_0x6d88('0x45')];_0x8af6c0[_0x6d88('0x4d')]=qs[_0x6d88('0x4e')](_0x373bcf['query'][_0x6d88('0x4e')]);_0x8af6c0[_0x6d88('0x51')]=qs['filters'](_[_0x6d88('0x6b')](_0x373bcf[_0x6d88('0x46')],_0x21236c[_0x6d88('0x4f')]));if(_0x373bcf[_0x6d88('0x46')][_0x6d88('0x52')]){_0x8af6c0[_0x6d88('0x51')]=_['merge'](_0x8af6c0[_0x6d88('0x51')],{'$or':_[_0x6d88('0x40')](_0x8af6c0[_0x6d88('0x49')],function(_0x47dff3){var _0x435fd7={};_0x435fd7[_0x47dff3]={'$like':'%'+_0x373bcf[_0x6d88('0x46')][_0x6d88('0x52')]+'%'};return _0x435fd7;})});}_0x8af6c0=_[_0x6d88('0x50')]({},_0x8af6c0,_0x373bcf['options']);return _0x17afa9[_0x6d88('0xe6')](_0x8af6c0);}})['then'](function(_0x35cfb2){if(_0x35cfb2){_0x4fd032=_0x35cfb2['length'];if(!_0x373bcf[_0x6d88('0x46')]['hasOwnProperty'](_0x6d88('0x71'))){_0x8af6c0[_0x6d88('0x30')]=qs[_0x6d88('0x30')](_0x373bcf[_0x6d88('0x46')][_0x6d88('0x30')]);_0x8af6c0[_0x6d88('0x2e')]=qs[_0x6d88('0x2e')](_0x373bcf[_0x6d88('0x46')][_0x6d88('0x2e')]);}return _0x17afa9[_0x6d88('0xe6')](_0x8af6c0);}})[_0x6d88('0x20')](function(_0x3ae614){if(_0x3ae614){return _0x3ae614?{'count':_0x4fd032,'rows':_0x3ae614}:null;}})['then'](respondWithResult(_0x52f3de,null))['catch'](handleError(_0x52f3de,null));}; \ No newline at end of file +var _0xcfcb=['bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','redif','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','count','set','reject','save','update','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','options','SmsAccount','includeAll','include','rows','catch','show','params','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','describe','addDisposition','SmsAccountId','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','order','removeAnswers','sms','Applications','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','From','Body','messageId','MessageSid','sender','text','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','Contacts','DESC','list','SmsInteraction','interaction','created','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','startRouting','Start','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','SmsApplication'];(function(_0x8f3d3,_0x5bec91){var _0xaf125d=function(_0x119c4e){while(--_0x119c4e){_0x8f3d3['push'](_0x8f3d3['shift']());}};_0xaf125d(++_0x5bec91);}(_0xcfcb,0x110));var _0xbcfc=function(_0x3359b0,_0x13700a){_0x3359b0=_0x3359b0-0x0;var _0x2e823b=_0xcfcb[_0x3359b0];return _0x2e823b;};'use strict';var emlformat=require(_0xbcfc('0x0'));var rimraf=require(_0xbcfc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbcfc('0x2'));var moment=require(_0xbcfc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcfc('0x4'));var path=require(_0xbcfc('0x5'));var sox=require('sox');var csv=require(_0xbcfc('0x6'));var ejs=require(_0xbcfc('0x7'));var fs=require('fs');var fs_extra=require(_0xbcfc('0x8'));var _=require(_0xbcfc('0x9'));var squel=require(_0xbcfc('0xa'));var crypto=require(_0xbcfc('0xb'));var jsforce=require(_0xbcfc('0xc'));var deskjs=require(_0xbcfc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbcfc('0xe'));var Papa=require(_0xbcfc('0xf'));var Redis=require(_0xbcfc('0x10'));var authService=require(_0xbcfc('0x11'));var qs=require(_0xbcfc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcfc('0x13'));var logger=require(_0xbcfc('0x14'))(_0xbcfc('0x15'));var utils=require(_0xbcfc('0x16'));var config=require(_0xbcfc('0x17'));var licenseUtil=require(_0xbcfc('0x18'));var db=require(_0xbcfc('0x19'))['db'];config['redis']=_[_0xbcfc('0x1a')](config[_0xbcfc('0x1b')],{'host':_0xbcfc('0x1c'),'port':0x18eb});var socket=require(_0xbcfc('0x1d'))(new Redis(config[_0xbcfc('0x1b')]));require(_0xbcfc('0x1e'))[_0xbcfc('0x1f')](socket);var jayson=require(_0xbcfc('0x20'));var client=jayson[_0xbcfc('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x12a527,_0x33a99e,_0x3ec725,_0x1baef7){return new BPromise(function(_0x764c80,_0x136e72){var _0x5d2998=_0x1baef7||client;return _0x5d2998['request'](_0x12a527,_0x3ec725)[_0xbcfc('0x22')](function(_0xd89294){logger[_0xbcfc('0x23')](_0xbcfc('0x24'),_0x33a99e,_0xbcfc('0x25'));logger['debug'](_0xbcfc('0x26'),_0x33a99e,_0xbcfc('0x25'),JSON[_0xbcfc('0x27')](_0xd89294));if(_0xd89294[_0xbcfc('0x28')]){if(_0xd89294[_0xbcfc('0x28')][_0xbcfc('0x29')]===0x1f4){logger[_0xbcfc('0x28')]('SmsAccount,\x20%s,\x20%s',_0x33a99e,_0xd89294[_0xbcfc('0x28')][_0xbcfc('0x2a')]);return _0x136e72(_0xd89294[_0xbcfc('0x28')]['message']);}logger[_0xbcfc('0x28')]('SmsAccount,\x20%s,\x20%s',_0x33a99e,_0xd89294[_0xbcfc('0x28')][_0xbcfc('0x2a')]);return _0x764c80(_0xd89294[_0xbcfc('0x28')][_0xbcfc('0x2a')]);}else{logger[_0xbcfc('0x23')](_0xbcfc('0x24'),_0x33a99e,_0xbcfc('0x25'));_0x764c80(_0xd89294[_0xbcfc('0x2b')][_0xbcfc('0x2a')]);}})['catch'](function(_0x2dccfc){logger[_0xbcfc('0x28')](_0xbcfc('0x24'),_0x33a99e,_0x2dccfc);_0x136e72(_0x2dccfc);});});}function respondWithStatusCode(_0x28997e,_0x553c5d){_0x553c5d=_0x553c5d||0xcc;return function(_0x122d61){if(_0x122d61){return _0x28997e[_0xbcfc('0x2c')](_0x553c5d);}return _0x28997e[_0xbcfc('0x2d')](_0x553c5d)[_0xbcfc('0x2e')]();};}function respondWithResult(_0x416856,_0x9b12d6){_0x9b12d6=_0x9b12d6||0xc8;return function(_0x50f6bd){if(_0x50f6bd){return _0x416856[_0xbcfc('0x2d')](_0x9b12d6)[_0xbcfc('0x2f')](_0x50f6bd);}};}function respondWithFilteredResult(_0x426437,_0x1ff15d){return function(_0x161dff){if(_0x161dff){var _0x5e0e4d=typeof _0x1ff15d[_0xbcfc('0x30')]==='undefined'&&typeof _0x1ff15d[_0xbcfc('0x31')]==='undefined';var _0x5bb415=_0x161dff[_0xbcfc('0x32')];var _0xe9e660=_0x5e0e4d?0x0:_0x1ff15d['offset'];var _0x5835aa=_0x5e0e4d?_0x161dff[_0xbcfc('0x32')]:_0x1ff15d[_0xbcfc('0x30')]+_0x1ff15d['limit'];var _0x34f3a6;if(_0x5835aa>=_0x5bb415){_0x5835aa=_0x5bb415;_0x34f3a6=0xc8;}else{_0x34f3a6=0xce;}_0x426437[_0xbcfc('0x2d')](_0x34f3a6);return _0x426437[_0xbcfc('0x33')]('Content-Range',_0xe9e660+'-'+_0x5835aa+'/'+_0x5bb415)['json'](_0x161dff);}return null;};}function patchUpdates(_0x56f76e){return function(_0x287300){try{jsonpatch['apply'](_0x287300,_0x56f76e,!![]);}catch(_0x2729eb){return BPromise[_0xbcfc('0x34')](_0x2729eb);}return _0x287300[_0xbcfc('0x35')]();};}function saveUpdates(_0x5711b0,_0x38aa27){return function(_0x237dd6){if(_0x237dd6){return _0x237dd6[_0xbcfc('0x36')](_0x5711b0)['then'](function(_0x1bc7a4){return _0x1bc7a4;});}return null;};}function removeEntity(_0x2f142d,_0x292260){return function(_0x988cd0){if(_0x988cd0){return _0x988cd0[_0xbcfc('0x37')]()[_0xbcfc('0x22')](function(){var _0x4fed25=_0x988cd0[_0xbcfc('0x38')]({'plain':!![]});var _0x5acb7c=_0xbcfc('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x5acb7c,'resourceId':_0x4fed25['id']}})[_0xbcfc('0x22')](function(){return _0x988cd0;});})[_0xbcfc('0x22')](function(){_0x2f142d[_0xbcfc('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbd54ee,_0x3018f6){return function(_0xf4d476){if(!_0xf4d476){_0xbd54ee['sendStatus'](0x194);}return _0xf4d476;};}function handleError(_0x480aa4,_0x131fd5){_0x131fd5=_0x131fd5||0x1f4;return function(_0x11dacd){logger[_0xbcfc('0x28')](_0x11dacd[_0xbcfc('0x3a')]);if(_0x11dacd['name']){delete _0x11dacd[_0xbcfc('0x3b')];}_0x480aa4[_0xbcfc('0x2d')](_0x131fd5)[_0xbcfc('0x3c')](_0x11dacd);};}exports[_0xbcfc('0x3d')]=function(_0x87aae7,_0x49a881){var _0x588eac={'include':[{'model':db[_0xbcfc('0x3e')],'as':_0xbcfc('0x3f')}]},_0x3db2f6={},_0x321f44={'count':0x0,'rows':[]};var _0x118765=_['map'](db['SmsAccount'][_0xbcfc('0x40')],function(_0x11418b){return{'name':_0x11418b[_0xbcfc('0x41')],'type':_0x11418b[_0xbcfc('0x42')][_0xbcfc('0x43')]};});_0x3db2f6[_0xbcfc('0x44')]=_['map'](_0x118765,_0xbcfc('0x3b'));_0x3db2f6['query']=_[_0xbcfc('0x45')](_0x87aae7[_0xbcfc('0x46')]);_0x3db2f6[_0xbcfc('0x47')]=_['intersection'](_0x3db2f6['model'],_0x3db2f6[_0xbcfc('0x46')]);_0x588eac[_0xbcfc('0x48')]=_[_0xbcfc('0x49')](_0x3db2f6[_0xbcfc('0x44')],qs['fields'](_0x87aae7[_0xbcfc('0x46')][_0xbcfc('0x4a')]));_0x588eac[_0xbcfc('0x48')]=_0x588eac['attributes'][_0xbcfc('0x4b')]?_0x588eac[_0xbcfc('0x48')]:_0x3db2f6['model'];if(!_0x87aae7['query'][_0xbcfc('0x4c')](_0xbcfc('0x4d'))){_0x588eac[_0xbcfc('0x31')]=qs['limit'](_0x87aae7[_0xbcfc('0x46')]['limit']);_0x588eac[_0xbcfc('0x30')]=qs[_0xbcfc('0x30')](_0x87aae7[_0xbcfc('0x46')][_0xbcfc('0x30')]);}_0x588eac['order']=qs[_0xbcfc('0x4e')](_0x87aae7[_0xbcfc('0x46')][_0xbcfc('0x4e')]);_0x588eac[_0xbcfc('0x4f')]=qs[_0xbcfc('0x47')](_[_0xbcfc('0x50')](_0x87aae7[_0xbcfc('0x46')],_0x3db2f6['filters']),_0x118765);if(_0x87aae7[_0xbcfc('0x46')][_0xbcfc('0x51')]){_0x588eac[_0xbcfc('0x4f')]=_['merge'](_0x588eac[_0xbcfc('0x4f')],{'$or':_[_0xbcfc('0x52')](_0x118765,function(_0x351bb6){if(_0x351bb6[_0xbcfc('0x42')]!=='VIRTUAL'){var _0x19057c={};_0x19057c[_0x351bb6[_0xbcfc('0x3b')]]={'$like':'%'+_0x87aae7[_0xbcfc('0x46')][_0xbcfc('0x51')]+'%'};return _0x19057c;}})});}_0x588eac=_['merge']({},_0x588eac,_0x87aae7[_0xbcfc('0x53')]);var _0x382312={'where':_0x588eac[_0xbcfc('0x4f')]};return db[_0xbcfc('0x54')][_0xbcfc('0x32')](_0x382312)['then'](function(_0x58dbdc){_0x321f44['count']=_0x58dbdc;if(_0x87aae7[_0xbcfc('0x46')][_0xbcfc('0x55')]){_0x588eac[_0xbcfc('0x56')]=[{'all':!![]}];}return db[_0xbcfc('0x54')]['findAll'](_0x588eac);})[_0xbcfc('0x22')](function(_0x3d5ba3){_0x321f44[_0xbcfc('0x57')]=_0x3d5ba3;return _0x321f44;})[_0xbcfc('0x22')](respondWithFilteredResult(_0x49a881,_0x588eac))[_0xbcfc('0x58')](handleError(_0x49a881,null));};exports[_0xbcfc('0x59')]=function(_0x2d581e,_0x5d4141){var _0x1714b1={'raw':![],'where':{'id':_0x2d581e[_0xbcfc('0x5a')]['id']},'include':[{'model':db[_0xbcfc('0x3e')],'as':_0xbcfc('0x3f')}]},_0x39dd0e={};_0x39dd0e[_0xbcfc('0x44')]=_[_0xbcfc('0x45')](db['SmsAccount'][_0xbcfc('0x40')]);_0x39dd0e['query']=_['keys'](_0x2d581e[_0xbcfc('0x46')]);_0x39dd0e[_0xbcfc('0x47')]=_[_0xbcfc('0x49')](_0x39dd0e['model'],_0x39dd0e[_0xbcfc('0x46')]);_0x1714b1[_0xbcfc('0x48')]=_[_0xbcfc('0x49')](_0x39dd0e[_0xbcfc('0x44')],qs['fields'](_0x2d581e[_0xbcfc('0x46')]['fields']));_0x1714b1[_0xbcfc('0x48')]=_0x1714b1['attributes'][_0xbcfc('0x4b')]?_0x1714b1['attributes']:_0x39dd0e[_0xbcfc('0x44')];if(_0x2d581e[_0xbcfc('0x46')][_0xbcfc('0x55')]){_0x1714b1[_0xbcfc('0x56')]=[{'all':!![]}];}_0x1714b1=_[_0xbcfc('0x5b')]({},_0x1714b1,_0x2d581e[_0xbcfc('0x53')]);return db[_0xbcfc('0x54')][_0xbcfc('0x5c')](_0x1714b1)[_0xbcfc('0x22')](handleEntityNotFound(_0x5d4141,null))[_0xbcfc('0x22')](respondWithResult(_0x5d4141,null))['catch'](handleError(_0x5d4141,null));};exports[_0xbcfc('0x5d')]=function(_0x40f24a,_0x349e74){return db['SmsAccount'][_0xbcfc('0x5d')](_0x40f24a['body'],{})[_0xbcfc('0x22')](function(_0x2a3e4d){var _0x3fced4=_0x40f24a[_0xbcfc('0x5e')][_0xbcfc('0x38')]({'plain':!![]});if(!_0x3fced4)throw new Error(_0xbcfc('0x5f'));if(_0x3fced4[_0xbcfc('0x60')]==='user'){var _0x14c25d=_0x2a3e4d[_0xbcfc('0x38')]({'plain':!![]});var _0x47f754='SmsAccounts';return db[_0xbcfc('0x61')][_0xbcfc('0x5c')]({'where':{'name':_0x47f754,'userProfileId':_0x3fced4[_0xbcfc('0x62')]},'raw':!![]})[_0xbcfc('0x22')](function(_0x43de91){if(_0x43de91&&_0x43de91['autoAssociation']===0x0){return db['UserProfileResource'][_0xbcfc('0x5d')]({'name':_0x14c25d[_0xbcfc('0x3b')],'resourceId':_0x14c25d['id'],'type':_0x43de91['name'],'sectionId':_0x43de91['id']},{})['then'](function(){return _0x2a3e4d;});}else{return _0x2a3e4d;}})[_0xbcfc('0x58')](function(_0x5a36c1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a36c1);throw _0x5a36c1;});}return _0x2a3e4d;})[_0xbcfc('0x22')](respondWithResult(_0x349e74,0xc9))['catch'](handleError(_0x349e74,null));};exports['update']=function(_0x458a60,_0x5c7372){if(_0x458a60[_0xbcfc('0x63')]['id']){delete _0x458a60[_0xbcfc('0x63')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x458a60[_0xbcfc('0x5a')]['id']},'include':[{'model':db[_0xbcfc('0x3e')],'as':_0xbcfc('0x3f')}]})[_0xbcfc('0x22')](handleEntityNotFound(_0x5c7372,null))[_0xbcfc('0x22')](saveUpdates(_0x458a60['body'],null))['then'](respondWithResult(_0x5c7372,null))['catch'](handleError(_0x5c7372,null));};exports['destroy']=function(_0x987a09,_0x3443db){return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x987a09[_0xbcfc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3443db,null))[_0xbcfc('0x22')](removeEntity(_0x3443db,null))[_0xbcfc('0x58')](handleError(_0x3443db,null));};exports['describe']=function(_0x4a68f6,_0x52df69){return db[_0xbcfc('0x54')][_0xbcfc('0x64')]()[_0xbcfc('0x22')](respondWithResult(_0x52df69,null))[_0xbcfc('0x58')](handleError(_0x52df69,null));};exports[_0xbcfc('0x65')]=function(_0x461ac1,_0x1dfab1,_0x453496){if(_0x461ac1[_0xbcfc('0x63')]['id']){delete _0x461ac1[_0xbcfc('0x63')]['id'];}return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x461ac1[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x1dfab1,null))[_0xbcfc('0x22')](function(_0x5c463a){if(_0x5c463a){_0x461ac1[_0xbcfc('0x63')][_0xbcfc('0x66')]=_0x5c463a['id'];return db['Disposition'][_0xbcfc('0x5d')](_0x461ac1['body']);}})[_0xbcfc('0x22')](respondWithResult(_0x1dfab1,null))['catch'](handleError(_0x1dfab1,null));};exports['getDispositions']=function(_0x534ed9,_0x403089,_0x53cba2){var _0x2933b2={'raw':![],'where':{}};var _0x2d7c9d={};var _0x36acc2={'count':0x0,'rows':[]};return db[_0xbcfc('0x54')]['findOne']({'where':{'id':_0x534ed9[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x403089,null))[_0xbcfc('0x22')](function(_0x1e1a63){if(_0x1e1a63){_0x2d7c9d[_0xbcfc('0x44')]=_['keys'](db[_0xbcfc('0x67')]['rawAttributes']);_0x2d7c9d[_0xbcfc('0x46')]=_[_0xbcfc('0x45')](_0x534ed9[_0xbcfc('0x46')]);_0x2d7c9d[_0xbcfc('0x47')]=_['intersection'](_0x2d7c9d[_0xbcfc('0x44')],_0x2d7c9d[_0xbcfc('0x46')]);_0x2933b2['attributes']=_[_0xbcfc('0x49')](_0x2d7c9d['model'],qs[_0xbcfc('0x4a')](_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x4a')]));_0x2933b2[_0xbcfc('0x48')]=_0x2933b2[_0xbcfc('0x48')][_0xbcfc('0x4b')]?_0x2933b2[_0xbcfc('0x48')]:_0x2d7c9d['model'];if(!_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x4c')](_0xbcfc('0x4d'))){_0x2933b2[_0xbcfc('0x31')]=qs[_0xbcfc('0x31')](_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x31')]);_0x2933b2[_0xbcfc('0x30')]=qs[_0xbcfc('0x30')](_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x30')]);}_0x2933b2['order']=qs[_0xbcfc('0x4e')](_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x4e')]);_0x2933b2[_0xbcfc('0x4f')]=qs[_0xbcfc('0x47')](_[_0xbcfc('0x50')](_0x534ed9[_0xbcfc('0x46')],_0x2d7c9d[_0xbcfc('0x47')]));_0x2933b2[_0xbcfc('0x4f')][_0xbcfc('0x66')]=_0x1e1a63['id'];if(_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x51')]){_0x2933b2[_0xbcfc('0x4f')]=_['merge'](_0x2933b2[_0xbcfc('0x4f')],{'$or':_[_0xbcfc('0x52')](_0x2933b2['attributes'],function(_0x5d8b16){var _0x40a2e3={};_0x40a2e3[_0x5d8b16]={'$like':'%'+_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x51')]+'%'};return _0x40a2e3;})});}_0x2933b2=_['merge']({},_0x2933b2,_0x534ed9['options']);return db['Disposition']['count']({'where':_0x2933b2['where']})['then'](function(_0x41fec4){_0x36acc2['count']=_0x41fec4;if(_0x534ed9[_0xbcfc('0x46')][_0xbcfc('0x55')]){_0x2933b2[_0xbcfc('0x56')]=[{'all':!![]}];}return db[_0xbcfc('0x67')][_0xbcfc('0x68')](_0x2933b2);})[_0xbcfc('0x22')](function(_0x196cba){_0x36acc2[_0xbcfc('0x57')]=_0x196cba;return _0x36acc2;});}})[_0xbcfc('0x22')](respondWithFilteredResult(_0x403089,_0x2933b2))['catch'](handleError(_0x403089,null));};exports['removeDispositions']=function(_0x348977,_0x3aedb5,_0x2d54c0){return db['SmsAccount']['find']({'where':{'id':_0x348977['params']['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x3aedb5,null))[_0xbcfc('0x22')](function(_0x5aac03){if(_0x5aac03){return _0x5aac03[_0xbcfc('0x69')](_0x348977[_0xbcfc('0x46')][_0xbcfc('0x6a')]);}})[_0xbcfc('0x22')](respondWithStatusCode(_0x3aedb5,null))['catch'](handleError(_0x3aedb5,null));};exports[_0xbcfc('0x6b')]=function(_0x2c9904,_0x1d6a02,_0x5d0ed2){if(_0x2c9904[_0xbcfc('0x63')]['id']){delete _0x2c9904[_0xbcfc('0x63')]['id'];}return db['SmsAccount'][_0xbcfc('0x5c')]({'where':{'id':_0x2c9904[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x1d6a02,null))[_0xbcfc('0x22')](function(_0x2e2cb1){if(_0x2e2cb1){_0x2c9904[_0xbcfc('0x63')][_0xbcfc('0x66')]=_0x2e2cb1['id'];return db[_0xbcfc('0x6c')][_0xbcfc('0x5d')](_0x2c9904[_0xbcfc('0x63')]);}})[_0xbcfc('0x22')](respondWithResult(_0x1d6a02,null))[_0xbcfc('0x58')](handleError(_0x1d6a02,null));};exports[_0xbcfc('0x6d')]=function(_0x3e15e6,_0x48691d,_0x5267f9){var _0x319d45={'raw':![],'where':{}};var _0x24c0a7={};var _0x59fbc7={'count':0x0,'rows':[]};return db[_0xbcfc('0x54')][_0xbcfc('0x6e')]({'where':{'id':_0x3e15e6[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x48691d,null))['then'](function(_0xca2761){if(_0xca2761){_0x24c0a7[_0xbcfc('0x44')]=_['keys'](db['CannedAnswer'][_0xbcfc('0x40')]);_0x24c0a7[_0xbcfc('0x46')]=_[_0xbcfc('0x45')](_0x3e15e6[_0xbcfc('0x46')]);_0x24c0a7[_0xbcfc('0x47')]=_[_0xbcfc('0x49')](_0x24c0a7[_0xbcfc('0x44')],_0x24c0a7[_0xbcfc('0x46')]);_0x319d45[_0xbcfc('0x48')]=_['intersection'](_0x24c0a7['model'],qs[_0xbcfc('0x4a')](_0x3e15e6[_0xbcfc('0x46')][_0xbcfc('0x4a')]));_0x319d45[_0xbcfc('0x48')]=_0x319d45['attributes']['length']?_0x319d45[_0xbcfc('0x48')]:_0x24c0a7[_0xbcfc('0x44')];if(!_0x3e15e6[_0xbcfc('0x46')][_0xbcfc('0x4c')]('nolimit')){_0x319d45['limit']=qs[_0xbcfc('0x31')](_0x3e15e6['query']['limit']);_0x319d45[_0xbcfc('0x30')]=qs[_0xbcfc('0x30')](_0x3e15e6['query'][_0xbcfc('0x30')]);}_0x319d45[_0xbcfc('0x6f')]=qs[_0xbcfc('0x4e')](_0x3e15e6[_0xbcfc('0x46')][_0xbcfc('0x4e')]);_0x319d45[_0xbcfc('0x4f')]=qs[_0xbcfc('0x47')](_['pick'](_0x3e15e6['query'],_0x24c0a7[_0xbcfc('0x47')]));_0x319d45[_0xbcfc('0x4f')]['SmsAccountId']=_0xca2761['id'];if(_0x3e15e6[_0xbcfc('0x46')][_0xbcfc('0x51')]){_0x319d45['where']=_[_0xbcfc('0x5b')](_0x319d45['where'],{'$or':_[_0xbcfc('0x52')](_0x319d45[_0xbcfc('0x48')],function(_0x20926b){var _0x2e2957={};_0x2e2957[_0x20926b]={'$like':'%'+_0x3e15e6['query']['filter']+'%'};return _0x2e2957;})});}_0x319d45=_['merge']({},_0x319d45,_0x3e15e6[_0xbcfc('0x53')]);return db[_0xbcfc('0x6c')][_0xbcfc('0x32')]({'where':_0x319d45[_0xbcfc('0x4f')]})[_0xbcfc('0x22')](function(_0x38c9cc){_0x59fbc7[_0xbcfc('0x32')]=_0x38c9cc;if(_0x3e15e6[_0xbcfc('0x46')][_0xbcfc('0x55')]){_0x319d45[_0xbcfc('0x56')]=[{'all':!![]}];}return db[_0xbcfc('0x6c')][_0xbcfc('0x68')](_0x319d45);})['then'](function(_0x2c671d){_0x59fbc7[_0xbcfc('0x57')]=_0x2c671d;return _0x59fbc7;});}})[_0xbcfc('0x22')](respondWithFilteredResult(_0x48691d,_0x319d45))['catch'](handleError(_0x48691d,null));};exports[_0xbcfc('0x70')]=function(_0x11ea6a,_0x3c150c,_0x34b4e5){return db['SmsAccount'][_0xbcfc('0x5c')]({'where':{'id':_0x11ea6a[_0xbcfc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c150c,null))[_0xbcfc('0x22')](function(_0x32b50f){if(_0x32b50f){return _0x32b50f[_0xbcfc('0x70')](_0x11ea6a[_0xbcfc('0x46')][_0xbcfc('0x6a')]);}})[_0xbcfc('0x22')](respondWithStatusCode(_0x3c150c,null))[_0xbcfc('0x58')](handleError(_0x3c150c,null));};exports['notify']=function(_0x984280,_0x346745,_0x2aee85){var _0x13a020={'channel':_0xbcfc('0x71')};var _0x21a599=[];var _0x2e0050=[];var _0x23656e={};return db['SmsAccount'][_0xbcfc('0x5c')]({'where':{'id':_0x984280[_0xbcfc('0x5a')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xbcfc('0x72')}]})[_0xbcfc('0x22')](handleEntityNotFound(_0x346745,null))[_0xbcfc('0x22')](function(_0x4d2ea7){_0x13a020[_0xbcfc('0x73')]=_0x4d2ea7;_0x13a020['applications']=_['orderBy'](_0x4d2ea7[_0xbcfc('0x72')],['priority'],['asc']);if(_0x13a020[_0xbcfc('0x73')][_0xbcfc('0x72')]){delete _0x13a020['account'][_0xbcfc('0x72')];}return db['CmContact'][_0xbcfc('0x64')]();})['then'](function(_0x161a22){if(!_0x161a22){throw new db[(_0xbcfc('0x74'))][(_0xbcfc('0x75'))](_0xbcfc('0x76'));}_0x21a599=_[_0xbcfc('0x77')](_[_0xbcfc('0x45')](_0x161a22),[_0xbcfc('0x78'),_0xbcfc('0x79')]);_0x2e0050=_[_0xbcfc('0x77')](_[_0xbcfc('0x45')](_0x161a22),[_0xbcfc('0x78'),_0xbcfc('0x79'),_0xbcfc('0x7a'),'ListId']);_0x13a020[_0xbcfc('0x63')]={'mapKey':'mobile'};if(_0x13a020[_0xbcfc('0x73')][_0xbcfc('0x42')]){switch(_0x13a020[_0xbcfc('0x73')]['type']){case _0xbcfc('0x7b'):_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x7d')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')]=_0x984280['body'][_0xbcfc('0x7e')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7f')]=_0x984280['body'][_0xbcfc('0x80')];break;case'skebby':_0x13a020['body'][_0xbcfc('0x7c')]='+'+_0x984280[_0xbcfc('0x63')][_0xbcfc('0x81')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x82')];break;case'connectel':_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]=_0x984280['body'][_0xbcfc('0x7c')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')]=_0x984280['body']['message'];break;case _0xbcfc('0x83'):_0x13a020['body']['from']=_0x984280['body'][_0xbcfc('0x7c')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x63')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7f')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x84')];break;case'plivo':_0x13a020['body'][_0xbcfc('0x7c')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x7d')];_0x13a020[_0xbcfc('0x63')]['body']=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x85')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7f')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x86')];break;case _0xbcfc('0x87'):_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]='+'+_0x984280[_0xbcfc('0x63')][_0xbcfc('0x88')][0x0][_0xbcfc('0x7c')];_0x13a020['body'][_0xbcfc('0x63')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x88')][0x0]['text'];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7f')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x88')][0x0]['messageId'];break;case _0xbcfc('0x89'):_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]=_0x984280['body'][_0xbcfc('0x8a')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x8b')][_0xbcfc('0x2a')];break;case'clickatell':_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x8c')];_0x13a020['body'][_0xbcfc('0x63')]=_0x984280['body'][_0xbcfc('0x82')];_0x13a020['body']['messageId']=_0x984280['body'][_0xbcfc('0x8d')];break;case _0xbcfc('0x8e'):_0x13a020['body'][_0xbcfc('0x7f')]=_0x984280[_0xbcfc('0x63')][0x0][_0xbcfc('0x2a')]['id'];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]=_0x984280[_0xbcfc('0x63')][0x0][_0xbcfc('0x2a')][_0xbcfc('0x7c')];_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')]=_0x984280[_0xbcfc('0x63')][0x0]['message'][_0xbcfc('0x82')];break;case _0xbcfc('0x8f'):_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')]=_0x984280['body'][_0xbcfc('0x7c')];_0x13a020[_0xbcfc('0x63')]['body']=_0x984280[_0xbcfc('0x63')][_0xbcfc('0x2a')];_0x13a020['body']['messageId']=_0x984280[_0xbcfc('0x63')]['refid'];break;}}if(_0x13a020[_0xbcfc('0x63')]['id']){delete _0x13a020['body']['id'];}if(_[_0xbcfc('0x90')](_0x13a020[_0xbcfc('0x63')]['from'])){throw new db[(_0xbcfc('0x74'))]['ValidationError'](_0xbcfc('0x91'));}if(_[_0xbcfc('0x90')](_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')])||_0x13a020[_0xbcfc('0x63')]['body']===''){throw new db[(_0xbcfc('0x74'))][(_0xbcfc('0x75'))](_0xbcfc('0x92'));}if(_[_0xbcfc('0x90')](_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x93')])){throw new db[(_0xbcfc('0x74'))]['ValidationError'](_0xbcfc('0x94')+_0x2e0050);}if(!_['includes'](_0x2e0050,_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x93')])){throw new db[(_0xbcfc('0x74'))][(_0xbcfc('0x75'))](_0xbcfc('0x95')+_0x2e0050);}_0x23656e[_0x13a020['body'][_0xbcfc('0x93')]]=_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')];return db[_0xbcfc('0x96')][_0xbcfc('0x5c')]({'where':{'id':_0x13a020[_0xbcfc('0x73')][_0xbcfc('0x97')]},'include':[{'model':db[_0xbcfc('0x98')],'as':_0xbcfc('0x99'),'where':_0x23656e,'limit':0x1,'order':[[_0xbcfc('0x79'),_0xbcfc('0x9a')]]}]});})[_0xbcfc('0x22')](handleEntityNotFound(_0x346745,null))[_0xbcfc('0x22')](function(_0x48ab0b){if(_0x48ab0b){_0x13a020[_0xbcfc('0x9b')]=_['omit'](_0x48ab0b,[_0xbcfc('0x99')]);if(_0x48ab0b[_0xbcfc('0x99')][_0xbcfc('0x4b')]){return _0x48ab0b['Contacts'][0x0];}var _0x364593=_[_0xbcfc('0x1a')](_0x13a020[_0xbcfc('0x63')],{'firstName':_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')],'ListId':_0x48ab0b['id']});_0x364593[_0x13a020[_0xbcfc('0x63')]['mapKey']]=_0x13a020[_0xbcfc('0x63')]['from'];return db[_0xbcfc('0x98')][_0xbcfc('0x5d')](_0x364593,{'fields':_0x21a599,'raw':!![]});}})[_0xbcfc('0x22')](handleEntityNotFound(_0x346745,null))['then'](function(_0x519a8d){if(_0x519a8d){_0x13a020['contact']=_0x519a8d;var _0x2295c3={'ContactId':_0x519a8d['id'],'phone':_0x13a020['body'][_0xbcfc('0x7c')],'SmsAccountId':_0x984280[_0xbcfc('0x5a')]['id']};var _0x1f6d2d={'ContactId':_0x519a8d['id'],'SmsAccountId':_0x984280[_0xbcfc('0x5a')]['id'],'closed':![]};return db[_0xbcfc('0x9c')][_0xbcfc('0x5c')]({'where':_0x1f6d2d})[_0xbcfc('0x22')](function(_0x29dad2){if(_0x29dad2){return[_0x29dad2,![]];}return db['SmsInteraction']['create'](_0x2295c3)[_0xbcfc('0x22')](function(_0x57b0e1){return[_0x57b0e1,!![]];});});}})['spread'](function(_0x5eec8d,_0x4af047){_0x13a020['interaction']=_0x5eec8d[_0xbcfc('0x38')]({'plain':!![]});_0x13a020[_0xbcfc('0x9d')][_0xbcfc('0x9e')]=![];if(_0x4af047){if(_0x13a020[_0xbcfc('0x73')]['autoclose']){_0x13a020[_0xbcfc('0x9f')][_0xbcfc('0xa0')]({'id':0x0,'priority':_0x13a020[_0xbcfc('0x9f')][_0xbcfc('0x4b')]+0x1,'app':_0xbcfc('0xa1'),'appdata':_0xbcfc('0xa2'),'interval':_0xbcfc('0xa3')});}_0x13a020[_0xbcfc('0x9d')][_0xbcfc('0x9e')]=!![];}return db[_0xbcfc('0xa4')][_0xbcfc('0x5d')]({'phone':_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x7c')],'messageId':_0x13a020['body'][_0xbcfc('0x7f')],'body':_0x13a020[_0xbcfc('0x63')][_0xbcfc('0x63')],'SmsAccountId':_0x984280['params']['id'],'SmsInteractionId':_0x5eec8d['id'],'direction':'in','ContactId':_0x5eec8d[_0xbcfc('0xa5')],'AttachmentId':_0x13a020[_0xbcfc('0x63')][_0xbcfc('0xa6')]});})[_0xbcfc('0x22')](function(_0x3f72cc){_0x13a020[_0xbcfc('0x2a')]=_0x3f72cc;if(_0x13a020[_0xbcfc('0x9d')][_0xbcfc('0xa7')]){return db[_0xbcfc('0xa8')][_0xbcfc('0x5c')]({'attributes':['id','name'],'where':{'id':_0x13a020['interaction'][_0xbcfc('0xa7')]}})[_0xbcfc('0x22')](function(_0xf66b30){if(_0xf66b30){_0x13a020[_0xbcfc('0x9f')][_0xbcfc('0xa9')]({'id':0x0,'priority':0x0,'app':_0xbcfc('0xaa'),'appdata':_0xf66b30[_0xbcfc('0x3b')]+','+(_0x13a020[_0xbcfc('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0xbcfc('0xa3')});}return respondWithRpcPromise('Start',_0xbcfc('0xab'),_0x13a020);});}return respondWithRpcPromise(_0xbcfc('0xac'),'startRouting',_0x13a020);})['then'](function(_0x1f0291){if(_0x1f0291){var _0x1defdd=0xc8;var _0x25f977=_0xbcfc('0xad');logger[_0xbcfc('0x23')](_0xbcfc('0x26'),_0x25f977,_0x1defdd,_0xbcfc('0xae'));logger[_0xbcfc('0xaf')](_0xbcfc('0xb0'),_0x25f977,_0x1defdd,'entity\x20found',JSON[_0xbcfc('0x27')](_0x1f0291));if(_0x13a020[_0xbcfc('0x73')]['type']===_0xbcfc('0x7b')){return _0x346745[_0xbcfc('0x2d')](_0x1defdd)[_0xbcfc('0x33')](_0xbcfc('0xb1'),_0xbcfc('0xb2'))[_0xbcfc('0x3c')](_0xbcfc('0xb3'));}else{return _0x346745[_0xbcfc('0x2d')](_0x1defdd)[_0xbcfc('0x2f')](_0x1f0291);}}})[_0xbcfc('0x58')](handleError(_0x346745,null));};exports[_0xbcfc('0xb4')]=function(_0x55b971,_0x10b76c,_0x4bf1b9){return db[_0xbcfc('0x54')][_0xbcfc('0x6e')]({'where':{'id':_0x55b971[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x10b76c,null))[_0xbcfc('0x22')](function(_0x52fb6c){if(_0x52fb6c){return db['sequelize']['transaction'](function(_0x4a2c83){return db[_0xbcfc('0xb5')][_0xbcfc('0x37')]({'where':{'SmsAccountId':_0x55b971[_0xbcfc('0x5a')]['id']},'transaction':_0x4a2c83})[_0xbcfc('0x22')](function(_0xf372d6){var _0x5557c2=_[_0xbcfc('0x52')](_0x55b971[_0xbcfc('0x63')],function(_0x43b4bd){_0x43b4bd[_0xbcfc('0x66')]=_0x55b971[_0xbcfc('0x5a')]['id'];return _0x43b4bd;});return db[_0xbcfc('0xb5')][_0xbcfc('0xb6')](_0x5557c2,{'transaction':_0x4a2c83});});})[_0xbcfc('0x22')](function(){return db['SmsApplication'][_0xbcfc('0xb7')]({'where':{'SmsAccountId':_0x55b971[_0xbcfc('0x5a')]['id']},'order':_0xbcfc('0xb8')});});}})[_0xbcfc('0x22')](respondWithResult(_0x10b76c,null))[_0xbcfc('0x58')](handleError(_0x10b76c,null));};exports['getApplications']=function(_0x5243c9,_0x59fec8,_0x4d4668){var _0x5a7cc9={};var _0x55d0be={};var _0x1d6ddd;var _0x3013d4;return db['SmsAccount'][_0xbcfc('0x6e')]({'where':{'id':_0x5243c9[_0xbcfc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x59fec8,null))['then'](function(_0x656e42){if(_0x656e42){_0x1d6ddd=_0x656e42;_0x55d0be[_0xbcfc('0x44')]=_[_0xbcfc('0x45')](db[_0xbcfc('0xb5')][_0xbcfc('0x40')]);_0x55d0be[_0xbcfc('0x46')]=_[_0xbcfc('0x45')](_0x5243c9[_0xbcfc('0x46')]);_0x55d0be[_0xbcfc('0x47')]=_[_0xbcfc('0x49')](_0x55d0be['model'],_0x55d0be[_0xbcfc('0x46')]);_0x5a7cc9[_0xbcfc('0x48')]=_['intersection'](_0x55d0be[_0xbcfc('0x44')],qs['fields'](_0x5243c9[_0xbcfc('0x46')][_0xbcfc('0x4a')]));_0x5a7cc9[_0xbcfc('0x48')]=_0x5a7cc9[_0xbcfc('0x48')][_0xbcfc('0x4b')]?_0x5a7cc9['attributes']:_0x55d0be[_0xbcfc('0x44')];_0x5a7cc9[_0xbcfc('0x6f')]=qs[_0xbcfc('0x4e')](_0x5243c9[_0xbcfc('0x46')]['sort']);_0x5a7cc9['where']=qs[_0xbcfc('0x47')](_['pick'](_0x5243c9['query'],_0x55d0be[_0xbcfc('0x47')]));if(_0x5243c9[_0xbcfc('0x46')][_0xbcfc('0x51')]){_0x5a7cc9[_0xbcfc('0x4f')]=_[_0xbcfc('0x5b')](_0x5a7cc9[_0xbcfc('0x4f')],{'$or':_[_0xbcfc('0x52')](_0x5a7cc9[_0xbcfc('0x48')],function(_0x222abf){var _0x53a7e9={};_0x53a7e9[_0x222abf]={'$like':'%'+_0x5243c9[_0xbcfc('0x46')][_0xbcfc('0x51')]+'%'};return _0x53a7e9;})});}_0x5a7cc9=_['merge']({},_0x5a7cc9,_0x5243c9[_0xbcfc('0x53')]);return _0x1d6ddd[_0xbcfc('0xb9')](_0x5a7cc9);}})[_0xbcfc('0x22')](function(_0x2d346c){if(_0x2d346c){_0x3013d4=_0x2d346c['length'];if(!_0x5243c9[_0xbcfc('0x46')][_0xbcfc('0x4c')](_0xbcfc('0x4d'))){_0x5a7cc9[_0xbcfc('0x31')]=qs['limit'](_0x5243c9['query'][_0xbcfc('0x31')]);_0x5a7cc9[_0xbcfc('0x30')]=qs[_0xbcfc('0x30')](_0x5243c9[_0xbcfc('0x46')][_0xbcfc('0x30')]);}return _0x1d6ddd[_0xbcfc('0xb9')](_0x5a7cc9);}})[_0xbcfc('0x22')](function(_0x5bbc11){if(_0x5bbc11){return _0x5bbc11?{'count':_0x3013d4,'rows':_0x5bbc11}:null;}})[_0xbcfc('0x22')](respondWithResult(_0x59fec8,null))[_0xbcfc('0x58')](handleError(_0x59fec8,null));};exports[_0xbcfc('0xba')]=function(_0x263bad,_0x362ca0,_0x774090){var _0x353c5b={'raw':![],'where':{}};var _0x130105={};var _0x2b453d={'count':0x0,'rows':[]};return db[_0xbcfc('0x54')]['findOne']({'where':{'id':_0x263bad[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x362ca0,null))[_0xbcfc('0x22')](function(_0xd36c49){if(_0xd36c49){_0x130105['model']=_[_0xbcfc('0x45')](db[_0xbcfc('0x9c')][_0xbcfc('0x40')]);_0x130105[_0xbcfc('0x46')]=_[_0xbcfc('0x45')](_0x263bad[_0xbcfc('0x46')]);_0x130105['filters']=_[_0xbcfc('0x49')](_0x130105[_0xbcfc('0x44')],_0x130105[_0xbcfc('0x46')]);_0x353c5b[_0xbcfc('0x48')]=_[_0xbcfc('0x49')](_0x130105[_0xbcfc('0x44')],qs[_0xbcfc('0x4a')](_0x263bad['query'][_0xbcfc('0x4a')]));_0x353c5b[_0xbcfc('0x48')]=_0x353c5b['attributes'][_0xbcfc('0x4b')]?_0x353c5b[_0xbcfc('0x48')]:_0x130105['model'];if(!_0x263bad['query']['hasOwnProperty'](_0xbcfc('0x4d'))){_0x353c5b[_0xbcfc('0x31')]=qs['limit'](_0x263bad[_0xbcfc('0x46')][_0xbcfc('0x31')]);_0x353c5b[_0xbcfc('0x30')]=qs[_0xbcfc('0x30')](_0x263bad[_0xbcfc('0x46')][_0xbcfc('0x30')]);}_0x353c5b['order']=qs[_0xbcfc('0x4e')](_0x263bad[_0xbcfc('0x46')][_0xbcfc('0x4e')]);_0x353c5b[_0xbcfc('0x4f')]=qs[_0xbcfc('0x47')](_[_0xbcfc('0x50')](_0x263bad[_0xbcfc('0x46')],_0x130105[_0xbcfc('0x47')]));_0x353c5b[_0xbcfc('0x4f')][_0xbcfc('0x66')]=_0xd36c49['id'];if(_0x263bad[_0xbcfc('0x46')][_0xbcfc('0x51')]){_0x353c5b[_0xbcfc('0x4f')]=_[_0xbcfc('0x5b')](_0x353c5b[_0xbcfc('0x4f')],{'$or':_['map'](_0x353c5b[_0xbcfc('0x48')],function(_0xe96254){var _0x3ac67c={};_0x3ac67c[_0xe96254]={'$like':'%'+_0x263bad[_0xbcfc('0x46')][_0xbcfc('0x51')]+'%'};return _0x3ac67c;})});}_0x353c5b=_[_0xbcfc('0x5b')]({},_0x353c5b,_0x263bad[_0xbcfc('0x53')]);return db[_0xbcfc('0x9c')][_0xbcfc('0x32')]({'where':_0x353c5b[_0xbcfc('0x4f')]})['then'](function(_0x186ed4){_0x2b453d[_0xbcfc('0x32')]=_0x186ed4;if(_0x263bad[_0xbcfc('0x46')][_0xbcfc('0x55')]){_0x353c5b[_0xbcfc('0x56')]=[{'model':db['CmContact'],'as':_0xbcfc('0xbb'),'required':![]},{'model':db[_0xbcfc('0xa8')],'as':_0xbcfc('0xbc'),'attributes':[_0xbcfc('0x3b'),_0xbcfc('0xbd'),'internal'],'required':![]},{'model':db[_0xbcfc('0xbe')],'as':_0xbcfc('0xbf'),'attributes':['id',_0xbcfc('0x3b'),_0xbcfc('0xc0')],'where':_0x263bad['query'][_0xbcfc('0xc1')]?{'id':_0x263bad[_0xbcfc('0x46')]['tag']}:undefined,'required':_0x263bad[_0xbcfc('0x46')][_0xbcfc('0xc1')]?!![]:![]}];}return db[_0xbcfc('0x9c')][_0xbcfc('0x68')](_0x353c5b);})[_0xbcfc('0x22')](function(_0xdd428b){_0x2b453d[_0xbcfc('0x57')]=_0xdd428b;return _0x2b453d;});}})['then'](respondWithFilteredResult(_0x362ca0,_0x353c5b))['catch'](handleError(_0x362ca0,null));};exports['send']=function(_0x4f8449,_0x3bf810,_0x54b3f4){var _0x348c91,_0x4f0628,_0x101f4f;if(_[_0xbcfc('0x90')](_0x4f8449[_0xbcfc('0x63')][_0xbcfc('0x63')])||_0x4f8449['body']['body']===''){throw new db[(_0xbcfc('0x74'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbcfc('0x90')](_0x4f8449[_0xbcfc('0x63')]['to'])){throw new db[(_0xbcfc('0x74'))][(_0xbcfc('0x75'))](_0xbcfc('0xc2'));}_0x348c91=_0x4f8449[_0xbcfc('0x63')]['to'];return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x4f8449[_0xbcfc('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xbcfc('0x99'),'where':{'mobile':_0x348c91},'limit':0x1,'order':[[_0xbcfc('0x79'),_0xbcfc('0x9a')]]}]}]})[_0xbcfc('0x22')](handleEntityNotFound(_0x3bf810,null))[_0xbcfc('0x22')](function(_0x1c1f85){if(_0x1c1f85&&_0x1c1f85[_0xbcfc('0xc3')]){_0x4f0628=_0x1c1f85[_0xbcfc('0x38')]({'plain':!![]});if(_0x4f0628[_0xbcfc('0xc3')]&&_0x4f0628[_0xbcfc('0xc3')][_0xbcfc('0x99')]['length']){return _0x4f0628[_0xbcfc('0xc3')][_0xbcfc('0x99')][0x0];}return db[_0xbcfc('0x98')][_0xbcfc('0x5d')](_[_0xbcfc('0x1a')](_0x4f8449[_0xbcfc('0x63')],{'firstName':_0x348c91,'mobile':_0x348c91,'phone':_0x348c91,'ListId':_0x4f0628[_0xbcfc('0x97')]}));}})[_0xbcfc('0x22')](handleEntityNotFound(_0x3bf810,null))[_0xbcfc('0x22')](function(_0x2ab393){if(_0x2ab393){_0x101f4f=_0x2ab393;return db[_0xbcfc('0x9c')]['find']({'where':{'ContactId':_0x101f4f['id'],'closed':![],'SmsAccountId':_0x4f0628['id']}})[_0xbcfc('0x22')](function(_0x13a5c6){if(_0x13a5c6){return[_0x13a5c6,![]];}return db[_0xbcfc('0x9c')][_0xbcfc('0x5d')]({'UserId':_0x4f8449[_0xbcfc('0x5e')]['id'],'ContactId':_0x101f4f['id'],'SmsAccountId':_0x4f0628['id'],'phone':_0x348c91,'firstMsgDirection':'out','Messages':[_[_0xbcfc('0x5b')](_0x4f8449['body'],{'read':![],'body':_0x4f8449['body'][_0xbcfc('0x63')],'phone':_0x348c91,'SmsAccountId':_0x4f0628['id'],'UserId':_0x4f8449[_0xbcfc('0x5e')]['id'],'ContactId':_0x101f4f['id']})]},{'include':[{'model':db[_0xbcfc('0xa4')],'as':_0xbcfc('0xc4')}]})['then'](function(_0x31f533){return[_0x31f533,!![]];});});}})[_0xbcfc('0xc5')](function(_0x49ee07,_0x527216){if(_0x527216){return _0x49ee07;}return db[_0xbcfc('0xa4')]['create'](_[_0xbcfc('0x5b')](_0x4f8449[_0xbcfc('0x63')],{'read':![],'body':_0x4f8449['body'][_0xbcfc('0x63')],'phone':_0x348c91,'SmsAccountId':_0x4f0628['id'],'SmsInteractionId':_0x49ee07['id'],'UserId':_0x4f8449[_0xbcfc('0x5e')]['id'],'ContactId':_0x101f4f['id']}))[_0xbcfc('0x22')](function(_0x14a74e){_0x49ee07[_0xbcfc('0xc6')][_0xbcfc('0xc4')]=[];_0x49ee07[_0xbcfc('0xc6')][_0xbcfc('0xc4')][_0xbcfc('0xa0')](_0x14a74e[_0xbcfc('0xc6')]);return _0x49ee07;});})[_0xbcfc('0x22')](respondWithResult(_0x3bf810,null))['catch'](handleError(_0x3bf810,null));};exports[_0xbcfc('0x2d')]=function(_0x4e944b,_0x1b3e4b,_0x2d119d){if(_0x4e944b[_0xbcfc('0x63')]['id']){delete _0x4e944b[_0xbcfc('0x63')]['id'];}var _0x2127a3,_0x81691,_0xb51c65;return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x4e944b[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x1b3e4b,null))[_0xbcfc('0x22')](function(_0x37f800){if(_0x37f800){_0xb51c65=_0x37f800;logger['debug'](_0xbcfc('0x26'),'status',_0xbcfc('0xc7'),_0x37f800[_0xbcfc('0x42')],util[_0xbcfc('0xc8')](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));switch(_0x37f800['type']){case _0xbcfc('0xc9'):if(_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0xca')]&&_0x4e944b['body']['status']){_0x81691=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x2d')];return db[_0xbcfc('0xa4')][_0xbcfc('0x5c')]({'where':{'messageId':_0x4e944b['body'][_0xbcfc('0xca')]}});}break;case'connectel':if(_0x4e944b['body']['requestid']&&_0x4e944b[_0xbcfc('0x63')]['statusInt']){_0x81691=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0xcb')];return db[_0xbcfc('0xa4')][_0xbcfc('0x5c')]({'where':{'messageId':_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0xcc')]}});}break;case'clicksend':if(_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x84')]&&_0x4e944b['body'][_0xbcfc('0xcd')]){_0x81691=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0xcd')];return db['SmsMessage']['find']({'where':{'messageId':_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x84')]}});}break;case _0xbcfc('0x87'):var _0x3660b4=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x88')][0x0];if(_0x3660b4[_0xbcfc('0x7f')]&&_0x3660b4[_0xbcfc('0x2d')][_0xbcfc('0xce')]===_0xbcfc('0xcf')){_0x81691=_0x3660b4[_0xbcfc('0x2d')][_0xbcfc('0xce')];return db[_0xbcfc('0xa4')]['find']({'where':{'messageId':_0x3660b4[_0xbcfc('0x7f')]}});}break;case _0xbcfc('0xd0'):if(_0x4e944b[_0xbcfc('0x63')]['messageId']&&_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x2d')]){_0x81691=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x2d')];return db[_0xbcfc('0xa4')]['find']({'where':{'messageId':_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x7f')]}});}break;case _0xbcfc('0x8e'):if(_0x4e944b[_0xbcfc('0x63')][0x0][_0xbcfc('0x2a')]['id']){_0x81691=_0x4e944b['body'][0x0][_0xbcfc('0x42')];return db[_0xbcfc('0xa4')][_0xbcfc('0x5c')]({'where':{'messageId':_0x4e944b['body'][0x0][_0xbcfc('0x2a')]['id']}});}break;case'intelepeer':if(_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0xd1')]&&_0x4e944b[_0xbcfc('0x63')]['status']){_0x81691=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x2d')];return db['SmsMessage'][_0xbcfc('0x5c')]({'where':{'messageId':_0x4e944b[_0xbcfc('0x63')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x1b3e4b,null))[_0xbcfc('0x22')](function(_0x469c29){if(_0x469c29){_0x2127a3=_0x469c29;switch(_0xb51c65[_0xbcfc('0x42')]){case _0xbcfc('0xc9'):if(_0x81691==='DELIVERED'){return _0x2127a3[_0xbcfc('0x36')]({'read':!![]});}else{logger[_0xbcfc('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util[_0xbcfc('0xc8')](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbcfc('0xd2'):if(_0x81691==='1'){return _0x2127a3['update']({'read':!![]});}else{logger[_0xbcfc('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbcfc('0x2d'),_0xbcfc('0xc9'),util[_0xbcfc('0xc8')](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0xd3')]&&_0x81691>=0xc8&&_0x81691<=0xce){return _0x2127a3[_0xbcfc('0x36')]({'read':!![]});}else{logger[_0xbcfc('0x28')](_0xbcfc('0x26'),'status','clicksend',util[_0xbcfc('0xc8')](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbcfc('0x87'):var _0x3d10fd=_0x4e944b[_0xbcfc('0x63')][_0xbcfc('0x88')][0x0];if(_0x3d10fd[_0xbcfc('0x2d')][_0xbcfc('0xce')]===_0xbcfc('0xcf')){return _0x2127a3[_0xbcfc('0x36')]({'read':!![]});}else{logger[_0xbcfc('0x28')](_0xbcfc('0x26'),'status',_0xbcfc('0x87'),util['inspect'](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbcfc('0xd0'):if(_0x81691==_0xbcfc('0xd4')||_0x81691==_0xbcfc('0xd5')){return _0x2127a3['update']({'read':!![]});}else{logger[_0xbcfc('0x28')](_0xbcfc('0x26'),_0xbcfc('0x2d'),_0xbcfc('0xd0'),util[_0xbcfc('0xc8')](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbcfc('0x8e'):if(_0x81691==_0xbcfc('0xd6')){return _0x2127a3[_0xbcfc('0x36')]({'read':!![]});}else{logger[_0xbcfc('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','bandwidth',util[_0xbcfc('0xc8')](_0x4e944b[_0xbcfc('0x63')],{'showHidden':![],'depth':null}));}break;case _0xbcfc('0x8f'):if(_0x81691===_0xbcfc('0xd7')||_0x81691===_0xbcfc('0xd8')){return _0x2127a3[_0xbcfc('0x36')]({'read':!![]});}else{logger[_0xbcfc('0x28')](_0xbcfc('0x26'),_0xbcfc('0x2d'),_0xbcfc('0x8f'),util[_0xbcfc('0xc8')](_0x4e944b['body'],{'showHidden':![],'depth':null}));}break;}return _0x2127a3;}})['then'](respondWithResult(_0x1b3e4b,null))[_0xbcfc('0x58')](handleError(_0x1b3e4b,null));};exports[_0xbcfc('0xd9')]=function(_0x5313be,_0x5ab377,_0x22fdeb){var _0x4bef92,_0x37eeb8,_0x16161d;return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x5313be[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x5ab377,null))[_0xbcfc('0x22')](function(_0x5c2785){if(_0x5c2785){_0x16161d=_0x5c2785;logger[_0xbcfc('0xaf')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbcfc('0x2d'),_0xbcfc('0xc7'),_0x5c2785['type'],util[_0xbcfc('0xc8')](_0x5313be[_0xbcfc('0x46')],{'showHidden':![],'depth':null}));switch(_0x5c2785[_0xbcfc('0x42')]){case _0xbcfc('0x89'):if(_0x5313be['query'][_0xbcfc('0xda')]&&_0x5313be[_0xbcfc('0x46')][_0xbcfc('0xdb')]){_0x37eeb8=_0x5313be[_0xbcfc('0x46')][_0xbcfc('0xdb')];return db['SmsMessage'][_0xbcfc('0x5c')]({'where':{'messageId':_0x5313be[_0xbcfc('0x46')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x5ab377,null))[_0xbcfc('0x22')](function(_0x11b6f8){if(_0x11b6f8){_0x4bef92=_0x11b6f8;switch(_0x16161d[_0xbcfc('0x42')]){case _0xbcfc('0x89'):if(_0x37eeb8==='2'||_0x37eeb8==='6'){return _0x4bef92[_0xbcfc('0x36')]({'read':!![]});}else{logger[_0xbcfc('0x28')](_0xbcfc('0x26'),_0xbcfc('0x2d'),_0xbcfc('0x89'),util[_0xbcfc('0xc8')](_0x5313be['query'],{'showHidden':![],'depth':null}));};break;}return _0x4bef92;}})['then'](respondWithResult(_0x5ab377,null))[_0xbcfc('0x58')](handleError(_0x5ab377,null));};exports[_0xbcfc('0xdc')]=function(_0x3cf637,_0x559ba4,_0x3a2180){return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x3cf637[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x559ba4,null))[_0xbcfc('0x22')](function(_0x2fcb6c){if(_0x2fcb6c){return _0x2fcb6c['addAgents'](_0x3cf637[_0xbcfc('0x63')]['ids'],_['omit'](_0x3cf637[_0xbcfc('0x63')],[_0xbcfc('0x6a'),'id'])||{})[_0xbcfc('0xc5')](function(_0x14cb96){for(var _0x5d753e=0x0;_0x5d753e<_0x3cf637[_0xbcfc('0x63')]['ids'][_0xbcfc('0x4b')];_0x5d753e+=0x1){socket[_0xbcfc('0xdd')](_0xbcfc('0xde'),{'UserId':Number(_0x3cf637[_0xbcfc('0x63')][_0xbcfc('0x6a')][_0x5d753e]),'SmsAccountId':Number(_0x3cf637[_0xbcfc('0x5a')]['id'])});}return _0x14cb96;});}})[_0xbcfc('0x22')](respondWithResult(_0x559ba4,null))[_0xbcfc('0x58')](handleError(_0x559ba4,null));};exports[_0xbcfc('0xdf')]=function(_0x295207,_0x44aa03,_0x16e217){return db[_0xbcfc('0x54')][_0xbcfc('0x5c')]({'where':{'id':_0x295207[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x44aa03,null))[_0xbcfc('0x22')](function(_0x2ab4e6){if(_0x2ab4e6){return _0x2ab4e6[_0xbcfc('0xdf')](_0x295207[_0xbcfc('0x46')]['ids'])['then'](function(){if(_[_0xbcfc('0xe0')](_0x295207['query'][_0xbcfc('0x6a')])){for(var _0x174dd4=0x0;_0x174dd4<_0x295207['query'][_0xbcfc('0x6a')][_0xbcfc('0x4b')];_0x174dd4+=0x1){socket[_0xbcfc('0xdd')](_0xbcfc('0xe1'),{'UserId':Number(_0x295207['query'][_0xbcfc('0x6a')][_0x174dd4]),'SmsAccountId':Number(_0x295207[_0xbcfc('0x5a')]['id'])});}}else{socket['emit'](_0xbcfc('0xe1'),{'UserId':Number(_0x295207[_0xbcfc('0x46')][_0xbcfc('0x6a')]),'SmsAccountId':Number(_0x295207[_0xbcfc('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x44aa03,null))[_0xbcfc('0x58')](handleError(_0x44aa03,null));};exports[_0xbcfc('0xe2')]=function(_0x4daf45,_0x3409be,_0xf9da81){var _0x1ca02b={};var _0x2f3048={};var _0x11331f;var _0x48b86c;return db['SmsAccount'][_0xbcfc('0x6e')]({'where':{'id':_0x4daf45[_0xbcfc('0x5a')]['id']}})[_0xbcfc('0x22')](handleEntityNotFound(_0x3409be,null))['then'](function(_0x5bfdf2){if(_0x5bfdf2){_0x11331f=_0x5bfdf2;_0x2f3048[_0xbcfc('0x44')]=_['keys'](db['User'][_0xbcfc('0x40')]);_0x2f3048[_0xbcfc('0x46')]=_[_0xbcfc('0x45')](_0x4daf45[_0xbcfc('0x46')]);_0x2f3048[_0xbcfc('0x47')]=_['intersection'](_0x2f3048[_0xbcfc('0x44')],_0x2f3048['query']);_0x1ca02b[_0xbcfc('0x48')]=_[_0xbcfc('0x49')](_0x2f3048['model'],qs[_0xbcfc('0x4a')](_0x4daf45[_0xbcfc('0x46')][_0xbcfc('0x4a')]));_0x1ca02b[_0xbcfc('0x48')]=_0x1ca02b[_0xbcfc('0x48')][_0xbcfc('0x4b')]?_0x1ca02b[_0xbcfc('0x48')]:_0x2f3048[_0xbcfc('0x44')];_0x1ca02b[_0xbcfc('0x6f')]=qs[_0xbcfc('0x4e')](_0x4daf45[_0xbcfc('0x46')][_0xbcfc('0x4e')]);_0x1ca02b['where']=qs['filters'](_[_0xbcfc('0x50')](_0x4daf45[_0xbcfc('0x46')],_0x2f3048[_0xbcfc('0x47')]));if(_0x4daf45[_0xbcfc('0x46')]['filter']){_0x1ca02b['where']=_['merge'](_0x1ca02b[_0xbcfc('0x4f')],{'$or':_['map'](_0x1ca02b['attributes'],function(_0x5768a0){var _0x1eba8a={};_0x1eba8a[_0x5768a0]={'$like':'%'+_0x4daf45[_0xbcfc('0x46')][_0xbcfc('0x51')]+'%'};return _0x1eba8a;})});}_0x1ca02b=_[_0xbcfc('0x5b')]({},_0x1ca02b,_0x4daf45[_0xbcfc('0x53')]);return _0x11331f[_0xbcfc('0xe2')](_0x1ca02b);}})[_0xbcfc('0x22')](function(_0x3d2be2){if(_0x3d2be2){_0x48b86c=_0x3d2be2['length'];if(!_0x4daf45[_0xbcfc('0x46')]['hasOwnProperty'](_0xbcfc('0x4d'))){_0x1ca02b[_0xbcfc('0x31')]=qs[_0xbcfc('0x31')](_0x4daf45[_0xbcfc('0x46')][_0xbcfc('0x31')]);_0x1ca02b[_0xbcfc('0x30')]=qs[_0xbcfc('0x30')](_0x4daf45[_0xbcfc('0x46')]['offset']);}return _0x11331f[_0xbcfc('0xe2')](_0x1ca02b);}})[_0xbcfc('0x22')](function(_0x30f433){if(_0x30f433){return _0x30f433?{'count':_0x48b86c,'rows':_0x30f433}:null;}})['then'](respondWithResult(_0x3409be,null))[_0xbcfc('0x58')](handleError(_0x3409be,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ecc0d83..8ff09b4 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 _0x78e8=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x2d1d91,_0x330db9){var _0x1a0b0d=function(_0x204121){while(--_0x204121){_0x2d1d91['push'](_0x2d1d91['shift']());}};_0x1a0b0d(++_0x330db9);}(_0x78e8,0x75));var _0x878e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x78e8[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x878e('0x0'));var SmsAccount=require(_0x878e('0x1'))['db'][_0x878e('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x878e('0x3')](0x0);var events={'afterCreate':_0x878e('0x4'),'afterUpdate':_0x878e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12ea7d){return function(_0x35b18c,_0x682e9e,_0x27fab6){SmsAccountEvents['emit'](_0x12ea7d+':'+_0x35b18c['id'],_0x35b18c);SmsAccountEvents[_0x878e('0x6')](_0x12ea7d,_0x35b18c);_0x27fab6(null);};}for(var e in events){if(events[_0x878e('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x878e('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x61fe=['remove','emit','hook','events','../../mysqldb','SmsAccount','save','update'];(function(_0x119275,_0x39fe82){var _0x1474fb=function(_0x582385){while(--_0x582385){_0x119275['push'](_0x119275['shift']());}};_0x1474fb(++_0x39fe82);}(_0x61fe,0x1bb));var _0xe61f=function(_0x147916,_0x490c14){_0x147916=_0x147916-0x0;var _0x59892b=_0x61fe[_0x147916];return _0x59892b;};'use strict';var EventEmitter=require(_0xe61f('0x0'));var SmsAccount=require(_0xe61f('0x1'))['db'][_0xe61f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe61f('0x3'),'afterUpdate':_0xe61f('0x4'),'afterDestroy':_0xe61f('0x5')};function emitEvent(_0x291e60){return function(_0x2a9ef3,_0x32640a,_0x4e194a){SmsAccountEvents[_0xe61f('0x6')](_0x291e60+':'+_0x2a9ef3['id'],_0x2a9ef3);SmsAccountEvents[_0xe61f('0x6')](_0x291e60,_0x2a9ef3);_0x4e194a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe61f('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 7bee7f8..2b15f3a 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 _0xab49=['lodash','util','api','bluebird','request-promise','rimraf','exports','define','SmsAccount','sms_accounts'];(function(_0x1e784f,_0x255025){var _0x43ef90=function(_0x15e152){while(--_0x15e152){_0x1e784f['push'](_0x1e784f['shift']());}};_0x43ef90(++_0x255025);}(_0xab49,0x122));var _0x9ab4=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xab49[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x9ab4('0x0'));var util=require(_0x9ab4('0x1'));var logger=require('../../config/logger')(_0x9ab4('0x2'));var moment=require('moment');var BPromise=require(_0x9ab4('0x3'));var rp=require(_0x9ab4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ab4('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x9ab4('0x6')]=function(_0xdeb307,_0x1bb2b4){return _0xdeb307[_0x9ab4('0x7')](_0x9ab4('0x8'),attributes,{'tableName':_0x9ab4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ad6=['define','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports'];(function(_0x23f2df,_0x370261){var _0x29ceeb=function(_0x39f2cd){while(--_0x39f2cd){_0x23f2df['push'](_0x23f2df['shift']());}};_0x29ceeb(++_0x370261);}(_0x7ad6,0x188));var _0x67ad=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7ad6[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x67ad('0x0'));var util=require(_0x67ad('0x1'));var logger=require(_0x67ad('0x2'))(_0x67ad('0x3'));var moment=require(_0x67ad('0x4'));var BPromise=require(_0x67ad('0x5'));var rp=require(_0x67ad('0x6'));var fs=require('fs');var path=require(_0x67ad('0x7'));var rimraf=require('rimraf');var config=require(_0x67ad('0x8'));var attributes=require(_0x67ad('0x9'));module[_0x67ad('0xa')]=function(_0x235595,_0x5bf7f7){return _0x235595[_0x67ad('0xb')]('SmsAccount',attributes,{'tableName':_0x67ad('0xc'),'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 609ae25..f4cab8d 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 _0x7d25=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','info','request\x20sent','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','model','include','catch','lodash'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x7d25,0x1e0));var _0x57d2=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x7d25[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0x57d2('0x0'));var util=require(_0x57d2('0x1'));var moment=require(_0x57d2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d2('0x3'))['db'];var utils=require(_0x57d2('0x4'));var logger=require(_0x57d2('0x5'))(_0x57d2('0x6'));var config=require(_0x57d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x8')][_0x57d2('0x9')]({'port':0x232a});config[_0x57d2('0xa')]=_[_0x57d2('0xb')](config[_0x57d2('0xa')],{'host':_0x57d2('0xc'),'port':0x18eb});var socket=require(_0x57d2('0xd'))(new Redis(config[_0x57d2('0xa')]));require(_0x57d2('0xe'))['register'](socket);function respondWithRpcPromise(_0x19da04,_0x1dc3b,_0x12ba0c){return new BPromise(function(_0x5c5e4e,_0x3c8677){return client[_0x57d2('0xf')](_0x19da04,_0x12ba0c)[_0x57d2('0x10')](function(_0x29a3a6){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1dc3b,'request\x20sent');logger[_0x57d2('0x11')](_0x57d2('0x12'),_0x1dc3b,'request\x20sent',JSON[_0x57d2('0x13')](_0x29a3a6));if(_0x29a3a6['error']){if(_0x29a3a6['error']['code']===0x1f4){logger[_0x57d2('0x14')](_0x57d2('0x15'),_0x1dc3b,_0x29a3a6[_0x57d2('0x14')][_0x57d2('0x16')]);return _0x3c8677(_0x29a3a6[_0x57d2('0x14')][_0x57d2('0x16')]);}logger[_0x57d2('0x14')](_0x57d2('0x15'),_0x1dc3b,_0x29a3a6['error']['message']);return _0x5c5e4e(_0x29a3a6[_0x57d2('0x14')][_0x57d2('0x16')]);}else{logger[_0x57d2('0x17')](_0x57d2('0x15'),_0x1dc3b,_0x57d2('0x18'));_0x5c5e4e(_0x29a3a6[_0x57d2('0x19')][_0x57d2('0x16')]);}})['catch'](function(_0x3e0805){logger[_0x57d2('0x14')]('SmsAccount,\x20%s,\x20%s',_0x1dc3b,_0x3e0805);_0x3c8677(_0x3e0805);});});}exports[_0x57d2('0x1a')]=function(_0x2d68f7){var _0x287645=this;return new Promise(function(_0x3013a2,_0x3e40aa){return db[_0x57d2('0x1b')][_0x57d2('0x1c')]({'raw':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7[_0x57d2('0x1d')][_0x57d2('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7[_0x57d2('0x1d')][_0x57d2('0x1f')]||null:null,'attributes':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7['options'][_0x57d2('0x20')]||null:null,'include':_0x2d68f7[_0x57d2('0x1d')]?_0x2d68f7['options']['include']?_[_0x57d2('0x21')](_0x2d68f7[_0x57d2('0x1d')]['include'],function(_0x216ed4){return{'model':db[_0x216ed4[_0x57d2('0x22')]],'as':_0x216ed4['as'],'attributes':_0x216ed4[_0x57d2('0x20')],'include':_0x216ed4['include']?_['map'](_0x216ed4[_0x57d2('0x23')],function(_0x12d07e){return{'model':db[_0x12d07e[_0x57d2('0x22')]],'as':_0x12d07e['as'],'attributes':_0x12d07e[_0x57d2('0x20')],'include':_0x12d07e[_0x57d2('0x23')]?_[_0x57d2('0x21')](_0x12d07e[_0x57d2('0x23')],function(_0x117192){return{'model':db[_0x117192[_0x57d2('0x22')]],'as':_0x117192['as'],'attributes':_0x117192['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27f8c0){logger[_0x57d2('0x17')](_0x57d2('0x1a'),_0x2d68f7);logger[_0x57d2('0x11')](_0x57d2('0x1a'),_0x2d68f7,JSON[_0x57d2('0x13')](_0x27f8c0));_0x3013a2(_0x27f8c0);})[_0x57d2('0x24')](function(_0x2d162f){logger[_0x57d2('0x14')]('ShowSmsAccount',_0x2d162f['message'],_0x2d68f7);_0x3e40aa(_0x287645[_0x57d2('0x14')](0x1f4,_0x2d162f[_0x57d2('0x16')]));});});}; \ No newline at end of file +var _0x26a5=['client','http','localhost','socket.io-emitter','redis','./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','where','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x183fdb,_0x288b39){var _0x1c2e04=function(_0x17b84f){while(--_0x17b84f){_0x183fdb['push'](_0x183fdb['shift']());}};_0x1c2e04(++_0x288b39);}(_0x26a5,0xda));var _0x526a=function(_0x377a12,_0x2f4d41){_0x377a12=_0x377a12-0x0;var _0x17bed8=_0x26a5[_0x377a12];return _0x17bed8;};'use strict';var _=require(_0x526a('0x0'));var util=require(_0x526a('0x1'));var moment=require(_0x526a('0x2'));var BPromise=require(_0x526a('0x3'));var rs=require(_0x526a('0x4'));var fs=require('fs');var Redis=require(_0x526a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x526a('0x6'));var logger=require('../../config/logger')(_0x526a('0x7'));var config=require(_0x526a('0x8'));var jayson=require(_0x526a('0x9'));var client=jayson[_0x526a('0xa')][_0x526a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x526a('0xc'),'port':0x18eb});var socket=require(_0x526a('0xd'))(new Redis(config[_0x526a('0xe')]));require(_0x526a('0xf'))[_0x526a('0x10')](socket);function respondWithRpcPromise(_0xe3b94f,_0x386ad4,_0x18224b){return new BPromise(function(_0x12fe67,_0x4b1e82){return client[_0x526a('0x11')](_0xe3b94f,_0x18224b)[_0x526a('0x12')](function(_0x5a5088){logger[_0x526a('0x13')]('SmsAccount,\x20%s,\x20%s',_0x386ad4,_0x526a('0x14'));logger[_0x526a('0x15')](_0x526a('0x16'),_0x386ad4,_0x526a('0x14'),JSON[_0x526a('0x17')](_0x5a5088));if(_0x5a5088[_0x526a('0x18')]){if(_0x5a5088['error'][_0x526a('0x19')]===0x1f4){logger[_0x526a('0x18')](_0x526a('0x1a'),_0x386ad4,_0x5a5088[_0x526a('0x18')]['message']);return _0x4b1e82(_0x5a5088[_0x526a('0x18')]['message']);}logger['error'](_0x526a('0x1a'),_0x386ad4,_0x5a5088['error'][_0x526a('0x1b')]);return _0x12fe67(_0x5a5088[_0x526a('0x18')][_0x526a('0x1b')]);}else{logger['info'](_0x526a('0x1a'),_0x386ad4,_0x526a('0x14'));_0x12fe67(_0x5a5088[_0x526a('0x1c')][_0x526a('0x1b')]);}})[_0x526a('0x1d')](function(_0x25b9a3){logger[_0x526a('0x18')](_0x526a('0x1a'),_0x386ad4,_0x25b9a3);_0x4b1e82(_0x25b9a3);});});}exports[_0x526a('0x1e')]=function(_0x18f1c3){var _0x5f3179=this;return new Promise(function(_0x217137,_0x282d6f){return db[_0x526a('0x1f')][_0x526a('0x20')]({'raw':_0x18f1c3['options']?_0x18f1c3['options']['raw']===undefined?!![]:![]:!![],'where':_0x18f1c3['options']?_0x18f1c3[_0x526a('0x21')][_0x526a('0x22')]||null:null,'attributes':_0x18f1c3[_0x526a('0x21')]?_0x18f1c3['options']['attributes']||null:null,'include':_0x18f1c3[_0x526a('0x21')]?_0x18f1c3[_0x526a('0x21')][_0x526a('0x23')]?_['map'](_0x18f1c3['options']['include'],function(_0x98defd){return{'model':db[_0x98defd[_0x526a('0x24')]],'as':_0x98defd['as'],'attributes':_0x98defd['attributes'],'include':_0x98defd[_0x526a('0x23')]?_['map'](_0x98defd['include'],function(_0xc4ab6f){return{'model':db[_0xc4ab6f[_0x526a('0x24')]],'as':_0xc4ab6f['as'],'attributes':_0xc4ab6f[_0x526a('0x25')],'include':_0xc4ab6f[_0x526a('0x23')]?_['map'](_0xc4ab6f['include'],function(_0x4a39b1){return{'model':db[_0x4a39b1['model']],'as':_0x4a39b1['as'],'attributes':_0x4a39b1[_0x526a('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3415dd){logger[_0x526a('0x13')](_0x526a('0x1e'),_0x18f1c3);logger[_0x526a('0x15')](_0x526a('0x1e'),_0x18f1c3,JSON[_0x526a('0x17')](_0x3415dd));_0x217137(_0x3415dd);})['catch'](function(_0x54f6de){logger[_0x526a('0x18')](_0x526a('0x1e'),_0x54f6de[_0x526a('0x1b')],_0x18f1c3);_0x282d6f(_0x5f3179[_0x526a('0x18')](0x1f4,_0x54f6de[_0x526a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 576420a..bcf79f6 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 fbc2e04..25ad1fa 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x59d822,_0x22cb65){var _0x3aad52=function(_0x1b7949){while(--_0x1b7949){_0x59d822['push'](_0x59d822['shift']());}};_0x3aad52(++_0x22cb65);}(_0x55ca,0x126));var _0xa55c=function(_0x39efbf,_0x118364){_0x39efbf=_0x39efbf-0x0;var _0xcbd510=_0x55ca[_0x39efbf];return _0xcbd510;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 4aab0a0..8afaf86 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 _0x3c9a=['INTEGER','STRING','*,*,*,*','exports'];(function(_0x544098,_0x4f7e9a){var _0x42d945=function(_0x25fb15){while(--_0x25fb15){_0x544098['push'](_0x544098['shift']());}};_0x42d945(++_0x4f7e9a);}(_0x3c9a,0x77));var _0xa3c9=function(_0x38b777,_0x58b31e){_0x38b777=_0x38b777-0x0;var _0x41da2c=_0x3c9a[_0x38b777];return _0x41da2c;};'use strict';var Sequelize=require('sequelize');module[_0xa3c9('0x0')]={'priority':{'type':Sequelize[_0xa3c9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa3c9('0x2')],'defaultValue':_0xa3c9('0x3')}}; \ No newline at end of file +var _0xc6f1=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc6f1,0x1af));var _0x1c6f=function(_0x302ebe,_0x4f4943){_0x302ebe=_0x302ebe-0x0;var _0x3c7926=_0xc6f1[_0x302ebe];return _0x3c7926;};'use strict';var Sequelize=require(_0x1c6f('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1c6f('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c6f('0x2')},'appdata':{'type':Sequelize[_0x1c6f('0x3')]()},'description':{'type':Sequelize[_0x1c6f('0x4')]},'interval':{'type':Sequelize[_0x1c6f('0x4')],'defaultValue':_0x1c6f('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index d924e0d..5e827a3 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 _0x17a6=['update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','SmsApplication','findAll','params','fields','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save'];(function(_0x4df9ea,_0x3d19ad){var _0x40c78b=function(_0x21fd7c){while(--_0x21fd7c){_0x4df9ea['push'](_0x4df9ea['shift']());}};_0x40c78b(++_0x3d19ad);}(_0x17a6,0x107));var _0x617a=function(_0x1753b8,_0x3edb69){_0x1753b8=_0x1753b8-0x0;var _0x1e56e6=_0x17a6[_0x1753b8];return _0x1e56e6;};'use strict';var emlformat=require(_0x617a('0x0'));var rimraf=require(_0x617a('0x1'));var zipdir=require(_0x617a('0x2'));var jsonpatch=require(_0x617a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x617a('0x4'));var Mustache=require(_0x617a('0x5'));var util=require(_0x617a('0x6'));var path=require(_0x617a('0x7'));var sox=require('sox');var csv=require(_0x617a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x617a('0x9'));var squel=require(_0x617a('0xa'));var crypto=require(_0x617a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x617a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x617a('0xd'));var Papa=require(_0x617a('0xe'));var Redis=require(_0x617a('0xf'));var authService=require(_0x617a('0x10'));var qs=require(_0x617a('0x11'));var as=require(_0x617a('0x12'));var hardwareService=require(_0x617a('0x13'));var logger=require('../../config/logger')(_0x617a('0x14'));var utils=require(_0x617a('0x15'));var config=require(_0x617a('0x16'));var licenseUtil=require(_0x617a('0x17'));var db=require(_0x617a('0x18'))['db'];function respondWithStatusCode(_0x529781,_0x26e5cc){_0x26e5cc=_0x26e5cc||0xcc;return function(_0x2b4b37){if(_0x2b4b37){return _0x529781[_0x617a('0x19')](_0x26e5cc);}return _0x529781['status'](_0x26e5cc)[_0x617a('0x1a')]();};}function respondWithResult(_0x48ab1a,_0x587586){_0x587586=_0x587586||0xc8;return function(_0x3c63b7){if(_0x3c63b7){return _0x48ab1a['status'](_0x587586)[_0x617a('0x1b')](_0x3c63b7);}};}function respondWithFilteredResult(_0x18f8b3,_0x2bee47){return function(_0x42d2cb){if(_0x42d2cb){var _0x2dd99f=typeof _0x2bee47['offset']===_0x617a('0x1c')&&typeof _0x2bee47[_0x617a('0x1d')]===_0x617a('0x1c');var _0x2339ba=_0x42d2cb[_0x617a('0x1e')];var _0x241c86=_0x2dd99f?0x0:_0x2bee47['offset'];var _0x48addf=_0x2dd99f?_0x42d2cb[_0x617a('0x1e')]:_0x2bee47[_0x617a('0x1f')]+_0x2bee47[_0x617a('0x1d')];var _0x3f187a;if(_0x48addf>=_0x2339ba){_0x48addf=_0x2339ba;_0x3f187a=0xc8;}else{_0x3f187a=0xce;}_0x18f8b3[_0x617a('0x20')](_0x3f187a);return _0x18f8b3[_0x617a('0x21')](_0x617a('0x22'),_0x241c86+'-'+_0x48addf+'/'+_0x2339ba)['json'](_0x42d2cb);}return null;};}function patchUpdates(_0x1429e4){return function(_0x373a52){try{jsonpatch['apply'](_0x373a52,_0x1429e4,!![]);}catch(_0x45010d){return BPromise[_0x617a('0x23')](_0x45010d);}return _0x373a52[_0x617a('0x24')]();};}function saveUpdates(_0x2ba74e,_0x3bf2a6){return function(_0x2316e8){if(_0x2316e8){return _0x2316e8[_0x617a('0x25')](_0x2ba74e)['then'](function(_0x408e55){return _0x408e55;});}return null;};}function removeEntity(_0xd4cf05,_0x35a395){return function(_0x45d49c){if(_0x45d49c){return _0x45d49c[_0x617a('0x26')]()[_0x617a('0x27')](function(){_0xd4cf05['status'](0xcc)[_0x617a('0x1a')]();});}};}function handleEntityNotFound(_0x3fa289,_0x3dfd85){return function(_0x485f94){if(!_0x485f94){_0x3fa289[_0x617a('0x19')](0x194);}return _0x485f94;};}function handleError(_0x42a860,_0x179e17){_0x179e17=_0x179e17||0x1f4;return function(_0x61dddb){logger[_0x617a('0x28')](_0x61dddb[_0x617a('0x29')]);if(_0x61dddb[_0x617a('0x2a')]){delete _0x61dddb[_0x617a('0x2a')];}_0x42a860[_0x617a('0x20')](_0x179e17)[_0x617a('0x2b')](_0x61dddb);};}exports[_0x617a('0x2c')]=function(_0x48e540,_0x1c8d13){var _0x1a3bd1={},_0x33d023={},_0x48bdfc={'count':0x0,'rows':[]};var _0x2cea03=_[_0x617a('0x2d')](db['SmsApplication'][_0x617a('0x2e')],function(_0x38dea0){return{'name':_0x38dea0[_0x617a('0x2f')],'type':_0x38dea0[_0x617a('0x30')][_0x617a('0x31')]};});_0x33d023['model']=_['map'](_0x2cea03,_0x617a('0x2a'));_0x33d023[_0x617a('0x32')]=_[_0x617a('0x33')](_0x48e540[_0x617a('0x32')]);_0x33d023['filters']=_[_0x617a('0x34')](_0x33d023[_0x617a('0x35')],_0x33d023[_0x617a('0x32')]);_0x1a3bd1[_0x617a('0x36')]=_[_0x617a('0x34')](_0x33d023[_0x617a('0x35')],qs['fields'](_0x48e540[_0x617a('0x32')]['fields']));_0x1a3bd1['attributes']=_0x1a3bd1['attributes'][_0x617a('0x37')]?_0x1a3bd1[_0x617a('0x36')]:_0x33d023[_0x617a('0x35')];if(!_0x48e540[_0x617a('0x32')][_0x617a('0x38')]('nolimit')){_0x1a3bd1[_0x617a('0x1d')]=qs[_0x617a('0x1d')](_0x48e540[_0x617a('0x32')][_0x617a('0x1d')]);_0x1a3bd1[_0x617a('0x1f')]=qs['offset'](_0x48e540[_0x617a('0x32')][_0x617a('0x1f')]);}_0x1a3bd1[_0x617a('0x39')]=qs[_0x617a('0x3a')](_0x48e540[_0x617a('0x32')][_0x617a('0x3a')]);_0x1a3bd1[_0x617a('0x3b')]=qs[_0x617a('0x3c')](_[_0x617a('0x3d')](_0x48e540[_0x617a('0x32')],_0x33d023[_0x617a('0x3c')]),_0x2cea03);if(_0x48e540[_0x617a('0x32')][_0x617a('0x3e')]){_0x1a3bd1[_0x617a('0x3b')]=_['merge'](_0x1a3bd1[_0x617a('0x3b')],{'$or':_[_0x617a('0x2d')](_0x2cea03,function(_0x356e9f){if(_0x356e9f[_0x617a('0x30')]!==_0x617a('0x3f')){var _0xe23633={};_0xe23633[_0x356e9f[_0x617a('0x2a')]]={'$like':'%'+_0x48e540[_0x617a('0x32')]['filter']+'%'};return _0xe23633;}})});}_0x1a3bd1=_['merge']({},_0x1a3bd1,_0x48e540['options']);var _0x159a6a={'where':_0x1a3bd1[_0x617a('0x3b')]};return db['SmsApplication'][_0x617a('0x1e')](_0x159a6a)[_0x617a('0x27')](function(_0x1294f6){_0x48bdfc['count']=_0x1294f6;if(_0x48e540[_0x617a('0x32')][_0x617a('0x40')]){_0x1a3bd1['include']=[{'all':!![]}];}return db[_0x617a('0x41')][_0x617a('0x42')](_0x1a3bd1);})[_0x617a('0x27')](function(_0x412983){_0x48bdfc['rows']=_0x412983;return _0x48bdfc;})[_0x617a('0x27')](respondWithFilteredResult(_0x1c8d13,_0x1a3bd1))['catch'](handleError(_0x1c8d13,null));};exports['show']=function(_0x4c4f06,_0x2abc17){var _0x3edea4={'raw':!![],'where':{'id':_0x4c4f06[_0x617a('0x43')]['id']}},_0x1a5825={};_0x1a5825['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x1a5825[_0x617a('0x32')]=_[_0x617a('0x33')](_0x4c4f06['query']);_0x1a5825['filters']=_[_0x617a('0x34')](_0x1a5825[_0x617a('0x35')],_0x1a5825[_0x617a('0x32')]);_0x3edea4[_0x617a('0x36')]=_[_0x617a('0x34')](_0x1a5825['model'],qs[_0x617a('0x44')](_0x4c4f06[_0x617a('0x32')][_0x617a('0x44')]));_0x3edea4[_0x617a('0x36')]=_0x3edea4[_0x617a('0x36')][_0x617a('0x37')]?_0x3edea4[_0x617a('0x36')]:_0x1a5825[_0x617a('0x35')];if(_0x4c4f06[_0x617a('0x32')][_0x617a('0x40')]){_0x3edea4[_0x617a('0x45')]=[{'all':!![]}];}_0x3edea4=_[_0x617a('0x46')]({},_0x3edea4,_0x4c4f06['options']);return db[_0x617a('0x41')][_0x617a('0x47')](_0x3edea4)[_0x617a('0x27')](handleEntityNotFound(_0x2abc17,null))['then'](respondWithResult(_0x2abc17,null))[_0x617a('0x48')](handleError(_0x2abc17,null));};exports[_0x617a('0x49')]=function(_0x241918,_0x5e6271){return db[_0x617a('0x41')][_0x617a('0x49')](_0x241918[_0x617a('0x4a')],{})['then'](respondWithResult(_0x5e6271,0xc9))[_0x617a('0x48')](handleError(_0x5e6271,null));};exports[_0x617a('0x25')]=function(_0x2a0e95,_0x4bb145){if(_0x2a0e95['body']['id']){delete _0x2a0e95[_0x617a('0x4a')]['id'];}return db[_0x617a('0x41')][_0x617a('0x47')]({'where':{'id':_0x2a0e95[_0x617a('0x43')]['id']}})[_0x617a('0x27')](handleEntityNotFound(_0x4bb145,null))[_0x617a('0x27')](saveUpdates(_0x2a0e95['body'],null))[_0x617a('0x27')](respondWithResult(_0x4bb145,null))['catch'](handleError(_0x4bb145,null));};exports[_0x617a('0x26')]=function(_0x3207ad,_0x512f66){return db[_0x617a('0x41')]['find']({'where':{'id':_0x3207ad[_0x617a('0x43')]['id']}})[_0x617a('0x27')](handleEntityNotFound(_0x512f66,null))[_0x617a('0x27')](removeEntity(_0x512f66,null))['catch'](handleError(_0x512f66,null));}; \ No newline at end of file +var _0x6265=['includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filters','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','keys'];(function(_0x551aef,_0x3a75be){var _0x4b5526=function(_0x486c73){while(--_0x486c73){_0x551aef['push'](_0x551aef['shift']());}};_0x4b5526(++_0x3a75be);}(_0x6265,0x11c));var _0x5626=function(_0x51fee8,_0x5d4310){_0x51fee8=_0x51fee8-0x0;var _0x4dd5a7=_0x6265[_0x51fee8];return _0x4dd5a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5626('0x0'));var zipdir=require(_0x5626('0x1'));var jsonpatch=require(_0x5626('0x2'));var rp=require(_0x5626('0x3'));var moment=require(_0x5626('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5626('0x5'));var util=require(_0x5626('0x6'));var path=require(_0x5626('0x7'));var sox=require('sox');var csv=require(_0x5626('0x8'));var ejs=require(_0x5626('0x9'));var fs=require('fs');var fs_extra=require(_0x5626('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5626('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5626('0xc'));var Papa=require(_0x5626('0xd'));var Redis=require(_0x5626('0xe'));var authService=require(_0x5626('0xf'));var qs=require(_0x5626('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5626('0x11'));var logger=require('../../config/logger')(_0x5626('0x12'));var utils=require(_0x5626('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5626('0x14'))['db'];function respondWithStatusCode(_0x1a75ff,_0x50a90e){_0x50a90e=_0x50a90e||0xcc;return function(_0x3947b9){if(_0x3947b9){return _0x1a75ff['sendStatus'](_0x50a90e);}return _0x1a75ff[_0x5626('0x15')](_0x50a90e)['end']();};}function respondWithResult(_0x5d5975,_0x41eb62){_0x41eb62=_0x41eb62||0xc8;return function(_0x3ee496){if(_0x3ee496){return _0x5d5975['status'](_0x41eb62)[_0x5626('0x16')](_0x3ee496);}};}function respondWithFilteredResult(_0x5904a7,_0xc66bb0){return function(_0x35ffb3){if(_0x35ffb3){var _0x28f3f6=typeof _0xc66bb0[_0x5626('0x17')]===_0x5626('0x18')&&typeof _0xc66bb0[_0x5626('0x19')]===_0x5626('0x18');var _0x3bf260=_0x35ffb3[_0x5626('0x1a')];var _0x1d2489=_0x28f3f6?0x0:_0xc66bb0[_0x5626('0x17')];var _0x5ef853=_0x28f3f6?_0x35ffb3[_0x5626('0x1a')]:_0xc66bb0[_0x5626('0x17')]+_0xc66bb0[_0x5626('0x19')];var _0xe345c;if(_0x5ef853>=_0x3bf260){_0x5ef853=_0x3bf260;_0xe345c=0xc8;}else{_0xe345c=0xce;}_0x5904a7['status'](_0xe345c);return _0x5904a7['set'](_0x5626('0x1b'),_0x1d2489+'-'+_0x5ef853+'/'+_0x3bf260)[_0x5626('0x16')](_0x35ffb3);}return null;};}function patchUpdates(_0x47fac5){return function(_0x15df63){try{jsonpatch[_0x5626('0x1c')](_0x15df63,_0x47fac5,!![]);}catch(_0x11c3d7){return BPromise[_0x5626('0x1d')](_0x11c3d7);}return _0x15df63['save']();};}function saveUpdates(_0x71d792,_0x3137d6){return function(_0x5836e0){if(_0x5836e0){return _0x5836e0[_0x5626('0x1e')](_0x71d792)[_0x5626('0x1f')](function(_0x547828){return _0x547828;});}return null;};}function removeEntity(_0x3f0fcb,_0x3bf785){return function(_0x30623d){if(_0x30623d){return _0x30623d[_0x5626('0x20')]()[_0x5626('0x1f')](function(){_0x3f0fcb[_0x5626('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x459548,_0x42ed8b){return function(_0x2153b3){if(!_0x2153b3){_0x459548[_0x5626('0x21')](0x194);}return _0x2153b3;};}function handleError(_0x5d7b5c,_0x3bd98f){_0x3bd98f=_0x3bd98f||0x1f4;return function(_0x291867){logger[_0x5626('0x22')](_0x291867[_0x5626('0x23')]);if(_0x291867['name']){delete _0x291867[_0x5626('0x24')];}_0x5d7b5c[_0x5626('0x15')](_0x3bd98f)[_0x5626('0x25')](_0x291867);};}exports[_0x5626('0x26')]=function(_0x2de5cc,_0x7cdf07){var _0x4c965b={},_0x4ffb8f={},_0x202b09={'count':0x0,'rows':[]};var _0x18a872=_[_0x5626('0x27')](db[_0x5626('0x28')][_0x5626('0x29')],function(_0x2f8672){return{'name':_0x2f8672['fieldName'],'type':_0x2f8672[_0x5626('0x2a')][_0x5626('0x2b')]};});_0x4ffb8f[_0x5626('0x2c')]=_[_0x5626('0x27')](_0x18a872,_0x5626('0x24'));_0x4ffb8f[_0x5626('0x2d')]=_['keys'](_0x2de5cc[_0x5626('0x2d')]);_0x4ffb8f['filters']=_[_0x5626('0x2e')](_0x4ffb8f[_0x5626('0x2c')],_0x4ffb8f[_0x5626('0x2d')]);_0x4c965b['attributes']=_[_0x5626('0x2e')](_0x4ffb8f['model'],qs['fields'](_0x2de5cc[_0x5626('0x2d')][_0x5626('0x2f')]));_0x4c965b[_0x5626('0x30')]=_0x4c965b[_0x5626('0x30')][_0x5626('0x31')]?_0x4c965b[_0x5626('0x30')]:_0x4ffb8f[_0x5626('0x2c')];if(!_0x2de5cc[_0x5626('0x2d')][_0x5626('0x32')](_0x5626('0x33'))){_0x4c965b[_0x5626('0x19')]=qs[_0x5626('0x19')](_0x2de5cc[_0x5626('0x2d')]['limit']);_0x4c965b[_0x5626('0x17')]=qs[_0x5626('0x17')](_0x2de5cc[_0x5626('0x2d')]['offset']);}_0x4c965b[_0x5626('0x34')]=qs['sort'](_0x2de5cc[_0x5626('0x2d')]['sort']);_0x4c965b[_0x5626('0x35')]=qs['filters'](_[_0x5626('0x36')](_0x2de5cc[_0x5626('0x2d')],_0x4ffb8f[_0x5626('0x37')]),_0x18a872);if(_0x2de5cc[_0x5626('0x2d')]['filter']){_0x4c965b[_0x5626('0x35')]=_[_0x5626('0x38')](_0x4c965b['where'],{'$or':_[_0x5626('0x27')](_0x18a872,function(_0x33ba5d){if(_0x33ba5d[_0x5626('0x2a')]!==_0x5626('0x39')){var _0x4efd2f={};_0x4efd2f[_0x33ba5d[_0x5626('0x24')]]={'$like':'%'+_0x2de5cc['query'][_0x5626('0x3a')]+'%'};return _0x4efd2f;}})});}_0x4c965b=_['merge']({},_0x4c965b,_0x2de5cc[_0x5626('0x3b')]);var _0x282431={'where':_0x4c965b[_0x5626('0x35')]};return db[_0x5626('0x28')][_0x5626('0x1a')](_0x282431)['then'](function(_0xa0b928){_0x202b09['count']=_0xa0b928;if(_0x2de5cc[_0x5626('0x2d')]['includeAll']){_0x4c965b[_0x5626('0x3c')]=[{'all':!![]}];}return db[_0x5626('0x28')][_0x5626('0x3d')](_0x4c965b);})[_0x5626('0x1f')](function(_0xcfdf77){_0x202b09['rows']=_0xcfdf77;return _0x202b09;})['then'](respondWithFilteredResult(_0x7cdf07,_0x4c965b))[_0x5626('0x3e')](handleError(_0x7cdf07,null));};exports[_0x5626('0x3f')]=function(_0x18eaf6,_0x5ba14b){var _0x134c01={'raw':!![],'where':{'id':_0x18eaf6[_0x5626('0x40')]['id']}},_0x38b5d4={};_0x38b5d4[_0x5626('0x2c')]=_['keys'](db[_0x5626('0x28')][_0x5626('0x29')]);_0x38b5d4[_0x5626('0x2d')]=_[_0x5626('0x41')](_0x18eaf6[_0x5626('0x2d')]);_0x38b5d4[_0x5626('0x37')]=_[_0x5626('0x2e')](_0x38b5d4[_0x5626('0x2c')],_0x38b5d4['query']);_0x134c01[_0x5626('0x30')]=_[_0x5626('0x2e')](_0x38b5d4['model'],qs[_0x5626('0x2f')](_0x18eaf6[_0x5626('0x2d')]['fields']));_0x134c01[_0x5626('0x30')]=_0x134c01[_0x5626('0x30')][_0x5626('0x31')]?_0x134c01[_0x5626('0x30')]:_0x38b5d4['model'];if(_0x18eaf6[_0x5626('0x2d')][_0x5626('0x42')]){_0x134c01[_0x5626('0x3c')]=[{'all':!![]}];}_0x134c01=_['merge']({},_0x134c01,_0x18eaf6[_0x5626('0x3b')]);return db[_0x5626('0x28')][_0x5626('0x43')](_0x134c01)[_0x5626('0x1f')](handleEntityNotFound(_0x5ba14b,null))[_0x5626('0x1f')](respondWithResult(_0x5ba14b,null))[_0x5626('0x3e')](handleError(_0x5ba14b,null));};exports[_0x5626('0x44')]=function(_0x14e0c4,_0x442063){return db[_0x5626('0x28')][_0x5626('0x44')](_0x14e0c4[_0x5626('0x45')],{})[_0x5626('0x1f')](respondWithResult(_0x442063,0xc9))[_0x5626('0x3e')](handleError(_0x442063,null));};exports['update']=function(_0x2b65c2,_0x264b03){if(_0x2b65c2[_0x5626('0x45')]['id']){delete _0x2b65c2[_0x5626('0x45')]['id'];}return db[_0x5626('0x28')][_0x5626('0x43')]({'where':{'id':_0x2b65c2[_0x5626('0x40')]['id']}})[_0x5626('0x1f')](handleEntityNotFound(_0x264b03,null))[_0x5626('0x1f')](saveUpdates(_0x2b65c2[_0x5626('0x45')],null))[_0x5626('0x1f')](respondWithResult(_0x264b03,null))[_0x5626('0x3e')](handleError(_0x264b03,null));};exports[_0x5626('0x20')]=function(_0x53a27f,_0x4a3313){return db['SmsApplication'][_0x5626('0x43')]({'where':{'id':_0x53a27f['params']['id']}})[_0x5626('0x1f')](handleEntityNotFound(_0x4a3313,null))[_0x5626('0x1f')](removeEntity(_0x4a3313,null))[_0x5626('0x3e')](handleError(_0x4a3313,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e4bde9e..b9a8e36 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 _0xc03e=['bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0xae72a4,_0x1bdc6a){var _0x27c197=function(_0x5f3335){while(--_0x5f3335){_0xae72a4['push'](_0xae72a4['shift']());}};_0x27c197(++_0x1bdc6a);}(_0xc03e,0x15a));var _0xec03=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc03e[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec03('0x1'));var moment=require('moment');var BPromise=require(_0xec03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec03('0x3'));var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1ce78a,_0x31db21){return _0x1ce78a[_0xec03('0x8')](_0xec03('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec03('0xa'),'collate':_0xec03('0xb')});}; \ No newline at end of file +var _0x8a24=['rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1fdd3b,_0x39c433){var _0x817306=function(_0x4629b3){while(--_0x4629b3){_0x1fdd3b['push'](_0x1fdd3b['shift']());}};_0x817306(++_0x39c433);}(_0x8a24,0x132));var _0x48a2=function(_0x27a618,_0xbc5174){_0x27a618=_0x27a618-0x0;var _0x209ba0=_0x8a24[_0x27a618];return _0x209ba0;};'use strict';var _=require(_0x48a2('0x0'));var util=require(_0x48a2('0x1'));var logger=require(_0x48a2('0x2'))(_0x48a2('0x3'));var moment=require(_0x48a2('0x4'));var BPromise=require(_0x48a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x48a2('0x6'));var config=require(_0x48a2('0x7'));var attributes=require('./smsApplication.attributes');module[_0x48a2('0x8')]=function(_0x6f75a4,_0x59fa68){return _0x6f75a4[_0x48a2('0x9')](_0x48a2('0xa'),attributes,{'tableName':_0x48a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x48a2('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 119ec3a..ebf3b19 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 _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0xcce451,_0x2dbd1a){var _0x5ade27=function(_0x240379){while(--_0x240379){_0xcce451['push'](_0xcce451['shift']());}};_0x5ade27(++_0x2dbd1a);}(_0x7916,0x128));var _0x6791=function(_0x2c7253,_0x5debe6){_0x2c7253=_0x2c7253-0x0;var _0x4ae6fb=_0x7916[_0x2c7253];return _0x4ae6fb;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file +var _0xc74c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xc74c,0x163));var _0xcc74=function(_0x1a47f8,_0xe88229){_0x1a47f8=_0x1a47f8-0x0;var _0x20626d=_0xc74c[_0x1a47f8];return _0x20626d;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc74('0x2'));var fs=require('fs');var Redis=require(_0xcc74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc74('0x4'));var logger=require(_0xcc74('0x5'))(_0xcc74('0x6'));var config=require(_0xcc74('0x7'));var jayson=require(_0xcc74('0x8'));var client=jayson[_0xcc74('0x9')][_0xcc74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d46a6,_0x15248f,_0x86f429){return new BPromise(function(_0x1eb886,_0x473308){return client[_0xcc74('0xb')](_0x5d46a6,_0x86f429)['then'](function(_0x4b4534){logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));logger['debug'](_0xcc74('0xf'),_0x15248f,_0xcc74('0xe'),JSON[_0xcc74('0x10')](_0x4b4534));if(_0x4b4534['error']){if(_0x4b4534[_0xcc74('0x11')]['code']===0x1f4){logger[_0xcc74('0x11')]('SmsApplication,\x20%s,\x20%s',_0x15248f,_0x4b4534['error']['message']);return _0x473308(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0x4b4534[_0xcc74('0x11')]['message']);return _0x1eb886(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}else{logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));_0x1eb886(_0x4b4534['result'][_0xcc74('0x12')]);}})[_0xcc74('0x13')](function(_0xe44014){logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0xe44014);_0x473308(_0xe44014);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index af88193..f36faeb 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 _0x14a0=['/:id/download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','/describe','describe','getMessages'];(function(_0x1f9cca,_0x3e51da){var _0x2aba04=function(_0x3037f6){while(--_0x3037f6){_0x1f9cca['push'](_0x1f9cca['shift']());}};_0x2aba04(++_0x3e51da);}(_0x14a0,0x8e));var _0x014a=function(_0x5234a6,_0x44fa0a){_0x5234a6=_0x5234a6-0x0;var _0x473c8e=_0x14a0[_0x5234a6];return _0x473c8e;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['download']);router[_0x014a('0xe')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0xe')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0xe')](_0x014a('0x12'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),'smsinteraction:addtags'),controller[_0x014a('0x15')]);router[_0x014a('0x16')]('/:id',auth[_0x014a('0x9')](),interaction[_0x014a('0x13')]('sms',_0x014a('0x17')),controller[_0x014a('0x18')]);router[_0x014a('0x19')](_0x014a('0x1a'),auth[_0x014a('0x9')](),interaction[_0x014a('0x13')](_0x014a('0x14'),_0x014a('0x1b')),controller[_0x014a('0x1c')]);router[_0x014a('0x19')](_0x014a('0x12'),auth[_0x014a('0x9')](),controller[_0x014a('0x1d')]);module[_0x014a('0x1e')]=router; \ No newline at end of file +var _0xefda=['../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x337082,_0x403d1d){var _0x547ccb=function(_0xd13a1c){while(--_0xd13a1c){_0x337082['push'](_0x337082['shift']());}};_0x547ccb(++_0x403d1d);}(_0xefda,0x96));var _0xaefd=function(_0x33a2b4,_0x5aab9b){_0x33a2b4=_0x33a2b4-0x0;var _0x42f2a7=_0xefda[_0x33a2b4];return _0x42f2a7;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['describe']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['show']);router['get']('/:id/messages',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0x8')](_0xaefd('0xe'),auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0x10')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0x11')]);router[_0xaefd('0x10')](_0xaefd('0x12'),auth['isAuthenticated'](),controller[_0xaefd('0x13')]);router['post'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),'smsinteraction:addtags'),controller[_0xaefd('0x17')]);router[_0xaefd('0x18')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x19')),controller[_0xaefd('0x1a')]);router['delete'](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x1b')),controller[_0xaefd('0x1c')]);router['delete'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x1d')]);module[_0xaefd('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index eac57cd..1e7a1b4 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 _0x8819=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x1bc296,_0x4c0446){var _0x3b22da=function(_0x5a0558){while(--_0x5a0558){_0x1bc296['push'](_0x1bc296['shift']());}};_0x3b22da(++_0x4c0446);}(_0x8819,0x94));var _0x9881=function(_0x421c55,_0x169e3a){_0x421c55=_0x421c55-0x0;var _0x589d4c=_0x8819[_0x421c55];return _0x589d4c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9881('0x0')]={'closed':{'type':Sequelize[_0x9881('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9881('0x2')]},'disposition':{'type':Sequelize[_0x9881('0x3')]},'secondDisposition':{'type':Sequelize[_0x9881('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9881('0x3')]},'phone':{'type':Sequelize[_0x9881('0x3')]},'read1stAt':{'type':Sequelize[_0x9881('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9881('0x4')]('in',_0x9881('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9881('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9881('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xab86=['exports','STRING','DATE','ENUM','out','BOOLEAN','sequelize','moment'];(function(_0x59dac6,_0x1b8801){var _0x1fada5=function(_0x598d46){while(--_0x598d46){_0x59dac6['push'](_0x59dac6['shift']());}};_0x1fada5(++_0x1b8801);}(_0xab86,0x13e));var _0x6ab8=function(_0x581fac,_0x165cbc){_0x581fac=_0x581fac-0x0;var _0x207776=_0xab86[_0x581fac];return _0x207776;};'use strict';var Sequelize=require(_0x6ab8('0x0'));var moment=require(_0x6ab8('0x1'));module[_0x6ab8('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6ab8('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6ab8('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x6ab8('0x3')]},'read1stAt':{'type':Sequelize[_0x6ab8('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6ab8('0x5')]('in',_0x6ab8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6ab8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6ab8('0x5')]('in',_0x6ab8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6ab8('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 799a88b..0d58a67 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 _0xe0c6=['where','pick','filters','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','rows','show','params','rawAttributes','includeAll','include','options','create','describe','SmsMessage','addMessage','ids','omit','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','direction','secret','Account','Owner','get','N.A.','closedAt','disposition','out','System','renderFile','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','catch','index','map','SmsInteraction','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe0c6,0x9f));var _0x6e0c=function(_0x1e1e76,_0x5e980c){_0x1e1e76=_0x1e1e76-0x0;var _0x4f9c36=_0xe0c6[_0x1e1e76];return _0x4f9c36;};'use strict';var emlformat=require(_0x6e0c('0x0'));var rimraf=require(_0x6e0c('0x1'));var zipdir=require(_0x6e0c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e0c('0x3'));var moment=require(_0x6e0c('0x4'));var BPromise=require(_0x6e0c('0x5'));var Mustache=require(_0x6e0c('0x6'));var util=require(_0x6e0c('0x7'));var path=require(_0x6e0c('0x8'));var sox=require(_0x6e0c('0x9'));var csv=require(_0x6e0c('0xa'));var ejs=require(_0x6e0c('0xb'));var fs=require('fs');var fs_extra=require(_0x6e0c('0xc'));var _=require(_0x6e0c('0xd'));var squel=require(_0x6e0c('0xe'));var crypto=require('crypto');var jsforce=require(_0x6e0c('0xf'));var deskjs=require(_0x6e0c('0x10'));var toCsv=require(_0x6e0c('0xa'));var querystring=require(_0x6e0c('0x11'));var Papa=require(_0x6e0c('0x12'));var Redis=require('ioredis');var authService=require(_0x6e0c('0x13'));var qs=require(_0x6e0c('0x14'));var as=require(_0x6e0c('0x15'));var pdf=require(_0x6e0c('0x16'));var hardwareService=require(_0x6e0c('0x17'));var logger=require(_0x6e0c('0x18'))(_0x6e0c('0x19'));var utils=require(_0x6e0c('0x1a'));var config=require(_0x6e0c('0x1b'));var licenseUtil=require(_0x6e0c('0x1c'));var db=require(_0x6e0c('0x1d'))['db'];config['redis']=_[_0x6e0c('0x1e')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6e0c('0x1f'))(new Redis(config[_0x6e0c('0x20')]));require(_0x6e0c('0x21'))[_0x6e0c('0x22')](socket);function respondWithStatusCode(_0x8d3de4,_0x487496){_0x487496=_0x487496||0xcc;return function(_0xdbb1f2){if(_0xdbb1f2){return _0x8d3de4[_0x6e0c('0x23')](_0x487496);}return _0x8d3de4[_0x6e0c('0x24')](_0x487496)[_0x6e0c('0x25')]();};}function respondWithResult(_0x4cf8f0,_0x3e4313){_0x3e4313=_0x3e4313||0xc8;return function(_0x249c17){if(_0x249c17){return _0x4cf8f0[_0x6e0c('0x24')](_0x3e4313)[_0x6e0c('0x26')](_0x249c17);}};}function respondWithFilteredResult(_0x82b5d8,_0x37976b){return function(_0x19d5cf){if(_0x19d5cf){var _0x6637b2=typeof _0x37976b[_0x6e0c('0x27')]===_0x6e0c('0x28')&&typeof _0x37976b[_0x6e0c('0x29')]===_0x6e0c('0x28');var _0x353b7c=_0x19d5cf[_0x6e0c('0x2a')];var _0xd349bb=_0x6637b2?0x0:_0x37976b[_0x6e0c('0x27')];var _0x5e2bd5=_0x6637b2?_0x19d5cf['count']:_0x37976b[_0x6e0c('0x27')]+_0x37976b[_0x6e0c('0x29')];var _0x37f2e8;if(_0x5e2bd5>=_0x353b7c){_0x5e2bd5=_0x353b7c;_0x37f2e8=0xc8;}else{_0x37f2e8=0xce;}_0x82b5d8['status'](_0x37f2e8);return _0x82b5d8[_0x6e0c('0x2b')](_0x6e0c('0x2c'),_0xd349bb+'-'+_0x5e2bd5+'/'+_0x353b7c)[_0x6e0c('0x26')](_0x19d5cf);}return null;};}function patchUpdates(_0x2f0005){return function(_0x4179bd){try{jsonpatch[_0x6e0c('0x2d')](_0x4179bd,_0x2f0005,!![]);}catch(_0xa1206f){return BPromise['reject'](_0xa1206f);}return _0x4179bd[_0x6e0c('0x2e')]();};}function saveUpdates(_0x18ae2f,_0x44eee0){return function(_0x12d714){if(_0x12d714){return _0x12d714[_0x6e0c('0x2f')](_0x18ae2f)['then'](function(_0x1308a){return _0x1308a;});}return null;};}function removeEntity(_0x5c625d,_0x41044c){return function(_0x582136){if(_0x582136){return _0x582136[_0x6e0c('0x30')]()[_0x6e0c('0x31')](function(){_0x5c625d[_0x6e0c('0x24')](0xcc)[_0x6e0c('0x25')]();});}};}function handleEntityNotFound(_0xfa2d2d,_0x2535c5){return function(_0x57728e){if(!_0x57728e){_0xfa2d2d[_0x6e0c('0x23')](0x194);}return _0x57728e;};}function handleError(_0xcce5d2,_0x87e1ab){_0x87e1ab=_0x87e1ab||0x1f4;return function(_0x462436){logger[_0x6e0c('0x32')](_0x462436[_0x6e0c('0x33')]);if(_0x462436['name']){delete _0x462436[_0x6e0c('0x34')];}_0xcce5d2['status'](_0x87e1ab)[_0x6e0c('0x35')](_0x462436);};}function getInteractionUsers(_0x145081,_0x2ddfa9){return new BPromise(function(_0x3d44da,_0x55c136){try{if(_0x2ddfa9[_0x145081['id']]){_0x145081['Users']=_['map'](_0x2ddfa9[_0x145081['id']],function(_0xce8ad9){return{'id':_0xce8ad9['id'],'fullname':_0xce8ad9[_0x6e0c('0x36')]};});}}catch(_0x16d0ee){_0x55c136(_0x16d0ee);}_0x3d44da(_0x145081);});}function getInteractionTags(_0x84167a,_0x62017b){return new BPromise(function(_0x1a3352,_0x57845d){try{if(_0x84167a[_0x6e0c('0x37')]){_0x84167a[_0x6e0c('0x38')]=[];_0x84167a[_0x6e0c('0x37')][_0x6e0c('0x39')](',')[_0x6e0c('0x3a')](function(_0x4f018f){_0x84167a['Tags'][_0x6e0c('0x3b')](_0x62017b[_0x4f018f]);});}delete _0x84167a['TagIds'];}catch(_0x41f0b8){_0x57845d(_0x41f0b8);}_0x1a3352(_0x84167a);});}function updateSmsInteraction(_0x3c254e,_0x493e0f,_0x3e06de){return new BPromise(function(_0x35d4b6,_0x4f99c8){return getInteractionUsers(_0x3c254e,_0x3e06de)[_0x6e0c('0x31')](function(_0x1a15d4){return getInteractionTags(_0x1a15d4,_0x493e0f);})[_0x6e0c('0x31')](function(_0x40d4ce){_0x35d4b6(_0x40d4ce);})[_0x6e0c('0x3c')](function(_0x591342){_0x4f99c8(_0x591342);});});}exports[_0x6e0c('0x3d')]=function(_0x429f3f,_0x47321f){var _0xcf8d77={},_0x520cc6={},_0x1b2bf1={'count':0x0,'rows':[]};var _0x1d1401=_[_0x6e0c('0x3e')](db[_0x6e0c('0x3f')]['rawAttributes'],function(_0x4e3483){return{'name':_0x4e3483[_0x6e0c('0x40')],'type':_0x4e3483[_0x6e0c('0x41')][_0x6e0c('0x42')]};});_0x520cc6[_0x6e0c('0x43')]=_[_0x6e0c('0x3e')](_0x1d1401,_0x6e0c('0x34'));_0x520cc6[_0x6e0c('0x44')]=_[_0x6e0c('0x45')](_0x429f3f['query']);_0x520cc6['filters']=_[_0x6e0c('0x46')](_0x520cc6[_0x6e0c('0x43')],_0x520cc6[_0x6e0c('0x44')]);_0xcf8d77[_0x6e0c('0x47')]=_[_0x6e0c('0x46')](_0x520cc6[_0x6e0c('0x43')],qs[_0x6e0c('0x48')](_0x429f3f['query'][_0x6e0c('0x48')]));_0xcf8d77[_0x6e0c('0x47')]=_0xcf8d77[_0x6e0c('0x47')][_0x6e0c('0x49')]?_0xcf8d77[_0x6e0c('0x47')]:_0x520cc6[_0x6e0c('0x43')];if(!_0x429f3f[_0x6e0c('0x44')]['hasOwnProperty'](_0x6e0c('0x4a'))){_0xcf8d77['limit']=qs[_0x6e0c('0x29')](_0x429f3f[_0x6e0c('0x44')]['limit']);_0xcf8d77['offset']=qs['offset'](_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x27')]);}_0xcf8d77[_0x6e0c('0x4b')]=qs['sort'](_0x429f3f['query'][_0x6e0c('0x4c')]);_0xcf8d77[_0x6e0c('0x4d')]=qs['filters'](_[_0x6e0c('0x4e')](_0x429f3f[_0x6e0c('0x44')],_0x520cc6[_0x6e0c('0x4f')]),_0x1d1401);var _0x4d0379=[];var _0x1088f0=squel[_0x6e0c('0x50')]()['field']('id')[_0x6e0c('0x51')]('name')[_0x6e0c('0x51')](_0x6e0c('0x52'))[_0x6e0c('0x53')]('tools_tags');var _0xa00e34=squel['select']()[_0x6e0c('0x51')](_0x6e0c('0x54'))[_0x6e0c('0x51')](_0x6e0c('0x55'))['field'](_0x6e0c('0x56'))[_0x6e0c('0x53')]('user_has_sms_interactions','ui')[_0x6e0c('0x57')](_0x6e0c('0x58'),'u',_0x6e0c('0x59'));var _0x22f037=squel[_0x6e0c('0x50')]()[_0x6e0c('0x53')](_0x6e0c('0x5a'),'i')[_0x6e0c('0x57')](_0x6e0c('0x5b'),'c',_0x6e0c('0x5c'))[_0x6e0c('0x57')](_0x6e0c('0x58'),'o','o.id\x20=\x20i.UserId')[_0x6e0c('0x57')](_0x6e0c('0x5d'),'a',_0x6e0c('0x5e'))[_0x6e0c('0x57')](_0x6e0c('0x5f'),'me',_0x6e0c('0x60'))[_0x6e0c('0x57')]('sms_interaction_has_tags','it',_0x6e0c('0x61'))[_0x6e0c('0x57')]('tools_tags','t',_0x6e0c('0x62'));var _0x21711f=squel[_0x6e0c('0x63')]();var _0x238f23=[];var _0x12998=squel[_0x6e0c('0x63')]();var _0x30f690;if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x64')]){_0x30f690=as['parseSearch'](_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x64')]);var _0x264626=_0x30f690['sqlOperator'];for(var _0x384189=0x0;_0x384189<_0x30f690[_0x6e0c('0x65')][_0x6e0c('0x49')];_0x384189++){var _0x34ea2c=_0x30f690[_0x6e0c('0x65')][_0x384189];var _0x4c0b84='i';var _0x2e569a=_[_0x6e0c('0x66')](_0x1d1401,[_0x6e0c('0x34'),_0x34ea2c[_0x6e0c('0x51')]]);if(!_0x2e569a){switch(_0x34ea2c[_0x6e0c('0x51')]){case _0x6e0c('0x67'):if(_0x34ea2c[_0x6e0c('0x68')]==0x1){_0x22f037[_0x6e0c('0x69')]('`'+_0x34ea2c['field']+_0x6e0c('0x6a'));}else{_0x22f037[_0x6e0c('0x69')]('`'+_0x34ea2c['field']+'`\x20>\x200');}break;case'Contact':if(_0x34ea2c[_0x6e0c('0x6b')]===_0x6e0c('0x6c')){if(_0x34ea2c['value'][_0x6e0c('0x39')]('\x20')['length']>0x1){_0x21711f[_0x264626](_0x6e0c('0x6d'),qs[_0x6e0c('0x6e')](_0x34ea2c[_0x6e0c('0x68')]),null);}else{var _0x517d5c='%'+_0x34ea2c['value']+'%';_0x21711f[_0x264626](_0x6e0c('0x6f'),_0x517d5c,_0x517d5c,_0x517d5c);}}else{_0x2e569a=_[_0x6e0c('0x66')](_0x1d1401,[_0x6e0c('0x34'),'ContactId']);_0x34ea2c[_0x6e0c('0x51')]='ContactId';_0x332364=as[_0x6e0c('0x70')](_0x4c0b84,_0x2e569a['type'],_0x34ea2c);_0x21711f[_0x264626](_0x332364['text'],_0x332364[_0x6e0c('0x68')][_0x6e0c('0x71')],_0x332364[_0x6e0c('0x68')]['end']);}break;case _0x6e0c('0x72'):var _0xf82f65=_0x34ea2c[_0x6e0c('0x68')][_0x6e0c('0x39')](',')[_0x6e0c('0x3e')](function(_0x501b02){return Number(_0x501b02);});_0xf82f65[_0x6e0c('0x3a')](function(_0x18830a){_0x12998['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18830a+',%');});_0x238f23=_[_0x6e0c('0x73')](_0x238f23,_0xf82f65);break;case _0x6e0c('0x74'):if(_0x34ea2c[_0x6e0c('0x6b')]==='$substring'){_0x21711f[_0x264626](_0x6e0c('0x75'),'%'+_0x34ea2c[_0x6e0c('0x68')]+'%',null);}else{_0x2e569a=_['find'](_0x1d1401,[_0x6e0c('0x34'),'UserId']);_0x34ea2c['field']='UserId';_0x332364=as['buildExpression'](_0x4c0b84,_0x2e569a[_0x6e0c('0x41')],_0x34ea2c);_0x21711f[_0x264626](_0x332364[_0x6e0c('0x76')],_0x332364['value'][_0x6e0c('0x71')],_0x332364['value'][_0x6e0c('0x25')]);}break;case _0x6e0c('0x77'):_0x332364=as[_0x6e0c('0x70')]('me',null,_0x34ea2c);_0x21711f[_0x264626](_0x332364[_0x6e0c('0x76')],_0x332364[_0x6e0c('0x68')][_0x6e0c('0x71')],_0x332364['value'][_0x6e0c('0x25')]);break;}}else{var _0x332364=as[_0x6e0c('0x70')](_0x4c0b84,_0x2e569a['type'],_0x34ea2c);_0x21711f[_0x264626](_0x332364[_0x6e0c('0x76')],_0x332364[_0x6e0c('0x68')][_0x6e0c('0x71')],_0x332364['value'][_0x6e0c('0x25')]);}}}else{var _0x4a2fd7=_(_0x429f3f[_0x6e0c('0x44')])[_0x6e0c('0x45')]()[_0x6e0c('0x3e')](function(_0x1c223e){return _['some'](_0x1d1401,['name',_0x1c223e])?_0x1c223e:undefined;})[_0x6e0c('0x78')]()[_0x6e0c('0x68')]();if(!_[_0x6e0c('0x79')](_0x4a2fd7)){_0x4a2fd7[_0x6e0c('0x3a')](function(_0x523c9f){if(_0x523c9f===_0x6e0c('0x7a')){_0x22f037[_0x6e0c('0x4d')](_0x6e0c('0x7b'),[][_0x6e0c('0x7c')](_0x429f3f[_0x6e0c('0x44')][_0x523c9f]));}else if(_0x523c9f===_0x6e0c('0x7d')){var _0x1b4175=JSON[_0x6e0c('0x7e')](_0x429f3f[_0x6e0c('0x44')][_0x523c9f])[_0x6e0c('0x7f')];var _0x433db9=JSON[_0x6e0c('0x7e')](_0x429f3f[_0x6e0c('0x44')][_0x523c9f])['$lte'];_0x22f037['where'](_0x6e0c('0x80'),_0x1b4175,_0x433db9);}else{if(_0x429f3f['query'][_0x523c9f]===_0x6e0c('0x81')){_0x22f037[_0x6e0c('0x4d')]('i.'+_0x523c9f+_0x6e0c('0x82'));}else{_0x22f037['where']('i.'+_0x523c9f+_0x6e0c('0x83'),_0x429f3f['query'][_0x523c9f]);}}});}if(_0x429f3f[_0x6e0c('0x44')]['read']){if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x84')]==0x1){_0x22f037[_0x6e0c('0x69')](_0x6e0c('0x85'));}else{_0x22f037['having'](_0x6e0c('0x86'));}}if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x87')]){_0x238f23=_[_0x6e0c('0x88')](_0x429f3f['query'][_0x6e0c('0x87')])?_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x87')]:new Array(_0x429f3f['query'][_0x6e0c('0x87')]);_0x238f23[_0x6e0c('0x3a')](function(_0x4cecd8){_0x12998['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4cecd8+',%');});}if(_0x429f3f[_0x6e0c('0x44')]['filter']){var _0x317aba=_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x89')][_0x6e0c('0x8a')]('\x5c','\x5c\x5c')[_0x6e0c('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x317aba)){_0x21711f['or'](_0x6e0c('0x8b'),_0x317aba+'%')['or'](_0x6e0c('0x8c'),_0x317aba+'%');}else{_0x21711f['or'](_0x6e0c('0x8d'),qs[_0x6e0c('0x6e')](_0x317aba))['or'](_0x6e0c('0x8e'),_0x317aba+'%');}}}_0x22f037[_0x6e0c('0x4d')](_0x21711f);_0x22f037[_0x6e0c('0x8f')](_0x6e0c('0x90'));var _0x43af9a={'type':db[_0x6e0c('0x91')][_0x6e0c('0x92')][_0x6e0c('0x93')],'raw':!![]};var _0x122435=_0x22f037['clone']();_0x122435[_0x6e0c('0x51')]('i.id');_0x122435['field'](_0x6e0c('0x94'),_0x6e0c('0x67'));if(_0xcf8d77[_0x6e0c('0x4b')]){_0xcf8d77[_0x6e0c('0x4b')]['forEach'](function(_0x5512ae){var _0x44b47f=_0x5512ae[0x0]===_0x6e0c('0x95')?_0x5512ae[0x0]:'i.'+_0x5512ae[0x0];_0x22f037[_0x6e0c('0x4b')](_0x44b47f,_0x5512ae[0x1]===_0x6e0c('0x96')?![]:!![]);});}if(!_[_0x6e0c('0x79')](_0x238f23)){_0x22f037['having'](_0x12998);_0x122435['where']('t.id\x20IN\x20?',_0x238f23);}BPromise['resolve']()[_0x6e0c('0x31')](function(){if(!_0x30f690){if(_0x429f3f[_0x6e0c('0x44')]['SmsAccountId'])return;_0x122435[_0x6e0c('0x4d')](_0x6e0c('0x97'));_0x22f037['where'](_0x6e0c('0x97'));return;}if(_0x429f3f[_0x6e0c('0x98')][_0x6e0c('0x99')]!==_0x6e0c('0x9a'))return;return _0x429f3f[_0x6e0c('0x98')][_0x6e0c('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12d674){if(_[_0x6e0c('0x79')](_0x12d674)){_0x122435['where']('i.SmsAccountId\x20IS\x20NULL');_0x22f037[_0x6e0c('0x4d')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x122435[_0x6e0c('0x4d')]('i.SmsAccountId\x20IN\x20?',_[_0x6e0c('0x3e')](_0x12d674,'id'));_0x22f037[_0x6e0c('0x4d')]('i.SmsAccountId\x20IN\x20?',_[_0x6e0c('0x3e')](_0x12d674,'id'));}});})[_0x6e0c('0x31')](function(){if(_0x429f3f[_0x6e0c('0x98')][_0x6e0c('0x99')]===_0x6e0c('0x9a')&&!_0x30f690&&!_0x429f3f[_0x6e0c('0x44')]['SmsAccountId'])return[];return db[_0x6e0c('0x9c')][_0x6e0c('0x44')](_0x122435['toString'](),_0x43af9a);})['then'](function(_0x590340){_0x1b2bf1[_0x6e0c('0x2a')]=_0x590340[_0x6e0c('0x49')];if(_0x1b2bf1[_0x6e0c('0x2a')]===0x0)return[];return db[_0x6e0c('0x9c')][_0x6e0c('0x44')](_0x1088f0[_0x6e0c('0x9d')](),_0x43af9a)['then'](function(_0x199929){_0x4d0379=_[_0x6e0c('0x9e')](_0x199929,'id');_0x43af9a=_[_0x6e0c('0x9f')](_0x43af9a,{'model':db[_0x6e0c('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x429f3f[_0x6e0c('0x44')][_0x6e0c('0x48')]){_0xcf8d77['attributes']['forEach'](function(_0x282edb){_0x22f037[_0x6e0c('0x51')]('i.'+_0x282edb);});}else{_0x22f037[_0x6e0c('0x51')](_0x6e0c('0x94'),_0x6e0c('0x67'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa0'),_0x6e0c('0xa1'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa2'),_0x6e0c('0xa3'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa4'),_0x6e0c('0x95'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa5'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa6'),_0x6e0c('0xa7'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xa8'),_0x6e0c('0xa9'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xaa'),_0x6e0c('0xab'));_0x22f037['field'](_0x6e0c('0xac'),_0x6e0c('0xad'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xae'),_0x6e0c('0xaf'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xb0'),_0x6e0c('0xb1'));_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xb2'),'Owner.fullname');_0x22f037[_0x6e0c('0x51')](_0x6e0c('0xb3'),'Owner.internal');_0x22f037['field'](_0x6e0c('0xb4'),_0x6e0c('0x37'));}if(_0xcf8d77[_0x6e0c('0x29')])_0x22f037[_0x6e0c('0x29')](_0xcf8d77[_0x6e0c('0x29')]);if(_0xcf8d77[_0x6e0c('0x27')])_0x22f037[_0x6e0c('0x27')](_0xcf8d77[_0x6e0c('0x27')]);return db['sequelize']['query'](_0x22f037[_0x6e0c('0x9d')](),_0x43af9a);})[_0x6e0c('0x31')](function(_0x56c5ba){if(_0x56c5ba[_0x6e0c('0x49')]>0x0)_0xa00e34[_0x6e0c('0x4d')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x56c5ba,'id'));return db[_0x6e0c('0x9c')][_0x6e0c('0x44')](_0xa00e34['toString'](),_0x43af9a)[_0x6e0c('0x31')](function(_0x4239b3){var _0x38f785=_[_0x6e0c('0xb5')](_0x4239b3,_0x6e0c('0xb6'));var _0x1d898d=[];_0x56c5ba[_0x6e0c('0x3a')](function(_0x34b989){_0x1d898d['push'](updateSmsInteraction(_0x34b989,_0x4d0379,_0x38f785));});return BPromise['all'](_0x1d898d);});});})[_0x6e0c('0x31')](function(_0x122715){_0x1b2bf1[_0x6e0c('0xb7')]=_0x122715;return _0x1b2bf1;})[_0x6e0c('0x31')](respondWithFilteredResult(_0x47321f,_0xcf8d77))[_0x6e0c('0x3c')](handleError(_0x47321f,null));};exports[_0x6e0c('0xb8')]=function(_0x587472,_0x12ff57){var _0x388e9d={'raw':![],'where':{'id':_0x587472[_0x6e0c('0xb9')]['id']}},_0x254600={};_0x254600[_0x6e0c('0x43')]=_[_0x6e0c('0x45')](db[_0x6e0c('0x3f')][_0x6e0c('0xba')]);_0x254600['query']=_['keys'](_0x587472[_0x6e0c('0x44')]);_0x254600[_0x6e0c('0x4f')]=_[_0x6e0c('0x46')](_0x254600['model'],_0x254600['query']);_0x388e9d[_0x6e0c('0x47')]=_[_0x6e0c('0x46')](_0x254600[_0x6e0c('0x43')],qs[_0x6e0c('0x48')](_0x587472['query'][_0x6e0c('0x48')]));_0x388e9d[_0x6e0c('0x47')]=_0x388e9d[_0x6e0c('0x47')][_0x6e0c('0x49')]?_0x388e9d[_0x6e0c('0x47')]:_0x254600[_0x6e0c('0x43')];if(_0x587472[_0x6e0c('0x44')][_0x6e0c('0xbb')]){_0x388e9d[_0x6e0c('0xbc')]=[{'all':!![]}];}_0x388e9d=_['merge']({},_0x388e9d,_0x587472[_0x6e0c('0xbd')]);return db[_0x6e0c('0x3f')]['find'](_0x388e9d)['then'](handleEntityNotFound(_0x12ff57,null))[_0x6e0c('0x31')](respondWithResult(_0x12ff57,null))[_0x6e0c('0x3c')](handleError(_0x12ff57,null));};exports[_0x6e0c('0xbe')]=function(_0x48227f,_0x4af23d){return db[_0x6e0c('0x3f')]['create'](_0x48227f[_0x6e0c('0x77')],{})[_0x6e0c('0x31')](respondWithResult(_0x4af23d,0xc9))['catch'](handleError(_0x4af23d,null));};exports[_0x6e0c('0x2f')]=function(_0x526bce,_0x4ea88f){if(_0x526bce[_0x6e0c('0x77')]['id']){delete _0x526bce[_0x6e0c('0x77')]['id'];}return db[_0x6e0c('0x3f')][_0x6e0c('0x66')]({'where':{'id':_0x526bce[_0x6e0c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x4ea88f,null))['then'](saveUpdates(_0x526bce[_0x6e0c('0x77')],null))[_0x6e0c('0x31')](respondWithResult(_0x4ea88f,null))[_0x6e0c('0x3c')](handleError(_0x4ea88f,null));};exports[_0x6e0c('0x30')]=function(_0x2221f0,_0x283d95){return db['SmsInteraction'][_0x6e0c('0x66')]({'where':{'id':_0x2221f0[_0x6e0c('0xb9')]['id']}})[_0x6e0c('0x31')](handleEntityNotFound(_0x283d95,null))[_0x6e0c('0x31')](removeEntity(_0x283d95,null))[_0x6e0c('0x3c')](handleError(_0x283d95,null));};exports['describe']=function(_0x5d62af,_0x1060a0){return db[_0x6e0c('0x3f')][_0x6e0c('0xbf')]()[_0x6e0c('0x31')](respondWithResult(_0x1060a0,null))[_0x6e0c('0x3c')](handleError(_0x1060a0,null));};exports['addMessage']=function(_0x4b596d,_0xf6f3bc,_0x51aa2b){return db[_0x6e0c('0xc0')][_0x6e0c('0x66')]({'where':{'id':_0x4b596d[_0x6e0c('0xb9')]['id']}})['then'](handleEntityNotFound(_0xf6f3bc,null))[_0x6e0c('0x31')](function(_0x2e99d4){if(_0x2e99d4){return _0x2e99d4[_0x6e0c('0xc1')](_0x4b596d['body'][_0x6e0c('0xc2')],_[_0x6e0c('0xc3')](_0x4b596d[_0x6e0c('0x77')],[_0x6e0c('0xc2'),'id'])||{});}})[_0x6e0c('0x31')](respondWithResult(_0xf6f3bc,null))['catch'](handleError(_0xf6f3bc,null));};exports['getMessages']=function(_0x117e78,_0x5e5b50,_0x36a872){var _0x5e333e={'raw':![],'where':{}};var _0x1c76ae={};var _0x5a18a7={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x6e0c('0xc4')]({'where':{'id':_0x117e78['params']['id']}})[_0x6e0c('0x31')](handleEntityNotFound(_0x5e5b50,null))[_0x6e0c('0x31')](function(_0x2e9de3){if(_0x2e9de3){_0x1c76ae['model']=_[_0x6e0c('0x45')](db[_0x6e0c('0xc0')][_0x6e0c('0xba')]);_0x1c76ae['query']=_[_0x6e0c('0x45')](_0x117e78[_0x6e0c('0x44')]);_0x1c76ae[_0x6e0c('0x4f')]=_[_0x6e0c('0x46')](_0x1c76ae['model'],_0x1c76ae['query']);_0x5e333e['attributes']=_[_0x6e0c('0x46')](_0x1c76ae['model'],qs[_0x6e0c('0x48')](_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x48')]));_0x5e333e[_0x6e0c('0x47')]=_0x5e333e[_0x6e0c('0x47')]['length']?_0x5e333e['attributes']:_0x1c76ae[_0x6e0c('0x43')];if(!_0x117e78[_0x6e0c('0x44')][_0x6e0c('0xc5')](_0x6e0c('0x4a'))){_0x5e333e['limit']=qs[_0x6e0c('0x29')](_0x117e78['query']['limit']);_0x5e333e[_0x6e0c('0x27')]=qs['offset'](_0x117e78['query'][_0x6e0c('0x27')]);}_0x5e333e[_0x6e0c('0x4b')]=qs[_0x6e0c('0x4c')](_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x4c')]);_0x5e333e[_0x6e0c('0x4d')]=qs[_0x6e0c('0x4f')](_[_0x6e0c('0x4e')](_0x117e78[_0x6e0c('0x44')],_0x1c76ae[_0x6e0c('0x4f')]));_0x5e333e['where'][_0x6e0c('0xb6')]=_0x2e9de3['id'];if(_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x89')]){_0x5e333e['where']=_['merge'](_0x5e333e[_0x6e0c('0x4d')],{'$or':_['map'](_0x5e333e[_0x6e0c('0x47')],function(_0x3e6dc0){var _0x16dc13={};_0x16dc13[_0x3e6dc0]={'$like':'%'+_0x117e78['query'][_0x6e0c('0x89')]+'%'};return _0x16dc13;})});}if(_0x117e78[_0x6e0c('0x44')][_0x6e0c('0x7f')]){var _0x28250d=_0x117e78['query'][_0x6e0c('0x7f')][_0x6e0c('0x39')](',');var _0x217787={};_0x217787[_0x28250d[0x0]]={'$gte':moment(_0x28250d[0x1])[_0x6e0c('0xc6')](_0x6e0c('0xc7'))};_0x5e333e[_0x6e0c('0x4d')]=_[_0x6e0c('0x9f')](_0x5e333e['where'],_0x217787);}_0x5e333e=_[_0x6e0c('0x9f')]({},_0x5e333e,_0x117e78[_0x6e0c('0xbd')]);return db[_0x6e0c('0xc0')]['count']({'where':_0x5e333e[_0x6e0c('0x4d')]})[_0x6e0c('0x31')](function(_0x5af2de){_0x5a18a7['count']=_0x5af2de;if(_0x117e78[_0x6e0c('0x44')]['includeAll']){_0x5e333e[_0x6e0c('0xbc')]=[{'all':!![]}];}return db[_0x6e0c('0xc0')][_0x6e0c('0xc8')](_0x5e333e);})[_0x6e0c('0x31')](function(_0x3728ba){_0x5a18a7[_0x6e0c('0xb7')]=_0x3728ba;return _0x5a18a7;});}})[_0x6e0c('0x31')](respondWithFilteredResult(_0x5e5b50,_0x5e333e))[_0x6e0c('0x3c')](handleError(_0x5e5b50,null));};exports[_0x6e0c('0xc9')]=function(_0x261381,_0x22ef29,_0x1e50c9){return db[_0x6e0c('0x3f')][_0x6e0c('0x66')]({'where':{'id':_0x261381['params']['id']}})['then'](handleEntityNotFound(_0x22ef29,null))[_0x6e0c('0x31')](function(_0x2d2586){if(_0x2d2586){return _0x2d2586[_0x6e0c('0xca')](_0x261381[_0x6e0c('0x77')][_0x6e0c('0xc2')],_[_0x6e0c('0xc3')](_0x261381[_0x6e0c('0x77')],[_0x6e0c('0xc2'),'id'])||{})['spread'](function(){return db[_0x6e0c('0x72')]['findAll']({'attributes':['id',_0x6e0c('0x34'),_0x6e0c('0x52')],'where':{'id':_0x261381['body'][_0x6e0c('0xc2')]}});})[_0x6e0c('0x31')](function(_0x40a1f7){socket[_0x6e0c('0xcb')]('smsInteractionTags:save',{'id':Number(_0x261381[_0x6e0c('0xb9')]['id']),'tags':_0x40a1f7||[]});return{'id':Number(_0x261381[_0x6e0c('0xb9')]['id']),'tags':_0x40a1f7||[]};});}})[_0x6e0c('0x31')](respondWithResult(_0x22ef29,null))[_0x6e0c('0x3c')](handleError(_0x22ef29,null));};exports[_0x6e0c('0xcc')]=function(_0x20ede0,_0x2266fe,_0x5cbb79){return db['SmsInteraction'][_0x6e0c('0x66')]({'where':{'id':_0x20ede0[_0x6e0c('0xb9')]['id']}})[_0x6e0c('0x31')](handleEntityNotFound(_0x2266fe,null))[_0x6e0c('0x31')](function(_0x224238){if(_0x224238){return _0x224238[_0x6e0c('0xcc')](_0x20ede0['query'][_0x6e0c('0xc2')]);}})[_0x6e0c('0x31')](respondWithStatusCode(_0x2266fe,null))['catch'](handleError(_0x2266fe,null));};exports[_0x6e0c('0xcd')]=function(_0x210d05,_0x3ca3aa){var _0x53d3ec=moment()[_0x6e0c('0xce')]()[_0x6e0c('0x9d')]();var _0xbaec77=path[_0x6e0c('0xcf')](config[_0x6e0c('0xd0')],_0x6e0c('0xd1'),'files',_0x6e0c('0xd2'));var _0x2c40b2=path['join'](config[_0x6e0c('0xd0')],'server',_0x6e0c('0xd3'),_0x6e0c('0xd4'));var _0x975455=path['join'](_0xbaec77,_0x53d3ec);var _0x1aa0a3=util[_0x6e0c('0xc6')](_0x6e0c('0xd5'),_0x210d05[_0x6e0c('0xb9')]['id'],_0x53d3ec);var _0x356f19=path[_0x6e0c('0xcf')](_0xbaec77,_0x1aa0a3);var _0x3d1878=[];_0x3d1878[_0x6e0c('0x3b')]({'model':db[_0x6e0c('0x74')],'as':'User','attributes':['id',_0x6e0c('0x36')],'raw':!![]});_0x3d1878[_0x6e0c('0x3b')]({'model':db[_0x6e0c('0xd6')],'as':_0x6e0c('0xd7'),'attributes':['id',_0x6e0c('0xd8'),_0x6e0c('0xd9')],'raw':!![]});var _0x1bb2b8=[{'model':db[_0x6e0c('0xc0')],'as':'Messages','attributes':['id',_0x6e0c('0x77'),'createdAt',_0x6e0c('0xda'),_0x6e0c('0xdb'),_0x6e0c('0x84')],'include':_0x3d1878}];_0x1bb2b8['push']({'model':db['SmsAccount'],'as':_0x6e0c('0xdc'),'attributes':['id',_0x6e0c('0x34')]});_0x1bb2b8[_0x6e0c('0x3b')]({'model':db[_0x6e0c('0x74')],'as':_0x6e0c('0xdd'),'attributes':['id',_0x6e0c('0x36')]});return db[_0x6e0c('0x3f')][_0x6e0c('0x66')]({'where':{'id':_0x210d05[_0x6e0c('0xb9')]['id']},'include':_0x1bb2b8})[_0x6e0c('0x31')](handleEntityNotFound(_0x3ca3aa,null))[_0x6e0c('0x31')](function(_0x31bd3a){if(_0x31bd3a){var _0x3f45ff=_0x31bd3a[_0x6e0c('0xde')]({'plain':!![]});fs['mkdirSync'](_0x975455);var _0x45bf48={'channel':'Sms','account':_0x3f45ff[_0x6e0c('0xdc')][_0x6e0c('0x34')],'agent':_0x3f45ff[_0x6e0c('0xdd')]?_0x3f45ff[_0x6e0c('0xdd')][_0x6e0c('0x36')]:_0x6e0c('0xdf'),'createdAt':moment(_0x3f45ff['createdAt'])[_0x6e0c('0xc6')](_0x6e0c('0xc7'))[_0x6e0c('0x9d')](),'closedAt':_0x3f45ff['closed']?moment(_0x3f45ff[_0x6e0c('0xe0')])['format'](_0x6e0c('0xc7'))['toString']():'','disposition':_0x3f45ff[_0x6e0c('0xe1')],'messages':_(_0x3f45ff['Messages'])['filter']({'secret':![]})[_0x6e0c('0x3e')](function(_0x2bbd03){return{'date':moment(_0x2bbd03[_0x6e0c('0x7d')])[_0x6e0c('0xc6')](_0x6e0c('0xc7'))[_0x6e0c('0x9d')](),'sender':_0x2bbd03[_0x6e0c('0xda')]===_0x6e0c('0xe2')?_0x2bbd03[_0x6e0c('0x74')]?_0x2bbd03['User'][_0x6e0c('0x36')]:_0x6e0c('0xe3'):_0x2bbd03['Contact'][_0x6e0c('0xd8')]+(_0x2bbd03[_0x6e0c('0xd7')][_0x6e0c('0xd9')]?'\x20'+_0x2bbd03[_0x6e0c('0xd7')][_0x6e0c('0xd9')]:''),'body':_0x2bbd03[_0x6e0c('0x77')],'direction':_0x2bbd03[_0x6e0c('0xda')]===_0x6e0c('0xe2')?'A':'C','secret':_0x2bbd03[_0x6e0c('0xdb')],'read':_0x2bbd03[_0x6e0c('0x84')]};})[_0x6e0c('0x68')]()};return ejs[_0x6e0c('0xe4')](path[_0x6e0c('0xcf')](config[_0x6e0c('0xd0')],_0x6e0c('0xd1'),'views','downloadInteraction.ejs'),{'interaction':_0x45bf48})[_0x6e0c('0x31')](function(_0x2c7d35){var _0x4e47e9=path[_0x6e0c('0xcf')](_0x975455,_0x6e0c('0xe5')+_0x3f45ff['id']+'-'+_0x53d3ec+_0x6e0c('0xe6'));var _0x272c53={'path':_0x4e47e9,'channel':_0x6e0c('0xe7'),'interactionId':_0x3f45ff['id']};return pdf[_0x6e0c('0xe8')](_0x2c7d35,_0x272c53);})[_0x6e0c('0x31')](function(){return new BPromise(function(_0x2c84db,_0x5d12a7){zipdir(_0x975455,{'saveTo':_0x356f19},function(_0x4335e2,_0x9c673c){if(_0x4335e2)return _0x5d12a7(_0x4335e2);return _0x2c84db(_0x9c673c);});})['then'](function(){return new BPromise(function(_0x560750,_0xec7f7e){rimraf(_0x975455,function(_0x34692d){if(_0x34692d)_0xec7f7e(_0x34692d);return _0x560750();});});})[_0x6e0c('0x31')](function(){return _0x3ca3aa[_0x6e0c('0xcd')](_0x356f19,_0x1aa0a3,function(_0x1f8451){if(_0x1f8451){console[_0x6e0c('0xe9')](_0x6e0c('0xea'),_0x1f8451);}else{fs[_0x6e0c('0xeb')](_0x356f19);}});});});}else{return _0x3ca3aa['sendStatus'](0xc8);}})[_0x6e0c('0x3c')](handleError(_0x3ca3aa,null));}; \ No newline at end of file +var _0x95e0=['body','some','compact','isEmpty','SmsAccountId','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\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)','unreadMessages','order','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','includeAll','options','describe','addMessage','ids','findOne','SmsMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','omit','spread','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','disposition','out','System','firstName','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','fullname','Tags','TagIds','split','forEach','push','catch','index','map','SmsInteraction','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','select','field','tools_tags','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','buildExpression','type','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x17f5b7,_0x5c575c){var _0x4f6e7=function(_0x305da6){while(--_0x305da6){_0x17f5b7['push'](_0x17f5b7['shift']());}};_0x4f6e7(++_0x5c575c);}(_0x95e0,0x163));var _0x095e=function(_0x5cbb9c,_0x490dcb){_0x5cbb9c=_0x5cbb9c-0x0;var _0x5c3dda=_0x95e0[_0x5cbb9c];return _0x5c3dda;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x095e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x095e('0x1'));var moment=require(_0x095e('0x2'));var BPromise=require(_0x095e('0x3'));var Mustache=require(_0x095e('0x4'));var util=require('util');var path=require(_0x095e('0x5'));var sox=require(_0x095e('0x6'));var csv=require(_0x095e('0x7'));var ejs=require(_0x095e('0x8'));var fs=require('fs');var fs_extra=require(_0x095e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x095e('0xa'));var deskjs=require(_0x095e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x095e('0xc'));var Papa=require(_0x095e('0xd'));var Redis=require(_0x095e('0xe'));var authService=require(_0x095e('0xf'));var qs=require(_0x095e('0x10'));var as=require(_0x095e('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x095e('0x12'))('api');var utils=require(_0x095e('0x13'));var config=require(_0x095e('0x14'));var licenseUtil=require(_0x095e('0x15'));var db=require(_0x095e('0x16'))['db'];config[_0x095e('0x17')]=_[_0x095e('0x18')](config[_0x095e('0x17')],{'host':_0x095e('0x19'),'port':0x18eb});var socket=require(_0x095e('0x1a'))(new Redis(config[_0x095e('0x17')]));require('./smsInteraction.socket')[_0x095e('0x1b')](socket);function respondWithStatusCode(_0x2686fe,_0x1d1248){_0x1d1248=_0x1d1248||0xcc;return function(_0x54e9d3){if(_0x54e9d3){return _0x2686fe['sendStatus'](_0x1d1248);}return _0x2686fe[_0x095e('0x1c')](_0x1d1248)[_0x095e('0x1d')]();};}function respondWithResult(_0x818439,_0x139b3d){_0x139b3d=_0x139b3d||0xc8;return function(_0x332369){if(_0x332369){return _0x818439[_0x095e('0x1c')](_0x139b3d)[_0x095e('0x1e')](_0x332369);}};}function respondWithFilteredResult(_0x1fb9c5,_0x1bc05b){return function(_0x3d731a){if(_0x3d731a){var _0x55183a=typeof _0x1bc05b[_0x095e('0x1f')]===_0x095e('0x20')&&typeof _0x1bc05b[_0x095e('0x21')]===_0x095e('0x20');var _0x4fc7b2=_0x3d731a['count'];var _0x48e4b4=_0x55183a?0x0:_0x1bc05b[_0x095e('0x1f')];var _0x1f59fd=_0x55183a?_0x3d731a[_0x095e('0x22')]:_0x1bc05b[_0x095e('0x1f')]+_0x1bc05b[_0x095e('0x21')];var _0x2b4025;if(_0x1f59fd>=_0x4fc7b2){_0x1f59fd=_0x4fc7b2;_0x2b4025=0xc8;}else{_0x2b4025=0xce;}_0x1fb9c5['status'](_0x2b4025);return _0x1fb9c5[_0x095e('0x23')](_0x095e('0x24'),_0x48e4b4+'-'+_0x1f59fd+'/'+_0x4fc7b2)[_0x095e('0x1e')](_0x3d731a);}return null;};}function patchUpdates(_0x5cf027){return function(_0x44f7c4){try{jsonpatch[_0x095e('0x25')](_0x44f7c4,_0x5cf027,!![]);}catch(_0x411c81){return BPromise[_0x095e('0x26')](_0x411c81);}return _0x44f7c4[_0x095e('0x27')]();};}function saveUpdates(_0x55a0b7,_0x59eb9f){return function(_0x3a57ae){if(_0x3a57ae){return _0x3a57ae[_0x095e('0x28')](_0x55a0b7)[_0x095e('0x29')](function(_0x1490cd){return _0x1490cd;});}return null;};}function removeEntity(_0x5d2ce8,_0x581ec1){return function(_0x175dac){if(_0x175dac){return _0x175dac[_0x095e('0x2a')]()[_0x095e('0x29')](function(){_0x5d2ce8[_0x095e('0x1c')](0xcc)[_0x095e('0x1d')]();});}};}function handleEntityNotFound(_0x22764d,_0x524b7e){return function(_0x3897b0){if(!_0x3897b0){_0x22764d[_0x095e('0x2b')](0x194);}return _0x3897b0;};}function handleError(_0x35da02,_0x199add){_0x199add=_0x199add||0x1f4;return function(_0x21652f){logger[_0x095e('0x2c')](_0x21652f[_0x095e('0x2d')]);if(_0x21652f[_0x095e('0x2e')]){delete _0x21652f[_0x095e('0x2e')];}_0x35da02['status'](_0x199add)[_0x095e('0x2f')](_0x21652f);};}function getInteractionUsers(_0x54f507,_0x4efbdc){return new BPromise(function(_0x39afed,_0x1605d8){try{if(_0x4efbdc[_0x54f507['id']]){_0x54f507['Users']=_['map'](_0x4efbdc[_0x54f507['id']],function(_0x2b066a){return{'id':_0x2b066a['id'],'fullname':_0x2b066a[_0x095e('0x30')]};});}}catch(_0x3ddf2e){_0x1605d8(_0x3ddf2e);}_0x39afed(_0x54f507);});}function getInteractionTags(_0x56e524,_0xde3942){return new BPromise(function(_0x3ad817,_0x35b57d){try{if(_0x56e524['TagIds']){_0x56e524[_0x095e('0x31')]=[];_0x56e524[_0x095e('0x32')][_0x095e('0x33')](',')[_0x095e('0x34')](function(_0x469e41){_0x56e524[_0x095e('0x31')][_0x095e('0x35')](_0xde3942[_0x469e41]);});}delete _0x56e524[_0x095e('0x32')];}catch(_0x432921){_0x35b57d(_0x432921);}_0x3ad817(_0x56e524);});}function updateSmsInteraction(_0x9e67,_0x4dbf2f,_0x51814e){return new BPromise(function(_0xec1904,_0x245dab){return getInteractionUsers(_0x9e67,_0x51814e)[_0x095e('0x29')](function(_0x48ab7e){return getInteractionTags(_0x48ab7e,_0x4dbf2f);})[_0x095e('0x29')](function(_0x3bea44){_0xec1904(_0x3bea44);})[_0x095e('0x36')](function(_0x3140ba){_0x245dab(_0x3140ba);});});}exports[_0x095e('0x37')]=function(_0x27664a,_0x39e8c1){var _0x1b9c85={},_0x3a5d61={},_0x499f75={'count':0x0,'rows':[]};var _0x4f16ab=_[_0x095e('0x38')](db[_0x095e('0x39')][_0x095e('0x3a')],function(_0x2e09c9){return{'name':_0x2e09c9['fieldName'],'type':_0x2e09c9['type'][_0x095e('0x3b')]};});_0x3a5d61[_0x095e('0x3c')]=_[_0x095e('0x38')](_0x4f16ab,_0x095e('0x2e'));_0x3a5d61[_0x095e('0x3d')]=_[_0x095e('0x3e')](_0x27664a['query']);_0x3a5d61[_0x095e('0x3f')]=_['intersection'](_0x3a5d61[_0x095e('0x3c')],_0x3a5d61['query']);_0x1b9c85[_0x095e('0x40')]=_[_0x095e('0x41')](_0x3a5d61[_0x095e('0x3c')],qs[_0x095e('0x42')](_0x27664a[_0x095e('0x3d')]['fields']));_0x1b9c85[_0x095e('0x40')]=_0x1b9c85[_0x095e('0x40')]['length']?_0x1b9c85[_0x095e('0x40')]:_0x3a5d61[_0x095e('0x3c')];if(!_0x27664a[_0x095e('0x3d')][_0x095e('0x43')]('nolimit')){_0x1b9c85[_0x095e('0x21')]=qs['limit'](_0x27664a['query'][_0x095e('0x21')]);_0x1b9c85[_0x095e('0x1f')]=qs['offset'](_0x27664a[_0x095e('0x3d')][_0x095e('0x1f')]);}_0x1b9c85['order']=qs[_0x095e('0x44')](_0x27664a[_0x095e('0x3d')]['sort']);_0x1b9c85['where']=qs[_0x095e('0x3f')](_[_0x095e('0x45')](_0x27664a['query'],_0x3a5d61[_0x095e('0x3f')]),_0x4f16ab);var _0x3330ba=[];var _0x48e119=squel[_0x095e('0x46')]()['field']('id')[_0x095e('0x47')](_0x095e('0x2e'))['field']('color')['from'](_0x095e('0x48'));var _0x54bd5d=squel[_0x095e('0x46')]()[_0x095e('0x47')](_0x095e('0x49'))[_0x095e('0x47')]('u.fullname')['field'](_0x095e('0x4a'))[_0x095e('0x4b')](_0x095e('0x4c'),'ui')[_0x095e('0x4d')](_0x095e('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x13a520=squel['select']()['from'](_0x095e('0x4f'),'i')[_0x095e('0x4d')](_0x095e('0x50'),'c',_0x095e('0x51'))['left_join'](_0x095e('0x4e'),'o',_0x095e('0x52'))[_0x095e('0x4d')](_0x095e('0x53'),'a',_0x095e('0x54'))['left_join'](_0x095e('0x55'),'me',_0x095e('0x56'))['left_join']('sms_interaction_has_tags','it',_0x095e('0x57'))[_0x095e('0x4d')]('tools_tags','t',_0x095e('0x58'));var _0x3f643b=squel[_0x095e('0x59')]();var _0x36a3ff=[];var _0x6dd360=squel[_0x095e('0x59')]();var _0x5883a7;if(_0x27664a[_0x095e('0x3d')][_0x095e('0x5a')]){_0x5883a7=as[_0x095e('0x5b')](_0x27664a[_0x095e('0x3d')]['search']);var _0x275b75=_0x5883a7['sqlOperator'];for(var _0x5b74b8=0x0;_0x5b74b8<_0x5883a7['conditions'][_0x095e('0x5c')];_0x5b74b8++){var _0x20323d=_0x5883a7['conditions'][_0x5b74b8];var _0x52b051='i';var _0x29bd9d=_[_0x095e('0x5d')](_0x4f16ab,[_0x095e('0x2e'),_0x20323d[_0x095e('0x47')]]);if(!_0x29bd9d){switch(_0x20323d[_0x095e('0x47')]){case'unreadMessages':if(_0x20323d[_0x095e('0x5e')]==0x1){_0x13a520[_0x095e('0x5f')]('`'+_0x20323d['field']+_0x095e('0x60'));}else{_0x13a520[_0x095e('0x5f')]('`'+_0x20323d[_0x095e('0x47')]+_0x095e('0x61'));}break;case _0x095e('0x62'):if(_0x20323d['operator']===_0x095e('0x63')){if(_0x20323d[_0x095e('0x5e')][_0x095e('0x33')]('\x20')[_0x095e('0x5c')]>0x1){_0x3f643b[_0x275b75](_0x095e('0x64'),qs[_0x095e('0x65')](_0x20323d[_0x095e('0x5e')]),null);}else{var _0x1b439='%'+_0x20323d['value']+'%';_0x3f643b[_0x275b75]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1b439,_0x1b439,_0x1b439);}}else{_0x29bd9d=_['find'](_0x4f16ab,[_0x095e('0x2e'),'ContactId']);_0x20323d[_0x095e('0x47')]='ContactId';_0x698e7f=as[_0x095e('0x66')](_0x52b051,_0x29bd9d[_0x095e('0x67')],_0x20323d);_0x3f643b[_0x275b75](_0x698e7f[_0x095e('0x68')],_0x698e7f[_0x095e('0x5e')][_0x095e('0x69')],_0x698e7f[_0x095e('0x5e')]['end']);}break;case _0x095e('0x6a'):var _0x3f98ea=_0x20323d[_0x095e('0x5e')][_0x095e('0x33')](',')[_0x095e('0x38')](function(_0x30ef68){return Number(_0x30ef68);});_0x3f98ea[_0x095e('0x34')](function(_0x1bbd34){_0x6dd360['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1bbd34+',%');});_0x36a3ff=_[_0x095e('0x6b')](_0x36a3ff,_0x3f98ea);break;case _0x095e('0x6c'):if(_0x20323d[_0x095e('0x6d')]===_0x095e('0x63')){_0x3f643b[_0x275b75](_0x095e('0x6e'),'%'+_0x20323d[_0x095e('0x5e')]+'%',null);}else{_0x29bd9d=_['find'](_0x4f16ab,[_0x095e('0x2e'),'UserId']);_0x20323d[_0x095e('0x47')]='UserId';_0x698e7f=as['buildExpression'](_0x52b051,_0x29bd9d[_0x095e('0x67')],_0x20323d);_0x3f643b[_0x275b75](_0x698e7f[_0x095e('0x68')],_0x698e7f[_0x095e('0x5e')]['start'],_0x698e7f[_0x095e('0x5e')]['end']);}break;case _0x095e('0x6f'):_0x698e7f=as[_0x095e('0x66')]('me',null,_0x20323d);_0x3f643b[_0x275b75](_0x698e7f[_0x095e('0x68')],_0x698e7f[_0x095e('0x5e')][_0x095e('0x69')],_0x698e7f[_0x095e('0x5e')]['end']);break;}}else{var _0x698e7f=as[_0x095e('0x66')](_0x52b051,_0x29bd9d[_0x095e('0x67')],_0x20323d);_0x3f643b[_0x275b75](_0x698e7f[_0x095e('0x68')],_0x698e7f['value'][_0x095e('0x69')],_0x698e7f[_0x095e('0x5e')][_0x095e('0x1d')]);}}}else{var _0x40f2b8=_(_0x27664a[_0x095e('0x3d')])['keys']()[_0x095e('0x38')](function(_0x8fd63a){return _[_0x095e('0x70')](_0x4f16ab,[_0x095e('0x2e'),_0x8fd63a])?_0x8fd63a:undefined;})[_0x095e('0x71')]()[_0x095e('0x5e')]();if(!_[_0x095e('0x72')](_0x40f2b8)){_0x40f2b8['forEach'](function(_0x4943e0){if(_0x4943e0===_0x095e('0x73')){_0x13a520['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x27664a['query'][_0x4943e0]));}else if(_0x4943e0==='createdAt'){var _0x227b50=JSON[_0x095e('0x74')](_0x27664a['query'][_0x4943e0])[_0x095e('0x75')];var _0xa4706f=JSON['parse'](_0x27664a[_0x095e('0x3d')][_0x4943e0])[_0x095e('0x76')];_0x13a520[_0x095e('0x77')](_0x095e('0x78'),_0x227b50,_0xa4706f);}else{if(_0x27664a[_0x095e('0x3d')][_0x4943e0]===_0x095e('0x79')){_0x13a520[_0x095e('0x77')]('i.'+_0x4943e0+'\x20IS\x20NULL');}else{_0x13a520[_0x095e('0x77')]('i.'+_0x4943e0+_0x095e('0x7a'),_0x27664a[_0x095e('0x3d')][_0x4943e0]);}}});}if(_0x27664a['query'][_0x095e('0x7b')]){if(_0x27664a['query'][_0x095e('0x7b')]==0x1){_0x13a520['having'](_0x095e('0x7c'));}else{_0x13a520[_0x095e('0x5f')](_0x095e('0x7d'));}}if(_0x27664a[_0x095e('0x3d')]['tag']){_0x36a3ff=_[_0x095e('0x7e')](_0x27664a[_0x095e('0x3d')][_0x095e('0x7f')])?_0x27664a['query'][_0x095e('0x7f')]:new Array(_0x27664a[_0x095e('0x3d')]['tag']);_0x36a3ff[_0x095e('0x34')](function(_0x2c9001){_0x6dd360['or'](_0x095e('0x80'),'%,'+_0x2c9001+',%');});}if(_0x27664a[_0x095e('0x3d')][_0x095e('0x81')]){var _0x55dbfd=_0x27664a[_0x095e('0x3d')][_0x095e('0x81')]['replace']('\x5c','\x5c\x5c')[_0x095e('0x82')](/'/g,'\x27\x27');if(qs[_0x095e('0x83')](_0x55dbfd)){_0x3f643b['or'](_0x095e('0x84'),_0x55dbfd+'%')['or'](_0x095e('0x85'),_0x55dbfd+'%');}else{_0x3f643b['or'](_0x095e('0x86'),qs[_0x095e('0x65')](_0x55dbfd))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x55dbfd+'%');}}}_0x13a520[_0x095e('0x77')](_0x3f643b);_0x13a520[_0x095e('0x87')](_0x095e('0x88'));var _0x1e9eeb={'type':db[_0x095e('0x89')][_0x095e('0x8a')][_0x095e('0x8b')],'raw':!![]};var _0x179361=_0x13a520[_0x095e('0x8c')]();_0x179361[_0x095e('0x47')](_0x095e('0x88'));_0x179361[_0x095e('0x47')](_0x095e('0x8d'),_0x095e('0x8e'));if(_0x1b9c85[_0x095e('0x8f')]){_0x1b9c85[_0x095e('0x8f')]['forEach'](function(_0x2cb6d1){var _0x1ec556=_0x2cb6d1[0x0]==='contactName'?_0x2cb6d1[0x0]:'i.'+_0x2cb6d1[0x0];_0x13a520['order'](_0x1ec556,_0x2cb6d1[0x1]===_0x095e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x36a3ff)){_0x13a520[_0x095e('0x5f')](_0x6dd360);_0x179361['where'](_0x095e('0x91'),_0x36a3ff);}BPromise['resolve']()['then'](function(){if(!_0x5883a7){if(_0x27664a[_0x095e('0x3d')][_0x095e('0x73')])return;_0x179361[_0x095e('0x77')](_0x095e('0x92'));_0x13a520['where'](_0x095e('0x92'));return;}if(_0x27664a['user'][_0x095e('0x93')]!==_0x095e('0x94'))return;return _0x27664a[_0x095e('0x95')][_0x095e('0x96')]({'attributes':['id'],'raw':!![]})[_0x095e('0x29')](function(_0x4a8393){if(_[_0x095e('0x72')](_0x4a8393)){_0x179361[_0x095e('0x77')]('i.SmsAccountId\x20IS\x20NULL');_0x13a520['where'](_0x095e('0x97'));}else{_0x179361[_0x095e('0x77')](_0x095e('0x98'),_[_0x095e('0x38')](_0x4a8393,'id'));_0x13a520[_0x095e('0x77')]('i.SmsAccountId\x20IN\x20?',_[_0x095e('0x38')](_0x4a8393,'id'));}});})[_0x095e('0x29')](function(){if(_0x27664a['user']['role']===_0x095e('0x94')&&!_0x5883a7&&!_0x27664a[_0x095e('0x3d')][_0x095e('0x73')])return[];return db['sequelize'][_0x095e('0x3d')](_0x179361[_0x095e('0x99')](),_0x1e9eeb);})[_0x095e('0x29')](function(_0x4b4d88){_0x499f75['count']=_0x4b4d88['length'];if(_0x499f75[_0x095e('0x22')]===0x0)return[];return db['sequelize'][_0x095e('0x3d')](_0x48e119[_0x095e('0x99')](),_0x1e9eeb)[_0x095e('0x29')](function(_0x5b5008){_0x3330ba=_['keyBy'](_0x5b5008,'id');_0x1e9eeb=_[_0x095e('0x9a')](_0x1e9eeb,{'model':db[_0x095e('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27664a[_0x095e('0x3d')][_0x095e('0x42')]){_0x1b9c85[_0x095e('0x40')][_0x095e('0x34')](function(_0x3822ae){_0x13a520[_0x095e('0x47')]('i.'+_0x3822ae);});}else{_0x13a520[_0x095e('0x47')](_0x095e('0x8d'),_0x095e('0x8e'));_0x13a520[_0x095e('0x47')](_0x095e('0x9b'),_0x095e('0x9c'));_0x13a520[_0x095e('0x47')](_0x095e('0x9d'),_0x095e('0x9e'));_0x13a520[_0x095e('0x47')](_0x095e('0x9f'),_0x095e('0xa0'));_0x13a520['field'](_0x095e('0xa1'));_0x13a520[_0x095e('0x47')](_0x095e('0xa2'),_0x095e('0xa3'));_0x13a520['field'](_0x095e('0xa4'),_0x095e('0xa5'));_0x13a520[_0x095e('0x47')]('c.email',_0x095e('0xa6'));_0x13a520[_0x095e('0x47')](_0x095e('0xa7'),'Contact.phone');_0x13a520[_0x095e('0x47')]('c.mobile',_0x095e('0xa8'));_0x13a520[_0x095e('0x47')](_0x095e('0xa9'),_0x095e('0xaa'));_0x13a520[_0x095e('0x47')](_0x095e('0xab'),_0x095e('0xac'));_0x13a520['field'](_0x095e('0xad'),'Owner.internal');_0x13a520[_0x095e('0x47')](_0x095e('0xae'),_0x095e('0x32'));}if(_0x1b9c85[_0x095e('0x21')])_0x13a520[_0x095e('0x21')](_0x1b9c85[_0x095e('0x21')]);if(_0x1b9c85['offset'])_0x13a520[_0x095e('0x1f')](_0x1b9c85['offset']);return db[_0x095e('0xaf')][_0x095e('0x3d')](_0x13a520['toString'](),_0x1e9eeb);})['then'](function(_0x4b45c4){if(_0x4b45c4[_0x095e('0x5c')]>0x0)_0x54bd5d[_0x095e('0x77')](_0x095e('0xb0'),_[_0x095e('0x38')](_0x4b45c4,'id'));return db['sequelize'][_0x095e('0x3d')](_0x54bd5d[_0x095e('0x99')](),_0x1e9eeb)[_0x095e('0x29')](function(_0x3fd187){var _0x5ecf72=_[_0x095e('0xb1')](_0x3fd187,_0x095e('0xb2'));var _0x54188a=[];_0x4b45c4['forEach'](function(_0x8203e2){_0x54188a[_0x095e('0x35')](updateSmsInteraction(_0x8203e2,_0x3330ba,_0x5ecf72));});return BPromise[_0x095e('0xb3')](_0x54188a);});});})[_0x095e('0x29')](function(_0x443c00){_0x499f75['rows']=_0x443c00;return _0x499f75;})['then'](respondWithFilteredResult(_0x39e8c1,_0x1b9c85))[_0x095e('0x36')](handleError(_0x39e8c1,null));};exports[_0x095e('0xb4')]=function(_0xb04d58,_0x19209b){var _0x1d185e={'raw':![],'where':{'id':_0xb04d58[_0x095e('0xb5')]['id']}},_0x4b25e1={};_0x4b25e1[_0x095e('0x3c')]=_['keys'](db[_0x095e('0x39')][_0x095e('0x3a')]);_0x4b25e1[_0x095e('0x3d')]=_[_0x095e('0x3e')](_0xb04d58[_0x095e('0x3d')]);_0x4b25e1[_0x095e('0x3f')]=_['intersection'](_0x4b25e1['model'],_0x4b25e1['query']);_0x1d185e[_0x095e('0x40')]=_[_0x095e('0x41')](_0x4b25e1[_0x095e('0x3c')],qs[_0x095e('0x42')](_0xb04d58['query'][_0x095e('0x42')]));_0x1d185e[_0x095e('0x40')]=_0x1d185e['attributes']['length']?_0x1d185e[_0x095e('0x40')]:_0x4b25e1[_0x095e('0x3c')];if(_0xb04d58[_0x095e('0x3d')][_0x095e('0xb6')]){_0x1d185e['include']=[{'all':!![]}];}_0x1d185e=_[_0x095e('0x9a')]({},_0x1d185e,_0xb04d58[_0x095e('0xb7')]);return db[_0x095e('0x39')]['find'](_0x1d185e)[_0x095e('0x29')](handleEntityNotFound(_0x19209b,null))['then'](respondWithResult(_0x19209b,null))['catch'](handleError(_0x19209b,null));};exports['create']=function(_0x57e347,_0x1490ab){return db[_0x095e('0x39')]['create'](_0x57e347[_0x095e('0x6f')],{})[_0x095e('0x29')](respondWithResult(_0x1490ab,0xc9))['catch'](handleError(_0x1490ab,null));};exports[_0x095e('0x28')]=function(_0xdd37ca,_0xccf5b7){if(_0xdd37ca[_0x095e('0x6f')]['id']){delete _0xdd37ca[_0x095e('0x6f')]['id'];}return db[_0x095e('0x39')][_0x095e('0x5d')]({'where':{'id':_0xdd37ca['params']['id']}})[_0x095e('0x29')](handleEntityNotFound(_0xccf5b7,null))['then'](saveUpdates(_0xdd37ca[_0x095e('0x6f')],null))[_0x095e('0x29')](respondWithResult(_0xccf5b7,null))[_0x095e('0x36')](handleError(_0xccf5b7,null));};exports['destroy']=function(_0x28210c,_0x1a98ca){return db[_0x095e('0x39')][_0x095e('0x5d')]({'where':{'id':_0x28210c[_0x095e('0xb5')]['id']}})[_0x095e('0x29')](handleEntityNotFound(_0x1a98ca,null))[_0x095e('0x29')](removeEntity(_0x1a98ca,null))[_0x095e('0x36')](handleError(_0x1a98ca,null));};exports[_0x095e('0xb8')]=function(_0x5a7af6,_0x493b2e){return db[_0x095e('0x39')][_0x095e('0xb8')]()[_0x095e('0x29')](respondWithResult(_0x493b2e,null))[_0x095e('0x36')](handleError(_0x493b2e,null));};exports[_0x095e('0xb9')]=function(_0x5f0024,_0x17fcb5,_0x31c1b0){return db['SmsMessage']['find']({'where':{'id':_0x5f0024[_0x095e('0xb5')]['id']}})[_0x095e('0x29')](handleEntityNotFound(_0x17fcb5,null))[_0x095e('0x29')](function(_0x31d609){if(_0x31d609){return _0x31d609[_0x095e('0xb9')](_0x5f0024[_0x095e('0x6f')][_0x095e('0xba')],_['omit'](_0x5f0024['body'],[_0x095e('0xba'),'id'])||{});}})[_0x095e('0x29')](respondWithResult(_0x17fcb5,null))[_0x095e('0x36')](handleError(_0x17fcb5,null));};exports['getMessages']=function(_0x4f703e,_0x547ff8,_0x96c149){var _0x3e98c4={'raw':![],'where':{}};var _0x32c619={};var _0x1bad1f={'count':0x0,'rows':[]};return db[_0x095e('0x39')][_0x095e('0xbb')]({'where':{'id':_0x4f703e[_0x095e('0xb5')]['id']}})[_0x095e('0x29')](handleEntityNotFound(_0x547ff8,null))[_0x095e('0x29')](function(_0x12f2d1){if(_0x12f2d1){_0x32c619['model']=_[_0x095e('0x3e')](db[_0x095e('0xbc')][_0x095e('0x3a')]);_0x32c619['query']=_[_0x095e('0x3e')](_0x4f703e[_0x095e('0x3d')]);_0x32c619[_0x095e('0x3f')]=_['intersection'](_0x32c619[_0x095e('0x3c')],_0x32c619[_0x095e('0x3d')]);_0x3e98c4['attributes']=_['intersection'](_0x32c619[_0x095e('0x3c')],qs[_0x095e('0x42')](_0x4f703e[_0x095e('0x3d')]['fields']));_0x3e98c4[_0x095e('0x40')]=_0x3e98c4[_0x095e('0x40')][_0x095e('0x5c')]?_0x3e98c4[_0x095e('0x40')]:_0x32c619[_0x095e('0x3c')];if(!_0x4f703e[_0x095e('0x3d')][_0x095e('0x43')](_0x095e('0xbd'))){_0x3e98c4[_0x095e('0x21')]=qs[_0x095e('0x21')](_0x4f703e[_0x095e('0x3d')][_0x095e('0x21')]);_0x3e98c4[_0x095e('0x1f')]=qs[_0x095e('0x1f')](_0x4f703e['query']['offset']);}_0x3e98c4['order']=qs[_0x095e('0x44')](_0x4f703e[_0x095e('0x3d')]['sort']);_0x3e98c4['where']=qs[_0x095e('0x3f')](_[_0x095e('0x45')](_0x4f703e[_0x095e('0x3d')],_0x32c619[_0x095e('0x3f')]));_0x3e98c4[_0x095e('0x77')][_0x095e('0xb2')]=_0x12f2d1['id'];if(_0x4f703e['query'][_0x095e('0x81')]){_0x3e98c4[_0x095e('0x77')]=_[_0x095e('0x9a')](_0x3e98c4['where'],{'$or':_[_0x095e('0x38')](_0x3e98c4[_0x095e('0x40')],function(_0x5ee16a){var _0x33cb8b={};_0x33cb8b[_0x5ee16a]={'$like':'%'+_0x4f703e['query'][_0x095e('0x81')]+'%'};return _0x33cb8b;})});}if(_0x4f703e[_0x095e('0x3d')]['$gte']){var _0xb70190=_0x4f703e[_0x095e('0x3d')][_0x095e('0x75')][_0x095e('0x33')](',');var _0x211183={};_0x211183[_0xb70190[0x0]]={'$gte':moment(_0xb70190[0x1])[_0x095e('0xbe')](_0x095e('0xbf'))};_0x3e98c4[_0x095e('0x77')]=_[_0x095e('0x9a')](_0x3e98c4[_0x095e('0x77')],_0x211183);}_0x3e98c4=_[_0x095e('0x9a')]({},_0x3e98c4,_0x4f703e[_0x095e('0xb7')]);return db[_0x095e('0xbc')][_0x095e('0x22')]({'where':_0x3e98c4[_0x095e('0x77')]})['then'](function(_0x1c9e34){_0x1bad1f[_0x095e('0x22')]=_0x1c9e34;if(_0x4f703e[_0x095e('0x3d')][_0x095e('0xb6')]){_0x3e98c4[_0x095e('0xc0')]=[{'all':!![]}];}return db[_0x095e('0xbc')]['findAll'](_0x3e98c4);})['then'](function(_0x23442c){_0x1bad1f['rows']=_0x23442c;return _0x1bad1f;});}})[_0x095e('0x29')](respondWithFilteredResult(_0x547ff8,_0x3e98c4))['catch'](handleError(_0x547ff8,null));};exports[_0x095e('0xc1')]=function(_0x552c1,_0x118c3b,_0x5f2b34){return db['SmsInteraction'][_0x095e('0x5d')]({'where':{'id':_0x552c1[_0x095e('0xb5')]['id']}})[_0x095e('0x29')](handleEntityNotFound(_0x118c3b,null))[_0x095e('0x29')](function(_0x3f7e62){if(_0x3f7e62){return _0x3f7e62['setTags'](_0x552c1['body'][_0x095e('0xba')],_[_0x095e('0xc2')](_0x552c1['body'],[_0x095e('0xba'),'id'])||{})[_0x095e('0xc3')](function(){return db[_0x095e('0x6a')][_0x095e('0xc4')]({'attributes':['id',_0x095e('0x2e'),_0x095e('0xc5')],'where':{'id':_0x552c1['body']['ids']}});})['then'](function(_0x1223b5){socket[_0x095e('0xc6')](_0x095e('0xc7'),{'id':Number(_0x552c1[_0x095e('0xb5')]['id']),'tags':_0x1223b5||[]});return{'id':Number(_0x552c1[_0x095e('0xb5')]['id']),'tags':_0x1223b5||[]};});}})[_0x095e('0x29')](respondWithResult(_0x118c3b,null))[_0x095e('0x36')](handleError(_0x118c3b,null));};exports[_0x095e('0xc8')]=function(_0x230bb0,_0x34b0c8,_0x3a73a6){return db['SmsInteraction'][_0x095e('0x5d')]({'where':{'id':_0x230bb0[_0x095e('0xb5')]['id']}})['then'](handleEntityNotFound(_0x34b0c8,null))[_0x095e('0x29')](function(_0x13ad59){if(_0x13ad59){return _0x13ad59[_0x095e('0xc8')](_0x230bb0['query'][_0x095e('0xba')]);}})[_0x095e('0x29')](respondWithStatusCode(_0x34b0c8,null))[_0x095e('0x36')](handleError(_0x34b0c8,null));};exports[_0x095e('0xc9')]=function(_0x186288,_0x9f16f5){var _0x4d45c5=moment()[_0x095e('0xca')]()[_0x095e('0x99')]();var _0x5de19e=path['join'](config[_0x095e('0xcb')],'server',_0x095e('0xcc'),_0x095e('0xcd'));var _0x3c1e92=path[_0x095e('0xce')](config[_0x095e('0xcb')],_0x095e('0xcf'),_0x095e('0xcc'),_0x095e('0xd0'));var _0x25b3e8=path[_0x095e('0xce')](_0x5de19e,_0x4d45c5);var _0x5e3683=util[_0x095e('0xbe')](_0x095e('0xd1'),_0x186288[_0x095e('0xb5')]['id'],_0x4d45c5);var _0x549188=path['join'](_0x5de19e,_0x5e3683);var _0x267e27=[];_0x267e27[_0x095e('0x35')]({'model':db[_0x095e('0x6c')],'as':'User','attributes':['id',_0x095e('0x30')],'raw':!![]});_0x267e27['push']({'model':db[_0x095e('0xd2')],'as':_0x095e('0x62'),'attributes':['id','firstName',_0x095e('0xd3')],'raw':!![]});var _0x2c13a5=[{'model':db[_0x095e('0xbc')],'as':_0x095e('0xd4'),'attributes':['id','body',_0x095e('0xd5'),_0x095e('0xd6'),_0x095e('0xd7'),'read'],'include':_0x267e27}];_0x2c13a5[_0x095e('0x35')]({'model':db[_0x095e('0xd8')],'as':_0x095e('0xd9'),'attributes':['id',_0x095e('0x2e')]});_0x2c13a5['push']({'model':db[_0x095e('0x6c')],'as':_0x095e('0xda'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x095e('0x5d')]({'where':{'id':_0x186288['params']['id']},'include':_0x2c13a5})[_0x095e('0x29')](handleEntityNotFound(_0x9f16f5,null))['then'](function(_0x4e2ecb){if(_0x4e2ecb){var _0x381a5d=_0x4e2ecb[_0x095e('0xdb')]({'plain':!![]});fs[_0x095e('0xdc')](_0x25b3e8);var _0x518881={'channel':_0x095e('0xdd'),'account':_0x381a5d[_0x095e('0xd9')][_0x095e('0x2e')],'agent':_0x381a5d[_0x095e('0xda')]?_0x381a5d['Owner']['fullname']:_0x095e('0xde'),'createdAt':moment(_0x381a5d[_0x095e('0xd5')])[_0x095e('0xbe')](_0x095e('0xbf'))['toString'](),'closedAt':_0x381a5d['closed']?moment(_0x381a5d[_0x095e('0xdf')])['format'](_0x095e('0xbf'))[_0x095e('0x99')]():'','disposition':_0x381a5d[_0x095e('0xe0')],'messages':_(_0x381a5d['Messages'])[_0x095e('0x81')]({'secret':![]})[_0x095e('0x38')](function(_0xe84c7c){return{'date':moment(_0xe84c7c[_0x095e('0xd5')])[_0x095e('0xbe')](_0x095e('0xbf'))[_0x095e('0x99')](),'sender':_0xe84c7c[_0x095e('0xd6')]===_0x095e('0xe1')?_0xe84c7c[_0x095e('0x6c')]?_0xe84c7c[_0x095e('0x6c')]['fullname']:_0x095e('0xe2'):_0xe84c7c[_0x095e('0x62')][_0x095e('0xe3')]+(_0xe84c7c[_0x095e('0x62')][_0x095e('0xd3')]?'\x20'+_0xe84c7c['Contact'][_0x095e('0xd3')]:''),'body':_0xe84c7c[_0x095e('0x6f')],'direction':_0xe84c7c[_0x095e('0xd6')]===_0x095e('0xe1')?'A':'C','secret':_0xe84c7c[_0x095e('0xd7')],'read':_0xe84c7c[_0x095e('0x7b')]};})[_0x095e('0x5e')]()};return ejs['renderFile'](path['join'](config[_0x095e('0xcb')],'server',_0x095e('0xe4'),_0x095e('0xe5')),{'interaction':_0x518881})[_0x095e('0x29')](function(_0x39d498){var _0x2930c5=path[_0x095e('0xce')](_0x25b3e8,'transcript-'+_0x381a5d['id']+'-'+_0x4d45c5+_0x095e('0xe6'));var _0x1ad7f9={'path':_0x2930c5,'channel':'Sms','interactionId':_0x381a5d['id']};return pdf[_0x095e('0xe7')](_0x39d498,_0x1ad7f9);})[_0x095e('0x29')](function(){return new BPromise(function(_0x2fa5cc,_0x553105){zipdir(_0x25b3e8,{'saveTo':_0x549188},function(_0x46a180,_0x5658e6){if(_0x46a180)return _0x553105(_0x46a180);return _0x2fa5cc(_0x5658e6);});})[_0x095e('0x29')](function(){return new BPromise(function(_0x16f297,_0x338d4b){rimraf(_0x25b3e8,function(_0x312370){if(_0x312370)_0x338d4b(_0x312370);return _0x16f297();});});})[_0x095e('0x29')](function(){return _0x9f16f5['download'](_0x549188,_0x5e3683,function(_0x1fd962){if(_0x1fd962){console[_0x095e('0xe8')]('err',_0x1fd962);}else{fs['unlinkSync'](_0x549188);}});});});}else{return _0x9f16f5['sendStatus'](0xc8);}})[_0x095e('0x36')](handleError(_0x9f16f5,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f2fb9fd..27b560e 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 _0x0120=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','then','unreadMessages','emit','catch'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x0120,0x6f));var _0x0012=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0120[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x0012('0x0'));var SmsInteraction=require(_0x0012('0x1'))['db'][_0x0012('0x2')];var SmsMessage=require(_0x0012('0x1'))['db'][_0x0012('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0012('0x4')](0x0);var events={'afterCreate':_0x0012('0x5'),'afterUpdate':_0x0012('0x6'),'afterDestroy':_0x0012('0x7')};function emitEvent(_0x302029){return function(_0x3505ab,_0x3fcfbc,_0x4eaa5b){_0x3505ab['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x95d441){_0x3505ab[_0x0012('0x8')](_0x0012('0x9'),_0x95d441[_0x0012('0xa')](function(_0x33c82f){return{'id':_0x33c82f['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3505ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0012('0xb')](function(_0x2d484c){_0x3505ab[_0x0012('0x8')](_0x0012('0xc'),_0x2d484c['length']);SmsInteractionEvents[_0x0012('0xd')](_0x302029+':'+_0x3505ab['id'],_0x3505ab);SmsInteractionEvents['emit'](_0x302029,_0x3505ab);_0x4eaa5b(null);})[_0x0012('0xe')](_0x4eaa5b(null));};}for(var e in events){if(events[_0x0012('0xf')](e)){var event=events[e];SmsInteraction[_0x0012('0x10')](e,emitEvent(event));}}module[_0x0012('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0xe3f0b0,_0x43edc9){var _0x3a839e=function(_0x45e9cf){while(--_0x45e9cf){_0xe3f0b0['push'](_0xe3f0b0['shift']());}};_0x3a839e(++_0x43edc9);}(_0xdb28,0x106));var _0x8db2=function(_0xe8cac3,_0x11ef4d){_0xe8cac3=_0xe8cac3-0x0;var _0x5e332c=_0xdb28[_0xe8cac3];return _0x5e332c;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b1faa71..afe7930 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 _0x570f=['api','bluebird','request-promise','path','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','lodash','../../config/logger'];(function(_0x52712a,_0x4cf13c){var _0x35b3ef=function(_0x2b06a5){while(--_0x2b06a5){_0x52712a['push'](_0x52712a['shift']());}};_0x35b3ef(++_0x4cf13c);}(_0x570f,0x1ec));var _0xf570=function(_0x15ee41,_0x9275d8){_0x15ee41=_0x15ee41-0x0;var _0x2b2846=_0x570f[_0x15ee41];return _0x2b2846;};'use strict';var _=require(_0xf570('0x0'));var util=require('util');var logger=require(_0xf570('0x1'))(_0xf570('0x2'));var moment=require('moment');var BPromise=require(_0xf570('0x3'));var rp=require(_0xf570('0x4'));var fs=require('fs');var path=require(_0xf570('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf570('0x6'));module[_0xf570('0x7')]=function(_0x3f3b0e,_0x34b2af){return _0x3f3b0e['define'](_0xf570('0x8'),attributes,{'tableName':_0xf570('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bcb08,_0x4e40d0,_0xb88f12){if(_0x3bcb08[_0xf570('0xa')](_0xf570('0xb'))){_0x3bcb08[_0xf570('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xb88f12(null,_0x3bcb08);}}});}; \ No newline at end of file +var _0x4d94=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','request-promise','path','rimraf','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x156608,_0x313f53){var _0xf7e226=function(_0x6fc28){while(--_0x6fc28){_0x156608['push'](_0x156608['shift']());}};_0xf7e226(++_0x313f53);}(_0x4d94,0x178));var _0x44d9=function(_0x58aa13,_0x533e05){_0x58aa13=_0x58aa13-0x0;var _0x33c614=_0x4d94[_0x58aa13];return _0x33c614;};'use strict';var _=require('lodash');var util=require(_0x44d9('0x0'));var logger=require(_0x44d9('0x1'))('api');var moment=require(_0x44d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x44d9('0x3'));var fs=require('fs');var path=require(_0x44d9('0x4'));var rimraf=require(_0x44d9('0x5'));var config=require('../../config/environment');var attributes=require(_0x44d9('0x6'));module[_0x44d9('0x7')]=function(_0x305666,_0x187aa1){return _0x305666['define'](_0x44d9('0x8'),attributes,{'tableName':_0x44d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ad23a,_0x3b1279,_0x10744b){if(_0x1ad23a[_0x44d9('0xa')](_0x44d9('0xb'))){_0x1ad23a[_0x44d9('0xc')]=moment()[_0x44d9('0xd')](_0x44d9('0xe'));}_0x10744b(null,_0x1ad23a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 7906d55..37adb29 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 _0x5b7d=['jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','SmsInteraction,\x20%s,\x20%s','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','attributes','limit','stringify','AddTagsToSmsInteraction','find','where','addTags','body','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x5a07ab,_0xddde9c){var _0x3e59f4=function(_0x24b06c){while(--_0x24b06c){_0x5a07ab['push'](_0x5a07ab['shift']());}};_0x3e59f4(++_0xddde9c);}(_0x5b7d,0x124));var _0xd5b7=function(_0x2b32a4,_0x2ee2dd){_0x2b32a4=_0x2b32a4-0x0;var _0x11380c=_0x5b7d[_0x2b32a4];return _0x11380c;};'use strict';var _=require(_0xd5b7('0x0'));var util=require(_0xd5b7('0x1'));var moment=require(_0xd5b7('0x2'));var BPromise=require(_0xd5b7('0x3'));var rs=require(_0xd5b7('0x4'));var fs=require('fs');var Redis=require(_0xd5b7('0x5'));var db=require(_0xd5b7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5b7('0x7'))('rpc');var config=require(_0xd5b7('0x8'));var jayson=require(_0xd5b7('0x9'));var client=jayson[_0xd5b7('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xd5b7('0xb')],{'host':_0xd5b7('0xc'),'port':0x18eb});var socket=require(_0xd5b7('0xd'))(new Redis(config[_0xd5b7('0xb')]));require('./smsInteraction.socket')[_0xd5b7('0xe')](socket);function respondWithRpcPromise(_0x596c7e,_0x26199a,_0x5604bf){return new BPromise(function(_0x32387a,_0x58061e){return client[_0xd5b7('0xf')](_0x596c7e,_0x5604bf)[_0xd5b7('0x10')](function(_0x1f22f7){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x26199a,_0xd5b7('0x11'));logger[_0xd5b7('0x12')](_0xd5b7('0x13'),_0x26199a,_0xd5b7('0x11'),JSON['stringify'](_0x1f22f7));if(_0x1f22f7[_0xd5b7('0x14')]){if(_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x15')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x26199a,_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x16')]);return _0x58061e(_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x16')]);}logger[_0xd5b7('0x14')](_0xd5b7('0x17'),_0x26199a,_0x1f22f7['error'][_0xd5b7('0x16')]);return _0x32387a(_0x1f22f7[_0xd5b7('0x14')][_0xd5b7('0x16')]);}else{logger[_0xd5b7('0x18')](_0xd5b7('0x17'),_0x26199a,'request\x20sent');_0x32387a(_0x1f22f7[_0xd5b7('0x19')][_0xd5b7('0x16')]);}})[_0xd5b7('0x1a')](function(_0xa3056){logger[_0xd5b7('0x14')](_0xd5b7('0x17'),_0x26199a,_0xa3056);_0x58061e(_0xa3056);});});}exports[_0xd5b7('0x1b')]=function(_0x2e277d){var _0x1eaa89=this;return new Promise(function(_0x3b2ba2,_0x5bb129){return db[_0xd5b7('0x1c')][_0xd5b7('0x1d')](_0x2e277d['body'],{'raw':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')][_0xd5b7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')]['where']||null:null,'attributes':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')][_0xd5b7('0x20')]||null:null,'limit':_0x2e277d[_0xd5b7('0x1e')]?_0x2e277d[_0xd5b7('0x1e')][_0xd5b7('0x21')]||null:null})[_0xd5b7('0x10')](function(_0x1909e6){logger['info'](_0xd5b7('0x1b'),_0x2e277d);logger[_0xd5b7('0x12')](_0xd5b7('0x1b'),_0x2e277d,JSON[_0xd5b7('0x22')](_0x1909e6));_0x3b2ba2(_0x1909e6);})[_0xd5b7('0x1a')](function(_0x44237d){logger['error']('UpdateSmsInteraction',_0x44237d[_0xd5b7('0x16')],_0x2e277d);_0x5bb129(_0x1eaa89[_0xd5b7('0x14')](0x1f4,_0x44237d['message']));});});};exports[_0xd5b7('0x23')]=function(_0x2217f2){return new Promise(function(_0x41287f,_0x302e4a){return db['SmsInteraction'][_0xd5b7('0x24')]({'where':_0x2217f2['options']?_0x2217f2[_0xd5b7('0x1e')][_0xd5b7('0x25')]||null:null})[_0xd5b7('0x10')](function(_0x89ff76){if(_0x89ff76){return _0x89ff76[_0xd5b7('0x26')](_0x2217f2[_0xd5b7('0x27')]['ids'],_[_0xd5b7('0x28')](_0x2217f2['body'],['ids','id'])||{});}})[_0xd5b7('0x29')](function(_0x5df528){logger[_0xd5b7('0x18')](_0xd5b7('0x2a'),_0x2217f2);logger[_0xd5b7('0x12')](_0xd5b7('0x2a'),_0x2217f2,JSON[_0xd5b7('0x22')](_0x5df528));_0x41287f(_0x5df528);})['catch'](function(_0x1e4756){logger[_0xd5b7('0x14')](_0xd5b7('0x2a'),_0x1e4756[_0xd5b7('0x16')],_0x2217f2);_0x302e4a(_this[_0xd5b7('0x14')](0x1f4,_0x1e4756[_0xd5b7('0x16')]));});});}; \ No newline at end of file +var _0x8986=['addTags','omit','spread','AddTags','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','then','AddTagsToSmsInteraction','find'];(function(_0x1143c9,_0x407c2d){var _0x557b90=function(_0xb6dbe1){while(--_0xb6dbe1){_0x1143c9['push'](_0x1143c9['shift']());}};_0x557b90(++_0x407c2d);}(_0x8986,0x124));var _0x6898=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8986[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6898('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6898('0x1'))['db'];var utils=require(_0x6898('0x2'));var logger=require(_0x6898('0x3'))('rpc');var config=require(_0x6898('0x4'));var jayson=require(_0x6898('0x5'));var client=jayson['client'][_0x6898('0x6')]({'port':0x232a});config[_0x6898('0x7')]=_['defaults'](config[_0x6898('0x7')],{'host':_0x6898('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6898('0x7')]));require('./smsInteraction.socket')[_0x6898('0x9')](socket);function respondWithRpcPromise(_0x2763a5,_0xdc7f37,_0xe071a6){return new BPromise(function(_0xcfe998,_0x280c82){return client[_0x6898('0xa')](_0x2763a5,_0xe071a6)['then'](function(_0x5427f7){logger[_0x6898('0xb')](_0x6898('0xc'),_0xdc7f37,_0x6898('0xd'));logger[_0x6898('0xe')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xdc7f37,_0x6898('0xd'),JSON[_0x6898('0xf')](_0x5427f7));if(_0x5427f7[_0x6898('0x10')]){if(_0x5427f7['error'][_0x6898('0x11')]===0x1f4){logger[_0x6898('0x10')](_0x6898('0xc'),_0xdc7f37,_0x5427f7[_0x6898('0x10')][_0x6898('0x12')]);return _0x280c82(_0x5427f7[_0x6898('0x10')]['message']);}logger['error'](_0x6898('0xc'),_0xdc7f37,_0x5427f7['error'][_0x6898('0x12')]);return _0xcfe998(_0x5427f7['error'][_0x6898('0x12')]);}else{logger[_0x6898('0xb')](_0x6898('0xc'),_0xdc7f37,_0x6898('0xd'));_0xcfe998(_0x5427f7[_0x6898('0x13')][_0x6898('0x12')]);}})[_0x6898('0x14')](function(_0x1cedfe){logger[_0x6898('0x10')]('SmsInteraction,\x20%s,\x20%s',_0xdc7f37,_0x1cedfe);_0x280c82(_0x1cedfe);});});}exports[_0x6898('0x15')]=function(_0x26347e){var _0x17c0c0=this;return new Promise(function(_0x422dc1,_0x1941ff){return db[_0x6898('0x16')][_0x6898('0x17')](_0x26347e[_0x6898('0x18')],{'raw':_0x26347e[_0x6898('0x19')]?_0x26347e[_0x6898('0x19')][_0x6898('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26347e[_0x6898('0x19')]?_0x26347e[_0x6898('0x19')][_0x6898('0x1b')]||null:null,'attributes':_0x26347e[_0x6898('0x19')]?_0x26347e['options'][_0x6898('0x1c')]||null:null,'limit':_0x26347e['options']?_0x26347e[_0x6898('0x19')]['limit']||null:null})[_0x6898('0x1d')](function(_0x30066a){logger[_0x6898('0xb')]('UpdateSmsInteraction',_0x26347e);logger[_0x6898('0xe')](_0x6898('0x15'),_0x26347e,JSON['stringify'](_0x30066a));_0x422dc1(_0x30066a);})[_0x6898('0x14')](function(_0x253275){logger[_0x6898('0x10')](_0x6898('0x15'),_0x253275[_0x6898('0x12')],_0x26347e);_0x1941ff(_0x17c0c0[_0x6898('0x10')](0x1f4,_0x253275['message']));});});};exports[_0x6898('0x1e')]=function(_0xc5f512){return new Promise(function(_0x5629d3,_0x2265cc){return db[_0x6898('0x16')][_0x6898('0x1f')]({'where':_0xc5f512[_0x6898('0x19')]?_0xc5f512[_0x6898('0x19')][_0x6898('0x1b')]||null:null})['then'](function(_0x4dea8a){if(_0x4dea8a){return _0x4dea8a[_0x6898('0x20')](_0xc5f512[_0x6898('0x18')]['ids'],_[_0x6898('0x21')](_0xc5f512[_0x6898('0x18')],['ids','id'])||{});}})[_0x6898('0x22')](function(_0x28e5d0){logger['info']('AddTags',_0xc5f512);logger[_0x6898('0xe')](_0x6898('0x23'),_0xc5f512,JSON['stringify'](_0x28e5d0));_0x5629d3(_0x28e5d0);})['catch'](function(_0x1b7b78){logger[_0x6898('0x10')](_0x6898('0x23'),_0x1b7b78[_0x6898('0x12')],_0xc5f512);_0x2265cc(_this[_0x6898('0x10')](0x1f4,_0x1b7b78[_0x6898('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 98ea787..215fdf4 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 _0xdab6=['removeListener','register','length','smsInteraction:','save','remove','emit'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0xdab6,0xe4));var _0x6dab=function(_0x48cbfa,_0x80864){_0x48cbfa=_0x48cbfa-0x0;var _0x1cea43=_0xdab6[_0x48cbfa];return _0x1cea43;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x6dab('0x0'),_0x6dab('0x1'),'update'];function createListener(_0x564bab,_0x3dae46){return function(_0x2d09ea){_0x3dae46[_0x6dab('0x2')](_0x564bab,_0x2d09ea);};}function removeListener(_0x17294c,_0x416150){return function(){SmsInteractionEvents[_0x6dab('0x3')](_0x17294c,_0x416150);};}exports[_0x6dab('0x4')]=function(_0x2f3d9f){for(var _0x1eb2f6=0x0,_0x118186=events[_0x6dab('0x5')];_0x1eb2f6<_0x118186;_0x1eb2f6++){var _0x11d485=events[_0x1eb2f6];var _0x2b0583=createListener(_0x6dab('0x6')+_0x11d485,_0x2f3d9f);SmsInteractionEvents['on'](_0x11d485,_0x2b0583);}}; \ No newline at end of file +var _0xcced=['emit','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xcced,0x6d));var _0xdcce=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xcced[_0x409353];return _0x4f4b59;};'use strict';var SmsInteractionEvents=require(_0xdcce('0x0'));var events=[_0xdcce('0x1'),_0xdcce('0x2'),'update'];function createListener(_0x5bd20b,_0x2d3738){return function(_0x1f88eb){_0x2d3738[_0xdcce('0x3')](_0x5bd20b,_0x1f88eb);};}function removeListener(_0x254c7a,_0x2c8937){return function(){SmsInteractionEvents['removeListener'](_0x254c7a,_0x2c8937);};}exports[_0xdcce('0x4')]=function(_0x2bbd0a){for(var _0x24718d=0x0,_0x535544=events[_0xdcce('0x5')];_0x24718d<_0x535544;_0x24718d++){var _0x3ff4a7=events[_0x24718d];var _0x535674=createListener(_0xdcce('0x6')+_0x3ff4a7,_0x2bbd0a);SmsInteractionEvents['on'](_0x3ff4a7,_0x535674);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 38e16b4..5c250f1 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 _0xe8ae=['sms','create','post','/:id/status','update','put','/:id/accept','accept','/:id','destroy','path','connect-timeout','express','Router','fs-extra','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','show','tracked'];(function(_0x313806,_0x3deffe){var _0x19dc96=function(_0x231879){while(--_0x231879){_0x313806['push'](_0x313806['shift']());}};_0x19dc96(++_0x3deffe);}(_0xe8ae,0x163));var _0xee8a=function(_0x3bc393,_0x3869a8){_0x3bc393=_0x3bc393-0x0;var _0x14f745=_0xe8ae[_0x3bc393];return _0x14f745;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee8a('0x0'));var timeout=require(_0xee8a('0x1'));var express=require(_0xee8a('0x2'));var router=express[_0xee8a('0x3')]();var fs_extra=require(_0xee8a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee8a('0x5'));router[_0xee8a('0x6')]('/',auth[_0xee8a('0x7')](),controller[_0xee8a('0x8')]);router[_0xee8a('0x6')](_0xee8a('0x9'),auth['isAuthenticated'](),controller[_0xee8a('0xa')]);router[_0xee8a('0x6')]('/:id',auth[_0xee8a('0x7')](),controller[_0xee8a('0xb')]);router['post']('/',auth[_0xee8a('0x7')](),interaction[_0xee8a('0xc')](_0xee8a('0xd'),'smsmessage:create'),controller[_0xee8a('0xe')]);router[_0xee8a('0xf')](_0xee8a('0x10'),controller['status']);router['put']('/:id',auth[_0xee8a('0x7')](),controller[_0xee8a('0x11')]);router[_0xee8a('0x12')](_0xee8a('0x13'),auth[_0xee8a('0x7')](),controller[_0xee8a('0x14')]);router[_0xee8a('0x12')]('/:id/reject',auth[_0xee8a('0x7')](),controller['reject']);router['delete'](_0xee8a('0x15'),auth[_0xee8a('0x7')](),controller[_0xee8a('0x16')]);module['exports']=router; \ No newline at end of file +var _0x18af=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','tracked','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','path','connect-timeout'];(function(_0x3fefd2,_0x1a39dc){var _0x520b72=function(_0x209deb){while(--_0x209deb){_0x3fefd2['push'](_0x3fefd2['shift']());}};_0x520b72(++_0x1a39dc);}(_0x18af,0x19d));var _0xf18a=function(_0x5489c7,_0x4ddaac){_0x5489c7=_0x5489c7-0x0;var _0xadc532=_0x18af[_0x5489c7];return _0xadc532;};'use strict';var multer=require(_0xf18a('0x0'));var util=require('util');var path=require(_0xf18a('0x1'));var timeout=require(_0xf18a('0x2'));var express=require(_0xf18a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf18a('0x4'));var interaction=require(_0xf18a('0x5'));var config=require(_0xf18a('0x6'));var controller=require('./smsMessage.controller');router[_0xf18a('0x7')]('/',auth[_0xf18a('0x8')](),controller[_0xf18a('0x9')]);router['get']('/describe',auth[_0xf18a('0x8')](),controller[_0xf18a('0xa')]);router['get'](_0xf18a('0xb'),auth[_0xf18a('0x8')](),controller[_0xf18a('0xc')]);router[_0xf18a('0xd')]('/',auth[_0xf18a('0x8')](),interaction[_0xf18a('0xe')]('sms',_0xf18a('0xf')),controller[_0xf18a('0x10')]);router[_0xf18a('0xd')](_0xf18a('0x11'),controller[_0xf18a('0x12')]);router[_0xf18a('0x13')](_0xf18a('0xb'),auth[_0xf18a('0x8')](),controller[_0xf18a('0x14')]);router['put'](_0xf18a('0x15'),auth[_0xf18a('0x8')](),controller[_0xf18a('0x16')]);router[_0xf18a('0x13')](_0xf18a('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0xf18a('0x18')]('/:id',auth[_0xf18a('0x8')](),controller['destroy']);module[_0xf18a('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 540a272..2fd966c 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 _0xdbef=['out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x33cd5f,_0x579df3){var _0x596552=function(_0x57abc7){while(--_0x57abc7){_0x33cd5f['push'](_0x33cd5f['shift']());}};_0x596552(++_0x579df3);}(_0xdbef,0xc2));var _0xfdbe=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdbef[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xfdbe('0x0'));module[_0xfdbe('0x1')]={'body':{'type':Sequelize[_0xfdbe('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfdbe('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfdbe('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xfdbe('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfdbe('0x5')]},'providerResponse':{'type':Sequelize[_0xfdbe('0x2')]}}; \ No newline at end of file +var _0x7a2d=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0xfc553f,_0xf60646){var _0x4f72ea=function(_0x4cca68){while(--_0x4cca68){_0xfc553f['push'](_0xfc553f['shift']());}};_0x4f72ea(++_0xf60646);}(_0x7a2d,0x142));var _0xd7a2=function(_0x949ff7,_0x24e8f7){_0x949ff7=_0x949ff7-0x0;var _0x2965f4=_0x7a2d[_0x949ff7];return _0x2965f4;};'use strict';var Sequelize=require(_0xd7a2('0x0'));module[_0xd7a2('0x1')]={'body':{'type':Sequelize[_0xd7a2('0x2')](_0xd7a2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd7a2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd7a2('0x5')]('in',_0xd7a2('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xd7a2('0x7')]},'readAt':{'type':Sequelize[_0xd7a2('0x8')]},'secret':{'type':Sequelize[_0xd7a2('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd7a2('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index c548d1f..1699c7b 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 _0x25a5=['[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','SmsInteraction','RejectMessage','rejectMessage','Sequelize','internal','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','bluebird','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction'];(function(_0x5391ef,_0x3c8788){var _0x136499=function(_0x4d80a5){while(--_0x4d80a5){_0x5391ef['push'](_0x5391ef['shift']());}};_0x136499(++_0x3c8788);}(_0x25a5,0x1e1));var _0x525a=function(_0x29223a,_0x3fd7dd){_0x29223a=_0x29223a-0x0;var _0xe3c621=_0x25a5[_0x29223a];return _0xe3c621;};'use strict';var emlformat=require(_0x525a('0x0'));var rimraf=require(_0x525a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x525a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x525a('0x3'));var Mustache=require('mustache');var util=require(_0x525a('0x4'));var path=require('path');var sox=require(_0x525a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x525a('0x6'));var squel=require(_0x525a('0x7'));var crypto=require(_0x525a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x525a('0x9'));var toCsv=require(_0x525a('0xa'));var querystring=require(_0x525a('0xb'));var Papa=require(_0x525a('0xc'));var Redis=require(_0x525a('0xd'));var authService=require(_0x525a('0xe'));var qs=require(_0x525a('0xf'));var as=require(_0x525a('0x10'));var hardwareService=require(_0x525a('0x11'));var logger=require(_0x525a('0x12'))(_0x525a('0x13'));var utils=require(_0x525a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x525a('0x15'));var db=require(_0x525a('0x16'))['db'];config[_0x525a('0x17')]=_[_0x525a('0x18')](config[_0x525a('0x17')],{'host':_0x525a('0x19'),'port':0x18eb});var socket=require(_0x525a('0x1a'))(new Redis(config[_0x525a('0x17')]));require(_0x525a('0x1b'))[_0x525a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x525a('0x1d')][_0x525a('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f1bd3,_0x295c8c,_0x3bcc8d,_0x5a7961){return new BPromise(function(_0x4db427,_0x55060d){var _0x374d67=_0x5a7961||client;return _0x374d67[_0x525a('0x1f')](_0x3f1bd3,_0x3bcc8d)[_0x525a('0x20')](function(_0x29a6a3){logger[_0x525a('0x21')](_0x525a('0x22'),_0x295c8c,_0x525a('0x23'));logger[_0x525a('0x24')](_0x525a('0x25'),_0x295c8c,_0x525a('0x23'),JSON[_0x525a('0x26')](_0x29a6a3));if(_0x29a6a3['error']){if(_0x29a6a3[_0x525a('0x27')][_0x525a('0x28')]===0x1f4){logger[_0x525a('0x27')](_0x525a('0x22'),_0x295c8c,_0x29a6a3[_0x525a('0x27')][_0x525a('0x29')]);return _0x55060d(_0x29a6a3['error'][_0x525a('0x29')]);}logger[_0x525a('0x27')](_0x525a('0x22'),_0x295c8c,_0x29a6a3[_0x525a('0x27')][_0x525a('0x29')]);return _0x4db427(_0x29a6a3[_0x525a('0x27')][_0x525a('0x29')]);}else{logger[_0x525a('0x21')](_0x525a('0x22'),_0x295c8c,_0x525a('0x23'));_0x4db427(_0x29a6a3[_0x525a('0x2a')][_0x525a('0x29')]);}})[_0x525a('0x2b')](function(_0xe26b19){logger[_0x525a('0x27')](_0x525a('0x22'),_0x295c8c,_0xe26b19);_0x55060d(_0xe26b19);});});}function respondWithStatusCode(_0x5b65f0,_0x48e02c){_0x48e02c=_0x48e02c||0xcc;return function(_0x112721){if(_0x112721){return _0x5b65f0[_0x525a('0x2c')](_0x48e02c);}return _0x5b65f0[_0x525a('0x2d')](_0x48e02c)[_0x525a('0x2e')]();};}function respondWithResult(_0x4afe1b,_0x3082c8){_0x3082c8=_0x3082c8||0xc8;return function(_0x302e5c){if(_0x302e5c){return _0x4afe1b[_0x525a('0x2d')](_0x3082c8)[_0x525a('0x2f')](_0x302e5c);}};}function respondWithFilteredResult(_0x3f46dc,_0x256cd5){return function(_0x17213b){if(_0x17213b){var _0x5bd740=typeof _0x256cd5[_0x525a('0x30')]===_0x525a('0x31')&&typeof _0x256cd5[_0x525a('0x32')]===_0x525a('0x31');var _0xe290cf=_0x17213b[_0x525a('0x33')];var _0x1cdf91=_0x5bd740?0x0:_0x256cd5['offset'];var _0x2c1bbd=_0x5bd740?_0x17213b['count']:_0x256cd5['offset']+_0x256cd5['limit'];var _0x546dd9;if(_0x2c1bbd>=_0xe290cf){_0x2c1bbd=_0xe290cf;_0x546dd9=0xc8;}else{_0x546dd9=0xce;}_0x3f46dc[_0x525a('0x2d')](_0x546dd9);return _0x3f46dc['set'](_0x525a('0x34'),_0x1cdf91+'-'+_0x2c1bbd+'/'+_0xe290cf)[_0x525a('0x2f')](_0x17213b);}return null;};}function patchUpdates(_0x4ba2c7){return function(_0x38423b){try{jsonpatch[_0x525a('0x35')](_0x38423b,_0x4ba2c7,!![]);}catch(_0x1585f5){return BPromise[_0x525a('0x36')](_0x1585f5);}return _0x38423b['save']();};}function saveUpdates(_0x500c90,_0x371c6b){return function(_0x3b7fa6){if(_0x3b7fa6){return _0x3b7fa6[_0x525a('0x37')](_0x500c90)[_0x525a('0x20')](function(_0x4596dd){return _0x4596dd;});}return null;};}function removeEntity(_0x4c0a03,_0x2129be){return function(_0x471f3b){if(_0x471f3b){return _0x471f3b[_0x525a('0x38')]()[_0x525a('0x20')](function(){_0x4c0a03[_0x525a('0x2d')](0xcc)[_0x525a('0x2e')]();});}};}function handleEntityNotFound(_0x62c2d6,_0x2c71a3){return function(_0x373209){if(!_0x373209){_0x62c2d6[_0x525a('0x2c')](0x194);}return _0x373209;};}function handleError(_0x5db2a6,_0x529eba){_0x529eba=_0x529eba||0x1f4;return function(_0x50aa6c){logger[_0x525a('0x27')](_0x50aa6c[_0x525a('0x39')]);if(_0x50aa6c[_0x525a('0x3a')]){delete _0x50aa6c[_0x525a('0x3a')];}_0x5db2a6['status'](_0x529eba)[_0x525a('0x3b')](_0x50aa6c);};}exports[_0x525a('0x3c')]=function(_0x4756e4,_0x1c604e){var _0x3dc1da={},_0x499d69={},_0x4cb6a4={'count':0x0,'rows':[]};var _0x1d56c1=_[_0x525a('0x3d')](db[_0x525a('0x3e')][_0x525a('0x3f')],function(_0x18bd36){return{'name':_0x18bd36['fieldName'],'type':_0x18bd36[_0x525a('0x40')][_0x525a('0x41')]};});_0x499d69[_0x525a('0x42')]=_[_0x525a('0x3d')](_0x1d56c1,_0x525a('0x3a'));_0x499d69['query']=_[_0x525a('0x43')](_0x4756e4['query']);_0x499d69[_0x525a('0x44')]=_[_0x525a('0x45')](_0x499d69[_0x525a('0x42')],_0x499d69['query']);_0x3dc1da[_0x525a('0x46')]=_['intersection'](_0x499d69[_0x525a('0x42')],qs[_0x525a('0x47')](_0x4756e4[_0x525a('0x48')]['fields']));_0x3dc1da['attributes']=_0x3dc1da[_0x525a('0x46')][_0x525a('0x49')]?_0x3dc1da[_0x525a('0x46')]:_0x499d69[_0x525a('0x42')];if(!_0x4756e4[_0x525a('0x48')]['hasOwnProperty'](_0x525a('0x4a'))){_0x3dc1da[_0x525a('0x32')]=qs[_0x525a('0x32')](_0x4756e4[_0x525a('0x48')]['limit']);_0x3dc1da[_0x525a('0x30')]=qs['offset'](_0x4756e4['query'][_0x525a('0x30')]);}_0x3dc1da[_0x525a('0x4b')]=qs['sort'](_0x4756e4[_0x525a('0x48')][_0x525a('0x4c')]);_0x3dc1da[_0x525a('0x4d')]=qs[_0x525a('0x44')](_[_0x525a('0x4e')](_0x4756e4['query'],_0x499d69[_0x525a('0x44')]),_0x1d56c1);if(_0x4756e4[_0x525a('0x48')][_0x525a('0x4f')]){_0x3dc1da[_0x525a('0x4d')]=_[_0x525a('0x50')](_0x3dc1da['where'],{'$or':_['map'](_0x1d56c1,function(_0x3cc4f5){if(_0x3cc4f5[_0x525a('0x40')]!==_0x525a('0x51')){var _0x3289d3={};_0x3289d3[_0x3cc4f5[_0x525a('0x3a')]]={'$like':'%'+_0x4756e4['query'][_0x525a('0x4f')]+'%'};return _0x3289d3;}})});}_0x3dc1da=_[_0x525a('0x50')]({},_0x3dc1da,_0x4756e4[_0x525a('0x52')]);var _0x59d955={'where':_0x3dc1da[_0x525a('0x4d')]};return db['SmsMessage'][_0x525a('0x33')](_0x59d955)['then'](function(_0x1e2c00){_0x4cb6a4['count']=_0x1e2c00;if(_0x4756e4[_0x525a('0x48')][_0x525a('0x53')]){_0x3dc1da[_0x525a('0x54')]=[{'all':!![]}];}return db['SmsMessage'][_0x525a('0x55')](_0x3dc1da);})[_0x525a('0x20')](function(_0x41f4a8){_0x4cb6a4[_0x525a('0x56')]=_0x41f4a8;return _0x4cb6a4;})[_0x525a('0x20')](respondWithFilteredResult(_0x1c604e,_0x3dc1da))[_0x525a('0x2b')](handleError(_0x1c604e,null));};exports[_0x525a('0x57')]=function(_0x3eead6,_0x5bf1fa){var _0x9da5d4={'raw':!![],'where':{'id':_0x3eead6[_0x525a('0x58')]['id']}},_0x53910e={};_0x53910e['model']=_[_0x525a('0x43')](db[_0x525a('0x3e')][_0x525a('0x3f')]);_0x53910e[_0x525a('0x48')]=_[_0x525a('0x43')](_0x3eead6[_0x525a('0x48')]);_0x53910e[_0x525a('0x44')]=_[_0x525a('0x45')](_0x53910e[_0x525a('0x42')],_0x53910e['query']);_0x9da5d4[_0x525a('0x46')]=_[_0x525a('0x45')](_0x53910e[_0x525a('0x42')],qs[_0x525a('0x47')](_0x3eead6[_0x525a('0x48')][_0x525a('0x47')]));_0x9da5d4[_0x525a('0x46')]=_0x9da5d4[_0x525a('0x46')][_0x525a('0x49')]?_0x9da5d4[_0x525a('0x46')]:_0x53910e['model'];if(_0x3eead6[_0x525a('0x48')]['includeAll']){_0x9da5d4[_0x525a('0x54')]=[{'all':!![]}];}_0x9da5d4=_['merge']({},_0x9da5d4,_0x3eead6['options']);return db[_0x525a('0x3e')][_0x525a('0x59')](_0x9da5d4)[_0x525a('0x20')](handleEntityNotFound(_0x5bf1fa,null))[_0x525a('0x20')](respondWithResult(_0x5bf1fa,null))[_0x525a('0x2b')](handleError(_0x5bf1fa,null));};exports['create']=function(_0x42ee7d,_0x2674a1){return db[_0x525a('0x3e')][_0x525a('0x5a')](_0x42ee7d[_0x525a('0x5b')],{})[_0x525a('0x20')](respondWithResult(_0x2674a1,0xc9))[_0x525a('0x2b')](handleError(_0x2674a1,null));};exports['update']=function(_0x54a043,_0x391d13){if(_0x54a043[_0x525a('0x5b')]['id']){delete _0x54a043[_0x525a('0x5b')]['id'];}return db[_0x525a('0x3e')]['find']({'where':{'id':_0x54a043[_0x525a('0x58')]['id']}})['then'](handleEntityNotFound(_0x391d13,null))[_0x525a('0x20')](saveUpdates(_0x54a043['body'],null))[_0x525a('0x20')](respondWithResult(_0x391d13,null))[_0x525a('0x2b')](handleError(_0x391d13,null));};exports[_0x525a('0x38')]=function(_0x4d7c3f,_0x5c49ce){return db[_0x525a('0x3e')]['find']({'where':{'id':_0x4d7c3f['params']['id']}})[_0x525a('0x20')](handleEntityNotFound(_0x5c49ce,null))['then'](removeEntity(_0x5c49ce,null))[_0x525a('0x2b')](handleError(_0x5c49ce,null));};exports[_0x525a('0x5c')]=function(_0x4292c8,_0x13c051){return db[_0x525a('0x3e')][_0x525a('0x5c')]()['then'](respondWithResult(_0x13c051,null))[_0x525a('0x2b')](handleError(_0x13c051,null));};var interaction_log=require(_0x525a('0x12'))(_0x525a('0x5d'));exports['accept']=function(_0xd04325,_0x39c57b,_0x48f41a){var _0x4b847d={'agent':{},'channel':_0x525a('0x5e')};if(_0xd04325[_0x525a('0x5b')]['id']){delete _0xd04325['body']['id'];}_0xd04325[_0x525a('0x5b')][_0x525a('0x5f')]=!![];_0xd04325[_0x525a('0x5b')][_0x525a('0x60')]=moment()[_0x525a('0x61')](_0x525a('0x62'));_0xd04325[_0x525a('0x5b')][_0x525a('0x63')]=_0xd04325[_0x525a('0x5b')][_0x525a('0x63')]||_0xd04325[_0x525a('0x64')]['id'];_0x4b847d[_0x525a('0x65')]['id']=_0xd04325[_0x525a('0x5b')][_0x525a('0x63')];return db[_0x525a('0x3e')]['find']({'where':{'id':_0xd04325[_0x525a('0x58')]['id'],'UserId':null}})[_0x525a('0x20')](handleEntityNotFound(_0x39c57b,null))[_0x525a('0x20')](saveUpdates(_0xd04325[_0x525a('0x5b')],null))[_0x525a('0x20')](function(_0x3ef7e8){if(_0x3ef7e8){_0x4b847d[_0x525a('0x29')]=_0x3ef7e8[_0x525a('0x66')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3ef7e8[_0x525a('0x67')]}});}return null;})[_0x525a('0x20')](handleEntityNotFound(_0x39c57b,null))[_0x525a('0x20')](function(_0x709dfe){if(_0x709dfe){return _0x709dfe[_0x525a('0x37')]({'UserId':_0xd04325['body'][_0x525a('0x63')],'read1stAt':_[_0x525a('0x68')](_0x709dfe[_0x525a('0x69')])?moment()[_0x525a('0x61')](_0x525a('0x62')):undefined});}return null;})[_0x525a('0x20')](function(_0x53c7fd){if(_0x53c7fd){_0x4b847d[_0x525a('0x6a')]=_0x53c7fd['get']({'plain':!![]});interaction_log[_0x525a('0x21')](_0x525a('0x6b'),_0xd04325['user']['id'],_0xd04325['user'][_0x525a('0x3a')],_0xd04325[_0x525a('0x64')][_0x525a('0x6c')],_0x4b847d[_0x525a('0x6a')]['id'],_0xd04325['body']?JSON[_0x525a('0x26')](_0xd04325['body']):_0x525a('0x6d'));return respondWithRpcPromise(_0x525a('0x6e'),_0x525a('0x6f'),_0x4b847d);}return null;})[_0x525a('0x20')](function(_0x317671){var _0x18fae7=_0x525a('0x70')+_0x317671[_0x525a('0x29')][_0x525a('0x71')];return db['sequelize'][_0x525a('0x48')](_0x18fae7,{'type':db['Sequelize'][_0x525a('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x200c47){return _0x200c47;});})[_0x525a('0x20')](function(_0x468002){if(_0x468002){_0x4b847d[_0x525a('0x29')][_0x525a('0x73')]=_0x468002[0x0];if(!_0xd04325['body'][_0x525a('0x63')])return;return db[_0x525a('0x74')][_0x525a('0x59')]({'where':{'id':_0xd04325[_0x525a('0x5b')]['UserId'],'role':_0x525a('0x65')},'attributes':['id','name',_0x525a('0x75'),_0x525a('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x149203){if(!_0x149203)return null;_0x4b847d[_0x525a('0x29')][_0x525a('0x65')]=_0x149203;return _0x4b847d;})[_0x525a('0x20')](function(_0x397e1d){if(_0x397e1d){if(_0xd04325[_0x525a('0x5b')]['manual']){_0x4b847d['message'][_0x525a('0x77')]=util[_0x525a('0x61')](_0x525a('0x78'),_0xd04325[_0x525a('0x64')]['name']);_0x4b847d[_0x525a('0x29')][_0x525a('0x79')]=_0x4b847d[_0x525a('0x79')];_0x4b847d[_0x525a('0x29')][_0x525a('0x7a')]=_0x4b847d[_0x525a('0x79')];_0x4b847d[_0x525a('0x29')][_0x525a('0x7b')]=_0x525a('0x7c');return respondWithRpcPromise('EventManager',_0x525a('0x7d'),{'event':'acceptmessage','message':_0x4b847d[_0x525a('0x29')]},client9002)['then'](function(){return _0x4b847d;});}return _0x4b847d;}return null;})[_0x525a('0x20')](respondWithResult(_0x39c57b,null))['catch'](handleError(_0x39c57b,null));};var interaction_log=require(_0x525a('0x12'))(_0x525a('0x5d'));exports[_0x525a('0x36')]=function(_0x456fe0,_0x1d59f2,_0x34ea85){var _0x7b6efd={'agent':{},'channel':'sms'};if(_0x456fe0['body']['id']){delete _0x456fe0['body']['id'];}_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')]=_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')]||_0x456fe0[_0x525a('0x64')]['id'];_0x7b6efd['agent']['id']=_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')];return db[_0x525a('0x3e')][_0x525a('0x59')]({'where':{'id':_0x456fe0[_0x525a('0x58')]['id'],'UserId':null}})[_0x525a('0x20')](handleEntityNotFound(_0x1d59f2,null))[_0x525a('0x20')](function(_0xd44733){if(_0xd44733){_0x7b6efd[_0x525a('0x29')]=_0xd44733[_0x525a('0x66')]({'plain':!![]});return db[_0x525a('0x7e')][_0x525a('0x59')]({'where':{'id':_0xd44733['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1d59f2,null))[_0x525a('0x20')](function(_0x5b786b){if(_0x5b786b){_0x7b6efd[_0x525a('0x6a')]=_0x5b786b[_0x525a('0x66')]({'plain':!![]});interaction_log[_0x525a('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x456fe0[_0x525a('0x64')]['id'],_0x456fe0[_0x525a('0x64')][_0x525a('0x3a')],_0x456fe0[_0x525a('0x64')][_0x525a('0x6c')],_0x7b6efd['interaction']['id'],_0x456fe0[_0x525a('0x5b')]?JSON[_0x525a('0x26')](_0x456fe0[_0x525a('0x5b')]):_0x525a('0x6d'));return respondWithRpcPromise(_0x525a('0x7f'),_0x525a('0x80'),_0x7b6efd);}return null;})[_0x525a('0x20')](function(_0x5e74b0){var _0x21609b=_0x525a('0x70')+_0x5e74b0['message'][_0x525a('0x71')];return db['sequelize']['query'](_0x21609b,{'type':db[_0x525a('0x81')][_0x525a('0x72')]['SELECT'],'raw':!![]})[_0x525a('0x20')](function(_0x589142){return _0x589142;});})['then'](function(_0x3e476a){if(_0x3e476a){_0x7b6efd[_0x525a('0x29')][_0x525a('0x73')]=_0x3e476a[0x0];if(!_0x456fe0[_0x525a('0x5b')]['UserId'])return;return db[_0x525a('0x74')][_0x525a('0x59')]({'where':{'id':_0x456fe0[_0x525a('0x5b')][_0x525a('0x63')],'role':_0x525a('0x65')},'attributes':['id',_0x525a('0x3a'),_0x525a('0x75'),_0x525a('0x76'),_0x525a('0x82')],'raw':!![]});}return null;})['then'](function(_0x18c402){if(!_0x18c402)return null;_0x7b6efd['message'][_0x525a('0x65')]=_0x18c402;return _0x7b6efd;})['then'](function(_0x2b6042){if(_0x2b6042){_0x2b6042['message'][_0x525a('0x77')]=util[_0x525a('0x61')](_0x525a('0x78'),_0x456fe0[_0x525a('0x64')][_0x525a('0x3a')]);_0x2b6042[_0x525a('0x29')]['channel']=_0x7b6efd[_0x525a('0x79')];_0x2b6042[_0x525a('0x29')]['motionChannel']=_0x7b6efd[_0x525a('0x79')];_0x2b6042['message']['event']=_0x525a('0x36');respondWithRpcPromise(_0x525a('0x7d'),_0x525a('0x7d'),{'event':_0x525a('0x83'),'message':_0x2b6042[_0x525a('0x29')]},client9002);return _0x7b6efd;}return null;})[_0x525a('0x20')](respondWithResult(_0x1d59f2,null))[_0x525a('0x2b')](handleError(_0x1d59f2,null));};exports[_0x525a('0x2d')]=function(_0x1f2433,_0x14f670,_0xef9c7b){if(_0x1f2433[_0x525a('0x5b')]['id']){delete _0x1f2433['body']['id'];}var _0x494211;return db['SmsMessage'][_0x525a('0x59')]({'where':{'id':_0x1f2433[_0x525a('0x58')]['id']}})['then'](handleEntityNotFound(_0x14f670,null))[_0x525a('0x20')](function(_0x289df6){if(_0x289df6){_0x494211=_0x289df6;return db['SmsAccount'][_0x525a('0x59')]({'where':{'id':_0x289df6[_0x525a('0x84')]}});}})[_0x525a('0x20')](handleEntityNotFound(_0x14f670,null))['then'](function(_0x11d4af){if(_0x11d4af){logger[_0x525a('0x24')](_0x525a('0x25'),'status',_0x525a('0x85'),_0x11d4af[_0x525a('0x40')],util[_0x525a('0x86')](_0x1f2433[_0x525a('0x5b')],{'showHidden':![],'depth':null}));switch(_0x11d4af[_0x525a('0x40')]){case'twilio':if(_0x1f2433[_0x525a('0x5b')][_0x525a('0x87')]&&_0x1f2433[_0x525a('0x5b')][_0x525a('0x87')]===_0x494211[_0x525a('0x88')]){return _0x494211['update']({'read':!![]});}else{logger[_0x525a('0x27')](_0x525a('0x89'),_0x525a('0x2d'),'twilio',util[_0x525a('0x86')](_0x1f2433['body'],{'showHidden':![],'depth':null}));}break;case _0x525a('0x8a'):if(_0x1f2433['body'][_0x525a('0x8b')]&&_0x1f2433[_0x525a('0x5b')][_0x525a('0x8b')]===_0x494211[_0x525a('0x88')]&&_[_0x525a('0x8c')]([_0x525a('0x8d'),_0x525a('0x8e')],_0x1f2433['body']['Status'])>=0x0){return _0x494211[_0x525a('0x37')]({'read':!![]});}else{logger['error'](_0x525a('0x89'),_0x525a('0x2d'),_0x525a('0x8f'),util['inspect'](_0x1f2433[_0x525a('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x525a('0x90'):var _0x23cb08=_0x1f2433[_0x525a('0x5b')][_0x525a('0x91')][0x0];if(_0x23cb08[_0x525a('0x2d')]['groupName']===_0x525a('0x92')){return _0x494211[_0x525a('0x37')]({'read':!![]});}else{logger[_0x525a('0x27')](_0x525a('0x89'),'status',_0x525a('0x90'),util[_0x525a('0x86')](_0x1f2433[_0x525a('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x494211;}})[_0x525a('0x20')](respondWithResult(_0x14f670,null))[_0x525a('0x2b')](handleError(_0x14f670,null));}; \ No newline at end of file +var _0x4f31=['inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','limit','undefined','offset','Content-Range','apply','save','update','name','send','index','map','SmsMessage','fieldName','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','destroy','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE: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','QueryTypes','SELECT','contact','agent','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','fullname','email','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from'];(function(_0x39fdda,_0x1994e1){var _0x5c9d2f=function(_0x141709){while(--_0x141709){_0x39fdda['push'](_0x39fdda['shift']());}};_0x5c9d2f(++_0x1994e1);}(_0x4f31,0x13f));var _0x14f3=function(_0x11512c,_0x59da82){_0x11512c=_0x11512c-0x0;var _0xef24f2=_0x4f31[_0x11512c];return _0xef24f2;};'use strict';var emlformat=require(_0x14f3('0x0'));var rimraf=require(_0x14f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14f3('0x2'));var rp=require('request-promise');var moment=require(_0x14f3('0x3'));var BPromise=require(_0x14f3('0x4'));var Mustache=require(_0x14f3('0x5'));var util=require(_0x14f3('0x6'));var path=require('path');var sox=require(_0x14f3('0x7'));var csv=require(_0x14f3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14f3('0x9'));var squel=require(_0x14f3('0xa'));var crypto=require(_0x14f3('0xb'));var jsforce=require(_0x14f3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x14f3('0xd'));var Redis=require(_0x14f3('0xe'));var authService=require(_0x14f3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x14f3('0x10'));var hardwareService=require(_0x14f3('0x11'));var logger=require(_0x14f3('0x12'))(_0x14f3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x14f3('0x14'));var db=require(_0x14f3('0x15'))['db'];config['redis']=_[_0x14f3('0x16')](config['redis'],{'host':_0x14f3('0x17'),'port':0x18eb});var socket=require(_0x14f3('0x18'))(new Redis(config[_0x14f3('0x19')]));require(_0x14f3('0x1a'))[_0x14f3('0x1b')](socket);var jayson=require(_0x14f3('0x1c'));var client=jayson['client'][_0x14f3('0x1d')]({'port':0x232c});var client9002=jayson[_0x14f3('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a9ecb,_0x3e5a7d,_0x489aaa,_0x4e2e48){return new BPromise(function(_0xb241bd,_0x5db825){var _0x4561ff=_0x4e2e48||client;return _0x4561ff[_0x14f3('0x1f')](_0x5a9ecb,_0x489aaa)[_0x14f3('0x20')](function(_0x594fc4){logger[_0x14f3('0x21')](_0x14f3('0x22'),_0x3e5a7d,_0x14f3('0x23'));logger[_0x14f3('0x24')](_0x14f3('0x25'),_0x3e5a7d,'request\x20sent',JSON[_0x14f3('0x26')](_0x594fc4));if(_0x594fc4[_0x14f3('0x27')]){if(_0x594fc4[_0x14f3('0x27')]['code']===0x1f4){logger[_0x14f3('0x27')](_0x14f3('0x22'),_0x3e5a7d,_0x594fc4[_0x14f3('0x27')][_0x14f3('0x28')]);return _0x5db825(_0x594fc4[_0x14f3('0x27')][_0x14f3('0x28')]);}logger[_0x14f3('0x27')](_0x14f3('0x22'),_0x3e5a7d,_0x594fc4[_0x14f3('0x27')]['message']);return _0xb241bd(_0x594fc4[_0x14f3('0x27')]['message']);}else{logger['info'](_0x14f3('0x22'),_0x3e5a7d,_0x14f3('0x23'));_0xb241bd(_0x594fc4[_0x14f3('0x29')][_0x14f3('0x28')]);}})[_0x14f3('0x2a')](function(_0x4db176){logger[_0x14f3('0x27')]('SmsMessage,\x20%s,\x20%s',_0x3e5a7d,_0x4db176);_0x5db825(_0x4db176);});});}function respondWithStatusCode(_0x251232,_0x281a5c){_0x281a5c=_0x281a5c||0xcc;return function(_0x22c8f5){if(_0x22c8f5){return _0x251232[_0x14f3('0x2b')](_0x281a5c);}return _0x251232[_0x14f3('0x2c')](_0x281a5c)['end']();};}function respondWithResult(_0x36d045,_0x4598df){_0x4598df=_0x4598df||0xc8;return function(_0x2bf14d){if(_0x2bf14d){return _0x36d045[_0x14f3('0x2c')](_0x4598df)[_0x14f3('0x2d')](_0x2bf14d);}};}function respondWithFilteredResult(_0x269abe,_0x1bce4f){return function(_0x3bd24a){if(_0x3bd24a){var _0x50aae3=typeof _0x1bce4f['offset']==='undefined'&&typeof _0x1bce4f[_0x14f3('0x2e')]===_0x14f3('0x2f');var _0x22d364=_0x3bd24a['count'];var _0x50f109=_0x50aae3?0x0:_0x1bce4f[_0x14f3('0x30')];var _0x37df7a=_0x50aae3?_0x3bd24a['count']:_0x1bce4f[_0x14f3('0x30')]+_0x1bce4f[_0x14f3('0x2e')];var _0x1f7955;if(_0x37df7a>=_0x22d364){_0x37df7a=_0x22d364;_0x1f7955=0xc8;}else{_0x1f7955=0xce;}_0x269abe[_0x14f3('0x2c')](_0x1f7955);return _0x269abe['set'](_0x14f3('0x31'),_0x50f109+'-'+_0x37df7a+'/'+_0x22d364)[_0x14f3('0x2d')](_0x3bd24a);}return null;};}function patchUpdates(_0x2f29e9){return function(_0x31f81a){try{jsonpatch[_0x14f3('0x32')](_0x31f81a,_0x2f29e9,!![]);}catch(_0xbce5e9){return BPromise['reject'](_0xbce5e9);}return _0x31f81a[_0x14f3('0x33')]();};}function saveUpdates(_0x5992c8,_0x556b4b){return function(_0x1ed518){if(_0x1ed518){return _0x1ed518[_0x14f3('0x34')](_0x5992c8)[_0x14f3('0x20')](function(_0x57bb46){return _0x57bb46;});}return null;};}function removeEntity(_0x3f6a03,_0x59ce02){return function(_0x4b2881){if(_0x4b2881){return _0x4b2881['destroy']()[_0x14f3('0x20')](function(){_0x3f6a03[_0x14f3('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x84d16c,_0x123a3b){return function(_0x777d9e){if(!_0x777d9e){_0x84d16c['sendStatus'](0x194);}return _0x777d9e;};}function handleError(_0x4a6c63,_0x1bda61){_0x1bda61=_0x1bda61||0x1f4;return function(_0x27a310){logger[_0x14f3('0x27')](_0x27a310['stack']);if(_0x27a310[_0x14f3('0x35')]){delete _0x27a310[_0x14f3('0x35')];}_0x4a6c63['status'](_0x1bda61)[_0x14f3('0x36')](_0x27a310);};}exports[_0x14f3('0x37')]=function(_0x367c94,_0x590304){var _0x5df358={},_0x4896ff={},_0x26efea={'count':0x0,'rows':[]};var _0x463039=_[_0x14f3('0x38')](db[_0x14f3('0x39')]['rawAttributes'],function(_0x15aea7){return{'name':_0x15aea7[_0x14f3('0x3a')],'type':_0x15aea7['type']['key']};});_0x4896ff[_0x14f3('0x3b')]=_['map'](_0x463039,_0x14f3('0x35'));_0x4896ff[_0x14f3('0x3c')]=_[_0x14f3('0x3d')](_0x367c94[_0x14f3('0x3c')]);_0x4896ff[_0x14f3('0x3e')]=_['intersection'](_0x4896ff['model'],_0x4896ff[_0x14f3('0x3c')]);_0x5df358[_0x14f3('0x3f')]=_[_0x14f3('0x40')](_0x4896ff['model'],qs[_0x14f3('0x41')](_0x367c94[_0x14f3('0x3c')][_0x14f3('0x41')]));_0x5df358[_0x14f3('0x3f')]=_0x5df358[_0x14f3('0x3f')][_0x14f3('0x42')]?_0x5df358[_0x14f3('0x3f')]:_0x4896ff['model'];if(!_0x367c94[_0x14f3('0x3c')]['hasOwnProperty'](_0x14f3('0x43'))){_0x5df358[_0x14f3('0x2e')]=qs[_0x14f3('0x2e')](_0x367c94[_0x14f3('0x3c')][_0x14f3('0x2e')]);_0x5df358[_0x14f3('0x30')]=qs[_0x14f3('0x30')](_0x367c94[_0x14f3('0x3c')][_0x14f3('0x30')]);}_0x5df358[_0x14f3('0x44')]=qs[_0x14f3('0x45')](_0x367c94[_0x14f3('0x3c')][_0x14f3('0x45')]);_0x5df358['where']=qs[_0x14f3('0x3e')](_[_0x14f3('0x46')](_0x367c94[_0x14f3('0x3c')],_0x4896ff[_0x14f3('0x3e')]),_0x463039);if(_0x367c94[_0x14f3('0x3c')]['filter']){_0x5df358[_0x14f3('0x47')]=_[_0x14f3('0x48')](_0x5df358[_0x14f3('0x47')],{'$or':_[_0x14f3('0x38')](_0x463039,function(_0x1f230f){if(_0x1f230f[_0x14f3('0x49')]!==_0x14f3('0x4a')){var _0x187396={};_0x187396[_0x1f230f[_0x14f3('0x35')]]={'$like':'%'+_0x367c94[_0x14f3('0x3c')][_0x14f3('0x4b')]+'%'};return _0x187396;}})});}_0x5df358=_['merge']({},_0x5df358,_0x367c94[_0x14f3('0x4c')]);var _0x3e080={'where':_0x5df358[_0x14f3('0x47')]};return db[_0x14f3('0x39')][_0x14f3('0x4d')](_0x3e080)['then'](function(_0x487d97){_0x26efea['count']=_0x487d97;if(_0x367c94['query'][_0x14f3('0x4e')]){_0x5df358[_0x14f3('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0x14f3('0x50')](_0x5df358);})[_0x14f3('0x20')](function(_0x59583c){_0x26efea[_0x14f3('0x51')]=_0x59583c;return _0x26efea;})[_0x14f3('0x20')](respondWithFilteredResult(_0x590304,_0x5df358))[_0x14f3('0x2a')](handleError(_0x590304,null));};exports[_0x14f3('0x52')]=function(_0x5a7f6d,_0x438af0){var _0x429e5b={'raw':!![],'where':{'id':_0x5a7f6d[_0x14f3('0x53')]['id']}},_0x3f86f7={};_0x3f86f7[_0x14f3('0x3b')]=_[_0x14f3('0x3d')](db[_0x14f3('0x39')][_0x14f3('0x54')]);_0x3f86f7[_0x14f3('0x3c')]=_[_0x14f3('0x3d')](_0x5a7f6d[_0x14f3('0x3c')]);_0x3f86f7[_0x14f3('0x3e')]=_['intersection'](_0x3f86f7[_0x14f3('0x3b')],_0x3f86f7[_0x14f3('0x3c')]);_0x429e5b[_0x14f3('0x3f')]=_[_0x14f3('0x40')](_0x3f86f7['model'],qs['fields'](_0x5a7f6d[_0x14f3('0x3c')][_0x14f3('0x41')]));_0x429e5b[_0x14f3('0x3f')]=_0x429e5b[_0x14f3('0x3f')][_0x14f3('0x42')]?_0x429e5b[_0x14f3('0x3f')]:_0x3f86f7[_0x14f3('0x3b')];if(_0x5a7f6d[_0x14f3('0x3c')]['includeAll']){_0x429e5b[_0x14f3('0x4f')]=[{'all':!![]}];}_0x429e5b=_[_0x14f3('0x48')]({},_0x429e5b,_0x5a7f6d[_0x14f3('0x4c')]);return db[_0x14f3('0x39')][_0x14f3('0x55')](_0x429e5b)[_0x14f3('0x20')](handleEntityNotFound(_0x438af0,null))[_0x14f3('0x20')](respondWithResult(_0x438af0,null))[_0x14f3('0x2a')](handleError(_0x438af0,null));};exports[_0x14f3('0x56')]=function(_0x16069e,_0xd891f4){return db[_0x14f3('0x39')][_0x14f3('0x56')](_0x16069e[_0x14f3('0x57')],{})['then'](respondWithResult(_0xd891f4,0xc9))[_0x14f3('0x2a')](handleError(_0xd891f4,null));};exports['update']=function(_0x26e57c,_0x3f64d8){if(_0x26e57c[_0x14f3('0x57')]['id']){delete _0x26e57c[_0x14f3('0x57')]['id'];}return db[_0x14f3('0x39')][_0x14f3('0x55')]({'where':{'id':_0x26e57c[_0x14f3('0x53')]['id']}})[_0x14f3('0x20')](handleEntityNotFound(_0x3f64d8,null))[_0x14f3('0x20')](saveUpdates(_0x26e57c[_0x14f3('0x57')],null))[_0x14f3('0x20')](respondWithResult(_0x3f64d8,null))[_0x14f3('0x2a')](handleError(_0x3f64d8,null));};exports[_0x14f3('0x58')]=function(_0x102199,_0x482b9d){return db[_0x14f3('0x39')][_0x14f3('0x55')]({'where':{'id':_0x102199[_0x14f3('0x53')]['id']}})[_0x14f3('0x20')](handleEntityNotFound(_0x482b9d,null))[_0x14f3('0x20')](removeEntity(_0x482b9d,null))[_0x14f3('0x2a')](handleError(_0x482b9d,null));};exports['describe']=function(_0xe7900c,_0x18057a){return db[_0x14f3('0x39')][_0x14f3('0x59')]()[_0x14f3('0x20')](respondWithResult(_0x18057a,null))['catch'](handleError(_0x18057a,null));};var interaction_log=require(_0x14f3('0x12'))(_0x14f3('0x5a'));exports[_0x14f3('0x5b')]=function(_0x2e9db2,_0x3f84ec,_0x5df5b4){var _0x568d13={'agent':{},'channel':'sms'};if(_0x2e9db2[_0x14f3('0x57')]['id']){delete _0x2e9db2['body']['id'];}_0x2e9db2[_0x14f3('0x57')]['read']=!![];_0x2e9db2[_0x14f3('0x57')][_0x14f3('0x5c')]=moment()[_0x14f3('0x5d')](_0x14f3('0x5e'));_0x2e9db2[_0x14f3('0x57')]['UserId']=_0x2e9db2[_0x14f3('0x57')]['UserId']||_0x2e9db2['user']['id'];_0x568d13['agent']['id']=_0x2e9db2[_0x14f3('0x57')][_0x14f3('0x5f')];return db[_0x14f3('0x39')]['find']({'where':{'id':_0x2e9db2[_0x14f3('0x53')]['id'],'UserId':null}})[_0x14f3('0x20')](handleEntityNotFound(_0x3f84ec,null))[_0x14f3('0x20')](saveUpdates(_0x2e9db2['body'],null))['then'](function(_0x433fae){if(_0x433fae){_0x568d13['message']=_0x433fae['get']({'plain':!![]});return db[_0x14f3('0x60')][_0x14f3('0x55')]({'where':{'id':_0x433fae[_0x14f3('0x61')]}});}return null;})[_0x14f3('0x20')](handleEntityNotFound(_0x3f84ec,null))[_0x14f3('0x20')](function(_0x422ff0){if(_0x422ff0){return _0x422ff0[_0x14f3('0x34')]({'UserId':_0x2e9db2[_0x14f3('0x57')][_0x14f3('0x5f')],'read1stAt':_[_0x14f3('0x62')](_0x422ff0[_0x14f3('0x63')])?moment()[_0x14f3('0x5d')](_0x14f3('0x5e')):undefined});}return null;})[_0x14f3('0x20')](function(_0x57ad89){if(_0x57ad89){_0x568d13[_0x14f3('0x64')]=_0x57ad89[_0x14f3('0x65')]({'plain':!![]});interaction_log[_0x14f3('0x21')](_0x14f3('0x66'),_0x2e9db2[_0x14f3('0x67')]['id'],_0x2e9db2[_0x14f3('0x67')]['name'],_0x2e9db2[_0x14f3('0x67')][_0x14f3('0x68')],_0x568d13['interaction']['id'],_0x2e9db2[_0x14f3('0x57')]?JSON['stringify'](_0x2e9db2[_0x14f3('0x57')]):_0x14f3('0x69'));return respondWithRpcPromise(_0x14f3('0x6a'),_0x14f3('0x6b'),_0x568d13);}return null;})[_0x14f3('0x20')](function(_0x2da9bd){var _0x22392a=_0x14f3('0x6c')+_0x2da9bd['message'][_0x14f3('0x6d')];return db[_0x14f3('0x6e')][_0x14f3('0x3c')](_0x22392a,{'type':db[_0x14f3('0x6f')][_0x14f3('0x70')][_0x14f3('0x71')],'raw':!![]})[_0x14f3('0x20')](function(_0x10fe34){return _0x10fe34;});})[_0x14f3('0x20')](function(_0x169c9c){if(_0x169c9c){_0x568d13[_0x14f3('0x28')][_0x14f3('0x72')]=_0x169c9c[0x0];if(!_0x2e9db2['body'][_0x14f3('0x5f')])return;return db['User']['find']({'where':{'id':_0x2e9db2[_0x14f3('0x57')][_0x14f3('0x5f')],'role':_0x14f3('0x73')},'attributes':['id',_0x14f3('0x35'),'fullname','email',_0x14f3('0x74')],'raw':!![]});}return null;})['then'](function(_0x16ae7e){if(!_0x16ae7e)return null;_0x568d13[_0x14f3('0x28')]['agent']=_0x16ae7e;return _0x568d13;})[_0x14f3('0x20')](function(_0x718a57){if(_0x718a57){if(_0x2e9db2[_0x14f3('0x57')][_0x14f3('0x75')]){_0x568d13[_0x14f3('0x28')][_0x14f3('0x76')]=util['format'](_0x14f3('0x77'),_0x2e9db2[_0x14f3('0x67')][_0x14f3('0x35')]);_0x568d13[_0x14f3('0x28')]['channel']=_0x568d13[_0x14f3('0x78')];_0x568d13['message']['motionChannel']=_0x568d13['channel'];_0x568d13[_0x14f3('0x28')][_0x14f3('0x79')]=_0x14f3('0x5b');return respondWithRpcPromise(_0x14f3('0x7a'),_0x14f3('0x7a'),{'event':_0x14f3('0x7b'),'message':_0x568d13[_0x14f3('0x28')]},client9002)['then'](function(){return _0x568d13;});}return _0x568d13;}return null;})[_0x14f3('0x20')](respondWithResult(_0x3f84ec,null))['catch'](handleError(_0x3f84ec,null));};var interaction_log=require(_0x14f3('0x12'))('sms-interactions');exports[_0x14f3('0x7c')]=function(_0x2dcc25,_0xfbe208,_0x415208){var _0x80a6d0={'agent':{},'channel':_0x14f3('0x7d')};if(_0x2dcc25['body']['id']){delete _0x2dcc25[_0x14f3('0x57')]['id'];}_0x2dcc25[_0x14f3('0x57')][_0x14f3('0x5f')]=_0x2dcc25['body'][_0x14f3('0x5f')]||_0x2dcc25['user']['id'];_0x80a6d0[_0x14f3('0x73')]['id']=_0x2dcc25[_0x14f3('0x57')]['UserId'];return db['SmsMessage'][_0x14f3('0x55')]({'where':{'id':_0x2dcc25[_0x14f3('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xfbe208,null))['then'](function(_0x2635e5){if(_0x2635e5){_0x80a6d0[_0x14f3('0x28')]=_0x2635e5[_0x14f3('0x65')]({'plain':!![]});return db[_0x14f3('0x60')][_0x14f3('0x55')]({'where':{'id':_0x2635e5[_0x14f3('0x61')]}});}return null;})[_0x14f3('0x20')](handleEntityNotFound(_0xfbe208,null))['then'](function(_0x5eea1c){if(_0x5eea1c){_0x80a6d0[_0x14f3('0x64')]=_0x5eea1c['get']({'plain':!![]});interaction_log['info'](_0x14f3('0x7e'),_0x2dcc25['user']['id'],_0x2dcc25['user'][_0x14f3('0x35')],_0x2dcc25['user'][_0x14f3('0x68')],_0x80a6d0[_0x14f3('0x64')]['id'],_0x2dcc25['body']?JSON[_0x14f3('0x26')](_0x2dcc25[_0x14f3('0x57')]):_0x14f3('0x69'));return respondWithRpcPromise(_0x14f3('0x7f'),_0x14f3('0x80'),_0x80a6d0);}return null;})['then'](function(_0x58f84d){var _0x27965c=_0x14f3('0x6c')+_0x58f84d[_0x14f3('0x28')][_0x14f3('0x6d')];return db[_0x14f3('0x6e')]['query'](_0x27965c,{'type':db[_0x14f3('0x6f')][_0x14f3('0x70')][_0x14f3('0x71')],'raw':!![]})[_0x14f3('0x20')](function(_0x2b0a9a){return _0x2b0a9a;});})[_0x14f3('0x20')](function(_0x49aea0){if(_0x49aea0){_0x80a6d0[_0x14f3('0x28')][_0x14f3('0x72')]=_0x49aea0[0x0];if(!_0x2dcc25[_0x14f3('0x57')][_0x14f3('0x5f')])return;return db[_0x14f3('0x81')][_0x14f3('0x55')]({'where':{'id':_0x2dcc25[_0x14f3('0x57')][_0x14f3('0x5f')],'role':_0x14f3('0x73')},'attributes':['id','name',_0x14f3('0x82'),_0x14f3('0x83'),_0x14f3('0x74')],'raw':!![]});}return null;})['then'](function(_0x40c0ab){if(!_0x40c0ab)return null;_0x80a6d0[_0x14f3('0x28')]['agent']=_0x40c0ab;return _0x80a6d0;})[_0x14f3('0x20')](function(_0x1416dc){if(_0x1416dc){_0x1416dc[_0x14f3('0x28')][_0x14f3('0x76')]=util['format']('SIP/%s',_0x2dcc25[_0x14f3('0x67')]['name']);_0x1416dc['message'][_0x14f3('0x78')]=_0x80a6d0['channel'];_0x1416dc[_0x14f3('0x28')][_0x14f3('0x84')]=_0x80a6d0['channel'];_0x1416dc[_0x14f3('0x28')]['event']=_0x14f3('0x7c');respondWithRpcPromise(_0x14f3('0x7a'),_0x14f3('0x7a'),{'event':_0x14f3('0x85'),'message':_0x1416dc[_0x14f3('0x28')]},client9002);return _0x80a6d0;}return null;})['then'](respondWithResult(_0xfbe208,null))[_0x14f3('0x2a')](handleError(_0xfbe208,null));};exports[_0x14f3('0x2c')]=function(_0x1d6764,_0x3604de,_0x44df23){if(_0x1d6764[_0x14f3('0x57')]['id']){delete _0x1d6764[_0x14f3('0x57')]['id'];}var _0x315d42;return db[_0x14f3('0x39')]['find']({'where':{'id':_0x1d6764['params']['id']}})[_0x14f3('0x20')](handleEntityNotFound(_0x3604de,null))[_0x14f3('0x20')](function(_0x41d17c){if(_0x41d17c){_0x315d42=_0x41d17c;return db[_0x14f3('0x86')]['find']({'where':{'id':_0x41d17c[_0x14f3('0x87')]}});}})['then'](handleEntityNotFound(_0x3604de,null))[_0x14f3('0x20')](function(_0x58e6af){if(_0x58e6af){logger[_0x14f3('0x24')](_0x14f3('0x25'),_0x14f3('0x2c'),_0x14f3('0x88'),_0x58e6af['type'],util[_0x14f3('0x89')](_0x1d6764['body'],{'showHidden':![],'depth':null}));switch(_0x58e6af[_0x14f3('0x49')]){case _0x14f3('0x8a'):if(_0x1d6764[_0x14f3('0x57')][_0x14f3('0x8b')]&&_0x1d6764['body'][_0x14f3('0x8b')]===_0x315d42[_0x14f3('0x8c')]){return _0x315d42[_0x14f3('0x34')]({'read':!![]});}else{logger[_0x14f3('0x27')](_0x14f3('0x8d'),_0x14f3('0x2c'),_0x14f3('0x8a'),util['inspect'](_0x1d6764[_0x14f3('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1d6764[_0x14f3('0x57')][_0x14f3('0x8e')]&&_0x1d6764[_0x14f3('0x57')][_0x14f3('0x8e')]===_0x315d42[_0x14f3('0x8c')]&&_[_0x14f3('0x8f')]([_0x14f3('0x90'),_0x14f3('0x91')],_0x1d6764[_0x14f3('0x57')][_0x14f3('0x92')])>=0x0){return _0x315d42[_0x14f3('0x34')]({'read':!![]});}else{logger[_0x14f3('0x27')](_0x14f3('0x8d'),_0x14f3('0x2c'),_0x14f3('0x93'),util[_0x14f3('0x89')](_0x1d6764[_0x14f3('0x57')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x18aecc=_0x1d6764['body'][_0x14f3('0x94')][0x0];if(_0x18aecc[_0x14f3('0x2c')][_0x14f3('0x95')]===_0x14f3('0x96')){return _0x315d42[_0x14f3('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x14f3('0x2c'),_0x14f3('0x97'),util[_0x14f3('0x89')](_0x1d6764[_0x14f3('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x315d42;}})[_0x14f3('0x20')](respondWithResult(_0x3604de,null))['catch'](handleError(_0x3604de,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index db2e4e2..3156fa5 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 _0xbe3e=['events','SmsMessage','setMaxListeners','update','emit','hook','exports'];(function(_0x1f8e33,_0x300371){var _0x37b939=function(_0x4d4fa4){while(--_0x4d4fa4){_0x1f8e33['push'](_0x1f8e33['shift']());}};_0x37b939(++_0x300371);}(_0xbe3e,0x1ab));var _0xebe3=function(_0x4535c7,_0x2c89c7){_0x4535c7=_0x4535c7-0x0;var _0x37ca9c=_0xbe3e[_0x4535c7];return _0x37ca9c;};'use strict';var EventEmitter=require(_0xebe3('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xebe3('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xebe3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xebe3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5a49ed){return function(_0x3e145c,_0x102d5a,_0x22d1f8){SmsMessageEvents[_0xebe3('0x4')](_0x5a49ed+':'+_0x3e145c['id'],_0x3e145c);SmsMessageEvents[_0xebe3('0x4')](_0x5a49ed,_0x3e145c);_0x22d1f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xebe3('0x5')](e,emitEvent(event));}}module[_0xebe3('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x92dd=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0xff81da,_0x5a25b8){var _0x478d3c=function(_0x2f12cb){while(--_0x2f12cb){_0xff81da['push'](_0xff81da['shift']());}};_0x478d3c(++_0x5a25b8);}(_0x92dd,0xe7));var _0xd92d=function(_0x36ee43,_0x440269){_0x36ee43=_0x36ee43-0x0;var _0x41b95a=_0x92dd[_0x36ee43];return _0x41b95a;};'use strict';var EventEmitter=require(_0xd92d('0x0'));var SmsMessage=require(_0xd92d('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd92d('0x2')](0x0);var events={'afterCreate':_0xd92d('0x3'),'afterUpdate':_0xd92d('0x4'),'afterDestroy':_0xd92d('0x5')};function emitEvent(_0x525e13){return function(_0x18f558,_0x284f95,_0x5260e1){SmsMessageEvents[_0xd92d('0x6')](_0x525e13+':'+_0x18f558['id'],_0x18f558);SmsMessageEvents[_0xd92d('0x6')](_0x525e13,_0x18f558);_0x5260e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xd92d('0x7')](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 afec69e..459e583 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 _0x37f8=['SmsAccount','find','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','sms','session_key','total_sent','deliveryReport','skebby','senderString','POST','https://smsapi.connectel.se/api/v2/send/','read','connectel','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','signature=','id_sms','csc','clickatell','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','secret'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x37f8,0xd2));var _0x837f=function(_0x22be3b,_0x243882){_0x22be3b=_0x22be3b-0x0;var _0x4e083f=_0x37f8[_0x22be3b];return _0x4e083f;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var logger=require(_0x837f('0x1'))(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require('bluebird');var rp=require(_0x837f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x19c939,_0x42986f){return _0x19c939[_0x837f('0x5')](_0x837f('0x6'),attributes,{'tableName':_0x837f('0x7'),'paranoid':![],'indexes':[{'name':_0x837f('0x8'),'fields':[_0x837f('0x8')]},{'name':_0x837f('0x9'),'fields':[_0x837f('0xa')],'type':_0x837f('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x475c7b,_0x1aea1e,_0x2063a3){var _0x1f8668=_0x19c939[_0x837f('0xc')];var _0x50b133=_0x475c7b[_0x837f('0xd')]({'plain':!![]});if(_0x50b133[_0x837f('0xe')][_0x837f('0xf')]()==='in'||_0x50b133[_0x837f('0xe')][_0x837f('0xf')]()==='out'&&!_0x50b133['secret']&&!_[_0x837f('0x10')](_0x50b133[_0x837f('0x11')])){_0x1f8668[_0x837f('0x12')][_0x837f('0x13')]({'where':{'id':_0x50b133[_0x837f('0x14')]}})['then'](function(_0x18d8aa){if(_0x18d8aa){_0x18d8aa[_0x837f('0x15')]({'lastMsgAt':_0x50b133[_0x837f('0x16')],'lastMsgDirection':_0x50b133[_0x837f('0xe')][_0x837f('0xf')]()});}})[_0x837f('0x17')](function(_0x546352){console[_0x837f('0x18')](_0x546352);});}if(_0x50b133[_0x837f('0xe')]==='out'&&!_0x50b133[_0x837f('0x19')]){var _0x2745f6;_0x1f8668[_0x837f('0x1a')][_0x837f('0x1b')]({'where':{'id':_0x50b133['SmsAccountId']},'raw':!![]})[_0x837f('0x1c')](function(_0x2d5d54){_0x2745f6=_0x2d5d54;if(_0x2745f6&&_0x2745f6[_0x837f('0x1d')]){switch(_0x2745f6[_0x837f('0x1d')]){case _0x837f('0x1e'):var _0x4e46c4=require(_0x837f('0x1e'));if(_0x2745f6[_0x837f('0x1f')]&&_0x2745f6[_0x837f('0x20')]&&_0x2745f6[_0x837f('0x21')]){var _0x3540f3=new _0x4e46c4(_0x2745f6['accountSid'],_0x2745f6[_0x837f('0x20')]);_0x3540f3[_0x837f('0x22')][_0x837f('0x23')]({'body':_0x50b133[_0x837f('0xa')],'to':_0x50b133[_0x837f('0x21')],'from':_0x2745f6[_0x837f('0x21')],'statusCallback':_0x2745f6[_0x837f('0x24')]+_0x837f('0x25')+_0x50b133['id']+_0x837f('0x26')+_0x2745f6[_0x837f('0x27')]})[_0x837f('0x1c')](function(_0xfb4df0){if(_0xfb4df0[_0x837f('0x28')]){return _0x475c7b[_0x837f('0x15')]({'messageId':_0xfb4df0[_0x837f('0x28')]});}})[_0x837f('0x17')](function(_0x43ca7d){logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x1e'),util[_0x837f('0x2b')](_0x43ca7d,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x1e'),_0x837f('0x2c'));}break;case'skebby':var _0x530f6d=_0x837f('0x2d');if(_0x2745f6[_0x837f('0x2e')]&&_0x2745f6[_0x837f('0x2f')]){var _0x4072a4={'recipient':[_0x50b133[_0x837f('0x21')]],'message':_0x50b133[_0x837f('0xa')],'message_type':_0x2745f6[_0x837f('0x30')]};if(_0x2745f6['smsMethod']&&_0x2745f6[_0x837f('0x30')]!=='SI'){_0x4072a4[_0x837f('0x31')]=_0x2745f6[_0x837f('0x21')];}var _0x3289b7={'url':_0x530f6d+'login?username='+_0x2745f6['username']+'&password='+_0x2745f6[_0x837f('0x2f')],'method':_0x837f('0x32')};rp(_0x3289b7)[_0x837f('0x1c')](function(_0x422498){var _0x5e186e=_0x422498[_0x837f('0x33')](';');var _0x4ac99c={'user_key':_0x5e186e[0x0],'session_key':_0x5e186e[0x1]};_0x3289b7={'url':_0x530f6d+_0x837f('0x34'),'method':'POST','headers':{'user_key':_0x4ac99c['user_key'],'Session_key':_0x4ac99c[_0x837f('0x35')]},'json':!![],'body':_0x4072a4};return rp(_0x3289b7);})[_0x837f('0x1c')](function(_0x359fea){if(_0x359fea[_0x837f('0x36')]>=0x1){var _0x42494b={'messageId':_0x359fea['internal_order_id']};if(_0x2745f6['smsMethod']!=='GP'||!_0x2745f6[_0x837f('0x37')]){_0x42494b['read']=!![];}return _0x475c7b[_0x837f('0x15')](_0x42494b);}else{return logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x38'),util[_0x837f('0x2b')](_0x359fea,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x26bde0){return logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x38'),util[_0x837f('0x2b')](_0x26bde0,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x837f('0x38'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x2745f6[_0x837f('0x20')]){var _0xb6951a={'recipient':_0x50b133['phone'],'message':_0x50b133['body'],'sender':_0x2745f6[_0x837f('0x39')]||_0x2745f6[_0x837f('0x21')],'authorization':_0x2745f6[_0x837f('0x20')]};var _0x1aea1e={'method':_0x837f('0x3a'),'uri':_0x837f('0x3b'),'body':_0xb6951a,'json':!![]};rp(_0x1aea1e)[_0x837f('0x1c')](function(_0x214e50){var _0x2ed1de={'messageId':_0x214e50['requestid']};if(!_0x2745f6['deliveryReport']){_0x2ed1de[_0x837f('0x3c')]=!![];}return _0x475c7b[_0x837f('0x15')](_0x2ed1de);})[_0x837f('0x17')](function(_0x53c0c7){logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x3d'),util['inspect'](_0x53c0c7,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case _0x837f('0x3e'):if(_0x2745f6[_0x837f('0x2e')]&&_0x2745f6[_0x837f('0x2f')]){var _0xb6951a={'messages':[{'source':_0x837f('0x3f'),'to':_0x50b133[_0x837f('0x21')],'body':_0x50b133[_0x837f('0xa')],'from':_0x2745f6[_0x837f('0x39')]||_0x2745f6[_0x837f('0x21')]}]};var _0xef98af=util['format'](_0x837f('0x40'),_0x2745f6[_0x837f('0x2e')],_0x2745f6['password']);var _0x1aea1e={'method':_0x837f('0x3a'),'uri':_0x837f('0x41'),'body':_0xb6951a,'headers':{'Authorization':util[_0x837f('0x42')](_0x837f('0x43'),new Buffer(_0xef98af)[_0x837f('0x44')]('base64'))},'json':!![]};rp(_0x1aea1e)[_0x837f('0x1c')](function(_0x18747f){if(_0x18747f[_0x837f('0x45')]>=0xc8&&_0x18747f[_0x837f('0x45')]<=0xce){if(_0x18747f[_0x837f('0x46')]&&_0x18747f[_0x837f('0x46')][_0x837f('0x47')]>0x0){var _0x1ba5bc=_['head'](_0x18747f[_0x837f('0x46')][_0x837f('0x22')]);var _0x4f9dcf={'messageId':_0x1ba5bc[_0x837f('0x48')]};if(!_0x2745f6[_0x837f('0x37')]){_0x4f9dcf['read']=!![];}return _0x475c7b[_0x837f('0x15')](_0x4f9dcf);}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x49'),util[_0x837f('0x2b')](_0x18747f,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x837f('0x29'),'afterCreate',_0x837f('0x49'),util[_0x837f('0x2b')](_0x18747f,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x39ce8b){logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate','clickSend',util['inspect'](_0x39ce8b,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate',_0x837f('0x49'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x837f('0x4a'):if(_0x2745f6[_0x837f('0x4b')]&&_0x2745f6[_0x837f('0x20')]){var _0xb6951a={'dst':_0x50b133[_0x837f('0x21')],'text':_0x50b133[_0x837f('0xa')],'src':_0x2745f6['senderString']||_0x2745f6[_0x837f('0x21')],'url':_0x2745f6['remote']+_0x837f('0x25')+_0x50b133['id']+_0x837f('0x26')+_0x2745f6[_0x837f('0x27')]};var _0xef98af=util[_0x837f('0x42')](_0x837f('0x40'),_0x2745f6[_0x837f('0x4b')],_0x2745f6[_0x837f('0x20')]);var _0x1aea1e={'method':_0x837f('0x3a'),'uri':util['format'](_0x837f('0x4c'),_0x2745f6[_0x837f('0x4b')]),'body':_0xb6951a,'headers':{'Authorization':util[_0x837f('0x42')](_0x837f('0x43'),new Buffer(_0xef98af)['toString'](_0x837f('0x4d')))},'json':!![]};rp(_0x1aea1e)['then'](function(_0x250e51){var _0x576365={'messageId':_0x250e51[_0x837f('0x4e')][0x0]};return _0x475c7b[_0x837f('0x15')](_0x576365);})[_0x837f('0x17')](function(_0x63cfe2){logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x4a'),util[_0x837f('0x2b')](_0x63cfe2,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),'plivo',_0x837f('0x4f'));}break;case _0x837f('0x50'):if(_0x2745f6['username']&&_0x2745f6[_0x837f('0x2f')]){if(_0x2745f6[_0x837f('0x51')]){var _0x6b06c1={'method':_0x837f('0x3a'),'uri':_0x2745f6[_0x837f('0x51')]+_0x837f('0x52'),'body':{'username':_0x2745f6[_0x837f('0x2e')],'password':_0x2745f6[_0x837f('0x2f')]},'json':!![]};return rp(_0x6b06c1)[_0x837f('0x1c')](function(_0x366a3a){var _0xb376c2={'method':_0x837f('0x3a'),'uri':_0x2745f6[_0x837f('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x2745f6[_0x837f('0x21')],'destinations':[{'to':_0x50b133[_0x837f('0x21')]}],'text':_0x50b133[_0x837f('0xa')],'notifyUrl':_0x2745f6['remote']+_0x837f('0x25')+_0x50b133['id']+_0x837f('0x26')+_0x2745f6[_0x837f('0x27')],'notifyContentType':_0x837f('0x53'),'callbackData':_0x2745f6[_0x837f('0x21')]+';'+_0x50b133[_0x837f('0xa')]}]},'headers':{'Authorization':_0x837f('0x54')+_0x366a3a['token']},'json':!![]};return rp(_0xb376c2)[_0x837f('0x1c')](function(_0x35d7d1){if(_0x35d7d1[_0x837f('0x22')]){var _0x5a2868={'messageId':_0x35d7d1[_0x837f('0x22')][0x0][_0x837f('0x8')]};if(!_0x2745f6[_0x837f('0x37')]){_0x5a2868[_0x837f('0x3c')]=!![];}return _0x475c7b['update'](_0x5a2868);}else{return logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),'infobip',util['inspect'](_0x35d7d1,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x323344){return logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x50'),util[_0x837f('0x2b')](_0x323344,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x50'),_0x837f('0x55'));}}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x128011=require(_0x837f('0x56'));if(_0x2745f6[_0x837f('0x57')]){var _0x474d2a={};_0x474d2a[_0x837f('0x58')]=_0x2745f6[_0x837f('0x2e')];_0x474d2a['phone']=_0x50b133[_0x837f('0x21')];_0x474d2a[_0x837f('0x31')]=_0x2745f6['phone'];_0x474d2a[_0x837f('0x59')]=_0x50b133[_0x837f('0xa')];_0x474d2a[_0x837f('0x5a')]=+new Date();var _0x5ccf08='';var _0x438297='';var _0x365bff=Object[_0x837f('0x5b')](_0x474d2a);_0x365bff['sort']();for(var _0x4a3dc7=0x0;_0x4a3dc7<_0x365bff[_0x837f('0x5c')];_0x4a3dc7++){if(_0x5ccf08!=''){_0x5ccf08+='&';}_0x5ccf08+=_0x365bff[_0x4a3dc7]+'='+encodeURIComponent(_0x474d2a[_0x365bff[_0x4a3dc7]]);_0x438297+=_0x474d2a[_0x365bff[_0x4a3dc7]];}_0x438297+=_0x2745f6['apiKey'];_0x438297=_0x128011[_0x837f('0x5d')](_0x837f('0x5e'))[_0x837f('0x15')](_0x438297)[_0x837f('0x5f')]('hex');if(_0x5ccf08!==''){_0x5ccf08+='&';}_0x5ccf08+=_0x837f('0x60')+_0x438297;var _0x3289b7={'method':_0x837f('0x32'),'uri':_0x2745f6['baseUrl']+'/external/get/send.php?'+_0x5ccf08,'json':!![]};return rp(_0x3289b7)[_0x837f('0x1c')](function(_0x130f36){var _0x262b76=Object['keys'](_0x130f36);if(_0x130f36[_0x262b76[0x0]]['error']&&parseInt(_0x130f36[_0x262b76[0x0]]['error'])===0x0){var _0x42071d={'messageId':_0x130f36[_0x262b76[0x0]][_0x837f('0x61')]};if(!_0x2745f6[_0x837f('0x37')]){_0x42071d[_0x837f('0x3c')]=!![];}return _0x475c7b['update'](_0x42071d);}else{return logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate',_0x837f('0x62'),util['inspect'](_0x130f36[_0x837f('0x18')],{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x14cfd9){return logger[_0x837f('0x18')](_0x837f('0x29'),'afterCreate',_0x837f('0x62'),util['inspect'](_0x14cfd9,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x62'),'Missing\x20parameters:\x20apiKey');}break;case _0x837f('0x63'):if(_0x2745f6[_0x837f('0x57')]){var _0x4e2cf6={'method':_0x837f('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2745f6[_0x837f('0x57')]},'body':{'content':_0x50b133[_0x837f('0xa')],'to':[_0x50b133['phone']],'from':_0x2745f6[_0x837f('0x21')],'binary':![],'clientMessageId':_0x837f('0x64'),'charset':_0x837f('0x65')},'json':!![]};rp(_0x4e2cf6)[_0x837f('0x1c')](function(_0x2ca1d8){if(!_0x2ca1d8[_0x837f('0x18')]){var _0x6202f0={'messageId':_0x2ca1d8[_0x837f('0x22')][0x0]['apiMessageId']};if(!_0x2745f6[_0x837f('0x37')]){_0x6202f0[_0x837f('0x3c')]=!![];}return _0x475c7b[_0x837f('0x15')](_0x6202f0);}else{return logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x63'),util['inspect'](_0x2ca1d8[_0x837f('0x18')],{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x457b22){return logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x63'),util[_0x837f('0x2b')](_0x457b22,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x63'),_0x837f('0x66'));}break;case _0x837f('0x67'):if(_0x2745f6[_0x837f('0x2e')]&&_0x2745f6[_0x837f('0x2f')]){var _0xef98af=util[_0x837f('0x42')](_0x837f('0x40'),_0x2745f6[_0x837f('0x2e')],_0x2745f6[_0x837f('0x2f')]);var _0x1aea1e={'method':_0x837f('0x3a'),'uri':_0x837f('0x68')+_0x2745f6[_0x837f('0x69')]+_0x837f('0x6a'),'body':{'to':[_0x50b133[_0x837f('0x21')]],'text':_0x50b133[_0x837f('0xa')],'from':_0x2745f6[_0x837f('0x21')],'applicationId':_0x2745f6[_0x837f('0x6b')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xef98af)[_0x837f('0x44')](_0x837f('0x4d')))},'json':!![]};rp(_0x1aea1e)[_0x837f('0x1c')](function(_0xe7a459){if(_0xe7a459['id']){var _0x166a50={'messageId':_0xe7a459['id']};return _0x475c7b[_0x837f('0x15')](_0x166a50);}else{logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x67'),util[_0x837f('0x2b')](_0xe7a459,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x803a0a){logger['error'](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x67'),util['inspect'](_0x803a0a,{'showHidden':![],'depth':null}));});}else{logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),'bandwidth',_0x837f('0x6c'));}break;case _0x837f('0x6d'):if(_0x2745f6['apiKey']){var _0x48ddbf={};var _0x3289b7={'method':_0x837f('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x2745f6[_0x837f('0x57')],'Content-Type':_0x837f('0x53')},'body':{'from':_0x2745f6[_0x837f('0x21')],'to':_0x50b133[_0x837f('0x21')],'text':_0x50b133[_0x837f('0xa')]},'json':!![]};return rp(_0x3289b7)[_0x837f('0x1c')](function(_0x35db13){if(_0x35db13[_0x837f('0x6e')]==0xca){_0x48ddbf[_0x837f('0x6f')]=_0x35db13;var _0x278ee1={'method':_0x837f('0x3a'),'uri':_0x837f('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x2745f6[_0x837f('0x57')],'Content-Type':_0x837f('0x53')},'body':{'refid':_0x48ddbf[_0x837f('0x6f')][_0x837f('0x71')]},'json':!![]};return rp(_0x278ee1)[_0x837f('0x1c')](function(_0x1e0883){_0x48ddbf[_0x837f('0x72')]=_0x1e0883;var _0x552af7={'messageId':_0x48ddbf[_0x837f('0x6f')][_0x837f('0x71')],'read':!![]};return _0x475c7b[_0x837f('0x15')](_0x552af7);});}else{return logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x6d'),util['inspect'](_0x35db13,{'showHidden':![],'depth':null}));}})[_0x837f('0x17')](function(_0x41fc30){return logger[_0x837f('0x18')](_0x837f('0x29'),_0x837f('0x2a'),_0x837f('0x6d'),util[_0x837f('0x2b')](_0x41fc30,{'showHidden':![],'depth':null}));});}else{return logger[_0x837f('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x837f('0x2a'),_0x837f('0x6d'),_0x837f('0x73'));}break;}}})['finally'](function(){_0x2063a3();});}else{_0x2063a3();}}},'charset':_0x837f('0x74'),'collate':_0x837f('0x75')});}; \ No newline at end of file +var _0x9532=['md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','apiMessageId','bandwidth','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsMessage.attributes','sms_messages','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','SmsInteraction','update','createdAt','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','password','sender','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','smsMethod','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messageId','csc','crypto','login','text','timestamp','keys','sort','length','apiKey'];(function(_0x481df5,_0x216652){var _0x32726e=function(_0x2133f4){while(--_0x2133f4){_0x481df5['push'](_0x481df5['shift']());}};_0x32726e(++_0x216652);}(_0x9532,0x8c));var _0x2953=function(_0x5f0e22,_0x1464bf){_0x5f0e22=_0x5f0e22-0x0;var _0x5582b1=_0x9532[_0x5f0e22];return _0x5582b1;};'use strict';var _=require(_0x2953('0x0'));var util=require(_0x2953('0x1'));var logger=require(_0x2953('0x2'))(_0x2953('0x3'));var moment=require(_0x2953('0x4'));var BPromise=require(_0x2953('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2953('0x6'));var rimraf=require(_0x2953('0x7'));var config=require('../../config/environment');var attributes=require(_0x2953('0x8'));module['exports']=function(_0x12de4a,_0x451c3c){return _0x12de4a['define']('SmsMessage',attributes,{'tableName':_0x2953('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x2953('0xa'),'fields':['body'],'type':_0x2953('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14e355,_0x20d976,_0xcc4af4){var _0x4c9cd8=_0x12de4a[_0x2953('0xc')];var _0x433b1d=_0x14e355[_0x2953('0xd')]({'plain':!![]});if(_0x433b1d[_0x2953('0xe')][_0x2953('0xf')]()==='in'||_0x433b1d[_0x2953('0xe')]['toLowerCase']()==='out'&&!_0x433b1d[_0x2953('0x10')]&&!_[_0x2953('0x11')](_0x433b1d['UserId'])){_0x4c9cd8[_0x2953('0x12')]['findOne']({'where':{'id':_0x433b1d['SmsInteractionId']}})['then'](function(_0x4e1e86){if(_0x4e1e86){_0x4e1e86[_0x2953('0x13')]({'lastMsgAt':_0x433b1d[_0x2953('0x14')],'lastMsgDirection':_0x433b1d[_0x2953('0xe')][_0x2953('0xf')]()});}})[_0x2953('0x15')](function(_0x4b9da7){console[_0x2953('0x16')](_0x4b9da7);});}if(_0x433b1d[_0x2953('0xe')]===_0x2953('0x17')&&!_0x433b1d[_0x2953('0x10')]){var _0x25dad2;_0x4c9cd8[_0x2953('0x18')][_0x2953('0x19')]({'where':{'id':_0x433b1d[_0x2953('0x1a')]},'raw':!![]})['then'](function(_0x2b9c97){_0x25dad2=_0x2b9c97;if(_0x25dad2&&_0x25dad2[_0x2953('0x1b')]){switch(_0x25dad2[_0x2953('0x1b')]){case _0x2953('0x1c'):var _0x2f303f=require(_0x2953('0x1c'));if(_0x25dad2[_0x2953('0x1d')]&&_0x25dad2[_0x2953('0x1e')]&&_0x25dad2[_0x2953('0x1f')]){var _0x68d656=new _0x2f303f(_0x25dad2[_0x2953('0x1d')],_0x25dad2[_0x2953('0x1e')]);_0x68d656[_0x2953('0x20')][_0x2953('0x21')]({'body':_0x433b1d[_0x2953('0x22')],'to':_0x433b1d['phone'],'from':_0x25dad2[_0x2953('0x1f')],'statusCallback':_0x25dad2[_0x2953('0x23')]+'/api/sms/messages/'+_0x433b1d['id']+_0x2953('0x24')+_0x25dad2[_0x2953('0x25')]})[_0x2953('0x26')](function(_0x25857e){if(_0x25857e[_0x2953('0x27')]){return _0x14e355[_0x2953('0x13')]({'messageId':_0x25857e[_0x2953('0x27')]});}})[_0x2953('0x15')](function(_0x3a7ae5){logger[_0x2953('0x16')](_0x2953('0x28'),'afterCreate',_0x2953('0x1c'),util['inspect'](_0x3a7ae5,{'showHidden':![],'depth':null}));});}else{logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x20e1c6=_0x2953('0x2a');if(_0x25dad2[_0x2953('0x2b')]&&_0x25dad2[_0x2953('0x2c')]){var _0x35040d={'recipient':[_0x433b1d[_0x2953('0x1f')]],'message':_0x433b1d[_0x2953('0x22')],'message_type':_0x25dad2['smsMethod']};if(_0x25dad2['smsMethod']&&_0x25dad2['smsMethod']!=='SI'){_0x35040d[_0x2953('0x2d')]=_0x25dad2[_0x2953('0x1f')];}var _0x4575db={'url':_0x20e1c6+_0x2953('0x2e')+_0x25dad2['username']+_0x2953('0x2f')+_0x25dad2[_0x2953('0x2c')],'method':_0x2953('0x30')};rp(_0x4575db)[_0x2953('0x26')](function(_0x4c808b){var _0x4525a2=_0x4c808b[_0x2953('0x31')](';');var _0x2245f8={'user_key':_0x4525a2[0x0],'session_key':_0x4525a2[0x1]};_0x4575db={'url':_0x20e1c6+_0x2953('0x32'),'method':_0x2953('0x33'),'headers':{'user_key':_0x2245f8[_0x2953('0x34')],'Session_key':_0x2245f8['session_key']},'json':!![],'body':_0x35040d};return rp(_0x4575db);})[_0x2953('0x26')](function(_0x2fb133){if(_0x2fb133[_0x2953('0x35')]>=0x1){var _0x216f01={'messageId':_0x2fb133[_0x2953('0x36')]};if(_0x25dad2[_0x2953('0x37')]!=='GP'||!_0x25dad2[_0x2953('0x38')]){_0x216f01[_0x2953('0x39')]=!![];}return _0x14e355[_0x2953('0x13')](_0x216f01);}else{return logger['error'](_0x2953('0x28'),_0x2953('0x29'),'skebby',util[_0x2953('0x3a')](_0x2fb133,{'showHidden':![],'depth':null}));}})[_0x2953('0x15')](function(_0x1b35e5){return logger['error'](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x3b'),util[_0x2953('0x3a')](_0x1b35e5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x3b'),_0x2953('0x3c'));}break;case _0x2953('0x3d'):if(_0x25dad2[_0x2953('0x1e')]){var _0x48b447={'recipient':_0x433b1d[_0x2953('0x1f')],'message':_0x433b1d[_0x2953('0x22')],'sender':_0x25dad2[_0x2953('0x3e')]||_0x25dad2[_0x2953('0x1f')],'authorization':_0x25dad2['authToken']};var _0x20d976={'method':_0x2953('0x33'),'uri':_0x2953('0x3f'),'body':_0x48b447,'json':!![]};rp(_0x20d976)[_0x2953('0x26')](function(_0x31c61f){var _0x40f2d3={'messageId':_0x31c61f['requestid']};if(!_0x25dad2[_0x2953('0x38')]){_0x40f2d3[_0x2953('0x39')]=!![];}return _0x14e355[_0x2953('0x13')](_0x40f2d3);})['catch'](function(_0x4f658c){logger['error'](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x3d'),util['inspect'](_0x4f658c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x3d'),_0x2953('0x40'));}break;case _0x2953('0x41'):if(_0x25dad2['username']&&_0x25dad2[_0x2953('0x2c')]){var _0x48b447={'messages':[{'source':_0x2953('0x42'),'to':_0x433b1d[_0x2953('0x1f')],'body':_0x433b1d[_0x2953('0x22')],'from':_0x25dad2[_0x2953('0x3e')]||_0x25dad2[_0x2953('0x1f')]}]};var _0x4d2a2e=util[_0x2953('0x43')](_0x2953('0x44'),_0x25dad2['username'],_0x25dad2[_0x2953('0x2c')]);var _0x20d976={'method':_0x2953('0x33'),'uri':_0x2953('0x45'),'body':_0x48b447,'headers':{'Authorization':util['format'](_0x2953('0x46'),new Buffer(_0x4d2a2e)[_0x2953('0x47')](_0x2953('0x48')))},'json':!![]};rp(_0x20d976)[_0x2953('0x26')](function(_0x430f37){if(_0x430f37[_0x2953('0x49')]>=0xc8&&_0x430f37[_0x2953('0x49')]<=0xce){if(_0x430f37[_0x2953('0x4a')]&&_0x430f37[_0x2953('0x4a')][_0x2953('0x4b')]>0x0){var _0x49f79c=_[_0x2953('0x4c')](_0x430f37['data']['messages']);var _0x365e32={'messageId':_0x49f79c['message_id']};if(!_0x25dad2[_0x2953('0x38')]){_0x365e32[_0x2953('0x39')]=!![];}return _0x14e355[_0x2953('0x13')](_0x365e32);}else{logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x4d'),util['inspect'](_0x430f37,{'showHidden':![],'depth':null}));}}else{logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x4d'),util[_0x2953('0x3a')](_0x430f37,{'showHidden':![],'depth':null}));}})[_0x2953('0x15')](function(_0x331961){logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x4d'),util[_0x2953('0x3a')](_0x331961,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953('0x29'),_0x2953('0x4d'),_0x2953('0x3c'));}break;case _0x2953('0x4e'):if(_0x25dad2['authId']&&_0x25dad2['authToken']){var _0x48b447={'dst':_0x433b1d['phone'],'text':_0x433b1d[_0x2953('0x22')],'src':_0x25dad2[_0x2953('0x3e')]||_0x25dad2['phone'],'url':_0x25dad2[_0x2953('0x23')]+_0x2953('0x4f')+_0x433b1d['id']+_0x2953('0x24')+_0x25dad2['token']};var _0x4d2a2e=util[_0x2953('0x43')](_0x2953('0x44'),_0x25dad2[_0x2953('0x50')],_0x25dad2[_0x2953('0x1e')]);var _0x20d976={'method':_0x2953('0x33'),'uri':util[_0x2953('0x43')](_0x2953('0x51'),_0x25dad2[_0x2953('0x50')]),'body':_0x48b447,'headers':{'Authorization':util[_0x2953('0x43')](_0x2953('0x46'),new Buffer(_0x4d2a2e)[_0x2953('0x47')]('base64'))},'json':!![]};rp(_0x20d976)['then'](function(_0x226567){var _0x5db7a8={'messageId':_0x226567['message_uuid'][0x0]};return _0x14e355['update'](_0x5db7a8);})['catch'](function(_0x2034b8){logger[_0x2953('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953('0x29'),_0x2953('0x4e'),util[_0x2953('0x3a')](_0x2034b8,{'showHidden':![],'depth':null}));});}else{logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x4e'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x2953('0x52'):if(_0x25dad2['username']&&_0x25dad2[_0x2953('0x2c')]){if(_0x25dad2[_0x2953('0x53')]){var _0x5b8966={'method':_0x2953('0x33'),'uri':_0x25dad2[_0x2953('0x53')]+_0x2953('0x54'),'body':{'username':_0x25dad2[_0x2953('0x2b')],'password':_0x25dad2[_0x2953('0x2c')]},'json':!![]};return rp(_0x5b8966)[_0x2953('0x26')](function(_0xfe59df){var _0x219e37={'method':_0x2953('0x33'),'uri':_0x25dad2[_0x2953('0x53')]+_0x2953('0x55'),'body':{'messages':[{'from':_0x25dad2[_0x2953('0x1f')],'destinations':[{'to':_0x433b1d[_0x2953('0x1f')]}],'text':_0x433b1d[_0x2953('0x22')],'notifyUrl':_0x25dad2['remote']+_0x2953('0x4f')+_0x433b1d['id']+_0x2953('0x24')+_0x25dad2[_0x2953('0x25')],'notifyContentType':_0x2953('0x56'),'callbackData':_0x25dad2[_0x2953('0x1f')]+';'+_0x433b1d[_0x2953('0x22')]}]},'headers':{'Authorization':_0x2953('0x57')+_0xfe59df['token']},'json':!![]};return rp(_0x219e37)[_0x2953('0x26')](function(_0x22a248){if(_0x22a248[_0x2953('0x20')]){var _0x32a59d={'messageId':_0x22a248[_0x2953('0x20')][0x0][_0x2953('0x58')]};if(!_0x25dad2[_0x2953('0x38')]){_0x32a59d[_0x2953('0x39')]=!![];}return _0x14e355[_0x2953('0x13')](_0x32a59d);}else{return logger[_0x2953('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953('0x29'),_0x2953('0x52'),util['inspect'](_0x22a248,{'showHidden':![],'depth':null}));}});})[_0x2953('0x15')](function(_0x5c80a8){return logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x52'),util[_0x2953('0x3a')](_0x5c80a8,{'showHidden':![],'depth':null}));});}else{logger[_0x2953('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2953('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x2953('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953('0x29'),_0x2953('0x52'),_0x2953('0x3c'));}break;case _0x2953('0x59'):var _0x5889c8=require(_0x2953('0x5a'));if(_0x25dad2['apiKey']){var _0x1fbcca={};_0x1fbcca[_0x2953('0x5b')]=_0x25dad2['username'];_0x1fbcca[_0x2953('0x1f')]=_0x433b1d[_0x2953('0x1f')];_0x1fbcca[_0x2953('0x2d')]=_0x25dad2['phone'];_0x1fbcca[_0x2953('0x5c')]=_0x433b1d['body'];_0x1fbcca[_0x2953('0x5d')]=+new Date();var _0x41be25='';var _0xd6399e='';var _0x313520=Object[_0x2953('0x5e')](_0x1fbcca);_0x313520[_0x2953('0x5f')]();for(var _0x5e8aab=0x0;_0x5e8aab<_0x313520[_0x2953('0x60')];_0x5e8aab++){if(_0x41be25!=''){_0x41be25+='&';}_0x41be25+=_0x313520[_0x5e8aab]+'='+encodeURIComponent(_0x1fbcca[_0x313520[_0x5e8aab]]);_0xd6399e+=_0x1fbcca[_0x313520[_0x5e8aab]];}_0xd6399e+=_0x25dad2[_0x2953('0x61')];_0xd6399e=_0x5889c8['createHash'](_0x2953('0x62'))[_0x2953('0x13')](_0xd6399e)[_0x2953('0x63')](_0x2953('0x64'));if(_0x41be25!==''){_0x41be25+='&';}_0x41be25+=_0x2953('0x65')+_0xd6399e;var _0x4575db={'method':_0x2953('0x30'),'uri':_0x25dad2[_0x2953('0x53')]+_0x2953('0x66')+_0x41be25,'json':!![]};return rp(_0x4575db)[_0x2953('0x26')](function(_0x317fc9){var _0x3eb4f5=Object[_0x2953('0x5e')](_0x317fc9);if(_0x317fc9[_0x3eb4f5[0x0]][_0x2953('0x16')]&&parseInt(_0x317fc9[_0x3eb4f5[0x0]][_0x2953('0x16')])===0x0){var _0x5793d4={'messageId':_0x317fc9[_0x3eb4f5[0x0]][_0x2953('0x67')]};if(!_0x25dad2[_0x2953('0x38')]){_0x5793d4[_0x2953('0x39')]=!![];}return _0x14e355[_0x2953('0x13')](_0x5793d4);}else{return logger[_0x2953('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2953('0x59'),util[_0x2953('0x3a')](_0x317fc9[_0x2953('0x16')],{'showHidden':![],'depth':null}));}})[_0x2953('0x15')](function(_0x462c75){return logger[_0x2953('0x16')](_0x2953('0x28'),'afterCreate',_0x2953('0x59'),util['inspect'](_0x462c75,{'showHidden':![],'depth':null}));});}else{logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x59'),_0x2953('0x68'));}break;case _0x2953('0x69'):if(_0x25dad2['apiKey']){var _0x8cfc1e={'method':_0x2953('0x33'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x25dad2[_0x2953('0x61')]},'body':{'content':_0x433b1d[_0x2953('0x22')],'to':[_0x433b1d[_0x2953('0x1f')]],'from':_0x25dad2[_0x2953('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x2953('0x6a')},'json':!![]};rp(_0x8cfc1e)[_0x2953('0x26')](function(_0x527c13){if(!_0x527c13[_0x2953('0x16')]){var _0x3f82c2={'messageId':_0x527c13[_0x2953('0x20')][0x0][_0x2953('0x6b')]};if(!_0x25dad2['deliveryReport']){_0x3f82c2[_0x2953('0x39')]=!![];}return _0x14e355[_0x2953('0x13')](_0x3f82c2);}else{return logger[_0x2953('0x16')](_0x2953('0x28'),'afterCreate','clickatell',util[_0x2953('0x3a')](_0x527c13[_0x2953('0x16')],{'showHidden':![],'depth':null}));}})[_0x2953('0x15')](function(_0xaf9050){return logger['error'](_0x2953('0x28'),'afterCreate',_0x2953('0x69'),util[_0x2953('0x3a')](_0xaf9050,{'showHidden':![],'depth':null}));});}else{logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x69'),_0x2953('0x68'));}break;case _0x2953('0x6c'):if(_0x25dad2[_0x2953('0x2b')]&&_0x25dad2[_0x2953('0x2c')]){var _0x4d2a2e=util[_0x2953('0x43')](_0x2953('0x44'),_0x25dad2['username'],_0x25dad2[_0x2953('0x2c')]);var _0x20d976={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x25dad2['accountId']+_0x2953('0x6d'),'body':{'to':[_0x433b1d[_0x2953('0x1f')]],'text':_0x433b1d['body'],'from':_0x25dad2[_0x2953('0x1f')],'applicationId':_0x25dad2['applicationId']},'headers':{'Authorization':util[_0x2953('0x43')](_0x2953('0x46'),new Buffer(_0x4d2a2e)[_0x2953('0x47')](_0x2953('0x48')))},'json':!![]};rp(_0x20d976)[_0x2953('0x26')](function(_0x407c9e){if(_0x407c9e['id']){var _0x28bef4={'messageId':_0x407c9e['id']};return _0x14e355[_0x2953('0x13')](_0x28bef4);}else{logger[_0x2953('0x16')](_0x2953('0x28'),'afterCreate',_0x2953('0x6c'),util[_0x2953('0x3a')](_0x407c9e,{'showHidden':![],'depth':null}));}})[_0x2953('0x15')](function(_0x172c63){logger[_0x2953('0x16')](_0x2953('0x28'),_0x2953('0x29'),_0x2953('0x6c'),util[_0x2953('0x3a')](_0x172c63,{'showHidden':![],'depth':null}));});}else{logger[_0x2953('0x16')](_0x2953('0x28'),'afterCreate',_0x2953('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x25dad2[_0x2953('0x61')]){var _0x5a0633={};var _0x4575db={'method':_0x2953('0x33'),'uri':_0x2953('0x6e'),'headers':{'Authorization':_0x2953('0x6f')+_0x25dad2[_0x2953('0x61')],'Content-Type':_0x2953('0x56')},'body':{'from':_0x25dad2[_0x2953('0x1f')],'to':_0x433b1d[_0x2953('0x1f')],'text':_0x433b1d[_0x2953('0x22')]},'json':!![]};return rp(_0x4575db)['then'](function(_0x484ee0){if(_0x484ee0[_0x2953('0x70')]==0xca){_0x5a0633[_0x2953('0x71')]=_0x484ee0;var _0x215d8b={'method':_0x2953('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x2953('0x6f')+_0x25dad2['apiKey'],'Content-Type':_0x2953('0x56')},'body':{'refid':_0x5a0633[_0x2953('0x71')][_0x2953('0x72')]},'json':!![]};return rp(_0x215d8b)[_0x2953('0x26')](function(_0x4186c4){_0x5a0633['status']=_0x4186c4;var _0x5ea250={'messageId':_0x5a0633[_0x2953('0x71')]['refid'],'read':!![]};return _0x14e355[_0x2953('0x13')](_0x5ea250);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953('0x29'),_0x2953('0x73'),util[_0x2953('0x3a')](_0x484ee0,{'showHidden':![],'depth':null}));}})[_0x2953('0x15')](function(_0x334150){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953('0x29'),_0x2953('0x73'),util[_0x2953('0x3a')](_0x334150,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2953('0x73'),_0x2953('0x74'));}break;}}})['finally'](function(){_0xcc4af4();});}else{_0xcc4af4();}}},'charset':_0x2953('0x75'),'collate':_0x2953('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3019fb4..7153884 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 _0x0579=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request\x20sent','debug','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','CreateSmsMessage','SmsMessage','body','options','raw','then','catch','lodash','util','bluebird','randomstring'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x0579,0xec));var _0x9057=function(_0x4534de,_0x967871){_0x4534de=_0x4534de-0x0;var _0x20819f=_0x0579[_0x4534de];return _0x20819f;};'use strict';var _=require(_0x9057('0x0'));var util=require(_0x9057('0x1'));var moment=require('moment');var BPromise=require(_0x9057('0x2'));var rs=require(_0x9057('0x3'));var fs=require('fs');var Redis=require(_0x9057('0x4'));var db=require(_0x9057('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9057('0x6'))(_0x9057('0x7'));var config=require(_0x9057('0x8'));var jayson=require(_0x9057('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9057('0xa')]=_[_0x9057('0xb')](config[_0x9057('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9057('0xc'))(new Redis(config['redis']));require(_0x9057('0xd'))[_0x9057('0xe')](socket);function respondWithRpcPromise(_0x41e955,_0x5455de,_0x37573a){return new BPromise(function(_0x22a570,_0x13dcb0){return client['request'](_0x41e955,_0x37573a)['then'](function(_0x15165f){logger['info']('SmsMessage,\x20%s,\x20%s',_0x5455de,_0x9057('0xf'));logger[_0x9057('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5455de,_0x9057('0xf'),JSON[_0x9057('0x11')](_0x15165f));if(_0x15165f['error']){if(_0x15165f['error']['code']===0x1f4){logger[_0x9057('0x12')](_0x9057('0x13'),_0x5455de,_0x15165f[_0x9057('0x12')][_0x9057('0x14')]);return _0x13dcb0(_0x15165f[_0x9057('0x12')][_0x9057('0x14')]);}logger[_0x9057('0x12')]('SmsMessage,\x20%s,\x20%s',_0x5455de,_0x15165f['error'][_0x9057('0x14')]);return _0x22a570(_0x15165f[_0x9057('0x12')]['message']);}else{logger[_0x9057('0x15')](_0x9057('0x13'),_0x5455de,_0x9057('0xf'));_0x22a570(_0x15165f[_0x9057('0x16')][_0x9057('0x14')]);}})['catch'](function(_0x35cb63){logger[_0x9057('0x12')](_0x9057('0x13'),_0x5455de,_0x35cb63);_0x13dcb0(_0x35cb63);});});}exports[_0x9057('0x17')]=function(_0x7e3c23){var _0x3d5f0c=this;return new Promise(function(_0x1adc29,_0x47837c){return db[_0x9057('0x18')]['create'](_0x7e3c23[_0x9057('0x19')],{'raw':_0x7e3c23['options']?_0x7e3c23[_0x9057('0x1a')][_0x9057('0x1b')]===undefined?!![]:![]:!![]})[_0x9057('0x1c')](function(_0x3b8acc){logger[_0x9057('0x15')]('CreateSmsMessage',_0x7e3c23);logger[_0x9057('0x10')]('CreateSmsMessage',_0x7e3c23,JSON[_0x9057('0x11')](_0x3b8acc));_0x1adc29(_0x3b8acc);})[_0x9057('0x1d')](function(_0x4c1e47){logger[_0x9057('0x12')](_0x9057('0x17'),_0x4c1e47[_0x9057('0x14')],_0x7e3c23);_0x47837c(_0x3d5f0c['error'](0x1f4,_0x4c1e47[_0x9057('0x14')]));});});}; \ No newline at end of file +var _0x7eae=['redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5d059f,_0x1b363f){var _0x2bcf71=function(_0x34602f){while(--_0x34602f){_0x5d059f['push'](_0x5d059f['shift']());}};_0x2bcf71(++_0x1b363f);}(_0x7eae,0x140));var _0xe7ea=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x7eae[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xe7ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe7ea('0x1'));var rs=require(_0xe7ea('0x2'));var fs=require('fs');var Redis=require(_0xe7ea('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe7ea('0x4'))(_0xe7ea('0x5'));var config=require(_0xe7ea('0x6'));var jayson=require(_0xe7ea('0x7'));var client=jayson[_0xe7ea('0x8')][_0xe7ea('0x9')]({'port':0x232a});config[_0xe7ea('0xa')]=_['defaults'](config[_0xe7ea('0xa')],{'host':_0xe7ea('0xb'),'port':0x18eb});var socket=require(_0xe7ea('0xc'))(new Redis(config[_0xe7ea('0xa')]));require(_0xe7ea('0xd'))[_0xe7ea('0xe')](socket);function respondWithRpcPromise(_0x3a9086,_0x2b2a66,_0x48dcc6){return new BPromise(function(_0x64600b,_0x1ea3f9){return client[_0xe7ea('0xf')](_0x3a9086,_0x48dcc6)[_0xe7ea('0x10')](function(_0x156d8a){logger[_0xe7ea('0x11')](_0xe7ea('0x12'),_0x2b2a66,_0xe7ea('0x13'));logger[_0xe7ea('0x14')](_0xe7ea('0x15'),_0x2b2a66,_0xe7ea('0x13'),JSON[_0xe7ea('0x16')](_0x156d8a));if(_0x156d8a[_0xe7ea('0x17')]){if(_0x156d8a[_0xe7ea('0x17')][_0xe7ea('0x18')]===0x1f4){logger[_0xe7ea('0x17')](_0xe7ea('0x12'),_0x2b2a66,_0x156d8a['error'][_0xe7ea('0x19')]);return _0x1ea3f9(_0x156d8a[_0xe7ea('0x17')][_0xe7ea('0x19')]);}logger[_0xe7ea('0x17')](_0xe7ea('0x12'),_0x2b2a66,_0x156d8a[_0xe7ea('0x17')][_0xe7ea('0x19')]);return _0x64600b(_0x156d8a[_0xe7ea('0x17')][_0xe7ea('0x19')]);}else{logger[_0xe7ea('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2b2a66,_0xe7ea('0x13'));_0x64600b(_0x156d8a[_0xe7ea('0x1a')][_0xe7ea('0x19')]);}})[_0xe7ea('0x1b')](function(_0x39894a){logger[_0xe7ea('0x17')](_0xe7ea('0x12'),_0x2b2a66,_0x39894a);_0x1ea3f9(_0x39894a);});});}exports[_0xe7ea('0x1c')]=function(_0x4d87c7){var _0x38954c=this;return new Promise(function(_0x2960fa,_0x473d52){return db[_0xe7ea('0x1d')]['create'](_0x4d87c7[_0xe7ea('0x1e')],{'raw':_0x4d87c7[_0xe7ea('0x1f')]?_0x4d87c7[_0xe7ea('0x1f')][_0xe7ea('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x35e327){logger['info']('CreateSmsMessage',_0x4d87c7);logger[_0xe7ea('0x14')](_0xe7ea('0x1c'),_0x4d87c7,JSON[_0xe7ea('0x16')](_0x35e327));_0x2960fa(_0x35e327);})['catch'](function(_0x5a7308){logger[_0xe7ea('0x17')](_0xe7ea('0x1c'),_0x5a7308[_0xe7ea('0x19')],_0x4d87c7);_0x473d52(_0x38954c['error'](0x1f4,_0x5a7308[_0xe7ea('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 374fa63..110ef9d 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 _0xedc6=['save','remove','update','smsMessage:','./smsMessage.events'];(function(_0x2c6d5b,_0x158029){var _0x2a5366=function(_0x279909){while(--_0x279909){_0x2c6d5b['push'](_0x2c6d5b['shift']());}};_0x2a5366(++_0x158029);}(_0xedc6,0x1a8));var _0x6edc=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xedc6[_0xf71120];return _0xbe2fd3;};'use strict';var SmsMessageEvents=require(_0x6edc('0x0'));var events=[_0x6edc('0x1'),_0x6edc('0x2'),_0x6edc('0x3')];function createListener(_0x5c6f21,_0xe508e9){return function(_0x495bc2){_0xe508e9['emit'](_0x5c6f21,_0x495bc2);};}function removeListener(_0x5d1cdf,_0x209ac0){return function(){SmsMessageEvents['removeListener'](_0x5d1cdf,_0x209ac0);};}exports['register']=function(_0xa3bc49){for(var _0xe41a9f=0x0,_0x3d6ae4=events['length'];_0xe41a9f<_0x3d6ae4;_0xe41a9f++){var _0x424590=events[_0xe41a9f];var _0xb82688=createListener(_0x6edc('0x4')+_0x424590,_0xa3bc49);SmsMessageEvents['on'](_0x424590,_0xb82688);}}; \ No newline at end of file +var _0x8bc4=['remove','update','emit','register','smsMessage:','save'];(function(_0x851ec0,_0x52c4c1){var _0xa062d5=function(_0x4c795d){while(--_0x4c795d){_0x851ec0['push'](_0x851ec0['shift']());}};_0xa062d5(++_0x52c4c1);}(_0x8bc4,0xe9));var _0x48bc=function(_0x29588a,_0x14c698){_0x29588a=_0x29588a-0x0;var _0x5f1398=_0x8bc4[_0x29588a];return _0x5f1398;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x48bc('0x0'),_0x48bc('0x1'),_0x48bc('0x2')];function createListener(_0x31f716,_0x2ba135){return function(_0x3361f1){_0x2ba135[_0x48bc('0x3')](_0x31f716,_0x3361f1);};}function removeListener(_0x4115f6,_0x475922){return function(){SmsMessageEvents['removeListener'](_0x4115f6,_0x475922);};}exports[_0x48bc('0x4')]=function(_0x459085){for(var _0x1276d4=0x0,_0x1266ee=events['length'];_0x1276d4<_0x1266ee;_0x1276d4++){var _0x1ae8be=events[_0x1276d4];var _0x1ef9d9=createListener(_0x48bc('0x5')+_0x1ae8be,_0x459085);SmsMessageEvents['on'](_0x1ae8be,_0x1ef9d9);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index e5ac2cf..2dbc625 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 _0xd0b2=['update','delete','destroy','/:id/teams','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','getTeams','/:id/users','getAgents','post','create'];(function(_0x2d91f2,_0x4b56ae){var _0x1ba446=function(_0x1668e0){while(--_0x1668e0){_0x2d91f2['push'](_0x2d91f2['shift']());}};_0x1ba446(++_0x4b56ae);}(_0xd0b2,0x74));var _0x2d0b=function(_0x332c4c,_0x9a12ff){_0x332c4c=_0x332c4c-0x0;var _0x3e8d3f=_0xd0b2[_0x332c4c];return _0x3e8d3f;};'use strict';var multer=require(_0x2d0b('0x0'));var util=require('util');var path=require(_0x2d0b('0x1'));var timeout=require(_0x2d0b('0x2'));var express=require('express');var router=express[_0x2d0b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2d0b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0x6')]);router[_0x2d0b('0x7')](_0x2d0b('0x8'),auth[_0x2d0b('0x5')](),controller['describe']);router['get'](_0x2d0b('0x9'),auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xa')]);router[_0x2d0b('0x7')]('/:id/members',auth[_0x2d0b('0x5')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xb')]);router['get'](_0x2d0b('0xc'),auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xd')]);router[_0x2d0b('0xe')]('/',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0xf')]);router['post']('/:id/teams',auth[_0x2d0b('0x5')](),controller['addTeams']);router['post'](_0x2d0b('0xc'),auth[_0x2d0b('0x5')](),controller['addAgents']);router['put']('/:id',auth[_0x2d0b('0x5')](),controller[_0x2d0b('0x10')]);router[_0x2d0b('0x11')](_0x2d0b('0x9'),auth[_0x2d0b('0x5')](),controller[_0x2d0b('0x12')]);router[_0x2d0b('0x11')](_0x2d0b('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x2d0b('0xc'),auth['isAuthenticated'](),controller[_0x2d0b('0x14')]);module[_0x2d0b('0x15')]=router; \ No newline at end of file +var _0xa276=['../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa276,0x111));var _0x6a27=function(_0x2592bd,_0x5aa296){_0x2592bd=_0x2592bd-0x0;var _0x43a95d=_0xa276[_0x2592bd];return _0x43a95d;};'use strict';var multer=require('multer');var util=require(_0x6a27('0x0'));var path=require(_0x6a27('0x1'));var timeout=require(_0x6a27('0x2'));var express=require(_0x6a27('0x3'));var router=express['Router']();var fs_extra=require(_0x6a27('0x4'));var auth=require(_0x6a27('0x5'));var interaction=require(_0x6a27('0x6'));var config=require(_0x6a27('0x7'));var controller=require(_0x6a27('0x8'));router['get']('/',auth[_0x6a27('0x9')](),controller[_0x6a27('0xa')]);router[_0x6a27('0xb')]('/describe',auth[_0x6a27('0x9')](),controller[_0x6a27('0xc')]);router[_0x6a27('0xb')](_0x6a27('0xd'),auth[_0x6a27('0x9')](),controller[_0x6a27('0xe')]);router[_0x6a27('0xb')](_0x6a27('0xf'),auth['isAuthenticated'](),controller[_0x6a27('0x10')]);router[_0x6a27('0xb')](_0x6a27('0x11'),auth['isAuthenticated'](),controller[_0x6a27('0x12')]);router[_0x6a27('0xb')]('/:id/users',auth[_0x6a27('0x9')](),controller[_0x6a27('0x13')]);router[_0x6a27('0x14')]('/',auth['isAuthenticated'](),controller[_0x6a27('0x15')]);router[_0x6a27('0x14')](_0x6a27('0x11'),auth[_0x6a27('0x9')](),controller[_0x6a27('0x16')]);router[_0x6a27('0x14')](_0x6a27('0x17'),auth['isAuthenticated'](),controller[_0x6a27('0x18')]);router[_0x6a27('0x19')](_0x6a27('0xd'),auth[_0x6a27('0x9')](),controller[_0x6a27('0x1a')]);router[_0x6a27('0x1b')](_0x6a27('0xd'),auth[_0x6a27('0x9')](),controller[_0x6a27('0x1c')]);router[_0x6a27('0x1b')](_0x6a27('0x11'),auth[_0x6a27('0x9')](),controller[_0x6a27('0x1d')]);router[_0x6a27('0x1b')](_0x6a27('0x17'),auth[_0x6a27('0x9')](),controller['removeAgents']);module[_0x6a27('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 8d25a9c..3ac447a 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 _0x50e7=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x2f365f,_0x4830a2){var _0x3266c4=function(_0x241f20){while(--_0x241f20){_0x2f365f['push'](_0x2f365f['shift']());}};_0x3266c4(++_0x4830a2);}(_0x50e7,0x19d));var _0x750e=function(_0x470805,_0x437de0){_0x470805=_0x470805-0x0;var _0x34cff0=_0x50e7[_0x470805];return _0x34cff0;};'use strict';var Sequelize=require('sequelize');module[_0x750e('0x0')]={'name':{'type':Sequelize[_0x750e('0x1')],'unique':_0x750e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x750e('0x1')]},'timeout':{'type':Sequelize[_0x750e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x750e('0x4'),_0x750e('0x5'),_0x750e('0x6'))}}; \ No newline at end of file +var _0xc1c8=['beepall','roundrobin','exports','rrmemory'];(function(_0x2720e7,_0x5758a5){var _0x39b035=function(_0x3f172b){while(--_0x3f172b){_0x2720e7['push'](_0x2720e7['shift']());}};_0x39b035(++_0x5758a5);}(_0xc1c8,0xa6));var _0x8c1c=function(_0x28b520,_0x24db8a){_0x28b520=_0x28b520-0x0;var _0x5c01d1=_0xc1c8[_0x28b520];return _0x5c01d1;};'use strict';var Sequelize=require('sequelize');module[_0x8c1c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8c1c('0x1'),_0x8c1c('0x2'),_0x8c1c('0x3'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c8e9ea2..b10e015 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 _0x0b4b=['Content-Range','reject','update','then','get','UserProfileResource','destroy','stack','name','index','map','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueue','count','includeAll','include','findAll','rows','catch','show','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','all','union','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x0b4b[_0x166742];return _0xb7814a;};'use strict';var emlformat=require(_0xb0b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0b4('0x1'));var jsonpatch=require(_0xb0b4('0x2'));var rp=require('request-promise');var moment=require(_0xb0b4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb0b4('0x4'));var util=require('util');var path=require(_0xb0b4('0x5'));var sox=require(_0xb0b4('0x6'));var csv=require(_0xb0b4('0x7'));var ejs=require(_0xb0b4('0x8'));var fs=require('fs');var fs_extra=require(_0xb0b4('0x9'));var _=require(_0xb0b4('0xa'));var squel=require(_0xb0b4('0xb'));var crypto=require(_0xb0b4('0xc'));var jsforce=require(_0xb0b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb0b4('0x7'));var querystring=require(_0xb0b4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb0b4('0xf'));var authService=require(_0xb0b4('0x10'));var qs=require(_0xb0b4('0x11'));var as=require(_0xb0b4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0b4('0x13'))(_0xb0b4('0x14'));var utils=require(_0xb0b4('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0b4('0x16'))['db'];config[_0xb0b4('0x17')]=_[_0xb0b4('0x18')](config['redis'],{'host':_0xb0b4('0x19'),'port':0x18eb});var socket=require(_0xb0b4('0x1a'))(new Redis(config[_0xb0b4('0x17')]));require(_0xb0b4('0x1b'))[_0xb0b4('0x1c')](socket);function respondWithStatusCode(_0x1b71fa,_0x1627cf){_0x1627cf=_0x1627cf||0xcc;return function(_0x2f864b){if(_0x2f864b){return _0x1b71fa[_0xb0b4('0x1d')](_0x1627cf);}return _0x1b71fa[_0xb0b4('0x1e')](_0x1627cf)[_0xb0b4('0x1f')]();};}function respondWithResult(_0x580ea4,_0x5d3252){_0x5d3252=_0x5d3252||0xc8;return function(_0x38bc91){if(_0x38bc91){return _0x580ea4['status'](_0x5d3252)[_0xb0b4('0x20')](_0x38bc91);}};}function respondWithFilteredResult(_0x32bf88,_0x2b8dad){return function(_0x225179){if(_0x225179){var _0x3a3daa=typeof _0x2b8dad[_0xb0b4('0x21')]==='undefined'&&typeof _0x2b8dad[_0xb0b4('0x22')]===_0xb0b4('0x23');var _0x2786ae=_0x225179['count'];var _0x5af140=_0x3a3daa?0x0:_0x2b8dad[_0xb0b4('0x21')];var _0x456a52=_0x3a3daa?_0x225179['count']:_0x2b8dad['offset']+_0x2b8dad['limit'];var _0x2c69f6;if(_0x456a52>=_0x2786ae){_0x456a52=_0x2786ae;_0x2c69f6=0xc8;}else{_0x2c69f6=0xce;}_0x32bf88['status'](_0x2c69f6);return _0x32bf88[_0xb0b4('0x24')](_0xb0b4('0x25'),_0x5af140+'-'+_0x456a52+'/'+_0x2786ae)[_0xb0b4('0x20')](_0x225179);}return null;};}function patchUpdates(_0x50aae4){return function(_0x1d24c4){try{jsonpatch['apply'](_0x1d24c4,_0x50aae4,!![]);}catch(_0x284cb2){return BPromise[_0xb0b4('0x26')](_0x284cb2);}return _0x1d24c4['save']();};}function saveUpdates(_0x593d23,_0x436871){return function(_0x45f012){if(_0x45f012){return _0x45f012[_0xb0b4('0x27')](_0x593d23)[_0xb0b4('0x28')](function(_0x25739e){return _0x25739e;});}return null;};}function removeEntity(_0x4aa328,_0x19eda7){return function(_0x1c3f24){if(_0x1c3f24){return _0x1c3f24['destroy']()[_0xb0b4('0x28')](function(){var _0x2f1250=_0x1c3f24[_0xb0b4('0x29')]({'plain':!![]});var _0x3e455d='SmsQueues';return db[_0xb0b4('0x2a')][_0xb0b4('0x2b')]({'where':{'type':_0x3e455d,'resourceId':_0x2f1250['id']}})['then'](function(){return _0x1c3f24;});})[_0xb0b4('0x28')](function(){_0x4aa328[_0xb0b4('0x1e')](0xcc)[_0xb0b4('0x1f')]();});}};}function handleEntityNotFound(_0x247d8b,_0x107023){return function(_0xf3791f){if(!_0xf3791f){_0x247d8b[_0xb0b4('0x1d')](0x194);}return _0xf3791f;};}function handleError(_0x240d6a,_0x408c36){_0x408c36=_0x408c36||0x1f4;return function(_0x334dca){logger['error'](_0x334dca[_0xb0b4('0x2c')]);if(_0x334dca['name']){delete _0x334dca[_0xb0b4('0x2d')];}_0x240d6a[_0xb0b4('0x1e')](_0x408c36)['send'](_0x334dca);};}exports[_0xb0b4('0x2e')]=function(_0x3acefd,_0x332f85){var _0x2c8bcd={},_0x5330bb={},_0x334368={'count':0x0,'rows':[]};var _0x43df28=_[_0xb0b4('0x2f')](db['SmsQueue']['rawAttributes'],function(_0xb92feb){return{'name':_0xb92feb['fieldName'],'type':_0xb92feb['type']['key']};});_0x5330bb[_0xb0b4('0x30')]=_['map'](_0x43df28,'name');_0x5330bb['query']=_['keys'](_0x3acefd['query']);_0x5330bb[_0xb0b4('0x31')]=_['intersection'](_0x5330bb[_0xb0b4('0x30')],_0x5330bb[_0xb0b4('0x32')]);_0x2c8bcd[_0xb0b4('0x33')]=_[_0xb0b4('0x34')](_0x5330bb['model'],qs[_0xb0b4('0x35')](_0x3acefd['query']['fields']));_0x2c8bcd[_0xb0b4('0x33')]=_0x2c8bcd[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x2c8bcd[_0xb0b4('0x33')]:_0x5330bb[_0xb0b4('0x30')];if(!_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x37')](_0xb0b4('0x38'))){_0x2c8bcd[_0xb0b4('0x22')]=qs[_0xb0b4('0x22')](_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0x2c8bcd['offset']=qs[_0xb0b4('0x21')](_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x21')]);}_0x2c8bcd[_0xb0b4('0x39')]=qs[_0xb0b4('0x3a')](_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x3a')]);_0x2c8bcd[_0xb0b4('0x3b')]=qs[_0xb0b4('0x31')](_[_0xb0b4('0x3c')](_0x3acefd[_0xb0b4('0x32')],_0x5330bb[_0xb0b4('0x31')]),_0x43df28);if(_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x3d')]){_0x2c8bcd[_0xb0b4('0x3b')]=_[_0xb0b4('0x3e')](_0x2c8bcd[_0xb0b4('0x3b')],{'$or':_[_0xb0b4('0x2f')](_0x43df28,function(_0x26fa23){if(_0x26fa23[_0xb0b4('0x3f')]!==_0xb0b4('0x40')){var _0x37cd3a={};_0x37cd3a[_0x26fa23[_0xb0b4('0x2d')]]={'$like':'%'+_0x3acefd[_0xb0b4('0x32')][_0xb0b4('0x3d')]+'%'};return _0x37cd3a;}})});}_0x2c8bcd=_[_0xb0b4('0x3e')]({},_0x2c8bcd,_0x3acefd[_0xb0b4('0x41')]);var _0x3ad2f8={'where':_0x2c8bcd['where']};return db[_0xb0b4('0x42')][_0xb0b4('0x43')](_0x3ad2f8)[_0xb0b4('0x28')](function(_0x41afde){_0x334368[_0xb0b4('0x43')]=_0x41afde;if(_0x3acefd['query'][_0xb0b4('0x44')]){_0x2c8bcd[_0xb0b4('0x45')]=[{'all':!![]}];}return db[_0xb0b4('0x42')][_0xb0b4('0x46')](_0x2c8bcd);})[_0xb0b4('0x28')](function(_0x2e4dc5){_0x334368[_0xb0b4('0x47')]=_0x2e4dc5;return _0x334368;})[_0xb0b4('0x28')](respondWithFilteredResult(_0x332f85,_0x2c8bcd))[_0xb0b4('0x48')](handleError(_0x332f85,null));};exports[_0xb0b4('0x49')]=function(_0x7db876,_0x1fe4af){var _0x5b72d6={'raw':!![],'where':{'id':_0x7db876['params']['id']}},_0x560430={};_0x560430[_0xb0b4('0x30')]=_[_0xb0b4('0x4a')](db[_0xb0b4('0x42')]['rawAttributes']);_0x560430[_0xb0b4('0x32')]=_[_0xb0b4('0x4a')](_0x7db876['query']);_0x560430['filters']=_[_0xb0b4('0x34')](_0x560430[_0xb0b4('0x30')],_0x560430[_0xb0b4('0x32')]);_0x5b72d6[_0xb0b4('0x33')]=_[_0xb0b4('0x34')](_0x560430[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x7db876[_0xb0b4('0x32')]['fields']));_0x5b72d6[_0xb0b4('0x33')]=_0x5b72d6[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x5b72d6[_0xb0b4('0x33')]:_0x560430[_0xb0b4('0x30')];if(_0x7db876[_0xb0b4('0x32')][_0xb0b4('0x44')]){_0x5b72d6[_0xb0b4('0x45')]=[{'all':!![]}];}_0x5b72d6=_[_0xb0b4('0x3e')]({},_0x5b72d6,_0x7db876[_0xb0b4('0x41')]);return db[_0xb0b4('0x42')][_0xb0b4('0x4b')](_0x5b72d6)[_0xb0b4('0x28')](handleEntityNotFound(_0x1fe4af,null))[_0xb0b4('0x28')](respondWithResult(_0x1fe4af,null))['catch'](handleError(_0x1fe4af,null));};exports[_0xb0b4('0x4c')]=function(_0x5f1667,_0x18a388){return db[_0xb0b4('0x42')]['create'](_0x5f1667['body'],{})[_0xb0b4('0x28')](function(_0x26d264){var _0x2edf02=_0x5f1667['user']['get']({'plain':!![]});if(!_0x2edf02)throw new Error(_0xb0b4('0x4d'));if(_0x2edf02[_0xb0b4('0x4e')]==='user'){var _0x40197e=_0x26d264['get']({'plain':!![]});var _0x3fc0af=_0xb0b4('0x4f');return db['UserProfileSection'][_0xb0b4('0x4b')]({'where':{'name':_0x3fc0af,'userProfileId':_0x2edf02['userProfileId']},'raw':!![]})[_0xb0b4('0x28')](function(_0xbf2400){if(_0xbf2400&&_0xbf2400[_0xb0b4('0x50')]===0x0){return db[_0xb0b4('0x2a')][_0xb0b4('0x4c')]({'name':_0x40197e[_0xb0b4('0x2d')],'resourceId':_0x40197e['id'],'type':_0xbf2400[_0xb0b4('0x2d')],'sectionId':_0xbf2400['id']},{})[_0xb0b4('0x28')](function(){return _0x26d264;});}else{return _0x26d264;}})[_0xb0b4('0x48')](function(_0x219062){logger['error'](_0xb0b4('0x51'),_0x219062);throw _0x219062;});}return _0x26d264;})[_0xb0b4('0x28')](respondWithResult(_0x18a388,0xc9))[_0xb0b4('0x48')](handleError(_0x18a388,null));};exports[_0xb0b4('0x27')]=function(_0x57c66e,_0x5a85c4){if(_0x57c66e[_0xb0b4('0x52')]['id']){delete _0x57c66e[_0xb0b4('0x52')]['id'];}return db['SmsQueue'][_0xb0b4('0x4b')]({'where':{'id':_0x57c66e['params']['id']}})['then'](handleEntityNotFound(_0x5a85c4,null))[_0xb0b4('0x28')](saveUpdates(_0x57c66e[_0xb0b4('0x52')],null))['then'](respondWithResult(_0x5a85c4,null))[_0xb0b4('0x48')](handleError(_0x5a85c4,null));};exports[_0xb0b4('0x2b')]=function(_0x26d601,_0x3e44e9){return db['SmsQueue'][_0xb0b4('0x4b')]({'where':{'id':_0x26d601[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x3e44e9,null))['then'](removeEntity(_0x3e44e9,null))[_0xb0b4('0x48')](handleError(_0x3e44e9,null));};exports[_0xb0b4('0x54')]=function(_0x1f4e41,_0x2bf12d){return db[_0xb0b4('0x42')][_0xb0b4('0x54')]()['then'](respondWithResult(_0x2bf12d,null))[_0xb0b4('0x48')](handleError(_0x2bf12d,null));};exports[_0xb0b4('0x55')]=function(_0x18e750,_0x43603b,_0x9fe44a){var _0x1fda97={'raw':!![],'where':{}},_0x173c32={},_0x3b4bfd;return db[_0xb0b4('0x42')][_0xb0b4('0x56')]({'where':{'id':_0x18e750[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x43603b,null))[_0xb0b4('0x28')](function(_0x1576b6){if(_0x1576b6){_0x3b4bfd=_0x1576b6['get']({'plain':!![]});_0x173c32['model']=_[_0xb0b4('0x4a')](db[_0xb0b4('0x57')][_0xb0b4('0x58')]);_0x173c32[_0xb0b4('0x32')]=_['keys'](_0x18e750['query']);_0x173c32[_0xb0b4('0x31')]=_['intersection'](_0x173c32[_0xb0b4('0x30')],_0x173c32[_0xb0b4('0x32')]);_0x1fda97['attributes']=_[_0xb0b4('0x34')](_0x173c32[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x18e750['query']['fields']));_0x1fda97[_0xb0b4('0x33')]=_0x1fda97[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x1fda97[_0xb0b4('0x33')]:_0x173c32[_0xb0b4('0x30')];if(!_0x18e750['query'][_0xb0b4('0x37')](_0xb0b4('0x38'))){_0x1fda97[_0xb0b4('0x22')]=qs['limit'](_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0x1fda97[_0xb0b4('0x21')]=qs[_0xb0b4('0x21')](_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x21')]);}_0x1fda97['order']=qs['sort'](_0x18e750['query'][_0xb0b4('0x3a')]);_0x1fda97[_0xb0b4('0x3b')]=qs[_0xb0b4('0x31')](_[_0xb0b4('0x3c')](_0x18e750[_0xb0b4('0x32')],_0x173c32[_0xb0b4('0x31')]));_0x1fda97['where'][_0xb0b4('0x59')]=_0x1576b6['id'];if(_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x3d')]){_0x1fda97[_0xb0b4('0x3b')]=_[_0xb0b4('0x3e')](_0x1fda97[_0xb0b4('0x3b')],{'$or':_[_0xb0b4('0x2f')](_0x1fda97[_0xb0b4('0x33')],function(_0x258e4a){var _0x4db1ab={};_0x4db1ab[_0x258e4a]={'$like':'%'+_0x18e750[_0xb0b4('0x32')][_0xb0b4('0x3d')]+'%'};return _0x4db1ab;})});}_0x1fda97=_[_0xb0b4('0x3e')]({},_0x1fda97,_0x18e750[_0xb0b4('0x41')]);return db[_0xb0b4('0x57')][_0xb0b4('0x46')](_0x1fda97);}})['then'](function(_0x13d0ff){if(_0x13d0ff){return db[_0xb0b4('0x5a')][_0xb0b4('0x5b')]({'where':{'id':_[_0xb0b4('0x2f')](_0x13d0ff,_0xb0b4('0x5c')),'role':_0xb0b4('0x5d')},'attributes':['id','name',_0xb0b4('0x5e'),_0xb0b4('0x5f'),_0xb0b4('0x60')]});}})[_0xb0b4('0x28')](function(_0x9d75b8){if(_0x9d75b8){return{'count':_0x9d75b8['count'],'rows':_[_0xb0b4('0x2f')](_0x9d75b8[_0xb0b4('0x47')],function(_0x26b406){return{'membername':_0x26b406[_0xb0b4('0x2d')],'UserId':_0x26b406['id'],'queue_name':_0x3b4bfd['name'],'SmsQueueId':_0x3b4bfd['id'],'interface':util['format']('%s/%s','SIP',_0x26b406[_0xb0b4('0x2d')]),'penalty':0x0,'paused':_0x26b406[_0xb0b4('0x5e')],'createdAt':_0x26b406[_0xb0b4('0x60')],'updatedAt':_0x26b406[_0xb0b4('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0b4('0x28')](respondWithFilteredResult(_0x43603b,_0x1fda97))[_0xb0b4('0x48')](handleError(_0x43603b,null));};exports[_0xb0b4('0x61')]=function(_0x4a16f3,_0x4be0b3,_0x4275b5){var _0xa53f76={};var _0xfb6527={};var _0x2d3f3e;var _0x759494;return db[_0xb0b4('0x42')][_0xb0b4('0x56')]({'where':{'id':_0x4a16f3['params']['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x4be0b3,null))['then'](function(_0x4f844a){if(_0x4f844a){_0x2d3f3e=_0x4f844a;_0xfb6527[_0xb0b4('0x30')]=_[_0xb0b4('0x4a')](db['Team']['rawAttributes']);_0xfb6527[_0xb0b4('0x32')]=_[_0xb0b4('0x4a')](_0x4a16f3[_0xb0b4('0x32')]);_0xfb6527[_0xb0b4('0x31')]=_['intersection'](_0xfb6527[_0xb0b4('0x30')],_0xfb6527['query']);_0xa53f76[_0xb0b4('0x33')]=_[_0xb0b4('0x34')](_0xfb6527[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x4a16f3[_0xb0b4('0x32')][_0xb0b4('0x35')]));_0xa53f76[_0xb0b4('0x33')]=_0xa53f76[_0xb0b4('0x33')]['length']?_0xa53f76[_0xb0b4('0x33')]:_0xfb6527[_0xb0b4('0x30')];_0xa53f76[_0xb0b4('0x39')]=qs[_0xb0b4('0x3a')](_0x4a16f3[_0xb0b4('0x32')]['sort']);_0xa53f76['where']=qs['filters'](_[_0xb0b4('0x3c')](_0x4a16f3[_0xb0b4('0x32')],_0xfb6527[_0xb0b4('0x31')]));if(_0x4a16f3['query'][_0xb0b4('0x3d')]){_0xa53f76[_0xb0b4('0x3b')]=_[_0xb0b4('0x3e')](_0xa53f76['where'],{'$or':_['map'](_0xa53f76[_0xb0b4('0x33')],function(_0x4e34a3){var _0x49ce5e={};_0x49ce5e[_0x4e34a3]={'$like':'%'+_0x4a16f3['query']['filter']+'%'};return _0x49ce5e;})});}_0xa53f76=_[_0xb0b4('0x3e')]({},_0xa53f76,_0x4a16f3[_0xb0b4('0x41')]);return _0x2d3f3e[_0xb0b4('0x61')](_0xa53f76);}})['then'](function(_0x5517c4){if(_0x5517c4){_0x759494=_0x5517c4[_0xb0b4('0x36')];if(!_0x4a16f3[_0xb0b4('0x32')][_0xb0b4('0x37')](_0xb0b4('0x38'))){_0xa53f76[_0xb0b4('0x22')]=qs[_0xb0b4('0x22')](_0x4a16f3[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0xa53f76[_0xb0b4('0x21')]=qs[_0xb0b4('0x21')](_0x4a16f3['query'][_0xb0b4('0x21')]);}return _0x2d3f3e['getTeams'](_0xa53f76);}})[_0xb0b4('0x28')](function(_0xe4ffb7){if(_0xe4ffb7){return _0xe4ffb7?{'count':_0x759494,'rows':_0xe4ffb7}:null;}})['then'](respondWithResult(_0x4be0b3,null))[_0xb0b4('0x48')](handleError(_0x4be0b3,null));};exports[_0xb0b4('0x62')]=function(_0x1842b8,_0x20a864,_0x397a33){var _0x56c21c=_0x1842b8[_0xb0b4('0x52')][_0xb0b4('0x63')];return db[_0xb0b4('0x64')]['findAll']({'where':{'id':_0x56c21c},'attributes':['id'],'include':[{'model':db[_0xb0b4('0x5a')],'as':_0xb0b4('0x65'),'attributes':['id',_0xb0b4('0x2d'),_0xb0b4('0x66'),_0xb0b4('0x67'),_0xb0b4('0x68')],'raw':!![]}]})[_0xb0b4('0x28')](function(_0x1c5488){if(_0x1c5488){var _0x5946a2=_['flatMap'](_0x1c5488,function(_0x15f6fe){var _0x3e823e=_0x15f6fe[_0xb0b4('0x29')]({'plain':!![]});return _0x3e823e['Agents'];});return db[_0xb0b4('0x42')][_0xb0b4('0x4b')]({'where':{'id':_0x1842b8[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](function(_0x2f5ac6){return db[_0xb0b4('0x69')][_0xb0b4('0x6a')](function(_0x34d95f){return _0x2f5ac6[_0xb0b4('0x62')](_0x56c21c,{'transaction':_0x34d95f})['then'](function(){return BPromise[_0xb0b4('0x6b')](_0x5946a2,function(_0x5a1ffe){return db[_0xb0b4('0x57')][_0xb0b4('0x6c')]({'where':{'UserId':_0x5a1ffe['id'],'SmsQueueId':_0x1842b8[_0xb0b4('0x53')]['id']},'transaction':_0x34d95f});});})[_0xb0b4('0x28')](function(){_0x5946a2[_0xb0b4('0x6d')](function(_0x29ea04){socket[_0xb0b4('0x6e')](_0xb0b4('0x6f'),{'UserId':_0x29ea04['id'],'SmsQueueId':_0x2f5ac6['id']});});});});});}})[_0xb0b4('0x28')](respondWithStatusCode(_0x20a864,null))[_0xb0b4('0x48')](handleError(_0x20a864,null));};exports[_0xb0b4('0x70')]=function(_0x549dee,_0x5d1d2e,_0x58e630){return db[_0xb0b4('0x64')][_0xb0b4('0x46')]({'where':{'id':_0x549dee['query'][_0xb0b4('0x63')]},'attributes':['id'],'include':[{'model':db[_0xb0b4('0x5a')],'as':_0xb0b4('0x65'),'attributes':['id'],'raw':!![]}]})[_0xb0b4('0x28')](handleEntityNotFound(_0x5d1d2e,null))[_0xb0b4('0x28')](function(_0x1c9524){var _0x530ce7=_[_0xb0b4('0x2f')](_0x1c9524,'id');var _0x23155d=[];var _0x3c4063=[];var _0x47b581=squel['select']();_0x47b581[_0xb0b4('0x71')](_0xb0b4('0x72'))['from'](_0xb0b4('0x73'),'tq')[_0xb0b4('0x74')]('user_has_teams','ut',_0xb0b4('0x75'))[_0xb0b4('0x3b')](_0xb0b4('0x76'),_0x549dee[_0xb0b4('0x53')]['id']);for(var _0x3bccc5=0x0;_0x3bccc5<_0x1c9524[_0xb0b4('0x36')];_0x3bccc5+=0x1){let _0x2be9a2=_0x1c9524[_0x3bccc5];for(var _0x24e94e=0x0;_0x24e94e<_0x2be9a2[_0xb0b4('0x65')][_0xb0b4('0x36')];_0x24e94e+=0x1){let _0x39fcc3=_0x2be9a2['Agents'][_0x24e94e];var _0x546871=_0x47b581[_0xb0b4('0x77')]();_0x546871['where']('ut.UserId\x20=\x20?',_0x39fcc3['id']);_0x3c4063[_0xb0b4('0x78')](db[_0xb0b4('0x69')][_0xb0b4('0x32')](_0x546871[_0xb0b4('0x79')](),{'type':db[_0xb0b4('0x69')][_0xb0b4('0x7a')]['SELECT']})['then'](function(_0xf25ccf){if(_0xf25ccf[_0xb0b4('0x36')]===0x1){return _0x39fcc3['id'];}else{var _0x32c07b=_[_0xb0b4('0x7b')](_[_0xb0b4('0x2f')](_0xf25ccf,'TeamId'),function(_0x56eef4){return _['includes'](_0x530ce7,_0x56eef4);});if(_0x32c07b){return _0x39fcc3['id'];}}}));}}return BPromise[_0xb0b4('0x7c')](_0x3c4063)[_0xb0b4('0x28')](function(_0x3f0c7d){_0x23155d=_(_0x23155d)[_0xb0b4('0x7d')](_0x3f0c7d)['compact']()['value']();return db['SmsQueue'][_0xb0b4('0x4b')]({'where':{'id':_0x549dee[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](function(_0x25b7e9){return db['sequelize'][_0xb0b4('0x6a')](function(_0x4eedc4){return _0x25b7e9[_0xb0b4('0x70')](_0x549dee[_0xb0b4('0x32')]['ids'],{'transaction':_0x4eedc4})['then'](function(){if(!_[_0xb0b4('0x7e')](_0x23155d)){return _0x25b7e9[_0xb0b4('0x7f')](_0x23155d,{'transaction':_0x4eedc4});}})[_0xb0b4('0x28')](function(){_0x23155d[_0xb0b4('0x6d')](function(_0x170fe3){socket[_0xb0b4('0x6e')](_0xb0b4('0x80'),{'UserId':_0x170fe3,'SmsQueueId':_0x25b7e9['id']});});});});});});})[_0xb0b4('0x28')](respondWithStatusCode(_0x5d1d2e,null))['catch'](handleError(_0x5d1d2e,null));};exports['addAgents']=function(_0x301c46,_0x25baee,_0x3a1c0a){return db[_0xb0b4('0x42')][_0xb0b4('0x4b')]({'where':{'id':_0x301c46[_0xb0b4('0x53')]['id']}})['then'](handleEntityNotFound(_0x25baee,null))[_0xb0b4('0x28')](function(_0x3857d4){if(_0x3857d4){return _0x3857d4[_0xb0b4('0x81')](_0x301c46[_0xb0b4('0x52')]['ids'],_[_0xb0b4('0x82')](_0x301c46[_0xb0b4('0x52')],[_0xb0b4('0x63'),'id'])||{})[_0xb0b4('0x83')](function(_0x4d31e4){for(var _0x536080=0x0;_0x536080<_0x301c46[_0xb0b4('0x52')]['ids']['length'];_0x536080+=0x1){socket[_0xb0b4('0x6e')](_0xb0b4('0x6f'),{'UserId':Number(_0x301c46['body'][_0xb0b4('0x63')][_0x536080]),'SmsQueueId':Number(_0x301c46[_0xb0b4('0x53')]['id'])});}return _0x4d31e4;});}})[_0xb0b4('0x28')](respondWithResult(_0x25baee,null))['catch'](handleError(_0x25baee,null));};exports[_0xb0b4('0x7f')]=function(_0x228ea3,_0x4602b5,_0x5c043e){return db[_0xb0b4('0x42')][_0xb0b4('0x4b')]({'where':{'id':_0x228ea3[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x4602b5,null))['then'](function(_0x49bcff){if(_0x49bcff){return _0x49bcff[_0xb0b4('0x7f')](_0x228ea3['query'][_0xb0b4('0x63')])[_0xb0b4('0x28')](function(){if(_[_0xb0b4('0x84')](_0x228ea3[_0xb0b4('0x32')][_0xb0b4('0x63')])){for(var _0x4ead1a=0x0;_0x4ead1a<_0x228ea3[_0xb0b4('0x32')]['ids'][_0xb0b4('0x36')];_0x4ead1a+=0x1){socket[_0xb0b4('0x6e')](_0xb0b4('0x80'),{'UserId':Number(_0x228ea3[_0xb0b4('0x32')][_0xb0b4('0x63')][_0x4ead1a]),'SmsQueueId':Number(_0x228ea3[_0xb0b4('0x53')]['id'])});}}else{socket[_0xb0b4('0x6e')](_0xb0b4('0x80'),{'UserId':Number(_0x228ea3[_0xb0b4('0x32')][_0xb0b4('0x63')]),'SmsQueueId':Number(_0x228ea3[_0xb0b4('0x53')]['id'])});}});}})[_0xb0b4('0x28')](respondWithStatusCode(_0x4602b5,null))[_0xb0b4('0x48')](handleError(_0x4602b5,null));};exports['getAgents']=function(_0x2edb07,_0x1c6766,_0x10e513){var _0x2e5b75={};var _0x41add9={};var _0x555ec3;var _0x3a0f1e;return db[_0xb0b4('0x42')][_0xb0b4('0x56')]({'where':{'id':_0x2edb07[_0xb0b4('0x53')]['id']}})[_0xb0b4('0x28')](handleEntityNotFound(_0x1c6766,null))[_0xb0b4('0x28')](function(_0x5b5431){if(_0x5b5431){_0x555ec3=_0x5b5431;_0x41add9['model']=_['keys'](db[_0xb0b4('0x5a')][_0xb0b4('0x58')]);_0x41add9[_0xb0b4('0x32')]=_[_0xb0b4('0x4a')](_0x2edb07['query']);_0x41add9[_0xb0b4('0x31')]=_['intersection'](_0x41add9[_0xb0b4('0x30')],_0x41add9[_0xb0b4('0x32')]);_0x2e5b75['attributes']=_[_0xb0b4('0x34')](_0x41add9[_0xb0b4('0x30')],qs[_0xb0b4('0x35')](_0x2edb07[_0xb0b4('0x32')]['fields']));_0x2e5b75['attributes']=_0x2e5b75[_0xb0b4('0x33')][_0xb0b4('0x36')]?_0x2e5b75[_0xb0b4('0x33')]:_0x41add9[_0xb0b4('0x30')];_0x2e5b75[_0xb0b4('0x39')]=qs[_0xb0b4('0x3a')](_0x2edb07[_0xb0b4('0x32')][_0xb0b4('0x3a')]);_0x2e5b75['where']=qs[_0xb0b4('0x31')](_['pick'](_0x2edb07[_0xb0b4('0x32')],_0x41add9[_0xb0b4('0x31')]));if(_0x2edb07[_0xb0b4('0x32')]['filter']){_0x2e5b75['where']=_[_0xb0b4('0x3e')](_0x2e5b75[_0xb0b4('0x3b')],{'$or':_[_0xb0b4('0x2f')](_0x2e5b75[_0xb0b4('0x33')],function(_0x34b5cc){var _0x46bcdf={};_0x46bcdf[_0x34b5cc]={'$like':'%'+_0x2edb07['query'][_0xb0b4('0x3d')]+'%'};return _0x46bcdf;})});}_0x2e5b75=_[_0xb0b4('0x3e')]({},_0x2e5b75,_0x2edb07[_0xb0b4('0x41')]);return _0x555ec3['getAgents'](_0x2e5b75);}})['then'](function(_0x5e44bf){if(_0x5e44bf){_0x3a0f1e=_0x5e44bf['length'];if(!_0x2edb07['query']['hasOwnProperty'](_0xb0b4('0x38'))){_0x2e5b75[_0xb0b4('0x22')]=qs[_0xb0b4('0x22')](_0x2edb07[_0xb0b4('0x32')][_0xb0b4('0x22')]);_0x2e5b75[_0xb0b4('0x21')]=qs[_0xb0b4('0x21')](_0x2edb07[_0xb0b4('0x32')]['offset']);}return _0x555ec3['getAgents'](_0x2e5b75);}})[_0xb0b4('0x28')](function(_0x4b046a){if(_0x4b046a){return _0x4b046a?{'count':_0x3a0f1e,'rows':_0x4b046a}:null;}})[_0xb0b4('0x28')](respondWithResult(_0x1c6766,null))[_0xb0b4('0x48')](handleError(_0x1c6766,null));}; \ No newline at end of file +var _0x6967=['union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','catch','show','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','params','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','rows','format','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6967,0x99));var _0x7696=function(_0x2570fa,_0x223e67){_0x2570fa=_0x2570fa-0x0;var _0xc36082=_0x6967[_0x2570fa];return _0xc36082;};'use strict';var emlformat=require(_0x7696('0x0'));var rimraf=require(_0x7696('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7696('0x2'));var rp=require(_0x7696('0x3'));var moment=require(_0x7696('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7696('0x5'));var util=require(_0x7696('0x6'));var path=require('path');var sox=require(_0x7696('0x7'));var csv=require(_0x7696('0x8'));var ejs=require(_0x7696('0x9'));var fs=require('fs');var fs_extra=require(_0x7696('0xa'));var _=require(_0x7696('0xb'));var squel=require(_0x7696('0xc'));var crypto=require('crypto');var jsforce=require(_0x7696('0xd'));var deskjs=require(_0x7696('0xe'));var toCsv=require(_0x7696('0x8'));var querystring=require(_0x7696('0xf'));var Papa=require(_0x7696('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7696('0x11'));var as=require(_0x7696('0x12'));var hardwareService=require(_0x7696('0x13'));var logger=require(_0x7696('0x14'))(_0x7696('0x15'));var utils=require(_0x7696('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7696('0x17'));var db=require(_0x7696('0x18'))['db'];config[_0x7696('0x19')]=_[_0x7696('0x1a')](config[_0x7696('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7696('0x1b'))(new Redis(config[_0x7696('0x19')]));require(_0x7696('0x1c'))['register'](socket);function respondWithStatusCode(_0x5c4bcd,_0x10a7ec){_0x10a7ec=_0x10a7ec||0xcc;return function(_0x89ab29){if(_0x89ab29){return _0x5c4bcd[_0x7696('0x1d')](_0x10a7ec);}return _0x5c4bcd[_0x7696('0x1e')](_0x10a7ec)[_0x7696('0x1f')]();};}function respondWithResult(_0x40d241,_0x1f7f83){_0x1f7f83=_0x1f7f83||0xc8;return function(_0x4262b8){if(_0x4262b8){return _0x40d241['status'](_0x1f7f83)['json'](_0x4262b8);}};}function respondWithFilteredResult(_0x93f5d1,_0x12a9d1){return function(_0x518562){if(_0x518562){var _0x3c5613=typeof _0x12a9d1[_0x7696('0x20')]===_0x7696('0x21')&&typeof _0x12a9d1[_0x7696('0x22')]===_0x7696('0x21');var _0x3c2064=_0x518562[_0x7696('0x23')];var _0x55f019=_0x3c5613?0x0:_0x12a9d1[_0x7696('0x20')];var _0x56928f=_0x3c5613?_0x518562['count']:_0x12a9d1[_0x7696('0x20')]+_0x12a9d1[_0x7696('0x22')];var _0x1da531;if(_0x56928f>=_0x3c2064){_0x56928f=_0x3c2064;_0x1da531=0xc8;}else{_0x1da531=0xce;}_0x93f5d1['status'](_0x1da531);return _0x93f5d1[_0x7696('0x24')]('Content-Range',_0x55f019+'-'+_0x56928f+'/'+_0x3c2064)[_0x7696('0x25')](_0x518562);}return null;};}function patchUpdates(_0x5b12bf){return function(_0x3336bf){try{jsonpatch[_0x7696('0x26')](_0x3336bf,_0x5b12bf,!![]);}catch(_0x1e8777){return BPromise[_0x7696('0x27')](_0x1e8777);}return _0x3336bf['save']();};}function saveUpdates(_0xefa2c4,_0x6e2282){return function(_0x56017c){if(_0x56017c){return _0x56017c['update'](_0xefa2c4)[_0x7696('0x28')](function(_0x3d16cb){return _0x3d16cb;});}return null;};}function removeEntity(_0x9d7a88,_0x7e2a40){return function(_0x43c92c){if(_0x43c92c){return _0x43c92c[_0x7696('0x29')]()[_0x7696('0x28')](function(){var _0x19b272=_0x43c92c['get']({'plain':!![]});var _0xd46c=_0x7696('0x2a');return db[_0x7696('0x2b')][_0x7696('0x29')]({'where':{'type':_0xd46c,'resourceId':_0x19b272['id']}})[_0x7696('0x28')](function(){return _0x43c92c;});})[_0x7696('0x28')](function(){_0x9d7a88[_0x7696('0x1e')](0xcc)[_0x7696('0x1f')]();});}};}function handleEntityNotFound(_0xc18df6,_0x4ab83b){return function(_0x1ee123){if(!_0x1ee123){_0xc18df6[_0x7696('0x1d')](0x194);}return _0x1ee123;};}function handleError(_0x6b5d3,_0x566a0b){_0x566a0b=_0x566a0b||0x1f4;return function(_0x1bbf51){logger[_0x7696('0x2c')](_0x1bbf51[_0x7696('0x2d')]);if(_0x1bbf51['name']){delete _0x1bbf51[_0x7696('0x2e')];}_0x6b5d3[_0x7696('0x1e')](_0x566a0b)[_0x7696('0x2f')](_0x1bbf51);};}exports[_0x7696('0x30')]=function(_0x183c09,_0x2b634d){var _0x2189ec={},_0x51959a={},_0x17a2dd={'count':0x0,'rows':[]};var _0x23be61=_[_0x7696('0x31')](db[_0x7696('0x32')][_0x7696('0x33')],function(_0x12a98c){return{'name':_0x12a98c[_0x7696('0x34')],'type':_0x12a98c[_0x7696('0x35')][_0x7696('0x36')]};});_0x51959a['model']=_['map'](_0x23be61,'name');_0x51959a[_0x7696('0x37')]=_[_0x7696('0x38')](_0x183c09[_0x7696('0x37')]);_0x51959a[_0x7696('0x39')]=_[_0x7696('0x3a')](_0x51959a[_0x7696('0x3b')],_0x51959a[_0x7696('0x37')]);_0x2189ec[_0x7696('0x3c')]=_['intersection'](_0x51959a[_0x7696('0x3b')],qs['fields'](_0x183c09[_0x7696('0x37')][_0x7696('0x3d')]));_0x2189ec[_0x7696('0x3c')]=_0x2189ec[_0x7696('0x3c')][_0x7696('0x3e')]?_0x2189ec[_0x7696('0x3c')]:_0x51959a['model'];if(!_0x183c09[_0x7696('0x37')][_0x7696('0x3f')](_0x7696('0x40'))){_0x2189ec[_0x7696('0x22')]=qs['limit'](_0x183c09[_0x7696('0x37')]['limit']);_0x2189ec[_0x7696('0x20')]=qs[_0x7696('0x20')](_0x183c09[_0x7696('0x37')][_0x7696('0x20')]);}_0x2189ec[_0x7696('0x41')]=qs[_0x7696('0x42')](_0x183c09[_0x7696('0x37')]['sort']);_0x2189ec[_0x7696('0x43')]=qs['filters'](_[_0x7696('0x44')](_0x183c09[_0x7696('0x37')],_0x51959a[_0x7696('0x39')]),_0x23be61);if(_0x183c09[_0x7696('0x37')]['filter']){_0x2189ec[_0x7696('0x43')]=_[_0x7696('0x45')](_0x2189ec['where'],{'$or':_['map'](_0x23be61,function(_0x195d60){if(_0x195d60[_0x7696('0x35')]!=='VIRTUAL'){var _0x284121={};_0x284121[_0x195d60[_0x7696('0x2e')]]={'$like':'%'+_0x183c09[_0x7696('0x37')][_0x7696('0x46')]+'%'};return _0x284121;}})});}_0x2189ec=_[_0x7696('0x45')]({},_0x2189ec,_0x183c09['options']);var _0x571242={'where':_0x2189ec[_0x7696('0x43')]};return db[_0x7696('0x32')][_0x7696('0x23')](_0x571242)[_0x7696('0x28')](function(_0x3ce75c){_0x17a2dd['count']=_0x3ce75c;if(_0x183c09[_0x7696('0x37')][_0x7696('0x47')]){_0x2189ec[_0x7696('0x48')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x2189ec);})[_0x7696('0x28')](function(_0x4d5484){_0x17a2dd['rows']=_0x4d5484;return _0x17a2dd;})[_0x7696('0x28')](respondWithFilteredResult(_0x2b634d,_0x2189ec))[_0x7696('0x49')](handleError(_0x2b634d,null));};exports[_0x7696('0x4a')]=function(_0x42a1af,_0x539f73){var _0x3de5b3={'raw':!![],'where':{'id':_0x42a1af['params']['id']}},_0x2e4a66={};_0x2e4a66[_0x7696('0x3b')]=_[_0x7696('0x38')](db['SmsQueue'][_0x7696('0x33')]);_0x2e4a66[_0x7696('0x37')]=_[_0x7696('0x38')](_0x42a1af[_0x7696('0x37')]);_0x2e4a66[_0x7696('0x39')]=_[_0x7696('0x3a')](_0x2e4a66[_0x7696('0x3b')],_0x2e4a66[_0x7696('0x37')]);_0x3de5b3[_0x7696('0x3c')]=_[_0x7696('0x3a')](_0x2e4a66[_0x7696('0x3b')],qs[_0x7696('0x3d')](_0x42a1af['query'][_0x7696('0x3d')]));_0x3de5b3[_0x7696('0x3c')]=_0x3de5b3[_0x7696('0x3c')][_0x7696('0x3e')]?_0x3de5b3[_0x7696('0x3c')]:_0x2e4a66[_0x7696('0x3b')];if(_0x42a1af[_0x7696('0x37')][_0x7696('0x47')]){_0x3de5b3['include']=[{'all':!![]}];}_0x3de5b3=_[_0x7696('0x45')]({},_0x3de5b3,_0x42a1af[_0x7696('0x4b')]);return db[_0x7696('0x32')]['find'](_0x3de5b3)[_0x7696('0x28')](handleEntityNotFound(_0x539f73,null))[_0x7696('0x28')](respondWithResult(_0x539f73,null))[_0x7696('0x49')](handleError(_0x539f73,null));};exports[_0x7696('0x4c')]=function(_0xfc14ac,_0xabcf7c){return db[_0x7696('0x32')][_0x7696('0x4c')](_0xfc14ac[_0x7696('0x4d')],{})[_0x7696('0x28')](function(_0xdc97bc){var _0x8d3940=_0xfc14ac[_0x7696('0x4e')][_0x7696('0x4f')]({'plain':!![]});if(!_0x8d3940)throw new Error(_0x7696('0x50'));if(_0x8d3940[_0x7696('0x51')]===_0x7696('0x4e')){var _0x37f6e9=_0xdc97bc['get']({'plain':!![]});var _0x48bba4=_0x7696('0x2a');return db[_0x7696('0x52')][_0x7696('0x53')]({'where':{'name':_0x48bba4,'userProfileId':_0x8d3940[_0x7696('0x54')]},'raw':!![]})['then'](function(_0x501e2b){if(_0x501e2b&&_0x501e2b['autoAssociation']===0x0){return db[_0x7696('0x2b')][_0x7696('0x4c')]({'name':_0x37f6e9[_0x7696('0x2e')],'resourceId':_0x37f6e9['id'],'type':_0x501e2b[_0x7696('0x2e')],'sectionId':_0x501e2b['id']},{})[_0x7696('0x28')](function(){return _0xdc97bc;});}else{return _0xdc97bc;}})['catch'](function(_0x21bc75){logger[_0x7696('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21bc75);throw _0x21bc75;});}return _0xdc97bc;})[_0x7696('0x28')](respondWithResult(_0xabcf7c,0xc9))[_0x7696('0x49')](handleError(_0xabcf7c,null));};exports[_0x7696('0x55')]=function(_0x4395b1,_0x214fd8){if(_0x4395b1[_0x7696('0x4d')]['id']){delete _0x4395b1[_0x7696('0x4d')]['id'];}return db[_0x7696('0x32')]['find']({'where':{'id':_0x4395b1[_0x7696('0x56')]['id']}})['then'](handleEntityNotFound(_0x214fd8,null))[_0x7696('0x28')](saveUpdates(_0x4395b1[_0x7696('0x4d')],null))[_0x7696('0x28')](respondWithResult(_0x214fd8,null))[_0x7696('0x49')](handleError(_0x214fd8,null));};exports['destroy']=function(_0x4b58da,_0x49ca7e){return db[_0x7696('0x32')][_0x7696('0x53')]({'where':{'id':_0x4b58da[_0x7696('0x56')]['id']}})[_0x7696('0x28')](handleEntityNotFound(_0x49ca7e,null))[_0x7696('0x28')](removeEntity(_0x49ca7e,null))[_0x7696('0x49')](handleError(_0x49ca7e,null));};exports['describe']=function(_0x1b0b90,_0x2b849c){return db[_0x7696('0x32')]['describe']()[_0x7696('0x28')](respondWithResult(_0x2b849c,null))[_0x7696('0x49')](handleError(_0x2b849c,null));};exports[_0x7696('0x57')]=function(_0x7810ab,_0x18b1c8,_0xd0346d){var _0x496632={'raw':!![],'where':{}},_0x389d97={},_0x24661a;return db['SmsQueue'][_0x7696('0x58')]({'where':{'id':_0x7810ab[_0x7696('0x56')]['id']}})['then'](handleEntityNotFound(_0x18b1c8,null))[_0x7696('0x28')](function(_0x77daba){if(_0x77daba){_0x24661a=_0x77daba[_0x7696('0x4f')]({'plain':!![]});_0x389d97['model']=_[_0x7696('0x38')](db[_0x7696('0x59')][_0x7696('0x33')]);_0x389d97[_0x7696('0x37')]=_[_0x7696('0x38')](_0x7810ab[_0x7696('0x37')]);_0x389d97[_0x7696('0x39')]=_[_0x7696('0x3a')](_0x389d97[_0x7696('0x3b')],_0x389d97[_0x7696('0x37')]);_0x496632['attributes']=_[_0x7696('0x3a')](_0x389d97[_0x7696('0x3b')],qs['fields'](_0x7810ab[_0x7696('0x37')][_0x7696('0x3d')]));_0x496632[_0x7696('0x3c')]=_0x496632[_0x7696('0x3c')]['length']?_0x496632[_0x7696('0x3c')]:_0x389d97['model'];if(!_0x7810ab[_0x7696('0x37')]['hasOwnProperty'](_0x7696('0x40'))){_0x496632[_0x7696('0x22')]=qs[_0x7696('0x22')](_0x7810ab[_0x7696('0x37')][_0x7696('0x22')]);_0x496632[_0x7696('0x20')]=qs[_0x7696('0x20')](_0x7810ab[_0x7696('0x37')][_0x7696('0x20')]);}_0x496632[_0x7696('0x41')]=qs[_0x7696('0x42')](_0x7810ab[_0x7696('0x37')][_0x7696('0x42')]);_0x496632[_0x7696('0x43')]=qs[_0x7696('0x39')](_[_0x7696('0x44')](_0x7810ab[_0x7696('0x37')],_0x389d97[_0x7696('0x39')]));_0x496632['where'][_0x7696('0x5a')]=_0x77daba['id'];if(_0x7810ab[_0x7696('0x37')][_0x7696('0x46')]){_0x496632['where']=_[_0x7696('0x45')](_0x496632[_0x7696('0x43')],{'$or':_[_0x7696('0x31')](_0x496632['attributes'],function(_0xa84987){var _0x3f5b11={};_0x3f5b11[_0xa84987]={'$like':'%'+_0x7810ab[_0x7696('0x37')][_0x7696('0x46')]+'%'};return _0x3f5b11;})});}_0x496632=_[_0x7696('0x45')]({},_0x496632,_0x7810ab['options']);return db[_0x7696('0x59')][_0x7696('0x5b')](_0x496632);}})[_0x7696('0x28')](function(_0x268acf){if(_0x268acf){return db[_0x7696('0x5c')]['findAndCountAll']({'where':{'id':_[_0x7696('0x31')](_0x268acf,_0x7696('0x5d')),'role':_0x7696('0x5e')},'attributes':['id',_0x7696('0x2e'),_0x7696('0x5f'),_0x7696('0x60'),_0x7696('0x61')]});}})[_0x7696('0x28')](function(_0x50cacd){if(_0x50cacd){return{'count':_0x50cacd['count'],'rows':_[_0x7696('0x31')](_0x50cacd[_0x7696('0x62')],function(_0x1527e1){return{'membername':_0x1527e1[_0x7696('0x2e')],'UserId':_0x1527e1['id'],'queue_name':_0x24661a[_0x7696('0x2e')],'SmsQueueId':_0x24661a['id'],'interface':util[_0x7696('0x63')]('%s/%s',_0x7696('0x64'),_0x1527e1['name']),'penalty':0x0,'paused':_0x1527e1['smsPause'],'createdAt':_0x1527e1[_0x7696('0x61')],'updatedAt':_0x1527e1[_0x7696('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7696('0x28')](respondWithFilteredResult(_0x18b1c8,_0x496632))[_0x7696('0x49')](handleError(_0x18b1c8,null));};exports['getTeams']=function(_0x632db9,_0x5620e1,_0x3f2d5b){var _0x2391f9={};var _0x42bfcc={};var _0x4f3619;var _0x25703c;return db[_0x7696('0x32')][_0x7696('0x58')]({'where':{'id':_0x632db9[_0x7696('0x56')]['id']}})[_0x7696('0x28')](handleEntityNotFound(_0x5620e1,null))[_0x7696('0x28')](function(_0x31f582){if(_0x31f582){_0x4f3619=_0x31f582;_0x42bfcc[_0x7696('0x3b')]=_[_0x7696('0x38')](db[_0x7696('0x65')][_0x7696('0x33')]);_0x42bfcc['query']=_[_0x7696('0x38')](_0x632db9[_0x7696('0x37')]);_0x42bfcc[_0x7696('0x39')]=_[_0x7696('0x3a')](_0x42bfcc['model'],_0x42bfcc[_0x7696('0x37')]);_0x2391f9[_0x7696('0x3c')]=_[_0x7696('0x3a')](_0x42bfcc[_0x7696('0x3b')],qs[_0x7696('0x3d')](_0x632db9['query'][_0x7696('0x3d')]));_0x2391f9['attributes']=_0x2391f9[_0x7696('0x3c')][_0x7696('0x3e')]?_0x2391f9[_0x7696('0x3c')]:_0x42bfcc[_0x7696('0x3b')];_0x2391f9[_0x7696('0x41')]=qs['sort'](_0x632db9['query'][_0x7696('0x42')]);_0x2391f9[_0x7696('0x43')]=qs[_0x7696('0x39')](_[_0x7696('0x44')](_0x632db9[_0x7696('0x37')],_0x42bfcc['filters']));if(_0x632db9[_0x7696('0x37')][_0x7696('0x46')]){_0x2391f9[_0x7696('0x43')]=_['merge'](_0x2391f9['where'],{'$or':_[_0x7696('0x31')](_0x2391f9[_0x7696('0x3c')],function(_0x1a54d3){var _0x2bde4f={};_0x2bde4f[_0x1a54d3]={'$like':'%'+_0x632db9[_0x7696('0x37')][_0x7696('0x46')]+'%'};return _0x2bde4f;})});}_0x2391f9=_[_0x7696('0x45')]({},_0x2391f9,_0x632db9[_0x7696('0x4b')]);return _0x4f3619['getTeams'](_0x2391f9);}})[_0x7696('0x28')](function(_0x4c835c){if(_0x4c835c){_0x25703c=_0x4c835c['length'];if(!_0x632db9[_0x7696('0x37')][_0x7696('0x3f')]('nolimit')){_0x2391f9[_0x7696('0x22')]=qs[_0x7696('0x22')](_0x632db9['query'][_0x7696('0x22')]);_0x2391f9[_0x7696('0x20')]=qs[_0x7696('0x20')](_0x632db9[_0x7696('0x37')][_0x7696('0x20')]);}return _0x4f3619[_0x7696('0x66')](_0x2391f9);}})[_0x7696('0x28')](function(_0x159221){if(_0x159221){return _0x159221?{'count':_0x25703c,'rows':_0x159221}:null;}})[_0x7696('0x28')](respondWithResult(_0x5620e1,null))[_0x7696('0x49')](handleError(_0x5620e1,null));};exports[_0x7696('0x67')]=function(_0xde6c1e,_0x1b4a71,_0x47c2af){var _0x2ab96b=_0xde6c1e['body'][_0x7696('0x68')];return db['Team'][_0x7696('0x5b')]({'where':{'id':_0x2ab96b},'attributes':['id'],'include':[{'model':db[_0x7696('0x5c')],'as':_0x7696('0x69'),'attributes':['id','name',_0x7696('0x6a'),_0x7696('0x6b'),_0x7696('0x6c')],'raw':!![]}]})[_0x7696('0x28')](function(_0x5bddc6){if(_0x5bddc6){var _0x34910d=_[_0x7696('0x6d')](_0x5bddc6,function(_0x218e0a){var _0x18a23b=_0x218e0a['get']({'plain':!![]});return _0x18a23b[_0x7696('0x69')];});return db[_0x7696('0x32')][_0x7696('0x53')]({'where':{'id':_0xde6c1e[_0x7696('0x56')]['id']}})[_0x7696('0x28')](function(_0x247252){return db[_0x7696('0x6e')][_0x7696('0x6f')](function(_0x45a65a){return _0x247252[_0x7696('0x67')](_0x2ab96b,{'transaction':_0x45a65a})[_0x7696('0x28')](function(){return BPromise[_0x7696('0x70')](_0x34910d,function(_0x3c832e){return db[_0x7696('0x59')][_0x7696('0x71')]({'where':{'UserId':_0x3c832e['id'],'SmsQueueId':_0xde6c1e[_0x7696('0x56')]['id']},'transaction':_0x45a65a});});})[_0x7696('0x28')](function(){_0x34910d[_0x7696('0x72')](function(_0xd3a05d){socket[_0x7696('0x73')](_0x7696('0x74'),{'UserId':_0xd3a05d['id'],'SmsQueueId':_0x247252['id']});});});});});}})[_0x7696('0x28')](respondWithStatusCode(_0x1b4a71,null))[_0x7696('0x49')](handleError(_0x1b4a71,null));};exports[_0x7696('0x75')]=function(_0x268f99,_0x558082,_0x9bb63b){return db[_0x7696('0x65')][_0x7696('0x5b')]({'where':{'id':_0x268f99[_0x7696('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7696('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7696('0x28')](handleEntityNotFound(_0x558082,null))[_0x7696('0x28')](function(_0x15380e){var _0x4bc56d=_[_0x7696('0x31')](_0x15380e,'id');var _0xa89b6=[];var _0x8dc500=[];var _0x1727fb=squel[_0x7696('0x76')]();_0x1727fb[_0x7696('0x77')](_0x7696('0x78'))['from'](_0x7696('0x79'),'tq')[_0x7696('0x7a')]('user_has_teams','ut',_0x7696('0x7b'))[_0x7696('0x43')](_0x7696('0x7c'),_0x268f99[_0x7696('0x56')]['id']);for(var _0x3c4609=0x0;_0x3c4609<_0x15380e[_0x7696('0x3e')];_0x3c4609+=0x1){let _0x24906d=_0x15380e[_0x3c4609];for(var _0x4bf0a5=0x0;_0x4bf0a5<_0x24906d[_0x7696('0x69')][_0x7696('0x3e')];_0x4bf0a5+=0x1){let _0xdcbaee=_0x24906d['Agents'][_0x4bf0a5];var _0x184a7d=_0x1727fb[_0x7696('0x7d')]();_0x184a7d[_0x7696('0x43')]('ut.UserId\x20=\x20?',_0xdcbaee['id']);_0x8dc500[_0x7696('0x7e')](db[_0x7696('0x6e')][_0x7696('0x37')](_0x184a7d[_0x7696('0x7f')](),{'type':db[_0x7696('0x6e')][_0x7696('0x80')][_0x7696('0x81')]})[_0x7696('0x28')](function(_0x14a25f){if(_0x14a25f[_0x7696('0x3e')]===0x1){return _0xdcbaee['id'];}else{var _0x163f14=_[_0x7696('0x82')](_[_0x7696('0x31')](_0x14a25f,_0x7696('0x83')),function(_0x2abfcd){return _['includes'](_0x4bc56d,_0x2abfcd);});if(_0x163f14){return _0xdcbaee['id'];}}}));}}return BPromise[_0x7696('0x84')](_0x8dc500)[_0x7696('0x28')](function(_0x291b41){_0xa89b6=_(_0xa89b6)[_0x7696('0x85')](_0x291b41)[_0x7696('0x86')]()[_0x7696('0x87')]();return db[_0x7696('0x32')][_0x7696('0x53')]({'where':{'id':_0x268f99[_0x7696('0x56')]['id']}})[_0x7696('0x28')](function(_0x48957b){return db['sequelize'][_0x7696('0x6f')](function(_0x4cf0f4){return _0x48957b[_0x7696('0x75')](_0x268f99[_0x7696('0x37')][_0x7696('0x68')],{'transaction':_0x4cf0f4})['then'](function(){if(!_[_0x7696('0x88')](_0xa89b6)){return _0x48957b[_0x7696('0x89')](_0xa89b6,{'transaction':_0x4cf0f4});}})[_0x7696('0x28')](function(){_0xa89b6[_0x7696('0x72')](function(_0x281c68){socket[_0x7696('0x73')](_0x7696('0x8a'),{'UserId':_0x281c68,'SmsQueueId':_0x48957b['id']});});});});});});})[_0x7696('0x28')](respondWithStatusCode(_0x558082,null))[_0x7696('0x49')](handleError(_0x558082,null));};exports[_0x7696('0x8b')]=function(_0x3e3445,_0x42d2a4,_0x293ca0){return db['SmsQueue'][_0x7696('0x53')]({'where':{'id':_0x3e3445[_0x7696('0x56')]['id']}})['then'](handleEntityNotFound(_0x42d2a4,null))[_0x7696('0x28')](function(_0x43ba7f){if(_0x43ba7f){return _0x43ba7f[_0x7696('0x8b')](_0x3e3445[_0x7696('0x4d')][_0x7696('0x68')],_[_0x7696('0x8c')](_0x3e3445[_0x7696('0x4d')],[_0x7696('0x68'),'id'])||{})[_0x7696('0x8d')](function(_0x1e8ad8){for(var _0x2ccac4=0x0;_0x2ccac4<_0x3e3445['body'][_0x7696('0x68')][_0x7696('0x3e')];_0x2ccac4+=0x1){socket['emit'](_0x7696('0x74'),{'UserId':Number(_0x3e3445['body'][_0x7696('0x68')][_0x2ccac4]),'SmsQueueId':Number(_0x3e3445[_0x7696('0x56')]['id'])});}return _0x1e8ad8;});}})[_0x7696('0x28')](respondWithResult(_0x42d2a4,null))['catch'](handleError(_0x42d2a4,null));};exports[_0x7696('0x89')]=function(_0xbe7b15,_0x553746,_0x2482f6){return db['SmsQueue'][_0x7696('0x53')]({'where':{'id':_0xbe7b15['params']['id']}})[_0x7696('0x28')](handleEntityNotFound(_0x553746,null))[_0x7696('0x28')](function(_0x2a2fb0){if(_0x2a2fb0){return _0x2a2fb0['removeAgents'](_0xbe7b15[_0x7696('0x37')]['ids'])[_0x7696('0x28')](function(){if(_['isArray'](_0xbe7b15[_0x7696('0x37')]['ids'])){for(var _0x5941d8=0x0;_0x5941d8<_0xbe7b15[_0x7696('0x37')][_0x7696('0x68')][_0x7696('0x3e')];_0x5941d8+=0x1){socket[_0x7696('0x73')](_0x7696('0x8a'),{'UserId':Number(_0xbe7b15[_0x7696('0x37')]['ids'][_0x5941d8]),'SmsQueueId':Number(_0xbe7b15['params']['id'])});}}else{socket[_0x7696('0x73')](_0x7696('0x8a'),{'UserId':Number(_0xbe7b15[_0x7696('0x37')][_0x7696('0x68')]),'SmsQueueId':Number(_0xbe7b15[_0x7696('0x56')]['id'])});}});}})[_0x7696('0x28')](respondWithStatusCode(_0x553746,null))['catch'](handleError(_0x553746,null));};exports[_0x7696('0x8e')]=function(_0x42f5e2,_0x5b0dae,_0x18793d){var _0x3a2454={};var _0x43f671={};var _0x597589;var _0x386113;return db[_0x7696('0x32')][_0x7696('0x58')]({'where':{'id':_0x42f5e2[_0x7696('0x56')]['id']}})[_0x7696('0x28')](handleEntityNotFound(_0x5b0dae,null))[_0x7696('0x28')](function(_0x416ea0){if(_0x416ea0){_0x597589=_0x416ea0;_0x43f671[_0x7696('0x3b')]=_['keys'](db[_0x7696('0x5c')][_0x7696('0x33')]);_0x43f671[_0x7696('0x37')]=_['keys'](_0x42f5e2[_0x7696('0x37')]);_0x43f671[_0x7696('0x39')]=_['intersection'](_0x43f671[_0x7696('0x3b')],_0x43f671['query']);_0x3a2454['attributes']=_[_0x7696('0x3a')](_0x43f671[_0x7696('0x3b')],qs[_0x7696('0x3d')](_0x42f5e2[_0x7696('0x37')][_0x7696('0x3d')]));_0x3a2454['attributes']=_0x3a2454[_0x7696('0x3c')][_0x7696('0x3e')]?_0x3a2454[_0x7696('0x3c')]:_0x43f671['model'];_0x3a2454[_0x7696('0x41')]=qs['sort'](_0x42f5e2[_0x7696('0x37')][_0x7696('0x42')]);_0x3a2454[_0x7696('0x43')]=qs[_0x7696('0x39')](_['pick'](_0x42f5e2[_0x7696('0x37')],_0x43f671[_0x7696('0x39')]));if(_0x42f5e2[_0x7696('0x37')][_0x7696('0x46')]){_0x3a2454[_0x7696('0x43')]=_[_0x7696('0x45')](_0x3a2454[_0x7696('0x43')],{'$or':_[_0x7696('0x31')](_0x3a2454[_0x7696('0x3c')],function(_0x2f30fd){var _0x52bb96={};_0x52bb96[_0x2f30fd]={'$like':'%'+_0x42f5e2[_0x7696('0x37')][_0x7696('0x46')]+'%'};return _0x52bb96;})});}_0x3a2454=_[_0x7696('0x45')]({},_0x3a2454,_0x42f5e2[_0x7696('0x4b')]);return _0x597589[_0x7696('0x8e')](_0x3a2454);}})[_0x7696('0x28')](function(_0x3d3b4d){if(_0x3d3b4d){_0x386113=_0x3d3b4d[_0x7696('0x3e')];if(!_0x42f5e2['query'][_0x7696('0x3f')]('nolimit')){_0x3a2454[_0x7696('0x22')]=qs[_0x7696('0x22')](_0x42f5e2['query'][_0x7696('0x22')]);_0x3a2454['offset']=qs[_0x7696('0x20')](_0x42f5e2[_0x7696('0x37')][_0x7696('0x20')]);}return _0x597589['getAgents'](_0x3a2454);}})['then'](function(_0x3aa8b0){if(_0x3aa8b0){return _0x3aa8b0?{'count':_0x386113,'rows':_0x3aa8b0}:null;}})['then'](respondWithResult(_0x5b0dae,null))[_0x7696('0x49')](handleError(_0x5b0dae,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index cc09e0c..7a4aead 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 _0x0824=['events','SmsQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x595439,_0x1653d0){var _0x2fd012=function(_0x45113d){while(--_0x45113d){_0x595439['push'](_0x595439['shift']());}};_0x2fd012(++_0x1653d0);}(_0x0824,0x80));var _0x4082=function(_0x471cd7,_0x4cc335){_0x471cd7=_0x471cd7-0x0;var _0x100420=_0x0824[_0x471cd7];return _0x100420;};'use strict';var EventEmitter=require(_0x4082('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x4082('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4082('0x2'),'afterUpdate':'update','afterDestroy':_0x4082('0x3')};function emitEvent(_0x21ee04){return function(_0x4d985a,_0x4f1b57,_0x5de37a){SmsQueueEvents[_0x4082('0x4')](_0x21ee04+':'+_0x4d985a['id'],_0x4d985a);SmsQueueEvents[_0x4082('0x4')](_0x21ee04,_0x4d985a);_0x5de37a(null);};}for(var e in events){if(events[_0x4082('0x5')](e)){var event=events[e];SmsQueue[_0x4082('0x6')](e,emitEvent(event));}}module[_0x4082('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xb119=['exports','events','SmsQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xb119,0xbe));var _0x9b11=function(_0x414c21,_0x1c1973){_0x414c21=_0x414c21-0x0;var _0x47b5d8=_0xb119[_0x414c21];return _0x47b5d8;};'use strict';var EventEmitter=require(_0x9b11('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x9b11('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9b11('0x2')](0x0);var events={'afterCreate':_0x9b11('0x3'),'afterUpdate':_0x9b11('0x4'),'afterDestroy':_0x9b11('0x5')};function emitEvent(_0x56c64e){return function(_0xeb0cc2,_0x269739,_0xacdbc5){SmsQueueEvents[_0x9b11('0x6')](_0x56c64e+':'+_0xeb0cc2['id'],_0xeb0cc2);SmsQueueEvents[_0x9b11('0x6')](_0x56c64e,_0xeb0cc2);_0xacdbc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x9b11('0x7')](e,emitEvent(event));}}module[_0x9b11('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 7be8cc9..a3e9bec 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 _0xf137=['bluebird','request-promise','rimraf','../../config/environment','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x50e012,_0x2498bb){var _0x208e39=function(_0x3216b9){while(--_0x3216b9){_0x50e012['push'](_0x50e012['shift']());}};_0x208e39(++_0x2498bb);}(_0xf137,0x7f));var _0x7f13=function(_0x2123aa,_0x2e8a74){_0x2123aa=_0x2123aa-0x0;var _0x413cde=_0xf137[_0x2123aa];return _0x413cde;};'use strict';var _=require(_0x7f13('0x0'));var util=require(_0x7f13('0x1'));var logger=require(_0x7f13('0x2'))(_0x7f13('0x3'));var moment=require(_0x7f13('0x4'));var BPromise=require(_0x7f13('0x5'));var rp=require(_0x7f13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f13('0x7'));var config=require(_0x7f13('0x8'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x53c6ad,_0x497c8a){return _0x53c6ad['define'](_0x7f13('0x9'),attributes,{'tableName':_0x7f13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e1d=['../../config/logger','api','bluebird','request-promise','path','exports','define','SmsQueue','util'];(function(_0x2c2cac,_0x12ab98){var _0x92cbe3=function(_0x460fd5){while(--_0x460fd5){_0x2c2cac['push'](_0x2c2cac['shift']());}};_0x92cbe3(++_0x12ab98);}(_0x3e1d,0x8f));var _0xd3e1=function(_0x54f4f1,_0x2e603b){_0x54f4f1=_0x54f4f1-0x0;var _0x14b71f=_0x3e1d[_0x54f4f1];return _0x14b71f;};'use strict';var _=require('lodash');var util=require(_0xd3e1('0x0'));var logger=require(_0xd3e1('0x1'))(_0xd3e1('0x2'));var moment=require('moment');var BPromise=require(_0xd3e1('0x3'));var rp=require(_0xd3e1('0x4'));var fs=require('fs');var path=require(_0xd3e1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0xd3e1('0x6')]=function(_0x2a76d6,_0x84c5c4){return _0x2a76d6[_0xd3e1('0x7')](_0xd3e1('0x8'),attributes,{'tableName':'sms_queues','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 31f6508..8cdd72d 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 _0x53e9=['ShowSmsQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x294d80,_0x44806b){var _0x4f67ff=function(_0x271527){while(--_0x271527){_0x294d80['push'](_0x294d80['shift']());}};_0x4f67ff(++_0x44806b);}(_0x53e9,0x1db));var _0x953e=function(_0x43a788,_0x4403a7){_0x43a788=_0x43a788-0x0;var _0x265d60=_0x53e9[_0x43a788];return _0x265d60;};'use strict';var _=require(_0x953e('0x0'));var util=require(_0x953e('0x1'));var moment=require(_0x953e('0x2'));var BPromise=require(_0x953e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x953e('0x4'));var db=require(_0x953e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x953e('0x6'))(_0x953e('0x7'));var config=require(_0x953e('0x8'));var jayson=require(_0x953e('0x9'));var client=jayson[_0x953e('0xa')][_0x953e('0xb')]({'port':0x232a});config['redis']=_[_0x953e('0xc')](config[_0x953e('0xd')],{'host':_0x953e('0xe'),'port':0x18eb});var socket=require(_0x953e('0xf'))(new Redis(config['redis']));require(_0x953e('0x10'))[_0x953e('0x11')](socket);function respondWithRpcPromise(_0x2ae8dc,_0x3c3656,_0x2ca0e1){return new BPromise(function(_0xde348,_0x79018b){return client['request'](_0x2ae8dc,_0x2ca0e1)[_0x953e('0x12')](function(_0x44666a){logger[_0x953e('0x13')](_0x953e('0x14'),_0x3c3656,_0x953e('0x15'));logger[_0x953e('0x16')](_0x953e('0x17'),_0x3c3656,'request\x20sent',JSON[_0x953e('0x18')](_0x44666a));if(_0x44666a[_0x953e('0x19')]){if(_0x44666a[_0x953e('0x19')][_0x953e('0x1a')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3c3656,_0x44666a[_0x953e('0x19')][_0x953e('0x1b')]);return _0x79018b(_0x44666a[_0x953e('0x19')][_0x953e('0x1b')]);}logger[_0x953e('0x19')](_0x953e('0x14'),_0x3c3656,_0x44666a[_0x953e('0x19')][_0x953e('0x1b')]);return _0xde348(_0x44666a[_0x953e('0x19')]['message']);}else{logger[_0x953e('0x13')](_0x953e('0x14'),_0x3c3656,_0x953e('0x15'));_0xde348(_0x44666a[_0x953e('0x1c')]['message']);}})[_0x953e('0x1d')](function(_0x4866b3){logger[_0x953e('0x19')](_0x953e('0x14'),_0x3c3656,_0x4866b3);_0x79018b(_0x4866b3);});});}exports[_0x953e('0x1e')]=function(_0xc90fbf){var _0x2438e1=this;return new Promise(function(_0x467c29,_0x5047f1){return db[_0x953e('0x1f')][_0x953e('0x20')]({'raw':_0xc90fbf['options']?_0xc90fbf[_0x953e('0x21')][_0x953e('0x22')]===undefined?!![]:![]:!![],'where':_0xc90fbf[_0x953e('0x21')]?_0xc90fbf[_0x953e('0x21')][_0x953e('0x23')]||null:null,'attributes':_0xc90fbf[_0x953e('0x21')]?_0xc90fbf[_0x953e('0x21')][_0x953e('0x24')]||null:null,'limit':_0xc90fbf[_0x953e('0x21')]?_0xc90fbf[_0x953e('0x21')][_0x953e('0x25')]||null:null,'include':_0xc90fbf['options']?_0xc90fbf['options'][_0x953e('0x26')]?_[_0x953e('0x27')](_0xc90fbf[_0x953e('0x21')][_0x953e('0x26')],function(_0x5ab872){return{'model':db[_0x5ab872[_0x953e('0x28')]],'as':_0x5ab872['as'],'attributes':_0x5ab872[_0x953e('0x24')],'include':_0x5ab872[_0x953e('0x26')]?_['map'](_0x5ab872[_0x953e('0x26')],function(_0x30a4df){return{'model':db[_0x30a4df[_0x953e('0x28')]],'as':_0x30a4df['as'],'attributes':_0x30a4df[_0x953e('0x24')],'include':_0x30a4df[_0x953e('0x26')]?_['map'](_0x30a4df[_0x953e('0x26')],function(_0x40596f){return{'model':db[_0x40596f[_0x953e('0x28')]],'as':_0x40596f['as'],'attributes':_0x40596f[_0x953e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x953e('0x12')](function(_0x34c6e4){logger[_0x953e('0x13')]('GetSmsQueue',_0xc90fbf);logger['debug'](_0x953e('0x1e'),_0xc90fbf,JSON[_0x953e('0x18')](_0x34c6e4));_0x467c29(_0x34c6e4);})[_0x953e('0x1d')](function(_0x16b531){logger[_0x953e('0x19')](_0x953e('0x1e'),_0x16b531[_0x953e('0x1b')],_0xc90fbf);_0x5047f1(_0x2438e1[_0x953e('0x19')](0x1f4,_0x16b531[_0x953e('0x1b')]));});});};exports[_0x953e('0x29')]=function(_0x167fce){var _0x53fc56=this;return new Promise(function(_0x547780,_0x4a27a0){return db[_0x953e('0x1f')][_0x953e('0x2a')]({'raw':_0x167fce[_0x953e('0x21')]?_0x167fce[_0x953e('0x21')][_0x953e('0x22')]===undefined?!![]:![]:!![],'where':_0x167fce[_0x953e('0x21')]?_0x167fce[_0x953e('0x21')][_0x953e('0x23')]||null:null,'attributes':_0x167fce[_0x953e('0x21')]?_0x167fce[_0x953e('0x21')][_0x953e('0x24')]||null:null,'include':_0x167fce[_0x953e('0x21')]?_0x167fce['options']['include']?_[_0x953e('0x27')](_0x167fce[_0x953e('0x21')][_0x953e('0x26')],function(_0x2d6b72){return{'model':db[_0x2d6b72[_0x953e('0x28')]],'as':_0x2d6b72['as'],'attributes':_0x2d6b72['attributes'],'include':_0x2d6b72[_0x953e('0x26')]?_[_0x953e('0x27')](_0x2d6b72[_0x953e('0x26')],function(_0x57fe84){return{'model':db[_0x57fe84[_0x953e('0x28')]],'as':_0x57fe84['as'],'attributes':_0x57fe84[_0x953e('0x24')],'include':_0x57fe84[_0x953e('0x26')]?_[_0x953e('0x27')](_0x57fe84[_0x953e('0x26')],function(_0x26d914){return{'model':db[_0x26d914[_0x953e('0x28')]],'as':_0x26d914['as'],'attributes':_0x26d914[_0x953e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x953e('0x12')](function(_0x34fddb){logger['info']('ShowSmsQueue',_0x167fce);logger[_0x953e('0x16')]('ShowSmsQueue',_0x167fce,JSON[_0x953e('0x18')](_0x34fddb));_0x547780(_0x34fddb);})[_0x953e('0x1d')](function(_0xc6352f){logger['error'](_0x953e('0x29'),_0xc6352f[_0x953e('0x1b')],_0x167fce);_0x4a27a0(_0x53fc56[_0x953e('0x19')](0x1f4,_0xc6352f[_0x953e('0x1b')]));});});}; \ No newline at end of file +var _0x265c=['code','message','result','catch','GetSmsQueue','findAll','options','where','attributes','include','model','map','ShowSmsQueue','SmsQueue','find','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','./smsQueue.socket','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x265c,0xad));var _0xc265=function(_0x52494e,_0x3b6d6f){_0x52494e=_0x52494e-0x0;var _0x1b8001=_0x265c[_0x52494e];return _0x1b8001;};'use strict';var _=require(_0xc265('0x0'));var util=require(_0xc265('0x1'));var moment=require(_0xc265('0x2'));var BPromise=require(_0xc265('0x3'));var rs=require(_0xc265('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc265('0x5'))['db'];var utils=require(_0xc265('0x6'));var logger=require(_0xc265('0x7'))(_0xc265('0x8'));var config=require(_0xc265('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc265('0xa')][_0xc265('0xb')]({'port':0x232a});config['redis']=_[_0xc265('0xc')](config[_0xc265('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc265('0xd')]));require(_0xc265('0xe'))['register'](socket);function respondWithRpcPromise(_0xec417,_0x40c00b,_0x12b1e2){return new BPromise(function(_0x9dd388,_0x31f551){return client[_0xc265('0xf')](_0xec417,_0x12b1e2)['then'](function(_0x44cfc4){logger[_0xc265('0x10')](_0xc265('0x11'),_0x40c00b,_0xc265('0x12'));logger[_0xc265('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x40c00b,_0xc265('0x12'),JSON[_0xc265('0x14')](_0x44cfc4));if(_0x44cfc4[_0xc265('0x15')]){if(_0x44cfc4[_0xc265('0x15')][_0xc265('0x16')]===0x1f4){logger[_0xc265('0x15')](_0xc265('0x11'),_0x40c00b,_0x44cfc4['error'][_0xc265('0x17')]);return _0x31f551(_0x44cfc4[_0xc265('0x15')][_0xc265('0x17')]);}logger[_0xc265('0x15')](_0xc265('0x11'),_0x40c00b,_0x44cfc4['error'][_0xc265('0x17')]);return _0x9dd388(_0x44cfc4[_0xc265('0x15')][_0xc265('0x17')]);}else{logger[_0xc265('0x10')](_0xc265('0x11'),_0x40c00b,_0xc265('0x12'));_0x9dd388(_0x44cfc4[_0xc265('0x18')][_0xc265('0x17')]);}})[_0xc265('0x19')](function(_0x13d9f5){logger[_0xc265('0x15')](_0xc265('0x11'),_0x40c00b,_0x13d9f5);_0x31f551(_0x13d9f5);});});}exports[_0xc265('0x1a')]=function(_0x44d32e){var _0x5505e7=this;return new Promise(function(_0x57007a,_0x155d66){return db['SmsQueue'][_0xc265('0x1b')]({'raw':_0x44d32e['options']?_0x44d32e[_0xc265('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x44d32e[_0xc265('0x1c')]?_0x44d32e[_0xc265('0x1c')][_0xc265('0x1d')]||null:null,'attributes':_0x44d32e[_0xc265('0x1c')]?_0x44d32e[_0xc265('0x1c')][_0xc265('0x1e')]||null:null,'limit':_0x44d32e['options']?_0x44d32e['options']['limit']||null:null,'include':_0x44d32e[_0xc265('0x1c')]?_0x44d32e[_0xc265('0x1c')]['include']?_['map'](_0x44d32e[_0xc265('0x1c')][_0xc265('0x1f')],function(_0x2d1fbb){return{'model':db[_0x2d1fbb[_0xc265('0x20')]],'as':_0x2d1fbb['as'],'attributes':_0x2d1fbb[_0xc265('0x1e')],'include':_0x2d1fbb[_0xc265('0x1f')]?_[_0xc265('0x21')](_0x2d1fbb[_0xc265('0x1f')],function(_0x3953ce){return{'model':db[_0x3953ce[_0xc265('0x20')]],'as':_0x3953ce['as'],'attributes':_0x3953ce[_0xc265('0x1e')],'include':_0x3953ce['include']?_[_0xc265('0x21')](_0x3953ce[_0xc265('0x1f')],function(_0x40436c){return{'model':db[_0x40436c[_0xc265('0x20')]],'as':_0x40436c['as'],'attributes':_0x40436c[_0xc265('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5161b7){logger[_0xc265('0x10')](_0xc265('0x1a'),_0x44d32e);logger[_0xc265('0x13')](_0xc265('0x1a'),_0x44d32e,JSON[_0xc265('0x14')](_0x5161b7));_0x57007a(_0x5161b7);})[_0xc265('0x19')](function(_0x133327){logger[_0xc265('0x15')](_0xc265('0x1a'),_0x133327[_0xc265('0x17')],_0x44d32e);_0x155d66(_0x5505e7['error'](0x1f4,_0x133327[_0xc265('0x17')]));});});};exports[_0xc265('0x22')]=function(_0x829863){var _0x4f42bc=this;return new Promise(function(_0x63fee4,_0xd9d8bf){return db[_0xc265('0x23')][_0xc265('0x24')]({'raw':_0x829863[_0xc265('0x1c')]?_0x829863[_0xc265('0x1c')][_0xc265('0x25')]===undefined?!![]:![]:!![],'where':_0x829863['options']?_0x829863['options'][_0xc265('0x1d')]||null:null,'attributes':_0x829863[_0xc265('0x1c')]?_0x829863[_0xc265('0x1c')]['attributes']||null:null,'include':_0x829863[_0xc265('0x1c')]?_0x829863['options'][_0xc265('0x1f')]?_[_0xc265('0x21')](_0x829863[_0xc265('0x1c')][_0xc265('0x1f')],function(_0x3edcb4){return{'model':db[_0x3edcb4[_0xc265('0x20')]],'as':_0x3edcb4['as'],'attributes':_0x3edcb4[_0xc265('0x1e')],'include':_0x3edcb4[_0xc265('0x1f')]?_[_0xc265('0x21')](_0x3edcb4[_0xc265('0x1f')],function(_0x4b443a){return{'model':db[_0x4b443a[_0xc265('0x20')]],'as':_0x4b443a['as'],'attributes':_0x4b443a[_0xc265('0x1e')],'include':_0x4b443a[_0xc265('0x1f')]?_['map'](_0x4b443a[_0xc265('0x1f')],function(_0x572fc5){return{'model':db[_0x572fc5[_0xc265('0x20')]],'as':_0x572fc5['as'],'attributes':_0x572fc5[_0xc265('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc265('0x26')](function(_0x3331ce){logger['info'](_0xc265('0x22'),_0x829863);logger['debug'](_0xc265('0x22'),_0x829863,JSON['stringify'](_0x3331ce));_0x63fee4(_0x3331ce);})[_0xc265('0x19')](function(_0x17e614){logger[_0xc265('0x15')]('ShowSmsQueue',_0x17e614[_0xc265('0x17')],_0x829863);_0xd9d8bf(_0x4f42bc[_0xc265('0x15')](0x1f4,_0x17e614[_0xc265('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 92e6110..8f03290 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 _0x306c=['./smsQueue.events','remove','emit','removeListener','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x306c,0x17c));var _0xc306=function(_0x714313,_0x43c99a){_0x714313=_0x714313-0x0;var _0x26b576=_0x306c[_0x714313];return _0x26b576;};'use strict';var SmsQueueEvents=require(_0xc306('0x0'));var events=['save',_0xc306('0x1'),'update'];function createListener(_0x162578,_0x1cd18e){return function(_0x428992){_0x1cd18e[_0xc306('0x2')](_0x162578,_0x428992);};}function removeListener(_0x41dfca,_0xfa398c){return function(){SmsQueueEvents[_0xc306('0x3')](_0x41dfca,_0xfa398c);};}exports[_0xc306('0x4')]=function(_0x14a9b5){for(var _0x3dd99b=0x0,_0xb93fd4=events['length'];_0x3dd99b<_0xb93fd4;_0x3dd99b++){var _0x2dc96d=events[_0x3dd99b];var _0x461cad=createListener('smsQueue:'+_0x2dc96d,_0x14a9b5);SmsQueueEvents['on'](_0x2dc96d,_0x461cad);}}; \ No newline at end of file +var _0x5f20=['emit','removeListener','register','length','save','update'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5f20,0xee));var _0x05f2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5f20[_0x199572];return _0x13cfa3;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x05f2('0x0'),'remove',_0x05f2('0x1')];function createListener(_0x5969d7,_0x36794f){return function(_0x591fd2){_0x36794f[_0x05f2('0x2')](_0x5969d7,_0x591fd2);};}function removeListener(_0x545285,_0x37e61d){return function(){SmsQueueEvents[_0x05f2('0x3')](_0x545285,_0x37e61d);};}exports[_0x05f2('0x4')]=function(_0x32d455){for(var _0x9f7b60=0x0,_0x4a71d6=events[_0x05f2('0x5')];_0x9f7b60<_0x4a71d6;_0x9f7b60++){var _0x44650e=events[_0x9f7b60];var _0x17a083=createListener('smsQueue:'+_0x44650e,_0x32d455);SmsQueueEvents['on'](_0x44650e,_0x17a083);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 5efee14..6956ad7 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 _0x1867=['put','update','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','create'];(function(_0x2452b4,_0x36150a){var _0x1d7288=function(_0x4e6e5f){while(--_0x4e6e5f){_0x2452b4['push'](_0x2452b4['shift']());}};_0x1d7288(++_0x36150a);}(_0x1867,0x134));var _0x7186=function(_0xfe0b89,_0xd9064){_0xfe0b89=_0xfe0b89-0x0;var _0x482866=_0x1867[_0xfe0b89];return _0x482866;};'use strict';var multer=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7186('0x2'));var router=express[_0x7186('0x3')]();var fs_extra=require(_0x7186('0x4'));var auth=require(_0x7186('0x5'));var interaction=require(_0x7186('0x6'));var config=require(_0x7186('0x7'));var controller=require(_0x7186('0x8'));router['get']('/',auth[_0x7186('0x9')](),controller[_0x7186('0xa')]);router[_0x7186('0xb')](_0x7186('0xc'),auth[_0x7186('0x9')](),controller['describe']);router[_0x7186('0xb')](_0x7186('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7186('0xe')]);router[_0x7186('0xf')](_0x7186('0xd'),auth[_0x7186('0x9')](),controller[_0x7186('0x10')]);router['delete'](_0x7186('0xd'),auth[_0x7186('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x49f8=['show','post','update','delete','exports','multer','util','express','Router','fs-extra','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x4940d0,_0x1142ad){var _0x53354b=function(_0x4819f5){while(--_0x4819f5){_0x4940d0['push'](_0x4940d0['shift']());}};_0x53354b(++_0x1142ad);}(_0x49f8,0x105));var _0x849f=function(_0x133937,_0x2ebfad){_0x133937=_0x133937-0x0;var _0x5e8947=_0x49f8[_0x133937];return _0x5e8947;};'use strict';var multer=require(_0x849f('0x0'));var util=require(_0x849f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x849f('0x2'));var router=express[_0x849f('0x3')]();var fs_extra=require(_0x849f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x849f('0x5'));router[_0x849f('0x6')]('/',auth[_0x849f('0x7')](),controller[_0x849f('0x8')]);router[_0x849f('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x849f('0x9')]);router[_0x849f('0x6')](_0x849f('0xa'),auth['isAuthenticated'](),controller[_0x849f('0xb')]);router[_0x849f('0xc')]('/',auth[_0x849f('0x7')](),controller['create']);router['put'](_0x849f('0xa'),auth[_0x849f('0x7')](),controller[_0x849f('0xd')]);router[_0x849f('0xe')](_0x849f('0xa'),auth[_0x849f('0x7')](),controller['destroy']);module[_0x849f('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 8dbe254..cb68d13 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 _0x4143=['exports','STRING','DATE','moment'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x4143,0x167));var _0x3414=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4143[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0x3414('0x0'));var Sequelize=require('sequelize');module[_0x3414('0x1')]={'uniqueid':{'type':Sequelize[_0x3414('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3414('0x2')]},'joinAt':{'type':Sequelize[_0x3414('0x3')]},'leaveAt':{'type':Sequelize[_0x3414('0x3')]},'acceptAt':{'type':Sequelize[_0x3414('0x3')]},'exitAt':{'type':Sequelize[_0x3414('0x3')]},'reason':{'type':Sequelize[_0x3414('0x2')]}}; \ No newline at end of file +var _0x7953=['STRING','DATE','moment','sequelize','exports'];(function(_0x4e8438,_0x30ba78){var _0x34af5a=function(_0x5c81ac){while(--_0x5c81ac){_0x4e8438['push'](_0x4e8438['shift']());}};_0x34af5a(++_0x30ba78);}(_0x7953,0x66));var _0x3795=function(_0x43e2e4,_0x4ad3b4){_0x43e2e4=_0x43e2e4-0x0;var _0x1b71d0=_0x7953[_0x43e2e4];return _0x1b71d0;};'use strict';var moment=require(_0x3795('0x0'));var Sequelize=require(_0x3795('0x1'));module[_0x3795('0x2')]={'uniqueid':{'type':Sequelize[_0x3795('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3795('0x3')]},'joinAt':{'type':Sequelize[_0x3795('0x4')]},'leaveAt':{'type':Sequelize[_0x3795('0x4')]},'acceptAt':{'type':Sequelize[_0x3795('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 86f0d5b..5363be1 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 _0xaf1f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','then','rows','catch','show','params','length','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xaf1f,0x156));var _0xfaf1=function(_0x5d0680,_0x10c11d){_0x5d0680=_0x5d0680-0x0;var _0x1ef1dc=_0xaf1f[_0x5d0680];return _0x1ef1dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaf1('0x0'));var zipdir=require(_0xfaf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfaf1('0x2'));var moment=require(_0xfaf1('0x3'));var BPromise=require(_0xfaf1('0x4'));var Mustache=require(_0xfaf1('0x5'));var util=require(_0xfaf1('0x6'));var path=require(_0xfaf1('0x7'));var sox=require('sox');var csv=require(_0xfaf1('0x8'));var ejs=require(_0xfaf1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfaf1('0xa'));var squel=require(_0xfaf1('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaf1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfaf1('0xd'));var Papa=require(_0xfaf1('0xe'));var Redis=require(_0xfaf1('0xf'));var authService=require(_0xfaf1('0x10'));var qs=require(_0xfaf1('0x11'));var as=require(_0xfaf1('0x12'));var hardwareService=require(_0xfaf1('0x13'));var logger=require('../../config/logger')(_0xfaf1('0x14'));var utils=require('../../config/utils');var config=require(_0xfaf1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaf1('0x16'))['db'];function respondWithStatusCode(_0x348c18,_0x547b56){_0x547b56=_0x547b56||0xcc;return function(_0x561f97){if(_0x561f97){return _0x348c18[_0xfaf1('0x17')](_0x547b56);}return _0x348c18[_0xfaf1('0x18')](_0x547b56)[_0xfaf1('0x19')]();};}function respondWithResult(_0x49cb4d,_0x9056a6){_0x9056a6=_0x9056a6||0xc8;return function(_0x5ee621){if(_0x5ee621){return _0x49cb4d[_0xfaf1('0x18')](_0x9056a6)[_0xfaf1('0x1a')](_0x5ee621);}};}function respondWithFilteredResult(_0x4f079b,_0x5e3d40){return function(_0x319f3e){if(_0x319f3e){var _0x23ec76=typeof _0x5e3d40[_0xfaf1('0x1b')]===_0xfaf1('0x1c')&&typeof _0x5e3d40[_0xfaf1('0x1d')]===_0xfaf1('0x1c');var _0x51e5b4=_0x319f3e[_0xfaf1('0x1e')];var _0x1b8995=_0x23ec76?0x0:_0x5e3d40[_0xfaf1('0x1b')];var _0x49af9e=_0x23ec76?_0x319f3e['count']:_0x5e3d40[_0xfaf1('0x1b')]+_0x5e3d40[_0xfaf1('0x1d')];var _0x31d7f7;if(_0x49af9e>=_0x51e5b4){_0x49af9e=_0x51e5b4;_0x31d7f7=0xc8;}else{_0x31d7f7=0xce;}_0x4f079b[_0xfaf1('0x18')](_0x31d7f7);return _0x4f079b[_0xfaf1('0x1f')](_0xfaf1('0x20'),_0x1b8995+'-'+_0x49af9e+'/'+_0x51e5b4)[_0xfaf1('0x1a')](_0x319f3e);}return null;};}function patchUpdates(_0x1543b1){return function(_0x258a62){try{jsonpatch[_0xfaf1('0x21')](_0x258a62,_0x1543b1,!![]);}catch(_0x5825b2){return BPromise['reject'](_0x5825b2);}return _0x258a62['save']();};}function saveUpdates(_0x47e088,_0x3de118){return function(_0x2a96dd){if(_0x2a96dd){return _0x2a96dd[_0xfaf1('0x22')](_0x47e088)['then'](function(_0x2aedc3){return _0x2aedc3;});}return null;};}function removeEntity(_0x3b4c1d,_0x2ea420){return function(_0x1be07a){if(_0x1be07a){return _0x1be07a[_0xfaf1('0x23')]()['then'](function(){_0x3b4c1d[_0xfaf1('0x18')](0xcc)[_0xfaf1('0x19')]();});}};}function handleEntityNotFound(_0x3c920a,_0x474081){return function(_0x34cbbe){if(!_0x34cbbe){_0x3c920a[_0xfaf1('0x17')](0x194);}return _0x34cbbe;};}function handleError(_0x3b2139,_0x341469){_0x341469=_0x341469||0x1f4;return function(_0x4ccb36){logger['error'](_0x4ccb36['stack']);if(_0x4ccb36[_0xfaf1('0x24')]){delete _0x4ccb36['name'];}_0x3b2139['status'](_0x341469)['send'](_0x4ccb36);};}exports[_0xfaf1('0x25')]=function(_0x1e97ac,_0x1b3533){var _0x4a991a={},_0x574d59={},_0xf648da={'count':0x0,'rows':[]};var _0x436a98=_[_0xfaf1('0x26')](db[_0xfaf1('0x27')][_0xfaf1('0x28')],function(_0x20a98f){return{'name':_0x20a98f[_0xfaf1('0x29')],'type':_0x20a98f[_0xfaf1('0x2a')]['key']};});_0x574d59[_0xfaf1('0x2b')]=_[_0xfaf1('0x26')](_0x436a98,_0xfaf1('0x24'));_0x574d59['query']=_[_0xfaf1('0x2c')](_0x1e97ac[_0xfaf1('0x2d')]);_0x574d59[_0xfaf1('0x2e')]=_[_0xfaf1('0x2f')](_0x574d59[_0xfaf1('0x2b')],_0x574d59[_0xfaf1('0x2d')]);_0x4a991a['attributes']=_['intersection'](_0x574d59[_0xfaf1('0x2b')],qs[_0xfaf1('0x30')](_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x30')]));_0x4a991a[_0xfaf1('0x31')]=_0x4a991a[_0xfaf1('0x31')]['length']?_0x4a991a['attributes']:_0x574d59[_0xfaf1('0x2b')];if(!_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x32')](_0xfaf1('0x33'))){_0x4a991a[_0xfaf1('0x1d')]=qs[_0xfaf1('0x1d')](_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x1d')]);_0x4a991a[_0xfaf1('0x1b')]=qs[_0xfaf1('0x1b')](_0x1e97ac[_0xfaf1('0x2d')][_0xfaf1('0x1b')]);}_0x4a991a[_0xfaf1('0x34')]=qs[_0xfaf1('0x35')](_0x1e97ac['query'][_0xfaf1('0x35')]);_0x4a991a[_0xfaf1('0x36')]=qs['filters'](_[_0xfaf1('0x37')](_0x1e97ac[_0xfaf1('0x2d')],_0x574d59['filters']),_0x436a98);if(_0x1e97ac['query'][_0xfaf1('0x38')]){_0x4a991a['where']=_[_0xfaf1('0x39')](_0x4a991a[_0xfaf1('0x36')],{'$or':_[_0xfaf1('0x26')](_0x436a98,function(_0x1da286){if(_0x1da286[_0xfaf1('0x2a')]!=='VIRTUAL'){var _0x1351aa={};_0x1351aa[_0x1da286[_0xfaf1('0x24')]]={'$like':'%'+_0x1e97ac['query'][_0xfaf1('0x38')]+'%'};return _0x1351aa;}})});}_0x4a991a=_[_0xfaf1('0x39')]({},_0x4a991a,_0x1e97ac[_0xfaf1('0x3a')]);var _0x51c465={'where':_0x4a991a[_0xfaf1('0x36')]};return db[_0xfaf1('0x27')]['count'](_0x51c465)['then'](function(_0x559590){_0xf648da[_0xfaf1('0x1e')]=_0x559590;if(_0x1e97ac['query'][_0xfaf1('0x3b')]){_0x4a991a['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x4a991a);})[_0xfaf1('0x3c')](function(_0x575e93){_0xf648da[_0xfaf1('0x3d')]=_0x575e93;return _0xf648da;})[_0xfaf1('0x3c')](respondWithFilteredResult(_0x1b3533,_0x4a991a))[_0xfaf1('0x3e')](handleError(_0x1b3533,null));};exports[_0xfaf1('0x3f')]=function(_0x4f4208,_0x4b9d05){var _0x6187fd={'raw':!![],'where':{'id':_0x4f4208[_0xfaf1('0x40')]['id']}},_0x5206fc={};_0x5206fc[_0xfaf1('0x2b')]=_[_0xfaf1('0x2c')](db[_0xfaf1('0x27')][_0xfaf1('0x28')]);_0x5206fc[_0xfaf1('0x2d')]=_[_0xfaf1('0x2c')](_0x4f4208['query']);_0x5206fc[_0xfaf1('0x2e')]=_[_0xfaf1('0x2f')](_0x5206fc[_0xfaf1('0x2b')],_0x5206fc[_0xfaf1('0x2d')]);_0x6187fd[_0xfaf1('0x31')]=_[_0xfaf1('0x2f')](_0x5206fc[_0xfaf1('0x2b')],qs[_0xfaf1('0x30')](_0x4f4208[_0xfaf1('0x2d')]['fields']));_0x6187fd[_0xfaf1('0x31')]=_0x6187fd[_0xfaf1('0x31')][_0xfaf1('0x41')]?_0x6187fd[_0xfaf1('0x31')]:_0x5206fc[_0xfaf1('0x2b')];if(_0x4f4208[_0xfaf1('0x2d')][_0xfaf1('0x3b')]){_0x6187fd[_0xfaf1('0x42')]=[{'all':!![]}];}_0x6187fd=_[_0xfaf1('0x39')]({},_0x6187fd,_0x4f4208[_0xfaf1('0x3a')]);return db[_0xfaf1('0x27')][_0xfaf1('0x43')](_0x6187fd)[_0xfaf1('0x3c')](handleEntityNotFound(_0x4b9d05,null))[_0xfaf1('0x3c')](respondWithResult(_0x4b9d05,null))[_0xfaf1('0x3e')](handleError(_0x4b9d05,null));};exports[_0xfaf1('0x44')]=function(_0x42f087,_0xc02b79){return db[_0xfaf1('0x27')][_0xfaf1('0x44')](_0x42f087[_0xfaf1('0x45')],{})[_0xfaf1('0x3c')](respondWithResult(_0xc02b79,0xc9))['catch'](handleError(_0xc02b79,null));};exports['update']=function(_0x5b0559,_0x807c27){if(_0x5b0559['body']['id']){delete _0x5b0559[_0xfaf1('0x45')]['id'];}return db[_0xfaf1('0x27')][_0xfaf1('0x43')]({'where':{'id':_0x5b0559[_0xfaf1('0x40')]['id']}})[_0xfaf1('0x3c')](handleEntityNotFound(_0x807c27,null))[_0xfaf1('0x3c')](saveUpdates(_0x5b0559[_0xfaf1('0x45')],null))[_0xfaf1('0x3c')](respondWithResult(_0x807c27,null))[_0xfaf1('0x3e')](handleError(_0x807c27,null));};exports[_0xfaf1('0x23')]=function(_0x21f8d7,_0x57b4bf){return db['SmsQueueReport']['find']({'where':{'id':_0x21f8d7[_0xfaf1('0x40')]['id']}})['then'](handleEntityNotFound(_0x57b4bf,null))[_0xfaf1('0x3c')](removeEntity(_0x57b4bf,null))[_0xfaf1('0x3e')](handleError(_0x57b4bf,null));};exports[_0xfaf1('0x46')]=function(_0x233466,_0x139121){return db[_0xfaf1('0x27')][_0xfaf1('0x46')]()[_0xfaf1('0x3c')](respondWithResult(_0x139121,null))[_0xfaf1('0x3e')](handleError(_0x139121,null));}; \ No newline at end of file +var _0x1e21=['count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','map','SmsQueueReport','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','merge','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1e21,0x18e));var _0x11e2=function(_0x83bce8,_0x3831ca){_0x83bce8=_0x83bce8-0x0;var _0x25c400=_0x1e21[_0x83bce8];return _0x25c400;};'use strict';var emlformat=require(_0x11e2('0x0'));var rimraf=require(_0x11e2('0x1'));var zipdir=require(_0x11e2('0x2'));var jsonpatch=require(_0x11e2('0x3'));var rp=require(_0x11e2('0x4'));var moment=require(_0x11e2('0x5'));var BPromise=require(_0x11e2('0x6'));var Mustache=require(_0x11e2('0x7'));var util=require(_0x11e2('0x8'));var path=require('path');var sox=require(_0x11e2('0x9'));var csv=require(_0x11e2('0xa'));var ejs=require(_0x11e2('0xb'));var fs=require('fs');var fs_extra=require(_0x11e2('0xc'));var _=require('lodash');var squel=require(_0x11e2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11e2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x11e2('0xf'));var Redis=require(_0x11e2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11e2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11e2('0x12'))(_0x11e2('0x13'));var utils=require(_0x11e2('0x14'));var config=require(_0x11e2('0x15'));var licenseUtil=require(_0x11e2('0x16'));var db=require(_0x11e2('0x17'))['db'];function respondWithStatusCode(_0x5c4548,_0x16589a){_0x16589a=_0x16589a||0xcc;return function(_0x2a3ea7){if(_0x2a3ea7){return _0x5c4548['sendStatus'](_0x16589a);}return _0x5c4548[_0x11e2('0x18')](_0x16589a)[_0x11e2('0x19')]();};}function respondWithResult(_0x31ebdc,_0x5a1238){_0x5a1238=_0x5a1238||0xc8;return function(_0x40a06a){if(_0x40a06a){return _0x31ebdc[_0x11e2('0x18')](_0x5a1238)[_0x11e2('0x1a')](_0x40a06a);}};}function respondWithFilteredResult(_0x33d6f3,_0x22d5c4){return function(_0x52f253){if(_0x52f253){var _0xe9bcb7=typeof _0x22d5c4['offset']==='undefined'&&typeof _0x22d5c4[_0x11e2('0x1b')]==='undefined';var _0x5a910c=_0x52f253[_0x11e2('0x1c')];var _0x35a353=_0xe9bcb7?0x0:_0x22d5c4[_0x11e2('0x1d')];var _0x5339b7=_0xe9bcb7?_0x52f253[_0x11e2('0x1c')]:_0x22d5c4[_0x11e2('0x1d')]+_0x22d5c4[_0x11e2('0x1b')];var _0x3f2d81;if(_0x5339b7>=_0x5a910c){_0x5339b7=_0x5a910c;_0x3f2d81=0xc8;}else{_0x3f2d81=0xce;}_0x33d6f3[_0x11e2('0x18')](_0x3f2d81);return _0x33d6f3[_0x11e2('0x1e')](_0x11e2('0x1f'),_0x35a353+'-'+_0x5339b7+'/'+_0x5a910c)[_0x11e2('0x1a')](_0x52f253);}return null;};}function patchUpdates(_0x10616c){return function(_0x3880d2){try{jsonpatch['apply'](_0x3880d2,_0x10616c,!![]);}catch(_0x1238a8){return BPromise[_0x11e2('0x20')](_0x1238a8);}return _0x3880d2[_0x11e2('0x21')]();};}function saveUpdates(_0x31d206,_0x52f675){return function(_0x5df4e1){if(_0x5df4e1){return _0x5df4e1[_0x11e2('0x22')](_0x31d206)[_0x11e2('0x23')](function(_0x2761d2){return _0x2761d2;});}return null;};}function removeEntity(_0x3f79ed,_0x224065){return function(_0x44f003){if(_0x44f003){return _0x44f003[_0x11e2('0x24')]()[_0x11e2('0x23')](function(){_0x3f79ed[_0x11e2('0x18')](0xcc)[_0x11e2('0x19')]();});}};}function handleEntityNotFound(_0x38707a,_0x105e79){return function(_0x52c01b){if(!_0x52c01b){_0x38707a[_0x11e2('0x25')](0x194);}return _0x52c01b;};}function handleError(_0x364506,_0x100815){_0x100815=_0x100815||0x1f4;return function(_0x3680bc){logger['error'](_0x3680bc[_0x11e2('0x26')]);if(_0x3680bc[_0x11e2('0x27')]){delete _0x3680bc['name'];}_0x364506[_0x11e2('0x18')](_0x100815)['send'](_0x3680bc);};}exports['index']=function(_0x50f0a0,_0x3d31c6){var _0x2c5783={},_0x42b4b4={},_0x2aca8a={'count':0x0,'rows':[]};var _0x3bfc2f=_[_0x11e2('0x28')](db[_0x11e2('0x29')]['rawAttributes'],function(_0xd12f07){return{'name':_0xd12f07[_0x11e2('0x2a')],'type':_0xd12f07['type'][_0x11e2('0x2b')]};});_0x42b4b4[_0x11e2('0x2c')]=_[_0x11e2('0x28')](_0x3bfc2f,'name');_0x42b4b4['query']=_[_0x11e2('0x2d')](_0x50f0a0[_0x11e2('0x2e')]);_0x42b4b4['filters']=_[_0x11e2('0x2f')](_0x42b4b4[_0x11e2('0x2c')],_0x42b4b4['query']);_0x2c5783[_0x11e2('0x30')]=_[_0x11e2('0x2f')](_0x42b4b4[_0x11e2('0x2c')],qs[_0x11e2('0x31')](_0x50f0a0[_0x11e2('0x2e')][_0x11e2('0x31')]));_0x2c5783['attributes']=_0x2c5783[_0x11e2('0x30')]['length']?_0x2c5783[_0x11e2('0x30')]:_0x42b4b4[_0x11e2('0x2c')];if(!_0x50f0a0[_0x11e2('0x2e')][_0x11e2('0x32')]('nolimit')){_0x2c5783[_0x11e2('0x1b')]=qs[_0x11e2('0x1b')](_0x50f0a0[_0x11e2('0x2e')][_0x11e2('0x1b')]);_0x2c5783['offset']=qs['offset'](_0x50f0a0['query']['offset']);}_0x2c5783[_0x11e2('0x33')]=qs[_0x11e2('0x34')](_0x50f0a0[_0x11e2('0x2e')]['sort']);_0x2c5783[_0x11e2('0x35')]=qs[_0x11e2('0x36')](_['pick'](_0x50f0a0['query'],_0x42b4b4[_0x11e2('0x36')]),_0x3bfc2f);if(_0x50f0a0['query'][_0x11e2('0x37')]){_0x2c5783[_0x11e2('0x35')]=_['merge'](_0x2c5783[_0x11e2('0x35')],{'$or':_[_0x11e2('0x28')](_0x3bfc2f,function(_0x4674e9){if(_0x4674e9[_0x11e2('0x38')]!==_0x11e2('0x39')){var _0x205ad6={};_0x205ad6[_0x4674e9[_0x11e2('0x27')]]={'$like':'%'+_0x50f0a0[_0x11e2('0x2e')][_0x11e2('0x37')]+'%'};return _0x205ad6;}})});}_0x2c5783=_['merge']({},_0x2c5783,_0x50f0a0['options']);var _0x291f22={'where':_0x2c5783[_0x11e2('0x35')]};return db[_0x11e2('0x29')][_0x11e2('0x1c')](_0x291f22)[_0x11e2('0x23')](function(_0x14b229){_0x2aca8a[_0x11e2('0x1c')]=_0x14b229;if(_0x50f0a0[_0x11e2('0x2e')][_0x11e2('0x3a')]){_0x2c5783[_0x11e2('0x3b')]=[{'all':!![]}];}return db[_0x11e2('0x29')]['findAll'](_0x2c5783);})[_0x11e2('0x23')](function(_0x2941e6){_0x2aca8a[_0x11e2('0x3c')]=_0x2941e6;return _0x2aca8a;})[_0x11e2('0x23')](respondWithFilteredResult(_0x3d31c6,_0x2c5783))[_0x11e2('0x3d')](handleError(_0x3d31c6,null));};exports[_0x11e2('0x3e')]=function(_0x5e7eff,_0x270596){var _0x3460f5={'raw':!![],'where':{'id':_0x5e7eff[_0x11e2('0x3f')]['id']}},_0x3556bc={};_0x3556bc['model']=_[_0x11e2('0x2d')](db[_0x11e2('0x29')][_0x11e2('0x40')]);_0x3556bc['query']=_[_0x11e2('0x2d')](_0x5e7eff['query']);_0x3556bc[_0x11e2('0x36')]=_['intersection'](_0x3556bc[_0x11e2('0x2c')],_0x3556bc['query']);_0x3460f5[_0x11e2('0x30')]=_[_0x11e2('0x2f')](_0x3556bc[_0x11e2('0x2c')],qs[_0x11e2('0x31')](_0x5e7eff['query']['fields']));_0x3460f5[_0x11e2('0x30')]=_0x3460f5[_0x11e2('0x30')]['length']?_0x3460f5[_0x11e2('0x30')]:_0x3556bc[_0x11e2('0x2c')];if(_0x5e7eff[_0x11e2('0x2e')][_0x11e2('0x3a')]){_0x3460f5[_0x11e2('0x3b')]=[{'all':!![]}];}_0x3460f5=_[_0x11e2('0x41')]({},_0x3460f5,_0x5e7eff[_0x11e2('0x42')]);return db[_0x11e2('0x29')]['find'](_0x3460f5)[_0x11e2('0x23')](handleEntityNotFound(_0x270596,null))[_0x11e2('0x23')](respondWithResult(_0x270596,null))[_0x11e2('0x3d')](handleError(_0x270596,null));};exports[_0x11e2('0x43')]=function(_0x217b83,_0x18c6f2){return db[_0x11e2('0x29')][_0x11e2('0x43')](_0x217b83[_0x11e2('0x44')],{})[_0x11e2('0x23')](respondWithResult(_0x18c6f2,0xc9))[_0x11e2('0x3d')](handleError(_0x18c6f2,null));};exports[_0x11e2('0x22')]=function(_0xb27ac7,_0x2db80e){if(_0xb27ac7[_0x11e2('0x44')]['id']){delete _0xb27ac7[_0x11e2('0x44')]['id'];}return db['SmsQueueReport'][_0x11e2('0x45')]({'where':{'id':_0xb27ac7[_0x11e2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2db80e,null))[_0x11e2('0x23')](saveUpdates(_0xb27ac7[_0x11e2('0x44')],null))[_0x11e2('0x23')](respondWithResult(_0x2db80e,null))['catch'](handleError(_0x2db80e,null));};exports['destroy']=function(_0x4bb1cf,_0x17bced){return db[_0x11e2('0x29')][_0x11e2('0x45')]({'where':{'id':_0x4bb1cf['params']['id']}})[_0x11e2('0x23')](handleEntityNotFound(_0x17bced,null))[_0x11e2('0x23')](removeEntity(_0x17bced,null))[_0x11e2('0x3d')](handleError(_0x17bced,null));};exports[_0x11e2('0x46')]=function(_0x51a9e0,_0x1b868b){return db['SmsQueueReport']['describe']()['then'](respondWithResult(_0x1b868b,null))[_0x11e2('0x3d')](handleError(_0x1b868b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 79fffe0..4e7eaaf 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x39ed8,_0x259fd6){var _0x4dfbd0=function(_0x4763eb){while(--_0x4763eb){_0x39ed8['push'](_0x39ed8['shift']());}};_0x4dfbd0(++_0x259fd6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xcb91[_0x249e96];return _0x17444c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x94eb51,_0x1164d3){var _0x231532=function(_0x4a2674){while(--_0x4a2674){_0x94eb51['push'](_0x94eb51['shift']());}};_0x231532(++_0x1164d3);}(_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'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index e2210c6..b9d9068 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 _0x7220=['catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5f3bfb,_0x2ab7d9){var _0xa3e1a9=function(_0x2fde2c){while(--_0x2fde2c){_0x5f3bfb['push'](_0x5f3bfb['shift']());}};_0xa3e1a9(++_0x2ab7d9);}(_0x7220,0x12b));var _0x0722=function(_0x51e08e,_0x3aeb82){_0x51e08e=_0x51e08e-0x0;var _0x564615=_0x7220[_0x51e08e];return _0x564615;};'use strict';var _=require('lodash');var util=require(_0x0722('0x0'));var moment=require(_0x0722('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0722('0x2'));var db=require(_0x0722('0x3'))['db'];var utils=require(_0x0722('0x4'));var logger=require(_0x0722('0x5'))(_0x0722('0x6'));var config=require(_0x0722('0x7'));var jayson=require(_0x0722('0x8'));var client=jayson[_0x0722('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x324757,_0x1c6a25,_0x34fb6b){return new BPromise(function(_0x22eadb,_0x57415d){return client[_0x0722('0xa')](_0x324757,_0x34fb6b)[_0x0722('0xb')](function(_0x552e3a){logger[_0x0722('0xc')](_0x0722('0xd'),_0x1c6a25,_0x0722('0xe'));logger[_0x0722('0xf')](_0x0722('0x10'),_0x1c6a25,_0x0722('0xe'),JSON[_0x0722('0x11')](_0x552e3a));if(_0x552e3a['error']){if(_0x552e3a[_0x0722('0x12')][_0x0722('0x13')]===0x1f4){logger['error'](_0x0722('0xd'),_0x1c6a25,_0x552e3a[_0x0722('0x12')]['message']);return _0x57415d(_0x552e3a['error']['message']);}logger[_0x0722('0x12')](_0x0722('0xd'),_0x1c6a25,_0x552e3a[_0x0722('0x12')][_0x0722('0x14')]);return _0x22eadb(_0x552e3a[_0x0722('0x12')][_0x0722('0x14')]);}else{logger['info'](_0x0722('0xd'),_0x1c6a25,_0x0722('0xe'));_0x22eadb(_0x552e3a['result'][_0x0722('0x14')]);}})[_0x0722('0x15')](function(_0x38dce3){logger[_0x0722('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x1c6a25,_0x38dce3);_0x57415d(_0x38dce3);});});}exports[_0x0722('0x16')]=function(_0x175bc3){var _0x283879=this;return new Promise(function(_0x4b824f,_0x24c9ec){return db[_0x0722('0x17')][_0x0722('0x18')](_0x175bc3['body'],{'raw':_0x175bc3[_0x0722('0x19')]?_0x175bc3[_0x0722('0x19')][_0x0722('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x190fb1){logger[_0x0722('0xc')](_0x0722('0x16'),_0x175bc3);logger[_0x0722('0xf')](_0x0722('0x16'),_0x175bc3,JSON[_0x0722('0x11')](_0x190fb1));_0x4b824f(_0x190fb1);})[_0x0722('0x15')](function(_0x18b7c1){logger[_0x0722('0x12')](_0x0722('0x16'),_0x18b7c1['message'],_0x175bc3);_0x24c9ec(_0x283879['error'](0x1f4,_0x18b7c1[_0x0722('0x14')]));});});};exports[_0x0722('0x1b')]=function(_0x209788){var _0x3dfadf=this;return new Promise(function(_0x53b0a8,_0x4f5ab1){return db['SmsQueueReport'][_0x0722('0x1c')](_0x209788['body'],{'raw':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')][_0x0722('0x1d')]||null:null,'attributes':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')][_0x0722('0x1e')]||null:null,'limit':_0x209788[_0x0722('0x19')]?_0x209788[_0x0722('0x19')][_0x0722('0x1f')]||null:null})[_0x0722('0xb')](function(_0xbd3db8){logger[_0x0722('0xc')](_0x0722('0x1b'),_0x209788);logger[_0x0722('0xf')]('UpdateSmsQueueReport',_0x209788,JSON['stringify'](_0xbd3db8));_0x53b0a8(_0xbd3db8);})['catch'](function(_0x392f07){logger[_0x0722('0x12')](_0x0722('0x1b'),_0x392f07[_0x0722('0x14')],_0x209788);_0x4f5ab1(_0x3dfadf['error'](0x1f4,_0x392f07['message']));});});}; \ No newline at end of file +var _0xf47b=['attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xf47b,0x1f1));var _0xbf47=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf47b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbf47('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbf47('0x1'));var rs=require(_0xbf47('0x2'));var fs=require('fs');var Redis=require(_0xbf47('0x3'));var db=require(_0xbf47('0x4'))['db'];var utils=require(_0xbf47('0x5'));var logger=require('../../config/logger')(_0xbf47('0x6'));var config=require(_0xbf47('0x7'));var jayson=require(_0xbf47('0x8'));var client=jayson[_0xbf47('0x9')][_0xbf47('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaaa4e3,_0x2aae7e,_0x32e803){return new BPromise(function(_0x282dc4,_0x397590){return client[_0xbf47('0xb')](_0xaaa4e3,_0x32e803)[_0xbf47('0xc')](function(_0x23fe3b){logger[_0xbf47('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x2aae7e,'request\x20sent');logger[_0xbf47('0xe')](_0xbf47('0xf'),_0x2aae7e,_0xbf47('0x10'),JSON[_0xbf47('0x11')](_0x23fe3b));if(_0x23fe3b[_0xbf47('0x12')]){if(_0x23fe3b['error']['code']===0x1f4){logger[_0xbf47('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2aae7e,_0x23fe3b[_0xbf47('0x12')][_0xbf47('0x13')]);return _0x397590(_0x23fe3b['error'][_0xbf47('0x13')]);}logger[_0xbf47('0x12')](_0xbf47('0x14'),_0x2aae7e,_0x23fe3b[_0xbf47('0x12')][_0xbf47('0x13')]);return _0x282dc4(_0x23fe3b[_0xbf47('0x12')][_0xbf47('0x13')]);}else{logger['info'](_0xbf47('0x14'),_0x2aae7e,_0xbf47('0x10'));_0x282dc4(_0x23fe3b[_0xbf47('0x15')][_0xbf47('0x13')]);}})[_0xbf47('0x16')](function(_0x2126e0){logger[_0xbf47('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2aae7e,_0x2126e0);_0x397590(_0x2126e0);});});}exports[_0xbf47('0x17')]=function(_0x4caeb1){var _0x3ea185=this;return new Promise(function(_0x189e42,_0x3c5dc3){return db[_0xbf47('0x18')][_0xbf47('0x19')](_0x4caeb1[_0xbf47('0x1a')],{'raw':_0x4caeb1[_0xbf47('0x1b')]?_0x4caeb1[_0xbf47('0x1b')][_0xbf47('0x1c')]===undefined?!![]:![]:!![]})[_0xbf47('0xc')](function(_0x4e0ddb){logger[_0xbf47('0xd')](_0xbf47('0x17'),_0x4caeb1);logger[_0xbf47('0xe')]('CreateSmsQueueReport',_0x4caeb1,JSON['stringify'](_0x4e0ddb));_0x189e42(_0x4e0ddb);})[_0xbf47('0x16')](function(_0x233261){logger[_0xbf47('0x12')]('CreateSmsQueueReport',_0x233261[_0xbf47('0x13')],_0x4caeb1);_0x3c5dc3(_0x3ea185['error'](0x1f4,_0x233261[_0xbf47('0x13')]));});});};exports[_0xbf47('0x1d')]=function(_0x27b97d){var _0x3f02e3=this;return new Promise(function(_0x4ff36e,_0x2c1a6f){return db[_0xbf47('0x18')][_0xbf47('0x1e')](_0x27b97d[_0xbf47('0x1a')],{'raw':_0x27b97d[_0xbf47('0x1b')]?_0x27b97d['options'][_0xbf47('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27b97d[_0xbf47('0x1b')]?_0x27b97d['options']['where']||null:null,'attributes':_0x27b97d[_0xbf47('0x1b')]?_0x27b97d[_0xbf47('0x1b')][_0xbf47('0x1f')]||null:null,'limit':_0x27b97d[_0xbf47('0x1b')]?_0x27b97d[_0xbf47('0x1b')][_0xbf47('0x20')]||null:null})['then'](function(_0x3cd123){logger[_0xbf47('0xd')](_0xbf47('0x1d'),_0x27b97d);logger[_0xbf47('0xe')]('UpdateSmsQueueReport',_0x27b97d,JSON['stringify'](_0x3cd123));_0x4ff36e(_0x3cd123);})[_0xbf47('0x16')](function(_0x5e5740){logger[_0xbf47('0x12')]('UpdateSmsQueueReport',_0x5e5740[_0xbf47('0x13')],_0x27b97d);_0x2c1a6f(_0x3f02e3[_0xbf47('0x12')](0x1f4,_0x5e5740[_0xbf47('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 4b47ea5..6fc851c 100644 --- a/server/api/smsTransferReport/index.js +++ b/server/api/smsTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08d9=['fs-extra','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','path','express','Router'];(function(_0x1b6911,_0x3ffb3c){var _0x26f1dd=function(_0xc18660){while(--_0xc18660){_0x1b6911['push'](_0x1b6911['shift']());}};_0x26f1dd(++_0x3ffb3c);}(_0x08d9,0xc2));var _0x908d=function(_0x32aaa5,_0x45c662){_0x32aaa5=_0x32aaa5-0x0;var _0x45b69e=_0x08d9[_0x32aaa5];return _0x45b69e;};'use strict';var multer=require(_0x908d('0x0'));var util=require('util');var path=require(_0x908d('0x1'));var timeout=require('connect-timeout');var express=require(_0x908d('0x2'));var router=express[_0x908d('0x3')]();var fs_extra=require(_0x908d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x908d('0x5'));var controller=require(_0x908d('0x6'));router[_0x908d('0x7')]('/',auth[_0x908d('0x8')](),controller[_0x908d('0x9')]);router['get'](_0x908d('0xa'),auth[_0x908d('0x8')](),controller[_0x908d('0xb')]);router[_0x908d('0x7')](_0x908d('0xc'),auth[_0x908d('0x8')](),controller[_0x908d('0xd')]);router[_0x908d('0xe')]('/',auth[_0x908d('0x8')](),controller[_0x908d('0xf')]);router['put'](_0x908d('0xc'),auth[_0x908d('0x8')](),controller[_0x908d('0x10')]);router[_0x908d('0x11')](_0x908d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x86f4=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x86f4,0x18a));var _0x486f=function(_0x5f4b9c,_0x4a00d1){_0x5f4b9c=_0x5f4b9c-0x0;var _0x4358f5=_0x86f4[_0x5f4b9c];return _0x4358f5;};'use strict';var multer=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var path=require(_0x486f('0x2'));var timeout=require(_0x486f('0x3'));var express=require(_0x486f('0x4'));var router=express[_0x486f('0x5')]();var fs_extra=require(_0x486f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x486f('0x7'));var config=require(_0x486f('0x8'));var controller=require('./smsTransferReport.controller');router[_0x486f('0x9')]('/',auth[_0x486f('0xa')](),controller[_0x486f('0xb')]);router[_0x486f('0x9')](_0x486f('0xc'),auth[_0x486f('0xa')](),controller['describe']);router[_0x486f('0x9')](_0x486f('0xd'),auth[_0x486f('0xa')](),controller[_0x486f('0xe')]);router[_0x486f('0xf')]('/',auth[_0x486f('0xa')](),controller[_0x486f('0x10')]);router[_0x486f('0x11')](_0x486f('0xd'),auth[_0x486f('0xa')](),controller[_0x486f('0x12')]);router[_0x486f('0x13')](_0x486f('0xd'),auth[_0x486f('0xa')](),controller[_0x486f('0x14')]);module[_0x486f('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 152e949..e3738a9 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(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x27a1a0,_0x410857){var _0x1321a0=function(_0x4d0991){while(--_0x4d0991){_0x27a1a0['push'](_0x27a1a0['shift']());}};_0x1321a0(++_0x410857);}(_0x54ef,0x112));var _0xf54e=function(_0xdbe4df,_0x4bec5f){_0xdbe4df=_0xdbe4df-0x0;var _0x316f42=_0x54ef[_0xdbe4df];return _0x316f42;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index b3ffd4d..088ac4a 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 _0x7b8b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','SmsTransferReport','include','catch','params','rawAttributes','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x1df101,_0x21b61b){var _0x3c7b19=function(_0x2c4b2a){while(--_0x2c4b2a){_0x1df101['push'](_0x1df101['shift']());}};_0x3c7b19(++_0x21b61b);}(_0x7b8b,0xc9));var _0xb7b8=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0x7b8b[_0x366e99];return _0x180bbe;};'use strict';var emlformat=require(_0xb7b8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7b8('0x1'));var moment=require(_0xb7b8('0x2'));var BPromise=require(_0xb7b8('0x3'));var Mustache=require(_0xb7b8('0x4'));var util=require(_0xb7b8('0x5'));var path=require(_0xb7b8('0x6'));var sox=require('sox');var csv=require(_0xb7b8('0x7'));var ejs=require(_0xb7b8('0x8'));var fs=require('fs');var fs_extra=require(_0xb7b8('0x9'));var _=require(_0xb7b8('0xa'));var squel=require(_0xb7b8('0xb'));var crypto=require(_0xb7b8('0xc'));var jsforce=require(_0xb7b8('0xd'));var deskjs=require(_0xb7b8('0xe'));var toCsv=require(_0xb7b8('0x7'));var querystring=require('querystring');var Papa=require(_0xb7b8('0xf'));var Redis=require(_0xb7b8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb7b8('0x11'));var as=require(_0xb7b8('0x12'));var hardwareService=require(_0xb7b8('0x13'));var logger=require(_0xb7b8('0x14'))(_0xb7b8('0x15'));var utils=require(_0xb7b8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb7b8('0x17'));var db=require(_0xb7b8('0x18'))['db'];function respondWithStatusCode(_0x58eb99,_0x57531b){_0x57531b=_0x57531b||0xcc;return function(_0x548dc9){if(_0x548dc9){return _0x58eb99[_0xb7b8('0x19')](_0x57531b);}return _0x58eb99[_0xb7b8('0x1a')](_0x57531b)['end']();};}function respondWithResult(_0x38b023,_0x11ce65){_0x11ce65=_0x11ce65||0xc8;return function(_0x335384){if(_0x335384){return _0x38b023['status'](_0x11ce65)[_0xb7b8('0x1b')](_0x335384);}};}function respondWithFilteredResult(_0x265905,_0x5286a3){return function(_0x538d47){if(_0x538d47){var _0x3cca57=typeof _0x5286a3['offset']===_0xb7b8('0x1c')&&typeof _0x5286a3[_0xb7b8('0x1d')]===_0xb7b8('0x1c');var _0x22f3b3=_0x538d47[_0xb7b8('0x1e')];var _0x563e0d=_0x3cca57?0x0:_0x5286a3[_0xb7b8('0x1f')];var _0x39c793=_0x3cca57?_0x538d47[_0xb7b8('0x1e')]:_0x5286a3[_0xb7b8('0x1f')]+_0x5286a3[_0xb7b8('0x1d')];var _0x2882e0;if(_0x39c793>=_0x22f3b3){_0x39c793=_0x22f3b3;_0x2882e0=0xc8;}else{_0x2882e0=0xce;}_0x265905[_0xb7b8('0x1a')](_0x2882e0);return _0x265905[_0xb7b8('0x20')](_0xb7b8('0x21'),_0x563e0d+'-'+_0x39c793+'/'+_0x22f3b3)[_0xb7b8('0x1b')](_0x538d47);}return null;};}function patchUpdates(_0xd10db2){return function(_0x143f78){try{jsonpatch['apply'](_0x143f78,_0xd10db2,!![]);}catch(_0x32b623){return BPromise[_0xb7b8('0x22')](_0x32b623);}return _0x143f78[_0xb7b8('0x23')]();};}function saveUpdates(_0x1889ce,_0x12be87){return function(_0x18503a){if(_0x18503a){return _0x18503a[_0xb7b8('0x24')](_0x1889ce)[_0xb7b8('0x25')](function(_0x10039c){return _0x10039c;});}return null;};}function removeEntity(_0x29d6e1,_0x2fd16d){return function(_0xc8b89e){if(_0xc8b89e){return _0xc8b89e[_0xb7b8('0x26')]()[_0xb7b8('0x25')](function(){_0x29d6e1['status'](0xcc)[_0xb7b8('0x27')]();});}};}function handleEntityNotFound(_0xb95398,_0x26e53f){return function(_0x390a6a){if(!_0x390a6a){_0xb95398[_0xb7b8('0x19')](0x194);}return _0x390a6a;};}function handleError(_0x291d5f,_0x3fe56b){_0x3fe56b=_0x3fe56b||0x1f4;return function(_0x24ed7b){logger[_0xb7b8('0x28')](_0x24ed7b[_0xb7b8('0x29')]);if(_0x24ed7b[_0xb7b8('0x2a')]){delete _0x24ed7b[_0xb7b8('0x2a')];}_0x291d5f[_0xb7b8('0x1a')](_0x3fe56b)[_0xb7b8('0x2b')](_0x24ed7b);};}exports[_0xb7b8('0x2c')]=function(_0x597fd6,_0x92a27f){var _0x261543={},_0x17cf97={},_0x303d6e={'count':0x0,'rows':[]};var _0x2dc925=_[_0xb7b8('0x2d')](db['SmsTransferReport']['rawAttributes'],function(_0x40480a){return{'name':_0x40480a[_0xb7b8('0x2e')],'type':_0x40480a[_0xb7b8('0x2f')][_0xb7b8('0x30')]};});_0x17cf97[_0xb7b8('0x31')]=_[_0xb7b8('0x2d')](_0x2dc925,_0xb7b8('0x2a'));_0x17cf97[_0xb7b8('0x32')]=_[_0xb7b8('0x33')](_0x597fd6[_0xb7b8('0x32')]);_0x17cf97[_0xb7b8('0x34')]=_[_0xb7b8('0x35')](_0x17cf97[_0xb7b8('0x31')],_0x17cf97[_0xb7b8('0x32')]);_0x261543[_0xb7b8('0x36')]=_[_0xb7b8('0x35')](_0x17cf97[_0xb7b8('0x31')],qs['fields'](_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x37')]));_0x261543[_0xb7b8('0x36')]=_0x261543['attributes'][_0xb7b8('0x38')]?_0x261543['attributes']:_0x17cf97[_0xb7b8('0x31')];if(!_0x597fd6[_0xb7b8('0x32')]['hasOwnProperty'](_0xb7b8('0x39'))){_0x261543[_0xb7b8('0x1d')]=qs['limit'](_0x597fd6['query'][_0xb7b8('0x1d')]);_0x261543[_0xb7b8('0x1f')]=qs[_0xb7b8('0x1f')](_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x1f')]);}_0x261543[_0xb7b8('0x3a')]=qs[_0xb7b8('0x3b')](_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x3b')]);_0x261543[_0xb7b8('0x3c')]=qs[_0xb7b8('0x34')](_[_0xb7b8('0x3d')](_0x597fd6[_0xb7b8('0x32')],_0x17cf97[_0xb7b8('0x34')]),_0x2dc925);if(_0x597fd6[_0xb7b8('0x32')]['filter']){_0x261543[_0xb7b8('0x3c')]=_[_0xb7b8('0x3e')](_0x261543[_0xb7b8('0x3c')],{'$or':_[_0xb7b8('0x2d')](_0x2dc925,function(_0x5c5edb){if(_0x5c5edb[_0xb7b8('0x2f')]!==_0xb7b8('0x3f')){var _0x3cb7a8={};_0x3cb7a8[_0x5c5edb[_0xb7b8('0x2a')]]={'$like':'%'+_0x597fd6[_0xb7b8('0x32')][_0xb7b8('0x40')]+'%'};return _0x3cb7a8;}})});}_0x261543=_[_0xb7b8('0x3e')]({},_0x261543,_0x597fd6['options']);var _0x33914c={'where':_0x261543[_0xb7b8('0x3c')]};return db[_0xb7b8('0x41')][_0xb7b8('0x1e')](_0x33914c)[_0xb7b8('0x25')](function(_0x4d7687){_0x303d6e[_0xb7b8('0x1e')]=_0x4d7687;if(_0x597fd6[_0xb7b8('0x32')]['includeAll']){_0x261543[_0xb7b8('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x261543);})[_0xb7b8('0x25')](function(_0x5c4e96){_0x303d6e['rows']=_0x5c4e96;return _0x303d6e;})[_0xb7b8('0x25')](respondWithFilteredResult(_0x92a27f,_0x261543))[_0xb7b8('0x43')](handleError(_0x92a27f,null));};exports['show']=function(_0x5d6888,_0x418805){var _0x2d74c8={'raw':!![],'where':{'id':_0x5d6888[_0xb7b8('0x44')]['id']}},_0x3ae476={};_0x3ae476[_0xb7b8('0x31')]=_[_0xb7b8('0x33')](db[_0xb7b8('0x41')][_0xb7b8('0x45')]);_0x3ae476[_0xb7b8('0x32')]=_[_0xb7b8('0x33')](_0x5d6888['query']);_0x3ae476[_0xb7b8('0x34')]=_[_0xb7b8('0x35')](_0x3ae476['model'],_0x3ae476[_0xb7b8('0x32')]);_0x2d74c8[_0xb7b8('0x36')]=_[_0xb7b8('0x35')](_0x3ae476[_0xb7b8('0x31')],qs['fields'](_0x5d6888['query'][_0xb7b8('0x37')]));_0x2d74c8[_0xb7b8('0x36')]=_0x2d74c8[_0xb7b8('0x36')][_0xb7b8('0x38')]?_0x2d74c8[_0xb7b8('0x36')]:_0x3ae476[_0xb7b8('0x31')];if(_0x5d6888[_0xb7b8('0x32')]['includeAll']){_0x2d74c8[_0xb7b8('0x42')]=[{'all':!![]}];}_0x2d74c8=_[_0xb7b8('0x3e')]({},_0x2d74c8,_0x5d6888['options']);return db[_0xb7b8('0x41')]['find'](_0x2d74c8)['then'](handleEntityNotFound(_0x418805,null))[_0xb7b8('0x25')](respondWithResult(_0x418805,null))[_0xb7b8('0x43')](handleError(_0x418805,null));};exports['create']=function(_0x115d56,_0x2dc265){return db['SmsTransferReport']['create'](_0x115d56[_0xb7b8('0x46')],{})['then'](respondWithResult(_0x2dc265,0xc9))[_0xb7b8('0x43')](handleError(_0x2dc265,null));};exports[_0xb7b8('0x24')]=function(_0x383bd2,_0x170102){if(_0x383bd2[_0xb7b8('0x46')]['id']){delete _0x383bd2[_0xb7b8('0x46')]['id'];}return db[_0xb7b8('0x41')][_0xb7b8('0x47')]({'where':{'id':_0x383bd2[_0xb7b8('0x44')]['id']}})[_0xb7b8('0x25')](handleEntityNotFound(_0x170102,null))[_0xb7b8('0x25')](saveUpdates(_0x383bd2[_0xb7b8('0x46')],null))[_0xb7b8('0x25')](respondWithResult(_0x170102,null))['catch'](handleError(_0x170102,null));};exports[_0xb7b8('0x26')]=function(_0x432900,_0x3335f8){return db[_0xb7b8('0x41')][_0xb7b8('0x47')]({'where':{'id':_0x432900[_0xb7b8('0x44')]['id']}})[_0xb7b8('0x25')](handleEntityNotFound(_0x3335f8,null))[_0xb7b8('0x25')](removeEntity(_0x3335f8,null))[_0xb7b8('0x43')](handleError(_0x3335f8,null));};exports[_0xb7b8('0x48')]=function(_0x891cc3,_0x15474b){return db[_0xb7b8('0x41')]['describe']()[_0xb7b8('0x25')](respondWithResult(_0x15474b,null))['catch'](handleError(_0x15474b,null));}; \ No newline at end of file +var _0x2418=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','SmsTransferReport','key','model','name','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2418,0x1bd));var _0x8241=function(_0xd96c99,_0x516add){_0xd96c99=_0xd96c99-0x0;var _0x5ede21=_0x2418[_0xd96c99];return _0x5ede21;};'use strict';var emlformat=require(_0x8241('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8241('0x1'));var moment=require(_0x8241('0x2'));var BPromise=require(_0x8241('0x3'));var Mustache=require(_0x8241('0x4'));var util=require(_0x8241('0x5'));var path=require(_0x8241('0x6'));var sox=require(_0x8241('0x7'));var csv=require('to-csv');var ejs=require(_0x8241('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8241('0x9'));var squel=require(_0x8241('0xa'));var crypto=require(_0x8241('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8241('0xc'));var toCsv=require(_0x8241('0xd'));var querystring=require(_0x8241('0xe'));var Papa=require(_0x8241('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8241('0x10'));var as=require(_0x8241('0x11'));var hardwareService=require(_0x8241('0x12'));var logger=require('../../config/logger')(_0x8241('0x13'));var utils=require(_0x8241('0x14'));var config=require(_0x8241('0x15'));var licenseUtil=require(_0x8241('0x16'));var db=require(_0x8241('0x17'))['db'];function respondWithStatusCode(_0x484a9f,_0x126a26){_0x126a26=_0x126a26||0xcc;return function(_0x307aba){if(_0x307aba){return _0x484a9f[_0x8241('0x18')](_0x126a26);}return _0x484a9f['status'](_0x126a26)[_0x8241('0x19')]();};}function respondWithResult(_0x5ecfc3,_0x3f11c5){_0x3f11c5=_0x3f11c5||0xc8;return function(_0x5358cd){if(_0x5358cd){return _0x5ecfc3[_0x8241('0x1a')](_0x3f11c5)['json'](_0x5358cd);}};}function respondWithFilteredResult(_0x6b8d21,_0x445111){return function(_0x716653){if(_0x716653){var _0x2f1972=typeof _0x445111[_0x8241('0x1b')]===_0x8241('0x1c')&&typeof _0x445111['limit']===_0x8241('0x1c');var _0x1325de=_0x716653[_0x8241('0x1d')];var _0x3df65a=_0x2f1972?0x0:_0x445111[_0x8241('0x1b')];var _0x562f9e=_0x2f1972?_0x716653[_0x8241('0x1d')]:_0x445111[_0x8241('0x1b')]+_0x445111['limit'];var _0x4cea3e;if(_0x562f9e>=_0x1325de){_0x562f9e=_0x1325de;_0x4cea3e=0xc8;}else{_0x4cea3e=0xce;}_0x6b8d21['status'](_0x4cea3e);return _0x6b8d21[_0x8241('0x1e')](_0x8241('0x1f'),_0x3df65a+'-'+_0x562f9e+'/'+_0x1325de)['json'](_0x716653);}return null;};}function patchUpdates(_0x5d3bb8){return function(_0x2ecc32){try{jsonpatch[_0x8241('0x20')](_0x2ecc32,_0x5d3bb8,!![]);}catch(_0x461c73){return BPromise[_0x8241('0x21')](_0x461c73);}return _0x2ecc32[_0x8241('0x22')]();};}function saveUpdates(_0x19b2f2,_0x577d8b){return function(_0x226d6e){if(_0x226d6e){return _0x226d6e[_0x8241('0x23')](_0x19b2f2)[_0x8241('0x24')](function(_0x3036c5){return _0x3036c5;});}return null;};}function removeEntity(_0x5f9ab8,_0x31fb71){return function(_0x434ac8){if(_0x434ac8){return _0x434ac8[_0x8241('0x25')]()[_0x8241('0x24')](function(){_0x5f9ab8[_0x8241('0x1a')](0xcc)[_0x8241('0x19')]();});}};}function handleEntityNotFound(_0x3724ae,_0x15295a){return function(_0x285a21){if(!_0x285a21){_0x3724ae[_0x8241('0x18')](0x194);}return _0x285a21;};}function handleError(_0x5ac699,_0x113ff8){_0x113ff8=_0x113ff8||0x1f4;return function(_0x2aafd2){logger[_0x8241('0x26')](_0x2aafd2[_0x8241('0x27')]);if(_0x2aafd2['name']){delete _0x2aafd2['name'];}_0x5ac699['status'](_0x113ff8)[_0x8241('0x28')](_0x2aafd2);};}exports[_0x8241('0x29')]=function(_0x1075e4,_0x586e1d){var _0x10ea8a={},_0x40daea={},_0xe8df65={'count':0x0,'rows':[]};var _0x2ce9c0=_[_0x8241('0x2a')](db[_0x8241('0x2b')]['rawAttributes'],function(_0x34a0be){return{'name':_0x34a0be['fieldName'],'type':_0x34a0be['type'][_0x8241('0x2c')]};});_0x40daea[_0x8241('0x2d')]=_[_0x8241('0x2a')](_0x2ce9c0,_0x8241('0x2e'));_0x40daea[_0x8241('0x2f')]=_[_0x8241('0x30')](_0x1075e4[_0x8241('0x2f')]);_0x40daea[_0x8241('0x31')]=_['intersection'](_0x40daea[_0x8241('0x2d')],_0x40daea[_0x8241('0x2f')]);_0x10ea8a['attributes']=_[_0x8241('0x32')](_0x40daea[_0x8241('0x2d')],qs[_0x8241('0x33')](_0x1075e4[_0x8241('0x2f')][_0x8241('0x33')]));_0x10ea8a['attributes']=_0x10ea8a['attributes'][_0x8241('0x34')]?_0x10ea8a[_0x8241('0x35')]:_0x40daea['model'];if(!_0x1075e4[_0x8241('0x2f')][_0x8241('0x36')](_0x8241('0x37'))){_0x10ea8a[_0x8241('0x38')]=qs[_0x8241('0x38')](_0x1075e4[_0x8241('0x2f')]['limit']);_0x10ea8a[_0x8241('0x1b')]=qs[_0x8241('0x1b')](_0x1075e4['query'][_0x8241('0x1b')]);}_0x10ea8a[_0x8241('0x39')]=qs['sort'](_0x1075e4[_0x8241('0x2f')][_0x8241('0x3a')]);_0x10ea8a[_0x8241('0x3b')]=qs[_0x8241('0x31')](_[_0x8241('0x3c')](_0x1075e4[_0x8241('0x2f')],_0x40daea['filters']),_0x2ce9c0);if(_0x1075e4['query'][_0x8241('0x3d')]){_0x10ea8a['where']=_[_0x8241('0x3e')](_0x10ea8a[_0x8241('0x3b')],{'$or':_[_0x8241('0x2a')](_0x2ce9c0,function(_0x5e1c4a){if(_0x5e1c4a[_0x8241('0x3f')]!==_0x8241('0x40')){var _0x4c0657={};_0x4c0657[_0x5e1c4a[_0x8241('0x2e')]]={'$like':'%'+_0x1075e4['query'][_0x8241('0x3d')]+'%'};return _0x4c0657;}})});}_0x10ea8a=_[_0x8241('0x3e')]({},_0x10ea8a,_0x1075e4[_0x8241('0x41')]);var _0x2dc672={'where':_0x10ea8a['where']};return db[_0x8241('0x2b')][_0x8241('0x1d')](_0x2dc672)[_0x8241('0x24')](function(_0x205923){_0xe8df65[_0x8241('0x1d')]=_0x205923;if(_0x1075e4[_0x8241('0x2f')][_0x8241('0x42')]){_0x10ea8a[_0x8241('0x43')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8241('0x44')](_0x10ea8a);})['then'](function(_0xf16c46){_0xe8df65[_0x8241('0x45')]=_0xf16c46;return _0xe8df65;})[_0x8241('0x24')](respondWithFilteredResult(_0x586e1d,_0x10ea8a))[_0x8241('0x46')](handleError(_0x586e1d,null));};exports[_0x8241('0x47')]=function(_0x4346d8,_0x5265f0){var _0x1466b0={'raw':!![],'where':{'id':_0x4346d8[_0x8241('0x48')]['id']}},_0x413759={};_0x413759[_0x8241('0x2d')]=_[_0x8241('0x30')](db[_0x8241('0x2b')]['rawAttributes']);_0x413759[_0x8241('0x2f')]=_[_0x8241('0x30')](_0x4346d8[_0x8241('0x2f')]);_0x413759['filters']=_[_0x8241('0x32')](_0x413759[_0x8241('0x2d')],_0x413759['query']);_0x1466b0[_0x8241('0x35')]=_[_0x8241('0x32')](_0x413759[_0x8241('0x2d')],qs[_0x8241('0x33')](_0x4346d8[_0x8241('0x2f')][_0x8241('0x33')]));_0x1466b0[_0x8241('0x35')]=_0x1466b0[_0x8241('0x35')][_0x8241('0x34')]?_0x1466b0[_0x8241('0x35')]:_0x413759[_0x8241('0x2d')];if(_0x4346d8['query'][_0x8241('0x42')]){_0x1466b0[_0x8241('0x43')]=[{'all':!![]}];}_0x1466b0=_[_0x8241('0x3e')]({},_0x1466b0,_0x4346d8[_0x8241('0x41')]);return db[_0x8241('0x2b')][_0x8241('0x49')](_0x1466b0)[_0x8241('0x24')](handleEntityNotFound(_0x5265f0,null))[_0x8241('0x24')](respondWithResult(_0x5265f0,null))[_0x8241('0x46')](handleError(_0x5265f0,null));};exports[_0x8241('0x4a')]=function(_0x5c79ea,_0x31d5d2){return db[_0x8241('0x2b')]['create'](_0x5c79ea[_0x8241('0x4b')],{})[_0x8241('0x24')](respondWithResult(_0x31d5d2,0xc9))['catch'](handleError(_0x31d5d2,null));};exports[_0x8241('0x23')]=function(_0x5dc789,_0x19cf2e){if(_0x5dc789[_0x8241('0x4b')]['id']){delete _0x5dc789[_0x8241('0x4b')]['id'];}return db['SmsTransferReport'][_0x8241('0x49')]({'where':{'id':_0x5dc789[_0x8241('0x48')]['id']}})[_0x8241('0x24')](handleEntityNotFound(_0x19cf2e,null))[_0x8241('0x24')](saveUpdates(_0x5dc789[_0x8241('0x4b')],null))[_0x8241('0x24')](respondWithResult(_0x19cf2e,null))['catch'](handleError(_0x19cf2e,null));};exports[_0x8241('0x25')]=function(_0x29ea46,_0x2d2167){return db['SmsTransferReport'][_0x8241('0x49')]({'where':{'id':_0x29ea46[_0x8241('0x48')]['id']}})[_0x8241('0x24')](handleEntityNotFound(_0x2d2167,null))[_0x8241('0x24')](removeEntity(_0x2d2167,null))[_0x8241('0x46')](handleError(_0x2d2167,null));};exports[_0x8241('0x4c')]=function(_0x401c7b,_0x36c01f){return db['SmsTransferReport'][_0x8241('0x4c')]()[_0x8241('0x24')](respondWithResult(_0x36c01f,null))[_0x8241('0x46')](handleError(_0x36c01f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f78a004..1ba14c7 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 _0xe548=['../../config/logger','api','moment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util'];(function(_0x4f3075,_0x3c0b65){var _0x40735f=function(_0x4a95b6){while(--_0x4a95b6){_0x4f3075['push'](_0x4f3075['shift']());}};_0x40735f(++_0x3c0b65);}(_0xe548,0x184));var _0x8e54=function(_0x2e5069,_0x3a1115){_0x2e5069=_0x2e5069-0x0;var _0x2f00ad=_0xe548[_0x2e5069];return _0x2f00ad;};'use strict';var _=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var logger=require(_0x8e54('0x2'))(_0x8e54('0x3'));var moment=require(_0x8e54('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e54('0x5'));module['exports']=function(_0x288be8,_0x47a58d){return _0x288be8[_0x8e54('0x6')](_0x8e54('0x7'),attributes,{'tableName':_0x8e54('0x8'),'paranoid':![],'indexes':[{'name':_0x8e54('0x9'),'fields':[_0x8e54('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad7c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid'];(function(_0x56bb32,_0x5d0dee){var _0xfb8403=function(_0x4a7644){while(--_0x4a7644){_0x56bb32['push'](_0x56bb32['shift']());}};_0xfb8403(++_0x5d0dee);}(_0xad7c,0x8c));var _0xcad7=function(_0x414b5c,_0x21773c){_0x414b5c=_0x414b5c-0x0;var _0x402a56=_0xad7c[_0x414b5c];return _0x402a56;};'use strict';var _=require(_0xcad7('0x0'));var util=require(_0xcad7('0x1'));var logger=require(_0xcad7('0x2'))(_0xcad7('0x3'));var moment=require(_0xcad7('0x4'));var BPromise=require('bluebird');var rp=require(_0xcad7('0x5'));var fs=require('fs');var path=require(_0xcad7('0x6'));var rimraf=require(_0xcad7('0x7'));var config=require(_0xcad7('0x8'));var attributes=require(_0xcad7('0x9'));module[_0xcad7('0xa')]=function(_0x4249be,_0x5a546c){return _0x4249be[_0xcad7('0xb')](_0xcad7('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xcad7('0xd'),'fields':[_0xcad7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 686fba1..b9d6fab 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 _0x34f8=['http','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34f8,0x80));var _0x834f=function(_0x39f9ab,_0x127552){_0x39f9ab=_0x39f9ab-0x0;var _0x1d9d70=_0x34f8[_0x39f9ab];return _0x1d9d70;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var moment=require(_0x834f('0x2'));var BPromise=require(_0x834f('0x3'));var rs=require(_0x834f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x834f('0x5'));var logger=require(_0x834f('0x6'))('rpc');var config=require(_0x834f('0x7'));var jayson=require(_0x834f('0x8'));var client=jayson[_0x834f('0x9')][_0x834f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5378c4,_0x4cd107,_0xf778e4){return new BPromise(function(_0x2597c6,_0x20b504){return client[_0x834f('0xb')](_0x5378c4,_0xf778e4)['then'](function(_0x4210cf){logger[_0x834f('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4cd107,_0x834f('0xd'));logger[_0x834f('0xe')](_0x834f('0xf'),_0x4cd107,_0x834f('0xd'),JSON[_0x834f('0x10')](_0x4210cf));if(_0x4210cf[_0x834f('0x11')]){if(_0x4210cf[_0x834f('0x11')][_0x834f('0x12')]===0x1f4){logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);return _0x20b504(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')]['message']);return _0x2597c6(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}else{logger['info'](_0x834f('0x13'),_0x4cd107,'request\x20sent');_0x2597c6(_0x4210cf[_0x834f('0x15')][_0x834f('0x14')]);}})[_0x834f('0x16')](function(_0x248924){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4cd107,_0x248924);_0x20b504(_0x248924);});});} \ No newline at end of file +var _0x6379=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4099c1,_0x2c3a00){var _0x30485d=function(_0x17143e){while(--_0x17143e){_0x4099c1['push'](_0x4099c1['shift']());}};_0x30485d(++_0x2c3a00);}(_0x6379,0x84));var _0x9637=function(_0x2d2aa4,_0x4f0c97){_0x2d2aa4=_0x2d2aa4-0x0;var _0x1b54bd=_0x6379[_0x2d2aa4];return _0x1b54bd;};'use strict';var _=require(_0x9637('0x0'));var util=require(_0x9637('0x1'));var moment=require(_0x9637('0x2'));var BPromise=require(_0x9637('0x3'));var rs=require(_0x9637('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9637('0x5'))['db'];var utils=require(_0x9637('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9637('0x7'));var jayson=require(_0x9637('0x8'));var client=jayson[_0x9637('0x9')][_0x9637('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf0db9f,_0x5ce1a4,_0x515a84){return new BPromise(function(_0x21d91b,_0x42eda1){return client[_0x9637('0xb')](_0xf0db9f,_0x515a84)[_0x9637('0xc')](function(_0x5e66ee){logger[_0x9637('0xd')](_0x9637('0xe'),_0x5ce1a4,_0x9637('0xf'));logger[_0x9637('0x10')](_0x9637('0x11'),_0x5ce1a4,_0x9637('0xf'),JSON[_0x9637('0x12')](_0x5e66ee));if(_0x5e66ee[_0x9637('0x13')]){if(_0x5e66ee[_0x9637('0x13')]['code']===0x1f4){logger[_0x9637('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x5ce1a4,_0x5e66ee[_0x9637('0x13')][_0x9637('0x14')]);return _0x42eda1(_0x5e66ee['error'][_0x9637('0x14')]);}logger[_0x9637('0x13')](_0x9637('0xe'),_0x5ce1a4,_0x5e66ee[_0x9637('0x13')]['message']);return _0x21d91b(_0x5e66ee[_0x9637('0x13')][_0x9637('0x14')]);}else{logger[_0x9637('0xd')](_0x9637('0xe'),_0x5ce1a4,_0x9637('0xf'));_0x21d91b(_0x5e66ee['result'][_0x9637('0x14')]);}})[_0x9637('0x15')](function(_0x1eb774){logger[_0x9637('0x13')](_0x9637('0xe'),_0x5ce1a4,_0x1eb774);_0x42eda1(_0x1eb774);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d010c72..38c821c 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 _0xa3d8=['download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0xa3d8,0x1f1));var _0x8a3d=function(_0x5bf26d,_0x12e71e){_0x5bf26d=_0x5bf26d-0x0;var _0x124db5=_0xa3d8[_0x5bf26d];return _0x124db5;};'use strict';var multer=require(_0x8a3d('0x0'));var util=require('util');var path=require(_0x8a3d('0x1'));var timeout=require(_0x8a3d('0x2'));var express=require(_0x8a3d('0x3'));var router=express['Router']();var fs_extra=require(_0x8a3d('0x4'));var auth=require(_0x8a3d('0x5'));var interaction=require(_0x8a3d('0x6'));var config=require(_0x8a3d('0x7'));var controller=require(_0x8a3d('0x8'));router[_0x8a3d('0x9')]('/',auth[_0x8a3d('0xa')](),controller[_0x8a3d('0xb')]);router[_0x8a3d('0x9')](_0x8a3d('0xc'),auth['isAuthenticated'](),controller[_0x8a3d('0xd')]);router[_0x8a3d('0x9')](_0x8a3d('0xe'),auth[_0x8a3d('0xa')](),controller[_0x8a3d('0xf')]);var upload=multer({'storage':multer[_0x8a3d('0x10')]({'destination':function(_0x219e09,_0x5a640f,_0x3046d5){_0x3046d5(null,path[_0x8a3d('0x11')](config['root'],_0x8a3d('0x12')));},'filename':function(_0x977574,_0x12e580,_0x1bd2ef){_0x12e580[_0x8a3d('0x13')]=_0x12e580[_0x8a3d('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1bd2ef(null,util[_0x8a3d('0x14')](_0x8a3d('0x15'),path[_0x8a3d('0x16')](_0x12e580[_0x8a3d('0x13')],path[_0x8a3d('0x17')](_0x12e580[_0x8a3d('0x13')])),Date[_0x8a3d('0x18')](),path[_0x8a3d('0x17')](_0x12e580[_0x8a3d('0x13')])));}})});router[_0x8a3d('0x19')]('/',upload[_0x8a3d('0x1a')](_0x8a3d('0x1b')),controller[_0x8a3d('0x1c')]);router[_0x8a3d('0x1d')]('/:id',auth[_0x8a3d('0xa')](),controller[_0x8a3d('0x1e')]);router[_0x8a3d('0x1f')](_0x8a3d('0xc'),auth['isAuthenticated'](),controller[_0x8a3d('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x8ffa=['Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','index','/:id','isAuthenticated','show','get','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','create','put','update','delete','util','express'];(function(_0x201ab0,_0x148b1b){var _0x124c05=function(_0x364586){while(--_0x364586){_0x201ab0['push'](_0x201ab0['shift']());}};_0x124c05(++_0x148b1b);}(_0x8ffa,0xe6));var _0xa8ff=function(_0xd8d76f,_0x42014a){_0xd8d76f=_0xd8d76f-0x0;var _0x2bbd81=_0x8ffa[_0xd8d76f];return _0x2bbd81;};'use strict';var multer=require('multer');var util=require(_0xa8ff('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa8ff('0x1'));var router=express[_0xa8ff('0x2')]();var fs_extra=require(_0xa8ff('0x3'));var auth=require(_0xa8ff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa8ff('0x5'));var controller=require(_0xa8ff('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa8ff('0x7')]);router['get'](_0xa8ff('0x8'),auth[_0xa8ff('0x9')](),controller[_0xa8ff('0xa')]);router[_0xa8ff('0xb')](_0xa8ff('0xc'),auth[_0xa8ff('0x9')](),controller[_0xa8ff('0xd')]);var upload=multer({'storage':multer[_0xa8ff('0xe')]({'destination':function(_0x17703d,_0x26e060,_0x529edd){_0x529edd(null,path[_0xa8ff('0xf')](config[_0xa8ff('0x10')],'server/files/sounds/original/'));},'filename':function(_0x4457cd,_0x36930e,_0x5be9f1){_0x36930e[_0xa8ff('0x11')]=_0x36930e[_0xa8ff('0x11')][_0xa8ff('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5be9f1(null,util[_0xa8ff('0x13')](_0xa8ff('0x14'),path[_0xa8ff('0x15')](_0x36930e[_0xa8ff('0x11')],path[_0xa8ff('0x16')](_0x36930e[_0xa8ff('0x11')])),Date[_0xa8ff('0x17')](),path[_0xa8ff('0x16')](_0x36930e['originalname'])));}})});router[_0xa8ff('0x18')]('/',upload['single']('file'),controller[_0xa8ff('0x19')]);router[_0xa8ff('0x1a')](_0xa8ff('0x8'),auth[_0xa8ff('0x9')](),controller[_0xa8ff('0x1b')]);router[_0xa8ff('0x1c')](_0xa8ff('0x8'),auth[_0xa8ff('0x9')](),controller[_0xa8ff('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6d61d26..2201030 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 _0x4708=['STRING','FLOAT','BIGINT','INTEGER','exports','name'];(function(_0x731e02,_0x338a0e){var _0x5a3b93=function(_0x357e4f){while(--_0x357e4f){_0x731e02['push'](_0x731e02['shift']());}};_0x5a3b93(++_0x338a0e);}(_0x4708,0x196));var _0x8470=function(_0x492f46,_0x233349){_0x492f46=_0x492f46-0x0;var _0x5bb67c=_0x4708[_0x492f46];return _0x5bb67c;};'use strict';var Sequelize=require('sequelize');module[_0x8470('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8470('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x8470('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x8470('0x2')]},'original_format':{'type':Sequelize[_0x8470('0x2')]},'original_duration':{'type':Sequelize[_0x8470('0x3')]},'original_sampleCount':{'type':Sequelize[_0x8470('0x4')]},'original_channelCount':{'type':Sequelize[_0x8470('0x5')]},'original_bitRate':{'type':Sequelize[_0x8470('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8470('0x5')]},'converted_format':{'type':Sequelize[_0x8470('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x8470('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x8470('0x5')]}}; \ No newline at end of file +var _0x2b39=['sequelize','STRING','name','BIGINT','INTEGER','FLOAT'];(function(_0x2b89dc,_0x8bfa42){var _0x412762=function(_0x42dc39){while(--_0x42dc39){_0x2b89dc['push'](_0x2b89dc['shift']());}};_0x412762(++_0x8bfa42);}(_0x2b39,0xc0));var _0x92b3=function(_0x3308a0,_0x5a71c4){_0x3308a0=_0x3308a0-0x0;var _0x3adbf3=_0x2b39[_0x3308a0];return _0x3adbf3;};'use strict';var Sequelize=require(_0x92b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x92b3('0x1')],'unique':_0x92b3('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x92b3('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x92b3('0x1')]},'original_format':{'type':Sequelize[_0x92b3('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x92b3('0x3')]},'original_channelCount':{'type':Sequelize[_0x92b3('0x4')]},'original_bitRate':{'type':Sequelize[_0x92b3('0x3')]},'original_sampleRate':{'type':Sequelize[_0x92b3('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x92b3('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x92b3('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x92b3('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c20e87e..8ad86d5 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 _0xe560=['sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','download','format','%s.%s','converted_format','basename','file','originalname','filename','extname','substring','wav','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','create','body','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0xe560,0x169));var _0x0e56=function(_0x663c22,_0x36041d){_0x663c22=_0x663c22-0x0;var _0x159b4d=_0xe560[_0x663c22];return _0x159b4d;};'use strict';var emlformat=require(_0x0e56('0x0'));var rimraf=require(_0x0e56('0x1'));var zipdir=require(_0x0e56('0x2'));var jsonpatch=require(_0x0e56('0x3'));var rp=require('request-promise');var moment=require(_0x0e56('0x4'));var BPromise=require(_0x0e56('0x5'));var Mustache=require('mustache');var util=require(_0x0e56('0x6'));var path=require(_0x0e56('0x7'));var sox=require(_0x0e56('0x8'));var csv=require(_0x0e56('0x9'));var ejs=require(_0x0e56('0xa'));var fs=require('fs');var fs_extra=require(_0x0e56('0xb'));var _=require('lodash');var squel=require(_0x0e56('0xc'));var crypto=require(_0x0e56('0xd'));var jsforce=require(_0x0e56('0xe'));var deskjs=require(_0x0e56('0xf'));var toCsv=require(_0x0e56('0x9'));var querystring=require(_0x0e56('0x10'));var Papa=require(_0x0e56('0x11'));var Redis=require(_0x0e56('0x12'));var authService=require(_0x0e56('0x13'));var qs=require(_0x0e56('0x14'));var as=require(_0x0e56('0x15'));var hardwareService=require(_0x0e56('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0e56('0x17'));var licenseUtil=require(_0x0e56('0x18'));var db=require(_0x0e56('0x19'))['db'];function respondWithStatusCode(_0x4bacce,_0x315ee5){_0x315ee5=_0x315ee5||0xcc;return function(_0x12185a){if(_0x12185a){return _0x4bacce[_0x0e56('0x1a')](_0x315ee5);}return _0x4bacce[_0x0e56('0x1b')](_0x315ee5)['end']();};}function respondWithResult(_0x191c76,_0x235830){_0x235830=_0x235830||0xc8;return function(_0x3df598){if(_0x3df598){return _0x191c76[_0x0e56('0x1b')](_0x235830)[_0x0e56('0x1c')](_0x3df598);}};}function respondWithFilteredResult(_0x24e2c4,_0x23f71e){return function(_0x255c9c){if(_0x255c9c){var _0x28d4a7=typeof _0x23f71e[_0x0e56('0x1d')]===_0x0e56('0x1e')&&typeof _0x23f71e[_0x0e56('0x1f')]===_0x0e56('0x1e');var _0x3b9077=_0x255c9c[_0x0e56('0x20')];var _0x2486ed=_0x28d4a7?0x0:_0x23f71e['offset'];var _0x2fd9d4=_0x28d4a7?_0x255c9c['count']:_0x23f71e[_0x0e56('0x1d')]+_0x23f71e[_0x0e56('0x1f')];var _0x22a4a5;if(_0x2fd9d4>=_0x3b9077){_0x2fd9d4=_0x3b9077;_0x22a4a5=0xc8;}else{_0x22a4a5=0xce;}_0x24e2c4[_0x0e56('0x1b')](_0x22a4a5);return _0x24e2c4[_0x0e56('0x21')]('Content-Range',_0x2486ed+'-'+_0x2fd9d4+'/'+_0x3b9077)['json'](_0x255c9c);}return null;};}function patchUpdates(_0x424384){return function(_0x201bef){try{jsonpatch[_0x0e56('0x22')](_0x201bef,_0x424384,!![]);}catch(_0x55f99f){return BPromise[_0x0e56('0x23')](_0x55f99f);}return _0x201bef['save']();};}function saveUpdates(_0x109b43,_0x5d363f){return function(_0x5843df){if(_0x5843df){return _0x5843df['update'](_0x109b43)[_0x0e56('0x24')](function(_0x37a142){return _0x37a142;});}return null;};}function removeEntity(_0x3c2bba,_0x4f1075){return function(_0x272865){if(_0x272865){return _0x272865[_0x0e56('0x25')]()[_0x0e56('0x24')](function(){var _0x49b026=_0x272865[_0x0e56('0x26')]({'plain':!![]});var _0xbbd414=_0x0e56('0x27');return db[_0x0e56('0x28')][_0x0e56('0x25')]({'where':{'type':_0xbbd414,'resourceId':_0x49b026['id']}})['then'](function(){return _0x272865;});})[_0x0e56('0x24')](function(){_0x3c2bba['status'](0xcc)[_0x0e56('0x29')]();});}};}function handleEntityNotFound(_0x18d8e0,_0x49a0fd){return function(_0x186fc2){if(!_0x186fc2){_0x18d8e0[_0x0e56('0x1a')](0x194);}return _0x186fc2;};}function handleError(_0x8c4f4e,_0x45db1c){_0x45db1c=_0x45db1c||0x1f4;return function(_0x3df88b){logger[_0x0e56('0x2a')](_0x3df88b[_0x0e56('0x2b')]);if(_0x3df88b['name']){delete _0x3df88b[_0x0e56('0x2c')];}_0x8c4f4e[_0x0e56('0x1b')](_0x45db1c)['send'](_0x3df88b);};}exports['index']=function(_0x3e0047,_0xe01bbc){var _0x14d259={},_0xf7b5df={},_0x23ee5b={'count':0x0,'rows':[]};var _0x406712=_[_0x0e56('0x2d')](db[_0x0e56('0x2e')][_0x0e56('0x2f')],function(_0x2e2770){return{'name':_0x2e2770[_0x0e56('0x30')],'type':_0x2e2770[_0x0e56('0x31')][_0x0e56('0x32')]};});_0xf7b5df['model']=_[_0x0e56('0x2d')](_0x406712,_0x0e56('0x2c'));_0xf7b5df[_0x0e56('0x33')]=_[_0x0e56('0x34')](_0x3e0047[_0x0e56('0x33')]);_0xf7b5df[_0x0e56('0x35')]=_['intersection'](_0xf7b5df[_0x0e56('0x36')],_0xf7b5df[_0x0e56('0x33')]);_0x14d259[_0x0e56('0x37')]=_[_0x0e56('0x38')](_0xf7b5df[_0x0e56('0x36')],qs[_0x0e56('0x39')](_0x3e0047[_0x0e56('0x33')]['fields']));_0x14d259['attributes']=_0x14d259[_0x0e56('0x37')][_0x0e56('0x3a')]?_0x14d259[_0x0e56('0x37')]:_0xf7b5df['model'];if(!_0x3e0047[_0x0e56('0x33')][_0x0e56('0x3b')](_0x0e56('0x3c'))){_0x14d259[_0x0e56('0x1f')]=qs[_0x0e56('0x1f')](_0x3e0047['query'][_0x0e56('0x1f')]);_0x14d259[_0x0e56('0x1d')]=qs['offset'](_0x3e0047[_0x0e56('0x33')][_0x0e56('0x1d')]);}_0x14d259[_0x0e56('0x3d')]=qs[_0x0e56('0x3e')](_0x3e0047[_0x0e56('0x33')][_0x0e56('0x3e')]);_0x14d259[_0x0e56('0x3f')]=qs[_0x0e56('0x35')](_['pick'](_0x3e0047['query'],_0xf7b5df[_0x0e56('0x35')]),_0x406712);if(_0x3e0047[_0x0e56('0x33')][_0x0e56('0x40')]){_0x14d259['where']=_[_0x0e56('0x41')](_0x14d259[_0x0e56('0x3f')],{'$or':_['map'](_0x406712,function(_0x77f256){if(_0x77f256[_0x0e56('0x31')]!==_0x0e56('0x42')){var _0x2653d2={};_0x2653d2[_0x77f256['name']]={'$like':'%'+_0x3e0047[_0x0e56('0x33')]['filter']+'%'};return _0x2653d2;}})});}_0x14d259=_[_0x0e56('0x41')]({},_0x14d259,_0x3e0047['options']);var _0x501faa={'where':_0x14d259[_0x0e56('0x3f')]};return db[_0x0e56('0x2e')][_0x0e56('0x20')](_0x501faa)[_0x0e56('0x24')](function(_0x870549){_0x23ee5b['count']=_0x870549;if(_0x3e0047[_0x0e56('0x33')][_0x0e56('0x43')]){_0x14d259[_0x0e56('0x44')]=[{'all':!![]}];}return db[_0x0e56('0x2e')]['findAll'](_0x14d259);})[_0x0e56('0x24')](function(_0x3255c7){_0x23ee5b['rows']=_0x3255c7;return _0x23ee5b;})[_0x0e56('0x24')](respondWithFilteredResult(_0xe01bbc,_0x14d259))[_0x0e56('0x45')](handleError(_0xe01bbc,null));};exports[_0x0e56('0x46')]=function(_0x97ed90,_0x36450b){var _0x7bf6a1={'raw':!![],'where':{'id':_0x97ed90[_0x0e56('0x47')]['id']}},_0x1e827b={};_0x1e827b[_0x0e56('0x36')]=_[_0x0e56('0x34')](db[_0x0e56('0x2e')][_0x0e56('0x2f')]);_0x1e827b[_0x0e56('0x33')]=_[_0x0e56('0x34')](_0x97ed90[_0x0e56('0x33')]);_0x1e827b[_0x0e56('0x35')]=_['intersection'](_0x1e827b[_0x0e56('0x36')],_0x1e827b[_0x0e56('0x33')]);_0x7bf6a1[_0x0e56('0x37')]=_[_0x0e56('0x38')](_0x1e827b[_0x0e56('0x36')],qs['fields'](_0x97ed90[_0x0e56('0x33')][_0x0e56('0x39')]));_0x7bf6a1[_0x0e56('0x37')]=_0x7bf6a1[_0x0e56('0x37')][_0x0e56('0x3a')]?_0x7bf6a1[_0x0e56('0x37')]:_0x1e827b[_0x0e56('0x36')];if(_0x97ed90[_0x0e56('0x33')][_0x0e56('0x43')]){_0x7bf6a1[_0x0e56('0x44')]=[{'all':!![]}];}_0x7bf6a1=_[_0x0e56('0x41')]({},_0x7bf6a1,_0x97ed90[_0x0e56('0x48')]);return db[_0x0e56('0x2e')][_0x0e56('0x49')](_0x7bf6a1)[_0x0e56('0x24')](handleEntityNotFound(_0x36450b,null))[_0x0e56('0x24')](respondWithResult(_0x36450b,null))[_0x0e56('0x45')](handleError(_0x36450b,null));};exports['download']=function(_0x5ba199,_0x4e8a2c,_0x41b89b){return db[_0x0e56('0x2e')][_0x0e56('0x49')]({'where':{'id':_0x5ba199[_0x0e56('0x47')]['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x4e8a2c,null))[_0x0e56('0x24')](function(_0x3231ae){if(_0x3231ae){if(!fs[_0x0e56('0x4a')](path[_0x0e56('0x4b')](config[_0x0e56('0x4c')],_0x0e56('0x4d'),_0x3231ae[_0x0e56('0x4e')]+'.'+_0x3231ae['converted_format']))){throw new db[(_0x0e56('0x4f'))]['ValidationError']('Sound\x20not\x20found');}return _0x4e8a2c[_0x0e56('0x50')](path['join'](config[_0x0e56('0x4c')],_0x0e56('0x4d'),util[_0x0e56('0x51')](_0x0e56('0x52'),_0x3231ae[_0x0e56('0x4e')],_0x3231ae[_0x0e56('0x53')])),util['format'](_0x0e56('0x52'),_0x3231ae[_0x0e56('0x2c')],_0x3231ae[_0x0e56('0x53')]));}return null;})[_0x0e56('0x45')](handleError(_0x4e8a2c,null));};exports['create']=function(_0x5e88cb,_0x50d1f2,_0x319c96){var _0x4c872d={'name':path[_0x0e56('0x54')](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x56')],path['extname'](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x56')])),'save_name':path[_0x0e56('0x54')](_0x5e88cb['file'][_0x0e56('0x57')],path[_0x0e56('0x58')](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x57')])),'original_format':path[_0x0e56('0x58')](_0x5e88cb['file']['originalname'])[_0x0e56('0x59')](0x1),'converted_format':_0x0e56('0x5a')};var _0x2d6355=path[_0x0e56('0x4b')](config['root'],'server/files/sounds/original',_0x5e88cb['file'][_0x0e56('0x57')]);var _0x18ccee=path['join'](config['root'],_0x0e56('0x4d'),util[_0x0e56('0x51')](_0x0e56('0x52'),path[_0x0e56('0x54')](_0x5e88cb['file'][_0x0e56('0x57')],path[_0x0e56('0x58')](_0x5e88cb[_0x0e56('0x55')][_0x0e56('0x57')])),_0x4c872d[_0x0e56('0x53')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x2d6355);logger[_0x0e56('0x5b')](_0x0e56('0x5c'),_0x18ccee);try{fs[_0x0e56('0x5d')](_0x2d6355,parseInt(_0x0e56('0x5e'),0x8));var _0x82bced=sox['transcode'](_0x2d6355,_0x18ccee,{'sampleRate':0x1f40,'format':_0x0e56('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x82bced['on'](_0x0e56('0x2a'),function(_0x426cf6){fs['unlinkSync'](_0x2d6355);_0x50d1f2[_0x0e56('0x1b')](0x1f4)[_0x0e56('0x5f')](_0x426cf6);});_0x82bced['on'](_0x0e56('0x60'),function(_0x2aac92){_0x4c872d['original_duration']=isNaN(_0x2aac92[_0x0e56('0x61')])?null:_0x2aac92['duration']*0x3e8;_0x4c872d[_0x0e56('0x62')]=isNaN(_0x2aac92[_0x0e56('0x63')])?null:_0x2aac92[_0x0e56('0x63')];_0x4c872d[_0x0e56('0x64')]=isNaN(_0x2aac92[_0x0e56('0x65')])?null:_0x2aac92[_0x0e56('0x65')];_0x4c872d[_0x0e56('0x66')]=isNaN(_0x2aac92['bitRate'])?null:_0x2aac92['bitRate'];_0x4c872d[_0x0e56('0x67')]=isNaN(_0x2aac92['sampleRate'])?null:_0x2aac92[_0x0e56('0x68')];});_0x82bced['on'](_0x0e56('0x69'),function(_0x2967c1){_0x4c872d[_0x0e56('0x6a')]=isNaN(_0x2967c1[_0x0e56('0x61')])?null:_0x2967c1[_0x0e56('0x61')]*0x3e8;_0x4c872d['converted_sampleCount']=isNaN(_0x2967c1[_0x0e56('0x63')])?null:_0x2967c1[_0x0e56('0x63')];_0x4c872d[_0x0e56('0x6b')]=isNaN(_0x2967c1[_0x0e56('0x65')])?null:_0x2967c1[_0x0e56('0x65')];_0x4c872d[_0x0e56('0x6c')]=isNaN(_0x2967c1[_0x0e56('0x6d')])?null:_0x2967c1['bitRate'];_0x4c872d[_0x0e56('0x6e')]=isNaN(_0x2967c1[_0x0e56('0x68')])?null:_0x2967c1['sampleRate'];});_0x82bced['on'](_0x0e56('0x29'),function(){fs[_0x0e56('0x5d')](_0x18ccee,parseInt(_0x0e56('0x5e'),0x8));return db['Sound'][_0x0e56('0x6f')](_0x4c872d)['then'](function(_0x20c1f1){var _0x4aa7e8={'role':_0x5e88cb[_0x0e56('0x70')]['role'],'userProfileId':_0x5e88cb[_0x0e56('0x70')][_0x0e56('0x71')]};if(!_0x4aa7e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa7e8['role']==='user'){var _0x3ca496=_0x20c1f1[_0x0e56('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x0e56('0x49')]({'where':{'name':_0x0e56('0x27'),'userProfileId':_0x4aa7e8[_0x0e56('0x71')]},'raw':!![]})[_0x0e56('0x24')](function(_0x1fe9eb){if(_0x1fe9eb&&_0x1fe9eb[_0x0e56('0x72')]===0x0){return db[_0x0e56('0x28')][_0x0e56('0x6f')]({'name':_0x3ca496['name'],'resourceId':_0x3ca496['id'],'type':_0x1fe9eb['name'],'sectionId':_0x1fe9eb['id']},{})[_0x0e56('0x24')](function(){return _0x20c1f1;});}else{return _0x20c1f1;}})[_0x0e56('0x45')](function(_0x2fa3fd){logger[_0x0e56('0x2a')](_0x0e56('0x73'),_0x2fa3fd);throw _0x2fa3fd;});}return _0x20c1f1;})[_0x0e56('0x24')](respondWithResult(_0x50d1f2,null))['catch'](handleError(_0x50d1f2,null));});_0x82bced[_0x0e56('0x74')]();}catch(_0x3f2818){_0x50d1f2[_0x0e56('0x1b')](0x1f4)[_0x0e56('0x5f')](_0x3f2818);}};exports[_0x0e56('0x75')]=function(_0x32f9b6,_0x1d5dc7,_0x1d7ba3){return db[_0x0e56('0x2e')][_0x0e56('0x49')]({'where':{'id':_0x32f9b6[_0x0e56('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d5dc7,null))[_0x0e56('0x24')](saveUpdates(_['pick'](_0x32f9b6[_0x0e56('0x70')],['name',_0x0e56('0x76')]),null))[_0x0e56('0x24')](respondWithResult(_0x1d5dc7,null))[_0x0e56('0x45')](handleError(_0x1d5dc7,null));};exports[_0x0e56('0x77')]=function(_0x12c12b,_0x39c8c2,_0xa1b1d3){return db[_0x0e56('0x2e')][_0x0e56('0x49')]({'where':{'id':_0x12c12b[_0x0e56('0x47')]['id']}})[_0x0e56('0x24')](function(_0x1bead5){if(_0x1bead5){return _0x1bead5[_0x0e56('0x25')]();}})['then'](function(_0xaa521c){var _0x5ae49a=path['join'](config[_0x0e56('0x4c')],_0x0e56('0x78'),util[_0x0e56('0x51')]('%s.%s',_0xaa521c[_0x0e56('0x4e')],_0xaa521c[_0x0e56('0x79')]));var _0x4a26b4=path[_0x0e56('0x4b')](config['root'],_0x0e56('0x4d'),util['format'](_0x0e56('0x52'),_0xaa521c[_0x0e56('0x4e')],_0xaa521c[_0x0e56('0x53')]));fs[_0x0e56('0x7a')](_0x5ae49a);fs[_0x0e56('0x7a')](_0x4a26b4);return _0xaa521c;})['then'](function(_0x3a2c1d){if(_0x3a2c1d){return _0x39c8c2[_0x0e56('0x1b')](0xcc)[_0x0e56('0x29')]();}})[_0x0e56('0x24')](handleEntityNotFound(_0x39c8c2,null))[_0x0e56('0x45')](handleError(_0x39c8c2,null));}; \ No newline at end of file +var _0xb5d2=['rows','catch','keys','find','download','params','converted_format','existsSync','join','server/files/sounds/converted','Sound\x20not\x20found','%s.%s','save_name','format','create','file','originalname','basename','filename','extname','wav','root','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','send','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','delete','destroy','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','Sounds','UserProfileResource','stack','name','index','map','Sound','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1e2b40,_0x3012b6){var _0x23ba2b=function(_0xbc6a00){while(--_0xbc6a00){_0x1e2b40['push'](_0x1e2b40['shift']());}};_0x23ba2b(++_0x3012b6);}(_0xb5d2,0x1b2));var _0x2b5d=function(_0x43f3fe,_0x19bb95){_0x43f3fe=_0x43f3fe-0x0;var _0x41827a=_0xb5d2[_0x43f3fe];return _0x41827a;};'use strict';var emlformat=require(_0x2b5d('0x0'));var rimraf=require(_0x2b5d('0x1'));var zipdir=require(_0x2b5d('0x2'));var jsonpatch=require(_0x2b5d('0x3'));var rp=require(_0x2b5d('0x4'));var moment=require(_0x2b5d('0x5'));var BPromise=require(_0x2b5d('0x6'));var Mustache=require('mustache');var util=require(_0x2b5d('0x7'));var path=require(_0x2b5d('0x8'));var sox=require(_0x2b5d('0x9'));var csv=require(_0x2b5d('0xa'));var ejs=require(_0x2b5d('0xb'));var fs=require('fs');var fs_extra=require(_0x2b5d('0xc'));var _=require(_0x2b5d('0xd'));var squel=require(_0x2b5d('0xe'));var crypto=require(_0x2b5d('0xf'));var jsforce=require(_0x2b5d('0x10'));var deskjs=require(_0x2b5d('0x11'));var toCsv=require(_0x2b5d('0xa'));var querystring=require(_0x2b5d('0x12'));var Papa=require(_0x2b5d('0x13'));var Redis=require(_0x2b5d('0x14'));var authService=require(_0x2b5d('0x15'));var qs=require(_0x2b5d('0x16'));var as=require(_0x2b5d('0x17'));var hardwareService=require(_0x2b5d('0x18'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2b5d('0x19'));var licenseUtil=require(_0x2b5d('0x1a'));var db=require(_0x2b5d('0x1b'))['db'];function respondWithStatusCode(_0x3577ae,_0x46f44f){_0x46f44f=_0x46f44f||0xcc;return function(_0xbb47ef){if(_0xbb47ef){return _0x3577ae[_0x2b5d('0x1c')](_0x46f44f);}return _0x3577ae[_0x2b5d('0x1d')](_0x46f44f)[_0x2b5d('0x1e')]();};}function respondWithResult(_0x421ff2,_0x1ff99a){_0x1ff99a=_0x1ff99a||0xc8;return function(_0x385727){if(_0x385727){return _0x421ff2[_0x2b5d('0x1d')](_0x1ff99a)['json'](_0x385727);}};}function respondWithFilteredResult(_0x2203e1,_0x262029){return function(_0x474b46){if(_0x474b46){var _0x547721=typeof _0x262029[_0x2b5d('0x1f')]===_0x2b5d('0x20')&&typeof _0x262029[_0x2b5d('0x21')]===_0x2b5d('0x20');var _0x127c27=_0x474b46[_0x2b5d('0x22')];var _0x4bd3b4=_0x547721?0x0:_0x262029['offset'];var _0x441ac9=_0x547721?_0x474b46[_0x2b5d('0x22')]:_0x262029[_0x2b5d('0x1f')]+_0x262029[_0x2b5d('0x21')];var _0x45e4b0;if(_0x441ac9>=_0x127c27){_0x441ac9=_0x127c27;_0x45e4b0=0xc8;}else{_0x45e4b0=0xce;}_0x2203e1[_0x2b5d('0x1d')](_0x45e4b0);return _0x2203e1[_0x2b5d('0x23')](_0x2b5d('0x24'),_0x4bd3b4+'-'+_0x441ac9+'/'+_0x127c27)[_0x2b5d('0x25')](_0x474b46);}return null;};}function patchUpdates(_0x16a764){return function(_0x1a74e3){try{jsonpatch[_0x2b5d('0x26')](_0x1a74e3,_0x16a764,!![]);}catch(_0x4b5dd4){return BPromise[_0x2b5d('0x27')](_0x4b5dd4);}return _0x1a74e3['save']();};}function saveUpdates(_0x2aa337,_0x53d5de){return function(_0x5d3431){if(_0x5d3431){return _0x5d3431['update'](_0x2aa337)['then'](function(_0x44cc57){return _0x44cc57;});}return null;};}function removeEntity(_0xbc2bbc,_0x55e2ac){return function(_0x24c657){if(_0x24c657){return _0x24c657['destroy']()[_0x2b5d('0x28')](function(){var _0x547f92=_0x24c657['get']({'plain':!![]});var _0x485780=_0x2b5d('0x29');return db[_0x2b5d('0x2a')]['destroy']({'where':{'type':_0x485780,'resourceId':_0x547f92['id']}})[_0x2b5d('0x28')](function(){return _0x24c657;});})[_0x2b5d('0x28')](function(){_0xbc2bbc[_0x2b5d('0x1d')](0xcc)[_0x2b5d('0x1e')]();});}};}function handleEntityNotFound(_0x21205e,_0x36afb6){return function(_0x1d88dd){if(!_0x1d88dd){_0x21205e[_0x2b5d('0x1c')](0x194);}return _0x1d88dd;};}function handleError(_0x2ab430,_0xa4c853){_0xa4c853=_0xa4c853||0x1f4;return function(_0x150a03){logger['error'](_0x150a03[_0x2b5d('0x2b')]);if(_0x150a03['name']){delete _0x150a03[_0x2b5d('0x2c')];}_0x2ab430[_0x2b5d('0x1d')](_0xa4c853)['send'](_0x150a03);};}exports[_0x2b5d('0x2d')]=function(_0x40c00e,_0x26dd25){var _0x17f18b={},_0x521ffa={},_0x1b52a0={'count':0x0,'rows':[]};var _0x2f9542=_[_0x2b5d('0x2e')](db[_0x2b5d('0x2f')][_0x2b5d('0x30')],function(_0x572dfa){return{'name':_0x572dfa['fieldName'],'type':_0x572dfa[_0x2b5d('0x31')]['key']};});_0x521ffa[_0x2b5d('0x32')]=_['map'](_0x2f9542,_0x2b5d('0x2c'));_0x521ffa[_0x2b5d('0x33')]=_['keys'](_0x40c00e[_0x2b5d('0x33')]);_0x521ffa[_0x2b5d('0x34')]=_[_0x2b5d('0x35')](_0x521ffa[_0x2b5d('0x32')],_0x521ffa[_0x2b5d('0x33')]);_0x17f18b[_0x2b5d('0x36')]=_[_0x2b5d('0x35')](_0x521ffa[_0x2b5d('0x32')],qs[_0x2b5d('0x37')](_0x40c00e[_0x2b5d('0x33')][_0x2b5d('0x37')]));_0x17f18b['attributes']=_0x17f18b[_0x2b5d('0x36')][_0x2b5d('0x38')]?_0x17f18b['attributes']:_0x521ffa[_0x2b5d('0x32')];if(!_0x40c00e[_0x2b5d('0x33')][_0x2b5d('0x39')](_0x2b5d('0x3a'))){_0x17f18b[_0x2b5d('0x21')]=qs[_0x2b5d('0x21')](_0x40c00e[_0x2b5d('0x33')][_0x2b5d('0x21')]);_0x17f18b[_0x2b5d('0x1f')]=qs[_0x2b5d('0x1f')](_0x40c00e[_0x2b5d('0x33')][_0x2b5d('0x1f')]);}_0x17f18b[_0x2b5d('0x3b')]=qs[_0x2b5d('0x3c')](_0x40c00e[_0x2b5d('0x33')][_0x2b5d('0x3c')]);_0x17f18b[_0x2b5d('0x3d')]=qs[_0x2b5d('0x34')](_[_0x2b5d('0x3e')](_0x40c00e['query'],_0x521ffa[_0x2b5d('0x34')]),_0x2f9542);if(_0x40c00e['query'][_0x2b5d('0x3f')]){_0x17f18b[_0x2b5d('0x3d')]=_[_0x2b5d('0x40')](_0x17f18b[_0x2b5d('0x3d')],{'$or':_[_0x2b5d('0x2e')](_0x2f9542,function(_0x6d1411){if(_0x6d1411[_0x2b5d('0x31')]!==_0x2b5d('0x41')){var _0x200641={};_0x200641[_0x6d1411[_0x2b5d('0x2c')]]={'$like':'%'+_0x40c00e['query'][_0x2b5d('0x3f')]+'%'};return _0x200641;}})});}_0x17f18b=_['merge']({},_0x17f18b,_0x40c00e[_0x2b5d('0x42')]);var _0xca4043={'where':_0x17f18b[_0x2b5d('0x3d')]};return db[_0x2b5d('0x2f')]['count'](_0xca4043)[_0x2b5d('0x28')](function(_0x512a03){_0x1b52a0['count']=_0x512a03;if(_0x40c00e[_0x2b5d('0x33')][_0x2b5d('0x43')]){_0x17f18b[_0x2b5d('0x44')]=[{'all':!![]}];}return db[_0x2b5d('0x2f')][_0x2b5d('0x45')](_0x17f18b);})[_0x2b5d('0x28')](function(_0x295182){_0x1b52a0[_0x2b5d('0x46')]=_0x295182;return _0x1b52a0;})[_0x2b5d('0x28')](respondWithFilteredResult(_0x26dd25,_0x17f18b))[_0x2b5d('0x47')](handleError(_0x26dd25,null));};exports['show']=function(_0x219dbc,_0xd899dc){var _0x20a4db={'raw':!![],'where':{'id':_0x219dbc['params']['id']}},_0x4801dc={};_0x4801dc['model']=_[_0x2b5d('0x48')](db['Sound'][_0x2b5d('0x30')]);_0x4801dc['query']=_[_0x2b5d('0x48')](_0x219dbc[_0x2b5d('0x33')]);_0x4801dc['filters']=_[_0x2b5d('0x35')](_0x4801dc[_0x2b5d('0x32')],_0x4801dc[_0x2b5d('0x33')]);_0x20a4db[_0x2b5d('0x36')]=_[_0x2b5d('0x35')](_0x4801dc[_0x2b5d('0x32')],qs[_0x2b5d('0x37')](_0x219dbc['query']['fields']));_0x20a4db[_0x2b5d('0x36')]=_0x20a4db['attributes']['length']?_0x20a4db['attributes']:_0x4801dc[_0x2b5d('0x32')];if(_0x219dbc[_0x2b5d('0x33')][_0x2b5d('0x43')]){_0x20a4db[_0x2b5d('0x44')]=[{'all':!![]}];}_0x20a4db=_[_0x2b5d('0x40')]({},_0x20a4db,_0x219dbc['options']);return db[_0x2b5d('0x2f')][_0x2b5d('0x49')](_0x20a4db)[_0x2b5d('0x28')](handleEntityNotFound(_0xd899dc,null))[_0x2b5d('0x28')](respondWithResult(_0xd899dc,null))['catch'](handleError(_0xd899dc,null));};exports[_0x2b5d('0x4a')]=function(_0xa08650,_0x3d6804,_0xa92109){return db[_0x2b5d('0x2f')][_0x2b5d('0x49')]({'where':{'id':_0xa08650[_0x2b5d('0x4b')]['id']},'attributes':[_0x2b5d('0x2c'),'save_name',_0x2b5d('0x4c')],'raw':!![]})[_0x2b5d('0x28')](handleEntityNotFound(_0x3d6804,null))[_0x2b5d('0x28')](function(_0xd14d2a){if(_0xd14d2a){if(!fs[_0x2b5d('0x4d')](path[_0x2b5d('0x4e')](config['root'],_0x2b5d('0x4f'),_0xd14d2a['save_name']+'.'+_0xd14d2a[_0x2b5d('0x4c')]))){throw new db['Sequelize']['ValidationError'](_0x2b5d('0x50'));}return _0x3d6804['download'](path[_0x2b5d('0x4e')](config['root'],_0x2b5d('0x4f'),util['format'](_0x2b5d('0x51'),_0xd14d2a[_0x2b5d('0x52')],_0xd14d2a['converted_format'])),util[_0x2b5d('0x53')](_0x2b5d('0x51'),_0xd14d2a[_0x2b5d('0x2c')],_0xd14d2a[_0x2b5d('0x4c')]));}return null;})[_0x2b5d('0x47')](handleError(_0x3d6804,null));};exports[_0x2b5d('0x54')]=function(_0x3ea8a5,_0x43d759,_0x44b7eb){var _0x719964={'name':path['basename'](_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x56')],path['extname'](_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x56')])),'save_name':path[_0x2b5d('0x57')](_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x58')],path[_0x2b5d('0x59')](_0x3ea8a5[_0x2b5d('0x55')]['filename'])),'original_format':path[_0x2b5d('0x59')](_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x56')])['substring'](0x1),'converted_format':_0x2b5d('0x5a')};var _0x158292=path[_0x2b5d('0x4e')](config[_0x2b5d('0x5b')],'server/files/sounds/original',_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x58')]);var _0x5dbd25=path[_0x2b5d('0x4e')](config['root'],_0x2b5d('0x4f'),util[_0x2b5d('0x53')](_0x2b5d('0x51'),path['basename'](_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x58')],path[_0x2b5d('0x59')](_0x3ea8a5[_0x2b5d('0x55')][_0x2b5d('0x58')])),_0x719964['converted_format']));logger[_0x2b5d('0x5c')]('Sound\x20upload\x20filepath:\x20%s',_0x158292);logger[_0x2b5d('0x5c')](_0x2b5d('0x5d'),_0x5dbd25);try{fs[_0x2b5d('0x5e')](_0x158292,parseInt('0777',0x8));var _0x516433=sox[_0x2b5d('0x5f')](_0x158292,_0x5dbd25,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x516433['on']('error',function(_0xfdb2e1){fs['unlinkSync'](_0x158292);_0x43d759['status'](0x1f4)[_0x2b5d('0x60')](_0xfdb2e1);});_0x516433['on']('src',function(_0x544ca5){_0x719964['original_duration']=isNaN(_0x544ca5[_0x2b5d('0x61')])?null:_0x544ca5[_0x2b5d('0x61')]*0x3e8;_0x719964[_0x2b5d('0x62')]=isNaN(_0x544ca5[_0x2b5d('0x63')])?null:_0x544ca5[_0x2b5d('0x63')];_0x719964[_0x2b5d('0x64')]=isNaN(_0x544ca5['channelCount'])?null:_0x544ca5[_0x2b5d('0x65')];_0x719964[_0x2b5d('0x66')]=isNaN(_0x544ca5[_0x2b5d('0x67')])?null:_0x544ca5[_0x2b5d('0x67')];_0x719964['original_sampleRate']=isNaN(_0x544ca5[_0x2b5d('0x68')])?null:_0x544ca5[_0x2b5d('0x68')];});_0x516433['on'](_0x2b5d('0x69'),function(_0x494ec1){_0x719964[_0x2b5d('0x6a')]=isNaN(_0x494ec1[_0x2b5d('0x61')])?null:_0x494ec1[_0x2b5d('0x61')]*0x3e8;_0x719964[_0x2b5d('0x6b')]=isNaN(_0x494ec1['sampleCount'])?null:_0x494ec1['sampleCount'];_0x719964[_0x2b5d('0x6c')]=isNaN(_0x494ec1['channelCount'])?null:_0x494ec1['channelCount'];_0x719964[_0x2b5d('0x6d')]=isNaN(_0x494ec1['bitRate'])?null:_0x494ec1['bitRate'];_0x719964[_0x2b5d('0x6e')]=isNaN(_0x494ec1[_0x2b5d('0x68')])?null:_0x494ec1[_0x2b5d('0x68')];});_0x516433['on']('end',function(){fs['chmodSync'](_0x5dbd25,parseInt(_0x2b5d('0x6f'),0x8));return db[_0x2b5d('0x2f')][_0x2b5d('0x54')](_0x719964)[_0x2b5d('0x28')](function(_0x1a2f8b){var _0x4ef6e1={'role':_0x3ea8a5[_0x2b5d('0x70')][_0x2b5d('0x71')],'userProfileId':_0x3ea8a5[_0x2b5d('0x70')][_0x2b5d('0x72')]};if(!_0x4ef6e1)throw new Error(_0x2b5d('0x73'));if(_0x4ef6e1[_0x2b5d('0x71')]==='user'){var _0x3c035b=_0x1a2f8b[_0x2b5d('0x74')]({'plain':!![]});return db[_0x2b5d('0x75')][_0x2b5d('0x49')]({'where':{'name':_0x2b5d('0x29'),'userProfileId':_0x4ef6e1[_0x2b5d('0x72')]},'raw':!![]})['then'](function(_0x3839e2){if(_0x3839e2&&_0x3839e2[_0x2b5d('0x76')]===0x0){return db[_0x2b5d('0x2a')][_0x2b5d('0x54')]({'name':_0x3c035b[_0x2b5d('0x2c')],'resourceId':_0x3c035b['id'],'type':_0x3839e2['name'],'sectionId':_0x3839e2['id']},{})[_0x2b5d('0x28')](function(){return _0x1a2f8b;});}else{return _0x1a2f8b;}})[_0x2b5d('0x47')](function(_0x2b6fd7){logger['error'](_0x2b5d('0x77'),_0x2b6fd7);throw _0x2b6fd7;});}return _0x1a2f8b;})['then'](respondWithResult(_0x43d759,null))[_0x2b5d('0x47')](handleError(_0x43d759,null));});_0x516433['start']();}catch(_0x4438c0){_0x43d759['status'](0x1f4)[_0x2b5d('0x60')](_0x4438c0);}};exports[_0x2b5d('0x78')]=function(_0xfa7577,_0x80017e,_0x57c0c4){return db['Sound']['find']({'where':{'id':_0xfa7577[_0x2b5d('0x4b')]['id']}})[_0x2b5d('0x28')](handleEntityNotFound(_0x80017e,null))['then'](saveUpdates(_[_0x2b5d('0x3e')](_0xfa7577[_0x2b5d('0x70')],['name','description']),null))[_0x2b5d('0x28')](respondWithResult(_0x80017e,null))[_0x2b5d('0x47')](handleError(_0x80017e,null));};exports[_0x2b5d('0x79')]=function(_0x5a30d5,_0x2eaa37,_0x315fa6){return db['Sound'][_0x2b5d('0x49')]({'where':{'id':_0x5a30d5[_0x2b5d('0x4b')]['id']}})[_0x2b5d('0x28')](function(_0x2af7e1){if(_0x2af7e1){return _0x2af7e1[_0x2b5d('0x7a')]();}})[_0x2b5d('0x28')](function(_0x49ca00){var _0x270afc=path['join'](config[_0x2b5d('0x5b')],_0x2b5d('0x7b'),util[_0x2b5d('0x53')](_0x2b5d('0x51'),_0x49ca00[_0x2b5d('0x52')],_0x49ca00[_0x2b5d('0x7c')]));var _0x576dd6=path[_0x2b5d('0x4e')](config[_0x2b5d('0x5b')],_0x2b5d('0x4f'),util[_0x2b5d('0x53')](_0x2b5d('0x51'),_0x49ca00[_0x2b5d('0x52')],_0x49ca00[_0x2b5d('0x4c')]));fs[_0x2b5d('0x7d')](_0x270afc);fs['unlinkSync'](_0x576dd6);return _0x49ca00;})[_0x2b5d('0x28')](function(_0x4cdde1){if(_0x4cdde1){return _0x2eaa37[_0x2b5d('0x1d')](0xcc)[_0x2b5d('0x1e')]();}})[_0x2b5d('0x28')](handleEntityNotFound(_0x2eaa37,null))[_0x2b5d('0x47')](handleError(_0x2eaa37,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 78f4be6..4090ff9 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 _0xb766=['../../config/environment','./sound.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1efbb6,_0x33d9c0){var _0x4fb725=function(_0x65f4bf){while(--_0x65f4bf){_0x1efbb6['push'](_0x1efbb6['shift']());}};_0x4fb725(++_0x33d9c0);}(_0xb766,0x71));var _0x6b76=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0xb766[_0x4bfe08];return _0x1f9125;};'use strict';var _=require(_0x6b76('0x0'));var util=require('util');var logger=require(_0x6b76('0x1'))(_0x6b76('0x2'));var moment=require(_0x6b76('0x3'));var BPromise=require(_0x6b76('0x4'));var rp=require(_0x6b76('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b76('0x6'));var config=require(_0x6b76('0x7'));var attributes=require(_0x6b76('0x8'));module[_0x6b76('0x9')]=function(_0xf5f18f,_0x1eb70a){return _0xf5f18f['define']('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9851=['lodash','util','api','bluebird','request-promise','rimraf','./sound.attributes','exports','Sound','tools_sounds'];(function(_0x26e634,_0x542240){var _0x54e48f=function(_0x2fc2cc){while(--_0x2fc2cc){_0x26e634['push'](_0x26e634['shift']());}};_0x54e48f(++_0x542240);}(_0x9851,0x10e));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1985('0x0'));var util=require(_0x1985('0x1'));var logger=require('../../config/logger')(_0x1985('0x2'));var moment=require('moment');var BPromise=require(_0x1985('0x3'));var rp=require(_0x1985('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1985('0x5'));var config=require('../../config/environment');var attributes=require(_0x1985('0x6'));module[_0x1985('0x7')]=function(_0x1f35ce,_0x4ce47b){return _0x1f35ce['define'](_0x1985('0x8'),attributes,{'tableName':_0x1985('0x9'),'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 cde3a79..54de9bc 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 _0xa362=['stringify','error','code','message','result','catch','find','options','raw','where','attributes','include','map','model','ShowSound','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x21e80c,_0x304d8f){var _0x4d4ebc=function(_0x1df650){while(--_0x1df650){_0x21e80c['push'](_0x21e80c['shift']());}};_0x4d4ebc(++_0x304d8f);}(_0xa362,0x87));var _0x2a36=function(_0x44ada0,_0x51e747){_0x44ada0=_0x44ada0-0x0;var _0x1de325=_0xa362[_0x44ada0];return _0x1de325;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2a36('0x0'));var rs=require(_0x2a36('0x1'));var fs=require('fs');var Redis=require(_0x2a36('0x2'));var db=require(_0x2a36('0x3'))['db'];var utils=require(_0x2a36('0x4'));var logger=require(_0x2a36('0x5'))(_0x2a36('0x6'));var config=require(_0x2a36('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2a36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48d21f,_0x2c5a9c,_0x2e813b){return new BPromise(function(_0x44b791,_0x3eff53){return client['request'](_0x48d21f,_0x2e813b)[_0x2a36('0x9')](function(_0x38329d){logger[_0x2a36('0xa')](_0x2a36('0xb'),_0x2c5a9c,'request\x20sent');logger[_0x2a36('0xc')](_0x2a36('0xd'),_0x2c5a9c,_0x2a36('0xe'),JSON[_0x2a36('0xf')](_0x38329d));if(_0x38329d[_0x2a36('0x10')]){if(_0x38329d['error'][_0x2a36('0x11')]===0x1f4){logger[_0x2a36('0x10')](_0x2a36('0xb'),_0x2c5a9c,_0x38329d[_0x2a36('0x10')][_0x2a36('0x12')]);return _0x3eff53(_0x38329d[_0x2a36('0x10')][_0x2a36('0x12')]);}logger[_0x2a36('0x10')](_0x2a36('0xb'),_0x2c5a9c,_0x38329d['error']['message']);return _0x44b791(_0x38329d['error']['message']);}else{logger[_0x2a36('0xa')](_0x2a36('0xb'),_0x2c5a9c,_0x2a36('0xe'));_0x44b791(_0x38329d[_0x2a36('0x13')]['message']);}})[_0x2a36('0x14')](function(_0x2ec1f7){logger[_0x2a36('0x10')](_0x2a36('0xb'),_0x2c5a9c,_0x2ec1f7);_0x3eff53(_0x2ec1f7);});});}exports['ShowSound']=function(_0x122ec9){var _0x8c9e1=this;return new Promise(function(_0x45af59,_0x4ef562){return db['Sound'][_0x2a36('0x15')]({'raw':_0x122ec9[_0x2a36('0x16')]?_0x122ec9[_0x2a36('0x16')][_0x2a36('0x17')]===undefined?!![]:![]:!![],'where':_0x122ec9[_0x2a36('0x16')]?_0x122ec9[_0x2a36('0x16')][_0x2a36('0x18')]||null:null,'attributes':_0x122ec9[_0x2a36('0x16')]?_0x122ec9['options'][_0x2a36('0x19')]||null:null,'include':_0x122ec9[_0x2a36('0x16')]?_0x122ec9['options'][_0x2a36('0x1a')]?_['map'](_0x122ec9[_0x2a36('0x16')][_0x2a36('0x1a')],function(_0x8e6f86){return{'model':db[_0x8e6f86['model']],'as':_0x8e6f86['as'],'attributes':_0x8e6f86['attributes'],'include':_0x8e6f86[_0x2a36('0x1a')]?_['map'](_0x8e6f86[_0x2a36('0x1a')],function(_0x5eafbe){return{'model':db[_0x5eafbe['model']],'as':_0x5eafbe['as'],'attributes':_0x5eafbe[_0x2a36('0x19')],'include':_0x5eafbe[_0x2a36('0x1a')]?_[_0x2a36('0x1b')](_0x5eafbe[_0x2a36('0x1a')],function(_0x574962){return{'model':db[_0x574962[_0x2a36('0x1c')]],'as':_0x574962['as'],'attributes':_0x574962[_0x2a36('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2a36('0x9')](function(_0x4c8f73){logger[_0x2a36('0xa')](_0x2a36('0x1d'),_0x122ec9);logger[_0x2a36('0xc')](_0x2a36('0x1d'),_0x122ec9,JSON['stringify'](_0x4c8f73));_0x45af59(_0x4c8f73);})['catch'](function(_0x4f4573){logger[_0x2a36('0x10')](_0x2a36('0x1d'),_0x4f4573['message'],_0x122ec9);_0x4ef562(_0x8c9e1[_0x2a36('0x10')](0x1f4,_0x4f4573['message']));});});}; \ No newline at end of file +var _0xc6f8=['client','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','catch','Sound','find','options','raw','attributes','include','map','model','ShowSound','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x52d065,_0x31d24){var _0x49f7bc=function(_0x2f0966){while(--_0x2f0966){_0x52d065['push'](_0x52d065['shift']());}};_0x49f7bc(++_0x31d24);}(_0xc6f8,0x181));var _0x8c6f=function(_0x1417e3,_0x25ff15){_0x1417e3=_0x1417e3-0x0;var _0xf3b83f=_0xc6f8[_0x1417e3];return _0xf3b83f;};'use strict';var _=require(_0x8c6f('0x0'));var util=require(_0x8c6f('0x1'));var moment=require('moment');var BPromise=require(_0x8c6f('0x2'));var rs=require(_0x8c6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8c6f('0x4'))('rpc');var config=require(_0x8c6f('0x5'));var jayson=require(_0x8c6f('0x6'));var client=jayson[_0x8c6f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x303507,_0xb01b3b,_0x213109){return new BPromise(function(_0x49fae6,_0x2c6ec3){return client['request'](_0x303507,_0x213109)[_0x8c6f('0x8')](function(_0x345380){logger[_0x8c6f('0x9')]('Sound,\x20%s,\x20%s',_0xb01b3b,_0x8c6f('0xa'));logger[_0x8c6f('0xb')](_0x8c6f('0xc'),_0xb01b3b,'request\x20sent',JSON[_0x8c6f('0xd')](_0x345380));if(_0x345380[_0x8c6f('0xe')]){if(_0x345380[_0x8c6f('0xe')][_0x8c6f('0xf')]===0x1f4){logger[_0x8c6f('0xe')](_0x8c6f('0x10'),_0xb01b3b,_0x345380[_0x8c6f('0xe')][_0x8c6f('0x11')]);return _0x2c6ec3(_0x345380[_0x8c6f('0xe')][_0x8c6f('0x11')]);}logger['error'](_0x8c6f('0x10'),_0xb01b3b,_0x345380[_0x8c6f('0xe')]['message']);return _0x49fae6(_0x345380[_0x8c6f('0xe')]['message']);}else{logger[_0x8c6f('0x9')]('Sound,\x20%s,\x20%s',_0xb01b3b,_0x8c6f('0xa'));_0x49fae6(_0x345380['result'][_0x8c6f('0x11')]);}})[_0x8c6f('0x12')](function(_0x5889fc){logger[_0x8c6f('0xe')]('Sound,\x20%s,\x20%s',_0xb01b3b,_0x5889fc);_0x2c6ec3(_0x5889fc);});});}exports['ShowSound']=function(_0x3ff58b){var _0x26f5e9=this;return new Promise(function(_0x239af8,_0x131bc7){return db[_0x8c6f('0x13')][_0x8c6f('0x14')]({'raw':_0x3ff58b[_0x8c6f('0x15')]?_0x3ff58b[_0x8c6f('0x15')][_0x8c6f('0x16')]===undefined?!![]:![]:!![],'where':_0x3ff58b[_0x8c6f('0x15')]?_0x3ff58b[_0x8c6f('0x15')]['where']||null:null,'attributes':_0x3ff58b[_0x8c6f('0x15')]?_0x3ff58b[_0x8c6f('0x15')][_0x8c6f('0x17')]||null:null,'include':_0x3ff58b[_0x8c6f('0x15')]?_0x3ff58b[_0x8c6f('0x15')][_0x8c6f('0x18')]?_[_0x8c6f('0x19')](_0x3ff58b[_0x8c6f('0x15')][_0x8c6f('0x18')],function(_0x582958){return{'model':db[_0x582958[_0x8c6f('0x1a')]],'as':_0x582958['as'],'attributes':_0x582958[_0x8c6f('0x17')],'include':_0x582958[_0x8c6f('0x18')]?_[_0x8c6f('0x19')](_0x582958['include'],function(_0x2ca8ad){return{'model':db[_0x2ca8ad[_0x8c6f('0x1a')]],'as':_0x2ca8ad['as'],'attributes':_0x2ca8ad[_0x8c6f('0x17')],'include':_0x2ca8ad[_0x8c6f('0x18')]?_[_0x8c6f('0x19')](_0x2ca8ad[_0x8c6f('0x18')],function(_0x3dc3cc){return{'model':db[_0x3dc3cc[_0x8c6f('0x1a')]],'as':_0x3dc3cc['as'],'attributes':_0x3dc3cc[_0x8c6f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6f('0x8')](function(_0x33bd3f){logger[_0x8c6f('0x9')]('ShowSound',_0x3ff58b);logger[_0x8c6f('0xb')](_0x8c6f('0x1b'),_0x3ff58b,JSON[_0x8c6f('0xd')](_0x33bd3f));_0x239af8(_0x33bd3f);})[_0x8c6f('0x12')](function(_0x48cd00){logger[_0x8c6f('0xe')](_0x8c6f('0x1b'),_0x48cd00['message'],_0x3ff58b);_0x131bc7(_0x26f5e9[_0x8c6f('0xe')](0x1f4,_0x48cd00[_0x8c6f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a245fe4..fb05951 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x79480f,_0x57671f){var _0x18f22c=function(_0x5f62bd){while(--_0x5f62bd){_0x79480f['push'](_0x79480f['shift']());}};_0x18f22c(++_0x57671f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xb7e7[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x864853,_0x1b7287){var _0x2d1509=function(_0x3c8ed2){while(--_0x3c8ed2){_0x864853['push'](_0x864853['shift']());}};_0x2d1509(++_0x1b7287);}(_0x2032,0xd9));var _0x2203=function(_0x4e5f0b,_0x42de0f){_0x4e5f0b=_0x4e5f0b-0x0;var _0x424d13=_0x2032[_0x4e5f0b];return _0x424d13;};'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 diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1468dac..27a7fdc 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 _0xf912=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf912,0x169));var _0x2f91=function(_0x11590b,_0x4eeded){_0x11590b=_0x11590b-0x0;var _0x532b42=_0xf912[_0x11590b];return _0x532b42;};'use strict';var Sequelize=require(_0x2f91('0x0'));module[_0x2f91('0x1')]={'uniqueid':{'type':Sequelize[_0x2f91('0x2')]},'body':{'type':Sequelize[_0x2f91('0x3')](_0x2f91('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x2f91('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2f91('0x2')]},'providerResponse':{'type':Sequelize[_0x2f91('0x3')]}}; \ No newline at end of file +var _0x92a1=['out','sequelize','exports','STRING','TEXT','ENUM'];(function(_0x43885b,_0x451a68){var _0x7e3cc6=function(_0x466f71){while(--_0x466f71){_0x43885b['push'](_0x43885b['shift']());}};_0x7e3cc6(++_0x451a68);}(_0x92a1,0x193));var _0x192a=function(_0x33bad8,_0xa77a59){_0x33bad8=_0x33bad8-0x0;var _0xed1658=_0x92a1[_0x33bad8];return _0xed1658;};'use strict';var Sequelize=require(_0x192a('0x0'));module[_0x192a('0x1')]={'uniqueid':{'type':Sequelize[_0x192a('0x2')]},'body':{'type':Sequelize[_0x192a('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x192a('0x4')]('in',_0x192a('0x5')),'defaultValue':_0x192a('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x192a('0x2')]},'providerResponse':{'type':Sequelize[_0x192a('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 62b1d90..5471bee 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 _0x794b=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareMessage','rows','show','params','rawAttributes','includeAll','catch','create','body','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x794b,0x1c2));var _0xb794=function(_0x43e413,_0x5a6b40){_0x43e413=_0x43e413-0x0;var _0x313971=_0x794b[_0x43e413];return _0x313971;};'use strict';var emlformat=require(_0xb794('0x0'));var rimraf=require(_0xb794('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb794('0x2'));var rp=require(_0xb794('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb794('0x4'));var util=require(_0xb794('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb794('0x6'));var ejs=require(_0xb794('0x7'));var fs=require('fs');var fs_extra=require(_0xb794('0x8'));var _=require(_0xb794('0x9'));var squel=require(_0xb794('0xa'));var crypto=require(_0xb794('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb794('0xc'));var toCsv=require(_0xb794('0x6'));var querystring=require(_0xb794('0xd'));var Papa=require(_0xb794('0xe'));var Redis=require(_0xb794('0xf'));var authService=require(_0xb794('0x10'));var qs=require(_0xb794('0x11'));var as=require(_0xb794('0x12'));var hardwareService=require(_0xb794('0x13'));var logger=require(_0xb794('0x14'))(_0xb794('0x15'));var utils=require(_0xb794('0x16'));var config=require(_0xb794('0x17'));var licenseUtil=require(_0xb794('0x18'));var db=require(_0xb794('0x19'))['db'];function respondWithStatusCode(_0xe8442a,_0x3900f0){_0x3900f0=_0x3900f0||0xcc;return function(_0x3be436){if(_0x3be436){return _0xe8442a[_0xb794('0x1a')](_0x3900f0);}return _0xe8442a[_0xb794('0x1b')](_0x3900f0)[_0xb794('0x1c')]();};}function respondWithResult(_0x57c750,_0x44e714){_0x44e714=_0x44e714||0xc8;return function(_0x14927e){if(_0x14927e){return _0x57c750[_0xb794('0x1b')](_0x44e714)[_0xb794('0x1d')](_0x14927e);}};}function respondWithFilteredResult(_0xac1f87,_0x469618){return function(_0x558bc1){if(_0x558bc1){var _0x43bf13=typeof _0x469618[_0xb794('0x1e')]==='undefined'&&typeof _0x469618[_0xb794('0x1f')]===_0xb794('0x20');var _0x53788b=_0x558bc1[_0xb794('0x21')];var _0xdf55d7=_0x43bf13?0x0:_0x469618[_0xb794('0x1e')];var _0x518d3d=_0x43bf13?_0x558bc1[_0xb794('0x21')]:_0x469618[_0xb794('0x1e')]+_0x469618['limit'];var _0x10d905;if(_0x518d3d>=_0x53788b){_0x518d3d=_0x53788b;_0x10d905=0xc8;}else{_0x10d905=0xce;}_0xac1f87[_0xb794('0x1b')](_0x10d905);return _0xac1f87[_0xb794('0x22')](_0xb794('0x23'),_0xdf55d7+'-'+_0x518d3d+'/'+_0x53788b)[_0xb794('0x1d')](_0x558bc1);}return null;};}function patchUpdates(_0x4fbb1c){return function(_0x24811c){try{jsonpatch[_0xb794('0x24')](_0x24811c,_0x4fbb1c,!![]);}catch(_0x4c2156){return BPromise[_0xb794('0x25')](_0x4c2156);}return _0x24811c[_0xb794('0x26')]();};}function saveUpdates(_0x29d308,_0x1b93dd){return function(_0x31bd91){if(_0x31bd91){return _0x31bd91[_0xb794('0x27')](_0x29d308)[_0xb794('0x28')](function(_0x45ddac){return _0x45ddac;});}return null;};}function removeEntity(_0x425a47,_0x43e077){return function(_0x4236fe){if(_0x4236fe){return _0x4236fe[_0xb794('0x29')]()[_0xb794('0x28')](function(){_0x425a47['status'](0xcc)[_0xb794('0x1c')]();});}};}function handleEntityNotFound(_0x3f6b71,_0xeebf12){return function(_0x47e38c){if(!_0x47e38c){_0x3f6b71['sendStatus'](0x194);}return _0x47e38c;};}function handleError(_0x1675ea,_0x536444){_0x536444=_0x536444||0x1f4;return function(_0xdb29d7){logger[_0xb794('0x2a')](_0xdb29d7['stack']);if(_0xdb29d7['name']){delete _0xdb29d7[_0xb794('0x2b')];}_0x1675ea[_0xb794('0x1b')](_0x536444)[_0xb794('0x2c')](_0xdb29d7);};}exports['index']=function(_0x59236a,_0x35fbd0){var _0x2db412={},_0x45d4d0={},_0x2ed6bc={'count':0x0,'rows':[]};var _0x3ec2f0=_[_0xb794('0x2d')](db['SquareMessage']['rawAttributes'],function(_0x54d796){return{'name':_0x54d796[_0xb794('0x2e')],'type':_0x54d796[_0xb794('0x2f')][_0xb794('0x30')]};});_0x45d4d0['model']=_[_0xb794('0x2d')](_0x3ec2f0,'name');_0x45d4d0[_0xb794('0x31')]=_[_0xb794('0x32')](_0x59236a['query']);_0x45d4d0[_0xb794('0x33')]=_['intersection'](_0x45d4d0[_0xb794('0x34')],_0x45d4d0[_0xb794('0x31')]);_0x2db412['attributes']=_[_0xb794('0x35')](_0x45d4d0[_0xb794('0x34')],qs[_0xb794('0x36')](_0x59236a[_0xb794('0x31')][_0xb794('0x36')]));_0x2db412[_0xb794('0x37')]=_0x2db412[_0xb794('0x37')]['length']?_0x2db412[_0xb794('0x37')]:_0x45d4d0['model'];if(!_0x59236a[_0xb794('0x31')]['hasOwnProperty'](_0xb794('0x38'))){_0x2db412[_0xb794('0x1f')]=qs[_0xb794('0x1f')](_0x59236a['query']['limit']);_0x2db412[_0xb794('0x1e')]=qs[_0xb794('0x1e')](_0x59236a[_0xb794('0x31')]['offset']);}_0x2db412[_0xb794('0x39')]=qs[_0xb794('0x3a')](_0x59236a[_0xb794('0x31')][_0xb794('0x3a')]);_0x2db412[_0xb794('0x3b')]=qs['filters'](_[_0xb794('0x3c')](_0x59236a[_0xb794('0x31')],_0x45d4d0[_0xb794('0x33')]),_0x3ec2f0);if(_0x59236a[_0xb794('0x31')]['filter']){_0x2db412[_0xb794('0x3b')]=_[_0xb794('0x3d')](_0x2db412[_0xb794('0x3b')],{'$or':_['map'](_0x3ec2f0,function(_0x583f4f){if(_0x583f4f[_0xb794('0x2f')]!==_0xb794('0x3e')){var _0x4928b9={};_0x4928b9[_0x583f4f[_0xb794('0x2b')]]={'$like':'%'+_0x59236a[_0xb794('0x31')][_0xb794('0x3f')]+'%'};return _0x4928b9;}})});}_0x2db412=_['merge']({},_0x2db412,_0x59236a[_0xb794('0x40')]);var _0xb9ad03={'where':_0x2db412[_0xb794('0x3b')]};return db[_0xb794('0x41')][_0xb794('0x21')](_0xb9ad03)[_0xb794('0x28')](function(_0x3f856a){_0x2ed6bc[_0xb794('0x21')]=_0x3f856a;if(_0x59236a[_0xb794('0x31')]['includeAll']){_0x2db412['include']=[{'all':!![]}];}return db[_0xb794('0x41')]['findAll'](_0x2db412);})[_0xb794('0x28')](function(_0x2265b7){_0x2ed6bc[_0xb794('0x42')]=_0x2265b7;return _0x2ed6bc;})[_0xb794('0x28')](respondWithFilteredResult(_0x35fbd0,_0x2db412))['catch'](handleError(_0x35fbd0,null));};exports[_0xb794('0x43')]=function(_0x5f2a0a,_0x12c344){var _0x8240e1={'raw':!![],'where':{'id':_0x5f2a0a[_0xb794('0x44')]['id']}},_0x27794d={};_0x27794d[_0xb794('0x34')]=_['keys'](db[_0xb794('0x41')][_0xb794('0x45')]);_0x27794d[_0xb794('0x31')]=_[_0xb794('0x32')](_0x5f2a0a[_0xb794('0x31')]);_0x27794d[_0xb794('0x33')]=_[_0xb794('0x35')](_0x27794d[_0xb794('0x34')],_0x27794d[_0xb794('0x31')]);_0x8240e1[_0xb794('0x37')]=_[_0xb794('0x35')](_0x27794d[_0xb794('0x34')],qs['fields'](_0x5f2a0a['query']['fields']));_0x8240e1['attributes']=_0x8240e1[_0xb794('0x37')]['length']?_0x8240e1[_0xb794('0x37')]:_0x27794d[_0xb794('0x34')];if(_0x5f2a0a[_0xb794('0x31')][_0xb794('0x46')]){_0x8240e1['include']=[{'all':!![]}];}_0x8240e1=_['merge']({},_0x8240e1,_0x5f2a0a[_0xb794('0x40')]);return db['SquareMessage']['find'](_0x8240e1)['then'](handleEntityNotFound(_0x12c344,null))['then'](respondWithResult(_0x12c344,null))[_0xb794('0x47')](handleError(_0x12c344,null));};exports[_0xb794('0x48')]=function(_0x620576,_0x6c8365){return db[_0xb794('0x41')][_0xb794('0x48')](_0x620576[_0xb794('0x49')],{})[_0xb794('0x28')](respondWithResult(_0x6c8365,0xc9))['catch'](handleError(_0x6c8365,null));};exports['update']=function(_0x3dc181,_0x4bff19){if(_0x3dc181[_0xb794('0x49')]['id']){delete _0x3dc181[_0xb794('0x49')]['id'];}return db[_0xb794('0x41')][_0xb794('0x4a')]({'where':{'id':_0x3dc181['params']['id']}})[_0xb794('0x28')](handleEntityNotFound(_0x4bff19,null))['then'](saveUpdates(_0x3dc181['body'],null))[_0xb794('0x28')](respondWithResult(_0x4bff19,null))['catch'](handleError(_0x4bff19,null));};exports['destroy']=function(_0x1c5609,_0x36ba32){return db[_0xb794('0x41')]['find']({'where':{'id':_0x1c5609['params']['id']}})['then'](handleEntityNotFound(_0x36ba32,null))[_0xb794('0x28')](removeEntity(_0x36ba32,null))['catch'](handleError(_0x36ba32,null));}; \ No newline at end of file +var _0xb725=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb725,0x86));var _0x5b72=function(_0x47a832,_0x40699e){_0x47a832=_0x47a832-0x0;var _0x17069f=_0xb725[_0x47a832];return _0x17069f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b72('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b72('0x1'));var rp=require(_0x5b72('0x2'));var moment=require(_0x5b72('0x3'));var BPromise=require(_0x5b72('0x4'));var Mustache=require(_0x5b72('0x5'));var util=require(_0x5b72('0x6'));var path=require(_0x5b72('0x7'));var sox=require(_0x5b72('0x8'));var csv=require(_0x5b72('0x9'));var ejs=require(_0x5b72('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b72('0xb'));var squel=require(_0x5b72('0xc'));var crypto=require(_0x5b72('0xd'));var jsforce=require(_0x5b72('0xe'));var deskjs=require(_0x5b72('0xf'));var toCsv=require(_0x5b72('0x9'));var querystring=require(_0x5b72('0x10'));var Papa=require('papaparse');var Redis=require(_0x5b72('0x11'));var authService=require(_0x5b72('0x12'));var qs=require(_0x5b72('0x13'));var as=require(_0x5b72('0x14'));var hardwareService=require(_0x5b72('0x15'));var logger=require(_0x5b72('0x16'))(_0x5b72('0x17'));var utils=require(_0x5b72('0x18'));var config=require(_0x5b72('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4099eb,_0x4c3a74){_0x4c3a74=_0x4c3a74||0xcc;return function(_0xab125c){if(_0xab125c){return _0x4099eb[_0x5b72('0x1a')](_0x4c3a74);}return _0x4099eb[_0x5b72('0x1b')](_0x4c3a74)[_0x5b72('0x1c')]();};}function respondWithResult(_0x2933b8,_0x17af73){_0x17af73=_0x17af73||0xc8;return function(_0x5f5614){if(_0x5f5614){return _0x2933b8[_0x5b72('0x1b')](_0x17af73)[_0x5b72('0x1d')](_0x5f5614);}};}function respondWithFilteredResult(_0x2d2bb1,_0x88362b){return function(_0x353fb8){if(_0x353fb8){var _0x1422a8=typeof _0x88362b[_0x5b72('0x1e')]===_0x5b72('0x1f')&&typeof _0x88362b[_0x5b72('0x20')]===_0x5b72('0x1f');var _0x49f5f1=_0x353fb8['count'];var _0x56c23f=_0x1422a8?0x0:_0x88362b[_0x5b72('0x1e')];var _0x4b3455=_0x1422a8?_0x353fb8[_0x5b72('0x21')]:_0x88362b[_0x5b72('0x1e')]+_0x88362b[_0x5b72('0x20')];var _0x49d951;if(_0x4b3455>=_0x49f5f1){_0x4b3455=_0x49f5f1;_0x49d951=0xc8;}else{_0x49d951=0xce;}_0x2d2bb1[_0x5b72('0x1b')](_0x49d951);return _0x2d2bb1[_0x5b72('0x22')](_0x5b72('0x23'),_0x56c23f+'-'+_0x4b3455+'/'+_0x49f5f1)[_0x5b72('0x1d')](_0x353fb8);}return null;};}function patchUpdates(_0x47acb5){return function(_0x51ae3d){try{jsonpatch[_0x5b72('0x24')](_0x51ae3d,_0x47acb5,!![]);}catch(_0x527121){return BPromise['reject'](_0x527121);}return _0x51ae3d[_0x5b72('0x25')]();};}function saveUpdates(_0x41364d,_0x2e08f9){return function(_0x519d4a){if(_0x519d4a){return _0x519d4a[_0x5b72('0x26')](_0x41364d)[_0x5b72('0x27')](function(_0x21b12a){return _0x21b12a;});}return null;};}function removeEntity(_0x3fa898,_0x10ed20){return function(_0x553c76){if(_0x553c76){return _0x553c76[_0x5b72('0x28')]()[_0x5b72('0x27')](function(){_0x3fa898['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52fc1d,_0x46d9c6){return function(_0x60e802){if(!_0x60e802){_0x52fc1d['sendStatus'](0x194);}return _0x60e802;};}function handleError(_0x52f385,_0x4178da){_0x4178da=_0x4178da||0x1f4;return function(_0x1ac7a7){logger[_0x5b72('0x29')](_0x1ac7a7['stack']);if(_0x1ac7a7[_0x5b72('0x2a')]){delete _0x1ac7a7[_0x5b72('0x2a')];}_0x52f385[_0x5b72('0x1b')](_0x4178da)[_0x5b72('0x2b')](_0x1ac7a7);};}exports[_0x5b72('0x2c')]=function(_0x4886be,_0x204d26){var _0x3b6848={},_0x2919a4={},_0x2e500d={'count':0x0,'rows':[]};var _0x549fdb=_[_0x5b72('0x2d')](db[_0x5b72('0x2e')][_0x5b72('0x2f')],function(_0x4a2b3e){return{'name':_0x4a2b3e[_0x5b72('0x30')],'type':_0x4a2b3e['type'][_0x5b72('0x31')]};});_0x2919a4['model']=_[_0x5b72('0x2d')](_0x549fdb,_0x5b72('0x2a'));_0x2919a4['query']=_['keys'](_0x4886be[_0x5b72('0x32')]);_0x2919a4[_0x5b72('0x33')]=_['intersection'](_0x2919a4[_0x5b72('0x34')],_0x2919a4['query']);_0x3b6848[_0x5b72('0x35')]=_[_0x5b72('0x36')](_0x2919a4[_0x5b72('0x34')],qs[_0x5b72('0x37')](_0x4886be['query'][_0x5b72('0x37')]));_0x3b6848['attributes']=_0x3b6848[_0x5b72('0x35')]['length']?_0x3b6848['attributes']:_0x2919a4['model'];if(!_0x4886be[_0x5b72('0x32')][_0x5b72('0x38')](_0x5b72('0x39'))){_0x3b6848[_0x5b72('0x20')]=qs['limit'](_0x4886be[_0x5b72('0x32')][_0x5b72('0x20')]);_0x3b6848['offset']=qs['offset'](_0x4886be[_0x5b72('0x32')]['offset']);}_0x3b6848[_0x5b72('0x3a')]=qs[_0x5b72('0x3b')](_0x4886be[_0x5b72('0x32')][_0x5b72('0x3b')]);_0x3b6848[_0x5b72('0x3c')]=qs['filters'](_[_0x5b72('0x3d')](_0x4886be[_0x5b72('0x32')],_0x2919a4['filters']),_0x549fdb);if(_0x4886be[_0x5b72('0x32')][_0x5b72('0x3e')]){_0x3b6848['where']=_['merge'](_0x3b6848[_0x5b72('0x3c')],{'$or':_['map'](_0x549fdb,function(_0x61d906){if(_0x61d906['type']!=='VIRTUAL'){var _0x3ea783={};_0x3ea783[_0x61d906[_0x5b72('0x2a')]]={'$like':'%'+_0x4886be[_0x5b72('0x32')][_0x5b72('0x3e')]+'%'};return _0x3ea783;}})});}_0x3b6848=_['merge']({},_0x3b6848,_0x4886be[_0x5b72('0x3f')]);var _0x5b7c7a={'where':_0x3b6848[_0x5b72('0x3c')]};return db[_0x5b72('0x2e')][_0x5b72('0x21')](_0x5b7c7a)[_0x5b72('0x27')](function(_0x3f074d){_0x2e500d[_0x5b72('0x21')]=_0x3f074d;if(_0x4886be['query']['includeAll']){_0x3b6848[_0x5b72('0x40')]=[{'all':!![]}];}return db['SquareMessage'][_0x5b72('0x41')](_0x3b6848);})[_0x5b72('0x27')](function(_0x1c62cb){_0x2e500d[_0x5b72('0x42')]=_0x1c62cb;return _0x2e500d;})[_0x5b72('0x27')](respondWithFilteredResult(_0x204d26,_0x3b6848))[_0x5b72('0x43')](handleError(_0x204d26,null));};exports[_0x5b72('0x44')]=function(_0x597ae3,_0x54217e){var _0x31d901={'raw':!![],'where':{'id':_0x597ae3['params']['id']}},_0x1de9f1={};_0x1de9f1[_0x5b72('0x34')]=_[_0x5b72('0x45')](db[_0x5b72('0x2e')]['rawAttributes']);_0x1de9f1[_0x5b72('0x32')]=_[_0x5b72('0x45')](_0x597ae3[_0x5b72('0x32')]);_0x1de9f1[_0x5b72('0x33')]=_['intersection'](_0x1de9f1[_0x5b72('0x34')],_0x1de9f1[_0x5b72('0x32')]);_0x31d901['attributes']=_[_0x5b72('0x36')](_0x1de9f1[_0x5b72('0x34')],qs[_0x5b72('0x37')](_0x597ae3[_0x5b72('0x32')][_0x5b72('0x37')]));_0x31d901['attributes']=_0x31d901[_0x5b72('0x35')][_0x5b72('0x46')]?_0x31d901[_0x5b72('0x35')]:_0x1de9f1[_0x5b72('0x34')];if(_0x597ae3['query'][_0x5b72('0x47')]){_0x31d901[_0x5b72('0x40')]=[{'all':!![]}];}_0x31d901=_['merge']({},_0x31d901,_0x597ae3[_0x5b72('0x3f')]);return db[_0x5b72('0x2e')][_0x5b72('0x48')](_0x31d901)[_0x5b72('0x27')](handleEntityNotFound(_0x54217e,null))['then'](respondWithResult(_0x54217e,null))[_0x5b72('0x43')](handleError(_0x54217e,null));};exports[_0x5b72('0x49')]=function(_0x392c02,_0xfb9b57){return db['SquareMessage'][_0x5b72('0x49')](_0x392c02['body'],{})['then'](respondWithResult(_0xfb9b57,0xc9))[_0x5b72('0x43')](handleError(_0xfb9b57,null));};exports[_0x5b72('0x26')]=function(_0x3dc39b,_0x1fa118){if(_0x3dc39b[_0x5b72('0x4a')]['id']){delete _0x3dc39b['body']['id'];}return db[_0x5b72('0x2e')][_0x5b72('0x48')]({'where':{'id':_0x3dc39b[_0x5b72('0x4b')]['id']}})[_0x5b72('0x27')](handleEntityNotFound(_0x1fa118,null))[_0x5b72('0x27')](saveUpdates(_0x3dc39b['body'],null))[_0x5b72('0x27')](respondWithResult(_0x1fa118,null))['catch'](handleError(_0x1fa118,null));};exports[_0x5b72('0x28')]=function(_0x5051e6,_0x2ad8b5){return db[_0x5b72('0x2e')]['find']({'where':{'id':_0x5051e6[_0x5b72('0x4b')]['id']}})[_0x5b72('0x27')](handleEntityNotFound(_0x2ad8b5,null))['then'](removeEntity(_0x2ad8b5,null))[_0x5b72('0x43')](handleError(_0x2ad8b5,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index c9bef3e..72a0079 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 _0x54ec=['rimraf','../../config/environment','./squareMessage.attributes','exports','square_messages','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x35e6ca,_0x54939f){var _0x239e43=function(_0x3ea90d){while(--_0x3ea90d){_0x35e6ca['push'](_0x35e6ca['shift']());}};_0x239e43(++_0x54939f);}(_0x54ec,0x1c8));var _0xc54e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x54ec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc54e('0x0'));var util=require('util');var logger=require(_0xc54e('0x1'))(_0xc54e('0x2'));var moment=require(_0xc54e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc54e('0x4'));var fs=require('fs');var path=require(_0xc54e('0x5'));var rimraf=require(_0xc54e('0x6'));var config=require(_0xc54e('0x7'));var attributes=require(_0xc54e('0x8'));module[_0xc54e('0x9')]=function(_0x270fe1,_0x5c272f){return _0x270fe1['define']('SquareMessage',attributes,{'tableName':_0xc54e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x205e=['SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x205e,0x1d6));var _0xe205=function(_0x487c27,_0x5ea184){_0x487c27=_0x487c27-0x0;var _0x22a2ad=_0x205e[_0x487c27];return _0x22a2ad;};'use strict';var _=require(_0xe205('0x0'));var util=require(_0xe205('0x1'));var logger=require(_0xe205('0x2'))(_0xe205('0x3'));var moment=require(_0xe205('0x4'));var BPromise=require(_0xe205('0x5'));var rp=require(_0xe205('0x6'));var fs=require('fs');var path=require(_0xe205('0x7'));var rimraf=require(_0xe205('0x8'));var config=require(_0xe205('0x9'));var attributes=require(_0xe205('0xa'));module['exports']=function(_0x3a9c5a,_0x2a51df){return _0x3a9c5a['define'](_0xe205('0xb'),attributes,{'tableName':_0xe205('0xc'),'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 7b6dae2..ce475cd 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 _0x6785=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareMessage,\x20%s,\x20%s','info','result','catch','CreateSquareMessage','SquareMessage','options','raw','debug','lodash','util','moment','bluebird','randomstring'];(function(_0xfa6bd7,_0x2887f4){var _0x2cb0b1=function(_0x5544c6){while(--_0x5544c6){_0xfa6bd7['push'](_0xfa6bd7['shift']());}};_0x2cb0b1(++_0x2887f4);}(_0x6785,0x6f));var _0x5678=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x6785[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x5678('0x0'));var util=require(_0x5678('0x1'));var moment=require(_0x5678('0x2'));var BPromise=require(_0x5678('0x3'));var rs=require(_0x5678('0x4'));var fs=require('fs');var Redis=require(_0x5678('0x5'));var db=require(_0x5678('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5678('0x7'))(_0x5678('0x8'));var config=require(_0x5678('0x9'));var jayson=require(_0x5678('0xa'));var client=jayson[_0x5678('0xb')][_0x5678('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9f84f2,_0x40efb3,_0x2f8b3f){return new BPromise(function(_0x8deb9e,_0x35ffbc){return client[_0x5678('0xd')](_0x9f84f2,_0x2f8b3f)[_0x5678('0xe')](function(_0x2a780e){logger['info']('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x5678('0xf'));logger['debug'](_0x5678('0x10'),_0x40efb3,_0x5678('0xf'),JSON[_0x5678('0x11')](_0x2a780e));if(_0x2a780e[_0x5678('0x12')]){if(_0x2a780e['error']['code']===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x2a780e['error'][_0x5678('0x13')]);return _0x35ffbc(_0x2a780e[_0x5678('0x12')][_0x5678('0x13')]);}logger['error'](_0x5678('0x14'),_0x40efb3,_0x2a780e[_0x5678('0x12')]['message']);return _0x8deb9e(_0x2a780e[_0x5678('0x12')][_0x5678('0x13')]);}else{logger[_0x5678('0x15')]('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x5678('0xf'));_0x8deb9e(_0x2a780e[_0x5678('0x16')][_0x5678('0x13')]);}})[_0x5678('0x17')](function(_0x4434f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x40efb3,_0x4434f4);_0x35ffbc(_0x4434f4);});});}exports[_0x5678('0x18')]=function(_0x4bdb0d){var _0x4e2310=this;return new Promise(function(_0x4372a7,_0x83e121){return db[_0x5678('0x19')]['create'](_0x4bdb0d['body'],{'raw':_0x4bdb0d[_0x5678('0x1a')]?_0x4bdb0d['options'][_0x5678('0x1b')]===undefined?!![]:![]:!![]})[_0x5678('0xe')](function(_0x5444f5){logger[_0x5678('0x15')](_0x5678('0x18'),_0x4bdb0d);logger[_0x5678('0x1c')](_0x5678('0x18'),_0x4bdb0d,JSON[_0x5678('0x11')](_0x5444f5));_0x4372a7(_0x5444f5);})[_0x5678('0x17')](function(_0x52840d){logger['error']('CreateSquareMessage',_0x52840d[_0x5678('0x13')],_0x4bdb0d);_0x83e121(_0x4e2310[_0x5678('0x12')](0x1f4,_0x52840d[_0x5678('0x13')]));});});}; \ No newline at end of file +var _0xb14f=['message','result','catch','CreateSquareMessage','SquareMessage','create','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x32f6f8,_0x34c11a){var _0xbdb87=function(_0x4542fb){while(--_0x4542fb){_0x32f6f8['push'](_0x32f6f8['shift']());}};_0xbdb87(++_0x34c11a);}(_0xb14f,0x131));var _0xfb14=function(_0x53313e,_0x25c9ed){_0x53313e=_0x53313e-0x0;var _0x187f0c=_0xb14f[_0x53313e];return _0x187f0c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfb14('0x0'));var rs=require(_0xfb14('0x1'));var fs=require('fs');var Redis=require(_0xfb14('0x2'));var db=require(_0xfb14('0x3'))['db'];var utils=require(_0xfb14('0x4'));var logger=require(_0xfb14('0x5'))(_0xfb14('0x6'));var config=require('../../config/environment');var jayson=require(_0xfb14('0x7'));var client=jayson[_0xfb14('0x8')][_0xfb14('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54c825,_0x276f74,_0x57d431){return new BPromise(function(_0x4ff156,_0xe2fffa){return client[_0xfb14('0xa')](_0x54c825,_0x57d431)[_0xfb14('0xb')](function(_0x2ae457){logger[_0xfb14('0xc')](_0xfb14('0xd'),_0x276f74,'request\x20sent');logger[_0xfb14('0xe')](_0xfb14('0xf'),_0x276f74,_0xfb14('0x10'),JSON[_0xfb14('0x11')](_0x2ae457));if(_0x2ae457[_0xfb14('0x12')]){if(_0x2ae457[_0xfb14('0x12')]['code']===0x1f4){logger[_0xfb14('0x12')]('SquareMessage,\x20%s,\x20%s',_0x276f74,_0x2ae457[_0xfb14('0x12')][_0xfb14('0x13')]);return _0xe2fffa(_0x2ae457[_0xfb14('0x12')][_0xfb14('0x13')]);}logger[_0xfb14('0x12')]('SquareMessage,\x20%s,\x20%s',_0x276f74,_0x2ae457[_0xfb14('0x12')][_0xfb14('0x13')]);return _0x4ff156(_0x2ae457['error'][_0xfb14('0x13')]);}else{logger[_0xfb14('0xc')](_0xfb14('0xd'),_0x276f74,'request\x20sent');_0x4ff156(_0x2ae457[_0xfb14('0x14')][_0xfb14('0x13')]);}})[_0xfb14('0x15')](function(_0xae2d0d){logger['error'](_0xfb14('0xd'),_0x276f74,_0xae2d0d);_0xe2fffa(_0xae2d0d);});});}exports[_0xfb14('0x16')]=function(_0x272c51){var _0x197b1a=this;return new Promise(function(_0x2631b0,_0x4d6eac){return db[_0xfb14('0x17')][_0xfb14('0x18')](_0x272c51['body'],{'raw':_0x272c51[_0xfb14('0x19')]?_0x272c51['options'][_0xfb14('0x1a')]===undefined?!![]:![]:!![]})[_0xfb14('0xb')](function(_0x3a874e){logger['info']('CreateSquareMessage',_0x272c51);logger[_0xfb14('0xe')]('CreateSquareMessage',_0x272c51,JSON[_0xfb14('0x11')](_0x3a874e));_0x2631b0(_0x3a874e);})[_0xfb14('0x15')](function(_0x28de0e){logger[_0xfb14('0x12')](_0xfb14('0x16'),_0x28de0e[_0xfb14('0x13')],_0x272c51);_0x4d6eac(_0x197b1a[_0xfb14('0x12')](0x1f4,_0x28de0e[_0xfb14('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9f5b33e..9aceb12 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 _0x89cb=['./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x214f8a,_0x34febb){var _0xde182f=function(_0x220c68){while(--_0x220c68){_0x214f8a['push'](_0x214f8a['shift']());}};_0xde182f(++_0x34febb);}(_0x89cb,0x16f));var _0xb89c=function(_0x414ff3,_0x35fc5b){_0x414ff3=_0x414ff3-0x0;var _0x3f8b3c=_0x89cb[_0x414ff3];return _0x3f8b3c;};'use strict';var multer=require('multer');var util=require(_0xb89c('0x0'));var path=require(_0xb89c('0x1'));var timeout=require(_0xb89c('0x2'));var express=require('express');var router=express[_0xb89c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb89c('0x4'));var interaction=require(_0xb89c('0x5'));var config=require(_0xb89c('0x6'));var controller=require(_0xb89c('0x7'));router[_0xb89c('0x8')]('/',auth[_0xb89c('0x9')](),controller[_0xb89c('0xa')]);router[_0xb89c('0x8')]('/:id',auth[_0xb89c('0x9')](),controller[_0xb89c('0xb')]);router[_0xb89c('0x8')](_0xb89c('0xc'),auth['isAuthenticated'](),timeout(_0xb89c('0xd')),controller[_0xb89c('0xe')]);router[_0xb89c('0xf')]('/',auth['isAuthenticated'](),controller[_0xb89c('0x10')]);router[_0xb89c('0x11')](_0xb89c('0x12'),auth['isAuthenticated'](),controller[_0xb89c('0x13')]);router[_0xb89c('0x14')](_0xb89c('0x12'),auth[_0xb89c('0x9')](),controller['destroy']);module[_0xb89c('0x15')]=router; \ No newline at end of file +var _0x08c7=['15s','post','create','put','destroy','exports','multer','util','path','express','Router','../../config/environment','isAuthenticated','get','/:id','show','/:id/test'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x08c7,0x15a));var _0x708c=function(_0x22a31a,_0x2e8d8){_0x22a31a=_0x22a31a-0x0;var _0x91bc25=_0x08c7[_0x22a31a];return _0x91bc25;};'use strict';var multer=require(_0x708c('0x0'));var util=require(_0x708c('0x1'));var path=require(_0x708c('0x2'));var timeout=require('connect-timeout');var express=require(_0x708c('0x3'));var router=express[_0x708c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x708c('0x5'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0x708c('0x6')](),controller['index']);router[_0x708c('0x7')](_0x708c('0x8'),auth[_0x708c('0x6')](),controller[_0x708c('0x9')]);router[_0x708c('0x7')](_0x708c('0xa'),auth['isAuthenticated'](),timeout(_0x708c('0xb')),controller['test']);router[_0x708c('0xc')]('/',auth[_0x708c('0x6')](),controller[_0x708c('0xd')]);router[_0x708c('0xe')](_0x708c('0x8'),auth[_0x708c('0x6')](),controller['update']);router['delete'](_0x708c('0x8'),auth['isAuthenticated'](),controller[_0x708c('0xf')]);module[_0x708c('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index af78a07..01285f0 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 _0x7ac9=['STRING','name','exports'];(function(_0x266be3,_0x1748f5){var _0x31700e=function(_0xf24ef3){while(--_0xf24ef3){_0x266be3['push'](_0x266be3['shift']());}};_0x31700e(++_0x1748f5);}(_0x7ac9,0x188));var _0x97ac=function(_0x8e04b8,_0x421921){_0x8e04b8=_0x8e04b8-0x0;var _0x2e78e7=_0x7ac9[_0x8e04b8];return _0x2e78e7;};'use strict';var Sequelize=require('sequelize');module[_0x97ac('0x0')]={'name':{'type':Sequelize[_0x97ac('0x1')],'unique':_0x97ac('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x97ac('0x1')]},'description':{'type':Sequelize[_0x97ac('0x1')]}}; \ No newline at end of file +var _0x9929=['name','sequelize','exports','STRING'];(function(_0x2743f2,_0x22cea6){var _0x45f8e4=function(_0x2ac786){while(--_0x2ac786){_0x2743f2['push'](_0x2743f2['shift']());}};_0x45f8e4(++_0x22cea6);}(_0x9929,0x1a5));var _0x9992=function(_0x294a94,_0x287404){_0x294a94=_0x294a94-0x0;var _0x389c43=_0x9929[_0x294a94];return _0x389c43;};'use strict';var Sequelize=require(_0x9992('0x0'));module[_0x9992('0x1')]={'name':{'type':Sequelize[_0x9992('0x2')],'unique':_0x9992('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'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 d7cdab6..59407fb 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 _0x8e6d=['../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x34d2d4,_0x480737){var _0x2384bc=function(_0x116c28){while(--_0x116c28){_0x34d2d4['push'](_0x34d2d4['shift']());}};_0x2384bc(++_0x480737);}(_0x8e6d,0x94));var _0xd8e6=function(_0x30c1d0,_0x473bb4){_0x30c1d0=_0x30c1d0-0x0;var _0x1cfcbe=_0x8e6d[_0x30c1d0];return _0x1cfcbe;};'use strict';var emlformat=require(_0xd8e6('0x0'));var rimraf=require(_0xd8e6('0x1'));var zipdir=require(_0xd8e6('0x2'));var jsonpatch=require(_0xd8e6('0x3'));var rp=require(_0xd8e6('0x4'));var moment=require(_0xd8e6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd8e6('0x6'));var path=require(_0xd8e6('0x7'));var sox=require('sox');var csv=require(_0xd8e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8e6('0x9'));var _=require('lodash');var squel=require(_0xd8e6('0xa'));var crypto=require(_0xd8e6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd8e6('0xc'));var toCsv=require(_0xd8e6('0x8'));var querystring=require(_0xd8e6('0xd'));var Papa=require('papaparse');var Redis=require(_0xd8e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd8e6('0xf'));var as=require(_0xd8e6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8e6('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd8e6('0x12'))['db'];function respondWithStatusCode(_0x1fe818,_0x2560f2){_0x2560f2=_0x2560f2||0xcc;return function(_0x7c6748){if(_0x7c6748){return _0x1fe818[_0xd8e6('0x13')](_0x2560f2);}return _0x1fe818[_0xd8e6('0x14')](_0x2560f2)[_0xd8e6('0x15')]();};}function respondWithResult(_0x51e3d8,_0x5e216e){_0x5e216e=_0x5e216e||0xc8;return function(_0x5cf3fe){if(_0x5cf3fe){return _0x51e3d8[_0xd8e6('0x14')](_0x5e216e)['json'](_0x5cf3fe);}};}function respondWithFilteredResult(_0x56a9a9,_0xa0de35){return function(_0x37f5c7){if(_0x37f5c7){var _0x1ff893=typeof _0xa0de35[_0xd8e6('0x16')]==='undefined'&&typeof _0xa0de35[_0xd8e6('0x17')]===_0xd8e6('0x18');var _0x3c5574=_0x37f5c7['count'];var _0x3c9c31=_0x1ff893?0x0:_0xa0de35['offset'];var _0x59ede0=_0x1ff893?_0x37f5c7[_0xd8e6('0x19')]:_0xa0de35['offset']+_0xa0de35[_0xd8e6('0x17')];var _0x856c7d;if(_0x59ede0>=_0x3c5574){_0x59ede0=_0x3c5574;_0x856c7d=0xc8;}else{_0x856c7d=0xce;}_0x56a9a9['status'](_0x856c7d);return _0x56a9a9[_0xd8e6('0x1a')](_0xd8e6('0x1b'),_0x3c9c31+'-'+_0x59ede0+'/'+_0x3c5574)[_0xd8e6('0x1c')](_0x37f5c7);}return null;};}function patchUpdates(_0x5c6614){return function(_0x59e1a1){try{jsonpatch[_0xd8e6('0x1d')](_0x59e1a1,_0x5c6614,!![]);}catch(_0x246651){return BPromise[_0xd8e6('0x1e')](_0x246651);}return _0x59e1a1[_0xd8e6('0x1f')]();};}function saveUpdates(_0x220459,_0x32bc9a){return function(_0x43df3d){if(_0x43df3d){return _0x43df3d[_0xd8e6('0x20')](_0x220459)['then'](function(_0x2eeec3){return _0x2eeec3;});}return null;};}function removeEntity(_0x2651fb,_0x4dd328){return function(_0xc25588){if(_0xc25588){return _0xc25588[_0xd8e6('0x21')]()[_0xd8e6('0x22')](function(){var _0x18cdd7=_0xc25588[_0xd8e6('0x23')]({'plain':!![]});var _0x29287b=_0xd8e6('0x24');return db[_0xd8e6('0x25')][_0xd8e6('0x21')]({'where':{'type':_0x29287b,'resourceId':_0x18cdd7['id']}})['then'](function(){return _0xc25588;});})[_0xd8e6('0x22')](function(){_0x2651fb[_0xd8e6('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34369b,_0xff3062){return function(_0x1184f7){if(!_0x1184f7){_0x34369b[_0xd8e6('0x13')](0x194);}return _0x1184f7;};}function handleError(_0x410e58,_0x2f6c91){_0x2f6c91=_0x2f6c91||0x1f4;return function(_0x3176be){logger[_0xd8e6('0x26')](_0x3176be[_0xd8e6('0x27')]);if(_0x3176be[_0xd8e6('0x28')]){delete _0x3176be[_0xd8e6('0x28')];}_0x410e58[_0xd8e6('0x14')](_0x2f6c91)[_0xd8e6('0x29')](_0x3176be);};}exports['index']=function(_0x7989cd,_0x44055c){var _0x2577dd={},_0x58f717={},_0x192f8a={'count':0x0,'rows':[]};var _0x32c065=_[_0xd8e6('0x2a')](db[_0xd8e6('0x2b')][_0xd8e6('0x2c')],function(_0x218528){return{'name':_0x218528[_0xd8e6('0x2d')],'type':_0x218528[_0xd8e6('0x2e')][_0xd8e6('0x2f')]};});_0x58f717['model']=_[_0xd8e6('0x2a')](_0x32c065,_0xd8e6('0x28'));_0x58f717[_0xd8e6('0x30')]=_[_0xd8e6('0x31')](_0x7989cd[_0xd8e6('0x30')]);_0x58f717['filters']=_[_0xd8e6('0x32')](_0x58f717[_0xd8e6('0x33')],_0x58f717[_0xd8e6('0x30')]);_0x2577dd[_0xd8e6('0x34')]=_[_0xd8e6('0x32')](_0x58f717[_0xd8e6('0x33')],qs[_0xd8e6('0x35')](_0x7989cd['query'][_0xd8e6('0x35')]));_0x2577dd[_0xd8e6('0x34')]=_0x2577dd[_0xd8e6('0x34')][_0xd8e6('0x36')]?_0x2577dd['attributes']:_0x58f717[_0xd8e6('0x33')];if(!_0x7989cd[_0xd8e6('0x30')][_0xd8e6('0x37')]('nolimit')){_0x2577dd[_0xd8e6('0x17')]=qs[_0xd8e6('0x17')](_0x7989cd[_0xd8e6('0x30')][_0xd8e6('0x17')]);_0x2577dd[_0xd8e6('0x16')]=qs[_0xd8e6('0x16')](_0x7989cd[_0xd8e6('0x30')][_0xd8e6('0x16')]);}_0x2577dd['order']=qs[_0xd8e6('0x38')](_0x7989cd[_0xd8e6('0x30')]['sort']);_0x2577dd[_0xd8e6('0x39')]=qs[_0xd8e6('0x3a')](_['pick'](_0x7989cd[_0xd8e6('0x30')],_0x58f717[_0xd8e6('0x3a')]),_0x32c065);if(_0x7989cd[_0xd8e6('0x30')]['filter']){_0x2577dd[_0xd8e6('0x39')]=_[_0xd8e6('0x3b')](_0x2577dd[_0xd8e6('0x39')],{'$or':_[_0xd8e6('0x2a')](_0x32c065,function(_0x5e397e){if(_0x5e397e[_0xd8e6('0x2e')]!==_0xd8e6('0x3c')){var _0x4e5998={};_0x4e5998[_0x5e397e[_0xd8e6('0x28')]]={'$like':'%'+_0x7989cd['query'][_0xd8e6('0x3d')]+'%'};return _0x4e5998;}})});}_0x2577dd=_[_0xd8e6('0x3b')]({},_0x2577dd,_0x7989cd[_0xd8e6('0x3e')]);var _0x3f9928={'where':_0x2577dd['where']};return db['SquareOdbc'][_0xd8e6('0x19')](_0x3f9928)[_0xd8e6('0x22')](function(_0xcab691){_0x192f8a[_0xd8e6('0x19')]=_0xcab691;if(_0x7989cd[_0xd8e6('0x30')]['includeAll']){_0x2577dd[_0xd8e6('0x3f')]=[{'all':!![]}];}return db[_0xd8e6('0x2b')][_0xd8e6('0x40')](_0x2577dd);})[_0xd8e6('0x22')](function(_0xdf00ec){_0x192f8a[_0xd8e6('0x41')]=_0xdf00ec;return _0x192f8a;})[_0xd8e6('0x22')](respondWithFilteredResult(_0x44055c,_0x2577dd))[_0xd8e6('0x42')](handleError(_0x44055c,null));};exports[_0xd8e6('0x43')]=function(_0x49219a,_0xc1a3c4){var _0x278db6={'raw':!![],'where':{'id':_0x49219a[_0xd8e6('0x44')]['id']}},_0x22268a={};_0x22268a[_0xd8e6('0x33')]=_[_0xd8e6('0x31')](db[_0xd8e6('0x2b')]['rawAttributes']);_0x22268a[_0xd8e6('0x30')]=_[_0xd8e6('0x31')](_0x49219a[_0xd8e6('0x30')]);_0x22268a[_0xd8e6('0x3a')]=_['intersection'](_0x22268a[_0xd8e6('0x33')],_0x22268a[_0xd8e6('0x30')]);_0x278db6[_0xd8e6('0x34')]=_[_0xd8e6('0x32')](_0x22268a[_0xd8e6('0x33')],qs['fields'](_0x49219a[_0xd8e6('0x30')][_0xd8e6('0x35')]));_0x278db6[_0xd8e6('0x34')]=_0x278db6[_0xd8e6('0x34')][_0xd8e6('0x36')]?_0x278db6['attributes']:_0x22268a[_0xd8e6('0x33')];if(_0x49219a[_0xd8e6('0x30')][_0xd8e6('0x45')]){_0x278db6[_0xd8e6('0x3f')]=[{'all':!![]}];}_0x278db6=_[_0xd8e6('0x3b')]({},_0x278db6,_0x49219a['options']);return db[_0xd8e6('0x2b')][_0xd8e6('0x46')](_0x278db6)['then'](handleEntityNotFound(_0xc1a3c4,null))['then'](respondWithResult(_0xc1a3c4,null))[_0xd8e6('0x42')](handleError(_0xc1a3c4,null));};exports['create']=function(_0x1c51bb,_0x3dd16e){return db[_0xd8e6('0x2b')][_0xd8e6('0x47')](_0x1c51bb['body'],{})['then'](function(_0x1a5f8b){var _0x1f916d=_0x1c51bb[_0xd8e6('0x48')][_0xd8e6('0x23')]({'plain':!![]});if(!_0x1f916d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f916d[_0xd8e6('0x49')]===_0xd8e6('0x48')){var _0x13cc50=_0x1a5f8b[_0xd8e6('0x23')]({'plain':!![]});var _0x2f8a75='ODBC';return db[_0xd8e6('0x4a')][_0xd8e6('0x46')]({'where':{'name':_0x2f8a75,'userProfileId':_0x1f916d[_0xd8e6('0x4b')]},'raw':!![]})['then'](function(_0xa58844){if(_0xa58844&&_0xa58844[_0xd8e6('0x4c')]===0x0){return db['UserProfileResource'][_0xd8e6('0x47')]({'name':_0x13cc50['name'],'resourceId':_0x13cc50['id'],'type':_0xa58844[_0xd8e6('0x28')],'sectionId':_0xa58844['id']},{})[_0xd8e6('0x22')](function(){return _0x1a5f8b;});}else{return _0x1a5f8b;}})[_0xd8e6('0x42')](function(_0xf885c6){logger[_0xd8e6('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf885c6);throw _0xf885c6;});}return _0x1a5f8b;})['then'](respondWithResult(_0x3dd16e,0xc9))[_0xd8e6('0x42')](handleError(_0x3dd16e,null));};exports['update']=function(_0x118115,_0x5273e6){if(_0x118115[_0xd8e6('0x4d')]['id']){delete _0x118115[_0xd8e6('0x4d')]['id'];}return db['SquareOdbc'][_0xd8e6('0x46')]({'where':{'id':_0x118115['params']['id']}})[_0xd8e6('0x22')](handleEntityNotFound(_0x5273e6,null))[_0xd8e6('0x22')](saveUpdates(_0x118115['body'],null))[_0xd8e6('0x22')](respondWithResult(_0x5273e6,null))[_0xd8e6('0x42')](handleError(_0x5273e6,null));};exports[_0xd8e6('0x21')]=function(_0x39fbe9,_0x2efdc1){return db['SquareOdbc'][_0xd8e6('0x46')]({'where':{'id':_0x39fbe9[_0xd8e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x2efdc1,null))['then'](removeEntity(_0x2efdc1,null))['catch'](handleError(_0x2efdc1,null));};exports['test']=function(_0x12958c,_0x26420a,_0xc12e1d){var _0x1e39b3;return db[_0xd8e6('0x2b')][_0xd8e6('0x46')]({'where':{'id':_0x12958c[_0xd8e6('0x44')]['id']},'attributes':['id',_0xd8e6('0x4e')]})[_0xd8e6('0x22')](handleEntityNotFound(_0x26420a,null))[_0xd8e6('0x22')](function(_0xa25022){if(_0xa25022){var _0xca0b2b=require(_0xd8e6('0x4f'))();_0xca0b2b[_0xd8e6('0x50')](_0xa25022[_0xd8e6('0x4e')]);_0xca0b2b[_0xd8e6('0x51')]();return _0xa25022;}})[_0xd8e6('0x22')](respondWithResult(_0x26420a,null))[_0xd8e6('0x42')](handleError(_0x26420a,null));}; \ No newline at end of file +var _0xfeb4=['where','pick','merge','VIRTUAL','filter','options','SquareOdbc','includeAll','include','findAll','rows','show','params','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0xca30ff,_0x4bda96){var _0xa8191b=function(_0x2384ed){while(--_0x2384ed){_0xca30ff['push'](_0xca30ff['shift']());}};_0xa8191b(++_0x4bda96);}(_0xfeb4,0x6d));var _0x4feb=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xfeb4[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0x4feb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4feb('0x1'));var jsonpatch=require(_0x4feb('0x2'));var rp=require(_0x4feb('0x3'));var moment=require(_0x4feb('0x4'));var BPromise=require(_0x4feb('0x5'));var Mustache=require(_0x4feb('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4feb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4feb('0x8'));var squel=require(_0x4feb('0x9'));var crypto=require('crypto');var jsforce=require(_0x4feb('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4feb('0xb'));var querystring=require(_0x4feb('0xc'));var Papa=require(_0x4feb('0xd'));var Redis=require('ioredis');var authService=require(_0x4feb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4feb('0xf'));var hardwareService=require(_0x4feb('0x10'));var logger=require(_0x4feb('0x11'))(_0x4feb('0x12'));var utils=require(_0x4feb('0x13'));var config=require(_0x4feb('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4feb('0x15'))['db'];function respondWithStatusCode(_0x241f21,_0x42676f){_0x42676f=_0x42676f||0xcc;return function(_0x2daa11){if(_0x2daa11){return _0x241f21['sendStatus'](_0x42676f);}return _0x241f21[_0x4feb('0x16')](_0x42676f)[_0x4feb('0x17')]();};}function respondWithResult(_0xa5204e,_0x3fdf1c){_0x3fdf1c=_0x3fdf1c||0xc8;return function(_0x46a50d){if(_0x46a50d){return _0xa5204e[_0x4feb('0x16')](_0x3fdf1c)['json'](_0x46a50d);}};}function respondWithFilteredResult(_0x402b24,_0x4f1ae5){return function(_0x123a3d){if(_0x123a3d){var _0xd4e03c=typeof _0x4f1ae5[_0x4feb('0x18')]===_0x4feb('0x19')&&typeof _0x4f1ae5[_0x4feb('0x1a')]===_0x4feb('0x19');var _0x209ae8=_0x123a3d[_0x4feb('0x1b')];var _0x2b3ded=_0xd4e03c?0x0:_0x4f1ae5[_0x4feb('0x18')];var _0x61e87e=_0xd4e03c?_0x123a3d[_0x4feb('0x1b')]:_0x4f1ae5[_0x4feb('0x18')]+_0x4f1ae5[_0x4feb('0x1a')];var _0x3a44de;if(_0x61e87e>=_0x209ae8){_0x61e87e=_0x209ae8;_0x3a44de=0xc8;}else{_0x3a44de=0xce;}_0x402b24['status'](_0x3a44de);return _0x402b24['set']('Content-Range',_0x2b3ded+'-'+_0x61e87e+'/'+_0x209ae8)['json'](_0x123a3d);}return null;};}function patchUpdates(_0x2bd2df){return function(_0x16998c){try{jsonpatch[_0x4feb('0x1c')](_0x16998c,_0x2bd2df,!![]);}catch(_0x46d0cd){return BPromise[_0x4feb('0x1d')](_0x46d0cd);}return _0x16998c[_0x4feb('0x1e')]();};}function saveUpdates(_0x1d5c42,_0x4ad334){return function(_0x32a5a6){if(_0x32a5a6){return _0x32a5a6[_0x4feb('0x1f')](_0x1d5c42)[_0x4feb('0x20')](function(_0x527ba4){return _0x527ba4;});}return null;};}function removeEntity(_0x33ef25,_0x4c5271){return function(_0x3aeb20){if(_0x3aeb20){return _0x3aeb20[_0x4feb('0x21')]()[_0x4feb('0x20')](function(){var _0x4930e3=_0x3aeb20[_0x4feb('0x22')]({'plain':!![]});var _0x39b077=_0x4feb('0x23');return db[_0x4feb('0x24')][_0x4feb('0x21')]({'where':{'type':_0x39b077,'resourceId':_0x4930e3['id']}})['then'](function(){return _0x3aeb20;});})[_0x4feb('0x20')](function(){_0x33ef25[_0x4feb('0x16')](0xcc)[_0x4feb('0x17')]();});}};}function handleEntityNotFound(_0x598e07,_0x5a44b1){return function(_0x117b84){if(!_0x117b84){_0x598e07[_0x4feb('0x25')](0x194);}return _0x117b84;};}function handleError(_0x450f6b,_0x3ab9f3){_0x3ab9f3=_0x3ab9f3||0x1f4;return function(_0x5b2558){logger[_0x4feb('0x26')](_0x5b2558[_0x4feb('0x27')]);if(_0x5b2558[_0x4feb('0x28')]){delete _0x5b2558[_0x4feb('0x28')];}_0x450f6b[_0x4feb('0x16')](_0x3ab9f3)[_0x4feb('0x29')](_0x5b2558);};}exports['index']=function(_0x50c2e8,_0x3ca2fa){var _0x58bccc={},_0x4d9831={},_0x355f06={'count':0x0,'rows':[]};var _0x4d1b42=_['map'](db['SquareOdbc'][_0x4feb('0x2a')],function(_0x33938d){return{'name':_0x33938d[_0x4feb('0x2b')],'type':_0x33938d[_0x4feb('0x2c')]['key']};});_0x4d9831[_0x4feb('0x2d')]=_[_0x4feb('0x2e')](_0x4d1b42,'name');_0x4d9831[_0x4feb('0x2f')]=_[_0x4feb('0x30')](_0x50c2e8[_0x4feb('0x2f')]);_0x4d9831[_0x4feb('0x31')]=_[_0x4feb('0x32')](_0x4d9831[_0x4feb('0x2d')],_0x4d9831[_0x4feb('0x2f')]);_0x58bccc[_0x4feb('0x33')]=_[_0x4feb('0x32')](_0x4d9831[_0x4feb('0x2d')],qs[_0x4feb('0x34')](_0x50c2e8[_0x4feb('0x2f')][_0x4feb('0x34')]));_0x58bccc[_0x4feb('0x33')]=_0x58bccc[_0x4feb('0x33')][_0x4feb('0x35')]?_0x58bccc[_0x4feb('0x33')]:_0x4d9831[_0x4feb('0x2d')];if(!_0x50c2e8[_0x4feb('0x2f')][_0x4feb('0x36')](_0x4feb('0x37'))){_0x58bccc[_0x4feb('0x1a')]=qs[_0x4feb('0x1a')](_0x50c2e8[_0x4feb('0x2f')]['limit']);_0x58bccc[_0x4feb('0x18')]=qs['offset'](_0x50c2e8['query'][_0x4feb('0x18')]);}_0x58bccc[_0x4feb('0x38')]=qs['sort'](_0x50c2e8[_0x4feb('0x2f')]['sort']);_0x58bccc[_0x4feb('0x39')]=qs[_0x4feb('0x31')](_[_0x4feb('0x3a')](_0x50c2e8[_0x4feb('0x2f')],_0x4d9831['filters']),_0x4d1b42);if(_0x50c2e8[_0x4feb('0x2f')]['filter']){_0x58bccc[_0x4feb('0x39')]=_[_0x4feb('0x3b')](_0x58bccc['where'],{'$or':_['map'](_0x4d1b42,function(_0x25f1c7){if(_0x25f1c7[_0x4feb('0x2c')]!==_0x4feb('0x3c')){var _0x5af34d={};_0x5af34d[_0x25f1c7[_0x4feb('0x28')]]={'$like':'%'+_0x50c2e8[_0x4feb('0x2f')][_0x4feb('0x3d')]+'%'};return _0x5af34d;}})});}_0x58bccc=_[_0x4feb('0x3b')]({},_0x58bccc,_0x50c2e8[_0x4feb('0x3e')]);var _0x21f918={'where':_0x58bccc[_0x4feb('0x39')]};return db[_0x4feb('0x3f')]['count'](_0x21f918)[_0x4feb('0x20')](function(_0x504275){_0x355f06['count']=_0x504275;if(_0x50c2e8['query'][_0x4feb('0x40')]){_0x58bccc[_0x4feb('0x41')]=[{'all':!![]}];}return db['SquareOdbc'][_0x4feb('0x42')](_0x58bccc);})[_0x4feb('0x20')](function(_0x5ebba7){_0x355f06[_0x4feb('0x43')]=_0x5ebba7;return _0x355f06;})['then'](respondWithFilteredResult(_0x3ca2fa,_0x58bccc))['catch'](handleError(_0x3ca2fa,null));};exports[_0x4feb('0x44')]=function(_0x158d43,_0x2c302f){var _0x5e5cba={'raw':!![],'where':{'id':_0x158d43[_0x4feb('0x45')]['id']}},_0x4da4f2={};_0x4da4f2[_0x4feb('0x2d')]=_[_0x4feb('0x30')](db[_0x4feb('0x3f')]['rawAttributes']);_0x4da4f2[_0x4feb('0x2f')]=_[_0x4feb('0x30')](_0x158d43[_0x4feb('0x2f')]);_0x4da4f2[_0x4feb('0x31')]=_[_0x4feb('0x32')](_0x4da4f2['model'],_0x4da4f2[_0x4feb('0x2f')]);_0x5e5cba[_0x4feb('0x33')]=_[_0x4feb('0x32')](_0x4da4f2[_0x4feb('0x2d')],qs['fields'](_0x158d43['query'][_0x4feb('0x34')]));_0x5e5cba[_0x4feb('0x33')]=_0x5e5cba[_0x4feb('0x33')][_0x4feb('0x35')]?_0x5e5cba[_0x4feb('0x33')]:_0x4da4f2['model'];if(_0x158d43[_0x4feb('0x2f')]['includeAll']){_0x5e5cba[_0x4feb('0x41')]=[{'all':!![]}];}_0x5e5cba=_['merge']({},_0x5e5cba,_0x158d43['options']);return db[_0x4feb('0x3f')]['find'](_0x5e5cba)[_0x4feb('0x20')](handleEntityNotFound(_0x2c302f,null))[_0x4feb('0x20')](respondWithResult(_0x2c302f,null))['catch'](handleError(_0x2c302f,null));};exports[_0x4feb('0x46')]=function(_0x3a4383,_0x95157c){return db[_0x4feb('0x3f')][_0x4feb('0x46')](_0x3a4383[_0x4feb('0x47')],{})[_0x4feb('0x20')](function(_0x18aeb1){var _0x21c56f=_0x3a4383[_0x4feb('0x48')][_0x4feb('0x22')]({'plain':!![]});if(!_0x21c56f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21c56f['role']===_0x4feb('0x48')){var _0x436aea=_0x18aeb1[_0x4feb('0x22')]({'plain':!![]});var _0x34c23f='ODBC';return db[_0x4feb('0x49')][_0x4feb('0x4a')]({'where':{'name':_0x34c23f,'userProfileId':_0x21c56f[_0x4feb('0x4b')]},'raw':!![]})['then'](function(_0x303d75){if(_0x303d75&&_0x303d75[_0x4feb('0x4c')]===0x0){return db[_0x4feb('0x24')][_0x4feb('0x46')]({'name':_0x436aea[_0x4feb('0x28')],'resourceId':_0x436aea['id'],'type':_0x303d75['name'],'sectionId':_0x303d75['id']},{})[_0x4feb('0x20')](function(){return _0x18aeb1;});}else{return _0x18aeb1;}})[_0x4feb('0x4d')](function(_0x1ea617){logger[_0x4feb('0x26')](_0x4feb('0x4e'),_0x1ea617);throw _0x1ea617;});}return _0x18aeb1;})[_0x4feb('0x20')](respondWithResult(_0x95157c,0xc9))[_0x4feb('0x4d')](handleError(_0x95157c,null));};exports[_0x4feb('0x1f')]=function(_0x4f0e0a,_0x2b76a3){if(_0x4f0e0a[_0x4feb('0x47')]['id']){delete _0x4f0e0a[_0x4feb('0x47')]['id'];}return db[_0x4feb('0x3f')]['find']({'where':{'id':_0x4f0e0a[_0x4feb('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b76a3,null))['then'](saveUpdates(_0x4f0e0a[_0x4feb('0x47')],null))[_0x4feb('0x20')](respondWithResult(_0x2b76a3,null))['catch'](handleError(_0x2b76a3,null));};exports['destroy']=function(_0x4d2ac6,_0x151033){return db[_0x4feb('0x3f')]['find']({'where':{'id':_0x4d2ac6[_0x4feb('0x45')]['id']}})[_0x4feb('0x20')](handleEntityNotFound(_0x151033,null))[_0x4feb('0x20')](removeEntity(_0x151033,null))['catch'](handleError(_0x151033,null));};exports[_0x4feb('0x4f')]=function(_0x1afb12,_0x6a6492,_0x1a2d3d){var _0x17b70f;return db[_0x4feb('0x3f')][_0x4feb('0x4a')]({'where':{'id':_0x1afb12[_0x4feb('0x45')]['id']},'attributes':['id','dsn']})[_0x4feb('0x20')](handleEntityNotFound(_0x6a6492,null))[_0x4feb('0x20')](function(_0x26869d){if(_0x26869d){var _0x1170cc=require(_0x4feb('0x50'))();_0x1170cc[_0x4feb('0x51')](_0x26869d[_0x4feb('0x52')]);_0x1170cc['closeSync']();return _0x26869d;}})[_0x4feb('0x20')](respondWithResult(_0x6a6492,null))[_0x4feb('0x4d')](handleError(_0x6a6492,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 02b273b..35e80b9 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 _0xb056=['api','moment','request-promise','../../config/environment','./squareOdbc.attributes','exports','lodash','util','../../config/logger'];(function(_0xedfbda,_0x427b63){var _0xbdb66=function(_0x37f46b){while(--_0x37f46b){_0xedfbda['push'](_0xedfbda['shift']());}};_0xbdb66(++_0x427b63);}(_0xb056,0x1da));var _0x6b05=function(_0x57744a,_0x1759eb){_0x57744a=_0x57744a-0x0;var _0x38d3fa=_0xb056[_0x57744a];return _0x38d3fa;};'use strict';var _=require(_0x6b05('0x0'));var util=require(_0x6b05('0x1'));var logger=require(_0x6b05('0x2'))(_0x6b05('0x3'));var moment=require(_0x6b05('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b05('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b05('0x6'));var attributes=require(_0x6b05('0x7'));module[_0x6b05('0x8')]=function(_0x5576f2,_0x2fb671){return _0x5576f2['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec96=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0xec96,0x102));var _0x6ec9=function(_0xbbd378,_0x501983){_0xbbd378=_0xbbd378-0x0;var _0x28de85=_0xec96[_0xbbd378];return _0x28de85;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var logger=require(_0x6ec9('0x2'))('api');var moment=require(_0x6ec9('0x3'));var BPromise=require(_0x6ec9('0x4'));var rp=require(_0x6ec9('0x5'));var fs=require('fs');var path=require(_0x6ec9('0x6'));var rimraf=require(_0x6ec9('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ec9('0x8'));module[_0x6ec9('0x9')]=function(_0x46122c,_0x54c7d6){return _0x46122c[_0x6ec9('0xa')](_0x6ec9('0xb'),attributes,{'tableName':_0x6ec9('0xc'),'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 75edfdb..637ff51 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 _0x9bca=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x9bca,0x1d1));var _0xa9bc=function(_0xd0f029,_0x181ef9){_0xd0f029=_0xd0f029-0x0;var _0x51b539=_0x9bca[_0xd0f029];return _0x51b539;};'use strict';var _=require('lodash');var util=require(_0xa9bc('0x0'));var moment=require('moment');var BPromise=require(_0xa9bc('0x1'));var rs=require(_0xa9bc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9bc('0x3'))['db'];var utils=require(_0xa9bc('0x4'));var logger=require('../../config/logger')(_0xa9bc('0x5'));var config=require(_0xa9bc('0x6'));var jayson=require(_0xa9bc('0x7'));var client=jayson[_0xa9bc('0x8')][_0xa9bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1ac3,_0x1c804e,_0x1c29ce){return new BPromise(function(_0x388b07,_0x4a679f){return client[_0xa9bc('0xa')](_0x4a1ac3,_0x1c29ce)[_0xa9bc('0xb')](function(_0x51a8e4){logger['info'](_0xa9bc('0xc'),_0x1c804e,_0xa9bc('0xd'));logger[_0xa9bc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1c804e,_0xa9bc('0xd'),JSON['stringify'](_0x51a8e4));if(_0x51a8e4['error']){if(_0x51a8e4[_0xa9bc('0xf')]['code']===0x1f4){logger[_0xa9bc('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1c804e,_0x51a8e4['error']['message']);return _0x4a679f(_0x51a8e4[_0xa9bc('0xf')]['message']);}logger[_0xa9bc('0xf')](_0xa9bc('0xc'),_0x1c804e,_0x51a8e4[_0xa9bc('0xf')]['message']);return _0x388b07(_0x51a8e4[_0xa9bc('0xf')][_0xa9bc('0x10')]);}else{logger[_0xa9bc('0x11')](_0xa9bc('0xc'),_0x1c804e,_0xa9bc('0xd'));_0x388b07(_0x51a8e4[_0xa9bc('0x12')][_0xa9bc('0x10')]);}})[_0xa9bc('0x13')](function(_0x564e83){logger[_0xa9bc('0xf')](_0xa9bc('0xc'),_0x1c804e,_0x564e83);_0x4a679f(_0x564e83);});});}exports[_0xa9bc('0x14')]=function(_0x42a04d){var _0x40c0c7=this;return new Promise(function(_0xc9db69,_0x9f9e63){return db[_0xa9bc('0x15')][_0xa9bc('0x16')]({'raw':_0x42a04d[_0xa9bc('0x17')]?_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x18')]===undefined?!![]:![]:!![],'where':_0x42a04d['options']?_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x19')]||null:null,'attributes':_0x42a04d[_0xa9bc('0x17')]?_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x1a')]||null:null,'include':_0x42a04d[_0xa9bc('0x17')]?_0x42a04d[_0xa9bc('0x17')]['include']?_[_0xa9bc('0x1b')](_0x42a04d[_0xa9bc('0x17')][_0xa9bc('0x1c')],function(_0xc31076){return{'model':db[_0xc31076[_0xa9bc('0x1d')]],'as':_0xc31076['as'],'attributes':_0xc31076[_0xa9bc('0x1a')],'include':_0xc31076[_0xa9bc('0x1c')]?_[_0xa9bc('0x1b')](_0xc31076[_0xa9bc('0x1c')],function(_0x144ac8){return{'model':db[_0x144ac8['model']],'as':_0x144ac8['as'],'attributes':_0x144ac8[_0xa9bc('0x1a')],'include':_0x144ac8[_0xa9bc('0x1c')]?_[_0xa9bc('0x1b')](_0x144ac8['include'],function(_0x334a5b){return{'model':db[_0x334a5b['model']],'as':_0x334a5b['as'],'attributes':_0x334a5b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9bc('0xb')](function(_0x31b884){logger[_0xa9bc('0x11')](_0xa9bc('0x14'),_0x42a04d);logger[_0xa9bc('0xe')](_0xa9bc('0x14'),_0x42a04d,JSON[_0xa9bc('0x1e')](_0x31b884));_0xc9db69(_0x31b884);})[_0xa9bc('0x13')](function(_0xc79c6e){logger[_0xa9bc('0xf')](_0xa9bc('0x14'),_0xc79c6e[_0xa9bc('0x10')],_0x42a04d);_0x9f9e63(_0x40c0c7[_0xa9bc('0xf')](0x1f4,_0xc79c6e['message']));});});}; \ No newline at end of file +var _0x29a3=['error','code','message','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x423353,_0x5956be){var _0x5330ac=function(_0x1f4599){while(--_0x1f4599){_0x423353['push'](_0x423353['shift']());}};_0x5330ac(++_0x5956be);}(_0x29a3,0x14f));var _0x329a=function(_0x53da0f,_0x142ae4){_0x53da0f=_0x53da0f-0x0;var _0x56d563=_0x29a3[_0x53da0f];return _0x56d563;};'use strict';var _=require(_0x329a('0x0'));var util=require(_0x329a('0x1'));var moment=require(_0x329a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x329a('0x3'))['db'];var utils=require(_0x329a('0x4'));var logger=require(_0x329a('0x5'))(_0x329a('0x6'));var config=require(_0x329a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x329a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a659d,_0x51bd47,_0x3d590c){return new BPromise(function(_0x27ba99,_0x512dae){return client[_0x329a('0x9')](_0x2a659d,_0x3d590c)[_0x329a('0xa')](function(_0x56ab86){logger[_0x329a('0xb')](_0x329a('0xc'),_0x51bd47,_0x329a('0xd'));logger[_0x329a('0xe')](_0x329a('0xf'),_0x51bd47,_0x329a('0xd'),JSON[_0x329a('0x10')](_0x56ab86));if(_0x56ab86[_0x329a('0x11')]){if(_0x56ab86['error'][_0x329a('0x12')]===0x1f4){logger[_0x329a('0x11')](_0x329a('0xc'),_0x51bd47,_0x56ab86[_0x329a('0x11')]['message']);return _0x512dae(_0x56ab86[_0x329a('0x11')][_0x329a('0x13')]);}logger[_0x329a('0x11')](_0x329a('0xc'),_0x51bd47,_0x56ab86['error'][_0x329a('0x13')]);return _0x27ba99(_0x56ab86['error'][_0x329a('0x13')]);}else{logger[_0x329a('0xb')](_0x329a('0xc'),_0x51bd47,'request\x20sent');_0x27ba99(_0x56ab86[_0x329a('0x14')]['message']);}})[_0x329a('0x15')](function(_0x5bd966){logger['error'](_0x329a('0xc'),_0x51bd47,_0x5bd966);_0x512dae(_0x5bd966);});});}exports['ShowSquareOdbc']=function(_0x587ab2){var _0xf390fe=this;return new Promise(function(_0x57396a,_0x238dcc){return db[_0x329a('0x16')][_0x329a('0x17')]({'raw':_0x587ab2[_0x329a('0x18')]?_0x587ab2[_0x329a('0x18')][_0x329a('0x19')]===undefined?!![]:![]:!![],'where':_0x587ab2[_0x329a('0x18')]?_0x587ab2['options'][_0x329a('0x1a')]||null:null,'attributes':_0x587ab2[_0x329a('0x18')]?_0x587ab2[_0x329a('0x18')][_0x329a('0x1b')]||null:null,'include':_0x587ab2[_0x329a('0x18')]?_0x587ab2[_0x329a('0x18')][_0x329a('0x1c')]?_[_0x329a('0x1d')](_0x587ab2['options']['include'],function(_0x18d774){return{'model':db[_0x18d774[_0x329a('0x1e')]],'as':_0x18d774['as'],'attributes':_0x18d774[_0x329a('0x1b')],'include':_0x18d774[_0x329a('0x1c')]?_[_0x329a('0x1d')](_0x18d774[_0x329a('0x1c')],function(_0x1620cb){return{'model':db[_0x1620cb['model']],'as':_0x1620cb['as'],'attributes':_0x1620cb[_0x329a('0x1b')],'include':_0x1620cb[_0x329a('0x1c')]?_['map'](_0x1620cb[_0x329a('0x1c')],function(_0x532371){return{'model':db[_0x532371[_0x329a('0x1e')]],'as':_0x532371['as'],'attributes':_0x532371[_0x329a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f6aa3){logger['info'](_0x329a('0x1f'),_0x587ab2);logger[_0x329a('0xe')](_0x329a('0x1f'),_0x587ab2,JSON[_0x329a('0x10')](_0x2f6aa3));_0x57396a(_0x2f6aa3);})[_0x329a('0x15')](function(_0x11110e){logger[_0x329a('0x11')]('ShowSquareOdbc',_0x11110e[_0x329a('0x13')],_0x587ab2);_0x238dcc(_0xf390fe[_0x329a('0x11')](0x1f4,_0x11110e[_0x329a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 87aee60..1f70f34 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 _0x7ebf=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','post','put'];(function(_0x11487e,_0x2695cd){var _0x3bb686=function(_0x3029de){while(--_0x3029de){_0x11487e['push'](_0x11487e['shift']());}};_0x3bb686(++_0x2695cd);}(_0x7ebf,0x153));var _0xf7eb=function(_0x2cdfe9,_0x5d833a){_0x2cdfe9=_0x2cdfe9-0x0;var _0x5c2490=_0x7ebf[_0x2cdfe9];return _0x5c2490;};'use strict';var multer=require(_0xf7eb('0x0'));var util=require(_0xf7eb('0x1'));var path=require('path');var timeout=require(_0xf7eb('0x2'));var express=require(_0xf7eb('0x3'));var router=express[_0xf7eb('0x4')]();var fs_extra=require(_0xf7eb('0x5'));var auth=require(_0xf7eb('0x6'));var interaction=require(_0xf7eb('0x7'));var config=require(_0xf7eb('0x8'));var controller=require(_0xf7eb('0x9'));router[_0xf7eb('0xa')]('/',auth['isAuthenticated'](),controller[_0xf7eb('0xb')]);router[_0xf7eb('0xa')](_0xf7eb('0xc'),auth[_0xf7eb('0xd')](),controller[_0xf7eb('0xe')]);router[_0xf7eb('0xa')](_0xf7eb('0xf'),auth[_0xf7eb('0xd')](),controller['getUsers']);router[_0xf7eb('0x10')]('/',auth[_0xf7eb('0xd')](),controller['create']);router['post'](_0xf7eb('0xf'),auth['isAuthenticated'](),controller['addUsers']);router[_0xf7eb('0x11')](_0xf7eb('0xc'),auth['isAuthenticated'](),controller[_0xf7eb('0x12')]);router[_0xf7eb('0x13')]('/:id',auth[_0xf7eb('0xd')](),controller['destroy']);router['delete'](_0xf7eb('0xf'),auth[_0xf7eb('0xd')](),controller['removeUsers']);module[_0xf7eb('0x14')]=router; \ No newline at end of file +var _0xf9f4=['../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','post','create','/:id/users','addUsers','put','update','delete','destroy','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf9f4,0x70));var _0x4f9f=function(_0x2a47cc,_0x49f366){_0x2a47cc=_0x2a47cc-0x0;var _0x361186=_0xf9f4[_0x2a47cc];return _0x361186;};'use strict';var multer=require(_0x4f9f('0x0'));var util=require('util');var path=require(_0x4f9f('0x1'));var timeout=require(_0x4f9f('0x2'));var express=require(_0x4f9f('0x3'));var router=express[_0x4f9f('0x4')]();var fs_extra=require(_0x4f9f('0x5'));var auth=require(_0x4f9f('0x6'));var interaction=require(_0x4f9f('0x7'));var config=require(_0x4f9f('0x8'));var controller=require(_0x4f9f('0x9'));router[_0x4f9f('0xa')]('/',auth[_0x4f9f('0xb')](),controller['index']);router['get'](_0x4f9f('0xc'),auth['isAuthenticated'](),controller[_0x4f9f('0xd')]);router['get']('/:id/users',auth[_0x4f9f('0xb')](),controller['getUsers']);router[_0x4f9f('0xe')]('/',auth[_0x4f9f('0xb')](),controller[_0x4f9f('0xf')]);router['post'](_0x4f9f('0x10'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x11')]);router[_0x4f9f('0x12')](_0x4f9f('0xc'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x13')]);router[_0x4f9f('0x14')](_0x4f9f('0xc'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x15')]);router['delete'](_0x4f9f('0x10'),auth[_0x4f9f('0xb')](),controller[_0x4f9f('0x16')]);module[_0x4f9f('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 41590cc..b67ad75 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 _0xc52c=['preproduction','toString','production','DATE','sequelize','exports','STRING','BLOB','getDataValue'];(function(_0x283487,_0x16b3e5){var _0x5cd831=function(_0x1dee6c){while(--_0x1dee6c){_0x283487['push'](_0x283487['shift']());}};_0x5cd831(++_0x16b3e5);}(_0xc52c,0x124));var _0xcc52=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0xc52c[_0x3f4f3b];return _0xfc6f02;};'use strict';var Sequelize=require(_0xcc52('0x0'));module[_0xcc52('0x1')]={'name':{'type':Sequelize[_0xcc52('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcc52('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xcc52('0x3')]('long'),'get':function(){if(this[_0xcc52('0x4')](_0xcc52('0x5'))){return this[_0xcc52('0x4')]('preproduction')[_0xcc52('0x6')]('utf8');}}},'production':{'type':Sequelize[_0xcc52('0x3')]('long'),'get':function(){if(this[_0xcc52('0x4')](_0xcc52('0x7'))){return this['getDataValue'](_0xcc52('0x7'))['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xcc52('0x8')]}}; \ No newline at end of file +var _0xe824=['STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe824,0x1c2));var _0x4e82=function(_0x4fe93e,_0x44f9e2){_0x4fe93e=_0x4fe93e-0x0;var _0x5f1d5a=_0xe824[_0x4fe93e];return _0x5f1d5a;};'use strict';var Sequelize=require(_0x4e82('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4e82('0x1')]},'notes':{'type':Sequelize[_0x4e82('0x2')]},'preproduction':{'type':Sequelize[_0x4e82('0x3')](_0x4e82('0x4')),'get':function(){if(this[_0x4e82('0x5')]('preproduction')){return this[_0x4e82('0x5')](_0x4e82('0x6'))[_0x4e82('0x7')](_0x4e82('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x4e82('0x5')](_0x4e82('0x9'))){return this[_0x4e82('0x5')](_0x4e82('0x9'))['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x4e82('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ce0f0c2..410895e 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 _0x46b7=['order','filter','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','stack','name','send','map','SquareProject','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','User'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x46b7,0x1d3));var _0x746b=function(_0x352a13,_0x172aa9){_0x352a13=_0x352a13-0x0;var _0x553856=_0x46b7[_0x352a13];return _0x553856;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x746b('0x0'));var jsonpatch=require(_0x746b('0x1'));var rp=require(_0x746b('0x2'));var moment=require(_0x746b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x746b('0x4'));var util=require('util');var path=require(_0x746b('0x5'));var sox=require('sox');var csv=require(_0x746b('0x6'));var ejs=require(_0x746b('0x7'));var fs=require('fs');var fs_extra=require(_0x746b('0x8'));var _=require(_0x746b('0x9'));var squel=require('squel');var crypto=require(_0x746b('0xa'));var jsforce=require(_0x746b('0xb'));var deskjs=require(_0x746b('0xc'));var toCsv=require(_0x746b('0x6'));var querystring=require(_0x746b('0xd'));var Papa=require('papaparse');var Redis=require(_0x746b('0xe'));var authService=require(_0x746b('0xf'));var qs=require(_0x746b('0x10'));var as=require(_0x746b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x746b('0x12'))(_0x746b('0x13'));var utils=require(_0x746b('0x14'));var config=require(_0x746b('0x15'));var licenseUtil=require(_0x746b('0x16'));var db=require(_0x746b('0x17'))['db'];config[_0x746b('0x18')]=_[_0x746b('0x19')](config[_0x746b('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x746b('0x18')]));require('./squareProject.socket')[_0x746b('0x1a')](socket);function respondWithStatusCode(_0x467f5f,_0x8c86b){_0x8c86b=_0x8c86b||0xcc;return function(_0x301305){if(_0x301305){return _0x467f5f['sendStatus'](_0x8c86b);}return _0x467f5f['status'](_0x8c86b)['end']();};}function respondWithResult(_0x20211c,_0x114d69){_0x114d69=_0x114d69||0xc8;return function(_0x5c68fe){if(_0x5c68fe){return _0x20211c[_0x746b('0x1b')](_0x114d69)['json'](_0x5c68fe);}};}function respondWithFilteredResult(_0x37fe5c,_0x32ace4){return function(_0x1cae4c){if(_0x1cae4c){var _0x495903=typeof _0x32ace4['offset']===_0x746b('0x1c')&&typeof _0x32ace4[_0x746b('0x1d')]===_0x746b('0x1c');var _0x38b2d3=_0x1cae4c[_0x746b('0x1e')];var _0x485608=_0x495903?0x0:_0x32ace4[_0x746b('0x1f')];var _0x3d43d5=_0x495903?_0x1cae4c[_0x746b('0x1e')]:_0x32ace4[_0x746b('0x1f')]+_0x32ace4[_0x746b('0x1d')];var _0x5dcb95;if(_0x3d43d5>=_0x38b2d3){_0x3d43d5=_0x38b2d3;_0x5dcb95=0xc8;}else{_0x5dcb95=0xce;}_0x37fe5c[_0x746b('0x1b')](_0x5dcb95);return _0x37fe5c[_0x746b('0x20')](_0x746b('0x21'),_0x485608+'-'+_0x3d43d5+'/'+_0x38b2d3)[_0x746b('0x22')](_0x1cae4c);}return null;};}function patchUpdates(_0x19d078){return function(_0x256236){try{jsonpatch[_0x746b('0x23')](_0x256236,_0x19d078,!![]);}catch(_0xe36a23){return BPromise['reject'](_0xe36a23);}return _0x256236[_0x746b('0x24')]();};}function saveUpdates(_0x2594af,_0x244e92){return function(_0x5a2bde){if(_0x5a2bde){return _0x5a2bde[_0x746b('0x25')](_0x2594af)[_0x746b('0x26')](function(_0xf98686){return _0xf98686;});}return null;};}function removeEntity(_0x1e43a1,_0x2edb7a){return function(_0x1bec8e){if(_0x1bec8e){return _0x1bec8e[_0x746b('0x27')]()['then'](function(){var _0x47d247=_0x1bec8e['get']({'plain':!![]});var _0x28619d='SquareProjects';return db[_0x746b('0x28')]['destroy']({'where':{'type':_0x28619d,'resourceId':_0x47d247['id']}})[_0x746b('0x26')](function(){return _0x1bec8e;});})['then'](function(){_0x1e43a1[_0x746b('0x1b')](0xcc)[_0x746b('0x29')]();});}};}function handleEntityNotFound(_0x55bf54,_0x4fb961){return function(_0x30cdba){if(!_0x30cdba){_0x55bf54[_0x746b('0x2a')](0x194);}return _0x30cdba;};}function handleError(_0x106891,_0x4463e2){_0x4463e2=_0x4463e2||0x1f4;return function(_0x2754af){logger['error'](_0x2754af[_0x746b('0x2b')]);if(_0x2754af[_0x746b('0x2c')]){delete _0x2754af['name'];}_0x106891[_0x746b('0x1b')](_0x4463e2)[_0x746b('0x2d')](_0x2754af);};}exports['index']=function(_0x109877,_0x55226c){var _0x3a60e9={},_0x200632={},_0x239faf={'count':0x0,'rows':[]};var _0x5f0b5e=_[_0x746b('0x2e')](db[_0x746b('0x2f')][_0x746b('0x30')],function(_0x52bf0a){return{'name':_0x52bf0a['fieldName'],'type':_0x52bf0a['type'][_0x746b('0x31')]};});_0x200632[_0x746b('0x32')]=_[_0x746b('0x2e')](_0x5f0b5e,_0x746b('0x2c'));_0x200632[_0x746b('0x33')]=_[_0x746b('0x34')](_0x109877[_0x746b('0x33')]);_0x200632[_0x746b('0x35')]=_[_0x746b('0x36')](_0x200632[_0x746b('0x32')],_0x200632[_0x746b('0x33')]);_0x3a60e9[_0x746b('0x37')]=_[_0x746b('0x36')](_0x200632[_0x746b('0x32')],qs[_0x746b('0x38')](_0x109877['query'][_0x746b('0x38')]));_0x3a60e9[_0x746b('0x37')]=_0x3a60e9[_0x746b('0x37')][_0x746b('0x39')]?_0x3a60e9['attributes']:_0x200632['model'];if(!_0x109877[_0x746b('0x33')][_0x746b('0x3a')](_0x746b('0x3b'))){_0x3a60e9['limit']=qs[_0x746b('0x1d')](_0x109877['query'][_0x746b('0x1d')]);_0x3a60e9[_0x746b('0x1f')]=qs[_0x746b('0x1f')](_0x109877['query']['offset']);}_0x3a60e9['order']=qs[_0x746b('0x3c')](_0x109877[_0x746b('0x33')][_0x746b('0x3c')]);_0x3a60e9[_0x746b('0x3d')]=qs['filters'](_[_0x746b('0x3e')](_0x109877[_0x746b('0x33')],_0x200632[_0x746b('0x35')]),_0x5f0b5e);if(_0x109877[_0x746b('0x33')]['filter']){_0x3a60e9[_0x746b('0x3d')]=_[_0x746b('0x3f')](_0x3a60e9[_0x746b('0x3d')],{'$or':_[_0x746b('0x2e')](_0x5f0b5e,function(_0x17f14f){if(_0x17f14f[_0x746b('0x40')]!==_0x746b('0x41')){var _0x56137c={};_0x56137c[_0x17f14f['name']]={'$like':'%'+_0x109877[_0x746b('0x33')]['filter']+'%'};return _0x56137c;}})});}_0x3a60e9=_[_0x746b('0x3f')]({},_0x3a60e9,_0x109877[_0x746b('0x42')]);var _0x57a5cc={'where':_0x3a60e9[_0x746b('0x3d')]};return db[_0x746b('0x2f')][_0x746b('0x1e')](_0x57a5cc)[_0x746b('0x26')](function(_0x164b73){_0x239faf['count']=_0x164b73;if(_0x109877[_0x746b('0x33')][_0x746b('0x43')]){_0x3a60e9[_0x746b('0x44')]=[{'all':!![]}];}return db[_0x746b('0x2f')][_0x746b('0x45')](_0x3a60e9);})[_0x746b('0x26')](function(_0x134ffb){_0x239faf[_0x746b('0x46')]=_0x134ffb;return _0x239faf;})[_0x746b('0x26')](respondWithFilteredResult(_0x55226c,_0x3a60e9))[_0x746b('0x47')](handleError(_0x55226c,null));};exports[_0x746b('0x48')]=function(_0x16b634,_0x17021e){var _0xc1d5cf={'raw':![],'where':{'id':_0x16b634[_0x746b('0x49')]['id']}},_0x4ad9e8={};_0x4ad9e8[_0x746b('0x32')]=_[_0x746b('0x34')](db[_0x746b('0x2f')][_0x746b('0x30')]);_0x4ad9e8['query']=_['keys'](_0x16b634['query']);_0x4ad9e8['filters']=_[_0x746b('0x36')](_0x4ad9e8[_0x746b('0x32')],_0x4ad9e8[_0x746b('0x33')]);_0xc1d5cf[_0x746b('0x37')]=_[_0x746b('0x36')](_0x4ad9e8['model'],qs['fields'](_0x16b634[_0x746b('0x33')][_0x746b('0x38')]));_0xc1d5cf['attributes']=_0xc1d5cf['attributes'][_0x746b('0x39')]?_0xc1d5cf[_0x746b('0x37')]:_0x4ad9e8[_0x746b('0x32')];if(_0x16b634[_0x746b('0x33')][_0x746b('0x43')]){_0xc1d5cf[_0x746b('0x44')]=[{'all':!![]}];}_0xc1d5cf=_[_0x746b('0x3f')]({},_0xc1d5cf,_0x16b634[_0x746b('0x42')]);return db[_0x746b('0x2f')][_0x746b('0x4a')](_0xc1d5cf)['then'](handleEntityNotFound(_0x17021e,null))[_0x746b('0x26')](respondWithResult(_0x17021e,null))[_0x746b('0x47')](handleError(_0x17021e,null));};exports[_0x746b('0x4b')]=function(_0x244160,_0x173a28){return db[_0x746b('0x2f')][_0x746b('0x4b')](_0x244160[_0x746b('0x4c')],{})[_0x746b('0x26')](function(_0x59b8ed){var _0x5cbd00=_0x244160['user'][_0x746b('0x4d')]({'plain':!![]});if(!_0x5cbd00)throw new Error(_0x746b('0x4e'));if(_0x5cbd00['role']==='user'){var _0x52d0ff=_0x59b8ed[_0x746b('0x4d')]({'plain':!![]});var _0x372a41=_0x746b('0x4f');return db[_0x746b('0x50')][_0x746b('0x4a')]({'where':{'name':_0x372a41,'userProfileId':_0x5cbd00['userProfileId']},'raw':!![]})[_0x746b('0x26')](function(_0x5ca6a0){if(_0x5ca6a0&&_0x5ca6a0[_0x746b('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x52d0ff[_0x746b('0x2c')],'resourceId':_0x52d0ff['id'],'type':_0x5ca6a0[_0x746b('0x2c')],'sectionId':_0x5ca6a0['id']},{})[_0x746b('0x26')](function(){return _0x59b8ed;});}else{return _0x59b8ed;}})['catch'](function(_0x4e15f4){logger['error'](_0x746b('0x52'),_0x4e15f4);throw _0x4e15f4;});}return _0x59b8ed;})[_0x746b('0x26')](respondWithResult(_0x173a28,0xc9))[_0x746b('0x47')](handleError(_0x173a28,null));};exports[_0x746b('0x25')]=function(_0x201066,_0x36e4f0){if(_0x201066[_0x746b('0x4c')]['id']){delete _0x201066[_0x746b('0x4c')]['id'];}return db[_0x746b('0x2f')][_0x746b('0x4a')]({'where':{'id':_0x201066[_0x746b('0x49')]['id']}})['then'](handleEntityNotFound(_0x36e4f0,null))[_0x746b('0x26')](saveUpdates(_0x201066[_0x746b('0x4c')],null))[_0x746b('0x26')](respondWithResult(_0x36e4f0,null))['catch'](handleError(_0x36e4f0,null));};exports[_0x746b('0x27')]=function(_0x2fd74e,_0x169036){return db['SquareProject'][_0x746b('0x4a')]({'where':{'id':_0x2fd74e[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x169036,null))[_0x746b('0x26')](removeEntity(_0x169036,null))['catch'](handleError(_0x169036,null));};exports[_0x746b('0x53')]=function(_0x396adf,_0x25c786,_0x42e665){return db[_0x746b('0x2f')]['find']({'where':{'id':_0x396adf[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x25c786,null))[_0x746b('0x26')](function(_0x3ca300){if(_0x3ca300){return _0x3ca300['addUsers'](_0x396adf['body'][_0x746b('0x54')],_[_0x746b('0x55')](_0x396adf[_0x746b('0x4c')],[_0x746b('0x54'),'id'])||{});}})[_0x746b('0x26')](respondWithResult(_0x25c786,null))[_0x746b('0x47')](handleError(_0x25c786,null));};exports['removeUsers']=function(_0x5416f6,_0x83f33f,_0x34abd7){return db[_0x746b('0x2f')][_0x746b('0x4a')]({'where':{'id':_0x5416f6[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x83f33f,null))[_0x746b('0x26')](function(_0x5e759b){if(_0x5e759b){return _0x5e759b[_0x746b('0x56')](_0x5416f6[_0x746b('0x33')][_0x746b('0x54')])[_0x746b('0x26')](function(){if(_['isArray'](_0x5416f6['query']['ids'])){for(var _0x4e9480=0x0;_0x4e9480<_0x5416f6[_0x746b('0x33')][_0x746b('0x54')][_0x746b('0x39')];_0x4e9480+=0x1){socket[_0x746b('0x57')](_0x746b('0x58'),{'UserId':Number(_0x5416f6[_0x746b('0x33')][_0x746b('0x54')][_0x4e9480]),'SquareProjectId':Number(_0x5416f6[_0x746b('0x49')]['id'])});}}else{socket[_0x746b('0x57')](_0x746b('0x58'),{'UserId':Number(_0x5416f6['query'][_0x746b('0x54')]),'SquareProjectId':Number(_0x5416f6[_0x746b('0x49')]['id'])});}});}})[_0x746b('0x26')](respondWithStatusCode(_0x83f33f,null))[_0x746b('0x47')](handleError(_0x83f33f,null));};exports[_0x746b('0x59')]=function(_0x59f53b,_0x4f87a7,_0x53a499){var _0xee6f1d={};var _0x3ef6b0={};var _0x18c19c;var _0x298a4d;return db[_0x746b('0x2f')]['findOne']({'where':{'id':_0x59f53b[_0x746b('0x49')]['id']}})[_0x746b('0x26')](handleEntityNotFound(_0x4f87a7,null))[_0x746b('0x26')](function(_0x46693c){if(_0x46693c){_0x18c19c=_0x46693c;_0x3ef6b0[_0x746b('0x32')]=_['keys'](db[_0x746b('0x5a')][_0x746b('0x30')]);_0x3ef6b0[_0x746b('0x33')]=_[_0x746b('0x34')](_0x59f53b[_0x746b('0x33')]);_0x3ef6b0['filters']=_[_0x746b('0x36')](_0x3ef6b0[_0x746b('0x32')],_0x3ef6b0['query']);_0xee6f1d[_0x746b('0x37')]=_[_0x746b('0x36')](_0x3ef6b0['model'],qs[_0x746b('0x38')](_0x59f53b[_0x746b('0x33')]['fields']));_0xee6f1d[_0x746b('0x37')]=_0xee6f1d[_0x746b('0x37')][_0x746b('0x39')]?_0xee6f1d[_0x746b('0x37')]:_0x3ef6b0[_0x746b('0x32')];_0xee6f1d[_0x746b('0x5b')]=qs[_0x746b('0x3c')](_0x59f53b[_0x746b('0x33')][_0x746b('0x3c')]);_0xee6f1d[_0x746b('0x3d')]=qs[_0x746b('0x35')](_[_0x746b('0x3e')](_0x59f53b['query'],_0x3ef6b0[_0x746b('0x35')]));if(_0x59f53b[_0x746b('0x33')][_0x746b('0x5c')]){_0xee6f1d['where']=_['merge'](_0xee6f1d[_0x746b('0x3d')],{'$or':_[_0x746b('0x2e')](_0xee6f1d['attributes'],function(_0x4ec717){var _0x2c6f5a={};_0x2c6f5a[_0x4ec717]={'$like':'%'+_0x59f53b[_0x746b('0x33')][_0x746b('0x5c')]+'%'};return _0x2c6f5a;})});}_0xee6f1d=_[_0x746b('0x3f')]({},_0xee6f1d,_0x59f53b['options']);return _0x18c19c[_0x746b('0x59')](_0xee6f1d);}})[_0x746b('0x26')](function(_0x4facfe){if(_0x4facfe){_0x298a4d=_0x4facfe['length'];if(!_0x59f53b[_0x746b('0x33')]['hasOwnProperty'](_0x746b('0x3b'))){_0xee6f1d[_0x746b('0x1d')]=qs[_0x746b('0x1d')](_0x59f53b[_0x746b('0x33')][_0x746b('0x1d')]);_0xee6f1d['offset']=qs[_0x746b('0x1f')](_0x59f53b['query'][_0x746b('0x1f')]);}return _0x18c19c[_0x746b('0x59')](_0xee6f1d);}})[_0x746b('0x26')](function(_0x2e6bd6){if(_0x2e6bd6){return _0x2e6bd6?{'count':_0x298a4d,'rows':_0x2e6bd6}:null;}})[_0x746b('0x26')](respondWithResult(_0x4f87a7,null))[_0x746b('0x47')](handleError(_0x4f87a7,null));}; \ No newline at end of file +var _0xd811=['limit','offset','count','Content-Range','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','SquareProject','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','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','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','end','json','undefined'];(function(_0x1504bb,_0x4f1e3f){var _0x5cfd4c=function(_0x44bc42){while(--_0x44bc42){_0x1504bb['push'](_0x1504bb['shift']());}};_0x5cfd4c(++_0x4f1e3f);}(_0xd811,0x1ca));var _0x1d81=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0xd811[_0x326d35];return _0xd3f8f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d81('0x0'));var zipdir=require(_0x1d81('0x1'));var jsonpatch=require(_0x1d81('0x2'));var rp=require(_0x1d81('0x3'));var moment=require(_0x1d81('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d81('0x5'));var path=require(_0x1d81('0x6'));var sox=require(_0x1d81('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d81('0x8'));var _=require(_0x1d81('0x9'));var squel=require(_0x1d81('0xa'));var crypto=require('crypto');var jsforce=require(_0x1d81('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1d81('0xc'));var querystring=require(_0x1d81('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1d81('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1d81('0xf'));var hardwareService=require(_0x1d81('0x10'));var logger=require(_0x1d81('0x11'))(_0x1d81('0x12'));var utils=require(_0x1d81('0x13'));var config=require(_0x1d81('0x14'));var licenseUtil=require(_0x1d81('0x15'));var db=require(_0x1d81('0x16'))['db'];config[_0x1d81('0x17')]=_[_0x1d81('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1d81('0x19'))(new Redis(config[_0x1d81('0x17')]));require(_0x1d81('0x1a'))[_0x1d81('0x1b')](socket);function respondWithStatusCode(_0x35584f,_0x21de2d){_0x21de2d=_0x21de2d||0xcc;return function(_0x51be8f){if(_0x51be8f){return _0x35584f['sendStatus'](_0x21de2d);}return _0x35584f[_0x1d81('0x1c')](_0x21de2d)[_0x1d81('0x1d')]();};}function respondWithResult(_0x6dd8ee,_0x47d1bb){_0x47d1bb=_0x47d1bb||0xc8;return function(_0x30d070){if(_0x30d070){return _0x6dd8ee[_0x1d81('0x1c')](_0x47d1bb)[_0x1d81('0x1e')](_0x30d070);}};}function respondWithFilteredResult(_0x5e3c51,_0x93e9d7){return function(_0x29e529){if(_0x29e529){var _0xd02abb=typeof _0x93e9d7['offset']===_0x1d81('0x1f')&&typeof _0x93e9d7[_0x1d81('0x20')]===_0x1d81('0x1f');var _0x356def=_0x29e529['count'];var _0x1e2740=_0xd02abb?0x0:_0x93e9d7[_0x1d81('0x21')];var _0x3039fb=_0xd02abb?_0x29e529[_0x1d81('0x22')]:_0x93e9d7['offset']+_0x93e9d7[_0x1d81('0x20')];var _0x47b2e6;if(_0x3039fb>=_0x356def){_0x3039fb=_0x356def;_0x47b2e6=0xc8;}else{_0x47b2e6=0xce;}_0x5e3c51[_0x1d81('0x1c')](_0x47b2e6);return _0x5e3c51['set'](_0x1d81('0x23'),_0x1e2740+'-'+_0x3039fb+'/'+_0x356def)['json'](_0x29e529);}return null;};}function patchUpdates(_0x7835f8){return function(_0xe8a491){try{jsonpatch['apply'](_0xe8a491,_0x7835f8,!![]);}catch(_0x260c08){return BPromise[_0x1d81('0x24')](_0x260c08);}return _0xe8a491[_0x1d81('0x25')]();};}function saveUpdates(_0x5760e6,_0x4cfb50){return function(_0x51d83f){if(_0x51d83f){return _0x51d83f[_0x1d81('0x26')](_0x5760e6)[_0x1d81('0x27')](function(_0x4835b1){return _0x4835b1;});}return null;};}function removeEntity(_0x139180,_0x1300a8){return function(_0xf61d30){if(_0xf61d30){return _0xf61d30['destroy']()[_0x1d81('0x27')](function(){var _0x2cd353=_0xf61d30[_0x1d81('0x28')]({'plain':!![]});var _0x46f21a=_0x1d81('0x29');return db[_0x1d81('0x2a')][_0x1d81('0x2b')]({'where':{'type':_0x46f21a,'resourceId':_0x2cd353['id']}})[_0x1d81('0x27')](function(){return _0xf61d30;});})[_0x1d81('0x27')](function(){_0x139180[_0x1d81('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385f35,_0x1a739a){return function(_0x5e4653){if(!_0x5e4653){_0x385f35[_0x1d81('0x2c')](0x194);}return _0x5e4653;};}function handleError(_0x349993,_0xfb40cc){_0xfb40cc=_0xfb40cc||0x1f4;return function(_0x5071b7){logger[_0x1d81('0x2d')](_0x5071b7[_0x1d81('0x2e')]);if(_0x5071b7[_0x1d81('0x2f')]){delete _0x5071b7[_0x1d81('0x2f')];}_0x349993[_0x1d81('0x1c')](_0xfb40cc)['send'](_0x5071b7);};}exports[_0x1d81('0x30')]=function(_0x1a9991,_0x21c132){var _0x2fcfff={},_0x4e4433={},_0x13fcbf={'count':0x0,'rows':[]};var _0x1df480=_[_0x1d81('0x31')](db[_0x1d81('0x32')][_0x1d81('0x33')],function(_0x104143){return{'name':_0x104143['fieldName'],'type':_0x104143[_0x1d81('0x34')][_0x1d81('0x35')]};});_0x4e4433[_0x1d81('0x36')]=_[_0x1d81('0x31')](_0x1df480,_0x1d81('0x2f'));_0x4e4433[_0x1d81('0x37')]=_[_0x1d81('0x38')](_0x1a9991['query']);_0x4e4433['filters']=_['intersection'](_0x4e4433[_0x1d81('0x36')],_0x4e4433['query']);_0x2fcfff[_0x1d81('0x39')]=_[_0x1d81('0x3a')](_0x4e4433[_0x1d81('0x36')],qs[_0x1d81('0x3b')](_0x1a9991[_0x1d81('0x37')][_0x1d81('0x3b')]));_0x2fcfff[_0x1d81('0x39')]=_0x2fcfff[_0x1d81('0x39')][_0x1d81('0x3c')]?_0x2fcfff[_0x1d81('0x39')]:_0x4e4433[_0x1d81('0x36')];if(!_0x1a9991[_0x1d81('0x37')][_0x1d81('0x3d')]('nolimit')){_0x2fcfff[_0x1d81('0x20')]=qs[_0x1d81('0x20')](_0x1a9991[_0x1d81('0x37')][_0x1d81('0x20')]);_0x2fcfff[_0x1d81('0x21')]=qs[_0x1d81('0x21')](_0x1a9991['query'][_0x1d81('0x21')]);}_0x2fcfff['order']=qs[_0x1d81('0x3e')](_0x1a9991[_0x1d81('0x37')][_0x1d81('0x3e')]);_0x2fcfff['where']=qs[_0x1d81('0x3f')](_[_0x1d81('0x40')](_0x1a9991['query'],_0x4e4433['filters']),_0x1df480);if(_0x1a9991['query'][_0x1d81('0x41')]){_0x2fcfff[_0x1d81('0x42')]=_[_0x1d81('0x43')](_0x2fcfff[_0x1d81('0x42')],{'$or':_[_0x1d81('0x31')](_0x1df480,function(_0x618926){if(_0x618926[_0x1d81('0x34')]!==_0x1d81('0x44')){var _0x1e6b2f={};_0x1e6b2f[_0x618926[_0x1d81('0x2f')]]={'$like':'%'+_0x1a9991[_0x1d81('0x37')]['filter']+'%'};return _0x1e6b2f;}})});}_0x2fcfff=_['merge']({},_0x2fcfff,_0x1a9991[_0x1d81('0x45')]);var _0x297ae8={'where':_0x2fcfff[_0x1d81('0x42')]};return db[_0x1d81('0x32')]['count'](_0x297ae8)['then'](function(_0xcc3130){_0x13fcbf['count']=_0xcc3130;if(_0x1a9991[_0x1d81('0x37')][_0x1d81('0x46')]){_0x2fcfff[_0x1d81('0x47')]=[{'all':!![]}];}return db[_0x1d81('0x32')]['findAll'](_0x2fcfff);})[_0x1d81('0x27')](function(_0x45c4ad){_0x13fcbf[_0x1d81('0x48')]=_0x45c4ad;return _0x13fcbf;})[_0x1d81('0x27')](respondWithFilteredResult(_0x21c132,_0x2fcfff))[_0x1d81('0x49')](handleError(_0x21c132,null));};exports[_0x1d81('0x4a')]=function(_0xe40eed,_0x3ad53a){var _0x49be5b={'raw':![],'where':{'id':_0xe40eed['params']['id']}},_0xce31b0={};_0xce31b0[_0x1d81('0x36')]=_[_0x1d81('0x38')](db['SquareProject'][_0x1d81('0x33')]);_0xce31b0['query']=_[_0x1d81('0x38')](_0xe40eed[_0x1d81('0x37')]);_0xce31b0[_0x1d81('0x3f')]=_[_0x1d81('0x3a')](_0xce31b0['model'],_0xce31b0[_0x1d81('0x37')]);_0x49be5b[_0x1d81('0x39')]=_[_0x1d81('0x3a')](_0xce31b0[_0x1d81('0x36')],qs['fields'](_0xe40eed[_0x1d81('0x37')][_0x1d81('0x3b')]));_0x49be5b['attributes']=_0x49be5b[_0x1d81('0x39')][_0x1d81('0x3c')]?_0x49be5b[_0x1d81('0x39')]:_0xce31b0[_0x1d81('0x36')];if(_0xe40eed['query'][_0x1d81('0x46')]){_0x49be5b[_0x1d81('0x47')]=[{'all':!![]}];}_0x49be5b=_['merge']({},_0x49be5b,_0xe40eed[_0x1d81('0x45')]);return db[_0x1d81('0x32')][_0x1d81('0x4b')](_0x49be5b)[_0x1d81('0x27')](handleEntityNotFound(_0x3ad53a,null))[_0x1d81('0x27')](respondWithResult(_0x3ad53a,null))[_0x1d81('0x49')](handleError(_0x3ad53a,null));};exports[_0x1d81('0x4c')]=function(_0x151ebc,_0x5c93e2){return db[_0x1d81('0x32')][_0x1d81('0x4c')](_0x151ebc[_0x1d81('0x4d')],{})[_0x1d81('0x27')](function(_0xc22766){var _0x4c300c=_0x151ebc[_0x1d81('0x4e')][_0x1d81('0x28')]({'plain':!![]});if(!_0x4c300c)throw new Error(_0x1d81('0x4f'));if(_0x4c300c[_0x1d81('0x50')]==='user'){var _0x5dcb24=_0xc22766[_0x1d81('0x28')]({'plain':!![]});var _0x163b15=_0x1d81('0x29');return db[_0x1d81('0x51')][_0x1d81('0x4b')]({'where':{'name':_0x163b15,'userProfileId':_0x4c300c[_0x1d81('0x52')]},'raw':!![]})[_0x1d81('0x27')](function(_0x53cacc){if(_0x53cacc&&_0x53cacc[_0x1d81('0x53')]===0x0){return db[_0x1d81('0x2a')][_0x1d81('0x4c')]({'name':_0x5dcb24[_0x1d81('0x2f')],'resourceId':_0x5dcb24['id'],'type':_0x53cacc[_0x1d81('0x2f')],'sectionId':_0x53cacc['id']},{})[_0x1d81('0x27')](function(){return _0xc22766;});}else{return _0xc22766;}})['catch'](function(_0x5293d0){logger[_0x1d81('0x2d')](_0x1d81('0x54'),_0x5293d0);throw _0x5293d0;});}return _0xc22766;})['then'](respondWithResult(_0x5c93e2,0xc9))[_0x1d81('0x49')](handleError(_0x5c93e2,null));};exports[_0x1d81('0x26')]=function(_0xf15ce2,_0x45f2ad){if(_0xf15ce2[_0x1d81('0x4d')]['id']){delete _0xf15ce2[_0x1d81('0x4d')]['id'];}return db['SquareProject'][_0x1d81('0x4b')]({'where':{'id':_0xf15ce2['params']['id']}})[_0x1d81('0x27')](handleEntityNotFound(_0x45f2ad,null))[_0x1d81('0x27')](saveUpdates(_0xf15ce2[_0x1d81('0x4d')],null))[_0x1d81('0x27')](respondWithResult(_0x45f2ad,null))['catch'](handleError(_0x45f2ad,null));};exports['destroy']=function(_0x419318,_0x89ba00){return db[_0x1d81('0x32')][_0x1d81('0x4b')]({'where':{'id':_0x419318[_0x1d81('0x55')]['id']}})[_0x1d81('0x27')](handleEntityNotFound(_0x89ba00,null))[_0x1d81('0x27')](removeEntity(_0x89ba00,null))[_0x1d81('0x49')](handleError(_0x89ba00,null));};exports[_0x1d81('0x56')]=function(_0xa05307,_0x198f23,_0x1a988a){return db[_0x1d81('0x32')][_0x1d81('0x4b')]({'where':{'id':_0xa05307[_0x1d81('0x55')]['id']}})['then'](handleEntityNotFound(_0x198f23,null))[_0x1d81('0x27')](function(_0x19b006){if(_0x19b006){return _0x19b006[_0x1d81('0x56')](_0xa05307['body'][_0x1d81('0x57')],_[_0x1d81('0x58')](_0xa05307[_0x1d81('0x4d')],[_0x1d81('0x57'),'id'])||{});}})[_0x1d81('0x27')](respondWithResult(_0x198f23,null))[_0x1d81('0x49')](handleError(_0x198f23,null));};exports[_0x1d81('0x59')]=function(_0x3d9ca7,_0x6b785b,_0x595227){return db['SquareProject'][_0x1d81('0x4b')]({'where':{'id':_0x3d9ca7[_0x1d81('0x55')]['id']}})['then'](handleEntityNotFound(_0x6b785b,null))['then'](function(_0x134130){if(_0x134130){return _0x134130['removeUsers'](_0x3d9ca7['query'][_0x1d81('0x57')])[_0x1d81('0x27')](function(){if(_[_0x1d81('0x5a')](_0x3d9ca7[_0x1d81('0x37')][_0x1d81('0x57')])){for(var _0x192c4a=0x0;_0x192c4a<_0x3d9ca7['query'][_0x1d81('0x57')][_0x1d81('0x3c')];_0x192c4a+=0x1){socket[_0x1d81('0x5b')](_0x1d81('0x5c'),{'UserId':Number(_0x3d9ca7[_0x1d81('0x37')][_0x1d81('0x57')][_0x192c4a]),'SquareProjectId':Number(_0x3d9ca7[_0x1d81('0x55')]['id'])});}}else{socket[_0x1d81('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x3d9ca7[_0x1d81('0x37')][_0x1d81('0x57')]),'SquareProjectId':Number(_0x3d9ca7[_0x1d81('0x55')]['id'])});}});}})[_0x1d81('0x27')](respondWithStatusCode(_0x6b785b,null))['catch'](handleError(_0x6b785b,null));};exports[_0x1d81('0x5d')]=function(_0xf52108,_0x55c101,_0x10f754){var _0x22e43b={};var _0x51f157={};var _0x21abda;var _0xc842b7;return db[_0x1d81('0x32')][_0x1d81('0x5e')]({'where':{'id':_0xf52108['params']['id']}})['then'](handleEntityNotFound(_0x55c101,null))['then'](function(_0x4b628b){if(_0x4b628b){_0x21abda=_0x4b628b;_0x51f157[_0x1d81('0x36')]=_[_0x1d81('0x38')](db[_0x1d81('0x5f')][_0x1d81('0x33')]);_0x51f157[_0x1d81('0x37')]=_[_0x1d81('0x38')](_0xf52108[_0x1d81('0x37')]);_0x51f157[_0x1d81('0x3f')]=_[_0x1d81('0x3a')](_0x51f157[_0x1d81('0x36')],_0x51f157['query']);_0x22e43b['attributes']=_['intersection'](_0x51f157[_0x1d81('0x36')],qs['fields'](_0xf52108['query'][_0x1d81('0x3b')]));_0x22e43b['attributes']=_0x22e43b[_0x1d81('0x39')][_0x1d81('0x3c')]?_0x22e43b[_0x1d81('0x39')]:_0x51f157[_0x1d81('0x36')];_0x22e43b[_0x1d81('0x60')]=qs[_0x1d81('0x3e')](_0xf52108[_0x1d81('0x37')]['sort']);_0x22e43b[_0x1d81('0x42')]=qs['filters'](_[_0x1d81('0x40')](_0xf52108['query'],_0x51f157[_0x1d81('0x3f')]));if(_0xf52108['query'][_0x1d81('0x41')]){_0x22e43b[_0x1d81('0x42')]=_[_0x1d81('0x43')](_0x22e43b[_0x1d81('0x42')],{'$or':_['map'](_0x22e43b['attributes'],function(_0x3710ae){var _0x30db90={};_0x30db90[_0x3710ae]={'$like':'%'+_0xf52108[_0x1d81('0x37')][_0x1d81('0x41')]+'%'};return _0x30db90;})});}_0x22e43b=_[_0x1d81('0x43')]({},_0x22e43b,_0xf52108['options']);return _0x21abda['getUsers'](_0x22e43b);}})['then'](function(_0x5e6165){if(_0x5e6165){_0xc842b7=_0x5e6165[_0x1d81('0x3c')];if(!_0xf52108['query'][_0x1d81('0x3d')](_0x1d81('0x61'))){_0x22e43b[_0x1d81('0x20')]=qs[_0x1d81('0x20')](_0xf52108[_0x1d81('0x37')][_0x1d81('0x20')]);_0x22e43b[_0x1d81('0x21')]=qs[_0x1d81('0x21')](_0xf52108[_0x1d81('0x37')]['offset']);}return _0x21abda['getUsers'](_0x22e43b);}})['then'](function(_0x2219d4){if(_0x2219d4){return _0x2219d4?{'count':_0xc842b7,'rows':_0x2219d4}:null;}})['then'](respondWithResult(_0x55c101,null))[_0x1d81('0x49')](handleError(_0x55c101,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f651507..ed0d136 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 _0xf526=['hook','events','../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x407bd8,_0x277add){var _0x20b6c9=function(_0x215b6c){while(--_0x215b6c){_0x407bd8['push'](_0x407bd8['shift']());}};_0x20b6c9(++_0x277add);}(_0xf526,0x1d5));var _0x6f52=function(_0x2cd007,_0x55231e){_0x2cd007=_0x2cd007-0x0;var _0x48ae38=_0xf526[_0x2cd007];return _0x48ae38;};'use strict';var EventEmitter=require(_0x6f52('0x0'));var SquareProject=require(_0x6f52('0x1'))['db'][_0x6f52('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f52('0x3'),'afterUpdate':_0x6f52('0x4'),'afterDestroy':_0x6f52('0x5')};function emitEvent(_0x5b6541){return function(_0x439c3a,_0x20b4c3,_0x587109){SquareProjectEvents[_0x6f52('0x6')](_0x5b6541+':'+_0x439c3a['id'],_0x439c3a);SquareProjectEvents[_0x6f52('0x6')](_0x5b6541,_0x439c3a);_0x587109(null);};}for(var e in events){if(events[_0x6f52('0x7')](e)){var event=events[e];SquareProject[_0x6f52('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x6a1c=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x3c8e26,_0x5b5e70){var _0x48e6da=function(_0xc723fa){while(--_0xc723fa){_0x3c8e26['push'](_0x3c8e26['shift']());}};_0x48e6da(++_0x5b5e70);}(_0x6a1c,0x150));var _0xc6a1=function(_0x4d2c06,_0x1cf73d){_0x4d2c06=_0x4d2c06-0x0;var _0xb2948a=_0x6a1c[_0x4d2c06];return _0xb2948a;};'use strict';var EventEmitter=require(_0xc6a1('0x0'));var SquareProject=require(_0xc6a1('0x1'))['db'][_0xc6a1('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc6a1('0x3')](0x0);var events={'afterCreate':_0xc6a1('0x4'),'afterUpdate':_0xc6a1('0x5'),'afterDestroy':_0xc6a1('0x6')};function emitEvent(_0x28c77a){return function(_0x34cf47,_0x1ea337,_0x3cc8d1){SquareProjectEvents[_0xc6a1('0x7')](_0x28c77a+':'+_0x34cf47['id'],_0x34cf47);SquareProjectEvents[_0xc6a1('0x7')](_0x28c77a,_0x34cf47);_0x3cc8d1(null);};}for(var e in events){if(events[_0xc6a1('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xc6a1('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c316a6f..939e457 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 _0x9371=['square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x109f95,_0xf40cb4){var _0x446879=function(_0x355ca3){while(--_0x355ca3){_0x109f95['push'](_0x109f95['shift']());}};_0x446879(++_0xf40cb4);}(_0x9371,0x120));var _0x1937=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9371[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x1937('0x0'));var util=require(_0x1937('0x1'));var logger=require(_0x1937('0x2'))(_0x1937('0x3'));var moment=require(_0x1937('0x4'));var BPromise=require(_0x1937('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1937('0x6'));var config=require(_0x1937('0x7'));var attributes=require(_0x1937('0x8'));module[_0x1937('0x9')]=function(_0x247c8d,_0x1ea5d4){return _0x247c8d[_0x1937('0xa')](_0x1937('0xb'),attributes,{'tableName':_0x1937('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x258ba8,_0x19985e,_0x2bfd7e){if(_0x258ba8[_0x1937('0xd')](_0x1937('0xe'))){_0x258ba8[_0x1937('0xf')]=moment()[_0x1937('0x10')](_0x1937('0x11'));}if(_0x258ba8[_0x1937('0xd')](_0x1937('0x12'))){_0x258ba8[_0x1937('0x13')]=moment()[_0x1937('0x10')](_0x1937('0x11'));}_0x2bfd7e(null,_0x258ba8);}}});}; \ No newline at end of file +var _0x7849=['rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x187dbd,_0x2ecf58){var _0x45d1e9=function(_0x2364c0){while(--_0x2364c0){_0x187dbd['push'](_0x187dbd['shift']());}};_0x45d1e9(++_0x2ecf58);}(_0x7849,0x108));var _0x9784=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7849[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x9784('0x0'));var logger=require(_0x9784('0x1'))('api');var moment=require(_0x9784('0x2'));var BPromise=require(_0x9784('0x3'));var rp=require(_0x9784('0x4'));var fs=require('fs');var path=require(_0x9784('0x5'));var rimraf=require(_0x9784('0x6'));var config=require(_0x9784('0x7'));var attributes=require(_0x9784('0x8'));module[_0x9784('0x9')]=function(_0x1c510d,_0x42dd5f){return _0x1c510d[_0x9784('0xa')](_0x9784('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38fd90,_0x7d4c2a,_0x39a04f){if(_0x38fd90[_0x9784('0xc')](_0x9784('0xd'))){_0x38fd90[_0x9784('0xe')]=moment()[_0x9784('0xf')](_0x9784('0x10'));}if(_0x38fd90[_0x9784('0xc')](_0x9784('0x11'))){_0x38fd90['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x39a04f(null,_0x38fd90);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4739234..8b6cf0d 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 _0x57f3=['find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareProject','SquareProject'];(function(_0x3e6785,_0x4f5844){var _0x23b4c0=function(_0x39323f){while(--_0x39323f){_0x3e6785['push'](_0x3e6785['shift']());}};_0x23b4c0(++_0x4f5844);}(_0x57f3,0x1e8));var _0x357f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x57f3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x357f('0x0'));var util=require(_0x357f('0x1'));var moment=require(_0x357f('0x2'));var BPromise=require(_0x357f('0x3'));var rs=require(_0x357f('0x4'));var fs=require('fs');var Redis=require(_0x357f('0x5'));var db=require(_0x357f('0x6'))['db'];var utils=require(_0x357f('0x7'));var logger=require(_0x357f('0x8'))(_0x357f('0x9'));var config=require(_0x357f('0xa'));var jayson=require(_0x357f('0xb'));var client=jayson[_0x357f('0xc')][_0x357f('0xd')]({'port':0x232a});config[_0x357f('0xe')]=_[_0x357f('0xf')](config[_0x357f('0xe')],{'host':_0x357f('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0x357f('0x11')](socket);function respondWithRpcPromise(_0x514800,_0x47f6a7,_0x168a1a){return new BPromise(function(_0xabb1ea,_0x54d41c){return client[_0x357f('0x12')](_0x514800,_0x168a1a)[_0x357f('0x13')](function(_0x333f5e){logger[_0x357f('0x14')](_0x357f('0x15'),_0x47f6a7,_0x357f('0x16'));logger[_0x357f('0x17')](_0x357f('0x18'),_0x47f6a7,'request\x20sent',JSON[_0x357f('0x19')](_0x333f5e));if(_0x333f5e['error']){if(_0x333f5e[_0x357f('0x1a')][_0x357f('0x1b')]===0x1f4){logger[_0x357f('0x1a')](_0x357f('0x15'),_0x47f6a7,_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);return _0x54d41c(_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);}logger[_0x357f('0x1a')](_0x357f('0x15'),_0x47f6a7,_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);return _0xabb1ea(_0x333f5e[_0x357f('0x1a')][_0x357f('0x1c')]);}else{logger[_0x357f('0x14')]('SquareProject,\x20%s,\x20%s',_0x47f6a7,_0x357f('0x16'));_0xabb1ea(_0x333f5e['result'][_0x357f('0x1c')]);}})[_0x357f('0x1d')](function(_0x2ffbde){logger['error'](_0x357f('0x15'),_0x47f6a7,_0x2ffbde);_0x54d41c(_0x2ffbde);});});}exports[_0x357f('0x1e')]=function(_0x2dbf02){var _0x1fc3cf=this;return new Promise(function(_0x57a76d,_0x407dbf){return db[_0x357f('0x1f')][_0x357f('0x20')]({'raw':_0x2dbf02[_0x357f('0x21')]?_0x2dbf02[_0x357f('0x21')][_0x357f('0x22')]===undefined?!![]:![]:!![],'where':_0x2dbf02['options']?_0x2dbf02[_0x357f('0x21')][_0x357f('0x23')]||null:null,'attributes':_0x2dbf02[_0x357f('0x21')]?_0x2dbf02[_0x357f('0x21')]['attributes']||null:null,'include':_0x2dbf02[_0x357f('0x21')]?_0x2dbf02[_0x357f('0x21')][_0x357f('0x24')]?_[_0x357f('0x25')](_0x2dbf02[_0x357f('0x21')]['include'],function(_0x92a003){return{'model':db[_0x92a003[_0x357f('0x26')]],'as':_0x92a003['as'],'attributes':_0x92a003['attributes'],'include':_0x92a003[_0x357f('0x24')]?_[_0x357f('0x25')](_0x92a003[_0x357f('0x24')],function(_0x12d95f){return{'model':db[_0x12d95f[_0x357f('0x26')]],'as':_0x12d95f['as'],'attributes':_0x12d95f[_0x357f('0x27')],'include':_0x12d95f['include']?_['map'](_0x12d95f['include'],function(_0x2dea39){return{'model':db[_0x2dea39['model']],'as':_0x2dea39['as'],'attributes':_0x2dea39['attributes']};}):[]};}):[]};}):[]:[]})[_0x357f('0x13')](function(_0x332eea){logger[_0x357f('0x14')](_0x357f('0x1e'),_0x2dbf02);logger[_0x357f('0x17')]('ShowSquareProject',_0x2dbf02,JSON['stringify'](_0x332eea));_0x57a76d(_0x332eea);})['catch'](function(_0x3d0e16){logger['error'](_0x357f('0x1e'),_0x3d0e16[_0x357f('0x1c')],_0x2dbf02);_0x407dbf(_0x1fc3cf[_0x357f('0x1a')](0x1f4,_0x3d0e16[_0x357f('0x1c')]));});});}; \ No newline at end of file +var _0xa25b=['ShowSquareProject','options','raw','include','model','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1f50f3,_0x281515){var _0x4cc6fb=function(_0x3fba72){while(--_0x3fba72){_0x1f50f3['push'](_0x1f50f3['shift']());}};_0x4cc6fb(++_0x281515);}(_0xa25b,0xf6));var _0xba25=function(_0xec7927,_0x417df7){_0xec7927=_0xec7927-0x0;var _0xb16197=_0xa25b[_0xec7927];return _0xb16197;};'use strict';var _=require(_0xba25('0x0'));var util=require('util');var moment=require(_0xba25('0x1'));var BPromise=require('bluebird');var rs=require(_0xba25('0x2'));var fs=require('fs');var Redis=require(_0xba25('0x3'));var db=require(_0xba25('0x4'))['db'];var utils=require(_0xba25('0x5'));var logger=require('../../config/logger')(_0xba25('0x6'));var config=require(_0xba25('0x7'));var jayson=require(_0xba25('0x8'));var client=jayson['client'][_0xba25('0x9')]({'port':0x232a});config[_0xba25('0xa')]=_['defaults'](config[_0xba25('0xa')],{'host':_0xba25('0xb'),'port':0x18eb});var socket=require(_0xba25('0xc'))(new Redis(config[_0xba25('0xa')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0xf921b2,_0x4d408b,_0x1940a2){return new BPromise(function(_0x4ad197,_0x53d736){return client[_0xba25('0xd')](_0xf921b2,_0x1940a2)[_0xba25('0xe')](function(_0x304104){logger[_0xba25('0xf')](_0xba25('0x10'),_0x4d408b,_0xba25('0x11'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x4d408b,_0xba25('0x11'),JSON[_0xba25('0x12')](_0x304104));if(_0x304104[_0xba25('0x13')]){if(_0x304104[_0xba25('0x13')][_0xba25('0x14')]===0x1f4){logger[_0xba25('0x13')]('SquareProject,\x20%s,\x20%s',_0x4d408b,_0x304104['error'][_0xba25('0x15')]);return _0x53d736(_0x304104['error'][_0xba25('0x15')]);}logger[_0xba25('0x13')](_0xba25('0x10'),_0x4d408b,_0x304104[_0xba25('0x13')]['message']);return _0x4ad197(_0x304104[_0xba25('0x13')][_0xba25('0x15')]);}else{logger[_0xba25('0xf')](_0xba25('0x10'),_0x4d408b,_0xba25('0x11'));_0x4ad197(_0x304104[_0xba25('0x16')][_0xba25('0x15')]);}})[_0xba25('0x17')](function(_0x515934){logger['error']('SquareProject,\x20%s,\x20%s',_0x4d408b,_0x515934);_0x53d736(_0x515934);});});}exports[_0xba25('0x18')]=function(_0x3cf551){var _0x27f7c8=this;return new Promise(function(_0x456d18,_0x50d0e9){return db['SquareProject']['find']({'raw':_0x3cf551['options']?_0x3cf551[_0xba25('0x19')][_0xba25('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cf551[_0xba25('0x19')]?_0x3cf551[_0xba25('0x19')]['where']||null:null,'attributes':_0x3cf551[_0xba25('0x19')]?_0x3cf551[_0xba25('0x19')]['attributes']||null:null,'include':_0x3cf551[_0xba25('0x19')]?_0x3cf551['options'][_0xba25('0x1b')]?_['map'](_0x3cf551['options'][_0xba25('0x1b')],function(_0x26f3be){return{'model':db[_0x26f3be[_0xba25('0x1c')]],'as':_0x26f3be['as'],'attributes':_0x26f3be[_0xba25('0x1d')],'include':_0x26f3be['include']?_['map'](_0x26f3be[_0xba25('0x1b')],function(_0x156fbb){return{'model':db[_0x156fbb[_0xba25('0x1c')]],'as':_0x156fbb['as'],'attributes':_0x156fbb[_0xba25('0x1d')],'include':_0x156fbb[_0xba25('0x1b')]?_['map'](_0x156fbb['include'],function(_0x55853a){return{'model':db[_0x55853a[_0xba25('0x1c')]],'as':_0x55853a['as'],'attributes':_0x55853a[_0xba25('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xba25('0xe')](function(_0x31d90a){logger[_0xba25('0xf')](_0xba25('0x18'),_0x3cf551);logger['debug'](_0xba25('0x18'),_0x3cf551,JSON[_0xba25('0x12')](_0x31d90a));_0x456d18(_0x31d90a);})[_0xba25('0x17')](function(_0x3aa888){logger['error'](_0xba25('0x18'),_0x3aa888[_0xba25('0x15')],_0x3cf551);_0x50d0e9(_0x27f7c8[_0xba25('0x13')](0x1f4,_0x3aa888[_0xba25('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index da8707a..1cc3469 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 _0x2472=['emit','removeListener','register','squareProject:','./squareProject.events','update'];(function(_0xae7134,_0x5a583b){var _0x25bf3b=function(_0x364793){while(--_0x364793){_0xae7134['push'](_0xae7134['shift']());}};_0x25bf3b(++_0x5a583b);}(_0x2472,0x17e));var _0x2247=function(_0x43561f,_0x517f0c){_0x43561f=_0x43561f-0x0;var _0x4f6641=_0x2472[_0x43561f];return _0x4f6641;};'use strict';var SquareProjectEvents=require(_0x2247('0x0'));var events=['save','remove',_0x2247('0x1')];function createListener(_0x75bd1e,_0x35db56){return function(_0x55b9f0){_0x35db56[_0x2247('0x2')](_0x75bd1e,_0x55b9f0);};}function removeListener(_0xd8485c,_0x46c7cc){return function(){SquareProjectEvents[_0x2247('0x3')](_0xd8485c,_0x46c7cc);};}exports[_0x2247('0x4')]=function(_0x3b971a){for(var _0x585cdd=0x0,_0x2faf83=events['length'];_0x585cdd<_0x2faf83;_0x585cdd++){var _0x37f8c7=events[_0x585cdd];var _0x2bcb7b=createListener(_0x2247('0x5')+_0x37f8c7,_0x3b971a);SquareProjectEvents['on'](_0x37f8c7,_0x2bcb7b);}}; \ No newline at end of file +var _0x089f=['./squareProject.events','save','remove','register','squareProject:'];(function(_0x59198f,_0x3a68b8){var _0x316881=function(_0x48b2f3){while(--_0x48b2f3){_0x59198f['push'](_0x59198f['shift']());}};_0x316881(++_0x3a68b8);}(_0x089f,0xdc));var _0xf089=function(_0x1c75fb,_0x49e58d){_0x1c75fb=_0x1c75fb-0x0;var _0x227ed8=_0x089f[_0x1c75fb];return _0x227ed8;};'use strict';var SquareProjectEvents=require(_0xf089('0x0'));var events=[_0xf089('0x1'),_0xf089('0x2'),'update'];function createListener(_0x4aa14b,_0x44030b){return function(_0x163415){_0x44030b['emit'](_0x4aa14b,_0x163415);};}function removeListener(_0x2ad30c,_0x2d1d3e){return function(){SquareProjectEvents['removeListener'](_0x2ad30c,_0x2d1d3e);};}exports[_0xf089('0x3')]=function(_0x1732af){for(var _0x3e65e8=0x0,_0x56bea2=events['length'];_0x3e65e8<_0x56bea2;_0x3e65e8++){var _0x478409=events[_0x3e65e8];var _0x3edbfa=createListener(_0xf089('0x4')+_0x478409,_0x1732af);SquareProjectEvents['on'](_0x478409,_0x3edbfa);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 9d5189e..61f2c16 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1f9a47,_0x540442){var _0x550db1=function(_0x4c84c3){while(--_0x4c84c3){_0x1f9a47['push'](_0x1f9a47['shift']());}};_0x550db1(++_0x540442);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ec3d1,_0x2d82b2){_0x2ec3d1=_0x2ec3d1-0x0;var _0x2551e2=_0x5fab[_0x2ec3d1];return _0x2551e2;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x9875f2,_0x5df566){var _0x57c331=function(_0x534eac){while(--_0x534eac){_0x9875f2['push'](_0x9875f2['shift']());}};_0x57c331(++_0x5df566);}(_0x326f,0xd1));var _0xf326=function(_0x5bbac8,_0x42de72){_0x5bbac8=_0x5bbac8-0x0;var _0x2837a0=_0x326f[_0x5bbac8];return _0x2837a0;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 35baa2f..222cb7d 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 _0xed1f=['lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','substring'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0xed1f,0x6a));var _0xfed1=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xed1f[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'uniqueid':{'type':Sequelize[_0xfed1('0x2')]},'callerid':{'type':Sequelize[_0xfed1('0x2')]},'calleridname':{'type':Sequelize[_0xfed1('0x2')]},'context':{'type':Sequelize[_0xfed1('0x2')]},'extension':{'type':Sequelize[_0xfed1('0x2')]},'priority':{'type':Sequelize[_0xfed1('0x2')]},'accountcode':{'type':Sequelize[_0xfed1('0x2')]},'dnid':{'type':Sequelize[_0xfed1('0x2')]},'projectName':{'type':Sequelize[_0xfed1('0x2')]},'saveName':{'type':Sequelize[_0xfed1('0x2')]},'filename':{'type':Sequelize[_0xfed1('0x2')]},'savePath':{'type':Sequelize[_0xfed1('0x2')]},'format':{'type':Sequelize[_0xfed1('0x3')],'get':function(){var _0x612b38='';var _0x2a6082=this[_0xfed1('0x4')]('savePath');if(_0x2a6082){_0x612b38=_0x2a6082[_0xfed1('0x5')](_0x2a6082[_0xfed1('0x6')]('.'));}return _0x612b38;}}}; \ No newline at end of file +var _0x7bae=['savePath','substring','lastIndexOf','STRING','VIRTUAL','getDataValue'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7bae[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7ba('0x0')]},'callerid':{'type':Sequelize[_0xe7ba('0x0')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe7ba('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe7ba('0x0')]},'accountcode':{'type':Sequelize[_0xe7ba('0x0')]},'dnid':{'type':Sequelize[_0xe7ba('0x0')]},'projectName':{'type':Sequelize[_0xe7ba('0x0')]},'saveName':{'type':Sequelize[_0xe7ba('0x0')]},'filename':{'type':Sequelize[_0xe7ba('0x0')]},'savePath':{'type':Sequelize[_0xe7ba('0x0')]},'format':{'type':Sequelize[_0xe7ba('0x1')],'get':function(){var _0x10b307='';var _0x34fb18=this[_0xe7ba('0x2')](_0xe7ba('0x3'));if(_0x34fb18){_0x10b307=_0x34fb18[_0xe7ba('0x4')](_0x34fb18[_0xe7ba('0x5')]('.'));}return _0x10b307;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 98dd697..3d82000 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 _0x4a71=['rimraf','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x4a71,0x1d0));var _0x14a7=function(_0xd3a512,_0x5ef934){_0xd3a512=_0xd3a512-0x0;var _0x4b449d=_0x4a71[_0xd3a512];return _0x4b449d;};'use strict';var emlformat=require(_0x14a7('0x0'));var rimraf=require(_0x14a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x14a7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x14a7('0x3'));var sox=require(_0x14a7('0x4'));var csv=require(_0x14a7('0x5'));var ejs=require(_0x14a7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14a7('0x7'));var squel=require(_0x14a7('0x8'));var crypto=require(_0x14a7('0x9'));var jsforce=require(_0x14a7('0xa'));var deskjs=require(_0x14a7('0xb'));var toCsv=require(_0x14a7('0x5'));var querystring=require(_0x14a7('0xc'));var Papa=require(_0x14a7('0xd'));var Redis=require(_0x14a7('0xe'));var authService=require(_0x14a7('0xf'));var qs=require(_0x14a7('0x10'));var as=require(_0x14a7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14a7('0x12'))('api');var utils=require(_0x14a7('0x13'));var config=require(_0x14a7('0x14'));var licenseUtil=require(_0x14a7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c6a4f,_0x2a6700){_0x2a6700=_0x2a6700||0xcc;return function(_0x2668d5){if(_0x2668d5){return _0x2c6a4f[_0x14a7('0x16')](_0x2a6700);}return _0x2c6a4f[_0x14a7('0x17')](_0x2a6700)[_0x14a7('0x18')]();};}function respondWithResult(_0x516f30,_0x18ca29){_0x18ca29=_0x18ca29||0xc8;return function(_0x99c61f){if(_0x99c61f){return _0x516f30['status'](_0x18ca29)[_0x14a7('0x19')](_0x99c61f);}};}function respondWithFilteredResult(_0x591575,_0x51b296){return function(_0x14712b){if(_0x14712b){var _0x5ca6df=typeof _0x51b296[_0x14a7('0x1a')]==='undefined'&&typeof _0x51b296[_0x14a7('0x1b')]===_0x14a7('0x1c');var _0x41f417=_0x14712b[_0x14a7('0x1d')];var _0x569f9f=_0x5ca6df?0x0:_0x51b296[_0x14a7('0x1a')];var _0x247217=_0x5ca6df?_0x14712b[_0x14a7('0x1d')]:_0x51b296[_0x14a7('0x1a')]+_0x51b296[_0x14a7('0x1b')];var _0x272ac7;if(_0x247217>=_0x41f417){_0x247217=_0x41f417;_0x272ac7=0xc8;}else{_0x272ac7=0xce;}_0x591575['status'](_0x272ac7);return _0x591575[_0x14a7('0x1e')](_0x14a7('0x1f'),_0x569f9f+'-'+_0x247217+'/'+_0x41f417)[_0x14a7('0x19')](_0x14712b);}return null;};}function patchUpdates(_0x1754b0){return function(_0x4a3ee2){try{jsonpatch[_0x14a7('0x20')](_0x4a3ee2,_0x1754b0,!![]);}catch(_0x179c30){return BPromise['reject'](_0x179c30);}return _0x4a3ee2[_0x14a7('0x21')]();};}function saveUpdates(_0x229f59,_0x350a9f){return function(_0xfacf00){if(_0xfacf00){return _0xfacf00[_0x14a7('0x22')](_0x229f59)['then'](function(_0x161ab7){return _0x161ab7;});}return null;};}function removeEntity(_0x1d3741,_0x25d308){return function(_0x5bdb12){if(_0x5bdb12){return _0x5bdb12[_0x14a7('0x23')]()[_0x14a7('0x24')](function(){_0x1d3741[_0x14a7('0x17')](0xcc)[_0x14a7('0x18')]();});}};}function handleEntityNotFound(_0x2d7855,_0x6eb658){return function(_0x2207d5){if(!_0x2207d5){_0x2d7855[_0x14a7('0x16')](0x194);}return _0x2207d5;};}function handleError(_0x2d3967,_0x2f8eba){_0x2f8eba=_0x2f8eba||0x1f4;return function(_0x3c57de){logger[_0x14a7('0x25')](_0x3c57de[_0x14a7('0x26')]);if(_0x3c57de[_0x14a7('0x27')]){delete _0x3c57de[_0x14a7('0x27')];}_0x2d3967['status'](_0x2f8eba)[_0x14a7('0x28')](_0x3c57de);};}exports[_0x14a7('0x29')]=function(_0x7743bf,_0x182fd8){var _0x4a1384={},_0x2eb313={},_0x4cc5f6={'count':0x0,'rows':[]};var _0x5ad9a6=_[_0x14a7('0x2a')](db[_0x14a7('0x2b')][_0x14a7('0x2c')],function(_0x175543){return{'name':_0x175543['fieldName'],'type':_0x175543[_0x14a7('0x2d')][_0x14a7('0x2e')]};});_0x2eb313['model']=_[_0x14a7('0x2a')](_0x5ad9a6,_0x14a7('0x27'));_0x2eb313[_0x14a7('0x2f')]=_['keys'](_0x7743bf[_0x14a7('0x2f')]);_0x2eb313[_0x14a7('0x30')]=_[_0x14a7('0x31')](_0x2eb313['model'],_0x2eb313[_0x14a7('0x2f')]);_0x4a1384[_0x14a7('0x32')]=_['intersection'](_0x2eb313[_0x14a7('0x33')],qs[_0x14a7('0x34')](_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x34')]));_0x4a1384[_0x14a7('0x32')]=_0x4a1384['attributes'][_0x14a7('0x35')]?_0x4a1384[_0x14a7('0x32')]:_0x2eb313[_0x14a7('0x33')];if(!_0x7743bf['query'][_0x14a7('0x36')](_0x14a7('0x37'))){_0x4a1384['limit']=qs[_0x14a7('0x1b')](_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x1b')]);_0x4a1384[_0x14a7('0x1a')]=qs[_0x14a7('0x1a')](_0x7743bf[_0x14a7('0x2f')]['offset']);}_0x4a1384[_0x14a7('0x38')]=qs['sort'](_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x39')]);_0x4a1384[_0x14a7('0x3a')]=qs[_0x14a7('0x30')](_[_0x14a7('0x3b')](_0x7743bf[_0x14a7('0x2f')],_0x2eb313[_0x14a7('0x30')]),_0x5ad9a6);if(_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x3c')]){_0x4a1384[_0x14a7('0x3a')]=_[_0x14a7('0x3d')](_0x4a1384[_0x14a7('0x3a')],{'$or':_[_0x14a7('0x2a')](_0x5ad9a6,function(_0x3c4edd){if(_0x3c4edd[_0x14a7('0x2d')]!==_0x14a7('0x3e')){var _0x1a5d8e={};_0x1a5d8e[_0x3c4edd[_0x14a7('0x27')]]={'$like':'%'+_0x7743bf[_0x14a7('0x2f')][_0x14a7('0x3c')]+'%'};return _0x1a5d8e;}})});}_0x4a1384=_[_0x14a7('0x3d')]({},_0x4a1384,_0x7743bf[_0x14a7('0x3f')]);var _0x3ea3f8={'where':_0x4a1384[_0x14a7('0x3a')]};return db[_0x14a7('0x2b')][_0x14a7('0x1d')](_0x3ea3f8)[_0x14a7('0x24')](function(_0x40336c){_0x4cc5f6[_0x14a7('0x1d')]=_0x40336c;if(_0x7743bf['query'][_0x14a7('0x40')]){_0x4a1384[_0x14a7('0x41')]=[{'all':!![]}];}return db[_0x14a7('0x2b')][_0x14a7('0x42')](_0x4a1384);})['then'](function(_0x13b90b){_0x4cc5f6['rows']=_0x13b90b;return _0x4cc5f6;})[_0x14a7('0x24')](respondWithFilteredResult(_0x182fd8,_0x4a1384))[_0x14a7('0x43')](handleError(_0x182fd8,null));};exports[_0x14a7('0x44')]=function(_0x541971,_0x5b40bf){var _0xd46bad={'raw':!![],'where':{'id':_0x541971[_0x14a7('0x45')]['id']}},_0x2c5c68={};_0x2c5c68[_0x14a7('0x33')]=_['keys'](db['SquareRecording'][_0x14a7('0x2c')]);_0x2c5c68[_0x14a7('0x2f')]=_[_0x14a7('0x46')](_0x541971['query']);_0x2c5c68[_0x14a7('0x30')]=_[_0x14a7('0x31')](_0x2c5c68[_0x14a7('0x33')],_0x2c5c68[_0x14a7('0x2f')]);_0xd46bad['attributes']=_[_0x14a7('0x31')](_0x2c5c68['model'],qs[_0x14a7('0x34')](_0x541971['query'][_0x14a7('0x34')]));_0xd46bad[_0x14a7('0x32')]=_0xd46bad[_0x14a7('0x32')][_0x14a7('0x35')]?_0xd46bad[_0x14a7('0x32')]:_0x2c5c68[_0x14a7('0x33')];if(_0x541971['query'][_0x14a7('0x40')]){_0xd46bad[_0x14a7('0x41')]=[{'all':!![]}];}_0xd46bad=_[_0x14a7('0x3d')]({},_0xd46bad,_0x541971['options']);return db[_0x14a7('0x2b')][_0x14a7('0x47')](_0xd46bad)[_0x14a7('0x24')](handleEntityNotFound(_0x5b40bf,null))['then'](respondWithResult(_0x5b40bf,null))[_0x14a7('0x43')](handleError(_0x5b40bf,null));};exports['create']=function(_0x16d077,_0x1eac2d){return db[_0x14a7('0x2b')][_0x14a7('0x48')](_0x16d077[_0x14a7('0x49')],{})[_0x14a7('0x24')](respondWithResult(_0x1eac2d,0xc9))['catch'](handleError(_0x1eac2d,null));};exports['update']=function(_0x1c852b,_0x19c916){if(_0x1c852b[_0x14a7('0x49')]['id']){delete _0x1c852b[_0x14a7('0x49')]['id'];}return db['SquareRecording'][_0x14a7('0x47')]({'where':{'id':_0x1c852b[_0x14a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x19c916,null))['then'](saveUpdates(_0x1c852b[_0x14a7('0x49')],null))[_0x14a7('0x24')](respondWithResult(_0x19c916,null))[_0x14a7('0x43')](handleError(_0x19c916,null));};exports['download']=function(_0x5a18c3,_0x182743,_0x107c56){var _0x503ed0=require(_0x14a7('0x4a'));var _0x2c9567=![];var _0x326394={};if(_0x5a18c3[_0x14a7('0x2f')][_0x14a7('0x2d')]&&_0x5a18c3[_0x14a7('0x2f')][_0x14a7('0x2d')]===_0x14a7('0x4b')){_0x326394[_0x14a7('0x4b')]=_0x5a18c3[_0x14a7('0x45')]['id'];}else{_0x326394['id']=_0x5a18c3['params']['id'];}return db[_0x14a7('0x2b')][_0x14a7('0x47')]({'where':_0x326394,'attributes':['id',_0x14a7('0x4c'),_0x14a7('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x182743,null))[_0x14a7('0x24')](function(_0x2aa939){if(_0x2aa939){var _0x17470d=_0x2aa939['savePath'];var _0x19696e=util[_0x14a7('0x4e')](_0x14a7('0x4f'),_0x17470d);if(fs[_0x14a7('0x50')](_0x19696e)){_0x2c9567=!![];return _0x503ed0['decryptFile'](_0x19696e,_0x17470d,config[_0x14a7('0x51')]['recording'])['then'](function(){return _0x2aa939;});}return _0x2aa939;}})[_0x14a7('0x24')](function(_0x5a98b6){if(_0x5a98b6){var _0x43dd78=_0x5a98b6[_0x14a7('0x4c')];if(!fs[_0x14a7('0x50')](_0x43dd78)){throw new db[(_0x14a7('0x52'))][(_0x14a7('0x53'))](_0x14a7('0x54'));}if(_0x5a98b6['filename']){return _0x182743['download'](_0x43dd78,_0x5a98b6['filename']+path[_0x14a7('0x55')](_0x43dd78),function(){if(_0x2c9567){fs[_0x14a7('0x56')](_0x43dd78);}});}else{return _0x182743['download'](_0x43dd78,function(_0x3f65fa){if(_0x2c9567){fs[_0x14a7('0x56')](_0x43dd78);}});}}})[_0x14a7('0x43')](function(_0x37e20d){if(_0x37e20d['message']==='SquareRecording\x20not\x20found'){_0x182743[_0x14a7('0x17')](0x194)[_0x14a7('0x28')]('Not\x20found');}else{return handleError(_0x182743,null);}});};exports[_0x14a7('0x23')]=function(_0x351a5c,_0x5558b6){return db[_0x14a7('0x2b')][_0x14a7('0x47')]({'where':{'id':_0x351a5c[_0x14a7('0x45')]['id']}})[_0x14a7('0x24')](function(_0x59b493){if(_[_0x14a7('0x57')](_0x59b493)){throw new ReferenceError('Entity\x20not\x20found');}return _0x59b493;})[_0x14a7('0x24')](function(_0x182832){var _0x3323e2=_0x182832[_0x14a7('0x4c')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3323e2);if(!_['isNil'](_0x182832['savePath'])&&fs[_0x14a7('0x50')](_0x3323e2)){logger[_0x14a7('0x58')](_0x14a7('0x59')+_0x3323e2+_0x14a7('0x5a'));fs['unlinkSync'](_0x3323e2);}_0x3323e2=_0x3323e2+_0x14a7('0x5b');if(!_['isNil'](_0x182832[_0x14a7('0x4c')])&&fs['existsSync'](_0x3323e2)){logger[_0x14a7('0x58')]('File:\x20\x22'+_0x3323e2+_0x14a7('0x5a'));fs[_0x14a7('0x5c')](_0x3323e2);}return _0x182832;})[_0x14a7('0x24')](function(_0x469bbd){if(!_0x469bbd)throw new InternalError();return _0x469bbd[_0x14a7('0x23')]();})[_0x14a7('0x24')](function(){_0x5558b6[_0x14a7('0x17')](0xcc)[_0x14a7('0x18')]();})[_0x14a7('0x43')](handleError(_0x5558b6,null));}; \ No newline at end of file +var _0x5e70=['isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','SquareRecording','findAll','rows','show','params','find','catch','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5e70,0x133));var _0x05e7=function(_0x207f32,_0x35c2d8){_0x207f32=_0x207f32-0x0;var _0x18f57e=_0x5e70[_0x207f32];return _0x18f57e;};'use strict';var emlformat=require(_0x05e7('0x0'));var rimraf=require(_0x05e7('0x1'));var zipdir=require(_0x05e7('0x2'));var jsonpatch=require(_0x05e7('0x3'));var rp=require(_0x05e7('0x4'));var moment=require(_0x05e7('0x5'));var BPromise=require(_0x05e7('0x6'));var Mustache=require('mustache');var util=require(_0x05e7('0x7'));var path=require(_0x05e7('0x8'));var sox=require(_0x05e7('0x9'));var csv=require(_0x05e7('0xa'));var ejs=require(_0x05e7('0xb'));var fs=require('fs');var fs_extra=require(_0x05e7('0xc'));var _=require(_0x05e7('0xd'));var squel=require('squel');var crypto=require(_0x05e7('0xe'));var jsforce=require(_0x05e7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x05e7('0xa'));var querystring=require(_0x05e7('0x10'));var Papa=require(_0x05e7('0x11'));var Redis=require('ioredis');var authService=require(_0x05e7('0x12'));var qs=require(_0x05e7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05e7('0x14'));var logger=require(_0x05e7('0x15'))(_0x05e7('0x16'));var utils=require(_0x05e7('0x17'));var config=require(_0x05e7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x05e7('0x19'))['db'];function respondWithStatusCode(_0x5772d0,_0x50cf56){_0x50cf56=_0x50cf56||0xcc;return function(_0x30f86b){if(_0x30f86b){return _0x5772d0[_0x05e7('0x1a')](_0x50cf56);}return _0x5772d0[_0x05e7('0x1b')](_0x50cf56)[_0x05e7('0x1c')]();};}function respondWithResult(_0x356674,_0xffa3ac){_0xffa3ac=_0xffa3ac||0xc8;return function(_0x2f3539){if(_0x2f3539){return _0x356674[_0x05e7('0x1b')](_0xffa3ac)['json'](_0x2f3539);}};}function respondWithFilteredResult(_0x29a9d3,_0x75534b){return function(_0x1cd365){if(_0x1cd365){var _0x24f6b2=typeof _0x75534b[_0x05e7('0x1d')]==='undefined'&&typeof _0x75534b['limit']===_0x05e7('0x1e');var _0x94c6ac=_0x1cd365['count'];var _0x48b1bc=_0x24f6b2?0x0:_0x75534b[_0x05e7('0x1d')];var _0x200e7e=_0x24f6b2?_0x1cd365[_0x05e7('0x1f')]:_0x75534b[_0x05e7('0x1d')]+_0x75534b[_0x05e7('0x20')];var _0x55280c;if(_0x200e7e>=_0x94c6ac){_0x200e7e=_0x94c6ac;_0x55280c=0xc8;}else{_0x55280c=0xce;}_0x29a9d3['status'](_0x55280c);return _0x29a9d3['set'](_0x05e7('0x21'),_0x48b1bc+'-'+_0x200e7e+'/'+_0x94c6ac)[_0x05e7('0x22')](_0x1cd365);}return null;};}function patchUpdates(_0x197286){return function(_0x3ed592){try{jsonpatch[_0x05e7('0x23')](_0x3ed592,_0x197286,!![]);}catch(_0x15f856){return BPromise[_0x05e7('0x24')](_0x15f856);}return _0x3ed592['save']();};}function saveUpdates(_0x21355e,_0x2d0bdd){return function(_0x5cec9e){if(_0x5cec9e){return _0x5cec9e[_0x05e7('0x25')](_0x21355e)[_0x05e7('0x26')](function(_0x46af62){return _0x46af62;});}return null;};}function removeEntity(_0x490636,_0x4aad90){return function(_0x2e9835){if(_0x2e9835){return _0x2e9835[_0x05e7('0x27')]()[_0x05e7('0x26')](function(){_0x490636[_0x05e7('0x1b')](0xcc)[_0x05e7('0x1c')]();});}};}function handleEntityNotFound(_0xda72d1,_0x2f852f){return function(_0x221f43){if(!_0x221f43){_0xda72d1['sendStatus'](0x194);}return _0x221f43;};}function handleError(_0x3392b3,_0x271ca5){_0x271ca5=_0x271ca5||0x1f4;return function(_0xa4657e){logger['error'](_0xa4657e[_0x05e7('0x28')]);if(_0xa4657e[_0x05e7('0x29')]){delete _0xa4657e[_0x05e7('0x29')];}_0x3392b3['status'](_0x271ca5)[_0x05e7('0x2a')](_0xa4657e);};}exports[_0x05e7('0x2b')]=function(_0x5a5353,_0xf5edd9){var _0x266d91={},_0x29ef65={},_0x4347a6={'count':0x0,'rows':[]};var _0x1a941f=_[_0x05e7('0x2c')](db['SquareRecording'][_0x05e7('0x2d')],function(_0xc87899){return{'name':_0xc87899[_0x05e7('0x2e')],'type':_0xc87899[_0x05e7('0x2f')][_0x05e7('0x30')]};});_0x29ef65[_0x05e7('0x31')]=_[_0x05e7('0x2c')](_0x1a941f,_0x05e7('0x29'));_0x29ef65[_0x05e7('0x32')]=_[_0x05e7('0x33')](_0x5a5353[_0x05e7('0x32')]);_0x29ef65[_0x05e7('0x34')]=_[_0x05e7('0x35')](_0x29ef65[_0x05e7('0x31')],_0x29ef65[_0x05e7('0x32')]);_0x266d91['attributes']=_[_0x05e7('0x35')](_0x29ef65[_0x05e7('0x31')],qs[_0x05e7('0x36')](_0x5a5353[_0x05e7('0x32')][_0x05e7('0x36')]));_0x266d91['attributes']=_0x266d91[_0x05e7('0x37')][_0x05e7('0x38')]?_0x266d91[_0x05e7('0x37')]:_0x29ef65['model'];if(!_0x5a5353[_0x05e7('0x32')]['hasOwnProperty'](_0x05e7('0x39'))){_0x266d91['limit']=qs['limit'](_0x5a5353[_0x05e7('0x32')][_0x05e7('0x20')]);_0x266d91[_0x05e7('0x1d')]=qs[_0x05e7('0x1d')](_0x5a5353[_0x05e7('0x32')][_0x05e7('0x1d')]);}_0x266d91[_0x05e7('0x3a')]=qs['sort'](_0x5a5353['query'][_0x05e7('0x3b')]);_0x266d91[_0x05e7('0x3c')]=qs[_0x05e7('0x34')](_[_0x05e7('0x3d')](_0x5a5353['query'],_0x29ef65[_0x05e7('0x34')]),_0x1a941f);if(_0x5a5353[_0x05e7('0x32')][_0x05e7('0x3e')]){_0x266d91[_0x05e7('0x3c')]=_[_0x05e7('0x3f')](_0x266d91[_0x05e7('0x3c')],{'$or':_['map'](_0x1a941f,function(_0x4cf2c4){if(_0x4cf2c4[_0x05e7('0x2f')]!==_0x05e7('0x40')){var _0x1d2699={};_0x1d2699[_0x4cf2c4[_0x05e7('0x29')]]={'$like':'%'+_0x5a5353['query'][_0x05e7('0x3e')]+'%'};return _0x1d2699;}})});}_0x266d91=_[_0x05e7('0x3f')]({},_0x266d91,_0x5a5353['options']);var _0x134e90={'where':_0x266d91[_0x05e7('0x3c')]};return db['SquareRecording'][_0x05e7('0x1f')](_0x134e90)['then'](function(_0x4d39f6){_0x4347a6[_0x05e7('0x1f')]=_0x4d39f6;if(_0x5a5353[_0x05e7('0x32')][_0x05e7('0x41')]){_0x266d91[_0x05e7('0x42')]=[{'all':!![]}];}return db[_0x05e7('0x43')][_0x05e7('0x44')](_0x266d91);})[_0x05e7('0x26')](function(_0x3cb425){_0x4347a6[_0x05e7('0x45')]=_0x3cb425;return _0x4347a6;})[_0x05e7('0x26')](respondWithFilteredResult(_0xf5edd9,_0x266d91))['catch'](handleError(_0xf5edd9,null));};exports[_0x05e7('0x46')]=function(_0x120132,_0xeef599){var _0x20334f={'raw':!![],'where':{'id':_0x120132[_0x05e7('0x47')]['id']}},_0x47e3b7={};_0x47e3b7['model']=_[_0x05e7('0x33')](db['SquareRecording'][_0x05e7('0x2d')]);_0x47e3b7[_0x05e7('0x32')]=_['keys'](_0x120132[_0x05e7('0x32')]);_0x47e3b7[_0x05e7('0x34')]=_[_0x05e7('0x35')](_0x47e3b7[_0x05e7('0x31')],_0x47e3b7['query']);_0x20334f['attributes']=_[_0x05e7('0x35')](_0x47e3b7[_0x05e7('0x31')],qs[_0x05e7('0x36')](_0x120132['query'][_0x05e7('0x36')]));_0x20334f[_0x05e7('0x37')]=_0x20334f['attributes']['length']?_0x20334f[_0x05e7('0x37')]:_0x47e3b7['model'];if(_0x120132['query'][_0x05e7('0x41')]){_0x20334f[_0x05e7('0x42')]=[{'all':!![]}];}_0x20334f=_[_0x05e7('0x3f')]({},_0x20334f,_0x120132['options']);return db['SquareRecording'][_0x05e7('0x48')](_0x20334f)['then'](handleEntityNotFound(_0xeef599,null))[_0x05e7('0x26')](respondWithResult(_0xeef599,null))[_0x05e7('0x49')](handleError(_0xeef599,null));};exports[_0x05e7('0x4a')]=function(_0x4d054c,_0x5240ae){return db['SquareRecording'][_0x05e7('0x4a')](_0x4d054c[_0x05e7('0x4b')],{})['then'](respondWithResult(_0x5240ae,0xc9))[_0x05e7('0x49')](handleError(_0x5240ae,null));};exports['update']=function(_0x3f6c14,_0x397d15){if(_0x3f6c14[_0x05e7('0x4b')]['id']){delete _0x3f6c14['body']['id'];}return db['SquareRecording'][_0x05e7('0x48')]({'where':{'id':_0x3f6c14[_0x05e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x397d15,null))['then'](saveUpdates(_0x3f6c14[_0x05e7('0x4b')],null))[_0x05e7('0x26')](respondWithResult(_0x397d15,null))[_0x05e7('0x49')](handleError(_0x397d15,null));};exports[_0x05e7('0x4c')]=function(_0x24b0aa,_0xeebe62,_0x30e07c){var _0x473196=require('../../components/encryptor');var _0x204a33=![];var _0x4092c8={};if(_0x24b0aa[_0x05e7('0x32')][_0x05e7('0x2f')]&&_0x24b0aa['query']['type']==='uniqueid'){_0x4092c8[_0x05e7('0x4d')]=_0x24b0aa[_0x05e7('0x47')]['id'];}else{_0x4092c8['id']=_0x24b0aa['params']['id'];}return db[_0x05e7('0x43')][_0x05e7('0x48')]({'where':_0x4092c8,'attributes':['id',_0x05e7('0x4e'),_0x05e7('0x4f')],'raw':!![]})[_0x05e7('0x26')](handleEntityNotFound(_0xeebe62,null))['then'](function(_0xa9c2e3){if(_0xa9c2e3){var _0x5c1083=_0xa9c2e3[_0x05e7('0x4e')];var _0x208a1a=util[_0x05e7('0x50')](_0x05e7('0x51'),_0x5c1083);if(fs[_0x05e7('0x52')](_0x208a1a)){_0x204a33=!![];return _0x473196[_0x05e7('0x53')](_0x208a1a,_0x5c1083,config[_0x05e7('0x54')][_0x05e7('0x55')])['then'](function(){return _0xa9c2e3;});}return _0xa9c2e3;}})[_0x05e7('0x26')](function(_0x1eb9f0){if(_0x1eb9f0){var _0x478f94=_0x1eb9f0[_0x05e7('0x4e')];if(!fs[_0x05e7('0x52')](_0x478f94)){throw new db[(_0x05e7('0x56'))][(_0x05e7('0x57'))](_0x05e7('0x58'));}if(_0x1eb9f0[_0x05e7('0x4f')]){return _0xeebe62[_0x05e7('0x4c')](_0x478f94,_0x1eb9f0[_0x05e7('0x4f')]+path[_0x05e7('0x59')](_0x478f94),function(){if(_0x204a33){fs[_0x05e7('0x5a')](_0x478f94);}});}else{return _0xeebe62[_0x05e7('0x4c')](_0x478f94,function(_0x750669){if(_0x204a33){fs[_0x05e7('0x5a')](_0x478f94);}});}}})['catch'](function(_0x2b8d5c){if(_0x2b8d5c[_0x05e7('0x5b')]===_0x05e7('0x58')){_0xeebe62[_0x05e7('0x1b')](0x194)[_0x05e7('0x2a')](_0x05e7('0x5c'));}else{return handleError(_0xeebe62,null);}});};exports['destroy']=function(_0x144b3c,_0x80c4d8){return db[_0x05e7('0x43')][_0x05e7('0x48')]({'where':{'id':_0x144b3c[_0x05e7('0x47')]['id']}})[_0x05e7('0x26')](function(_0x344db5){if(_[_0x05e7('0x5d')](_0x344db5)){throw new ReferenceError(_0x05e7('0x5e'));}return _0x344db5;})['then'](function(_0x54d8d3){var _0x477681=_0x54d8d3[_0x05e7('0x4e')];logger[_0x05e7('0x5f')](_0x05e7('0x60'),_0x477681);if(!_[_0x05e7('0x5d')](_0x54d8d3[_0x05e7('0x4e')])&&fs[_0x05e7('0x52')](_0x477681)){logger[_0x05e7('0x5f')]('File:\x20\x22'+_0x477681+_0x05e7('0x61'));fs[_0x05e7('0x62')](_0x477681);}_0x477681=_0x477681+'.cypher';if(!_[_0x05e7('0x5d')](_0x54d8d3[_0x05e7('0x4e')])&&fs['existsSync'](_0x477681)){logger[_0x05e7('0x5f')](_0x05e7('0x63')+_0x477681+_0x05e7('0x61'));fs[_0x05e7('0x62')](_0x477681);}return _0x54d8d3;})[_0x05e7('0x26')](function(_0x4477f4){if(!_0x4477f4)throw new InternalError();return _0x4477f4[_0x05e7('0x27')]();})[_0x05e7('0x26')](function(){_0x80c4d8['status'](0xcc)[_0x05e7('0x1c')]();})[_0x05e7('0x49')](handleError(_0x80c4d8,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4e06862..0260405 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 _0x7b77=['../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x193b8d,_0x4b794b){var _0x23659a=function(_0xf87999){while(--_0xf87999){_0x193b8d['push'](_0x193b8d['shift']());}};_0x23659a(++_0x4b794b);}(_0x7b77,0x179));var _0x77b7=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x7b77[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var logger=require(_0x77b7('0x2'))(_0x77b7('0x3'));var moment=require('moment');var BPromise=require(_0x77b7('0x4'));var rp=require(_0x77b7('0x5'));var fs=require('fs');var path=require(_0x77b7('0x6'));var rimraf=require('rimraf');var config=require(_0x77b7('0x7'));var attributes=require(_0x77b7('0x8'));module[_0x77b7('0x9')]=function(_0x3d97f0,_0x4556c1){return _0x3d97f0[_0x77b7('0xa')]('SquareRecording',attributes,{'tableName':_0x77b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7af9=['path','rimraf','../../config/environment','define','SquareRecording','square_recordings','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x7af9,0x95));var _0x97af=function(_0x41d98a,_0xf5a414){_0x41d98a=_0x41d98a-0x0;var _0x3db31d=_0x7af9[_0x41d98a];return _0x3db31d;};'use strict';var _=require(_0x97af('0x0'));var util=require('util');var logger=require(_0x97af('0x1'))(_0x97af('0x2'));var moment=require('moment');var BPromise=require(_0x97af('0x3'));var rp=require(_0x97af('0x4'));var fs=require('fs');var path=require(_0x97af('0x5'));var rimraf=require(_0x97af('0x6'));var config=require(_0x97af('0x7'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x4e2dff,_0x440a77){return _0x4e2dff[_0x97af('0x8')](_0x97af('0x9'),attributes,{'tableName':_0x97af('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 736e2f0..0c98851 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 _0x0ca9=['http','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','then','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0xbbe7a8,_0x36a6b3){var _0x2f7ba4=function(_0xe195f7){while(--_0xe195f7){_0xbbe7a8['push'](_0xbbe7a8['shift']());}};_0x2f7ba4(++_0x36a6b3);}(_0x0ca9,0x99));var _0x90ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ca9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var moment=require('moment');var BPromise=require(_0x90ca('0x2'));var rs=require(_0x90ca('0x3'));var fs=require('fs');var Redis=require(_0x90ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90ca('0x5'));var config=require(_0x90ca('0x6'));var jayson=require(_0x90ca('0x7'));var client=jayson[_0x90ca('0x8')][_0x90ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4faf32,_0x1e31d2,_0x5995ec){return new BPromise(function(_0x6a6d1,_0x8365e6){return client['request'](_0x4faf32,_0x5995ec)['then'](function(_0x139917){logger[_0x90ca('0xa')](_0x90ca('0xb'),_0x1e31d2,'request\x20sent');logger[_0x90ca('0xc')](_0x90ca('0xd'),_0x1e31d2,'request\x20sent',JSON[_0x90ca('0xe')](_0x139917));if(_0x139917[_0x90ca('0xf')]){if(_0x139917['error'][_0x90ca('0x10')]===0x1f4){logger[_0x90ca('0xf')](_0x90ca('0xb'),_0x1e31d2,_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);return _0x8365e6(_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);}logger['error'](_0x90ca('0xb'),_0x1e31d2,_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);return _0x6a6d1(_0x139917[_0x90ca('0xf')][_0x90ca('0x11')]);}else{logger[_0x90ca('0xa')](_0x90ca('0xb'),_0x1e31d2,_0x90ca('0x12'));_0x6a6d1(_0x139917[_0x90ca('0x13')][_0x90ca('0x11')]);}})[_0x90ca('0x14')](function(_0x580987){logger[_0x90ca('0xf')](_0x90ca('0xb'),_0x1e31d2,_0x580987);_0x8365e6(_0x580987);});});}exports[_0x90ca('0x15')]=function(_0x1c96d6){var _0x1da559=this;return new Promise(function(_0x263db3,_0xf6ce97){return db[_0x90ca('0x16')][_0x90ca('0x17')](_0x1c96d6['body'],{'raw':_0x1c96d6[_0x90ca('0x18')]?_0x1c96d6[_0x90ca('0x18')][_0x90ca('0x19')]===undefined?!![]:![]:!![]})[_0x90ca('0x1a')](function(_0x443313){logger['info'](_0x90ca('0x15'),_0x1c96d6);logger['debug'](_0x90ca('0x15'),_0x1c96d6,JSON[_0x90ca('0xe')](_0x443313));_0x263db3(_0x443313);})[_0x90ca('0x14')](function(_0x40dbeb){logger[_0x90ca('0xf')](_0x90ca('0x15'),_0x40dbeb[_0x90ca('0x11')],_0x1c96d6);_0xf6ce97(_0x1da559[_0x90ca('0xf')](0x1f4,_0x40dbeb['message']));});});}; \ No newline at end of file +var _0xc2eb=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateSquareRecording','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xce8ee4,_0x2de145){var _0x6194a2=function(_0xc0cd19){while(--_0xc0cd19){_0xce8ee4['push'](_0xce8ee4['shift']());}};_0x6194a2(++_0x2de145);}(_0xc2eb,0x153));var _0xbc2e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xc2eb[_0x3e112d];return _0x531c31;};'use strict';var _=require('lodash');var util=require(_0xbc2e('0x0'));var moment=require(_0xbc2e('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc2e('0x2'));var fs=require('fs');var Redis=require(_0xbc2e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc2e('0x4'));var jayson=require(_0xbc2e('0x5'));var client=jayson[_0xbc2e('0x6')][_0xbc2e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e8983,_0x3163c2,_0x1f3034){return new BPromise(function(_0x556f01,_0x5e4b3d){return client[_0xbc2e('0x8')](_0x1e8983,_0x1f3034)[_0xbc2e('0x9')](function(_0x52e693){logger[_0xbc2e('0xa')](_0xbc2e('0xb'),_0x3163c2,_0xbc2e('0xc'));logger[_0xbc2e('0xd')](_0xbc2e('0xe'),_0x3163c2,_0xbc2e('0xc'),JSON[_0xbc2e('0xf')](_0x52e693));if(_0x52e693[_0xbc2e('0x10')]){if(_0x52e693[_0xbc2e('0x10')][_0xbc2e('0x11')]===0x1f4){logger[_0xbc2e('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3163c2,_0x52e693[_0xbc2e('0x10')][_0xbc2e('0x12')]);return _0x5e4b3d(_0x52e693[_0xbc2e('0x10')]['message']);}logger[_0xbc2e('0x10')](_0xbc2e('0xb'),_0x3163c2,_0x52e693[_0xbc2e('0x10')][_0xbc2e('0x12')]);return _0x556f01(_0x52e693['error'][_0xbc2e('0x12')]);}else{logger[_0xbc2e('0xa')](_0xbc2e('0xb'),_0x3163c2,'request\x20sent');_0x556f01(_0x52e693[_0xbc2e('0x13')][_0xbc2e('0x12')]);}})[_0xbc2e('0x14')](function(_0x1d5f07){logger[_0xbc2e('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3163c2,_0x1d5f07);_0x5e4b3d(_0x1d5f07);});});}exports['CreateSquareRecording']=function(_0x4930f6){var _0xea373c=this;return new Promise(function(_0x56569d,_0x108ed4){return db['SquareRecording'][_0xbc2e('0x15')](_0x4930f6[_0xbc2e('0x16')],{'raw':_0x4930f6[_0xbc2e('0x17')]?_0x4930f6[_0xbc2e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbc2e('0x9')](function(_0x5e96d8){logger[_0xbc2e('0xa')](_0xbc2e('0x18'),_0x4930f6);logger[_0xbc2e('0xd')]('CreateSquareRecording',_0x4930f6,JSON[_0xbc2e('0xf')](_0x5e96d8));_0x56569d(_0x5e96d8);})[_0xbc2e('0x14')](function(_0x5c6f56){logger[_0xbc2e('0x10')](_0xbc2e('0x18'),_0x5c6f56[_0xbc2e('0x12')],_0x4930f6);_0x108ed4(_0xea373c[_0xbc2e('0x10')](0x1f4,_0x5c6f56['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b1859c5..6b5db40 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4171bf,_0x4322f3){var _0x18a433=function(_0x41c545){while(--_0x41c545){_0x4171bf['push'](_0x4171bf['shift']());}};_0x18a433(++_0x4322f3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x386247,_0x5dcfa9){var _0x3abf65=function(_0x29d423){while(--_0x29d423){_0x386247['push'](_0x386247['shift']());}};_0x3abf65(++_0x5dcfa9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index a02fee2..4ae45e7 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 _0x200b=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x200b,0x7d));var _0xb200=function(_0x206aac,_0x820337){_0x206aac=_0x206aac-0x0;var _0xd10a7d=_0x200b[_0x206aac];return _0xd10a7d;};'use strict';var Sequelize=require(_0xb200('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb200('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb200('0x1')]},'language':{'type':Sequelize[_0xb200('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb200('0x1')]},'version':{'type':Sequelize[_0xb200('0x1')]},'callerid':{'type':Sequelize[_0xb200('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xb200('0x1')]},'callingani2':{'type':Sequelize[_0xb200('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xb200('0x1')]},'rdnis':{'type':Sequelize[_0xb200('0x1')]},'context':{'type':Sequelize[_0xb200('0x1')]},'extension':{'type':Sequelize[_0xb200('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb200('0x1')]},'project_name':{'type':Sequelize[_0xb200('0x1')]},'joinAt':{'type':Sequelize[_0xb200('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xb200('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb12d=['sequelize','exports','STRING','DATE'];(function(_0x5cb12f,_0x2268ba){var _0x4bfa03=function(_0x594412){while(--_0x594412){_0x5cb12f['push'](_0x5cb12f['shift']());}};_0x4bfa03(++_0x2268ba);}(_0xb12d,0x124));var _0xdb12=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0xb12d[_0x3e6729];return _0x535bcd;};'use strict';var Sequelize=require(_0xdb12('0x0'));module[_0xdb12('0x1')]={'network':{'type':Sequelize[_0xdb12('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xdb12('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdb12('0x2')]},'type':{'type':Sequelize[_0xdb12('0x2')]},'uniqueid':{'type':Sequelize[_0xdb12('0x2')]},'version':{'type':Sequelize[_0xdb12('0x2')]},'callerid':{'type':Sequelize[_0xdb12('0x2')]},'calleridname':{'type':Sequelize[_0xdb12('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xdb12('0x2')]},'callington':{'type':Sequelize[_0xdb12('0x2')]},'callingtns':{'type':Sequelize[_0xdb12('0x2')]},'dnid':{'type':Sequelize[_0xdb12('0x2')]},'rdnis':{'type':Sequelize[_0xdb12('0x2')]},'context':{'type':Sequelize[_0xdb12('0x2')]},'extension':{'type':Sequelize[_0xdb12('0x2')]},'priority':{'type':Sequelize[_0xdb12('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdb12('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xdb12('0x2')]},'joinAt':{'type':Sequelize[_0xdb12('0x3')]},'leaveAt':{'type':Sequelize[_0xdb12('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 6d24204..6e69650 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 _0x59a7=['fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','SquareReport','include','findAll','rows','catch','params','keys','length','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x59a7,0x8f));var _0x759a=function(_0x123281,_0x80da8e){_0x123281=_0x123281-0x0;var _0xec9f4=_0x59a7[_0x123281];return _0xec9f4;};'use strict';var emlformat=require(_0x759a('0x0'));var rimraf=require(_0x759a('0x1'));var zipdir=require(_0x759a('0x2'));var jsonpatch=require(_0x759a('0x3'));var rp=require(_0x759a('0x4'));var moment=require('moment');var BPromise=require(_0x759a('0x5'));var Mustache=require(_0x759a('0x6'));var util=require(_0x759a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x759a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x759a('0x9'));var _=require(_0x759a('0xa'));var squel=require(_0x759a('0xb'));var crypto=require(_0x759a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x759a('0x8'));var querystring=require(_0x759a('0xd'));var Papa=require(_0x759a('0xe'));var Redis=require(_0x759a('0xf'));var authService=require(_0x759a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x759a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x759a('0x12'));var utils=require(_0x759a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x759a('0x14'));var db=require(_0x759a('0x15'))['db'];function respondWithStatusCode(_0x19615b,_0x589697){_0x589697=_0x589697||0xcc;return function(_0x19d615){if(_0x19d615){return _0x19615b['sendStatus'](_0x589697);}return _0x19615b[_0x759a('0x16')](_0x589697)[_0x759a('0x17')]();};}function respondWithResult(_0x1d8a74,_0x25a481){_0x25a481=_0x25a481||0xc8;return function(_0x567bab){if(_0x567bab){return _0x1d8a74[_0x759a('0x16')](_0x25a481)[_0x759a('0x18')](_0x567bab);}};}function respondWithFilteredResult(_0x52e329,_0x5a5c35){return function(_0x469c20){if(_0x469c20){var _0x555b6b=typeof _0x5a5c35['offset']===_0x759a('0x19')&&typeof _0x5a5c35[_0x759a('0x1a')]===_0x759a('0x19');var _0x1486f7=_0x469c20[_0x759a('0x1b')];var _0xf091c1=_0x555b6b?0x0:_0x5a5c35[_0x759a('0x1c')];var _0x300a59=_0x555b6b?_0x469c20['count']:_0x5a5c35[_0x759a('0x1c')]+_0x5a5c35[_0x759a('0x1a')];var _0x4771fe;if(_0x300a59>=_0x1486f7){_0x300a59=_0x1486f7;_0x4771fe=0xc8;}else{_0x4771fe=0xce;}_0x52e329[_0x759a('0x16')](_0x4771fe);return _0x52e329['set'](_0x759a('0x1d'),_0xf091c1+'-'+_0x300a59+'/'+_0x1486f7)[_0x759a('0x18')](_0x469c20);}return null;};}function patchUpdates(_0x2e82ba){return function(_0x1719e1){try{jsonpatch[_0x759a('0x1e')](_0x1719e1,_0x2e82ba,!![]);}catch(_0x47fb24){return BPromise[_0x759a('0x1f')](_0x47fb24);}return _0x1719e1['save']();};}function saveUpdates(_0x3ef420,_0x221417){return function(_0x49feca){if(_0x49feca){return _0x49feca[_0x759a('0x20')](_0x3ef420)[_0x759a('0x21')](function(_0x202889){return _0x202889;});}return null;};}function removeEntity(_0x2e3d5c,_0x5855b1){return function(_0x41afd6){if(_0x41afd6){return _0x41afd6['destroy']()[_0x759a('0x21')](function(){_0x2e3d5c[_0x759a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9b62,_0x1a8e16){return function(_0x2dc911){if(!_0x2dc911){_0x4a9b62['sendStatus'](0x194);}return _0x2dc911;};}function handleError(_0x5d6fa9,_0x3a11ce){_0x3a11ce=_0x3a11ce||0x1f4;return function(_0x4443fe){logger[_0x759a('0x22')](_0x4443fe[_0x759a('0x23')]);if(_0x4443fe[_0x759a('0x24')]){delete _0x4443fe['name'];}_0x5d6fa9[_0x759a('0x16')](_0x3a11ce)[_0x759a('0x25')](_0x4443fe);};}exports[_0x759a('0x26')]=function(_0x1aa4d4,_0x4912ff){var _0x1f1d6c={},_0x3803ed={},_0x1c6f74={'count':0x0,'rows':[]};var _0x23a6f8=_[_0x759a('0x27')](db['SquareReport'][_0x759a('0x28')],function(_0x12e7e4){return{'name':_0x12e7e4[_0x759a('0x29')],'type':_0x12e7e4['type'][_0x759a('0x2a')]};});_0x3803ed[_0x759a('0x2b')]=_[_0x759a('0x27')](_0x23a6f8,'name');_0x3803ed[_0x759a('0x2c')]=_['keys'](_0x1aa4d4[_0x759a('0x2c')]);_0x3803ed[_0x759a('0x2d')]=_[_0x759a('0x2e')](_0x3803ed[_0x759a('0x2b')],_0x3803ed[_0x759a('0x2c')]);_0x1f1d6c[_0x759a('0x2f')]=_[_0x759a('0x2e')](_0x3803ed[_0x759a('0x2b')],qs[_0x759a('0x30')](_0x1aa4d4[_0x759a('0x2c')]['fields']));_0x1f1d6c['attributes']=_0x1f1d6c['attributes']['length']?_0x1f1d6c[_0x759a('0x2f')]:_0x3803ed[_0x759a('0x2b')];if(!_0x1aa4d4[_0x759a('0x2c')][_0x759a('0x31')](_0x759a('0x32'))){_0x1f1d6c[_0x759a('0x1a')]=qs[_0x759a('0x1a')](_0x1aa4d4['query']['limit']);_0x1f1d6c[_0x759a('0x1c')]=qs[_0x759a('0x1c')](_0x1aa4d4[_0x759a('0x2c')]['offset']);}_0x1f1d6c['order']=qs[_0x759a('0x33')](_0x1aa4d4['query'][_0x759a('0x33')]);_0x1f1d6c[_0x759a('0x34')]=qs[_0x759a('0x2d')](_[_0x759a('0x35')](_0x1aa4d4[_0x759a('0x2c')],_0x3803ed['filters']),_0x23a6f8);if(_0x1aa4d4[_0x759a('0x2c')]['filter']){_0x1f1d6c['where']=_['merge'](_0x1f1d6c[_0x759a('0x34')],{'$or':_[_0x759a('0x27')](_0x23a6f8,function(_0x5cf58a){if(_0x5cf58a[_0x759a('0x36')]!==_0x759a('0x37')){var _0x3e98c3={};_0x3e98c3[_0x5cf58a['name']]={'$like':'%'+_0x1aa4d4['query'][_0x759a('0x38')]+'%'};return _0x3e98c3;}})});}_0x1f1d6c=_[_0x759a('0x39')]({},_0x1f1d6c,_0x1aa4d4[_0x759a('0x3a')]);var _0x32c545={'where':_0x1f1d6c[_0x759a('0x34')]};return db[_0x759a('0x3b')][_0x759a('0x1b')](_0x32c545)['then'](function(_0x1ff142){_0x1c6f74[_0x759a('0x1b')]=_0x1ff142;if(_0x1aa4d4[_0x759a('0x2c')]['includeAll']){_0x1f1d6c[_0x759a('0x3c')]=[{'all':!![]}];}return db['SquareReport'][_0x759a('0x3d')](_0x1f1d6c);})['then'](function(_0x3481de){_0x1c6f74[_0x759a('0x3e')]=_0x3481de;return _0x1c6f74;})['then'](respondWithFilteredResult(_0x4912ff,_0x1f1d6c))[_0x759a('0x3f')](handleError(_0x4912ff,null));};exports['show']=function(_0x1a40b8,_0x124d51){var _0x3e4608={'raw':!![],'where':{'id':_0x1a40b8[_0x759a('0x40')]['id']}},_0x3f4599={};_0x3f4599[_0x759a('0x2b')]=_[_0x759a('0x41')](db['SquareReport'][_0x759a('0x28')]);_0x3f4599[_0x759a('0x2c')]=_[_0x759a('0x41')](_0x1a40b8['query']);_0x3f4599[_0x759a('0x2d')]=_[_0x759a('0x2e')](_0x3f4599['model'],_0x3f4599['query']);_0x3e4608[_0x759a('0x2f')]=_[_0x759a('0x2e')](_0x3f4599[_0x759a('0x2b')],qs[_0x759a('0x30')](_0x1a40b8[_0x759a('0x2c')][_0x759a('0x30')]));_0x3e4608[_0x759a('0x2f')]=_0x3e4608[_0x759a('0x2f')][_0x759a('0x42')]?_0x3e4608[_0x759a('0x2f')]:_0x3f4599[_0x759a('0x2b')];if(_0x1a40b8[_0x759a('0x2c')][_0x759a('0x43')]){_0x3e4608[_0x759a('0x3c')]=[{'all':!![]}];}_0x3e4608=_[_0x759a('0x39')]({},_0x3e4608,_0x1a40b8[_0x759a('0x3a')]);return db['SquareReport'][_0x759a('0x44')](_0x3e4608)[_0x759a('0x21')](handleEntityNotFound(_0x124d51,null))[_0x759a('0x21')](respondWithResult(_0x124d51,null))[_0x759a('0x3f')](handleError(_0x124d51,null));};exports[_0x759a('0x45')]=function(_0x4ccc1a,_0x350fa1){return db['SquareReport'][_0x759a('0x45')](_0x4ccc1a['body'],{})[_0x759a('0x21')](respondWithResult(_0x350fa1,0xc9))[_0x759a('0x3f')](handleError(_0x350fa1,null));};exports[_0x759a('0x20')]=function(_0x2a8004,_0x104ddc){if(_0x2a8004['body']['id']){delete _0x2a8004[_0x759a('0x46')]['id'];}return db[_0x759a('0x3b')][_0x759a('0x44')]({'where':{'id':_0x2a8004[_0x759a('0x40')]['id']}})['then'](handleEntityNotFound(_0x104ddc,null))[_0x759a('0x21')](saveUpdates(_0x2a8004['body'],null))['then'](respondWithResult(_0x104ddc,null))[_0x759a('0x3f')](handleError(_0x104ddc,null));};exports[_0x759a('0x47')]=function(_0x51e5eb,_0x1779a9){return db[_0x759a('0x3b')]['find']({'where':{'id':_0x51e5eb[_0x759a('0x40')]['id']}})[_0x759a('0x21')](handleEntityNotFound(_0x1779a9,null))[_0x759a('0x21')](removeEntity(_0x1779a9,null))[_0x759a('0x3f')](handleError(_0x1779a9,null));};exports['describe']=function(_0x59c052,_0xf15ad6){return db[_0x759a('0x3b')][_0x759a('0x48')]()[_0x759a('0x21')](respondWithResult(_0xf15ad6,null))[_0x759a('0x3f')](handleError(_0xf15ad6,null));}; \ No newline at end of file +var _0xea0b=['model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','index','map','SquareReport','rawAttributes','fieldName','type','query','filters','intersection'];(function(_0x355e14,_0x42f386){var _0x316c1c=function(_0x227720){while(--_0x227720){_0x355e14['push'](_0x355e14['shift']());}};_0x316c1c(++_0x42f386);}(_0xea0b,0x1e6));var _0xbea0=function(_0x4eabde,_0x15d845){_0x4eabde=_0x4eabde-0x0;var _0x201e80=_0xea0b[_0x4eabde];return _0x201e80;};'use strict';var emlformat=require(_0xbea0('0x0'));var rimraf=require(_0xbea0('0x1'));var zipdir=require(_0xbea0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbea0('0x3'));var moment=require(_0xbea0('0x4'));var BPromise=require(_0xbea0('0x5'));var Mustache=require(_0xbea0('0x6'));var util=require(_0xbea0('0x7'));var path=require(_0xbea0('0x8'));var sox=require(_0xbea0('0x9'));var csv=require(_0xbea0('0xa'));var ejs=require(_0xbea0('0xb'));var fs=require('fs');var fs_extra=require(_0xbea0('0xc'));var _=require(_0xbea0('0xd'));var squel=require(_0xbea0('0xe'));var crypto=require(_0xbea0('0xf'));var jsforce=require(_0xbea0('0x10'));var deskjs=require(_0xbea0('0x11'));var toCsv=require(_0xbea0('0xa'));var querystring=require(_0xbea0('0x12'));var Papa=require('papaparse');var Redis=require(_0xbea0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbea0('0x14'));var as=require(_0xbea0('0x15'));var hardwareService=require(_0xbea0('0x16'));var logger=require(_0xbea0('0x17'))(_0xbea0('0x18'));var utils=require('../../config/utils');var config=require(_0xbea0('0x19'));var licenseUtil=require(_0xbea0('0x1a'));var db=require(_0xbea0('0x1b'))['db'];function respondWithStatusCode(_0x2fd389,_0x5d4668){_0x5d4668=_0x5d4668||0xcc;return function(_0x4b48e5){if(_0x4b48e5){return _0x2fd389[_0xbea0('0x1c')](_0x5d4668);}return _0x2fd389['status'](_0x5d4668)[_0xbea0('0x1d')]();};}function respondWithResult(_0x2b2b29,_0x271e5b){_0x271e5b=_0x271e5b||0xc8;return function(_0x3b40e2){if(_0x3b40e2){return _0x2b2b29['status'](_0x271e5b)['json'](_0x3b40e2);}};}function respondWithFilteredResult(_0x323856,_0x5172ac){return function(_0x5282e9){if(_0x5282e9){var _0x286217=typeof _0x5172ac[_0xbea0('0x1e')]===_0xbea0('0x1f')&&typeof _0x5172ac[_0xbea0('0x20')]===_0xbea0('0x1f');var _0x17b387=_0x5282e9[_0xbea0('0x21')];var _0x19b388=_0x286217?0x0:_0x5172ac[_0xbea0('0x1e')];var _0x30b943=_0x286217?_0x5282e9['count']:_0x5172ac[_0xbea0('0x1e')]+_0x5172ac['limit'];var _0xc49e16;if(_0x30b943>=_0x17b387){_0x30b943=_0x17b387;_0xc49e16=0xc8;}else{_0xc49e16=0xce;}_0x323856['status'](_0xc49e16);return _0x323856[_0xbea0('0x22')](_0xbea0('0x23'),_0x19b388+'-'+_0x30b943+'/'+_0x17b387)[_0xbea0('0x24')](_0x5282e9);}return null;};}function patchUpdates(_0x3c838c){return function(_0x1a653){try{jsonpatch[_0xbea0('0x25')](_0x1a653,_0x3c838c,!![]);}catch(_0x16a03c){return BPromise[_0xbea0('0x26')](_0x16a03c);}return _0x1a653[_0xbea0('0x27')]();};}function saveUpdates(_0x427c73,_0xcc5be5){return function(_0x2140d4){if(_0x2140d4){return _0x2140d4['update'](_0x427c73)[_0xbea0('0x28')](function(_0xe36804){return _0xe36804;});}return null;};}function removeEntity(_0x348796,_0x9e57e9){return function(_0x1009d3){if(_0x1009d3){return _0x1009d3[_0xbea0('0x29')]()[_0xbea0('0x28')](function(){_0x348796['status'](0xcc)[_0xbea0('0x1d')]();});}};}function handleEntityNotFound(_0x1e7016,_0x398846){return function(_0x1bd034){if(!_0x1bd034){_0x1e7016['sendStatus'](0x194);}return _0x1bd034;};}function handleError(_0x2b1dd5,_0x3bdd08){_0x3bdd08=_0x3bdd08||0x1f4;return function(_0x1540fb){logger[_0xbea0('0x2a')](_0x1540fb['stack']);if(_0x1540fb[_0xbea0('0x2b')]){delete _0x1540fb[_0xbea0('0x2b')];}_0x2b1dd5['status'](_0x3bdd08)['send'](_0x1540fb);};}exports[_0xbea0('0x2c')]=function(_0x19ab24,_0x55c5ee){var _0x110a5b={},_0x15d023={},_0x4a038d={'count':0x0,'rows':[]};var _0x32537a=_[_0xbea0('0x2d')](db[_0xbea0('0x2e')][_0xbea0('0x2f')],function(_0x3c7058){return{'name':_0x3c7058[_0xbea0('0x30')],'type':_0x3c7058[_0xbea0('0x31')]['key']};});_0x15d023['model']=_[_0xbea0('0x2d')](_0x32537a,_0xbea0('0x2b'));_0x15d023[_0xbea0('0x32')]=_['keys'](_0x19ab24['query']);_0x15d023[_0xbea0('0x33')]=_[_0xbea0('0x34')](_0x15d023[_0xbea0('0x35')],_0x15d023[_0xbea0('0x32')]);_0x110a5b[_0xbea0('0x36')]=_[_0xbea0('0x34')](_0x15d023[_0xbea0('0x35')],qs[_0xbea0('0x37')](_0x19ab24[_0xbea0('0x32')][_0xbea0('0x37')]));_0x110a5b['attributes']=_0x110a5b[_0xbea0('0x36')]['length']?_0x110a5b['attributes']:_0x15d023[_0xbea0('0x35')];if(!_0x19ab24[_0xbea0('0x32')][_0xbea0('0x38')]('nolimit')){_0x110a5b[_0xbea0('0x20')]=qs[_0xbea0('0x20')](_0x19ab24['query']['limit']);_0x110a5b[_0xbea0('0x1e')]=qs['offset'](_0x19ab24[_0xbea0('0x32')][_0xbea0('0x1e')]);}_0x110a5b[_0xbea0('0x39')]=qs[_0xbea0('0x3a')](_0x19ab24[_0xbea0('0x32')]['sort']);_0x110a5b['where']=qs[_0xbea0('0x33')](_[_0xbea0('0x3b')](_0x19ab24[_0xbea0('0x32')],_0x15d023['filters']),_0x32537a);if(_0x19ab24[_0xbea0('0x32')][_0xbea0('0x3c')]){_0x110a5b[_0xbea0('0x3d')]=_[_0xbea0('0x3e')](_0x110a5b[_0xbea0('0x3d')],{'$or':_['map'](_0x32537a,function(_0x3c6d03){if(_0x3c6d03[_0xbea0('0x31')]!==_0xbea0('0x3f')){var _0x323a45={};_0x323a45[_0x3c6d03[_0xbea0('0x2b')]]={'$like':'%'+_0x19ab24['query'][_0xbea0('0x3c')]+'%'};return _0x323a45;}})});}_0x110a5b=_[_0xbea0('0x3e')]({},_0x110a5b,_0x19ab24[_0xbea0('0x40')]);var _0x25870d={'where':_0x110a5b[_0xbea0('0x3d')]};return db[_0xbea0('0x2e')][_0xbea0('0x21')](_0x25870d)[_0xbea0('0x28')](function(_0x543607){_0x4a038d[_0xbea0('0x21')]=_0x543607;if(_0x19ab24[_0xbea0('0x32')][_0xbea0('0x41')]){_0x110a5b[_0xbea0('0x42')]=[{'all':!![]}];}return db['SquareReport'][_0xbea0('0x43')](_0x110a5b);})[_0xbea0('0x28')](function(_0x4b27aa){_0x4a038d[_0xbea0('0x44')]=_0x4b27aa;return _0x4a038d;})['then'](respondWithFilteredResult(_0x55c5ee,_0x110a5b))['catch'](handleError(_0x55c5ee,null));};exports[_0xbea0('0x45')]=function(_0x3672c9,_0x1c2414){var _0x4f6998={'raw':!![],'where':{'id':_0x3672c9[_0xbea0('0x46')]['id']}},_0x531294={};_0x531294['model']=_[_0xbea0('0x47')](db['SquareReport'][_0xbea0('0x2f')]);_0x531294[_0xbea0('0x32')]=_['keys'](_0x3672c9['query']);_0x531294['filters']=_[_0xbea0('0x34')](_0x531294['model'],_0x531294[_0xbea0('0x32')]);_0x4f6998[_0xbea0('0x36')]=_[_0xbea0('0x34')](_0x531294['model'],qs['fields'](_0x3672c9[_0xbea0('0x32')][_0xbea0('0x37')]));_0x4f6998[_0xbea0('0x36')]=_0x4f6998[_0xbea0('0x36')]['length']?_0x4f6998[_0xbea0('0x36')]:_0x531294['model'];if(_0x3672c9[_0xbea0('0x32')][_0xbea0('0x41')]){_0x4f6998[_0xbea0('0x42')]=[{'all':!![]}];}_0x4f6998=_[_0xbea0('0x3e')]({},_0x4f6998,_0x3672c9[_0xbea0('0x40')]);return db[_0xbea0('0x2e')][_0xbea0('0x48')](_0x4f6998)[_0xbea0('0x28')](handleEntityNotFound(_0x1c2414,null))[_0xbea0('0x28')](respondWithResult(_0x1c2414,null))[_0xbea0('0x49')](handleError(_0x1c2414,null));};exports['create']=function(_0x118867,_0x4b0f37){return db['SquareReport']['create'](_0x118867[_0xbea0('0x4a')],{})['then'](respondWithResult(_0x4b0f37,0xc9))[_0xbea0('0x49')](handleError(_0x4b0f37,null));};exports[_0xbea0('0x4b')]=function(_0x26d880,_0x20e3a7){if(_0x26d880[_0xbea0('0x4a')]['id']){delete _0x26d880['body']['id'];}return db['SquareReport']['find']({'where':{'id':_0x26d880['params']['id']}})[_0xbea0('0x28')](handleEntityNotFound(_0x20e3a7,null))[_0xbea0('0x28')](saveUpdates(_0x26d880[_0xbea0('0x4a')],null))[_0xbea0('0x28')](respondWithResult(_0x20e3a7,null))[_0xbea0('0x49')](handleError(_0x20e3a7,null));};exports['destroy']=function(_0x4ffbaa,_0x2b6db9){return db[_0xbea0('0x2e')][_0xbea0('0x48')]({'where':{'id':_0x4ffbaa['params']['id']}})['then'](handleEntityNotFound(_0x2b6db9,null))[_0xbea0('0x28')](removeEntity(_0x2b6db9,null))[_0xbea0('0x49')](handleError(_0x2b6db9,null));};exports['describe']=function(_0x5bc796,_0x15c260){return db[_0xbea0('0x2e')][_0xbea0('0x4c')]()['then'](respondWithResult(_0x15c260,null))['catch'](handleError(_0x15c260,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 8a4ceca..1ffee14 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 _0xc9fa=['uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square'];(function(_0x37afab,_0x20ba27){var _0x3d5018=function(_0x5968fc){while(--_0x5968fc){_0x37afab['push'](_0x37afab['shift']());}};_0x3d5018(++_0x20ba27);}(_0xc9fa,0x1a8));var _0xac9f=function(_0x4dd210,_0x585025){_0x4dd210=_0x4dd210-0x0;var _0x48885f=_0xc9fa[_0x4dd210];return _0x48885f;};'use strict';var _=require('lodash');var util=require(_0xac9f('0x0'));var logger=require(_0xac9f('0x1'))('api');var moment=require(_0xac9f('0x2'));var BPromise=require('bluebird');var rp=require(_0xac9f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac9f('0x4'));var config=require(_0xac9f('0x5'));var attributes=require(_0xac9f('0x6'));module[_0xac9f('0x7')]=function(_0x187b71,_0x2cdc90){return _0x187b71[_0xac9f('0x8')]('SquareReport',attributes,{'tableName':_0xac9f('0x9'),'paranoid':![],'indexes':[{'name':_0xac9f('0xa'),'fields':[_0xac9f('0xb'),_0xac9f('0xc')]},{'name':'leaveAt','fields':[_0xac9f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16e0=['bluebird','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','moment'];(function(_0x4578f8,_0x199c11){var _0x1129f1=function(_0x8a4369){while(--_0x8a4369){_0x4578f8['push'](_0x4578f8['shift']());}};_0x1129f1(++_0x199c11);}(_0x16e0,0x101));var _0x016e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x16e0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x016e('0x0'));var util=require(_0x016e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x016e('0x2'));var BPromise=require(_0x016e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x016e('0x4'));var config=require(_0x016e('0x5'));var attributes=require(_0x016e('0x6'));module['exports']=function(_0xfdd246,_0x4048ba){return _0xfdd246[_0x016e('0x7')](_0x016e('0x8'),attributes,{'tableName':_0x016e('0x9'),'paranoid':![],'indexes':[{'name':_0x016e('0xa'),'fields':['uniqueid',_0x016e('0xb')]},{'name':_0x016e('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index b7cd5f1..e93cecc 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 _0x72a8=['SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','CreateSquareReport','debug','UpdateSquareReport','body','raw','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x320fa3,_0x1a10c5){var _0x2a0ba3=function(_0x708eff){while(--_0x708eff){_0x320fa3['push'](_0x320fa3['shift']());}};_0x2a0ba3(++_0x1a10c5);}(_0x72a8,0xe3));var _0x872a=function(_0x5e221f,_0xf62c4f){_0x5e221f=_0x5e221f-0x0;var _0x33329c=_0x72a8[_0x5e221f];return _0x33329c;};'use strict';var _=require(_0x872a('0x0'));var util=require('util');var moment=require(_0x872a('0x1'));var BPromise=require('bluebird');var rs=require(_0x872a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x872a('0x3'))['db'];var utils=require(_0x872a('0x4'));var logger=require(_0x872a('0x5'))('rpc');var config=require(_0x872a('0x6'));var jayson=require(_0x872a('0x7'));var client=jayson[_0x872a('0x8')][_0x872a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e268a,_0x203fa4,_0xf6e4d8){return new BPromise(function(_0x3ecdc8,_0x9a0711){return client[_0x872a('0xa')](_0x5e268a,_0xf6e4d8)[_0x872a('0xb')](function(_0x4fb679){logger[_0x872a('0xc')](_0x872a('0xd'),_0x203fa4,_0x872a('0xe'));logger['debug'](_0x872a('0xf'),_0x203fa4,_0x872a('0xe'),JSON[_0x872a('0x10')](_0x4fb679));if(_0x4fb679[_0x872a('0x11')]){if(_0x4fb679[_0x872a('0x11')][_0x872a('0x12')]===0x1f4){logger[_0x872a('0x11')](_0x872a('0xd'),_0x203fa4,_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);return _0x9a0711(_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x203fa4,_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);return _0x3ecdc8(_0x4fb679[_0x872a('0x11')][_0x872a('0x13')]);}else{logger[_0x872a('0xc')]('SquareReport,\x20%s,\x20%s',_0x203fa4,_0x872a('0xe'));_0x3ecdc8(_0x4fb679[_0x872a('0x14')][_0x872a('0x13')]);}})[_0x872a('0x15')](function(_0x55bdaf){logger[_0x872a('0x11')](_0x872a('0xd'),_0x203fa4,_0x55bdaf);_0x9a0711(_0x55bdaf);});});}exports['CreateSquareReport']=function(_0x379720){var _0x118c27=this;return new Promise(function(_0x5f0b47,_0x5debb5){return db['SquareReport'][_0x872a('0x16')](_0x379720['body'],{'raw':_0x379720[_0x872a('0x17')]?_0x379720['options']['raw']===undefined?!![]:![]:!![]})[_0x872a('0xb')](function(_0x2c5d73){logger[_0x872a('0xc')](_0x872a('0x18'),_0x379720);logger[_0x872a('0x19')](_0x872a('0x18'),_0x379720,JSON[_0x872a('0x10')](_0x2c5d73));_0x5f0b47(_0x2c5d73);})['catch'](function(_0x23a0a5){logger[_0x872a('0x11')](_0x872a('0x18'),_0x23a0a5['message'],_0x379720);_0x5debb5(_0x118c27[_0x872a('0x11')](0x1f4,_0x23a0a5[_0x872a('0x13')]));});});};exports[_0x872a('0x1a')]=function(_0x5abf70){var _0x2e2796=this;return new Promise(function(_0x383a38,_0x22cb01){return db['SquareReport']['update'](_0x5abf70[_0x872a('0x1b')],{'raw':_0x5abf70[_0x872a('0x17')]?_0x5abf70[_0x872a('0x17')][_0x872a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5abf70[_0x872a('0x17')]?_0x5abf70[_0x872a('0x17')]['where']||null:null,'attributes':_0x5abf70[_0x872a('0x17')]?_0x5abf70[_0x872a('0x17')]['attributes']||null:null,'limit':_0x5abf70[_0x872a('0x17')]?_0x5abf70['options'][_0x872a('0x1d')]||null:null})[_0x872a('0xb')](function(_0x1fd316){logger[_0x872a('0xc')](_0x872a('0x1a'),_0x5abf70);logger[_0x872a('0x19')](_0x872a('0x1a'),_0x5abf70,JSON[_0x872a('0x10')](_0x1fd316));_0x383a38(_0x1fd316);})[_0x872a('0x15')](function(_0x524d8d){logger[_0x872a('0x11')](_0x872a('0x1a'),_0x524d8d[_0x872a('0x13')],_0x5abf70);_0x22cb01(_0x2e2796[_0x872a('0x11')](0x1f4,_0x524d8d['message']));});});}; \ No newline at end of file +var _0x77e1=['stringify','error','code','message','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','create','options','raw','then','update','body','where','attributes','UpdateSquareReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug'];(function(_0x2f4069,_0x74eb6c){var _0x4e5d90=function(_0x56fedf){while(--_0x56fedf){_0x2f4069['push'](_0x2f4069['shift']());}};_0x4e5d90(++_0x74eb6c);}(_0x77e1,0x92));var _0x177e=function(_0x48da68,_0x132675){_0x48da68=_0x48da68-0x0;var _0x512f87=_0x77e1[_0x48da68];return _0x512f87;};'use strict';var _=require(_0x177e('0x0'));var util=require(_0x177e('0x1'));var moment=require(_0x177e('0x2'));var BPromise=require(_0x177e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x177e('0x4'));var db=require(_0x177e('0x5'))['db'];var utils=require(_0x177e('0x6'));var logger=require(_0x177e('0x7'))('rpc');var config=require(_0x177e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x177e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f21a0,_0x8fe65d,_0x1ee08b){return new BPromise(function(_0x3c32f2,_0x1ee4e8){return client[_0x177e('0xa')](_0x4f21a0,_0x1ee08b)['then'](function(_0x1605d9){logger[_0x177e('0xb')]('SquareReport,\x20%s,\x20%s',_0x8fe65d,_0x177e('0xc'));logger[_0x177e('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x8fe65d,'request\x20sent',JSON[_0x177e('0xe')](_0x1605d9));if(_0x1605d9[_0x177e('0xf')]){if(_0x1605d9[_0x177e('0xf')][_0x177e('0x10')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x8fe65d,_0x1605d9['error'][_0x177e('0x11')]);return _0x1ee4e8(_0x1605d9[_0x177e('0xf')][_0x177e('0x11')]);}logger[_0x177e('0xf')](_0x177e('0x12'),_0x8fe65d,_0x1605d9[_0x177e('0xf')]['message']);return _0x3c32f2(_0x1605d9[_0x177e('0xf')][_0x177e('0x11')]);}else{logger[_0x177e('0xb')]('SquareReport,\x20%s,\x20%s',_0x8fe65d,_0x177e('0xc'));_0x3c32f2(_0x1605d9[_0x177e('0x13')][_0x177e('0x11')]);}})[_0x177e('0x14')](function(_0xbd918d){logger[_0x177e('0xf')](_0x177e('0x12'),_0x8fe65d,_0xbd918d);_0x1ee4e8(_0xbd918d);});});}exports[_0x177e('0x15')]=function(_0x3290e4){var _0xe1a99f=this;return new Promise(function(_0x1b42f8,_0x4b14bd){return db[_0x177e('0x16')][_0x177e('0x17')](_0x3290e4['body'],{'raw':_0x3290e4[_0x177e('0x18')]?_0x3290e4['options'][_0x177e('0x19')]===undefined?!![]:![]:!![]})[_0x177e('0x1a')](function(_0x48fd93){logger['info']('CreateSquareReport',_0x3290e4);logger[_0x177e('0xd')](_0x177e('0x15'),_0x3290e4,JSON[_0x177e('0xe')](_0x48fd93));_0x1b42f8(_0x48fd93);})['catch'](function(_0x2e3e49){logger[_0x177e('0xf')](_0x177e('0x15'),_0x2e3e49[_0x177e('0x11')],_0x3290e4);_0x4b14bd(_0xe1a99f[_0x177e('0xf')](0x1f4,_0x2e3e49[_0x177e('0x11')]));});});};exports['UpdateSquareReport']=function(_0x3b6106){var _0x48e592=this;return new Promise(function(_0x27b3e6,_0x41db92){return db['SquareReport'][_0x177e('0x1b')](_0x3b6106[_0x177e('0x1c')],{'raw':_0x3b6106[_0x177e('0x18')]?_0x3b6106['options'][_0x177e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b6106['options']?_0x3b6106[_0x177e('0x18')][_0x177e('0x1d')]||null:null,'attributes':_0x3b6106[_0x177e('0x18')]?_0x3b6106[_0x177e('0x18')][_0x177e('0x1e')]||null:null,'limit':_0x3b6106[_0x177e('0x18')]?_0x3b6106[_0x177e('0x18')]['limit']||null:null})[_0x177e('0x1a')](function(_0x3a1846){logger[_0x177e('0xb')](_0x177e('0x1f'),_0x3b6106);logger[_0x177e('0xd')](_0x177e('0x1f'),_0x3b6106,JSON['stringify'](_0x3a1846));_0x27b3e6(_0x3a1846);})[_0x177e('0x14')](function(_0x372312){logger[_0x177e('0xf')]('UpdateSquareReport',_0x372312[_0x177e('0x11')],_0x3b6106);_0x41db92(_0x48e592[_0x177e('0xf')](0x1f4,_0x372312[_0x177e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a1f8287..e048560 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 _0xc9dc=['isAuthenticated','index','describe','/:id','show','post','create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x2567f0,_0x4fa60){var _0x14852a=function(_0x55b95f){while(--_0x55b95f){_0x2567f0['push'](_0x2567f0['shift']());}};_0x14852a(++_0x4fa60);}(_0xc9dc,0x75));var _0xcc9d=function(_0x4a4646,_0x516d11){_0x4a4646=_0x4a4646-0x0;var _0x22d6af=_0xc9dc[_0x4a4646];return _0x22d6af;};'use strict';var multer=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var path=require('path');var timeout=require(_0xcc9d('0x2'));var express=require(_0xcc9d('0x3'));var router=express[_0xcc9d('0x4')]();var fs_extra=require(_0xcc9d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc9d('0x6'));var config=require(_0xcc9d('0x7'));var controller=require('./squareReportDetail.controller');router[_0xcc9d('0x8')]('/',auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xa')]);router['get']('/describe',auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xb')]);router[_0xcc9d('0x8')](_0xcc9d('0xc'),auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xd')]);router[_0xcc9d('0xe')]('/',auth[_0xcc9d('0x9')](),controller[_0xcc9d('0xf')]);router[_0xcc9d('0x10')](_0xcc9d('0xc'),auth[_0xcc9d('0x9')](),controller['update']);router['delete']('/:id',auth[_0xcc9d('0x9')](),controller['destroy']);module[_0xcc9d('0x11')]=router; \ No newline at end of file +var _0x34af=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe'];(function(_0x2a66b8,_0x2f9832){var _0x10e01c=function(_0x4c0914){while(--_0x4c0914){_0x2a66b8['push'](_0x2a66b8['shift']());}};_0x10e01c(++_0x2f9832);}(_0x34af,0x1ad));var _0xf34a=function(_0x146e34,_0x35a8be){_0x146e34=_0x146e34-0x0;var _0x13e10c=_0x34af[_0x146e34];return _0x13e10c;};'use strict';var multer=require(_0xf34a('0x0'));var util=require('util');var path=require(_0xf34a('0x1'));var timeout=require(_0xf34a('0x2'));var express=require('express');var router=express[_0xf34a('0x3')]();var fs_extra=require(_0xf34a('0x4'));var auth=require(_0xf34a('0x5'));var interaction=require(_0xf34a('0x6'));var config=require(_0xf34a('0x7'));var controller=require(_0xf34a('0x8'));router['get']('/',auth[_0xf34a('0x9')](),controller['index']);router[_0xf34a('0xa')](_0xf34a('0xb'),auth[_0xf34a('0x9')](),controller[_0xf34a('0xc')]);router['get'](_0xf34a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf34a('0xe')]('/',auth[_0xf34a('0x9')](),controller[_0xf34a('0xf')]);router[_0xf34a('0x10')](_0xf34a('0xd'),auth[_0xf34a('0x9')](),controller[_0xf34a('0x11')]);router[_0xf34a('0x12')](_0xf34a('0xd'),auth[_0xf34a('0x9')](),controller[_0xf34a('0x13')]);module[_0xf34a('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 7e27816..5d98029 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 _0x8755=['sequelize','exports','STRING','TEXT'];(function(_0x4bfa32,_0x3981db){var _0x403269=function(_0x4f0b9a){while(--_0x4f0b9a){_0x4bfa32['push'](_0x4bfa32['shift']());}};_0x403269(++_0x3981db);}(_0x8755,0x138));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5875('0x0'));module[_0x5875('0x1')]={'uniqueid':{'type':Sequelize[_0x5875('0x2')]},'node':{'type':Sequelize[_0x5875('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x5875('0x3')]},'project_name':{'type':Sequelize[_0x5875('0x2')]},'callerid':{'type':Sequelize[_0x5875('0x2')]}}; \ No newline at end of file +var _0x40c4=['TEXT','sequelize','STRING'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x40c4,0x181));var _0x440c=function(_0x2fd123,_0x3649e4){_0x2fd123=_0x2fd123-0x0;var _0x14686b=_0x40c4[_0x2fd123];return _0x14686b;};'use strict';var Sequelize=require(_0x440c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x440c('0x1')]},'node':{'type':Sequelize[_0x440c('0x1')]},'application':{'type':Sequelize[_0x440c('0x1')]},'data':{'type':Sequelize[_0x440c('0x2')]},'project_name':{'type':Sequelize[_0x440c('0x1')]},'callerid':{'type':Sequelize[_0x440c('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index bcd81ae..93683b0 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 _0x0b5d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x233148,_0x4cb72a){var _0x3d7b70=function(_0x3f6caf){while(--_0x3f6caf){_0x233148['push'](_0x233148['shift']());}};_0x3d7b70(++_0x4cb72a);}(_0x0b5d,0x80));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd0b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0b5('0x2'));var moment=require(_0xd0b5('0x3'));var BPromise=require(_0xd0b5('0x4'));var Mustache=require(_0xd0b5('0x5'));var util=require(_0xd0b5('0x6'));var path=require(_0xd0b5('0x7'));var sox=require(_0xd0b5('0x8'));var csv=require(_0xd0b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0b5('0xa'));var squel=require(_0xd0b5('0xb'));var crypto=require('crypto');var jsforce=require(_0xd0b5('0xc'));var deskjs=require(_0xd0b5('0xd'));var toCsv=require(_0xd0b5('0x9'));var querystring=require(_0xd0b5('0xe'));var Papa=require(_0xd0b5('0xf'));var Redis=require(_0xd0b5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0b5('0x11'));var as=require(_0xd0b5('0x12'));var hardwareService=require(_0xd0b5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd0b5('0x14'));var config=require(_0xd0b5('0x15'));var licenseUtil=require(_0xd0b5('0x16'));var db=require(_0xd0b5('0x17'))['db'];function respondWithStatusCode(_0x9a344b,_0x8ec3e8){_0x8ec3e8=_0x8ec3e8||0xcc;return function(_0x68b64f){if(_0x68b64f){return _0x9a344b[_0xd0b5('0x18')](_0x8ec3e8);}return _0x9a344b[_0xd0b5('0x19')](_0x8ec3e8)['end']();};}function respondWithResult(_0x13c2cd,_0xae6661){_0xae6661=_0xae6661||0xc8;return function(_0x3c2844){if(_0x3c2844){return _0x13c2cd[_0xd0b5('0x19')](_0xae6661)[_0xd0b5('0x1a')](_0x3c2844);}};}function respondWithFilteredResult(_0x337616,_0x29152a){return function(_0x494aec){if(_0x494aec){var _0x4f9a3a=typeof _0x29152a['offset']==='undefined'&&typeof _0x29152a['limit']===_0xd0b5('0x1b');var _0x1187c2=_0x494aec[_0xd0b5('0x1c')];var _0x157c63=_0x4f9a3a?0x0:_0x29152a['offset'];var _0x27ba06=_0x4f9a3a?_0x494aec[_0xd0b5('0x1c')]:_0x29152a[_0xd0b5('0x1d')]+_0x29152a[_0xd0b5('0x1e')];var _0x169ed9;if(_0x27ba06>=_0x1187c2){_0x27ba06=_0x1187c2;_0x169ed9=0xc8;}else{_0x169ed9=0xce;}_0x337616['status'](_0x169ed9);return _0x337616['set'](_0xd0b5('0x1f'),_0x157c63+'-'+_0x27ba06+'/'+_0x1187c2)[_0xd0b5('0x1a')](_0x494aec);}return null;};}function patchUpdates(_0x51b0f0){return function(_0x472844){try{jsonpatch[_0xd0b5('0x20')](_0x472844,_0x51b0f0,!![]);}catch(_0x2e34fc){return BPromise[_0xd0b5('0x21')](_0x2e34fc);}return _0x472844[_0xd0b5('0x22')]();};}function saveUpdates(_0xb20146,_0xff3f5b){return function(_0x49ae61){if(_0x49ae61){return _0x49ae61[_0xd0b5('0x23')](_0xb20146)['then'](function(_0x24daf0){return _0x24daf0;});}return null;};}function removeEntity(_0x1e6dd8,_0x5469bc){return function(_0x7d16b){if(_0x7d16b){return _0x7d16b[_0xd0b5('0x24')]()[_0xd0b5('0x25')](function(){_0x1e6dd8[_0xd0b5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f5d1,_0xc7b99b){return function(_0x2720ce){if(!_0x2720ce){_0x31f5d1[_0xd0b5('0x18')](0x194);}return _0x2720ce;};}function handleError(_0x2e7499,_0x53a822){_0x53a822=_0x53a822||0x1f4;return function(_0x3cce22){logger[_0xd0b5('0x26')](_0x3cce22[_0xd0b5('0x27')]);if(_0x3cce22[_0xd0b5('0x28')]){delete _0x3cce22[_0xd0b5('0x28')];}_0x2e7499['status'](_0x53a822)[_0xd0b5('0x29')](_0x3cce22);};}exports[_0xd0b5('0x2a')]=function(_0x2bcc84,_0x8befe0){var _0xac99c6={},_0x50b072={},_0xcddbf9={'count':0x0,'rows':[]};var _0x2638a5=_[_0xd0b5('0x2b')](db[_0xd0b5('0x2c')][_0xd0b5('0x2d')],function(_0x3bdebb){return{'name':_0x3bdebb[_0xd0b5('0x2e')],'type':_0x3bdebb[_0xd0b5('0x2f')]['key']};});_0x50b072[_0xd0b5('0x30')]=_[_0xd0b5('0x2b')](_0x2638a5,_0xd0b5('0x28'));_0x50b072['query']=_['keys'](_0x2bcc84['query']);_0x50b072[_0xd0b5('0x31')]=_[_0xd0b5('0x32')](_0x50b072['model'],_0x50b072[_0xd0b5('0x33')]);_0xac99c6['attributes']=_[_0xd0b5('0x32')](_0x50b072[_0xd0b5('0x30')],qs[_0xd0b5('0x34')](_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x34')]));_0xac99c6['attributes']=_0xac99c6[_0xd0b5('0x35')][_0xd0b5('0x36')]?_0xac99c6[_0xd0b5('0x35')]:_0x50b072[_0xd0b5('0x30')];if(!_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x37')]('nolimit')){_0xac99c6[_0xd0b5('0x1e')]=qs[_0xd0b5('0x1e')](_0x2bcc84[_0xd0b5('0x33')]['limit']);_0xac99c6['offset']=qs['offset'](_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x1d')]);}_0xac99c6[_0xd0b5('0x38')]=qs[_0xd0b5('0x39')](_0x2bcc84[_0xd0b5('0x33')]['sort']);_0xac99c6[_0xd0b5('0x3a')]=qs[_0xd0b5('0x31')](_[_0xd0b5('0x3b')](_0x2bcc84[_0xd0b5('0x33')],_0x50b072['filters']),_0x2638a5);if(_0x2bcc84[_0xd0b5('0x33')][_0xd0b5('0x3c')]){_0xac99c6[_0xd0b5('0x3a')]=_[_0xd0b5('0x3d')](_0xac99c6[_0xd0b5('0x3a')],{'$or':_[_0xd0b5('0x2b')](_0x2638a5,function(_0x17cb42){if(_0x17cb42[_0xd0b5('0x2f')]!==_0xd0b5('0x3e')){var _0x1a962f={};_0x1a962f[_0x17cb42[_0xd0b5('0x28')]]={'$like':'%'+_0x2bcc84[_0xd0b5('0x33')]['filter']+'%'};return _0x1a962f;}})});}_0xac99c6=_[_0xd0b5('0x3d')]({},_0xac99c6,_0x2bcc84[_0xd0b5('0x3f')]);var _0x508c54={'where':_0xac99c6[_0xd0b5('0x3a')]};return db[_0xd0b5('0x2c')][_0xd0b5('0x1c')](_0x508c54)[_0xd0b5('0x25')](function(_0xf3828d){_0xcddbf9['count']=_0xf3828d;if(_0x2bcc84['query']['includeAll']){_0xac99c6[_0xd0b5('0x40')]=[{'all':!![]}];}return db[_0xd0b5('0x2c')]['findAll'](_0xac99c6);})[_0xd0b5('0x25')](function(_0x27ed62){_0xcddbf9[_0xd0b5('0x41')]=_0x27ed62;return _0xcddbf9;})[_0xd0b5('0x25')](respondWithFilteredResult(_0x8befe0,_0xac99c6))['catch'](handleError(_0x8befe0,null));};exports[_0xd0b5('0x42')]=function(_0x4766a3,_0x40ac73){var _0x2d76e5={'raw':!![],'where':{'id':_0x4766a3[_0xd0b5('0x43')]['id']}},_0x49f6fc={};_0x49f6fc[_0xd0b5('0x30')]=_[_0xd0b5('0x44')](db['SquareDetailsReport'][_0xd0b5('0x2d')]);_0x49f6fc[_0xd0b5('0x33')]=_[_0xd0b5('0x44')](_0x4766a3[_0xd0b5('0x33')]);_0x49f6fc[_0xd0b5('0x31')]=_[_0xd0b5('0x32')](_0x49f6fc[_0xd0b5('0x30')],_0x49f6fc['query']);_0x2d76e5['attributes']=_[_0xd0b5('0x32')](_0x49f6fc['model'],qs[_0xd0b5('0x34')](_0x4766a3[_0xd0b5('0x33')][_0xd0b5('0x34')]));_0x2d76e5[_0xd0b5('0x35')]=_0x2d76e5[_0xd0b5('0x35')][_0xd0b5('0x36')]?_0x2d76e5[_0xd0b5('0x35')]:_0x49f6fc[_0xd0b5('0x30')];if(_0x4766a3[_0xd0b5('0x33')]['includeAll']){_0x2d76e5['include']=[{'all':!![]}];}_0x2d76e5=_[_0xd0b5('0x3d')]({},_0x2d76e5,_0x4766a3['options']);return db[_0xd0b5('0x2c')][_0xd0b5('0x45')](_0x2d76e5)[_0xd0b5('0x25')](handleEntityNotFound(_0x40ac73,null))[_0xd0b5('0x25')](respondWithResult(_0x40ac73,null))[_0xd0b5('0x46')](handleError(_0x40ac73,null));};exports[_0xd0b5('0x47')]=function(_0x15d474,_0x2a2c1a){return db[_0xd0b5('0x2c')]['create'](_0x15d474[_0xd0b5('0x48')],{})['then'](respondWithResult(_0x2a2c1a,0xc9))[_0xd0b5('0x46')](handleError(_0x2a2c1a,null));};exports[_0xd0b5('0x23')]=function(_0x5ed42a,_0x3ca9fc){if(_0x5ed42a['body']['id']){delete _0x5ed42a[_0xd0b5('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x5ed42a[_0xd0b5('0x43')]['id']}})[_0xd0b5('0x25')](handleEntityNotFound(_0x3ca9fc,null))[_0xd0b5('0x25')](saveUpdates(_0x5ed42a['body'],null))[_0xd0b5('0x25')](respondWithResult(_0x3ca9fc,null))['catch'](handleError(_0x3ca9fc,null));};exports['destroy']=function(_0x280412,_0x2ad3c0){return db['SquareDetailsReport']['find']({'where':{'id':_0x280412['params']['id']}})[_0xd0b5('0x25')](handleEntityNotFound(_0x2ad3c0,null))[_0xd0b5('0x25')](removeEntity(_0x2ad3c0,null))[_0xd0b5('0x46')](handleError(_0x2ad3c0,null));};exports['describe']=function(_0x15fb87,_0x4dbdad){return db[_0xd0b5('0x2c')]['describe']()[_0xd0b5('0x25')](respondWithResult(_0x4dbdad,null))[_0xd0b5('0x46')](handleError(_0x4dbdad,null));}; \ No newline at end of file +var _0x43ed=['filter','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','sendStatus','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick'];(function(_0x481ff7,_0x2b6ebb){var _0x1c1573=function(_0x4933fe){while(--_0x4933fe){_0x481ff7['push'](_0x481ff7['shift']());}};_0x1c1573(++_0x2b6ebb);}(_0x43ed,0xeb));var _0xd43e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x43ed[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0xd43e('0x0'));var rimraf=require(_0xd43e('0x1'));var zipdir=require(_0xd43e('0x2'));var jsonpatch=require(_0xd43e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd43e('0x4'));var Mustache=require(_0xd43e('0x5'));var util=require(_0xd43e('0x6'));var path=require(_0xd43e('0x7'));var sox=require(_0xd43e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd43e('0x9'));var _=require(_0xd43e('0xa'));var squel=require('squel');var crypto=require(_0xd43e('0xb'));var jsforce=require(_0xd43e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd43e('0xd'));var querystring=require('querystring');var Papa=require(_0xd43e('0xe'));var Redis=require(_0xd43e('0xf'));var authService=require(_0xd43e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd43e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd43e('0x12'));var utils=require(_0xd43e('0x13'));var config=require(_0xd43e('0x14'));var licenseUtil=require(_0xd43e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53e6d1,_0x36d716){_0x36d716=_0x36d716||0xcc;return function(_0x5a9edb){if(_0x5a9edb){return _0x53e6d1['sendStatus'](_0x36d716);}return _0x53e6d1[_0xd43e('0x16')](_0x36d716)[_0xd43e('0x17')]();};}function respondWithResult(_0x5853bd,_0x546d35){_0x546d35=_0x546d35||0xc8;return function(_0x202d35){if(_0x202d35){return _0x5853bd['status'](_0x546d35)[_0xd43e('0x18')](_0x202d35);}};}function respondWithFilteredResult(_0x401d8e,_0x46841b){return function(_0x3c9493){if(_0x3c9493){var _0x3b8ce7=typeof _0x46841b['offset']===_0xd43e('0x19')&&typeof _0x46841b[_0xd43e('0x1a')]===_0xd43e('0x19');var _0x4784d2=_0x3c9493[_0xd43e('0x1b')];var _0xf04e51=_0x3b8ce7?0x0:_0x46841b['offset'];var _0x2f6272=_0x3b8ce7?_0x3c9493[_0xd43e('0x1b')]:_0x46841b[_0xd43e('0x1c')]+_0x46841b[_0xd43e('0x1a')];var _0x2db6ad;if(_0x2f6272>=_0x4784d2){_0x2f6272=_0x4784d2;_0x2db6ad=0xc8;}else{_0x2db6ad=0xce;}_0x401d8e[_0xd43e('0x16')](_0x2db6ad);return _0x401d8e['set'](_0xd43e('0x1d'),_0xf04e51+'-'+_0x2f6272+'/'+_0x4784d2)[_0xd43e('0x18')](_0x3c9493);}return null;};}function patchUpdates(_0x4deda3){return function(_0x4005de){try{jsonpatch[_0xd43e('0x1e')](_0x4005de,_0x4deda3,!![]);}catch(_0x2a53fc){return BPromise['reject'](_0x2a53fc);}return _0x4005de[_0xd43e('0x1f')]();};}function saveUpdates(_0x1e99ed,_0xa59e18){return function(_0x5b086a){if(_0x5b086a){return _0x5b086a['update'](_0x1e99ed)[_0xd43e('0x20')](function(_0x1c53a7){return _0x1c53a7;});}return null;};}function removeEntity(_0x513581,_0x2952c0){return function(_0x1f1b05){if(_0x1f1b05){return _0x1f1b05[_0xd43e('0x21')]()[_0xd43e('0x20')](function(){_0x513581[_0xd43e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4087e9,_0xdd415f){return function(_0x41a9f3){if(!_0x41a9f3){_0x4087e9[_0xd43e('0x22')](0x194);}return _0x41a9f3;};}function handleError(_0x4c51b2,_0x14bccd){_0x14bccd=_0x14bccd||0x1f4;return function(_0x4cd1e6){logger['error'](_0x4cd1e6[_0xd43e('0x23')]);if(_0x4cd1e6[_0xd43e('0x24')]){delete _0x4cd1e6['name'];}_0x4c51b2[_0xd43e('0x16')](_0x14bccd)[_0xd43e('0x25')](_0x4cd1e6);};}exports[_0xd43e('0x26')]=function(_0x3f99ea,_0x2aa513){var _0x5a7fd7={},_0x145570={},_0x311172={'count':0x0,'rows':[]};var _0x4a8be4=_[_0xd43e('0x27')](db[_0xd43e('0x28')][_0xd43e('0x29')],function(_0x24d2ac){return{'name':_0x24d2ac[_0xd43e('0x2a')],'type':_0x24d2ac[_0xd43e('0x2b')][_0xd43e('0x2c')]};});_0x145570[_0xd43e('0x2d')]=_['map'](_0x4a8be4,'name');_0x145570[_0xd43e('0x2e')]=_[_0xd43e('0x2f')](_0x3f99ea[_0xd43e('0x2e')]);_0x145570[_0xd43e('0x30')]=_[_0xd43e('0x31')](_0x145570[_0xd43e('0x2d')],_0x145570['query']);_0x5a7fd7[_0xd43e('0x32')]=_[_0xd43e('0x31')](_0x145570[_0xd43e('0x2d')],qs[_0xd43e('0x33')](_0x3f99ea[_0xd43e('0x2e')][_0xd43e('0x33')]));_0x5a7fd7[_0xd43e('0x32')]=_0x5a7fd7['attributes']['length']?_0x5a7fd7[_0xd43e('0x32')]:_0x145570[_0xd43e('0x2d')];if(!_0x3f99ea[_0xd43e('0x2e')][_0xd43e('0x34')]('nolimit')){_0x5a7fd7[_0xd43e('0x1a')]=qs[_0xd43e('0x1a')](_0x3f99ea[_0xd43e('0x2e')]['limit']);_0x5a7fd7['offset']=qs[_0xd43e('0x1c')](_0x3f99ea[_0xd43e('0x2e')][_0xd43e('0x1c')]);}_0x5a7fd7[_0xd43e('0x35')]=qs['sort'](_0x3f99ea[_0xd43e('0x2e')][_0xd43e('0x36')]);_0x5a7fd7[_0xd43e('0x37')]=qs[_0xd43e('0x30')](_[_0xd43e('0x38')](_0x3f99ea['query'],_0x145570[_0xd43e('0x30')]),_0x4a8be4);if(_0x3f99ea[_0xd43e('0x2e')][_0xd43e('0x39')]){_0x5a7fd7['where']=_[_0xd43e('0x3a')](_0x5a7fd7[_0xd43e('0x37')],{'$or':_['map'](_0x4a8be4,function(_0x16d231){if(_0x16d231[_0xd43e('0x2b')]!==_0xd43e('0x3b')){var _0x13f412={};_0x13f412[_0x16d231[_0xd43e('0x24')]]={'$like':'%'+_0x3f99ea[_0xd43e('0x2e')][_0xd43e('0x39')]+'%'};return _0x13f412;}})});}_0x5a7fd7=_['merge']({},_0x5a7fd7,_0x3f99ea[_0xd43e('0x3c')]);var _0x18aa31={'where':_0x5a7fd7[_0xd43e('0x37')]};return db['SquareDetailsReport'][_0xd43e('0x1b')](_0x18aa31)[_0xd43e('0x20')](function(_0xb8ac67){_0x311172['count']=_0xb8ac67;if(_0x3f99ea[_0xd43e('0x2e')]['includeAll']){_0x5a7fd7[_0xd43e('0x3d')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x5a7fd7);})[_0xd43e('0x20')](function(_0x18c179){_0x311172[_0xd43e('0x3e')]=_0x18c179;return _0x311172;})[_0xd43e('0x20')](respondWithFilteredResult(_0x2aa513,_0x5a7fd7))[_0xd43e('0x3f')](handleError(_0x2aa513,null));};exports[_0xd43e('0x40')]=function(_0x5aa8ce,_0x53477a){var _0x332832={'raw':!![],'where':{'id':_0x5aa8ce[_0xd43e('0x41')]['id']}},_0x1cb09f={};_0x1cb09f['model']=_[_0xd43e('0x2f')](db[_0xd43e('0x28')]['rawAttributes']);_0x1cb09f[_0xd43e('0x2e')]=_[_0xd43e('0x2f')](_0x5aa8ce['query']);_0x1cb09f['filters']=_[_0xd43e('0x31')](_0x1cb09f['model'],_0x1cb09f[_0xd43e('0x2e')]);_0x332832[_0xd43e('0x32')]=_['intersection'](_0x1cb09f[_0xd43e('0x2d')],qs[_0xd43e('0x33')](_0x5aa8ce[_0xd43e('0x2e')][_0xd43e('0x33')]));_0x332832['attributes']=_0x332832[_0xd43e('0x32')][_0xd43e('0x42')]?_0x332832[_0xd43e('0x32')]:_0x1cb09f[_0xd43e('0x2d')];if(_0x5aa8ce[_0xd43e('0x2e')][_0xd43e('0x43')]){_0x332832[_0xd43e('0x3d')]=[{'all':!![]}];}_0x332832=_['merge']({},_0x332832,_0x5aa8ce['options']);return db[_0xd43e('0x28')][_0xd43e('0x44')](_0x332832)[_0xd43e('0x20')](handleEntityNotFound(_0x53477a,null))[_0xd43e('0x20')](respondWithResult(_0x53477a,null))[_0xd43e('0x3f')](handleError(_0x53477a,null));};exports[_0xd43e('0x45')]=function(_0x2e73fc,_0xe0043d){return db['SquareDetailsReport']['create'](_0x2e73fc[_0xd43e('0x46')],{})[_0xd43e('0x20')](respondWithResult(_0xe0043d,0xc9))[_0xd43e('0x3f')](handleError(_0xe0043d,null));};exports[_0xd43e('0x47')]=function(_0x1a7eb7,_0x5d6049){if(_0x1a7eb7[_0xd43e('0x46')]['id']){delete _0x1a7eb7['body']['id'];}return db['SquareDetailsReport'][_0xd43e('0x44')]({'where':{'id':_0x1a7eb7[_0xd43e('0x41')]['id']}})[_0xd43e('0x20')](handleEntityNotFound(_0x5d6049,null))['then'](saveUpdates(_0x1a7eb7[_0xd43e('0x46')],null))[_0xd43e('0x20')](respondWithResult(_0x5d6049,null))['catch'](handleError(_0x5d6049,null));};exports['destroy']=function(_0x145d16,_0x56375e){return db[_0xd43e('0x28')][_0xd43e('0x44')]({'where':{'id':_0x145d16[_0xd43e('0x41')]['id']}})['then'](handleEntityNotFound(_0x56375e,null))[_0xd43e('0x20')](removeEntity(_0x56375e,null))[_0xd43e('0x3f')](handleError(_0x56375e,null));};exports[_0xd43e('0x48')]=function(_0x57293e,_0x339252){return db['SquareDetailsReport']['describe']()[_0xd43e('0x20')](respondWithResult(_0x339252,null))[_0xd43e('0x3f')](handleError(_0x339252,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index a116398..9b2726c 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 _0x2f55=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','lodash'];(function(_0x3aab1b,_0xddaa33){var _0x3134b0=function(_0x1ea18b){while(--_0x1ea18b){_0x3aab1b['push'](_0x3aab1b['shift']());}};_0x3134b0(++_0xddaa33);}(_0x2f55,0x18b));var _0x52f5=function(_0x449cee,_0x3d88b0){_0x449cee=_0x449cee-0x0;var _0x58de0a=_0x2f55[_0x449cee];return _0x58de0a;};'use strict';var _=require(_0x52f5('0x0'));var util=require(_0x52f5('0x1'));var logger=require(_0x52f5('0x2'))('api');var moment=require(_0x52f5('0x3'));var BPromise=require('bluebird');var rp=require(_0x52f5('0x4'));var fs=require('fs');var path=require(_0x52f5('0x5'));var rimraf=require(_0x52f5('0x6'));var config=require(_0x52f5('0x7'));var attributes=require(_0x52f5('0x8'));module[_0x52f5('0x9')]=function(_0x1e79d8,_0x4ba268){return _0x1e79d8['define'](_0x52f5('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fb3=['path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','util','api','moment','bluebird'];(function(_0x5e2854,_0x386173){var _0x3e4cd5=function(_0x4ed14b){while(--_0x4ed14b){_0x5e2854['push'](_0x5e2854['shift']());}};_0x3e4cd5(++_0x386173);}(_0x2fb3,0x92));var _0x32fb=function(_0x3f45de,_0x73f3e){_0x3f45de=_0x3f45de-0x0;var _0x20f1bd=_0x2fb3[_0x3f45de];return _0x20f1bd;};'use strict';var _=require('lodash');var util=require(_0x32fb('0x0'));var logger=require('../../config/logger')(_0x32fb('0x1'));var moment=require(_0x32fb('0x2'));var BPromise=require(_0x32fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32fb('0x4'));var rimraf=require(_0x32fb('0x5'));var config=require(_0x32fb('0x6'));var attributes=require(_0x32fb('0x7'));module['exports']=function(_0x321279,_0xe11f0d){return _0x321279[_0x32fb('0x8')](_0x32fb('0x9'),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 9634f7c..126f56c 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 _0x36ee=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw'];(function(_0x47a836,_0x5228a9){var _0x1b3d12=function(_0x2350a1){while(--_0x2350a1){_0x47a836['push'](_0x47a836['shift']());}};_0x1b3d12(++_0x5228a9);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')](_0x2184ae['body'],{'raw':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x21e95e){logger[_0xe36e('0x15')](_0xe36e('0x18'),_0x2184ae);logger[_0xe36e('0xe')](_0xe36e('0x18'),_0x2184ae,JSON[_0xe36e('0x11')](_0x21e95e));_0x21d9a3(_0x21e95e);})['catch'](function(_0xd71137){logger[_0xe36e('0x12')](_0xe36e('0x18'),_0xd71137[_0xe36e('0x14')],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0xd71137['message']));});});}; \ No newline at end of file +var _0xa32b=['create','body','CreateSquareDetailsReport','stringify','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','SquareDetailsReport,\x20%s,\x20%s','message','info','result','catch','SquareDetailsReport'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0xa32b,0x68));var _0xba32=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0xa32b[_0x32a81f];return _0x5b67a2;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var moment=require(_0xba32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba32('0x2'));var db=require(_0xba32('0x3'))['db'];var utils=require(_0xba32('0x4'));var logger=require('../../config/logger')(_0xba32('0x5'));var config=require(_0xba32('0x6'));var jayson=require(_0xba32('0x7'));var client=jayson[_0xba32('0x8')][_0xba32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a59,_0x1b1332,_0x4edbc6){return new BPromise(function(_0xcdcc5b,_0x13395b){return client[_0xba32('0xa')](_0x5c5a59,_0x4edbc6)[_0xba32('0xb')](function(_0x5d8f64){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x1b1332,'request\x20sent');logger[_0xba32('0xc')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'),JSON['stringify'](_0x5d8f64));if(_0x5d8f64[_0xba32('0xe')]){if(_0x5d8f64['error']['code']===0x1f4){logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0x13395b(_0x5d8f64[_0xba32('0xe')]['message']);}logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0xcdcc5b(_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);}else{logger[_0xba32('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'));_0xcdcc5b(_0x5d8f64[_0xba32('0x12')][_0xba32('0x10')]);}})[_0xba32('0x13')](function(_0x310dee){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1b1332,_0x310dee);_0x13395b(_0x310dee);});});}exports['CreateSquareDetailsReport']=function(_0x5c3fe6){var _0x234db9=this;return new Promise(function(_0x1ae3ea,_0x42803d){return db[_0xba32('0x14')][_0xba32('0x15')](_0x5c3fe6[_0xba32('0x16')],{'raw':_0x5c3fe6['options']?_0x5c3fe6['options']['raw']===undefined?!![]:![]:!![]})[_0xba32('0xb')](function(_0x51c43a){logger[_0xba32('0x11')](_0xba32('0x17'),_0x5c3fe6);logger[_0xba32('0xc')](_0xba32('0x17'),_0x5c3fe6,JSON[_0xba32('0x18')](_0x51c43a));_0x1ae3ea(_0x51c43a);})[_0xba32('0x13')](function(_0xdfa807){logger['error'](_0xba32('0x17'),_0xdfa807[_0xba32('0x10')],_0x5c3fe6);_0x42803d(_0x234db9[_0xba32('0xe')](0x1f4,_0xdfa807[_0xba32('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 8897da2..2744eb0 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 _0x4eb2=['./system.controller','get','index','/process/:pid/kill','killProcess','express','../../components/auth/service'];(function(_0x146bd4,_0x143604){var _0x209fac=function(_0x11b3ae){while(--_0x11b3ae){_0x146bd4['push'](_0x146bd4['shift']());}};_0x209fac(++_0x143604);}(_0x4eb2,0xf3));var _0x24eb=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x4eb2[_0x1eda20];return _0x31b953;};'use strict';var express=require(_0x24eb('0x0'));var router=express['Router']();var auth=require(_0x24eb('0x1'));var controller=require(_0x24eb('0x2'));router[_0x24eb('0x3')]('/',auth['isAuthenticated'](),controller[_0x24eb('0x4')]);router[_0x24eb('0x3')](_0x24eb('0x5'),auth['isAuthenticated'](),controller[_0x24eb('0x6')]);module['exports']=router; \ No newline at end of file +var _0x65f9=['index','/process/:pid/kill','killProcess','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0xe4744,_0x40ad76){var _0x535a99=function(_0x9d1cde){while(--_0x9d1cde){_0xe4744['push'](_0xe4744['shift']());}};_0x535a99(++_0x40ad76);}(_0x65f9,0x1c3));var _0x965f=function(_0x5641df,_0x482c13){_0x5641df=_0x5641df-0x0;var _0x30f96e=_0x65f9[_0x5641df];return _0x30f96e;};'use strict';var express=require('express');var router=express[_0x965f('0x0')]();var auth=require(_0x965f('0x1'));var controller=require(_0x965f('0x2'));router[_0x965f('0x3')]('/',auth[_0x965f('0x4')](),controller[_0x965f('0x5')]);router[_0x965f('0x3')](_0x965f('0x6'),auth['isAuthenticated'](),controller[_0x965f('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index cafdae1..f4cd91d 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 _0x55f1=['length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split'];(function(_0x1896d2,_0x38e977){var _0xd06e7=function(_0x2ef043){while(--_0x2ef043){_0x1896d2['push'](_0x1896d2['shift']());}};_0xd06e7(++_0x38e977);}(_0x55f1,0x17b));var _0x155f=function(_0xfd0380,_0x20399b){_0xfd0380=_0xfd0380-0x0;var _0x54f7fd=_0x55f1[_0xfd0380];return _0x54f7fd;};'use strict';var info=require(_0x155f('0x0'));var exec=require(_0x155f('0x1'))[_0x155f('0x2')];var logger=require(_0x155f('0x3'))(_0x155f('0x4'));var util=require(_0x155f('0x5'));var BPromise=require('bluebird');var _=require(_0x155f('0x6'));function handleError(_0x4eb66c,_0x11c1fe,_0x36e5b9){_0x11c1fe=_0x11c1fe||0x1f4;return function(_0x4c3691){logger['error'](_0x155f('0x7'),_0x36e5b9,_0x11c1fe,util[_0x155f('0x8')](_0x4c3691,{'showHidden':![],'depth':null}));delete _0x4c3691[_0x155f('0x9')];_0x4eb66c[_0x155f('0xa')](_0x11c1fe)[_0x155f('0xb')](_0x4c3691);};}exports['index']=function(_0x1f9acc,_0x8fc7b3){return info['getAllData']()['then'](function(_0x3dfa33){return _0x8fc7b3[_0x155f('0xa')](0xc8)[_0x155f('0xc')](_0x3dfa33);})[_0x155f('0xd')](function(_0x59a072){return _0x8fc7b3[_0x155f('0xa')](0x1f4)[_0x155f('0xc')](_0x59a072);});};exports[_0x155f('0xe')]=function(_0x30fb54,_0x57cdaa){var _0x28367b=[_0x155f('0xf')];return new BPromise(function(_0x11e0bd,_0x31e426){return exec(util['format'](_0x155f('0x10'),_0x30fb54[_0x155f('0x11')][_0x155f('0x12')]),function(_0x21a530,_0xaff98b,_0x3584ba){if(_0x21a530){return _0x31e426(_0x21a530);}return _0x11e0bd(_0xaff98b);});})[_0x155f('0x13')](function(_0x6c2711){var _0x310a54=![];var _0x310ab4=_0x6c2711[_0x155f('0x14')](/\n/);for(var _0x484716=0x0,_0x47020d=_0x28367b[_0x155f('0x15')];_0x484716<_0x47020d,_0x310a54===![];_0x484716+=0x1){if(_0x6c2711['indexOf'](_0x28367b[_0x484716])>=0x0){_0x310a54=!![];}}if(!_0x310a54){throw new Error(util[_0x155f('0x16')](_0x155f('0x17'),_0x30fb54['params']['pid']));}process['kill'](_0x30fb54['params'][_0x155f('0x12')],_0x155f('0x18'));return _0x57cdaa[_0x155f('0xa')](0xc8)['json']({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x30fb54[_0x155f('0x11')][_0x155f('0x12')])});})[_0x155f('0xd')](handleError(_0x57cdaa,null,_0x155f('0xe')));}; \ No newline at end of file +var _0xac4f=['json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','getAllData','then','catch'];(function(_0x42ac93,_0x5952b2){var _0x465580=function(_0xbd8069){while(--_0xbd8069){_0x42ac93['push'](_0x42ac93['shift']());}};_0x465580(++_0x5952b2);}(_0xac4f,0x136));var _0xfac4=function(_0x277c19,_0x22f714){_0x277c19=_0x277c19-0x0;var _0x3281e5=_0xac4f[_0x277c19];return _0x3281e5;};'use strict';var info=require(_0xfac4('0x0'));var exec=require(_0xfac4('0x1'))[_0xfac4('0x2')];var logger=require('../../config/logger')(_0xfac4('0x3'));var util=require(_0xfac4('0x4'));var BPromise=require(_0xfac4('0x5'));var _=require(_0xfac4('0x6'));function handleError(_0xd3c8f7,_0x31c282,_0x3b513d){_0x31c282=_0x31c282||0x1f4;return function(_0xf19879){logger[_0xfac4('0x7')](_0xfac4('0x8'),_0x3b513d,_0x31c282,util['inspect'](_0xf19879,{'showHidden':![],'depth':null}));delete _0xf19879['name'];_0xd3c8f7[_0xfac4('0x9')](_0x31c282)[_0xfac4('0xa')](_0xf19879);};}exports[_0xfac4('0xb')]=function(_0x162648,_0x2c68d8){return info[_0xfac4('0xc')]()[_0xfac4('0xd')](function(_0x1bee9f){return _0x2c68d8[_0xfac4('0x9')](0xc8)['json'](_0x1bee9f);})[_0xfac4('0xe')](function(_0x259f21){return _0x2c68d8['status'](0x1f4)[_0xfac4('0xf')](_0x259f21);});};exports[_0xfac4('0x10')]=function(_0x5ae72c,_0x1e8cd6){var _0x56007d=[_0xfac4('0x11')];return new BPromise(function(_0x599013,_0x2ee167){return exec(util[_0xfac4('0x12')](_0xfac4('0x13'),_0x5ae72c['params']['pid']),function(_0x76c553,_0x3b77cb,_0x1d72ae){if(_0x76c553){return _0x2ee167(_0x76c553);}return _0x599013(_0x3b77cb);});})[_0xfac4('0xd')](function(_0x5968d7){var _0x54371b=![];var _0x440a39=_0x5968d7[_0xfac4('0x14')](/\n/);for(var _0x3e83b6=0x0,_0x3f43a6=_0x56007d['length'];_0x3e83b6<_0x3f43a6,_0x54371b===![];_0x3e83b6+=0x1){if(_0x5968d7['indexOf'](_0x56007d[_0x3e83b6])>=0x0){_0x54371b=!![];}}if(!_0x54371b){throw new Error(util[_0xfac4('0x12')](_0xfac4('0x15'),_0x5ae72c['params'][_0xfac4('0x16')]));}process[_0xfac4('0x17')](_0x5ae72c['params'][_0xfac4('0x16')],'SIGINT');return _0x1e8cd6[_0xfac4('0x9')](0xc8)[_0xfac4('0xf')]({'message':util[_0xfac4('0x12')](_0xfac4('0x18'),_0x5ae72c['params'][_0xfac4('0x16')])});})[_0xfac4('0xe')](handleError(_0x1e8cd6,null,_0xfac4('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index aa8d7b8..c6f18de 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 _0xdcdb=['index','/:id','show','post','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x158ad5,_0x335477){var _0x264448=function(_0x4da69e){while(--_0x4da69e){_0x158ad5['push'](_0x158ad5['shift']());}};_0x264448(++_0x335477);}(_0xdcdb,0xae));var _0xbdcd=function(_0x2367b2,_0x345751){_0x2367b2=_0x2367b2-0x0;var _0x58c87e=_0xdcdb[_0x2367b2];return _0x58c87e;};'use strict';var multer=require(_0xbdcd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbdcd('0x1'));var express=require(_0xbdcd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbdcd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbdcd('0x4'));var controller=require(_0xbdcd('0x5'));router[_0xbdcd('0x6')]('/',auth[_0xbdcd('0x7')](),controller[_0xbdcd('0x8')]);router[_0xbdcd('0x6')](_0xbdcd('0x9'),auth[_0xbdcd('0x7')](),controller[_0xbdcd('0xa')]);router[_0xbdcd('0xb')]('/',auth[_0xbdcd('0x7')](),controller['create']);router['put'](_0xbdcd('0x9'),auth[_0xbdcd('0x7')](),controller['update']);router[_0xbdcd('0xc')](_0xbdcd('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xbdcd('0xd')]=router; \ No newline at end of file +var _0x3aed=['../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0x3aed,0x1c6));var _0xd3ae=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x3aed[_0x3bab09];return _0x164376;};'use strict';var multer=require(_0xd3ae('0x0'));var util=require(_0xd3ae('0x1'));var path=require(_0xd3ae('0x2'));var timeout=require(_0xd3ae('0x3'));var express=require(_0xd3ae('0x4'));var router=express[_0xd3ae('0x5')]();var fs_extra=require(_0xd3ae('0x6'));var auth=require(_0xd3ae('0x7'));var interaction=require(_0xd3ae('0x8'));var config=require('../../config/environment');var controller=require(_0xd3ae('0x9'));router[_0xd3ae('0xa')]('/',auth[_0xd3ae('0xb')](),controller[_0xd3ae('0xc')]);router[_0xd3ae('0xa')](_0xd3ae('0xd'),auth[_0xd3ae('0xb')](),controller[_0xd3ae('0xe')]);router[_0xd3ae('0xf')]('/',auth['isAuthenticated'](),controller[_0xd3ae('0x10')]);router[_0xd3ae('0x11')](_0xd3ae('0xd'),auth[_0xd3ae('0xb')](),controller[_0xd3ae('0x12')]);router[_0xd3ae('0x13')](_0xd3ae('0xd'),auth[_0xd3ae('0xb')](),controller[_0xd3ae('0x14')]);module[_0xd3ae('0x15')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 846ee63..31c19a5 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 _0xbc4a=['sequelize','exports','STRING'];(function(_0x8a2b25,_0x788ab3){var _0xc174a3=function(_0x5c218f){while(--_0x5c218f){_0x8a2b25['push'](_0x8a2b25['shift']());}};_0xc174a3(++_0x788ab3);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0xbc4a[_0x24679e];return _0x291f21;};'use strict';var Sequelize=require(_0xabc4('0x0'));module[_0xabc4('0x1')]={'name':{'type':Sequelize[_0xabc4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x570f=['STRING','#0091EA','sequelize','exports'];(function(_0x271281,_0x59ba24){var _0x2b28e7=function(_0x35da6d){while(--_0x35da6d){_0x271281['push'](_0x271281['shift']());}};_0x2b28e7(++_0x59ba24);}(_0x570f,0x152));var _0xf570=function(_0x23da4d,_0x63498c){_0x23da4d=_0x23da4d-0x0;var _0x4ae55=_0x570f[_0x23da4d];return _0x4ae55;};'use strict';var Sequelize=require(_0xf570('0x0'));module[_0xf570('0x1')]={'name':{'type':Sequelize[_0xf570('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xf570('0x3')},'description':{'type':Sequelize[_0xf570('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 8e8fb43..278903e 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 _0x702d=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','get','Tags','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Tag','includeAll','include','rows','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x2604d8,_0x445628){var _0x54e7c8=function(_0x255ec4){while(--_0x255ec4){_0x2604d8['push'](_0x2604d8['shift']());}};_0x54e7c8(++_0x445628);}(_0x702d,0x147));var _0xd702=function(_0x20eebc,_0x253840){_0x20eebc=_0x20eebc-0x0;var _0x44309d=_0x702d[_0x20eebc];return _0x44309d;};'use strict';var emlformat=require(_0xd702('0x0'));var rimraf=require(_0xd702('0x1'));var zipdir=require(_0xd702('0x2'));var jsonpatch=require(_0xd702('0x3'));var rp=require(_0xd702('0x4'));var moment=require('moment');var BPromise=require(_0xd702('0x5'));var Mustache=require(_0xd702('0x6'));var util=require(_0xd702('0x7'));var path=require(_0xd702('0x8'));var sox=require('sox');var csv=require(_0xd702('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd702('0xa'));var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0x9'));var querystring=require(_0xd702('0xe'));var Papa=require(_0xd702('0xf'));var Redis=require(_0xd702('0x10'));var authService=require(_0xd702('0x11'));var qs=require(_0xd702('0x12'));var as=require(_0xd702('0x13'));var hardwareService=require(_0xd702('0x14'));var logger=require(_0xd702('0x15'))(_0xd702('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd702('0x17'));var db=require(_0xd702('0x18'))['db'];function respondWithStatusCode(_0x273577,_0x5c0dad){_0x5c0dad=_0x5c0dad||0xcc;return function(_0x13ee5a){if(_0x13ee5a){return _0x273577[_0xd702('0x19')](_0x5c0dad);}return _0x273577[_0xd702('0x1a')](_0x5c0dad)[_0xd702('0x1b')]();};}function respondWithResult(_0x3948f8,_0x181ff2){_0x181ff2=_0x181ff2||0xc8;return function(_0x59dd33){if(_0x59dd33){return _0x3948f8[_0xd702('0x1a')](_0x181ff2)[_0xd702('0x1c')](_0x59dd33);}};}function respondWithFilteredResult(_0x5d7978,_0x707b9){return function(_0x4922f8){if(_0x4922f8){var _0x268c66=typeof _0x707b9[_0xd702('0x1d')]==='undefined'&&typeof _0x707b9[_0xd702('0x1e')]===_0xd702('0x1f');var _0x2a87f2=_0x4922f8['count'];var _0x5b3b1d=_0x268c66?0x0:_0x707b9[_0xd702('0x1d')];var _0x5a296e=_0x268c66?_0x4922f8[_0xd702('0x20')]:_0x707b9[_0xd702('0x1d')]+_0x707b9[_0xd702('0x1e')];var _0x265b1b;if(_0x5a296e>=_0x2a87f2){_0x5a296e=_0x2a87f2;_0x265b1b=0xc8;}else{_0x265b1b=0xce;}_0x5d7978[_0xd702('0x1a')](_0x265b1b);return _0x5d7978[_0xd702('0x21')](_0xd702('0x22'),_0x5b3b1d+'-'+_0x5a296e+'/'+_0x2a87f2)['json'](_0x4922f8);}return null;};}function patchUpdates(_0x4be140){return function(_0x536ca8){try{jsonpatch[_0xd702('0x23')](_0x536ca8,_0x4be140,!![]);}catch(_0x109284){return BPromise['reject'](_0x109284);}return _0x536ca8[_0xd702('0x24')]();};}function saveUpdates(_0x5d91fd,_0xc4c246){return function(_0x5824ec){if(_0x5824ec){return _0x5824ec['update'](_0x5d91fd)['then'](function(_0x21c00e){return _0x21c00e;});}return null;};}function removeEntity(_0xeec2e4,_0x459184){return function(_0x49761c){if(_0x49761c){return _0x49761c[_0xd702('0x25')]()[_0xd702('0x26')](function(){var _0x10599a=_0x49761c[_0xd702('0x27')]({'plain':!![]});var _0x1200ed=_0xd702('0x28');return db[_0xd702('0x29')][_0xd702('0x25')]({'where':{'type':_0x1200ed,'resourceId':_0x10599a['id']}})[_0xd702('0x26')](function(){return _0x49761c;});})['then'](function(){_0xeec2e4[_0xd702('0x1a')](0xcc)[_0xd702('0x1b')]();});}};}function handleEntityNotFound(_0x25e96a,_0x335202){return function(_0xbe4518){if(!_0xbe4518){_0x25e96a[_0xd702('0x19')](0x194);}return _0xbe4518;};}function handleError(_0x797156,_0x22441b){_0x22441b=_0x22441b||0x1f4;return function(_0x5f1084){logger['error'](_0x5f1084[_0xd702('0x2a')]);if(_0x5f1084[_0xd702('0x2b')]){delete _0x5f1084['name'];}_0x797156[_0xd702('0x1a')](_0x22441b)[_0xd702('0x2c')](_0x5f1084);};}exports[_0xd702('0x2d')]=function(_0x2946ae,_0x56e9cd){var _0x213c31={},_0x313281={},_0x1630ed={'count':0x0,'rows':[]};var _0x43fe18=_[_0xd702('0x2e')](db['Tag'][_0xd702('0x2f')],function(_0x219f41){return{'name':_0x219f41[_0xd702('0x30')],'type':_0x219f41['type'][_0xd702('0x31')]};});_0x313281['model']=_['map'](_0x43fe18,_0xd702('0x2b'));_0x313281[_0xd702('0x32')]=_[_0xd702('0x33')](_0x2946ae['query']);_0x313281[_0xd702('0x34')]=_[_0xd702('0x35')](_0x313281['model'],_0x313281[_0xd702('0x32')]);_0x213c31[_0xd702('0x36')]=_[_0xd702('0x35')](_0x313281[_0xd702('0x37')],qs[_0xd702('0x38')](_0x2946ae[_0xd702('0x32')][_0xd702('0x38')]));_0x213c31[_0xd702('0x36')]=_0x213c31[_0xd702('0x36')][_0xd702('0x39')]?_0x213c31[_0xd702('0x36')]:_0x313281[_0xd702('0x37')];if(!_0x2946ae[_0xd702('0x32')]['hasOwnProperty'](_0xd702('0x3a'))){_0x213c31[_0xd702('0x1e')]=qs[_0xd702('0x1e')](_0x2946ae[_0xd702('0x32')][_0xd702('0x1e')]);_0x213c31[_0xd702('0x1d')]=qs[_0xd702('0x1d')](_0x2946ae['query']['offset']);}_0x213c31[_0xd702('0x3b')]=qs[_0xd702('0x3c')](_0x2946ae['query']['sort']);_0x213c31[_0xd702('0x3d')]=qs[_0xd702('0x34')](_['pick'](_0x2946ae[_0xd702('0x32')],_0x313281[_0xd702('0x34')]),_0x43fe18);if(_0x2946ae[_0xd702('0x32')]['filter']){_0x213c31[_0xd702('0x3d')]=_[_0xd702('0x3e')](_0x213c31[_0xd702('0x3d')],{'$or':_['map'](_0x43fe18,function(_0x45acfc){if(_0x45acfc['type']!==_0xd702('0x3f')){var _0x239bec={};_0x239bec[_0x45acfc[_0xd702('0x2b')]]={'$like':'%'+_0x2946ae[_0xd702('0x32')][_0xd702('0x40')]+'%'};return _0x239bec;}})});}_0x213c31=_[_0xd702('0x3e')]({},_0x213c31,_0x2946ae[_0xd702('0x41')]);var _0x388efa={'where':_0x213c31['where']};return db[_0xd702('0x42')][_0xd702('0x20')](_0x388efa)[_0xd702('0x26')](function(_0x3d703e){_0x1630ed[_0xd702('0x20')]=_0x3d703e;if(_0x2946ae['query'][_0xd702('0x43')]){_0x213c31[_0xd702('0x44')]=[{'all':!![]}];}return db[_0xd702('0x42')]['findAll'](_0x213c31);})[_0xd702('0x26')](function(_0x3a1ed5){_0x1630ed[_0xd702('0x45')]=_0x3a1ed5;return _0x1630ed;})[_0xd702('0x26')](respondWithFilteredResult(_0x56e9cd,_0x213c31))['catch'](handleError(_0x56e9cd,null));};exports[_0xd702('0x46')]=function(_0xfa5e9,_0x1743bd){var _0x3579ea={'raw':!![],'where':{'id':_0xfa5e9['params']['id']}},_0x185e4a={};_0x185e4a[_0xd702('0x37')]=_[_0xd702('0x33')](db['Tag']['rawAttributes']);_0x185e4a[_0xd702('0x32')]=_[_0xd702('0x33')](_0xfa5e9[_0xd702('0x32')]);_0x185e4a[_0xd702('0x34')]=_[_0xd702('0x35')](_0x185e4a[_0xd702('0x37')],_0x185e4a[_0xd702('0x32')]);_0x3579ea[_0xd702('0x36')]=_[_0xd702('0x35')](_0x185e4a['model'],qs['fields'](_0xfa5e9[_0xd702('0x32')]['fields']));_0x3579ea[_0xd702('0x36')]=_0x3579ea['attributes'][_0xd702('0x39')]?_0x3579ea['attributes']:_0x185e4a[_0xd702('0x37')];if(_0xfa5e9['query'][_0xd702('0x43')]){_0x3579ea[_0xd702('0x44')]=[{'all':!![]}];}_0x3579ea=_['merge']({},_0x3579ea,_0xfa5e9[_0xd702('0x41')]);return db[_0xd702('0x42')][_0xd702('0x47')](_0x3579ea)[_0xd702('0x26')](handleEntityNotFound(_0x1743bd,null))[_0xd702('0x26')](respondWithResult(_0x1743bd,null))['catch'](handleError(_0x1743bd,null));};exports[_0xd702('0x48')]=function(_0x14c1db,_0x2d09be){return db['Tag'][_0xd702('0x48')](_0x14c1db['body'],{})[_0xd702('0x26')](function(_0x9a970b){var _0x1bd39e=_0x14c1db['user']['get']({'plain':!![]});if(!_0x1bd39e)throw new Error(_0xd702('0x49'));if(_0x1bd39e[_0xd702('0x4a')]===_0xd702('0x4b')){var _0x397e91=_0x9a970b[_0xd702('0x27')]({'plain':!![]});var _0x2274bd=_0xd702('0x28');return db[_0xd702('0x4c')][_0xd702('0x47')]({'where':{'name':_0x2274bd,'userProfileId':_0x1bd39e[_0xd702('0x4d')]},'raw':!![]})['then'](function(_0x4efdc7){if(_0x4efdc7&&_0x4efdc7[_0xd702('0x4e')]===0x0){return db[_0xd702('0x29')][_0xd702('0x48')]({'name':_0x397e91['name'],'resourceId':_0x397e91['id'],'type':_0x4efdc7['name'],'sectionId':_0x4efdc7['id']},{})[_0xd702('0x26')](function(){return _0x9a970b;});}else{return _0x9a970b;}})['catch'](function(_0x46b92e){logger[_0xd702('0x4f')](_0xd702('0x50'),_0x46b92e);throw _0x46b92e;});}return _0x9a970b;})[_0xd702('0x26')](respondWithResult(_0x2d09be,0xc9))[_0xd702('0x51')](handleError(_0x2d09be,null));};exports[_0xd702('0x52')]=function(_0x475e03,_0x2863a3){if(_0x475e03[_0xd702('0x53')]['id']){delete _0x475e03['body']['id'];}return db[_0xd702('0x42')][_0xd702('0x47')]({'where':{'id':_0x475e03[_0xd702('0x54')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x2863a3,null))['then'](saveUpdates(_0x475e03[_0xd702('0x53')],null))['then'](respondWithResult(_0x2863a3,null))[_0xd702('0x51')](handleError(_0x2863a3,null));};exports['destroy']=function(_0x581360,_0x2a31c0){return db[_0xd702('0x42')][_0xd702('0x47')]({'where':{'id':_0x581360[_0xd702('0x54')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x2a31c0,null))[_0xd702('0x26')](removeEntity(_0x2a31c0,null))['catch'](handleError(_0x2a31c0,null));}; \ No newline at end of file +var _0x54ef=['pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','map','Tag','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x5deda9,_0xb06c05){var _0x453001=function(_0x35d17e){while(--_0x35d17e){_0x5deda9['push'](_0x5deda9['shift']());}};_0x453001(++_0xb06c05);}(_0x54ef,0x112));var _0xf54e=function(_0x37cd1f,_0x481e23){_0x37cd1f=_0x37cd1f-0x0;var _0x25dd2b=_0x54ef[_0x37cd1f];return _0x25dd2b;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){var _0x474b61=_0x264a8f[_0xf54e('0x28')]({'plain':!![]});var _0x160160=_0xf54e('0x29');return db[_0xf54e('0x2a')][_0xf54e('0x27')]({'where':{'type':_0x160160,'resourceId':_0x474b61['id']}})[_0xf54e('0x26')](function(){return _0x264a8f;});})[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(!_0x4cbf7c){_0x5390b8[_0xf54e('0x19')](0x194);}return _0x4cbf7c;};}function handleError(_0x5e63f4,_0x15b888){_0x15b888=_0x15b888||0x1f4;return function(_0x269f47){logger[_0xf54e('0x2b')](_0x269f47[_0xf54e('0x2c')]);if(_0x269f47[_0xf54e('0x2d')]){delete _0x269f47[_0xf54e('0x2d')];}_0x5e63f4[_0xf54e('0x1a')](_0x15b888)['send'](_0x269f47);};}exports['index']=function(_0x2f96b1,_0x258d29){var _0x2ec92e={},_0x16d00f={},_0xb2d4c4={'count':0x0,'rows':[]};var _0x133cd7=_[_0xf54e('0x2e')](db[_0xf54e('0x2f')][_0xf54e('0x30')],function(_0x12edc3){return{'name':_0x12edc3['fieldName'],'type':_0x12edc3['type'][_0xf54e('0x31')]};});_0x16d00f[_0xf54e('0x32')]=_['map'](_0x133cd7,_0xf54e('0x2d'));_0x16d00f[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x2f96b1[_0xf54e('0x33')]);_0x16d00f['filters']=_['intersection'](_0x16d00f['model'],_0x16d00f[_0xf54e('0x33')]);_0x2ec92e[_0xf54e('0x35')]=_[_0xf54e('0x36')](_0x16d00f[_0xf54e('0x32')],qs[_0xf54e('0x37')](_0x2f96b1[_0xf54e('0x33')]['fields']));_0x2ec92e['attributes']=_0x2ec92e['attributes'][_0xf54e('0x38')]?_0x2ec92e[_0xf54e('0x35')]:_0x16d00f['model'];if(!_0x2f96b1['query'][_0xf54e('0x39')](_0xf54e('0x3a'))){_0x2ec92e[_0xf54e('0x1d')]=qs['limit'](_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x1d')]);_0x2ec92e['offset']=qs[_0xf54e('0x20')](_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x20')]);}_0x2ec92e[_0xf54e('0x3b')]=qs[_0xf54e('0x3c')](_0x2f96b1[_0xf54e('0x33')]['sort']);_0x2ec92e['where']=qs[_0xf54e('0x3d')](_[_0xf54e('0x3e')](_0x2f96b1[_0xf54e('0x33')],_0x16d00f['filters']),_0x133cd7);if(_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x3f')]){_0x2ec92e[_0xf54e('0x40')]=_[_0xf54e('0x41')](_0x2ec92e[_0xf54e('0x40')],{'$or':_[_0xf54e('0x2e')](_0x133cd7,function(_0x17c7ec){if(_0x17c7ec[_0xf54e('0x42')]!==_0xf54e('0x43')){var _0x2087b3={};_0x2087b3[_0x17c7ec[_0xf54e('0x2d')]]={'$like':'%'+_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x3f')]+'%'};return _0x2087b3;}})});}_0x2ec92e=_[_0xf54e('0x41')]({},_0x2ec92e,_0x2f96b1[_0xf54e('0x44')]);var _0x5085c1={'where':_0x2ec92e['where']};return db['Tag'][_0xf54e('0x1f')](_0x5085c1)[_0xf54e('0x26')](function(_0x5398b2){_0xb2d4c4[_0xf54e('0x1f')]=_0x5398b2;if(_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x45')]){_0x2ec92e['include']=[{'all':!![]}];}return db[_0xf54e('0x2f')][_0xf54e('0x46')](_0x2ec92e);})[_0xf54e('0x26')](function(_0x794be7){_0xb2d4c4[_0xf54e('0x47')]=_0x794be7;return _0xb2d4c4;})[_0xf54e('0x26')](respondWithFilteredResult(_0x258d29,_0x2ec92e))[_0xf54e('0x48')](handleError(_0x258d29,null));};exports[_0xf54e('0x49')]=function(_0x5b4ea1,_0x47bedd){var _0x11c736={'raw':!![],'where':{'id':_0x5b4ea1[_0xf54e('0x4a')]['id']}},_0x3447fd={};_0x3447fd[_0xf54e('0x32')]=_[_0xf54e('0x34')](db[_0xf54e('0x2f')]['rawAttributes']);_0x3447fd[_0xf54e('0x33')]=_['keys'](_0x5b4ea1[_0xf54e('0x33')]);_0x3447fd['filters']=_[_0xf54e('0x36')](_0x3447fd[_0xf54e('0x32')],_0x3447fd[_0xf54e('0x33')]);_0x11c736['attributes']=_[_0xf54e('0x36')](_0x3447fd[_0xf54e('0x32')],qs[_0xf54e('0x37')](_0x5b4ea1[_0xf54e('0x33')][_0xf54e('0x37')]));_0x11c736['attributes']=_0x11c736[_0xf54e('0x35')][_0xf54e('0x38')]?_0x11c736[_0xf54e('0x35')]:_0x3447fd[_0xf54e('0x32')];if(_0x5b4ea1['query'][_0xf54e('0x45')]){_0x11c736[_0xf54e('0x4b')]=[{'all':!![]}];}_0x11c736=_['merge']({},_0x11c736,_0x5b4ea1[_0xf54e('0x44')]);return db[_0xf54e('0x2f')][_0xf54e('0x4c')](_0x11c736)[_0xf54e('0x26')](handleEntityNotFound(_0x47bedd,null))['then'](respondWithResult(_0x47bedd,null))[_0xf54e('0x48')](handleError(_0x47bedd,null));};exports[_0xf54e('0x4d')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x2f')][_0xf54e('0x4d')](_0x2527f6[_0xf54e('0x4e')],{})[_0xf54e('0x26')](function(_0x15bfef){var _0x21f2f8=_0x2527f6[_0xf54e('0x4f')][_0xf54e('0x28')]({'plain':!![]});if(!_0x21f2f8)throw new Error(_0xf54e('0x50'));if(_0x21f2f8[_0xf54e('0x51')]===_0xf54e('0x4f')){var _0xa6c305=_0x15bfef[_0xf54e('0x28')]({'plain':!![]});var _0xe9338b=_0xf54e('0x29');return db[_0xf54e('0x52')]['find']({'where':{'name':_0xe9338b,'userProfileId':_0x21f2f8['userProfileId']},'raw':!![]})[_0xf54e('0x26')](function(_0x1106bb){if(_0x1106bb&&_0x1106bb[_0xf54e('0x53')]===0x0){return db[_0xf54e('0x2a')][_0xf54e('0x4d')]({'name':_0xa6c305[_0xf54e('0x2d')],'resourceId':_0xa6c305['id'],'type':_0x1106bb[_0xf54e('0x2d')],'sectionId':_0x1106bb['id']},{})[_0xf54e('0x26')](function(){return _0x15bfef;});}else{return _0x15bfef;}})[_0xf54e('0x48')](function(_0xdf63c4){logger[_0xf54e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdf63c4);throw _0xdf63c4;});}return _0x15bfef;})[_0xf54e('0x26')](respondWithResult(_0xb4654f,0xc9))[_0xf54e('0x48')](handleError(_0xb4654f,null));};exports[_0xf54e('0x25')]=function(_0x37e4f8,_0x1b8f16){if(_0x37e4f8[_0xf54e('0x4e')]['id']){delete _0x37e4f8[_0xf54e('0x4e')]['id'];}return db['Tag'][_0xf54e('0x4c')]({'where':{'id':_0x37e4f8[_0xf54e('0x4a')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0x1b8f16,null))['then'](saveUpdates(_0x37e4f8[_0xf54e('0x4e')],null))['then'](respondWithResult(_0x1b8f16,null))[_0xf54e('0x48')](handleError(_0x1b8f16,null));};exports[_0xf54e('0x27')]=function(_0x3e2fd1,_0x5b882f){return db[_0xf54e('0x2f')][_0xf54e('0x4c')]({'where':{'id':_0x3e2fd1[_0xf54e('0x4a')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0x5b882f,null))[_0xf54e('0x26')](removeEntity(_0x5b882f,null))[_0xf54e('0x48')](handleError(_0x5b882f,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 46af968..9bbe0af 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 _0x72f8=['rimraf','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5ac602,_0x5a92a4){var _0x464a2d=function(_0x5b4bc2){while(--_0x5b4bc2){_0x5ac602['push'](_0x5ac602['shift']());}};_0x464a2d(++_0x5a92a4);}(_0x72f8,0x6e));var _0x872f=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x72f8[_0x2962d5];return _0x273406;};'use strict';var _=require(_0x872f('0x0'));var util=require(_0x872f('0x1'));var logger=require(_0x872f('0x2'))(_0x872f('0x3'));var moment=require(_0x872f('0x4'));var BPromise=require(_0x872f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x872f('0x6'));var rimraf=require(_0x872f('0x7'));var config=require(_0x872f('0x8'));var attributes=require(_0x872f('0x9'));module[_0x872f('0xa')]=function(_0x3bb376,_0x1f7d52){return _0x3bb376[_0x872f('0xb')]('Tag',attributes,{'tableName':_0x872f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ea7=['exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x75865d,_0x17c78b){var _0xc1149b=function(_0x5cfa01){while(--_0x5cfa01){_0x75865d['push'](_0x75865d['shift']());}};_0xc1149b(++_0x17c78b);}(_0x3ea7,0x1ee));var _0x73ea=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x3ea7[_0x172747];return _0x509692;};'use strict';var _=require(_0x73ea('0x0'));var util=require(_0x73ea('0x1'));var logger=require(_0x73ea('0x2'))(_0x73ea('0x3'));var moment=require(_0x73ea('0x4'));var BPromise=require(_0x73ea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73ea('0x6'));var rimraf=require(_0x73ea('0x7'));var config=require(_0x73ea('0x8'));var attributes=require(_0x73ea('0x9'));module[_0x73ea('0xa')]=function(_0x4b34e9,_0x5ca325){return _0x4b34e9[_0x73ea('0xb')](_0x73ea('0xc'),attributes,{'tableName':_0x73ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 0af37c7..490f61c 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6b1=['catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','Tag,\x20%s,\x20%s','message','info','result'];(function(_0xe4971c,_0x5e5ae2){var _0x1f5c80=function(_0x382d57){while(--_0x382d57){_0xe4971c['push'](_0xe4971c['shift']());}};_0x1f5c80(++_0x5e5ae2);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb6b1[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Tag,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});} \ No newline at end of file +var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dacc1,_0x161dc7){var _0x670b97=function(_0x575abc){while(--_0x575abc){_0x3dacc1['push'](_0x3dacc1['shift']());}};_0x670b97(++_0x161dc7);}(_0xe14d,0x1ee));var _0xde14=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xe14d[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('Tag,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index d76c62f..5896899 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 2ddd0d5..558fea5 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 _0x0713=['STRING','name'];(function(_0x2d140d,_0x262d51){var _0x4b462c=function(_0x390714){while(--_0x390714){_0x2d140d['push'](_0x2d140d['shift']());}};_0x4b462c(++_0x262d51);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e32bee2..08ee80e 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 _0x87b1=['upsert','isNil','format','SIP/%s','all','UserVoicePrefix','addAgents','spread','removeAgents','emit','getAgents','eml-format','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','stack','name','send','map','Team','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','pick','addQueues','findOne','add','Queues','ids','remove','isArray','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','online','interface','UserVoiceQueueRt'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x87b1,0xa2));var _0x187b=function(_0x40bfde,_0x13168a){_0x40bfde=_0x40bfde-0x0;var _0x3d25ad=_0x87b1[_0x40bfde];return _0x3d25ad;};'use strict';var emlformat=require(_0x187b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x187b('0x1'));var moment=require(_0x187b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x187b('0x3'));var path=require(_0x187b('0x4'));var sox=require(_0x187b('0x5'));var csv=require(_0x187b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x187b('0x7'));var _=require(_0x187b('0x8'));var squel=require(_0x187b('0x9'));var crypto=require(_0x187b('0xa'));var jsforce=require(_0x187b('0xb'));var deskjs=require(_0x187b('0xc'));var toCsv=require(_0x187b('0x6'));var querystring=require(_0x187b('0xd'));var Papa=require(_0x187b('0xe'));var Redis=require(_0x187b('0xf'));var authService=require(_0x187b('0x10'));var qs=require(_0x187b('0x11'));var as=require(_0x187b('0x12'));var hardwareService=require(_0x187b('0x13'));var logger=require(_0x187b('0x14'))(_0x187b('0x15'));var utils=require('../../config/utils');var config=require(_0x187b('0x16'));var licenseUtil=require(_0x187b('0x17'));var db=require(_0x187b('0x18'))['db'];config['redis']=_[_0x187b('0x19')](config[_0x187b('0x1a')],{'host':_0x187b('0x1b'),'port':0x18eb});var socket=require(_0x187b('0x1c'))(new Redis(config[_0x187b('0x1a')]));require(_0x187b('0x1d'))['register'](socket);function respondWithStatusCode(_0x9cd8de,_0x24ebe6){_0x24ebe6=_0x24ebe6||0xcc;return function(_0xb7f582){if(_0xb7f582){return _0x9cd8de[_0x187b('0x1e')](_0x24ebe6);}return _0x9cd8de[_0x187b('0x1f')](_0x24ebe6)[_0x187b('0x20')]();};}function respondWithResult(_0x24dbd4,_0x44dd22){_0x44dd22=_0x44dd22||0xc8;return function(_0x156755){if(_0x156755){return _0x24dbd4[_0x187b('0x1f')](_0x44dd22)[_0x187b('0x21')](_0x156755);}};}function respondWithFilteredResult(_0x23f828,_0x404f2c){return function(_0x383013){if(_0x383013){var _0x3c6de5=typeof _0x404f2c[_0x187b('0x22')]===_0x187b('0x23')&&typeof _0x404f2c[_0x187b('0x24')]===_0x187b('0x23');var _0x5cac25=_0x383013[_0x187b('0x25')];var _0x156991=_0x3c6de5?0x0:_0x404f2c[_0x187b('0x22')];var _0x26f163=_0x3c6de5?_0x383013[_0x187b('0x25')]:_0x404f2c[_0x187b('0x22')]+_0x404f2c[_0x187b('0x24')];var _0x5a4866;if(_0x26f163>=_0x5cac25){_0x26f163=_0x5cac25;_0x5a4866=0xc8;}else{_0x5a4866=0xce;}_0x23f828[_0x187b('0x1f')](_0x5a4866);return _0x23f828['set'](_0x187b('0x26'),_0x156991+'-'+_0x26f163+'/'+_0x5cac25)[_0x187b('0x21')](_0x383013);}return null;};}function patchUpdates(_0x2cdcc0){return function(_0x1fa0ec){try{jsonpatch[_0x187b('0x27')](_0x1fa0ec,_0x2cdcc0,!![]);}catch(_0xfe4af0){return BPromise[_0x187b('0x28')](_0xfe4af0);}return _0x1fa0ec[_0x187b('0x29')]();};}function saveUpdates(_0x211eeb,_0x36c8fd){return function(_0x580f36){if(_0x580f36){return _0x580f36[_0x187b('0x2a')](_0x211eeb)['then'](function(_0x375879){return _0x375879;});}return null;};}function handleEntityNotFound(_0x4b5688,_0x1baaa0){return function(_0x10f51f){if(!_0x10f51f){_0x4b5688[_0x187b('0x1e')](0x194);}return _0x10f51f;};}function handleError(_0x1a3a05,_0x565350){_0x565350=_0x565350||0x1f4;return function(_0x3cb573){logger['error'](_0x3cb573[_0x187b('0x2b')]);if(_0x3cb573['name']){delete _0x3cb573[_0x187b('0x2c')];}_0x1a3a05['status'](_0x565350)[_0x187b('0x2d')](_0x3cb573);};}exports['index']=function(_0x572c28,_0x57e7db){var _0x560731={},_0x4338dd={},_0x4aba2b={'count':0x0,'rows':[]};var _0x7c1b98=_[_0x187b('0x2e')](db[_0x187b('0x2f')][_0x187b('0x30')],function(_0x4a83fa){return{'name':_0x4a83fa['fieldName'],'type':_0x4a83fa[_0x187b('0x31')][_0x187b('0x32')]};});_0x4338dd[_0x187b('0x33')]=_['map'](_0x7c1b98,_0x187b('0x2c'));_0x4338dd[_0x187b('0x34')]=_['keys'](_0x572c28[_0x187b('0x34')]);_0x4338dd[_0x187b('0x35')]=_['intersection'](_0x4338dd[_0x187b('0x33')],_0x4338dd[_0x187b('0x34')]);_0x560731[_0x187b('0x36')]=_[_0x187b('0x37')](_0x4338dd[_0x187b('0x33')],qs[_0x187b('0x38')](_0x572c28[_0x187b('0x34')][_0x187b('0x38')]));_0x560731[_0x187b('0x36')]=_0x560731[_0x187b('0x36')][_0x187b('0x39')]?_0x560731[_0x187b('0x36')]:_0x4338dd[_0x187b('0x33')];if(!_0x572c28['query'][_0x187b('0x3a')](_0x187b('0x3b'))){_0x560731[_0x187b('0x24')]=qs[_0x187b('0x24')](_0x572c28['query'][_0x187b('0x24')]);_0x560731[_0x187b('0x22')]=qs['offset'](_0x572c28[_0x187b('0x34')][_0x187b('0x22')]);}_0x560731[_0x187b('0x3c')]=qs[_0x187b('0x3d')](_0x572c28[_0x187b('0x34')][_0x187b('0x3d')]);_0x560731[_0x187b('0x3e')]=qs['filters'](_['pick'](_0x572c28['query'],_0x4338dd[_0x187b('0x35')]),_0x7c1b98);if(_0x572c28[_0x187b('0x34')][_0x187b('0x3f')]){_0x560731['where']=_[_0x187b('0x40')](_0x560731[_0x187b('0x3e')],{'$or':_['map'](_0x7c1b98,function(_0x11b028){if(_0x11b028['type']!==_0x187b('0x41')){var _0x10685c={};_0x10685c[_0x11b028[_0x187b('0x2c')]]={'$like':'%'+_0x572c28[_0x187b('0x34')][_0x187b('0x3f')]+'%'};return _0x10685c;}})});}_0x560731=_[_0x187b('0x40')]({},_0x560731,_0x572c28[_0x187b('0x42')]);var _0x2eed51={'where':_0x560731[_0x187b('0x3e')]};return db[_0x187b('0x2f')][_0x187b('0x25')](_0x2eed51)[_0x187b('0x43')](function(_0x5d4431){_0x4aba2b[_0x187b('0x25')]=_0x5d4431;if(_0x572c28[_0x187b('0x34')][_0x187b('0x44')]){_0x560731[_0x187b('0x45')]=[{'all':!![]}];}return db[_0x187b('0x2f')][_0x187b('0x46')](_0x560731);})['then'](function(_0x4d0665){_0x4aba2b[_0x187b('0x47')]=_0x4d0665;return _0x4aba2b;})['then'](respondWithFilteredResult(_0x57e7db,_0x560731))[_0x187b('0x48')](handleError(_0x57e7db,null));};exports['show']=function(_0x1bd796,_0x4d6fba){var _0x14a132={'raw':![],'where':{'id':_0x1bd796['params']['id']}},_0x4c0eb5={};_0x4c0eb5['model']=_['keys'](db['Team']['rawAttributes']);_0x4c0eb5[_0x187b('0x34')]=_[_0x187b('0x49')](_0x1bd796['query']);_0x4c0eb5[_0x187b('0x35')]=_[_0x187b('0x37')](_0x4c0eb5['model'],_0x4c0eb5[_0x187b('0x34')]);_0x14a132[_0x187b('0x36')]=_[_0x187b('0x37')](_0x4c0eb5[_0x187b('0x33')],qs[_0x187b('0x38')](_0x1bd796[_0x187b('0x34')][_0x187b('0x38')]));_0x14a132[_0x187b('0x36')]=_0x14a132[_0x187b('0x36')]['length']?_0x14a132[_0x187b('0x36')]:_0x4c0eb5[_0x187b('0x33')];if(_0x1bd796['query'][_0x187b('0x44')]){_0x14a132['include']=[{'all':!![]}];}_0x14a132=_[_0x187b('0x40')]({},_0x14a132,_0x1bd796['options']);return db[_0x187b('0x2f')][_0x187b('0x4a')](_0x14a132)['then'](handleEntityNotFound(_0x4d6fba,null))['then'](respondWithResult(_0x4d6fba,null))[_0x187b('0x48')](handleError(_0x4d6fba,null));};exports['create']=function(_0x2fc37e,_0x546ae9){return db[_0x187b('0x2f')][_0x187b('0x4b')](_0x2fc37e[_0x187b('0x4c')],{})[_0x187b('0x43')](function(_0x2981a5){var _0x44b251=_0x2fc37e[_0x187b('0x4d')][_0x187b('0x4e')]({'plain':!![]});if(!_0x44b251)throw new Error(_0x187b('0x4f'));if(_0x44b251['role']===_0x187b('0x4d')){var _0x55826c=_0x2981a5[_0x187b('0x4e')]({'plain':!![]});var _0x5e7c8e=_0x187b('0x50');return db['UserProfileSection'][_0x187b('0x4a')]({'where':{'name':_0x5e7c8e,'userProfileId':_0x44b251[_0x187b('0x51')]},'raw':!![]})[_0x187b('0x43')](function(_0xab8920){if(_0xab8920&&_0xab8920[_0x187b('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x55826c[_0x187b('0x2c')],'resourceId':_0x55826c['id'],'type':_0xab8920[_0x187b('0x2c')],'sectionId':_0xab8920['id']},{})[_0x187b('0x43')](function(){return _0x2981a5;});}else{return _0x2981a5;}})[_0x187b('0x48')](function(_0x4b9671){logger[_0x187b('0x53')](_0x187b('0x54'),_0x4b9671);throw _0x4b9671;});}return _0x2981a5;})[_0x187b('0x43')](respondWithResult(_0x546ae9,0xc9))['catch'](handleError(_0x546ae9,null));};exports[_0x187b('0x2a')]=function(_0x56428a,_0xa808ec){if(_0x56428a['body']['id']){delete _0x56428a[_0x187b('0x4c')]['id'];}return db[_0x187b('0x2f')]['find']({'where':{'id':_0x56428a[_0x187b('0x55')]['id']}})[_0x187b('0x43')](handleEntityNotFound(_0xa808ec,null))[_0x187b('0x43')](saveUpdates(_0x56428a[_0x187b('0x4c')],null))['then'](respondWithResult(_0xa808ec,null))['catch'](handleError(_0xa808ec,null));};exports[_0x187b('0x56')]=function(_0x6bc33,_0x32ea82){var _0x4beac4=_0x6bc33[_0x187b('0x55')]['id'];var _0x7a774e=[];return db[_0x187b('0x57')][_0x187b('0x58')](function(_0x18586b){var _0x481b35='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x481b35,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b})[_0x187b('0x43')](function(_0x1a00bf){_0x7a774e=_[_0x187b('0x2e')](_0x1a00bf,function(_0x10489b){return Number(_0x10489b[_0x187b('0x5c')]);});})[_0x187b('0x43')](function(){var _0x2c3750='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x2c3750,{'type':db[_0x187b('0x59')][_0x187b('0x5a')]['SELECT'],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x537ab3){var _0x3d4bc2=_[_0x187b('0x2e')](_0x537ab3,function(_0x485a4f){return Number(_0x485a4f[_0x187b('0x5d')]);});return db[_0x187b('0x5e')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'VoiceQueueId':{'$in':_0x3d4bc2}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x490bbe=_0x187b('0x5f')+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x490bbe,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x8788e){var _0x492d27=_[_0x187b('0x2e')](_0x8788e,function(_0x33457e){return Number(_0x33457e['MailQueueId']);});return db[_0x187b('0x60')]['destroy']({'where':{'UserId':{'$in':_0x7a774e},'MailQueueId':{'$in':_0x492d27}},'transaction':_0x18586b});})['then'](function(){var _0x4ea820='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')]['query'](_0x4ea820,{'type':db['Sequelize'][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x3cb682){var _0x1eade3=_['map'](_0x3cb682,function(_0x4d298d){return Number(_0x4d298d[_0x187b('0x61')]);});return db['UserSmsQueue'][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'SmsQueueId':{'$in':_0x1eade3}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x5af1d2=_0x187b('0x62')+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x5af1d2,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x3e164b){var _0x4dc047=_['map'](_0x3e164b,function(_0x29cb26){return Number(_0x29cb26[_0x187b('0x63')]);});return db[_0x187b('0x64')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'ChatQueueId':{'$in':_0x4dc047}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x49ebba='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0x49ebba,{'type':db[_0x187b('0x59')][_0x187b('0x5a')][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x19830a){var _0x2670cc=_[_0x187b('0x2e')](_0x19830a,function(_0x5841a2){return Number(_0x5841a2['FaxQueueId']);});return db[_0x187b('0x65')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'FaxQueueId':{'$in':_0x2670cc}},'transaction':_0x18586b});})['then'](function(){var _0xafdd44='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4beac4;return db[_0x187b('0x57')][_0x187b('0x34')](_0xafdd44,{'type':db[_0x187b('0x59')]['QueryTypes'][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x3b209d){var _0x3f8c26=_[_0x187b('0x2e')](_0x3b209d,function(_0x5ab607){return Number(_0x5ab607[_0x187b('0x66')]);});return db[_0x187b('0x67')][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'OpenchannelQueueId':{'$in':_0x3f8c26}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){var _0x41b80c=_0x187b('0x68')+_0x4beac4;return db['sequelize']['query'](_0x41b80c,{'type':db[_0x187b('0x59')]['QueryTypes'][_0x187b('0x5b')],'raw':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0xa59a2c){var _0x3b9e32=_[_0x187b('0x2e')](_0xa59a2c,function(_0x2bf1e7){return Number(_0x2bf1e7[_0x187b('0x69')]);});return db[_0x187b('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x7a774e},'WhatsappQueueId':{'$in':_0x3b9e32}},'transaction':_0x18586b});})[_0x187b('0x43')](function(){return db[_0x187b('0x6b')][_0x187b('0x4a')]({'where':{'TeamId':_0x4beac4}});})[_0x187b('0x43')](function(_0x3be930){if(_0x3be930===null){return;}return db['UserVoicePrefix'][_0x187b('0x56')]({'where':{'UserId':{'$in':_0x7a774e},'VoicePrefixId':_0x3be930[_0x187b('0x6c')]},'transaction':_0x18586b});})[_0x187b('0x43')](function(){return db[_0x187b('0x2f')][_0x187b('0x56')]({'where':{'id':_0x4beac4},'cascade':!![],'transaction':_0x18586b});})[_0x187b('0x43')](function(_0x2e5ee7){if(_0x2e5ee7===0x0){_0x32ea82[_0x187b('0x1e')](0x194);}else{return db['UserProfileResource'][_0x187b('0x56')]({'where':{'type':'Teams','resourceId':_0x4beac4},'cascade':!![],'transaction':_0x18586b})[_0x187b('0x43')](function(){_0x32ea82[_0x187b('0x1f')](0xcc)[_0x187b('0x20')]();});}})['catch'](function(_0x340b59){_0x32ea82[_0x187b('0x1f')](0x1f4)[_0x187b('0x2d')](_0x340b59);});});};exports[_0x187b('0x6d')]=function(_0x4d65fc,_0x496d36,_0x37daa3){return db[_0x187b('0x2f')]['findOne']({'where':{'id':_0x4d65fc[_0x187b('0x55')]['id']}})[_0x187b('0x43')](handleEntityNotFound(_0x496d36,null))[_0x187b('0x43')](function(_0x2250b1){if(!_0x4d65fc[_0x187b('0x34')][_0x187b('0x6e')]||!utils[_0x187b('0x6f')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x6e')])){throw new db[(_0x187b('0x59'))][(_0x187b('0x70'))](_0x187b('0x71'));}var _0x39df7b={};var _0x41d028={};_0x41d028['model']=_[_0x187b('0x49')](db[_[_0x187b('0x72')](_0x4d65fc['query']['channel'][_0x187b('0x73')]())+'Queue'][_0x187b('0x30')]);_0x41d028[_0x187b('0x34')]=_[_0x187b('0x49')](_0x4d65fc[_0x187b('0x34')]);_0x41d028[_0x187b('0x35')]=_[_0x187b('0x37')](_0x41d028[_0x187b('0x33')],_0x41d028[_0x187b('0x34')]);_0x39df7b['attributes']=_[_0x187b('0x37')](_0x41d028[_0x187b('0x33')],qs['fields'](_0x4d65fc[_0x187b('0x34')]['fields']));_0x39df7b[_0x187b('0x36')]=_0x39df7b[_0x187b('0x36')][_0x187b('0x39')]?_0x39df7b[_0x187b('0x36')]:_0x41d028[_0x187b('0x33')];_0x39df7b[_0x187b('0x24')]=qs[_0x187b('0x24')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x24')]);_0x39df7b['offset']=qs[_0x187b('0x22')](_0x4d65fc[_0x187b('0x34')]['offset']);_0x39df7b[_0x187b('0x3c')]=qs[_0x187b('0x3d')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x3d')]);_0x39df7b[_0x187b('0x3e')]=qs[_0x187b('0x35')](_[_0x187b('0x74')](_0x4d65fc['query'],_0x41d028[_0x187b('0x35')]));_0x39df7b=_['merge']({},_0x39df7b,_0x4d65fc[_0x187b('0x42')]);return _0x2250b1[_0x187b('0x4e')+_[_0x187b('0x72')](_0x4d65fc[_0x187b('0x34')][_0x187b('0x6e')][_0x187b('0x73')]())+'Queues'](_0x39df7b);})[_0x187b('0x43')](respondWithResult(_0x496d36,null))[_0x187b('0x48')](handleError(_0x496d36,null));};exports[_0x187b('0x75')]=function(_0x117420,_0x335a79,_0x1031e3){return db[_0x187b('0x2f')][_0x187b('0x76')]({'where':{'id':_0x117420['params']['id']}})[_0x187b('0x43')](function(_0x8f0080){if(_0x8f0080){if(!_0x117420['body'][_0x187b('0x6e')]||!utils[_0x187b('0x6f')](_0x117420[_0x187b('0x4c')][_0x187b('0x6e')])){throw new db[(_0x187b('0x59'))][(_0x187b('0x70'))](_0x187b('0x71'));}return _0x8f0080[_0x187b('0x77')+_[_0x187b('0x72')](_0x117420['body']['channel'][_0x187b('0x73')]())+_0x187b('0x78')](_0x117420[_0x187b('0x4c')][_0x187b('0x79')]);}return null;})[_0x187b('0x43')](handleEntityNotFound(_0x335a79,null))[_0x187b('0x43')](respondWithStatusCode(_0x335a79,null))[_0x187b('0x48')](handleError(_0x335a79,null));};exports['removeQueues']=function(_0x606a5b,_0x1a306a,_0x2e73cd){return db['Team'][_0x187b('0x76')]({'where':{'id':_0x606a5b[_0x187b('0x55')]['id']}})[_0x187b('0x43')](function(_0x517784){if(_0x517784){if(!_0x606a5b[_0x187b('0x34')][_0x187b('0x6e')]||!utils[_0x187b('0x6f')](_0x606a5b[_0x187b('0x34')]['channel'])){throw new db['Sequelize'][(_0x187b('0x70'))](_0x187b('0x71'));}return _0x517784[_0x187b('0x7a')+_[_0x187b('0x72')](_0x606a5b['query'][_0x187b('0x6e')][_0x187b('0x73')]())+_0x187b('0x78')](_0x606a5b[_0x187b('0x34')]['ids']);}return null;})[_0x187b('0x43')](handleEntityNotFound(_0x1a306a,null))[_0x187b('0x43')](respondWithStatusCode(_0x1a306a,null))[_0x187b('0x48')](handleError(_0x1a306a,null));};exports['addAgents']=function(_0x3725bc,_0x5bad5a){var _0x31b44c=_[_0x187b('0x7b')](_0x3725bc['body'][_0x187b('0x79')])?_0x3725bc['body'][_0x187b('0x79')]:[_0x3725bc['body']['ids']];var _0x4946a3=_0x3725bc[_0x187b('0x55')]['id'];return db[_0x187b('0x2f')][_0x187b('0x4a')]({'where':{'id':_0x4946a3}})['then'](handleEntityNotFound(_0x5bad5a,null))[_0x187b('0x43')](function(_0x51db24){if(_0x51db24){var _0x2344e3=[_0x187b('0x7c'),'Chat',_0x187b('0x7d'),_0x187b('0x7e'),_0x187b('0x7f'),_0x187b('0x80'),_0x187b('0x81')];return db[_0x187b('0x57')][_0x187b('0x58')](function(_0x14a6a6){var _0x14d4c2=_[_0x187b('0x2e')](_0x2344e3,function(_0x29e385){var _0x11a6b3={'attributes':['id',_0x187b('0x2c')]};if(_0x29e385==='Voice'){_0x11a6b3[_0x187b('0x82')]={'attributes':[_0x187b('0x83')]};}return _0x51db24[_0x187b('0x4e')+_0x29e385+_0x187b('0x78')](_0x11a6b3)[_0x187b('0x43')](function(_0x3ebbb2){var _0x23750c=_[_0x187b('0x2e')](_0x3ebbb2,function(_0x1e2e60){var _0x39132e=_[_0x187b('0x2e')](_0x31b44c,function(_0x59d7ed){var _0x40aba5={'where':{'UserId':_0x59d7ed,[_0x29e385+_0x187b('0x84')]:_0x1e2e60['id']},'transaction':_0x14a6a6};if(_0x29e385==='Voice'){_0x40aba5[_0x187b('0x19')]={'penalty':_0x1e2e60[_0x187b('0x85')][_0x187b('0x83')]};}return db[_0x187b('0x86')+_0x29e385+_0x187b('0x87')][_0x187b('0x88')](_0x40aba5)[_0x187b('0x43')](function(){socket['emit'](_0x187b('0x4d')+_0x29e385+'Queue:save',{'UserId':_0x59d7ed,[_0x29e385+_0x187b('0x84')]:_0x1e2e60['id']});if(_0x29e385!==_0x187b('0x7c')){return;}return db[_0x187b('0x86')]['findAll']({'where':{'id':_0x31b44c,'online':0x1},'attributes':['id',_0x187b('0x2c'),_0x187b('0x89'),'voicePause',_0x187b('0x8a')],'raw':!![]})[_0x187b('0x43')](function(_0x9c342b){var _0x963da7=_[_0x187b('0x2e')](_0x9c342b,function(_0x51844a){return db[_0x187b('0x8b')][_0x187b('0x8c')]({'membername':_0x51844a[_0x187b('0x2c')],'UserId':_0x51844a['id'],'queue_name':_0x1e2e60['name'],'VoiceQueueId':_0x1e2e60['id'],'interface':_[_0x187b('0x8d')](_0x51844a['interface'])?util[_0x187b('0x8e')](_0x187b('0x8f'),_0x51844a[_0x187b('0x2c')]):_0x51844a[_0x187b('0x8a')],'paused':_0x51844a['voicePause']||![],'penalty':_0x1e2e60[_0x187b('0x85')][_0x187b('0x83')]},{'transaction':_0x14a6a6});});return Promise['all'](_0x963da7);});});});return Promise[_0x187b('0x90')](_0x39132e);});return Promise[_0x187b('0x90')](_0x23750c);})[_0x187b('0x43')](function(){return db[_0x187b('0x6b')][_0x187b('0x76')]({'where':{'teamId':_0x4946a3}})[_0x187b('0x43')](function(_0x1649fd){if(_0x1649fd){var _0x3136d7=_[_0x187b('0x2e')](_0x31b44c,function(_0x34edfd){db[_0x187b('0x91')][_0x187b('0x8c')]({'UserId':_0x34edfd,'VoicePrefixId':_0x1649fd[_0x187b('0x6c')]});});return Promise[_0x187b('0x90')](_0x3136d7);}});});});return Promise[_0x187b('0x90')](_0x14d4c2)[_0x187b('0x43')](function(){return _0x51db24[_0x187b('0x92')](_0x31b44c,{'transaction':_0x14a6a6})[_0x187b('0x93')](function(_0x1cfafc){return _0x1cfafc;});});});}})[_0x187b('0x43')](respondWithResult(_0x5bad5a,null))[_0x187b('0x48')](handleError(_0x5bad5a,null));};exports[_0x187b('0x94')]=function(_0x35b2c3,_0x45996c){var _0x329d2e=_[_0x187b('0x7b')](_0x35b2c3['query'][_0x187b('0x79')])?_0x35b2c3['query'][_0x187b('0x79')]:[_0x35b2c3[_0x187b('0x34')]['ids']];var _0x46c52b=_0x35b2c3[_0x187b('0x55')]['id'];return db[_0x187b('0x2f')][_0x187b('0x4a')]({'where':{'id':_0x46c52b}})[_0x187b('0x43')](handleEntityNotFound(_0x45996c,null))[_0x187b('0x43')](function(_0x75f8ec){if(_0x75f8ec){var _0x19ac17=[_0x187b('0x7c'),'Chat',_0x187b('0x7d'),_0x187b('0x7e'),_0x187b('0x7f'),_0x187b('0x80'),'Whatsapp'];return db['sequelize'][_0x187b('0x58')](function(_0x31a345){var _0x1fee94=_['map'](_0x19ac17,function(_0x50335b){var _0x459e0a={'attributes':['id',_0x187b('0x2c')]};return _0x75f8ec[_0x187b('0x4e')+_0x50335b+_0x187b('0x78')](_0x459e0a)[_0x187b('0x43')](function(_0x37657f){var _0x53e197=_['map'](_0x37657f,function(_0x7106ed){return _0x7106ed['removeAgents'](_0x329d2e,{'transaction':_0x31a345})[_0x187b('0x43')](function(){var _0x3cd298=_[_0x187b('0x2e')](_0x329d2e,function(_0x331b3c){socket[_0x187b('0x95')]('user'+_0x50335b+'Queue:remove',{'UserId':Number(_0x331b3c),[_0x50335b+_0x187b('0x84')]:_0x7106ed['id']});if(_0x50335b!==_0x187b('0x7c')){return;}return db[_0x187b('0x8b')][_0x187b('0x56')]({'where':{'VoiceQueueId':_0x7106ed['id'],'UserId':_0x331b3c},'transaction':_0x31a345});});return Promise['all'](_0x3cd298);});});return Promise[_0x187b('0x90')](_0x53e197);});});return Promise[_0x187b('0x90')](_0x1fee94)['then'](function(){return _0x75f8ec[_0x187b('0x94')](_0x329d2e,{'transaction':_0x31a345});})[_0x187b('0x43')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x46c52b}})['then'](function(_0x27acc0){if(_0x27acc0){var _0x355f83=_[_0x187b('0x2e')](_0x329d2e,function(_0xa8133){db[_0x187b('0x91')][_0x187b('0x56')]({'where':{'UserId':_0xa8133,'VoicePrefixId':_0x27acc0['VoicePrefixId']}});});return Promise[_0x187b('0x90')](_0x355f83);}});});});}})[_0x187b('0x43')](respondWithStatusCode(_0x45996c,null))[_0x187b('0x48')](handleError(_0x45996c,null));};exports[_0x187b('0x96')]=function(_0x264592,_0x3c494b,_0xd45f46){var _0x1f622f={};var _0x33ddc5={};var _0x43d003;var _0x18f430;return db['Team']['findOne']({'where':{'id':_0x264592[_0x187b('0x55')]['id']}})['then'](handleEntityNotFound(_0x3c494b,null))[_0x187b('0x43')](function(_0x571fab){if(_0x571fab){_0x43d003=_0x571fab;_0x33ddc5[_0x187b('0x33')]=_[_0x187b('0x49')](db['User']['rawAttributes']);_0x33ddc5[_0x187b('0x34')]=_['keys'](_0x264592[_0x187b('0x34')]);_0x33ddc5['filters']=_[_0x187b('0x37')](_0x33ddc5[_0x187b('0x33')],_0x33ddc5['query']);_0x1f622f[_0x187b('0x36')]=_['intersection'](_0x33ddc5['model'],qs[_0x187b('0x38')](_0x264592[_0x187b('0x34')][_0x187b('0x38')]));_0x1f622f[_0x187b('0x36')]=_0x1f622f[_0x187b('0x36')][_0x187b('0x39')]?_0x1f622f[_0x187b('0x36')]:_0x33ddc5[_0x187b('0x33')];_0x1f622f[_0x187b('0x3c')]=qs[_0x187b('0x3d')](_0x264592[_0x187b('0x34')][_0x187b('0x3d')]);_0x1f622f[_0x187b('0x3e')]=qs[_0x187b('0x35')](_[_0x187b('0x74')](_0x264592[_0x187b('0x34')],_0x33ddc5[_0x187b('0x35')]));if(_0x264592[_0x187b('0x34')][_0x187b('0x3f')]){_0x1f622f[_0x187b('0x3e')]=_[_0x187b('0x40')](_0x1f622f[_0x187b('0x3e')],{'$or':_[_0x187b('0x2e')](_0x1f622f[_0x187b('0x36')],function(_0x259700){var _0x3d94a9={};_0x3d94a9[_0x259700]={'$like':'%'+_0x264592[_0x187b('0x34')][_0x187b('0x3f')]+'%'};return _0x3d94a9;})});}_0x1f622f=_[_0x187b('0x40')]({},_0x1f622f,_0x264592['options']);return _0x43d003['getAgents'](_0x1f622f);}})[_0x187b('0x43')](function(_0x31258d){if(_0x31258d){_0x18f430=_0x31258d[_0x187b('0x39')];if(!_0x264592[_0x187b('0x34')]['hasOwnProperty'](_0x187b('0x3b'))){_0x1f622f[_0x187b('0x24')]=qs[_0x187b('0x24')](_0x264592[_0x187b('0x34')][_0x187b('0x24')]);_0x1f622f['offset']=qs[_0x187b('0x22')](_0x264592[_0x187b('0x34')][_0x187b('0x22')]);}return _0x43d003['getAgents'](_0x1f622f);}})[_0x187b('0x43')](function(_0x4b352b){if(_0x4b352b){return _0x4b352b?{'count':_0x18f430,'rows':_0x4b352b}:null;}})[_0x187b('0x43')](respondWithResult(_0x3c494b,null))['catch'](handleError(_0x3c494b,null));}; \ No newline at end of file +var _0x45d5=['keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','send','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','addQueues','Unknown\x20channel','add','removeQueues','Queues','ids','Voice','Chat','Mail','Sms','Fax','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','UserVoicePrefix','addAgents','spread','removeAgents','isArray','Openchannel','emit','Queue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','stack','name','map','Team','rawAttributes','fieldName','type','model'];(function(_0x1a387a,_0x53ba88){var _0x49496c=function(_0x12a6c4){while(--_0x12a6c4){_0x1a387a['push'](_0x1a387a['shift']());}};_0x49496c(++_0x53ba88);}(_0x45d5,0x1a4));var _0x545d=function(_0xfe8056,_0xf48d86){_0xfe8056=_0xfe8056-0x0;var _0x49dce4=_0x45d5[_0xfe8056];return _0x49dce4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x545d('0x0'));var jsonpatch=require(_0x545d('0x1'));var rp=require(_0x545d('0x2'));var moment=require(_0x545d('0x3'));var BPromise=require(_0x545d('0x4'));var Mustache=require(_0x545d('0x5'));var util=require(_0x545d('0x6'));var path=require(_0x545d('0x7'));var sox=require(_0x545d('0x8'));var csv=require(_0x545d('0x9'));var ejs=require(_0x545d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x545d('0xb'));var crypto=require(_0x545d('0xc'));var jsforce=require(_0x545d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x545d('0x9'));var querystring=require(_0x545d('0xe'));var Papa=require(_0x545d('0xf'));var Redis=require(_0x545d('0x10'));var authService=require(_0x545d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x545d('0x12'))('api');var utils=require(_0x545d('0x13'));var config=require(_0x545d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x545d('0x15'))['db'];config[_0x545d('0x16')]=_[_0x545d('0x17')](config[_0x545d('0x16')],{'host':_0x545d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x545d('0x16')]));require(_0x545d('0x19'))[_0x545d('0x1a')](socket);function respondWithStatusCode(_0x3786a5,_0x897f41){_0x897f41=_0x897f41||0xcc;return function(_0x22e0b0){if(_0x22e0b0){return _0x3786a5[_0x545d('0x1b')](_0x897f41);}return _0x3786a5[_0x545d('0x1c')](_0x897f41)[_0x545d('0x1d')]();};}function respondWithResult(_0x2e4a76,_0x92de94){_0x92de94=_0x92de94||0xc8;return function(_0x2867c1){if(_0x2867c1){return _0x2e4a76[_0x545d('0x1c')](_0x92de94)['json'](_0x2867c1);}};}function respondWithFilteredResult(_0x1d6f5f,_0x44f191){return function(_0x457063){if(_0x457063){var _0x2dd1b9=typeof _0x44f191[_0x545d('0x1e')]===_0x545d('0x1f')&&typeof _0x44f191[_0x545d('0x20')]==='undefined';var _0x4fc76b=_0x457063['count'];var _0x3503a9=_0x2dd1b9?0x0:_0x44f191[_0x545d('0x1e')];var _0x195361=_0x2dd1b9?_0x457063[_0x545d('0x21')]:_0x44f191[_0x545d('0x1e')]+_0x44f191['limit'];var _0x2222d3;if(_0x195361>=_0x4fc76b){_0x195361=_0x4fc76b;_0x2222d3=0xc8;}else{_0x2222d3=0xce;}_0x1d6f5f[_0x545d('0x1c')](_0x2222d3);return _0x1d6f5f[_0x545d('0x22')]('Content-Range',_0x3503a9+'-'+_0x195361+'/'+_0x4fc76b)[_0x545d('0x23')](_0x457063);}return null;};}function patchUpdates(_0x404b84){return function(_0x1565da){try{jsonpatch['apply'](_0x1565da,_0x404b84,!![]);}catch(_0x4b53f4){return BPromise[_0x545d('0x24')](_0x4b53f4);}return _0x1565da[_0x545d('0x25')]();};}function saveUpdates(_0xcde4c3,_0x1c6327){return function(_0x7333a3){if(_0x7333a3){return _0x7333a3[_0x545d('0x26')](_0xcde4c3)[_0x545d('0x27')](function(_0x302e3b){return _0x302e3b;});}return null;};}function handleEntityNotFound(_0x258bb2,_0x252c48){return function(_0x47019f){if(!_0x47019f){_0x258bb2[_0x545d('0x1b')](0x194);}return _0x47019f;};}function handleError(_0x451d1b,_0x1bccb3){_0x1bccb3=_0x1bccb3||0x1f4;return function(_0x4f7c38){logger['error'](_0x4f7c38[_0x545d('0x28')]);if(_0x4f7c38[_0x545d('0x29')]){delete _0x4f7c38[_0x545d('0x29')];}_0x451d1b['status'](_0x1bccb3)['send'](_0x4f7c38);};}exports['index']=function(_0x44cf13,_0x52ec89){var _0x516cc4={},_0x20155e={},_0x5852b3={'count':0x0,'rows':[]};var _0x47b8c6=_[_0x545d('0x2a')](db[_0x545d('0x2b')][_0x545d('0x2c')],function(_0x41f9ab){return{'name':_0x41f9ab[_0x545d('0x2d')],'type':_0x41f9ab[_0x545d('0x2e')]['key']};});_0x20155e[_0x545d('0x2f')]=_[_0x545d('0x2a')](_0x47b8c6,_0x545d('0x29'));_0x20155e['query']=_[_0x545d('0x30')](_0x44cf13[_0x545d('0x31')]);_0x20155e[_0x545d('0x32')]=_[_0x545d('0x33')](_0x20155e['model'],_0x20155e[_0x545d('0x31')]);_0x516cc4[_0x545d('0x34')]=_[_0x545d('0x33')](_0x20155e[_0x545d('0x2f')],qs['fields'](_0x44cf13[_0x545d('0x31')][_0x545d('0x35')]));_0x516cc4['attributes']=_0x516cc4[_0x545d('0x34')][_0x545d('0x36')]?_0x516cc4[_0x545d('0x34')]:_0x20155e[_0x545d('0x2f')];if(!_0x44cf13[_0x545d('0x31')]['hasOwnProperty'](_0x545d('0x37'))){_0x516cc4[_0x545d('0x20')]=qs[_0x545d('0x20')](_0x44cf13['query']['limit']);_0x516cc4[_0x545d('0x1e')]=qs[_0x545d('0x1e')](_0x44cf13[_0x545d('0x31')][_0x545d('0x1e')]);}_0x516cc4[_0x545d('0x38')]=qs[_0x545d('0x39')](_0x44cf13[_0x545d('0x31')][_0x545d('0x39')]);_0x516cc4[_0x545d('0x3a')]=qs[_0x545d('0x32')](_[_0x545d('0x3b')](_0x44cf13[_0x545d('0x31')],_0x20155e[_0x545d('0x32')]),_0x47b8c6);if(_0x44cf13[_0x545d('0x31')][_0x545d('0x3c')]){_0x516cc4[_0x545d('0x3a')]=_['merge'](_0x516cc4[_0x545d('0x3a')],{'$or':_[_0x545d('0x2a')](_0x47b8c6,function(_0x2a4f92){if(_0x2a4f92[_0x545d('0x2e')]!==_0x545d('0x3d')){var _0x2d6257={};_0x2d6257[_0x2a4f92[_0x545d('0x29')]]={'$like':'%'+_0x44cf13['query'][_0x545d('0x3c')]+'%'};return _0x2d6257;}})});}_0x516cc4=_['merge']({},_0x516cc4,_0x44cf13[_0x545d('0x3e')]);var _0x1cb964={'where':_0x516cc4[_0x545d('0x3a')]};return db['Team']['count'](_0x1cb964)['then'](function(_0x2b070d){_0x5852b3[_0x545d('0x21')]=_0x2b070d;if(_0x44cf13[_0x545d('0x31')][_0x545d('0x3f')]){_0x516cc4['include']=[{'all':!![]}];}return db[_0x545d('0x2b')][_0x545d('0x40')](_0x516cc4);})[_0x545d('0x27')](function(_0x344443){_0x5852b3[_0x545d('0x41')]=_0x344443;return _0x5852b3;})[_0x545d('0x27')](respondWithFilteredResult(_0x52ec89,_0x516cc4))[_0x545d('0x42')](handleError(_0x52ec89,null));};exports['show']=function(_0x50ae95,_0x5c5b27){var _0x3f8198={'raw':![],'where':{'id':_0x50ae95[_0x545d('0x43')]['id']}},_0x35bacc={};_0x35bacc[_0x545d('0x2f')]=_['keys'](db[_0x545d('0x2b')]['rawAttributes']);_0x35bacc[_0x545d('0x31')]=_[_0x545d('0x30')](_0x50ae95[_0x545d('0x31')]);_0x35bacc[_0x545d('0x32')]=_[_0x545d('0x33')](_0x35bacc['model'],_0x35bacc[_0x545d('0x31')]);_0x3f8198[_0x545d('0x34')]=_[_0x545d('0x33')](_0x35bacc[_0x545d('0x2f')],qs[_0x545d('0x35')](_0x50ae95[_0x545d('0x31')][_0x545d('0x35')]));_0x3f8198['attributes']=_0x3f8198[_0x545d('0x34')]['length']?_0x3f8198['attributes']:_0x35bacc[_0x545d('0x2f')];if(_0x50ae95['query'][_0x545d('0x3f')]){_0x3f8198[_0x545d('0x44')]=[{'all':!![]}];}_0x3f8198=_[_0x545d('0x45')]({},_0x3f8198,_0x50ae95[_0x545d('0x3e')]);return db[_0x545d('0x2b')][_0x545d('0x46')](_0x3f8198)[_0x545d('0x27')](handleEntityNotFound(_0x5c5b27,null))['then'](respondWithResult(_0x5c5b27,null))[_0x545d('0x42')](handleError(_0x5c5b27,null));};exports[_0x545d('0x47')]=function(_0x429864,_0x532234){return db[_0x545d('0x2b')][_0x545d('0x47')](_0x429864[_0x545d('0x48')],{})[_0x545d('0x27')](function(_0x4beab1){var _0x485e16=_0x429864['user'][_0x545d('0x49')]({'plain':!![]});if(!_0x485e16)throw new Error(_0x545d('0x4a'));if(_0x485e16[_0x545d('0x4b')]===_0x545d('0x4c')){var _0x5ce7af=_0x4beab1[_0x545d('0x49')]({'plain':!![]});var _0x24998e=_0x545d('0x4d');return db[_0x545d('0x4e')][_0x545d('0x46')]({'where':{'name':_0x24998e,'userProfileId':_0x485e16[_0x545d('0x4f')]},'raw':!![]})[_0x545d('0x27')](function(_0x43193f){if(_0x43193f&&_0x43193f[_0x545d('0x50')]===0x0){return db['UserProfileResource'][_0x545d('0x47')]({'name':_0x5ce7af['name'],'resourceId':_0x5ce7af['id'],'type':_0x43193f[_0x545d('0x29')],'sectionId':_0x43193f['id']},{})[_0x545d('0x27')](function(){return _0x4beab1;});}else{return _0x4beab1;}})[_0x545d('0x42')](function(_0x53bfd5){logger['error'](_0x545d('0x51'),_0x53bfd5);throw _0x53bfd5;});}return _0x4beab1;})[_0x545d('0x27')](respondWithResult(_0x532234,0xc9))[_0x545d('0x42')](handleError(_0x532234,null));};exports[_0x545d('0x26')]=function(_0x3e7c93,_0x494fa4){if(_0x3e7c93[_0x545d('0x48')]['id']){delete _0x3e7c93[_0x545d('0x48')]['id'];}return db['Team'][_0x545d('0x46')]({'where':{'id':_0x3e7c93[_0x545d('0x43')]['id']}})[_0x545d('0x27')](handleEntityNotFound(_0x494fa4,null))['then'](saveUpdates(_0x3e7c93[_0x545d('0x48')],null))[_0x545d('0x27')](respondWithResult(_0x494fa4,null))['catch'](handleError(_0x494fa4,null));};exports[_0x545d('0x52')]=function(_0x48eb55,_0x109d7c){var _0x48192c=_0x48eb55[_0x545d('0x43')]['id'];var _0x376339=[];return db[_0x545d('0x53')]['transaction'](function(_0x1719df){var _0x310905=_0x545d('0x54')+_0x48192c;return db[_0x545d('0x53')]['query'](_0x310905,{'type':db[_0x545d('0x55')][_0x545d('0x56')]['SELECT'],'raw':!![],'transaction':_0x1719df})[_0x545d('0x27')](function(_0x3f3446){_0x376339=_[_0x545d('0x2a')](_0x3f3446,function(_0x3decf6){return Number(_0x3decf6[_0x545d('0x57')]);});})['then'](function(){var _0x1f3a8d=_0x545d('0x58')+_0x48192c;return db['sequelize'][_0x545d('0x31')](_0x1f3a8d,{'type':db['Sequelize'][_0x545d('0x56')]['SELECT'],'raw':!![],'transaction':_0x1719df});})['then'](function(_0x2c4d69){var _0x4256ab=_['map'](_0x2c4d69,function(_0x681538){return Number(_0x681538[_0x545d('0x59')]);});return db[_0x545d('0x5a')]['destroy']({'where':{'UserId':{'$in':_0x376339},'VoiceQueueId':{'$in':_0x4256ab}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){var _0xf86932='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x48192c;return db[_0x545d('0x53')][_0x545d('0x31')](_0xf86932,{'type':db[_0x545d('0x55')]['QueryTypes'][_0x545d('0x5b')],'raw':!![],'transaction':_0x1719df});})[_0x545d('0x27')](function(_0x3438d7){var _0x5e5b1a=_['map'](_0x3438d7,function(_0x1df9bd){return Number(_0x1df9bd[_0x545d('0x5c')]);});return db['UserMailQueue'][_0x545d('0x52')]({'where':{'UserId':{'$in':_0x376339},'MailQueueId':{'$in':_0x5e5b1a}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){var _0x1de31b=_0x545d('0x5d')+_0x48192c;return db[_0x545d('0x53')]['query'](_0x1de31b,{'type':db[_0x545d('0x55')]['QueryTypes'][_0x545d('0x5b')],'raw':!![],'transaction':_0x1719df});})[_0x545d('0x27')](function(_0x389a7e){var _0x34d9cd=_['map'](_0x389a7e,function(_0x9ccd43){return Number(_0x9ccd43[_0x545d('0x5e')]);});return db[_0x545d('0x5f')][_0x545d('0x52')]({'where':{'UserId':{'$in':_0x376339},'SmsQueueId':{'$in':_0x34d9cd}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){var _0x283825=_0x545d('0x60')+_0x48192c;return db['sequelize'][_0x545d('0x31')](_0x283825,{'type':db[_0x545d('0x55')]['QueryTypes'][_0x545d('0x5b')],'raw':!![],'transaction':_0x1719df});})[_0x545d('0x27')](function(_0x546c98){var _0x3db9f4=_[_0x545d('0x2a')](_0x546c98,function(_0x18ca58){return Number(_0x18ca58[_0x545d('0x61')]);});return db[_0x545d('0x62')]['destroy']({'where':{'UserId':{'$in':_0x376339},'ChatQueueId':{'$in':_0x3db9f4}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){var _0x22371c=_0x545d('0x63')+_0x48192c;return db[_0x545d('0x53')][_0x545d('0x31')](_0x22371c,{'type':db[_0x545d('0x55')]['QueryTypes'][_0x545d('0x5b')],'raw':!![],'transaction':_0x1719df});})[_0x545d('0x27')](function(_0x533bd1){var _0x2a807c=_[_0x545d('0x2a')](_0x533bd1,function(_0x4d360b){return Number(_0x4d360b[_0x545d('0x64')]);});return db[_0x545d('0x65')][_0x545d('0x52')]({'where':{'UserId':{'$in':_0x376339},'FaxQueueId':{'$in':_0x2a807c}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){var _0x5930fa=_0x545d('0x66')+_0x48192c;return db[_0x545d('0x53')][_0x545d('0x31')](_0x5930fa,{'type':db[_0x545d('0x55')][_0x545d('0x56')]['SELECT'],'raw':!![],'transaction':_0x1719df});})[_0x545d('0x27')](function(_0x59f31b){var _0x268856=_[_0x545d('0x2a')](_0x59f31b,function(_0x56d7b9){return Number(_0x56d7b9[_0x545d('0x67')]);});return db[_0x545d('0x68')][_0x545d('0x52')]({'where':{'UserId':{'$in':_0x376339},'OpenchannelQueueId':{'$in':_0x268856}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){var _0x361c2e='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x48192c;return db[_0x545d('0x53')][_0x545d('0x31')](_0x361c2e,{'type':db[_0x545d('0x55')]['QueryTypes'][_0x545d('0x5b')],'raw':!![],'transaction':_0x1719df});})['then'](function(_0x437acc){var _0x5c2461=_[_0x545d('0x2a')](_0x437acc,function(_0x4d9dfa){return Number(_0x4d9dfa[_0x545d('0x69')]);});return db[_0x545d('0x6a')][_0x545d('0x52')]({'where':{'UserId':{'$in':_0x376339},'WhatsappQueueId':{'$in':_0x5c2461}},'transaction':_0x1719df});})[_0x545d('0x27')](function(){return db[_0x545d('0x6b')][_0x545d('0x46')]({'where':{'TeamId':_0x48192c}});})['then'](function(_0x3d6994){if(_0x3d6994===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x376339},'VoicePrefixId':_0x3d6994[_0x545d('0x6c')]},'transaction':_0x1719df});})[_0x545d('0x27')](function(){return db[_0x545d('0x2b')]['destroy']({'where':{'id':_0x48192c},'cascade':!![],'transaction':_0x1719df});})[_0x545d('0x27')](function(_0x15c4e1){if(_0x15c4e1===0x0){_0x109d7c[_0x545d('0x1b')](0x194);}else{return db[_0x545d('0x6d')][_0x545d('0x52')]({'where':{'type':'Teams','resourceId':_0x48192c},'cascade':!![],'transaction':_0x1719df})[_0x545d('0x27')](function(){_0x109d7c[_0x545d('0x1c')](0xcc)[_0x545d('0x1d')]();});}})['catch'](function(_0x15da91){_0x109d7c[_0x545d('0x1c')](0x1f4)[_0x545d('0x6e')](_0x15da91);});});};exports[_0x545d('0x6f')]=function(_0x4ecf9a,_0x1c6c23,_0x5a892a){return db[_0x545d('0x2b')][_0x545d('0x70')]({'where':{'id':_0x4ecf9a['params']['id']}})[_0x545d('0x27')](handleEntityNotFound(_0x1c6c23,null))['then'](function(_0x4708cf){if(!_0x4ecf9a[_0x545d('0x31')][_0x545d('0x71')]||!utils[_0x545d('0x72')](_0x4ecf9a[_0x545d('0x31')]['channel'])){throw new db[(_0x545d('0x55'))][(_0x545d('0x73'))]('Unknown\x20channel');}var _0x77b9fa={};var _0x423efc={};_0x423efc[_0x545d('0x2f')]=_[_0x545d('0x30')](db[_[_0x545d('0x74')](_0x4ecf9a[_0x545d('0x31')][_0x545d('0x71')]['toLowerCase']())+'Queue'][_0x545d('0x2c')]);_0x423efc['query']=_[_0x545d('0x30')](_0x4ecf9a['query']);_0x423efc[_0x545d('0x32')]=_['intersection'](_0x423efc[_0x545d('0x2f')],_0x423efc[_0x545d('0x31')]);_0x77b9fa['attributes']=_['intersection'](_0x423efc['model'],qs[_0x545d('0x35')](_0x4ecf9a[_0x545d('0x31')][_0x545d('0x35')]));_0x77b9fa['attributes']=_0x77b9fa['attributes'][_0x545d('0x36')]?_0x77b9fa[_0x545d('0x34')]:_0x423efc[_0x545d('0x2f')];_0x77b9fa[_0x545d('0x20')]=qs[_0x545d('0x20')](_0x4ecf9a[_0x545d('0x31')][_0x545d('0x20')]);_0x77b9fa[_0x545d('0x1e')]=qs[_0x545d('0x1e')](_0x4ecf9a[_0x545d('0x31')][_0x545d('0x1e')]);_0x77b9fa['order']=qs['sort'](_0x4ecf9a[_0x545d('0x31')][_0x545d('0x39')]);_0x77b9fa[_0x545d('0x3a')]=qs[_0x545d('0x32')](_[_0x545d('0x3b')](_0x4ecf9a[_0x545d('0x31')],_0x423efc[_0x545d('0x32')]));_0x77b9fa=_[_0x545d('0x45')]({},_0x77b9fa,_0x4ecf9a[_0x545d('0x3e')]);return _0x4708cf[_0x545d('0x49')+_[_0x545d('0x74')](_0x4ecf9a[_0x545d('0x31')]['channel'][_0x545d('0x75')]())+'Queues'](_0x77b9fa);})[_0x545d('0x27')](respondWithResult(_0x1c6c23,null))[_0x545d('0x42')](handleError(_0x1c6c23,null));};exports[_0x545d('0x76')]=function(_0x4c233d,_0x2c2078,_0x4400d6){return db[_0x545d('0x2b')][_0x545d('0x70')]({'where':{'id':_0x4c233d[_0x545d('0x43')]['id']}})['then'](function(_0x11afb5){if(_0x11afb5){if(!_0x4c233d[_0x545d('0x48')][_0x545d('0x71')]||!utils[_0x545d('0x72')](_0x4c233d['body'][_0x545d('0x71')])){throw new db[(_0x545d('0x55'))]['ValidationError'](_0x545d('0x77'));}return _0x11afb5[_0x545d('0x78')+_[_0x545d('0x74')](_0x4c233d[_0x545d('0x48')][_0x545d('0x71')][_0x545d('0x75')]())+'Queues'](_0x4c233d['body']['ids']);}return null;})[_0x545d('0x27')](handleEntityNotFound(_0x2c2078,null))[_0x545d('0x27')](respondWithStatusCode(_0x2c2078,null))['catch'](handleError(_0x2c2078,null));};exports[_0x545d('0x79')]=function(_0x45e567,_0xee4c7f,_0x5e2582){return db[_0x545d('0x2b')][_0x545d('0x70')]({'where':{'id':_0x45e567[_0x545d('0x43')]['id']}})['then'](function(_0x5f4a66){if(_0x5f4a66){if(!_0x45e567['query'][_0x545d('0x71')]||!utils[_0x545d('0x72')](_0x45e567['query'][_0x545d('0x71')])){throw new db[(_0x545d('0x55'))][(_0x545d('0x73'))](_0x545d('0x77'));}return _0x5f4a66['remove'+_[_0x545d('0x74')](_0x45e567[_0x545d('0x31')][_0x545d('0x71')][_0x545d('0x75')]())+_0x545d('0x7a')](_0x45e567[_0x545d('0x31')]['ids']);}return null;})[_0x545d('0x27')](handleEntityNotFound(_0xee4c7f,null))[_0x545d('0x27')](respondWithStatusCode(_0xee4c7f,null))[_0x545d('0x42')](handleError(_0xee4c7f,null));};exports['addAgents']=function(_0x37c624,_0x4cb077){var _0x448546=_['isArray'](_0x37c624[_0x545d('0x48')][_0x545d('0x7b')])?_0x37c624[_0x545d('0x48')][_0x545d('0x7b')]:[_0x37c624['body'][_0x545d('0x7b')]];var _0x279edb=_0x37c624[_0x545d('0x43')]['id'];return db[_0x545d('0x2b')]['find']({'where':{'id':_0x279edb}})['then'](handleEntityNotFound(_0x4cb077,null))[_0x545d('0x27')](function(_0x4792af){if(_0x4792af){var _0x3a5ca2=[_0x545d('0x7c'),_0x545d('0x7d'),_0x545d('0x7e'),_0x545d('0x7f'),_0x545d('0x80'),'Openchannel',_0x545d('0x81')];return db[_0x545d('0x53')][_0x545d('0x82')](function(_0x11e39e){var _0x3bb979=_['map'](_0x3a5ca2,function(_0x3e7b6c){var _0x457698={'attributes':['id',_0x545d('0x29')]};if(_0x3e7b6c==='Voice'){_0x457698[_0x545d('0x83')]={'attributes':[_0x545d('0x84')]};}return _0x4792af[_0x545d('0x49')+_0x3e7b6c+'Queues'](_0x457698)[_0x545d('0x27')](function(_0x234340){var _0x5de071=_[_0x545d('0x2a')](_0x234340,function(_0x5596f7){var _0x3eed60=_[_0x545d('0x2a')](_0x448546,function(_0x2482e1){var _0x9b785={'where':{'UserId':_0x2482e1,[_0x3e7b6c+_0x545d('0x85')]:_0x5596f7['id']},'transaction':_0x11e39e};if(_0x3e7b6c===_0x545d('0x7c')){_0x9b785['defaults']={'penalty':_0x5596f7[_0x545d('0x86')]['penalty']};}return db[_0x545d('0x87')+_0x3e7b6c+_0x545d('0x88')][_0x545d('0x89')](_0x9b785)[_0x545d('0x27')](function(){socket['emit'](_0x545d('0x4c')+_0x3e7b6c+_0x545d('0x8a'),{'UserId':_0x2482e1,[_0x3e7b6c+_0x545d('0x85')]:_0x5596f7['id']});if(_0x3e7b6c!==_0x545d('0x7c')){return;}return db[_0x545d('0x87')]['findAll']({'where':{'id':_0x448546,'online':0x1},'attributes':['id',_0x545d('0x29'),_0x545d('0x8b'),_0x545d('0x8c'),_0x545d('0x8d')],'raw':!![]})[_0x545d('0x27')](function(_0x267ce9){var _0x4bacfc=_['map'](_0x267ce9,function(_0x90ac35){return db[_0x545d('0x8e')][_0x545d('0x8f')]({'membername':_0x90ac35[_0x545d('0x29')],'UserId':_0x90ac35['id'],'queue_name':_0x5596f7[_0x545d('0x29')],'VoiceQueueId':_0x5596f7['id'],'interface':_[_0x545d('0x90')](_0x90ac35[_0x545d('0x8d')])?util['format'](_0x545d('0x91'),_0x90ac35['name']):_0x90ac35[_0x545d('0x8d')],'paused':_0x90ac35[_0x545d('0x8c')]||![],'penalty':_0x5596f7[_0x545d('0x86')][_0x545d('0x84')]},{'transaction':_0x11e39e});});return Promise[_0x545d('0x92')](_0x4bacfc);});});});return Promise[_0x545d('0x92')](_0x3eed60);});return Promise[_0x545d('0x92')](_0x5de071);})[_0x545d('0x27')](function(){return db[_0x545d('0x6b')]['findOne']({'where':{'teamId':_0x279edb}})[_0x545d('0x27')](function(_0x468075){if(_0x468075){var _0x24a61c=_[_0x545d('0x2a')](_0x448546,function(_0x33c586){db[_0x545d('0x93')][_0x545d('0x8f')]({'UserId':_0x33c586,'VoicePrefixId':_0x468075[_0x545d('0x6c')]});});return Promise[_0x545d('0x92')](_0x24a61c);}});});});return Promise['all'](_0x3bb979)['then'](function(){return _0x4792af[_0x545d('0x94')](_0x448546,{'transaction':_0x11e39e})[_0x545d('0x95')](function(_0x37061e){return _0x37061e;});});});}})[_0x545d('0x27')](respondWithResult(_0x4cb077,null))[_0x545d('0x42')](handleError(_0x4cb077,null));};exports[_0x545d('0x96')]=function(_0x316bf6,_0xd7b6b8){var _0x2ba2da=_[_0x545d('0x97')](_0x316bf6[_0x545d('0x31')][_0x545d('0x7b')])?_0x316bf6['query'][_0x545d('0x7b')]:[_0x316bf6[_0x545d('0x31')][_0x545d('0x7b')]];var _0x525e31=_0x316bf6[_0x545d('0x43')]['id'];return db[_0x545d('0x2b')]['find']({'where':{'id':_0x525e31}})[_0x545d('0x27')](handleEntityNotFound(_0xd7b6b8,null))[_0x545d('0x27')](function(_0x4b5f04){if(_0x4b5f04){var _0x2d66d4=[_0x545d('0x7c'),_0x545d('0x7d'),_0x545d('0x7e'),_0x545d('0x7f'),_0x545d('0x80'),_0x545d('0x98'),_0x545d('0x81')];return db[_0x545d('0x53')][_0x545d('0x82')](function(_0x17b7df){var _0x2d98e7=_['map'](_0x2d66d4,function(_0x2d9c05){var _0x4508c0={'attributes':['id',_0x545d('0x29')]};return _0x4b5f04[_0x545d('0x49')+_0x2d9c05+'Queues'](_0x4508c0)[_0x545d('0x27')](function(_0x1f5ef1){var _0x58677b=_[_0x545d('0x2a')](_0x1f5ef1,function(_0x37edcb){return _0x37edcb[_0x545d('0x96')](_0x2ba2da,{'transaction':_0x17b7df})[_0x545d('0x27')](function(){var _0x570750=_[_0x545d('0x2a')](_0x2ba2da,function(_0x4b301a){socket[_0x545d('0x99')]('user'+_0x2d9c05+_0x545d('0x9a'),{'UserId':Number(_0x4b301a),[_0x2d9c05+_0x545d('0x85')]:_0x37edcb['id']});if(_0x2d9c05!=='Voice'){return;}return db[_0x545d('0x8e')][_0x545d('0x52')]({'where':{'VoiceQueueId':_0x37edcb['id'],'UserId':_0x4b301a},'transaction':_0x17b7df});});return Promise[_0x545d('0x92')](_0x570750);});});return Promise[_0x545d('0x92')](_0x58677b);});});return Promise[_0x545d('0x92')](_0x2d98e7)[_0x545d('0x27')](function(){return _0x4b5f04[_0x545d('0x96')](_0x2ba2da,{'transaction':_0x17b7df});})['then'](function(){return db[_0x545d('0x6b')][_0x545d('0x70')]({'where':{'teamId':_0x525e31}})['then'](function(_0x2b8218){if(_0x2b8218){var _0x528118=_[_0x545d('0x2a')](_0x2ba2da,function(_0x171071){db[_0x545d('0x93')][_0x545d('0x52')]({'where':{'UserId':_0x171071,'VoicePrefixId':_0x2b8218[_0x545d('0x6c')]}});});return Promise['all'](_0x528118);}});});});}})[_0x545d('0x27')](respondWithStatusCode(_0xd7b6b8,null))[_0x545d('0x42')](handleError(_0xd7b6b8,null));};exports[_0x545d('0x9b')]=function(_0x2c2d5e,_0x5559ae,_0x438996){var _0x39f062={};var _0x11565b={};var _0x5a941a;var _0x189826;return db[_0x545d('0x2b')]['findOne']({'where':{'id':_0x2c2d5e[_0x545d('0x43')]['id']}})[_0x545d('0x27')](handleEntityNotFound(_0x5559ae,null))['then'](function(_0x559a8b){if(_0x559a8b){_0x5a941a=_0x559a8b;_0x11565b[_0x545d('0x2f')]=_[_0x545d('0x30')](db['User'][_0x545d('0x2c')]);_0x11565b[_0x545d('0x31')]=_['keys'](_0x2c2d5e[_0x545d('0x31')]);_0x11565b[_0x545d('0x32')]=_[_0x545d('0x33')](_0x11565b[_0x545d('0x2f')],_0x11565b[_0x545d('0x31')]);_0x39f062[_0x545d('0x34')]=_[_0x545d('0x33')](_0x11565b[_0x545d('0x2f')],qs['fields'](_0x2c2d5e[_0x545d('0x31')][_0x545d('0x35')]));_0x39f062[_0x545d('0x34')]=_0x39f062[_0x545d('0x34')]['length']?_0x39f062[_0x545d('0x34')]:_0x11565b[_0x545d('0x2f')];_0x39f062[_0x545d('0x38')]=qs[_0x545d('0x39')](_0x2c2d5e['query'][_0x545d('0x39')]);_0x39f062['where']=qs[_0x545d('0x32')](_[_0x545d('0x3b')](_0x2c2d5e['query'],_0x11565b[_0x545d('0x32')]));if(_0x2c2d5e[_0x545d('0x31')]['filter']){_0x39f062['where']=_[_0x545d('0x45')](_0x39f062['where'],{'$or':_['map'](_0x39f062['attributes'],function(_0xbfa436){var _0x1abd70={};_0x1abd70[_0xbfa436]={'$like':'%'+_0x2c2d5e[_0x545d('0x31')][_0x545d('0x3c')]+'%'};return _0x1abd70;})});}_0x39f062=_[_0x545d('0x45')]({},_0x39f062,_0x2c2d5e[_0x545d('0x3e')]);return _0x5a941a[_0x545d('0x9b')](_0x39f062);}})[_0x545d('0x27')](function(_0x657d83){if(_0x657d83){_0x189826=_0x657d83[_0x545d('0x36')];if(!_0x2c2d5e[_0x545d('0x31')]['hasOwnProperty'](_0x545d('0x37'))){_0x39f062['limit']=qs[_0x545d('0x20')](_0x2c2d5e[_0x545d('0x31')][_0x545d('0x20')]);_0x39f062[_0x545d('0x1e')]=qs[_0x545d('0x1e')](_0x2c2d5e[_0x545d('0x31')][_0x545d('0x1e')]);}return _0x5a941a[_0x545d('0x9b')](_0x39f062);}})[_0x545d('0x27')](function(_0x155d81){if(_0x155d81){return _0x155d81?{'count':_0x189826,'rows':_0x155d81}:null;}})[_0x545d('0x27')](respondWithResult(_0x5559ae,null))[_0x545d('0x42')](handleError(_0x5559ae,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6ae2c99..2732868 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 _0x52a3=['update','remove','emit','hook','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x8cadfc,_0x4ff50c){var _0x3ed3a6=function(_0x15e5fa){while(--_0x15e5fa){_0x8cadfc['push'](_0x8cadfc['shift']());}};_0x3ed3a6(++_0x4ff50c);}(_0x52a3,0x16d));var _0x352a=function(_0x3d2c3d,_0x16164b){_0x3d2c3d=_0x3d2c3d-0x0;var _0x36126c=_0x52a3[_0x3d2c3d];return _0x36126c;};'use strict';var EventEmitter=require(_0x352a('0x0'));var Team=require(_0x352a('0x1'))['db'][_0x352a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x352a('0x3')](0x0);var events={'afterCreate':_0x352a('0x4'),'afterUpdate':_0x352a('0x5'),'afterDestroy':_0x352a('0x6')};function emitEvent(_0x5112ff){return function(_0x3fd516,_0x2515a1,_0x25199e){TeamEvents[_0x352a('0x7')](_0x5112ff+':'+_0x3fd516['id'],_0x3fd516);TeamEvents[_0x352a('0x7')](_0x5112ff,_0x3fd516);_0x25199e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x352a('0x8')](e,emitEvent(event));}}module[_0x352a('0x9')]=TeamEvents; \ No newline at end of file +var _0x4ec4=['hasOwnProperty','hook','exports','events','Team','setMaxListeners','save','update','remove','emit'];(function(_0x3d8e0f,_0x294530){var _0x5e2f81=function(_0x517d2e){while(--_0x517d2e){_0x3d8e0f['push'](_0x3d8e0f['shift']());}};_0x5e2f81(++_0x294530);}(_0x4ec4,0x19d));var _0x44ec=function(_0x2859b9,_0x1df68e){_0x2859b9=_0x2859b9-0x0;var _0x191dbd=_0x4ec4[_0x2859b9];return _0x191dbd;};'use strict';var EventEmitter=require(_0x44ec('0x0'));var Team=require('../../mysqldb')['db'][_0x44ec('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x44ec('0x2')](0x0);var events={'afterCreate':_0x44ec('0x3'),'afterUpdate':_0x44ec('0x4'),'afterDestroy':_0x44ec('0x5')};function emitEvent(_0x52c2b8){return function(_0x32041f,_0x3aa933,_0x698a04){TeamEvents[_0x44ec('0x6')](_0x52c2b8+':'+_0x32041f['id'],_0x32041f);TeamEvents['emit'](_0x52c2b8,_0x32041f);_0x698a04(null);};}for(var e in events){if(events[_0x44ec('0x7')](e)){var event=events[e];Team[_0x44ec('0x8')](e,emitEvent(event));}}module[_0x44ec('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ba71ee7..2f4f536 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 _0x8ee0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','lodash'];(function(_0x289967,_0x52906c){var _0x1f8a3c=function(_0x1d1202){while(--_0x1d1202){_0x289967['push'](_0x289967['shift']());}};_0x1f8a3c(++_0x52906c);}(_0x8ee0,0xc2));var _0x08ee=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x8ee0[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require(_0x08ee('0x0'));var util=require(_0x08ee('0x1'));var logger=require(_0x08ee('0x2'))(_0x08ee('0x3'));var moment=require(_0x08ee('0x4'));var BPromise=require(_0x08ee('0x5'));var rp=require(_0x08ee('0x6'));var fs=require('fs');var path=require(_0x08ee('0x7'));var rimraf=require(_0x08ee('0x8'));var config=require(_0x08ee('0x9'));var attributes=require(_0x08ee('0xa'));module['exports']=function(_0x534668,_0x55878a){return _0x534668[_0x08ee('0xb')](_0x08ee('0xc'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x026b=['rimraf','./team.attributes','define','Team','teams','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3b9a57,_0x7e3c76){var _0x149016=function(_0xf36e5e){while(--_0xf36e5e){_0x3b9a57['push'](_0x3b9a57['shift']());}};_0x149016(++_0x7e3c76);}(_0x026b,0x1bd));var _0xb026=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x026b[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xb026('0x0'));var util=require(_0xb026('0x1'));var logger=require(_0xb026('0x2'))(_0xb026('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb026('0x4'));var fs=require('fs');var path=require(_0xb026('0x5'));var rimraf=require(_0xb026('0x6'));var config=require('../../config/environment');var attributes=require(_0xb026('0x7'));module['exports']=function(_0x31c383,_0x5aa413){return _0x31c383[_0xb026('0x8')](_0xb026('0x9'),attributes,{'tableName':_0xb026('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 76e3fcd..19c2df4 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 _0x84ff=['request\x20sent','debug','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x84ff,0x156));var _0xf84f=function(_0x153d09,_0x39f503){_0x153d09=_0x153d09-0x0;var _0x3ee63b=_0x84ff[_0x153d09];return _0x3ee63b;};'use strict';var _=require('lodash');var util=require(_0xf84f('0x0'));var moment=require('moment');var BPromise=require(_0xf84f('0x1'));var rs=require(_0xf84f('0x2'));var fs=require('fs');var Redis=require(_0xf84f('0x3'));var db=require(_0xf84f('0x4'))['db'];var utils=require(_0xf84f('0x5'));var logger=require(_0xf84f('0x6'))('rpc');var config=require(_0xf84f('0x7'));var jayson=require(_0xf84f('0x8'));var client=jayson[_0xf84f('0x9')][_0xf84f('0xa')]({'port':0x232a});config[_0xf84f('0xb')]=_[_0xf84f('0xc')](config[_0xf84f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf84f('0xb')]));require('./team.socket')[_0xf84f('0xd')](socket);function respondWithRpcPromise(_0x1be5c4,_0xa04e60,_0x5babf9){return new BPromise(function(_0xec4af,_0x10dc7d){return client[_0xf84f('0xe')](_0x1be5c4,_0x5babf9)[_0xf84f('0xf')](function(_0x157433){logger[_0xf84f('0x10')](_0xf84f('0x11'),_0xa04e60,_0xf84f('0x12'));logger[_0xf84f('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0xa04e60,_0xf84f('0x12'),JSON['stringify'](_0x157433));if(_0x157433[_0xf84f('0x14')]){if(_0x157433[_0xf84f('0x14')][_0xf84f('0x15')]===0x1f4){logger[_0xf84f('0x14')](_0xf84f('0x11'),_0xa04e60,_0x157433[_0xf84f('0x14')][_0xf84f('0x16')]);return _0x10dc7d(_0x157433[_0xf84f('0x14')]['message']);}logger[_0xf84f('0x14')](_0xf84f('0x11'),_0xa04e60,_0x157433[_0xf84f('0x14')][_0xf84f('0x16')]);return _0xec4af(_0x157433[_0xf84f('0x14')]['message']);}else{logger['info']('Team,\x20%s,\x20%s',_0xa04e60,_0xf84f('0x12'));_0xec4af(_0x157433[_0xf84f('0x17')][_0xf84f('0x16')]);}})['catch'](function(_0x95cc5){logger[_0xf84f('0x14')]('Team,\x20%s,\x20%s',_0xa04e60,_0x95cc5);_0x10dc7d(_0x95cc5);});});} \ No newline at end of file +var _0xadfd=['then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./team.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadfd,0x1c5));var _0xdadf=function(_0x200060,_0xd360ec){_0x200060=_0x200060-0x0;var _0x2660e1=_0xadfd[_0x200060];return _0x2660e1;};'use strict';var _=require(_0xdadf('0x0'));var util=require(_0xdadf('0x1'));var moment=require(_0xdadf('0x2'));var BPromise=require(_0xdadf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdadf('0x4'))['db'];var utils=require(_0xdadf('0x5'));var logger=require(_0xdadf('0x6'))(_0xdadf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdadf('0x8')]['http']({'port':0x232a});config[_0xdadf('0x9')]=_[_0xdadf('0xa')](config[_0xdadf('0x9')],{'host':_0xdadf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdadf('0x9')]));require(_0xdadf('0xc'))[_0xdadf('0xd')](socket);function respondWithRpcPromise(_0x54c94e,_0x241af1,_0x105dd6){return new BPromise(function(_0x2d09c9,_0x16ae55){return client[_0xdadf('0xe')](_0x54c94e,_0x105dd6)[_0xdadf('0xf')](function(_0x108363){logger[_0xdadf('0x10')](_0xdadf('0x11'),_0x241af1,_0xdadf('0x12'));logger[_0xdadf('0x13')](_0xdadf('0x14'),_0x241af1,_0xdadf('0x12'),JSON['stringify'](_0x108363));if(_0x108363['error']){if(_0x108363[_0xdadf('0x15')][_0xdadf('0x16')]===0x1f4){logger['error'](_0xdadf('0x11'),_0x241af1,_0x108363[_0xdadf('0x15')][_0xdadf('0x17')]);return _0x16ae55(_0x108363[_0xdadf('0x15')][_0xdadf('0x17')]);}logger[_0xdadf('0x15')](_0xdadf('0x11'),_0x241af1,_0x108363[_0xdadf('0x15')][_0xdadf('0x17')]);return _0x2d09c9(_0x108363[_0xdadf('0x15')][_0xdadf('0x17')]);}else{logger['info'](_0xdadf('0x11'),_0x241af1,_0xdadf('0x12'));_0x2d09c9(_0x108363[_0xdadf('0x18')][_0xdadf('0x17')]);}})[_0xdadf('0x19')](function(_0x2ac0cd){logger[_0xdadf('0x15')](_0xdadf('0x11'),_0x241af1,_0x2ac0cd);_0x16ae55(_0x2ac0cd);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 73db523..79d8176 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 _0x30c7=['update','emit','length','./team.events','remove'];(function(_0x551bfb,_0x272f93){var _0x17069b=function(_0x1cb79a){while(--_0x1cb79a){_0x551bfb['push'](_0x551bfb['shift']());}};_0x17069b(++_0x272f93);}(_0x30c7,0x111));var _0x730c=function(_0x224ad1,_0x400422){_0x224ad1=_0x224ad1-0x0;var _0x156e8d=_0x30c7[_0x224ad1];return _0x156e8d;};'use strict';var TeamEvents=require(_0x730c('0x0'));var events=['save',_0x730c('0x1'),_0x730c('0x2')];function createListener(_0x3a8026,_0x5aa43a){return function(_0x47601e){_0x5aa43a[_0x730c('0x3')](_0x3a8026,_0x47601e);};}function removeListener(_0x49c816,_0x59a230){return function(){TeamEvents['removeListener'](_0x49c816,_0x59a230);};}exports['register']=function(_0x3516be){for(var _0x229682=0x0,_0x5748ab=events[_0x730c('0x4')];_0x229682<_0x5748ab;_0x229682++){var _0x2ed29c=events[_0x229682];var _0x6022ae=createListener('team:'+_0x2ed29c,_0x3516be);TeamEvents['on'](_0x2ed29c,_0x6022ae);}}; \ No newline at end of file +var _0xb1ba=['emit','removeListener','length','remove','update'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xb1ba,0x152));var _0xab1b=function(_0x266795,_0x5629f5){_0x266795=_0x266795-0x0;var _0x2fc23f=_0xb1ba[_0x266795];return _0x2fc23f;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0xab1b('0x0'),_0xab1b('0x1')];function createListener(_0x3ce25c,_0xe94f44){return function(_0x33d6a9){_0xe94f44[_0xab1b('0x2')](_0x3ce25c,_0x33d6a9);};}function removeListener(_0x4ff0e3,_0x5c31d6){return function(){TeamEvents[_0xab1b('0x3')](_0x4ff0e3,_0x5c31d6);};}exports['register']=function(_0x28d452){for(var _0x18b2e0=0x0,_0x406df2=events[_0xab1b('0x4')];_0x18b2e0<_0x406df2;_0x18b2e0++){var _0x2ec157=events[_0x18b2e0];var _0x35d207=createListener('team:'+_0x2ec157,_0x28d452);TeamEvents['on'](_0x2ec157,_0x35d207);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index fa7193c..c56d5b2 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 _0x7ec2=['sequelize','exports','INTEGER'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x7ec2,0x15c));var _0x27ec=function(_0x20e94e,_0x5bc6f8){_0x20e94e=_0x20e94e-0x0;var _0x12b132=_0x7ec2[_0x20e94e];return _0x12b132;};'use strict';var Sequelize=require(_0x27ec('0x0'));module[_0x27ec('0x1')]={'TeamId':{'type':Sequelize[_0x27ec('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcab6=['sequelize','INTEGER'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xcab6,0xd4));var _0x6cab=function(_0x57e941,_0xea9554){_0x57e941=_0x57e941-0x0;var _0x13cb87=_0xcab6[_0x57e941];return _0x13cb87;};'use strict';var Sequelize=require(_0x6cab('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x6cab('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x6cab('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 7522500..a854913 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 _0x3495=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','lodash','util'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x3495,0x1de));var _0x5349=function(_0x18d3eb,_0x5334d6){_0x18d3eb=_0x18d3eb-0x0;var _0x4bddd1=_0x3495[_0x18d3eb];return _0x4bddd1;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var logger=require(_0x5349('0x2'))(_0x5349('0x3'));var moment=require(_0x5349('0x4'));var BPromise=require(_0x5349('0x5'));var rp=require(_0x5349('0x6'));var fs=require('fs');var path=require(_0x5349('0x7'));var rimraf=require(_0x5349('0x8'));var config=require('../../config/environment');var attributes=require(_0x5349('0x9'));module[_0x5349('0xa')]=function(_0x5ce2cd,_0xcb5a1){return _0x5ce2cd['define'](_0x5349('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67da=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x67da,0x192));var _0xa67d=function(_0x2fbed7,_0xf6e7df){_0x2fbed7=_0x2fbed7-0x0;var _0x94ffd6=_0x67da[_0x2fbed7];return _0x94ffd6;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var logger=require(_0xa67d('0x1'))(_0xa67d('0x2'));var moment=require(_0xa67d('0x3'));var BPromise=require(_0xa67d('0x4'));var rp=require(_0xa67d('0x5'));var fs=require('fs');var path=require(_0xa67d('0x6'));var rimraf=require(_0xa67d('0x7'));var config=require(_0xa67d('0x8'));var attributes=require(_0xa67d('0x9'));module['exports']=function(_0x5b8ec7,_0x408786){return _0x5b8ec7['define'](_0xa67d('0xa'),attributes,{'tableName':_0xa67d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 5348905..6fbceea 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x381db5,_0x1e7659){var _0x59cf4c=function(_0x11a940){while(--_0x11a940){_0x381db5['push'](_0x381db5['shift']());}};_0x59cf4c(++_0x1e7659);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x412b87,_0x1c5931){var _0x887e22=function(_0x23cabf){while(--_0x23cabf){_0x412b87['push'](_0x412b87['shift']());}};_0x887e22(++_0x1c5931);}(_0x70e0,0x17b));var _0x070e=function(_0x112a0d,_0x3d7654){_0x112a0d=_0x112a0d-0x0;var _0x367c57=_0x70e0[_0x112a0d];return _0x367c57;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 45aabd3..f8d4ce4 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 _0x2580=['sequelize','INTEGER'];(function(_0xcba282,_0x565c7c){var _0x3ab27d=function(_0x2d06e7){while(--_0x2d06e7){_0xcba282['push'](_0xcba282['shift']());}};_0x3ab27d(++_0x565c7c);}(_0x2580,0xa6));var _0x0258=function(_0x456ca0,_0x25aa28){_0x456ca0=_0x456ca0-0x0;var _0x3d200e=_0x2580[_0x456ca0];return _0x3d200e;};'use strict';var Sequelize=require(_0x0258('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0258('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xefca=['INTEGER','exports'];(function(_0x38690b,_0x158905){var _0x1478e7=function(_0x58884d){while(--_0x58884d){_0x38690b['push'](_0x38690b['shift']());}};_0x1478e7(++_0x158905);}(_0xefca,0xe7));var _0xaefc=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0xefca[_0x695b76];return _0x1dc21f;};'use strict';var Sequelize=require('sequelize');module[_0xaefc('0x0')]={'penalty':{'type':Sequelize[_0xaefc('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 08cca2f..e01382d 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 _0xf9bb=['./teamVoiceQueue.attributes','exports','team_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x2ab231,_0x116f5c){var _0x3d3662=function(_0x3d6da8){while(--_0x3d6da8){_0x2ab231['push'](_0x2ab231['shift']());}};_0x3d3662(++_0x116f5c);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x4563b6,_0x2611c5){_0x4563b6=_0x4563b6-0x0;var _0xa7e08c=_0xf9bb[_0x4563b6];return _0xa7e08c;};'use strict';var _=require(_0xbf9b('0x0'));var util=require(_0xbf9b('0x1'));var logger=require(_0xbf9b('0x2'))('api');var moment=require(_0xbf9b('0x3'));var BPromise=require(_0xbf9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9b('0x5'));var config=require(_0xbf9b('0x6'));var attributes=require(_0xbf9b('0x7'));module[_0xbf9b('0x8')]=function(_0x46d1f,_0x7fa5a){return _0x46d1f['define']('TeamVoiceQueue',attributes,{'tableName':_0xbf9b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26c2=['bluebird','request-promise','rimraf','../../config/environment','exports','define','TeamVoiceQueue','api','moment'];(function(_0x31659c,_0x4c1c13){var _0x415c58=function(_0x4e0578){while(--_0x4e0578){_0x31659c['push'](_0x31659c['shift']());}};_0x415c58(++_0x4c1c13);}(_0x26c2,0x130));var _0x226c=function(_0x215f8a,_0xf4090e){_0x215f8a=_0x215f8a-0x0;var _0x115b7f=_0x26c2[_0x215f8a];return _0x115b7f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x226c('0x0'));var moment=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var rp=require(_0x226c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0x226c('0x6')]=function(_0xb40fbd,_0x21ed3a){return _0xb40fbd[_0x226c('0x7')](_0x226c('0x8'),attributes,{'tableName':'team_has_voice_queues','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 8f15d46..dc25afb 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 _0x395a=['code','TeamVoiceQueue,\x20%s,\x20%s','message','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x395a,0x159));var _0xa395=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x395a[_0x3f6bcf];return _0x1c5350;};'use strict';var _=require(_0xa395('0x0'));var util=require(_0xa395('0x1'));var moment=require(_0xa395('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa395('0x3'))['db'];var utils=require(_0xa395('0x4'));var logger=require(_0xa395('0x5'))('rpc');var config=require(_0xa395('0x6'));var jayson=require(_0xa395('0x7'));var client=jayson[_0xa395('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492f47,_0x397dc3,_0x3a23c5){return new BPromise(function(_0x39f352,_0x4ce79f){return client[_0xa395('0x9')](_0x492f47,_0x3a23c5)['then'](function(_0x22f00e){logger[_0xa395('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x397dc3,_0xa395('0xb'));logger[_0xa395('0xc')](_0xa395('0xd'),_0x397dc3,_0xa395('0xb'),JSON[_0xa395('0xe')](_0x22f00e));if(_0x22f00e[_0xa395('0xf')]){if(_0x22f00e[_0xa395('0xf')][_0xa395('0x10')]===0x1f4){logger[_0xa395('0xf')](_0xa395('0x11'),_0x397dc3,_0x22f00e[_0xa395('0xf')][_0xa395('0x12')]);return _0x4ce79f(_0x22f00e[_0xa395('0xf')]['message']);}logger['error'](_0xa395('0x11'),_0x397dc3,_0x22f00e[_0xa395('0xf')][_0xa395('0x12')]);return _0x39f352(_0x22f00e[_0xa395('0xf')]['message']);}else{logger[_0xa395('0xa')](_0xa395('0x11'),_0x397dc3,_0xa395('0xb'));_0x39f352(_0x22f00e['result']['message']);}})['catch'](function(_0x1723f0){logger[_0xa395('0xf')](_0xa395('0x11'),_0x397dc3,_0x1723f0);_0x4ce79f(_0x1723f0);});});} \ No newline at end of file +var _0x7980=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x44d360,_0xe49b11){var _0x1c5cda=function(_0x2a9839){while(--_0x2a9839){_0x44d360['push'](_0x44d360['shift']());}};_0x1c5cda(++_0xe49b11);}(_0x7980,0xab));var _0x0798=function(_0xca8add,_0x48ea8f){_0xca8add=_0xca8add-0x0;var _0x3f8477=_0x7980[_0xca8add];return _0x3f8477;};'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']('TeamVoiceQueue,\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')]('TeamVoiceQueue,\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/template/index.js b/server/api/template/index.js index 88fb169..cde77ab 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 _0x8768=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy'];(function(_0x106de4,_0x5c4eeb){var _0x130bf2=function(_0x4a1536){while(--_0x4a1536){_0x106de4['push'](_0x106de4['shift']());}};_0x130bf2(++_0x5c4eeb);}(_0x8768,0xa1));var _0x8876=function(_0x64039e,_0x86a69b){_0x64039e=_0x64039e-0x0;var _0x3b948a=_0x8768[_0x64039e];return _0x3b948a;};'use strict';var multer=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var path=require(_0x8876('0x2'));var timeout=require(_0x8876('0x3'));var express=require(_0x8876('0x4'));var router=express[_0x8876('0x5')]();var fs_extra=require(_0x8876('0x6'));var auth=require(_0x8876('0x7'));var interaction=require(_0x8876('0x8'));var config=require(_0x8876('0x9'));var controller=require(_0x8876('0xa'));router[_0x8876('0xb')]('/',auth[_0x8876('0xc')](),controller['index']);router[_0x8876('0xb')](_0x8876('0xd'),auth[_0x8876('0xc')](),controller[_0x8876('0xe')]);router[_0x8876('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8876('0x10')](_0x8876('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8876('0x11')](_0x8876('0xd'),auth[_0x8876('0xc')](),controller[_0x8876('0x12')]);module[_0x8876('0x13')]=router; \ No newline at end of file +var _0x323f=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x164ddf,_0x2d3858){var _0x56260a=function(_0x2ca5e2){while(--_0x2ca5e2){_0x164ddf['push'](_0x164ddf['shift']());}};_0x56260a(++_0x2d3858);}(_0x323f,0x1ee));var _0xf323=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x323f[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var fs_extra=require(_0xf323('0x4'));var auth=require(_0xf323('0x5'));var interaction=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var controller=require(_0xf323('0x8'));router[_0xf323('0x9')]('/',auth[_0xf323('0xa')](),controller['index']);router[_0xf323('0x9')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0xc')]);router[_0xf323('0xd')]('/',auth[_0xf323('0xa')](),controller[_0xf323('0xe')]);router[_0xf323('0xf')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0x12')]);module[_0xf323('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 84533bf..7bc65a4 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 _0x5b95=['TEXT','sequelize','exports','STRING'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x5b95,0xc9));var _0x55b9=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x5b95[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require(_0x55b9('0x0'));module[_0x55b9('0x1')]={'name':{'type':Sequelize[_0x55b9('0x2')]},'description':{'type':Sequelize[_0x55b9('0x2')]},'html':{'type':Sequelize[_0x55b9('0x3')]}}; \ No newline at end of file +var _0x94bc=['sequelize','exports','STRING'];(function(_0x2a2ed0,_0xa1e1f5){var _0xc86fb0=function(_0x5e0725){while(--_0x5e0725){_0x2a2ed0['push'](_0x2a2ed0['shift']());}};_0xc86fb0(++_0xa1e1f5);}(_0x94bc,0x17d));var _0xc94b=function(_0x5100bc,_0x35e471){_0x5100bc=_0x5100bc-0x0;var _0x1d6ec6=_0x94bc[_0x5100bc];return _0x1d6ec6;};'use strict';var Sequelize=require(_0xc94b('0x0'));module[_0xc94b('0x1')]={'name':{'type':Sequelize[_0xc94b('0x2')]},'description':{'type':Sequelize[_0xc94b('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 4a8289a..f6b5988 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 _0x3e1d=['key','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Template','fieldName'];(function(_0x13b90c,_0x54b635){var _0x2034fe=function(_0x2bf095){while(--_0x2bf095){_0x13b90c['push'](_0x13b90c['shift']());}};_0x2034fe(++_0x54b635);}(_0x3e1d,0x76));var _0xd3e1=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x3e1d[_0x3e8270];return _0x1ccde9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3e1('0x1'));var rp=require(_0xd3e1('0x2'));var moment=require(_0xd3e1('0x3'));var BPromise=require(_0xd3e1('0x4'));var Mustache=require(_0xd3e1('0x5'));var util=require(_0xd3e1('0x6'));var path=require('path');var sox=require(_0xd3e1('0x7'));var csv=require(_0xd3e1('0x8'));var ejs=require(_0xd3e1('0x9'));var fs=require('fs');var fs_extra=require(_0xd3e1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd3e1('0xb'));var deskjs=require(_0xd3e1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd3e1('0xd'));var Papa=require(_0xd3e1('0xe'));var Redis=require(_0xd3e1('0xf'));var authService=require(_0xd3e1('0x10'));var qs=require(_0xd3e1('0x11'));var as=require(_0xd3e1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd3e1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x241106,_0x436cb5){_0x436cb5=_0x436cb5||0xcc;return function(_0xc9219a){if(_0xc9219a){return _0x241106[_0xd3e1('0x15')](_0x436cb5);}return _0x241106[_0xd3e1('0x16')](_0x436cb5)[_0xd3e1('0x17')]();};}function respondWithResult(_0x3e24d5,_0xe70372){_0xe70372=_0xe70372||0xc8;return function(_0x299cc3){if(_0x299cc3){return _0x3e24d5[_0xd3e1('0x16')](_0xe70372)[_0xd3e1('0x18')](_0x299cc3);}};}function respondWithFilteredResult(_0xdddc15,_0x4960be){return function(_0x450c24){if(_0x450c24){var _0x3abff8=typeof _0x4960be['offset']===_0xd3e1('0x19')&&typeof _0x4960be[_0xd3e1('0x1a')]==='undefined';var _0x5553d4=_0x450c24[_0xd3e1('0x1b')];var _0x128b99=_0x3abff8?0x0:_0x4960be[_0xd3e1('0x1c')];var _0x5e9676=_0x3abff8?_0x450c24[_0xd3e1('0x1b')]:_0x4960be[_0xd3e1('0x1c')]+_0x4960be[_0xd3e1('0x1a')];var _0x2ff98d;if(_0x5e9676>=_0x5553d4){_0x5e9676=_0x5553d4;_0x2ff98d=0xc8;}else{_0x2ff98d=0xce;}_0xdddc15[_0xd3e1('0x16')](_0x2ff98d);return _0xdddc15[_0xd3e1('0x1d')](_0xd3e1('0x1e'),_0x128b99+'-'+_0x5e9676+'/'+_0x5553d4)[_0xd3e1('0x18')](_0x450c24);}return null;};}function patchUpdates(_0x3e8be2){return function(_0x3c78cf){try{jsonpatch['apply'](_0x3c78cf,_0x3e8be2,!![]);}catch(_0x569f85){return BPromise[_0xd3e1('0x1f')](_0x569f85);}return _0x3c78cf['save']();};}function saveUpdates(_0x344fdc,_0x351059){return function(_0x5e4951){if(_0x5e4951){return _0x5e4951[_0xd3e1('0x20')](_0x344fdc)[_0xd3e1('0x21')](function(_0x22577b){return _0x22577b;});}return null;};}function removeEntity(_0x5ab48f,_0x57624d){return function(_0x110b05){if(_0x110b05){return _0x110b05['destroy']()[_0xd3e1('0x21')](function(){var _0x4712e3=_0x110b05[_0xd3e1('0x22')]({'plain':!![]});var _0x3b3679='Templates';return db[_0xd3e1('0x23')][_0xd3e1('0x24')]({'where':{'type':_0x3b3679,'resourceId':_0x4712e3['id']}})[_0xd3e1('0x21')](function(){return _0x110b05;});})['then'](function(){_0x5ab48f[_0xd3e1('0x16')](0xcc)[_0xd3e1('0x17')]();});}};}function handleEntityNotFound(_0x38a4d9,_0x1b6f0a){return function(_0x2d8de3){if(!_0x2d8de3){_0x38a4d9[_0xd3e1('0x15')](0x194);}return _0x2d8de3;};}function handleError(_0x3285f4,_0x286d9a){_0x286d9a=_0x286d9a||0x1f4;return function(_0x17ea82){logger[_0xd3e1('0x25')](_0x17ea82[_0xd3e1('0x26')]);if(_0x17ea82[_0xd3e1('0x27')]){delete _0x17ea82[_0xd3e1('0x27')];}_0x3285f4[_0xd3e1('0x16')](_0x286d9a)[_0xd3e1('0x28')](_0x17ea82);};}exports['index']=function(_0x1bf270,_0x374e0b){var _0x40ebde={},_0x33b690={},_0x295bab={'count':0x0,'rows':[]};var _0x388590=_[_0xd3e1('0x29')](db[_0xd3e1('0x2a')]['rawAttributes'],function(_0x585857){return{'name':_0x585857[_0xd3e1('0x2b')],'type':_0x585857['type'][_0xd3e1('0x2c')]};});_0x33b690[_0xd3e1('0x2d')]=_[_0xd3e1('0x29')](_0x388590,_0xd3e1('0x27'));_0x33b690['query']=_['keys'](_0x1bf270['query']);_0x33b690['filters']=_[_0xd3e1('0x2e')](_0x33b690[_0xd3e1('0x2d')],_0x33b690[_0xd3e1('0x2f')]);_0x40ebde['attributes']=_[_0xd3e1('0x2e')](_0x33b690[_0xd3e1('0x2d')],qs[_0xd3e1('0x30')](_0x1bf270['query'][_0xd3e1('0x30')]));_0x40ebde[_0xd3e1('0x31')]=_0x40ebde[_0xd3e1('0x31')][_0xd3e1('0x32')]?_0x40ebde[_0xd3e1('0x31')]:_0x33b690['model'];if(!_0x1bf270['query'][_0xd3e1('0x33')](_0xd3e1('0x34'))){_0x40ebde[_0xd3e1('0x1a')]=qs[_0xd3e1('0x1a')](_0x1bf270['query'][_0xd3e1('0x1a')]);_0x40ebde[_0xd3e1('0x1c')]=qs[_0xd3e1('0x1c')](_0x1bf270[_0xd3e1('0x2f')]['offset']);}_0x40ebde[_0xd3e1('0x35')]=qs[_0xd3e1('0x36')](_0x1bf270[_0xd3e1('0x2f')][_0xd3e1('0x36')]);_0x40ebde[_0xd3e1('0x37')]=qs['filters'](_[_0xd3e1('0x38')](_0x1bf270[_0xd3e1('0x2f')],_0x33b690[_0xd3e1('0x39')]),_0x388590);if(_0x1bf270['query'][_0xd3e1('0x3a')]){_0x40ebde['where']=_[_0xd3e1('0x3b')](_0x40ebde[_0xd3e1('0x37')],{'$or':_[_0xd3e1('0x29')](_0x388590,function(_0xe8260b){if(_0xe8260b[_0xd3e1('0x3c')]!==_0xd3e1('0x3d')){var _0x3d00ec={};_0x3d00ec[_0xe8260b[_0xd3e1('0x27')]]={'$like':'%'+_0x1bf270[_0xd3e1('0x2f')]['filter']+'%'};return _0x3d00ec;}})});}_0x40ebde=_['merge']({},_0x40ebde,_0x1bf270[_0xd3e1('0x3e')]);var _0x57927a={'where':_0x40ebde[_0xd3e1('0x37')]};return db[_0xd3e1('0x2a')][_0xd3e1('0x1b')](_0x57927a)[_0xd3e1('0x21')](function(_0x352a6a){_0x295bab[_0xd3e1('0x1b')]=_0x352a6a;if(_0x1bf270['query'][_0xd3e1('0x3f')]){_0x40ebde['include']=[{'all':!![]}];}return db[_0xd3e1('0x2a')][_0xd3e1('0x40')](_0x40ebde);})['then'](function(_0x5e2021){_0x295bab[_0xd3e1('0x41')]=_0x5e2021;return _0x295bab;})['then'](respondWithFilteredResult(_0x374e0b,_0x40ebde))[_0xd3e1('0x42')](handleError(_0x374e0b,null));};exports['show']=function(_0x4029b0,_0x515a3e){var _0x143b23={'raw':!![],'where':{'id':_0x4029b0[_0xd3e1('0x43')]['id']}},_0x52ade5={};_0x52ade5[_0xd3e1('0x2d')]=_[_0xd3e1('0x44')](db[_0xd3e1('0x2a')][_0xd3e1('0x45')]);_0x52ade5['query']=_['keys'](_0x4029b0[_0xd3e1('0x2f')]);_0x52ade5['filters']=_['intersection'](_0x52ade5['model'],_0x52ade5[_0xd3e1('0x2f')]);_0x143b23[_0xd3e1('0x31')]=_['intersection'](_0x52ade5['model'],qs['fields'](_0x4029b0[_0xd3e1('0x2f')][_0xd3e1('0x30')]));_0x143b23[_0xd3e1('0x31')]=_0x143b23[_0xd3e1('0x31')][_0xd3e1('0x32')]?_0x143b23[_0xd3e1('0x31')]:_0x52ade5[_0xd3e1('0x2d')];if(_0x4029b0['query'][_0xd3e1('0x3f')]){_0x143b23[_0xd3e1('0x46')]=[{'all':!![]}];}_0x143b23=_['merge']({},_0x143b23,_0x4029b0['options']);return db[_0xd3e1('0x2a')][_0xd3e1('0x47')](_0x143b23)[_0xd3e1('0x21')](handleEntityNotFound(_0x515a3e,null))['then'](respondWithResult(_0x515a3e,null))[_0xd3e1('0x42')](handleError(_0x515a3e,null));};exports[_0xd3e1('0x48')]=function(_0x33155e,_0x5879f8){return db['Template'][_0xd3e1('0x48')](_0x33155e[_0xd3e1('0x49')],{})[_0xd3e1('0x21')](function(_0x4ea45d){var _0x2c3922=_0x33155e[_0xd3e1('0x4a')][_0xd3e1('0x22')]({'plain':!![]});if(!_0x2c3922)throw new Error(_0xd3e1('0x4b'));if(_0x2c3922[_0xd3e1('0x4c')]===_0xd3e1('0x4a')){var _0x5e732a=_0x4ea45d[_0xd3e1('0x22')]({'plain':!![]});var _0x2d1aab=_0xd3e1('0x4d');return db[_0xd3e1('0x4e')][_0xd3e1('0x47')]({'where':{'name':_0x2d1aab,'userProfileId':_0x2c3922[_0xd3e1('0x4f')]},'raw':!![]})[_0xd3e1('0x21')](function(_0x3e7ea2){if(_0x3e7ea2&&_0x3e7ea2['autoAssociation']===0x0){return db[_0xd3e1('0x23')][_0xd3e1('0x48')]({'name':_0x5e732a[_0xd3e1('0x27')],'resourceId':_0x5e732a['id'],'type':_0x3e7ea2['name'],'sectionId':_0x3e7ea2['id']},{})[_0xd3e1('0x21')](function(){return _0x4ea45d;});}else{return _0x4ea45d;}})['catch'](function(_0x5a1760){logger[_0xd3e1('0x25')](_0xd3e1('0x50'),_0x5a1760);throw _0x5a1760;});}return _0x4ea45d;})[_0xd3e1('0x21')](respondWithResult(_0x5879f8,0xc9))[_0xd3e1('0x42')](handleError(_0x5879f8,null));};exports['update']=function(_0x33cd97,_0x11d381){if(_0x33cd97[_0xd3e1('0x49')]['id']){delete _0x33cd97[_0xd3e1('0x49')]['id'];}return db[_0xd3e1('0x2a')][_0xd3e1('0x47')]({'where':{'id':_0x33cd97['params']['id']}})[_0xd3e1('0x21')](handleEntityNotFound(_0x11d381,null))[_0xd3e1('0x21')](saveUpdates(_0x33cd97[_0xd3e1('0x49')],null))[_0xd3e1('0x21')](respondWithResult(_0x11d381,null))['catch'](handleError(_0x11d381,null));};exports[_0xd3e1('0x24')]=function(_0x2d98eb,_0x4b7f49){return db[_0xd3e1('0x2a')]['find']({'where':{'id':_0x2d98eb[_0xd3e1('0x43')]['id']}})[_0xd3e1('0x21')](handleEntityNotFound(_0x4b7f49,null))[_0xd3e1('0x21')](removeEntity(_0x4b7f49,null))[_0xd3e1('0x42')](handleError(_0x4b7f49,null));}; \ No newline at end of file +var _0x2792=['model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','Template','fieldName','type','key'];(function(_0x463734,_0x3b347e){var _0x1efc12=function(_0x32f3ab){while(--_0x32f3ab){_0x463734['push'](_0x463734['shift']());}};_0x1efc12(++_0x3b347e);}(_0x2792,0x72));var _0x2279=function(_0xf244e0,_0x20556c){_0xf244e0=_0xf244e0-0x0;var _0xe94095=_0x2792[_0xf244e0];return _0xe94095;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2279('0x0'));var zipdir=require(_0x2279('0x1'));var jsonpatch=require(_0x2279('0x2'));var rp=require(_0x2279('0x3'));var moment=require(_0x2279('0x4'));var BPromise=require(_0x2279('0x5'));var Mustache=require(_0x2279('0x6'));var util=require(_0x2279('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2279('0x8'));var ejs=require(_0x2279('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2279('0xa'));var squel=require(_0x2279('0xb'));var crypto=require(_0x2279('0xc'));var jsforce=require(_0x2279('0xd'));var deskjs=require(_0x2279('0xe'));var toCsv=require(_0x2279('0x8'));var querystring=require(_0x2279('0xf'));var Papa=require(_0x2279('0x10'));var Redis=require(_0x2279('0x11'));var authService=require(_0x2279('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2279('0x13'));var hardwareService=require(_0x2279('0x14'));var logger=require('../../config/logger')(_0x2279('0x15'));var utils=require(_0x2279('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2279('0x17'));var db=require(_0x2279('0x18'))['db'];function respondWithStatusCode(_0x35f402,_0x4a23ed){_0x4a23ed=_0x4a23ed||0xcc;return function(_0x510598){if(_0x510598){return _0x35f402[_0x2279('0x19')](_0x4a23ed);}return _0x35f402['status'](_0x4a23ed)[_0x2279('0x1a')]();};}function respondWithResult(_0x50398c,_0x3c4476){_0x3c4476=_0x3c4476||0xc8;return function(_0x28317b){if(_0x28317b){return _0x50398c[_0x2279('0x1b')](_0x3c4476)[_0x2279('0x1c')](_0x28317b);}};}function respondWithFilteredResult(_0x29a7b4,_0x49e182){return function(_0x20649c){if(_0x20649c){var _0x4306e8=typeof _0x49e182['offset']===_0x2279('0x1d')&&typeof _0x49e182[_0x2279('0x1e')]==='undefined';var _0x5c2a2d=_0x20649c[_0x2279('0x1f')];var _0x27ea8c=_0x4306e8?0x0:_0x49e182[_0x2279('0x20')];var _0x32a0dc=_0x4306e8?_0x20649c[_0x2279('0x1f')]:_0x49e182[_0x2279('0x20')]+_0x49e182[_0x2279('0x1e')];var _0x4b6b1;if(_0x32a0dc>=_0x5c2a2d){_0x32a0dc=_0x5c2a2d;_0x4b6b1=0xc8;}else{_0x4b6b1=0xce;}_0x29a7b4[_0x2279('0x1b')](_0x4b6b1);return _0x29a7b4[_0x2279('0x21')]('Content-Range',_0x27ea8c+'-'+_0x32a0dc+'/'+_0x5c2a2d)[_0x2279('0x1c')](_0x20649c);}return null;};}function patchUpdates(_0x3ef6f7){return function(_0x38c1be){try{jsonpatch['apply'](_0x38c1be,_0x3ef6f7,!![]);}catch(_0x10c1a4){return BPromise[_0x2279('0x22')](_0x10c1a4);}return _0x38c1be[_0x2279('0x23')]();};}function saveUpdates(_0x1c9124,_0x3e4dd9){return function(_0x37e7fb){if(_0x37e7fb){return _0x37e7fb['update'](_0x1c9124)[_0x2279('0x24')](function(_0x2b5c40){return _0x2b5c40;});}return null;};}function removeEntity(_0x551304,_0x61d1a2){return function(_0x5c2557){if(_0x5c2557){return _0x5c2557[_0x2279('0x25')]()[_0x2279('0x24')](function(){var _0x41b059=_0x5c2557[_0x2279('0x26')]({'plain':!![]});var _0x3c445b=_0x2279('0x27');return db[_0x2279('0x28')][_0x2279('0x25')]({'where':{'type':_0x3c445b,'resourceId':_0x41b059['id']}})[_0x2279('0x24')](function(){return _0x5c2557;});})[_0x2279('0x24')](function(){_0x551304['status'](0xcc)[_0x2279('0x1a')]();});}};}function handleEntityNotFound(_0x3a0ff2,_0x18df5f){return function(_0x54a5da){if(!_0x54a5da){_0x3a0ff2['sendStatus'](0x194);}return _0x54a5da;};}function handleError(_0x5aacae,_0x1cdf3b){_0x1cdf3b=_0x1cdf3b||0x1f4;return function(_0x20bb8c){logger[_0x2279('0x29')](_0x20bb8c[_0x2279('0x2a')]);if(_0x20bb8c[_0x2279('0x2b')]){delete _0x20bb8c['name'];}_0x5aacae[_0x2279('0x1b')](_0x1cdf3b)[_0x2279('0x2c')](_0x20bb8c);};}exports[_0x2279('0x2d')]=function(_0x471340,_0x15b4f9){var _0x682efc={},_0x1db19b={},_0x53d2e9={'count':0x0,'rows':[]};var _0x27ff5d=_['map'](db[_0x2279('0x2e')]['rawAttributes'],function(_0x3ec1b4){return{'name':_0x3ec1b4[_0x2279('0x2f')],'type':_0x3ec1b4[_0x2279('0x30')][_0x2279('0x31')]};});_0x1db19b[_0x2279('0x32')]=_[_0x2279('0x33')](_0x27ff5d,'name');_0x1db19b['query']=_[_0x2279('0x34')](_0x471340[_0x2279('0x35')]);_0x1db19b[_0x2279('0x36')]=_[_0x2279('0x37')](_0x1db19b[_0x2279('0x32')],_0x1db19b['query']);_0x682efc[_0x2279('0x38')]=_[_0x2279('0x37')](_0x1db19b['model'],qs[_0x2279('0x39')](_0x471340['query'][_0x2279('0x39')]));_0x682efc[_0x2279('0x38')]=_0x682efc[_0x2279('0x38')]['length']?_0x682efc['attributes']:_0x1db19b[_0x2279('0x32')];if(!_0x471340[_0x2279('0x35')][_0x2279('0x3a')]('nolimit')){_0x682efc[_0x2279('0x1e')]=qs[_0x2279('0x1e')](_0x471340['query'][_0x2279('0x1e')]);_0x682efc[_0x2279('0x20')]=qs[_0x2279('0x20')](_0x471340[_0x2279('0x35')]['offset']);}_0x682efc[_0x2279('0x3b')]=qs[_0x2279('0x3c')](_0x471340['query'][_0x2279('0x3c')]);_0x682efc[_0x2279('0x3d')]=qs['filters'](_[_0x2279('0x3e')](_0x471340[_0x2279('0x35')],_0x1db19b['filters']),_0x27ff5d);if(_0x471340[_0x2279('0x35')]['filter']){_0x682efc[_0x2279('0x3d')]=_[_0x2279('0x3f')](_0x682efc[_0x2279('0x3d')],{'$or':_[_0x2279('0x33')](_0x27ff5d,function(_0xc7e878){if(_0xc7e878[_0x2279('0x30')]!==_0x2279('0x40')){var _0xe4d90c={};_0xe4d90c[_0xc7e878[_0x2279('0x2b')]]={'$like':'%'+_0x471340[_0x2279('0x35')][_0x2279('0x41')]+'%'};return _0xe4d90c;}})});}_0x682efc=_['merge']({},_0x682efc,_0x471340[_0x2279('0x42')]);var _0x1ed036={'where':_0x682efc[_0x2279('0x3d')]};return db[_0x2279('0x2e')][_0x2279('0x1f')](_0x1ed036)[_0x2279('0x24')](function(_0x18e4d3){_0x53d2e9[_0x2279('0x1f')]=_0x18e4d3;if(_0x471340[_0x2279('0x35')]['includeAll']){_0x682efc[_0x2279('0x43')]=[{'all':!![]}];}return db[_0x2279('0x2e')][_0x2279('0x44')](_0x682efc);})['then'](function(_0x4d0981){_0x53d2e9['rows']=_0x4d0981;return _0x53d2e9;})[_0x2279('0x24')](respondWithFilteredResult(_0x15b4f9,_0x682efc))[_0x2279('0x45')](handleError(_0x15b4f9,null));};exports[_0x2279('0x46')]=function(_0x20bcc9,_0xe01fa2){var _0x1fbd55={'raw':!![],'where':{'id':_0x20bcc9[_0x2279('0x47')]['id']}},_0x1ced45={};_0x1ced45[_0x2279('0x32')]=_[_0x2279('0x34')](db[_0x2279('0x2e')]['rawAttributes']);_0x1ced45[_0x2279('0x35')]=_['keys'](_0x20bcc9['query']);_0x1ced45[_0x2279('0x36')]=_[_0x2279('0x37')](_0x1ced45[_0x2279('0x32')],_0x1ced45[_0x2279('0x35')]);_0x1fbd55[_0x2279('0x38')]=_[_0x2279('0x37')](_0x1ced45[_0x2279('0x32')],qs[_0x2279('0x39')](_0x20bcc9[_0x2279('0x35')][_0x2279('0x39')]));_0x1fbd55[_0x2279('0x38')]=_0x1fbd55[_0x2279('0x38')][_0x2279('0x48')]?_0x1fbd55[_0x2279('0x38')]:_0x1ced45['model'];if(_0x20bcc9[_0x2279('0x35')][_0x2279('0x49')]){_0x1fbd55[_0x2279('0x43')]=[{'all':!![]}];}_0x1fbd55=_[_0x2279('0x3f')]({},_0x1fbd55,_0x20bcc9[_0x2279('0x42')]);return db['Template'][_0x2279('0x4a')](_0x1fbd55)[_0x2279('0x24')](handleEntityNotFound(_0xe01fa2,null))[_0x2279('0x24')](respondWithResult(_0xe01fa2,null))['catch'](handleError(_0xe01fa2,null));};exports[_0x2279('0x4b')]=function(_0x21ab96,_0x27e45b){return db[_0x2279('0x2e')]['create'](_0x21ab96[_0x2279('0x4c')],{})['then'](function(_0x90f371){var _0x140a7a=_0x21ab96[_0x2279('0x4d')][_0x2279('0x26')]({'plain':!![]});if(!_0x140a7a)throw new Error(_0x2279('0x4e'));if(_0x140a7a[_0x2279('0x4f')]==='user'){var _0x336d47=_0x90f371[_0x2279('0x26')]({'plain':!![]});var _0x36648d=_0x2279('0x27');return db[_0x2279('0x50')][_0x2279('0x4a')]({'where':{'name':_0x36648d,'userProfileId':_0x140a7a['userProfileId']},'raw':!![]})[_0x2279('0x24')](function(_0x43fcfc){if(_0x43fcfc&&_0x43fcfc['autoAssociation']===0x0){return db[_0x2279('0x28')]['create']({'name':_0x336d47['name'],'resourceId':_0x336d47['id'],'type':_0x43fcfc[_0x2279('0x2b')],'sectionId':_0x43fcfc['id']},{})['then'](function(){return _0x90f371;});}else{return _0x90f371;}})[_0x2279('0x45')](function(_0xa6c07f){logger[_0x2279('0x29')](_0x2279('0x51'),_0xa6c07f);throw _0xa6c07f;});}return _0x90f371;})[_0x2279('0x24')](respondWithResult(_0x27e45b,0xc9))[_0x2279('0x45')](handleError(_0x27e45b,null));};exports['update']=function(_0x2a0776,_0x35e0e8){if(_0x2a0776['body']['id']){delete _0x2a0776[_0x2279('0x4c')]['id'];}return db['Template'][_0x2279('0x4a')]({'where':{'id':_0x2a0776[_0x2279('0x47')]['id']}})[_0x2279('0x24')](handleEntityNotFound(_0x35e0e8,null))['then'](saveUpdates(_0x2a0776[_0x2279('0x4c')],null))[_0x2279('0x24')](respondWithResult(_0x35e0e8,null))[_0x2279('0x45')](handleError(_0x35e0e8,null));};exports[_0x2279('0x25')]=function(_0xdcddff,_0x3db8f7){return db[_0x2279('0x2e')][_0x2279('0x4a')]({'where':{'id':_0xdcddff['params']['id']}})[_0x2279('0x24')](handleEntityNotFound(_0x3db8f7,null))[_0x2279('0x24')](removeEntity(_0x3db8f7,null))[_0x2279('0x45')](handleError(_0x3db8f7,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a218371..a19d9c6 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 _0x57ee=['define','Template','tools_templates','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x5422ca,_0x538609){var _0x2c514e=function(_0x55c92c){while(--_0x55c92c){_0x5422ca['push'](_0x5422ca['shift']());}};_0x2c514e(++_0x538609);}(_0x57ee,0x1d1));var _0xe57e=function(_0x3b9f20,_0x57b0a2){_0x3b9f20=_0x3b9f20-0x0;var _0x54b6b7=_0x57ee[_0x3b9f20];return _0x54b6b7;};'use strict';var _=require(_0xe57e('0x0'));var util=require(_0xe57e('0x1'));var logger=require('../../config/logger')(_0xe57e('0x2'));var moment=require(_0xe57e('0x3'));var BPromise=require(_0xe57e('0x4'));var rp=require(_0xe57e('0x5'));var fs=require('fs');var path=require(_0xe57e('0x6'));var rimraf=require(_0xe57e('0x7'));var config=require(_0xe57e('0x8'));var attributes=require(_0xe57e('0x9'));module[_0xe57e('0xa')]=function(_0x5a7de2,_0x12982f){return _0x5a7de2[_0xe57e('0xb')](_0xe57e('0xc'),attributes,{'tableName':_0xe57e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3761=['./template.attributes','exports','define','Template','tools_templates','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x3761,0x1e5));var _0x1376=function(_0xd6c8f2,_0x26c786){_0xd6c8f2=_0xd6c8f2-0x0;var _0x36348a=_0x3761[_0xd6c8f2];return _0x36348a;};'use strict';var _=require(_0x1376('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1376('0x1'));var moment=require(_0x1376('0x2'));var BPromise=require(_0x1376('0x3'));var rp=require(_0x1376('0x4'));var fs=require('fs');var path=require(_0x1376('0x5'));var rimraf=require('rimraf');var config=require(_0x1376('0x6'));var attributes=require(_0x1376('0x7'));module[_0x1376('0x8')]=function(_0x3d05c8,_0x3478fd){return _0x3d05c8[_0x1376('0x9')](_0x1376('0xa'),attributes,{'tableName':_0x1376('0xb'),'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 6fbd916..05d98c0 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 _0xd2bf=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','options','raw','where','limit','include','model','attributes','map','GetTemplate','lodash','randomstring','ioredis'];(function(_0x3a243d,_0x31d480){var _0x2fcd72=function(_0x57fca3){while(--_0x57fca3){_0x3a243d['push'](_0x3a243d['shift']());}};_0x2fcd72(++_0x31d480);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0xd2bf[_0x176d14];return _0x89522c;};'use strict';var _=require(_0xfd2b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd2b('0x1'));var fs=require('fs');var Redis=require(_0xfd2b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd2b('0x3'));var logger=require('../../config/logger')(_0xfd2b('0x4'));var config=require(_0xfd2b('0x5'));var jayson=require(_0xfd2b('0x6'));var client=jayson[_0xfd2b('0x7')][_0xfd2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fb95e,_0x38db5b,_0x2fa636){return new BPromise(function(_0x46e8db,_0x476f85){return client[_0xfd2b('0x9')](_0x4fb95e,_0x2fa636)[_0xfd2b('0xa')](function(_0x40dde7){logger[_0xfd2b('0xb')](_0xfd2b('0xc'),_0x38db5b,_0xfd2b('0xd'));logger[_0xfd2b('0xe')](_0xfd2b('0xf'),_0x38db5b,_0xfd2b('0xd'),JSON[_0xfd2b('0x10')](_0x40dde7));if(_0x40dde7['error']){if(_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x12')]===0x1f4){logger[_0xfd2b('0x11')]('Template,\x20%s,\x20%s',_0x38db5b,_0x40dde7[_0xfd2b('0x11')]['message']);return _0x476f85(_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x13')]);}logger[_0xfd2b('0x11')]('Template,\x20%s,\x20%s',_0x38db5b,_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x13')]);return _0x46e8db(_0x40dde7[_0xfd2b('0x11')][_0xfd2b('0x13')]);}else{logger[_0xfd2b('0xb')]('Template,\x20%s,\x20%s',_0x38db5b,_0xfd2b('0xd'));_0x46e8db(_0x40dde7[_0xfd2b('0x14')][_0xfd2b('0x13')]);}})[_0xfd2b('0x15')](function(_0x40d901){logger[_0xfd2b('0x11')]('Template,\x20%s,\x20%s',_0x38db5b,_0x40d901);_0x476f85(_0x40d901);});});}exports['GetTemplate']=function(_0x2ebf14){var _0x738bd=this;return new Promise(function(_0x1efd2d,_0x28b353){return db[_0xfd2b('0x16')]['findAll']({'raw':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14[_0xfd2b('0x17')][_0xfd2b('0x18')]===undefined?!![]:![]:!![],'where':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14['options'][_0xfd2b('0x19')]||null:null,'attributes':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14[_0xfd2b('0x17')]['attributes']||null:null,'limit':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14[_0xfd2b('0x17')][_0xfd2b('0x1a')]||null:null,'include':_0x2ebf14[_0xfd2b('0x17')]?_0x2ebf14['options'][_0xfd2b('0x1b')]?_['map'](_0x2ebf14[_0xfd2b('0x17')][_0xfd2b('0x1b')],function(_0x5ada3e){return{'model':db[_0x5ada3e[_0xfd2b('0x1c')]],'as':_0x5ada3e['as'],'attributes':_0x5ada3e[_0xfd2b('0x1d')],'include':_0x5ada3e[_0xfd2b('0x1b')]?_[_0xfd2b('0x1e')](_0x5ada3e[_0xfd2b('0x1b')],function(_0x222eed){return{'model':db[_0x222eed[_0xfd2b('0x1c')]],'as':_0x222eed['as'],'attributes':_0x222eed[_0xfd2b('0x1d')],'include':_0x222eed[_0xfd2b('0x1b')]?_['map'](_0x222eed[_0xfd2b('0x1b')],function(_0x1b7126){return{'model':db[_0x1b7126[_0xfd2b('0x1c')]],'as':_0x1b7126['as'],'attributes':_0x1b7126[_0xfd2b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd2b('0xa')](function(_0x271081){logger[_0xfd2b('0xb')]('GetTemplate',_0x2ebf14);logger[_0xfd2b('0xe')]('GetTemplate',_0x2ebf14,JSON[_0xfd2b('0x10')](_0x271081));_0x1efd2d(_0x271081);})[_0xfd2b('0x15')](function(_0x160c54){logger[_0xfd2b('0x11')](_0xfd2b('0x1f'),_0x160c54[_0xfd2b('0x13')],_0x2ebf14);_0x28b353(_0x738bd[_0xfd2b('0x11')](0x1f4,_0x160c54[_0xfd2b('0x13')]));});});}; \ No newline at end of file +var _0x0b55=['attributes','model','GetTemplate','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','findAll','options','where','limit','include','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b55,0x1d4));var _0x50b5=function(_0x3e7084,_0x870be6){_0x3e7084=_0x3e7084-0x0;var _0x1a9eed=_0x0b55[_0x3e7084];return _0x1a9eed;};'use strict';var _=require(_0x50b5('0x0'));var util=require('util');var moment=require(_0x50b5('0x1'));var BPromise=require(_0x50b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50b5('0x3'));var db=require(_0x50b5('0x4'))['db'];var utils=require(_0x50b5('0x5'));var logger=require(_0x50b5('0x6'))(_0x50b5('0x7'));var config=require(_0x50b5('0x8'));var jayson=require(_0x50b5('0x9'));var client=jayson['client'][_0x50b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65386,_0xfcbd3d,_0x1592f7){return new BPromise(function(_0x15528a,_0x93dda3){return client[_0x50b5('0xb')](_0x65386,_0x1592f7)[_0x50b5('0xc')](function(_0x19cb90){logger['info'](_0x50b5('0xd'),_0xfcbd3d,_0x50b5('0xe'));logger[_0x50b5('0xf')](_0x50b5('0x10'),_0xfcbd3d,'request\x20sent',JSON['stringify'](_0x19cb90));if(_0x19cb90['error']){if(_0x19cb90[_0x50b5('0x11')]['code']===0x1f4){logger['error'](_0x50b5('0xd'),_0xfcbd3d,_0x19cb90['error'][_0x50b5('0x12')]);return _0x93dda3(_0x19cb90[_0x50b5('0x11')][_0x50b5('0x12')]);}logger[_0x50b5('0x11')]('Template,\x20%s,\x20%s',_0xfcbd3d,_0x19cb90[_0x50b5('0x11')][_0x50b5('0x12')]);return _0x15528a(_0x19cb90[_0x50b5('0x11')][_0x50b5('0x12')]);}else{logger[_0x50b5('0x13')](_0x50b5('0xd'),_0xfcbd3d,_0x50b5('0xe'));_0x15528a(_0x19cb90[_0x50b5('0x14')][_0x50b5('0x12')]);}})[_0x50b5('0x15')](function(_0x5e547f){logger[_0x50b5('0x11')]('Template,\x20%s,\x20%s',_0xfcbd3d,_0x5e547f);_0x93dda3(_0x5e547f);});});}exports['GetTemplate']=function(_0x1b9690){var _0x143ccc=this;return new Promise(function(_0x20a974,_0x2c20e6){return db['Template'][_0x50b5('0x16')]({'raw':_0x1b9690[_0x50b5('0x17')]?_0x1b9690[_0x50b5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b9690['options']?_0x1b9690[_0x50b5('0x17')][_0x50b5('0x18')]||null:null,'attributes':_0x1b9690[_0x50b5('0x17')]?_0x1b9690[_0x50b5('0x17')]['attributes']||null:null,'limit':_0x1b9690[_0x50b5('0x17')]?_0x1b9690[_0x50b5('0x17')][_0x50b5('0x19')]||null:null,'include':_0x1b9690[_0x50b5('0x17')]?_0x1b9690[_0x50b5('0x17')][_0x50b5('0x1a')]?_[_0x50b5('0x1b')](_0x1b9690[_0x50b5('0x17')][_0x50b5('0x1a')],function(_0x18d982){return{'model':db[_0x18d982['model']],'as':_0x18d982['as'],'attributes':_0x18d982[_0x50b5('0x1c')],'include':_0x18d982[_0x50b5('0x1a')]?_[_0x50b5('0x1b')](_0x18d982[_0x50b5('0x1a')],function(_0x343518){return{'model':db[_0x343518[_0x50b5('0x1d')]],'as':_0x343518['as'],'attributes':_0x343518[_0x50b5('0x1c')],'include':_0x343518[_0x50b5('0x1a')]?_['map'](_0x343518[_0x50b5('0x1a')],function(_0x271a00){return{'model':db[_0x271a00[_0x50b5('0x1d')]],'as':_0x271a00['as'],'attributes':_0x271a00[_0x50b5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x50b5('0xc')](function(_0x424b33){logger[_0x50b5('0x13')](_0x50b5('0x1e'),_0x1b9690);logger[_0x50b5('0xf')]('GetTemplate',_0x1b9690,JSON['stringify'](_0x424b33));_0x20a974(_0x424b33);})[_0x50b5('0x15')](function(_0xb2f8d8){logger[_0x50b5('0x11')](_0x50b5('0x1e'),_0xb2f8d8[_0x50b5('0x12')],_0x1b9690);_0x2c20e6(_0x143ccc[_0x50b5('0x11')](0x1f4,_0xb2f8d8['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1629889..5778c98 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 _0x8bc9=['fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x90dc14,_0x3e55e5){var _0x23a79c=function(_0x5bb338){while(--_0x5bb338){_0x90dc14['push'](_0x90dc14['shift']());}};_0x23a79c(++_0x3e55e5);}(_0x8bc9,0x1bb));var _0x98bc=function(_0x27dc51,_0x14950f){_0x27dc51=_0x27dc51-0x0;var _0x739ae1=_0x8bc9[_0x27dc51];return _0x739ae1;};'use strict';var multer=require(_0x98bc('0x0'));var util=require(_0x98bc('0x1'));var path=require(_0x98bc('0x2'));var timeout=require(_0x98bc('0x3'));var express=require('express');var router=express[_0x98bc('0x4')]();var fs_extra=require(_0x98bc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98bc('0x6'));var config=require(_0x98bc('0x7'));var controller=require(_0x98bc('0x8'));router[_0x98bc('0x9')]('/',auth['isAuthenticated'](),controller[_0x98bc('0xa')]);router[_0x98bc('0x9')](_0x98bc('0xb'),auth[_0x98bc('0xc')](),controller['show']);router['get']('/:id/all_conditions',auth[_0x98bc('0xc')](),controller[_0x98bc('0xd')]);router['get'](_0x98bc('0xe'),auth[_0x98bc('0xc')](),controller[_0x98bc('0xf')]);router[_0x98bc('0x9')](_0x98bc('0x10'),auth[_0x98bc('0xc')](),controller[_0x98bc('0x11')]);router[_0x98bc('0x12')]('/',auth[_0x98bc('0xc')](),controller[_0x98bc('0x13')]);router[_0x98bc('0x12')](_0x98bc('0x14'),auth[_0x98bc('0xc')](),controller[_0x98bc('0x15')]);router[_0x98bc('0x12')](_0x98bc('0xe'),auth[_0x98bc('0xc')](),controller[_0x98bc('0x16')]);router[_0x98bc('0x12')](_0x98bc('0x10'),auth['isAuthenticated'](),controller[_0x98bc('0x17')]);router[_0x98bc('0x18')]('/:id',auth[_0x98bc('0xc')](),controller[_0x98bc('0x19')]);router['delete'](_0x98bc('0xb'),auth['isAuthenticated'](),controller[_0x98bc('0x1a')]);module[_0x98bc('0x1b')]=router; \ No newline at end of file +var _0xeef8=['get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','addAllCondition','post','addAction','update','delete','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller'];(function(_0x5dc89f,_0x4411bc){var _0x5115e4=function(_0x12d2ab){while(--_0x12d2ab){_0x5dc89f['push'](_0x5dc89f['shift']());}};_0x5115e4(++_0x4411bc);}(_0xeef8,0x197));var _0x8eef=function(_0x117f5f,_0x283091){_0x117f5f=_0x117f5f-0x0;var _0x5ebbd8=_0xeef8[_0x117f5f];return _0x5ebbd8;};'use strict';var multer=require('multer');var util=require(_0x8eef('0x0'));var path=require(_0x8eef('0x1'));var timeout=require(_0x8eef('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8eef('0x3'));var interaction=require(_0x8eef('0x4'));var config=require(_0x8eef('0x5'));var controller=require(_0x8eef('0x6'));router[_0x8eef('0x7')]('/',auth[_0x8eef('0x8')](),controller[_0x8eef('0x9')]);router[_0x8eef('0x7')](_0x8eef('0xa'),auth[_0x8eef('0x8')](),controller[_0x8eef('0xb')]);router[_0x8eef('0x7')](_0x8eef('0xc'),auth[_0x8eef('0x8')](),controller[_0x8eef('0xd')]);router[_0x8eef('0x7')](_0x8eef('0xe'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x8eef('0x7')](_0x8eef('0xf'),auth['isAuthenticated'](),controller[_0x8eef('0x10')]);router['post']('/',auth[_0x8eef('0x8')](),controller[_0x8eef('0x11')]);router['post']('/:id/all_conditions',auth[_0x8eef('0x8')](),controller[_0x8eef('0x12')]);router[_0x8eef('0x13')](_0x8eef('0xe'),auth[_0x8eef('0x8')](),controller['addAnyCondition']);router[_0x8eef('0x13')](_0x8eef('0xf'),auth[_0x8eef('0x8')](),controller[_0x8eef('0x14')]);router['put'](_0x8eef('0xa'),auth['isAuthenticated'](),controller[_0x8eef('0x15')]);router[_0x8eef('0x16')]('/:id',auth[_0x8eef('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e57af0d..86afbec 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 _0x57bd=['sequelize','exports','STRING','BOOLEAN'];(function(_0x473862,_0x199b67){var _0x5a57bb=function(_0x15d93d){while(--_0x15d93d){_0x473862['push'](_0x473862['shift']());}};_0x5a57bb(++_0x199b67);}(_0x57bd,0xec));var _0xd57b=function(_0x1c05ca,_0x6153de){_0x1c05ca=_0x1c05ca-0x0;var _0x241a2e=_0x57bd[_0x1c05ca];return _0x241a2e;};'use strict';var Sequelize=require(_0xd57b('0x0'));module[_0xd57b('0x1')]={'name':{'type':Sequelize[_0xd57b('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd57b('0x2')]},'status':{'type':Sequelize[_0xd57b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa62b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x333767,_0x220733){var _0x42a755=function(_0x535b16){while(--_0x535b16){_0x333767['push'](_0x333767['shift']());}};_0x42a755(++_0x220733);}(_0xa62b,0x1b0));var _0xba62=function(_0x1b7555,_0x3bd781){_0x1b7555=_0x1b7555-0x0;var _0x4436e1=_0xa62b[_0x1b7555];return _0x4436e1;};'use strict';var Sequelize=require(_0xba62('0x0'));module[_0xba62('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xba62('0x2')]},'description':{'type':Sequelize[_0xba62('0x2')]},'status':{'type':Sequelize[_0xba62('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index ac08870..dfec4ea 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 _0x66c0=['include','findAll','rows','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','find','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','nolimit','getAnyConditions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','destroy','error','stack','name','send','index','map','Trigger','fieldName','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll'];(function(_0x3b98c1,_0x3a4ae5){var _0x26990b=function(_0x2e1779){while(--_0x2e1779){_0x3b98c1['push'](_0x3b98c1['shift']());}};_0x26990b(++_0x3a4ae5);}(_0x66c0,0x1a2));var _0x066c=function(_0x402510,_0xe6fa73){_0x402510=_0x402510-0x0;var _0x5e43e3=_0x66c0[_0x402510];return _0x5e43e3;};'use strict';var emlformat=require(_0x066c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x066c('0x1'));var rp=require(_0x066c('0x2'));var moment=require(_0x066c('0x3'));var BPromise=require(_0x066c('0x4'));var Mustache=require(_0x066c('0x5'));var util=require(_0x066c('0x6'));var path=require(_0x066c('0x7'));var sox=require('sox');var csv=require(_0x066c('0x8'));var ejs=require(_0x066c('0x9'));var fs=require('fs');var fs_extra=require(_0x066c('0xa'));var _=require(_0x066c('0xb'));var squel=require(_0x066c('0xc'));var crypto=require('crypto');var jsforce=require(_0x066c('0xd'));var deskjs=require(_0x066c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x066c('0xf'));var Papa=require(_0x066c('0x10'));var Redis=require(_0x066c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x066c('0x12'));var hardwareService=require(_0x066c('0x13'));var logger=require('../../config/logger')(_0x066c('0x14'));var utils=require(_0x066c('0x15'));var config=require(_0x066c('0x16'));var licenseUtil=require(_0x066c('0x17'));var db=require(_0x066c('0x18'))['db'];function respondWithStatusCode(_0x523aa7,_0x3ae722){_0x3ae722=_0x3ae722||0xcc;return function(_0x2b2c5e){if(_0x2b2c5e){return _0x523aa7[_0x066c('0x19')](_0x3ae722);}return _0x523aa7[_0x066c('0x1a')](_0x3ae722)[_0x066c('0x1b')]();};}function respondWithResult(_0x50f801,_0x4e2ccf){_0x4e2ccf=_0x4e2ccf||0xc8;return function(_0x1b2c5c){if(_0x1b2c5c){return _0x50f801[_0x066c('0x1a')](_0x4e2ccf)['json'](_0x1b2c5c);}};}function respondWithFilteredResult(_0x416043,_0x382996){return function(_0x50ae43){if(_0x50ae43){var _0x5e47a8=typeof _0x382996[_0x066c('0x1c')]===_0x066c('0x1d')&&typeof _0x382996[_0x066c('0x1e')]===_0x066c('0x1d');var _0x4440c8=_0x50ae43[_0x066c('0x1f')];var _0x58c025=_0x5e47a8?0x0:_0x382996[_0x066c('0x1c')];var _0x95708b=_0x5e47a8?_0x50ae43[_0x066c('0x1f')]:_0x382996[_0x066c('0x1c')]+_0x382996[_0x066c('0x1e')];var _0x401404;if(_0x95708b>=_0x4440c8){_0x95708b=_0x4440c8;_0x401404=0xc8;}else{_0x401404=0xce;}_0x416043[_0x066c('0x1a')](_0x401404);return _0x416043[_0x066c('0x20')](_0x066c('0x21'),_0x58c025+'-'+_0x95708b+'/'+_0x4440c8)[_0x066c('0x22')](_0x50ae43);}return null;};}function patchUpdates(_0x29ab7b){return function(_0x2bdb3a){try{jsonpatch[_0x066c('0x23')](_0x2bdb3a,_0x29ab7b,!![]);}catch(_0x44fc4f){return BPromise[_0x066c('0x24')](_0x44fc4f);}return _0x2bdb3a[_0x066c('0x25')]();};}function saveUpdates(_0x5d3141,_0x217ba2){return function(_0x2b572a){if(_0x2b572a){return _0x2b572a['update'](_0x5d3141)['then'](function(_0x328103){return _0x328103;});}return null;};}function removeEntity(_0x2c34bb,_0x3bcbb2){return function(_0x422631){if(_0x422631){return _0x422631['destroy']()[_0x066c('0x26')](function(){var _0x1fd002=_0x422631[_0x066c('0x27')]({'plain':!![]});var _0x37452a='Triggers';return db['UserProfileResource'][_0x066c('0x28')]({'where':{'type':_0x37452a,'resourceId':_0x1fd002['id']}})[_0x066c('0x26')](function(){return _0x422631;});})['then'](function(){_0x2c34bb['status'](0xcc)[_0x066c('0x1b')]();});}};}function handleEntityNotFound(_0x42e184,_0xa6ef30){return function(_0x35be85){if(!_0x35be85){_0x42e184['sendStatus'](0x194);}return _0x35be85;};}function handleError(_0x2562ef,_0x3f6987){_0x3f6987=_0x3f6987||0x1f4;return function(_0x39eea1){logger[_0x066c('0x29')](_0x39eea1[_0x066c('0x2a')]);if(_0x39eea1[_0x066c('0x2b')]){delete _0x39eea1[_0x066c('0x2b')];}_0x2562ef[_0x066c('0x1a')](_0x3f6987)[_0x066c('0x2c')](_0x39eea1);};}exports[_0x066c('0x2d')]=function(_0x27c249,_0x141f9f){var _0x1455f1={},_0x22e4ea={},_0x3afd11={'count':0x0,'rows':[]};var _0x26135a=_[_0x066c('0x2e')](db[_0x066c('0x2f')]['rawAttributes'],function(_0x55f878){return{'name':_0x55f878[_0x066c('0x30')],'type':_0x55f878['type'][_0x066c('0x31')]};});_0x22e4ea[_0x066c('0x32')]=_['map'](_0x26135a,_0x066c('0x2b'));_0x22e4ea['query']=_[_0x066c('0x33')](_0x27c249['query']);_0x22e4ea[_0x066c('0x34')]=_[_0x066c('0x35')](_0x22e4ea['model'],_0x22e4ea['query']);_0x1455f1[_0x066c('0x36')]=_[_0x066c('0x35')](_0x22e4ea[_0x066c('0x32')],qs[_0x066c('0x37')](_0x27c249['query'][_0x066c('0x37')]));_0x1455f1[_0x066c('0x36')]=_0x1455f1[_0x066c('0x36')][_0x066c('0x38')]?_0x1455f1[_0x066c('0x36')]:_0x22e4ea[_0x066c('0x32')];if(!_0x27c249[_0x066c('0x39')][_0x066c('0x3a')]('nolimit')){_0x1455f1['limit']=qs['limit'](_0x27c249['query'][_0x066c('0x1e')]);_0x1455f1[_0x066c('0x1c')]=qs[_0x066c('0x1c')](_0x27c249[_0x066c('0x39')][_0x066c('0x1c')]);}_0x1455f1['order']=qs[_0x066c('0x3b')](_0x27c249[_0x066c('0x39')][_0x066c('0x3b')]);_0x1455f1[_0x066c('0x3c')]=qs[_0x066c('0x34')](_[_0x066c('0x3d')](_0x27c249[_0x066c('0x39')],_0x22e4ea[_0x066c('0x34')]),_0x26135a);if(_0x27c249['query']['filter']){_0x1455f1['where']=_['merge'](_0x1455f1['where'],{'$or':_[_0x066c('0x2e')](_0x26135a,function(_0x43ed98){if(_0x43ed98['type']!==_0x066c('0x3e')){var _0x1bb61c={};_0x1bb61c[_0x43ed98['name']]={'$like':'%'+_0x27c249[_0x066c('0x39')][_0x066c('0x3f')]+'%'};return _0x1bb61c;}})});}_0x1455f1=_[_0x066c('0x40')]({},_0x1455f1,_0x27c249[_0x066c('0x41')]);var _0x23e08b={'where':_0x1455f1[_0x066c('0x3c')]};return db[_0x066c('0x2f')][_0x066c('0x1f')](_0x23e08b)[_0x066c('0x26')](function(_0x40948f){_0x3afd11[_0x066c('0x1f')]=_0x40948f;if(_0x27c249['query'][_0x066c('0x42')]){_0x1455f1[_0x066c('0x43')]=[{'all':!![]}];}return db[_0x066c('0x2f')][_0x066c('0x44')](_0x1455f1);})['then'](function(_0x37f205){_0x3afd11[_0x066c('0x45')]=_0x37f205;return _0x3afd11;})[_0x066c('0x26')](respondWithFilteredResult(_0x141f9f,_0x1455f1))['catch'](handleError(_0x141f9f,null));};exports[_0x066c('0x46')]=function(_0x4e046e,_0xaf4dc){var _0x125b9c={'raw':![],'where':{'id':_0x4e046e[_0x066c('0x47')]['id']}},_0x26990d={};_0x26990d[_0x066c('0x32')]=_[_0x066c('0x33')](db[_0x066c('0x2f')][_0x066c('0x48')]);_0x26990d[_0x066c('0x39')]=_[_0x066c('0x33')](_0x4e046e[_0x066c('0x39')]);_0x26990d[_0x066c('0x34')]=_[_0x066c('0x35')](_0x26990d['model'],_0x26990d['query']);_0x125b9c[_0x066c('0x36')]=_[_0x066c('0x35')](_0x26990d[_0x066c('0x32')],qs[_0x066c('0x37')](_0x4e046e[_0x066c('0x39')][_0x066c('0x37')]));_0x125b9c[_0x066c('0x36')]=_0x125b9c[_0x066c('0x36')][_0x066c('0x38')]?_0x125b9c[_0x066c('0x36')]:_0x26990d[_0x066c('0x32')];if(_0x4e046e[_0x066c('0x39')][_0x066c('0x42')]){_0x125b9c[_0x066c('0x43')]=[{'all':!![]}];}_0x125b9c=_[_0x066c('0x40')]({},_0x125b9c,_0x4e046e[_0x066c('0x41')]);return db['Trigger']['find'](_0x125b9c)[_0x066c('0x26')](handleEntityNotFound(_0xaf4dc,null))[_0x066c('0x26')](respondWithResult(_0xaf4dc,null))['catch'](handleError(_0xaf4dc,null));};exports[_0x066c('0x49')]=function(_0x2c332c,_0x406639){return db[_0x066c('0x2f')][_0x066c('0x49')](_0x2c332c[_0x066c('0x4a')],{})[_0x066c('0x26')](function(_0xdf347a){var _0x36815b=_0x2c332c[_0x066c('0x4b')]['get']({'plain':!![]});if(!_0x36815b)throw new Error(_0x066c('0x4c'));if(_0x36815b[_0x066c('0x4d')]===_0x066c('0x4b')){var _0x515f59=_0xdf347a[_0x066c('0x27')]({'plain':!![]});var _0xf57868=_0x066c('0x4e');return db['UserProfileSection'][_0x066c('0x4f')]({'where':{'name':_0xf57868,'userProfileId':_0x36815b[_0x066c('0x50')]},'raw':!![]})[_0x066c('0x26')](function(_0x544b76){if(_0x544b76&&_0x544b76['autoAssociation']===0x0){return db[_0x066c('0x51')][_0x066c('0x49')]({'name':_0x515f59[_0x066c('0x2b')],'resourceId':_0x515f59['id'],'type':_0x544b76[_0x066c('0x2b')],'sectionId':_0x544b76['id']},{})[_0x066c('0x26')](function(){return _0xdf347a;});}else{return _0xdf347a;}})[_0x066c('0x52')](function(_0x5eb29b){logger[_0x066c('0x29')](_0x066c('0x53'),_0x5eb29b);throw _0x5eb29b;});}return _0xdf347a;})['then'](respondWithResult(_0x406639,0xc9))[_0x066c('0x52')](handleError(_0x406639,null));};exports[_0x066c('0x54')]=function(_0x14278e,_0x2eb8a8){if(_0x14278e['body']['id']){delete _0x14278e[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')]['find']({'where':{'id':_0x14278e[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x2eb8a8,null))[_0x066c('0x26')](saveUpdates(_0x14278e[_0x066c('0x4a')],null))[_0x066c('0x26')](respondWithResult(_0x2eb8a8,null))[_0x066c('0x52')](handleError(_0x2eb8a8,null));};exports[_0x066c('0x28')]=function(_0x383280,_0x2ca8a3){return db['Trigger'][_0x066c('0x4f')]({'where':{'id':_0x383280[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x2ca8a3,null))[_0x066c('0x26')](removeEntity(_0x2ca8a3,null))[_0x066c('0x52')](handleError(_0x2ca8a3,null));};exports[_0x066c('0x55')]=function(_0x374563,_0x546f6b,_0x49af18){if(_0x374563[_0x066c('0x4a')]['id']){delete _0x374563[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')][_0x066c('0x4f')]({'where':{'id':_0x374563[_0x066c('0x47')]['id']}})['then'](handleEntityNotFound(_0x546f6b,null))['then'](function(_0x24b966){if(_0x24b966){_0x374563['body'][_0x066c('0x56')]=_0x24b966['id'];return db[_0x066c('0x57')][_0x066c('0x49')](_0x374563[_0x066c('0x4a')]);}})[_0x066c('0x26')](respondWithResult(_0x546f6b,null))['catch'](handleError(_0x546f6b,null));};exports[_0x066c('0x58')]=function(_0x377033,_0x342e25,_0x318851){if(_0x377033['body']['id']){delete _0x377033[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')][_0x066c('0x4f')]({'where':{'id':_0x377033[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x342e25,null))['then'](function(_0x3f4792){if(_0x3f4792){_0x377033['body'][_0x066c('0x59')]=_0x3f4792['id'];return db[_0x066c('0x57')][_0x066c('0x49')](_0x377033[_0x066c('0x4a')]);}})[_0x066c('0x26')](respondWithResult(_0x342e25,null))[_0x066c('0x52')](handleError(_0x342e25,null));};exports[_0x066c('0x5a')]=function(_0x17afef,_0x25c80c,_0x1524d3){var _0x24c8e9={};var _0x928a67={};var _0x4e523c;var _0x10d94a;return db[_0x066c('0x2f')][_0x066c('0x5b')]({'where':{'id':_0x17afef['params']['id']}})['then'](handleEntityNotFound(_0x25c80c,null))[_0x066c('0x26')](function(_0x37cffa){if(_0x37cffa){_0x4e523c=_0x37cffa;_0x928a67[_0x066c('0x32')]=_[_0x066c('0x33')](db['Condition'][_0x066c('0x48')]);_0x928a67['query']=_[_0x066c('0x33')](_0x17afef[_0x066c('0x39')]);_0x928a67[_0x066c('0x34')]=_[_0x066c('0x35')](_0x928a67[_0x066c('0x32')],_0x928a67[_0x066c('0x39')]);_0x24c8e9[_0x066c('0x36')]=_[_0x066c('0x35')](_0x928a67[_0x066c('0x32')],qs[_0x066c('0x37')](_0x17afef[_0x066c('0x39')]['fields']));_0x24c8e9[_0x066c('0x36')]=_0x24c8e9['attributes'][_0x066c('0x38')]?_0x24c8e9[_0x066c('0x36')]:_0x928a67[_0x066c('0x32')];_0x24c8e9[_0x066c('0x5c')]=qs[_0x066c('0x3b')](_0x17afef['query'][_0x066c('0x3b')]);_0x24c8e9[_0x066c('0x3c')]=qs[_0x066c('0x34')](_['pick'](_0x17afef['query'],_0x928a67[_0x066c('0x34')]));if(_0x17afef[_0x066c('0x39')][_0x066c('0x3f')]){_0x24c8e9['where']=_[_0x066c('0x40')](_0x24c8e9[_0x066c('0x3c')],{'$or':_[_0x066c('0x2e')](_0x24c8e9[_0x066c('0x36')],function(_0x1bd8b2){var _0xdb8a05={};_0xdb8a05[_0x1bd8b2]={'$like':'%'+_0x17afef[_0x066c('0x39')]['filter']+'%'};return _0xdb8a05;})});}_0x24c8e9=_['merge']({},_0x24c8e9,_0x17afef[_0x066c('0x41')]);return _0x4e523c[_0x066c('0x5a')](_0x24c8e9);}})[_0x066c('0x26')](function(_0x3e1929){if(_0x3e1929){_0x10d94a=_0x3e1929[_0x066c('0x38')];if(!_0x17afef['query'][_0x066c('0x3a')](_0x066c('0x5d'))){_0x24c8e9[_0x066c('0x1e')]=qs[_0x066c('0x1e')](_0x17afef[_0x066c('0x39')][_0x066c('0x1e')]);_0x24c8e9[_0x066c('0x1c')]=qs['offset'](_0x17afef[_0x066c('0x39')][_0x066c('0x1c')]);}return _0x4e523c[_0x066c('0x5a')](_0x24c8e9);}})[_0x066c('0x26')](function(_0x2ed64b){if(_0x2ed64b){return _0x2ed64b?{'count':_0x10d94a,'rows':_0x2ed64b}:null;}})['then'](respondWithResult(_0x25c80c,null))[_0x066c('0x52')](handleError(_0x25c80c,null));};exports[_0x066c('0x5e')]=function(_0x382df8,_0x1a6fdc,_0x47b244){var _0x2402e2={};var _0x1ff4ab={};var _0x119f54;var _0xe5bf00;return db[_0x066c('0x2f')]['findOne']({'where':{'id':_0x382df8['params']['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x1a6fdc,null))[_0x066c('0x26')](function(_0x6d8e66){if(_0x6d8e66){_0x119f54=_0x6d8e66;_0x1ff4ab[_0x066c('0x32')]=_['keys'](db[_0x066c('0x57')][_0x066c('0x48')]);_0x1ff4ab[_0x066c('0x39')]=_[_0x066c('0x33')](_0x382df8[_0x066c('0x39')]);_0x1ff4ab['filters']=_[_0x066c('0x35')](_0x1ff4ab[_0x066c('0x32')],_0x1ff4ab['query']);_0x2402e2[_0x066c('0x36')]=_[_0x066c('0x35')](_0x1ff4ab[_0x066c('0x32')],qs['fields'](_0x382df8[_0x066c('0x39')][_0x066c('0x37')]));_0x2402e2[_0x066c('0x36')]=_0x2402e2[_0x066c('0x36')][_0x066c('0x38')]?_0x2402e2[_0x066c('0x36')]:_0x1ff4ab[_0x066c('0x32')];_0x2402e2['order']=qs['sort'](_0x382df8[_0x066c('0x39')]['sort']);_0x2402e2[_0x066c('0x3c')]=qs['filters'](_[_0x066c('0x3d')](_0x382df8[_0x066c('0x39')],_0x1ff4ab[_0x066c('0x34')]));if(_0x382df8[_0x066c('0x39')][_0x066c('0x3f')]){_0x2402e2['where']=_[_0x066c('0x40')](_0x2402e2[_0x066c('0x3c')],{'$or':_[_0x066c('0x2e')](_0x2402e2['attributes'],function(_0x1a96ef){var _0x58a6ec={};_0x58a6ec[_0x1a96ef]={'$like':'%'+_0x382df8[_0x066c('0x39')][_0x066c('0x3f')]+'%'};return _0x58a6ec;})});}_0x2402e2=_['merge']({},_0x2402e2,_0x382df8['options']);return _0x119f54[_0x066c('0x5e')](_0x2402e2);}})[_0x066c('0x26')](function(_0x525453){if(_0x525453){_0xe5bf00=_0x525453[_0x066c('0x38')];if(!_0x382df8['query'][_0x066c('0x3a')]('nolimit')){_0x2402e2[_0x066c('0x1e')]=qs[_0x066c('0x1e')](_0x382df8[_0x066c('0x39')][_0x066c('0x1e')]);_0x2402e2['offset']=qs[_0x066c('0x1c')](_0x382df8[_0x066c('0x39')][_0x066c('0x1c')]);}return _0x119f54['getAnyConditions'](_0x2402e2);}})[_0x066c('0x26')](function(_0x29c827){if(_0x29c827){return _0x29c827?{'count':_0xe5bf00,'rows':_0x29c827}:null;}})['then'](respondWithResult(_0x1a6fdc,null))[_0x066c('0x52')](handleError(_0x1a6fdc,null));};exports['addAction']=function(_0x213666,_0x260287,_0x1b5cd7){if(_0x213666[_0x066c('0x4a')]['id']){delete _0x213666[_0x066c('0x4a')]['id'];}return db[_0x066c('0x2f')][_0x066c('0x4f')]({'where':{'id':_0x213666[_0x066c('0x47')]['id']}})[_0x066c('0x26')](handleEntityNotFound(_0x260287,null))[_0x066c('0x26')](function(_0x1cd7a6){if(_0x1cd7a6){_0x213666[_0x066c('0x4a')]['TriggerId']=_0x1cd7a6['id'];return db['Action'][_0x066c('0x49')](_0x213666[_0x066c('0x4a')]);}})['then'](respondWithResult(_0x260287,null))[_0x066c('0x52')](handleError(_0x260287,null));};exports['getActions']=function(_0x2724dc,_0x413a58,_0x1d8bc6){var _0x4ee314={};var _0x376ae0={};var _0x2780e0;var _0x15a2e9;return db[_0x066c('0x2f')][_0x066c('0x5b')]({'where':{'id':_0x2724dc[_0x066c('0x47')]['id']}})['then'](handleEntityNotFound(_0x413a58,null))[_0x066c('0x26')](function(_0x447a0f){if(_0x447a0f){_0x2780e0=_0x447a0f;_0x376ae0[_0x066c('0x32')]=_['keys'](db[_0x066c('0x5f')][_0x066c('0x48')]);_0x376ae0[_0x066c('0x39')]=_[_0x066c('0x33')](_0x2724dc[_0x066c('0x39')]);_0x376ae0['filters']=_[_0x066c('0x35')](_0x376ae0[_0x066c('0x32')],_0x376ae0[_0x066c('0x39')]);_0x4ee314[_0x066c('0x36')]=_[_0x066c('0x35')](_0x376ae0[_0x066c('0x32')],qs[_0x066c('0x37')](_0x2724dc['query'][_0x066c('0x37')]));_0x4ee314[_0x066c('0x36')]=_0x4ee314[_0x066c('0x36')][_0x066c('0x38')]?_0x4ee314[_0x066c('0x36')]:_0x376ae0['model'];_0x4ee314[_0x066c('0x5c')]=qs[_0x066c('0x3b')](_0x2724dc[_0x066c('0x39')]['sort']);_0x4ee314['where']=qs[_0x066c('0x34')](_[_0x066c('0x3d')](_0x2724dc['query'],_0x376ae0[_0x066c('0x34')]));if(_0x2724dc['query'][_0x066c('0x3f')]){_0x4ee314[_0x066c('0x3c')]=_[_0x066c('0x40')](_0x4ee314['where'],{'$or':_[_0x066c('0x2e')](_0x4ee314[_0x066c('0x36')],function(_0x5853ab){var _0x2cf660={};_0x2cf660[_0x5853ab]={'$like':'%'+_0x2724dc['query']['filter']+'%'};return _0x2cf660;})});}_0x4ee314=_[_0x066c('0x40')]({},_0x4ee314,_0x2724dc[_0x066c('0x41')]);return _0x2780e0['getActions'](_0x4ee314);}})[_0x066c('0x26')](function(_0x5bc41b){if(_0x5bc41b){_0x15a2e9=_0x5bc41b[_0x066c('0x38')];if(!_0x2724dc[_0x066c('0x39')][_0x066c('0x3a')](_0x066c('0x5d'))){_0x4ee314[_0x066c('0x1e')]=qs['limit'](_0x2724dc['query'][_0x066c('0x1e')]);_0x4ee314[_0x066c('0x1c')]=qs[_0x066c('0x1c')](_0x2724dc['query'][_0x066c('0x1c')]);}return _0x2780e0[_0x066c('0x60')](_0x4ee314);}})[_0x066c('0x26')](function(_0x254c38){if(_0x254c38){return _0x254c38?{'count':_0x15a2e9,'rows':_0x254c38}:null;}})['then'](respondWithResult(_0x413a58,null))[_0x066c('0x52')](handleError(_0x413a58,null));}; \ No newline at end of file +var _0x43e3=['addAction','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','Triggers','UserProfileResource','error','stack','name','send','map','Trigger','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','include','findAll','rows','catch','show','find','body','user','role','get','UserProfileSection','userProfileId','create','update','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','length','pick','getAnyConditions'];(function(_0x4b09f4,_0x2ba844){var _0x5ea197=function(_0x1e91dd){while(--_0x1e91dd){_0x4b09f4['push'](_0x4b09f4['shift']());}};_0x5ea197(++_0x2ba844);}(_0x43e3,0xbd));var _0x343e=function(_0x475b7d,_0x3e1f95){_0x475b7d=_0x475b7d-0x0;var _0x2ad527=_0x43e3[_0x475b7d];return _0x2ad527;};'use strict';var emlformat=require(_0x343e('0x0'));var rimraf=require(_0x343e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x343e('0x2'));var rp=require(_0x343e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x343e('0x4'));var util=require(_0x343e('0x5'));var path=require(_0x343e('0x6'));var sox=require(_0x343e('0x7'));var csv=require(_0x343e('0x8'));var ejs=require(_0x343e('0x9'));var fs=require('fs');var fs_extra=require(_0x343e('0xa'));var _=require(_0x343e('0xb'));var squel=require(_0x343e('0xc'));var crypto=require(_0x343e('0xd'));var jsforce=require(_0x343e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x343e('0x8'));var querystring=require(_0x343e('0xf'));var Papa=require(_0x343e('0x10'));var Redis=require(_0x343e('0x11'));var authService=require(_0x343e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x343e('0x13'));var hardwareService=require(_0x343e('0x14'));var logger=require(_0x343e('0x15'))(_0x343e('0x16'));var utils=require(_0x343e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x343e('0x18'))['db'];function respondWithStatusCode(_0x123d12,_0x3fb5f0){_0x3fb5f0=_0x3fb5f0||0xcc;return function(_0x55be33){if(_0x55be33){return _0x123d12[_0x343e('0x19')](_0x3fb5f0);}return _0x123d12['status'](_0x3fb5f0)[_0x343e('0x1a')]();};}function respondWithResult(_0x1d191c,_0x379ba8){_0x379ba8=_0x379ba8||0xc8;return function(_0x231667){if(_0x231667){return _0x1d191c[_0x343e('0x1b')](_0x379ba8)['json'](_0x231667);}};}function respondWithFilteredResult(_0x278a5e,_0x1d2e27){return function(_0x14bb07){if(_0x14bb07){var _0xf37331=typeof _0x1d2e27[_0x343e('0x1c')]===_0x343e('0x1d')&&typeof _0x1d2e27[_0x343e('0x1e')]===_0x343e('0x1d');var _0xcb4e06=_0x14bb07['count'];var _0x4852fc=_0xf37331?0x0:_0x1d2e27['offset'];var _0x22f262=_0xf37331?_0x14bb07[_0x343e('0x1f')]:_0x1d2e27['offset']+_0x1d2e27['limit'];var _0x9aa0d1;if(_0x22f262>=_0xcb4e06){_0x22f262=_0xcb4e06;_0x9aa0d1=0xc8;}else{_0x9aa0d1=0xce;}_0x278a5e[_0x343e('0x1b')](_0x9aa0d1);return _0x278a5e[_0x343e('0x20')](_0x343e('0x21'),_0x4852fc+'-'+_0x22f262+'/'+_0xcb4e06)[_0x343e('0x22')](_0x14bb07);}return null;};}function patchUpdates(_0x4d0fe0){return function(_0x357058){try{jsonpatch[_0x343e('0x23')](_0x357058,_0x4d0fe0,!![]);}catch(_0x1c0fac){return BPromise['reject'](_0x1c0fac);}return _0x357058['save']();};}function saveUpdates(_0x49416d,_0x3e9ab8){return function(_0x4eb771){if(_0x4eb771){return _0x4eb771['update'](_0x49416d)[_0x343e('0x24')](function(_0x4ecdc7){return _0x4ecdc7;});}return null;};}function removeEntity(_0x15f21f,_0x3bcc72){return function(_0x3505c1){if(_0x3505c1){return _0x3505c1[_0x343e('0x25')]()[_0x343e('0x24')](function(){var _0x2f6118=_0x3505c1['get']({'plain':!![]});var _0x147c78=_0x343e('0x26');return db[_0x343e('0x27')]['destroy']({'where':{'type':_0x147c78,'resourceId':_0x2f6118['id']}})['then'](function(){return _0x3505c1;});})['then'](function(){_0x15f21f[_0x343e('0x1b')](0xcc)[_0x343e('0x1a')]();});}};}function handleEntityNotFound(_0x399d1e,_0x5bac39){return function(_0x45b828){if(!_0x45b828){_0x399d1e[_0x343e('0x19')](0x194);}return _0x45b828;};}function handleError(_0x1a8a10,_0x83d638){_0x83d638=_0x83d638||0x1f4;return function(_0x4f9198){logger[_0x343e('0x28')](_0x4f9198[_0x343e('0x29')]);if(_0x4f9198[_0x343e('0x2a')]){delete _0x4f9198[_0x343e('0x2a')];}_0x1a8a10[_0x343e('0x1b')](_0x83d638)[_0x343e('0x2b')](_0x4f9198);};}exports['index']=function(_0x6c2b2d,_0x24c9cc){var _0x1f062a={},_0x23c39c={},_0x2f4d40={'count':0x0,'rows':[]};var _0x5c10e7=_[_0x343e('0x2c')](db[_0x343e('0x2d')][_0x343e('0x2e')],function(_0x57b238){return{'name':_0x57b238[_0x343e('0x2f')],'type':_0x57b238[_0x343e('0x30')]['key']};});_0x23c39c['model']=_[_0x343e('0x2c')](_0x5c10e7,_0x343e('0x2a'));_0x23c39c[_0x343e('0x31')]=_[_0x343e('0x32')](_0x6c2b2d[_0x343e('0x31')]);_0x23c39c[_0x343e('0x33')]=_[_0x343e('0x34')](_0x23c39c[_0x343e('0x35')],_0x23c39c['query']);_0x1f062a[_0x343e('0x36')]=_[_0x343e('0x34')](_0x23c39c[_0x343e('0x35')],qs[_0x343e('0x37')](_0x6c2b2d[_0x343e('0x31')][_0x343e('0x37')]));_0x1f062a[_0x343e('0x36')]=_0x1f062a[_0x343e('0x36')]['length']?_0x1f062a[_0x343e('0x36')]:_0x23c39c[_0x343e('0x35')];if(!_0x6c2b2d[_0x343e('0x31')][_0x343e('0x38')](_0x343e('0x39'))){_0x1f062a['limit']=qs['limit'](_0x6c2b2d['query'][_0x343e('0x1e')]);_0x1f062a[_0x343e('0x1c')]=qs[_0x343e('0x1c')](_0x6c2b2d[_0x343e('0x31')][_0x343e('0x1c')]);}_0x1f062a[_0x343e('0x3a')]=qs[_0x343e('0x3b')](_0x6c2b2d[_0x343e('0x31')][_0x343e('0x3b')]);_0x1f062a['where']=qs[_0x343e('0x33')](_['pick'](_0x6c2b2d[_0x343e('0x31')],_0x23c39c[_0x343e('0x33')]),_0x5c10e7);if(_0x6c2b2d['query'][_0x343e('0x3c')]){_0x1f062a['where']=_[_0x343e('0x3d')](_0x1f062a['where'],{'$or':_[_0x343e('0x2c')](_0x5c10e7,function(_0x240d94){if(_0x240d94[_0x343e('0x30')]!==_0x343e('0x3e')){var _0x296460={};_0x296460[_0x240d94[_0x343e('0x2a')]]={'$like':'%'+_0x6c2b2d['query'][_0x343e('0x3c')]+'%'};return _0x296460;}})});}_0x1f062a=_['merge']({},_0x1f062a,_0x6c2b2d[_0x343e('0x3f')]);var _0x27bede={'where':_0x1f062a[_0x343e('0x40')]};return db[_0x343e('0x2d')][_0x343e('0x1f')](_0x27bede)['then'](function(_0x5e6a4c){_0x2f4d40[_0x343e('0x1f')]=_0x5e6a4c;if(_0x6c2b2d[_0x343e('0x31')]['includeAll']){_0x1f062a[_0x343e('0x41')]=[{'all':!![]}];}return db[_0x343e('0x2d')][_0x343e('0x42')](_0x1f062a);})[_0x343e('0x24')](function(_0x1daedf){_0x2f4d40[_0x343e('0x43')]=_0x1daedf;return _0x2f4d40;})[_0x343e('0x24')](respondWithFilteredResult(_0x24c9cc,_0x1f062a))[_0x343e('0x44')](handleError(_0x24c9cc,null));};exports[_0x343e('0x45')]=function(_0x2d218b,_0x266c15){var _0x7df482={'raw':![],'where':{'id':_0x2d218b['params']['id']}},_0x4e8112={};_0x4e8112[_0x343e('0x35')]=_[_0x343e('0x32')](db[_0x343e('0x2d')][_0x343e('0x2e')]);_0x4e8112[_0x343e('0x31')]=_[_0x343e('0x32')](_0x2d218b[_0x343e('0x31')]);_0x4e8112['filters']=_[_0x343e('0x34')](_0x4e8112['model'],_0x4e8112[_0x343e('0x31')]);_0x7df482['attributes']=_[_0x343e('0x34')](_0x4e8112[_0x343e('0x35')],qs[_0x343e('0x37')](_0x2d218b[_0x343e('0x31')][_0x343e('0x37')]));_0x7df482['attributes']=_0x7df482[_0x343e('0x36')]['length']?_0x7df482[_0x343e('0x36')]:_0x4e8112[_0x343e('0x35')];if(_0x2d218b[_0x343e('0x31')]['includeAll']){_0x7df482[_0x343e('0x41')]=[{'all':!![]}];}_0x7df482=_['merge']({},_0x7df482,_0x2d218b[_0x343e('0x3f')]);return db[_0x343e('0x2d')][_0x343e('0x46')](_0x7df482)['then'](handleEntityNotFound(_0x266c15,null))[_0x343e('0x24')](respondWithResult(_0x266c15,null))['catch'](handleError(_0x266c15,null));};exports['create']=function(_0x4ca88c,_0x5ee225){return db[_0x343e('0x2d')]['create'](_0x4ca88c[_0x343e('0x47')],{})[_0x343e('0x24')](function(_0xb5a71f){var _0x328264=_0x4ca88c[_0x343e('0x48')]['get']({'plain':!![]});if(!_0x328264)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x328264[_0x343e('0x49')]===_0x343e('0x48')){var _0x5e6af8=_0xb5a71f[_0x343e('0x4a')]({'plain':!![]});var _0x46eaec=_0x343e('0x26');return db[_0x343e('0x4b')][_0x343e('0x46')]({'where':{'name':_0x46eaec,'userProfileId':_0x328264[_0x343e('0x4c')]},'raw':!![]})[_0x343e('0x24')](function(_0xc20a8a){if(_0xc20a8a&&_0xc20a8a['autoAssociation']===0x0){return db[_0x343e('0x27')][_0x343e('0x4d')]({'name':_0x5e6af8[_0x343e('0x2a')],'resourceId':_0x5e6af8['id'],'type':_0xc20a8a['name'],'sectionId':_0xc20a8a['id']},{})[_0x343e('0x24')](function(){return _0xb5a71f;});}else{return _0xb5a71f;}})[_0x343e('0x44')](function(_0x2031c4){logger[_0x343e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2031c4);throw _0x2031c4;});}return _0xb5a71f;})['then'](respondWithResult(_0x5ee225,0xc9))[_0x343e('0x44')](handleError(_0x5ee225,null));};exports[_0x343e('0x4e')]=function(_0x400c86,_0x5dfd44){if(_0x400c86[_0x343e('0x47')]['id']){delete _0x400c86[_0x343e('0x47')]['id'];}return db['Trigger']['find']({'where':{'id':_0x400c86[_0x343e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5dfd44,null))[_0x343e('0x24')](saveUpdates(_0x400c86[_0x343e('0x47')],null))[_0x343e('0x24')](respondWithResult(_0x5dfd44,null))[_0x343e('0x44')](handleError(_0x5dfd44,null));};exports[_0x343e('0x25')]=function(_0x1a27a7,_0x525293){return db[_0x343e('0x2d')]['find']({'where':{'id':_0x1a27a7[_0x343e('0x4f')]['id']}})[_0x343e('0x24')](handleEntityNotFound(_0x525293,null))['then'](removeEntity(_0x525293,null))[_0x343e('0x44')](handleError(_0x525293,null));};exports[_0x343e('0x50')]=function(_0x4c7e01,_0xc60b00,_0x2d1cb4){if(_0x4c7e01['body']['id']){delete _0x4c7e01[_0x343e('0x47')]['id'];}return db[_0x343e('0x2d')][_0x343e('0x46')]({'where':{'id':_0x4c7e01[_0x343e('0x4f')]['id']}})[_0x343e('0x24')](handleEntityNotFound(_0xc60b00,null))['then'](function(_0x5a7008){if(_0x5a7008){_0x4c7e01[_0x343e('0x47')][_0x343e('0x51')]=_0x5a7008['id'];return db[_0x343e('0x52')][_0x343e('0x4d')](_0x4c7e01[_0x343e('0x47')]);}})[_0x343e('0x24')](respondWithResult(_0xc60b00,null))[_0x343e('0x44')](handleError(_0xc60b00,null));};exports[_0x343e('0x53')]=function(_0x389525,_0x3cfcc3,_0xf9ebae){if(_0x389525['body']['id']){delete _0x389525[_0x343e('0x47')]['id'];}return db[_0x343e('0x2d')][_0x343e('0x46')]({'where':{'id':_0x389525[_0x343e('0x4f')]['id']}})[_0x343e('0x24')](handleEntityNotFound(_0x3cfcc3,null))[_0x343e('0x24')](function(_0x7118a1){if(_0x7118a1){_0x389525[_0x343e('0x47')][_0x343e('0x54')]=_0x7118a1['id'];return db[_0x343e('0x52')]['create'](_0x389525[_0x343e('0x47')]);}})['then'](respondWithResult(_0x3cfcc3,null))[_0x343e('0x44')](handleError(_0x3cfcc3,null));};exports[_0x343e('0x55')]=function(_0x2ca901,_0x3752d7,_0x45b6ee){var _0x31a04b={};var _0x5cb3f1={};var _0x5c7dab;var _0x5c537e;return db[_0x343e('0x2d')][_0x343e('0x56')]({'where':{'id':_0x2ca901[_0x343e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3752d7,null))['then'](function(_0x29a0a2){if(_0x29a0a2){_0x5c7dab=_0x29a0a2;_0x5cb3f1[_0x343e('0x35')]=_[_0x343e('0x32')](db[_0x343e('0x52')]['rawAttributes']);_0x5cb3f1[_0x343e('0x31')]=_[_0x343e('0x32')](_0x2ca901[_0x343e('0x31')]);_0x5cb3f1[_0x343e('0x33')]=_[_0x343e('0x34')](_0x5cb3f1[_0x343e('0x35')],_0x5cb3f1['query']);_0x31a04b[_0x343e('0x36')]=_[_0x343e('0x34')](_0x5cb3f1[_0x343e('0x35')],qs[_0x343e('0x37')](_0x2ca901[_0x343e('0x31')][_0x343e('0x37')]));_0x31a04b[_0x343e('0x36')]=_0x31a04b[_0x343e('0x36')][_0x343e('0x57')]?_0x31a04b['attributes']:_0x5cb3f1[_0x343e('0x35')];_0x31a04b[_0x343e('0x3a')]=qs[_0x343e('0x3b')](_0x2ca901[_0x343e('0x31')][_0x343e('0x3b')]);_0x31a04b['where']=qs[_0x343e('0x33')](_[_0x343e('0x58')](_0x2ca901[_0x343e('0x31')],_0x5cb3f1['filters']));if(_0x2ca901['query'][_0x343e('0x3c')]){_0x31a04b[_0x343e('0x40')]=_[_0x343e('0x3d')](_0x31a04b['where'],{'$or':_[_0x343e('0x2c')](_0x31a04b[_0x343e('0x36')],function(_0x31a7ec){var _0x1d425a={};_0x1d425a[_0x31a7ec]={'$like':'%'+_0x2ca901['query'][_0x343e('0x3c')]+'%'};return _0x1d425a;})});}_0x31a04b=_[_0x343e('0x3d')]({},_0x31a04b,_0x2ca901[_0x343e('0x3f')]);return _0x5c7dab['getAllConditions'](_0x31a04b);}})[_0x343e('0x24')](function(_0x2d9c72){if(_0x2d9c72){_0x5c537e=_0x2d9c72[_0x343e('0x57')];if(!_0x2ca901['query'][_0x343e('0x38')]('nolimit')){_0x31a04b[_0x343e('0x1e')]=qs[_0x343e('0x1e')](_0x2ca901[_0x343e('0x31')]['limit']);_0x31a04b[_0x343e('0x1c')]=qs[_0x343e('0x1c')](_0x2ca901['query']['offset']);}return _0x5c7dab[_0x343e('0x55')](_0x31a04b);}})[_0x343e('0x24')](function(_0x36f08e){if(_0x36f08e){return _0x36f08e?{'count':_0x5c537e,'rows':_0x36f08e}:null;}})[_0x343e('0x24')](respondWithResult(_0x3752d7,null))['catch'](handleError(_0x3752d7,null));};exports[_0x343e('0x59')]=function(_0xc1728a,_0x45f6fb,_0xd48da6){var _0x2239b9={};var _0x1036cc={};var _0x2f7e1a;var _0xa498b8;return db['Trigger'][_0x343e('0x56')]({'where':{'id':_0xc1728a[_0x343e('0x4f')]['id']}})[_0x343e('0x24')](handleEntityNotFound(_0x45f6fb,null))[_0x343e('0x24')](function(_0x4ddbde){if(_0x4ddbde){_0x2f7e1a=_0x4ddbde;_0x1036cc[_0x343e('0x35')]=_[_0x343e('0x32')](db['Condition'][_0x343e('0x2e')]);_0x1036cc[_0x343e('0x31')]=_[_0x343e('0x32')](_0xc1728a[_0x343e('0x31')]);_0x1036cc[_0x343e('0x33')]=_[_0x343e('0x34')](_0x1036cc[_0x343e('0x35')],_0x1036cc[_0x343e('0x31')]);_0x2239b9['attributes']=_['intersection'](_0x1036cc[_0x343e('0x35')],qs[_0x343e('0x37')](_0xc1728a[_0x343e('0x31')][_0x343e('0x37')]));_0x2239b9['attributes']=_0x2239b9[_0x343e('0x36')][_0x343e('0x57')]?_0x2239b9[_0x343e('0x36')]:_0x1036cc[_0x343e('0x35')];_0x2239b9['order']=qs[_0x343e('0x3b')](_0xc1728a[_0x343e('0x31')][_0x343e('0x3b')]);_0x2239b9['where']=qs['filters'](_[_0x343e('0x58')](_0xc1728a[_0x343e('0x31')],_0x1036cc['filters']));if(_0xc1728a[_0x343e('0x31')]['filter']){_0x2239b9[_0x343e('0x40')]=_[_0x343e('0x3d')](_0x2239b9[_0x343e('0x40')],{'$or':_[_0x343e('0x2c')](_0x2239b9['attributes'],function(_0x322036){var _0x4ae2fd={};_0x4ae2fd[_0x322036]={'$like':'%'+_0xc1728a[_0x343e('0x31')][_0x343e('0x3c')]+'%'};return _0x4ae2fd;})});}_0x2239b9=_[_0x343e('0x3d')]({},_0x2239b9,_0xc1728a[_0x343e('0x3f')]);return _0x2f7e1a[_0x343e('0x59')](_0x2239b9);}})[_0x343e('0x24')](function(_0x215318){if(_0x215318){_0xa498b8=_0x215318[_0x343e('0x57')];if(!_0xc1728a[_0x343e('0x31')][_0x343e('0x38')](_0x343e('0x39'))){_0x2239b9[_0x343e('0x1e')]=qs[_0x343e('0x1e')](_0xc1728a[_0x343e('0x31')]['limit']);_0x2239b9[_0x343e('0x1c')]=qs[_0x343e('0x1c')](_0xc1728a[_0x343e('0x31')][_0x343e('0x1c')]);}return _0x2f7e1a[_0x343e('0x59')](_0x2239b9);}})[_0x343e('0x24')](function(_0x1d17a8){if(_0x1d17a8){return _0x1d17a8?{'count':_0xa498b8,'rows':_0x1d17a8}:null;}})[_0x343e('0x24')](respondWithResult(_0x45f6fb,null))['catch'](handleError(_0x45f6fb,null));};exports[_0x343e('0x5a')]=function(_0x4bce44,_0x176462,_0x3e7101){if(_0x4bce44['body']['id']){delete _0x4bce44[_0x343e('0x47')]['id'];}return db['Trigger'][_0x343e('0x46')]({'where':{'id':_0x4bce44[_0x343e('0x4f')]['id']}})[_0x343e('0x24')](handleEntityNotFound(_0x176462,null))[_0x343e('0x24')](function(_0x3dee65){if(_0x3dee65){_0x4bce44[_0x343e('0x47')]['TriggerId']=_0x3dee65['id'];return db[_0x343e('0x5b')][_0x343e('0x4d')](_0x4bce44[_0x343e('0x47')]);}})['then'](respondWithResult(_0x176462,null))[_0x343e('0x44')](handleError(_0x176462,null));};exports[_0x343e('0x5c')]=function(_0x3e58ad,_0x136316,_0x30d1dd){var _0x5920f8={};var _0x22f089={};var _0x937cb0;var _0x33c66e;return db[_0x343e('0x2d')]['findOne']({'where':{'id':_0x3e58ad[_0x343e('0x4f')]['id']}})[_0x343e('0x24')](handleEntityNotFound(_0x136316,null))[_0x343e('0x24')](function(_0x8a974){if(_0x8a974){_0x937cb0=_0x8a974;_0x22f089[_0x343e('0x35')]=_['keys'](db[_0x343e('0x5b')]['rawAttributes']);_0x22f089[_0x343e('0x31')]=_[_0x343e('0x32')](_0x3e58ad['query']);_0x22f089['filters']=_['intersection'](_0x22f089['model'],_0x22f089[_0x343e('0x31')]);_0x5920f8[_0x343e('0x36')]=_[_0x343e('0x34')](_0x22f089[_0x343e('0x35')],qs['fields'](_0x3e58ad['query'][_0x343e('0x37')]));_0x5920f8[_0x343e('0x36')]=_0x5920f8['attributes']['length']?_0x5920f8['attributes']:_0x22f089[_0x343e('0x35')];_0x5920f8['order']=qs[_0x343e('0x3b')](_0x3e58ad[_0x343e('0x31')][_0x343e('0x3b')]);_0x5920f8[_0x343e('0x40')]=qs[_0x343e('0x33')](_['pick'](_0x3e58ad[_0x343e('0x31')],_0x22f089[_0x343e('0x33')]));if(_0x3e58ad[_0x343e('0x31')]['filter']){_0x5920f8['where']=_[_0x343e('0x3d')](_0x5920f8['where'],{'$or':_[_0x343e('0x2c')](_0x5920f8[_0x343e('0x36')],function(_0x2778b7){var _0x3a7d48={};_0x3a7d48[_0x2778b7]={'$like':'%'+_0x3e58ad[_0x343e('0x31')]['filter']+'%'};return _0x3a7d48;})});}_0x5920f8=_[_0x343e('0x3d')]({},_0x5920f8,_0x3e58ad[_0x343e('0x3f')]);return _0x937cb0[_0x343e('0x5c')](_0x5920f8);}})[_0x343e('0x24')](function(_0x58ab50){if(_0x58ab50){_0x33c66e=_0x58ab50[_0x343e('0x57')];if(!_0x3e58ad['query'][_0x343e('0x38')](_0x343e('0x39'))){_0x5920f8[_0x343e('0x1e')]=qs['limit'](_0x3e58ad[_0x343e('0x31')][_0x343e('0x1e')]);_0x5920f8['offset']=qs['offset'](_0x3e58ad[_0x343e('0x31')]['offset']);}return _0x937cb0[_0x343e('0x5c')](_0x5920f8);}})[_0x343e('0x24')](function(_0x47a4c9){if(_0x47a4c9){return _0x47a4c9?{'count':_0x33c66e,'rows':_0x47a4c9}:null;}})[_0x343e('0x24')](respondWithResult(_0x136316,null))[_0x343e('0x44')](handleError(_0x136316,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index fd1d6df..fa63999 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 _0xf987=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api'];(function(_0xe0564e,_0x37cf17){var _0x36ffe3=function(_0x1e5677){while(--_0x1e5677){_0xe0564e['push'](_0xe0564e['shift']());}};_0x36ffe3(++_0x37cf17);}(_0xf987,0x18a));var _0x7f98=function(_0x3f33a3,_0x430b3c){_0x3f33a3=_0x3f33a3-0x0;var _0x59e530=_0xf987[_0x3f33a3];return _0x59e530;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1f0=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x4c3bf7,_0x557598){_0x4c3bf7=_0x4c3bf7-0x0;var _0x5680db=_0xe1f0[_0x4c3bf7];return _0x5680db;};'use strict';var _=require('lodash');var util=require(_0x0e1f('0x0'));var logger=require(_0x0e1f('0x1'))('api');var moment=require(_0x0e1f('0x2'));var BPromise=require(_0x0e1f('0x3'));var rp=require(_0x0e1f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var attributes=require(_0x0e1f('0x7'));module['exports']=function(_0x260585,_0x569a5a){return _0x260585[_0x0e1f('0x8')](_0x0e1f('0x9'),attributes,{'tableName':_0x0e1f('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 6e27934..bf0d6bd 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 _0xde03=['limit','include','map','model','then','debug','ShowTrigger','Trigger','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','findAll','raw','options','where','attributes'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xde03,0x1f3));var _0x3de0=function(_0x569b67,_0x14d427){_0x569b67=_0x569b67-0x0;var _0x33131f=_0xde03[_0x569b67];return _0x33131f;};'use strict';var _=require(_0x3de0('0x0'));var util=require(_0x3de0('0x1'));var moment=require(_0x3de0('0x2'));var BPromise=require(_0x3de0('0x3'));var rs=require(_0x3de0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3de0('0x5'));var logger=require(_0x3de0('0x6'))(_0x3de0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3de0('0x8')][_0x3de0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3151a8,_0x424009,_0x2c3fc8){return new BPromise(function(_0x1f2851,_0x585b41){return client[_0x3de0('0xa')](_0x3151a8,_0x2c3fc8)['then'](function(_0x5edbaa){logger[_0x3de0('0xb')](_0x3de0('0xc'),_0x424009,_0x3de0('0xd'));logger['debug'](_0x3de0('0xe'),_0x424009,_0x3de0('0xd'),JSON[_0x3de0('0xf')](_0x5edbaa));if(_0x5edbaa[_0x3de0('0x10')]){if(_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x11')]===0x1f4){logger[_0x3de0('0x10')]('Trigger,\x20%s,\x20%s',_0x424009,_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x12')]);return _0x585b41(_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x12')]);}logger[_0x3de0('0x10')](_0x3de0('0xc'),_0x424009,_0x5edbaa['error'][_0x3de0('0x12')]);return _0x1f2851(_0x5edbaa[_0x3de0('0x10')][_0x3de0('0x12')]);}else{logger[_0x3de0('0xb')](_0x3de0('0xc'),_0x424009,'request\x20sent');_0x1f2851(_0x5edbaa['result'][_0x3de0('0x12')]);}})[_0x3de0('0x13')](function(_0x4c6f13){logger[_0x3de0('0x10')](_0x3de0('0xc'),_0x424009,_0x4c6f13);_0x585b41(_0x4c6f13);});});}exports[_0x3de0('0x14')]=function(_0x489b0b){var _0x48e05a=this;return new Promise(function(_0x33fe7d,_0x76952c){return db['Trigger'][_0x3de0('0x15')]({'raw':_0x489b0b['options']?_0x489b0b['options'][_0x3de0('0x16')]===undefined?!![]:![]:!![],'where':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')][_0x3de0('0x18')]||null:null,'attributes':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')][_0x3de0('0x19')]||null:null,'limit':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')][_0x3de0('0x1a')]||null:null,'include':_0x489b0b[_0x3de0('0x17')]?_0x489b0b[_0x3de0('0x17')]['include']?_['map'](_0x489b0b[_0x3de0('0x17')][_0x3de0('0x1b')],function(_0x2a034c){return{'model':db[_0x2a034c['model']],'as':_0x2a034c['as'],'attributes':_0x2a034c[_0x3de0('0x19')],'include':_0x2a034c[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x2a034c[_0x3de0('0x1b')],function(_0x32ccb6){return{'model':db[_0x32ccb6[_0x3de0('0x1d')]],'as':_0x32ccb6['as'],'attributes':_0x32ccb6[_0x3de0('0x19')],'include':_0x32ccb6[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x32ccb6[_0x3de0('0x1b')],function(_0x16e614){return{'model':db[_0x16e614['model']],'as':_0x16e614['as'],'attributes':_0x16e614[_0x3de0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3de0('0x1e')](function(_0x29da7e){logger[_0x3de0('0xb')](_0x3de0('0x14'),_0x489b0b);logger[_0x3de0('0x1f')](_0x3de0('0x14'),_0x489b0b,JSON[_0x3de0('0xf')](_0x29da7e));_0x33fe7d(_0x29da7e);})[_0x3de0('0x13')](function(_0x1f1861){logger[_0x3de0('0x10')](_0x3de0('0x14'),_0x1f1861[_0x3de0('0x12')],_0x489b0b);_0x76952c(_0x48e05a['error'](0x1f4,_0x1f1861[_0x3de0('0x12')]));});});};exports[_0x3de0('0x20')]=function(_0x14866f){var _0x4d7371=this;return new Promise(function(_0x81152f,_0x43b7da){return db[_0x3de0('0x21')][_0x3de0('0x22')]({'raw':_0x14866f[_0x3de0('0x17')]?_0x14866f[_0x3de0('0x17')][_0x3de0('0x16')]===undefined?!![]:![]:!![],'where':_0x14866f['options']?_0x14866f['options'][_0x3de0('0x18')]||null:null,'attributes':_0x14866f[_0x3de0('0x17')]?_0x14866f[_0x3de0('0x17')][_0x3de0('0x19')]||null:null,'include':_0x14866f[_0x3de0('0x17')]?_0x14866f[_0x3de0('0x17')][_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x14866f[_0x3de0('0x17')][_0x3de0('0x1b')],function(_0x2723d9){return{'model':db[_0x2723d9[_0x3de0('0x1d')]],'as':_0x2723d9['as'],'attributes':_0x2723d9[_0x3de0('0x19')],'include':_0x2723d9[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x2723d9[_0x3de0('0x1b')],function(_0x1e70e6){return{'model':db[_0x1e70e6[_0x3de0('0x1d')]],'as':_0x1e70e6['as'],'attributes':_0x1e70e6[_0x3de0('0x19')],'include':_0x1e70e6[_0x3de0('0x1b')]?_[_0x3de0('0x1c')](_0x1e70e6[_0x3de0('0x1b')],function(_0x13493a){return{'model':db[_0x13493a[_0x3de0('0x1d')]],'as':_0x13493a['as'],'attributes':_0x13493a[_0x3de0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14d55c){logger[_0x3de0('0xb')](_0x3de0('0x20'),_0x14866f);logger[_0x3de0('0x1f')](_0x3de0('0x20'),_0x14866f,JSON[_0x3de0('0xf')](_0x14d55c));_0x81152f(_0x14d55c);})[_0x3de0('0x13')](function(_0x23f62d){logger[_0x3de0('0x10')](_0x3de0('0x20'),_0x23f62d['message'],_0x14866f);_0x43b7da(_0x4d7371[_0x3de0('0x10')](0x1f4,_0x23f62d['message']));});});}; \ No newline at end of file +var _0x8555=['limit','include','map','model','stringify','ShowTrigger','Trigger','find','where','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','options','raw','attributes'];(function(_0x11315f,_0x4eabdd){var _0xb4c69c=function(_0x2773ea){while(--_0x2773ea){_0x11315f['push'](_0x11315f['shift']());}};_0xb4c69c(++_0x4eabdd);}(_0x8555,0x8e));var _0x5855=function(_0x38a8ce,_0x5dff60){_0x38a8ce=_0x38a8ce-0x0;var _0x5b26f3=_0x8555[_0x38a8ce];return _0x5b26f3;};'use strict';var _=require(_0x5855('0x0'));var util=require('util');var moment=require(_0x5855('0x1'));var BPromise=require(_0x5855('0x2'));var rs=require(_0x5855('0x3'));var fs=require('fs');var Redis=require(_0x5855('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5855('0x5'));var logger=require('../../config/logger')(_0x5855('0x6'));var config=require(_0x5855('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5855('0x8')][_0x5855('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14cbd6,_0x24a06e,_0x346390){return new BPromise(function(_0x5569ed,_0x2044d6){return client['request'](_0x14cbd6,_0x346390)[_0x5855('0xa')](function(_0x7991b4){logger[_0x5855('0xb')]('Trigger,\x20%s,\x20%s',_0x24a06e,_0x5855('0xc'));logger[_0x5855('0xd')](_0x5855('0xe'),_0x24a06e,_0x5855('0xc'),JSON['stringify'](_0x7991b4));if(_0x7991b4[_0x5855('0xf')]){if(_0x7991b4[_0x5855('0xf')]['code']===0x1f4){logger[_0x5855('0xf')](_0x5855('0x10'),_0x24a06e,_0x7991b4[_0x5855('0xf')][_0x5855('0x11')]);return _0x2044d6(_0x7991b4['error']['message']);}logger['error'](_0x5855('0x10'),_0x24a06e,_0x7991b4[_0x5855('0xf')][_0x5855('0x11')]);return _0x5569ed(_0x7991b4[_0x5855('0xf')][_0x5855('0x11')]);}else{logger[_0x5855('0xb')](_0x5855('0x10'),_0x24a06e,_0x5855('0xc'));_0x5569ed(_0x7991b4[_0x5855('0x12')]['message']);}})['catch'](function(_0x1e1f08){logger['error']('Trigger,\x20%s,\x20%s',_0x24a06e,_0x1e1f08);_0x2044d6(_0x1e1f08);});});}exports[_0x5855('0x13')]=function(_0x3416c2){var _0x4e7f0e=this;return new Promise(function(_0x2cc9e8,_0x1bf4cc){return db['Trigger']['findAll']({'raw':_0x3416c2['options']?_0x3416c2[_0x5855('0x14')][_0x5855('0x15')]===undefined?!![]:![]:!![],'where':_0x3416c2[_0x5855('0x14')]?_0x3416c2[_0x5855('0x14')]['where']||null:null,'attributes':_0x3416c2[_0x5855('0x14')]?_0x3416c2[_0x5855('0x14')][_0x5855('0x16')]||null:null,'limit':_0x3416c2[_0x5855('0x14')]?_0x3416c2['options'][_0x5855('0x17')]||null:null,'include':_0x3416c2['options']?_0x3416c2[_0x5855('0x14')][_0x5855('0x18')]?_[_0x5855('0x19')](_0x3416c2[_0x5855('0x14')][_0x5855('0x18')],function(_0x330294){return{'model':db[_0x330294['model']],'as':_0x330294['as'],'attributes':_0x330294[_0x5855('0x16')],'include':_0x330294[_0x5855('0x18')]?_['map'](_0x330294[_0x5855('0x18')],function(_0x312e06){return{'model':db[_0x312e06[_0x5855('0x1a')]],'as':_0x312e06['as'],'attributes':_0x312e06[_0x5855('0x16')],'include':_0x312e06[_0x5855('0x18')]?_[_0x5855('0x19')](_0x312e06[_0x5855('0x18')],function(_0x1284dd){return{'model':db[_0x1284dd[_0x5855('0x1a')]],'as':_0x1284dd['as'],'attributes':_0x1284dd[_0x5855('0x16')]};}):[]};}):[]};}):[]:[]})[_0x5855('0xa')](function(_0x3522be){logger['info']('GetTrigger',_0x3416c2);logger[_0x5855('0xd')](_0x5855('0x13'),_0x3416c2,JSON[_0x5855('0x1b')](_0x3522be));_0x2cc9e8(_0x3522be);})['catch'](function(_0x3eaec3){logger[_0x5855('0xf')](_0x5855('0x13'),_0x3eaec3[_0x5855('0x11')],_0x3416c2);_0x1bf4cc(_0x4e7f0e['error'](0x1f4,_0x3eaec3[_0x5855('0x11')]));});});};exports[_0x5855('0x1c')]=function(_0x2675eb){var _0x10c896=this;return new Promise(function(_0x712414,_0x146d11){return db[_0x5855('0x1d')][_0x5855('0x1e')]({'raw':_0x2675eb[_0x5855('0x14')]?_0x2675eb['options'][_0x5855('0x15')]===undefined?!![]:![]:!![],'where':_0x2675eb[_0x5855('0x14')]?_0x2675eb['options'][_0x5855('0x1f')]||null:null,'attributes':_0x2675eb[_0x5855('0x14')]?_0x2675eb[_0x5855('0x14')][_0x5855('0x16')]||null:null,'include':_0x2675eb[_0x5855('0x14')]?_0x2675eb[_0x5855('0x14')][_0x5855('0x18')]?_[_0x5855('0x19')](_0x2675eb[_0x5855('0x14')][_0x5855('0x18')],function(_0x166920){return{'model':db[_0x166920['model']],'as':_0x166920['as'],'attributes':_0x166920[_0x5855('0x16')],'include':_0x166920[_0x5855('0x18')]?_['map'](_0x166920[_0x5855('0x18')],function(_0xc29467){return{'model':db[_0xc29467[_0x5855('0x1a')]],'as':_0xc29467['as'],'attributes':_0xc29467[_0x5855('0x16')],'include':_0xc29467['include']?_[_0x5855('0x19')](_0xc29467[_0x5855('0x18')],function(_0xa97048){return{'model':db[_0xa97048[_0x5855('0x1a')]],'as':_0xa97048['as'],'attributes':_0xa97048['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x218b20){logger['info'](_0x5855('0x1c'),_0x2675eb);logger[_0x5855('0xd')](_0x5855('0x1c'),_0x2675eb,JSON['stringify'](_0x218b20));_0x712414(_0x218b20);})[_0x5855('0x20')](function(_0x3df9cf){logger['error'](_0x5855('0x1c'),_0x3df9cf[_0x5855('0x11')],_0x2675eb);_0x146d11(_0x10c896[_0x5855('0xf')](0x1f4,_0x3df9cf[_0x5855('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d68e8dd..b0c108c 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 _0x20dd=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','/:id/clone','post','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0xef58d7,_0x3df485){var _0x11d7eb=function(_0x1705d9){while(--_0x1705d9){_0xef58d7['push'](_0xef58d7['shift']());}};_0x11d7eb(++_0x3df485);}(_0x20dd,0xd3));var _0xd20d=function(_0x147df6,_0x2ba7cf){_0x147df6=_0x147df6-0x0;var _0x17ec6a=_0x20dd[_0x147df6];return _0x17ec6a;};'use strict';var multer=require(_0xd20d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd20d('0x1'));var router=express[_0xd20d('0x2')]();var fs_extra=require(_0xd20d('0x3'));var auth=require(_0xd20d('0x4'));var interaction=require(_0xd20d('0x5'));var config=require(_0xd20d('0x6'));var controller=require(_0xd20d('0x7'));router[_0xd20d('0x8')]('/',auth[_0xd20d('0x9')](),controller[_0xd20d('0xa')]);router[_0xd20d('0x8')](_0xd20d('0xb'),auth[_0xd20d('0x9')](),controller['show']);router['post'](_0xd20d('0xc'),auth[_0xd20d('0x9')](),controller['clone']);router[_0xd20d('0xd')]('/',auth[_0xd20d('0x9')](),controller['create']);router[_0xd20d('0xe')]('/:id',auth[_0xd20d('0x9')](),controller['update']);router[_0xd20d('0xf')](_0xd20d('0xb'),auth[_0xd20d('0x9')](),controller[_0xd20d('0x10')]);module[_0xd20d('0x11')]=router; \ No newline at end of file +var _0x9538=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','post','/:id/clone','create','/:id','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x141f85,_0x165bcf){var _0x1056fa=function(_0x3ae81f){while(--_0x3ae81f){_0x141f85['push'](_0x141f85['shift']());}};_0x1056fa(++_0x165bcf);}(_0x9538,0x177));var _0x8953=function(_0x3fa8b2,_0x2d49a0){_0x3fa8b2=_0x3fa8b2-0x0;var _0x5863ba=_0x9538[_0x3fa8b2];return _0x5863ba;};'use strict';var multer=require(_0x8953('0x0'));var util=require(_0x8953('0x1'));var path=require(_0x8953('0x2'));var timeout=require(_0x8953('0x3'));var express=require(_0x8953('0x4'));var router=express['Router']();var fs_extra=require(_0x8953('0x5'));var auth=require(_0x8953('0x6'));var interaction=require(_0x8953('0x7'));var config=require(_0x8953('0x8'));var controller=require(_0x8953('0x9'));router[_0x8953('0xa')]('/',auth[_0x8953('0xb')](),controller[_0x8953('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8953('0xd')](_0x8953('0xe'),auth[_0x8953('0xb')](),controller['clone']);router[_0x8953('0xd')]('/',auth[_0x8953('0xb')](),controller[_0x8953('0xf')]);router['put'](_0x8953('0x10'),auth[_0x8953('0xb')](),controller['update']);router[_0x8953('0x11')]('/:id',auth[_0x8953('0xb')](),controller['destroy']);module[_0x8953('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 01a13cf..ccbbcd8 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 _0x889e=['join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','shortinfo','auto','nonat','outgoing','yes','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x14b459,_0x3d2605){var _0x456ad1=function(_0xc7ea01){while(--_0xc7ea01){_0x14b459['push'](_0x14b459['shift']());}};_0x456ad1(++_0x3d2605);}(_0x889e,0x19a));var _0xe889=function(_0x266176,_0x24c6e3){_0x266176=_0x266176-0x0;var _0x186e01=_0x889e[_0x266176];return _0x186e01;};'use strict';var Sequelize=require(_0xe889('0x0'));module[_0xe889('0x1')]={'name':{'type':Sequelize[_0xe889('0x2')],'allowNull':![],'unique':_0xe889('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe889('0x4'),_0xe889('0x5'),'peer'),'allowNull':![],'defaultValue':_0xe889('0x4')},'context':{'type':Sequelize[_0xe889('0x2')],'allowNull':![],'defaultValue':_0xe889('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0xe889('0x7'),'ALLOWED_PASSED_SCREEN',_0xe889('0x8'),'ALLOWED',_0xe889('0x9'),_0xe889('0xa'),_0xe889('0xb'),_0xe889('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe889('0x2')]},'secret':{'type':Sequelize[_0xe889('0x2')]},'md5secret':{'type':Sequelize[_0xe889('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe889('0x2')],'defaultValue':_0xe889('0xd'),'set':function(_0xb81cd3){this['setDataValue']('transport',_0xb81cd3?_0xb81cd3[_0xe889('0xe')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xe889('0xf')](_0xe889('0x10'))[_0xe889('0x11')](','):null;},'comment':_0xe889('0x12')},'dtmfmode':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x14'),'info',_0xe889('0x15'),'inband',_0xe889('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xe889('0x17'),'update',_0xe889('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe889('0x2')]},'directmediadeny':{'type':Sequelize[_0xe889('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xe889('0x1a'),'set':function(_0x3d9bc5){this[_0xe889('0x1b')](_0xe889('0x1c'),_0x3d9bc5?_0x3d9bc5[_0xe889('0xe')](','):null);},'get':function(){return this[_0xe889('0xf')]('nat')?this['getDataValue'](_0xe889('0x1c'))[_0xe889('0x11')](','):null;},'comment':_0xe889('0x1d')},'callgroup':{'type':Sequelize[_0xe889('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe889('0x2')]},'pickupgroup':{'type':Sequelize[_0xe889('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe889('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe889('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe889('0x2')],'defaultValue':_0xe889('0x1e')},'allow':{'type':Sequelize[_0xe889('0x2')],'allowNull':![],'defaultValue':_0xe889('0x1f'),'set':function(_0x103206){this[_0xe889('0x1b')](_0xe889('0x20'),_0x103206?_0x103206[_0xe889('0xe')](';'):_0xe889('0x1f'));},'get':function(){return this[_0xe889('0xf')](_0xe889('0x20'))?this[_0xe889('0xf')](_0xe889('0x20'))[_0xe889('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'insecure':{'type':Sequelize[_0xe889('0x2')],'defaultValue':_0xe889('0x21'),'set':function(_0xa4a20d){this['setDataValue'](_0xe889('0x22'),_0xa4a20d?_0xa4a20d[_0xe889('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xe889('0x22'))?this[_0xe889('0xf')](_0xe889('0x22'))[_0xe889('0x11')](','):null;},'comment':_0xe889('0x23')},'trustrpid':{'type':Sequelize[_0xe889('0x13')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe889('0x13')]('yes','no',_0xe889('0x24'))},'promiscredir':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xe889('0x25')](0xb)},'setvar':{'type':Sequelize[_0xe889('0x2')]},'callerid':{'type':Sequelize[_0xe889('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xe889('0x13')]('yes','no'),'defaultValue':_0xe889('0x19')},'busylevel':{'type':Sequelize[_0xe889('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xe889('0x2')]},'template':{'type':Sequelize[_0xe889('0x2')]},'videosupport':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no',_0xe889('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe889('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x27'),_0xe889('0x28'),_0xe889('0x29'))},'session_expires':{'type':Sequelize[_0xe889('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xe889('0x2a'),_0xe889('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xe889('0x2')]},'fromdomain':{'type':Sequelize[_0xe889('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe889('0x25')](0x5)},'qualify':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no'),'defaultValue':_0xe889('0x19')},'keepalive':{'type':Sequelize[_0xe889('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xe889('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xe889('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe889('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xe889('0x13')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xe889('0x2')]},'timert1':{'type':Sequelize[_0xe889('0x25')](0xb)},'timerb':{'type':Sequelize[_0xe889('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe889('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xe889('0x2')]},'contactdeny':{'type':Sequelize[_0xe889('0x2')]},'contactacl':{'type':Sequelize[_0xe889('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xe889('0x2')]},'use_q850_reason':{'type':Sequelize[_0xe889('0x2')]},'maxforwards':{'type':Sequelize[_0xe889('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'force_avp':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'icesupport':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xe889('0x2c'),_0xe889('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xe889('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xe889('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xe889('0x2')]},'dtlscipher':{'type':Sequelize[_0xe889('0x2')]},'dtlscafile':{'type':Sequelize[_0xe889('0x2')]},'dtlscapath':{'type':Sequelize[_0xe889('0x2')]},'dtlssetup':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x2e'),_0xe889('0x2f'),_0xe889('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe889('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xe889('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe889('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe889('0x13')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xe889('0x13')](_0xe889('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xe889('0x2')]},'mohsuggest':{'type':Sequelize[_0xe889('0x2')]},'parkinglot':{'type':Sequelize[_0xe889('0x2')]},'description':{'type':Sequelize[_0xe889('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xe889('0x31')},'canreinvite':{'type':Sequelize[_0xe889('0x13')]('yes','no',_0xe889('0x17'),_0xe889('0x32'),_0xe889('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe889('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xe889('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe889('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe60c=['join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','nonat','update','yes','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','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]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport'];(function(_0x12871e,_0x14c5f4){var _0x9a263=function(_0x551fbd){while(--_0x551fbd){_0x12871e['push'](_0x12871e['shift']());}};_0x9a263(++_0x14c5f4);}(_0xe60c,0xed));var _0xce60=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0xe60c[_0x118afa];return _0x167d76;};'use strict';var Sequelize=require(_0xce60('0x0'));module[_0xce60('0x1')]={'name':{'type':Sequelize[_0xce60('0x2')],'allowNull':![],'unique':_0xce60('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x5'),_0xce60('0x6'),_0xce60('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xce60('0x2')],'allowNull':![],'defaultValue':_0xce60('0x8')},'callingpres':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x9'),'ALLOWED_PASSED_SCREEN',_0xce60('0xa'),_0xce60('0xb'),'PROHIB_NOT_SCREENED',_0xce60('0xc'),_0xce60('0xd'),_0xce60('0xe'))},'deny':{'type':Sequelize[_0xce60('0x2')]},'permit':{'type':Sequelize[_0xce60('0x2')]},'secret':{'type':Sequelize[_0xce60('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xce60('0x2')]},'transport':{'type':Sequelize[_0xce60('0x2')],'defaultValue':_0xce60('0xf'),'set':function(_0x3cd234){this[_0xce60('0x10')](_0xce60('0x11'),_0x3cd234?_0x3cd234[_0xce60('0x12')](','):null);},'get':function(){return this[_0xce60('0x13')](_0xce60('0x11'))?this[_0xce60('0x13')](_0xce60('0x11'))[_0xce60('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x15'),_0xce60('0x16'),_0xce60('0x17'),_0xce60('0x18'),_0xce60('0x19')),'defaultValue':_0xce60('0x15')},'directmedia':{'type':Sequelize[_0xce60('0x4')]('yes','no',_0xce60('0x1a'),_0xce60('0x1b'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xce60('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xce60('0x2')],'defaultValue':_0xce60('0x1d'),'set':function(_0x22ff64){this[_0xce60('0x10')]('nat',_0x22ff64?_0x22ff64['join'](','):null);},'get':function(){return this[_0xce60('0x13')](_0xce60('0x1e'))?this[_0xce60('0x13')](_0xce60('0x1e'))[_0xce60('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xce60('0x2')]},'pickupgroup':{'type':Sequelize[_0xce60('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xce60('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xce60('0x2')],'defaultValue':_0xce60('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x37e1ac){this[_0xce60('0x10')](_0xce60('0x20'),_0x37e1ac?_0x37e1ac[_0xce60('0x12')](';'):_0xce60('0x21'));},'get':function(){return this[_0xce60('0x13')](_0xce60('0x20'))?this[_0xce60('0x13')](_0xce60('0x20'))[_0xce60('0x14')](';'):null;},'comment':_0xce60('0x22')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0xce60('0x2')],'defaultValue':'port,invite','set':function(_0x5d9884){this['setDataValue'](_0xce60('0x23'),_0x5d9884?_0x5d9884['join'](','):null);},'get':function(){return this[_0xce60('0x13')]('insecure')?this['getDataValue'](_0xce60('0x23'))['split'](','):null;},'comment':_0xce60('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xce60('0x4')]('yes','no',_0xce60('0x25'))},'promiscredir':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0xce60('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0xce60('0x26')](0xb)},'setvar':{'type':Sequelize[_0xce60('0x2')]},'callerid':{'type':Sequelize[_0xce60('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xce60('0x1c')},'busylevel':{'type':Sequelize[_0xce60('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0xce60('0x2')]},'template':{'type':Sequelize[_0xce60('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no',_0xce60('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xce60('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'mailbox':{'type':Sequelize[_0xce60('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0xce60('0x28'),_0xce60('0x29'),_0xce60('0x2a'))},'session_expires':{'type':Sequelize[_0xce60('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x2b'),_0xce60('0x2c')),'defaultValue':_0xce60('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xce60('0x2')]},'regexten':{'type':Sequelize[_0xce60('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xce60('0x2')]},'defaultuser':{'type':Sequelize[_0xce60('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xce60('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no',_0xce60('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xce60('0x26')](0xb)},'timerb':{'type':Sequelize[_0xce60('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xce60('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xce60('0x2')]},'contactdeny':{'type':Sequelize[_0xce60('0x2')]},'contactacl':{'type':Sequelize[_0xce60('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xce60('0x2')]},'use_q850_reason':{'type':Sequelize[_0xce60('0x2')]},'maxforwards':{'type':Sequelize[_0xce60('0x26')](0xb)},'encryption':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xce60('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'icesupport':{'type':Sequelize[_0xce60('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0xce60('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xce60('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xce60('0x2')]},'dtlscafile':{'type':Sequelize[_0xce60('0x2')]},'dtlscapath':{'type':Sequelize[_0xce60('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xce60('0x2e'),'passive',_0xce60('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xce60('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0xce60('0x4')](_0xce60('0x1c'),'no')},'vmexten':{'type':Sequelize[_0xce60('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xce60('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xce60('0x2')],'defaultValue':_0xce60('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0xce60('0x1c'),'no',_0xce60('0x1a'),_0xce60('0x1b'),_0xce60('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xce60('0x2')]},'otherFields':{'type':Sequelize[_0xce60('0x2')]},'active':{'type':Sequelize[_0xce60('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xce60('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 e4115cf..e8d04c4 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 _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x43e95a,_0x578530){var _0x17b22a=function(_0x4f92c5){while(--_0x4f92c5){_0x43e95a['push'](_0x43e95a['shift']());}};_0x17b22a(++_0x578530);}(_0x98a8,0x12c));var _0x898a=function(_0x46ac61,_0x3d6c94){_0x46ac61=_0x46ac61-0x0;var _0x48e2f4=_0x98a8[_0x46ac61];return _0x48e2f4;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file +var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x3e3587,_0x40d185){var _0x1bc608=function(_0x470499){while(--_0x470499){_0x3e3587['push'](_0x3e3587['shift']());}};_0x1bc608(++_0x40d185);}(_0x425d,0x1e0));var _0xd425=function(_0xdbbb14,_0x140263){_0xdbbb14=_0xdbbb14-0x0;var _0x3c3585=_0x425d[_0xdbbb14];return _0x3c3585;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 682758e..e8c1997 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 _0x4efd=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x55d124,_0x4eb63f){var _0x316748=function(_0x12a23f){while(--_0x12a23f){_0x55d124['push'](_0x55d124['shift']());}};_0x316748(++_0x4eb63f);}(_0x4efd,0xf1));var _0xd4ef=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x4efd[_0x65c903];return _0x23e1d7;};'use strict';var _=require(_0xd4ef('0x0'));var util=require(_0xd4ef('0x1'));var logger=require(_0xd4ef('0x2'))('api');var moment=require(_0xd4ef('0x3'));var BPromise=require(_0xd4ef('0x4'));var rp=require(_0xd4ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xd4ef('0x7'));module[_0xd4ef('0x8')]=function(_0x14c25b,_0x5aee8b){return _0x14c25b[_0xd4ef('0x9')](_0xd4ef('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac4c=['api','moment','bluebird','request-promise','path','rimraf','exports','define','Trunk','lodash','../../config/logger'];(function(_0x39d711,_0xe11eb7){var _0xee1d0c=function(_0x457e08){while(--_0x457e08){_0x39d711['push'](_0x39d711['shift']());}};_0xee1d0c(++_0xe11eb7);}(_0xac4c,0x1cc));var _0xcac4=function(_0x53245e,_0x189693){_0x53245e=_0x53245e-0x0;var _0x24e81b=_0xac4c[_0x53245e];return _0x24e81b;};'use strict';var _=require(_0xcac4('0x0'));var util=require('util');var logger=require(_0xcac4('0x1'))(_0xcac4('0x2'));var moment=require(_0xcac4('0x3'));var BPromise=require(_0xcac4('0x4'));var rp=require(_0xcac4('0x5'));var fs=require('fs');var path=require(_0xcac4('0x6'));var rimraf=require(_0xcac4('0x7'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xcac4('0x8')]=function(_0x3d5151,_0x34edd8){return _0x3d5151[_0xcac4('0x9')](_0xcac4('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 405d0d3..b7211b3 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 _0x0579=['where','attributes','limit','include','map','model','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetTrunk','Trunk','findAll','options','raw'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0x0579,0x111));var _0x9057=function(_0x306770,_0x41e405){_0x306770=_0x306770-0x0;var _0x5ccf4a=_0x0579[_0x306770];return _0x5ccf4a;};'use strict';var _=require(_0x9057('0x0'));var util=require(_0x9057('0x1'));var moment=require(_0x9057('0x2'));var BPromise=require(_0x9057('0x3'));var rs=require(_0x9057('0x4'));var fs=require('fs');var Redis=require(_0x9057('0x5'));var db=require(_0x9057('0x6'))['db'];var utils=require(_0x9057('0x7'));var logger=require(_0x9057('0x8'))(_0x9057('0x9'));var config=require(_0x9057('0xa'));var jayson=require(_0x9057('0xb'));var client=jayson[_0x9057('0xc')][_0x9057('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d1bfd,_0x2c63ef,_0x53df46){return new BPromise(function(_0x1e4ea6,_0x372532){return client[_0x9057('0xe')](_0x1d1bfd,_0x53df46)[_0x9057('0xf')](function(_0x4df855){logger['info'](_0x9057('0x10'),_0x2c63ef,_0x9057('0x11'));logger[_0x9057('0x12')](_0x9057('0x13'),_0x2c63ef,_0x9057('0x11'),JSON[_0x9057('0x14')](_0x4df855));if(_0x4df855[_0x9057('0x15')]){if(_0x4df855[_0x9057('0x15')][_0x9057('0x16')]===0x1f4){logger[_0x9057('0x15')](_0x9057('0x10'),_0x2c63ef,_0x4df855[_0x9057('0x15')]['message']);return _0x372532(_0x4df855['error'][_0x9057('0x17')]);}logger[_0x9057('0x15')](_0x9057('0x10'),_0x2c63ef,_0x4df855[_0x9057('0x15')][_0x9057('0x17')]);return _0x1e4ea6(_0x4df855[_0x9057('0x15')][_0x9057('0x17')]);}else{logger[_0x9057('0x18')](_0x9057('0x10'),_0x2c63ef,_0x9057('0x11'));_0x1e4ea6(_0x4df855['result'][_0x9057('0x17')]);}})[_0x9057('0x19')](function(_0x50eff9){logger[_0x9057('0x15')](_0x9057('0x10'),_0x2c63ef,_0x50eff9);_0x372532(_0x50eff9);});});}exports[_0x9057('0x1a')]=function(_0xf67862){var _0x49ba88=this;return new Promise(function(_0x2f82c4,_0x10d0e3){return db[_0x9057('0x1b')][_0x9057('0x1c')]({'raw':_0xf67862['options']?_0xf67862[_0x9057('0x1d')][_0x9057('0x1e')]===undefined?!![]:![]:!![],'where':_0xf67862[_0x9057('0x1d')]?_0xf67862['options'][_0x9057('0x1f')]||null:null,'attributes':_0xf67862['options']?_0xf67862[_0x9057('0x1d')][_0x9057('0x20')]||null:null,'limit':_0xf67862[_0x9057('0x1d')]?_0xf67862[_0x9057('0x1d')][_0x9057('0x21')]||null:null,'include':_0xf67862[_0x9057('0x1d')]?_0xf67862[_0x9057('0x1d')][_0x9057('0x22')]?_['map'](_0xf67862['options'][_0x9057('0x22')],function(_0x2bd7b9){return{'model':db[_0x2bd7b9['model']],'as':_0x2bd7b9['as'],'attributes':_0x2bd7b9[_0x9057('0x20')],'include':_0x2bd7b9[_0x9057('0x22')]?_[_0x9057('0x23')](_0x2bd7b9[_0x9057('0x22')],function(_0x2d8d59){return{'model':db[_0x2d8d59['model']],'as':_0x2d8d59['as'],'attributes':_0x2d8d59['attributes'],'include':_0x2d8d59[_0x9057('0x22')]?_['map'](_0x2d8d59[_0x9057('0x22')],function(_0x1128cf){return{'model':db[_0x1128cf[_0x9057('0x24')]],'as':_0x1128cf['as'],'attributes':_0x1128cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9057('0xf')](function(_0x397028){logger[_0x9057('0x18')](_0x9057('0x1a'),_0xf67862);logger['debug'](_0x9057('0x1a'),_0xf67862,JSON[_0x9057('0x14')](_0x397028));_0x2f82c4(_0x397028);})[_0x9057('0x19')](function(_0x22d112){logger[_0x9057('0x15')](_0x9057('0x1a'),_0x22d112[_0x9057('0x17')],_0xf67862);_0x10d0e3(_0x49ba88[_0x9057('0x15')](0x1f4,_0x22d112[_0x9057('0x17')]));});});};exports['ShowTrunk']=function(_0x161d72){var _0x3b6074=this;return new Promise(function(_0x144036,_0xe60ffd){return db[_0x9057('0x1b')]['find']({'raw':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')][_0x9057('0x1e')]===undefined?!![]:![]:!![],'where':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')][_0x9057('0x1f')]||null:null,'attributes':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')]['attributes']||null:null,'include':_0x161d72[_0x9057('0x1d')]?_0x161d72[_0x9057('0x1d')]['include']?_[_0x9057('0x23')](_0x161d72['options'][_0x9057('0x22')],function(_0x362f6f){return{'model':db[_0x362f6f[_0x9057('0x24')]],'as':_0x362f6f['as'],'attributes':_0x362f6f[_0x9057('0x20')],'include':_0x362f6f[_0x9057('0x22')]?_[_0x9057('0x23')](_0x362f6f[_0x9057('0x22')],function(_0x1ab66b){return{'model':db[_0x1ab66b[_0x9057('0x24')]],'as':_0x1ab66b['as'],'attributes':_0x1ab66b[_0x9057('0x20')],'include':_0x1ab66b[_0x9057('0x22')]?_['map'](_0x1ab66b[_0x9057('0x22')],function(_0x31f9e6){return{'model':db[_0x31f9e6[_0x9057('0x24')]],'as':_0x31f9e6['as'],'attributes':_0x31f9e6[_0x9057('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x231573){logger['info'](_0x9057('0x25'),_0x161d72);logger['debug'](_0x9057('0x25'),_0x161d72,JSON[_0x9057('0x14')](_0x231573));_0x144036(_0x231573);})[_0x9057('0x19')](function(_0x27e348){logger[_0x9057('0x15')](_0x9057('0x25'),_0x27e348[_0x9057('0x17')],_0x161d72);_0xe60ffd(_0x3b6074[_0x9057('0x15')](0x1f4,_0x27e348[_0x9057('0x17')]));});});}; \ No newline at end of file +var _0xc9c3=['catch','GetTrunk','findAll','options','raw','attributes','include','map','model','ShowTrunk','Trunk','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x28f283,_0x36c5bf){var _0xb8f541=function(_0x565739){while(--_0x565739){_0x28f283['push'](_0x28f283['shift']());}};_0xb8f541(++_0x36c5bf);}(_0xc9c3,0x1ba));var _0x3c9c=function(_0x5344ca,_0x424b2){_0x5344ca=_0x5344ca-0x0;var _0x573835=_0xc9c3[_0x5344ca];return _0x573835;};'use strict';var _=require(_0x3c9c('0x0'));var util=require(_0x3c9c('0x1'));var moment=require('moment');var BPromise=require(_0x3c9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var config=require('../../config/environment');var jayson=require(_0x3c9c('0x7'));var client=jayson[_0x3c9c('0x8')][_0x3c9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d0cc,_0x3dbca6,_0x59e237){return new BPromise(function(_0xfbf67a,_0x253066){return client['request'](_0x20d0cc,_0x59e237)[_0x3c9c('0xa')](function(_0x4d7dde){logger[_0x3c9c('0xb')](_0x3c9c('0xc'),_0x3dbca6,_0x3c9c('0xd'));logger[_0x3c9c('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3dbca6,_0x3c9c('0xd'),JSON[_0x3c9c('0xf')](_0x4d7dde));if(_0x4d7dde[_0x3c9c('0x10')]){if(_0x4d7dde['error'][_0x3c9c('0x11')]===0x1f4){logger[_0x3c9c('0x10')](_0x3c9c('0xc'),_0x3dbca6,_0x4d7dde[_0x3c9c('0x10')][_0x3c9c('0x12')]);return _0x253066(_0x4d7dde[_0x3c9c('0x10')][_0x3c9c('0x12')]);}logger[_0x3c9c('0x10')]('Trunk,\x20%s,\x20%s',_0x3dbca6,_0x4d7dde[_0x3c9c('0x10')][_0x3c9c('0x12')]);return _0xfbf67a(_0x4d7dde['error'][_0x3c9c('0x12')]);}else{logger[_0x3c9c('0xb')](_0x3c9c('0xc'),_0x3dbca6,_0x3c9c('0xd'));_0xfbf67a(_0x4d7dde[_0x3c9c('0x13')]['message']);}})[_0x3c9c('0x14')](function(_0x51d270){logger['error'](_0x3c9c('0xc'),_0x3dbca6,_0x51d270);_0x253066(_0x51d270);});});}exports[_0x3c9c('0x15')]=function(_0x5128e1){var _0x351551=this;return new Promise(function(_0x486d6d,_0x5fe62){return db['Trunk'][_0x3c9c('0x16')]({'raw':_0x5128e1[_0x3c9c('0x17')]?_0x5128e1[_0x3c9c('0x17')][_0x3c9c('0x18')]===undefined?!![]:![]:!![],'where':_0x5128e1[_0x3c9c('0x17')]?_0x5128e1['options']['where']||null:null,'attributes':_0x5128e1[_0x3c9c('0x17')]?_0x5128e1[_0x3c9c('0x17')][_0x3c9c('0x19')]||null:null,'limit':_0x5128e1['options']?_0x5128e1[_0x3c9c('0x17')]['limit']||null:null,'include':_0x5128e1[_0x3c9c('0x17')]?_0x5128e1[_0x3c9c('0x17')][_0x3c9c('0x1a')]?_[_0x3c9c('0x1b')](_0x5128e1[_0x3c9c('0x17')]['include'],function(_0xe62957){return{'model':db[_0xe62957[_0x3c9c('0x1c')]],'as':_0xe62957['as'],'attributes':_0xe62957[_0x3c9c('0x19')],'include':_0xe62957[_0x3c9c('0x1a')]?_['map'](_0xe62957[_0x3c9c('0x1a')],function(_0x5dd40e){return{'model':db[_0x5dd40e[_0x3c9c('0x1c')]],'as':_0x5dd40e['as'],'attributes':_0x5dd40e[_0x3c9c('0x19')],'include':_0x5dd40e[_0x3c9c('0x1a')]?_['map'](_0x5dd40e[_0x3c9c('0x1a')],function(_0x1ec5c2){return{'model':db[_0x1ec5c2[_0x3c9c('0x1c')]],'as':_0x1ec5c2['as'],'attributes':_0x1ec5c2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ef295){logger[_0x3c9c('0xb')](_0x3c9c('0x15'),_0x5128e1);logger['debug'](_0x3c9c('0x15'),_0x5128e1,JSON[_0x3c9c('0xf')](_0x5ef295));_0x486d6d(_0x5ef295);})[_0x3c9c('0x14')](function(_0x5a7b7d){logger[_0x3c9c('0x10')]('GetTrunk',_0x5a7b7d[_0x3c9c('0x12')],_0x5128e1);_0x5fe62(_0x351551['error'](0x1f4,_0x5a7b7d[_0x3c9c('0x12')]));});});};exports[_0x3c9c('0x1d')]=function(_0x49593f){var _0x1631aa=this;return new Promise(function(_0x1ec6e6,_0x28b548){return db[_0x3c9c('0x1e')][_0x3c9c('0x1f')]({'raw':_0x49593f[_0x3c9c('0x17')]?_0x49593f[_0x3c9c('0x17')][_0x3c9c('0x18')]===undefined?!![]:![]:!![],'where':_0x49593f[_0x3c9c('0x17')]?_0x49593f[_0x3c9c('0x17')][_0x3c9c('0x20')]||null:null,'attributes':_0x49593f[_0x3c9c('0x17')]?_0x49593f['options'][_0x3c9c('0x19')]||null:null,'include':_0x49593f['options']?_0x49593f[_0x3c9c('0x17')][_0x3c9c('0x1a')]?_[_0x3c9c('0x1b')](_0x49593f['options'][_0x3c9c('0x1a')],function(_0x51735f){return{'model':db[_0x51735f[_0x3c9c('0x1c')]],'as':_0x51735f['as'],'attributes':_0x51735f[_0x3c9c('0x19')],'include':_0x51735f[_0x3c9c('0x1a')]?_[_0x3c9c('0x1b')](_0x51735f['include'],function(_0x14d0c0){return{'model':db[_0x14d0c0['model']],'as':_0x14d0c0['as'],'attributes':_0x14d0c0['attributes'],'include':_0x14d0c0[_0x3c9c('0x1a')]?_['map'](_0x14d0c0[_0x3c9c('0x1a')],function(_0x38f833){return{'model':db[_0x38f833[_0x3c9c('0x1c')]],'as':_0x38f833['as'],'attributes':_0x38f833['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c9c('0xa')](function(_0x42688d){logger[_0x3c9c('0xb')](_0x3c9c('0x1d'),_0x49593f);logger[_0x3c9c('0xe')]('ShowTrunk',_0x49593f,JSON['stringify'](_0x42688d));_0x1ec6e6(_0x42688d);})[_0x3c9c('0x14')](function(_0x5a53aa){logger['error'](_0x3c9c('0x1d'),_0x5a53aa[_0x3c9c('0x12')],_0x49593f);_0x28b548(_0x1631aa[_0x3c9c('0x10')](0x1f4,_0x5a53aa[_0x3c9c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9b21f5e..4087ae6 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 _0x64d4=['removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','/presence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/lists','getLists','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','post','addContacts','create','addQueues','now','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','unpause','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addWhatsappAccounts','/:id/api_key','createApiKey','/:id','changePassword','removeQueues','delete','/:id/teams','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions'];(function(_0x32bd7b,_0x31964d){var _0x2a61d6=function(_0x1249bd){while(--_0x1249bd){_0x32bd7b['push'](_0x32bd7b['shift']());}};_0x2a61d6(++_0x31964d);}(_0x64d4,0xe3));var _0x464d=function(_0x5f1c67,_0x2124f4){_0x5f1c67=_0x5f1c67-0x0;var _0x1dc4c4=_0x64d4[_0x5f1c67];return _0x1dc4c4;};'use strict';var multer=require(_0x464d('0x0'));var util=require(_0x464d('0x1'));var path=require(_0x464d('0x2'));var timeout=require(_0x464d('0x3'));var express=require(_0x464d('0x4'));var router=express[_0x464d('0x5')]();var fs_extra=require(_0x464d('0x6'));var auth=require(_0x464d('0x7'));var interaction=require(_0x464d('0x8'));var config=require(_0x464d('0x9'));var controller=require(_0x464d('0xa'));router[_0x464d('0xb')]('/',auth[_0x464d('0xc')](),controller[_0x464d('0xd')]);router[_0x464d('0xb')]('/describe',auth[_0x464d('0xc')](),controller[_0x464d('0xe')]);router[_0x464d('0xb')](_0x464d('0xf'),auth[_0x464d('0xc')](),controller[_0x464d('0x10')]);router[_0x464d('0xb')](_0x464d('0x11'),auth[_0x464d('0xc')](),controller['getPresence']);router['get']('/:id',auth[_0x464d('0xc')](),controller[_0x464d('0x12')]);router[_0x464d('0xb')](_0x464d('0x13'),controller[_0x464d('0x14')]);router[_0x464d('0xb')](_0x464d('0x15'),auth[_0x464d('0xc')](),controller[_0x464d('0x16')]);router['get'](_0x464d('0x17'),auth[_0x464d('0xc')](),controller['getContacts']);router[_0x464d('0xb')](_0x464d('0x18'),auth['isAuthenticated'](),controller['getQueues']);router[_0x464d('0xb')](_0x464d('0x19'),auth[_0x464d('0xc')](),controller[_0x464d('0x1a')]);router[_0x464d('0xb')](_0x464d('0x1b'),auth['isAuthenticated'](),controller[_0x464d('0x1c')]);router['get'](_0x464d('0x1d'),auth[_0x464d('0xc')](),controller[_0x464d('0x1e')]);router[_0x464d('0xb')](_0x464d('0x1f'),auth[_0x464d('0xc')](),controller[_0x464d('0x20')]);router[_0x464d('0xb')]('/:id/chat/interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x21')]);router[_0x464d('0xb')](_0x464d('0x22'),auth[_0x464d('0xc')](),controller[_0x464d('0x23')]);router[_0x464d('0xb')](_0x464d('0x24'),auth['isAuthenticated'](),controller[_0x464d('0x25')]);router[_0x464d('0xb')]('/:id/sms/interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x26')]);router[_0x464d('0xb')](_0x464d('0x27'),auth[_0x464d('0xc')](),controller[_0x464d('0x28')]);router[_0x464d('0xb')](_0x464d('0x29'),auth[_0x464d('0xc')](),controller[_0x464d('0x2a')]);router['get']('/:id/teams',auth[_0x464d('0xc')](),controller['getTeams']);router[_0x464d('0xb')](_0x464d('0x2b'),auth[_0x464d('0xc')](),controller[_0x464d('0x2c')]);router['get']('/:id/agents',auth[_0x464d('0xc')](),controller['getAgents']);router[_0x464d('0xb')](_0x464d('0x2d'),auth[_0x464d('0xc')](),controller['getVoicePrefixes']);router[_0x464d('0xb')](_0x464d('0x2e'),auth[_0x464d('0xc')](),controller[_0x464d('0x2f')]);router[_0x464d('0xb')](_0x464d('0x30'),auth[_0x464d('0xc')](),controller[_0x464d('0x31')]);router[_0x464d('0xb')](_0x464d('0x32'),auth[_0x464d('0xc')](),controller[_0x464d('0x33')]);router[_0x464d('0xb')](_0x464d('0x34'),auth[_0x464d('0xc')](),controller[_0x464d('0x35')]);router[_0x464d('0xb')](_0x464d('0x36'),auth[_0x464d('0xc')](),controller[_0x464d('0x37')]);router[_0x464d('0xb')](_0x464d('0x38'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x464d('0xb')](_0x464d('0x39'),auth[_0x464d('0xc')](),controller[_0x464d('0x3a')]);router[_0x464d('0xb')](_0x464d('0x3b'),auth[_0x464d('0xc')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth['isAuthenticated'](),controller[_0x464d('0x3c')]);router[_0x464d('0x3d')]('/:id/contacts',auth[_0x464d('0xc')](),controller[_0x464d('0x3e')]);router[_0x464d('0x3d')]('/',auth[_0x464d('0xc')](),controller[_0x464d('0x3f')]);router[_0x464d('0x3d')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0x464d('0x3d')](_0x464d('0x18'),auth[_0x464d('0xc')](),controller[_0x464d('0x40')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bd281,_0x5317fe,_0x2e12b7){_0x2e12b7(null,path['join'](config['root'],'server/files/images/'));},'filename':function(_0x4a390d,_0x5ddb74,_0x275103){_0x275103(null,util['format']('%s-%s',Date[_0x464d('0x41')](),_0x5ddb74['originalname']));}})});router[_0x464d('0x3d')](_0x464d('0x13'),upload[_0x464d('0x42')](_0x464d('0x43')),controller[_0x464d('0x44')]);router['post'](_0x464d('0x45'),auth['isAuthenticated'](),controller[_0x464d('0x46')]);router[_0x464d('0x3d')]('/:id/logout',auth['isAuthenticated'](),controller[_0x464d('0x47')]);router[_0x464d('0x3d')](_0x464d('0x48'),auth[_0x464d('0xc')](),controller[_0x464d('0x49')]);router[_0x464d('0x3d')]('/:id/unpause',auth[_0x464d('0xc')](),controller[_0x464d('0x4a')]);router['post']('/:id/teams',auth[_0x464d('0xc')](),controller['addTeams']);router[_0x464d('0x3d')](_0x464d('0x4b'),auth[_0x464d('0xc')](),controller['addChatInteractions']);router[_0x464d('0x3d')]('/:id/mail_interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x4c')]);router['post'](_0x464d('0x4d'),auth[_0x464d('0xc')](),controller[_0x464d('0x4e')]);router[_0x464d('0x3d')](_0x464d('0x4f'),auth[_0x464d('0xc')](),controller[_0x464d('0x50')]);router[_0x464d('0x3d')](_0x464d('0x51'),auth[_0x464d('0xc')](),controller[_0x464d('0x52')]);router[_0x464d('0x3d')](_0x464d('0x53'),auth[_0x464d('0xc')](),controller[_0x464d('0x54')]);router[_0x464d('0x3d')]('/:id/fax_accounts',auth[_0x464d('0xc')](),controller['addFaxAccounts']);router[_0x464d('0x3d')]('/:id/mail_accounts',auth[_0x464d('0xc')](),controller['addMailAccounts']);router['post'](_0x464d('0x32'),auth[_0x464d('0xc')](),controller[_0x464d('0x55')]);router[_0x464d('0x3d')](_0x464d('0x34'),auth[_0x464d('0xc')](),controller['addSmsAccounts']);router[_0x464d('0x3d')](_0x464d('0x36'),auth[_0x464d('0xc')](),controller['addChatWebsites']);router[_0x464d('0x3d')]('/:id/whatsapp_accounts',auth[_0x464d('0xc')](),controller[_0x464d('0x56')]);router[_0x464d('0x3d')](_0x464d('0x39'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0x464d('0x3d')](_0x464d('0x57'),auth['isAuthenticated'](),controller[_0x464d('0x58')]);router['put'](_0x464d('0x59'),auth[_0x464d('0xc')](),controller['update']);router['put']('/:id/password',auth[_0x464d('0xc')](),controller[_0x464d('0x5a')]);router['delete']('/:id/queues',auth[_0x464d('0xc')](),controller[_0x464d('0x5b')]);router[_0x464d('0x5c')](_0x464d('0x5d'),auth[_0x464d('0xc')](),controller[_0x464d('0x5e')]);router[_0x464d('0x5c')](_0x464d('0x59'),auth['isAuthenticated'](),controller[_0x464d('0x5f')]);router[_0x464d('0x5c')](_0x464d('0x4b'),auth[_0x464d('0xc')](),controller[_0x464d('0x60')]);router[_0x464d('0x5c')]('/:id/mail_interactions',auth[_0x464d('0xc')](),controller[_0x464d('0x61')]);router['delete'](_0x464d('0x4d'),auth['isAuthenticated'](),controller[_0x464d('0x62')]);router[_0x464d('0x5c')](_0x464d('0x4f'),auth[_0x464d('0xc')](),controller[_0x464d('0x63')]);router[_0x464d('0x5c')](_0x464d('0x51'),auth[_0x464d('0xc')](),controller['removeOpenchannelInteractions']);router[_0x464d('0x5c')](_0x464d('0x53'),auth[_0x464d('0xc')](),controller[_0x464d('0x64')]);router['delete'](_0x464d('0x2e'),auth[_0x464d('0xc')](),controller[_0x464d('0x65')]);router[_0x464d('0x5c')](_0x464d('0x30'),auth[_0x464d('0xc')](),controller['removeMailAccounts']);router[_0x464d('0x5c')](_0x464d('0x32'),auth[_0x464d('0xc')](),controller[_0x464d('0x66')]);router['delete'](_0x464d('0x34'),auth[_0x464d('0xc')](),controller[_0x464d('0x67')]);router[_0x464d('0x5c')](_0x464d('0x36'),auth[_0x464d('0xc')](),controller[_0x464d('0x68')]);router[_0x464d('0x5c')](_0x464d('0x38'),auth[_0x464d('0xc')](),controller[_0x464d('0x69')]);router[_0x464d('0x5c')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x464d('0x6a')]);router[_0x464d('0x5c')](_0x464d('0x57'),auth[_0x464d('0xc')](),controller[_0x464d('0x6b')]);module[_0x464d('0x6c')]=router; \ No newline at end of file +var _0xf7a3=['/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','/:id/queues','addQueues','root','format','originalname','single','file','addAvatar','login','logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions'];(function(_0x2d2a33,_0x2d1d1f){var _0x32d8ba=function(_0x566914){while(--_0x566914){_0x2d2a33['push'](_0x2d2a33['shift']());}};_0x32d8ba(++_0x2d1d1f);}(_0xf7a3,0xc4));var _0x3f7a=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xf7a3[_0x4914e2];return _0x2dcd07;};'use strict';var multer=require(_0x3f7a('0x0'));var util=require(_0x3f7a('0x1'));var path=require(_0x3f7a('0x2'));var timeout=require('connect-timeout');var express=require(_0x3f7a('0x3'));var router=express[_0x3f7a('0x4')]();var fs_extra=require(_0x3f7a('0x5'));var auth=require(_0x3f7a('0x6'));var interaction=require(_0x3f7a('0x7'));var config=require(_0x3f7a('0x8'));var controller=require(_0x3f7a('0x9'));router[_0x3f7a('0xa')]('/',auth[_0x3f7a('0xb')](),controller['index']);router[_0x3f7a('0xa')](_0x3f7a('0xc'),auth[_0x3f7a('0xb')](),controller['describe']);router[_0x3f7a('0xa')](_0x3f7a('0xd'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0xe')]);router[_0x3f7a('0xa')]('/presence',auth['isAuthenticated'](),controller[_0x3f7a('0xf')]);router[_0x3f7a('0xa')](_0x3f7a('0x10'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x11')]);router[_0x3f7a('0xa')](_0x3f7a('0x12'),controller['getAvatar']);router[_0x3f7a('0xa')](_0x3f7a('0x13'),auth[_0x3f7a('0xb')](),controller['getOpenTabs']);router[_0x3f7a('0xa')](_0x3f7a('0x14'),auth['isAuthenticated'](),controller[_0x3f7a('0x15')]);router[_0x3f7a('0xa')]('/:id/queues',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x16')]);router['get'](_0x3f7a('0x17'),auth[_0x3f7a('0xb')](),controller['getVoiceQueuesRt']);router[_0x3f7a('0xa')](_0x3f7a('0x18'),auth['isAuthenticated'](),controller[_0x3f7a('0x19')]);router[_0x3f7a('0xa')](_0x3f7a('0x1a'),auth['isAuthenticated'](),controller[_0x3f7a('0x1b')]);router[_0x3f7a('0xa')](_0x3f7a('0x1c'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x1d')]);router['get'](_0x3f7a('0x1e'),auth[_0x3f7a('0xb')](),controller['getChatInteractions']);router[_0x3f7a('0xa')]('/:id/openchannel/interactions',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x1f')]);router[_0x3f7a('0xa')](_0x3f7a('0x20'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x21')]);router[_0x3f7a('0xa')](_0x3f7a('0x22'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x23')]);router[_0x3f7a('0xa')](_0x3f7a('0x24'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x25')]);router['get'](_0x3f7a('0x26'),auth[_0x3f7a('0xb')](),controller['getWhatsappInteractions']);router[_0x3f7a('0xa')](_0x3f7a('0x27'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x28')]);router[_0x3f7a('0xa')](_0x3f7a('0x29'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x2a')]);router['get'](_0x3f7a('0x2b'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x2c')]);router['get'](_0x3f7a('0x2d'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x2e')]);router[_0x3f7a('0xa')](_0x3f7a('0x2f'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x30')]);router['get'](_0x3f7a('0x31'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x32')]);router[_0x3f7a('0xa')](_0x3f7a('0x33'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x34')]);router[_0x3f7a('0xa')](_0x3f7a('0x35'),auth[_0x3f7a('0xb')](),controller['getSmsAccounts']);router[_0x3f7a('0xa')](_0x3f7a('0x36'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x37')]);router[_0x3f7a('0xa')](_0x3f7a('0x38'),auth['isAuthenticated'](),controller[_0x3f7a('0x39')]);router['get'](_0x3f7a('0x3a'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x3b')]);router[_0x3f7a('0xa')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x3f7a('0xa')](_0x3f7a('0x3c'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x3d')]);router[_0x3f7a('0x3e')]('/:id/contacts',auth[_0x3f7a('0xb')](),controller['addContacts']);router[_0x3f7a('0x3e')]('/',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x3f')]);router[_0x3f7a('0x3e')](_0x3f7a('0x40'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x41')]);router[_0x3f7a('0x3e')](_0x3f7a('0x42'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x43')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4435b9,_0x1c8109,_0x3d9090){_0x3d9090(null,path['join'](config[_0x3f7a('0x44')],'server/files/images/'));},'filename':function(_0x51f24b,_0x1ed965,_0x4a4790){_0x4a4790(null,util[_0x3f7a('0x45')]('%s-%s',Date['now'](),_0x1ed965[_0x3f7a('0x46')]));}})});router[_0x3f7a('0x3e')](_0x3f7a('0x12'),upload[_0x3f7a('0x47')](_0x3f7a('0x48')),controller[_0x3f7a('0x49')]);router[_0x3f7a('0x3e')]('/:id/login',auth['isAuthenticated'](),controller[_0x3f7a('0x4a')]);router['post']('/:id/logout',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x4b')]);router[_0x3f7a('0x3e')](_0x3f7a('0x4c'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x4d')]);router['post']('/:id/unpause',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x4e')]);router[_0x3f7a('0x3e')](_0x3f7a('0x27'),auth['isAuthenticated'](),controller[_0x3f7a('0x4f')]);router[_0x3f7a('0x3e')](_0x3f7a('0x50'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x51')]);router[_0x3f7a('0x3e')](_0x3f7a('0x52'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x53')]);router[_0x3f7a('0x3e')](_0x3f7a('0x54'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x55')]);router[_0x3f7a('0x3e')](_0x3f7a('0x56'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x57')]);router[_0x3f7a('0x3e')](_0x3f7a('0x58'),auth['isAuthenticated'](),controller[_0x3f7a('0x59')]);router[_0x3f7a('0x3e')]('/:id/whatsapp_interactions',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x5a')]);router[_0x3f7a('0x3e')](_0x3f7a('0x2f'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x3f7a('0x31'),auth['isAuthenticated'](),controller[_0x3f7a('0x5b')]);router[_0x3f7a('0x3e')](_0x3f7a('0x33'),auth[_0x3f7a('0xb')](),controller['addOpenchannelAccounts']);router[_0x3f7a('0x3e')](_0x3f7a('0x35'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x5c')]);router['post'](_0x3f7a('0x36'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x5d')]);router[_0x3f7a('0x3e')](_0x3f7a('0x38'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x5e')]);router[_0x3f7a('0x3e')](_0x3f7a('0x3a'),auth['isAuthenticated'](),controller[_0x3f7a('0x5f')]);router['post'](_0x3f7a('0x3c'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x3f7a('0x60')]('/:id',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x61')]);router[_0x3f7a('0x60')](_0x3f7a('0x62'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x63')]);router[_0x3f7a('0x64')](_0x3f7a('0x42'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x65')]);router['delete'](_0x3f7a('0x27'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x66')]);router[_0x3f7a('0x64')](_0x3f7a('0x10'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x67')]);router[_0x3f7a('0x64')](_0x3f7a('0x50'),auth['isAuthenticated'](),controller[_0x3f7a('0x68')]);router[_0x3f7a('0x64')]('/:id/mail_interactions',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x69')]);router[_0x3f7a('0x64')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x3f7a('0x6a')]);router[_0x3f7a('0x64')](_0x3f7a('0x56'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x6b')]);router[_0x3f7a('0x64')](_0x3f7a('0x58'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x6c')]);router[_0x3f7a('0x64')]('/:id/whatsapp_interactions',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x6d')]);router[_0x3f7a('0x64')]('/:id/fax_accounts',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x6e')]);router[_0x3f7a('0x64')](_0x3f7a('0x31'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x6f')]);router[_0x3f7a('0x64')](_0x3f7a('0x33'),auth[_0x3f7a('0xb')](),controller['removeOpenchannelAccounts']);router[_0x3f7a('0x64')]('/:id/sms_accounts',auth[_0x3f7a('0xb')](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x70')]);router[_0x3f7a('0x64')](_0x3f7a('0x38'),auth[_0x3f7a('0xb')](),controller[_0x3f7a('0x71')]);router[_0x3f7a('0x64')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x3f7a('0x72')]);router[_0x3f7a('0x64')](_0x3f7a('0x3c'),auth[_0x3f7a('0xb')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e724f84..6888482 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 _0x2ef3=['permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','agent','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','TEXT','showWebBar','udp','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','force_avp','/etc/pki/tls/private/motion.key'];(function(_0xc7ae8c,_0x44b3ef){var _0x1978e9=function(_0x925b92){while(--_0x925b92){_0xc7ae8c['push'](_0xc7ae8c['shift']());}};_0x1978e9(++_0x44b3ef);}(_0x2ef3,0xba));var _0x32ef=function(_0xa5bfa8,_0x56b1cb){_0xa5bfa8=_0xa5bfa8-0x0;var _0x1f044a=_0x2ef3[_0xa5bfa8];return _0x1f044a;};'use strict';var Sequelize=require(_0x32ef('0x0'));var moment=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var _=require(_0x32ef('0x3'));module[_0x32ef('0x4')]={'name':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x38f865){this[_0x32ef('0x6')]('name',_0x38f865);this[_0x32ef('0x6')](_0x32ef('0x7'),_0x38f865);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2c0089){this[_0x32ef('0x6')](_0x32ef('0x8'),_0x2c0089);this[_0x32ef('0x6')](_0x32ef('0x9'),util[_0x32ef('0xa')](_0x32ef('0xb'),_0x2c0089,this[_0x32ef('0xc')](_0x32ef('0xd'))));}},'alias':{'type':Sequelize[_0x32ef('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x401d0b){if(_0x401d0b){this[_0x32ef('0x6')](_0x32ef('0xe'),_0x401d0b[_0x32ef('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0x32ef('0x10'),'user',_0x32ef('0x11'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x32ef('0xd'),'set':function(_0x4d8009){this[_0x32ef('0x6')](_0x32ef('0xd'),_0x4d8009);this[_0x32ef('0x6')](_0x32ef('0x12'),_0x4d8009);this['setDataValue']('callerid',util['format'](_0x32ef('0xb'),this[_0x32ef('0xc')](_0x32ef('0x8')),_0x4d8009));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x32ef('0x5')]},'address':{'type':Sequelize[_0x32ef('0x5')]},'zipcode':{'type':Sequelize[_0x32ef('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x32ef('0x5')]},'country':{'type':Sequelize[_0x32ef('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x32ef('0x13')]},'voicePause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x32ef('0x15')},'lastPauseAt':{'type':Sequelize[_0x32ef('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x32ef('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':_0x32ef('0x17')},'ipaddr':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x32ef('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x32ef('0x18')]('friend',_0x32ef('0x19'),_0x32ef('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':_0x32ef('0x1b')},'callingpres':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x1c'),'ALLOWED_PASSED_SCREEN',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f'),_0x32ef('0x20'),_0x32ef('0x21'),_0x32ef('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0xcc2efb){this[_0x32ef('0x6')](_0x32ef('0x23'),_0xcc2efb?_0xcc2efb[_0x32ef('0x24')](','):null);},'get':function(){return this[_0x32ef('0xc')]('transport')?this['getDataValue'](_0x32ef('0x23'))['split'](','):null;},'comment':_0x32ef('0x25')},'dtmfmode':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x26'),_0x32ef('0x27'),_0x32ef('0x28'),_0x32ef('0x29'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no',_0x32ef('0x2b'),_0x32ef('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0xcbdec8){this[_0x32ef('0x6')](_0x32ef('0x2d'),_0xcbdec8?_0xcbdec8[_0x32ef('0x24')](','):null);},'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x2d'))?this[_0x32ef('0xc')](_0x32ef('0x2d'))[_0x32ef('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x32ef('0x5')]},'namedcallgroup':{'type':Sequelize[_0x32ef('0x5')]},'pickupgroup':{'type':Sequelize[_0x32ef('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x32ef('0x5')]},'disallow':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'defaultValue':_0x32ef('0x2f')},'allow':{'type':Sequelize[_0x32ef('0x5')],'allowNull':![],'defaultValue':_0x32ef('0x30'),'set':function(_0x256c40){this[_0x32ef('0x6')](_0x32ef('0x31'),_0x256c40?_0x256c40[_0x32ef('0x24')](';'):_0x32ef('0x30'));},'get':function(){return this[_0x32ef('0xc')]('allow')?this[_0x32ef('0xc')](_0x32ef('0x31'))[_0x32ef('0x2e')](';'):null;},'comment':_0x32ef('0x32')},'autoframing':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'set':function(_0x596d5a){this['setDataValue'](_0x32ef('0x33'),_0x596d5a?_0x596d5a[_0x32ef('0x24')](','):null);},'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x33'))?this['getDataValue'](_0x32ef('0x33'))[_0x32ef('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no',_0x32ef('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no',_0x32ef('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x36'),_0x32ef('0x37'),_0x32ef('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x39'),_0x32ef('0x3a')),'allowNull':!![],'defaultValue':_0x32ef('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x32ef('0x2a')},'keepalive':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x32ef('0x18')]('yes','no',_0x32ef('0x3b'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x32ef('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x3c'),_0x32ef('0x3d'),_0x32ef('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x32ef('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x32ef('0x18')](_0x32ef('0x2a'),'no',_0x32ef('0x2b'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x32ef('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x32ef('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x32ef('0x3f')]},'showWebBar':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0,'set':function(_0x49c245){this[_0x32ef('0x6')](_0x32ef('0x40'),_0x49c245);var _0x20dcc5=this['get']({'plain':!![]});switch(_0x49c245){case 0x0:case 0x1:var _0x5e6030=_0x20dcc5[_0x32ef('0x23')]?_['isArray'](_0x20dcc5[_0x32ef('0x23')])?_0x20dcc5['transport']['join']():_0x20dcc5[_0x32ef('0x23')]:_0x32ef('0x41');if(_0x5e6030===_0x32ef('0x42')){_0x5e6030='udp';}this[_0x32ef('0x6')](_0x32ef('0x23'),_0x5e6030);this[_0x32ef('0x6')]('encryption','no');this[_0x32ef('0x6')](_0x32ef('0x43'),null);this['setDataValue']('force_avp',null);this[_0x32ef('0x6')](_0x32ef('0x44'),null);this[_0x32ef('0x6')](_0x32ef('0x45'),null);this[_0x32ef('0x6')](_0x32ef('0x46'),null);this['setDataValue'](_0x32ef('0x47'),null);this[_0x32ef('0x6')](_0x32ef('0x48'),null);this[_0x32ef('0x6')](_0x32ef('0x49'),null);this[_0x32ef('0x6')](_0x32ef('0x4a'),'no');break;case 0x2:this[_0x32ef('0x6')](_0x32ef('0x23'),'wss');this[_0x32ef('0x6')](_0x32ef('0x4b'),_0x32ef('0x2a'));this[_0x32ef('0x6')](_0x32ef('0x43'),'yes');this['setDataValue'](_0x32ef('0x4c'),_0x32ef('0x2a'));this[_0x32ef('0x6')](_0x32ef('0x44'),_0x32ef('0x2a'));this['setDataValue'](_0x32ef('0x45'),'yes');this[_0x32ef('0x6')](_0x32ef('0x46'),'no');this['setDataValue']('dtlssetup',_0x32ef('0x3e'));this[_0x32ef('0x6')](_0x32ef('0x48'),_0x20dcc5['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x32ef('0x6')](_0x32ef('0x49'),_0x20dcc5[_0x32ef('0x49')]||_0x32ef('0x4d'));this['setDataValue'](_0x32ef('0x4a'),_0x32ef('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x32ef('0x3f')],'set':function(_0xd7a78){this[_0x32ef('0x6')](_0x32ef('0x4e'),_0xd7a78?_0xd7a78[_0x32ef('0x24')](','):[]);},'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x4e'))?_[_0x32ef('0x4f')](this[_0x32ef('0xc')](_0x32ef('0x4e'))['split'](','),function(_0x4ab179){return parseInt(_0x4ab179,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x32ef('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x32ef('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x32ef('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x32ef('0x18')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x32ef('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x32ef('0xc')](_0x32ef('0x50'))?this[_0x32ef('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x32ef('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![],'set':function(_0x339184){if(typeof _0x339184===_0x32ef('0x51')){var _0x51a34d=_0x339184==='1'?!![]:_0x339184==='0'?![]:_0x339184===_0x32ef('0x52')?!![]:_0x339184==='false'?![]:![];this['setDataValue'](_0x32ef('0x53'),_0x51a34d);}else{this['setDataValue'](_0x32ef('0x53'),_0x339184);}}},'blocked':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![],'set':function(_0x4d64ec){this[_0x32ef('0x6')](_0x32ef('0x54'),_0x4d64ec);if(_0x4d64ec===!![]){this[_0x32ef('0x6')](_0x32ef('0x55'),moment());this[_0x32ef('0x6')](_0x32ef('0x56'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x32ef('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x32ef('0x16')](0x5)[_0x32ef('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x32ef('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe14a=['PROHIB','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','nonat','update','yes','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','refuse','originate','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','isArray','udp','avpf','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','wss','encryption','force_avp','icesupport','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','email','ENUM','admin','user','agent','telephone','local','INTEGER','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN'];(function(_0x5c41a1,_0x32bfb1){var _0x4f0055=function(_0x445730){while(--_0x445730){_0x5c41a1['push'](_0x5c41a1['shift']());}};_0x4f0055(++_0x32bfb1);}(_0xe14a,0x94));var _0xae14=function(_0x58e3b2,_0x2483f4){_0x58e3b2=_0x58e3b2-0x0;var _0x135f7d=_0xe14a[_0x58e3b2];return _0x135f7d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xae14('0x0')],'allowNull':![],'unique':_0xae14('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5cdfa7){this[_0xae14('0x2')](_0xae14('0x1'),_0x5cdfa7);this[_0xae14('0x2')](_0xae14('0x3'),_0x5cdfa7);},'comment':_0xae14('0x4')},'fullname':{'type':Sequelize[_0xae14('0x0')],'allowNull':![],'set':function(_0xbdeb24){this[_0xae14('0x2')](_0xae14('0x5'),_0xbdeb24);this[_0xae14('0x2')](_0xae14('0x6'),util[_0xae14('0x7')](_0xae14('0x8'),_0xbdeb24,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0xae14('0x0')]},'email':{'type':Sequelize[_0xae14('0x0')],'allowNull':![],'unique':_0xae14('0x9'),'validate':{'isEmail':!![]},'set':function(_0x324dd0){if(_0x324dd0){this[_0xae14('0x2')]('email',_0x324dd0['toLowerCase']());}}},'role':{'type':Sequelize[_0xae14('0xa')](_0xae14('0xb'),_0xae14('0xc'),_0xae14('0xd'),_0xae14('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0xae14('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xae14('0x0')],'defaultValue':_0xae14('0xf')},'internal':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':![],'unique':_0xae14('0x11'),'set':function(_0x4a2446){this[_0xae14('0x2')](_0xae14('0x11'),_0x4a2446);this['setDataValue'](_0xae14('0x12'),_0x4a2446);this[_0xae14('0x2')](_0xae14('0x6'),util[_0xae14('0x7')](_0xae14('0x8'),this['getDataValue']('fullname'),_0x4a2446));}},'salt':{'type':Sequelize[_0xae14('0x0')]},'phone':{'type':Sequelize[_0xae14('0x0')]},'mobile':{'type':Sequelize[_0xae14('0x0')]},'address':{'type':Sequelize[_0xae14('0x0')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xae14('0x0')]},'city':{'type':Sequelize[_0xae14('0x0')]},'country':{'type':Sequelize[_0xae14('0x0')]},'online':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xae14('0x14')]},'voicePause':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xae14('0x0')],'defaultValue':_0xae14('0x15')},'lastPauseAt':{'type':Sequelize[_0xae14('0x14')]},'chatCapacity':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xae14('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'host':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![],'defaultValue':_0xae14('0x16')},'ipaddr':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'port':{'type':Sequelize[_0xae14('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x17'),_0xae14('0xc'),_0xae14('0x18')),'allowNull':!![],'defaultValue':_0xae14('0x17')},'context':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x19'),_0xae14('0x1a'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xae14('0x1b'),_0xae14('0x1c'),_0xae14('0x1d'),_0xae14('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'secret':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x1553e1){this[_0xae14('0x2')](_0xae14('0x1f'),_0x1553e1?_0x1553e1['join'](','):null);},'get':function(){return this[_0xae14('0x20')](_0xae14('0x1f'))?this[_0xae14('0x20')]('transport')[_0xae14('0x21')](','):null;},'comment':_0xae14('0x22')},'dtmfmode':{'type':Sequelize['ENUM'](_0xae14('0x23'),_0xae14('0x24'),_0xae14('0x25'),_0xae14('0x26'),'auto'),'allowNull':!![],'defaultValue':_0xae14('0x23')},'directmedia':{'type':Sequelize[_0xae14('0xa')]('yes','no',_0xae14('0x27'),_0xae14('0x28'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'nat':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![],'defaultValue':_0xae14('0x2a'),'set':function(_0x57bdf9){this[_0xae14('0x2')](_0xae14('0x2b'),_0x57bdf9?_0x57bdf9[_0xae14('0x2c')](','):null);},'get':function(){return this[_0xae14('0x20')](_0xae14('0x2b'))?this[_0xae14('0x20')](_0xae14('0x2b'))['split'](','):null;},'comment':_0xae14('0x2d')},'callgroup':{'type':Sequelize[_0xae14('0x0')]},'namedcallgroup':{'type':Sequelize[_0xae14('0x0')]},'pickupgroup':{'type':Sequelize[_0xae14('0x0')]},'namedpickupgroup':{'type':Sequelize[_0xae14('0x0')]},'language':{'type':Sequelize[_0xae14('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xae14('0x0')]},'disallow':{'type':Sequelize[_0xae14('0x0')],'allowNull':![],'defaultValue':_0xae14('0x2e')},'allow':{'type':Sequelize[_0xae14('0x0')],'allowNull':![],'defaultValue':_0xae14('0x2f'),'set':function(_0x484f24){this['setDataValue'](_0xae14('0x30'),_0x484f24?_0x484f24['join'](';'):_0xae14('0x2f'));},'get':function(){return this[_0xae14('0x20')](_0xae14('0x30'))?this[_0xae14('0x20')](_0xae14('0x30'))[_0xae14('0x21')](';'):null;},'comment':_0xae14('0x31')},'autoframing':{'type':Sequelize[_0xae14('0xa')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![],'set':function(_0x5be21c){this[_0xae14('0x2')]('insecure',_0x5be21c?_0x5be21c[_0xae14('0x2c')](','):null);},'get':function(){return this[_0xae14('0x20')](_0xae14('0x32'))?this['getDataValue'](_0xae14('0x32'))['split'](','):null;},'comment':_0xae14('0x33')},'trustrpid':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xae14('0xa')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xae14('0xa')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![],'defaultValue':_0xae14('0x34')},'amaflags':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xae14('0xa')]('yes','no'),'allowNull':!![],'defaultValue':_0xae14('0x29')},'busylevel':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'template':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xae14('0xa')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xae14('0xa')]('accept',_0xae14('0x35'),_0xae14('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xae14('0xa')]('uac','uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':_0xae14('0x29')},'keepalive':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no',_0xae14('0x37'),_0xae14('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x39'),_0xae14('0x3a'),_0xae14('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xae14('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xae14('0xa')](_0xae14('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xae14('0x29'),'no',_0xae14('0x27'),_0xae14('0x28'),_0xae14('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xae14('0x14')]},'passwordResetAt':{'type':Sequelize[_0xae14('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xae14('0x3d')]},'showWebBar':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0,'set':function(_0x24d8c0){this[_0xae14('0x2')](_0xae14('0x3e'),_0x24d8c0);var _0x2ba264=this['get']({'plain':!![]});switch(_0x24d8c0){case 0x0:case 0x1:var _0x11d9d9=_0x2ba264[_0xae14('0x1f')]?_[_0xae14('0x3f')](_0x2ba264[_0xae14('0x1f')])?_0x2ba264[_0xae14('0x1f')][_0xae14('0x2c')]():_0x2ba264['transport']:_0xae14('0x40');if(_0x11d9d9==='wss'){_0x11d9d9=_0xae14('0x40');}this[_0xae14('0x2')](_0xae14('0x1f'),_0x11d9d9);this['setDataValue']('encryption','no');this[_0xae14('0x2')](_0xae14('0x41'),null);this[_0xae14('0x2')]('force_avp',null);this[_0xae14('0x2')]('icesupport',null);this['setDataValue'](_0xae14('0x42'),null);this[_0xae14('0x2')](_0xae14('0x43'),null);this[_0xae14('0x2')]('dtlssetup',null);this[_0xae14('0x2')]('dtlscertfile',null);this[_0xae14('0x2')](_0xae14('0x44'),null);this['setDataValue'](_0xae14('0x45'),'no');break;case 0x2:this[_0xae14('0x2')]('transport',_0xae14('0x46'));this[_0xae14('0x2')](_0xae14('0x47'),_0xae14('0x29'));this[_0xae14('0x2')](_0xae14('0x41'),_0xae14('0x29'));this[_0xae14('0x2')](_0xae14('0x48'),_0xae14('0x29'));this['setDataValue'](_0xae14('0x49'),_0xae14('0x29'));this['setDataValue']('dtlsenable',_0xae14('0x29'));this[_0xae14('0x2')]('dtlsverify','no');this['setDataValue'](_0xae14('0x4a'),_0xae14('0x3b'));this[_0xae14('0x2')](_0xae14('0x4b'),_0x2ba264[_0xae14('0x4b')]||_0xae14('0x4c'));this[_0xae14('0x2')](_0xae14('0x44'),_0x2ba264['dtlsprivatekey']||_0xae14('0x4d'));this['setDataValue'](_0xae14('0x45'),_0xae14('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xae14('0x3d')],'set':function(_0x801e9f){this[_0xae14('0x2')](_0xae14('0x4e'),_0x801e9f?_0x801e9f[_0xae14('0x2c')](','):[]);},'get':function(){return this[_0xae14('0x20')]('permissions')?_[_0xae14('0x4f')](this[_0xae14('0x20')]('permissions')[_0xae14('0x21')](','),function(_0x2e4ae4){return parseInt(_0x2e4ae4,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xae14('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xae14('0xa')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xae14('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xae14('0x0')]},'phoneBarEnableJaws':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xae14('0x50')],'get':function(){return this[_0xae14('0x20')](_0xae14('0x51'))?this[_0xae14('0x20')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0xae14('0x0')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xae14('0x0')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x18f715){if(typeof _0x18f715===_0xae14('0x52')){var _0xc0add4=_0x18f715==='1'?!![]:_0x18f715==='0'?![]:_0x18f715===_0xae14('0x53')?!![]:_0x18f715===_0xae14('0x54')?![]:![];this[_0xae14('0x2')]('screenrecording',_0xc0add4);}else{this[_0xae14('0x2')](_0xae14('0x55'),_0x18f715);}}},'blocked':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![],'set':function(_0x43ad21){this[_0xae14('0x2')](_0xae14('0x56'),_0x43ad21);if(_0x43ad21===!![]){this[_0xae14('0x2')]('blockedAt',moment());this[_0xae14('0x2')](_0xae14('0x57'),0x0);}else{this[_0xae14('0x2')](_0xae14('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0xae14('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xae14('0x10')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xae14('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xae14('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xae14('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 2fb9e0d..c908d6b 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 _0x187d=['unpause','manual','set','%s%s','getTeams','Team','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getVoiceQueues','getLists','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','getChatWebsites','addChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','lastName','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','getAgents','lower','col','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','voiceStatus','busy','slice','toUpperCase','SELECT','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','OpenTabs','moment','util','path','lodash','squel','jayson/promise','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','undefined','offset','count','Content-Range','json','update','destroy','get','Users','user','Agents','agent','Telephones','telephone','ignore','map','value','includes','find','UserProfileResource','sendStatus','stack','name','index','User','type','key','filter','salt','query','includeAll','include','attributes','push','rows','openTabs','true','length','chat','dataValues','openchannel','whatsapp','all','show','params','model','differenceBy','rawAttributes','intersection','fields','merge','sms','fax','mail','body','role','describe','addContacts','ids','omit','internal','Setting','securePassword','validatePasswordPattern','password','isNil','min_internal','sequelize','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','104','105','106','107','109','100','114','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','findAll','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','authenticate','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','emit','Queue:save','voice','online','interface','format','SIP/%s','penalty','UserVoiceQueueRt','removeQueues','channel','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','root','download','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','keys','CmContact','filters','order','sort','where','pick','hasOwnProperty','CmList','List','Tag','tag','nolimit','limit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','options','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','upsert','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','concat','resolve','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','whatsapppause','pauseType'];(function(_0x12c2d0,_0x3fb60e){var _0x3b35d3=function(_0x5af761){while(--_0x5af761){_0x12c2d0['push'](_0x12c2d0['shift']());}};_0x3b35d3(++_0x3fb60e);}(_0x187d,0x93));var _0xd187=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x187d[_0x4baae2];return _0x1a2285;};'use strict';var moment=require(_0xd187('0x0'));var BPromise=require('bluebird');var util=require(_0xd187('0x1'));var path=require(_0xd187('0x2'));var fs=require('fs');var _=require(_0xd187('0x3'));var squel=require(_0xd187('0x4'));var jayson=require(_0xd187('0x5'));var Redis=require(_0xd187('0x6'));var authService=require('../../components/auth/service');var qs=require(_0xd187('0x7'));var logger=require(_0xd187('0x8'))('api');var utils=require(_0xd187('0x9'));var config=require(_0xd187('0xa'));var licenseUtil=require(_0xd187('0xb'));var db=require(_0xd187('0xc'))['db'];var socket=require(_0xd187('0xd'))(new Redis(config[_0xd187('0xe')]));require(_0xd187('0xf'))[_0xd187('0x10')](socket);config['redis']=_[_0xd187('0x11')](config[_0xd187('0xe')],{'host':_0xd187('0x12'),'port':0x18eb});var client=jayson[_0xd187('0x13')][_0xd187('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2a61a4,_0x59c194,_0x10d467,_0x412ccf){return new BPromise(function(_0x18237b,_0x5e6180){var _0x37e80c=_0x412ccf||client;return _0x37e80c[_0xd187('0x15')](_0x2a61a4,_0x10d467)[_0xd187('0x16')](function(_0x59ee4a){logger[_0xd187('0x17')](_0xd187('0x18'),_0x59c194,_0xd187('0x19'));logger[_0xd187('0x1a')]('User,\x20%s,\x20%s,\x20%s',_0x59c194,_0xd187('0x19'),JSON[_0xd187('0x1b')](_0x59ee4a));if(_0x59ee4a[_0xd187('0x1c')]){if(_0x59ee4a[_0xd187('0x1c')]['code']===0x1f4){logger[_0xd187('0x1c')]('User,\x20%s,\x20%s',_0x59c194,_0x59ee4a['error'][_0xd187('0x1d')]);return _0x5e6180(_0x59ee4a['error']['message']);}logger[_0xd187('0x1c')](_0xd187('0x18'),_0x59c194,_0x59ee4a[_0xd187('0x1c')][_0xd187('0x1d')]);return _0x18237b(_0x59ee4a[_0xd187('0x1c')][_0xd187('0x1d')]);}else{logger[_0xd187('0x17')](_0xd187('0x18'),_0x59c194,_0xd187('0x19'));_0x18237b(_0x59ee4a[_0xd187('0x1e')][_0xd187('0x1d')]);}})[_0xd187('0x1f')](function(_0x207978){logger['error'](_0xd187('0x18'),_0x59c194,_0x207978);_0x5e6180(_0x207978);});});}function respondWithStatusCode(_0x81b988,_0xc5bba5){_0xc5bba5=_0xc5bba5||0xcc;return function(_0x5bcf5b){if(_0x5bcf5b){return _0x81b988['sendStatus'](_0xc5bba5);}return _0x81b988['status'](_0xc5bba5)[_0xd187('0x20')]();};}function respondWithResult(_0x33741d,_0x249a82){_0x249a82=_0x249a82||0xc8;return function(_0x4f62c8){if(_0x4f62c8){return _0x33741d[_0xd187('0x21')](_0x249a82)['json'](_0x4f62c8);}};}function respondWithFilteredResult(_0x145771,_0x5a7a23){return function(_0x1047f4){if(_0x1047f4){var _0x54f340=typeof _0x5a7a23['offset']===_0xd187('0x22')&&typeof _0x5a7a23['limit']===_0xd187('0x22');var _0x598aa4=_0x1047f4['count'];var _0x4eac6a=_0x54f340?0x0:_0x5a7a23[_0xd187('0x23')];var _0xeff822=_0x54f340?_0x1047f4[_0xd187('0x24')]:_0x5a7a23[_0xd187('0x23')]+_0x5a7a23['limit'];var _0x2a20ed;if(_0xeff822>=_0x598aa4){_0xeff822=_0x598aa4;_0x2a20ed=0xc8;}else{_0x2a20ed=0xce;}_0x145771[_0xd187('0x21')](_0x2a20ed);return _0x145771['set'](_0xd187('0x25'),_0x4eac6a+'-'+_0xeff822+'/'+_0x598aa4)[_0xd187('0x26')](_0x1047f4);}return null;};}function saveUpdates(_0x34febe){return function(_0x4c50a5){if(_0x4c50a5){return _0x4c50a5[_0xd187('0x27')](_0x34febe)['then'](function(_0x263e31){return _0x263e31;});}return null;};}function removeEntity(_0x19e75f){return function(_0x1e7750){if(_0x1e7750){return _0x1e7750[_0xd187('0x28')]()['then'](function(){var _0x140e54=_0x1e7750[_0xd187('0x29')]({'plain':!![]});if(_0x140e54['role']==='admin')return;var _0x1a1922=[{'name':_0xd187('0x2a'),'value':_0xd187('0x2b'),'ignore':!![]},{'name':_0xd187('0x2c'),'value':_0xd187('0x2d'),'ignore':![]},{'name':_0xd187('0x2e'),'value':_0xd187('0x2f'),'ignore':![]}];var _0x4713df=_(_0x1a1922)['filter'](_0xd187('0x30'))[_0xd187('0x31')](_0xd187('0x32'))['value']();if(_[_0xd187('0x33')](_0x4713df,_0x140e54['role'])){return;}var _0xb3efa3=_[_0xd187('0x34')](_0x1a1922,[_0xd187('0x32'),_0x140e54['role']])['name'];return db[_0xd187('0x35')][_0xd187('0x28')]({'where':{'type':_0xb3efa3,'resourceId':_0x140e54['id']}})['then'](function(){return _0x1e7750;});})[_0xd187('0x16')](function(){_0x19e75f[_0xd187('0x21')](0xcc)[_0xd187('0x20')]();});}};}function handleEntityNotFound(_0x54abed){return function(_0x527c6f){if(!_0x527c6f){_0x54abed[_0xd187('0x36')](0x194);}return _0x527c6f;};}function handleError(_0xf32da2,_0x556146){_0x556146=_0x556146||0x1f4;return function(_0x51f5bf){logger['error'](_0x51f5bf[_0xd187('0x37')]);if(_0x51f5bf['name']){delete _0x51f5bf[_0xd187('0x38')];}_0xf32da2[_0xd187('0x21')](_0x556146)['send'](_0x51f5bf);};}exports[_0xd187('0x39')]=function(_0x5674ca,_0x293ce9){var _0x2db36e={},_0x4af59f={'count':0x0,'rows':[]};var _0x1a6256=_(db[_0xd187('0x3a')]['rawAttributes'])[_0xd187('0x31')](function(_0x5ec6cd){return{'name':_0x5ec6cd['fieldName'],'type':_0x5ec6cd[_0xd187('0x3b')][_0xd187('0x3c')]};})[_0xd187('0x3d')](function(_0x1a8f54){return!_[_0xd187('0x33')](['password',_0xd187('0x3e')],_0x1a8f54[_0xd187('0x38')]);})[_0xd187('0x32')]();_0x2db36e=qs['getOptions'](_0x1a6256,_0x5674ca);var _0x4b121c={'where':_0x2db36e['where']};return db['User'][_0xd187('0x24')](_0x4b121c)[_0xd187('0x16')](function(_0x3d74cc){_0x4af59f[_0xd187('0x24')]=_0x3d74cc;if(_0x5674ca[_0xd187('0x3f')][_0xd187('0x40')]){_0x2db36e[_0xd187('0x41')]=[{'all':!![]}];}if(!_[_0xd187('0x33')](_0x2db36e['attributes'],'id')){_0x2db36e[_0xd187('0x42')][_0xd187('0x43')]('id');}return db[_0xd187('0x3a')]['findAll'](_0x2db36e);})[_0xd187('0x16')](function(_0x48c100){_0x4af59f[_0xd187('0x44')]=_0x48c100;if(_0x5674ca[_0xd187('0x3f')][_0xd187('0x45')]===_0xd187('0x46')){var _0x3cea48=[];for(var _0x49c26e=0x0;_0x49c26e<_0x4af59f[_0xd187('0x44')][_0xd187('0x47')];_0x49c26e++){_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x48'),_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs('sms',_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48['push'](get_open_tabs('fax',_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48['push'](get_open_tabs('mail',_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x4a'),_0x4af59f[_0xd187('0x44')][_0x49c26e][_0xd187('0x49')]));_0x3cea48[_0xd187('0x43')](get_open_tabs(_0xd187('0x4b'),_0x4af59f['rows'][_0x49c26e][_0xd187('0x49')]));}return BPromise[_0xd187('0x4c')](_0x3cea48)[_0xd187('0x16')](function(_0x3ce4a1){return _0x4af59f;});}else{return _0x4af59f;}})[_0xd187('0x16')](respondWithFilteredResult(_0x293ce9,_0x2db36e))[_0xd187('0x1f')](handleError(_0x293ce9,null));};exports[_0xd187('0x4d')]=function(_0x3400a0,_0x4e4a32){var _0x368348={'raw':![],'where':{'id':_0x3400a0[_0xd187('0x4e')]['id']}},_0x2657be={};_0x2657be[_0xd187('0x4f')]=_[_0xd187('0x50')](_['keys'](db[_0xd187('0x3a')][_0xd187('0x51')]),['password',_0xd187('0x3e')]);_0x2657be[_0xd187('0x3f')]=_['keys'](_0x3400a0['query']);_0x2657be['filters']=_['intersection'](_0x2657be[_0xd187('0x4f')],_0x2657be[_0xd187('0x3f')]);_0x368348[_0xd187('0x42')]=_[_0xd187('0x52')](_0x2657be[_0xd187('0x4f')],qs[_0xd187('0x53')](_0x3400a0[_0xd187('0x3f')]['fields']));_0x368348[_0xd187('0x42')]=_0x368348[_0xd187('0x42')][_0xd187('0x47')]?_0x368348[_0xd187('0x42')]:_0x2657be['model'];if(_0x3400a0[_0xd187('0x3f')]['includeAll']){_0x368348['include']=[{'all':!![]}];}_0x368348=_[_0xd187('0x54')]({},_0x368348,_0x3400a0['options']);if(!_[_0xd187('0x33')](_0x368348[_0xd187('0x42')],'id')){_0x368348[_0xd187('0x42')][_0xd187('0x43')]('id');}return db[_0xd187('0x3a')][_0xd187('0x34')](_0x368348)[_0xd187('0x16')](handleEntityNotFound(_0x4e4a32,null))[_0xd187('0x16')](function(_0x1649a2){var _0x55e954=[];values=_0x1649a2;if(_0x3400a0[_0xd187('0x3f')][_0xd187('0x45')]==='true'){_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x48'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x55'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x4a'),_0x1649a2[_0xd187('0x49')]));_0x55e954['push'](get_open_tabs(_0xd187('0x4b'),_0x1649a2['dataValues']));_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x56'),_0x1649a2[_0xd187('0x49')]));_0x55e954[_0xd187('0x43')](get_open_tabs(_0xd187('0x57'),_0x1649a2[_0xd187('0x49')]));return BPromise[_0xd187('0x4c')](_0x55e954);}else{return values;}})['then'](function(_0xcef6ca){return values;})[_0xd187('0x16')](respondWithResult(_0x4e4a32,null))[_0xd187('0x1f')](handleError(_0x4e4a32,null));};exports['update']=function(_0x374e30,_0x23428f){if(_0x374e30[_0xd187('0x58')]['id']){delete _0x374e30[_0xd187('0x58')]['id'];}delete _0x374e30[_0xd187('0x58')][_0xd187('0x59')];return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x374e30[_0xd187('0x4e')]['id']}})[_0xd187('0x16')](handleEntityNotFound(_0x23428f,null))[_0xd187('0x16')](saveUpdates(_0x374e30[_0xd187('0x58')],null))[_0xd187('0x16')](respondWithResult(_0x23428f,null))[_0xd187('0x1f')](handleError(_0x23428f,null));};exports[_0xd187('0x5a')]=function(_0xaff1e6,_0x42fb32){return db[_0xd187('0x3a')][_0xd187('0x5a')]()[_0xd187('0x16')](respondWithResult(_0x42fb32,null))['catch'](handleError(_0x42fb32,null));};exports[_0xd187('0x5b')]=function(_0x48c82d,_0x13d118){return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x48c82d[_0xd187('0x4e')]['id']}})['then'](handleEntityNotFound(_0x13d118,null))[_0xd187('0x16')](function(_0x2eda30){if(_0x2eda30){return _0x2eda30['addContacts'](_0x48c82d['body'][_0xd187('0x5c')],_[_0xd187('0x5d')](_0x48c82d[_0xd187('0x58')],[_0xd187('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x13d118,null))[_0xd187('0x1f')](handleError(_0x13d118,null));};function validateUser(_0x49543f){return new BPromise(function(_0x1971b2,_0x2f6a72){if(_0x49543f[_0xd187('0x5e')])return _0x1971b2(_0x49543f);return db[_0xd187('0x5f')]['findById'](0x1)[_0xd187('0x16')](function(_0xaea7e0){if(_0xaea7e0[_0xd187('0x60')])authService[_0xd187('0x61')](_0x49543f[_0xd187('0x62')]);db['User']['max'](_0xd187('0x5e'))[_0xd187('0x16')](function(_0x167eaf){if(_[_0xd187('0x63')](_0x167eaf)){_0x49543f[_0xd187('0x5e')]=_0xaea7e0[_0xd187('0x64')]||0x1;return;}if(_[_0xd187('0x63')](_0xaea7e0[_0xd187('0x64')])||_0xaea7e0[_0xd187('0x64')]===_0x167eaf){_0x49543f[_0xd187('0x5e')]=_0x167eaf+0x1;return;}if(_0xaea7e0[_0xd187('0x64')]>_0x167eaf){_0x49543f[_0xd187('0x5e')]=_0xaea7e0['min_internal'];return;}return db[_0xd187('0x65')][_0xd187('0x3f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd187('0x65')][_0xd187('0x66')]['SELECT']})['then'](function(_0x32ba2a){if(_0x32ba2a&&_0x32ba2a[_0xd187('0x47')]){for(var _0x2ac56f=0x0,_0x2f743b=_0x32ba2a['length'];_0x2ac56f<_0x2f743b&&_[_0xd187('0x63')](_0x49543f[_0xd187('0x5e')]);_0x2ac56f++){if(_0xaea7e0['min_internal']<=_0x32ba2a[_0x2ac56f]['from']){_0x49543f[_0xd187('0x5e')]=_0x32ba2a[_0x2ac56f]['from'];}else if(_0xaea7e0[_0xd187('0x64')]>_0x32ba2a[_0x2ac56f][_0xd187('0x67')]&&_0xaea7e0['min_internal']<=_0x32ba2a[_0x2ac56f]['to']){_0x49543f[_0xd187('0x5e')]=_0xaea7e0['min_internal'];}}}if(_[_0xd187('0x63')](_0x49543f['internal'])){_0x49543f['internal']=_0x167eaf+0x1;}return _0x1971b2(_0x49543f);});});})['catch'](function(_0x16d9ea){_0x2f6a72(_0x16d9ea);});});}function updateUser(_0x243063){return new BPromise(function(_0x421585,_0x216829){try{if(_0x243063[_0xd187('0x68')]){_0x243063[_0xd187('0x69')]=_0x243063[_0xd187('0x5e')];_0x243063[_0xd187('0x6a')]={'mailbox':_0x243063['internal'],'password':_0x243063[_0xd187('0x62')],'fullname':_0x243063[_0xd187('0x6b')],'email':_0x243063[_0xd187('0x6c')]};}if(_0x243063['role']===_0xd187('0x2d')){if(!_0x243063[_0xd187('0x6d')])_0x243063[_0xd187('0x6d')]=[_0xd187('0x6e'),'102',_0xd187('0x6f'),_0xd187('0x70'),'110',_0xd187('0x71'),_0xd187('0x72'),_0xd187('0x73'),_0xd187('0x74'),'108',_0xd187('0x75'),_0xd187('0x76'),'111',_0xd187('0x77'),'115'];}_0x421585(_0x243063);}catch(_0x47c27c){_0x216829(_0x47c27c);}});}exports['create']=function(_0x7cbbac,_0x28472d){if(_0x7cbbac[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x2d'))throw new Error(_0xd187('0x78'));if(_0x7cbbac['body'][_0xd187('0x59')]===_0xd187('0x2b')&&_0x7cbbac['user']['role']!==_0xd187('0x79')){throw new Error(_0xd187('0x7a'));}if(_0x7cbbac[_0xd187('0x58')][_0xd187('0x59')]===_0xd187('0x79')&&_0x7cbbac[_0xd187('0x2b')]['role']!==_0xd187('0x79')){throw new Error(_0xd187('0x7b'));}return licenseUtil[_0xd187('0x7c')]([_0x7cbbac[_0xd187('0x58')]])[_0xd187('0x16')](function(){return validateUser(_0x7cbbac[_0xd187('0x58')]);})[_0xd187('0x16')](function(_0x1e58d4){return updateUser(_0x1e58d4)[_0xd187('0x16')](function(_0xf31fac){if(_0xf31fac[_0xd187('0x59')]===_0xd187('0x79')){_0xf31fac['settingsEnabled']=_0x7cbbac['user'][_0xd187('0x7d')];delete _0xf31fac[_0xd187('0x7e')];}return _0xf31fac;});})[_0xd187('0x16')](function(_0x147c96){return db[_0xd187('0x3a')][_0xd187('0x7f')](_0x147c96,{'include':[{'model':db['VoiceMail'],'as':_0xd187('0x6a')}]});})['then'](function(_0x2b2df3){if(_0x7cbbac['body']['role']===_0xd187('0x2b'))return _0x2b2df3;if(_0x7cbbac['user'][_0xd187('0x59')]!==_0xd187('0x2b'))return _0x2b2df3;return db[_0xd187('0x80')][_0xd187('0x34')]({'where':{'name':_0x2b2df3[_0xd187('0x59')]===_0xd187('0x2d')?_0xd187('0x2c'):_0xd187('0x2e'),'userProfileId':_0x7cbbac[_0xd187('0x2b')][_0xd187('0x7e')]},'raw':!![]})[_0xd187('0x16')](function(_0x3ae931){if(!_0x3ae931||_0x3ae931[_0xd187('0x81')]!=0x0)return _0x2b2df3;return db[_0xd187('0x35')][_0xd187('0x7f')]({'name':_0x2b2df3['name'],'resourceId':_0x2b2df3['id'],'type':_0x3ae931[_0xd187('0x38')],'sectionId':_0x3ae931['id']},{})[_0xd187('0x16')](function(){return _0x2b2df3;});})[_0xd187('0x1f')](function(_0x43563b){logger['error'](_0xd187('0x82'),_0x43563b);throw _0x43563b;});})[_0xd187('0x16')](respondWithResult(_0x28472d,0xc9))['catch'](handleError(_0x28472d,null));};exports['bulkCreate']=function(_0x20b680,_0x3c993a){var _0x7fdb14=_0x20b680[_0xd187('0x58')];var _0x371869=[];if(_0x20b680[_0xd187('0x2b')]['role']===_0xd187('0x2d'))throw new Error(_0xd187('0x78'));if(_['some'](_0x7fdb14,[_0xd187('0x59'),_0xd187('0x2b')])&&_0x20b680[_0xd187('0x2b')][_0xd187('0x59')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd187('0x83')](_0x7fdb14,[_0xd187('0x59'),_0xd187('0x79')])&&_0x20b680['user'][_0xd187('0x59')]!==_0xd187('0x79')){throw new Error(_0xd187('0x84'));}return licenseUtil[_0xd187('0x7c')](_0x7fdb14)['then'](function(){return validateUser(_0x7fdb14[0x0]);})[_0xd187('0x16')](function(){for(var _0x4efb9f=0x1;_0x4efb9f<_0x7fdb14['length'];_0x4efb9f++){var _0x4a9310=_0x7fdb14[_0x4efb9f-0x1]['internal'];if(!_0x7fdb14[_0x4efb9f]['internal'])_0x7fdb14[_0x4efb9f]['internal']=_0x4a9310+0x1;_0x371869['push'](validateUser(_0x7fdb14[_0x4efb9f]));}return BPromise[_0xd187('0x4c')](_0x371869);})[_0xd187('0x16')](function(){_0x371869=[];for(var _0x4c5879=0x0;_0x4c5879<_0x7fdb14[_0xd187('0x47')];_0x4c5879++){_0x371869[_0xd187('0x43')](updateUser(_0x7fdb14[_0x4c5879]));}return BPromise[_0xd187('0x4c')](_0x371869);})[_0xd187('0x16')](function(){return BPromise[_0xd187('0x85')](_0x7fdb14,function(_0x4a1189){return db[_0xd187('0x3a')]['create'](_0x4a1189,{'include':[{'model':db[_0xd187('0x6a')],'as':_0xd187('0x6a')}]})[_0xd187('0x16')](function(_0x36e6ae){_0x4a1189['id']=_0x36e6ae['id'];return _0x4a1189;});});})[_0xd187('0x16')](function(_0x18690e){if(_0x20b680[_0xd187('0x58')]['role']===_0xd187('0x2b'))return _0x18690e;if(_0x20b680[_0xd187('0x2b')]['role']!==_0xd187('0x2b'))return _0x18690e;var _0x3720f1=_['some'](_0x18690e,function(_0x348b73){return _0x348b73[_0xd187('0x59')]===_0xd187('0x2d')||_0x348b73[_0xd187('0x59')]===_0xd187('0x2f');});if(!_0x3720f1)return _0x18690e;return db[_0xd187('0x80')][_0xd187('0x86')]({'where':{'name':{'$or':[_0xd187('0x2c'),'Telephones']},'userProfileId':_0x20b680[_0xd187('0x2b')][_0xd187('0x7e')]},'raw':!![]})[_0xd187('0x16')](function(_0x44ac47){if(_[_0xd187('0x87')](_0x44ac47)||!_[_0xd187('0x83')](_0x44ac47,['autoAssociation',0x0]))return _0x18690e;_0x371869=[];var _0x4fcf43=_(_0x44ac47)[_0xd187('0x31')](function(_0x3c9248){if(_0x3c9248['autoAssociation']===0x1)return;return _0x3c9248[_0xd187('0x38')]===_0xd187('0x2c')?_0xd187('0x2d'):_0xd187('0x2f');})[_0xd187('0x88')]()[_0xd187('0x32')]();for(var _0x578de9=0x0;_0x578de9<_0x18690e[_0xd187('0x47')];_0x578de9++){if(!_[_0xd187('0x33')](_0x4fcf43,_0x18690e[_0x578de9][_0xd187('0x59')]))return;var _0x23e30b=_0x18690e[_0x578de9][_0xd187('0x59')]===_0xd187('0x2d')?_0xd187('0x2c'):_0xd187('0x2e');_0x371869[_0xd187('0x43')](db['UserProfileResource'][_0xd187('0x7f')]({'name':_0x18690e[_0x578de9][_0xd187('0x38')],'resourceId':_0x18690e[_0x578de9]['id'],'type':_0x23e30b,'sectionId':_[_0xd187('0x34')](_0x44ac47,['name',_0x23e30b])['id']},{}));}return BPromise[_0xd187('0x4c')](_0x371869);});})[_0xd187('0x16')](respondWithResult(_0x3c993a,0xc9))[_0xd187('0x1f')](handleError(_0x3c993a,null));};exports[_0xd187('0x89')]=function(_0x1e0e80,_0xec0779){if(_0x1e0e80['body']['id']){delete _0x1e0e80[_0xd187('0x58')]['id'];}return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x1e0e80['params']['id']}})[_0xd187('0x16')](function(_0xd39f2a){if(!_0xd39f2a)return null;if(_0xd39f2a['id']===_0x1e0e80[_0xd187('0x2b')]['id']){if(!_0x1e0e80[_0xd187('0x58')][_0xd187('0x8a')]||!_0x1e0e80[_0xd187('0x58')]['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xd39f2a[_0xd187('0x8d')](_0x1e0e80[_0xd187('0x58')]['oldPassword'])){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))]('Wrong\x20credentials');}if(_0x1e0e80[_0xd187('0x58')][_0xd187('0x8a')]===_0x1e0e80['body'][_0xd187('0x8e')]){throw new db['Sequelize'][(_0xd187('0x8c'))](_0xd187('0x8f'));}}else if(_0x1e0e80[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x79')){if(!_0x1e0e80['body']['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x90'));}}else if(_0x1e0e80[_0xd187('0x2b')][_0xd187('0x59')]===_0xd187('0x2b')){if(!_0x1e0e80[_0xd187('0x58')]['newPassword']){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x90'));}if(_0xd39f2a[_0xd187('0x59')]!==_0xd187('0x2d')){throw new db[(_0xd187('0x8b'))]['ValidationError'](_0xd187('0x78'));}}else{throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x78'));}return _0xd39f2a;})[_0xd187('0x16')](handleEntityNotFound(_0xec0779,null))[_0xd187('0x16')](function(_0x1c6433){return db[_0xd187('0x5f')]['findOne']({'attributes':['id',_0xd187('0x60'),'enforcePasswordHistory',_0xd187('0x91')]})[_0xd187('0x16')](function(_0x4853a8){if(_0x4853a8[_0xd187('0x60')])authService[_0xd187('0x61')](_0x1e0e80['body'][_0xd187('0x8e')]);if(!_0x4853a8['enforcePasswordHistory']||!_0x1c6433[_0xd187('0x92')])return _0x1c6433;authService['validatePasswordHistory'](_0x1e0e80['body'][_0xd187('0x8e')],_0x1c6433[_0xd187('0x92')],_0x4853a8[_0xd187('0x91')]);return _0x1c6433;})[_0xd187('0x16')](saveUpdates({'password':_0x1e0e80['body'][_0xd187('0x8e')],'passwordResetAt':_0x1e0e80[_0xd187('0x2b')]['id']==_0x1e0e80[_0xd187('0x4e')]['id']?moment():null,'previousPasswords':authService[_0xd187('0x93')](_0x1e0e80[_0xd187('0x58')][_0xd187('0x8e')],_0x1c6433[_0xd187('0x92')])},null));})[_0xd187('0x16')](respondWithResult(_0xec0779,null))[_0xd187('0x1f')](handleError(_0xec0779,null));};exports[_0xd187('0x94')]=function(_0x52f520,_0x74f8d7){var _0x8c3b2a=_0x52f520[_0xd187('0x58')]['channel'];return db['User'][_0xd187('0x34')]({'where':{'id':_0x52f520[_0xd187('0x4e')]['id']},'attributes':['id',_0xd187('0x38'),'role','online',_0xd187('0x95'),_0xd187('0x96'),'interface']})[_0xd187('0x16')](handleEntityNotFound(_0x74f8d7,null))[_0xd187('0x16')](function(_0x361f8b){if(_0x361f8b){if(!utils[_0xd187('0x97')](_0x8c3b2a)){throw new db['Sequelize'][(_0xd187('0x8c'))](_0xd187('0x98'));}return _0x361f8b[_0xd187('0x99')+_[_0xd187('0x9a')](_0x8c3b2a[_0xd187('0x9b')]())+_0xd187('0x9c')](_0x52f520[_0xd187('0x58')]['ids'],{'penalty':_0x52f520[_0xd187('0x58')]['penalty']||0x0})[_0xd187('0x9d')](function(_0x4f50a8){for(var _0x3a1101=0x0;_0x3a1101<_0x52f520['body'][_0xd187('0x5c')][_0xd187('0x47')];_0x3a1101+=0x1){var _0x388797={'UserId':Number(_0x52f520['params']['id'])};_0x388797[_[_0xd187('0x9a')](_0x8c3b2a[_0xd187('0x9b')]())+_0xd187('0x9e')]=Number(_0x52f520[_0xd187('0x58')][_0xd187('0x5c')][_0x3a1101]);socket[_0xd187('0x9f')](_0xd187('0x2b')+_[_0xd187('0x9a')](_0x8c3b2a['toLowerCase']())+_0xd187('0xa0'),_0x388797);}return _0x4f50a8;})[_0xd187('0x16')](function(){if(_0x8c3b2a===_0xd187('0xa1')){return db['VoiceQueue'][_0xd187('0x86')]({'where':{'id':_0x52f520[_0xd187('0x58')][_0xd187('0x5c')]||[]},'raw':!![],'attributes':['id',_0xd187('0x38')]});}})[_0xd187('0x16')](function(_0x28bc14){var _0x2e4db4=_0x361f8b[_0xd187('0x29')]({'plain':!![]});var _0xbb4a68=[];if(_0x8c3b2a===_0xd187('0xa1')&&_0x2e4db4[_0xd187('0x59')]==='agent'&&_0x2e4db4[_0xd187('0xa2')]){for(var _0x7960ed=0x0;_0x7960ed<_0x28bc14[_0xd187('0x47')];_0x7960ed+=0x1){_0xbb4a68[_0xd187('0x43')]({'membername':_0x2e4db4['name'],'UserId':_0x2e4db4['id'],'queue_name':_0x28bc14[_0x7960ed][_0xd187('0x38')],'VoiceQueueId':_0x28bc14[_0x7960ed]['id'],'interface':_['isNil'](_0x2e4db4[_0xd187('0xa3')])?util[_0xd187('0xa4')](_0xd187('0xa5'),_0x2e4db4[_0xd187('0x38')]):_0x2e4db4[_0xd187('0xa3')],'paused':_0x2e4db4['voicePause']||![],'penalty':_0x52f520[_0xd187('0x58')][_0xd187('0xa6')]||0x0});}return BPromise[_0xd187('0x85')](_0xbb4a68,function(_0x31c17b){return db[_0xd187('0xa7')]['upsert'](_0x31c17b);});}return _0x361f8b;});}})[_0xd187('0x16')](respondWithStatusCode(_0x74f8d7,null))[_0xd187('0x1f')](handleError(_0x74f8d7,null));};exports[_0xd187('0xa8')]=function(_0x4fce90,_0x4dcd41){var _0x38e2af;return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x4fce90[_0xd187('0x4e')]['id']},'attributes':['id','name',_0xd187('0x59')]})[_0xd187('0x16')](handleEntityNotFound(_0x4dcd41,null))[_0xd187('0x16')](function(_0x1721c2){if(_0x1721c2){_0x38e2af=_0x1721c2;if(!_0x4fce90['query'][_0xd187('0xa9')]||!utils['isValidChannel'](_0x4fce90[_0xd187('0x3f')][_0xd187('0xa9')])){throw new db[(_0xd187('0x8b'))][(_0xd187('0x8c'))](_0xd187('0x98'));}return _0x1721c2['remove'+_[_0xd187('0x9a')](_0x4fce90[_0xd187('0x3f')][_0xd187('0xa9')][_0xd187('0x9b')]())+'Queues'](_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')]);}})[_0xd187('0x16')](function(_0x474a9f){if(_[_0xd187('0xaa')](_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')])){for(var _0x12e3ca=0x0;_0x12e3ca<_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')][_0xd187('0x47')];_0x12e3ca+=0x1){var _0x943fc1={'UserId':Number(_0x4fce90[_0xd187('0x4e')]['id'])};_0x943fc1[_['capitalize'](_0x4fce90[_0xd187('0x3f')]['channel'][_0xd187('0x9b')]())+'QueueId']=Number(_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')][_0x12e3ca]);socket[_0xd187('0x9f')](_0xd187('0x2b')+_['capitalize'](_0x4fce90['query'][_0xd187('0xa9')][_0xd187('0x9b')]())+_0xd187('0xab'),_0x943fc1);}}else{var _0x943fc1={'UserId':Number(_0x4fce90[_0xd187('0x4e')]['id'])};_0x943fc1[_[_0xd187('0x9a')](_0x4fce90['query']['channel'][_0xd187('0x9b')]())+_0xd187('0x9e')]=Number(_0x4fce90[_0xd187('0x3f')]['ids']);socket[_0xd187('0x9f')](_0xd187('0x2b')+_[_0xd187('0x9a')](_0x4fce90['query'][_0xd187('0xa9')]['toLowerCase']())+_0xd187('0xab'),_0x943fc1);}return _0x474a9f;})['then'](function(){if(_0x4fce90['query']['channel']===_0xd187('0xa1')){return db[_0xd187('0xa7')][_0xd187('0x28')]({'where':{'UserId':_0x4fce90[_0xd187('0x4e')]['id'],'VoiceQueueId':_0x4fce90[_0xd187('0x3f')][_0xd187('0x5c')]},'individualHooks':!![]})['then'](function(){return _0x38e2af;});}return _0x38e2af;})[_0xd187('0x16')](respondWithStatusCode(_0x4dcd41,null))['catch'](handleError(_0x4dcd41,null));};exports[_0xd187('0xac')]=function(_0x3ee43e,_0x3c71f3){_0x3ee43e[_0xd187('0x58')][_0xd187('0xad')]=_0x3ee43e[_0xd187('0xae')]['filename'];return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x3ee43e[_0xd187('0x4e')]['id']}})[_0xd187('0x16')](handleEntityNotFound(_0x3c71f3,null))['then'](saveUpdates(_0x3ee43e[_0xd187('0x58')],null))[_0xd187('0x16')](respondWithResult(_0x3c71f3,null))['catch'](handleError(_0x3c71f3,null));};exports[_0xd187('0xaf')]=function(_0x305023,_0xc926a1){var _0x18c8e4=path['join'](config[_0xd187('0xb0')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x305023[_0xd187('0x4e')]['id']},'attributes':['id',_0xd187('0xad')],'raw':!![]})[_0xd187('0x16')](handleEntityNotFound(_0xc926a1,null))[_0xd187('0x16')](function(_0x7d8eb5){if(_0x7d8eb5){if(_[_0xd187('0x63')](_0x7d8eb5[_0xd187('0xad')])){return _0xc926a1[_0xd187('0xb1')](_0x18c8e4);}else{if(!fs['existsSync'](path[_0xd187('0xb2')](config[_0xd187('0xb0')],_0xd187('0xb3'),_0x7d8eb5['userpic']))){return _0xc926a1[_0xd187('0xb1')](_0x18c8e4);}return _0xc926a1[_0xd187('0xb1')](path[_0xd187('0xb2')](config[_0xd187('0xb0')],_0xd187('0xb3'),_0x7d8eb5['userpic']));}}})[_0xd187('0x1f')](handleError(_0xc926a1,null));};exports[_0xd187('0xb4')]=function(_0x1ac714,_0x5ac21a){return db[_0xd187('0x3a')][_0xd187('0x34')]({'where':{'id':_0x1ac714[_0xd187('0x4e')]['id']},'attributes':['id']})[_0xd187('0x16')](handleEntityNotFound(_0x5ac21a,null))['then'](function(_0x476b70){var _0x3cf76c=[];values=_0x476b70[_0xd187('0x49')];_0x3cf76c[_0xd187('0x43')](get_open_tabs('chat',_0x476b70[_0xd187('0x49')]));_0x3cf76c[_0xd187('0x43')](get_open_tabs('sms',_0x476b70[_0xd187('0x49')]));_0x3cf76c['push'](get_open_tabs(_0xd187('0x4a'),_0x476b70['dataValues']));_0x3cf76c['push'](get_open_tabs(_0xd187('0x4b'),_0x476b70['dataValues']));_0x3cf76c[_0xd187('0x43')](get_open_tabs('fax',_0x476b70[_0xd187('0x49')]));_0x3cf76c[_0xd187('0x43')](get_open_tabs('mail',_0x476b70[_0xd187('0x49')]));return BPromise[_0xd187('0x4c')](_0x3cf76c);})[_0xd187('0x16')](function(_0x450bf6){var _0x1751ee=[];if(_0x450bf6){for(var _0x17a1d6=0x0;_0x17a1d6=_0x5f8f7){_0x2f62d7=_0x5f8f7;_0x552469=0xc8;}else{_0x552469=0xce;}_0x5a4994[_0x3162('0x19')](_0x552469);return _0x5a4994[_0x3162('0x20')](_0x3162('0x21'),_0x356c5d+'-'+_0x2f62d7+'/'+_0x5f8f7)['json'](_0x2433f8);}return null;};}function saveUpdates(_0x4903e7){return function(_0xda0389){if(_0xda0389){return _0xda0389[_0x3162('0x22')](_0x4903e7)[_0x3162('0x23')](function(_0x399148){return _0x399148;});}return null;};}function removeEntity(_0x2f88ec){return function(_0x5c2d28){if(_0x5c2d28){return _0x5c2d28[_0x3162('0x24')]()['then'](function(){var _0xf11765=_0x5c2d28[_0x3162('0x25')]({'plain':!![]});if(_0xf11765[_0x3162('0x26')]===_0x3162('0x27'))return;var _0x118dab=[{'name':_0x3162('0x28'),'value':_0x3162('0x29'),'ignore':!![]},{'name':_0x3162('0x2a'),'value':'agent','ignore':![]},{'name':_0x3162('0x2b'),'value':_0x3162('0x2c'),'ignore':![]}];var _0x48d6fc=_(_0x118dab)[_0x3162('0x2d')](_0x3162('0x2e'))['map']('value')[_0x3162('0x2f')]();if(_['includes'](_0x48d6fc,_0xf11765[_0x3162('0x26')])){return;}var _0x47241c=_[_0x3162('0x30')](_0x118dab,['value',_0xf11765['role']])[_0x3162('0x31')];return db[_0x3162('0x32')]['destroy']({'where':{'type':_0x47241c,'resourceId':_0xf11765['id']}})[_0x3162('0x23')](function(){return _0x5c2d28;});})['then'](function(){_0x2f88ec[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x339be2){return function(_0x137e9b){if(!_0x137e9b){_0x339be2[_0x3162('0x18')](0x194);}return _0x137e9b;};}function handleError(_0x3b6c91,_0x30bb26){_0x30bb26=_0x30bb26||0x1f4;return function(_0x25951b){logger[_0x3162('0x14')](_0x25951b[_0x3162('0x33')]);if(_0x25951b[_0x3162('0x31')]){delete _0x25951b['name'];}_0x3b6c91[_0x3162('0x19')](_0x30bb26)[_0x3162('0x34')](_0x25951b);};}exports[_0x3162('0x35')]=function(_0x5396df,_0x59759d){var _0x3b0a0b={},_0x124c92={'count':0x0,'rows':[]};var _0x2e1ab5=_(db[_0x3162('0x36')]['rawAttributes'])[_0x3162('0x37')](function(_0x5ee3e2){return{'name':_0x5ee3e2['fieldName'],'type':_0x5ee3e2['type'][_0x3162('0x38')]};})[_0x3162('0x2d')](function(_0x315fdb){return!_['includes']([_0x3162('0x39'),_0x3162('0x3a')],_0x315fdb[_0x3162('0x31')]);})[_0x3162('0x2f')]();_0x3b0a0b=qs[_0x3162('0x3b')](_0x2e1ab5,_0x5396df);var _0x4f06c5={'where':_0x3b0a0b['where']};return db[_0x3162('0x36')][_0x3162('0x1f')](_0x4f06c5)['then'](function(_0x5960cd){_0x124c92[_0x3162('0x1f')]=_0x5960cd;if(_0x5396df[_0x3162('0x3c')][_0x3162('0x3d')]){_0x3b0a0b['include']=[{'all':!![]}];}if(!_[_0x3162('0x3e')](_0x3b0a0b[_0x3162('0x3f')],'id')){_0x3b0a0b[_0x3162('0x3f')][_0x3162('0x40')]('id');}return db['User'][_0x3162('0x41')](_0x3b0a0b);})[_0x3162('0x23')](function(_0x522cce){_0x124c92[_0x3162('0x42')]=_0x522cce;if(_0x5396df[_0x3162('0x3c')]['openTabs']===_0x3162('0x43')){var _0x19cf70=[];for(var _0x59f75d=0x0;_0x59f75d<_0x124c92[_0x3162('0x42')]['length'];_0x59f75d++){_0x19cf70[_0x3162('0x40')](get_open_tabs(_0x3162('0x44'),_0x124c92[_0x3162('0x42')][_0x59f75d][_0x3162('0x45')]));_0x19cf70[_0x3162('0x40')](get_open_tabs(_0x3162('0x46'),_0x124c92['rows'][_0x59f75d][_0x3162('0x45')]));_0x19cf70[_0x3162('0x40')](get_open_tabs(_0x3162('0x47'),_0x124c92['rows'][_0x59f75d][_0x3162('0x45')]));_0x19cf70[_0x3162('0x40')](get_open_tabs('mail',_0x124c92[_0x3162('0x42')][_0x59f75d]['dataValues']));_0x19cf70['push'](get_open_tabs('openchannel',_0x124c92[_0x3162('0x42')][_0x59f75d][_0x3162('0x45')]));_0x19cf70[_0x3162('0x40')](get_open_tabs(_0x3162('0x48'),_0x124c92[_0x3162('0x42')][_0x59f75d][_0x3162('0x45')]));}return BPromise[_0x3162('0x49')](_0x19cf70)[_0x3162('0x23')](function(_0x3d2958){return _0x124c92;});}else{return _0x124c92;}})[_0x3162('0x23')](respondWithFilteredResult(_0x59759d,_0x3b0a0b))[_0x3162('0x4a')](handleError(_0x59759d,null));};exports[_0x3162('0x4b')]=function(_0x209383,_0x56f9bf){var _0x3ac940={'raw':![],'where':{'id':_0x209383['params']['id']}},_0x48cb8f={};_0x48cb8f[_0x3162('0x4c')]=_[_0x3162('0x4d')](_[_0x3162('0x4e')](db[_0x3162('0x36')]['rawAttributes']),[_0x3162('0x39'),'salt']);_0x48cb8f[_0x3162('0x3c')]=_[_0x3162('0x4e')](_0x209383['query']);_0x48cb8f[_0x3162('0x4f')]=_['intersection'](_0x48cb8f['model'],_0x48cb8f[_0x3162('0x3c')]);_0x3ac940[_0x3162('0x3f')]=_[_0x3162('0x50')](_0x48cb8f[_0x3162('0x4c')],qs[_0x3162('0x51')](_0x209383[_0x3162('0x3c')][_0x3162('0x51')]));_0x3ac940[_0x3162('0x3f')]=_0x3ac940['attributes']['length']?_0x3ac940['attributes']:_0x48cb8f[_0x3162('0x4c')];if(_0x209383[_0x3162('0x3c')][_0x3162('0x3d')]){_0x3ac940[_0x3162('0x52')]=[{'all':!![]}];}_0x3ac940=_[_0x3162('0x53')]({},_0x3ac940,_0x209383[_0x3162('0x54')]);if(!_[_0x3162('0x3e')](_0x3ac940['attributes'],'id')){_0x3ac940[_0x3162('0x3f')]['push']('id');}return db[_0x3162('0x36')]['find'](_0x3ac940)[_0x3162('0x23')](handleEntityNotFound(_0x56f9bf,null))['then'](function(_0x1a7165){var _0xd6b792=[];values=_0x1a7165;if(_0x209383['query']['openTabs']===_0x3162('0x43')){_0xd6b792[_0x3162('0x40')](get_open_tabs('chat',_0x1a7165[_0x3162('0x45')]));_0xd6b792[_0x3162('0x40')](get_open_tabs(_0x3162('0x46'),_0x1a7165[_0x3162('0x45')]));_0xd6b792[_0x3162('0x40')](get_open_tabs('openchannel',_0x1a7165[_0x3162('0x45')]));_0xd6b792[_0x3162('0x40')](get_open_tabs('whatsapp',_0x1a7165['dataValues']));_0xd6b792[_0x3162('0x40')](get_open_tabs(_0x3162('0x47'),_0x1a7165[_0x3162('0x45')]));_0xd6b792['push'](get_open_tabs(_0x3162('0x55'),_0x1a7165[_0x3162('0x45')]));return BPromise[_0x3162('0x49')](_0xd6b792);}else{return values;}})[_0x3162('0x23')](function(_0x5c948d){return values;})[_0x3162('0x23')](respondWithResult(_0x56f9bf,null))[_0x3162('0x4a')](handleError(_0x56f9bf,null));};exports['update']=function(_0x3179a,_0x4fd42f){if(_0x3179a[_0x3162('0x56')]['id']){delete _0x3179a[_0x3162('0x56')]['id'];}delete _0x3179a[_0x3162('0x56')]['role'];return db[_0x3162('0x36')][_0x3162('0x30')]({'where':{'id':_0x3179a[_0x3162('0x57')]['id']}})[_0x3162('0x23')](handleEntityNotFound(_0x4fd42f,null))[_0x3162('0x23')](saveUpdates(_0x3179a[_0x3162('0x56')],null))['then'](respondWithResult(_0x4fd42f,null))['catch'](handleError(_0x4fd42f,null));};exports['describe']=function(_0x410593,_0x5b2de9){return db[_0x3162('0x36')][_0x3162('0x58')]()[_0x3162('0x23')](respondWithResult(_0x5b2de9,null))[_0x3162('0x4a')](handleError(_0x5b2de9,null));};exports[_0x3162('0x59')]=function(_0x512137,_0x5a832c){return db[_0x3162('0x36')][_0x3162('0x30')]({'where':{'id':_0x512137['params']['id']}})[_0x3162('0x23')](handleEntityNotFound(_0x5a832c,null))[_0x3162('0x23')](function(_0x1c1fd1){if(_0x1c1fd1){return _0x1c1fd1[_0x3162('0x59')](_0x512137[_0x3162('0x56')]['ids'],_[_0x3162('0x5a')](_0x512137[_0x3162('0x56')],[_0x3162('0x5b'),'id'])||{});}})[_0x3162('0x23')](respondWithResult(_0x5a832c,null))[_0x3162('0x4a')](handleError(_0x5a832c,null));};function validateUser(_0x5c8cef){return new BPromise(function(_0x35fcf5,_0x401b4e){if(_0x5c8cef[_0x3162('0x5c')])return _0x35fcf5(_0x5c8cef);return db[_0x3162('0x5d')]['findById'](0x1)[_0x3162('0x23')](function(_0x141ab9){if(_0x141ab9[_0x3162('0x5e')])authService[_0x3162('0x5f')](_0x5c8cef[_0x3162('0x39')]);db[_0x3162('0x36')][_0x3162('0x60')](_0x3162('0x5c'))[_0x3162('0x23')](function(_0x262266){if(_['isNil'](_0x262266)){_0x5c8cef[_0x3162('0x5c')]=_0x141ab9[_0x3162('0x61')]||0x1;return;}if(_['isNil'](_0x141ab9[_0x3162('0x61')])||_0x141ab9['min_internal']===_0x262266){_0x5c8cef[_0x3162('0x5c')]=_0x262266+0x1;return;}if(_0x141ab9[_0x3162('0x61')]>_0x262266){_0x5c8cef[_0x3162('0x5c')]=_0x141ab9[_0x3162('0x61')];return;}return db[_0x3162('0x62')][_0x3162('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x3162('0x62')][_0x3162('0x63')][_0x3162('0x64')]})[_0x3162('0x23')](function(_0x3147a8){if(_0x3147a8&&_0x3147a8[_0x3162('0x65')]){for(var _0x509c99=0x0,_0x2a3e33=_0x3147a8[_0x3162('0x65')];_0x509c99<_0x2a3e33&&_[_0x3162('0x66')](_0x5c8cef[_0x3162('0x5c')]);_0x509c99++){if(_0x141ab9[_0x3162('0x61')]<=_0x3147a8[_0x509c99][_0x3162('0x67')]){_0x5c8cef[_0x3162('0x5c')]=_0x3147a8[_0x509c99]['from'];}else if(_0x141ab9['min_internal']>_0x3147a8[_0x509c99]['from']&&_0x141ab9[_0x3162('0x61')]<=_0x3147a8[_0x509c99]['to']){_0x5c8cef[_0x3162('0x5c')]=_0x141ab9['min_internal'];}}}if(_[_0x3162('0x66')](_0x5c8cef[_0x3162('0x5c')])){_0x5c8cef[_0x3162('0x5c')]=_0x262266+0x1;}return _0x35fcf5(_0x5c8cef);});});})[_0x3162('0x4a')](function(_0x4eb53c){_0x401b4e(_0x4eb53c);});});}function updateUser(_0x1e5d8a){return new BPromise(function(_0x5fe32c,_0x533140){try{if(_0x1e5d8a[_0x3162('0x68')]){_0x1e5d8a['mailbox']=_0x1e5d8a[_0x3162('0x5c')];_0x1e5d8a['VoiceMail']={'mailbox':_0x1e5d8a[_0x3162('0x5c')],'password':_0x1e5d8a['password'],'fullname':_0x1e5d8a[_0x3162('0x69')],'email':_0x1e5d8a[_0x3162('0x6a')]};}if(_0x1e5d8a[_0x3162('0x26')]===_0x3162('0x6b')){if(!_0x1e5d8a[_0x3162('0x6c')])_0x1e5d8a[_0x3162('0x6c')]=['101',_0x3162('0x6d'),_0x3162('0x6e'),_0x3162('0x6f'),'110',_0x3162('0x70'),_0x3162('0x71'),_0x3162('0x72'),_0x3162('0x73'),_0x3162('0x74'),'109',_0x3162('0x75'),_0x3162('0x76'),'114','115'];}_0x5fe32c(_0x1e5d8a);}catch(_0x262e82){_0x533140(_0x262e82);}});}exports[_0x3162('0x77')]=function(_0x54735c,_0x81909b){if(_0x54735c[_0x3162('0x29')][_0x3162('0x26')]===_0x3162('0x6b'))throw new Error(_0x3162('0x78'));if(_0x54735c[_0x3162('0x56')][_0x3162('0x26')]===_0x3162('0x29')&&_0x54735c[_0x3162('0x29')]['role']!=='admin'){throw new Error(_0x3162('0x79'));}if(_0x54735c[_0x3162('0x56')]['role']===_0x3162('0x27')&&_0x54735c['user']['role']!=='admin'){throw new Error(_0x3162('0x7a'));}return licenseUtil['checkUserLimits']([_0x54735c[_0x3162('0x56')]])[_0x3162('0x23')](function(){return validateUser(_0x54735c[_0x3162('0x56')]);})[_0x3162('0x23')](function(_0x1bd5f6){return updateUser(_0x1bd5f6)[_0x3162('0x23')](function(_0x36b427){if(_0x36b427[_0x3162('0x26')]===_0x3162('0x27')){_0x36b427[_0x3162('0x7b')]=_0x54735c[_0x3162('0x29')]['settingsEnabled'];delete _0x36b427[_0x3162('0x7c')];}return _0x36b427;});})[_0x3162('0x23')](function(_0x42c195){return db[_0x3162('0x36')][_0x3162('0x77')](_0x42c195,{'include':[{'model':db[_0x3162('0x7d')],'as':_0x3162('0x7d')}]});})[_0x3162('0x23')](function(_0x34032a){if(_0x54735c[_0x3162('0x56')][_0x3162('0x26')]===_0x3162('0x29'))return _0x34032a;if(_0x54735c['user'][_0x3162('0x26')]!==_0x3162('0x29'))return _0x34032a;return db[_0x3162('0x7e')]['find']({'where':{'name':_0x34032a[_0x3162('0x26')]==='agent'?_0x3162('0x2a'):_0x3162('0x2b'),'userProfileId':_0x54735c['user']['userProfileId']},'raw':!![]})[_0x3162('0x23')](function(_0x459db1){if(!_0x459db1||_0x459db1['autoAssociation']!=0x0)return _0x34032a;return db[_0x3162('0x32')]['create']({'name':_0x34032a[_0x3162('0x31')],'resourceId':_0x34032a['id'],'type':_0x459db1[_0x3162('0x31')],'sectionId':_0x459db1['id']},{})[_0x3162('0x23')](function(){return _0x34032a;});})[_0x3162('0x4a')](function(_0x397e95){logger[_0x3162('0x14')](_0x3162('0x7f'),_0x397e95);throw _0x397e95;});})[_0x3162('0x23')](respondWithResult(_0x81909b,0xc9))[_0x3162('0x4a')](handleError(_0x81909b,null));};exports['bulkCreate']=function(_0x42e4ef,_0x528bf6){var _0x102f0c=_0x42e4ef[_0x3162('0x56')];var _0x4e5420=[];if(_0x42e4ef[_0x3162('0x29')][_0x3162('0x26')]===_0x3162('0x6b'))throw new Error(_0x3162('0x78'));if(_[_0x3162('0x80')](_0x102f0c,[_0x3162('0x26'),_0x3162('0x29')])&&_0x42e4ef['user'][_0x3162('0x26')]!==_0x3162('0x27')){throw new Error(_0x3162('0x79'));}if(_['some'](_0x102f0c,[_0x3162('0x26'),_0x3162('0x27')])&&_0x42e4ef[_0x3162('0x29')][_0x3162('0x26')]!==_0x3162('0x27')){throw new Error(_0x3162('0x81'));}return licenseUtil['checkUserLimits'](_0x102f0c)[_0x3162('0x23')](function(){return validateUser(_0x102f0c[0x0]);})[_0x3162('0x23')](function(){for(var _0x3ac0ef=0x1;_0x3ac0ef<_0x102f0c[_0x3162('0x65')];_0x3ac0ef++){var _0x40ae99=_0x102f0c[_0x3ac0ef-0x1]['internal'];if(!_0x102f0c[_0x3ac0ef][_0x3162('0x5c')])_0x102f0c[_0x3ac0ef]['internal']=_0x40ae99+0x1;_0x4e5420[_0x3162('0x40')](validateUser(_0x102f0c[_0x3ac0ef]));}return BPromise[_0x3162('0x49')](_0x4e5420);})['then'](function(){_0x4e5420=[];for(var _0x2cf06c=0x0;_0x2cf06c<_0x102f0c[_0x3162('0x65')];_0x2cf06c++){_0x4e5420[_0x3162('0x40')](updateUser(_0x102f0c[_0x2cf06c]));}return BPromise['all'](_0x4e5420);})[_0x3162('0x23')](function(){return BPromise['each'](_0x102f0c,function(_0x5369a0){return db[_0x3162('0x36')][_0x3162('0x77')](_0x5369a0,{'include':[{'model':db[_0x3162('0x7d')],'as':_0x3162('0x7d')}]})[_0x3162('0x23')](function(_0x34c426){_0x5369a0['id']=_0x34c426['id'];return _0x5369a0;});});})[_0x3162('0x23')](function(_0x5308d1){if(_0x42e4ef['body']['role']===_0x3162('0x29'))return _0x5308d1;if(_0x42e4ef[_0x3162('0x29')]['role']!=='user')return _0x5308d1;var _0x118d5e=_['some'](_0x5308d1,function(_0xd803e){return _0xd803e[_0x3162('0x26')]===_0x3162('0x6b')||_0xd803e[_0x3162('0x26')]==='telephone';});if(!_0x118d5e)return _0x5308d1;return db[_0x3162('0x7e')][_0x3162('0x41')]({'where':{'name':{'$or':[_0x3162('0x2a'),'Telephones']},'userProfileId':_0x42e4ef[_0x3162('0x29')]['userProfileId']},'raw':!![]})[_0x3162('0x23')](function(_0x5aa57b){if(_[_0x3162('0x82')](_0x5aa57b)||!_[_0x3162('0x80')](_0x5aa57b,[_0x3162('0x83'),0x0]))return _0x5308d1;_0x4e5420=[];var _0x591bb7=_(_0x5aa57b)[_0x3162('0x37')](function(_0x23c591){if(_0x23c591[_0x3162('0x83')]===0x1)return;return _0x23c591[_0x3162('0x31')]==='Agents'?_0x3162('0x6b'):_0x3162('0x2c');})['compact']()[_0x3162('0x2f')]();for(var _0x21a6e6=0x0;_0x21a6e6<_0x5308d1[_0x3162('0x65')];_0x21a6e6++){if(!_[_0x3162('0x3e')](_0x591bb7,_0x5308d1[_0x21a6e6][_0x3162('0x26')]))return;var _0x197427=_0x5308d1[_0x21a6e6][_0x3162('0x26')]===_0x3162('0x6b')?_0x3162('0x2a'):_0x3162('0x2b');_0x4e5420['push'](db[_0x3162('0x32')][_0x3162('0x77')]({'name':_0x5308d1[_0x21a6e6][_0x3162('0x31')],'resourceId':_0x5308d1[_0x21a6e6]['id'],'type':_0x197427,'sectionId':_[_0x3162('0x30')](_0x5aa57b,[_0x3162('0x31'),_0x197427])['id']},{}));}return BPromise[_0x3162('0x49')](_0x4e5420);});})[_0x3162('0x23')](respondWithResult(_0x528bf6,0xc9))[_0x3162('0x4a')](handleError(_0x528bf6,null));};exports['changePassword']=function(_0x2d179b,_0x3f0764){if(_0x2d179b['body']['id']){delete _0x2d179b[_0x3162('0x56')]['id'];}return db[_0x3162('0x36')][_0x3162('0x30')]({'where':{'id':_0x2d179b[_0x3162('0x57')]['id']}})[_0x3162('0x23')](function(_0x54305b){if(!_0x54305b)return null;if(_0x54305b['id']===_0x2d179b[_0x3162('0x29')]['id']){if(!_0x2d179b[_0x3162('0x56')]['oldPassword']||!_0x2d179b[_0x3162('0x56')][_0x3162('0x84')]){throw new db[(_0x3162('0x85'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x54305b[_0x3162('0x86')](_0x2d179b[_0x3162('0x56')]['oldPassword'])){throw new db[(_0x3162('0x85'))][(_0x3162('0x87'))](_0x3162('0x88'));}if(_0x2d179b[_0x3162('0x56')][_0x3162('0x89')]===_0x2d179b[_0x3162('0x56')][_0x3162('0x84')]){throw new db[(_0x3162('0x85'))][(_0x3162('0x87'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x2d179b[_0x3162('0x29')][_0x3162('0x26')]==='admin'){if(!_0x2d179b[_0x3162('0x56')][_0x3162('0x84')]){throw new db[(_0x3162('0x85'))][(_0x3162('0x87'))](_0x3162('0x8a'));}}else if(_0x2d179b[_0x3162('0x29')][_0x3162('0x26')]===_0x3162('0x29')){if(!_0x2d179b[_0x3162('0x56')][_0x3162('0x84')]){throw new db[(_0x3162('0x85'))][(_0x3162('0x87'))](_0x3162('0x8a'));}if(_0x54305b['role']!==_0x3162('0x6b')){throw new db[(_0x3162('0x85'))]['ValidationError'](_0x3162('0x78'));}}else{throw new db['Sequelize'][(_0x3162('0x87'))](_0x3162('0x78'));}return _0x54305b;})[_0x3162('0x23')](handleEntityNotFound(_0x3f0764,null))[_0x3162('0x23')](function(_0x48f3cb){return db[_0x3162('0x5d')][_0x3162('0x8b')]({'attributes':['id',_0x3162('0x5e'),_0x3162('0x8c'),_0x3162('0x8d')]})[_0x3162('0x23')](function(_0x2618c3){if(_0x2618c3[_0x3162('0x5e')])authService[_0x3162('0x5f')](_0x2d179b[_0x3162('0x56')][_0x3162('0x84')]);if(!_0x2618c3['enforcePasswordHistory']||!_0x48f3cb[_0x3162('0x8e')])return _0x48f3cb;authService[_0x3162('0x8f')](_0x2d179b[_0x3162('0x56')][_0x3162('0x84')],_0x48f3cb['previousPasswords'],_0x2618c3[_0x3162('0x8d')]);return _0x48f3cb;})[_0x3162('0x23')](saveUpdates({'password':_0x2d179b[_0x3162('0x56')]['newPassword'],'passwordResetAt':_0x2d179b[_0x3162('0x29')]['id']==_0x2d179b[_0x3162('0x57')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2d179b[_0x3162('0x56')][_0x3162('0x84')],_0x48f3cb['previousPasswords'])},null));})[_0x3162('0x23')](respondWithResult(_0x3f0764,null))[_0x3162('0x4a')](handleError(_0x3f0764,null));};exports[_0x3162('0x90')]=function(_0x3f35d5,_0x5917d1){var _0x2d756e=_0x3f35d5[_0x3162('0x56')][_0x3162('0x91')];return db['User'][_0x3162('0x30')]({'where':{'id':_0x3f35d5[_0x3162('0x57')]['id']},'attributes':['id',_0x3162('0x31'),_0x3162('0x26'),_0x3162('0x92'),_0x3162('0x93'),_0x3162('0x94'),'interface']})[_0x3162('0x23')](handleEntityNotFound(_0x5917d1,null))[_0x3162('0x23')](function(_0x348241){if(_0x348241){if(!utils['isValidChannel'](_0x2d756e)){throw new db[(_0x3162('0x85'))][(_0x3162('0x87'))](_0x3162('0x95'));}return _0x348241['add'+_[_0x3162('0x96')](_0x2d756e[_0x3162('0x97')]())+_0x3162('0x98')](_0x3f35d5[_0x3162('0x56')][_0x3162('0x5b')],{'penalty':_0x3f35d5[_0x3162('0x56')][_0x3162('0x99')]||0x0})[_0x3162('0x9a')](function(_0x2ae412){for(var _0x2f1bc1=0x0;_0x2f1bc1<_0x3f35d5[_0x3162('0x56')][_0x3162('0x5b')][_0x3162('0x65')];_0x2f1bc1+=0x1){var _0x153f96={'UserId':Number(_0x3f35d5[_0x3162('0x57')]['id'])};_0x153f96[_[_0x3162('0x96')](_0x2d756e[_0x3162('0x97')]())+_0x3162('0x9b')]=Number(_0x3f35d5[_0x3162('0x56')][_0x3162('0x5b')][_0x2f1bc1]);socket[_0x3162('0x9c')](_0x3162('0x29')+_['capitalize'](_0x2d756e[_0x3162('0x97')]())+_0x3162('0x9d'),_0x153f96);}return _0x2ae412;})['then'](function(){if(_0x2d756e===_0x3162('0x9e')){return db[_0x3162('0x9f')][_0x3162('0x41')]({'where':{'id':_0x3f35d5[_0x3162('0x56')][_0x3162('0x5b')]||[]},'raw':!![],'attributes':['id',_0x3162('0x31')]});}})['then'](function(_0x63da70){var _0x10b7d3=_0x348241['get']({'plain':!![]});var _0x37770e=[];if(_0x2d756e==='voice'&&_0x10b7d3[_0x3162('0x26')]===_0x3162('0x6b')&&_0x10b7d3[_0x3162('0x92')]){for(var _0x46ef5a=0x0;_0x46ef5a<_0x63da70['length'];_0x46ef5a+=0x1){_0x37770e[_0x3162('0x40')]({'membername':_0x10b7d3[_0x3162('0x31')],'UserId':_0x10b7d3['id'],'queue_name':_0x63da70[_0x46ef5a][_0x3162('0x31')],'VoiceQueueId':_0x63da70[_0x46ef5a]['id'],'interface':_[_0x3162('0x66')](_0x10b7d3[_0x3162('0xa0')])?util[_0x3162('0xa1')](_0x3162('0xa2'),_0x10b7d3[_0x3162('0x31')]):_0x10b7d3['interface'],'paused':_0x10b7d3[_0x3162('0x94')]||![],'penalty':_0x3f35d5[_0x3162('0x56')][_0x3162('0x99')]||0x0});}return BPromise[_0x3162('0xa3')](_0x37770e,function(_0x57af9d){return db[_0x3162('0xa4')]['upsert'](_0x57af9d);});}return _0x348241;});}})[_0x3162('0x23')](respondWithStatusCode(_0x5917d1,null))[_0x3162('0x4a')](handleError(_0x5917d1,null));};exports[_0x3162('0xa5')]=function(_0x2b5b4d,_0x58f6bb){var _0x21e6ff;return db[_0x3162('0x36')][_0x3162('0x30')]({'where':{'id':_0x2b5b4d['params']['id']},'attributes':['id',_0x3162('0x31'),'role']})[_0x3162('0x23')](handleEntityNotFound(_0x58f6bb,null))[_0x3162('0x23')](function(_0x1d734f){if(_0x1d734f){_0x21e6ff=_0x1d734f;if(!_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x91')]||!utils[_0x3162('0xa6')](_0x2b5b4d[_0x3162('0x3c')]['channel'])){throw new db[(_0x3162('0x85'))][(_0x3162('0x87'))](_0x3162('0x95'));}return _0x1d734f[_0x3162('0xa7')+_[_0x3162('0x96')](_0x2b5b4d[_0x3162('0x3c')]['channel'][_0x3162('0x97')]())+_0x3162('0x98')](_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x5b')]);}})['then'](function(_0x46d2ab){if(_[_0x3162('0xa8')](_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x5b')])){for(var _0x2fd7a4=0x0;_0x2fd7a4<_0x2b5b4d['query']['ids'][_0x3162('0x65')];_0x2fd7a4+=0x1){var _0x2d3ffd={'UserId':Number(_0x2b5b4d[_0x3162('0x57')]['id'])};_0x2d3ffd[_['capitalize'](_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x91')][_0x3162('0x97')]())+_0x3162('0x9b')]=Number(_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x5b')][_0x2fd7a4]);socket['emit'](_0x3162('0x29')+_['capitalize'](_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x91')]['toLowerCase']())+_0x3162('0xa9'),_0x2d3ffd);}}else{var _0x2d3ffd={'UserId':Number(_0x2b5b4d[_0x3162('0x57')]['id'])};_0x2d3ffd[_['capitalize'](_0x2b5b4d['query']['channel'][_0x3162('0x97')]())+_0x3162('0x9b')]=Number(_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x5b')]);socket['emit']('user'+_[_0x3162('0x96')](_0x2b5b4d['query'][_0x3162('0x91')][_0x3162('0x97')]())+_0x3162('0xa9'),_0x2d3ffd);}return _0x46d2ab;})[_0x3162('0x23')](function(){if(_0x2b5b4d[_0x3162('0x3c')][_0x3162('0x91')]==='voice'){return db[_0x3162('0xa4')][_0x3162('0x24')]({'where':{'UserId':_0x2b5b4d['params']['id'],'VoiceQueueId':_0x2b5b4d[_0x3162('0x3c')]['ids']},'individualHooks':!![]})[_0x3162('0x23')](function(){return _0x21e6ff;});}return _0x21e6ff;})['then'](respondWithStatusCode(_0x58f6bb,null))[_0x3162('0x4a')](handleError(_0x58f6bb,null));};exports[_0x3162('0xaa')]=function(_0x10ab22,_0x563aec){_0x10ab22[_0x3162('0x56')]['userpic']=_0x10ab22['file']['filename'];return db[_0x3162('0x36')][_0x3162('0x30')]({'where':{'id':_0x10ab22[_0x3162('0x57')]['id']}})[_0x3162('0x23')](handleEntityNotFound(_0x563aec,null))[_0x3162('0x23')](saveUpdates(_0x10ab22[_0x3162('0x56')],null))[_0x3162('0x23')](respondWithResult(_0x563aec,null))[_0x3162('0x4a')](handleError(_0x563aec,null));};exports[_0x3162('0xab')]=function(_0x2d298e,_0x17be94){var _0x3f69bf=path[_0x3162('0xac')](config[_0x3162('0xad')],_0x3162('0xae'));return db[_0x3162('0x36')]['find']({'where':{'id':_0x2d298e[_0x3162('0x57')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x3162('0x23')](handleEntityNotFound(_0x17be94,null))[_0x3162('0x23')](function(_0x44781e){if(_0x44781e){if(_[_0x3162('0x66')](_0x44781e[_0x3162('0xaf')])){return _0x17be94[_0x3162('0xb0')](_0x3f69bf);}else{if(!fs[_0x3162('0xb1')](path[_0x3162('0xac')](config[_0x3162('0xad')],_0x3162('0xb2'),_0x44781e[_0x3162('0xaf')]))){return _0x17be94[_0x3162('0xb0')](_0x3f69bf);}return _0x17be94[_0x3162('0xb0')](path['join'](config['root'],_0x3162('0xb2'),_0x44781e[_0x3162('0xaf')]));}}})[_0x3162('0x4a')](handleError(_0x17be94,null));};exports['getOpenTabs']=function(_0x499e3f,_0x544631){return db[_0x3162('0x36')][_0x3162('0x30')]({'where':{'id':_0x499e3f[_0x3162('0x57')]['id']},'attributes':['id']})[_0x3162('0x23')](handleEntityNotFound(_0x544631,null))['then'](function(_0x21fbb1){var _0x5890e8=[];values=_0x21fbb1[_0x3162('0x45')];_0x5890e8['push'](get_open_tabs(_0x3162('0x44'),_0x21fbb1[_0x3162('0x45')]));_0x5890e8[_0x3162('0x40')](get_open_tabs(_0x3162('0x46'),_0x21fbb1[_0x3162('0x45')]));_0x5890e8['push'](get_open_tabs('openchannel',_0x21fbb1[_0x3162('0x45')]));_0x5890e8[_0x3162('0x40')](get_open_tabs(_0x3162('0x48'),_0x21fbb1[_0x3162('0x45')]));_0x5890e8[_0x3162('0x40')](get_open_tabs('fax',_0x21fbb1[_0x3162('0x45')]));_0x5890e8[_0x3162('0x40')](get_open_tabs(_0x3162('0x55'),_0x21fbb1[_0x3162('0x45')]));return BPromise[_0x3162('0x49')](_0x5890e8);})[_0x3162('0x23')](function(_0x4f94b2){var _0x1954b7=[];if(_0x4f94b2){for(var _0x282428=0x0;_0x282428=_0x1e24f2[_0x362c('0x53')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x362c('0x10')](function(){if(_0xa652ba){return db[_0x362c('0x3f')]['destroy']({'where':{'membername':_0xa652ba['name']},'individualHooks':!![]});}})[_0x362c('0x10')](function(){if(_0xa652ba){return _0xa652ba[_0x362c('0x54')]({'raw':!![]});}})[_0x362c('0x10')](function(_0x3ef3d9){if(_0xa652ba){if(_0x3ef3d9){var _0x59cf5b=[];_0x50ee8e=_0x3ef3d9;if(_0x50ee8e[_0x362c('0x2d')]){for(var _0x456064=0x0;_0x456064<_0x50ee8e['length'];_0x456064++){_0x59cf5b[_0x362c('0x32')](db[_0x362c('0x3f')][_0x362c('0x55')]({'membername':_0xa652ba[_0x362c('0x2c')],'UserId':_0xa652ba['id'],'queue_name':_0x50ee8e[_0x456064][_0x362c('0x2c')],'VoiceQueueId':_0x50ee8e[_0x456064]['id'],'interface':_0x1e69c0,'paused':_0xa652ba['loginInPause']||![],'penalty':_0x50ee8e[_0x456064][_0x362c('0x56')]||0x0}));}return BPromise[_0x362c('0x48')](_0x59cf5b);}}}})[_0x362c('0x10')](function(){if(_0xa652ba){return db[_0x362c('0x2b')]['findAll']({'where':{'membername':_0xa652ba[_0x362c('0x2c')],'exitAt':null}});}})[_0x362c('0x10')](function(_0x692ff2){if(_0xa652ba){if(_0x692ff2&&_0x692ff2[_0x362c('0x2d')]){var _0x10e40f=[];_0x692ff2[_0x362c('0x31')](function(_0x36b1aa){_0x10e40f[_0x362c('0x32')](_0x36b1aa[_0x362c('0x40')]({'exitAt':moment()[_0x362c('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x362c('0x48')](_0x10e40f);}}})[_0x362c('0x10')](function(_0x1516c6){if(_0xa652ba){var _0x83287c=[];var _0x3dba92=[];var _0x5b3748=utils['getChannels']();var _0x81e8e6={'membername':_0xa652ba['name'],'interface':_0x1e69c0,'enterAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'role':_0xa652ba[_0x362c('0x29')],'internal':_0xa652ba[_0x362c('0x2a')]};_0x5b3748['forEach'](function(_0x5b9276){_0x83287c[_0x362c('0x32')](_[_0x362c('0x57')]({'channel':_0x5b9276,'type':'LOGIN','data1':_0x362c('0x58'),'data2':_0x1e69c0},_0x81e8e6));if(_0xa652ba[_0x362c('0x4d')]){_0x3dba92[_0x362c('0x32')](_['merge']({'channel':_0x5b9276,'type':_0x362c('0x34'),'data1':_0x362c('0x59')},_0x81e8e6));}});return db['MemberReport'][_0x362c('0x38')](_0x83287c[_0x362c('0x5a')](_0x3dba92),{'individualHooks':!![]});}})[_0x362c('0x10')](function(){if(_0xa652ba){return _0xa652ba['update']({'online':!![],'lastLoginAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'voicePause':_0xa652ba['loginInPause']||![],'mailPause':_0xa652ba['loginInPause']||![],'chatPause':_0xa652ba[_0x362c('0x4d')]||![],'faxPause':_0xa652ba[_0x362c('0x4d')]||![],'smsPause':_0xa652ba['loginInPause']||![],'openchannelPause':_0xa652ba[_0x362c('0x4d')]||![],'pauseType':_0xa652ba[_0x362c('0x4d')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x362c('0x2e')](_0x362c('0x2f')),'interface':_0x1e69c0});}})['then'](function(_0x13a0df){_0x5468ae(_0x13a0df);})[_0x362c('0x1a')](function(_0x198d90){_0x1dfbea(_0x1dd853['error'](0x1f4,_0x198d90['message']));});});}; \ No newline at end of file +var _0x8f19=['Unknown\x20channel','voice','system','mail','chat','fax','sms','whatsapp','set','%s%s','Pause','all','destroy','phone','internal','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowUser','PauseUser','find','name','role','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','getChannels','forEach','push','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','channel'];(function(_0x490893,_0x30e994){var _0x32f3ac=function(_0x21076c){while(--_0x21076c){_0x490893['push'](_0x490893['shift']());}};_0x32f3ac(++_0x30e994);}(_0x8f19,0x78));var _0x98f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x98f1('0x0'));var util=require(_0x98f1('0x1'));var moment=require(_0x98f1('0x2'));var BPromise=require(_0x98f1('0x3'));var rs=require(_0x98f1('0x4'));var fs=require('fs');var Redis=require(_0x98f1('0x5'));var db=require(_0x98f1('0x6'))['db'];var utils=require(_0x98f1('0x7'));var logger=require(_0x98f1('0x8'))(_0x98f1('0x9'));var config=require(_0x98f1('0xa'));var jayson=require(_0x98f1('0xb'));var client=jayson['client'][_0x98f1('0xc')]({'port':0x232a});config[_0x98f1('0xd')]=_['defaults'](config[_0x98f1('0xd')],{'host':_0x98f1('0xe'),'port':0x18eb});var socket=require(_0x98f1('0xf'))(new Redis(config[_0x98f1('0xd')]));require(_0x98f1('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e9895,_0x208e55,_0x5c19e1){return new BPromise(function(_0x27c278,_0x35897){return client[_0x98f1('0x11')](_0x3e9895,_0x5c19e1)[_0x98f1('0x12')](function(_0x26062f){logger[_0x98f1('0x13')](_0x98f1('0x14'),_0x208e55,_0x98f1('0x15'));logger[_0x98f1('0x16')](_0x98f1('0x17'),_0x208e55,_0x98f1('0x15'),JSON['stringify'](_0x26062f));if(_0x26062f[_0x98f1('0x18')]){if(_0x26062f[_0x98f1('0x18')]['code']===0x1f4){logger[_0x98f1('0x18')]('User,\x20%s,\x20%s',_0x208e55,_0x26062f[_0x98f1('0x18')][_0x98f1('0x19')]);return _0x35897(_0x26062f['error'][_0x98f1('0x19')]);}logger[_0x98f1('0x18')](_0x98f1('0x14'),_0x208e55,_0x26062f[_0x98f1('0x18')][_0x98f1('0x19')]);return _0x27c278(_0x26062f['error'][_0x98f1('0x19')]);}else{logger[_0x98f1('0x13')](_0x98f1('0x14'),_0x208e55,_0x98f1('0x15'));_0x27c278(_0x26062f[_0x98f1('0x1a')][_0x98f1('0x19')]);}})[_0x98f1('0x1b')](function(_0x2758e6){logger[_0x98f1('0x18')]('User,\x20%s,\x20%s',_0x208e55,_0x2758e6);_0x35897(_0x2758e6);});});}exports[_0x98f1('0x1c')]=function(_0x5df8b6){var _0x51a0dc=this;return new Promise(function(_0x51823a,_0x47a091){return db[_0x98f1('0x1d')][_0x98f1('0x1e')]({'raw':_0x5df8b6[_0x98f1('0x1f')]?_0x5df8b6[_0x98f1('0x1f')][_0x98f1('0x20')]===undefined?!![]:![]:!![],'where':_0x5df8b6['options']?_0x5df8b6[_0x98f1('0x1f')][_0x98f1('0x21')]||null:null,'attributes':_0x5df8b6[_0x98f1('0x1f')]?_0x5df8b6[_0x98f1('0x1f')][_0x98f1('0x22')]||null:null,'limit':_0x5df8b6[_0x98f1('0x1f')]?_0x5df8b6['options'][_0x98f1('0x23')]||null:null,'include':_0x5df8b6[_0x98f1('0x1f')]?_0x5df8b6[_0x98f1('0x1f')][_0x98f1('0x24')]?_[_0x98f1('0x25')](_0x5df8b6[_0x98f1('0x1f')]['include'],function(_0x607a66){return{'model':db[_0x607a66[_0x98f1('0x26')]],'as':_0x607a66['as'],'attributes':_0x607a66[_0x98f1('0x22')],'include':_0x607a66[_0x98f1('0x24')]?_[_0x98f1('0x25')](_0x607a66['include'],function(_0x378ff5){return{'model':db[_0x378ff5[_0x98f1('0x26')]],'as':_0x378ff5['as'],'attributes':_0x378ff5[_0x98f1('0x22')],'include':_0x378ff5[_0x98f1('0x24')]?_[_0x98f1('0x25')](_0x378ff5[_0x98f1('0x24')],function(_0x341ced){return{'model':db[_0x341ced[_0x98f1('0x26')]],'as':_0x341ced['as'],'attributes':_0x341ced[_0x98f1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x98f1('0x12')](function(_0x478acf){logger[_0x98f1('0x13')](_0x98f1('0x1c'),_0x5df8b6);logger[_0x98f1('0x16')](_0x98f1('0x1c'),_0x5df8b6,JSON[_0x98f1('0x27')](_0x478acf));_0x51823a(_0x478acf);})[_0x98f1('0x1b')](function(_0xc08753){logger['error'](_0x98f1('0x1c'),_0xc08753[_0x98f1('0x19')],_0x5df8b6);_0x47a091(_0x51a0dc['error'](0x1f4,_0xc08753[_0x98f1('0x19')]));});});};exports[_0x98f1('0x28')]=function(_0x9107ed){var _0x56cec1=this;return new Promise(function(_0x14b211,_0x2cc4ac){return db[_0x98f1('0x1d')]['find']({'raw':_0x9107ed[_0x98f1('0x1f')]?_0x9107ed[_0x98f1('0x1f')][_0x98f1('0x20')]===undefined?!![]:![]:!![],'where':_0x9107ed[_0x98f1('0x1f')]?_0x9107ed[_0x98f1('0x1f')][_0x98f1('0x21')]||null:null,'attributes':_0x9107ed[_0x98f1('0x1f')]?_0x9107ed[_0x98f1('0x1f')]['attributes']||null:null,'include':_0x9107ed[_0x98f1('0x1f')]?_0x9107ed[_0x98f1('0x1f')][_0x98f1('0x24')]?_['map'](_0x9107ed[_0x98f1('0x1f')][_0x98f1('0x24')],function(_0x333255){return{'model':db[_0x333255[_0x98f1('0x26')]],'as':_0x333255['as'],'attributes':_0x333255[_0x98f1('0x22')],'include':_0x333255[_0x98f1('0x24')]?_[_0x98f1('0x25')](_0x333255[_0x98f1('0x24')],function(_0x3c6c04){return{'model':db[_0x3c6c04[_0x98f1('0x26')]],'as':_0x3c6c04['as'],'attributes':_0x3c6c04[_0x98f1('0x22')],'include':_0x3c6c04[_0x98f1('0x24')]?_[_0x98f1('0x25')](_0x3c6c04[_0x98f1('0x24')],function(_0x11e140){return{'model':db[_0x11e140[_0x98f1('0x26')]],'as':_0x11e140['as'],'attributes':_0x11e140[_0x98f1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x98f1('0x12')](function(_0x999116){logger[_0x98f1('0x13')](_0x98f1('0x28'),_0x9107ed);logger[_0x98f1('0x16')](_0x98f1('0x28'),_0x9107ed,JSON[_0x98f1('0x27')](_0x999116));_0x14b211(_0x999116);})[_0x98f1('0x1b')](function(_0x506e43){logger['error']('ShowUser',_0x506e43[_0x98f1('0x19')],_0x9107ed);_0x2cc4ac(_0x56cec1[_0x98f1('0x18')](0x1f4,_0x506e43['message']));});});};exports[_0x98f1('0x29')]=function(_0x81a5e5){var _0x2a4489=this;return new Promise(function(_0x21e51c,_0x26025a){var _0x1179b8;return db[_0x98f1('0x1d')][_0x98f1('0x2a')]({'where':_0x81a5e5[_0x98f1('0x1f')][_0x98f1('0x21')]||{},'attributes':['id',_0x98f1('0x2b'),_0x98f1('0x2c'),'internal',_0x98f1('0x2d')]})[_0x98f1('0x12')](function(_0x39e059){if(_0x39e059){_0x1179b8=_0x39e059;return db[_0x98f1('0x2e')][_0x98f1('0x2f')]({'paused':0x1},{'where':{'UserId':_0x1179b8['id']},'individualHooks':!![]});}})['then'](function(){if(_0x1179b8){return db[_0x98f1('0x30')][_0x98f1('0x1e')]({'where':{'membername':_0x1179b8[_0x98f1('0x2b')],'type':_0x98f1('0x31'),'exitAt':null}});}})[_0x98f1('0x12')](function(_0x15423a){if(_0x1179b8){if(_0x15423a&&_0x15423a['length']){var _0x49d5fb=moment()[_0x98f1('0x32')](_0x98f1('0x33'));for(var _0x170c09=0x0,_0xc6103b=_0x15423a[_0x98f1('0x34')];_0x170c09<_0xc6103b;_0x170c09++){_0x15423a[_0x170c09]['updateAttributes']({'exitAt':_0x49d5fb});}}}})[_0x98f1('0x12')](function(){if(_0x1179b8){var _0x5cef1a=[];var _0x40634f=utils[_0x98f1('0x35')]();_0x40634f[_0x98f1('0x36')](function(_0x4caab1){_0x5cef1a[_0x98f1('0x37')]({'channel':_0x4caab1,'membername':_0x1179b8[_0x98f1('0x2b')],'interface':_['isNil'](_0x1179b8['interface'])?util[_0x98f1('0x32')](_0x98f1('0x38'),_0x1179b8['name']):_0x1179b8[_0x98f1('0x2d')],'type':_0x98f1('0x31'),'enterAt':moment()[_0x98f1('0x32')](_0x98f1('0x33')),'data1':_0x81a5e5[_0x98f1('0x39')][_0x98f1('0x3a')]||_0x98f1('0x3b'),'role':_0x1179b8[_0x98f1('0x2c')],'internal':_0x1179b8['internal'],'uniqueid':_0x81a5e5[_0x98f1('0x39')][_0x98f1('0x3c')]||null});});return db[_0x98f1('0x30')][_0x98f1('0x3d')](_0x5cef1a,{'individualHooks':!![]});}})[_0x98f1('0x12')](function(){if(_0x1179b8){return _0x1179b8[_0x98f1('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x81a5e5[_0x98f1('0x39')][_0x98f1('0x3a')]||_0x98f1('0x3b'),'lastPauseAt':moment()['format'](_0x98f1('0x33'))});}})[_0x98f1('0x12')](function(_0x35b3dc){_0x21e51c(_0x35b3dc);})[_0x98f1('0x1b')](function(_0x2ac3e3){_0x26025a(_0x2a4489[_0x98f1('0x18')](0x1f4,_0x2ac3e3[_0x98f1('0x19')]));});});};exports[_0x98f1('0x3e')]=function(_0xb9feb2){var _0x3fcbd5=this;return new Promise(function(_0x1fec34,_0x1e5ff0){var _0x334c0f;return db[_0x98f1('0x1d')]['findOne']({'where':_0xb9feb2[_0x98f1('0x1f')][_0x98f1('0x21')]||{},'attributes':['id',_0x98f1('0x2b')]})[_0x98f1('0x12')](function(_0x133a99){if(_0x133a99){_0x334c0f=_0x133a99;if(_0xb9feb2[_0x98f1('0x39')][_0x98f1('0x3f')]&&!utils['isValidChannel'](_0xb9feb2[_0x98f1('0x39')][_0x98f1('0x3f')])){throw new Error(_0x98f1('0x40'));}switch(_0xb9feb2[_0x98f1('0x39')][_0x98f1('0x3f')]){case _0x98f1('0x41'):return db[_0x98f1('0x2e')][_0x98f1('0x2f')]({'paused':0x0},{'where':{'UserId':_0x334c0f['id']}})['then'](function(){return db['MemberReport'][_0x98f1('0x2a')]({'where':{'channel':_0xb9feb2['body'][_0x98f1('0x3f')],'membername':_0x334c0f['name'],'type':_0x98f1('0x31'),'exitAt':null}});})['then'](function(_0x37af37){if(_0x37af37){return _0x37af37['update']({'exitAt':moment()[_0x98f1('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x98f1('0x42')},{'individualHooks':!![]});}return null;})[_0x98f1('0x12')](function(){return _0x334c0f[_0x98f1('0x2f')]({'voicePause':![]});});case _0x98f1('0x43'):case _0x98f1('0x44'):case _0x98f1('0x45'):case _0x98f1('0x46'):case'openchannel':case _0x98f1('0x47'):return db['MemberReport']['find']({'where':{'channel':_0xb9feb2[_0x98f1('0x39')]['channel'],'membername':_0x334c0f[_0x98f1('0x2b')],'type':_0x98f1('0x31'),'exitAt':null}})[_0x98f1('0x12')](function(_0x59f388){return _0x59f388[_0x98f1('0x2f')]({'exitAt':moment()['format'](_0x98f1('0x33')),'data2':_0x98f1('0x42')},{'individualHooks':!![]});})[_0x98f1('0x12')](function(){var _0x273c29={};_[_0x98f1('0x48')](_0x273c29,util['format'](_0x98f1('0x49'),_0xb9feb2[_0x98f1('0x39')][_0x98f1('0x3f')],_0x98f1('0x4a')),![]);return _0x334c0f['update'](_0x273c29);});default:return db[_0x98f1('0x2e')]['update']({'paused':0x0},{'where':{'UserId':_0x334c0f['id']}})[_0x98f1('0x12')](function(){return db[_0x98f1('0x30')]['findAll']({'where':{'membername':_0x334c0f[_0x98f1('0x2b')],'type':_0x98f1('0x31'),'exitAt':null}});})[_0x98f1('0x12')](function(_0x347918){var _0x23cda7=[];_0x347918['forEach'](function(_0x2760c3){_0x23cda7[_0x98f1('0x37')](_0x2760c3[_0x98f1('0x2f')]({'exitAt':moment()[_0x98f1('0x32')](_0x98f1('0x33')),'data2':_0x98f1('0x42')}));});return BPromise[_0x98f1('0x4b')](_0x23cda7);})[_0x98f1('0x12')](function(){return _0x334c0f[_0x98f1('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x98f1('0x12')](function(_0x3dd752){_0x1fec34(_0x3dd752);})[_0x98f1('0x1b')](function(_0x36342c){_0x1e5ff0(_0x3fcbd5[_0x98f1('0x18')](0x1f4,_0x36342c['message']));});});};exports['LogoutUser']=function(_0x440366){var _0x4fb7a7=this;return new Promise(function(_0x2c8819,_0x37a6cb){var _0x5b8498;return db['User']['findOne']({'where':_0x440366[_0x98f1('0x1f')]['where']||{},'attributes':['id',_0x98f1('0x2b')]})[_0x98f1('0x12')](function(_0x127eef){if(_0x127eef){_0x5b8498=_0x127eef;return db['UserVoiceQueueRt'][_0x98f1('0x4c')]({'where':{'membername':_0x5b8498[_0x98f1('0x2b')]},'individualHooks':!![]});}})[_0x98f1('0x12')](function(){if(_0x5b8498){return db['MemberReport']['findAll']({'where':{'membername':_0x5b8498[_0x98f1('0x2b')],'exitAt':null}});}})[_0x98f1('0x12')](function(_0xfd371a){if(_0x5b8498){if(_0xfd371a&&_0xfd371a[_0x98f1('0x34')]){var _0x3e5093=[];_0xfd371a[_0x98f1('0x36')](function(_0x2c71c3){_0x3e5093[_0x98f1('0x37')](_0x2c71c3[_0x98f1('0x2f')]({'exitAt':moment()[_0x98f1('0x32')](_0x98f1('0x33'))}));});return BPromise['all'](_0x3e5093);}}})[_0x98f1('0x12')](function(){if(_0x5b8498){return _0x5b8498[_0x98f1('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x98f1('0x12')](function(_0x3440d1){_0x2c8819(_0x3440d1);})[_0x98f1('0x1b')](function(_0x31fa18){_0x37a6cb(_0x4fb7a7['error'](0x1f4,_0x31fa18['message']));});});};exports['LoginUser']=function(_0x5d2034){var _0x3d4e6a=this;return new Promise(function(_0x31495e,_0xdb079f){var _0x337ff1;var _0x40ecd1;var _0x38c191;var _0x3be654;return db[_0x98f1('0x1d')]['findOne']({'where':_0x5d2034['options'][_0x98f1('0x21')]||{},'attributes':['id','name',_0x98f1('0x2c'),'mobile',_0x98f1('0x4d'),_0x98f1('0x4e'),_0x98f1('0x4f'),_0x98f1('0x2d')]})[_0x98f1('0x12')](function(_0x46c670){if(_0x46c670){_0x337ff1=_0x46c670;_0x3be654=_0x5d2034[_0x98f1('0x39')][_0x98f1('0x2d')]?_0x5d2034[_0x98f1('0x39')][_0x98f1('0x2d')]:util['format']('SIP/%s',_0x337ff1['name']);return db[_0x98f1('0x1d')][_0x98f1('0x50')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x337ff1['id']}}});}})['then'](function(_0xfeee26){if(_0xfeee26){_0x38c191=_0xfeee26;return require(_0x98f1('0x51'))[_0x98f1('0x52')]();}})[_0x98f1('0x12')](function(_0x3b5fa2){if(_0x3b5fa2&&_0x3b5fa2[_0x98f1('0x53')]&&_0x38c191>=_0x3b5fa2[_0x98f1('0x53')]){throw new Error(_0x98f1('0x54'));}})[_0x98f1('0x12')](function(){if(_0x337ff1){return db[_0x98f1('0x2e')][_0x98f1('0x4c')]({'where':{'membername':_0x337ff1[_0x98f1('0x2b')]},'individualHooks':!![]});}})[_0x98f1('0x12')](function(){if(_0x337ff1){return _0x337ff1[_0x98f1('0x55')]({'raw':!![]});}})[_0x98f1('0x12')](function(_0x3d43cd){if(_0x337ff1){if(_0x3d43cd){var _0x2b00e8=[];_0x40ecd1=_0x3d43cd;if(_0x40ecd1[_0x98f1('0x34')]){for(var _0x25bdb6=0x0;_0x25bdb6<_0x40ecd1['length'];_0x25bdb6++){_0x2b00e8[_0x98f1('0x37')](db['UserVoiceQueueRt']['upsert']({'membername':_0x337ff1[_0x98f1('0x2b')],'UserId':_0x337ff1['id'],'queue_name':_0x40ecd1[_0x25bdb6][_0x98f1('0x2b')],'VoiceQueueId':_0x40ecd1[_0x25bdb6]['id'],'interface':_0x3be654,'paused':_0x337ff1['loginInPause']||![],'penalty':_0x40ecd1[_0x25bdb6][_0x98f1('0x56')]||0x0}));}return BPromise['all'](_0x2b00e8);}}}})['then'](function(){if(_0x337ff1){return db[_0x98f1('0x30')][_0x98f1('0x1e')]({'where':{'membername':_0x337ff1['name'],'exitAt':null}});}})[_0x98f1('0x12')](function(_0x3af5e3){if(_0x337ff1){if(_0x3af5e3&&_0x3af5e3['length']){var _0x58bcd4=[];_0x3af5e3[_0x98f1('0x36')](function(_0x1348ad){_0x58bcd4['push'](_0x1348ad[_0x98f1('0x2f')]({'exitAt':moment()[_0x98f1('0x32')](_0x98f1('0x33'))}));});return BPromise[_0x98f1('0x4b')](_0x58bcd4);}}})[_0x98f1('0x12')](function(_0x47ab81){if(_0x337ff1){var _0x42bdfd=[];var _0xaaf28=[];var _0x3313dc=utils[_0x98f1('0x35')]();var _0x549df4={'membername':_0x337ff1['name'],'interface':_0x3be654,'enterAt':moment()[_0x98f1('0x32')](_0x98f1('0x33')),'role':_0x337ff1['role'],'internal':_0x337ff1[_0x98f1('0x4e')]};_0x3313dc[_0x98f1('0x36')](function(_0x32b4f2){_0x42bdfd[_0x98f1('0x37')](_[_0x98f1('0x57')]({'channel':_0x32b4f2,'type':_0x98f1('0x58'),'data1':_0x98f1('0x59'),'data2':_0x3be654},_0x549df4));if(_0x337ff1['loginInPause']){_0xaaf28[_0x98f1('0x37')](_[_0x98f1('0x57')]({'channel':_0x32b4f2,'type':_0x98f1('0x31'),'data1':_0x98f1('0x5a')},_0x549df4));}});return db[_0x98f1('0x30')]['bulkCreate'](_0x42bdfd[_0x98f1('0x5b')](_0xaaf28),{'individualHooks':!![]});}})[_0x98f1('0x12')](function(){if(_0x337ff1){return _0x337ff1[_0x98f1('0x2f')]({'online':!![],'lastLoginAt':moment()[_0x98f1('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x337ff1[_0x98f1('0x4f')]||![],'mailPause':_0x337ff1[_0x98f1('0x4f')]||![],'chatPause':_0x337ff1[_0x98f1('0x4f')]||![],'faxPause':_0x337ff1['loginInPause']||![],'smsPause':_0x337ff1[_0x98f1('0x4f')]||![],'openchannelPause':_0x337ff1[_0x98f1('0x4f')]||![],'pauseType':_0x337ff1[_0x98f1('0x4f')]?_0x98f1('0x5a'):null,'lastPauseAt':moment()['format'](_0x98f1('0x33')),'interface':_0x3be654});}})['then'](function(_0x2d3ab5){_0x31495e(_0x2d3ab5);})[_0x98f1('0x1b')](function(_0x19dce1){_0xdb079f(_0x3d4e6a[_0x98f1('0x18')](0x1f4,_0x19dce1['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9ec4894..c0e31c1 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 _0x7b66=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x3fd2b4,_0x2a4116){var _0x18b688=function(_0x8279e8){while(--_0x8279e8){_0x3fd2b4['push'](_0x3fd2b4['shift']());}};_0x18b688(++_0x2a4116);}(_0x7b66,0x10d));var _0x67b6=function(_0x3248aa,_0x56468c){_0x3248aa=_0x3248aa-0x0;var _0x1147a5=_0x7b66[_0x3248aa];return _0x1147a5;};'use strict';var UserEvents=require(_0x67b6('0x0'));var events=[_0x67b6('0x1'),_0x67b6('0x2'),_0x67b6('0x3')];function createListener(_0x5c7f79,_0x5276f5){return function(_0x560fe6){_0x5276f5['emit'](_0x5c7f79,_0x560fe6);};}function removeListener(_0x276325,_0x3f5335){return function(){UserEvents[_0x67b6('0x4')](_0x276325,_0x3f5335);};}exports[_0x67b6('0x5')]=function(_0x1e7983){for(var _0xad90c0=0x0,_0x4b04a4=events[_0x67b6('0x6')];_0xad90c0<_0x4b04a4;_0xad90c0++){var _0x2143fd=events[_0xad90c0];var _0x53d285=createListener(_0x67b6('0x7')+_0x2143fd,_0x1e7983);UserEvents['on'](_0x2143fd,_0x53d285);}}; \ No newline at end of file +var _0x16a1=['removeListener','register','user:','save','update','emit'];(function(_0xe65b88,_0x4898f2){var _0x468393=function(_0xcb023c){while(--_0xcb023c){_0xe65b88['push'](_0xe65b88['shift']());}};_0x468393(++_0x4898f2);}(_0x16a1,0xab));var _0x116a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x16a1[_0x618414];return _0x21c19a;};'use strict';var UserEvents=require('./user.events');var events=[_0x116a('0x0'),'remove',_0x116a('0x1')];function createListener(_0x4339e7,_0x32afaa){return function(_0x54cc11){_0x32afaa[_0x116a('0x2')](_0x4339e7,_0x54cc11);};}function removeListener(_0x21dffd,_0x36e7a7){return function(){UserEvents[_0x116a('0x3')](_0x21dffd,_0x36e7a7);};}exports[_0x116a('0x4')]=function(_0x2eba9a){for(var _0x39c828=0x0,_0x415c17=events['length'];_0x39c828<_0x415c17;_0x39c828++){var _0x1655e3=events[_0x39c828];var _0x1bcad8=createListener(_0x116a('0x5')+_0x1655e3,_0x2eba9a);UserEvents['on'](_0x1655e3,_0x1bcad8);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index bb4b976..9828a6c 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5cad3f,_0x178b11){var _0x2b3e9d=function(_0x57179b){while(--_0x57179b){_0x5cad3f['push'](_0x5cad3f['shift']());}};_0x2b3e9d(++_0x178b11);}(_0x70e0,0x17b));var _0x070e=function(_0x5fac1d,_0x42f6e9){_0x5fac1d=_0x5fac1d-0x0;var _0x1c021a=_0x70e0[_0x5fac1d];return _0x1c021a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x55a787,_0x1466a3){var _0x5d90a0=function(_0x5405fb){while(--_0x5405fb){_0x55a787['push'](_0x55a787['shift']());}};_0x5d90a0(++_0x1466a3);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 2be4041..4c6a7b7 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 _0xeb2c=['INTEGER','sequelize'];(function(_0x3f624f,_0x369ab0){var _0x1b99e7=function(_0x2a8093){while(--_0x2a8093){_0x3f624f['push'](_0x3f624f['shift']());}};_0x1b99e7(++_0x369ab0);}(_0xeb2c,0x105));var _0xceb2=function(_0x44a440,_0x21ddad){_0x44a440=_0x44a440-0x0;var _0x53df80=_0xeb2c[_0x44a440];return _0x53df80;};'use strict';var Sequelize=require(_0xceb2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xceb2('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc9b0=['exports','INTEGER','sequelize'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0xc9b0,0x143));var _0x0c9b=function(_0x1029b2,_0x2edb16){_0x1029b2=_0x1029b2-0x0;var _0x5bb8f0=_0xc9b0[_0x1029b2];return _0x5bb8f0;};'use strict';var Sequelize=require(_0x0c9b('0x0'));module[_0x0c9b('0x1')]={'penalty':{'type':Sequelize[_0x0c9b('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 3e7ee59..a354566 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 _0xb155=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xea8476,_0x187479){var _0x307e6f=function(_0x13262d){while(--_0x13262d){_0xea8476['push'](_0xea8476['shift']());}};_0x307e6f(++_0x187479);}(_0xb155,0x198));var _0x5b15=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xb155[_0x34b821];return _0x5e00a0;};'use strict';var _=require(_0x5b15('0x0'));var util=require(_0x5b15('0x1'));var logger=require(_0x5b15('0x2'))(_0x5b15('0x3'));var moment=require(_0x5b15('0x4'));var BPromise=require(_0x5b15('0x5'));var rp=require(_0x5b15('0x6'));var fs=require('fs');var path=require(_0x5b15('0x7'));var rimraf=require(_0x5b15('0x8'));var config=require(_0x5b15('0x9'));var attributes=require(_0x5b15('0xa'));module[_0x5b15('0xb')]=function(_0x490d55,_0x18a3f4){return _0x490d55[_0x5b15('0xc')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc0c=['UserChatQueue','user_has_chat_queues','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xbc0c,0x86));var _0xcbc0=function(_0xfb3391,_0x2c72ef){_0xfb3391=_0xfb3391-0x0;var _0x45deb9=_0xbc0c[_0xfb3391];return _0x45deb9;};'use strict';var _=require(_0xcbc0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcbc0('0x1'));var BPromise=require(_0xcbc0('0x2'));var rp=require(_0xcbc0('0x3'));var fs=require('fs');var path=require(_0xcbc0('0x4'));var rimraf=require(_0xcbc0('0x5'));var config=require(_0xcbc0('0x6'));var attributes=require(_0xcbc0('0x7'));module[_0xcbc0('0x8')]=function(_0x1b0747,_0x5569df){return _0x1b0747[_0xcbc0('0x9')](_0xcbc0('0xa'),attributes,{'tableName':_0xcbc0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 106e6b9..44e5661 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 _0x1eaf=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserChatQueue,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x567849,_0x5c2294){var _0xc68d9c=function(_0x3a4ee1){while(--_0x3a4ee1){_0x567849['push'](_0x567849['shift']());}};_0xc68d9c(++_0x5c2294);}(_0x1eaf,0x17e));var _0xf1ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1eaf[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xf1ea('0x0'));var moment=require('moment');var BPromise=require(_0xf1ea('0x1'));var rs=require(_0xf1ea('0x2'));var fs=require('fs');var Redis=require(_0xf1ea('0x3'));var db=require(_0xf1ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1ea('0x5'))(_0xf1ea('0x6'));var config=require(_0xf1ea('0x7'));var jayson=require(_0xf1ea('0x8'));var client=jayson['client'][_0xf1ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x195689,_0x59457d,_0x32e4dc){return new BPromise(function(_0x312cad,_0x4739b1){return client[_0xf1ea('0xa')](_0x195689,_0x32e4dc)[_0xf1ea('0xb')](function(_0x4543ba){logger[_0xf1ea('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x59457d,_0xf1ea('0xd'));logger[_0xf1ea('0xe')](_0xf1ea('0xf'),_0x59457d,_0xf1ea('0xd'),JSON[_0xf1ea('0x10')](_0x4543ba));if(_0x4543ba[_0xf1ea('0x11')]){if(_0x4543ba['error']['code']===0x1f4){logger[_0xf1ea('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x59457d,_0x4543ba['error']['message']);return _0x4739b1(_0x4543ba[_0xf1ea('0x11')][_0xf1ea('0x12')]);}logger[_0xf1ea('0x11')](_0xf1ea('0x13'),_0x59457d,_0x4543ba['error'][_0xf1ea('0x12')]);return _0x312cad(_0x4543ba['error'][_0xf1ea('0x12')]);}else{logger[_0xf1ea('0xc')](_0xf1ea('0x13'),_0x59457d,'request\x20sent');_0x312cad(_0x4543ba[_0xf1ea('0x14')]['message']);}})[_0xf1ea('0x15')](function(_0x10a947){logger[_0xf1ea('0x11')](_0xf1ea('0x13'),_0x59457d,_0x10a947);_0x4739b1(_0x10a947);});});} \ No newline at end of file +var _0x626a=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x27cb8d,_0x3d1c1a){var _0x3f44d7=function(_0x1b9a58){while(--_0x1b9a58){_0x27cb8d['push'](_0x27cb8d['shift']());}};_0x3f44d7(++_0x3d1c1a);}(_0x626a,0x80));var _0xa626=function(_0x2b8ba3,_0x7b0bee){_0x2b8ba3=_0x2b8ba3-0x0;var _0x5e9758=_0x626a[_0x2b8ba3];return _0x5e9758;};'use strict';var _=require(_0xa626('0x0'));var util=require(_0xa626('0x1'));var moment=require('moment');var BPromise=require(_0xa626('0x2'));var rs=require(_0xa626('0x3'));var fs=require('fs');var Redis=require(_0xa626('0x4'));var db=require(_0xa626('0x5'))['db'];var utils=require(_0xa626('0x6'));var logger=require(_0xa626('0x7'))(_0xa626('0x8'));var config=require(_0xa626('0x9'));var jayson=require(_0xa626('0xa'));var client=jayson[_0xa626('0xb')][_0xa626('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x79cc40,_0x85c2ac,_0x81991d){return new BPromise(function(_0x499970,_0x1f9e40){return client['request'](_0x79cc40,_0x81991d)['then'](function(_0x63d16){logger[_0xa626('0xd')](_0xa626('0xe'),_0x85c2ac,_0xa626('0xf'));logger[_0xa626('0x10')](_0xa626('0x11'),_0x85c2ac,_0xa626('0xf'),JSON[_0xa626('0x12')](_0x63d16));if(_0x63d16[_0xa626('0x13')]){if(_0x63d16['error'][_0xa626('0x14')]===0x1f4){logger[_0xa626('0x13')](_0xa626('0xe'),_0x85c2ac,_0x63d16[_0xa626('0x13')][_0xa626('0x15')]);return _0x1f9e40(_0x63d16['error'][_0xa626('0x15')]);}logger[_0xa626('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x85c2ac,_0x63d16['error'][_0xa626('0x15')]);return _0x499970(_0x63d16[_0xa626('0x13')][_0xa626('0x15')]);}else{logger[_0xa626('0xd')](_0xa626('0xe'),_0x85c2ac,_0xa626('0xf'));_0x499970(_0x63d16[_0xa626('0x16')][_0xa626('0x15')]);}})[_0xa626('0x17')](function(_0x4e33b4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x85c2ac,_0x4e33b4);_0x1f9e40(_0x4e33b4);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2142bf3..67e2af9 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f3309,_0x5092e3){var _0x9f0fb7=function(_0x515e0c){while(--_0x515e0c){_0x4f3309['push'](_0x4f3309['shift']());}};_0x9f0fb7(++_0x5092e3);}(_0x70e0,0x17b));var _0x070e=function(_0x4dbaa0,_0x2b764e){_0x4dbaa0=_0x4dbaa0-0x0;var _0x4359ff=_0x70e0[_0x4dbaa0];return _0x4359ff;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x356307,_0xe0a012){var _0x59e722=function(_0x31348d){while(--_0x31348d){_0x356307['push'](_0x356307['shift']());}};_0x59e722(++_0xe0a012);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d21e35c..0de8d6f 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 _0x089a=['INTEGER','sequelize','exports'];(function(_0x378d3b,_0x116b94){var _0x462153=function(_0xb5658){while(--_0xb5658){_0x378d3b['push'](_0x378d3b['shift']());}};_0x462153(++_0x116b94);}(_0x089a,0x112));var _0xa089=function(_0x2f5658,_0x1935a5){_0x2f5658=_0x2f5658-0x0;var _0x54c3ed=_0x089a[_0x2f5658];return _0x54c3ed;};'use strict';var Sequelize=require(_0xa089('0x0'));module[_0xa089('0x1')]={'penalty':{'type':Sequelize[_0xa089('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdc0f=['INTEGER','exports'];(function(_0x1998ad,_0x9e6af6){var _0x612cf4=function(_0x275f46){while(--_0x275f46){_0x1998ad['push'](_0x1998ad['shift']());}};_0x612cf4(++_0x9e6af6);}(_0xdc0f,0x1af));var _0xfdc0=function(_0x5bd948,_0x478409){_0x5bd948=_0x5bd948-0x0;var _0x52771a=_0xdc0f[_0x5bd948];return _0x52771a;};'use strict';var Sequelize=require('sequelize');module[_0xfdc0('0x0')]={'penalty':{'type':Sequelize[_0xfdc0('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 924b8c5..a61191a 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 _0x497d=['api','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x497d,0xf0));var _0xd497=function(_0xa5c3a0,_0x20dd0a){_0xa5c3a0=_0xa5c3a0-0x0;var _0x3cec3d=_0x497d[_0xa5c3a0];return _0x3cec3d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd497('0x0'));var moment=require('moment');var BPromise=require(_0xd497('0x1'));var rp=require(_0xd497('0x2'));var fs=require('fs');var path=require(_0xd497('0x3'));var rimraf=require('rimraf');var config=require(_0xd497('0x4'));var attributes=require(_0xd497('0x5'));module['exports']=function(_0x1a4edb,_0xc16605){return _0x1a4edb['define'](_0xd497('0x6'),attributes,{'tableName':_0xd497('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd47=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0xdd47,0x6e));var _0x7dd4=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xdd47[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require('lodash');var util=require(_0x7dd4('0x0'));var logger=require(_0x7dd4('0x1'))(_0x7dd4('0x2'));var moment=require(_0x7dd4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dd4('0x4'));var rimraf=require(_0x7dd4('0x5'));var config=require(_0x7dd4('0x6'));var attributes=require(_0x7dd4('0x7'));module[_0x7dd4('0x8')]=function(_0x31df96,_0x38b718){return _0x31df96['define'](_0x7dd4('0x9'),attributes,{'tableName':_0x7dd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index af803b5..04b729f 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 _0x7c2a=['message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7c2a,0x17e));var _0xa7c2=function(_0x2c38a8,_0x31e01f){_0x2c38a8=_0x2c38a8-0x0;var _0x441655=_0x7c2a[_0x2c38a8];return _0x441655;};'use strict';var _=require('lodash');var util=require(_0xa7c2('0x0'));var moment=require(_0xa7c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7c2('0x2'));var fs=require('fs');var Redis=require(_0xa7c2('0x3'));var db=require(_0xa7c2('0x4'))['db'];var utils=require(_0xa7c2('0x5'));var logger=require(_0xa7c2('0x6'))(_0xa7c2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa7c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a95e,_0x46398a,_0x91791c){return new BPromise(function(_0x241315,_0x2f5d28){return client[_0xa7c2('0x9')](_0x38a95e,_0x91791c)[_0xa7c2('0xa')](function(_0x5b3b55){logger['info'](_0xa7c2('0xb'),_0x46398a,'request\x20sent');logger[_0xa7c2('0xc')](_0xa7c2('0xd'),_0x46398a,_0xa7c2('0xe'),JSON['stringify'](_0x5b3b55));if(_0x5b3b55['error']){if(_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x10')]===0x1f4){logger[_0xa7c2('0xf')](_0xa7c2('0xb'),_0x46398a,_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x11')]);return _0x2f5d28(_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x11')]);}logger[_0xa7c2('0xf')](_0xa7c2('0xb'),_0x46398a,_0x5b3b55[_0xa7c2('0xf')][_0xa7c2('0x11')]);return _0x241315(_0x5b3b55['error'][_0xa7c2('0x11')]);}else{logger[_0xa7c2('0x12')](_0xa7c2('0xb'),_0x46398a,'request\x20sent');_0x241315(_0x5b3b55['result'][_0xa7c2('0x11')]);}})['catch'](function(_0x65bb01){logger[_0xa7c2('0xf')](_0xa7c2('0xb'),_0x46398a,_0x65bb01);_0x2f5d28(_0x65bb01);});});} \ No newline at end of file +var _0x453a=['lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5d8c07,_0x59f510){var _0x49077b=function(_0x50fb55){while(--_0x50fb55){_0x5d8c07['push'](_0x5d8c07['shift']());}};_0x49077b(++_0x59f510);}(_0x453a,0xf2));var _0xa453=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0x453a[_0x51f4fc];return _0x4d96fc;};'use strict';var _=require(_0xa453('0x0'));var util=require(_0xa453('0x1'));var moment=require(_0xa453('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa453('0x3'));var db=require(_0xa453('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa453('0x5'))(_0xa453('0x6'));var config=require(_0xa453('0x7'));var jayson=require(_0xa453('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19c190,_0xa3cbbd,_0x5db01f){return new BPromise(function(_0x1af857,_0x4c2477){return client[_0xa453('0x9')](_0x19c190,_0x5db01f)[_0xa453('0xa')](function(_0x383e18){logger[_0xa453('0xb')](_0xa453('0xc'),_0xa3cbbd,'request\x20sent');logger[_0xa453('0xd')](_0xa453('0xe'),_0xa3cbbd,_0xa453('0xf'),JSON[_0xa453('0x10')](_0x383e18));if(_0x383e18[_0xa453('0x11')]){if(_0x383e18['error'][_0xa453('0x12')]===0x1f4){logger[_0xa453('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0xa3cbbd,_0x383e18[_0xa453('0x11')][_0xa453('0x13')]);return _0x4c2477(_0x383e18[_0xa453('0x11')][_0xa453('0x13')]);}logger[_0xa453('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0xa3cbbd,_0x383e18['error'][_0xa453('0x13')]);return _0x1af857(_0x383e18[_0xa453('0x11')]['message']);}else{logger[_0xa453('0xb')](_0xa453('0xc'),_0xa3cbbd,_0xa453('0xf'));_0x1af857(_0x383e18[_0xa453('0x14')][_0xa453('0x13')]);}})[_0xa453('0x15')](function(_0x414170){logger[_0xa453('0x11')](_0xa453('0xc'),_0xa3cbbd,_0x414170);_0x4c2477(_0x414170);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index b10eff0..296a4b4 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2260f3,_0x1b433c){var _0xb76562=function(_0x31409e){while(--_0x31409e){_0x2260f3['push'](_0x2260f3['shift']());}};_0xb76562(++_0x1b433c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x506f1d,_0x3d51b7){var _0x4bd262=function(_0x3ec208){while(--_0x3ec208){_0x506f1d['push'](_0x506f1d['shift']());}};_0x4bd262(++_0x3d51b7);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index bd85bdf..690bcce 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 _0xa0bf=['INTEGER','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa0bf,0xcd));var _0xfa0b=function(_0x250d2c,_0x948c48){_0x250d2c=_0x250d2c-0x0;var _0x42c1ed=_0xa0bf[_0x250d2c];return _0x42c1ed;};'use strict';var Sequelize=require('sequelize');module[_0xfa0b('0x0')]={'penalty':{'type':Sequelize[_0xfa0b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0417=['INTEGER','sequelize','exports'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x0417,0xfa));var _0x7041=function(_0x837634,_0x34ac06){_0x837634=_0x837634-0x0;var _0x593fb3=_0x0417[_0x837634];return _0x593fb3;};'use strict';var Sequelize=require(_0x7041('0x0'));module[_0x7041('0x1')]={'penalty':{'type':Sequelize[_0x7041('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 4d33c34..97a2be7 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 _0xfb18=['bluebird','request-promise','path','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment'];(function(_0x7c9eef,_0x196fbb){var _0x16c4e5=function(_0x2613a6){while(--_0x2613a6){_0x7c9eef['push'](_0x7c9eef['shift']());}};_0x16c4e5(++_0x196fbb);}(_0xfb18,0x1f4));var _0x8fb1=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0xfb18[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x8fb1('0x0'));var util=require(_0x8fb1('0x1'));var logger=require('../../config/logger')(_0x8fb1('0x2'));var moment=require(_0x8fb1('0x3'));var BPromise=require(_0x8fb1('0x4'));var rp=require(_0x8fb1('0x5'));var fs=require('fs');var path=require(_0x8fb1('0x6'));var rimraf=require('rimraf');var config=require(_0x8fb1('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x8fb1('0x8')]=function(_0xae7a6a,_0x5f58c5){return _0xae7a6a[_0x8fb1('0x9')](_0x8fb1('0xa'),attributes,{'tableName':_0x8fb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35f9=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x271898,_0x171940){var _0x33eda7=function(_0x230fc3){while(--_0x230fc3){_0x271898['push'](_0x271898['shift']());}};_0x33eda7(++_0x171940);}(_0x35f9,0xaf));var _0x935f=function(_0x138234,_0x5be550){_0x138234=_0x138234-0x0;var _0xce30e9=_0x35f9[_0x138234];return _0xce30e9;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var logger=require(_0x935f('0x2'))(_0x935f('0x3'));var moment=require(_0x935f('0x4'));var BPromise=require(_0x935f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x935f('0x6'));var config=require(_0x935f('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x935f('0x8')]=function(_0x4bf84e,_0x47e37a){return _0x4bf84e['define'](_0x935f('0x9'),attributes,{'tableName':_0x935f('0xa'),'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 9747316..7b4dbac 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x258ac3,_0x3e7a2f){var _0x209cd9=function(_0x3d5ac1){while(--_0x3d5ac1){_0x258ac3['push'](_0x258ac3['shift']());}};_0x209cd9(++_0x3e7a2f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3cfe4d,_0x50d2bb){var _0x3e4308=function(_0x4ed564){while(--_0x4ed564){_0x3cfe4d['push'](_0x3cfe4d['shift']());}};_0x3e4308(++_0x50d2bb);}(_0x34e8,0x12c));var _0x834e=function(_0x57cd7,_0x16ac5e){_0x57cd7=_0x57cd7-0x0;var _0x27de40=_0x34e8[_0x57cd7];return _0x27de40;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 3437991..dc3cd2c 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 _0xc7b1=['../../components/interaction/service','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5c4887,_0x282565){var _0x365b8e=function(_0x224da6){while(--_0x224da6){_0x5c4887['push'](_0x5c4887['shift']());}};_0x365b8e(++_0x282565);}(_0xc7b1,0xc0));var _0x1c7b=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xc7b1[_0x380a3f];return _0x2b4eca;};'use strict';var multer=require(_0x1c7b('0x0'));var util=require(_0x1c7b('0x1'));var path=require(_0x1c7b('0x2'));var timeout=require(_0x1c7b('0x3'));var express=require(_0x1c7b('0x4'));var router=express['Router']();var fs_extra=require(_0x1c7b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c7b('0x6'));var config=require('../../config/environment');var controller=require(_0x1c7b('0x7'));router[_0x1c7b('0x8')]('/',auth[_0x1c7b('0x9')](),controller['sendUserNotification']);module[_0x1c7b('0xa')]=router; \ No newline at end of file +var _0xc2a8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x38dd19,_0x3990e5){var _0x5f2408=function(_0x5cca83){while(--_0x5cca83){_0x38dd19['push'](_0x38dd19['shift']());}};_0x5f2408(++_0x3990e5);}(_0xc2a8,0xee));var _0x8c2a=function(_0x2c386e,_0x3b07d2){_0x2c386e=_0x2c386e-0x0;var _0x2190b7=_0xc2a8[_0x2c386e];return _0x2190b7;};'use strict';var multer=require(_0x8c2a('0x0'));var util=require(_0x8c2a('0x1'));var path=require(_0x8c2a('0x2'));var timeout=require(_0x8c2a('0x3'));var express=require(_0x8c2a('0x4'));var router=express[_0x8c2a('0x5')]();var fs_extra=require(_0x8c2a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8c2a('0x7'));var config=require(_0x8c2a('0x8'));var controller=require(_0x8c2a('0x9'));router[_0x8c2a('0xa')]('/',auth[_0x8c2a('0xb')](),controller[_0x8c2a('0xc')]);module[_0x8c2a('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 f49c88d..c134f96 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 _0x477c=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x4bad3e,_0x5c88a7){var _0x4ebdb6=function(_0x1ec99b){while(--_0x1ec99b){_0x4bad3e['push'](_0x4bad3e['shift']());}};_0x4ebdb6(++_0x5c88a7);}(_0x477c,0x133));var _0xc477=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x477c[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xc477('0x0'));module[_0xc477('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xc477('0x2')]},'recipientsId':{'type':Sequelize[_0xc477('0x3')]},'recipientsDescription':{'type':Sequelize[_0xc477('0x2')]},'beep':{'type':Sequelize[_0xc477('0x4')]}}; \ No newline at end of file +var _0xdb22=['BOOLEAN','sequelize','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb22,0x85));var _0x2db2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdb22[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x2db2('0x0'));module['exports']={'body':{'type':Sequelize[_0x2db2('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2db2('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 901fc9b..94fc794 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 _0xd6c9=['voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','queue','replace','Queue','push','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','chatqueue','faxqueue','openchannelqueue','smsqueue'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xd6c9,0xe8));var _0x9d6c=function(_0x59fbe4,_0x3904b4){_0x59fbe4=_0x59fbe4-0x0;var _0x31a4aa=_0xd6c9[_0x59fbe4];return _0x31a4aa;};'use strict';var emlformat=require(_0x9d6c('0x0'));var rimraf=require(_0x9d6c('0x1'));var zipdir=require(_0x9d6c('0x2'));var jsonpatch=require(_0x9d6c('0x3'));var rp=require(_0x9d6c('0x4'));var moment=require('moment');var BPromise=require(_0x9d6c('0x5'));var Mustache=require(_0x9d6c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9d6c('0x7'));var csv=require('to-csv');var ejs=require(_0x9d6c('0x8'));var fs=require('fs');var fs_extra=require(_0x9d6c('0x9'));var _=require(_0x9d6c('0xa'));var squel=require(_0x9d6c('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d6c('0xc'));var deskjs=require(_0x9d6c('0xd'));var toCsv=require(_0x9d6c('0xe'));var querystring=require(_0x9d6c('0xf'));var Papa=require(_0x9d6c('0x10'));var Redis=require(_0x9d6c('0x11'));var authService=require(_0x9d6c('0x12'));var qs=require(_0x9d6c('0x13'));var as=require(_0x9d6c('0x14'));var hardwareService=require(_0x9d6c('0x15'));var logger=require(_0x9d6c('0x16'))(_0x9d6c('0x17'));var utils=require('../../config/utils');var config=require(_0x9d6c('0x18'));var licenseUtil=require(_0x9d6c('0x19'));var db=require('../../mysqldb')['db'];config[_0x9d6c('0x1a')]=_[_0x9d6c('0x1b')](config[_0x9d6c('0x1a')],{'host':_0x9d6c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d6c('0x1d'))[_0x9d6c('0x1e')](socket);function respondWithStatusCode(_0x37ca64,_0x563f79){_0x563f79=_0x563f79||0xcc;return function(_0x39a68a){if(_0x39a68a){return _0x37ca64['sendStatus'](_0x563f79);}return _0x37ca64[_0x9d6c('0x1f')](_0x563f79)[_0x9d6c('0x20')]();};}function respondWithResult(_0x37cc9e,_0x1403cf){_0x1403cf=_0x1403cf||0xc8;return function(_0x5a6c81){if(_0x5a6c81){return _0x37cc9e[_0x9d6c('0x1f')](_0x1403cf)[_0x9d6c('0x21')](_0x5a6c81);}};}function respondWithFilteredResult(_0x24fb15,_0x30b447){return function(_0xa584a1){if(_0xa584a1){var _0x34dab4=typeof _0x30b447[_0x9d6c('0x22')]===_0x9d6c('0x23')&&typeof _0x30b447[_0x9d6c('0x24')]===_0x9d6c('0x23');var _0x56937b=_0xa584a1[_0x9d6c('0x25')];var _0xe8d931=_0x34dab4?0x0:_0x30b447['offset'];var _0x5a8e24=_0x34dab4?_0xa584a1[_0x9d6c('0x25')]:_0x30b447[_0x9d6c('0x22')]+_0x30b447['limit'];var _0x33ebf6;if(_0x5a8e24>=_0x56937b){_0x5a8e24=_0x56937b;_0x33ebf6=0xc8;}else{_0x33ebf6=0xce;}_0x24fb15['status'](_0x33ebf6);return _0x24fb15[_0x9d6c('0x26')](_0x9d6c('0x27'),_0xe8d931+'-'+_0x5a8e24+'/'+_0x56937b)['json'](_0xa584a1);}return null;};}function patchUpdates(_0x52474a){return function(_0x4ac13d){try{jsonpatch[_0x9d6c('0x28')](_0x4ac13d,_0x52474a,!![]);}catch(_0x40638f){return BPromise[_0x9d6c('0x29')](_0x40638f);}return _0x4ac13d[_0x9d6c('0x2a')]();};}function saveUpdates(_0x31ea47,_0x581144){return function(_0x47b1c3){if(_0x47b1c3){return _0x47b1c3[_0x9d6c('0x2b')](_0x31ea47)[_0x9d6c('0x2c')](function(_0x3a76d8){return _0x3a76d8;});}return null;};}function removeEntity(_0x4568e1,_0xa91823){return function(_0x1ff5bb){if(_0x1ff5bb){return _0x1ff5bb['destroy']()[_0x9d6c('0x2c')](function(){_0x4568e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de2aa,_0x7a674c){return function(_0x32893d){if(!_0x32893d){_0x3de2aa[_0x9d6c('0x2d')](0x194);}return _0x32893d;};}function handleError(_0x7436ac,_0xa51561){_0xa51561=_0xa51561||0x1f4;return function(_0x39dcaa){logger[_0x9d6c('0x2e')](_0x39dcaa['stack']);if(_0x39dcaa[_0x9d6c('0x2f')]){delete _0x39dcaa[_0x9d6c('0x2f')];}_0x7436ac['status'](_0xa51561)['send'](_0x39dcaa);};}exports['sendUserNotification']=function(_0x2ff82e,_0xa8657e,_0x264200){if(!_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x31')]('text')&&!_0x2ff82e['body'][_0x9d6c('0x31')](_0x9d6c('0x32'))){throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x35'));}else{if(_0x2ff82e[_0x9d6c('0x30')]['hasOwnProperty'](_0x9d6c('0x32'))&&!_0x2ff82e['body'][_0x9d6c('0x31')](_0x9d6c('0x36'))){throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x37'));}if(!_0x2ff82e[_0x9d6c('0x30')]['hasOwnProperty'](_0x9d6c('0x38'))){throw new db[(_0x9d6c('0x33'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x15c816=JSON[_0x9d6c('0x39')](_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x38')]);}catch(_0x4f1ca1){logger[_0x9d6c('0x2e')](_0x4f1ca1);throw new db[(_0x9d6c('0x33'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x4b0fc9=[_0x9d6c('0x3a'),_0x9d6c('0x3b'),'mailqueue',_0x9d6c('0x3c'),_0x9d6c('0x3d'),_0x9d6c('0x3e'),_0x9d6c('0x3f'),_0x9d6c('0x40'),_0x9d6c('0x41')];if(_[_0x9d6c('0x42')](_0x15c816,function(_0x3b7fee){return!_[_0x9d6c('0x43')](_0x4b0fc9,_0x3b7fee[_0x9d6c('0x44')]['toLowerCase']());})){throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x45'));}}}var _0x21a5aa={};_0x21a5aa[_0x9d6c('0x46')]=_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x31')](_0x9d6c('0x46'))?_0x2ff82e['body'][_0x9d6c('0x46')]:_0x2ff82e[_0x9d6c('0x41')]['fullname'];_0x21a5aa['recipientsDescription']=_[_0x9d6c('0x47')](_0x2ff82e[_0x9d6c('0x30')]['recipientsDescription'])?null:_0x2ff82e['body'][_0x9d6c('0x48')];_0x21a5aa[_0x9d6c('0x49')]=_0x2ff82e[_0x9d6c('0x30')][_0x9d6c('0x49')]||![];_0x21a5aa[_0x9d6c('0x4a')]=_0x2ff82e[_0x9d6c('0x41')]['id'];return getContent(_0x2ff82e[_0x9d6c('0x30')])['then'](function(_0xded6fc){_0x21a5aa[_0x9d6c('0x30')]=_0xded6fc;return getRecipients(_0x15c816);})[_0x9d6c('0x2c')](function(_0x352bd2){_0x21a5aa[_0x9d6c('0x4b')]=_['sortBy'](_0x352bd2)['join'](',');return db[_0x9d6c('0x4c')][_0x9d6c('0x4d')](function(_0x13c7a7){return db[_0x9d6c('0x4e')][_0x9d6c('0x4f')](_0x21a5aa,{'raw':!![],'transaction':_0x13c7a7})[_0x9d6c('0x2c')](function(_0x288644){var _0x3f4589={'sender':_0x21a5aa[_0x9d6c('0x46')],'description':_0x21a5aa[_0x9d6c('0x48')],'content':_0x21a5aa[_0x9d6c('0x30')],'beep':_0x21a5aa[_0x9d6c('0x49')]};_0x352bd2[_0x9d6c('0x50')](function(_0x284a85){_0x3f4589['recipient']=_0x284a85;socket[_0x9d6c('0x51')](_0x9d6c('0x52'),_0x3f4589);});return _0x288644;});});})[_0x9d6c('0x2c')](respondWithResult(_0xa8657e,0xc9))[_0x9d6c('0x53')](handleError(_0xa8657e,null));};function getContent(_0x4880d5){return new BPromise(function(_0xc8df7a,_0x34f10c){if(_0x4880d5['text']){_0xc8df7a(_0x4880d5[_0x9d6c('0x54')]);return;}return db[_0x9d6c('0x55')][_0x9d6c('0x56')]({'attributes':[_0x9d6c('0x57')],'where':{'id':_0x4880d5[_0x9d6c('0x32')]},'raw':!![]})[_0x9d6c('0x2c')](function(_0x1d3f10){if(!_0x1d3f10)throw new db[(_0x9d6c('0x33'))][(_0x9d6c('0x34'))](_0x9d6c('0x58'));var _0x3d3bcf=Mustache[_0x9d6c('0x59')](_0x1d3f10['html'],_0x4880d5[_0x9d6c('0x36')]);_0xc8df7a(_0x3d3bcf);})[_0x9d6c('0x53')](function(_0x5590e9){_0x34f10c(_0x5590e9);});});}function getRecipients(_0x5abd5b){return new BPromise(function(_0x5f42a1,_0x33d281){var _0x2f5f22=[];var _0x425d7e=[];_0x5abd5b['forEach'](function(_0x3193f6){var _0x1c81e7=_[_0x9d6c('0x5a')](_0x3193f6['model']['toLowerCase']());if(_0x1c81e7==='User'){_0x2f5f22=_[_0x9d6c('0x5b')](_0x2f5f22,_0x3193f6['ids']);}else{if(_[_0x9d6c('0x43')](_0x1c81e7,_0x9d6c('0x5c')))_0x1c81e7=_0x1c81e7[_0x9d6c('0x5d')](_0x9d6c('0x5c'),_0x9d6c('0x5e'));_0x3193f6['ids'][_0x9d6c('0x50')](function(_0x3d27da){_0x425d7e[_0x9d6c('0x5f')](getAgents(_0x1c81e7,_0x3d27da));});}});return BPromise['all'](_0x425d7e)[_0x9d6c('0x2c')](function(_0x3c93d8){_0x2f5f22=_[_0x9d6c('0x5b')](_0x2f5f22,_['flatten'](_0x3c93d8));_0x5f42a1(_0x2f5f22);})[_0x9d6c('0x53')](function(_0x311402){_0x33d281(_0x311402);});});}function getAgents(_0x36d443,_0x3fbf2a){return new BPromise(function(_0x20b085,_0x42ef8b){return db[_0x36d443]['findOne']({'where':{'id':_0x3fbf2a}})[_0x9d6c('0x2c')](function(_0x3cfbc4){return _0x3cfbc4[_0x9d6c('0x60')]({'attributes':['id'],'raw':!![]})[_0x9d6c('0x2c')](function(_0x1ca5a3){var _0x1f182d=_[_0x9d6c('0x61')](_0x1ca5a3,'id');_0x20b085(_0x1f182d);});})[_0x9d6c('0x53')](function(_0x2d6f02){_0x42ef8b(_0x2d6f02);});});} \ No newline at end of file +var _0x9d46=['userNotification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','model','User','union','queue','replace','Queue','ids','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','some','includes','toLowerCase','senderName','user','fullname','isEmpty','recipientsDescription','beep','SenderId','join','UserNotification','forEach','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9d46,0xdb));var _0x69d4=function(_0x228d00,_0x10266c){_0x228d00=_0x228d00-0x0;var _0x5569e1=_0x9d46[_0x228d00];return _0x5569e1;};'use strict';var emlformat=require(_0x69d4('0x0'));var rimraf=require(_0x69d4('0x1'));var zipdir=require(_0x69d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x69d4('0x3'));var Mustache=require(_0x69d4('0x4'));var util=require(_0x69d4('0x5'));var path=require(_0x69d4('0x6'));var sox=require('sox');var csv=require(_0x69d4('0x7'));var ejs=require(_0x69d4('0x8'));var fs=require('fs');var fs_extra=require(_0x69d4('0x9'));var _=require(_0x69d4('0xa'));var squel=require(_0x69d4('0xb'));var crypto=require(_0x69d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x69d4('0xd'));var toCsv=require(_0x69d4('0x7'));var querystring=require(_0x69d4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x69d4('0xf'));var qs=require(_0x69d4('0x10'));var as=require(_0x69d4('0x11'));var hardwareService=require(_0x69d4('0x12'));var logger=require('../../config/logger')(_0x69d4('0x13'));var utils=require(_0x69d4('0x14'));var config=require(_0x69d4('0x15'));var licenseUtil=require(_0x69d4('0x16'));var db=require(_0x69d4('0x17'))['db'];config['redis']=_['defaults'](config[_0x69d4('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x69d4('0x19'))(new Redis(config[_0x69d4('0x18')]));require('./userNotification.socket')[_0x69d4('0x1a')](socket);function respondWithStatusCode(_0x54e522,_0x1bb030){_0x1bb030=_0x1bb030||0xcc;return function(_0x38c550){if(_0x38c550){return _0x54e522['sendStatus'](_0x1bb030);}return _0x54e522['status'](_0x1bb030)[_0x69d4('0x1b')]();};}function respondWithResult(_0xa81e6,_0x7fc67b){_0x7fc67b=_0x7fc67b||0xc8;return function(_0x5e4ba3){if(_0x5e4ba3){return _0xa81e6[_0x69d4('0x1c')](_0x7fc67b)[_0x69d4('0x1d')](_0x5e4ba3);}};}function respondWithFilteredResult(_0x3d66b3,_0x55a94b){return function(_0x388744){if(_0x388744){var _0x4c130f=typeof _0x55a94b[_0x69d4('0x1e')]===_0x69d4('0x1f')&&typeof _0x55a94b[_0x69d4('0x20')]===_0x69d4('0x1f');var _0x51657e=_0x388744[_0x69d4('0x21')];var _0x506562=_0x4c130f?0x0:_0x55a94b[_0x69d4('0x1e')];var _0x234903=_0x4c130f?_0x388744[_0x69d4('0x21')]:_0x55a94b[_0x69d4('0x1e')]+_0x55a94b[_0x69d4('0x20')];var _0x58db79;if(_0x234903>=_0x51657e){_0x234903=_0x51657e;_0x58db79=0xc8;}else{_0x58db79=0xce;}_0x3d66b3[_0x69d4('0x1c')](_0x58db79);return _0x3d66b3[_0x69d4('0x22')](_0x69d4('0x23'),_0x506562+'-'+_0x234903+'/'+_0x51657e)[_0x69d4('0x1d')](_0x388744);}return null;};}function patchUpdates(_0x571b23){return function(_0x8bcc43){try{jsonpatch[_0x69d4('0x24')](_0x8bcc43,_0x571b23,!![]);}catch(_0x17c2a0){return BPromise[_0x69d4('0x25')](_0x17c2a0);}return _0x8bcc43[_0x69d4('0x26')]();};}function saveUpdates(_0x3b146c,_0x159422){return function(_0x4b4170){if(_0x4b4170){return _0x4b4170[_0x69d4('0x27')](_0x3b146c)[_0x69d4('0x28')](function(_0x372b6b){return _0x372b6b;});}return null;};}function removeEntity(_0xc681fa,_0x3d9538){return function(_0x1f88ac){if(_0x1f88ac){return _0x1f88ac[_0x69d4('0x29')]()[_0x69d4('0x28')](function(){_0xc681fa['status'](0xcc)[_0x69d4('0x1b')]();});}};}function handleEntityNotFound(_0x4afd44,_0x469698){return function(_0x25182b){if(!_0x25182b){_0x4afd44[_0x69d4('0x2a')](0x194);}return _0x25182b;};}function handleError(_0x4a2fea,_0xaaf5de){_0xaaf5de=_0xaaf5de||0x1f4;return function(_0x51e54c){logger[_0x69d4('0x2b')](_0x51e54c[_0x69d4('0x2c')]);if(_0x51e54c[_0x69d4('0x2d')]){delete _0x51e54c[_0x69d4('0x2d')];}_0x4a2fea['status'](_0xaaf5de)[_0x69d4('0x2e')](_0x51e54c);};}exports[_0x69d4('0x2f')]=function(_0x2a6e1f,_0x469a6e,_0x24080d){if(!_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x31')](_0x69d4('0x32'))&&!_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x31')](_0x69d4('0x33'))){throw new db[(_0x69d4('0x34'))]['ValidationError'](_0x69d4('0x35'));}else{if(_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x31')](_0x69d4('0x33'))&&!_0x2a6e1f['body'][_0x69d4('0x31')]('view')){throw new db[(_0x69d4('0x34'))]['ValidationError'](_0x69d4('0x36'));}if(!_0x2a6e1f['body'][_0x69d4('0x31')](_0x69d4('0x37'))){throw new db[(_0x69d4('0x34'))][(_0x69d4('0x38'))](_0x69d4('0x39'));}else{try{var _0x411392=JSON[_0x69d4('0x3a')](_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x37')]);}catch(_0x82d4dd){logger[_0x69d4('0x2b')](_0x82d4dd);throw new db['Sequelize'][(_0x69d4('0x38'))](_0x69d4('0x3b'));}var _0x50cdca=[_0x69d4('0x3c'),_0x69d4('0x3d'),_0x69d4('0x3e'),_0x69d4('0x3f'),_0x69d4('0x40'),'voicequeue',_0x69d4('0x41'),_0x69d4('0x42'),'user'];if(_[_0x69d4('0x43')](_0x411392,function(_0x7bc796){return!_[_0x69d4('0x44')](_0x50cdca,_0x7bc796['model'][_0x69d4('0x45')]());})){throw new db[(_0x69d4('0x34'))][(_0x69d4('0x38'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x58d05c={};_0x58d05c['senderName']=_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x31')](_0x69d4('0x46'))?_0x2a6e1f['body'][_0x69d4('0x46')]:_0x2a6e1f[_0x69d4('0x47')][_0x69d4('0x48')];_0x58d05c['recipientsDescription']=_[_0x69d4('0x49')](_0x2a6e1f[_0x69d4('0x30')]['recipientsDescription'])?null:_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x4a')];_0x58d05c['beep']=_0x2a6e1f[_0x69d4('0x30')][_0x69d4('0x4b')]||![];_0x58d05c[_0x69d4('0x4c')]=_0x2a6e1f['user']['id'];return getContent(_0x2a6e1f[_0x69d4('0x30')])[_0x69d4('0x28')](function(_0x59a918){_0x58d05c[_0x69d4('0x30')]=_0x59a918;return getRecipients(_0x411392);})['then'](function(_0x6dd06c){_0x58d05c['recipientsId']=_['sortBy'](_0x6dd06c)[_0x69d4('0x4d')](',');return db['sequelize']['transaction'](function(_0x5c9947){return db[_0x69d4('0x4e')]['create'](_0x58d05c,{'raw':!![],'transaction':_0x5c9947})[_0x69d4('0x28')](function(_0x1fb3e4){var _0x12ea10={'sender':_0x58d05c[_0x69d4('0x46')],'description':_0x58d05c['recipientsDescription'],'content':_0x58d05c[_0x69d4('0x30')],'beep':_0x58d05c[_0x69d4('0x4b')]};_0x6dd06c[_0x69d4('0x4f')](function(_0x100df8){_0x12ea10['recipient']=_0x100df8;socket[_0x69d4('0x50')](_0x69d4('0x51'),_0x12ea10);});return _0x1fb3e4;});});})[_0x69d4('0x28')](respondWithResult(_0x469a6e,0xc9))['catch'](handleError(_0x469a6e,null));};function getContent(_0x2c1c90){return new BPromise(function(_0x2587e2,_0x40d0a8){if(_0x2c1c90[_0x69d4('0x32')]){_0x2587e2(_0x2c1c90[_0x69d4('0x32')]);return;}return db[_0x69d4('0x52')][_0x69d4('0x53')]({'attributes':['html'],'where':{'id':_0x2c1c90[_0x69d4('0x33')]},'raw':!![]})[_0x69d4('0x28')](function(_0x5a369b){if(!_0x5a369b)throw new db[(_0x69d4('0x34'))][(_0x69d4('0x38'))](_0x69d4('0x54'));var _0x564c95=Mustache[_0x69d4('0x55')](_0x5a369b['html'],_0x2c1c90[_0x69d4('0x56')]);_0x2587e2(_0x564c95);})[_0x69d4('0x57')](function(_0x16fefc){_0x40d0a8(_0x16fefc);});});}function getRecipients(_0x21fb12){return new BPromise(function(_0x11118f,_0x8d0485){var _0x34453d=[];var _0x383b91=[];_0x21fb12[_0x69d4('0x4f')](function(_0x175944){var _0x1a0395=_[_0x69d4('0x58')](_0x175944[_0x69d4('0x59')][_0x69d4('0x45')]());if(_0x1a0395===_0x69d4('0x5a')){_0x34453d=_[_0x69d4('0x5b')](_0x34453d,_0x175944['ids']);}else{if(_[_0x69d4('0x44')](_0x1a0395,_0x69d4('0x5c')))_0x1a0395=_0x1a0395[_0x69d4('0x5d')](_0x69d4('0x5c'),_0x69d4('0x5e'));_0x175944[_0x69d4('0x5f')][_0x69d4('0x4f')](function(_0x1e7aa0){_0x383b91['push'](getAgents(_0x1a0395,_0x1e7aa0));});}});return BPromise[_0x69d4('0x60')](_0x383b91)[_0x69d4('0x28')](function(_0x5ea34d){_0x34453d=_[_0x69d4('0x5b')](_0x34453d,_[_0x69d4('0x61')](_0x5ea34d));_0x11118f(_0x34453d);})[_0x69d4('0x57')](function(_0xeb0092){_0x8d0485(_0xeb0092);});});}function getAgents(_0x216970,_0xf1349e){return new BPromise(function(_0x258dfa,_0x2a0ddc){return db[_0x216970][_0x69d4('0x53')]({'where':{'id':_0xf1349e}})['then'](function(_0x1466b2){return _0x1466b2[_0x69d4('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3b87e5){var _0x19a76a=_[_0x69d4('0x63')](_0x3b87e5,'id');_0x258dfa(_0x19a76a);});})[_0x69d4('0x57')](function(_0x101115){_0x2a0ddc(_0x101115);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 808da50..853770e 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 _0x53e2=['emit','hasOwnProperty','../../mysqldb','UserNotification','setMaxListeners','update'];(function(_0x4d78dc,_0x3830c6){var _0x309d51=function(_0x3d74c2){while(--_0x3d74c2){_0x4d78dc['push'](_0x4d78dc['shift']());}};_0x309d51(++_0x3830c6);}(_0x53e2,0x104));var _0x253e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e2[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x253e('0x0'))['db'][_0x253e('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x253e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x253e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x489c82){return function(_0x814d12,_0x2b16ac,_0x4ccf0b){UserNotificationEvents['emit'](_0x489c82+':'+_0x814d12['id'],_0x814d12);UserNotificationEvents[_0x253e('0x4')](_0x489c82,_0x814d12);_0x4ccf0b(null);};}for(var e in events){if(events[_0x253e('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x8db0=['setMaxListeners','remove','emit','hook','../../mysqldb','UserNotification'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0x8db0,0x190));var _0x08db=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x8db0[_0x55c1f0];return _0x1530fa;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x08db('0x0'))['db'][_0x08db('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x08db('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x08db('0x3')};function emitEvent(_0x41a93a){return function(_0x1e2a3d,_0x141dbd,_0x3603f3){UserNotificationEvents['emit'](_0x41a93a+':'+_0x1e2a3d['id'],_0x1e2a3d);UserNotificationEvents[_0x08db('0x4')](_0x41a93a,_0x1e2a3d);_0x3603f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x08db('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 5f8a199..645e809 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 _0x130d=['define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x49f786,_0x307037){var _0x44b69d=function(_0x326fc2){while(--_0x326fc2){_0x49f786['push'](_0x49f786['shift']());}};_0x44b69d(++_0x307037);}(_0x130d,0x1f2));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require(_0xd130('0x1'));var logger=require(_0xd130('0x2'))(_0xd130('0x3'));var moment=require(_0xd130('0x4'));var BPromise=require(_0xd130('0x5'));var rp=require(_0xd130('0x6'));var fs=require('fs');var path=require(_0xd130('0x7'));var rimraf=require(_0xd130('0x8'));var config=require(_0xd130('0x9'));var attributes=require(_0xd130('0xa'));module[_0xd130('0xb')]=function(_0x38e738,_0x4cbb53){return _0x38e738[_0xd130('0xc')](_0xd130('0xd'),attributes,{'tableName':_0xd130('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd130('0xf'),'collate':_0xd130('0x10')});}; \ No newline at end of file +var _0x4241=['define','UserNotification','userNotifications','utf8mb4','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x246f92,_0xcf7bd4){var _0x2b8e7d=function(_0x9e8650){while(--_0x9e8650){_0x246f92['push'](_0x246f92['shift']());}};_0x2b8e7d(++_0xcf7bd4);}(_0x4241,0x17d));var _0x1424=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x4241[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1424('0x0'))(_0x1424('0x1'));var moment=require(_0x1424('0x2'));var BPromise=require(_0x1424('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1424('0x4'));var rimraf=require(_0x1424('0x5'));var config=require(_0x1424('0x6'));var attributes=require(_0x1424('0x7'));module[_0x1424('0x8')]=function(_0x1edd66,_0x2e44b5){return _0x1edd66[_0x1424('0x9')](_0x1424('0xa'),attributes,{'tableName':_0x1424('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1424('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1706159..0915ebd 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 _0x0460=['then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','./userNotification.socket','register','request'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x0460,0x1b2));var _0x0046=function(_0x9d5442,_0x33e9ab){_0x9d5442=_0x9d5442-0x0;var _0x5331b1=_0x0460[_0x9d5442];return _0x5331b1;};'use strict';var _=require(_0x0046('0x0'));var util=require(_0x0046('0x1'));var moment=require(_0x0046('0x2'));var BPromise=require(_0x0046('0x3'));var rs=require(_0x0046('0x4'));var fs=require('fs');var Redis=require(_0x0046('0x5'));var db=require(_0x0046('0x6'))['db'];var utils=require(_0x0046('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0046('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0046('0x9')][_0x0046('0xa')]({'port':0x232a});config[_0x0046('0xb')]=_[_0x0046('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0046('0xb')]));require(_0x0046('0xd'))[_0x0046('0xe')](socket);function respondWithRpcPromise(_0x27b9a9,_0xc8b8fd,_0x57f259){return new BPromise(function(_0x4e4827,_0x4dfa4f){return client[_0x0046('0xf')](_0x27b9a9,_0x57f259)[_0x0046('0x10')](function(_0x5a197a){logger[_0x0046('0x11')](_0x0046('0x12'),_0xc8b8fd,'request\x20sent');logger['debug'](_0x0046('0x13'),_0xc8b8fd,_0x0046('0x14'),JSON['stringify'](_0x5a197a));if(_0x5a197a[_0x0046('0x15')]){if(_0x5a197a[_0x0046('0x15')]['code']===0x1f4){logger[_0x0046('0x15')](_0x0046('0x12'),_0xc8b8fd,_0x5a197a[_0x0046('0x15')][_0x0046('0x16')]);return _0x4dfa4f(_0x5a197a[_0x0046('0x15')][_0x0046('0x16')]);}logger[_0x0046('0x15')](_0x0046('0x12'),_0xc8b8fd,_0x5a197a['error']['message']);return _0x4e4827(_0x5a197a['error'][_0x0046('0x16')]);}else{logger[_0x0046('0x11')](_0x0046('0x12'),_0xc8b8fd,'request\x20sent');_0x4e4827(_0x5a197a[_0x0046('0x17')]['message']);}})[_0x0046('0x18')](function(_0x2f00bc){logger[_0x0046('0x15')]('UserNotification,\x20%s,\x20%s',_0xc8b8fd,_0x2f00bc);_0x4dfa4f(_0x2f00bc);});});} \ No newline at end of file +var _0x29ec=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x53f144,_0x23b43f){var _0x396ce9=function(_0x36941f){while(--_0x36941f){_0x53f144['push'](_0x53f144['shift']());}};_0x396ce9(++_0x23b43f);}(_0x29ec,0xd9));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc29e('0x0'));var util=require(_0xc29e('0x1'));var moment=require(_0xc29e('0x2'));var BPromise=require(_0xc29e('0x3'));var rs=require(_0xc29e('0x4'));var fs=require('fs');var Redis=require(_0xc29e('0x5'));var db=require(_0xc29e('0x6'))['db'];var utils=require(_0xc29e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc29e('0x8'));var jayson=require(_0xc29e('0x9'));var client=jayson[_0xc29e('0xa')][_0xc29e('0xb')]({'port':0x232a});config[_0xc29e('0xc')]=_[_0xc29e('0xd')](config[_0xc29e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc29e('0xe'))(new Redis(config[_0xc29e('0xc')]));require(_0xc29e('0xf'))[_0xc29e('0x10')](socket);function respondWithRpcPromise(_0x4a31e6,_0x90761e,_0xe3b7a4){return new BPromise(function(_0xd76296,_0x3dc998){return client['request'](_0x4a31e6,_0xe3b7a4)[_0xc29e('0x11')](function(_0x13c9dc){logger['info'](_0xc29e('0x12'),_0x90761e,_0xc29e('0x13'));logger[_0xc29e('0x14')](_0xc29e('0x15'),_0x90761e,_0xc29e('0x13'),JSON[_0xc29e('0x16')](_0x13c9dc));if(_0x13c9dc[_0xc29e('0x17')]){if(_0x13c9dc[_0xc29e('0x17')]['code']===0x1f4){logger[_0xc29e('0x17')](_0xc29e('0x12'),_0x90761e,_0x13c9dc[_0xc29e('0x17')][_0xc29e('0x18')]);return _0x3dc998(_0x13c9dc[_0xc29e('0x17')]['message']);}logger['error'](_0xc29e('0x12'),_0x90761e,_0x13c9dc['error'][_0xc29e('0x18')]);return _0xd76296(_0x13c9dc[_0xc29e('0x17')][_0xc29e('0x18')]);}else{logger[_0xc29e('0x19')](_0xc29e('0x12'),_0x90761e,'request\x20sent');_0xd76296(_0x13c9dc[_0xc29e('0x1a')]['message']);}})[_0xc29e('0x1b')](function(_0x292973){logger['error']('UserNotification,\x20%s,\x20%s',_0x90761e,_0x292973);_0x3dc998(_0x292973);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index cfa3d99..071867f 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 _0x7411=['length','userNotification:','save','remove','update','removeListener','register'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7411,0x191));var _0x1741=function(_0xf352f5,_0x374af5){_0xf352f5=_0xf352f5-0x0;var _0x291d58=_0x7411[_0xf352f5];return _0x291d58;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1741('0x0'),_0x1741('0x1'),_0x1741('0x2')];function createListener(_0x2d9587,_0x1cbacf){return function(_0x5af198){_0x1cbacf['emit'](_0x2d9587,_0x5af198);};}function removeListener(_0x1b6846,_0x2c4212){return function(){UserNotificationEvents[_0x1741('0x3')](_0x1b6846,_0x2c4212);};}exports[_0x1741('0x4')]=function(_0x1fd16){for(var _0x1b5abd=0x0,_0x18b782=events[_0x1741('0x5')];_0x1b5abd<_0x18b782;_0x1b5abd++){var _0x5a6f74=events[_0x1b5abd];var _0x28cce7=createListener(_0x1741('0x6')+_0x5a6f74,_0x1fd16);UserNotificationEvents['on'](_0x5a6f74,_0x28cce7);}}; \ No newline at end of file +var _0x4f0b=['save','update','emit','register','userNotification:','./userNotification.events'];(function(_0x53a90d,_0x408e3e){var _0x431564=function(_0x4a07de){while(--_0x4a07de){_0x53a90d['push'](_0x53a90d['shift']());}};_0x431564(++_0x408e3e);}(_0x4f0b,0x6b));var _0xb4f0=function(_0x33bacc,_0x519717){_0x33bacc=_0x33bacc-0x0;var _0x27911c=_0x4f0b[_0x33bacc];return _0x27911c;};'use strict';var UserNotificationEvents=require(_0xb4f0('0x0'));var events=[_0xb4f0('0x1'),'remove',_0xb4f0('0x2')];function createListener(_0xa590e4,_0x19fb04){return function(_0x29ba30){_0x19fb04[_0xb4f0('0x3')](_0xa590e4,_0x29ba30);};}function removeListener(_0x613b13,_0x28ef0f){return function(){UserNotificationEvents['removeListener'](_0x613b13,_0x28ef0f);};}exports[_0xb4f0('0x4')]=function(_0x5071c1){for(var _0x13e09c=0x0,_0x22b2c5=events['length'];_0x13e09c<_0x22b2c5;_0x13e09c++){var _0x37dca4=events[_0x13e09c];var _0x26ef36=createListener(_0xb4f0('0x5')+_0x37dca4,_0x5071c1);UserNotificationEvents['on'](_0x37dca4,_0x26ef36);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2ea9247..eb243f9 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x63bdd2,_0x4509bf){var _0x5d9db7=function(_0x1ae0d7){while(--_0x1ae0d7){_0x63bdd2['push'](_0x63bdd2['shift']());}};_0x5d9db7(++_0x4509bf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1b78e1,_0x5d90e9){var _0x132f1f=function(_0x2bd667){while(--_0x2bd667){_0x1b78e1['push'](_0x1b78e1['shift']());}};_0x132f1f(++_0x5d90e9);}(_0x70e0,0x17b));var _0x070e=function(_0x3476d8,_0x1f6db6){_0x3476d8=_0x3476d8-0x0;var _0x5955a7=_0x70e0[_0x3476d8];return _0x5955a7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 0be36cf..c2ada2a 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 _0x6d4d=['sequelize','INTEGER'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6d4d,0x86));var _0xd6d4=function(_0x512e84,_0x2234b8){_0x512e84=_0x512e84-0x0;var _0x58a7f0=_0x6d4d[_0x512e84];return _0x58a7f0;};'use strict';var Sequelize=require(_0xd6d4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd6d4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8994=['INTEGER','sequelize','exports'];(function(_0x56db3d,_0x5ee08e){var _0xe4763f=function(_0x12ae82){while(--_0x12ae82){_0x56db3d['push'](_0x56db3d['shift']());}};_0xe4763f(++_0x5ee08e);}(_0x8994,0x16f));var _0x4899=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x8994[_0x485b5a];return _0xd2b34d;};'use strict';var Sequelize=require(_0x4899('0x0'));module[_0x4899('0x1')]={'penalty':{'type':Sequelize[_0x4899('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index fa73ff4..9a9b91d 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 _0x5a0f=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4cda09,_0x3011dc){var _0x42d0e9=function(_0x55bc8a){while(--_0x55bc8a){_0x4cda09['push'](_0x4cda09['shift']());}};_0x42d0e9(++_0x3011dc);}(_0x5a0f,0x15b));var _0xf5a0=function(_0x31bbb2,_0x13f99b){_0x31bbb2=_0x31bbb2-0x0;var _0x1353a1=_0x5a0f[_0x31bbb2];return _0x1353a1;};'use strict';var _=require('lodash');var util=require(_0xf5a0('0x0'));var logger=require(_0xf5a0('0x1'))('api');var moment=require(_0xf5a0('0x2'));var BPromise=require(_0xf5a0('0x3'));var rp=require(_0xf5a0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf5a0('0x5'));var attributes=require(_0xf5a0('0x6'));module[_0xf5a0('0x7')]=function(_0x353332,_0x1da7f2){return _0x353332[_0xf5a0('0x8')](_0xf5a0('0x9'),attributes,{'tableName':_0xf5a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30c3=['define','UserOpenchannelQueue','util','../../config/logger','api','moment','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports'];(function(_0x5b3c61,_0x3eb2aa){var _0x153389=function(_0x2a1a99){while(--_0x2a1a99){_0x5b3c61['push'](_0x5b3c61['shift']());}};_0x153389(++_0x3eb2aa);}(_0x30c3,0x183));var _0x330c=function(_0x5e4ffa,_0x56154d){_0x5e4ffa=_0x5e4ffa-0x0;var _0x43a656=_0x30c3[_0x5e4ffa];return _0x43a656;};'use strict';var _=require('lodash');var util=require(_0x330c('0x0'));var logger=require(_0x330c('0x1'))(_0x330c('0x2'));var moment=require(_0x330c('0x3'));var BPromise=require('bluebird');var rp=require(_0x330c('0x4'));var fs=require('fs');var path=require(_0x330c('0x5'));var rimraf=require(_0x330c('0x6'));var config=require('../../config/environment');var attributes=require(_0x330c('0x7'));module[_0x330c('0x8')]=function(_0x4d0818,_0x4371c7){return _0x4d0818[_0x330c('0x9')](_0x330c('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index decfaaf..791d900 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 _0xf4fe=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf4fe,0x174));var _0xef4f=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xf4fe[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xef4f('0x0'));var util=require('util');var moment=require(_0xef4f('0x1'));var BPromise=require('bluebird');var rs=require(_0xef4f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xef4f('0x3'))(_0xef4f('0x4'));var config=require(_0xef4f('0x5'));var jayson=require(_0xef4f('0x6'));var client=jayson['client'][_0xef4f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x655ef6,_0x39d19b,_0x41fc40){return new BPromise(function(_0x275bda,_0x10b829){return client['request'](_0x655ef6,_0x41fc40)[_0xef4f('0x8')](function(_0x4e7ea0){logger[_0xef4f('0x9')](_0xef4f('0xa'),_0x39d19b,_0xef4f('0xb'));logger[_0xef4f('0xc')](_0xef4f('0xd'),_0x39d19b,_0xef4f('0xb'),JSON['stringify'](_0x4e7ea0));if(_0x4e7ea0[_0xef4f('0xe')]){if(_0x4e7ea0[_0xef4f('0xe')][_0xef4f('0xf')]===0x1f4){logger[_0xef4f('0xe')](_0xef4f('0xa'),_0x39d19b,_0x4e7ea0['error']['message']);return _0x10b829(_0x4e7ea0['error']['message']);}logger[_0xef4f('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x39d19b,_0x4e7ea0[_0xef4f('0xe')][_0xef4f('0x10')]);return _0x275bda(_0x4e7ea0[_0xef4f('0xe')]['message']);}else{logger[_0xef4f('0x9')](_0xef4f('0xa'),_0x39d19b,_0xef4f('0xb'));_0x275bda(_0x4e7ea0['result'][_0xef4f('0x10')]);}})['catch'](function(_0x58bb24){logger['error'](_0xef4f('0xa'),_0x39d19b,_0x58bb24);_0x10b829(_0x58bb24);});});} \ No newline at end of file +var _0xb138=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x57ca83,_0x423a09){var _0x3973a0=function(_0x264235){while(--_0x264235){_0x57ca83['push'](_0x57ca83['shift']());}};_0x3973a0(++_0x423a09);}(_0xb138,0x94));var _0x8b13=function(_0x2e997e,_0x4edf31){_0x2e997e=_0x2e997e-0x0;var _0x5a6cb1=_0xb138[_0x2e997e];return _0x5a6cb1;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var BPromise=require(_0x8b13('0x3'));var rs=require(_0x8b13('0x4'));var fs=require('fs');var Redis=require(_0x8b13('0x5'));var db=require(_0x8b13('0x6'))['db'];var utils=require(_0x8b13('0x7'));var logger=require(_0x8b13('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b13('0x9')][_0x8b13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a5f26,_0x237bd0,_0x16824e){return new BPromise(function(_0xd7934f,_0x5b4025){return client[_0x8b13('0xb')](_0x3a5f26,_0x16824e)[_0x8b13('0xc')](function(_0x1bd3c7){logger[_0x8b13('0xd')](_0x8b13('0xe'),_0x237bd0,_0x8b13('0xf'));logger[_0x8b13('0x10')](_0x8b13('0x11'),_0x237bd0,_0x8b13('0xf'),JSON[_0x8b13('0x12')](_0x1bd3c7));if(_0x1bd3c7[_0x8b13('0x13')]){if(_0x1bd3c7['error'][_0x8b13('0x14')]===0x1f4){logger['error'](_0x8b13('0xe'),_0x237bd0,_0x1bd3c7[_0x8b13('0x13')][_0x8b13('0x15')]);return _0x5b4025(_0x1bd3c7[_0x8b13('0x13')]['message']);}logger[_0x8b13('0x13')](_0x8b13('0xe'),_0x237bd0,_0x1bd3c7[_0x8b13('0x13')][_0x8b13('0x15')]);return _0xd7934f(_0x1bd3c7['error'][_0x8b13('0x15')]);}else{logger[_0x8b13('0xd')](_0x8b13('0xe'),_0x237bd0,_0x8b13('0xf'));_0xd7934f(_0x1bd3c7['result']['message']);}})[_0x8b13('0x16')](function(_0x3185e6){logger[_0x8b13('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x237bd0,_0x3185e6);_0x5b4025(_0x3185e6);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 581858e..0c9878e 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 _0x03ba=['./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addResources','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a6953,_0x226a21){var _0x4c1f52=function(_0x4380eb){while(--_0x4380eb){_0x4a6953['push'](_0x4a6953['shift']());}};_0x4c1f52(++_0x226a21);}(_0x03ba,0x1c4));var _0xa03b=function(_0x5b04ac,_0x14b9b5){_0x5b04ac=_0x5b04ac-0x0;var _0x106281=_0x03ba[_0x5b04ac];return _0x106281;};'use strict';var multer=require(_0xa03b('0x0'));var util=require(_0xa03b('0x1'));var path=require(_0xa03b('0x2'));var timeout=require(_0xa03b('0x3'));var express=require(_0xa03b('0x4'));var router=express[_0xa03b('0x5')]();var fs_extra=require(_0xa03b('0x6'));var auth=require(_0xa03b('0x7'));var interaction=require(_0xa03b('0x8'));var config=require(_0xa03b('0x9'));var controller=require(_0xa03b('0xa'));router[_0xa03b('0xb')]('/',auth[_0xa03b('0xc')](),controller[_0xa03b('0xd')]);router['get'](_0xa03b('0xe'),auth[_0xa03b('0xc')](),controller[_0xa03b('0xf')]);router[_0xa03b('0xb')](_0xa03b('0x10'),auth['isAuthenticated'](),controller[_0xa03b('0x11')]);router['get']('/:id/sections',auth[_0xa03b('0xc')](),controller[_0xa03b('0x12')]);router[_0xa03b('0xb')](_0xa03b('0x13'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x14')]);router[_0xa03b('0x15')]('/',auth[_0xa03b('0xc')](),controller[_0xa03b('0x16')]);router[_0xa03b('0x15')]('/:id/clone',auth[_0xa03b('0xc')](),controller[_0xa03b('0x17')]);router[_0xa03b('0x15')](_0xa03b('0x18'),auth[_0xa03b('0xc')](),controller['addSections']);router[_0xa03b('0x15')](_0xa03b('0x13'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x19')]);router[_0xa03b('0x1a')](_0xa03b('0x10'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x1b')]);router['delete'](_0xa03b('0x10'),auth[_0xa03b('0xc')](),controller[_0xa03b('0x1c')]);router[_0xa03b('0x1d')]('/:id/sections',auth[_0xa03b('0xc')](),controller[_0xa03b('0x1e')]);router[_0xa03b('0x1d')]('/:id/resources',auth[_0xa03b('0xc')](),controller[_0xa03b('0x1f')]);module[_0xa03b('0x20')]=router; \ No newline at end of file +var _0x4fde=['post','/:id/clone','clone','addSections','/:id','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id/sections','/:id/resources','getResources','create'];(function(_0x5e42f2,_0x18ed32){var _0x2ef04e=function(_0x5b5eab){while(--_0x5b5eab){_0x5e42f2['push'](_0x5e42f2['shift']());}};_0x2ef04e(++_0x18ed32);}(_0x4fde,0x19f));var _0xe4fd=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x4fde[_0xbe40ad];return _0x50fac9;};'use strict';var multer=require(_0xe4fd('0x0'));var util=require(_0xe4fd('0x1'));var path=require(_0xe4fd('0x2'));var timeout=require(_0xe4fd('0x3'));var express=require('express');var router=express[_0xe4fd('0x4')]();var fs_extra=require(_0xe4fd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4fd('0x6'));var config=require(_0xe4fd('0x7'));var controller=require(_0xe4fd('0x8'));router[_0xe4fd('0x9')]('/',auth[_0xe4fd('0xa')](),controller[_0xe4fd('0xb')]);router[_0xe4fd('0x9')](_0xe4fd('0xc'),auth[_0xe4fd('0xa')](),controller['describe']);router[_0xe4fd('0x9')]('/:id',auth[_0xe4fd('0xa')](),controller['show']);router['get'](_0xe4fd('0xd'),auth[_0xe4fd('0xa')](),controller['getSections']);router['get'](_0xe4fd('0xe'),auth[_0xe4fd('0xa')](),controller[_0xe4fd('0xf')]);router['post']('/',auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x10')]);router[_0xe4fd('0x11')](_0xe4fd('0x12'),auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x13')]);router['post'](_0xe4fd('0xd'),auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x14')]);router['post'](_0xe4fd('0xe'),auth[_0xe4fd('0xa')](),controller['addResources']);router['put'](_0xe4fd('0x15'),auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x16')]);router['delete'](_0xe4fd('0x15'),auth['isAuthenticated'](),controller['destroy']);router[_0xe4fd('0x17')](_0xe4fd('0xd'),auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x18')]);router[_0xe4fd('0x17')]('/:id/resources',auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x19')]);module[_0xe4fd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 839f0af..6f32f54 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 _0x7198=['exports','STRING','name','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x4c32f5,_0x3dbbf1){var _0x19cae9=function(_0x3c77cd){while(--_0x3c77cd){_0x4c32f5['push'](_0x4c32f5['shift']());}};_0x19cae9(++_0x3dbbf1);}(_0x7198,0x1b0));var _0x8719=function(_0x38d914,_0x10124c){_0x38d914=_0x38d914-0x0;var _0x218083=_0x7198[_0x38d914];return _0x218083;};'use strict';var Sequelize=require('sequelize');module[_0x8719('0x0')]={'name':{'type':Sequelize[_0x8719('0x1')],'allowNull':![],'unique':_0x8719('0x2')},'crudPermissions':{'type':Sequelize[_0x8719('0x1')],'set':function(_0x4abf2c){this['setDataValue'](_0x8719('0x3'),_0x4abf2c?_0x4abf2c[_0x8719('0x4')](''):[]);},'get':function(){return this[_0x8719('0x5')](_0x8719('0x3'))?this['getDataValue'](_0x8719('0x3'))[_0x8719('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8719('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8719('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8719('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3438=['STRING','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','name'];(function(_0x20a3cf,_0x5dde6d){var _0x39dd1e=function(_0x183867){while(--_0x183867){_0x20a3cf['push'](_0x20a3cf['shift']());}};_0x39dd1e(++_0x5dde6d);}(_0x3438,0x1a6));var _0x8343=function(_0x1955c8,_0x1043fb){_0x1955c8=_0x1955c8-0x0;var _0x4f363f=_0x3438[_0x1955c8];return _0x4f363f;};'use strict';var Sequelize=require(_0x8343('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8343('0x1')},'crudPermissions':{'type':Sequelize[_0x8343('0x2')],'set':function(_0x27ff9d){this['setDataValue'](_0x8343('0x3'),_0x27ff9d?_0x27ff9d[_0x8343('0x4')](''):[]);},'get':function(){return this[_0x8343('0x5')](_0x8343('0x3'))?this[_0x8343('0x5')](_0x8343('0x3'))[_0x8343('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8343('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8343('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8343('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8343('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8343('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8343('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8343('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 497c095..f3dba52 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 _0x6901=['Resources','UserProfileSection','describe','addSections','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','clone','get','crudPermissions','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','omit','updatedAt'];(function(_0x433057,_0x519616){var _0x2fc400=function(_0x5a59b9){while(--_0x5a59b9){_0x433057['push'](_0x433057['shift']());}};_0x2fc400(++_0x519616);}(_0x6901,0x100));var _0x1690=function(_0x437f4a,_0x2fdc3b){_0x437f4a=_0x437f4a-0x0;var _0x140337=_0x6901[_0x437f4a];return _0x140337;};'use strict';var emlformat=require(_0x1690('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1690('0x1'));var jsonpatch=require(_0x1690('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1690('0x3'));var Mustache=require(_0x1690('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1690('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1690('0x6'));var _=require(_0x1690('0x7'));var squel=require(_0x1690('0x8'));var crypto=require(_0x1690('0x9'));var jsforce=require(_0x1690('0xa'));var deskjs=require(_0x1690('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1690('0xc'));var Papa=require(_0x1690('0xd'));var Redis=require(_0x1690('0xe'));var authService=require(_0x1690('0xf'));var qs=require(_0x1690('0x10'));var as=require(_0x1690('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1690('0x12'))(_0x1690('0x13'));var utils=require('../../config/utils');var config=require(_0x1690('0x14'));var licenseUtil=require(_0x1690('0x15'));var db=require(_0x1690('0x16'))['db'];config[_0x1690('0x17')]=_[_0x1690('0x18')](config[_0x1690('0x17')],{'host':_0x1690('0x19'),'port':0x18eb});var socket=require(_0x1690('0x1a'))(new Redis(config[_0x1690('0x17')]));require(_0x1690('0x1b'))['register'](socket);function respondWithStatusCode(_0x2adcb3,_0x2d4e75){_0x2d4e75=_0x2d4e75||0xcc;return function(_0x11e9bf){if(_0x11e9bf){return _0x2adcb3['sendStatus'](_0x2d4e75);}return _0x2adcb3['status'](_0x2d4e75)[_0x1690('0x1c')]();};}function respondWithResult(_0x575010,_0x1e2061){_0x1e2061=_0x1e2061||0xc8;return function(_0x5295b6){if(_0x5295b6){return _0x575010['status'](_0x1e2061)[_0x1690('0x1d')](_0x5295b6);}};}function respondWithFilteredResult(_0x55bb34,_0x36c250){return function(_0x2e1696){if(_0x2e1696){var _0x58435b=typeof _0x36c250[_0x1690('0x1e')]===_0x1690('0x1f')&&typeof _0x36c250[_0x1690('0x20')]===_0x1690('0x1f');var _0x4d06e7=_0x2e1696[_0x1690('0x21')];var _0x4d2fb9=_0x58435b?0x0:_0x36c250[_0x1690('0x1e')];var _0x2be44b=_0x58435b?_0x2e1696[_0x1690('0x21')]:_0x36c250[_0x1690('0x1e')]+_0x36c250[_0x1690('0x20')];var _0x8f5ceb;if(_0x2be44b>=_0x4d06e7){_0x2be44b=_0x4d06e7;_0x8f5ceb=0xc8;}else{_0x8f5ceb=0xce;}_0x55bb34[_0x1690('0x22')](_0x8f5ceb);return _0x55bb34[_0x1690('0x23')](_0x1690('0x24'),_0x4d2fb9+'-'+_0x2be44b+'/'+_0x4d06e7)[_0x1690('0x1d')](_0x2e1696);}return null;};}function patchUpdates(_0x74cb9){return function(_0x44986d){try{jsonpatch[_0x1690('0x25')](_0x44986d,_0x74cb9,!![]);}catch(_0x3e24e5){return BPromise[_0x1690('0x26')](_0x3e24e5);}return _0x44986d[_0x1690('0x27')]();};}function saveUpdates(_0x395d81,_0x1b7fc1){return function(_0x592104){if(_0x592104){return _0x592104[_0x1690('0x28')](_0x395d81)[_0x1690('0x29')](function(_0x5c1cf8){return _0x5c1cf8;});}return null;};}function removeEntity(_0x34a818,_0x1c1b7b){return function(_0x252e88){if(_0x252e88){return _0x252e88[_0x1690('0x2a')]()['then'](function(){_0x34a818[_0x1690('0x22')](0xcc)[_0x1690('0x1c')]();});}};}function handleEntityNotFound(_0x32dd95,_0x1d7ae2){return function(_0x214679){if(!_0x214679){_0x32dd95[_0x1690('0x2b')](0x194);}return _0x214679;};}function handleError(_0x4fb78c,_0x48febb){_0x48febb=_0x48febb||0x1f4;return function(_0x12961e){logger['error'](_0x12961e['stack']);if(_0x12961e['name']){delete _0x12961e[_0x1690('0x2c')];}_0x4fb78c[_0x1690('0x22')](_0x48febb)[_0x1690('0x2d')](_0x12961e);};}exports[_0x1690('0x2e')]=function(_0x2bd32e,_0x3022f7){var _0x2ff0d5={},_0x52760b={},_0x3ead2e={'count':0x0,'rows':[]};var _0x45cddb=_[_0x1690('0x2f')](db[_0x1690('0x30')][_0x1690('0x31')],function(_0x2579ce){return{'name':_0x2579ce[_0x1690('0x32')],'type':_0x2579ce['type'][_0x1690('0x33')]};});_0x52760b[_0x1690('0x34')]=_['map'](_0x45cddb,_0x1690('0x2c'));_0x52760b[_0x1690('0x35')]=_[_0x1690('0x36')](_0x2bd32e[_0x1690('0x35')]);_0x52760b[_0x1690('0x37')]=_[_0x1690('0x38')](_0x52760b[_0x1690('0x34')],_0x52760b[_0x1690('0x35')]);_0x2ff0d5['attributes']=_[_0x1690('0x38')](_0x52760b[_0x1690('0x34')],qs[_0x1690('0x39')](_0x2bd32e[_0x1690('0x35')]['fields']));_0x2ff0d5['attributes']=_0x2ff0d5[_0x1690('0x3a')][_0x1690('0x3b')]?_0x2ff0d5[_0x1690('0x3a')]:_0x52760b[_0x1690('0x34')];if(!_0x2bd32e[_0x1690('0x35')][_0x1690('0x3c')]('nolimit')){_0x2ff0d5[_0x1690('0x20')]=qs[_0x1690('0x20')](_0x2bd32e['query'][_0x1690('0x20')]);_0x2ff0d5['offset']=qs['offset'](_0x2bd32e[_0x1690('0x35')][_0x1690('0x1e')]);}_0x2ff0d5['order']=qs['sort'](_0x2bd32e[_0x1690('0x35')][_0x1690('0x3d')]);_0x2ff0d5[_0x1690('0x3e')]=qs[_0x1690('0x37')](_[_0x1690('0x3f')](_0x2bd32e[_0x1690('0x35')],_0x52760b[_0x1690('0x37')]),_0x45cddb);if(_0x2bd32e[_0x1690('0x35')]['filter']){_0x2ff0d5[_0x1690('0x3e')]=_['merge'](_0x2ff0d5[_0x1690('0x3e')],{'$or':_[_0x1690('0x2f')](_0x45cddb,function(_0x1e6242){if(_0x1e6242['type']!==_0x1690('0x40')){var _0x9b3489={};_0x9b3489[_0x1e6242[_0x1690('0x2c')]]={'$like':'%'+_0x2bd32e['query'][_0x1690('0x41')]+'%'};return _0x9b3489;}})});}_0x2ff0d5=_[_0x1690('0x42')]({},_0x2ff0d5,_0x2bd32e[_0x1690('0x43')]);var _0x37f620={'where':_0x2ff0d5['where']};return db['UserProfile'][_0x1690('0x21')](_0x37f620)[_0x1690('0x29')](function(_0x2a39c2){_0x3ead2e[_0x1690('0x21')]=_0x2a39c2;if(_0x2bd32e['query'][_0x1690('0x44')]){_0x2ff0d5[_0x1690('0x45')]=[{'all':!![]}];}return db[_0x1690('0x30')][_0x1690('0x46')](_0x2ff0d5);})['then'](function(_0x5e3c68){_0x3ead2e['rows']=_0x5e3c68;return _0x3ead2e;})[_0x1690('0x29')](respondWithFilteredResult(_0x3022f7,_0x2ff0d5))[_0x1690('0x47')](handleError(_0x3022f7,null));};exports[_0x1690('0x48')]=function(_0x4bc829,_0x1c18d3){var _0xf248c0={'raw':![],'where':{'id':_0x4bc829[_0x1690('0x49')]['id']}},_0x4dd5ff={};_0x4dd5ff[_0x1690('0x34')]=_['keys'](db[_0x1690('0x30')]['rawAttributes']);_0x4dd5ff[_0x1690('0x35')]=_[_0x1690('0x36')](_0x4bc829[_0x1690('0x35')]);_0x4dd5ff[_0x1690('0x37')]=_[_0x1690('0x38')](_0x4dd5ff[_0x1690('0x34')],_0x4dd5ff[_0x1690('0x35')]);_0xf248c0[_0x1690('0x3a')]=_[_0x1690('0x38')](_0x4dd5ff[_0x1690('0x34')],qs[_0x1690('0x39')](_0x4bc829[_0x1690('0x35')][_0x1690('0x39')]));_0xf248c0[_0x1690('0x3a')]=_0xf248c0['attributes']['length']?_0xf248c0[_0x1690('0x3a')]:_0x4dd5ff['model'];if(_0x4bc829[_0x1690('0x35')][_0x1690('0x44')]){_0xf248c0[_0x1690('0x45')]=[{'all':!![]}];}_0xf248c0=_[_0x1690('0x42')]({},_0xf248c0,_0x4bc829['options']);return db[_0x1690('0x30')][_0x1690('0x4a')](_0xf248c0)[_0x1690('0x29')](handleEntityNotFound(_0x1c18d3,null))[_0x1690('0x29')](respondWithResult(_0x1c18d3,null))['catch'](handleError(_0x1c18d3,null));};exports[_0x1690('0x4b')]=function(_0x537c58,_0x36fb1d){return db['UserProfile']['create'](_0x537c58[_0x1690('0x4c')],{})['then'](respondWithResult(_0x36fb1d,0xc9))[_0x1690('0x47')](handleError(_0x36fb1d,null));};exports[_0x1690('0x4d')]=function(_0x37943b,_0x219b7c){var _0x33ef29={'where':{'id':_0x37943b[_0x1690('0x49')]['id']}},_0x3d4d95={};_0x3d4d95[_0x1690('0x34')]=_['keys'](db['UserProfile'][_0x1690('0x31')]);_0x33ef29['attributes']=_['intersection'](_0x3d4d95[_0x1690('0x34')],qs[_0x1690('0x39')](_0x37943b[_0x1690('0x35')]['fields']));_0x33ef29['attributes']=_0x33ef29['attributes'][_0x1690('0x3b')]?_0x33ef29['attributes']:_0x3d4d95[_0x1690('0x34')];if(_0x37943b[_0x1690('0x35')][_0x1690('0x44')]){_0x33ef29[_0x1690('0x45')]=[{'all':!![]}];}_0x33ef29=_[_0x1690('0x42')]({},_0x33ef29,_0x37943b['options']);return db[_0x1690('0x30')][_0x1690('0x4a')](_0x33ef29)[_0x1690('0x29')](handleEntityNotFound(_0x219b7c,null))[_0x1690('0x29')](function(_0x2e3e8a){if(_0x2e3e8a){var _0x17c5ab=_0x2e3e8a[_0x1690('0x4e')]({'plain':!![]});_0x17c5ab=qs['omit'](_0x17c5ab,['id','createdAt','updatedAt',_0x1690('0x4f')]);_0x37943b[_0x1690('0x4c')]=_['omit'](_0x37943b['body'],['id',_0x1690('0x50'),'updatedAt']);return db[_0x1690('0x51')][_0x1690('0x52')](function(_0x535c53){return db[_0x1690('0x30')][_0x1690('0x4b')](_['merge'](_0x17c5ab,_0x37943b[_0x1690('0x4c')]),{'include':_0x37943b[_0x1690('0x35')][_0x1690('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x535c53})['then'](function(_0x28d2dd){var _0x35e73c=_0x28d2dd[_0x1690('0x4e')]({'plain':!![]});return db['UserProfileSection'][_0x1690('0x46')]({'where':{'userProfileId':_0x37943b['params']['id']},'raw':!![]})['then'](function(_0x372908){if(_0x372908){return BPromise[_0x1690('0x53')](_0x372908,function(_0x2dc53c){return new BPromise(function(_0x2ff810,_0x1e5f24){if(_0x2dc53c[_0x1690('0x54')]===null||_0x2dc53c[_0x1690('0x54')]===0x1)_0x2ff810(null);return db[_0x1690('0x55')]['findAll']({'where':{'sectionId':_0x2dc53c['id']},'raw':!![]})[_0x1690('0x29')](function(_0x3d4c3d){var _0x35b9ab=_[_0x1690('0x2f')](_0x3d4c3d,function(_0x56bbc1){return qs['omit'](_0x56bbc1,['id',_0x1690('0x50'),'updatedAt',_0x1690('0x56')]);});_0x2ff810(_0x35b9ab);})[_0x1690('0x47')](function(_0x2afa21){_0x1e5f24(_0x2afa21);});})[_0x1690('0x29')](function(_0x4db8e9){var _0x45e4fc=qs[_0x1690('0x57')](_0x2dc53c,['id',_0x1690('0x50'),_0x1690('0x58')]);_0x45e4fc['userProfileId']=_0x35e73c['id'];if(_0x4db8e9)_0x45e4fc[_0x1690('0x59')]=_0x4db8e9;return _0x45e4fc;})[_0x1690('0x29')](function(_0x5dfe8c){return db[_0x1690('0x5a')][_0x1690('0x4b')](_0x5dfe8c,{'include':[{'model':db[_0x1690('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x535c53});});})[_0x1690('0x29')](function(){return _0x35e73c;});}});});});}})[_0x1690('0x29')](respondWithResult(_0x219b7c,0xc9))[_0x1690('0x47')](handleError(_0x219b7c,null));};exports['update']=function(_0x2e8373,_0x2f755){if(_0x2e8373[_0x1690('0x4c')]['id']){delete _0x2e8373[_0x1690('0x4c')]['id'];}return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0x2e8373['params']['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x2f755,null))[_0x1690('0x29')](saveUpdates(_0x2e8373[_0x1690('0x4c')],null))[_0x1690('0x29')](respondWithResult(_0x2f755,null))[_0x1690('0x47')](handleError(_0x2f755,null));};exports['destroy']=function(_0x3d7217,_0x5a09ac){return db['UserProfile'][_0x1690('0x4a')]({'where':{'id':_0x3d7217[_0x1690('0x49')]['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x5a09ac,null))[_0x1690('0x29')](removeEntity(_0x5a09ac,null))['catch'](handleError(_0x5a09ac,null));};exports[_0x1690('0x5b')]=function(_0x45d2cc,_0x276bb7){return db[_0x1690('0x30')][_0x1690('0x5b')]()['then'](respondWithResult(_0x276bb7,null))[_0x1690('0x47')](handleError(_0x276bb7,null));};exports[_0x1690('0x5c')]=function(_0x179de2,_0x574770){var _0x56705b=_0x179de2[_0x1690('0x4c')];return db['UserProfile'][_0x1690('0x4a')]({'where':{'id':_0x179de2['params']['id']}})['then'](handleEntityNotFound(_0x574770,null))[_0x1690('0x29')](function(_0x1e832b){if(_0x1e832b){return db['sequelize']['transaction'](function(_0x222530){return db[_0x1690('0x5a')][_0x1690('0x2a')]({'where':{'userProfileId':_0x179de2[_0x1690('0x49')]['id'],'sectionId':_['map'](_0x56705b,function(_0x53a5e7){return _0x53a5e7[_0x1690('0x56')];})},'transaction':_0x222530})[_0x1690('0x29')](function(){var _0x3e5cea=_['map'](_0x56705b,function(_0x3cd2fa){_0x3cd2fa['userProfileId']=_0x179de2[_0x1690('0x49')]['id'];return _0x3cd2fa;});var _0x3ef521=[];return BPromise[_0x1690('0x53')](_0x3e5cea,function(_0x3fe463){return db[_0x1690('0x5a')][_0x1690('0x4b')](_0x3fe463,{'include':[{'model':db[_0x1690('0x55')],'as':_0x1690('0x59')}],'raw':!![],'transaction':_0x222530})[_0x1690('0x29')](function(_0x583cef){_0x3ef521[_0x1690('0x5d')](_0x583cef[_0x1690('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x3ef521;});});});}})[_0x1690('0x29')](function(_0x514208){return _0x514208;})[_0x1690('0x29')](respondWithResult(_0x574770,null))[_0x1690('0x47')](handleError(_0x574770,null));};exports[_0x1690('0x5e')]=function(_0x5779f7,_0x15ccd2){var _0x133fb4;return db['UserProfile'][_0x1690('0x4a')]({'where':{'id':_0x5779f7['params']['id']},'attributes':['id',_0x1690('0x2c')]})[_0x1690('0x29')](handleEntityNotFound(_0x15ccd2,null))[_0x1690('0x29')](function(_0x2bde92){if(_0x2bde92){_0x133fb4=_0x2bde92;return db['UserProfileSection'][_0x1690('0x2a')]({'where':{'userProfileId':_0x5779f7[_0x1690('0x49')]['id'],'sectionId':_0x5779f7['query']['ids']}});}})[_0x1690('0x29')](function(){return _0x133fb4;})[_0x1690('0x29')](respondWithStatusCode(_0x15ccd2,null))[_0x1690('0x47')](handleError(_0x15ccd2,null));};exports[_0x1690('0x5f')]=function(_0x277f57,_0x55b44b){var _0x2671f0=[];var _0x55a6d2=[];return db['UserProfileSection'][_0x1690('0x46')]({'where':{'userProfileId':_0x277f57[_0x1690('0x49')]['id']},'raw':!![]})[_0x1690('0x29')](function(_0x15572c){_0x2671f0=_[_0x1690('0x41')](_0x15572c,function(_0x3ea1cd){return _0x3ea1cd[_0x1690('0x60')]===0x1||_[_0x1690('0x61')]([0x3eb,0x709],_0x3ea1cd[_0x1690('0x56')]);});if(!_[_0x1690('0x62')](_0x2671f0)){return _[_0x1690('0x2f')](_0x2671f0,function(_0x250faf){return _0x250faf[_0x1690('0x56')];});}else{return;}})['then'](function(_0x42ead8){if(_0x42ead8)_0x55a6d2=_0x42ead8;if(_['includes'](_0x55a6d2,0x64)){var _0x29859b=_[_0x1690('0x4a')](_0x2671f0,{'sectionId':0x64});return hasDefaultDashboard(_0x29859b)['then'](function(_0x358afc){return _[_0x1690('0x2f')](_0x2671f0,function(_0x4e7b6b){if(_0x4e7b6b['sectionId']===0x64){_0x4e7b6b[_0x1690('0x63')]=_0x358afc;}return _0x4e7b6b;});});}else{return;}})[_0x1690('0x29')](function(_0x5e93f6){if(_0x5e93f6)_0x2671f0=_0x5e93f6;if(_[_0x1690('0x61')](_0x55a6d2,0x3eb)){var _0x21b1ce=_[_0x1690('0x4a')](_0x2671f0,{'sectionId':0x3eb});return getCustomDashboards(_0x21b1ce)[_0x1690('0x29')](function(_0x393cd8){return _[_0x1690('0x2f')](_0x2671f0,function(_0xa59d45){if(_0x21b1ce[_0x1690('0x60')]){if(_0xa59d45[_0x1690('0x56')]===0x3eb){_0xa59d45['subsections']=_0x393cd8;}}else{if(_0xa59d45[_0x1690('0x56')]===0x64){_0xa59d45[_0x1690('0x63')]=_0x393cd8;}}return _0xa59d45;});});}else{return;}})[_0x1690('0x29')](function(_0xf7e2f4){if(_0xf7e2f4)_0x2671f0=_0xf7e2f4;if(_[_0x1690('0x61')](_0x55a6d2,0x709)){var _0x2bfce1=_[_0x1690('0x4a')](_0x2671f0,{'sectionId':0x709});return getPlugins(_0x2bfce1)[_0x1690('0x29')](function(_0xcb3f08){if(_0x2bfce1[_0x1690('0x60')]){return _[_0x1690('0x2f')](_0x2671f0,function(_0x9f8ade){if(_0x9f8ade[_0x1690('0x56')]===0x709){_0x9f8ade[_0x1690('0x63')]=_0xcb3f08;}return _0x9f8ade;});}else{var _0x2cf91a={'sectionId':0x76c,'enabled':0x1,'subsections':_0xcb3f08};var _0x2ac77e=_['map'](_0x2671f0);_0x2ac77e[_0x1690('0x5d')](_0x2cf91a);return _0x2ac77e;}});}else{return;}})['then'](function(_0x2694b5){if(_0x2694b5)_0x2671f0=_0x2694b5;return _[_0x1690('0x41')](_0x2671f0,[_0x1690('0x60'),0x1]);})[_0x1690('0x29')](respondWithResult(_0x55b44b,null))[_0x1690('0x47')](handleError(_0x55b44b,null));};function hasDefaultDashboard(_0x55ff77){var _0x14a73a=[0x65];return new BPromise(function(_0x4dca59,_0x1419a9){try{if(_0x55ff77[_0x1690('0x54')]){_0x4dca59(_0x14a73a);}else{return db[_0x1690('0x55')][_0x1690('0x64')]({'where':{'sectionId':_0x55ff77['id']},'raw':!![]})[_0x1690('0x29')](function(_0x7b9e3c){_0x7b9e3c?_0x4dca59(_0x14a73a):_0x4dca59();});}}catch(_0x58ad55){_0x1419a9(_0x58ad55);}});}function getCustomDashboards(_0x576e9c){var _0x4da656=[];return new BPromise(function(_0x285239,_0x4189ad){try{if(_0x576e9c[_0x1690('0x54')]){return db[_0x1690('0x65')][_0x1690('0x46')]({'raw':!![]})[_0x1690('0x29')](function(_0x546f56){_0x546f56[_0x1690('0x66')](function(_0x239a67){_0x4da656['push'](_0x239a67['id']+0x1869f);});_0x285239(_0x4da656);});}else{return db[_0x1690('0x55')][_0x1690('0x46')]({'where':{'sectionId':_0x576e9c['id']},'raw':!![]})[_0x1690('0x29')](function(_0x321e71){_0x321e71[_0x1690('0x66')](function(_0x276fe0){_0x4da656[_0x1690('0x5d')](_0x276fe0[_0x1690('0x67')]+0x1869f);});_0x285239(_0x4da656);});}}catch(_0x33a30e){_0x4189ad(_0x33a30e);}});}function getPlugins(_0x878394){var _0x335996=[];return new BPromise(function(_0x36f7f9,_0x522c67){try{if(_0x878394[_0x1690('0x54')]){return db[_0x1690('0x68')]['findAll']({'raw':!![]})[_0x1690('0x29')](function(_0x379f5){_0x379f5['forEach'](function(_0x1b225e){_0x335996[_0x1690('0x5d')](_0x1b225e['id']+0x15b38);});_0x36f7f9(_0x335996);});}else{return db['UserProfileResource'][_0x1690('0x46')]({'where':{'sectionId':_0x878394['id']},'raw':!![]})[_0x1690('0x29')](function(_0x451dd5){_0x451dd5[_0x1690('0x66')](function(_0x3ad28b){_0x335996[_0x1690('0x5d')](_0x3ad28b[_0x1690('0x67')]+0x15b38);});_0x36f7f9(_0x335996);});}}catch(_0x2df0e7){_0x522c67(_0x2df0e7);}});}exports[_0x1690('0x69')]=function(_0xb9843f,_0x383e7e){return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0xb9843f[_0x1690('0x49')]['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x383e7e,null))['then'](function(_0xc40ced){if(_0xc40ced){return db[_0x1690('0x51')][_0x1690('0x52')](function(_0x45f3e7){return db[_0x1690('0x5a')][_0x1690('0x46')]({'where':{'userProfileId':_0xb9843f['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x5130fb){if(_0x5130fb){return db['UserProfileSection'][_0x1690('0x2a')]({'where':{'userProfileId':_0xb9843f[_0x1690('0x49')]['id'],'id':_[_0x1690('0x2f')](_0x5130fb,function(_0x59d567){return _0x59d567['id'];})},'transaction':_0x45f3e7});}})[_0x1690('0x29')](function(_0x11887d){var _0xd6dcee=_[_0x1690('0x2f')](_0xb9843f[_0x1690('0x4c')],function(_0x3ee1b4){_0x3ee1b4[_0x1690('0x6a')]=_0xb9843f[_0x1690('0x49')]['id'];return _0x3ee1b4;});return db[_0x1690('0x5a')][_0x1690('0x6b')](_0xd6dcee,{'raw':!![],'transaction':_0x45f3e7});})[_0x1690('0x29')](function(_0x32374d){var _0x4a27c2=_[_0x1690('0x41')](_[_0x1690('0x2f')](_0x32374d,function(_0x4f01d8){return _0x4f01d8[_0x1690('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x4a27c2){return db['UserProfileSection'][_0x1690('0x46')]({'where':{'userProfileId':_0xb9843f[_0x1690('0x49')]['id'],'sectionId':_[_0x1690('0x2f')](_0x4a27c2,function(_0x2c9256){return _0x2c9256[_0x1690('0x56')];})},'attributes':['id',_0x1690('0x56')],'raw':!![]})['then'](function(_0x2ab1f8){var _0x5496dd=_[_0x1690('0x2f')](_0xb9843f['body'],function(_0x29b66d){_0x29b66d[_0x1690('0x6a')]=_0xb9843f[_0x1690('0x49')]['id'];return _0x29b66d;});return db[_0x1690('0x55')][_0x1690('0x6b')](_0x5496dd,{'raw':!![],'transaction':_0x45f3e7});});}})[_0x1690('0x47')](handleError(_0x383e7e,null));});}})[_0x1690('0x29')](function(_0xeecdb9){var _0x157fa8=_[_0x1690('0x2f')](_0xeecdb9,function(_0x109c1c){return _0x109c1c[_0x1690('0x4e')]({'plain':!![]});});})[_0x1690('0x29')](respondWithResult(_0x383e7e,null))['catch'](handleError(_0x383e7e,null));};exports['removeResources']=function(_0x2a2d5c,_0x2d7f1d,_0x3a633e){return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0x2a2d5c[_0x1690('0x49')]['id']}})[_0x1690('0x29')](handleEntityNotFound(_0x2d7f1d,null))[_0x1690('0x29')](function(_0x2fe94d){if(_0x2fe94d){return _0x2fe94d[_0x1690('0x6c')](_0x2a2d5c[_0x1690('0x35')][_0x1690('0x6d')]);}})[_0x1690('0x29')](respondWithStatusCode(_0x2d7f1d,null))[_0x1690('0x47')](handleError(_0x2d7f1d,null));};exports[_0x1690('0x6e')]=function(_0x254761,_0x241f63){var _0x2598cc={};if(!_0x254761[_0x1690('0x35')][_0x1690('0x6f')])throw new Error(_0x1690('0x70'));if(!_0x254761[_0x1690('0x35')]['hasOwnProperty'](_0x1690('0x71'))){_0x2598cc[_0x1690('0x20')]=qs[_0x1690('0x20')](_0x254761[_0x1690('0x35')][_0x1690('0x20')]);_0x2598cc[_0x1690('0x1e')]=qs['offset'](_0x254761[_0x1690('0x35')][_0x1690('0x1e')]);}return db[_0x1690('0x30')][_0x1690('0x4a')]({'where':{'id':_0x254761[_0x1690('0x49')]['id']}})[_0x1690('0x29')](function(_0x4379ca){if(!_0x4379ca)throw new Error(_0x1690('0x72')+_0x254761[_0x1690('0x49')]['id']);return db[_0x1690('0x30')][_0x1690('0x6e')](_0x254761);})[_0x1690('0x29')](respondWithFilteredResult(_0x241f63,_0x2598cc))[_0x1690('0x47')](handleError(_0x241f63,null));}; \ No newline at end of file +var _0x9e63=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','create','body','clone','options','get','createdAt','updatedAt','crudPermissions','UserProfileSection','each','autoAssociation','UserProfileResource','omit','sectionId','userProfileId','Resources','find','describe','addSections','transaction','destroy','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','sequelize','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x547d01,_0x3dca2c){var _0x3f469a=function(_0x3b29f9){while(--_0x3b29f9){_0x547d01['push'](_0x547d01['shift']());}};_0x3f469a(++_0x3dca2c);}(_0x9e63,0x65));var _0x39e6=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x9e63[_0x4e1d03];return _0x362d4b;};'use strict';var emlformat=require(_0x39e6('0x0'));var rimraf=require(_0x39e6('0x1'));var zipdir=require(_0x39e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39e6('0x3'));var moment=require(_0x39e6('0x4'));var BPromise=require(_0x39e6('0x5'));var Mustache=require(_0x39e6('0x6'));var util=require(_0x39e6('0x7'));var path=require(_0x39e6('0x8'));var sox=require(_0x39e6('0x9'));var csv=require(_0x39e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39e6('0xb'));var _=require(_0x39e6('0xc'));var squel=require(_0x39e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x39e6('0xe'));var deskjs=require(_0x39e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x39e6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39e6('0x11'));var qs=require(_0x39e6('0x12'));var as=require(_0x39e6('0x13'));var hardwareService=require(_0x39e6('0x14'));var logger=require(_0x39e6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x39e6('0x16'));var licenseUtil=require(_0x39e6('0x17'));var db=require(_0x39e6('0x18'))['db'];config[_0x39e6('0x19')]=_[_0x39e6('0x1a')](config['redis'],{'host':_0x39e6('0x1b'),'port':0x18eb});var socket=require(_0x39e6('0x1c'))(new Redis(config[_0x39e6('0x19')]));require(_0x39e6('0x1d'))['register'](socket);function respondWithStatusCode(_0x4ed79d,_0x4ffa4d){_0x4ffa4d=_0x4ffa4d||0xcc;return function(_0x24ac12){if(_0x24ac12){return _0x4ed79d[_0x39e6('0x1e')](_0x4ffa4d);}return _0x4ed79d[_0x39e6('0x1f')](_0x4ffa4d)[_0x39e6('0x20')]();};}function respondWithResult(_0x5a86e3,_0x215096){_0x215096=_0x215096||0xc8;return function(_0x124e05){if(_0x124e05){return _0x5a86e3[_0x39e6('0x1f')](_0x215096)[_0x39e6('0x21')](_0x124e05);}};}function respondWithFilteredResult(_0x18d076,_0xc6497b){return function(_0x1a3adf){if(_0x1a3adf){var _0x512279=typeof _0xc6497b[_0x39e6('0x22')]===_0x39e6('0x23')&&typeof _0xc6497b[_0x39e6('0x24')]==='undefined';var _0x47e94b=_0x1a3adf[_0x39e6('0x25')];var _0x445f12=_0x512279?0x0:_0xc6497b[_0x39e6('0x22')];var _0x2d9a98=_0x512279?_0x1a3adf[_0x39e6('0x25')]:_0xc6497b['offset']+_0xc6497b[_0x39e6('0x24')];var _0x59c532;if(_0x2d9a98>=_0x47e94b){_0x2d9a98=_0x47e94b;_0x59c532=0xc8;}else{_0x59c532=0xce;}_0x18d076[_0x39e6('0x1f')](_0x59c532);return _0x18d076[_0x39e6('0x26')]('Content-Range',_0x445f12+'-'+_0x2d9a98+'/'+_0x47e94b)[_0x39e6('0x21')](_0x1a3adf);}return null;};}function patchUpdates(_0x1c626a){return function(_0x2e4890){try{jsonpatch[_0x39e6('0x27')](_0x2e4890,_0x1c626a,!![]);}catch(_0x314c7d){return BPromise[_0x39e6('0x28')](_0x314c7d);}return _0x2e4890[_0x39e6('0x29')]();};}function saveUpdates(_0x4619ee,_0x302f77){return function(_0x47704f){if(_0x47704f){return _0x47704f[_0x39e6('0x2a')](_0x4619ee)[_0x39e6('0x2b')](function(_0x3dce4d){return _0x3dce4d;});}return null;};}function removeEntity(_0x5102d8,_0x537462){return function(_0x5e45cd){if(_0x5e45cd){return _0x5e45cd['destroy']()[_0x39e6('0x2b')](function(){_0x5102d8[_0x39e6('0x1f')](0xcc)[_0x39e6('0x20')]();});}};}function handleEntityNotFound(_0x19f780,_0x5c0c2e){return function(_0x39de88){if(!_0x39de88){_0x19f780[_0x39e6('0x1e')](0x194);}return _0x39de88;};}function handleError(_0x59ea28,_0xdb9c93){_0xdb9c93=_0xdb9c93||0x1f4;return function(_0x1a60ae){logger['error'](_0x1a60ae[_0x39e6('0x2c')]);if(_0x1a60ae[_0x39e6('0x2d')]){delete _0x1a60ae[_0x39e6('0x2d')];}_0x59ea28[_0x39e6('0x1f')](_0xdb9c93)[_0x39e6('0x2e')](_0x1a60ae);};}exports['index']=function(_0x21fce8,_0x596d6f){var _0x355ad9={},_0x14c4d3={},_0x3db607={'count':0x0,'rows':[]};var _0x3c01e9=_[_0x39e6('0x2f')](db[_0x39e6('0x30')][_0x39e6('0x31')],function(_0x373f95){return{'name':_0x373f95[_0x39e6('0x32')],'type':_0x373f95[_0x39e6('0x33')][_0x39e6('0x34')]};});_0x14c4d3[_0x39e6('0x35')]=_[_0x39e6('0x2f')](_0x3c01e9,_0x39e6('0x2d'));_0x14c4d3[_0x39e6('0x36')]=_[_0x39e6('0x37')](_0x21fce8['query']);_0x14c4d3[_0x39e6('0x38')]=_[_0x39e6('0x39')](_0x14c4d3[_0x39e6('0x35')],_0x14c4d3['query']);_0x355ad9[_0x39e6('0x3a')]=_[_0x39e6('0x39')](_0x14c4d3[_0x39e6('0x35')],qs['fields'](_0x21fce8[_0x39e6('0x36')]['fields']));_0x355ad9[_0x39e6('0x3a')]=_0x355ad9[_0x39e6('0x3a')][_0x39e6('0x3b')]?_0x355ad9['attributes']:_0x14c4d3[_0x39e6('0x35')];if(!_0x21fce8[_0x39e6('0x36')][_0x39e6('0x3c')](_0x39e6('0x3d'))){_0x355ad9['limit']=qs['limit'](_0x21fce8[_0x39e6('0x36')][_0x39e6('0x24')]);_0x355ad9[_0x39e6('0x22')]=qs[_0x39e6('0x22')](_0x21fce8[_0x39e6('0x36')][_0x39e6('0x22')]);}_0x355ad9[_0x39e6('0x3e')]=qs['sort'](_0x21fce8[_0x39e6('0x36')]['sort']);_0x355ad9['where']=qs[_0x39e6('0x38')](_[_0x39e6('0x3f')](_0x21fce8[_0x39e6('0x36')],_0x14c4d3[_0x39e6('0x38')]),_0x3c01e9);if(_0x21fce8[_0x39e6('0x36')][_0x39e6('0x40')]){_0x355ad9[_0x39e6('0x41')]=_[_0x39e6('0x42')](_0x355ad9['where'],{'$or':_[_0x39e6('0x2f')](_0x3c01e9,function(_0x45c84d){if(_0x45c84d[_0x39e6('0x33')]!==_0x39e6('0x43')){var _0x2662da={};_0x2662da[_0x45c84d['name']]={'$like':'%'+_0x21fce8['query'][_0x39e6('0x40')]+'%'};return _0x2662da;}})});}_0x355ad9=_[_0x39e6('0x42')]({},_0x355ad9,_0x21fce8['options']);var _0x365b10={'where':_0x355ad9[_0x39e6('0x41')]};return db['UserProfile']['count'](_0x365b10)[_0x39e6('0x2b')](function(_0xd3342a){_0x3db607['count']=_0xd3342a;if(_0x21fce8[_0x39e6('0x36')][_0x39e6('0x44')]){_0x355ad9[_0x39e6('0x45')]=[{'all':!![]}];}return db[_0x39e6('0x30')][_0x39e6('0x46')](_0x355ad9);})[_0x39e6('0x2b')](function(_0x28397d){_0x3db607[_0x39e6('0x47')]=_0x28397d;return _0x3db607;})['then'](respondWithFilteredResult(_0x596d6f,_0x355ad9))[_0x39e6('0x48')](handleError(_0x596d6f,null));};exports[_0x39e6('0x49')]=function(_0x463355,_0x5660e0){var _0x520236={'raw':![],'where':{'id':_0x463355[_0x39e6('0x4a')]['id']}},_0x149463={};_0x149463[_0x39e6('0x35')]=_[_0x39e6('0x37')](db[_0x39e6('0x30')][_0x39e6('0x31')]);_0x149463[_0x39e6('0x36')]=_['keys'](_0x463355['query']);_0x149463['filters']=_[_0x39e6('0x39')](_0x149463['model'],_0x149463[_0x39e6('0x36')]);_0x520236[_0x39e6('0x3a')]=_[_0x39e6('0x39')](_0x149463[_0x39e6('0x35')],qs[_0x39e6('0x4b')](_0x463355[_0x39e6('0x36')][_0x39e6('0x4b')]));_0x520236[_0x39e6('0x3a')]=_0x520236[_0x39e6('0x3a')][_0x39e6('0x3b')]?_0x520236['attributes']:_0x149463[_0x39e6('0x35')];if(_0x463355[_0x39e6('0x36')][_0x39e6('0x44')]){_0x520236[_0x39e6('0x45')]=[{'all':!![]}];}_0x520236=_['merge']({},_0x520236,_0x463355['options']);return db[_0x39e6('0x30')]['find'](_0x520236)[_0x39e6('0x2b')](handleEntityNotFound(_0x5660e0,null))[_0x39e6('0x2b')](respondWithResult(_0x5660e0,null))['catch'](handleError(_0x5660e0,null));};exports[_0x39e6('0x4c')]=function(_0x2300b9,_0xabd04b){return db[_0x39e6('0x30')][_0x39e6('0x4c')](_0x2300b9[_0x39e6('0x4d')],{})[_0x39e6('0x2b')](respondWithResult(_0xabd04b,0xc9))[_0x39e6('0x48')](handleError(_0xabd04b,null));};exports[_0x39e6('0x4e')]=function(_0x1bb029,_0x389b8c){var _0x142c49={'where':{'id':_0x1bb029[_0x39e6('0x4a')]['id']}},_0xb468b9={};_0xb468b9[_0x39e6('0x35')]=_[_0x39e6('0x37')](db[_0x39e6('0x30')]['rawAttributes']);_0x142c49[_0x39e6('0x3a')]=_['intersection'](_0xb468b9['model'],qs['fields'](_0x1bb029[_0x39e6('0x36')][_0x39e6('0x4b')]));_0x142c49[_0x39e6('0x3a')]=_0x142c49['attributes']['length']?_0x142c49[_0x39e6('0x3a')]:_0xb468b9['model'];if(_0x1bb029[_0x39e6('0x36')][_0x39e6('0x44')]){_0x142c49[_0x39e6('0x45')]=[{'all':!![]}];}_0x142c49=_['merge']({},_0x142c49,_0x1bb029[_0x39e6('0x4f')]);return db[_0x39e6('0x30')]['find'](_0x142c49)[_0x39e6('0x2b')](handleEntityNotFound(_0x389b8c,null))['then'](function(_0x41bca3){if(_0x41bca3){var _0x257812=_0x41bca3[_0x39e6('0x50')]({'plain':!![]});_0x257812=qs['omit'](_0x257812,['id',_0x39e6('0x51'),_0x39e6('0x52'),_0x39e6('0x53')]);_0x1bb029[_0x39e6('0x4d')]=_['omit'](_0x1bb029[_0x39e6('0x4d')],['id',_0x39e6('0x51'),_0x39e6('0x52')]);return db['sequelize']['transaction'](function(_0x4c13a1){return db['UserProfile'][_0x39e6('0x4c')](_[_0x39e6('0x42')](_0x257812,_0x1bb029[_0x39e6('0x4d')]),{'include':_0x1bb029[_0x39e6('0x36')][_0x39e6('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x4c13a1})[_0x39e6('0x2b')](function(_0x34ab5b){var _0xdd7c9a=_0x34ab5b['get']({'plain':!![]});return db[_0x39e6('0x54')]['findAll']({'where':{'userProfileId':_0x1bb029[_0x39e6('0x4a')]['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x28fe88){if(_0x28fe88){return BPromise[_0x39e6('0x55')](_0x28fe88,function(_0xbdf5e6){return new BPromise(function(_0x5d4298,_0x5ad7d5){if(_0xbdf5e6[_0x39e6('0x56')]===null||_0xbdf5e6[_0x39e6('0x56')]===0x1)_0x5d4298(null);return db[_0x39e6('0x57')]['findAll']({'where':{'sectionId':_0xbdf5e6['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x53d542){var _0x1d4cf5=_[_0x39e6('0x2f')](_0x53d542,function(_0x9abcb){return qs[_0x39e6('0x58')](_0x9abcb,['id',_0x39e6('0x51'),_0x39e6('0x52'),_0x39e6('0x59')]);});_0x5d4298(_0x1d4cf5);})[_0x39e6('0x48')](function(_0x14a611){_0x5ad7d5(_0x14a611);});})[_0x39e6('0x2b')](function(_0x42848a){var _0x252860=qs['omit'](_0xbdf5e6,['id',_0x39e6('0x51'),_0x39e6('0x52')]);_0x252860[_0x39e6('0x5a')]=_0xdd7c9a['id'];if(_0x42848a)_0x252860[_0x39e6('0x5b')]=_0x42848a;return _0x252860;})[_0x39e6('0x2b')](function(_0x420f60){return db[_0x39e6('0x54')]['create'](_0x420f60,{'include':[{'model':db['UserProfileResource'],'as':_0x39e6('0x5b')}],'raw':!![],'transaction':_0x4c13a1});});})[_0x39e6('0x2b')](function(){return _0xdd7c9a;});}});});});}})[_0x39e6('0x2b')](respondWithResult(_0x389b8c,0xc9))['catch'](handleError(_0x389b8c,null));};exports[_0x39e6('0x2a')]=function(_0x2d8863,_0x220ee7){if(_0x2d8863[_0x39e6('0x4d')]['id']){delete _0x2d8863[_0x39e6('0x4d')]['id'];}return db[_0x39e6('0x30')]['find']({'where':{'id':_0x2d8863[_0x39e6('0x4a')]['id']}})[_0x39e6('0x2b')](handleEntityNotFound(_0x220ee7,null))[_0x39e6('0x2b')](saveUpdates(_0x2d8863[_0x39e6('0x4d')],null))[_0x39e6('0x2b')](respondWithResult(_0x220ee7,null))[_0x39e6('0x48')](handleError(_0x220ee7,null));};exports['destroy']=function(_0x1dca0b,_0x21a7c1){return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0x1dca0b[_0x39e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21a7c1,null))['then'](removeEntity(_0x21a7c1,null))[_0x39e6('0x48')](handleError(_0x21a7c1,null));};exports[_0x39e6('0x5d')]=function(_0x2d7093,_0x26fc05){return db[_0x39e6('0x30')][_0x39e6('0x5d')]()[_0x39e6('0x2b')](respondWithResult(_0x26fc05,null))[_0x39e6('0x48')](handleError(_0x26fc05,null));};exports[_0x39e6('0x5e')]=function(_0xc326cd,_0x1c7374){var _0x160bde=_0xc326cd['body'];return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0xc326cd[_0x39e6('0x4a')]['id']}})[_0x39e6('0x2b')](handleEntityNotFound(_0x1c7374,null))[_0x39e6('0x2b')](function(_0x29a8c3){if(_0x29a8c3){return db['sequelize'][_0x39e6('0x5f')](function(_0x353145){return db[_0x39e6('0x54')][_0x39e6('0x60')]({'where':{'userProfileId':_0xc326cd['params']['id'],'sectionId':_[_0x39e6('0x2f')](_0x160bde,function(_0x14114c){return _0x14114c['sectionId'];})},'transaction':_0x353145})['then'](function(){var _0x13b076=_[_0x39e6('0x2f')](_0x160bde,function(_0x277a72){_0x277a72[_0x39e6('0x5a')]=_0xc326cd['params']['id'];return _0x277a72;});var _0x28b92d=[];return BPromise[_0x39e6('0x55')](_0x13b076,function(_0x343189){return db[_0x39e6('0x54')][_0x39e6('0x4c')](_0x343189,{'include':[{'model':db['UserProfileResource'],'as':_0x39e6('0x5b')}],'raw':!![],'transaction':_0x353145})[_0x39e6('0x2b')](function(_0x1b79b1){_0x28b92d[_0x39e6('0x61')](_0x1b79b1[_0x39e6('0x50')]({'plain':!![]}));});})[_0x39e6('0x2b')](function(){return _0x28b92d;});});});}})[_0x39e6('0x2b')](function(_0x8330f4){return _0x8330f4;})[_0x39e6('0x2b')](respondWithResult(_0x1c7374,null))[_0x39e6('0x48')](handleError(_0x1c7374,null));};exports[_0x39e6('0x62')]=function(_0x26d8b2,_0x2e8e45){var _0x5322e3;return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0x26d8b2[_0x39e6('0x4a')]['id']},'attributes':['id',_0x39e6('0x2d')]})[_0x39e6('0x2b')](handleEntityNotFound(_0x2e8e45,null))['then'](function(_0x3bdd22){if(_0x3bdd22){_0x5322e3=_0x3bdd22;return db[_0x39e6('0x54')][_0x39e6('0x60')]({'where':{'userProfileId':_0x26d8b2['params']['id'],'sectionId':_0x26d8b2[_0x39e6('0x36')][_0x39e6('0x63')]}});}})[_0x39e6('0x2b')](function(){return _0x5322e3;})['then'](respondWithStatusCode(_0x2e8e45,null))[_0x39e6('0x48')](handleError(_0x2e8e45,null));};exports[_0x39e6('0x64')]=function(_0x34b1e5,_0xa44463){var _0x441ef2=[];var _0x43b233=[];return db[_0x39e6('0x54')][_0x39e6('0x46')]({'where':{'userProfileId':_0x34b1e5['params']['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x1915e9){_0x441ef2=_[_0x39e6('0x40')](_0x1915e9,function(_0x38a5ad){return _0x38a5ad[_0x39e6('0x65')]===0x1||_[_0x39e6('0x66')]([0x3eb,0x709],_0x38a5ad[_0x39e6('0x59')]);});if(!_[_0x39e6('0x67')](_0x441ef2)){return _[_0x39e6('0x2f')](_0x441ef2,function(_0xaa739e){return _0xaa739e[_0x39e6('0x59')];});}else{return;}})['then'](function(_0x4ac85f){if(_0x4ac85f)_0x43b233=_0x4ac85f;if(_['includes'](_0x43b233,0x64)){var _0x26e0cf=_[_0x39e6('0x5c')](_0x441ef2,{'sectionId':0x64});return hasDefaultDashboard(_0x26e0cf)[_0x39e6('0x2b')](function(_0x5f4d80){return _[_0x39e6('0x2f')](_0x441ef2,function(_0x1f8af9){if(_0x1f8af9[_0x39e6('0x59')]===0x64){_0x1f8af9[_0x39e6('0x68')]=_0x5f4d80;}return _0x1f8af9;});});}else{return;}})[_0x39e6('0x2b')](function(_0x3c09e9){if(_0x3c09e9)_0x441ef2=_0x3c09e9;if(_[_0x39e6('0x66')](_0x43b233,0x3eb)){var _0x2e9e62=_[_0x39e6('0x5c')](_0x441ef2,{'sectionId':0x3eb});return getCustomDashboards(_0x2e9e62)['then'](function(_0xf0447c){return _['map'](_0x441ef2,function(_0x2527aa){if(_0x2e9e62[_0x39e6('0x65')]){if(_0x2527aa['sectionId']===0x3eb){_0x2527aa[_0x39e6('0x68')]=_0xf0447c;}}else{if(_0x2527aa['sectionId']===0x64){_0x2527aa[_0x39e6('0x68')]=_0xf0447c;}}return _0x2527aa;});});}else{return;}})[_0x39e6('0x2b')](function(_0x38fd87){if(_0x38fd87)_0x441ef2=_0x38fd87;if(_[_0x39e6('0x66')](_0x43b233,0x709)){var _0x37479f=_['find'](_0x441ef2,{'sectionId':0x709});return getPlugins(_0x37479f)['then'](function(_0x4d81a9){if(_0x37479f[_0x39e6('0x65')]){return _[_0x39e6('0x2f')](_0x441ef2,function(_0x1a5a12){if(_0x1a5a12[_0x39e6('0x59')]===0x709){_0x1a5a12[_0x39e6('0x68')]=_0x4d81a9;}return _0x1a5a12;});}else{var _0x724011={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4d81a9};var _0xfb23e3=_['map'](_0x441ef2);_0xfb23e3[_0x39e6('0x61')](_0x724011);return _0xfb23e3;}});}else{return;}})[_0x39e6('0x2b')](function(_0x81dd41){if(_0x81dd41)_0x441ef2=_0x81dd41;return _[_0x39e6('0x40')](_0x441ef2,['enabled',0x1]);})[_0x39e6('0x2b')](respondWithResult(_0xa44463,null))[_0x39e6('0x48')](handleError(_0xa44463,null));};function hasDefaultDashboard(_0x479a61){var _0x40e98d=[0x65];return new BPromise(function(_0xc231ba,_0xb0f224){try{if(_0x479a61['autoAssociation']){_0xc231ba(_0x40e98d);}else{return db[_0x39e6('0x57')][_0x39e6('0x69')]({'where':{'sectionId':_0x479a61['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x4cb13a){_0x4cb13a?_0xc231ba(_0x40e98d):_0xc231ba();});}}catch(_0x515b46){_0xb0f224(_0x515b46);}});}function getCustomDashboards(_0x33b774){var _0x54794e=[];return new BPromise(function(_0x22183d,_0x404413){try{if(_0x33b774['autoAssociation']){return db[_0x39e6('0x6a')]['findAll']({'raw':!![]})['then'](function(_0x1acc91){_0x1acc91[_0x39e6('0x6b')](function(_0x3f62df){_0x54794e['push'](_0x3f62df['id']+0x1869f);});_0x22183d(_0x54794e);});}else{return db[_0x39e6('0x57')][_0x39e6('0x46')]({'where':{'sectionId':_0x33b774['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x4cdddf){_0x4cdddf[_0x39e6('0x6b')](function(_0x303599){_0x54794e[_0x39e6('0x61')](_0x303599['resourceId']+0x1869f);});_0x22183d(_0x54794e);});}}catch(_0x51e679){_0x404413(_0x51e679);}});}function getPlugins(_0xe0c7a7){var _0x58ed0a=[];return new BPromise(function(_0x1872e3,_0x3fc990){try{if(_0xe0c7a7[_0x39e6('0x56')]){return db[_0x39e6('0x6c')][_0x39e6('0x46')]({'raw':!![]})[_0x39e6('0x2b')](function(_0x316a2b){_0x316a2b[_0x39e6('0x6b')](function(_0x5e5f8f){_0x58ed0a[_0x39e6('0x61')](_0x5e5f8f['id']+0x15b38);});_0x1872e3(_0x58ed0a);});}else{return db['UserProfileResource'][_0x39e6('0x46')]({'where':{'sectionId':_0xe0c7a7['id']},'raw':!![]})['then'](function(_0x265a09){_0x265a09[_0x39e6('0x6b')](function(_0x35d5e2){_0x58ed0a['push'](_0x35d5e2['resourceId']+0x15b38);});_0x1872e3(_0x58ed0a);});}}catch(_0x41db63){_0x3fc990(_0x41db63);}});}exports[_0x39e6('0x6d')]=function(_0x2aa212,_0x32e967){return db['UserProfile']['find']({'where':{'id':_0x2aa212[_0x39e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e967,null))[_0x39e6('0x2b')](function(_0x363d83){if(_0x363d83){return db[_0x39e6('0x6e')][_0x39e6('0x5f')](function(_0x4b62e2){return db[_0x39e6('0x54')][_0x39e6('0x46')]({'where':{'userProfileId':_0x2aa212[_0x39e6('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x48c9ae){if(_0x48c9ae){return db['UserProfileSection'][_0x39e6('0x60')]({'where':{'userProfileId':_0x2aa212[_0x39e6('0x4a')]['id'],'id':_[_0x39e6('0x2f')](_0x48c9ae,function(_0xd70298){return _0xd70298['id'];})},'transaction':_0x4b62e2});}})['then'](function(_0x32cf3a){var _0x38c744=_[_0x39e6('0x2f')](_0x2aa212['body'],function(_0x30da4e){_0x30da4e[_0x39e6('0x5a')]=_0x2aa212['params']['id'];return _0x30da4e;});return db['UserProfileSection'][_0x39e6('0x6f')](_0x38c744,{'raw':!![],'transaction':_0x4b62e2});})['then'](function(_0x1cadd0){var _0x24edee=_['filter'](_[_0x39e6('0x2f')](_0x1cadd0,function(_0x38e3df){return _0x38e3df['get']({'plain':!![]});}),{'includeAll':![]});if(_0x24edee){return db[_0x39e6('0x54')][_0x39e6('0x46')]({'where':{'userProfileId':_0x2aa212[_0x39e6('0x4a')]['id'],'sectionId':_[_0x39e6('0x2f')](_0x24edee,function(_0x23e38d){return _0x23e38d[_0x39e6('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x1e3250){var _0x30cf71=_[_0x39e6('0x2f')](_0x2aa212[_0x39e6('0x4d')],function(_0x39cc58){_0x39cc58['userProfileId']=_0x2aa212['params']['id'];return _0x39cc58;});return db[_0x39e6('0x57')][_0x39e6('0x6f')](_0x30cf71,{'raw':!![],'transaction':_0x4b62e2});});}})['catch'](handleError(_0x32e967,null));});}})[_0x39e6('0x2b')](function(_0x5188c1){var _0x21b89d=_[_0x39e6('0x2f')](_0x5188c1,function(_0x4e4710){return _0x4e4710['get']({'plain':!![]});});})[_0x39e6('0x2b')](respondWithResult(_0x32e967,null))[_0x39e6('0x48')](handleError(_0x32e967,null));};exports['removeResources']=function(_0x24710a,_0x169b77,_0x333563){return db['UserProfile'][_0x39e6('0x5c')]({'where':{'id':_0x24710a['params']['id']}})[_0x39e6('0x2b')](handleEntityNotFound(_0x169b77,null))[_0x39e6('0x2b')](function(_0x168475){if(_0x168475){return _0x168475[_0x39e6('0x70')](_0x24710a['query']['ids']);}})[_0x39e6('0x2b')](respondWithStatusCode(_0x169b77,null))[_0x39e6('0x48')](handleError(_0x169b77,null));};exports[_0x39e6('0x71')]=function(_0x40cf76,_0x10c7bc){var _0x468bd5={};if(!_0x40cf76[_0x39e6('0x36')][_0x39e6('0x72')])throw new Error(_0x39e6('0x73'));if(!_0x40cf76[_0x39e6('0x36')]['hasOwnProperty'](_0x39e6('0x3d'))){_0x468bd5[_0x39e6('0x24')]=qs[_0x39e6('0x24')](_0x40cf76[_0x39e6('0x36')][_0x39e6('0x24')]);_0x468bd5['offset']=qs['offset'](_0x40cf76[_0x39e6('0x36')]['offset']);}return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0x40cf76[_0x39e6('0x4a')]['id']}})[_0x39e6('0x2b')](function(_0x448a43){if(!_0x448a43)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x40cf76[_0x39e6('0x4a')]['id']);return db[_0x39e6('0x30')][_0x39e6('0x71')](_0x40cf76);})[_0x39e6('0x2b')](respondWithFilteredResult(_0x10c7bc,_0x468bd5))[_0x39e6('0x48')](handleError(_0x10c7bc,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b607e9c..596673a 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 _0xcedf=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile'];(function(_0x5497d3,_0x193adf){var _0x42f1ef=function(_0x83263f){while(--_0x83263f){_0x5497d3['push'](_0x5497d3['shift']());}};_0x42f1ef(++_0x193adf);}(_0xcedf,0x1b6));var _0xfced=function(_0x5ec6d9,_0xc1413a){_0x5ec6d9=_0x5ec6d9-0x0;var _0x4d0a8d=_0xcedf[_0x5ec6d9];return _0x4d0a8d;};'use strict';var EventEmitter=require(_0xfced('0x0'));var UserProfile=require(_0xfced('0x1'))['db'][_0xfced('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xfced('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfced('0x4'),'afterDestroy':_0xfced('0x5')};function emitEvent(_0x4c426b){return function(_0x5b16af,_0x1dad76,_0x4a86d5){UserProfileEvents[_0xfced('0x6')](_0x4c426b+':'+_0x5b16af['id'],_0x5b16af);UserProfileEvents['emit'](_0x4c426b,_0x5b16af);_0x4a86d5(null);};}for(var e in events){if(events[_0xfced('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xfced('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x6c65=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xd66b7f,_0x5104dd){var _0x14fc93=function(_0x377e4f){while(--_0x377e4f){_0xd66b7f['push'](_0xd66b7f['shift']());}};_0x14fc93(++_0x5104dd);}(_0x6c65,0x78));var _0x56c6=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0x6c65[_0x29dda1];return _0x21b0ef;};'use strict';var EventEmitter=require(_0x56c6('0x0'));var UserProfile=require(_0x56c6('0x1'))['db'][_0x56c6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x56c6('0x3')](0x0);var events={'afterCreate':_0x56c6('0x4'),'afterUpdate':_0x56c6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x43d710){return function(_0x4321ef,_0x3f532d,_0x1e70f2){UserProfileEvents[_0x56c6('0x6')](_0x43d710+':'+_0x4321ef['id'],_0x4321ef);UserProfileEvents['emit'](_0x43d710,_0x4321ef);_0x1e70f2(null);};}for(var e in events){if(events[_0x56c6('0x7')](e)){var event=events[e];UserProfile[_0x56c6('0x8')](e,emitEvent(event));}}module[_0x56c6('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 94fed76..9d6ecbb 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 _0x3a6d=['queue','VoiceQueue','inbound','type','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','Reports','reportId','AnalyticMetric','toUpperCase','slice','QueryTypes','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','section','isEmpty','push','UserProfileSection','find','all','ignore','union','length','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','default','DefaultReports','custom','CustomReports','count','include','ThroughTags','color','tag','rows','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x3a6d,0x143));var _0xd3a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3a6d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd3a6('0x0'));var attributes=require(_0xd3a6('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xd3a6('0x2'));module[_0xd3a6('0x3')]=function(_0x31619a){var _0x37a8f2=_0x31619a[_0xd3a6('0x4')];function _0x585473(_0x1cb966,_0x27d641){return new Promise(function(_0x1e44bd,_0x1fc450){if(!_0x27d641)return _0x1e44bd(null);var _0x25b042=_0x27d641[_0xd3a6('0x5')]?{[_0x27d641['filter'][_0xd3a6('0x6')]]:_0x27d641[_0xd3a6('0x5')][_0xd3a6('0x7')]}:undefined;return _0x37a8f2[_0x1cb966][_0xd3a6('0x8')]({'where':_0x25b042,'raw':!![]})[_0xd3a6('0x9')](function(_0xa67661){_0x27d641[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0xa67661,'id');_0x1e44bd(_0x27d641);})[_0xd3a6('0xc')](function(_0x5ab5a9){_0x1fc450(_0x5ab5a9);});});}function _0x172513(_0x1a00f7,_0x3f4d74){return new Promise(function(_0x225399,_0x2bd4f0){var _0x517a3b=_0x1a00f7['filter']?{[_0x1a00f7['filter'][_0xd3a6('0x6')]]:_0x1a00f7[_0xd3a6('0x5')][_0xd3a6('0x7')]}:undefined;return _0x37a8f2[_0x1a00f7[_0xd3a6('0xd')]][_0xd3a6('0x8')]({'where':_0x517a3b,'raw':!![]})[_0xd3a6('0x9')](function(_0xa56452){_0x3f4d74['associatedResources']=_[_0xd3a6('0xb')](_0xa56452,function(_0xf5ace5){return _0xf5ace5[_0xd3a6('0xe')];});_0x225399(_0x3f4d74);})['catch'](function(_0x3c2399){_0x2bd4f0(_0x3c2399);});});}function _0x305b61(_0x1781f6,_0x57d826,_0x3498d5){if(!_0x57d826)return Promise['resolve'](null);return new Promise(function(_0x518b6d,_0x28b63c){return _0x37a8f2[_0xd3a6('0xf')][_0xd3a6('0x8')]({'where':{'sectionId':_0x57d826['id']},'raw':!![]})[_0xd3a6('0x9')](function(_0x22fb05){if(_0x1781f6[_0xd3a6('0x6')]&&_0x1781f6[_0xd3a6('0x6')]!=='id'){_0x57d826['associatedResources']=_[_0xd3a6('0xb')](_0x22fb05,function(_0x4e78ec){return _0x4e78ec[_0x1781f6[_0xd3a6('0x6')]];});}else{if(_0x3498d5===_0xd3a6('0x10')){_0x57d826[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0x22fb05,function(_0x465d25){return{'id':_0x465d25[_0xd3a6('0x11')],'type':_0x465d25['type']};});}else{_0x57d826[_0xd3a6('0xa')]=_[_0xd3a6('0xb')](_0x22fb05,function(_0x57cf15){return _0x57cf15['resourceId'];});}}_0x518b6d(_0x57d826);})['catch'](function(_0x573870){_0x28b63c(_0x573870);});});}function _0x5c9075(_0x98a12a,_0x400982){var _0x3d0b28={'parentSections':[]};switch(_0x98a12a['toLowerCase']()){case _0xd3a6('0x12'):_0x3d0b28['childModel']=_0xd3a6('0x13');break;case _0xd3a6('0x14'):_0x3d0b28[_0xd3a6('0x15')]='SquareOdbc';break;case _0xd3a6('0x16'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x17');_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x19'),'field':_0xd3a6('0xe'),'foreignKey':'projectName'}];break;case _0xd3a6('0x1a'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x1b');break;case _0xd3a6('0x1c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x1d');_0x3d0b28['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0xd3a6('0x1e')}];break;case _0xd3a6('0x1f'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x20');break;case'companies':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x21');break;case'globalcustomfields':_0x3d0b28[_0xd3a6('0x15')]='CmCustomField';break;case _0xd3a6('0x22'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x23');break;case _0xd3a6('0x24'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x25');break;case _0xd3a6('0x26'):_0x3d0b28['childModel']='FaxQueue';break;case _0xd3a6('0x27'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x28');break;case'inboundroutes':case _0xd3a6('0x29'):case _0xd3a6('0x2a'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x2b');break;case _0xd3a6('0x2c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x2d');break;case _0xd3a6('0x2e'):_0x3d0b28['childModel']=_0xd3a6('0x2f');break;case _0xd3a6('0x30'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x31');_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x32'),'field':'name','foreignKey':_0xd3a6('0x33'),'model':'User','filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x35')]}},{'name':_0xd3a6('0x36'),'field':_0xd3a6('0xe'),'foreignKey':'membername','model':'User','filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x37')]}},{'name':_0xd3a6('0x38'),'field':'name','foreignKey':_0xd3a6('0x39'),'model':_0xd3a6('0x3a'),'filter':{'field':'type','value':[_0xd3a6('0x3b')]}},{'name':'QueueCampaigns','field':_0xd3a6('0xe'),'foreignKey':_0xd3a6('0x39'),'model':'VoiceQueue','filter':{'field':_0xd3a6('0x3c'),'value':['outbound']}}];break;case _0xd3a6('0x3d'):_0x3d0b28[_0xd3a6('0x15')]='VoiceMusicOnHold';break;case _0xd3a6('0x3e'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x3f');break;case _0xd3a6('0x40'):_0x3d0b28['childModel']=_0xd3a6('0x41');break;case _0xd3a6('0x42'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x43');break;case _0xd3a6('0x44'):_0x3d0b28['childModel']=_0xd3a6('0x45');break;case'mailaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x46');break;case _0xd3a6('0x47'):_0x3d0b28['childModel']=_0xd3a6('0x48');break;case'openchannelqueues':_0x3d0b28[_0xd3a6('0x15')]='OpenchannelQueue';break;case _0xd3a6('0x49'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x4a');break;case _0xd3a6('0x4b'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x4c');break;case _0xd3a6('0x4d'):_0x3d0b28['childModel']=_0xd3a6('0x4e');break;case _0xd3a6('0x4f'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x50');break;case'whatsappaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x51');break;case _0xd3a6('0x52'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x53');break;case _0xd3a6('0x54'):case _0xd3a6('0x55'):_0x3d0b28[_0xd3a6('0x15')]='VoiceQueue';if(_0x400982){_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x38')},{'name':_0xd3a6('0x56')}];}break;case _0xd3a6('0x57'):case _0xd3a6('0x58'):case'telephones':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x59');if(_0x400982){_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x5a'),'filter':{'field':_0xd3a6('0x34'),'value':[_0xd3a6('0x5b'),_0xd3a6('0x5c')]},'ignore':!![]},{'name':_0xd3a6('0x32')},{'name':'Telephones'}];}break;case _0xd3a6('0x5d'):_0x3d0b28['childModel']=_0xd3a6('0x5e');break;case _0xd3a6('0x5f'):_0x3d0b28['childModel']=_0xd3a6('0x60');break;case _0xd3a6('0x61'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x62');break;case _0xd3a6('0x63'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x64');break;case _0xd3a6('0x65'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x66');break;case'zohoaccounts':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x67');break;case _0xd3a6('0x68'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x59');break;case _0xd3a6('0x69'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6a');break;case _0xd3a6('0x6b'):_0x3d0b28[_0xd3a6('0x15')]='Disposition';break;case _0xd3a6('0x6c'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6d');break;case'intervals':_0x3d0b28[_0xd3a6('0x15')]='Interval';break;case'pauses':_0x3d0b28['childModel']='Pause';break;case _0xd3a6('0x6e'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x6f');break;case _0xd3a6('0x70'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x71');break;case _0xd3a6('0x72'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x73');break;case _0xd3a6('0x74'):_0x3d0b28['childModel']='Template';break;case _0xd3a6('0x75'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x76');break;case _0xd3a6('0x77'):_0x3d0b28[_0xd3a6('0x15')]='Trunk';break;case _0xd3a6('0x78'):_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x79');break;case _0xd3a6('0x7a'):_0x3d0b28['childModel']='Plugin';break;case _0xd3a6('0x7b'):_0x3d0b28[_0xd3a6('0x15')]='AnalyticExtractedReport';_0x3d0b28[_0xd3a6('0x18')]=[{'name':_0xd3a6('0x7c'),'field':'id','foreignKey':_0xd3a6('0x7d')}];break;case'metrics':_0x3d0b28[_0xd3a6('0x15')]=_0xd3a6('0x7e');break;}return _0x3d0b28;}function _0x5dc8fd(_0x10b56f,_0x3c4fa9){var _0x5134fa=_0x10b56f['charAt'](0x0)[_0xd3a6('0x7f')]()+_0x10b56f[_0xd3a6('0x80')](0x1);var _0x4e02fb={'type':_0x37a8f2['Sequelize'][_0xd3a6('0x81')]['SELECT'],'raw':!![]};return new Promise(function(_0x3354cf,_0x3b5f26){var _0x5b1fc9=squel[_0xd3a6('0x82')]()['field']('ui.'+_0x5134fa+_0xd3a6('0x83'),'id')['field'](_0xd3a6('0x84'))[_0xd3a6('0x85')](_0xd3a6('0x86')+_0x10b56f+_0xd3a6('0x87'),'ui')[_0xd3a6('0x88')]('ui.UserId\x20=\x20?',_0x3c4fa9['id']);return _0x37a8f2[_0xd3a6('0x89')][_0xd3a6('0x8a')](_0x5b1fc9[_0xd3a6('0x8b')](),_0x4e02fb)[_0xd3a6('0x9')](function(_0x52a65e){_0x3c4fa9[_0x5134fa+_0xd3a6('0x8c')]=_0x52a65e;_0x3354cf(_0x52a65e);})[_0xd3a6('0xc')](function(_0x911ff0){_0x3b5f26(_0x911ff0);});});}return _0x31619a[_0xd3a6('0x8d')](_0xd3a6('0x8e'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x49cc6e){var _0x24115a={'raw':![],'where':{}};var _0x49bec2={};var _0xd2f49={'count':0x0,'rows':[]};var _0x2a1d67=_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0x8f')];var _0x3c6b26=_0x49cc6e['query']['mergeResources']||![];var _0x20e881=_0x5c9075(_0x2a1d67,_0x3c6b26);if(!_0x20e881['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x2a1d67+'\x27');var _0xf8b715=[{'name':_0x2a1d67}];if(!_[_0xd3a6('0x90')](_0x20e881[_0xd3a6('0x18')]))_0xf8b715=_0x20e881[_0xd3a6('0x18')];var _0x3818fd=[];for(var _0x3f79cd=0x0;_0x3f79cd<_0xf8b715['length'];_0x3f79cd++){_0x3818fd[_0xd3a6('0x91')](_0x37a8f2[_0xd3a6('0x92')][_0xd3a6('0x93')]({'where':{'userProfileId':_0x49cc6e['params']['id'],'name':_0xf8b715[_0x3f79cd][_0xd3a6('0xe')]},'raw':!![]}));}return Promise[_0xd3a6('0x94')](_0x3818fd)['then'](function(_0x224b20){var _0x5a7749=_[_0xd3a6('0x5')](_0x224b20,function(_0x2c3b55){return _0x2c3b55?_0x2c3b55:undefined;});var _0x26748e=_['filter'](_0xf8b715,[_0xd3a6('0x95'),!![]]);var _0x4c1204=_[_0xd3a6('0x90')](_0x5a7749)&&_[_0xd3a6('0x90')](_0x26748e)?null:_[_0xd3a6('0x96')](_0x26748e,_0x5a7749);if(!_0x4c1204)return null;var _0x5287f0=[];for(var _0x17cb54=0x0;_0x17cb54<_0x4c1204[_0xd3a6('0x97')];_0x17cb54++){var _0x532b07=_[_0xd3a6('0x93')](_0xf8b715,function(_0x25c2f8){return _0x4c1204[_0x17cb54]?_0x25c2f8[_0xd3a6('0xe')]===_0x4c1204[_0x17cb54][_0xd3a6('0xe')]:null;});if(_0x532b07){if(_0x4c1204[_0x17cb54][_0xd3a6('0x95')]){_0x5287f0[_0xd3a6('0x91')](_0x585473(_0x20e881['childModel'],_0x4c1204[_0x17cb54]));}else{if(!_0x4c1204[_0x17cb54]['autoAssociation']){_0x5287f0[_0xd3a6('0x91')](_0x305b61(_0x532b07,_0x4c1204[_0x17cb54],_0x20e881[_0xd3a6('0x15')]));}else{if(_0x532b07[_0xd3a6('0xd')]){_0x5287f0[_0xd3a6('0x91')](_0x172513(_0x532b07,_0x4c1204[_0x17cb54]));}}}}}return Promise['all'](_0x5287f0);})[_0xd3a6('0x9')](function(_0x2a1495){var _0x377f28=_0x2a1495;var _0x477feb=null;if(_0x377f28){_0x477feb=_0x377f28['length']===0x1?_0x377f28[0x0]:null;}if(!_0x477feb&&!_0x377f28)return _0xd2f49;var _0x30815f=_0x37a8f2[_0x20e881['childModel']][_0xd3a6('0x98')];_0x49bec2[_0xd3a6('0xd')]=_[_0xd3a6('0x99')](_0x30815f);_0x49bec2[_0xd3a6('0x8a')]=_[_0xd3a6('0x99')](_0x49cc6e[_0xd3a6('0x8a')]);_0x49bec2[_0xd3a6('0x9a')]=_[_0xd3a6('0x9b')](_0x49bec2[_0xd3a6('0xd')],_0x49bec2[_0xd3a6('0x8a')]);_0x24115a[_0xd3a6('0x9c')]=_[_0xd3a6('0x9b')](_0x49bec2['model'],qs[_0xd3a6('0x9d')](_0x49cc6e['query'][_0xd3a6('0x9d')]));_0x24115a[_0xd3a6('0x9c')]=_0x24115a[_0xd3a6('0x9c')]['length']?_0x24115a[_0xd3a6('0x9c')]:_0x49bec2[_0xd3a6('0xd')];if(!_0x49cc6e['query'][_0xd3a6('0x9e')](_0xd3a6('0x9f'))){_0x24115a[_0xd3a6('0xa0')]=qs[_0xd3a6('0xa0')](_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xa0')]);_0x24115a[_0xd3a6('0xa1')]=qs[_0xd3a6('0xa1')](_0x49cc6e['query'][_0xd3a6('0xa1')]);}_0x24115a[_0xd3a6('0xa2')]=qs[_0xd3a6('0xa3')](_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xa3')]);_0x24115a[_0xd3a6('0x88')]=qs[_0xd3a6('0x9a')](_[_0xd3a6('0xa4')](_0x49cc6e[_0xd3a6('0x8a')],_0x49bec2[_0xd3a6('0x9a')]));if(_0x49cc6e[_0xd3a6('0x8a')]['filter']){_0x24115a[_0xd3a6('0x88')]=_['merge'](_0x24115a[_0xd3a6('0x88')],{'$or':_[_0xd3a6('0xb')](_0x30815f,function(_0x5e9dda){if(_0x5e9dda[_0xd3a6('0x3c')][_0xd3a6('0xa5')]!==_0xd3a6('0xa6')){var _0x13beb2={};_0x13beb2[_0x5e9dda[_0xd3a6('0x6')]]={'$like':'%'+_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0x5')]+'%'};return _0x13beb2;}})});}var _0x2bed51=[];var _0xa62210=null;var _0xf95987={};if(_0x477feb){_0xa62210=_[_0xd3a6('0x93')](_0xf8b715,['name',_0x477feb[_0xd3a6('0xe')]]);if(_0xa62210[_0xd3a6('0x6')]){_0xf95987={};if(_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x10')){_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_[_0xd3a6('0xb')](_0x477feb['associatedResources'],'id');}else{_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_0x477feb[_0xd3a6('0xa')];}_0x2bed51['push'](_0xf95987);}else{_0x24115a[_0xd3a6('0x88')]['id']=_0x477feb['associatedResources'];}}else{for(var _0x310a4f=0x0;_0x310a4f<_0x377f28[_0xd3a6('0x97')];_0x310a4f++){_0xa62210=_['find'](_0xf8b715,[_0xd3a6('0xe'),_0x377f28[_0x310a4f][_0xd3a6('0xe')]]);if(_0xa62210[_0xd3a6('0x6')]){_0xf95987={};_0xf95987[_0xa62210[_0xd3a6('0xa7')]]=_0x377f28[_0x310a4f]['associatedResources'];_0x2bed51['push'](_0xf95987);}else{if(!_0x24115a[_0xd3a6('0x88')]['id'])_0x24115a[_0xd3a6('0x88')]['id']=[];_0x377f28[_0x310a4f][_0xd3a6('0xa')][_0xd3a6('0xa8')](function(_0x154fb1){_0x24115a['where']['id'][_0xd3a6('0x91')](_0x154fb1);});}}}if(!_[_0xd3a6('0x90')](_0x2bed51)){_0x24115a[_0xd3a6('0x88')]=_[_0xd3a6('0xa9')](_0x24115a[_0xd3a6('0x88')],{'$and':{'$or':_0x2bed51}});}_0x24115a=_[_0xd3a6('0xa9')]({},_0x24115a,_0x49cc6e[_0xd3a6('0xaa')]);if(_0x477feb&&!_0x477feb[_0xd3a6('0xab')]&&_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x10')){if(_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xac')]){_0x24115a['include']=[{'all':!![]}];}return _0x37a8f2[_0x20e881['childModel']]['findAll'](_0x24115a)[_0xd3a6('0x9')](function(_0x18ba56){var _0x58bf33=[];_0x18ba56[_0xd3a6('0xa8')](function(_0x29126f){var _0x339f68;switch(_0x29126f['reportType']){case _0xd3a6('0xad'):_0x339f68=_[_0xd3a6('0x93')](_0x477feb[_0xd3a6('0xa')],function(_0x2b39cb){return _0x2b39cb['id']===_0x29126f['reportId']&&_0x2b39cb['type']===_0xd3a6('0xae');});break;case _0xd3a6('0xaf'):_0x339f68=_[_0xd3a6('0x93')](_0x477feb['associatedResources'],function(_0x4d95f5){return _0x4d95f5['id']===_0x29126f[_0xd3a6('0x7d')]&&_0x4d95f5[_0xd3a6('0x3c')]===_0xd3a6('0xb0');});break;}if(_0x339f68)_0x58bf33['push'](_0x29126f);});_0xd2f49[_0xd3a6('0xb1')]=_0x58bf33[_0xd3a6('0x97')];_0xd2f49['rows']=_0x58bf33;return _0xd2f49;});}else{return _0x37a8f2[_0x20e881[_0xd3a6('0x15')]]['count']({'where':_0x24115a[_0xd3a6('0x88')]})[_0xd3a6('0x9')](function(_0x3834ba){_0xd2f49[_0xd3a6('0xb1')]=_0x3834ba;if(_0x49cc6e['query']['includeAll']){if(_0x20e881[_0xd3a6('0x15')]===_0xd3a6('0x1d')){_0x24115a[_0xd3a6('0xb2')]=[{'model':_0x37a8f2['Tag'],'as':'Tags','attributes':['id',_0xd3a6('0xe'),'color'],'required':_0x49cc6e[_0xd3a6('0x8a')]['tag']?!![]:![]},{'model':_0x37a8f2[_0xd3a6('0x73')],'as':_0xd3a6('0xb3'),'attributes':['id',_0xd3a6('0xe'),_0xd3a6('0xb4')],'through':_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xb5')]?{'attributes':[],'where':{'TagId':_0x49cc6e[_0xd3a6('0x8a')][_0xd3a6('0xb5')]||undefined}}:{},'required':_0x49cc6e[_0xd3a6('0x8a')]['tag']?!![]:![]}];}else{_0x24115a['include']=[{'all':!![]}];}}return _0x37a8f2[_0x20e881['childModel']][_0xd3a6('0x8')](_0x24115a);})[_0xd3a6('0x9')](function(_0x31a6fb){_0xd2f49[_0xd3a6('0xb6')]=_0x31a6fb;if(_0x2a1d67===_0xd3a6('0x32')&&_0x49cc6e[_0xd3a6('0x8a')]['openTabs']===_0xd3a6('0xb7')){var _0x339674=[];for(var _0x4e643b=0x0;_0x4e643b<_0xd2f49[_0xd3a6('0xb6')][_0xd3a6('0x97')];_0x4e643b++){_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xb8'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xba'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd(_0xd3a6('0xbb'),_0xd2f49['rows'][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd('mail',_0xd2f49[_0xd3a6('0xb6')][_0x4e643b][_0xd3a6('0xb9')]));_0x339674['push'](_0x5dc8fd(_0xd3a6('0xbc'),_0xd2f49['rows'][_0x4e643b][_0xd3a6('0xb9')]));_0x339674[_0xd3a6('0x91')](_0x5dc8fd(_0xd3a6('0xbd'),_0xd2f49[_0xd3a6('0xb6')][_0x4e643b]['dataValues']));}return Promise[_0xd3a6('0x94')](_0x339674)[_0xd3a6('0x9')](function(){return _0xd2f49;});}return _0xd2f49;});}});}}});}; \ No newline at end of file +var _0xed1c=['UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','union','autoAssociation','all','keys','filters','intersection','attributes','nolimit','limit','offset','where','pick','key','VIRTUAL','foreignKey','merge','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','rows','count','CmContact','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','Lists','ListId','lists','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','admin','user','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Variable','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','ui.UserId\x20=\x20?','query','OpenTabs','define'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xed1c,0xe4));var _0xced1=function(_0x5c10bd,_0x445068){_0x5c10bd=_0x5c10bd-0x0;var _0x17cc9f=_0xed1c[_0x5c10bd];return _0x17cc9f;};'use strict';var _=require(_0xced1('0x0'));var attributes=require(_0xced1('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module['exports']=function(_0x4c3102){var _0x424db6=_0x4c3102[_0xced1('0x2')];function _0x79202e(_0x47a45c,_0x1e23a9){return new Promise(function(_0x445160,_0x466657){if(!_0x1e23a9)return _0x445160(null);var _0x37b22b=_0x1e23a9['filter']?{[_0x1e23a9[_0xced1('0x3')][_0xced1('0x4')]]:_0x1e23a9[_0xced1('0x3')][_0xced1('0x5')]}:undefined;return _0x424db6[_0x47a45c][_0xced1('0x6')]({'where':_0x37b22b,'raw':!![]})[_0xced1('0x7')](function(_0x325dd2){_0x1e23a9[_0xced1('0x8')]=_['map'](_0x325dd2,'id');_0x445160(_0x1e23a9);})[_0xced1('0x9')](function(_0x59c820){_0x466657(_0x59c820);});});}function _0x3464f3(_0x15e99f,_0x1edaaa){return new Promise(function(_0x18c028,_0x15f678){var _0x44b05c=_0x15e99f[_0xced1('0x3')]?{[_0x15e99f['filter'][_0xced1('0x4')]]:_0x15e99f[_0xced1('0x3')][_0xced1('0x5')]}:undefined;return _0x424db6[_0x15e99f[_0xced1('0xa')]]['findAll']({'where':_0x44b05c,'raw':!![]})[_0xced1('0x7')](function(_0x31a32c){_0x1edaaa['associatedResources']=_[_0xced1('0xb')](_0x31a32c,function(_0x26f81){return _0x26f81[_0xced1('0xc')];});_0x18c028(_0x1edaaa);})[_0xced1('0x9')](function(_0x47baec){_0x15f678(_0x47baec);});});}function _0x5560af(_0x3eb3ac,_0x4178d8,_0x236473){if(!_0x4178d8)return Promise[_0xced1('0xd')](null);return new Promise(function(_0x3e53bd,_0x292997){return _0x424db6['UserProfileResource']['findAll']({'where':{'sectionId':_0x4178d8['id']},'raw':!![]})[_0xced1('0x7')](function(_0x111fb0){if(_0x3eb3ac[_0xced1('0x4')]&&_0x3eb3ac['field']!=='id'){_0x4178d8[_0xced1('0x8')]=_[_0xced1('0xb')](_0x111fb0,function(_0x3e51e4){return _0x3e51e4[_0x3eb3ac['field']];});}else{if(_0x236473===_0xced1('0xe')){_0x4178d8[_0xced1('0x8')]=_[_0xced1('0xb')](_0x111fb0,function(_0x4819fd){return{'id':_0x4819fd[_0xced1('0xf')],'type':_0x4819fd[_0xced1('0x10')]};});}else{_0x4178d8[_0xced1('0x8')]=_['map'](_0x111fb0,function(_0x4dab56){return _0x4dab56[_0xced1('0xf')];});}}_0x3e53bd(_0x4178d8);})[_0xced1('0x9')](function(_0x2a6248){_0x292997(_0x2a6248);});});}function _0x20dcb4(_0x210d7e,_0x49c8b9){var _0x14f47e={'parentSections':[]};switch(_0x210d7e[_0xced1('0x11')]()){case'squareprojects':_0x14f47e['childModel']=_0xced1('0x12');break;case _0xced1('0x13'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x15');break;case _0xced1('0x16'):_0x14f47e[_0xced1('0x14')]='SquareRecording';_0x14f47e[_0xced1('0x17')]=[{'name':_0xced1('0x18'),'field':_0xced1('0xc'),'foreignKey':_0xced1('0x19')}];break;case _0xced1('0x1a'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x1b');break;case'contacts':_0x14f47e[_0xced1('0x14')]='CmContact';_0x14f47e[_0xced1('0x17')]=[{'name':_0xced1('0x1c'),'field':'id','foreignKey':_0xced1('0x1d')}];break;case _0xced1('0x1e'):_0x14f47e['childModel']='CmList';break;case _0xced1('0x1f'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x20');break;case'globalcustomfields':_0x14f47e['childModel']='CmCustomField';break;case _0xced1('0x21'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x22');break;case _0xced1('0x23'):_0x14f47e['childModel']=_0xced1('0x24');break;case _0xced1('0x25'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x26');break;case _0xced1('0x27'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x28');break;case'inboundroutes':case'internalroutes':case _0xced1('0x29'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x2a');break;case _0xced1('0x2b'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x2c');break;case'voicemails':_0x14f47e['childModel']='VoiceMail';break;case'voicerecordings':_0x14f47e[_0xced1('0x14')]=_0xced1('0x2d');_0x14f47e[_0xced1('0x17')]=[{'name':_0xced1('0x2e'),'field':_0xced1('0xc'),'foreignKey':_0xced1('0x2f'),'model':_0xced1('0x30'),'filter':{'field':_0xced1('0x31'),'value':[_0xced1('0x32')]}},{'name':_0xced1('0x33'),'field':_0xced1('0xc'),'foreignKey':_0xced1('0x2f'),'model':_0xced1('0x30'),'filter':{'field':'role','value':[_0xced1('0x34')]}},{'name':_0xced1('0x35'),'field':_0xced1('0xc'),'foreignKey':_0xced1('0x36'),'model':_0xced1('0x37'),'filter':{'field':_0xced1('0x10'),'value':['inbound']}},{'name':_0xced1('0x38'),'field':_0xced1('0xc'),'foreignKey':_0xced1('0x36'),'model':_0xced1('0x37'),'filter':{'field':_0xced1('0x10'),'value':[_0xced1('0x39')]}}];break;case _0xced1('0x3a'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x3b');break;case _0xced1('0x3c'):_0x14f47e[_0xced1('0x14')]='VoiceChanSpy';break;case'voiceprefixes':_0x14f47e[_0xced1('0x14')]=_0xced1('0x3d');break;case _0xced1('0x3e'):_0x14f47e['childModel']=_0xced1('0x3f');break;case _0xced1('0x40'):_0x14f47e[_0xced1('0x14')]='MailQueue';break;case _0xced1('0x41'):_0x14f47e[_0xced1('0x14')]='MailAccount';break;case _0xced1('0x42'):_0x14f47e['childModel']=_0xced1('0x43');break;case _0xced1('0x44'):_0x14f47e['childModel']=_0xced1('0x45');break;case _0xced1('0x46'):_0x14f47e[_0xced1('0x14')]='OpenchannelAccount';break;case _0xced1('0x47'):_0x14f47e[_0xced1('0x14')]='SmsQueue';break;case _0xced1('0x48'):_0x14f47e['childModel']='SmsAccount';break;case _0xced1('0x49'):_0x14f47e['childModel']=_0xced1('0x4a');break;case _0xced1('0x4b'):_0x14f47e[_0xced1('0x14')]='WhatsappAccount';break;case _0xced1('0x4c'):_0x14f47e['childModel']=_0xced1('0x4d');break;case _0xced1('0x4e'):case _0xced1('0x4f'):_0x14f47e[_0xced1('0x14')]='VoiceQueue';if(_0x49c8b9){_0x14f47e[_0xced1('0x17')]=[{'name':_0xced1('0x35')},{'name':'QueueCampaigns'}];}break;case _0xced1('0x50'):case _0xced1('0x51'):case'telephones':_0x14f47e[_0xced1('0x14')]=_0xced1('0x30');if(_0x49c8b9){_0x14f47e[_0xced1('0x17')]=[{'name':'Users','filter':{'field':_0xced1('0x31'),'value':[_0xced1('0x52'),_0xced1('0x53')]},'ignore':!![]},{'name':_0xced1('0x2e')},{'name':_0xced1('0x33')}];}break;case'zendeskaccounts':_0x14f47e[_0xced1('0x14')]='ZendeskAccount';break;case _0xced1('0x54'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x55');break;case _0xced1('0x56'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x57');break;case'sugarcrmaccounts':_0x14f47e[_0xced1('0x14')]=_0xced1('0x58');break;case'deskaccounts':_0x14f47e[_0xced1('0x14')]='DeskAccount';break;case'zohoaccounts':_0x14f47e[_0xced1('0x14')]=_0xced1('0x59');break;case _0xced1('0x5a'):_0x14f47e[_0xced1('0x14')]='User';break;case _0xced1('0x5b'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x5c');break;case'dispositions':_0x14f47e['childModel']=_0xced1('0x5d');break;case _0xced1('0x5e'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x5f');break;case'intervals':_0x14f47e['childModel']='Interval';break;case _0xced1('0x60'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x61');break;case _0xced1('0x62'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x63');break;case _0xced1('0x64'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x65');break;case'tags':_0x14f47e[_0xced1('0x14')]=_0xced1('0x66');break;case _0xced1('0x67'):_0x14f47e['childModel']=_0xced1('0x68');break;case _0xced1('0x69'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x6a');break;case'trunks':_0x14f47e[_0xced1('0x14')]='Trunk';break;case'variables':_0x14f47e[_0xced1('0x14')]=_0xced1('0x6b');break;case'plugins':_0x14f47e['childModel']='Plugin';break;case _0xced1('0x6c'):_0x14f47e['childModel']=_0xced1('0xe');_0x14f47e[_0xced1('0x17')]=[{'name':_0xced1('0x6d'),'field':'id','foreignKey':_0xced1('0x6e')}];break;case _0xced1('0x6f'):_0x14f47e[_0xced1('0x14')]=_0xced1('0x70');break;}return _0x14f47e;}function _0x849056(_0x4d5a58,_0x4f17fb){var _0x4832d2=_0x4d5a58[_0xced1('0x71')](0x0)[_0xced1('0x72')]()+_0x4d5a58[_0xced1('0x73')](0x1);var _0x5b40ea={'type':_0x424db6[_0xced1('0x74')][_0xced1('0x75')][_0xced1('0x76')],'raw':!![]};return new Promise(function(_0x4365da,_0x5950d2){var _0x458f36=squel[_0xced1('0x77')]()[_0xced1('0x4')](_0xced1('0x78')+_0x4832d2+_0xced1('0x79'),'id')[_0xced1('0x4')](_0xced1('0x7a'))[_0xced1('0x7b')]('user_has_'+_0x4d5a58+'_interactions','ui')['where'](_0xced1('0x7c'),_0x4f17fb['id']);return _0x424db6['sequelize'][_0xced1('0x7d')](_0x458f36['toString'](),_0x5b40ea)['then'](function(_0x37bec5){_0x4f17fb[_0x4832d2+_0xced1('0x7e')]=_0x37bec5;_0x4365da(_0x37bec5);})[_0xced1('0x9')](function(_0x2bdcea){_0x5950d2(_0x2bdcea);});});}return _0x4c3102[_0xced1('0x7f')](_0xced1('0x80'),attributes,{'tableName':_0xced1('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x164ca1){var _0x395b52={'raw':![],'where':{}};var _0x2f22aa={};var _0x1d850b={'count':0x0,'rows':[]};var _0x57b644=_0x164ca1[_0xced1('0x7d')][_0xced1('0x82')];var _0x4956a4=_0x164ca1[_0xced1('0x7d')][_0xced1('0x83')]||![];var _0x55c21d=_0x20dcb4(_0x57b644,_0x4956a4);if(!_0x55c21d[_0xced1('0x14')])throw new Error(_0xced1('0x84')+_0x57b644+'\x27');var _0x2dd0d6=[{'name':_0x57b644}];if(!_[_0xced1('0x85')](_0x55c21d[_0xced1('0x17')]))_0x2dd0d6=_0x55c21d['parentSections'];var _0x59806a=[];for(var _0x487094=0x0;_0x487094<_0x2dd0d6[_0xced1('0x86')];_0x487094++){_0x59806a[_0xced1('0x87')](_0x424db6['UserProfileSection'][_0xced1('0x88')]({'where':{'userProfileId':_0x164ca1[_0xced1('0x89')]['id'],'name':_0x2dd0d6[_0x487094][_0xced1('0xc')]},'raw':!![]}));}return Promise['all'](_0x59806a)[_0xced1('0x7')](function(_0x384efc){var _0x4ed12c=_[_0xced1('0x3')](_0x384efc,function(_0x47e33d){return _0x47e33d?_0x47e33d:undefined;});var _0x1e77e8=_[_0xced1('0x3')](_0x2dd0d6,[_0xced1('0x8a'),!![]]);var _0x2b54e2=_[_0xced1('0x85')](_0x4ed12c)&&_[_0xced1('0x85')](_0x1e77e8)?null:_[_0xced1('0x8b')](_0x1e77e8,_0x4ed12c);if(!_0x2b54e2)return null;var _0x49e802=[];for(var _0x395fe0=0x0;_0x395fe0<_0x2b54e2[_0xced1('0x86')];_0x395fe0++){var _0x154808=_['find'](_0x2dd0d6,function(_0x5c2567){return _0x2b54e2[_0x395fe0]?_0x5c2567[_0xced1('0xc')]===_0x2b54e2[_0x395fe0][_0xced1('0xc')]:null;});if(_0x154808){if(_0x2b54e2[_0x395fe0]['ignore']){_0x49e802[_0xced1('0x87')](_0x79202e(_0x55c21d[_0xced1('0x14')],_0x2b54e2[_0x395fe0]));}else{if(!_0x2b54e2[_0x395fe0][_0xced1('0x8c')]){_0x49e802['push'](_0x5560af(_0x154808,_0x2b54e2[_0x395fe0],_0x55c21d['childModel']));}else{if(_0x154808[_0xced1('0xa')]){_0x49e802[_0xced1('0x87')](_0x3464f3(_0x154808,_0x2b54e2[_0x395fe0]));}}}}}return Promise[_0xced1('0x8d')](_0x49e802);})[_0xced1('0x7')](function(_0x95c83b){var _0x224b8f=_0x95c83b;var _0x5b6acb=null;if(_0x224b8f){_0x5b6acb=_0x224b8f[_0xced1('0x86')]===0x1?_0x224b8f[0x0]:null;}if(!_0x5b6acb&&!_0x224b8f)return _0x1d850b;var _0x4fa327=_0x424db6[_0x55c21d['childModel']]['rawAttributes'];_0x2f22aa['model']=_[_0xced1('0x8e')](_0x4fa327);_0x2f22aa[_0xced1('0x7d')]=_['keys'](_0x164ca1['query']);_0x2f22aa[_0xced1('0x8f')]=_[_0xced1('0x90')](_0x2f22aa['model'],_0x2f22aa['query']);_0x395b52[_0xced1('0x91')]=_[_0xced1('0x90')](_0x2f22aa['model'],qs['fields'](_0x164ca1['query']['fields']));_0x395b52[_0xced1('0x91')]=_0x395b52[_0xced1('0x91')][_0xced1('0x86')]?_0x395b52[_0xced1('0x91')]:_0x2f22aa[_0xced1('0xa')];if(!_0x164ca1[_0xced1('0x7d')]['hasOwnProperty'](_0xced1('0x92'))){_0x395b52[_0xced1('0x93')]=qs[_0xced1('0x93')](_0x164ca1[_0xced1('0x7d')][_0xced1('0x93')]);_0x395b52[_0xced1('0x94')]=qs[_0xced1('0x94')](_0x164ca1[_0xced1('0x7d')][_0xced1('0x94')]);}_0x395b52['order']=qs['sort'](_0x164ca1[_0xced1('0x7d')]['sort']);_0x395b52[_0xced1('0x95')]=qs['filters'](_[_0xced1('0x96')](_0x164ca1[_0xced1('0x7d')],_0x2f22aa[_0xced1('0x8f')]));if(_0x164ca1[_0xced1('0x7d')][_0xced1('0x3')]){_0x395b52[_0xced1('0x95')]=_['merge'](_0x395b52[_0xced1('0x95')],{'$or':_[_0xced1('0xb')](_0x4fa327,function(_0x4104ad){if(_0x4104ad[_0xced1('0x10')][_0xced1('0x97')]!==_0xced1('0x98')){var _0x4fc259={};_0x4fc259[_0x4104ad['field']]={'$like':'%'+_0x164ca1[_0xced1('0x7d')][_0xced1('0x3')]+'%'};return _0x4fc259;}})});}var _0x40eed6=[];var _0x173e9a=null;var _0x37fa95={};if(_0x5b6acb){_0x173e9a=_['find'](_0x2dd0d6,[_0xced1('0xc'),_0x5b6acb[_0xced1('0xc')]]);if(_0x173e9a[_0xced1('0x4')]){_0x37fa95={};if(_0x55c21d[_0xced1('0x14')]==='AnalyticExtractedReport'){_0x37fa95[_0x173e9a[_0xced1('0x99')]]=_[_0xced1('0xb')](_0x5b6acb['associatedResources'],'id');}else{_0x37fa95[_0x173e9a[_0xced1('0x99')]]=_0x5b6acb['associatedResources'];}_0x40eed6[_0xced1('0x87')](_0x37fa95);}else{_0x395b52[_0xced1('0x95')]['id']=_0x5b6acb[_0xced1('0x8')];}}else{for(var _0x19f15d=0x0;_0x19f15d<_0x224b8f[_0xced1('0x86')];_0x19f15d++){_0x173e9a=_[_0xced1('0x88')](_0x2dd0d6,[_0xced1('0xc'),_0x224b8f[_0x19f15d][_0xced1('0xc')]]);if(_0x173e9a[_0xced1('0x4')]){_0x37fa95={};_0x37fa95[_0x173e9a[_0xced1('0x99')]]=_0x224b8f[_0x19f15d]['associatedResources'];_0x40eed6[_0xced1('0x87')](_0x37fa95);}else{if(!_0x395b52[_0xced1('0x95')]['id'])_0x395b52[_0xced1('0x95')]['id']=[];_0x224b8f[_0x19f15d][_0xced1('0x8')]['forEach'](function(_0x35ff8d){_0x395b52[_0xced1('0x95')]['id'][_0xced1('0x87')](_0x35ff8d);});}}}if(!_[_0xced1('0x85')](_0x40eed6)){_0x395b52['where']=_[_0xced1('0x9a')](_0x395b52[_0xced1('0x95')],{'$and':{'$or':_0x40eed6}});}_0x395b52=_[_0xced1('0x9a')]({},_0x395b52,_0x164ca1[_0xced1('0x9b')]);if(_0x5b6acb&&!_0x5b6acb[_0xced1('0x8c')]&&_0x55c21d['childModel']===_0xced1('0xe')){if(_0x164ca1['query'][_0xced1('0x9c')]){_0x395b52[_0xced1('0x9d')]=[{'all':!![]}];}return _0x424db6[_0x55c21d[_0xced1('0x14')]]['findAll'](_0x395b52)[_0xced1('0x7')](function(_0x328079){var _0x5eca32=[];_0x328079[_0xced1('0x9e')](function(_0x4eaf08){var _0xc4a5c8;switch(_0x4eaf08[_0xced1('0x9f')]){case _0xced1('0xa0'):_0xc4a5c8=_['find'](_0x5b6acb['associatedResources'],function(_0x1b6c00){return _0x1b6c00['id']===_0x4eaf08[_0xced1('0x6e')]&&_0x1b6c00[_0xced1('0x10')]===_0xced1('0xa1');});break;case _0xced1('0xa2'):_0xc4a5c8=_['find'](_0x5b6acb['associatedResources'],function(_0x30a9a1){return _0x30a9a1['id']===_0x4eaf08[_0xced1('0x6e')]&&_0x30a9a1[_0xced1('0x10')]==='CustomReports';});break;}if(_0xc4a5c8)_0x5eca32[_0xced1('0x87')](_0x4eaf08);});_0x1d850b['count']=_0x5eca32['length'];_0x1d850b[_0xced1('0xa3')]=_0x5eca32;return _0x1d850b;});}else{return _0x424db6[_0x55c21d['childModel']][_0xced1('0xa4')]({'where':_0x395b52['where']})[_0xced1('0x7')](function(_0x19120f){_0x1d850b[_0xced1('0xa4')]=_0x19120f;if(_0x164ca1[_0xced1('0x7d')][_0xced1('0x9c')]){if(_0x55c21d[_0xced1('0x14')]===_0xced1('0xa5')){_0x395b52['include']=[{'model':_0x424db6['Tag'],'as':_0xced1('0xa6'),'attributes':['id',_0xced1('0xc'),_0xced1('0xa7')],'required':_0x164ca1[_0xced1('0x7d')]['tag']?!![]:![]},{'model':_0x424db6['Tag'],'as':_0xced1('0xa8'),'attributes':['id','name',_0xced1('0xa7')],'through':_0x164ca1[_0xced1('0x7d')][_0xced1('0xa9')]?{'attributes':[],'where':{'TagId':_0x164ca1['query'][_0xced1('0xa9')]||undefined}}:{},'required':_0x164ca1[_0xced1('0x7d')]['tag']?!![]:![]}];}else{_0x395b52[_0xced1('0x9d')]=[{'all':!![]}];}}return _0x424db6[_0x55c21d[_0xced1('0x14')]][_0xced1('0x6')](_0x395b52);})['then'](function(_0x2f4f7a){_0x1d850b[_0xced1('0xa3')]=_0x2f4f7a;if(_0x57b644===_0xced1('0x2e')&&_0x164ca1[_0xced1('0x7d')][_0xced1('0xaa')]===_0xced1('0xab')){var _0x53fca5=[];for(var _0x5126d2=0x0;_0x5126d2<_0x1d850b[_0xced1('0xa3')][_0xced1('0x86')];_0x5126d2++){_0x53fca5[_0xced1('0x87')](_0x849056(_0xced1('0xac'),_0x1d850b[_0xced1('0xa3')][_0x5126d2][_0xced1('0xad')]));_0x53fca5[_0xced1('0x87')](_0x849056(_0xced1('0xae'),_0x1d850b[_0xced1('0xa3')][_0x5126d2][_0xced1('0xad')]));_0x53fca5[_0xced1('0x87')](_0x849056('fax',_0x1d850b['rows'][_0x5126d2][_0xced1('0xad')]));_0x53fca5[_0xced1('0x87')](_0x849056(_0xced1('0xaf'),_0x1d850b[_0xced1('0xa3')][_0x5126d2][_0xced1('0xad')]));_0x53fca5[_0xced1('0x87')](_0x849056(_0xced1('0xb0'),_0x1d850b[_0xced1('0xa3')][_0x5126d2][_0xced1('0xad')]));_0x53fca5[_0xced1('0x87')](_0x849056(_0xced1('0xb1'),_0x1d850b[_0xced1('0xa3')][_0x5126d2][_0xced1('0xad')]));}return Promise[_0xced1('0x8d')](_0x53fca5)[_0xced1('0x7')](function(){return _0x1d850b;});}return _0x1d850b;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f150373..5f98ac6 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 _0xe626=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x3df327,_0xeae0dd){var _0x25db3f=function(_0x31b55a){while(--_0x31b55a){_0x3df327['push'](_0x3df327['shift']());}};_0x25db3f(++_0xeae0dd);}(_0xe626,0x9d));var _0x6e62=function(_0x24b118,_0x193275){_0x24b118=_0x24b118-0x0;var _0x24e285=_0xe626[_0x24b118];return _0x24e285;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var moment=require(_0x6e62('0x2'));var BPromise=require(_0x6e62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e62('0x4'));var db=require(_0x6e62('0x5'))['db'];var utils=require(_0x6e62('0x6'));var logger=require(_0x6e62('0x7'))(_0x6e62('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e62('0x9')]({'port':0x232a});config[_0x6e62('0xa')]=_['defaults'](config[_0x6e62('0xa')],{'host':_0x6e62('0xb'),'port':0x18eb});var socket=require(_0x6e62('0xc'))(new Redis(config[_0x6e62('0xa')]));require('./userProfile.socket')[_0x6e62('0xd')](socket);function respondWithRpcPromise(_0x3d677f,_0x4e25d3,_0x2fbfd0){return new BPromise(function(_0x4c3b6b,_0x1f2693){return client['request'](_0x3d677f,_0x2fbfd0)[_0x6e62('0xe')](function(_0x4fc5a8){logger[_0x6e62('0xf')](_0x6e62('0x10'),_0x4e25d3,_0x6e62('0x11'));logger[_0x6e62('0x12')](_0x6e62('0x13'),_0x4e25d3,_0x6e62('0x11'),JSON[_0x6e62('0x14')](_0x4fc5a8));if(_0x4fc5a8['error']){if(_0x4fc5a8['error'][_0x6e62('0x15')]===0x1f4){logger[_0x6e62('0x16')]('UserProfile,\x20%s,\x20%s',_0x4e25d3,_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);return _0x1f2693(_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);}logger['error'](_0x6e62('0x10'),_0x4e25d3,_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);return _0x4c3b6b(_0x4fc5a8[_0x6e62('0x16')][_0x6e62('0x17')]);}else{logger[_0x6e62('0xf')](_0x6e62('0x10'),_0x4e25d3,_0x6e62('0x11'));_0x4c3b6b(_0x4fc5a8[_0x6e62('0x18')][_0x6e62('0x17')]);}})['catch'](function(_0x1f5ee7){logger[_0x6e62('0x16')]('UserProfile,\x20%s,\x20%s',_0x4e25d3,_0x1f5ee7);_0x1f2693(_0x1f5ee7);});});} \ No newline at end of file +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(_0x1f42bc,_0x208463){var _0x23f159=function(_0x3933bb){while(--_0x3933bb){_0x1f42bc['push'](_0x1f42bc['shift']());}};_0x23f159(++_0x208463);}(_0xa701,0xd4));var _0x1a70=function(_0x55f7ce,_0x42e07d){_0x55f7ce=_0x55f7ce-0x0;var _0x45b247=_0xa701[_0x55f7ce];return _0x45b247;};'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 diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 9c707d8..18f4371 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 _0xbb3a=['register','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb3a,0x166));var _0xabb3=function(_0xb5272c,_0x4016d6){_0xb5272c=_0xb5272c-0x0;var _0x434e80=_0xbb3a[_0xb5272c];return _0x434e80;};'use strict';var UserProfileEvents=require(_0xabb3('0x0'));var events=[_0xabb3('0x1'),_0xabb3('0x2'),_0xabb3('0x3')];function createListener(_0x43e16f,_0x541721){return function(_0x19a4de){_0x541721[_0xabb3('0x4')](_0x43e16f,_0x19a4de);};}function removeListener(_0x57c61a,_0x4b8c88){return function(){UserProfileEvents[_0xabb3('0x5')](_0x57c61a,_0x4b8c88);};}exports[_0xabb3('0x6')]=function(_0x8c3649){for(var _0x526939=0x0,_0x357b80=events['length'];_0x526939<_0x357b80;_0x526939++){var _0x3a4cc2=events[_0x526939];var _0x18444c=createListener('userProfile:'+_0x3a4cc2,_0x8c3649);UserProfileEvents['on'](_0x3a4cc2,_0x18444c);}}; \ No newline at end of file +var _0xbcda=['update','emit','removeListener','register','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbcda,0x17e));var _0xabcd=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xbcda[_0x29b609];return _0x54c952;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xabcd('0x0'),_0xabcd('0x1'),_0xabcd('0x2')];function createListener(_0x291652,_0x384518){return function(_0x552169){_0x384518[_0xabcd('0x3')](_0x291652,_0x552169);};}function removeListener(_0x49b1f0,_0x339c13){return function(){UserProfileEvents[_0xabcd('0x4')](_0x49b1f0,_0x339c13);};}exports[_0xabcd('0x5')]=function(_0xe22b55){for(var _0x290901=0x0,_0x17f8da=events['length'];_0x290901<_0x17f8da;_0x290901++){var _0x42513b=events[_0x290901];var _0x1240db=createListener('userProfile:'+_0x42513b,_0xe22b55);UserProfileEvents['on'](_0x42513b,_0x1240db);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0b5825d..679e70f 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 _0x8293=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','show','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x186bb2,_0x40e1a0){var _0x5ef25d=function(_0x33bd5f){while(--_0x33bd5f){_0x186bb2['push'](_0x186bb2['shift']());}};_0x5ef25d(++_0x40e1a0);}(_0x8293,0xe1));var _0x3829=function(_0x5caf56,_0x3a2515){_0x5caf56=_0x5caf56-0x0;var _0x21a472=_0x8293[_0x5caf56];return _0x21a472;};'use strict';var multer=require(_0x3829('0x0'));var util=require(_0x3829('0x1'));var path=require(_0x3829('0x2'));var timeout=require(_0x3829('0x3'));var express=require(_0x3829('0x4'));var router=express[_0x3829('0x5')]();var fs_extra=require(_0x3829('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3829('0x7'));var config=require(_0x3829('0x8'));var controller=require(_0x3829('0x9'));router['get']('/',auth[_0x3829('0xa')](),controller['index']);router[_0x3829('0xb')](_0x3829('0xc'),auth[_0x3829('0xa')](),controller[_0x3829('0xd')]);router['get']('/:id',auth[_0x3829('0xa')](),controller[_0x3829('0xe')]);router[_0x3829('0xf')]('/',auth[_0x3829('0xa')](),controller[_0x3829('0x10')]);router[_0x3829('0x11')](_0x3829('0x12'),auth['isAuthenticated'](),controller[_0x3829('0x13')]);router[_0x3829('0x14')](_0x3829('0x12'),auth[_0x3829('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8d35=['show','post','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','get','isAuthenticated','describe','/:id'];(function(_0x2ac4a3,_0x5e5c66){var _0x330bcc=function(_0x5e2201){while(--_0x5e2201){_0x2ac4a3['push'](_0x2ac4a3['shift']());}};_0x330bcc(++_0x5e5c66);}(_0x8d35,0x1e7));var _0x58d3=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x8d35[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0x58d3('0x0'));var util=require('util');var path=require(_0x58d3('0x1'));var timeout=require('connect-timeout');var express=require(_0x58d3('0x2'));var router=express['Router']();var fs_extra=require(_0x58d3('0x3'));var auth=require(_0x58d3('0x4'));var interaction=require(_0x58d3('0x5'));var config=require(_0x58d3('0x6'));var controller=require(_0x58d3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x58d3('0x8')]);router[_0x58d3('0x9')]('/describe',auth[_0x58d3('0xa')](),controller[_0x58d3('0xb')]);router[_0x58d3('0x9')](_0x58d3('0xc'),auth[_0x58d3('0xa')](),controller[_0x58d3('0xd')]);router[_0x58d3('0xe')]('/',auth[_0x58d3('0xa')](),controller['create']);router[_0x58d3('0xf')](_0x58d3('0xc'),auth[_0x58d3('0xa')](),controller[_0x58d3('0x10')]);router[_0x58d3('0x11')]('/:id',auth[_0x58d3('0xa')](),controller[_0x58d3('0x12')]);module[_0x58d3('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 36fc6a5..0a0174e 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 _0x4772=['INTEGER','sequelize','exports','STRING'];(function(_0xdd1797,_0x416285){var _0x7ebad5=function(_0x193c02){while(--_0x193c02){_0xdd1797['push'](_0xdd1797['shift']());}};_0x7ebad5(++_0x416285);}(_0x4772,0x165));var _0x2477=function(_0x2ebd82,_0x24fe88){_0x2ebd82=_0x2ebd82-0x0;var _0x570aa2=_0x4772[_0x2ebd82];return _0x570aa2;};'use strict';var Sequelize=require(_0x2477('0x0'));module[_0x2477('0x1')]={'name':{'type':Sequelize[_0x2477('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2477('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2477('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7aba=['STRING','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7aba,0x11a));var _0xa7ab=function(_0x474bf0,_0x5b5129){_0x474bf0=_0x474bf0-0x0;var _0x30027c=_0x7aba[_0x474bf0];return _0x30027c;};'use strict';var Sequelize=require(_0xa7ab('0x0'));module[_0xa7ab('0x1')]={'name':{'type':Sequelize[_0xa7ab('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa7ab('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa7ab('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3293487..88153e9 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 _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file +var _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0xa85b46,_0x571cab){var _0x4b4c88=function(_0x621751){while(--_0x621751){_0xa85b46['push'](_0xa85b46['shift']());}};_0x4b4c88(++_0x571cab);}(_0xc2c7,0x134));var _0x7c2c=function(_0x46c9e9,_0x4c0b02){_0x46c9e9=_0x46c9e9-0x0;var _0x1bf1bd=_0xc2c7[_0x46c9e9];return _0x1bf1bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['UserProfileResource'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['UserProfileResource'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['UserProfileResource'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1e16291..f8d2186 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 _0x7e1b=['define','UserProfileResource','compositeIndex','resourceId','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x4c789b,_0x5b43a7){var _0x3c5e02=function(_0x8af805){while(--_0x8af805){_0x4c789b['push'](_0x4c789b['shift']());}};_0x3c5e02(++_0x5b43a7);}(_0x7e1b,0xba));var _0xb7e1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x7e1b[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xb7e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb7e1('0x1'));var moment=require(_0xb7e1('0x2'));var BPromise=require('bluebird');var rp=require(_0xb7e1('0x3'));var fs=require('fs');var path=require(_0xb7e1('0x4'));var rimraf=require(_0xb7e1('0x5'));var config=require(_0xb7e1('0x6'));var attributes=require(_0xb7e1('0x7'));module[_0xb7e1('0x8')]=function(_0x155819,_0x48e1f4){return _0x155819[_0xb7e1('0x9')](_0xb7e1('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xb7e1('0xb'),'fields':[_0xb7e1('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4753=['request-promise','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment','bluebird'];(function(_0x315b02,_0x41721a){var _0x296e92=function(_0x2d205c){while(--_0x2d205c){_0x315b02['push'](_0x315b02['shift']());}};_0x296e92(++_0x41721a);}(_0x4753,0x19f));var _0x3475=function(_0x21a7e0,_0x5657db){_0x21a7e0=_0x21a7e0-0x0;var _0x4816bd=_0x4753[_0x21a7e0];return _0x4816bd;};'use strict';var _=require('lodash');var util=require(_0x3475('0x0'));var logger=require(_0x3475('0x1'))(_0x3475('0x2'));var moment=require(_0x3475('0x3'));var BPromise=require(_0x3475('0x4'));var rp=require(_0x3475('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3475('0x6'));var attributes=require(_0x3475('0x7'));module[_0x3475('0x8')]=function(_0x356a78,_0xfa0f2d){return _0x356a78[_0x3475('0x9')]('UserProfileResource',attributes,{'tableName':_0x3475('0xa'),'paranoid':![],'indexes':[{'name':_0x3475('0xb'),'fields':[_0x3475('0xc'),_0x3475('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 789415a..8a66ecd 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 _0xe672=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35931e,_0x94f9a2){var _0x11850a=function(_0x36bd64){while(--_0x36bd64){_0x35931e['push'](_0x35931e['shift']());}};_0x11850a(++_0x94f9a2);}(_0xe672,0x1e4));var _0x2e67=function(_0x43602a,_0x8633c4){_0x43602a=_0x43602a-0x0;var _0x36ce11=_0xe672[_0x43602a];return _0x36ce11;};'use strict';var _=require(_0x2e67('0x0'));var util=require('util');var moment=require(_0x2e67('0x1'));var BPromise=require(_0x2e67('0x2'));var rs=require(_0x2e67('0x3'));var fs=require('fs');var Redis=require(_0x2e67('0x4'));var db=require(_0x2e67('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2e67('0x6'));var config=require(_0x2e67('0x7'));var jayson=require(_0x2e67('0x8'));var client=jayson[_0x2e67('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494f9b,_0x37dc36,_0x1d2188){return new BPromise(function(_0x25ebe1,_0x2b60df){return client['request'](_0x494f9b,_0x1d2188)[_0x2e67('0xa')](function(_0x1a126c){logger[_0x2e67('0xb')](_0x2e67('0xc'),_0x37dc36,_0x2e67('0xd'));logger[_0x2e67('0xe')](_0x2e67('0xf'),_0x37dc36,_0x2e67('0xd'),JSON[_0x2e67('0x10')](_0x1a126c));if(_0x1a126c[_0x2e67('0x11')]){if(_0x1a126c[_0x2e67('0x11')][_0x2e67('0x12')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x37dc36,_0x1a126c[_0x2e67('0x11')][_0x2e67('0x13')]);return _0x2b60df(_0x1a126c[_0x2e67('0x11')][_0x2e67('0x13')]);}logger[_0x2e67('0x11')](_0x2e67('0xc'),_0x37dc36,_0x1a126c[_0x2e67('0x11')][_0x2e67('0x13')]);return _0x25ebe1(_0x1a126c['error']['message']);}else{logger[_0x2e67('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x37dc36,_0x2e67('0xd'));_0x25ebe1(_0x1a126c['result']['message']);}})[_0x2e67('0x14')](function(_0x32c7fc){logger[_0x2e67('0x11')](_0x2e67('0xc'),_0x37dc36,_0x32c7fc);_0x2b60df(_0x32c7fc);});});} \ No newline at end of file +var _0x9ead=['UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileResource,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug'];(function(_0x3a92f1,_0x82d7fd){var _0x158c2e=function(_0xd48e2a){while(--_0xd48e2a){_0x3a92f1['push'](_0x3a92f1['shift']());}};_0x158c2e(++_0x82d7fd);}(_0x9ead,0xc4));var _0xd9ea=function(_0x368fc3,_0x2b7c2c){_0x368fc3=_0x368fc3-0x0;var _0x1fa4b2=_0x9ead[_0x368fc3];return _0x1fa4b2;};'use strict';var _=require(_0xd9ea('0x0'));var util=require('util');var moment=require(_0xd9ea('0x1'));var BPromise=require(_0xd9ea('0x2'));var rs=require(_0xd9ea('0x3'));var fs=require('fs');var Redis=require(_0xd9ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd9ea('0x5'))(_0xd9ea('0x6'));var config=require(_0xd9ea('0x7'));var jayson=require(_0xd9ea('0x8'));var client=jayson[_0xd9ea('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4684d8,_0x5c0b03,_0x382179){return new BPromise(function(_0x469464,_0x58cd67){return client['request'](_0x4684d8,_0x382179)['then'](function(_0xb27c91){logger[_0xd9ea('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x5c0b03,_0xd9ea('0xb'));logger[_0xd9ea('0xc')](_0xd9ea('0xd'),_0x5c0b03,_0xd9ea('0xb'),JSON[_0xd9ea('0xe')](_0xb27c91));if(_0xb27c91['error']){if(_0xb27c91[_0xd9ea('0xf')]['code']===0x1f4){logger[_0xd9ea('0xf')](_0xd9ea('0x10'),_0x5c0b03,_0xb27c91[_0xd9ea('0xf')]['message']);return _0x58cd67(_0xb27c91[_0xd9ea('0xf')]['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x5c0b03,_0xb27c91[_0xd9ea('0xf')][_0xd9ea('0x11')]);return _0x469464(_0xb27c91[_0xd9ea('0xf')]['message']);}else{logger[_0xd9ea('0xa')](_0xd9ea('0x10'),_0x5c0b03,_0xd9ea('0xb'));_0x469464(_0xb27c91['result'][_0xd9ea('0x11')]);}})[_0xd9ea('0x12')](function(_0x16ca86){logger[_0xd9ea('0xf')](_0xd9ea('0x10'),_0x5c0b03,_0x16ca86);_0x58cd67(_0x16ca86);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 6c0cd6a..1923f14 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 _0xe04b=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe'];(function(_0x17c5a6,_0x3b324c){var _0x4a6a6d=function(_0x17bde6){while(--_0x17bde6){_0x17c5a6['push'](_0x17c5a6['shift']());}};_0x4a6a6d(++_0x3b324c);}(_0xe04b,0x1d8));var _0xbe04=function(_0xdbbbcd,_0x5f2401){_0xdbbbcd=_0xdbbbcd-0x0;var _0x148a67=_0xe04b[_0xdbbbcd];return _0x148a67;};'use strict';var multer=require(_0xbe04('0x0'));var util=require(_0xbe04('0x1'));var path=require('path');var timeout=require(_0xbe04('0x2'));var express=require(_0xbe04('0x3'));var router=express['Router']();var fs_extra=require(_0xbe04('0x4'));var auth=require(_0xbe04('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbe04('0x6'));var controller=require(_0xbe04('0x7'));router['get']('/',auth[_0xbe04('0x8')](),controller[_0xbe04('0x9')]);router[_0xbe04('0xa')](_0xbe04('0xb'),auth['isAuthenticated'](),controller[_0xbe04('0xc')]);router['get'](_0xbe04('0xd'),auth[_0xbe04('0x8')](),controller[_0xbe04('0xe')]);router[_0xbe04('0xf')]('/',auth['isAuthenticated'](),controller[_0xbe04('0x10')]);router[_0xbe04('0x11')](_0xbe04('0xd'),auth[_0xbe04('0x8')](),controller[_0xbe04('0x12')]);router[_0xbe04('0x13')]('/:id',auth[_0xbe04('0x8')](),controller[_0xbe04('0x14')]);module[_0xbe04('0x15')]=router; \ No newline at end of file +var _0x6016=['../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/:id','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x127f8a,_0x3f1c55){var _0x396d8e=function(_0x59d9c6){while(--_0x59d9c6){_0x127f8a['push'](_0x127f8a['shift']());}};_0x396d8e(++_0x3f1c55);}(_0x6016,0x162));var _0x6601=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x6016[_0x59d0cc];return _0x2ae79f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6601('0x0'));var timeout=require(_0x6601('0x1'));var express=require(_0x6601('0x2'));var router=express[_0x6601('0x3')]();var fs_extra=require(_0x6601('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6601('0x5'));var config=require(_0x6601('0x6'));var controller=require(_0x6601('0x7'));router['get']('/',auth[_0x6601('0x8')](),controller[_0x6601('0x9')]);router[_0x6601('0xa')]('/describe',auth[_0x6601('0x8')](),controller['describe']);router['get'](_0x6601('0xb'),auth[_0x6601('0x8')](),controller['show']);router[_0x6601('0xc')]('/',auth[_0x6601('0x8')](),controller[_0x6601('0xd')]);router['put'](_0x6601('0xb'),auth[_0x6601('0x8')](),controller[_0x6601('0xe')]);router[_0x6601('0xf')](_0x6601('0xb'),auth[_0x6601('0x8')](),controller[_0x6601('0x10')]);module[_0x6601('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 7875264..935c61f 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 _0x36ee=['getDataValue','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x41e8b6,_0x306cc2){var _0x13f112=function(_0x484f85){while(--_0x484f85){_0x41e8b6['push'](_0x41e8b6['shift']());}};_0x13f112(++_0x306cc2);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe36e('0x0')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe36e('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe36e('0x0')],'set':function(_0x567a84){this[_0xe36e('0x3')](_0xe36e('0x4'),_0x567a84?_0x567a84[_0xe36e('0x5')](''):[]);},'get':function(){return this[_0xe36e('0x6')](_0xe36e('0x4'))?this[_0xe36e('0x6')](_0xe36e('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x3ab78b,_0x1f0f58){var _0x2a5138=function(_0x406d3f){while(--_0x406d3f){_0x3ab78b['push'](_0x3ab78b['shift']());}};_0x2a5138(++_0x1f0f58);}(_0x6cb4,0xff));var _0x46cb=function(_0x857129,_0x3223aa){_0x857129=_0x857129-0x0;var _0x1253af=_0x6cb4[_0x857129];return _0x1253af;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 946fd21..1f1a6a7 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 _0x9614=['squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x5557e9,_0x55cf12){var _0x4d731f=function(_0x33fc5c){while(--_0x33fc5c){_0x5557e9['push'](_0x5557e9['shift']());}};_0x4d731f(++_0x55cf12);}(_0x9614,0x179));var _0x4961=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x9614[_0x329437];return _0x3789d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4961('0x0'));var zipdir=require(_0x4961('0x1'));var jsonpatch=require(_0x4961('0x2'));var rp=require(_0x4961('0x3'));var moment=require(_0x4961('0x4'));var BPromise=require(_0x4961('0x5'));var Mustache=require(_0x4961('0x6'));var util=require(_0x4961('0x7'));var path=require(_0x4961('0x8'));var sox=require('sox');var csv=require(_0x4961('0x9'));var ejs=require(_0x4961('0xa'));var fs=require('fs');var fs_extra=require(_0x4961('0xb'));var _=require(_0x4961('0xc'));var squel=require(_0x4961('0xd'));var crypto=require(_0x4961('0xe'));var jsforce=require(_0x4961('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4961('0x9'));var querystring=require(_0x4961('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4961('0x11'));var as=require(_0x4961('0x12'));var hardwareService=require(_0x4961('0x13'));var logger=require('../../config/logger')(_0x4961('0x14'));var utils=require(_0x4961('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4961('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc0be1a,_0x51262a){_0x51262a=_0x51262a||0xcc;return function(_0x1ce7e5){if(_0x1ce7e5){return _0xc0be1a[_0x4961('0x17')](_0x51262a);}return _0xc0be1a['status'](_0x51262a)[_0x4961('0x18')]();};}function respondWithResult(_0x87968c,_0x57c88c){_0x57c88c=_0x57c88c||0xc8;return function(_0x29240e){if(_0x29240e){return _0x87968c[_0x4961('0x19')](_0x57c88c)[_0x4961('0x1a')](_0x29240e);}};}function respondWithFilteredResult(_0x2ca8dd,_0x2579a8){return function(_0x453ff9){if(_0x453ff9){var _0x39153a=typeof _0x2579a8[_0x4961('0x1b')]==='undefined'&&typeof _0x2579a8[_0x4961('0x1c')]===_0x4961('0x1d');var _0x3184a5=_0x453ff9[_0x4961('0x1e')];var _0xe054d9=_0x39153a?0x0:_0x2579a8[_0x4961('0x1b')];var _0x39cf38=_0x39153a?_0x453ff9[_0x4961('0x1e')]:_0x2579a8[_0x4961('0x1b')]+_0x2579a8[_0x4961('0x1c')];var _0x3282e1;if(_0x39cf38>=_0x3184a5){_0x39cf38=_0x3184a5;_0x3282e1=0xc8;}else{_0x3282e1=0xce;}_0x2ca8dd[_0x4961('0x19')](_0x3282e1);return _0x2ca8dd[_0x4961('0x1f')]('Content-Range',_0xe054d9+'-'+_0x39cf38+'/'+_0x3184a5)[_0x4961('0x1a')](_0x453ff9);}return null;};}function patchUpdates(_0x9bc5ee){return function(_0x2009ee){try{jsonpatch[_0x4961('0x20')](_0x2009ee,_0x9bc5ee,!![]);}catch(_0x2c5236){return BPromise[_0x4961('0x21')](_0x2c5236);}return _0x2009ee[_0x4961('0x22')]();};}function saveUpdates(_0x1ce17d,_0xfffbf){return function(_0x423f9b){if(_0x423f9b){return _0x423f9b['update'](_0x1ce17d)[_0x4961('0x23')](function(_0x115825){return _0x115825;});}return null;};}function removeEntity(_0x49f1f6,_0x5afcf3){return function(_0x3927cf){if(_0x3927cf){return _0x3927cf[_0x4961('0x24')]()['then'](function(){_0x49f1f6[_0x4961('0x19')](0xcc)[_0x4961('0x18')]();});}};}function handleEntityNotFound(_0x54eedd,_0x5a8129){return function(_0x28fe5b){if(!_0x28fe5b){_0x54eedd[_0x4961('0x17')](0x194);}return _0x28fe5b;};}function handleError(_0x3235cc,_0x4a1854){_0x4a1854=_0x4a1854||0x1f4;return function(_0x3533d4){logger[_0x4961('0x25')](_0x3533d4[_0x4961('0x26')]);if(_0x3533d4[_0x4961('0x27')]){delete _0x3533d4[_0x4961('0x27')];}_0x3235cc[_0x4961('0x19')](_0x4a1854)[_0x4961('0x28')](_0x3533d4);};}exports[_0x4961('0x29')]=function(_0x5e8b8e,_0x99ddd4){var _0x5a4c82={},_0x11a4c7={},_0x388043={'count':0x0,'rows':[]};var _0x94bc33=_[_0x4961('0x2a')](db['UserProfileSection'][_0x4961('0x2b')],function(_0x6b6785){return{'name':_0x6b6785[_0x4961('0x2c')],'type':_0x6b6785[_0x4961('0x2d')][_0x4961('0x2e')]};});_0x11a4c7[_0x4961('0x2f')]=_['map'](_0x94bc33,_0x4961('0x27'));_0x11a4c7[_0x4961('0x30')]=_[_0x4961('0x31')](_0x5e8b8e[_0x4961('0x30')]);_0x11a4c7[_0x4961('0x32')]=_[_0x4961('0x33')](_0x11a4c7[_0x4961('0x2f')],_0x11a4c7[_0x4961('0x30')]);_0x5a4c82['attributes']=_[_0x4961('0x33')](_0x11a4c7['model'],qs[_0x4961('0x34')](_0x5e8b8e['query'][_0x4961('0x34')]));_0x5a4c82[_0x4961('0x35')]=_0x5a4c82[_0x4961('0x35')][_0x4961('0x36')]?_0x5a4c82['attributes']:_0x11a4c7[_0x4961('0x2f')];if(!_0x5e8b8e[_0x4961('0x30')][_0x4961('0x37')](_0x4961('0x38'))){_0x5a4c82[_0x4961('0x1c')]=qs['limit'](_0x5e8b8e[_0x4961('0x30')][_0x4961('0x1c')]);_0x5a4c82['offset']=qs[_0x4961('0x1b')](_0x5e8b8e[_0x4961('0x30')][_0x4961('0x1b')]);}_0x5a4c82[_0x4961('0x39')]=qs[_0x4961('0x3a')](_0x5e8b8e[_0x4961('0x30')]['sort']);_0x5a4c82['where']=qs['filters'](_[_0x4961('0x3b')](_0x5e8b8e[_0x4961('0x30')],_0x11a4c7[_0x4961('0x32')]),_0x94bc33);if(_0x5e8b8e[_0x4961('0x30')][_0x4961('0x3c')]){_0x5a4c82[_0x4961('0x3d')]=_[_0x4961('0x3e')](_0x5a4c82[_0x4961('0x3d')],{'$or':_['map'](_0x94bc33,function(_0x1c6b2b){if(_0x1c6b2b[_0x4961('0x2d')]!==_0x4961('0x3f')){var _0x245c32={};_0x245c32[_0x1c6b2b[_0x4961('0x27')]]={'$like':'%'+_0x5e8b8e['query'][_0x4961('0x3c')]+'%'};return _0x245c32;}})});}_0x5a4c82=_[_0x4961('0x3e')]({},_0x5a4c82,_0x5e8b8e[_0x4961('0x40')]);var _0x4bd9c3={'where':_0x5a4c82[_0x4961('0x3d')]};return db[_0x4961('0x41')][_0x4961('0x1e')](_0x4bd9c3)[_0x4961('0x23')](function(_0x5c6801){_0x388043[_0x4961('0x1e')]=_0x5c6801;if(_0x5e8b8e[_0x4961('0x30')][_0x4961('0x42')]){_0x5a4c82[_0x4961('0x43')]=[{'all':!![]}];}return db[_0x4961('0x41')][_0x4961('0x44')](_0x5a4c82);})[_0x4961('0x23')](function(_0x24e5f3){_0x388043[_0x4961('0x45')]=_0x24e5f3;return _0x388043;})[_0x4961('0x23')](respondWithFilteredResult(_0x99ddd4,_0x5a4c82))['catch'](handleError(_0x99ddd4,null));};exports[_0x4961('0x46')]=function(_0x4f6ff4,_0xd0cc63){var _0x2987a2={'raw':![],'where':{'id':_0x4f6ff4['params']['id']}},_0x53e1b6={};_0x53e1b6[_0x4961('0x2f')]=_['keys'](db[_0x4961('0x41')]['rawAttributes']);_0x53e1b6[_0x4961('0x30')]=_[_0x4961('0x31')](_0x4f6ff4[_0x4961('0x30')]);_0x53e1b6[_0x4961('0x32')]=_['intersection'](_0x53e1b6[_0x4961('0x2f')],_0x53e1b6[_0x4961('0x30')]);_0x2987a2[_0x4961('0x35')]=_[_0x4961('0x33')](_0x53e1b6['model'],qs['fields'](_0x4f6ff4[_0x4961('0x30')]['fields']));_0x2987a2['attributes']=_0x2987a2[_0x4961('0x35')][_0x4961('0x36')]?_0x2987a2[_0x4961('0x35')]:_0x53e1b6[_0x4961('0x2f')];if(_0x4f6ff4[_0x4961('0x30')][_0x4961('0x42')]){_0x2987a2[_0x4961('0x43')]=[{'all':!![]}];}_0x2987a2=_[_0x4961('0x3e')]({},_0x2987a2,_0x4f6ff4[_0x4961('0x40')]);return db[_0x4961('0x41')][_0x4961('0x47')](_0x2987a2)[_0x4961('0x23')](handleEntityNotFound(_0xd0cc63,null))[_0x4961('0x23')](respondWithResult(_0xd0cc63,null))[_0x4961('0x48')](handleError(_0xd0cc63,null));};exports['create']=function(_0x29035e,_0x10d73a){return db[_0x4961('0x41')][_0x4961('0x49')](_0x29035e[_0x4961('0x4a')],{})[_0x4961('0x23')](respondWithResult(_0x10d73a,0xc9))[_0x4961('0x48')](handleError(_0x10d73a,null));};exports[_0x4961('0x4b')]=function(_0x4385a1,_0x4eae33){if(_0x4385a1['body']['id']){delete _0x4385a1[_0x4961('0x4a')]['id'];}return db['UserProfileSection'][_0x4961('0x47')]({'where':{'id':_0x4385a1[_0x4961('0x4c')]['id']}})[_0x4961('0x23')](handleEntityNotFound(_0x4eae33,null))[_0x4961('0x23')](saveUpdates(_0x4385a1['body'],null))[_0x4961('0x23')](respondWithResult(_0x4eae33,null))['catch'](handleError(_0x4eae33,null));};exports['destroy']=function(_0x53dc99,_0x49a27c){return db[_0x4961('0x41')][_0x4961('0x47')]({'where':{'id':_0x53dc99[_0x4961('0x4c')]['id']}})[_0x4961('0x23')](handleEntityNotFound(_0x49a27c,null))['then'](removeEntity(_0x49a27c,null))[_0x4961('0x48')](handleError(_0x49a27c,null));};exports[_0x4961('0x4d')]=function(_0x4277f8,_0x185933){return db[_0x4961('0x41')]['describe']()['then'](respondWithResult(_0x185933,null))[_0x4961('0x48')](handleError(_0x185933,null));}; \ No newline at end of file +var _0xff63=['filter','merge','VIRTUAL','rows','catch','show','params','model','includeAll','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','UserProfileSection','rawAttributes','type','key','map','keys','query','fields','attributes','length','hasOwnProperty','offset','order','sort','where','filters','pick'];(function(_0x56b36b,_0x322730){var _0x2996ea=function(_0x41e97b){while(--_0x41e97b){_0x56b36b['push'](_0x56b36b['shift']());}};_0x2996ea(++_0x322730);}(_0xff63,0xec));var _0x3ff6=function(_0x444c1f,_0x1bbab1){_0x444c1f=_0x444c1f-0x0;var _0x2d9d3c=_0xff63[_0x444c1f];return _0x2d9d3c;};'use strict';var emlformat=require(_0x3ff6('0x0'));var rimraf=require(_0x3ff6('0x1'));var zipdir=require(_0x3ff6('0x2'));var jsonpatch=require(_0x3ff6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3ff6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ff6('0x5'));var sox=require(_0x3ff6('0x6'));var csv=require(_0x3ff6('0x7'));var ejs=require(_0x3ff6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ff6('0x9'));var squel=require('squel');var crypto=require(_0x3ff6('0xa'));var jsforce=require(_0x3ff6('0xb'));var deskjs=require(_0x3ff6('0xc'));var toCsv=require(_0x3ff6('0x7'));var querystring=require(_0x3ff6('0xd'));var Papa=require(_0x3ff6('0xe'));var Redis=require(_0x3ff6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3ff6('0x10'));var as=require(_0x3ff6('0x11'));var hardwareService=require(_0x3ff6('0x12'));var logger=require('../../config/logger')(_0x3ff6('0x13'));var utils=require(_0x3ff6('0x14'));var config=require(_0x3ff6('0x15'));var licenseUtil=require(_0x3ff6('0x16'));var db=require(_0x3ff6('0x17'))['db'];function respondWithStatusCode(_0x6448d8,_0x4aacb8){_0x4aacb8=_0x4aacb8||0xcc;return function(_0x4e2378){if(_0x4e2378){return _0x6448d8[_0x3ff6('0x18')](_0x4aacb8);}return _0x6448d8[_0x3ff6('0x19')](_0x4aacb8)[_0x3ff6('0x1a')]();};}function respondWithResult(_0x5e3956,_0x231bb6){_0x231bb6=_0x231bb6||0xc8;return function(_0x1e9f65){if(_0x1e9f65){return _0x5e3956[_0x3ff6('0x19')](_0x231bb6)['json'](_0x1e9f65);}};}function respondWithFilteredResult(_0xa315,_0x2900f5){return function(_0x4a9dee){if(_0x4a9dee){var _0xb7badd=typeof _0x2900f5['offset']===_0x3ff6('0x1b')&&typeof _0x2900f5['limit']===_0x3ff6('0x1b');var _0x11e04c=_0x4a9dee['count'];var _0x1b145d=_0xb7badd?0x0:_0x2900f5['offset'];var _0x3bce98=_0xb7badd?_0x4a9dee[_0x3ff6('0x1c')]:_0x2900f5['offset']+_0x2900f5[_0x3ff6('0x1d')];var _0x2a13d7;if(_0x3bce98>=_0x11e04c){_0x3bce98=_0x11e04c;_0x2a13d7=0xc8;}else{_0x2a13d7=0xce;}_0xa315['status'](_0x2a13d7);return _0xa315[_0x3ff6('0x1e')](_0x3ff6('0x1f'),_0x1b145d+'-'+_0x3bce98+'/'+_0x11e04c)[_0x3ff6('0x20')](_0x4a9dee);}return null;};}function patchUpdates(_0x3dfef1){return function(_0x1a4092){try{jsonpatch[_0x3ff6('0x21')](_0x1a4092,_0x3dfef1,!![]);}catch(_0x134604){return BPromise[_0x3ff6('0x22')](_0x134604);}return _0x1a4092[_0x3ff6('0x23')]();};}function saveUpdates(_0x13c6d3,_0x3e7502){return function(_0x3206b9){if(_0x3206b9){return _0x3206b9[_0x3ff6('0x24')](_0x13c6d3)['then'](function(_0x1f26ef){return _0x1f26ef;});}return null;};}function removeEntity(_0x5737d1,_0x5ae163){return function(_0x415e1f){if(_0x415e1f){return _0x415e1f[_0x3ff6('0x25')]()[_0x3ff6('0x26')](function(){_0x5737d1['status'](0xcc)[_0x3ff6('0x1a')]();});}};}function handleEntityNotFound(_0x5aa137,_0xbb302){return function(_0x4cc5bf){if(!_0x4cc5bf){_0x5aa137[_0x3ff6('0x18')](0x194);}return _0x4cc5bf;};}function handleError(_0x1a3f85,_0x5ac7b9){_0x5ac7b9=_0x5ac7b9||0x1f4;return function(_0x1fddd0){logger[_0x3ff6('0x27')](_0x1fddd0['stack']);if(_0x1fddd0[_0x3ff6('0x28')]){delete _0x1fddd0[_0x3ff6('0x28')];}_0x1a3f85[_0x3ff6('0x19')](_0x5ac7b9)[_0x3ff6('0x29')](_0x1fddd0);};}exports[_0x3ff6('0x2a')]=function(_0x2e0f3e,_0x185153){var _0x41c106={},_0x3593e1={},_0x1eabb3={'count':0x0,'rows':[]};var _0xf62a2=_['map'](db[_0x3ff6('0x2b')][_0x3ff6('0x2c')],function(_0x297351){return{'name':_0x297351['fieldName'],'type':_0x297351[_0x3ff6('0x2d')][_0x3ff6('0x2e')]};});_0x3593e1['model']=_[_0x3ff6('0x2f')](_0xf62a2,_0x3ff6('0x28'));_0x3593e1['query']=_[_0x3ff6('0x30')](_0x2e0f3e[_0x3ff6('0x31')]);_0x3593e1['filters']=_['intersection'](_0x3593e1['model'],_0x3593e1['query']);_0x41c106['attributes']=_['intersection'](_0x3593e1['model'],qs[_0x3ff6('0x32')](_0x2e0f3e[_0x3ff6('0x31')][_0x3ff6('0x32')]));_0x41c106[_0x3ff6('0x33')]=_0x41c106[_0x3ff6('0x33')][_0x3ff6('0x34')]?_0x41c106[_0x3ff6('0x33')]:_0x3593e1['model'];if(!_0x2e0f3e['query'][_0x3ff6('0x35')]('nolimit')){_0x41c106[_0x3ff6('0x1d')]=qs[_0x3ff6('0x1d')](_0x2e0f3e['query'][_0x3ff6('0x1d')]);_0x41c106[_0x3ff6('0x36')]=qs['offset'](_0x2e0f3e['query']['offset']);}_0x41c106[_0x3ff6('0x37')]=qs[_0x3ff6('0x38')](_0x2e0f3e[_0x3ff6('0x31')][_0x3ff6('0x38')]);_0x41c106[_0x3ff6('0x39')]=qs[_0x3ff6('0x3a')](_[_0x3ff6('0x3b')](_0x2e0f3e[_0x3ff6('0x31')],_0x3593e1[_0x3ff6('0x3a')]),_0xf62a2);if(_0x2e0f3e[_0x3ff6('0x31')][_0x3ff6('0x3c')]){_0x41c106[_0x3ff6('0x39')]=_[_0x3ff6('0x3d')](_0x41c106[_0x3ff6('0x39')],{'$or':_[_0x3ff6('0x2f')](_0xf62a2,function(_0x18b5e7){if(_0x18b5e7[_0x3ff6('0x2d')]!==_0x3ff6('0x3e')){var _0x429ca2={};_0x429ca2[_0x18b5e7['name']]={'$like':'%'+_0x2e0f3e[_0x3ff6('0x31')][_0x3ff6('0x3c')]+'%'};return _0x429ca2;}})});}_0x41c106=_['merge']({},_0x41c106,_0x2e0f3e['options']);var _0x2a0c2d={'where':_0x41c106[_0x3ff6('0x39')]};return db['UserProfileSection']['count'](_0x2a0c2d)[_0x3ff6('0x26')](function(_0x4ab703){_0x1eabb3[_0x3ff6('0x1c')]=_0x4ab703;if(_0x2e0f3e[_0x3ff6('0x31')]['includeAll']){_0x41c106['include']=[{'all':!![]}];}return db[_0x3ff6('0x2b')]['findAll'](_0x41c106);})[_0x3ff6('0x26')](function(_0x24928c){_0x1eabb3[_0x3ff6('0x3f')]=_0x24928c;return _0x1eabb3;})[_0x3ff6('0x26')](respondWithFilteredResult(_0x185153,_0x41c106))[_0x3ff6('0x40')](handleError(_0x185153,null));};exports[_0x3ff6('0x41')]=function(_0x826c2e,_0x1ea52f){var _0x3c08f1={'raw':![],'where':{'id':_0x826c2e[_0x3ff6('0x42')]['id']}},_0x5b1314={};_0x5b1314[_0x3ff6('0x43')]=_[_0x3ff6('0x30')](db[_0x3ff6('0x2b')][_0x3ff6('0x2c')]);_0x5b1314[_0x3ff6('0x31')]=_[_0x3ff6('0x30')](_0x826c2e[_0x3ff6('0x31')]);_0x5b1314[_0x3ff6('0x3a')]=_['intersection'](_0x5b1314[_0x3ff6('0x43')],_0x5b1314[_0x3ff6('0x31')]);_0x3c08f1['attributes']=_['intersection'](_0x5b1314['model'],qs[_0x3ff6('0x32')](_0x826c2e[_0x3ff6('0x31')][_0x3ff6('0x32')]));_0x3c08f1[_0x3ff6('0x33')]=_0x3c08f1[_0x3ff6('0x33')]['length']?_0x3c08f1[_0x3ff6('0x33')]:_0x5b1314[_0x3ff6('0x43')];if(_0x826c2e['query'][_0x3ff6('0x44')]){_0x3c08f1['include']=[{'all':!![]}];}_0x3c08f1=_['merge']({},_0x3c08f1,_0x826c2e[_0x3ff6('0x45')]);return db['UserProfileSection']['find'](_0x3c08f1)['then'](handleEntityNotFound(_0x1ea52f,null))[_0x3ff6('0x26')](respondWithResult(_0x1ea52f,null))[_0x3ff6('0x40')](handleError(_0x1ea52f,null));};exports['create']=function(_0x495cf4,_0x3a2498){return db['UserProfileSection'][_0x3ff6('0x46')](_0x495cf4[_0x3ff6('0x47')],{})[_0x3ff6('0x26')](respondWithResult(_0x3a2498,0xc9))[_0x3ff6('0x40')](handleError(_0x3a2498,null));};exports[_0x3ff6('0x24')]=function(_0x584646,_0x2284c2){if(_0x584646[_0x3ff6('0x47')]['id']){delete _0x584646['body']['id'];}return db[_0x3ff6('0x2b')][_0x3ff6('0x48')]({'where':{'id':_0x584646[_0x3ff6('0x42')]['id']}})[_0x3ff6('0x26')](handleEntityNotFound(_0x2284c2,null))[_0x3ff6('0x26')](saveUpdates(_0x584646['body'],null))[_0x3ff6('0x26')](respondWithResult(_0x2284c2,null))[_0x3ff6('0x40')](handleError(_0x2284c2,null));};exports[_0x3ff6('0x25')]=function(_0x418872,_0x476bcd){return db[_0x3ff6('0x2b')][_0x3ff6('0x48')]({'where':{'id':_0x418872[_0x3ff6('0x42')]['id']}})[_0x3ff6('0x26')](handleEntityNotFound(_0x476bcd,null))[_0x3ff6('0x26')](removeEntity(_0x476bcd,null))[_0x3ff6('0x40')](handleError(_0x476bcd,null));};exports[_0x3ff6('0x49')]=function(_0x2d0f9,_0xb2d7a2){return db[_0x3ff6('0x2b')][_0x3ff6('0x49')]()[_0x3ff6('0x26')](respondWithResult(_0xb2d7a2,null))['catch'](handleError(_0xb2d7a2,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c13bfa2..27c537a 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 _0x8556=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x36c26e,_0x4a64a3){var _0x546071=function(_0x500d02){while(--_0x500d02){_0x36c26e['push'](_0x36c26e['shift']());}};_0x546071(++_0x4a64a3);}(_0x8556,0x1da));var _0x6855=function(_0x5c6403,_0xb08818){_0x5c6403=_0x5c6403-0x0;var _0x523367=_0x8556[_0x5c6403];return _0x523367;};'use strict';var _=require(_0x6855('0x0'));var util=require(_0x6855('0x1'));var logger=require(_0x6855('0x2'))('api');var moment=require(_0x6855('0x3'));var BPromise=require(_0x6855('0x4'));var rp=require(_0x6855('0x5'));var fs=require('fs');var path=require(_0x6855('0x6'));var rimraf=require(_0x6855('0x7'));var config=require(_0x6855('0x8'));var attributes=require(_0x6855('0x9'));module[_0x6855('0xa')]=function(_0x346b22,_0x2b02bf){return _0x346b22[_0x6855('0xb')]('UserProfileSection',attributes,{'tableName':_0x6855('0xc'),'paranoid':![],'indexes':[{'name':_0x6855('0xd'),'fields':['sectionId',_0x6855('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea12=['../../config/logger','bluebird','request-promise','path','rimraf','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xea12,0x136));var _0x2ea1=function(_0x4cbe2c,_0x4d0cd2){_0x4cbe2c=_0x4cbe2c-0x0;var _0x38ccd3=_0xea12[_0x4cbe2c];return _0x38ccd3;};'use strict';var _=require(_0x2ea1('0x0'));var util=require(_0x2ea1('0x1'));var logger=require(_0x2ea1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2ea1('0x3'));var rp=require(_0x2ea1('0x4'));var fs=require('fs');var path=require(_0x2ea1('0x5'));var rimraf=require(_0x2ea1('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x347b8f,_0x1a151d){return _0x347b8f[_0x2ea1('0x7')](_0x2ea1('0x8'),attributes,{'tableName':_0x2ea1('0x9'),'paranoid':![],'indexes':[{'name':_0x2ea1('0xa'),'fields':[_0x2ea1('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 16eee21..1ce55f6 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 _0x2d39=['stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0xe92f5b,_0x5c5b57){var _0x27854b=function(_0x578fdd){while(--_0x578fdd){_0xe92f5b['push'](_0xe92f5b['shift']());}};_0x27854b(++_0x5c5b57);}(_0x2d39,0x11e));var _0x92d3=function(_0x20bb55,_0x58e943){_0x20bb55=_0x20bb55-0x0;var _0x47b801=_0x2d39[_0x20bb55];return _0x47b801;};'use strict';var _=require(_0x92d3('0x0'));var util=require('util');var moment=require(_0x92d3('0x1'));var BPromise=require(_0x92d3('0x2'));var rs=require(_0x92d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92d3('0x4'))['db'];var utils=require(_0x92d3('0x5'));var logger=require(_0x92d3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x92d3('0x7'));var client=jayson[_0x92d3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cfaf8,_0x5cd9aa,_0x40c576){return new BPromise(function(_0x286d8d,_0xa63b22){return client['request'](_0x1cfaf8,_0x40c576)[_0x92d3('0x9')](function(_0x58d51d){logger['info'](_0x92d3('0xa'),_0x5cd9aa,_0x92d3('0xb'));logger[_0x92d3('0xc')](_0x92d3('0xd'),_0x5cd9aa,'request\x20sent',JSON[_0x92d3('0xe')](_0x58d51d));if(_0x58d51d['error']){if(_0x58d51d[_0x92d3('0xf')][_0x92d3('0x10')]===0x1f4){logger[_0x92d3('0xf')](_0x92d3('0xa'),_0x5cd9aa,_0x58d51d[_0x92d3('0xf')][_0x92d3('0x11')]);return _0xa63b22(_0x58d51d[_0x92d3('0xf')][_0x92d3('0x11')]);}logger[_0x92d3('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x5cd9aa,_0x58d51d[_0x92d3('0xf')][_0x92d3('0x11')]);return _0x286d8d(_0x58d51d['error'][_0x92d3('0x11')]);}else{logger[_0x92d3('0x12')](_0x92d3('0xa'),_0x5cd9aa,_0x92d3('0xb'));_0x286d8d(_0x58d51d['result'][_0x92d3('0x11')]);}})[_0x92d3('0x13')](function(_0x10e8e5){logger[_0x92d3('0xf')](_0x92d3('0xa'),_0x5cd9aa,_0x10e8e5);_0xa63b22(_0x10e8e5);});});} \ No newline at end of file +var _0x0200=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileSection,\x20%s,\x20%s','message','info'];(function(_0x4c2f0d,_0x50b78e){var _0x5543cf=function(_0x4bc2fb){while(--_0x4bc2fb){_0x4c2f0d['push'](_0x4c2f0d['shift']());}};_0x5543cf(++_0x50b78e);}(_0x0200,0x17d));var _0x0020=function(_0x53aaf8,_0x863bcb){_0x53aaf8=_0x53aaf8-0x0;var _0x1fedb1=_0x0200[_0x53aaf8];return _0x1fedb1;};'use strict';var _=require(_0x0020('0x0'));var util=require(_0x0020('0x1'));var moment=require(_0x0020('0x2'));var BPromise=require('bluebird');var rs=require(_0x0020('0x3'));var fs=require('fs');var Redis=require(_0x0020('0x4'));var db=require(_0x0020('0x5'))['db'];var utils=require(_0x0020('0x6'));var logger=require(_0x0020('0x7'))(_0x0020('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20ad02,_0x44aef9,_0x1f497e){return new BPromise(function(_0x4665bd,_0x241a76){return client[_0x0020('0x9')](_0x20ad02,_0x1f497e)[_0x0020('0xa')](function(_0x2a5e8e){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x44aef9,_0x0020('0xb'));logger[_0x0020('0xc')](_0x0020('0xd'),_0x44aef9,_0x0020('0xb'),JSON[_0x0020('0xe')](_0x2a5e8e));if(_0x2a5e8e['error']){if(_0x2a5e8e[_0x0020('0xf')]['code']===0x1f4){logger[_0x0020('0xf')](_0x0020('0x10'),_0x44aef9,_0x2a5e8e[_0x0020('0xf')][_0x0020('0x11')]);return _0x241a76(_0x2a5e8e['error'][_0x0020('0x11')]);}logger[_0x0020('0xf')](_0x0020('0x10'),_0x44aef9,_0x2a5e8e[_0x0020('0xf')][_0x0020('0x11')]);return _0x4665bd(_0x2a5e8e[_0x0020('0xf')][_0x0020('0x11')]);}else{logger[_0x0020('0x12')](_0x0020('0x10'),_0x44aef9,_0x0020('0xb'));_0x4665bd(_0x2a5e8e['result'][_0x0020('0x11')]);}})[_0x0020('0x13')](function(_0x38418e){logger[_0x0020('0xf')](_0x0020('0x10'),_0x44aef9,_0x38418e);_0x241a76(_0x38418e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 6b9f115..e77df39 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5017e8,_0x44bf12){var _0x4f36f0=function(_0x41dd76){while(--_0x41dd76){_0x5017e8['push'](_0x5017e8['shift']());}};_0x4f36f0(++_0x44bf12);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x262ee7,_0x52ee92){var _0x1dc842=function(_0x4bf54a){while(--_0x4bf54a){_0x262ee7['push'](_0x262ee7['shift']());}};_0x1dc842(++_0x52ee92);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 3084b70..56a8735 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 _0x1b00=['INTEGER','sequelize'];(function(_0xbed6a6,_0x2c7518){var _0x53614d=function(_0x5d8917){while(--_0x5d8917){_0xbed6a6['push'](_0xbed6a6['shift']());}};_0x53614d(++_0x2c7518);}(_0x1b00,0xc7));var _0x01b0=function(_0x210f6c,_0x3684e7){_0x210f6c=_0x210f6c-0x0;var _0x2c07db=_0x1b00[_0x210f6c];return _0x2c07db;};'use strict';var Sequelize=require(_0x01b0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x01b0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4e6=['sequelize','exports','INTEGER'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xb4e6[_0x230e39];return _0xa804e;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module[_0x6b4e('0x1')]={'penalty':{'type':Sequelize[_0x6b4e('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 cbc1cec..fabfce0 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 _0xf40b=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment'];(function(_0x1342e5,_0x1950f4){var _0x16af23=function(_0x225400){while(--_0x225400){_0x1342e5['push'](_0x1342e5['shift']());}};_0x16af23(++_0x1950f4);}(_0xf40b,0xb0));var _0xbf40=function(_0x1e7aff,_0x1c843b){_0x1e7aff=_0x1e7aff-0x0;var _0x2a16bf=_0xf40b[_0x1e7aff];return _0x2a16bf;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf40('0x4'));var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module['exports']=function(_0x2e74b5,_0xbe1c47){return _0x2e74b5[_0xbf40('0x9')](_0xbf40('0xa'),attributes,{'tableName':_0xbf40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','UserSmsQueue','user_has_sms_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports'];(function(_0x31e965,_0xbd1e54){var _0x120351=function(_0x45229d){while(--_0x45229d){_0x31e965['push'](_0x31e965['shift']());}};_0x120351(++_0xbd1e54);}(_0xacf4,0xe7));var _0x4acf=function(_0x46360b,_0x37bd12){_0x46360b=_0x46360b-0x0;var _0x41c465=_0xacf4[_0x46360b];return _0x41c465;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('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 6f309bd..a0e4bcc 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 _0xcc83=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4fb815,_0x4191c7){var _0x295e42=function(_0x2a1082){while(--_0x2a1082){_0x4fb815['push'](_0x4fb815['shift']());}};_0x295e42(++_0x4191c7);}(_0xcc83,0x157));var _0x3cc8=function(_0x27a4e0,_0x4816f5){_0x27a4e0=_0x27a4e0-0x0;var _0x2b57c7=_0xcc83[_0x27a4e0];return _0x2b57c7;};'use strict';var _=require('lodash');var util=require(_0x3cc8('0x0'));var moment=require(_0x3cc8('0x1'));var BPromise=require(_0x3cc8('0x2'));var rs=require(_0x3cc8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cc8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cc8('0x5'))(_0x3cc8('0x6'));var config=require(_0x3cc8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3cc8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x502700,_0x37c9cc,_0x2d78be){return new BPromise(function(_0x48c8eb,_0xcb5e1){return client[_0x3cc8('0x9')](_0x502700,_0x2d78be)[_0x3cc8('0xa')](function(_0x440dd2){logger['info'](_0x3cc8('0xb'),_0x37c9cc,_0x3cc8('0xc'));logger['debug'](_0x3cc8('0xd'),_0x37c9cc,'request\x20sent',JSON[_0x3cc8('0xe')](_0x440dd2));if(_0x440dd2[_0x3cc8('0xf')]){if(_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x10')]===0x1f4){logger[_0x3cc8('0xf')](_0x3cc8('0xb'),_0x37c9cc,_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);return _0xcb5e1(_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);}logger['error'](_0x3cc8('0xb'),_0x37c9cc,_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);return _0x48c8eb(_0x440dd2[_0x3cc8('0xf')][_0x3cc8('0x11')]);}else{logger['info'](_0x3cc8('0xb'),_0x37c9cc,_0x3cc8('0xc'));_0x48c8eb(_0x440dd2[_0x3cc8('0x12')]['message']);}})[_0x3cc8('0x13')](function(_0x6941b3){logger[_0x3cc8('0xf')](_0x3cc8('0xb'),_0x37c9cc,_0x6941b3);_0xcb5e1(_0x6941b3);});});} \ No newline at end of file +var _0x2d29=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x48d0c9,_0x5b26ac){var _0xcfaa34=function(_0x45edfc){while(--_0x45edfc){_0x48d0c9['push'](_0x48d0c9['shift']());}};_0xcfaa34(++_0x5b26ac);}(_0x2d29,0x13b));var _0x92d2=function(_0x3178f4,_0xd535ca){_0x3178f4=_0x3178f4-0x0;var _0x41efce=_0x2d29[_0x3178f4];return _0x41efce;};'use strict';var _=require(_0x92d2('0x0'));var util=require(_0x92d2('0x1'));var moment=require(_0x92d2('0x2'));var BPromise=require(_0x92d2('0x3'));var rs=require(_0x92d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92d2('0x6'))(_0x92d2('0x7'));var config=require('../../config/environment');var jayson=require(_0x92d2('0x8'));var client=jayson[_0x92d2('0x9')][_0x92d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe322f4,_0x4a0cfe,_0xb0a0ce){return new BPromise(function(_0x2f4a4a,_0x45df4a){return client[_0x92d2('0xb')](_0xe322f4,_0xb0a0ce)['then'](function(_0x193006){logger[_0x92d2('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x4a0cfe,_0x92d2('0xd'));logger['debug'](_0x92d2('0xe'),_0x4a0cfe,'request\x20sent',JSON['stringify'](_0x193006));if(_0x193006[_0x92d2('0xf')]){if(_0x193006['error'][_0x92d2('0x10')]===0x1f4){logger['error'](_0x92d2('0x11'),_0x4a0cfe,_0x193006[_0x92d2('0xf')][_0x92d2('0x12')]);return _0x45df4a(_0x193006['error']['message']);}logger[_0x92d2('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x4a0cfe,_0x193006[_0x92d2('0xf')][_0x92d2('0x12')]);return _0x2f4a4a(_0x193006[_0x92d2('0xf')][_0x92d2('0x12')]);}else{logger[_0x92d2('0xc')](_0x92d2('0x11'),_0x4a0cfe,'request\x20sent');_0x2f4a4a(_0x193006[_0x92d2('0x13')][_0x92d2('0x12')]);}})[_0x92d2('0x14')](function(_0x138574){logger[_0x92d2('0xf')](_0x92d2('0x11'),_0x4a0cfe,_0x138574);_0x45df4a(_0x138574);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 79b73f0..aff626f 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 _0x1249=['INTEGER'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x1249,0x1aa));var _0x9124=function(_0x189081,_0x5c63b9){_0x189081=_0x189081-0x0;var _0x1fb834=_0x1249[_0x189081];return _0x1fb834;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x9124('0x0')]}}; \ No newline at end of file +var _0x4465=['sequelize','exports','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4465,0xdb));var _0x5446=function(_0x3a96f0,_0x524cd7){_0x3a96f0=_0x3a96f0-0x0;var _0x35a2d5=_0x4465[_0x3a96f0];return _0x35a2d5;};'use strict';var Sequelize=require(_0x5446('0x0'));module[_0x5446('0x1')]={'UserId':{'type':Sequelize[_0x5446('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5446('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 55e01f2..3b91749 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(_0x41c8f2,_0x4713f7){var _0x53e568=function(_0x34358a){while(--_0x34358a){_0x41c8f2['push'](_0x41c8f2['shift']());}};_0x53e568(++_0x4713f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3a711c,_0x116edb){var _0x5370ef=function(_0x2e8d40){while(--_0x2e8d40){_0x3a711c['push'](_0x3a711c['shift']());}};_0x5370ef(++_0x116edb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 9b52b8e..37db35d 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5f33ec,_0x3e6fde){var _0x104c6b=function(_0x310fe6){while(--_0x310fe6){_0x5f33ec['push'](_0x5f33ec['shift']());}};_0x104c6b(++_0x3e6fde);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0xcb91[_0x23c73d];return _0x36ba47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e6bdb,_0x49f327){var _0x4cc923=function(_0x17d720){while(--_0x17d720){_0x1e6bdb['push'](_0x1e6bdb['shift']());}};_0x4cc923(++_0x49f327);}(_0x70e0,0x17b));var _0x070e=function(_0x53c037,_0x37df9d){_0x53c037=_0x53c037-0x0;var _0x52a063=_0x70e0[_0x53c037];return _0x52a063;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 6410c56..46fbd2b 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 _0xf8b2=['exports','INTEGER','sequelize'];(function(_0x32a73d,_0x5cdbc9){var _0x4d4942=function(_0x1a68c7){while(--_0x1a68c7){_0x32a73d['push'](_0x32a73d['shift']());}};_0x4d4942(++_0x5cdbc9);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x29e683,_0x31f631){_0x29e683=_0x29e683-0x0;var _0x5a100c=_0xf8b2[_0x29e683];return _0x5a100c;};'use strict';var Sequelize=require(_0x2f8b('0x0'));module[_0x2f8b('0x1')]={'penalty':{'type':Sequelize[_0x2f8b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa2f3=['exports'];(function(_0x26ad6b,_0x662c04){var _0x5be2b2=function(_0x366825){while(--_0x366825){_0x26ad6b['push'](_0x26ad6b['shift']());}};_0x5be2b2(++_0x662c04);}(_0xa2f3,0x76));var _0x3a2f=function(_0x5acbce,_0x46e43b){_0x5acbce=_0x5acbce-0x0;var _0x13ecb7=_0xa2f3[_0x5acbce];return _0x13ecb7;};'use strict';var Sequelize=require('sequelize');module[_0x3a2f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index d0a4f2d..5e0c3cc 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 _0x1fee=['exports','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0xcce960,_0x706200){var _0x5e5597=function(_0x567734){while(--_0x567734){_0xcce960['push'](_0xcce960['shift']());}};_0x5e5597(++_0x706200);}(_0x1fee,0x12e));var _0xe1fe=function(_0x36e831,_0x448d5e){_0x36e831=_0x36e831-0x0;var _0x201465=_0x1fee[_0x36e831];return _0x201465;};'use strict';var _=require(_0xe1fe('0x0'));var util=require(_0xe1fe('0x1'));var logger=require(_0xe1fe('0x2'))(_0xe1fe('0x3'));var moment=require(_0xe1fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1fe('0x5'));var fs=require('fs');var path=require(_0xe1fe('0x6'));var rimraf=require(_0xe1fe('0x7'));var config=require(_0xe1fe('0x8'));var attributes=require(_0xe1fe('0x9'));module[_0xe1fe('0xa')]=function(_0x8b3fd,_0x3c5fb1){return _0x8b3fd['define']('UserVoiceQueue',attributes,{'tableName':_0xe1fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd334=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xd334,0x1bb));var _0x4d33=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd334[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x4d33('0x0'));var util=require(_0x4d33('0x1'));var logger=require('../../config/logger')(_0x4d33('0x2'));var moment=require(_0x4d33('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d33('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d33('0x5'));var config=require(_0x4d33('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x4d33('0x7')]=function(_0x50100b,_0x31c1a3){return _0x50100b[_0x4d33('0x8')](_0x4d33('0x9'),attributes,{'tableName':_0x4d33('0xa'),'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 23e7aad..24bfd5b 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 _0xe373=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x5061ad,_0x4b076b){var _0x4ce894=function(_0xf9ad6d){while(--_0xf9ad6d){_0x5061ad['push'](_0x5061ad['shift']());}};_0x4ce894(++_0x4b076b);}(_0xe373,0x125));var _0x3e37=function(_0x2c5cd8,_0x3f462a){_0x2c5cd8=_0x2c5cd8-0x0;var _0x2e610b=_0xe373[_0x2c5cd8];return _0x2e610b;};'use strict';var _=require(_0x3e37('0x0'));var util=require('util');var moment=require(_0x3e37('0x1'));var BPromise=require(_0x3e37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e37('0x3'));var db=require(_0x3e37('0x4'))['db'];var utils=require(_0x3e37('0x5'));var logger=require(_0x3e37('0x6'))(_0x3e37('0x7'));var config=require(_0x3e37('0x8'));var jayson=require(_0x3e37('0x9'));var client=jayson[_0x3e37('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xce557e,_0x500ea4,_0x114510){return new BPromise(function(_0x2ff1fb,_0x5a875b){return client[_0x3e37('0xb')](_0xce557e,_0x114510)[_0x3e37('0xc')](function(_0x1d411e){logger[_0x3e37('0xd')](_0x3e37('0xe'),_0x500ea4,_0x3e37('0xf'));logger[_0x3e37('0x10')](_0x3e37('0x11'),_0x500ea4,_0x3e37('0xf'),JSON[_0x3e37('0x12')](_0x1d411e));if(_0x1d411e[_0x3e37('0x13')]){if(_0x1d411e[_0x3e37('0x13')]['code']===0x1f4){logger[_0x3e37('0x13')](_0x3e37('0xe'),_0x500ea4,_0x1d411e[_0x3e37('0x13')][_0x3e37('0x14')]);return _0x5a875b(_0x1d411e[_0x3e37('0x13')][_0x3e37('0x14')]);}logger[_0x3e37('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x500ea4,_0x1d411e['error']['message']);return _0x2ff1fb(_0x1d411e[_0x3e37('0x13')][_0x3e37('0x14')]);}else{logger[_0x3e37('0xd')](_0x3e37('0xe'),_0x500ea4,_0x3e37('0xf'));_0x2ff1fb(_0x1d411e[_0x3e37('0x15')][_0x3e37('0x14')]);}})['catch'](function(_0x13d6d4){logger[_0x3e37('0x13')](_0x3e37('0xe'),_0x500ea4,_0x13d6d4);_0x5a875b(_0x13d6d4);});});} \ No newline at end of file +var _0x7b4c=['../../config/environment','client','http','request','debug','request\x20sent','stringify','error','message','result','catch','UserVoiceQueue,\x20%s,\x20%s','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b4c,0xd2));var _0xc7b4=function(_0x40247a,_0x4f8a77){_0x40247a=_0x40247a-0x0;var _0x1e0a8d=_0x7b4c[_0x40247a];return _0x1e0a8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc7b4('0x0'));var fs=require('fs');var Redis=require(_0xc7b4('0x1'));var db=require(_0xc7b4('0x2'))['db'];var utils=require(_0xc7b4('0x3'));var logger=require(_0xc7b4('0x4'))(_0xc7b4('0x5'));var config=require(_0xc7b4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc7b4('0x7')][_0xc7b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xde67f8,_0x4b3524,_0x5ebc63){return new BPromise(function(_0x467254,_0x28124e){return client[_0xc7b4('0x9')](_0xde67f8,_0x5ebc63)['then'](function(_0x496629){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x4b3524,'request\x20sent');logger[_0xc7b4('0xa')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4b3524,_0xc7b4('0xb'),JSON[_0xc7b4('0xc')](_0x496629));if(_0x496629[_0xc7b4('0xd')]){if(_0x496629[_0xc7b4('0xd')]['code']===0x1f4){logger[_0xc7b4('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x4b3524,_0x496629[_0xc7b4('0xd')][_0xc7b4('0xe')]);return _0x28124e(_0x496629[_0xc7b4('0xd')][_0xc7b4('0xe')]);}logger[_0xc7b4('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x4b3524,_0x496629[_0xc7b4('0xd')][_0xc7b4('0xe')]);return _0x467254(_0x496629[_0xc7b4('0xd')]['message']);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x4b3524,'request\x20sent');_0x467254(_0x496629[_0xc7b4('0xf')][_0xc7b4('0xe')]);}})[_0xc7b4('0x10')](function(_0xc6319b){logger[_0xc7b4('0xd')](_0xc7b4('0x11'),_0x4b3524,_0xc6319b);_0x28124e(_0xc6319b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c384ab7..af1e16b 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1e28a1,_0x4fb2e0){var _0x408d2d=function(_0x4f2120){while(--_0x4f2120){_0x1e28a1['push'](_0x1e28a1['shift']());}};_0x408d2d(++_0x4fb2e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4cf07b,_0x3533aa){var _0x5d70ff=function(_0x321805){while(--_0x321805){_0x4cf07b['push'](_0x4cf07b['shift']());}};_0x5d70ff(++_0x3533aa);}(_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 f7b98e7..ca66f6d 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 _0x5291=['queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER','STRING'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0x5291,0xda));var _0x1529=function(_0x184bf2,_0xf1db7f){_0x184bf2=_0x184bf2-0x0;var _0x2748c8=_0x5291[_0x184bf2];return _0x2748c8;};'use strict';var Sequelize=require(_0x1529('0x0'));module[_0x1529('0x1')]={'uniqueid':{'type':Sequelize[_0x1529('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x1529('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1529('0x3')],'allowNull':![],'unique':_0x1529('0x4'),'comment':_0x1529('0x5')},'VoiceQueueId':{'type':Sequelize[_0x1529('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1529('0x4'),'comment':_0x1529('0x5')},'penalty':{'type':Sequelize[_0x1529('0x2')](0xb),'defaultValue':0x0,'comment':_0x1529('0x5')},'paused':{'type':Sequelize[_0x1529('0x2')](0xb),'defaultValue':0x0,'comment':_0x1529('0x5')}}; \ No newline at end of file +var _0xf00a=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf00a,0x114));var _0xaf00=function(_0x25678f,_0x5958d5){_0x25678f=_0x25678f-0x0;var _0x1961b5=_0xf00a[_0x25678f];return _0x1961b5;};'use strict';var Sequelize=require(_0xaf00('0x0'));module[_0xaf00('0x1')]={'uniqueid':{'type':Sequelize[_0xaf00('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xaf00('0x3')},'membername':{'type':Sequelize[_0xaf00('0x4')],'allowNull':![],'comment':_0xaf00('0x3')},'UserId':{'type':Sequelize[_0xaf00('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xaf00('0x4')],'allowNull':![],'unique':_0xaf00('0x5'),'comment':_0xaf00('0x3')},'VoiceQueueId':{'type':Sequelize[_0xaf00('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xaf00('0x4')],'allowNull':![],'unique':_0xaf00('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xaf00('0x2')](0xb),'defaultValue':0x0,'comment':_0xaf00('0x3')},'paused':{'type':Sequelize[_0xaf00('0x2')](0xb),'defaultValue':0x0,'comment':_0xaf00('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9b592db..db21c8c 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 _0x8b1a=['exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x82d46a,_0x2eafa5){var _0x46dfd6=function(_0x4edc4a){while(--_0x4edc4a){_0x82d46a['push'](_0x82d46a['shift']());}};_0x46dfd6(++_0x2eafa5);}(_0x8b1a,0x10f));var _0xa8b1=function(_0x2682fd,_0xc583be){_0x2682fd=_0x2682fd-0x0;var _0x485276=_0x8b1a[_0x2682fd];return _0x485276;};'use strict';var EventEmitter=require(_0xa8b1('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xa8b1('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa8b1('0x2')](0x0);var events={'afterCreate':_0xa8b1('0x3'),'afterUpdate':_0xa8b1('0x4'),'afterDestroy':_0xa8b1('0x5')};function emitEvent(_0x2bc743){return function(_0x427f77,_0x53d8ef,_0x5da654){UserVoiceQueueRtEvents[_0xa8b1('0x6')](_0x2bc743+':'+_0x427f77['id'],_0x427f77);UserVoiceQueueRtEvents[_0xa8b1('0x6')](_0x2bc743,_0x427f77);_0x5da654(null);};}for(var e in events){if(events[_0xa8b1('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xa8b1('0x8')](e,emitEvent(event));}}module[_0xa8b1('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x89f7=['setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x3a39f0,_0x2bfe12){var _0x26a696=function(_0x326c5c){while(--_0x326c5c){_0x3a39f0['push'](_0x3a39f0['shift']());}};_0x26a696(++_0x2bfe12);}(_0x89f7,0x72));var _0x789f=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x89f7[_0x59616b];return _0x5c4523;};'use strict';var EventEmitter=require(_0x789f('0x0'));var UserVoiceQueueRt=require(_0x789f('0x1'))['db'][_0x789f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x789f('0x3')](0x0);var events={'afterCreate':_0x789f('0x4'),'afterUpdate':_0x789f('0x5'),'afterDestroy':_0x789f('0x6')};function emitEvent(_0x57ac38){return function(_0x428c4e,_0x203045,_0x885955){UserVoiceQueueRtEvents['emit'](_0x57ac38+':'+_0x428c4e['id'],_0x428c4e);UserVoiceQueueRtEvents['emit'](_0x57ac38,_0x428c4e);_0x885955(null);};}for(var e in events){if(events[_0x789f('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x789f('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 070aa0d..ef3b129 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 _0xc959=['user_has_voice_queues_rt','lodash','util','moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt'];(function(_0x42d508,_0x265ea3){var _0x88fd77=function(_0x1307af){while(--_0x1307af){_0x42d508['push'](_0x42d508['shift']());}};_0x88fd77(++_0x265ea3);}(_0xc959,0x1af));var _0x9c95=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc959[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x9c95('0x0'));var util=require(_0x9c95('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c95('0x2'));var BPromise=require(_0x9c95('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c95('0x4'));var rimraf=require('rimraf');var config=require(_0x9c95('0x5'));var attributes=require(_0x9c95('0x6'));module['exports']=function(_0x1e83d0,_0x45672c){return _0x1e83d0[_0x9c95('0x7')](_0x9c95('0x8'),attributes,{'tableName':_0x9c95('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6343=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x2b3441,_0x46835a){var _0x22f5df=function(_0x1cf0f1){while(--_0x1cf0f1){_0x2b3441['push'](_0x2b3441['shift']());}};_0x22f5df(++_0x46835a);}(_0x6343,0xd1));var _0x3634=function(_0x39e053,_0x592e73){_0x39e053=_0x39e053-0x0;var _0x3d04d0=_0x6343[_0x39e053];return _0x3d04d0;};'use strict';var _=require(_0x3634('0x0'));var util=require('util');var logger=require(_0x3634('0x1'))('api');var moment=require(_0x3634('0x2'));var BPromise=require(_0x3634('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3634('0x4'));var rimraf=require('rimraf');var config=require(_0x3634('0x5'));var attributes=require(_0x3634('0x6'));module[_0x3634('0x7')]=function(_0x2957dd,_0x18ec72){return _0x2957dd[_0x3634('0x8')](_0x3634('0x9'),attributes,{'tableName':_0x3634('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 8cbe7b2..5119bab 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 _0x750d=['then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x506079,_0x2fac62){var _0x4365b2=function(_0x45dcfc){while(--_0x45dcfc){_0x506079['push'](_0x506079['shift']());}};_0x4365b2(++_0x2fac62);}(_0x750d,0x13b));var _0xd750=function(_0x3e8eb3,_0x12d894){_0x3e8eb3=_0x3e8eb3-0x0;var _0x2c222a=_0x750d[_0x3e8eb3];return _0x2c222a;};'use strict';var _=require(_0xd750('0x0'));var util=require('util');var moment=require(_0xd750('0x1'));var BPromise=require(_0xd750('0x2'));var rs=require(_0xd750('0x3'));var fs=require('fs');var Redis=require(_0xd750('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd750('0x5'));var logger=require(_0xd750('0x6'))(_0xd750('0x7'));var config=require('../../config/environment');var jayson=require(_0xd750('0x8'));var client=jayson[_0xd750('0x9')]['http']({'port':0x232a});config[_0xd750('0xa')]=_[_0xd750('0xb')](config[_0xd750('0xa')],{'host':_0xd750('0xc'),'port':0x18eb});var socket=require(_0xd750('0xd'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xd750('0xe')](socket);function respondWithRpcPromise(_0x450b75,_0x30d820,_0x6ab90c){return new BPromise(function(_0x267278,_0x5e448c){return client['request'](_0x450b75,_0x6ab90c)[_0xd750('0xf')](function(_0x20fd64){logger[_0xd750('0x10')](_0xd750('0x11'),_0x30d820,_0xd750('0x12'));logger[_0xd750('0x13')](_0xd750('0x14'),_0x30d820,'request\x20sent',JSON['stringify'](_0x20fd64));if(_0x20fd64[_0xd750('0x15')]){if(_0x20fd64[_0xd750('0x15')]['code']===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x30d820,_0x20fd64[_0xd750('0x15')]['message']);return _0x5e448c(_0x20fd64[_0xd750('0x15')][_0xd750('0x16')]);}logger[_0xd750('0x15')](_0xd750('0x11'),_0x30d820,_0x20fd64['error'][_0xd750('0x16')]);return _0x267278(_0x20fd64[_0xd750('0x15')][_0xd750('0x16')]);}else{logger[_0xd750('0x10')](_0xd750('0x11'),_0x30d820,_0xd750('0x12'));_0x267278(_0x20fd64['result'][_0xd750('0x16')]);}})['catch'](function(_0x3028cc){logger[_0xd750('0x15')](_0xd750('0x11'),_0x30d820,_0x3028cc);_0x5e448c(_0x3028cc);});});}exports[_0xd750('0x17')]=function(_0x643511){var _0x5996ac=this;return new Promise(function(_0xcc768,_0x50b2b0){return db[_0xd750('0x18')][_0xd750('0x19')]({'raw':_0x643511[_0xd750('0x1a')]?_0x643511[_0xd750('0x1a')][_0xd750('0x1b')]===undefined?!![]:![]:!![],'where':_0x643511['options']?_0x643511['options'][_0xd750('0x1c')]||null:null,'attributes':[[db[_0xd750('0x1d')]['fn'](_0xd750('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xd750('0x1f')))),_0xd750('0x20')]]})[_0xd750('0xf')](function(_0x37f828){logger[_0xd750('0x10')](_0xd750('0x17'),_0x643511);logger[_0xd750('0x13')]('GetVoiceQueueRtPauses',_0x643511,JSON['stringify'](_0x37f828));_0xcc768(_0x37f828);})['catch'](function(_0x4db9f5){logger[_0xd750('0x15')](_0xd750('0x17'),_0x4db9f5[_0xd750('0x16')],_0x643511);_0x50b2b0(_0x5996ac[_0xd750('0x15')](0x1f4,_0x4db9f5[_0xd750('0x16')]));});});}; \ No newline at end of file +var _0x404d=['then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x404d,0xb7));var _0xd404=function(_0x4f5530,_0x14d560){_0x4f5530=_0x4f5530-0x0;var _0x122f09=_0x404d[_0x4f5530];return _0x122f09;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require('moment');var BPromise=require(_0xd404('0x2'));var rs=require(_0xd404('0x3'));var fs=require('fs');var Redis=require(_0xd404('0x4'));var db=require(_0xd404('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd404('0x6'))(_0xd404('0x7'));var config=require(_0xd404('0x8'));var jayson=require(_0xd404('0x9'));var client=jayson[_0xd404('0xa')]['http']({'port':0x232a});config[_0xd404('0xb')]=_[_0xd404('0xc')](config[_0xd404('0xb')],{'host':_0xd404('0xd'),'port':0x18eb});var socket=require(_0xd404('0xe'))(new Redis(config[_0xd404('0xb')]));require(_0xd404('0xf'))['register'](socket);function respondWithRpcPromise(_0x208213,_0x2750fb,_0x2016fa){return new BPromise(function(_0x28e291,_0x316c93){return client[_0xd404('0x10')](_0x208213,_0x2016fa)[_0xd404('0x11')](function(_0x6aa8c5){logger['info'](_0xd404('0x12'),_0x2750fb,_0xd404('0x13'));logger[_0xd404('0x14')](_0xd404('0x15'),_0x2750fb,_0xd404('0x13'),JSON[_0xd404('0x16')](_0x6aa8c5));if(_0x6aa8c5[_0xd404('0x17')]){if(_0x6aa8c5[_0xd404('0x17')][_0xd404('0x18')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2750fb,_0x6aa8c5[_0xd404('0x17')][_0xd404('0x19')]);return _0x316c93(_0x6aa8c5[_0xd404('0x17')][_0xd404('0x19')]);}logger[_0xd404('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2750fb,_0x6aa8c5['error'][_0xd404('0x19')]);return _0x28e291(_0x6aa8c5[_0xd404('0x17')]['message']);}else{logger[_0xd404('0x1a')](_0xd404('0x12'),_0x2750fb,'request\x20sent');_0x28e291(_0x6aa8c5[_0xd404('0x1b')][_0xd404('0x19')]);}})[_0xd404('0x1c')](function(_0x100551){logger[_0xd404('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2750fb,_0x100551);_0x316c93(_0x100551);});});}exports[_0xd404('0x1d')]=function(_0x26693a){var _0x126088=this;return new Promise(function(_0x44e261,_0x176f63){return db[_0xd404('0x1e')][_0xd404('0x1f')]({'raw':_0x26693a[_0xd404('0x20')]?_0x26693a[_0xd404('0x20')][_0xd404('0x21')]===undefined?!![]:![]:!![],'where':_0x26693a[_0xd404('0x20')]?_0x26693a['options'][_0xd404('0x22')]||null:null,'attributes':[[db[_0xd404('0x23')]['fn'](_0xd404('0x24'),db[_0xd404('0x23')]['fn']('IF',db[_0xd404('0x23')][_0xd404('0x25')](_0xd404('0x26')))),_0xd404('0x27')]]})[_0xd404('0x11')](function(_0x5e5dce){logger[_0xd404('0x1a')](_0xd404('0x1d'),_0x26693a);logger[_0xd404('0x14')](_0xd404('0x1d'),_0x26693a,JSON['stringify'](_0x5e5dce));_0x44e261(_0x5e5dce);})[_0xd404('0x1c')](function(_0x3d0f39){logger[_0xd404('0x17')]('GetVoiceQueueRtPauses',_0x3d0f39[_0xd404('0x19')],_0x26693a);_0x176f63(_0x126088[_0xd404('0x17')](0x1f4,_0x3d0f39[_0xd404('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b932d77..c83d55b 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 _0xbea5=['emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbea5,0x177));var _0x5bea=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xbea5[_0x3522c8];return _0x22f498;};'use strict';var UserVoiceQueueRtEvents=require(_0x5bea('0x0'));var events=[_0x5bea('0x1'),'remove',_0x5bea('0x2')];function createListener(_0x45cd6f,_0x24c5f6){return function(_0x2837be){_0x24c5f6[_0x5bea('0x3')](_0x45cd6f,_0x2837be);};}function removeListener(_0x528183,_0x5cd985){return function(){UserVoiceQueueRtEvents[_0x5bea('0x4')](_0x528183,_0x5cd985);};}exports['register']=function(_0x156737){for(var _0x51ac31=0x0,_0x487888=events[_0x5bea('0x5')];_0x51ac31<_0x487888;_0x51ac31++){var _0x581c55=events[_0x51ac31];var _0x4b204d=createListener(_0x5bea('0x6')+_0x581c55,_0x156737);UserVoiceQueueRtEvents['on'](_0x581c55,_0x4b204d);}}; \ No newline at end of file +var _0x55c1=['./userVoiceQueueRt.events','save','emit','register','length'];(function(_0x5cf936,_0x125307){var _0x1d4e46=function(_0x41e33f){while(--_0x41e33f){_0x5cf936['push'](_0x5cf936['shift']());}};_0x1d4e46(++_0x125307);}(_0x55c1,0x1e5));var _0x155c=function(_0x2adae0,_0x4fa150){_0x2adae0=_0x2adae0-0x0;var _0x4bbb68=_0x55c1[_0x2adae0];return _0x4bbb68;};'use strict';var UserVoiceQueueRtEvents=require(_0x155c('0x0'));var events=[_0x155c('0x1'),'remove','update'];function createListener(_0x530d64,_0x81b6fa){return function(_0x7efdc0){_0x81b6fa[_0x155c('0x2')](_0x530d64,_0x7efdc0);};}function removeListener(_0x64c8aa,_0xb127e8){return function(){UserVoiceQueueRtEvents['removeListener'](_0x64c8aa,_0xb127e8);};}exports[_0x155c('0x3')]=function(_0x55a3ae){for(var _0x1b30c6=0x0,_0x4df902=events[_0x155c('0x4')];_0x1b30c6<_0x4df902;_0x1b30c6++){var _0x25b08a=events[_0x1b30c6];var _0x22ed0d=createListener('userVoiceQueueRt:'+_0x25b08a,_0x55a3ae);UserVoiceQueueRtEvents['on'](_0x25b08a,_0x22ed0d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3cca321..ba84edd 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1d95d3,_0xadc054){var _0x379fc1=function(_0x2fe900){while(--_0x2fe900){_0x1d95d3['push'](_0x1d95d3['shift']());}};_0x379fc1(++_0xadc054);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xcb91[_0x111e94];return _0x3de107;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x326558,_0x4a22a1){var _0x5cd3a0=function(_0x412b66){while(--_0x412b66){_0x326558['push'](_0x326558['shift']());}};_0x5cd3a0(++_0x4a22a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index b4349ae..6cf7bff 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 _0xd709=['exports','INTEGER','sequelize'];(function(_0x541f64,_0x222e09){var _0x2458f9=function(_0xdf2893){while(--_0xdf2893){_0x541f64['push'](_0x541f64['shift']());}};_0x2458f9(++_0x222e09);}(_0xd709,0x7d));var _0x9d70=function(_0x22f86f,_0xad1d43){_0x22f86f=_0x22f86f-0x0;var _0x486673=_0xd709[_0x22f86f];return _0x486673;};'use strict';var Sequelize=require(_0x9d70('0x0'));module[_0x9d70('0x1')]={'penalty':{'type':Sequelize[_0x9d70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfac1=['exports'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xfac1,0x16f));var _0x1fac=function(_0x25f0ea,_0xd6d029){_0x25f0ea=_0x25f0ea-0x0;var _0x275268=_0xfac1[_0x25f0ea];return _0x275268;};'use strict';var Sequelize=require('sequelize');module[_0x1fac('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index e3c5424..11c1643 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 _0xcc95=['api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','lodash','util'];(function(_0x43b10d,_0x2f0aba){var _0xdc3f91=function(_0x2ea0f4){while(--_0x2ea0f4){_0x43b10d['push'](_0x43b10d['shift']());}};_0xdc3f91(++_0x2f0aba);}(_0xcc95,0x8a));var _0x5cc9=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xcc95[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x5cc9('0x0'));var util=require(_0x5cc9('0x1'));var logger=require('../../config/logger')(_0x5cc9('0x2'));var moment=require(_0x5cc9('0x3'));var BPromise=require(_0x5cc9('0x4'));var rp=require(_0x5cc9('0x5'));var fs=require('fs');var path=require(_0x5cc9('0x6'));var rimraf=require('rimraf');var config=require(_0x5cc9('0x7'));var attributes=require(_0x5cc9('0x8'));module[_0x5cc9('0x9')]=function(_0x43550f,_0x2709ba){return _0x43550f['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8273=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util'];(function(_0x480a54,_0x3d92e5){var _0x2378f1=function(_0x5e3367){while(--_0x5e3367){_0x480a54['push'](_0x480a54['shift']());}};_0x2378f1(++_0x3d92e5);}(_0x8273,0x1df));var _0x3827=function(_0x59fcce,_0x57fb8b){_0x59fcce=_0x59fcce-0x0;var _0x65d044=_0x8273[_0x59fcce];return _0x65d044;};'use strict';var _=require(_0x3827('0x0'));var util=require(_0x3827('0x1'));var logger=require('../../config/logger')(_0x3827('0x2'));var moment=require(_0x3827('0x3'));var BPromise=require(_0x3827('0x4'));var rp=require(_0x3827('0x5'));var fs=require('fs');var path=require(_0x3827('0x6'));var rimraf=require(_0x3827('0x7'));var config=require(_0x3827('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0x3827('0x9')]=function(_0x3258db,_0x2b01f5){return _0x3258db[_0x3827('0xa')](_0x3827('0xb'),attributes,{'tableName':_0x3827('0xc'),'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 5937831..7ecfb74 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 _0x320c=['request','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x46e1ef,_0x1ebbc2){var _0x34c79d=function(_0x1df960){while(--_0x1df960){_0x46e1ef['push'](_0x46e1ef['shift']());}};_0x34c79d(++_0x1ebbc2);}(_0x320c,0x1a4));var _0xc320=function(_0x5b1c7c,_0x241733){_0x5b1c7c=_0x5b1c7c-0x0;var _0x344bdd=_0x320c[_0x5b1c7c];return _0x344bdd;};'use strict';var _=require('lodash');var util=require(_0xc320('0x0'));var moment=require(_0xc320('0x1'));var BPromise=require(_0xc320('0x2'));var rs=require(_0xc320('0x3'));var fs=require('fs');var Redis=require(_0xc320('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc320('0x5'));var logger=require(_0xc320('0x6'))(_0xc320('0x7'));var config=require(_0xc320('0x8'));var jayson=require(_0xc320('0x9'));var client=jayson[_0xc320('0xa')][_0xc320('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d760c,_0x1a646d,_0x56becf){return new BPromise(function(_0x333587,_0x406475){return client[_0xc320('0xc')](_0x1d760c,_0x56becf)[_0xc320('0xd')](function(_0x30dc72){logger[_0xc320('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1a646d,'request\x20sent');logger[_0xc320('0xf')](_0xc320('0x10'),_0x1a646d,'request\x20sent',JSON[_0xc320('0x11')](_0x30dc72));if(_0x30dc72[_0xc320('0x12')]){if(_0x30dc72[_0xc320('0x12')]['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x1a646d,_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);return _0x406475(_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);}logger['error'](_0xc320('0x14'),_0x1a646d,_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);return _0x333587(_0x30dc72[_0xc320('0x12')][_0xc320('0x13')]);}else{logger[_0xc320('0xe')](_0xc320('0x14'),_0x1a646d,_0xc320('0x15'));_0x333587(_0x30dc72[_0xc320('0x16')][_0xc320('0x13')]);}})[_0xc320('0x17')](function(_0x28b7e8){logger['error'](_0xc320('0x14'),_0x1a646d,_0x28b7e8);_0x406475(_0x28b7e8);});});} \ No newline at end of file +var _0xed9f=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xed9f,0x1bf));var _0xfed9=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xed9f[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xfed9('0x0'));var util=require(_0xfed9('0x1'));var moment=require(_0xfed9('0x2'));var BPromise=require(_0xfed9('0x3'));var rs=require(_0xfed9('0x4'));var fs=require('fs');var Redis=require(_0xfed9('0x5'));var db=require(_0xfed9('0x6'))['db'];var utils=require(_0xfed9('0x7'));var logger=require(_0xfed9('0x8'))('rpc');var config=require(_0xfed9('0x9'));var jayson=require(_0xfed9('0xa'));var client=jayson[_0xfed9('0xb')][_0xfed9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c870c,_0x42bce7,_0x4beac3){return new BPromise(function(_0x58b651,_0x2d3b74){return client[_0xfed9('0xd')](_0x2c870c,_0x4beac3)['then'](function(_0x669448){logger[_0xfed9('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x42bce7,_0xfed9('0xf'));logger[_0xfed9('0x10')](_0xfed9('0x11'),_0x42bce7,_0xfed9('0xf'),JSON[_0xfed9('0x12')](_0x669448));if(_0x669448['error']){if(_0x669448[_0xfed9('0x13')][_0xfed9('0x14')]===0x1f4){logger[_0xfed9('0x13')](_0xfed9('0x15'),_0x42bce7,_0x669448['error'][_0xfed9('0x16')]);return _0x2d3b74(_0x669448[_0xfed9('0x13')]['message']);}logger[_0xfed9('0x13')](_0xfed9('0x15'),_0x42bce7,_0x669448['error'][_0xfed9('0x16')]);return _0x58b651(_0x669448[_0xfed9('0x13')]['message']);}else{logger[_0xfed9('0xe')](_0xfed9('0x15'),_0x42bce7,_0xfed9('0xf'));_0x58b651(_0x669448[_0xfed9('0x17')][_0xfed9('0x16')]);}})['catch'](function(_0x377211){logger[_0xfed9('0x13')](_0xfed9('0x15'),_0x42bce7,_0x377211);_0x2d3b74(_0x377211);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index b507917..87d1337 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 _0xb2ef=['Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x27c6bd,_0x540372){_0x27c6bd=_0x27c6bd-0x0;var _0x3bd051=_0xb2ef[_0x27c6bd];return _0x3bd051;};'use strict';var multer=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var path=require(_0xfb2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb2e('0x3'));var router=express[_0xfb2e('0x4')]();var fs_extra=require(_0xfb2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var controller=require(_0xfb2e('0x8'));router[_0xfb2e('0x9')]('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xb')]);router[_0xfb2e('0x9')](_0xfb2e('0xc'),auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xd')]);router['post']('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xe')]);router[_0xfb2e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfb2e('0x10')]);router[_0xfb2e('0x11')]('/:id',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9f94=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x305551,_0x868339){var _0x115ce2=function(_0x49265b){while(--_0x49265b){_0x305551['push'](_0x305551['shift']());}};_0x115ce2(++_0x868339);}(_0x9f94,0x1e7));var _0x49f9=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9f94[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var path=require(_0x49f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49f9('0x3')]();var fs_extra=require(_0x49f9('0x4'));var auth=require(_0x49f9('0x5'));var interaction=require(_0x49f9('0x6'));var config=require(_0x49f9('0x7'));var controller=require('./variable.controller');router[_0x49f9('0x8')]('/',auth[_0x49f9('0x9')](),controller[_0x49f9('0xa')]);router[_0x49f9('0x8')](_0x49f9('0xb'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xc')]);router[_0x49f9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49f9('0xe')]('/:id',auth[_0x49f9('0x9')](),controller[_0x49f9('0xf')]);router[_0x49f9('0x10')]('/:id',auth[_0x49f9('0x9')](),controller['destroy']);module[_0x49f9('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 32f443c..30f24e4 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 _0xd756=['name','sequelize','STRING'];(function(_0x119f21,_0x57717a){var _0xf35465=function(_0x11ed2f){while(--_0x11ed2f){_0x119f21['push'](_0x119f21['shift']());}};_0xf35465(++_0x57717a);}(_0xd756,0xa3));var _0x6d75=function(_0x327665,_0x5dec8d){_0x327665=_0x327665-0x0;var _0x4d5109=_0xd756[_0x327665];return _0x4d5109;};'use strict';var Sequelize=require(_0x6d75('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d75('0x1')],'unique':_0x6d75('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6d75('0x1')]}}; \ No newline at end of file +var _0xe5e7=['name','STRING'];(function(_0x17967e,_0x5d5b7c){var _0x45ab82=function(_0x5c53e9){while(--_0x5c53e9){_0x17967e['push'](_0x17967e['shift']());}};_0x45ab82(++_0x5d5b7c);}(_0xe5e7,0x10d));var _0x7e5e=function(_0x1b878e,_0x4bc26e){_0x1b878e=_0x1b878e-0x0;var _0x37389d=_0xe5e7[_0x1b878e];return _0x37389d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7e5e('0x0')],'unique':_0x7e5e('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7e5e('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index ca203d4..eceacb9 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 _0xeb36=['where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','Variable','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort'];(function(_0x3c5687,_0x123151){var _0x20051c=function(_0x3f269d){while(--_0x3f269d){_0x3c5687['push'](_0x3c5687['shift']());}};_0x20051c(++_0x123151);}(_0xeb36,0xb8));var _0x6eb3=function(_0x499396,_0x33a919){_0x499396=_0x499396-0x0;var _0x542891=_0xeb36[_0x499396];return _0x542891;};'use strict';var emlformat=require(_0x6eb3('0x0'));var rimraf=require(_0x6eb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6eb3('0x2'));var rp=require('request-promise');var moment=require(_0x6eb3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6eb3('0x4'));var sox=require(_0x6eb3('0x5'));var csv=require(_0x6eb3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6eb3('0x7'));var jsforce=require(_0x6eb3('0x8'));var deskjs=require(_0x6eb3('0x9'));var toCsv=require('to-csv');var querystring=require(_0x6eb3('0xa'));var Papa=require('papaparse');var Redis=require(_0x6eb3('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6eb3('0xc'));var as=require(_0x6eb3('0xd'));var hardwareService=require(_0x6eb3('0xe'));var logger=require(_0x6eb3('0xf'))('api');var utils=require(_0x6eb3('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x6eb3('0x11'));var db=require(_0x6eb3('0x12'))['db'];function respondWithStatusCode(_0x4b1dd9,_0x56d46e){_0x56d46e=_0x56d46e||0xcc;return function(_0x711b69){if(_0x711b69){return _0x4b1dd9[_0x6eb3('0x13')](_0x56d46e);}return _0x4b1dd9['status'](_0x56d46e)[_0x6eb3('0x14')]();};}function respondWithResult(_0x5ac936,_0x180a46){_0x180a46=_0x180a46||0xc8;return function(_0x3c6abb){if(_0x3c6abb){return _0x5ac936[_0x6eb3('0x15')](_0x180a46)[_0x6eb3('0x16')](_0x3c6abb);}};}function respondWithFilteredResult(_0x2cb362,_0x1b27fa){return function(_0x2ced98){if(_0x2ced98){var _0x3057de=typeof _0x1b27fa['offset']==='undefined'&&typeof _0x1b27fa[_0x6eb3('0x17')]===_0x6eb3('0x18');var _0x3f3b10=_0x2ced98['count'];var _0x16f6d7=_0x3057de?0x0:_0x1b27fa[_0x6eb3('0x19')];var _0x5b326f=_0x3057de?_0x2ced98[_0x6eb3('0x1a')]:_0x1b27fa[_0x6eb3('0x19')]+_0x1b27fa[_0x6eb3('0x17')];var _0x364654;if(_0x5b326f>=_0x3f3b10){_0x5b326f=_0x3f3b10;_0x364654=0xc8;}else{_0x364654=0xce;}_0x2cb362[_0x6eb3('0x15')](_0x364654);return _0x2cb362[_0x6eb3('0x1b')](_0x6eb3('0x1c'),_0x16f6d7+'-'+_0x5b326f+'/'+_0x3f3b10)[_0x6eb3('0x16')](_0x2ced98);}return null;};}function patchUpdates(_0x58687c){return function(_0x393d5a){try{jsonpatch[_0x6eb3('0x1d')](_0x393d5a,_0x58687c,!![]);}catch(_0x39bb61){return BPromise[_0x6eb3('0x1e')](_0x39bb61);}return _0x393d5a[_0x6eb3('0x1f')]();};}function saveUpdates(_0x3b2a53,_0xc4fae9){return function(_0x47698e){if(_0x47698e){return _0x47698e[_0x6eb3('0x20')](_0x3b2a53)[_0x6eb3('0x21')](function(_0x17d54e){return _0x17d54e;});}return null;};}function removeEntity(_0x238ed0,_0x2d6812){return function(_0x1b3b31){if(_0x1b3b31){return _0x1b3b31[_0x6eb3('0x22')]()['then'](function(){var _0x157e2d=_0x1b3b31[_0x6eb3('0x23')]({'plain':!![]});var _0x497884=_0x6eb3('0x24');return db[_0x6eb3('0x25')][_0x6eb3('0x22')]({'where':{'type':_0x497884,'resourceId':_0x157e2d['id']}})[_0x6eb3('0x21')](function(){return _0x1b3b31;});})[_0x6eb3('0x21')](function(){_0x238ed0[_0x6eb3('0x15')](0xcc)[_0x6eb3('0x14')]();});}};}function handleEntityNotFound(_0x56e2ed,_0x4294fb){return function(_0x5c9084){if(!_0x5c9084){_0x56e2ed[_0x6eb3('0x13')](0x194);}return _0x5c9084;};}function handleError(_0x43b9f3,_0x2ababf){_0x2ababf=_0x2ababf||0x1f4;return function(_0x47c450){logger[_0x6eb3('0x26')](_0x47c450[_0x6eb3('0x27')]);if(_0x47c450[_0x6eb3('0x28')]){delete _0x47c450['name'];}_0x43b9f3[_0x6eb3('0x15')](_0x2ababf)[_0x6eb3('0x29')](_0x47c450);};}exports[_0x6eb3('0x2a')]=function(_0xbb7ba,_0x13780c){var _0x55ddf1={},_0x3553c3={},_0x159eb4={'count':0x0,'rows':[]};var _0x36151c=_[_0x6eb3('0x2b')](db['Variable'][_0x6eb3('0x2c')],function(_0x26ef6b){return{'name':_0x26ef6b[_0x6eb3('0x2d')],'type':_0x26ef6b['type'][_0x6eb3('0x2e')]};});_0x3553c3[_0x6eb3('0x2f')]=_[_0x6eb3('0x2b')](_0x36151c,'name');_0x3553c3[_0x6eb3('0x30')]=_[_0x6eb3('0x31')](_0xbb7ba[_0x6eb3('0x30')]);_0x3553c3['filters']=_['intersection'](_0x3553c3[_0x6eb3('0x2f')],_0x3553c3['query']);_0x55ddf1['attributes']=_[_0x6eb3('0x32')](_0x3553c3[_0x6eb3('0x2f')],qs['fields'](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x33')]));_0x55ddf1[_0x6eb3('0x34')]=_0x55ddf1[_0x6eb3('0x34')][_0x6eb3('0x35')]?_0x55ddf1[_0x6eb3('0x34')]:_0x3553c3[_0x6eb3('0x2f')];if(!_0xbb7ba[_0x6eb3('0x30')]['hasOwnProperty'](_0x6eb3('0x36'))){_0x55ddf1['limit']=qs[_0x6eb3('0x17')](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x17')]);_0x55ddf1['offset']=qs[_0x6eb3('0x19')](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x19')]);}_0x55ddf1['order']=qs[_0x6eb3('0x37')](_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x37')]);_0x55ddf1[_0x6eb3('0x38')]=qs[_0x6eb3('0x39')](_['pick'](_0xbb7ba[_0x6eb3('0x30')],_0x3553c3[_0x6eb3('0x39')]),_0x36151c);if(_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x3a')]){_0x55ddf1[_0x6eb3('0x38')]=_[_0x6eb3('0x3b')](_0x55ddf1[_0x6eb3('0x38')],{'$or':_[_0x6eb3('0x2b')](_0x36151c,function(_0x4e0888){if(_0x4e0888[_0x6eb3('0x3c')]!==_0x6eb3('0x3d')){var _0x12d158={};_0x12d158[_0x4e0888[_0x6eb3('0x28')]]={'$like':'%'+_0xbb7ba['query'][_0x6eb3('0x3a')]+'%'};return _0x12d158;}})});}_0x55ddf1=_['merge']({},_0x55ddf1,_0xbb7ba[_0x6eb3('0x3e')]);var _0x4edb56={'where':_0x55ddf1[_0x6eb3('0x38')]};return db['Variable']['count'](_0x4edb56)['then'](function(_0x1745df){_0x159eb4[_0x6eb3('0x1a')]=_0x1745df;if(_0xbb7ba[_0x6eb3('0x30')][_0x6eb3('0x3f')]){_0x55ddf1[_0x6eb3('0x40')]=[{'all':!![]}];}return db[_0x6eb3('0x41')][_0x6eb3('0x42')](_0x55ddf1);})[_0x6eb3('0x21')](function(_0x1e909d){_0x159eb4[_0x6eb3('0x43')]=_0x1e909d;return _0x159eb4;})[_0x6eb3('0x21')](respondWithFilteredResult(_0x13780c,_0x55ddf1))[_0x6eb3('0x44')](handleError(_0x13780c,null));};exports['show']=function(_0x1698df,_0x494231){var _0x48417f={'raw':!![],'where':{'id':_0x1698df[_0x6eb3('0x45')]['id']}},_0x1b62c9={};_0x1b62c9[_0x6eb3('0x2f')]=_[_0x6eb3('0x31')](db[_0x6eb3('0x41')][_0x6eb3('0x2c')]);_0x1b62c9['query']=_[_0x6eb3('0x31')](_0x1698df[_0x6eb3('0x30')]);_0x1b62c9[_0x6eb3('0x39')]=_[_0x6eb3('0x32')](_0x1b62c9[_0x6eb3('0x2f')],_0x1b62c9[_0x6eb3('0x30')]);_0x48417f['attributes']=_[_0x6eb3('0x32')](_0x1b62c9[_0x6eb3('0x2f')],qs[_0x6eb3('0x33')](_0x1698df['query']['fields']));_0x48417f[_0x6eb3('0x34')]=_0x48417f[_0x6eb3('0x34')][_0x6eb3('0x35')]?_0x48417f[_0x6eb3('0x34')]:_0x1b62c9[_0x6eb3('0x2f')];if(_0x1698df['query'][_0x6eb3('0x3f')]){_0x48417f[_0x6eb3('0x40')]=[{'all':!![]}];}_0x48417f=_[_0x6eb3('0x3b')]({},_0x48417f,_0x1698df['options']);return db[_0x6eb3('0x41')][_0x6eb3('0x46')](_0x48417f)[_0x6eb3('0x21')](handleEntityNotFound(_0x494231,null))[_0x6eb3('0x21')](respondWithResult(_0x494231,null))[_0x6eb3('0x44')](handleError(_0x494231,null));};exports[_0x6eb3('0x47')]=function(_0x1b3c25,_0x3ff778){return db['Variable'][_0x6eb3('0x47')](_0x1b3c25[_0x6eb3('0x48')],{})['then'](function(_0x3d5be0){var _0x31f271=_0x1b3c25[_0x6eb3('0x49')][_0x6eb3('0x23')]({'plain':!![]});if(!_0x31f271)throw new Error(_0x6eb3('0x4a'));if(_0x31f271[_0x6eb3('0x4b')]===_0x6eb3('0x49')){var _0x1dc982=_0x3d5be0[_0x6eb3('0x23')]({'plain':!![]});var _0x326c59=_0x6eb3('0x24');return db[_0x6eb3('0x4c')]['find']({'where':{'name':_0x326c59,'userProfileId':_0x31f271[_0x6eb3('0x4d')]},'raw':!![]})[_0x6eb3('0x21')](function(_0x28a72d){if(_0x28a72d&&_0x28a72d[_0x6eb3('0x4e')]===0x0){return db[_0x6eb3('0x25')]['create']({'name':_0x1dc982[_0x6eb3('0x28')],'resourceId':_0x1dc982['id'],'type':_0x28a72d['name'],'sectionId':_0x28a72d['id']},{})[_0x6eb3('0x21')](function(){return _0x3d5be0;});}else{return _0x3d5be0;}})[_0x6eb3('0x44')](function(_0x5c798f){logger[_0x6eb3('0x26')](_0x6eb3('0x4f'),_0x5c798f);throw _0x5c798f;});}return _0x3d5be0;})[_0x6eb3('0x21')](respondWithResult(_0x3ff778,0xc9))[_0x6eb3('0x44')](handleError(_0x3ff778,null));};exports[_0x6eb3('0x20')]=function(_0x3fa3c7,_0xd8672a){if(_0x3fa3c7[_0x6eb3('0x48')]['id']){delete _0x3fa3c7[_0x6eb3('0x48')]['id'];}return db[_0x6eb3('0x41')][_0x6eb3('0x46')]({'where':{'id':_0x3fa3c7['params']['id']}})['then'](handleEntityNotFound(_0xd8672a,null))[_0x6eb3('0x21')](saveUpdates(_0x3fa3c7[_0x6eb3('0x48')],null))[_0x6eb3('0x21')](respondWithResult(_0xd8672a,null))[_0x6eb3('0x44')](handleError(_0xd8672a,null));};exports[_0x6eb3('0x22')]=function(_0x4c16c5,_0x2251d0){return db['Variable']['find']({'where':{'id':_0x4c16c5[_0x6eb3('0x45')]['id']}})[_0x6eb3('0x21')](handleEntityNotFound(_0x2251d0,null))[_0x6eb3('0x21')](removeEntity(_0x2251d0,null))[_0x6eb3('0x44')](handleError(_0x2251d0,null));}; \ No newline at end of file +var _0x725e=['moment','bluebird','mustache','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','Variables','error','name','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','includeAll','include','rows','catch','show','keys','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir'];(function(_0x1cfd20,_0x537412){var _0x3a41d8=function(_0x31f4c1){while(--_0x31f4c1){_0x1cfd20['push'](_0x1cfd20['shift']());}};_0x3a41d8(++_0x537412);}(_0x725e,0xe7));var _0xe725=function(_0x361ee7,_0x1ebe00){_0x361ee7=_0x361ee7-0x0;var _0x24971b=_0x725e[_0x361ee7];return _0x24971b;};'use strict';var emlformat=require(_0xe725('0x0'));var rimraf=require(_0xe725('0x1'));var zipdir=require(_0xe725('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe725('0x3'));var BPromise=require(_0xe725('0x4'));var Mustache=require(_0xe725('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe725('0x6'));var fs=require('fs');var fs_extra=require(_0xe725('0x7'));var _=require(_0xe725('0x8'));var squel=require(_0xe725('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe725('0xa'));var toCsv=require(_0xe725('0xb'));var querystring=require(_0xe725('0xc'));var Papa=require('papaparse');var Redis=require(_0xe725('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe725('0xe'));var as=require(_0xe725('0xf'));var hardwareService=require(_0xe725('0x10'));var logger=require(_0xe725('0x11'))(_0xe725('0x12'));var utils=require(_0xe725('0x13'));var config=require(_0xe725('0x14'));var licenseUtil=require(_0xe725('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275225,_0x4f7975){_0x4f7975=_0x4f7975||0xcc;return function(_0x563a77){if(_0x563a77){return _0x275225[_0xe725('0x16')](_0x4f7975);}return _0x275225['status'](_0x4f7975)[_0xe725('0x17')]();};}function respondWithResult(_0x435cca,_0x3e5ed8){_0x3e5ed8=_0x3e5ed8||0xc8;return function(_0x2e9c2a){if(_0x2e9c2a){return _0x435cca[_0xe725('0x18')](_0x3e5ed8)['json'](_0x2e9c2a);}};}function respondWithFilteredResult(_0x235a65,_0x4341a8){return function(_0x2c7322){if(_0x2c7322){var _0x246263=typeof _0x4341a8[_0xe725('0x19')]===_0xe725('0x1a')&&typeof _0x4341a8['limit']===_0xe725('0x1a');var _0x195288=_0x2c7322[_0xe725('0x1b')];var _0x2fae22=_0x246263?0x0:_0x4341a8[_0xe725('0x19')];var _0x28795c=_0x246263?_0x2c7322[_0xe725('0x1b')]:_0x4341a8[_0xe725('0x19')]+_0x4341a8['limit'];var _0xe24f64;if(_0x28795c>=_0x195288){_0x28795c=_0x195288;_0xe24f64=0xc8;}else{_0xe24f64=0xce;}_0x235a65[_0xe725('0x18')](_0xe24f64);return _0x235a65[_0xe725('0x1c')](_0xe725('0x1d'),_0x2fae22+'-'+_0x28795c+'/'+_0x195288)['json'](_0x2c7322);}return null;};}function patchUpdates(_0x2f6f48){return function(_0x451444){try{jsonpatch['apply'](_0x451444,_0x2f6f48,!![]);}catch(_0x201be5){return BPromise[_0xe725('0x1e')](_0x201be5);}return _0x451444[_0xe725('0x1f')]();};}function saveUpdates(_0x5ee1db,_0x566465){return function(_0x2c9da7){if(_0x2c9da7){return _0x2c9da7[_0xe725('0x20')](_0x5ee1db)[_0xe725('0x21')](function(_0x5e5ec3){return _0x5e5ec3;});}return null;};}function removeEntity(_0x545109,_0x5b20c6){return function(_0x4aee9a){if(_0x4aee9a){return _0x4aee9a[_0xe725('0x22')]()[_0xe725('0x21')](function(){var _0x8a4e5c=_0x4aee9a[_0xe725('0x23')]({'plain':!![]});var _0x4ac91f=_0xe725('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x4ac91f,'resourceId':_0x8a4e5c['id']}})[_0xe725('0x21')](function(){return _0x4aee9a;});})[_0xe725('0x21')](function(){_0x545109[_0xe725('0x18')](0xcc)[_0xe725('0x17')]();});}};}function handleEntityNotFound(_0x1b94d9,_0x567fda){return function(_0xbbba3){if(!_0xbbba3){_0x1b94d9[_0xe725('0x16')](0x194);}return _0xbbba3;};}function handleError(_0x5e768a,_0x4f52be){_0x4f52be=_0x4f52be||0x1f4;return function(_0x480a60){logger[_0xe725('0x25')](_0x480a60['stack']);if(_0x480a60[_0xe725('0x26')]){delete _0x480a60[_0xe725('0x26')];}_0x5e768a[_0xe725('0x18')](_0x4f52be)['send'](_0x480a60);};}exports['index']=function(_0x57d7cc,_0xe01466){var _0x51c340={},_0x58af02={},_0x4de942={'count':0x0,'rows':[]};var _0x2a229e=_[_0xe725('0x27')](db[_0xe725('0x28')][_0xe725('0x29')],function(_0x38cd56){return{'name':_0x38cd56[_0xe725('0x2a')],'type':_0x38cd56[_0xe725('0x2b')][_0xe725('0x2c')]};});_0x58af02[_0xe725('0x2d')]=_[_0xe725('0x27')](_0x2a229e,_0xe725('0x26'));_0x58af02[_0xe725('0x2e')]=_['keys'](_0x57d7cc[_0xe725('0x2e')]);_0x58af02[_0xe725('0x2f')]=_['intersection'](_0x58af02['model'],_0x58af02[_0xe725('0x2e')]);_0x51c340[_0xe725('0x30')]=_[_0xe725('0x31')](_0x58af02[_0xe725('0x2d')],qs[_0xe725('0x32')](_0x57d7cc[_0xe725('0x2e')]['fields']));_0x51c340[_0xe725('0x30')]=_0x51c340[_0xe725('0x30')]['length']?_0x51c340[_0xe725('0x30')]:_0x58af02[_0xe725('0x2d')];if(!_0x57d7cc['query'][_0xe725('0x33')](_0xe725('0x34'))){_0x51c340[_0xe725('0x35')]=qs[_0xe725('0x35')](_0x57d7cc[_0xe725('0x2e')]['limit']);_0x51c340[_0xe725('0x19')]=qs[_0xe725('0x19')](_0x57d7cc[_0xe725('0x2e')][_0xe725('0x19')]);}_0x51c340[_0xe725('0x36')]=qs['sort'](_0x57d7cc[_0xe725('0x2e')][_0xe725('0x37')]);_0x51c340[_0xe725('0x38')]=qs[_0xe725('0x2f')](_['pick'](_0x57d7cc['query'],_0x58af02['filters']),_0x2a229e);if(_0x57d7cc[_0xe725('0x2e')][_0xe725('0x39')]){_0x51c340[_0xe725('0x38')]=_[_0xe725('0x3a')](_0x51c340['where'],{'$or':_[_0xe725('0x27')](_0x2a229e,function(_0x29453b){if(_0x29453b[_0xe725('0x2b')]!=='VIRTUAL'){var _0x5a250e={};_0x5a250e[_0x29453b[_0xe725('0x26')]]={'$like':'%'+_0x57d7cc[_0xe725('0x2e')][_0xe725('0x39')]+'%'};return _0x5a250e;}})});}_0x51c340=_['merge']({},_0x51c340,_0x57d7cc['options']);var _0xc9c675={'where':_0x51c340[_0xe725('0x38')]};return db[_0xe725('0x28')][_0xe725('0x1b')](_0xc9c675)['then'](function(_0x43d8a7){_0x4de942['count']=_0x43d8a7;if(_0x57d7cc[_0xe725('0x2e')][_0xe725('0x3b')]){_0x51c340[_0xe725('0x3c')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x51c340);})[_0xe725('0x21')](function(_0x4de035){_0x4de942[_0xe725('0x3d')]=_0x4de035;return _0x4de942;})[_0xe725('0x21')](respondWithFilteredResult(_0xe01466,_0x51c340))[_0xe725('0x3e')](handleError(_0xe01466,null));};exports[_0xe725('0x3f')]=function(_0x45f514,_0x13db9c){var _0x93717e={'raw':!![],'where':{'id':_0x45f514['params']['id']}},_0x6f4926={};_0x6f4926['model']=_[_0xe725('0x40')](db[_0xe725('0x28')][_0xe725('0x29')]);_0x6f4926[_0xe725('0x2e')]=_[_0xe725('0x40')](_0x45f514[_0xe725('0x2e')]);_0x6f4926[_0xe725('0x2f')]=_['intersection'](_0x6f4926['model'],_0x6f4926['query']);_0x93717e['attributes']=_['intersection'](_0x6f4926[_0xe725('0x2d')],qs['fields'](_0x45f514['query'][_0xe725('0x32')]));_0x93717e[_0xe725('0x30')]=_0x93717e[_0xe725('0x30')][_0xe725('0x41')]?_0x93717e[_0xe725('0x30')]:_0x6f4926[_0xe725('0x2d')];if(_0x45f514[_0xe725('0x2e')][_0xe725('0x3b')]){_0x93717e['include']=[{'all':!![]}];}_0x93717e=_[_0xe725('0x3a')]({},_0x93717e,_0x45f514[_0xe725('0x42')]);return db[_0xe725('0x28')][_0xe725('0x43')](_0x93717e)[_0xe725('0x21')](handleEntityNotFound(_0x13db9c,null))[_0xe725('0x21')](respondWithResult(_0x13db9c,null))['catch'](handleError(_0x13db9c,null));};exports[_0xe725('0x44')]=function(_0x4e9c53,_0x14a924){return db[_0xe725('0x28')]['create'](_0x4e9c53[_0xe725('0x45')],{})[_0xe725('0x21')](function(_0x10a11a){var _0x8243f7=_0x4e9c53[_0xe725('0x46')][_0xe725('0x23')]({'plain':!![]});if(!_0x8243f7)throw new Error(_0xe725('0x47'));if(_0x8243f7['role']===_0xe725('0x46')){var _0x1bcb4e=_0x10a11a['get']({'plain':!![]});var _0x15bb63='Variables';return db[_0xe725('0x48')][_0xe725('0x43')]({'where':{'name':_0x15bb63,'userProfileId':_0x8243f7[_0xe725('0x49')]},'raw':!![]})['then'](function(_0x11da83){if(_0x11da83&&_0x11da83[_0xe725('0x4a')]===0x0){return db[_0xe725('0x4b')][_0xe725('0x44')]({'name':_0x1bcb4e[_0xe725('0x26')],'resourceId':_0x1bcb4e['id'],'type':_0x11da83[_0xe725('0x26')],'sectionId':_0x11da83['id']},{})[_0xe725('0x21')](function(){return _0x10a11a;});}else{return _0x10a11a;}})[_0xe725('0x3e')](function(_0x1cd24b){logger[_0xe725('0x25')](_0xe725('0x4c'),_0x1cd24b);throw _0x1cd24b;});}return _0x10a11a;})[_0xe725('0x21')](respondWithResult(_0x14a924,0xc9))[_0xe725('0x3e')](handleError(_0x14a924,null));};exports[_0xe725('0x20')]=function(_0x585d19,_0x588708){if(_0x585d19[_0xe725('0x45')]['id']){delete _0x585d19['body']['id'];}return db[_0xe725('0x28')][_0xe725('0x43')]({'where':{'id':_0x585d19['params']['id']}})[_0xe725('0x21')](handleEntityNotFound(_0x588708,null))[_0xe725('0x21')](saveUpdates(_0x585d19['body'],null))[_0xe725('0x21')](respondWithResult(_0x588708,null))[_0xe725('0x3e')](handleError(_0x588708,null));};exports[_0xe725('0x22')]=function(_0xeb4bc3,_0x17f1d3){return db['Variable'][_0xe725('0x43')]({'where':{'id':_0xeb4bc3[_0xe725('0x4d')]['id']}})[_0xe725('0x21')](handleEntityNotFound(_0x17f1d3,null))[_0xe725('0x21')](removeEntity(_0x17f1d3,null))['catch'](handleError(_0x17f1d3,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5b0f719..ce0fb34 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 _0xaba7=['bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','moment'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0xaba7,0x1f4));var _0x7aba=function(_0x337d3a,_0x297363){_0x337d3a=_0x337d3a-0x0;var _0x3bc3be=_0xaba7[_0x337d3a];return _0x3bc3be;};'use strict';var _=require(_0x7aba('0x0'));var util=require(_0x7aba('0x1'));var logger=require(_0x7aba('0x2'))('api');var moment=require(_0x7aba('0x3'));var BPromise=require(_0x7aba('0x4'));var rp=require(_0x7aba('0x5'));var fs=require('fs');var path=require(_0x7aba('0x6'));var rimraf=require('rimraf');var config=require(_0x7aba('0x7'));var attributes=require(_0x7aba('0x8'));module[_0x7aba('0x9')]=function(_0x1c4114,_0xd3ee54){return _0x1c4114[_0x7aba('0xa')](_0x7aba('0xb'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34fb=['define','tools_variables','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x289c9d,_0x55993d){var _0x3b749c=function(_0x3fba0f){while(--_0x3fba0f){_0x289c9d['push'](_0x289c9d['shift']());}};_0x3b749c(++_0x55993d);}(_0x34fb,0xd4));var _0xb34f=function(_0x1f0024,_0x2d41b5){_0x1f0024=_0x1f0024-0x0;var _0x41da1d=_0x34fb[_0x1f0024];return _0x41da1d;};'use strict';var _=require('lodash');var util=require(_0xb34f('0x0'));var logger=require(_0xb34f('0x1'))(_0xb34f('0x2'));var moment=require(_0xb34f('0x3'));var BPromise=require(_0xb34f('0x4'));var rp=require(_0xb34f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb34f('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xb34f('0x7')]=function(_0x6d3bfe,_0x27811d){return _0x6d3bfe[_0xb34f('0x8')]('Variable',attributes,{'tableName':_0xb34f('0x9'),'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 a0d7136..0cab551 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 _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x219729,_0x19f07d){var _0x35c464=function(_0x3c412c){while(--_0x3c412c){_0x219729['push'](_0x219729['shift']());}};_0x35c464(++_0x19f07d);}(_0x3e74,0x175));var _0x43e7=function(_0x77eae7,_0x372be0){_0x77eae7=_0x77eae7-0x0;var _0x6b99ad=_0x3e74[_0x77eae7];return _0x6b99ad;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x485722,_0x3fb3e7){var _0x356a5d=function(_0x215584){while(--_0x215584){_0x485722['push'](_0x485722['shift']());}};_0x356a5d(++_0x3fb3e7);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3c57f13..1b7e962 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 _0xaa59=['isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','get','index'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xaa59,0x1e8));var _0x9aa5=function(_0x1aca1f,_0x505a9f){_0x1aca1f=_0x1aca1f-0x0;var _0xf390e3=_0xaa59[_0x1aca1f];return _0xf390e3;};'use strict';var express=require(_0x9aa5('0x0'));var router=express[_0x9aa5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9aa5('0x2'));router[_0x9aa5('0x3')]('/',controller[_0x9aa5('0x4')]);router[_0x9aa5('0x3')]('/fetch',auth[_0x9aa5('0x5')](),auth[_0x9aa5('0x6')](),controller[_0x9aa5('0x7')]);router['get'](_0x9aa5('0x8'),auth[_0x9aa5('0x5')](),auth['canUpdate'](),controller[_0x9aa5('0x9')]);router[_0x9aa5('0x3')](_0x9aa5('0xa'),auth['isAuthenticated'](),auth[_0x9aa5('0x6')](),controller[_0x9aa5('0xb')]);router[_0x9aa5('0x3')](_0x9aa5('0xc'),auth['isAuthenticated'](),controller[_0x9aa5('0xd')]);router[_0x9aa5('0x3')](_0x9aa5('0xe'),controller[_0x9aa5('0xf')]);module[_0x9aa5('0x10')]=router; \ No newline at end of file +var _0x871d=['/restart','/migrations','exports','express','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull'];(function(_0x1792ae,_0x3738a3){var _0x379871=function(_0x5d5195){while(--_0x5d5195){_0x1792ae['push'](_0x1792ae['shift']());}};_0x379871(++_0x3738a3);}(_0x871d,0x10d));var _0xd871=function(_0x2ca142,_0x198244){_0x2ca142=_0x2ca142-0x0;var _0x290778=_0x871d[_0x2ca142];return _0x290778;};'use strict';var express=require(_0xd871('0x0'));var router=express['Router']();var auth=require(_0xd871('0x1'));var controller=require('./version.controller');router[_0xd871('0x2')]('/',controller[_0xd871('0x3')]);router[_0xd871('0x2')](_0xd871('0x4'),auth[_0xd871('0x5')](),auth[_0xd871('0x6')](),controller['fetch']);router[_0xd871('0x2')](_0xd871('0x7'),auth[_0xd871('0x5')](),auth[_0xd871('0x6')](),controller[_0xd871('0x8')]);router[_0xd871('0x2')](_0xd871('0x9'),auth[_0xd871('0x5')](),auth['canUpdate'](),controller[_0xd871('0xa')]);router[_0xd871('0x2')](_0xd871('0xb'),auth[_0xd871('0x5')](),controller['restart']);router[_0xd871('0x2')](_0xd871('0xc'),controller['migrations']);module[_0xd871('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index f3f0f02..c057c7e 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 _0x5942=['simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','json','status','origin','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','replace','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update'];(function(_0x249de2,_0x5f3ba3){var _0x80eeba=function(_0x587b9c){while(--_0x587b9c){_0x249de2['push'](_0x249de2['shift']());}};_0x80eeba(++_0x5f3ba3);}(_0x5942,0x19c));var _0x2594=function(_0x2be63a,_0x44d8b5){_0x2be63a=_0x2be63a-0x0;var _0x2bd7c2=_0x5942[_0x2be63a];return _0x2bd7c2;};'use strict';var Umzug=require(_0x2594('0x0'));var path=require(_0x2594('0x1'));var fs=require('fs');var _=require(_0x2594('0x2'));var pkginfo=require(_0x2594('0x3'))(module,_0x2594('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x2594('0x5'))[_0x2594('0x6')];var db=require(_0x2594('0x7'))['db'];var config=require(_0x2594('0x8'));var pm2=require(_0x2594('0x9'));var logger=require(_0x2594('0xa'))(_0x2594('0xb'));var git=require(_0x2594('0xc'))(config[_0x2594('0xd')]);exports[_0x2594('0xe')]=function(_0x1dd0fc,_0x9e220c){var _0x362627={'current':module[_0x2594('0xf')][_0x2594('0x4')],'phonebar':0x2};if(_0x1dd0fc[_0x2594('0x10')]&&_0x1dd0fc[_0x2594('0x10')]['latest']){return git[_0x2594('0x11')]()[_0x2594('0x12')](function(_0x3a1797,_0x478250){_0x362627[_0x2594('0x13')]=(_0x3a1797?module[_0x2594('0xf')]['version']:_0x478250[_0x2594('0x13')])||_0x2594('0x14');return _0x9e220c['status'](0xc8)[_0x2594('0x15')](_0x362627);});}else{return _0x9e220c[_0x2594('0x16')](0xc8)[_0x2594('0x15')](_0x362627);}};exports[_0x2594('0x11')]=function(_0x2ce8b5,_0x47613c){return git[_0x2594('0x11')]([_0x2594('0x17'),'master'],function(_0x4aa52b){if(_0x4aa52b){logger[_0x2594('0x18')](_0x4aa52b);return _0x47613c['status'](0x1f4)['json'](_0x4aa52b);}logger['info'](_0x2594('0x19'));return _0x47613c['status'](0xc8)[_0x2594('0x15')]({'output':_0x2594('0x1a')});});};exports[_0x2594('0x1b')]=function(_0x40a5a0,_0x598012){return git[_0x2594('0x1b')]([_0x2594('0x1c'),'FETCH_HEAD'],function(_0x16e94f){if(_0x16e94f){logger[_0x2594('0x18')](_0x16e94f);return _0x598012['status'](0x1f4)[_0x2594('0x15')](_0x16e94f);}logger[_0x2594('0x1d')](_0x2594('0x1e'));return _0x598012['status'](0xc8)[_0x2594('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x40b24b,_0x4ac5d0){exec('npm\x20install\x20--production',function(_0x5f2f49,_0x36a81c,_0x545751){logger['info'](_0x36a81c);logger[_0x2594('0x1d')](_0x545751);if(_0x5f2f49){logger['error'](_0x5f2f49);return _0x4ac5d0['status'](0x1f4)[_0x2594('0x15')](_0x5f2f49);}return _0x4ac5d0[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':_0x36a81c});});};exports[_0x2594('0x1f')]=function(_0x34ef39,_0xbaec56){return pm2[_0x2594('0x1f')](_0x2594('0x20'))[_0x2594('0x21')](function(_0x3b8414){logger[_0x2594('0x1d')]('pm2\x20restart\x20motion\x20%s',_0x3b8414);return _0xbaec56[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':_0x2594('0x22')});})[_0x2594('0x23')](function(_0x2f4954){logger[_0x2594('0x18')](_0x2f4954);return _0xbaec56[_0x2594('0x16')](0x1f4)[_0x2594('0x15')](_0x2f4954);});};exports[_0x2594('0x24')]=function(_0x37594c,_0x306adb){var _0x1262b9=fs['readdirSync'](path[_0x2594('0x25')](config[_0x2594('0xd')],_0x2594('0x26'),'migrations'));var _0x22176c=[];for(var _0x5e2e80=0x0;_0x5e2e80<_0x1262b9['length'];_0x5e2e80++){var _0x21c2f4=_0x1262b9[_0x5e2e80][_0x2594('0x27')]('.js','');if(compareVersions(module['exports'][_0x2594('0x4')],_0x21c2f4)===-0x1){_0x22176c[_0x2594('0x28')](_0x21c2f4);}}if(_0x22176c[_0x2594('0x29')]){var _0x44852f=_0x22176c[_0x2594('0x2a')](compareVersions);var _0x5c6bfc=new Umzug({'storage':_0x2594('0x2b'),'storageOptions':{'model':db[_0x2594('0x2c')],'modelName':_0x2594('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x2594('0x2b')][_0x2594('0x2d')](),db[_0x2594('0x2b')][_0x2594('0x2e')],function(){throw new Error(_0x2594('0x2f'));}],'path':path['join'](config[_0x2594('0xd')],_0x2594('0x26'),_0x2594('0x24')),'pattern':/\.js$/}});_0x5c6bfc['up']({'migrations':_[_0x2594('0x30')](_0x44852f,function(_0x783079){return _0x783079+'.js';})})[_0x2594('0x21')](function(){return _0x306adb[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x2594('0xf')][_0x2594('0x4')]+_0x2594('0x31')+_[_0x2594('0x32')](_0x44852f),'migrations':_[_0x2594('0x25')](_0x44852f)});})[_0x2594('0x23')](function(_0x1b0b13){if(_0x1b0b13 instanceof db[_0x2594('0x2b')][_0x2594('0x33')]){return _0x306adb[_0x2594('0x16')](0xc8)[_0x2594('0x15')]({'output':_0x2594('0x34')});}else{return _0x306adb[_0x2594('0x16')](0x1f4)[_0x2594('0x15')](_0x1b0b13);}});}else{return _0x306adb['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x6e24=['master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','pull','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','server','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','latest','json','status','fetch','origin'];(function(_0x8b6b0c,_0x2e259f){var _0x45b7c3=function(_0x4bc39d){while(--_0x4bc39d){_0x8b6b0c['push'](_0x8b6b0c['shift']());}};_0x45b7c3(++_0x2e259f);}(_0x6e24,0xf0));var _0x46e2=function(_0x5a112b,_0x3e6cc6){_0x5a112b=_0x5a112b-0x0;var _0x19931c=_0x6e24[_0x5a112b];return _0x19931c;};'use strict';var Umzug=require(_0x46e2('0x0'));var path=require(_0x46e2('0x1'));var fs=require('fs');var _=require(_0x46e2('0x2'));var pkginfo=require(_0x46e2('0x3'))(module,_0x46e2('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x46e2('0x5'))[_0x46e2('0x6')];var db=require(_0x46e2('0x7'))['db'];var config=require(_0x46e2('0x8'));var pm2=require(_0x46e2('0x9'));var logger=require(_0x46e2('0xa'))(_0x46e2('0xb'));var git=require(_0x46e2('0xc'))(config[_0x46e2('0xd')]);exports['index']=function(_0x531d41,_0x431863){var _0x1417ed={'current':module[_0x46e2('0xe')][_0x46e2('0x4')],'phonebar':0x2};if(_0x531d41['query']&&_0x531d41['query'][_0x46e2('0xf')]){return git['fetch']()['tags'](function(_0x405c75,_0x515a7f){_0x1417ed[_0x46e2('0xf')]=(_0x405c75?module[_0x46e2('0xe')][_0x46e2('0x4')]:_0x515a7f['latest'])||'2.0.0';return _0x431863['status'](0xc8)[_0x46e2('0x10')](_0x1417ed);});}else{return _0x431863[_0x46e2('0x11')](0xc8)['json'](_0x1417ed);}};exports['fetch']=function(_0x491901,_0x5dc907){return git[_0x46e2('0x12')]([_0x46e2('0x13'),_0x46e2('0x14')],function(_0x57a4a9){if(_0x57a4a9){logger[_0x46e2('0x15')](_0x57a4a9);return _0x5dc907[_0x46e2('0x11')](0x1f4)['json'](_0x57a4a9);}logger['info'](_0x46e2('0x16'));return _0x5dc907['status'](0xc8)[_0x46e2('0x10')]({'output':_0x46e2('0x17')});});};exports[_0x46e2('0x18')]=function(_0x57664a,_0x1c6d86){return git[_0x46e2('0x18')](['--hard',_0x46e2('0x19')],function(_0x40bca5){if(_0x40bca5){logger[_0x46e2('0x15')](_0x40bca5);return _0x1c6d86[_0x46e2('0x11')](0x1f4)[_0x46e2('0x10')](_0x40bca5);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1c6d86[_0x46e2('0x11')](0xc8)[_0x46e2('0x10')]({'output':'git\x20reset\x20--hard'});});};exports[_0x46e2('0x1a')]=function(_0x11c1cd,_0x58dcdf){exec(_0x46e2('0x1b'),function(_0x2c6272,_0x2e6be1,_0x4d3fa1){logger[_0x46e2('0x1c')](_0x2e6be1);logger[_0x46e2('0x1c')](_0x4d3fa1);if(_0x2c6272){logger[_0x46e2('0x15')](_0x2c6272);return _0x58dcdf['status'](0x1f4)[_0x46e2('0x10')](_0x2c6272);}return _0x58dcdf[_0x46e2('0x11')](0xc8)[_0x46e2('0x10')]({'output':_0x2e6be1});});};exports[_0x46e2('0x1d')]=function(_0x511efb,_0x59de5d){return pm2[_0x46e2('0x1d')](_0x46e2('0x1e'))[_0x46e2('0x1f')](function(_0x270dc3){logger[_0x46e2('0x1c')](_0x46e2('0x20'),_0x270dc3);return _0x59de5d[_0x46e2('0x11')](0xc8)[_0x46e2('0x10')]({'output':_0x46e2('0x21')});})['catch'](function(_0x822ff1){logger[_0x46e2('0x15')](_0x822ff1);return _0x59de5d[_0x46e2('0x11')](0x1f4)[_0x46e2('0x10')](_0x822ff1);});};exports['migrations']=function(_0x12e5a8,_0x510aa1){var _0x361037=fs[_0x46e2('0x22')](path[_0x46e2('0x23')](config['root'],_0x46e2('0x24'),'migrations'));var _0x1b97bd=[];for(var _0x70f9a0=0x0;_0x70f9a0<_0x361037['length'];_0x70f9a0++){var _0x49ae30=_0x361037[_0x70f9a0][_0x46e2('0x25')](_0x46e2('0x26'),'');if(compareVersions(module[_0x46e2('0xe')]['version'],_0x49ae30)===-0x1){_0x1b97bd[_0x46e2('0x27')](_0x49ae30);}}if(_0x1b97bd['length']){var _0x345d36=_0x1b97bd[_0x46e2('0x28')](compareVersions);var _0x42cdf3=new Umzug({'storage':_0x46e2('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0x46e2('0x2a'),'columnName':_0x46e2('0x4')},'migrations':{'params':[db[_0x46e2('0x29')][_0x46e2('0x2b')](),db[_0x46e2('0x29')][_0x46e2('0x2c')],function(){throw new Error(_0x46e2('0x2d'));}],'path':path['join'](config[_0x46e2('0xd')],_0x46e2('0x24'),_0x46e2('0x2e')),'pattern':/\.js$/}});_0x42cdf3['up']({'migrations':_['map'](_0x345d36,function(_0x491434){return _0x491434+_0x46e2('0x26');})})[_0x46e2('0x1f')](function(){return _0x510aa1[_0x46e2('0x11')](0xc8)[_0x46e2('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x46e2('0xe')][_0x46e2('0x4')]+_0x46e2('0x2f')+_[_0x46e2('0x30')](_0x345d36),'migrations':_[_0x46e2('0x23')](_0x345d36)});})[_0x46e2('0x31')](function(_0x330e8c){if(_0x330e8c instanceof db['sequelize'][_0x46e2('0x32')]){return _0x510aa1[_0x46e2('0x11')](0xc8)['json']({'output':_0x46e2('0x33')});}else{return _0x510aa1['status'](0x1f4)[_0x46e2('0x10')](_0x330e8c);}});}else{return _0x510aa1['status'](0xc8)[_0x46e2('0x10')]({'output':_0x46e2('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index cf0c21c..5616c72 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 _0xa139=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2c2773,_0x2bc6c4){var _0x256a98=function(_0x27c570){while(--_0x27c570){_0x2c2773['push'](_0x2c2773['shift']());}};_0x256a98(++_0x2bc6c4);}(_0xa139,0x1c5));var _0x9a13=function(_0x17a89a,_0x4c26d5){_0x17a89a=_0x17a89a-0x0;var _0x59dcf9=_0xa139[_0x17a89a];return _0x59dcf9;};'use strict';var multer=require(_0x9a13('0x0'));var util=require(_0x9a13('0x1'));var path=require(_0x9a13('0x2'));var timeout=require(_0x9a13('0x3'));var express=require(_0x9a13('0x4'));var router=express[_0x9a13('0x5')]();var fs_extra=require(_0x9a13('0x6'));var auth=require(_0x9a13('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9a13('0x8'));var controller=require(_0x9a13('0x9'));router[_0x9a13('0xa')]('/',auth[_0x9a13('0xb')](),controller[_0x9a13('0xc')]);router[_0x9a13('0xa')](_0x9a13('0xd'),auth[_0x9a13('0xb')](),controller['describe']);router['get'](_0x9a13('0xe'),auth[_0x9a13('0xb')](),controller[_0x9a13('0xf')]);router[_0x9a13('0x10')]('/',auth[_0x9a13('0xb')](),controller[_0x9a13('0x11')]);router[_0x9a13('0x12')](_0x9a13('0xe'),auth[_0x9a13('0xb')](),controller['update']);router[_0x9a13('0x13')](_0x9a13('0xe'),auth[_0x9a13('0xb')](),controller['destroy']);module[_0x9a13('0x14')]=router; \ No newline at end of file +var _0xa84e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x3eb540,_0x4e517a){var _0x2e88d8=function(_0x5902aa){while(--_0x5902aa){_0x3eb540['push'](_0x3eb540['shift']());}};_0x2e88d8(++_0x4e517a);}(_0xa84e,0x151));var _0xea84=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xa84e[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require(_0xea84('0x0'));var util=require(_0xea84('0x1'));var path=require(_0xea84('0x2'));var timeout=require(_0xea84('0x3'));var express=require(_0xea84('0x4'));var router=express['Router']();var fs_extra=require(_0xea84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xea84('0x6'));var config=require('../../config/environment');var controller=require(_0xea84('0x7'));router[_0xea84('0x8')]('/',auth['isAuthenticated'](),controller[_0xea84('0x9')]);router[_0xea84('0x8')](_0xea84('0xa'),auth[_0xea84('0xb')](),controller[_0xea84('0xc')]);router['get'](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0xe')]);router[_0xea84('0xf')]('/',auth[_0xea84('0xb')](),controller['create']);router[_0xea84('0x10')](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0x11')]);router[_0xea84('0x12')](_0xea84('0xd'),auth[_0xea84('0xb')](),controller[_0xea84('0x13')]);module[_0xea84('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 0af98a0..64fc68d 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 _0xb4f8=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x1cbc6f,_0x2aa534){var _0x823729=function(_0x2c3ef2){while(--_0x2c3ef2){_0x1cbc6f['push'](_0x1cbc6f['shift']());}};_0x823729(++_0x2aa534);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0xb4f8[_0x2f9467];return _0x39894c;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'type':{'type':Sequelize[_0x8b4f('0x1')]},'uniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'calleridnum':{'type':Sequelize[_0x8b4f('0x1')]},'calleridname':{'type':Sequelize[_0x8b4f('0x1')]},'queue':{'type':Sequelize[_0x8b4f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8b4f('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x8b4f('0x2')]},'agentdumpAt':{'type':Sequelize[_0x8b4f('0x2')]},'holdtime':{'type':Sequelize[_0x8b4f('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8b4f('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8b4f('0x3')]},'reason':{'type':Sequelize[_0x8b4f('0x1')]},'lastevent':{'type':Sequelize[_0x8b4f('0x1')]},'channel':{'type':Sequelize[_0x8b4f('0x1')]},'channelstate':{'type':Sequelize[_0x8b4f('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8b4f('0x1')]},'connectedlinename':{'type':Sequelize[_0x8b4f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b4f('0x1')]},'context':{'type':Sequelize[_0x8b4f('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8b4f('0x1')]},'destchannel':{'type':Sequelize[_0x8b4f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8b4f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8b4f('0x1')]},'destcalleridname':{'type':Sequelize[_0x8b4f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8b4f('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8b4f('0x1')]},'destaccountcode':{'type':Sequelize[_0x8b4f('0x1')]},'destcontext':{'type':Sequelize[_0x8b4f('0x1')]},'destexten':{'type':Sequelize[_0x8b4f('0x1')]},'destpriority':{'type':Sequelize[_0x8b4f('0x1')]},'destuniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8b4f('0x1')]},'transfer':{'type':Sequelize[_0x8b4f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8b4f('0x1')],'comment':_0x8b4f('0x5')},'transferexten':{'type':Sequelize[_0x8b4f('0x1')]},'transferuniqueid':{'type':Sequelize[_0x8b4f('0x1')]},'agententerreason':{'type':Sequelize[_0x8b4f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x94e6=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94e6,0x194));var _0x694e=function(_0x364e3f,_0x9761bf){_0x364e3f=_0x364e3f-0x0;var _0xc18c5a=_0x94e6[_0x364e3f];return _0xc18c5a;};'use strict';var Sequelize=require(_0x694e('0x0'));module['exports']={'type':{'type':Sequelize[_0x694e('0x1')]},'uniqueid':{'type':Sequelize[_0x694e('0x1')]},'calleridnum':{'type':Sequelize[_0x694e('0x1')]},'calleridname':{'type':Sequelize[_0x694e('0x1')]},'queue':{'type':Sequelize[_0x694e('0x1')]},'interface':{'type':Sequelize[_0x694e('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x694e('0x2')]},'agentconnectAt':{'type':Sequelize[_0x694e('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x694e('0x2')]},'holdtime':{'type':Sequelize[_0x694e('0x3')]},'agentcomplete':{'type':Sequelize[_0x694e('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x694e('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x694e('0x1')]},'channel':{'type':Sequelize[_0x694e('0x1')]},'channelstate':{'type':Sequelize[_0x694e('0x3')]},'channelstatedesc':{'type':Sequelize[_0x694e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x694e('0x1')]},'language':{'type':Sequelize[_0x694e('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x694e('0x1')]},'exten':{'type':Sequelize[_0x694e('0x1')]},'priority':{'type':Sequelize[_0x694e('0x1')]},'destchannel':{'type':Sequelize[_0x694e('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x694e('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x694e('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x694e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x694e('0x1')]},'destlanguage':{'type':Sequelize[_0x694e('0x1')]},'destaccountcode':{'type':Sequelize[_0x694e('0x1')]},'destcontext':{'type':Sequelize[_0x694e('0x1')]},'destexten':{'type':Sequelize[_0x694e('0x1')]},'destpriority':{'type':Sequelize[_0x694e('0x1')]},'destuniqueid':{'type':Sequelize[_0x694e('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x694e('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x694e('0x1')]},'transfer':{'type':Sequelize[_0x694e('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x694e('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x694e('0x1')]},'transferuniqueid':{'type':Sequelize[_0x694e('0x1')]},'agententerreason':{'type':Sequelize[_0x694e('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 9301a0f..423de28 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +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(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 ecabd5b..72757a6 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 _0x9576=['request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api'];(function(_0x36357e,_0x7ff1f3){var _0x22e6c9=function(_0xbf2dc0){while(--_0xbf2dc0){_0x36357e['push'](_0x36357e['shift']());}};_0x22e6c9(++_0x7ff1f3);}(_0x9576,0x182));var _0x6957=function(_0x59512c,_0x28ca39){_0x59512c=_0x59512c-0x0;var _0x808131=_0x9576[_0x59512c];return _0x808131;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var logger=require(_0x6957('0x2'))(_0x6957('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6957('0x4'));var fs=require('fs');var path=require(_0x6957('0x5'));var rimraf=require(_0x6957('0x6'));var config=require(_0x6957('0x7'));var attributes=require(_0x6957('0x8'));module[_0x6957('0x9')]=function(_0x2eb79e,_0x49e08a){return _0x2eb79e[_0x6957('0xa')](_0x6957('0xb'),attributes,{'tableName':_0x6957('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6957('0xd'),_0x6957('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e7=['report_agent','destuniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0x13397a,_0x4d7425){var _0x1a111a=function(_0x2491fd){while(--_0x2491fd){_0x13397a['push'](_0x13397a['shift']());}};_0x1a111a(++_0x4d7425);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x31cfe9,_0x44c183){_0x31cfe9=_0x31cfe9-0x0;var _0x5a5b28=_0xe9e7[_0x31cfe9];return _0x5a5b28;};'use strict';var _=require(_0x7e9e('0x0'));var util=require(_0x7e9e('0x1'));var logger=require(_0x7e9e('0x2'))('api');var moment=require(_0x7e9e('0x3'));var BPromise=require(_0x7e9e('0x4'));var rp=require(_0x7e9e('0x5'));var fs=require('fs');var path=require(_0x7e9e('0x6'));var rimraf=require(_0x7e9e('0x7'));var config=require(_0x7e9e('0x8'));var attributes=require(_0x7e9e('0x9'));module['exports']=function(_0x319f70,_0x134fac){return _0x319f70[_0x7e9e('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x7e9e('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x7e9e('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 e7da126..6fb562f 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 _0xfe80=['result','CreateVoiceAgentReport','create','body','options','raw','debug','catch','UpdateVoiceAgentReport','update','where','info','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','then','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x35e507,_0x171e16){var _0x51b71b=function(_0x20a51e){while(--_0x20a51e){_0x35e507['push'](_0x35e507['shift']());}};_0x51b71b(++_0x171e16);}(_0xfe80,0x194));var _0x0fe8=function(_0x2dbd40,_0x1a1931){_0x2dbd40=_0x2dbd40-0x0;var _0x92aa93=_0xfe80[_0x2dbd40];return _0x92aa93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0fe8('0x0'));var BPromise=require(_0x0fe8('0x1'));var rs=require(_0x0fe8('0x2'));var fs=require('fs');var Redis=require(_0x0fe8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0fe8('0x4'))(_0x0fe8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0fe8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x148a25,_0x31133a,_0x4728b1){return new BPromise(function(_0x2627e9,_0x3969e3){return client[_0x0fe8('0x7')](_0x148a25,_0x4728b1)[_0x0fe8('0x8')](function(_0x281c02){logger['info'](_0x0fe8('0x9'),_0x31133a,'request\x20sent');logger['debug'](_0x0fe8('0xa'),_0x31133a,_0x0fe8('0xb'),JSON[_0x0fe8('0xc')](_0x281c02));if(_0x281c02[_0x0fe8('0xd')]){if(_0x281c02[_0x0fe8('0xd')][_0x0fe8('0xe')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x31133a,_0x281c02['error']['message']);return _0x3969e3(_0x281c02[_0x0fe8('0xd')][_0x0fe8('0xf')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x31133a,_0x281c02[_0x0fe8('0xd')]['message']);return _0x2627e9(_0x281c02['error'][_0x0fe8('0xf')]);}else{logger['info'](_0x0fe8('0x9'),_0x31133a,_0x0fe8('0xb'));_0x2627e9(_0x281c02[_0x0fe8('0x10')][_0x0fe8('0xf')]);}})['catch'](function(_0x24f4b6){logger['error'](_0x0fe8('0x9'),_0x31133a,_0x24f4b6);_0x3969e3(_0x24f4b6);});});}exports[_0x0fe8('0x11')]=function(_0x5160d4){var _0x3f0def=this;return new Promise(function(_0x3fa88a,_0x5e70fa){return db['VoiceAgentReport'][_0x0fe8('0x12')](_0x5160d4[_0x0fe8('0x13')],{'raw':_0x5160d4[_0x0fe8('0x14')]?_0x5160d4[_0x0fe8('0x14')][_0x0fe8('0x15')]===undefined?!![]:![]:!![]})[_0x0fe8('0x8')](function(_0x1404b5){logger['info']('CreateVoiceAgentReport',_0x5160d4);logger[_0x0fe8('0x16')](_0x0fe8('0x11'),_0x5160d4,JSON[_0x0fe8('0xc')](_0x1404b5));_0x3fa88a(_0x1404b5);})[_0x0fe8('0x17')](function(_0x55a63b){logger[_0x0fe8('0xd')](_0x0fe8('0x11'),_0x55a63b[_0x0fe8('0xf')],_0x5160d4);_0x5e70fa(_0x3f0def[_0x0fe8('0xd')](0x1f4,_0x55a63b['message']));});});};exports[_0x0fe8('0x18')]=function(_0xb875d9){var _0x1d8ab4=this;return new Promise(function(_0x1fa17c,_0x34a457){return db['VoiceAgentReport'][_0x0fe8('0x19')](_0xb875d9['body'],{'raw':_0xb875d9['options']?_0xb875d9[_0x0fe8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb875d9[_0x0fe8('0x14')]?_0xb875d9[_0x0fe8('0x14')][_0x0fe8('0x1a')]||null:null,'attributes':_0xb875d9[_0x0fe8('0x14')]?_0xb875d9[_0x0fe8('0x14')]['attributes']||null:null,'limit':_0xb875d9[_0x0fe8('0x14')]?_0xb875d9[_0x0fe8('0x14')]['limit']||null:null})[_0x0fe8('0x8')](function(_0x1b9644){logger[_0x0fe8('0x1b')](_0x0fe8('0x18'),_0xb875d9);logger['debug'](_0x0fe8('0x18'),_0xb875d9,JSON['stringify'](_0x1b9644));_0x1fa17c(_0x1b9644);})[_0x0fe8('0x17')](function(_0x4fbb15){logger['error'](_0x0fe8('0x18'),_0x4fbb15[_0x0fe8('0xf')],_0xb875d9);_0x34a457(_0x1d8ab4[_0x0fe8('0xd')](0x1f4,_0x4fbb15[_0x0fe8('0xf')]));});});}; \ No newline at end of file +var _0xf508=['result','catch','CreateVoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5f26f4,_0x4f9bcf){var _0x385e31=function(_0x20d9d7){while(--_0x20d9d7){_0x5f26f4['push'](_0x5f26f4['shift']());}};_0x385e31(++_0x4f9bcf);}(_0xf508,0xf4));var _0x8f50=function(_0x327664,_0x39a926){_0x327664=_0x327664-0x0;var _0x1f7663=_0xf508[_0x327664];return _0x1f7663;};'use strict';var _=require('lodash');var util=require(_0x8f50('0x0'));var moment=require(_0x8f50('0x1'));var BPromise=require(_0x8f50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f50('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f50('0x4'));var logger=require(_0x8f50('0x5'))(_0x8f50('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f50('0x7'));var client=jayson['client'][_0x8f50('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f11d8,_0x44cb7d,_0x2804fc){return new BPromise(function(_0x9557b,_0x481f7d){return client[_0x8f50('0x9')](_0x5f11d8,_0x2804fc)[_0x8f50('0xa')](function(_0x53db17){logger['info'](_0x8f50('0xb'),_0x44cb7d,_0x8f50('0xc'));logger[_0x8f50('0xd')](_0x8f50('0xe'),_0x44cb7d,_0x8f50('0xc'),JSON[_0x8f50('0xf')](_0x53db17));if(_0x53db17[_0x8f50('0x10')]){if(_0x53db17[_0x8f50('0x10')][_0x8f50('0x11')]===0x1f4){logger[_0x8f50('0x10')](_0x8f50('0xb'),_0x44cb7d,_0x53db17[_0x8f50('0x10')][_0x8f50('0x12')]);return _0x481f7d(_0x53db17[_0x8f50('0x10')][_0x8f50('0x12')]);}logger[_0x8f50('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x44cb7d,_0x53db17[_0x8f50('0x10')][_0x8f50('0x12')]);return _0x9557b(_0x53db17[_0x8f50('0x10')]['message']);}else{logger[_0x8f50('0x13')](_0x8f50('0xb'),_0x44cb7d,_0x8f50('0xc'));_0x9557b(_0x53db17[_0x8f50('0x14')][_0x8f50('0x12')]);}})[_0x8f50('0x15')](function(_0x459e47){logger[_0x8f50('0x10')](_0x8f50('0xb'),_0x44cb7d,_0x459e47);_0x481f7d(_0x459e47);});});}exports[_0x8f50('0x16')]=function(_0x13b484){var _0x2f3a1d=this;return new Promise(function(_0x1d253a,_0x3efdf9){return db['VoiceAgentReport'][_0x8f50('0x17')](_0x13b484[_0x8f50('0x18')],{'raw':_0x13b484[_0x8f50('0x19')]?_0x13b484[_0x8f50('0x19')][_0x8f50('0x1a')]===undefined?!![]:![]:!![]})[_0x8f50('0xa')](function(_0xa6a9ec){logger[_0x8f50('0x13')]('CreateVoiceAgentReport',_0x13b484);logger[_0x8f50('0xd')](_0x8f50('0x16'),_0x13b484,JSON[_0x8f50('0xf')](_0xa6a9ec));_0x1d253a(_0xa6a9ec);})[_0x8f50('0x15')](function(_0x163f42){logger[_0x8f50('0x10')](_0x8f50('0x16'),_0x163f42[_0x8f50('0x12')],_0x13b484);_0x3efdf9(_0x2f3a1d[_0x8f50('0x10')](0x1f4,_0x163f42[_0x8f50('0x12')]));});});};exports[_0x8f50('0x1b')]=function(_0x2ebd7e){var _0x439a20=this;return new Promise(function(_0x1f3a7e,_0x334761){return db[_0x8f50('0x1c')][_0x8f50('0x1d')](_0x2ebd7e[_0x8f50('0x18')],{'raw':_0x2ebd7e['options']?_0x2ebd7e[_0x8f50('0x19')][_0x8f50('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ebd7e[_0x8f50('0x19')]?_0x2ebd7e[_0x8f50('0x19')][_0x8f50('0x1e')]||null:null,'attributes':_0x2ebd7e[_0x8f50('0x19')]?_0x2ebd7e[_0x8f50('0x19')][_0x8f50('0x1f')]||null:null,'limit':_0x2ebd7e[_0x8f50('0x19')]?_0x2ebd7e[_0x8f50('0x19')][_0x8f50('0x20')]||null:null})[_0x8f50('0xa')](function(_0x4f9625){logger[_0x8f50('0x13')](_0x8f50('0x1b'),_0x2ebd7e);logger[_0x8f50('0xd')]('UpdateVoiceAgentReport',_0x2ebd7e,JSON['stringify'](_0x4f9625));_0x1f3a7e(_0x4f9625);})[_0x8f50('0x15')](function(_0x3d5d78){logger['error'](_0x8f50('0x1b'),_0x3d5d78[_0x8f50('0x12')],_0x2ebd7e);_0x334761(_0x439a20[_0x8f50('0x10')](0x1f4,_0x3d5d78[_0x8f50('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index be27b43..e282195 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 _0x4c4e=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x1c8307,_0x436ce5){var _0x5d4e8e=function(_0x1bf043){while(--_0x1bf043){_0x1c8307['push'](_0x1c8307['shift']());}};_0x5d4e8e(++_0x436ce5);}(_0x4c4e,0x152));var _0xe4c4=function(_0x49809a,_0x343f85){_0x49809a=_0x49809a-0x0;var _0xb9f22a=_0x4c4e[_0x49809a];return _0xb9f22a;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xe')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0x10')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['update']);router[_0xe4c4('0x11')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','/describe','isAuthenticated','/:id','create'];(function(_0x30e0f5,_0x5e4826){var _0x3b5800=function(_0x3d9155){while(--_0x3d9155){_0x30e0f5['push'](_0x30e0f5['shift']());}};_0x3b5800(++_0x5e4826);}(_0x038b,0x114));var _0xb038=function(_0x521f3d,_0x3f0977){_0x521f3d=_0x521f3d-0x0;var _0x2965ba=_0x038b[_0x521f3d];return _0x2965ba;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb038('0x7')](_0xb038('0x8'),auth[_0xb038('0x9')](),controller['describe']);router['get'](_0xb038('0xa'),auth[_0xb038('0x9')](),controller['show']);router['post']('/',auth[_0xb038('0x9')](),controller[_0xb038('0xb')]);router['put'](_0xb038('0xa'),auth[_0xb038('0x9')](),controller[_0xb038('0xc')]);router[_0xb038('0xd')](_0xb038('0xa'),auth[_0xb038('0x9')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 022311b..7a00582 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 _0xc42f=['inbound','outbound','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x1bfc7b,_0x360a77){var _0x3004cf=function(_0x3dde42){while(--_0x3dde42){_0x1bfc7b['push'](_0x1bfc7b['shift']());}};_0x3004cf(++_0x360a77);}(_0xc42f,0xb0));var _0xfc42=function(_0x2fc13a,_0x463f42){_0x2fc13a=_0x2fc13a-0x0;var _0x17a77d=_0xc42f[_0x2fc13a];return _0x17a77d;};'use strict';var Sequelize=require(_0xfc42('0x0'));module[_0xfc42('0x1')]={'uniqueid':{'type':Sequelize[_0xfc42('0x2')]},'type':{'type':Sequelize[_0xfc42('0x3')](_0xfc42('0x4'),'internal',_0xfc42('0x5'),'inbound-fax','outbound-fax',_0xfc42('0x6'))},'tag':{'type':Sequelize[_0xfc42('0x2')]},'accountcode':{'type':Sequelize[_0xfc42('0x2')]},'source':{'type':Sequelize[_0xfc42('0x2')]},'destination':{'type':Sequelize[_0xfc42('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfc42('0x2')]},'channel':{'type':Sequelize[_0xfc42('0x2')]},'destinationchannel':{'type':Sequelize[_0xfc42('0x2')]},'lastapplication':{'type':Sequelize[_0xfc42('0x2')]},'lastdata':{'type':Sequelize[_0xfc42('0x7')]},'starttime':{'type':Sequelize[_0xfc42('0x8')]},'systemanswertime':{'type':Sequelize[_0xfc42('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfc42('0x8')]},'duration':{'type':Sequelize[_0xfc42('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfc42('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfc42('0x2')]},'amaflags':{'type':Sequelize[_0xfc42('0x2')]},'userfield':{'type':Sequelize[_0xfc42('0x2')]},'userDisposition':{'type':Sequelize[_0xfc42('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xfc42('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xfc42('0x2')]},'note':{'type':Sequelize[_0xfc42('0x2')]},'prefix':{'type':Sequelize[_0xfc42('0x2')]},'routeid':{'type':Sequelize[_0xfc42('0x9')]},'sipcallid':{'type':Sequelize[_0xfc42('0x2')]}}; \ No newline at end of file +var _0x8889=['inbound-fax','outbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound'];(function(_0x3c2180,_0xd1e22e){var _0x192a8f=function(_0x5c96df){while(--_0x5c96df){_0x3c2180['push'](_0x3c2180['shift']());}};_0x192a8f(++_0xd1e22e);}(_0x8889,0x1d9));var _0x9888=function(_0xadfd1c,_0x33cba4){_0xadfd1c=_0xadfd1c-0x0;var _0x4ba49b=_0x8889[_0xadfd1c];return _0x4ba49b;};'use strict';var Sequelize=require(_0x9888('0x0'));module[_0x9888('0x1')]={'uniqueid':{'type':Sequelize[_0x9888('0x2')]},'type':{'type':Sequelize[_0x9888('0x3')](_0x9888('0x4'),_0x9888('0x5'),_0x9888('0x6'),_0x9888('0x7'),_0x9888('0x8'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9888('0x2')]},'source':{'type':Sequelize[_0x9888('0x2')]},'destination':{'type':Sequelize[_0x9888('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9888('0x2')]},'channel':{'type':Sequelize[_0x9888('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x9888('0x2')]},'lastdata':{'type':Sequelize[_0x9888('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9888('0xa')]},'endtime':{'type':Sequelize[_0x9888('0xa')]},'duration':{'type':Sequelize[_0x9888('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x9888('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9888('0x2')]},'amaflags':{'type':Sequelize[_0x9888('0x2')]},'userfield':{'type':Sequelize[_0x9888('0x2')]},'userDisposition':{'type':Sequelize[_0x9888('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x9888('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x9888('0x2')]},'note':{'type':Sequelize[_0x9888('0x2')]},'prefix':{'type':Sequelize[_0x9888('0x2')]},'routeid':{'type':Sequelize[_0x9888('0xb')]},'sipcallid':{'type':Sequelize[_0x9888('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 6d61bd7..e62c4d7 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(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x2f98d4,_0x533fd7){var _0xf199dc=function(_0x4efa7f){while(--_0x4efa7f){_0x2f98d4['push'](_0x2f98d4['shift']());}};_0xf199dc(++_0x533fd7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2da8e3,_0x397415){_0x2da8e3=_0x2da8e3-0x0;var _0x281fd5=_0x0b0e[_0x2da8e3];return _0x281fd5;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index b487e6e..8d5ac71 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 _0x9386=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','lodash','util','api','moment','bluebird'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x9386,0x6b));var _0x6938=function(_0x4f01f8,_0x4386eb){_0x4f01f8=_0x4f01f8-0x0;var _0x385831=_0x9386[_0x4f01f8];return _0x385831;};'use strict';var _=require(_0x6938('0x0'));var util=require(_0x6938('0x1'));var logger=require('../../config/logger')(_0x6938('0x2'));var moment=require(_0x6938('0x3'));var BPromise=require(_0x6938('0x4'));var rp=require(_0x6938('0x5'));var fs=require('fs');var path=require(_0x6938('0x6'));var rimraf=require(_0x6938('0x7'));var config=require(_0x6938('0x8'));var attributes=require(_0x6938('0x9'));module[_0x6938('0xa')]=function(_0x55b42f,_0x4698ce){return _0x55b42f[_0x6938('0xb')](_0x6938('0xc'),attributes,{'tableName':_0x6938('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf963=['define','lodash','../../config/logger','bluebird','path','rimraf','./voiceCallReport.attributes','exports'];(function(_0x537ab5,_0x5dc6c6){var _0x100378=function(_0x16353b){while(--_0x16353b){_0x537ab5['push'](_0x537ab5['shift']());}};_0x100378(++_0x5dc6c6);}(_0xf963,0xf9));var _0x3f96=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf963[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x3f96('0x0'));var util=require('util');var logger=require(_0x3f96('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3f96('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f96('0x3'));var rimraf=require(_0x3f96('0x4'));var config=require('../../config/environment');var attributes=require(_0x3f96('0x5'));module[_0x3f96('0x6')]=function(_0x925c29,_0x25c3ec){return _0x925c29[_0x3f96('0x7')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index a4b81bd..ef0fa31 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 _0xcf0a=['VoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','limit','include','model','map','CreateVoiceCallReport'];(function(_0xd7cea4,_0x125f5e){var _0x15bff0=function(_0x49b472){while(--_0x49b472){_0xd7cea4['push'](_0xd7cea4['shift']());}};_0x15bff0(++_0x125f5e);}(_0xcf0a,0x1e7));var _0xacf0=function(_0x4917d4,_0x3fdd01){_0x4917d4=_0x4917d4-0x0;var _0x382f7d=_0xcf0a[_0x4917d4];return _0x382f7d;};'use strict';var _=require(_0xacf0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xacf0('0x1'));var rs=require(_0xacf0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacf0('0x3'))['db'];var utils=require(_0xacf0('0x4'));var logger=require('../../config/logger')(_0xacf0('0x5'));var config=require(_0xacf0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xacf0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43e131,_0x4d5ed4,_0x277c67){return new BPromise(function(_0x5067f9,_0x517c58){return client[_0xacf0('0x8')](_0x43e131,_0x277c67)[_0xacf0('0x9')](function(_0x111319){logger[_0xacf0('0xa')](_0xacf0('0xb'),_0x4d5ed4,'request\x20sent');logger[_0xacf0('0xc')](_0xacf0('0xd'),_0x4d5ed4,'request\x20sent',JSON[_0xacf0('0xe')](_0x111319));if(_0x111319[_0xacf0('0xf')]){if(_0x111319[_0xacf0('0xf')][_0xacf0('0x10')]===0x1f4){logger[_0xacf0('0xf')](_0xacf0('0xb'),_0x4d5ed4,_0x111319[_0xacf0('0xf')]['message']);return _0x517c58(_0x111319[_0xacf0('0xf')][_0xacf0('0x11')]);}logger[_0xacf0('0xf')](_0xacf0('0xb'),_0x4d5ed4,_0x111319[_0xacf0('0xf')][_0xacf0('0x11')]);return _0x5067f9(_0x111319[_0xacf0('0xf')]['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x4d5ed4,_0xacf0('0x12'));_0x5067f9(_0x111319[_0xacf0('0x13')][_0xacf0('0x11')]);}})[_0xacf0('0x14')](function(_0x252e74){logger[_0xacf0('0xf')](_0xacf0('0xb'),_0x4d5ed4,_0x252e74);_0x517c58(_0x252e74);});});}exports[_0xacf0('0x15')]=function(_0x26fbeb){var _0x3dfc22=this;return new Promise(function(_0x2c250d,_0x5a8fd9){return db['VoiceCallReport'][_0xacf0('0x16')]({'raw':_0x26fbeb['options']?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x18')]===undefined?!![]:![]:!![],'where':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb['options']['where']||null:null,'attributes':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x19')]||null:null,'limit':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x1a')]||null:null,'include':_0x26fbeb[_0xacf0('0x17')]?_0x26fbeb[_0xacf0('0x17')][_0xacf0('0x1b')]?_['map'](_0x26fbeb['options'][_0xacf0('0x1b')],function(_0x5e6bee){return{'model':db[_0x5e6bee[_0xacf0('0x1c')]],'as':_0x5e6bee['as'],'attributes':_0x5e6bee[_0xacf0('0x19')],'include':_0x5e6bee[_0xacf0('0x1b')]?_['map'](_0x5e6bee[_0xacf0('0x1b')],function(_0x2b46d9){return{'model':db[_0x2b46d9[_0xacf0('0x1c')]],'as':_0x2b46d9['as'],'attributes':_0x2b46d9['attributes'],'include':_0x2b46d9[_0xacf0('0x1b')]?_[_0xacf0('0x1d')](_0x2b46d9[_0xacf0('0x1b')],function(_0x255f4f){return{'model':db[_0x255f4f[_0xacf0('0x1c')]],'as':_0x255f4f['as'],'attributes':_0x255f4f['attributes']};}):[]};}):[]};}):[]:[]})[_0xacf0('0x9')](function(_0xc410a9){logger[_0xacf0('0xa')](_0xacf0('0x15'),_0x26fbeb);logger[_0xacf0('0xc')](_0xacf0('0x15'),_0x26fbeb,JSON[_0xacf0('0xe')](_0xc410a9));_0x2c250d(_0xc410a9);})['catch'](function(_0x111640){logger['error']('GetVoiceCallReport',_0x111640['message'],_0x26fbeb);_0x5a8fd9(_0x3dfc22[_0xacf0('0xf')](0x1f4,_0x111640['message']));});});};exports[_0xacf0('0x1e')]=function(_0x588d9f){var _0x4b21da=this;return new Promise(function(_0x21c031,_0x6e9d82){return db[_0xacf0('0x1f')][_0xacf0('0x20')](_0x588d9f[_0xacf0('0x21')],{'raw':_0x588d9f[_0xacf0('0x17')]?_0x588d9f[_0xacf0('0x17')][_0xacf0('0x18')]===undefined?!![]:![]:!![]})[_0xacf0('0x9')](function(_0x36def8){logger[_0xacf0('0xa')](_0xacf0('0x1e'),_0x588d9f);logger[_0xacf0('0xc')](_0xacf0('0x1e'),_0x588d9f,JSON[_0xacf0('0xe')](_0x36def8));_0x21c031(_0x36def8);})[_0xacf0('0x14')](function(_0x248a87){logger['error'](_0xacf0('0x1e'),_0x248a87['message'],_0x588d9f);_0x6e9d82(_0x4b21da[_0xacf0('0xf')](0x1f4,_0x248a87[_0xacf0('0x11')]));});});};exports[_0xacf0('0x22')]=function(_0x873a90){var _0x394682=this;return new Promise(function(_0x37efa0,_0x2d9179){return db[_0xacf0('0x1f')][_0xacf0('0x23')](_0x873a90[_0xacf0('0x21')],{'raw':_0x873a90[_0xacf0('0x17')]?_0x873a90['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x873a90['options']?_0x873a90[_0xacf0('0x17')][_0xacf0('0x24')]||null:null,'attributes':_0x873a90[_0xacf0('0x17')]?_0x873a90[_0xacf0('0x17')][_0xacf0('0x19')]||null:null,'limit':_0x873a90[_0xacf0('0x17')]?_0x873a90[_0xacf0('0x17')][_0xacf0('0x1a')]||null:null})['then'](function(_0x1a267e){logger[_0xacf0('0xa')]('UpdateVoiceCallReport',_0x873a90);logger[_0xacf0('0xc')](_0xacf0('0x22'),_0x873a90,JSON[_0xacf0('0xe')](_0x1a267e));_0x37efa0(_0x1a267e);})['catch'](function(_0x4b0645){logger['error'](_0xacf0('0x22'),_0x4b0645[_0xacf0('0x11')],_0x873a90);_0x2d9179(_0x394682[_0xacf0('0xf')](0x1f4,_0x4b0645[_0xacf0('0x11')]));});});}; \ No newline at end of file +var _0x77e0=['include','map','model','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x77e0,0x133));var _0x077e=function(_0x54169a,_0x2a946f){_0x54169a=_0x54169a-0x0;var _0x414948=_0x77e0[_0x54169a];return _0x414948;};'use strict';var _=require(_0x077e('0x0'));var util=require('util');var moment=require(_0x077e('0x1'));var BPromise=require(_0x077e('0x2'));var rs=require(_0x077e('0x3'));var fs=require('fs');var Redis=require(_0x077e('0x4'));var db=require(_0x077e('0x5'))['db'];var utils=require(_0x077e('0x6'));var logger=require(_0x077e('0x7'))(_0x077e('0x8'));var config=require(_0x077e('0x9'));var jayson=require(_0x077e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ce24e,_0x5cb5de,_0x36a3db){return new BPromise(function(_0x191263,_0x44fb48){return client[_0x077e('0xb')](_0x2ce24e,_0x36a3db)['then'](function(_0x4dcb2a){logger['info'](_0x077e('0xc'),_0x5cb5de,_0x077e('0xd'));logger[_0x077e('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5cb5de,'request\x20sent',JSON[_0x077e('0xf')](_0x4dcb2a));if(_0x4dcb2a[_0x077e('0x10')]){if(_0x4dcb2a[_0x077e('0x10')]['code']===0x1f4){logger[_0x077e('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x5cb5de,_0x4dcb2a['error'][_0x077e('0x11')]);return _0x44fb48(_0x4dcb2a[_0x077e('0x10')]['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5cb5de,_0x4dcb2a[_0x077e('0x10')][_0x077e('0x11')]);return _0x191263(_0x4dcb2a['error'][_0x077e('0x11')]);}else{logger[_0x077e('0x12')](_0x077e('0xc'),_0x5cb5de,'request\x20sent');_0x191263(_0x4dcb2a['result']['message']);}})[_0x077e('0x13')](function(_0x43f111){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5cb5de,_0x43f111);_0x44fb48(_0x43f111);});});}exports[_0x077e('0x14')]=function(_0x3eb056){var _0x28bc97=this;return new Promise(function(_0x2ca3c5,_0xfa8d83){return db[_0x077e('0x15')][_0x077e('0x16')]({'raw':_0x3eb056[_0x077e('0x17')]?_0x3eb056['options'][_0x077e('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb056[_0x077e('0x17')]?_0x3eb056[_0x077e('0x17')][_0x077e('0x19')]||null:null,'attributes':_0x3eb056['options']?_0x3eb056[_0x077e('0x17')]['attributes']||null:null,'limit':_0x3eb056[_0x077e('0x17')]?_0x3eb056['options']['limit']||null:null,'include':_0x3eb056[_0x077e('0x17')]?_0x3eb056['options'][_0x077e('0x1a')]?_['map'](_0x3eb056['options']['include'],function(_0x2f85a9){return{'model':db[_0x2f85a9['model']],'as':_0x2f85a9['as'],'attributes':_0x2f85a9['attributes'],'include':_0x2f85a9[_0x077e('0x1a')]?_[_0x077e('0x1b')](_0x2f85a9['include'],function(_0x24701b){return{'model':db[_0x24701b[_0x077e('0x1c')]],'as':_0x24701b['as'],'attributes':_0x24701b['attributes'],'include':_0x24701b[_0x077e('0x1a')]?_['map'](_0x24701b[_0x077e('0x1a')],function(_0x1f9ff4){return{'model':db[_0x1f9ff4['model']],'as':_0x1f9ff4['as'],'attributes':_0x1f9ff4['attributes']};}):[]};}):[]};}):[]:[]})[_0x077e('0x1d')](function(_0x46c273){logger['info'](_0x077e('0x14'),_0x3eb056);logger[_0x077e('0xe')](_0x077e('0x14'),_0x3eb056,JSON[_0x077e('0xf')](_0x46c273));_0x2ca3c5(_0x46c273);})[_0x077e('0x13')](function(_0x42e989){logger[_0x077e('0x10')](_0x077e('0x14'),_0x42e989[_0x077e('0x11')],_0x3eb056);_0xfa8d83(_0x28bc97[_0x077e('0x10')](0x1f4,_0x42e989[_0x077e('0x11')]));});});};exports[_0x077e('0x1e')]=function(_0x2c6f0){var _0x2457d3=this;return new Promise(function(_0x44caa4,_0x180dea){return db[_0x077e('0x15')][_0x077e('0x1f')](_0x2c6f0[_0x077e('0x20')],{'raw':_0x2c6f0[_0x077e('0x17')]?_0x2c6f0[_0x077e('0x17')][_0x077e('0x18')]===undefined?!![]:![]:!![]})[_0x077e('0x1d')](function(_0x167e47){logger[_0x077e('0x12')](_0x077e('0x1e'),_0x2c6f0);logger['debug'](_0x077e('0x1e'),_0x2c6f0,JSON[_0x077e('0xf')](_0x167e47));_0x44caa4(_0x167e47);})['catch'](function(_0x4afb94){logger[_0x077e('0x10')](_0x077e('0x1e'),_0x4afb94[_0x077e('0x11')],_0x2c6f0);_0x180dea(_0x2457d3[_0x077e('0x10')](0x1f4,_0x4afb94[_0x077e('0x11')]));});});};exports[_0x077e('0x21')]=function(_0x124dbb){var _0x52739b=this;return new Promise(function(_0x444065,_0x404fba){return db['VoiceCallReport'][_0x077e('0x22')](_0x124dbb[_0x077e('0x20')],{'raw':_0x124dbb[_0x077e('0x17')]?_0x124dbb['options'][_0x077e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x124dbb[_0x077e('0x17')]?_0x124dbb[_0x077e('0x17')][_0x077e('0x19')]||null:null,'attributes':_0x124dbb[_0x077e('0x17')]?_0x124dbb[_0x077e('0x17')][_0x077e('0x23')]||null:null,'limit':_0x124dbb[_0x077e('0x17')]?_0x124dbb[_0x077e('0x17')][_0x077e('0x24')]||null:null})[_0x077e('0x1d')](function(_0x172529){logger[_0x077e('0x12')](_0x077e('0x21'),_0x124dbb);logger[_0x077e('0xe')]('UpdateVoiceCallReport',_0x124dbb,JSON['stringify'](_0x172529));_0x444065(_0x172529);})[_0x077e('0x13')](function(_0xaa4efb){logger[_0x077e('0x10')](_0x077e('0x21'),_0xaa4efb['message'],_0x124dbb);_0x404fba(_0x52739b['error'](0x1f4,_0xaa4efb[_0x077e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1dd733d..e13020d 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 _0x87c4=['get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller'];(function(_0x28d661,_0x2f9212){var _0x45873a=function(_0x499c42){while(--_0x499c42){_0x28d661['push'](_0x28d661['shift']());}};_0x45873a(++_0x2f9212);}(_0x87c4,0x19a));var _0x487c=function(_0x48e0e3,_0x448060){_0x48e0e3=_0x48e0e3-0x0;var _0x3c7450=_0x87c4[_0x48e0e3];return _0x3c7450;};'use strict';var multer=require(_0x487c('0x0'));var util=require(_0x487c('0x1'));var path=require(_0x487c('0x2'));var timeout=require(_0x487c('0x3'));var express=require(_0x487c('0x4'));var router=express[_0x487c('0x5')]();var fs_extra=require(_0x487c('0x6'));var auth=require(_0x487c('0x7'));var interaction=require(_0x487c('0x8'));var config=require('../../config/environment');var controller=require(_0x487c('0x9'));router[_0x487c('0xa')]('/',auth[_0x487c('0xb')](),controller[_0x487c('0xc')]);router[_0x487c('0xa')]('/:id',auth[_0x487c('0xb')](),controller['show']);router[_0x487c('0xd')]('/',auth[_0x487c('0xb')](),controller[_0x487c('0xe')]);router[_0x487c('0xf')](_0x487c('0x10'),auth[_0x487c('0xb')](),controller[_0x487c('0x11')]);router[_0x487c('0x12')](_0x487c('0x10'),auth[_0x487c('0xb')](),controller[_0x487c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7ea8=['../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x7ea8,0x197));var _0x87ea=function(_0x51f120,_0x27f998){_0x51f120=_0x51f120-0x0;var _0x22ff09=_0x7ea8[_0x51f120];return _0x22ff09;};'use strict';var multer=require(_0x87ea('0x0'));var util=require('util');var path=require(_0x87ea('0x1'));var timeout=require(_0x87ea('0x2'));var express=require(_0x87ea('0x3'));var router=express[_0x87ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x87ea('0x5'));var interaction=require(_0x87ea('0x6'));var config=require(_0x87ea('0x7'));var controller=require(_0x87ea('0x8'));router['get']('/',auth[_0x87ea('0x9')](),controller[_0x87ea('0xa')]);router[_0x87ea('0xb')](_0x87ea('0xc'),auth[_0x87ea('0x9')](),controller['show']);router[_0x87ea('0xd')]('/',auth[_0x87ea('0x9')](),controller[_0x87ea('0xe')]);router[_0x87ea('0xf')](_0x87ea('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x87ea('0x10')](_0x87ea('0xc'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ff79934..0dc2986 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 _0xfa7e=['options','join','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x37f84a,_0x2c81f5){var _0x5c1d26=function(_0x11b10e){while(--_0x11b10e){_0x37f84a['push'](_0x37f84a['shift']());}};_0x5c1d26(++_0x2c81f5);}(_0xfa7e,0xf5));var _0xefa7=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xfa7e[_0x5c6994];return _0x1d5c84;};'use strict';var Sequelize=require('sequelize');module[_0xefa7('0x0')]={'name':{'type':Sequelize[_0xefa7('0x1')]},'prefix':{'type':Sequelize[_0xefa7('0x1')],'unique':_0xefa7('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xefa7('0x1')],'set':function(_0x4f30ef){this['setDataValue'](_0xefa7('0x3'),_0x4f30ef?_0x4f30ef[_0xefa7('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xefa7('0x3'))?this[_0xefa7('0x5')](_0xefa7('0x3'))[_0xefa7('0x6')](''):[];}},'auth':{'type':Sequelize[_0xefa7('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xefa7('0x1')]},'record':{'type':Sequelize[_0xefa7('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xefa7('0x1')]},'description':{'type':Sequelize[_0xefa7('0x1')]}}; \ No newline at end of file +var _0x43b2=['BOOLEAN','exports','STRING','name','setDataValue','options','getDataValue','split'];(function(_0x117994,_0x46bbbb){var _0x40814a=function(_0x5e88ca){while(--_0x5e88ca){_0x117994['push'](_0x117994['shift']());}};_0x40814a(++_0x46bbbb);}(_0x43b2,0x189));var _0x243b=function(_0x23bc44,_0x143afd){_0x23bc44=_0x23bc44-0x0;var _0x470b2c=_0x43b2[_0x23bc44];return _0x470b2c;};'use strict';var Sequelize=require('sequelize');module[_0x243b('0x0')]={'name':{'type':Sequelize[_0x243b('0x1')]},'prefix':{'type':Sequelize[_0x243b('0x1')],'unique':_0x243b('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0xe6264){this[_0x243b('0x3')](_0x243b('0x4'),_0xe6264?_0xe6264['join'](''):[]);},'get':function(){return this[_0x243b('0x5')]('options')?this[_0x243b('0x5')](_0x243b('0x4'))[_0x243b('0x6')](''):[];}},'auth':{'type':Sequelize[_0x243b('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x243b('0x1')]},'record':{'type':Sequelize[_0x243b('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x243b('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 324eefb..68b730a 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 _0x684c=['includeAll','rows','params','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','ChanSpies','UserProfileResource','then','error','name','send','index','map','VoiceChanSpy','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options'];(function(_0x432465,_0x30ce18){var _0x589592=function(_0x21e15c){while(--_0x21e15c){_0x432465['push'](_0x432465['shift']());}};_0x589592(++_0x30ce18);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc684('0x0'));var rimraf=require(_0xc684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc684('0x2'));var rp=require(_0xc684('0x3'));var moment=require(_0xc684('0x4'));var BPromise=require(_0xc684('0x5'));var Mustache=require(_0xc684('0x6'));var util=require('util');var path=require(_0xc684('0x7'));var sox=require(_0xc684('0x8'));var csv=require(_0xc684('0x9'));var ejs=require(_0xc684('0xa'));var fs=require('fs');var fs_extra=require(_0xc684('0xb'));var _=require(_0xc684('0xc'));var squel=require(_0xc684('0xd'));var crypto=require(_0xc684('0xe'));var jsforce=require(_0xc684('0xf'));var deskjs=require(_0xc684('0x10'));var toCsv=require(_0xc684('0x9'));var querystring=require(_0xc684('0x11'));var Papa=require(_0xc684('0x12'));var Redis=require(_0xc684('0x13'));var authService=require(_0xc684('0x14'));var qs=require(_0xc684('0x15'));var as=require(_0xc684('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc684('0x17'))(_0xc684('0x18'));var utils=require(_0xc684('0x19'));var config=require(_0xc684('0x1a'));var licenseUtil=require(_0xc684('0x1b'));var db=require(_0xc684('0x1c'))['db'];function respondWithStatusCode(_0x4f3ff9,_0x3004a6){_0x3004a6=_0x3004a6||0xcc;return function(_0x10cc25){if(_0x10cc25){return _0x4f3ff9['sendStatus'](_0x3004a6);}return _0x4f3ff9['status'](_0x3004a6)[_0xc684('0x1d')]();};}function respondWithResult(_0x34cfd7,_0x32d5da){_0x32d5da=_0x32d5da||0xc8;return function(_0x2ad4f1){if(_0x2ad4f1){return _0x34cfd7[_0xc684('0x1e')](_0x32d5da)[_0xc684('0x1f')](_0x2ad4f1);}};}function respondWithFilteredResult(_0x4f26f7,_0x56d76f){return function(_0x43235d){if(_0x43235d){var _0x599c93=typeof _0x56d76f['offset']==='undefined'&&typeof _0x56d76f['limit']==='undefined';var _0x264cb5=_0x43235d[_0xc684('0x20')];var _0x3b6f5e=_0x599c93?0x0:_0x56d76f[_0xc684('0x21')];var _0x1c3af5=_0x599c93?_0x43235d['count']:_0x56d76f[_0xc684('0x21')]+_0x56d76f[_0xc684('0x22')];var _0x4afdd0;if(_0x1c3af5>=_0x264cb5){_0x1c3af5=_0x264cb5;_0x4afdd0=0xc8;}else{_0x4afdd0=0xce;}_0x4f26f7[_0xc684('0x1e')](_0x4afdd0);return _0x4f26f7[_0xc684('0x23')](_0xc684('0x24'),_0x3b6f5e+'-'+_0x1c3af5+'/'+_0x264cb5)['json'](_0x43235d);}return null;};}function patchUpdates(_0x62c4e5){return function(_0x11a159){try{jsonpatch[_0xc684('0x25')](_0x11a159,_0x62c4e5,!![]);}catch(_0xe7aadb){return BPromise[_0xc684('0x26')](_0xe7aadb);}return _0x11a159['save']();};}function saveUpdates(_0x13d43f,_0x39f39a){return function(_0x1fb8b0){if(_0x1fb8b0){return _0x1fb8b0['update'](_0x13d43f)['then'](function(_0x5a7b2e){return _0x5a7b2e;});}return null;};}function removeEntity(_0x41162b,_0x15ce5d){return function(_0xd2a943){if(_0xd2a943){return _0xd2a943['destroy']()['then'](function(){var _0x4e68e0=_0xd2a943['get']({'plain':!![]});var _0x27c7cc=_0xc684('0x27');return db[_0xc684('0x28')]['destroy']({'where':{'type':_0x27c7cc,'resourceId':_0x4e68e0['id']}})[_0xc684('0x29')](function(){return _0xd2a943;});})['then'](function(){_0x41162b[_0xc684('0x1e')](0xcc)[_0xc684('0x1d')]();});}};}function handleEntityNotFound(_0x13e09d,_0x49dad1){return function(_0x1f8e85){if(!_0x1f8e85){_0x13e09d['sendStatus'](0x194);}return _0x1f8e85;};}function handleError(_0x279998,_0x640ca1){_0x640ca1=_0x640ca1||0x1f4;return function(_0x210dcd){logger[_0xc684('0x2a')](_0x210dcd['stack']);if(_0x210dcd[_0xc684('0x2b')]){delete _0x210dcd[_0xc684('0x2b')];}_0x279998[_0xc684('0x1e')](_0x640ca1)[_0xc684('0x2c')](_0x210dcd);};}exports[_0xc684('0x2d')]=function(_0x1e029c,_0x10db0d){var _0x3abd2d={},_0x4df4d4={},_0x5c47ab={'count':0x0,'rows':[]};var _0x4e1d09=_[_0xc684('0x2e')](db[_0xc684('0x2f')]['rawAttributes'],function(_0x4e46c2){return{'name':_0x4e46c2[_0xc684('0x30')],'type':_0x4e46c2['type'][_0xc684('0x31')]};});_0x4df4d4[_0xc684('0x32')]=_[_0xc684('0x2e')](_0x4e1d09,'name');_0x4df4d4['query']=_[_0xc684('0x33')](_0x1e029c[_0xc684('0x34')]);_0x4df4d4['filters']=_['intersection'](_0x4df4d4[_0xc684('0x32')],_0x4df4d4[_0xc684('0x34')]);_0x3abd2d[_0xc684('0x35')]=_[_0xc684('0x36')](_0x4df4d4[_0xc684('0x32')],qs[_0xc684('0x37')](_0x1e029c['query'][_0xc684('0x37')]));_0x3abd2d['attributes']=_0x3abd2d['attributes'][_0xc684('0x38')]?_0x3abd2d[_0xc684('0x35')]:_0x4df4d4['model'];if(!_0x1e029c['query'][_0xc684('0x39')](_0xc684('0x3a'))){_0x3abd2d[_0xc684('0x22')]=qs[_0xc684('0x22')](_0x1e029c[_0xc684('0x34')]['limit']);_0x3abd2d[_0xc684('0x21')]=qs[_0xc684('0x21')](_0x1e029c['query']['offset']);}_0x3abd2d[_0xc684('0x3b')]=qs[_0xc684('0x3c')](_0x1e029c[_0xc684('0x34')][_0xc684('0x3c')]);_0x3abd2d[_0xc684('0x3d')]=qs[_0xc684('0x3e')](_[_0xc684('0x3f')](_0x1e029c['query'],_0x4df4d4['filters']),_0x4e1d09);if(_0x1e029c[_0xc684('0x34')][_0xc684('0x40')]){_0x3abd2d['where']=_['merge'](_0x3abd2d['where'],{'$or':_[_0xc684('0x2e')](_0x4e1d09,function(_0x4a9320){if(_0x4a9320[_0xc684('0x41')]!==_0xc684('0x42')){var _0x2649ee={};_0x2649ee[_0x4a9320['name']]={'$like':'%'+_0x1e029c[_0xc684('0x34')]['filter']+'%'};return _0x2649ee;}})});}_0x3abd2d=_[_0xc684('0x43')]({},_0x3abd2d,_0x1e029c[_0xc684('0x44')]);var _0x380e7c={'where':_0x3abd2d[_0xc684('0x3d')]};return db['VoiceChanSpy'][_0xc684('0x20')](_0x380e7c)[_0xc684('0x29')](function(_0xd9eae7){_0x5c47ab[_0xc684('0x20')]=_0xd9eae7;if(_0x1e029c[_0xc684('0x34')][_0xc684('0x45')]){_0x3abd2d['include']=[{'all':!![]}];}return db[_0xc684('0x2f')]['findAll'](_0x3abd2d);})['then'](function(_0x46c6ad){_0x5c47ab[_0xc684('0x46')]=_0x46c6ad;return _0x5c47ab;})[_0xc684('0x29')](respondWithFilteredResult(_0x10db0d,_0x3abd2d))['catch'](handleError(_0x10db0d,null));};exports['show']=function(_0x4f288b,_0x4ebd3e){var _0x4d0586={'raw':![],'where':{'id':_0x4f288b[_0xc684('0x47')]['id']}},_0x189b26={};_0x189b26[_0xc684('0x32')]=_['keys'](db[_0xc684('0x2f')]['rawAttributes']);_0x189b26[_0xc684('0x34')]=_['keys'](_0x4f288b[_0xc684('0x34')]);_0x189b26[_0xc684('0x3e')]=_[_0xc684('0x36')](_0x189b26[_0xc684('0x32')],_0x189b26[_0xc684('0x34')]);_0x4d0586['attributes']=_[_0xc684('0x36')](_0x189b26[_0xc684('0x32')],qs[_0xc684('0x37')](_0x4f288b[_0xc684('0x34')][_0xc684('0x37')]));_0x4d0586[_0xc684('0x35')]=_0x4d0586[_0xc684('0x35')][_0xc684('0x38')]?_0x4d0586[_0xc684('0x35')]:_0x189b26['model'];if(_0x4f288b[_0xc684('0x34')][_0xc684('0x45')]){_0x4d0586['include']=[{'all':!![]}];}_0x4d0586=_[_0xc684('0x43')]({},_0x4d0586,_0x4f288b['options']);return db[_0xc684('0x2f')]['find'](_0x4d0586)[_0xc684('0x29')](handleEntityNotFound(_0x4ebd3e,null))[_0xc684('0x29')](respondWithResult(_0x4ebd3e,null))[_0xc684('0x48')](handleError(_0x4ebd3e,null));};exports[_0xc684('0x49')]=function(_0x1bfd8d,_0x1fde57){return db[_0xc684('0x2f')][_0xc684('0x49')](_0x1bfd8d[_0xc684('0x4a')],{})[_0xc684('0x29')](function(_0x4abd04){var _0x16951f=_0x1bfd8d[_0xc684('0x4b')]['get']({'plain':!![]});if(!_0x16951f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16951f['role']===_0xc684('0x4b')){var _0x1304a2=_0x4abd04[_0xc684('0x4c')]({'plain':!![]});var _0x34b2cd=_0xc684('0x27');return db[_0xc684('0x4d')]['find']({'where':{'name':_0x34b2cd,'userProfileId':_0x16951f[_0xc684('0x4e')]},'raw':!![]})[_0xc684('0x29')](function(_0x16f039){if(_0x16f039&&_0x16f039[_0xc684('0x4f')]===0x0){return db[_0xc684('0x28')]['create']({'name':_0x1304a2[_0xc684('0x2b')],'resourceId':_0x1304a2['id'],'type':_0x16f039[_0xc684('0x2b')],'sectionId':_0x16f039['id']},{})['then'](function(){return _0x4abd04;});}else{return _0x4abd04;}})[_0xc684('0x48')](function(_0x7af88c){logger[_0xc684('0x2a')](_0xc684('0x50'),_0x7af88c);throw _0x7af88c;});}return _0x4abd04;})[_0xc684('0x29')](respondWithResult(_0x1fde57,0xc9))['catch'](handleError(_0x1fde57,null));};exports[_0xc684('0x51')]=function(_0x4d3484,_0x3c6f05){if(_0x4d3484[_0xc684('0x4a')]['id']){delete _0x4d3484[_0xc684('0x4a')]['id'];}return db[_0xc684('0x2f')][_0xc684('0x52')]({'where':{'id':_0x4d3484[_0xc684('0x47')]['id']}})[_0xc684('0x29')](handleEntityNotFound(_0x3c6f05,null))[_0xc684('0x29')](saveUpdates(_0x4d3484[_0xc684('0x4a')],null))['then'](respondWithResult(_0x3c6f05,null))['catch'](handleError(_0x3c6f05,null));};exports[_0xc684('0x53')]=function(_0x49218e,_0x2b2d54){return db['VoiceChanSpy']['find']({'where':{'id':_0x49218e[_0xc684('0x47')]['id']}})[_0xc684('0x29')](handleEntityNotFound(_0x2b2d54,null))[_0xc684('0x29')](removeEntity(_0x2b2d54,null))[_0xc684('0x48')](handleError(_0x2b2d54,null));}; \ No newline at end of file +var _0xcf14=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x32fe22,_0x5287d6){var _0x319ba7=function(_0x4a6704){while(--_0x4a6704){_0x32fe22['push'](_0x32fe22['shift']());}};_0x319ba7(++_0x5287d6);}(_0xcf14,0xa1));var _0x4cf1=function(_0x5c98fb,_0x124d25){_0x5c98fb=_0x5c98fb-0x0;var _0x1f1221=_0xcf14[_0x5c98fb];return _0x1f1221;};'use strict';var emlformat=require(_0x4cf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4cf1('0x1'));var jsonpatch=require(_0x4cf1('0x2'));var rp=require('request-promise');var moment=require(_0x4cf1('0x3'));var BPromise=require(_0x4cf1('0x4'));var Mustache=require(_0x4cf1('0x5'));var util=require(_0x4cf1('0x6'));var path=require('path');var sox=require(_0x4cf1('0x7'));var csv=require(_0x4cf1('0x8'));var ejs=require(_0x4cf1('0x9'));var fs=require('fs');var fs_extra=require(_0x4cf1('0xa'));var _=require(_0x4cf1('0xb'));var squel=require(_0x4cf1('0xc'));var crypto=require(_0x4cf1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4cf1('0xe'));var toCsv=require(_0x4cf1('0x8'));var querystring=require(_0x4cf1('0xf'));var Papa=require(_0x4cf1('0x10'));var Redis=require(_0x4cf1('0x11'));var authService=require(_0x4cf1('0x12'));var qs=require(_0x4cf1('0x13'));var as=require(_0x4cf1('0x14'));var hardwareService=require(_0x4cf1('0x15'));var logger=require(_0x4cf1('0x16'))(_0x4cf1('0x17'));var utils=require(_0x4cf1('0x18'));var config=require(_0x4cf1('0x19'));var licenseUtil=require(_0x4cf1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cee57,_0x5622dc){_0x5622dc=_0x5622dc||0xcc;return function(_0x1ae8fb){if(_0x1ae8fb){return _0x3cee57[_0x4cf1('0x1b')](_0x5622dc);}return _0x3cee57[_0x4cf1('0x1c')](_0x5622dc)[_0x4cf1('0x1d')]();};}function respondWithResult(_0x10abde,_0x3f365c){_0x3f365c=_0x3f365c||0xc8;return function(_0x25f091){if(_0x25f091){return _0x10abde[_0x4cf1('0x1c')](_0x3f365c)[_0x4cf1('0x1e')](_0x25f091);}};}function respondWithFilteredResult(_0xec2510,_0xcfa115){return function(_0x2a8cf7){if(_0x2a8cf7){var _0xe257a5=typeof _0xcfa115['offset']===_0x4cf1('0x1f')&&typeof _0xcfa115['limit']===_0x4cf1('0x1f');var _0x3c485a=_0x2a8cf7[_0x4cf1('0x20')];var _0x1f20c0=_0xe257a5?0x0:_0xcfa115[_0x4cf1('0x21')];var _0x48d35a=_0xe257a5?_0x2a8cf7[_0x4cf1('0x20')]:_0xcfa115[_0x4cf1('0x21')]+_0xcfa115[_0x4cf1('0x22')];var _0x4557e0;if(_0x48d35a>=_0x3c485a){_0x48d35a=_0x3c485a;_0x4557e0=0xc8;}else{_0x4557e0=0xce;}_0xec2510['status'](_0x4557e0);return _0xec2510['set'](_0x4cf1('0x23'),_0x1f20c0+'-'+_0x48d35a+'/'+_0x3c485a)[_0x4cf1('0x1e')](_0x2a8cf7);}return null;};}function patchUpdates(_0x5603ae){return function(_0x85885a){try{jsonpatch[_0x4cf1('0x24')](_0x85885a,_0x5603ae,!![]);}catch(_0x3cc036){return BPromise[_0x4cf1('0x25')](_0x3cc036);}return _0x85885a['save']();};}function saveUpdates(_0x3469ac,_0x158000){return function(_0x2338c3){if(_0x2338c3){return _0x2338c3[_0x4cf1('0x26')](_0x3469ac)[_0x4cf1('0x27')](function(_0x2945b4){return _0x2945b4;});}return null;};}function removeEntity(_0x4f14a0,_0x351ccc){return function(_0x5bb535){if(_0x5bb535){return _0x5bb535[_0x4cf1('0x28')]()[_0x4cf1('0x27')](function(){var _0x1b0ad4=_0x5bb535[_0x4cf1('0x29')]({'plain':!![]});var _0x389575=_0x4cf1('0x2a');return db[_0x4cf1('0x2b')][_0x4cf1('0x28')]({'where':{'type':_0x389575,'resourceId':_0x1b0ad4['id']}})[_0x4cf1('0x27')](function(){return _0x5bb535;});})[_0x4cf1('0x27')](function(){_0x4f14a0[_0x4cf1('0x1c')](0xcc)[_0x4cf1('0x1d')]();});}};}function handleEntityNotFound(_0x2a17ce,_0x4bcd78){return function(_0x4498b5){if(!_0x4498b5){_0x2a17ce[_0x4cf1('0x1b')](0x194);}return _0x4498b5;};}function handleError(_0x20d9d9,_0x1c7c9c){_0x1c7c9c=_0x1c7c9c||0x1f4;return function(_0x4348d0){logger[_0x4cf1('0x2c')](_0x4348d0[_0x4cf1('0x2d')]);if(_0x4348d0[_0x4cf1('0x2e')]){delete _0x4348d0[_0x4cf1('0x2e')];}_0x20d9d9[_0x4cf1('0x1c')](_0x1c7c9c)[_0x4cf1('0x2f')](_0x4348d0);};}exports['index']=function(_0x18232e,_0x167da0){var _0x59ea9f={},_0x2c8c92={},_0x54adfa={'count':0x0,'rows':[]};var _0x29f111=_[_0x4cf1('0x30')](db[_0x4cf1('0x31')][_0x4cf1('0x32')],function(_0x483f48){return{'name':_0x483f48[_0x4cf1('0x33')],'type':_0x483f48['type'][_0x4cf1('0x34')]};});_0x2c8c92[_0x4cf1('0x35')]=_[_0x4cf1('0x30')](_0x29f111,_0x4cf1('0x2e'));_0x2c8c92[_0x4cf1('0x36')]=_['keys'](_0x18232e[_0x4cf1('0x36')]);_0x2c8c92['filters']=_['intersection'](_0x2c8c92['model'],_0x2c8c92[_0x4cf1('0x36')]);_0x59ea9f[_0x4cf1('0x37')]=_[_0x4cf1('0x38')](_0x2c8c92[_0x4cf1('0x35')],qs[_0x4cf1('0x39')](_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x39')]));_0x59ea9f[_0x4cf1('0x37')]=_0x59ea9f['attributes']['length']?_0x59ea9f['attributes']:_0x2c8c92[_0x4cf1('0x35')];if(!_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x3a')](_0x4cf1('0x3b'))){_0x59ea9f[_0x4cf1('0x22')]=qs[_0x4cf1('0x22')](_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x22')]);_0x59ea9f[_0x4cf1('0x21')]=qs[_0x4cf1('0x21')](_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x21')]);}_0x59ea9f[_0x4cf1('0x3c')]=qs['sort'](_0x18232e['query'][_0x4cf1('0x3d')]);_0x59ea9f[_0x4cf1('0x3e')]=qs[_0x4cf1('0x3f')](_[_0x4cf1('0x40')](_0x18232e[_0x4cf1('0x36')],_0x2c8c92[_0x4cf1('0x3f')]),_0x29f111);if(_0x18232e[_0x4cf1('0x36')]['filter']){_0x59ea9f[_0x4cf1('0x3e')]=_[_0x4cf1('0x41')](_0x59ea9f[_0x4cf1('0x3e')],{'$or':_[_0x4cf1('0x30')](_0x29f111,function(_0x2850f7){if(_0x2850f7[_0x4cf1('0x42')]!=='VIRTUAL'){var _0x5348f5={};_0x5348f5[_0x2850f7[_0x4cf1('0x2e')]]={'$like':'%'+_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x43')]+'%'};return _0x5348f5;}})});}_0x59ea9f=_[_0x4cf1('0x41')]({},_0x59ea9f,_0x18232e[_0x4cf1('0x44')]);var _0x43d336={'where':_0x59ea9f[_0x4cf1('0x3e')]};return db[_0x4cf1('0x31')][_0x4cf1('0x20')](_0x43d336)[_0x4cf1('0x27')](function(_0x1a2869){_0x54adfa['count']=_0x1a2869;if(_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x45')]){_0x59ea9f['include']=[{'all':!![]}];}return db[_0x4cf1('0x31')][_0x4cf1('0x46')](_0x59ea9f);})[_0x4cf1('0x27')](function(_0xc2b163){_0x54adfa[_0x4cf1('0x47')]=_0xc2b163;return _0x54adfa;})['then'](respondWithFilteredResult(_0x167da0,_0x59ea9f))[_0x4cf1('0x48')](handleError(_0x167da0,null));};exports['show']=function(_0x5d024c,_0x3d1464){var _0x3fb6ed={'raw':![],'where':{'id':_0x5d024c[_0x4cf1('0x49')]['id']}},_0x17f59e={};_0x17f59e[_0x4cf1('0x35')]=_[_0x4cf1('0x4a')](db[_0x4cf1('0x31')][_0x4cf1('0x32')]);_0x17f59e[_0x4cf1('0x36')]=_[_0x4cf1('0x4a')](_0x5d024c[_0x4cf1('0x36')]);_0x17f59e[_0x4cf1('0x3f')]=_[_0x4cf1('0x38')](_0x17f59e[_0x4cf1('0x35')],_0x17f59e[_0x4cf1('0x36')]);_0x3fb6ed[_0x4cf1('0x37')]=_['intersection'](_0x17f59e[_0x4cf1('0x35')],qs[_0x4cf1('0x39')](_0x5d024c[_0x4cf1('0x36')][_0x4cf1('0x39')]));_0x3fb6ed[_0x4cf1('0x37')]=_0x3fb6ed[_0x4cf1('0x37')][_0x4cf1('0x4b')]?_0x3fb6ed['attributes']:_0x17f59e[_0x4cf1('0x35')];if(_0x5d024c['query'][_0x4cf1('0x45')]){_0x3fb6ed[_0x4cf1('0x4c')]=[{'all':!![]}];}_0x3fb6ed=_[_0x4cf1('0x41')]({},_0x3fb6ed,_0x5d024c[_0x4cf1('0x44')]);return db[_0x4cf1('0x31')][_0x4cf1('0x4d')](_0x3fb6ed)['then'](handleEntityNotFound(_0x3d1464,null))['then'](respondWithResult(_0x3d1464,null))['catch'](handleError(_0x3d1464,null));};exports[_0x4cf1('0x4e')]=function(_0x18e085,_0x1cd038){return db['VoiceChanSpy'][_0x4cf1('0x4e')](_0x18e085[_0x4cf1('0x4f')],{})['then'](function(_0x28a267){var _0x3e3e5d=_0x18e085[_0x4cf1('0x50')][_0x4cf1('0x29')]({'plain':!![]});if(!_0x3e3e5d)throw new Error(_0x4cf1('0x51'));if(_0x3e3e5d['role']===_0x4cf1('0x50')){var _0x1f3c7e=_0x28a267[_0x4cf1('0x29')]({'plain':!![]});var _0x77418c=_0x4cf1('0x2a');return db['UserProfileSection'][_0x4cf1('0x4d')]({'where':{'name':_0x77418c,'userProfileId':_0x3e3e5d[_0x4cf1('0x52')]},'raw':!![]})['then'](function(_0x5b74fc){if(_0x5b74fc&&_0x5b74fc['autoAssociation']===0x0){return db[_0x4cf1('0x2b')][_0x4cf1('0x4e')]({'name':_0x1f3c7e[_0x4cf1('0x2e')],'resourceId':_0x1f3c7e['id'],'type':_0x5b74fc['name'],'sectionId':_0x5b74fc['id']},{})[_0x4cf1('0x27')](function(){return _0x28a267;});}else{return _0x28a267;}})[_0x4cf1('0x48')](function(_0x296065){logger['error'](_0x4cf1('0x53'),_0x296065);throw _0x296065;});}return _0x28a267;})[_0x4cf1('0x27')](respondWithResult(_0x1cd038,0xc9))[_0x4cf1('0x48')](handleError(_0x1cd038,null));};exports[_0x4cf1('0x26')]=function(_0x57dfb3,_0x1105cb){if(_0x57dfb3[_0x4cf1('0x4f')]['id']){delete _0x57dfb3['body']['id'];}return db[_0x4cf1('0x31')][_0x4cf1('0x4d')]({'where':{'id':_0x57dfb3[_0x4cf1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1105cb,null))[_0x4cf1('0x27')](saveUpdates(_0x57dfb3[_0x4cf1('0x4f')],null))[_0x4cf1('0x27')](respondWithResult(_0x1105cb,null))[_0x4cf1('0x48')](handleError(_0x1105cb,null));};exports[_0x4cf1('0x28')]=function(_0x2e93cc,_0x2d161f){return db['VoiceChanSpy']['find']({'where':{'id':_0x2e93cc[_0x4cf1('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d161f,null))[_0x4cf1('0x27')](removeEntity(_0x2d161f,null))[_0x4cf1('0x48')](handleError(_0x2d161f,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 69d6794..f1d7ecf 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 _0x1b38=['record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','options','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy'];(function(_0x33fa11,_0x1c91c0){var _0x5c290f=function(_0x516660){while(--_0x516660){_0x33fa11['push'](_0x33fa11['shift']());}};_0x5c290f(++_0x1c91c0);}(_0x1b38,0x13e));var _0x81b3=function(_0x3fb372,_0x2d9fc4){_0x3fb372=_0x3fb372-0x0;var _0x4d7b70=_0x1b38[_0x3fb372];return _0x4d7b70;};'use strict';var _=require(_0x81b3('0x0'));var util=require(_0x81b3('0x1'));var BPromise=require(_0x81b3('0x2'));var attributes=require(_0x81b3('0x3'));var getUserApplications=function(_0x470dfb,_0x5ee8d1,_0x1f1ea3){var _0x462097=0x1;var _0x14e2a4=[];var _0x4699d0={'context':_0x5ee8d1[_0x81b3('0x4')]||_0x81b3('0x5'),'exten':util[_0x81b3('0x6')](_0x81b3('0x7'),_0x470dfb[_0x81b3('0x8')],_0x1f1ea3),'type':_0x81b3('0x9'),'isApp':![],'ChanSpyId':_0x470dfb['id'],'UserId':_0x5ee8d1['id']};_0x14e2a4[_0x81b3('0xa')](_[_0x81b3('0xb')]({'app':_0x81b3('0xc'),'appdata':util[_0x81b3('0x6')](_0x81b3('0xd'),_0x81b3('0xe')),'priority':_0x462097++},_0x4699d0));if(_0x470dfb[_0x81b3('0xf')]){_0x14e2a4['push'](_[_0x81b3('0xb')]({'app':_0x81b3('0x10'),'appdata':util['format'](_0x81b3('0x11'),_0x470dfb[_0x81b3('0x12')]),'priority':_0x462097++},_0x4699d0));}if(_0x470dfb['auth']){_0x14e2a4[_0x81b3('0xa')](_[_0x81b3('0xb')]({'app':_0x81b3('0x13'),'appdata':_0x470dfb[_0x81b3('0x14')],'priority':_0x462097++},_0x4699d0));}_0x14e2a4['push'](_[_0x81b3('0xb')]({'app':_0x81b3('0x15'),'appdata':util[_0x81b3('0x6')]('SIP/%s,%s',_0x5ee8d1['name'],_0x470dfb['options']?_0x470dfb[_0x81b3('0x16')]['join'](''):''),'priority':_0x462097++},_0x4699d0));if(_0x470dfb[_0x81b3('0xf')]){_0x14e2a4[_0x81b3('0xa')](_[_0x81b3('0xb')]({'app':_0x81b3('0x17'),'priority':_0x462097++},_0x4699d0));}return _0x14e2a4;};var getChanSpyApplications=function(_0xe4bac4,_0x5aa458){var _0x1c71d9=[];for(var _0x4ef03e=0x0,_0x25b00a=0x1;_0x4ef03e<_0x5aa458[_0x81b3('0x18')];_0x4ef03e++,_0x25b00a=0x1){_0x1c71d9=_0x1c71d9[_0x81b3('0x19')](getUserApplications(_0xe4bac4,_0x5aa458[_0x4ef03e],_0x5aa458[_0x4ef03e][_0x81b3('0x1a')]));if(_0x5aa458[_0x4ef03e][_0x81b3('0x1a')]!=_0x5aa458[_0x4ef03e]['name']){_0x1c71d9=_0x1c71d9[_0x81b3('0x19')](getUserApplications(_0xe4bac4,_0x5aa458[_0x4ef03e],_0x5aa458[_0x4ef03e][_0x81b3('0x1b')]));}}return _0x1c71d9;};var getChanSpyPromise=function(_0x4c9e58,_0x53f224){return new BPromise(function(_0x12c251,_0x3c99b2){return _0x4c9e58[_0x81b3('0x1c')][_0x81b3('0x1d')]({'attributes':['id','name','internal'],'where':{'role':_0x81b3('0x1e'),'chanspy':!![]},'raw':!![]})[_0x81b3('0x1f')](function(_0x4a8522){if(_0x4a8522){return _0x12c251(getChanSpyApplications(_0x53f224,_0x4a8522));}return _0x12c251([]);})[_0x81b3('0x20')](function(_0x4b87e3){_0x3c99b2(_0x4b87e3);});});};module['exports']=function(_0x19fc5e,_0x15fc28){var _0x5c63b8=_0x19fc5e['models'];return _0x19fc5e['define'](_0x81b3('0x21'),attributes,{'tableName':_0x81b3('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c3072,_0x2f4ff3,_0x555e2a){return getChanSpyPromise(_0x5c63b8,_0x4c3072)['then'](function(_0x2bf6bd){if(_0x2bf6bd&&_0x2bf6bd[_0x81b3('0x18')]){return _0x5c63b8[_0x81b3('0x23')]['bulkCreate'](_0x2bf6bd);}})[_0x81b3('0x1f')](function(){_0x555e2a();})[_0x81b3('0x20')](function(_0xf05736){_0x555e2a(_0xf05736);});},'afterUpdate':function(_0x53d987,_0x1800c2,_0x3b0537){return _0x5c63b8[_0x81b3('0x23')][_0x81b3('0x24')]({'where':{'ChanSpyId':_0x53d987['id']}})[_0x81b3('0x1f')](function(){return getChanSpyPromise(_0x5c63b8,_0x53d987);})[_0x81b3('0x1f')](function(_0x518c6b){if(_0x518c6b&&_0x518c6b['length']){return _0x5c63b8[_0x81b3('0x23')]['bulkCreate'](_0x518c6b);}})['then'](function(){_0x3b0537();})[_0x81b3('0x20')](function(_0x4ef307){_0x3b0537(_0x4ef307);});},'afterDestroy':function(_0x595ef7,_0x56b5f9,_0x2d0af7){return _0x5c63b8[_0x81b3('0x23')][_0x81b3('0x24')]({'where':{'ChanSpyId':_0x595ef7['id']}})[_0x81b3('0x1f')](function(){_0x2d0af7();})['catch'](function(_0x59774c){_0x2d0af7(_0x59774c);});}}});}; \ No newline at end of file +var _0xb8f9=['util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','catch','destroy','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb8f9,0xe9));var _0x9b8f=function(_0x228394,_0x2bcb15){_0x228394=_0x228394-0x0;var _0x1f4a17=_0xb8f9[_0x228394];return _0x1f4a17;};'use strict';var _=require(_0x9b8f('0x0'));var util=require(_0x9b8f('0x1'));var BPromise=require(_0x9b8f('0x2'));var attributes=require(_0x9b8f('0x3'));var getUserApplications=function(_0x2b3748,_0x3f2df1,_0x4db0e3){var _0x496896=0x1;var _0x27eedc=[];var _0x50b721={'context':_0x3f2df1[_0x9b8f('0x4')]||_0x9b8f('0x5'),'exten':util[_0x9b8f('0x6')](_0x9b8f('0x7'),_0x2b3748[_0x9b8f('0x8')],_0x4db0e3),'type':_0x9b8f('0x9'),'isApp':![],'ChanSpyId':_0x2b3748['id'],'UserId':_0x3f2df1['id']};_0x27eedc[_0x9b8f('0xa')](_[_0x9b8f('0xb')]({'app':'Set','appdata':util[_0x9b8f('0x6')](_0x9b8f('0xc'),'chanspy'),'priority':_0x496896++},_0x50b721));if(_0x2b3748[_0x9b8f('0xd')]){_0x27eedc[_0x9b8f('0xa')](_[_0x9b8f('0xb')]({'app':_0x9b8f('0xe'),'appdata':util[_0x9b8f('0x6')](_0x9b8f('0xf'),_0x2b3748['recordingFormat']),'priority':_0x496896++},_0x50b721));}if(_0x2b3748[_0x9b8f('0x10')]){_0x27eedc[_0x9b8f('0xa')](_['merge']({'app':_0x9b8f('0x11'),'appdata':_0x2b3748[_0x9b8f('0x12')],'priority':_0x496896++},_0x50b721));}_0x27eedc[_0x9b8f('0xa')](_['merge']({'app':_0x9b8f('0x13'),'appdata':util[_0x9b8f('0x6')](_0x9b8f('0x14'),_0x3f2df1['name'],_0x2b3748['options']?_0x2b3748[_0x9b8f('0x15')]['join'](''):''),'priority':_0x496896++},_0x50b721));if(_0x2b3748[_0x9b8f('0xd')]){_0x27eedc[_0x9b8f('0xa')](_['merge']({'app':_0x9b8f('0x16'),'priority':_0x496896++},_0x50b721));}return _0x27eedc;};var getChanSpyApplications=function(_0x1334d5,_0x636d95){var _0x398c3d=[];for(var _0x2094d1=0x0,_0x97c993=0x1;_0x2094d1<_0x636d95[_0x9b8f('0x17')];_0x2094d1++,_0x97c993=0x1){_0x398c3d=_0x398c3d[_0x9b8f('0x18')](getUserApplications(_0x1334d5,_0x636d95[_0x2094d1],_0x636d95[_0x2094d1][_0x9b8f('0x19')]));if(_0x636d95[_0x2094d1][_0x9b8f('0x19')]!=_0x636d95[_0x2094d1]['name']){_0x398c3d=_0x398c3d['concat'](getUserApplications(_0x1334d5,_0x636d95[_0x2094d1],_0x636d95[_0x2094d1][_0x9b8f('0x1a')]));}}return _0x398c3d;};var getChanSpyPromise=function(_0x48d3ea,_0x327316){return new BPromise(function(_0x1de491,_0x2e25f2){return _0x48d3ea[_0x9b8f('0x1b')][_0x9b8f('0x1c')]({'attributes':['id',_0x9b8f('0x1a'),_0x9b8f('0x19')],'where':{'role':_0x9b8f('0x1d'),'chanspy':!![]},'raw':!![]})[_0x9b8f('0x1e')](function(_0x3dec7a){if(_0x3dec7a){return _0x1de491(getChanSpyApplications(_0x327316,_0x3dec7a));}return _0x1de491([]);})['catch'](function(_0x23aabe){_0x2e25f2(_0x23aabe);});});};module[_0x9b8f('0x1f')]=function(_0x5e9484,_0x45a131){var _0x139377=_0x5e9484[_0x9b8f('0x20')];return _0x5e9484[_0x9b8f('0x21')](_0x9b8f('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x179265,_0x3dcd0b,_0x58e3dd){return getChanSpyPromise(_0x139377,_0x179265)[_0x9b8f('0x1e')](function(_0x5656cc){if(_0x5656cc&&_0x5656cc[_0x9b8f('0x17')]){return _0x139377[_0x9b8f('0x23')][_0x9b8f('0x24')](_0x5656cc);}})[_0x9b8f('0x1e')](function(){_0x58e3dd();})[_0x9b8f('0x25')](function(_0x276418){_0x58e3dd(_0x276418);});},'afterUpdate':function(_0x3411ff,_0x4e49ff,_0x11206c){return _0x139377[_0x9b8f('0x23')][_0x9b8f('0x26')]({'where':{'ChanSpyId':_0x3411ff['id']}})[_0x9b8f('0x1e')](function(){return getChanSpyPromise(_0x139377,_0x3411ff);})[_0x9b8f('0x1e')](function(_0x44ed7f){if(_0x44ed7f&&_0x44ed7f[_0x9b8f('0x17')]){return _0x139377[_0x9b8f('0x23')][_0x9b8f('0x24')](_0x44ed7f);}})[_0x9b8f('0x1e')](function(){_0x11206c();})[_0x9b8f('0x25')](function(_0x23c6b2){_0x11206c(_0x23c6b2);});},'afterDestroy':function(_0x54e247,_0xdd379c,_0x5dcc8e){return _0x139377['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x54e247['id']}})['then'](function(){_0x5dcc8e();})[_0x9b8f('0x25')](function(_0x1272dd){_0x5dcc8e(_0x1272dd);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a0d2aed..5770fe0 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 _0x593e=['then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x59bde3,_0x22752f){var _0x326574=function(_0x45bb19){while(--_0x45bb19){_0x59bde3['push'](_0x59bde3['shift']());}};_0x326574(++_0x22752f);}(_0x593e,0xcb));var _0xe593=function(_0x3c65ff,_0x40b129){_0x3c65ff=_0x3c65ff-0x0;var _0x1bb362=_0x593e[_0x3c65ff];return _0x1bb362;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cff3,_0x1cda29,_0x307dad){return new BPromise(function(_0x169c08,_0x265099){return client['request'](_0x14cff3,_0x307dad)[_0xe593('0xd')](function(_0x4091db){logger[_0xe593('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,'request\x20sent');logger[_0xe593('0xf')](_0xe593('0x10'),_0x1cda29,_0xe593('0x11'),JSON['stringify'](_0x4091db));if(_0x4091db[_0xe593('0x12')]){if(_0x4091db[_0xe593('0x12')][_0xe593('0x13')]===0x1f4){logger[_0xe593('0x12')](_0xe593('0x14'),_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x265099(_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);}logger[_0xe593('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0x4091db[_0xe593('0x12')][_0xe593('0x15')]);return _0x169c08(_0x4091db['error'][_0xe593('0x15')]);}else{logger[_0xe593('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0xe593('0x11'));_0x169c08(_0x4091db[_0xe593('0x16')][_0xe593('0x15')]);}})[_0xe593('0x17')](function(_0x3408ec){logger[_0xe593('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x1cda29,_0x3408ec);_0x265099(_0x3408ec);});});} \ No newline at end of file +var _0x49e9=['stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x3b7fe3,_0x4e88da){var _0x554c89=function(_0xfe22cb){while(--_0xfe22cb){_0x3b7fe3['push'](_0x3b7fe3['shift']());}};_0x554c89(++_0x4e88da);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 25c5a89..c092042 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 _0x3a21=['index','show','post','create','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x3a21,0x15e));var _0x13a2=function(_0x5ae361,_0x3eca7c){_0x5ae361=_0x5ae361-0x0;var _0x4da594=_0x3a21[_0x5ae361];return _0x4da594;};'use strict';var multer=require(_0x13a2('0x0'));var util=require(_0x13a2('0x1'));var path=require(_0x13a2('0x2'));var timeout=require('connect-timeout');var express=require(_0x13a2('0x3'));var router=express[_0x13a2('0x4')]();var fs_extra=require(_0x13a2('0x5'));var auth=require(_0x13a2('0x6'));var interaction=require(_0x13a2('0x7'));var config=require(_0x13a2('0x8'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x13a2('0x9')](),controller[_0x13a2('0xa')]);router['get']('/:id',auth[_0x13a2('0x9')](),controller[_0x13a2('0xb')]);router[_0x13a2('0xc')]('/',auth[_0x13a2('0x9')](),controller[_0x13a2('0xd')]);router['put']('/:id',auth[_0x13a2('0x9')](),controller['update']);router[_0x13a2('0xe')](_0x13a2('0xf'),auth['isAuthenticated'](),controller[_0x13a2('0x10')]);module[_0x13a2('0x11')]=router; \ No newline at end of file +var _0x6233=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','post','create','put','/:id','destroy','exports','multer'];(function(_0x5206c8,_0x41b3a4){var _0x5e0abe=function(_0x1ef8a3){while(--_0x1ef8a3){_0x5206c8['push'](_0x5206c8['shift']());}};_0x5e0abe(++_0x41b3a4);}(_0x6233,0xc5));var _0x3623=function(_0x7d1fe4,_0x5aa052){_0x7d1fe4=_0x7d1fe4-0x0;var _0x2cab32=_0x6233[_0x7d1fe4];return _0x2cab32;};'use strict';var multer=require(_0x3623('0x0'));var util=require(_0x3623('0x1'));var path=require('path');var timeout=require(_0x3623('0x2'));var express=require(_0x3623('0x3'));var router=express[_0x3623('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3623('0x5'));var interaction=require(_0x3623('0x6'));var config=require(_0x3623('0x7'));var controller=require(_0x3623('0x8'));router[_0x3623('0x9')]('/',auth[_0x3623('0xa')](),controller[_0x3623('0xb')]);router[_0x3623('0x9')]('/:id',auth[_0x3623('0xa')](),controller['show']);router[_0x3623('0xc')]('/',auth[_0x3623('0xa')](),controller[_0x3623('0xd')]);router[_0x3623('0xe')](_0x3623('0xf'),auth[_0x3623('0xa')](),controller['update']);router['delete'](_0x3623('0xf'),auth[_0x3623('0xa')](),controller[_0x3623('0x10')]);module[_0x3623('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 463cfe6..f7fd1fe 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 _0x453d=['BOOLEAN','sequelize','STRING'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x453d,0x1cc));var _0xd453=function(_0x2dcc0d,_0x38061e){_0x2dcc0d=_0x2dcc0d-0x0;var _0x22c783=_0x453d[_0x2dcc0d];return _0x22c783;};'use strict';var Sequelize=require(_0xd453('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xd453('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd453('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4881=['sequelize','exports','STRING','name'];(function(_0x153d2f,_0x51f894){var _0x269a22=function(_0x440a44){while(--_0x440a44){_0x153d2f['push'](_0x153d2f['shift']());}};_0x269a22(++_0x51f894);}(_0x4881,0x98));var _0x1488=function(_0x42e07f,_0x393196){_0x42e07f=_0x42e07f-0x0;var _0x358915=_0x4881[_0x42e07f];return _0x358915;};'use strict';var Sequelize=require(_0x1488('0x0'));module[_0x1488('0x1')]={'name':{'type':Sequelize[_0x1488('0x2')],'unique':_0x1488('0x3')},'description':{'type':Sequelize[_0x1488('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 4b100e2..f6b12ed 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 _0x4043=['message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','create','body','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','join','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x1b3a72,_0x3a1f98){var _0x8b247f=function(_0x17cc35){while(--_0x17cc35){_0x1b3a72['push'](_0x1b3a72['shift']());}};_0x8b247f(++_0x3a1f98);}(_0x4043,0x1f3));var _0x3404=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4043[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3404('0x0'));var rimraf=require(_0x3404('0x1'));var zipdir=require(_0x3404('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3404('0x3'));var BPromise=require(_0x3404('0x4'));var Mustache=require(_0x3404('0x5'));var util=require(_0x3404('0x6'));var path=require(_0x3404('0x7'));var sox=require(_0x3404('0x8'));var csv=require('to-csv');var ejs=require(_0x3404('0x9'));var fs=require('fs');var fs_extra=require(_0x3404('0xa'));var _=require('lodash');var squel=require(_0x3404('0xb'));var crypto=require(_0x3404('0xc'));var jsforce=require(_0x3404('0xd'));var deskjs=require(_0x3404('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3404('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3404('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3404('0x11'));var logger=require(_0x3404('0x12'))(_0x3404('0x13'));var utils=require(_0x3404('0x14'));var config=require(_0x3404('0x15'));var licenseUtil=require(_0x3404('0x16'));var db=require(_0x3404('0x17'))['db'];var jayson=require(_0x3404('0x18'));var client=jayson[_0x3404('0x19')][_0x3404('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2e7aeb,_0x4a8df1,_0x47f938,_0x1aaaa3){return new BPromise(function(_0x850a4,_0x2267e5){var _0x3a3968=_0x1aaaa3||client;return _0x3a3968[_0x3404('0x1b')](_0x2e7aeb,_0x47f938)[_0x3404('0x1c')](function(_0x51917e){logger[_0x3404('0x1d')](_0x3404('0x1e'),_0x4a8df1,_0x3404('0x1f'));logger[_0x3404('0x20')](_0x3404('0x21'),_0x4a8df1,_0x3404('0x1f'),JSON['stringify'](_0x51917e));if(_0x51917e['error']){if(_0x51917e['error'][_0x3404('0x22')]===0x1f4){logger[_0x3404('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4a8df1,_0x51917e[_0x3404('0x23')][_0x3404('0x24')]);return _0x2267e5(_0x51917e[_0x3404('0x23')][_0x3404('0x24')]);}logger[_0x3404('0x23')](_0x3404('0x1e'),_0x4a8df1,_0x51917e[_0x3404('0x23')][_0x3404('0x24')]);return _0x850a4(_0x51917e['error']['message']);}else{logger[_0x3404('0x1d')](_0x3404('0x1e'),_0x4a8df1,'request\x20sent');_0x850a4(_0x51917e[_0x3404('0x25')][_0x3404('0x24')]);}})[_0x3404('0x26')](function(_0x41927f){logger[_0x3404('0x23')](_0x3404('0x1e'),_0x4a8df1,_0x41927f);_0x2267e5(_0x41927f);});});}function respondWithStatusCode(_0x3358dd,_0x7a8559){_0x7a8559=_0x7a8559||0xcc;return function(_0x419b25){if(_0x419b25){return _0x3358dd[_0x3404('0x27')](_0x7a8559);}return _0x3358dd[_0x3404('0x28')](_0x7a8559)[_0x3404('0x29')]();};}function respondWithResult(_0x130319,_0x588089){_0x588089=_0x588089||0xc8;return function(_0x390ef9){if(_0x390ef9){return _0x130319[_0x3404('0x28')](_0x588089)[_0x3404('0x2a')](_0x390ef9);}};}function respondWithFilteredResult(_0x553603,_0x4ebf61){return function(_0x21f4cc){if(_0x21f4cc){var _0x169c05=typeof _0x4ebf61['offset']==='undefined'&&typeof _0x4ebf61[_0x3404('0x2b')]===_0x3404('0x2c');var _0x575105=_0x21f4cc[_0x3404('0x2d')];var _0x2941da=_0x169c05?0x0:_0x4ebf61[_0x3404('0x2e')];var _0x81e1f4=_0x169c05?_0x21f4cc[_0x3404('0x2d')]:_0x4ebf61[_0x3404('0x2e')]+_0x4ebf61[_0x3404('0x2b')];var _0x4ba380;if(_0x81e1f4>=_0x575105){_0x81e1f4=_0x575105;_0x4ba380=0xc8;}else{_0x4ba380=0xce;}_0x553603[_0x3404('0x28')](_0x4ba380);return _0x553603[_0x3404('0x2f')](_0x3404('0x30'),_0x2941da+'-'+_0x81e1f4+'/'+_0x575105)[_0x3404('0x2a')](_0x21f4cc);}return null;};}function patchUpdates(_0x1f45a1){return function(_0x4c5a31){try{jsonpatch['apply'](_0x4c5a31,_0x1f45a1,!![]);}catch(_0x57397f){return BPromise[_0x3404('0x31')](_0x57397f);}return _0x4c5a31[_0x3404('0x32')]();};}function saveUpdates(_0x4d58a8,_0x26e4f1){return function(_0x4e3564){if(_0x4e3564){return _0x4e3564[_0x3404('0x33')](_0x4d58a8)[_0x3404('0x1c')](function(_0x171e44){return _0x171e44;});}return null;};}function removeEntity(_0x2ee3d1,_0x2edd74){return function(_0x375f19){if(_0x375f19){return _0x375f19[_0x3404('0x34')]()[_0x3404('0x1c')](function(){var _0x55508d=_0x375f19[_0x3404('0x35')]({'plain':!![]});var _0x36fedd='Contexts';return db[_0x3404('0x36')][_0x3404('0x34')]({'where':{'type':_0x36fedd,'resourceId':_0x55508d['id']}})[_0x3404('0x1c')](function(){return _0x375f19;});})[_0x3404('0x1c')](function(){_0x2ee3d1[_0x3404('0x28')](0xcc)[_0x3404('0x29')]();});}};}function handleEntityNotFound(_0x149bf3,_0x413cfb){return function(_0x2b30ca){if(!_0x2b30ca){_0x149bf3[_0x3404('0x27')](0x194);}return _0x2b30ca;};}function handleError(_0x27a651,_0x3b9dd2){_0x3b9dd2=_0x3b9dd2||0x1f4;return function(_0x8f3b5f){logger[_0x3404('0x23')](_0x8f3b5f[_0x3404('0x37')]);if(_0x8f3b5f[_0x3404('0x38')]){delete _0x8f3b5f[_0x3404('0x38')];}_0x27a651[_0x3404('0x28')](_0x3b9dd2)[_0x3404('0x39')](_0x8f3b5f);};}exports[_0x3404('0x3a')]=function(_0x58cdf0,_0x2a006f){var _0x2ef3de={},_0x4c41c7={},_0x291dab={'count':0x0,'rows':[]};var _0x45ec77=_[_0x3404('0x3b')](db[_0x3404('0x3c')]['rawAttributes'],function(_0x567ba5){return{'name':_0x567ba5[_0x3404('0x3d')],'type':_0x567ba5[_0x3404('0x3e')][_0x3404('0x3f')]};});_0x4c41c7[_0x3404('0x40')]=_[_0x3404('0x3b')](_0x45ec77,'name');_0x4c41c7[_0x3404('0x41')]=_[_0x3404('0x42')](_0x58cdf0[_0x3404('0x41')]);_0x4c41c7[_0x3404('0x43')]=_['intersection'](_0x4c41c7[_0x3404('0x40')],_0x4c41c7['query']);_0x2ef3de[_0x3404('0x44')]=_['intersection'](_0x4c41c7[_0x3404('0x40')],qs[_0x3404('0x45')](_0x58cdf0[_0x3404('0x41')][_0x3404('0x45')]));_0x2ef3de[_0x3404('0x44')]=_0x2ef3de[_0x3404('0x44')][_0x3404('0x46')]?_0x2ef3de['attributes']:_0x4c41c7[_0x3404('0x40')];if(!_0x58cdf0[_0x3404('0x41')][_0x3404('0x47')](_0x3404('0x48'))){_0x2ef3de['limit']=qs[_0x3404('0x2b')](_0x58cdf0['query'][_0x3404('0x2b')]);_0x2ef3de['offset']=qs[_0x3404('0x2e')](_0x58cdf0[_0x3404('0x41')][_0x3404('0x2e')]);}_0x2ef3de['order']=qs[_0x3404('0x49')](_0x58cdf0[_0x3404('0x41')][_0x3404('0x49')]);_0x2ef3de[_0x3404('0x4a')]=qs[_0x3404('0x43')](_[_0x3404('0x4b')](_0x58cdf0[_0x3404('0x41')],_0x4c41c7[_0x3404('0x43')]),_0x45ec77);if(_0x58cdf0['query'][_0x3404('0x4c')]){_0x2ef3de[_0x3404('0x4a')]=_[_0x3404('0x4d')](_0x2ef3de['where'],{'$or':_[_0x3404('0x3b')](_0x45ec77,function(_0x388f2b){if(_0x388f2b['type']!==_0x3404('0x4e')){var _0x44b2d2={};_0x44b2d2[_0x388f2b['name']]={'$like':'%'+_0x58cdf0[_0x3404('0x41')][_0x3404('0x4c')]+'%'};return _0x44b2d2;}})});}_0x2ef3de=_[_0x3404('0x4d')]({},_0x2ef3de,_0x58cdf0[_0x3404('0x4f')]);var _0x1c28ff={'where':_0x2ef3de[_0x3404('0x4a')]};return db[_0x3404('0x3c')][_0x3404('0x2d')](_0x1c28ff)[_0x3404('0x1c')](function(_0x5ba43c){_0x291dab[_0x3404('0x2d')]=_0x5ba43c;if(_0x58cdf0['query'][_0x3404('0x50')]){_0x2ef3de[_0x3404('0x51')]=[{'all':!![]}];}return db[_0x3404('0x3c')][_0x3404('0x52')](_0x2ef3de);})['then'](function(_0x1ecd51){_0x291dab[_0x3404('0x53')]=_0x1ecd51;return _0x291dab;})[_0x3404('0x1c')](respondWithFilteredResult(_0x2a006f,_0x2ef3de))[_0x3404('0x26')](handleError(_0x2a006f,null));};exports[_0x3404('0x54')]=function(_0x4856ff,_0x1d497c){var _0x1b6810={'raw':![],'where':{'id':_0x4856ff['params']['id']}},_0x5c66ff={};_0x5c66ff[_0x3404('0x40')]=_[_0x3404('0x42')](db[_0x3404('0x3c')]['rawAttributes']);_0x5c66ff['query']=_[_0x3404('0x42')](_0x4856ff[_0x3404('0x41')]);_0x5c66ff['filters']=_[_0x3404('0x55')](_0x5c66ff[_0x3404('0x40')],_0x5c66ff['query']);_0x1b6810[_0x3404('0x44')]=_[_0x3404('0x55')](_0x5c66ff[_0x3404('0x40')],qs[_0x3404('0x45')](_0x4856ff[_0x3404('0x41')]['fields']));_0x1b6810['attributes']=_0x1b6810[_0x3404('0x44')]['length']?_0x1b6810[_0x3404('0x44')]:_0x5c66ff[_0x3404('0x40')];if(_0x4856ff[_0x3404('0x41')][_0x3404('0x50')]){_0x1b6810[_0x3404('0x51')]=[{'all':!![]}];}_0x1b6810=_[_0x3404('0x4d')]({},_0x1b6810,_0x4856ff['options']);return db['VoiceContext'][_0x3404('0x56')](_0x1b6810)[_0x3404('0x1c')](handleEntityNotFound(_0x1d497c,null))[_0x3404('0x1c')](respondWithResult(_0x1d497c,null))[_0x3404('0x26')](handleError(_0x1d497c,null));};exports[_0x3404('0x57')]=function(_0x18090d,_0xf3b766,_0x536f76){var _0x5a8049;return db[_0x3404('0x3c')]['create'](_0x18090d[_0x3404('0x58')],{'raw':!![]})['then'](function(_0x4b6902){_0x5a8049=_0x4b6902;return db[_0x3404('0x3c')][_0x3404('0x52')]({'raw':!![]});})[_0x3404('0x1c')](function(_0x2b92b5){var _0x1b8f43=fs['readFileSync'](path['join'](config[_0x3404('0x59')],_0x3404('0x5a')),'utf8');var _0x5b54a8=ejs[_0x3404('0x5b')](_0x1b8f43,{'contexts':_0x2b92b5||[]});fs[_0x3404('0x5c')](_0x3404('0x5d'),_0x5b54a8);})[_0x3404('0x1c')](function(){return respondWithRpcPromise(_0x3404('0x5e'),_0x3404('0x57'),{'module':_0x3404('0x5f')});})['then'](function(){var _0x2f99c0=_0x18090d['user'][_0x3404('0x35')]({'plain':!![]});if(!_0x2f99c0)throw new Error(_0x3404('0x60'));if(_0x2f99c0[_0x3404('0x61')]===_0x3404('0x62')){var _0x2ae37f=_0x5a8049['get']({'plain':!![]});return db[_0x3404('0x63')][_0x3404('0x56')]({'where':{'name':_0x3404('0x64'),'userProfileId':_0x2f99c0[_0x3404('0x65')]},'raw':!![]})['then'](function(_0x4c21a9){if(_0x4c21a9&&_0x4c21a9[_0x3404('0x66')]===0x0){return db[_0x3404('0x36')][_0x3404('0x57')]({'name':_0x2ae37f[_0x3404('0x38')],'resourceId':_0x2ae37f['id'],'type':_0x4c21a9['name'],'sectionId':_0x4c21a9['id']},{})[_0x3404('0x1c')](function(){return _0x5a8049;});}else{return _0x5a8049;}})[_0x3404('0x26')](function(_0x31e2f1){logger[_0x3404('0x23')](_0x3404('0x67'),_0x31e2f1);throw _0x31e2f1;});}return _0x5a8049;})[_0x3404('0x1c')](respondWithResult(_0xf3b766,0xc9))['catch'](handleError(_0xf3b766,null));};exports['update']=function(_0x5b59b4,_0x205a45,_0x27a3cb){var _0x1b78b3;return db[_0x3404('0x3c')]['find']({'where':{'id':_0x5b59b4[_0x3404('0x68')]['id']}})[_0x3404('0x1c')](handleEntityNotFound(_0x205a45,null))['then'](saveUpdates(_0x5b59b4[_0x3404('0x58')],null))[_0x3404('0x1c')](function(_0x2ea506){if(_0x2ea506){_0x1b78b3=_0x2ea506;return db[_0x3404('0x3c')][_0x3404('0x52')]({'raw':!![]});}})[_0x3404('0x1c')](function(_0x3058c9){var _0x5e58ea=fs['readFileSync'](path['join'](config[_0x3404('0x59')],_0x3404('0x5a')),_0x3404('0x69'));var _0x6b7a66=ejs[_0x3404('0x5b')](_0x5e58ea,{'contexts':_0x3058c9||[]});fs['writeFileSync'](_0x3404('0x5d'),_0x6b7a66);})[_0x3404('0x1c')](function(){return respondWithRpcPromise(_0x3404('0x5e'),_0x3404('0x33'),{'module':'chan_sip.so'});})['then'](function(){return _0x1b78b3;})[_0x3404('0x1c')](respondWithResult(_0x205a45,null))[_0x3404('0x26')](handleError(_0x205a45,null));};exports[_0x3404('0x34')]=function(_0x412e05,_0x304d05,_0x126d58){var _0x24bab4;return db[_0x3404('0x3c')][_0x3404('0x56')]({'where':{'id':_0x412e05[_0x3404('0x68')]['id']}})[_0x3404('0x1c')](handleEntityNotFound(_0x304d05,null))[_0x3404('0x1c')](removeEntity(_0x304d05,null))[_0x3404('0x1c')](function(){return db['VoiceContext'][_0x3404('0x52')]({'raw':!![]});})['then'](function(_0x266f40){var _0x2ba3b2=fs['readFileSync'](path[_0x3404('0x6a')](config[_0x3404('0x59')],_0x3404('0x5a')),'utf8');var _0xac0cff=ejs['render'](_0x2ba3b2,{'contexts':_0x266f40});fs[_0x3404('0x5c')](_0x3404('0x5d'),_0xac0cff);return respondWithRpcPromise(_0x3404('0x5e'),_0x3404('0x34'),{'module':_0x3404('0x5f')});})[_0x3404('0x26')](handleError(_0x304d05,null));}; \ No newline at end of file +var _0x0449=['/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Reload','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','Contexts','UserProfileResource','end','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','limit','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','params','length','include','find','create','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync'];(function(_0x18496e,_0x4ca16e){var _0x5ec01f=function(_0x527b82){while(--_0x527b82){_0x18496e['push'](_0x18496e['shift']());}};_0x5ec01f(++_0x4ca16e);}(_0x0449,0x18b));var _0x9044=function(_0x3d3a9c,_0x33f233){_0x3d3a9c=_0x3d3a9c-0x0;var _0x424f00=_0x0449[_0x3d3a9c];return _0x424f00;};'use strict';var emlformat=require(_0x9044('0x0'));var rimraf=require(_0x9044('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9044('0x2'));var rp=require(_0x9044('0x3'));var moment=require('moment');var BPromise=require(_0x9044('0x4'));var Mustache=require(_0x9044('0x5'));var util=require('util');var path=require(_0x9044('0x6'));var sox=require(_0x9044('0x7'));var csv=require(_0x9044('0x8'));var ejs=require(_0x9044('0x9'));var fs=require('fs');var fs_extra=require(_0x9044('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9044('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9044('0xc'));var Papa=require(_0x9044('0xd'));var Redis=require(_0x9044('0xe'));var authService=require(_0x9044('0xf'));var qs=require(_0x9044('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9044('0x11'));var logger=require('../../config/logger')(_0x9044('0x12'));var utils=require('../../config/utils');var config=require(_0x9044('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x9044('0x14'));var client=jayson[_0x9044('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d4148,_0x51add1,_0x421cb5,_0x4595fb){return new BPromise(function(_0x3b065d,_0x3170ad){var _0x45f96d=_0x4595fb||client;return _0x45f96d['request'](_0x2d4148,_0x421cb5)[_0x9044('0x16')](function(_0x374a74){logger[_0x9044('0x17')](_0x9044('0x18'),_0x51add1,_0x9044('0x19'));logger['debug'](_0x9044('0x1a'),_0x51add1,_0x9044('0x19'),JSON['stringify'](_0x374a74));if(_0x374a74['error']){if(_0x374a74[_0x9044('0x1b')][_0x9044('0x1c')]===0x1f4){logger[_0x9044('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x51add1,_0x374a74[_0x9044('0x1b')][_0x9044('0x1d')]);return _0x3170ad(_0x374a74[_0x9044('0x1b')][_0x9044('0x1d')]);}logger[_0x9044('0x1b')](_0x9044('0x18'),_0x51add1,_0x374a74[_0x9044('0x1b')][_0x9044('0x1d')]);return _0x3b065d(_0x374a74[_0x9044('0x1b')]['message']);}else{logger[_0x9044('0x17')]('VoiceContext,\x20%s,\x20%s',_0x51add1,_0x9044('0x19'));_0x3b065d(_0x374a74[_0x9044('0x1e')][_0x9044('0x1d')]);}})[_0x9044('0x1f')](function(_0x29fd7f){logger[_0x9044('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x51add1,_0x29fd7f);_0x3170ad(_0x29fd7f);});});}function respondWithStatusCode(_0x5dac72,_0x3b6a06){_0x3b6a06=_0x3b6a06||0xcc;return function(_0x214d62){if(_0x214d62){return _0x5dac72['sendStatus'](_0x3b6a06);}return _0x5dac72[_0x9044('0x20')](_0x3b6a06)['end']();};}function respondWithResult(_0x2b9a6c,_0x4966b8){_0x4966b8=_0x4966b8||0xc8;return function(_0x491843){if(_0x491843){return _0x2b9a6c[_0x9044('0x20')](_0x4966b8)[_0x9044('0x21')](_0x491843);}};}function respondWithFilteredResult(_0x1a6b40,_0x2d83c1){return function(_0x15165a){if(_0x15165a){var _0x286986=typeof _0x2d83c1[_0x9044('0x22')]===_0x9044('0x23')&&typeof _0x2d83c1['limit']===_0x9044('0x23');var _0x5e5bc9=_0x15165a[_0x9044('0x24')];var _0x3777a9=_0x286986?0x0:_0x2d83c1[_0x9044('0x22')];var _0x5e15fd=_0x286986?_0x15165a[_0x9044('0x24')]:_0x2d83c1[_0x9044('0x22')]+_0x2d83c1['limit'];var _0x3b1ae7;if(_0x5e15fd>=_0x5e5bc9){_0x5e15fd=_0x5e5bc9;_0x3b1ae7=0xc8;}else{_0x3b1ae7=0xce;}_0x1a6b40[_0x9044('0x20')](_0x3b1ae7);return _0x1a6b40[_0x9044('0x25')](_0x9044('0x26'),_0x3777a9+'-'+_0x5e15fd+'/'+_0x5e5bc9)[_0x9044('0x21')](_0x15165a);}return null;};}function patchUpdates(_0x1a1c82){return function(_0x46f289){try{jsonpatch['apply'](_0x46f289,_0x1a1c82,!![]);}catch(_0x3f9929){return BPromise['reject'](_0x3f9929);}return _0x46f289[_0x9044('0x27')]();};}function saveUpdates(_0x34903e,_0x1690ed){return function(_0x422c07){if(_0x422c07){return _0x422c07[_0x9044('0x28')](_0x34903e)[_0x9044('0x16')](function(_0x2b6057){return _0x2b6057;});}return null;};}function removeEntity(_0x11160c,_0x56a968){return function(_0x58adab){if(_0x58adab){return _0x58adab[_0x9044('0x29')]()[_0x9044('0x16')](function(){var _0xb775ad=_0x58adab['get']({'plain':!![]});var _0x53e573=_0x9044('0x2a');return db[_0x9044('0x2b')][_0x9044('0x29')]({'where':{'type':_0x53e573,'resourceId':_0xb775ad['id']}})[_0x9044('0x16')](function(){return _0x58adab;});})[_0x9044('0x16')](function(){_0x11160c['status'](0xcc)[_0x9044('0x2c')]();});}};}function handleEntityNotFound(_0x26d220,_0x3b23bd){return function(_0x5dd0cf){if(!_0x5dd0cf){_0x26d220[_0x9044('0x2d')](0x194);}return _0x5dd0cf;};}function handleError(_0xf02251,_0x569852){_0x569852=_0x569852||0x1f4;return function(_0x440acd){logger[_0x9044('0x1b')](_0x440acd[_0x9044('0x2e')]);if(_0x440acd['name']){delete _0x440acd[_0x9044('0x2f')];}_0xf02251['status'](_0x569852)[_0x9044('0x30')](_0x440acd);};}exports[_0x9044('0x31')]=function(_0x37ca4f,_0x344325){var _0x59f31e={},_0x813199={},_0x581247={'count':0x0,'rows':[]};var _0x4fa8e5=_[_0x9044('0x32')](db[_0x9044('0x33')][_0x9044('0x34')],function(_0x2ff25f){return{'name':_0x2ff25f[_0x9044('0x35')],'type':_0x2ff25f[_0x9044('0x36')][_0x9044('0x37')]};});_0x813199['model']=_[_0x9044('0x32')](_0x4fa8e5,'name');_0x813199[_0x9044('0x38')]=_[_0x9044('0x39')](_0x37ca4f['query']);_0x813199['filters']=_[_0x9044('0x3a')](_0x813199['model'],_0x813199[_0x9044('0x38')]);_0x59f31e[_0x9044('0x3b')]=_[_0x9044('0x3a')](_0x813199[_0x9044('0x3c')],qs[_0x9044('0x3d')](_0x37ca4f[_0x9044('0x38')][_0x9044('0x3d')]));_0x59f31e[_0x9044('0x3b')]=_0x59f31e[_0x9044('0x3b')]['length']?_0x59f31e['attributes']:_0x813199[_0x9044('0x3c')];if(!_0x37ca4f['query']['hasOwnProperty']('nolimit')){_0x59f31e[_0x9044('0x3e')]=qs[_0x9044('0x3e')](_0x37ca4f[_0x9044('0x38')][_0x9044('0x3e')]);_0x59f31e[_0x9044('0x22')]=qs['offset'](_0x37ca4f[_0x9044('0x38')][_0x9044('0x22')]);}_0x59f31e[_0x9044('0x3f')]=qs[_0x9044('0x40')](_0x37ca4f[_0x9044('0x38')][_0x9044('0x40')]);_0x59f31e['where']=qs[_0x9044('0x41')](_['pick'](_0x37ca4f[_0x9044('0x38')],_0x813199[_0x9044('0x41')]),_0x4fa8e5);if(_0x37ca4f[_0x9044('0x38')]['filter']){_0x59f31e[_0x9044('0x42')]=_[_0x9044('0x43')](_0x59f31e[_0x9044('0x42')],{'$or':_['map'](_0x4fa8e5,function(_0x4d24cb){if(_0x4d24cb[_0x9044('0x36')]!==_0x9044('0x44')){var _0x1992b9={};_0x1992b9[_0x4d24cb['name']]={'$like':'%'+_0x37ca4f[_0x9044('0x38')][_0x9044('0x45')]+'%'};return _0x1992b9;}})});}_0x59f31e=_[_0x9044('0x43')]({},_0x59f31e,_0x37ca4f[_0x9044('0x46')]);var _0x4c5bfd={'where':_0x59f31e[_0x9044('0x42')]};return db['VoiceContext'][_0x9044('0x24')](_0x4c5bfd)[_0x9044('0x16')](function(_0x152ef1){_0x581247[_0x9044('0x24')]=_0x152ef1;if(_0x37ca4f[_0x9044('0x38')][_0x9044('0x47')]){_0x59f31e['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x59f31e);})[_0x9044('0x16')](function(_0x367139){_0x581247['rows']=_0x367139;return _0x581247;})[_0x9044('0x16')](respondWithFilteredResult(_0x344325,_0x59f31e))[_0x9044('0x1f')](handleError(_0x344325,null));};exports['show']=function(_0x2d791b,_0x11a310){var _0xef9f4f={'raw':![],'where':{'id':_0x2d791b[_0x9044('0x48')]['id']}},_0x29ee91={};_0x29ee91[_0x9044('0x3c')]=_[_0x9044('0x39')](db[_0x9044('0x33')][_0x9044('0x34')]);_0x29ee91[_0x9044('0x38')]=_[_0x9044('0x39')](_0x2d791b[_0x9044('0x38')]);_0x29ee91['filters']=_[_0x9044('0x3a')](_0x29ee91[_0x9044('0x3c')],_0x29ee91[_0x9044('0x38')]);_0xef9f4f['attributes']=_[_0x9044('0x3a')](_0x29ee91[_0x9044('0x3c')],qs[_0x9044('0x3d')](_0x2d791b['query'][_0x9044('0x3d')]));_0xef9f4f[_0x9044('0x3b')]=_0xef9f4f[_0x9044('0x3b')][_0x9044('0x49')]?_0xef9f4f[_0x9044('0x3b')]:_0x29ee91['model'];if(_0x2d791b[_0x9044('0x38')][_0x9044('0x47')]){_0xef9f4f[_0x9044('0x4a')]=[{'all':!![]}];}_0xef9f4f=_[_0x9044('0x43')]({},_0xef9f4f,_0x2d791b[_0x9044('0x46')]);return db['VoiceContext'][_0x9044('0x4b')](_0xef9f4f)['then'](handleEntityNotFound(_0x11a310,null))['then'](respondWithResult(_0x11a310,null))[_0x9044('0x1f')](handleError(_0x11a310,null));};exports[_0x9044('0x4c')]=function(_0x15d8d2,_0x5adb67,_0x37c05b){var _0x322869;return db[_0x9044('0x33')][_0x9044('0x4c')](_0x15d8d2['body'],{'raw':!![]})[_0x9044('0x16')](function(_0x49ff3c){_0x322869=_0x49ff3c;return db[_0x9044('0x33')][_0x9044('0x4d')]({'raw':!![]});})['then'](function(_0x173816){var _0x5cda33=fs[_0x9044('0x4e')](path[_0x9044('0x4f')](config[_0x9044('0x50')],_0x9044('0x51')),_0x9044('0x52'));var _0x3deada=ejs[_0x9044('0x53')](_0x5cda33,{'contexts':_0x173816||[]});fs[_0x9044('0x54')](_0x9044('0x55'),_0x3deada);})[_0x9044('0x16')](function(){return respondWithRpcPromise('Reload',_0x9044('0x4c'),{'module':_0x9044('0x56')});})['then'](function(){var _0x54cf5f=_0x15d8d2['user'][_0x9044('0x57')]({'plain':!![]});if(!_0x54cf5f)throw new Error(_0x9044('0x58'));if(_0x54cf5f[_0x9044('0x59')]===_0x9044('0x5a')){var _0x277851=_0x322869[_0x9044('0x57')]({'plain':!![]});return db[_0x9044('0x5b')]['find']({'where':{'name':_0x9044('0x2a'),'userProfileId':_0x54cf5f[_0x9044('0x5c')]},'raw':!![]})['then'](function(_0x3cc5e9){if(_0x3cc5e9&&_0x3cc5e9['autoAssociation']===0x0){return db[_0x9044('0x2b')][_0x9044('0x4c')]({'name':_0x277851[_0x9044('0x2f')],'resourceId':_0x277851['id'],'type':_0x3cc5e9[_0x9044('0x2f')],'sectionId':_0x3cc5e9['id']},{})['then'](function(){return _0x322869;});}else{return _0x322869;}})[_0x9044('0x1f')](function(_0x453c19){logger[_0x9044('0x1b')](_0x9044('0x5d'),_0x453c19);throw _0x453c19;});}return _0x322869;})[_0x9044('0x16')](respondWithResult(_0x5adb67,0xc9))[_0x9044('0x1f')](handleError(_0x5adb67,null));};exports[_0x9044('0x28')]=function(_0x5bee14,_0x39d134,_0x14a30d){var _0x34e59f;return db[_0x9044('0x33')][_0x9044('0x4b')]({'where':{'id':_0x5bee14[_0x9044('0x48')]['id']}})[_0x9044('0x16')](handleEntityNotFound(_0x39d134,null))['then'](saveUpdates(_0x5bee14[_0x9044('0x5e')],null))[_0x9044('0x16')](function(_0x35a17b){if(_0x35a17b){_0x34e59f=_0x35a17b;return db[_0x9044('0x33')]['findAll']({'raw':!![]});}})[_0x9044('0x16')](function(_0x4af1ed){var _0x3f7c64=fs[_0x9044('0x4e')](path[_0x9044('0x4f')](config[_0x9044('0x50')],_0x9044('0x51')),_0x9044('0x52'));var _0x9b2724=ejs[_0x9044('0x53')](_0x3f7c64,{'contexts':_0x4af1ed||[]});fs['writeFileSync'](_0x9044('0x55'),_0x9b2724);})['then'](function(){return respondWithRpcPromise('Reload',_0x9044('0x28'),{'module':'chan_sip.so'});})[_0x9044('0x16')](function(){return _0x34e59f;})[_0x9044('0x16')](respondWithResult(_0x39d134,null))[_0x9044('0x1f')](handleError(_0x39d134,null));};exports['destroy']=function(_0x60bd1d,_0x5d0b1b,_0x316d80){var _0x3edee7;return db[_0x9044('0x33')][_0x9044('0x4b')]({'where':{'id':_0x60bd1d['params']['id']}})[_0x9044('0x16')](handleEntityNotFound(_0x5d0b1b,null))[_0x9044('0x16')](removeEntity(_0x5d0b1b,null))[_0x9044('0x16')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x9044('0x16')](function(_0x42d697){var _0x230495=fs['readFileSync'](path['join'](config['root'],_0x9044('0x51')),_0x9044('0x52'));var _0x59562c=ejs[_0x9044('0x53')](_0x230495,{'contexts':_0x42d697});fs[_0x9044('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x59562c);return respondWithRpcPromise(_0x9044('0x5f'),_0x9044('0x29'),{'module':'chan_sip.so'});})[_0x9044('0x1f')](handleError(_0x5d0b1b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 57a20a3..5e710ab 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 _0xed22=['../../config/environment','./voiceContext.attributes','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x540bd7,_0x283b6e){var _0x4d39d7=function(_0x4ce047){while(--_0x4ce047){_0x540bd7['push'](_0x540bd7['shift']());}};_0x4d39d7(++_0x283b6e);}(_0xed22,0x87));var _0x2ed2=function(_0x2f2a5c,_0x4cd034){_0x2f2a5c=_0x2f2a5c-0x0;var _0x33f574=_0xed22[_0x2f2a5c];return _0x33f574;};'use strict';var _=require(_0x2ed2('0x0'));var util=require(_0x2ed2('0x1'));var logger=require(_0x2ed2('0x2'))(_0x2ed2('0x3'));var moment=require(_0x2ed2('0x4'));var BPromise=require(_0x2ed2('0x5'));var rp=require(_0x2ed2('0x6'));var fs=require('fs');var path=require(_0x2ed2('0x7'));var rimraf=require(_0x2ed2('0x8'));var config=require(_0x2ed2('0x9'));var attributes=require(_0x2ed2('0xa'));module['exports']=function(_0x1d8a36,_0x15ee88){return _0x1d8a36['define']('VoiceContext',attributes,{'tableName':_0x2ed2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a69=['../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3c34cd,_0x187610){var _0x299b33=function(_0x2004eb){while(--_0x2004eb){_0x3c34cd['push'](_0x3c34cd['shift']());}};_0x299b33(++_0x187610);}(_0x5a69,0x1de));var _0x95a6=function(_0x3d887c,_0x5e7c76){_0x3d887c=_0x3d887c-0x0;var _0x489382=_0x5a69[_0x3d887c];return _0x489382;};'use strict';var _=require(_0x95a6('0x0'));var util=require(_0x95a6('0x1'));var logger=require('../../config/logger')(_0x95a6('0x2'));var moment=require(_0x95a6('0x3'));var BPromise=require(_0x95a6('0x4'));var rp=require(_0x95a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x95a6('0x6'));var attributes=require(_0x95a6('0x7'));module[_0x95a6('0x8')]=function(_0x3d4fa1,_0x295b87){return _0x3d4fa1['define'](_0x95a6('0x9'),attributes,{'tableName':_0x95a6('0xa'),'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 19e49ab..2239be4 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 _0x6bc4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','util'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x6bc4,0x164));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x46bc('0x0'));var moment=require('moment');var BPromise=require(_0x46bc('0x1'));var rs=require(_0x46bc('0x2'));var fs=require('fs');var Redis=require(_0x46bc('0x3'));var db=require(_0x46bc('0x4'))['db'];var utils=require(_0x46bc('0x5'));var logger=require(_0x46bc('0x6'))('rpc');var config=require(_0x46bc('0x7'));var jayson=require(_0x46bc('0x8'));var client=jayson['client'][_0x46bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19be50,_0x17710b,_0x75614){return new BPromise(function(_0x3c89e9,_0x3842b3){return client['request'](_0x19be50,_0x75614)[_0x46bc('0xa')](function(_0x28b7e1){logger['info'](_0x46bc('0xb'),_0x17710b,'request\x20sent');logger[_0x46bc('0xc')](_0x46bc('0xd'),_0x17710b,'request\x20sent',JSON[_0x46bc('0xe')](_0x28b7e1));if(_0x28b7e1[_0x46bc('0xf')]){if(_0x28b7e1['error'][_0x46bc('0x10')]===0x1f4){logger['error'](_0x46bc('0xb'),_0x17710b,_0x28b7e1[_0x46bc('0xf')][_0x46bc('0x11')]);return _0x3842b3(_0x28b7e1['error'][_0x46bc('0x11')]);}logger[_0x46bc('0xf')](_0x46bc('0xb'),_0x17710b,_0x28b7e1[_0x46bc('0xf')]['message']);return _0x3c89e9(_0x28b7e1[_0x46bc('0xf')][_0x46bc('0x11')]);}else{logger[_0x46bc('0x12')]('VoiceContext,\x20%s,\x20%s',_0x17710b,_0x46bc('0x13'));_0x3c89e9(_0x28b7e1['result'][_0x46bc('0x11')]);}})[_0x46bc('0x14')](function(_0x4c6de8){logger[_0x46bc('0xf')](_0x46bc('0xb'),_0x17710b,_0x4c6de8);_0x3842b3(_0x4c6de8);});});} \ No newline at end of file +var _0x79ad=['client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x18d402,_0x293437){var _0x5607c9=function(_0x25b6ec){while(--_0x25b6ec){_0x18d402['push'](_0x18d402['shift']());}};_0x5607c9(++_0x293437);}(_0x79ad,0x16e));var _0xd79a=function(_0x33daeb,_0x2c5f4b){_0x33daeb=_0x33daeb-0x0;var _0xaa5215=_0x79ad[_0x33daeb];return _0xaa5215;};'use strict';var _=require(_0xd79a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd79a('0x1'));var rs=require(_0xd79a('0x2'));var fs=require('fs');var Redis=require(_0xd79a('0x3'));var db=require(_0xd79a('0x4'))['db'];var utils=require(_0xd79a('0x5'));var logger=require(_0xd79a('0x6'))(_0xd79a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd79a('0x8')][_0xd79a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d3a5a,_0x273f8d,_0x12bf8c){return new BPromise(function(_0x263519,_0x2d3ec9){return client[_0xd79a('0xa')](_0x1d3a5a,_0x12bf8c)[_0xd79a('0xb')](function(_0x3080b0){logger[_0xd79a('0xc')](_0xd79a('0xd'),_0x273f8d,_0xd79a('0xe'));logger['debug'](_0xd79a('0xf'),_0x273f8d,_0xd79a('0xe'),JSON[_0xd79a('0x10')](_0x3080b0));if(_0x3080b0[_0xd79a('0x11')]){if(_0x3080b0[_0xd79a('0x11')][_0xd79a('0x12')]===0x1f4){logger[_0xd79a('0x11')](_0xd79a('0xd'),_0x273f8d,_0x3080b0[_0xd79a('0x11')]['message']);return _0x2d3ec9(_0x3080b0['error'][_0xd79a('0x13')]);}logger['error'](_0xd79a('0xd'),_0x273f8d,_0x3080b0[_0xd79a('0x11')][_0xd79a('0x13')]);return _0x263519(_0x3080b0[_0xd79a('0x11')][_0xd79a('0x13')]);}else{logger[_0xd79a('0xc')](_0xd79a('0xd'),_0x273f8d,_0xd79a('0xe'));_0x263519(_0x3080b0[_0xd79a('0x14')][_0xd79a('0x13')]);}})[_0xd79a('0x15')](function(_0x10f490){logger['error'](_0xd79a('0xd'),_0x273f8d,_0x10f490);_0x2d3ec9(_0x10f490);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1e10f33..821113f 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 _0x4221=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','/describe','isAuthenticated','/:id','show','post','create'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4221,0x1a1));var _0x1422=function(_0x4234ed,_0x1ac5d4){_0x4234ed=_0x4234ed-0x0;var _0xe4e6c0=_0x4221[_0x4234ed];return _0xe4e6c0;};'use strict';var multer=require(_0x1422('0x0'));var util=require('util');var path=require(_0x1422('0x1'));var timeout=require(_0x1422('0x2'));var express=require(_0x1422('0x3'));var router=express[_0x1422('0x4')]();var fs_extra=require(_0x1422('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1422('0x6'));var config=require('../../config/environment');var controller=require(_0x1422('0x7'));router[_0x1422('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1422('0x8')](_0x1422('0x9'),auth[_0x1422('0xa')](),controller['describe']);router['get'](_0x1422('0xb'),auth[_0x1422('0xa')](),controller[_0x1422('0xc')]);router[_0x1422('0xd')]('/',auth[_0x1422('0xa')](),controller[_0x1422('0xe')]);router['put'](_0x1422('0xb'),auth[_0x1422('0xa')](),controller[_0x1422('0xf')]);router[_0x1422('0x10')](_0x1422('0xb'),auth[_0x1422('0xa')](),controller['destroy']);module[_0x1422('0x11')]=router; \ No newline at end of file +var _0x51f3=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','create','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x432595,_0x56bef0){var _0x296128=function(_0x4e4e42){while(--_0x4e4e42){_0x432595['push'](_0x432595['shift']());}};_0x296128(++_0x56bef0);}(_0x51f3,0x9f));var _0x351f=function(_0x3c5289,_0x5eeb0d){_0x3c5289=_0x3c5289-0x0;var _0x36f689=_0x51f3[_0x3c5289];return _0x36f689;};'use strict';var multer=require(_0x351f('0x0'));var util=require(_0x351f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x351f('0x2'));var router=express[_0x351f('0x3')]();var fs_extra=require(_0x351f('0x4'));var auth=require(_0x351f('0x5'));var interaction=require(_0x351f('0x6'));var config=require(_0x351f('0x7'));var controller=require('./voiceDialReport.controller');router[_0x351f('0x8')]('/',auth['isAuthenticated'](),controller[_0x351f('0x9')]);router[_0x351f('0x8')]('/describe',auth[_0x351f('0xa')](),controller[_0x351f('0xb')]);router[_0x351f('0x8')](_0x351f('0xc'),auth['isAuthenticated'](),controller[_0x351f('0xd')]);router['post']('/',auth[_0x351f('0xa')](),controller[_0x351f('0xe')]);router['put'](_0x351f('0xc'),auth[_0x351f('0xa')](),controller['update']);router['delete'](_0x351f('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 9de319d..f55a81e 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 _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x409904,_0x3e71){var _0x5862bb=function(_0x495703){while(--_0x495703){_0x409904['push'](_0x409904['shift']());}};_0x5862bb(++_0x3e71);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file +var _0xf2ca=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x1ac170,_0xbc9e92){var _0x3cfc1f=function(_0x27b95b){while(--_0x27b95b){_0x1ac170['push'](_0x1ac170['shift']());}};_0x3cfc1f(++_0xbc9e92);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0xf2ca[_0xc7348b];return _0x307cec;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'privilege':{'type':Sequelize[_0xaf2c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaf2c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'destlinkedid':{'type':Sequelize[_0xaf2c('0x2')]},'dialstring':{'type':Sequelize[_0xaf2c('0x2')]},'dialstatus':{'type':Sequelize[_0xaf2c('0x2')]},'starttime':{'type':Sequelize[_0xaf2c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x5')},'routeId':{'type':Sequelize[_0xaf2c('0x3')]},'duration':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x3')]},'billableseconds':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 440ba60..5805554 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 _0xad9c=['sort','where','pick','filters','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','error','stack','name','map','VoiceDialReport','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','nolimit','order'];(function(_0x441d3a,_0x49bed8){var _0x32a7c3=function(_0x34dcaf){while(--_0x34dcaf){_0x441d3a['push'](_0x441d3a['shift']());}};_0x32a7c3(++_0x49bed8);}(_0xad9c,0xa3));var _0xcad9=function(_0x262057,_0x22e694){_0x262057=_0x262057-0x0;var _0x42e59a=_0xad9c[_0x262057];return _0x42e59a;};'use strict';var emlformat=require(_0xcad9('0x0'));var rimraf=require(_0xcad9('0x1'));var zipdir=require(_0xcad9('0x2'));var jsonpatch=require(_0xcad9('0x3'));var rp=require('request-promise');var moment=require(_0xcad9('0x4'));var BPromise=require(_0xcad9('0x5'));var Mustache=require('mustache');var util=require(_0xcad9('0x6'));var path=require(_0xcad9('0x7'));var sox=require(_0xcad9('0x8'));var csv=require(_0xcad9('0x9'));var ejs=require(_0xcad9('0xa'));var fs=require('fs');var fs_extra=require(_0xcad9('0xb'));var _=require(_0xcad9('0xc'));var squel=require(_0xcad9('0xd'));var crypto=require(_0xcad9('0xe'));var jsforce=require(_0xcad9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcad9('0x9'));var querystring=require(_0xcad9('0x10'));var Papa=require(_0xcad9('0x11'));var Redis=require(_0xcad9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcad9('0x13'));var as=require(_0xcad9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcad9('0x15'))(_0xcad9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcad9('0x17'));var db=require(_0xcad9('0x18'))['db'];function respondWithStatusCode(_0x44387b,_0x18f306){_0x18f306=_0x18f306||0xcc;return function(_0x455dd7){if(_0x455dd7){return _0x44387b[_0xcad9('0x19')](_0x18f306);}return _0x44387b[_0xcad9('0x1a')](_0x18f306)['end']();};}function respondWithResult(_0xbf5e8a,_0x2a2fed){_0x2a2fed=_0x2a2fed||0xc8;return function(_0x184fd0){if(_0x184fd0){return _0xbf5e8a[_0xcad9('0x1a')](_0x2a2fed)['json'](_0x184fd0);}};}function respondWithFilteredResult(_0x607458,_0x2e639a){return function(_0xea684d){if(_0xea684d){var _0x3a6465=typeof _0x2e639a[_0xcad9('0x1b')]===_0xcad9('0x1c')&&typeof _0x2e639a[_0xcad9('0x1d')]===_0xcad9('0x1c');var _0x4c0dd6=_0xea684d[_0xcad9('0x1e')];var _0x33b26b=_0x3a6465?0x0:_0x2e639a[_0xcad9('0x1b')];var _0x252540=_0x3a6465?_0xea684d['count']:_0x2e639a['offset']+_0x2e639a[_0xcad9('0x1d')];var _0x1b8167;if(_0x252540>=_0x4c0dd6){_0x252540=_0x4c0dd6;_0x1b8167=0xc8;}else{_0x1b8167=0xce;}_0x607458[_0xcad9('0x1a')](_0x1b8167);return _0x607458[_0xcad9('0x1f')](_0xcad9('0x20'),_0x33b26b+'-'+_0x252540+'/'+_0x4c0dd6)['json'](_0xea684d);}return null;};}function patchUpdates(_0x109aca){return function(_0x14275b){try{jsonpatch[_0xcad9('0x21')](_0x14275b,_0x109aca,!![]);}catch(_0x16b0e9){return BPromise['reject'](_0x16b0e9);}return _0x14275b['save']();};}function saveUpdates(_0x41b612,_0x33ca47){return function(_0x551404){if(_0x551404){return _0x551404['update'](_0x41b612)[_0xcad9('0x22')](function(_0x15ae0e){return _0x15ae0e;});}return null;};}function removeEntity(_0x124c16,_0x3a879d){return function(_0x4704e7){if(_0x4704e7){return _0x4704e7[_0xcad9('0x23')]()[_0xcad9('0x22')](function(){_0x124c16[_0xcad9('0x1a')](0xcc)[_0xcad9('0x24')]();});}};}function handleEntityNotFound(_0x39f148,_0x376c28){return function(_0x46b130){if(!_0x46b130){_0x39f148['sendStatus'](0x194);}return _0x46b130;};}function handleError(_0x3f4627,_0x45f2e3){_0x45f2e3=_0x45f2e3||0x1f4;return function(_0x236b96){logger[_0xcad9('0x25')](_0x236b96[_0xcad9('0x26')]);if(_0x236b96['name']){delete _0x236b96[_0xcad9('0x27')];}_0x3f4627[_0xcad9('0x1a')](_0x45f2e3)['send'](_0x236b96);};}exports['index']=function(_0x3c5124,_0x564ea0){var _0x43d4ca={},_0x54beea={},_0x95c51f={'count':0x0,'rows':[]};var _0x9bc33d=_[_0xcad9('0x28')](db[_0xcad9('0x29')][_0xcad9('0x2a')],function(_0x50a108){return{'name':_0x50a108[_0xcad9('0x2b')],'type':_0x50a108[_0xcad9('0x2c')]['key']};});_0x54beea[_0xcad9('0x2d')]=_[_0xcad9('0x28')](_0x9bc33d,_0xcad9('0x27'));_0x54beea['query']=_[_0xcad9('0x2e')](_0x3c5124[_0xcad9('0x2f')]);_0x54beea['filters']=_[_0xcad9('0x30')](_0x54beea[_0xcad9('0x2d')],_0x54beea[_0xcad9('0x2f')]);_0x43d4ca['attributes']=_['intersection'](_0x54beea[_0xcad9('0x2d')],qs[_0xcad9('0x31')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x31')]));_0x43d4ca[_0xcad9('0x32')]=_0x43d4ca['attributes']['length']?_0x43d4ca[_0xcad9('0x32')]:_0x54beea['model'];if(!_0x3c5124[_0xcad9('0x2f')]['hasOwnProperty'](_0xcad9('0x33'))){_0x43d4ca['limit']=qs[_0xcad9('0x1d')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x1d')]);_0x43d4ca['offset']=qs[_0xcad9('0x1b')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x1b')]);}_0x43d4ca[_0xcad9('0x34')]=qs[_0xcad9('0x35')](_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x35')]);_0x43d4ca[_0xcad9('0x36')]=qs['filters'](_[_0xcad9('0x37')](_0x3c5124['query'],_0x54beea[_0xcad9('0x38')]),_0x9bc33d);if(_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x39')]){_0x43d4ca[_0xcad9('0x36')]=_[_0xcad9('0x3a')](_0x43d4ca[_0xcad9('0x36')],{'$or':_[_0xcad9('0x28')](_0x9bc33d,function(_0x7fc48e){if(_0x7fc48e['type']!=='VIRTUAL'){var _0x907960={};_0x907960[_0x7fc48e['name']]={'$like':'%'+_0x3c5124[_0xcad9('0x2f')][_0xcad9('0x39')]+'%'};return _0x907960;}})});}_0x43d4ca=_[_0xcad9('0x3a')]({},_0x43d4ca,_0x3c5124[_0xcad9('0x3b')]);var _0x5db7c7={'where':_0x43d4ca[_0xcad9('0x36')]};return db['VoiceDialReport'][_0xcad9('0x1e')](_0x5db7c7)[_0xcad9('0x22')](function(_0x5b0749){_0x95c51f[_0xcad9('0x1e')]=_0x5b0749;if(_0x3c5124[_0xcad9('0x2f')]['includeAll']){_0x43d4ca[_0xcad9('0x3c')]=[{'all':!![]}];}return db[_0xcad9('0x29')][_0xcad9('0x3d')](_0x43d4ca);})[_0xcad9('0x22')](function(_0xafb391){_0x95c51f[_0xcad9('0x3e')]=_0xafb391;return _0x95c51f;})[_0xcad9('0x22')](respondWithFilteredResult(_0x564ea0,_0x43d4ca))[_0xcad9('0x3f')](handleError(_0x564ea0,null));};exports['show']=function(_0x5645c8,_0x45a5f5){var _0x5cc1ee={'raw':!![],'where':{'id':_0x5645c8[_0xcad9('0x40')]['id']}},_0x3db4f6={};_0x3db4f6['model']=_[_0xcad9('0x2e')](db['VoiceDialReport'][_0xcad9('0x2a')]);_0x3db4f6[_0xcad9('0x2f')]=_[_0xcad9('0x2e')](_0x5645c8['query']);_0x3db4f6[_0xcad9('0x38')]=_[_0xcad9('0x30')](_0x3db4f6[_0xcad9('0x2d')],_0x3db4f6[_0xcad9('0x2f')]);_0x5cc1ee[_0xcad9('0x32')]=_['intersection'](_0x3db4f6[_0xcad9('0x2d')],qs[_0xcad9('0x31')](_0x5645c8['query'][_0xcad9('0x31')]));_0x5cc1ee[_0xcad9('0x32')]=_0x5cc1ee[_0xcad9('0x32')][_0xcad9('0x41')]?_0x5cc1ee['attributes']:_0x3db4f6[_0xcad9('0x2d')];if(_0x5645c8[_0xcad9('0x2f')][_0xcad9('0x42')]){_0x5cc1ee[_0xcad9('0x3c')]=[{'all':!![]}];}_0x5cc1ee=_[_0xcad9('0x3a')]({},_0x5cc1ee,_0x5645c8[_0xcad9('0x3b')]);return db[_0xcad9('0x29')][_0xcad9('0x43')](_0x5cc1ee)['then'](handleEntityNotFound(_0x45a5f5,null))[_0xcad9('0x22')](respondWithResult(_0x45a5f5,null))['catch'](handleError(_0x45a5f5,null));};exports[_0xcad9('0x44')]=function(_0x5c75f5,_0x4e3a70){return db['VoiceDialReport']['create'](_0x5c75f5[_0xcad9('0x45')],{})['then'](respondWithResult(_0x4e3a70,0xc9))[_0xcad9('0x3f')](handleError(_0x4e3a70,null));};exports[_0xcad9('0x46')]=function(_0x4c9148,_0x3a07de){if(_0x4c9148[_0xcad9('0x45')]['id']){delete _0x4c9148[_0xcad9('0x45')]['id'];}return db[_0xcad9('0x29')][_0xcad9('0x43')]({'where':{'id':_0x4c9148[_0xcad9('0x40')]['id']}})[_0xcad9('0x22')](handleEntityNotFound(_0x3a07de,null))[_0xcad9('0x22')](saveUpdates(_0x4c9148['body'],null))[_0xcad9('0x22')](respondWithResult(_0x3a07de,null))['catch'](handleError(_0x3a07de,null));};exports[_0xcad9('0x23')]=function(_0x30ff90,_0x7de469){return db[_0xcad9('0x29')][_0xcad9('0x43')]({'where':{'id':_0x30ff90[_0xcad9('0x40')]['id']}})['then'](handleEntityNotFound(_0x7de469,null))[_0xcad9('0x22')](removeEntity(_0x7de469,null))['catch'](handleError(_0x7de469,null));};exports[_0xcad9('0x47')]=function(_0xe2b063,_0x3b9dff){return db[_0xcad9('0x29')][_0xcad9('0x47')]()[_0xcad9('0x22')](respondWithResult(_0x3b9dff,null))[_0xcad9('0x3f')](handleError(_0x3b9dff,null));}; \ No newline at end of file +var _0xccb2=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','params','find','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0xbfa7a8,_0x3e106e){var _0x5a4181=function(_0x59f367){while(--_0x59f367){_0xbfa7a8['push'](_0xbfa7a8['shift']());}};_0x5a4181(++_0x3e106e);}(_0xccb2,0x8c));var _0x2ccb=function(_0x50c90a,_0x5888e5){_0x50c90a=_0x50c90a-0x0;var _0x533244=_0xccb2[_0x50c90a];return _0x533244;};'use strict';var emlformat=require(_0x2ccb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ccb('0x1'));var jsonpatch=require(_0x2ccb('0x2'));var rp=require(_0x2ccb('0x3'));var moment=require(_0x2ccb('0x4'));var BPromise=require(_0x2ccb('0x5'));var Mustache=require(_0x2ccb('0x6'));var util=require(_0x2ccb('0x7'));var path=require(_0x2ccb('0x8'));var sox=require('sox');var csv=require(_0x2ccb('0x9'));var ejs=require(_0x2ccb('0xa'));var fs=require('fs');var fs_extra=require(_0x2ccb('0xb'));var _=require(_0x2ccb('0xc'));var squel=require(_0x2ccb('0xd'));var crypto=require(_0x2ccb('0xe'));var jsforce=require(_0x2ccb('0xf'));var deskjs=require(_0x2ccb('0x10'));var toCsv=require(_0x2ccb('0x9'));var querystring=require(_0x2ccb('0x11'));var Papa=require(_0x2ccb('0x12'));var Redis=require(_0x2ccb('0x13'));var authService=require(_0x2ccb('0x14'));var qs=require(_0x2ccb('0x15'));var as=require(_0x2ccb('0x16'));var hardwareService=require(_0x2ccb('0x17'));var logger=require(_0x2ccb('0x18'))('api');var utils=require(_0x2ccb('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2ccb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d6c35,_0x3fe405){_0x3fe405=_0x3fe405||0xcc;return function(_0x5078da){if(_0x5078da){return _0x5d6c35['sendStatus'](_0x3fe405);}return _0x5d6c35['status'](_0x3fe405)['end']();};}function respondWithResult(_0x3ee236,_0x34b6a9){_0x34b6a9=_0x34b6a9||0xc8;return function(_0x6a1b09){if(_0x6a1b09){return _0x3ee236[_0x2ccb('0x1b')](_0x34b6a9)['json'](_0x6a1b09);}};}function respondWithFilteredResult(_0x2c44b9,_0x2cd149){return function(_0x2b0e26){if(_0x2b0e26){var _0xbd7795=typeof _0x2cd149[_0x2ccb('0x1c')]===_0x2ccb('0x1d')&&typeof _0x2cd149[_0x2ccb('0x1e')]===_0x2ccb('0x1d');var _0x1b6732=_0x2b0e26[_0x2ccb('0x1f')];var _0x486de6=_0xbd7795?0x0:_0x2cd149[_0x2ccb('0x1c')];var _0x1261e9=_0xbd7795?_0x2b0e26[_0x2ccb('0x1f')]:_0x2cd149[_0x2ccb('0x1c')]+_0x2cd149[_0x2ccb('0x1e')];var _0x362019;if(_0x1261e9>=_0x1b6732){_0x1261e9=_0x1b6732;_0x362019=0xc8;}else{_0x362019=0xce;}_0x2c44b9[_0x2ccb('0x1b')](_0x362019);return _0x2c44b9[_0x2ccb('0x20')](_0x2ccb('0x21'),_0x486de6+'-'+_0x1261e9+'/'+_0x1b6732)['json'](_0x2b0e26);}return null;};}function patchUpdates(_0x5e1bea){return function(_0x1f6ae6){try{jsonpatch[_0x2ccb('0x22')](_0x1f6ae6,_0x5e1bea,!![]);}catch(_0x537803){return BPromise['reject'](_0x537803);}return _0x1f6ae6[_0x2ccb('0x23')]();};}function saveUpdates(_0x490e76,_0x5514dc){return function(_0x3a2246){if(_0x3a2246){return _0x3a2246[_0x2ccb('0x24')](_0x490e76)['then'](function(_0xf3a94){return _0xf3a94;});}return null;};}function removeEntity(_0x340160,_0x351da6){return function(_0x2ebe8b){if(_0x2ebe8b){return _0x2ebe8b[_0x2ccb('0x25')]()[_0x2ccb('0x26')](function(){_0x340160[_0x2ccb('0x1b')](0xcc)[_0x2ccb('0x27')]();});}};}function handleEntityNotFound(_0x1d5511,_0x4aac9c){return function(_0x1ec50e){if(!_0x1ec50e){_0x1d5511['sendStatus'](0x194);}return _0x1ec50e;};}function handleError(_0x37a69a,_0x8a2e25){_0x8a2e25=_0x8a2e25||0x1f4;return function(_0x4369f1){logger[_0x2ccb('0x28')](_0x4369f1['stack']);if(_0x4369f1['name']){delete _0x4369f1[_0x2ccb('0x29')];}_0x37a69a[_0x2ccb('0x1b')](_0x8a2e25)[_0x2ccb('0x2a')](_0x4369f1);};}exports[_0x2ccb('0x2b')]=function(_0x16fd96,_0x3ff1c6){var _0x41f3da={},_0x4bc3aa={},_0x448fdc={'count':0x0,'rows':[]};var _0xef95d5=_[_0x2ccb('0x2c')](db[_0x2ccb('0x2d')][_0x2ccb('0x2e')],function(_0x527c36){return{'name':_0x527c36[_0x2ccb('0x2f')],'type':_0x527c36[_0x2ccb('0x30')][_0x2ccb('0x31')]};});_0x4bc3aa[_0x2ccb('0x32')]=_[_0x2ccb('0x2c')](_0xef95d5,_0x2ccb('0x29'));_0x4bc3aa[_0x2ccb('0x33')]=_[_0x2ccb('0x34')](_0x16fd96[_0x2ccb('0x33')]);_0x4bc3aa['filters']=_[_0x2ccb('0x35')](_0x4bc3aa[_0x2ccb('0x32')],_0x4bc3aa['query']);_0x41f3da['attributes']=_[_0x2ccb('0x35')](_0x4bc3aa[_0x2ccb('0x32')],qs[_0x2ccb('0x36')](_0x16fd96[_0x2ccb('0x33')][_0x2ccb('0x36')]));_0x41f3da[_0x2ccb('0x37')]=_0x41f3da['attributes'][_0x2ccb('0x38')]?_0x41f3da[_0x2ccb('0x37')]:_0x4bc3aa['model'];if(!_0x16fd96[_0x2ccb('0x33')]['hasOwnProperty'](_0x2ccb('0x39'))){_0x41f3da[_0x2ccb('0x1e')]=qs[_0x2ccb('0x1e')](_0x16fd96[_0x2ccb('0x33')][_0x2ccb('0x1e')]);_0x41f3da['offset']=qs['offset'](_0x16fd96['query'][_0x2ccb('0x1c')]);}_0x41f3da[_0x2ccb('0x3a')]=qs['sort'](_0x16fd96['query'][_0x2ccb('0x3b')]);_0x41f3da[_0x2ccb('0x3c')]=qs[_0x2ccb('0x3d')](_[_0x2ccb('0x3e')](_0x16fd96['query'],_0x4bc3aa[_0x2ccb('0x3d')]),_0xef95d5);if(_0x16fd96[_0x2ccb('0x33')]['filter']){_0x41f3da[_0x2ccb('0x3c')]=_[_0x2ccb('0x3f')](_0x41f3da['where'],{'$or':_[_0x2ccb('0x2c')](_0xef95d5,function(_0x32e995){if(_0x32e995[_0x2ccb('0x30')]!=='VIRTUAL'){var _0x10153b={};_0x10153b[_0x32e995['name']]={'$like':'%'+_0x16fd96[_0x2ccb('0x33')][_0x2ccb('0x40')]+'%'};return _0x10153b;}})});}_0x41f3da=_['merge']({},_0x41f3da,_0x16fd96[_0x2ccb('0x41')]);var _0x55cb48={'where':_0x41f3da['where']};return db[_0x2ccb('0x2d')]['count'](_0x55cb48)[_0x2ccb('0x26')](function(_0x59291f){_0x448fdc[_0x2ccb('0x1f')]=_0x59291f;if(_0x16fd96[_0x2ccb('0x33')][_0x2ccb('0x42')]){_0x41f3da[_0x2ccb('0x43')]=[{'all':!![]}];}return db[_0x2ccb('0x2d')][_0x2ccb('0x44')](_0x41f3da);})[_0x2ccb('0x26')](function(_0x593712){_0x448fdc[_0x2ccb('0x45')]=_0x593712;return _0x448fdc;})[_0x2ccb('0x26')](respondWithFilteredResult(_0x3ff1c6,_0x41f3da))['catch'](handleError(_0x3ff1c6,null));};exports['show']=function(_0x4e28da,_0x3cb124){var _0x42a413={'raw':!![],'where':{'id':_0x4e28da[_0x2ccb('0x46')]['id']}},_0x5c65de={};_0x5c65de[_0x2ccb('0x32')]=_[_0x2ccb('0x34')](db[_0x2ccb('0x2d')][_0x2ccb('0x2e')]);_0x5c65de['query']=_[_0x2ccb('0x34')](_0x4e28da[_0x2ccb('0x33')]);_0x5c65de[_0x2ccb('0x3d')]=_[_0x2ccb('0x35')](_0x5c65de[_0x2ccb('0x32')],_0x5c65de[_0x2ccb('0x33')]);_0x42a413[_0x2ccb('0x37')]=_[_0x2ccb('0x35')](_0x5c65de['model'],qs[_0x2ccb('0x36')](_0x4e28da[_0x2ccb('0x33')][_0x2ccb('0x36')]));_0x42a413['attributes']=_0x42a413['attributes']['length']?_0x42a413[_0x2ccb('0x37')]:_0x5c65de[_0x2ccb('0x32')];if(_0x4e28da[_0x2ccb('0x33')][_0x2ccb('0x42')]){_0x42a413[_0x2ccb('0x43')]=[{'all':!![]}];}_0x42a413=_['merge']({},_0x42a413,_0x4e28da[_0x2ccb('0x41')]);return db[_0x2ccb('0x2d')][_0x2ccb('0x47')](_0x42a413)[_0x2ccb('0x26')](handleEntityNotFound(_0x3cb124,null))[_0x2ccb('0x26')](respondWithResult(_0x3cb124,null))['catch'](handleError(_0x3cb124,null));};exports['create']=function(_0x51d1e4,_0x540e8c){return db[_0x2ccb('0x2d')]['create'](_0x51d1e4[_0x2ccb('0x48')],{})[_0x2ccb('0x26')](respondWithResult(_0x540e8c,0xc9))['catch'](handleError(_0x540e8c,null));};exports[_0x2ccb('0x24')]=function(_0x12e4ce,_0x1daa29){if(_0x12e4ce[_0x2ccb('0x48')]['id']){delete _0x12e4ce[_0x2ccb('0x48')]['id'];}return db['VoiceDialReport'][_0x2ccb('0x47')]({'where':{'id':_0x12e4ce['params']['id']}})['then'](handleEntityNotFound(_0x1daa29,null))[_0x2ccb('0x26')](saveUpdates(_0x12e4ce[_0x2ccb('0x48')],null))['then'](respondWithResult(_0x1daa29,null))['catch'](handleError(_0x1daa29,null));};exports[_0x2ccb('0x25')]=function(_0x19c6ee,_0x1a2dcf){return db[_0x2ccb('0x2d')][_0x2ccb('0x47')]({'where':{'id':_0x19c6ee[_0x2ccb('0x46')]['id']}})[_0x2ccb('0x26')](handleEntityNotFound(_0x1a2dcf,null))[_0x2ccb('0x26')](removeEntity(_0x1a2dcf,null))[_0x2ccb('0x49')](handleError(_0x1a2dcf,null));};exports['describe']=function(_0x2c1985,_0xd394ae){return db[_0x2ccb('0x2d')][_0x2ccb('0x4a')]()[_0x2ccb('0x26')](respondWithResult(_0xd394ae,null))['catch'](handleError(_0xd394ae,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index e35045d..337e756 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 _0x5b91=['api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x10537f,_0x26090f){var _0x4a6a9a=function(_0x2b0e34){while(--_0x2b0e34){_0x10537f['push'](_0x10537f['shift']());}};_0x4a6a9a(++_0x26090f);}(_0x5b91,0x128));var _0x15b9=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x5b91[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0x15b9('0x0'));var util=require(_0x15b9('0x1'));var logger=require(_0x15b9('0x2'))(_0x15b9('0x3'));var moment=require(_0x15b9('0x4'));var BPromise=require(_0x15b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x15b9('0x6'));var config=require(_0x15b9('0x7'));var attributes=require(_0x15b9('0x8'));module[_0x15b9('0x9')]=function(_0x49ebb3,_0x24009b){return _0x49ebb3['define'](_0x15b9('0xa'),attributes,{'tableName':_0x15b9('0xb'),'paranoid':![],'indexes':[{'fields':[_0x15b9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8bb6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x8bb6,0x16b));var _0x68bb=function(_0x1300ec,_0x3ff267){_0x1300ec=_0x1300ec-0x0;var _0x2c13c9=_0x8bb6[_0x1300ec];return _0x2c13c9;};'use strict';var _=require(_0x68bb('0x0'));var util=require(_0x68bb('0x1'));var logger=require('../../config/logger')(_0x68bb('0x2'));var moment=require(_0x68bb('0x3'));var BPromise=require(_0x68bb('0x4'));var rp=require(_0x68bb('0x5'));var fs=require('fs');var path=require(_0x68bb('0x6'));var rimraf=require(_0x68bb('0x7'));var config=require(_0x68bb('0x8'));var attributes=require(_0x68bb('0x9'));module[_0x68bb('0xa')]=function(_0x1c78f2,_0x2b39b6){return _0x1c78f2['define'](_0x68bb('0xb'),attributes,{'tableName':_0x68bb('0xc'),'paranoid':![],'indexes':[{'fields':[_0x68bb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index de4e573..86a778e 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 _0xedc7=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceDialReport','body','CreateVoiceDialReport','UpdateVoiceDialReport','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3e0f2e,_0x187d0b){var _0x4a562a=function(_0x579096){while(--_0x579096){_0x3e0f2e['push'](_0x3e0f2e['shift']());}};_0x4a562a(++_0x187d0b);}(_0xedc7,0x13b));var _0x7edc=function(_0x4570d5,_0x115f91){_0x4570d5=_0x4570d5-0x0;var _0x314a34=_0xedc7[_0x4570d5];return _0x314a34;};'use strict';var _=require(_0x7edc('0x0'));var util=require(_0x7edc('0x1'));var moment=require(_0x7edc('0x2'));var BPromise=require(_0x7edc('0x3'));var rs=require(_0x7edc('0x4'));var fs=require('fs');var Redis=require(_0x7edc('0x5'));var db=require(_0x7edc('0x6'))['db'];var utils=require(_0x7edc('0x7'));var logger=require('../../config/logger')(_0x7edc('0x8'));var config=require('../../config/environment');var jayson=require(_0x7edc('0x9'));var client=jayson[_0x7edc('0xa')][_0x7edc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x178d96,_0x5a9e59,_0x5770a9){return new BPromise(function(_0x4681ea,_0x2eac6a){return client[_0x7edc('0xc')](_0x178d96,_0x5770a9)[_0x7edc('0xd')](function(_0x4437d9){logger[_0x7edc('0xe')](_0x7edc('0xf'),_0x5a9e59,_0x7edc('0x10'));logger[_0x7edc('0x11')](_0x7edc('0x12'),_0x5a9e59,_0x7edc('0x10'),JSON['stringify'](_0x4437d9));if(_0x4437d9[_0x7edc('0x13')]){if(_0x4437d9[_0x7edc('0x13')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5a9e59,_0x4437d9[_0x7edc('0x13')]['message']);return _0x2eac6a(_0x4437d9[_0x7edc('0x13')][_0x7edc('0x14')]);}logger[_0x7edc('0x13')](_0x7edc('0xf'),_0x5a9e59,_0x4437d9[_0x7edc('0x13')][_0x7edc('0x14')]);return _0x4681ea(_0x4437d9[_0x7edc('0x13')][_0x7edc('0x14')]);}else{logger[_0x7edc('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x5a9e59,_0x7edc('0x10'));_0x4681ea(_0x4437d9[_0x7edc('0x15')][_0x7edc('0x14')]);}})[_0x7edc('0x16')](function(_0x2ec9e4){logger[_0x7edc('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x5a9e59,_0x2ec9e4);_0x2eac6a(_0x2ec9e4);});});}exports['CreateVoiceDialReport']=function(_0x593674){var _0x29e885=this;return new Promise(function(_0x157031,_0x218be6){return db[_0x7edc('0x17')]['create'](_0x593674[_0x7edc('0x18')],{'raw':_0x593674['options']?_0x593674['options']['raw']===undefined?!![]:![]:!![]})[_0x7edc('0xd')](function(_0x4b1f1a){logger[_0x7edc('0xe')](_0x7edc('0x19'),_0x593674);logger[_0x7edc('0x11')](_0x7edc('0x19'),_0x593674,JSON['stringify'](_0x4b1f1a));_0x157031(_0x4b1f1a);})['catch'](function(_0x6907fb){logger['error'](_0x7edc('0x19'),_0x6907fb['message'],_0x593674);_0x218be6(_0x29e885[_0x7edc('0x13')](0x1f4,_0x6907fb['message']));});});};exports[_0x7edc('0x1a')]=function(_0x30cc32){var _0x4a0d0d=this;return new Promise(function(_0x35739f,_0x3d627c){return db['VoiceDialReport']['update'](_0x30cc32[_0x7edc('0x18')],{'raw':_0x30cc32[_0x7edc('0x1b')]?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30cc32['options']?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1d')]||null:null,'attributes':_0x30cc32['options']?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1e')]||null:null,'limit':_0x30cc32['options']?_0x30cc32[_0x7edc('0x1b')][_0x7edc('0x1f')]||null:null})[_0x7edc('0xd')](function(_0x56e719){logger['info']('UpdateVoiceDialReport',_0x30cc32);logger['debug'](_0x7edc('0x1a'),_0x30cc32,JSON[_0x7edc('0x20')](_0x56e719));_0x35739f(_0x56e719);})[_0x7edc('0x16')](function(_0x577f63){logger['error'](_0x7edc('0x1a'),_0x577f63[_0x7edc('0x14')],_0x30cc32);_0x3d627c(_0x4a0d0d[_0x7edc('0x13')](0x1f4,_0x577f63[_0x7edc('0x14')]));});});}; \ No newline at end of file +var _0x727c=['client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','stringify','UpdateVoiceDialReport','update','where','attributes','limit','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5ededf,_0x3d5733){var _0xc81eb7=function(_0x17ca5f){while(--_0x17ca5f){_0x5ededf['push'](_0x5ededf['shift']());}};_0xc81eb7(++_0x3d5733);}(_0x727c,0x129));var _0xc727=function(_0x19a7d3,_0x487155){_0x19a7d3=_0x19a7d3-0x0;var _0x569a8e=_0x727c[_0x19a7d3];return _0x569a8e;};'use strict';var _=require(_0xc727('0x0'));var util=require(_0xc727('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc727('0x2'));var fs=require('fs');var Redis=require(_0xc727('0x3'));var db=require(_0xc727('0x4'))['db'];var utils=require(_0xc727('0x5'));var logger=require(_0xc727('0x6'))('rpc');var config=require(_0xc727('0x7'));var jayson=require(_0xc727('0x8'));var client=jayson[_0xc727('0x9')][_0xc727('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11d18f,_0x41d7a7,_0x5d3399){return new BPromise(function(_0x342c42,_0x252fbb){return client[_0xc727('0xb')](_0x11d18f,_0x5d3399)[_0xc727('0xc')](function(_0x1e8315){logger[_0xc727('0xd')](_0xc727('0xe'),_0x41d7a7,_0xc727('0xf'));logger[_0xc727('0x10')](_0xc727('0x11'),_0x41d7a7,'request\x20sent',JSON['stringify'](_0x1e8315));if(_0x1e8315[_0xc727('0x12')]){if(_0x1e8315[_0xc727('0x12')][_0xc727('0x13')]===0x1f4){logger[_0xc727('0x12')](_0xc727('0xe'),_0x41d7a7,_0x1e8315['error']['message']);return _0x252fbb(_0x1e8315[_0xc727('0x12')]['message']);}logger['error'](_0xc727('0xe'),_0x41d7a7,_0x1e8315[_0xc727('0x12')][_0xc727('0x14')]);return _0x342c42(_0x1e8315[_0xc727('0x12')][_0xc727('0x14')]);}else{logger[_0xc727('0xd')](_0xc727('0xe'),_0x41d7a7,_0xc727('0xf'));_0x342c42(_0x1e8315[_0xc727('0x15')][_0xc727('0x14')]);}})['catch'](function(_0x4e9d34){logger[_0xc727('0x12')](_0xc727('0xe'),_0x41d7a7,_0x4e9d34);_0x252fbb(_0x4e9d34);});});}exports[_0xc727('0x16')]=function(_0x1cf005){var _0x249b61=this;return new Promise(function(_0x18b58e,_0x140338){return db[_0xc727('0x17')]['create'](_0x1cf005[_0xc727('0x18')],{'raw':_0x1cf005[_0xc727('0x19')]?_0x1cf005[_0xc727('0x19')][_0xc727('0x1a')]===undefined?!![]:![]:!![]})[_0xc727('0xc')](function(_0x56b3b7){logger[_0xc727('0xd')]('CreateVoiceDialReport',_0x1cf005);logger[_0xc727('0x10')](_0xc727('0x16'),_0x1cf005,JSON[_0xc727('0x1b')](_0x56b3b7));_0x18b58e(_0x56b3b7);})['catch'](function(_0x503631){logger[_0xc727('0x12')]('CreateVoiceDialReport',_0x503631[_0xc727('0x14')],_0x1cf005);_0x140338(_0x249b61[_0xc727('0x12')](0x1f4,_0x503631[_0xc727('0x14')]));});});};exports[_0xc727('0x1c')]=function(_0x1b5f13){var _0x349edb=this;return new Promise(function(_0x406797,_0x382cf5){return db[_0xc727('0x17')][_0xc727('0x1d')](_0x1b5f13['body'],{'raw':_0x1b5f13[_0xc727('0x19')]?_0x1b5f13[_0xc727('0x19')][_0xc727('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5f13[_0xc727('0x19')]?_0x1b5f13['options'][_0xc727('0x1e')]||null:null,'attributes':_0x1b5f13['options']?_0x1b5f13['options'][_0xc727('0x1f')]||null:null,'limit':_0x1b5f13[_0xc727('0x19')]?_0x1b5f13['options'][_0xc727('0x20')]||null:null})[_0xc727('0xc')](function(_0x1c10c9){logger[_0xc727('0xd')](_0xc727('0x1c'),_0x1b5f13);logger[_0xc727('0x10')](_0xc727('0x1c'),_0x1b5f13,JSON[_0xc727('0x1b')](_0x1c10c9));_0x406797(_0x1c10c9);})[_0xc727('0x21')](function(_0x56be91){logger[_0xc727('0x12')](_0xc727('0x1c'),_0x56be91[_0xc727('0x14')],_0x1b5f13);_0x382cf5(_0x349edb[_0xc727('0x12')](0x1f4,_0x56be91[_0xc727('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 4a749b1..3d9d66f 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 _0xff35=['index','/:id','show','post','create','/:id/applications','addApplications','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x116a48,_0x45d1d7){var _0x176a29=function(_0x59a921){while(--_0x59a921){_0x116a48['push'](_0x116a48['shift']());}};_0x176a29(++_0x45d1d7);}(_0xff35,0x181));var _0x5ff3=function(_0x3849eb,_0x5f9348){_0x3849eb=_0x3849eb-0x0;var _0x5c5ad3=_0xff35[_0x3849eb];return _0x5c5ad3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ff3('0x0'));var timeout=require(_0x5ff3('0x1'));var express=require(_0x5ff3('0x2'));var router=express[_0x5ff3('0x3')]();var fs_extra=require(_0x5ff3('0x4'));var auth=require(_0x5ff3('0x5'));var interaction=require(_0x5ff3('0x6'));var config=require(_0x5ff3('0x7'));var controller=require(_0x5ff3('0x8'));router[_0x5ff3('0x9')]('/',auth[_0x5ff3('0xa')](),controller[_0x5ff3('0xb')]);router[_0x5ff3('0x9')](_0x5ff3('0xc'),auth['isAuthenticated'](),controller[_0x5ff3('0xd')]);router[_0x5ff3('0xe')]('/',auth['isAuthenticated'](),controller[_0x5ff3('0xf')]);router[_0x5ff3('0xe')](_0x5ff3('0x10'),auth['isAuthenticated'](),controller[_0x5ff3('0x11')]);router[_0x5ff3('0x12')](_0x5ff3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5ff3('0x13')](_0x5ff3('0xc'),auth[_0x5ff3('0xa')](),controller[_0x5ff3('0x14')]);module[_0x5ff3('0x15')]=router; \ No newline at end of file +var _0xfee5=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4dc392,_0x255362){var _0x4e45ad=function(_0x1d932d){while(--_0x1d932d){_0x4dc392['push'](_0x4dc392['shift']());}};_0x4e45ad(++_0x255362);}(_0xfee5,0x189));var _0x5fee=function(_0x3934e2,_0x2dc66b){_0x3934e2=_0x3934e2-0x0;var _0x35b87c=_0xfee5[_0x3934e2];return _0x35b87c;};'use strict';var multer=require('multer');var util=require(_0x5fee('0x0'));var path=require(_0x5fee('0x1'));var timeout=require(_0x5fee('0x2'));var express=require(_0x5fee('0x3'));var router=express[_0x5fee('0x4')]();var fs_extra=require(_0x5fee('0x5'));var auth=require(_0x5fee('0x6'));var interaction=require(_0x5fee('0x7'));var config=require(_0x5fee('0x8'));var controller=require(_0x5fee('0x9'));router['get']('/',auth[_0x5fee('0xa')](),controller[_0x5fee('0xb')]);router['get'](_0x5fee('0xc'),auth['isAuthenticated'](),controller[_0x5fee('0xd')]);router[_0x5fee('0xe')]('/',auth['isAuthenticated'](),controller[_0x5fee('0xf')]);router[_0x5fee('0xe')](_0x5fee('0x10'),auth[_0x5fee('0xa')](),controller[_0x5fee('0x11')]);router['put'](_0x5fee('0xc'),auth[_0x5fee('0xa')](),controller['update']);router[_0x5fee('0x12')](_0x5fee('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x5fee('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 50ab830..464c15e 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 _0x1acd=['INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*'];(function(_0x2a0a34,_0x1e3529){var _0x41a8c3=function(_0x5610ab){while(--_0x5610ab){_0x2a0a34['push'](_0x2a0a34['shift']());}};_0x41a8c3(++_0x1e3529);}(_0x1acd,0xf3));var _0xd1ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1acd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1ac('0x0'));module[_0xd1ac('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd1ac('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'unique':_0xd1ac('0x2')},'priority':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':_0xd1ac('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xd1ac('0x5'),_0xd1ac('0x6'),_0xd1ac('0x7'),_0xd1ac('0x8'),_0xd1ac('0x9'),'system',_0xd1ac('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xd1ac('0x3')]},'interval':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':![],'defaultValue':_0xd1ac('0xb')},'IntervalId':{'type':Sequelize[_0xd1ac('0xc')]},'isApp':{'type':Sequelize[_0xd1ac('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xd1ac('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xd1ac('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd1ac('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xd1ac('0xe')},'answer':{'type':Sequelize[_0xd1ac('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a4dd8){return this[_0xd1ac('0xf')](_0xd1ac('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xfa8b=['compositeIndex','ENUM','outbound','internal','inbound-fax','system','any','INTEGER','BOOLEAN','wav','getDataValue','exten','exports','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfa8b,0x1be));var _0xbfa8=function(_0x406472,_0x233473){_0x406472=_0x406472-0x0;var _0x2eff79=_0xfa8b[_0x406472];return _0x2eff79;};'use strict';var Sequelize=require('sequelize');module[_0xbfa8('0x0')]={'context':{'type':Sequelize[_0xbfa8('0x1')],'allowNull':![],'unique':_0xbfa8('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xbfa8('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xbfa8('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbfa8('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xbfa8('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbfa8('0x3')]('inbound',_0xbfa8('0x4'),_0xbfa8('0x5'),_0xbfa8('0x6'),'outbound-fax',_0xbfa8('0x7'),_0xbfa8('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xbfa8('0x1')]},'interval':{'type':Sequelize[_0xbfa8('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xbfa8('0x9')]},'isApp':{'type':Sequelize[_0xbfa8('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbfa8('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbfa8('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbfa8('0x9')]},'recordingFormat':{'type':Sequelize[_0xbfa8('0x1')],'defaultValue':_0xbfa8('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4879c5){return this[_0xbfa8('0xc')](_0xbfa8('0xd'));}},'alias':{'type':Sequelize[_0xbfa8('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 4099bfd..e550161 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 _0xd35f=['findAll','rows','catch','show','params','create','body','startsWith','exten','concat','user','role','OutboundRoutes','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','findOne','sequelize','transaction','VoiceExtensionId','isApp','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','lodash','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','limit','count','Content-Range','destroy','then','get','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','VoiceExtension','includeAll','include'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xd35f,0xd2));var _0xfd35=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0xd35f[_0x364a36];return _0x5cd6fa;};'use strict';var _=require(_0xfd35('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xfd35('0x1'))('api');var config=require(_0xfd35('0x2'));var db=require(_0xfd35('0x3'))['db'];config['redis']=_[_0xfd35('0x4')](config[_0xfd35('0x5')],{'host':_0xfd35('0x6'),'port':0x18eb});var socket=require(_0xfd35('0x7'))(new Redis(config[_0xfd35('0x5')]));require('./voiceExtension.socket')[_0xfd35('0x8')](socket);function respondWithStatusCode(_0x11ed40,_0xa2395c){_0xa2395c=_0xa2395c||0xcc;return function(_0x39337f){if(_0x39337f){return _0x11ed40[_0xfd35('0x9')](_0xa2395c);}return _0x11ed40['status'](_0xa2395c)[_0xfd35('0xa')]();};}function respondWithResult(_0x1da506,_0x58d938){_0x58d938=_0x58d938||0xc8;return function(_0x51df18){if(_0x51df18){return _0x1da506[_0xfd35('0xb')](_0x58d938)[_0xfd35('0xc')](_0x51df18);}};}function respondWithFilteredResult(_0x320a21,_0x3f9ed){return function(_0x1b29f2){if(_0x1b29f2){var _0x55979d=typeof _0x3f9ed[_0xfd35('0xd')]==='undefined'&&typeof _0x3f9ed[_0xfd35('0xe')]==='undefined';var _0x47d196=_0x1b29f2[_0xfd35('0xf')];var _0x3030d5=_0x55979d?0x0:_0x3f9ed['offset'];var _0xbd3e8f=_0x55979d?_0x1b29f2[_0xfd35('0xf')]:_0x3f9ed[_0xfd35('0xd')]+_0x3f9ed[_0xfd35('0xe')];var _0x47c7f6;if(_0xbd3e8f>=_0x47d196){_0xbd3e8f=_0x47d196;_0x47c7f6=0xc8;}else{_0x47c7f6=0xce;}_0x320a21[_0xfd35('0xb')](_0x47c7f6);return _0x320a21['set'](_0xfd35('0x10'),_0x3030d5+'-'+_0xbd3e8f+'/'+_0x47d196)[_0xfd35('0xc')](_0x1b29f2);}return null;};}function removeEntity(_0x13a5c2){return function(_0x10c637){if(_0x10c637){return _0x10c637[_0xfd35('0x11')]()[_0xfd35('0x12')](function(){var _0x313080=_0x10c637[_0xfd35('0x13')]({'plain':!![]});var _0x3b3723=[{'name':'InboundRoutes','value':_0xfd35('0x14'),'ignore':![]},{'name':'OutboundRoutes','value':_0xfd35('0x15'),'ignore':![]},{'name':_0xfd35('0x16'),'value':_0xfd35('0x17'),'ignore':![]}];var _0x41473d=_(_0x3b3723)[_0xfd35('0x18')](_0xfd35('0x19'))[_0xfd35('0x1a')](_0xfd35('0x1b'))[_0xfd35('0x1b')]();if(_[_0xfd35('0x1c')](_0x41473d,_0x313080[_0xfd35('0x1d')])){return;}var _0x1b79ef=_[_0xfd35('0x1e')](_0x3b3723,['value',_0x313080[_0xfd35('0x1d')]])[_0xfd35('0x1f')];return db[_0xfd35('0x20')][_0xfd35('0x11')]({'where':{'type':_0x1b79ef,'resourceId':_0x313080['id']}})['then'](function(){return _0x10c637;});})[_0xfd35('0x12')](function(){_0x13a5c2[_0xfd35('0xb')](0xcc)[_0xfd35('0xa')]();});}};}function handleEntityNotFound(_0x46f893){return function(_0x28942b){if(!_0x28942b){_0x46f893[_0xfd35('0x9')](0x194);}return _0x28942b;};}function handleError(_0x2e6c1b,_0x39d830){_0x39d830=_0x39d830||0x1f4;return function(_0x16f804){logger['error'](_0x16f804[_0xfd35('0x21')]);if(_0x16f804['name']){delete _0x16f804[_0xfd35('0x1f')];}_0x2e6c1b[_0xfd35('0xb')](_0x39d830)['send'](_0x16f804);};}exports[_0xfd35('0x22')]=function(_0x3fb963,_0x55d1e5){var _0x5f1679={},_0x2954a2={},_0x333d68={'count':0x0,'rows':[]};var _0x2b1eae=_[_0xfd35('0x1a')](db['VoiceExtension'][_0xfd35('0x23')],function(_0x5bf9fb){return{'name':_0x5bf9fb['fieldName'],'type':_0x5bf9fb['type'][_0xfd35('0x24')]};});_0x2954a2[_0xfd35('0x25')]=_[_0xfd35('0x1a')](_0x2b1eae,_0xfd35('0x1f'));_0x2954a2[_0xfd35('0x26')]=_[_0xfd35('0x27')](_0x3fb963[_0xfd35('0x26')]);_0x2954a2[_0xfd35('0x28')]=_[_0xfd35('0x29')](_0x2954a2[_0xfd35('0x25')],_0x2954a2[_0xfd35('0x26')]);_0x5f1679[_0xfd35('0x2a')]=_[_0xfd35('0x29')](_0x2954a2[_0xfd35('0x25')],qs['fields'](_0x3fb963[_0xfd35('0x26')][_0xfd35('0x2b')]));_0x5f1679[_0xfd35('0x2a')]=_0x5f1679[_0xfd35('0x2a')][_0xfd35('0x2c')]?_0x5f1679[_0xfd35('0x2a')]:_0x2954a2['model'];if(!_0x3fb963[_0xfd35('0x26')][_0xfd35('0x2d')](_0xfd35('0x2e'))){_0x5f1679[_0xfd35('0xe')]=qs[_0xfd35('0xe')](_0x3fb963['query'][_0xfd35('0xe')]);_0x5f1679['offset']=qs[_0xfd35('0xd')](_0x3fb963[_0xfd35('0x26')][_0xfd35('0xd')]);}_0x5f1679[_0xfd35('0x2f')]=qs[_0xfd35('0x30')](_0x3fb963[_0xfd35('0x26')][_0xfd35('0x30')]);_0x5f1679[_0xfd35('0x31')]=qs[_0xfd35('0x28')](_[_0xfd35('0x32')](_0x3fb963[_0xfd35('0x26')],_0x2954a2[_0xfd35('0x28')]),_0x2b1eae);if(_0x3fb963[_0xfd35('0x26')][_0xfd35('0x18')]){_0x5f1679[_0xfd35('0x31')]=_['merge'](_0x5f1679[_0xfd35('0x31')],{'$or':_[_0xfd35('0x1a')](_0x2b1eae,function(_0x2884ea){if(_0x2884ea[_0xfd35('0x1d')]!==_0xfd35('0x33')){var _0x55947b={};_0x55947b[_0x2884ea[_0xfd35('0x1f')]]={'$like':'%'+_0x3fb963[_0xfd35('0x26')][_0xfd35('0x18')]+'%'};return _0x55947b;}})});}_0x5f1679=_[_0xfd35('0x34')]({},_0x5f1679,_0x3fb963[_0xfd35('0x35')]);var _0x196512={'where':_0x5f1679['where']};return db[_0xfd35('0x36')][_0xfd35('0xf')](_0x196512)[_0xfd35('0x12')](function(_0x2f2182){_0x333d68[_0xfd35('0xf')]=_0x2f2182;if(_0x3fb963[_0xfd35('0x26')][_0xfd35('0x37')]){_0x5f1679[_0xfd35('0x38')]=[{'all':!![]}];}return db[_0xfd35('0x36')][_0xfd35('0x39')](_0x5f1679);})[_0xfd35('0x12')](function(_0x5eff13){_0x333d68[_0xfd35('0x3a')]=_0x5eff13;return _0x333d68;})[_0xfd35('0x12')](respondWithFilteredResult(_0x55d1e5,_0x5f1679))[_0xfd35('0x3b')](handleError(_0x55d1e5,null));};exports[_0xfd35('0x3c')]=function(_0x4cfbdf,_0xf8f488){var _0x588d57={'raw':![],'where':{'id':_0x4cfbdf[_0xfd35('0x3d')]['id']}},_0x41245a={};_0x41245a[_0xfd35('0x25')]=_[_0xfd35('0x27')](db[_0xfd35('0x36')][_0xfd35('0x23')]);_0x41245a[_0xfd35('0x26')]=_['keys'](_0x4cfbdf[_0xfd35('0x26')]);_0x41245a['filters']=_[_0xfd35('0x29')](_0x41245a[_0xfd35('0x25')],_0x41245a[_0xfd35('0x26')]);_0x588d57['attributes']=_[_0xfd35('0x29')](_0x41245a[_0xfd35('0x25')],qs[_0xfd35('0x2b')](_0x4cfbdf[_0xfd35('0x26')][_0xfd35('0x2b')]));_0x588d57[_0xfd35('0x2a')]=_0x588d57[_0xfd35('0x2a')][_0xfd35('0x2c')]?_0x588d57[_0xfd35('0x2a')]:_0x41245a[_0xfd35('0x25')];if(_0x4cfbdf[_0xfd35('0x26')]['includeAll']){_0x588d57[_0xfd35('0x38')]=[{'all':!![]}];}_0x588d57=_['merge']({},_0x588d57,_0x4cfbdf[_0xfd35('0x35')]);return db['VoiceExtension'][_0xfd35('0x1e')](_0x588d57)[_0xfd35('0x12')](handleEntityNotFound(_0xf8f488,null))[_0xfd35('0x12')](respondWithResult(_0xf8f488,null))[_0xfd35('0x3b')](handleError(_0xf8f488,null));};exports[_0xfd35('0x11')]=function(_0x16afb9,_0x50660b){return db[_0xfd35('0x36')][_0xfd35('0x1e')]({'where':{'id':_0x16afb9[_0xfd35('0x3d')]['id']}})['then'](handleEntityNotFound(_0x50660b,null))[_0xfd35('0x12')](removeEntity(_0x50660b,null))[_0xfd35('0x3b')](handleError(_0x50660b,null));};exports[_0xfd35('0x3e')]=function(_0x4d3727,_0x35feab){if(_0x4d3727[_0xfd35('0x3f')][_0xfd35('0x1d')]===_0xfd35('0x15')&&!_[_0xfd35('0x40')](_0x4d3727[_0xfd35('0x3f')][_0xfd35('0x41')],'_')){_0x4d3727['body'][_0xfd35('0x41')]='_'[_0xfd35('0x42')](_0x4d3727[_0xfd35('0x3f')][_0xfd35('0x41')]);}return db[_0xfd35('0x36')]['create'](_0x4d3727[_0xfd35('0x3f')],{'raw':![]})[_0xfd35('0x12')](function(_0x4f2b27){var _0x3b4e9d=_0x4d3727[_0xfd35('0x43')]['get']({'plain':!![]});if(!_0x3b4e9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b4e9d[_0xfd35('0x44')]===_0xfd35('0x43')){var _0x421187=_0x4f2b27[_0xfd35('0x13')]({'plain':!![]});var _0xa933a1=[{'name':'InboundRoutes','value':_0xfd35('0x14')},{'name':_0xfd35('0x45'),'value':_0xfd35('0x15')},{'name':'InternalRoutes','value':_0xfd35('0x17')}];var _0x18c602=_[_0xfd35('0x1e')](_0xa933a1,['value',_0x421187[_0xfd35('0x1d')]])[_0xfd35('0x1f')];return db[_0xfd35('0x46')][_0xfd35('0x1e')]({'where':{'name':_0x18c602,'userProfileId':_0x3b4e9d[_0xfd35('0x47')]},'raw':!![]})[_0xfd35('0x12')](function(_0x2b5113){if(_0x2b5113&&_0x2b5113['autoAssociation']===0x0){return db[_0xfd35('0x20')][_0xfd35('0x3e')]({'name':_0x421187[_0xfd35('0x1f')],'resourceId':_0x421187['id'],'type':_0x2b5113[_0xfd35('0x1f')],'sectionId':_0x2b5113['id']},{})['then'](function(){return _0x4f2b27;});}else{return _0x4f2b27;}})[_0xfd35('0x3b')](function(_0x47b176){logger[_0xfd35('0x48')](_0xfd35('0x49'),_0x47b176);throw _0x47b176;});}return _0x4f2b27;})[_0xfd35('0x12')](respondWithResult(_0x35feab,0xc9))[_0xfd35('0x3b')](handleError(_0x35feab,null));};exports[_0xfd35('0x4a')]=function(_0x5f4282,_0x231e32){if(_0x5f4282[_0xfd35('0x3f')]['id']){delete _0x5f4282[_0xfd35('0x3f')]['id'];}return db[_0xfd35('0x36')][_0xfd35('0x1e')]({'where':{'id':_0x5f4282[_0xfd35('0x3d')]['id']}})[_0xfd35('0x12')](handleEntityNotFound(_0x231e32,null))['then'](function(_0x57821b){if(_0x57821b){return db['VoiceExtension'][_0xfd35('0x4a')](_[_0xfd35('0x32')](_0x5f4282['body'],[_0xfd35('0x41'),_0xfd35('0x4b'),'description',_0xfd35('0x4c'),_0xfd35('0x4d'),_0xfd35('0x4e'),_0xfd35('0x4f')]),{'where':{'context':_0x57821b['context'],'exten':_0x57821b[_0xfd35('0x41')]},'individualHooks':!![]})[_0xfd35('0x12')](function(_0x27142c){return _0x27142c;});}return null;})[_0xfd35('0x12')](respondWithStatusCode(_0x231e32,null))[_0xfd35('0x3b')](handleError(_0x231e32,null));};exports['addApplications']=function(_0x6d9918,_0x3d9e48){return db['VoiceExtension'][_0xfd35('0x50')]({'where':{'id':_0x6d9918['params']['id']}})[_0xfd35('0x12')](function(_0x3e3a5c){if(_0x3e3a5c){return db[_0xfd35('0x51')][_0xfd35('0x52')](function(_0x374b7a){return db[_0xfd35('0x36')]['destroy']({'where':{'VoiceExtensionId':_0x6d9918[_0xfd35('0x3d')]['id']},'transaction':_0x374b7a})[_0xfd35('0x12')](function(){var _0x2dd8a7=_[_0xfd35('0x1a')](_0x6d9918[_0xfd35('0x3f')],function(_0x87f24f){_0x87f24f[_0xfd35('0x53')]=_0x6d9918['params']['id'];_0x87f24f[_0xfd35('0x54')]=!![];return _0x87f24f;});return _0x3e3a5c['createRouting'](_0x2dd8a7);})[_0xfd35('0x12')](function(_0x443812){console[_0xfd35('0x55')](_0xfd35('0x56'),_0x443812);return db[_0xfd35('0x36')][_0xfd35('0x57')](_0x443812,{'transaction':_0x374b7a});});})[_0xfd35('0x12')](function(){return db[_0xfd35('0x36')][_0xfd35('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x6d9918['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x3d9e48,null))[_0xfd35('0x3b')](handleError(_0x3d9e48,null));}; \ No newline at end of file +var _0x58e5=['sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','startsWith','exten','concat','create','user','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','register','status','json','undefined','limit','offset','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','sendStatus','stack','VoiceExtension','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58e5,0xd1));var _0x558e=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x58e5[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0x558e('0x0'));var Redis=require(_0x558e('0x1'));var qs=require(_0x558e('0x2'));var logger=require(_0x558e('0x3'))(_0x558e('0x4'));var config=require(_0x558e('0x5'));var db=require('../../mysqldb')['db'];config[_0x558e('0x6')]=_['defaults'](config['redis'],{'host':_0x558e('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x558e('0x6')]));require('./voiceExtension.socket')[_0x558e('0x8')](socket);function respondWithStatusCode(_0xdf6e1e,_0x533a69){_0x533a69=_0x533a69||0xcc;return function(_0x58c368){if(_0x58c368){return _0xdf6e1e['sendStatus'](_0x533a69);}return _0xdf6e1e['status'](_0x533a69)['end']();};}function respondWithResult(_0x29c7ac,_0x8b89a){_0x8b89a=_0x8b89a||0xc8;return function(_0x5d1e17){if(_0x5d1e17){return _0x29c7ac[_0x558e('0x9')](_0x8b89a)[_0x558e('0xa')](_0x5d1e17);}};}function respondWithFilteredResult(_0x12be93,_0x10e25c){return function(_0x49a166){if(_0x49a166){var _0x163783=typeof _0x10e25c['offset']===_0x558e('0xb')&&typeof _0x10e25c[_0x558e('0xc')]===_0x558e('0xb');var _0x3bd154=_0x49a166['count'];var _0x407afd=_0x163783?0x0:_0x10e25c[_0x558e('0xd')];var _0x519a4d=_0x163783?_0x49a166[_0x558e('0xe')]:_0x10e25c[_0x558e('0xd')]+_0x10e25c['limit'];var _0x23d153;if(_0x519a4d>=_0x3bd154){_0x519a4d=_0x3bd154;_0x23d153=0xc8;}else{_0x23d153=0xce;}_0x12be93['status'](_0x23d153);return _0x12be93[_0x558e('0xf')](_0x558e('0x10'),_0x407afd+'-'+_0x519a4d+'/'+_0x3bd154)['json'](_0x49a166);}return null;};}function removeEntity(_0x21552c){return function(_0x110094){if(_0x110094){return _0x110094[_0x558e('0x11')]()[_0x558e('0x12')](function(){var _0x4c8ffb=_0x110094[_0x558e('0x13')]({'plain':!![]});var _0x120be6=[{'name':_0x558e('0x14'),'value':_0x558e('0x15'),'ignore':![]},{'name':_0x558e('0x16'),'value':_0x558e('0x17'),'ignore':![]},{'name':_0x558e('0x18'),'value':'internal','ignore':![]}];var _0x4afcfe=_(_0x120be6)[_0x558e('0x19')](_0x558e('0x1a'))[_0x558e('0x1b')](_0x558e('0x1c'))[_0x558e('0x1c')]();if(_[_0x558e('0x1d')](_0x4afcfe,_0x4c8ffb[_0x558e('0x1e')])){return;}var _0x2e3279=_[_0x558e('0x1f')](_0x120be6,[_0x558e('0x1c'),_0x4c8ffb['type']])[_0x558e('0x20')];return db[_0x558e('0x21')]['destroy']({'where':{'type':_0x2e3279,'resourceId':_0x4c8ffb['id']}})['then'](function(){return _0x110094;});})[_0x558e('0x12')](function(){_0x21552c[_0x558e('0x9')](0xcc)[_0x558e('0x22')]();});}};}function handleEntityNotFound(_0x44b7fe){return function(_0x58beca){if(!_0x58beca){_0x44b7fe[_0x558e('0x23')](0x194);}return _0x58beca;};}function handleError(_0xb9c059,_0x57b569){_0x57b569=_0x57b569||0x1f4;return function(_0x26874d){logger['error'](_0x26874d[_0x558e('0x24')]);if(_0x26874d[_0x558e('0x20')]){delete _0x26874d[_0x558e('0x20')];}_0xb9c059[_0x558e('0x9')](_0x57b569)['send'](_0x26874d);};}exports['index']=function(_0x240e0b,_0x4d1561){var _0x480613={},_0x2dc860={},_0x1d02c5={'count':0x0,'rows':[]};var _0x1112a7=_[_0x558e('0x1b')](db[_0x558e('0x25')]['rawAttributes'],function(_0x2e0166){return{'name':_0x2e0166[_0x558e('0x26')],'type':_0x2e0166[_0x558e('0x1e')]['key']};});_0x2dc860[_0x558e('0x27')]=_[_0x558e('0x1b')](_0x1112a7,_0x558e('0x20'));_0x2dc860[_0x558e('0x28')]=_[_0x558e('0x29')](_0x240e0b[_0x558e('0x28')]);_0x2dc860[_0x558e('0x2a')]=_[_0x558e('0x2b')](_0x2dc860[_0x558e('0x27')],_0x2dc860[_0x558e('0x28')]);_0x480613['attributes']=_[_0x558e('0x2b')](_0x2dc860[_0x558e('0x27')],qs[_0x558e('0x2c')](_0x240e0b[_0x558e('0x28')]['fields']));_0x480613['attributes']=_0x480613[_0x558e('0x2d')][_0x558e('0x2e')]?_0x480613[_0x558e('0x2d')]:_0x2dc860[_0x558e('0x27')];if(!_0x240e0b['query']['hasOwnProperty'](_0x558e('0x2f'))){_0x480613[_0x558e('0xc')]=qs[_0x558e('0xc')](_0x240e0b[_0x558e('0x28')][_0x558e('0xc')]);_0x480613[_0x558e('0xd')]=qs[_0x558e('0xd')](_0x240e0b[_0x558e('0x28')][_0x558e('0xd')]);}_0x480613[_0x558e('0x30')]=qs[_0x558e('0x31')](_0x240e0b['query'][_0x558e('0x31')]);_0x480613[_0x558e('0x32')]=qs['filters'](_['pick'](_0x240e0b['query'],_0x2dc860[_0x558e('0x2a')]),_0x1112a7);if(_0x240e0b[_0x558e('0x28')]['filter']){_0x480613[_0x558e('0x32')]=_[_0x558e('0x33')](_0x480613[_0x558e('0x32')],{'$or':_[_0x558e('0x1b')](_0x1112a7,function(_0x4e16a8){if(_0x4e16a8[_0x558e('0x1e')]!==_0x558e('0x34')){var _0x5614b8={};_0x5614b8[_0x4e16a8['name']]={'$like':'%'+_0x240e0b[_0x558e('0x28')][_0x558e('0x19')]+'%'};return _0x5614b8;}})});}_0x480613=_['merge']({},_0x480613,_0x240e0b[_0x558e('0x35')]);var _0x3f8f91={'where':_0x480613[_0x558e('0x32')]};return db['VoiceExtension'][_0x558e('0xe')](_0x3f8f91)[_0x558e('0x12')](function(_0x133018){_0x1d02c5[_0x558e('0xe')]=_0x133018;if(_0x240e0b[_0x558e('0x28')][_0x558e('0x36')]){_0x480613[_0x558e('0x37')]=[{'all':!![]}];}return db[_0x558e('0x25')][_0x558e('0x38')](_0x480613);})['then'](function(_0x20a1e5){_0x1d02c5[_0x558e('0x39')]=_0x20a1e5;return _0x1d02c5;})[_0x558e('0x12')](respondWithFilteredResult(_0x4d1561,_0x480613))[_0x558e('0x3a')](handleError(_0x4d1561,null));};exports[_0x558e('0x3b')]=function(_0xd61497,_0x8909){var _0x1b8f8b={'raw':![],'where':{'id':_0xd61497[_0x558e('0x3c')]['id']}},_0x347bf6={};_0x347bf6[_0x558e('0x27')]=_[_0x558e('0x29')](db[_0x558e('0x25')]['rawAttributes']);_0x347bf6[_0x558e('0x28')]=_[_0x558e('0x29')](_0xd61497[_0x558e('0x28')]);_0x347bf6['filters']=_[_0x558e('0x2b')](_0x347bf6[_0x558e('0x27')],_0x347bf6[_0x558e('0x28')]);_0x1b8f8b['attributes']=_[_0x558e('0x2b')](_0x347bf6[_0x558e('0x27')],qs[_0x558e('0x2c')](_0xd61497[_0x558e('0x28')][_0x558e('0x2c')]));_0x1b8f8b[_0x558e('0x2d')]=_0x1b8f8b[_0x558e('0x2d')][_0x558e('0x2e')]?_0x1b8f8b[_0x558e('0x2d')]:_0x347bf6[_0x558e('0x27')];if(_0xd61497[_0x558e('0x28')][_0x558e('0x36')]){_0x1b8f8b[_0x558e('0x37')]=[{'all':!![]}];}_0x1b8f8b=_[_0x558e('0x33')]({},_0x1b8f8b,_0xd61497['options']);return db[_0x558e('0x25')][_0x558e('0x1f')](_0x1b8f8b)['then'](handleEntityNotFound(_0x8909,null))[_0x558e('0x12')](respondWithResult(_0x8909,null))['catch'](handleError(_0x8909,null));};exports[_0x558e('0x11')]=function(_0x1ce47c,_0x4474e8){return db[_0x558e('0x25')][_0x558e('0x1f')]({'where':{'id':_0x1ce47c[_0x558e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4474e8,null))['then'](removeEntity(_0x4474e8,null))['catch'](handleError(_0x4474e8,null));};exports['create']=function(_0x29f92f,_0x10380f){if(_0x29f92f[_0x558e('0x3d')][_0x558e('0x1e')]==='outbound'&&!_[_0x558e('0x3e')](_0x29f92f[_0x558e('0x3d')][_0x558e('0x3f')],'_')){_0x29f92f[_0x558e('0x3d')][_0x558e('0x3f')]='_'[_0x558e('0x40')](_0x29f92f[_0x558e('0x3d')][_0x558e('0x3f')]);}return db['VoiceExtension'][_0x558e('0x41')](_0x29f92f[_0x558e('0x3d')],{'raw':![]})[_0x558e('0x12')](function(_0x4b5353){var _0x1cdaa6=_0x29f92f[_0x558e('0x42')][_0x558e('0x13')]({'plain':!![]});if(!_0x1cdaa6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cdaa6['role']===_0x558e('0x42')){var _0x4465eb=_0x4b5353[_0x558e('0x13')]({'plain':!![]});var _0xe1d543=[{'name':_0x558e('0x14'),'value':_0x558e('0x15')},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':_0x558e('0x43')}];var _0x2822e8=_['find'](_0xe1d543,[_0x558e('0x1c'),_0x4465eb[_0x558e('0x1e')]])[_0x558e('0x20')];return db[_0x558e('0x44')]['find']({'where':{'name':_0x2822e8,'userProfileId':_0x1cdaa6[_0x558e('0x45')]},'raw':!![]})['then'](function(_0x200eb2){if(_0x200eb2&&_0x200eb2[_0x558e('0x46')]===0x0){return db[_0x558e('0x21')][_0x558e('0x41')]({'name':_0x4465eb[_0x558e('0x20')],'resourceId':_0x4465eb['id'],'type':_0x200eb2[_0x558e('0x20')],'sectionId':_0x200eb2['id']},{})[_0x558e('0x12')](function(){return _0x4b5353;});}else{return _0x4b5353;}})[_0x558e('0x3a')](function(_0x45dfcb){logger['error'](_0x558e('0x47'),_0x45dfcb);throw _0x45dfcb;});}return _0x4b5353;})[_0x558e('0x12')](respondWithResult(_0x10380f,0xc9))[_0x558e('0x3a')](handleError(_0x10380f,null));};exports[_0x558e('0x48')]=function(_0x3513da,_0x12b0aa){if(_0x3513da[_0x558e('0x3d')]['id']){delete _0x3513da['body']['id'];}return db['VoiceExtension'][_0x558e('0x1f')]({'where':{'id':_0x3513da[_0x558e('0x3c')]['id']}})[_0x558e('0x12')](handleEntityNotFound(_0x12b0aa,null))[_0x558e('0x12')](function(_0x1fd370){if(_0x1fd370){return db['VoiceExtension'][_0x558e('0x48')](_['pick'](_0x3513da['body'],[_0x558e('0x3f'),_0x558e('0x49'),'description',_0x558e('0x4a'),_0x558e('0x4b'),_0x558e('0x4c'),'alias']),{'where':{'context':_0x1fd370[_0x558e('0x49')],'exten':_0x1fd370[_0x558e('0x3f')]},'individualHooks':!![]})['then'](function(_0x33e67e){return _0x33e67e;});}return null;})[_0x558e('0x12')](respondWithStatusCode(_0x12b0aa,null))['catch'](handleError(_0x12b0aa,null));};exports[_0x558e('0x4d')]=function(_0x30a36b,_0x54e3da){return db[_0x558e('0x25')][_0x558e('0x4e')]({'where':{'id':_0x30a36b[_0x558e('0x3c')]['id']}})[_0x558e('0x12')](function(_0x175540){if(_0x175540){return db[_0x558e('0x4f')][_0x558e('0x50')](function(_0x660ce3){return db[_0x558e('0x25')][_0x558e('0x11')]({'where':{'VoiceExtensionId':_0x30a36b['params']['id']},'transaction':_0x660ce3})[_0x558e('0x12')](function(){var _0x205ae6=_[_0x558e('0x1b')](_0x30a36b[_0x558e('0x3d')],function(_0x519a7b){_0x519a7b[_0x558e('0x51')]=_0x30a36b[_0x558e('0x3c')]['id'];_0x519a7b[_0x558e('0x52')]=!![];return _0x519a7b;});return _0x175540[_0x558e('0x53')](_0x205ae6);})[_0x558e('0x12')](function(_0x4330f1){console['log'](_0x558e('0x54'),_0x4330f1);return db[_0x558e('0x25')]['bulkCreate'](_0x4330f1,{'transaction':_0x660ce3});});})[_0x558e('0x12')](function(){return db[_0x558e('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x30a36b[_0x558e('0x3c')]['id']},'order':_0x558e('0x55')});});}})[_0x558e('0x12')](respondWithResult(_0x54e3da,null))[_0x558e('0x3a')](handleError(_0x54e3da,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index f0955e6..dd2e79c 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 _0xc255=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x2222fb,_0x40c407){var _0x27cf1a=function(_0x29b6f6){while(--_0x29b6f6){_0x2222fb['push'](_0x2222fb['shift']());}};_0x27cf1a(++_0x40c407);}(_0xc255,0x1e1));var _0x5c25=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xc255[_0x470bfb];return _0x2f5d97;};'use strict';var EventEmitter=require(_0x5c25('0x0'));var VoiceExtension=require(_0x5c25('0x1'))['db'][_0x5c25('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5c25('0x3')](0x0);var events={'afterCreate':_0x5c25('0x4'),'afterUpdate':'update','afterDestroy':_0x5c25('0x5')};function emitEvent(_0x2786f1){return function(_0x58f9ce,_0x3bd6b9,_0x30e186){VoiceExtensionEvents['emit'](_0x2786f1+':'+_0x58f9ce['id'],_0x58f9ce);VoiceExtensionEvents[_0x5c25('0x6')](_0x2786f1,_0x58f9ce);_0x30e186(null);};}for(var e in events){if(events[_0x5c25('0x7')](e)){var event=events[e];VoiceExtension[_0x5c25('0x8')](e,emitEvent(event));}}module[_0x5c25('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc67b=['exports','events','../../mysqldb','VoiceExtension','save','update','emit','hasOwnProperty'];(function(_0xf97eb0,_0x1578b7){var _0xea70f4=function(_0x574c8d){while(--_0x574c8d){_0xf97eb0['push'](_0xf97eb0['shift']());}};_0xea70f4(++_0x1578b7);}(_0xc67b,0x139));var _0xbc67=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc67b[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0xbc67('0x0'));var VoiceExtension=require(_0xbc67('0x1'))['db'][_0xbc67('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc67('0x3'),'afterUpdate':_0xbc67('0x4'),'afterDestroy':'remove'};function emitEvent(_0x192532){return function(_0x3595f0,_0x552a89,_0x323b11){VoiceExtensionEvents[_0xbc67('0x5')](_0x192532+':'+_0x3595f0['id'],_0x3595f0);VoiceExtensionEvents[_0xbc67('0x5')](_0x192532,_0x3595f0);_0x323b11(null);};}for(var e in events){if(events[_0xbc67('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xbc67('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index cd214da..dd83bec 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 _0x0f17=['outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','param','prefix','phone','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','appType','custom','answer','XCALLY-MOTION-ANSWER=1','ExecIf','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','then','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var attributes=require(_0x70f1('0x1'));module[_0x70f1('0x2')]=function(_0x584254){var _0x331ae3=_0x584254[_0x70f1('0x3')];function _0x1aa52f(_0x390087){var _0x428227=0x2;var _0x4679e7=[{'type':_0x390087[_0x70f1('0x4')],'app':_0x70f1('0x5'),'appdata':_0x70f1('0x6')+_0x390087[_0x70f1('0x4')],'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087[_0x70f1('0x8')],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']},{'type':_0x390087['type'],'app':_0x390087[_0x70f1('0x9')]?'Set':_0x70f1('0xa'),'appdata':_0x390087[_0x70f1('0x9')]?'CDR(routeAlias)='+_0x390087[_0x70f1('0x9')]:_0x70f1('0xb'),'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087['exten'],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']}];if(_0x390087[_0x70f1('0x4')]===_0x70f1('0xc')){_0x4679e7['push']({'type':_0x70f1('0xc'),'app':_0x70f1('0x5'),'appdata':_0x70f1('0xd')+_0x390087['id'],'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087[_0x70f1('0x8')],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']});}_0x4679e7[_0x70f1('0xe')]({'type':_0x390087[_0x70f1('0x4')],'app':_0x70f1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x390087[_0x70f1('0x7')],'exten':_0x390087['exten'],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']},{'type':_0x390087[_0x70f1('0x4')],'app':'Set','appdata':_0x70f1('0xf'),'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087[_0x70f1('0x8')],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']},{'type':_0x390087[_0x70f1('0x4')],'app':_0x70f1('0x5'),'appdata':_0x70f1('0x10'),'context':_0x390087[_0x70f1('0x7')],'exten':_0x390087['exten'],'priority':_0x428227++,'VoiceExtensionId':_0x390087['id']});return _0x4679e7;}function _0xfb67f1(_0x4f6952){var _0x947fce=0x2;var _0x2bed93=[{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':_0x70f1('0x12'),'context':_0x4f6952['context'],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x4f6952[_0x70f1('0x9')]?'Set':_0x70f1('0xa'),'appdata':_0x4f6952[_0x70f1('0x9')]?_0x70f1('0x13')+_0x4f6952[_0x70f1('0x9')]:'No\x20alias\x20set','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952['exten'],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':'Set','appdata':'CDR(destination)='+(_0x4f6952[_0x70f1('0x14')]?_0x70f1('0x15')+_0x4f6952[_0x70f1('0x14')]+'}':_0x70f1('0x16')),'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952['exten'],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':_0x70f1('0xd')+_0x4f6952['id'],'context':_0x4f6952['context'],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':'outbound','app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x947fce+0x2)+_0x70f1('0x17')+(_0x947fce+0x1)+')','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':_0x4f6952[_0x70f1('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x4f6952['cutdigits']+'}':_0x70f1('0x18'),'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952['exten'],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':'outbound','app':_0x70f1('0x5'),'appdata':'outboundrouteid='+_0x4f6952['id'],'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']}];if(_0x4f6952[_0x70f1('0x19')]('recordingFormat')&&_0x4f6952[_0x70f1('0x1a')]!==_0x70f1('0x1b')){_0x2bed93[_0x70f1('0xe')]({'type':_0x70f1('0x11'),'app':_0x70f1('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']},{'type':'outbound','app':'Set','appdata':_0x70f1('0x1c')+_0x4f6952[_0x70f1('0x1a')]||_0x70f1('0x1d'),'context':_0x4f6952[_0x70f1('0x7')],'exten':_0x4f6952[_0x70f1('0x8')],'priority':_0x947fce++,'VoiceExtensionId':_0x4f6952['id']});}return _0x2bed93;}function _0xb8a75b(_0x18c5b3,_0x4fc542){var _0x37ba81=[{'name':_0x70f1('0x1e'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x70f1('0x1f'),'param':0x2},{'name':_0x70f1('0x20'),'param':0x3}];var _0x13370c={};var _0x3376e8=_0x4fc542[_0x70f1('0x21')](',');var _0x2684d2=[];for(var _0x2e8d78=0x0;_0x2e8d78<_0x37ba81[_0x70f1('0x22')];_0x2e8d78++){switch(_0x37ba81[_0x2e8d78]['name']){case'trunk':_0x13370c[_0x70f1('0x1e')]=_0x3376e8[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]][_0x70f1('0x21')]('/')[0x1];_0x13370c['phone']=_0x3376e8[_0x37ba81[_0x2e8d78]['param']][_0x70f1('0x21')]('/')[0x2];_0x13370c[_0x70f1('0x24')]=_0x13370c[_0x70f1('0x25')]?_0x13370c[_0x70f1('0x25')][_0x70f1('0x21')]('$')[0x0]:undefined;_0x13370c[_0x70f1('0x25')]=_0x18c5b3[_0x70f1('0x14')]?(_0x13370c['prefix']||'')+_0x70f1('0x15')+_0x18c5b3['cutdigits']+'}':(_0x13370c['prefix']||'')+_0x70f1('0x16');_0x2684d2[_0x37ba81[_0x2e8d78]['param']]=['SIP',_0x13370c[_0x70f1('0x1e')],_0x13370c['phone']][_0x70f1('0x26')]('/');break;case _0x70f1('0x1f'):_0x13370c[_0x70f1('0x1f')]=_0x3376e8[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]];if(_0x18c5b3[_0x70f1('0x1a')]!==_0x70f1('0x1b')){if(_0x13370c[_0x70f1('0x1f')][_0x70f1('0x27')](_0x70f1('0x28'))<0x0){_0x13370c[_0x70f1('0x1f')]+='U(xcally-mixmonitor-context)';}}else{_0x13370c[_0x70f1('0x1f')]=_0x13370c[_0x70f1('0x1f')][_0x70f1('0x29')]('U(xcally-mixmonitor-context)','');}_0x2684d2[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]]=_0x13370c[_0x70f1('0x1f')];break;default:_0x2684d2[_0x37ba81[_0x2e8d78]['param']]=_0x3376e8[_0x37ba81[_0x2e8d78][_0x70f1('0x23')]];}}return _0x2684d2[_0x70f1('0x26')](',');}function _0x519425(_0x28f0bf,_0x3af2cf,_0x2aa207){return new Promise(function(_0x447b98,_0x27b82a){var _0x82262a=[];if(_[_0x70f1('0x2a')](_0x3af2cf))return _0x447b98(_0x82262a);_0x331ae3[_0x70f1('0x2b')]['findAll']({'attributes':['id',_0x70f1('0x2c'),'IntervalId'],'raw':!![]})['then'](function(_0x46098d){for(var _0x5627c1=0x0,_0x231d53=0x0;_0x5627c1<_0x3af2cf[_0x70f1('0x22')];_0x5627c1++,_0x231d53=0x0){var _0x1cbf80=_0x3af2cf[_0x5627c1];var _0x465746=[];var _0x5537d8=[];delete _0x1cbf80['id'];if(_0x1cbf80[_0x70f1('0x2c')]!==_0x70f1('0x2d')){_0x1cbf80[_0x70f1('0x2e')]=[_0x1cbf80['interval']];}else{_0x1cbf80['intervals']=_0x1cbf80[_0x70f1('0x2f')]?_[_0x70f1('0x30')](_['filter'](_0x46098d,{'IntervalId':_0x1cbf80[_0x70f1('0x2f')]}),'interval'):[];}_0x1cbf80[_0x70f1('0x7')]=_0x28f0bf['context'];_0x1cbf80[_0x70f1('0x8')]=_0x28f0bf[_0x70f1('0x8')];if(_0x1cbf80['type'])_0x1cbf80[_0x70f1('0x4')]=_0x1cbf80[_0x70f1('0x4')][_0x70f1('0x31')]();if(_0x28f0bf[_0x70f1('0x4')]===_0x70f1('0x11')){if(_0x1cbf80[_0x70f1('0x19')](_0x70f1('0x32'))&&_0x1cbf80['tag']&&_0x1cbf80[_0x70f1('0x32')]!=='--'){_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80[_0x70f1('0x4')][_0x70f1('0x31')](),'app':'Set','appdata':_0x70f1('0x33')+_0x1cbf80[_0x70f1('0x32')],'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80['type']['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1cbf80[_0x70f1('0x34')]?_0x70f1('0x35')+_0x1cbf80[_0x70f1('0x34')]+')':_0x70f1('0x36')),'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}else{if(_0x1cbf80['hasOwnProperty']('answer')){if([_0x70f1('0x37'),_0x70f1('0x38')][_0x70f1('0x39')](_0x1cbf80['app'][_0x70f1('0x31')]())&&_0x1cbf80[_0x70f1('0x3a')]!==_0x70f1('0x3b')){if(_0x1cbf80[_0x70f1('0x3c')]){_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80[_0x70f1('0x4')][_0x70f1('0x31')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80[_0x70f1('0x4')]['toLowerCase'](),'app':'Set','appdata':_0x70f1('0x3d'),'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80['intervals'][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}else{_0x465746[_0x70f1('0xe')]({'type':_0x1cbf80['type'][_0x70f1('0x31')](),'app':_0x70f1('0x3e'),'appdata':_0x70f1('0x3f'),'context':_0x28f0bf[_0x70f1('0x7')],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80['intervals'][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});_0x465746['push']({'type':_0x1cbf80['type'][_0x70f1('0x31')](),'app':_0x70f1('0x5'),'appdata':_0x70f1('0x40'),'context':_0x28f0bf['context'],'exten':_0x28f0bf[_0x70f1('0x8')],'priority':_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]+_0x2aa207+_0x231d53++,'VoiceExtensionId':_0x28f0bf['id']});}}}}for(var _0x409420=0x0;_0x409420<_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')];_0x409420++){var _0x463e76=_0x2aa207+_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')];var _0x1cd39e=_0x409420===_0x1cbf80[_0x70f1('0x2e')][_0x70f1('0x22')]-0x1?_0x2aa207+_0x465746[_0x70f1('0x22')]+_0x5537d8[_0x70f1('0x22')]+0x2:_0x2aa207+_0x409420+0x1;_0x465746[_0x70f1('0x41')](_0x409420,0x0,{'type':_0x28f0bf['type'],'app':_0x70f1('0x42'),'appdata':_0x1cbf80[_0x70f1('0x2e')][_0x409420]+'?'+_0x28f0bf['context']+_0x70f1('0x43')+_0x463e76+':'+_0x28f0bf[_0x70f1('0x7')]+_0x70f1('0x43')+_0x1cd39e,'exten':_0x28f0bf['exten'],'context':_0x28f0bf[_0x70f1('0x7')],'priority':_0x2aa207+_0x409420,'VoiceExtensionId':_0x28f0bf['id']});}if(_0x1cbf80[_0x70f1('0x3a')]===_0x70f1('0x44'))_0x1cbf80['appdata']=_0xb8a75b(_0x28f0bf,_0x1cbf80[_0x70f1('0x45')]);_0x1cbf80[_0x70f1('0x46')]=_0x465746[_0x70f1('0x22')]?_[_0x70f1('0x47')](_0x465746)[_0x70f1('0x46')]+0x1:_0x2aa207;_0x82262a=_['concat'](_0x82262a,_0x465746,[_0x1cbf80],_0x5537d8);_0x2aa207=_[_0x70f1('0x47')](_0x82262a)[_0x70f1('0x46')]+0x1;}return _0x447b98(_0x82262a);})[_0x70f1('0x48')](function(_0x3916b2){_0x27b82a(_0x3916b2);});});}return _0x584254[_0x70f1('0x49')](_0x70f1('0x4a'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x403572){var _0xde6208=this['get']({'plain':!![]});var _0x299548=_0xde6208['type']===_0x70f1('0x11')?_0xfb67f1(_0xde6208):_0x1aa52f(_0xde6208);return _0x519425(_0xde6208,_0x403572,_['last'](_0x299548)['priority']+0x1)[_0x70f1('0x4b')](function(_0x443b85){var _0x9139be=_[_0x70f1('0x4c')](_0x299548,_0x443b85);_0x9139be[_0x70f1('0xe')]({'type':_0xde6208[_0x70f1('0x4')],'app':_0x70f1('0x4d'),'exten':_0xde6208['exten'],'context':_0xde6208[_0x70f1('0x7')],'priority':_[_0x70f1('0x47')](_0x9139be)[_0x70f1('0x46')]+0x1,'VoiceExtensionId':_0xde6208['id']});return _0x9139be;});}}});}; \ No newline at end of file +var _0x9ab0=['MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','param','split','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','length','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','type','context','exten','alias','Set','NoOp','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0'];(function(_0x2b5ad0,_0x12c399){var _0x4cba07=function(_0x2dd462){while(--_0x2dd462){_0x2b5ad0['push'](_0x2b5ad0['shift']());}};_0x4cba07(++_0x12c399);}(_0x9ab0,0x195));var _0x09ab=function(_0x5d32ed,_0xc2d8fb){_0x5d32ed=_0x5d32ed-0x0;var _0x483f4e=_0x9ab0[_0x5d32ed];return _0x483f4e;};'use strict';var _=require(_0x09ab('0x0'));var attributes=require(_0x09ab('0x1'));module[_0x09ab('0x2')]=function(_0x28d64f){var _0x38fee4=_0x28d64f[_0x09ab('0x3')];function _0x38c30a(_0x3601d4){var _0x3c0cd0=0x2;var _0x4bb59a=[{'type':_0x3601d4['type'],'app':'Set','appdata':_0x09ab('0x4')+_0x3601d4[_0x09ab('0x5')],'context':_0x3601d4[_0x09ab('0x6')],'exten':_0x3601d4[_0x09ab('0x7')],'priority':_0x3c0cd0++,'VoiceExtensionId':_0x3601d4['id']},{'type':_0x3601d4[_0x09ab('0x5')],'app':_0x3601d4[_0x09ab('0x8')]?_0x09ab('0x9'):_0x09ab('0xa'),'appdata':_0x3601d4[_0x09ab('0x8')]?'CDR(routeAlias)='+_0x3601d4[_0x09ab('0x8')]:'No\x20alias\x20set','context':_0x3601d4[_0x09ab('0x6')],'exten':_0x3601d4[_0x09ab('0x7')],'priority':_0x3c0cd0++,'VoiceExtensionId':_0x3601d4['id']}];if(_0x3601d4[_0x09ab('0x5')]==='inbound'){_0x4bb59a['push']({'type':_0x09ab('0xb'),'app':_0x09ab('0x9'),'appdata':'CDR(routeid)='+_0x3601d4['id'],'context':_0x3601d4['context'],'exten':_0x3601d4[_0x09ab('0x7')],'priority':_0x3c0cd0++,'VoiceExtensionId':_0x3601d4['id']});}_0x4bb59a[_0x09ab('0xc')]({'type':_0x3601d4[_0x09ab('0x5')],'app':_0x09ab('0x9'),'appdata':_0x09ab('0xd'),'context':_0x3601d4[_0x09ab('0x6')],'exten':_0x3601d4[_0x09ab('0x7')],'priority':_0x3c0cd0++,'VoiceExtensionId':_0x3601d4['id']},{'type':_0x3601d4[_0x09ab('0x5')],'app':_0x09ab('0x9'),'appdata':_0x09ab('0xe'),'context':_0x3601d4[_0x09ab('0x6')],'exten':_0x3601d4[_0x09ab('0x7')],'priority':_0x3c0cd0++,'VoiceExtensionId':_0x3601d4['id']},{'type':_0x3601d4['type'],'app':_0x09ab('0x9'),'appdata':_0x09ab('0xf'),'context':_0x3601d4[_0x09ab('0x6')],'exten':_0x3601d4['exten'],'priority':_0x3c0cd0++,'VoiceExtensionId':_0x3601d4['id']});return _0x4bb59a;}function _0x21db00(_0x23160e){var _0x2f75a8=0x2;var _0x574b0f=[{'type':_0x09ab('0x10'),'app':_0x09ab('0x9'),'appdata':_0x09ab('0x11'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':_0x23160e['alias']?_0x09ab('0x9'):_0x09ab('0xa'),'appdata':_0x23160e['alias']?_0x09ab('0x12')+_0x23160e[_0x09ab('0x8')]:_0x09ab('0x13'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':_0x09ab('0x9'),'appdata':_0x09ab('0x14')+(_0x23160e['cutdigits']?_0x09ab('0x15')+_0x23160e[_0x09ab('0x16')]+'}':_0x09ab('0x17')),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':'Set','appdata':_0x09ab('0x18')+_0x23160e['id'],'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':_0x09ab('0x19'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2f75a8+0x2)+'):Goto('+(_0x2f75a8+0x1)+')','context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':'outbound','app':_0x09ab('0x9'),'appdata':_0x23160e[_0x09ab('0x16')]?_0x09ab('0x1a')+_0x23160e[_0x09ab('0x16')]+'}':_0x09ab('0x1b'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':'Set','appdata':_0x09ab('0xd'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':_0x09ab('0x9'),'appdata':_0x09ab('0xe'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':_0x09ab('0x9'),'appdata':_0x09ab('0xf'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':'outbound','app':_0x09ab('0x9'),'appdata':_0x09ab('0x1c')+_0x23160e['id'],'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']}];if(_0x23160e[_0x09ab('0x1d')](_0x09ab('0x1e'))&&_0x23160e[_0x09ab('0x1e')]!==_0x09ab('0x1f')){_0x574b0f[_0x09ab('0xc')]({'type':'outbound','app':'Set','appdata':_0x09ab('0x20'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e['exten'],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']},{'type':_0x09ab('0x10'),'app':_0x09ab('0x9'),'appdata':_0x09ab('0x21')+_0x23160e['recordingFormat']||_0x09ab('0x22'),'context':_0x23160e[_0x09ab('0x6')],'exten':_0x23160e[_0x09ab('0x7')],'priority':_0x2f75a8++,'VoiceExtensionId':_0x23160e['id']});}return _0x574b0f;}function _0x527d91(_0x4e908d,_0x1a225c){var _0x2141a3=[{'name':_0x09ab('0x23'),'param':0x0},{'name':_0x09ab('0x24'),'param':0x1},{'name':_0x09ab('0x25'),'param':0x2},{'name':'url','param':0x3}];var _0x307aca={};var _0x3080ca=_0x1a225c['split'](',');var _0x429e17=[];for(var _0x39c4ab=0x0;_0x39c4ab<_0x2141a3['length'];_0x39c4ab++){switch(_0x2141a3[_0x39c4ab]['name']){case'trunk':_0x307aca['trunk']=_0x3080ca[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]][_0x09ab('0x27')]('/')[0x1];_0x307aca['phone']=_0x3080ca[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]][_0x09ab('0x27')]('/')[0x2];_0x307aca[_0x09ab('0x28')]=_0x307aca[_0x09ab('0x29')]?_0x307aca['phone'][_0x09ab('0x27')]('$')[0x0]:undefined;_0x307aca[_0x09ab('0x29')]=_0x4e908d[_0x09ab('0x16')]?(_0x307aca[_0x09ab('0x28')]||'')+_0x09ab('0x15')+_0x4e908d[_0x09ab('0x16')]+'}':(_0x307aca[_0x09ab('0x28')]||'')+_0x09ab('0x17');_0x429e17[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]]=[_0x09ab('0x2a'),_0x307aca[_0x09ab('0x23')],_0x307aca[_0x09ab('0x29')]]['join']('/');break;case _0x09ab('0x25'):_0x307aca[_0x09ab('0x25')]=_0x3080ca[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]];if(_0x4e908d[_0x09ab('0x1e')]!==_0x09ab('0x1f')){if(_0x307aca['options'][_0x09ab('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x307aca[_0x09ab('0x25')]+=_0x09ab('0x2c');}}else{_0x307aca[_0x09ab('0x25')]=_0x307aca[_0x09ab('0x25')][_0x09ab('0x2d')]('U(xcally-mixmonitor-context)','');}_0x429e17[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]]=_0x307aca[_0x09ab('0x25')];break;default:_0x429e17[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]]=_0x3080ca[_0x2141a3[_0x39c4ab][_0x09ab('0x26')]];}}return _0x429e17[_0x09ab('0x2e')](',');}function _0x3572f2(_0x14e82c,_0x75feeb,_0x1e8189){return new Promise(function(_0x310a29,_0x44a820){var _0x37e86e=[];if(_[_0x09ab('0x2f')](_0x75feeb))return _0x310a29(_0x37e86e);_0x38fee4[_0x09ab('0x30')][_0x09ab('0x31')]({'attributes':['id',_0x09ab('0x32'),_0x09ab('0x33')],'raw':!![]})[_0x09ab('0x34')](function(_0x386c26){for(var _0x566283=0x0,_0x4c6e94=0x0;_0x566283<_0x75feeb[_0x09ab('0x35')];_0x566283++,_0x4c6e94=0x0){var _0x406107=_0x75feeb[_0x566283];var _0x52a0ad=[];var _0x253437=[];delete _0x406107['id'];if(_0x406107[_0x09ab('0x32')]!=='*,*,*,*'){_0x406107[_0x09ab('0x36')]=[_0x406107[_0x09ab('0x32')]];}else{_0x406107['intervals']=_0x406107[_0x09ab('0x33')]?_[_0x09ab('0x37')](_[_0x09ab('0x38')](_0x386c26,{'IntervalId':_0x406107[_0x09ab('0x33')]}),_0x09ab('0x32')):[];}_0x406107[_0x09ab('0x6')]=_0x14e82c[_0x09ab('0x6')];_0x406107[_0x09ab('0x7')]=_0x14e82c['exten'];if(_0x406107[_0x09ab('0x5')])_0x406107[_0x09ab('0x5')]=_0x406107[_0x09ab('0x5')]['toLowerCase']();if(_0x14e82c[_0x09ab('0x5')]===_0x09ab('0x10')){if(_0x406107[_0x09ab('0x1d')](_0x09ab('0x39'))&&_0x406107['tag']&&_0x406107['tag']!=='--'){_0x52a0ad['push']({'type':_0x406107['type'][_0x09ab('0x3a')](),'app':_0x09ab('0x9'),'appdata':_0x09ab('0x3b')+_0x406107['tag'],'context':_0x14e82c[_0x09ab('0x6')],'exten':_0x14e82c[_0x09ab('0x7')],'priority':_0x406107['intervals'][_0x09ab('0x35')]+_0x1e8189+_0x4c6e94++,'VoiceExtensionId':_0x14e82c['id']});}_0x52a0ad[_0x09ab('0xc')]({'type':_0x406107[_0x09ab('0x5')][_0x09ab('0x3a')](),'app':'ExecIf','appdata':_0x09ab('0x3c')+(_0x406107[_0x09ab('0x3d')]?_0x09ab('0x3e')+_0x406107[_0x09ab('0x3d')]+')':_0x09ab('0x3f')),'context':_0x14e82c['context'],'exten':_0x14e82c[_0x09ab('0x7')],'priority':_0x406107[_0x09ab('0x36')][_0x09ab('0x35')]+_0x1e8189+_0x4c6e94++,'VoiceExtensionId':_0x14e82c['id']});}else{if(_0x406107[_0x09ab('0x1d')](_0x09ab('0x40'))){if([_0x09ab('0x41'),_0x09ab('0x42')][_0x09ab('0x43')](_0x406107[_0x09ab('0x44')][_0x09ab('0x3a')]())&&_0x406107['appType']!==_0x09ab('0x45')){if(_0x406107[_0x09ab('0x40')]){_0x52a0ad[_0x09ab('0xc')]({'type':_0x406107[_0x09ab('0x5')]['toLowerCase'](),'app':_0x09ab('0x19'),'appdata':_0x09ab('0x46'),'context':_0x14e82c[_0x09ab('0x6')],'exten':_0x14e82c[_0x09ab('0x7')],'priority':_0x406107['intervals'][_0x09ab('0x35')]+_0x1e8189+_0x4c6e94++,'VoiceExtensionId':_0x14e82c['id']});_0x52a0ad[_0x09ab('0xc')]({'type':_0x406107['type'][_0x09ab('0x3a')](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x14e82c[_0x09ab('0x6')],'exten':_0x14e82c[_0x09ab('0x7')],'priority':_0x406107[_0x09ab('0x36')]['length']+_0x1e8189+_0x4c6e94++,'VoiceExtensionId':_0x14e82c['id']});}else{_0x52a0ad['push']({'type':_0x406107[_0x09ab('0x5')][_0x09ab('0x3a')](),'app':'ExecIf','appdata':_0x09ab('0x47'),'context':_0x14e82c[_0x09ab('0x6')],'exten':_0x14e82c[_0x09ab('0x7')],'priority':_0x406107[_0x09ab('0x36')][_0x09ab('0x35')]+_0x1e8189+_0x4c6e94++,'VoiceExtensionId':_0x14e82c['id']});_0x52a0ad[_0x09ab('0xc')]({'type':_0x406107[_0x09ab('0x5')]['toLowerCase'](),'app':_0x09ab('0x9'),'appdata':_0x09ab('0x48'),'context':_0x14e82c[_0x09ab('0x6')],'exten':_0x14e82c[_0x09ab('0x7')],'priority':_0x406107[_0x09ab('0x36')][_0x09ab('0x35')]+_0x1e8189+_0x4c6e94++,'VoiceExtensionId':_0x14e82c['id']});}}}}for(var _0xe8db1d=0x0;_0xe8db1d<_0x406107[_0x09ab('0x36')][_0x09ab('0x35')];_0xe8db1d++){var _0x7320be=_0x1e8189+_0x406107['intervals'][_0x09ab('0x35')];var _0x472f0a=_0xe8db1d===_0x406107[_0x09ab('0x36')]['length']-0x1?_0x1e8189+_0x52a0ad['length']+_0x253437[_0x09ab('0x35')]+0x2:_0x1e8189+_0xe8db1d+0x1;_0x52a0ad[_0x09ab('0x49')](_0xe8db1d,0x0,{'type':_0x14e82c[_0x09ab('0x5')],'app':_0x09ab('0x4a'),'appdata':_0x406107[_0x09ab('0x36')][_0xe8db1d]+'?'+_0x14e82c['context']+_0x09ab('0x4b')+_0x7320be+':'+_0x14e82c[_0x09ab('0x6')]+_0x09ab('0x4b')+_0x472f0a,'exten':_0x14e82c[_0x09ab('0x7')],'context':_0x14e82c[_0x09ab('0x6')],'priority':_0x1e8189+_0xe8db1d,'VoiceExtensionId':_0x14e82c['id']});}if(_0x406107['appType']==='outboundDial')_0x406107[_0x09ab('0x4c')]=_0x527d91(_0x14e82c,_0x406107[_0x09ab('0x4c')]);_0x406107[_0x09ab('0x4d')]=_0x52a0ad[_0x09ab('0x35')]?_[_0x09ab('0x4e')](_0x52a0ad)[_0x09ab('0x4d')]+0x1:_0x1e8189;_0x37e86e=_[_0x09ab('0x4f')](_0x37e86e,_0x52a0ad,[_0x406107],_0x253437);_0x1e8189=_['last'](_0x37e86e)[_0x09ab('0x4d')]+0x1;}return _0x310a29(_0x37e86e);})['catch'](function(_0x322f43){_0x44a820(_0x322f43);});});}return _0x28d64f[_0x09ab('0x50')]('VoiceExtension',attributes,{'tableName':_0x09ab('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4f6b80){var _0x181f7c=this[_0x09ab('0x52')]({'plain':!![]});var _0x2b9371=_0x181f7c['type']===_0x09ab('0x10')?_0x21db00(_0x181f7c):_0x38c30a(_0x181f7c);return _0x3572f2(_0x181f7c,_0x4f6b80,_['last'](_0x2b9371)[_0x09ab('0x4d')]+0x1)['then'](function(_0x113082){var _0x2ebeb6=_[_0x09ab('0x4f')](_0x2b9371,_0x113082);_0x2ebeb6['push']({'type':_0x181f7c['type'],'app':_0x09ab('0x53'),'exten':_0x181f7c[_0x09ab('0x7')],'context':_0x181f7c[_0x09ab('0x6')],'priority':_[_0x09ab('0x4e')](_0x2ebeb6)['priority']+0x1,'VoiceExtensionId':_0x181f7c['id']});return _0x2ebeb6;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index e2c72a0..916d4e8 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 _0x972c=['result','catch','GetVoiceExtension','findAll','options','raw','where','include','model','attributes','map','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x54cc8e,_0x51dd90){var _0x336b92=function(_0x56f6a6){while(--_0x56f6a6){_0x54cc8e['push'](_0x54cc8e['shift']());}};_0x336b92(++_0x51dd90);}(_0x972c,0xf2));var _0xc972=function(_0x48d048,_0x448394){_0x48d048=_0x48d048-0x0;var _0xd295e5=_0x972c[_0x48d048];return _0xd295e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc972('0x0'));var BPromise=require(_0xc972('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc972('0x2'));var db=require(_0xc972('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc972('0x4'));var config=require(_0xc972('0x5'));var jayson=require(_0xc972('0x6'));var client=jayson['client'][_0xc972('0x7')]({'port':0x232a});config['redis']=_[_0xc972('0x8')](config[_0xc972('0x9')],{'host':_0xc972('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xc972('0xb')](socket);function respondWithRpcPromise(_0x4c4903,_0x3053d6,_0x16993d){return new BPromise(function(_0x32cb5b,_0x423926){return client[_0xc972('0xc')](_0x4c4903,_0x16993d)[_0xc972('0xd')](function(_0x233d36){logger['info'](_0xc972('0xe'),_0x3053d6,_0xc972('0xf'));logger[_0xc972('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3053d6,_0xc972('0xf'),JSON[_0xc972('0x11')](_0x233d36));if(_0x233d36[_0xc972('0x12')]){if(_0x233d36['error'][_0xc972('0x13')]===0x1f4){logger[_0xc972('0x12')](_0xc972('0xe'),_0x3053d6,_0x233d36[_0xc972('0x12')]['message']);return _0x423926(_0x233d36[_0xc972('0x12')][_0xc972('0x14')]);}logger[_0xc972('0x12')](_0xc972('0xe'),_0x3053d6,_0x233d36[_0xc972('0x12')][_0xc972('0x14')]);return _0x32cb5b(_0x233d36[_0xc972('0x12')][_0xc972('0x14')]);}else{logger[_0xc972('0x15')](_0xc972('0xe'),_0x3053d6,_0xc972('0xf'));_0x32cb5b(_0x233d36[_0xc972('0x16')][_0xc972('0x14')]);}})[_0xc972('0x17')](function(_0x3dffe5){logger[_0xc972('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x3053d6,_0x3dffe5);_0x423926(_0x3dffe5);});});}exports[_0xc972('0x18')]=function(_0x20cb18){var _0x3c8bda=this;return new Promise(function(_0x267d6c,_0x486340){return db['VoiceExtension'][_0xc972('0x19')]({'raw':_0x20cb18[_0xc972('0x1a')]?_0x20cb18['options'][_0xc972('0x1b')]===undefined?!![]:![]:!![],'where':_0x20cb18[_0xc972('0x1a')]?_0x20cb18[_0xc972('0x1a')][_0xc972('0x1c')]||null:null,'attributes':_0x20cb18[_0xc972('0x1a')]?_0x20cb18[_0xc972('0x1a')]['attributes']||null:null,'limit':_0x20cb18[_0xc972('0x1a')]?_0x20cb18['options']['limit']||null:null,'include':_0x20cb18[_0xc972('0x1a')]?_0x20cb18[_0xc972('0x1a')][_0xc972('0x1d')]?_['map'](_0x20cb18[_0xc972('0x1a')][_0xc972('0x1d')],function(_0xf115da){return{'model':db[_0xf115da[_0xc972('0x1e')]],'as':_0xf115da['as'],'attributes':_0xf115da[_0xc972('0x1f')],'include':_0xf115da[_0xc972('0x1d')]?_[_0xc972('0x20')](_0xf115da[_0xc972('0x1d')],function(_0x3610d7){return{'model':db[_0x3610d7[_0xc972('0x1e')]],'as':_0x3610d7['as'],'attributes':_0x3610d7[_0xc972('0x1f')],'include':_0x3610d7[_0xc972('0x1d')]?_[_0xc972('0x20')](_0x3610d7[_0xc972('0x1d')],function(_0x5ad71d){return{'model':db[_0x5ad71d[_0xc972('0x1e')]],'as':_0x5ad71d['as'],'attributes':_0x5ad71d['attributes']};}):[]};}):[]};}):[]:[]})[_0xc972('0xd')](function(_0x4efef1){logger[_0xc972('0x15')](_0xc972('0x18'),_0x20cb18);logger[_0xc972('0x10')](_0xc972('0x18'),_0x20cb18,JSON[_0xc972('0x11')](_0x4efef1));_0x267d6c(_0x4efef1);})['catch'](function(_0xdbc068){logger[_0xc972('0x12')](_0xc972('0x18'),_0xdbc068[_0xc972('0x14')],_0x20cb18);_0x486340(_0x3c8bda['error'](0x1f4,_0xdbc068[_0xc972('0x14')]));});});}; \ No newline at end of file +var _0xbea5=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','defaults','socket.io-emitter','redis','./voiceExtension.socket','request','then','info','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','map','include'];(function(_0x3e9a38,_0x3e8f1c){var _0x34e234=function(_0x324889){while(--_0x324889){_0x3e9a38['push'](_0x3e9a38['shift']());}};_0x34e234(++_0x3e8f1c);}(_0xbea5,0x177));var _0x5bea=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xbea5[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var moment=require('moment');var BPromise=require(_0x5bea('0x2'));var rs=require(_0x5bea('0x3'));var fs=require('fs');var Redis=require(_0x5bea('0x4'));var db=require(_0x5bea('0x5'))['db'];var utils=require(_0x5bea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5bea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5bea('0x8')]['http']({'port':0x232a});config['redis']=_[_0x5bea('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5bea('0xa'))(new Redis(config[_0x5bea('0xb')]));require(_0x5bea('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e65aa,_0x53cec8,_0x4e793c){return new BPromise(function(_0x2af7af,_0x1bb8f0){return client[_0x5bea('0xd')](_0x1e65aa,_0x4e793c)[_0x5bea('0xe')](function(_0x78adda){logger[_0x5bea('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x53cec8,_0x5bea('0x10'));logger[_0x5bea('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x53cec8,_0x5bea('0x10'),JSON[_0x5bea('0x12')](_0x78adda));if(_0x78adda['error']){if(_0x78adda[_0x5bea('0x13')][_0x5bea('0x14')]===0x1f4){logger[_0x5bea('0x13')](_0x5bea('0x15'),_0x53cec8,_0x78adda[_0x5bea('0x13')][_0x5bea('0x16')]);return _0x1bb8f0(_0x78adda[_0x5bea('0x13')]['message']);}logger['error'](_0x5bea('0x15'),_0x53cec8,_0x78adda[_0x5bea('0x13')][_0x5bea('0x16')]);return _0x2af7af(_0x78adda['error'][_0x5bea('0x16')]);}else{logger[_0x5bea('0xf')](_0x5bea('0x15'),_0x53cec8,'request\x20sent');_0x2af7af(_0x78adda[_0x5bea('0x17')][_0x5bea('0x16')]);}})['catch'](function(_0x163bf7){logger['error'](_0x5bea('0x15'),_0x53cec8,_0x163bf7);_0x1bb8f0(_0x163bf7);});});}exports[_0x5bea('0x18')]=function(_0x34c032){var _0x4c90e3=this;return new Promise(function(_0x57667c,_0x4169e5){return db[_0x5bea('0x19')][_0x5bea('0x1a')]({'raw':_0x34c032['options']?_0x34c032[_0x5bea('0x1b')][_0x5bea('0x1c')]===undefined?!![]:![]:!![],'where':_0x34c032[_0x5bea('0x1b')]?_0x34c032[_0x5bea('0x1b')]['where']||null:null,'attributes':_0x34c032[_0x5bea('0x1b')]?_0x34c032[_0x5bea('0x1b')][_0x5bea('0x1d')]||null:null,'limit':_0x34c032[_0x5bea('0x1b')]?_0x34c032['options'][_0x5bea('0x1e')]||null:null,'include':_0x34c032['options']?_0x34c032[_0x5bea('0x1b')]['include']?_[_0x5bea('0x1f')](_0x34c032[_0x5bea('0x1b')][_0x5bea('0x20')],function(_0x5a8361){return{'model':db[_0x5a8361['model']],'as':_0x5a8361['as'],'attributes':_0x5a8361['attributes'],'include':_0x5a8361['include']?_[_0x5bea('0x1f')](_0x5a8361[_0x5bea('0x20')],function(_0x4d5dd5){return{'model':db[_0x4d5dd5['model']],'as':_0x4d5dd5['as'],'attributes':_0x4d5dd5[_0x5bea('0x1d')],'include':_0x4d5dd5[_0x5bea('0x20')]?_['map'](_0x4d5dd5[_0x5bea('0x20')],function(_0x5db06b){return{'model':db[_0x5db06b['model']],'as':_0x5db06b['as'],'attributes':_0x5db06b[_0x5bea('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5bea('0xe')](function(_0x10b5e6){logger[_0x5bea('0xf')](_0x5bea('0x18'),_0x34c032);logger[_0x5bea('0x11')](_0x5bea('0x18'),_0x34c032,JSON[_0x5bea('0x12')](_0x10b5e6));_0x57667c(_0x10b5e6);})[_0x5bea('0x21')](function(_0x4c023f){logger['error'](_0x5bea('0x18'),_0x4c023f[_0x5bea('0x16')],_0x34c032);_0x4169e5(_0x4c90e3[_0x5bea('0x13')](0x1f4,_0x4c023f[_0x5bea('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 692b0aa..9384c58 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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x814b,0x1a2));var _0xb814=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0x814b[_0x423e15];return _0x184279;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x32a674,_0x4a40b9){var _0x1eec02=function(_0x37f38a){while(--_0x37f38a){_0x32a674['push'](_0x32a674['shift']());}};_0x1eec02(++_0x4a40b9);}(_0x4975,0x86));var _0x5497=function(_0x73a96e,_0x54f73d){_0x73a96e=_0x73a96e-0x0;var _0x5a6f18=_0x4975[_0x73a96e];return _0x5a6f18;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ff68f92..970dcf6 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','delete'];(function(_0x2221f0,_0x2a1654){var _0x408219=function(_0x10311d){while(--_0x10311d){_0x2221f0['push'](_0x2221f0['shift']());}};_0x408219(++_0x2a1654);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0xdf55=['/:id/messages','getMessages','create','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x487663,_0x57146b){var _0xa64395=function(_0x2b4fe1){while(--_0x2b4fe1){_0x487663['push'](_0x487663['shift']());}};_0xa64395(++_0x57146b);}(_0xdf55,0x83));var _0x5df5=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xdf55[_0x466247];return _0x4b352e;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5df5('0xf')]);router['put'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller['update']);router['delete'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x10')]);module[_0x5df5('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d961c8c..0a05274 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 _0x240e=['VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','INTEGER'];(function(_0x2690dc,_0x307e24){var _0x4e924e=function(_0x2f45d7){while(--_0x2f45d7){_0x2690dc['push'](_0x2690dc['shift']());}};_0x4e924e(++_0x307e24);}(_0x240e,0x1c4));var _0xe240=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x240e[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0xe240('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xe240('0x1')]},'context':{'type':Sequelize[_0xe240('0x1')],'defaultValue':_0xe240('0x2'),'unique':_0xe240('0x3')},'mailbox':{'type':Sequelize[_0xe240('0x1')],'defaultValue':'','allowNull':![],'unique':_0xe240('0x3')},'password':{'type':Sequelize[_0xe240('0x1')]},'fullname':{'type':Sequelize[_0xe240('0x1')]},'email':{'type':Sequelize[_0xe240('0x1')],'validate':{'isEmail':!![]},'set':function(_0x48cb7a){this[_0xe240('0x4')](_0xe240('0x5'),typeof _0x48cb7a===_0xe240('0x6')&&_0x48cb7a[_0xe240('0x7')]()?_0x48cb7a[_0xe240('0x7')]():null);}},'pager':{'type':Sequelize[_0xe240('0x1')]},'tz':{'type':Sequelize[_0xe240('0x1')],'defaultValue':_0xe240('0x8')},'attach':{'type':Sequelize['ENUM'](_0xe240('0x9'),'no'),'defaultValue':_0xe240('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xe240('0x1')]},'callback':{'type':Sequelize[_0xe240('0x1')]},'review':{'type':Sequelize['ENUM'](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe240('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe240('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe240('0xa')](_0xe240('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xe240('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xe240('0x1')]},'maxsecs':{'type':Sequelize[_0xe240('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe240('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe240('0xc')],'get':function(){return this[_0xe240('0xd')]('fullname')+_0xe240('0xe')+this[_0xe240('0xd')](_0xe240('0xf'));}}}; \ No newline at end of file +var _0x7433=['INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','sequelize','STRING','contest_mailbox','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7433,0xe2));var _0x3743=function(_0xeb254a,_0x1c1fc9){_0xeb254a=_0xeb254a-0x0;var _0x78e431=_0x7433[_0xeb254a];return _0x78e431;};'use strict';var Sequelize=require(_0x3743('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x3743('0x1')]},'context':{'type':Sequelize[_0x3743('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x3743('0x1')],'defaultValue':'','allowNull':![],'unique':_0x3743('0x2')},'password':{'type':Sequelize[_0x3743('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3743('0x1')],'validate':{'isEmail':!![]},'set':function(_0x21f8c1){this['setDataValue']('email',typeof _0x21f8c1==='string'&&_0x21f8c1[_0x3743('0x3')]()?_0x21f8c1[_0x3743('0x3')]():null);}},'pager':{'type':Sequelize[_0x3743('0x1')]},'tz':{'type':Sequelize[_0x3743('0x1')],'defaultValue':_0x3743('0x4')},'attach':{'type':Sequelize['ENUM'](_0x3743('0x5'),'no'),'defaultValue':_0x3743('0x5'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x3743('0x5'),'no'),'defaultValue':_0x3743('0x5'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3743('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x3743('0x5'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3743('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3743('0x6')](_0x3743('0x5'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3743('0x6')](_0x3743('0x5'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3743('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x3743('0x5'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3743('0x6')](_0x3743('0x5'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3743('0x6')]('yes','no'),'defaultValue':_0x3743('0x5'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3743('0x6')](_0x3743('0x5'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3743('0x5'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x3743('0x1')]},'maxsecs':{'type':Sequelize[_0x3743('0x8')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3743('0x9')],'get':function(){return this['getDataValue'](_0x3743('0xa'))+_0x3743('0xb')+this[_0x3743('0xc')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 7a6cdb7..748847b 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 _0xae60=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2843d2,_0x27cfa5){var _0x214d1b=function(_0x2859bc){while(--_0x2859bc){_0x2843d2['push'](_0x2843d2['shift']());}};_0x214d1b(++_0x27cfa5);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xae60[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){var _0x3c43d8=_0x4e1242[_0x0ae6('0x2b')]({'plain':!![]});var _0x5b86fe=_0x0ae6('0x2c');return db[_0x0ae6('0x2d')]['destroy']({'where':{'type':_0x5b86fe,'resourceId':_0x3c43d8['id']}})['then'](function(){return _0x4e1242;});})[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x4fe77b,_0x3b5f8f){return function(_0xb68cbe){if(!_0xb68cbe){_0x4fe77b[_0x0ae6('0x1c')](0x194);}return _0xb68cbe;};}function handleError(_0x4df796,_0x2428b2){_0x2428b2=_0x2428b2||0x1f4;return function(_0x29fef3){logger[_0x0ae6('0x2e')](_0x29fef3[_0x0ae6('0x2f')]);if(_0x29fef3[_0x0ae6('0x30')]){delete _0x29fef3[_0x0ae6('0x30')];}_0x4df796['status'](_0x2428b2)['send'](_0x29fef3);};}exports[_0x0ae6('0x31')]=function(_0x419384,_0x4e6df8){var _0x4a06f1={},_0x1ca059={},_0x278577={'count':0x0,'rows':[]};var _0x714c6d=_[_0x0ae6('0x32')](db['VoiceMail'][_0x0ae6('0x33')],function(_0x429f06){return{'name':_0x429f06[_0x0ae6('0x34')],'type':_0x429f06['type'][_0x0ae6('0x35')]};});_0x1ca059[_0x0ae6('0x36')]=_[_0x0ae6('0x32')](_0x714c6d,_0x0ae6('0x30'));_0x1ca059[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x419384[_0x0ae6('0x37')]);_0x1ca059[_0x0ae6('0x39')]=_[_0x0ae6('0x3a')](_0x1ca059[_0x0ae6('0x36')],_0x1ca059['query']);_0x4a06f1[_0x0ae6('0x3b')]=_[_0x0ae6('0x3a')](_0x1ca059['model'],qs[_0x0ae6('0x3c')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x4a06f1['attributes']=_0x4a06f1[_0x0ae6('0x3b')]['length']?_0x4a06f1['attributes']:_0x1ca059[_0x0ae6('0x36')];if(!_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3d')](_0x0ae6('0x3e'))){_0x4a06f1[_0x0ae6('0x22')]=qs['limit'](_0x419384['query'][_0x0ae6('0x22')]);_0x4a06f1['offset']=qs[_0x0ae6('0x20')](_0x419384['query'][_0x0ae6('0x20')]);}_0x4a06f1['order']=qs[_0x0ae6('0x3f')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3f')]);_0x4a06f1[_0x0ae6('0x40')]=qs['filters'](_['pick'](_0x419384[_0x0ae6('0x37')],_0x1ca059[_0x0ae6('0x39')]),_0x714c6d);if(_0x419384[_0x0ae6('0x37')]['filter']){_0x4a06f1[_0x0ae6('0x40')]=_['merge'](_0x4a06f1[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x714c6d,function(_0x460e3f){if(_0x460e3f[_0x0ae6('0x41')]!==_0x0ae6('0x42')){var _0x1f8258={};_0x1f8258[_0x460e3f['name']]={'$like':'%'+_0x419384[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x1f8258;}})});}_0x4a06f1=_[_0x0ae6('0x44')]({},_0x4a06f1,_0x419384[_0x0ae6('0x45')]);var _0x1ad562={'where':_0x4a06f1[_0x0ae6('0x40')]};return db[_0x0ae6('0x46')][_0x0ae6('0x23')](_0x1ad562)['then'](function(_0x38faeb){_0x278577[_0x0ae6('0x23')]=_0x38faeb;if(_0x419384[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x4a06f1[_0x0ae6('0x48')]=[{'all':!![]}];}return db[_0x0ae6('0x46')][_0x0ae6('0x49')](_0x4a06f1);})[_0x0ae6('0x29')](function(_0xb38cbb){_0x278577[_0x0ae6('0x4a')]=_0xb38cbb;return _0x278577;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x4e6df8,_0x4a06f1))[_0x0ae6('0x4b')](handleError(_0x4e6df8,null));};exports[_0x0ae6('0x4c')]=function(_0x85d9ce,_0x201e95){var _0x16d225={'raw':!![],'where':{'id':_0x85d9ce[_0x0ae6('0x4d')]['id']}},_0x4235de={};_0x4235de['model']=_[_0x0ae6('0x38')](db[_0x0ae6('0x46')][_0x0ae6('0x33')]);_0x4235de[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x85d9ce[_0x0ae6('0x37')]);_0x4235de['filters']=_[_0x0ae6('0x3a')](_0x4235de[_0x0ae6('0x36')],_0x4235de[_0x0ae6('0x37')]);_0x16d225[_0x0ae6('0x3b')]=_['intersection'](_0x4235de['model'],qs['fields'](_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x16d225[_0x0ae6('0x3b')]=_0x16d225['attributes'][_0x0ae6('0x4e')]?_0x16d225[_0x0ae6('0x3b')]:_0x4235de['model'];if(_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x16d225['include']=[{'all':!![]}];}_0x16d225=_[_0x0ae6('0x44')]({},_0x16d225,_0x85d9ce[_0x0ae6('0x45')]);return db['VoiceMail'][_0x0ae6('0x4f')](_0x16d225)[_0x0ae6('0x29')](handleEntityNotFound(_0x201e95,null))[_0x0ae6('0x29')](respondWithResult(_0x201e95,null))['catch'](handleError(_0x201e95,null));};exports[_0x0ae6('0x50')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x46')][_0x0ae6('0x50')](_0x21de54[_0x0ae6('0x51')],{})[_0x0ae6('0x29')](function(_0x5ababa){var _0x5afd3b=_0x21de54[_0x0ae6('0x52')][_0x0ae6('0x2b')]({'plain':!![]});if(!_0x5afd3b)throw new Error(_0x0ae6('0x53'));if(_0x5afd3b['role']===_0x0ae6('0x52')){var _0x51df5c=_0x5ababa['get']({'plain':!![]});var _0x23454a=_0x0ae6('0x2c');return db[_0x0ae6('0x54')]['find']({'where':{'name':_0x23454a,'userProfileId':_0x5afd3b[_0x0ae6('0x55')]},'raw':!![]})[_0x0ae6('0x29')](function(_0x31a4db){if(_0x31a4db&&_0x31a4db[_0x0ae6('0x56')]===0x0){return db[_0x0ae6('0x2d')][_0x0ae6('0x50')]({'name':_0x51df5c[_0x0ae6('0x30')],'resourceId':_0x51df5c['id'],'type':_0x31a4db[_0x0ae6('0x30')],'sectionId':_0x31a4db['id']},{})[_0x0ae6('0x29')](function(){return _0x5ababa;});}else{return _0x5ababa;}})[_0x0ae6('0x4b')](function(_0x1cc515){logger[_0x0ae6('0x2e')](_0x0ae6('0x57'),_0x1cc515);throw _0x1cc515;});}return _0x5ababa;})[_0x0ae6('0x29')](respondWithResult(_0x46075a,0xc9))[_0x0ae6('0x4b')](handleError(_0x46075a,null));};exports['update']=function(_0x4cbe19,_0x30a9f1){if(_0x4cbe19[_0x0ae6('0x51')]['id']){delete _0x4cbe19[_0x0ae6('0x51')]['id'];}return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x4cbe19[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x30a9f1,null))[_0x0ae6('0x29')](saveUpdates(_0x4cbe19[_0x0ae6('0x51')],null))[_0x0ae6('0x29')](respondWithResult(_0x30a9f1,null))[_0x0ae6('0x4b')](handleError(_0x30a9f1,null));};exports[_0x0ae6('0x2a')]=function(_0x16a311,_0x2babcc){return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x16a311[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2babcc,null))['then'](removeEntity(_0x2babcc,null))[_0x0ae6('0x4b')](handleError(_0x2babcc,null));};exports[_0x0ae6('0x58')]=function(_0x15191e,_0x578125,_0x2648de){return db[_0x0ae6('0x46')][_0x0ae6('0x59')]({'where':{'id':_0x15191e[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x578125,null))[_0x0ae6('0x29')](function(_0x5ec716){var _0x456d2a;var _0x2132d6={},_0x1c53bf={};_0x1c53bf[_0x0ae6('0x36')]=_[_0x0ae6('0x38')](db[_0x0ae6('0x5a')][_0x0ae6('0x33')]);_0x1c53bf[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x15191e['query']);_0x1c53bf['filters']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],_0x1c53bf['query']);_0x2132d6['attributes']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],qs[_0x0ae6('0x3c')](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x2132d6[_0x0ae6('0x3b')]=_0x2132d6[_0x0ae6('0x3b')]['length']?_0x2132d6[_0x0ae6('0x3b')]:_0x1c53bf['model'];if(!_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3d')]('nolimit')){_0x2132d6[_0x0ae6('0x22')]=qs[_0x0ae6('0x22')](_0x15191e[_0x0ae6('0x37')]['limit']);_0x2132d6[_0x0ae6('0x20')]=qs['offset'](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x20')]);}_0x2132d6[_0x0ae6('0x5b')]=qs[_0x0ae6('0x3f')](_0x15191e['query']['sort']);_0x2132d6[_0x0ae6('0x40')]=qs[_0x0ae6('0x39')](_[_0x0ae6('0x5c')](_0x15191e[_0x0ae6('0x37')],_0x1c53bf[_0x0ae6('0x39')]));if(_0x15191e[_0x0ae6('0x37')]['filter']){_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x2132d6[_0x0ae6('0x3b')],function(_0x2bafcc){var _0x15f38f={};_0x15f38f[_0x2bafcc]={'$like':'%'+_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x15f38f;})});}_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'mailboxuser':_0x5ec716[_0x0ae6('0x5d')]});_0x2132d6=_[_0x0ae6('0x44')]({},_0x2132d6,_0x15191e[_0x0ae6('0x45')]);return db[_0x0ae6('0x5a')]['findAndCountAll'](_0x2132d6)['then'](respondWithFilteredResult(_0x578125,_0x2132d6));})[_0x0ae6('0x4b')](handleError(_0x578125,null));}; \ No newline at end of file +var _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x987cf2,_0xa636d8){var _0x48e791=function(_0x21851d){while(--_0x21851d){_0x987cf2['push'](_0x987cf2['shift']());}};_0x48e791(++_0xa636d8);}(_0x16d2,0x123));var _0x216d=function(_0x39e26c,_0x1db2d8){_0x39e26c=_0x39e26c-0x0;var _0x29aade=_0x16d2[_0x39e26c];return _0x29aade;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index dc69f11..441b4b7 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 _0x8834=['../../config/environment','exports','define','voice_voicemail','mailbox','context','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x118005,_0x3f3def){var _0x3b1c50=function(_0x557950){while(--_0x557950){_0x118005['push'](_0x118005['shift']());}};_0x3b1c50(++_0x3f3def);}(_0x8834,0x1c9));var _0x4883=function(_0x3692a5,_0xf715e8){_0x3692a5=_0x3692a5-0x0;var _0x1472d3=_0x8834[_0x3692a5];return _0x1472d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4883('0x0'))('api');var moment=require(_0x4883('0x1'));var BPromise=require(_0x4883('0x2'));var rp=require(_0x4883('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4883('0x4'));var config=require(_0x4883('0x5'));var attributes=require('./voiceMail.attributes');module[_0x4883('0x6')]=function(_0x2c8b09,_0x1c282a){return _0x2c8b09[_0x4883('0x7')]('VoiceMail',attributes,{'tableName':_0x4883('0x8'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x4883('0x9'),_0x4883('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3e9=['util','api','moment','request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','lodash'];(function(_0x190148,_0xda6bdd){var _0x5009de=function(_0x19c769){while(--_0x19c769){_0x190148['push'](_0x190148['shift']());}};_0x5009de(++_0xda6bdd);}(_0xc3e9,0x1e0));var _0x9c3e=function(_0x396694,_0x3d75b5){_0x396694=_0x396694-0x0;var _0x59d77e=_0xc3e9[_0x396694];return _0x59d77e;};'use strict';var _=require(_0x9c3e('0x0'));var util=require(_0x9c3e('0x1'));var logger=require('../../config/logger')(_0x9c3e('0x2'));var moment=require(_0x9c3e('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c3e('0x4'));var fs=require('fs');var path=require(_0x9c3e('0x5'));var rimraf=require('rimraf');var config=require(_0x9c3e('0x6'));var attributes=require(_0x9c3e('0x7'));module[_0x9c3e('0x8')]=function(_0x27985f,_0x344f0e){return _0x27985f[_0x9c3e('0x9')]('VoiceMail',attributes,{'tableName':_0x9c3e('0xa'),'paranoid':![],'indexes':[{'name':_0x9c3e('0xb'),'fields':[_0x9c3e('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index cb013b5..98506f6 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 _0xc7f5=['info','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','request','then','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc7f5,0x92));var _0x5c7f=function(_0x2dcf8b,_0x477184){_0x2dcf8b=_0x2dcf8b-0x0;var _0x287c68=_0xc7f5[_0x2dcf8b];return _0x287c68;};'use strict';var _=require(_0x5c7f('0x0'));var util=require('util');var moment=require(_0x5c7f('0x1'));var BPromise=require(_0x5c7f('0x2'));var rs=require(_0x5c7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c7f('0x4'));var logger=require('../../config/logger')(_0x5c7f('0x5'));var config=require(_0x5c7f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5c7f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bda6d,_0x14f1d6,_0x45033e){return new BPromise(function(_0x4c19c3,_0x2729a3){return client[_0x5c7f('0x8')](_0x1bda6d,_0x45033e)[_0x5c7f('0x9')](function(_0x4dc650){logger['info'](_0x5c7f('0xa'),_0x14f1d6,'request\x20sent');logger['debug'](_0x5c7f('0xb'),_0x14f1d6,_0x5c7f('0xc'),JSON[_0x5c7f('0xd')](_0x4dc650));if(_0x4dc650[_0x5c7f('0xe')]){if(_0x4dc650['error']['code']===0x1f4){logger[_0x5c7f('0xe')](_0x5c7f('0xa'),_0x14f1d6,_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);return _0x2729a3(_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);}logger[_0x5c7f('0xe')]('VoiceMail,\x20%s,\x20%s',_0x14f1d6,_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);return _0x4c19c3(_0x4dc650[_0x5c7f('0xe')][_0x5c7f('0xf')]);}else{logger[_0x5c7f('0x10')](_0x5c7f('0xa'),_0x14f1d6,_0x5c7f('0xc'));_0x4c19c3(_0x4dc650[_0x5c7f('0x11')][_0x5c7f('0xf')]);}})['catch'](function(_0x470fe0){logger[_0x5c7f('0xe')]('VoiceMail,\x20%s,\x20%s',_0x14f1d6,_0x470fe0);_0x2729a3(_0x470fe0);});});} \ No newline at end of file +var _0x5611=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x321c77,_0x2334e9){var _0x37b98c=function(_0x3233d5){while(--_0x3233d5){_0x321c77['push'](_0x321c77['shift']());}};_0x37b98c(++_0x2334e9);}(_0x5611,0x96));var _0x1561=function(_0x186941,_0x1f259b){_0x186941=_0x186941-0x0;var _0x52da3c=_0x5611[_0x186941];return _0x52da3c;};'use strict';var _=require(_0x1561('0x0'));var util=require(_0x1561('0x1'));var moment=require(_0x1561('0x2'));var BPromise=require(_0x1561('0x3'));var rs=require(_0x1561('0x4'));var fs=require('fs');var Redis=require(_0x1561('0x5'));var db=require(_0x1561('0x6'))['db'];var utils=require(_0x1561('0x7'));var logger=require(_0x1561('0x8'))(_0x1561('0x9'));var config=require(_0x1561('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1561('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x113892,_0x46a5c6,_0xc7018d){return new BPromise(function(_0x448117,_0x12dcb1){return client['request'](_0x113892,_0xc7018d)[_0x1561('0xc')](function(_0x135d36){logger[_0x1561('0xd')](_0x1561('0xe'),_0x46a5c6,_0x1561('0xf'));logger[_0x1561('0x10')](_0x1561('0x11'),_0x46a5c6,_0x1561('0xf'),JSON[_0x1561('0x12')](_0x135d36));if(_0x135d36[_0x1561('0x13')]){if(_0x135d36['error'][_0x1561('0x14')]===0x1f4){logger[_0x1561('0x13')](_0x1561('0xe'),_0x46a5c6,_0x135d36[_0x1561('0x13')][_0x1561('0x15')]);return _0x12dcb1(_0x135d36[_0x1561('0x13')][_0x1561('0x15')]);}logger['error'](_0x1561('0xe'),_0x46a5c6,_0x135d36[_0x1561('0x13')][_0x1561('0x15')]);return _0x448117(_0x135d36[_0x1561('0x13')][_0x1561('0x15')]);}else{logger['info'](_0x1561('0xe'),_0x46a5c6,_0x1561('0xf'));_0x448117(_0x135d36[_0x1561('0x16')][_0x1561('0x15')]);}})[_0x1561('0x17')](function(_0x59a2cb){logger[_0x1561('0x13')](_0x1561('0xe'),_0x46a5c6,_0x59a2cb);_0x12dcb1(_0x59a2cb);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 3ac0de6..cf35559 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 _0x0ee1=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','/:id/download','download','create','put','destroy','multer','util','path'];(function(_0xc51235,_0x52c411){var _0x48ed80=function(_0x1fe7a4){while(--_0x1fe7a4){_0xc51235['push'](_0xc51235['shift']());}};_0x48ed80(++_0x52c411);}(_0x0ee1,0x1bf));var _0x10ee=function(_0xf9cb7a,_0x155fd9){_0xf9cb7a=_0xf9cb7a-0x0;var _0x337245=_0x0ee1[_0xf9cb7a];return _0x337245;};'use strict';var multer=require(_0x10ee('0x0'));var util=require(_0x10ee('0x1'));var path=require(_0x10ee('0x2'));var timeout=require(_0x10ee('0x3'));var express=require(_0x10ee('0x4'));var router=express['Router']();var fs_extra=require(_0x10ee('0x5'));var auth=require(_0x10ee('0x6'));var interaction=require(_0x10ee('0x7'));var config=require(_0x10ee('0x8'));var controller=require(_0x10ee('0x9'));router[_0x10ee('0xa')]('/',auth[_0x10ee('0xb')](),controller['index']);router[_0x10ee('0xa')](_0x10ee('0xc'),auth[_0x10ee('0xb')](),controller['show']);router['get'](_0x10ee('0xd'),auth['isAuthenticated'](),controller[_0x10ee('0xe')]);router['post']('/',auth[_0x10ee('0xb')](),controller[_0x10ee('0xf')]);router[_0x10ee('0x10')]('/:id',auth[_0x10ee('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x10ee('0x11')]);module['exports']=router; \ No newline at end of file +var _0x680a=['download','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x680a,0x159));var _0xa680=function(_0x2a5be4,_0x2a0c89){_0x2a5be4=_0x2a5be4-0x0;var _0x2833aa=_0x680a[_0x2a5be4];return _0x2833aa;};'use strict';var multer=require(_0xa680('0x0'));var util=require(_0xa680('0x1'));var path=require(_0xa680('0x2'));var timeout=require(_0xa680('0x3'));var express=require('express');var router=express[_0xa680('0x4')]();var fs_extra=require(_0xa680('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa680('0x6'));var config=require(_0xa680('0x7'));var controller=require(_0xa680('0x8'));router['get']('/',auth[_0xa680('0x9')](),controller[_0xa680('0xa')]);router[_0xa680('0xb')](_0xa680('0xc'),auth['isAuthenticated'](),controller[_0xa680('0xd')]);router[_0xa680('0xb')](_0xa680('0xe'),auth['isAuthenticated'](),controller[_0xa680('0xf')]);router['post']('/',auth[_0xa680('0x9')](),controller['create']);router[_0xa680('0x10')](_0xa680('0xc'),auth[_0xa680('0x9')](),controller[_0xa680('0x11')]);router[_0xa680('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa680('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f3d06b6..9f97113 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 _0xbe0a=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x332b1a,_0x255af2){var _0x3f2400=function(_0x24316e){while(--_0x24316e){_0x332b1a['push'](_0x332b1a['shift']());}};_0x3f2400(++_0x255af2);}(_0xbe0a,0xde));var _0xabe0=function(_0x2cb00d,_0x320ca2){_0x2cb00d=_0x2cb00d-0x0;var _0x49179d=_0xbe0a[_0x2cb00d];return _0x49179d;};'use strict';var Sequelize=require('sequelize');module[_0xabe0('0x0')]={'name':{'type':Sequelize[_0xabe0('0x1')],'get':function(_0x323822){return this[_0xabe0('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xabe0('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xabe0('0x5')](_0xabe0('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xabe0('0x4')],'defaultValue':''},'stamp':{'type':_0xabe0('0x7'),'defaultValue':Sequelize[_0xabe0('0x8')](_0xabe0('0x9'))}}; \ No newline at end of file +var _0xdec0=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','STRING','long','TIMESTAMP','literal'];(function(_0x395e92,_0x2ff5cd){var _0x574aa1=function(_0xecd86b){while(--_0xecd86b){_0x395e92['push'](_0x395e92['shift']());}};_0x574aa1(++_0x2ff5cd);}(_0xdec0,0x69));var _0x0dec=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xdec0[_0x34b821];return _0x5e00a0;};'use strict';var Sequelize=require('sequelize');module[_0x0dec('0x0')]={'name':{'type':Sequelize[_0x0dec('0x1')],'get':function(_0x180787){return this[_0x0dec('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x0dec('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0dec('0x3')],'defaultValue':''},'stamp':{'type':_0x0dec('0x5'),'defaultValue':Sequelize[_0x0dec('0x6')](_0x0dec('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index aebb188..7058dad 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 _0x67c9=['audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','then','end','name','send','index','map','VoiceMailMessage','type','model','differenceBy','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch','show','rawAttributes','length','create','body','find','params','msg_id','recording','ValidationError'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x67c9,0x1df));var _0x967c=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x67c9[_0x319cb9];return _0x1735fc;};'use strict';var emlformat=require(_0x967c('0x0'));var rimraf=require(_0x967c('0x1'));var zipdir=require(_0x967c('0x2'));var jsonpatch=require(_0x967c('0x3'));var rp=require('request-promise');var moment=require(_0x967c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x967c('0x5'));var util=require(_0x967c('0x6'));var path=require(_0x967c('0x7'));var sox=require(_0x967c('0x8'));var csv=require(_0x967c('0x9'));var ejs=require(_0x967c('0xa'));var fs=require('fs');var fs_extra=require(_0x967c('0xb'));var _=require(_0x967c('0xc'));var squel=require(_0x967c('0xd'));var crypto=require(_0x967c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x967c('0x9'));var querystring=require(_0x967c('0xf'));var Papa=require(_0x967c('0x10'));var Redis=require(_0x967c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x967c('0x12'));var as=require(_0x967c('0x13'));var hardwareService=require(_0x967c('0x14'));var logger=require(_0x967c('0x15'))(_0x967c('0x16'));var utils=require(_0x967c('0x17'));var config=require(_0x967c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x967c('0x19'))['db'];function respondWithStatusCode(_0x4824f9,_0x3b5f13){_0x3b5f13=_0x3b5f13||0xcc;return function(_0x489dac){if(_0x489dac){return _0x4824f9['sendStatus'](_0x3b5f13);}return _0x4824f9[_0x967c('0x1a')](_0x3b5f13)['end']();};}function respondWithResult(_0x8c226a,_0x2a1e3e){_0x2a1e3e=_0x2a1e3e||0xc8;return function(_0x15cb91){if(_0x15cb91){return _0x8c226a['status'](_0x2a1e3e)['json'](_0x15cb91);}};}function respondWithFilteredResult(_0x46543c,_0x55f0df){return function(_0x49fa2c){if(_0x49fa2c){var _0x521025=typeof _0x55f0df[_0x967c('0x1b')]===_0x967c('0x1c')&&typeof _0x55f0df[_0x967c('0x1d')]===_0x967c('0x1c');var _0x3d53d4=_0x49fa2c[_0x967c('0x1e')];var _0x305951=_0x521025?0x0:_0x55f0df[_0x967c('0x1b')];var _0x12d5a2=_0x521025?_0x49fa2c[_0x967c('0x1e')]:_0x55f0df['offset']+_0x55f0df[_0x967c('0x1d')];var _0x425fe2;if(_0x12d5a2>=_0x3d53d4){_0x12d5a2=_0x3d53d4;_0x425fe2=0xc8;}else{_0x425fe2=0xce;}_0x46543c['status'](_0x425fe2);return _0x46543c[_0x967c('0x1f')](_0x967c('0x20'),_0x305951+'-'+_0x12d5a2+'/'+_0x3d53d4)[_0x967c('0x21')](_0x49fa2c);}return null;};}function patchUpdates(_0x2f4a00){return function(_0x493859){try{jsonpatch['apply'](_0x493859,_0x2f4a00,!![]);}catch(_0x380672){return BPromise[_0x967c('0x22')](_0x380672);}return _0x493859['save']();};}function saveUpdates(_0x125f83,_0x1ec029){return function(_0x1f185d){if(_0x1f185d){return _0x1f185d[_0x967c('0x23')](_0x125f83)['then'](function(_0x425721){return _0x425721;});}return null;};}function removeEntity(_0x5949d4,_0x256d9e){return function(_0x120c96){if(_0x120c96){return _0x120c96[_0x967c('0x24')]()[_0x967c('0x25')](function(){_0x5949d4[_0x967c('0x1a')](0xcc)[_0x967c('0x26')]();});}};}function handleEntityNotFound(_0x9a19da,_0x399a51){return function(_0x1dc844){if(!_0x1dc844){_0x9a19da['sendStatus'](0x194);}return _0x1dc844;};}function handleError(_0x2228fd,_0x4eb8fd){_0x4eb8fd=_0x4eb8fd||0x1f4;return function(_0x36680b){logger['error'](_0x36680b['stack']);if(_0x36680b[_0x967c('0x27')]){delete _0x36680b[_0x967c('0x27')];}_0x2228fd[_0x967c('0x1a')](_0x4eb8fd)[_0x967c('0x28')](_0x36680b);};}exports[_0x967c('0x29')]=function(_0xb29f6b,_0x44d00b){var _0x2a2683={},_0x4a6f26={},_0x3188f9={'count':0x0,'rows':[]};var _0x573b93=_[_0x967c('0x2a')](db[_0x967c('0x2b')]['rawAttributes'],function(_0x33b43a){return{'name':_0x33b43a['fieldName'],'type':_0x33b43a[_0x967c('0x2c')]['key']};});_0x4a6f26[_0x967c('0x2d')]=_[_0x967c('0x2e')](_[_0x967c('0x2a')](_0x573b93,'name'),['name']);_0x4a6f26['query']=_[_0x967c('0x2f')](_0xb29f6b[_0x967c('0x30')]);_0x4a6f26[_0x967c('0x31')]=_['intersection'](_0x4a6f26['model'],_0x4a6f26[_0x967c('0x30')]);_0x2a2683[_0x967c('0x32')]=_[_0x967c('0x33')](_0x4a6f26['model'],qs[_0x967c('0x34')](_0xb29f6b['query'][_0x967c('0x34')]));_0x2a2683[_0x967c('0x32')]=_0x2a2683[_0x967c('0x32')]['length']?_0x2a2683[_0x967c('0x32')]:_0x4a6f26[_0x967c('0x2d')];if(!_0xb29f6b['query']['hasOwnProperty'](_0x967c('0x35'))){_0x2a2683['limit']=qs[_0x967c('0x1d')](_0xb29f6b[_0x967c('0x30')]['limit']);_0x2a2683['offset']=qs[_0x967c('0x1b')](_0xb29f6b[_0x967c('0x30')][_0x967c('0x1b')]);}_0x2a2683[_0x967c('0x36')]=qs[_0x967c('0x37')](_0xb29f6b[_0x967c('0x30')][_0x967c('0x37')]);_0x2a2683[_0x967c('0x38')]=qs[_0x967c('0x31')](_[_0x967c('0x39')](_0xb29f6b[_0x967c('0x30')],_0x4a6f26[_0x967c('0x31')]),_0x573b93);if(_0xb29f6b[_0x967c('0x30')]['filter']){_0x2a2683[_0x967c('0x38')]=_['merge'](_0x2a2683[_0x967c('0x38')],{'$or':_[_0x967c('0x2a')](_0x573b93,function(_0x334769){if(_0x334769[_0x967c('0x2c')]!=='VIRTUAL'){var _0x309c15={};_0x309c15[_0x334769[_0x967c('0x27')]]={'$like':'%'+_0xb29f6b['query']['filter']+'%'};return _0x309c15;}})});}_0x2a2683=_[_0x967c('0x3a')]({},_0x2a2683,_0xb29f6b[_0x967c('0x3b')]);var _0x4e4dec={'where':_0x2a2683[_0x967c('0x38')]};return db[_0x967c('0x2b')][_0x967c('0x1e')](_0x4e4dec)[_0x967c('0x25')](function(_0x5854b9){_0x3188f9['count']=_0x5854b9;if(_0xb29f6b['query'][_0x967c('0x3c')]){_0x2a2683[_0x967c('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x2a2683);})['then'](function(_0x31fe16){_0x3188f9[_0x967c('0x3e')]=_0x31fe16;return _0x3188f9;})['then'](respondWithFilteredResult(_0x44d00b,_0x2a2683))[_0x967c('0x3f')](handleError(_0x44d00b,null));};exports[_0x967c('0x40')]=function(_0x34a2ad,_0x2e2e28){var _0x34522c={'raw':!![],'where':{'id':_0x34a2ad['params']['id']}},_0x53468d={};_0x53468d[_0x967c('0x2d')]=_[_0x967c('0x2f')](db[_0x967c('0x2b')][_0x967c('0x41')]);_0x53468d['query']=_[_0x967c('0x2f')](_0x34a2ad[_0x967c('0x30')]);_0x53468d['filters']=_[_0x967c('0x33')](_0x53468d[_0x967c('0x2d')],_0x53468d[_0x967c('0x30')]);_0x34522c[_0x967c('0x32')]=_[_0x967c('0x33')](_0x53468d[_0x967c('0x2d')],qs[_0x967c('0x34')](_0x34a2ad[_0x967c('0x30')][_0x967c('0x34')]));_0x34522c['attributes']=_0x34522c[_0x967c('0x32')][_0x967c('0x42')]?_0x34522c[_0x967c('0x32')]:_0x53468d[_0x967c('0x2d')];if(_0x34a2ad[_0x967c('0x30')][_0x967c('0x3c')]){_0x34522c[_0x967c('0x3d')]=[{'all':!![]}];}_0x34522c=_[_0x967c('0x3a')]({},_0x34522c,_0x34a2ad[_0x967c('0x3b')]);return db['VoiceMailMessage']['find'](_0x34522c)[_0x967c('0x25')](handleEntityNotFound(_0x2e2e28,null))[_0x967c('0x25')](respondWithResult(_0x2e2e28,null))[_0x967c('0x3f')](handleError(_0x2e2e28,null));};exports['create']=function(_0x23867d,_0x2daaca){return db[_0x967c('0x2b')][_0x967c('0x43')](_0x23867d[_0x967c('0x44')],{})['then'](respondWithResult(_0x2daaca,0xc9))[_0x967c('0x3f')](handleError(_0x2daaca,null));};exports[_0x967c('0x23')]=function(_0x153154,_0x3c4611){if(_0x153154[_0x967c('0x44')]['id']){delete _0x153154['body']['id'];}return db[_0x967c('0x2b')][_0x967c('0x45')]({'where':{'id':_0x153154[_0x967c('0x46')]['id']}})[_0x967c('0x25')](handleEntityNotFound(_0x3c4611,null))[_0x967c('0x25')](saveUpdates(_0x153154['body'],null))[_0x967c('0x25')](respondWithResult(_0x3c4611,null))['catch'](handleError(_0x3c4611,null));};exports[_0x967c('0x24')]=function(_0xccd4e6,_0x2b487c){return db[_0x967c('0x2b')][_0x967c('0x45')]({'where':{'id':_0xccd4e6[_0x967c('0x46')]['id']}})[_0x967c('0x25')](handleEntityNotFound(_0x2b487c,null))[_0x967c('0x25')](removeEntity(_0x2b487c,null))['catch'](handleError(_0x2b487c,null));};exports['download']=function(_0x1b29b4,_0x5d1132,_0x1c4e33){return db[_0x967c('0x2b')][_0x967c('0x45')]({'where':{'id':_0x1b29b4[_0x967c('0x46')]['id']},'attributes':['id','recording',_0x967c('0x47')]})[_0x967c('0x25')](handleEntityNotFound(_0x5d1132,null))[_0x967c('0x25')](function(_0x26f314){if(_0x26f314){if(!_0x26f314[_0x967c('0x48')]){throw new db['Sequelize'][(_0x967c('0x49'))]('VoiceMailMessage\x20not\x20found');}var _0x5e626e={'Content-Type':_0x967c('0x4a'),'Content-Disposition':_0x967c('0x4b')};if(_0x26f314[_0x967c('0x47')]){_0x5e626e[_0x967c('0x4c')]=_0x967c('0x4d')+_0x26f314[_0x967c('0x47')]+_0x967c('0x4e');}_0x5d1132['set'](_0x5e626e);return _0x5d1132['send'](new Buffer(_0x26f314[_0x967c('0x48')]));}})[_0x967c('0x3f')](handleError(_0x5d1132,null));}; \ No newline at end of file +var _0xa967=['zip-dir','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','keys','filters','intersection','query','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','fields','include','options','find','create','body','download','recording','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf'];(function(_0x564adc,_0x4cb97f){var _0xa98e9a=function(_0x3c8ec3){while(--_0x3c8ec3){_0x564adc['push'](_0x564adc['shift']());}};_0xa98e9a(++_0x4cb97f);}(_0xa967,0x14a));var _0x7a96=function(_0x1c136c,_0x12a99d){_0x1c136c=_0x1c136c-0x0;var _0x5f27d0=_0xa967[_0x1c136c];return _0x5f27d0;};'use strict';var emlformat=require(_0x7a96('0x0'));var rimraf=require(_0x7a96('0x1'));var zipdir=require(_0x7a96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a96('0x3'));var moment=require('moment');var BPromise=require(_0x7a96('0x4'));var Mustache=require(_0x7a96('0x5'));var util=require('util');var path=require(_0x7a96('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a96('0x7'));var fs=require('fs');var fs_extra=require(_0x7a96('0x8'));var _=require(_0x7a96('0x9'));var squel=require(_0x7a96('0xa'));var crypto=require(_0x7a96('0xb'));var jsforce=require(_0x7a96('0xc'));var deskjs=require(_0x7a96('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a96('0xe'));var Papa=require('papaparse');var Redis=require(_0x7a96('0xf'));var authService=require(_0x7a96('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7a96('0x11'));var hardwareService=require(_0x7a96('0x12'));var logger=require(_0x7a96('0x13'))(_0x7a96('0x14'));var utils=require('../../config/utils');var config=require(_0x7a96('0x15'));var licenseUtil=require(_0x7a96('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b68b4,_0x5321ca){_0x5321ca=_0x5321ca||0xcc;return function(_0x439a3d){if(_0x439a3d){return _0x5b68b4[_0x7a96('0x17')](_0x5321ca);}return _0x5b68b4['status'](_0x5321ca)[_0x7a96('0x18')]();};}function respondWithResult(_0x27907e,_0x45b55a){_0x45b55a=_0x45b55a||0xc8;return function(_0x3ae816){if(_0x3ae816){return _0x27907e[_0x7a96('0x19')](_0x45b55a)[_0x7a96('0x1a')](_0x3ae816);}};}function respondWithFilteredResult(_0x1b00af,_0x5be1ab){return function(_0x29ba95){if(_0x29ba95){var _0x3cac36=typeof _0x5be1ab[_0x7a96('0x1b')]===_0x7a96('0x1c')&&typeof _0x5be1ab[_0x7a96('0x1d')]===_0x7a96('0x1c');var _0x4038f4=_0x29ba95[_0x7a96('0x1e')];var _0x1289f0=_0x3cac36?0x0:_0x5be1ab[_0x7a96('0x1b')];var _0x435d14=_0x3cac36?_0x29ba95[_0x7a96('0x1e')]:_0x5be1ab[_0x7a96('0x1b')]+_0x5be1ab[_0x7a96('0x1d')];var _0x433403;if(_0x435d14>=_0x4038f4){_0x435d14=_0x4038f4;_0x433403=0xc8;}else{_0x433403=0xce;}_0x1b00af['status'](_0x433403);return _0x1b00af['set'](_0x7a96('0x1f'),_0x1289f0+'-'+_0x435d14+'/'+_0x4038f4)['json'](_0x29ba95);}return null;};}function patchUpdates(_0x308cee){return function(_0x43e1e6){try{jsonpatch[_0x7a96('0x20')](_0x43e1e6,_0x308cee,!![]);}catch(_0xa60662){return BPromise[_0x7a96('0x21')](_0xa60662);}return _0x43e1e6[_0x7a96('0x22')]();};}function saveUpdates(_0x3aed69,_0x518f1f){return function(_0x176b70){if(_0x176b70){return _0x176b70[_0x7a96('0x23')](_0x3aed69)[_0x7a96('0x24')](function(_0x4eaf36){return _0x4eaf36;});}return null;};}function removeEntity(_0x17a3ac,_0x47fa89){return function(_0x1fba77){if(_0x1fba77){return _0x1fba77[_0x7a96('0x25')]()[_0x7a96('0x24')](function(){_0x17a3ac[_0x7a96('0x19')](0xcc)[_0x7a96('0x18')]();});}};}function handleEntityNotFound(_0x1c4d58,_0x260560){return function(_0x4d3fbf){if(!_0x4d3fbf){_0x1c4d58[_0x7a96('0x17')](0x194);}return _0x4d3fbf;};}function handleError(_0xae4490,_0x96ec28){_0x96ec28=_0x96ec28||0x1f4;return function(_0x321a36){logger[_0x7a96('0x26')](_0x321a36[_0x7a96('0x27')]);if(_0x321a36['name']){delete _0x321a36[_0x7a96('0x28')];}_0xae4490[_0x7a96('0x19')](_0x96ec28)[_0x7a96('0x29')](_0x321a36);};}exports[_0x7a96('0x2a')]=function(_0x384b5e,_0x33a59a){var _0x31f8f3={},_0x256727={},_0x1f0354={'count':0x0,'rows':[]};var _0x12fe14=_[_0x7a96('0x2b')](db[_0x7a96('0x2c')][_0x7a96('0x2d')],function(_0x1381a7){return{'name':_0x1381a7[_0x7a96('0x2e')],'type':_0x1381a7['type'][_0x7a96('0x2f')]};});_0x256727[_0x7a96('0x30')]=_[_0x7a96('0x31')](_[_0x7a96('0x2b')](_0x12fe14,_0x7a96('0x28')),[_0x7a96('0x28')]);_0x256727['query']=_[_0x7a96('0x32')](_0x384b5e['query']);_0x256727[_0x7a96('0x33')]=_[_0x7a96('0x34')](_0x256727[_0x7a96('0x30')],_0x256727[_0x7a96('0x35')]);_0x31f8f3[_0x7a96('0x36')]=_[_0x7a96('0x34')](_0x256727[_0x7a96('0x30')],qs['fields'](_0x384b5e[_0x7a96('0x35')]['fields']));_0x31f8f3[_0x7a96('0x36')]=_0x31f8f3[_0x7a96('0x36')][_0x7a96('0x37')]?_0x31f8f3['attributes']:_0x256727[_0x7a96('0x30')];if(!_0x384b5e[_0x7a96('0x35')]['hasOwnProperty'](_0x7a96('0x38'))){_0x31f8f3['limit']=qs[_0x7a96('0x1d')](_0x384b5e[_0x7a96('0x35')]['limit']);_0x31f8f3[_0x7a96('0x1b')]=qs[_0x7a96('0x1b')](_0x384b5e['query'][_0x7a96('0x1b')]);}_0x31f8f3[_0x7a96('0x39')]=qs['sort'](_0x384b5e[_0x7a96('0x35')][_0x7a96('0x3a')]);_0x31f8f3[_0x7a96('0x3b')]=qs[_0x7a96('0x33')](_[_0x7a96('0x3c')](_0x384b5e[_0x7a96('0x35')],_0x256727[_0x7a96('0x33')]),_0x12fe14);if(_0x384b5e[_0x7a96('0x35')]['filter']){_0x31f8f3[_0x7a96('0x3b')]=_[_0x7a96('0x3d')](_0x31f8f3[_0x7a96('0x3b')],{'$or':_[_0x7a96('0x2b')](_0x12fe14,function(_0x52fed5){if(_0x52fed5[_0x7a96('0x3e')]!==_0x7a96('0x3f')){var _0x456346={};_0x456346[_0x52fed5[_0x7a96('0x28')]]={'$like':'%'+_0x384b5e[_0x7a96('0x35')]['filter']+'%'};return _0x456346;}})});}_0x31f8f3=_[_0x7a96('0x3d')]({},_0x31f8f3,_0x384b5e['options']);var _0x4226e7={'where':_0x31f8f3[_0x7a96('0x3b')]};return db[_0x7a96('0x2c')]['count'](_0x4226e7)['then'](function(_0x2409b9){_0x1f0354['count']=_0x2409b9;if(_0x384b5e[_0x7a96('0x35')][_0x7a96('0x40')]){_0x31f8f3['include']=[{'all':!![]}];}return db[_0x7a96('0x2c')][_0x7a96('0x41')](_0x31f8f3);})['then'](function(_0x5678cf){_0x1f0354[_0x7a96('0x42')]=_0x5678cf;return _0x1f0354;})['then'](respondWithFilteredResult(_0x33a59a,_0x31f8f3))[_0x7a96('0x43')](handleError(_0x33a59a,null));};exports['show']=function(_0x385b85,_0x985217){var _0x221968={'raw':!![],'where':{'id':_0x385b85[_0x7a96('0x44')]['id']}},_0x57dfcb={};_0x57dfcb[_0x7a96('0x30')]=_[_0x7a96('0x32')](db[_0x7a96('0x2c')][_0x7a96('0x2d')]);_0x57dfcb[_0x7a96('0x35')]=_[_0x7a96('0x32')](_0x385b85[_0x7a96('0x35')]);_0x57dfcb[_0x7a96('0x33')]=_['intersection'](_0x57dfcb['model'],_0x57dfcb[_0x7a96('0x35')]);_0x221968['attributes']=_[_0x7a96('0x34')](_0x57dfcb[_0x7a96('0x30')],qs[_0x7a96('0x45')](_0x385b85[_0x7a96('0x35')][_0x7a96('0x45')]));_0x221968[_0x7a96('0x36')]=_0x221968[_0x7a96('0x36')][_0x7a96('0x37')]?_0x221968[_0x7a96('0x36')]:_0x57dfcb[_0x7a96('0x30')];if(_0x385b85[_0x7a96('0x35')]['includeAll']){_0x221968[_0x7a96('0x46')]=[{'all':!![]}];}_0x221968=_[_0x7a96('0x3d')]({},_0x221968,_0x385b85[_0x7a96('0x47')]);return db[_0x7a96('0x2c')][_0x7a96('0x48')](_0x221968)[_0x7a96('0x24')](handleEntityNotFound(_0x985217,null))[_0x7a96('0x24')](respondWithResult(_0x985217,null))[_0x7a96('0x43')](handleError(_0x985217,null));};exports[_0x7a96('0x49')]=function(_0x5c2e7f,_0x33e785){return db[_0x7a96('0x2c')]['create'](_0x5c2e7f[_0x7a96('0x4a')],{})[_0x7a96('0x24')](respondWithResult(_0x33e785,0xc9))['catch'](handleError(_0x33e785,null));};exports['update']=function(_0x54cee4,_0x263caf){if(_0x54cee4['body']['id']){delete _0x54cee4[_0x7a96('0x4a')]['id'];}return db[_0x7a96('0x2c')][_0x7a96('0x48')]({'where':{'id':_0x54cee4['params']['id']}})['then'](handleEntityNotFound(_0x263caf,null))['then'](saveUpdates(_0x54cee4[_0x7a96('0x4a')],null))[_0x7a96('0x24')](respondWithResult(_0x263caf,null))[_0x7a96('0x43')](handleError(_0x263caf,null));};exports['destroy']=function(_0x4c21be,_0x5c1f6f){return db[_0x7a96('0x2c')][_0x7a96('0x48')]({'where':{'id':_0x4c21be['params']['id']}})[_0x7a96('0x24')](handleEntityNotFound(_0x5c1f6f,null))[_0x7a96('0x24')](removeEntity(_0x5c1f6f,null))[_0x7a96('0x43')](handleError(_0x5c1f6f,null));};exports[_0x7a96('0x4b')]=function(_0x3c8259,_0x94acfc,_0x1c5c1a){return db['VoiceMailMessage'][_0x7a96('0x48')]({'where':{'id':_0x3c8259[_0x7a96('0x44')]['id']},'attributes':['id',_0x7a96('0x4c'),'msg_id']})[_0x7a96('0x24')](handleEntityNotFound(_0x94acfc,null))[_0x7a96('0x24')](function(_0x2202d5){if(_0x2202d5){if(!_0x2202d5['recording']){throw new db['Sequelize']['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x5eeaf5={'Content-Type':_0x7a96('0x4d'),'Content-Disposition':_0x7a96('0x4e')};if(_0x2202d5[_0x7a96('0x4f')]){_0x5eeaf5[_0x7a96('0x50')]=_0x7a96('0x51')+_0x2202d5[_0x7a96('0x4f')]+_0x7a96('0x52');}_0x94acfc['set'](_0x5eeaf5);return _0x94acfc[_0x7a96('0x29')](new Buffer(_0x2202d5[_0x7a96('0x4c')]));}})[_0x7a96('0x43')](handleError(_0x94acfc,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index cea3b88..e071463 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 _0xc05d=['api','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc05d,0x195));var _0xdc05=function(_0x233de7,_0x31e254){_0x233de7=_0x233de7-0x0;var _0x17775f=_0xc05d[_0x233de7];return _0x17775f;};'use strict';var _=require(_0xdc05('0x0'));var util=require(_0xdc05('0x1'));var logger=require('../../config/logger')(_0xdc05('0x2'));var moment=require('moment');var BPromise=require(_0xdc05('0x3'));var rp=require(_0xdc05('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc05('0x5'));var attributes=require(_0xdc05('0x6'));module[_0xdc05('0x7')]=function(_0x29e779,_0x576f2a){return _0x29e779[_0xdc05('0x8')](_0xdc05('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xdc05('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x1eae=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x35ecef,_0x2aaf3e){var _0x4334ee=function(_0x10b93c){while(--_0x10b93c){_0x35ecef['push'](_0x35ecef['shift']());}};_0x4334ee(++_0x2aaf3e);}(_0x1eae,0xb4));var _0xe1ea=function(_0xfd3d67,_0x167031){_0xfd3d67=_0xfd3d67-0x0;var _0x5e48eb=_0x1eae[_0xfd3d67];return _0x5e48eb;};'use strict';var _=require(_0xe1ea('0x0'));var util=require(_0xe1ea('0x1'));var logger=require(_0xe1ea('0x2'))(_0xe1ea('0x3'));var moment=require(_0xe1ea('0x4'));var BPromise=require(_0xe1ea('0x5'));var rp=require(_0xe1ea('0x6'));var fs=require('fs');var path=require(_0xe1ea('0x7'));var rimraf=require('rimraf');var config=require(_0xe1ea('0x8'));var attributes=require(_0xe1ea('0x9'));module[_0xe1ea('0xa')]=function(_0xfe7856,_0x2e15f8){return _0xfe7856[_0xe1ea('0xb')](_0xe1ea('0xc'),attributes,{'tableName':_0xe1ea('0xd'),'paranoid':![],'indexes':[{'name':_0xe1ea('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index af48b7c..73ee37f 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 _0x471c=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x471c,0x1e2));var _0xc471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc471('0x0'));var util=require(_0xc471('0x1'));var moment=require('moment');var BPromise=require(_0xc471('0x2'));var rs=require(_0xc471('0x3'));var fs=require('fs');var Redis=require(_0xc471('0x4'));var db=require(_0xc471('0x5'))['db'];var utils=require(_0xc471('0x6'));var logger=require('../../config/logger')(_0xc471('0x7'));var config=require(_0xc471('0x8'));var jayson=require(_0xc471('0x9'));var client=jayson[_0xc471('0xa')][_0xc471('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b8f7a,_0x5227d8,_0xbb83a6){return new BPromise(function(_0x38cbe9,_0x38a9c0){return client[_0xc471('0xc')](_0x4b8f7a,_0xbb83a6)[_0xc471('0xd')](function(_0x28b929){logger[_0xc471('0xe')](_0xc471('0xf'),_0x5227d8,_0xc471('0x10'));logger['debug'](_0xc471('0x11'),_0x5227d8,_0xc471('0x10'),JSON[_0xc471('0x12')](_0x28b929));if(_0x28b929[_0xc471('0x13')]){if(_0x28b929[_0xc471('0x13')][_0xc471('0x14')]===0x1f4){logger[_0xc471('0x13')](_0xc471('0xf'),_0x5227d8,_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);return _0x38a9c0(_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);}logger[_0xc471('0x13')](_0xc471('0xf'),_0x5227d8,_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);return _0x38cbe9(_0x28b929[_0xc471('0x13')][_0xc471('0x15')]);}else{logger['info'](_0xc471('0xf'),_0x5227d8,'request\x20sent');_0x38cbe9(_0x28b929[_0xc471('0x16')][_0xc471('0x15')]);}})[_0xc471('0x17')](function(_0x21519e){logger['error'](_0xc471('0xf'),_0x5227d8,_0x21519e);_0x38a9c0(_0x21519e);});});} \ No newline at end of file +var _0x7514=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x2e3d56,_0x4fb6ed){var _0x1815c1=function(_0x45a5fd){while(--_0x45a5fd){_0x2e3d56['push'](_0x2e3d56['shift']());}};_0x1815c1(++_0x4fb6ed);}(_0x7514,0xd9));var _0x4751=function(_0xdc71d,_0x246b70){_0xdc71d=_0xdc71d-0x0;var _0x4fb017=_0x7514[_0xdc71d];return _0x4fb017;};'use strict';var _=require(_0x4751('0x0'));var util=require(_0x4751('0x1'));var moment=require('moment');var BPromise=require(_0x4751('0x2'));var rs=require(_0x4751('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4751('0x4'))['db'];var utils=require(_0x4751('0x5'));var logger=require(_0x4751('0x6'))(_0x4751('0x7'));var config=require('../../config/environment');var jayson=require(_0x4751('0x8'));var client=jayson[_0x4751('0x9')][_0x4751('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c8b18,_0xa65753,_0x41a54c){return new BPromise(function(_0x1ca287,_0x152276){return client[_0x4751('0xb')](_0x5c8b18,_0x41a54c)['then'](function(_0x53b5c6){logger[_0x4751('0xc')](_0x4751('0xd'),_0xa65753,_0x4751('0xe'));logger[_0x4751('0xf')](_0x4751('0x10'),_0xa65753,'request\x20sent',JSON[_0x4751('0x11')](_0x53b5c6));if(_0x53b5c6['error']){if(_0x53b5c6['error']['code']===0x1f4){logger[_0x4751('0x12')](_0x4751('0xd'),_0xa65753,_0x53b5c6[_0x4751('0x12')][_0x4751('0x13')]);return _0x152276(_0x53b5c6['error'][_0x4751('0x13')]);}logger[_0x4751('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0xa65753,_0x53b5c6[_0x4751('0x12')][_0x4751('0x13')]);return _0x1ca287(_0x53b5c6[_0x4751('0x12')][_0x4751('0x13')]);}else{logger[_0x4751('0xc')](_0x4751('0xd'),_0xa65753,_0x4751('0xe'));_0x1ca287(_0x53b5c6[_0x4751('0x14')][_0x4751('0x13')]);}})[_0x4751('0x15')](function(_0x497b8f){logger['error'](_0x4751('0xd'),_0xa65753,_0x497b8f);_0x152276(_0x497b8f);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b5cd3b1..a975eed 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 _0x90a8=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','removeSound','exports','multer','util','connect-timeout'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x90a8,0xad));var _0x890a=function(_0x45442d,_0x39546e){_0x45442d=_0x45442d-0x0;var _0x289f00=_0x90a8[_0x45442d];return _0x289f00;};'use strict';var multer=require(_0x890a('0x0'));var util=require(_0x890a('0x1'));var path=require('path');var timeout=require(_0x890a('0x2'));var express=require(_0x890a('0x3'));var router=express[_0x890a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x890a('0x5'));var interaction=require(_0x890a('0x6'));var config=require(_0x890a('0x7'));var controller=require(_0x890a('0x8'));router[_0x890a('0x9')]('/',auth[_0x890a('0xa')](),controller[_0x890a('0xb')]);router[_0x890a('0x9')](_0x890a('0xc'),auth[_0x890a('0xa')](),controller[_0x890a('0xd')]);router['get'](_0x890a('0xe'),auth['isAuthenticated'](),controller[_0x890a('0xf')]);router[_0x890a('0x10')]('/',auth['isAuthenticated'](),controller[_0x890a('0x11')]);router['post'](_0x890a('0xe'),auth[_0x890a('0xa')](),controller[_0x890a('0x12')]);router[_0x890a('0x13')](_0x890a('0xc'),auth[_0x890a('0xa')](),controller['update']);router['delete'](_0x890a('0xc'),auth[_0x890a('0xa')](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x890a('0xa')](),controller[_0x890a('0x14')]);module[_0x890a('0x15')]=router; \ No newline at end of file +var _0x6023=['../../components/auth/service','./voiceMusicOnHold.controller','isAuthenticated','index','/:id','show','/:id/sounds','post','create','addSound','removeSound','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x8f3235,_0x20644d){var _0x2bf06a=function(_0x4e54d1){while(--_0x4e54d1){_0x8f3235['push'](_0x8f3235['shift']());}};_0x2bf06a(++_0x20644d);}(_0x6023,0x11b));var _0x3602=function(_0x1a46e2,_0x15c509){_0x1a46e2=_0x1a46e2-0x0;var _0x3454a1=_0x6023[_0x1a46e2];return _0x3454a1;};'use strict';var multer=require(_0x3602('0x0'));var util=require('util');var path=require(_0x3602('0x1'));var timeout=require(_0x3602('0x2'));var express=require(_0x3602('0x3'));var router=express[_0x3602('0x4')]();var fs_extra=require(_0x3602('0x5'));var auth=require(_0x3602('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3602('0x7'));router['get']('/',auth[_0x3602('0x8')](),controller[_0x3602('0x9')]);router['get'](_0x3602('0xa'),auth[_0x3602('0x8')](),controller[_0x3602('0xb')]);router['get'](_0x3602('0xc'),auth['isAuthenticated'](),controller['getSounds']);router[_0x3602('0xd')]('/',auth['isAuthenticated'](),controller[_0x3602('0xe')]);router['post'](_0x3602('0xc'),auth[_0x3602('0x8')](),controller[_0x3602('0xf')]);router['put']('/:id',auth[_0x3602('0x8')](),controller['update']);router['delete'](_0x3602('0xa'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x3602('0x8')](),controller[_0x3602('0x10')]);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 a7a7610..93ce91a 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 _0xd682=['sequelize','STRING','ENUM','custom','files','mp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x40c7e0,_0x1e97bc){var _0x4e9787=function(_0x3fc279){while(--_0x3fc279){_0x40c7e0['push'](_0x40c7e0['shift']());}};_0x4e9787(++_0x1e97bc);}(_0xd682,0x1b8));var _0x2d68=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xd682[_0x412e27];return _0x53da42;};'use strict';var Sequelize=require(_0x2d68('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d68('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x2d68('0x2')](_0x2d68('0x3'),_0x2d68('0x4'),_0x2d68('0x5'),'quietmp3nb',_0x2d68('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x2d68('0x4')},'directory':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![],'defaultValue':_0x2d68('0x7')},'format':{'type':Sequelize[_0x2d68('0x1')],'allowNull':!![]},'stamp':{'type':_0x2d68('0x8')},'defaultEntry':{'type':Sequelize[_0x2d68('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x587d=['quietmp3','mp3','alpha','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb'];(function(_0x10fcec,_0x8d134a){var _0x57aa87=function(_0x262be8){while(--_0x262be8){_0x10fcec['push'](_0x10fcec['shift']());}};_0x57aa87(++_0x8d134a);}(_0x587d,0x13b));var _0xd587=function(_0x36cc70,_0x3f0d9f){_0x36cc70=_0x36cc70-0x0;var _0x1cf0a1=_0x587d[_0x36cc70];return _0x1cf0a1;};'use strict';var Sequelize=require(_0xd587('0x0'));module[_0xd587('0x1')]={'name':{'type':Sequelize[_0xd587('0x2')],'allowNull':![],'unique':_0xd587('0x3')},'mode':{'type':Sequelize[_0xd587('0x4')](_0xd587('0x5'),_0xd587('0x6'),_0xd587('0x7'),_0xd587('0x8'),_0xd587('0x9'),_0xd587('0xa')),'allowNull':!![],'defaultValue':_0xd587('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xd587('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xd587('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xd587('0x2')],'allowNull':!![],'defaultValue':_0xd587('0xb')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'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 e9f0395..7c2343c 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 _0x6f1d=['mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','transaction','readdirSync','forEach','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','%s.%s','basename','extname','format','symlinkSync','removeSound','id2','unlinkSync','getSounds','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','catch','body','find','create','sequelize','mode','files','directory','join','root','server/files/moh'];(function(_0x4f37d4,_0x5907d2){var _0x5f1efe=function(_0x5afebd){while(--_0x5afebd){_0x4f37d4['push'](_0x4f37d4['shift']());}};_0x5f1efe(++_0x5907d2);}(_0x6f1d,0x177));var _0xd6f1=function(_0x3ac49b,_0x4ee6c8){_0x3ac49b=_0x3ac49b-0x0;var _0x1453df=_0x6f1d[_0x3ac49b];return _0x1453df;};'use strict';var emlformat=require(_0xd6f1('0x0'));var rimraf=require(_0xd6f1('0x1'));var zipdir=require(_0xd6f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6f1('0x3'));var BPromise=require(_0xd6f1('0x4'));var Mustache=require(_0xd6f1('0x5'));var util=require(_0xd6f1('0x6'));var path=require(_0xd6f1('0x7'));var sox=require('sox');var csv=require(_0xd6f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6f1('0x9'));var _=require(_0xd6f1('0xa'));var squel=require('squel');var crypto=require(_0xd6f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd6f1('0xc'));var toCsv=require(_0xd6f1('0x8'));var querystring=require(_0xd6f1('0xd'));var Papa=require(_0xd6f1('0xe'));var Redis=require(_0xd6f1('0xf'));var authService=require(_0xd6f1('0x10'));var qs=require(_0xd6f1('0x11'));var as=require(_0xd6f1('0x12'));var hardwareService=require(_0xd6f1('0x13'));var logger=require(_0xd6f1('0x14'))(_0xd6f1('0x15'));var utils=require(_0xd6f1('0x16'));var config=require(_0xd6f1('0x17'));var licenseUtil=require(_0xd6f1('0x18'));var db=require(_0xd6f1('0x19'))['db'];function respondWithStatusCode(_0x315af7,_0x5ba2e9){_0x5ba2e9=_0x5ba2e9||0xcc;return function(_0x27abad){if(_0x27abad){return _0x315af7[_0xd6f1('0x1a')](_0x5ba2e9);}return _0x315af7[_0xd6f1('0x1b')](_0x5ba2e9)[_0xd6f1('0x1c')]();};}function respondWithResult(_0x5f2ec6,_0x44503d){_0x44503d=_0x44503d||0xc8;return function(_0x5c0bb2){if(_0x5c0bb2){return _0x5f2ec6[_0xd6f1('0x1b')](_0x44503d)[_0xd6f1('0x1d')](_0x5c0bb2);}};}function respondWithFilteredResult(_0xba2f5c,_0x3b7037){return function(_0x108264){if(_0x108264){var _0x28ab1e=typeof _0x3b7037['offset']===_0xd6f1('0x1e')&&typeof _0x3b7037[_0xd6f1('0x1f')]===_0xd6f1('0x1e');var _0x2c9c14=_0x108264[_0xd6f1('0x20')];var _0x3fdedb=_0x28ab1e?0x0:_0x3b7037[_0xd6f1('0x21')];var _0x2cb562=_0x28ab1e?_0x108264[_0xd6f1('0x20')]:_0x3b7037[_0xd6f1('0x21')]+_0x3b7037['limit'];var _0xb6a2e;if(_0x2cb562>=_0x2c9c14){_0x2cb562=_0x2c9c14;_0xb6a2e=0xc8;}else{_0xb6a2e=0xce;}_0xba2f5c['status'](_0xb6a2e);return _0xba2f5c[_0xd6f1('0x22')](_0xd6f1('0x23'),_0x3fdedb+'-'+_0x2cb562+'/'+_0x2c9c14)[_0xd6f1('0x1d')](_0x108264);}return null;};}function patchUpdates(_0x565a53){return function(_0x32225f){try{jsonpatch[_0xd6f1('0x24')](_0x32225f,_0x565a53,!![]);}catch(_0x4e209d){return BPromise[_0xd6f1('0x25')](_0x4e209d);}return _0x32225f['save']();};}function saveUpdates(_0x286d79,_0x56614f){return function(_0x4f7af9){if(_0x4f7af9){return _0x4f7af9[_0xd6f1('0x26')](_0x286d79)[_0xd6f1('0x27')](function(_0x1971b6){return _0x1971b6;});}return null;};}function removeEntity(_0x2d3e8d,_0x4a26d7){return function(_0x5c379d){if(_0x5c379d){return _0x5c379d[_0xd6f1('0x28')]()['then'](function(){var _0x42bc94=_0x5c379d[_0xd6f1('0x29')]({'plain':!![]});var _0x430fa6=_0xd6f1('0x2a');return db['UserProfileResource'][_0xd6f1('0x28')]({'where':{'type':_0x430fa6,'resourceId':_0x42bc94['id']}})[_0xd6f1('0x27')](function(){return _0x5c379d;});})[_0xd6f1('0x27')](function(){_0x2d3e8d[_0xd6f1('0x1b')](0xcc)[_0xd6f1('0x1c')]();});}};}function handleEntityNotFound(_0x54e8a7,_0x330dc5){return function(_0x38b29f){if(!_0x38b29f){_0x54e8a7['sendStatus'](0x194);}return _0x38b29f;};}function handleError(_0x218548,_0x562bd7){_0x562bd7=_0x562bd7||0x1f4;return function(_0x11372b){logger['error'](_0x11372b[_0xd6f1('0x2b')]);if(_0x11372b[_0xd6f1('0x2c')]){delete _0x11372b[_0xd6f1('0x2c')];}_0x218548[_0xd6f1('0x1b')](_0x562bd7)[_0xd6f1('0x2d')](_0x11372b);};}exports[_0xd6f1('0x2e')]=function(_0x338977,_0x678559){var _0x50ab9d={},_0x3704d9={},_0x5b6622={'count':0x0,'rows':[]};var _0x267132=_[_0xd6f1('0x2f')](db[_0xd6f1('0x30')][_0xd6f1('0x31')],function(_0x31c57f){return{'name':_0x31c57f[_0xd6f1('0x32')],'type':_0x31c57f[_0xd6f1('0x33')]['key']};});_0x3704d9[_0xd6f1('0x34')]=_[_0xd6f1('0x2f')](_0x267132,_0xd6f1('0x2c'));_0x3704d9[_0xd6f1('0x35')]=_[_0xd6f1('0x36')](_0x338977['query']);_0x3704d9[_0xd6f1('0x37')]=_[_0xd6f1('0x38')](_0x3704d9[_0xd6f1('0x34')],_0x3704d9['query']);_0x50ab9d[_0xd6f1('0x39')]=_[_0xd6f1('0x38')](_0x3704d9[_0xd6f1('0x34')],qs[_0xd6f1('0x3a')](_0x338977[_0xd6f1('0x35')]['fields']));_0x50ab9d[_0xd6f1('0x39')]=_0x50ab9d[_0xd6f1('0x39')][_0xd6f1('0x3b')]?_0x50ab9d[_0xd6f1('0x39')]:_0x3704d9['model'];if(!_0x338977[_0xd6f1('0x35')][_0xd6f1('0x3c')](_0xd6f1('0x3d'))){_0x50ab9d[_0xd6f1('0x1f')]=qs['limit'](_0x338977[_0xd6f1('0x35')]['limit']);_0x50ab9d['offset']=qs[_0xd6f1('0x21')](_0x338977['query'][_0xd6f1('0x21')]);}_0x50ab9d[_0xd6f1('0x3e')]=qs[_0xd6f1('0x3f')](_0x338977['query'][_0xd6f1('0x3f')]);delete _0x338977['query'][_0xd6f1('0x3f')];_0x50ab9d[_0xd6f1('0x40')]=qs[_0xd6f1('0x37')](_[_0xd6f1('0x41')](_0x338977[_0xd6f1('0x35')],_0x3704d9[_0xd6f1('0x37')]),_0x267132);if(_0x338977['query']['filter']){_0x50ab9d[_0xd6f1('0x40')]=_[_0xd6f1('0x42')](_0x50ab9d[_0xd6f1('0x40')],{'$or':_['map'](_0x267132,function(_0x2453aa){if(_0x2453aa[_0xd6f1('0x33')]!=='VIRTUAL'){var _0x150cff={};_0x150cff[_0x2453aa[_0xd6f1('0x2c')]]={'$like':'%'+_0x338977[_0xd6f1('0x35')][_0xd6f1('0x43')]+'%'};return _0x150cff;}})});}_0x50ab9d=_[_0xd6f1('0x42')]({},_0x50ab9d,_0x338977[_0xd6f1('0x44')]);var _0x3552f5={'where':_0x50ab9d[_0xd6f1('0x40')]};return db[_0xd6f1('0x30')][_0xd6f1('0x20')](_0x3552f5)[_0xd6f1('0x27')](function(_0xccab2c){_0x5b6622['count']=_0xccab2c;if(_0x338977['query'][_0xd6f1('0x45')]){_0x50ab9d['include']=[{'all':!![]}];}return db[_0xd6f1('0x30')][_0xd6f1('0x46')](_0x50ab9d);})[_0xd6f1('0x27')](function(_0x58b0c4){_0x5b6622[_0xd6f1('0x47')]=_0x58b0c4;return _0x5b6622;})[_0xd6f1('0x27')](respondWithFilteredResult(_0x678559,_0x50ab9d))['catch'](handleError(_0x678559,null));};exports[_0xd6f1('0x48')]=function(_0x3bc363,_0x2924a4){var _0x3165b9={'raw':![],'where':{'id':_0x3bc363[_0xd6f1('0x49')]['id']}},_0x5a3494={};_0x5a3494[_0xd6f1('0x34')]=_[_0xd6f1('0x36')](db['VoiceMusicOnHold']['rawAttributes']);_0x5a3494[_0xd6f1('0x35')]=_[_0xd6f1('0x36')](_0x3bc363[_0xd6f1('0x35')]);_0x5a3494['filters']=_[_0xd6f1('0x38')](_0x5a3494[_0xd6f1('0x34')],_0x5a3494['query']);_0x3165b9['attributes']=_['intersection'](_0x5a3494['model'],qs[_0xd6f1('0x3a')](_0x3bc363['query'][_0xd6f1('0x3a')]));_0x3165b9[_0xd6f1('0x39')]=_0x3165b9[_0xd6f1('0x39')][_0xd6f1('0x3b')]?_0x3165b9[_0xd6f1('0x39')]:_0x5a3494['model'];if(_0x3bc363['query'][_0xd6f1('0x45')]){_0x3165b9['include']=[{'all':!![]}];}_0x3165b9=_[_0xd6f1('0x42')]({},_0x3165b9,_0x3bc363[_0xd6f1('0x44')]);return db[_0xd6f1('0x30')]['find'](_0x3165b9)[_0xd6f1('0x27')](handleEntityNotFound(_0x2924a4,null))['then'](respondWithResult(_0x2924a4,null))[_0xd6f1('0x4a')](handleError(_0x2924a4,null));};exports['update']=function(_0x27482e,_0x9336fb){if(_0x27482e[_0xd6f1('0x4b')]['id']){delete _0x27482e[_0xd6f1('0x4b')]['id'];}return db[_0xd6f1('0x30')][_0xd6f1('0x4c')]({'where':{'id':_0x27482e['params']['id']}})[_0xd6f1('0x27')](handleEntityNotFound(_0x9336fb,null))[_0xd6f1('0x27')](saveUpdates(_0x27482e[_0xd6f1('0x4b')],null))[_0xd6f1('0x27')](respondWithResult(_0x9336fb,null))['catch'](handleError(_0x9336fb,null));};exports[_0xd6f1('0x4d')]=function(_0x20b668,_0xfe5183,_0x3144f9){return db[_0xd6f1('0x4e')]['transaction'](function(_0x12a7c4){if(_0x20b668[_0xd6f1('0x4b')][_0xd6f1('0x4f')]===_0xd6f1('0x50')){_0x20b668['body'][_0xd6f1('0x51')]=path[_0xd6f1('0x52')](config[_0xd6f1('0x53')],_0xd6f1('0x54'),_0x20b668[_0xd6f1('0x4b')]['name']);}return db[_0xd6f1('0x30')][_0xd6f1('0x4d')](_0x20b668[_0xd6f1('0x4b')],{'transaction':_0x12a7c4})[_0xd6f1('0x27')](function(_0x147555){if(_0x20b668[_0xd6f1('0x4b')][_0xd6f1('0x4f')]==='files'){fs[_0xd6f1('0x55')](_0x147555['directory'],parseInt(_0xd6f1('0x56'),0x8));}var _0xcb0e18=_0x20b668['user']['get']({'plain':!![]});if(!_0xcb0e18)throw new Error(_0xd6f1('0x57'));if(_0xcb0e18[_0xd6f1('0x58')]===_0xd6f1('0x59')){var _0x3c2655=_0x147555[_0xd6f1('0x29')]({'plain':!![]});return db[_0xd6f1('0x5a')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0xcb0e18[_0xd6f1('0x5b')]},'raw':!![]})['then'](function(_0x3a98b8){if(_0x3a98b8&&_0x3a98b8['autoAssociation']===0x0){return db[_0xd6f1('0x5c')][_0xd6f1('0x4d')]({'name':_0x3c2655['name'],'resourceId':_0x3c2655['id'],'type':_0x3a98b8[_0xd6f1('0x2c')],'sectionId':_0x3a98b8['id']},{})[_0xd6f1('0x27')](function(){return _0x147555;});}else{return _0x147555;}})['catch'](function(_0x231e32){logger[_0xd6f1('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x231e32);});}return _0x147555;});})[_0xd6f1('0x27')](respondWithResult(_0xfe5183,0xc9))[_0xd6f1('0x4a')](handleError(_0xfe5183,null));};exports[_0xd6f1('0x28')]=function(_0x5ed690,_0x5ee16f,_0x4925a8){var _0xd49da9;return db[_0xd6f1('0x30')][_0xd6f1('0x4c')]({'where':{'id':_0x5ed690[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](function(_0x112d93){if(_0x112d93){return db[_0xd6f1('0x4e')][_0xd6f1('0x5e')](function(_0x291251){return _0x112d93[_0xd6f1('0x28')]({'transaction':_0x291251,'raw':!![]})[_0xd6f1('0x27')](function(_0x5b146e){if(_0x5b146e['directory']){fs[_0xd6f1('0x5f')](_0x5b146e['directory'])[_0xd6f1('0x60')](function(_0x409684){fs['unlinkSync'](path[_0xd6f1('0x52')](_0x5b146e['directory'],_0x409684));});fs['rmdirSync'](_0x5b146e['directory']);}return _0x5b146e;});})['catch'](function(_0x347ebb){throw new db[(_0xd6f1('0x61'))][(_0xd6f1('0x62'))](_0x347ebb[_0xd6f1('0x63')]);});}})[_0xd6f1('0x27')](handleEntityNotFound(_0x5ee16f,null))[_0xd6f1('0x27')](removeEntity(_0x5ee16f,null))[_0xd6f1('0x4a')](handleError(_0x5ee16f,null));};exports[_0xd6f1('0x64')]=function(_0x125046,_0x1975be,_0x37e781){return db[_0xd6f1('0x4e')][_0xd6f1('0x5e')](function(_0x2f7a1a){var _0x3875f9;return db[_0xd6f1('0x30')][_0xd6f1('0x4c')]({'where':{'id':_0x125046[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](function(_0x51498b){if(_0x51498b){_0x3875f9=_0x51498b;return _0x51498b[_0xd6f1('0x64')](_0x125046[_0xd6f1('0x4b')]['id'],{'transaction':_0x2f7a1a});}})[_0xd6f1('0x27')](function(_0x568fd2){if(_0x568fd2){return db[_0xd6f1('0x65')][_0xd6f1('0x66')]({'where':{'id':_0x125046[_0xd6f1('0x4b')]['id']},'attributes':['id','name',_0xd6f1('0x67'),_0xd6f1('0x68'),_0xd6f1('0x69')],'raw':!![]});}})['then'](function(_0x53896f){if(_0x53896f){var _0x4a2004=path[_0xd6f1('0x52')](config[_0xd6f1('0x53')],'server/files/sounds/converted',util['format'](_0xd6f1('0x6a'),path[_0xd6f1('0x6b')](_0x53896f[_0xd6f1('0x67')],path[_0xd6f1('0x6c')](_0x53896f['save_name'])),_0x53896f['converted_format']));var _0x4f3cd6=path[_0xd6f1('0x52')](config[_0xd6f1('0x53')],_0xd6f1('0x54'),_0x3875f9['name'],util[_0xd6f1('0x6d')](_0xd6f1('0x6a'),_0x53896f['name'],_0x53896f['converted_format']));fs[_0xd6f1('0x6e')](_0x4a2004,_0x4f3cd6);return _0x53896f;}})[_0xd6f1('0x4a')](function(_0x43aeee){throw new db[(_0xd6f1('0x61'))][(_0xd6f1('0x62'))](_0x43aeee[_0xd6f1('0x63')]);});})['then'](handleEntityNotFound(_0x1975be,null))[_0xd6f1('0x27')](respondWithResult(_0x1975be,0xc9))['catch'](handleError(_0x1975be,null));};exports[_0xd6f1('0x6f')]=function(_0x4bfa99,_0x2678c6,_0x53c665){return db[_0xd6f1('0x4e')][_0xd6f1('0x5e')](function(_0x5d1631){var _0xec02af;return db[_0xd6f1('0x30')][_0xd6f1('0x66')]({'where':{'id':_0x4bfa99[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](handleEntityNotFound(_0x2678c6,null))['then'](function(_0x5db02c){if(_0x5db02c){_0xec02af=_0x5db02c;return _0x5db02c[_0xd6f1('0x6f')](_0x4bfa99[_0xd6f1('0x49')]['id2']);}})[_0xd6f1('0x27')](function(_0x48466a){if(_0x48466a){return db[_0xd6f1('0x65')]['findOne']({'where':{'id':_0x4bfa99[_0xd6f1('0x49')][_0xd6f1('0x70')]},'attributes':['id',_0xd6f1('0x2c'),_0xd6f1('0x67'),_0xd6f1('0x68'),_0xd6f1('0x69')],'raw':!![]});}})[_0xd6f1('0x27')](function(_0x36c8b0){if(_0x36c8b0){fs[_0xd6f1('0x71')](path[_0xd6f1('0x52')](_0xec02af[_0xd6f1('0x51')],util[_0xd6f1('0x6d')](_0xd6f1('0x6a'),_0x36c8b0[_0xd6f1('0x2c')],_0x36c8b0['converted_format'])));return _0x36c8b0;}})[_0xd6f1('0x4a')](function(_0x47080d){throw new db[(_0xd6f1('0x61'))]['ValidationError'](_0x47080d[_0xd6f1('0x63')]);});})[_0xd6f1('0x27')](handleEntityNotFound(_0x2678c6,null))['then'](respondWithStatusCode(_0x2678c6,0xcc))['catch'](handleError(_0x2678c6,null));};exports[_0xd6f1('0x72')]=function(_0x487a29,_0x44c957,_0x130c23){var _0x1996cd={};var _0x51c438={};var _0x1800e3;var _0x1064ae;return db['VoiceMusicOnHold'][_0xd6f1('0x66')]({'where':{'id':_0x487a29[_0xd6f1('0x49')]['id']}})[_0xd6f1('0x27')](handleEntityNotFound(_0x44c957,null))[_0xd6f1('0x27')](function(_0x3ee68e){if(_0x3ee68e){_0x1800e3=_0x3ee68e;_0x51c438[_0xd6f1('0x34')]=_[_0xd6f1('0x36')](db['Sound'][_0xd6f1('0x31')]);_0x51c438['query']=_['keys'](_0x487a29[_0xd6f1('0x35')]);_0x51c438[_0xd6f1('0x37')]=_[_0xd6f1('0x38')](_0x51c438[_0xd6f1('0x34')],_0x51c438['query']);_0x1996cd[_0xd6f1('0x39')]=_[_0xd6f1('0x38')](_0x51c438['model'],qs[_0xd6f1('0x3a')](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x3a')]));_0x1996cd[_0xd6f1('0x39')]=_0x1996cd[_0xd6f1('0x39')][_0xd6f1('0x3b')]?_0x1996cd['attributes']:_0x51c438[_0xd6f1('0x34')];_0x1996cd[_0xd6f1('0x3e')]=qs['sort'](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x3f')]);_0x1996cd['where']=qs['filters'](_[_0xd6f1('0x41')](_0x487a29[_0xd6f1('0x35')],_0x51c438[_0xd6f1('0x37')]));if(_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x43')]){_0x1996cd[_0xd6f1('0x40')]=_[_0xd6f1('0x42')](_0x1996cd[_0xd6f1('0x40')],{'$or':_[_0xd6f1('0x2f')](_0x1996cd[_0xd6f1('0x39')],function(_0x45963d){var _0x38b33b={};_0x38b33b[_0x45963d]={'$like':'%'+_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x43')]+'%'};return _0x38b33b;})});}_0x1996cd=_['merge']({},_0x1996cd,_0x487a29[_0xd6f1('0x44')]);return _0x1800e3[_0xd6f1('0x72')](_0x1996cd);}})[_0xd6f1('0x27')](function(_0x5607d1){if(_0x5607d1){_0x1064ae=_0x5607d1['length'];if(!_0x487a29['query'][_0xd6f1('0x3c')](_0xd6f1('0x3d'))){_0x1996cd[_0xd6f1('0x1f')]=qs['limit'](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x1f')]);_0x1996cd[_0xd6f1('0x21')]=qs[_0xd6f1('0x21')](_0x487a29[_0xd6f1('0x35')][_0xd6f1('0x21')]);}return _0x1800e3['getSounds'](_0x1996cd);}})[_0xd6f1('0x27')](function(_0x570b2c){if(_0x570b2c){return _0x570b2c?{'count':_0x1064ae,'rows':_0x570b2c}:null;}})[_0xd6f1('0x27')](respondWithResult(_0x44c957,null))[_0xd6f1('0x4a')](handleError(_0x44c957,null));}; \ No newline at end of file +var _0xf5a6=['Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','server/files/sounds/converted','%s.%s','format','symlinkSync','removeSound','Sound','id2','createdAt','getSounds','order','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','merge','where','VIRTUAL','options','VoiceMusicOnHold','include','findAll','rows','catch','show','params','includeAll','find','body','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','readdirSync','forEach','unlinkSync'];(function(_0x13191c,_0x3c5bd6){var _0x35adc2=function(_0x4f89f2){while(--_0x4f89f2){_0x13191c['push'](_0x13191c['shift']());}};_0x35adc2(++_0x3c5bd6);}(_0xf5a6,0xf8));var _0x6f5a=function(_0x312172,_0x426647){_0x312172=_0x312172-0x0;var _0x19822a=_0xf5a6[_0x312172];return _0x19822a;};'use strict';var emlformat=require(_0x6f5a('0x0'));var rimraf=require(_0x6f5a('0x1'));var zipdir=require(_0x6f5a('0x2'));var jsonpatch=require(_0x6f5a('0x3'));var rp=require(_0x6f5a('0x4'));var moment=require('moment');var BPromise=require(_0x6f5a('0x5'));var Mustache=require(_0x6f5a('0x6'));var util=require(_0x6f5a('0x7'));var path=require(_0x6f5a('0x8'));var sox=require('sox');var csv=require(_0x6f5a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f5a('0xa'));var _=require(_0x6f5a('0xb'));var squel=require(_0x6f5a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6f5a('0xd'));var toCsv=require(_0x6f5a('0x9'));var querystring=require(_0x6f5a('0xe'));var Papa=require(_0x6f5a('0xf'));var Redis=require(_0x6f5a('0x10'));var authService=require(_0x6f5a('0x11'));var qs=require(_0x6f5a('0x12'));var as=require(_0x6f5a('0x13'));var hardwareService=require(_0x6f5a('0x14'));var logger=require('../../config/logger')(_0x6f5a('0x15'));var utils=require(_0x6f5a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f5a('0x17'))['db'];function respondWithStatusCode(_0x4cc004,_0x44eed5){_0x44eed5=_0x44eed5||0xcc;return function(_0x2bcc59){if(_0x2bcc59){return _0x4cc004['sendStatus'](_0x44eed5);}return _0x4cc004['status'](_0x44eed5)[_0x6f5a('0x18')]();};}function respondWithResult(_0x5a863f,_0x1c9e6e){_0x1c9e6e=_0x1c9e6e||0xc8;return function(_0x120c7d){if(_0x120c7d){return _0x5a863f['status'](_0x1c9e6e)[_0x6f5a('0x19')](_0x120c7d);}};}function respondWithFilteredResult(_0x1d7daf,_0x1f7580){return function(_0x17c923){if(_0x17c923){var _0x8a614e=typeof _0x1f7580[_0x6f5a('0x1a')]===_0x6f5a('0x1b')&&typeof _0x1f7580[_0x6f5a('0x1c')]===_0x6f5a('0x1b');var _0x44af87=_0x17c923[_0x6f5a('0x1d')];var _0x177c36=_0x8a614e?0x0:_0x1f7580[_0x6f5a('0x1a')];var _0x57df3f=_0x8a614e?_0x17c923[_0x6f5a('0x1d')]:_0x1f7580[_0x6f5a('0x1a')]+_0x1f7580[_0x6f5a('0x1c')];var _0x29a2b9;if(_0x57df3f>=_0x44af87){_0x57df3f=_0x44af87;_0x29a2b9=0xc8;}else{_0x29a2b9=0xce;}_0x1d7daf[_0x6f5a('0x1e')](_0x29a2b9);return _0x1d7daf[_0x6f5a('0x1f')](_0x6f5a('0x20'),_0x177c36+'-'+_0x57df3f+'/'+_0x44af87)['json'](_0x17c923);}return null;};}function patchUpdates(_0x235187){return function(_0x58c6e4){try{jsonpatch[_0x6f5a('0x21')](_0x58c6e4,_0x235187,!![]);}catch(_0x2bfe2c){return BPromise[_0x6f5a('0x22')](_0x2bfe2c);}return _0x58c6e4[_0x6f5a('0x23')]();};}function saveUpdates(_0x27d7b4,_0x4a9099){return function(_0x1d9f88){if(_0x1d9f88){return _0x1d9f88[_0x6f5a('0x24')](_0x27d7b4)['then'](function(_0x310aa){return _0x310aa;});}return null;};}function removeEntity(_0x20b66d,_0x1c6ac7){return function(_0x5dc5c5){if(_0x5dc5c5){return _0x5dc5c5['destroy']()[_0x6f5a('0x25')](function(){var _0x5da5e3=_0x5dc5c5['get']({'plain':!![]});var _0x14cdb8=_0x6f5a('0x26');return db[_0x6f5a('0x27')]['destroy']({'where':{'type':_0x14cdb8,'resourceId':_0x5da5e3['id']}})['then'](function(){return _0x5dc5c5;});})[_0x6f5a('0x25')](function(){_0x20b66d['status'](0xcc)[_0x6f5a('0x18')]();});}};}function handleEntityNotFound(_0x578411,_0x1ace7d){return function(_0x2c4a2c){if(!_0x2c4a2c){_0x578411[_0x6f5a('0x28')](0x194);}return _0x2c4a2c;};}function handleError(_0x55e727,_0x38a9e4){_0x38a9e4=_0x38a9e4||0x1f4;return function(_0x523f67){logger[_0x6f5a('0x29')](_0x523f67[_0x6f5a('0x2a')]);if(_0x523f67[_0x6f5a('0x2b')]){delete _0x523f67[_0x6f5a('0x2b')];}_0x55e727['status'](_0x38a9e4)['send'](_0x523f67);};}exports[_0x6f5a('0x2c')]=function(_0x4a8c43,_0x31c656){var _0x5e6556={},_0x4e33fb={},_0x32be90={'count':0x0,'rows':[]};var _0x4f77c3=_[_0x6f5a('0x2d')](db['VoiceMusicOnHold'][_0x6f5a('0x2e')],function(_0x17e101){return{'name':_0x17e101[_0x6f5a('0x2f')],'type':_0x17e101[_0x6f5a('0x30')]['key']};});_0x4e33fb[_0x6f5a('0x31')]=_[_0x6f5a('0x2d')](_0x4f77c3,_0x6f5a('0x2b'));_0x4e33fb[_0x6f5a('0x32')]=_[_0x6f5a('0x33')](_0x4a8c43[_0x6f5a('0x32')]);_0x4e33fb[_0x6f5a('0x34')]=_['intersection'](_0x4e33fb[_0x6f5a('0x31')],_0x4e33fb[_0x6f5a('0x32')]);_0x5e6556['attributes']=_[_0x6f5a('0x35')](_0x4e33fb[_0x6f5a('0x31')],qs[_0x6f5a('0x36')](_0x4a8c43['query']['fields']));_0x5e6556['attributes']=_0x5e6556[_0x6f5a('0x37')][_0x6f5a('0x38')]?_0x5e6556[_0x6f5a('0x37')]:_0x4e33fb[_0x6f5a('0x31')];if(!_0x4a8c43[_0x6f5a('0x32')][_0x6f5a('0x39')](_0x6f5a('0x3a'))){_0x5e6556[_0x6f5a('0x1c')]=qs[_0x6f5a('0x1c')](_0x4a8c43[_0x6f5a('0x32')]['limit']);_0x5e6556[_0x6f5a('0x1a')]=qs[_0x6f5a('0x1a')](_0x4a8c43[_0x6f5a('0x32')][_0x6f5a('0x1a')]);}_0x5e6556['order']=qs[_0x6f5a('0x3b')](_0x4a8c43[_0x6f5a('0x32')][_0x6f5a('0x3b')]);delete _0x4a8c43[_0x6f5a('0x32')][_0x6f5a('0x3b')];_0x5e6556['where']=qs[_0x6f5a('0x34')](_['pick'](_0x4a8c43[_0x6f5a('0x32')],_0x4e33fb[_0x6f5a('0x34')]),_0x4f77c3);if(_0x4a8c43['query']['filter']){_0x5e6556['where']=_[_0x6f5a('0x3c')](_0x5e6556[_0x6f5a('0x3d')],{'$or':_[_0x6f5a('0x2d')](_0x4f77c3,function(_0x2ceda3){if(_0x2ceda3[_0x6f5a('0x30')]!==_0x6f5a('0x3e')){var _0x1c9015={};_0x1c9015[_0x2ceda3['name']]={'$like':'%'+_0x4a8c43[_0x6f5a('0x32')]['filter']+'%'};return _0x1c9015;}})});}_0x5e6556=_[_0x6f5a('0x3c')]({},_0x5e6556,_0x4a8c43[_0x6f5a('0x3f')]);var _0x4d1942={'where':_0x5e6556[_0x6f5a('0x3d')]};return db[_0x6f5a('0x40')]['count'](_0x4d1942)[_0x6f5a('0x25')](function(_0x157e8f){_0x32be90[_0x6f5a('0x1d')]=_0x157e8f;if(_0x4a8c43[_0x6f5a('0x32')]['includeAll']){_0x5e6556[_0x6f5a('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x6f5a('0x42')](_0x5e6556);})['then'](function(_0x407d50){_0x32be90[_0x6f5a('0x43')]=_0x407d50;return _0x32be90;})['then'](respondWithFilteredResult(_0x31c656,_0x5e6556))[_0x6f5a('0x44')](handleError(_0x31c656,null));};exports[_0x6f5a('0x45')]=function(_0x15bdf8,_0x321580){var _0x8da63d={'raw':![],'where':{'id':_0x15bdf8[_0x6f5a('0x46')]['id']}},_0x1524a8={};_0x1524a8[_0x6f5a('0x31')]=_[_0x6f5a('0x33')](db[_0x6f5a('0x40')][_0x6f5a('0x2e')]);_0x1524a8[_0x6f5a('0x32')]=_[_0x6f5a('0x33')](_0x15bdf8[_0x6f5a('0x32')]);_0x1524a8[_0x6f5a('0x34')]=_['intersection'](_0x1524a8['model'],_0x1524a8[_0x6f5a('0x32')]);_0x8da63d['attributes']=_['intersection'](_0x1524a8[_0x6f5a('0x31')],qs[_0x6f5a('0x36')](_0x15bdf8[_0x6f5a('0x32')][_0x6f5a('0x36')]));_0x8da63d[_0x6f5a('0x37')]=_0x8da63d['attributes']['length']?_0x8da63d[_0x6f5a('0x37')]:_0x1524a8[_0x6f5a('0x31')];if(_0x15bdf8['query'][_0x6f5a('0x47')]){_0x8da63d[_0x6f5a('0x41')]=[{'all':!![]}];}_0x8da63d=_['merge']({},_0x8da63d,_0x15bdf8[_0x6f5a('0x3f')]);return db[_0x6f5a('0x40')][_0x6f5a('0x48')](_0x8da63d)[_0x6f5a('0x25')](handleEntityNotFound(_0x321580,null))[_0x6f5a('0x25')](respondWithResult(_0x321580,null))['catch'](handleError(_0x321580,null));};exports[_0x6f5a('0x24')]=function(_0x4388f4,_0x402d44){if(_0x4388f4['body']['id']){delete _0x4388f4['body']['id'];}return db[_0x6f5a('0x40')][_0x6f5a('0x48')]({'where':{'id':_0x4388f4['params']['id']}})[_0x6f5a('0x25')](handleEntityNotFound(_0x402d44,null))[_0x6f5a('0x25')](saveUpdates(_0x4388f4[_0x6f5a('0x49')],null))[_0x6f5a('0x25')](respondWithResult(_0x402d44,null))['catch'](handleError(_0x402d44,null));};exports[_0x6f5a('0x4a')]=function(_0x3ac136,_0x10e72b,_0x4c2b91){return db['sequelize'][_0x6f5a('0x4b')](function(_0x14112e){if(_0x3ac136[_0x6f5a('0x49')][_0x6f5a('0x4c')]===_0x6f5a('0x4d')){_0x3ac136[_0x6f5a('0x49')][_0x6f5a('0x4e')]=path[_0x6f5a('0x4f')](config[_0x6f5a('0x50')],_0x6f5a('0x51'),_0x3ac136[_0x6f5a('0x49')]['name']);}return db[_0x6f5a('0x40')][_0x6f5a('0x4a')](_0x3ac136[_0x6f5a('0x49')],{'transaction':_0x14112e})['then'](function(_0x183f6f){if(_0x3ac136[_0x6f5a('0x49')][_0x6f5a('0x4c')]===_0x6f5a('0x4d')){fs[_0x6f5a('0x52')](_0x183f6f[_0x6f5a('0x4e')],parseInt(_0x6f5a('0x53'),0x8));}var _0x15e736=_0x3ac136[_0x6f5a('0x54')][_0x6f5a('0x55')]({'plain':!![]});if(!_0x15e736)throw new Error(_0x6f5a('0x56'));if(_0x15e736[_0x6f5a('0x57')]===_0x6f5a('0x54')){var _0x50f6ec=_0x183f6f[_0x6f5a('0x55')]({'plain':!![]});return db[_0x6f5a('0x58')][_0x6f5a('0x48')]({'where':{'name':_0x6f5a('0x26'),'userProfileId':_0x15e736[_0x6f5a('0x59')]},'raw':!![]})[_0x6f5a('0x25')](function(_0x1ee854){if(_0x1ee854&&_0x1ee854[_0x6f5a('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x50f6ec[_0x6f5a('0x2b')],'resourceId':_0x50f6ec['id'],'type':_0x1ee854[_0x6f5a('0x2b')],'sectionId':_0x1ee854['id']},{})[_0x6f5a('0x25')](function(){return _0x183f6f;});}else{return _0x183f6f;}})[_0x6f5a('0x44')](function(_0x37d453){logger[_0x6f5a('0x29')](_0x6f5a('0x5b'),_0x37d453);});}return _0x183f6f;});})[_0x6f5a('0x25')](respondWithResult(_0x10e72b,0xc9))['catch'](handleError(_0x10e72b,null));};exports[_0x6f5a('0x5c')]=function(_0xdebe33,_0x51c958,_0x1cd396){var _0x3cfe4a;return db[_0x6f5a('0x40')][_0x6f5a('0x48')]({'where':{'id':_0xdebe33['params']['id']}})[_0x6f5a('0x25')](function(_0x36a7da){if(_0x36a7da){return db[_0x6f5a('0x5d')][_0x6f5a('0x4b')](function(_0x16f0d8){return _0x36a7da[_0x6f5a('0x5c')]({'transaction':_0x16f0d8,'raw':!![]})[_0x6f5a('0x25')](function(_0x3a087f){if(_0x3a087f['directory']){fs[_0x6f5a('0x5e')](_0x3a087f[_0x6f5a('0x4e')])[_0x6f5a('0x5f')](function(_0x498e8f){fs[_0x6f5a('0x60')](path[_0x6f5a('0x4f')](_0x3a087f[_0x6f5a('0x4e')],_0x498e8f));});fs['rmdirSync'](_0x3a087f['directory']);}return _0x3a087f;});})[_0x6f5a('0x44')](function(_0x365154){throw new db[(_0x6f5a('0x61'))][(_0x6f5a('0x62'))](_0x365154[_0x6f5a('0x63')]);});}})[_0x6f5a('0x25')](handleEntityNotFound(_0x51c958,null))[_0x6f5a('0x25')](removeEntity(_0x51c958,null))[_0x6f5a('0x44')](handleError(_0x51c958,null));};exports[_0x6f5a('0x64')]=function(_0x3dac89,_0xe3d66c,_0x251d95){return db[_0x6f5a('0x5d')][_0x6f5a('0x4b')](function(_0x39bd34){var _0x1ac044;return db[_0x6f5a('0x40')]['find']({'where':{'id':_0x3dac89[_0x6f5a('0x46')]['id']}})[_0x6f5a('0x25')](function(_0x295a09){if(_0x295a09){_0x1ac044=_0x295a09;return _0x295a09[_0x6f5a('0x64')](_0x3dac89[_0x6f5a('0x49')]['id'],{'transaction':_0x39bd34});}})[_0x6f5a('0x25')](function(_0xdc03cd){if(_0xdc03cd){return db['Sound'][_0x6f5a('0x65')]({'where':{'id':_0x3dac89['body']['id']},'attributes':['id',_0x6f5a('0x2b'),_0x6f5a('0x66'),_0x6f5a('0x67'),'createdAt'],'raw':!![]});}})[_0x6f5a('0x25')](function(_0x1eaa92){if(_0x1eaa92){var _0x1d47ab=path[_0x6f5a('0x4f')](config[_0x6f5a('0x50')],_0x6f5a('0x68'),util['format'](_0x6f5a('0x69'),path['basename'](_0x1eaa92[_0x6f5a('0x66')],path['extname'](_0x1eaa92[_0x6f5a('0x66')])),_0x1eaa92['converted_format']));var _0x3dc2f3=path[_0x6f5a('0x4f')](config[_0x6f5a('0x50')],_0x6f5a('0x51'),_0x1ac044[_0x6f5a('0x2b')],util[_0x6f5a('0x6a')](_0x6f5a('0x69'),_0x1eaa92['name'],_0x1eaa92[_0x6f5a('0x67')]));fs[_0x6f5a('0x6b')](_0x1d47ab,_0x3dc2f3);return _0x1eaa92;}})[_0x6f5a('0x44')](function(_0x47246c){throw new db[(_0x6f5a('0x61'))][(_0x6f5a('0x62'))](_0x47246c[_0x6f5a('0x63')]);});})[_0x6f5a('0x25')](handleEntityNotFound(_0xe3d66c,null))['then'](respondWithResult(_0xe3d66c,0xc9))[_0x6f5a('0x44')](handleError(_0xe3d66c,null));};exports[_0x6f5a('0x6c')]=function(_0x6b983,_0x68af2d,_0x511f7f){return db['sequelize'][_0x6f5a('0x4b')](function(_0x3882a7){var _0x306111;return db[_0x6f5a('0x40')]['findOne']({'where':{'id':_0x6b983[_0x6f5a('0x46')]['id']}})['then'](handleEntityNotFound(_0x68af2d,null))[_0x6f5a('0x25')](function(_0x174d7a){if(_0x174d7a){_0x306111=_0x174d7a;return _0x174d7a['removeSound'](_0x6b983[_0x6f5a('0x46')]['id2']);}})[_0x6f5a('0x25')](function(_0x5e55b2){if(_0x5e55b2){return db[_0x6f5a('0x6d')]['findOne']({'where':{'id':_0x6b983[_0x6f5a('0x46')][_0x6f5a('0x6e')]},'attributes':['id','name',_0x6f5a('0x66'),'converted_format',_0x6f5a('0x6f')],'raw':!![]});}})[_0x6f5a('0x25')](function(_0x5d21a2){if(_0x5d21a2){fs[_0x6f5a('0x60')](path[_0x6f5a('0x4f')](_0x306111['directory'],util['format']('%s.%s',_0x5d21a2[_0x6f5a('0x2b')],_0x5d21a2[_0x6f5a('0x67')])));return _0x5d21a2;}})[_0x6f5a('0x44')](function(_0xc9fa98){throw new db[(_0x6f5a('0x61'))][(_0x6f5a('0x62'))](_0xc9fa98[_0x6f5a('0x63')]);});})[_0x6f5a('0x25')](handleEntityNotFound(_0x68af2d,null))['then'](respondWithStatusCode(_0x68af2d,0xcc))[_0x6f5a('0x44')](handleError(_0x68af2d,null));};exports[_0x6f5a('0x70')]=function(_0x1dd1cf,_0x2f61c3,_0x1d1c12){var _0x2e8a3e={};var _0x493073={};var _0x9537d6;var _0x46f001;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x1dd1cf['params']['id']}})['then'](handleEntityNotFound(_0x2f61c3,null))[_0x6f5a('0x25')](function(_0x2bcb95){if(_0x2bcb95){_0x9537d6=_0x2bcb95;_0x493073[_0x6f5a('0x31')]=_[_0x6f5a('0x33')](db[_0x6f5a('0x6d')][_0x6f5a('0x2e')]);_0x493073[_0x6f5a('0x32')]=_[_0x6f5a('0x33')](_0x1dd1cf['query']);_0x493073['filters']=_[_0x6f5a('0x35')](_0x493073[_0x6f5a('0x31')],_0x493073[_0x6f5a('0x32')]);_0x2e8a3e[_0x6f5a('0x37')]=_['intersection'](_0x493073[_0x6f5a('0x31')],qs[_0x6f5a('0x36')](_0x1dd1cf[_0x6f5a('0x32')]['fields']));_0x2e8a3e['attributes']=_0x2e8a3e[_0x6f5a('0x37')][_0x6f5a('0x38')]?_0x2e8a3e['attributes']:_0x493073[_0x6f5a('0x31')];_0x2e8a3e[_0x6f5a('0x71')]=qs[_0x6f5a('0x3b')](_0x1dd1cf[_0x6f5a('0x32')][_0x6f5a('0x3b')]);_0x2e8a3e[_0x6f5a('0x3d')]=qs['filters'](_['pick'](_0x1dd1cf[_0x6f5a('0x32')],_0x493073[_0x6f5a('0x34')]));if(_0x1dd1cf['query'][_0x6f5a('0x72')]){_0x2e8a3e[_0x6f5a('0x3d')]=_[_0x6f5a('0x3c')](_0x2e8a3e[_0x6f5a('0x3d')],{'$or':_['map'](_0x2e8a3e[_0x6f5a('0x37')],function(_0x32f19b){var _0x497422={};_0x497422[_0x32f19b]={'$like':'%'+_0x1dd1cf[_0x6f5a('0x32')][_0x6f5a('0x72')]+'%'};return _0x497422;})});}_0x2e8a3e=_[_0x6f5a('0x3c')]({},_0x2e8a3e,_0x1dd1cf['options']);return _0x9537d6[_0x6f5a('0x70')](_0x2e8a3e);}})[_0x6f5a('0x25')](function(_0x4d1e93){if(_0x4d1e93){_0x46f001=_0x4d1e93[_0x6f5a('0x38')];if(!_0x1dd1cf[_0x6f5a('0x32')][_0x6f5a('0x39')]('nolimit')){_0x2e8a3e[_0x6f5a('0x1c')]=qs[_0x6f5a('0x1c')](_0x1dd1cf[_0x6f5a('0x32')]['limit']);_0x2e8a3e[_0x6f5a('0x1a')]=qs['offset'](_0x1dd1cf[_0x6f5a('0x32')][_0x6f5a('0x1a')]);}return _0x9537d6[_0x6f5a('0x70')](_0x2e8a3e);}})[_0x6f5a('0x25')](function(_0x5c2800){if(_0x5c2800){return _0x5c2800?{'count':_0x46f001,'rows':_0x5c2800}:null;}})[_0x6f5a('0x25')](respondWithResult(_0x2f61c3,null))[_0x6f5a('0x44')](handleError(_0x2f61c3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2d265ad..6b07341 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 _0xd239=['lodash','api','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x5eede8,_0x549104){var _0x551f6d=function(_0x11418c){while(--_0x11418c){_0x5eede8['push'](_0x5eede8['shift']());}};_0x551f6d(++_0x549104);}(_0xd239,0x82));var _0x9d23=function(_0x4e7c1a,_0x356c24){_0x4e7c1a=_0x4e7c1a-0x0;var _0xfe44dd=_0xd239[_0x4e7c1a];return _0xfe44dd;};'use strict';var _=require(_0x9d23('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9d23('0x1'));var moment=require('moment');var BPromise=require(_0x9d23('0x2'));var rp=require(_0x9d23('0x3'));var fs=require('fs');var path=require(_0x9d23('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d23('0x5'));module[_0x9d23('0x6')]=function(_0x96c93f,_0x1e7364){return _0x96c93f[_0x9d23('0x7')](_0x9d23('0x8'),attributes,{'tableName':_0x9d23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x954e=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xaf852,_0x2d7f05){var _0x22fcdc=function(_0xa78859){while(--_0xa78859){_0xaf852['push'](_0xaf852['shift']());}};_0x22fcdc(++_0x2d7f05);}(_0x954e,0xcb));var _0xe954=function(_0x37ca5f,_0x7b93d4){_0x37ca5f=_0x37ca5f-0x0;var _0x4b0676=_0x954e[_0x37ca5f];return _0x4b0676;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe954('0x0'))(_0xe954('0x1'));var moment=require(_0xe954('0x2'));var BPromise=require(_0xe954('0x3'));var rp=require(_0xe954('0x4'));var fs=require('fs');var path=require(_0xe954('0x5'));var rimraf=require(_0xe954('0x6'));var config=require(_0xe954('0x7'));var attributes=require(_0xe954('0x8'));module[_0xe954('0x9')]=function(_0x4cb34c,_0x477120){return _0x4cb34c[_0xe954('0xa')](_0xe954('0xb'),attributes,{'tableName':_0xe954('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 50d3ee4..bc5cd75 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x128df4,_0x1d4a84){var _0x1e8e3a=function(_0x1b7d94){while(--_0x1b7d94){_0x128df4['push'](_0x128df4['shift']());}};_0x1e8e3a(++_0x1d4a84);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f605d,_0x33292f){var _0x45eb99=function(_0x4d5bd7){while(--_0x4d5bd7){_0x4f605d['push'](_0x4f605d['shift']());}};_0x45eb99(++_0x33292f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 46d0282..7dd9795 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 _0xbfda=['getTeams','post','create','/:id/users','addAgents','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','getAgents','/:id/teams'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbfda,0x1dc));var _0xabfd=function(_0x19cfac,_0x3745dc){_0x19cfac=_0x19cfac-0x0;var _0x25d2a5=_0xbfda[_0x19cfac];return _0x25d2a5;};'use strict';var multer=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var path=require(_0xabfd('0x2'));var timeout=require('connect-timeout');var express=require(_0xabfd('0x3'));var router=express['Router']();var fs_extra=require(_0xabfd('0x4'));var auth=require(_0xabfd('0x5'));var interaction=require(_0xabfd('0x6'));var config=require(_0xabfd('0x7'));var controller=require('./voicePrefix.controller');router[_0xabfd('0x8')]('/',auth['isAuthenticated'](),controller[_0xabfd('0x9')]);router['get'](_0xabfd('0xa'),auth['isAuthenticated'](),controller[_0xabfd('0xb')]);router[_0xabfd('0x8')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0xe')]);router[_0xabfd('0x8')]('/:id/users',auth[_0xabfd('0xd')](),controller[_0xabfd('0xf')]);router[_0xabfd('0x8')](_0xabfd('0x10'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x11')]);router[_0xabfd('0x12')]('/',auth[_0xabfd('0xd')](),controller[_0xabfd('0x13')]);router[_0xabfd('0x12')](_0xabfd('0x14'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x15')]);router['post'](_0xabfd('0x10'),auth[_0xabfd('0xd')](),controller['addTeams']);router[_0xabfd('0x16')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x17')]);router[_0xabfd('0x18')](_0xabfd('0xc'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x19')]);router[_0xabfd('0x18')]('/:id/users',auth[_0xabfd('0xd')](),controller[_0xabfd('0x1a')]);router[_0xabfd('0x18')](_0xabfd('0x10'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x1b')]);module[_0xabfd('0x1c')]=router; \ No newline at end of file +var _0x0d6a=['removeTeams','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id/teams','getTeams','post','/:id/users','addTeams','put','/:id','destroy','delete','removeAgents'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x0d6a[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xa0d6('0x0'));var util=require(_0xa0d6('0x1'));var path=require('path');var timeout=require(_0xa0d6('0x2'));var express=require(_0xa0d6('0x3'));var router=express[_0xa0d6('0x4')]();var fs_extra=require(_0xa0d6('0x5'));var auth=require(_0xa0d6('0x6'));var interaction=require(_0xa0d6('0x7'));var config=require(_0xa0d6('0x8'));var controller=require(_0xa0d6('0x9'));router[_0xa0d6('0xa')]('/',auth[_0xa0d6('0xb')](),controller['index']);router[_0xa0d6('0xa')](_0xa0d6('0xc'),auth[_0xa0d6('0xb')](),controller[_0xa0d6('0xd')]);router[_0xa0d6('0xa')]('/:id',auth[_0xa0d6('0xb')](),controller['show']);router[_0xa0d6('0xa')]('/:id/users',auth[_0xa0d6('0xb')](),controller['getAgents']);router[_0xa0d6('0xa')](_0xa0d6('0xe'),auth[_0xa0d6('0xb')](),controller[_0xa0d6('0xf')]);router[_0xa0d6('0x10')]('/',auth[_0xa0d6('0xb')](),controller['create']);router[_0xa0d6('0x10')](_0xa0d6('0x11'),auth[_0xa0d6('0xb')](),controller['addAgents']);router[_0xa0d6('0x10')](_0xa0d6('0xe'),auth[_0xa0d6('0xb')](),controller[_0xa0d6('0x12')]);router[_0xa0d6('0x13')](_0xa0d6('0x14'),auth[_0xa0d6('0xb')](),controller['update']);router['delete'](_0xa0d6('0x14'),auth[_0xa0d6('0xb')](),controller[_0xa0d6('0x15')]);router[_0xa0d6('0x16')](_0xa0d6('0x11'),auth[_0xa0d6('0xb')](),controller[_0xa0d6('0x17')]);router['delete'](_0xa0d6('0xe'),auth[_0xa0d6('0xb')](),controller[_0xa0d6('0x18')]);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 fcc076e..147152a 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 _0x259f=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x105671,_0x17f306){var _0x2c078c=function(_0x9e4884){while(--_0x9e4884){_0x105671['push'](_0x105671['shift']());}};_0x2c078c(++_0x17f306);}(_0x259f,0x10a));var _0xf259=function(_0x5072df,_0x4b6d2c){_0x5072df=_0x5072df-0x0;var _0x80cc8d=_0x259f[_0x5072df];return _0x80cc8d;};'use strict';var Sequelize=require(_0xf259('0x0'));module[_0xf259('0x1')]={'name':{'type':Sequelize[_0xf259('0x2')],'allowNull':![],'unique':_0xf259('0x3')},'prefix':{'type':Sequelize[_0xf259('0x4')],'get':function(_0x85b9aa){return _0xf259('0x5')+this[_0xf259('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xf259('0x2')]},'callerIdAll':{'type':Sequelize[_0xf259('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3711=['exports','name','VIRTUAL','system-','STRING','INTEGER','sequelize'];(function(_0x4f36be,_0x3a46ce){var _0x4995f0=function(_0x192a20){while(--_0x192a20){_0x4f36be['push'](_0x4f36be['shift']());}};_0x4995f0(++_0x3a46ce);}(_0x3711,0x102));var _0x1371=function(_0x521d9c,_0x564b21){_0x521d9c=_0x521d9c-0x0;var _0x2b9132=_0x3711[_0x521d9c];return _0x2b9132;};'use strict';var Sequelize=require(_0x1371('0x0'));module[_0x1371('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1371('0x2')},'prefix':{'type':Sequelize[_0x1371('0x3')],'get':function(_0x9850d1){return _0x1371('0x4')+this['getDataValue'](_0x1371('0x2'))+'-';}},'description':{'type':Sequelize[_0x1371('0x5')]},'callerIdAll':{'type':Sequelize[_0x1371('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x1371('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2109916..a2f4385 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 _0x7d25=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoicePrefix','includeAll','findAll','catch','show','include','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','context','app','system','description','appdata','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','NoOp','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','params','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','User','getTeams','findOne','addTeams','Agents','online','interface','each','upsert','forEach','removeTeams','Team','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4e4003,_0x58aaf7){var _0x3ad762=function(_0x5c168e){while(--_0x5c168e){_0x4e4003['push'](_0x4e4003['shift']());}};_0x3ad762(++_0x58aaf7);}(_0x7d25,0x8a));var _0x57d2=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x7d25[_0x4ed520];return _0x4415a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];config[_0x57d2('0x17')]=_[_0x57d2('0x18')](config[_0x57d2('0x17')],{'host':_0x57d2('0x19'),'port':0x18eb});var socket=require(_0x57d2('0x1a'))(new Redis(config[_0x57d2('0x17')]));require(_0x57d2('0x1b'))[_0x57d2('0x1c')](socket);function respondWithStatusCode(_0x5382d9,_0x5b940e){_0x5b940e=_0x5b940e||0xcc;return function(_0x6fad35){if(_0x6fad35){return _0x5382d9[_0x57d2('0x1d')](_0x5b940e);}return _0x5382d9['status'](_0x5b940e)[_0x57d2('0x1e')]();};}function respondWithResult(_0x319489,_0x4bb8f7){_0x4bb8f7=_0x4bb8f7||0xc8;return function(_0x3e12c6){if(_0x3e12c6){return _0x319489['status'](_0x4bb8f7)[_0x57d2('0x1f')](_0x3e12c6);}};}function respondWithFilteredResult(_0x4b4fe0,_0x2ab5f0){return function(_0x7d4cf1){if(_0x7d4cf1){var _0x2ecfdf=typeof _0x2ab5f0['offset']==='undefined'&&typeof _0x2ab5f0[_0x57d2('0x20')]===_0x57d2('0x21');var _0x2662cd=_0x7d4cf1[_0x57d2('0x22')];var _0x5b1b9d=_0x2ecfdf?0x0:_0x2ab5f0[_0x57d2('0x23')];var _0xcf924f=_0x2ecfdf?_0x7d4cf1['count']:_0x2ab5f0['offset']+_0x2ab5f0[_0x57d2('0x20')];var _0x326d49;if(_0xcf924f>=_0x2662cd){_0xcf924f=_0x2662cd;_0x326d49=0xc8;}else{_0x326d49=0xce;}_0x4b4fe0[_0x57d2('0x24')](_0x326d49);return _0x4b4fe0[_0x57d2('0x25')](_0x57d2('0x26'),_0x5b1b9d+'-'+_0xcf924f+'/'+_0x2662cd)[_0x57d2('0x1f')](_0x7d4cf1);}return null;};}function patchUpdates(_0x32c7c8){return function(_0x31d2cf){try{jsonpatch[_0x57d2('0x27')](_0x31d2cf,_0x32c7c8,!![]);}catch(_0x26718e){return BPromise[_0x57d2('0x28')](_0x26718e);}return _0x31d2cf[_0x57d2('0x29')]();};}function saveUpdates(_0x12ff19,_0x473df2){return function(_0x5327ea){if(_0x5327ea){return _0x5327ea[_0x57d2('0x2a')](_0x12ff19)[_0x57d2('0x2b')](function(_0x3c7de8){return _0x3c7de8;});}return null;};}function removeEntity(_0x452d5e,_0x4363b3){return function(_0x5058be){if(_0x5058be){return _0x5058be[_0x57d2('0x2c')]()[_0x57d2('0x2b')](function(){var _0x995928=_0x5058be[_0x57d2('0x2d')]({'plain':!![]});var _0x18d500=_0x57d2('0x2e');return db[_0x57d2('0x2f')]['destroy']({'where':{'type':_0x18d500,'resourceId':_0x995928['id']}})[_0x57d2('0x2b')](function(){return _0x5058be;});})[_0x57d2('0x2b')](function(){_0x452d5e[_0x57d2('0x24')](0xcc)[_0x57d2('0x1e')]();});}};}function handleEntityNotFound(_0x1957a6,_0x7c33f3){return function(_0x1dd6cb){if(!_0x1dd6cb){_0x1957a6[_0x57d2('0x1d')](0x194);}return _0x1dd6cb;};}function handleError(_0x1d2bdb,_0x2cf9d9){_0x2cf9d9=_0x2cf9d9||0x1f4;return function(_0x574589){logger[_0x57d2('0x30')](_0x574589[_0x57d2('0x31')]);if(_0x574589[_0x57d2('0x32')]){delete _0x574589[_0x57d2('0x32')];}_0x1d2bdb['status'](_0x2cf9d9)[_0x57d2('0x33')](_0x574589);};}exports[_0x57d2('0x34')]=function(_0x21152e,_0x290c2d){var _0xb3051c={},_0x40f3f2={},_0x3cbc4b={'count':0x0,'rows':[]};var _0x36c0d7=_[_0x57d2('0x35')](db['VoicePrefix'][_0x57d2('0x36')],function(_0x213c99){return{'name':_0x213c99['fieldName'],'type':_0x213c99[_0x57d2('0x37')][_0x57d2('0x38')]};});_0x40f3f2['model']=_[_0x57d2('0x35')](_0x36c0d7,_0x57d2('0x32'));_0x40f3f2[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x21152e[_0x57d2('0x39')]);_0x40f3f2['filters']=_['intersection'](_0x40f3f2['model'],_0x40f3f2['query']);_0xb3051c[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x40f3f2[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x21152e[_0x57d2('0x39')]['fields']));_0xb3051c[_0x57d2('0x3b')]=_0xb3051c['attributes'][_0x57d2('0x3f')]?_0xb3051c[_0x57d2('0x3b')]:_0x40f3f2[_0x57d2('0x3d')];if(!_0x21152e['query'][_0x57d2('0x40')](_0x57d2('0x41'))){_0xb3051c['limit']=qs[_0x57d2('0x20')](_0x21152e[_0x57d2('0x39')][_0x57d2('0x20')]);_0xb3051c[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x21152e[_0x57d2('0x39')]['offset']);}_0xb3051c[_0x57d2('0x42')]=qs['sort'](_0x21152e[_0x57d2('0x39')][_0x57d2('0x43')]);_0xb3051c[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x21152e['query'],_0x40f3f2[_0x57d2('0x45')]),_0x36c0d7);if(_0x21152e[_0x57d2('0x39')]['filter']){_0xb3051c[_0x57d2('0x44')]=_[_0x57d2('0x47')](_0xb3051c[_0x57d2('0x44')],{'$or':_['map'](_0x36c0d7,function(_0x226e56){if(_0x226e56[_0x57d2('0x37')]!==_0x57d2('0x48')){var _0x3281c9={};_0x3281c9[_0x226e56['name']]={'$like':'%'+_0x21152e['query'][_0x57d2('0x49')]+'%'};return _0x3281c9;}})});}_0xb3051c=_[_0x57d2('0x47')]({},_0xb3051c,_0x21152e[_0x57d2('0x4a')]);var _0x5795e7={'where':_0xb3051c['where']};return db[_0x57d2('0x4b')]['count'](_0x5795e7)[_0x57d2('0x2b')](function(_0x1bb8ad){_0x3cbc4b[_0x57d2('0x22')]=_0x1bb8ad;if(_0x21152e[_0x57d2('0x39')][_0x57d2('0x4c')]){_0xb3051c['include']=[{'all':!![]}];}return db[_0x57d2('0x4b')][_0x57d2('0x4d')](_0xb3051c);})['then'](function(_0x775f8c){_0x3cbc4b['rows']=_0x775f8c;return _0x3cbc4b;})[_0x57d2('0x2b')](respondWithFilteredResult(_0x290c2d,_0xb3051c))[_0x57d2('0x4e')](handleError(_0x290c2d,null));};exports[_0x57d2('0x4f')]=function(_0x323273,_0x58aa4e){var _0x541772={'raw':![],'where':{'id':_0x323273['params']['id']}},_0x3d8256={};_0x3d8256['model']=_[_0x57d2('0x3a')](db['VoicePrefix']['rawAttributes']);_0x3d8256[_0x57d2('0x39')]=_['keys'](_0x323273[_0x57d2('0x39')]);_0x3d8256['filters']=_[_0x57d2('0x3c')](_0x3d8256['model'],_0x3d8256['query']);_0x541772[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x3d8256[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x323273[_0x57d2('0x39')][_0x57d2('0x3e')]));_0x541772['attributes']=_0x541772[_0x57d2('0x3b')][_0x57d2('0x3f')]?_0x541772[_0x57d2('0x3b')]:_0x3d8256[_0x57d2('0x3d')];if(_0x323273[_0x57d2('0x39')][_0x57d2('0x4c')]){_0x541772[_0x57d2('0x50')]=[{'all':!![]}];}_0x541772=_[_0x57d2('0x47')]({},_0x541772,_0x323273['options']);return db[_0x57d2('0x4b')][_0x57d2('0x51')](_0x541772)['then'](handleEntityNotFound(_0x58aa4e,null))[_0x57d2('0x2b')](respondWithResult(_0x58aa4e,null))['catch'](handleError(_0x58aa4e,null));};exports['destroy']=function(_0x1a1dc7,_0x31f404){return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x1a1dc7['params']['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x31f404,null))[_0x57d2('0x2b')](removeEntity(_0x31f404,null))['catch'](handleError(_0x31f404,null));};exports['describe']=function(_0xd7c79f,_0xb02f43){return db[_0x57d2('0x4b')][_0x57d2('0x52')]()[_0x57d2('0x2b')](respondWithResult(_0xb02f43,null))[_0x57d2('0x4e')](handleError(_0xb02f43,null));};exports['create']=function(_0x4b377f,_0x5a5edb){var _0x30482c;return db['sequelize'][_0x57d2('0x53')](function(_0x2ef710){return db['VoicePrefix'][_0x57d2('0x54')](_0x4b377f[_0x57d2('0x55')],{'transaction':_0x2ef710})[_0x57d2('0x2b')](function(_0x557f79){_0x30482c=_0x557f79[_0x57d2('0x2d')]({'plain':!![]});return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x30482c[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x2e90eb){return createVoicePrefixExtensions(_0x30482c,_0x2e90eb,_0x2ef710);});});})[_0x57d2('0x2b')](function(){var _0x2b93c4=_0x4b377f[_0x57d2('0x58')]['get']({'plain':!![]});if(!_0x2b93c4)throw new Error(_0x57d2('0x59'));if(_0x2b93c4[_0x57d2('0x5a')]===_0x57d2('0x58')){var _0x5e3289=_0x30482c;return db[_0x57d2('0x5b')][_0x57d2('0x51')]({'where':{'name':_0x57d2('0x2e'),'userProfileId':_0x2b93c4['userProfileId']},'raw':!![]})['then'](function(_0x56ddfd){if(_0x56ddfd&&_0x56ddfd[_0x57d2('0x5c')]===0x0){return db['UserProfileResource'][_0x57d2('0x54')]({'name':_0x5e3289['name'],'resourceId':_0x5e3289['id'],'type':_0x56ddfd[_0x57d2('0x32')],'sectionId':_0x56ddfd['id']},{})['then'](function(){return _0x30482c;});}else{return _0x30482c;}})[_0x57d2('0x4e')](function(_0x430f85){logger[_0x57d2('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430f85);throw _0x430f85;});}return _0x30482c;})['then'](respondWithResult(_0x5a5edb,null))[_0x57d2('0x4e')](handleError(_0x5a5edb,null));};function Extension(_0x2c1710,_0x3b57fa,_0x227a02,_0x3e5d71){this[_0x57d2('0x5d')]='from-sip';this['exten']=_0x2c1710;this[_0x57d2('0x5e')]=_0x227a02;this[_0x57d2('0x37')]=_0x57d2('0x5f');this[_0x57d2('0x60')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3b57fa;this[_0x57d2('0x61')]=_0x3e5d71;}function createVoicePrefixExtensions(_0x301e43,_0x4f6b8a,_0xad397){return new BPromise(function(_0x28fcdb,_0x15e3b6){var _0x472e5d=new Extension(formatPrefixName(_0x301e43['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x472e5d['VoicePrefixId']=_0x301e43['id'];return db[_0x57d2('0x56')][_0x57d2('0x54')](_0x472e5d,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0xa57b70){var _0xd13626=_0xa57b70[_0x57d2('0x2d')]({'plain':!![]});var _0x2737ab=_['map'](addVoicePrefixExtensions(_0x301e43,_0x4f6b8a),function(_0x35808a){_0x35808a['VoiceExtensionId']=_0xd13626['id'];_0x35808a[_0x57d2('0x62')]=_0x301e43['id'];return _0x35808a;});return db['VoiceExtension'][_0x57d2('0x63')](_0x2737ab,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0x453e6c){if(!_0x453e6c){return _0x15e3b6(_0x57d2('0x64'));}else{return _0x28fcdb(_0x453e6c);}})[_0x57d2('0x4e')](function(_0x145370){return _0x15e3b6(_0x145370);});});;});};function addVoicePrefixExtensions(_0x5e697c,_0x2a481c){var _0x24d3bf=[];var _0x27b27a=formatPrefixName(_0x5e697c[_0x57d2('0x65')]);_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x2,_0x57d2('0x67'),_0x57d2('0x68')+_0x5e697c[_0x57d2('0x32')]));if(_0x5e697c[_0x57d2('0x69')]){_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x67'),'PREFIX-CALLERIDALL='+_0x5e697c['callerIdAll']));}else{_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x6a'),'No\x20callerid\x20available'));}_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x4,_0x57d2('0x6b'),_0x2a481c['context']+','+_0x57d2('0x6c')+(0x8+_0x5e697c[_0x57d2('0x32')][_0x57d2('0x3f')])+'}'+','+0x1));return _0x24d3bf;}function formatPrefixName(_0x13741f){var _0x5eb7a3='_';for(var _0x3afeb9=0x0;_0x3afeb9<_0x13741f[_0x57d2('0x3f')];_0x3afeb9++){if(_0x13741f['charAt'](_0x3afeb9)=='-'){_0x5eb7a3+=_0x13741f['charAt'](_0x3afeb9);}else{_0x5eb7a3+='['+_0x13741f[_0x57d2('0x6d')](_0x3afeb9)+']';}}_0x5eb7a3+='.';return _0x5eb7a3;}exports[_0x57d2('0x2a')]=function(_0x481c6b,_0x46c7de,_0x5a1283){var _0x360ee0=_0x481c6b[_0x57d2('0x55')];_0x360ee0[_0x57d2('0x65')]=_0x57d2('0x6e')+_0x360ee0[_0x57d2('0x32')]+'-';return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x3bec6f){return db[_0x57d2('0x4b')][_0x57d2('0x2a')](_0x360ee0,{'where':{'id':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db['VoiceExtension'][_0x57d2('0x2c')]({'where':{'VoicePrefixId':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x360ee0[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x42666b){return createVoicePrefixExtensions(_0x360ee0,_0x42666b,_0x3bec6f);});});});})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x4b')][_0x57d2('0x70')](_0x360ee0['id']);})[_0x57d2('0x2b')](respondWithResult(_0x46c7de,null))[_0x57d2('0x4e')](handleError(_0x46c7de,null));};exports[_0x57d2('0x71')]=function(_0x26da1b,_0x1bf74a,_0x144229){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x26da1b[_0x57d2('0x72')]['id']}})['then'](handleEntityNotFound(_0x1bf74a,null))[_0x57d2('0x2b')](function(_0x17b3c1){if(_0x17b3c1){return _0x17b3c1[_0x57d2('0x71')](_0x26da1b[_0x57d2('0x55')]['ids'],_[_0x57d2('0x73')](_0x26da1b['body'],['ids','id'])||{})[_0x57d2('0x74')](function(_0x4f30e8){for(var _0x282457=0x0;_0x282457<_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x57d2('0x3f')];_0x282457+=0x1){socket['emit'](_0x57d2('0x76'),{'UserId':Number(_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x282457]),'VoicePrefixId':Number(_0x26da1b[_0x57d2('0x72')]['id'])});}return _0x4f30e8;});}})[_0x57d2('0x2b')](respondWithResult(_0x1bf74a,null))[_0x57d2('0x4e')](handleError(_0x1bf74a,null));};exports[_0x57d2('0x77')]=function(_0x41ca89,_0x1d147f,_0x261850){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x41ca89[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x1d147f,null))[_0x57d2('0x2b')](function(_0x468990){if(_0x468990){return _0x468990[_0x57d2('0x77')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])[_0x57d2('0x2b')](function(){if(_[_0x57d2('0x78')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])){for(var _0x54edaf=0x0;_0x54edaf<_0x41ca89['query'][_0x57d2('0x75')][_0x57d2('0x3f')];_0x54edaf+=0x1){socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')]['ids'][_0x54edaf]),'VoicePrefixId':Number(_0x41ca89['params']['id'])});}}else{socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')]),'VoicePrefixId':Number(_0x41ca89[_0x57d2('0x72')]['id'])});}});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x1d147f,null))['catch'](handleError(_0x1d147f,null));};exports[_0x57d2('0x7b')]=function(_0x2f5625,_0x5bb7cd,_0x4913c0){var _0x5ac6ee={};var _0x5b3cc6={};var _0xa557d6;var _0x4a7e00;return db[_0x57d2('0x4b')]['findOne']({'where':{'id':_0x2f5625[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x5bb7cd,null))[_0x57d2('0x2b')](function(_0x1dbe31){if(_0x1dbe31){_0xa557d6=_0x1dbe31;_0x5b3cc6[_0x57d2('0x3d')]=_['keys'](db[_0x57d2('0x7c')][_0x57d2('0x36')]);_0x5b3cc6[_0x57d2('0x39')]=_['keys'](_0x2f5625[_0x57d2('0x39')]);_0x5b3cc6[_0x57d2('0x45')]=_[_0x57d2('0x3c')](_0x5b3cc6[_0x57d2('0x3d')],_0x5b3cc6[_0x57d2('0x39')]);_0x5ac6ee[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x5b3cc6['model'],qs['fields'](_0x2f5625['query'][_0x57d2('0x3e')]));_0x5ac6ee[_0x57d2('0x3b')]=_0x5ac6ee[_0x57d2('0x3b')]['length']?_0x5ac6ee[_0x57d2('0x3b')]:_0x5b3cc6[_0x57d2('0x3d')];_0x5ac6ee[_0x57d2('0x42')]=qs[_0x57d2('0x43')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x43')]);_0x5ac6ee[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_['pick'](_0x2f5625[_0x57d2('0x39')],_0x5b3cc6[_0x57d2('0x45')]));if(_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]){_0x5ac6ee['where']=_['merge'](_0x5ac6ee[_0x57d2('0x44')],{'$or':_['map'](_0x5ac6ee[_0x57d2('0x3b')],function(_0x598d62){var _0x3a35d7={};_0x3a35d7[_0x598d62]={'$like':'%'+_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x3a35d7;})});}_0x5ac6ee=_['merge']({},_0x5ac6ee,_0x2f5625[_0x57d2('0x4a')]);return _0xa557d6['getAgents'](_0x5ac6ee);}})[_0x57d2('0x2b')](function(_0xe71357){if(_0xe71357){_0x4a7e00=_0xe71357[_0x57d2('0x3f')];if(!_0x2f5625[_0x57d2('0x39')][_0x57d2('0x40')](_0x57d2('0x41'))){_0x5ac6ee[_0x57d2('0x20')]=qs[_0x57d2('0x20')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x20')]);_0x5ac6ee[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x23')]);}return _0xa557d6[_0x57d2('0x7b')](_0x5ac6ee);}})['then'](function(_0x3a7d89){if(_0x3a7d89){return _0x3a7d89?{'count':_0x4a7e00,'rows':_0x3a7d89}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x5bb7cd,null))[_0x57d2('0x4e')](handleError(_0x5bb7cd,null));};exports[_0x57d2('0x7d')]=function(_0x4d83cf,_0x93bc52,_0x362b77){var _0x2728ba={};var _0x4f6585={};var _0x34f39a;var _0x1a90cb;return db[_0x57d2('0x4b')][_0x57d2('0x7e')]({'where':{'id':_0x4d83cf[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x93bc52,null))[_0x57d2('0x2b')](function(_0x1ba236){if(_0x1ba236){_0x34f39a=_0x1ba236;_0x4f6585[_0x57d2('0x3d')]=_[_0x57d2('0x3a')](db['Team']['rawAttributes']);_0x4f6585[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x4d83cf[_0x57d2('0x39')]);_0x4f6585[_0x57d2('0x45')]=_['intersection'](_0x4f6585[_0x57d2('0x3d')],_0x4f6585[_0x57d2('0x39')]);_0x2728ba[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x4f6585[_0x57d2('0x3d')],qs['fields'](_0x4d83cf['query']['fields']));_0x2728ba['attributes']=_0x2728ba['attributes'][_0x57d2('0x3f')]?_0x2728ba['attributes']:_0x4f6585[_0x57d2('0x3d')];_0x2728ba[_0x57d2('0x42')]=qs['sort'](_0x4d83cf[_0x57d2('0x39')]['sort']);_0x2728ba[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x4d83cf[_0x57d2('0x39')],_0x4f6585['filters']));if(_0x4d83cf[_0x57d2('0x39')]['filter']){_0x2728ba['where']=_[_0x57d2('0x47')](_0x2728ba[_0x57d2('0x44')],{'$or':_[_0x57d2('0x35')](_0x2728ba[_0x57d2('0x3b')],function(_0x127224){var _0x47ee55={};_0x47ee55[_0x127224]={'$like':'%'+_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x47ee55;})});}_0x2728ba=_[_0x57d2('0x47')]({},_0x2728ba,_0x4d83cf[_0x57d2('0x4a')]);return _0x34f39a[_0x57d2('0x7d')](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x4773a4){if(_0x4773a4){_0x1a90cb=_0x4773a4[_0x57d2('0x3f')];if(!_0x4d83cf['query']['hasOwnProperty'](_0x57d2('0x41'))){_0x2728ba['limit']=qs[_0x57d2('0x20')](_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x20')]);_0x2728ba[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x4d83cf['query'][_0x57d2('0x23')]);}return _0x34f39a['getTeams'](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x888a75){if(_0x888a75){return _0x888a75?{'count':_0x1a90cb,'rows':_0x888a75}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x93bc52,null))[_0x57d2('0x4e')](handleError(_0x93bc52,null));};exports[_0x57d2('0x7f')]=function(_0x37608b,_0x5cb4b6,_0xa4b4fd){var _0x3c9d18=_0x37608b[_0x57d2('0x55')][_0x57d2('0x75')];var _0x55f7df;return db['Team']['findAll']({'where':{'id':_0x3c9d18},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id',_0x57d2('0x32'),_0x57d2('0x81'),'voicePause',_0x57d2('0x82')],'raw':!![]}]})[_0x57d2('0x2b')](function(_0x178706){if(_0x178706){_0x55f7df=_0x178706;var _0xa92185=_['flatMap'](_0x178706,function(_0x3865c7){var _0x1d9c66=_0x3865c7[_0x57d2('0x2d')]({'plain':!![]});return _0x1d9c66[_0x57d2('0x80')];});return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x37608b['params']['id']}})['then'](function(_0x5a4689){return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x488dcd){return _0x5a4689['addTeams'](_0x3c9d18,{'transaction':_0x488dcd})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0x55f7df,function(_0x23a448){return db['TeamVoicePrefix'][_0x57d2('0x84')]({'TeamId':_0x23a448['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},{'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0xa92185,function(_0xa269b5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0xa269b5['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){_0xa92185[_0x57d2('0x85')](function(_0x434389){socket['emit'](_0x57d2('0x76'),{'UserId':_0x434389['id'],'VoicePrefixId':_0x5a4689['id']});});});});});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x5cb4b6,null))['catch'](handleError(_0x5cb4b6,null));};exports[_0x57d2('0x86')]=function(_0x29b37c,_0x531b42,_0x120e28){return db[_0x57d2('0x87')][_0x57d2('0x4d')]({'where':{'id':_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')]},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x531b42,null))[_0x57d2('0x2b')](function(_0x2809c1){var _0x5444bf=_[_0x57d2('0x35')](_0x2809c1,'id');var _0x3da7ba=[];var _0x2fc3b5=[];var _0x41ba89=squel['select']();_0x41ba89[_0x57d2('0x88')]('tq.TeamId')[_0x57d2('0x89')](_0x57d2('0x8a'),'tq')[_0x57d2('0x8b')](_0x57d2('0x8c'),'ut',_0x57d2('0x8d'))[_0x57d2('0x44')](_0x57d2('0x8e'),_0x29b37c[_0x57d2('0x72')]['id']);for(var _0x112218=0x0;_0x112218<_0x2809c1[_0x57d2('0x3f')];_0x112218+=0x1){let _0x57314b=_0x2809c1[_0x112218];for(var _0x3acffd=0x0;_0x3acffd<_0x57314b[_0x57d2('0x80')]['length'];_0x3acffd+=0x1){let _0x447051=_0x57314b[_0x57d2('0x80')][_0x3acffd];var _0x511494=_0x41ba89[_0x57d2('0x8f')]();_0x511494[_0x57d2('0x44')](_0x57d2('0x90'),_0x447051['id']);_0x2fc3b5[_0x57d2('0x66')](db['sequelize'][_0x57d2('0x39')](_0x511494[_0x57d2('0x91')](),{'type':db['sequelize'][_0x57d2('0x92')][_0x57d2('0x93')]})[_0x57d2('0x2b')](function(_0x13aec4){if(_0x13aec4[_0x57d2('0x3f')]===0x1){return _0x447051['id'];}else{var _0x4e3497=_[_0x57d2('0x94')](_[_0x57d2('0x35')](_0x13aec4,'TeamId'),function(_0xb122b9){return _[_0x57d2('0x95')](_0x5444bf,_0xb122b9);});if(_0x4e3497){return _0x447051['id'];}}}));}}return BPromise[_0x57d2('0x96')](_0x2fc3b5)['then'](function(_0xdc5333){_0x3da7ba=_(_0x3da7ba)[_0x57d2('0x97')](_0xdc5333)['compact']()[_0x57d2('0x98')]();return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x29b37c[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](function(_0x456ed3){return db['sequelize'][_0x57d2('0x53')](function(_0x376cea){return _0x456ed3[_0x57d2('0x86')](_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')],{'transaction':_0x376cea})[_0x57d2('0x2b')](function(){if(!_[_0x57d2('0x99')](_0x3da7ba)){return _0x456ed3[_0x57d2('0x77')](_0x3da7ba,{'transaction':_0x376cea});}})[_0x57d2('0x2b')](function(){_0x3da7ba['forEach'](function(_0x5b7f18){socket[_0x57d2('0x79')]('userVoicePrefix:remove',{'UserId':_0x5b7f18,'VoicePrefixId':_0x456ed3['id']});});});});});});})[_0x57d2('0x2b')](respondWithStatusCode(_0x531b42,null))['catch'](handleError(_0x531b42,null));}; \ No newline at end of file +var _0xb03e=['from','team_has_voice_prefixes','join','user_has_teams','clone','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','keys','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId'];(function(_0x1f31e3,_0x3194cd){var _0x349e6c=function(_0x4e2349){while(--_0x4e2349){_0x1f31e3['push'](_0x1f31e3['shift']());}};_0x349e6c(++_0x3194cd);}(_0xb03e,0x1eb));var _0xeb03=function(_0x182740,_0x9f82a1){_0x182740=_0x182740-0x0;var _0x27463f=_0xb03e[_0x182740];return _0x27463f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];config[_0xeb03('0x1b')]=_[_0xeb03('0x1c')](config[_0xeb03('0x1b')],{'host':_0xeb03('0x1d'),'port':0x18eb});var socket=require(_0xeb03('0x1e'))(new Redis(config[_0xeb03('0x1b')]));require('./voicePrefix.socket')[_0xeb03('0x1f')](socket);function respondWithStatusCode(_0x100bef,_0x372c71){_0x372c71=_0x372c71||0xcc;return function(_0x33f9ba){if(_0x33f9ba){return _0x100bef['sendStatus'](_0x372c71);}return _0x100bef[_0xeb03('0x20')](_0x372c71)[_0xeb03('0x21')]();};}function respondWithResult(_0x3f26ef,_0x478989){_0x478989=_0x478989||0xc8;return function(_0x7ce874){if(_0x7ce874){return _0x3f26ef[_0xeb03('0x20')](_0x478989)[_0xeb03('0x22')](_0x7ce874);}};}function respondWithFilteredResult(_0x44716c,_0x42fa4e){return function(_0x1b4cbd){if(_0x1b4cbd){var _0x167a33=typeof _0x42fa4e[_0xeb03('0x23')]===_0xeb03('0x24')&&typeof _0x42fa4e[_0xeb03('0x25')]===_0xeb03('0x24');var _0x2c238d=_0x1b4cbd[_0xeb03('0x26')];var _0x19bddf=_0x167a33?0x0:_0x42fa4e['offset'];var _0x1bea3f=_0x167a33?_0x1b4cbd[_0xeb03('0x26')]:_0x42fa4e[_0xeb03('0x23')]+_0x42fa4e[_0xeb03('0x25')];var _0xe5a1c2;if(_0x1bea3f>=_0x2c238d){_0x1bea3f=_0x2c238d;_0xe5a1c2=0xc8;}else{_0xe5a1c2=0xce;}_0x44716c[_0xeb03('0x20')](_0xe5a1c2);return _0x44716c[_0xeb03('0x27')](_0xeb03('0x28'),_0x19bddf+'-'+_0x1bea3f+'/'+_0x2c238d)[_0xeb03('0x22')](_0x1b4cbd);}return null;};}function patchUpdates(_0x5a704b){return function(_0x712ac2){try{jsonpatch[_0xeb03('0x29')](_0x712ac2,_0x5a704b,!![]);}catch(_0x11ea85){return BPromise[_0xeb03('0x2a')](_0x11ea85);}return _0x712ac2[_0xeb03('0x2b')]();};}function saveUpdates(_0x5dcda3,_0x638353){return function(_0x406864){if(_0x406864){return _0x406864[_0xeb03('0x2c')](_0x5dcda3)[_0xeb03('0x2d')](function(_0x3f276a){return _0x3f276a;});}return null;};}function removeEntity(_0x119697,_0xb04f34){return function(_0x3f68f3){if(_0x3f68f3){return _0x3f68f3[_0xeb03('0x2e')]()['then'](function(){var _0x832372=_0x3f68f3[_0xeb03('0x2f')]({'plain':!![]});var _0x2683f9=_0xeb03('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x2683f9,'resourceId':_0x832372['id']}})[_0xeb03('0x2d')](function(){return _0x3f68f3;});})['then'](function(){_0x119697[_0xeb03('0x20')](0xcc)[_0xeb03('0x21')]();});}};}function handleEntityNotFound(_0x160a37,_0x5db8bb){return function(_0xd4c8ec){if(!_0xd4c8ec){_0x160a37['sendStatus'](0x194);}return _0xd4c8ec;};}function handleError(_0x5cb729,_0x49e316){_0x49e316=_0x49e316||0x1f4;return function(_0x538d19){logger[_0xeb03('0x31')](_0x538d19[_0xeb03('0x32')]);if(_0x538d19['name']){delete _0x538d19['name'];}_0x5cb729['status'](_0x49e316)['send'](_0x538d19);};}exports[_0xeb03('0x33')]=function(_0x3655c3,_0x32aff7){var _0x2d2ddd={},_0x19fa35={},_0x5234dc={'count':0x0,'rows':[]};var _0x13efc6=_['map'](db[_0xeb03('0x34')][_0xeb03('0x35')],function(_0x19ceae){return{'name':_0x19ceae[_0xeb03('0x36')],'type':_0x19ceae[_0xeb03('0x37')][_0xeb03('0x38')]};});_0x19fa35[_0xeb03('0x39')]=_[_0xeb03('0x3a')](_0x13efc6,'name');_0x19fa35[_0xeb03('0x3b')]=_['keys'](_0x3655c3[_0xeb03('0x3b')]);_0x19fa35[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x19fa35[_0xeb03('0x39')],_0x19fa35[_0xeb03('0x3b')]);_0x2d2ddd[_0xeb03('0x3e')]=_['intersection'](_0x19fa35[_0xeb03('0x39')],qs['fields'](_0x3655c3['query']['fields']));_0x2d2ddd[_0xeb03('0x3e')]=_0x2d2ddd[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x2d2ddd[_0xeb03('0x3e')]:_0x19fa35[_0xeb03('0x39')];if(!_0x3655c3['query'][_0xeb03('0x40')](_0xeb03('0x41'))){_0x2d2ddd[_0xeb03('0x25')]=qs['limit'](_0x3655c3['query'][_0xeb03('0x25')]);_0x2d2ddd[_0xeb03('0x23')]=qs[_0xeb03('0x23')](_0x3655c3['query'][_0xeb03('0x23')]);}_0x2d2ddd[_0xeb03('0x42')]=qs['sort'](_0x3655c3['query'][_0xeb03('0x43')]);_0x2d2ddd[_0xeb03('0x44')]=qs['filters'](_[_0xeb03('0x45')](_0x3655c3[_0xeb03('0x3b')],_0x19fa35[_0xeb03('0x3c')]),_0x13efc6);if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x2d2ddd[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x2d2ddd[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x13efc6,function(_0x286f48){if(_0x286f48[_0xeb03('0x37')]!==_0xeb03('0x48')){var _0x2a9348={};_0x2a9348[_0x286f48[_0xeb03('0x49')]]={'$like':'%'+_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x2a9348;}})});}_0x2d2ddd=_[_0xeb03('0x47')]({},_0x2d2ddd,_0x3655c3[_0xeb03('0x4a')]);var _0x35e53d={'where':_0x2d2ddd[_0xeb03('0x44')]};return db[_0xeb03('0x34')][_0xeb03('0x26')](_0x35e53d)[_0xeb03('0x2d')](function(_0x5bb7d9){_0x5234dc['count']=_0x5bb7d9;if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x4b')]){_0x2d2ddd[_0xeb03('0x4c')]=[{'all':!![]}];}return db[_0xeb03('0x34')][_0xeb03('0x4d')](_0x2d2ddd);})[_0xeb03('0x2d')](function(_0x103c78){_0x5234dc[_0xeb03('0x4e')]=_0x103c78;return _0x5234dc;})['then'](respondWithFilteredResult(_0x32aff7,_0x2d2ddd))[_0xeb03('0x4f')](handleError(_0x32aff7,null));};exports[_0xeb03('0x50')]=function(_0x275d4d,_0xe9dcb0){var _0x528c0f={'raw':![],'where':{'id':_0x275d4d['params']['id']}},_0x57f59e={};_0x57f59e[_0xeb03('0x39')]=_['keys'](db['VoicePrefix']['rawAttributes']);_0x57f59e[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x275d4d[_0xeb03('0x3b')]);_0x57f59e[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x57f59e[_0xeb03('0x39')],_0x57f59e['query']);_0x528c0f[_0xeb03('0x3e')]=_['intersection'](_0x57f59e['model'],qs[_0xeb03('0x52')](_0x275d4d[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x528c0f['attributes']=_0x528c0f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x528c0f[_0xeb03('0x3e')]:_0x57f59e[_0xeb03('0x39')];if(_0x275d4d[_0xeb03('0x3b')]['includeAll']){_0x528c0f[_0xeb03('0x4c')]=[{'all':!![]}];}_0x528c0f=_['merge']({},_0x528c0f,_0x275d4d[_0xeb03('0x4a')]);return db[_0xeb03('0x34')][_0xeb03('0x53')](_0x528c0f)[_0xeb03('0x2d')](handleEntityNotFound(_0xe9dcb0,null))[_0xeb03('0x2d')](respondWithResult(_0xe9dcb0,null))[_0xeb03('0x4f')](handleError(_0xe9dcb0,null));};exports[_0xeb03('0x2e')]=function(_0x292319,_0x38c993){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x292319[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x38c993,null))[_0xeb03('0x2d')](removeEntity(_0x38c993,null))[_0xeb03('0x4f')](handleError(_0x38c993,null));};exports[_0xeb03('0x55')]=function(_0xf5c1ab,_0x79b7c6){return db[_0xeb03('0x34')][_0xeb03('0x55')]()[_0xeb03('0x2d')](respondWithResult(_0x79b7c6,null))[_0xeb03('0x4f')](handleError(_0x79b7c6,null));};exports[_0xeb03('0x56')]=function(_0x365520,_0x509d79){var _0x17112e;return db[_0xeb03('0x57')][_0xeb03('0x58')](function(_0x5405b4){return db[_0xeb03('0x34')][_0xeb03('0x56')](_0x365520[_0xeb03('0x59')],{'transaction':_0x5405b4})[_0xeb03('0x2d')](function(_0x103da5){_0x17112e=_0x103da5[_0xeb03('0x2f')]({'plain':!![]});return db[_0xeb03('0x5a')][_0xeb03('0x53')]({'where':{'id':_0x17112e[_0xeb03('0x5b')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x46f52e){return createVoicePrefixExtensions(_0x17112e,_0x46f52e,_0x5405b4);});});})[_0xeb03('0x2d')](function(){var _0xf9beaf=_0x365520[_0xeb03('0x5c')]['get']({'plain':!![]});if(!_0xf9beaf)throw new Error(_0xeb03('0x5d'));if(_0xf9beaf[_0xeb03('0x5e')]===_0xeb03('0x5c')){var _0x259db7=_0x17112e;return db[_0xeb03('0x5f')][_0xeb03('0x53')]({'where':{'name':_0xeb03('0x30'),'userProfileId':_0xf9beaf[_0xeb03('0x60')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x23406a){if(_0x23406a&&_0x23406a['autoAssociation']===0x0){return db[_0xeb03('0x61')][_0xeb03('0x56')]({'name':_0x259db7[_0xeb03('0x49')],'resourceId':_0x259db7['id'],'type':_0x23406a[_0xeb03('0x49')],'sectionId':_0x23406a['id']},{})['then'](function(){return _0x17112e;});}else{return _0x17112e;}})[_0xeb03('0x4f')](function(_0x68e1b7){logger[_0xeb03('0x31')](_0xeb03('0x62'),_0x68e1b7);throw _0x68e1b7;});}return _0x17112e;})[_0xeb03('0x2d')](respondWithResult(_0x509d79,null))['catch'](handleError(_0x509d79,null));};function Extension(_0x43efc3,_0x10beeb,_0x28e488,_0x5e1361){this[_0xeb03('0x63')]=_0xeb03('0x64');this['exten']=_0x43efc3;this[_0xeb03('0x65')]=_0x28e488;this[_0xeb03('0x37')]=_0xeb03('0x66');this['description']=_0xeb03('0x67');this[_0xeb03('0x68')]=_0x10beeb;this['appdata']=_0x5e1361;}function createVoicePrefixExtensions(_0x3eb482,_0xfeb8e2,_0x1972fb){return new BPromise(function(_0x3ac2de,_0x3963a7){var _0x38618e=new Extension(formatPrefixName(_0x3eb482[_0xeb03('0x69')]),0x1,_0xeb03('0x6a'),'Voice\x20Prefix');_0x38618e[_0xeb03('0x6b')]=_0x3eb482['id'];return db['VoiceExtension'][_0xeb03('0x56')](_0x38618e,{'transaction':_0x1972fb})[_0xeb03('0x2d')](function(_0x3a9518){var _0x59d0c7=_0x3a9518[_0xeb03('0x2f')]({'plain':!![]});var _0x1508f6=_[_0xeb03('0x3a')](addVoicePrefixExtensions(_0x3eb482,_0xfeb8e2),function(_0x467a9d){_0x467a9d['VoiceExtensionId']=_0x59d0c7['id'];_0x467a9d[_0xeb03('0x6b')]=_0x3eb482['id'];return _0x467a9d;});return db[_0xeb03('0x5a')]['bulkCreate'](_0x1508f6,{'transaction':_0x1972fb})['then'](function(_0x583518){if(!_0x583518){return _0x3963a7(_0xeb03('0x6c'));}else{return _0x3ac2de(_0x583518);}})[_0xeb03('0x4f')](function(_0x9148a6){return _0x3963a7(_0x9148a6);});});;});};function addVoicePrefixExtensions(_0x16ad3a,_0x3da5f4){var _0x461777=[];var _0x443fc9=formatPrefixName(_0x16ad3a[_0xeb03('0x69')]);_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x2,'Set','CDR(prefix)='+_0x16ad3a[_0xeb03('0x49')]));if(_0x16ad3a[_0xeb03('0x6e')]){_0x461777['push'](new Extension(_0x443fc9,0x3,_0xeb03('0x6f'),_0xeb03('0x70')+_0x16ad3a[_0xeb03('0x6e')]));}else{_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x3,'NoOp','No\x20callerid\x20available'));}_0x461777[_0xeb03('0x6d')](new Extension(_0x443fc9,0x4,_0xeb03('0x71'),_0x3da5f4[_0xeb03('0x63')]+','+_0xeb03('0x72')+(0x8+_0x16ad3a[_0xeb03('0x49')][_0xeb03('0x3f')])+'}'+','+0x1));return _0x461777;}function formatPrefixName(_0x1a8057){var _0x2ee5c1='_';for(var _0x2e67a4=0x0;_0x2e67a4<_0x1a8057[_0xeb03('0x3f')];_0x2e67a4++){if(_0x1a8057[_0xeb03('0x73')](_0x2e67a4)=='-'){_0x2ee5c1+=_0x1a8057['charAt'](_0x2e67a4);}else{_0x2ee5c1+='['+_0x1a8057['charAt'](_0x2e67a4)+']';}}_0x2ee5c1+='.';return _0x2ee5c1;}exports[_0xeb03('0x2c')]=function(_0x4e52a4,_0x1099ff,_0x4cf4f1){var _0x30623a=_0x4e52a4['body'];_0x30623a[_0xeb03('0x69')]=_0xeb03('0x74')+_0x30623a['name']+'-';return db[_0xeb03('0x57')]['transaction'](function(_0x45f0aa){return db['VoicePrefix'][_0xeb03('0x2c')](_0x30623a,{'where':{'id':_0x30623a['id']},'transaction':_0x45f0aa})['then'](function(){return db['VoiceExtension'][_0xeb03('0x2e')]({'where':{'VoicePrefixId':_0x30623a['id']},'transaction':_0x45f0aa})[_0xeb03('0x2d')](function(){return db[_0xeb03('0x5a')][_0xeb03('0x53')]({'where':{'id':_0x30623a[_0xeb03('0x5b')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x39c15d){return createVoicePrefixExtensions(_0x30623a,_0x39c15d,_0x45f0aa);});});});})['then'](function(){return db[_0xeb03('0x34')][_0xeb03('0x75')](_0x30623a['id']);})[_0xeb03('0x2d')](respondWithResult(_0x1099ff,null))[_0xeb03('0x4f')](handleError(_0x1099ff,null));};exports[_0xeb03('0x76')]=function(_0x126a7f,_0x137a98,_0x4fff6e){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x126a7f[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x137a98,null))[_0xeb03('0x2d')](function(_0xcd7ab1){if(_0xcd7ab1){return _0xcd7ab1[_0xeb03('0x76')](_0x126a7f[_0xeb03('0x59')]['ids'],_[_0xeb03('0x77')](_0x126a7f[_0xeb03('0x59')],[_0xeb03('0x78'),'id'])||{})[_0xeb03('0x79')](function(_0x17c010){for(var _0x5ace77=0x0;_0x5ace77<_0x126a7f[_0xeb03('0x59')][_0xeb03('0x78')][_0xeb03('0x3f')];_0x5ace77+=0x1){socket[_0xeb03('0x7a')](_0xeb03('0x7b'),{'UserId':Number(_0x126a7f[_0xeb03('0x59')][_0xeb03('0x78')][_0x5ace77]),'VoicePrefixId':Number(_0x126a7f['params']['id'])});}return _0x17c010;});}})[_0xeb03('0x2d')](respondWithResult(_0x137a98,null))[_0xeb03('0x4f')](handleError(_0x137a98,null));};exports[_0xeb03('0x7c')]=function(_0x21dfab,_0x396329,_0x48dc21){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x21dfab[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x396329,null))[_0xeb03('0x2d')](function(_0x215759){if(_0x215759){return _0x215759[_0xeb03('0x7c')](_0x21dfab['query'][_0xeb03('0x78')])[_0xeb03('0x2d')](function(){if(_[_0xeb03('0x7d')](_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')])){for(var _0x388fbd=0x0;_0x388fbd<_0x21dfab['query'][_0xeb03('0x78')][_0xeb03('0x3f')];_0x388fbd+=0x1){socket[_0xeb03('0x7a')]('userVoicePrefix:remove',{'UserId':Number(_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')][_0x388fbd]),'VoicePrefixId':Number(_0x21dfab[_0xeb03('0x54')]['id'])});}}else{socket[_0xeb03('0x7a')](_0xeb03('0x7e'),{'UserId':Number(_0x21dfab[_0xeb03('0x3b')][_0xeb03('0x78')]),'VoicePrefixId':Number(_0x21dfab['params']['id'])});}});}})['then'](respondWithStatusCode(_0x396329,null))[_0xeb03('0x4f')](handleError(_0x396329,null));};exports[_0xeb03('0x7f')]=function(_0x3630a7,_0xe55200,_0x511e5a){var _0x8ba377={};var _0x42c477={};var _0x5b60a4;var _0x45fd83;return db[_0xeb03('0x34')][_0xeb03('0x80')]({'where':{'id':_0x3630a7[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0xe55200,null))[_0xeb03('0x2d')](function(_0x5ea593){if(_0x5ea593){_0x5b60a4=_0x5ea593;_0x42c477[_0xeb03('0x39')]=_[_0xeb03('0x51')](db[_0xeb03('0x81')][_0xeb03('0x35')]);_0x42c477[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x3630a7[_0xeb03('0x3b')]);_0x42c477[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x42c477[_0xeb03('0x39')],_0x42c477['query']);_0x8ba377[_0xeb03('0x3e')]=_[_0xeb03('0x3d')](_0x42c477['model'],qs[_0xeb03('0x52')](_0x3630a7[_0xeb03('0x3b')]['fields']));_0x8ba377[_0xeb03('0x3e')]=_0x8ba377[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x8ba377[_0xeb03('0x3e')]:_0x42c477[_0xeb03('0x39')];_0x8ba377['order']=qs['sort'](_0x3630a7['query'][_0xeb03('0x43')]);_0x8ba377['where']=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x3630a7[_0xeb03('0x3b')],_0x42c477[_0xeb03('0x3c')]));if(_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x8ba377[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x8ba377[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x8ba377[_0xeb03('0x3e')],function(_0x27a388){var _0x4ec45c={};_0x4ec45c[_0x27a388]={'$like':'%'+_0x3630a7['query'][_0xeb03('0x46')]+'%'};return _0x4ec45c;})});}_0x8ba377=_['merge']({},_0x8ba377,_0x3630a7['options']);return _0x5b60a4[_0xeb03('0x7f')](_0x8ba377);}})[_0xeb03('0x2d')](function(_0x502b25){if(_0x502b25){_0x45fd83=_0x502b25['length'];if(!_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x40')]('nolimit')){_0x8ba377[_0xeb03('0x25')]=qs[_0xeb03('0x25')](_0x3630a7[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x8ba377[_0xeb03('0x23')]=qs['offset'](_0x3630a7[_0xeb03('0x3b')]['offset']);}return _0x5b60a4['getAgents'](_0x8ba377);}})[_0xeb03('0x2d')](function(_0x2d12eb){if(_0x2d12eb){return _0x2d12eb?{'count':_0x45fd83,'rows':_0x2d12eb}:null;}})[_0xeb03('0x2d')](respondWithResult(_0xe55200,null))[_0xeb03('0x4f')](handleError(_0xe55200,null));};exports['getTeams']=function(_0x4b59f4,_0xf9f2d3,_0x847253){var _0x70343f={};var _0x2d6225={};var _0x388642;var _0x3dc483;return db[_0xeb03('0x34')][_0xeb03('0x80')]({'where':{'id':_0x4b59f4['params']['id']}})['then'](handleEntityNotFound(_0xf9f2d3,null))[_0xeb03('0x2d')](function(_0x5741d4){if(_0x5741d4){_0x388642=_0x5741d4;_0x2d6225[_0xeb03('0x39')]=_['keys'](db[_0xeb03('0x82')][_0xeb03('0x35')]);_0x2d6225[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x4b59f4[_0xeb03('0x3b')]);_0x2d6225[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x2d6225[_0xeb03('0x39')],_0x2d6225['query']);_0x70343f['attributes']=_[_0xeb03('0x3d')](_0x2d6225[_0xeb03('0x39')],qs[_0xeb03('0x52')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x70343f['attributes']=_0x70343f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x70343f['attributes']:_0x2d6225[_0xeb03('0x39')];_0x70343f[_0xeb03('0x42')]=qs[_0xeb03('0x43')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x43')]);_0x70343f[_0xeb03('0x44')]=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x4b59f4[_0xeb03('0x3b')],_0x2d6225[_0xeb03('0x3c')]));if(_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x70343f[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x70343f['where'],{'$or':_[_0xeb03('0x3a')](_0x70343f[_0xeb03('0x3e')],function(_0x4c6b85){var _0x1f3ee1={};_0x1f3ee1[_0x4c6b85]={'$like':'%'+_0x4b59f4['query'][_0xeb03('0x46')]+'%'};return _0x1f3ee1;})});}_0x70343f=_['merge']({},_0x70343f,_0x4b59f4[_0xeb03('0x4a')]);return _0x388642[_0xeb03('0x83')](_0x70343f);}})[_0xeb03('0x2d')](function(_0x1df994){if(_0x1df994){_0x3dc483=_0x1df994[_0xeb03('0x3f')];if(!_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x40')](_0xeb03('0x41'))){_0x70343f['limit']=qs[_0xeb03('0x25')](_0x4b59f4[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x70343f[_0xeb03('0x23')]=qs['offset'](_0x4b59f4[_0xeb03('0x3b')]['offset']);}return _0x388642[_0xeb03('0x83')](_0x70343f);}})[_0xeb03('0x2d')](function(_0x423ddd){if(_0x423ddd){return _0x423ddd?{'count':_0x3dc483,'rows':_0x423ddd}:null;}})[_0xeb03('0x2d')](respondWithResult(_0xf9f2d3,null))['catch'](handleError(_0xf9f2d3,null));};exports[_0xeb03('0x84')]=function(_0x473d63,_0x1fc15a,_0x45f4d3){var _0x5095a6=_0x473d63[_0xeb03('0x59')]['ids'];var _0x4e0fd8;return db['Team'][_0xeb03('0x4d')]({'where':{'id':_0x5095a6},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb03('0x85'),'attributes':['id',_0xeb03('0x49'),_0xeb03('0x86'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x50b2c5){if(_0x50b2c5){_0x4e0fd8=_0x50b2c5;var _0x5c7f6e=_[_0xeb03('0x87')](_0x50b2c5,function(_0x392aaa){var _0x117c5e=_0x392aaa[_0xeb03('0x2f')]({'plain':!![]});return _0x117c5e[_0xeb03('0x85')];});return db[_0xeb03('0x34')]['find']({'where':{'id':_0x473d63[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](function(_0x2d8bca){return db[_0xeb03('0x57')]['transaction'](function(_0x5c49c9){return _0x2d8bca[_0xeb03('0x84')](_0x5095a6,{'transaction':_0x5c49c9})[_0xeb03('0x2d')](function(){return BPromise['each'](_0x4e0fd8,function(_0xc7a504){return db[_0xeb03('0x88')][_0xeb03('0x89')]({'TeamId':_0xc7a504['id'],'VoicePrefixId':_0x473d63[_0xeb03('0x54')]['id']},{'transaction':_0x5c49c9});});})[_0xeb03('0x2d')](function(){return BPromise[_0xeb03('0x8a')](_0x5c7f6e,function(_0x11cc99){return db['UserVoicePrefix'][_0xeb03('0x8b')]({'where':{'UserId':_0x11cc99['id'],'VoicePrefixId':_0x473d63[_0xeb03('0x54')]['id']},'transaction':_0x5c49c9});});})[_0xeb03('0x2d')](function(){_0x5c7f6e[_0xeb03('0x8c')](function(_0x1f2ebe){socket[_0xeb03('0x7a')](_0xeb03('0x7b'),{'UserId':_0x1f2ebe['id'],'VoicePrefixId':_0x2d8bca['id']});});});});});}})[_0xeb03('0x2d')](respondWithStatusCode(_0x1fc15a,null))['catch'](handleError(_0x1fc15a,null));};exports[_0xeb03('0x8d')]=function(_0x5e0e2b,_0x497a5b,_0x188d39){return db[_0xeb03('0x82')]['findAll']({'where':{'id':_0x5e0e2b[_0xeb03('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xeb03('0x81')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeb03('0x2d')](handleEntityNotFound(_0x497a5b,null))[_0xeb03('0x2d')](function(_0xd6f37b){var _0x1522d4=_[_0xeb03('0x3a')](_0xd6f37b,'id');var _0x47b648=[];var _0x15a726=[];var _0x226569=squel[_0xeb03('0x8e')]();_0x226569[_0xeb03('0x8f')](_0xeb03('0x90'))[_0xeb03('0x91')](_0xeb03('0x92'),'tq')[_0xeb03('0x93')](_0xeb03('0x94'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x5e0e2b[_0xeb03('0x54')]['id']);for(var _0x40a6ce=0x0;_0x40a6ce<_0xd6f37b[_0xeb03('0x3f')];_0x40a6ce+=0x1){let _0x2f640d=_0xd6f37b[_0x40a6ce];for(var _0x546ebe=0x0;_0x546ebe<_0x2f640d['Agents']['length'];_0x546ebe+=0x1){let _0x3d861f=_0x2f640d[_0xeb03('0x85')][_0x546ebe];var _0x2c89c4=_0x226569[_0xeb03('0x95')]();_0x2c89c4[_0xeb03('0x44')]('ut.UserId\x20=\x20?',_0x3d861f['id']);_0x15a726[_0xeb03('0x6d')](db[_0xeb03('0x57')]['query'](_0x2c89c4[_0xeb03('0x96')](),{'type':db['sequelize']['QueryTypes'][_0xeb03('0x97')]})[_0xeb03('0x2d')](function(_0x123742){if(_0x123742['length']===0x1){return _0x3d861f['id'];}else{var _0x243689=_[_0xeb03('0x98')](_['map'](_0x123742,_0xeb03('0x99')),function(_0x5eb15a){return _['includes'](_0x1522d4,_0x5eb15a);});if(_0x243689){return _0x3d861f['id'];}}}));}}return BPromise[_0xeb03('0x9a')](_0x15a726)[_0xeb03('0x2d')](function(_0x366054){_0x47b648=_(_0x47b648)[_0xeb03('0x9b')](_0x366054)[_0xeb03('0x9c')]()[_0xeb03('0x9d')]();return db['VoicePrefix'][_0xeb03('0x53')]({'where':{'id':_0x5e0e2b[_0xeb03('0x54')]['id']}})[_0xeb03('0x2d')](function(_0x1f0387){return db[_0xeb03('0x57')][_0xeb03('0x58')](function(_0xf0d912){return _0x1f0387[_0xeb03('0x8d')](_0x5e0e2b[_0xeb03('0x3b')][_0xeb03('0x78')],{'transaction':_0xf0d912})[_0xeb03('0x2d')](function(){if(!_[_0xeb03('0x9e')](_0x47b648)){return _0x1f0387[_0xeb03('0x7c')](_0x47b648,{'transaction':_0xf0d912});}})[_0xeb03('0x2d')](function(){_0x47b648[_0xeb03('0x8c')](function(_0x1a0bb5){socket[_0xeb03('0x7a')](_0xeb03('0x7e'),{'UserId':_0x1a0bb5,'VoicePrefixId':_0x1f0387['id']});});});});});});})[_0xeb03('0x2d')](respondWithStatusCode(_0x497a5b,null))[_0xeb03('0x4f')](handleError(_0x497a5b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 10a7af0..1981aaf 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 _0x3732=['../../mysqldb','VoicePrefix','save','remove','emit','hook','exports','events'];(function(_0x297a9c,_0x2c5459){var _0x376fd2=function(_0x856370){while(--_0x856370){_0x297a9c['push'](_0x297a9c['shift']());}};_0x376fd2(++_0x2c5459);}(_0x3732,0x19f));var _0x2373=function(_0x550580,_0x2797db){_0x550580=_0x550580-0x0;var _0x21b5dd=_0x3732[_0x550580];return _0x21b5dd;};'use strict';var EventEmitter=require(_0x2373('0x0'));var VoicePrefix=require(_0x2373('0x1'))['db'][_0x2373('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2373('0x3'),'afterUpdate':'update','afterDestroy':_0x2373('0x4')};function emitEvent(_0x5da03c){return function(_0x14c3e3,_0x9f992e,_0x5c7792){VoicePrefixEvents['emit'](_0x5da03c+':'+_0x14c3e3['id'],_0x14c3e3);VoicePrefixEvents[_0x2373('0x5')](_0x5da03c,_0x14c3e3);_0x5c7792(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2373('0x6')](e,emitEvent(event));}}module[_0x2373('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x8108=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix'];(function(_0x2ada99,_0x4ea2aa){var _0x5447e5=function(_0x1d25eb){while(--_0x1d25eb){_0x2ada99['push'](_0x2ada99['shift']());}};_0x5447e5(++_0x4ea2aa);}(_0x8108,0xe3));var _0x8810=function(_0x137c34,_0x2ebd98){_0x137c34=_0x137c34-0x0;var _0x145d9b=_0x8108[_0x137c34];return _0x145d9b;};'use strict';var EventEmitter=require(_0x8810('0x0'));var VoicePrefix=require(_0x8810('0x1'))['db'][_0x8810('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8810('0x3')](0x0);var events={'afterCreate':_0x8810('0x4'),'afterUpdate':_0x8810('0x5'),'afterDestroy':'remove'};function emitEvent(_0x13a882){return function(_0x3d5d82,_0x730871,_0x37cdfb){VoicePrefixEvents[_0x8810('0x6')](_0x13a882+':'+_0x3d5d82['id'],_0x3d5d82);VoicePrefixEvents[_0x8810('0x6')](_0x13a882,_0x3d5d82);_0x37cdfb(null);};}for(var e in events){if(events[_0x8810('0x7')](e)){var event=events[e];VoicePrefix[_0x8810('0x8')](e,emitEvent(event));}}module[_0x8810('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 0bc9009..ee02651 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 _0x39fe=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x39fe,0x168));var _0xe39f=function(_0x3b85ec,_0x512f8a){_0x3b85ec=_0x3b85ec-0x0;var _0x38574e=_0x39fe[_0x3b85ec];return _0x38574e;};'use strict';var _=require(_0xe39f('0x0'));var util=require(_0xe39f('0x1'));var logger=require(_0xe39f('0x2'))(_0xe39f('0x3'));var moment=require(_0xe39f('0x4'));var BPromise=require(_0xe39f('0x5'));var rp=require(_0xe39f('0x6'));var fs=require('fs');var path=require(_0xe39f('0x7'));var rimraf=require(_0xe39f('0x8'));var config=require(_0xe39f('0x9'));var attributes=require(_0xe39f('0xa'));module[_0xe39f('0xb')]=function(_0x5062c4,_0x28b340){return _0x5062c4[_0xe39f('0xc')](_0xe39f('0xd'),attributes,{'tableName':_0xe39f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7654=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','VoicePrefix','voice_prefixes','util'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x7654,0x133));var _0x4765=function(_0x5103ba,_0x11e48a){_0x5103ba=_0x5103ba-0x0;var _0x2bd28a=_0x7654[_0x5103ba];return _0x2bd28a;};'use strict';var _=require('lodash');var util=require(_0x4765('0x0'));var logger=require(_0x4765('0x1'))(_0x4765('0x2'));var moment=require(_0x4765('0x3'));var BPromise=require(_0x4765('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4765('0x5'));var rimraf=require(_0x4765('0x6'));var config=require(_0x4765('0x7'));var attributes=require(_0x4765('0x8'));module['exports']=function(_0x5e7fa0,_0x1876fb){return _0x5e7fa0['define'](_0x4765('0x9'),attributes,{'tableName':_0x4765('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 3dec866..13a215f 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 _0xd43e=['request','then','request\x20sent','debug','stringify','error','code','message','info','VoicePrefix,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./voicePrefix.socket','register'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd43e,0x88));var _0xed43=function(_0x497326,_0x3d0598){_0x497326=_0x497326-0x0;var _0x1c6553=_0xd43e[_0x497326];return _0x1c6553;};'use strict';var _=require(_0xed43('0x0'));var util=require('util');var moment=require(_0xed43('0x1'));var BPromise=require(_0xed43('0x2'));var rs=require(_0xed43('0x3'));var fs=require('fs');var Redis=require(_0xed43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed43('0x5'))(_0xed43('0x6'));var config=require(_0xed43('0x7'));var jayson=require(_0xed43('0x8'));var client=jayson['client'][_0xed43('0x9')]({'port':0x232a});config[_0xed43('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xed43('0xb'))(new Redis(config[_0xed43('0xa')]));require(_0xed43('0xc'))[_0xed43('0xd')](socket);function respondWithRpcPromise(_0x3cad15,_0x5dbd4b,_0x2d698a){return new BPromise(function(_0x428fb2,_0x4dd64f){return client[_0xed43('0xe')](_0x3cad15,_0x2d698a)[_0xed43('0xf')](function(_0xb026ab){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x5dbd4b,_0xed43('0x10'));logger[_0xed43('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5dbd4b,_0xed43('0x10'),JSON[_0xed43('0x12')](_0xb026ab));if(_0xb026ab[_0xed43('0x13')]){if(_0xb026ab[_0xed43('0x13')][_0xed43('0x14')]===0x1f4){logger[_0xed43('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x5dbd4b,_0xb026ab[_0xed43('0x13')]['message']);return _0x4dd64f(_0xb026ab[_0xed43('0x13')]['message']);}logger[_0xed43('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x5dbd4b,_0xb026ab['error'][_0xed43('0x15')]);return _0x428fb2(_0xb026ab['error'][_0xed43('0x15')]);}else{logger[_0xed43('0x16')](_0xed43('0x17'),_0x5dbd4b,'request\x20sent');_0x428fb2(_0xb026ab[_0xed43('0x18')][_0xed43('0x15')]);}})['catch'](function(_0x594458){logger[_0xed43('0x13')](_0xed43('0x17'),_0x5dbd4b,_0x594458);_0x4dd64f(_0x594458);});});} \ No newline at end of file +var _0xb2ad=['socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x1b2ff2,_0x5522aa){var _0x4a1fd4=function(_0x5772bb){while(--_0x5772bb){_0x1b2ff2['push'](_0x1b2ff2['shift']());}};_0x4a1fd4(++_0x5522aa);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x1d03a1,_0x56a15f){_0x1d03a1=_0x1d03a1-0x0;var _0x5c2a0c=_0xb2ad[_0x1d03a1];return _0x5c2a0c;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var moment=require('moment');var BPromise=require(_0xdb2a('0x1'));var rs=require(_0xdb2a('0x2'));var fs=require('fs');var Redis=require(_0xdb2a('0x3'));var db=require(_0xdb2a('0x4'))['db'];var utils=require(_0xdb2a('0x5'));var logger=require('../../config/logger')(_0xdb2a('0x6'));var config=require(_0xdb2a('0x7'));var jayson=require(_0xdb2a('0x8'));var client=jayson[_0xdb2a('0x9')][_0xdb2a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdb2a('0xb')],{'host':_0xdb2a('0xc'),'port':0x18eb});var socket=require(_0xdb2a('0xd'))(new Redis(config['redis']));require(_0xdb2a('0xe'))[_0xdb2a('0xf')](socket);function respondWithRpcPromise(_0x5d2a87,_0x3b1bbe,_0x39f48e){return new BPromise(function(_0x4bdf25,_0x591114){return client[_0xdb2a('0x10')](_0x5d2a87,_0x39f48e)[_0xdb2a('0x11')](function(_0x134425){logger['info'](_0xdb2a('0x12'),_0x3b1bbe,_0xdb2a('0x13'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3b1bbe,'request\x20sent',JSON[_0xdb2a('0x14')](_0x134425));if(_0x134425['error']){if(_0x134425[_0xdb2a('0x15')][_0xdb2a('0x16')]===0x1f4){logger['error'](_0xdb2a('0x12'),_0x3b1bbe,_0x134425['error']['message']);return _0x591114(_0x134425['error']['message']);}logger[_0xdb2a('0x15')](_0xdb2a('0x12'),_0x3b1bbe,_0x134425['error']['message']);return _0x4bdf25(_0x134425[_0xdb2a('0x15')][_0xdb2a('0x17')]);}else{logger[_0xdb2a('0x18')](_0xdb2a('0x12'),_0x3b1bbe,'request\x20sent');_0x4bdf25(_0x134425[_0xdb2a('0x19')][_0xdb2a('0x17')]);}})[_0xdb2a('0x1a')](function(_0x584981){logger['error'](_0xdb2a('0x12'),_0x3b1bbe,_0x584981);_0x591114(_0x584981);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 3543476..a33b03f 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 _0xcb18=['remove','emit','removeListener','register','voicePrefix:'];(function(_0x585886,_0x36611c){var _0x341624=function(_0x23008b){while(--_0x23008b){_0x585886['push'](_0x585886['shift']());}};_0x341624(++_0x36611c);}(_0xcb18,0x159));var _0x8cb1=function(_0x45c9ae,_0x4de6be){_0x45c9ae=_0x45c9ae-0x0;var _0x16a8eb=_0xcb18[_0x45c9ae];return _0x16a8eb;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x8cb1('0x0'),'update'];function createListener(_0x3df352,_0x50513d){return function(_0x5e800d){_0x50513d[_0x8cb1('0x1')](_0x3df352,_0x5e800d);};}function removeListener(_0x87b1d3,_0x15d761){return function(){VoicePrefixEvents[_0x8cb1('0x2')](_0x87b1d3,_0x15d761);};}exports[_0x8cb1('0x3')]=function(_0x503927){for(var _0x355d91=0x0,_0x335e41=events['length'];_0x355d91<_0x335e41;_0x355d91++){var _0x186f71=events[_0x355d91];var _0x510e92=createListener(_0x8cb1('0x4')+_0x186f71,_0x503927);VoicePrefixEvents['on'](_0x186f71,_0x510e92);}}; \ No newline at end of file +var _0x9990=['update','emit','removeListener','register','length','voicePrefix:','save','remove'];(function(_0x51b42e,_0x8dea09){var _0x43ed23=function(_0x2de749){while(--_0x2de749){_0x51b42e['push'](_0x51b42e['shift']());}};_0x43ed23(++_0x8dea09);}(_0x9990,0xf6));var _0x0999=function(_0x5575c1,_0x11b31a){_0x5575c1=_0x5575c1-0x0;var _0x50ea4e=_0x9990[_0x5575c1];return _0x50ea4e;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x0999('0x0'),_0x0999('0x1'),_0x0999('0x2')];function createListener(_0x46a009,_0x33d7a5){return function(_0x43f491){_0x33d7a5[_0x0999('0x3')](_0x46a009,_0x43f491);};}function removeListener(_0x2754ce,_0x4e13c1){return function(){VoicePrefixEvents[_0x0999('0x4')](_0x2754ce,_0x4e13c1);};}exports[_0x0999('0x5')]=function(_0x45d3e0){for(var _0x4c606f=0x0,_0x1a6f23=events[_0x0999('0x6')];_0x4c606f<_0x1a6f23;_0x4c606f++){var _0x3fe805=events[_0x4c606f];var _0x304f75=createListener(_0x0999('0x7')+_0x3fe805,_0x45d3e0);VoicePrefixEvents['on'](_0x3fe805,_0x304f75);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bef9bf2..9dd9440 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 _0x684c=['/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x275850,_0x11cf6c){var _0x10d32e=function(_0x5097db){while(--_0x5097db){_0x275850['push'](_0x275850['shift']());}};_0x10d32e(++_0x11cf6c);}(_0x684c,0x6f));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var path=require(_0xc684('0x2'));var timeout=require(_0xc684('0x3'));var express=require(_0xc684('0x4'));var router=express[_0xc684('0x5')]();var fs_extra=require(_0xc684('0x6'));var auth=require(_0xc684('0x7'));var interaction=require(_0xc684('0x8'));var config=require('../../config/environment');var controller=require(_0xc684('0x9'));router[_0xc684('0xa')]('/',auth[_0xc684('0xb')](),controller[_0xc684('0xc')]);router[_0xc684('0xa')]('/:id',auth[_0xc684('0xb')](),controller[_0xc684('0xd')]);router[_0xc684('0xa')]('/:id/hoppers',auth[_0xc684('0xb')](),controller[_0xc684('0xe')]);router[_0xc684('0xa')](_0xc684('0xf'),auth['isAuthenticated'](),controller[_0xc684('0x10')]);router[_0xc684('0xa')](_0xc684('0x11'),auth[_0xc684('0xb')](),controller[_0xc684('0x12')]);router['get'](_0xc684('0x13'),auth['isAuthenticated'](),controller[_0xc684('0x14')]);router[_0xc684('0xa')](_0xc684('0x15'),auth['isAuthenticated'](),controller[_0xc684('0x16')]);router[_0xc684('0xa')](_0xc684('0x17'),auth[_0xc684('0xb')](),controller[_0xc684('0x18')]);router[_0xc684('0xa')](_0xc684('0x19'),auth[_0xc684('0xb')](),controller[_0xc684('0x1a')]);router['get'](_0xc684('0x1b'),auth['isAuthenticated'](),controller[_0xc684('0x1c')]);router[_0xc684('0xa')](_0xc684('0x1d'),auth[_0xc684('0xb')](),controller[_0xc684('0x1e')]);router[_0xc684('0x1f')]('/',auth['isAuthenticated'](),controller[_0xc684('0x20')]);router['post'](_0xc684('0x21'),auth[_0xc684('0xb')](),controller[_0xc684('0x22')]);router[_0xc684('0x1f')](_0xc684('0x15'),auth[_0xc684('0xb')](),controller[_0xc684('0x23')]);router[_0xc684('0x1f')](_0xc684('0x17'),auth[_0xc684('0xb')](),controller[_0xc684('0x24')]);router[_0xc684('0x1f')](_0xc684('0x1b'),auth[_0xc684('0xb')](),controller[_0xc684('0x25')]);router['post'](_0xc684('0x1d'),auth[_0xc684('0xb')](),controller[_0xc684('0x26')]);router['put'](_0xc684('0x27'),auth['isAuthenticated'](),controller[_0xc684('0x28')]);router[_0xc684('0x29')](_0xc684('0x27'),auth[_0xc684('0xb')](),controller[_0xc684('0x2a')]);router['delete'](_0xc684('0x15'),auth[_0xc684('0xb')](),controller[_0xc684('0x2b')]);router[_0xc684('0x29')](_0xc684('0x17'),auth[_0xc684('0xb')](),controller[_0xc684('0x2c')]);router[_0xc684('0x29')](_0xc684('0x1b'),auth[_0xc684('0xb')](),controller[_0xc684('0x2d')]);router['delete'](_0xc684('0x1d'),auth['isAuthenticated'](),controller[_0xc684('0x2e')]);module[_0xc684('0x2f')]=router; \ No newline at end of file +var _0x495f=['delete','removeTeams','/:id/users','removeLists','removeBlackLists','connect-timeout','fs-extra','isAuthenticated','index','get','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/teams','getAgents','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','destroy'];(function(_0x64fafc,_0x342746){var _0x2b8d07=function(_0x5cbd66){while(--_0x5cbd66){_0x64fafc['push'](_0x64fafc['shift']());}};_0x2b8d07(++_0x342746);}(_0x495f,0x11c));var _0xf495=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x495f[_0x363ef8];return _0x148822;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf495('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf495('0x1'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router['get']('/',auth[_0xf495('0x2')](),controller[_0xf495('0x3')]);router[_0xf495('0x4')](_0xf495('0x5'),auth[_0xf495('0x2')](),controller['show']);router[_0xf495('0x4')](_0xf495('0x6'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xf495('0x4')](_0xf495('0x7'),auth[_0xf495('0x2')](),controller[_0xf495('0x8')]);router[_0xf495('0x4')](_0xf495('0x9'),auth[_0xf495('0x2')](),controller[_0xf495('0xa')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xf495('0x4')](_0xf495('0xb'),auth[_0xf495('0x2')](),controller['getTeams']);router['get']('/:id/users',auth[_0xf495('0x2')](),controller[_0xf495('0xc')]);router[_0xf495('0x4')]('/:id/members',auth[_0xf495('0x2')](),controller['getMembers']);router['get'](_0xf495('0xd'),auth[_0xf495('0x2')](),controller[_0xf495('0xe')]);router[_0xf495('0x4')](_0xf495('0xf'),auth[_0xf495('0x2')](),controller[_0xf495('0x10')]);router[_0xf495('0x11')]('/',auth[_0xf495('0x2')](),controller[_0xf495('0x12')]);router['post'](_0xf495('0x13'),auth[_0xf495('0x2')](),controller['clone']);router[_0xf495('0x11')](_0xf495('0xb'),auth[_0xf495('0x2')](),controller[_0xf495('0x14')]);router[_0xf495('0x11')]('/:id/users',auth[_0xf495('0x2')](),controller[_0xf495('0x15')]);router[_0xf495('0x11')](_0xf495('0xd'),auth[_0xf495('0x2')](),controller[_0xf495('0x16')]);router['post'](_0xf495('0xf'),auth['isAuthenticated'](),controller[_0xf495('0x17')]);router[_0xf495('0x18')](_0xf495('0x5'),auth[_0xf495('0x2')](),controller['update']);router['delete']('/:id',auth[_0xf495('0x2')](),controller[_0xf495('0x19')]);router[_0xf495('0x1a')](_0xf495('0xb'),auth[_0xf495('0x2')](),controller[_0xf495('0x1b')]);router[_0xf495('0x1a')](_0xf495('0x1c'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xf495('0x1a')](_0xf495('0xd'),auth[_0xf495('0x2')](),controller[_0xf495('0x1d')]);router[_0xf495('0x1a')](_0xf495('0xf'),auth[_0xf495('0x2')](),controller[_0xf495('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e8a917e..0b3cf7d 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 _0x4812=['ASC','BOOLEAN','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC'];(function(_0xea27ad,_0x2364c1){var _0x23e858=function(_0x58b583){while(--_0x58b583){_0xea27ad['push'](_0xea27ad['shift']());}};_0x23e858(++_0x2364c1);}(_0x4812,0x10a));var _0x2481=function(_0x369e60,_0x13e87d){_0x369e60=_0x369e60-0x0;var _0x3f31f6=_0x4812[_0x369e60];return _0x3f31f6;};'use strict';var Sequelize=require(_0x2481('0x0'));module[_0x2481('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2481('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x4'),_0x2481('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x2481('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x2481('0x7'),_0x2481('0x8'),_0x2481('0x9'),_0x2481('0xa'),_0x2481('0xb'),_0x2481('0xc'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x2481('0x7'),'set':function(_0xd6b18b){this[_0x2481('0xd')](_0x2481('0xe'),_0xd6b18b?_0xd6b18b:_0x2481('0xb'));},'get':function(){var _0x5922e5=this[_0x2481('0xf')](_0x2481('0x10'));var _0x264fe5=this[_0x2481('0xf')](_0x2481('0x11'));var _0x256da9=this['getDataValue'](_0x2481('0xe'));if(_0x5922e5===_0x2481('0x4')){return _0x256da9;}if(_0x264fe5===_0x2481('0x12')&&_0x256da9===_0x2481('0xb')||_0x264fe5===_0x2481('0x12')&&_0x256da9===_0x2481('0x13')){return _0x256da9;}if(_0x264fe5===_0x2481('0x14')||_0x264fe5===_0x2481('0x15')||_0x264fe5==='power'){return _0x256da9;}return null;}},'servicelevel':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2481('0x16')](0xb)},'timeout':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x2481('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2481('0x3')]('yes','no'),'defaultValue':_0x2481('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no',_0x2481('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2481('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2481('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2481('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x2481('0x17'),'no'),'defaultValue':_0x2481('0x17')},'announce_holdtime':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x2481('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2481('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2481('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2481('0x6')]},'queue_youarenext':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2481('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2481('0x6')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x2481('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x2481('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x2481('0x19')],'set':function(_0xd87f0f){this['setDataValue'](_0x2481('0x1a'),_0xd87f0f?_0xd87f0f[_0x2481('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x2481('0x1a'))?this[_0x2481('0xf')](_0x2481('0x1a'))[_0x2481('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'yes','set':function(_0x1ab6f0){this[_0x2481('0xd')]('joinempty',_0x1ab6f0?_0x1ab6f0['join'](','):undefined);},'get':function(){return this[_0x2481('0xf')](_0x2481('0x1d'))?this[_0x2481('0xf')]('joinempty')[_0x2481('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2481('0x6')],'defaultValue':'no','set':function(_0x4375fe){this[_0x2481('0xd')]('leavewhenempty',_0x4375fe?_0x4375fe[_0x2481('0x1b')](','):undefined);},'get':function(){return this[_0x2481('0xf')](_0x2481('0x1e'))?this[_0x2481('0xf')](_0x2481('0x1e'))[_0x2481('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2481('0x6')]},'description':{'type':Sequelize[_0x2481('0x6')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x21b9f6){this[_0x2481('0xd')](_0x2481('0x1f'),_0x21b9f6);if(_0x21b9f6){if(this[_0x2481('0xf')](_0x2481('0x20'))<0x2){this[_0x2481('0xd')](_0x2481('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2481('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2481('0x21')},'dialMethod':{'type':Sequelize[_0x2481('0x3')](_0x2481('0x22'),_0x2481('0x14'),_0x2481('0x23'),'predictive',_0x2481('0x12')),'defaultValue':_0x2481('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x2481('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2481('0x24')},'dialLimitQueue':{'type':Sequelize[_0x2481('0x16')](0x4)[_0x2481('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2481('0x26')},'dialPowerLevel':{'type':Sequelize[_0x2481('0x27')](0x2)[_0x2481('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2481('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x2481('0x29'),'dropRate'),'defaultValue':_0x2481('0x2a'),'comment':_0x2481('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2481('0x27')](0x2)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2481('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x2481('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2481('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2481('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2481('0x2e'),'comment':_0x2481('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x30')},'dialQueueProject':{'type':Sequelize[_0x2481('0x6')],'comment':_0x2481('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'comment':_0x2481('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2481('0x36')},'dialTimezone':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2481('0x37')},'dialPrefix':{'type':Sequelize[_0x2481('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2481('0x3')]('always',_0x2481('0x38'),_0x2481('0x39')),'defaultValue':_0x2481('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2481('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x2481('0x16')](0x9)[_0x2481('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2481('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2481('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2481('0x16')](0x9)[_0x2481('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2481('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2481('0x16')](0x9)[_0x2481('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2481('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2481('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2481('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2481('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2481('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2481('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2481('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2481('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2481('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2481('0x45'),_0x2481('0x46')),'defaultValue':_0x2481('0x45')},'dialQueueProject2':{'type':Sequelize[_0x2481('0x6')],'comment':_0x2481('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2481('0x47')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2481('0x47')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2481('0x48')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2481('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2481('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2481('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2481('0x16')](0x5)[_0x2481('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2481('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2481('0x16')],'allowNull':!![],'comment':_0x2481('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x2481('0x47')],'defaultValue':![],'comment':_0x2481('0x51'),'set':function(_0x46df45){if(!_0x46df45)this[_0x2481('0xd')](_0x2481('0x52'),null);this[_0x2481('0xd')](_0x2481('0x53'),_0x46df45);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2481('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2481('0x16')](0x3)[_0x2481('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x5e0c=['#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','inbound','outbound','default','ringall','random','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','strategy','booked','roundrobin','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','predictive','Dial\x20Method.','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','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x254081,_0x133020){_0x254081=_0x254081-0x0;var _0x15e822=_0x5e0c[_0x254081];return _0x15e822;};'use strict';var Sequelize=require('sequelize');module[_0xc5e0('0x0')]={'name':{'type':Sequelize[_0xc5e0('0x1')],'allowNull':![],'unique':_0xc5e0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x4'),_0xc5e0('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':_0xc5e0('0x6')},'announce':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xc5e0('0x3')]('rr',_0xc5e0('0x7'),'leastrecent','fewestcalls',_0xc5e0('0x8'),'rrmemory',_0xc5e0('0x9'),_0xc5e0('0xa'),_0xc5e0('0xb')),'allowNull':![],'defaultValue':_0xc5e0('0x7'),'set':function(_0x5ce913){this[_0xc5e0('0xc')]('strategy',_0x5ce913?_0x5ce913:_0xc5e0('0xd'));},'get':function(){var _0x33d821=this[_0xc5e0('0xe')](_0xc5e0('0xf'));var _0x1f220b=this[_0xc5e0('0xe')]('dialMethod');var _0x43969b=this[_0xc5e0('0xe')](_0xc5e0('0x10'));if(_0x33d821===_0xc5e0('0x4')){return _0x43969b;}if(_0x1f220b===_0xc5e0('0x11')&&_0x43969b==='rrmemory'||_0x1f220b===_0xc5e0('0x11')&&_0x43969b===_0xc5e0('0x12')){return _0x43969b;}if(_0x1f220b==='progressive'||_0x1f220b==='predictive'||_0x1f220b===_0xc5e0('0x13')){return _0x43969b;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc5e0('0x14')](0xb)},'timeout':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc5e0('0x1')]},'weight':{'type':Sequelize[_0xc5e0('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x15'),'no'),'defaultValue':_0xc5e0('0x15')},'autopause':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x15'),'no',_0xc5e0('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc5e0('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xc5e0('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xc5e0('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xc5e0('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xc5e0('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc5e0('0x3')]('yes','no'),'defaultValue':_0xc5e0('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xc5e0('0x15'),'no',_0xc5e0('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xc5e0('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xc5e0('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc5e0('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xc5e0('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xc5e0('0x1')]},'queue_less_than':{'type':Sequelize[_0xc5e0('0x1')]},'periodic_announce':{'type':Sequelize[_0xc5e0('0x18')],'set':function(_0x168212){this['setDataValue'](_0xc5e0('0x19'),_0x168212?_0x168212[_0xc5e0('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0xc5e0('0x19'))?this[_0xc5e0('0xe')](_0xc5e0('0x19'))[_0xc5e0('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':_0xc5e0('0x15'),'set':function(_0x31a921){this[_0xc5e0('0xc')](_0xc5e0('0x1c'),_0x31a921?_0x31a921[_0xc5e0('0x1a')](','):undefined);},'get':function(){return this[_0xc5e0('0xe')](_0xc5e0('0x1c'))?this['getDataValue']('joinempty')[_0xc5e0('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x3e2ded){this[_0xc5e0('0xc')](_0xc5e0('0x1d'),_0x3e2ded?_0x3e2ded[_0xc5e0('0x1a')](','):undefined);},'get':function(){return this[_0xc5e0('0xe')](_0xc5e0('0x1d'))?this['getDataValue'](_0xc5e0('0x1d'))[_0xc5e0('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xc5e0('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc5e0('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc5e0('0x1')]},'description':{'type':Sequelize[_0xc5e0('0x1')]},'acw':{'type':Sequelize[_0xc5e0('0x1e')],'defaultValue':0x0,'set':function(_0x30127e){this[_0xc5e0('0xc')](_0xc5e0('0x1f'),_0x30127e);if(_0x30127e){if(this[_0xc5e0('0xe')](_0xc5e0('0x20'))<0x2){this[_0xc5e0('0xc')](_0xc5e0('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc5e0('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc5e0('0x1e')],'defaultValue':0x0,'comment':_0xc5e0('0x21')},'dialMethod':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x22'),_0xc5e0('0x23'),_0xc5e0('0x13'),_0xc5e0('0x24'),_0xc5e0('0x11')),'defaultValue':'progressive','comment':_0xc5e0('0x25')},'dialLimitChannel':{'type':Sequelize[_0xc5e0('0x14')](0x4)[_0xc5e0('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc5e0('0x27')},'dialLimitQueue':{'type':Sequelize[_0xc5e0('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc5e0('0x28')},'dialPowerLevel':{'type':Sequelize[_0xc5e0('0x29')](0x2)[_0xc5e0('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xc5e0('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x2b'),'dropRate'),'defaultValue':_0xc5e0('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc5e0('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc5e0('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xc5e0('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc5e0('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc5e0('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e0('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':_0xc5e0('0x2f'),'comment':_0xc5e0('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc5e0('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc5e0('0x14')](0x5)[_0xc5e0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc5e0('0x14')](0x5)[_0xc5e0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc5e0('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc5e0('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc5e0('0x36')},'dialPrefix':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x37'),_0xc5e0('0x38'),_0xc5e0('0x39')),'defaultValue':_0xc5e0('0x37')},'dialAMDActive':{'type':Sequelize[_0xc5e0('0x1e')],'defaultValue':0x0,'comment':_0xc5e0('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5e0('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc5e0('0x14')](0x9)[_0xc5e0('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc5e0('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5e0('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc5e0('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc5e0('0x14')](0x9)[_0xc5e0('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc5e0('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xc5e0('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc5e0('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc5e0('0x14')](0x9)[_0xc5e0('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc5e0('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc5e0('0x14')](0x9)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc5e0('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc5e0('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc5e0('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xc5e0('0x14')](0x5)[_0xc5e0('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc5e0('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc5e0('0x3')](_0xc5e0('0x42'),_0xc5e0('0x43')),'defaultValue':_0xc5e0('0x42')},'dialQueueProject2':{'type':Sequelize[_0xc5e0('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc5e0('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xc5e0('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc5e0('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5e0('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc5e0('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5e0('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e0('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc5e0('0x14')](0x5)[_0xc5e0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e0('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0xc5e0('0x14')](0x5)[_0xc5e0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e0('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e0('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5e0('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc5e0('0x14')](0x5)[_0xc5e0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5e0('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc5e0('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc5e0('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3be7b3){if(!_0x3be7b3)this[_0xc5e0('0xc')]('mandatoryDispositionPauseId',null);this[_0xc5e0('0xc')]('mandatoryDisposition',_0x3be7b3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc5e0('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xc5e0('0x14')](0x3)[_0xc5e0('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index dc4a788..117d6e3 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 _0x07e9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','find','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','updatedAt','createdAt','VoiceQueues','UserProfileSection','update','CmHopper','nolimit','VoiceQueueId','rows','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','isEmpty','removeAgents','userVoiceQueue:remove','spread','userVoiceQueue:save','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','ListId','phone','scheduledAt','toString','NOW()','from','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','name','UserProfileResource','stack','send','index','rawAttributes','key','query','keys','filters','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','VoiceQueue','include','findAll','show','params','intersection','create','body','user','get'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0x07e9,0x65));var _0x907e=function(_0x2663ac,_0x3521b5){_0x2663ac=_0x2663ac-0x0;var _0x353b70=_0x07e9[_0x2663ac];return _0x353b70;};'use strict';var emlformat=require(_0x907e('0x0'));var rimraf=require(_0x907e('0x1'));var zipdir=require(_0x907e('0x2'));var jsonpatch=require(_0x907e('0x3'));var rp=require('request-promise');var moment=require(_0x907e('0x4'));var BPromise=require(_0x907e('0x5'));var Mustache=require(_0x907e('0x6'));var util=require(_0x907e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x907e('0x8'));var fs=require('fs');var fs_extra=require(_0x907e('0x9'));var _=require(_0x907e('0xa'));var squel=require(_0x907e('0xb'));var crypto=require('crypto');var jsforce=require(_0x907e('0xc'));var deskjs=require(_0x907e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x907e('0xe'));var Papa=require(_0x907e('0xf'));var Redis=require(_0x907e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x907e('0x11'));var logger=require(_0x907e('0x12'))(_0x907e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x907e('0x14'))['db'];config[_0x907e('0x15')]=_[_0x907e('0x16')](config[_0x907e('0x15')],{'host':_0x907e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0x907e('0x18')](socket);function respondWithStatusCode(_0x530db2,_0x353d5b){_0x353d5b=_0x353d5b||0xcc;return function(_0x186d2d){if(_0x186d2d){return _0x530db2[_0x907e('0x19')](_0x353d5b);}return _0x530db2[_0x907e('0x1a')](_0x353d5b)[_0x907e('0x1b')]();};}function respondWithResult(_0x293e81,_0x215ac6){_0x215ac6=_0x215ac6||0xc8;return function(_0x46d2c7){if(_0x46d2c7){return _0x293e81[_0x907e('0x1a')](_0x215ac6)[_0x907e('0x1c')](_0x46d2c7);}};}function respondWithFilteredResult(_0x2d0e04,_0x5a2b43){return function(_0x4e5831){if(_0x4e5831){var _0x5c62b3=typeof _0x5a2b43[_0x907e('0x1d')]===_0x907e('0x1e')&&typeof _0x5a2b43[_0x907e('0x1f')]===_0x907e('0x1e');var _0xca88ac=_0x4e5831['count'];var _0x5375e6=_0x5c62b3?0x0:_0x5a2b43[_0x907e('0x1d')];var _0x43922a=_0x5c62b3?_0x4e5831[_0x907e('0x20')]:_0x5a2b43[_0x907e('0x1d')]+_0x5a2b43[_0x907e('0x1f')];var _0x1ce1e2;if(_0x43922a>=_0xca88ac){_0x43922a=_0xca88ac;_0x1ce1e2=0xc8;}else{_0x1ce1e2=0xce;}_0x2d0e04[_0x907e('0x1a')](_0x1ce1e2);return _0x2d0e04[_0x907e('0x21')](_0x907e('0x22'),_0x5375e6+'-'+_0x43922a+'/'+_0xca88ac)[_0x907e('0x1c')](_0x4e5831);}return null;};}function patchUpdates(_0x28d5c8){return function(_0x13c60e){try{jsonpatch[_0x907e('0x23')](_0x13c60e,_0x28d5c8,!![]);}catch(_0x55a364){return BPromise['reject'](_0x55a364);}return _0x13c60e[_0x907e('0x24')]();};}function saveUpdates(_0x4a8f31,_0x2c2776){return function(_0x7fdff5){if(_0x7fdff5){return _0x7fdff5['update'](_0x4a8f31)[_0x907e('0x25')](function(_0x4e7946){return _0x4e7946;});}return null;};}function removeEntity(_0x274ae3,_0x2b7b64){return function(_0x423ea8){if(_0x423ea8){return _0x423ea8[_0x907e('0x26')]()[_0x907e('0x25')](function(){var _0x4f20fa=_0x423ea8['get']({'plain':!![]});var _0x143e43=[{'name':'VoiceQueues','value':_0x907e('0x27'),'ignore':![]},{'name':_0x907e('0x28'),'value':'outbound','ignore':![]}];var _0x35ec20=_(_0x143e43)[_0x907e('0x29')](_0x907e('0x2a'))[_0x907e('0x2b')](_0x907e('0x2c'))[_0x907e('0x2c')]();if(_[_0x907e('0x2d')](_0x35ec20,_0x4f20fa[_0x907e('0x2e')])){return;}var _0x549dab=_['find'](_0x143e43,['value',_0x4f20fa[_0x907e('0x2e')]])[_0x907e('0x2f')];return db[_0x907e('0x30')][_0x907e('0x26')]({'where':{'type':_0x549dab,'resourceId':_0x4f20fa['id']}})[_0x907e('0x25')](function(){return _0x423ea8;});})[_0x907e('0x25')](function(){_0x274ae3[_0x907e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e95e,_0x147cfe){return function(_0x3aea14){if(!_0x3aea14){_0x19e95e['sendStatus'](0x194);}return _0x3aea14;};}function handleError(_0xeb3546,_0x328292){_0x328292=_0x328292||0x1f4;return function(_0x4492e8){logger['error'](_0x4492e8[_0x907e('0x31')]);if(_0x4492e8[_0x907e('0x2f')]){delete _0x4492e8[_0x907e('0x2f')];}_0xeb3546[_0x907e('0x1a')](_0x328292)[_0x907e('0x32')](_0x4492e8);};}exports[_0x907e('0x33')]=function(_0x12bd1a,_0x419374){var _0x564a2b={},_0x1c032e={},_0x28bb9b={'count':0x0,'rows':[]};var _0x3db155=_[_0x907e('0x2b')](db['VoiceQueue'][_0x907e('0x34')],function(_0x29b7e4){return{'name':_0x29b7e4['fieldName'],'type':_0x29b7e4[_0x907e('0x2e')][_0x907e('0x35')]};});_0x1c032e['model']=_[_0x907e('0x2b')](_0x3db155,_0x907e('0x2f'));_0x1c032e[_0x907e('0x36')]=_[_0x907e('0x37')](_0x12bd1a[_0x907e('0x36')]);_0x1c032e[_0x907e('0x38')]=_['intersection'](_0x1c032e['model'],_0x1c032e[_0x907e('0x36')]);_0x564a2b['attributes']=_['intersection'](_0x1c032e['model'],qs[_0x907e('0x39')](_0x12bd1a[_0x907e('0x36')][_0x907e('0x39')]));_0x564a2b[_0x907e('0x3a')]=_0x564a2b['attributes'][_0x907e('0x3b')]?_0x564a2b[_0x907e('0x3a')]:_0x1c032e[_0x907e('0x3c')];if(!_0x12bd1a['query'][_0x907e('0x3d')]('nolimit')){_0x564a2b[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x12bd1a[_0x907e('0x36')]['limit']);_0x564a2b[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x12bd1a[_0x907e('0x36')][_0x907e('0x1d')]);}_0x564a2b[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x12bd1a['query'][_0x907e('0x3f')]);_0x564a2b[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x12bd1a['query'],_0x1c032e[_0x907e('0x38')]),_0x3db155);if(_0x12bd1a['query'][_0x907e('0x29')]){_0x564a2b['where']=_['merge'](_0x564a2b[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x3db155,function(_0x135486){if(_0x135486[_0x907e('0x2e')]!==_0x907e('0x42')){var _0x38b95d={};_0x38b95d[_0x135486['name']]={'$like':'%'+_0x12bd1a[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x38b95d;}})});}_0x564a2b=_[_0x907e('0x43')]({},_0x564a2b,_0x12bd1a[_0x907e('0x44')]);var _0x2c97da={'where':_0x564a2b[_0x907e('0x40')]};return db[_0x907e('0x45')][_0x907e('0x20')](_0x2c97da)['then'](function(_0x30add2){_0x28bb9b[_0x907e('0x20')]=_0x30add2;if(_0x12bd1a['query']['includeAll']){_0x564a2b[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x45')][_0x907e('0x47')](_0x564a2b);})[_0x907e('0x25')](function(_0x1fbd71){_0x28bb9b['rows']=_0x1fbd71;return _0x28bb9b;})[_0x907e('0x25')](respondWithFilteredResult(_0x419374,_0x564a2b))['catch'](handleError(_0x419374,null));};exports[_0x907e('0x48')]=function(_0x3d9168,_0x251fe4){var _0x5a8095={'raw':![],'where':{'id':_0x3d9168[_0x907e('0x49')]['id']}},_0x51c51f={};_0x51c51f[_0x907e('0x3c')]=_['keys'](db[_0x907e('0x45')]['rawAttributes']);_0x51c51f['query']=_[_0x907e('0x37')](_0x3d9168[_0x907e('0x36')]);_0x51c51f[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x51c51f[_0x907e('0x3c')],_0x51c51f[_0x907e('0x36')]);_0x5a8095[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x51c51f[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x3d9168[_0x907e('0x36')][_0x907e('0x39')]));_0x5a8095[_0x907e('0x3a')]=_0x5a8095[_0x907e('0x3a')]['length']?_0x5a8095[_0x907e('0x3a')]:_0x51c51f[_0x907e('0x3c')];if(_0x3d9168['query']['includeAll']){_0x5a8095['include']=[{'all':!![]}];}_0x5a8095=_[_0x907e('0x43')]({},_0x5a8095,_0x3d9168[_0x907e('0x44')]);return db[_0x907e('0x45')]['find'](_0x5a8095)['then'](handleEntityNotFound(_0x251fe4,null))[_0x907e('0x25')](respondWithResult(_0x251fe4,null))['catch'](handleError(_0x251fe4,null));};exports[_0x907e('0x4b')]=function(_0xd6ab62,_0x2965e1){return db[_0x907e('0x45')][_0x907e('0x4b')](_0xd6ab62[_0x907e('0x4c')],{})['then'](function(_0x2ae360){var _0x721d89=_0xd6ab62[_0x907e('0x4d')][_0x907e('0x4e')]({'plain':!![]});if(!_0x721d89)throw new Error(_0x907e('0x4f'));if(_0x721d89[_0x907e('0x50')]===_0x907e('0x4d')){var _0xdc9578=_0x2ae360['get']({'plain':!![]});var _0x56321e=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x907e('0x28'),'value':_0x907e('0x51')}];var _0x2df6d1=_[_0x907e('0x52')](_0x56321e,['value',_0xdc9578[_0x907e('0x2e')]])[_0x907e('0x2f')];return db['UserProfileSection'][_0x907e('0x52')]({'where':{'name':_0x2df6d1,'userProfileId':_0x721d89[_0x907e('0x53')]},'raw':!![]})[_0x907e('0x25')](function(_0x451a91){if(_0x451a91&&_0x451a91['autoAssociation']===0x0){return db[_0x907e('0x30')][_0x907e('0x4b')]({'name':_0xdc9578[_0x907e('0x2f')],'resourceId':_0xdc9578['id'],'type':_0x451a91[_0x907e('0x2f')],'sectionId':_0x451a91['id']},{})['then'](function(){return _0x2ae360;});}else{return _0x2ae360;}})[_0x907e('0x54')](function(_0x294ad9){logger[_0x907e('0x55')](_0x907e('0x56'),_0x294ad9);throw _0x294ad9;});}return _0x2ae360;})['then'](respondWithResult(_0x2965e1,0xc9))[_0x907e('0x54')](handleError(_0x2965e1,null));};exports[_0x907e('0x57')]=function(_0x329f02,_0x55083b){var _0x39480c={'where':{'id':_0x329f02[_0x907e('0x49')]['id']}},_0x5436b4={};_0x5436b4[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x45')][_0x907e('0x34')]);_0x39480c[_0x907e('0x3a')]=_['intersection'](_0x5436b4['model'],qs[_0x907e('0x39')](_0x329f02[_0x907e('0x36')][_0x907e('0x39')]));_0x39480c[_0x907e('0x3a')]=_0x39480c[_0x907e('0x3a')][_0x907e('0x3b')]?_0x39480c[_0x907e('0x3a')]:_0x5436b4['model'];if(_0x329f02[_0x907e('0x36')][_0x907e('0x58')]){_0x39480c['include']=[{'all':!![]}];}_0x39480c=_[_0x907e('0x43')]({},_0x39480c,_0x329f02[_0x907e('0x44')]);return db['VoiceQueue'][_0x907e('0x52')](_0x39480c)['then'](handleEntityNotFound(_0x55083b,null))[_0x907e('0x25')](function(_0x141c5b){if(_0x141c5b){var _0x1bbfdf=_0x141c5b[_0x907e('0x4e')]({'plain':!![]});_0x1bbfdf=qs[_0x907e('0x59')](_0x1bbfdf,['id','createdAt',_0x907e('0x5a')]);_0x329f02[_0x907e('0x4c')]=_[_0x907e('0x59')](_0x329f02[_0x907e('0x4c')],['id',_0x907e('0x5b'),_0x907e('0x5a')]);return db[_0x907e('0x45')][_0x907e('0x4b')](_[_0x907e('0x43')](_0x1bbfdf,_0x329f02[_0x907e('0x4c')]),{'include':_0x329f02[_0x907e('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x907e('0x25')](function(_0x22f514){var _0x2cfac0=_0x329f02[_0x907e('0x4d')]['get']({'plain':!![]});if(!_0x2cfac0)throw new Error(_0x907e('0x4f'));if(_0x2cfac0[_0x907e('0x50')]===_0x907e('0x4d')){var _0x35601c=_0x22f514[_0x907e('0x4e')]({'plain':!![]});var _0x10b789=[{'name':_0x907e('0x5c'),'value':_0x907e('0x27')},{'name':_0x907e('0x28'),'value':_0x907e('0x51')}];var _0x116623=_[_0x907e('0x52')](_0x10b789,['value',_0x35601c[_0x907e('0x2e')]])[_0x907e('0x2f')];return db[_0x907e('0x5d')][_0x907e('0x52')]({'where':{'name':_0x116623,'userProfileId':_0x2cfac0['userProfileId']},'raw':!![]})[_0x907e('0x25')](function(_0x4b5630){if(_0x4b5630&&_0x4b5630['autoAssociation']===0x0){return db['UserProfileResource'][_0x907e('0x4b')]({'name':_0x35601c[_0x907e('0x2f')],'resourceId':_0x35601c['id'],'type':_0x4b5630['name'],'sectionId':_0x4b5630['id']},{})[_0x907e('0x25')](function(){return _0x22f514;});}else{return _0x22f514;}})[_0x907e('0x54')](function(_0x382c19){logger[_0x907e('0x55')](_0x907e('0x56'),_0x382c19);throw _0x382c19;});}return _0x22f514;});}})['then'](respondWithResult(_0x55083b,0xc9))[_0x907e('0x54')](handleError(_0x55083b,null));};exports[_0x907e('0x5e')]=function(_0x56cad2,_0x5a7674){if(_0x56cad2['body']['id']){delete _0x56cad2['body']['id'];}return db['VoiceQueue'][_0x907e('0x52')]({'where':{'id':_0x56cad2[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x5a7674,null))[_0x907e('0x25')](saveUpdates(_0x56cad2[_0x907e('0x4c')],null))['then'](respondWithResult(_0x5a7674,null))['catch'](handleError(_0x5a7674,null));};exports[_0x907e('0x26')]=function(_0x15a9ba,_0x27de00){return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x15a9ba['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x27de00,null))[_0x907e('0x25')](removeEntity(_0x27de00,null))['catch'](handleError(_0x27de00,null));};exports['getHoppers']=function(_0x16b3c3,_0x34d7d1,_0xd4418d){var _0x519305={'raw':![],'where':{}};var _0x3fc403={};var _0x53d5e4={'count':0x0,'rows':[]};return db[_0x907e('0x45')]['findOne']({'where':{'id':_0x16b3c3['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x34d7d1,null))[_0x907e('0x25')](function(_0x3f2530){if(_0x3f2530){_0x3fc403[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x5f')]['rawAttributes']);_0x3fc403[_0x907e('0x36')]=_['keys'](_0x16b3c3[_0x907e('0x36')]);_0x3fc403['filters']=_[_0x907e('0x4a')](_0x3fc403[_0x907e('0x3c')],_0x3fc403[_0x907e('0x36')]);_0x519305[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x3fc403[_0x907e('0x3c')],qs['fields'](_0x16b3c3[_0x907e('0x36')]['fields']));_0x519305['attributes']=_0x519305[_0x907e('0x3a')]['length']?_0x519305['attributes']:_0x3fc403[_0x907e('0x3c')];if(!_0x16b3c3['query'][_0x907e('0x3d')](_0x907e('0x60'))){_0x519305[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x16b3c3[_0x907e('0x36')][_0x907e('0x1f')]);_0x519305['offset']=qs[_0x907e('0x1d')](_0x16b3c3[_0x907e('0x36')][_0x907e('0x1d')]);}_0x519305[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x16b3c3[_0x907e('0x36')]['sort']);_0x519305[_0x907e('0x40')]=qs[_0x907e('0x38')](_['pick'](_0x16b3c3[_0x907e('0x36')],_0x3fc403[_0x907e('0x38')]));_0x519305[_0x907e('0x40')][_0x907e('0x61')]=_0x3f2530['id'];if(_0x16b3c3[_0x907e('0x36')][_0x907e('0x29')]){_0x519305[_0x907e('0x40')]=_[_0x907e('0x43')](_0x519305[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x519305[_0x907e('0x3a')],function(_0x14dbc1){var _0x27c5c9={};_0x27c5c9[_0x14dbc1]={'$like':'%'+_0x16b3c3['query'][_0x907e('0x29')]+'%'};return _0x27c5c9;})});}_0x519305=_[_0x907e('0x43')]({},_0x519305,_0x16b3c3[_0x907e('0x44')]);return db[_0x907e('0x5f')][_0x907e('0x20')]({'where':_0x519305[_0x907e('0x40')]})['then'](function(_0x4be4fd){_0x53d5e4[_0x907e('0x20')]=_0x4be4fd;if(_0x16b3c3['query'][_0x907e('0x58')]){_0x519305[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x5f')][_0x907e('0x47')](_0x519305);})[_0x907e('0x25')](function(_0x5ae67f){_0x53d5e4[_0x907e('0x62')]=_0x5ae67f;return _0x53d5e4;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x34d7d1,_0x519305))[_0x907e('0x54')](handleError(_0x34d7d1,null));};exports['getHopperHistories']=function(_0x22138b,_0x35e86b,_0x15d0c5){var _0x498bec={'raw':!![],'where':{}};var _0x46e940={};var _0x5affee={'count':0x0,'rows':[]};return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x22138b['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x35e86b,null))[_0x907e('0x25')](function(_0x134e96){if(_0x134e96){_0x46e940[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x64')][_0x907e('0x34')]);_0x46e940['query']=_[_0x907e('0x37')](_0x22138b[_0x907e('0x36')]);_0x46e940['filters']=_[_0x907e('0x4a')](_0x46e940[_0x907e('0x3c')],_0x46e940['query']);_0x498bec['attributes']=_['intersection'](_0x46e940[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x22138b[_0x907e('0x36')][_0x907e('0x39')]));_0x498bec['attributes']=_0x498bec['attributes'][_0x907e('0x3b')]?_0x498bec[_0x907e('0x3a')]:_0x46e940['model'];if(!_0x22138b['query']['hasOwnProperty']('nolimit')){_0x498bec[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x22138b[_0x907e('0x36')][_0x907e('0x1f')]);_0x498bec[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x22138b[_0x907e('0x36')][_0x907e('0x1d')]);}_0x498bec['order']=qs[_0x907e('0x3f')](_0x22138b[_0x907e('0x36')][_0x907e('0x3f')]);_0x498bec[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x22138b[_0x907e('0x36')],_0x46e940[_0x907e('0x38')]));_0x498bec[_0x907e('0x40')][_0x907e('0x61')]=_0x134e96['id'];if(_0x22138b[_0x907e('0x36')][_0x907e('0x29')]){_0x498bec[_0x907e('0x40')]=_['merge'](_0x498bec['where'],{'$or':_[_0x907e('0x2b')](_0x498bec[_0x907e('0x3a')],function(_0x1dd6e2){var _0x253803={};_0x253803[_0x1dd6e2]={'$like':'%'+_0x22138b[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x253803;})});}_0x498bec=_[_0x907e('0x43')]({},_0x498bec,_0x22138b[_0x907e('0x44')]);return db[_0x907e('0x64')][_0x907e('0x20')]({'where':_0x498bec[_0x907e('0x40')]})[_0x907e('0x25')](function(_0x52cbcf){_0x5affee[_0x907e('0x20')]=_0x52cbcf;if(_0x22138b[_0x907e('0x36')][_0x907e('0x58')]){_0x498bec[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x64')][_0x907e('0x47')](_0x498bec);})[_0x907e('0x25')](function(_0x503c47){_0x5affee[_0x907e('0x62')]=_0x503c47;return _0x5affee;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x35e86b,_0x498bec))['catch'](handleError(_0x35e86b,null));};exports['getHopperFinals']=function(_0x1683fa,_0x511aab,_0x46f681){var _0x32211c={'raw':!![],'where':{}};var _0x69056e={};var _0xe4d717={'count':0x0,'rows':[]};return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x1683fa[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x511aab,null))[_0x907e('0x25')](function(_0x4a3ef1){if(_0x4a3ef1){_0x69056e[_0x907e('0x3c')]=_[_0x907e('0x37')](db['CmHopperFinal'][_0x907e('0x34')]);_0x69056e[_0x907e('0x36')]=_[_0x907e('0x37')](_0x1683fa[_0x907e('0x36')]);_0x69056e[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x69056e[_0x907e('0x3c')],_0x69056e[_0x907e('0x36')]);_0x32211c[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x69056e[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x1683fa[_0x907e('0x36')][_0x907e('0x39')]));_0x32211c[_0x907e('0x3a')]=_0x32211c[_0x907e('0x3a')]['length']?_0x32211c[_0x907e('0x3a')]:_0x69056e[_0x907e('0x3c')];if(!_0x1683fa[_0x907e('0x36')][_0x907e('0x3d')](_0x907e('0x60'))){_0x32211c['limit']=qs[_0x907e('0x1f')](_0x1683fa[_0x907e('0x36')][_0x907e('0x1f')]);_0x32211c[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x1683fa['query'][_0x907e('0x1d')]);}_0x32211c[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x1683fa[_0x907e('0x36')]['sort']);_0x32211c[_0x907e('0x40')]=qs['filters'](_[_0x907e('0x41')](_0x1683fa[_0x907e('0x36')],_0x69056e['filters']));_0x32211c[_0x907e('0x40')][_0x907e('0x61')]=_0x4a3ef1['id'];if(_0x1683fa[_0x907e('0x36')][_0x907e('0x29')]){_0x32211c[_0x907e('0x40')]=_[_0x907e('0x43')](_0x32211c[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x32211c['attributes'],function(_0x21d51d){var _0x1e1936={};_0x1e1936[_0x21d51d]={'$like':'%'+_0x1683fa[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x1e1936;})});}_0x32211c=_[_0x907e('0x43')]({},_0x32211c,_0x1683fa[_0x907e('0x44')]);return db[_0x907e('0x65')][_0x907e('0x20')]({'where':_0x32211c['where']})['then'](function(_0x1e9bcb){_0xe4d717[_0x907e('0x20')]=_0x1e9bcb;if(_0x1683fa['query']['includeAll']){_0x32211c[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x65')][_0x907e('0x47')](_0x32211c);})['then'](function(_0x497e6d){_0xe4d717['rows']=_0x497e6d;return _0xe4d717;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x511aab,_0x32211c))[_0x907e('0x54')](handleError(_0x511aab,null));};exports[_0x907e('0x66')]=function(_0x47bcbe,_0x104466,_0x5bed80){var _0x380225={'raw':!![],'where':{}};var _0x3a3a08={};var _0x300853={'count':0x0,'rows':[]};return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x47bcbe[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x104466,null))[_0x907e('0x25')](function(_0x4117a5){if(_0x4117a5){_0x3a3a08[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x67')][_0x907e('0x34')]);_0x3a3a08[_0x907e('0x36')]=_[_0x907e('0x37')](_0x47bcbe[_0x907e('0x36')]);_0x3a3a08[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x3a3a08[_0x907e('0x3c')],_0x3a3a08[_0x907e('0x36')]);_0x380225[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x3a3a08[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x47bcbe[_0x907e('0x36')]['fields']));_0x380225[_0x907e('0x3a')]=_0x380225['attributes'][_0x907e('0x3b')]?_0x380225['attributes']:_0x3a3a08[_0x907e('0x3c')];if(!_0x47bcbe['query'][_0x907e('0x3d')]('nolimit')){_0x380225['limit']=qs['limit'](_0x47bcbe['query'][_0x907e('0x1f')]);_0x380225['offset']=qs[_0x907e('0x1d')](_0x47bcbe['query'][_0x907e('0x1d')]);}_0x380225[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x47bcbe['query'][_0x907e('0x3f')]);_0x380225[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x47bcbe[_0x907e('0x36')],_0x3a3a08[_0x907e('0x38')]));_0x380225[_0x907e('0x40')][_0x907e('0x61')]=_0x4117a5['id'];if(_0x47bcbe[_0x907e('0x36')]['filter']){_0x380225['where']=_[_0x907e('0x43')](_0x380225[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x380225[_0x907e('0x3a')],function(_0x199ffc){var _0x1bf18d={};_0x1bf18d[_0x199ffc]={'$like':'%'+_0x47bcbe['query'][_0x907e('0x29')]+'%'};return _0x1bf18d;})});}_0x380225=_[_0x907e('0x43')]({},_0x380225,_0x47bcbe[_0x907e('0x44')]);return db[_0x907e('0x67')][_0x907e('0x20')]({'where':_0x380225[_0x907e('0x40')]})[_0x907e('0x25')](function(_0x5cbede){_0x300853[_0x907e('0x20')]=_0x5cbede;if(_0x47bcbe[_0x907e('0x36')][_0x907e('0x58')]){_0x380225[_0x907e('0x46')]=[{'all':!![]}];}return db[_0x907e('0x67')][_0x907e('0x47')](_0x380225);})[_0x907e('0x25')](function(_0x34daeb){_0x300853[_0x907e('0x62')]=_0x34daeb;return _0x300853;});}})[_0x907e('0x25')](respondWithFilteredResult(_0x104466,_0x380225))[_0x907e('0x54')](handleError(_0x104466,null));};exports[_0x907e('0x68')]=function(_0x3476f8,_0x3a6af8,_0x2cacb1){var _0x23a64b={};var _0x3f445e={};var _0x817b50;var _0x3b4f11;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x3476f8['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x3a6af8,null))[_0x907e('0x25')](function(_0x353a68){if(_0x353a68){_0x817b50=_0x353a68;_0x3f445e['model']=_[_0x907e('0x37')](db[_0x907e('0x69')][_0x907e('0x34')]);_0x3f445e[_0x907e('0x36')]=_['keys'](_0x3476f8['query']);_0x3f445e[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x3f445e[_0x907e('0x3c')],_0x3f445e['query']);_0x23a64b['attributes']=_[_0x907e('0x4a')](_0x3f445e[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x3476f8[_0x907e('0x36')]['fields']));_0x23a64b[_0x907e('0x3a')]=_0x23a64b['attributes']['length']?_0x23a64b[_0x907e('0x3a')]:_0x3f445e[_0x907e('0x3c')];_0x23a64b['order']=qs['sort'](_0x3476f8['query'][_0x907e('0x3f')]);_0x23a64b[_0x907e('0x40')]=qs['filters'](_[_0x907e('0x41')](_0x3476f8[_0x907e('0x36')],_0x3f445e['filters']));if(_0x3476f8['query'][_0x907e('0x29')]){_0x23a64b[_0x907e('0x40')]=_[_0x907e('0x43')](_0x23a64b[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x23a64b[_0x907e('0x3a')],function(_0x14d586){var _0x3946cf={};_0x3946cf[_0x14d586]={'$like':'%'+_0x3476f8[_0x907e('0x36')]['filter']+'%'};return _0x3946cf;})});}_0x23a64b=_[_0x907e('0x43')]({},_0x23a64b,_0x3476f8[_0x907e('0x44')]);return _0x817b50[_0x907e('0x68')](_0x23a64b);}})[_0x907e('0x25')](function(_0x157969){if(_0x157969){_0x3b4f11=_0x157969[_0x907e('0x3b')];if(!_0x3476f8[_0x907e('0x36')][_0x907e('0x3d')]('nolimit')){_0x23a64b['limit']=qs['limit'](_0x3476f8[_0x907e('0x36')]['limit']);_0x23a64b[_0x907e('0x1d')]=qs['offset'](_0x3476f8[_0x907e('0x36')][_0x907e('0x1d')]);}return _0x817b50[_0x907e('0x68')](_0x23a64b);}})[_0x907e('0x25')](function(_0x31ff7c){if(_0x31ff7c){return _0x31ff7c?{'count':_0x3b4f11,'rows':_0x31ff7c}:null;}})[_0x907e('0x25')](respondWithResult(_0x3a6af8,null))[_0x907e('0x54')](handleError(_0x3a6af8,null));};exports[_0x907e('0x6a')]=function(_0x12af9b,_0x430b08,_0x37e25e){var _0x345e6a=_0x12af9b[_0x907e('0x4c')][_0x907e('0x6b')];var _0x272aed=_[_0x907e('0x2b')](_0x345e6a,'id');return db[_0x907e('0x69')]['findAll']({'where':{'id':_0x272aed},'attributes':['id'],'include':[{'model':db[_0x907e('0x6c')],'as':_0x907e('0x6d'),'attributes':['id','name',_0x907e('0x6e'),_0x907e('0x6f'),_0x907e('0x70')],'raw':!![]}]})[_0x907e('0x25')](function(_0x20828e){if(_0x20828e){var _0x4d4e69=_[_0x907e('0x71')](_0x20828e,function(_0x5a8a25){var _0x1f159d=_0x5a8a25[_0x907e('0x4e')]({'plain':!![]});_0x1f159d['Agents'][_0x907e('0x72')](function(_0x564648){_0x564648[_0x907e('0x73')]=_[_0x907e('0x52')](_0x345e6a,{'id':_0x1f159d['id']})[_0x907e('0x73')];});return _0x1f159d['Agents'];});return db[_0x907e('0x45')]['find']({'where':{'id':_0x12af9b[_0x907e('0x49')]['id']}})[_0x907e('0x25')](function(_0xba4df2){return db[_0x907e('0x74')]['transaction'](function(_0x12511e){return _0xba4df2[_0x907e('0x6a')](_0x272aed,{'transaction':_0x12511e})[_0x907e('0x25')](function(){return BPromise[_0x907e('0x75')](_0x345e6a,function(_0x363134){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x363134['id'],'VoiceQueueId':_0x12af9b[_0x907e('0x49')]['id'],'penalty':_0x363134[_0x907e('0x73')]},{'transaction':_0x12511e});});})[_0x907e('0x25')](function(){return BPromise[_0x907e('0x75')](_0x4d4e69,function(_0xf03fba){return db[_0x907e('0x76')][_0x907e('0x77')]({'where':{'UserId':_0xf03fba['id'],'VoiceQueueId':_0x12af9b[_0x907e('0x49')]['id']},'defaults':{'penalty':_0xf03fba[_0x907e('0x73')]},'transaction':_0x12511e});});})[_0x907e('0x25')](function(){return BPromise[_0x907e('0x75')](_[_0x907e('0x29')](_0x4d4e69,{'online':!![]}),function(_0x185754){return db[_0x907e('0x78')][_0x907e('0x79')]({'membername':_0x185754[_0x907e('0x2f')],'UserId':_0x185754['id'],'queue_name':_0xba4df2[_0x907e('0x2f')],'VoiceQueueId':_0xba4df2['id'],'interface':_[_0x907e('0x7a')](_0x185754[_0x907e('0x70')])?util[_0x907e('0x7b')](_0x907e('0x7c'),_0x185754[_0x907e('0x2f')]):_0x185754[_0x907e('0x70')],'paused':_0x185754[_0x907e('0x6f')]||![],'penalty':_0x185754[_0x907e('0x73')]},{'transaction':_0x12511e});});})[_0x907e('0x25')](function(){_0x4d4e69[_0x907e('0x72')](function(_0x410de5){socket[_0x907e('0x7d')]('userVoiceQueue:save',{'UserId':_0x410de5['id'],'VoiceQueueId':_0xba4df2['id']});});});});});}})[_0x907e('0x25')](respondWithStatusCode(_0x430b08,null))[_0x907e('0x54')](handleError(_0x430b08,null));};exports[_0x907e('0x7e')]=function(_0x5be8f2,_0x3b7516,_0x1e6249){return db[_0x907e('0x69')][_0x907e('0x47')]({'where':{'id':_0x5be8f2[_0x907e('0x36')][_0x907e('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x907e('0x6c')],'as':_0x907e('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x907e('0x25')](handleEntityNotFound(_0x3b7516,null))[_0x907e('0x25')](function(_0x3e45e4){var _0x386afd=_[_0x907e('0x2b')](_0x3e45e4,'id');var _0xbf5778=[];var _0x5f0ecb=[];var _0x59bd8f=squel[_0x907e('0x80')]();_0x59bd8f[_0x907e('0x81')](_0x907e('0x82'))['from'](_0x907e('0x83'),'tq')[_0x907e('0x84')](_0x907e('0x85'),'ut',_0x907e('0x86'))[_0x907e('0x40')]('VoiceQueueId\x20=\x20?',_0x5be8f2['params']['id']);for(var _0x309550=0x0;_0x309550<_0x3e45e4['length'];_0x309550+=0x1){let _0x118a55=_0x3e45e4[_0x309550];for(var _0x1accbc=0x0;_0x1accbc<_0x118a55[_0x907e('0x6d')][_0x907e('0x3b')];_0x1accbc+=0x1){let _0x363f47=_0x118a55[_0x907e('0x6d')][_0x1accbc];var _0x2c1f66=_0x59bd8f[_0x907e('0x57')]();_0x2c1f66['where'](_0x907e('0x87'),_0x363f47['id']);_0x5f0ecb['push'](db[_0x907e('0x74')][_0x907e('0x36')](_0x2c1f66['toString'](),{'type':db[_0x907e('0x74')][_0x907e('0x88')][_0x907e('0x89')]})['then'](function(_0x540aa5){if(_0x540aa5['length']===0x1){return _0x363f47['id'];}else{var _0x3de6d9=_[_0x907e('0x8a')](_[_0x907e('0x2b')](_0x540aa5,_0x907e('0x8b')),function(_0x3bd3d8){return _[_0x907e('0x2d')](_0x386afd,_0x3bd3d8);});if(_0x3de6d9){return _0x363f47['id'];}}}));}}return BPromise[_0x907e('0x8c')](_0x5f0ecb)[_0x907e('0x25')](function(_0x7ad732){_0xbf5778=_(_0xbf5778)['union'](_0x7ad732)['compact']()['value']();return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x5be8f2['params']['id']}})['then'](function(_0x22a4eb){return db[_0x907e('0x74')]['transaction'](function(_0x2ee465){return _0x22a4eb[_0x907e('0x7e')](_0x5be8f2[_0x907e('0x36')][_0x907e('0x7f')],{'transaction':_0x2ee465})['then'](function(){if(!_[_0x907e('0x8d')](_0xbf5778)){return _0x22a4eb[_0x907e('0x8e')](_0xbf5778,{'transaction':_0x2ee465})[_0x907e('0x25')](function(){return db[_0x907e('0x78')][_0x907e('0x26')]({'where':{'VoiceQueueId':_0x5be8f2[_0x907e('0x49')]['id'],'UserId':_0xbf5778},'transaction':_0x2ee465});});}})[_0x907e('0x25')](function(){_0xbf5778['forEach'](function(_0xd7f75c){socket[_0x907e('0x7d')](_0x907e('0x8f'),{'UserId':_0xd7f75c,'VoiceQueueId':_0x22a4eb['id']});});});});});});})[_0x907e('0x25')](respondWithStatusCode(_0x3b7516,null))['catch'](handleError(_0x3b7516,null));};exports['addAgents']=function(_0x5fe159,_0x38c337,_0xf48ef8){var _0x2ac6fc,_0x2eb3ac;return db['VoiceQueue'][_0x907e('0x52')]({'where':{'id':_0x5fe159[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x38c337,null))[_0x907e('0x25')](function(_0xe03053){if(_0xe03053){_0x2eb3ac=_0xe03053;return _0xe03053['addAgents'](_0x5fe159['body'][_0x907e('0x7f')],_[_0x907e('0x59')](_0x5fe159[_0x907e('0x4c')],[_0x907e('0x7f'),'id'])||{})[_0x907e('0x90')](function(_0x4f127f){for(var _0x383a4a=0x0;_0x383a4a<_0x5fe159[_0x907e('0x4c')][_0x907e('0x7f')][_0x907e('0x3b')];_0x383a4a+=0x1){socket[_0x907e('0x7d')](_0x907e('0x91'),{'UserId':Number(_0x5fe159[_0x907e('0x4c')]['ids'][_0x383a4a]),'VoiceQueueId':Number(_0x5fe159['params']['id'])});}return _0x4f127f;});}})[_0x907e('0x25')](function(_0x25baeb){_0x2ac6fc=_0x25baeb||[];if(_0x2eb3ac){return db[_0x907e('0x6c')]['findAll']({'where':{'id':_0x5fe159[_0x907e('0x4c')]['ids']},'attributes':['id',_0x907e('0x2f'),_0x907e('0x6e'),'voicePause',_0x907e('0x70')],'raw':!![]});}})[_0x907e('0x25')](function(_0x3850a3){if(!_[_0x907e('0x8d')](_0x3850a3)){var _0xac54e6=[];for(var _0x536946=0x0;_0x536946<_0x3850a3['length'];_0x536946++){if(_0x3850a3[_0x536946][_0x907e('0x6e')]){_0xac54e6['push'](db[_0x907e('0x78')]['upsert']({'membername':_0x3850a3[_0x536946][_0x907e('0x2f')],'UserId':_0x3850a3[_0x536946]['id'],'queue_name':_0x2eb3ac[_0x907e('0x2f')],'VoiceQueueId':_0x2eb3ac['id'],'interface':_['isNil'](_0x3850a3[_0x536946]['interface'])?util[_0x907e('0x7b')](_0x907e('0x7c'),_0x3850a3[_0x536946][_0x907e('0x2f')]):_0x3850a3[_0x536946]['interface'],'paused':_0x3850a3[_0x536946][_0x907e('0x6f')]||![],'penalty':_0x5fe159[_0x907e('0x4c')]['penalty']||0x0}));}}return BPromise[_0x907e('0x8c')](_0xac54e6);}})[_0x907e('0x25')](function(){return _0x2ac6fc;})[_0x907e('0x25')](respondWithResult(_0x38c337,null))[_0x907e('0x54')](handleError(_0x38c337,null));};exports[_0x907e('0x8e')]=function(_0x54686d,_0x12d637,_0x56f724){return db[_0x907e('0x45')]['find']({'where':{'id':_0x54686d[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x12d637,null))['then'](function(_0x585805){if(_0x585805){return _0x585805[_0x907e('0x8e')](_0x54686d['query'][_0x907e('0x7f')])[_0x907e('0x25')](function(){if(_[_0x907e('0x92')](_0x54686d['query'][_0x907e('0x7f')])){for(var _0x44c055=0x0;_0x44c055<_0x54686d[_0x907e('0x36')]['ids'][_0x907e('0x3b')];_0x44c055+=0x1){socket[_0x907e('0x7d')](_0x907e('0x8f'),{'UserId':Number(_0x54686d['query'][_0x907e('0x7f')][_0x44c055]),'VoiceQueueId':Number(_0x54686d[_0x907e('0x49')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x54686d[_0x907e('0x36')][_0x907e('0x7f')]),'VoiceQueueId':Number(_0x54686d[_0x907e('0x49')]['id'])});}});}})[_0x907e('0x25')](function(_0xfb57a2){return db[_0x907e('0x78')][_0x907e('0x26')]({'where':{'VoiceQueueId':_0x54686d[_0x907e('0x49')]['id'],'UserId':_0x54686d[_0x907e('0x36')][_0x907e('0x7f')]}})[_0x907e('0x25')](function(){return _0xfb57a2;});})[_0x907e('0x25')](respondWithStatusCode(_0x12d637,null))['catch'](handleError(_0x12d637,null));};exports['getAgents']=function(_0x499f70,_0x3c1312,_0x4eb70c){var _0x434f3d={};var _0x1c53f5={};var _0x278297;var _0x1f65da;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x499f70[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c1312,null))[_0x907e('0x25')](function(_0x3fe03b){if(_0x3fe03b){_0x278297=_0x3fe03b;_0x1c53f5['model']=_['keys'](db[_0x907e('0x6c')][_0x907e('0x34')]);_0x1c53f5['query']=_[_0x907e('0x37')](_0x499f70[_0x907e('0x36')]);_0x1c53f5[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x1c53f5[_0x907e('0x3c')],_0x1c53f5[_0x907e('0x36')]);_0x434f3d[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x1c53f5[_0x907e('0x3c')],qs['fields'](_0x499f70[_0x907e('0x36')]['fields']));_0x434f3d[_0x907e('0x3a')]=_0x434f3d[_0x907e('0x3a')][_0x907e('0x3b')]?_0x434f3d['attributes']:_0x1c53f5[_0x907e('0x3c')];_0x434f3d[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x499f70[_0x907e('0x36')][_0x907e('0x3f')]);_0x434f3d[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x499f70[_0x907e('0x36')],_0x1c53f5[_0x907e('0x38')]));if(_0x499f70[_0x907e('0x36')][_0x907e('0x29')]){_0x434f3d[_0x907e('0x40')]=_[_0x907e('0x43')](_0x434f3d[_0x907e('0x40')],{'$or':_['map'](_0x434f3d[_0x907e('0x3a')],function(_0x1db699){var _0xdb564e={};_0xdb564e[_0x1db699]={'$like':'%'+_0x499f70[_0x907e('0x36')]['filter']+'%'};return _0xdb564e;})});}_0x434f3d=_[_0x907e('0x43')]({},_0x434f3d,_0x499f70[_0x907e('0x44')]);return _0x278297['getAgents'](_0x434f3d);}})[_0x907e('0x25')](function(_0x161fba){if(_0x161fba){_0x1f65da=_0x161fba[_0x907e('0x3b')];if(!_0x499f70['query'][_0x907e('0x3d')](_0x907e('0x60'))){_0x434f3d['limit']=qs[_0x907e('0x1f')](_0x499f70[_0x907e('0x36')][_0x907e('0x1f')]);_0x434f3d['offset']=qs[_0x907e('0x1d')](_0x499f70[_0x907e('0x36')]['offset']);}return _0x278297[_0x907e('0x93')](_0x434f3d);}})['then'](function(_0x53b31d){if(_0x53b31d){return _0x53b31d?{'count':_0x1f65da,'rows':_0x53b31d}:null;}})[_0x907e('0x25')](respondWithResult(_0x3c1312,null))['catch'](handleError(_0x3c1312,null));};exports['getMembers']=function(_0x4c0158,_0x1f5de7,_0x16694a){var _0x5aa7bb={};var _0x909086={};var _0x206112;var _0x47923d;return db[_0x907e('0x45')]['findOne']({'where':{'id':_0x4c0158['params']['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x1f5de7,null))[_0x907e('0x25')](function(_0x47bebc){if(_0x47bebc){_0x206112=_0x47bebc;_0x909086[_0x907e('0x3c')]=_[_0x907e('0x37')](db[_0x907e('0x78')]['rawAttributes']);_0x909086[_0x907e('0x36')]=_[_0x907e('0x37')](_0x4c0158[_0x907e('0x36')]);_0x909086[_0x907e('0x38')]=_['intersection'](_0x909086[_0x907e('0x3c')],_0x909086[_0x907e('0x36')]);_0x5aa7bb[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x909086[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x4c0158[_0x907e('0x36')][_0x907e('0x39')]));_0x5aa7bb['attributes']=_0x5aa7bb[_0x907e('0x3a')][_0x907e('0x3b')]?_0x5aa7bb[_0x907e('0x3a')]:_0x909086[_0x907e('0x3c')];_0x5aa7bb[_0x907e('0x3e')]=qs['sort'](_0x4c0158[_0x907e('0x36')][_0x907e('0x3f')]);_0x5aa7bb[_0x907e('0x40')]=qs[_0x907e('0x38')](_['pick'](_0x4c0158['query'],_0x909086['filters']));if(_0x4c0158[_0x907e('0x36')][_0x907e('0x29')]){_0x5aa7bb['where']=_['merge'](_0x5aa7bb[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x5aa7bb[_0x907e('0x3a')],function(_0x3e8e13){var _0x5def15={};_0x5def15[_0x3e8e13]={'$like':'%'+_0x4c0158[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x5def15;})});}_0x5aa7bb=_[_0x907e('0x43')]({},_0x5aa7bb,_0x4c0158[_0x907e('0x44')]);return _0x206112[_0x907e('0x94')](_0x5aa7bb);}})[_0x907e('0x25')](function(_0x3220ea){if(_0x3220ea){_0x47923d=_0x3220ea[_0x907e('0x3b')];if(!_0x4c0158[_0x907e('0x36')][_0x907e('0x3d')](_0x907e('0x60'))){_0x5aa7bb[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x4c0158[_0x907e('0x36')]['limit']);_0x5aa7bb[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x4c0158['query'][_0x907e('0x1d')]);}return _0x206112[_0x907e('0x94')](_0x5aa7bb);}})['then'](function(_0x1c7354){return _0x1c7354?{'count':_0x47923d,'rows':_0x1c7354}:null;})[_0x907e('0x25')](respondWithResult(_0x1f5de7,null))['catch'](handleError(_0x1f5de7,null));};exports[_0x907e('0x95')]=function(_0x3955cf,_0x5b7b40,_0x2fb6e8){var _0x16c963={};var _0x26127a={};var _0x399741;var _0x40a11e;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x3955cf[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x5b7b40,null))[_0x907e('0x25')](function(_0x3b9c0b){if(_0x3b9c0b){_0x399741=_0x3b9c0b;_0x26127a[_0x907e('0x3c')]=_['keys'](db[_0x907e('0x96')][_0x907e('0x34')]);_0x26127a[_0x907e('0x36')]=_[_0x907e('0x37')](_0x3955cf[_0x907e('0x36')]);_0x26127a[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x26127a[_0x907e('0x3c')],_0x26127a[_0x907e('0x36')]);_0x16c963[_0x907e('0x3a')]=_[_0x907e('0x4a')](_0x26127a[_0x907e('0x3c')],qs['fields'](_0x3955cf['query'][_0x907e('0x39')]));_0x16c963['attributes']=_0x16c963[_0x907e('0x3a')]['length']?_0x16c963['attributes']:_0x26127a[_0x907e('0x3c')];_0x16c963[_0x907e('0x3e')]=qs[_0x907e('0x3f')](_0x3955cf[_0x907e('0x36')]['sort']);_0x16c963[_0x907e('0x40')]=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x3955cf[_0x907e('0x36')],_0x26127a[_0x907e('0x38')]));if(_0x3955cf[_0x907e('0x36')][_0x907e('0x29')]){_0x16c963[_0x907e('0x40')]=_[_0x907e('0x43')](_0x16c963[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x16c963['attributes'],function(_0xee55e1){var _0x34e20c={};_0x34e20c[_0xee55e1]={'$like':'%'+_0x3955cf[_0x907e('0x36')][_0x907e('0x29')]+'%'};return _0x34e20c;})});}_0x16c963=_[_0x907e('0x43')]({},_0x16c963,_0x3955cf['options']);return _0x399741[_0x907e('0x95')](_0x16c963);}})[_0x907e('0x25')](function(_0x506fd0){if(_0x506fd0){_0x40a11e=_0x506fd0[_0x907e('0x3b')];if(!_0x3955cf[_0x907e('0x36')][_0x907e('0x3d')](_0x907e('0x60'))){_0x16c963[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x3955cf[_0x907e('0x36')][_0x907e('0x1f')]);_0x16c963['offset']=qs['offset'](_0x3955cf[_0x907e('0x36')]['offset']);}return _0x399741['getLists'](_0x16c963);}})[_0x907e('0x25')](function(_0x66d940){if(_0x66d940){return _0x66d940?{'count':_0x40a11e,'rows':_0x66d940}:null;}})[_0x907e('0x25')](respondWithResult(_0x5b7b40,null))['catch'](handleError(_0x5b7b40,null));};exports[_0x907e('0x97')]=function(_0x502bc5,_0x3f7d26,_0x1eb738){var _0x505c23,_0x43777d;return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x502bc5[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f7d26,null))[_0x907e('0x25')](function(_0x3126a8){if(_0x3126a8){_0x43777d=_0x3126a8;return _0x3126a8[_0x907e('0x97')](_0x502bc5[_0x907e('0x4c')]['ids'],_['omit'](_0x502bc5[_0x907e('0x4c')],[_0x907e('0x7f'),'id'])||{});}return null;})[_0x907e('0x90')](function(_0x30e205){var _0x330d1d;_0x505c23=_0x30e205||[];var _0x47b1e7=[];if(_0x30e205){for(var _0x2fa96d=0x0;_0x2fa96d<_0x30e205[_0x907e('0x3b')];_0x2fa96d+=0x1){var _0x43798a=_0x30e205[_0x2fa96d][_0x907e('0x4e')]({'plain':!![]});_0x43777d[_0x907e('0x98')]=_0x502bc5[_0x907e('0x4c')][_0x907e('0x98')]?_0x502bc5['body'][_0x907e('0x98')]:_0x43777d['dialCheckDuplicateType'];switch(_0x43777d[_0x907e('0x98')]){case'always':_0x330d1d=squel[_0x907e('0x99')]()[_0x907e('0x9a')](_0x907e('0x9b'))[_0x907e('0x9c')](['phone','scheduledAt',_0x907e('0x9d'),_0x907e('0x9e'),'VoiceQueueId',_0x907e('0x5b'),_0x907e('0x5a')],squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0x9f'),_0x907e('0x9f'))['field']('NOW()',_0x907e('0xa0'))[_0x907e('0x81')]('id','ContactId')[_0x907e('0x81')](_0x43798a['CmListId'][_0x907e('0xa1')](),_0x907e('0x9e'))['field'](_0x502bc5[_0x907e('0x49')]['id'][_0x907e('0xa1')](),_0x907e('0x61'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5b'))['field'](_0x907e('0xa2'),'updatedAt')[_0x907e('0xa3')]('cm_contacts')[_0x907e('0x40')]('deletedAt\x20IS\x20NULL')[_0x907e('0x40')](_0x907e('0xa4'),_0x43798a[_0x907e('0xa5')][_0x907e('0xa1')]())[_0x907e('0x40')](_0x907e('0xa6'))[_0x907e('0x40')](_0x907e('0xa7'),squel[_0x907e('0x80')]()[_0x907e('0x81')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x907e('0xa8'))['where'](_0x907e('0xa9'),_0x502bc5['params']['id'][_0x907e('0xa1')]()))[_0x907e('0x40')](_0x907e('0xa7'),squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0xaa'))[_0x907e('0xa3')]('cm_hopper')[_0x907e('0x40')](_0x907e('0xa9'),_0x502bc5[_0x907e('0x49')]['id'][_0x907e('0xa1')]())))['toString']();break;case _0x907e('0xab'):_0x330d1d=squel[_0x907e('0x99')]()[_0x907e('0x9a')](_0x907e('0x9b'))[_0x907e('0x9c')]([_0x907e('0x9f'),_0x907e('0xa0'),_0x907e('0x9d'),'ListId',_0x907e('0x61'),_0x907e('0x5b'),'updatedAt'],squel['select']()[_0x907e('0x81')](_0x907e('0x9f'),_0x907e('0x9f'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0xa0'))[_0x907e('0x81')]('id',_0x907e('0x9d'))[_0x907e('0x81')](_0x43798a[_0x907e('0xa5')][_0x907e('0xa1')](),_0x907e('0x9e'))[_0x907e('0x81')](_0x502bc5['params']['id'][_0x907e('0xa1')](),_0x907e('0x61'))[_0x907e('0x81')]('NOW()',_0x907e('0x5b'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5a'))[_0x907e('0xa3')]('cm_contacts')[_0x907e('0x40')]('deletedAt\x20IS\x20NULL')[_0x907e('0x40')](_0x907e('0xa4'),_0x43798a[_0x907e('0xa5')]['toString']())[_0x907e('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x907e('0x40')](_0x907e('0xa7'),squel['select']()[_0x907e('0x81')]('COALESCE(phone,\x27\x27)')[_0x907e('0xa3')]('cm_hopper')['where'](_0x907e('0xa9'),_0x502bc5[_0x907e('0x49')]['id']['toString']())))[_0x907e('0xa1')]();break;default:_0x330d1d=squel['insert']()[_0x907e('0x9a')]('cm_hopper')[_0x907e('0x9c')](['phone','scheduledAt',_0x907e('0x9d'),'ListId','VoiceQueueId',_0x907e('0x5b'),'updatedAt'],squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0x9f'),'phone')[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0xa0'))['field']('id',_0x907e('0x9d'))['field'](_0x43798a[_0x907e('0xa5')][_0x907e('0xa1')](),_0x907e('0x9e'))[_0x907e('0x81')](_0x502bc5['params']['id']['toString'](),_0x907e('0x61'))[_0x907e('0x81')]('NOW()',_0x907e('0x5b'))[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5a'))['from'](_0x907e('0xac'))[_0x907e('0x40')](_0x907e('0xad'))['where'](_0x907e('0xa4'),_0x43798a['CmListId'][_0x907e('0xa1')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x907e('0xa1')]();}_0x47b1e7[_0x907e('0xae')](db[_0x907e('0x74')][_0x907e('0x36')](_0x330d1d));}return BPromise['all'](_0x47b1e7);}})[_0x907e('0x25')](function(){return _0x505c23;})['then'](respondWithResult(_0x3f7d26,null))['catch'](handleError(_0x3f7d26,null));};exports[_0x907e('0xaf')]=function(_0x1866ab,_0x4caf0d,_0x55db9d){return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x1866ab[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x4caf0d,null))['then'](function(_0x4cbdfe){if(_0x4cbdfe){return _0x4cbdfe[_0x907e('0xaf')](_0x1866ab[_0x907e('0x36')][_0x907e('0x7f')]);}})[_0x907e('0x25')](function(_0x2dcef2){if(_0x2dcef2){return db[_0x907e('0x5f')]['destroy']({'where':{'ListId':_0x1866ab[_0x907e('0x36')][_0x907e('0x7f')],'VoiceQueueId':_0x1866ab[_0x907e('0x49')]['id']}})['then'](function(){return _0x2dcef2;});}})[_0x907e('0x25')](respondWithStatusCode(_0x4caf0d,null))[_0x907e('0x54')](handleError(_0x4caf0d,null));};exports[_0x907e('0xb0')]=function(_0x4766a3,_0x5e925e,_0x287b6){var _0x326ae7={};var _0x3c610f={};var _0x2d3234;var _0x1db873;return db[_0x907e('0x45')][_0x907e('0x63')]({'where':{'id':_0x4766a3[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x5e925e,null))[_0x907e('0x25')](function(_0x50afaf){if(_0x50afaf){_0x2d3234=_0x50afaf;_0x3c610f[_0x907e('0x3c')]=_[_0x907e('0x37')](db['CmList'][_0x907e('0x34')]);_0x3c610f[_0x907e('0x36')]=_[_0x907e('0x37')](_0x4766a3['query']);_0x3c610f[_0x907e('0x38')]=_[_0x907e('0x4a')](_0x3c610f['model'],_0x3c610f[_0x907e('0x36')]);_0x326ae7['attributes']=_[_0x907e('0x4a')](_0x3c610f[_0x907e('0x3c')],qs[_0x907e('0x39')](_0x4766a3[_0x907e('0x36')][_0x907e('0x39')]));_0x326ae7[_0x907e('0x3a')]=_0x326ae7[_0x907e('0x3a')][_0x907e('0x3b')]?_0x326ae7['attributes']:_0x3c610f[_0x907e('0x3c')];_0x326ae7['order']=qs[_0x907e('0x3f')](_0x4766a3['query'][_0x907e('0x3f')]);_0x326ae7['where']=qs[_0x907e('0x38')](_[_0x907e('0x41')](_0x4766a3[_0x907e('0x36')],_0x3c610f[_0x907e('0x38')]));if(_0x4766a3[_0x907e('0x36')][_0x907e('0x29')]){_0x326ae7[_0x907e('0x40')]=_[_0x907e('0x43')](_0x326ae7[_0x907e('0x40')],{'$or':_[_0x907e('0x2b')](_0x326ae7[_0x907e('0x3a')],function(_0x5bf90e){var _0x42c426={};_0x42c426[_0x5bf90e]={'$like':'%'+_0x4766a3['query'][_0x907e('0x29')]+'%'};return _0x42c426;})});}_0x326ae7=_[_0x907e('0x43')]({},_0x326ae7,_0x4766a3['options']);return _0x2d3234[_0x907e('0xb0')](_0x326ae7);}})['then'](function(_0x167674){if(_0x167674){_0x1db873=_0x167674[_0x907e('0x3b')];if(!_0x4766a3[_0x907e('0x36')]['hasOwnProperty'](_0x907e('0x60'))){_0x326ae7[_0x907e('0x1f')]=qs[_0x907e('0x1f')](_0x4766a3[_0x907e('0x36')][_0x907e('0x1f')]);_0x326ae7[_0x907e('0x1d')]=qs[_0x907e('0x1d')](_0x4766a3[_0x907e('0x36')][_0x907e('0x1d')]);}return _0x2d3234[_0x907e('0xb0')](_0x326ae7);}})[_0x907e('0x25')](function(_0x2e527f){if(_0x2e527f){return _0x2e527f?{'count':_0x1db873,'rows':_0x2e527f}:null;}})['then'](respondWithResult(_0x5e925e,null))['catch'](handleError(_0x5e925e,null));};exports[_0x907e('0xb1')]=function(_0x1d85a9,_0x13ce25,_0x55b148){var _0x328b27,_0x36b88e;return db[_0x907e('0x45')]['find']({'where':{'id':_0x1d85a9[_0x907e('0x49')]['id']}})['then'](handleEntityNotFound(_0x13ce25,null))[_0x907e('0x25')](function(_0x3198d6){if(_0x3198d6){_0x36b88e=_0x3198d6;return _0x3198d6['addBlackLists'](_0x1d85a9[_0x907e('0x4c')][_0x907e('0x7f')],_[_0x907e('0x59')](_0x1d85a9[_0x907e('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x16911d){var _0x37289e;_0x328b27=_0x16911d||[];var _0x5e0919=[];if(_0x16911d){for(var _0x4b2ee2=0x0;_0x4b2ee2<_0x16911d[_0x907e('0x3b')];_0x4b2ee2+=0x1){var _0xff6bad=_0x16911d[_0x4b2ee2][_0x907e('0x4e')]({'plain':!![]});_0x37289e=squel[_0x907e('0x99')]()[_0x907e('0x9a')](_0x907e('0xb2'))[_0x907e('0x9c')]([_0x907e('0x9f'),'ContactId',_0x907e('0x9e'),_0x907e('0x61'),_0x907e('0x5b'),_0x907e('0x5a')],squel[_0x907e('0x80')]()[_0x907e('0x81')](_0x907e('0x9f'),_0x907e('0x9f'))[_0x907e('0x81')]('id',_0x907e('0x9d'))[_0x907e('0x81')](_0xff6bad[_0x907e('0xa5')][_0x907e('0xa1')](),'ListId')[_0x907e('0x81')](_0x1d85a9[_0x907e('0x49')]['id'][_0x907e('0xa1')](),'VoiceQueueId')[_0x907e('0x81')](_0x907e('0xa2'),_0x907e('0x5b'))[_0x907e('0x81')]('NOW()',_0x907e('0x5a'))['from']('cm_contacts')[_0x907e('0x40')](_0x907e('0xad'))['where'](_0x907e('0xa4'),_0xff6bad[_0x907e('0xa5')][_0x907e('0xa1')]())[_0x907e('0x40')](_0x907e('0xa6')))['toString']();_0x5e0919[_0x907e('0xae')](db['sequelize'][_0x907e('0x36')](_0x37289e));}return BPromise[_0x907e('0x8c')](_0x5e0919);}})[_0x907e('0x25')](function(){return _0x328b27;})['then'](respondWithResult(_0x13ce25,null))[_0x907e('0x54')](handleError(_0x13ce25,null));};exports[_0x907e('0xb3')]=function(_0x1fc5d9,_0x294d5b,_0x426e92){return db[_0x907e('0x45')][_0x907e('0x52')]({'where':{'id':_0x1fc5d9[_0x907e('0x49')]['id']}})[_0x907e('0x25')](handleEntityNotFound(_0x294d5b,null))[_0x907e('0x25')](function(_0x115e8b){if(_0x115e8b){return _0x115e8b[_0x907e('0xb3')](_0x1fc5d9['query'][_0x907e('0x7f')]);}})[_0x907e('0x25')](function(_0x2a008c){if(_0x2a008c){return db[_0x907e('0x67')]['destroy']({'where':{'ListId':_0x1fc5d9[_0x907e('0x36')][_0x907e('0x7f')],'VoiceQueueId':_0x1fc5d9[_0x907e('0x49')]['id']}})[_0x907e('0x25')](function(){return _0x2a008c;});}})[_0x907e('0x25')](respondWithStatusCode(_0x294d5b,null))['catch'](handleError(_0x294d5b,null));}; \ No newline at end of file +var _0xfd6c=['phone','scheduledAt','ListId','NOW()','ContactId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','catch','show','params','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','body','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','order','VoiceQueueId','CmHopper','findOne','CmHopperHistory','nolimit','rows','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','isNil','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','isEmpty','isArray','emit','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery'];(function(_0x346df1,_0x10fe5d){var _0xba7da6=function(_0x2a75c6){while(--_0x2a75c6){_0x346df1['push'](_0x346df1['shift']());}};_0xba7da6(++_0x10fe5d);}(_0xfd6c,0x18e));var _0xcfd6=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xfd6c[_0x40ddc0];return _0x1aebf1;};'use strict';var emlformat=require(_0xcfd6('0x0'));var rimraf=require(_0xcfd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcfd6('0x2'));var rp=require(_0xcfd6('0x3'));var moment=require(_0xcfd6('0x4'));var BPromise=require(_0xcfd6('0x5'));var Mustache=require(_0xcfd6('0x6'));var util=require(_0xcfd6('0x7'));var path=require(_0xcfd6('0x8'));var sox=require(_0xcfd6('0x9'));var csv=require('to-csv');var ejs=require(_0xcfd6('0xa'));var fs=require('fs');var fs_extra=require(_0xcfd6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcfd6('0xc'));var jsforce=require(_0xcfd6('0xd'));var deskjs=require(_0xcfd6('0xe'));var toCsv=require(_0xcfd6('0xf'));var querystring=require('querystring');var Papa=require(_0xcfd6('0x10'));var Redis=require(_0xcfd6('0x11'));var authService=require(_0xcfd6('0x12'));var qs=require(_0xcfd6('0x13'));var as=require(_0xcfd6('0x14'));var hardwareService=require(_0xcfd6('0x15'));var logger=require(_0xcfd6('0x16'))(_0xcfd6('0x17'));var utils=require(_0xcfd6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcfd6('0x19'));var db=require(_0xcfd6('0x1a'))['db'];config[_0xcfd6('0x1b')]=_[_0xcfd6('0x1c')](config[_0xcfd6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcfd6('0x1d'))(new Redis(config[_0xcfd6('0x1b')]));require('./voiceQueue.socket')[_0xcfd6('0x1e')](socket);function respondWithStatusCode(_0x4d42ab,_0x2ac2d6){_0x2ac2d6=_0x2ac2d6||0xcc;return function(_0x2c88bc){if(_0x2c88bc){return _0x4d42ab[_0xcfd6('0x1f')](_0x2ac2d6);}return _0x4d42ab[_0xcfd6('0x20')](_0x2ac2d6)[_0xcfd6('0x21')]();};}function respondWithResult(_0x44b876,_0x301f8f){_0x301f8f=_0x301f8f||0xc8;return function(_0x463eef){if(_0x463eef){return _0x44b876[_0xcfd6('0x20')](_0x301f8f)[_0xcfd6('0x22')](_0x463eef);}};}function respondWithFilteredResult(_0x48346d,_0x21cb40){return function(_0x23313a){if(_0x23313a){var _0x505d06=typeof _0x21cb40[_0xcfd6('0x23')]===_0xcfd6('0x24')&&typeof _0x21cb40[_0xcfd6('0x25')]==='undefined';var _0x4dd7ec=_0x23313a[_0xcfd6('0x26')];var _0x233dbe=_0x505d06?0x0:_0x21cb40[_0xcfd6('0x23')];var _0x14103c=_0x505d06?_0x23313a[_0xcfd6('0x26')]:_0x21cb40['offset']+_0x21cb40[_0xcfd6('0x25')];var _0x40939b;if(_0x14103c>=_0x4dd7ec){_0x14103c=_0x4dd7ec;_0x40939b=0xc8;}else{_0x40939b=0xce;}_0x48346d[_0xcfd6('0x20')](_0x40939b);return _0x48346d['set'](_0xcfd6('0x27'),_0x233dbe+'-'+_0x14103c+'/'+_0x4dd7ec)[_0xcfd6('0x22')](_0x23313a);}return null;};}function patchUpdates(_0x3e4362){return function(_0x4b62d9){try{jsonpatch[_0xcfd6('0x28')](_0x4b62d9,_0x3e4362,!![]);}catch(_0x2e8ff3){return BPromise[_0xcfd6('0x29')](_0x2e8ff3);}return _0x4b62d9[_0xcfd6('0x2a')]();};}function saveUpdates(_0x1c23d9,_0x56e726){return function(_0x2d8597){if(_0x2d8597){return _0x2d8597[_0xcfd6('0x2b')](_0x1c23d9)[_0xcfd6('0x2c')](function(_0x476490){return _0x476490;});}return null;};}function removeEntity(_0x5030e9,_0x2ddfa3){return function(_0x1e1ada){if(_0x1e1ada){return _0x1e1ada[_0xcfd6('0x2d')]()[_0xcfd6('0x2c')](function(){var _0x496c8a=_0x1e1ada[_0xcfd6('0x2e')]({'plain':!![]});var _0x4f8207=[{'name':_0xcfd6('0x2f'),'value':_0xcfd6('0x30'),'ignore':![]},{'name':'QueueCampaigns','value':_0xcfd6('0x31'),'ignore':![]}];var _0x49935c=_(_0x4f8207)[_0xcfd6('0x32')](_0xcfd6('0x33'))[_0xcfd6('0x34')]('value')[_0xcfd6('0x35')]();if(_['includes'](_0x49935c,_0x496c8a[_0xcfd6('0x36')])){return;}var _0x4c0928=_[_0xcfd6('0x37')](_0x4f8207,['value',_0x496c8a['type']])[_0xcfd6('0x38')];return db[_0xcfd6('0x39')][_0xcfd6('0x2d')]({'where':{'type':_0x4c0928,'resourceId':_0x496c8a['id']}})[_0xcfd6('0x2c')](function(){return _0x1e1ada;});})['then'](function(){_0x5030e9[_0xcfd6('0x20')](0xcc)[_0xcfd6('0x21')]();});}};}function handleEntityNotFound(_0x488794,_0x39e780){return function(_0xcda4da){if(!_0xcda4da){_0x488794[_0xcfd6('0x1f')](0x194);}return _0xcda4da;};}function handleError(_0x474c82,_0x15e9e1){_0x15e9e1=_0x15e9e1||0x1f4;return function(_0x100e42){logger[_0xcfd6('0x3a')](_0x100e42[_0xcfd6('0x3b')]);if(_0x100e42[_0xcfd6('0x38')]){delete _0x100e42['name'];}_0x474c82[_0xcfd6('0x20')](_0x15e9e1)[_0xcfd6('0x3c')](_0x100e42);};}exports[_0xcfd6('0x3d')]=function(_0xdcb1d8,_0x304b7f){var _0x59f644={},_0x4f958f={},_0xb17b84={'count':0x0,'rows':[]};var _0x43374c=_[_0xcfd6('0x34')](db[_0xcfd6('0x3e')]['rawAttributes'],function(_0x122407){return{'name':_0x122407['fieldName'],'type':_0x122407[_0xcfd6('0x36')][_0xcfd6('0x3f')]};});_0x4f958f['model']=_['map'](_0x43374c,'name');_0x4f958f['query']=_[_0xcfd6('0x40')](_0xdcb1d8[_0xcfd6('0x41')]);_0x4f958f[_0xcfd6('0x42')]=_['intersection'](_0x4f958f[_0xcfd6('0x43')],_0x4f958f[_0xcfd6('0x41')]);_0x59f644[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x4f958f['model'],qs['fields'](_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x59f644[_0xcfd6('0x44')]=_0x59f644['attributes'][_0xcfd6('0x47')]?_0x59f644[_0xcfd6('0x44')]:_0x4f958f[_0xcfd6('0x43')];if(!_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x48')]('nolimit')){_0x59f644[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0x59f644[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x23')]);}_0x59f644['order']=qs[_0xcfd6('0x49')](_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x49')]);_0x59f644[_0xcfd6('0x4a')]=qs['filters'](_[_0xcfd6('0x4b')](_0xdcb1d8['query'],_0x4f958f[_0xcfd6('0x42')]),_0x43374c);if(_0xdcb1d8[_0xcfd6('0x41')]['filter']){_0x59f644['where']=_[_0xcfd6('0x4c')](_0x59f644[_0xcfd6('0x4a')],{'$or':_[_0xcfd6('0x34')](_0x43374c,function(_0x2cf140){if(_0x2cf140[_0xcfd6('0x36')]!==_0xcfd6('0x4d')){var _0x5bf25e={};_0x5bf25e[_0x2cf140[_0xcfd6('0x38')]]={'$like':'%'+_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x32')]+'%'};return _0x5bf25e;}})});}_0x59f644=_[_0xcfd6('0x4c')]({},_0x59f644,_0xdcb1d8[_0xcfd6('0x4e')]);var _0x1fe612={'where':_0x59f644['where']};return db[_0xcfd6('0x3e')][_0xcfd6('0x26')](_0x1fe612)[_0xcfd6('0x2c')](function(_0x520268){_0xb17b84['count']=_0x520268;if(_0xdcb1d8[_0xcfd6('0x41')][_0xcfd6('0x4f')]){_0x59f644['include']=[{'all':!![]}];}return db[_0xcfd6('0x3e')]['findAll'](_0x59f644);})[_0xcfd6('0x2c')](function(_0x4320d6){_0xb17b84['rows']=_0x4320d6;return _0xb17b84;})[_0xcfd6('0x2c')](respondWithFilteredResult(_0x304b7f,_0x59f644))[_0xcfd6('0x50')](handleError(_0x304b7f,null));};exports[_0xcfd6('0x51')]=function(_0x200659,_0x3ff948){var _0x24515e={'raw':![],'where':{'id':_0x200659[_0xcfd6('0x52')]['id']}},_0x5a0bef={};_0x5a0bef[_0xcfd6('0x43')]=_['keys'](db[_0xcfd6('0x3e')][_0xcfd6('0x53')]);_0x5a0bef[_0xcfd6('0x41')]=_['keys'](_0x200659[_0xcfd6('0x41')]);_0x5a0bef[_0xcfd6('0x42')]=_[_0xcfd6('0x45')](_0x5a0bef['model'],_0x5a0bef[_0xcfd6('0x41')]);_0x24515e[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x5a0bef[_0xcfd6('0x43')],qs[_0xcfd6('0x46')](_0x200659[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x24515e[_0xcfd6('0x44')]=_0x24515e[_0xcfd6('0x44')][_0xcfd6('0x47')]?_0x24515e[_0xcfd6('0x44')]:_0x5a0bef[_0xcfd6('0x43')];if(_0x200659[_0xcfd6('0x41')][_0xcfd6('0x4f')]){_0x24515e[_0xcfd6('0x54')]=[{'all':!![]}];}_0x24515e=_[_0xcfd6('0x4c')]({},_0x24515e,_0x200659[_0xcfd6('0x4e')]);return db[_0xcfd6('0x3e')][_0xcfd6('0x37')](_0x24515e)[_0xcfd6('0x2c')](handleEntityNotFound(_0x3ff948,null))[_0xcfd6('0x2c')](respondWithResult(_0x3ff948,null))[_0xcfd6('0x50')](handleError(_0x3ff948,null));};exports[_0xcfd6('0x55')]=function(_0x42ab17,_0x6b5631){return db[_0xcfd6('0x3e')]['create'](_0x42ab17['body'],{})[_0xcfd6('0x2c')](function(_0x55ef70){var _0x5a36b9=_0x42ab17[_0xcfd6('0x56')][_0xcfd6('0x2e')]({'plain':!![]});if(!_0x5a36b9)throw new Error(_0xcfd6('0x57'));if(_0x5a36b9[_0xcfd6('0x58')]==='user'){var _0x473f5c=_0x55ef70[_0xcfd6('0x2e')]({'plain':!![]});var _0x643233=[{'name':_0xcfd6('0x2f'),'value':_0xcfd6('0x30')},{'name':_0xcfd6('0x59'),'value':'outbound'}];var _0x3dbb86=_[_0xcfd6('0x37')](_0x643233,[_0xcfd6('0x35'),_0x473f5c['type']])[_0xcfd6('0x38')];return db[_0xcfd6('0x5a')][_0xcfd6('0x37')]({'where':{'name':_0x3dbb86,'userProfileId':_0x5a36b9['userProfileId']},'raw':!![]})[_0xcfd6('0x2c')](function(_0x29e931){if(_0x29e931&&_0x29e931[_0xcfd6('0x5b')]===0x0){return db['UserProfileResource'][_0xcfd6('0x55')]({'name':_0x473f5c['name'],'resourceId':_0x473f5c['id'],'type':_0x29e931['name'],'sectionId':_0x29e931['id']},{})[_0xcfd6('0x2c')](function(){return _0x55ef70;});}else{return _0x55ef70;}})[_0xcfd6('0x50')](function(_0x5778e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5778e5);throw _0x5778e5;});}return _0x55ef70;})[_0xcfd6('0x2c')](respondWithResult(_0x6b5631,0xc9))['catch'](handleError(_0x6b5631,null));};exports[_0xcfd6('0x5c')]=function(_0x54fcea,_0xb1457b){var _0x5be85={'where':{'id':_0x54fcea['params']['id']}},_0x256192={};_0x256192['model']=_[_0xcfd6('0x40')](db[_0xcfd6('0x3e')][_0xcfd6('0x53')]);_0x5be85[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x256192[_0xcfd6('0x43')],qs[_0xcfd6('0x46')](_0x54fcea[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x5be85[_0xcfd6('0x44')]=_0x5be85[_0xcfd6('0x44')][_0xcfd6('0x47')]?_0x5be85[_0xcfd6('0x44')]:_0x256192[_0xcfd6('0x43')];if(_0x54fcea[_0xcfd6('0x41')][_0xcfd6('0x4f')]){_0x5be85['include']=[{'all':!![]}];}_0x5be85=_['merge']({},_0x5be85,_0x54fcea[_0xcfd6('0x4e')]);return db['VoiceQueue'][_0xcfd6('0x37')](_0x5be85)[_0xcfd6('0x2c')](handleEntityNotFound(_0xb1457b,null))[_0xcfd6('0x2c')](function(_0x4c295c){if(_0x4c295c){var _0x12ffef=_0x4c295c[_0xcfd6('0x2e')]({'plain':!![]});_0x12ffef=qs[_0xcfd6('0x5d')](_0x12ffef,['id',_0xcfd6('0x5e'),_0xcfd6('0x5f')]);_0x54fcea[_0xcfd6('0x60')]=_[_0xcfd6('0x5d')](_0x54fcea[_0xcfd6('0x60')],['id',_0xcfd6('0x5e'),_0xcfd6('0x5f')]);return db[_0xcfd6('0x3e')][_0xcfd6('0x55')](_['merge'](_0x12ffef,_0x54fcea[_0xcfd6('0x60')]),{'include':_0x54fcea[_0xcfd6('0x41')]['includeAll']?[{'all':!![]}]:undefined})[_0xcfd6('0x2c')](function(_0x7997c8){var _0x26f9b9=_0x54fcea[_0xcfd6('0x56')]['get']({'plain':!![]});if(!_0x26f9b9)throw new Error(_0xcfd6('0x57'));if(_0x26f9b9['role']===_0xcfd6('0x56')){var _0x1a8a5b=_0x7997c8[_0xcfd6('0x2e')]({'plain':!![]});var _0x25cbf9=[{'name':_0xcfd6('0x2f'),'value':'inbound'},{'name':_0xcfd6('0x59'),'value':'outbound'}];var _0x102301=_['find'](_0x25cbf9,[_0xcfd6('0x35'),_0x1a8a5b[_0xcfd6('0x36')]])[_0xcfd6('0x38')];return db['UserProfileSection'][_0xcfd6('0x37')]({'where':{'name':_0x102301,'userProfileId':_0x26f9b9[_0xcfd6('0x61')]},'raw':!![]})[_0xcfd6('0x2c')](function(_0x810b5c){if(_0x810b5c&&_0x810b5c['autoAssociation']===0x0){return db[_0xcfd6('0x39')][_0xcfd6('0x55')]({'name':_0x1a8a5b['name'],'resourceId':_0x1a8a5b['id'],'type':_0x810b5c['name'],'sectionId':_0x810b5c['id']},{})[_0xcfd6('0x2c')](function(){return _0x7997c8;});}else{return _0x7997c8;}})['catch'](function(_0x5b058d){logger[_0xcfd6('0x3a')](_0xcfd6('0x62'),_0x5b058d);throw _0x5b058d;});}return _0x7997c8;});}})[_0xcfd6('0x2c')](respondWithResult(_0xb1457b,0xc9))['catch'](handleError(_0xb1457b,null));};exports['update']=function(_0x357270,_0x47ef18){if(_0x357270['body']['id']){delete _0x357270['body']['id'];}return db[_0xcfd6('0x3e')][_0xcfd6('0x37')]({'where':{'id':_0x357270[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x47ef18,null))[_0xcfd6('0x2c')](saveUpdates(_0x357270['body'],null))[_0xcfd6('0x2c')](respondWithResult(_0x47ef18,null))['catch'](handleError(_0x47ef18,null));};exports[_0xcfd6('0x2d')]=function(_0x57e7c1,_0x5e70e1){return db[_0xcfd6('0x3e')]['find']({'where':{'id':_0x57e7c1['params']['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x5e70e1,null))[_0xcfd6('0x2c')](removeEntity(_0x5e70e1,null))[_0xcfd6('0x50')](handleError(_0x5e70e1,null));};exports[_0xcfd6('0x63')]=function(_0x3dbdbc,_0x5ef39f,_0x242f39){var _0x1b8804={'raw':![],'where':{}};var _0x180510={};var _0x7a128c={'count':0x0,'rows':[]};return db[_0xcfd6('0x3e')]['findOne']({'where':{'id':_0x3dbdbc['params']['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x5ef39f,null))[_0xcfd6('0x2c')](function(_0x2e285e){if(_0x2e285e){_0x180510['model']=_['keys'](db['CmHopper']['rawAttributes']);_0x180510[_0xcfd6('0x41')]=_[_0xcfd6('0x40')](_0x3dbdbc[_0xcfd6('0x41')]);_0x180510['filters']=_['intersection'](_0x180510['model'],_0x180510[_0xcfd6('0x41')]);_0x1b8804[_0xcfd6('0x44')]=_['intersection'](_0x180510['model'],qs[_0xcfd6('0x46')](_0x3dbdbc[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x1b8804[_0xcfd6('0x44')]=_0x1b8804[_0xcfd6('0x44')]['length']?_0x1b8804[_0xcfd6('0x44')]:_0x180510['model'];if(!_0x3dbdbc['query'][_0xcfd6('0x48')]('nolimit')){_0x1b8804[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0x3dbdbc[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0x1b8804[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x3dbdbc[_0xcfd6('0x41')][_0xcfd6('0x23')]);}_0x1b8804[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x3dbdbc['query'][_0xcfd6('0x49')]);_0x1b8804[_0xcfd6('0x4a')]=qs[_0xcfd6('0x42')](_[_0xcfd6('0x4b')](_0x3dbdbc['query'],_0x180510[_0xcfd6('0x42')]));_0x1b8804[_0xcfd6('0x4a')][_0xcfd6('0x65')]=_0x2e285e['id'];if(_0x3dbdbc['query']['filter']){_0x1b8804[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x1b8804[_0xcfd6('0x4a')],{'$or':_[_0xcfd6('0x34')](_0x1b8804[_0xcfd6('0x44')],function(_0x522723){var _0x557236={};_0x557236[_0x522723]={'$like':'%'+_0x3dbdbc[_0xcfd6('0x41')]['filter']+'%'};return _0x557236;})});}_0x1b8804=_[_0xcfd6('0x4c')]({},_0x1b8804,_0x3dbdbc[_0xcfd6('0x4e')]);return db['CmHopper'][_0xcfd6('0x26')]({'where':_0x1b8804[_0xcfd6('0x4a')]})['then'](function(_0x1c95f3){_0x7a128c['count']=_0x1c95f3;if(_0x3dbdbc['query'][_0xcfd6('0x4f')]){_0x1b8804[_0xcfd6('0x54')]=[{'all':!![]}];}return db[_0xcfd6('0x66')]['findAll'](_0x1b8804);})[_0xcfd6('0x2c')](function(_0x4ae907){_0x7a128c['rows']=_0x4ae907;return _0x7a128c;});}})[_0xcfd6('0x2c')](respondWithFilteredResult(_0x5ef39f,_0x1b8804))['catch'](handleError(_0x5ef39f,null));};exports['getHopperHistories']=function(_0x145f1a,_0x235d8f,_0x130963){var _0x767eca={'raw':!![],'where':{}};var _0x3b5626={};var _0x1da5b4={'count':0x0,'rows':[]};return db[_0xcfd6('0x3e')][_0xcfd6('0x67')]({'where':{'id':_0x145f1a[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x235d8f,null))['then'](function(_0x49811c){if(_0x49811c){_0x3b5626[_0xcfd6('0x43')]=_[_0xcfd6('0x40')](db[_0xcfd6('0x68')]['rawAttributes']);_0x3b5626['query']=_[_0xcfd6('0x40')](_0x145f1a[_0xcfd6('0x41')]);_0x3b5626[_0xcfd6('0x42')]=_[_0xcfd6('0x45')](_0x3b5626[_0xcfd6('0x43')],_0x3b5626['query']);_0x767eca['attributes']=_[_0xcfd6('0x45')](_0x3b5626['model'],qs[_0xcfd6('0x46')](_0x145f1a[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x767eca[_0xcfd6('0x44')]=_0x767eca['attributes'][_0xcfd6('0x47')]?_0x767eca['attributes']:_0x3b5626[_0xcfd6('0x43')];if(!_0x145f1a[_0xcfd6('0x41')][_0xcfd6('0x48')](_0xcfd6('0x69'))){_0x767eca[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0x145f1a[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0x767eca[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x145f1a['query']['offset']);}_0x767eca[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x145f1a[_0xcfd6('0x41')][_0xcfd6('0x49')]);_0x767eca[_0xcfd6('0x4a')]=qs[_0xcfd6('0x42')](_['pick'](_0x145f1a[_0xcfd6('0x41')],_0x3b5626[_0xcfd6('0x42')]));_0x767eca['where'][_0xcfd6('0x65')]=_0x49811c['id'];if(_0x145f1a[_0xcfd6('0x41')][_0xcfd6('0x32')]){_0x767eca[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x767eca[_0xcfd6('0x4a')],{'$or':_[_0xcfd6('0x34')](_0x767eca[_0xcfd6('0x44')],function(_0x14b9ca){var _0x4416ee={};_0x4416ee[_0x14b9ca]={'$like':'%'+_0x145f1a['query'][_0xcfd6('0x32')]+'%'};return _0x4416ee;})});}_0x767eca=_[_0xcfd6('0x4c')]({},_0x767eca,_0x145f1a[_0xcfd6('0x4e')]);return db[_0xcfd6('0x68')][_0xcfd6('0x26')]({'where':_0x767eca[_0xcfd6('0x4a')]})[_0xcfd6('0x2c')](function(_0x2e065d){_0x1da5b4[_0xcfd6('0x26')]=_0x2e065d;if(_0x145f1a[_0xcfd6('0x41')][_0xcfd6('0x4f')]){_0x767eca[_0xcfd6('0x54')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x767eca);})[_0xcfd6('0x2c')](function(_0x1ff877){_0x1da5b4[_0xcfd6('0x6a')]=_0x1ff877;return _0x1da5b4;});}})[_0xcfd6('0x2c')](respondWithFilteredResult(_0x235d8f,_0x767eca))[_0xcfd6('0x50')](handleError(_0x235d8f,null));};exports[_0xcfd6('0x6b')]=function(_0x2d9de5,_0x5a2b3f,_0x532ef0){var _0x40ab2e={'raw':!![],'where':{}};var _0x5dd503={};var _0x4b05ed={'count':0x0,'rows':[]};return db[_0xcfd6('0x3e')][_0xcfd6('0x67')]({'where':{'id':_0x2d9de5[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x5a2b3f,null))[_0xcfd6('0x2c')](function(_0x1d8e7f){if(_0x1d8e7f){_0x5dd503[_0xcfd6('0x43')]=_['keys'](db[_0xcfd6('0x6c')][_0xcfd6('0x53')]);_0x5dd503['query']=_['keys'](_0x2d9de5[_0xcfd6('0x41')]);_0x5dd503[_0xcfd6('0x42')]=_[_0xcfd6('0x45')](_0x5dd503[_0xcfd6('0x43')],_0x5dd503[_0xcfd6('0x41')]);_0x40ab2e[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x5dd503[_0xcfd6('0x43')],qs['fields'](_0x2d9de5[_0xcfd6('0x41')]['fields']));_0x40ab2e[_0xcfd6('0x44')]=_0x40ab2e['attributes'][_0xcfd6('0x47')]?_0x40ab2e[_0xcfd6('0x44')]:_0x5dd503[_0xcfd6('0x43')];if(!_0x2d9de5[_0xcfd6('0x41')][_0xcfd6('0x48')]('nolimit')){_0x40ab2e[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0x2d9de5[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0x40ab2e[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x2d9de5['query'][_0xcfd6('0x23')]);}_0x40ab2e[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x2d9de5[_0xcfd6('0x41')][_0xcfd6('0x49')]);_0x40ab2e['where']=qs[_0xcfd6('0x42')](_['pick'](_0x2d9de5['query'],_0x5dd503[_0xcfd6('0x42')]));_0x40ab2e[_0xcfd6('0x4a')]['VoiceQueueId']=_0x1d8e7f['id'];if(_0x2d9de5[_0xcfd6('0x41')]['filter']){_0x40ab2e[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x40ab2e['where'],{'$or':_[_0xcfd6('0x34')](_0x40ab2e[_0xcfd6('0x44')],function(_0x552fb5){var _0x2e3660={};_0x2e3660[_0x552fb5]={'$like':'%'+_0x2d9de5[_0xcfd6('0x41')][_0xcfd6('0x32')]+'%'};return _0x2e3660;})});}_0x40ab2e=_['merge']({},_0x40ab2e,_0x2d9de5[_0xcfd6('0x4e')]);return db[_0xcfd6('0x6c')][_0xcfd6('0x26')]({'where':_0x40ab2e[_0xcfd6('0x4a')]})['then'](function(_0x175376){_0x4b05ed[_0xcfd6('0x26')]=_0x175376;if(_0x2d9de5[_0xcfd6('0x41')][_0xcfd6('0x4f')]){_0x40ab2e['include']=[{'all':!![]}];}return db[_0xcfd6('0x6c')][_0xcfd6('0x6d')](_0x40ab2e);})[_0xcfd6('0x2c')](function(_0x12d997){_0x4b05ed['rows']=_0x12d997;return _0x4b05ed;});}})[_0xcfd6('0x2c')](respondWithFilteredResult(_0x5a2b3f,_0x40ab2e))[_0xcfd6('0x50')](handleError(_0x5a2b3f,null));};exports[_0xcfd6('0x6e')]=function(_0x1615ed,_0x52ecf8,_0x3c12ca){var _0xd739d8={'raw':!![],'where':{}};var _0x5d8a20={};var _0x347537={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x1615ed[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x52ecf8,null))[_0xcfd6('0x2c')](function(_0x3c43a2){if(_0x3c43a2){_0x5d8a20[_0xcfd6('0x43')]=_[_0xcfd6('0x40')](db[_0xcfd6('0x6f')][_0xcfd6('0x53')]);_0x5d8a20[_0xcfd6('0x41')]=_[_0xcfd6('0x40')](_0x1615ed[_0xcfd6('0x41')]);_0x5d8a20['filters']=_[_0xcfd6('0x45')](_0x5d8a20['model'],_0x5d8a20[_0xcfd6('0x41')]);_0xd739d8[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x5d8a20[_0xcfd6('0x43')],qs['fields'](_0x1615ed[_0xcfd6('0x41')]['fields']));_0xd739d8[_0xcfd6('0x44')]=_0xd739d8[_0xcfd6('0x44')]['length']?_0xd739d8['attributes']:_0x5d8a20[_0xcfd6('0x43')];if(!_0x1615ed[_0xcfd6('0x41')][_0xcfd6('0x48')](_0xcfd6('0x69'))){_0xd739d8[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0x1615ed[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0xd739d8[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x1615ed['query'][_0xcfd6('0x23')]);}_0xd739d8[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x1615ed[_0xcfd6('0x41')][_0xcfd6('0x49')]);_0xd739d8[_0xcfd6('0x4a')]=qs[_0xcfd6('0x42')](_['pick'](_0x1615ed['query'],_0x5d8a20['filters']));_0xd739d8[_0xcfd6('0x4a')]['VoiceQueueId']=_0x3c43a2['id'];if(_0x1615ed[_0xcfd6('0x41')][_0xcfd6('0x32')]){_0xd739d8[_0xcfd6('0x4a')]=_['merge'](_0xd739d8['where'],{'$or':_[_0xcfd6('0x34')](_0xd739d8[_0xcfd6('0x44')],function(_0x1045b3){var _0x1daa63={};_0x1daa63[_0x1045b3]={'$like':'%'+_0x1615ed['query'][_0xcfd6('0x32')]+'%'};return _0x1daa63;})});}_0xd739d8=_['merge']({},_0xd739d8,_0x1615ed['options']);return db['CmHopperBlack'][_0xcfd6('0x26')]({'where':_0xd739d8['where']})[_0xcfd6('0x2c')](function(_0x329c10){_0x347537[_0xcfd6('0x26')]=_0x329c10;if(_0x1615ed['query'][_0xcfd6('0x4f')]){_0xd739d8[_0xcfd6('0x54')]=[{'all':!![]}];}return db[_0xcfd6('0x6f')][_0xcfd6('0x6d')](_0xd739d8);})[_0xcfd6('0x2c')](function(_0x226b15){_0x347537['rows']=_0x226b15;return _0x347537;});}})['then'](respondWithFilteredResult(_0x52ecf8,_0xd739d8))[_0xcfd6('0x50')](handleError(_0x52ecf8,null));};exports[_0xcfd6('0x70')]=function(_0x31630e,_0x352e3e,_0x1ad4dd){var _0x3098f6={};var _0x4c5d5e={};var _0x39a0c9;var _0x286133;return db[_0xcfd6('0x3e')][_0xcfd6('0x67')]({'where':{'id':_0x31630e['params']['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x352e3e,null))[_0xcfd6('0x2c')](function(_0xe949f8){if(_0xe949f8){_0x39a0c9=_0xe949f8;_0x4c5d5e['model']=_[_0xcfd6('0x40')](db['Team'][_0xcfd6('0x53')]);_0x4c5d5e[_0xcfd6('0x41')]=_['keys'](_0x31630e[_0xcfd6('0x41')]);_0x4c5d5e[_0xcfd6('0x42')]=_['intersection'](_0x4c5d5e['model'],_0x4c5d5e[_0xcfd6('0x41')]);_0x3098f6[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x4c5d5e['model'],qs[_0xcfd6('0x46')](_0x31630e[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x3098f6[_0xcfd6('0x44')]=_0x3098f6[_0xcfd6('0x44')][_0xcfd6('0x47')]?_0x3098f6['attributes']:_0x4c5d5e['model'];_0x3098f6[_0xcfd6('0x64')]=qs['sort'](_0x31630e['query'][_0xcfd6('0x49')]);_0x3098f6[_0xcfd6('0x4a')]=qs[_0xcfd6('0x42')](_[_0xcfd6('0x4b')](_0x31630e['query'],_0x4c5d5e[_0xcfd6('0x42')]));if(_0x31630e[_0xcfd6('0x41')][_0xcfd6('0x32')]){_0x3098f6[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x3098f6['where'],{'$or':_['map'](_0x3098f6[_0xcfd6('0x44')],function(_0x55a580){var _0x3eb5ab={};_0x3eb5ab[_0x55a580]={'$like':'%'+_0x31630e[_0xcfd6('0x41')]['filter']+'%'};return _0x3eb5ab;})});}_0x3098f6=_[_0xcfd6('0x4c')]({},_0x3098f6,_0x31630e['options']);return _0x39a0c9['getTeams'](_0x3098f6);}})[_0xcfd6('0x2c')](function(_0x18286f){if(_0x18286f){_0x286133=_0x18286f[_0xcfd6('0x47')];if(!_0x31630e[_0xcfd6('0x41')]['hasOwnProperty'](_0xcfd6('0x69'))){_0x3098f6[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0x31630e['query'][_0xcfd6('0x25')]);_0x3098f6[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x31630e[_0xcfd6('0x41')][_0xcfd6('0x23')]);}return _0x39a0c9['getTeams'](_0x3098f6);}})[_0xcfd6('0x2c')](function(_0x1f73a5){if(_0x1f73a5){return _0x1f73a5?{'count':_0x286133,'rows':_0x1f73a5}:null;}})[_0xcfd6('0x2c')](respondWithResult(_0x352e3e,null))[_0xcfd6('0x50')](handleError(_0x352e3e,null));};exports['addTeams']=function(_0x66e0c,_0x4383c2,_0x1ffb27){var _0x6db1d9=_0x66e0c[_0xcfd6('0x60')][_0xcfd6('0x71')];var _0x5b347c=_[_0xcfd6('0x34')](_0x6db1d9,'id');return db[_0xcfd6('0x72')]['findAll']({'where':{'id':_0x5b347c},'attributes':['id'],'include':[{'model':db[_0xcfd6('0x73')],'as':_0xcfd6('0x74'),'attributes':['id',_0xcfd6('0x38'),_0xcfd6('0x75'),_0xcfd6('0x76'),_0xcfd6('0x77')],'raw':!![]}]})[_0xcfd6('0x2c')](function(_0x55cd13){if(_0x55cd13){var _0x32a894=_[_0xcfd6('0x78')](_0x55cd13,function(_0x19c2fb){var _0x660dbb=_0x19c2fb[_0xcfd6('0x2e')]({'plain':!![]});_0x660dbb[_0xcfd6('0x74')]['forEach'](function(_0x2d8f28){_0x2d8f28['penalty']=_[_0xcfd6('0x37')](_0x6db1d9,{'id':_0x660dbb['id']})[_0xcfd6('0x79')];});return _0x660dbb['Agents'];});return db[_0xcfd6('0x3e')][_0xcfd6('0x37')]({'where':{'id':_0x66e0c['params']['id']}})[_0xcfd6('0x2c')](function(_0x572277){return db[_0xcfd6('0x7a')][_0xcfd6('0x7b')](function(_0x36bdd2){return _0x572277[_0xcfd6('0x7c')](_0x5b347c,{'transaction':_0x36bdd2})[_0xcfd6('0x2c')](function(){return BPromise[_0xcfd6('0x7d')](_0x6db1d9,function(_0x116c37){return db[_0xcfd6('0x7e')][_0xcfd6('0x7f')]({'TeamId':_0x116c37['id'],'VoiceQueueId':_0x66e0c[_0xcfd6('0x52')]['id'],'penalty':_0x116c37[_0xcfd6('0x79')]},{'transaction':_0x36bdd2});});})[_0xcfd6('0x2c')](function(){return BPromise[_0xcfd6('0x7d')](_0x32a894,function(_0x4d58d3){return db[_0xcfd6('0x80')]['findOrCreate']({'where':{'UserId':_0x4d58d3['id'],'VoiceQueueId':_0x66e0c[_0xcfd6('0x52')]['id']},'defaults':{'penalty':_0x4d58d3[_0xcfd6('0x79')]},'transaction':_0x36bdd2});});})['then'](function(){return BPromise[_0xcfd6('0x7d')](_[_0xcfd6('0x32')](_0x32a894,{'online':!![]}),function(_0x58ec6a){return db['UserVoiceQueueRt']['upsert']({'membername':_0x58ec6a['name'],'UserId':_0x58ec6a['id'],'queue_name':_0x572277[_0xcfd6('0x38')],'VoiceQueueId':_0x572277['id'],'interface':_[_0xcfd6('0x81')](_0x58ec6a[_0xcfd6('0x77')])?util[_0xcfd6('0x82')](_0xcfd6('0x83'),_0x58ec6a[_0xcfd6('0x38')]):_0x58ec6a['interface'],'paused':_0x58ec6a[_0xcfd6('0x76')]||![],'penalty':_0x58ec6a['penalty']},{'transaction':_0x36bdd2});});})['then'](function(){_0x32a894[_0xcfd6('0x84')](function(_0x3b962d){socket['emit'](_0xcfd6('0x85'),{'UserId':_0x3b962d['id'],'VoiceQueueId':_0x572277['id']});});});});});}})['then'](respondWithStatusCode(_0x4383c2,null))[_0xcfd6('0x50')](handleError(_0x4383c2,null));};exports[_0xcfd6('0x86')]=function(_0x115459,_0x544b00,_0x1bf7ba){return db[_0xcfd6('0x72')]['findAll']({'where':{'id':_0x115459[_0xcfd6('0x41')][_0xcfd6('0x87')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcfd6('0x74'),'attributes':['id'],'raw':!![]}]})[_0xcfd6('0x2c')](handleEntityNotFound(_0x544b00,null))[_0xcfd6('0x2c')](function(_0x40cc06){var _0xad17dd=_[_0xcfd6('0x34')](_0x40cc06,'id');var _0x581736=[];var _0x47987f=[];var _0x249f99=squel[_0xcfd6('0x88')]();_0x249f99[_0xcfd6('0x89')](_0xcfd6('0x8a'))[_0xcfd6('0x8b')]('team_has_voice_queues','tq')['join'](_0xcfd6('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xcfd6('0x4a')](_0xcfd6('0x8d'),_0x115459['params']['id']);for(var _0x2eea69=0x0;_0x2eea69<_0x40cc06['length'];_0x2eea69+=0x1){let _0x48e68e=_0x40cc06[_0x2eea69];for(var _0x87d4ab=0x0;_0x87d4ab<_0x48e68e[_0xcfd6('0x74')]['length'];_0x87d4ab+=0x1){let _0x59cb85=_0x48e68e[_0xcfd6('0x74')][_0x87d4ab];var _0xff41ef=_0x249f99[_0xcfd6('0x5c')]();_0xff41ef[_0xcfd6('0x4a')](_0xcfd6('0x8e'),_0x59cb85['id']);_0x47987f[_0xcfd6('0x8f')](db[_0xcfd6('0x7a')][_0xcfd6('0x41')](_0xff41ef[_0xcfd6('0x90')](),{'type':db[_0xcfd6('0x7a')][_0xcfd6('0x91')][_0xcfd6('0x92')]})[_0xcfd6('0x2c')](function(_0x5d7a7e){if(_0x5d7a7e[_0xcfd6('0x47')]===0x1){return _0x59cb85['id'];}else{var _0x122c05=_['every'](_[_0xcfd6('0x34')](_0x5d7a7e,_0xcfd6('0x93')),function(_0x4e3460){return _[_0xcfd6('0x94')](_0xad17dd,_0x4e3460);});if(_0x122c05){return _0x59cb85['id'];}}}));}}return BPromise[_0xcfd6('0x95')](_0x47987f)['then'](function(_0x14bec6){_0x581736=_(_0x581736)[_0xcfd6('0x96')](_0x14bec6)[_0xcfd6('0x97')]()[_0xcfd6('0x35')]();return db[_0xcfd6('0x3e')][_0xcfd6('0x37')]({'where':{'id':_0x115459[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](function(_0x52e1ac){return db[_0xcfd6('0x7a')][_0xcfd6('0x7b')](function(_0x2ec88a){return _0x52e1ac[_0xcfd6('0x86')](_0x115459[_0xcfd6('0x41')][_0xcfd6('0x87')],{'transaction':_0x2ec88a})['then'](function(){if(!_['isEmpty'](_0x581736)){return _0x52e1ac[_0xcfd6('0x98')](_0x581736,{'transaction':_0x2ec88a})[_0xcfd6('0x2c')](function(){return db[_0xcfd6('0x99')][_0xcfd6('0x2d')]({'where':{'VoiceQueueId':_0x115459[_0xcfd6('0x52')]['id'],'UserId':_0x581736},'transaction':_0x2ec88a});});}})[_0xcfd6('0x2c')](function(){_0x581736[_0xcfd6('0x84')](function(_0x5d48d8){socket['emit'](_0xcfd6('0x9a'),{'UserId':_0x5d48d8,'VoiceQueueId':_0x52e1ac['id']});});});});});});})[_0xcfd6('0x2c')](respondWithStatusCode(_0x544b00,null))[_0xcfd6('0x50')](handleError(_0x544b00,null));};exports[_0xcfd6('0x9b')]=function(_0x1dd6e3,_0x2ba4f5,_0x186229){var _0x6f5f83,_0x333008;return db[_0xcfd6('0x3e')][_0xcfd6('0x37')]({'where':{'id':_0x1dd6e3['params']['id']}})['then'](handleEntityNotFound(_0x2ba4f5,null))['then'](function(_0xf13cc0){if(_0xf13cc0){_0x333008=_0xf13cc0;return _0xf13cc0[_0xcfd6('0x9b')](_0x1dd6e3[_0xcfd6('0x60')][_0xcfd6('0x87')],_[_0xcfd6('0x5d')](_0x1dd6e3[_0xcfd6('0x60')],[_0xcfd6('0x87'),'id'])||{})['spread'](function(_0x56cd26){for(var _0x45c1f7=0x0;_0x45c1f7<_0x1dd6e3[_0xcfd6('0x60')][_0xcfd6('0x87')][_0xcfd6('0x47')];_0x45c1f7+=0x1){socket['emit'](_0xcfd6('0x85'),{'UserId':Number(_0x1dd6e3[_0xcfd6('0x60')]['ids'][_0x45c1f7]),'VoiceQueueId':Number(_0x1dd6e3[_0xcfd6('0x52')]['id'])});}return _0x56cd26;});}})[_0xcfd6('0x2c')](function(_0x27bacd){_0x6f5f83=_0x27bacd||[];if(_0x333008){return db[_0xcfd6('0x73')][_0xcfd6('0x6d')]({'where':{'id':_0x1dd6e3[_0xcfd6('0x60')][_0xcfd6('0x87')]},'attributes':['id',_0xcfd6('0x38'),'online',_0xcfd6('0x76'),_0xcfd6('0x77')],'raw':!![]});}})[_0xcfd6('0x2c')](function(_0x3d23ce){if(!_[_0xcfd6('0x9c')](_0x3d23ce)){var _0x38cff2=[];for(var _0x4823d2=0x0;_0x4823d2<_0x3d23ce['length'];_0x4823d2++){if(_0x3d23ce[_0x4823d2][_0xcfd6('0x75')]){_0x38cff2[_0xcfd6('0x8f')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3d23ce[_0x4823d2][_0xcfd6('0x38')],'UserId':_0x3d23ce[_0x4823d2]['id'],'queue_name':_0x333008[_0xcfd6('0x38')],'VoiceQueueId':_0x333008['id'],'interface':_['isNil'](_0x3d23ce[_0x4823d2][_0xcfd6('0x77')])?util[_0xcfd6('0x82')](_0xcfd6('0x83'),_0x3d23ce[_0x4823d2][_0xcfd6('0x38')]):_0x3d23ce[_0x4823d2][_0xcfd6('0x77')],'paused':_0x3d23ce[_0x4823d2]['voicePause']||![],'penalty':_0x1dd6e3[_0xcfd6('0x60')][_0xcfd6('0x79')]||0x0}));}}return BPromise[_0xcfd6('0x95')](_0x38cff2);}})[_0xcfd6('0x2c')](function(){return _0x6f5f83;})['then'](respondWithResult(_0x2ba4f5,null))[_0xcfd6('0x50')](handleError(_0x2ba4f5,null));};exports[_0xcfd6('0x98')]=function(_0x3dbb82,_0x4108de,_0x31f3ac){return db[_0xcfd6('0x3e')][_0xcfd6('0x37')]({'where':{'id':_0x3dbb82['params']['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x4108de,null))[_0xcfd6('0x2c')](function(_0x4be297){if(_0x4be297){return _0x4be297[_0xcfd6('0x98')](_0x3dbb82[_0xcfd6('0x41')][_0xcfd6('0x87')])[_0xcfd6('0x2c')](function(){if(_[_0xcfd6('0x9d')](_0x3dbb82[_0xcfd6('0x41')]['ids'])){for(var _0x578cdc=0x0;_0x578cdc<_0x3dbb82['query'][_0xcfd6('0x87')]['length'];_0x578cdc+=0x1){socket[_0xcfd6('0x9e')]('userVoiceQueue:remove',{'UserId':Number(_0x3dbb82[_0xcfd6('0x41')]['ids'][_0x578cdc]),'VoiceQueueId':Number(_0x3dbb82[_0xcfd6('0x52')]['id'])});}}else{socket[_0xcfd6('0x9e')](_0xcfd6('0x9a'),{'UserId':Number(_0x3dbb82[_0xcfd6('0x41')]['ids']),'VoiceQueueId':Number(_0x3dbb82[_0xcfd6('0x52')]['id'])});}});}})[_0xcfd6('0x2c')](function(_0xd2b252){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3dbb82[_0xcfd6('0x52')]['id'],'UserId':_0x3dbb82['query'][_0xcfd6('0x87')]}})[_0xcfd6('0x2c')](function(){return _0xd2b252;});})[_0xcfd6('0x2c')](respondWithStatusCode(_0x4108de,null))['catch'](handleError(_0x4108de,null));};exports[_0xcfd6('0x9f')]=function(_0x2f11d8,_0xbd4f73,_0x19ab32){var _0x350a77={};var _0x210f81={};var _0x403a1e;var _0x399bc2;return db[_0xcfd6('0x3e')]['findOne']({'where':{'id':_0x2f11d8[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0xbd4f73,null))[_0xcfd6('0x2c')](function(_0x3588b4){if(_0x3588b4){_0x403a1e=_0x3588b4;_0x210f81[_0xcfd6('0x43')]=_[_0xcfd6('0x40')](db['User'][_0xcfd6('0x53')]);_0x210f81[_0xcfd6('0x41')]=_[_0xcfd6('0x40')](_0x2f11d8[_0xcfd6('0x41')]);_0x210f81[_0xcfd6('0x42')]=_[_0xcfd6('0x45')](_0x210f81[_0xcfd6('0x43')],_0x210f81[_0xcfd6('0x41')]);_0x350a77[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x210f81['model'],qs[_0xcfd6('0x46')](_0x2f11d8[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x350a77[_0xcfd6('0x44')]=_0x350a77[_0xcfd6('0x44')][_0xcfd6('0x47')]?_0x350a77['attributes']:_0x210f81[_0xcfd6('0x43')];_0x350a77[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x2f11d8[_0xcfd6('0x41')]['sort']);_0x350a77['where']=qs[_0xcfd6('0x42')](_[_0xcfd6('0x4b')](_0x2f11d8['query'],_0x210f81[_0xcfd6('0x42')]));if(_0x2f11d8[_0xcfd6('0x41')]['filter']){_0x350a77[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x350a77['where'],{'$or':_[_0xcfd6('0x34')](_0x350a77[_0xcfd6('0x44')],function(_0xe6b3a2){var _0x4f2535={};_0x4f2535[_0xe6b3a2]={'$like':'%'+_0x2f11d8[_0xcfd6('0x41')][_0xcfd6('0x32')]+'%'};return _0x4f2535;})});}_0x350a77=_[_0xcfd6('0x4c')]({},_0x350a77,_0x2f11d8[_0xcfd6('0x4e')]);return _0x403a1e[_0xcfd6('0x9f')](_0x350a77);}})[_0xcfd6('0x2c')](function(_0x23f205){if(_0x23f205){_0x399bc2=_0x23f205[_0xcfd6('0x47')];if(!_0x2f11d8[_0xcfd6('0x41')]['hasOwnProperty'](_0xcfd6('0x69'))){_0x350a77['limit']=qs[_0xcfd6('0x25')](_0x2f11d8[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0x350a77[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x2f11d8['query']['offset']);}return _0x403a1e['getAgents'](_0x350a77);}})[_0xcfd6('0x2c')](function(_0x1d09cc){if(_0x1d09cc){return _0x1d09cc?{'count':_0x399bc2,'rows':_0x1d09cc}:null;}})['then'](respondWithResult(_0xbd4f73,null))['catch'](handleError(_0xbd4f73,null));};exports[_0xcfd6('0xa0')]=function(_0x3a108f,_0x5840c5,_0x2432b0){var _0x821b8d={};var _0x2c77b6={};var _0x38b86e;var _0x4e6cf9;return db[_0xcfd6('0x3e')][_0xcfd6('0x67')]({'where':{'id':_0x3a108f[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x5840c5,null))[_0xcfd6('0x2c')](function(_0x2d3a10){if(_0x2d3a10){_0x38b86e=_0x2d3a10;_0x2c77b6[_0xcfd6('0x43')]=_['keys'](db[_0xcfd6('0x99')][_0xcfd6('0x53')]);_0x2c77b6[_0xcfd6('0x41')]=_[_0xcfd6('0x40')](_0x3a108f['query']);_0x2c77b6['filters']=_['intersection'](_0x2c77b6[_0xcfd6('0x43')],_0x2c77b6[_0xcfd6('0x41')]);_0x821b8d[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x2c77b6[_0xcfd6('0x43')],qs[_0xcfd6('0x46')](_0x3a108f[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x821b8d['attributes']=_0x821b8d[_0xcfd6('0x44')][_0xcfd6('0x47')]?_0x821b8d[_0xcfd6('0x44')]:_0x2c77b6['model'];_0x821b8d[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x3a108f[_0xcfd6('0x41')]['sort']);_0x821b8d[_0xcfd6('0x4a')]=qs[_0xcfd6('0x42')](_[_0xcfd6('0x4b')](_0x3a108f['query'],_0x2c77b6['filters']));if(_0x3a108f[_0xcfd6('0x41')][_0xcfd6('0x32')]){_0x821b8d[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x821b8d[_0xcfd6('0x4a')],{'$or':_[_0xcfd6('0x34')](_0x821b8d[_0xcfd6('0x44')],function(_0x4447f3){var _0x27b8fc={};_0x27b8fc[_0x4447f3]={'$like':'%'+_0x3a108f[_0xcfd6('0x41')]['filter']+'%'};return _0x27b8fc;})});}_0x821b8d=_[_0xcfd6('0x4c')]({},_0x821b8d,_0x3a108f[_0xcfd6('0x4e')]);return _0x38b86e['getMembers'](_0x821b8d);}})['then'](function(_0x4df0a7){if(_0x4df0a7){_0x4e6cf9=_0x4df0a7[_0xcfd6('0x47')];if(!_0x3a108f['query'][_0xcfd6('0x48')](_0xcfd6('0x69'))){_0x821b8d['limit']=qs['limit'](_0x3a108f[_0xcfd6('0x41')]['limit']);_0x821b8d[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x3a108f[_0xcfd6('0x41')][_0xcfd6('0x23')]);}return _0x38b86e[_0xcfd6('0xa0')](_0x821b8d);}})[_0xcfd6('0x2c')](function(_0x2e7e4c){return _0x2e7e4c?{'count':_0x4e6cf9,'rows':_0x2e7e4c}:null;})[_0xcfd6('0x2c')](respondWithResult(_0x5840c5,null))[_0xcfd6('0x50')](handleError(_0x5840c5,null));};exports[_0xcfd6('0xa1')]=function(_0x8a51c7,_0x25ef88,_0x5e6b92){var _0x13b56e={};var _0x1b1e92={};var _0x5edf3d;var _0x4e12df;return db[_0xcfd6('0x3e')][_0xcfd6('0x67')]({'where':{'id':_0x8a51c7[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x25ef88,null))[_0xcfd6('0x2c')](function(_0x4721f7){if(_0x4721f7){_0x5edf3d=_0x4721f7;_0x1b1e92['model']=_[_0xcfd6('0x40')](db[_0xcfd6('0xa2')][_0xcfd6('0x53')]);_0x1b1e92['query']=_[_0xcfd6('0x40')](_0x8a51c7['query']);_0x1b1e92[_0xcfd6('0x42')]=_['intersection'](_0x1b1e92[_0xcfd6('0x43')],_0x1b1e92[_0xcfd6('0x41')]);_0x13b56e[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x1b1e92[_0xcfd6('0x43')],qs['fields'](_0x8a51c7[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x13b56e[_0xcfd6('0x44')]=_0x13b56e[_0xcfd6('0x44')][_0xcfd6('0x47')]?_0x13b56e[_0xcfd6('0x44')]:_0x1b1e92['model'];_0x13b56e[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0x8a51c7[_0xcfd6('0x41')][_0xcfd6('0x49')]);_0x13b56e['where']=qs[_0xcfd6('0x42')](_[_0xcfd6('0x4b')](_0x8a51c7[_0xcfd6('0x41')],_0x1b1e92[_0xcfd6('0x42')]));if(_0x8a51c7[_0xcfd6('0x41')][_0xcfd6('0x32')]){_0x13b56e['where']=_[_0xcfd6('0x4c')](_0x13b56e[_0xcfd6('0x4a')],{'$or':_[_0xcfd6('0x34')](_0x13b56e[_0xcfd6('0x44')],function(_0x5bff39){var _0x4bf06c={};_0x4bf06c[_0x5bff39]={'$like':'%'+_0x8a51c7[_0xcfd6('0x41')]['filter']+'%'};return _0x4bf06c;})});}_0x13b56e=_['merge']({},_0x13b56e,_0x8a51c7['options']);return _0x5edf3d[_0xcfd6('0xa1')](_0x13b56e);}})[_0xcfd6('0x2c')](function(_0xe1ca44){if(_0xe1ca44){_0x4e12df=_0xe1ca44[_0xcfd6('0x47')];if(!_0x8a51c7[_0xcfd6('0x41')][_0xcfd6('0x48')](_0xcfd6('0x69'))){_0x13b56e[_0xcfd6('0x25')]=qs['limit'](_0x8a51c7[_0xcfd6('0x41')]['limit']);_0x13b56e[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0x8a51c7[_0xcfd6('0x41')]['offset']);}return _0x5edf3d['getLists'](_0x13b56e);}})['then'](function(_0x2953e1){if(_0x2953e1){return _0x2953e1?{'count':_0x4e12df,'rows':_0x2953e1}:null;}})[_0xcfd6('0x2c')](respondWithResult(_0x25ef88,null))[_0xcfd6('0x50')](handleError(_0x25ef88,null));};exports[_0xcfd6('0xa3')]=function(_0x4feb9e,_0x625c06,_0x3995cb){var _0x12a1e0,_0x4e5d6c;return db['VoiceQueue'][_0xcfd6('0x37')]({'where':{'id':_0x4feb9e['params']['id']}})['then'](handleEntityNotFound(_0x625c06,null))[_0xcfd6('0x2c')](function(_0x5c4119){if(_0x5c4119){_0x4e5d6c=_0x5c4119;return _0x5c4119[_0xcfd6('0xa3')](_0x4feb9e[_0xcfd6('0x60')][_0xcfd6('0x87')],_['omit'](_0x4feb9e[_0xcfd6('0x60')],['ids','id'])||{});}return null;})['spread'](function(_0x2f5ebc){var _0x4f8f9f;_0x12a1e0=_0x2f5ebc||[];var _0x468f95=[];if(_0x2f5ebc){for(var _0x126b26=0x0;_0x126b26<_0x2f5ebc[_0xcfd6('0x47')];_0x126b26+=0x1){var _0x4fb152=_0x2f5ebc[_0x126b26][_0xcfd6('0x2e')]({'plain':!![]});_0x4e5d6c[_0xcfd6('0xa4')]=_0x4feb9e[_0xcfd6('0x60')]['dialCheckDuplicateType']?_0x4feb9e[_0xcfd6('0x60')]['dialCheckDuplicateType']:_0x4e5d6c['dialCheckDuplicateType'];switch(_0x4e5d6c[_0xcfd6('0xa4')]){case'always':_0x4f8f9f=squel[_0xcfd6('0xa5')]()[_0xcfd6('0xa6')](_0xcfd6('0xa7'))[_0xcfd6('0xa8')]([_0xcfd6('0xa9'),_0xcfd6('0xaa'),'ContactId',_0xcfd6('0xab'),_0xcfd6('0x65'),_0xcfd6('0x5e'),_0xcfd6('0x5f')],squel[_0xcfd6('0x88')]()[_0xcfd6('0x89')](_0xcfd6('0xa9'),_0xcfd6('0xa9'))[_0xcfd6('0x89')](_0xcfd6('0xac'),_0xcfd6('0xaa'))[_0xcfd6('0x89')]('id',_0xcfd6('0xad'))[_0xcfd6('0x89')](_0x4fb152[_0xcfd6('0xae')][_0xcfd6('0x90')](),_0xcfd6('0xab'))[_0xcfd6('0x89')](_0x4feb9e[_0xcfd6('0x52')]['id'][_0xcfd6('0x90')](),_0xcfd6('0x65'))[_0xcfd6('0x89')](_0xcfd6('0xac'),_0xcfd6('0x5e'))[_0xcfd6('0x89')](_0xcfd6('0xac'),_0xcfd6('0x5f'))[_0xcfd6('0x8b')]('cm_contacts')['where'](_0xcfd6('0xaf'))[_0xcfd6('0x4a')](_0xcfd6('0xb0'),_0x4fb152['CmListId']['toString']())[_0xcfd6('0x4a')](_0xcfd6('0xb1'))[_0xcfd6('0x4a')](_0xcfd6('0xb2'),squel[_0xcfd6('0x88')]()[_0xcfd6('0x89')]('COALESCE(calleridnum,\x27\x27)')[_0xcfd6('0x8b')](_0xcfd6('0xb3'))[_0xcfd6('0x4a')](_0xcfd6('0x8d'),_0x4feb9e[_0xcfd6('0x52')]['id'][_0xcfd6('0x90')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xcfd6('0x88')]()['field'](_0xcfd6('0xb4'))['from'](_0xcfd6('0xa7'))[_0xcfd6('0x4a')](_0xcfd6('0x8d'),_0x4feb9e[_0xcfd6('0x52')]['id'][_0xcfd6('0x90')]())))[_0xcfd6('0x90')]();break;case _0xcfd6('0xb5'):_0x4f8f9f=squel[_0xcfd6('0xa5')]()[_0xcfd6('0xa6')](_0xcfd6('0xa7'))[_0xcfd6('0xa8')]([_0xcfd6('0xa9'),_0xcfd6('0xaa'),'ContactId','ListId','VoiceQueueId',_0xcfd6('0x5e'),_0xcfd6('0x5f')],squel[_0xcfd6('0x88')]()[_0xcfd6('0x89')](_0xcfd6('0xa9'),'phone')[_0xcfd6('0x89')](_0xcfd6('0xac'),'scheduledAt')['field']('id',_0xcfd6('0xad'))['field'](_0x4fb152[_0xcfd6('0xae')]['toString'](),_0xcfd6('0xab'))[_0xcfd6('0x89')](_0x4feb9e[_0xcfd6('0x52')]['id']['toString'](),'VoiceQueueId')['field'](_0xcfd6('0xac'),_0xcfd6('0x5e'))[_0xcfd6('0x89')](_0xcfd6('0xac'),_0xcfd6('0x5f'))[_0xcfd6('0x8b')]('cm_contacts')['where'](_0xcfd6('0xaf'))[_0xcfd6('0x4a')]('ListId\x20=\x20?',_0x4fb152[_0xcfd6('0xae')][_0xcfd6('0x90')]())[_0xcfd6('0x4a')](_0xcfd6('0xb1'))[_0xcfd6('0x4a')](_0xcfd6('0xb2'),squel[_0xcfd6('0x88')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0xcfd6('0xa7'))['where'](_0xcfd6('0x8d'),_0x4feb9e[_0xcfd6('0x52')]['id'][_0xcfd6('0x90')]())))[_0xcfd6('0x90')]();break;default:_0x4f8f9f=squel[_0xcfd6('0xa5')]()[_0xcfd6('0xa6')](_0xcfd6('0xa7'))[_0xcfd6('0xa8')]([_0xcfd6('0xa9'),'scheduledAt','ContactId','ListId','VoiceQueueId',_0xcfd6('0x5e'),_0xcfd6('0x5f')],squel['select']()[_0xcfd6('0x89')](_0xcfd6('0xa9'),_0xcfd6('0xa9'))[_0xcfd6('0x89')](_0xcfd6('0xac'),'scheduledAt')[_0xcfd6('0x89')]('id',_0xcfd6('0xad'))['field'](_0x4fb152['CmListId'][_0xcfd6('0x90')](),_0xcfd6('0xab'))[_0xcfd6('0x89')](_0x4feb9e[_0xcfd6('0x52')]['id']['toString'](),_0xcfd6('0x65'))[_0xcfd6('0x89')](_0xcfd6('0xac'),_0xcfd6('0x5e'))['field']('NOW()','updatedAt')[_0xcfd6('0x8b')](_0xcfd6('0xb6'))[_0xcfd6('0x4a')](_0xcfd6('0xaf'))[_0xcfd6('0x4a')](_0xcfd6('0xb0'),_0x4fb152[_0xcfd6('0xae')][_0xcfd6('0x90')]())['where'](_0xcfd6('0xb1')))[_0xcfd6('0x90')]();}_0x468f95[_0xcfd6('0x8f')](db[_0xcfd6('0x7a')][_0xcfd6('0x41')](_0x4f8f9f));}return BPromise[_0xcfd6('0x95')](_0x468f95);}})['then'](function(){return _0x12a1e0;})[_0xcfd6('0x2c')](respondWithResult(_0x625c06,null))[_0xcfd6('0x50')](handleError(_0x625c06,null));};exports[_0xcfd6('0xb7')]=function(_0x4fc0e3,_0x4f11bc,_0x2ca2ca){return db['VoiceQueue'][_0xcfd6('0x37')]({'where':{'id':_0x4fc0e3[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x4f11bc,null))[_0xcfd6('0x2c')](function(_0xd12379){if(_0xd12379){return _0xd12379[_0xcfd6('0xb7')](_0x4fc0e3[_0xcfd6('0x41')][_0xcfd6('0x87')]);}})[_0xcfd6('0x2c')](function(_0x53e6e5){if(_0x53e6e5){return db['CmHopper'][_0xcfd6('0x2d')]({'where':{'ListId':_0x4fc0e3[_0xcfd6('0x41')]['ids'],'VoiceQueueId':_0x4fc0e3['params']['id']}})[_0xcfd6('0x2c')](function(){return _0x53e6e5;});}})[_0xcfd6('0x2c')](respondWithStatusCode(_0x4f11bc,null))[_0xcfd6('0x50')](handleError(_0x4f11bc,null));};exports[_0xcfd6('0xb8')]=function(_0xd17594,_0x3b51a6,_0x40fa39){var _0x35e6b2={};var _0x2a2074={};var _0xefeb0b;var _0x430c9f;return db['VoiceQueue'][_0xcfd6('0x67')]({'where':{'id':_0xd17594[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x3b51a6,null))[_0xcfd6('0x2c')](function(_0xb26fa){if(_0xb26fa){_0xefeb0b=_0xb26fa;_0x2a2074[_0xcfd6('0x43')]=_[_0xcfd6('0x40')](db['CmList']['rawAttributes']);_0x2a2074['query']=_[_0xcfd6('0x40')](_0xd17594[_0xcfd6('0x41')]);_0x2a2074['filters']=_[_0xcfd6('0x45')](_0x2a2074[_0xcfd6('0x43')],_0x2a2074[_0xcfd6('0x41')]);_0x35e6b2[_0xcfd6('0x44')]=_[_0xcfd6('0x45')](_0x2a2074[_0xcfd6('0x43')],qs[_0xcfd6('0x46')](_0xd17594[_0xcfd6('0x41')][_0xcfd6('0x46')]));_0x35e6b2[_0xcfd6('0x44')]=_0x35e6b2[_0xcfd6('0x44')]['length']?_0x35e6b2[_0xcfd6('0x44')]:_0x2a2074[_0xcfd6('0x43')];_0x35e6b2[_0xcfd6('0x64')]=qs[_0xcfd6('0x49')](_0xd17594[_0xcfd6('0x41')]['sort']);_0x35e6b2['where']=qs[_0xcfd6('0x42')](_[_0xcfd6('0x4b')](_0xd17594[_0xcfd6('0x41')],_0x2a2074[_0xcfd6('0x42')]));if(_0xd17594[_0xcfd6('0x41')][_0xcfd6('0x32')]){_0x35e6b2[_0xcfd6('0x4a')]=_[_0xcfd6('0x4c')](_0x35e6b2[_0xcfd6('0x4a')],{'$or':_[_0xcfd6('0x34')](_0x35e6b2[_0xcfd6('0x44')],function(_0x42794f){var _0x2c4671={};_0x2c4671[_0x42794f]={'$like':'%'+_0xd17594['query']['filter']+'%'};return _0x2c4671;})});}_0x35e6b2=_[_0xcfd6('0x4c')]({},_0x35e6b2,_0xd17594[_0xcfd6('0x4e')]);return _0xefeb0b[_0xcfd6('0xb8')](_0x35e6b2);}})[_0xcfd6('0x2c')](function(_0x32a903){if(_0x32a903){_0x430c9f=_0x32a903['length'];if(!_0xd17594[_0xcfd6('0x41')]['hasOwnProperty'](_0xcfd6('0x69'))){_0x35e6b2[_0xcfd6('0x25')]=qs[_0xcfd6('0x25')](_0xd17594[_0xcfd6('0x41')][_0xcfd6('0x25')]);_0x35e6b2[_0xcfd6('0x23')]=qs[_0xcfd6('0x23')](_0xd17594[_0xcfd6('0x41')][_0xcfd6('0x23')]);}return _0xefeb0b[_0xcfd6('0xb8')](_0x35e6b2);}})[_0xcfd6('0x2c')](function(_0x46afa5){if(_0x46afa5){return _0x46afa5?{'count':_0x430c9f,'rows':_0x46afa5}:null;}})['then'](respondWithResult(_0x3b51a6,null))['catch'](handleError(_0x3b51a6,null));};exports[_0xcfd6('0xb9')]=function(_0x13627d,_0x522ea4,_0x23cdbc){var _0x51c465,_0x1a7f11;return db['VoiceQueue']['find']({'where':{'id':_0x13627d[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x522ea4,null))[_0xcfd6('0x2c')](function(_0x43eff3){if(_0x43eff3){_0x1a7f11=_0x43eff3;return _0x43eff3[_0xcfd6('0xb9')](_0x13627d[_0xcfd6('0x60')][_0xcfd6('0x87')],_[_0xcfd6('0x5d')](_0x13627d['body'],[_0xcfd6('0x87'),'id'])||{});}return null;})[_0xcfd6('0xba')](function(_0x2a8f3a){var _0x362748;_0x51c465=_0x2a8f3a||[];var _0x38b86f=[];if(_0x2a8f3a){for(var _0x2a9ab9=0x0;_0x2a9ab9<_0x2a8f3a['length'];_0x2a9ab9+=0x1){var _0x33703f=_0x2a8f3a[_0x2a9ab9][_0xcfd6('0x2e')]({'plain':!![]});_0x362748=squel[_0xcfd6('0xa5')]()[_0xcfd6('0xa6')](_0xcfd6('0xbb'))[_0xcfd6('0xa8')](['phone',_0xcfd6('0xad'),_0xcfd6('0xab'),_0xcfd6('0x65'),'createdAt',_0xcfd6('0x5f')],squel['select']()[_0xcfd6('0x89')](_0xcfd6('0xa9'),'phone')[_0xcfd6('0x89')]('id',_0xcfd6('0xad'))['field'](_0x33703f[_0xcfd6('0xae')][_0xcfd6('0x90')](),_0xcfd6('0xab'))[_0xcfd6('0x89')](_0x13627d[_0xcfd6('0x52')]['id'][_0xcfd6('0x90')](),_0xcfd6('0x65'))['field'](_0xcfd6('0xac'),'createdAt')['field'](_0xcfd6('0xac'),_0xcfd6('0x5f'))[_0xcfd6('0x8b')]('cm_contacts')[_0xcfd6('0x4a')]('deletedAt\x20IS\x20NULL')[_0xcfd6('0x4a')](_0xcfd6('0xb0'),_0x33703f['CmListId'][_0xcfd6('0x90')]())[_0xcfd6('0x4a')]('phone\x20IS\x20NOT\x20NULL'))[_0xcfd6('0x90')]();_0x38b86f['push'](db['sequelize'][_0xcfd6('0x41')](_0x362748));}return BPromise['all'](_0x38b86f);}})[_0xcfd6('0x2c')](function(){return _0x51c465;})[_0xcfd6('0x2c')](respondWithResult(_0x522ea4,null))[_0xcfd6('0x50')](handleError(_0x522ea4,null));};exports[_0xcfd6('0xbc')]=function(_0x125da5,_0x1c56dd,_0x33f50e){return db['VoiceQueue'][_0xcfd6('0x37')]({'where':{'id':_0x125da5[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](handleEntityNotFound(_0x1c56dd,null))[_0xcfd6('0x2c')](function(_0x3f5ca5){if(_0x3f5ca5){return _0x3f5ca5[_0xcfd6('0xbc')](_0x125da5[_0xcfd6('0x41')]['ids']);}})[_0xcfd6('0x2c')](function(_0x52b542){if(_0x52b542){return db[_0xcfd6('0x6f')][_0xcfd6('0x2d')]({'where':{'ListId':_0x125da5[_0xcfd6('0x41')][_0xcfd6('0x87')],'VoiceQueueId':_0x125da5[_0xcfd6('0x52')]['id']}})[_0xcfd6('0x2c')](function(){return _0x52b542;});}})['then'](respondWithStatusCode(_0x1c56dd,null))[_0xcfd6('0x50')](handleError(_0x1c56dd,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 210271b..1dbc9f2 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 _0x1d9a=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x232d09,_0x30a518){var _0x454385=function(_0x3a5fdd){while(--_0x3a5fdd){_0x232d09['push'](_0x232d09['shift']());}};_0x454385(++_0x30a518);}(_0x1d9a,0x15a));var _0xa1d9=function(_0x12b43e,_0x1fae05){_0x12b43e=_0x12b43e-0x0;var _0x556c0b=_0x1d9a[_0x12b43e];return _0x556c0b;};'use strict';var EventEmitter=require(_0xa1d9('0x0'));var VoiceQueue=require(_0xa1d9('0x1'))['db'][_0xa1d9('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa1d9('0x3')](0x0);var events={'afterCreate':_0xa1d9('0x4'),'afterUpdate':_0xa1d9('0x5'),'afterDestroy':_0xa1d9('0x6')};function emitEvent(_0x3612cc){return function(_0x2ab0e9,_0x4478eb,_0xe70a1c){VoiceQueueEvents[_0xa1d9('0x7')](_0x3612cc+':'+_0x2ab0e9['id'],_0x2ab0e9);VoiceQueueEvents[_0xa1d9('0x7')](_0x3612cc,_0x2ab0e9);_0xe70a1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa1d9('0x8')](e,emitEvent(event));}}module[_0xa1d9('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x4742=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2b7f97,_0x3fe5c6){var _0x3c2339=function(_0x12e36c){while(--_0x12e36c){_0x2b7f97['push'](_0x2b7f97['shift']());}};_0x3c2339(++_0x3fe5c6);}(_0x4742,0xf9));var _0x2474=function(_0x39f97c,_0x43cfc3){_0x39f97c=_0x39f97c-0x0;var _0x5c3e1b=_0x4742[_0x39f97c];return _0x5c3e1b;};'use strict';var EventEmitter=require(_0x2474('0x0'));var VoiceQueue=require(_0x2474('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2474('0x2')](0x0);var events={'afterCreate':_0x2474('0x3'),'afterUpdate':_0x2474('0x4'),'afterDestroy':_0x2474('0x5')};function emitEvent(_0x1b1ec1){return function(_0x45b858,_0x1452f9,_0x514a06){VoiceQueueEvents[_0x2474('0x6')](_0x1b1ec1+':'+_0x45b858['id'],_0x45b858);VoiceQueueEvents[_0x2474('0x6')](_0x1b1ec1,_0x45b858);_0x514a06(null);};}for(var e in events){if(events[_0x2474('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x2474('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 6aa8503..3a2948d 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2a5477,_0x180d79){var _0x44e186=function(_0x20e9ea){while(--_0x20e9ea){_0x2a5477['push'](_0x2a5477['shift']());}};_0x44e186(++_0x180d79);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f9ad3,_0x435646){_0x1f9ad3=_0x1f9ad3-0x0;var _0x1c9b6a=_0xedd9[_0x1f9ad3];return _0x1c9b6a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x31baf0,_0x282cd4){var _0x2ab6c5=function(_0x3f263f){while(--_0x3f263f){_0x31baf0['push'](_0x31baf0['shift']());}};_0x2ab6c5(++_0x282cd4);}(_0x34e8,0x12c));var _0x834e=function(_0x31f685,_0x3a5faa){_0x31f685=_0x31f685-0x0;var _0x423551=_0x34e8[_0x31f685];return _0x423551;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index c7a9490..3a769c8 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 _0xc2ad=['request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','GetVoiceQueue','catch','find','raw','ShowVoiceQueue','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x530756,_0x2d5015){var _0x37b932=function(_0x5f25f0){while(--_0x5f25f0){_0x530756['push'](_0x530756['shift']());}};_0x37b932(++_0x2d5015);}(_0xc2ad,0xe8));var _0xdc2a=function(_0x5dd058,_0x58fb39){_0x5dd058=_0x5dd058-0x0;var _0x471b8b=_0xc2ad[_0x5dd058];return _0x471b8b;};'use strict';var _=require('lodash');var util=require(_0xdc2a('0x0'));var moment=require(_0xdc2a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc2a('0x2'));var db=require(_0xdc2a('0x3'))['db'];var utils=require(_0xdc2a('0x4'));var logger=require(_0xdc2a('0x5'))(_0xdc2a('0x6'));var config=require(_0xdc2a('0x7'));var jayson=require(_0xdc2a('0x8'));var client=jayson[_0xdc2a('0x9')][_0xdc2a('0xa')]({'port':0x232a});config[_0xdc2a('0xb')]=_[_0xdc2a('0xc')](config[_0xdc2a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc2a('0xd'))(new Redis(config[_0xdc2a('0xb')]));require(_0xdc2a('0xe'))[_0xdc2a('0xf')](socket);function respondWithRpcPromise(_0x2619a7,_0x25e2e4,_0x688d3c){return new BPromise(function(_0x400ec9,_0x12f8fe){return client[_0xdc2a('0x10')](_0x2619a7,_0x688d3c)[_0xdc2a('0x11')](function(_0x3aa604){logger[_0xdc2a('0x12')](_0xdc2a('0x13'),_0x25e2e4,_0xdc2a('0x14'));logger[_0xdc2a('0x15')](_0xdc2a('0x16'),_0x25e2e4,_0xdc2a('0x14'),JSON[_0xdc2a('0x17')](_0x3aa604));if(_0x3aa604[_0xdc2a('0x18')]){if(_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x19')]===0x1f4){logger[_0xdc2a('0x18')](_0xdc2a('0x13'),_0x25e2e4,_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x1a')]);return _0x12f8fe(_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x1a')]);}logger['error'](_0xdc2a('0x13'),_0x25e2e4,_0x3aa604[_0xdc2a('0x18')][_0xdc2a('0x1a')]);return _0x400ec9(_0x3aa604['error'][_0xdc2a('0x1a')]);}else{logger[_0xdc2a('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x25e2e4,_0xdc2a('0x14'));_0x400ec9(_0x3aa604[_0xdc2a('0x1b')][_0xdc2a('0x1a')]);}})['catch'](function(_0x1c3a46){logger[_0xdc2a('0x18')](_0xdc2a('0x13'),_0x25e2e4,_0x1c3a46);_0x12f8fe(_0x1c3a46);});});}exports['GetVoiceQueue']=function(_0x5eb77c){var _0x4bef9c=this;return new Promise(function(_0x297e9d,_0x47a0d8){return db[_0xdc2a('0x1c')][_0xdc2a('0x1d')]({'raw':_0x5eb77c['options']?_0x5eb77c[_0xdc2a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5eb77c[_0xdc2a('0x1e')]?_0x5eb77c['options'][_0xdc2a('0x1f')]||null:null,'attributes':_0x5eb77c[_0xdc2a('0x1e')]?_0x5eb77c[_0xdc2a('0x1e')][_0xdc2a('0x20')]||null:null,'limit':_0x5eb77c['options']?_0x5eb77c['options'][_0xdc2a('0x21')]||null:null,'include':_0x5eb77c[_0xdc2a('0x1e')]?_0x5eb77c['options'][_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x5eb77c[_0xdc2a('0x1e')][_0xdc2a('0x22')],function(_0x3810e6){return{'model':db[_0x3810e6[_0xdc2a('0x24')]],'as':_0x3810e6['as'],'attributes':_0x3810e6[_0xdc2a('0x20')],'include':_0x3810e6[_0xdc2a('0x22')]?_['map'](_0x3810e6[_0xdc2a('0x22')],function(_0x3722f5){return{'model':db[_0x3722f5['model']],'as':_0x3722f5['as'],'attributes':_0x3722f5[_0xdc2a('0x20')],'include':_0x3722f5[_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x3722f5[_0xdc2a('0x22')],function(_0x22cf83){return{'model':db[_0x22cf83['model']],'as':_0x22cf83['as'],'attributes':_0x22cf83[_0xdc2a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4edc){logger[_0xdc2a('0x12')](_0xdc2a('0x25'),_0x5eb77c);logger['debug'](_0xdc2a('0x25'),_0x5eb77c,JSON[_0xdc2a('0x17')](_0x4f4edc));_0x297e9d(_0x4f4edc);})[_0xdc2a('0x26')](function(_0x43d0f2){logger[_0xdc2a('0x18')](_0xdc2a('0x25'),_0x43d0f2[_0xdc2a('0x1a')],_0x5eb77c);_0x47a0d8(_0x4bef9c[_0xdc2a('0x18')](0x1f4,_0x43d0f2[_0xdc2a('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x4754ee){var _0x4bef6c=this;return new Promise(function(_0x2dfcbc,_0x136243){return db[_0xdc2a('0x1c')][_0xdc2a('0x27')]({'raw':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee['options'][_0xdc2a('0x28')]===undefined?!![]:![]:!![],'where':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x1f')]||null:null,'attributes':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x20')]||null:null,'include':_0x4754ee[_0xdc2a('0x1e')]?_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x4754ee[_0xdc2a('0x1e')][_0xdc2a('0x22')],function(_0x102adf){return{'model':db[_0x102adf[_0xdc2a('0x24')]],'as':_0x102adf['as'],'attributes':_0x102adf['attributes'],'include':_0x102adf[_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x102adf[_0xdc2a('0x22')],function(_0x35a166){return{'model':db[_0x35a166[_0xdc2a('0x24')]],'as':_0x35a166['as'],'attributes':_0x35a166[_0xdc2a('0x20')],'include':_0x35a166[_0xdc2a('0x22')]?_[_0xdc2a('0x23')](_0x35a166[_0xdc2a('0x22')],function(_0x4457c4){return{'model':db[_0x4457c4[_0xdc2a('0x24')]],'as':_0x4457c4['as'],'attributes':_0x4457c4[_0xdc2a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdc2a('0x11')](function(_0x6a308f){logger[_0xdc2a('0x12')](_0xdc2a('0x29'),_0x4754ee);logger[_0xdc2a('0x15')](_0xdc2a('0x29'),_0x4754ee,JSON[_0xdc2a('0x17')](_0x6a308f));_0x2dfcbc(_0x6a308f);})[_0xdc2a('0x26')](function(_0x43b62f){logger[_0xdc2a('0x18')](_0xdc2a('0x29'),_0x43b62f[_0xdc2a('0x1a')],_0x4754ee);_0x136243(_0x4bef6c[_0xdc2a('0x18')](0x1f4,_0x43b62f['message']));});});}; \ No newline at end of file +var _0xc068=['find','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','GetVoiceQueue'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc068,0x152));var _0x8c06=function(_0x184ade,_0x4e5ae7){_0x184ade=_0x184ade-0x0;var _0x4cbae8=_0xc068[_0x184ade];return _0x4cbae8;};'use strict';var _=require('lodash');var util=require(_0x8c06('0x0'));var moment=require(_0x8c06('0x1'));var BPromise=require(_0x8c06('0x2'));var rs=require(_0x8c06('0x3'));var fs=require('fs');var Redis=require(_0x8c06('0x4'));var db=require(_0x8c06('0x5'))['db'];var utils=require(_0x8c06('0x6'));var logger=require('../../config/logger')(_0x8c06('0x7'));var config=require(_0x8c06('0x8'));var jayson=require(_0x8c06('0x9'));var client=jayson[_0x8c06('0xa')][_0x8c06('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8c06('0xc')],{'host':_0x8c06('0xd'),'port':0x18eb});var socket=require(_0x8c06('0xe'))(new Redis(config[_0x8c06('0xc')]));require('./voiceQueue.socket')[_0x8c06('0xf')](socket);function respondWithRpcPromise(_0x25dd3d,_0x52b610,_0x1ec282){return new BPromise(function(_0x3ea1fe,_0x8c6ee){return client[_0x8c06('0x10')](_0x25dd3d,_0x1ec282)['then'](function(_0x4ea9ad){logger[_0x8c06('0x11')](_0x8c06('0x12'),_0x52b610,_0x8c06('0x13'));logger['debug'](_0x8c06('0x14'),_0x52b610,_0x8c06('0x13'),JSON[_0x8c06('0x15')](_0x4ea9ad));if(_0x4ea9ad[_0x8c06('0x16')]){if(_0x4ea9ad[_0x8c06('0x16')][_0x8c06('0x17')]===0x1f4){logger[_0x8c06('0x16')](_0x8c06('0x12'),_0x52b610,_0x4ea9ad[_0x8c06('0x16')][_0x8c06('0x18')]);return _0x8c6ee(_0x4ea9ad['error'][_0x8c06('0x18')]);}logger[_0x8c06('0x16')](_0x8c06('0x12'),_0x52b610,_0x4ea9ad[_0x8c06('0x16')][_0x8c06('0x18')]);return _0x3ea1fe(_0x4ea9ad[_0x8c06('0x16')]['message']);}else{logger[_0x8c06('0x11')](_0x8c06('0x12'),_0x52b610,_0x8c06('0x13'));_0x3ea1fe(_0x4ea9ad[_0x8c06('0x19')][_0x8c06('0x18')]);}})[_0x8c06('0x1a')](function(_0x29c7ed){logger[_0x8c06('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x52b610,_0x29c7ed);_0x8c6ee(_0x29c7ed);});});}exports['GetVoiceQueue']=function(_0x46869e){var _0x256d82=this;return new Promise(function(_0x330c18,_0x5ae795){return db[_0x8c06('0x1b')][_0x8c06('0x1c')]({'raw':_0x46869e['options']?_0x46869e[_0x8c06('0x1d')][_0x8c06('0x1e')]===undefined?!![]:![]:!![],'where':_0x46869e['options']?_0x46869e[_0x8c06('0x1d')][_0x8c06('0x1f')]||null:null,'attributes':_0x46869e['options']?_0x46869e[_0x8c06('0x1d')][_0x8c06('0x20')]||null:null,'limit':_0x46869e['options']?_0x46869e[_0x8c06('0x1d')][_0x8c06('0x21')]||null:null,'include':_0x46869e[_0x8c06('0x1d')]?_0x46869e[_0x8c06('0x1d')]['include']?_[_0x8c06('0x22')](_0x46869e['options']['include'],function(_0x516e85){return{'model':db[_0x516e85['model']],'as':_0x516e85['as'],'attributes':_0x516e85[_0x8c06('0x20')],'include':_0x516e85[_0x8c06('0x23')]?_[_0x8c06('0x22')](_0x516e85['include'],function(_0x3520ff){return{'model':db[_0x3520ff[_0x8c06('0x24')]],'as':_0x3520ff['as'],'attributes':_0x3520ff[_0x8c06('0x20')],'include':_0x3520ff[_0x8c06('0x23')]?_['map'](_0x3520ff['include'],function(_0x3fb90c){return{'model':db[_0x3fb90c[_0x8c06('0x24')]],'as':_0x3fb90c['as'],'attributes':_0x3fb90c[_0x8c06('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8c06('0x25')](function(_0x714c65){logger[_0x8c06('0x11')]('GetVoiceQueue',_0x46869e);logger[_0x8c06('0x26')](_0x8c06('0x27'),_0x46869e,JSON['stringify'](_0x714c65));_0x330c18(_0x714c65);})[_0x8c06('0x1a')](function(_0x428d0e){logger[_0x8c06('0x16')](_0x8c06('0x27'),_0x428d0e[_0x8c06('0x18')],_0x46869e);_0x5ae795(_0x256d82[_0x8c06('0x16')](0x1f4,_0x428d0e[_0x8c06('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x22b0a9){var _0x257d35=this;return new Promise(function(_0x9c7548,_0x22bb71){return db['VoiceQueue'][_0x8c06('0x28')]({'raw':_0x22b0a9[_0x8c06('0x1d')]?_0x22b0a9[_0x8c06('0x1d')][_0x8c06('0x1e')]===undefined?!![]:![]:!![],'where':_0x22b0a9[_0x8c06('0x1d')]?_0x22b0a9[_0x8c06('0x1d')][_0x8c06('0x1f')]||null:null,'attributes':_0x22b0a9[_0x8c06('0x1d')]?_0x22b0a9[_0x8c06('0x1d')]['attributes']||null:null,'include':_0x22b0a9[_0x8c06('0x1d')]?_0x22b0a9[_0x8c06('0x1d')][_0x8c06('0x23')]?_['map'](_0x22b0a9[_0x8c06('0x1d')]['include'],function(_0x340507){return{'model':db[_0x340507[_0x8c06('0x24')]],'as':_0x340507['as'],'attributes':_0x340507[_0x8c06('0x20')],'include':_0x340507[_0x8c06('0x23')]?_['map'](_0x340507['include'],function(_0x5abda7){return{'model':db[_0x5abda7[_0x8c06('0x24')]],'as':_0x5abda7['as'],'attributes':_0x5abda7['attributes'],'include':_0x5abda7['include']?_[_0x8c06('0x22')](_0x5abda7[_0x8c06('0x23')],function(_0x47ed2d){return{'model':db[_0x47ed2d[_0x8c06('0x24')]],'as':_0x47ed2d['as'],'attributes':_0x47ed2d[_0x8c06('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8c06('0x25')](function(_0x5c72df){logger[_0x8c06('0x11')](_0x8c06('0x29'),_0x22b0a9);logger[_0x8c06('0x26')]('ShowVoiceQueue',_0x22b0a9,JSON[_0x8c06('0x15')](_0x5c72df));_0x9c7548(_0x5c72df);})['catch'](function(_0x594c22){logger[_0x8c06('0x16')](_0x8c06('0x29'),_0x594c22['message'],_0x22b0a9);_0x22bb71(_0x257d35[_0x8c06('0x16')](0x1f4,_0x594c22['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index bada8a4..d0aed44 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 _0x08dd=['removeListener','length','voiceQueue:','save','update','emit'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x08dd,0x183));var _0xd08d=function(_0x454cbf,_0x202eac){_0x454cbf=_0x454cbf-0x0;var _0x1b702c=_0x08dd[_0x454cbf];return _0x1b702c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xd08d('0x0'),'remove',_0xd08d('0x1')];function createListener(_0x1cd06f,_0x2ff809){return function(_0x2406b6){_0x2ff809[_0xd08d('0x2')](_0x1cd06f,_0x2406b6);};}function removeListener(_0x26aa1c,_0x2ab604){return function(){VoiceQueueEvents[_0xd08d('0x3')](_0x26aa1c,_0x2ab604);};}exports['register']=function(_0x56d007){for(var _0x523ae1=0x0,_0x3558aa=events[_0xd08d('0x4')];_0x523ae1<_0x3558aa;_0x523ae1++){var _0x5d6b72=events[_0x523ae1];var _0x25309e=createListener(_0xd08d('0x5')+_0x5d6b72,_0x56d007);VoiceQueueEvents['on'](_0x5d6b72,_0x25309e);}}; \ No newline at end of file +var _0x96cc=['remove','update','emit','removeListener','length','voiceQueue:','save'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x96cc,0x1db));var _0xc96c=function(_0x323021,_0x30f030){_0x323021=_0x323021-0x0;var _0x52cb3e=_0x96cc[_0x323021];return _0x52cb3e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xc96c('0x0'),_0xc96c('0x1'),_0xc96c('0x2')];function createListener(_0x1e7e9f,_0x46f075){return function(_0x40f2ae){_0x46f075[_0xc96c('0x3')](_0x1e7e9f,_0x40f2ae);};}function removeListener(_0x49f148,_0xd56bb1){return function(){VoiceQueueEvents[_0xc96c('0x4')](_0x49f148,_0xd56bb1);};}exports['register']=function(_0x41146b){for(var _0x1eb4b3=0x0,_0x348a08=events[_0xc96c('0x5')];_0x1eb4b3<_0x348a08;_0x1eb4b3++){var _0x14ae63=events[_0x1eb4b3];var _0x407f81=createListener(_0xc96c('0x6')+_0x14ae63,_0x41146b);VoiceQueueEvents['on'](_0x14ae63,_0x407f81);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 518da30..0e2e06d 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 _0x0f98=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x0f98,0x103));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x80f9('0x0'));var path=require(_0x80f9('0x1'));var timeout=require(_0x80f9('0x2'));var express=require('express');var router=express[_0x80f9('0x3')]();var fs_extra=require(_0x80f9('0x4'));var auth=require(_0x80f9('0x5'));var interaction=require(_0x80f9('0x6'));var config=require(_0x80f9('0x7'));var controller=require(_0x80f9('0x8'));router[_0x80f9('0x9')]('/',auth[_0x80f9('0xa')](),controller['index']);router[_0x80f9('0x9')](_0x80f9('0xb'),auth[_0x80f9('0xa')](),controller[_0x80f9('0xc')]);router[_0x80f9('0x9')](_0x80f9('0xd'),auth[_0x80f9('0xa')](),controller[_0x80f9('0xe')]);router[_0x80f9('0x9')](_0x80f9('0xf'),auth[_0x80f9('0xa')](),controller[_0x80f9('0x10')]);router[_0x80f9('0x11')]('/',auth['isAuthenticated'](),controller[_0x80f9('0x12')]);router['put'](_0x80f9('0xf'),auth[_0x80f9('0xa')](),controller['update']);router[_0x80f9('0x13')]('/:id',auth[_0x80f9('0xa')](),controller[_0x80f9('0x14')]);module[_0x80f9('0x15')]=router; \ No newline at end of file +var _0xb9dd=['getVoiceQueuesReport','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/index'];(function(_0x1a2493,_0x4ee32b){var _0x6639ff=function(_0x14e2a6){while(--_0x14e2a6){_0x1a2493['push'](_0x1a2493['shift']());}};_0x6639ff(++_0x4ee32b);}(_0xb9dd,0x197));var _0xdb9d=function(_0x451ede,_0x1d14b1){_0x451ede=_0x451ede-0x0;var _0x1a910d=_0xb9dd[_0x451ede];return _0x1a910d;};'use strict';var multer=require(_0xdb9d('0x0'));var util=require(_0xdb9d('0x1'));var path=require(_0xdb9d('0x2'));var timeout=require(_0xdb9d('0x3'));var express=require(_0xdb9d('0x4'));var router=express['Router']();var fs_extra=require(_0xdb9d('0x5'));var auth=require(_0xdb9d('0x6'));var interaction=require(_0xdb9d('0x7'));var config=require(_0xdb9d('0x8'));var controller=require(_0xdb9d('0x9'));router[_0xdb9d('0xa')]('/',auth[_0xdb9d('0xb')](),controller['index']);router[_0xdb9d('0xa')]('/describe',auth[_0xdb9d('0xb')](),controller['describe']);router[_0xdb9d('0xa')](_0xdb9d('0xc'),auth['isAuthenticated'](),controller[_0xdb9d('0xd')]);router[_0xdb9d('0xa')](_0xdb9d('0xe'),auth[_0xdb9d('0xb')](),controller[_0xdb9d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdb9d('0x10')](_0xdb9d('0xe'),auth[_0xdb9d('0xb')](),controller[_0xdb9d('0x11')]);router[_0xdb9d('0x12')]('/:id',auth[_0xdb9d('0xb')](),controller['destroy']);module[_0xdb9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 96f668a..499efa8 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 _0x3bf4=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x2d555f,_0x3f2876){var _0x14a1b1=function(_0xf6a217){while(--_0xf6a217){_0x2d555f['push'](_0x2d555f['shift']());}};_0x14a1b1(++_0x3f2876);}(_0x3bf4,0xd3));var _0x43bf=function(_0x4a591c,_0x48e5d9){_0x4a591c=_0x4a591c-0x0;var _0xacfe93=_0x3bf4[_0x4a591c];return _0xacfe93;};'use strict';var Sequelize=require(_0x43bf('0x0'));var moment=require(_0x43bf('0x1'));module[_0x43bf('0x2')]={'type':{'type':Sequelize[_0x43bf('0x3')]},'uniqueid':{'type':Sequelize[_0x43bf('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43bf('0x3')]},'queue':{'type':Sequelize[_0x43bf('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x43bf('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x43bf('0x4')],'set':function(_0x198a99){var _0x1dd905=moment(_0x198a99);var _0x3cc040=moment(this[_0x43bf('0x5')](_0x43bf('0x6')))[_0x43bf('0x7')](_0x43bf('0x8'));var _0x2bb9d5=_0x1dd905[_0x43bf('0x9')](_0x3cc040,_0x43bf('0xa'));this[_0x43bf('0xb')](_0x43bf('0xc'),_0x198a99);this['setDataValue'](_0x43bf('0xd'),_0x2bb9d5||null);}},'position':{'type':Sequelize[_0x43bf('0xe')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x43bf('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x43bf('0x4')]},'queuecallerexit':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x43bf('0x3')],'comment':_0x43bf('0x10')},'originalposition':{'type':Sequelize[_0x43bf('0xe')]},'channel':{'type':Sequelize[_0x43bf('0x3')]},'connectedlinenum':{'type':Sequelize[_0x43bf('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x43bf('0x3')]},'context':{'type':Sequelize[_0x43bf('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43bf('0x3')]},'holdtime':{'type':Sequelize[_0x43bf('0xe')]},'mohtime':{'type':Sequelize[_0x43bf('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x43bf('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x43bf('0x3')],'comment':_0x43bf('0x11')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x43bf('0x3')]},'disposition':{'type':Sequelize[_0x43bf('0x3')]},'secondDisposition':{'type':Sequelize[_0x43bf('0x3')]},'thirdDisposition':{'type':Sequelize[_0x43bf('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbca9=['sequelize','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1b8d7d,_0x47891f){var _0x855e6b=function(_0x1fe2ea){while(--_0x1fe2ea){_0x1b8d7d['push'](_0x1b8d7d['shift']());}};_0x855e6b(++_0x47891f);}(_0xbca9,0x159));var _0x9bca=function(_0x1f2d5d,_0x4357f6){_0x1f2d5d=_0x1f2d5d-0x0;var _0x2797a3=_0xbca9[_0x1f2d5d];return _0x2797a3;};'use strict';var Sequelize=require(_0x9bca('0x0'));var moment=require('moment');module[_0x9bca('0x1')]={'type':{'type':Sequelize[_0x9bca('0x2')]},'uniqueid':{'type':Sequelize[_0x9bca('0x2')]},'calleridnum':{'type':Sequelize[_0x9bca('0x2')]},'calleridname':{'type':Sequelize[_0x9bca('0x2')]},'queue':{'type':Sequelize[_0x9bca('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x9bca('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x540111){var _0x5479e6=moment(_0x540111);var _0x41848e=moment(this[_0x9bca('0x4')]('queuecallerjoinAt'))[_0x9bca('0x5')](_0x9bca('0x6'));var _0x44dd9e=_0x5479e6[_0x9bca('0x7')](_0x41848e,_0x9bca('0x8'));this[_0x9bca('0x9')](_0x9bca('0xa'),_0x540111);this[_0x9bca('0x9')](_0x9bca('0xb'),_0x44dd9e||null);}},'position':{'type':Sequelize[_0x9bca('0xc')]},'count':{'type':Sequelize[_0x9bca('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x9bca('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9bca('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x9bca('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9bca('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x9bca('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x9bca('0xc')]},'channel':{'type':Sequelize[_0x9bca('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9bca('0x2')]},'accountcode':{'type':Sequelize[_0x9bca('0x2')]},'context':{'type':Sequelize[_0x9bca('0x2')]},'exten':{'type':Sequelize[_0x9bca('0x2')]},'priority':{'type':Sequelize[_0x9bca('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x9bca('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x9bca('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9bca('0xe')},'transferexten':{'type':Sequelize[_0x9bca('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9bca('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x9bca('0xc')],'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 61a2e86..de6f9ef 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 _0x4bad=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','status','json','undefined','count','offset','set','apply','save','update','then','destroy','end','sendStatus','error','send','index','key','map','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','merge','options','includeAll','include','VoiceQueueReport','rows','catch','show','params','keys','length','find','create','body','describe','rawAttributes','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2ca012,_0x477ca6){var _0x1bd467=function(_0x5bba5f){while(--_0x5bba5f){_0x2ca012['push'](_0x2ca012['shift']());}};_0x1bd467(++_0x477ca6);}(_0x4bad,0x1db));var _0xd4ba=function(_0x4905e0,_0x1725a3){_0x4905e0=_0x4905e0-0x0;var _0x43c90e=_0x4bad[_0x4905e0];return _0x43c90e;};'use strict';var emlformat=require(_0xd4ba('0x0'));var rimraf=require(_0xd4ba('0x1'));var zipdir=require(_0xd4ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4ba('0x3'));var moment=require('moment');var BPromise=require(_0xd4ba('0x4'));var Mustache=require(_0xd4ba('0x5'));var util=require(_0xd4ba('0x6'));var path=require(_0xd4ba('0x7'));var sox=require(_0xd4ba('0x8'));var csv=require('to-csv');var ejs=require(_0xd4ba('0x9'));var fs=require('fs');var fs_extra=require(_0xd4ba('0xa'));var _=require('lodash');var squel=require(_0xd4ba('0xb'));var crypto=require(_0xd4ba('0xc'));var jsforce=require(_0xd4ba('0xd'));var deskjs=require(_0xd4ba('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd4ba('0xf'));var Papa=require(_0xd4ba('0x10'));var Redis=require(_0xd4ba('0x11'));var authService=require(_0xd4ba('0x12'));var qs=require(_0xd4ba('0x13'));var as=require(_0xd4ba('0x14'));var hardwareService=require(_0xd4ba('0x15'));var logger=require('../../config/logger')(_0xd4ba('0x16'));var utils=require(_0xd4ba('0x17'));var config=require(_0xd4ba('0x18'));var licenseUtil=require(_0xd4ba('0x19'));var db=require('../../mysqldb')['db'];config[_0xd4ba('0x1a')]=_[_0xd4ba('0x1b')](config[_0xd4ba('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd4ba('0x1c'))(new Redis(config[_0xd4ba('0x1a')]));require('./voiceQueueReport.socket')[_0xd4ba('0x1d')](socket);function respondWithStatusCode(_0x5344d8,_0x25d00c){_0x25d00c=_0x25d00c||0xcc;return function(_0x4bf8af){if(_0x4bf8af){return _0x5344d8['sendStatus'](_0x25d00c);}return _0x5344d8[_0xd4ba('0x1e')](_0x25d00c)['end']();};}function respondWithResult(_0x53c67c,_0x4e6ab5){_0x4e6ab5=_0x4e6ab5||0xc8;return function(_0x16fd51){if(_0x16fd51){return _0x53c67c['status'](_0x4e6ab5)[_0xd4ba('0x1f')](_0x16fd51);}};}function respondWithFilteredResult(_0x5455c8,_0x37ee14){return function(_0x5a8462){if(_0x5a8462){var _0x513d2d=typeof _0x37ee14['offset']===_0xd4ba('0x20')&&typeof _0x37ee14['limit']==='undefined';var _0x5ea99b=_0x5a8462[_0xd4ba('0x21')];var _0x442d01=_0x513d2d?0x0:_0x37ee14['offset'];var _0x3c7e36=_0x513d2d?_0x5a8462['count']:_0x37ee14[_0xd4ba('0x22')]+_0x37ee14['limit'];var _0x2876ca;if(_0x3c7e36>=_0x5ea99b){_0x3c7e36=_0x5ea99b;_0x2876ca=0xc8;}else{_0x2876ca=0xce;}_0x5455c8['status'](_0x2876ca);return _0x5455c8[_0xd4ba('0x23')]('Content-Range',_0x442d01+'-'+_0x3c7e36+'/'+_0x5ea99b)['json'](_0x5a8462);}return null;};}function patchUpdates(_0xe993fa){return function(_0x5367a9){try{jsonpatch[_0xd4ba('0x24')](_0x5367a9,_0xe993fa,!![]);}catch(_0x3efc63){return BPromise['reject'](_0x3efc63);}return _0x5367a9[_0xd4ba('0x25')]();};}function saveUpdates(_0x5383ab,_0x411314){return function(_0x7331fc){if(_0x7331fc){return _0x7331fc[_0xd4ba('0x26')](_0x5383ab)[_0xd4ba('0x27')](function(_0x5d3029){return _0x5d3029;});}return null;};}function removeEntity(_0x47aa69,_0x428c7a){return function(_0x229c46){if(_0x229c46){return _0x229c46[_0xd4ba('0x28')]()[_0xd4ba('0x27')](function(){_0x47aa69[_0xd4ba('0x1e')](0xcc)[_0xd4ba('0x29')]();});}};}function handleEntityNotFound(_0x4b0e12,_0x51cbad){return function(_0x276a7b){if(!_0x276a7b){_0x4b0e12[_0xd4ba('0x2a')](0x194);}return _0x276a7b;};}function handleError(_0x3c1c8a,_0x18f577){_0x18f577=_0x18f577||0x1f4;return function(_0x24b4a){logger[_0xd4ba('0x2b')](_0x24b4a['stack']);if(_0x24b4a['name']){delete _0x24b4a['name'];}_0x3c1c8a[_0xd4ba('0x1e')](_0x18f577)[_0xd4ba('0x2c')](_0x24b4a);};}exports[_0xd4ba('0x2d')]=function(_0x5622de,_0x4922cc){var _0x553871={},_0x2492be={},_0x52433f={'count':0x0,'rows':[]};var _0x5dad56=_['map'](db['VoiceQueueReport']['rawAttributes'],function(_0x31244d){return{'name':_0x31244d['fieldName'],'type':_0x31244d['type'][_0xd4ba('0x2e')]};});_0x2492be['model']=_[_0xd4ba('0x2f')](_0x5dad56,_0xd4ba('0x30'));_0x2492be['query']=_['keys'](_0x5622de[_0xd4ba('0x31')]);_0x2492be[_0xd4ba('0x32')]=_[_0xd4ba('0x33')](_0x2492be[_0xd4ba('0x34')],_0x2492be[_0xd4ba('0x31')]);_0x553871['attributes']=_[_0xd4ba('0x33')](_0x2492be[_0xd4ba('0x34')],qs['fields'](_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x35')]));_0x553871[_0xd4ba('0x36')]=_0x553871[_0xd4ba('0x36')]['length']?_0x553871[_0xd4ba('0x36')]:_0x2492be[_0xd4ba('0x34')];if(!_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x37')](_0xd4ba('0x38'))){_0x553871[_0xd4ba('0x39')]=qs[_0xd4ba('0x39')](_0x5622de['query'][_0xd4ba('0x39')]);_0x553871['offset']=qs['offset'](_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x22')]);}_0x553871[_0xd4ba('0x3a')]=qs[_0xd4ba('0x3b')](_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x3b')]);_0x553871[_0xd4ba('0x3c')]=qs['filters'](_[_0xd4ba('0x3d')](_0x5622de['query'],_0x2492be[_0xd4ba('0x32')]),_0x5dad56);if(_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x3e')]){_0x553871[_0xd4ba('0x3c')]=_['merge'](_0x553871['where'],{'$or':_[_0xd4ba('0x2f')](_0x5dad56,function(_0x201486){if(_0x201486[_0xd4ba('0x3f')]!=='VIRTUAL'){var _0x4eb9cd={};_0x4eb9cd[_0x201486[_0xd4ba('0x30')]]={'$like':'%'+_0x5622de[_0xd4ba('0x31')]['filter']+'%'};return _0x4eb9cd;}})});}_0x553871=_[_0xd4ba('0x40')]({},_0x553871,_0x5622de[_0xd4ba('0x41')]);var _0x1b9c6e={'where':_0x553871['where']};return db['VoiceQueueReport']['count'](_0x1b9c6e)[_0xd4ba('0x27')](function(_0x4eec84){_0x52433f[_0xd4ba('0x21')]=_0x4eec84;if(_0x5622de[_0xd4ba('0x31')][_0xd4ba('0x42')]){_0x553871[_0xd4ba('0x43')]=[{'all':!![]}];}return db[_0xd4ba('0x44')]['findAll'](_0x553871);})['then'](function(_0xd8b7af){_0x52433f[_0xd4ba('0x45')]=_0xd8b7af;return _0x52433f;})['then'](respondWithFilteredResult(_0x4922cc,_0x553871))[_0xd4ba('0x46')](handleError(_0x4922cc,null));};exports[_0xd4ba('0x47')]=function(_0x428696,_0x41cf0e){var _0x6beca8={'raw':![],'where':{'id':_0x428696[_0xd4ba('0x48')]['id']}},_0x4eaf9d={};_0x4eaf9d[_0xd4ba('0x34')]=_[_0xd4ba('0x49')](db[_0xd4ba('0x44')]['rawAttributes']);_0x4eaf9d[_0xd4ba('0x31')]=_[_0xd4ba('0x49')](_0x428696[_0xd4ba('0x31')]);_0x4eaf9d[_0xd4ba('0x32')]=_['intersection'](_0x4eaf9d[_0xd4ba('0x34')],_0x4eaf9d['query']);_0x6beca8[_0xd4ba('0x36')]=_['intersection'](_0x4eaf9d[_0xd4ba('0x34')],qs[_0xd4ba('0x35')](_0x428696[_0xd4ba('0x31')]['fields']));_0x6beca8[_0xd4ba('0x36')]=_0x6beca8[_0xd4ba('0x36')][_0xd4ba('0x4a')]?_0x6beca8[_0xd4ba('0x36')]:_0x4eaf9d[_0xd4ba('0x34')];if(_0x428696[_0xd4ba('0x31')][_0xd4ba('0x42')]){_0x6beca8[_0xd4ba('0x43')]=[{'all':!![]}];}_0x6beca8=_[_0xd4ba('0x40')]({},_0x6beca8,_0x428696[_0xd4ba('0x41')]);return db[_0xd4ba('0x44')][_0xd4ba('0x4b')](_0x6beca8)[_0xd4ba('0x27')](handleEntityNotFound(_0x41cf0e,null))[_0xd4ba('0x27')](respondWithResult(_0x41cf0e,null))[_0xd4ba('0x46')](handleError(_0x41cf0e,null));};exports[_0xd4ba('0x4c')]=function(_0x19be91,_0x3a19b2){return db['VoiceQueueReport']['create'](_0x19be91['body'],{})[_0xd4ba('0x27')](respondWithResult(_0x3a19b2,0xc9))['catch'](handleError(_0x3a19b2,null));};exports[_0xd4ba('0x26')]=function(_0x36611a,_0x290876){if(_0x36611a[_0xd4ba('0x4d')]['id']){delete _0x36611a['body']['id'];}return db[_0xd4ba('0x44')]['find']({'where':{'id':_0x36611a[_0xd4ba('0x48')]['id']}})[_0xd4ba('0x27')](handleEntityNotFound(_0x290876,null))[_0xd4ba('0x27')](saveUpdates(_0x36611a[_0xd4ba('0x4d')],null))[_0xd4ba('0x27')](respondWithResult(_0x290876,null))[_0xd4ba('0x46')](handleError(_0x290876,null));};exports[_0xd4ba('0x28')]=function(_0x409720,_0x1a60e0){return db['VoiceQueueReport'][_0xd4ba('0x4b')]({'where':{'id':_0x409720['params']['id']}})[_0xd4ba('0x27')](handleEntityNotFound(_0x1a60e0,null))[_0xd4ba('0x27')](removeEntity(_0x1a60e0,null))[_0xd4ba('0x46')](handleError(_0x1a60e0,null));};exports[_0xd4ba('0x4e')]=function(_0x57cd88,_0x3846ec){return db[_0xd4ba('0x44')]['describe']()['then'](respondWithResult(_0x3846ec,null))[_0xd4ba('0x46')](handleError(_0x3846ec,null));};exports['getVoiceQueuesReport']=function(_0x1049fc,_0x4d14d0){var _0xaf541e={},_0x4b6f52={},_0x10f8bb={'count':0x0,'rows':[]};_0x4b6f52[_0xd4ba('0x34')]=_[_0xd4ba('0x49')](db['VoiceQueueReport'][_0xd4ba('0x4f')]);_0x4b6f52[_0xd4ba('0x31')]=_[_0xd4ba('0x49')](_0x1049fc[_0xd4ba('0x31')]);_0x4b6f52['filters']=_['intersection'](_0x4b6f52['model'],_0x4b6f52['query']);_0xaf541e['attributes']=_[_0xd4ba('0x33')](_0x4b6f52[_0xd4ba('0x34')],qs[_0xd4ba('0x35')](_0x1049fc['query'][_0xd4ba('0x35')]));_0xaf541e[_0xd4ba('0x36')]=_0xaf541e[_0xd4ba('0x36')]['length']?_0xaf541e['attributes']:_0x4b6f52[_0xd4ba('0x34')];if(!_0x1049fc[_0xd4ba('0x31')]['hasOwnProperty'](_0xd4ba('0x38'))){_0xaf541e[_0xd4ba('0x39')]=qs[_0xd4ba('0x39')](_0x1049fc[_0xd4ba('0x31')]['limit']);_0xaf541e['offset']=qs[_0xd4ba('0x22')](_0x1049fc[_0xd4ba('0x31')][_0xd4ba('0x22')]);}_0xaf541e[_0xd4ba('0x3a')]=qs['sort'](_0x1049fc[_0xd4ba('0x31')][_0xd4ba('0x3b')]);_0xaf541e[_0xd4ba('0x3c')]=qs[_0xd4ba('0x32')](_[_0xd4ba('0x3d')](_0x1049fc['query'],_0x4b6f52['filters']));if(_0x1049fc['query'][_0xd4ba('0x3e')]){_0xaf541e[_0xd4ba('0x3c')]=_[_0xd4ba('0x40')](_0xaf541e[_0xd4ba('0x3c')],{'$or':_['map'](_0xaf541e[_0xd4ba('0x36')],function(_0x584a86){var _0x1c9795={};_0x1c9795[_0x584a86]={'$like':'%'+_0x1049fc['query'][_0xd4ba('0x3e')]+'%'};return _0x1c9795;})});}_0xaf541e=_['merge']({},_0xaf541e,_0x1049fc[_0xd4ba('0x41')]);var _0x52870d={'where':_0xaf541e[_0xd4ba('0x3c')]};return db[_0xd4ba('0x44')][_0xd4ba('0x21')](_0x52870d)[_0xd4ba('0x27')](function(_0x48be6d){_0x10f8bb[_0xd4ba('0x21')]=_0x48be6d;if(_0x1049fc['query'][_0xd4ba('0x42')]){_0xaf541e['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd4ba('0x50')](_0xaf541e);})[_0xd4ba('0x27')](function(_0x4faa6c){_0x10f8bb['rows']=_0x4faa6c;return _0x10f8bb;})[_0xd4ba('0x27')](respondWithFilteredResult(_0x4d14d0,_0xaf541e,_0xd4ba('0x51')))[_0xd4ba('0x46')](handleError(_0x4d14d0,null,_0xd4ba('0x51')));}; \ No newline at end of file +var _0xedac=['name','send','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','body','params','describe','getVoiceQueuesReport','hasOwnProperty','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','undefined','count','offset','set','apply','reject','save','update','then','sendStatus','error','stack'];(function(_0x347f41,_0x2f3249){var _0x47903f=function(_0x76e20d){while(--_0x76e20d){_0x347f41['push'](_0x347f41['shift']());}};_0x47903f(++_0x2f3249);}(_0xedac,0x77));var _0xceda=function(_0x599bcf,_0x103c6a){_0x599bcf=_0x599bcf-0x0;var _0x379fbb=_0xedac[_0x599bcf];return _0x379fbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xceda('0x0'));var zipdir=require(_0xceda('0x1'));var jsonpatch=require(_0xceda('0x2'));var rp=require(_0xceda('0x3'));var moment=require(_0xceda('0x4'));var BPromise=require(_0xceda('0x5'));var Mustache=require(_0xceda('0x6'));var util=require(_0xceda('0x7'));var path=require(_0xceda('0x8'));var sox=require(_0xceda('0x9'));var csv=require(_0xceda('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xceda('0xb'));var _=require(_0xceda('0xc'));var squel=require(_0xceda('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xceda('0xa'));var querystring=require(_0xceda('0xe'));var Papa=require(_0xceda('0xf'));var Redis=require(_0xceda('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xceda('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceda('0x12'));var logger=require(_0xceda('0x13'))(_0xceda('0x14'));var utils=require('../../config/utils');var config=require(_0xceda('0x15'));var licenseUtil=require(_0xceda('0x16'));var db=require(_0xceda('0x17'))['db'];config[_0xceda('0x18')]=_[_0xceda('0x19')](config['redis'],{'host':_0xceda('0x1a'),'port':0x18eb});var socket=require(_0xceda('0x1b'))(new Redis(config[_0xceda('0x18')]));require(_0xceda('0x1c'))[_0xceda('0x1d')](socket);function respondWithStatusCode(_0x496aee,_0x1cafd1){_0x1cafd1=_0x1cafd1||0xcc;return function(_0x3bf95b){if(_0x3bf95b){return _0x496aee['sendStatus'](_0x1cafd1);}return _0x496aee['status'](_0x1cafd1)[_0xceda('0x1e')]();};}function respondWithResult(_0x16cf06,_0x33ecd0){_0x33ecd0=_0x33ecd0||0xc8;return function(_0x302431){if(_0x302431){return _0x16cf06[_0xceda('0x1f')](_0x33ecd0)[_0xceda('0x20')](_0x302431);}};}function respondWithFilteredResult(_0x57ab12,_0x4de99e){return function(_0x56314f){if(_0x56314f){var _0x68bed6=typeof _0x4de99e['offset']===_0xceda('0x21')&&typeof _0x4de99e['limit']===_0xceda('0x21');var _0x49ebbc=_0x56314f[_0xceda('0x22')];var _0x58d856=_0x68bed6?0x0:_0x4de99e['offset'];var _0x3d6ee0=_0x68bed6?_0x56314f[_0xceda('0x22')]:_0x4de99e[_0xceda('0x23')]+_0x4de99e['limit'];var _0x39554f;if(_0x3d6ee0>=_0x49ebbc){_0x3d6ee0=_0x49ebbc;_0x39554f=0xc8;}else{_0x39554f=0xce;}_0x57ab12['status'](_0x39554f);return _0x57ab12[_0xceda('0x24')]('Content-Range',_0x58d856+'-'+_0x3d6ee0+'/'+_0x49ebbc)[_0xceda('0x20')](_0x56314f);}return null;};}function patchUpdates(_0x2f2806){return function(_0x30eca4){try{jsonpatch[_0xceda('0x25')](_0x30eca4,_0x2f2806,!![]);}catch(_0x26762c){return BPromise[_0xceda('0x26')](_0x26762c);}return _0x30eca4[_0xceda('0x27')]();};}function saveUpdates(_0x2fdaa9,_0x5d691c){return function(_0x1ceb6a){if(_0x1ceb6a){return _0x1ceb6a[_0xceda('0x28')](_0x2fdaa9)[_0xceda('0x29')](function(_0x225837){return _0x225837;});}return null;};}function removeEntity(_0x112359,_0x4b2f69){return function(_0x2803c5){if(_0x2803c5){return _0x2803c5['destroy']()[_0xceda('0x29')](function(){_0x112359[_0xceda('0x1f')](0xcc)[_0xceda('0x1e')]();});}};}function handleEntityNotFound(_0x2f54bb,_0x4dee48){return function(_0x390ed4){if(!_0x390ed4){_0x2f54bb[_0xceda('0x2a')](0x194);}return _0x390ed4;};}function handleError(_0x227701,_0x33deee){_0x33deee=_0x33deee||0x1f4;return function(_0x194943){logger[_0xceda('0x2b')](_0x194943[_0xceda('0x2c')]);if(_0x194943[_0xceda('0x2d')]){delete _0x194943[_0xceda('0x2d')];}_0x227701['status'](_0x33deee)[_0xceda('0x2e')](_0x194943);};}exports['index']=function(_0x3d2738,_0xa65c65){var _0x30a23e={},_0x3c4b63={},_0x5376c1={'count':0x0,'rows':[]};var _0x108a12=_[_0xceda('0x2f')](db[_0xceda('0x30')][_0xceda('0x31')],function(_0x35de3c){return{'name':_0x35de3c['fieldName'],'type':_0x35de3c[_0xceda('0x32')][_0xceda('0x33')]};});_0x3c4b63[_0xceda('0x34')]=_['map'](_0x108a12,_0xceda('0x2d'));_0x3c4b63[_0xceda('0x35')]=_[_0xceda('0x36')](_0x3d2738['query']);_0x3c4b63['filters']=_[_0xceda('0x37')](_0x3c4b63['model'],_0x3c4b63[_0xceda('0x35')]);_0x30a23e[_0xceda('0x38')]=_[_0xceda('0x37')](_0x3c4b63[_0xceda('0x34')],qs[_0xceda('0x39')](_0x3d2738[_0xceda('0x35')]['fields']));_0x30a23e[_0xceda('0x38')]=_0x30a23e[_0xceda('0x38')]['length']?_0x30a23e['attributes']:_0x3c4b63[_0xceda('0x34')];if(!_0x3d2738[_0xceda('0x35')]['hasOwnProperty'](_0xceda('0x3a'))){_0x30a23e[_0xceda('0x3b')]=qs['limit'](_0x3d2738[_0xceda('0x35')][_0xceda('0x3b')]);_0x30a23e[_0xceda('0x23')]=qs[_0xceda('0x23')](_0x3d2738['query']['offset']);}_0x30a23e[_0xceda('0x3c')]=qs[_0xceda('0x3d')](_0x3d2738['query'][_0xceda('0x3d')]);_0x30a23e['where']=qs[_0xceda('0x3e')](_['pick'](_0x3d2738[_0xceda('0x35')],_0x3c4b63[_0xceda('0x3e')]),_0x108a12);if(_0x3d2738['query'][_0xceda('0x3f')]){_0x30a23e['where']=_[_0xceda('0x40')](_0x30a23e[_0xceda('0x41')],{'$or':_[_0xceda('0x2f')](_0x108a12,function(_0x2ba974){if(_0x2ba974[_0xceda('0x32')]!==_0xceda('0x42')){var _0x5b7134={};_0x5b7134[_0x2ba974[_0xceda('0x2d')]]={'$like':'%'+_0x3d2738[_0xceda('0x35')][_0xceda('0x3f')]+'%'};return _0x5b7134;}})});}_0x30a23e=_['merge']({},_0x30a23e,_0x3d2738[_0xceda('0x43')]);var _0xe4bc64={'where':_0x30a23e[_0xceda('0x41')]};return db[_0xceda('0x30')]['count'](_0xe4bc64)['then'](function(_0x3aaf96){_0x5376c1[_0xceda('0x22')]=_0x3aaf96;if(_0x3d2738[_0xceda('0x35')]['includeAll']){_0x30a23e[_0xceda('0x44')]=[{'all':!![]}];}return db[_0xceda('0x30')][_0xceda('0x45')](_0x30a23e);})[_0xceda('0x29')](function(_0x13f601){_0x5376c1[_0xceda('0x46')]=_0x13f601;return _0x5376c1;})[_0xceda('0x29')](respondWithFilteredResult(_0xa65c65,_0x30a23e))[_0xceda('0x47')](handleError(_0xa65c65,null));};exports['show']=function(_0x132339,_0x593810){var _0x72a4e8={'raw':![],'where':{'id':_0x132339['params']['id']}},_0x1a12e0={};_0x1a12e0[_0xceda('0x34')]=_[_0xceda('0x36')](db['VoiceQueueReport']['rawAttributes']);_0x1a12e0[_0xceda('0x35')]=_['keys'](_0x132339[_0xceda('0x35')]);_0x1a12e0[_0xceda('0x3e')]=_[_0xceda('0x37')](_0x1a12e0[_0xceda('0x34')],_0x1a12e0[_0xceda('0x35')]);_0x72a4e8[_0xceda('0x38')]=_[_0xceda('0x37')](_0x1a12e0[_0xceda('0x34')],qs[_0xceda('0x39')](_0x132339['query'][_0xceda('0x39')]));_0x72a4e8[_0xceda('0x38')]=_0x72a4e8[_0xceda('0x38')][_0xceda('0x48')]?_0x72a4e8['attributes']:_0x1a12e0[_0xceda('0x34')];if(_0x132339[_0xceda('0x35')][_0xceda('0x49')]){_0x72a4e8[_0xceda('0x44')]=[{'all':!![]}];}_0x72a4e8=_[_0xceda('0x40')]({},_0x72a4e8,_0x132339[_0xceda('0x43')]);return db[_0xceda('0x30')][_0xceda('0x4a')](_0x72a4e8)[_0xceda('0x29')](handleEntityNotFound(_0x593810,null))['then'](respondWithResult(_0x593810,null))[_0xceda('0x47')](handleError(_0x593810,null));};exports['create']=function(_0x4eb767,_0x286f2a){return db[_0xceda('0x30')][_0xceda('0x4b')](_0x4eb767[_0xceda('0x4c')],{})[_0xceda('0x29')](respondWithResult(_0x286f2a,0xc9))['catch'](handleError(_0x286f2a,null));};exports[_0xceda('0x28')]=function(_0x3a6f32,_0x496385){if(_0x3a6f32[_0xceda('0x4c')]['id']){delete _0x3a6f32[_0xceda('0x4c')]['id'];}return db[_0xceda('0x30')][_0xceda('0x4a')]({'where':{'id':_0x3a6f32[_0xceda('0x4d')]['id']}})['then'](handleEntityNotFound(_0x496385,null))['then'](saveUpdates(_0x3a6f32[_0xceda('0x4c')],null))[_0xceda('0x29')](respondWithResult(_0x496385,null))['catch'](handleError(_0x496385,null));};exports['destroy']=function(_0x52629d,_0x1e5cfc){return db[_0xceda('0x30')][_0xceda('0x4a')]({'where':{'id':_0x52629d['params']['id']}})[_0xceda('0x29')](handleEntityNotFound(_0x1e5cfc,null))[_0xceda('0x29')](removeEntity(_0x1e5cfc,null))[_0xceda('0x47')](handleError(_0x1e5cfc,null));};exports[_0xceda('0x4e')]=function(_0x1f079b,_0x3410b2){return db[_0xceda('0x30')][_0xceda('0x4e')]()[_0xceda('0x29')](respondWithResult(_0x3410b2,null))[_0xceda('0x47')](handleError(_0x3410b2,null));};exports[_0xceda('0x4f')]=function(_0x5ad5fe,_0x455dc6){var _0x47a3cf={},_0x4f27f={},_0x2e6795={'count':0x0,'rows':[]};_0x4f27f[_0xceda('0x34')]=_[_0xceda('0x36')](db[_0xceda('0x30')][_0xceda('0x31')]);_0x4f27f['query']=_[_0xceda('0x36')](_0x5ad5fe['query']);_0x4f27f[_0xceda('0x3e')]=_[_0xceda('0x37')](_0x4f27f['model'],_0x4f27f[_0xceda('0x35')]);_0x47a3cf[_0xceda('0x38')]=_['intersection'](_0x4f27f[_0xceda('0x34')],qs[_0xceda('0x39')](_0x5ad5fe[_0xceda('0x35')][_0xceda('0x39')]));_0x47a3cf['attributes']=_0x47a3cf[_0xceda('0x38')][_0xceda('0x48')]?_0x47a3cf[_0xceda('0x38')]:_0x4f27f['model'];if(!_0x5ad5fe[_0xceda('0x35')][_0xceda('0x50')](_0xceda('0x3a'))){_0x47a3cf[_0xceda('0x3b')]=qs[_0xceda('0x3b')](_0x5ad5fe[_0xceda('0x35')]['limit']);_0x47a3cf[_0xceda('0x23')]=qs[_0xceda('0x23')](_0x5ad5fe[_0xceda('0x35')][_0xceda('0x23')]);}_0x47a3cf[_0xceda('0x3c')]=qs[_0xceda('0x3d')](_0x5ad5fe[_0xceda('0x35')]['sort']);_0x47a3cf[_0xceda('0x41')]=qs[_0xceda('0x3e')](_[_0xceda('0x51')](_0x5ad5fe['query'],_0x4f27f[_0xceda('0x3e')]));if(_0x5ad5fe[_0xceda('0x35')]['filter']){_0x47a3cf[_0xceda('0x41')]=_[_0xceda('0x40')](_0x47a3cf[_0xceda('0x41')],{'$or':_[_0xceda('0x2f')](_0x47a3cf['attributes'],function(_0x6733d5){var _0x4d2571={};_0x4d2571[_0x6733d5]={'$like':'%'+_0x5ad5fe[_0xceda('0x35')][_0xceda('0x3f')]+'%'};return _0x4d2571;})});}_0x47a3cf=_[_0xceda('0x40')]({},_0x47a3cf,_0x5ad5fe[_0xceda('0x43')]);var _0x571556={'where':_0x47a3cf[_0xceda('0x41')]};return db[_0xceda('0x30')][_0xceda('0x22')](_0x571556)['then'](function(_0x1a1ab3){_0x2e6795[_0xceda('0x22')]=_0x1a1ab3;if(_0x5ad5fe[_0xceda('0x35')]['includeAll']){_0x47a3cf[_0xceda('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xceda('0x45')](_0x47a3cf);})[_0xceda('0x29')](function(_0x2e4982){_0x2e6795[_0xceda('0x46')]=_0x2e4982;return _0x2e6795;})[_0xceda('0x29')](respondWithFilteredResult(_0x455dc6,_0x47a3cf,_0xceda('0x4f')))['catch'](handleError(_0x455dc6,null,_0xceda('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0f66129..52817dc 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 _0x9cce=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0x9cce,0x157));var _0xe9cc=function(_0x352f87,_0x53388d){_0x352f87=_0x352f87-0x0;var _0x74143e=_0x9cce[_0x352f87];return _0x74143e;};'use strict';var EventEmitter=require(_0xe9cc('0x0'));var VoiceQueueReport=require(_0xe9cc('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe9cc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9cc('0x3'),'afterDestroy':_0xe9cc('0x4')};function emitEvent(_0x5d4716){return function(_0x493393,_0x55f5c7,_0x2a4c3b){VoiceQueueReportEvents[_0xe9cc('0x5')](_0x5d4716+':'+_0x493393['id'],_0x493393);VoiceQueueReportEvents[_0xe9cc('0x5')](_0x5d4716,_0x493393);_0x2a4c3b(null);};}for(var e in events){if(events[_0xe9cc('0x6')](e)){var event=events[e];VoiceQueueReport[_0xe9cc('0x7')](e,emitEvent(event));}}module[_0xe9cc('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7123=['save','update','remove','emit','hook','exports','VoiceQueueReport','setMaxListeners'];(function(_0x1d729d,_0x1afdde){var _0x3234cf=function(_0x5aed55){while(--_0x5aed55){_0x1d729d['push'](_0x1d729d['shift']());}};_0x3234cf(++_0x1afdde);}(_0x7123,0xb6));var _0x3712=function(_0x1ef6af,_0x169aa8){_0x1ef6af=_0x1ef6af-0x0;var _0x2bf0f5=_0x7123[_0x1ef6af];return _0x2bf0f5;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x3712('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3712('0x1')](0x0);var events={'afterCreate':_0x3712('0x2'),'afterUpdate':_0x3712('0x3'),'afterDestroy':_0x3712('0x4')};function emitEvent(_0x136490){return function(_0x3547d6,_0x2d9731,_0x42b97d){VoiceQueueReportEvents[_0x3712('0x5')](_0x136490+':'+_0x3547d6['id'],_0x3547d6);VoiceQueueReportEvents[_0x3712('0x5')](_0x136490,_0x3547d6);_0x42b97d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x3712('0x6')](e,emitEvent(event));}}module[_0x3712('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index c6d9349..d54b6c0 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 _0x9123=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','calleridnum'];(function(_0x4a5f39,_0x22ef39){var _0x6299ee=function(_0x2e1429){while(--_0x2e1429){_0x4a5f39['push'](_0x4a5f39['shift']());}};_0x6299ee(++_0x22ef39);}(_0x9123,0xb0));var _0x3912=function(_0x2de738,_0x1b4c12){_0x2de738=_0x2de738-0x0;var _0x356ad1=_0x9123[_0x2de738];return _0x356ad1;};'use strict';var _=require(_0x3912('0x0'));var util=require(_0x3912('0x1'));var logger=require(_0x3912('0x2'))(_0x3912('0x3'));var moment=require('moment');var BPromise=require(_0x3912('0x4'));var rp=require(_0x3912('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3912('0x6'));var attributes=require(_0x3912('0x7'));module[_0x3912('0x8')]=function(_0x1bfb84,_0x29c5bc){return _0x1bfb84['define'](_0x3912('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3912('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb344=['report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb344,0x113));var _0x4b34=function(_0x17de24,_0x3c6c3c){_0x17de24=_0x17de24-0x0;var _0x4a7763=_0xb344[_0x17de24];return _0x4a7763;};'use strict';var _=require(_0x4b34('0x0'));var util=require(_0x4b34('0x1'));var logger=require(_0x4b34('0x2'))(_0x4b34('0x3'));var moment=require(_0x4b34('0x4'));var BPromise=require(_0x4b34('0x5'));var rp=require(_0x4b34('0x6'));var fs=require('fs');var path=require(_0x4b34('0x7'));var rimraf=require(_0x4b34('0x8'));var config=require(_0x4b34('0x9'));var attributes=require(_0x4b34('0xa'));module['exports']=function(_0x136ade,_0x462736){return _0x136ade[_0x4b34('0xb')](_0x4b34('0xc'),attributes,{'tableName':_0x4b34('0xd'),'paranoid':![],'indexes':[{'fields':[_0x4b34('0xe')]},{'fields':[_0x4b34('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 6546ace..5344fba 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 _0xc0ca=['request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceQueueReport','findAll','options','raw','attributes','limit','map','include','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x3e3217,_0x518c13){var _0x425fac=function(_0x22a925){while(--_0x22a925){_0x3e3217['push'](_0x3e3217['shift']());}};_0x425fac(++_0x518c13);}(_0xc0ca,0xfc));var _0xac0c=function(_0x2f6cbd,_0x5d7246){_0x2f6cbd=_0x2f6cbd-0x0;var _0xf02334=_0xc0ca[_0x2f6cbd];return _0xf02334;};'use strict';var _=require(_0xac0c('0x0'));var util=require(_0xac0c('0x1'));var moment=require(_0xac0c('0x2'));var BPromise=require('bluebird');var rs=require(_0xac0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac0c('0x4'))['db'];var utils=require(_0xac0c('0x5'));var logger=require(_0xac0c('0x6'))(_0xac0c('0x7'));var config=require(_0xac0c('0x8'));var jayson=require(_0xac0c('0x9'));var client=jayson[_0xac0c('0xa')][_0xac0c('0xb')]({'port':0x232a});config[_0xac0c('0xc')]=_[_0xac0c('0xd')](config[_0xac0c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xac0c('0xe'))(new Redis(config[_0xac0c('0xc')]));require(_0xac0c('0xf'))[_0xac0c('0x10')](socket);function respondWithRpcPromise(_0x1aebdb,_0x538c66,_0x1ce7d9){return new BPromise(function(_0x1999ed,_0x264854){return client['request'](_0x1aebdb,_0x1ce7d9)['then'](function(_0x12b86b){logger['info'](_0xac0c('0x11'),_0x538c66,_0xac0c('0x12'));logger[_0xac0c('0x13')](_0xac0c('0x14'),_0x538c66,'request\x20sent',JSON[_0xac0c('0x15')](_0x12b86b));if(_0x12b86b['error']){if(_0x12b86b[_0xac0c('0x16')][_0xac0c('0x17')]===0x1f4){logger[_0xac0c('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x538c66,_0x12b86b['error'][_0xac0c('0x18')]);return _0x264854(_0x12b86b[_0xac0c('0x16')][_0xac0c('0x18')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x538c66,_0x12b86b[_0xac0c('0x16')][_0xac0c('0x18')]);return _0x1999ed(_0x12b86b[_0xac0c('0x16')][_0xac0c('0x18')]);}else{logger[_0xac0c('0x19')](_0xac0c('0x11'),_0x538c66,_0xac0c('0x12'));_0x1999ed(_0x12b86b[_0xac0c('0x1a')][_0xac0c('0x18')]);}})[_0xac0c('0x1b')](function(_0x4571f1){logger[_0xac0c('0x16')](_0xac0c('0x11'),_0x538c66,_0x4571f1);_0x264854(_0x4571f1);});});}exports['GetVoiceQueueReport']=function(_0xfaa21e){var _0x48d81b=this;return new Promise(function(_0x1a0a09,_0x34aaf7){return db[_0xac0c('0x1c')][_0xac0c('0x1d')]({'raw':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')][_0xac0c('0x1f')]===undefined?!![]:![]:!![],'where':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')]['where']||null:null,'attributes':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')][_0xac0c('0x20')]||null:null,'limit':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e['options'][_0xac0c('0x21')]||null:null,'include':_0xfaa21e[_0xac0c('0x1e')]?_0xfaa21e[_0xac0c('0x1e')]['include']?_[_0xac0c('0x22')](_0xfaa21e['options'][_0xac0c('0x23')],function(_0x4e3206){return{'model':db[_0x4e3206[_0xac0c('0x24')]],'as':_0x4e3206['as'],'attributes':_0x4e3206[_0xac0c('0x20')],'include':_0x4e3206[_0xac0c('0x23')]?_[_0xac0c('0x22')](_0x4e3206['include'],function(_0x4e1f34){return{'model':db[_0x4e1f34[_0xac0c('0x24')]],'as':_0x4e1f34['as'],'attributes':_0x4e1f34[_0xac0c('0x20')],'include':_0x4e1f34['include']?_['map'](_0x4e1f34['include'],function(_0x323319){return{'model':db[_0x323319[_0xac0c('0x24')]],'as':_0x323319['as'],'attributes':_0x323319[_0xac0c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x261202){logger[_0xac0c('0x19')](_0xac0c('0x25'),_0xfaa21e);logger[_0xac0c('0x13')]('GetVoiceQueueReport',_0xfaa21e,JSON[_0xac0c('0x15')](_0x261202));_0x1a0a09(_0x261202);})['catch'](function(_0x3dd492){logger['error'](_0xac0c('0x25'),_0x3dd492[_0xac0c('0x18')],_0xfaa21e);_0x34aaf7(_0x48d81b[_0xac0c('0x16')](0x1f4,_0x3dd492[_0xac0c('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x1316c3){var _0x992836=this;return new Promise(function(_0x5a6c77,_0x288df2){return db[_0xac0c('0x1c')][_0xac0c('0x26')](_0x1316c3[_0xac0c('0x27')],{'raw':_0x1316c3[_0xac0c('0x1e')]?_0x1316c3[_0xac0c('0x1e')][_0xac0c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x54f27a){logger['info'](_0xac0c('0x28'),_0x1316c3);logger[_0xac0c('0x13')]('CreateVoiceQueueReport',_0x1316c3,JSON[_0xac0c('0x15')](_0x54f27a));_0x5a6c77(_0x54f27a);})[_0xac0c('0x1b')](function(_0x47dbb5){logger[_0xac0c('0x16')]('CreateVoiceQueueReport',_0x47dbb5[_0xac0c('0x18')],_0x1316c3);_0x288df2(_0x992836[_0xac0c('0x16')](0x1f4,_0x47dbb5[_0xac0c('0x18')]));});});};exports[_0xac0c('0x29')]=function(_0x42730a){var _0xc468c5=this;return new Promise(function(_0xfde512,_0x12984a){return db['VoiceQueueReport'][_0xac0c('0x2a')](_0x42730a[_0xac0c('0x27')],{'raw':_0x42730a[_0xac0c('0x1e')]?_0x42730a[_0xac0c('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42730a[_0xac0c('0x1e')]?_0x42730a[_0xac0c('0x1e')][_0xac0c('0x2b')]||null:null,'attributes':_0x42730a['options']?_0x42730a[_0xac0c('0x1e')][_0xac0c('0x20')]||null:null,'limit':_0x42730a['options']?_0x42730a[_0xac0c('0x1e')][_0xac0c('0x21')]||null:null})[_0xac0c('0x2c')](function(_0x4f52a7){logger[_0xac0c('0x19')]('UpdateVoiceQueueReport',_0x42730a);logger['debug'](_0xac0c('0x29'),_0x42730a,JSON[_0xac0c('0x15')](_0x4f52a7));_0xfde512(_0x4f52a7);})[_0xac0c('0x1b')](function(_0x92aee4){logger[_0xac0c('0x16')](_0xac0c('0x29'),_0x92aee4[_0xac0c('0x18')],_0x42730a);_0x12984a(_0xc468c5['error'](0x1f4,_0x92aee4['message']));});});}; \ No newline at end of file +var _0x34e2=['create','CreateVoiceQueueReport','debug','body','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','VoiceQueueReport','findAll','options','raw','where','limit','include','map','attributes','model','GetVoiceQueueReport','stringify'];(function(_0x1b277a,_0x5c6f98){var _0x1d720b=function(_0x543245){while(--_0x543245){_0x1b277a['push'](_0x1b277a['shift']());}};_0x1d720b(++_0x5c6f98);}(_0x34e2,0x155));var _0x234e=function(_0x33d78b,_0xfe9512){_0x33d78b=_0x33d78b-0x0;var _0x139bc4=_0x34e2[_0x33d78b];return _0x139bc4;};'use strict';var _=require(_0x234e('0x0'));var util=require(_0x234e('0x1'));var moment=require(_0x234e('0x2'));var BPromise=require('bluebird');var rs=require(_0x234e('0x3'));var fs=require('fs');var Redis=require(_0x234e('0x4'));var db=require(_0x234e('0x5'))['db'];var utils=require(_0x234e('0x6'));var logger=require(_0x234e('0x7'))(_0x234e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x234e('0x9')][_0x234e('0xa')]({'port':0x232a});config[_0x234e('0xb')]=_['defaults'](config['redis'],{'host':_0x234e('0xc'),'port':0x18eb});var socket=require(_0x234e('0xd'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x234e('0xe')](socket);function respondWithRpcPromise(_0x62adda,_0x3cdacd,_0x459533){return new BPromise(function(_0x3f8c1a,_0x4475c8){return client[_0x234e('0xf')](_0x62adda,_0x459533)[_0x234e('0x10')](function(_0x521454){logger['info'](_0x234e('0x11'),_0x3cdacd,_0x234e('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3cdacd,'request\x20sent',JSON['stringify'](_0x521454));if(_0x521454[_0x234e('0x13')]){if(_0x521454[_0x234e('0x13')][_0x234e('0x14')]===0x1f4){logger[_0x234e('0x13')](_0x234e('0x11'),_0x3cdacd,_0x521454[_0x234e('0x13')][_0x234e('0x15')]);return _0x4475c8(_0x521454[_0x234e('0x13')][_0x234e('0x15')]);}logger[_0x234e('0x13')](_0x234e('0x11'),_0x3cdacd,_0x521454[_0x234e('0x13')][_0x234e('0x15')]);return _0x3f8c1a(_0x521454[_0x234e('0x13')][_0x234e('0x15')]);}else{logger[_0x234e('0x16')](_0x234e('0x11'),_0x3cdacd,_0x234e('0x12'));_0x3f8c1a(_0x521454[_0x234e('0x17')][_0x234e('0x15')]);}})[_0x234e('0x18')](function(_0x29dacf){logger[_0x234e('0x13')](_0x234e('0x11'),_0x3cdacd,_0x29dacf);_0x4475c8(_0x29dacf);});});}exports['GetVoiceQueueReport']=function(_0xbddf1d){var _0x12fac2=this;return new Promise(function(_0x1d4a18,_0x357a0e){return db[_0x234e('0x19')][_0x234e('0x1a')]({'raw':_0xbddf1d[_0x234e('0x1b')]?_0xbddf1d['options'][_0x234e('0x1c')]===undefined?!![]:![]:!![],'where':_0xbddf1d['options']?_0xbddf1d[_0x234e('0x1b')][_0x234e('0x1d')]||null:null,'attributes':_0xbddf1d['options']?_0xbddf1d[_0x234e('0x1b')]['attributes']||null:null,'limit':_0xbddf1d[_0x234e('0x1b')]?_0xbddf1d[_0x234e('0x1b')][_0x234e('0x1e')]||null:null,'include':_0xbddf1d[_0x234e('0x1b')]?_0xbddf1d[_0x234e('0x1b')][_0x234e('0x1f')]?_[_0x234e('0x20')](_0xbddf1d[_0x234e('0x1b')]['include'],function(_0x470083){return{'model':db[_0x470083['model']],'as':_0x470083['as'],'attributes':_0x470083[_0x234e('0x21')],'include':_0x470083[_0x234e('0x1f')]?_['map'](_0x470083[_0x234e('0x1f')],function(_0x45db1c){return{'model':db[_0x45db1c[_0x234e('0x22')]],'as':_0x45db1c['as'],'attributes':_0x45db1c[_0x234e('0x21')],'include':_0x45db1c[_0x234e('0x1f')]?_[_0x234e('0x20')](_0x45db1c[_0x234e('0x1f')],function(_0x5d965c){return{'model':db[_0x5d965c[_0x234e('0x22')]],'as':_0x5d965c['as'],'attributes':_0x5d965c[_0x234e('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46b683){logger[_0x234e('0x16')](_0x234e('0x23'),_0xbddf1d);logger['debug'](_0x234e('0x23'),_0xbddf1d,JSON[_0x234e('0x24')](_0x46b683));_0x1d4a18(_0x46b683);})[_0x234e('0x18')](function(_0x23fa52){logger[_0x234e('0x13')](_0x234e('0x23'),_0x23fa52[_0x234e('0x15')],_0xbddf1d);_0x357a0e(_0x12fac2[_0x234e('0x13')](0x1f4,_0x23fa52[_0x234e('0x15')]));});});};exports['CreateVoiceQueueReport']=function(_0x7be52d){var _0x373c3c=this;return new Promise(function(_0x4017f6,_0xe584cb){return db[_0x234e('0x19')][_0x234e('0x25')](_0x7be52d['body'],{'raw':_0x7be52d[_0x234e('0x1b')]?_0x7be52d['options'][_0x234e('0x1c')]===undefined?!![]:![]:!![]})[_0x234e('0x10')](function(_0x5d9554){logger[_0x234e('0x16')](_0x234e('0x26'),_0x7be52d);logger[_0x234e('0x27')](_0x234e('0x26'),_0x7be52d,JSON[_0x234e('0x24')](_0x5d9554));_0x4017f6(_0x5d9554);})[_0x234e('0x18')](function(_0x15afde){logger['error']('CreateVoiceQueueReport',_0x15afde[_0x234e('0x15')],_0x7be52d);_0xe584cb(_0x373c3c[_0x234e('0x13')](0x1f4,_0x15afde[_0x234e('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x32f065){var _0xdd47ed=this;return new Promise(function(_0x4a0381,_0x46e3ac){return db[_0x234e('0x19')]['update'](_0x32f065[_0x234e('0x28')],{'raw':_0x32f065['options']?_0x32f065['options'][_0x234e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32f065[_0x234e('0x1b')]?_0x32f065[_0x234e('0x1b')][_0x234e('0x1d')]||null:null,'attributes':_0x32f065['options']?_0x32f065[_0x234e('0x1b')]['attributes']||null:null,'limit':_0x32f065['options']?_0x32f065[_0x234e('0x1b')]['limit']||null:null})[_0x234e('0x10')](function(_0xb8176e){logger[_0x234e('0x16')](_0x234e('0x29'),_0x32f065);logger[_0x234e('0x27')](_0x234e('0x29'),_0x32f065,JSON['stringify'](_0xb8176e));_0x4a0381(_0xb8176e);})[_0x234e('0x18')](function(_0x566677){logger['error'](_0x234e('0x29'),_0x566677[_0x234e('0x15')],_0x32f065);_0x46e3ac(_0xdd47ed[_0x234e('0x13')](0x1f4,_0x566677[_0x234e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e3c5729..6297172 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 _0x010a=['register','voiceQueueReport:','save','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x010a,0x1f4));var _0xa010=function(_0x4c4cbc,_0x5cc924){_0x4c4cbc=_0x4c4cbc-0x0;var _0x7608c3=_0x010a[_0x4c4cbc];return _0x7608c3;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xa010('0x0'),'remove',_0xa010('0x1')];function createListener(_0x105330,_0x4cc67a){return function(_0x47652c){_0x4cc67a[_0xa010('0x2')](_0x105330,_0x47652c);};}function removeListener(_0x2c0c40,_0x17fe51){return function(){VoiceQueueReportEvents[_0xa010('0x3')](_0x2c0c40,_0x17fe51);};}exports[_0xa010('0x4')]=function(_0x198d67){for(var _0x1f2f47=0x0,_0x39235c=events['length'];_0x1f2f47<_0x39235c;_0x1f2f47++){var _0x45f03=events[_0x1f2f47];var _0x368806=createListener(_0xa010('0x5')+_0x45f03,_0x198d67);VoiceQueueReportEvents['on'](_0x45f03,_0x368806);}}; \ No newline at end of file +var _0x6a93=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','removeListener','register'];(function(_0x43046e,_0x7977aa){var _0x54f608=function(_0xcc797){while(--_0xcc797){_0x43046e['push'](_0x43046e['shift']());}};_0x54f608(++_0x7977aa);}(_0x6a93,0x1d7));var _0x36a9=function(_0x1492f3,_0x379a97){_0x1492f3=_0x1492f3-0x0;var _0x51a288=_0x6a93[_0x1492f3];return _0x51a288;};'use strict';var VoiceQueueReportEvents=require(_0x36a9('0x0'));var events=[_0x36a9('0x1'),_0x36a9('0x2'),'update'];function createListener(_0x508291,_0x3d1196){return function(_0x209444){_0x3d1196['emit'](_0x508291,_0x209444);};}function removeListener(_0x2deb45,_0x2127e0){return function(){VoiceQueueReportEvents[_0x36a9('0x3')](_0x2deb45,_0x2127e0);};}exports[_0x36a9('0x4')]=function(_0x2c1be3){for(var _0x6de7d=0x0,_0x258db9=events[_0x36a9('0x5')];_0x6de7d<_0x258db9;_0x6de7d++){var _0x156951=events[_0x6de7d];var _0x444d75=createListener(_0x36a9('0x6')+_0x156951,_0x2c1be3);VoiceQueueReportEvents['on'](_0x156951,_0x444d75);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0db71a1..cc2cbc6 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 _0xc7e6=['util','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2fdba5,_0x541898){var _0x2089c1=function(_0x506b33){while(--_0x506b33){_0x2fdba5['push'](_0x2fdba5['shift']());}};_0x2089c1(++_0x541898);}(_0xc7e6,0x1ef));var _0x6c7e=function(_0x5285d0,_0x3d424c){_0x5285d0=_0x5285d0-0x0;var _0x4dd0a2=_0xc7e6[_0x5285d0];return _0x4dd0a2;};'use strict';var multer=require(_0x6c7e('0x0'));var util=require(_0x6c7e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c7e('0x2')]();var fs_extra=require(_0x6c7e('0x3'));var auth=require(_0x6c7e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6c7e('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x6c7e('0x6')]('/',auth['isAuthenticated'](),controller[_0x6c7e('0x7')]);router['get']('/:id',auth[_0x6c7e('0x8')](),controller['show']);router[_0x6c7e('0x9')]('/',auth[_0x6c7e('0x8')](),controller[_0x6c7e('0xa')]);router[_0x6c7e('0xb')]('/:id',auth[_0x6c7e('0x8')](),controller[_0x6c7e('0xc')]);router[_0x6c7e('0xd')]('/:id',auth[_0x6c7e('0x8')](),controller[_0x6c7e('0xe')]);module[_0x6c7e('0xf')]=router; \ No newline at end of file +var _0xecc5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','multer','path'];(function(_0x3befec,_0x17c37b){var _0x87a919=function(_0x16436d){while(--_0x16436d){_0x3befec['push'](_0x3befec['shift']());}};_0x87a919(++_0x17c37b);}(_0xecc5,0x96));var _0x5ecc=function(_0x3771ea,_0x1d135f){_0x3771ea=_0x3771ea-0x0;var _0x39503a=_0xecc5[_0x3771ea];return _0x39503a;};'use strict';var multer=require(_0x5ecc('0x0'));var util=require('util');var path=require(_0x5ecc('0x1'));var timeout=require(_0x5ecc('0x2'));var express=require(_0x5ecc('0x3'));var router=express[_0x5ecc('0x4')]();var fs_extra=require(_0x5ecc('0x5'));var auth=require(_0x5ecc('0x6'));var interaction=require(_0x5ecc('0x7'));var config=require(_0x5ecc('0x8'));var controller=require(_0x5ecc('0x9'));router[_0x5ecc('0xa')]('/',auth[_0x5ecc('0xb')](),controller['index']);router[_0x5ecc('0xa')](_0x5ecc('0xc'),auth[_0x5ecc('0xb')](),controller[_0x5ecc('0xd')]);router[_0x5ecc('0xe')]('/',auth[_0x5ecc('0xb')](),controller['create']);router[_0x5ecc('0xf')](_0x5ecc('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5ecc('0x10')](_0x5ecc('0xc'),auth[_0x5ecc('0xb')](),controller[_0x5ecc('0x11')]);module[_0x5ecc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 38afdfb..25c1667 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 _0xaa40=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0xec359a,_0x5981db){var _0x49b5b8=function(_0x2b310c){while(--_0x2b310c){_0xec359a['push'](_0xec359a['shift']());}};_0x49b5b8(++_0x5981db);}(_0xaa40,0x107));var _0x0aa4=function(_0x365962,_0x4d168c){_0x365962=_0x365962-0x0;var _0xeb69e4=_0xaa40[_0x365962];return _0xeb69e4;};'use strict';var Sequelize=require(_0x0aa4('0x0'));var moment=require('moment');module[_0x0aa4('0x1')]={'time':{'type':Sequelize[_0x0aa4('0x2')]},'callid':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0aa4('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0aa4('0x3')],'allowNull':![],'defaultValue':moment()[_0x0aa4('0x4')](_0x0aa4('0x5'))}}; \ No newline at end of file +var _0x00f0=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x18b973,_0x2259b9){var _0x288b49=function(_0x111726){while(--_0x111726){_0x18b973['push'](_0x18b973['shift']());}};_0x288b49(++_0x2259b9);}(_0x00f0,0xec));var _0x000f=function(_0x2bb0c8,_0x545654){_0x2bb0c8=_0x2bb0c8-0x0;var _0x2facdb=_0x00f0[_0x2bb0c8];return _0x2facdb;};'use strict';var Sequelize=require(_0x000f('0x0'));var moment=require(_0x000f('0x1'));module[_0x000f('0x2')]={'time':{'type':Sequelize[_0x000f('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x000f('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x000f('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x000f('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x000f('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x000f('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x000f('0x4')],'allowNull':![],'defaultValue':moment()[_0x000f('0x5')](_0x000f('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 884d41f..4328a37 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 _0x304a=['catch','show','rawAttributes','intersection','find','body','update','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','VoiceQueuesLog','fieldName','type','key','keys','query','filters','model','attributes','fields','length','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x304a,0x12d));var _0xa304=function(_0xca81f,_0x27286f){_0xca81f=_0xca81f-0x0;var _0x56294e=_0x304a[_0xca81f];return _0x56294e;};'use strict';var emlformat=require(_0xa304('0x0'));var rimraf=require(_0xa304('0x1'));var zipdir=require(_0xa304('0x2'));var jsonpatch=require(_0xa304('0x3'));var rp=require(_0xa304('0x4'));var moment=require(_0xa304('0x5'));var BPromise=require(_0xa304('0x6'));var Mustache=require(_0xa304('0x7'));var util=require(_0xa304('0x8'));var path=require('path');var sox=require(_0xa304('0x9'));var csv=require(_0xa304('0xa'));var ejs=require(_0xa304('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa304('0xc'));var deskjs=require(_0xa304('0xd'));var toCsv=require(_0xa304('0xa'));var querystring=require(_0xa304('0xe'));var Papa=require(_0xa304('0xf'));var Redis=require(_0xa304('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa304('0x11'));var as=require(_0xa304('0x12'));var hardwareService=require(_0xa304('0x13'));var logger=require('../../config/logger')(_0xa304('0x14'));var utils=require(_0xa304('0x15'));var config=require(_0xa304('0x16'));var licenseUtil=require(_0xa304('0x17'));var db=require(_0xa304('0x18'))['db'];function respondWithStatusCode(_0x27b6ac,_0xad9be4){_0xad9be4=_0xad9be4||0xcc;return function(_0x2dfd9e){if(_0x2dfd9e){return _0x27b6ac[_0xa304('0x19')](_0xad9be4);}return _0x27b6ac[_0xa304('0x1a')](_0xad9be4)[_0xa304('0x1b')]();};}function respondWithResult(_0xd2bd9d,_0x337197){_0x337197=_0x337197||0xc8;return function(_0x3917ae){if(_0x3917ae){return _0xd2bd9d[_0xa304('0x1a')](_0x337197)[_0xa304('0x1c')](_0x3917ae);}};}function respondWithFilteredResult(_0x4637a7,_0x13f670){return function(_0x2269fe){if(_0x2269fe){var _0x4f0d5c=typeof _0x13f670[_0xa304('0x1d')]==='undefined'&&typeof _0x13f670[_0xa304('0x1e')]==='undefined';var _0x19aa5e=_0x2269fe[_0xa304('0x1f')];var _0x23c1c9=_0x4f0d5c?0x0:_0x13f670[_0xa304('0x1d')];var _0x12e22f=_0x4f0d5c?_0x2269fe[_0xa304('0x1f')]:_0x13f670[_0xa304('0x1d')]+_0x13f670['limit'];var _0x516f5b;if(_0x12e22f>=_0x19aa5e){_0x12e22f=_0x19aa5e;_0x516f5b=0xc8;}else{_0x516f5b=0xce;}_0x4637a7[_0xa304('0x1a')](_0x516f5b);return _0x4637a7[_0xa304('0x20')](_0xa304('0x21'),_0x23c1c9+'-'+_0x12e22f+'/'+_0x19aa5e)[_0xa304('0x1c')](_0x2269fe);}return null;};}function patchUpdates(_0x325349){return function(_0x3602ac){try{jsonpatch[_0xa304('0x22')](_0x3602ac,_0x325349,!![]);}catch(_0x449a5e){return BPromise[_0xa304('0x23')](_0x449a5e);}return _0x3602ac[_0xa304('0x24')]();};}function saveUpdates(_0x19ef2e,_0x34eb88){return function(_0x186830){if(_0x186830){return _0x186830['update'](_0x19ef2e)[_0xa304('0x25')](function(_0x3293f5){return _0x3293f5;});}return null;};}function removeEntity(_0x354354,_0x36c3c2){return function(_0x2205b9){if(_0x2205b9){return _0x2205b9['destroy']()['then'](function(){_0x354354[_0xa304('0x1a')](0xcc)[_0xa304('0x1b')]();});}};}function handleEntityNotFound(_0x2509b3,_0x3d233a){return function(_0x386307){if(!_0x386307){_0x2509b3[_0xa304('0x19')](0x194);}return _0x386307;};}function handleError(_0x517111,_0x27ee19){_0x27ee19=_0x27ee19||0x1f4;return function(_0x353c0e){logger['error'](_0x353c0e[_0xa304('0x26')]);if(_0x353c0e[_0xa304('0x27')]){delete _0x353c0e['name'];}_0x517111[_0xa304('0x1a')](_0x27ee19)[_0xa304('0x28')](_0x353c0e);};}exports[_0xa304('0x29')]=function(_0x39d57f,_0x580a01){var _0x18a06f={},_0x33e4d4={},_0x469b72={'count':0x0,'rows':[]};var _0x2901b3=_['map'](db[_0xa304('0x2a')]['rawAttributes'],function(_0x27a979){return{'name':_0x27a979[_0xa304('0x2b')],'type':_0x27a979[_0xa304('0x2c')][_0xa304('0x2d')]};});_0x33e4d4['model']=_['map'](_0x2901b3,_0xa304('0x27'));_0x33e4d4['query']=_[_0xa304('0x2e')](_0x39d57f[_0xa304('0x2f')]);_0x33e4d4[_0xa304('0x30')]=_['intersection'](_0x33e4d4[_0xa304('0x31')],_0x33e4d4[_0xa304('0x2f')]);_0x18a06f[_0xa304('0x32')]=_['intersection'](_0x33e4d4[_0xa304('0x31')],qs[_0xa304('0x33')](_0x39d57f['query'][_0xa304('0x33')]));_0x18a06f[_0xa304('0x32')]=_0x18a06f[_0xa304('0x32')][_0xa304('0x34')]?_0x18a06f[_0xa304('0x32')]:_0x33e4d4[_0xa304('0x31')];if(!_0x39d57f[_0xa304('0x2f')]['hasOwnProperty']('nolimit')){_0x18a06f[_0xa304('0x1e')]=qs[_0xa304('0x1e')](_0x39d57f[_0xa304('0x2f')][_0xa304('0x1e')]);_0x18a06f[_0xa304('0x1d')]=qs[_0xa304('0x1d')](_0x39d57f[_0xa304('0x2f')][_0xa304('0x1d')]);}_0x18a06f[_0xa304('0x35')]=qs[_0xa304('0x36')](_0x39d57f[_0xa304('0x2f')]['sort']);_0x18a06f[_0xa304('0x37')]=qs[_0xa304('0x30')](_[_0xa304('0x38')](_0x39d57f[_0xa304('0x2f')],_0x33e4d4['filters']),_0x2901b3);if(_0x39d57f[_0xa304('0x2f')]['filter']){_0x18a06f[_0xa304('0x37')]=_[_0xa304('0x39')](_0x18a06f[_0xa304('0x37')],{'$or':_[_0xa304('0x3a')](_0x2901b3,function(_0x6fee0){if(_0x6fee0[_0xa304('0x2c')]!==_0xa304('0x3b')){var _0x381560={};_0x381560[_0x6fee0[_0xa304('0x27')]]={'$like':'%'+_0x39d57f[_0xa304('0x2f')][_0xa304('0x3c')]+'%'};return _0x381560;}})});}_0x18a06f=_[_0xa304('0x39')]({},_0x18a06f,_0x39d57f[_0xa304('0x3d')]);var _0x1cb75d={'where':_0x18a06f[_0xa304('0x37')]};return db[_0xa304('0x2a')]['count'](_0x1cb75d)[_0xa304('0x25')](function(_0x1a2713){_0x469b72['count']=_0x1a2713;if(_0x39d57f['query'][_0xa304('0x3e')]){_0x18a06f[_0xa304('0x3f')]=[{'all':!![]}];}return db[_0xa304('0x2a')]['findAll'](_0x18a06f);})['then'](function(_0x425159){_0x469b72['rows']=_0x425159;return _0x469b72;})[_0xa304('0x25')](respondWithFilteredResult(_0x580a01,_0x18a06f))[_0xa304('0x40')](handleError(_0x580a01,null));};exports[_0xa304('0x41')]=function(_0x79553d,_0x4699f0){var _0xa8d9f9={'raw':!![],'where':{'id':_0x79553d['params']['id']}},_0x53e1c1={};_0x53e1c1['model']=_[_0xa304('0x2e')](db['VoiceQueuesLog'][_0xa304('0x42')]);_0x53e1c1[_0xa304('0x2f')]=_[_0xa304('0x2e')](_0x79553d[_0xa304('0x2f')]);_0x53e1c1[_0xa304('0x30')]=_[_0xa304('0x43')](_0x53e1c1[_0xa304('0x31')],_0x53e1c1['query']);_0xa8d9f9['attributes']=_[_0xa304('0x43')](_0x53e1c1[_0xa304('0x31')],qs[_0xa304('0x33')](_0x79553d[_0xa304('0x2f')][_0xa304('0x33')]));_0xa8d9f9['attributes']=_0xa8d9f9['attributes']['length']?_0xa8d9f9[_0xa304('0x32')]:_0x53e1c1[_0xa304('0x31')];if(_0x79553d[_0xa304('0x2f')][_0xa304('0x3e')]){_0xa8d9f9[_0xa304('0x3f')]=[{'all':!![]}];}_0xa8d9f9=_[_0xa304('0x39')]({},_0xa8d9f9,_0x79553d['options']);return db[_0xa304('0x2a')][_0xa304('0x44')](_0xa8d9f9)[_0xa304('0x25')](handleEntityNotFound(_0x4699f0,null))[_0xa304('0x25')](respondWithResult(_0x4699f0,null))[_0xa304('0x40')](handleError(_0x4699f0,null));};exports['create']=function(_0x1a5e16,_0x2a5c9a){return db[_0xa304('0x2a')]['create'](_0x1a5e16[_0xa304('0x45')],{})['then'](respondWithResult(_0x2a5c9a,0xc9))[_0xa304('0x40')](handleError(_0x2a5c9a,null));};exports[_0xa304('0x46')]=function(_0x4e04c2,_0xbfb120){if(_0x4e04c2[_0xa304('0x45')]['id']){delete _0x4e04c2[_0xa304('0x45')]['id'];}return db['VoiceQueuesLog'][_0xa304('0x44')]({'where':{'id':_0x4e04c2['params']['id']}})['then'](handleEntityNotFound(_0xbfb120,null))[_0xa304('0x25')](saveUpdates(_0x4e04c2[_0xa304('0x45')],null))['then'](respondWithResult(_0xbfb120,null))[_0xa304('0x40')](handleError(_0xbfb120,null));};exports[_0xa304('0x47')]=function(_0x11ae93,_0x24f9fc){return db['VoiceQueuesLog']['find']({'where':{'id':_0x11ae93[_0xa304('0x48')]['id']}})['then'](handleEntityNotFound(_0x24f9fc,null))[_0xa304('0x25')](removeEntity(_0x24f9fc,null))[_0xa304('0x40')](handleError(_0x24f9fc,null));}; \ No newline at end of file +var _0x2ec4=['type','VIRTUAL','options','includeAll','include','rows','catch','params','merge','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2ec4,0x11c));var _0x42ec=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2ec4[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0x42ec('0x0'));var rimraf=require(_0x42ec('0x1'));var zipdir=require(_0x42ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x42ec('0x3'));var BPromise=require(_0x42ec('0x4'));var Mustache=require(_0x42ec('0x5'));var util=require('util');var path=require('path');var sox=require(_0x42ec('0x6'));var csv=require(_0x42ec('0x7'));var ejs=require(_0x42ec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42ec('0x9'));var squel=require(_0x42ec('0xa'));var crypto=require(_0x42ec('0xb'));var jsforce=require(_0x42ec('0xc'));var deskjs=require(_0x42ec('0xd'));var toCsv=require(_0x42ec('0x7'));var querystring=require(_0x42ec('0xe'));var Papa=require(_0x42ec('0xf'));var Redis=require(_0x42ec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x42ec('0x11'));var hardwareService=require(_0x42ec('0x12'));var logger=require(_0x42ec('0x13'))('api');var utils=require(_0x42ec('0x14'));var config=require(_0x42ec('0x15'));var licenseUtil=require(_0x42ec('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7ead1e,_0x13a791){_0x13a791=_0x13a791||0xcc;return function(_0x2fa1c1){if(_0x2fa1c1){return _0x7ead1e[_0x42ec('0x17')](_0x13a791);}return _0x7ead1e[_0x42ec('0x18')](_0x13a791)['end']();};}function respondWithResult(_0x30624d,_0x3d94a2){_0x3d94a2=_0x3d94a2||0xc8;return function(_0x18e150){if(_0x18e150){return _0x30624d[_0x42ec('0x18')](_0x3d94a2)[_0x42ec('0x19')](_0x18e150);}};}function respondWithFilteredResult(_0x2d94f4,_0x33d58f){return function(_0x16b3d8){if(_0x16b3d8){var _0x17fe37=typeof _0x33d58f[_0x42ec('0x1a')]===_0x42ec('0x1b')&&typeof _0x33d58f[_0x42ec('0x1c')]===_0x42ec('0x1b');var _0x55acaf=_0x16b3d8['count'];var _0x3b1057=_0x17fe37?0x0:_0x33d58f['offset'];var _0x1701a4=_0x17fe37?_0x16b3d8[_0x42ec('0x1d')]:_0x33d58f[_0x42ec('0x1a')]+_0x33d58f[_0x42ec('0x1c')];var _0x49f62b;if(_0x1701a4>=_0x55acaf){_0x1701a4=_0x55acaf;_0x49f62b=0xc8;}else{_0x49f62b=0xce;}_0x2d94f4[_0x42ec('0x18')](_0x49f62b);return _0x2d94f4[_0x42ec('0x1e')]('Content-Range',_0x3b1057+'-'+_0x1701a4+'/'+_0x55acaf)[_0x42ec('0x19')](_0x16b3d8);}return null;};}function patchUpdates(_0x865a19){return function(_0x1b7a37){try{jsonpatch[_0x42ec('0x1f')](_0x1b7a37,_0x865a19,!![]);}catch(_0x4df496){return BPromise['reject'](_0x4df496);}return _0x1b7a37['save']();};}function saveUpdates(_0x9f395c,_0x3857b6){return function(_0x3ed60a){if(_0x3ed60a){return _0x3ed60a[_0x42ec('0x20')](_0x9f395c)[_0x42ec('0x21')](function(_0x5c959c){return _0x5c959c;});}return null;};}function removeEntity(_0xff2b12,_0xa0d082){return function(_0x389f8f){if(_0x389f8f){return _0x389f8f[_0x42ec('0x22')]()[_0x42ec('0x21')](function(){_0xff2b12[_0x42ec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32f2fe,_0x2b2dc2){return function(_0x3b5d21){if(!_0x3b5d21){_0x32f2fe['sendStatus'](0x194);}return _0x3b5d21;};}function handleError(_0x699206,_0x20699e){_0x20699e=_0x20699e||0x1f4;return function(_0xdf0473){logger[_0x42ec('0x23')](_0xdf0473[_0x42ec('0x24')]);if(_0xdf0473[_0x42ec('0x25')]){delete _0xdf0473[_0x42ec('0x25')];}_0x699206['status'](_0x20699e)[_0x42ec('0x26')](_0xdf0473);};}exports['index']=function(_0xcc91a8,_0x37712e){var _0x1b7f0d={},_0x169db9={},_0x3dd6e1={'count':0x0,'rows':[]};var _0x15687b=_[_0x42ec('0x27')](db[_0x42ec('0x28')][_0x42ec('0x29')],function(_0xa34cfa){return{'name':_0xa34cfa['fieldName'],'type':_0xa34cfa['type'][_0x42ec('0x2a')]};});_0x169db9[_0x42ec('0x2b')]=_[_0x42ec('0x27')](_0x15687b,_0x42ec('0x25'));_0x169db9[_0x42ec('0x2c')]=_[_0x42ec('0x2d')](_0xcc91a8[_0x42ec('0x2c')]);_0x169db9[_0x42ec('0x2e')]=_[_0x42ec('0x2f')](_0x169db9[_0x42ec('0x2b')],_0x169db9[_0x42ec('0x2c')]);_0x1b7f0d[_0x42ec('0x30')]=_['intersection'](_0x169db9[_0x42ec('0x2b')],qs[_0x42ec('0x31')](_0xcc91a8[_0x42ec('0x2c')][_0x42ec('0x31')]));_0x1b7f0d['attributes']=_0x1b7f0d[_0x42ec('0x30')][_0x42ec('0x32')]?_0x1b7f0d[_0x42ec('0x30')]:_0x169db9[_0x42ec('0x2b')];if(!_0xcc91a8[_0x42ec('0x2c')]['hasOwnProperty'](_0x42ec('0x33'))){_0x1b7f0d[_0x42ec('0x1c')]=qs['limit'](_0xcc91a8[_0x42ec('0x2c')]['limit']);_0x1b7f0d[_0x42ec('0x1a')]=qs[_0x42ec('0x1a')](_0xcc91a8[_0x42ec('0x2c')][_0x42ec('0x1a')]);}_0x1b7f0d['order']=qs[_0x42ec('0x34')](_0xcc91a8['query']['sort']);_0x1b7f0d[_0x42ec('0x35')]=qs['filters'](_[_0x42ec('0x36')](_0xcc91a8[_0x42ec('0x2c')],_0x169db9[_0x42ec('0x2e')]),_0x15687b);if(_0xcc91a8[_0x42ec('0x2c')][_0x42ec('0x37')]){_0x1b7f0d[_0x42ec('0x35')]=_['merge'](_0x1b7f0d[_0x42ec('0x35')],{'$or':_[_0x42ec('0x27')](_0x15687b,function(_0x32cf6c){if(_0x32cf6c[_0x42ec('0x38')]!==_0x42ec('0x39')){var _0x2bc76f={};_0x2bc76f[_0x32cf6c[_0x42ec('0x25')]]={'$like':'%'+_0xcc91a8[_0x42ec('0x2c')][_0x42ec('0x37')]+'%'};return _0x2bc76f;}})});}_0x1b7f0d=_['merge']({},_0x1b7f0d,_0xcc91a8[_0x42ec('0x3a')]);var _0x281bd1={'where':_0x1b7f0d['where']};return db[_0x42ec('0x28')][_0x42ec('0x1d')](_0x281bd1)[_0x42ec('0x21')](function(_0x592aeb){_0x3dd6e1[_0x42ec('0x1d')]=_0x592aeb;if(_0xcc91a8[_0x42ec('0x2c')][_0x42ec('0x3b')]){_0x1b7f0d[_0x42ec('0x3c')]=[{'all':!![]}];}return db[_0x42ec('0x28')]['findAll'](_0x1b7f0d);})[_0x42ec('0x21')](function(_0xa3dd09){_0x3dd6e1[_0x42ec('0x3d')]=_0xa3dd09;return _0x3dd6e1;})[_0x42ec('0x21')](respondWithFilteredResult(_0x37712e,_0x1b7f0d))[_0x42ec('0x3e')](handleError(_0x37712e,null));};exports['show']=function(_0x41756d,_0x3367cf){var _0x9cbac9={'raw':!![],'where':{'id':_0x41756d[_0x42ec('0x3f')]['id']}},_0x11c580={};_0x11c580['model']=_[_0x42ec('0x2d')](db[_0x42ec('0x28')][_0x42ec('0x29')]);_0x11c580['query']=_['keys'](_0x41756d['query']);_0x11c580[_0x42ec('0x2e')]=_[_0x42ec('0x2f')](_0x11c580[_0x42ec('0x2b')],_0x11c580[_0x42ec('0x2c')]);_0x9cbac9[_0x42ec('0x30')]=_[_0x42ec('0x2f')](_0x11c580[_0x42ec('0x2b')],qs[_0x42ec('0x31')](_0x41756d[_0x42ec('0x2c')]['fields']));_0x9cbac9[_0x42ec('0x30')]=_0x9cbac9['attributes'][_0x42ec('0x32')]?_0x9cbac9[_0x42ec('0x30')]:_0x11c580[_0x42ec('0x2b')];if(_0x41756d[_0x42ec('0x2c')][_0x42ec('0x3b')]){_0x9cbac9[_0x42ec('0x3c')]=[{'all':!![]}];}_0x9cbac9=_[_0x42ec('0x40')]({},_0x9cbac9,_0x41756d[_0x42ec('0x3a')]);return db[_0x42ec('0x28')]['find'](_0x9cbac9)['then'](handleEntityNotFound(_0x3367cf,null))[_0x42ec('0x21')](respondWithResult(_0x3367cf,null))[_0x42ec('0x3e')](handleError(_0x3367cf,null));};exports[_0x42ec('0x41')]=function(_0x575bca,_0x30311b){return db[_0x42ec('0x28')][_0x42ec('0x41')](_0x575bca[_0x42ec('0x42')],{})['then'](respondWithResult(_0x30311b,0xc9))[_0x42ec('0x3e')](handleError(_0x30311b,null));};exports[_0x42ec('0x20')]=function(_0x1ad4d6,_0x21aa98){if(_0x1ad4d6['body']['id']){delete _0x1ad4d6[_0x42ec('0x42')]['id'];}return db[_0x42ec('0x28')]['find']({'where':{'id':_0x1ad4d6[_0x42ec('0x3f')]['id']}})[_0x42ec('0x21')](handleEntityNotFound(_0x21aa98,null))['then'](saveUpdates(_0x1ad4d6[_0x42ec('0x42')],null))[_0x42ec('0x21')](respondWithResult(_0x21aa98,null))['catch'](handleError(_0x21aa98,null));};exports[_0x42ec('0x22')]=function(_0x5772e5,_0x335a6e){return db['VoiceQueuesLog'][_0x42ec('0x43')]({'where':{'id':_0x5772e5['params']['id']}})[_0x42ec('0x21')](handleEntityNotFound(_0x335a6e,null))[_0x42ec('0x21')](removeEntity(_0x335a6e,null))['catch'](handleError(_0x335a6e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 610a077..a0ed3d7 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 _0xa7aa=['api','moment','bluebird','request-promise','../../config/environment','voice_queues_log','event_dtm','event','dtm','util','../../config/logger'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa7aa,0x8d));var _0xaa7a=function(_0x172ccc,_0x2e4da5){_0x172ccc=_0x172ccc-0x0;var _0x14c2d2=_0xa7aa[_0x172ccc];return _0x14c2d2;};'use strict';var _=require('lodash');var util=require(_0xaa7a('0x0'));var logger=require(_0xaa7a('0x1'))(_0xaa7a('0x2'));var moment=require(_0xaa7a('0x3'));var BPromise=require(_0xaa7a('0x4'));var rp=require(_0xaa7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa7a('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x5675f3,_0x4159ec){return _0x5675f3['define']('VoiceQueuesLog',attributes,{'tableName':_0xaa7a('0x7'),'paranoid':![],'indexes':[{'name':_0xaa7a('0x8'),'fields':[_0xaa7a('0x9'),_0xaa7a('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xaced=['define','VoiceQueuesLog','voice_queues_log','event_dtm','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xaced,0x18c));var _0xdace=function(_0x199697,_0x3d296b){_0x199697=_0x199697-0x0;var _0x2b01fa=_0xaced[_0x199697];return _0x2b01fa;};'use strict';var _=require(_0xdace('0x0'));var util=require(_0xdace('0x1'));var logger=require(_0xdace('0x2'))(_0xdace('0x3'));var moment=require(_0xdace('0x4'));var BPromise=require('bluebird');var rp=require(_0xdace('0x5'));var fs=require('fs');var path=require(_0xdace('0x6'));var rimraf=require(_0xdace('0x7'));var config=require(_0xdace('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0xdace('0x9')]=function(_0x4d7f80,_0x5f5d92){return _0x4d7f80[_0xdace('0xa')](_0xdace('0xb'),attributes,{'tableName':_0xdace('0xc'),'paranoid':![],'indexes':[{'name':_0xdace('0xd'),'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 680002e..d1cde69 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 _0xf9b2=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result'];(function(_0x102662,_0x355699){var _0x3b0762=function(_0x2040d0){while(--_0x2040d0){_0x102662['push'](_0x102662['shift']());}};_0x3b0762(++_0x355699);}(_0xf9b2,0x9a));var _0x2f9b=function(_0x34e684,_0x30feb5){_0x34e684=_0x34e684-0x0;var _0x4e9039=_0xf9b2[_0x34e684];return _0x4e9039;};'use strict';var _=require(_0x2f9b('0x0'));var util=require(_0x2f9b('0x1'));var moment=require(_0x2f9b('0x2'));var BPromise=require(_0x2f9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f9b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f9b('0x6'));var jayson=require(_0x2f9b('0x7'));var client=jayson[_0x2f9b('0x8')][_0x2f9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae8281,_0x329642,_0xcf6aea){return new BPromise(function(_0x4bf726,_0x21a47e){return client[_0x2f9b('0xa')](_0xae8281,_0xcf6aea)[_0x2f9b('0xb')](function(_0x5dfcbf){logger[_0x2f9b('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x329642,_0x2f9b('0xd'));logger[_0x2f9b('0xe')](_0x2f9b('0xf'),_0x329642,_0x2f9b('0xd'),JSON[_0x2f9b('0x10')](_0x5dfcbf));if(_0x5dfcbf[_0x2f9b('0x11')]){if(_0x5dfcbf['error'][_0x2f9b('0x12')]===0x1f4){logger[_0x2f9b('0x11')](_0x2f9b('0x13'),_0x329642,_0x5dfcbf[_0x2f9b('0x11')]['message']);return _0x21a47e(_0x5dfcbf[_0x2f9b('0x11')][_0x2f9b('0x14')]);}logger['error'](_0x2f9b('0x13'),_0x329642,_0x5dfcbf[_0x2f9b('0x11')]['message']);return _0x4bf726(_0x5dfcbf['error'][_0x2f9b('0x14')]);}else{logger[_0x2f9b('0xc')](_0x2f9b('0x13'),_0x329642,_0x2f9b('0xd'));_0x4bf726(_0x5dfcbf[_0x2f9b('0x15')]['message']);}})['catch'](function(_0x1fedfa){logger[_0x2f9b('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x329642,_0x1fedfa);_0x21a47e(_0x1fedfa);});});} \ No newline at end of file +var _0x2b5f=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x4f9a71,_0x4dfa0a){var _0x5526b9=function(_0x44c3fd){while(--_0x44c3fd){_0x4f9a71['push'](_0x4f9a71['shift']());}};_0x5526b9(++_0x4dfa0a);}(_0x2b5f,0x118));var _0xf2b5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2b5f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf2b5('0x0'));var util=require(_0xf2b5('0x1'));var moment=require(_0xf2b5('0x2'));var BPromise=require(_0xf2b5('0x3'));var rs=require(_0xf2b5('0x4'));var fs=require('fs');var Redis=require(_0xf2b5('0x5'));var db=require(_0xf2b5('0x6'))['db'];var utils=require(_0xf2b5('0x7'));var logger=require(_0xf2b5('0x8'))(_0xf2b5('0x9'));var config=require(_0xf2b5('0xa'));var jayson=require(_0xf2b5('0xb'));var client=jayson[_0xf2b5('0xc')][_0xf2b5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x554539,_0x34e7a2,_0xd6e9f){return new BPromise(function(_0x2d6659,_0xa6008f){return client[_0xf2b5('0xe')](_0x554539,_0xd6e9f)[_0xf2b5('0xf')](function(_0x5b1169){logger[_0xf2b5('0x10')](_0xf2b5('0x11'),_0x34e7a2,_0xf2b5('0x12'));logger['debug'](_0xf2b5('0x13'),_0x34e7a2,_0xf2b5('0x12'),JSON[_0xf2b5('0x14')](_0x5b1169));if(_0x5b1169[_0xf2b5('0x15')]){if(_0x5b1169[_0xf2b5('0x15')][_0xf2b5('0x16')]===0x1f4){logger['error'](_0xf2b5('0x11'),_0x34e7a2,_0x5b1169['error'][_0xf2b5('0x17')]);return _0xa6008f(_0x5b1169[_0xf2b5('0x15')][_0xf2b5('0x17')]);}logger[_0xf2b5('0x15')](_0xf2b5('0x11'),_0x34e7a2,_0x5b1169[_0xf2b5('0x15')][_0xf2b5('0x17')]);return _0x2d6659(_0x5b1169[_0xf2b5('0x15')][_0xf2b5('0x17')]);}else{logger['info'](_0xf2b5('0x11'),_0x34e7a2,_0xf2b5('0x12'));_0x2d6659(_0x5b1169['result'][_0xf2b5('0x17')]);}})[_0xf2b5('0x18')](function(_0x308886){logger[_0xf2b5('0x15')](_0xf2b5('0x11'),_0x34e7a2,_0x308886);_0xa6008f(_0x308886);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 598bbe5..238060a 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 _0xbf2c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbf2c,0x114));var _0xcbf2=function(_0x3bcf96,_0x31a36b){_0x3bcf96=_0x3bcf96-0x0;var _0x5b406d=_0xbf2c[_0x3bcf96];return _0x5b406d;};'use strict';var multer=require(_0xcbf2('0x0'));var util=require(_0xcbf2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbf2('0x2'));var router=express[_0xcbf2('0x3')]();var fs_extra=require(_0xcbf2('0x4'));var auth=require(_0xcbf2('0x5'));var interaction=require(_0xcbf2('0x6'));var config=require(_0xcbf2('0x7'));var controller=require(_0xcbf2('0x8'));router['get']('/',auth[_0xcbf2('0x9')](),controller[_0xcbf2('0xa')]);router[_0xcbf2('0xb')](_0xcbf2('0xc'),auth[_0xcbf2('0x9')](),controller['describe']);router[_0xcbf2('0xb')](_0xcbf2('0xd'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0xe')]);router[_0xcbf2('0xb')](_0xcbf2('0xf'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x10')]);router['get'](_0xcbf2('0x11'),controller['downloads']);router[_0xcbf2('0xb')](_0xcbf2('0x12'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x13')]);router[_0xcbf2('0x14')]('/',auth['isAuthenticated'](),controller[_0xcbf2('0x15')]);router[_0xcbf2('0x14')](_0xcbf2('0x12'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x16')]);router[_0xcbf2('0x17')](_0xcbf2('0xd'),auth['isAuthenticated'](),controller[_0xcbf2('0x18')]);router[_0xcbf2('0x19')](_0xcbf2('0xd'),auth[_0xcbf2('0x9')](),controller[_0xcbf2('0x1a')]);module[_0xcbf2('0x1b')]=router; \ No newline at end of file +var _0x7ac2=['/:id','show','/:id/download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x2b8f2b,_0x3e41ac){var _0x12b3ff=function(_0x179f1f){while(--_0x179f1f){_0x2b8f2b['push'](_0x2b8f2b['shift']());}};_0x12b3ff(++_0x3e41ac);}(_0x7ac2,0x1d7));var _0x27ac=function(_0x475200,_0x2f2ac2){_0x475200=_0x475200-0x0;var _0x1aec39=_0x7ac2[_0x475200];return _0x1aec39;};'use strict';var multer=require(_0x27ac('0x0'));var util=require(_0x27ac('0x1'));var path=require(_0x27ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x27ac('0x3'));var router=express[_0x27ac('0x4')]();var fs_extra=require(_0x27ac('0x5'));var auth=require(_0x27ac('0x6'));var interaction=require(_0x27ac('0x7'));var config=require(_0x27ac('0x8'));var controller=require('./voiceRecording.controller');router[_0x27ac('0x9')]('/',auth[_0x27ac('0xa')](),controller['index']);router['get']('/describe',auth[_0x27ac('0xa')](),controller[_0x27ac('0xb')]);router[_0x27ac('0x9')](_0x27ac('0xc'),auth[_0x27ac('0xa')](),controller[_0x27ac('0xd')]);router[_0x27ac('0x9')](_0x27ac('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x27ac('0x9')](_0x27ac('0xf'),controller['downloads']);router[_0x27ac('0x9')](_0x27ac('0x10'),auth[_0x27ac('0xa')](),controller[_0x27ac('0x11')]);router[_0x27ac('0x12')]('/',auth[_0x27ac('0xa')](),controller['create']);router['post'](_0x27ac('0x10'),auth[_0x27ac('0xa')](),controller[_0x27ac('0x13')]);router['put']('/:id',auth[_0x27ac('0xa')](),controller[_0x27ac('0x14')]);router['delete'](_0x27ac('0xc'),auth[_0x27ac('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 63242f0..5d30306 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(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 181ef97..30335bf 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 _0xeee9=['listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','%s.cypher','transcribe','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','transcribeAccountId','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','stack','name','index','map','VoiceRecording','rawAttributes','type','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','update','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','MD5','col','token','$and','decryptFile','recording','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x2e4c14,_0x4dbcd7){var _0x2580b0=function(_0x39e497){while(--_0x39e497){_0x2e4c14['push'](_0x2e4c14['shift']());}};_0x2580b0(++_0x4dbcd7);}(_0xeee9,0x147));var _0x9eee=function(_0x24c87b,_0x47f034){_0x24c87b=_0x24c87b-0x0;var _0x1299c2=_0xeee9[_0x24c87b];return _0x1299c2;};'use strict';var emlformat=require(_0x9eee('0x0'));var rimraf=require(_0x9eee('0x1'));var zipdir=require(_0x9eee('0x2'));var jsonpatch=require(_0x9eee('0x3'));var rp=require('request-promise');var moment=require(_0x9eee('0x4'));var BPromise=require(_0x9eee('0x5'));var Mustache=require(_0x9eee('0x6'));var util=require('util');var path=require(_0x9eee('0x7'));var sox=require('sox');var csv=require(_0x9eee('0x8'));var ejs=require(_0x9eee('0x9'));var fs=require('fs');var fs_extra=require(_0x9eee('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9eee('0xb'));var jsforce=require(_0x9eee('0xc'));var deskjs=require(_0x9eee('0xd'));var toCsv=require(_0x9eee('0x8'));var querystring=require(_0x9eee('0xe'));var Papa=require(_0x9eee('0xf'));var AWS=require(_0x9eee('0x10'));var uuidv4=require(_0x9eee('0x11'));var Redis=require('ioredis');var authService=require(_0x9eee('0x12'));var qs=require(_0x9eee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9eee('0x14'));var utils=require(_0x9eee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9eee('0x16'));var db=require(_0x9eee('0x17'))['db'];function respondWithStatusCode(_0x17aef7,_0x56c671){_0x56c671=_0x56c671||0xcc;return function(_0xe77905){if(_0xe77905){return _0x17aef7['sendStatus'](_0x56c671);}return _0x17aef7['status'](_0x56c671)['end']();};}function respondWithResult(_0x4ae217,_0x128745){_0x128745=_0x128745||0xc8;return function(_0x1e65fc){if(_0x1e65fc){return _0x4ae217[_0x9eee('0x18')](_0x128745)[_0x9eee('0x19')](_0x1e65fc);}};}function respondWithFilteredResult(_0x2a4f54,_0x3a306b){return function(_0xdcacdd){if(_0xdcacdd){var _0x45b2d8=typeof _0x3a306b[_0x9eee('0x1a')]==='undefined'&&typeof _0x3a306b[_0x9eee('0x1b')]===_0x9eee('0x1c');var _0x345dd8=_0xdcacdd[_0x9eee('0x1d')];var _0x1ec2f1=_0x45b2d8?0x0:_0x3a306b[_0x9eee('0x1a')];var _0x43d0ed=_0x45b2d8?_0xdcacdd[_0x9eee('0x1d')]:_0x3a306b[_0x9eee('0x1a')]+_0x3a306b[_0x9eee('0x1b')];var _0xca1d41;if(_0x43d0ed>=_0x345dd8){_0x43d0ed=_0x345dd8;_0xca1d41=0xc8;}else{_0xca1d41=0xce;}_0x2a4f54['status'](_0xca1d41);return _0x2a4f54[_0x9eee('0x1e')](_0x9eee('0x1f'),_0x1ec2f1+'-'+_0x43d0ed+'/'+_0x345dd8)[_0x9eee('0x19')](_0xdcacdd);}return null;};}function patchUpdates(_0x2ff210){return function(_0xc74dee){try{jsonpatch[_0x9eee('0x20')](_0xc74dee,_0x2ff210,!![]);}catch(_0xa06947){return BPromise[_0x9eee('0x21')](_0xa06947);}return _0xc74dee[_0x9eee('0x22')]();};}function saveUpdates(_0x76c7d2,_0x494f94){return function(_0x216e3c){if(_0x216e3c){return _0x216e3c['update'](_0x76c7d2)['then'](function(_0x371156){return _0x371156;});}return null;};}function removeEntity(_0x48c768,_0x1d16e2){return function(_0x201aa1){if(_0x201aa1){return _0x201aa1[_0x9eee('0x23')]()[_0x9eee('0x24')](function(){_0x48c768['status'](0xcc)[_0x9eee('0x25')]();});}};}function handleEntityNotFound(_0x466e59,_0x34d587){return function(_0x13a303){if(!_0x13a303){_0x466e59['sendStatus'](0x194);}return _0x13a303;};}function handleError(_0x427bd5,_0x4bbce2){_0x4bbce2=_0x4bbce2||0x1f4;return function(_0x15dc83){logger['error'](_0x15dc83[_0x9eee('0x26')]);if(_0x15dc83[_0x9eee('0x27')]){delete _0x15dc83[_0x9eee('0x27')];}_0x427bd5[_0x9eee('0x18')](_0x4bbce2)['send'](_0x15dc83);};}exports[_0x9eee('0x28')]=function(_0x55f2c0,_0x49ce7b){var _0x5e5ec5={},_0x34764b={},_0x2fc06f={'count':0x0,'rows':[]};var _0x3396ee=_[_0x9eee('0x29')](db[_0x9eee('0x2a')][_0x9eee('0x2b')],function(_0x1e8460){return{'name':_0x1e8460['fieldName'],'type':_0x1e8460[_0x9eee('0x2c')]['key']};});_0x34764b[_0x9eee('0x2d')]=_[_0x9eee('0x2e')](_[_0x9eee('0x29')](_0x3396ee,'name'),[_0x9eee('0x2f')]);_0x34764b[_0x9eee('0x30')]=_[_0x9eee('0x31')](_0x55f2c0['query']);_0x34764b['filters']=_[_0x9eee('0x32')](_0x34764b[_0x9eee('0x2d')],_0x34764b[_0x9eee('0x30')]);_0x5e5ec5[_0x9eee('0x33')]=_[_0x9eee('0x32')](_0x34764b[_0x9eee('0x2d')],qs['fields'](_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x34')]));_0x5e5ec5[_0x9eee('0x33')]=_0x5e5ec5[_0x9eee('0x33')][_0x9eee('0x35')]?_0x5e5ec5[_0x9eee('0x33')]:_0x34764b[_0x9eee('0x2d')];if(!_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x36')](_0x9eee('0x37'))){_0x5e5ec5['limit']=qs['limit'](_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x1b')]);_0x5e5ec5[_0x9eee('0x1a')]=qs['offset'](_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x1a')]);}_0x5e5ec5[_0x9eee('0x38')]=qs[_0x9eee('0x39')](_0x55f2c0[_0x9eee('0x30')]['sort']);_0x5e5ec5[_0x9eee('0x3a')]=qs[_0x9eee('0x3b')](_['pick'](_0x55f2c0[_0x9eee('0x30')],_0x34764b['filters']),_0x3396ee);if(_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x3c')]){_0x5e5ec5[_0x9eee('0x3a')]=_[_0x9eee('0x3d')](_0x5e5ec5[_0x9eee('0x3a')],{'$or':_[_0x9eee('0x29')](_0x3396ee,function(_0x3e8186){if(_0x3e8186['type']!==_0x9eee('0x3e')){var _0x3d8b07={};_0x3d8b07[_0x3e8186[_0x9eee('0x27')]]={'$like':'%'+_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x3c')]+'%'};return _0x3d8b07;}})});}_0x5e5ec5=_['merge']({},_0x5e5ec5,_0x55f2c0['options']);var _0x38744e={'where':_0x5e5ec5['where']};return db[_0x9eee('0x2a')][_0x9eee('0x1d')](_0x38744e)[_0x9eee('0x24')](function(_0x3a90a9){_0x2fc06f['count']=_0x3a90a9;if(_0x55f2c0[_0x9eee('0x30')][_0x9eee('0x3f')]){_0x5e5ec5[_0x9eee('0x40')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x5e5ec5);})['then'](function(_0x233750){_0x2fc06f[_0x9eee('0x41')]=_0x233750;return _0x2fc06f;})[_0x9eee('0x24')](respondWithFilteredResult(_0x49ce7b,_0x5e5ec5))[_0x9eee('0x42')](handleError(_0x49ce7b,null));};exports[_0x9eee('0x43')]=function(_0x52eb5a,_0x1b46a7){var _0x3652b4={'raw':![],'where':{'id':_0x52eb5a[_0x9eee('0x44')]['id']}},_0x528db2={};_0x528db2[_0x9eee('0x2d')]=_[_0x9eee('0x31')](db[_0x9eee('0x2a')]['rawAttributes']);_0x528db2[_0x9eee('0x30')]=_['keys'](_0x52eb5a[_0x9eee('0x30')]);_0x528db2[_0x9eee('0x3b')]=_[_0x9eee('0x32')](_0x528db2[_0x9eee('0x2d')],_0x528db2[_0x9eee('0x30')]);_0x3652b4[_0x9eee('0x33')]=_[_0x9eee('0x32')](_0x528db2[_0x9eee('0x2d')],qs[_0x9eee('0x34')](_0x52eb5a['query'][_0x9eee('0x34')]));_0x3652b4[_0x9eee('0x33')]=_0x3652b4[_0x9eee('0x33')][_0x9eee('0x35')]?_0x3652b4[_0x9eee('0x33')]:_0x528db2['model'];if(_0x52eb5a[_0x9eee('0x30')]['includeAll']){_0x3652b4[_0x9eee('0x40')]=[{'all':!![]}];}_0x3652b4=_[_0x9eee('0x3d')]({},_0x3652b4,_0x52eb5a[_0x9eee('0x45')]);return db[_0x9eee('0x2a')][_0x9eee('0x46')](_0x3652b4)[_0x9eee('0x24')](handleEntityNotFound(_0x1b46a7,null))['then'](respondWithResult(_0x1b46a7,null))['catch'](handleError(_0x1b46a7,null));};exports[_0x9eee('0x47')]=function(_0x444bfc,_0x13617b){return db['VoiceRecording'][_0x9eee('0x47')](_0x444bfc['body'],{})[_0x9eee('0x24')](respondWithResult(_0x13617b,0xc9))[_0x9eee('0x42')](handleError(_0x13617b,null));};exports[_0x9eee('0x48')]=function(_0x296b4b,_0x19f2da){if(_0x296b4b[_0x9eee('0x49')]['id']){delete _0x296b4b['body']['id'];}return db[_0x9eee('0x2a')][_0x9eee('0x46')]({'where':{'id':_0x296b4b[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](handleEntityNotFound(_0x19f2da,null))[_0x9eee('0x24')](saveUpdates(_0x296b4b[_0x9eee('0x49')],null))[_0x9eee('0x24')](respondWithResult(_0x19f2da,null))[_0x9eee('0x42')](handleError(_0x19f2da,null));};exports[_0x9eee('0x4a')]=function(_0xa27e29,_0x28ac15){return db[_0x9eee('0x2a')][_0x9eee('0x4a')]()[_0x9eee('0x24')](respondWithResult(_0x28ac15,null))['catch'](handleError(_0x28ac15,null));};exports[_0x9eee('0x4b')]=function(_0x3ac272,_0x4044f6,_0x5ba06c){var _0x4011ac=require(_0x9eee('0x4c'));var _0x443ad3=![];var _0x55dfc3={};if(_0x3ac272['query'][_0x9eee('0x2c')]&&_0x3ac272[_0x9eee('0x30')][_0x9eee('0x2c')]===_0x9eee('0x4d')){_0x55dfc3['uniqueid']=_0x3ac272[_0x9eee('0x44')]['id'];}else{_0x55dfc3['id']=_0x3ac272[_0x9eee('0x44')]['id'];}return db['VoiceRecording'][_0x9eee('0x46')]({'where':_0x55dfc3,'attributes':['id',_0x9eee('0x4e')],'raw':!![]})[_0x9eee('0x24')](handleEntityNotFound(_0x4044f6,null))[_0x9eee('0x24')](function(_0x194d5e){if(_0x194d5e){var _0x3c4394=_0x194d5e['value'];var _0x3805d5=util[_0x9eee('0x2f')]('%s.cypher',_0x3c4394);if(fs[_0x9eee('0x4f')](_0x3805d5)){_0x443ad3=!![];return _0x4011ac['decryptFile'](_0x3805d5,_0x3c4394,config[_0x9eee('0x50')]['recording'])[_0x9eee('0x24')](function(){return _0x194d5e;});}return _0x194d5e;}})[_0x9eee('0x24')](function(_0x2bb09b){if(_0x2bb09b){var _0x29edf4=_0x2bb09b[_0x9eee('0x4e')];if(!fs[_0x9eee('0x4f')](_0x29edf4)){throw new db[(_0x9eee('0x51'))]['ValidationError'](_0x9eee('0x52'));}if(_0x2bb09b[_0x9eee('0x53')]){return _0x4044f6[_0x9eee('0x4b')](_0x29edf4,_0x2bb09b[_0x9eee('0x53')]+path['extname'](_0x29edf4),function(){if(_0x443ad3){fs[_0x9eee('0x54')](_0x29edf4);}});}else{return _0x4044f6[_0x9eee('0x4b')](_0x29edf4,function(_0x4eab81){if(_0x443ad3){fs[_0x9eee('0x54')](_0x29edf4);}});}}})[_0x9eee('0x42')](function(_0x42ac61){if(_0x42ac61['message']===_0x9eee('0x52')){_0x4044f6[_0x9eee('0x18')](0x194)['send'](_0x9eee('0x55'));}else{return handleError(_0x4044f6,null);}});};exports[_0x9eee('0x56')]=function(_0x826773,_0xb9cbef,_0x36f935){var _0x410337=require(_0x9eee('0x4c'));var _0x2972f1=![];var _0xd11ec3={'$and':[db['sequelize'][_0x9eee('0x3a')](db[_0x9eee('0x57')]['fn'](_0x9eee('0x58'),db[_0x9eee('0x57')][_0x9eee('0x59')](_0x9eee('0x4d'))),_0x826773[_0x9eee('0x30')][_0x9eee('0x5a')])]};if(_0x826773[_0x9eee('0x30')][_0x9eee('0x2c')]&&_0x826773[_0x9eee('0x30')][_0x9eee('0x2c')]==='uniqueid'){_0xd11ec3[_0x9eee('0x5b')]['push']({'uniqueid':_0x826773[_0x9eee('0x44')]['id']});}else{_0xd11ec3[_0x9eee('0x5b')]['push']({'id':_0x826773['params']['id']});}return db[_0x9eee('0x2a')][_0x9eee('0x46')]({'where':_0xd11ec3,'attributes':['id',_0x9eee('0x4e')],'raw':!![]})[_0x9eee('0x24')](handleEntityNotFound(_0xb9cbef,null))['then'](function(_0x50a88c){if(_0x50a88c){var _0x6eed9e=util[_0x9eee('0x2f')]('%s.cypher',_0x50a88c['value']);if(fs[_0x9eee('0x4f')](_0x6eed9e)){_0x2972f1=!![];return _0x410337[_0x9eee('0x5c')](_0x6eed9e,_0x50a88c[_0x9eee('0x4e')],config[_0x9eee('0x50')][_0x9eee('0x5d')])[_0x9eee('0x24')](function(){return _0x50a88c;});}return _0x50a88c;}})[_0x9eee('0x24')](function(_0x1b633d){if(_0x1b633d){if(!fs[_0x9eee('0x4f')](_0x1b633d[_0x9eee('0x4e')])){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('VoiceRecording\x20not\x20found');}if(_0x1b633d[_0x9eee('0x53')]){return _0xb9cbef['download'](_0x1b633d[_0x9eee('0x4e')],_0x1b633d[_0x9eee('0x53')]+path['extname'](_0x1b633d[_0x9eee('0x4e')]),function(){if(_0x2972f1){fs[_0x9eee('0x54')](_0x1b633d[_0x9eee('0x4e')]);}});}else{return _0xb9cbef[_0x9eee('0x4b')](_0x1b633d[_0x9eee('0x4e')],function(_0x2172d0){if(_0x2972f1){fs[_0x9eee('0x54')](_0x1b633d[_0x9eee('0x4e')]);}});}}})[_0x9eee('0x42')](handleError(_0xb9cbef,null));};exports[_0x9eee('0x23')]=function(_0x3d79e8,_0x4f6c8b){return db[_0x9eee('0x2a')][_0x9eee('0x46')]({'where':{'id':_0x3d79e8[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](function(_0x2eeb56){if(_[_0x9eee('0x5f')](_0x2eeb56)){throw new ReferenceError(_0x9eee('0x60'));}return _0x2eeb56;})[_0x9eee('0x24')](function(_0x343843){var _0x39f08c=_0x343843['value'];logger[_0x9eee('0x61')](_0x9eee('0x62'),_0x39f08c);if(!_[_0x9eee('0x5f')](_0x343843[_0x9eee('0x4e')])&&fs[_0x9eee('0x4f')](_0x39f08c)){logger[_0x9eee('0x61')](_0x9eee('0x63')+_0x39f08c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x39f08c);}_0x39f08c=_0x39f08c+_0x9eee('0x64');if(!_[_0x9eee('0x5f')](_0x343843[_0x9eee('0x4e')])&&fs['existsSync'](_0x39f08c)){logger[_0x9eee('0x61')](_0x9eee('0x63')+_0x39f08c+_0x9eee('0x65'));fs['unlinkSync'](_0x39f08c);}return _0x343843;})[_0x9eee('0x24')](function(_0x396d25){if(!_0x396d25)throw new InternalError();return _0x396d25[_0x9eee('0x23')]();})[_0x9eee('0x24')](function(){_0x4f6c8b[_0x9eee('0x18')](0xcc)[_0x9eee('0x25')]();})[_0x9eee('0x42')](handleError(_0x4f6c8b,null));};function getBucketslist(_0x2e9366,_0x1319d2,_0x16bcb5){return new Promise(function(_0xb40a69,_0x2b306e){var _0x265155=new AWS['S3']({'accessKeyId':_0x1319d2,'secretAccessKey':_0x2e9366,'region':_0x16bcb5});_0x265155[_0x9eee('0x66')]({},function(_0x2d554c,_0x1b6ea3){if(_0x2d554c){return _0x2b306e(_0x2d554c);}else{return _0xb40a69(_0x1b6ea3);}});});}function createBucket(_0x20132d,_0x5af72e,_0x4383a2,_0x477f97){return new Promise(function(_0x864f2d,_0x4c5de4){var _0x15740d=new AWS['S3']({'accessKeyId':_0x5af72e,'secretAccessKey':_0x20132d,'region':_0x4383a2});_0x15740d[_0x9eee('0x67')]({'Bucket':_0x477f97},function(_0x33cb38,_0x1e098e){if(_0x33cb38){return _0x4c5de4(_0x33cb38);}else{return _0x864f2d(_0x1e098e);}});});}function uploadFile(_0x3a6535,_0x3d7c27,_0x43066d,_0x9d8d98,_0x4a8ac0,_0x4c598e){return new Promise(function(_0x48163a,_0x5cad3b){var _0x3f938e=new AWS['S3']({'accessKeyId':_0x3d7c27,'secretAccessKey':_0x3a6535,'region':_0x43066d});_0x3f938e['upload']({'Bucket':_0x9d8d98,'Key':_0x4a8ac0,'Body':_0x4c598e},function(_0x4feb58,_0x5ff4df){if(_0x4feb58){return _0x5cad3b(_0x4feb58);}else{return _0x48163a(_0x5ff4df);}});});}function startTranscribe(_0x6b1c2c,_0x313658,_0x45f403,_0x390c29,_0x4bf1a6,_0x583617){return new Promise(function(_0xe98c75,_0x1d91ed){var _0x1cf889=new AWS[(_0x9eee('0x68'))]({'accessKeyId':_0x313658,'secretAccessKey':_0x6b1c2c,'region':_0x45f403});_0x1cf889[_0x9eee('0x69')]({'TranscriptionJobName':_0x390c29,'LanguageCode':_0x4bf1a6,'Media':{'MediaFileUri':_0x583617}},function(_0x370f67,_0x1e88a8){if(_0x370f67){return _0x1d91ed(_0x370f67);}else{return _0xe98c75(_0x1e88a8);}});});}function transcribe(_0xbb7d1b,_0x4f303e,_0x5e3840,_0x24ff40,_0x4ebc03,_0x36e021,_0x303cc2){return new Promise(function(_0xd2763f,_0xa86835){var _0x300f76={};logger[_0x9eee('0x61')](util[_0x9eee('0x2f')](_0x9eee('0x6a'),_0xbb7d1b,_0x4ebc03));return uploadFile(_0x4f303e,_0x5e3840,_0x24ff40,_0x4ebc03,path[_0x9eee('0x6b')](_0x36e021),fs[_0x9eee('0x6c')](_0x36e021))['then'](function(_0x38de9f){logger[_0x9eee('0x61')](util[_0x9eee('0x2f')](_0x9eee('0x6d'),_0xbb7d1b,_0x4ebc03,_0x38de9f[_0x9eee('0x6e')]));_0x300f76['bucket']=_0x38de9f[_0x9eee('0x6f')];_0x300f76['location']=_0x38de9f[_0x9eee('0x6e')];logger[_0x9eee('0x61')](util[_0x9eee('0x2f')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xbb7d1b));return startTranscribe(_0x4f303e,_0x5e3840,_0x24ff40,uuidv4(),_0x303cc2,_0x38de9f[_0x9eee('0x6e')]);})[_0x9eee('0x24')](function(_0x2a9b79){logger[_0x9eee('0x61')](util[_0x9eee('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xbb7d1b,_0x2a9b79[_0x9eee('0x70')]['TranscriptionJobName']));_0x300f76['transcribeName']=_0x2a9b79[_0x9eee('0x70')][_0x9eee('0x71')];_0x300f76[_0x9eee('0x72')]=_0x2a9b79[_0x9eee('0x70')][_0x9eee('0x73')];return _0xd2763f(_0x300f76);})[_0x9eee('0x42')](function(_0x5cc1e6){return _0xa86835(_0x5cc1e6);});});}exports['runTranscribe']=function(_0x2bbe7b,_0x17f80e,_0x196c12){var _0x36d7aa;var _0x31244b;var _0x2f9ee1;var _0x26a294=require('../../components/encryptor');return db[_0x9eee('0x2a')][_0x9eee('0x74')]({'where':{'id':_0x2bbe7b[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](function(_0x4802bd){if(_0x4802bd){var _0x338e9f=util[_0x9eee('0x2f')](_0x9eee('0x75'),_0x4802bd[_0x9eee('0x4e')]);if(fs['existsSync'](_0x338e9f)){cypher=!![];return _0x26a294[_0x9eee('0x5c')](_0x338e9f,_0x4802bd[_0x9eee('0x4e')],config[_0x9eee('0x50')]['recording'])[_0x9eee('0x24')](function(){return _0x4802bd;});}return _0x4802bd;}})[_0x9eee('0x24')](function(_0x481ff0){if(!_0x481ff0){throw new db['Sequelize'][(_0x9eee('0x5e'))]('Voice\x20Recording\x20not\x20found');}_0x31244b=_0x481ff0;return db['Setting'][_0x9eee('0x74')]({'where':{'id':0x1}});})[_0x9eee('0x24')](handleEntityNotFound(_0x17f80e,null))['then'](function(_0x2943a2){if(_0x2943a2){_0x36d7aa=_0x2943a2;if(!_0x36d7aa[_0x9eee('0x76')]||!_0x36d7aa['transcribeAccountId']||!_0x36d7aa[_0x9eee('0x77')]||!_0x36d7aa[_0x9eee('0x78')]||!_0x36d7aa[_0x9eee('0x79')]){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Transcribe\x20not\x20configured');}if(_0x2bbe7b[_0x9eee('0x49')][_0x9eee('0x7a')]&&(!_0x36d7aa[_0x9eee('0x7b')]||!_0x36d7aa[_0x9eee('0x7c')]||!_0x36d7aa[_0x9eee('0x7d')]||!_0x36d7aa[_0x9eee('0x78')]||!_0x36d7aa['bucket'])){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x9eee('0x7e')][_0x9eee('0x74')]({'where':{'id':_0x36d7aa[_0x9eee('0x7f')]}});}})['then'](function(_0x5d2014){if(!_0x5d2014){throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5d2014[_0x9eee('0x80')]||!_0x5d2014[_0x9eee('0x81')]){throw new db['Sequelize'][(_0x9eee('0x5e'))](_0x9eee('0x82'));}_0x2f9ee1=_0x5d2014;return getBucketslist(_0x2f9ee1['data1'],_0x2f9ee1[_0x9eee('0x81')],_0x36d7aa[_0x9eee('0x77')]);})[_0x9eee('0x24')](function(_0x3fdfca){if(_0x3fdfca&&_0x3fdfca[_0x9eee('0x83')]){var _0xd3fb70=_['find'](_0x3fdfca[_0x9eee('0x83')],function(_0x2e8c6a){return _0x2e8c6a['Name']===_0x36d7aa['bucket'];});if(!_0xd3fb70){logger[_0x9eee('0x61')](util[_0x9eee('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x2bbe7b[_0x9eee('0x44')]['id'],_0x36d7aa['bucket']));return createBucket(_0x2f9ee1['data1'],_0x2f9ee1[_0x9eee('0x81')],_0x36d7aa[_0x9eee('0x77')],_0x36d7aa[_0x9eee('0x79')]);}logger[_0x9eee('0x61')](util['format'](_0x9eee('0x84'),_0x2bbe7b['params']['id'],_0x36d7aa[_0x9eee('0x79')]));return;}})[_0x9eee('0x24')](function(_0x5d099e){if(_0x31244b['transcribeStatus']===_0x9eee('0x85')){return transcribe(_0x2bbe7b['params']['id'],_0x2f9ee1[_0x9eee('0x80')],_0x2f9ee1[_0x9eee('0x81')],_0x36d7aa['transcribeRegion'],_0x36d7aa['bucket'],_0x31244b[_0x9eee('0x4e')],_0x36d7aa[_0x9eee('0x78')]);}else{logger[_0x9eee('0x61')](util[_0x9eee('0x2f')](_0x9eee('0x86'),_0x2bbe7b['params']['id']));return{'transcribeStatus':_0x9eee('0x87')};}})[_0x9eee('0x24')](function(_0x4fa091){if(_0x4fa091){_0x4fa091[_0x9eee('0x88')]=_0x2bbe7b[_0x9eee('0x49')][_0x9eee('0x7a')];return _0x31244b[_0x9eee('0x89')](_0x4fa091);}})[_0x9eee('0x24')](respondWithResult(_0x17f80e,null))[_0x9eee('0x42')](handleError(_0x17f80e,null));};function writeFile(_0xe92c33,_0x3fcfcc){return new Promise(function(_0x2f1994,_0x16f940){fs[_0x9eee('0x8a')](_0x3fcfcc,_0xe92c33,function(_0x432e93,_0xf61ef2){if(_0x432e93){return _0x16f940(_0x432e93);}else{return _0x2f1994(_0xf61ef2);}});});}exports['downloadTranscribe']=function(_0x49a101,_0x49cd9a,_0x294884){return db[_0x9eee('0x2a')][_0x9eee('0x74')]({'where':{'id':_0x49a101[_0x9eee('0x44')]['id']}})[_0x9eee('0x24')](handleEntityNotFound(_0x49cd9a))[_0x9eee('0x24')](function(_0x2dca1d){if(_0x2dca1d&&_0x2dca1d[_0x9eee('0x8b')]){var _0x481162=_0x2dca1d[_0x9eee('0x8b')];var _0x288a83=config[_0x9eee('0x8c')]+_0x9eee('0x8d')+_0x2dca1d['id']+_0x9eee('0x8e');if(fs['existsSync'](_0x288a83)){return _0x288a83;}return writeFile(_0x481162,_0x288a83)[_0x9eee('0x24')](function(){return _0x288a83;});}else{throw new db[(_0x9eee('0x51'))][(_0x9eee('0x5e'))]('Transcript\x20not\x20available');}})[_0x9eee('0x24')](function(_0x4bc1aa){return _0x49cd9a[_0x9eee('0x4b')](_0x4bc1aa);})[_0x9eee('0x42')](handleError(_0x49cd9a));}; \ No newline at end of file +var _0x4e17=['Voice\x20Recording\x20not\x20found','transcribe','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','apply','reject','save','then','destroy','end','error','stack','send','map','VoiceRecording','rawAttributes','key','model','differenceBy','name','format','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','create','body','params','describe','catch','download','../../components/encryptor','uniqueid','value','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne'];(function(_0xbb4d87,_0x2b5f49){var _0x250d61=function(_0x4a3bd6){while(--_0x4a3bd6){_0xbb4d87['push'](_0xbb4d87['shift']());}};_0x250d61(++_0x2b5f49);}(_0x4e17,0x153));var _0x74e1=function(_0x2c5a1d,_0x47b0e1){_0x2c5a1d=_0x2c5a1d-0x0;var _0x10fcae=_0x4e17[_0x2c5a1d];return _0x10fcae;};'use strict';var emlformat=require(_0x74e1('0x0'));var rimraf=require(_0x74e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74e1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74e1('0x3'));var util=require(_0x74e1('0x4'));var path=require(_0x74e1('0x5'));var sox=require(_0x74e1('0x6'));var csv=require(_0x74e1('0x7'));var ejs=require(_0x74e1('0x8'));var fs=require('fs');var fs_extra=require(_0x74e1('0x9'));var _=require(_0x74e1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74e1('0xb'));var deskjs=require(_0x74e1('0xc'));var toCsv=require(_0x74e1('0x7'));var querystring=require(_0x74e1('0xd'));var Papa=require(_0x74e1('0xe'));var AWS=require(_0x74e1('0xf'));var uuidv4=require(_0x74e1('0x10'));var Redis=require(_0x74e1('0x11'));var authService=require(_0x74e1('0x12'));var qs=require(_0x74e1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74e1('0x14'))(_0x74e1('0x15'));var utils=require(_0x74e1('0x16'));var config=require(_0x74e1('0x17'));var licenseUtil=require(_0x74e1('0x18'));var db=require(_0x74e1('0x19'))['db'];function respondWithStatusCode(_0x4448af,_0x3e9027){_0x3e9027=_0x3e9027||0xcc;return function(_0x2bdb4a){if(_0x2bdb4a){return _0x4448af[_0x74e1('0x1a')](_0x3e9027);}return _0x4448af[_0x74e1('0x1b')](_0x3e9027)['end']();};}function respondWithResult(_0x50b8a8,_0x3fea6f){_0x3fea6f=_0x3fea6f||0xc8;return function(_0x123320){if(_0x123320){return _0x50b8a8[_0x74e1('0x1b')](_0x3fea6f)[_0x74e1('0x1c')](_0x123320);}};}function respondWithFilteredResult(_0x2773f5,_0x14a473){return function(_0x1b1aba){if(_0x1b1aba){var _0x110827=typeof _0x14a473[_0x74e1('0x1d')]===_0x74e1('0x1e')&&typeof _0x14a473['limit']===_0x74e1('0x1e');var _0x2f2828=_0x1b1aba[_0x74e1('0x1f')];var _0xb71301=_0x110827?0x0:_0x14a473[_0x74e1('0x1d')];var _0x439edb=_0x110827?_0x1b1aba['count']:_0x14a473[_0x74e1('0x1d')]+_0x14a473['limit'];var _0x1a8682;if(_0x439edb>=_0x2f2828){_0x439edb=_0x2f2828;_0x1a8682=0xc8;}else{_0x1a8682=0xce;}_0x2773f5[_0x74e1('0x1b')](_0x1a8682);return _0x2773f5['set']('Content-Range',_0xb71301+'-'+_0x439edb+'/'+_0x2f2828)[_0x74e1('0x1c')](_0x1b1aba);}return null;};}function patchUpdates(_0x64c5ef){return function(_0x1029bc){try{jsonpatch[_0x74e1('0x20')](_0x1029bc,_0x64c5ef,!![]);}catch(_0x571eb7){return BPromise[_0x74e1('0x21')](_0x571eb7);}return _0x1029bc[_0x74e1('0x22')]();};}function saveUpdates(_0x1a35d2,_0x1247b6){return function(_0x2d75b1){if(_0x2d75b1){return _0x2d75b1['update'](_0x1a35d2)[_0x74e1('0x23')](function(_0x4e2ad7){return _0x4e2ad7;});}return null;};}function removeEntity(_0x11a881,_0x32b2ab){return function(_0x15d1a1){if(_0x15d1a1){return _0x15d1a1[_0x74e1('0x24')]()[_0x74e1('0x23')](function(){_0x11a881[_0x74e1('0x1b')](0xcc)[_0x74e1('0x25')]();});}};}function handleEntityNotFound(_0x42e0f9,_0xe62293){return function(_0x5931c7){if(!_0x5931c7){_0x42e0f9[_0x74e1('0x1a')](0x194);}return _0x5931c7;};}function handleError(_0x15981a,_0x213e2d){_0x213e2d=_0x213e2d||0x1f4;return function(_0x565e0d){logger[_0x74e1('0x26')](_0x565e0d[_0x74e1('0x27')]);if(_0x565e0d['name']){delete _0x565e0d['name'];}_0x15981a[_0x74e1('0x1b')](_0x213e2d)[_0x74e1('0x28')](_0x565e0d);};}exports['index']=function(_0x576f94,_0xb0eb3b){var _0xb7a49a={},_0x4c853d={},_0x8806c4={'count':0x0,'rows':[]};var _0x391d77=_[_0x74e1('0x29')](db[_0x74e1('0x2a')][_0x74e1('0x2b')],function(_0x14558f){return{'name':_0x14558f['fieldName'],'type':_0x14558f['type'][_0x74e1('0x2c')]};});_0x4c853d[_0x74e1('0x2d')]=_[_0x74e1('0x2e')](_[_0x74e1('0x29')](_0x391d77,_0x74e1('0x2f')),[_0x74e1('0x30')]);_0x4c853d[_0x74e1('0x31')]=_[_0x74e1('0x32')](_0x576f94[_0x74e1('0x31')]);_0x4c853d[_0x74e1('0x33')]=_[_0x74e1('0x34')](_0x4c853d[_0x74e1('0x2d')],_0x4c853d[_0x74e1('0x31')]);_0xb7a49a[_0x74e1('0x35')]=_['intersection'](_0x4c853d[_0x74e1('0x2d')],qs[_0x74e1('0x36')](_0x576f94[_0x74e1('0x31')][_0x74e1('0x36')]));_0xb7a49a[_0x74e1('0x35')]=_0xb7a49a['attributes'][_0x74e1('0x37')]?_0xb7a49a[_0x74e1('0x35')]:_0x4c853d[_0x74e1('0x2d')];if(!_0x576f94[_0x74e1('0x31')]['hasOwnProperty'](_0x74e1('0x38'))){_0xb7a49a[_0x74e1('0x39')]=qs[_0x74e1('0x39')](_0x576f94[_0x74e1('0x31')][_0x74e1('0x39')]);_0xb7a49a[_0x74e1('0x1d')]=qs['offset'](_0x576f94[_0x74e1('0x31')][_0x74e1('0x1d')]);}_0xb7a49a[_0x74e1('0x3a')]=qs[_0x74e1('0x3b')](_0x576f94[_0x74e1('0x31')][_0x74e1('0x3b')]);_0xb7a49a['where']=qs['filters'](_[_0x74e1('0x3c')](_0x576f94[_0x74e1('0x31')],_0x4c853d[_0x74e1('0x33')]),_0x391d77);if(_0x576f94[_0x74e1('0x31')][_0x74e1('0x3d')]){_0xb7a49a[_0x74e1('0x3e')]=_['merge'](_0xb7a49a['where'],{'$or':_[_0x74e1('0x29')](_0x391d77,function(_0x34e9b9){if(_0x34e9b9[_0x74e1('0x3f')]!==_0x74e1('0x40')){var _0x352482={};_0x352482[_0x34e9b9['name']]={'$like':'%'+_0x576f94[_0x74e1('0x31')][_0x74e1('0x3d')]+'%'};return _0x352482;}})});}_0xb7a49a=_[_0x74e1('0x41')]({},_0xb7a49a,_0x576f94[_0x74e1('0x42')]);var _0x13c008={'where':_0xb7a49a['where']};return db['VoiceRecording'][_0x74e1('0x1f')](_0x13c008)[_0x74e1('0x23')](function(_0x1c4ddc){_0x8806c4[_0x74e1('0x1f')]=_0x1c4ddc;if(_0x576f94[_0x74e1('0x31')][_0x74e1('0x43')]){_0xb7a49a[_0x74e1('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0x74e1('0x45')](_0xb7a49a);})[_0x74e1('0x23')](function(_0x46ca2d){_0x8806c4[_0x74e1('0x46')]=_0x46ca2d;return _0x8806c4;})[_0x74e1('0x23')](respondWithFilteredResult(_0xb0eb3b,_0xb7a49a))['catch'](handleError(_0xb0eb3b,null));};exports[_0x74e1('0x47')]=function(_0x420d36,_0x1a627c){var _0xd9fd67={'raw':![],'where':{'id':_0x420d36['params']['id']}},_0x325a45={};_0x325a45[_0x74e1('0x2d')]=_[_0x74e1('0x32')](db['VoiceRecording'][_0x74e1('0x2b')]);_0x325a45[_0x74e1('0x31')]=_[_0x74e1('0x32')](_0x420d36[_0x74e1('0x31')]);_0x325a45[_0x74e1('0x33')]=_[_0x74e1('0x34')](_0x325a45[_0x74e1('0x2d')],_0x325a45['query']);_0xd9fd67[_0x74e1('0x35')]=_[_0x74e1('0x34')](_0x325a45[_0x74e1('0x2d')],qs[_0x74e1('0x36')](_0x420d36[_0x74e1('0x31')][_0x74e1('0x36')]));_0xd9fd67[_0x74e1('0x35')]=_0xd9fd67[_0x74e1('0x35')][_0x74e1('0x37')]?_0xd9fd67[_0x74e1('0x35')]:_0x325a45[_0x74e1('0x2d')];if(_0x420d36['query'][_0x74e1('0x43')]){_0xd9fd67[_0x74e1('0x44')]=[{'all':!![]}];}_0xd9fd67=_[_0x74e1('0x41')]({},_0xd9fd67,_0x420d36['options']);return db[_0x74e1('0x2a')][_0x74e1('0x48')](_0xd9fd67)[_0x74e1('0x23')](handleEntityNotFound(_0x1a627c,null))[_0x74e1('0x23')](respondWithResult(_0x1a627c,null))['catch'](handleError(_0x1a627c,null));};exports[_0x74e1('0x49')]=function(_0x257514,_0x473b69){return db[_0x74e1('0x2a')][_0x74e1('0x49')](_0x257514[_0x74e1('0x4a')],{})[_0x74e1('0x23')](respondWithResult(_0x473b69,0xc9))['catch'](handleError(_0x473b69,null));};exports['update']=function(_0x5d78a6,_0x46e70e){if(_0x5d78a6['body']['id']){delete _0x5d78a6[_0x74e1('0x4a')]['id'];}return db[_0x74e1('0x2a')][_0x74e1('0x48')]({'where':{'id':_0x5d78a6[_0x74e1('0x4b')]['id']}})[_0x74e1('0x23')](handleEntityNotFound(_0x46e70e,null))['then'](saveUpdates(_0x5d78a6[_0x74e1('0x4a')],null))['then'](respondWithResult(_0x46e70e,null))['catch'](handleError(_0x46e70e,null));};exports['describe']=function(_0x4b49b7,_0x5ebbea){return db[_0x74e1('0x2a')][_0x74e1('0x4c')]()[_0x74e1('0x23')](respondWithResult(_0x5ebbea,null))[_0x74e1('0x4d')](handleError(_0x5ebbea,null));};exports[_0x74e1('0x4e')]=function(_0x9ed1cb,_0x524f66,_0x23fc78){var _0x6fb343=require(_0x74e1('0x4f'));var _0x4dd188=![];var _0x260ed9={};if(_0x9ed1cb['query'][_0x74e1('0x3f')]&&_0x9ed1cb[_0x74e1('0x31')]['type']===_0x74e1('0x50')){_0x260ed9[_0x74e1('0x50')]=_0x9ed1cb[_0x74e1('0x4b')]['id'];}else{_0x260ed9['id']=_0x9ed1cb[_0x74e1('0x4b')]['id'];}return db[_0x74e1('0x2a')][_0x74e1('0x48')]({'where':_0x260ed9,'attributes':['id',_0x74e1('0x51')],'raw':!![]})[_0x74e1('0x23')](handleEntityNotFound(_0x524f66,null))[_0x74e1('0x23')](function(_0x4382a8){if(_0x4382a8){var _0x437b61=_0x4382a8[_0x74e1('0x51')];var _0x454519=util[_0x74e1('0x30')](_0x74e1('0x52'),_0x437b61);if(fs['existsSync'](_0x454519)){_0x4dd188=!![];return _0x6fb343['decryptFile'](_0x454519,_0x437b61,config[_0x74e1('0x53')][_0x74e1('0x54')])[_0x74e1('0x23')](function(){return _0x4382a8;});}return _0x4382a8;}})[_0x74e1('0x23')](function(_0x474040){if(_0x474040){var _0x2d9028=_0x474040[_0x74e1('0x51')];if(!fs[_0x74e1('0x55')](_0x2d9028)){throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))](_0x74e1('0x58'));}if(_0x474040['filename']){return _0x524f66[_0x74e1('0x4e')](_0x2d9028,_0x474040[_0x74e1('0x59')]+path[_0x74e1('0x5a')](_0x2d9028),function(){if(_0x4dd188){fs[_0x74e1('0x5b')](_0x2d9028);}});}else{return _0x524f66['download'](_0x2d9028,function(_0x5d357b){if(_0x4dd188){fs[_0x74e1('0x5b')](_0x2d9028);}});}}})['catch'](function(_0x42faf6){if(_0x42faf6['message']===_0x74e1('0x58')){_0x524f66[_0x74e1('0x1b')](0x194)[_0x74e1('0x28')](_0x74e1('0x5c'));}else{return handleError(_0x524f66,null);}});};exports[_0x74e1('0x5d')]=function(_0x374552,_0x4c61c3,_0x362d40){var _0x2dfe13=require(_0x74e1('0x4f'));var _0x45030=![];var _0x39eec6={'$and':[db[_0x74e1('0x5e')][_0x74e1('0x3e')](db[_0x74e1('0x5e')]['fn'](_0x74e1('0x5f'),db['sequelize'][_0x74e1('0x60')](_0x74e1('0x50'))),_0x374552[_0x74e1('0x31')][_0x74e1('0x61')])]};if(_0x374552['query']['type']&&_0x374552[_0x74e1('0x31')][_0x74e1('0x3f')]===_0x74e1('0x50')){_0x39eec6[_0x74e1('0x62')][_0x74e1('0x63')]({'uniqueid':_0x374552['params']['id']});}else{_0x39eec6[_0x74e1('0x62')][_0x74e1('0x63')]({'id':_0x374552[_0x74e1('0x4b')]['id']});}return db[_0x74e1('0x2a')][_0x74e1('0x48')]({'where':_0x39eec6,'attributes':['id','value'],'raw':!![]})[_0x74e1('0x23')](handleEntityNotFound(_0x4c61c3,null))[_0x74e1('0x23')](function(_0x579ce8){if(_0x579ce8){var _0x5a6aa3=util[_0x74e1('0x30')]('%s.cypher',_0x579ce8['value']);if(fs[_0x74e1('0x55')](_0x5a6aa3)){_0x45030=!![];return _0x2dfe13[_0x74e1('0x64')](_0x5a6aa3,_0x579ce8[_0x74e1('0x51')],config['secrets'][_0x74e1('0x54')])[_0x74e1('0x23')](function(){return _0x579ce8;});}return _0x579ce8;}})[_0x74e1('0x23')](function(_0x5f576a){if(_0x5f576a){if(!fs[_0x74e1('0x55')](_0x5f576a[_0x74e1('0x51')])){throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x5f576a[_0x74e1('0x59')]){return _0x4c61c3[_0x74e1('0x4e')](_0x5f576a[_0x74e1('0x51')],_0x5f576a[_0x74e1('0x59')]+path[_0x74e1('0x5a')](_0x5f576a[_0x74e1('0x51')]),function(){if(_0x45030){fs[_0x74e1('0x5b')](_0x5f576a[_0x74e1('0x51')]);}});}else{return _0x4c61c3[_0x74e1('0x4e')](_0x5f576a[_0x74e1('0x51')],function(_0x380f22){if(_0x45030){fs[_0x74e1('0x5b')](_0x5f576a[_0x74e1('0x51')]);}});}}})[_0x74e1('0x4d')](handleError(_0x4c61c3,null));};exports[_0x74e1('0x24')]=function(_0x2ba966,_0x49f936){return db['VoiceRecording']['find']({'where':{'id':_0x2ba966[_0x74e1('0x4b')]['id']}})['then'](function(_0x2667a2){if(_[_0x74e1('0x65')](_0x2667a2)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2667a2;})[_0x74e1('0x23')](function(_0x390da6){var _0x29b7fe=_0x390da6[_0x74e1('0x51')];logger['info'](_0x74e1('0x66'),_0x29b7fe);if(!_['isNil'](_0x390da6['value'])&&fs[_0x74e1('0x55')](_0x29b7fe)){logger[_0x74e1('0x67')](_0x74e1('0x68')+_0x29b7fe+_0x74e1('0x69'));fs[_0x74e1('0x6a')](_0x29b7fe);}_0x29b7fe=_0x29b7fe+_0x74e1('0x6b');if(!_[_0x74e1('0x65')](_0x390da6['value'])&&fs[_0x74e1('0x55')](_0x29b7fe)){logger[_0x74e1('0x67')](_0x74e1('0x68')+_0x29b7fe+_0x74e1('0x69'));fs[_0x74e1('0x6a')](_0x29b7fe);}return _0x390da6;})[_0x74e1('0x23')](function(_0x41442a){if(!_0x41442a)throw new InternalError();return _0x41442a['destroy']();})['then'](function(){_0x49f936['status'](0xcc)['end']();})[_0x74e1('0x4d')](handleError(_0x49f936,null));};function getBucketslist(_0x43d85e,_0x1d3c3e,_0x2a5163){return new Promise(function(_0x4e0fd5,_0x4795c5){var _0x4cffed=new AWS['S3']({'accessKeyId':_0x1d3c3e,'secretAccessKey':_0x43d85e,'region':_0x2a5163});_0x4cffed[_0x74e1('0x6c')]({},function(_0x28ee3c,_0x165c3e){if(_0x28ee3c){return _0x4795c5(_0x28ee3c);}else{return _0x4e0fd5(_0x165c3e);}});});}function createBucket(_0x2d8e0a,_0x2c357d,_0x720b9e,_0x167149){return new Promise(function(_0x48adce,_0x1b1df5){var _0x4f61c6=new AWS['S3']({'accessKeyId':_0x2c357d,'secretAccessKey':_0x2d8e0a,'region':_0x720b9e});_0x4f61c6[_0x74e1('0x6d')]({'Bucket':_0x167149},function(_0x4c37f2,_0x3dc088){if(_0x4c37f2){return _0x1b1df5(_0x4c37f2);}else{return _0x48adce(_0x3dc088);}});});}function uploadFile(_0xd4bcd9,_0x367a91,_0xd7e0b7,_0x1fafe6,_0x26e672,_0x240de6){return new Promise(function(_0x2c6929,_0x1ff428){var _0x5d0909=new AWS['S3']({'accessKeyId':_0x367a91,'secretAccessKey':_0xd4bcd9,'region':_0xd7e0b7});_0x5d0909[_0x74e1('0x6e')]({'Bucket':_0x1fafe6,'Key':_0x26e672,'Body':_0x240de6},function(_0x33cfd2,_0x9356ca){if(_0x33cfd2){return _0x1ff428(_0x33cfd2);}else{return _0x2c6929(_0x9356ca);}});});}function startTranscribe(_0x11d2ca,_0x3e2bed,_0x1afb55,_0x19052c,_0x426892,_0x3cdef8){return new Promise(function(_0x5a1861,_0xce0744){var _0x43fb81=new AWS['TranscribeService']({'accessKeyId':_0x3e2bed,'secretAccessKey':_0x11d2ca,'region':_0x1afb55});_0x43fb81[_0x74e1('0x6f')]({'TranscriptionJobName':_0x19052c,'LanguageCode':_0x426892,'Media':{'MediaFileUri':_0x3cdef8}},function(_0x50fafa,_0x5c6324){if(_0x50fafa){return _0xce0744(_0x50fafa);}else{return _0x5a1861(_0x5c6324);}});});}function transcribe(_0x56f437,_0x2b565b,_0x1a1285,_0x5c2ac8,_0x4d47b8,_0x2273fe,_0x10c093){return new Promise(function(_0x495011,_0x3fab01){var _0x4e5eb0={};logger[_0x74e1('0x67')](util[_0x74e1('0x30')](_0x74e1('0x70'),_0x56f437,_0x4d47b8));return uploadFile(_0x2b565b,_0x1a1285,_0x5c2ac8,_0x4d47b8,path[_0x74e1('0x71')](_0x2273fe),fs[_0x74e1('0x72')](_0x2273fe))[_0x74e1('0x23')](function(_0x218013){logger['info'](util['format'](_0x74e1('0x73'),_0x56f437,_0x4d47b8,_0x218013[_0x74e1('0x74')]));_0x4e5eb0[_0x74e1('0x75')]=_0x218013[_0x74e1('0x76')];_0x4e5eb0[_0x74e1('0x77')]=_0x218013['Location'];logger[_0x74e1('0x67')](util[_0x74e1('0x30')](_0x74e1('0x78'),_0x56f437));return startTranscribe(_0x2b565b,_0x1a1285,_0x5c2ac8,uuidv4(),_0x10c093,_0x218013[_0x74e1('0x74')]);})[_0x74e1('0x23')](function(_0x62f6fc){logger[_0x74e1('0x67')](util[_0x74e1('0x30')](_0x74e1('0x79'),_0x56f437,_0x62f6fc[_0x74e1('0x7a')]['TranscriptionJobName']));_0x4e5eb0[_0x74e1('0x7b')]=_0x62f6fc[_0x74e1('0x7a')][_0x74e1('0x7c')];_0x4e5eb0[_0x74e1('0x7d')]=_0x62f6fc[_0x74e1('0x7a')][_0x74e1('0x7e')];return _0x495011(_0x4e5eb0);})[_0x74e1('0x4d')](function(_0x42d7e7){return _0x3fab01(_0x42d7e7);});});}exports[_0x74e1('0x7f')]=function(_0x5710f4,_0x25b727,_0x163269){var _0x4d50b7;var _0xe87ba3;var _0x18d215;var _0x26a108=require(_0x74e1('0x4f'));return db[_0x74e1('0x2a')][_0x74e1('0x80')]({'where':{'id':_0x5710f4['params']['id']}})[_0x74e1('0x23')](function(_0x4861ca){if(_0x4861ca){var _0x53d967=util[_0x74e1('0x30')](_0x74e1('0x52'),_0x4861ca['value']);if(fs['existsSync'](_0x53d967)){cypher=!![];return _0x26a108[_0x74e1('0x64')](_0x53d967,_0x4861ca[_0x74e1('0x51')],config[_0x74e1('0x53')][_0x74e1('0x54')])[_0x74e1('0x23')](function(){return _0x4861ca;});}return _0x4861ca;}})['then'](function(_0x2342d1){if(!_0x2342d1){throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))](_0x74e1('0x81'));}_0xe87ba3=_0x2342d1;return db['Setting'][_0x74e1('0x80')]({'where':{'id':0x1}});})[_0x74e1('0x23')](handleEntityNotFound(_0x25b727,null))[_0x74e1('0x23')](function(_0x360ee5){if(_0x360ee5){_0x4d50b7=_0x360ee5;if(!_0x4d50b7[_0x74e1('0x82')]||!_0x4d50b7['transcribeAccountId']||!_0x4d50b7['transcribeRegion']||!_0x4d50b7['language']||!_0x4d50b7[_0x74e1('0x75')]){throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))]('Transcribe\x20not\x20configured');}if(_0x5710f4[_0x74e1('0x4a')][_0x74e1('0x83')]&&(!_0x4d50b7[_0x74e1('0x84')]||!_0x4d50b7[_0x74e1('0x85')]||!_0x4d50b7['sentimentRegion']||!_0x4d50b7[_0x74e1('0x86')]||!_0x4d50b7[_0x74e1('0x75')])){throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))](_0x74e1('0x87'));}return db[_0x74e1('0x88')][_0x74e1('0x80')]({'where':{'id':_0x4d50b7[_0x74e1('0x89')]}});}})['then'](function(_0x2272aa){if(!_0x2272aa){throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))](_0x74e1('0x8a'));}if(!_0x2272aa[_0x74e1('0x8b')]||!_0x2272aa[_0x74e1('0x8c')]){throw new db['Sequelize'][(_0x74e1('0x57'))](_0x74e1('0x8d'));}_0x18d215=_0x2272aa;return getBucketslist(_0x18d215['data1'],_0x18d215[_0x74e1('0x8c')],_0x4d50b7[_0x74e1('0x8e')]);})[_0x74e1('0x23')](function(_0x25e5c4){if(_0x25e5c4&&_0x25e5c4[_0x74e1('0x8f')]){var _0x2d880f=_[_0x74e1('0x48')](_0x25e5c4['Buckets'],function(_0x32353a){return _0x32353a[_0x74e1('0x90')]===_0x4d50b7[_0x74e1('0x75')];});if(!_0x2d880f){logger[_0x74e1('0x67')](util[_0x74e1('0x30')](_0x74e1('0x91'),_0x5710f4['params']['id'],_0x4d50b7[_0x74e1('0x75')]));return createBucket(_0x18d215[_0x74e1('0x8b')],_0x18d215[_0x74e1('0x8c')],_0x4d50b7[_0x74e1('0x8e')],_0x4d50b7['bucket']);}logger[_0x74e1('0x67')](util[_0x74e1('0x30')](_0x74e1('0x92'),_0x5710f4[_0x74e1('0x4b')]['id'],_0x4d50b7['bucket']));return;}})['then'](function(_0x477698){if(_0xe87ba3['transcribeStatus']===_0x74e1('0x93')){return transcribe(_0x5710f4[_0x74e1('0x4b')]['id'],_0x18d215[_0x74e1('0x8b')],_0x18d215['data2'],_0x4d50b7['transcribeRegion'],_0x4d50b7[_0x74e1('0x75')],_0xe87ba3[_0x74e1('0x51')],_0x4d50b7[_0x74e1('0x86')]);}else{logger[_0x74e1('0x67')](util[_0x74e1('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5710f4[_0x74e1('0x4b')]['id']));return{'transcribeStatus':_0x74e1('0x94')};}})[_0x74e1('0x23')](function(_0xba367b){if(_0xba367b){_0xba367b[_0x74e1('0x95')]=_0x5710f4['body'][_0x74e1('0x83')];return _0xe87ba3[_0x74e1('0x96')](_0xba367b);}})[_0x74e1('0x23')](respondWithResult(_0x25b727,null))['catch'](handleError(_0x25b727,null));};function writeFile(_0x1dd198,_0x4d4295){return new Promise(function(_0x5c870a,_0x5ccf8e){fs['writeFile'](_0x4d4295,_0x1dd198,function(_0x491ccb,_0x5adc76){if(_0x491ccb){return _0x5ccf8e(_0x491ccb);}else{return _0x5c870a(_0x5adc76);}});});}exports[_0x74e1('0x97')]=function(_0x297ed1,_0xa0df1c,_0x1eeaac){return db[_0x74e1('0x2a')][_0x74e1('0x80')]({'where':{'id':_0x297ed1['params']['id']}})[_0x74e1('0x23')](handleEntityNotFound(_0xa0df1c))[_0x74e1('0x23')](function(_0x249b3a){if(_0x249b3a&&_0x249b3a[_0x74e1('0x98')]){var _0x5a7f5f=_0x249b3a['fileText'];var _0x1dcd70=config[_0x74e1('0x99')]+_0x74e1('0x9a')+_0x249b3a['id']+_0x74e1('0x9b');if(fs[_0x74e1('0x55')](_0x1dcd70)){return _0x1dcd70;}return writeFile(_0x5a7f5f,_0x1dcd70)['then'](function(){return _0x1dcd70;});}else{throw new db[(_0x74e1('0x56'))][(_0x74e1('0x57'))]('Transcript\x20not\x20available');}})[_0x74e1('0x23')](function(_0x26b2eb){return _0xa0df1c[_0x74e1('0x4e')](_0x26b2eb);})['catch'](handleError(_0xa0df1c));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6a5a71f..ee69e85 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 _0x285b=['./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x528f00,_0x2ba04c){var _0x1b371a=function(_0x549e5a){while(--_0x549e5a){_0x528f00['push'](_0x528f00['shift']());}};_0x1b371a(++_0x2ba04c);}(_0x285b,0x171));var _0xb285=function(_0x26b239,_0x3046bf){_0x26b239=_0x26b239-0x0;var _0x55b915=_0x285b[_0x26b239];return _0x55b915;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var logger=require(_0xb285('0x1'))(_0xb285('0x2'));var moment=require('moment');var BPromise=require(_0xb285('0x3'));var rp=require(_0xb285('0x4'));var fs=require('fs');var path=require(_0xb285('0x5'));var rimraf=require(_0xb285('0x6'));var config=require(_0xb285('0x7'));var attributes=require(_0xb285('0x8'));module[_0xb285('0x9')]=function(_0xe785ea,_0x333dfb){return _0xe785ea[_0xb285('0xa')]('VoiceRecording',attributes,{'tableName':_0xb285('0xb'),'paranoid':![],'indexes':[{'name':_0xb285('0xc'),'fields':[_0xb285('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5208=['rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5208,0x1d5));var _0x8520=function(_0x39767f,_0xdf30e6){_0x39767f=_0x39767f-0x0;var _0x54ff20=_0x5208[_0x39767f];return _0x54ff20;};'use strict';var _=require('lodash');var util=require(_0x8520('0x0'));var logger=require(_0x8520('0x1'))(_0x8520('0x2'));var moment=require(_0x8520('0x3'));var BPromise=require(_0x8520('0x4'));var rp=require(_0x8520('0x5'));var fs=require('fs');var path=require(_0x8520('0x6'));var rimraf=require(_0x8520('0x7'));var config=require('../../config/environment');var attributes=require(_0x8520('0x8'));module[_0x8520('0x9')]=function(_0x1bb532,_0x2cb469){return _0x1bb532[_0x8520('0xa')](_0x8520('0xb'),attributes,{'tableName':_0x8520('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8520('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 8ad1078..8d0e1b5 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 _0x90b1=['request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','limit','then','../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','%s.cypher','encryptFile','value','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x90b1,0x1bb));var _0x190b=function(_0x3fd7ab,_0x3dd0bc){_0x3fd7ab=_0x3fd7ab-0x0;var _0x56cb4b=_0x90b1[_0x3fd7ab];return _0x56cb4b;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')](_0x21e458[_0x190b('0x17')],{'raw':_0x21e458[_0x190b('0x18')]?_0x21e458[_0x190b('0x18')][_0x190b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21e458['options']?_0x21e458[_0x190b('0x18')][_0x190b('0x1a')]||null:null,'attributes':_0x21e458['options']?_0x21e458[_0x190b('0x18')]['attributes']||null:null,'limit':_0x21e458['options']?_0x21e458[_0x190b('0x18')][_0x190b('0x1b')]||null:null})[_0x190b('0x1c')](function(_0x4c0b6e){logger[_0x190b('0x9')](_0x190b('0x14'),_0x21e458);logger[_0x190b('0xc')](_0x190b('0x14'),_0x21e458,JSON[_0x190b('0xe')](_0x4c0b6e));_0x16c009(_0x4c0b6e);})[_0x190b('0x13')](function(_0x1bce97){logger['error']('UpdateVoiceRecording',_0x1bce97[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a[_0x190b('0xf')](0x1f4,_0x1bce97['message']));});});};exports['CreateVoiceRecording']=function(_0x3260d5){var _0x4e2a93=this;return new Promise(function(_0x328e5e,_0x3b6aaf){var _0x51f8b4=require(_0x190b('0x1d'));var _0x1deea6;return db['Setting'][_0x190b('0x1e')]({'attributes':['id',_0x190b('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x190b('0x1c')](function(_0x494f3f){_0x1deea6=_0x494f3f;return db['VoiceRecording'][_0x190b('0x20')](_0x3260d5['body']);})[_0x190b('0x1c')](function(_0x19e421){if(_0x1deea6['callRecordingEncryption']&&fs[_0x190b('0x21')](_0x19e421['value'])){var _0x40d060=util['format'](_0x190b('0x22'),_0x19e421['value']);return _0x51f8b4[_0x190b('0x23')](_0x19e421[_0x190b('0x24')],_0x40d060,config['secrets'][_0x190b('0x25')])[_0x190b('0x1c')](function(){fs[_0x190b('0x26')](_0x19e421[_0x190b('0x24')]);logger[_0x190b('0x9')](_0x190b('0x27'));return _0x19e421;});}return _0x19e421;})[_0x190b('0x1c')](function(_0x248919){logger['info']('CreateVoiceRecording',_0x3260d5);logger[_0x190b('0xc')](_0x190b('0x28'),_0x3260d5,JSON['stringify'](_0x248919));_0x328e5e(_0x248919);})[_0x190b('0x13')](function(_0x2dcd39){logger[_0x190b('0xf')](_0x190b('0x28'),_0x2dcd39[_0x190b('0x11')],_0x3260d5);_0x3b6aaf(_0x4e2a93[_0x190b('0xf')](0x1f4,_0x2dcd39[_0x190b('0x11')]));});});}; \ No newline at end of file +var _0x6d11=['message','catch','VoiceRecording','update','options','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','body','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2d13b1,_0x2678d5){var _0x18c844=function(_0x4b0e6c){while(--_0x4b0e6c){_0x2d13b1['push'](_0x2d13b1['shift']());}};_0x18c844(++_0x2678d5);}(_0x6d11,0xbf));var _0x16d1=function(_0x4f1869,_0x3946d2){_0x4f1869=_0x4f1869-0x0;var _0x5a0d6d=_0x6d11[_0x4f1869];return _0x5a0d6d;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['UpdateVoiceRecording']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')](_0x46a25e['body'],{'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x18')]||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x19')]||null:null,'limit':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1a')]||null:null})[_0x16d1('0xa')](function(_0x585ce5){logger[_0x16d1('0xb')](_0x16d1('0x1b'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1b'),_0x46a25e,JSON[_0x16d1('0x10')](_0x585ce5));_0x1da1b8(_0x585ce5);})[_0x16d1('0x14')](function(_0x32f362){logger[_0x16d1('0x11')](_0x16d1('0x1b'),_0x32f362[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x32f362[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1c')]=function(_0x262f89){var _0x346b69=this;return new Promise(function(_0x2b8403,_0x491f65){var _0x25ae4e=require(_0x16d1('0x1d'));var _0x4257f1;return db['Setting'][_0x16d1('0x1e')]({'attributes':['id',_0x16d1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x16d1('0xa')](function(_0x22e5b3){_0x4257f1=_0x22e5b3;return db[_0x16d1('0x15')][_0x16d1('0x20')](_0x262f89[_0x16d1('0x21')]);})['then'](function(_0x3dd104){if(_0x4257f1[_0x16d1('0x1f')]&&fs[_0x16d1('0x22')](_0x3dd104[_0x16d1('0x23')])){var _0x55c021=util['format'](_0x16d1('0x24'),_0x3dd104[_0x16d1('0x23')]);return _0x25ae4e[_0x16d1('0x25')](_0x3dd104[_0x16d1('0x23')],_0x55c021,config[_0x16d1('0x26')][_0x16d1('0x27')])[_0x16d1('0xa')](function(){fs[_0x16d1('0x28')](_0x3dd104[_0x16d1('0x23')]);logger[_0x16d1('0xb')](_0x16d1('0x29'));return _0x3dd104;});}return _0x3dd104;})[_0x16d1('0xa')](function(_0x188cf4){logger[_0x16d1('0xb')]('CreateVoiceRecording',_0x262f89);logger[_0x16d1('0xd')]('CreateVoiceRecording',_0x262f89,JSON[_0x16d1('0x10')](_0x188cf4));_0x2b8403(_0x188cf4);})[_0x16d1('0x14')](function(_0x2b9126){logger[_0x16d1('0x11')](_0x16d1('0x1c'),_0x2b9126[_0x16d1('0x13')],_0x262f89);_0x491f65(_0x346b69['error'](0x1f4,_0x2b9126['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c849f93..03d364e 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 _0x7326=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util'];(function(_0x2b0d7d,_0x3f9a3e){var _0xa8709c=function(_0x178048){while(--_0x178048){_0x2b0d7d['push'](_0x2b0d7d['shift']());}};_0xa8709c(++_0x3f9a3e);}(_0x7326,0x14e));var _0x6732=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7326[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x6732('0x0'));var util=require(_0x6732('0x1'));var path=require(_0x6732('0x2'));var timeout=require(_0x6732('0x3'));var express=require(_0x6732('0x4'));var router=express['Router']();var fs_extra=require(_0x6732('0x5'));var auth=require(_0x6732('0x6'));var interaction=require(_0x6732('0x7'));var config=require(_0x6732('0x8'));var controller=require(_0x6732('0x9'));router[_0x6732('0xa')]('/',auth[_0x6732('0xb')](),controller[_0x6732('0xc')]);router[_0x6732('0xa')](_0x6732('0xd'),auth[_0x6732('0xb')](),controller[_0x6732('0xe')]);router['get'](_0x6732('0xf'),auth['isAuthenticated'](),controller[_0x6732('0x10')]);router[_0x6732('0x11')]('/',auth[_0x6732('0xb')](),controller['create']);router['put'](_0x6732('0xf'),auth[_0x6732('0xb')](),controller[_0x6732('0x12')]);router[_0x6732('0x13')](_0x6732('0xf'),auth[_0x6732('0xb')](),controller[_0x6732('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5b06=['create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x54dcec,_0x202f84){var _0x5b8bac=function(_0x5079a9){while(--_0x5079a9){_0x54dcec['push'](_0x54dcec['shift']());}};_0x5b8bac(++_0x202f84);}(_0x5b06,0x17f));var _0x65b0=function(_0x168054,_0x132055){_0x168054=_0x168054-0x0;var _0x280b8b=_0x5b06[_0x168054];return _0x280b8b;};'use strict';var multer=require(_0x65b0('0x0'));var util=require(_0x65b0('0x1'));var path=require(_0x65b0('0x2'));var timeout=require(_0x65b0('0x3'));var express=require('express');var router=express[_0x65b0('0x4')]();var fs_extra=require(_0x65b0('0x5'));var auth=require(_0x65b0('0x6'));var interaction=require(_0x65b0('0x7'));var config=require(_0x65b0('0x8'));var controller=require(_0x65b0('0x9'));router[_0x65b0('0xa')]('/',auth[_0x65b0('0xb')](),controller[_0x65b0('0xc')]);router['get']('/describe',auth[_0x65b0('0xb')](),controller[_0x65b0('0xd')]);router[_0x65b0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x65b0('0xe')]);router[_0x65b0('0xf')]('/',auth[_0x65b0('0xb')](),controller[_0x65b0('0x10')]);router[_0x65b0('0x11')](_0x65b0('0x12'),auth[_0x65b0('0xb')](),controller[_0x65b0('0x13')]);router[_0x65b0('0x14')](_0x65b0('0x12'),auth[_0x65b0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index dd16301..e2aa6de 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 _0x906b=['moment','exports','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0xf3cbad,_0x201fdb){var _0x27866f=function(_0x143bc4){while(--_0x143bc4){_0xf3cbad['push'](_0xf3cbad['shift']());}};_0x27866f(++_0x201fdb);}(_0x906b,0xb7));var _0xb906=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x906b[_0x210d7f];return _0x42d687;};'use strict';var Sequelize=require(_0xb906('0x0'));var moment=require(_0xb906('0x1'));module[_0xb906('0x2')]={'type':{'type':Sequelize[_0xb906('0x3')](_0xb906('0x4'),_0xb906('0x5'))},'result':{'type':Sequelize[_0xb906('0x6')]},'transfererchannel':{'type':Sequelize[_0xb906('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xb906('0x6')]},'transferercalleridname':{'type':Sequelize[_0xb906('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb906('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb906('0x6')]},'transferercontext':{'type':Sequelize[_0xb906('0x6')]},'transfererexten':{'type':Sequelize[_0xb906('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xb906('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xb906('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xb906('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xb906('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xb906('0x6')]},'transfereecontext':{'type':Sequelize[_0xb906('0x6')]},'transfereeexten':{'type':Sequelize[_0xb906('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xb906('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xb906('0x7'),'No')},'context':{'type':Sequelize[_0xb906('0x6')]},'extension':{'type':Sequelize[_0xb906('0x6')]}}; \ No newline at end of file +var _0x7366=['attended','STRING','Yes','sequelize','moment','exports','ENUM','blind'];(function(_0x3f573b,_0x5ecd70){var _0x48a84e=function(_0x1c20be){while(--_0x1c20be){_0x3f573b['push'](_0x3f573b['shift']());}};_0x48a84e(++_0x5ecd70);}(_0x7366,0x103));var _0x6736=function(_0x4f7848,_0x41579d){_0x4f7848=_0x4f7848-0x0;var _0x2ac58a=_0x7366[_0x4f7848];return _0x2ac58a;};'use strict';var Sequelize=require(_0x6736('0x0'));var moment=require(_0x6736('0x1'));module[_0x6736('0x2')]={'type':{'type':Sequelize[_0x6736('0x3')](_0x6736('0x4'),_0x6736('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x6736('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x6736('0x6')]},'transferercalleridname':{'type':Sequelize[_0x6736('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x6736('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x6736('0x6')]},'transferercontext':{'type':Sequelize[_0x6736('0x6')]},'transfererexten':{'type':Sequelize[_0x6736('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x6736('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x6736('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x6736('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6736('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6736('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x6736('0x6')]},'transfereecontext':{'type':Sequelize[_0x6736('0x6')]},'transfereeexten':{'type':Sequelize[_0x6736('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x6736('0x3')](_0x6736('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index bb09d92..6e3da0e 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 _0xe129=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','VoiceTransferReport','rows','catch','params','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x232cc5,_0x49cce0){var _0x270ad1=function(_0x286598){while(--_0x286598){_0x232cc5['push'](_0x232cc5['shift']());}};_0x270ad1(++_0x49cce0);}(_0xe129,0x8f));var _0x9e12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe129[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e12('0x0'));var zipdir=require(_0x9e12('0x1'));var jsonpatch=require(_0x9e12('0x2'));var rp=require(_0x9e12('0x3'));var moment=require(_0x9e12('0x4'));var BPromise=require(_0x9e12('0x5'));var Mustache=require(_0x9e12('0x6'));var util=require(_0x9e12('0x7'));var path=require(_0x9e12('0x8'));var sox=require(_0x9e12('0x9'));var csv=require(_0x9e12('0xa'));var ejs=require(_0x9e12('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e12('0xc'));var squel=require(_0x9e12('0xd'));var crypto=require(_0x9e12('0xe'));var jsforce=require(_0x9e12('0xf'));var deskjs=require(_0x9e12('0x10'));var toCsv=require(_0x9e12('0xa'));var querystring=require(_0x9e12('0x11'));var Papa=require(_0x9e12('0x12'));var Redis=require(_0x9e12('0x13'));var authService=require(_0x9e12('0x14'));var qs=require(_0x9e12('0x15'));var as=require(_0x9e12('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9e12('0x17'));var config=require(_0x9e12('0x18'));var licenseUtil=require(_0x9e12('0x19'));var db=require(_0x9e12('0x1a'))['db'];function respondWithStatusCode(_0x39ee9a,_0x10f8d2){_0x10f8d2=_0x10f8d2||0xcc;return function(_0x25c973){if(_0x25c973){return _0x39ee9a[_0x9e12('0x1b')](_0x10f8d2);}return _0x39ee9a[_0x9e12('0x1c')](_0x10f8d2)['end']();};}function respondWithResult(_0x191db6,_0x819490){_0x819490=_0x819490||0xc8;return function(_0x21c35b){if(_0x21c35b){return _0x191db6[_0x9e12('0x1c')](_0x819490)[_0x9e12('0x1d')](_0x21c35b);}};}function respondWithFilteredResult(_0x28acbe,_0x5a96c4){return function(_0x8e00a4){if(_0x8e00a4){var _0x2b4f6b=typeof _0x5a96c4[_0x9e12('0x1e')]===_0x9e12('0x1f')&&typeof _0x5a96c4[_0x9e12('0x20')]==='undefined';var _0x470113=_0x8e00a4[_0x9e12('0x21')];var _0x40d8d5=_0x2b4f6b?0x0:_0x5a96c4[_0x9e12('0x1e')];var _0x4d88b=_0x2b4f6b?_0x8e00a4[_0x9e12('0x21')]:_0x5a96c4['offset']+_0x5a96c4[_0x9e12('0x20')];var _0x5065d1;if(_0x4d88b>=_0x470113){_0x4d88b=_0x470113;_0x5065d1=0xc8;}else{_0x5065d1=0xce;}_0x28acbe[_0x9e12('0x1c')](_0x5065d1);return _0x28acbe[_0x9e12('0x22')]('Content-Range',_0x40d8d5+'-'+_0x4d88b+'/'+_0x470113)[_0x9e12('0x1d')](_0x8e00a4);}return null;};}function patchUpdates(_0x1bba81){return function(_0x145518){try{jsonpatch[_0x9e12('0x23')](_0x145518,_0x1bba81,!![]);}catch(_0x38ccb9){return BPromise[_0x9e12('0x24')](_0x38ccb9);}return _0x145518[_0x9e12('0x25')]();};}function saveUpdates(_0x5eb74f,_0x3ee6a7){return function(_0x15b79a){if(_0x15b79a){return _0x15b79a[_0x9e12('0x26')](_0x5eb74f)[_0x9e12('0x27')](function(_0x25037a){return _0x25037a;});}return null;};}function removeEntity(_0x18292b,_0x15a683){return function(_0x2d45dd){if(_0x2d45dd){return _0x2d45dd[_0x9e12('0x28')]()[_0x9e12('0x27')](function(){_0x18292b[_0x9e12('0x1c')](0xcc)[_0x9e12('0x29')]();});}};}function handleEntityNotFound(_0x5cb60b,_0x3fdced){return function(_0x37c84b){if(!_0x37c84b){_0x5cb60b[_0x9e12('0x1b')](0x194);}return _0x37c84b;};}function handleError(_0x2ded27,_0x1a1337){_0x1a1337=_0x1a1337||0x1f4;return function(_0x1b4465){logger[_0x9e12('0x2a')](_0x1b4465[_0x9e12('0x2b')]);if(_0x1b4465['name']){delete _0x1b4465[_0x9e12('0x2c')];}_0x2ded27[_0x9e12('0x1c')](_0x1a1337)[_0x9e12('0x2d')](_0x1b4465);};}exports[_0x9e12('0x2e')]=function(_0x11c4ce,_0x19e2f0){var _0x4be360={},_0x21273e={},_0x3df1ef={'count':0x0,'rows':[]};var _0x35530f=_[_0x9e12('0x2f')](db['VoiceTransferReport'][_0x9e12('0x30')],function(_0x5b9824){return{'name':_0x5b9824[_0x9e12('0x31')],'type':_0x5b9824[_0x9e12('0x32')][_0x9e12('0x33')]};});_0x21273e[_0x9e12('0x34')]=_[_0x9e12('0x2f')](_0x35530f,_0x9e12('0x2c'));_0x21273e[_0x9e12('0x35')]=_[_0x9e12('0x36')](_0x11c4ce[_0x9e12('0x35')]);_0x21273e[_0x9e12('0x37')]=_[_0x9e12('0x38')](_0x21273e[_0x9e12('0x34')],_0x21273e[_0x9e12('0x35')]);_0x4be360[_0x9e12('0x39')]=_[_0x9e12('0x38')](_0x21273e['model'],qs[_0x9e12('0x3a')](_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x3a')]));_0x4be360['attributes']=_0x4be360[_0x9e12('0x39')][_0x9e12('0x3b')]?_0x4be360[_0x9e12('0x39')]:_0x21273e[_0x9e12('0x34')];if(!_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x3c')](_0x9e12('0x3d'))){_0x4be360[_0x9e12('0x20')]=qs['limit'](_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x20')]);_0x4be360[_0x9e12('0x1e')]=qs['offset'](_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x1e')]);}_0x4be360[_0x9e12('0x3e')]=qs[_0x9e12('0x3f')](_0x11c4ce[_0x9e12('0x35')]['sort']);_0x4be360[_0x9e12('0x40')]=qs[_0x9e12('0x37')](_[_0x9e12('0x41')](_0x11c4ce[_0x9e12('0x35')],_0x21273e[_0x9e12('0x37')]),_0x35530f);if(_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x42')]){_0x4be360['where']=_[_0x9e12('0x43')](_0x4be360['where'],{'$or':_[_0x9e12('0x2f')](_0x35530f,function(_0x3ad01b){if(_0x3ad01b['type']!==_0x9e12('0x44')){var _0x29c414={};_0x29c414[_0x3ad01b[_0x9e12('0x2c')]]={'$like':'%'+_0x11c4ce['query']['filter']+'%'};return _0x29c414;}})});}_0x4be360=_[_0x9e12('0x43')]({},_0x4be360,_0x11c4ce['options']);var _0x2006b7={'where':_0x4be360[_0x9e12('0x40')]};return db['VoiceTransferReport'][_0x9e12('0x21')](_0x2006b7)[_0x9e12('0x27')](function(_0x265720){_0x3df1ef['count']=_0x265720;if(_0x11c4ce[_0x9e12('0x35')][_0x9e12('0x45')]){_0x4be360[_0x9e12('0x46')]=[{'all':!![]}];}return db[_0x9e12('0x47')]['findAll'](_0x4be360);})['then'](function(_0x53171d){_0x3df1ef[_0x9e12('0x48')]=_0x53171d;return _0x3df1ef;})['then'](respondWithFilteredResult(_0x19e2f0,_0x4be360))[_0x9e12('0x49')](handleError(_0x19e2f0,null));};exports['show']=function(_0x410129,_0x163e6d){var _0x4b91c5={'raw':!![],'where':{'id':_0x410129[_0x9e12('0x4a')]['id']}},_0x3a76e4={};_0x3a76e4[_0x9e12('0x34')]=_[_0x9e12('0x36')](db[_0x9e12('0x47')]['rawAttributes']);_0x3a76e4[_0x9e12('0x35')]=_['keys'](_0x410129[_0x9e12('0x35')]);_0x3a76e4['filters']=_[_0x9e12('0x38')](_0x3a76e4[_0x9e12('0x34')],_0x3a76e4[_0x9e12('0x35')]);_0x4b91c5[_0x9e12('0x39')]=_['intersection'](_0x3a76e4['model'],qs['fields'](_0x410129[_0x9e12('0x35')][_0x9e12('0x3a')]));_0x4b91c5['attributes']=_0x4b91c5[_0x9e12('0x39')]['length']?_0x4b91c5[_0x9e12('0x39')]:_0x3a76e4[_0x9e12('0x34')];if(_0x410129['query'][_0x9e12('0x45')]){_0x4b91c5['include']=[{'all':!![]}];}_0x4b91c5=_[_0x9e12('0x43')]({},_0x4b91c5,_0x410129[_0x9e12('0x4b')]);return db[_0x9e12('0x47')]['find'](_0x4b91c5)['then'](handleEntityNotFound(_0x163e6d,null))[_0x9e12('0x27')](respondWithResult(_0x163e6d,null))[_0x9e12('0x49')](handleError(_0x163e6d,null));};exports[_0x9e12('0x4c')]=function(_0x8429ce,_0x24e8c2){return db['VoiceTransferReport']['create'](_0x8429ce[_0x9e12('0x4d')],{})['then'](respondWithResult(_0x24e8c2,0xc9))[_0x9e12('0x49')](handleError(_0x24e8c2,null));};exports[_0x9e12('0x26')]=function(_0x6f2b89,_0x48ca32){if(_0x6f2b89[_0x9e12('0x4d')]['id']){delete _0x6f2b89[_0x9e12('0x4d')]['id'];}return db['VoiceTransferReport'][_0x9e12('0x4e')]({'where':{'id':_0x6f2b89[_0x9e12('0x4a')]['id']}})[_0x9e12('0x27')](handleEntityNotFound(_0x48ca32,null))[_0x9e12('0x27')](saveUpdates(_0x6f2b89['body'],null))[_0x9e12('0x27')](respondWithResult(_0x48ca32,null))[_0x9e12('0x49')](handleError(_0x48ca32,null));};exports[_0x9e12('0x28')]=function(_0x4b7b91,_0x5600ff){return db['VoiceTransferReport'][_0x9e12('0x4e')]({'where':{'id':_0x4b7b91[_0x9e12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5600ff,null))[_0x9e12('0x27')](removeEntity(_0x5600ff,null))[_0x9e12('0x49')](handleError(_0x5600ff,null));};exports['describe']=function(_0x3c844e,_0x1f7a83){return db[_0x9e12('0x47')][_0x9e12('0x4f')]()[_0x9e12('0x27')](respondWithResult(_0x1f7a83,null))['catch'](handleError(_0x1f7a83,null));}; \ No newline at end of file +var _0x516c=['options','find','body','describe','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','name','send','index','map','VoiceTransferReport','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys'];(function(_0xaa534a,_0x24dc24){var _0x45f1d4=function(_0x59eef6){while(--_0x59eef6){_0xaa534a['push'](_0xaa534a['shift']());}};_0x45f1d4(++_0x24dc24);}(_0x516c,0x158));var _0xc516=function(_0x1415d1,_0x5283d1){_0x1415d1=_0x1415d1-0x0;var _0x2622bf=_0x516c[_0x1415d1];return _0x2622bf;};'use strict';var emlformat=require(_0xc516('0x0'));var rimraf=require(_0xc516('0x1'));var zipdir=require(_0xc516('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc516('0x3'));var Mustache=require('mustache');var util=require(_0xc516('0x4'));var path=require(_0xc516('0x5'));var sox=require(_0xc516('0x6'));var csv=require('to-csv');var ejs=require(_0xc516('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc516('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc516('0x9'));var toCsv=require('to-csv');var querystring=require(_0xc516('0xa'));var Papa=require(_0xc516('0xb'));var Redis=require(_0xc516('0xc'));var authService=require(_0xc516('0xd'));var qs=require(_0xc516('0xe'));var as=require(_0xc516('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc516('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xc516('0x11'));var licenseUtil=require(_0xc516('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xabac08,_0x34ddb5){_0x34ddb5=_0x34ddb5||0xcc;return function(_0x2090c9){if(_0x2090c9){return _0xabac08[_0xc516('0x13')](_0x34ddb5);}return _0xabac08['status'](_0x34ddb5)[_0xc516('0x14')]();};}function respondWithResult(_0x1a5d9d,_0x532941){_0x532941=_0x532941||0xc8;return function(_0x31a63d){if(_0x31a63d){return _0x1a5d9d[_0xc516('0x15')](_0x532941)['json'](_0x31a63d);}};}function respondWithFilteredResult(_0x27f961,_0x48f62c){return function(_0x320114){if(_0x320114){var _0x41f895=typeof _0x48f62c['offset']==='undefined'&&typeof _0x48f62c['limit']===_0xc516('0x16');var _0x1c34d4=_0x320114['count'];var _0x3d9962=_0x41f895?0x0:_0x48f62c['offset'];var _0x467c0f=_0x41f895?_0x320114[_0xc516('0x17')]:_0x48f62c[_0xc516('0x18')]+_0x48f62c[_0xc516('0x19')];var _0x5ce630;if(_0x467c0f>=_0x1c34d4){_0x467c0f=_0x1c34d4;_0x5ce630=0xc8;}else{_0x5ce630=0xce;}_0x27f961[_0xc516('0x15')](_0x5ce630);return _0x27f961[_0xc516('0x1a')](_0xc516('0x1b'),_0x3d9962+'-'+_0x467c0f+'/'+_0x1c34d4)[_0xc516('0x1c')](_0x320114);}return null;};}function patchUpdates(_0x56b463){return function(_0x4e2a2d){try{jsonpatch[_0xc516('0x1d')](_0x4e2a2d,_0x56b463,!![]);}catch(_0x279bf2){return BPromise['reject'](_0x279bf2);}return _0x4e2a2d[_0xc516('0x1e')]();};}function saveUpdates(_0x12059f,_0x1cbcbb){return function(_0x2f682a){if(_0x2f682a){return _0x2f682a[_0xc516('0x1f')](_0x12059f)['then'](function(_0x262c2d){return _0x262c2d;});}return null;};}function removeEntity(_0x6066,_0x347a5d){return function(_0x189c81){if(_0x189c81){return _0x189c81[_0xc516('0x20')]()[_0xc516('0x21')](function(){_0x6066[_0xc516('0x15')](0xcc)[_0xc516('0x14')]();});}};}function handleEntityNotFound(_0x369dbf,_0x3bd8cb){return function(_0xabe30){if(!_0xabe30){_0x369dbf[_0xc516('0x13')](0x194);}return _0xabe30;};}function handleError(_0x3f0c39,_0x3f54e2){_0x3f54e2=_0x3f54e2||0x1f4;return function(_0x34f1b3){logger['error'](_0x34f1b3['stack']);if(_0x34f1b3[_0xc516('0x22')]){delete _0x34f1b3['name'];}_0x3f0c39[_0xc516('0x15')](_0x3f54e2)[_0xc516('0x23')](_0x34f1b3);};}exports[_0xc516('0x24')]=function(_0x407866,_0x2c8e22){var _0x483099={},_0x58d549={},_0x128a32={'count':0x0,'rows':[]};var _0x3b2133=_[_0xc516('0x25')](db[_0xc516('0x26')][_0xc516('0x27')],function(_0x3ef0f7){return{'name':_0x3ef0f7['fieldName'],'type':_0x3ef0f7[_0xc516('0x28')]['key']};});_0x58d549[_0xc516('0x29')]=_['map'](_0x3b2133,_0xc516('0x22'));_0x58d549['query']=_['keys'](_0x407866[_0xc516('0x2a')]);_0x58d549[_0xc516('0x2b')]=_['intersection'](_0x58d549[_0xc516('0x29')],_0x58d549[_0xc516('0x2a')]);_0x483099[_0xc516('0x2c')]=_[_0xc516('0x2d')](_0x58d549['model'],qs['fields'](_0x407866[_0xc516('0x2a')][_0xc516('0x2e')]));_0x483099[_0xc516('0x2c')]=_0x483099[_0xc516('0x2c')][_0xc516('0x2f')]?_0x483099['attributes']:_0x58d549[_0xc516('0x29')];if(!_0x407866['query'][_0xc516('0x30')](_0xc516('0x31'))){_0x483099[_0xc516('0x19')]=qs[_0xc516('0x19')](_0x407866[_0xc516('0x2a')][_0xc516('0x19')]);_0x483099[_0xc516('0x18')]=qs[_0xc516('0x18')](_0x407866['query'][_0xc516('0x18')]);}_0x483099[_0xc516('0x32')]=qs['sort'](_0x407866[_0xc516('0x2a')][_0xc516('0x33')]);_0x483099[_0xc516('0x34')]=qs[_0xc516('0x2b')](_[_0xc516('0x35')](_0x407866[_0xc516('0x2a')],_0x58d549['filters']),_0x3b2133);if(_0x407866[_0xc516('0x2a')][_0xc516('0x36')]){_0x483099[_0xc516('0x34')]=_[_0xc516('0x37')](_0x483099[_0xc516('0x34')],{'$or':_['map'](_0x3b2133,function(_0x18ed9a){if(_0x18ed9a[_0xc516('0x28')]!==_0xc516('0x38')){var _0x3b85ec={};_0x3b85ec[_0x18ed9a[_0xc516('0x22')]]={'$like':'%'+_0x407866[_0xc516('0x2a')][_0xc516('0x36')]+'%'};return _0x3b85ec;}})});}_0x483099=_[_0xc516('0x37')]({},_0x483099,_0x407866['options']);var _0x1a3015={'where':_0x483099['where']};return db[_0xc516('0x26')][_0xc516('0x17')](_0x1a3015)[_0xc516('0x21')](function(_0xc76981){_0x128a32[_0xc516('0x17')]=_0xc76981;if(_0x407866['query'][_0xc516('0x39')]){_0x483099[_0xc516('0x3a')]=[{'all':!![]}];}return db[_0xc516('0x26')][_0xc516('0x3b')](_0x483099);})[_0xc516('0x21')](function(_0x75ef5d){_0x128a32['rows']=_0x75ef5d;return _0x128a32;})[_0xc516('0x21')](respondWithFilteredResult(_0x2c8e22,_0x483099))[_0xc516('0x3c')](handleError(_0x2c8e22,null));};exports[_0xc516('0x3d')]=function(_0x523a8c,_0x51f40f){var _0x4fe000={'raw':!![],'where':{'id':_0x523a8c[_0xc516('0x3e')]['id']}},_0x4bedf8={};_0x4bedf8['model']=_[_0xc516('0x3f')](db[_0xc516('0x26')][_0xc516('0x27')]);_0x4bedf8['query']=_[_0xc516('0x3f')](_0x523a8c[_0xc516('0x2a')]);_0x4bedf8[_0xc516('0x2b')]=_[_0xc516('0x2d')](_0x4bedf8[_0xc516('0x29')],_0x4bedf8[_0xc516('0x2a')]);_0x4fe000['attributes']=_[_0xc516('0x2d')](_0x4bedf8[_0xc516('0x29')],qs[_0xc516('0x2e')](_0x523a8c[_0xc516('0x2a')][_0xc516('0x2e')]));_0x4fe000[_0xc516('0x2c')]=_0x4fe000[_0xc516('0x2c')]['length']?_0x4fe000[_0xc516('0x2c')]:_0x4bedf8[_0xc516('0x29')];if(_0x523a8c['query'][_0xc516('0x39')]){_0x4fe000['include']=[{'all':!![]}];}_0x4fe000=_[_0xc516('0x37')]({},_0x4fe000,_0x523a8c[_0xc516('0x40')]);return db[_0xc516('0x26')][_0xc516('0x41')](_0x4fe000)[_0xc516('0x21')](handleEntityNotFound(_0x51f40f,null))['then'](respondWithResult(_0x51f40f,null))['catch'](handleError(_0x51f40f,null));};exports['create']=function(_0x350d6,_0x3439ed){return db['VoiceTransferReport']['create'](_0x350d6[_0xc516('0x42')],{})['then'](respondWithResult(_0x3439ed,0xc9))[_0xc516('0x3c')](handleError(_0x3439ed,null));};exports[_0xc516('0x1f')]=function(_0xd17bb5,_0x2e5512){if(_0xd17bb5[_0xc516('0x42')]['id']){delete _0xd17bb5[_0xc516('0x42')]['id'];}return db[_0xc516('0x26')]['find']({'where':{'id':_0xd17bb5[_0xc516('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2e5512,null))['then'](saveUpdates(_0xd17bb5['body'],null))[_0xc516('0x21')](respondWithResult(_0x2e5512,null))[_0xc516('0x3c')](handleError(_0x2e5512,null));};exports[_0xc516('0x20')]=function(_0x1ab80d,_0x48ef4e){return db[_0xc516('0x26')][_0xc516('0x41')]({'where':{'id':_0x1ab80d[_0xc516('0x3e')]['id']}})[_0xc516('0x21')](handleEntityNotFound(_0x48ef4e,null))[_0xc516('0x21')](removeEntity(_0x48ef4e,null))[_0xc516('0x3c')](handleError(_0x48ef4e,null));};exports[_0xc516('0x43')]=function(_0x1542c2,_0x1d00bb){return db[_0xc516('0x26')][_0xc516('0x43')]()[_0xc516('0x21')](respondWithResult(_0x1d00bb,null))['catch'](handleError(_0x1d00bb,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3f0c2ea..4b1f208 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 _0x0aec=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xed798f,_0x43a4a2){var _0x427fd9=function(_0xe8bd10){while(--_0xe8bd10){_0xed798f['push'](_0xed798f['shift']());}};_0x427fd9(++_0x43a4a2);}(_0x0aec,0x87));var _0xc0ae=function(_0x1d8687,_0x212ee9){_0x1d8687=_0x1d8687-0x0;var _0x4a4a03=_0x0aec[_0x1d8687];return _0x4a4a03;};'use strict';var _=require('lodash');var util=require(_0xc0ae('0x0'));var logger=require(_0xc0ae('0x1'))(_0xc0ae('0x2'));var moment=require(_0xc0ae('0x3'));var BPromise=require(_0xc0ae('0x4'));var rp=require(_0xc0ae('0x5'));var fs=require('fs');var path=require(_0xc0ae('0x6'));var rimraf=require(_0xc0ae('0x7'));var config=require('../../config/environment');var attributes=require(_0xc0ae('0x8'));module[_0xc0ae('0x9')]=function(_0x3460a7,_0x515ca9){return _0x3460a7[_0xc0ae('0xa')](_0xc0ae('0xb'),attributes,{'tableName':_0xc0ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36c1=['moment','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','../../config/logger','api'];(function(_0x403a5e,_0x7fffa7){var _0x24d221=function(_0x3299d8){while(--_0x3299d8){_0x403a5e['push'](_0x403a5e['shift']());}};_0x24d221(++_0x7fffa7);}(_0x36c1,0x11b));var _0x136c=function(_0x459963,_0x5a366a){_0x459963=_0x459963-0x0;var _0xbe84e3=_0x36c1[_0x459963];return _0xbe84e3;};'use strict';var _=require(_0x136c('0x0'));var util=require('util');var logger=require(_0x136c('0x1'))(_0x136c('0x2'));var moment=require(_0x136c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x136c('0x4'));var rimraf=require(_0x136c('0x5'));var config=require(_0x136c('0x6'));var attributes=require(_0x136c('0x7'));module[_0x136c('0x8')]=function(_0x447c6c,_0xf5b4a1){return _0x447c6c[_0x136c('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x136c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index a33f89b..10cc6ed 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 _0xa0d8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','options','raw','CreateVoiceTransferReport','stringify','lodash'];(function(_0x337af1,_0x2b1114){var _0x13040d=function(_0x3aa68a){while(--_0x3aa68a){_0x337af1['push'](_0x337af1['shift']());}};_0x13040d(++_0x2b1114);}(_0xa0d8,0x19d));var _0x8a0d=function(_0x5d3b5e,_0x4e9cf6){_0x5d3b5e=_0x5d3b5e-0x0;var _0x44f917=_0xa0d8[_0x5d3b5e];return _0x44f917;};'use strict';var _=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var moment=require(_0x8a0d('0x2'));var BPromise=require(_0x8a0d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a0d('0x4'));var db=require(_0x8a0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a0d('0x6'))(_0x8a0d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a0d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x69d3b7,_0x37963d,_0x12068d){return new BPromise(function(_0x41c013,_0x124967){return client[_0x8a0d('0x9')](_0x69d3b7,_0x12068d)[_0x8a0d('0xa')](function(_0x313c36){logger[_0x8a0d('0xb')](_0x8a0d('0xc'),_0x37963d,_0x8a0d('0xd'));logger[_0x8a0d('0xe')](_0x8a0d('0xf'),_0x37963d,'request\x20sent',JSON['stringify'](_0x313c36));if(_0x313c36[_0x8a0d('0x10')]){if(_0x313c36['error']['code']===0x1f4){logger[_0x8a0d('0x10')](_0x8a0d('0xc'),_0x37963d,_0x313c36[_0x8a0d('0x10')][_0x8a0d('0x11')]);return _0x124967(_0x313c36[_0x8a0d('0x10')][_0x8a0d('0x11')]);}logger[_0x8a0d('0x10')](_0x8a0d('0xc'),_0x37963d,_0x313c36['error'][_0x8a0d('0x11')]);return _0x41c013(_0x313c36[_0x8a0d('0x10')]['message']);}else{logger[_0x8a0d('0xb')](_0x8a0d('0xc'),_0x37963d,'request\x20sent');_0x41c013(_0x313c36[_0x8a0d('0x12')][_0x8a0d('0x11')]);}})['catch'](function(_0x5d739f){logger['error'](_0x8a0d('0xc'),_0x37963d,_0x5d739f);_0x124967(_0x5d739f);});});}exports['CreateVoiceTransferReport']=function(_0x5c2f39){var _0x3abf97=this;return new Promise(function(_0x43eb08,_0x1a2813){return db['VoiceTransferReport']['create'](_0x5c2f39['body'],{'raw':_0x5c2f39[_0x8a0d('0x13')]?_0x5c2f39[_0x8a0d('0x13')][_0x8a0d('0x14')]===undefined?!![]:![]:!![]})[_0x8a0d('0xa')](function(_0x20177e){logger['info']('CreateVoiceTransferReport',_0x5c2f39);logger[_0x8a0d('0xe')](_0x8a0d('0x15'),_0x5c2f39,JSON[_0x8a0d('0x16')](_0x20177e));_0x43eb08(_0x20177e);})['catch'](function(_0x18cbf3){logger[_0x8a0d('0x10')](_0x8a0d('0x15'),_0x18cbf3['message'],_0x5c2f39);_0x1a2813(_0x3abf97[_0x8a0d('0x10')](0x1f4,_0x18cbf3[_0x8a0d('0x11')]));});});}; \ No newline at end of file +var _0x6678=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6678,0x64));var _0x8667=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x6678[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x8667('0x0'));var util=require(_0x8667('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8667('0x2'));var fs=require('fs');var Redis=require(_0x8667('0x3'));var db=require(_0x8667('0x4'))['db'];var utils=require(_0x8667('0x5'));var logger=require('../../config/logger')(_0x8667('0x6'));var config=require(_0x8667('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8667('0x8')][_0x8667('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aa2ad,_0x4aa987,_0x56d904){return new BPromise(function(_0x2c0880,_0x2c23da){return client[_0x8667('0xa')](_0x1aa2ad,_0x56d904)[_0x8667('0xb')](function(_0x20d15c){logger[_0x8667('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x4aa987,_0x8667('0xd'));logger[_0x8667('0xe')](_0x8667('0xf'),_0x4aa987,'request\x20sent',JSON[_0x8667('0x10')](_0x20d15c));if(_0x20d15c[_0x8667('0x11')]){if(_0x20d15c['error']['code']===0x1f4){logger['error'](_0x8667('0x12'),_0x4aa987,_0x20d15c[_0x8667('0x11')][_0x8667('0x13')]);return _0x2c23da(_0x20d15c[_0x8667('0x11')][_0x8667('0x13')]);}logger[_0x8667('0x11')](_0x8667('0x12'),_0x4aa987,_0x20d15c[_0x8667('0x11')][_0x8667('0x13')]);return _0x2c0880(_0x20d15c[_0x8667('0x11')][_0x8667('0x13')]);}else{logger[_0x8667('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x4aa987,_0x8667('0xd'));_0x2c0880(_0x20d15c['result'][_0x8667('0x13')]);}})[_0x8667('0x14')](function(_0x1c4e9c){logger['error'](_0x8667('0x12'),_0x4aa987,_0x1c4e9c);_0x2c23da(_0x1c4e9c);});});}exports[_0x8667('0x15')]=function(_0x2b81b9){var _0x47671d=this;return new Promise(function(_0x3d026d,_0x3fa59c){return db['VoiceTransferReport'][_0x8667('0x16')](_0x2b81b9[_0x8667('0x17')],{'raw':_0x2b81b9[_0x8667('0x18')]?_0x2b81b9['options'][_0x8667('0x19')]===undefined?!![]:![]:!![]})[_0x8667('0xb')](function(_0x446d87){logger[_0x8667('0xc')](_0x8667('0x15'),_0x2b81b9);logger[_0x8667('0xe')](_0x8667('0x15'),_0x2b81b9,JSON['stringify'](_0x446d87));_0x3d026d(_0x446d87);})[_0x8667('0x14')](function(_0x4a4d78){logger['error'](_0x8667('0x15'),_0x4a4d78[_0x8667('0x13')],_0x2b81b9);_0x3fa59c(_0x47671d[_0x8667('0x11')](0x1f4,_0x4a4d78['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c20c6ef..6efd236 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 _0x03c1=['Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate','isAuthenticated','hangup','/answer','hold','unhold','calls','transfer','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x03c1,0x149));var _0x103c=function(_0xa03344,_0x581292){_0xa03344=_0xa03344-0x0;var _0x38acfd=_0x03c1[_0xa03344];return _0x38acfd;};'use strict';var express=require(_0x103c('0x0'));var router=express[_0x103c('0x1')]();var auth=require(_0x103c('0x2'));var controller=require(_0x103c('0x3'));router[_0x103c('0x4')](_0x103c('0x5'),auth['isAuthenticated'](),auth[_0x103c('0x6')](),controller[_0x103c('0x7')]);router[_0x103c('0x4')]('/hangup',auth[_0x103c('0x8')](),auth[_0x103c('0x6')](),controller[_0x103c('0x9')]);router['post'](_0x103c('0xa'),auth['isAuthenticated'](),auth[_0x103c('0x6')](),controller['answer']);router[_0x103c('0x4')]('/hold',auth[_0x103c('0x8')](),auth[_0x103c('0x6')](),controller[_0x103c('0xb')]);router['post']('/unhold',auth['isAuthenticated'](),auth[_0x103c('0x6')](),controller[_0x103c('0xc')]);router[_0x103c('0x4')]('/calls',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x103c('0xd')]);router[_0x103c('0x4')]('/transfer',auth[_0x103c('0x8')](),auth['canUpdate'](),controller[_0x103c('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7652=['transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','/hangup','canUpdate','hangup','/answer','answer','/unhold','unhold','/calls','calls','/transfer'];(function(_0x3006b4,_0x524f86){var _0x50c960=function(_0x495e1a){while(--_0x495e1a){_0x3006b4['push'](_0x3006b4['shift']());}};_0x50c960(++_0x524f86);}(_0x7652,0xb6));var _0x2765=function(_0x2ec3fe,_0x3b7fd8){_0x2ec3fe=_0x2ec3fe-0x0;var _0x380ba8=_0x7652[_0x2ec3fe];return _0x380ba8;};'use strict';var express=require(_0x2765('0x0'));var router=express[_0x2765('0x1')]();var auth=require(_0x2765('0x2'));var controller=require(_0x2765('0x3'));router[_0x2765('0x4')]('/originate',auth[_0x2765('0x5')](),auth['canUpdate'](),controller['originate']);router[_0x2765('0x4')](_0x2765('0x6'),auth[_0x2765('0x5')](),auth[_0x2765('0x7')](),controller[_0x2765('0x8')]);router['post'](_0x2765('0x9'),auth[_0x2765('0x5')](),auth['canUpdate'](),controller[_0x2765('0xa')]);router[_0x2765('0x4')]('/hold',auth['isAuthenticated'](),auth['canUpdate'](),controller['hold']);router['post'](_0x2765('0xb'),auth['isAuthenticated'](),auth[_0x2765('0x7')](),controller[_0x2765('0xc')]);router[_0x2765('0x4')](_0x2765('0xd'),auth[_0x2765('0x5')](),auth['canUpdate'](),controller[_0x2765('0xe')]);router['post'](_0x2765('0xf'),auth['isAuthenticated'](),auth[_0x2765('0x7')](),controller[_0x2765('0x10')]);module[_0x2765('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index de19e97..f97bb78 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 _0x402f=['json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer\x20fired:','userId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','all','filter','catch','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','bluebird','jayson/promise','client','../../config/logger','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','rows','UserId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x402f,0x6f));var _0xf402=function(_0x470721,_0x393598){_0x470721=_0x470721-0x0;var _0x548773=_0x402f[_0x470721];return _0x548773;};'use strict';var path=require(_0xf402('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xf402('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xf402('0x2'));var jayson=require(_0xf402('0x3'));var amiClient=jayson[_0xf402('0x4')]['http']({'port':0x232a});var logger=require(_0xf402('0x5'))('webbarapi');var Redis=require(_0xf402('0x6'));config[_0xf402('0x7')]=_[_0xf402('0x8')](config[_0xf402('0x7')],{'host':_0xf402('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xf402('0xa'));var originateValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],_0xf402('0xc')]},'callNumber':{'type':_0xf402('0xd'),'required':[!![],_0xf402('0xe')]},'callerId':{'type':_0xf402('0xd')},'callbackUrl':{'type':_0xf402('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf402('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf402('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf402('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf402('0xb'),'required':[!![],_0xf402('0xc')]},'sessionId':{'type':_0xf402('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf402('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf402('0xc')]}});function emit(_0x5e38d8,_0x5cc240,_0x545d1a){logger[_0xf402('0xf')](_0x5e38d8,_0x5cc240,JSON[_0xf402('0x10')](_0x545d1a));io['to'](_0x5e38d8)[_0xf402('0x11')](_0x5cc240,_0x545d1a);}function handleError(_0x4629b7){return function(_0x2fbe36){console[_0xf402('0x12')](_0xf402('0x13'),_0x2fbe36,_0x2fbe36 instanceof RangeError);logger[_0xf402('0x14')](_0x2fbe36[_0xf402('0x15')]);if(_0x2fbe36 instanceof RangeError){if(_0x2fbe36[_0xf402('0x16')]){delete _0x2fbe36['name'];}_0x4629b7[_0xf402('0x17')](0x194)[_0xf402('0x18')](_0x2fbe36);}else{if(_0x2fbe36[_0xf402('0x16')]){delete _0x2fbe36[_0xf402('0x16')];}_0x4629b7[_0xf402('0x17')](0x1f4)[_0xf402('0x18')](_0x2fbe36);}};}function checkError(){return function(_0x2d476a){if(!_0x2d476a){throw new RangeError(_0xf402('0x19'));}return _0x2d476a;};}function respondWithRpcPromise(_0x16a05b,_0x499113){return new BPromise(function(_0x3cfe38,_0x4ffe46){var _0x297a68=amiClient;return _0x297a68[_0xf402('0x1a')](_0x16a05b,_0x499113)[_0xf402('0x1b')](function(_0x477709){if(_0x477709[_0xf402('0x14')]){if(_0x477709[_0xf402('0x14')][_0xf402('0x1c')]===0x1f4){return _0x4ffe46(_0x477709[_0xf402('0x14')][_0xf402('0x1d')]);}return _0x3cfe38(_0x477709[_0xf402('0x14')][_0xf402('0x1d')]);}else{_0x3cfe38(_0x477709[_0xf402('0x1e')]);}})['catch'](function(_0x3285bd){_0x4ffe46(_0x3285bd);});});}function getAgent(_0x16c21c){return db[_0xf402('0x1f')][_0xf402('0x20')]({'where':{'id':_0x16c21c,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x3e26d3,_0x3f837e){return new BPromise(function(_0x3a6a8d,_0xb7c8e4){var _0x32f1dc=respondWithRpcPromise('VoiceChannels');var _0x39a38a=getAgent(_0x3e26d3);Promise['all']([_0x32f1dc,_0x39a38a])[_0xf402('0x1b')](function(_0xe3dc2f){var _0x45ead3=_0xe3dc2f[0x0];var _0xb28d88=_0xe3dc2f[0x1];var _0xd82d61=_['filter'](_0x45ead3[_0xf402('0x21')],function(_0x3720c6){return _0x3720c6[_0xf402('0x22')]==_0xb28d88['id']&&_0x3720c6['sessionId']==_0x3f837e;});if(_0xd82d61['length']==0x1){_0x3a6a8d(_0xb28d88);}else{_0xb7c8e4(new RangeError(_0xf402('0x23')+_0x3f837e+_0xf402('0x24')));}});});}exports[_0xf402('0x25')]=function(_0x221d6d,_0x162cce){logger['info'](_0xf402('0x26'),_0x221d6d[_0xf402('0x27')]);var _0x44aa26=originateValidation[_0xf402('0xa')](_0x221d6d[_0xf402('0x27')]);if(_0x44aa26[_0xf402('0x28')]>0x0){return _0x162cce['status'](0x190)[_0xf402('0x29')](_0x44aa26);}var _0x209eae=_0x221d6d[_0xf402('0x27')]['userId'];var _0x5704a2=_0x221d6d[_0xf402('0x27')][_0xf402('0x2a')];var _0x106721=_0x221d6d['body'][_0xf402('0x2b')];var _0x335b34=_0x221d6d[_0xf402('0x27')][_0xf402('0x2c')];return getAgent(_0x209eae)[_0xf402('0x1b')](function(_0x2c4217){logger['info'](_0xf402('0x2d'),_0x2c4217[_0xf402('0x16')]);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0x2c4217[_0xf402('0x16')]),'webbar:originate',{'callNumber':_0x5704a2,'callerId':_0x106721,'callbackUrl':_0x335b34});return _0x162cce[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x30')});})['catch'](handleError(_0x162cce));};exports['hangup']=function(_0x66f414,_0x52e99b){logger[_0xf402('0xf')](_0xf402('0x31'),_0x66f414['body']);var _0x18c3c8=hangupValidation[_0xf402('0xa')](_0x66f414[_0xf402('0x27')]);if(_0x18c3c8[_0xf402('0x28')]>0x0){return _0x52e99b[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x18c3c8);}var _0x141631=_0x66f414[_0xf402('0x27')]['userId'];var _0x4e62b=_0x66f414[_0xf402('0x27')][_0xf402('0x32')];return getAgent(_0x141631)[_0xf402('0x1b')](function(_0x2fb923){logger['info'](_0xf402('0x2d'),_0x2fb923['name']);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0x2fb923[_0xf402('0x16')]),_0xf402('0x33'),{'sessionId':_0x4e62b});return _0x52e99b[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x34')});})['catch'](handleError(_0x52e99b));};exports['answer']=function(_0x352753,_0x22d601){logger[_0xf402('0xf')](_0xf402('0x35'),_0x352753[_0xf402('0x27')]);var _0x1fe222=answerValidation['validate'](_0x352753[_0xf402('0x27')]);if(_0x1fe222[_0xf402('0x28')]>0x0){return _0x22d601[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x1fe222);}var _0x50c439=_0x352753[_0xf402('0x27')][_0xf402('0x36')];var _0x299af2=_0x352753[_0xf402('0x27')][_0xf402('0x32')];return getAgent(_0x50c439)[_0xf402('0x1b')](function(_0x47c1e3){logger[_0xf402('0xf')](_0xf402('0x2d'),_0x47c1e3['name']);emit(util['format'](_0xf402('0x2f'),_0x47c1e3[_0xf402('0x16')]),'webbar:answer',{'sessionId':_0x299af2});return _0x22d601[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x37')});})['catch'](handleError(_0x22d601));};exports[_0xf402('0x38')]=function(_0x48fd97,_0x6bddd8){logger['info'](_0xf402('0x39'),_0x48fd97[_0xf402('0x27')]);var _0x59ae4f=holdValidation['validate'](_0x48fd97[_0xf402('0x27')]);if(_0x59ae4f[_0xf402('0x28')]>0x0){return _0x6bddd8['status'](0x190)['json'](_0x59ae4f);}var _0x213c51=_0x48fd97[_0xf402('0x27')][_0xf402('0x36')];var _0xe53177=_0x48fd97[_0xf402('0x27')][_0xf402('0x32')];return getAgent(_0x213c51)[_0xf402('0x1b')](function(_0xf91b26){logger[_0xf402('0xf')]('entityFound:',_0xf91b26[_0xf402('0x16')]);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0xf91b26['name']),_0xf402('0x3a'),{'sessionId':_0xe53177});return _0x6bddd8[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x3b')});})['catch'](handleError(_0x6bddd8));};exports[_0xf402('0x3c')]=function(_0x411fa3,_0x206601){logger[_0xf402('0xf')](_0xf402('0x3d'),_0x411fa3[_0xf402('0x27')]);var _0x19eb1f=unholdValidation[_0xf402('0xa')](_0x411fa3[_0xf402('0x27')]);if(_0x19eb1f[_0xf402('0x28')]>0x0){return _0x206601[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x19eb1f);}var _0xfa0ef4=_0x411fa3['body']['userId'];var _0x2a304c=_0x411fa3['body']['sessionId'];return getAgent(_0xfa0ef4)['then'](function(_0xb0a9e7){logger[_0xf402('0xf')]('entityFound:',_0xb0a9e7[_0xf402('0x16')]);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0xb0a9e7[_0xf402('0x16')]),_0xf402('0x3e'),{'sessionId':_0x2a304c});return _0x206601[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'error':![],'message':_0xf402('0x3f')});})['catch'](handleError(_0x206601));};exports['calls']=function(_0x3b8dff,_0x14d955){logger['info'](_0xf402('0x40'),_0x14d955[_0xf402('0x27')]);var _0x49b1d6=callsValidation['validate'](_0x3b8dff[_0xf402('0x27')]);if(_0x49b1d6['length']>0x0){return _0x14d955[_0xf402('0x17')](0x190)['json'](_0x49b1d6);}var _0x192d35=_0x3b8dff[_0xf402('0x27')]['userId'];var _0x4a1ca7=respondWithRpcPromise(_0xf402('0x41'));var _0x4159e2=getAgent(_0x192d35);return Promise[_0xf402('0x42')]([_0x4a1ca7,_0x4159e2])[_0xf402('0x1b')](function(_0x3e5de4){var _0x43378c=_0x3e5de4[0x0];var _0x4bb648=_0x3e5de4[0x1];var _0xe0b662=_[_0xf402('0x43')](_0x43378c[_0xf402('0x21')],function(_0x483d47){return _0x483d47[_0xf402('0x22')]==_0x4bb648['id'];});return _0x14d955[_0xf402('0x17')](0xc8)[_0xf402('0x29')]({'count':_0xe0b662['length'],'rows':_0xe0b662});})[_0xf402('0x44')](handleError(_0x14d955));};exports[_0xf402('0x45')]=function(_0x57a27e,_0x16508f){logger[_0xf402('0xf')](_0xf402('0x46'),_0x57a27e[_0xf402('0x27')]);var _0x4b9ab1=conferenceValidation[_0xf402('0xa')](_0x57a27e[_0xf402('0x27')]);if(_0x4b9ab1['length']>0x0){return _0x16508f[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x4b9ab1);}var _0x5bc9b7=_0x57a27e[_0xf402('0x27')]['userId'];return getAgent(_0x5bc9b7)[_0xf402('0x1b')](function(_0x559272){logger[_0xf402('0xf')](_0xf402('0x2d'),_0x559272[_0xf402('0x16')]);emit(util['format'](_0xf402('0x2f'),_0x559272[_0xf402('0x16')]),'webbar:conference');return _0x16508f['status'](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0xf402('0x44')](handleError(_0x16508f));};exports[_0xf402('0x47')]=function(_0x6fb6d2,_0xffbac5){logger['info'](_0xf402('0x48'),_0x6fb6d2[_0xf402('0x27')]);var _0x385a95=transferValidation[_0xf402('0xa')](_0x6fb6d2[_0xf402('0x27')]);if(_0x385a95[_0xf402('0x28')]>0x0){return _0xffbac5[_0xf402('0x17')](0x190)[_0xf402('0x29')](_0x385a95);}var _0x16f1ec=_0x6fb6d2[_0xf402('0x27')][_0xf402('0x36')];var _0x5dc335=_0x6fb6d2[_0xf402('0x27')][_0xf402('0x32')];var _0x387a44=_0x6fb6d2[_0xf402('0x27')][_0xf402('0x49')];return getAgent(_0x16f1ec)[_0xf402('0x1b')](function(_0xfddb50){logger[_0xf402('0xf')](_0xf402('0x2d'),_0xfddb50['name']);emit(util[_0xf402('0x2e')](_0xf402('0x2f'),_0xfddb50[_0xf402('0x16')]),_0xf402('0x4a'),{'sessionId':_0x5dc335,'transferNumber':_0x387a44});return _0xffbac5['status'](0xc8)['json']({'error':![],'message':_0xf402('0x4b')});})['catch'](handleError(_0xffbac5));}; \ No newline at end of file +var _0xcea2=['result','catch','findOne','agent','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','NotFound','then','code','message'];(function(_0xffd0ff,_0x3aacdc){var _0x519c9c=function(_0x147d2a){while(--_0x147d2a){_0xffd0ff['push'](_0xffd0ff['shift']());}};_0x519c9c(++_0x3aacdc);}(_0xcea2,0x15a));var _0x2cea=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xcea2[_0x4b7895];return _0x264180;};'use strict';var path=require(_0x2cea('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x2cea('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x2cea('0x2'));var BPromise=require(_0x2cea('0x3'));var jayson=require(_0x2cea('0x4'));var amiClient=jayson['client'][_0x2cea('0x5')]({'port':0x232a});var logger=require(_0x2cea('0x6'))(_0x2cea('0x7'));var Redis=require('ioredis');config[_0x2cea('0x8')]=_['defaults'](config[_0x2cea('0x8')],{'host':_0x2cea('0x9'),'port':0x18eb});var io=require(_0x2cea('0xa'))(new Redis(config[_0x2cea('0x8')]));var Schema=require(_0x2cea('0xb'));var originateValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2cea('0xd'),'required':[!![],_0x2cea('0xe')]},'callerId':{'type':_0x2cea('0xd')},'callbackUrl':{'type':_0x2cea('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]},'sessionId':{'type':_0x2cea('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2cea('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]},'sessionId':{'type':_0x2cea('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]}});function emit(_0x981e3f,_0x17322c,_0x232dad){logger[_0x2cea('0x10')](_0x981e3f,_0x17322c,JSON[_0x2cea('0x11')](_0x232dad));io['to'](_0x981e3f)[_0x2cea('0x12')](_0x17322c,_0x232dad);}function handleError(_0x5eee09){return function(_0x19927a){console[_0x2cea('0x13')](_0x2cea('0x14'),_0x19927a,_0x19927a instanceof RangeError);logger[_0x2cea('0x15')](_0x19927a[_0x2cea('0x16')]);if(_0x19927a instanceof RangeError){if(_0x19927a[_0x2cea('0x17')]){delete _0x19927a['name'];}_0x5eee09[_0x2cea('0x18')](0x194)['send'](_0x19927a);}else{if(_0x19927a[_0x2cea('0x17')]){delete _0x19927a[_0x2cea('0x17')];}_0x5eee09[_0x2cea('0x18')](0x1f4)['send'](_0x19927a);}};}function checkError(){return function(_0x46a112){if(!_0x46a112){throw new RangeError(_0x2cea('0x19'));}return _0x46a112;};}function respondWithRpcPromise(_0x210d7e,_0x1b389b){return new BPromise(function(_0x3246bc,_0x3f6f0e){var _0x10f13a=amiClient;return _0x10f13a['request'](_0x210d7e,_0x1b389b)[_0x2cea('0x1a')](function(_0x5e5b46){if(_0x5e5b46[_0x2cea('0x15')]){if(_0x5e5b46['error'][_0x2cea('0x1b')]===0x1f4){return _0x3f6f0e(_0x5e5b46[_0x2cea('0x15')]['message']);}return _0x3246bc(_0x5e5b46[_0x2cea('0x15')][_0x2cea('0x1c')]);}else{_0x3246bc(_0x5e5b46[_0x2cea('0x1d')]);}})[_0x2cea('0x1e')](function(_0x3f3ee0){_0x3f6f0e(_0x3f3ee0);});});}function getAgent(_0x79529b){return db['User'][_0x2cea('0x1f')]({'where':{'id':_0x79529b,'role':_0x2cea('0x20')}})[_0x2cea('0x1a')](checkError());}function getAgentCheckSession(_0x32af98,_0x46ef5a){return new BPromise(function(_0x3ea40c,_0xe99cca){var _0x2741cb=respondWithRpcPromise('VoiceChannels');var _0xff69ad=getAgent(_0x32af98);Promise[_0x2cea('0x21')]([_0x2741cb,_0xff69ad])['then'](function(_0xfeb8bd){var _0xc398c5=_0xfeb8bd[0x0];var _0x271b2f=_0xfeb8bd[0x1];var _0x16cf9f=_['filter'](_0xc398c5[_0x2cea('0x22')],function(_0x128934){return _0x128934['UserId']==_0x271b2f['id']&&_0x128934[_0x2cea('0x23')]==_0x46ef5a;});if(_0x16cf9f[_0x2cea('0x24')]==0x1){_0x3ea40c(_0x271b2f);}else{_0xe99cca(new RangeError(_0x2cea('0x25')+_0x46ef5a+_0x2cea('0x26')));}});});}exports[_0x2cea('0x27')]=function(_0x35b37e,_0x10e7c5){logger[_0x2cea('0x10')](_0x2cea('0x28'),_0x35b37e[_0x2cea('0x29')]);var _0x107472=originateValidation['validate'](_0x35b37e[_0x2cea('0x29')]);if(_0x107472[_0x2cea('0x24')]>0x0){return _0x10e7c5[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x107472);}var _0x5a0061=_0x35b37e['body'][_0x2cea('0x2b')];var _0x1451f2=_0x35b37e['body'][_0x2cea('0x2c')];var _0x49d851=_0x35b37e[_0x2cea('0x29')]['callerId'];var _0x510d66=_0x35b37e['body'][_0x2cea('0x2d')];return getAgent(_0x5a0061)[_0x2cea('0x1a')](function(_0x5d254d){logger[_0x2cea('0x10')](_0x2cea('0x2e'),_0x5d254d['name']);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x5d254d[_0x2cea('0x17')]),_0x2cea('0x31'),{'callNumber':_0x1451f2,'callerId':_0x49d851,'callbackUrl':_0x510d66});return _0x10e7c5[_0x2cea('0x18')](0xc8)['json']({'error':![],'message':_0x2cea('0x32')});})[_0x2cea('0x1e')](handleError(_0x10e7c5));};exports['hangup']=function(_0x53c088,_0x1913a2){logger['info']('hangup\x20fired:',_0x53c088['body']);var _0x50f632=hangupValidation[_0x2cea('0xb')](_0x53c088[_0x2cea('0x29')]);if(_0x50f632['length']>0x0){return _0x1913a2[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x50f632);}var _0x249aaa=_0x53c088['body'][_0x2cea('0x2b')];var _0xcc11b6=_0x53c088[_0x2cea('0x29')][_0x2cea('0x23')];return getAgent(_0x249aaa)[_0x2cea('0x1a')](function(_0x2cb62b){logger[_0x2cea('0x10')](_0x2cea('0x2e'),_0x2cb62b[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x2cb62b[_0x2cea('0x17')]),_0x2cea('0x33'),{'sessionId':_0xcc11b6});return _0x1913a2[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x34')});})[_0x2cea('0x1e')](handleError(_0x1913a2));};exports[_0x2cea('0x35')]=function(_0x49fcfa,_0x294057){logger['info'](_0x2cea('0x36'),_0x49fcfa[_0x2cea('0x29')]);var _0x22ce6b=answerValidation[_0x2cea('0xb')](_0x49fcfa[_0x2cea('0x29')]);if(_0x22ce6b[_0x2cea('0x24')]>0x0){return _0x294057[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x22ce6b);}var _0x608740=_0x49fcfa[_0x2cea('0x29')]['userId'];var _0x515494=_0x49fcfa[_0x2cea('0x29')][_0x2cea('0x23')];return getAgent(_0x608740)['then'](function(_0x2d22db){logger['info'](_0x2cea('0x2e'),_0x2d22db['name']);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x2d22db[_0x2cea('0x17')]),_0x2cea('0x37'),{'sessionId':_0x515494});return _0x294057[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x38')});})[_0x2cea('0x1e')](handleError(_0x294057));};exports[_0x2cea('0x39')]=function(_0x1ce60a,_0x5a55ed){logger[_0x2cea('0x10')](_0x2cea('0x3a'),_0x1ce60a[_0x2cea('0x29')]);var _0x348baf=holdValidation['validate'](_0x1ce60a['body']);if(_0x348baf[_0x2cea('0x24')]>0x0){return _0x5a55ed[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x348baf);}var _0x510e0f=_0x1ce60a[_0x2cea('0x29')][_0x2cea('0x2b')];var _0x4223d8=_0x1ce60a[_0x2cea('0x29')]['sessionId'];return getAgent(_0x510e0f)[_0x2cea('0x1a')](function(_0x526e92){logger['info'](_0x2cea('0x2e'),_0x526e92[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x526e92['name']),'webbar:hold',{'sessionId':_0x4223d8});return _0x5a55ed[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x3b')});})[_0x2cea('0x1e')](handleError(_0x5a55ed));};exports['unhold']=function(_0x4ec462,_0x5d7cb6){logger[_0x2cea('0x10')](_0x2cea('0x3c'),_0x4ec462[_0x2cea('0x29')]);var _0x25dc12=unholdValidation[_0x2cea('0xb')](_0x4ec462[_0x2cea('0x29')]);if(_0x25dc12[_0x2cea('0x24')]>0x0){return _0x5d7cb6['status'](0x190)[_0x2cea('0x2a')](_0x25dc12);}var _0x39937e=_0x4ec462[_0x2cea('0x29')]['userId'];var _0x103f18=_0x4ec462['body'][_0x2cea('0x23')];return getAgent(_0x39937e)[_0x2cea('0x1a')](function(_0x21851a){logger[_0x2cea('0x10')](_0x2cea('0x2e'),_0x21851a[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x21851a['name']),_0x2cea('0x3d'),{'sessionId':_0x103f18});return _0x5d7cb6['status'](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x3e')});})[_0x2cea('0x1e')](handleError(_0x5d7cb6));};exports['calls']=function(_0x3b27f4,_0x4c4db6){logger['info'](_0x2cea('0x3f'),_0x4c4db6[_0x2cea('0x29')]);var _0x28e720=callsValidation[_0x2cea('0xb')](_0x3b27f4[_0x2cea('0x29')]);if(_0x28e720['length']>0x0){return _0x4c4db6['status'](0x190)[_0x2cea('0x2a')](_0x28e720);}var _0x160755=_0x3b27f4[_0x2cea('0x29')][_0x2cea('0x2b')];var _0x526269=respondWithRpcPromise(_0x2cea('0x40'));var _0x5ae31b=getAgent(_0x160755);return Promise[_0x2cea('0x21')]([_0x526269,_0x5ae31b])[_0x2cea('0x1a')](function(_0x35d64b){var _0x3f06d1=_0x35d64b[0x0];var _0x221c16=_0x35d64b[0x1];var _0x50adbe=_[_0x2cea('0x41')](_0x3f06d1[_0x2cea('0x22')],function(_0x2c6dd4){return _0x2c6dd4[_0x2cea('0x42')]==_0x221c16['id'];});return _0x4c4db6[_0x2cea('0x18')](0xc8)['json']({'count':_0x50adbe[_0x2cea('0x24')],'rows':_0x50adbe});})[_0x2cea('0x1e')](handleError(_0x4c4db6));};exports['conference']=function(_0x548912,_0x820317){logger[_0x2cea('0x10')](_0x2cea('0x43'),_0x548912['body']);var _0x5806b8=conferenceValidation[_0x2cea('0xb')](_0x548912[_0x2cea('0x29')]);if(_0x5806b8['length']>0x0){return _0x820317[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x5806b8);}var _0x589682=_0x548912[_0x2cea('0x29')][_0x2cea('0x2b')];return getAgent(_0x589682)[_0x2cea('0x1a')](function(_0x42881c){logger[_0x2cea('0x10')]('entityFound:',_0x42881c[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')]('user:%s',_0x42881c[_0x2cea('0x17')]),_0x2cea('0x44'));return _0x820317[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x45')});})[_0x2cea('0x1e')](handleError(_0x820317));};exports[_0x2cea('0x46')]=function(_0xb9ef65,_0x3708c8){logger[_0x2cea('0x10')](_0x2cea('0x47'),_0xb9ef65[_0x2cea('0x29')]);var _0x400459=transferValidation['validate'](_0xb9ef65['body']);if(_0x400459[_0x2cea('0x24')]>0x0){return _0x3708c8[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x400459);}var _0x104051=_0xb9ef65[_0x2cea('0x29')][_0x2cea('0x2b')];var _0x354c42=_0xb9ef65['body']['sessionId'];var _0x1dfeaf=_0xb9ef65[_0x2cea('0x29')][_0x2cea('0x48')];return getAgent(_0x104051)['then'](function(_0x4e00b6){logger['info'](_0x2cea('0x2e'),_0x4e00b6[_0x2cea('0x17')]);emit(util['format']('user:%s',_0x4e00b6[_0x2cea('0x17')]),_0x2cea('0x49'),{'sessionId':_0x354c42,'transferNumber':_0x1dfeaf});return _0x3708c8[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x4a')});})[_0x2cea('0x1e')](handleError(_0x3708c8));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 8d53743..d2d4eeb 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1c00e1,_0x43a1ea){var _0x5a3598=function(_0x386920){while(--_0x386920){_0x1c00e1['push'](_0x1c00e1['shift']());}};_0x5a3598(++_0x43a1ea);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x5c3c[_0x2f1762];return _0x8ab21;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var fs_extra=require(_0xc5c3('0x5'));var auth=require(_0xc5c3('0x6'));var interaction=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var controller=require(_0xc5c3('0x9'));router[_0xc5c3('0xa')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xa')]('/:id',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xe')]);router['get'](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller['getDispositions']);router[_0xc5c3('0xa')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['getAnswers']);router[_0xc5c3('0xa')](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x12')]);router[_0xc5c3('0xa')](_0xc5c3('0x13'),auth['isAuthenticated'](),controller[_0xc5c3('0x14')]);router[_0xc5c3('0x15')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x16')]);router[_0xc5c3('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc5c3('0x17')]);router[_0xc5c3('0x15')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['addAnswer']);router['post'](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x18')]);router[_0xc5c3('0x15')](_0xc5c3('0x13'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x19')]);router['post'](_0xc5c3('0x1a'),controller[_0xc5c3('0x1b')]);router[_0xc5c3('0x15')](_0xc5c3('0x1c'),auth['isAuthenticated'](),controller[_0xc5c3('0x1d')]);router[_0xc5c3('0x1e')](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x20')]);router['delete'](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x21')]);router[_0xc5c3('0x22')](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x23')]);router['delete']('/:id/canned_answers',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x24')]);router['delete']('/:id/users',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x25')]);module[_0xc5c3('0x26')]=router; \ No newline at end of file +var _0x9582=['destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','/:id/notify','/:id/send','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9582,0x95));var _0x2958=function(_0x5e057e,_0x1635d7){_0x5e057e=_0x5e057e-0x0;var _0x5df464=_0x9582[_0x5e057e];return _0x5df464;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0xa')](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x18')]('/',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2958('0x1a')]);router[_0x2958('0x18')]('/:id/canned_answers',auth[_0x2958('0xb')](),controller['addAnswer']);router['post'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller['addAgents']);router['post'](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x18')](_0x2958('0x1c'),controller['notify']);router[_0x2958('0x18')](_0x2958('0x1d'),auth[_0x2958('0xb')](),controller['send']);router[_0x2958('0x1e')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller[_0x2958('0x1f')]);router[_0x2958('0x20')](_0x2958('0x10'),auth[_0x2958('0xb')](),controller[_0x2958('0x21')]);router[_0x2958('0x20')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x22')]);router[_0x2958('0x20')](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f30b56a..9fde1e1 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 _0x2827=['randomstring','exports','STRING','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x263721,_0x13b7e1){var _0x17daff=function(_0x22cfef){while(--_0x22cfef){_0x263721['push'](_0x263721['shift']());}};_0x17daff(++_0x13b7e1);}(_0x2827,0x117));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7282('0x0'));var rs=require(_0x7282('0x1'));module[_0x7282('0x2')]={'name':{'type':Sequelize[_0x7282('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x7282('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7282('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7282('0x3')],'defaultValue':function(){return rs[_0x7282('0x4')]();}},'phone':{'type':Sequelize[_0x7282('0x3')]},'type':{'type':Sequelize['ENUM'](_0x7282('0x5'))},'accountSid':{'type':Sequelize[_0x7282('0x3')]},'authToken':{'type':Sequelize[_0x7282('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7282('0x6')],'defaultValue':function(){return _0x7282('0x7');}},'notificationSound':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7282('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7282('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7282('0x9')],'comment':_0x7282('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x7282('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x206073){if(!_0x206073){this[_0x7282('0xb')](_0x7282('0xc'),null);}this[_0x7282('0xb')](_0x7282('0xd'),_0x206073);}},'description':{'type':Sequelize[_0x7282('0x3')]}}; \ No newline at end of file +var _0x1c3b=['randomstring','exports','STRING','name','generate','ENUM','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize'];(function(_0x54e92d,_0x45aa33){var _0xc7edb6=function(_0x8c5834){while(--_0x8c5834){_0x54e92d['push'](_0x54e92d['shift']());}};_0xc7edb6(++_0x45aa33);}(_0x1c3b,0x77));var _0xb1c3=function(_0xb64c20,_0x419f51){_0xb64c20=_0xb64c20-0x0;var _0x53b1f5=_0x1c3b[_0xb64c20];return _0x53b1f5;};'use strict';var Sequelize=require(_0xb1c3('0x0'));var rs=require(_0xb1c3('0x1'));module[_0xb1c3('0x2')]={'name':{'type':Sequelize[_0xb1c3('0x3')],'unique':_0xb1c3('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb1c3('0x5')]();}},'phone':{'type':Sequelize[_0xb1c3('0x3')]},'type':{'type':Sequelize[_0xb1c3('0x6')](_0xb1c3('0x7'))},'accountSid':{'type':Sequelize[_0xb1c3('0x3')]},'authToken':{'type':Sequelize[_0xb1c3('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb1c3('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb1c3('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb1c3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb1c3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb1c3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb1c3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1c3('0xa')],'comment':_0xb1c3('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xb1c3('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d3269){if(!_0x4d3269){this['setDataValue'](_0xb1c3('0xc'),null);}this[_0xb1c3('0xd')](_0xb1c3('0xe'),_0x4d3269);}},'description':{'type':Sequelize[_0xb1c3('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 32fca8e..d04f608 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 _0x2434=['jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','WhatsappAccount','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','destroy','describe','addDisposition','WhatsappAccountId','Disposition','findOne','length','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','Content-Type','text/xml','send','\x0a','json','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register'];(function(_0x1e33b2,_0x3f2813){var _0x29733d=function(_0x55f8e9){while(--_0x55f8e9){_0x1e33b2['push'](_0x1e33b2['shift']());}};_0x29733d(++_0x3f2813);}(_0x2434,0x15a));var _0x4243=function(_0xd1788c,_0x4830a2){_0xd1788c=_0xd1788c-0x0;var _0x9ce47f=_0x2434[_0xd1788c];return _0x9ce47f;};'use strict';var emlformat=require(_0x4243('0x0'));var rimraf=require(_0x4243('0x1'));var zipdir=require(_0x4243('0x2'));var jsonpatch=require(_0x4243('0x3'));var rp=require('request-promise');var moment=require(_0x4243('0x4'));var BPromise=require(_0x4243('0x5'));var Mustache=require(_0x4243('0x6'));var util=require(_0x4243('0x7'));var path=require(_0x4243('0x8'));var sox=require(_0x4243('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4243('0xa'));var _=require(_0x4243('0xb'));var squel=require(_0x4243('0xc'));var crypto=require(_0x4243('0xd'));var jsforce=require(_0x4243('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4243('0xf'));var querystring=require(_0x4243('0x10'));var Papa=require(_0x4243('0x11'));var Redis=require('ioredis');var authService=require(_0x4243('0x12'));var qs=require(_0x4243('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4243('0x14'));var logger=require(_0x4243('0x15'))(_0x4243('0x16'));var utils=require(_0x4243('0x17'));var config=require(_0x4243('0x18'));var licenseUtil=require(_0x4243('0x19'));var db=require(_0x4243('0x1a'))['db'];config[_0x4243('0x1b')]=_[_0x4243('0x1c')](config[_0x4243('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4243('0x1d'))(new Redis(config[_0x4243('0x1b')]));require(_0x4243('0x1e'))[_0x4243('0x1f')](socket);var jayson=require(_0x4243('0x20'));var client=jayson[_0x4243('0x21')][_0x4243('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x2802bb,_0x49c7d1,_0x197781,_0x4c5639){return new BPromise(function(_0x42dcb6,_0x516f42){var _0x2ad140=_0x4c5639||client;return _0x2ad140[_0x4243('0x23')](_0x2802bb,_0x197781)[_0x4243('0x24')](function(_0xe7827d){logger[_0x4243('0x25')](_0x4243('0x26'),_0x49c7d1,_0x4243('0x27'));logger[_0x4243('0x28')](_0x4243('0x29'),_0x49c7d1,'request\x20sent',JSON[_0x4243('0x2a')](_0xe7827d));if(_0xe7827d[_0x4243('0x2b')]){if(_0xe7827d[_0x4243('0x2b')][_0x4243('0x2c')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x49c7d1,_0xe7827d['error']['message']);return _0x516f42(_0xe7827d[_0x4243('0x2b')][_0x4243('0x2d')]);}logger['error'](_0x4243('0x26'),_0x49c7d1,_0xe7827d[_0x4243('0x2b')][_0x4243('0x2d')]);return _0x42dcb6(_0xe7827d[_0x4243('0x2b')][_0x4243('0x2d')]);}else{logger['info'](_0x4243('0x26'),_0x49c7d1,_0x4243('0x27'));_0x42dcb6(_0xe7827d['result'][_0x4243('0x2d')]);}})[_0x4243('0x2e')](function(_0x3114f0){logger[_0x4243('0x2b')](_0x4243('0x26'),_0x49c7d1,_0x3114f0);_0x516f42(_0x3114f0);});});}function respondWithStatusCode(_0x33745e,_0xfc7426){_0xfc7426=_0xfc7426||0xcc;return function(_0x503bd3){if(_0x503bd3){return _0x33745e[_0x4243('0x2f')](_0xfc7426);}return _0x33745e[_0x4243('0x30')](_0xfc7426)[_0x4243('0x31')]();};}function respondWithResult(_0x260342,_0x18c7bc){_0x18c7bc=_0x18c7bc||0xc8;return function(_0x534e56){if(_0x534e56){return _0x260342[_0x4243('0x30')](_0x18c7bc)['json'](_0x534e56);}};}function respondWithFilteredResult(_0x3809fa,_0x48173b){return function(_0x38f2b2){if(_0x38f2b2){var _0x558465=typeof _0x48173b[_0x4243('0x32')]===_0x4243('0x33')&&typeof _0x48173b[_0x4243('0x34')]==='undefined';var _0x1dbec1=_0x38f2b2[_0x4243('0x35')];var _0x1cd847=_0x558465?0x0:_0x48173b[_0x4243('0x32')];var _0xf4697=_0x558465?_0x38f2b2['count']:_0x48173b[_0x4243('0x32')]+_0x48173b[_0x4243('0x34')];var _0x486bf8;if(_0xf4697>=_0x1dbec1){_0xf4697=_0x1dbec1;_0x486bf8=0xc8;}else{_0x486bf8=0xce;}_0x3809fa[_0x4243('0x30')](_0x486bf8);return _0x3809fa[_0x4243('0x36')](_0x4243('0x37'),_0x1cd847+'-'+_0xf4697+'/'+_0x1dbec1)['json'](_0x38f2b2);}return null;};}function patchUpdates(_0x5f5219){return function(_0x3983c3){try{jsonpatch[_0x4243('0x38')](_0x3983c3,_0x5f5219,!![]);}catch(_0x578c8c){return BPromise[_0x4243('0x39')](_0x578c8c);}return _0x3983c3[_0x4243('0x3a')]();};}function saveUpdates(_0x465dab,_0x442e73){return function(_0x5275be){if(_0x5275be){return _0x5275be[_0x4243('0x3b')](_0x465dab)[_0x4243('0x24')](function(_0x4825c3){return _0x4825c3;});}return null;};}function removeEntity(_0x1b98cc,_0x4fce24){return function(_0x14a1db){if(_0x14a1db){return _0x14a1db['destroy']()[_0x4243('0x24')](function(){var _0x35e51c=_0x14a1db['get']({'plain':!![]});var _0x3e557b=_0x4243('0x3c');return db[_0x4243('0x3d')]['destroy']({'where':{'type':_0x3e557b,'resourceId':_0x35e51c['id']}})[_0x4243('0x24')](function(){return _0x14a1db;});})[_0x4243('0x24')](function(){_0x1b98cc['status'](0xcc)[_0x4243('0x31')]();});}};}function handleEntityNotFound(_0x2cd3e2,_0x5f18c0){return function(_0x26b5f5){if(!_0x26b5f5){_0x2cd3e2[_0x4243('0x2f')](0x194);}return _0x26b5f5;};}function handleError(_0xbdbab1,_0x5207f3){_0x5207f3=_0x5207f3||0x1f4;return function(_0x36cbf9){logger['error'](_0x36cbf9[_0x4243('0x3e')]);if(_0x36cbf9[_0x4243('0x3f')]){delete _0x36cbf9[_0x4243('0x3f')];}_0xbdbab1[_0x4243('0x30')](_0x5207f3)['send'](_0x36cbf9);};}exports[_0x4243('0x40')]=function(_0x46945e,_0x10ba7b){var _0x1a08ed={'include':[{'model':db[_0x4243('0x41')],'as':'mandatoryDispositionPause'}]},_0x4d207e={},_0x254236={'count':0x0,'rows':[]};var _0x2d5762=_['map'](db[_0x4243('0x42')][_0x4243('0x43')],function(_0x887c3e){return{'name':_0x887c3e['fieldName'],'type':_0x887c3e[_0x4243('0x44')]['key']};});_0x4d207e[_0x4243('0x45')]=_[_0x4243('0x46')](_0x2d5762,_0x4243('0x3f'));_0x4d207e['query']=_[_0x4243('0x47')](_0x46945e[_0x4243('0x48')]);_0x4d207e[_0x4243('0x49')]=_[_0x4243('0x4a')](_0x4d207e[_0x4243('0x45')],_0x4d207e['query']);_0x1a08ed[_0x4243('0x4b')]=_[_0x4243('0x4a')](_0x4d207e['model'],qs['fields'](_0x46945e[_0x4243('0x48')][_0x4243('0x4c')]));_0x1a08ed[_0x4243('0x4b')]=_0x1a08ed[_0x4243('0x4b')]['length']?_0x1a08ed[_0x4243('0x4b')]:_0x4d207e[_0x4243('0x45')];if(!_0x46945e[_0x4243('0x48')][_0x4243('0x4d')]('nolimit')){_0x1a08ed[_0x4243('0x34')]=qs[_0x4243('0x34')](_0x46945e['query'][_0x4243('0x34')]);_0x1a08ed[_0x4243('0x32')]=qs[_0x4243('0x32')](_0x46945e[_0x4243('0x48')]['offset']);}_0x1a08ed[_0x4243('0x4e')]=qs[_0x4243('0x4f')](_0x46945e[_0x4243('0x48')]['sort']);_0x1a08ed[_0x4243('0x50')]=qs[_0x4243('0x49')](_['pick'](_0x46945e['query'],_0x4d207e[_0x4243('0x49')]),_0x2d5762);if(_0x46945e[_0x4243('0x48')][_0x4243('0x51')]){_0x1a08ed[_0x4243('0x50')]=_['merge'](_0x1a08ed[_0x4243('0x50')],{'$or':_['map'](_0x2d5762,function(_0x44c6b7){if(_0x44c6b7[_0x4243('0x44')]!==_0x4243('0x52')){var _0x3e6859={};_0x3e6859[_0x44c6b7[_0x4243('0x3f')]]={'$like':'%'+_0x46945e['query'][_0x4243('0x51')]+'%'};return _0x3e6859;}})});}_0x1a08ed=_[_0x4243('0x53')]({},_0x1a08ed,_0x46945e[_0x4243('0x54')]);var _0x544339={'where':_0x1a08ed[_0x4243('0x50')]};return db['WhatsappAccount'][_0x4243('0x35')](_0x544339)['then'](function(_0xfb21f){_0x254236[_0x4243('0x35')]=_0xfb21f;if(_0x46945e[_0x4243('0x48')]['includeAll']){_0x1a08ed[_0x4243('0x55')]=[{'all':!![]}];}return db[_0x4243('0x42')][_0x4243('0x56')](_0x1a08ed);})['then'](function(_0x377806){_0x254236[_0x4243('0x57')]=_0x377806;return _0x254236;})[_0x4243('0x24')](respondWithFilteredResult(_0x10ba7b,_0x1a08ed))[_0x4243('0x2e')](handleError(_0x10ba7b,null));};exports[_0x4243('0x58')]=function(_0x1bd867,_0x1e90e0){var _0x4c23c4={'raw':![],'where':{'id':_0x1bd867[_0x4243('0x59')]['id']},'include':[{'model':db[_0x4243('0x41')],'as':'mandatoryDispositionPause'}]},_0x46ee80={};_0x46ee80[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x42')][_0x4243('0x43')]);_0x46ee80['query']=_[_0x4243('0x47')](_0x1bd867[_0x4243('0x48')]);_0x46ee80[_0x4243('0x49')]=_['intersection'](_0x46ee80[_0x4243('0x45')],_0x46ee80[_0x4243('0x48')]);_0x4c23c4[_0x4243('0x4b')]=_[_0x4243('0x4a')](_0x46ee80[_0x4243('0x45')],qs[_0x4243('0x4c')](_0x1bd867[_0x4243('0x48')][_0x4243('0x4c')]));_0x4c23c4[_0x4243('0x4b')]=_0x4c23c4['attributes']['length']?_0x4c23c4['attributes']:_0x46ee80[_0x4243('0x45')];if(_0x1bd867['query'][_0x4243('0x5a')]){_0x4c23c4['include']=[{'all':!![]}];}_0x4c23c4=_[_0x4243('0x53')]({},_0x4c23c4,_0x1bd867[_0x4243('0x54')]);return db[_0x4243('0x42')][_0x4243('0x5b')](_0x4c23c4)['then'](handleEntityNotFound(_0x1e90e0,null))[_0x4243('0x24')](respondWithResult(_0x1e90e0,null))[_0x4243('0x2e')](handleError(_0x1e90e0,null));};exports[_0x4243('0x5c')]=function(_0xdbdfec,_0x47e838){return db[_0x4243('0x42')]['create'](_0xdbdfec['body'],{})[_0x4243('0x24')](function(_0x442eb3){var _0xb248c7=_0xdbdfec[_0x4243('0x5d')][_0x4243('0x5e')]({'plain':!![]});if(!_0xb248c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb248c7[_0x4243('0x5f')]===_0x4243('0x5d')){var _0x460f28=_0x442eb3[_0x4243('0x5e')]({'plain':!![]});var _0x1b6f3d=_0x4243('0x3c');return db['UserProfileSection'][_0x4243('0x5b')]({'where':{'name':_0x1b6f3d,'userProfileId':_0xb248c7[_0x4243('0x60')]},'raw':!![]})[_0x4243('0x24')](function(_0x3dea33){if(_0x3dea33&&_0x3dea33[_0x4243('0x61')]===0x0){return db[_0x4243('0x3d')][_0x4243('0x5c')]({'name':_0x460f28['name'],'resourceId':_0x460f28['id'],'type':_0x3dea33[_0x4243('0x3f')],'sectionId':_0x3dea33['id']},{})[_0x4243('0x24')](function(){return _0x442eb3;});}else{return _0x442eb3;}})[_0x4243('0x2e')](function(_0x294736){logger[_0x4243('0x2b')](_0x4243('0x62'),_0x294736);throw _0x294736;});}return _0x442eb3;})[_0x4243('0x24')](respondWithResult(_0x47e838,0xc9))['catch'](handleError(_0x47e838,null));};exports[_0x4243('0x3b')]=function(_0x55dd82,_0x9f993b){if(_0x55dd82[_0x4243('0x63')]['id']){delete _0x55dd82[_0x4243('0x63')]['id'];}return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x55dd82[_0x4243('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x4243('0x64')}]})[_0x4243('0x24')](handleEntityNotFound(_0x9f993b,null))[_0x4243('0x24')](saveUpdates(_0x55dd82[_0x4243('0x63')],null))[_0x4243('0x24')](respondWithResult(_0x9f993b,null))[_0x4243('0x2e')](handleError(_0x9f993b,null));};exports[_0x4243('0x65')]=function(_0x262f6f,_0x10334e){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x262f6f[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x10334e,null))[_0x4243('0x24')](removeEntity(_0x10334e,null))[_0x4243('0x2e')](handleError(_0x10334e,null));};exports[_0x4243('0x66')]=function(_0x52ffbe,_0x4db352){return db[_0x4243('0x42')]['describe']()[_0x4243('0x24')](respondWithResult(_0x4db352,null))['catch'](handleError(_0x4db352,null));};exports[_0x4243('0x67')]=function(_0xafaac6,_0x513f9d,_0x1dc70b){if(_0xafaac6['body']['id']){delete _0xafaac6[_0x4243('0x63')]['id'];}return db[_0x4243('0x42')]['find']({'where':{'id':_0xafaac6[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x513f9d,null))[_0x4243('0x24')](function(_0x196d1a){if(_0x196d1a){_0xafaac6['body'][_0x4243('0x68')]=_0x196d1a['id'];return db[_0x4243('0x69')][_0x4243('0x5c')](_0xafaac6[_0x4243('0x63')]);}})[_0x4243('0x24')](respondWithResult(_0x513f9d,null))[_0x4243('0x2e')](handleError(_0x513f9d,null));};exports['getDispositions']=function(_0x20f1b0,_0x3c9462,_0x3f7beb){var _0x5262ac={'raw':![],'where':{}};var _0x4979de={};var _0xd77660={'count':0x0,'rows':[]};return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x20f1b0[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x3c9462,null))[_0x4243('0x24')](function(_0x412165){if(_0x412165){_0x4979de[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x69')]['rawAttributes']);_0x4979de[_0x4243('0x48')]=_['keys'](_0x20f1b0[_0x4243('0x48')]);_0x4979de[_0x4243('0x49')]=_['intersection'](_0x4979de[_0x4243('0x45')],_0x4979de['query']);_0x5262ac[_0x4243('0x4b')]=_[_0x4243('0x4a')](_0x4979de['model'],qs['fields'](_0x20f1b0['query'][_0x4243('0x4c')]));_0x5262ac[_0x4243('0x4b')]=_0x5262ac[_0x4243('0x4b')][_0x4243('0x6b')]?_0x5262ac['attributes']:_0x4979de[_0x4243('0x45')];if(!_0x20f1b0[_0x4243('0x48')]['hasOwnProperty'](_0x4243('0x6c'))){_0x5262ac[_0x4243('0x34')]=qs[_0x4243('0x34')](_0x20f1b0[_0x4243('0x48')]['limit']);_0x5262ac['offset']=qs[_0x4243('0x32')](_0x20f1b0[_0x4243('0x48')]['offset']);}_0x5262ac[_0x4243('0x4e')]=qs[_0x4243('0x4f')](_0x20f1b0[_0x4243('0x48')][_0x4243('0x4f')]);_0x5262ac[_0x4243('0x50')]=qs[_0x4243('0x49')](_[_0x4243('0x6d')](_0x20f1b0[_0x4243('0x48')],_0x4979de[_0x4243('0x49')]));_0x5262ac[_0x4243('0x50')]['WhatsappAccountId']=_0x412165['id'];if(_0x20f1b0[_0x4243('0x48')][_0x4243('0x51')]){_0x5262ac[_0x4243('0x50')]=_[_0x4243('0x53')](_0x5262ac[_0x4243('0x50')],{'$or':_[_0x4243('0x46')](_0x5262ac[_0x4243('0x4b')],function(_0x11abf7){var _0x442d1d={};_0x442d1d[_0x11abf7]={'$like':'%'+_0x20f1b0[_0x4243('0x48')][_0x4243('0x51')]+'%'};return _0x442d1d;})});}_0x5262ac=_[_0x4243('0x53')]({},_0x5262ac,_0x20f1b0[_0x4243('0x54')]);return db[_0x4243('0x69')][_0x4243('0x35')]({'where':_0x5262ac['where']})['then'](function(_0x2536cf){_0xd77660[_0x4243('0x35')]=_0x2536cf;if(_0x20f1b0[_0x4243('0x48')][_0x4243('0x5a')]){_0x5262ac['include']=[{'all':!![]}];}return db[_0x4243('0x69')][_0x4243('0x56')](_0x5262ac);})['then'](function(_0x1597d3){_0xd77660[_0x4243('0x57')]=_0x1597d3;return _0xd77660;});}})[_0x4243('0x24')](respondWithFilteredResult(_0x3c9462,_0x5262ac))['catch'](handleError(_0x3c9462,null));};exports[_0x4243('0x6e')]=function(_0x2ffbc3,_0x55047b,_0x2b451d){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x2ffbc3[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x55047b,null))[_0x4243('0x24')](function(_0x4cc450){if(_0x4cc450){return _0x4cc450[_0x4243('0x6e')](_0x2ffbc3[_0x4243('0x48')][_0x4243('0x6f')]);}})[_0x4243('0x24')](respondWithStatusCode(_0x55047b,null))[_0x4243('0x2e')](handleError(_0x55047b,null));};exports[_0x4243('0x70')]=function(_0x494f7e,_0x5bfdb0,_0x2e301c){if(_0x494f7e[_0x4243('0x63')]['id']){delete _0x494f7e[_0x4243('0x63')]['id'];}return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x494f7e[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x5bfdb0,null))[_0x4243('0x24')](function(_0x4af611){if(_0x4af611){_0x494f7e['body'][_0x4243('0x68')]=_0x4af611['id'];return db[_0x4243('0x71')]['create'](_0x494f7e[_0x4243('0x63')]);}})[_0x4243('0x24')](respondWithResult(_0x5bfdb0,null))[_0x4243('0x2e')](handleError(_0x5bfdb0,null));};exports[_0x4243('0x72')]=function(_0x304fee,_0x59ef3c,_0x357b43){var _0x168f85={'raw':![],'where':{}};var _0x501904={};var _0x80ec7={'count':0x0,'rows':[]};return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x304fee[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x59ef3c,null))[_0x4243('0x24')](function(_0xd72c41){if(_0xd72c41){_0x501904[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x71')][_0x4243('0x43')]);_0x501904[_0x4243('0x48')]=_[_0x4243('0x47')](_0x304fee['query']);_0x501904[_0x4243('0x49')]=_[_0x4243('0x4a')](_0x501904[_0x4243('0x45')],_0x501904[_0x4243('0x48')]);_0x168f85[_0x4243('0x4b')]=_['intersection'](_0x501904[_0x4243('0x45')],qs[_0x4243('0x4c')](_0x304fee[_0x4243('0x48')]['fields']));_0x168f85['attributes']=_0x168f85['attributes'][_0x4243('0x6b')]?_0x168f85[_0x4243('0x4b')]:_0x501904[_0x4243('0x45')];if(!_0x304fee['query']['hasOwnProperty'](_0x4243('0x6c'))){_0x168f85[_0x4243('0x34')]=qs['limit'](_0x304fee[_0x4243('0x48')]['limit']);_0x168f85['offset']=qs['offset'](_0x304fee['query'][_0x4243('0x32')]);}_0x168f85[_0x4243('0x4e')]=qs['sort'](_0x304fee['query']['sort']);_0x168f85[_0x4243('0x50')]=qs[_0x4243('0x49')](_['pick'](_0x304fee['query'],_0x501904[_0x4243('0x49')]));_0x168f85[_0x4243('0x50')][_0x4243('0x68')]=_0xd72c41['id'];if(_0x304fee['query'][_0x4243('0x51')]){_0x168f85[_0x4243('0x50')]=_[_0x4243('0x53')](_0x168f85[_0x4243('0x50')],{'$or':_[_0x4243('0x46')](_0x168f85[_0x4243('0x4b')],function(_0xc15c88){var _0x28c256={};_0x28c256[_0xc15c88]={'$like':'%'+_0x304fee[_0x4243('0x48')]['filter']+'%'};return _0x28c256;})});}_0x168f85=_[_0x4243('0x53')]({},_0x168f85,_0x304fee[_0x4243('0x54')]);return db['CannedAnswer'][_0x4243('0x35')]({'where':_0x168f85[_0x4243('0x50')]})[_0x4243('0x24')](function(_0x3fde94){_0x80ec7[_0x4243('0x35')]=_0x3fde94;if(_0x304fee[_0x4243('0x48')][_0x4243('0x5a')]){_0x168f85[_0x4243('0x55')]=[{'all':!![]}];}return db[_0x4243('0x71')][_0x4243('0x56')](_0x168f85);})['then'](function(_0x41cde9){_0x80ec7[_0x4243('0x57')]=_0x41cde9;return _0x80ec7;});}})[_0x4243('0x24')](respondWithFilteredResult(_0x59ef3c,_0x168f85))['catch'](handleError(_0x59ef3c,null));};exports[_0x4243('0x73')]=function(_0x363573,_0x979a5e,_0x46082c){return db[_0x4243('0x42')]['find']({'where':{'id':_0x363573[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x979a5e,null))[_0x4243('0x24')](function(_0x4b7b9e){if(_0x4b7b9e){return _0x4b7b9e[_0x4243('0x73')](_0x363573[_0x4243('0x48')][_0x4243('0x6f')]);}})[_0x4243('0x24')](respondWithStatusCode(_0x979a5e,null))[_0x4243('0x2e')](handleError(_0x979a5e,null));};exports[_0x4243('0x74')]=function(_0x5529e0,_0x128201,_0xa36043){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x5529e0[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x128201,null))[_0x4243('0x24')](function(_0x2855a4){if(_0x2855a4){return _0x2855a4[_0x4243('0x74')](_0x5529e0[_0x4243('0x63')]['ids'],_[_0x4243('0x75')](_0x5529e0[_0x4243('0x63')],[_0x4243('0x6f'),'id'])||{})[_0x4243('0x76')](function(_0x4956b1){for(var _0x5a8aed=0x0;_0x5a8aed<_0x5529e0[_0x4243('0x63')][_0x4243('0x6f')][_0x4243('0x6b')];_0x5a8aed+=0x1){socket[_0x4243('0x77')](_0x4243('0x78'),{'UserId':Number(_0x5529e0[_0x4243('0x63')]['ids'][_0x5a8aed]),'WhatsappAccountId':Number(_0x5529e0[_0x4243('0x59')]['id'])});}return _0x4956b1;});}})['then'](respondWithResult(_0x128201,null))[_0x4243('0x2e')](handleError(_0x128201,null));};exports['removeAgents']=function(_0x59a087,_0x5eb152,_0x5b126d){return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x59a087[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x5eb152,null))[_0x4243('0x24')](function(_0x569d8d){if(_0x569d8d){return _0x569d8d['removeAgents'](_0x59a087[_0x4243('0x48')][_0x4243('0x6f')])[_0x4243('0x24')](function(){if(_[_0x4243('0x79')](_0x59a087[_0x4243('0x48')][_0x4243('0x6f')])){for(var _0x6ada21=0x0;_0x6ada21<_0x59a087['query'][_0x4243('0x6f')]['length'];_0x6ada21+=0x1){socket['emit'](_0x4243('0x7a'),{'UserId':Number(_0x59a087[_0x4243('0x48')][_0x4243('0x6f')][_0x6ada21]),'WhatsappAccountId':Number(_0x59a087[_0x4243('0x59')]['id'])});}}else{socket[_0x4243('0x77')]('userWhatsappAccount:remove',{'UserId':Number(_0x59a087[_0x4243('0x48')][_0x4243('0x6f')]),'WhatsappAccountId':Number(_0x59a087[_0x4243('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x5eb152,null))[_0x4243('0x2e')](handleError(_0x5eb152,null));};exports[_0x4243('0x7b')]=function(_0x1558fb,_0x3cca3e,_0x30bf3f){var _0x1f82b7={};var _0x1007a5={};var _0x322e45;var _0x51b244;return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x1558fb[_0x4243('0x59')]['id']}})['then'](handleEntityNotFound(_0x3cca3e,null))[_0x4243('0x24')](function(_0x11244c){if(_0x11244c){_0x322e45=_0x11244c;_0x1007a5[_0x4243('0x45')]=_[_0x4243('0x47')](db[_0x4243('0x7c')][_0x4243('0x43')]);_0x1007a5['query']=_[_0x4243('0x47')](_0x1558fb['query']);_0x1007a5[_0x4243('0x49')]=_[_0x4243('0x4a')](_0x1007a5['model'],_0x1007a5[_0x4243('0x48')]);_0x1f82b7[_0x4243('0x4b')]=_['intersection'](_0x1007a5[_0x4243('0x45')],qs[_0x4243('0x4c')](_0x1558fb['query']['fields']));_0x1f82b7['attributes']=_0x1f82b7[_0x4243('0x4b')]['length']?_0x1f82b7['attributes']:_0x1007a5[_0x4243('0x45')];_0x1f82b7[_0x4243('0x4e')]=qs['sort'](_0x1558fb[_0x4243('0x48')]['sort']);_0x1f82b7[_0x4243('0x50')]=qs[_0x4243('0x49')](_[_0x4243('0x6d')](_0x1558fb[_0x4243('0x48')],_0x1007a5[_0x4243('0x49')]));if(_0x1558fb[_0x4243('0x48')][_0x4243('0x51')]){_0x1f82b7[_0x4243('0x50')]=_[_0x4243('0x53')](_0x1f82b7[_0x4243('0x50')],{'$or':_['map'](_0x1f82b7[_0x4243('0x4b')],function(_0x44ea33){var _0x144b06={};_0x144b06[_0x44ea33]={'$like':'%'+_0x1558fb['query'][_0x4243('0x51')]+'%'};return _0x144b06;})});}_0x1f82b7=_['merge']({},_0x1f82b7,_0x1558fb[_0x4243('0x54')]);return _0x322e45[_0x4243('0x7b')](_0x1f82b7);}})[_0x4243('0x24')](function(_0x1e53c2){if(_0x1e53c2){_0x51b244=_0x1e53c2[_0x4243('0x6b')];if(!_0x1558fb[_0x4243('0x48')][_0x4243('0x4d')]('nolimit')){_0x1f82b7[_0x4243('0x34')]=qs[_0x4243('0x34')](_0x1558fb['query'][_0x4243('0x34')]);_0x1f82b7[_0x4243('0x32')]=qs[_0x4243('0x32')](_0x1558fb['query'][_0x4243('0x32')]);}return _0x322e45[_0x4243('0x7b')](_0x1f82b7);}})['then'](function(_0x5831a4){if(_0x5831a4){return _0x5831a4?{'count':_0x51b244,'rows':_0x5831a4}:null;}})[_0x4243('0x24')](respondWithResult(_0x3cca3e,null))['catch'](handleError(_0x3cca3e,null));};exports[_0x4243('0x7d')]=function(_0x55b859,_0x521d5c,_0x449880){return db[_0x4243('0x42')][_0x4243('0x6a')]({'where':{'id':_0x55b859['params']['id']}})['then'](handleEntityNotFound(_0x521d5c,null))[_0x4243('0x24')](function(_0x241a78){if(_0x241a78){return db[_0x4243('0x7e')][_0x4243('0x7f')](function(_0x4ffe6f){return db[_0x4243('0x80')][_0x4243('0x65')]({'where':{'WhatsappAccountId':_0x55b859[_0x4243('0x59')]['id']},'transaction':_0x4ffe6f})[_0x4243('0x24')](function(_0x56a7df){var _0x18ff1e=_[_0x4243('0x46')](_0x55b859[_0x4243('0x63')],function(_0x4c74a7){_0x4c74a7[_0x4243('0x68')]=_0x55b859[_0x4243('0x59')]['id'];return _0x4c74a7;});return db[_0x4243('0x80')]['bulkCreate'](_0x18ff1e,{'transaction':_0x4ffe6f});});})[_0x4243('0x24')](function(){return db[_0x4243('0x80')][_0x4243('0x81')]({'where':{'WhatsappAccountId':_0x55b859[_0x4243('0x59')]['id']},'order':_0x4243('0x82')});});}})[_0x4243('0x24')](respondWithResult(_0x521d5c,null))['catch'](handleError(_0x521d5c,null));};exports['getApplications']=function(_0xa30de5,_0x4653b8,_0x487942){var _0x1db79d={};var _0x579c8f={};var _0x3f4aa6;var _0x24c427;return db['WhatsappAccount'][_0x4243('0x6a')]({'where':{'id':_0xa30de5[_0x4243('0x59')]['id']}})[_0x4243('0x24')](handleEntityNotFound(_0x4653b8,null))[_0x4243('0x24')](function(_0x4699d6){if(_0x4699d6){_0x3f4aa6=_0x4699d6;_0x579c8f['model']=_[_0x4243('0x47')](db[_0x4243('0x80')][_0x4243('0x43')]);_0x579c8f['query']=_[_0x4243('0x47')](_0xa30de5[_0x4243('0x48')]);_0x579c8f['filters']=_[_0x4243('0x4a')](_0x579c8f[_0x4243('0x45')],_0x579c8f[_0x4243('0x48')]);_0x1db79d[_0x4243('0x4b')]=_['intersection'](_0x579c8f[_0x4243('0x45')],qs[_0x4243('0x4c')](_0xa30de5[_0x4243('0x48')][_0x4243('0x4c')]));_0x1db79d[_0x4243('0x4b')]=_0x1db79d['attributes']['length']?_0x1db79d[_0x4243('0x4b')]:_0x579c8f[_0x4243('0x45')];_0x1db79d[_0x4243('0x4e')]=qs[_0x4243('0x4f')](_0xa30de5[_0x4243('0x48')][_0x4243('0x4f')]);_0x1db79d[_0x4243('0x50')]=qs['filters'](_[_0x4243('0x6d')](_0xa30de5[_0x4243('0x48')],_0x579c8f['filters']));if(_0xa30de5[_0x4243('0x48')]['filter']){_0x1db79d[_0x4243('0x50')]=_[_0x4243('0x53')](_0x1db79d['where'],{'$or':_['map'](_0x1db79d[_0x4243('0x4b')],function(_0x5d41bc){var _0x37473b={};_0x37473b[_0x5d41bc]={'$like':'%'+_0xa30de5['query'][_0x4243('0x51')]+'%'};return _0x37473b;})});}_0x1db79d=_[_0x4243('0x53')]({},_0x1db79d,_0xa30de5['options']);return _0x3f4aa6[_0x4243('0x83')](_0x1db79d);}})['then'](function(_0x22ade4){if(_0x22ade4){_0x24c427=_0x22ade4[_0x4243('0x6b')];if(!_0xa30de5[_0x4243('0x48')][_0x4243('0x4d')](_0x4243('0x6c'))){_0x1db79d['limit']=qs[_0x4243('0x34')](_0xa30de5['query'][_0x4243('0x34')]);_0x1db79d['offset']=qs[_0x4243('0x32')](_0xa30de5['query'][_0x4243('0x32')]);}return _0x3f4aa6[_0x4243('0x83')](_0x1db79d);}})[_0x4243('0x24')](function(_0x21489c){if(_0x21489c){return _0x21489c?{'count':_0x24c427,'rows':_0x21489c}:null;}})['then'](respondWithResult(_0x4653b8,null))['catch'](handleError(_0x4653b8,null));};exports[_0x4243('0x84')]=function(_0x13a5cb,_0x56f929,_0x198a3d){var _0x2cbf26={'channel':'whatsapp'};var _0x263d71=[];var _0x2e078c=[];var _0x112178={};return db[_0x4243('0x42')]['find']({'where':{'id':_0x13a5cb[_0x4243('0x59')]['id']},'include':[{'model':db[_0x4243('0x80')],'as':_0x4243('0x85')}]})[_0x4243('0x24')](handleEntityNotFound(_0x56f929,null))[_0x4243('0x24')](function(_0x481da2){_0x2cbf26['account']=_0x481da2;_0x2cbf26['applications']=_['orderBy'](_0x481da2[_0x4243('0x85')],[_0x4243('0x82')],['asc']);if(_0x2cbf26[_0x4243('0x86')][_0x4243('0x85')]){delete _0x2cbf26[_0x4243('0x86')][_0x4243('0x85')];}return db[_0x4243('0x87')][_0x4243('0x66')]();})[_0x4243('0x24')](function(_0x5bc391){if(!_0x5bc391){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x8a'));}_0x263d71=_[_0x4243('0x8b')](_[_0x4243('0x47')](_0x5bc391),['createdAt',_0x4243('0x8c')]);_0x2e078c=_[_0x4243('0x8b')](_[_0x4243('0x47')](_0x5bc391),[_0x4243('0x8d'),'updatedAt','CompanyId',_0x4243('0x8e')]);_0x2cbf26[_0x4243('0x63')]={'mapKey':_0x4243('0x8f')};if(_0x2cbf26[_0x4243('0x86')][_0x4243('0x44')]&&_0x2cbf26[_0x4243('0x86')]['type']===_0x4243('0x90')){_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')]=_0x13a5cb[_0x4243('0x63')][_0x4243('0x92')][_0x4243('0x93')](_0x4243('0x94'),'');_0x2cbf26[_0x4243('0x63')]['body']=_0x13a5cb[_0x4243('0x63')][_0x4243('0x95')];_0x2cbf26['body'][_0x4243('0x96')]=_0x13a5cb[_0x4243('0x63')][_0x4243('0x97')];}if(_0x2cbf26[_0x4243('0x63')]['id']){delete _0x2cbf26[_0x4243('0x63')]['id'];}if(_[_0x4243('0x98')](_0x2cbf26['body']['from'])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x99'));}if(_[_0x4243('0x98')](_0x2cbf26[_0x4243('0x63')][_0x4243('0x63')])||_0x2cbf26[_0x4243('0x63')][_0x4243('0x63')]===''){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2cbf26['body']['mapKey'])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x9a')+_0x2e078c);}if(!_[_0x4243('0x9b')](_0x2e078c,_0x2cbf26[_0x4243('0x63')][_0x4243('0x9c')])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))](_0x4243('0x9d')+_0x2e078c);}_0x112178[_0x2cbf26[_0x4243('0x63')]['mapKey']]=_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')];return db['CmList']['find']({'where':{'id':_0x2cbf26[_0x4243('0x86')][_0x4243('0x8e')]},'include':[{'model':db['CmContact'],'as':_0x4243('0x9e'),'where':_0x112178,'limit':0x1,'order':[[_0x4243('0x8c'),_0x4243('0x9f')]]}]});})['then'](handleEntityNotFound(_0x56f929,null))[_0x4243('0x24')](function(_0x17c327){if(_0x17c327){_0x2cbf26[_0x4243('0xa0')]=_[_0x4243('0x75')](_0x17c327,[_0x4243('0x9e')]);if(_0x17c327['Contacts'][_0x4243('0x6b')]){return _0x17c327['Contacts'][0x0];}var _0x415e2c=_['defaults'](_0x2cbf26[_0x4243('0x63')],{'firstName':_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')],'ListId':_0x17c327['id']});_0x415e2c[_0x2cbf26['body'][_0x4243('0x9c')]]=_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')];return db[_0x4243('0x87')][_0x4243('0x5c')](_0x415e2c,{'fields':_0x263d71,'raw':!![]});}})[_0x4243('0x24')](handleEntityNotFound(_0x56f929,null))[_0x4243('0x24')](function(_0x381454){if(_0x381454){_0x2cbf26['contact']=_0x381454;var _0x24be15={'ContactId':_0x381454['id'],'phone':_0x2cbf26[_0x4243('0x63')]['from'],'WhatsappAccountId':_0x13a5cb[_0x4243('0x59')]['id']};var _0x344fe8={'ContactId':_0x381454['id'],'WhatsappAccountId':_0x13a5cb['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x344fe8})[_0x4243('0x24')](function(_0x113067){if(_0x113067){return[_0x113067,![]];}return db[_0x4243('0xa1')][_0x4243('0x5c')](_0x24be15)[_0x4243('0x24')](function(_0x17022c){return[_0x17022c,!![]];});});}})[_0x4243('0x76')](function(_0x535e0b,_0x459878){_0x2cbf26[_0x4243('0xa2')]=_0x535e0b[_0x4243('0x5e')]({'plain':!![]});_0x2cbf26[_0x4243('0xa2')][_0x4243('0xa3')]=![];if(_0x459878){if(_0x2cbf26[_0x4243('0x86')][_0x4243('0xa4')]){_0x2cbf26[_0x4243('0xa5')][_0x4243('0xa6')]({'id':0x0,'priority':_0x2cbf26[_0x4243('0xa5')][_0x4243('0x6b')]+0x1,'app':_0x4243('0xa7'),'appdata':_0x4243('0xa8'),'interval':'*,*,*,*'});}_0x2cbf26[_0x4243('0xa2')][_0x4243('0xa3')]=!![];}return db[_0x4243('0xa9')][_0x4243('0x5c')]({'phone':_0x2cbf26[_0x4243('0x63')][_0x4243('0x91')],'messageId':_0x2cbf26[_0x4243('0x63')][_0x4243('0x96')],'body':_0x2cbf26['body'][_0x4243('0x63')],'WhatsappAccountId':_0x13a5cb[_0x4243('0x59')]['id'],'WhatsappInteractionId':_0x535e0b['id'],'direction':'in','ContactId':_0x535e0b[_0x4243('0xaa')],'AttachmentId':_0x2cbf26['body'][_0x4243('0xab')]});})[_0x4243('0x24')](function(_0x46cd48){_0x2cbf26[_0x4243('0x2d')]=_0x46cd48;if(_0x2cbf26[_0x4243('0xa2')][_0x4243('0xac')]){return db[_0x4243('0x7c')][_0x4243('0x5b')]({'attributes':['id',_0x4243('0x3f')],'where':{'id':_0x2cbf26[_0x4243('0xa2')][_0x4243('0xac')]}})[_0x4243('0x24')](function(_0x569c4f){if(_0x569c4f){_0x2cbf26[_0x4243('0xa5')][_0x4243('0xad')]({'id':0x0,'priority':0x0,'app':_0x4243('0xae'),'appdata':_0x569c4f[_0x4243('0x3f')]+','+(_0x2cbf26[_0x4243('0x86')][_0x4243('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4243('0xb0'),'startRouting',_0x2cbf26);});}return respondWithRpcPromise('Start',_0x4243('0xb1'),_0x2cbf26);})[_0x4243('0x24')](function(_0x356839){if(_0x356839){var _0x30f34b=0xc8;var _0x44b01b='receiveMessage';logger[_0x4243('0x25')](_0x4243('0x29'),_0x44b01b,_0x30f34b,_0x4243('0xb2'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x44b01b,_0x30f34b,_0x4243('0xb2'),JSON['stringify'](_0x356839));if(_0x2cbf26[_0x4243('0x86')][_0x4243('0x44')]===_0x4243('0x90')){return _0x56f929[_0x4243('0x30')](_0x30f34b)['set'](_0x4243('0xb3'),_0x4243('0xb4'))[_0x4243('0xb5')](_0x4243('0xb6'));}else{return _0x56f929[_0x4243('0x30')](_0x30f34b)[_0x4243('0xb7')](_0x356839);}}})[_0x4243('0x2e')](handleError(_0x56f929,null));};exports[_0x4243('0xb5')]=function(_0x2cb65b,_0x20e6e1,_0x502d33){var _0x2a4db6,_0x215b2d,_0xb7d720;if(_[_0x4243('0x98')](_0x2cb65b['body'][_0x4243('0x63')])||_0x2cb65b['body'][_0x4243('0x63')]===''){throw new db['Sequelize'][(_0x4243('0x89'))](_0x4243('0xb8'));}if(_[_0x4243('0x98')](_0x2cb65b[_0x4243('0x63')]['to'])){throw new db[(_0x4243('0x88'))][(_0x4243('0x89'))]('to\x20is\x20mandatory');}_0x2a4db6=_0x2cb65b[_0x4243('0x63')]['to'];return db[_0x4243('0x42')][_0x4243('0x5b')]({'where':{'id':_0x2cb65b['params']['id']},'include':[{'model':db[_0x4243('0xb9')],'as':_0x4243('0xba'),'include':[{'model':db[_0x4243('0x87')],'as':_0x4243('0x9e'),'where':{'mobile':_0x2a4db6},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x4243('0x24')](handleEntityNotFound(_0x20e6e1,null))[_0x4243('0x24')](function(_0x4b2291){if(_0x4b2291&&_0x4b2291['List']){_0x215b2d=_0x4b2291['get']({'plain':!![]});if(_0x215b2d['List']&&_0x215b2d['List'][_0x4243('0x9e')][_0x4243('0x6b')]){return _0x215b2d['List'][_0x4243('0x9e')][0x0];}return db[_0x4243('0x87')]['create'](_['defaults'](_0x2cb65b[_0x4243('0x63')],{'firstName':_0x2a4db6,'mobile':_0x2a4db6,'phone':_0x2a4db6,'ListId':_0x215b2d[_0x4243('0x8e')]}));}})['then'](handleEntityNotFound(_0x20e6e1,null))[_0x4243('0x24')](function(_0x2a72e9){if(_0x2a72e9){_0xb7d720=_0x2a72e9;return db[_0x4243('0xa1')][_0x4243('0x5b')]({'where':{'ContactId':_0xb7d720['id'],'closed':![],'WhatsappAccountId':_0x215b2d['id']}})[_0x4243('0x24')](function(_0xde3eca){if(_0xde3eca){return[_0xde3eca,![]];}return db[_0x4243('0xa1')][_0x4243('0x5c')]({'UserId':_0x2cb65b['user']['id'],'ContactId':_0xb7d720['id'],'WhatsappAccountId':_0x215b2d['id'],'phone':_0x2a4db6,'firstMsgDirection':'out','Messages':[_['merge'](_0x2cb65b[_0x4243('0x63')],{'read':![],'body':_0x2cb65b[_0x4243('0x63')][_0x4243('0x63')],'phone':_0x2a4db6,'WhatsappAccountId':_0x215b2d['id'],'UserId':_0x2cb65b['user']['id'],'ContactId':_0xb7d720['id']})]},{'include':[{'model':db[_0x4243('0xa9')],'as':_0x4243('0xbb')}]})[_0x4243('0x24')](function(_0x5ed783){return[_0x5ed783,!![]];});});}})['spread'](function(_0x5d4cd2,_0x4f2c2c){if(_0x4f2c2c){return _0x5d4cd2;}return db[_0x4243('0xa9')][_0x4243('0x5c')](_[_0x4243('0x53')](_0x2cb65b[_0x4243('0x63')],{'read':![],'body':_0x2cb65b['body'][_0x4243('0x63')],'phone':_0x2a4db6,'WhatsappAccountId':_0x215b2d['id'],'WhatsappInteractionId':_0x5d4cd2['id'],'UserId':_0x2cb65b[_0x4243('0x5d')]['id'],'ContactId':_0xb7d720['id']}))[_0x4243('0x24')](function(_0x5e6d18){_0x5d4cd2['dataValues'][_0x4243('0xbb')]=[];_0x5d4cd2[_0x4243('0xbc')]['Messages'][_0x4243('0xa6')](_0x5e6d18[_0x4243('0xbc')]);return _0x5d4cd2;});})['then'](respondWithResult(_0x20e6e1,null))[_0x4243('0x2e')](handleError(_0x20e6e1,null));}; \ No newline at end of file +var _0x28a6=['stringify','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','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','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','WhatsappAccounts','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','Pause','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','describe','addDisposition','WhatsappAccountId','Disposition','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','whatsapp','account','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','ValidationError','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','updatedAt','DESC','list','contact','WhatsappInteraction','interaction','autoclose','unmanaged','*,*,*,*','created','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found'];(function(_0x36f1cd,_0xea4aec){var _0x707c40=function(_0xbe075c){while(--_0xbe075c){_0x36f1cd['push'](_0x36f1cd['shift']());}};_0x707c40(++_0xea4aec);}(_0x28a6,0xc8));var _0x628a=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x28a6[_0x356127];return _0x5d4c75;};'use strict';var emlformat=require(_0x628a('0x0'));var rimraf=require(_0x628a('0x1'));var zipdir=require(_0x628a('0x2'));var jsonpatch=require(_0x628a('0x3'));var rp=require('request-promise');var moment=require(_0x628a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x628a('0x5'));var util=require(_0x628a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x628a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x628a('0x8'));var squel=require(_0x628a('0x9'));var crypto=require(_0x628a('0xa'));var jsforce=require(_0x628a('0xb'));var deskjs=require(_0x628a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x628a('0xd'));var Papa=require(_0x628a('0xe'));var Redis=require('ioredis');var authService=require(_0x628a('0xf'));var qs=require(_0x628a('0x10'));var as=require(_0x628a('0x11'));var hardwareService=require(_0x628a('0x12'));var logger=require(_0x628a('0x13'))('api');var utils=require(_0x628a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x628a('0x15'));var db=require(_0x628a('0x16'))['db'];config['redis']=_[_0x628a('0x17')](config[_0x628a('0x18')],{'host':_0x628a('0x19'),'port':0x18eb});var socket=require(_0x628a('0x1a'))(new Redis(config[_0x628a('0x18')]));require(_0x628a('0x1b'))['register'](socket);var jayson=require(_0x628a('0x1c'));var client=jayson['client'][_0x628a('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x4e124a,_0x165424,_0x179484,_0x2e3db3){return new BPromise(function(_0x51e729,_0x295be5){var _0x1d1260=_0x2e3db3||client;return _0x1d1260[_0x628a('0x1e')](_0x4e124a,_0x179484)['then'](function(_0x2ade59){logger[_0x628a('0x1f')](_0x628a('0x20'),_0x165424,'request\x20sent');logger[_0x628a('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x165424,'request\x20sent',JSON['stringify'](_0x2ade59));if(_0x2ade59[_0x628a('0x22')]){if(_0x2ade59[_0x628a('0x22')][_0x628a('0x23')]===0x1f4){logger[_0x628a('0x22')](_0x628a('0x20'),_0x165424,_0x2ade59[_0x628a('0x22')][_0x628a('0x24')]);return _0x295be5(_0x2ade59['error'][_0x628a('0x24')]);}logger['error'](_0x628a('0x20'),_0x165424,_0x2ade59[_0x628a('0x22')][_0x628a('0x24')]);return _0x51e729(_0x2ade59[_0x628a('0x22')][_0x628a('0x24')]);}else{logger['info'](_0x628a('0x20'),_0x165424,_0x628a('0x25'));_0x51e729(_0x2ade59['result'][_0x628a('0x24')]);}})[_0x628a('0x26')](function(_0x511c72){logger[_0x628a('0x22')](_0x628a('0x20'),_0x165424,_0x511c72);_0x295be5(_0x511c72);});});}function respondWithStatusCode(_0xbe9cd6,_0x22cfd9){_0x22cfd9=_0x22cfd9||0xcc;return function(_0x234de8){if(_0x234de8){return _0xbe9cd6[_0x628a('0x27')](_0x22cfd9);}return _0xbe9cd6[_0x628a('0x28')](_0x22cfd9)['end']();};}function respondWithResult(_0x1db8f4,_0x53abcb){_0x53abcb=_0x53abcb||0xc8;return function(_0x372485){if(_0x372485){return _0x1db8f4[_0x628a('0x28')](_0x53abcb)[_0x628a('0x29')](_0x372485);}};}function respondWithFilteredResult(_0x51ca65,_0x2e2119){return function(_0x366362){if(_0x366362){var _0x3e8ffe=typeof _0x2e2119['offset']===_0x628a('0x2a')&&typeof _0x2e2119[_0x628a('0x2b')]===_0x628a('0x2a');var _0x4ef424=_0x366362[_0x628a('0x2c')];var _0x51e17c=_0x3e8ffe?0x0:_0x2e2119[_0x628a('0x2d')];var _0x4c0394=_0x3e8ffe?_0x366362['count']:_0x2e2119[_0x628a('0x2d')]+_0x2e2119[_0x628a('0x2b')];var _0x17c3ae;if(_0x4c0394>=_0x4ef424){_0x4c0394=_0x4ef424;_0x17c3ae=0xc8;}else{_0x17c3ae=0xce;}_0x51ca65['status'](_0x17c3ae);return _0x51ca65[_0x628a('0x2e')](_0x628a('0x2f'),_0x51e17c+'-'+_0x4c0394+'/'+_0x4ef424)['json'](_0x366362);}return null;};}function patchUpdates(_0x16f215){return function(_0x1b0e85){try{jsonpatch[_0x628a('0x30')](_0x1b0e85,_0x16f215,!![]);}catch(_0x84807c){return BPromise[_0x628a('0x31')](_0x84807c);}return _0x1b0e85[_0x628a('0x32')]();};}function saveUpdates(_0x3b0929,_0x5eb6a7){return function(_0x344860){if(_0x344860){return _0x344860[_0x628a('0x33')](_0x3b0929)['then'](function(_0x21e0c2){return _0x21e0c2;});}return null;};}function removeEntity(_0x746be5,_0x46dc91){return function(_0x4facaa){if(_0x4facaa){return _0x4facaa[_0x628a('0x34')]()[_0x628a('0x35')](function(){var _0x2030bc=_0x4facaa[_0x628a('0x36')]({'plain':!![]});var _0x459074=_0x628a('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x459074,'resourceId':_0x2030bc['id']}})['then'](function(){return _0x4facaa;});})['then'](function(){_0x746be5[_0x628a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d325a,_0x12f320){return function(_0x2272fa){if(!_0x2272fa){_0x5d325a[_0x628a('0x27')](0x194);}return _0x2272fa;};}function handleError(_0x4ee15f,_0x278383){_0x278383=_0x278383||0x1f4;return function(_0x559cd5){logger['error'](_0x559cd5['stack']);if(_0x559cd5[_0x628a('0x38')]){delete _0x559cd5[_0x628a('0x38')];}_0x4ee15f[_0x628a('0x28')](_0x278383)[_0x628a('0x39')](_0x559cd5);};}exports[_0x628a('0x3a')]=function(_0x584665,_0x18cdac){var _0x4d0b47={'include':[{'model':db['Pause'],'as':_0x628a('0x3b')}]},_0x5718d9={},_0x1db8ad={'count':0x0,'rows':[]};var _0x83e7d8=_[_0x628a('0x3c')](db[_0x628a('0x3d')][_0x628a('0x3e')],function(_0x2ffed5){return{'name':_0x2ffed5[_0x628a('0x3f')],'type':_0x2ffed5[_0x628a('0x40')][_0x628a('0x41')]};});_0x5718d9[_0x628a('0x42')]=_[_0x628a('0x3c')](_0x83e7d8,'name');_0x5718d9[_0x628a('0x43')]=_[_0x628a('0x44')](_0x584665[_0x628a('0x43')]);_0x5718d9[_0x628a('0x45')]=_[_0x628a('0x46')](_0x5718d9[_0x628a('0x42')],_0x5718d9['query']);_0x4d0b47[_0x628a('0x47')]=_['intersection'](_0x5718d9[_0x628a('0x42')],qs[_0x628a('0x48')](_0x584665[_0x628a('0x43')][_0x628a('0x48')]));_0x4d0b47[_0x628a('0x47')]=_0x4d0b47['attributes'][_0x628a('0x49')]?_0x4d0b47['attributes']:_0x5718d9[_0x628a('0x42')];if(!_0x584665[_0x628a('0x43')][_0x628a('0x4a')]('nolimit')){_0x4d0b47[_0x628a('0x2b')]=qs[_0x628a('0x2b')](_0x584665['query'][_0x628a('0x2b')]);_0x4d0b47[_0x628a('0x2d')]=qs['offset'](_0x584665[_0x628a('0x43')][_0x628a('0x2d')]);}_0x4d0b47[_0x628a('0x4b')]=qs[_0x628a('0x4c')](_0x584665[_0x628a('0x43')]['sort']);_0x4d0b47['where']=qs[_0x628a('0x45')](_[_0x628a('0x4d')](_0x584665[_0x628a('0x43')],_0x5718d9[_0x628a('0x45')]),_0x83e7d8);if(_0x584665[_0x628a('0x43')][_0x628a('0x4e')]){_0x4d0b47[_0x628a('0x4f')]=_[_0x628a('0x50')](_0x4d0b47[_0x628a('0x4f')],{'$or':_[_0x628a('0x3c')](_0x83e7d8,function(_0x42b584){if(_0x42b584[_0x628a('0x40')]!==_0x628a('0x51')){var _0xd3c055={};_0xd3c055[_0x42b584[_0x628a('0x38')]]={'$like':'%'+_0x584665[_0x628a('0x43')]['filter']+'%'};return _0xd3c055;}})});}_0x4d0b47=_[_0x628a('0x50')]({},_0x4d0b47,_0x584665['options']);var _0x3e7a58={'where':_0x4d0b47['where']};return db[_0x628a('0x3d')][_0x628a('0x2c')](_0x3e7a58)[_0x628a('0x35')](function(_0xfaf4c0){_0x1db8ad[_0x628a('0x2c')]=_0xfaf4c0;if(_0x584665['query']['includeAll']){_0x4d0b47[_0x628a('0x52')]=[{'all':!![]}];}return db[_0x628a('0x3d')][_0x628a('0x53')](_0x4d0b47);})['then'](function(_0x81a4f8){_0x1db8ad[_0x628a('0x54')]=_0x81a4f8;return _0x1db8ad;})['then'](respondWithFilteredResult(_0x18cdac,_0x4d0b47))['catch'](handleError(_0x18cdac,null));};exports[_0x628a('0x55')]=function(_0x43943d,_0x59a1ea){var _0x4be7be={'raw':![],'where':{'id':_0x43943d[_0x628a('0x56')]['id']},'include':[{'model':db[_0x628a('0x57')],'as':_0x628a('0x3b')}]},_0x20aa29={};_0x20aa29[_0x628a('0x42')]=_[_0x628a('0x44')](db[_0x628a('0x3d')][_0x628a('0x3e')]);_0x20aa29[_0x628a('0x43')]=_[_0x628a('0x44')](_0x43943d[_0x628a('0x43')]);_0x20aa29[_0x628a('0x45')]=_[_0x628a('0x46')](_0x20aa29[_0x628a('0x42')],_0x20aa29[_0x628a('0x43')]);_0x4be7be[_0x628a('0x47')]=_[_0x628a('0x46')](_0x20aa29[_0x628a('0x42')],qs['fields'](_0x43943d['query'][_0x628a('0x48')]));_0x4be7be[_0x628a('0x47')]=_0x4be7be['attributes'][_0x628a('0x49')]?_0x4be7be[_0x628a('0x47')]:_0x20aa29['model'];if(_0x43943d[_0x628a('0x43')][_0x628a('0x58')]){_0x4be7be[_0x628a('0x52')]=[{'all':!![]}];}_0x4be7be=_[_0x628a('0x50')]({},_0x4be7be,_0x43943d[_0x628a('0x59')]);return db[_0x628a('0x3d')][_0x628a('0x5a')](_0x4be7be)['then'](handleEntityNotFound(_0x59a1ea,null))[_0x628a('0x35')](respondWithResult(_0x59a1ea,null))[_0x628a('0x26')](handleError(_0x59a1ea,null));};exports['create']=function(_0x212e95,_0x1873e0){return db['WhatsappAccount'][_0x628a('0x5b')](_0x212e95[_0x628a('0x5c')],{})[_0x628a('0x35')](function(_0x485555){var _0x4c7b4d=_0x212e95[_0x628a('0x5d')]['get']({'plain':!![]});if(!_0x4c7b4d)throw new Error(_0x628a('0x5e'));if(_0x4c7b4d[_0x628a('0x5f')]==='user'){var _0x17a47e=_0x485555[_0x628a('0x36')]({'plain':!![]});var _0x277731=_0x628a('0x37');return db[_0x628a('0x60')][_0x628a('0x5a')]({'where':{'name':_0x277731,'userProfileId':_0x4c7b4d[_0x628a('0x61')]},'raw':!![]})[_0x628a('0x35')](function(_0x165b99){if(_0x165b99&&_0x165b99['autoAssociation']===0x0){return db[_0x628a('0x62')][_0x628a('0x5b')]({'name':_0x17a47e[_0x628a('0x38')],'resourceId':_0x17a47e['id'],'type':_0x165b99['name'],'sectionId':_0x165b99['id']},{})[_0x628a('0x35')](function(){return _0x485555;});}else{return _0x485555;}})[_0x628a('0x26')](function(_0x276a28){logger[_0x628a('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x276a28);throw _0x276a28;});}return _0x485555;})[_0x628a('0x35')](respondWithResult(_0x1873e0,0xc9))[_0x628a('0x26')](handleError(_0x1873e0,null));};exports[_0x628a('0x33')]=function(_0x47d39a,_0x38abe5){if(_0x47d39a['body']['id']){delete _0x47d39a[_0x628a('0x5c')]['id'];}return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x47d39a[_0x628a('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x628a('0x35')](handleEntityNotFound(_0x38abe5,null))[_0x628a('0x35')](saveUpdates(_0x47d39a[_0x628a('0x5c')],null))[_0x628a('0x35')](respondWithResult(_0x38abe5,null))[_0x628a('0x26')](handleError(_0x38abe5,null));};exports[_0x628a('0x34')]=function(_0x2d6354,_0x27b73c){return db['WhatsappAccount'][_0x628a('0x5a')]({'where':{'id':_0x2d6354[_0x628a('0x56')]['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x27b73c,null))[_0x628a('0x35')](removeEntity(_0x27b73c,null))[_0x628a('0x26')](handleError(_0x27b73c,null));};exports[_0x628a('0x63')]=function(_0x2d1e9c,_0x46ec93){return db[_0x628a('0x3d')][_0x628a('0x63')]()[_0x628a('0x35')](respondWithResult(_0x46ec93,null))[_0x628a('0x26')](handleError(_0x46ec93,null));};exports[_0x628a('0x64')]=function(_0x2bed84,_0x5ea26f,_0x534817){if(_0x2bed84[_0x628a('0x5c')]['id']){delete _0x2bed84[_0x628a('0x5c')]['id'];}return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x2bed84['params']['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x5ea26f,null))[_0x628a('0x35')](function(_0x26fa20){if(_0x26fa20){_0x2bed84[_0x628a('0x5c')][_0x628a('0x65')]=_0x26fa20['id'];return db[_0x628a('0x66')][_0x628a('0x5b')](_0x2bed84[_0x628a('0x5c')]);}})[_0x628a('0x35')](respondWithResult(_0x5ea26f,null))[_0x628a('0x26')](handleError(_0x5ea26f,null));};exports['getDispositions']=function(_0x48c69e,_0xc35ba0,_0x599285){var _0x9ad941={'raw':![],'where':{}};var _0x541eef={};var _0x369584={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x628a('0x67')]({'where':{'id':_0x48c69e[_0x628a('0x56')]['id']}})[_0x628a('0x35')](handleEntityNotFound(_0xc35ba0,null))[_0x628a('0x35')](function(_0x45e76d){if(_0x45e76d){_0x541eef[_0x628a('0x42')]=_['keys'](db[_0x628a('0x66')]['rawAttributes']);_0x541eef['query']=_['keys'](_0x48c69e[_0x628a('0x43')]);_0x541eef[_0x628a('0x45')]=_[_0x628a('0x46')](_0x541eef[_0x628a('0x42')],_0x541eef[_0x628a('0x43')]);_0x9ad941[_0x628a('0x47')]=_['intersection'](_0x541eef['model'],qs[_0x628a('0x48')](_0x48c69e[_0x628a('0x43')][_0x628a('0x48')]));_0x9ad941[_0x628a('0x47')]=_0x9ad941[_0x628a('0x47')]['length']?_0x9ad941[_0x628a('0x47')]:_0x541eef[_0x628a('0x42')];if(!_0x48c69e['query'][_0x628a('0x4a')](_0x628a('0x68'))){_0x9ad941[_0x628a('0x2b')]=qs[_0x628a('0x2b')](_0x48c69e[_0x628a('0x43')]['limit']);_0x9ad941['offset']=qs[_0x628a('0x2d')](_0x48c69e[_0x628a('0x43')][_0x628a('0x2d')]);}_0x9ad941[_0x628a('0x4b')]=qs[_0x628a('0x4c')](_0x48c69e[_0x628a('0x43')]['sort']);_0x9ad941[_0x628a('0x4f')]=qs[_0x628a('0x45')](_['pick'](_0x48c69e[_0x628a('0x43')],_0x541eef[_0x628a('0x45')]));_0x9ad941[_0x628a('0x4f')][_0x628a('0x65')]=_0x45e76d['id'];if(_0x48c69e['query'][_0x628a('0x4e')]){_0x9ad941[_0x628a('0x4f')]=_[_0x628a('0x50')](_0x9ad941[_0x628a('0x4f')],{'$or':_['map'](_0x9ad941['attributes'],function(_0x289f52){var _0x551cd0={};_0x551cd0[_0x289f52]={'$like':'%'+_0x48c69e[_0x628a('0x43')][_0x628a('0x4e')]+'%'};return _0x551cd0;})});}_0x9ad941=_[_0x628a('0x50')]({},_0x9ad941,_0x48c69e[_0x628a('0x59')]);return db[_0x628a('0x66')][_0x628a('0x2c')]({'where':_0x9ad941[_0x628a('0x4f')]})[_0x628a('0x35')](function(_0x583960){_0x369584[_0x628a('0x2c')]=_0x583960;if(_0x48c69e[_0x628a('0x43')][_0x628a('0x58')]){_0x9ad941[_0x628a('0x52')]=[{'all':!![]}];}return db[_0x628a('0x66')][_0x628a('0x53')](_0x9ad941);})[_0x628a('0x35')](function(_0x1bb9af){_0x369584[_0x628a('0x54')]=_0x1bb9af;return _0x369584;});}})['then'](respondWithFilteredResult(_0xc35ba0,_0x9ad941))['catch'](handleError(_0xc35ba0,null));};exports['removeDispositions']=function(_0x2668d9,_0x34b5ce,_0x3b1647){return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x2668d9[_0x628a('0x56')]['id']}})['then'](handleEntityNotFound(_0x34b5ce,null))[_0x628a('0x35')](function(_0x12eb17){if(_0x12eb17){return _0x12eb17[_0x628a('0x69')](_0x2668d9[_0x628a('0x43')][_0x628a('0x6a')]);}})[_0x628a('0x35')](respondWithStatusCode(_0x34b5ce,null))[_0x628a('0x26')](handleError(_0x34b5ce,null));};exports[_0x628a('0x6b')]=function(_0x352cb3,_0x59d37b,_0x4ebce8){if(_0x352cb3[_0x628a('0x5c')]['id']){delete _0x352cb3[_0x628a('0x5c')]['id'];}return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x352cb3['params']['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x59d37b,null))[_0x628a('0x35')](function(_0x3e5add){if(_0x3e5add){_0x352cb3['body'][_0x628a('0x65')]=_0x3e5add['id'];return db['CannedAnswer'][_0x628a('0x5b')](_0x352cb3[_0x628a('0x5c')]);}})[_0x628a('0x35')](respondWithResult(_0x59d37b,null))[_0x628a('0x26')](handleError(_0x59d37b,null));};exports['getAnswers']=function(_0x5cd972,_0x39ca2c,_0x571021){var _0x4ed9fc={'raw':![],'where':{}};var _0x4bcc30={};var _0x39ac72={'count':0x0,'rows':[]};return db[_0x628a('0x3d')]['findOne']({'where':{'id':_0x5cd972[_0x628a('0x56')]['id']}})['then'](handleEntityNotFound(_0x39ca2c,null))[_0x628a('0x35')](function(_0x2fd98d){if(_0x2fd98d){_0x4bcc30[_0x628a('0x42')]=_[_0x628a('0x44')](db['CannedAnswer']['rawAttributes']);_0x4bcc30[_0x628a('0x43')]=_[_0x628a('0x44')](_0x5cd972['query']);_0x4bcc30[_0x628a('0x45')]=_[_0x628a('0x46')](_0x4bcc30[_0x628a('0x42')],_0x4bcc30[_0x628a('0x43')]);_0x4ed9fc['attributes']=_[_0x628a('0x46')](_0x4bcc30[_0x628a('0x42')],qs['fields'](_0x5cd972[_0x628a('0x43')][_0x628a('0x48')]));_0x4ed9fc['attributes']=_0x4ed9fc['attributes'][_0x628a('0x49')]?_0x4ed9fc['attributes']:_0x4bcc30[_0x628a('0x42')];if(!_0x5cd972[_0x628a('0x43')][_0x628a('0x4a')]('nolimit')){_0x4ed9fc[_0x628a('0x2b')]=qs[_0x628a('0x2b')](_0x5cd972[_0x628a('0x43')][_0x628a('0x2b')]);_0x4ed9fc[_0x628a('0x2d')]=qs[_0x628a('0x2d')](_0x5cd972[_0x628a('0x43')][_0x628a('0x2d')]);}_0x4ed9fc[_0x628a('0x4b')]=qs[_0x628a('0x4c')](_0x5cd972['query']['sort']);_0x4ed9fc[_0x628a('0x4f')]=qs[_0x628a('0x45')](_['pick'](_0x5cd972[_0x628a('0x43')],_0x4bcc30[_0x628a('0x45')]));_0x4ed9fc[_0x628a('0x4f')]['WhatsappAccountId']=_0x2fd98d['id'];if(_0x5cd972[_0x628a('0x43')][_0x628a('0x4e')]){_0x4ed9fc['where']=_[_0x628a('0x50')](_0x4ed9fc[_0x628a('0x4f')],{'$or':_[_0x628a('0x3c')](_0x4ed9fc[_0x628a('0x47')],function(_0x31bacf){var _0x76e748={};_0x76e748[_0x31bacf]={'$like':'%'+_0x5cd972[_0x628a('0x43')][_0x628a('0x4e')]+'%'};return _0x76e748;})});}_0x4ed9fc=_[_0x628a('0x50')]({},_0x4ed9fc,_0x5cd972[_0x628a('0x59')]);return db[_0x628a('0x6c')][_0x628a('0x2c')]({'where':_0x4ed9fc[_0x628a('0x4f')]})[_0x628a('0x35')](function(_0xd38414){_0x39ac72['count']=_0xd38414;if(_0x5cd972[_0x628a('0x43')][_0x628a('0x58')]){_0x4ed9fc[_0x628a('0x52')]=[{'all':!![]}];}return db[_0x628a('0x6c')]['findAll'](_0x4ed9fc);})['then'](function(_0x4be7df){_0x39ac72[_0x628a('0x54')]=_0x4be7df;return _0x39ac72;});}})[_0x628a('0x35')](respondWithFilteredResult(_0x39ca2c,_0x4ed9fc))['catch'](handleError(_0x39ca2c,null));};exports[_0x628a('0x6d')]=function(_0x555545,_0x1df7f9,_0x505798){return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x555545[_0x628a('0x56')]['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x1df7f9,null))[_0x628a('0x35')](function(_0x15d6e0){if(_0x15d6e0){return _0x15d6e0[_0x628a('0x6d')](_0x555545[_0x628a('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x1df7f9,null))[_0x628a('0x26')](handleError(_0x1df7f9,null));};exports[_0x628a('0x6e')]=function(_0x4c66c0,_0x4110be,_0x178e06){return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x4c66c0[_0x628a('0x56')]['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x4110be,null))[_0x628a('0x35')](function(_0x259c66){if(_0x259c66){return _0x259c66[_0x628a('0x6e')](_0x4c66c0[_0x628a('0x5c')][_0x628a('0x6a')],_[_0x628a('0x6f')](_0x4c66c0[_0x628a('0x5c')],[_0x628a('0x6a'),'id'])||{})[_0x628a('0x70')](function(_0x30d3b6){for(var _0x214850=0x0;_0x214850<_0x4c66c0['body'][_0x628a('0x6a')]['length'];_0x214850+=0x1){socket[_0x628a('0x71')](_0x628a('0x72'),{'UserId':Number(_0x4c66c0['body'][_0x628a('0x6a')][_0x214850]),'WhatsappAccountId':Number(_0x4c66c0[_0x628a('0x56')]['id'])});}return _0x30d3b6;});}})[_0x628a('0x35')](respondWithResult(_0x4110be,null))[_0x628a('0x26')](handleError(_0x4110be,null));};exports[_0x628a('0x73')]=function(_0x323e69,_0x1a05bb,_0x5f2c10){return db[_0x628a('0x3d')]['find']({'where':{'id':_0x323e69[_0x628a('0x56')]['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x1a05bb,null))[_0x628a('0x35')](function(_0x4fc04b){if(_0x4fc04b){return _0x4fc04b[_0x628a('0x73')](_0x323e69[_0x628a('0x43')][_0x628a('0x6a')])[_0x628a('0x35')](function(){if(_[_0x628a('0x74')](_0x323e69['query']['ids'])){for(var _0x132498=0x0;_0x132498<_0x323e69[_0x628a('0x43')][_0x628a('0x6a')][_0x628a('0x49')];_0x132498+=0x1){socket[_0x628a('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x323e69[_0x628a('0x43')]['ids'][_0x132498]),'WhatsappAccountId':Number(_0x323e69[_0x628a('0x56')]['id'])});}}else{socket['emit'](_0x628a('0x75'),{'UserId':Number(_0x323e69[_0x628a('0x43')][_0x628a('0x6a')]),'WhatsappAccountId':Number(_0x323e69[_0x628a('0x56')]['id'])});}});}})[_0x628a('0x35')](respondWithStatusCode(_0x1a05bb,null))[_0x628a('0x26')](handleError(_0x1a05bb,null));};exports[_0x628a('0x76')]=function(_0x5d9991,_0x51c061,_0x3547d2){var _0x56c134={};var _0x152981={};var _0x597876;var _0x4c02a2;return db[_0x628a('0x3d')]['findOne']({'where':{'id':_0x5d9991['params']['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x51c061,null))[_0x628a('0x35')](function(_0x4a46c3){if(_0x4a46c3){_0x597876=_0x4a46c3;_0x152981['model']=_['keys'](db[_0x628a('0x77')][_0x628a('0x3e')]);_0x152981[_0x628a('0x43')]=_[_0x628a('0x44')](_0x5d9991[_0x628a('0x43')]);_0x152981['filters']=_[_0x628a('0x46')](_0x152981[_0x628a('0x42')],_0x152981[_0x628a('0x43')]);_0x56c134[_0x628a('0x47')]=_[_0x628a('0x46')](_0x152981[_0x628a('0x42')],qs[_0x628a('0x48')](_0x5d9991['query'][_0x628a('0x48')]));_0x56c134[_0x628a('0x47')]=_0x56c134[_0x628a('0x47')][_0x628a('0x49')]?_0x56c134['attributes']:_0x152981[_0x628a('0x42')];_0x56c134[_0x628a('0x4b')]=qs[_0x628a('0x4c')](_0x5d9991['query'][_0x628a('0x4c')]);_0x56c134[_0x628a('0x4f')]=qs[_0x628a('0x45')](_[_0x628a('0x4d')](_0x5d9991[_0x628a('0x43')],_0x152981[_0x628a('0x45')]));if(_0x5d9991[_0x628a('0x43')][_0x628a('0x4e')]){_0x56c134[_0x628a('0x4f')]=_['merge'](_0x56c134['where'],{'$or':_[_0x628a('0x3c')](_0x56c134['attributes'],function(_0x510e4d){var _0x2fa53d={};_0x2fa53d[_0x510e4d]={'$like':'%'+_0x5d9991[_0x628a('0x43')]['filter']+'%'};return _0x2fa53d;})});}_0x56c134=_['merge']({},_0x56c134,_0x5d9991['options']);return _0x597876[_0x628a('0x76')](_0x56c134);}})[_0x628a('0x35')](function(_0x3c7596){if(_0x3c7596){_0x4c02a2=_0x3c7596[_0x628a('0x49')];if(!_0x5d9991[_0x628a('0x43')][_0x628a('0x4a')](_0x628a('0x68'))){_0x56c134[_0x628a('0x2b')]=qs[_0x628a('0x2b')](_0x5d9991[_0x628a('0x43')][_0x628a('0x2b')]);_0x56c134[_0x628a('0x2d')]=qs[_0x628a('0x2d')](_0x5d9991[_0x628a('0x43')][_0x628a('0x2d')]);}return _0x597876[_0x628a('0x76')](_0x56c134);}})['then'](function(_0x2ff11a){if(_0x2ff11a){return _0x2ff11a?{'count':_0x4c02a2,'rows':_0x2ff11a}:null;}})[_0x628a('0x35')](respondWithResult(_0x51c061,null))[_0x628a('0x26')](handleError(_0x51c061,null));};exports[_0x628a('0x78')]=function(_0x461ea9,_0x28eb0a,_0x22ac19){return db[_0x628a('0x3d')][_0x628a('0x67')]({'where':{'id':_0x461ea9['params']['id']}})[_0x628a('0x35')](handleEntityNotFound(_0x28eb0a,null))[_0x628a('0x35')](function(_0x576fb8){if(_0x576fb8){return db[_0x628a('0x79')][_0x628a('0x7a')](function(_0x283da4){return db['WhatsappApplication'][_0x628a('0x34')]({'where':{'WhatsappAccountId':_0x461ea9[_0x628a('0x56')]['id']},'transaction':_0x283da4})['then'](function(_0x4a4e43){var _0xd888bc=_[_0x628a('0x3c')](_0x461ea9[_0x628a('0x5c')],function(_0x29e76c){_0x29e76c[_0x628a('0x65')]=_0x461ea9[_0x628a('0x56')]['id'];return _0x29e76c;});return db[_0x628a('0x7b')][_0x628a('0x7c')](_0xd888bc,{'transaction':_0x283da4});});})[_0x628a('0x35')](function(){return db[_0x628a('0x7b')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x461ea9[_0x628a('0x56')]['id']},'order':_0x628a('0x7d')});});}})[_0x628a('0x35')](respondWithResult(_0x28eb0a,null))['catch'](handleError(_0x28eb0a,null));};exports[_0x628a('0x7e')]=function(_0x58adc0,_0x3989ed,_0x2fa650){var _0x3e2d65={};var _0xa3ea3e={};var _0x115f69;var _0x2134e3;return db['WhatsappAccount'][_0x628a('0x67')]({'where':{'id':_0x58adc0['params']['id']}})['then'](handleEntityNotFound(_0x3989ed,null))['then'](function(_0x524344){if(_0x524344){_0x115f69=_0x524344;_0xa3ea3e['model']=_[_0x628a('0x44')](db[_0x628a('0x7b')][_0x628a('0x3e')]);_0xa3ea3e[_0x628a('0x43')]=_[_0x628a('0x44')](_0x58adc0[_0x628a('0x43')]);_0xa3ea3e[_0x628a('0x45')]=_[_0x628a('0x46')](_0xa3ea3e[_0x628a('0x42')],_0xa3ea3e[_0x628a('0x43')]);_0x3e2d65['attributes']=_[_0x628a('0x46')](_0xa3ea3e[_0x628a('0x42')],qs['fields'](_0x58adc0[_0x628a('0x43')][_0x628a('0x48')]));_0x3e2d65[_0x628a('0x47')]=_0x3e2d65[_0x628a('0x47')][_0x628a('0x49')]?_0x3e2d65[_0x628a('0x47')]:_0xa3ea3e[_0x628a('0x42')];_0x3e2d65[_0x628a('0x4b')]=qs[_0x628a('0x4c')](_0x58adc0['query']['sort']);_0x3e2d65[_0x628a('0x4f')]=qs[_0x628a('0x45')](_[_0x628a('0x4d')](_0x58adc0['query'],_0xa3ea3e[_0x628a('0x45')]));if(_0x58adc0['query'][_0x628a('0x4e')]){_0x3e2d65[_0x628a('0x4f')]=_['merge'](_0x3e2d65['where'],{'$or':_[_0x628a('0x3c')](_0x3e2d65['attributes'],function(_0x19bda0){var _0x28dc2e={};_0x28dc2e[_0x19bda0]={'$like':'%'+_0x58adc0[_0x628a('0x43')][_0x628a('0x4e')]+'%'};return _0x28dc2e;})});}_0x3e2d65=_['merge']({},_0x3e2d65,_0x58adc0['options']);return _0x115f69[_0x628a('0x7e')](_0x3e2d65);}})['then'](function(_0x4d6488){if(_0x4d6488){_0x2134e3=_0x4d6488[_0x628a('0x49')];if(!_0x58adc0[_0x628a('0x43')]['hasOwnProperty'](_0x628a('0x68'))){_0x3e2d65[_0x628a('0x2b')]=qs['limit'](_0x58adc0['query'][_0x628a('0x2b')]);_0x3e2d65[_0x628a('0x2d')]=qs['offset'](_0x58adc0[_0x628a('0x43')][_0x628a('0x2d')]);}return _0x115f69[_0x628a('0x7e')](_0x3e2d65);}})['then'](function(_0x3ce5f0){if(_0x3ce5f0){return _0x3ce5f0?{'count':_0x2134e3,'rows':_0x3ce5f0}:null;}})[_0x628a('0x35')](respondWithResult(_0x3989ed,null))[_0x628a('0x26')](handleError(_0x3989ed,null));};exports['notify']=function(_0x3a2036,_0x575ade,_0x415e47){var _0x2d9bdf={'channel':_0x628a('0x7f')};var _0x352a0d=[];var _0x59ae08=[];var _0x2afcf1={};return db['WhatsappAccount']['find']({'where':{'id':_0x3a2036['params']['id']},'include':[{'model':db[_0x628a('0x7b')],'as':'Applications'}]})[_0x628a('0x35')](handleEntityNotFound(_0x575ade,null))['then'](function(_0x4d49ab){_0x2d9bdf[_0x628a('0x80')]=_0x4d49ab;_0x2d9bdf[_0x628a('0x81')]=_[_0x628a('0x82')](_0x4d49ab[_0x628a('0x83')],[_0x628a('0x7d')],[_0x628a('0x84')]);if(_0x2d9bdf[_0x628a('0x80')][_0x628a('0x83')]){delete _0x2d9bdf['account'][_0x628a('0x83')];}return db[_0x628a('0x85')][_0x628a('0x63')]();})[_0x628a('0x35')](function(_0x4a3b36){if(!_0x4a3b36){throw new db[(_0x628a('0x86'))]['ValidationError'](_0x628a('0x87'));}_0x352a0d=_['difference'](_[_0x628a('0x44')](_0x4a3b36),['createdAt','updatedAt']);_0x59ae08=_[_0x628a('0x88')](_['keys'](_0x4a3b36),[_0x628a('0x89'),'updatedAt',_0x628a('0x8a'),_0x628a('0x8b')]);_0x2d9bdf[_0x628a('0x5c')]={'mapKey':_0x628a('0x8c')};if(_0x2d9bdf[_0x628a('0x80')][_0x628a('0x40')]&&_0x2d9bdf['account'][_0x628a('0x40')]===_0x628a('0x8d')){_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x8e')]=_0x3a2036[_0x628a('0x5c')][_0x628a('0x8f')][_0x628a('0x90')]('whatsapp:','');_0x2d9bdf['body'][_0x628a('0x5c')]=_0x3a2036[_0x628a('0x5c')][_0x628a('0x91')];_0x2d9bdf['body']['messageId']=_0x3a2036['body']['MessageSid'];}if(_0x2d9bdf[_0x628a('0x5c')]['id']){delete _0x2d9bdf[_0x628a('0x5c')]['id'];}if(_['isNil'](_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x8e')])){throw new db[(_0x628a('0x86'))][(_0x628a('0x92'))](_0x628a('0x93'));}if(_[_0x628a('0x94')](_0x2d9bdf['body'][_0x628a('0x5c')])||_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x5c')]===''){throw new db[(_0x628a('0x86'))][(_0x628a('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x628a('0x94')](_0x2d9bdf['body']['mapKey'])){throw new db[(_0x628a('0x86'))][(_0x628a('0x92'))](_0x628a('0x95')+_0x59ae08);}if(!_[_0x628a('0x96')](_0x59ae08,_0x2d9bdf[_0x628a('0x5c')]['mapKey'])){throw new db[(_0x628a('0x86'))]['ValidationError'](_0x628a('0x97')+_0x59ae08);}_0x2afcf1[_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x98')]]=_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x8e')];return db[_0x628a('0x99')][_0x628a('0x5a')]({'where':{'id':_0x2d9bdf[_0x628a('0x80')][_0x628a('0x8b')]},'include':[{'model':db[_0x628a('0x85')],'as':_0x628a('0x9a'),'where':_0x2afcf1,'limit':0x1,'order':[[_0x628a('0x9b'),_0x628a('0x9c')]]}]});})[_0x628a('0x35')](handleEntityNotFound(_0x575ade,null))['then'](function(_0x5a4f9d){if(_0x5a4f9d){_0x2d9bdf[_0x628a('0x9d')]=_[_0x628a('0x6f')](_0x5a4f9d,[_0x628a('0x9a')]);if(_0x5a4f9d[_0x628a('0x9a')][_0x628a('0x49')]){return _0x5a4f9d[_0x628a('0x9a')][0x0];}var _0x527699=_[_0x628a('0x17')](_0x2d9bdf[_0x628a('0x5c')],{'firstName':_0x2d9bdf[_0x628a('0x5c')]['from'],'ListId':_0x5a4f9d['id']});_0x527699[_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x98')]]=_0x2d9bdf[_0x628a('0x5c')]['from'];return db['CmContact'][_0x628a('0x5b')](_0x527699,{'fields':_0x352a0d,'raw':!![]});}})['then'](handleEntityNotFound(_0x575ade,null))['then'](function(_0x445969){if(_0x445969){_0x2d9bdf[_0x628a('0x9e')]=_0x445969;var _0x20fada={'ContactId':_0x445969['id'],'phone':_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x8e')],'WhatsappAccountId':_0x3a2036[_0x628a('0x56')]['id']};var _0x235cfc={'ContactId':_0x445969['id'],'WhatsappAccountId':_0x3a2036[_0x628a('0x56')]['id'],'closed':![]};return db[_0x628a('0x9f')][_0x628a('0x5a')]({'where':_0x235cfc})[_0x628a('0x35')](function(_0x4f9716){if(_0x4f9716){return[_0x4f9716,![]];}return db[_0x628a('0x9f')][_0x628a('0x5b')](_0x20fada)['then'](function(_0x5d7611){return[_0x5d7611,!![]];});});}})[_0x628a('0x70')](function(_0x526c1e,_0x24a218){_0x2d9bdf[_0x628a('0xa0')]=_0x526c1e[_0x628a('0x36')]({'plain':!![]});_0x2d9bdf[_0x628a('0xa0')]['created']=![];if(_0x24a218){if(_0x2d9bdf[_0x628a('0x80')][_0x628a('0xa1')]){_0x2d9bdf['applications']['push']({'id':0x0,'priority':_0x2d9bdf[_0x628a('0x81')]['length']+0x1,'app':'close','appdata':_0x628a('0xa2'),'interval':_0x628a('0xa3')});}_0x2d9bdf['interaction'][_0x628a('0xa4')]=!![];}return db[_0x628a('0xa5')][_0x628a('0x5b')]({'phone':_0x2d9bdf[_0x628a('0x5c')]['from'],'messageId':_0x2d9bdf[_0x628a('0x5c')][_0x628a('0xa6')],'body':_0x2d9bdf[_0x628a('0x5c')][_0x628a('0x5c')],'WhatsappAccountId':_0x3a2036[_0x628a('0x56')]['id'],'WhatsappInteractionId':_0x526c1e['id'],'direction':'in','ContactId':_0x526c1e[_0x628a('0xa7')],'AttachmentId':_0x2d9bdf['body'][_0x628a('0xa8')]});})[_0x628a('0x35')](function(_0x3490c7){_0x2d9bdf['message']=_0x3490c7;if(_0x2d9bdf['interaction'][_0x628a('0xa9')]){return db[_0x628a('0x77')][_0x628a('0x5a')]({'attributes':['id','name'],'where':{'id':_0x2d9bdf[_0x628a('0xa0')]['UserId']}})['then'](function(_0x1b0315){if(_0x1b0315){_0x2d9bdf['applications'][_0x628a('0xaa')]({'id':0x0,'priority':0x0,'app':_0x628a('0xab'),'appdata':_0x1b0315[_0x628a('0x38')]+','+(_0x2d9bdf['account'][_0x628a('0xac')]||0xa),'interval':_0x628a('0xa3')});}return respondWithRpcPromise(_0x628a('0xad'),'startRouting',_0x2d9bdf);});}return respondWithRpcPromise(_0x628a('0xad'),_0x628a('0xae'),_0x2d9bdf);})[_0x628a('0x35')](function(_0x5bd8df){if(_0x5bd8df){var _0x1fbf7a=0xc8;var _0x577e10=_0x628a('0xaf');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x577e10,_0x1fbf7a,'entity\x20found');logger[_0x628a('0x21')](_0x628a('0xb0'),_0x577e10,_0x1fbf7a,_0x628a('0xb1'),JSON[_0x628a('0xb2')](_0x5bd8df));if(_0x2d9bdf[_0x628a('0x80')]['type']===_0x628a('0x8d')){return _0x575ade['status'](_0x1fbf7a)['set'](_0x628a('0xb3'),_0x628a('0xb4'))[_0x628a('0x39')](_0x628a('0xb5'));}else{return _0x575ade[_0x628a('0x28')](_0x1fbf7a)[_0x628a('0x29')](_0x5bd8df);}}})[_0x628a('0x26')](handleError(_0x575ade,null));};exports[_0x628a('0x39')]=function(_0x5e8dbb,_0xae1e46,_0x4f55b2){var _0x2b8062,_0x1dfe55,_0x102b60;if(_[_0x628a('0x94')](_0x5e8dbb[_0x628a('0x5c')][_0x628a('0x5c')])||_0x5e8dbb[_0x628a('0x5c')][_0x628a('0x5c')]===''){throw new db['Sequelize'][(_0x628a('0x92'))](_0x628a('0xb6'));}if(_[_0x628a('0x94')](_0x5e8dbb['body']['to'])){throw new db[(_0x628a('0x86'))][(_0x628a('0x92'))](_0x628a('0xb7'));}_0x2b8062=_0x5e8dbb[_0x628a('0x5c')]['to'];return db[_0x628a('0x3d')][_0x628a('0x5a')]({'where':{'id':_0x5e8dbb[_0x628a('0x56')]['id']},'include':[{'model':db[_0x628a('0x99')],'as':_0x628a('0xb8'),'include':[{'model':db[_0x628a('0x85')],'as':_0x628a('0x9a'),'where':{'mobile':_0x2b8062},'limit':0x1,'order':[[_0x628a('0x9b'),_0x628a('0x9c')]]}]}]})['then'](handleEntityNotFound(_0xae1e46,null))['then'](function(_0x4dcb7e){if(_0x4dcb7e&&_0x4dcb7e[_0x628a('0xb8')]){_0x1dfe55=_0x4dcb7e[_0x628a('0x36')]({'plain':!![]});if(_0x1dfe55['List']&&_0x1dfe55[_0x628a('0xb8')][_0x628a('0x9a')][_0x628a('0x49')]){return _0x1dfe55[_0x628a('0xb8')][_0x628a('0x9a')][0x0];}return db[_0x628a('0x85')][_0x628a('0x5b')](_[_0x628a('0x17')](_0x5e8dbb[_0x628a('0x5c')],{'firstName':_0x2b8062,'mobile':_0x2b8062,'phone':_0x2b8062,'ListId':_0x1dfe55[_0x628a('0x8b')]}));}})[_0x628a('0x35')](handleEntityNotFound(_0xae1e46,null))[_0x628a('0x35')](function(_0x4c44ca){if(_0x4c44ca){_0x102b60=_0x4c44ca;return db[_0x628a('0x9f')][_0x628a('0x5a')]({'where':{'ContactId':_0x102b60['id'],'closed':![],'WhatsappAccountId':_0x1dfe55['id']}})[_0x628a('0x35')](function(_0x29f5bc){if(_0x29f5bc){return[_0x29f5bc,![]];}return db['WhatsappInteraction'][_0x628a('0x5b')]({'UserId':_0x5e8dbb[_0x628a('0x5d')]['id'],'ContactId':_0x102b60['id'],'WhatsappAccountId':_0x1dfe55['id'],'phone':_0x2b8062,'firstMsgDirection':_0x628a('0xb9'),'Messages':[_[_0x628a('0x50')](_0x5e8dbb[_0x628a('0x5c')],{'read':![],'body':_0x5e8dbb['body']['body'],'phone':_0x2b8062,'WhatsappAccountId':_0x1dfe55['id'],'UserId':_0x5e8dbb['user']['id'],'ContactId':_0x102b60['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x628a('0xba')}]})[_0x628a('0x35')](function(_0x3147d9){return[_0x3147d9,!![]];});});}})[_0x628a('0x70')](function(_0x2be052,_0x24fb4c){if(_0x24fb4c){return _0x2be052;}return db['WhatsappMessage'][_0x628a('0x5b')](_[_0x628a('0x50')](_0x5e8dbb[_0x628a('0x5c')],{'read':![],'body':_0x5e8dbb[_0x628a('0x5c')][_0x628a('0x5c')],'phone':_0x2b8062,'WhatsappAccountId':_0x1dfe55['id'],'WhatsappInteractionId':_0x2be052['id'],'UserId':_0x5e8dbb[_0x628a('0x5d')]['id'],'ContactId':_0x102b60['id']}))[_0x628a('0x35')](function(_0x4d8120){_0x2be052['dataValues']['Messages']=[];_0x2be052[_0x628a('0xbb')][_0x628a('0xba')][_0x628a('0xbc')](_0x4d8120[_0x628a('0xbb')]);return _0x2be052;});})['then'](respondWithResult(_0xae1e46,null))[_0x628a('0x26')](handleError(_0xae1e46,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 8d154eb..622b2b6 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 _0xf061=['update','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','save'];(function(_0x17092b,_0x2ab52c){var _0x16a6a3=function(_0x3f3bee){while(--_0x3f3bee){_0x17092b['push'](_0x17092b['shift']());}};_0x16a6a3(++_0x2ab52c);}(_0xf061,0x1d4));var _0x1f06=function(_0x580d42,_0x172d66){_0x580d42=_0x580d42-0x0;var _0x527515=_0xf061[_0x580d42];return _0x527515;};'use strict';var EventEmitter=require(_0x1f06('0x0'));var WhatsappAccount=require(_0x1f06('0x1'))['db'][_0x1f06('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f06('0x3'),'afterUpdate':_0x1f06('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fa1b9){return function(_0x28a1f7,_0x4d0674,_0x505dd8){WhatsappAccountEvents[_0x1f06('0x5')](_0x2fa1b9+':'+_0x28a1f7['id'],_0x28a1f7);WhatsappAccountEvents[_0x1f06('0x5')](_0x2fa1b9,_0x28a1f7);_0x505dd8(null);};}for(var e in events){if(events[_0x1f06('0x6')](e)){var event=events[e];WhatsappAccount[_0x1f06('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xc809=['update','remove','emit','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x1ac511,_0x4f56b9){var _0x87f94f=function(_0x39c477){while(--_0x39c477){_0x1ac511['push'](_0x1ac511['shift']());}};_0x87f94f(++_0x4f56b9);}(_0xc809,0xa4));var _0x9c80=function(_0x1dcbfd,_0x2b829b){_0x1dcbfd=_0x1dcbfd-0x0;var _0x4a8abc=_0xc809[_0x1dcbfd];return _0x4a8abc;};'use strict';var EventEmitter=require(_0x9c80('0x0'));var WhatsappAccount=require(_0x9c80('0x1'))['db'][_0x9c80('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9c80('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9c80('0x4'),'afterDestroy':_0x9c80('0x5')};function emitEvent(_0x2b711c){return function(_0x2294dd,_0xe4342,_0x461054){WhatsappAccountEvents[_0x9c80('0x6')](_0x2b711c+':'+_0x2294dd['id'],_0x2294dd);WhatsappAccountEvents[_0x9c80('0x6')](_0x2b711c,_0x2294dd);_0x461054(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x9c80('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 1999fbb..ea7bb04 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 _0xf3c5=['whatsapp_accounts','util','../../config/logger','bluebird','request-promise','path','./whatsappAccount.attributes','define'];(function(_0x27879a,_0x1ccc32){var _0x36013e=function(_0x4ed5ea){while(--_0x4ed5ea){_0x27879a['push'](_0x27879a['shift']());}};_0x36013e(++_0x1ccc32);}(_0xf3c5,0xe1));var _0x5f3c=function(_0x139a23,_0x184a3f){_0x139a23=_0x139a23-0x0;var _0x4da424=_0xf3c5[_0x139a23];return _0x4da424;};'use strict';var _=require('lodash');var util=require(_0x5f3c('0x0'));var logger=require(_0x5f3c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5f3c('0x2'));var rp=require(_0x5f3c('0x3'));var fs=require('fs');var path=require(_0x5f3c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f3c('0x5'));module['exports']=function(_0x567e8b,_0x4afd57){return _0x567e8b[_0x5f3c('0x6')]('WhatsappAccount',attributes,{'tableName':_0x5f3c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86b9=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','bluebird','path'];(function(_0x3c2bbd,_0x55c6f9){var _0x502eb9=function(_0x5486ca){while(--_0x5486ca){_0x3c2bbd['push'](_0x3c2bbd['shift']());}};_0x502eb9(++_0x55c6f9);}(_0x86b9,0xc1));var _0x986b=function(_0xff4214,_0x4f849d){_0xff4214=_0xff4214-0x0;var _0x499398=_0x86b9[_0xff4214];return _0x499398;};'use strict';var _=require(_0x986b('0x0'));var util=require('util');var logger=require(_0x986b('0x1'))(_0x986b('0x2'));var moment=require('moment');var BPromise=require(_0x986b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x986b('0x4'));var rimraf=require('rimraf');var config=require(_0x986b('0x5'));var attributes=require(_0x986b('0x6'));module[_0x986b('0x7')]=function(_0x569f27,_0x551fc9){return _0x569f27[_0x986b('0x8')](_0x986b('0x9'),attributes,{'tableName':_0x986b('0xa'),'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 ec68795..11c147f 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 _0xf799=['result','catch','find','options','raw','where','attributes','model','include','map','ShowWhatsappAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xf799,0x1c7));var _0x9f79=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xf799[_0x2525f1];return _0x13c1b5;};'use strict';var _=require('lodash');var util=require(_0x9f79('0x0'));var moment=require(_0x9f79('0x1'));var BPromise=require(_0x9f79('0x2'));var rs=require(_0x9f79('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f79('0x4'))['db'];var utils=require(_0x9f79('0x5'));var logger=require(_0x9f79('0x6'))(_0x9f79('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f79('0x8')]['http']({'port':0x232a});config[_0x9f79('0x9')]=_[_0x9f79('0xa')](config[_0x9f79('0x9')],{'host':_0x9f79('0xb'),'port':0x18eb});var socket=require(_0x9f79('0xc'))(new Redis(config[_0x9f79('0x9')]));require(_0x9f79('0xd'))[_0x9f79('0xe')](socket);function respondWithRpcPromise(_0x4eba09,_0x4e4366,_0x3aeb5b){return new BPromise(function(_0x471ef7,_0x5a5253){return client[_0x9f79('0xf')](_0x4eba09,_0x3aeb5b)[_0x9f79('0x10')](function(_0x291363){logger[_0x9f79('0x11')](_0x9f79('0x12'),_0x4e4366,'request\x20sent');logger[_0x9f79('0x13')](_0x9f79('0x14'),_0x4e4366,'request\x20sent',JSON[_0x9f79('0x15')](_0x291363));if(_0x291363[_0x9f79('0x16')]){if(_0x291363['error'][_0x9f79('0x17')]===0x1f4){logger[_0x9f79('0x16')](_0x9f79('0x12'),_0x4e4366,_0x291363[_0x9f79('0x16')][_0x9f79('0x18')]);return _0x5a5253(_0x291363['error'][_0x9f79('0x18')]);}logger['error'](_0x9f79('0x12'),_0x4e4366,_0x291363[_0x9f79('0x16')][_0x9f79('0x18')]);return _0x471ef7(_0x291363[_0x9f79('0x16')][_0x9f79('0x18')]);}else{logger[_0x9f79('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x4e4366,_0x9f79('0x19'));_0x471ef7(_0x291363[_0x9f79('0x1a')][_0x9f79('0x18')]);}})[_0x9f79('0x1b')](function(_0x2f7c1b){logger[_0x9f79('0x16')](_0x9f79('0x12'),_0x4e4366,_0x2f7c1b);_0x5a5253(_0x2f7c1b);});});}exports['ShowWhatsappAccount']=function(_0x1020d4){var _0x4cdc40=this;return new Promise(function(_0x2950a6,_0x5c6246){return db['WhatsappAccount'][_0x9f79('0x1c')]({'raw':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')][_0x9f79('0x1e')]===undefined?!![]:![]:!![],'where':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')][_0x9f79('0x1f')]||null:null,'attributes':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')][_0x9f79('0x20')]||null:null,'include':_0x1020d4[_0x9f79('0x1d')]?_0x1020d4[_0x9f79('0x1d')]['include']?_['map'](_0x1020d4[_0x9f79('0x1d')]['include'],function(_0x21539a){return{'model':db[_0x21539a[_0x9f79('0x21')]],'as':_0x21539a['as'],'attributes':_0x21539a[_0x9f79('0x20')],'include':_0x21539a[_0x9f79('0x22')]?_[_0x9f79('0x23')](_0x21539a['include'],function(_0x451acc){return{'model':db[_0x451acc[_0x9f79('0x21')]],'as':_0x451acc['as'],'attributes':_0x451acc[_0x9f79('0x20')],'include':_0x451acc[_0x9f79('0x22')]?_[_0x9f79('0x23')](_0x451acc['include'],function(_0x37bef1){return{'model':db[_0x37bef1[_0x9f79('0x21')]],'as':_0x37bef1['as'],'attributes':_0x37bef1[_0x9f79('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f79('0x10')](function(_0x131f40){logger[_0x9f79('0x11')](_0x9f79('0x24'),_0x1020d4);logger[_0x9f79('0x13')](_0x9f79('0x24'),_0x1020d4,JSON[_0x9f79('0x15')](_0x131f40));_0x2950a6(_0x131f40);})[_0x9f79('0x1b')](function(_0x1ee2c9){logger[_0x9f79('0x16')](_0x9f79('0x24'),_0x1ee2c9[_0x9f79('0x18')],_0x1020d4);_0x5c6246(_0x4cdc40[_0x9f79('0x16')](0x1f4,_0x1ee2c9[_0x9f79('0x18')]));});});}; \ No newline at end of file +var _0x78e7=['WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x298fa4,_0x4662b0){var _0x57b569=function(_0x652fd6){while(--_0x652fd6){_0x298fa4['push'](_0x298fa4['shift']());}};_0x57b569(++_0x4662b0);}(_0x78e7,0xb1));var _0x778e=function(_0xc71b76,_0x2ab7c1){_0xc71b76=_0xc71b76-0x0;var _0x40dcc7=_0x78e7[_0xc71b76];return _0x40dcc7;};'use strict';var _=require(_0x778e('0x0'));var util=require(_0x778e('0x1'));var moment=require(_0x778e('0x2'));var BPromise=require(_0x778e('0x3'));var rs=require(_0x778e('0x4'));var fs=require('fs');var Redis=require(_0x778e('0x5'));var db=require(_0x778e('0x6'))['db'];var utils=require(_0x778e('0x7'));var logger=require(_0x778e('0x8'))(_0x778e('0x9'));var config=require('../../config/environment');var jayson=require(_0x778e('0xa'));var client=jayson[_0x778e('0xb')][_0x778e('0xc')]({'port':0x232a});config[_0x778e('0xd')]=_['defaults'](config[_0x778e('0xd')],{'host':_0x778e('0xe'),'port':0x18eb});var socket=require(_0x778e('0xf'))(new Redis(config[_0x778e('0xd')]));require('./whatsappAccount.socket')[_0x778e('0x10')](socket);function respondWithRpcPromise(_0x4c2ede,_0x561fd2,_0xed6809){return new BPromise(function(_0x2a5462,_0x22b0ee){return client[_0x778e('0x11')](_0x4c2ede,_0xed6809)[_0x778e('0x12')](function(_0x2382b9){logger[_0x778e('0x13')](_0x778e('0x14'),_0x561fd2,_0x778e('0x15'));logger[_0x778e('0x16')](_0x778e('0x17'),_0x561fd2,_0x778e('0x15'),JSON[_0x778e('0x18')](_0x2382b9));if(_0x2382b9['error']){if(_0x2382b9['error'][_0x778e('0x19')]===0x1f4){logger['error'](_0x778e('0x14'),_0x561fd2,_0x2382b9['error'][_0x778e('0x1a')]);return _0x22b0ee(_0x2382b9[_0x778e('0x1b')][_0x778e('0x1a')]);}logger[_0x778e('0x1b')](_0x778e('0x14'),_0x561fd2,_0x2382b9[_0x778e('0x1b')]['message']);return _0x2a5462(_0x2382b9['error'][_0x778e('0x1a')]);}else{logger[_0x778e('0x13')](_0x778e('0x14'),_0x561fd2,_0x778e('0x15'));_0x2a5462(_0x2382b9[_0x778e('0x1c')][_0x778e('0x1a')]);}})[_0x778e('0x1d')](function(_0x110d4d){logger['error'](_0x778e('0x14'),_0x561fd2,_0x110d4d);_0x22b0ee(_0x110d4d);});});}exports[_0x778e('0x1e')]=function(_0x39f76e){var _0x35ab57=this;return new Promise(function(_0x21a5d0,_0x5511f0){return db[_0x778e('0x1f')][_0x778e('0x20')]({'raw':_0x39f76e[_0x778e('0x21')]?_0x39f76e[_0x778e('0x21')][_0x778e('0x22')]===undefined?!![]:![]:!![],'where':_0x39f76e[_0x778e('0x21')]?_0x39f76e['options'][_0x778e('0x23')]||null:null,'attributes':_0x39f76e['options']?_0x39f76e['options']['attributes']||null:null,'include':_0x39f76e[_0x778e('0x21')]?_0x39f76e[_0x778e('0x21')]['include']?_[_0x778e('0x24')](_0x39f76e['options'][_0x778e('0x25')],function(_0x381e5c){return{'model':db[_0x381e5c[_0x778e('0x26')]],'as':_0x381e5c['as'],'attributes':_0x381e5c[_0x778e('0x27')],'include':_0x381e5c[_0x778e('0x25')]?_[_0x778e('0x24')](_0x381e5c[_0x778e('0x25')],function(_0x3f0dcf){return{'model':db[_0x3f0dcf[_0x778e('0x26')]],'as':_0x3f0dcf['as'],'attributes':_0x3f0dcf[_0x778e('0x27')],'include':_0x3f0dcf[_0x778e('0x25')]?_['map'](_0x3f0dcf['include'],function(_0x55a832){return{'model':db[_0x55a832[_0x778e('0x26')]],'as':_0x55a832['as'],'attributes':_0x55a832[_0x778e('0x27')]};}):[]};}):[]};}):[]:[]})[_0x778e('0x12')](function(_0x59405b){logger[_0x778e('0x13')](_0x778e('0x1e'),_0x39f76e);logger[_0x778e('0x16')]('ShowWhatsappAccount',_0x39f76e,JSON[_0x778e('0x18')](_0x59405b));_0x21a5d0(_0x59405b);})[_0x778e('0x1d')](function(_0x4c7b36){logger['error'](_0x778e('0x1e'),_0x4c7b36['message'],_0x39f76e);_0x5511f0(_0x35ab57[_0x778e('0x1b')](0x1f4,_0x4c7b36[_0x778e('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index bdac1d2..83bb4da 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 _0xc78f=['length','whatsappAccount:','./whatsappAccount.events','remove','emit','register'];(function(_0x357c47,_0x5512fd){var _0x3309b4=function(_0x1f1a47){while(--_0x1f1a47){_0x357c47['push'](_0x357c47['shift']());}};_0x3309b4(++_0x5512fd);}(_0xc78f,0x10a));var _0xfc78=function(_0x5e1a6e,_0x39e9b7){_0x5e1a6e=_0x5e1a6e-0x0;var _0x48d8ff=_0xc78f[_0x5e1a6e];return _0x48d8ff;};'use strict';var WhatsappAccountEvents=require(_0xfc78('0x0'));var events=['save',_0xfc78('0x1'),'update'];function createListener(_0x115a77,_0x534555){return function(_0x3e1e19){_0x534555[_0xfc78('0x2')](_0x115a77,_0x3e1e19);};}function removeListener(_0x6f4edf,_0x1c6c74){return function(){WhatsappAccountEvents['removeListener'](_0x6f4edf,_0x1c6c74);};}exports[_0xfc78('0x3')]=function(_0x2b0a85){for(var _0x1779f5=0x0,_0x10a46b=events[_0xfc78('0x4')];_0x1779f5<_0x10a46b;_0x1779f5++){var _0x558bd7=events[_0x1779f5];var _0x2128d0=createListener(_0xfc78('0x5')+_0x558bd7,_0x2b0a85);WhatsappAccountEvents['on'](_0x558bd7,_0x2128d0);}}; \ No newline at end of file +var _0x972e=['save','remove','update','emit','removeListener','register','length','./whatsappAccount.events'];(function(_0x2119e4,_0x44c5bf){var _0x4afe17=function(_0xb6cf52){while(--_0xb6cf52){_0x2119e4['push'](_0x2119e4['shift']());}};_0x4afe17(++_0x44c5bf);}(_0x972e,0xaf));var _0xe972=function(_0x34e2e1,_0x51aaec){_0x34e2e1=_0x34e2e1-0x0;var _0x2dbd55=_0x972e[_0x34e2e1];return _0x2dbd55;};'use strict';var WhatsappAccountEvents=require(_0xe972('0x0'));var events=[_0xe972('0x1'),_0xe972('0x2'),_0xe972('0x3')];function createListener(_0x2a7297,_0x144881){return function(_0x23947e){_0x144881[_0xe972('0x4')](_0x2a7297,_0x23947e);};}function removeListener(_0x31da72,_0x53a854){return function(){WhatsappAccountEvents[_0xe972('0x5')](_0x31da72,_0x53a854);};}exports[_0xe972('0x6')]=function(_0x31b645){for(var _0x5559e3=0x0,_0xb3a0bc=events[_0xe972('0x7')];_0x5559e3<_0xb3a0bc;_0x5559e3++){var _0x5ee922=events[_0x5559e3];var _0x457197=createListener('whatsappAccount:'+_0x5ee922,_0x31b645);WhatsappAccountEvents['on'](_0x5ee922,_0x457197);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 038810a..4456e38 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 _0xfe7a=['../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0xfe7a,0x17f));var _0xafe7=function(_0x559fe6,_0x4db925){_0x559fe6=_0x559fe6-0x0;var _0x590fb0=_0xfe7a[_0x559fe6];return _0x590fb0;};'use strict';var multer=require(_0xafe7('0x0'));var util=require(_0xafe7('0x1'));var path=require(_0xafe7('0x2'));var timeout=require(_0xafe7('0x3'));var express=require(_0xafe7('0x4'));var router=express[_0xafe7('0x5')]();var fs_extra=require(_0xafe7('0x6'));var auth=require(_0xafe7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xafe7('0x8'));var controller=require(_0xafe7('0x9'));router['get']('/',auth[_0xafe7('0xa')](),controller[_0xafe7('0xb')]);router[_0xafe7('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xafe7('0xa')](),controller['create']);router[_0xafe7('0xd')](_0xafe7('0xe'),auth[_0xafe7('0xa')](),controller[_0xafe7('0xf')]);router['delete'](_0xafe7('0xe'),auth['isAuthenticated'](),controller[_0xafe7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9ea0=['./whatsappApplication.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x9ea0,0x102));var _0x09ea=function(_0x316af7,_0x72e80c){_0x316af7=_0x316af7-0x0;var _0x286d96=_0x9ea0[_0x316af7];return _0x286d96;};'use strict';var multer=require(_0x09ea('0x0'));var util=require(_0x09ea('0x1'));var path=require(_0x09ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x09ea('0x3'));var router=express[_0x09ea('0x4')]();var fs_extra=require(_0x09ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x09ea('0x6'));var config=require(_0x09ea('0x7'));var controller=require(_0x09ea('0x8'));router[_0x09ea('0x9')]('/',auth[_0x09ea('0xa')](),controller[_0x09ea('0xb')]);router[_0x09ea('0x9')]('/:id',auth[_0x09ea('0xa')](),controller[_0x09ea('0xc')]);router['post']('/',auth[_0x09ea('0xa')](),controller[_0x09ea('0xd')]);router[_0x09ea('0xe')](_0x09ea('0xf'),auth[_0x09ea('0xa')](),controller[_0x09ea('0x10')]);router[_0x09ea('0x11')](_0x09ea('0xf'),auth['isAuthenticated'](),controller[_0x09ea('0x12')]);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 ee384f0..e4ebe05 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 _0x2e77=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2e77,0xc6));var _0x72e7=function(_0x11bb1c,_0x51b84b){_0x11bb1c=_0x11bb1c-0x0;var _0x3a592c=_0x2e77[_0x11bb1c];return _0x3a592c;};'use strict';var Sequelize=require(_0x72e7('0x0'));module[_0x72e7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x72e7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x72e7('0x3')]()},'description':{'type':Sequelize[_0x72e7('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x72e7('0x4')}}; \ No newline at end of file +var _0x8d18=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x8d18,0x73));var _0x88d1=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x8d18[_0x5af59e];return _0x4240df;};'use strict';var Sequelize=require(_0x88d1('0x0'));module[_0x88d1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x88d1('0x2')],'allowNull':![],'defaultValue':_0x88d1('0x3')},'appdata':{'type':Sequelize[_0x88d1('0x4')]()},'description':{'type':Sequelize[_0x88d1('0x2')]},'interval':{'type':Sequelize[_0x88d1('0x2')],'defaultValue':_0x88d1('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 4e7d730..bc00e08 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 _0xffc0=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','WhatsappApplication','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','length','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x35952a,_0xe7809f){var _0x158a2d=function(_0x254c9a){while(--_0x254c9a){_0x35952a['push'](_0x35952a['shift']());}};_0x158a2d(++_0xe7809f);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x4851bb,_0x5b6fe8){_0x4851bb=_0x4851bb-0x0;var _0x4c0e25=_0xffc0[_0x4851bb];return _0x4c0e25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ffc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ffc('0x1'));var rp=require(_0x0ffc('0x2'));var moment=require(_0x0ffc('0x3'));var BPromise=require(_0x0ffc('0x4'));var Mustache=require(_0x0ffc('0x5'));var util=require(_0x0ffc('0x6'));var path=require(_0x0ffc('0x7'));var sox=require('sox');var csv=require(_0x0ffc('0x8'));var ejs=require(_0x0ffc('0x9'));var fs=require('fs');var fs_extra=require(_0x0ffc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0ffc('0xb'));var jsforce=require(_0x0ffc('0xc'));var deskjs=require(_0x0ffc('0xd'));var toCsv=require(_0x0ffc('0x8'));var querystring=require('querystring');var Papa=require(_0x0ffc('0xe'));var Redis=require(_0x0ffc('0xf'));var authService=require(_0x0ffc('0x10'));var qs=require(_0x0ffc('0x11'));var as=require(_0x0ffc('0x12'));var hardwareService=require(_0x0ffc('0x13'));var logger=require(_0x0ffc('0x14'))(_0x0ffc('0x15'));var utils=require('../../config/utils');var config=require(_0x0ffc('0x16'));var licenseUtil=require(_0x0ffc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e514,_0xbf12d1){_0xbf12d1=_0xbf12d1||0xcc;return function(_0x9622fe){if(_0x9622fe){return _0x19e514['sendStatus'](_0xbf12d1);}return _0x19e514[_0x0ffc('0x18')](_0xbf12d1)[_0x0ffc('0x19')]();};}function respondWithResult(_0x47a80b,_0x2095df){_0x2095df=_0x2095df||0xc8;return function(_0x137908){if(_0x137908){return _0x47a80b[_0x0ffc('0x18')](_0x2095df)[_0x0ffc('0x1a')](_0x137908);}};}function respondWithFilteredResult(_0x20edfc,_0x5034bc){return function(_0x35af98){if(_0x35af98){var _0x565921=typeof _0x5034bc[_0x0ffc('0x1b')]===_0x0ffc('0x1c')&&typeof _0x5034bc['limit']===_0x0ffc('0x1c');var _0x577e89=_0x35af98['count'];var _0x5b0018=_0x565921?0x0:_0x5034bc['offset'];var _0x314dab=_0x565921?_0x35af98[_0x0ffc('0x1d')]:_0x5034bc[_0x0ffc('0x1b')]+_0x5034bc[_0x0ffc('0x1e')];var _0x294f34;if(_0x314dab>=_0x577e89){_0x314dab=_0x577e89;_0x294f34=0xc8;}else{_0x294f34=0xce;}_0x20edfc['status'](_0x294f34);return _0x20edfc['set'](_0x0ffc('0x1f'),_0x5b0018+'-'+_0x314dab+'/'+_0x577e89)['json'](_0x35af98);}return null;};}function patchUpdates(_0x49e690){return function(_0x60ac9d){try{jsonpatch[_0x0ffc('0x20')](_0x60ac9d,_0x49e690,!![]);}catch(_0x49faaa){return BPromise[_0x0ffc('0x21')](_0x49faaa);}return _0x60ac9d[_0x0ffc('0x22')]();};}function saveUpdates(_0x27ae43,_0x527fd4){return function(_0x4ffd80){if(_0x4ffd80){return _0x4ffd80[_0x0ffc('0x23')](_0x27ae43)[_0x0ffc('0x24')](function(_0x418150){return _0x418150;});}return null;};}function removeEntity(_0x948451,_0x46b4e6){return function(_0x4d4294){if(_0x4d4294){return _0x4d4294['destroy']()[_0x0ffc('0x24')](function(){_0x948451['status'](0xcc)[_0x0ffc('0x19')]();});}};}function handleEntityNotFound(_0x5ad1b4,_0x25e3c0){return function(_0x136b0a){if(!_0x136b0a){_0x5ad1b4[_0x0ffc('0x25')](0x194);}return _0x136b0a;};}function handleError(_0x1265f5,_0x3968cc){_0x3968cc=_0x3968cc||0x1f4;return function(_0x34bce1){logger[_0x0ffc('0x26')](_0x34bce1[_0x0ffc('0x27')]);if(_0x34bce1['name']){delete _0x34bce1[_0x0ffc('0x28')];}_0x1265f5[_0x0ffc('0x18')](_0x3968cc)['send'](_0x34bce1);};}exports['index']=function(_0x40166f,_0x5f3a01){var _0x13c425={},_0x5d3cff={},_0x4ece4f={'count':0x0,'rows':[]};var _0x22eafd=_['map'](db[_0x0ffc('0x29')][_0x0ffc('0x2a')],function(_0x28c608){return{'name':_0x28c608['fieldName'],'type':_0x28c608[_0x0ffc('0x2b')][_0x0ffc('0x2c')]};});_0x5d3cff[_0x0ffc('0x2d')]=_[_0x0ffc('0x2e')](_0x22eafd,'name');_0x5d3cff[_0x0ffc('0x2f')]=_[_0x0ffc('0x30')](_0x40166f[_0x0ffc('0x2f')]);_0x5d3cff['filters']=_[_0x0ffc('0x31')](_0x5d3cff['model'],_0x5d3cff[_0x0ffc('0x2f')]);_0x13c425['attributes']=_[_0x0ffc('0x31')](_0x5d3cff[_0x0ffc('0x2d')],qs['fields'](_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x32')]));_0x13c425[_0x0ffc('0x33')]=_0x13c425[_0x0ffc('0x33')]['length']?_0x13c425[_0x0ffc('0x33')]:_0x5d3cff[_0x0ffc('0x2d')];if(!_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x34')](_0x0ffc('0x35'))){_0x13c425[_0x0ffc('0x1e')]=qs[_0x0ffc('0x1e')](_0x40166f['query'][_0x0ffc('0x1e')]);_0x13c425[_0x0ffc('0x1b')]=qs[_0x0ffc('0x1b')](_0x40166f[_0x0ffc('0x2f')]['offset']);}_0x13c425[_0x0ffc('0x36')]=qs[_0x0ffc('0x37')](_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x37')]);_0x13c425['where']=qs[_0x0ffc('0x38')](_[_0x0ffc('0x39')](_0x40166f[_0x0ffc('0x2f')],_0x5d3cff[_0x0ffc('0x38')]),_0x22eafd);if(_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x3a')]){_0x13c425[_0x0ffc('0x3b')]=_[_0x0ffc('0x3c')](_0x13c425[_0x0ffc('0x3b')],{'$or':_['map'](_0x22eafd,function(_0x1d23d4){if(_0x1d23d4[_0x0ffc('0x2b')]!==_0x0ffc('0x3d')){var _0x2d5d00={};_0x2d5d00[_0x1d23d4['name']]={'$like':'%'+_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x3a')]+'%'};return _0x2d5d00;}})});}_0x13c425=_[_0x0ffc('0x3c')]({},_0x13c425,_0x40166f[_0x0ffc('0x3e')]);var _0x2f9f98={'where':_0x13c425[_0x0ffc('0x3b')]};return db[_0x0ffc('0x29')][_0x0ffc('0x1d')](_0x2f9f98)[_0x0ffc('0x24')](function(_0x5cf45e){_0x4ece4f[_0x0ffc('0x1d')]=_0x5cf45e;if(_0x40166f[_0x0ffc('0x2f')][_0x0ffc('0x3f')]){_0x13c425[_0x0ffc('0x40')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x13c425);})['then'](function(_0x28105d){_0x4ece4f['rows']=_0x28105d;return _0x4ece4f;})[_0x0ffc('0x24')](respondWithFilteredResult(_0x5f3a01,_0x13c425))['catch'](handleError(_0x5f3a01,null));};exports[_0x0ffc('0x41')]=function(_0x1cb958,_0x50c005){var _0x54070c={'raw':!![],'where':{'id':_0x1cb958[_0x0ffc('0x42')]['id']}},_0x1bf431={};_0x1bf431['model']=_[_0x0ffc('0x30')](db[_0x0ffc('0x29')]['rawAttributes']);_0x1bf431['query']=_[_0x0ffc('0x30')](_0x1cb958['query']);_0x1bf431[_0x0ffc('0x38')]=_['intersection'](_0x1bf431['model'],_0x1bf431['query']);_0x54070c[_0x0ffc('0x33')]=_['intersection'](_0x1bf431[_0x0ffc('0x2d')],qs[_0x0ffc('0x32')](_0x1cb958[_0x0ffc('0x2f')]['fields']));_0x54070c[_0x0ffc('0x33')]=_0x54070c[_0x0ffc('0x33')][_0x0ffc('0x43')]?_0x54070c[_0x0ffc('0x33')]:_0x1bf431[_0x0ffc('0x2d')];if(_0x1cb958[_0x0ffc('0x2f')][_0x0ffc('0x3f')]){_0x54070c[_0x0ffc('0x40')]=[{'all':!![]}];}_0x54070c=_['merge']({},_0x54070c,_0x1cb958[_0x0ffc('0x3e')]);return db[_0x0ffc('0x29')][_0x0ffc('0x44')](_0x54070c)['then'](handleEntityNotFound(_0x50c005,null))[_0x0ffc('0x24')](respondWithResult(_0x50c005,null))[_0x0ffc('0x45')](handleError(_0x50c005,null));};exports[_0x0ffc('0x46')]=function(_0x2b16f7,_0x4a146f){return db[_0x0ffc('0x29')][_0x0ffc('0x46')](_0x2b16f7['body'],{})[_0x0ffc('0x24')](respondWithResult(_0x4a146f,0xc9))[_0x0ffc('0x45')](handleError(_0x4a146f,null));};exports['update']=function(_0x57e328,_0x18b774){if(_0x57e328[_0x0ffc('0x47')]['id']){delete _0x57e328[_0x0ffc('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x57e328[_0x0ffc('0x42')]['id']}})['then'](handleEntityNotFound(_0x18b774,null))[_0x0ffc('0x24')](saveUpdates(_0x57e328[_0x0ffc('0x47')],null))[_0x0ffc('0x24')](respondWithResult(_0x18b774,null))[_0x0ffc('0x45')](handleError(_0x18b774,null));};exports[_0x0ffc('0x48')]=function(_0x4a879a,_0x1b73b5){return db[_0x0ffc('0x29')][_0x0ffc('0x44')]({'where':{'id':_0x4a879a[_0x0ffc('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b73b5,null))['then'](removeEntity(_0x1b73b5,null))[_0x0ffc('0x45')](handleError(_0x1b73b5,null));}; \ No newline at end of file +var _0xab00=['include','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xab00,0x1b9));var _0x0ab0=function(_0x327732,_0x8d928d){_0x327732=_0x327732-0x0;var _0x21893f=_0xab00[_0x327732];return _0x21893f;};'use strict';var emlformat=require(_0x0ab0('0x0'));var rimraf=require(_0x0ab0('0x1'));var zipdir=require(_0x0ab0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ab0('0x3'));var moment=require(_0x0ab0('0x4'));var BPromise=require(_0x0ab0('0x5'));var Mustache=require('mustache');var util=require(_0x0ab0('0x6'));var path=require('path');var sox=require(_0x0ab0('0x7'));var csv=require(_0x0ab0('0x8'));var ejs=require(_0x0ab0('0x9'));var fs=require('fs');var fs_extra=require(_0x0ab0('0xa'));var _=require(_0x0ab0('0xb'));var squel=require(_0x0ab0('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ab0('0xd'));var deskjs=require(_0x0ab0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0ab0('0xf'));var Papa=require('papaparse');var Redis=require(_0x0ab0('0x10'));var authService=require(_0x0ab0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0ab0('0x12'));var utils=require('../../config/utils');var config=require(_0x0ab0('0x13'));var licenseUtil=require(_0x0ab0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bf478,_0xfa9b2c){_0xfa9b2c=_0xfa9b2c||0xcc;return function(_0x332370){if(_0x332370){return _0x2bf478[_0x0ab0('0x15')](_0xfa9b2c);}return _0x2bf478[_0x0ab0('0x16')](_0xfa9b2c)[_0x0ab0('0x17')]();};}function respondWithResult(_0x906db9,_0x297262){_0x297262=_0x297262||0xc8;return function(_0x2dfcd3){if(_0x2dfcd3){return _0x906db9[_0x0ab0('0x16')](_0x297262)[_0x0ab0('0x18')](_0x2dfcd3);}};}function respondWithFilteredResult(_0x3c39b6,_0x55a322){return function(_0x5cf1cd){if(_0x5cf1cd){var _0x5f4a41=typeof _0x55a322[_0x0ab0('0x19')]===_0x0ab0('0x1a')&&typeof _0x55a322[_0x0ab0('0x1b')]==='undefined';var _0x49df08=_0x5cf1cd['count'];var _0x5b3bef=_0x5f4a41?0x0:_0x55a322['offset'];var _0x171341=_0x5f4a41?_0x5cf1cd[_0x0ab0('0x1c')]:_0x55a322[_0x0ab0('0x19')]+_0x55a322[_0x0ab0('0x1b')];var _0x454eb3;if(_0x171341>=_0x49df08){_0x171341=_0x49df08;_0x454eb3=0xc8;}else{_0x454eb3=0xce;}_0x3c39b6[_0x0ab0('0x16')](_0x454eb3);return _0x3c39b6[_0x0ab0('0x1d')]('Content-Range',_0x5b3bef+'-'+_0x171341+'/'+_0x49df08)['json'](_0x5cf1cd);}return null;};}function patchUpdates(_0x2cda33){return function(_0x1a87a2){try{jsonpatch[_0x0ab0('0x1e')](_0x1a87a2,_0x2cda33,!![]);}catch(_0x5c3382){return BPromise[_0x0ab0('0x1f')](_0x5c3382);}return _0x1a87a2['save']();};}function saveUpdates(_0x2691c7,_0x2ccb3e){return function(_0x20cd95){if(_0x20cd95){return _0x20cd95[_0x0ab0('0x20')](_0x2691c7)[_0x0ab0('0x21')](function(_0xc51b90){return _0xc51b90;});}return null;};}function removeEntity(_0x1bec79,_0x5795f0){return function(_0x2a4629){if(_0x2a4629){return _0x2a4629[_0x0ab0('0x22')]()[_0x0ab0('0x21')](function(){_0x1bec79['status'](0xcc)[_0x0ab0('0x17')]();});}};}function handleEntityNotFound(_0xd7c564,_0x3e9afd){return function(_0x5add07){if(!_0x5add07){_0xd7c564[_0x0ab0('0x15')](0x194);}return _0x5add07;};}function handleError(_0x34c9e6,_0x113386){_0x113386=_0x113386||0x1f4;return function(_0x2a4f7c){logger[_0x0ab0('0x23')](_0x2a4f7c['stack']);if(_0x2a4f7c[_0x0ab0('0x24')]){delete _0x2a4f7c['name'];}_0x34c9e6[_0x0ab0('0x16')](_0x113386)[_0x0ab0('0x25')](_0x2a4f7c);};}exports[_0x0ab0('0x26')]=function(_0x29e200,_0x5ae993){var _0x4764fc={},_0x5e7e2b={},_0x2c29c0={'count':0x0,'rows':[]};var _0x34f67e=_[_0x0ab0('0x27')](db[_0x0ab0('0x28')][_0x0ab0('0x29')],function(_0xa9cb4f){return{'name':_0xa9cb4f[_0x0ab0('0x2a')],'type':_0xa9cb4f[_0x0ab0('0x2b')][_0x0ab0('0x2c')]};});_0x5e7e2b[_0x0ab0('0x2d')]=_[_0x0ab0('0x27')](_0x34f67e,_0x0ab0('0x24'));_0x5e7e2b['query']=_[_0x0ab0('0x2e')](_0x29e200[_0x0ab0('0x2f')]);_0x5e7e2b[_0x0ab0('0x30')]=_[_0x0ab0('0x31')](_0x5e7e2b[_0x0ab0('0x2d')],_0x5e7e2b[_0x0ab0('0x2f')]);_0x4764fc['attributes']=_['intersection'](_0x5e7e2b[_0x0ab0('0x2d')],qs[_0x0ab0('0x32')](_0x29e200[_0x0ab0('0x2f')][_0x0ab0('0x32')]));_0x4764fc[_0x0ab0('0x33')]=_0x4764fc[_0x0ab0('0x33')][_0x0ab0('0x34')]?_0x4764fc['attributes']:_0x5e7e2b[_0x0ab0('0x2d')];if(!_0x29e200[_0x0ab0('0x2f')][_0x0ab0('0x35')](_0x0ab0('0x36'))){_0x4764fc['limit']=qs[_0x0ab0('0x1b')](_0x29e200['query'][_0x0ab0('0x1b')]);_0x4764fc['offset']=qs['offset'](_0x29e200[_0x0ab0('0x2f')]['offset']);}_0x4764fc[_0x0ab0('0x37')]=qs[_0x0ab0('0x38')](_0x29e200[_0x0ab0('0x2f')][_0x0ab0('0x38')]);_0x4764fc[_0x0ab0('0x39')]=qs[_0x0ab0('0x30')](_[_0x0ab0('0x3a')](_0x29e200['query'],_0x5e7e2b['filters']),_0x34f67e);if(_0x29e200['query'][_0x0ab0('0x3b')]){_0x4764fc[_0x0ab0('0x39')]=_[_0x0ab0('0x3c')](_0x4764fc['where'],{'$or':_['map'](_0x34f67e,function(_0x7585c4){if(_0x7585c4[_0x0ab0('0x2b')]!==_0x0ab0('0x3d')){var _0x1438ff={};_0x1438ff[_0x7585c4[_0x0ab0('0x24')]]={'$like':'%'+_0x29e200[_0x0ab0('0x2f')]['filter']+'%'};return _0x1438ff;}})});}_0x4764fc=_[_0x0ab0('0x3c')]({},_0x4764fc,_0x29e200['options']);var _0x542c44={'where':_0x4764fc[_0x0ab0('0x39')]};return db['WhatsappApplication'][_0x0ab0('0x1c')](_0x542c44)[_0x0ab0('0x21')](function(_0x5be95a){_0x2c29c0['count']=_0x5be95a;if(_0x29e200['query'][_0x0ab0('0x3e')]){_0x4764fc[_0x0ab0('0x3f')]=[{'all':!![]}];}return db[_0x0ab0('0x28')]['findAll'](_0x4764fc);})[_0x0ab0('0x21')](function(_0x3db8a6){_0x2c29c0[_0x0ab0('0x40')]=_0x3db8a6;return _0x2c29c0;})['then'](respondWithFilteredResult(_0x5ae993,_0x4764fc))[_0x0ab0('0x41')](handleError(_0x5ae993,null));};exports[_0x0ab0('0x42')]=function(_0x3b30e8,_0x1e21f2){var _0x18b5f5={'raw':!![],'where':{'id':_0x3b30e8['params']['id']}},_0x51cf3f={};_0x51cf3f[_0x0ab0('0x2d')]=_[_0x0ab0('0x2e')](db[_0x0ab0('0x28')][_0x0ab0('0x29')]);_0x51cf3f[_0x0ab0('0x2f')]=_[_0x0ab0('0x2e')](_0x3b30e8['query']);_0x51cf3f[_0x0ab0('0x30')]=_[_0x0ab0('0x31')](_0x51cf3f[_0x0ab0('0x2d')],_0x51cf3f[_0x0ab0('0x2f')]);_0x18b5f5['attributes']=_['intersection'](_0x51cf3f[_0x0ab0('0x2d')],qs[_0x0ab0('0x32')](_0x3b30e8[_0x0ab0('0x2f')][_0x0ab0('0x32')]));_0x18b5f5[_0x0ab0('0x33')]=_0x18b5f5[_0x0ab0('0x33')][_0x0ab0('0x34')]?_0x18b5f5['attributes']:_0x51cf3f['model'];if(_0x3b30e8['query'][_0x0ab0('0x3e')]){_0x18b5f5[_0x0ab0('0x3f')]=[{'all':!![]}];}_0x18b5f5=_[_0x0ab0('0x3c')]({},_0x18b5f5,_0x3b30e8[_0x0ab0('0x43')]);return db[_0x0ab0('0x28')][_0x0ab0('0x44')](_0x18b5f5)[_0x0ab0('0x21')](handleEntityNotFound(_0x1e21f2,null))['then'](respondWithResult(_0x1e21f2,null))[_0x0ab0('0x41')](handleError(_0x1e21f2,null));};exports[_0x0ab0('0x45')]=function(_0x39519e,_0x30d400){return db[_0x0ab0('0x28')][_0x0ab0('0x45')](_0x39519e[_0x0ab0('0x46')],{})[_0x0ab0('0x21')](respondWithResult(_0x30d400,0xc9))['catch'](handleError(_0x30d400,null));};exports['update']=function(_0x37e688,_0x318301){if(_0x37e688[_0x0ab0('0x46')]['id']){delete _0x37e688[_0x0ab0('0x46')]['id'];}return db[_0x0ab0('0x28')][_0x0ab0('0x44')]({'where':{'id':_0x37e688['params']['id']}})[_0x0ab0('0x21')](handleEntityNotFound(_0x318301,null))[_0x0ab0('0x21')](saveUpdates(_0x37e688[_0x0ab0('0x46')],null))[_0x0ab0('0x21')](respondWithResult(_0x318301,null))[_0x0ab0('0x41')](handleError(_0x318301,null));};exports[_0x0ab0('0x22')]=function(_0x35f269,_0xcd971a){return db[_0x0ab0('0x28')][_0x0ab0('0x44')]({'where':{'id':_0x35f269[_0x0ab0('0x47')]['id']}})[_0x0ab0('0x21')](handleEntityNotFound(_0xcd971a,null))[_0x0ab0('0x21')](removeEntity(_0xcd971a,null))[_0x0ab0('0x41')](handleError(_0xcd971a,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5ff3e60..c7f5d5f 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 _0xd2ea=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3eba3f,_0x1fa13e){var _0x11a78d=function(_0x27529d){while(--_0x27529d){_0x3eba3f['push'](_0x3eba3f['shift']());}};_0x11a78d(++_0x1fa13e);}(_0xd2ea,0x15f));var _0xad2e=function(_0x559e79,_0x13c437){_0x559e79=_0x559e79-0x0;var _0x49dd80=_0xd2ea[_0x559e79];return _0x49dd80;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad2e('0xe')});}; \ No newline at end of file +var _0xcca7=['../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0xcca7,0x1aa));var _0x7cca=function(_0x25ae39,_0x10de45){_0x25ae39=_0x25ae39-0x0;var _0x396450=_0xcca7[_0x25ae39];return _0x396450;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('WhatsappApplication',attributes,{'tableName':_0x7cca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7cca('0xa'),'collate':_0x7cca('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index b8c8e68..f11d336 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 _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5c7e30,_0x462ed3){var _0x2f309a=function(_0x430f51){while(--_0x430f51){_0x5c7e30['push'](_0x5c7e30['shift']());}};_0x2f309a(++_0x462ed3);}(_0xda55,0x6d));var _0x5da5=function(_0x2d6ab8,_0x1b6b82){_0x2d6ab8=_0x2d6ab8-0x0;var _0x339c56=_0xda55[_0x2d6ab8];return _0x339c56;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file +var _0x6f0d=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x303e92,_0x5f54f8){var _0x5020e9=function(_0x1b3d32){while(--_0x1b3d32){_0x303e92['push'](_0x303e92['shift']());}};_0x5020e9(++_0x5f54f8);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x32ff69,_0x256ac8){_0x32ff69=_0x32ff69-0x0;var _0x3d4938=_0x6f0d[_0x32ff69];return _0x3d4938;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ebb9e41..4fec366 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 _0xc6ac=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x394b76,_0x923c90){var _0x45ce23=function(_0x24d77c){while(--_0x24d77c){_0x394b76['push'](_0x394b76['shift']());}};_0x45ce23(++_0x923c90);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xac2260,_0xfc4cda){_0xac2260=_0xac2260-0x0;var _0x43d7be=_0xc6ac[_0xac2260];return _0x43d7be;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0x16')]('/',auth[_0xcc6a('0xc')](),controller['create']);router['post'](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x17')]);router['post']('/:id/tags',auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1a')),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x1c')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0xcc6a('0x1d')]);router[_0xcc6a('0x1e')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1f')),controller[_0xcc6a('0x20')]);router[_0xcc6a('0x1e')](_0xcc6a('0x21'),auth[_0xcc6a('0xc')](),controller['removeTags']);module[_0xcc6a('0x22')]=router; \ No newline at end of file +var _0x5a5a=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','put','tracked','update','delete','whatsappinteraction:destroy','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x12861e,_0x44ac5f){var _0x5ec3f1=function(_0x165278){while(--_0x165278){_0x12861e['push'](_0x12861e['shift']());}};_0x5ec3f1(++_0x44ac5f);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x44a3a6,_0x59abd5){_0x44a3a6=_0x44a3a6-0x0;var _0x5e395b=_0x5a5a[_0x44a3a6];return _0x5e395b;};'use strict';var multer=require('multer');var util=require(_0xa5a5('0x0'));var path=require(_0xa5a5('0x1'));var timeout=require(_0xa5a5('0x2'));var express=require(_0xa5a5('0x3'));var router=express[_0xa5a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa5a5('0x5'));var interaction=require(_0xa5a5('0x6'));var config=require(_0xa5a5('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x9')]);router['get'](_0xa5a5('0xa'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0xb')]);router[_0xa5a5('0xc')](_0xa5a5('0xd'),auth['isAuthenticated'](),controller[_0xa5a5('0xe')]);router[_0xa5a5('0xc')](_0xa5a5('0xf'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x10')]);router[_0xa5a5('0xc')](_0xa5a5('0x11'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x12')]);router[_0xa5a5('0x13')]('/',auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x14')]);router['post'](_0xa5a5('0xf'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x15')]);router[_0xa5a5('0x13')](_0xa5a5('0x16'),auth[_0xa5a5('0x8')](),interaction['tracked'](_0xa5a5('0x17'),_0xa5a5('0x18')),controller[_0xa5a5('0x19')]);router[_0xa5a5('0x1a')](_0xa5a5('0xd'),auth[_0xa5a5('0x8')](),interaction[_0xa5a5('0x1b')](_0xa5a5('0x17'),'whatsappinteraction:update'),controller[_0xa5a5('0x1c')]);router[_0xa5a5('0x1d')](_0xa5a5('0xd'),auth[_0xa5a5('0x8')](),interaction[_0xa5a5('0x1b')](_0xa5a5('0x17'),_0xa5a5('0x1e')),controller['destroy']);router[_0xa5a5('0x1d')](_0xa5a5('0x16'),auth[_0xa5a5('0x8')](),controller[_0xa5a5('0x1f')]);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 0646b89..e35f208 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 _0x9829=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x9829,0xc4));var _0x9982=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x9829[_0x313c96];return _0x522f53;};'use strict';var Sequelize=require(_0x9982('0x0'));var moment=require(_0x9982('0x1'));module[_0x9982('0x2')]={'closed':{'type':Sequelize[_0x9982('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9982('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9982('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9982('0x5')]},'note':{'type':Sequelize[_0x9982('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9982('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9982('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9982('0x6')]('in',_0x9982('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7ad3=['sequelize','moment','exports','BOOLEAN','STRING','out','DATE','ENUM'];(function(_0x20ba52,_0xacc64e){var _0x1c625e=function(_0x338a84){while(--_0x338a84){_0x20ba52['push'](_0x20ba52['shift']());}};_0x1c625e(++_0xacc64e);}(_0x7ad3,0x108));var _0x37ad=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x7ad3[_0x2074db];return _0x27324c;};'use strict';var Sequelize=require(_0x37ad('0x0'));var moment=require(_0x37ad('0x1'));module[_0x37ad('0x2')]={'closed':{'type':Sequelize[_0x37ad('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x37ad('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x37ad('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x37ad('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x37ad('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x37ad('0x7')]('in',_0x37ad('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x37ad('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ebd024f..a7f6703 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 _0x383a=['register','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','fullname','TagIds','split','forEach','Tags','index','WhatsappInteraction','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','i.id','QueryTypes','SELECT','contactName','DESC','t.id\x20IN\x20?','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','push','all','show','params','include','merge','catch','create','find','addMessage','WhatsappMessage','ids','omit','getMessages','rawAttributes','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closed','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','server','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0x383a,0x1ad));var _0xa383=function(_0x41bd33,_0x8dd533){_0x41bd33=_0x41bd33-0x0;var _0x1ef83a=_0x383a[_0x41bd33];return _0x1ef83a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa383('0x0'));var zipdir=require(_0xa383('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa383('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa383('0x3'));var util=require(_0xa383('0x4'));var path=require(_0xa383('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa383('0x6'));var fs=require('fs');var fs_extra=require(_0xa383('0x7'));var _=require(_0xa383('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa383('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa383('0xa'));var authService=require(_0xa383('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xa383('0xc'));var pdf=require(_0xa383('0xd'));var hardwareService=require(_0xa383('0xe'));var logger=require('../../config/logger')(_0xa383('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa383('0x10'));var db=require(_0xa383('0x11'))['db'];config[_0xa383('0x12')]=_[_0xa383('0x13')](config['redis'],{'host':_0xa383('0x14'),'port':0x18eb});var socket=require(_0xa383('0x15'))(new Redis(config[_0xa383('0x12')]));require(_0xa383('0x16'))[_0xa383('0x17')](socket);function respondWithStatusCode(_0x1fcb20,_0x1c655c){_0x1c655c=_0x1c655c||0xcc;return function(_0x83a77a){if(_0x83a77a){return _0x1fcb20['sendStatus'](_0x1c655c);}return _0x1fcb20['status'](_0x1c655c)[_0xa383('0x18')]();};}function respondWithResult(_0x2d8794,_0xe2e956){_0xe2e956=_0xe2e956||0xc8;return function(_0x2f2fd8){if(_0x2f2fd8){return _0x2d8794['status'](_0xe2e956)[_0xa383('0x19')](_0x2f2fd8);}};}function respondWithFilteredResult(_0x5d491c,_0x287b82){return function(_0x81eab0){if(_0x81eab0){var _0x2ccaf7=typeof _0x287b82[_0xa383('0x1a')]===_0xa383('0x1b')&&typeof _0x287b82[_0xa383('0x1c')]===_0xa383('0x1b');var _0x2649b0=_0x81eab0[_0xa383('0x1d')];var _0x113ff0=_0x2ccaf7?0x0:_0x287b82['offset'];var _0x5d87f9=_0x2ccaf7?_0x81eab0['count']:_0x287b82[_0xa383('0x1a')]+_0x287b82[_0xa383('0x1c')];var _0x5e0ba5;if(_0x5d87f9>=_0x2649b0){_0x5d87f9=_0x2649b0;_0x5e0ba5=0xc8;}else{_0x5e0ba5=0xce;}_0x5d491c[_0xa383('0x1e')](_0x5e0ba5);return _0x5d491c['set'](_0xa383('0x1f'),_0x113ff0+'-'+_0x5d87f9+'/'+_0x2649b0)[_0xa383('0x19')](_0x81eab0);}return null;};}function patchUpdates(_0x4db308){return function(_0x433d85){try{jsonpatch[_0xa383('0x20')](_0x433d85,_0x4db308,!![]);}catch(_0x4cc53b){return BPromise[_0xa383('0x21')](_0x4cc53b);}return _0x433d85[_0xa383('0x22')]();};}function saveUpdates(_0x37bacb,_0xd2c369){return function(_0x398cd5){if(_0x398cd5){return _0x398cd5[_0xa383('0x23')](_0x37bacb)['then'](function(_0x23d22b){return _0x23d22b;});}return null;};}function removeEntity(_0x28add7,_0x90148c){return function(_0x2ffa5d){if(_0x2ffa5d){return _0x2ffa5d[_0xa383('0x24')]()[_0xa383('0x25')](function(){_0x28add7[_0xa383('0x1e')](0xcc)[_0xa383('0x18')]();});}};}function handleEntityNotFound(_0x553d45,_0x3b671a){return function(_0x25ce4f){if(!_0x25ce4f){_0x553d45[_0xa383('0x26')](0x194);}return _0x25ce4f;};}function handleError(_0x1db1ac,_0x2640f4){_0x2640f4=_0x2640f4||0x1f4;return function(_0x26c28a){logger[_0xa383('0x27')](_0x26c28a[_0xa383('0x28')]);if(_0x26c28a[_0xa383('0x29')]){delete _0x26c28a[_0xa383('0x29')];}_0x1db1ac[_0xa383('0x1e')](_0x2640f4)['send'](_0x26c28a);};}function getInteractionUsers(_0x4d0ecb,_0xd11504){return new BPromise(function(_0x2e4ba5,_0x390bbe){try{if(_0xd11504[_0x4d0ecb['id']]){_0x4d0ecb['Users']=_[_0xa383('0x2a')](_0xd11504[_0x4d0ecb['id']],function(_0x2468c1){return{'id':_0x2468c1['id'],'fullname':_0x2468c1[_0xa383('0x2b')]};});}}catch(_0x1394c5){_0x390bbe(_0x1394c5);}_0x2e4ba5(_0x4d0ecb);});}function getInteractionTags(_0x56866d,_0x32f851){return new BPromise(function(_0x36de27,_0x302d5b){try{if(_0x56866d[_0xa383('0x2c')]){_0x56866d['Tags']=[];_0x56866d[_0xa383('0x2c')][_0xa383('0x2d')](',')[_0xa383('0x2e')](function(_0xfbff18){_0x56866d[_0xa383('0x2f')]['push'](_0x32f851[_0xfbff18]);});}delete _0x56866d[_0xa383('0x2c')];}catch(_0x39060a){_0x302d5b(_0x39060a);}_0x36de27(_0x56866d);});}function updateWhatsappInteraction(_0x1110fe,_0x402472,_0x59381a){return new BPromise(function(_0x24d74c,_0x46a43e){return getInteractionUsers(_0x1110fe,_0x59381a)['then'](function(_0x129e13){return getInteractionTags(_0x129e13,_0x402472);})[_0xa383('0x25')](function(_0x2eb5c2){_0x24d74c(_0x2eb5c2);})['catch'](function(_0x115a00){_0x46a43e(_0x115a00);});});}exports[_0xa383('0x30')]=function(_0x10afeb,_0x91b4c4){var _0x503cc8={},_0x269cc1={},_0x50869c={'count':0x0,'rows':[]};var _0x238ac4=_[_0xa383('0x2a')](db[_0xa383('0x31')]['rawAttributes'],function(_0x307cb4){return{'name':_0x307cb4[_0xa383('0x32')],'type':_0x307cb4[_0xa383('0x33')][_0xa383('0x34')]};});_0x269cc1[_0xa383('0x35')]=_[_0xa383('0x2a')](_0x238ac4,'name');_0x269cc1[_0xa383('0x36')]=_[_0xa383('0x37')](_0x10afeb[_0xa383('0x36')]);_0x269cc1['filters']=_[_0xa383('0x38')](_0x269cc1[_0xa383('0x35')],_0x269cc1['query']);_0x503cc8[_0xa383('0x39')]=_['intersection'](_0x269cc1['model'],qs[_0xa383('0x3a')](_0x10afeb[_0xa383('0x36')]['fields']));_0x503cc8[_0xa383('0x39')]=_0x503cc8[_0xa383('0x39')][_0xa383('0x3b')]?_0x503cc8[_0xa383('0x39')]:_0x269cc1['model'];if(!_0x10afeb[_0xa383('0x36')][_0xa383('0x3c')](_0xa383('0x3d'))){_0x503cc8[_0xa383('0x1c')]=qs[_0xa383('0x1c')](_0x10afeb['query'][_0xa383('0x1c')]);_0x503cc8[_0xa383('0x1a')]=qs[_0xa383('0x1a')](_0x10afeb['query'][_0xa383('0x1a')]);}_0x503cc8[_0xa383('0x3e')]=qs[_0xa383('0x3f')](_0x10afeb[_0xa383('0x36')][_0xa383('0x3f')]);_0x503cc8[_0xa383('0x40')]=qs[_0xa383('0x41')](_['pick'](_0x10afeb[_0xa383('0x36')],_0x269cc1['filters']),_0x238ac4);var _0x331f14=[];var _0x48a387=squel[_0xa383('0x42')]()['field']('id')[_0xa383('0x43')](_0xa383('0x29'))[_0xa383('0x43')](_0xa383('0x44'))[_0xa383('0x45')]('tools_tags');var _0x3411a3=squel[_0xa383('0x42')]()[_0xa383('0x43')](_0xa383('0x46'))['field'](_0xa383('0x47'))[_0xa383('0x43')](_0xa383('0x48'))['from']('user_has_whatsapp_interactions','ui')[_0xa383('0x49')](_0xa383('0x4a'),'u',_0xa383('0x4b'));var _0x33e177=squel[_0xa383('0x42')]()[_0xa383('0x45')](_0xa383('0x4c'),'i')[_0xa383('0x49')](_0xa383('0x4d'),'c',_0xa383('0x4e'))[_0xa383('0x49')](_0xa383('0x4a'),'o','o.id\x20=\x20i.UserId')[_0xa383('0x49')](_0xa383('0x4f'),'a',_0xa383('0x50'))['left_join']('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0xa383('0x49')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xa383('0x49')](_0xa383('0x51'),'t',_0xa383('0x52'));var _0x9cbb43=squel[_0xa383('0x53')]();var _0x339bf6=[];var _0x2c393b=squel[_0xa383('0x53')]();var _0x25e61c;if(_0x10afeb['query'][_0xa383('0x54')]){_0x25e61c=as[_0xa383('0x55')](_0x10afeb['query']['search']);var _0x5248c4=_0x25e61c[_0xa383('0x56')];for(var _0xa9719b=0x0;_0xa9719b<_0x25e61c[_0xa383('0x57')][_0xa383('0x3b')];_0xa9719b++){var _0x4e47fc=_0x25e61c[_0xa383('0x57')][_0xa9719b];var _0x1858a9='i';var _0x8cd84=_['find'](_0x238ac4,['name',_0x4e47fc[_0xa383('0x43')]]);if(!_0x8cd84){switch(_0x4e47fc[_0xa383('0x43')]){case _0xa383('0x58'):if(_0x4e47fc[_0xa383('0x59')]==0x1){_0x33e177['having']('`'+_0x4e47fc[_0xa383('0x43')]+'`\x20=\x200');}else{_0x33e177[_0xa383('0x5a')]('`'+_0x4e47fc[_0xa383('0x43')]+_0xa383('0x5b'));}break;case _0xa383('0x5c'):if(_0x4e47fc['operator']==='$substring'){if(_0x4e47fc[_0xa383('0x59')][_0xa383('0x2d')]('\x20')[_0xa383('0x3b')]>0x1){_0x9cbb43[_0x5248c4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa383('0x5d')](_0x4e47fc[_0xa383('0x59')]),null);}else{var _0x51d440='%'+_0x4e47fc[_0xa383('0x59')]+'%';_0x9cbb43[_0x5248c4](_0xa383('0x5e'),_0x51d440,_0x51d440,_0x51d440);}}else{_0x8cd84=_['find'](_0x238ac4,[_0xa383('0x29'),_0xa383('0x5f')]);_0x4e47fc[_0xa383('0x43')]=_0xa383('0x5f');_0x348b17=as[_0xa383('0x60')](_0x1858a9,_0x8cd84['type'],_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17[_0xa383('0x61')],_0x348b17[_0xa383('0x59')]['start'],_0x348b17['value'][_0xa383('0x18')]);}break;case _0xa383('0x62'):var _0x53c587=_0x4e47fc[_0xa383('0x59')][_0xa383('0x2d')](',')[_0xa383('0x2a')](function(_0x2ba23a){return Number(_0x2ba23a);});_0x53c587[_0xa383('0x2e')](function(_0x4a565d){_0x2c393b['or'](_0xa383('0x63'),'%,'+_0x4a565d+',%');});_0x339bf6=_['union'](_0x339bf6,_0x53c587);break;case _0xa383('0x64'):if(_0x4e47fc[_0xa383('0x65')]===_0xa383('0x66')){_0x9cbb43[_0x5248c4](_0xa383('0x67'),'%'+_0x4e47fc[_0xa383('0x59')]+'%',null);}else{_0x8cd84=_['find'](_0x238ac4,[_0xa383('0x29'),'UserId']);_0x4e47fc['field']=_0xa383('0x68');_0x348b17=as[_0xa383('0x60')](_0x1858a9,_0x8cd84['type'],_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17[_0xa383('0x61')],_0x348b17['value'][_0xa383('0x69')],_0x348b17[_0xa383('0x59')]['end']);}break;case _0xa383('0x6a'):_0x348b17=as[_0xa383('0x60')]('me',null,_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17[_0xa383('0x61')],_0x348b17[_0xa383('0x59')][_0xa383('0x69')],_0x348b17[_0xa383('0x59')]['end']);break;}}else{var _0x348b17=as[_0xa383('0x60')](_0x1858a9,_0x8cd84[_0xa383('0x33')],_0x4e47fc);_0x9cbb43[_0x5248c4](_0x348b17['text'],_0x348b17[_0xa383('0x59')][_0xa383('0x69')],_0x348b17[_0xa383('0x59')][_0xa383('0x18')]);}}}else{var _0x20de90=_(_0x10afeb[_0xa383('0x36')])[_0xa383('0x37')]()[_0xa383('0x2a')](function(_0x1378bf){return _[_0xa383('0x6b')](_0x238ac4,['name',_0x1378bf])?_0x1378bf:undefined;})[_0xa383('0x6c')]()[_0xa383('0x59')]();if(!_[_0xa383('0x6d')](_0x20de90)){_0x20de90[_0xa383('0x2e')](function(_0x2644ed){if(_0x2644ed==='WhatsappAccountId'){_0x33e177['where']('i.WhatsappAccountId\x20IN\x20?',[][_0xa383('0x6e')](_0x10afeb[_0xa383('0x36')][_0x2644ed]));}else if(_0x2644ed===_0xa383('0x6f')){var _0x1303b6=JSON[_0xa383('0x70')](_0x10afeb[_0xa383('0x36')][_0x2644ed])[_0xa383('0x71')];var _0x5b7cde=JSON[_0xa383('0x70')](_0x10afeb[_0xa383('0x36')][_0x2644ed])[_0xa383('0x72')];_0x33e177['where'](_0xa383('0x73'),_0x1303b6,_0x5b7cde);}else{if(_0x10afeb[_0xa383('0x36')][_0x2644ed]===_0xa383('0x74')){_0x33e177[_0xa383('0x40')]('i.'+_0x2644ed+_0xa383('0x75'));}else{_0x33e177[_0xa383('0x40')]('i.'+_0x2644ed+_0xa383('0x76'),_0x10afeb[_0xa383('0x36')][_0x2644ed]);}}});}if(_0x10afeb['query'][_0xa383('0x77')]){if(_0x10afeb['query'][_0xa383('0x77')]==0x1){_0x33e177['having'](_0xa383('0x78'));}else{_0x33e177[_0xa383('0x5a')](_0xa383('0x79'));}}if(_0x10afeb['query'][_0xa383('0x7a')]){_0x339bf6=_[_0xa383('0x7b')](_0x10afeb[_0xa383('0x36')][_0xa383('0x7a')])?_0x10afeb['query'][_0xa383('0x7a')]:new Array(_0x10afeb['query'][_0xa383('0x7a')]);_0x339bf6[_0xa383('0x2e')](function(_0x460f4d){_0x2c393b['or'](_0xa383('0x63'),'%,'+_0x460f4d+',%');});}if(_0x10afeb[_0xa383('0x36')][_0xa383('0x7c')]){var _0x381270=_0x10afeb[_0xa383('0x36')][_0xa383('0x7c')]['replace']('\x5c','\x5c\x5c')[_0xa383('0x7d')](/'/g,'\x27\x27');if(qs[_0xa383('0x7e')](_0x381270)){_0x9cbb43['or'](_0xa383('0x7f'),_0x381270+'%')['or'](_0xa383('0x80'),_0x381270+'%');}else{_0x9cbb43['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa383('0x5d')](_0x381270))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x381270+'%');}}}_0x33e177[_0xa383('0x40')](_0x9cbb43);_0x33e177['group'](_0xa383('0x81'));var _0x331108={'type':db['Sequelize'][_0xa383('0x82')][_0xa383('0x83')],'raw':!![]};var _0x14dcfd=_0x33e177['clone']();_0x14dcfd['field']('i.id');_0x14dcfd[_0xa383('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa383('0x58'));if(_0x503cc8[_0xa383('0x3e')]){_0x503cc8['order'][_0xa383('0x2e')](function(_0x4e5021){var _0x37c773=_0x4e5021[0x0]===_0xa383('0x84')?_0x4e5021[0x0]:'i.'+_0x4e5021[0x0];_0x33e177[_0xa383('0x3e')](_0x37c773,_0x4e5021[0x1]===_0xa383('0x85')?![]:!![]);});}if(!_[_0xa383('0x6d')](_0x339bf6)){_0x33e177[_0xa383('0x5a')](_0x2c393b);_0x14dcfd[_0xa383('0x40')](_0xa383('0x86'),_0x339bf6);}BPromise['resolve']()[_0xa383('0x25')](function(){if(!_0x25e61c){if(_0x10afeb['query'][_0xa383('0x87')])return;_0x14dcfd[_0xa383('0x40')](_0xa383('0x88'));_0x33e177[_0xa383('0x40')](_0xa383('0x88'));return;}if(_0x10afeb[_0xa383('0x89')]['role']!==_0xa383('0x8a'))return;return _0x10afeb['user'][_0xa383('0x8b')]({'attributes':['id'],'raw':!![]})[_0xa383('0x25')](function(_0x32fe47){if(_[_0xa383('0x6d')](_0x32fe47)){_0x14dcfd[_0xa383('0x40')](_0xa383('0x8c'));_0x33e177[_0xa383('0x40')](_0xa383('0x8c'));}else{_0x14dcfd[_0xa383('0x40')](_0xa383('0x8d'),_[_0xa383('0x2a')](_0x32fe47,'id'));_0x33e177[_0xa383('0x40')]('i.WhatsappAccountId\x20IN\x20?',_[_0xa383('0x2a')](_0x32fe47,'id'));}});})[_0xa383('0x25')](function(){if(_0x10afeb[_0xa383('0x89')]['role']===_0xa383('0x8a')&&!_0x25e61c&&!_0x10afeb['query'][_0xa383('0x87')])return[];return db[_0xa383('0x8e')][_0xa383('0x36')](_0x14dcfd[_0xa383('0x8f')](),_0x331108);})[_0xa383('0x25')](function(_0x9d99e){_0x50869c[_0xa383('0x1d')]=_0x9d99e['length'];if(_0x50869c[_0xa383('0x1d')]===0x0)return[];return db[_0xa383('0x8e')]['query'](_0x48a387[_0xa383('0x8f')](),_0x331108)[_0xa383('0x25')](function(_0x54b4ab){_0x331f14=_['keyBy'](_0x54b4ab,'id');_0x331108=_['merge'](_0x331108,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10afeb[_0xa383('0x36')][_0xa383('0x3a')]){_0x503cc8[_0xa383('0x39')]['forEach'](function(_0x4a77b4){_0x33e177[_0xa383('0x43')]('i.'+_0x4a77b4);});}else{_0x33e177[_0xa383('0x43')](_0xa383('0x90'),_0xa383('0x58'));_0x33e177[_0xa383('0x43')]('a.key','Account.key');_0x33e177['field']('a.mandatoryDisposition',_0xa383('0x91'));_0x33e177[_0xa383('0x43')](_0xa383('0x92'),_0xa383('0x84'));_0x33e177[_0xa383('0x43')]('i.*');_0x33e177['field'](_0xa383('0x93'),_0xa383('0x94'));_0x33e177[_0xa383('0x43')](_0xa383('0x95'),'Contact.lastName');_0x33e177[_0xa383('0x43')](_0xa383('0x96'),'Contact.email');_0x33e177[_0xa383('0x43')](_0xa383('0x97'),_0xa383('0x98'));_0x33e177[_0xa383('0x43')](_0xa383('0x99'),_0xa383('0x9a'));_0x33e177[_0xa383('0x43')](_0xa383('0x9b'),_0xa383('0x9c'));_0x33e177[_0xa383('0x43')](_0xa383('0x9d'),_0xa383('0x9e'));_0x33e177[_0xa383('0x43')]('o.internal',_0xa383('0x9f'));_0x33e177[_0xa383('0x43')](_0xa383('0xa0'),_0xa383('0x2c'));}if(_0x503cc8['limit'])_0x33e177['limit'](_0x503cc8[_0xa383('0x1c')]);if(_0x503cc8[_0xa383('0x1a')])_0x33e177['offset'](_0x503cc8['offset']);return db[_0xa383('0x8e')][_0xa383('0x36')](_0x33e177[_0xa383('0x8f')](),_0x331108);})[_0xa383('0x25')](function(_0x5cda08){if(_0x5cda08['length']>0x0)_0x3411a3[_0xa383('0x40')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x5cda08,'id'));return db[_0xa383('0x8e')][_0xa383('0x36')](_0x3411a3['toString'](),_0x331108)[_0xa383('0x25')](function(_0x5eb8b9){var _0x1ada9e=_[_0xa383('0xa1')](_0x5eb8b9,_0xa383('0xa2'));var _0x847bd0=[];_0x5cda08[_0xa383('0x2e')](function(_0x4d2270){_0x847bd0[_0xa383('0xa3')](updateWhatsappInteraction(_0x4d2270,_0x331f14,_0x1ada9e));});return BPromise[_0xa383('0xa4')](_0x847bd0);});});})['then'](function(_0x533ac9){_0x50869c['rows']=_0x533ac9;return _0x50869c;})['then'](respondWithFilteredResult(_0x91b4c4,_0x503cc8))['catch'](handleError(_0x91b4c4,null));};exports[_0xa383('0xa5')]=function(_0x582b55,_0x4489d5){var _0x31b2ec={'raw':![],'where':{'id':_0x582b55[_0xa383('0xa6')]['id']}},_0x31f1da={};_0x31f1da['model']=_['keys'](db[_0xa383('0x31')]['rawAttributes']);_0x31f1da[_0xa383('0x36')]=_[_0xa383('0x37')](_0x582b55[_0xa383('0x36')]);_0x31f1da['filters']=_[_0xa383('0x38')](_0x31f1da['model'],_0x31f1da[_0xa383('0x36')]);_0x31b2ec[_0xa383('0x39')]=_[_0xa383('0x38')](_0x31f1da[_0xa383('0x35')],qs[_0xa383('0x3a')](_0x582b55[_0xa383('0x36')][_0xa383('0x3a')]));_0x31b2ec[_0xa383('0x39')]=_0x31b2ec[_0xa383('0x39')][_0xa383('0x3b')]?_0x31b2ec[_0xa383('0x39')]:_0x31f1da[_0xa383('0x35')];if(_0x582b55[_0xa383('0x36')]['includeAll']){_0x31b2ec[_0xa383('0xa7')]=[{'all':!![]}];}_0x31b2ec=_[_0xa383('0xa8')]({},_0x31b2ec,_0x582b55['options']);return db[_0xa383('0x31')]['find'](_0x31b2ec)['then'](handleEntityNotFound(_0x4489d5,null))[_0xa383('0x25')](respondWithResult(_0x4489d5,null))[_0xa383('0xa9')](handleError(_0x4489d5,null));};exports[_0xa383('0xaa')]=function(_0x1fe063,_0x26754b){return db[_0xa383('0x31')][_0xa383('0xaa')](_0x1fe063[_0xa383('0x6a')],{})['then'](respondWithResult(_0x26754b,0xc9))['catch'](handleError(_0x26754b,null));};exports['update']=function(_0x226617,_0x59ce33){if(_0x226617[_0xa383('0x6a')]['id']){delete _0x226617[_0xa383('0x6a')]['id'];}return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x226617[_0xa383('0xa6')]['id']}})[_0xa383('0x25')](handleEntityNotFound(_0x59ce33,null))[_0xa383('0x25')](saveUpdates(_0x226617[_0xa383('0x6a')],null))[_0xa383('0x25')](respondWithResult(_0x59ce33,null))[_0xa383('0xa9')](handleError(_0x59ce33,null));};exports[_0xa383('0x24')]=function(_0x360b84,_0x27b33c){return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x360b84[_0xa383('0xa6')]['id']}})[_0xa383('0x25')](handleEntityNotFound(_0x27b33c,null))[_0xa383('0x25')](removeEntity(_0x27b33c,null))['catch'](handleError(_0x27b33c,null));};exports['describe']=function(_0x198089,_0x7480e4){return db[_0xa383('0x31')]['describe']()['then'](respondWithResult(_0x7480e4,null))[_0xa383('0xa9')](handleError(_0x7480e4,null));};exports[_0xa383('0xac')]=function(_0x2ccc27,_0x131ab3,_0x5e301b){return db[_0xa383('0xad')][_0xa383('0xab')]({'where':{'id':_0x2ccc27[_0xa383('0xa6')]['id']}})['then'](handleEntityNotFound(_0x131ab3,null))[_0xa383('0x25')](function(_0x59c605){if(_0x59c605){return _0x59c605[_0xa383('0xac')](_0x2ccc27['body'][_0xa383('0xae')],_[_0xa383('0xaf')](_0x2ccc27[_0xa383('0x6a')],[_0xa383('0xae'),'id'])||{});}})['then'](respondWithResult(_0x131ab3,null))[_0xa383('0xa9')](handleError(_0x131ab3,null));};exports[_0xa383('0xb0')]=function(_0x595caa,_0x340bdb,_0x381414){var _0x518229={'raw':![],'where':{}};var _0x100d3b={};var _0xadd757={'count':0x0,'rows':[]};return db[_0xa383('0x31')]['findOne']({'where':{'id':_0x595caa['params']['id']}})['then'](handleEntityNotFound(_0x340bdb,null))['then'](function(_0x4582b8){if(_0x4582b8){_0x100d3b['model']=_['keys'](db[_0xa383('0xad')][_0xa383('0xb1')]);_0x100d3b[_0xa383('0x36')]=_[_0xa383('0x37')](_0x595caa['query']);_0x100d3b[_0xa383('0x41')]=_[_0xa383('0x38')](_0x100d3b[_0xa383('0x35')],_0x100d3b[_0xa383('0x36')]);_0x518229[_0xa383('0x39')]=_[_0xa383('0x38')](_0x100d3b[_0xa383('0x35')],qs[_0xa383('0x3a')](_0x595caa[_0xa383('0x36')]['fields']));_0x518229[_0xa383('0x39')]=_0x518229['attributes']['length']?_0x518229['attributes']:_0x100d3b['model'];if(!_0x595caa[_0xa383('0x36')][_0xa383('0x3c')](_0xa383('0x3d'))){_0x518229[_0xa383('0x1c')]=qs['limit'](_0x595caa['query'][_0xa383('0x1c')]);_0x518229[_0xa383('0x1a')]=qs[_0xa383('0x1a')](_0x595caa[_0xa383('0x36')][_0xa383('0x1a')]);}_0x518229[_0xa383('0x3e')]=qs[_0xa383('0x3f')](_0x595caa[_0xa383('0x36')][_0xa383('0x3f')]);_0x518229[_0xa383('0x40')]=qs[_0xa383('0x41')](_['pick'](_0x595caa[_0xa383('0x36')],_0x100d3b['filters']));_0x518229[_0xa383('0x40')]['WhatsappInteractionId']=_0x4582b8['id'];if(_0x595caa[_0xa383('0x36')][_0xa383('0x7c')]){_0x518229['where']=_[_0xa383('0xa8')](_0x518229['where'],{'$or':_[_0xa383('0x2a')](_0x518229[_0xa383('0x39')],function(_0x34d251){var _0x57baaa={};_0x57baaa[_0x34d251]={'$like':'%'+_0x595caa[_0xa383('0x36')]['filter']+'%'};return _0x57baaa;})});}if(_0x595caa['query'][_0xa383('0x71')]){var _0xa0db57=_0x595caa[_0xa383('0x36')]['$gte'][_0xa383('0x2d')](',');var _0x2103c7={};_0x2103c7[_0xa0db57[0x0]]={'$gte':moment(_0xa0db57[0x1])[_0xa383('0xb2')](_0xa383('0xb3'))};_0x518229[_0xa383('0x40')]=_[_0xa383('0xa8')](_0x518229[_0xa383('0x40')],_0x2103c7);}_0x518229=_['merge']({},_0x518229,_0x595caa[_0xa383('0xb4')]);return db[_0xa383('0xad')][_0xa383('0x1d')]({'where':_0x518229[_0xa383('0x40')]})[_0xa383('0x25')](function(_0x57ac29){_0xadd757[_0xa383('0x1d')]=_0x57ac29;if(_0x595caa['query'][_0xa383('0xb5')]){_0x518229[_0xa383('0xa7')]=[{'all':!![]}];}return db[_0xa383('0xad')][_0xa383('0xb6')](_0x518229);})[_0xa383('0x25')](function(_0x2f27e3){_0xadd757[_0xa383('0xb7')]=_0x2f27e3;return _0xadd757;});}})[_0xa383('0x25')](respondWithFilteredResult(_0x340bdb,_0x518229))[_0xa383('0xa9')](handleError(_0x340bdb,null));};exports[_0xa383('0xb8')]=function(_0x2316e8,_0x33fc6e,_0xee3240){return db[_0xa383('0x31')]['find']({'where':{'id':_0x2316e8[_0xa383('0xa6')]['id']}})[_0xa383('0x25')](handleEntityNotFound(_0x33fc6e,null))['then'](function(_0x10d656){if(_0x10d656){return _0x10d656['setTags'](_0x2316e8[_0xa383('0x6a')][_0xa383('0xae')],_['omit'](_0x2316e8[_0xa383('0x6a')],['ids','id'])||{})[_0xa383('0xb9')](function(){return db[_0xa383('0x62')][_0xa383('0xb6')]({'attributes':['id',_0xa383('0x29'),'color'],'where':{'id':_0x2316e8['body'][_0xa383('0xae')]}});})['then'](function(_0x1ebd88){socket[_0xa383('0xba')](_0xa383('0xbb'),{'id':Number(_0x2316e8['params']['id']),'tags':_0x1ebd88||[]});return{'id':Number(_0x2316e8[_0xa383('0xa6')]['id']),'tags':_0x1ebd88||[]};});}})[_0xa383('0x25')](respondWithResult(_0x33fc6e,null))[_0xa383('0xa9')](handleError(_0x33fc6e,null));};exports[_0xa383('0xbc')]=function(_0x1e17bd,_0x4e143d,_0x548946){return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x1e17bd[_0xa383('0xa6')]['id']}})['then'](handleEntityNotFound(_0x4e143d,null))[_0xa383('0x25')](function(_0x1af3c6){if(_0x1af3c6){return _0x1af3c6['removeTags'](_0x1e17bd[_0xa383('0x36')][_0xa383('0xae')]);}})['then'](respondWithStatusCode(_0x4e143d,null))[_0xa383('0xa9')](handleError(_0x4e143d,null));};exports[_0xa383('0xbd')]=function(_0x1f9134,_0x469fa7){var _0x194db4=moment()[_0xa383('0xbe')]()[_0xa383('0x8f')]();var _0x3b32a8=path[_0xa383('0xbf')](config[_0xa383('0xc0')],'server',_0xa383('0xc1'),_0xa383('0xc2'));var _0x24b59b=path[_0xa383('0xbf')](config[_0xa383('0xc0')],'server','files',_0xa383('0xc3'));var _0xf17630=path['join'](_0x3b32a8,_0x194db4);var _0x27dc5b=util['format'](_0xa383('0xc4'),_0x1f9134[_0xa383('0xa6')]['id'],_0x194db4);var _0x50c551=path[_0xa383('0xbf')](_0x3b32a8,_0x27dc5b);var _0x38a26c=[];_0x38a26c[_0xa383('0xa3')]({'model':db[_0xa383('0x64')],'as':_0xa383('0x64'),'attributes':['id','fullname'],'raw':!![]});_0x38a26c['push']({'model':db[_0xa383('0xc5')],'as':'Contact','attributes':['id',_0xa383('0xc6'),_0xa383('0xc7')],'raw':!![]});if(_0x1f9134['query'][_0xa383('0xc3')]){_0x38a26c[_0xa383('0xa3')]({'model':db[_0xa383('0xc8')],'as':_0xa383('0xc8'),'raw':!![]});}var _0x4fae25=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xa383('0x6a'),_0xa383('0x6f'),_0xa383('0xc9'),_0xa383('0xca'),_0xa383('0x77')],'include':_0x38a26c}];_0x4fae25[_0xa383('0xa3')]({'model':db[_0xa383('0xcb')],'as':_0xa383('0xcc'),'attributes':['id',_0xa383('0x29')]});_0x4fae25[_0xa383('0xa3')]({'model':db[_0xa383('0x64')],'as':'Owner','attributes':['id',_0xa383('0x2b')]});return db[_0xa383('0x31')][_0xa383('0xab')]({'where':{'id':_0x1f9134[_0xa383('0xa6')]['id']},'include':_0x4fae25})['then'](handleEntityNotFound(_0x469fa7,null))[_0xa383('0x25')](function(_0x2af097){if(_0x2af097){var _0x7fdae0=_0x2af097[_0xa383('0xcd')]({'plain':!![]});fs[_0xa383('0xce')](_0xf17630);var _0x2cb356={'channel':_0xa383('0xcf'),'account':_0x7fdae0[_0xa383('0xcc')][_0xa383('0x29')],'agent':_0x7fdae0[_0xa383('0xd0')]?_0x7fdae0[_0xa383('0xd0')][_0xa383('0x2b')]:_0xa383('0xd1'),'createdAt':moment(_0x7fdae0[_0xa383('0x6f')])[_0xa383('0xb2')](_0xa383('0xb3'))['toString'](),'closedAt':_0x7fdae0[_0xa383('0xd2')]?moment(_0x7fdae0['closedAt'])['format'](_0xa383('0xb3'))[_0xa383('0x8f')]():'','disposition':_0x7fdae0[_0xa383('0xd3')],'messages':_(_0x7fdae0[_0xa383('0xd4')])[_0xa383('0x7c')]({'secret':![]})['map'](function(_0x1eb1e7){if(_0x1eb1e7[_0xa383('0xc8')]){var _0x13497d=path[_0xa383('0xbf')](_0x24b59b,_0x1eb1e7['Attachment'][_0xa383('0xd5')]);if(fs[_0xa383('0xd6')](_0x13497d)){fs[_0xa383('0xd7')](_0x13497d)[_0xa383('0xd8')](fs[_0xa383('0xd9')](path[_0xa383('0xbf')](_0xf17630,_0x1eb1e7[_0xa383('0xc8')][_0xa383('0xd5')])));}}return{'date':moment(_0x1eb1e7[_0xa383('0x6f')])['format'](_0xa383('0xb3'))['toString'](),'sender':_0x1eb1e7[_0xa383('0xc9')]===_0xa383('0xda')?_0x1eb1e7[_0xa383('0x64')]?_0x1eb1e7[_0xa383('0x64')][_0xa383('0x2b')]:_0xa383('0xdb'):_0x1eb1e7[_0xa383('0x5c')]['firstName']+(_0x1eb1e7[_0xa383('0x5c')][_0xa383('0xc7')]?'\x20'+_0x1eb1e7[_0xa383('0x5c')][_0xa383('0xc7')]:''),'body':_0x1eb1e7['Attachment']?_0x1eb1e7[_0xa383('0xc8')][_0xa383('0xd5')]:_0x1eb1e7[_0xa383('0x6a')],'direction':_0x1eb1e7[_0xa383('0xc9')]==='out'?'A':'C','secret':_0x1eb1e7[_0xa383('0xca')],'read':_0x1eb1e7[_0xa383('0x77')],'attachment':_0x1eb1e7['Attachment']};})[_0xa383('0x59')]()};return ejs['renderFile'](path[_0xa383('0xbf')](config[_0xa383('0xc0')],_0xa383('0xdc'),'views',_0xa383('0xdd')),{'interaction':_0x2cb356})[_0xa383('0x25')](function(_0xd69118){var _0x4d6768=path[_0xa383('0xbf')](_0xf17630,'transcript-'+_0x7fdae0['id']+'-'+_0x194db4+_0xa383('0xde'));var _0xef5e47={'path':_0x4d6768,'channel':_0xa383('0xcf'),'interactionId':_0x7fdae0['id']};return pdf[_0xa383('0xdf')](_0xd69118,_0xef5e47);})[_0xa383('0x25')](function(){return new BPromise(function(_0x219f4b,_0x2c1ec4){zipdir(_0xf17630,{'saveTo':_0x50c551},function(_0x2e5107,_0x416b61){if(_0x2e5107)return _0x2c1ec4(_0x2e5107);return _0x219f4b(_0x416b61);});})[_0xa383('0x25')](function(){return new BPromise(function(_0x10aba5,_0x5565ab){rimraf(_0xf17630,function(_0x5f0c07){if(_0x5f0c07)_0x5565ab(_0x5f0c07);return _0x10aba5();});});})[_0xa383('0x25')](function(){return _0x469fa7[_0xa383('0xbd')](_0x50c551,_0x27dc5b,function(_0x4be491){if(_0x4be491){console[_0xa383('0xe0')]('err',_0x4be491);}else{fs[_0xa383('0xe1')](_0x50c551);}});});});}else{return _0x469fa7[_0xa383('0x26')](0xc8);}})['catch'](handleError(_0x469fa7,null));}; \ No newline at end of file +var _0x7e16=['`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','clone','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','rows','catch','params','include','create','describe','addMessage','omit','getMessages','findOne','pick','WhatsappInteractionId','format','options','WhatsappMessage','includeAll','ids','spread','findAll','emit','whatsappInteractionTags:save','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','fullname','CmContact','Contact','firstName','Attachment','direction','secret','WhatsappAccount','get','Whatsapp','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','basename','existsSync','pipe','out','System','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','TagIds','Tags','split','forEach','push','map','WhatsappInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','select','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200'];(function(_0x376bd7,_0x107c2d){var _0x50dcf1=function(_0x4e65ea){while(--_0x4e65ea){_0x376bd7['push'](_0x376bd7['shift']());}};_0x50dcf1(++_0x107c2d);}(_0x7e16,0x16f));var _0x67e1=function(_0x5a5c06,_0x2749dd){_0x5a5c06=_0x5a5c06-0x0;var _0x14f2f2=_0x7e16[_0x5a5c06];return _0x14f2f2;};'use strict';var emlformat=require(_0x67e1('0x0'));var rimraf=require(_0x67e1('0x1'));var zipdir=require(_0x67e1('0x2'));var jsonpatch=require(_0x67e1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67e1('0x4'));var Mustache=require('mustache');var util=require(_0x67e1('0x5'));var path=require(_0x67e1('0x6'));var sox=require('sox');var csv=require(_0x67e1('0x7'));var ejs=require(_0x67e1('0x8'));var fs=require('fs');var fs_extra=require(_0x67e1('0x9'));var _=require(_0x67e1('0xa'));var squel=require(_0x67e1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67e1('0x7'));var querystring=require(_0x67e1('0xc'));var Papa=require(_0x67e1('0xd'));var Redis=require(_0x67e1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x67e1('0xf'));var as=require(_0x67e1('0x10'));var pdf=require(_0x67e1('0x11'));var hardwareService=require(_0x67e1('0x12'));var logger=require('../../config/logger')(_0x67e1('0x13'));var utils=require('../../config/utils');var config=require(_0x67e1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x67e1('0x15')]=_[_0x67e1('0x16')](config[_0x67e1('0x15')],{'host':_0x67e1('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67e1('0x15')]));require(_0x67e1('0x18'))[_0x67e1('0x19')](socket);function respondWithStatusCode(_0x4c2e34,_0x208013){_0x208013=_0x208013||0xcc;return function(_0x2cb7c1){if(_0x2cb7c1){return _0x4c2e34[_0x67e1('0x1a')](_0x208013);}return _0x4c2e34[_0x67e1('0x1b')](_0x208013)[_0x67e1('0x1c')]();};}function respondWithResult(_0x45b9df,_0x216ad4){_0x216ad4=_0x216ad4||0xc8;return function(_0x406ffe){if(_0x406ffe){return _0x45b9df[_0x67e1('0x1b')](_0x216ad4)[_0x67e1('0x1d')](_0x406ffe);}};}function respondWithFilteredResult(_0x577400,_0x14ab29){return function(_0x9e931d){if(_0x9e931d){var _0x2c36b8=typeof _0x14ab29['offset']==='undefined'&&typeof _0x14ab29['limit']===_0x67e1('0x1e');var _0xaabf4f=_0x9e931d[_0x67e1('0x1f')];var _0x31b9cc=_0x2c36b8?0x0:_0x14ab29['offset'];var _0x39807c=_0x2c36b8?_0x9e931d[_0x67e1('0x1f')]:_0x14ab29[_0x67e1('0x20')]+_0x14ab29[_0x67e1('0x21')];var _0x5b3c79;if(_0x39807c>=_0xaabf4f){_0x39807c=_0xaabf4f;_0x5b3c79=0xc8;}else{_0x5b3c79=0xce;}_0x577400[_0x67e1('0x1b')](_0x5b3c79);return _0x577400[_0x67e1('0x22')](_0x67e1('0x23'),_0x31b9cc+'-'+_0x39807c+'/'+_0xaabf4f)[_0x67e1('0x1d')](_0x9e931d);}return null;};}function patchUpdates(_0xcd4943){return function(_0x2a627d){try{jsonpatch[_0x67e1('0x24')](_0x2a627d,_0xcd4943,!![]);}catch(_0x571930){return BPromise[_0x67e1('0x25')](_0x571930);}return _0x2a627d[_0x67e1('0x26')]();};}function saveUpdates(_0xa44c7b,_0x1cae53){return function(_0x343cd7){if(_0x343cd7){return _0x343cd7[_0x67e1('0x27')](_0xa44c7b)[_0x67e1('0x28')](function(_0x274b69){return _0x274b69;});}return null;};}function removeEntity(_0x25e094,_0x2fc2be){return function(_0x59ae5e){if(_0x59ae5e){return _0x59ae5e[_0x67e1('0x29')]()[_0x67e1('0x28')](function(){_0x25e094[_0x67e1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1778ec,_0x5ddb2f){return function(_0x2d19a4){if(!_0x2d19a4){_0x1778ec[_0x67e1('0x1a')](0x194);}return _0x2d19a4;};}function handleError(_0x1e14b7,_0x544371){_0x544371=_0x544371||0x1f4;return function(_0x710c50){logger['error'](_0x710c50[_0x67e1('0x2a')]);if(_0x710c50[_0x67e1('0x2b')]){delete _0x710c50['name'];}_0x1e14b7[_0x67e1('0x1b')](_0x544371)[_0x67e1('0x2c')](_0x710c50);};}function getInteractionUsers(_0x1bbe01,_0x1fd992){return new BPromise(function(_0x226851,_0x4594d1){try{if(_0x1fd992[_0x1bbe01['id']]){_0x1bbe01['Users']=_['map'](_0x1fd992[_0x1bbe01['id']],function(_0x5343a6){return{'id':_0x5343a6['id'],'fullname':_0x5343a6['fullname']};});}}catch(_0x3a7d56){_0x4594d1(_0x3a7d56);}_0x226851(_0x1bbe01);});}function getInteractionTags(_0x2f347b,_0x4928b6){return new BPromise(function(_0x1b8cd8,_0x294a62){try{if(_0x2f347b[_0x67e1('0x2d')]){_0x2f347b[_0x67e1('0x2e')]=[];_0x2f347b[_0x67e1('0x2d')][_0x67e1('0x2f')](',')[_0x67e1('0x30')](function(_0x32a86f){_0x2f347b['Tags'][_0x67e1('0x31')](_0x4928b6[_0x32a86f]);});}delete _0x2f347b['TagIds'];}catch(_0x2d5850){_0x294a62(_0x2d5850);}_0x1b8cd8(_0x2f347b);});}function updateWhatsappInteraction(_0x4928a1,_0x34c624,_0x58df77){return new BPromise(function(_0x46638,_0x1034f2){return getInteractionUsers(_0x4928a1,_0x58df77)['then'](function(_0x4ab9bb){return getInteractionTags(_0x4ab9bb,_0x34c624);})['then'](function(_0x2f4e9a){_0x46638(_0x2f4e9a);})['catch'](function(_0x3aab7d){_0x1034f2(_0x3aab7d);});});}exports['index']=function(_0x110767,_0x4eb6fb){var _0x5ca771={},_0x1e77de={},_0x1e2144={'count':0x0,'rows':[]};var _0x5216a0=_[_0x67e1('0x32')](db[_0x67e1('0x33')][_0x67e1('0x34')],function(_0x184862){return{'name':_0x184862[_0x67e1('0x35')],'type':_0x184862[_0x67e1('0x36')][_0x67e1('0x37')]};});_0x1e77de['model']=_[_0x67e1('0x32')](_0x5216a0,_0x67e1('0x2b'));_0x1e77de['query']=_[_0x67e1('0x38')](_0x110767[_0x67e1('0x39')]);_0x1e77de[_0x67e1('0x3a')]=_[_0x67e1('0x3b')](_0x1e77de[_0x67e1('0x3c')],_0x1e77de[_0x67e1('0x39')]);_0x5ca771[_0x67e1('0x3d')]=_[_0x67e1('0x3b')](_0x1e77de[_0x67e1('0x3c')],qs[_0x67e1('0x3e')](_0x110767[_0x67e1('0x39')][_0x67e1('0x3e')]));_0x5ca771[_0x67e1('0x3d')]=_0x5ca771[_0x67e1('0x3d')][_0x67e1('0x3f')]?_0x5ca771[_0x67e1('0x3d')]:_0x1e77de[_0x67e1('0x3c')];if(!_0x110767[_0x67e1('0x39')][_0x67e1('0x40')](_0x67e1('0x41'))){_0x5ca771[_0x67e1('0x21')]=qs[_0x67e1('0x21')](_0x110767[_0x67e1('0x39')]['limit']);_0x5ca771[_0x67e1('0x20')]=qs['offset'](_0x110767['query'][_0x67e1('0x20')]);}_0x5ca771[_0x67e1('0x42')]=qs[_0x67e1('0x43')](_0x110767[_0x67e1('0x39')][_0x67e1('0x43')]);_0x5ca771[_0x67e1('0x44')]=qs[_0x67e1('0x3a')](_['pick'](_0x110767[_0x67e1('0x39')],_0x1e77de[_0x67e1('0x3a')]),_0x5216a0);var _0x27b7c6=[];var _0x46cacb=squel['select']()['field']('id')['field'](_0x67e1('0x2b'))[_0x67e1('0x45')](_0x67e1('0x46'))[_0x67e1('0x47')]('tools_tags');var _0x5ee633=squel[_0x67e1('0x48')]()[_0x67e1('0x45')](_0x67e1('0x49'))[_0x67e1('0x45')](_0x67e1('0x4a'))['field']('ui.WhatsappInteractionId')[_0x67e1('0x47')](_0x67e1('0x4b'),'ui')[_0x67e1('0x4c')](_0x67e1('0x4d'),'u',_0x67e1('0x4e'));var _0x3deb38=squel['select']()[_0x67e1('0x47')](_0x67e1('0x4f'),'i')['left_join'](_0x67e1('0x50'),'c',_0x67e1('0x51'))['left_join']('users','o',_0x67e1('0x52'))[_0x67e1('0x4c')](_0x67e1('0x53'),'a',_0x67e1('0x54'))[_0x67e1('0x4c')](_0x67e1('0x55'),'me',_0x67e1('0x56'))[_0x67e1('0x4c')](_0x67e1('0x57'),'it',_0x67e1('0x58'))['left_join'](_0x67e1('0x59'),'t','t.id\x20=\x20it.TagId');var _0x3f2be2=squel['expr']();var _0x226425=[];var _0x557bc2=squel[_0x67e1('0x5a')]();var _0x4b7c72;if(_0x110767[_0x67e1('0x39')]['search']){_0x4b7c72=as[_0x67e1('0x5b')](_0x110767[_0x67e1('0x39')][_0x67e1('0x5c')]);var _0x186020=_0x4b7c72[_0x67e1('0x5d')];for(var _0x37e809=0x0;_0x37e809<_0x4b7c72[_0x67e1('0x5e')][_0x67e1('0x3f')];_0x37e809++){var _0x52f08c=_0x4b7c72[_0x67e1('0x5e')][_0x37e809];var _0x359879='i';var _0x245c03=_[_0x67e1('0x5f')](_0x5216a0,[_0x67e1('0x2b'),_0x52f08c['field']]);if(!_0x245c03){switch(_0x52f08c[_0x67e1('0x45')]){case _0x67e1('0x60'):if(_0x52f08c['value']==0x1){_0x3deb38[_0x67e1('0x61')]('`'+_0x52f08c[_0x67e1('0x45')]+_0x67e1('0x62'));}else{_0x3deb38[_0x67e1('0x61')]('`'+_0x52f08c[_0x67e1('0x45')]+_0x67e1('0x63'));}break;case'Contact':if(_0x52f08c[_0x67e1('0x64')]===_0x67e1('0x65')){if(_0x52f08c[_0x67e1('0x66')][_0x67e1('0x2f')]('\x20')[_0x67e1('0x3f')]>0x1){_0x3f2be2[_0x186020](_0x67e1('0x67'),qs[_0x67e1('0x68')](_0x52f08c[_0x67e1('0x66')]),null);}else{var _0xad2116='%'+_0x52f08c[_0x67e1('0x66')]+'%';_0x3f2be2[_0x186020](_0x67e1('0x69'),_0xad2116,_0xad2116,_0xad2116);}}else{_0x245c03=_[_0x67e1('0x5f')](_0x5216a0,['name','ContactId']);_0x52f08c[_0x67e1('0x45')]=_0x67e1('0x6a');_0x783ea4=as[_0x67e1('0x6b')](_0x359879,_0x245c03[_0x67e1('0x36')],_0x52f08c);_0x3f2be2[_0x186020](_0x783ea4[_0x67e1('0x6c')],_0x783ea4[_0x67e1('0x66')][_0x67e1('0x6d')],_0x783ea4[_0x67e1('0x66')][_0x67e1('0x1c')]);}break;case _0x67e1('0x6e'):var _0x251681=_0x52f08c[_0x67e1('0x66')][_0x67e1('0x2f')](',')['map'](function(_0x102584){return Number(_0x102584);});_0x251681[_0x67e1('0x30')](function(_0x2cc6ab){_0x557bc2['or'](_0x67e1('0x6f'),'%,'+_0x2cc6ab+',%');});_0x226425=_[_0x67e1('0x70')](_0x226425,_0x251681);break;case _0x67e1('0x71'):if(_0x52f08c[_0x67e1('0x64')]==='$substring'){_0x3f2be2[_0x186020](_0x67e1('0x72'),'%'+_0x52f08c[_0x67e1('0x66')]+'%',null);}else{_0x245c03=_[_0x67e1('0x5f')](_0x5216a0,[_0x67e1('0x2b'),_0x67e1('0x73')]);_0x52f08c[_0x67e1('0x45')]='UserId';_0x783ea4=as[_0x67e1('0x6b')](_0x359879,_0x245c03[_0x67e1('0x36')],_0x52f08c);_0x3f2be2[_0x186020](_0x783ea4[_0x67e1('0x6c')],_0x783ea4['value'][_0x67e1('0x6d')],_0x783ea4[_0x67e1('0x66')]['end']);}break;case _0x67e1('0x74'):_0x783ea4=as['buildExpression']('me',null,_0x52f08c);_0x3f2be2[_0x186020](_0x783ea4[_0x67e1('0x6c')],_0x783ea4[_0x67e1('0x66')][_0x67e1('0x6d')],_0x783ea4[_0x67e1('0x66')][_0x67e1('0x1c')]);break;}}else{var _0x783ea4=as['buildExpression'](_0x359879,_0x245c03['type'],_0x52f08c);_0x3f2be2[_0x186020](_0x783ea4[_0x67e1('0x6c')],_0x783ea4['value'][_0x67e1('0x6d')],_0x783ea4[_0x67e1('0x66')][_0x67e1('0x1c')]);}}}else{var _0x181678=_(_0x110767['query'])[_0x67e1('0x38')]()[_0x67e1('0x32')](function(_0x45af3c){return _[_0x67e1('0x75')](_0x5216a0,[_0x67e1('0x2b'),_0x45af3c])?_0x45af3c:undefined;})[_0x67e1('0x76')]()['value']();if(!_[_0x67e1('0x77')](_0x181678)){_0x181678[_0x67e1('0x30')](function(_0x289f07){if(_0x289f07===_0x67e1('0x78')){_0x3deb38[_0x67e1('0x44')](_0x67e1('0x79'),[][_0x67e1('0x7a')](_0x110767[_0x67e1('0x39')][_0x289f07]));}else if(_0x289f07===_0x67e1('0x7b')){var _0x20017a=JSON[_0x67e1('0x7c')](_0x110767['query'][_0x289f07])[_0x67e1('0x7d')];var _0x512371=JSON[_0x67e1('0x7c')](_0x110767[_0x67e1('0x39')][_0x289f07])[_0x67e1('0x7e')];_0x3deb38[_0x67e1('0x44')](_0x67e1('0x7f'),_0x20017a,_0x512371);}else{if(_0x110767[_0x67e1('0x39')][_0x289f07]===_0x67e1('0x80')){_0x3deb38[_0x67e1('0x44')]('i.'+_0x289f07+_0x67e1('0x81'));}else{_0x3deb38['where']('i.'+_0x289f07+_0x67e1('0x82'),_0x110767['query'][_0x289f07]);}}});}if(_0x110767[_0x67e1('0x39')][_0x67e1('0x83')]){if(_0x110767[_0x67e1('0x39')][_0x67e1('0x83')]==0x1){_0x3deb38[_0x67e1('0x61')](_0x67e1('0x84'));}else{_0x3deb38[_0x67e1('0x61')](_0x67e1('0x85'));}}if(_0x110767[_0x67e1('0x39')][_0x67e1('0x86')]){_0x226425=_['isArray'](_0x110767[_0x67e1('0x39')][_0x67e1('0x86')])?_0x110767[_0x67e1('0x39')]['tag']:new Array(_0x110767['query'][_0x67e1('0x86')]);_0x226425[_0x67e1('0x30')](function(_0x2a5a76){_0x557bc2['or'](_0x67e1('0x6f'),'%,'+_0x2a5a76+',%');});}if(_0x110767[_0x67e1('0x39')][_0x67e1('0x87')]){var _0xabd4=_0x110767[_0x67e1('0x39')]['filter']['replace']('\x5c','\x5c\x5c')[_0x67e1('0x88')](/'/g,'\x27\x27');if(qs[_0x67e1('0x89')](_0xabd4)){_0x3f2be2['or']('i.id\x20LIKE\x20?',_0xabd4+'%')['or'](_0x67e1('0x8a'),_0xabd4+'%');}else{_0x3f2be2['or'](_0x67e1('0x8b'),qs[_0x67e1('0x68')](_0xabd4))['or'](_0x67e1('0x8c'),_0xabd4+'%');}}}_0x3deb38[_0x67e1('0x44')](_0x3f2be2);_0x3deb38['group'](_0x67e1('0x8d'));var _0x32c5fb={'type':db[_0x67e1('0x8e')]['QueryTypes']['SELECT'],'raw':!![]};var _0x541b5f=_0x3deb38[_0x67e1('0x8f')]();_0x541b5f[_0x67e1('0x45')](_0x67e1('0x8d'));_0x541b5f[_0x67e1('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x67e1('0x60'));if(_0x5ca771[_0x67e1('0x42')]){_0x5ca771['order'][_0x67e1('0x30')](function(_0x384a0d){var _0x189bba=_0x384a0d[0x0]===_0x67e1('0x90')?_0x384a0d[0x0]:'i.'+_0x384a0d[0x0];_0x3deb38[_0x67e1('0x42')](_0x189bba,_0x384a0d[0x1]==='DESC'?![]:!![]);});}if(!_[_0x67e1('0x77')](_0x226425)){_0x3deb38[_0x67e1('0x61')](_0x557bc2);_0x541b5f[_0x67e1('0x44')](_0x67e1('0x91'),_0x226425);}BPromise[_0x67e1('0x92')]()[_0x67e1('0x28')](function(){if(!_0x4b7c72){if(_0x110767['query'][_0x67e1('0x78')])return;_0x541b5f[_0x67e1('0x44')](_0x67e1('0x93'));_0x3deb38[_0x67e1('0x44')](_0x67e1('0x93'));return;}if(_0x110767[_0x67e1('0x94')][_0x67e1('0x95')]!==_0x67e1('0x96'))return;return _0x110767['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x67e1('0x28')](function(_0x14eae8){if(_[_0x67e1('0x77')](_0x14eae8)){_0x541b5f[_0x67e1('0x44')](_0x67e1('0x97'));_0x3deb38[_0x67e1('0x44')](_0x67e1('0x97'));}else{_0x541b5f[_0x67e1('0x44')]('i.WhatsappAccountId\x20IN\x20?',_[_0x67e1('0x32')](_0x14eae8,'id'));_0x3deb38[_0x67e1('0x44')](_0x67e1('0x79'),_[_0x67e1('0x32')](_0x14eae8,'id'));}});})[_0x67e1('0x28')](function(){if(_0x110767[_0x67e1('0x94')][_0x67e1('0x95')]===_0x67e1('0x96')&&!_0x4b7c72&&!_0x110767[_0x67e1('0x39')][_0x67e1('0x78')])return[];return db[_0x67e1('0x98')][_0x67e1('0x39')](_0x541b5f[_0x67e1('0x99')](),_0x32c5fb);})[_0x67e1('0x28')](function(_0x4fb856){_0x1e2144['count']=_0x4fb856[_0x67e1('0x3f')];if(_0x1e2144['count']===0x0)return[];return db[_0x67e1('0x98')]['query'](_0x46cacb['toString'](),_0x32c5fb)[_0x67e1('0x28')](function(_0x3e0523){_0x27b7c6=_[_0x67e1('0x9a')](_0x3e0523,'id');_0x32c5fb=_[_0x67e1('0x9b')](_0x32c5fb,{'model':db[_0x67e1('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x110767[_0x67e1('0x39')]['fields']){_0x5ca771['attributes']['forEach'](function(_0x137ab8){_0x3deb38[_0x67e1('0x45')]('i.'+_0x137ab8);});}else{_0x3deb38['field'](_0x67e1('0x9c'),_0x67e1('0x60'));_0x3deb38['field'](_0x67e1('0x9d'),'Account.key');_0x3deb38[_0x67e1('0x45')](_0x67e1('0x9e'),_0x67e1('0x9f'));_0x3deb38[_0x67e1('0x45')](_0x67e1('0xa0'),_0x67e1('0x90'));_0x3deb38[_0x67e1('0x45')](_0x67e1('0xa1'));_0x3deb38[_0x67e1('0x45')](_0x67e1('0xa2'),_0x67e1('0xa3'));_0x3deb38['field']('c.lastName',_0x67e1('0xa4'));_0x3deb38[_0x67e1('0x45')](_0x67e1('0xa5'),_0x67e1('0xa6'));_0x3deb38[_0x67e1('0x45')]('c.phone',_0x67e1('0xa7'));_0x3deb38['field'](_0x67e1('0xa8'),_0x67e1('0xa9'));_0x3deb38[_0x67e1('0x45')](_0x67e1('0xaa'),_0x67e1('0xab'));_0x3deb38[_0x67e1('0x45')]('o.fullname',_0x67e1('0xac'));_0x3deb38['field'](_0x67e1('0xad'),_0x67e1('0xae'));_0x3deb38[_0x67e1('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x67e1('0x2d'));}if(_0x5ca771[_0x67e1('0x21')])_0x3deb38[_0x67e1('0x21')](_0x5ca771[_0x67e1('0x21')]);if(_0x5ca771['offset'])_0x3deb38[_0x67e1('0x20')](_0x5ca771[_0x67e1('0x20')]);return db[_0x67e1('0x98')]['query'](_0x3deb38[_0x67e1('0x99')](),_0x32c5fb);})[_0x67e1('0x28')](function(_0x1ebc34){if(_0x1ebc34[_0x67e1('0x3f')]>0x0)_0x5ee633[_0x67e1('0x44')](_0x67e1('0xaf'),_['map'](_0x1ebc34,'id'));return db[_0x67e1('0x98')][_0x67e1('0x39')](_0x5ee633[_0x67e1('0x99')](),_0x32c5fb)[_0x67e1('0x28')](function(_0x5c0e54){var _0x5cec09=_['groupBy'](_0x5c0e54,'WhatsappInteractionId');var _0x5e99bb=[];_0x1ebc34[_0x67e1('0x30')](function(_0x5c7c46){_0x5e99bb[_0x67e1('0x31')](updateWhatsappInteraction(_0x5c7c46,_0x27b7c6,_0x5cec09));});return BPromise['all'](_0x5e99bb);});});})['then'](function(_0x2c65e1){_0x1e2144[_0x67e1('0xb0')]=_0x2c65e1;return _0x1e2144;})[_0x67e1('0x28')](respondWithFilteredResult(_0x4eb6fb,_0x5ca771))[_0x67e1('0xb1')](handleError(_0x4eb6fb,null));};exports['show']=function(_0x1f4062,_0x460b2a){var _0xa33cdf={'raw':![],'where':{'id':_0x1f4062[_0x67e1('0xb2')]['id']}},_0x45eefa={};_0x45eefa[_0x67e1('0x3c')]=_['keys'](db[_0x67e1('0x33')][_0x67e1('0x34')]);_0x45eefa['query']=_[_0x67e1('0x38')](_0x1f4062[_0x67e1('0x39')]);_0x45eefa[_0x67e1('0x3a')]=_['intersection'](_0x45eefa['model'],_0x45eefa['query']);_0xa33cdf['attributes']=_[_0x67e1('0x3b')](_0x45eefa[_0x67e1('0x3c')],qs[_0x67e1('0x3e')](_0x1f4062[_0x67e1('0x39')]['fields']));_0xa33cdf[_0x67e1('0x3d')]=_0xa33cdf[_0x67e1('0x3d')][_0x67e1('0x3f')]?_0xa33cdf[_0x67e1('0x3d')]:_0x45eefa[_0x67e1('0x3c')];if(_0x1f4062[_0x67e1('0x39')]['includeAll']){_0xa33cdf[_0x67e1('0xb3')]=[{'all':!![]}];}_0xa33cdf=_['merge']({},_0xa33cdf,_0x1f4062['options']);return db[_0x67e1('0x33')]['find'](_0xa33cdf)[_0x67e1('0x28')](handleEntityNotFound(_0x460b2a,null))['then'](respondWithResult(_0x460b2a,null))[_0x67e1('0xb1')](handleError(_0x460b2a,null));};exports[_0x67e1('0xb4')]=function(_0x6283eb,_0x807c5){return db[_0x67e1('0x33')][_0x67e1('0xb4')](_0x6283eb['body'],{})[_0x67e1('0x28')](respondWithResult(_0x807c5,0xc9))[_0x67e1('0xb1')](handleError(_0x807c5,null));};exports[_0x67e1('0x27')]=function(_0x1649a4,_0x23766e){if(_0x1649a4[_0x67e1('0x74')]['id']){delete _0x1649a4[_0x67e1('0x74')]['id'];}return db[_0x67e1('0x33')][_0x67e1('0x5f')]({'where':{'id':_0x1649a4[_0x67e1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x23766e,null))['then'](saveUpdates(_0x1649a4[_0x67e1('0x74')],null))[_0x67e1('0x28')](respondWithResult(_0x23766e,null))[_0x67e1('0xb1')](handleError(_0x23766e,null));};exports[_0x67e1('0x29')]=function(_0x12c84b,_0x26a50d){return db['WhatsappInteraction']['find']({'where':{'id':_0x12c84b[_0x67e1('0xb2')]['id']}})[_0x67e1('0x28')](handleEntityNotFound(_0x26a50d,null))[_0x67e1('0x28')](removeEntity(_0x26a50d,null))[_0x67e1('0xb1')](handleError(_0x26a50d,null));};exports[_0x67e1('0xb5')]=function(_0x2a8130,_0x380b68){return db[_0x67e1('0x33')][_0x67e1('0xb5')]()[_0x67e1('0x28')](respondWithResult(_0x380b68,null))[_0x67e1('0xb1')](handleError(_0x380b68,null));};exports[_0x67e1('0xb6')]=function(_0x1d409e,_0x53bbf2,_0x3d3232){return db['WhatsappMessage'][_0x67e1('0x5f')]({'where':{'id':_0x1d409e['params']['id']}})['then'](handleEntityNotFound(_0x53bbf2,null))['then'](function(_0x5e7521){if(_0x5e7521){return _0x5e7521[_0x67e1('0xb6')](_0x1d409e[_0x67e1('0x74')]['ids'],_[_0x67e1('0xb7')](_0x1d409e['body'],['ids','id'])||{});}})[_0x67e1('0x28')](respondWithResult(_0x53bbf2,null))[_0x67e1('0xb1')](handleError(_0x53bbf2,null));};exports[_0x67e1('0xb8')]=function(_0x58604b,_0x5be06f,_0x501a70){var _0x1815bb={'raw':![],'where':{}};var _0x5a5180={};var _0x455cdf={'count':0x0,'rows':[]};return db[_0x67e1('0x33')][_0x67e1('0xb9')]({'where':{'id':_0x58604b[_0x67e1('0xb2')]['id']}})[_0x67e1('0x28')](handleEntityNotFound(_0x5be06f,null))[_0x67e1('0x28')](function(_0x584354){if(_0x584354){_0x5a5180['model']=_[_0x67e1('0x38')](db['WhatsappMessage'][_0x67e1('0x34')]);_0x5a5180[_0x67e1('0x39')]=_['keys'](_0x58604b[_0x67e1('0x39')]);_0x5a5180[_0x67e1('0x3a')]=_[_0x67e1('0x3b')](_0x5a5180[_0x67e1('0x3c')],_0x5a5180[_0x67e1('0x39')]);_0x1815bb['attributes']=_['intersection'](_0x5a5180[_0x67e1('0x3c')],qs[_0x67e1('0x3e')](_0x58604b[_0x67e1('0x39')]['fields']));_0x1815bb[_0x67e1('0x3d')]=_0x1815bb[_0x67e1('0x3d')][_0x67e1('0x3f')]?_0x1815bb[_0x67e1('0x3d')]:_0x5a5180['model'];if(!_0x58604b[_0x67e1('0x39')]['hasOwnProperty']('nolimit')){_0x1815bb[_0x67e1('0x21')]=qs['limit'](_0x58604b[_0x67e1('0x39')][_0x67e1('0x21')]);_0x1815bb[_0x67e1('0x20')]=qs['offset'](_0x58604b[_0x67e1('0x39')][_0x67e1('0x20')]);}_0x1815bb[_0x67e1('0x42')]=qs[_0x67e1('0x43')](_0x58604b['query'][_0x67e1('0x43')]);_0x1815bb['where']=qs[_0x67e1('0x3a')](_[_0x67e1('0xba')](_0x58604b[_0x67e1('0x39')],_0x5a5180[_0x67e1('0x3a')]));_0x1815bb[_0x67e1('0x44')][_0x67e1('0xbb')]=_0x584354['id'];if(_0x58604b[_0x67e1('0x39')]['filter']){_0x1815bb[_0x67e1('0x44')]=_[_0x67e1('0x9b')](_0x1815bb[_0x67e1('0x44')],{'$or':_[_0x67e1('0x32')](_0x1815bb[_0x67e1('0x3d')],function(_0x34b428){var _0x14d920={};_0x14d920[_0x34b428]={'$like':'%'+_0x58604b[_0x67e1('0x39')]['filter']+'%'};return _0x14d920;})});}if(_0x58604b[_0x67e1('0x39')][_0x67e1('0x7d')]){var _0x5768c5=_0x58604b[_0x67e1('0x39')]['$gte'][_0x67e1('0x2f')](',');var _0x42d23c={};_0x42d23c[_0x5768c5[0x0]]={'$gte':moment(_0x5768c5[0x1])[_0x67e1('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1815bb['where']=_[_0x67e1('0x9b')](_0x1815bb[_0x67e1('0x44')],_0x42d23c);}_0x1815bb=_[_0x67e1('0x9b')]({},_0x1815bb,_0x58604b[_0x67e1('0xbd')]);return db[_0x67e1('0xbe')]['count']({'where':_0x1815bb[_0x67e1('0x44')]})['then'](function(_0x5a1d86){_0x455cdf['count']=_0x5a1d86;if(_0x58604b[_0x67e1('0x39')][_0x67e1('0xbf')]){_0x1815bb[_0x67e1('0xb3')]=[{'all':!![]}];}return db[_0x67e1('0xbe')]['findAll'](_0x1815bb);})[_0x67e1('0x28')](function(_0x13e5c5){_0x455cdf[_0x67e1('0xb0')]=_0x13e5c5;return _0x455cdf;});}})[_0x67e1('0x28')](respondWithFilteredResult(_0x5be06f,_0x1815bb))[_0x67e1('0xb1')](handleError(_0x5be06f,null));};exports['addTags']=function(_0x14bdab,_0x59f147,_0x53a332){return db['WhatsappInteraction']['find']({'where':{'id':_0x14bdab['params']['id']}})[_0x67e1('0x28')](handleEntityNotFound(_0x59f147,null))[_0x67e1('0x28')](function(_0x5dc930){if(_0x5dc930){return _0x5dc930['setTags'](_0x14bdab[_0x67e1('0x74')]['ids'],_[_0x67e1('0xb7')](_0x14bdab[_0x67e1('0x74')],[_0x67e1('0xc0'),'id'])||{})[_0x67e1('0xc1')](function(){return db[_0x67e1('0x6e')][_0x67e1('0xc2')]({'attributes':['id','name',_0x67e1('0x46')],'where':{'id':_0x14bdab['body']['ids']}});})[_0x67e1('0x28')](function(_0xa96b27){socket[_0x67e1('0xc3')](_0x67e1('0xc4'),{'id':Number(_0x14bdab[_0x67e1('0xb2')]['id']),'tags':_0xa96b27||[]});return{'id':Number(_0x14bdab[_0x67e1('0xb2')]['id']),'tags':_0xa96b27||[]};});}})[_0x67e1('0x28')](respondWithResult(_0x59f147,null))[_0x67e1('0xb1')](handleError(_0x59f147,null));};exports['removeTags']=function(_0x1e3c72,_0x32db87,_0xfb14c){return db[_0x67e1('0x33')]['find']({'where':{'id':_0x1e3c72[_0x67e1('0xb2')]['id']}})[_0x67e1('0x28')](handleEntityNotFound(_0x32db87,null))[_0x67e1('0x28')](function(_0x594f81){if(_0x594f81){return _0x594f81['removeTags'](_0x1e3c72[_0x67e1('0x39')][_0x67e1('0xc0')]);}})[_0x67e1('0x28')](respondWithStatusCode(_0x32db87,null))[_0x67e1('0xb1')](handleError(_0x32db87,null));};exports['download']=function(_0x3b1241,_0x2e3864){var _0x4714ae=moment()[_0x67e1('0xc5')]()[_0x67e1('0x99')]();var _0x219bed=path[_0x67e1('0xc6')](config['root'],_0x67e1('0xc7'),_0x67e1('0xc8'),_0x67e1('0xc9'));var _0x46de19=path[_0x67e1('0xc6')](config[_0x67e1('0xca')],'server','files',_0x67e1('0xcb'));var _0x56dece=path['join'](_0x219bed,_0x4714ae);var _0x345aa6=util[_0x67e1('0xbc')](_0x67e1('0xcc'),_0x3b1241[_0x67e1('0xb2')]['id'],_0x4714ae);var _0x4b90f3=path[_0x67e1('0xc6')](_0x219bed,_0x345aa6);var _0xdcccb=[];_0xdcccb['push']({'model':db['User'],'as':'User','attributes':['id',_0x67e1('0xcd')],'raw':!![]});_0xdcccb[_0x67e1('0x31')]({'model':db[_0x67e1('0xce')],'as':_0x67e1('0xcf'),'attributes':['id',_0x67e1('0xd0'),'lastName'],'raw':!![]});if(_0x3b1241[_0x67e1('0x39')][_0x67e1('0xcb')]){_0xdcccb[_0x67e1('0x31')]({'model':db[_0x67e1('0xd1')],'as':_0x67e1('0xd1'),'raw':!![]});}var _0x13a91c=[{'model':db[_0x67e1('0xbe')],'as':'Messages','attributes':['id',_0x67e1('0x74'),_0x67e1('0x7b'),_0x67e1('0xd2'),_0x67e1('0xd3'),_0x67e1('0x83')],'include':_0xdcccb}];_0x13a91c['push']({'model':db[_0x67e1('0xd4')],'as':'Account','attributes':['id',_0x67e1('0x2b')]});_0x13a91c[_0x67e1('0x31')]({'model':db[_0x67e1('0x71')],'as':'Owner','attributes':['id',_0x67e1('0xcd')]});return db['WhatsappInteraction'][_0x67e1('0x5f')]({'where':{'id':_0x3b1241[_0x67e1('0xb2')]['id']},'include':_0x13a91c})[_0x67e1('0x28')](handleEntityNotFound(_0x2e3864,null))[_0x67e1('0x28')](function(_0x4f4965){if(_0x4f4965){var _0x5264c5=_0x4f4965[_0x67e1('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x56dece);var _0x187114={'channel':_0x67e1('0xd6'),'account':_0x5264c5[_0x67e1('0xd7')][_0x67e1('0x2b')],'agent':_0x5264c5[_0x67e1('0xd8')]?_0x5264c5[_0x67e1('0xd8')][_0x67e1('0xcd')]:'N.A.','createdAt':moment(_0x5264c5['createdAt'])[_0x67e1('0xbc')](_0x67e1('0xd9'))[_0x67e1('0x99')](),'closedAt':_0x5264c5[_0x67e1('0xda')]?moment(_0x5264c5['closedAt'])[_0x67e1('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x5264c5[_0x67e1('0xdb')],'messages':_(_0x5264c5['Messages'])[_0x67e1('0x87')]({'secret':![]})[_0x67e1('0x32')](function(_0x2ff1fa){if(_0x2ff1fa[_0x67e1('0xd1')]){var _0x4e97ee=path[_0x67e1('0xc6')](_0x46de19,_0x2ff1fa[_0x67e1('0xd1')][_0x67e1('0xdc')]);if(fs[_0x67e1('0xdd')](_0x4e97ee)){fs['createReadStream'](_0x4e97ee)[_0x67e1('0xde')](fs['createWriteStream'](path[_0x67e1('0xc6')](_0x56dece,_0x2ff1fa['Attachment'][_0x67e1('0xdc')])));}}return{'date':moment(_0x2ff1fa[_0x67e1('0x7b')])['format'](_0x67e1('0xd9'))[_0x67e1('0x99')](),'sender':_0x2ff1fa[_0x67e1('0xd2')]===_0x67e1('0xdf')?_0x2ff1fa[_0x67e1('0x71')]?_0x2ff1fa[_0x67e1('0x71')]['fullname']:_0x67e1('0xe0'):_0x2ff1fa[_0x67e1('0xcf')][_0x67e1('0xd0')]+(_0x2ff1fa[_0x67e1('0xcf')][_0x67e1('0xe1')]?'\x20'+_0x2ff1fa[_0x67e1('0xcf')][_0x67e1('0xe1')]:''),'body':_0x2ff1fa[_0x67e1('0xd1')]?_0x2ff1fa['Attachment'][_0x67e1('0xdc')]:_0x2ff1fa[_0x67e1('0x74')],'direction':_0x2ff1fa[_0x67e1('0xd2')]===_0x67e1('0xdf')?'A':'C','secret':_0x2ff1fa[_0x67e1('0xd3')],'read':_0x2ff1fa['read'],'attachment':_0x2ff1fa[_0x67e1('0xd1')]};})[_0x67e1('0x66')]()};return ejs[_0x67e1('0xe2')](path['join'](config[_0x67e1('0xca')],_0x67e1('0xc7'),'views',_0x67e1('0xe3')),{'interaction':_0x187114})[_0x67e1('0x28')](function(_0xa6f6fd){var _0x402327=path[_0x67e1('0xc6')](_0x56dece,'transcript-'+_0x5264c5['id']+'-'+_0x4714ae+_0x67e1('0xe4'));var _0x14d238={'path':_0x402327,'channel':_0x67e1('0xd6'),'interactionId':_0x5264c5['id']};return pdf[_0x67e1('0xe5')](_0xa6f6fd,_0x14d238);})['then'](function(){return new BPromise(function(_0x5ddb4b,_0x1643d2){zipdir(_0x56dece,{'saveTo':_0x4b90f3},function(_0x301b1b,_0x11c2b1){if(_0x301b1b)return _0x1643d2(_0x301b1b);return _0x5ddb4b(_0x11c2b1);});})['then'](function(){return new BPromise(function(_0x4f9ddd,_0x29d5d5){rimraf(_0x56dece,function(_0x39a460){if(_0x39a460)_0x29d5d5(_0x39a460);return _0x4f9ddd();});});})[_0x67e1('0x28')](function(){return _0x2e3864[_0x67e1('0xe6')](_0x4b90f3,_0x345aa6,function(_0x4f6515){if(_0x4f6515){console[_0x67e1('0xe7')]('err',_0x4f6515);}else{fs[_0x67e1('0xe8')](_0x4b90f3);}});});});}else{return _0x2e3864['sendStatus'](0xc8);}})[_0x67e1('0xb1')](handleError(_0x2e3864,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d736ab4..91690c0 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 _0x4c71=['setDataValue','Users','map','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x4c71,0x12b));var _0x14c7=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x4c71[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require(_0x14c7('0x0'));var WhatsappInteraction=require(_0x14c7('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x14c7('0x1'))['db'][_0x14c7('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x14c7('0x3')](0x0);var events={'afterCreate':_0x14c7('0x4'),'afterUpdate':_0x14c7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x10a777){return function(_0xd22e73,_0x24fd35,_0x3c6929){_0xd22e73[_0x14c7('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f1868){_0xd22e73[_0x14c7('0x7')](_0x14c7('0x8'),_0x3f1868[_0x14c7('0x9')](function(_0x2f19cc){return{'id':_0x2f19cc['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0xd22e73['id'],'direction':'in','read':![]},'raw':!![]});})[_0x14c7('0xa')](function(_0x4f2d04){_0xd22e73[_0x14c7('0x7')](_0x14c7('0xb'),_0x4f2d04['length']);WhatsappInteractionEvents[_0x14c7('0xc')](_0x10a777+':'+_0xd22e73['id'],_0xd22e73);WhatsappInteractionEvents[_0x14c7('0xc')](_0x10a777,_0xd22e73);_0x3c6929(null);})[_0x14c7('0xd')](_0x3c6929(null));};}for(var e in events){if(events[_0x14c7('0xe')](e)){var event=events[e];WhatsappInteraction[_0x14c7('0xf')](e,emitEvent(event));}}module[_0x14c7('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x1df5=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','remove','getUsers','Users','map','findAll','then','setDataValue'];(function(_0x5414af,_0x16970d){var _0x20c9f6=function(_0x3d28de){while(--_0x3d28de){_0x5414af['push'](_0x5414af['shift']());}};_0x20c9f6(++_0x16970d);}(_0x1df5,0xfd));var _0x51df=function(_0x2785de,_0xcbf4b3){_0x2785de=_0x2785de-0x0;var _0x1f6afc=_0x1df5[_0x2785de];return _0x1f6afc;};'use strict';var EventEmitter=require(_0x51df('0x0'));var WhatsappInteraction=require(_0x51df('0x1'))['db'][_0x51df('0x2')];var WhatsappMessage=require(_0x51df('0x1'))['db'][_0x51df('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x51df('0x4'),'afterUpdate':_0x51df('0x5'),'afterDestroy':_0x51df('0x6')};function emitEvent(_0x34fedd){return function(_0x5ff7ba,_0xd33a85,_0x15de76){_0x5ff7ba[_0x51df('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1316c2){_0x5ff7ba['setDataValue'](_0x51df('0x8'),_0x1316c2[_0x51df('0x9')](function(_0x8dbf50){return{'id':_0x8dbf50['id']};}));return WhatsappMessage[_0x51df('0xa')]({'where':{'WhatsappInteractionId':_0x5ff7ba['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51df('0xb')](function(_0x130cd5){_0x5ff7ba[_0x51df('0xc')](_0x51df('0xd'),_0x130cd5['length']);WhatsappInteractionEvents[_0x51df('0xe')](_0x34fedd+':'+_0x5ff7ba['id'],_0x5ff7ba);WhatsappInteractionEvents[_0x51df('0xe')](_0x34fedd,_0x5ff7ba);_0x15de76(null);})[_0x51df('0xf')](_0x15de76(null));};}for(var e in events){if(events[_0x51df('0x10')](e)){var event=events[e];WhatsappInteraction[_0x51df('0x11')](e,emitEvent(event));}}module[_0x51df('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 21be513..9b38691 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 _0xe511=['../../config/logger','moment','bluebird','path','rimraf','exports','WhatsappInteraction','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0xe511,0x143));var _0x1e51=function(_0x4d3b39,_0x4ec5ad){_0x4d3b39=_0x4d3b39-0x0;var _0x3f92ca=_0xe511[_0x4d3b39];return _0x3f92ca;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require(_0x1e51('0x2'))('api');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e51('0x5'));var rimraf=require(_0x1e51('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x1e51('0x7')]=function(_0x1ce775,_0x45de70){return _0x1ce775['define'](_0x1e51('0x8'),attributes,{'tableName':_0x1e51('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c8a01,_0x1aea2d,_0xe4d52c){if(_0x5c8a01['changed'](_0x1e51('0xa'))){_0x5c8a01[_0x1e51('0xb')]=moment()['format'](_0x1e51('0xc'));}_0xe4d52c(null,_0x5c8a01);}}});}; \ No newline at end of file +var _0xc33d=['format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closedAt'];(function(_0x545e64,_0x5879d0){var _0x595cbf=function(_0x2cfe77){while(--_0x2cfe77){_0x545e64['push'](_0x545e64['shift']());}};_0x595cbf(++_0x5879d0);}(_0xc33d,0x1cd));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdc33('0x0'));var logger=require(_0xdc33('0x1'))(_0xdc33('0x2'));var moment=require(_0xdc33('0x3'));var BPromise=require(_0xdc33('0x4'));var rp=require(_0xdc33('0x5'));var fs=require('fs');var path=require(_0xdc33('0x6'));var rimraf=require(_0xdc33('0x7'));var config=require(_0xdc33('0x8'));var attributes=require(_0xdc33('0x9'));module[_0xdc33('0xa')]=function(_0x4d0658,_0x5d986e){return _0x4d0658[_0xdc33('0xb')]('WhatsappInteraction',attributes,{'tableName':_0xdc33('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57d79b,_0x7f67ff,_0x1be58b){if(_0x57d79b[_0xdc33('0xd')]('closed')){_0x57d79b[_0xdc33('0xe')]=moment()[_0xdc33('0xf')](_0xdc33('0x10'));}_0x1be58b(null,_0x57d79b);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c24423e..95a70b9 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 _0x2a61=['find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','WhatsappInteraction','update','body','options','attributes','limit','UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction'];(function(_0x2195d1,_0xd71034){var _0x10f225=function(_0x8cc75c){while(--_0x8cc75c){_0x2195d1['push'](_0x2195d1['shift']());}};_0x10f225(++_0xd71034);}(_0x2a61,0x1f3));var _0x12a6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2a61[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x12a6('0x0'));var moment=require(_0x12a6('0x1'));var BPromise=require(_0x12a6('0x2'));var rs=require(_0x12a6('0x3'));var fs=require('fs');var Redis=require(_0x12a6('0x4'));var db=require(_0x12a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x12a6('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x12a6('0x7')]({'port':0x232a});config[_0x12a6('0x8')]=_[_0x12a6('0x9')](config[_0x12a6('0x8')],{'host':_0x12a6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12a6('0x8')]));require(_0x12a6('0xb'))[_0x12a6('0xc')](socket);function respondWithRpcPromise(_0x5a9686,_0x330c83,_0x1569c1){return new BPromise(function(_0x1af20a,_0x4a7c03){return client[_0x12a6('0xd')](_0x5a9686,_0x1569c1)[_0x12a6('0xe')](function(_0x42a26a){logger['info'](_0x12a6('0xf'),_0x330c83,_0x12a6('0x10'));logger[_0x12a6('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x330c83,'request\x20sent',JSON['stringify'](_0x42a26a));if(_0x42a26a['error']){if(_0x42a26a[_0x12a6('0x12')][_0x12a6('0x13')]===0x1f4){logger[_0x12a6('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x330c83,_0x42a26a[_0x12a6('0x12')][_0x12a6('0x14')]);return _0x4a7c03(_0x42a26a['error'][_0x12a6('0x14')]);}logger['error'](_0x12a6('0xf'),_0x330c83,_0x42a26a[_0x12a6('0x12')][_0x12a6('0x14')]);return _0x1af20a(_0x42a26a['error'][_0x12a6('0x14')]);}else{logger[_0x12a6('0x15')](_0x12a6('0xf'),_0x330c83,'request\x20sent');_0x1af20a(_0x42a26a[_0x12a6('0x16')][_0x12a6('0x14')]);}})[_0x12a6('0x17')](function(_0x12748b){logger[_0x12a6('0x12')](_0x12a6('0xf'),_0x330c83,_0x12748b);_0x4a7c03(_0x12748b);});});}exports['UpdateWhatsappInteraction']=function(_0x1c17ba){var _0x25ff9f=this;return new Promise(function(_0x1bb722,_0x2c4184){return db[_0x12a6('0x18')][_0x12a6('0x19')](_0x1c17ba[_0x12a6('0x1a')],{'raw':_0x1c17ba[_0x12a6('0x1b')]?_0x1c17ba[_0x12a6('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c17ba[_0x12a6('0x1b')]?_0x1c17ba['options']['where']||null:null,'attributes':_0x1c17ba[_0x12a6('0x1b')]?_0x1c17ba[_0x12a6('0x1b')][_0x12a6('0x1c')]||null:null,'limit':_0x1c17ba['options']?_0x1c17ba[_0x12a6('0x1b')][_0x12a6('0x1d')]||null:null})['then'](function(_0x2b6327){logger['info'](_0x12a6('0x1e'),_0x1c17ba);logger['debug']('UpdateWhatsappInteraction',_0x1c17ba,JSON[_0x12a6('0x1f')](_0x2b6327));_0x1bb722(_0x2b6327);})[_0x12a6('0x17')](function(_0x205740){logger[_0x12a6('0x12')]('UpdateWhatsappInteraction',_0x205740[_0x12a6('0x14')],_0x1c17ba);_0x2c4184(_0x25ff9f[_0x12a6('0x12')](0x1f4,_0x205740[_0x12a6('0x14')]));});});};exports[_0x12a6('0x20')]=function(_0x22a3f9){return new Promise(function(_0x39d6a7,_0x277f17){return db[_0x12a6('0x18')][_0x12a6('0x21')]({'where':_0x22a3f9[_0x12a6('0x1b')]?_0x22a3f9[_0x12a6('0x1b')]['where']||null:null})['then'](function(_0x3b1fe1){if(_0x3b1fe1){return _0x3b1fe1[_0x12a6('0x22')](_0x22a3f9[_0x12a6('0x1a')][_0x12a6('0x23')],_['omit'](_0x22a3f9[_0x12a6('0x1a')],[_0x12a6('0x23'),'id'])||{});}})[_0x12a6('0x24')](function(_0x373f54){logger['info']('AddTags',_0x22a3f9);logger[_0x12a6('0x11')](_0x12a6('0x25'),_0x22a3f9,JSON[_0x12a6('0x1f')](_0x373f54));_0x39d6a7(_0x373f54);})[_0x12a6('0x17')](function(_0x4f1487){logger['error'](_0x12a6('0x25'),_0x4f1487[_0x12a6('0x14')],_0x22a3f9);_0x277f17(_this[_0x12a6('0x12')](0x1f4,_0x4f1487[_0x12a6('0x14')]));});});}; \ No newline at end of file +var _0xaca2=['redis','defaults','localhost','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','then','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xa7e16e,_0x3dffb0){var _0xd9b0a8=function(_0x204967){while(--_0x204967){_0xa7e16e['push'](_0xa7e16e['shift']());}};_0xd9b0a8(++_0x3dffb0);}(_0xaca2,0x168));var _0x2aca=function(_0x435117,_0x2b9bad){_0x435117=_0x435117-0x0;var _0x585a63=_0xaca2[_0x435117];return _0x585a63;};'use strict';var _=require(_0x2aca('0x0'));var util=require('util');var moment=require(_0x2aca('0x1'));var BPromise=require('bluebird');var rs=require(_0x2aca('0x2'));var fs=require('fs');var Redis=require(_0x2aca('0x3'));var db=require(_0x2aca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aca('0x5'))(_0x2aca('0x6'));var config=require(_0x2aca('0x7'));var jayson=require(_0x2aca('0x8'));var client=jayson['client'][_0x2aca('0x9')]({'port':0x232a});config[_0x2aca('0xa')]=_[_0x2aca('0xb')](config['redis'],{'host':_0x2aca('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2aca('0xa')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x59acd1,_0x593b54,_0xb7ac2e){return new BPromise(function(_0x4c1618,_0x5d0ab9){return client['request'](_0x59acd1,_0xb7ac2e)['then'](function(_0x4aadec){logger[_0x2aca('0xd')](_0x2aca('0xe'),_0x593b54,_0x2aca('0xf'));logger[_0x2aca('0x10')](_0x2aca('0x11'),_0x593b54,_0x2aca('0xf'),JSON[_0x2aca('0x12')](_0x4aadec));if(_0x4aadec[_0x2aca('0x13')]){if(_0x4aadec[_0x2aca('0x13')]['code']===0x1f4){logger[_0x2aca('0x13')](_0x2aca('0xe'),_0x593b54,_0x4aadec[_0x2aca('0x13')][_0x2aca('0x14')]);return _0x5d0ab9(_0x4aadec[_0x2aca('0x13')][_0x2aca('0x14')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x593b54,_0x4aadec[_0x2aca('0x13')][_0x2aca('0x14')]);return _0x4c1618(_0x4aadec[_0x2aca('0x13')][_0x2aca('0x14')]);}else{logger[_0x2aca('0xd')]('WhatsappInteraction,\x20%s,\x20%s',_0x593b54,'request\x20sent');_0x4c1618(_0x4aadec[_0x2aca('0x15')][_0x2aca('0x14')]);}})[_0x2aca('0x16')](function(_0x9989ef){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x593b54,_0x9989ef);_0x5d0ab9(_0x9989ef);});});}exports[_0x2aca('0x17')]=function(_0x470e15){var _0x2d6bb0=this;return new Promise(function(_0x38c292,_0x3b8680){return db[_0x2aca('0x18')][_0x2aca('0x19')](_0x470e15[_0x2aca('0x1a')],{'raw':_0x470e15[_0x2aca('0x1b')]?_0x470e15[_0x2aca('0x1b')][_0x2aca('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x470e15[_0x2aca('0x1b')]?_0x470e15['options']['where']||null:null,'attributes':_0x470e15[_0x2aca('0x1b')]?_0x470e15[_0x2aca('0x1b')][_0x2aca('0x1d')]||null:null,'limit':_0x470e15[_0x2aca('0x1b')]?_0x470e15['options']['limit']||null:null})[_0x2aca('0x1e')](function(_0x229c6b){logger[_0x2aca('0xd')](_0x2aca('0x17'),_0x470e15);logger['debug'](_0x2aca('0x17'),_0x470e15,JSON['stringify'](_0x229c6b));_0x38c292(_0x229c6b);})[_0x2aca('0x16')](function(_0x3c2861){logger[_0x2aca('0x13')](_0x2aca('0x17'),_0x3c2861['message'],_0x470e15);_0x3b8680(_0x2d6bb0['error'](0x1f4,_0x3c2861[_0x2aca('0x14')]));});});};exports[_0x2aca('0x1f')]=function(_0x85db05){return new Promise(function(_0x15d9fa,_0xe9b59c){return db[_0x2aca('0x18')]['find']({'where':_0x85db05[_0x2aca('0x1b')]?_0x85db05['options']['where']||null:null})[_0x2aca('0x1e')](function(_0xc9a03f){if(_0xc9a03f){return _0xc9a03f[_0x2aca('0x20')](_0x85db05[_0x2aca('0x1a')][_0x2aca('0x21')],_[_0x2aca('0x22')](_0x85db05['body'],['ids','id'])||{});}})[_0x2aca('0x23')](function(_0x406abe){logger[_0x2aca('0xd')](_0x2aca('0x24'),_0x85db05);logger['debug'](_0x2aca('0x24'),_0x85db05,JSON[_0x2aca('0x12')](_0x406abe));_0x15d9fa(_0x406abe);})[_0x2aca('0x16')](function(_0x4cce4b){logger['error'](_0x2aca('0x24'),_0x4cce4b[_0x2aca('0x14')],_0x85db05);_0xe9b59c(_this[_0x2aca('0x13')](0x1f4,_0x4cce4b[_0x2aca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 4748e68..ef7cedc 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 _0x7387=['register','length','./whatsappInteraction.events','remove','update','emit'];(function(_0x48ee41,_0x3f9fc2){var _0x198f62=function(_0x2508ef){while(--_0x2508ef){_0x48ee41['push'](_0x48ee41['shift']());}};_0x198f62(++_0x3f9fc2);}(_0x7387,0x12e));var _0x7738=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7387[_0x178e48];return _0x440d7e;};'use strict';var WhatsappInteractionEvents=require(_0x7738('0x0'));var events=['save',_0x7738('0x1'),_0x7738('0x2')];function createListener(_0x285225,_0x55df58){return function(_0x5b9430){_0x55df58[_0x7738('0x3')](_0x285225,_0x5b9430);};}function removeListener(_0xb3689a,_0x8ead4){return function(){WhatsappInteractionEvents['removeListener'](_0xb3689a,_0x8ead4);};}exports[_0x7738('0x4')]=function(_0x50a0e2){for(var _0x3b9cc8=0x0,_0x3958f1=events[_0x7738('0x5')];_0x3b9cc8<_0x3958f1;_0x3b9cc8++){var _0x55fdd4=events[_0x3b9cc8];var _0x329c3e=createListener('whatsappInteraction:'+_0x55fdd4,_0x50a0e2);WhatsappInteractionEvents['on'](_0x55fdd4,_0x329c3e);}}; \ No newline at end of file +var _0x852c=['save','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x852c,0x1d4));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require(_0xc852('0x0'));var events=[_0xc852('0x1'),'remove','update'];function createListener(_0x448a9a,_0x40d89a){return function(_0x3d4941){_0x40d89a[_0xc852('0x2')](_0x448a9a,_0x3d4941);};}function removeListener(_0x39477b,_0xd57e66){return function(){WhatsappInteractionEvents[_0xc852('0x3')](_0x39477b,_0xd57e66);};}exports[_0xc852('0x4')]=function(_0x4d1c6b){for(var _0x21619b=0x0,_0x10dba9=events[_0xc852('0x5')];_0x21619b<_0x10dba9;_0x21619b++){var _0x28d952=events[_0x21619b];var _0x2e18b9=createListener(_0xc852('0x6')+_0x28d952,_0x4d1c6b);WhatsappInteractionEvents['on'](_0x28d952,_0x2e18b9);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c93e18d..4d804c4 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 _0x9a4c=['/:id/status','status','put','update','/:id/accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked','whatsapp','create'];(function(_0x500789,_0x1ffb8d){var _0xe05b0c=function(_0x133d14){while(--_0x133d14){_0x500789['push'](_0x500789['shift']());}};_0xe05b0c(++_0x1ffb8d);}(_0x9a4c,0xb0));var _0xc9a4=function(_0x12512f,_0x19c37d){_0x12512f=_0x12512f-0x0;var _0x3583ba=_0x9a4c[_0x12512f];return _0x3583ba;};'use strict';var multer=require(_0xc9a4('0x0'));var util=require(_0xc9a4('0x1'));var path=require(_0xc9a4('0x2'));var timeout=require(_0xc9a4('0x3'));var express=require(_0xc9a4('0x4'));var router=express[_0xc9a4('0x5')]();var fs_extra=require(_0xc9a4('0x6'));var auth=require(_0xc9a4('0x7'));var interaction=require(_0xc9a4('0x8'));var config=require(_0xc9a4('0x9'));var controller=require(_0xc9a4('0xa'));router['get']('/',auth[_0xc9a4('0xb')](),controller[_0xc9a4('0xc')]);router[_0xc9a4('0xd')](_0xc9a4('0xe'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0xf')]);router[_0xc9a4('0xd')](_0xc9a4('0x10'),auth[_0xc9a4('0xb')](),controller['show']);router['post']('/',auth[_0xc9a4('0xb')](),interaction[_0xc9a4('0x11')](_0xc9a4('0x12'),'whatsappmessage:create'),controller[_0xc9a4('0x13')]);router['post'](_0xc9a4('0x14'),controller[_0xc9a4('0x15')]);router[_0xc9a4('0x16')](_0xc9a4('0x10'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0x17')]);router['put'](_0xc9a4('0x18'),auth[_0xc9a4('0xb')](),controller['accept']);router[_0xc9a4('0x16')](_0xc9a4('0x19'),auth[_0xc9a4('0xb')](),controller[_0xc9a4('0x1a')]);router['delete'](_0xc9a4('0x10'),auth[_0xc9a4('0xb')](),controller['destroy']);module[_0xc9a4('0x1b')]=router; \ No newline at end of file +var _0x7fcc=['/:id','tracked','whatsappmessage:create','create','post','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x7fcc,0x75));var _0xc7fc=function(_0x242b97,_0x1029d1){_0x242b97=_0x242b97-0x0;var _0x105e69=_0x7fcc[_0x242b97];return _0x105e69;};'use strict';var multer=require(_0xc7fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc7fc('0x1'));var express=require(_0xc7fc('0x2'));var router=express[_0xc7fc('0x3')]();var fs_extra=require(_0xc7fc('0x4'));var auth=require(_0xc7fc('0x5'));var interaction=require(_0xc7fc('0x6'));var config=require(_0xc7fc('0x7'));var controller=require(_0xc7fc('0x8'));router[_0xc7fc('0x9')]('/',auth[_0xc7fc('0xa')](),controller[_0xc7fc('0xb')]);router['get']('/describe',auth[_0xc7fc('0xa')](),controller[_0xc7fc('0xc')]);router[_0xc7fc('0x9')](_0xc7fc('0xd'),auth[_0xc7fc('0xa')](),controller['show']);router['post']('/',auth[_0xc7fc('0xa')](),interaction[_0xc7fc('0xe')]('whatsapp',_0xc7fc('0xf')),controller[_0xc7fc('0x10')]);router[_0xc7fc('0x11')]('/:id/status',controller[_0xc7fc('0x12')]);router['put'](_0xc7fc('0xd'),auth[_0xc7fc('0xa')](),controller['update']);router[_0xc7fc('0x13')](_0xc7fc('0x14'),auth[_0xc7fc('0xa')](),controller[_0xc7fc('0x15')]);router['put'](_0xc7fc('0x16'),auth[_0xc7fc('0xa')](),controller['reject']);router[_0xc7fc('0x17')](_0xc7fc('0xd'),auth[_0xc7fc('0xa')](),controller[_0xc7fc('0x18')]);module[_0xc7fc('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 5e3aabe..256abf6 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 _0xc8c3=['STRING','sequelize','exports','TEXT','ENUM','out','DATE','BOOLEAN'];(function(_0x4f5c07,_0x81096b){var _0x204647=function(_0x113212){while(--_0x113212){_0x4f5c07['push'](_0x4f5c07['shift']());}};_0x204647(++_0x81096b);}(_0xc8c3,0x1c1));var _0x3c8c=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xc8c3[_0x11ba83];return _0x3f3925;};'use strict';var Sequelize=require(_0x3c8c('0x0'));module[_0x3c8c('0x1')]={'body':{'type':Sequelize[_0x3c8c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3c8c('0x3')]('in',_0x3c8c('0x4')),'defaultValue':_0x3c8c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x3c8c('0x5')]},'secret':{'type':Sequelize[_0x3c8c('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3c8c('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf685=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf685,0x117));var _0x5f68=function(_0xd47ae,_0x30eaea){_0xd47ae=_0xd47ae-0x0;var _0x469c34=_0xf685[_0xd47ae];return _0x469c34;};'use strict';var Sequelize=require(_0x5f68('0x0'));module[_0x5f68('0x1')]={'body':{'type':Sequelize[_0x5f68('0x2')](_0x5f68('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5f68('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5f68('0x5')]('in',_0x5f68('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x5f68('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5f68('0x7')]},'providerResponse':{'type':Sequelize[_0x5f68('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 526d0f6..2b661f8 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 _0x0d6a=['hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','WhatsappMessage','findAll','rows','params','rawAttributes','options','find','create','body','describe','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','contact','User','fullname','email','internal','interface','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','QueryTypes','SELECT','SIP/%s','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x1b24fa,_0x436522){var _0x2852bd=function(_0x187de7){while(--_0x187de7){_0x1b24fa['push'](_0x1b24fa['shift']());}};_0x2852bd(++_0x436522);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x0d6a[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0xa0d6('0x0'));var rimraf=require(_0xa0d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0d6('0x2'));var rp=require(_0xa0d6('0x3'));var moment=require(_0xa0d6('0x4'));var BPromise=require(_0xa0d6('0x5'));var Mustache=require(_0xa0d6('0x6'));var util=require(_0xa0d6('0x7'));var path=require(_0xa0d6('0x8'));var sox=require(_0xa0d6('0x9'));var csv=require(_0xa0d6('0xa'));var ejs=require(_0xa0d6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0d6('0xc'));var squel=require(_0xa0d6('0xd'));var crypto=require(_0xa0d6('0xe'));var jsforce=require(_0xa0d6('0xf'));var deskjs=require(_0xa0d6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa0d6('0x11'));var Papa=require('papaparse');var Redis=require(_0xa0d6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa0d6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0d6('0x14'));var logger=require(_0xa0d6('0x15'))(_0xa0d6('0x16'));var utils=require(_0xa0d6('0x17'));var config=require(_0xa0d6('0x18'));var licenseUtil=require(_0xa0d6('0x19'));var db=require('../../mysqldb')['db'];config[_0xa0d6('0x1a')]=_[_0xa0d6('0x1b')](config[_0xa0d6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0d6('0x1c'))(new Redis(config[_0xa0d6('0x1a')]));require(_0xa0d6('0x1d'))[_0xa0d6('0x1e')](socket);var jayson=require(_0xa0d6('0x1f'));var client=jayson[_0xa0d6('0x20')][_0xa0d6('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39e63f,_0x3f8ed3,_0xb21e34,_0x3ee9d9){return new BPromise(function(_0x1e8b82,_0x1985e6){var _0x82e7b6=_0x3ee9d9||client;return _0x82e7b6['request'](_0x39e63f,_0xb21e34)[_0xa0d6('0x22')](function(_0x4723b4){logger[_0xa0d6('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3f8ed3,_0xa0d6('0x24'));logger['debug'](_0xa0d6('0x25'),_0x3f8ed3,'request\x20sent',JSON[_0xa0d6('0x26')](_0x4723b4));if(_0x4723b4[_0xa0d6('0x27')]){if(_0x4723b4[_0xa0d6('0x27')][_0xa0d6('0x28')]===0x1f4){logger[_0xa0d6('0x27')](_0xa0d6('0x29'),_0x3f8ed3,_0x4723b4['error'][_0xa0d6('0x2a')]);return _0x1985e6(_0x4723b4[_0xa0d6('0x27')]['message']);}logger[_0xa0d6('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x3f8ed3,_0x4723b4['error'][_0xa0d6('0x2a')]);return _0x1e8b82(_0x4723b4[_0xa0d6('0x27')][_0xa0d6('0x2a')]);}else{logger[_0xa0d6('0x23')](_0xa0d6('0x29'),_0x3f8ed3,_0xa0d6('0x24'));_0x1e8b82(_0x4723b4[_0xa0d6('0x2b')][_0xa0d6('0x2a')]);}})[_0xa0d6('0x2c')](function(_0x338b17){logger['error'](_0xa0d6('0x29'),_0x3f8ed3,_0x338b17);_0x1985e6(_0x338b17);});});}function respondWithStatusCode(_0x16753e,_0x621e42){_0x621e42=_0x621e42||0xcc;return function(_0x2656c5){if(_0x2656c5){return _0x16753e[_0xa0d6('0x2d')](_0x621e42);}return _0x16753e[_0xa0d6('0x2e')](_0x621e42)[_0xa0d6('0x2f')]();};}function respondWithResult(_0x437150,_0xcb7cf2){_0xcb7cf2=_0xcb7cf2||0xc8;return function(_0x28abb2){if(_0x28abb2){return _0x437150[_0xa0d6('0x2e')](_0xcb7cf2)[_0xa0d6('0x30')](_0x28abb2);}};}function respondWithFilteredResult(_0x414b84,_0x382a37){return function(_0x11b38c){if(_0x11b38c){var _0x19b932=typeof _0x382a37[_0xa0d6('0x31')]===_0xa0d6('0x32')&&typeof _0x382a37[_0xa0d6('0x33')]===_0xa0d6('0x32');var _0x184a5a=_0x11b38c[_0xa0d6('0x34')];var _0xa62bf6=_0x19b932?0x0:_0x382a37[_0xa0d6('0x31')];var _0x4a30e1=_0x19b932?_0x11b38c[_0xa0d6('0x34')]:_0x382a37['offset']+_0x382a37[_0xa0d6('0x33')];var _0x266675;if(_0x4a30e1>=_0x184a5a){_0x4a30e1=_0x184a5a;_0x266675=0xc8;}else{_0x266675=0xce;}_0x414b84[_0xa0d6('0x2e')](_0x266675);return _0x414b84['set'](_0xa0d6('0x35'),_0xa62bf6+'-'+_0x4a30e1+'/'+_0x184a5a)[_0xa0d6('0x30')](_0x11b38c);}return null;};}function patchUpdates(_0x5e7084){return function(_0x28f597){try{jsonpatch[_0xa0d6('0x36')](_0x28f597,_0x5e7084,!![]);}catch(_0x556746){return BPromise[_0xa0d6('0x37')](_0x556746);}return _0x28f597[_0xa0d6('0x38')]();};}function saveUpdates(_0x52bb7c,_0x54fbfb){return function(_0x2e48dc){if(_0x2e48dc){return _0x2e48dc[_0xa0d6('0x39')](_0x52bb7c)['then'](function(_0xac9125){return _0xac9125;});}return null;};}function removeEntity(_0x2f8a3c,_0x4d5dc4){return function(_0xe323b1){if(_0xe323b1){return _0xe323b1[_0xa0d6('0x3a')]()['then'](function(){_0x2f8a3c[_0xa0d6('0x2e')](0xcc)[_0xa0d6('0x2f')]();});}};}function handleEntityNotFound(_0x49c2f7,_0x4ce5c5){return function(_0x3c23ec){if(!_0x3c23ec){_0x49c2f7[_0xa0d6('0x2d')](0x194);}return _0x3c23ec;};}function handleError(_0xd13f64,_0x4369fd){_0x4369fd=_0x4369fd||0x1f4;return function(_0x5aba86){logger[_0xa0d6('0x27')](_0x5aba86['stack']);if(_0x5aba86[_0xa0d6('0x3b')]){delete _0x5aba86[_0xa0d6('0x3b')];}_0xd13f64[_0xa0d6('0x2e')](_0x4369fd)[_0xa0d6('0x3c')](_0x5aba86);};}exports[_0xa0d6('0x3d')]=function(_0x3f5969,_0xbe949e){var _0x3e5664={},_0x598e84={},_0xc2b8a3={'count':0x0,'rows':[]};var _0x3c0d5f=_[_0xa0d6('0x3e')](db['WhatsappMessage']['rawAttributes'],function(_0x15e690){return{'name':_0x15e690['fieldName'],'type':_0x15e690[_0xa0d6('0x3f')][_0xa0d6('0x40')]};});_0x598e84['model']=_[_0xa0d6('0x3e')](_0x3c0d5f,_0xa0d6('0x3b'));_0x598e84[_0xa0d6('0x41')]=_[_0xa0d6('0x42')](_0x3f5969[_0xa0d6('0x41')]);_0x598e84[_0xa0d6('0x43')]=_['intersection'](_0x598e84[_0xa0d6('0x44')],_0x598e84[_0xa0d6('0x41')]);_0x3e5664[_0xa0d6('0x45')]=_[_0xa0d6('0x46')](_0x598e84[_0xa0d6('0x44')],qs['fields'](_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x47')]));_0x3e5664['attributes']=_0x3e5664[_0xa0d6('0x45')][_0xa0d6('0x48')]?_0x3e5664[_0xa0d6('0x45')]:_0x598e84[_0xa0d6('0x44')];if(!_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x49')](_0xa0d6('0x4a'))){_0x3e5664[_0xa0d6('0x33')]=qs['limit'](_0x3f5969['query'][_0xa0d6('0x33')]);_0x3e5664[_0xa0d6('0x31')]=qs[_0xa0d6('0x31')](_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x31')]);}_0x3e5664[_0xa0d6('0x4b')]=qs[_0xa0d6('0x4c')](_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x4c')]);_0x3e5664[_0xa0d6('0x4d')]=qs['filters'](_[_0xa0d6('0x4e')](_0x3f5969[_0xa0d6('0x41')],_0x598e84[_0xa0d6('0x43')]),_0x3c0d5f);if(_0x3f5969[_0xa0d6('0x41')]['filter']){_0x3e5664[_0xa0d6('0x4d')]=_[_0xa0d6('0x4f')](_0x3e5664[_0xa0d6('0x4d')],{'$or':_[_0xa0d6('0x3e')](_0x3c0d5f,function(_0x3bfbe4){if(_0x3bfbe4['type']!=='VIRTUAL'){var _0x82e50d={};_0x82e50d[_0x3bfbe4[_0xa0d6('0x3b')]]={'$like':'%'+_0x3f5969[_0xa0d6('0x41')]['filter']+'%'};return _0x82e50d;}})});}_0x3e5664=_[_0xa0d6('0x4f')]({},_0x3e5664,_0x3f5969['options']);var _0x177e11={'where':_0x3e5664[_0xa0d6('0x4d')]};return db['WhatsappMessage'][_0xa0d6('0x34')](_0x177e11)[_0xa0d6('0x22')](function(_0x3739df){_0xc2b8a3['count']=_0x3739df;if(_0x3f5969[_0xa0d6('0x41')][_0xa0d6('0x50')]){_0x3e5664[_0xa0d6('0x51')]=[{'all':!![]}];}return db[_0xa0d6('0x52')][_0xa0d6('0x53')](_0x3e5664);})[_0xa0d6('0x22')](function(_0x12594e){_0xc2b8a3[_0xa0d6('0x54')]=_0x12594e;return _0xc2b8a3;})[_0xa0d6('0x22')](respondWithFilteredResult(_0xbe949e,_0x3e5664))[_0xa0d6('0x2c')](handleError(_0xbe949e,null));};exports['show']=function(_0x577fea,_0xcde9fe){var _0x29e9fd={'raw':!![],'where':{'id':_0x577fea[_0xa0d6('0x55')]['id']}},_0x413b23={};_0x413b23[_0xa0d6('0x44')]=_[_0xa0d6('0x42')](db['WhatsappMessage'][_0xa0d6('0x56')]);_0x413b23['query']=_[_0xa0d6('0x42')](_0x577fea[_0xa0d6('0x41')]);_0x413b23[_0xa0d6('0x43')]=_['intersection'](_0x413b23[_0xa0d6('0x44')],_0x413b23[_0xa0d6('0x41')]);_0x29e9fd[_0xa0d6('0x45')]=_[_0xa0d6('0x46')](_0x413b23['model'],qs[_0xa0d6('0x47')](_0x577fea[_0xa0d6('0x41')][_0xa0d6('0x47')]));_0x29e9fd['attributes']=_0x29e9fd[_0xa0d6('0x45')]['length']?_0x29e9fd['attributes']:_0x413b23[_0xa0d6('0x44')];if(_0x577fea[_0xa0d6('0x41')][_0xa0d6('0x50')]){_0x29e9fd[_0xa0d6('0x51')]=[{'all':!![]}];}_0x29e9fd=_[_0xa0d6('0x4f')]({},_0x29e9fd,_0x577fea[_0xa0d6('0x57')]);return db[_0xa0d6('0x52')][_0xa0d6('0x58')](_0x29e9fd)['then'](handleEntityNotFound(_0xcde9fe,null))['then'](respondWithResult(_0xcde9fe,null))[_0xa0d6('0x2c')](handleError(_0xcde9fe,null));};exports['create']=function(_0x1ac398,_0x2f7534){return db[_0xa0d6('0x52')][_0xa0d6('0x59')](_0x1ac398[_0xa0d6('0x5a')],{})[_0xa0d6('0x22')](respondWithResult(_0x2f7534,0xc9))['catch'](handleError(_0x2f7534,null));};exports[_0xa0d6('0x39')]=function(_0x578ef7,_0x557b0c){if(_0x578ef7[_0xa0d6('0x5a')]['id']){delete _0x578ef7[_0xa0d6('0x5a')]['id'];}return db[_0xa0d6('0x52')]['find']({'where':{'id':_0x578ef7[_0xa0d6('0x55')]['id']}})[_0xa0d6('0x22')](handleEntityNotFound(_0x557b0c,null))[_0xa0d6('0x22')](saveUpdates(_0x578ef7[_0xa0d6('0x5a')],null))[_0xa0d6('0x22')](respondWithResult(_0x557b0c,null))['catch'](handleError(_0x557b0c,null));};exports[_0xa0d6('0x3a')]=function(_0x7380ee,_0x3bf2fa){return db[_0xa0d6('0x52')][_0xa0d6('0x58')]({'where':{'id':_0x7380ee[_0xa0d6('0x55')]['id']}})[_0xa0d6('0x22')](handleEntityNotFound(_0x3bf2fa,null))['then'](removeEntity(_0x3bf2fa,null))['catch'](handleError(_0x3bf2fa,null));};exports[_0xa0d6('0x5b')]=function(_0x2ec7be,_0x2e0d76){return db[_0xa0d6('0x52')][_0xa0d6('0x5b')]()[_0xa0d6('0x22')](respondWithResult(_0x2e0d76,null))['catch'](handleError(_0x2e0d76,null));};var interaction_log=require(_0xa0d6('0x15'))('whatsapp-interactions');exports[_0xa0d6('0x5c')]=function(_0x12e2d9,_0x5d9fae,_0x35fea9){var _0x507d94={'agent':{},'channel':_0xa0d6('0x5d')};if(_0x12e2d9['body']['id']){delete _0x12e2d9[_0xa0d6('0x5a')]['id'];}_0x12e2d9['body']['read']=!![];_0x12e2d9[_0xa0d6('0x5a')]['readAt']=moment()[_0xa0d6('0x5e')](_0xa0d6('0x5f'));_0x12e2d9[_0xa0d6('0x5a')]['UserId']=_0x12e2d9[_0xa0d6('0x5a')][_0xa0d6('0x60')]||_0x12e2d9[_0xa0d6('0x61')]['id'];_0x507d94[_0xa0d6('0x62')]['id']=_0x12e2d9['body'][_0xa0d6('0x60')];return db[_0xa0d6('0x52')][_0xa0d6('0x58')]({'where':{'id':_0x12e2d9[_0xa0d6('0x55')]['id'],'UserId':null}})[_0xa0d6('0x22')](handleEntityNotFound(_0x5d9fae,null))[_0xa0d6('0x22')](saveUpdates(_0x12e2d9[_0xa0d6('0x5a')],null))[_0xa0d6('0x22')](function(_0x38a0ae){if(_0x38a0ae){_0x507d94[_0xa0d6('0x2a')]=_0x38a0ae[_0xa0d6('0x63')]({'plain':!![]});return db[_0xa0d6('0x64')]['find']({'where':{'id':_0x38a0ae[_0xa0d6('0x65')]}});}return null;})[_0xa0d6('0x22')](handleEntityNotFound(_0x5d9fae,null))[_0xa0d6('0x22')](function(_0x3f308b){if(_0x3f308b){return _0x3f308b[_0xa0d6('0x39')]({'UserId':_0x12e2d9[_0xa0d6('0x5a')]['UserId'],'read1stAt':_[_0xa0d6('0x66')](_0x3f308b[_0xa0d6('0x67')])?moment()[_0xa0d6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa0d6('0x22')](function(_0xf6ab33){if(_0xf6ab33){_0x507d94[_0xa0d6('0x68')]=_0xf6ab33['get']({'plain':!![]});interaction_log[_0xa0d6('0x23')](_0xa0d6('0x69'),_0x12e2d9[_0xa0d6('0x61')]['id'],_0x12e2d9[_0xa0d6('0x61')][_0xa0d6('0x3b')],_0x12e2d9[_0xa0d6('0x61')][_0xa0d6('0x6a')],_0x507d94['interaction']['id'],_0x12e2d9['body']?JSON['stringify'](_0x12e2d9[_0xa0d6('0x5a')]):_0xa0d6('0x6b'));return respondWithRpcPromise(_0xa0d6('0x6c'),'acceptMessage',_0x507d94);}return null;})[_0xa0d6('0x22')](function(_0x5a9aa3){var _0x3ca5cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a9aa3['message'][_0xa0d6('0x6d')];return db['sequelize'][_0xa0d6('0x41')](_0x3ca5cf,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xa0d6('0x22')](function(_0x5f4e63){return _0x5f4e63;});})['then'](function(_0x5e02fa){if(_0x5e02fa){_0x507d94[_0xa0d6('0x2a')][_0xa0d6('0x6e')]=_0x5e02fa[0x0];if(!_0x12e2d9[_0xa0d6('0x5a')][_0xa0d6('0x60')])return;return db[_0xa0d6('0x6f')][_0xa0d6('0x58')]({'where':{'id':_0x12e2d9[_0xa0d6('0x5a')][_0xa0d6('0x60')],'role':_0xa0d6('0x62')},'attributes':['id',_0xa0d6('0x3b'),_0xa0d6('0x70'),_0xa0d6('0x71'),_0xa0d6('0x72')],'raw':!![]});}return null;})['then'](function(_0x1cb860){if(!_0x1cb860)return null;_0x507d94['message'][_0xa0d6('0x62')]=_0x1cb860;return _0x507d94;})['then'](function(_0xf2bf5d){if(_0xf2bf5d){if(_0x12e2d9[_0xa0d6('0x5a')]['manual']){_0x507d94[_0xa0d6('0x2a')][_0xa0d6('0x73')]=util[_0xa0d6('0x5e')]('SIP/%s',_0x12e2d9[_0xa0d6('0x61')][_0xa0d6('0x3b')]);_0x507d94[_0xa0d6('0x2a')][_0xa0d6('0x74')]=_0x507d94[_0xa0d6('0x74')];_0x507d94['message']['motionChannel']=_0x507d94[_0xa0d6('0x74')];_0x507d94['message'][_0xa0d6('0x75')]=_0xa0d6('0x5c');return respondWithRpcPromise(_0xa0d6('0x76'),'EventManager',{'event':'acceptmessage','message':_0x507d94['message']},client9002)[_0xa0d6('0x22')](function(){return _0x507d94;});}return _0x507d94;}return null;})[_0xa0d6('0x22')](respondWithResult(_0x5d9fae,null))['catch'](handleError(_0x5d9fae,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xa0d6('0x37')]=function(_0x393595,_0x3b56d1,_0x50859c){var _0x2b49d9={'agent':{},'channel':_0xa0d6('0x5d')};if(_0x393595[_0xa0d6('0x5a')]['id']){delete _0x393595[_0xa0d6('0x5a')]['id'];}_0x393595[_0xa0d6('0x5a')][_0xa0d6('0x60')]=_0x393595[_0xa0d6('0x5a')][_0xa0d6('0x60')]||_0x393595[_0xa0d6('0x61')]['id'];_0x2b49d9[_0xa0d6('0x62')]['id']=_0x393595['body'][_0xa0d6('0x60')];return db[_0xa0d6('0x52')][_0xa0d6('0x58')]({'where':{'id':_0x393595[_0xa0d6('0x55')]['id'],'UserId':null}})[_0xa0d6('0x22')](handleEntityNotFound(_0x3b56d1,null))[_0xa0d6('0x22')](function(_0x59612b){if(_0x59612b){_0x2b49d9[_0xa0d6('0x2a')]=_0x59612b[_0xa0d6('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0xa0d6('0x58')]({'where':{'id':_0x59612b[_0xa0d6('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3b56d1,null))['then'](function(_0x205f79){if(_0x205f79){_0x2b49d9[_0xa0d6('0x68')]=_0x205f79[_0xa0d6('0x63')]({'plain':!![]});interaction_log[_0xa0d6('0x23')](_0xa0d6('0x77'),_0x393595[_0xa0d6('0x61')]['id'],_0x393595[_0xa0d6('0x61')][_0xa0d6('0x3b')],_0x393595['user']['role'],_0x2b49d9[_0xa0d6('0x68')]['id'],_0x393595['body']?JSON['stringify'](_0x393595[_0xa0d6('0x5a')]):'null');return respondWithRpcPromise(_0xa0d6('0x78'),'rejectMessage',_0x2b49d9);}return null;})[_0xa0d6('0x22')](function(_0x17124c){var _0x2b2ec4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17124c[_0xa0d6('0x2a')][_0xa0d6('0x6d')];return db[_0xa0d6('0x79')][_0xa0d6('0x41')](_0x2b2ec4,{'type':db[_0xa0d6('0x7a')][_0xa0d6('0x7b')][_0xa0d6('0x7c')],'raw':!![]})[_0xa0d6('0x22')](function(_0x29c8e1){return _0x29c8e1;});})[_0xa0d6('0x22')](function(_0x5ed71e){if(_0x5ed71e){_0x2b49d9[_0xa0d6('0x2a')][_0xa0d6('0x6e')]=_0x5ed71e[0x0];if(!_0x393595['body'][_0xa0d6('0x60')])return;return db[_0xa0d6('0x6f')][_0xa0d6('0x58')]({'where':{'id':_0x393595[_0xa0d6('0x5a')][_0xa0d6('0x60')],'role':_0xa0d6('0x62')},'attributes':['id','name',_0xa0d6('0x70'),_0xa0d6('0x71'),_0xa0d6('0x72')],'raw':!![]});}return null;})['then'](function(_0x3446bd){if(!_0x3446bd)return null;_0x2b49d9[_0xa0d6('0x2a')]['agent']=_0x3446bd;return _0x2b49d9;})[_0xa0d6('0x22')](function(_0x331160){if(_0x331160){_0x331160['message'][_0xa0d6('0x73')]=util[_0xa0d6('0x5e')](_0xa0d6('0x7d'),_0x393595[_0xa0d6('0x61')][_0xa0d6('0x3b')]);_0x331160[_0xa0d6('0x2a')]['channel']=_0x2b49d9['channel'];_0x331160['message']['motionChannel']=_0x2b49d9[_0xa0d6('0x74')];_0x331160[_0xa0d6('0x2a')]['event']='reject';respondWithRpcPromise(_0xa0d6('0x76'),_0xa0d6('0x76'),{'event':'rejectmessage','message':_0x331160[_0xa0d6('0x2a')]},client9002);return _0x2b49d9;}return null;})[_0xa0d6('0x22')](respondWithResult(_0x3b56d1,null))[_0xa0d6('0x2c')](handleError(_0x3b56d1,null));};exports['status']=function(_0xc817fb,_0xc67fde,_0x46bf9c){if(_0xc817fb[_0xa0d6('0x5a')]['id']){delete _0xc817fb[_0xa0d6('0x5a')]['id'];}var _0x43e13e;return db[_0xa0d6('0x52')]['find']({'where':{'id':_0xc817fb['params']['id']}})['then'](handleEntityNotFound(_0xc67fde,null))[_0xa0d6('0x22')](function(_0x3dae5b){if(_0x3dae5b){_0x43e13e=_0x3dae5b;return db[_0xa0d6('0x7e')][_0xa0d6('0x58')]({'where':{'id':_0x3dae5b[_0xa0d6('0x7f')]}});}})[_0xa0d6('0x22')](handleEntityNotFound(_0xc67fde,null))['then'](function(_0x122bfe){if(_0x122bfe){logger[_0xa0d6('0x80')](_0xa0d6('0x81'),'status',_0xa0d6('0x82'),_0x122bfe[_0xa0d6('0x3f')],util['inspect'](_0xc817fb[_0xa0d6('0x5a')],{'showHidden':![],'depth':null}));switch(_0x122bfe[_0xa0d6('0x3f')]){case _0xa0d6('0x83'):if(_0xc817fb[_0xa0d6('0x5a')][_0xa0d6('0x84')]&&_0xc817fb['body'][_0xa0d6('0x84')]===_0x43e13e['messageId']&&_0xc817fb[_0xa0d6('0x5a')][_0xa0d6('0x85')]&&_0xc817fb['body']['MessageStatus']===_0xa0d6('0x86')){return _0x43e13e[_0xa0d6('0x39')]({'read':!![]});}else{logger[_0xa0d6('0x27')](_0xa0d6('0x87'),'status','twilio',util[_0xa0d6('0x88')](_0xc817fb[_0xa0d6('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x43e13e;}})['then'](respondWithResult(_0xc67fde,null))[_0xa0d6('0x2c')](handleError(_0xc67fde,null));}; \ No newline at end of file +var _0xfd28=['include','findAll','rows','show','params','intersection','create','body','find','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','type','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll'];(function(_0x186b00,_0x109f71){var _0x3bd728=function(_0x21924a){while(--_0x21924a){_0x186b00['push'](_0x186b00['shift']());}};_0x3bd728(++_0x109f71);}(_0xfd28,0x148));var _0x8fd2=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0xfd28[_0x648163];return _0x199d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd2('0x0'));var zipdir=require(_0x8fd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fd2('0x2'));var moment=require('moment');var BPromise=require(_0x8fd2('0x3'));var Mustache=require(_0x8fd2('0x4'));var util=require(_0x8fd2('0x5'));var path=require('path');var sox=require(_0x8fd2('0x6'));var csv=require(_0x8fd2('0x7'));var ejs=require(_0x8fd2('0x8'));var fs=require('fs');var fs_extra=require(_0x8fd2('0x9'));var _=require(_0x8fd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fd2('0xb'));var deskjs=require(_0x8fd2('0xc'));var toCsv=require(_0x8fd2('0x7'));var querystring=require('querystring');var Papa=require(_0x8fd2('0xd'));var Redis=require('ioredis');var authService=require(_0x8fd2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8fd2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fd2('0x10'))('api');var utils=require(_0x8fd2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8fd2('0x12'));var db=require(_0x8fd2('0x13'))['db'];config[_0x8fd2('0x14')]=_[_0x8fd2('0x15')](config[_0x8fd2('0x14')],{'host':_0x8fd2('0x16'),'port':0x18eb});var socket=require(_0x8fd2('0x17'))(new Redis(config[_0x8fd2('0x14')]));require(_0x8fd2('0x18'))[_0x8fd2('0x19')](socket);var jayson=require(_0x8fd2('0x1a'));var client=jayson[_0x8fd2('0x1b')][_0x8fd2('0x1c')]({'port':0x232c});var client9002=jayson[_0x8fd2('0x1b')][_0x8fd2('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x596639,_0x20daca,_0x5ef478,_0x4f0b17){return new BPromise(function(_0x56f75d,_0x3b79f3){var _0x530866=_0x4f0b17||client;return _0x530866[_0x8fd2('0x1d')](_0x596639,_0x5ef478)[_0x8fd2('0x1e')](function(_0x5c8b3c){logger[_0x8fd2('0x1f')](_0x8fd2('0x20'),_0x20daca,_0x8fd2('0x21'));logger[_0x8fd2('0x22')](_0x8fd2('0x23'),_0x20daca,'request\x20sent',JSON['stringify'](_0x5c8b3c));if(_0x5c8b3c[_0x8fd2('0x24')]){if(_0x5c8b3c['error'][_0x8fd2('0x25')]===0x1f4){logger['error'](_0x8fd2('0x20'),_0x20daca,_0x5c8b3c[_0x8fd2('0x24')]['message']);return _0x3b79f3(_0x5c8b3c[_0x8fd2('0x24')]['message']);}logger[_0x8fd2('0x24')](_0x8fd2('0x20'),_0x20daca,_0x5c8b3c['error'][_0x8fd2('0x26')]);return _0x56f75d(_0x5c8b3c[_0x8fd2('0x24')][_0x8fd2('0x26')]);}else{logger['info'](_0x8fd2('0x20'),_0x20daca,_0x8fd2('0x21'));_0x56f75d(_0x5c8b3c[_0x8fd2('0x27')][_0x8fd2('0x26')]);}})[_0x8fd2('0x28')](function(_0x25db4e){logger[_0x8fd2('0x24')](_0x8fd2('0x20'),_0x20daca,_0x25db4e);_0x3b79f3(_0x25db4e);});});}function respondWithStatusCode(_0x1456b4,_0xbc5945){_0xbc5945=_0xbc5945||0xcc;return function(_0x3392fb){if(_0x3392fb){return _0x1456b4[_0x8fd2('0x29')](_0xbc5945);}return _0x1456b4[_0x8fd2('0x2a')](_0xbc5945)['end']();};}function respondWithResult(_0x4c6af7,_0x345bc3){_0x345bc3=_0x345bc3||0xc8;return function(_0x1858a9){if(_0x1858a9){return _0x4c6af7[_0x8fd2('0x2a')](_0x345bc3)['json'](_0x1858a9);}};}function respondWithFilteredResult(_0x2f26ae,_0x7820e7){return function(_0x27b256){if(_0x27b256){var _0x960869=typeof _0x7820e7[_0x8fd2('0x2b')]===_0x8fd2('0x2c')&&typeof _0x7820e7[_0x8fd2('0x2d')]==='undefined';var _0xe76676=_0x27b256[_0x8fd2('0x2e')];var _0x818f61=_0x960869?0x0:_0x7820e7[_0x8fd2('0x2b')];var _0x313902=_0x960869?_0x27b256[_0x8fd2('0x2e')]:_0x7820e7[_0x8fd2('0x2b')]+_0x7820e7['limit'];var _0x5b992a;if(_0x313902>=_0xe76676){_0x313902=_0xe76676;_0x5b992a=0xc8;}else{_0x5b992a=0xce;}_0x2f26ae['status'](_0x5b992a);return _0x2f26ae[_0x8fd2('0x2f')](_0x8fd2('0x30'),_0x818f61+'-'+_0x313902+'/'+_0xe76676)[_0x8fd2('0x31')](_0x27b256);}return null;};}function patchUpdates(_0xe4987b){return function(_0x5a0b3b){try{jsonpatch['apply'](_0x5a0b3b,_0xe4987b,!![]);}catch(_0x3ebeab){return BPromise[_0x8fd2('0x32')](_0x3ebeab);}return _0x5a0b3b[_0x8fd2('0x33')]();};}function saveUpdates(_0x18fe4e,_0x121fd4){return function(_0x52c46b){if(_0x52c46b){return _0x52c46b[_0x8fd2('0x34')](_0x18fe4e)['then'](function(_0x20a9d0){return _0x20a9d0;});}return null;};}function removeEntity(_0x4ade8c,_0x445b67){return function(_0x4d9faa){if(_0x4d9faa){return _0x4d9faa[_0x8fd2('0x35')]()[_0x8fd2('0x1e')](function(){_0x4ade8c[_0x8fd2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339291,_0x4e7f72){return function(_0x11a71d){if(!_0x11a71d){_0x339291[_0x8fd2('0x29')](0x194);}return _0x11a71d;};}function handleError(_0x290c62,_0x5aaaed){_0x5aaaed=_0x5aaaed||0x1f4;return function(_0x14f382){logger[_0x8fd2('0x24')](_0x14f382[_0x8fd2('0x36')]);if(_0x14f382['name']){delete _0x14f382[_0x8fd2('0x37')];}_0x290c62[_0x8fd2('0x2a')](_0x5aaaed)[_0x8fd2('0x38')](_0x14f382);};}exports['index']=function(_0x37a24b,_0x3d3ec6){var _0x589d97={},_0x16b1f3={},_0x130072={'count':0x0,'rows':[]};var _0xac2ca3=_[_0x8fd2('0x39')](db[_0x8fd2('0x3a')][_0x8fd2('0x3b')],function(_0x221022){return{'name':_0x221022['fieldName'],'type':_0x221022[_0x8fd2('0x3c')]['key']};});_0x16b1f3['model']=_[_0x8fd2('0x39')](_0xac2ca3,_0x8fd2('0x37'));_0x16b1f3[_0x8fd2('0x3d')]=_[_0x8fd2('0x3e')](_0x37a24b[_0x8fd2('0x3d')]);_0x16b1f3[_0x8fd2('0x3f')]=_['intersection'](_0x16b1f3['model'],_0x16b1f3[_0x8fd2('0x3d')]);_0x589d97['attributes']=_['intersection'](_0x16b1f3[_0x8fd2('0x40')],qs[_0x8fd2('0x41')](_0x37a24b[_0x8fd2('0x3d')][_0x8fd2('0x41')]));_0x589d97['attributes']=_0x589d97[_0x8fd2('0x42')][_0x8fd2('0x43')]?_0x589d97[_0x8fd2('0x42')]:_0x16b1f3[_0x8fd2('0x40')];if(!_0x37a24b[_0x8fd2('0x3d')][_0x8fd2('0x44')](_0x8fd2('0x45'))){_0x589d97['limit']=qs[_0x8fd2('0x2d')](_0x37a24b[_0x8fd2('0x3d')][_0x8fd2('0x2d')]);_0x589d97[_0x8fd2('0x2b')]=qs[_0x8fd2('0x2b')](_0x37a24b[_0x8fd2('0x3d')][_0x8fd2('0x2b')]);}_0x589d97['order']=qs[_0x8fd2('0x46')](_0x37a24b[_0x8fd2('0x3d')][_0x8fd2('0x46')]);_0x589d97[_0x8fd2('0x47')]=qs[_0x8fd2('0x3f')](_[_0x8fd2('0x48')](_0x37a24b[_0x8fd2('0x3d')],_0x16b1f3['filters']),_0xac2ca3);if(_0x37a24b[_0x8fd2('0x3d')]['filter']){_0x589d97[_0x8fd2('0x47')]=_['merge'](_0x589d97[_0x8fd2('0x47')],{'$or':_[_0x8fd2('0x39')](_0xac2ca3,function(_0x2a39ac){if(_0x2a39ac['type']!==_0x8fd2('0x49')){var _0x2ccc94={};_0x2ccc94[_0x2a39ac[_0x8fd2('0x37')]]={'$like':'%'+_0x37a24b['query'][_0x8fd2('0x4a')]+'%'};return _0x2ccc94;}})});}_0x589d97=_['merge']({},_0x589d97,_0x37a24b[_0x8fd2('0x4b')]);var _0x21195f={'where':_0x589d97[_0x8fd2('0x47')]};return db[_0x8fd2('0x3a')][_0x8fd2('0x2e')](_0x21195f)[_0x8fd2('0x1e')](function(_0x154b61){_0x130072[_0x8fd2('0x2e')]=_0x154b61;if(_0x37a24b[_0x8fd2('0x3d')][_0x8fd2('0x4c')]){_0x589d97[_0x8fd2('0x4d')]=[{'all':!![]}];}return db[_0x8fd2('0x3a')][_0x8fd2('0x4e')](_0x589d97);})[_0x8fd2('0x1e')](function(_0x109d49){_0x130072[_0x8fd2('0x4f')]=_0x109d49;return _0x130072;})[_0x8fd2('0x1e')](respondWithFilteredResult(_0x3d3ec6,_0x589d97))[_0x8fd2('0x28')](handleError(_0x3d3ec6,null));};exports[_0x8fd2('0x50')]=function(_0x57084b,_0x50f894){var _0x43a9a8={'raw':!![],'where':{'id':_0x57084b[_0x8fd2('0x51')]['id']}},_0x40537e={};_0x40537e['model']=_['keys'](db[_0x8fd2('0x3a')]['rawAttributes']);_0x40537e[_0x8fd2('0x3d')]=_[_0x8fd2('0x3e')](_0x57084b[_0x8fd2('0x3d')]);_0x40537e['filters']=_[_0x8fd2('0x52')](_0x40537e[_0x8fd2('0x40')],_0x40537e['query']);_0x43a9a8[_0x8fd2('0x42')]=_[_0x8fd2('0x52')](_0x40537e[_0x8fd2('0x40')],qs['fields'](_0x57084b[_0x8fd2('0x3d')][_0x8fd2('0x41')]));_0x43a9a8[_0x8fd2('0x42')]=_0x43a9a8[_0x8fd2('0x42')][_0x8fd2('0x43')]?_0x43a9a8[_0x8fd2('0x42')]:_0x40537e['model'];if(_0x57084b['query'][_0x8fd2('0x4c')]){_0x43a9a8[_0x8fd2('0x4d')]=[{'all':!![]}];}_0x43a9a8=_['merge']({},_0x43a9a8,_0x57084b[_0x8fd2('0x4b')]);return db['WhatsappMessage']['find'](_0x43a9a8)[_0x8fd2('0x1e')](handleEntityNotFound(_0x50f894,null))[_0x8fd2('0x1e')](respondWithResult(_0x50f894,null))[_0x8fd2('0x28')](handleError(_0x50f894,null));};exports[_0x8fd2('0x53')]=function(_0x353450,_0x3de5b1){return db['WhatsappMessage'][_0x8fd2('0x53')](_0x353450[_0x8fd2('0x54')],{})[_0x8fd2('0x1e')](respondWithResult(_0x3de5b1,0xc9))[_0x8fd2('0x28')](handleError(_0x3de5b1,null));};exports[_0x8fd2('0x34')]=function(_0x51b586,_0x5cf641){if(_0x51b586['body']['id']){delete _0x51b586['body']['id'];}return db['WhatsappMessage'][_0x8fd2('0x55')]({'where':{'id':_0x51b586[_0x8fd2('0x51')]['id']}})[_0x8fd2('0x1e')](handleEntityNotFound(_0x5cf641,null))[_0x8fd2('0x1e')](saveUpdates(_0x51b586[_0x8fd2('0x54')],null))[_0x8fd2('0x1e')](respondWithResult(_0x5cf641,null))[_0x8fd2('0x28')](handleError(_0x5cf641,null));};exports['destroy']=function(_0x5e5f79,_0x5f0cfa){return db[_0x8fd2('0x3a')][_0x8fd2('0x55')]({'where':{'id':_0x5e5f79['params']['id']}})['then'](handleEntityNotFound(_0x5f0cfa,null))[_0x8fd2('0x1e')](removeEntity(_0x5f0cfa,null))[_0x8fd2('0x28')](handleError(_0x5f0cfa,null));};exports[_0x8fd2('0x56')]=function(_0x30a952,_0x37ddfa){return db['WhatsappMessage'][_0x8fd2('0x56')]()[_0x8fd2('0x1e')](respondWithResult(_0x37ddfa,null))[_0x8fd2('0x28')](handleError(_0x37ddfa,null));};var interaction_log=require(_0x8fd2('0x10'))('whatsapp-interactions');exports[_0x8fd2('0x57')]=function(_0x3bd8ce,_0x3ca4b1,_0x23c608){var _0x5df526={'agent':{},'channel':'whatsapp'};if(_0x3bd8ce['body']['id']){delete _0x3bd8ce[_0x8fd2('0x54')]['id'];}_0x3bd8ce[_0x8fd2('0x54')][_0x8fd2('0x58')]=!![];_0x3bd8ce[_0x8fd2('0x54')][_0x8fd2('0x59')]=moment()['format'](_0x8fd2('0x5a'));_0x3bd8ce[_0x8fd2('0x54')]['UserId']=_0x3bd8ce[_0x8fd2('0x54')][_0x8fd2('0x5b')]||_0x3bd8ce[_0x8fd2('0x5c')]['id'];_0x5df526[_0x8fd2('0x5d')]['id']=_0x3bd8ce[_0x8fd2('0x54')]['UserId'];return db[_0x8fd2('0x3a')][_0x8fd2('0x55')]({'where':{'id':_0x3bd8ce[_0x8fd2('0x51')]['id'],'UserId':null}})[_0x8fd2('0x1e')](handleEntityNotFound(_0x3ca4b1,null))[_0x8fd2('0x1e')](saveUpdates(_0x3bd8ce[_0x8fd2('0x54')],null))[_0x8fd2('0x1e')](function(_0x292672){if(_0x292672){_0x5df526[_0x8fd2('0x26')]=_0x292672[_0x8fd2('0x5e')]({'plain':!![]});return db[_0x8fd2('0x5f')][_0x8fd2('0x55')]({'where':{'id':_0x292672[_0x8fd2('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x3ca4b1,null))[_0x8fd2('0x1e')](function(_0x237756){if(_0x237756){return _0x237756['update']({'UserId':_0x3bd8ce['body']['UserId'],'read1stAt':_[_0x8fd2('0x61')](_0x237756[_0x8fd2('0x62')])?moment()[_0x8fd2('0x63')](_0x8fd2('0x5a')):undefined});}return null;})[_0x8fd2('0x1e')](function(_0x2eaa0c){if(_0x2eaa0c){_0x5df526['interaction']=_0x2eaa0c[_0x8fd2('0x5e')]({'plain':!![]});interaction_log[_0x8fd2('0x1f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3bd8ce[_0x8fd2('0x5c')]['id'],_0x3bd8ce['user'][_0x8fd2('0x37')],_0x3bd8ce[_0x8fd2('0x5c')][_0x8fd2('0x64')],_0x5df526[_0x8fd2('0x65')]['id'],_0x3bd8ce[_0x8fd2('0x54')]?JSON['stringify'](_0x3bd8ce[_0x8fd2('0x54')]):_0x8fd2('0x66'));return respondWithRpcPromise('AcceptMessage',_0x8fd2('0x67'),_0x5df526);}return null;})['then'](function(_0x50c6a6){var _0x433912=_0x8fd2('0x68')+_0x50c6a6['message'][_0x8fd2('0x69')];return db[_0x8fd2('0x6a')][_0x8fd2('0x3d')](_0x433912,{'type':db['Sequelize'][_0x8fd2('0x6b')][_0x8fd2('0x6c')],'raw':!![]})[_0x8fd2('0x1e')](function(_0x59f39b){return _0x59f39b;});})[_0x8fd2('0x1e')](function(_0x31cb0e){if(_0x31cb0e){_0x5df526[_0x8fd2('0x26')]['contact']=_0x31cb0e[0x0];if(!_0x3bd8ce['body'][_0x8fd2('0x5b')])return;return db[_0x8fd2('0x6d')]['find']({'where':{'id':_0x3bd8ce['body']['UserId'],'role':'agent'},'attributes':['id','name',_0x8fd2('0x6e'),_0x8fd2('0x6f'),_0x8fd2('0x70')],'raw':!![]});}return null;})[_0x8fd2('0x1e')](function(_0x1fa13a){if(!_0x1fa13a)return null;_0x5df526['message'][_0x8fd2('0x5d')]=_0x1fa13a;return _0x5df526;})[_0x8fd2('0x1e')](function(_0x3b94f9){if(_0x3b94f9){if(_0x3bd8ce['body'][_0x8fd2('0x71')]){_0x5df526[_0x8fd2('0x26')]['interface']=util[_0x8fd2('0x63')](_0x8fd2('0x72'),_0x3bd8ce[_0x8fd2('0x5c')][_0x8fd2('0x37')]);_0x5df526[_0x8fd2('0x26')][_0x8fd2('0x73')]=_0x5df526[_0x8fd2('0x73')];_0x5df526['message'][_0x8fd2('0x74')]=_0x5df526[_0x8fd2('0x73')];_0x5df526[_0x8fd2('0x26')][_0x8fd2('0x75')]=_0x8fd2('0x57');return respondWithRpcPromise(_0x8fd2('0x76'),_0x8fd2('0x76'),{'event':'acceptmessage','message':_0x5df526[_0x8fd2('0x26')]},client9002)[_0x8fd2('0x1e')](function(){return _0x5df526;});}return _0x5df526;}return null;})['then'](respondWithResult(_0x3ca4b1,null))[_0x8fd2('0x28')](handleError(_0x3ca4b1,null));};var interaction_log=require(_0x8fd2('0x10'))(_0x8fd2('0x77'));exports[_0x8fd2('0x32')]=function(_0x570c23,_0x26e4b9,_0x2ab7cd){var _0x2a0c4={'agent':{},'channel':'whatsapp'};if(_0x570c23[_0x8fd2('0x54')]['id']){delete _0x570c23['body']['id'];}_0x570c23['body']['UserId']=_0x570c23[_0x8fd2('0x54')]['UserId']||_0x570c23[_0x8fd2('0x5c')]['id'];_0x2a0c4['agent']['id']=_0x570c23['body'][_0x8fd2('0x5b')];return db[_0x8fd2('0x3a')]['find']({'where':{'id':_0x570c23[_0x8fd2('0x51')]['id'],'UserId':null}})[_0x8fd2('0x1e')](handleEntityNotFound(_0x26e4b9,null))[_0x8fd2('0x1e')](function(_0x1b1255){if(_0x1b1255){_0x2a0c4['message']=_0x1b1255['get']({'plain':!![]});return db[_0x8fd2('0x5f')]['find']({'where':{'id':_0x1b1255[_0x8fd2('0x60')]}});}return null;})[_0x8fd2('0x1e')](handleEntityNotFound(_0x26e4b9,null))['then'](function(_0x1a96f7){if(_0x1a96f7){_0x2a0c4[_0x8fd2('0x65')]=_0x1a96f7[_0x8fd2('0x5e')]({'plain':!![]});interaction_log[_0x8fd2('0x1f')](_0x8fd2('0x78'),_0x570c23[_0x8fd2('0x5c')]['id'],_0x570c23[_0x8fd2('0x5c')]['name'],_0x570c23[_0x8fd2('0x5c')][_0x8fd2('0x64')],_0x2a0c4[_0x8fd2('0x65')]['id'],_0x570c23[_0x8fd2('0x54')]?JSON['stringify'](_0x570c23[_0x8fd2('0x54')]):_0x8fd2('0x66'));return respondWithRpcPromise(_0x8fd2('0x79'),_0x8fd2('0x7a'),_0x2a0c4);}return null;})['then'](function(_0x4d229a){var _0x1f01e6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d229a['message'][_0x8fd2('0x69')];return db['sequelize']['query'](_0x1f01e6,{'type':db[_0x8fd2('0x7b')][_0x8fd2('0x6b')][_0x8fd2('0x6c')],'raw':!![]})[_0x8fd2('0x1e')](function(_0x1a1daf){return _0x1a1daf;});})[_0x8fd2('0x1e')](function(_0x15df51){if(_0x15df51){_0x2a0c4['message'][_0x8fd2('0x7c')]=_0x15df51[0x0];if(!_0x570c23[_0x8fd2('0x54')][_0x8fd2('0x5b')])return;return db[_0x8fd2('0x6d')]['find']({'where':{'id':_0x570c23[_0x8fd2('0x54')]['UserId'],'role':'agent'},'attributes':['id',_0x8fd2('0x37'),_0x8fd2('0x6e'),_0x8fd2('0x6f'),_0x8fd2('0x70')],'raw':!![]});}return null;})[_0x8fd2('0x1e')](function(_0xe90905){if(!_0xe90905)return null;_0x2a0c4[_0x8fd2('0x26')][_0x8fd2('0x5d')]=_0xe90905;return _0x2a0c4;})['then'](function(_0x58fbd6){if(_0x58fbd6){_0x58fbd6[_0x8fd2('0x26')][_0x8fd2('0x7d')]=util[_0x8fd2('0x63')](_0x8fd2('0x72'),_0x570c23['user'][_0x8fd2('0x37')]);_0x58fbd6[_0x8fd2('0x26')]['channel']=_0x2a0c4[_0x8fd2('0x73')];_0x58fbd6[_0x8fd2('0x26')]['motionChannel']=_0x2a0c4[_0x8fd2('0x73')];_0x58fbd6[_0x8fd2('0x26')]['event']=_0x8fd2('0x32');respondWithRpcPromise(_0x8fd2('0x76'),_0x8fd2('0x76'),{'event':_0x8fd2('0x7e'),'message':_0x58fbd6[_0x8fd2('0x26')]},client9002);return _0x2a0c4;}return null;})[_0x8fd2('0x1e')](respondWithResult(_0x26e4b9,null))['catch'](handleError(_0x26e4b9,null));};exports[_0x8fd2('0x2a')]=function(_0xd79110,_0x451fe7,_0xdb481f){if(_0xd79110[_0x8fd2('0x54')]['id']){delete _0xd79110[_0x8fd2('0x54')]['id'];}var _0x411a45;return db[_0x8fd2('0x3a')][_0x8fd2('0x55')]({'where':{'id':_0xd79110[_0x8fd2('0x51')]['id']}})[_0x8fd2('0x1e')](handleEntityNotFound(_0x451fe7,null))['then'](function(_0x58408a){if(_0x58408a){_0x411a45=_0x58408a;return db[_0x8fd2('0x7f')]['find']({'where':{'id':_0x58408a[_0x8fd2('0x80')]}});}})['then'](handleEntityNotFound(_0x451fe7,null))[_0x8fd2('0x1e')](function(_0x5db816){if(_0x5db816){logger['debug'](_0x8fd2('0x81'),_0x8fd2('0x2a'),_0x8fd2('0x82'),_0x5db816[_0x8fd2('0x3c')],util['inspect'](_0xd79110['body'],{'showHidden':![],'depth':null}));switch(_0x5db816['type']){case _0x8fd2('0x83'):if(_0xd79110[_0x8fd2('0x54')][_0x8fd2('0x84')]&&_0xd79110['body'][_0x8fd2('0x84')]===_0x411a45[_0x8fd2('0x85')]&&_0xd79110['body']['MessageStatus']&&_0xd79110[_0x8fd2('0x54')]['MessageStatus']==='read'){return _0x411a45[_0x8fd2('0x34')]({'read':!![]});}else{logger[_0x8fd2('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x8fd2('0x83'),util[_0x8fd2('0x86')](_0xd79110['body'],{'showHidden':![],'depth':null}));}break;}return _0x411a45;}})[_0x8fd2('0x1e')](respondWithResult(_0x451fe7,null))[_0x8fd2('0x28')](handleError(_0x451fe7,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index f495818..30d3852 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 _0x7072=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0xdb3bd7,_0x2a2cd0){var _0x4c071d=function(_0x1f8a04){while(--_0x1f8a04){_0xdb3bd7['push'](_0xdb3bd7['shift']());}};_0x4c071d(++_0x2a2cd0);}(_0x7072,0x138));var _0x2707=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7072[_0x1eda20];return _0x31b953;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2707('0x0'))['db'][_0x2707('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2707('0x2')](0x0);var events={'afterCreate':_0x2707('0x3'),'afterUpdate':_0x2707('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5af54f){return function(_0xfdfa7a,_0x5f3c1c,_0xd36287){WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f+':'+_0xfdfa7a['id'],_0xfdfa7a);WhatsappMessageEvents[_0x2707('0x5')](_0x5af54f,_0xfdfa7a);_0xd36287(null);};}for(var e in events){if(events[_0x2707('0x6')](e)){var event=events[e];WhatsappMessage[_0x2707('0x7')](e,emitEvent(event));}}module[_0x2707('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0427=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','WhatsappMessage'];(function(_0x225882,_0x56198c){var _0x25682c=function(_0x10fa44){while(--_0x10fa44){_0x225882['push'](_0x225882['shift']());}};_0x25682c(++_0x56198c);}(_0x0427,0x137));var _0x7042=function(_0x34319a,_0x1509eb){_0x34319a=_0x34319a-0x0;var _0x8ff628=_0x0427[_0x34319a];return _0x8ff628;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x7042('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7042('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7042('0x2'),'afterDestroy':_0x7042('0x3')};function emitEvent(_0xae8bc2){return function(_0x1db1f3,_0xa72963,_0x343a69){WhatsappMessageEvents[_0x7042('0x4')](_0xae8bc2+':'+_0x1db1f3['id'],_0x1db1f3);WhatsappMessageEvents['emit'](_0xae8bc2,_0x1db1f3);_0x343a69(null);};}for(var e in events){if(events[_0x7042('0x5')](e)){var event=events[e];WhatsappMessage[_0x7042('0x6')](e,emitEvent(event));}}module[_0x7042('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 0690a19..abde7da 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 _0xe46f=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','error','out','WhatsappAccount','find','type','twilio','authToken','phone','accountSid','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci'];(function(_0x37a8d8,_0x172e04){var _0x56e093=function(_0x2f7452){while(--_0x2f7452){_0x37a8d8['push'](_0x37a8d8['shift']());}};_0x56e093(++_0x172e04);}(_0xe46f,0x157));var _0xfe46=function(_0xf237f7,_0xb11ac){_0xf237f7=_0xf237f7-0x0;var _0x2c183b=_0xe46f[_0xf237f7];return _0x2c183b;};'use strict';var _=require('lodash');var util=require(_0xfe46('0x0'));var logger=require(_0xfe46('0x1'))(_0xfe46('0x2'));var moment=require(_0xfe46('0x3'));var BPromise=require(_0xfe46('0x4'));var rp=require(_0xfe46('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfe46('0x6'));var attributes=require(_0xfe46('0x7'));module[_0xfe46('0x8')]=function(_0x11803e,_0x752d09){return _0x11803e[_0xfe46('0x9')](_0xfe46('0xa'),attributes,{'tableName':_0xfe46('0xb'),'paranoid':![],'indexes':[{'name':_0xfe46('0xc'),'fields':['messageId']},{'name':_0xfe46('0xd'),'fields':[_0xfe46('0xe')],'type':_0xfe46('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e113,_0x325796,_0x3eb9fe){var _0x5fd1a1=_0x11803e['models'];var _0x46ed94=_0x30e113[_0xfe46('0x10')]({'plain':!![]});if(_0x46ed94[_0xfe46('0x11')][_0xfe46('0x12')]()==='in'||_0x46ed94[_0xfe46('0x11')]['toLowerCase']()==='out'&&!_0x46ed94[_0xfe46('0x13')]&&!_[_0xfe46('0x14')](_0x46ed94['UserId'])){_0x5fd1a1[_0xfe46('0x15')]['findOne']({'where':{'id':_0x46ed94[_0xfe46('0x16')]}})[_0xfe46('0x17')](function(_0x4907de){if(_0x4907de){_0x4907de[_0xfe46('0x18')]({'lastMsgAt':_0x46ed94[_0xfe46('0x19')],'lastMsgDirection':_0x46ed94['direction']['toLowerCase']()});}})['catch'](function(_0xef3786){console[_0xfe46('0x1a')](_0xef3786);});}if(_0x46ed94[_0xfe46('0x11')]===_0xfe46('0x1b')&&!_0x46ed94[_0xfe46('0x13')]){var _0x3ede94;_0x5fd1a1[_0xfe46('0x1c')][_0xfe46('0x1d')]({'where':{'id':_0x46ed94['WhatsappAccountId']},'raw':!![]})[_0xfe46('0x17')](function(_0x56786a){_0x3ede94=_0x56786a;if(_0x3ede94&&_0x3ede94[_0xfe46('0x1e')]){switch(_0x3ede94[_0xfe46('0x1e')]){case _0xfe46('0x1f'):var _0x13bcc7=require(_0xfe46('0x1f'));if(_0x3ede94['accountSid']&&_0x3ede94[_0xfe46('0x20')]&&_0x3ede94[_0xfe46('0x21')]){var _0x16135d=new _0x13bcc7(_0x3ede94[_0xfe46('0x22')],_0x3ede94[_0xfe46('0x20')]);_0x16135d['messages'][_0xfe46('0x23')]({'body':_0x46ed94['body'],'to':_0xfe46('0x24')+_0x46ed94[_0xfe46('0x21')],'from':_0xfe46('0x24')+_0x3ede94[_0xfe46('0x21')],'statusCallback':_0x3ede94[_0xfe46('0x25')]+_0xfe46('0x26')+_0x46ed94['id']+_0xfe46('0x27')+_0x3ede94[_0xfe46('0x28')]})[_0xfe46('0x17')](function(_0x447c81){if(_0x447c81[_0xfe46('0x29')]){return _0x30e113[_0xfe46('0x18')]({'messageId':_0x447c81['sid']});}})[_0xfe46('0x2a')](function(_0xb68081){logger[_0xfe46('0x1a')](_0xfe46('0x2b'),_0xfe46('0x2c'),'twilio',util[_0xfe46('0x2d')](_0xb68081,{'showHidden':![],'depth':null}));});}else{logger[_0xfe46('0x1a')](_0xfe46('0x2b'),_0xfe46('0x2c'),_0xfe46('0x1f'),_0xfe46('0x2e'));}break;}}})[_0xfe46('0x2f')](function(){_0x3eb9fe();});}else{_0x3eb9fe();}}},'charset':'utf8mb4','collate':_0xfe46('0x30')});}; \ No newline at end of file +var _0x0442=['create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','then','type','twilio','accountSid','authToken','phone','messages'];(function(_0x2dc949,_0x380aec){var _0x53c9f5=function(_0x474f17){while(--_0x474f17){_0x2dc949['push'](_0x2dc949['shift']());}};_0x53c9f5(++_0x380aec);}(_0x0442,0x1e2));var _0x2044=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0x0442[_0x51b661];return _0x5d1971;};'use strict';var _=require(_0x2044('0x0'));var util=require(_0x2044('0x1'));var logger=require(_0x2044('0x2'))('api');var moment=require(_0x2044('0x3'));var BPromise=require(_0x2044('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2044('0x5'));var rimraf=require(_0x2044('0x6'));var config=require(_0x2044('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x2044('0x8')]=function(_0x4a18a7,_0x434b8b){return _0x4a18a7[_0x2044('0x9')](_0x2044('0xa'),attributes,{'tableName':_0x2044('0xb'),'paranoid':![],'indexes':[{'name':_0x2044('0xc'),'fields':[_0x2044('0xc')]},{'name':_0x2044('0xd'),'fields':[_0x2044('0xe')],'type':_0x2044('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39c32b,_0x42da30,_0x4c23a0){var _0x2e996f=_0x4a18a7[_0x2044('0x10')];var _0x507a2e=_0x39c32b[_0x2044('0x11')]({'plain':!![]});if(_0x507a2e[_0x2044('0x12')][_0x2044('0x13')]()==='in'||_0x507a2e[_0x2044('0x12')][_0x2044('0x13')]()===_0x2044('0x14')&&!_0x507a2e[_0x2044('0x15')]&&!_[_0x2044('0x16')](_0x507a2e[_0x2044('0x17')])){_0x2e996f['WhatsappInteraction']['findOne']({'where':{'id':_0x507a2e[_0x2044('0x18')]}})['then'](function(_0x5dd50c){if(_0x5dd50c){_0x5dd50c[_0x2044('0x19')]({'lastMsgAt':_0x507a2e[_0x2044('0x1a')],'lastMsgDirection':_0x507a2e[_0x2044('0x12')]['toLowerCase']()});}})[_0x2044('0x1b')](function(_0x19e2ad){console[_0x2044('0x1c')](_0x19e2ad);});}if(_0x507a2e[_0x2044('0x12')]===_0x2044('0x14')&&!_0x507a2e[_0x2044('0x15')]){var _0x1dc64f;_0x2e996f[_0x2044('0x1d')][_0x2044('0x1e')]({'where':{'id':_0x507a2e['WhatsappAccountId']},'raw':!![]})[_0x2044('0x1f')](function(_0x3be812){_0x1dc64f=_0x3be812;if(_0x1dc64f&&_0x1dc64f[_0x2044('0x20')]){switch(_0x1dc64f['type']){case _0x2044('0x21'):var _0x5083d6=require(_0x2044('0x21'));if(_0x1dc64f[_0x2044('0x22')]&&_0x1dc64f[_0x2044('0x23')]&&_0x1dc64f[_0x2044('0x24')]){var _0x51a970=new _0x5083d6(_0x1dc64f[_0x2044('0x22')],_0x1dc64f[_0x2044('0x23')]);_0x51a970[_0x2044('0x25')][_0x2044('0x26')]({'body':_0x507a2e[_0x2044('0xe')],'to':_0x2044('0x27')+_0x507a2e[_0x2044('0x24')],'from':_0x2044('0x27')+_0x1dc64f[_0x2044('0x24')],'statusCallback':_0x1dc64f[_0x2044('0x28')]+_0x2044('0x29')+_0x507a2e['id']+_0x2044('0x2a')+_0x1dc64f[_0x2044('0x2b')]})['then'](function(_0x3e8895){if(_0x3e8895[_0x2044('0x2c')]){return _0x39c32b['update']({'messageId':_0x3e8895['sid']});}})[_0x2044('0x1b')](function(_0x5a4bba){logger[_0x2044('0x1c')](_0x2044('0x2d'),'afterCreate',_0x2044('0x21'),util[_0x2044('0x2e')](_0x5a4bba,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2044('0x2d'),_0x2044('0x2f'),_0x2044('0x21'),_0x2044('0x30'));}break;}}})[_0x2044('0x31')](function(){_0x4c23a0();});}else{_0x4c23a0();}}},'charset':_0x2044('0x32'),'collate':_0x2044('0x33')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 594afa4..35eefe8 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 _0x5d67=['error','code','message','result','catch','CreateWhatsappMessage','body','options','raw','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5ddb5f,_0x62dc79){var _0x5b6825=function(_0x402d34){while(--_0x402d34){_0x5ddb5f['push'](_0x5ddb5f['shift']());}};_0x5b6825(++_0x62dc79);}(_0x5d67,0x15f));var _0x75d6=function(_0x3fbd66,_0x26be2f){_0x3fbd66=_0x3fbd66-0x0;var _0x78d3d9=_0x5d67[_0x3fbd66];return _0x78d3d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x75d6('0x0'));var BPromise=require(_0x75d6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75d6('0x2'));var db=require(_0x75d6('0x3'))['db'];var utils=require(_0x75d6('0x4'));var logger=require(_0x75d6('0x5'))(_0x75d6('0x6'));var config=require(_0x75d6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x75d6('0x8')][_0x75d6('0x9')]({'port':0x232a});config[_0x75d6('0xa')]=_[_0x75d6('0xb')](config['redis'],{'host':_0x75d6('0xc'),'port':0x18eb});var socket=require(_0x75d6('0xd'))(new Redis(config[_0x75d6('0xa')]));require(_0x75d6('0xe'))[_0x75d6('0xf')](socket);function respondWithRpcPromise(_0x1a57d3,_0xbaad2f,_0x3883bf){return new BPromise(function(_0x4b7e01,_0x2b4b51){return client['request'](_0x1a57d3,_0x3883bf)['then'](function(_0x15e191){logger[_0x75d6('0x10')](_0x75d6('0x11'),_0xbaad2f,_0x75d6('0x12'));logger[_0x75d6('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xbaad2f,_0x75d6('0x12'),JSON[_0x75d6('0x14')](_0x15e191));if(_0x15e191[_0x75d6('0x15')]){if(_0x15e191['error'][_0x75d6('0x16')]===0x1f4){logger[_0x75d6('0x15')](_0x75d6('0x11'),_0xbaad2f,_0x15e191[_0x75d6('0x15')]['message']);return _0x2b4b51(_0x15e191[_0x75d6('0x15')][_0x75d6('0x17')]);}logger[_0x75d6('0x15')](_0x75d6('0x11'),_0xbaad2f,_0x15e191['error'][_0x75d6('0x17')]);return _0x4b7e01(_0x15e191['error'][_0x75d6('0x17')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xbaad2f,_0x75d6('0x12'));_0x4b7e01(_0x15e191[_0x75d6('0x18')]['message']);}})[_0x75d6('0x19')](function(_0x2b44bf){logger[_0x75d6('0x15')](_0x75d6('0x11'),_0xbaad2f,_0x2b44bf);_0x2b4b51(_0x2b44bf);});});}exports[_0x75d6('0x1a')]=function(_0x3c7570){var _0x4bd929=this;return new Promise(function(_0x316d72,_0xac41c8){return db['WhatsappMessage']['create'](_0x3c7570[_0x75d6('0x1b')],{'raw':_0x3c7570[_0x75d6('0x1c')]?_0x3c7570[_0x75d6('0x1c')][_0x75d6('0x1d')]===undefined?!![]:![]:!![]})[_0x75d6('0x1e')](function(_0x5d7dc4){logger[_0x75d6('0x10')](_0x75d6('0x1a'),_0x3c7570);logger[_0x75d6('0x13')](_0x75d6('0x1a'),_0x3c7570,JSON['stringify'](_0x5d7dc4));_0x316d72(_0x5d7dc4);})[_0x75d6('0x19')](function(_0x560a9c){logger[_0x75d6('0x15')](_0x75d6('0x1a'),_0x560a9c[_0x75d6('0x17')],_0x3c7570);_0xac41c8(_0x4bd929[_0x75d6('0x15')](0x1f4,_0x560a9c[_0x75d6('0x17')]));});});}; \ No newline at end of file +var _0x5f7a=['debug','stringify','error','code','message','request\x20sent','catch','CreateWhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappMessage,\x20%s,\x20%s'];(function(_0x5f43b3,_0x3e64d7){var _0xbc3960=function(_0x4efdf8){while(--_0x4efdf8){_0x5f43b3['push'](_0x5f43b3['shift']());}};_0xbc3960(++_0x3e64d7);}(_0x5f7a,0xec));var _0xa5f7=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x5f7a[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xa5f7('0x0'));var util=require(_0xa5f7('0x1'));var moment=require(_0xa5f7('0x2'));var BPromise=require(_0xa5f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5f7('0x4'));var db=require(_0xa5f7('0x5'))['db'];var utils=require(_0xa5f7('0x6'));var logger=require(_0xa5f7('0x7'))(_0xa5f7('0x8'));var config=require(_0xa5f7('0x9'));var jayson=require(_0xa5f7('0xa'));var client=jayson['client'][_0xa5f7('0xb')]({'port':0x232a});config[_0xa5f7('0xc')]=_[_0xa5f7('0xd')](config[_0xa5f7('0xc')],{'host':_0xa5f7('0xe'),'port':0x18eb});var socket=require(_0xa5f7('0xf'))(new Redis(config[_0xa5f7('0xc')]));require('./whatsappMessage.socket')[_0xa5f7('0x10')](socket);function respondWithRpcPromise(_0xd76e9,_0x152d45,_0x12fa5f){return new BPromise(function(_0x2ba1cc,_0x1c240e){return client[_0xa5f7('0x11')](_0xd76e9,_0x12fa5f)[_0xa5f7('0x12')](function(_0x555a2b){logger['info'](_0xa5f7('0x13'),_0x152d45,'request\x20sent');logger[_0xa5f7('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x152d45,'request\x20sent',JSON[_0xa5f7('0x15')](_0x555a2b));if(_0x555a2b[_0xa5f7('0x16')]){if(_0x555a2b['error'][_0xa5f7('0x17')]===0x1f4){logger['error'](_0xa5f7('0x13'),_0x152d45,_0x555a2b[_0xa5f7('0x16')]['message']);return _0x1c240e(_0x555a2b[_0xa5f7('0x16')][_0xa5f7('0x18')]);}logger[_0xa5f7('0x16')](_0xa5f7('0x13'),_0x152d45,_0x555a2b[_0xa5f7('0x16')][_0xa5f7('0x18')]);return _0x2ba1cc(_0x555a2b['error'][_0xa5f7('0x18')]);}else{logger['info'](_0xa5f7('0x13'),_0x152d45,_0xa5f7('0x19'));_0x2ba1cc(_0x555a2b['result'][_0xa5f7('0x18')]);}})[_0xa5f7('0x1a')](function(_0x4443d1){logger[_0xa5f7('0x16')](_0xa5f7('0x13'),_0x152d45,_0x4443d1);_0x1c240e(_0x4443d1);});});}exports[_0xa5f7('0x1b')]=function(_0x23c560){var _0x1e4efc=this;return new Promise(function(_0x190269,_0x220cf9){return db['WhatsappMessage'][_0xa5f7('0x1c')](_0x23c560[_0xa5f7('0x1d')],{'raw':_0x23c560[_0xa5f7('0x1e')]?_0x23c560[_0xa5f7('0x1e')][_0xa5f7('0x1f')]===undefined?!![]:![]:!![]})[_0xa5f7('0x12')](function(_0xddcb54){logger['info']('CreateWhatsappMessage',_0x23c560);logger[_0xa5f7('0x14')](_0xa5f7('0x1b'),_0x23c560,JSON[_0xa5f7('0x15')](_0xddcb54));_0x190269(_0xddcb54);})[_0xa5f7('0x1a')](function(_0x40f814){logger[_0xa5f7('0x16')]('CreateWhatsappMessage',_0x40f814[_0xa5f7('0x18')],_0x23c560);_0x220cf9(_0x1e4efc[_0xa5f7('0x16')](0x1f4,_0x40f814[_0xa5f7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index fbd53f1..3990ab4 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 _0xefb8=['register','length','whatsappMessage:','remove','emit','removeListener'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xefb8,0xf3));var _0x8efb=function(_0x2e20a8,_0x341bf4){_0x2e20a8=_0x2e20a8-0x0;var _0x48df32=_0xefb8[_0x2e20a8];return _0x48df32;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x8efb('0x0'),'update'];function createListener(_0x90bfd,_0x7dea6b){return function(_0x424df0){_0x7dea6b[_0x8efb('0x1')](_0x90bfd,_0x424df0);};}function removeListener(_0x1d2bf5,_0x658655){return function(){WhatsappMessageEvents[_0x8efb('0x2')](_0x1d2bf5,_0x658655);};}exports[_0x8efb('0x3')]=function(_0x1cb869){for(var _0x331c23=0x0,_0x29ac69=events[_0x8efb('0x4')];_0x331c23<_0x29ac69;_0x331c23++){var _0x3a80f3=events[_0x331c23];var _0x58a3b4=createListener(_0x8efb('0x5')+_0x3a80f3,_0x1cb869);WhatsappMessageEvents['on'](_0x3a80f3,_0x58a3b4);}}; \ No newline at end of file +var _0x04bc=['removeListener','whatsappMessage:','./whatsappMessage.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04bc,0x92));var _0xc04b=function(_0x218db7,_0x196f29){_0x218db7=_0x218db7-0x0;var _0x4c8f5f=_0x04bc[_0x218db7];return _0x4c8f5f;};'use strict';var WhatsappMessageEvents=require(_0xc04b('0x0'));var events=[_0xc04b('0x1'),'remove',_0xc04b('0x2')];function createListener(_0x21c92d,_0xc621c8){return function(_0x3330b1){_0xc621c8[_0xc04b('0x3')](_0x21c92d,_0x3330b1);};}function removeListener(_0x1ea8ac,_0x469061){return function(){WhatsappMessageEvents[_0xc04b('0x4')](_0x1ea8ac,_0x469061);};}exports['register']=function(_0x1c8ee0){for(var _0x191949=0x0,_0x460285=events['length'];_0x191949<_0x460285;_0x191949++){var _0xee5f17=events[_0x191949];var _0x32312b=createListener(_0xc04b('0x5')+_0xee5f17,_0x1c8ee0);WhatsappMessageEvents['on'](_0xee5f17,_0x32312b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 73b0119..6d6d02f 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 _0xeed4=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','removeTeams','exports'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0xeed4,0x1cb));var _0x4eed=function(_0x169d7f,_0x129afd){_0x169d7f=_0x169d7f-0x0;var _0x28e8c=_0xeed4[_0x169d7f];return _0x28e8c;};'use strict';var multer=require(_0x4eed('0x0'));var util=require('util');var path=require(_0x4eed('0x1'));var timeout=require(_0x4eed('0x2'));var express=require(_0x4eed('0x3'));var router=express[_0x4eed('0x4')]();var fs_extra=require(_0x4eed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4eed('0x6'));var config=require(_0x4eed('0x7'));var controller=require(_0x4eed('0x8'));router[_0x4eed('0x9')]('/',auth[_0x4eed('0xa')](),controller[_0x4eed('0xb')]);router[_0x4eed('0x9')](_0x4eed('0xc'),auth[_0x4eed('0xa')](),controller[_0x4eed('0xd')]);router[_0x4eed('0x9')](_0x4eed('0xe'),auth['isAuthenticated'](),controller[_0x4eed('0xf')]);router[_0x4eed('0x9')]('/:id/members',auth[_0x4eed('0xa')](),controller['getMembers']);router[_0x4eed('0x9')](_0x4eed('0x10'),auth['isAuthenticated'](),controller[_0x4eed('0x11')]);router[_0x4eed('0x9')](_0x4eed('0x12'),auth['isAuthenticated'](),controller[_0x4eed('0x13')]);router[_0x4eed('0x14')]('/',auth[_0x4eed('0xa')](),controller['create']);router[_0x4eed('0x14')](_0x4eed('0x10'),auth['isAuthenticated'](),controller[_0x4eed('0x15')]);router[_0x4eed('0x14')](_0x4eed('0x12'),auth[_0x4eed('0xa')](),controller[_0x4eed('0x16')]);router[_0x4eed('0x17')](_0x4eed('0xe'),auth[_0x4eed('0xa')](),controller['update']);router[_0x4eed('0x18')]('/:id',auth[_0x4eed('0xa')](),controller['destroy']);router[_0x4eed('0x18')](_0x4eed('0x10'),auth[_0x4eed('0xa')](),controller[_0x4eed('0x19')]);router[_0x4eed('0x18')](_0x4eed('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x4eed('0x1a')]=router; \ No newline at end of file +var _0x416e=['index','/describe','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x4edafe,_0x1b3031){var _0x100a2d=function(_0x3c7c6c){while(--_0x3c7c6c){_0x4edafe['push'](_0x4edafe['shift']());}};_0x100a2d(++_0x1b3031);}(_0x416e,0xb3));var _0xe416=function(_0x798ad0,_0xefa3c1){_0x798ad0=_0x798ad0-0x0;var _0x66039e=_0x416e[_0x798ad0];return _0x66039e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe416('0x0'));var timeout=require('connect-timeout');var express=require(_0xe416('0x1'));var router=express[_0xe416('0x2')]();var fs_extra=require(_0xe416('0x3'));var auth=require(_0xe416('0x4'));var interaction=require(_0xe416('0x5'));var config=require(_0xe416('0x6'));var controller=require(_0xe416('0x7'));router[_0xe416('0x8')]('/',auth[_0xe416('0x9')](),controller[_0xe416('0xa')]);router[_0xe416('0x8')](_0xe416('0xb'),auth[_0xe416('0x9')](),controller['describe']);router[_0xe416('0x8')]('/:id',auth[_0xe416('0x9')](),controller['show']);router[_0xe416('0x8')](_0xe416('0xc'),auth[_0xe416('0x9')](),controller[_0xe416('0xd')]);router['get'](_0xe416('0xe'),auth[_0xe416('0x9')](),controller[_0xe416('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xe416('0x10')]('/',auth[_0xe416('0x9')](),controller[_0xe416('0x11')]);router['post'](_0xe416('0xe'),auth[_0xe416('0x9')](),controller[_0xe416('0x12')]);router[_0xe416('0x10')](_0xe416('0x13'),auth[_0xe416('0x9')](),controller[_0xe416('0x14')]);router[_0xe416('0x15')]('/:id',auth[_0xe416('0x9')](),controller[_0xe416('0x16')]);router[_0xe416('0x17')](_0xe416('0x18'),auth[_0xe416('0x9')](),controller[_0xe416('0x19')]);router['delete']('/:id/teams',auth[_0xe416('0x9')](),controller['removeTeams']);router[_0xe416('0x17')]('/:id/users',auth[_0xe416('0x9')](),controller['removeAgents']);module[_0xe416('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a6cea43..3d33090 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 _0xf290=['ENUM','rrmemory','beepall','roundrobin','STRING','exports','name'];(function(_0x1e5f76,_0x288ae4){var _0x452f4e=function(_0x3e6643){while(--_0x3e6643){_0x1e5f76['push'](_0x1e5f76['shift']());}};_0x452f4e(++_0x288ae4);}(_0xf290,0xde));var _0x0f29=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xf290[_0x270adf];return _0x29eda9;};'use strict';var Sequelize=require('sequelize');module[_0x0f29('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0f29('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f29('0x2')](_0x0f29('0x3'),_0x0f29('0x4'),_0x0f29('0x5'))},'description':{'type':Sequelize[_0x0f29('0x6')]}}; \ No newline at end of file +var _0x9780=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9780,0x1d4));var _0x0978=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x9780[_0x3b8ed6];return _0x2e6223;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0978('0x0')],'unique':_0x0978('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0978('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0978('0x3')](_0x0978('0x4'),_0x0978('0x5'),_0x0978('0x6'))},'description':{'type':Sequelize[_0x0978('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d7b5e8d..9d81d33 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 _0x6011=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','WhatsappQueues','stack','name','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','format','SIP','whatsappPause','createdAt','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xf9fd03,_0x3ea33c){var _0x287128=function(_0x7c8d5e){while(--_0x7c8d5e){_0xf9fd03['push'](_0xf9fd03['shift']());}};_0x287128(++_0x3ea33c);}(_0x6011,0x84));var _0x1601=function(_0x7b03b7,_0x36211c){_0x7b03b7=_0x7b03b7-0x0;var _0x16adb7=_0x6011[_0x7b03b7];return _0x16adb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1601('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1601('0x1'));var rp=require(_0x1601('0x2'));var moment=require(_0x1601('0x3'));var BPromise=require(_0x1601('0x4'));var Mustache=require(_0x1601('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1601('0x6'));var csv=require('to-csv');var ejs=require(_0x1601('0x7'));var fs=require('fs');var fs_extra=require(_0x1601('0x8'));var _=require(_0x1601('0x9'));var squel=require(_0x1601('0xa'));var crypto=require(_0x1601('0xb'));var jsforce=require(_0x1601('0xc'));var deskjs=require(_0x1601('0xd'));var toCsv=require(_0x1601('0xe'));var querystring=require(_0x1601('0xf'));var Papa=require('papaparse');var Redis=require(_0x1601('0x10'));var authService=require(_0x1601('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1601('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1601('0x13'));var utils=require(_0x1601('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1601('0x15'));var db=require(_0x1601('0x16'))['db'];config[_0x1601('0x17')]=_['defaults'](config['redis'],{'host':_0x1601('0x18'),'port':0x18eb});var socket=require(_0x1601('0x19'))(new Redis(config[_0x1601('0x17')]));require(_0x1601('0x1a'))['register'](socket);function respondWithStatusCode(_0x1819e9,_0x5823c7){_0x5823c7=_0x5823c7||0xcc;return function(_0x100778){if(_0x100778){return _0x1819e9[_0x1601('0x1b')](_0x5823c7);}return _0x1819e9[_0x1601('0x1c')](_0x5823c7)[_0x1601('0x1d')]();};}function respondWithResult(_0x20ccd2,_0x51082a){_0x51082a=_0x51082a||0xc8;return function(_0xc4144f){if(_0xc4144f){return _0x20ccd2[_0x1601('0x1c')](_0x51082a)[_0x1601('0x1e')](_0xc4144f);}};}function respondWithFilteredResult(_0x207fc2,_0x57f1c3){return function(_0x4e5c57){if(_0x4e5c57){var _0x1f5284=typeof _0x57f1c3[_0x1601('0x1f')]==='undefined'&&typeof _0x57f1c3[_0x1601('0x20')]===_0x1601('0x21');var _0x28c4a3=_0x4e5c57[_0x1601('0x22')];var _0x2ac2fe=_0x1f5284?0x0:_0x57f1c3[_0x1601('0x1f')];var _0x84ce50=_0x1f5284?_0x4e5c57['count']:_0x57f1c3[_0x1601('0x1f')]+_0x57f1c3[_0x1601('0x20')];var _0x11d2db;if(_0x84ce50>=_0x28c4a3){_0x84ce50=_0x28c4a3;_0x11d2db=0xc8;}else{_0x11d2db=0xce;}_0x207fc2[_0x1601('0x1c')](_0x11d2db);return _0x207fc2[_0x1601('0x23')]('Content-Range',_0x2ac2fe+'-'+_0x84ce50+'/'+_0x28c4a3)[_0x1601('0x1e')](_0x4e5c57);}return null;};}function patchUpdates(_0x5651f9){return function(_0x2e2158){try{jsonpatch[_0x1601('0x24')](_0x2e2158,_0x5651f9,!![]);}catch(_0x170a9f){return BPromise['reject'](_0x170a9f);}return _0x2e2158[_0x1601('0x25')]();};}function saveUpdates(_0x23d3fd,_0x105e98){return function(_0x2a4ccb){if(_0x2a4ccb){return _0x2a4ccb[_0x1601('0x26')](_0x23d3fd)[_0x1601('0x27')](function(_0x27a7d0){return _0x27a7d0;});}return null;};}function removeEntity(_0x547b96,_0x37e6d2){return function(_0x11de8d){if(_0x11de8d){return _0x11de8d[_0x1601('0x28')]()[_0x1601('0x27')](function(){var _0x5d3f9b=_0x11de8d[_0x1601('0x29')]({'plain':!![]});var _0x3e14d2=_0x1601('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e14d2,'resourceId':_0x5d3f9b['id']}})[_0x1601('0x27')](function(){return _0x11de8d;});})['then'](function(){_0x547b96[_0x1601('0x1c')](0xcc)[_0x1601('0x1d')]();});}};}function handleEntityNotFound(_0x16c6b0,_0x431638){return function(_0x24bc6b){if(!_0x24bc6b){_0x16c6b0[_0x1601('0x1b')](0x194);}return _0x24bc6b;};}function handleError(_0x2082ae,_0x48b50f){_0x48b50f=_0x48b50f||0x1f4;return function(_0x5b9225){logger['error'](_0x5b9225[_0x1601('0x2b')]);if(_0x5b9225[_0x1601('0x2c')]){delete _0x5b9225[_0x1601('0x2c')];}_0x2082ae[_0x1601('0x1c')](_0x48b50f)['send'](_0x5b9225);};}exports[_0x1601('0x2d')]=function(_0x5b291d,_0xbd2450){var _0x486a2d={},_0x5d4aab={},_0xb54c0b={'count':0x0,'rows':[]};var _0x124711=_[_0x1601('0x2e')](db[_0x1601('0x2f')]['rawAttributes'],function(_0x317557){return{'name':_0x317557[_0x1601('0x30')],'type':_0x317557[_0x1601('0x31')][_0x1601('0x32')]};});_0x5d4aab[_0x1601('0x33')]=_[_0x1601('0x2e')](_0x124711,_0x1601('0x2c'));_0x5d4aab[_0x1601('0x34')]=_[_0x1601('0x35')](_0x5b291d['query']);_0x5d4aab['filters']=_[_0x1601('0x36')](_0x5d4aab[_0x1601('0x33')],_0x5d4aab[_0x1601('0x34')]);_0x486a2d[_0x1601('0x37')]=_[_0x1601('0x36')](_0x5d4aab[_0x1601('0x33')],qs[_0x1601('0x38')](_0x5b291d[_0x1601('0x34')][_0x1601('0x38')]));_0x486a2d[_0x1601('0x37')]=_0x486a2d['attributes']['length']?_0x486a2d[_0x1601('0x37')]:_0x5d4aab[_0x1601('0x33')];if(!_0x5b291d[_0x1601('0x34')][_0x1601('0x39')](_0x1601('0x3a'))){_0x486a2d[_0x1601('0x20')]=qs[_0x1601('0x20')](_0x5b291d['query'][_0x1601('0x20')]);_0x486a2d['offset']=qs['offset'](_0x5b291d['query'][_0x1601('0x1f')]);}_0x486a2d[_0x1601('0x3b')]=qs[_0x1601('0x3c')](_0x5b291d[_0x1601('0x34')][_0x1601('0x3c')]);_0x486a2d[_0x1601('0x3d')]=qs['filters'](_[_0x1601('0x3e')](_0x5b291d[_0x1601('0x34')],_0x5d4aab[_0x1601('0x3f')]),_0x124711);if(_0x5b291d[_0x1601('0x34')][_0x1601('0x40')]){_0x486a2d['where']=_[_0x1601('0x41')](_0x486a2d['where'],{'$or':_[_0x1601('0x2e')](_0x124711,function(_0x4ffc0d){if(_0x4ffc0d[_0x1601('0x31')]!==_0x1601('0x42')){var _0x2eaffe={};_0x2eaffe[_0x4ffc0d[_0x1601('0x2c')]]={'$like':'%'+_0x5b291d[_0x1601('0x34')]['filter']+'%'};return _0x2eaffe;}})});}_0x486a2d=_[_0x1601('0x41')]({},_0x486a2d,_0x5b291d[_0x1601('0x43')]);var _0x171d04={'where':_0x486a2d[_0x1601('0x3d')]};return db[_0x1601('0x2f')][_0x1601('0x22')](_0x171d04)[_0x1601('0x27')](function(_0x2030a6){_0xb54c0b[_0x1601('0x22')]=_0x2030a6;if(_0x5b291d[_0x1601('0x34')][_0x1601('0x44')]){_0x486a2d['include']=[{'all':!![]}];}return db[_0x1601('0x2f')][_0x1601('0x45')](_0x486a2d);})['then'](function(_0x45cf2f){_0xb54c0b[_0x1601('0x46')]=_0x45cf2f;return _0xb54c0b;})[_0x1601('0x27')](respondWithFilteredResult(_0xbd2450,_0x486a2d))[_0x1601('0x47')](handleError(_0xbd2450,null));};exports[_0x1601('0x48')]=function(_0x426424,_0x260532){var _0x4cea6c={'raw':!![],'where':{'id':_0x426424[_0x1601('0x49')]['id']}},_0x2d1077={};_0x2d1077[_0x1601('0x33')]=_[_0x1601('0x35')](db[_0x1601('0x2f')][_0x1601('0x4a')]);_0x2d1077[_0x1601('0x34')]=_[_0x1601('0x35')](_0x426424[_0x1601('0x34')]);_0x2d1077[_0x1601('0x3f')]=_['intersection'](_0x2d1077['model'],_0x2d1077['query']);_0x4cea6c[_0x1601('0x37')]=_[_0x1601('0x36')](_0x2d1077['model'],qs[_0x1601('0x38')](_0x426424['query'][_0x1601('0x38')]));_0x4cea6c[_0x1601('0x37')]=_0x4cea6c[_0x1601('0x37')][_0x1601('0x4b')]?_0x4cea6c[_0x1601('0x37')]:_0x2d1077['model'];if(_0x426424[_0x1601('0x34')][_0x1601('0x44')]){_0x4cea6c[_0x1601('0x4c')]=[{'all':!![]}];}_0x4cea6c=_[_0x1601('0x41')]({},_0x4cea6c,_0x426424['options']);return db['WhatsappQueue'][_0x1601('0x4d')](_0x4cea6c)['then'](handleEntityNotFound(_0x260532,null))['then'](respondWithResult(_0x260532,null))[_0x1601('0x47')](handleError(_0x260532,null));};exports[_0x1601('0x4e')]=function(_0x1bc1a0,_0x10a99f){return db[_0x1601('0x2f')][_0x1601('0x4e')](_0x1bc1a0['body'],{})[_0x1601('0x27')](function(_0x5bbd0a){var _0x16319d=_0x1bc1a0['user'][_0x1601('0x29')]({'plain':!![]});if(!_0x16319d)throw new Error(_0x1601('0x4f'));if(_0x16319d[_0x1601('0x50')]==='user'){var _0x20e2ce=_0x5bbd0a['get']({'plain':!![]});var _0x1fb0fc=_0x1601('0x2a');return db['UserProfileSection'][_0x1601('0x4d')]({'where':{'name':_0x1fb0fc,'userProfileId':_0x16319d['userProfileId']},'raw':!![]})['then'](function(_0xda606f){if(_0xda606f&&_0xda606f[_0x1601('0x51')]===0x0){return db[_0x1601('0x52')][_0x1601('0x4e')]({'name':_0x20e2ce[_0x1601('0x2c')],'resourceId':_0x20e2ce['id'],'type':_0xda606f[_0x1601('0x2c')],'sectionId':_0xda606f['id']},{})[_0x1601('0x27')](function(){return _0x5bbd0a;});}else{return _0x5bbd0a;}})[_0x1601('0x47')](function(_0x5874ab){logger['error'](_0x1601('0x53'),_0x5874ab);throw _0x5874ab;});}return _0x5bbd0a;})['then'](respondWithResult(_0x10a99f,0xc9))[_0x1601('0x47')](handleError(_0x10a99f,null));};exports[_0x1601('0x26')]=function(_0x2984a5,_0x50ff56){if(_0x2984a5['body']['id']){delete _0x2984a5[_0x1601('0x54')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x2984a5[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x50ff56,null))[_0x1601('0x27')](saveUpdates(_0x2984a5[_0x1601('0x54')],null))['then'](respondWithResult(_0x50ff56,null))[_0x1601('0x47')](handleError(_0x50ff56,null));};exports[_0x1601('0x28')]=function(_0x5bbbc6,_0x24fc05){return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x5bbbc6[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x24fc05,null))['then'](removeEntity(_0x24fc05,null))[_0x1601('0x47')](handleError(_0x24fc05,null));};exports[_0x1601('0x55')]=function(_0x1be233,_0x30a947){return db['WhatsappQueue']['describe']()[_0x1601('0x27')](respondWithResult(_0x30a947,null))[_0x1601('0x47')](handleError(_0x30a947,null));};exports['getMembers']=function(_0x533b36,_0x43b5b3,_0x31f945){var _0x55ce21={'raw':!![],'where':{}},_0x39e0db={},_0x5ee931;return db[_0x1601('0x2f')][_0x1601('0x56')]({'where':{'id':_0x533b36['params']['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x43b5b3,null))[_0x1601('0x27')](function(_0x1c0a58){if(_0x1c0a58){_0x5ee931=_0x1c0a58['get']({'plain':!![]});_0x39e0db[_0x1601('0x33')]=_[_0x1601('0x35')](db[_0x1601('0x57')][_0x1601('0x4a')]);_0x39e0db[_0x1601('0x34')]=_[_0x1601('0x35')](_0x533b36['query']);_0x39e0db[_0x1601('0x3f')]=_[_0x1601('0x36')](_0x39e0db[_0x1601('0x33')],_0x39e0db[_0x1601('0x34')]);_0x55ce21[_0x1601('0x37')]=_[_0x1601('0x36')](_0x39e0db[_0x1601('0x33')],qs[_0x1601('0x38')](_0x533b36[_0x1601('0x34')]['fields']));_0x55ce21['attributes']=_0x55ce21[_0x1601('0x37')][_0x1601('0x4b')]?_0x55ce21[_0x1601('0x37')]:_0x39e0db[_0x1601('0x33')];if(!_0x533b36['query'][_0x1601('0x39')](_0x1601('0x3a'))){_0x55ce21[_0x1601('0x20')]=qs['limit'](_0x533b36['query']['limit']);_0x55ce21['offset']=qs[_0x1601('0x1f')](_0x533b36['query']['offset']);}_0x55ce21[_0x1601('0x3b')]=qs[_0x1601('0x3c')](_0x533b36[_0x1601('0x34')][_0x1601('0x3c')]);_0x55ce21['where']=qs['filters'](_['pick'](_0x533b36[_0x1601('0x34')],_0x39e0db[_0x1601('0x3f')]));_0x55ce21[_0x1601('0x3d')][_0x1601('0x58')]=_0x1c0a58['id'];if(_0x533b36['query']['filter']){_0x55ce21[_0x1601('0x3d')]=_[_0x1601('0x41')](_0x55ce21[_0x1601('0x3d')],{'$or':_[_0x1601('0x2e')](_0x55ce21['attributes'],function(_0x32fd1c){var _0x3ecb67={};_0x3ecb67[_0x32fd1c]={'$like':'%'+_0x533b36[_0x1601('0x34')][_0x1601('0x40')]+'%'};return _0x3ecb67;})});}_0x55ce21=_['merge']({},_0x55ce21,_0x533b36[_0x1601('0x43')]);return db[_0x1601('0x57')][_0x1601('0x45')](_0x55ce21);}})[_0x1601('0x27')](function(_0xcf5319){if(_0xcf5319){return db[_0x1601('0x59')][_0x1601('0x5a')]({'where':{'id':_[_0x1601('0x2e')](_0xcf5319,'UserId'),'role':_0x1601('0x5b')},'attributes':['id',_0x1601('0x2c'),'whatsappPause',_0x1601('0x5c'),'createdAt']});}})[_0x1601('0x27')](function(_0x3a3408){if(_0x3a3408){return{'count':_0x3a3408['count'],'rows':_[_0x1601('0x2e')](_0x3a3408['rows'],function(_0x33d00c){return{'membername':_0x33d00c[_0x1601('0x2c')],'UserId':_0x33d00c['id'],'queue_name':_0x5ee931[_0x1601('0x2c')],'WhatsappQueueId':_0x5ee931['id'],'interface':util[_0x1601('0x5d')]('%s/%s',_0x1601('0x5e'),_0x33d00c[_0x1601('0x2c')]),'penalty':0x0,'paused':_0x33d00c[_0x1601('0x5f')],'createdAt':_0x33d00c[_0x1601('0x60')],'updatedAt':_0x33d00c[_0x1601('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1601('0x27')](respondWithFilteredResult(_0x43b5b3,_0x55ce21))[_0x1601('0x47')](handleError(_0x43b5b3,null));};exports[_0x1601('0x61')]=function(_0x4ecb88,_0x15b81b,_0x5d3752){var _0x2540b0={};var _0x258d34={};var _0x57f9a8;var _0x470f93;return db[_0x1601('0x2f')][_0x1601('0x56')]({'where':{'id':_0x4ecb88[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x15b81b,null))[_0x1601('0x27')](function(_0x438fcb){if(_0x438fcb){_0x57f9a8=_0x438fcb;_0x258d34['model']=_[_0x1601('0x35')](db[_0x1601('0x62')]['rawAttributes']);_0x258d34[_0x1601('0x34')]=_[_0x1601('0x35')](_0x4ecb88[_0x1601('0x34')]);_0x258d34[_0x1601('0x3f')]=_[_0x1601('0x36')](_0x258d34[_0x1601('0x33')],_0x258d34[_0x1601('0x34')]);_0x2540b0[_0x1601('0x37')]=_[_0x1601('0x36')](_0x258d34[_0x1601('0x33')],qs[_0x1601('0x38')](_0x4ecb88[_0x1601('0x34')]['fields']));_0x2540b0[_0x1601('0x37')]=_0x2540b0[_0x1601('0x37')][_0x1601('0x4b')]?_0x2540b0[_0x1601('0x37')]:_0x258d34[_0x1601('0x33')];_0x2540b0[_0x1601('0x3b')]=qs['sort'](_0x4ecb88[_0x1601('0x34')][_0x1601('0x3c')]);_0x2540b0[_0x1601('0x3d')]=qs['filters'](_['pick'](_0x4ecb88[_0x1601('0x34')],_0x258d34[_0x1601('0x3f')]));if(_0x4ecb88[_0x1601('0x34')][_0x1601('0x40')]){_0x2540b0['where']=_[_0x1601('0x41')](_0x2540b0[_0x1601('0x3d')],{'$or':_['map'](_0x2540b0['attributes'],function(_0x1c1368){var _0x1dd463={};_0x1dd463[_0x1c1368]={'$like':'%'+_0x4ecb88[_0x1601('0x34')][_0x1601('0x40')]+'%'};return _0x1dd463;})});}_0x2540b0=_[_0x1601('0x41')]({},_0x2540b0,_0x4ecb88[_0x1601('0x43')]);return _0x57f9a8['getTeams'](_0x2540b0);}})[_0x1601('0x27')](function(_0x1cb31b){if(_0x1cb31b){_0x470f93=_0x1cb31b[_0x1601('0x4b')];if(!_0x4ecb88['query'][_0x1601('0x39')](_0x1601('0x3a'))){_0x2540b0['limit']=qs[_0x1601('0x20')](_0x4ecb88[_0x1601('0x34')][_0x1601('0x20')]);_0x2540b0[_0x1601('0x1f')]=qs[_0x1601('0x1f')](_0x4ecb88['query'][_0x1601('0x1f')]);}return _0x57f9a8[_0x1601('0x61')](_0x2540b0);}})[_0x1601('0x27')](function(_0x3417c9){if(_0x3417c9){return _0x3417c9?{'count':_0x470f93,'rows':_0x3417c9}:null;}})['then'](respondWithResult(_0x15b81b,null))[_0x1601('0x47')](handleError(_0x15b81b,null));};exports['addTeams']=function(_0x258e73,_0x1fe1ef,_0x1b1e5c){var _0x14c2c9=_0x258e73[_0x1601('0x54')][_0x1601('0x63')];return db[_0x1601('0x62')][_0x1601('0x45')]({'where':{'id':_0x14c2c9},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1601('0x2c'),_0x1601('0x64'),_0x1601('0x65'),_0x1601('0x66')],'raw':!![]}]})[_0x1601('0x27')](function(_0x28608a){if(_0x28608a){var _0x3f302b=_[_0x1601('0x67')](_0x28608a,function(_0xfa90f9){var _0x31862f=_0xfa90f9[_0x1601('0x29')]({'plain':!![]});return _0x31862f[_0x1601('0x68')];});return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x258e73['params']['id']}})[_0x1601('0x27')](function(_0x170d08){return db[_0x1601('0x69')][_0x1601('0x6a')](function(_0x3092cb){return _0x170d08['addTeams'](_0x14c2c9,{'transaction':_0x3092cb})['then'](function(){return BPromise['each'](_0x3f302b,function(_0x526a4f){return db[_0x1601('0x57')][_0x1601('0x6b')]({'where':{'UserId':_0x526a4f['id'],'WhatsappQueueId':_0x258e73['params']['id']},'transaction':_0x3092cb});});})[_0x1601('0x27')](function(){_0x3f302b[_0x1601('0x6c')](function(_0x23969d){socket[_0x1601('0x6d')](_0x1601('0x6e'),{'UserId':_0x23969d['id'],'WhatsappQueueId':_0x170d08['id']});});});});});}})[_0x1601('0x27')](respondWithStatusCode(_0x1fe1ef,null))[_0x1601('0x47')](handleError(_0x1fe1ef,null));};exports[_0x1601('0x6f')]=function(_0x4df11d,_0x1c2b47,_0x5e93d6){return db[_0x1601('0x62')]['findAll']({'where':{'id':_0x4df11d[_0x1601('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1601('0x59')],'as':_0x1601('0x68'),'attributes':['id'],'raw':!![]}]})[_0x1601('0x27')](handleEntityNotFound(_0x1c2b47,null))['then'](function(_0x14e223){var _0x485674=_['map'](_0x14e223,'id');var _0x2bb23b=[];var _0x304e4c=[];var _0x43616e=squel[_0x1601('0x70')]();_0x43616e[_0x1601('0x71')](_0x1601('0x72'))[_0x1601('0x73')](_0x1601('0x74'),'tq')[_0x1601('0x75')]('user_has_teams','ut',_0x1601('0x76'))[_0x1601('0x3d')](_0x1601('0x77'),_0x4df11d[_0x1601('0x49')]['id']);for(var _0x12129b=0x0;_0x12129b<_0x14e223[_0x1601('0x4b')];_0x12129b+=0x1){let _0x1c1a88=_0x14e223[_0x12129b];for(var _0x1880cb=0x0;_0x1880cb<_0x1c1a88[_0x1601('0x68')]['length'];_0x1880cb+=0x1){let _0x56bced=_0x1c1a88['Agents'][_0x1880cb];var _0x3af48b=_0x43616e[_0x1601('0x78')]();_0x3af48b[_0x1601('0x3d')](_0x1601('0x79'),_0x56bced['id']);_0x304e4c['push'](db[_0x1601('0x69')]['query'](_0x3af48b[_0x1601('0x7a')](),{'type':db[_0x1601('0x69')][_0x1601('0x7b')][_0x1601('0x7c')]})['then'](function(_0x3e5b73){if(_0x3e5b73[_0x1601('0x4b')]===0x1){return _0x56bced['id'];}else{var _0x26a843=_[_0x1601('0x7d')](_[_0x1601('0x2e')](_0x3e5b73,_0x1601('0x7e')),function(_0x5d639e){return _[_0x1601('0x7f')](_0x485674,_0x5d639e);});if(_0x26a843){return _0x56bced['id'];}}}));}}return BPromise[_0x1601('0x80')](_0x304e4c)[_0x1601('0x27')](function(_0x1da9ed){_0x2bb23b=_(_0x2bb23b)[_0x1601('0x81')](_0x1da9ed)[_0x1601('0x82')]()['value']();return db[_0x1601('0x2f')]['find']({'where':{'id':_0x4df11d['params']['id']}})[_0x1601('0x27')](function(_0xb1ffc6){return db[_0x1601('0x69')][_0x1601('0x6a')](function(_0x2e36f5){return _0xb1ffc6[_0x1601('0x6f')](_0x4df11d[_0x1601('0x34')][_0x1601('0x63')],{'transaction':_0x2e36f5})[_0x1601('0x27')](function(){if(!_[_0x1601('0x83')](_0x2bb23b)){return _0xb1ffc6[_0x1601('0x84')](_0x2bb23b,{'transaction':_0x2e36f5});}})[_0x1601('0x27')](function(){_0x2bb23b[_0x1601('0x6c')](function(_0x566de0){socket[_0x1601('0x6d')](_0x1601('0x85'),{'UserId':_0x566de0,'WhatsappQueueId':_0xb1ffc6['id']});});});});});});})[_0x1601('0x27')](respondWithStatusCode(_0x1c2b47,null))[_0x1601('0x47')](handleError(_0x1c2b47,null));};exports['addAgents']=function(_0x247451,_0x2fac08,_0x382a92){return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x247451['params']['id']}})['then'](handleEntityNotFound(_0x2fac08,null))[_0x1601('0x27')](function(_0x1400a9){if(_0x1400a9){return _0x1400a9[_0x1601('0x86')](_0x247451[_0x1601('0x54')][_0x1601('0x63')],_[_0x1601('0x87')](_0x247451[_0x1601('0x54')],[_0x1601('0x63'),'id'])||{})['spread'](function(_0x411009){for(var _0x5dd052=0x0;_0x5dd052<_0x247451[_0x1601('0x54')][_0x1601('0x63')][_0x1601('0x4b')];_0x5dd052+=0x1){socket[_0x1601('0x6d')](_0x1601('0x6e'),{'UserId':Number(_0x247451[_0x1601('0x54')][_0x1601('0x63')][_0x5dd052]),'WhatsappQueueId':Number(_0x247451[_0x1601('0x49')]['id'])});}return _0x411009;});}})['then'](respondWithResult(_0x2fac08,null))['catch'](handleError(_0x2fac08,null));};exports[_0x1601('0x84')]=function(_0x4f93c4,_0x543e41,_0x568094){return db[_0x1601('0x2f')][_0x1601('0x4d')]({'where':{'id':_0x4f93c4[_0x1601('0x49')]['id']}})['then'](handleEntityNotFound(_0x543e41,null))[_0x1601('0x27')](function(_0x4c02be){if(_0x4c02be){return _0x4c02be[_0x1601('0x84')](_0x4f93c4[_0x1601('0x34')][_0x1601('0x63')])[_0x1601('0x27')](function(){if(_[_0x1601('0x88')](_0x4f93c4[_0x1601('0x34')][_0x1601('0x63')])){for(var _0x2e11d7=0x0;_0x2e11d7<_0x4f93c4[_0x1601('0x34')]['ids']['length'];_0x2e11d7+=0x1){socket[_0x1601('0x6d')](_0x1601('0x85'),{'UserId':Number(_0x4f93c4[_0x1601('0x34')][_0x1601('0x63')][_0x2e11d7]),'WhatsappQueueId':Number(_0x4f93c4[_0x1601('0x49')]['id'])});}}else{socket[_0x1601('0x6d')](_0x1601('0x85'),{'UserId':Number(_0x4f93c4[_0x1601('0x34')]['ids']),'WhatsappQueueId':Number(_0x4f93c4[_0x1601('0x49')]['id'])});}});}})[_0x1601('0x27')](respondWithStatusCode(_0x543e41,null))[_0x1601('0x47')](handleError(_0x543e41,null));};exports['getAgents']=function(_0x503842,_0x49e9fc,_0x242d8d){var _0x3ad5c4={};var _0x5a8461={};var _0x58e3d3;var _0x27b583;return db[_0x1601('0x2f')][_0x1601('0x56')]({'where':{'id':_0x503842[_0x1601('0x49')]['id']}})[_0x1601('0x27')](handleEntityNotFound(_0x49e9fc,null))[_0x1601('0x27')](function(_0x80fae4){if(_0x80fae4){_0x58e3d3=_0x80fae4;_0x5a8461[_0x1601('0x33')]=_[_0x1601('0x35')](db[_0x1601('0x59')][_0x1601('0x4a')]);_0x5a8461[_0x1601('0x34')]=_[_0x1601('0x35')](_0x503842[_0x1601('0x34')]);_0x5a8461['filters']=_[_0x1601('0x36')](_0x5a8461[_0x1601('0x33')],_0x5a8461['query']);_0x3ad5c4['attributes']=_['intersection'](_0x5a8461[_0x1601('0x33')],qs[_0x1601('0x38')](_0x503842[_0x1601('0x34')][_0x1601('0x38')]));_0x3ad5c4['attributes']=_0x3ad5c4[_0x1601('0x37')][_0x1601('0x4b')]?_0x3ad5c4[_0x1601('0x37')]:_0x5a8461[_0x1601('0x33')];_0x3ad5c4['order']=qs['sort'](_0x503842['query']['sort']);_0x3ad5c4[_0x1601('0x3d')]=qs[_0x1601('0x3f')](_[_0x1601('0x3e')](_0x503842[_0x1601('0x34')],_0x5a8461[_0x1601('0x3f')]));if(_0x503842['query'][_0x1601('0x40')]){_0x3ad5c4[_0x1601('0x3d')]=_['merge'](_0x3ad5c4[_0x1601('0x3d')],{'$or':_['map'](_0x3ad5c4['attributes'],function(_0x1dfc86){var _0x5c7865={};_0x5c7865[_0x1dfc86]={'$like':'%'+_0x503842[_0x1601('0x34')][_0x1601('0x40')]+'%'};return _0x5c7865;})});}_0x3ad5c4=_[_0x1601('0x41')]({},_0x3ad5c4,_0x503842[_0x1601('0x43')]);return _0x58e3d3[_0x1601('0x89')](_0x3ad5c4);}})['then'](function(_0x24f9cd){if(_0x24f9cd){_0x27b583=_0x24f9cd[_0x1601('0x4b')];if(!_0x503842[_0x1601('0x34')]['hasOwnProperty'](_0x1601('0x3a'))){_0x3ad5c4['limit']=qs[_0x1601('0x20')](_0x503842[_0x1601('0x34')]['limit']);_0x3ad5c4[_0x1601('0x1f')]=qs[_0x1601('0x1f')](_0x503842[_0x1601('0x34')]['offset']);}return _0x58e3d3['getAgents'](_0x3ad5c4);}})[_0x1601('0x27')](function(_0x129b73){if(_0x129b73){return _0x129b73?{'count':_0x27b583,'rows':_0x129b73}:null;}})[_0x1601('0x27')](respondWithResult(_0x49e9fc,null))['catch'](handleError(_0x49e9fc,null));}; \ No newline at end of file +var _0x5098=['isArray','userWhatsappQueue:remove','getAgents','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','get','WhatsappQueues','UserProfileResource','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','WhatsappQueue','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','order','WhatsappQueueId','findAll','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','each','findOrCreate','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','includes','all','compact','value','transaction','removeTeams','isEmpty','forEach','addAgents','omit','spread','removeAgents'];(function(_0x3a95f1,_0x6f9805){var _0xa249c3=function(_0x2f741f){while(--_0x2f741f){_0x3a95f1['push'](_0x3a95f1['shift']());}};_0xa249c3(++_0x6f9805);}(_0x5098,0x95));var _0x8509=function(_0xd2fdb5,_0x2721c0){_0xd2fdb5=_0xd2fdb5-0x0;var _0x8d24ee=_0x5098[_0xd2fdb5];return _0x8d24ee;};'use strict';var emlformat=require(_0x8509('0x0'));var rimraf=require(_0x8509('0x1'));var zipdir=require(_0x8509('0x2'));var jsonpatch=require(_0x8509('0x3'));var rp=require(_0x8509('0x4'));var moment=require(_0x8509('0x5'));var BPromise=require(_0x8509('0x6'));var Mustache=require(_0x8509('0x7'));var util=require(_0x8509('0x8'));var path=require(_0x8509('0x9'));var sox=require(_0x8509('0xa'));var csv=require(_0x8509('0xb'));var ejs=require(_0x8509('0xc'));var fs=require('fs');var fs_extra=require(_0x8509('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8509('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8509('0xf'));var toCsv=require(_0x8509('0xb'));var querystring=require(_0x8509('0x10'));var Papa=require(_0x8509('0x11'));var Redis=require(_0x8509('0x12'));var authService=require(_0x8509('0x13'));var qs=require(_0x8509('0x14'));var as=require(_0x8509('0x15'));var hardwareService=require(_0x8509('0x16'));var logger=require('../../config/logger')(_0x8509('0x17'));var utils=require('../../config/utils');var config=require(_0x8509('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8509('0x19'))['db'];config['redis']=_[_0x8509('0x1a')](config[_0x8509('0x1b')],{'host':_0x8509('0x1c'),'port':0x18eb});var socket=require(_0x8509('0x1d'))(new Redis(config[_0x8509('0x1b')]));require('./whatsappQueue.socket')[_0x8509('0x1e')](socket);function respondWithStatusCode(_0x5cd4e4,_0x2d5986){_0x2d5986=_0x2d5986||0xcc;return function(_0x54699b){if(_0x54699b){return _0x5cd4e4[_0x8509('0x1f')](_0x2d5986);}return _0x5cd4e4[_0x8509('0x20')](_0x2d5986)[_0x8509('0x21')]();};}function respondWithResult(_0x3e75bc,_0x23acd6){_0x23acd6=_0x23acd6||0xc8;return function(_0x10ae3c){if(_0x10ae3c){return _0x3e75bc['status'](_0x23acd6)[_0x8509('0x22')](_0x10ae3c);}};}function respondWithFilteredResult(_0x322a91,_0x12bf29){return function(_0x37d5d7){if(_0x37d5d7){var _0x40b554=typeof _0x12bf29[_0x8509('0x23')]===_0x8509('0x24')&&typeof _0x12bf29[_0x8509('0x25')]==='undefined';var _0x27f8af=_0x37d5d7['count'];var _0x237e56=_0x40b554?0x0:_0x12bf29[_0x8509('0x23')];var _0x1a79ae=_0x40b554?_0x37d5d7[_0x8509('0x26')]:_0x12bf29[_0x8509('0x23')]+_0x12bf29['limit'];var _0x47e6c5;if(_0x1a79ae>=_0x27f8af){_0x1a79ae=_0x27f8af;_0x47e6c5=0xc8;}else{_0x47e6c5=0xce;}_0x322a91[_0x8509('0x20')](_0x47e6c5);return _0x322a91['set'](_0x8509('0x27'),_0x237e56+'-'+_0x1a79ae+'/'+_0x27f8af)[_0x8509('0x22')](_0x37d5d7);}return null;};}function patchUpdates(_0x2c6bae){return function(_0x3337c1){try{jsonpatch[_0x8509('0x28')](_0x3337c1,_0x2c6bae,!![]);}catch(_0x581e2c){return BPromise[_0x8509('0x29')](_0x581e2c);}return _0x3337c1['save']();};}function saveUpdates(_0x1706da,_0x446bc5){return function(_0x3d95b7){if(_0x3d95b7){return _0x3d95b7[_0x8509('0x2a')](_0x1706da)['then'](function(_0xc9d939){return _0xc9d939;});}return null;};}function removeEntity(_0x46f46f,_0x29bd94){return function(_0x25a05b){if(_0x25a05b){return _0x25a05b['destroy']()['then'](function(){var _0x2802f4=_0x25a05b[_0x8509('0x2b')]({'plain':!![]});var _0x24642f=_0x8509('0x2c');return db[_0x8509('0x2d')][_0x8509('0x2e')]({'where':{'type':_0x24642f,'resourceId':_0x2802f4['id']}})[_0x8509('0x2f')](function(){return _0x25a05b;});})['then'](function(){_0x46f46f[_0x8509('0x20')](0xcc)[_0x8509('0x21')]();});}};}function handleEntityNotFound(_0x3bbc53,_0x44122d){return function(_0x35a632){if(!_0x35a632){_0x3bbc53[_0x8509('0x1f')](0x194);}return _0x35a632;};}function handleError(_0x22640e,_0x2c1da8){_0x2c1da8=_0x2c1da8||0x1f4;return function(_0x4d9947){logger['error'](_0x4d9947[_0x8509('0x30')]);if(_0x4d9947[_0x8509('0x31')]){delete _0x4d9947[_0x8509('0x31')];}_0x22640e[_0x8509('0x20')](_0x2c1da8)[_0x8509('0x32')](_0x4d9947);};}exports[_0x8509('0x33')]=function(_0x366b29,_0x5a410){var _0x31c76f={},_0x5088da={},_0x7dd51={'count':0x0,'rows':[]};var _0x4af978=_[_0x8509('0x34')](db['WhatsappQueue'][_0x8509('0x35')],function(_0x2b0227){return{'name':_0x2b0227[_0x8509('0x36')],'type':_0x2b0227[_0x8509('0x37')][_0x8509('0x38')]};});_0x5088da['model']=_[_0x8509('0x34')](_0x4af978,_0x8509('0x31'));_0x5088da[_0x8509('0x39')]=_[_0x8509('0x3a')](_0x366b29[_0x8509('0x39')]);_0x5088da[_0x8509('0x3b')]=_[_0x8509('0x3c')](_0x5088da[_0x8509('0x3d')],_0x5088da['query']);_0x31c76f[_0x8509('0x3e')]=_['intersection'](_0x5088da['model'],qs[_0x8509('0x3f')](_0x366b29[_0x8509('0x39')][_0x8509('0x3f')]));_0x31c76f[_0x8509('0x3e')]=_0x31c76f[_0x8509('0x3e')][_0x8509('0x40')]?_0x31c76f[_0x8509('0x3e')]:_0x5088da['model'];if(!_0x366b29['query'][_0x8509('0x41')](_0x8509('0x42'))){_0x31c76f[_0x8509('0x25')]=qs['limit'](_0x366b29[_0x8509('0x39')][_0x8509('0x25')]);_0x31c76f[_0x8509('0x23')]=qs[_0x8509('0x23')](_0x366b29[_0x8509('0x39')][_0x8509('0x23')]);}_0x31c76f['order']=qs[_0x8509('0x43')](_0x366b29[_0x8509('0x39')][_0x8509('0x43')]);_0x31c76f[_0x8509('0x44')]=qs[_0x8509('0x3b')](_['pick'](_0x366b29[_0x8509('0x39')],_0x5088da[_0x8509('0x3b')]),_0x4af978);if(_0x366b29[_0x8509('0x39')][_0x8509('0x45')]){_0x31c76f[_0x8509('0x44')]=_[_0x8509('0x46')](_0x31c76f[_0x8509('0x44')],{'$or':_[_0x8509('0x34')](_0x4af978,function(_0x3c8cf2){if(_0x3c8cf2['type']!=='VIRTUAL'){var _0x4e894b={};_0x4e894b[_0x3c8cf2[_0x8509('0x31')]]={'$like':'%'+_0x366b29[_0x8509('0x39')][_0x8509('0x45')]+'%'};return _0x4e894b;}})});}_0x31c76f=_['merge']({},_0x31c76f,_0x366b29[_0x8509('0x47')]);var _0x131dc7={'where':_0x31c76f[_0x8509('0x44')]};return db['WhatsappQueue'][_0x8509('0x26')](_0x131dc7)[_0x8509('0x2f')](function(_0x115b43){_0x7dd51[_0x8509('0x26')]=_0x115b43;if(_0x366b29[_0x8509('0x39')][_0x8509('0x48')]){_0x31c76f[_0x8509('0x49')]=[{'all':!![]}];}return db[_0x8509('0x4a')]['findAll'](_0x31c76f);})['then'](function(_0x1ffc56){_0x7dd51[_0x8509('0x4b')]=_0x1ffc56;return _0x7dd51;})[_0x8509('0x2f')](respondWithFilteredResult(_0x5a410,_0x31c76f))[_0x8509('0x4c')](handleError(_0x5a410,null));};exports[_0x8509('0x4d')]=function(_0x3bd76d,_0x4fc833){var _0x34826a={'raw':!![],'where':{'id':_0x3bd76d[_0x8509('0x4e')]['id']}},_0x283fbd={};_0x283fbd[_0x8509('0x3d')]=_[_0x8509('0x3a')](db[_0x8509('0x4a')][_0x8509('0x35')]);_0x283fbd[_0x8509('0x39')]=_[_0x8509('0x3a')](_0x3bd76d[_0x8509('0x39')]);_0x283fbd[_0x8509('0x3b')]=_[_0x8509('0x3c')](_0x283fbd[_0x8509('0x3d')],_0x283fbd[_0x8509('0x39')]);_0x34826a['attributes']=_['intersection'](_0x283fbd[_0x8509('0x3d')],qs[_0x8509('0x3f')](_0x3bd76d[_0x8509('0x39')]['fields']));_0x34826a[_0x8509('0x3e')]=_0x34826a['attributes'][_0x8509('0x40')]?_0x34826a[_0x8509('0x3e')]:_0x283fbd[_0x8509('0x3d')];if(_0x3bd76d[_0x8509('0x39')][_0x8509('0x48')]){_0x34826a[_0x8509('0x49')]=[{'all':!![]}];}_0x34826a=_['merge']({},_0x34826a,_0x3bd76d[_0x8509('0x47')]);return db['WhatsappQueue'][_0x8509('0x4f')](_0x34826a)[_0x8509('0x2f')](handleEntityNotFound(_0x4fc833,null))[_0x8509('0x2f')](respondWithResult(_0x4fc833,null))[_0x8509('0x4c')](handleError(_0x4fc833,null));};exports[_0x8509('0x50')]=function(_0x5a34f2,_0x37620f){return db['WhatsappQueue'][_0x8509('0x50')](_0x5a34f2[_0x8509('0x51')],{})['then'](function(_0x4e8f2c){var _0x1bb0ab=_0x5a34f2[_0x8509('0x52')]['get']({'plain':!![]});if(!_0x1bb0ab)throw new Error(_0x8509('0x53'));if(_0x1bb0ab[_0x8509('0x54')]===_0x8509('0x52')){var _0x2d114a=_0x4e8f2c[_0x8509('0x2b')]({'plain':!![]});var _0x48878b='WhatsappQueues';return db[_0x8509('0x55')][_0x8509('0x4f')]({'where':{'name':_0x48878b,'userProfileId':_0x1bb0ab[_0x8509('0x56')]},'raw':!![]})[_0x8509('0x2f')](function(_0x3e56b2){if(_0x3e56b2&&_0x3e56b2[_0x8509('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d114a[_0x8509('0x31')],'resourceId':_0x2d114a['id'],'type':_0x3e56b2[_0x8509('0x31')],'sectionId':_0x3e56b2['id']},{})[_0x8509('0x2f')](function(){return _0x4e8f2c;});}else{return _0x4e8f2c;}})[_0x8509('0x4c')](function(_0x10b528){logger[_0x8509('0x58')](_0x8509('0x59'),_0x10b528);throw _0x10b528;});}return _0x4e8f2c;})[_0x8509('0x2f')](respondWithResult(_0x37620f,0xc9))[_0x8509('0x4c')](handleError(_0x37620f,null));};exports[_0x8509('0x2a')]=function(_0x53be94,_0x523926){if(_0x53be94[_0x8509('0x51')]['id']){delete _0x53be94[_0x8509('0x51')]['id'];}return db[_0x8509('0x4a')][_0x8509('0x4f')]({'where':{'id':_0x53be94[_0x8509('0x4e')]['id']}})['then'](handleEntityNotFound(_0x523926,null))[_0x8509('0x2f')](saveUpdates(_0x53be94[_0x8509('0x51')],null))[_0x8509('0x2f')](respondWithResult(_0x523926,null))[_0x8509('0x4c')](handleError(_0x523926,null));};exports[_0x8509('0x2e')]=function(_0x5cdfe3,_0x2313b6){return db[_0x8509('0x4a')][_0x8509('0x4f')]({'where':{'id':_0x5cdfe3[_0x8509('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2313b6,null))[_0x8509('0x2f')](removeEntity(_0x2313b6,null))[_0x8509('0x4c')](handleError(_0x2313b6,null));};exports[_0x8509('0x5a')]=function(_0x2cca3d,_0x394661){return db[_0x8509('0x4a')][_0x8509('0x5a')]()[_0x8509('0x2f')](respondWithResult(_0x394661,null))[_0x8509('0x4c')](handleError(_0x394661,null));};exports[_0x8509('0x5b')]=function(_0x45efc0,_0x18311c,_0x1e1e15){var _0x277993={'raw':!![],'where':{}},_0x6529ca={},_0x443c8e;return db[_0x8509('0x4a')]['findOne']({'where':{'id':_0x45efc0[_0x8509('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18311c,null))['then'](function(_0x175d1c){if(_0x175d1c){_0x443c8e=_0x175d1c[_0x8509('0x2b')]({'plain':!![]});_0x6529ca['model']=_[_0x8509('0x3a')](db[_0x8509('0x5c')][_0x8509('0x35')]);_0x6529ca[_0x8509('0x39')]=_[_0x8509('0x3a')](_0x45efc0[_0x8509('0x39')]);_0x6529ca[_0x8509('0x3b')]=_[_0x8509('0x3c')](_0x6529ca[_0x8509('0x3d')],_0x6529ca['query']);_0x277993[_0x8509('0x3e')]=_[_0x8509('0x3c')](_0x6529ca[_0x8509('0x3d')],qs[_0x8509('0x3f')](_0x45efc0['query'][_0x8509('0x3f')]));_0x277993[_0x8509('0x3e')]=_0x277993[_0x8509('0x3e')][_0x8509('0x40')]?_0x277993[_0x8509('0x3e')]:_0x6529ca[_0x8509('0x3d')];if(!_0x45efc0[_0x8509('0x39')][_0x8509('0x41')](_0x8509('0x42'))){_0x277993[_0x8509('0x25')]=qs[_0x8509('0x25')](_0x45efc0[_0x8509('0x39')][_0x8509('0x25')]);_0x277993['offset']=qs[_0x8509('0x23')](_0x45efc0[_0x8509('0x39')][_0x8509('0x23')]);}_0x277993[_0x8509('0x5d')]=qs[_0x8509('0x43')](_0x45efc0[_0x8509('0x39')][_0x8509('0x43')]);_0x277993['where']=qs[_0x8509('0x3b')](_['pick'](_0x45efc0['query'],_0x6529ca['filters']));_0x277993[_0x8509('0x44')][_0x8509('0x5e')]=_0x175d1c['id'];if(_0x45efc0[_0x8509('0x39')][_0x8509('0x45')]){_0x277993[_0x8509('0x44')]=_[_0x8509('0x46')](_0x277993['where'],{'$or':_['map'](_0x277993[_0x8509('0x3e')],function(_0x239467){var _0x219b61={};_0x219b61[_0x239467]={'$like':'%'+_0x45efc0[_0x8509('0x39')][_0x8509('0x45')]+'%'};return _0x219b61;})});}_0x277993=_[_0x8509('0x46')]({},_0x277993,_0x45efc0[_0x8509('0x47')]);return db[_0x8509('0x5c')][_0x8509('0x5f')](_0x277993);}})[_0x8509('0x2f')](function(_0x2c56ce){if(_0x2c56ce){return db[_0x8509('0x60')][_0x8509('0x61')]({'where':{'id':_['map'](_0x2c56ce,'UserId'),'role':_0x8509('0x62')},'attributes':['id',_0x8509('0x31'),_0x8509('0x63'),_0x8509('0x64'),_0x8509('0x65')]});}})[_0x8509('0x2f')](function(_0x488348){if(_0x488348){return{'count':_0x488348['count'],'rows':_[_0x8509('0x34')](_0x488348[_0x8509('0x4b')],function(_0x23fd21){return{'membername':_0x23fd21['name'],'UserId':_0x23fd21['id'],'queue_name':_0x443c8e[_0x8509('0x31')],'WhatsappQueueId':_0x443c8e['id'],'interface':util['format'](_0x8509('0x66'),_0x8509('0x67'),_0x23fd21[_0x8509('0x31')]),'penalty':0x0,'paused':_0x23fd21[_0x8509('0x63')],'createdAt':_0x23fd21[_0x8509('0x65')],'updatedAt':_0x23fd21['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8509('0x2f')](respondWithFilteredResult(_0x18311c,_0x277993))['catch'](handleError(_0x18311c,null));};exports[_0x8509('0x68')]=function(_0x28b593,_0x38b152,_0x12179a){var _0x4005ff={};var _0x1bd055={};var _0x162fe3;var _0x3f1896;return db['WhatsappQueue'][_0x8509('0x69')]({'where':{'id':_0x28b593[_0x8509('0x4e')]['id']}})[_0x8509('0x2f')](handleEntityNotFound(_0x38b152,null))[_0x8509('0x2f')](function(_0x42de90){if(_0x42de90){_0x162fe3=_0x42de90;_0x1bd055[_0x8509('0x3d')]=_['keys'](db[_0x8509('0x6a')][_0x8509('0x35')]);_0x1bd055[_0x8509('0x39')]=_[_0x8509('0x3a')](_0x28b593['query']);_0x1bd055['filters']=_[_0x8509('0x3c')](_0x1bd055[_0x8509('0x3d')],_0x1bd055[_0x8509('0x39')]);_0x4005ff[_0x8509('0x3e')]=_[_0x8509('0x3c')](_0x1bd055['model'],qs[_0x8509('0x3f')](_0x28b593[_0x8509('0x39')][_0x8509('0x3f')]));_0x4005ff['attributes']=_0x4005ff[_0x8509('0x3e')][_0x8509('0x40')]?_0x4005ff[_0x8509('0x3e')]:_0x1bd055['model'];_0x4005ff['order']=qs['sort'](_0x28b593[_0x8509('0x39')][_0x8509('0x43')]);_0x4005ff[_0x8509('0x44')]=qs['filters'](_['pick'](_0x28b593['query'],_0x1bd055[_0x8509('0x3b')]));if(_0x28b593['query']['filter']){_0x4005ff[_0x8509('0x44')]=_[_0x8509('0x46')](_0x4005ff[_0x8509('0x44')],{'$or':_[_0x8509('0x34')](_0x4005ff[_0x8509('0x3e')],function(_0x11f7ee){var _0x118322={};_0x118322[_0x11f7ee]={'$like':'%'+_0x28b593[_0x8509('0x39')]['filter']+'%'};return _0x118322;})});}_0x4005ff=_[_0x8509('0x46')]({},_0x4005ff,_0x28b593['options']);return _0x162fe3[_0x8509('0x68')](_0x4005ff);}})[_0x8509('0x2f')](function(_0x1326ce){if(_0x1326ce){_0x3f1896=_0x1326ce[_0x8509('0x40')];if(!_0x28b593['query'][_0x8509('0x41')]('nolimit')){_0x4005ff[_0x8509('0x25')]=qs['limit'](_0x28b593[_0x8509('0x39')][_0x8509('0x25')]);_0x4005ff[_0x8509('0x23')]=qs['offset'](_0x28b593[_0x8509('0x39')][_0x8509('0x23')]);}return _0x162fe3[_0x8509('0x68')](_0x4005ff);}})['then'](function(_0x5d0c48){if(_0x5d0c48){return _0x5d0c48?{'count':_0x3f1896,'rows':_0x5d0c48}:null;}})['then'](respondWithResult(_0x38b152,null))[_0x8509('0x4c')](handleError(_0x38b152,null));};exports['addTeams']=function(_0x12c6e4,_0x1c122d,_0x13cfc3){var _0x3e5423=_0x12c6e4[_0x8509('0x51')][_0x8509('0x6b')];return db['Team']['findAll']({'where':{'id':_0x3e5423},'attributes':['id'],'include':[{'model':db[_0x8509('0x60')],'as':_0x8509('0x6c'),'attributes':['id',_0x8509('0x31'),_0x8509('0x6d'),_0x8509('0x6e'),_0x8509('0x6f')],'raw':!![]}]})[_0x8509('0x2f')](function(_0x1f8068){if(_0x1f8068){var _0x4853db=_[_0x8509('0x70')](_0x1f8068,function(_0x2323f0){var _0x1915a0=_0x2323f0[_0x8509('0x2b')]({'plain':!![]});return _0x1915a0['Agents'];});return db[_0x8509('0x4a')]['find']({'where':{'id':_0x12c6e4[_0x8509('0x4e')]['id']}})[_0x8509('0x2f')](function(_0x25d11e){return db['sequelize']['transaction'](function(_0x20d144){return _0x25d11e['addTeams'](_0x3e5423,{'transaction':_0x20d144})[_0x8509('0x2f')](function(){return BPromise[_0x8509('0x71')](_0x4853db,function(_0xc2cb5){return db[_0x8509('0x5c')][_0x8509('0x72')]({'where':{'UserId':_0xc2cb5['id'],'WhatsappQueueId':_0x12c6e4[_0x8509('0x4e')]['id']},'transaction':_0x20d144});});})[_0x8509('0x2f')](function(){_0x4853db['forEach'](function(_0x1451ef){socket[_0x8509('0x73')](_0x8509('0x74'),{'UserId':_0x1451ef['id'],'WhatsappQueueId':_0x25d11e['id']});});});});});}})[_0x8509('0x2f')](respondWithStatusCode(_0x1c122d,null))['catch'](handleError(_0x1c122d,null));};exports['removeTeams']=function(_0x1277fa,_0x196b44,_0x37d539){return db['Team'][_0x8509('0x5f')]({'where':{'id':_0x1277fa['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x8509('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8509('0x2f')](handleEntityNotFound(_0x196b44,null))[_0x8509('0x2f')](function(_0x4d6ba9){var _0x112415=_['map'](_0x4d6ba9,'id');var _0x52b259=[];var _0x323676=[];var _0x335ac4=squel[_0x8509('0x75')]();_0x335ac4['field'](_0x8509('0x76'))[_0x8509('0x77')](_0x8509('0x78'),'tq')[_0x8509('0x79')](_0x8509('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8509('0x44')](_0x8509('0x7b'),_0x1277fa[_0x8509('0x4e')]['id']);for(var _0x5cd95a=0x0;_0x5cd95a<_0x4d6ba9[_0x8509('0x40')];_0x5cd95a+=0x1){let _0xe20e3e=_0x4d6ba9[_0x5cd95a];for(var _0x7f787d=0x0;_0x7f787d<_0xe20e3e[_0x8509('0x6c')][_0x8509('0x40')];_0x7f787d+=0x1){let _0x3961e6=_0xe20e3e['Agents'][_0x7f787d];var _0x2b6dd7=_0x335ac4['clone']();_0x2b6dd7[_0x8509('0x44')](_0x8509('0x7c'),_0x3961e6['id']);_0x323676[_0x8509('0x7d')](db['sequelize'][_0x8509('0x39')](_0x2b6dd7[_0x8509('0x7e')](),{'type':db[_0x8509('0x7f')][_0x8509('0x80')]['SELECT']})[_0x8509('0x2f')](function(_0x2d3bc4){if(_0x2d3bc4[_0x8509('0x40')]===0x1){return _0x3961e6['id'];}else{var _0x4ee933=_['every'](_['map'](_0x2d3bc4,'TeamId'),function(_0x3d5765){return _[_0x8509('0x81')](_0x112415,_0x3d5765);});if(_0x4ee933){return _0x3961e6['id'];}}}));}}return BPromise[_0x8509('0x82')](_0x323676)['then'](function(_0x4169b6){_0x52b259=_(_0x52b259)['union'](_0x4169b6)[_0x8509('0x83')]()[_0x8509('0x84')]();return db[_0x8509('0x4a')][_0x8509('0x4f')]({'where':{'id':_0x1277fa[_0x8509('0x4e')]['id']}})[_0x8509('0x2f')](function(_0x46f8bb){return db['sequelize'][_0x8509('0x85')](function(_0x442d53){return _0x46f8bb[_0x8509('0x86')](_0x1277fa[_0x8509('0x39')][_0x8509('0x6b')],{'transaction':_0x442d53})[_0x8509('0x2f')](function(){if(!_[_0x8509('0x87')](_0x52b259)){return _0x46f8bb['removeAgents'](_0x52b259,{'transaction':_0x442d53});}})[_0x8509('0x2f')](function(){_0x52b259[_0x8509('0x88')](function(_0x45d505){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x45d505,'WhatsappQueueId':_0x46f8bb['id']});});});});});});})['then'](respondWithStatusCode(_0x196b44,null))[_0x8509('0x4c')](handleError(_0x196b44,null));};exports['addAgents']=function(_0x5ec4ce,_0x2b508c,_0x3dae09){return db['WhatsappQueue'][_0x8509('0x4f')]({'where':{'id':_0x5ec4ce[_0x8509('0x4e')]['id']}})[_0x8509('0x2f')](handleEntityNotFound(_0x2b508c,null))['then'](function(_0x5e9a5f){if(_0x5e9a5f){return _0x5e9a5f[_0x8509('0x89')](_0x5ec4ce[_0x8509('0x51')][_0x8509('0x6b')],_[_0x8509('0x8a')](_0x5ec4ce[_0x8509('0x51')],[_0x8509('0x6b'),'id'])||{})[_0x8509('0x8b')](function(_0x19953e){for(var _0x2246e7=0x0;_0x2246e7<_0x5ec4ce['body'][_0x8509('0x6b')][_0x8509('0x40')];_0x2246e7+=0x1){socket[_0x8509('0x73')]('userWhatsappQueue:save',{'UserId':Number(_0x5ec4ce[_0x8509('0x51')][_0x8509('0x6b')][_0x2246e7]),'WhatsappQueueId':Number(_0x5ec4ce[_0x8509('0x4e')]['id'])});}return _0x19953e;});}})[_0x8509('0x2f')](respondWithResult(_0x2b508c,null))['catch'](handleError(_0x2b508c,null));};exports['removeAgents']=function(_0x3aa250,_0x1349d7,_0x3bedae){return db[_0x8509('0x4a')]['find']({'where':{'id':_0x3aa250['params']['id']}})[_0x8509('0x2f')](handleEntityNotFound(_0x1349d7,null))[_0x8509('0x2f')](function(_0x1caee4){if(_0x1caee4){return _0x1caee4[_0x8509('0x8c')](_0x3aa250[_0x8509('0x39')]['ids'])['then'](function(){if(_[_0x8509('0x8d')](_0x3aa250[_0x8509('0x39')][_0x8509('0x6b')])){for(var _0x2647e3=0x0;_0x2647e3<_0x3aa250[_0x8509('0x39')]['ids'][_0x8509('0x40')];_0x2647e3+=0x1){socket[_0x8509('0x73')](_0x8509('0x8e'),{'UserId':Number(_0x3aa250[_0x8509('0x39')][_0x8509('0x6b')][_0x2647e3]),'WhatsappQueueId':Number(_0x3aa250[_0x8509('0x4e')]['id'])});}}else{socket[_0x8509('0x73')](_0x8509('0x8e'),{'UserId':Number(_0x3aa250[_0x8509('0x39')][_0x8509('0x6b')]),'WhatsappQueueId':Number(_0x3aa250[_0x8509('0x4e')]['id'])});}});}})[_0x8509('0x2f')](respondWithStatusCode(_0x1349d7,null))[_0x8509('0x4c')](handleError(_0x1349d7,null));};exports[_0x8509('0x8f')]=function(_0x1f1973,_0x2ae763,_0x3ff13e){var _0x5a2732={};var _0x568fff={};var _0x5d7c81;var _0x4e47d9;return db[_0x8509('0x4a')][_0x8509('0x69')]({'where':{'id':_0x1f1973[_0x8509('0x4e')]['id']}})[_0x8509('0x2f')](handleEntityNotFound(_0x2ae763,null))[_0x8509('0x2f')](function(_0xcb40e0){if(_0xcb40e0){_0x5d7c81=_0xcb40e0;_0x568fff['model']=_[_0x8509('0x3a')](db['User']['rawAttributes']);_0x568fff[_0x8509('0x39')]=_[_0x8509('0x3a')](_0x1f1973['query']);_0x568fff[_0x8509('0x3b')]=_[_0x8509('0x3c')](_0x568fff['model'],_0x568fff[_0x8509('0x39')]);_0x5a2732['attributes']=_[_0x8509('0x3c')](_0x568fff[_0x8509('0x3d')],qs[_0x8509('0x3f')](_0x1f1973[_0x8509('0x39')][_0x8509('0x3f')]));_0x5a2732[_0x8509('0x3e')]=_0x5a2732[_0x8509('0x3e')][_0x8509('0x40')]?_0x5a2732['attributes']:_0x568fff[_0x8509('0x3d')];_0x5a2732[_0x8509('0x5d')]=qs[_0x8509('0x43')](_0x1f1973[_0x8509('0x39')]['sort']);_0x5a2732[_0x8509('0x44')]=qs['filters'](_[_0x8509('0x90')](_0x1f1973['query'],_0x568fff['filters']));if(_0x1f1973[_0x8509('0x39')]['filter']){_0x5a2732[_0x8509('0x44')]=_['merge'](_0x5a2732[_0x8509('0x44')],{'$or':_[_0x8509('0x34')](_0x5a2732[_0x8509('0x3e')],function(_0x15bb9e){var _0x3b86a7={};_0x3b86a7[_0x15bb9e]={'$like':'%'+_0x1f1973[_0x8509('0x39')]['filter']+'%'};return _0x3b86a7;})});}_0x5a2732=_[_0x8509('0x46')]({},_0x5a2732,_0x1f1973[_0x8509('0x47')]);return _0x5d7c81[_0x8509('0x8f')](_0x5a2732);}})[_0x8509('0x2f')](function(_0x449dbf){if(_0x449dbf){_0x4e47d9=_0x449dbf[_0x8509('0x40')];if(!_0x1f1973[_0x8509('0x39')]['hasOwnProperty'](_0x8509('0x42'))){_0x5a2732[_0x8509('0x25')]=qs[_0x8509('0x25')](_0x1f1973[_0x8509('0x39')][_0x8509('0x25')]);_0x5a2732[_0x8509('0x23')]=qs[_0x8509('0x23')](_0x1f1973['query'][_0x8509('0x23')]);}return _0x5d7c81['getAgents'](_0x5a2732);}})[_0x8509('0x2f')](function(_0x4da015){if(_0x4da015){return _0x4da015?{'count':_0x4e47d9,'rows':_0x4da015}:null;}})['then'](respondWithResult(_0x2ae763,null))[_0x8509('0x4c')](handleError(_0x2ae763,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index db89372..65361d5 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 _0xa1e4=['../../mysqldb','WhatsappQueue','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa1e4,0x157));var _0x4a1e=function(_0x3a556e,_0x32191b){_0x3a556e=_0x3a556e-0x0;var _0xfe3a36=_0xa1e4[_0x3a556e];return _0xfe3a36;};'use strict';var EventEmitter=require(_0x4a1e('0x0'));var WhatsappQueue=require(_0x4a1e('0x1'))['db'][_0x4a1e('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4a1e('0x3')](0x0);var events={'afterCreate':_0x4a1e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d737a){return function(_0x3be23a,_0x1430d8,_0x6ec5d2){WhatsappQueueEvents[_0x4a1e('0x5')](_0x4d737a+':'+_0x3be23a['id'],_0x3be23a);WhatsappQueueEvents[_0x4a1e('0x5')](_0x4d737a,_0x3be23a);_0x6ec5d2(null);};}for(var e in events){if(events[_0x4a1e('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x4a1e('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x8ca9=['save','update','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners'];(function(_0x49e428,_0x8af8eb){var _0x408143=function(_0x2d55ff){while(--_0x2d55ff){_0x49e428['push'](_0x49e428['shift']());}};_0x408143(++_0x8af8eb);}(_0x8ca9,0xf9));var _0x98ca=function(_0x49af49,_0xe06a4c){_0x49af49=_0x49af49-0x0;var _0x52da19=_0x8ca9[_0x49af49];return _0x52da19;};'use strict';var EventEmitter=require(_0x98ca('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x98ca('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x98ca('0x2')](0x0);var events={'afterCreate':_0x98ca('0x3'),'afterUpdate':_0x98ca('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e22e2){return function(_0x850207,_0x537fdb,_0x52d266){WhatsappQueueEvents[_0x98ca('0x5')](_0x2e22e2+':'+_0x850207['id'],_0x850207);WhatsappQueueEvents[_0x98ca('0x5')](_0x2e22e2,_0x850207);_0x52d266(null);};}for(var e in events){if(events[_0x98ca('0x6')](e)){var event=events[e];WhatsappQueue[_0x98ca('0x7')](e,emitEvent(event));}}module[_0x98ca('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 45ce9b3..a510a9c 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 _0x92a5=['util','../../config/logger','api','bluebird','path','rimraf','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x28d2d2,_0x5723e5){var _0x41a8db=function(_0x54bf80){while(--_0x54bf80){_0x28d2d2['push'](_0x28d2d2['shift']());}};_0x41a8db(++_0x5723e5);}(_0x92a5,0x1ac));var _0x592a=function(_0x4a4bfa,_0x2c4d6c){_0x4a4bfa=_0x4a4bfa-0x0;var _0x19a08b=_0x92a5[_0x4a4bfa];return _0x19a08b;};'use strict';var _=require(_0x592a('0x0'));var util=require(_0x592a('0x1'));var logger=require(_0x592a('0x2'))(_0x592a('0x3'));var moment=require('moment');var BPromise=require(_0x592a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x592a('0x5'));var rimraf=require(_0x592a('0x6'));var config=require('../../config/environment');var attributes=require(_0x592a('0x7'));module['exports']=function(_0x29cc02,_0x54a655){return _0x29cc02[_0x592a('0x8')](_0x592a('0x9'),attributes,{'tableName':_0x592a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf270=['path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53f27c,_0x5d3e6b){var _0x1f94f5=function(_0xcfc18a){while(--_0xcfc18a){_0x53f27c['push'](_0x53f27c['shift']());}};_0x1f94f5(++_0x5d3e6b);}(_0xf270,0x6e));var _0x0f27=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xf270[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0f27('0x0'));var util=require(_0x0f27('0x1'));var logger=require(_0x0f27('0x2'))(_0x0f27('0x3'));var moment=require(_0x0f27('0x4'));var BPromise=require(_0x0f27('0x5'));var rp=require(_0x0f27('0x6'));var fs=require('fs');var path=require(_0x0f27('0x7'));var rimraf=require(_0x0f27('0x8'));var config=require('../../config/environment');var attributes=require(_0x0f27('0x9'));module[_0x0f27('0xa')]=function(_0x3ba4b,_0x3372bf){return _0x3ba4b[_0x0f27('0xb')](_0x0f27('0xc'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index a67b035..60bd64a 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 _0x91dd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','find','moment'];(function(_0xd4cf1e,_0x1467a6){var _0x1940a9=function(_0x36e6df){while(--_0x36e6df){_0xd4cf1e['push'](_0xd4cf1e['shift']());}};_0x1940a9(++_0x1467a6);}(_0x91dd,0x171));var _0xd91d=function(_0x3b5895,_0x33d1d9){_0x3b5895=_0x3b5895-0x0;var _0xa2ce18=_0x91dd[_0x3b5895];return _0xa2ce18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd91d('0x0'));var BPromise=require(_0xd91d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd91d('0x2'));var db=require(_0xd91d('0x3'))['db'];var utils=require(_0xd91d('0x4'));var logger=require(_0xd91d('0x5'))(_0xd91d('0x6'));var config=require(_0xd91d('0x7'));var jayson=require(_0xd91d('0x8'));var client=jayson[_0xd91d('0x9')][_0xd91d('0xa')]({'port':0x232a});config[_0xd91d('0xb')]=_['defaults'](config[_0xd91d('0xb')],{'host':_0xd91d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd91d('0xb')]));require(_0xd91d('0xd'))['register'](socket);function respondWithRpcPromise(_0x32ed30,_0x3d1827,_0x3b85fc){return new BPromise(function(_0x453780,_0x1324c6){return client[_0xd91d('0xe')](_0x32ed30,_0x3b85fc)[_0xd91d('0xf')](function(_0x164846){logger['info'](_0xd91d('0x10'),_0x3d1827,_0xd91d('0x11'));logger[_0xd91d('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3d1827,_0xd91d('0x11'),JSON[_0xd91d('0x13')](_0x164846));if(_0x164846[_0xd91d('0x14')]){if(_0x164846[_0xd91d('0x14')]['code']===0x1f4){logger['error'](_0xd91d('0x10'),_0x3d1827,_0x164846[_0xd91d('0x14')][_0xd91d('0x15')]);return _0x1324c6(_0x164846[_0xd91d('0x14')]['message']);}logger['error'](_0xd91d('0x10'),_0x3d1827,_0x164846[_0xd91d('0x14')][_0xd91d('0x15')]);return _0x453780(_0x164846['error'][_0xd91d('0x15')]);}else{logger[_0xd91d('0x16')](_0xd91d('0x10'),_0x3d1827,_0xd91d('0x11'));_0x453780(_0x164846[_0xd91d('0x17')][_0xd91d('0x15')]);}})[_0xd91d('0x18')](function(_0x9995ed){logger[_0xd91d('0x14')](_0xd91d('0x10'),_0x3d1827,_0x9995ed);_0x1324c6(_0x9995ed);});});}exports['GetWhatsappQueue']=function(_0x297944){var _0x4b9bf3=this;return new Promise(function(_0x2d6998,_0xc975a0){return db[_0xd91d('0x19')][_0xd91d('0x1a')]({'raw':_0x297944[_0xd91d('0x1b')]?_0x297944[_0xd91d('0x1b')][_0xd91d('0x1c')]===undefined?!![]:![]:!![],'where':_0x297944[_0xd91d('0x1b')]?_0x297944[_0xd91d('0x1b')][_0xd91d('0x1d')]||null:null,'attributes':_0x297944['options']?_0x297944['options'][_0xd91d('0x1e')]||null:null,'limit':_0x297944['options']?_0x297944[_0xd91d('0x1b')]['limit']||null:null,'include':_0x297944[_0xd91d('0x1b')]?_0x297944[_0xd91d('0x1b')][_0xd91d('0x1f')]?_['map'](_0x297944[_0xd91d('0x1b')][_0xd91d('0x1f')],function(_0x1b6343){return{'model':db[_0x1b6343['model']],'as':_0x1b6343['as'],'attributes':_0x1b6343[_0xd91d('0x1e')],'include':_0x1b6343[_0xd91d('0x1f')]?_['map'](_0x1b6343[_0xd91d('0x1f')],function(_0x3497db){return{'model':db[_0x3497db[_0xd91d('0x20')]],'as':_0x3497db['as'],'attributes':_0x3497db[_0xd91d('0x1e')],'include':_0x3497db['include']?_[_0xd91d('0x21')](_0x3497db[_0xd91d('0x1f')],function(_0x262010){return{'model':db[_0x262010[_0xd91d('0x20')]],'as':_0x262010['as'],'attributes':_0x262010[_0xd91d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd91d('0xf')](function(_0x219fd7){logger['info']('GetWhatsappQueue',_0x297944);logger[_0xd91d('0x12')]('GetWhatsappQueue',_0x297944,JSON[_0xd91d('0x13')](_0x219fd7));_0x2d6998(_0x219fd7);})[_0xd91d('0x18')](function(_0x58d017){logger[_0xd91d('0x14')](_0xd91d('0x22'),_0x58d017[_0xd91d('0x15')],_0x297944);_0xc975a0(_0x4b9bf3['error'](0x1f4,_0x58d017[_0xd91d('0x15')]));});});};exports[_0xd91d('0x23')]=function(_0xe1a215){var _0x3263ff=this;return new Promise(function(_0x3623ca,_0x142162){return db[_0xd91d('0x19')][_0xd91d('0x24')]({'raw':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215['options'][_0xd91d('0x1c')]===undefined?!![]:![]:!![],'where':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215[_0xd91d('0x1b')][_0xd91d('0x1d')]||null:null,'attributes':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215[_0xd91d('0x1b')][_0xd91d('0x1e')]||null:null,'include':_0xe1a215[_0xd91d('0x1b')]?_0xe1a215['options']['include']?_[_0xd91d('0x21')](_0xe1a215[_0xd91d('0x1b')][_0xd91d('0x1f')],function(_0x307bc8){return{'model':db[_0x307bc8[_0xd91d('0x20')]],'as':_0x307bc8['as'],'attributes':_0x307bc8[_0xd91d('0x1e')],'include':_0x307bc8[_0xd91d('0x1f')]?_[_0xd91d('0x21')](_0x307bc8[_0xd91d('0x1f')],function(_0x5d91e7){return{'model':db[_0x5d91e7['model']],'as':_0x5d91e7['as'],'attributes':_0x5d91e7[_0xd91d('0x1e')],'include':_0x5d91e7[_0xd91d('0x1f')]?_[_0xd91d('0x21')](_0x5d91e7[_0xd91d('0x1f')],function(_0x1e9d8e){return{'model':db[_0x1e9d8e['model']],'as':_0x1e9d8e['as'],'attributes':_0x1e9d8e[_0xd91d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd91d('0xf')](function(_0xdb7216){logger['info'](_0xd91d('0x23'),_0xe1a215);logger[_0xd91d('0x12')](_0xd91d('0x23'),_0xe1a215,JSON[_0xd91d('0x13')](_0xdb7216));_0x3623ca(_0xdb7216);})[_0xd91d('0x18')](function(_0x5a5e97){logger[_0xd91d('0x14')](_0xd91d('0x23'),_0x5a5e97[_0xd91d('0x15')],_0xe1a215);_0x142162(_0x3263ff['error'](0x1f4,_0x5a5e97[_0xd91d('0x15')]));});});}; \ No newline at end of file +var _0x3500=['localhost','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3500,0x18d));var _0x0350=function(_0x4a9a0c,_0x120b8a){_0x4a9a0c=_0x4a9a0c-0x0;var _0x316d25=_0x3500[_0x4a9a0c];return _0x316d25;};'use strict';var _=require(_0x0350('0x0'));var util=require(_0x0350('0x1'));var moment=require(_0x0350('0x2'));var BPromise=require(_0x0350('0x3'));var rs=require(_0x0350('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0350('0x5'))['db'];var utils=require(_0x0350('0x6'));var logger=require('../../config/logger')(_0x0350('0x7'));var config=require(_0x0350('0x8'));var jayson=require(_0x0350('0x9'));var client=jayson[_0x0350('0xa')]['http']({'port':0x232a});config['redis']=_[_0x0350('0xb')](config[_0x0350('0xc')],{'host':_0x0350('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0350('0xc')]));require(_0x0350('0xe'))[_0x0350('0xf')](socket);function respondWithRpcPromise(_0x5201e0,_0x19ecd6,_0x10dd67){return new BPromise(function(_0x25f893,_0x409b4b){return client['request'](_0x5201e0,_0x10dd67)[_0x0350('0x10')](function(_0xab1a12){logger['info'](_0x0350('0x11'),_0x19ecd6,_0x0350('0x12'));logger[_0x0350('0x13')](_0x0350('0x14'),_0x19ecd6,_0x0350('0x12'),JSON[_0x0350('0x15')](_0xab1a12));if(_0xab1a12['error']){if(_0xab1a12[_0x0350('0x16')][_0x0350('0x17')]===0x1f4){logger[_0x0350('0x16')](_0x0350('0x11'),_0x19ecd6,_0xab1a12[_0x0350('0x16')]['message']);return _0x409b4b(_0xab1a12[_0x0350('0x16')][_0x0350('0x18')]);}logger[_0x0350('0x16')](_0x0350('0x11'),_0x19ecd6,_0xab1a12['error']['message']);return _0x25f893(_0xab1a12[_0x0350('0x16')][_0x0350('0x18')]);}else{logger['info'](_0x0350('0x11'),_0x19ecd6,_0x0350('0x12'));_0x25f893(_0xab1a12[_0x0350('0x19')]['message']);}})[_0x0350('0x1a')](function(_0x1cd4ea){logger[_0x0350('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x19ecd6,_0x1cd4ea);_0x409b4b(_0x1cd4ea);});});}exports[_0x0350('0x1b')]=function(_0x357141){var _0x3b8d95=this;return new Promise(function(_0x32422e,_0x40eedb){return db[_0x0350('0x1c')][_0x0350('0x1d')]({'raw':_0x357141['options']?_0x357141[_0x0350('0x1e')][_0x0350('0x1f')]===undefined?!![]:![]:!![],'where':_0x357141[_0x0350('0x1e')]?_0x357141[_0x0350('0x1e')][_0x0350('0x20')]||null:null,'attributes':_0x357141[_0x0350('0x1e')]?_0x357141['options'][_0x0350('0x21')]||null:null,'limit':_0x357141[_0x0350('0x1e')]?_0x357141[_0x0350('0x1e')][_0x0350('0x22')]||null:null,'include':_0x357141[_0x0350('0x1e')]?_0x357141[_0x0350('0x1e')][_0x0350('0x23')]?_['map'](_0x357141[_0x0350('0x1e')]['include'],function(_0x20de79){return{'model':db[_0x20de79[_0x0350('0x24')]],'as':_0x20de79['as'],'attributes':_0x20de79[_0x0350('0x21')],'include':_0x20de79[_0x0350('0x23')]?_[_0x0350('0x25')](_0x20de79['include'],function(_0x5c1de9){return{'model':db[_0x5c1de9[_0x0350('0x24')]],'as':_0x5c1de9['as'],'attributes':_0x5c1de9['attributes'],'include':_0x5c1de9[_0x0350('0x23')]?_[_0x0350('0x25')](_0x5c1de9[_0x0350('0x23')],function(_0x309b2c){return{'model':db[_0x309b2c[_0x0350('0x24')]],'as':_0x309b2c['as'],'attributes':_0x309b2c[_0x0350('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0350('0x10')](function(_0x475052){logger[_0x0350('0x26')]('GetWhatsappQueue',_0x357141);logger[_0x0350('0x13')]('GetWhatsappQueue',_0x357141,JSON[_0x0350('0x15')](_0x475052));_0x32422e(_0x475052);})[_0x0350('0x1a')](function(_0x1433bb){logger['error']('GetWhatsappQueue',_0x1433bb['message'],_0x357141);_0x40eedb(_0x3b8d95[_0x0350('0x16')](0x1f4,_0x1433bb[_0x0350('0x18')]));});});};exports[_0x0350('0x27')]=function(_0x5566da){var _0x40d598=this;return new Promise(function(_0x5cddd9,_0x374476){return db['WhatsappQueue'][_0x0350('0x28')]({'raw':_0x5566da[_0x0350('0x1e')]?_0x5566da[_0x0350('0x1e')][_0x0350('0x1f')]===undefined?!![]:![]:!![],'where':_0x5566da[_0x0350('0x1e')]?_0x5566da[_0x0350('0x1e')][_0x0350('0x20')]||null:null,'attributes':_0x5566da[_0x0350('0x1e')]?_0x5566da[_0x0350('0x1e')][_0x0350('0x21')]||null:null,'include':_0x5566da[_0x0350('0x1e')]?_0x5566da['options']['include']?_['map'](_0x5566da['options'][_0x0350('0x23')],function(_0x28b3e1){return{'model':db[_0x28b3e1[_0x0350('0x24')]],'as':_0x28b3e1['as'],'attributes':_0x28b3e1[_0x0350('0x21')],'include':_0x28b3e1[_0x0350('0x23')]?_['map'](_0x28b3e1[_0x0350('0x23')],function(_0x33d93e){return{'model':db[_0x33d93e[_0x0350('0x24')]],'as':_0x33d93e['as'],'attributes':_0x33d93e['attributes'],'include':_0x33d93e['include']?_['map'](_0x33d93e[_0x0350('0x23')],function(_0x90e708){return{'model':db[_0x90e708[_0x0350('0x24')]],'as':_0x90e708['as'],'attributes':_0x90e708['attributes']};}):[]};}):[]};}):[]:[]})[_0x0350('0x10')](function(_0x2fb04f){logger[_0x0350('0x26')](_0x0350('0x27'),_0x5566da);logger['debug'](_0x0350('0x27'),_0x5566da,JSON['stringify'](_0x2fb04f));_0x5cddd9(_0x2fb04f);})[_0x0350('0x1a')](function(_0xe96d15){logger[_0x0350('0x16')](_0x0350('0x27'),_0xe96d15[_0x0350('0x18')],_0x5566da);_0x374476(_0x40d598['error'](0x1f4,_0xe96d15['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a862d6d..924bd48 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 _0xfc50=['length','./whatsappQueue.events','save','remove','emit','removeListener','register'];(function(_0x132538,_0x4c4cbd){var _0x4c5012=function(_0x28513c){while(--_0x28513c){_0x132538['push'](_0x132538['shift']());}};_0x4c5012(++_0x4c4cbd);}(_0xfc50,0x1c8));var _0x0fc5=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfc50[_0x6131cd];return _0x47e916;};'use strict';var WhatsappQueueEvents=require(_0x0fc5('0x0'));var events=[_0x0fc5('0x1'),_0x0fc5('0x2'),'update'];function createListener(_0x24080f,_0x215f17){return function(_0x35af3f){_0x215f17[_0x0fc5('0x3')](_0x24080f,_0x35af3f);};}function removeListener(_0x3f4404,_0x3d162c){return function(){WhatsappQueueEvents[_0x0fc5('0x4')](_0x3f4404,_0x3d162c);};}exports[_0x0fc5('0x5')]=function(_0x250923){for(var _0x3d5847=0x0,_0x10d597=events[_0x0fc5('0x6')];_0x3d5847<_0x10d597;_0x3d5847++){var _0x292dc8=events[_0x3d5847];var _0x48c49e=createListener('whatsappQueue:'+_0x292dc8,_0x250923);WhatsappQueueEvents['on'](_0x292dc8,_0x48c49e);}}; \ No newline at end of file +var _0x8d45=['register','whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener'];(function(_0x371e5f,_0x208744){var _0x578953=function(_0x3abdc8){while(--_0x3abdc8){_0x371e5f['push'](_0x371e5f['shift']());}};_0x578953(++_0x208744);}(_0x8d45,0x1d7));var _0x58d4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8d45[_0x1facfa];return _0x9ec701;};'use strict';var WhatsappQueueEvents=require(_0x58d4('0x0'));var events=[_0x58d4('0x1'),_0x58d4('0x2'),_0x58d4('0x3')];function createListener(_0x4363a3,_0x3604a1){return function(_0xa9f438){_0x3604a1['emit'](_0x4363a3,_0xa9f438);};}function removeListener(_0x3224b7,_0x9867b3){return function(){WhatsappQueueEvents[_0x58d4('0x4')](_0x3224b7,_0x9867b3);};}exports[_0x58d4('0x5')]=function(_0x577f83){for(var _0x30d3f1=0x0,_0x1e966b=events['length'];_0x30d3f1<_0x1e966b;_0x30d3f1++){var _0x319403=events[_0x30d3f1];var _0x1624c5=createListener(_0x58d4('0x6')+_0x319403,_0x577f83);WhatsappQueueEvents['on'](_0x319403,_0x1624c5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ad190b8..944dfac 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 _0x3c52=['post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x3c52,0xa5));var _0x23c5=function(_0x189c04,_0x1ff750){_0x189c04=_0x189c04-0x0;var _0x5735e6=_0x3c52[_0x189c04];return _0x5735e6;};'use strict';var multer=require(_0x23c5('0x0'));var util=require(_0x23c5('0x1'));var path=require(_0x23c5('0x2'));var timeout=require(_0x23c5('0x3'));var express=require(_0x23c5('0x4'));var router=express[_0x23c5('0x5')]();var fs_extra=require(_0x23c5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x23c5('0x7'));var config=require(_0x23c5('0x8'));var controller=require(_0x23c5('0x9'));router[_0x23c5('0xa')]('/',auth[_0x23c5('0xb')](),controller[_0x23c5('0xc')]);router['get']('/describe',auth[_0x23c5('0xb')](),controller['describe']);router['get'](_0x23c5('0xd'),auth[_0x23c5('0xb')](),controller[_0x23c5('0xe')]);router[_0x23c5('0xf')]('/',auth[_0x23c5('0xb')](),controller[_0x23c5('0x10')]);router['put'](_0x23c5('0xd'),auth[_0x23c5('0xb')](),controller[_0x23c5('0x11')]);router['delete'](_0x23c5('0xd'),auth[_0x23c5('0xb')](),controller[_0x23c5('0x12')]);module[_0x23c5('0x13')]=router; \ No newline at end of file +var _0x9819=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9819,0x13e));var _0x9981=function(_0x58e35e,_0x42715e){_0x58e35e=_0x58e35e-0x0;var _0x36b3b2=_0x9819[_0x58e35e];return _0x36b3b2;};'use strict';var multer=require('multer');var util=require(_0x9981('0x0'));var path=require('path');var timeout=require(_0x9981('0x1'));var express=require(_0x9981('0x2'));var router=express[_0x9981('0x3')]();var fs_extra=require(_0x9981('0x4'));var auth=require(_0x9981('0x5'));var interaction=require(_0x9981('0x6'));var config=require(_0x9981('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x9981('0x8')]('/',auth[_0x9981('0x9')](),controller['index']);router['get']('/describe',auth[_0x9981('0x9')](),controller[_0x9981('0xa')]);router[_0x9981('0x8')](_0x9981('0xb'),auth[_0x9981('0x9')](),controller[_0x9981('0xc')]);router[_0x9981('0xd')]('/',auth['isAuthenticated'](),controller[_0x9981('0xe')]);router['put'](_0x9981('0xb'),auth['isAuthenticated'](),controller[_0x9981('0xf')]);router[_0x9981('0x10')](_0x9981('0xb'),auth['isAuthenticated'](),controller[_0x9981('0x11')]);module[_0x9981('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d3e0c04..c091574 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(_0x4cd49f,_0x35cfb1){var _0x843fd3=function(_0x427659){while(--_0x427659){_0x4cd49f['push'](_0x4cd49f['shift']());}};_0x843fd3(++_0x35cfb1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x50621f,_0x56845c){var _0x1d2b1d=function(_0x4f6c51){while(--_0x4f6c51){_0x50621f['push'](_0x50621f['shift']());}};_0x1d2b1d(++_0x56845c);}(_0x7a54,0x106));var _0x47a5=function(_0x530a71,_0x22b30e){_0x530a71=_0x530a71-0x0;var _0x1f054e=_0x7a54[_0x530a71];return _0x1f054e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 1a9fd9a..2493da0 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 _0xae60=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x11f640,_0x482aa3){var _0x3f6283=function(_0x1923a8){while(--_0x1923a8){_0x11f640['push'](_0x11f640['shift']());}};_0x3f6283(++_0x482aa3);}(_0xae60,0x1c7));var _0x0ae6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xae60[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['WhatsappQueueReport'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));};exports[_0x0ae6('0x4e')]=function(_0x327b55,_0x173acd){return db[_0x0ae6('0x2e')][_0x0ae6('0x4e')]()[_0x0ae6('0x29')](respondWithResult(_0x173acd,null))[_0x0ae6('0x48')](handleError(_0x173acd,null));}; \ No newline at end of file +var _0xac4a=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x20ffae,_0x557b68){var _0x2af088=function(_0x21d8aa){while(--_0x21d8aa){_0x20ffae['push'](_0x20ffae['shift']());}};_0x2af088(++_0x557b68);}(_0xac4a,0x13f));var _0xaac4=function(_0x494a96,_0x23ff31){_0x494a96=_0x494a96-0x0;var _0x1ab19a=_0xac4a[_0x494a96];return _0x1ab19a;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={},_0x16b33c={},_0xda10b6={'count':0x0,'rows':[]};var _0xb76ccc=_[_0xaac4('0x29')](db[_0xaac4('0x2a')]['rawAttributes'],function(_0xcf6c1){return{'name':_0xcf6c1['fieldName'],'type':_0xcf6c1[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x16b33c[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0xb76ccc,'name');_0x16b33c['query']=_['keys'](_0x386c9b[_0xaac4('0x2e')]);_0x16b33c[_0xaac4('0x2f')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],_0x16b33c[_0xaac4('0x2e')]);_0x316445[_0xaac4('0x31')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x32')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x33')]?_0x316445[_0xaac4('0x31')]:_0x16b33c['model'];if(!_0x386c9b['query'][_0xaac4('0x34')](_0xaac4('0x35'))){_0x316445[_0xaac4('0x1a')]=qs['limit'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x316445[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x18')]);}_0x316445[_0xaac4('0x36')]=qs['sort'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x316445[_0xaac4('0x38')]=qs['filters'](_[_0xaac4('0x39')](_0x386c9b['query'],_0x16b33c['filters']),_0xb76ccc);if(_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x3a')]){_0x316445[_0xaac4('0x38')]=_['merge'](_0x316445['where'],{'$or':_[_0xaac4('0x29')](_0xb76ccc,function(_0x33cc4){if(_0x33cc4[_0xaac4('0x2b')]!==_0xaac4('0x3b')){var _0x2b65b1={};_0x2b65b1[_0x33cc4[_0xaac4('0x26')]]={'$like':'%'+_0x386c9b['query']['filter']+'%'};return _0x2b65b1;}})});}_0x316445=_[_0xaac4('0x3c')]({},_0x316445,_0x386c9b[_0xaac4('0x3d')]);var _0x5371b4={'where':_0x316445[_0xaac4('0x38')]};return db[_0xaac4('0x2a')][_0xaac4('0x1b')](_0x5371b4)['then'](function(_0x74a1c){_0xda10b6[_0xaac4('0x1b')]=_0x74a1c;if(_0x386c9b[_0xaac4('0x2e')]['includeAll']){_0x316445[_0xaac4('0x3e')]=[{'all':!![]}];}return db[_0xaac4('0x2a')][_0xaac4('0x3f')](_0x316445);})[_0xaac4('0x23')](function(_0x51e59d){_0xda10b6[_0xaac4('0x40')]=_0x51e59d;return _0xda10b6;})['then'](respondWithFilteredResult(_0x4d0f5f,_0x316445))['catch'](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x41')]=function(_0x31e240,_0x27df36){var _0x40c007={'raw':!![],'where':{'id':_0x31e240[_0xaac4('0x42')]['id']}},_0x43bc12={};_0x43bc12[_0xaac4('0x2d')]=_[_0xaac4('0x43')](db['WhatsappQueueReport'][_0xaac4('0x44')]);_0x43bc12[_0xaac4('0x2e')]=_[_0xaac4('0x43')](_0x31e240[_0xaac4('0x2e')]);_0x43bc12['filters']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],_0x43bc12[_0xaac4('0x2e')]);_0x40c007['attributes']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x31e240[_0xaac4('0x2e')]['fields']));_0x40c007[_0xaac4('0x31')]=_0x40c007[_0xaac4('0x31')][_0xaac4('0x33')]?_0x40c007['attributes']:_0x43bc12[_0xaac4('0x2d')];if(_0x31e240[_0xaac4('0x2e')][_0xaac4('0x45')]){_0x40c007[_0xaac4('0x3e')]=[{'all':!![]}];}_0x40c007=_[_0xaac4('0x3c')]({},_0x40c007,_0x31e240[_0xaac4('0x3d')]);return db[_0xaac4('0x2a')][_0xaac4('0x46')](_0x40c007)[_0xaac4('0x23')](handleEntityNotFound(_0x27df36,null))['then'](respondWithResult(_0x27df36,null))[_0xaac4('0x47')](handleError(_0x27df36,null));};exports[_0xaac4('0x48')]=function(_0x27425a,_0x360420){return db[_0xaac4('0x2a')]['create'](_0x27425a['body'],{})[_0xaac4('0x23')](respondWithResult(_0x360420,0xc9))[_0xaac4('0x47')](handleError(_0x360420,null));};exports[_0xaac4('0x21')]=function(_0x16c7f4,_0x5f33ea){if(_0x16c7f4[_0xaac4('0x49')]['id']){delete _0x16c7f4['body']['id'];}return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x16c7f4['params']['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x5f33ea,null))[_0xaac4('0x23')](saveUpdates(_0x16c7f4[_0xaac4('0x49')],null))['then'](respondWithResult(_0x5f33ea,null))['catch'](handleError(_0x5f33ea,null));};exports[_0xaac4('0x22')]=function(_0x2c1751,_0x22dda7){return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x2c1751[_0xaac4('0x42')]['id']}})['then'](handleEntityNotFound(_0x22dda7,null))[_0xaac4('0x23')](removeEntity(_0x22dda7,null))[_0xaac4('0x47')](handleError(_0x22dda7,null));};exports[_0xaac4('0x4a')]=function(_0x38f9af,_0x56201b){return db[_0xaac4('0x2a')]['describe']()[_0xaac4('0x23')](respondWithResult(_0x56201b,null))[_0xaac4('0x47')](handleError(_0x56201b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 636f750..44fff7d 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 _0x8bde=['uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x5b012e,_0x5cb94c){var _0xd6daf0=function(_0x1e9d33){while(--_0x1e9d33){_0x5b012e['push'](_0x5b012e['shift']());}};_0xd6daf0(++_0x5cb94c);}(_0x8bde,0x169));var _0xe8bd=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x8bde[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0xe8bd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe8bd('0x1'));var BPromise=require(_0xe8bd('0x2'));var rp=require(_0xe8bd('0x3'));var fs=require('fs');var path=require(_0xe8bd('0x4'));var rimraf=require(_0xe8bd('0x5'));var config=require(_0xe8bd('0x6'));var attributes=require(_0xe8bd('0x7'));module[_0xe8bd('0x8')]=function(_0x104cb4,_0x5dcde6){return _0x104cb4[_0xe8bd('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0xe8bd('0xa'),'paranoid':![],'indexes':[{'name':_0xe8bd('0xb'),'fields':[_0xe8bd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa85f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x2a8c42,_0x501718){var _0x6494e9=function(_0x2f2f3a){while(--_0x2f2f3a){_0x2a8c42['push'](_0x2a8c42['shift']());}};_0x6494e9(++_0x501718);}(_0xa85f,0x188));var _0xfa85=function(_0xfcde96,_0x3ce18c){_0xfcde96=_0xfcde96-0x0;var _0x39fd1e=_0xa85f[_0xfcde96];return _0x39fd1e;};'use strict';var _=require(_0xfa85('0x0'));var util=require(_0xfa85('0x1'));var logger=require(_0xfa85('0x2'))('api');var moment=require(_0xfa85('0x3'));var BPromise=require(_0xfa85('0x4'));var rp=require(_0xfa85('0x5'));var fs=require('fs');var path=require(_0xfa85('0x6'));var rimraf=require('rimraf');var config=require(_0xfa85('0x7'));var attributes=require(_0xfa85('0x8'));module[_0xfa85('0x9')]=function(_0x3b6071,_0x1130e0){return _0x3b6071[_0xfa85('0xa')](_0xfa85('0xb'),attributes,{'tableName':_0xfa85('0xc'),'paranoid':![],'indexes':[{'name':_0xfa85('0xd'),'fields':[_0xfa85('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 5abdaf3..feaf6ba 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 _0x10a9=['stringify','error','code','message','info','request\x20sent','result','catch','WhatsappQueueReport','create','options','then','CreateWhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1a06c7,_0x7a82f7){var _0x464d01=function(_0x4500ad){while(--_0x4500ad){_0x1a06c7['push'](_0x1a06c7['shift']());}};_0x464d01(++_0x7a82f7);}(_0x10a9,0xb7));var _0x910a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x10a9[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x910a('0x0'));var util=require(_0x910a('0x1'));var moment=require(_0x910a('0x2'));var BPromise=require(_0x910a('0x3'));var rs=require(_0x910a('0x4'));var fs=require('fs');var Redis=require(_0x910a('0x5'));var db=require(_0x910a('0x6'))['db'];var utils=require(_0x910a('0x7'));var logger=require('../../config/logger')(_0x910a('0x8'));var config=require(_0x910a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x910a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2138e4,_0x112bc6,_0x454fa5){return new BPromise(function(_0x5bcd73,_0xa08d68){return client[_0x910a('0xb')](_0x2138e4,_0x454fa5)['then'](function(_0x597bd4){logger['info'](_0x910a('0xc'),_0x112bc6,'request\x20sent');logger[_0x910a('0xd')](_0x910a('0xe'),_0x112bc6,'request\x20sent',JSON[_0x910a('0xf')](_0x597bd4));if(_0x597bd4[_0x910a('0x10')]){if(_0x597bd4[_0x910a('0x10')][_0x910a('0x11')]===0x1f4){logger[_0x910a('0x10')](_0x910a('0xc'),_0x112bc6,_0x597bd4[_0x910a('0x10')]['message']);return _0xa08d68(_0x597bd4[_0x910a('0x10')][_0x910a('0x12')]);}logger[_0x910a('0x10')](_0x910a('0xc'),_0x112bc6,_0x597bd4[_0x910a('0x10')][_0x910a('0x12')]);return _0x5bcd73(_0x597bd4['error'][_0x910a('0x12')]);}else{logger[_0x910a('0x13')](_0x910a('0xc'),_0x112bc6,_0x910a('0x14'));_0x5bcd73(_0x597bd4[_0x910a('0x15')][_0x910a('0x12')]);}})[_0x910a('0x16')](function(_0x5a1c24){logger[_0x910a('0x10')](_0x910a('0xc'),_0x112bc6,_0x5a1c24);_0xa08d68(_0x5a1c24);});});}exports['CreateWhatsappQueueReport']=function(_0xad6c1f){var _0x283f59=this;return new Promise(function(_0x37c790,_0x2438ba){return db[_0x910a('0x17')][_0x910a('0x18')](_0xad6c1f['body'],{'raw':_0xad6c1f[_0x910a('0x19')]?_0xad6c1f[_0x910a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x910a('0x1a')](function(_0x1b9533){logger[_0x910a('0x13')]('CreateWhatsappQueueReport',_0xad6c1f);logger[_0x910a('0xd')]('CreateWhatsappQueueReport',_0xad6c1f,JSON[_0x910a('0xf')](_0x1b9533));_0x37c790(_0x1b9533);})[_0x910a('0x16')](function(_0x236730){logger[_0x910a('0x10')](_0x910a('0x1b'),_0x236730[_0x910a('0x12')],_0xad6c1f);_0x2438ba(_0x283f59[_0x910a('0x10')](0x1f4,_0x236730[_0x910a('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x96f84c){var _0x1739d7=this;return new Promise(function(_0x2d05b7,_0x1a6dbc){return db[_0x910a('0x17')][_0x910a('0x1c')](_0x96f84c['body'],{'raw':_0x96f84c[_0x910a('0x19')]?_0x96f84c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96f84c[_0x910a('0x19')]?_0x96f84c[_0x910a('0x19')][_0x910a('0x1d')]||null:null,'attributes':_0x96f84c[_0x910a('0x19')]?_0x96f84c[_0x910a('0x19')][_0x910a('0x1e')]||null:null,'limit':_0x96f84c['options']?_0x96f84c[_0x910a('0x19')][_0x910a('0x1f')]||null:null})['then'](function(_0xec2821){logger[_0x910a('0x13')](_0x910a('0x20'),_0x96f84c);logger[_0x910a('0xd')](_0x910a('0x20'),_0x96f84c,JSON[_0x910a('0xf')](_0xec2821));_0x2d05b7(_0xec2821);})['catch'](function(_0x4ff706){logger[_0x910a('0x10')](_0x910a('0x20'),_0x4ff706[_0x910a('0x12')],_0x96f84c);_0x1a6dbc(_0x1739d7['error'](0x1f4,_0x4ff706[_0x910a('0x12')]));});});}; \ No newline at end of file +var _0x1617=['then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30a582,_0x4bed3e){var _0x353c6a=function(_0x567ac2){while(--_0x567ac2){_0x30a582['push'](_0x30a582['shift']());}};_0x353c6a(++_0x4bed3e);}(_0x1617,0xa5));var _0x7161=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x1617[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require(_0x7161('0x0'));var moment=require('moment');var BPromise=require(_0x7161('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7161('0x2'));var db=require(_0x7161('0x3'))['db'];var utils=require(_0x7161('0x4'));var logger=require(_0x7161('0x5'))(_0x7161('0x6'));var config=require(_0x7161('0x7'));var jayson=require(_0x7161('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24f962,_0x1b668,_0xe7a2d3){return new BPromise(function(_0x77e26,_0x258435){return client['request'](_0x24f962,_0xe7a2d3)[_0x7161('0x9')](function(_0xca1f15){logger[_0x7161('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1b668,_0x7161('0xb'));logger[_0x7161('0xc')](_0x7161('0xd'),_0x1b668,_0x7161('0xb'),JSON[_0x7161('0xe')](_0xca1f15));if(_0xca1f15[_0x7161('0xf')]){if(_0xca1f15['error']['code']===0x1f4){logger[_0x7161('0xf')](_0x7161('0x10'),_0x1b668,_0xca1f15['error'][_0x7161('0x11')]);return _0x258435(_0xca1f15[_0x7161('0xf')][_0x7161('0x11')]);}logger[_0x7161('0xf')](_0x7161('0x10'),_0x1b668,_0xca1f15[_0x7161('0xf')][_0x7161('0x11')]);return _0x77e26(_0xca1f15[_0x7161('0xf')]['message']);}else{logger[_0x7161('0xa')](_0x7161('0x10'),_0x1b668,_0x7161('0xb'));_0x77e26(_0xca1f15[_0x7161('0x12')][_0x7161('0x11')]);}})['catch'](function(_0x35c2bb){logger[_0x7161('0xf')](_0x7161('0x10'),_0x1b668,_0x35c2bb);_0x258435(_0x35c2bb);});});}exports['CreateWhatsappQueueReport']=function(_0x5c10b6){var _0x56f6fd=this;return new Promise(function(_0x5cfd9c,_0x57fba7){return db[_0x7161('0x13')][_0x7161('0x14')](_0x5c10b6[_0x7161('0x15')],{'raw':_0x5c10b6[_0x7161('0x16')]?_0x5c10b6[_0x7161('0x16')][_0x7161('0x17')]===undefined?!![]:![]:!![]})[_0x7161('0x9')](function(_0x25500f){logger['info']('CreateWhatsappQueueReport',_0x5c10b6);logger[_0x7161('0xc')](_0x7161('0x18'),_0x5c10b6,JSON['stringify'](_0x25500f));_0x5cfd9c(_0x25500f);})[_0x7161('0x19')](function(_0x15a3a8){logger[_0x7161('0xf')](_0x7161('0x18'),_0x15a3a8[_0x7161('0x11')],_0x5c10b6);_0x57fba7(_0x56f6fd[_0x7161('0xf')](0x1f4,_0x15a3a8[_0x7161('0x11')]));});});};exports[_0x7161('0x1a')]=function(_0x98e3c8){var _0x3ccebb=this;return new Promise(function(_0x301d34,_0x17c0fa){return db[_0x7161('0x13')][_0x7161('0x1b')](_0x98e3c8[_0x7161('0x15')],{'raw':_0x98e3c8[_0x7161('0x16')]?_0x98e3c8[_0x7161('0x16')][_0x7161('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x98e3c8[_0x7161('0x16')]?_0x98e3c8[_0x7161('0x16')]['where']||null:null,'attributes':_0x98e3c8[_0x7161('0x16')]?_0x98e3c8[_0x7161('0x16')]['attributes']||null:null,'limit':_0x98e3c8['options']?_0x98e3c8[_0x7161('0x16')][_0x7161('0x1c')]||null:null})['then'](function(_0x398ef3){logger['info'](_0x7161('0x1a'),_0x98e3c8);logger[_0x7161('0xc')](_0x7161('0x1a'),_0x98e3c8,JSON[_0x7161('0xe')](_0x398ef3));_0x301d34(_0x398ef3);})[_0x7161('0x19')](function(_0x133830){logger[_0x7161('0xf')]('UpdateWhatsappQueueReport',_0x133830[_0x7161('0x11')],_0x98e3c8);_0x17c0fa(_0x3ccebb[_0x7161('0xf')](0x1f4,_0x133830[_0x7161('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4914ce1..6d0f877 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 _0x4b58=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xc7f885,_0x1f8b90){var _0x2e146c=function(_0x48b8ec){while(--_0x48b8ec){_0xc7f885['push'](_0xc7f885['shift']());}};_0x2e146c(++_0x1f8b90);}(_0x4b58,0x67));var _0x84b5=function(_0x2e8dd7,_0x2d334e){_0x2e8dd7=_0x2e8dd7-0x0;var _0x164ddb=_0x4b58[_0x2e8dd7];return _0x164ddb;};'use strict';var multer=require(_0x84b5('0x0'));var util=require(_0x84b5('0x1'));var path=require(_0x84b5('0x2'));var timeout=require(_0x84b5('0x3'));var express=require(_0x84b5('0x4'));var router=express[_0x84b5('0x5')]();var fs_extra=require(_0x84b5('0x6'));var auth=require(_0x84b5('0x7'));var interaction=require(_0x84b5('0x8'));var config=require(_0x84b5('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0x84b5('0xa')]('/',auth[_0x84b5('0xb')](),controller['index']);router['get'](_0x84b5('0xc'),auth[_0x84b5('0xb')](),controller[_0x84b5('0xd')]);router[_0x84b5('0xa')](_0x84b5('0xe'),auth[_0x84b5('0xb')](),controller[_0x84b5('0xf')]);router[_0x84b5('0x10')]('/',auth[_0x84b5('0xb')](),controller[_0x84b5('0x11')]);router['put'](_0x84b5('0xe'),auth[_0x84b5('0xb')](),controller[_0x84b5('0x12')]);router[_0x84b5('0x13')](_0x84b5('0xe'),auth[_0x84b5('0xb')](),controller[_0x84b5('0x14')]);module[_0x84b5('0x15')]=router; \ No newline at end of file +var _0xc2bd=['/:id','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x2d289e,_0x1005d9){var _0xe3785a=function(_0x433037){while(--_0x433037){_0x2d289e['push'](_0x2d289e['shift']());}};_0xe3785a(++_0x1005d9);}(_0xc2bd,0x15d));var _0xdc2b=function(_0x3fe988,_0x149b45){_0x3fe988=_0x3fe988-0x0;var _0x62ef22=_0xc2bd[_0x3fe988];return _0x62ef22;};'use strict';var multer=require(_0xdc2b('0x0'));var util=require(_0xdc2b('0x1'));var path=require('path');var timeout=require(_0xdc2b('0x2'));var express=require(_0xdc2b('0x3'));var router=express[_0xdc2b('0x4')]();var fs_extra=require(_0xdc2b('0x5'));var auth=require(_0xdc2b('0x6'));var interaction=require(_0xdc2b('0x7'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xdc2b('0x8')]('/',auth[_0xdc2b('0x9')](),controller[_0xdc2b('0xa')]);router[_0xdc2b('0x8')](_0xdc2b('0xb'),auth[_0xdc2b('0x9')](),controller['describe']);router[_0xdc2b('0x8')](_0xdc2b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xdc2b('0xd')]('/',auth['isAuthenticated'](),controller[_0xdc2b('0xe')]);router[_0xdc2b('0xf')](_0xdc2b('0xc'),auth[_0xdc2b('0x9')](),controller[_0xdc2b('0x10')]);router['delete'](_0xdc2b('0xc'),auth[_0xdc2b('0x9')](),controller[_0xdc2b('0x11')]);module[_0xdc2b('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a62c7ae..4e1fbe7 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 _0x8814=['sequelize','ENUM','agent','queue','DATE'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x8814,0x1b8));var _0x4881=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x8814[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require(_0x4881('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4881('0x1')]('account',_0x4881('0x2'),_0x4881('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4881('0x4')]}}; \ No newline at end of file +var _0x3cd0=['agent','queue','DATE','sequelize','ENUM'];(function(_0x6bc441,_0x4e9239){var _0x57514f=function(_0xb88b8e){while(--_0xb88b8e){_0x6bc441['push'](_0x6bc441['shift']());}};_0x57514f(++_0x4e9239);}(_0x3cd0,0x8a));var _0x03cd=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0x3cd0[_0x31dde9];return _0x1fbf2d;};'use strict';var Sequelize=require(_0x03cd('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x03cd('0x1')]('account',_0x03cd('0x2'),_0x03cd('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x03cd('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 3696203..668ff49 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 _0x77de=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','merge','find','create'];(function(_0x50ce31,_0x1a50ef){var _0x12e8b5=function(_0x24b60b){while(--_0x24b60b){_0x50ce31['push'](_0x50ce31['shift']());}};_0x12e8b5(++_0x1a50ef);}(_0x77de,0x1d0));var _0xe77d=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x77de[_0x24392f];return _0x591e33;};'use strict';var emlformat=require(_0xe77d('0x0'));var rimraf=require(_0xe77d('0x1'));var zipdir=require(_0xe77d('0x2'));var jsonpatch=require(_0xe77d('0x3'));var rp=require('request-promise');var moment=require(_0xe77d('0x4'));var BPromise=require(_0xe77d('0x5'));var Mustache=require(_0xe77d('0x6'));var util=require(_0xe77d('0x7'));var path=require(_0xe77d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe77d('0x9'));var fs=require('fs');var fs_extra=require(_0xe77d('0xa'));var _=require(_0xe77d('0xb'));var squel=require(_0xe77d('0xc'));var crypto=require(_0xe77d('0xd'));var jsforce=require(_0xe77d('0xe'));var deskjs=require(_0xe77d('0xf'));var toCsv=require(_0xe77d('0x10'));var querystring=require(_0xe77d('0x11'));var Papa=require('papaparse');var Redis=require(_0xe77d('0x12'));var authService=require(_0xe77d('0x13'));var qs=require(_0xe77d('0x14'));var as=require(_0xe77d('0x15'));var hardwareService=require(_0xe77d('0x16'));var logger=require(_0xe77d('0x17'))(_0xe77d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd0dc,_0x304a37){_0x304a37=_0x304a37||0xcc;return function(_0x1dc084){if(_0x1dc084){return _0x2bd0dc[_0xe77d('0x19')](_0x304a37);}return _0x2bd0dc[_0xe77d('0x1a')](_0x304a37)[_0xe77d('0x1b')]();};}function respondWithResult(_0x229257,_0x23385a){_0x23385a=_0x23385a||0xc8;return function(_0x35a6d4){if(_0x35a6d4){return _0x229257['status'](_0x23385a)['json'](_0x35a6d4);}};}function respondWithFilteredResult(_0x2907af,_0x4be4ce){return function(_0xef102d){if(_0xef102d){var _0x37c44d=typeof _0x4be4ce['offset']===_0xe77d('0x1c')&&typeof _0x4be4ce[_0xe77d('0x1d')]===_0xe77d('0x1c');var _0x81ee3e=_0xef102d[_0xe77d('0x1e')];var _0x5a3846=_0x37c44d?0x0:_0x4be4ce[_0xe77d('0x1f')];var _0x5d3b11=_0x37c44d?_0xef102d[_0xe77d('0x1e')]:_0x4be4ce[_0xe77d('0x1f')]+_0x4be4ce['limit'];var _0x535d98;if(_0x5d3b11>=_0x81ee3e){_0x5d3b11=_0x81ee3e;_0x535d98=0xc8;}else{_0x535d98=0xce;}_0x2907af['status'](_0x535d98);return _0x2907af[_0xe77d('0x20')](_0xe77d('0x21'),_0x5a3846+'-'+_0x5d3b11+'/'+_0x81ee3e)[_0xe77d('0x22')](_0xef102d);}return null;};}function patchUpdates(_0x2cdc01){return function(_0x267bf0){try{jsonpatch[_0xe77d('0x23')](_0x267bf0,_0x2cdc01,!![]);}catch(_0x2ec821){return BPromise[_0xe77d('0x24')](_0x2ec821);}return _0x267bf0['save']();};}function saveUpdates(_0x557928,_0x522f93){return function(_0x2a6953){if(_0x2a6953){return _0x2a6953['update'](_0x557928)[_0xe77d('0x25')](function(_0x34a063){return _0x34a063;});}return null;};}function removeEntity(_0x38a451,_0x36f0ad){return function(_0x18d5ab){if(_0x18d5ab){return _0x18d5ab[_0xe77d('0x26')]()[_0xe77d('0x25')](function(){_0x38a451['status'](0xcc)[_0xe77d('0x1b')]();});}};}function handleEntityNotFound(_0x363837,_0x3b9fa0){return function(_0x3e5061){if(!_0x3e5061){_0x363837[_0xe77d('0x19')](0x194);}return _0x3e5061;};}function handleError(_0x536a78,_0x539281){_0x539281=_0x539281||0x1f4;return function(_0x4eb01f){logger['error'](_0x4eb01f[_0xe77d('0x27')]);if(_0x4eb01f[_0xe77d('0x28')]){delete _0x4eb01f[_0xe77d('0x28')];}_0x536a78[_0xe77d('0x1a')](_0x539281)[_0xe77d('0x29')](_0x4eb01f);};}exports[_0xe77d('0x2a')]=function(_0x506c3a,_0x49b30d){var _0x35dcc2={},_0x57ebfe={},_0x273766={'count':0x0,'rows':[]};var _0x5d0d5c=_[_0xe77d('0x2b')](db[_0xe77d('0x2c')]['rawAttributes'],function(_0x568aa1){return{'name':_0x568aa1[_0xe77d('0x2d')],'type':_0x568aa1[_0xe77d('0x2e')][_0xe77d('0x2f')]};});_0x57ebfe[_0xe77d('0x30')]=_[_0xe77d('0x2b')](_0x5d0d5c,_0xe77d('0x28'));_0x57ebfe[_0xe77d('0x31')]=_['keys'](_0x506c3a[_0xe77d('0x31')]);_0x57ebfe[_0xe77d('0x32')]=_['intersection'](_0x57ebfe['model'],_0x57ebfe[_0xe77d('0x31')]);_0x35dcc2[_0xe77d('0x33')]=_[_0xe77d('0x34')](_0x57ebfe['model'],qs[_0xe77d('0x35')](_0x506c3a[_0xe77d('0x31')][_0xe77d('0x35')]));_0x35dcc2[_0xe77d('0x33')]=_0x35dcc2[_0xe77d('0x33')]['length']?_0x35dcc2[_0xe77d('0x33')]:_0x57ebfe[_0xe77d('0x30')];if(!_0x506c3a['query'][_0xe77d('0x36')](_0xe77d('0x37'))){_0x35dcc2[_0xe77d('0x1d')]=qs[_0xe77d('0x1d')](_0x506c3a[_0xe77d('0x31')]['limit']);_0x35dcc2[_0xe77d('0x1f')]=qs[_0xe77d('0x1f')](_0x506c3a['query']['offset']);}_0x35dcc2[_0xe77d('0x38')]=qs[_0xe77d('0x39')](_0x506c3a['query'][_0xe77d('0x39')]);_0x35dcc2['where']=qs[_0xe77d('0x32')](_[_0xe77d('0x3a')](_0x506c3a[_0xe77d('0x31')],_0x57ebfe['filters']),_0x5d0d5c);if(_0x506c3a[_0xe77d('0x31')][_0xe77d('0x3b')]){_0x35dcc2[_0xe77d('0x3c')]=_['merge'](_0x35dcc2['where'],{'$or':_[_0xe77d('0x2b')](_0x5d0d5c,function(_0x316901){if(_0x316901['type']!==_0xe77d('0x3d')){var _0x15c17f={};_0x15c17f[_0x316901[_0xe77d('0x28')]]={'$like':'%'+_0x506c3a['query'][_0xe77d('0x3b')]+'%'};return _0x15c17f;}})});}_0x35dcc2=_['merge']({},_0x35dcc2,_0x506c3a[_0xe77d('0x3e')]);var _0x358e9f={'where':_0x35dcc2['where']};return db[_0xe77d('0x2c')]['count'](_0x358e9f)[_0xe77d('0x25')](function(_0x293ad6){_0x273766[_0xe77d('0x1e')]=_0x293ad6;if(_0x506c3a[_0xe77d('0x31')][_0xe77d('0x3f')]){_0x35dcc2[_0xe77d('0x40')]=[{'all':!![]}];}return db[_0xe77d('0x2c')]['findAll'](_0x35dcc2);})[_0xe77d('0x25')](function(_0xeab8a3){_0x273766[_0xe77d('0x41')]=_0xeab8a3;return _0x273766;})[_0xe77d('0x25')](respondWithFilteredResult(_0x49b30d,_0x35dcc2))[_0xe77d('0x42')](handleError(_0x49b30d,null));};exports[_0xe77d('0x43')]=function(_0x2c5b94,_0x466bc8){var _0xe1e879={'raw':!![],'where':{'id':_0x2c5b94[_0xe77d('0x44')]['id']}},_0x3c693e={};_0x3c693e[_0xe77d('0x30')]=_[_0xe77d('0x45')](db[_0xe77d('0x2c')][_0xe77d('0x46')]);_0x3c693e[_0xe77d('0x31')]=_[_0xe77d('0x45')](_0x2c5b94['query']);_0x3c693e['filters']=_['intersection'](_0x3c693e[_0xe77d('0x30')],_0x3c693e[_0xe77d('0x31')]);_0xe1e879[_0xe77d('0x33')]=_['intersection'](_0x3c693e[_0xe77d('0x30')],qs['fields'](_0x2c5b94[_0xe77d('0x31')][_0xe77d('0x35')]));_0xe1e879['attributes']=_0xe1e879[_0xe77d('0x33')][_0xe77d('0x47')]?_0xe1e879[_0xe77d('0x33')]:_0x3c693e[_0xe77d('0x30')];if(_0x2c5b94[_0xe77d('0x31')][_0xe77d('0x3f')]){_0xe1e879[_0xe77d('0x40')]=[{'all':!![]}];}_0xe1e879=_[_0xe77d('0x48')]({},_0xe1e879,_0x2c5b94[_0xe77d('0x3e')]);return db[_0xe77d('0x2c')][_0xe77d('0x49')](_0xe1e879)['then'](handleEntityNotFound(_0x466bc8,null))[_0xe77d('0x25')](respondWithResult(_0x466bc8,null))[_0xe77d('0x42')](handleError(_0x466bc8,null));};exports[_0xe77d('0x4a')]=function(_0x27b5a9,_0x40050e){return db[_0xe77d('0x2c')][_0xe77d('0x4a')](_0x27b5a9[_0xe77d('0x4b')],{})[_0xe77d('0x25')](respondWithResult(_0x40050e,0xc9))[_0xe77d('0x42')](handleError(_0x40050e,null));};exports['update']=function(_0x4e73e0,_0x312464){if(_0x4e73e0[_0xe77d('0x4b')]['id']){delete _0x4e73e0[_0xe77d('0x4b')]['id'];}return db[_0xe77d('0x2c')][_0xe77d('0x49')]({'where':{'id':_0x4e73e0[_0xe77d('0x44')]['id']}})[_0xe77d('0x25')](handleEntityNotFound(_0x312464,null))[_0xe77d('0x25')](saveUpdates(_0x4e73e0[_0xe77d('0x4b')],null))['then'](respondWithResult(_0x312464,null))[_0xe77d('0x42')](handleError(_0x312464,null));};exports[_0xe77d('0x26')]=function(_0x13485c,_0x587b03){return db['WhatsappTransferReport'][_0xe77d('0x49')]({'where':{'id':_0x13485c[_0xe77d('0x44')]['id']}})[_0xe77d('0x25')](handleEntityNotFound(_0x587b03,null))[_0xe77d('0x25')](removeEntity(_0x587b03,null))[_0xe77d('0x42')](handleError(_0x587b03,null));};exports['describe']=function(_0x4091ce,_0x3e170f){return db[_0xe77d('0x2c')][_0xe77d('0x4c')]()[_0xe77d('0x25')](respondWithResult(_0x3e170f,null))[_0xe77d('0x42')](handleError(_0x3e170f,null));}; \ No newline at end of file +var _0x5700=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','options','includeAll','include','WhatsappTransferReport','findAll','rows','catch','keys','rawAttributes','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','save','update','then','destroy','stack','name','index','map','fieldName','type','key','model','query'];(function(_0x315062,_0x3b97d7){var _0x1bea22=function(_0x3ceccb){while(--_0x3ceccb){_0x315062['push'](_0x315062['shift']());}};_0x1bea22(++_0x3b97d7);}(_0x5700,0x12d));var _0x0570=function(_0x5ebe0f,_0x1292af){_0x5ebe0f=_0x5ebe0f-0x0;var _0x2fef04=_0x5700[_0x5ebe0f];return _0x2fef04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0570('0x0'));var zipdir=require(_0x0570('0x1'));var jsonpatch=require(_0x0570('0x2'));var rp=require(_0x0570('0x3'));var moment=require(_0x0570('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0570('0x5'));var util=require(_0x0570('0x6'));var path=require(_0x0570('0x7'));var sox=require(_0x0570('0x8'));var csv=require('to-csv');var ejs=require(_0x0570('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0570('0xa'));var crypto=require(_0x0570('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0570('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0570('0xd'));var Papa=require(_0x0570('0xe'));var Redis=require(_0x0570('0xf'));var authService=require(_0x0570('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0570('0x11'));var hardwareService=require(_0x0570('0x12'));var logger=require(_0x0570('0x13'))('api');var utils=require(_0x0570('0x14'));var config=require(_0x0570('0x15'));var licenseUtil=require(_0x0570('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554b63,_0x354a2c){_0x354a2c=_0x354a2c||0xcc;return function(_0x18412d){if(_0x18412d){return _0x554b63[_0x0570('0x17')](_0x354a2c);}return _0x554b63[_0x0570('0x18')](_0x354a2c)[_0x0570('0x19')]();};}function respondWithResult(_0x338ea5,_0x205027){_0x205027=_0x205027||0xc8;return function(_0x472cb0){if(_0x472cb0){return _0x338ea5[_0x0570('0x18')](_0x205027)[_0x0570('0x1a')](_0x472cb0);}};}function respondWithFilteredResult(_0x55cd48,_0x43efe1){return function(_0x462474){if(_0x462474){var _0x2d39b3=typeof _0x43efe1[_0x0570('0x1b')]===_0x0570('0x1c')&&typeof _0x43efe1['limit']===_0x0570('0x1c');var _0x5707c6=_0x462474['count'];var _0x13a9c4=_0x2d39b3?0x0:_0x43efe1[_0x0570('0x1b')];var _0x24851c=_0x2d39b3?_0x462474[_0x0570('0x1d')]:_0x43efe1[_0x0570('0x1b')]+_0x43efe1[_0x0570('0x1e')];var _0x1ac364;if(_0x24851c>=_0x5707c6){_0x24851c=_0x5707c6;_0x1ac364=0xc8;}else{_0x1ac364=0xce;}_0x55cd48['status'](_0x1ac364);return _0x55cd48['set']('Content-Range',_0x13a9c4+'-'+_0x24851c+'/'+_0x5707c6)[_0x0570('0x1a')](_0x462474);}return null;};}function patchUpdates(_0x10f222){return function(_0x409806){try{jsonpatch['apply'](_0x409806,_0x10f222,!![]);}catch(_0x4d9cc0){return BPromise['reject'](_0x4d9cc0);}return _0x409806[_0x0570('0x1f')]();};}function saveUpdates(_0x3b102a,_0x486b37){return function(_0x408b21){if(_0x408b21){return _0x408b21[_0x0570('0x20')](_0x3b102a)[_0x0570('0x21')](function(_0x72e904){return _0x72e904;});}return null;};}function removeEntity(_0x56b7e0,_0xf44762){return function(_0x5de013){if(_0x5de013){return _0x5de013[_0x0570('0x22')]()['then'](function(){_0x56b7e0[_0x0570('0x18')](0xcc)[_0x0570('0x19')]();});}};}function handleEntityNotFound(_0x2ce860,_0x4af6d4){return function(_0x3732d4){if(!_0x3732d4){_0x2ce860['sendStatus'](0x194);}return _0x3732d4;};}function handleError(_0x1da589,_0xf65df0){_0xf65df0=_0xf65df0||0x1f4;return function(_0x4b952f){logger['error'](_0x4b952f[_0x0570('0x23')]);if(_0x4b952f[_0x0570('0x24')]){delete _0x4b952f[_0x0570('0x24')];}_0x1da589[_0x0570('0x18')](_0xf65df0)['send'](_0x4b952f);};}exports[_0x0570('0x25')]=function(_0x5e5da7,_0x4be2c6){var _0x1e6426={},_0x55697e={},_0x53fed8={'count':0x0,'rows':[]};var _0x232fbc=_[_0x0570('0x26')](db['WhatsappTransferReport']['rawAttributes'],function(_0x3016b3){return{'name':_0x3016b3[_0x0570('0x27')],'type':_0x3016b3[_0x0570('0x28')][_0x0570('0x29')]};});_0x55697e[_0x0570('0x2a')]=_[_0x0570('0x26')](_0x232fbc,_0x0570('0x24'));_0x55697e['query']=_['keys'](_0x5e5da7[_0x0570('0x2b')]);_0x55697e[_0x0570('0x2c')]=_[_0x0570('0x2d')](_0x55697e['model'],_0x55697e[_0x0570('0x2b')]);_0x1e6426[_0x0570('0x2e')]=_[_0x0570('0x2d')](_0x55697e[_0x0570('0x2a')],qs['fields'](_0x5e5da7[_0x0570('0x2b')][_0x0570('0x2f')]));_0x1e6426[_0x0570('0x2e')]=_0x1e6426[_0x0570('0x2e')][_0x0570('0x30')]?_0x1e6426[_0x0570('0x2e')]:_0x55697e[_0x0570('0x2a')];if(!_0x5e5da7[_0x0570('0x2b')][_0x0570('0x31')](_0x0570('0x32'))){_0x1e6426[_0x0570('0x1e')]=qs[_0x0570('0x1e')](_0x5e5da7[_0x0570('0x2b')][_0x0570('0x1e')]);_0x1e6426[_0x0570('0x1b')]=qs[_0x0570('0x1b')](_0x5e5da7['query'][_0x0570('0x1b')]);}_0x1e6426[_0x0570('0x33')]=qs['sort'](_0x5e5da7['query']['sort']);_0x1e6426[_0x0570('0x34')]=qs[_0x0570('0x2c')](_[_0x0570('0x35')](_0x5e5da7[_0x0570('0x2b')],_0x55697e['filters']),_0x232fbc);if(_0x5e5da7['query']['filter']){_0x1e6426[_0x0570('0x34')]=_[_0x0570('0x36')](_0x1e6426[_0x0570('0x34')],{'$or':_[_0x0570('0x26')](_0x232fbc,function(_0x4aaa11){if(_0x4aaa11['type']!=='VIRTUAL'){var _0x4b7b9b={};_0x4b7b9b[_0x4aaa11[_0x0570('0x24')]]={'$like':'%'+_0x5e5da7['query']['filter']+'%'};return _0x4b7b9b;}})});}_0x1e6426=_[_0x0570('0x36')]({},_0x1e6426,_0x5e5da7[_0x0570('0x37')]);var _0x24b4c9={'where':_0x1e6426[_0x0570('0x34')]};return db['WhatsappTransferReport'][_0x0570('0x1d')](_0x24b4c9)[_0x0570('0x21')](function(_0x15f3c9){_0x53fed8[_0x0570('0x1d')]=_0x15f3c9;if(_0x5e5da7[_0x0570('0x2b')][_0x0570('0x38')]){_0x1e6426[_0x0570('0x39')]=[{'all':!![]}];}return db[_0x0570('0x3a')][_0x0570('0x3b')](_0x1e6426);})[_0x0570('0x21')](function(_0x525ebc){_0x53fed8[_0x0570('0x3c')]=_0x525ebc;return _0x53fed8;})[_0x0570('0x21')](respondWithFilteredResult(_0x4be2c6,_0x1e6426))[_0x0570('0x3d')](handleError(_0x4be2c6,null));};exports['show']=function(_0x4f67db,_0x8e7c14){var _0x2d02c0={'raw':!![],'where':{'id':_0x4f67db['params']['id']}},_0x443683={};_0x443683[_0x0570('0x2a')]=_[_0x0570('0x3e')](db['WhatsappTransferReport'][_0x0570('0x3f')]);_0x443683['query']=_[_0x0570('0x3e')](_0x4f67db[_0x0570('0x2b')]);_0x443683[_0x0570('0x2c')]=_[_0x0570('0x2d')](_0x443683[_0x0570('0x2a')],_0x443683[_0x0570('0x2b')]);_0x2d02c0[_0x0570('0x2e')]=_[_0x0570('0x2d')](_0x443683[_0x0570('0x2a')],qs[_0x0570('0x2f')](_0x4f67db[_0x0570('0x2b')][_0x0570('0x2f')]));_0x2d02c0[_0x0570('0x2e')]=_0x2d02c0[_0x0570('0x2e')][_0x0570('0x30')]?_0x2d02c0[_0x0570('0x2e')]:_0x443683[_0x0570('0x2a')];if(_0x4f67db[_0x0570('0x2b')][_0x0570('0x38')]){_0x2d02c0[_0x0570('0x39')]=[{'all':!![]}];}_0x2d02c0=_[_0x0570('0x36')]({},_0x2d02c0,_0x4f67db[_0x0570('0x37')]);return db['WhatsappTransferReport'][_0x0570('0x40')](_0x2d02c0)[_0x0570('0x21')](handleEntityNotFound(_0x8e7c14,null))[_0x0570('0x21')](respondWithResult(_0x8e7c14,null))[_0x0570('0x3d')](handleError(_0x8e7c14,null));};exports['create']=function(_0x1859e4,_0x328fc7){return db[_0x0570('0x3a')][_0x0570('0x41')](_0x1859e4[_0x0570('0x42')],{})[_0x0570('0x21')](respondWithResult(_0x328fc7,0xc9))[_0x0570('0x3d')](handleError(_0x328fc7,null));};exports[_0x0570('0x20')]=function(_0x618b56,_0x365af8){if(_0x618b56[_0x0570('0x42')]['id']){delete _0x618b56['body']['id'];}return db[_0x0570('0x3a')][_0x0570('0x40')]({'where':{'id':_0x618b56[_0x0570('0x43')]['id']}})[_0x0570('0x21')](handleEntityNotFound(_0x365af8,null))['then'](saveUpdates(_0x618b56[_0x0570('0x42')],null))[_0x0570('0x21')](respondWithResult(_0x365af8,null))[_0x0570('0x3d')](handleError(_0x365af8,null));};exports[_0x0570('0x22')]=function(_0x222ad7,_0x1eac8e){return db['WhatsappTransferReport'][_0x0570('0x40')]({'where':{'id':_0x222ad7[_0x0570('0x43')]['id']}})[_0x0570('0x21')](handleEntityNotFound(_0x1eac8e,null))[_0x0570('0x21')](removeEntity(_0x1eac8e,null))['catch'](handleError(_0x1eac8e,null));};exports['describe']=function(_0x3ccae2,_0x484775){return db[_0x0570('0x3a')][_0x0570('0x44')]()['then'](respondWithResult(_0x484775,null))[_0x0570('0x3d')](handleError(_0x484775,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 3545c65..31ffa5e 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 _0x211a=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x396ead,_0x2b4d16){var _0x4a55a1=function(_0x971acc){while(--_0x971acc){_0x396ead['push'](_0x396ead['shift']());}};_0x4a55a1(++_0x2b4d16);}(_0x211a,0x138));var _0xa211=function(_0x1861d2,_0x217fde){_0x1861d2=_0x1861d2-0x0;var _0x4a3f68=_0x211a[_0x1861d2];return _0x4a3f68;};'use strict';var _=require(_0xa211('0x0'));var util=require('util');var logger=require(_0xa211('0x1'))(_0xa211('0x2'));var moment=require(_0xa211('0x3'));var BPromise=require(_0xa211('0x4'));var rp=require(_0xa211('0x5'));var fs=require('fs');var path=require(_0xa211('0x6'));var rimraf=require(_0xa211('0x7'));var config=require(_0xa211('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0xa211('0x9')]=function(_0x500786,_0x5e21a6){return _0x500786['define'](_0xa211('0xa'),attributes,{'tableName':_0xa211('0xb'),'paranoid':![],'indexes':[{'name':_0xa211('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa515=['bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','report_whatsapp_transfer','uniqueid','lodash','util','api','moment'];(function(_0x26e1d0,_0x5d0f48){var _0x21664b=function(_0x27cfde){while(--_0x27cfde){_0x26e1d0['push'](_0x26e1d0['shift']());}};_0x21664b(++_0x5d0f48);}(_0xa515,0x170));var _0x5a51=function(_0x3865f4,_0xd57c37){_0x3865f4=_0x3865f4-0x0;var _0x229b84=_0xa515[_0x3865f4];return _0x229b84;};'use strict';var _=require(_0x5a51('0x0'));var util=require(_0x5a51('0x1'));var logger=require('../../config/logger')(_0x5a51('0x2'));var moment=require(_0x5a51('0x3'));var BPromise=require(_0x5a51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a51('0x5'));var rimraf=require(_0x5a51('0x6'));var config=require(_0x5a51('0x7'));var attributes=require(_0x5a51('0x8'));module['exports']=function(_0x3e6d21,_0x1af268){return _0x3e6d21[_0x5a51('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0x5a51('0xa'),'paranoid':![],'indexes':[{'name':_0x5a51('0xb'),'fields':[_0x5a51('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 684654c..7996904 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 _0x34e1=['http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x34e1,0xcd));var _0x134e=function(_0x2ae998,_0x35812b){_0x2ae998=_0x2ae998-0x0;var _0xecaa88=_0x34e1[_0x2ae998];return _0xecaa88;};'use strict';var _=require(_0x134e('0x0'));var util=require(_0x134e('0x1'));var moment=require('moment');var BPromise=require(_0x134e('0x2'));var rs=require(_0x134e('0x3'));var fs=require('fs');var Redis=require(_0x134e('0x4'));var db=require(_0x134e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x134e('0x6'))(_0x134e('0x7'));var config=require(_0x134e('0x8'));var jayson=require(_0x134e('0x9'));var client=jayson[_0x134e('0xa')][_0x134e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357811,_0x3cdcac,_0x32ffeb){return new BPromise(function(_0x1dbfe0,_0x56f1a1){return client[_0x134e('0xc')](_0x357811,_0x32ffeb)[_0x134e('0xd')](function(_0x4358a8){logger[_0x134e('0xe')](_0x134e('0xf'),_0x3cdcac,_0x134e('0x10'));logger[_0x134e('0x11')](_0x134e('0x12'),_0x3cdcac,_0x134e('0x10'),JSON['stringify'](_0x4358a8));if(_0x4358a8[_0x134e('0x13')]){if(_0x4358a8[_0x134e('0x13')][_0x134e('0x14')]===0x1f4){logger[_0x134e('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3cdcac,_0x4358a8[_0x134e('0x13')][_0x134e('0x15')]);return _0x56f1a1(_0x4358a8[_0x134e('0x13')][_0x134e('0x15')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3cdcac,_0x4358a8[_0x134e('0x13')][_0x134e('0x15')]);return _0x1dbfe0(_0x4358a8['error'][_0x134e('0x15')]);}else{logger[_0x134e('0xe')](_0x134e('0xf'),_0x3cdcac,'request\x20sent');_0x1dbfe0(_0x4358a8[_0x134e('0x16')][_0x134e('0x15')]);}})[_0x134e('0x17')](function(_0x19436a){logger['error'](_0x134e('0xf'),_0x3cdcac,_0x19436a);_0x56f1a1(_0x19436a);});});} \ No newline at end of file +var _0xb4df=['request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x434639,_0x2e40f0){var _0x228798=function(_0x2ed31c){while(--_0x2ed31c){_0x434639['push'](_0x434639['shift']());}};_0x228798(++_0x2e40f0);}(_0xb4df,0x64));var _0xfb4d=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb4df[_0x24259d];return _0x5a701;};'use strict';var _=require('lodash');var util=require(_0xfb4d('0x0'));var moment=require(_0xfb4d('0x1'));var BPromise=require(_0xfb4d('0x2'));var rs=require(_0xfb4d('0x3'));var fs=require('fs');var Redis=require(_0xfb4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb4d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb4d('0x6'));var jayson=require(_0xfb4d('0x7'));var client=jayson[_0xfb4d('0x8')][_0xfb4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x282b85,_0x4b8f92,_0x1ba64b){return new BPromise(function(_0x4f32fd,_0x4f9491){return client[_0xfb4d('0xa')](_0x282b85,_0x1ba64b)[_0xfb4d('0xb')](function(_0x4ec777){logger[_0xfb4d('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4b8f92,_0xfb4d('0xd'));logger[_0xfb4d('0xe')](_0xfb4d('0xf'),_0x4b8f92,_0xfb4d('0xd'),JSON[_0xfb4d('0x10')](_0x4ec777));if(_0x4ec777[_0xfb4d('0x11')]){if(_0x4ec777[_0xfb4d('0x11')][_0xfb4d('0x12')]===0x1f4){logger[_0xfb4d('0x11')](_0xfb4d('0x13'),_0x4b8f92,_0x4ec777['error']['message']);return _0x4f9491(_0x4ec777[_0xfb4d('0x11')][_0xfb4d('0x14')]);}logger[_0xfb4d('0x11')](_0xfb4d('0x13'),_0x4b8f92,_0x4ec777[_0xfb4d('0x11')][_0xfb4d('0x14')]);return _0x4f32fd(_0x4ec777[_0xfb4d('0x11')][_0xfb4d('0x14')]);}else{logger['info'](_0xfb4d('0x13'),_0x4b8f92,_0xfb4d('0xd'));_0x4f32fd(_0x4ec777[_0xfb4d('0x15')][_0xfb4d('0x14')]);}})['catch'](function(_0xdc68d6){logger[_0xfb4d('0x11')](_0xfb4d('0x13'),_0x4b8f92,_0xdc68d6);_0x4f9491(_0xdc68d6);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 337d42e..9ed074b 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81c4=['Offline\x20apps:','filter','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','then','info','start','Online\x20apps:','map','online','join'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x81c4,0x91));var _0x481c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81c4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var mysqldb=require(_0x481c('0x0'));var rpc=require(_0x481c('0x1'));var config=require(_0x481c('0x2'));var logger=require(_0x481c('0x3'))(_0x481c('0x4'));var pm2=require(_0x481c('0x5'));var pm2Config=require(_0x481c('0x6'));var schedule=require('./config/schedule');var chat=require(_0x481c('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x481c('0x8'));function main(){return mysqldb['db'][_0x481c('0x9')]['sync']()[_0x481c('0xa')](function(){return rpc['listen']();})[_0x481c('0xa')](function(_0x10c9a9){logger[_0x481c('0xb')](_0x10c9a9);return chat[_0x481c('0xc')]();})[_0x481c('0xa')](function(){return whatsapp['start']();})[_0x481c('0xa')](function(){return schedule['start']();})[_0x481c('0xa')](function(){return transcribe[_0x481c('0xc')]();})['then'](function(_0x134602){logger[_0x481c('0xb')](_0x134602);return pm2[_0x481c('0xc')](pm2Config);})['then'](function(_0x581a13){logger[_0x481c('0xb')](_0x481c('0xd'),_[_0x481c('0xe')](_['filter'](_0x581a13,{'status':_0x481c('0xf')}),'name')[_0x481c('0x10')]());logger['info'](_0x481c('0x11'),_[_0x481c('0xe')](_[_0x481c('0x12')](_0x581a13,function(_0x4c02d4){return _0x4c02d4['status']!==_0x481c('0xf');}),'name')['join']()||_0x481c('0x13'));config[_0x481c('0x14')]&&require(_0x481c('0x15'))[_0x481c('0x16')]();require(_0x481c('0x17'))[_0x481c('0x16')]();})[_0x481c('0x18')](function(_0x140244){logger[_0x481c('0x19')](_0x481c('0x1a'),_0x140244);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x94f9=['then','listen','start','info','Online\x20apps:','filter','online','name','Offline\x20apps:','map','status','join','None','seedDB','default','catch','exit','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','sync'];(function(_0x571f7c,_0x450489){var _0x374a19=function(_0x5ddfdf){while(--_0x5ddfdf){_0x571f7c['push'](_0x571f7c['shift']());}};_0x374a19(++_0x450489);}(_0x94f9,0x1c1));var _0x994f=function(_0xfb19ff,_0x1a17c2){_0xfb19ff=_0xfb19ff-0x0;var _0x3c8900=_0x94f9[_0xfb19ff];return _0x3c8900;};'use strict';var _=require(_0x994f('0x0'));var mysqldb=require(_0x994f('0x1'));var rpc=require(_0x994f('0x2'));var config=require('./config/environment');var logger=require(_0x994f('0x3'))(_0x994f('0x4'));var pm2=require(_0x994f('0x5'));var pm2Config=require(_0x994f('0x6'));var schedule=require(_0x994f('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x994f('0x8')][_0x994f('0x9')]()[_0x994f('0xa')](function(){return rpc[_0x994f('0xb')]();})['then'](function(_0x12564c){logger['info'](_0x12564c);return chat[_0x994f('0xc')]();})[_0x994f('0xa')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x994f('0xc')]();})[_0x994f('0xa')](function(){return transcribe[_0x994f('0xc')]();})['then'](function(_0x33be8f){logger['info'](_0x33be8f);return pm2[_0x994f('0xc')](pm2Config);})['then'](function(_0x3d4dab){logger[_0x994f('0xd')](_0x994f('0xe'),_['map'](_[_0x994f('0xf')](_0x3d4dab,{'status':_0x994f('0x10')}),_0x994f('0x11'))['join']());logger['info'](_0x994f('0x12'),_[_0x994f('0x13')](_[_0x994f('0xf')](_0x3d4dab,function(_0x118ee5){return _0x118ee5[_0x994f('0x14')]!==_0x994f('0x10');}),'name')[_0x994f('0x15')]()||_0x994f('0x16'));config[_0x994f('0x17')]&&require('./config/seedDB')[_0x994f('0x18')]();require('./config/license')[_0x994f('0x18')]();})[_0x994f('0x19')](function(_0x377772){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x377772);process[_0x994f('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index dfeef4e..1641922 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 _0x7c62=['startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','session','payload','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','fullname','internal','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','Basic','User','find','pass','Wrong\x20credentials.','catch'];(function(_0x10b799,_0x5b0289){var _0x5368c9=function(_0x143d82){while(--_0x143d82){_0x10b799['push'](_0x10b799['shift']());}};_0x5368c9(++_0x5b0289);}(_0x7c62,0xb5));var _0x27c6=function(_0x52592f,_0x48d73d){_0x52592f=_0x52592f-0x0;var _0x2d9f1a=_0x7c62[_0x52592f];return _0x2d9f1a;};'use strict';var db=require(_0x27c6('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x27c6('0x1'));var encryptor=require(_0x27c6('0x2'));var _=require(_0x27c6('0x3'));var jwt=require(_0x27c6('0x4'));var expressJwt=require(_0x27c6('0x5'));var compose=require(_0x27c6('0x6'));var basicAuth=require(_0x27c6('0x7'));var crypto=require(_0x27c6('0x8'));var BPromise=require(_0x27c6('0x9'));var util=require(_0x27c6('0xa'));var moment=require(_0x27c6('0xb'));var validateJwt=expressJwt({'secret':config[_0x27c6('0xc')]['session']});var userAttributes=['id','role',_0x27c6('0xd'),'name',_0x27c6('0xe'),'email','userpic',_0x27c6('0xf'),_0x27c6('0x10'),_0x27c6('0x11'),_0x27c6('0x12'),_0x27c6('0x13'),_0x27c6('0x14'),_0x27c6('0x15'),'openchannelPause',_0x27c6('0x16'),_0x27c6('0x17'),_0x27c6('0x18'),_0x27c6('0x19'),'crudPermissions','allowmessenger',_0x27c6('0x1a'),'alias',_0x27c6('0x1b'),_0x27c6('0x1c'),_0x27c6('0x1d'),'phoneBarEnableRecording',_0x27c6('0x1e'),'phoneBarEnableSettings',_0x27c6('0x1f'),_0x27c6('0x20'),_0x27c6('0x21'),_0x27c6('0x22'),'hotdesk','interface',_0x27c6('0x23'),_0x27c6('0x24'),_0x27c6('0x25'),_0x27c6('0x26'),_0x27c6('0x27'),_0x27c6('0x28'),_0x27c6('0x29')];exports[_0x27c6('0x2a')]=function(){return this['isAuthenticated'](!![])[_0x27c6('0x2b')](function(_0x4aed5d,_0x26f8a5,_0x5bc456){if(_0x4aed5d[_0x27c6('0x2c')]){_0x5bc456();}else{return db[_0x27c6('0x2d')][_0x27c6('0x2e')]({'where':{'id':_0x4aed5d[_0x27c6('0x2f')]['id']},'attributes':['id',_0x27c6('0x30'),_0x27c6('0x31')],'raw':!![]})[_0x27c6('0x32')](function(_0xaebc9d){if(_0xaebc9d&&_0xaebc9d[_0x27c6('0x30')]){return _0x26f8a5[_0x27c6('0x33')](_0xaebc9d[_0x27c6('0x31')]==='unmanaged'?0x195:0x193)[_0x27c6('0x34')]({'message':_0xaebc9d['disposition']===_0x27c6('0x35')?_0x27c6('0x36'):_0x27c6('0x37')});}else{_0x5bc456();}})['catch'](function(_0x5c5440){_0x5bc456(_0x5c5440);});}});};exports[_0x27c6('0x38')]=function isAuthenticated(_0x4fe8ca){return compose()[_0x27c6('0x2b')](function(_0x23df5d,_0x200d2b,_0x1713d3){var _0x597379;if(_0x23df5d[_0x27c6('0x39')][_0x27c6('0x3a')]){if(_['startsWith'](_0x23df5d['headers'][_0x27c6('0x3a')],_0x27c6('0x3b'))){var _0x1a5625=basicAuth(_0x23df5d);db[_0x27c6('0x3c')][_0x27c6('0x3d')]({'where':{'name':_0x1a5625['name']}})[_0x27c6('0x32')](function(_0x4c8ed6){if(!_0x4c8ed6||!_0x4c8ed6['authenticate'](_0x1a5625[_0x27c6('0x3e')])){return _0x200d2b['status'](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x3f')});}_0x23df5d[_0x27c6('0x2c')]={'id':_0x4c8ed6['id']};_0x1713d3();})[_0x27c6('0x40')](function(_0x4856b4){_0x1713d3(_0x4856b4);});}else if(_[_0x27c6('0x41')](_0x23df5d[_0x27c6('0x39')][_0x27c6('0x3a')],_0x27c6('0x42'))){validateJwt(_0x23df5d,_0x200d2b,_0x1713d3);}else{if(_0x4fe8ca){_0x1713d3();}else{return _0x200d2b[_0x27c6('0x33')](0x193)[_0x27c6('0x34')]({'message':_0x27c6('0x43')});}}}else if(_0x23df5d[_0x27c6('0x44')]['apikey']){try{var _0x13571f={'audience':hardwareConf[_0x27c6('0x45')](),'issuer':hardwareConf[_0x27c6('0x45')]()};verifyJwt(_0x23df5d['query'][_0x27c6('0x46')],_0x13571f)[_0x27c6('0x32')](function(_0x2998d2){return db[_0x27c6('0x3c')][_0x27c6('0x3d')]({'where':{'id':_0x2998d2['sub']}})[_0x27c6('0x32')](function(_0x343593){_0x597379=_0x343593;return db[_0x27c6('0x47')]['findOne']({'where':{'id':0x1},'attributes':[_0x27c6('0x48'),_0x27c6('0x49')],'raw':!![]});})[_0x27c6('0x32')](function(_0x327b4c){if(!_0x597379||!_[_0x27c6('0x4a')](_0x597379[_0x27c6('0x4b')],_0x2998d2['nonce'])){return _0x200d2b[_0x27c6('0x33')](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4c')});}if(_0x597379[_0x27c6('0x4d')]){return _0x200d2b['status'](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4e')});}if(_0x597379[_0x27c6('0x4f')]){if(_0x327b4c[_0x27c6('0x49')]>0x0){if(moment(_0x597379[_0x27c6('0x50')])[_0x27c6('0x51')](_0x327b4c[_0x27c6('0x49')],_0x27c6('0x52'))>moment()){return _0x200d2b['status'](0x191)['json']({'message':_0x27c6('0x4e')});}}else{return _0x200d2b[_0x27c6('0x33')](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4e')});}}_0x23df5d[_0x27c6('0x2c')]={'id':_0x597379['id']};_0x1713d3();});})[_0x27c6('0x40')](function(){return _0x200d2b[_0x27c6('0x33')](0x191)[_0x27c6('0x34')]({'message':_0x27c6('0x4e')});});}catch(_0x3fdeba){_0x1713d3(_0x3fdeba);}}else if(_0x4fe8ca){_0x1713d3();}else{return _0x200d2b[_0x27c6('0x33')](0x193)['json']({'message':_0x27c6('0x43')});}})[_0x27c6('0x2b')](function(_0x1f5293,_0xb071d6,_0x3e2189){if(_0x1f5293['user']){db[_0x27c6('0x3c')][_0x27c6('0x3d')]({'where':{'id':_0x1f5293[_0x27c6('0x2c')]['id']},'attributes':userAttributes})[_0x27c6('0x32')](function(_0x199d10){if(!_0x199d10){return _0xb071d6['status'](0x194)[_0x27c6('0x34')]({'message':'User\x20not\x20found.'});}_0x1f5293['user']=_0x199d10;_0x3e2189();})['catch'](function(_0x56ed26){_0x3e2189(_0x56ed26);});}else if(_0x4fe8ca){_0x3e2189();}else{return _0xb071d6[_0x27c6('0x33')](0x194)[_0x27c6('0x34')]({'message':_0x27c6('0x53')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x27c6('0x2b')](function(_0x34de41,_0x1e0622,_0xb6bb4c){return licenseUtil[_0x27c6('0x54')]()['then'](function(_0x2593b1){if(_0x2593b1[_0x27c6('0x55')]){_0xb6bb4c();}else{return _0x1e0622[_0x27c6('0x33')](0x193)[_0x27c6('0x34')]({'message':_0x27c6('0x56')});}})[_0x27c6('0x40')](function(_0x560c20){_0xb6bb4c(_0x560c20);});});};exports[_0x27c6('0x57')]=function(_0x1b5c5e,_0x2b6ba4,_0x4688fa){_0x1b5c5e['isMiddleware']=!![];return _0x4688fa();};exports[_0x27c6('0x58')]=function signToken(_0x2d4adb){return signJwt(_0x2d4adb);};exports[_0x27c6('0x59')]=function(_0x127e50,_0xb6ce72){if(!_0x127e50[_0x27c6('0x2c')]){return _0xb6ce72['status'](0x194)[_0x27c6('0x34')]({'message':_0x27c6('0x5a')});}var _0xc69384={'payload':{'id':_0x127e50[_0x27c6('0x2c')]['id'],'role':_0x127e50['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xc69384)[_0x27c6('0x32')](function(_0x51a7b1){_0xb6ce72['cookie']('motion.token',_0x51a7b1);_0xb6ce72[_0x27c6('0x5b')](_0x27c6('0x5c'));})[_0x27c6('0x40')](function(_0x430a57){return _0xb6ce72[_0x27c6('0x33')](0x1f4)[_0x27c6('0x5d')](_0x430a57);});};exports['retrieveApiKey']=function(_0x4d9b89){if(_[_0x27c6('0x5e')](_0x4d9b89[_0x27c6('0x4b')])||_[_0x27c6('0x5e')](_0x4d9b89['apiKeyIat'])){return null;}else{return createJwt(_0x4d9b89);}};exports[_0x27c6('0x5f')]=function(_0x2e1e81){_0x2e1e81[_0x27c6('0x4b')]=generateNonce();_0x2e1e81[_0x27c6('0x60')]=generateIssuedAt();return createJwt(_0x2e1e81);};exports[_0x27c6('0x61')]=function(_0x3cce5d,_0x465a06){var _0x29b597=_0x3cce5d[_0x27c6('0x44')][_0x27c6('0x46')];if(_0x29b597){var _0x23ca67={'nonce':_0x465a06[_0x27c6('0x4b')],'iat':_0x465a06['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x29b597,_0x23ca67)['then'](function(){return generateApiKey(_0x465a06);});}else{throw{'message':_0x27c6('0x62')};}};exports[_0x27c6('0x63')]=function(_0x595210){var _0x2d5b31=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2d5b31['test'](_0x595210))throw new db[(_0x27c6('0x64'))][(_0x27c6('0x65'))](_0x27c6('0x66'));return;};exports[_0x27c6('0x67')]=function(_0x4a4898,_0x3f1049,_0x7fa23d){var _0x2fbd55=encryptor[_0x27c6('0x68')](_0x3f1049)[_0x27c6('0x69')](',');for(var _0x3b9bf4=0x0;_0x3b9bf4<_0x7fa23d;_0x3b9bf4++){if(!_0x2fbd55[_0x3b9bf4])break;if(_0x4a4898[_0x27c6('0x6a')]()===_0x2fbd55[_0x3b9bf4][_0x27c6('0x6a')]()){var _0x3ce703=util[_0x27c6('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x7fa23d);if(_0x7fa23d===0x1){_0x3ce703=_0x27c6('0x6c');}throw new db['Sequelize'][(_0x27c6('0x65'))](_0x3ce703);}}return;};exports[_0x27c6('0x6d')]=function(_0x1c7d76,_0x183ab3){var _0x75a79a=_0x183ab3?encryptor['decryptString'](_0x183ab3)[_0x27c6('0x69')](','):[];if(_0x75a79a[_0x27c6('0x6e')]===0x5){_0x75a79a['splice'](-0x1,0x1);}_0x75a79a[_0x27c6('0x6f')](_0x1c7d76);return encryptor[_0x27c6('0x70')](_0x75a79a[_0x27c6('0x71')](','));};function signJwt(_0x471e59){var _0x1b2929=BPromise['promisify'](jwt[_0x27c6('0x72')],{'context':jwt});var _0x3df3fd=_0x471e59['secret']||config[_0x27c6('0xc')][_0x27c6('0x73')];return new BPromise(function(_0x102caf,_0x5d2f47){_0x1b2929(_0x471e59[_0x27c6('0x74')],_0x3df3fd,_0x471e59['options'])[_0x27c6('0x32')](function(_0x272f28){_0x102caf(_0x272f28);})[_0x27c6('0x40')](function(_0x1f0d2f){_0x5d2f47(_0x1f0d2f);});});}function verifyJwt(_0x2ab86e,_0x1480e0,_0x4bffa7){var _0x19e494=BPromise['promisify'](jwt[_0x27c6('0x75')],{'context':jwt});var _0xc541f9=_0x4bffa7||config['secrets'][_0x27c6('0x73')];return new BPromise(function(_0x139942,_0x583de2){_0x19e494(_0x2ab86e,_0xc541f9,_0x1480e0)[_0x27c6('0x32')](function(_0x808cf4){_0x139942(_0x808cf4);})[_0x27c6('0x40')](function(_0x439836){_0x583de2(_0x439836);});});}function generateNonce(){return crypto[_0x27c6('0x76')](0x10)[_0x27c6('0x77')](_0x27c6('0x78'));}function generateIssuedAt(){return Math[_0x27c6('0x79')](Date['now']()/0x3e8)[_0x27c6('0x77')]();}function createJwt(_0x23b7e8){var _0x1e9680={'payload':{'iat':_0x23b7e8['apiKeyIat'],'nonce':_0x23b7e8['apiKeyNonce']},'options':{'algorithm':_0x27c6('0x7a'),'subject':_0x23b7e8['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x27c6('0x45')]()}};return signJwt(_0x1e9680)[_0x27c6('0x32')](function(_0x40ec8e){return{'iat':_0x23b7e8[_0x27c6('0x60')],'nonce':_0x23b7e8[_0x27c6('0x4b')],'token':_0x40ec8e};});} \ No newline at end of file +var _0xe2f8=['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.','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','now','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session','role','fullname','name','internal','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','find','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','User','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','validatePasswordHistory','decryptString'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xe2f8,0x10f));var _0x8e2f=function(_0x16295f,_0x263e7d){_0x16295f=_0x16295f-0x0;var _0x29e074=_0xe2f8[_0x16295f];return _0x29e074;};'use strict';var db=require(_0x8e2f('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x8e2f('0x1'));var licenseUtil=require(_0x8e2f('0x2'));var encryptor=require(_0x8e2f('0x3'));var _=require(_0x8e2f('0x4'));var jwt=require(_0x8e2f('0x5'));var expressJwt=require(_0x8e2f('0x6'));var compose=require(_0x8e2f('0x7'));var basicAuth=require(_0x8e2f('0x8'));var crypto=require('crypto');var BPromise=require(_0x8e2f('0x9'));var util=require(_0x8e2f('0xa'));var moment=require(_0x8e2f('0xb'));var validateJwt=expressJwt({'secret':config[_0x8e2f('0xc')][_0x8e2f('0xd')]});var userAttributes=['id',_0x8e2f('0xe'),_0x8e2f('0xf'),_0x8e2f('0x10'),_0x8e2f('0x11'),'email','userpic','permissions','md5secret',_0x8e2f('0x12'),_0x8e2f('0x13'),_0x8e2f('0x14'),_0x8e2f('0x15'),_0x8e2f('0x16'),_0x8e2f('0x17'),_0x8e2f('0x18'),_0x8e2f('0x19'),_0x8e2f('0x1a'),_0x8e2f('0x1b'),_0x8e2f('0x1c'),_0x8e2f('0x1d'),'passwordResetAt','alias',_0x8e2f('0x1e'),_0x8e2f('0x1f'),_0x8e2f('0x20'),_0x8e2f('0x21'),_0x8e2f('0x22'),'phoneBarEnableSettings',_0x8e2f('0x23'),_0x8e2f('0x24'),_0x8e2f('0x25'),_0x8e2f('0x26'),'hotdesk',_0x8e2f('0x27'),_0x8e2f('0x28'),_0x8e2f('0x29'),_0x8e2f('0x2a'),_0x8e2f('0x2b'),_0x8e2f('0x2c'),_0x8e2f('0x2d'),_0x8e2f('0x2e')];exports['isChatInteractionAuthorized']=function(){return this[_0x8e2f('0x2f')](!![])[_0x8e2f('0x30')](function(_0x6531a,_0x4a717c,_0xda7ffa){if(_0x6531a[_0x8e2f('0x31')]){_0xda7ffa();}else{return db[_0x8e2f('0x32')][_0x8e2f('0x33')]({'where':{'id':_0x6531a[_0x8e2f('0x34')]['id']},'attributes':['id',_0x8e2f('0x35'),_0x8e2f('0x36')],'raw':!![]})[_0x8e2f('0x37')](function(_0x2bce30){if(_0x2bce30&&_0x2bce30[_0x8e2f('0x35')]){return _0x4a717c[_0x8e2f('0x38')](_0x2bce30[_0x8e2f('0x36')]===_0x8e2f('0x39')?0x195:0x193)[_0x8e2f('0x3a')]({'message':_0x2bce30[_0x8e2f('0x36')]===_0x8e2f('0x39')?'Unmanaged.':_0x8e2f('0x3b')});}else{_0xda7ffa();}})[_0x8e2f('0x3c')](function(_0x44a919){_0xda7ffa(_0x44a919);});}});};exports['isAuthenticated']=function isAuthenticated(_0x2f8206){return compose()['use'](function(_0x4ec16f,_0xb6bdbb,_0x379002){var _0x1d71d8;if(_0x4ec16f[_0x8e2f('0x3d')][_0x8e2f('0x3e')]){if(_[_0x8e2f('0x3f')](_0x4ec16f[_0x8e2f('0x3d')]['authorization'],'Basic')){var _0x2d1ad0=basicAuth(_0x4ec16f);db['User'][_0x8e2f('0x40')]({'where':{'name':_0x2d1ad0[_0x8e2f('0x10')]}})[_0x8e2f('0x37')](function(_0x177156){if(!_0x177156||!_0x177156['authenticate'](_0x2d1ad0[_0x8e2f('0x41')])){return _0xb6bdbb[_0x8e2f('0x38')](0x191)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x42')});}_0x4ec16f[_0x8e2f('0x31')]={'id':_0x177156['id']};_0x379002();})['catch'](function(_0x19d641){_0x379002(_0x19d641);});}else if(_[_0x8e2f('0x3f')](_0x4ec16f[_0x8e2f('0x3d')][_0x8e2f('0x3e')],_0x8e2f('0x43'))){validateJwt(_0x4ec16f,_0xb6bdbb,_0x379002);}else{if(_0x2f8206){_0x379002();}else{return _0xb6bdbb[_0x8e2f('0x38')](0x193)['json']({'message':_0x8e2f('0x44')});}}}else if(_0x4ec16f['query']['apikey']){try{var _0x425fe1={'audience':hardwareConf[_0x8e2f('0x45')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x4ec16f[_0x8e2f('0x46')][_0x8e2f('0x47')],_0x425fe1)[_0x8e2f('0x37')](function(_0x161f2d){return db[_0x8e2f('0x48')][_0x8e2f('0x40')]({'where':{'id':_0x161f2d[_0x8e2f('0x49')]}})[_0x8e2f('0x37')](function(_0x1cc044){_0x1d71d8=_0x1cc044;return db[_0x8e2f('0x4a')][_0x8e2f('0x33')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8e2f('0x4b')],'raw':!![]});})[_0x8e2f('0x37')](function(_0x7ae463){if(!_0x1d71d8||!_[_0x8e2f('0x4c')](_0x1d71d8[_0x8e2f('0x4d')],_0x161f2d[_0x8e2f('0x4e')])){return _0xb6bdbb['status'](0x191)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x4f')});}if(_0x1d71d8['disabled']){return _0xb6bdbb[_0x8e2f('0x38')](0x191)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x50')});}if(_0x1d71d8[_0x8e2f('0x51')]){if(_0x7ae463[_0x8e2f('0x4b')]>0x0){if(moment(_0x1d71d8[_0x8e2f('0x52')])[_0x8e2f('0x53')](_0x7ae463[_0x8e2f('0x4b')],_0x8e2f('0x54'))>moment()){return _0xb6bdbb['status'](0x191)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x50')});}}else{return _0xb6bdbb[_0x8e2f('0x38')](0x191)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x50')});}}_0x4ec16f[_0x8e2f('0x31')]={'id':_0x1d71d8['id']};_0x379002();});})[_0x8e2f('0x3c')](function(){return _0xb6bdbb['status'](0x191)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x50')});});}catch(_0x1361b4){_0x379002(_0x1361b4);}}else if(_0x2f8206){_0x379002();}else{return _0xb6bdbb['status'](0x193)[_0x8e2f('0x3a')]({'message':'Unknown\x20authorization\x20format'});}})[_0x8e2f('0x30')](function(_0x4b0f8f,_0x5de502,_0x3179ff){if(_0x4b0f8f[_0x8e2f('0x31')]){db[_0x8e2f('0x48')][_0x8e2f('0x40')]({'where':{'id':_0x4b0f8f['user']['id']},'attributes':userAttributes})[_0x8e2f('0x37')](function(_0x4ecc49){if(!_0x4ecc49){return _0x5de502[_0x8e2f('0x38')](0x194)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x55')});}_0x4b0f8f[_0x8e2f('0x31')]=_0x4ecc49;_0x3179ff();})[_0x8e2f('0x3c')](function(_0x32a2a4){_0x3179ff(_0x32a2a4);});}else if(_0x2f8206){_0x3179ff();}else{return _0x5de502['status'](0x194)['json']({'message':_0x8e2f('0x56')});}});};exports[_0x8e2f('0x57')]=function canUpdate(){return compose()[_0x8e2f('0x30')](function(_0x9d3c4e,_0x221adb,_0x167a25){return licenseUtil[_0x8e2f('0x58')]()[_0x8e2f('0x37')](function(_0x37d88d){if(_0x37d88d['update']){_0x167a25();}else{return _0x221adb[_0x8e2f('0x38')](0x193)[_0x8e2f('0x3a')]({'message':_0x8e2f('0x59')});}})[_0x8e2f('0x3c')](function(_0x4ee181){_0x167a25(_0x4ee181);});});};exports['isMiddleware']=function(_0x71c561,_0x31dc3f,_0x2e2897){_0x71c561[_0x8e2f('0x5a')]=!![];return _0x2e2897();};exports[_0x8e2f('0x5b')]=function signToken(_0x37fc50){return signJwt(_0x37fc50);};exports['setTokenCookie']=function(_0xb78ed5,_0x2634bc){if(!_0xb78ed5[_0x8e2f('0x31')]){return _0x2634bc[_0x8e2f('0x38')](0x194)['json']({'message':_0x8e2f('0x5c')});}var _0x14364a={'payload':{'id':_0xb78ed5[_0x8e2f('0x31')]['id'],'role':_0xb78ed5[_0x8e2f('0x31')][_0x8e2f('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x14364a)[_0x8e2f('0x37')](function(_0x3043f9){_0x2634bc[_0x8e2f('0x5d')](_0x8e2f('0x5e'),_0x3043f9);_0x2634bc[_0x8e2f('0x5f')]('/dashboards/general');})[_0x8e2f('0x3c')](function(_0x571152){return _0x2634bc[_0x8e2f('0x38')](0x1f4)[_0x8e2f('0x60')](_0x571152);});};exports[_0x8e2f('0x61')]=function(_0x1a1cdd){if(_[_0x8e2f('0x62')](_0x1a1cdd[_0x8e2f('0x4d')])||_[_0x8e2f('0x62')](_0x1a1cdd[_0x8e2f('0x63')])){return null;}else{return createJwt(_0x1a1cdd);}};exports['generateApiKey']=function(_0x55f207){_0x55f207[_0x8e2f('0x4d')]=generateNonce();_0x55f207['apiKeyIat']=generateIssuedAt();return createJwt(_0x55f207);};exports['regenerateApiKey']=function(_0x24db8e,_0x1bd444){var _0x3ccdb5=_0x24db8e[_0x8e2f('0x46')]['apikey'];if(_0x3ccdb5){var _0xff831c={'nonce':_0x1bd444[_0x8e2f('0x4d')],'iat':_0x1bd444['apiKeyIat'],'audience':hardwareConf[_0x8e2f('0x45')](),'issuer':hardwareConf[_0x8e2f('0x45')]()};return verifyJwt(_0x3ccdb5,_0xff831c)[_0x8e2f('0x37')](function(){return generateApiKey(_0x1bd444);});}else{throw{'message':_0x8e2f('0x64')};}};exports['validatePasswordPattern']=function(_0x1bd960){var _0xbfb27a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xbfb27a['test'](_0x1bd960))throw new db[(_0x8e2f('0x65'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x8e2f('0x66')]=function(_0x2854d7,_0x4f7c76,_0x212b40){var _0x162daa=encryptor[_0x8e2f('0x67')](_0x4f7c76)[_0x8e2f('0x68')](',');for(var _0xab6a24=0x0;_0xab6a24<_0x212b40;_0xab6a24++){if(!_0x162daa[_0xab6a24])break;if(_0x2854d7[_0x8e2f('0x69')]()===_0x162daa[_0xab6a24][_0x8e2f('0x69')]()){var _0x263d14=util[_0x8e2f('0x6a')](_0x8e2f('0x6b'),_0x212b40);if(_0x212b40===0x1){_0x263d14=_0x8e2f('0x6c');}throw new db[(_0x8e2f('0x65'))][(_0x8e2f('0x6d'))](_0x263d14);}}return;};exports[_0x8e2f('0x6e')]=function(_0x5e98c5,_0x205c31){var _0xcd61e2=_0x205c31?encryptor['decryptString'](_0x205c31)[_0x8e2f('0x68')](','):[];if(_0xcd61e2[_0x8e2f('0x6f')]===0x5){_0xcd61e2[_0x8e2f('0x70')](-0x1,0x1);}_0xcd61e2[_0x8e2f('0x71')](_0x5e98c5);return encryptor[_0x8e2f('0x72')](_0xcd61e2[_0x8e2f('0x73')](','));};function signJwt(_0x4dce66){var _0x26d8c3=BPromise[_0x8e2f('0x74')](jwt[_0x8e2f('0x75')],{'context':jwt});var _0x2f49bb=_0x4dce66[_0x8e2f('0x76')]||config[_0x8e2f('0xc')][_0x8e2f('0xd')];return new BPromise(function(_0x98cd0e,_0x40ce38){_0x26d8c3(_0x4dce66['payload'],_0x2f49bb,_0x4dce66[_0x8e2f('0x77')])[_0x8e2f('0x37')](function(_0x36ed37){_0x98cd0e(_0x36ed37);})['catch'](function(_0x9aedbf){_0x40ce38(_0x9aedbf);});});}function verifyJwt(_0xc00a16,_0x3add41,_0x401d23){var _0x19f508=BPromise['promisify'](jwt[_0x8e2f('0x78')],{'context':jwt});var _0x1e24d9=_0x401d23||config[_0x8e2f('0xc')][_0x8e2f('0xd')];return new BPromise(function(_0x201b79,_0xd7fea2){_0x19f508(_0xc00a16,_0x1e24d9,_0x3add41)['then'](function(_0x152466){_0x201b79(_0x152466);})['catch'](function(_0x47d100){_0xd7fea2(_0x47d100);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x8e2f('0x79')](_0x8e2f('0x7a'));}function generateIssuedAt(){return Math[_0x8e2f('0x7b')](Date[_0x8e2f('0x7c')]()/0x3e8)[_0x8e2f('0x79')]();}function createJwt(_0x111a79){var _0x28ad7b={'payload':{'iat':_0x111a79['apiKeyIat'],'nonce':_0x111a79[_0x8e2f('0x4d')]},'options':{'algorithm':'HS512','subject':_0x111a79['id'][_0x8e2f('0x79')](),'issuer':hardwareConf[_0x8e2f('0x45')](),'audience':hardwareConf[_0x8e2f('0x45')]()}};return signJwt(_0x28ad7b)[_0x8e2f('0x37')](function(_0x2166fe){return{'iat':_0x111a79[_0x8e2f('0x63')],'nonce':_0x111a79[_0x8e2f('0x4d')],'token':_0x2166fe};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 7114c97..43f8e82 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 _0xaeb2=['write','final','binary','end','close','createReadStream','createWriteStream','createDecipher','encryptString','utf8','base64','decryptString','secret','crypto','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','createCipher','data','update'];(function(_0x4d938c,_0x957d2e){var _0x245628=function(_0x439b57){while(--_0x439b57){_0x4d938c['push'](_0x4d938c['shift']());}};_0x245628(++_0x957d2e);}(_0xaeb2,0x16d));var _0x2aeb=function(_0x5a3234,_0x520408){_0x5a3234=_0x5a3234-0x0;var _0x359190=_0xaeb2[_0x5a3234];return _0x359190;};'use strict';var crypto=require(_0x2aeb('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x2aeb('0x1'));var config=require(_0x2aeb('0x2'));var logger=require(_0x2aeb('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2aeb('0x4')][_0x2aeb('0x5')],'algorithm':_0x2aeb('0x6')};const fileOptions={'algorithm':_0x2aeb('0x7')};if(config[_0x2aeb('0x8')]&&config[_0x2aeb('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x2aeb('0x8')]['algorithm']);if(isSupported){fileOptions[_0x2aeb('0x9')]=config[_0x2aeb('0x8')][_0x2aeb('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x2aeb('0xa')](config[_0x2aeb('0x8')][_0x2aeb('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0xb4643){return AES_SUPPORTED_RX[_0x2aeb('0xb')](_0xb4643);}function getSupportedCiphers(){return crypto[_0x2aeb('0xc')]()[_0x2aeb('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x11b39f){return getSupportedCiphers()[_0x2aeb('0xe')](_0x11b39f)>-0x1;}function combineOptions(_0x4158b3){var _0x24e18d={};for(var _0x892009 in fileOptions){if(fileOptions[_0x2aeb('0xf')](_0x892009)){_0x24e18d[_0x892009]=fileOptions[_0x892009];}}if(_0x4158b3){for(var _0x193580 in _0x4158b3){if(_0x4158b3[_0x2aeb('0xf')](_0x193580)){_0x24e18d[_0x193580]=_0x4158b3[_0x193580];}}}return _0x24e18d;}exports['encryptFile']=function(_0x51c486,_0x1ea251,_0x4c2aff,_0x4f4c27){return new BPromise(function(_0x4c9b35,_0x20ba43){_0x4f4c27=combineOptions(_0x4f4c27);var _0x2bc4f0=new Buffer(_0x4c2aff);var _0x25aac9=fs['createReadStream'](_0x51c486);var _0x4954de=fs['createWriteStream'](_0x1ea251);var _0xb923d7=crypto[_0x2aeb('0x10')](_0x4f4c27[_0x2aeb('0x9')],_0x2bc4f0);_0x25aac9['on'](_0x2aeb('0x11'),function(_0x510175){var _0x255c52=new Buffer(_0xb923d7[_0x2aeb('0x12')](_0x510175),'binary');_0x4954de[_0x2aeb('0x13')](_0x255c52);});_0x25aac9['on']('end',function(){try{var _0x50fcb9=new Buffer(_0xb923d7[_0x2aeb('0x14')](_0x2aeb('0x15')),_0x2aeb('0x15'));_0x4954de['write'](_0x50fcb9);_0x4954de[_0x2aeb('0x16')]();_0x4954de['on'](_0x2aeb('0x17'),function(){return _0x4c9b35(_0x1ea251);});}catch(_0x2a525f){fs['unlink'](_0x1ea251);return _0x20ba43(_0x2a525f);}});});};exports['decryptFile']=function(_0x552741,_0x1ce9c2,_0x27d3e7,_0x351764){return new BPromise(function(_0x579d89,_0x1259b4){_0x351764=combineOptions(_0x351764);var _0x37229f=new Buffer(_0x27d3e7);var _0x20fa89=fs[_0x2aeb('0x18')](_0x552741);var _0x2b15e0=fs[_0x2aeb('0x19')](_0x1ce9c2);var _0xd92b3f=crypto[_0x2aeb('0x1a')](_0x351764[_0x2aeb('0x9')],_0x37229f);_0x20fa89['on'](_0x2aeb('0x11'),function(_0x203382){var _0x5917f7=new Buffer(_0xd92b3f[_0x2aeb('0x12')](_0x203382),'binary');_0x2b15e0[_0x2aeb('0x13')](_0x5917f7);});_0x20fa89['on']('end',function(){try{var _0x5b5a13=new Buffer(_0xd92b3f['final']('binary'),_0x2aeb('0x15'));_0x2b15e0[_0x2aeb('0x13')](_0x5b5a13);_0x2b15e0[_0x2aeb('0x16')]();_0x2b15e0['on'](_0x2aeb('0x17'),function(){return _0x579d89(_0x1ce9c2);});}catch(_0x35cf3f){fs['unlink'](_0x1ce9c2);return _0x1259b4(_0x35cf3f);}});});};exports[_0x2aeb('0x1b')]=function(_0x5e984e,_0xac0370,_0x3af407){var _0x5a8bea=_0x3af407||stringOptions[_0x2aeb('0x9')];var _0x1c709a=_0xac0370||stringOptions['secret'];var _0x1f4335=crypto['createCipher'](_0x5a8bea,_0x1c709a);var _0x1f76f0=_0x1f4335[_0x2aeb('0x12')](_0x5e984e,_0x2aeb('0x1c'),_0x2aeb('0x1d'));_0x1f76f0+=_0x1f4335[_0x2aeb('0x14')]('base64');return _0x1f76f0;};exports[_0x2aeb('0x1e')]=function(_0xd6cffb,_0x1bcd71,_0x4a3498){var _0x17cdb8=_0x4a3498||stringOptions['algorithm'];var _0x16e0a6=_0x1bcd71||stringOptions[_0x2aeb('0x1f')];var _0x175294=crypto[_0x2aeb('0x1a')](_0x17cdb8,_0x16e0a6);var _0xb65bba=_0x175294[_0x2aeb('0x12')](_0xd6cffb,_0x2aeb('0x1d'),_0x2aeb('0x1c'));_0xb65bba+=_0x175294[_0x2aeb('0x14')](_0x2aeb('0x1c'));return _0xb65bba;}; \ No newline at end of file +var _0x3662=['../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','final','end','close','unlink','createDecipher','data','write','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3662,0x8d));var _0x2366=function(_0x115737,_0x4b4df7){_0x115737=_0x115737-0x0;var _0xa98ae4=_0x3662[_0x115737];return _0xa98ae4;};'use strict';var crypto=require(_0x2366('0x0'));var fs=require('fs');var BPromise=require(_0x2366('0x1'));var _=require(_0x2366('0x2'));var config=require(_0x2366('0x3'));var logger=require('../../config/logger')(_0x2366('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2366('0x5')]['session'],'algorithm':_0x2366('0x6')};const fileOptions={'algorithm':_0x2366('0x7')};if(config[_0x2366('0x8')]&&config[_0x2366('0x8')][_0x2366('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x2366('0x9')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x2366('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2366('0xa')](',\x20');logger[_0x2366('0xb')](config[_0x2366('0x8')][_0x2366('0x9')],_0x2366('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x543737){return AES_SUPPORTED_RX[_0x2366('0xd')](_0x543737);}function getSupportedCiphers(){return crypto[_0x2366('0xe')]()[_0x2366('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x227453){return getSupportedCiphers()[_0x2366('0x10')](_0x227453)>-0x1;}function combineOptions(_0x16ad72){var _0x43ea36={};for(var _0x571904 in fileOptions){if(fileOptions[_0x2366('0x11')](_0x571904)){_0x43ea36[_0x571904]=fileOptions[_0x571904];}}if(_0x16ad72){for(var _0x575f3f in _0x16ad72){if(_0x16ad72[_0x2366('0x11')](_0x575f3f)){_0x43ea36[_0x575f3f]=_0x16ad72[_0x575f3f];}}}return _0x43ea36;}exports[_0x2366('0x12')]=function(_0x247ec3,_0x38deec,_0x486479,_0x1a9db3){return new BPromise(function(_0x4f8706,_0x4724f9){_0x1a9db3=combineOptions(_0x1a9db3);var _0x64ea6b=new Buffer(_0x486479);var _0x23ae3a=fs[_0x2366('0x13')](_0x247ec3);var _0x56067f=fs[_0x2366('0x14')](_0x38deec);var _0x4bfe15=crypto[_0x2366('0x15')](_0x1a9db3[_0x2366('0x9')],_0x64ea6b);_0x23ae3a['on']('data',function(_0x35515b){var _0x5c4606=new Buffer(_0x4bfe15[_0x2366('0x16')](_0x35515b),_0x2366('0x17'));_0x56067f['write'](_0x5c4606);});_0x23ae3a['on']('end',function(){try{var _0x42db9f=new Buffer(_0x4bfe15[_0x2366('0x18')](_0x2366('0x17')),_0x2366('0x17'));_0x56067f['write'](_0x42db9f);_0x56067f[_0x2366('0x19')]();_0x56067f['on'](_0x2366('0x1a'),function(){return _0x4f8706(_0x38deec);});}catch(_0x1a4ba8){fs[_0x2366('0x1b')](_0x38deec);return _0x4724f9(_0x1a4ba8);}});});};exports['decryptFile']=function(_0x103060,_0x345cde,_0x38ab37,_0x4435fa){return new BPromise(function(_0x358944,_0x4e65e5){_0x4435fa=combineOptions(_0x4435fa);var _0x3e9442=new Buffer(_0x38ab37);var _0x1e782c=fs[_0x2366('0x13')](_0x103060);var _0x31af1f=fs['createWriteStream'](_0x345cde);var _0x2b9ed1=crypto[_0x2366('0x1c')](_0x4435fa[_0x2366('0x9')],_0x3e9442);_0x1e782c['on'](_0x2366('0x1d'),function(_0x28fab6){var _0x3ded15=new Buffer(_0x2b9ed1['update'](_0x28fab6),_0x2366('0x17'));_0x31af1f[_0x2366('0x1e')](_0x3ded15);});_0x1e782c['on'](_0x2366('0x19'),function(){try{var _0x447fbb=new Buffer(_0x2b9ed1['final'](_0x2366('0x17')),_0x2366('0x17'));_0x31af1f[_0x2366('0x1e')](_0x447fbb);_0x31af1f[_0x2366('0x19')]();_0x31af1f['on'](_0x2366('0x1a'),function(){return _0x358944(_0x345cde);});}catch(_0x44cb12){fs[_0x2366('0x1b')](_0x345cde);return _0x4e65e5(_0x44cb12);}});});};exports[_0x2366('0x1f')]=function(_0x4a8816,_0x4fd288,_0x193409){var _0x42721f=_0x193409||stringOptions[_0x2366('0x9')];var _0x4c8ddb=_0x4fd288||stringOptions[_0x2366('0x20')];var _0x4a575f=crypto['createCipher'](_0x42721f,_0x4c8ddb);var _0x50e68c=_0x4a575f[_0x2366('0x16')](_0x4a8816,_0x2366('0x21'),_0x2366('0x22'));_0x50e68c+=_0x4a575f[_0x2366('0x18')](_0x2366('0x22'));return _0x50e68c;};exports[_0x2366('0x23')]=function(_0x306bd7,_0x45c24f,_0x2ca531){var _0x357734=_0x2ca531||stringOptions[_0x2366('0x9')];var _0x34e5c6=_0x45c24f||stringOptions['secret'];var _0x505c4c=crypto[_0x2366('0x1c')](_0x357734,_0x34e5c6);var _0x432c8e=_0x505c4c['update'](_0x306bd7,'base64','utf8');_0x432c8e+=_0x505c4c[_0x2366('0x18')]('utf8');return _0x432c8e;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 1e89175..a4ad4b0 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 _0x1a63=['Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3b0b07,_0xc927c6){var _0x198e38=function(_0x19377d){while(--_0x19377d){_0x3b0b07['push'](_0x3b0b07['shift']());}};_0x198e38(++_0xc927c6);}(_0x1a63,0x192));var _0x31a6=function(_0x4de184,_0x2c7f5d){_0x4de184=_0x4de184-0x0;var _0x233a76=_0x1a63[_0x4de184];return _0x233a76;};'use strict';var util=require(_0x31a6('0x0'));var path=require(_0x31a6('0x1'));var _=require(_0x31a6('0x2'));var csv=require(_0x31a6('0x3'));var fs=require('fs');var BPromise=require(_0x31a6('0x4'));var zipdir=require(_0x31a6('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x31a6('0x6'))[_0x31a6('0x7')];var logger=require(_0x31a6('0x8'))(_0x31a6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x31a6('0xa')][0x2]);var QUERY=process[_0x31a6('0xa')][0x3];var PATH=process[_0x31a6('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd5d761,_0x794f93){var _0x3bde1e={'status':_0xd5d761};var _0x632eee={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x794f93){_0x3bde1e[_0x31a6('0xb')]=_0x794f93;}return db['AnalyticExtractedReport'][_0x31a6('0xc')](_0x3bde1e,_0x632eee);}function main(){var _0x4885b4=0x1388;var _0xb6ff9a;logger[_0x31a6('0xd')](util[_0x31a6('0xe')](_0x31a6('0xf'),EXTRACTED_REPORT_ID,_0x31a6('0x10')));return db[_0x31a6('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x31a6('0x12'),_0x31a6('0x13')]})[_0x31a6('0x14')](function(_0x22d5fb){if(_0x22d5fb){_0xb6ff9a=_0x22d5fb;_0x4885b4=_0xb6ff9a['splitSizeCsv']||0x1388;}})[_0x31a6('0x14')](function(){return dbH['sequelize'][_0x31a6('0x15')](util[_0x31a6('0xe')](_0x31a6('0x16'),QUERY),{'type':dbH[_0x31a6('0x17')][_0x31a6('0x18')][_0x31a6('0x19')]});})[_0x31a6('0x14')](function(_0x45e075){if(!_0x45e075[0x0][_0x31a6('0x1a')]){return analyticExtractedReport(_0x31a6('0x1b'));}var _0x2ee73e=[];var _0x5aed42=0x0;if(_0xb6ff9a[_0x31a6('0x12')]){if(_0x45e075&&_0x45e075['length']){var _0x133a4e=_[_0x31a6('0x1c')](_0x45e075[0x0][_0x31a6('0x1a')]/_0x4885b4);var _0xa35903=Number[_0x31a6('0x1d')](_0x45e075[0x0]['num']/_0x4885b4)?_0x45e075[0x0][_0x31a6('0x1a')]%_0x4885b4:0x0;_0x133a4e['forEach'](function(_0x5915de){if(_0x5915de>0x0){_0x5aed42+=_0x4885b4;}_0x2ee73e[_0x31a6('0x1e')](dbH[_0x31a6('0x17')][_0x31a6('0x15')](util[_0x31a6('0xe')](_0x31a6('0x1f'),QUERY,_0x4885b4,_0x5aed42),{'type':dbH['sequelize']['QueryTypes'][_0x31a6('0x19')]}));});if(_0xa35903>0x0){_0x5aed42+=_0x4885b4;_0x2ee73e[_0x31a6('0x1e')](dbH[_0x31a6('0x17')][_0x31a6('0x15')](util[_0x31a6('0xe')](_0x31a6('0x1f'),QUERY,_0xa35903,_0x5aed42),{'type':dbH[_0x31a6('0x17')]['QueryTypes'][_0x31a6('0x19')]}));}}}else{_0x2ee73e[_0x31a6('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x31a6('0x17')][_0x31a6('0x18')][_0x31a6('0x19')]}));}var _0x96fcb1=path[_0x31a6('0x20')](PATH);var _0x2514be=path[_0x31a6('0x21')](PATH,_0x31a6('0x22'));var _0x297a24=_0xb6ff9a[_0x31a6('0x12')]&&_0x2ee73e[_0x31a6('0x23')]>0x1;var _0x4c3382=[];if(!fs[_0x31a6('0x24')](path[_0x31a6('0x25')](_0x96fcb1,_0x2514be))&&_0x297a24){fs[_0x31a6('0x26')](path[_0x31a6('0x25')](_0x96fcb1,_0x2514be));}return BPromise['each'](_0x2ee73e,function(_0x55036c){_0x4c3382['push'](_0x55036c);})['then'](function(){for(var _0x45663d=0x0;_0x45663d<_0x4c3382[_0x31a6('0x23')];_0x45663d+=0x1){var _0x51b0f1;var _0x230806=_0x4c3382[_0x45663d];if(_0x297a24){_0x51b0f1=path[_0x31a6('0x25')](_0x96fcb1,_0x2514be,util[_0x31a6('0xe')](_0x31a6('0x27'),_0x2514be,_0x45663d,'csv'));}else{_0x51b0f1=path[_0x31a6('0x25')](_0x96fcb1,util[_0x31a6('0xe')](_0x31a6('0x28'),_0x2514be,_0x31a6('0x29')));}fs[_0x31a6('0x2a')](_0x51b0f1,csv(_0x230806));}})['then'](function(){if(_0x297a24){return new Promise(function(_0x3d803a){zipdir(path[_0x31a6('0x25')](_0x96fcb1,_0x2514be),{'saveTo':path[_0x31a6('0x25')](_0x96fcb1,util[_0x31a6('0xe')]('%s.%s',_0x2514be,_0x31a6('0x2b')))},function(_0xdaffa9,_0x42e40c){rimraf(path[_0x31a6('0x25')](_0x96fcb1,_0x2514be),function(){});_0x3d803a(_0x31a6('0x2c'));});});}})[_0x31a6('0x14')](function(){logger[_0x31a6('0xd')](util[_0x31a6('0xe')](_0x31a6('0x2d'),EXTRACTED_REPORT_ID,_0x31a6('0x10')));return analyticExtractedReport('Completed',_0x297a24?util[_0x31a6('0xe')](_0x31a6('0x28'),_0x2514be,_0x297a24?'zip':_0x31a6('0x29')):null);});})[_0x31a6('0x2e')](function(_0x573586){logger[_0x31a6('0xd')](util[_0x31a6('0xe')](_0x31a6('0x2f'),EXTRACTED_REPORT_ID,_0x31a6('0x10')),util['inspect'](_0x573586,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x31a6('0x30'));})[_0x31a6('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x80d6=['Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','to-csv','bluebird','../../mysqldb','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync'];(function(_0x4ccab3,_0x2cffb4){var _0x5763c9=function(_0x2155e9){while(--_0x2155e9){_0x4ccab3['push'](_0x4ccab3['shift']());}};_0x5763c9(++_0x2cffb4);}(_0x80d6,0xb7));var _0x680d=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0x80d6[_0x252328];return _0xaa85b7;};'use strict';var util=require(_0x680d('0x0'));var path=require(_0x680d('0x1'));var _=require('lodash');var csv=require(_0x680d('0x2'));var fs=require('fs');var BPromise=require(_0x680d('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x680d('0x4'))['db'];var dbH=require(_0x680d('0x4'))['dbH'];var logger=require('../../config/logger')(_0x680d('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x680d('0x6')][0x2]);var QUERY=process[_0x680d('0x6')][0x3];var PATH=process[_0x680d('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5efe5c,_0x519f03){var _0x1ef287={'status':_0x5efe5c};var _0x39bfcf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x519f03){_0x1ef287['savename']=_0x519f03;}return db['AnalyticExtractedReport'][_0x680d('0x7')](_0x1ef287,_0x39bfcf);}function main(){var _0x41fe15=0x1388;var _0x300722;logger[_0x680d('0x8')](util[_0x680d('0x9')](_0x680d('0xa'),EXTRACTED_REPORT_ID,_0x680d('0xb')));return db[_0x680d('0xc')][_0x680d('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x680d('0xe'),_0x680d('0xf')]})[_0x680d('0x10')](function(_0x3c9de7){if(_0x3c9de7){_0x300722=_0x3c9de7;_0x41fe15=_0x300722['splitSizeCsv']||0x1388;}})[_0x680d('0x10')](function(){return dbH[_0x680d('0x11')][_0x680d('0x12')](util[_0x680d('0x9')](_0x680d('0x13'),QUERY),{'type':dbH[_0x680d('0x11')]['QueryTypes'][_0x680d('0x14')]});})[_0x680d('0x10')](function(_0x2fc418){if(!_0x2fc418[0x0][_0x680d('0x15')]){return analyticExtractedReport(_0x680d('0x16'));}var _0xbead36=[];var _0x3421ef=0x0;if(_0x300722[_0x680d('0xe')]){if(_0x2fc418&&_0x2fc418[_0x680d('0x17')]){var _0x4653a2=_[_0x680d('0x18')](_0x2fc418[0x0]['num']/_0x41fe15);var _0x2050ad=Number['isInteger'](_0x2fc418[0x0][_0x680d('0x15')]/_0x41fe15)?_0x2fc418[0x0]['num']%_0x41fe15:0x0;_0x4653a2[_0x680d('0x19')](function(_0x5cc721){if(_0x5cc721>0x0){_0x3421ef+=_0x41fe15;}_0xbead36[_0x680d('0x1a')](dbH['sequelize'][_0x680d('0x12')](util[_0x680d('0x9')](_0x680d('0x1b'),QUERY,_0x41fe15,_0x3421ef),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));});if(_0x2050ad>0x0){_0x3421ef+=_0x41fe15;_0xbead36[_0x680d('0x1a')](dbH[_0x680d('0x11')]['query'](util[_0x680d('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2050ad,_0x3421ef),{'type':dbH[_0x680d('0x11')]['QueryTypes'][_0x680d('0x14')]}));}}}else{_0xbead36[_0x680d('0x1a')](dbH[_0x680d('0x11')][_0x680d('0x12')](QUERY,{'type':dbH['sequelize'][_0x680d('0x1c')][_0x680d('0x14')]}));}var _0x15a492=path['dirname'](PATH);var _0xc4d841=path[_0x680d('0x1d')](PATH,'.csv');var _0x4e6769=_0x300722[_0x680d('0xe')]&&_0xbead36['length']>0x1;var _0x30c629=[];if(!fs[_0x680d('0x1e')](path[_0x680d('0x1f')](_0x15a492,_0xc4d841))&&_0x4e6769){fs[_0x680d('0x20')](path[_0x680d('0x1f')](_0x15a492,_0xc4d841));}return BPromise['each'](_0xbead36,function(_0x24fc46){_0x30c629[_0x680d('0x1a')](_0x24fc46);})[_0x680d('0x10')](function(){for(var _0x4cb861=0x0;_0x4cb861<_0x30c629[_0x680d('0x17')];_0x4cb861+=0x1){var _0xd241dd;var _0x579b9b=_0x30c629[_0x4cb861];if(_0x4e6769){_0xd241dd=path[_0x680d('0x1f')](_0x15a492,_0xc4d841,util[_0x680d('0x9')](_0x680d('0x21'),_0xc4d841,_0x4cb861,_0x680d('0x22')));}else{_0xd241dd=path[_0x680d('0x1f')](_0x15a492,util[_0x680d('0x9')](_0x680d('0x23'),_0xc4d841,_0x680d('0x22')));}fs[_0x680d('0x24')](_0xd241dd,csv(_0x579b9b));}})[_0x680d('0x10')](function(){if(_0x4e6769){return new Promise(function(_0x396725){zipdir(path[_0x680d('0x1f')](_0x15a492,_0xc4d841),{'saveTo':path[_0x680d('0x1f')](_0x15a492,util['format']('%s.%s',_0xc4d841,'zip'))},function(_0x4e1731,_0x320c25){rimraf(path[_0x680d('0x1f')](_0x15a492,_0xc4d841),function(){});_0x396725('zip\x20finished');});});}})['then'](function(){logger[_0x680d('0x8')](util[_0x680d('0x9')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x680d('0xb')));return analyticExtractedReport(_0x680d('0x25'),_0x4e6769?util[_0x680d('0x9')](_0x680d('0x23'),_0xc4d841,_0x4e6769?'zip':_0x680d('0x22')):null);});})[_0x680d('0x26')](function(_0xb8522){logger[_0x680d('0x8')](util[_0x680d('0x9')](_0x680d('0x27'),EXTRACTED_REPORT_ID,_0x680d('0xb')),util[_0x680d('0x28')](_0xb8522,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x680d('0x29'));})[_0x680d('0x2a')](function(){process[_0x680d('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index d87eda5..f2e1d66 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 _0xe228=['body','push','keys','format','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Setting','find','splitSizePdf','then','split','isInteger','forEach','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','fill','length'];(function(_0x165194,_0x31a93e){var _0x2975f0=function(_0x49ae22){while(--_0x49ae22){_0x165194['push'](_0x165194['shift']());}};_0x2975f0(++_0x31a93e);}(_0xe228,0x99));var _0x8e22=function(_0x3bd900,_0x5f0108){_0x3bd900=_0x3bd900-0x0;var _0x475130=_0xe228[_0x3bd900];return _0x475130;};'use strict';var _=require(_0x8e22('0x0'));var fs=require('fs');var util=require(_0x8e22('0x1'));var path=require(_0x8e22('0x2'));var moment=require(_0x8e22('0x3'));var htmlToPdfmake=require(_0x8e22('0x4'));var PdfPrinter=require(_0x8e22('0x5'));var zipdir=require(_0x8e22('0x6'));var rimraf=require(_0x8e22('0x7'));var JSDOM=require(_0x8e22('0x8'))['JSDOM'];var window=new JSDOM('')[_0x8e22('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x8e22('0xa'))[_0x8e22('0xb')];var logger=require(_0x8e22('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8e22('0xd')][0x2]);var QUERY=process[_0x8e22('0xd')][0x3];var PATH=process[_0x8e22('0xd')][0x4];var NAME=process[_0x8e22('0xd')][0x5];var FORMAT=_0x8e22('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3106b9,_0x71653){var _0x34fe1e={'status':_0x3106b9};var _0x5dc79a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x71653){_0x34fe1e[_0x8e22('0xf')]=_0x71653;}return db[_0x8e22('0x10')][_0x8e22('0x11')](_0x34fe1e,_0x5dc79a);}function getHeaders(_0x5d7ad9){return _[_0x8e22('0x12')](_0x5d7ad9,function(_0x5794ed){return{'text':_0x5794ed,'style':'tableHeader'};});}function getRows(_0x34bba5,_0x449d5f){return _['map'](_0x449d5f,function(_0x3d3ac0){return _(_0x3d3ac0)[_0x8e22('0x13')](_0x34bba5)[_0x8e22('0x12')](function(_0x520e41){return _0x520e41?_[_0x8e22('0x14')](_0x520e41):'';})['value']();});}function createTable(_0x2f1938,_0x399248){var _0x563045={'widths':_[_0x8e22('0x15')](Array(_0x2f1938[_0x8e22('0x16')]),0x91),'heights':function(_0x2907c4){return _0x2907c4===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4eb6ee=getHeaders(_0x2f1938);_0x563045[_0x8e22('0x17')][_0x8e22('0x18')](_0x4eb6ee);var _0x1b75bb=getRows(_0x2f1938,_0x399248);_0x563045[_0x8e22('0x17')]=_0x563045[_0x8e22('0x17')]['concat'](_0x1b75bb);return _0x563045;}function createTables(_0x28f7a4){var _0x45933e=[];var _0x12873b=_['chunk'](Object[_0x8e22('0x19')](_0x28f7a4[0x0]),0x5);_0x12873b['forEach'](function(_0xc60730){_0x45933e[_0x8e22('0x18')](createTable(_0xc60730,_0x28f7a4));});return _0x45933e;}function getPDFDocDefinition(_0x429ee9){var _0x498c56=util[_0x8e22('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x8e22('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x8e22('0x1b')])[_0x8e22('0x1a')](FORMAT));var _0x48356a=[];for(var _0x28e6ab=0x0;_0x28e6ab<_0x429ee9[_0x8e22('0x16')];_0x28e6ab++){var _0x20c506=[];if(_0x28e6ab===0x0){_0x20c506['push']({'text':_0x498c56,'style':_0x8e22('0x1c')});}var _0x1132c2={'table':_0x429ee9[_0x28e6ab]};if(_0x28e6ab>0x0){_0x1132c2[_0x8e22('0x1d')]=_0x8e22('0x1e');_0x1132c2[_0x8e22('0x1f')]=[0x0,0x46,0x0,0x0];}_0x20c506[_0x8e22('0x18')](_0x1132c2);_0x48356a['push'](_0x20c506);}return{'pageSize':'A4','pageOrientation':_0x8e22('0x20'),'content':_0x48356a,'footer':function(_0x6cf667,_0xb64d58){return{'text':_0x6cf667[_0x8e22('0x14')]()+_0x8e22('0x21')+_0xb64d58,'style':_0x8e22('0x22')};},'defaultStyle':{'font':_0x8e22('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8e22('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xe12e0e){var _0x286476=0x1388;var _0x3b7cf1;if(!_0xe12e0e[0x0][_0x8e22('0x25')]){return analyticExtractedReport('Empty');}return db[_0x8e22('0x26')][_0x8e22('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8e22('0x28')]})[_0x8e22('0x29')](function(_0x2b1171){if(_0x2b1171){_0x3b7cf1=_0x2b1171;_0x286476=_0x3b7cf1[_0x8e22('0x28')]||0x3e8;}})['then'](function(){var _0xb9aefd=[];var _0x2c7467=0x0;if(_0x3b7cf1[_0x8e22('0x2a')]){if(_0xe12e0e&&_0xe12e0e[_0x8e22('0x16')]){var _0x2a5ea8=_['range'](_0xe12e0e[0x0][_0x8e22('0x25')]/_0x286476);var _0x4bd1db=Number[_0x8e22('0x2b')](_0xe12e0e[0x0][_0x8e22('0x25')]/_0x286476)?_0xe12e0e[0x0][_0x8e22('0x25')]%_0x286476:0x0;_0x2a5ea8[_0x8e22('0x2c')](function(_0x32eade){if(_0x32eade>0x0){_0x2c7467+=_0x286476;}_0xb9aefd[_0x8e22('0x18')](dbH['sequelize'][_0x8e22('0x2d')](util[_0x8e22('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x286476,_0x2c7467),{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')][_0x8e22('0x30')]}));});if(_0x4bd1db>0x0){_0x2c7467+=_0x286476;_0xb9aefd[_0x8e22('0x18')](dbH[_0x8e22('0x2e')][_0x8e22('0x2d')](util[_0x8e22('0x1a')](_0x8e22('0x31'),QUERY,_0x4bd1db,_0x2c7467),{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')][_0x8e22('0x30')]}));}}}else{_0xb9aefd[_0x8e22('0x18')](dbH[_0x8e22('0x2e')]['query'](QUERY,{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')]['SELECT']}));}var _0x171866=path[_0x8e22('0x32')](PATH);var _0x1d2c95=path[_0x8e22('0x33')](PATH,_0x8e22('0x34'));var _0x26620d=_0x3b7cf1[_0x8e22('0x2a')]&&_0xb9aefd[_0x8e22('0x16')]>0x1;var _0x1e461c=[];if(!fs[_0x8e22('0x35')](path['join'](_0x171866,_0x1d2c95))&&_0x26620d){fs[_0x8e22('0x36')](path[_0x8e22('0x37')](_0x171866,_0x1d2c95));}return BPromise[_0x8e22('0x38')](_0xb9aefd,function(_0x24b3c7){_0x1e461c[_0x8e22('0x18')](_0x24b3c7);})['then'](function(){var _0x120749=[];for(var _0x1b0952=0x0;_0x1b0952<_0x1e461c[_0x8e22('0x16')];_0x1b0952+=0x1){var _0x1e53f8=_0x1e461c[_0x1b0952];var _0x32a29c=createTables(_['flatten'](_0x1e53f8));var _0x4684ce;var _0x31b0ed=getPDFDocDefinition(_0x32a29c);var _0x48329d=getPDFPrinter();var _0x1fd6f5=_0x48329d[_0x8e22('0x39')](_0x31b0ed);if(_0x26620d){_0x4684ce=path['join'](_0x171866,_0x1d2c95,util[_0x8e22('0x1a')](_0x8e22('0x3a'),_0x1d2c95,_0x1b0952,_0x8e22('0x3b')));}else{_0x4684ce=path[_0x8e22('0x37')](_0x171866,util[_0x8e22('0x1a')](_0x8e22('0x3c'),_0x1d2c95,_0x8e22('0x3b')));}_0x120749[_0x8e22('0x18')](writePDFDocument(_0x1fd6f5,_0x4684ce));}return Promise[_0x8e22('0x3d')](_0x120749);})[_0x8e22('0x29')](function(){if(_0x26620d){return new Promise(function(_0x5b800c){zipdir(path['join'](_0x171866,_0x1d2c95),{'saveTo':path[_0x8e22('0x37')](_0x171866,util[_0x8e22('0x1a')](_0x8e22('0x3c'),_0x1d2c95,_0x8e22('0x3e')))},function(){rimraf(path[_0x8e22('0x37')](_0x171866,_0x1d2c95),function(){});_0x5b800c(_0x8e22('0x3f'));});});}})[_0x8e22('0x29')](function(){if(!_0x26620d)return;rimraf(path[_0x8e22('0x37')](_0x171866,_0x1d2c95),function(){});})['then'](function(){logger[_0x8e22('0x40')](util[_0x8e22('0x1a')](_0x8e22('0x41'),EXTRACTED_REPORT_ID,_0x8e22('0x42')));return analyticExtractedReport(_0x8e22('0x43'),_0x26620d?util[_0x8e22('0x1a')](_0x8e22('0x3c'),_0x1d2c95,_0x26620d?'zip':_0x8e22('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8e22('0x40')](util[_0x8e22('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8e22('0x42')));return db['AnalyticExtractedReport'][_0x8e22('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8e22('0x29')](function(_0x2f0853){EXTRACTED_REPORT=_0x2f0853;return dbH[_0x8e22('0x2e')][_0x8e22('0x2d')](util[_0x8e22('0x1a')](_0x8e22('0x45'),QUERY),{'type':dbH[_0x8e22('0x2e')][_0x8e22('0x2f')][_0x8e22('0x30')]});})[_0x8e22('0x29')](extractReport)[_0x8e22('0x46')](function(_0xeace23){logger['info'](util['format'](_0x8e22('0x47'),EXTRACTED_REPORT_ID,_0x8e22('0x42')),util['inspect'](_0xeace23,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8e22('0x48'));})[_0x8e22('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1f1f1a=new PdfPrinter({'Arial':{'normal':__dirname+_0x8e22('0x4a'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8e22('0x4b'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x1f1f1a;}function getPDFDocDefinitionFromHTML(_0x58429b,_0x5f3df1){var _0x363124=util[_0x8e22('0x1a')](_0x8e22('0x4c'),_0x5f3df1[_0x8e22('0x4d')],_0x5f3df1[_0x8e22('0x4e')]);var _0x45d34c=moment()['format'](_0x8e22('0x4f'))[_0x8e22('0x14')]();var _0x116326=htmlToPdfmake(_0x58429b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x116326],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8e22('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8e22('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x8e22('0x51'),'style':_0x8e22('0x1c')}];},'footer':function(_0x2d6dea,_0x1d1109){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x363124,_0x2d6dea,_0x1d1109,_0x45d34c),'style':_0x8e22('0x22')}];}};}function writePDFDocument(_0x28b4c1,_0x258ad9){return new Promise(function(_0x280c54,_0x85f0f1){var _0x1f9856=_0x28b4c1[_0x8e22('0x52')](fs[_0x8e22('0x53')](_0x258ad9));_0x1f9856['on'](_0x8e22('0x54'),function(){_0x280c54(_0x8e22('0x54'));});_0x1f9856['on'](_0x8e22('0x55'),function(_0x460a6a){_0x85f0f1(_0x460a6a);});_0x28b4c1[_0x8e22('0x56')]();});}exports[_0x8e22('0x57')]=function(_0xd2be8f,_0x35a1ee){var _0x5448a2=getPDFPrinter();var _0x874013=getPDFDocDefinitionFromHTML(_0xd2be8f,_0x35a1ee);var _0x1078e3=_0x5448a2[_0x8e22('0x39')](_0x874013);return writePDFDocument(_0x1078e3,_0x35a1ee['path'])['catch'](function(_0x11deb8){throw _0x11deb8;});}; \ No newline at end of file +var _0xd5a8=['find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','createPdfKitDocument','%s%d.%s','%s.%s','pdf','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','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','fill','length','body','push','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Setting'];(function(_0x139b85,_0x5e0691){var _0x1e833f=function(_0xc97932){while(--_0xc97932){_0x139b85['push'](_0x139b85['shift']());}};_0x1e833f(++_0x5e0691);}(_0xd5a8,0x198));var _0x8d5a=function(_0x220ae5,_0x4eceb4){_0x220ae5=_0x220ae5-0x0;var _0x319e72=_0xd5a8[_0x220ae5];return _0x319e72;};'use strict';var _=require(_0x8d5a('0x0'));var fs=require('fs');var util=require(_0x8d5a('0x1'));var path=require('path');var moment=require(_0x8d5a('0x2'));var htmlToPdfmake=require(_0x8d5a('0x3'));var PdfPrinter=require(_0x8d5a('0x4'));var zipdir=require(_0x8d5a('0x5'));var rimraf=require(_0x8d5a('0x6'));var JSDOM=require(_0x8d5a('0x7'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x8d5a('0x8'));var db=require(_0x8d5a('0x9'))['db'];var dbH=require(_0x8d5a('0x9'))[_0x8d5a('0xa')];var logger=require(_0x8d5a('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8d5a('0xc')][0x2]);var QUERY=process[_0x8d5a('0xc')][0x3];var PATH=process[_0x8d5a('0xc')][0x4];var NAME=process[_0x8d5a('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xc8d44e,_0xa726af){var _0x44d918={'status':_0xc8d44e};var _0x454b40={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa726af){_0x44d918[_0x8d5a('0xd')]=_0xa726af;}return db[_0x8d5a('0xe')][_0x8d5a('0xf')](_0x44d918,_0x454b40);}function getHeaders(_0x1a646f){return _[_0x8d5a('0x10')](_0x1a646f,function(_0x2f0147){return{'text':_0x2f0147,'style':_0x8d5a('0x11')};});}function getRows(_0x2c46e4,_0x48279f){return _[_0x8d5a('0x10')](_0x48279f,function(_0x392b41){return _(_0x392b41)[_0x8d5a('0x12')](_0x2c46e4)[_0x8d5a('0x10')](function(_0x4b4788){return _0x4b4788?_[_0x8d5a('0x13')](_0x4b4788):'';})['value']();});}function createTable(_0x4ff01c,_0x29da9f){var _0x296b50={'widths':_[_0x8d5a('0x14')](Array(_0x4ff01c[_0x8d5a('0x15')]),0x91),'heights':function(_0x2af095){return _0x2af095===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xd19c2a=getHeaders(_0x4ff01c);_0x296b50[_0x8d5a('0x16')][_0x8d5a('0x17')](_0xd19c2a);var _0x2a1c64=getRows(_0x4ff01c,_0x29da9f);_0x296b50[_0x8d5a('0x16')]=_0x296b50[_0x8d5a('0x16')]['concat'](_0x2a1c64);return _0x296b50;}function createTables(_0x3b9b1c){var _0xad404=[];var _0xcdf869=_['chunk'](Object[_0x8d5a('0x18')](_0x3b9b1c[0x0]),0x5);_0xcdf869['forEach'](function(_0x53f6ba){_0xad404[_0x8d5a('0x17')](createTable(_0x53f6ba,_0x3b9b1c));});return _0xad404;}function getPDFDocDefinition(_0x2bcc8a){var _0x3d1903=util['format'](_0x8d5a('0x19'),NAME,EXTRACTED_REPORT[_0x8d5a('0x1a')],moment(EXTRACTED_REPORT[_0x8d5a('0x1b')])[_0x8d5a('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x8d5a('0x1d')])[_0x8d5a('0x1c')](FORMAT));var _0x286750=[];for(var _0x1dc4b4=0x0;_0x1dc4b4<_0x2bcc8a[_0x8d5a('0x15')];_0x1dc4b4++){var _0x150a21=[];if(_0x1dc4b4===0x0){_0x150a21[_0x8d5a('0x17')]({'text':_0x3d1903,'style':_0x8d5a('0x1e')});}var _0x9aa2d9={'table':_0x2bcc8a[_0x1dc4b4]};if(_0x1dc4b4>0x0){_0x9aa2d9[_0x8d5a('0x1f')]=_0x8d5a('0x20');_0x9aa2d9[_0x8d5a('0x21')]=[0x0,0x46,0x0,0x0];}_0x150a21[_0x8d5a('0x17')](_0x9aa2d9);_0x286750[_0x8d5a('0x17')](_0x150a21);}return{'pageSize':'A4','pageOrientation':_0x8d5a('0x22'),'content':_0x286750,'footer':function(_0xae1ac9,_0x5eed2f){return{'text':_0xae1ac9[_0x8d5a('0x13')]()+_0x8d5a('0x23')+_0x5eed2f,'style':_0x8d5a('0x24')};},'defaultStyle':{'font':_0x8d5a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8d5a('0x26')},'footer':{'alignment':_0x8d5a('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x391120){var _0x255bde=0x1388;var _0x36dd6b;if(!_0x391120[0x0][_0x8d5a('0x28')]){return analyticExtractedReport('Empty');}return db[_0x8d5a('0x29')][_0x8d5a('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8d5a('0x2b'),_0x8d5a('0x2c')]})[_0x8d5a('0x2d')](function(_0x2c76ac){if(_0x2c76ac){_0x36dd6b=_0x2c76ac;_0x255bde=_0x36dd6b[_0x8d5a('0x2c')]||0x3e8;}})[_0x8d5a('0x2d')](function(){var _0x3f5339=[];var _0x17f358=0x0;if(_0x36dd6b['split']){if(_0x391120&&_0x391120[_0x8d5a('0x15')]){var _0xdd89a2=_[_0x8d5a('0x2e')](_0x391120[0x0]['num']/_0x255bde);var _0x5494c6=Number[_0x8d5a('0x2f')](_0x391120[0x0][_0x8d5a('0x28')]/_0x255bde)?_0x391120[0x0][_0x8d5a('0x28')]%_0x255bde:0x0;_0xdd89a2['forEach'](function(_0x231e64){if(_0x231e64>0x0){_0x17f358+=_0x255bde;}_0x3f5339[_0x8d5a('0x17')](dbH[_0x8d5a('0x30')][_0x8d5a('0x31')](util['format'](_0x8d5a('0x32'),QUERY,_0x255bde,_0x17f358),{'type':dbH[_0x8d5a('0x30')][_0x8d5a('0x33')][_0x8d5a('0x34')]}));});if(_0x5494c6>0x0){_0x17f358+=_0x255bde;_0x3f5339[_0x8d5a('0x17')](dbH[_0x8d5a('0x30')][_0x8d5a('0x31')](util['format'](_0x8d5a('0x32'),QUERY,_0x5494c6,_0x17f358),{'type':dbH[_0x8d5a('0x30')][_0x8d5a('0x33')][_0x8d5a('0x34')]}));}}}else{_0x3f5339[_0x8d5a('0x17')](dbH[_0x8d5a('0x30')][_0x8d5a('0x31')](QUERY,{'type':dbH[_0x8d5a('0x30')][_0x8d5a('0x33')][_0x8d5a('0x34')]}));}var _0x1d78be=path[_0x8d5a('0x35')](PATH);var _0x55aa72=path[_0x8d5a('0x36')](PATH,_0x8d5a('0x37'));var _0x3caa7f=_0x36dd6b[_0x8d5a('0x2b')]&&_0x3f5339[_0x8d5a('0x15')]>0x1;var _0xd8607c=[];if(!fs[_0x8d5a('0x38')](path[_0x8d5a('0x39')](_0x1d78be,_0x55aa72))&&_0x3caa7f){fs['mkdirSync'](path['join'](_0x1d78be,_0x55aa72));}return BPromise['each'](_0x3f5339,function(_0x58dabd){_0xd8607c[_0x8d5a('0x17')](_0x58dabd);})[_0x8d5a('0x2d')](function(){var _0x7776bc=[];for(var _0x27deab=0x0;_0x27deab<_0xd8607c[_0x8d5a('0x15')];_0x27deab+=0x1){var _0x34962a=_0xd8607c[_0x27deab];var _0x55a41e=createTables(_['flatten'](_0x34962a));var _0x4140f8;var _0x4c44ee=getPDFDocDefinition(_0x55a41e);var _0x37c06e=getPDFPrinter();var _0x2dd490=_0x37c06e[_0x8d5a('0x3a')](_0x4c44ee);if(_0x3caa7f){_0x4140f8=path[_0x8d5a('0x39')](_0x1d78be,_0x55aa72,util[_0x8d5a('0x1c')](_0x8d5a('0x3b'),_0x55aa72,_0x27deab,'pdf'));}else{_0x4140f8=path['join'](_0x1d78be,util['format'](_0x8d5a('0x3c'),_0x55aa72,_0x8d5a('0x3d')));}_0x7776bc[_0x8d5a('0x17')](writePDFDocument(_0x2dd490,_0x4140f8));}return Promise[_0x8d5a('0x3e')](_0x7776bc);})[_0x8d5a('0x2d')](function(){if(_0x3caa7f){return new Promise(function(_0x231c1e){zipdir(path[_0x8d5a('0x39')](_0x1d78be,_0x55aa72),{'saveTo':path[_0x8d5a('0x39')](_0x1d78be,util[_0x8d5a('0x1c')](_0x8d5a('0x3c'),_0x55aa72,_0x8d5a('0x3f')))},function(){rimraf(path[_0x8d5a('0x39')](_0x1d78be,_0x55aa72),function(){});_0x231c1e(_0x8d5a('0x40'));});});}})[_0x8d5a('0x2d')](function(){if(!_0x3caa7f)return;rimraf(path['join'](_0x1d78be,_0x55aa72),function(){});})['then'](function(){logger[_0x8d5a('0x41')](util['format'](_0x8d5a('0x42'),EXTRACTED_REPORT_ID,_0x8d5a('0x43')));return analyticExtractedReport(_0x8d5a('0x44'),_0x3caa7f?util[_0x8d5a('0x1c')](_0x8d5a('0x3c'),_0x55aa72,_0x3caa7f?_0x8d5a('0x3f'):_0x8d5a('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8d5a('0x41')](util[_0x8d5a('0x1c')](_0x8d5a('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x8d5a('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8d5a('0x2d')](function(_0x1bdccf){EXTRACTED_REPORT=_0x1bdccf;return dbH[_0x8d5a('0x30')]['query'](util[_0x8d5a('0x1c')](_0x8d5a('0x47'),QUERY),{'type':dbH[_0x8d5a('0x30')]['QueryTypes'][_0x8d5a('0x34')]});})[_0x8d5a('0x2d')](extractReport)[_0x8d5a('0x48')](function(_0x4ae401){logger['info'](util[_0x8d5a('0x1c')](_0x8d5a('0x49'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x4ae401,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x46c990=new PdfPrinter({'Arial':{'normal':__dirname+_0x8d5a('0x4a'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8d5a('0x4b'),'bolditalics':__dirname+_0x8d5a('0x4c')}});return _0x46c990;}function getPDFDocDefinitionFromHTML(_0x2fe290,_0x1cd991){var _0x42341a=util['format'](_0x8d5a('0x4d'),_0x1cd991[_0x8d5a('0x4e')],_0x1cd991[_0x8d5a('0x4f')]);var _0x4a8ac0=moment()[_0x8d5a('0x1c')](_0x8d5a('0x50'))[_0x8d5a('0x13')]();var _0x37f13d=htmlToPdfmake(_0x2fe290,{'window':window,'tableAutoSize':!![]});return{'content':[_0x37f13d],'defaultStyle':{'font':_0x8d5a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8d5a('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8d5a('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8d5a('0x51')}},'header':function(){return[{'text':_0x8d5a('0x52'),'style':_0x8d5a('0x1e')}];},'footer':function(_0x4a37d1,_0x31ab67){return[{'text':util[_0x8d5a('0x1c')](_0x8d5a('0x53'),_0x42341a,_0x4a37d1,_0x31ab67,_0x4a8ac0),'style':_0x8d5a('0x24')}];}};}function writePDFDocument(_0x5ab928,_0x49a8d5){return new Promise(function(_0x2bd98a,_0x3307b7){var _0x3ad9b1=_0x5ab928['pipe'](fs[_0x8d5a('0x54')](_0x49a8d5));_0x3ad9b1['on'](_0x8d5a('0x55'),function(){_0x2bd98a(_0x8d5a('0x55'));});_0x3ad9b1['on'](_0x8d5a('0x56'),function(_0x3a0833){_0x3307b7(_0x3a0833);});_0x5ab928[_0x8d5a('0x57')]();});}exports[_0x8d5a('0x58')]=function(_0x4521e8,_0xa8f8c6){var _0x9e159f=getPDFPrinter();var _0x34e77a=getPDFDocDefinitionFromHTML(_0x4521e8,_0xa8f8c6);var _0x26ef00=_0x9e159f[_0x8d5a('0x3a')](_0x34e77a);return writePDFDocument(_0x26ef00,_0xa8f8c6[_0x8d5a('0x59')])[_0x8d5a('0x48')](function(_0xbdee25){throw _0xbdee25;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 051f8eb..d59a85c 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 _0x2c91=['num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','format','Empty','length','range'];(function(_0x17667c,_0x217e6e){var _0x4b35c3=function(_0x4abed1){while(--_0x4abed1){_0x17667c['push'](_0x17667c['shift']());}};_0x4b35c3(++_0x217e6e);}(_0x2c91,0x158));var _0x12c9=function(_0x399eef,_0x248e70){_0x399eef=_0x399eef-0x0;var _0x1cbe04=_0x2c91[_0x399eef];return _0x1cbe04;};'use strict';var util=require(_0x12c9('0x0'));var path=require(_0x12c9('0x1'));var _=require(_0x12c9('0x2'));var fs=require('fs');var json2xls=require(_0x12c9('0x3'));var BPromise=require(_0x12c9('0x4'));var zipdir=require(_0x12c9('0x5'));var rimraf=require(_0x12c9('0x6'));var db=require(_0x12c9('0x7'))['db'];var dbH=require('../../mysqldb')[_0x12c9('0x8')];var logger=require(_0x12c9('0x9'))(_0x12c9('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x12c9('0xb')][0x2]);var QUERY=process[_0x12c9('0xb')][0x3];var PATH=process[_0x12c9('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3e30ed,_0x55c40a){var _0x283633={'status':_0x3e30ed};var _0x2cbffe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x55c40a){_0x283633['savename']=_0x55c40a;}return db[_0x12c9('0xc')][_0x12c9('0xd')](_0x283633,_0x2cbffe);}function main(){var _0x4fa1de=0x1388;var _0x6addcf;logger[_0x12c9('0xe')](util['format'](_0x12c9('0xf'),EXTRACTED_REPORT_ID,_0x12c9('0x10')));return db['Setting'][_0x12c9('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x12c9('0x12'),_0x12c9('0x13')]})[_0x12c9('0x14')](function(_0x278da5){if(_0x278da5){_0x6addcf=_0x278da5;_0x4fa1de=_0x6addcf[_0x12c9('0x13')]||0x1388;}})['then'](function(){return dbH[_0x12c9('0x15')][_0x12c9('0x16')](util[_0x12c9('0x17')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](function(_0x9fa35){if(!_0x9fa35[0x0]['num']){return analyticExtractedReport(_0x12c9('0x18'));}var _0x4460d5=[];var _0x1d7716=0x0;if(_0x6addcf[_0x12c9('0x12')]){if(_0x9fa35&&_0x9fa35[_0x12c9('0x19')]){var _0x529a6a=_[_0x12c9('0x1a')](_0x9fa35[0x0][_0x12c9('0x1b')]/_0x4fa1de);var _0x1890d4=Number[_0x12c9('0x1c')](_0x9fa35[0x0][_0x12c9('0x1b')]/_0x4fa1de)?_0x9fa35[0x0][_0x12c9('0x1b')]%_0x4fa1de:0x0;_0x529a6a[_0x12c9('0x1d')](function(_0x374cf7){if(_0x374cf7>0x0){_0x1d7716+=_0x4fa1de;}_0x4460d5['push'](dbH[_0x12c9('0x15')]['query'](util[_0x12c9('0x17')](_0x12c9('0x1e'),QUERY,_0x4fa1de,_0x1d7716),{'type':dbH[_0x12c9('0x15')][_0x12c9('0x1f')][_0x12c9('0x20')]}));});if(_0x1890d4>0x0){_0x1d7716+=_0x4fa1de;_0x4460d5['push'](dbH[_0x12c9('0x15')][_0x12c9('0x16')](util[_0x12c9('0x17')](_0x12c9('0x1e'),QUERY,_0x1890d4,_0x1d7716),{'type':dbH[_0x12c9('0x15')][_0x12c9('0x1f')][_0x12c9('0x20')]}));}}}else{_0x4460d5[_0x12c9('0x21')](dbH[_0x12c9('0x15')][_0x12c9('0x16')](QUERY,{'type':dbH[_0x12c9('0x15')]['QueryTypes'][_0x12c9('0x20')]}));}var _0x1599a8=path[_0x12c9('0x22')](PATH);var _0x1aa6a8=path[_0x12c9('0x23')](PATH,_0x12c9('0x24'));var _0x2f03be=_0x6addcf[_0x12c9('0x12')]&&_0x4460d5[_0x12c9('0x19')]>0x1;var _0x3ed911=[];if(!fs[_0x12c9('0x25')](path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8))&&_0x2f03be){fs[_0x12c9('0x27')](path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8));}return BPromise[_0x12c9('0x28')](_0x4460d5,function(_0x4141db){_0x3ed911[_0x12c9('0x21')](_0x4141db);})[_0x12c9('0x14')](function(){for(var _0x9a8f1e=0x0;_0x9a8f1e<_0x3ed911[_0x12c9('0x19')];_0x9a8f1e+=0x1){var _0x5c02fb;var _0x44636d=_0x3ed911[_0x9a8f1e];if(_0x2f03be){_0x5c02fb=path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8,util[_0x12c9('0x17')](_0x12c9('0x29'),_0x1aa6a8,_0x9a8f1e,_0x12c9('0x2a')));}else{_0x5c02fb=path[_0x12c9('0x26')](_0x1599a8,util[_0x12c9('0x17')]('%s.%s',_0x1aa6a8,_0x12c9('0x2a')));}fs[_0x12c9('0x2b')](_0x5c02fb,json2xls(_0x44636d),_0x12c9('0x2c'));}})[_0x12c9('0x14')](function(){if(_0x2f03be){return new Promise(function(_0x34ff2e){zipdir(path['join'](_0x1599a8,_0x1aa6a8),{'saveTo':path[_0x12c9('0x26')](_0x1599a8,util['format'](_0x12c9('0x2d'),_0x1aa6a8,_0x12c9('0x2e')))},function(_0x1763fd,_0xadd087){rimraf(path[_0x12c9('0x26')](_0x1599a8,_0x1aa6a8),function(){});_0x34ff2e(_0x12c9('0x2f'));});});}})[_0x12c9('0x14')](function(){logger[_0x12c9('0xe')](util[_0x12c9('0x17')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x12c9('0x30'),_0x2f03be?util[_0x12c9('0x17')](_0x12c9('0x2d'),_0x1aa6a8,_0x2f03be?_0x12c9('0x2e'):_0x12c9('0x2a')):null);});})[_0x12c9('0x31')](function(_0x410841){logger['info'](util[_0x12c9('0x17')](_0x12c9('0x32'),EXTRACTED_REPORT_ID,_0x12c9('0x10')),util['inspect'](_0x410841,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x12c9('0x33'));})[_0x12c9('0x34')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1794=['../../mysqldb','argv','savename','AnalyticExtractedReport','update','format','Setting','find','split','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','XLSX','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf'];(function(_0x7a3220,_0x1c9e8d){var _0x4801cc=function(_0xcd000f){while(--_0xcd000f){_0x7a3220['push'](_0x7a3220['shift']());}};_0x4801cc(++_0x1c9e8d);}(_0x1794,0xc2));var _0x4179=function(_0x2256c9,_0x5c97a7){_0x2256c9=_0x2256c9-0x0;var _0x27ec38=_0x1794[_0x2256c9];return _0x27ec38;};'use strict';var util=require('util');var path=require(_0x4179('0x0'));var _=require(_0x4179('0x1'));var fs=require('fs');var json2xls=require(_0x4179('0x2'));var BPromise=require(_0x4179('0x3'));var zipdir=require(_0x4179('0x4'));var rimraf=require(_0x4179('0x5'));var db=require(_0x4179('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x4179('0x7')][0x3];var PATH=process[_0x4179('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xbde556,_0x33b0cc){var _0x27d570={'status':_0xbde556};var _0x1a708c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x33b0cc){_0x27d570[_0x4179('0x8')]=_0x33b0cc;}return db[_0x4179('0x9')][_0x4179('0xa')](_0x27d570,_0x1a708c);}function main(){var _0xe7c563=0x1388;var _0x2c9578;logger['info'](util[_0x4179('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4179('0xc')][_0x4179('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4179('0xe'),'splitSizeXlsx']})[_0x4179('0xf')](function(_0x2bb05a){if(_0x2bb05a){_0x2c9578=_0x2bb05a;_0xe7c563=_0x2c9578['splitSizeXlsx']||0x1388;}})[_0x4179('0xf')](function(){return dbH[_0x4179('0x10')][_0x4179('0x11')](util['format'](_0x4179('0x12'),QUERY),{'type':dbH['sequelize'][_0x4179('0x13')][_0x4179('0x14')]});})[_0x4179('0xf')](function(_0x36e28d){if(!_0x36e28d[0x0][_0x4179('0x15')]){return analyticExtractedReport(_0x4179('0x16'));}var _0x2d90f2=[];var _0x453be7=0x0;if(_0x2c9578[_0x4179('0xe')]){if(_0x36e28d&&_0x36e28d[_0x4179('0x17')]){var _0x30b6e9=_[_0x4179('0x18')](_0x36e28d[0x0][_0x4179('0x15')]/_0xe7c563);var _0x43211d=Number[_0x4179('0x19')](_0x36e28d[0x0][_0x4179('0x15')]/_0xe7c563)?_0x36e28d[0x0][_0x4179('0x15')]%_0xe7c563:0x0;_0x30b6e9[_0x4179('0x1a')](function(_0x262876){if(_0x262876>0x0){_0x453be7+=_0xe7c563;}_0x2d90f2[_0x4179('0x1b')](dbH[_0x4179('0x10')][_0x4179('0x11')](util[_0x4179('0xb')](_0x4179('0x1c'),QUERY,_0xe7c563,_0x453be7),{'type':dbH['sequelize'][_0x4179('0x13')][_0x4179('0x14')]}));});if(_0x43211d>0x0){_0x453be7+=_0xe7c563;_0x2d90f2[_0x4179('0x1b')](dbH[_0x4179('0x10')][_0x4179('0x11')](util[_0x4179('0xb')](_0x4179('0x1c'),QUERY,_0x43211d,_0x453be7),{'type':dbH[_0x4179('0x10')]['QueryTypes'][_0x4179('0x14')]}));}}}else{_0x2d90f2[_0x4179('0x1b')](dbH[_0x4179('0x10')][_0x4179('0x11')](QUERY,{'type':dbH['sequelize'][_0x4179('0x13')][_0x4179('0x14')]}));}var _0xbd76cc=path[_0x4179('0x1d')](PATH);var _0x1f0426=path[_0x4179('0x1e')](PATH,_0x4179('0x1f'));var _0x1ced3d=_0x2c9578['split']&&_0x2d90f2[_0x4179('0x17')]>0x1;var _0x275d28=[];if(!fs[_0x4179('0x20')](path[_0x4179('0x21')](_0xbd76cc,_0x1f0426))&&_0x1ced3d){fs[_0x4179('0x22')](path[_0x4179('0x21')](_0xbd76cc,_0x1f0426));}return BPromise[_0x4179('0x23')](_0x2d90f2,function(_0x58f2a7){_0x275d28[_0x4179('0x1b')](_0x58f2a7);})[_0x4179('0xf')](function(){for(var _0x5ee7b1=0x0;_0x5ee7b1<_0x275d28['length'];_0x5ee7b1+=0x1){var _0x2d1cf4;var _0x146efa=_0x275d28[_0x5ee7b1];if(_0x1ced3d){_0x2d1cf4=path[_0x4179('0x21')](_0xbd76cc,_0x1f0426,util['format'](_0x4179('0x24'),_0x1f0426,_0x5ee7b1,_0x4179('0x25')));}else{_0x2d1cf4=path[_0x4179('0x21')](_0xbd76cc,util[_0x4179('0xb')]('%s.%s',_0x1f0426,_0x4179('0x25')));}fs[_0x4179('0x26')](_0x2d1cf4,json2xls(_0x146efa),_0x4179('0x27'));}})[_0x4179('0xf')](function(){if(_0x1ced3d){return new Promise(function(_0x2228fc){zipdir(path[_0x4179('0x21')](_0xbd76cc,_0x1f0426),{'saveTo':path[_0x4179('0x21')](_0xbd76cc,util['format'](_0x4179('0x28'),_0x1f0426,_0x4179('0x29')))},function(_0x59240b,_0x3d255b){rimraf(path[_0x4179('0x21')](_0xbd76cc,_0x1f0426),function(){});_0x2228fc(_0x4179('0x2a'));});});}})[_0x4179('0xf')](function(){logger['info'](util[_0x4179('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x4179('0x2b')));return analyticExtractedReport(_0x4179('0x2c'),_0x1ced3d?util[_0x4179('0xb')](_0x4179('0x28'),_0x1f0426,_0x1ced3d?_0x4179('0x29'):_0x4179('0x25')):null);});})[_0x4179('0x2d')](function(_0x1cfbd7){logger[_0x4179('0x2e')](util[_0x4179('0xb')](_0x4179('0x2f'),EXTRACTED_REPORT_ID,_0x4179('0x2b')),util['inspect'](_0x1cfbd7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4179('0x30'));})[_0x4179('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 407a3e3..9d2ece8 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 _0x254d=['bulkCreate','sortBy','catch','error','lodash','util','Interval','findAll','then','intervals','VoiceExtension','IntervalId','models','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','find','extensions','CDR(type)=%s','type','context','priority','push','Set','CDR(routeid)=','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','indexOf','appType','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup'];(function(_0x4c6e7b,_0x46d268){var _0x436174=function(_0x5c64b9){while(--_0x5c64b9){_0x4c6e7b['push'](_0x4c6e7b['shift']());}};_0x436174(++_0x46d268);}(_0x254d,0x8a));var _0xd254=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x254d[_0x26bf51];return _0x503415;};'use strict';var _=require(_0xd254('0x0'));var util=require(_0xd254('0x1'));function rewrite(_0x117fc0,_0x127b0e){var _0x443d23=this;return _0x117fc0['models'][_0xd254('0x2')][_0xd254('0x3')]({'raw':!![]})[_0xd254('0x4')](function(_0x1447a8){_0x443d23[_0xd254('0x5')]=_0x1447a8;return _0x117fc0['models'][_0xd254('0x6')][_0xd254('0x3')]({'where':{'IntervalId':_0x127b0e[_0xd254('0x7')]},'raw':!![]});})[_0xd254('0x4')](function(_0x3fccc7){return _0x117fc0[_0xd254('0x8')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x3fccc7,'exten'))}},'order':[{'raw':_0xd254('0x9')}],'raw':!![]});})['then'](function(_0x2eec2d){var _0x343cf8=_[_0xd254('0xa')](_0x2eec2d,{'priority':'1'});var _0x5117a1=_['filter'](_0x2eec2d,{'isApp':0x1});var _0x4151b4=_[_0xd254('0xb')](_0x5117a1,_0xd254('0xc'));var _0x3d18a9=[_0xd254('0xd'),_0xd254('0xe')];var _0x3a192d=[];var _0xde587c=[];for(var _0x195125 in _0x4151b4){if(_0x4151b4[_0xd254('0xf')](_0x195125)){_0x443d23['priority']=0x2;_0x443d23['extensions']=[];_0x443d23['extension']=_[_0xd254('0x10')](_0x343cf8,{'exten':_0x4151b4[_0x195125][0x0]['exten']});_0x443d23[_0xd254('0x11')]['push']({'type':_0x4151b4[_0x195125][0x0]['type'],'app':'Set','appdata':util['format'](_0xd254('0x12'),_0x4151b4[_0x195125][0x0][_0xd254('0x13')]),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});if(_0x4151b4[_0x195125][0x0]['type']==='inbound'){_0x443d23['extensions'][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x18')+_0x4151b4[_0x195125][0x0][_0xd254('0x19')],'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}else if(_0x4151b4[_0x195125][0x0][_0xd254('0x13')]===_0xd254('0x1a')){if(_0x443d23[_0xd254('0x1b')]){_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x1c')+(_0x443d23['extension'][_0xd254('0x1d')]?_0xd254('0x1e')+_0x443d23['extension'][_0xd254('0x1d')]+'}':'${EXTEN}'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':_0xd254('0x17'),'appdata':_0xd254('0x18')+_0x4151b4[_0x195125][0x0][_0xd254('0x19')],'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});var _0x24cb55=_0x443d23[_0xd254('0x15')]++;_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x1f'),'appdata':_0xd254('0x20')+(_0x24cb55+0x2)+'):Goto('+(_0x24cb55+0x1)+')','context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x24cb55,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});if(_0x443d23[_0xd254('0x1b')]){_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':'Set','appdata':_0x443d23[_0xd254('0x1b')]['cutdigits']?_0xd254('0x21')+_0x443d23[_0xd254('0x1b')][_0xd254('0x1d')]+'}':_0xd254('0x22'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});}_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':_0xd254('0x17'),'appdata':'outboundrouteid='+_0x4151b4[_0x195125][0x0][_0xd254('0x19')],'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});if(_0x443d23[_0xd254('0x1b')]&&_0x443d23[_0xd254('0x1b')][_0xd254('0xf')](_0xd254('0x23'))&&_0x443d23[_0xd254('0x1b')][_0xd254('0x23')]!==_0xd254('0x24')){_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x25'),'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':_0xd254('0x17'),'appdata':_0xd254('0x26')+_0x443d23[_0xd254('0x1b')][_0xd254('0x23')]||_0xd254('0x27'),'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}}_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x28'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23[_0xd254('0x15')]++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':'Set','appdata':_0xd254('0x29'),'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});_0x443d23[_0xd254('0x11')][_0xd254('0x16')]({'type':_0x4151b4[_0x195125][0x0]['type'],'app':'Set','appdata':_0xd254('0x2a'),'context':_0x4151b4[_0x195125][0x0]['context'],'exten':_0x4151b4[_0x195125][0x0]['exten'],'priority':_0x443d23['priority']++,'VoiceExtensionId':_0x4151b4[_0x195125][0x0]['VoiceExtensionId']});for(var _0x177020=0x0,_0x3ef068=0x0;_0x177020<_0x4151b4[_0x195125][_0xd254('0x2b')];_0x177020+=0x1,_0x3ef068=0x0){var _0x2f642d=_0x4151b4[_0x195125][_0x177020];if(_0x2f642d[_0xd254('0x13')]){_0x2f642d['type']=_0x2f642d[_0xd254('0x13')][_0xd254('0x2c')]();}var _0x200264=[];var _0x1b952f=[];delete _0x2f642d['id'];delete _0x2f642d[_0xd254('0x2d')];delete _0x2f642d['updatedAt'];var _0x53ee5d=_0x2f642d[_0xd254('0x2e')]!==_0xd254('0x2f')?[_0x2f642d[_0xd254('0x2e')]]:_0x2f642d[_0xd254('0x7')]?_[_0xd254('0x30')](_[_0xd254('0xa')](_0x443d23[_0xd254('0x5')],{'IntervalId':_0x2f642d['IntervalId']}),_0xd254('0x2e')):[];if(_0x2f642d['hasOwnProperty']('tag')){if(_0x2f642d['tag']&&_0x2f642d[_0xd254('0x31')]!=='--'){_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x32')+_0x2f642d['tag'],'context':_0x2f642d['context'],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d['VoiceExtensionId']});}}if(_0x2f642d[_0xd254('0x13')]===_0xd254('0x1a')&&_0x2f642d[_0xd254('0xf')](_0xd254('0x33'))){if(_0x2f642d[_0xd254('0x33')]){_0x200264['push']({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2f642d[_0xd254('0x33')]+')','context':_0x2f642d['context'],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23['priority']+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});}else{_0x200264[_0xd254('0x16')]({'type':_0x2f642d['type'],'app':_0xd254('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d['exten'],'priority':_0x53ee5d[_0xd254('0x2b')]+_0x443d23['priority']+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});}}if(_0x2f642d[_0xd254('0xf')]('answer')){if(_0x3d18a9[_0xd254('0x34')](_0x2f642d['app'][_0xd254('0x2c')]())>=0x0&&_0x2f642d[_0xd254('0x35')]!=='custom'){if(_0x2f642d[_0xd254('0x36')]){_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});_0x200264['push']({'type':_0x2f642d['type'],'app':_0xd254('0x17'),'appdata':_0xd254('0x37'),'context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23['priority']+_0x3ef068++,'VoiceExtensionId':_0x2f642d['VoiceExtensionId']});}else{_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x1f'),'appdata':_0xd254('0x38'),'context':_0x2f642d['context'],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d[_0xd254('0x2b')]+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});_0x200264[_0xd254('0x16')]({'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x17'),'appdata':_0xd254('0x39'),'context':_0x2f642d[_0xd254('0x14')],'exten':_0x2f642d[_0xd254('0xc')],'priority':_0x53ee5d['length']+_0x443d23[_0xd254('0x15')]+_0x3ef068++,'VoiceExtensionId':_0x2f642d[_0xd254('0x19')]});}}}for(var _0x501d65=0x0;_0x501d65<_0x53ee5d[_0xd254('0x2b')];_0x501d65+=0x1){var _0x2d6066=_0x443d23[_0xd254('0x15')]+_0x53ee5d[_0xd254('0x2b')];var _0x3dcae6=_0x501d65===_0x53ee5d[_0xd254('0x2b')]-0x1?_0x443d23['priority']+_0x200264[_0xd254('0x2b')]+_0x1b952f[_0xd254('0x2b')]+0x2:_0x443d23[_0xd254('0x15')]+_0x501d65+0x1;_0x200264['splice'](_0x501d65,0x0,{'type':_0x2f642d[_0xd254('0x13')],'app':_0xd254('0x3a'),'appdata':_0x53ee5d[_0x501d65]+'?'+_0x2f642d[_0xd254('0x14')]+',${EXTEN},'+_0x2d6066+':'+_0x2f642d[_0xd254('0x14')]+_0xd254('0x3b')+_0x3dcae6,'exten':_0x2f642d[_0xd254('0xc')],'context':_0x2f642d[_0xd254('0x14')],'priority':_0x443d23['priority']+_0x501d65,'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});}_0x2f642d[_0xd254('0x15')]=_0x200264['length']?_[_0xd254('0x3c')](_0x200264)[_0xd254('0x15')]+0x1:_0x443d23[_0xd254('0x15')];_0x443d23[_0xd254('0x15')]=(_0x1b952f[_0xd254('0x2b')]?_[_0xd254('0x3c')](_0x1b952f)[_0xd254('0x15')]:_0x2f642d[_0xd254('0x15')])+0x1;_0x443d23[_0xd254('0x11')]=_[_0xd254('0x3d')](_0x443d23['extensions'],_0x200264,[_0x2f642d],_0x1b952f);}_0x443d23[_0xd254('0x11')]['push']({'type':_0x4151b4[_0x195125][0x0][_0xd254('0x13')],'app':_0xd254('0x3e'),'exten':_0x4151b4[_0x195125][0x0][_0xd254('0xc')],'context':_0x4151b4[_0x195125][0x0][_0xd254('0x14')],'priority':_0x443d23[_0xd254('0x15')],'VoiceExtensionId':_0x4151b4[_0x195125][0x0][_0xd254('0x19')]});_0x3a192d[_0xd254('0x16')](_0x4151b4[_0x195125][0x0][_0xd254('0x19')]);_0xde587c=_[_0xd254('0x3d')](_0xde587c,_0x443d23['extensions']);}}return _0x117fc0['transaction'](function(_0x43dbe6){return _0x117fc0[_0xd254('0x8')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3a192d}},'transaction':_0x43dbe6})[_0xd254('0x4')](function(_0x5defcc){return _0x117fc0[_0xd254('0x8')][_0xd254('0x6')][_0xd254('0x3f')](_[_0xd254('0x40')](_0xde587c,_0xd254('0x15')),{'transaction':_0x43dbe6});});});})[_0xd254('0x41')](function(_0x3a587f){console[_0xd254('0x42')](_0x3a587f);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xc1fd=['bulkCreate','sortBy','error','rewrite','util','Interval','findAll','then','intervals','models','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','extensions','extension','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','push','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','concat','transaction','destroy'];(function(_0x1b0661,_0x6816b1){var _0x3b94d1=function(_0x4d3d75){while(--_0x4d3d75){_0x1b0661['push'](_0x1b0661['shift']());}};_0x3b94d1(++_0x6816b1);}(_0xc1fd,0x1ae));var _0xdc1f=function(_0x2784b8,_0x989cac){_0x2784b8=_0x2784b8-0x0;var _0xbde0da=_0xc1fd[_0x2784b8];return _0xbde0da;};'use strict';var _=require('lodash');var util=require(_0xdc1f('0x0'));function rewrite(_0x5d5e09,_0x5783e2){var _0x429447=this;return _0x5d5e09['models'][_0xdc1f('0x1')][_0xdc1f('0x2')]({'raw':!![]})[_0xdc1f('0x3')](function(_0x1aa12f){_0x429447[_0xdc1f('0x4')]=_0x1aa12f;return _0x5d5e09[_0xdc1f('0x5')][_0xdc1f('0x6')]['findAll']({'where':{'IntervalId':_0x5783e2['IntervalId']},'raw':!![]});})['then'](function(_0xa47cf3){return _0x5d5e09[_0xdc1f('0x5')][_0xdc1f('0x6')][_0xdc1f('0x2')]({'where':{'exten':{'$in':_[_0xdc1f('0x7')](_[_0xdc1f('0x8')](_0xa47cf3,_0xdc1f('0x9')))}},'order':[{'raw':_0xdc1f('0xa')}],'raw':!![]});})[_0xdc1f('0x3')](function(_0x4cb2c2){var _0xbe3230=_['filter'](_0x4cb2c2,{'priority':'1'});var _0x2ea05c=_[_0xdc1f('0xb')](_0x4cb2c2,{'isApp':0x1});var _0x416c7d=_[_0xdc1f('0xc')](_0x2ea05c,_0xdc1f('0x9'));var _0x4eafdf=[_0xdc1f('0xd'),_0xdc1f('0xe')];var _0x4070da=[];var _0x36d2e3=[];for(var _0x39ae3f in _0x416c7d){if(_0x416c7d['hasOwnProperty'](_0x39ae3f)){_0x429447['priority']=0x2;_0x429447[_0xdc1f('0xf')]=[];_0x429447[_0xdc1f('0x10')]=_['find'](_0xbe3230,{'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')]});_0x429447['extensions']['push']({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':util[_0xdc1f('0x13')](_0xdc1f('0x14'),_0x416c7d[_0x39ae3f][0x0]['type']),'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});if(_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')]===_0xdc1f('0x18')){_0x429447['extensions']['push']({'type':_0x416c7d[_0x39ae3f][0x0]['type'],'app':'Set','appdata':_0xdc1f('0x19')+_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')],'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0]['exten'],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});}else if(_0x416c7d[_0x39ae3f][0x0]['type']===_0xdc1f('0x1a')){if(_0x429447[_0xdc1f('0x10')]){_0x429447[_0xdc1f('0xf')]['push']({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':'Set','appdata':_0xdc1f('0x1b')+(_0x429447[_0xdc1f('0x10')][_0xdc1f('0x1c')]?_0xdc1f('0x1d')+_0x429447[_0xdc1f('0x10')][_0xdc1f('0x1c')]+'}':_0xdc1f('0x1e')),'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0]['exten'],'priority':_0x429447['priority']++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});}_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':_0xdc1f('0x19')+_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')],'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x429447['priority']++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});var _0x38f0f5=_0x429447[_0xdc1f('0x16')]++;_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0]['type'],'app':_0xdc1f('0x20'),'appdata':_0xdc1f('0x21')+(_0x38f0f5+0x2)+_0xdc1f('0x22')+(_0x38f0f5+0x1)+')','context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x38f0f5,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0]['VoiceExtensionId']});if(_0x429447[_0xdc1f('0x10')]){_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':_0x429447[_0xdc1f('0x10')]['cutdigits']?_0xdc1f('0x23')+_0x429447[_0xdc1f('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x416c7d[_0x39ae3f][0x0]['context'],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});}_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':'Set','appdata':_0xdc1f('0x24')+_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')],'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0]['exten'],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});if(_0x429447[_0xdc1f('0x10')]&&_0x429447[_0xdc1f('0x10')][_0xdc1f('0x25')]('recordingFormat')&&_0x429447['extension'][_0xdc1f('0x26')]!==_0xdc1f('0x27')){_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':_0xdc1f('0x28'),'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0]['exten'],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':'Set','appdata':_0xdc1f('0x29')+_0x429447[_0xdc1f('0x10')]['recordingFormat']||_0xdc1f('0x2a'),'context':_0x416c7d[_0x39ae3f][0x0]['context'],'exten':_0x416c7d[_0x39ae3f][0x0]['exten'],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});}}_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':_0xdc1f('0x2b'),'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});_0x429447[_0xdc1f('0xf')]['push']({'type':_0x416c7d[_0x39ae3f][0x0]['type'],'app':_0xdc1f('0x12'),'appdata':_0xdc1f('0x2c'),'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'priority':_0x429447[_0xdc1f('0x16')]++,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});for(var _0x4219f1=0x0,_0x588967=0x0;_0x4219f1<_0x416c7d[_0x39ae3f][_0xdc1f('0x2d')];_0x4219f1+=0x1,_0x588967=0x0){var _0xf7af58=_0x416c7d[_0x39ae3f][_0x4219f1];if(_0xf7af58['type']){_0xf7af58[_0xdc1f('0x11')]=_0xf7af58[_0xdc1f('0x11')][_0xdc1f('0x2e')]();}var _0x2b28f2=[];var _0x21f233=[];delete _0xf7af58['id'];delete _0xf7af58[_0xdc1f('0x2f')];delete _0xf7af58['updatedAt'];var _0xbbd8ec=_0xf7af58[_0xdc1f('0x30')]!=='*,*,*,*'?[_0xf7af58['interval']]:_0xf7af58[_0xdc1f('0x31')]?_['map'](_[_0xdc1f('0xb')](_0x429447[_0xdc1f('0x4')],{'IntervalId':_0xf7af58['IntervalId']}),_0xdc1f('0x30')):[];if(_0xf7af58[_0xdc1f('0x25')](_0xdc1f('0x32'))){if(_0xf7af58['tag']&&_0xf7af58['tag']!=='--'){_0x2b28f2[_0xdc1f('0x1f')]({'type':_0xf7af58[_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':_0xdc1f('0x33')+_0xf7af58[_0xdc1f('0x32')],'context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58['exten'],'priority':_0xbbd8ec[_0xdc1f('0x2d')]+_0x429447['priority']+_0x588967++,'VoiceExtensionId':_0xf7af58[_0xdc1f('0x17')]});}}if(_0xf7af58['type']===_0xdc1f('0x1a')&&_0xf7af58['hasOwnProperty']('callerID')){if(_0xf7af58[_0xdc1f('0x34')]){_0x2b28f2[_0xdc1f('0x1f')]({'type':_0xf7af58[_0xdc1f('0x11')],'app':_0xdc1f('0x20'),'appdata':_0xdc1f('0x35')+_0xf7af58['callerID']+')','context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58['exten'],'priority':_0xbbd8ec[_0xdc1f('0x2d')]+_0x429447[_0xdc1f('0x16')]+_0x588967++,'VoiceExtensionId':_0xf7af58[_0xdc1f('0x17')]});}else{_0x2b28f2['push']({'type':_0xf7af58[_0xdc1f('0x11')],'app':_0xdc1f('0x20'),'appdata':_0xdc1f('0x36'),'context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58[_0xdc1f('0x9')],'priority':_0xbbd8ec[_0xdc1f('0x2d')]+_0x429447[_0xdc1f('0x16')]+_0x588967++,'VoiceExtensionId':_0xf7af58['VoiceExtensionId']});}}if(_0xf7af58[_0xdc1f('0x25')](_0xdc1f('0x37'))){if(_0x4eafdf[_0xdc1f('0x38')](_0xf7af58['app'][_0xdc1f('0x2e')]())>=0x0&&_0xf7af58[_0xdc1f('0x39')]!=='custom'){if(_0xf7af58[_0xdc1f('0x37')]){_0x2b28f2['push']({'type':_0xf7af58[_0xdc1f('0x11')],'app':'ExecIf','appdata':_0xdc1f('0x3a'),'context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58[_0xdc1f('0x9')],'priority':_0xbbd8ec[_0xdc1f('0x2d')]+_0x429447[_0xdc1f('0x16')]+_0x588967++,'VoiceExtensionId':_0xf7af58[_0xdc1f('0x17')]});_0x2b28f2[_0xdc1f('0x1f')]({'type':_0xf7af58[_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58[_0xdc1f('0x9')],'priority':_0xbbd8ec[_0xdc1f('0x2d')]+_0x429447[_0xdc1f('0x16')]+_0x588967++,'VoiceExtensionId':_0xf7af58['VoiceExtensionId']});}else{_0x2b28f2[_0xdc1f('0x1f')]({'type':_0xf7af58['type'],'app':_0xdc1f('0x20'),'appdata':_0xdc1f('0x3b'),'context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58['exten'],'priority':_0xbbd8ec[_0xdc1f('0x2d')]+_0x429447[_0xdc1f('0x16')]+_0x588967++,'VoiceExtensionId':_0xf7af58[_0xdc1f('0x17')]});_0x2b28f2[_0xdc1f('0x1f')]({'type':_0xf7af58[_0xdc1f('0x11')],'app':_0xdc1f('0x12'),'appdata':_0xdc1f('0x3c'),'context':_0xf7af58[_0xdc1f('0x15')],'exten':_0xf7af58[_0xdc1f('0x9')],'priority':_0xbbd8ec['length']+_0x429447[_0xdc1f('0x16')]+_0x588967++,'VoiceExtensionId':_0xf7af58['VoiceExtensionId']});}}}for(var _0xfa6e17=0x0;_0xfa6e17<_0xbbd8ec['length'];_0xfa6e17+=0x1){var _0x563c75=_0x429447[_0xdc1f('0x16')]+_0xbbd8ec[_0xdc1f('0x2d')];var _0x4d91ee=_0xfa6e17===_0xbbd8ec['length']-0x1?_0x429447[_0xdc1f('0x16')]+_0x2b28f2['length']+_0x21f233[_0xdc1f('0x2d')]+0x2:_0x429447[_0xdc1f('0x16')]+_0xfa6e17+0x1;_0x2b28f2[_0xdc1f('0x3d')](_0xfa6e17,0x0,{'type':_0xf7af58['type'],'app':_0xdc1f('0x3e'),'appdata':_0xbbd8ec[_0xfa6e17]+'?'+_0xf7af58[_0xdc1f('0x15')]+',${EXTEN},'+_0x563c75+':'+_0xf7af58[_0xdc1f('0x15')]+',${EXTEN},'+_0x4d91ee,'exten':_0xf7af58[_0xdc1f('0x9')],'context':_0xf7af58['context'],'priority':_0x429447[_0xdc1f('0x16')]+_0xfa6e17,'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0]['VoiceExtensionId']});}_0xf7af58[_0xdc1f('0x16')]=_0x2b28f2['length']?_['last'](_0x2b28f2)[_0xdc1f('0x16')]+0x1:_0x429447[_0xdc1f('0x16')];_0x429447['priority']=(_0x21f233[_0xdc1f('0x2d')]?_[_0xdc1f('0x3f')](_0x21f233)[_0xdc1f('0x16')]:_0xf7af58[_0xdc1f('0x16')])+0x1;_0x429447[_0xdc1f('0xf')]=_[_0xdc1f('0x40')](_0x429447[_0xdc1f('0xf')],_0x2b28f2,[_0xf7af58],_0x21f233);}_0x429447[_0xdc1f('0xf')][_0xdc1f('0x1f')]({'type':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x11')],'app':'Hangup','exten':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x9')],'context':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x15')],'priority':_0x429447[_0xdc1f('0x16')],'VoiceExtensionId':_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]});_0x4070da[_0xdc1f('0x1f')](_0x416c7d[_0x39ae3f][0x0][_0xdc1f('0x17')]);_0x36d2e3=_['concat'](_0x36d2e3,_0x429447['extensions']);}}return _0x5d5e09[_0xdc1f('0x41')](function(_0x61e8a8){return _0x5d5e09['models'][_0xdc1f('0x6')][_0xdc1f('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x4070da}},'transaction':_0x61e8a8})[_0xdc1f('0x3')](function(_0x5e76ab){return _0x5d5e09[_0xdc1f('0x5')][_0xdc1f('0x6')][_0xdc1f('0x43')](_[_0xdc1f('0x44')](_0x36d2e3,_0xdc1f('0x16')),{'transaction':_0x61e8a8});});});})['catch'](function(_0xb43eac){console[_0xdc1f('0x45')](_0xb43eac);});}exports[_0xdc1f('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 7f4df6a..7ac1fe3 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 _0x606e=['bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','map','message','hasOwnProperty','data','firstName','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','from','where','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','cm_hopper_final','str','VoiceQueue','findAll','dialCheckDuplicateType','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','outbound','CmList','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:'];(function(_0x4085c7,_0x1f0d36){var _0x18099f=function(_0x115b84){while(--_0x115b84){_0x4085c7['push'](_0x4085c7['shift']());}};_0x18099f(++_0x1f0d36);}(_0x606e,0x6c));var _0xe606=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x606e[_0x386c3e];return _0x4b8e13;};'use strict';var BPromise=require(_0xe606('0x0'));var util=require(_0xe606('0x1'));var _=require(_0xe606('0x2'));var fs=require('fs');var squel=require(_0xe606('0x3'));var Papa=require(_0xe606('0x4'));var Redis=require(_0xe606('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xe606('0x6'));var logger=require(_0xe606('0x7'))(_0xe606('0x8'));config['redis']=_[_0xe606('0x9')](config[_0xe606('0xa')],{'host':_0xe606('0xb'),'port':0x18eb});var socket=require(_0xe606('0xc'))(new Redis(config[_0xe606('0xa')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xe606('0xd')][0x2]||process[_0xe606('0xd')][0x2]===_0xe606('0xe')||process[_0xe606('0xd')][0x2]==='null'){throw new Error(_0xe606('0xf'));}var FILEPATH=process[_0xe606('0xd')][0x2];if(!process[_0xe606('0xd')][0x3]||process[_0xe606('0xd')][0x3]===_0xe606('0xe')||process[_0xe606('0xd')][0x3]===_0xe606('0x10')||!process[_0xe606('0xd')][0x4]||process[_0xe606('0xd')][0x4]===_0xe606('0xe')||process[_0xe606('0xd')][0x4]===_0xe606('0x10')){throw new Error(_0xe606('0x11'));}var FIELDS=_[_0xe606('0x12')](process[_0xe606('0xd')][0x3][_0xe606('0x13')](','),process['argv'][0x4][_0xe606('0x13')](','));if(!process[_0xe606('0xd')][0x5]||process[_0xe606('0xd')][0x5]==='undefined'||process[_0xe606('0xd')][0x5]===_0xe606('0x10')){throw new Error(_0xe606('0x14'));}var LISTID=process[_0xe606('0xd')][0x5];var COMPANYID=process[_0xe606('0xd')][0x6]&&process[_0xe606('0xd')][0x6]!=='undefined'&&process[_0xe606('0xd')][0x6]!=='null'?process[_0xe606('0xd')][0x6]:null;var DUPLICATES=process[_0xe606('0xd')][0x7]&&process[_0xe606('0xd')][0x7]!==_0xe606('0xe')&&process['argv'][0x7]!==_0xe606('0x10')?process['argv'][0x7]:null;if(!process[_0xe606('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xe606('0xd')][0x8]==='null'){throw new Error(_0xe606('0x15'));}var SOCKET_TIMESTAMP=process[_0xe606('0xd')][0x8];}catch(_0x396b57){logger[_0xe606('0x16')](_0x396b57);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x27197d,_0x3fd674,_0x536b6f,_0x4031ed){var _0xa9bb0b={'message':_0x3fd674};_0xa9bb0b[_0x27197d]=!![];if(_0x536b6f){_0xa9bb0b[_0xe606('0x17')]=_0x536b6f;}if(_0x4031ed){_0xa9bb0b['index']=_0x4031ed;}return _0xa9bb0b;}function isEmail(_0x34b8de){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xe606('0x18')](_0x34b8de);}function checkRow(_0x9cee08,_0x27f1ea,_0x2868f9){return new BPromise(function(_0x29b190,_0x207861){if(_[_0xe606('0x19')](_0x9cee08)){return _0x207861(handleCheckRowError(_0xe606('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x2868f9));}if(_0x9cee08[_0xe606('0x1a')]&&_0x9cee08[_0xe606('0x1a')]['length']){var _0x3713b1=_[_0xe606('0x1b')](_0x9cee08['errors'],_0xe606('0x1c'))['join'](';');return _0x207861(handleCheckRowError('error',_0x3713b1,null,_0x2868f9));}var _0x453848={};for(var _0x5632f0 in FIELDS){if(FIELDS[_0xe606('0x1d')](_0x5632f0)&&FIELDS[_0x5632f0]){_0x453848[_0x5632f0]=_0x9cee08['data'][0x0][FIELDS[_0x5632f0]]||_0x9cee08[_0xe606('0x1e')][0x0]['\ufeff'+FIELDS[_0x5632f0]];}}if(!_0x453848[_0xe606('0x1f')]){return _0x207861(handleCheckRowError(_0xe606('0x16'),'firstName\x20not\x20specified!',null,_0x2868f9));}if(!_0x453848['phone']){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x20'),null,_0x2868f9));}if(_0x453848[_0xe606('0x21')]){var _0x2ebf6c=moment(_0x453848[_0xe606('0x21')],'YYYY-MM-DD');if(!_0x2ebf6c[_0xe606('0x22')]()){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x23'),null,_0x2868f9));}}if(_0x453848['email']){if(!isEmail(_0x453848[_0xe606('0x24')])){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x25'),null,_0x2868f9));}}_0x453848[_0xe606('0x26')]=LISTID;_0x453848[_0xe606('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe606('0x28')]&&_0x27f1ea){var _0x1a8454={};for(var _0x4d4e97=0x0,_0x493df8=DUPLICATES[_0xe606('0x28')];_0x4d4e97<_0x493df8;_0x4d4e97+=0x1){_0x1a8454[DUPLICATES[_0x4d4e97]]=_0x453848[DUPLICATES[_0x4d4e97]];}var _0x236959=_[_0xe606('0x29')](_0x27f1ea,_0x1a8454);if(_0x236959){return _0x207861(handleCheckRowError(_0xe606('0x2a'),'Duplicate\x20Contact',_0x236959,_0x2868f9));}}return db[_0xe606('0x2b')]['create'](_0x453848,{'raw':!![],'hooks':![],'fields':_[_0xe606('0x2c')](_0x453848)})[_0xe606('0x2d')](function(_0x36e2e6){if(DUPLICATES&&DUPLICATES['length']&&_0x27f1ea){_0x27f1ea[_0xe606('0x2e')](_[_0xe606('0x2f')](_0x453848,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x36e2e6['id'];return _0x29b190();})[_0xe606('0x30')](function(_0x42d75f){return _0x207861(handleCheckRowError(_0xe606('0x16'),_0xe606('0x31')+(_0x42d75f['message']||JSON[_0xe606('0x32')](_0x42d75f)),null,_0x2868f9));});});}function checkHopper(){function _0x13a990(){return function(_0x5a8649){logger['error'](_0xe606('0x33'),_0xe606('0x34'),util[_0xe606('0x35')](_0x5a8649,{'showHidden':![],'depth':null}));};}var _0x36f917=function(_0x9c0a6b,_0x2aa5db){var _0x79c2a6=squel['insert']()[_0xe606('0x36')](_0xe606('0x37'))[_0xe606('0x38')]([_0xe606('0x39'),_0xe606('0x3a'),_0xe606('0x3b'),_0xe606('0x26'),_0x2aa5db,_0xe606('0x3c'),_0xe606('0x3d')],squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x39'),_0xe606('0x39'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3a'))[_0xe606('0x3f')]('id','ContactId')['field'](LISTID['toString'](),_0xe606('0x26'))[_0xe606('0x3f')](_0x9c0a6b['id']['toString'](),_0x2aa5db)[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3c'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3d'))[_0xe606('0x41')]('cm_contacts')[_0xe606('0x42')]('deletedAt\x20IS\x20NULL')[_0xe606('0x42')](_0xe606('0x43'),LISTID[_0xe606('0x44')]())[_0xe606('0x42')](_0xe606('0x45'))[_0xe606('0x42')](_0xe606('0x46'),squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x39'))['from'](_0xe606('0x37'))[_0xe606('0x42')](_0x2aa5db+_0xe606('0x47'),_0x9c0a6b['id'][_0xe606('0x44')]())))[_0xe606('0x44')]();return _0x79c2a6;};var _0x21d631=function(_0x161e0a,_0x1fe449){var _0x3a7ea7=squel[_0xe606('0x48')]()[_0xe606('0x36')](_0xe606('0x37'))[_0xe606('0x38')](['phone',_0xe606('0x3a'),'ContactId','ListId',_0x1fe449,'createdAt',_0xe606('0x3d')],squel[_0xe606('0x3e')]()[_0xe606('0x3f')]('phone','phone')[_0xe606('0x3f')]('NOW()',_0xe606('0x3a'))['field']('id','ContactId')[_0xe606('0x3f')](LISTID[_0xe606('0x44')](),_0xe606('0x26'))[_0xe606('0x3f')](_0x161e0a['id']['toString'](),_0x1fe449)[_0xe606('0x3f')](_0xe606('0x40'),'createdAt')['field']('NOW()',_0xe606('0x3d'))['from'](_0xe606('0x49'))[_0xe606('0x42')](_0xe606('0x4a'))[_0xe606('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0xe606('0x42')](_0xe606('0x4b'),squel['str'](hopperContacts))[_0xe606('0x42')](_0xe606('0x45'))[_0xe606('0x42')](_0xe606('0x46'),squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x4c'))[_0xe606('0x41')](_0xe606('0x4d'))['where'](_0x1fe449+_0xe606('0x47'),_0x161e0a['id'][_0xe606('0x44')]()))[_0xe606('0x42')](_0xe606('0x46'),squel['select']()[_0xe606('0x3f')](_0xe606('0x39'))[_0xe606('0x41')](_0xe606('0x37'))['where'](_0x1fe449+_0xe606('0x47'),_0x161e0a['id'][_0xe606('0x44')]())))['toString']();return _0x3a7ea7;};function _0x18e94e(_0x17a5d0,_0x599141){var _0x24aa72=squel['insert']()[_0xe606('0x36')](_0xe606('0x37'))[_0xe606('0x38')](['phone','scheduledAt',_0xe606('0x3b'),_0xe606('0x26'),_0x599141,_0xe606('0x3c'),_0xe606('0x3d')],squel[_0xe606('0x3e')]()[_0xe606('0x3f')](_0xe606('0x39'),_0xe606('0x39'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3a'))[_0xe606('0x3f')]('id',_0xe606('0x3b'))['field'](LISTID[_0xe606('0x44')](),_0xe606('0x26'))[_0xe606('0x3f')](_0x17a5d0['id'][_0xe606('0x44')](),_0x599141)[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3c'))[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3d'))[_0xe606('0x41')]('cm_contacts')[_0xe606('0x42')](_0xe606('0x4a'))[_0xe606('0x42')](_0xe606('0x43'),LISTID[_0xe606('0x44')]())[_0xe606('0x42')](_0xe606('0x4b'),squel[_0xe606('0x4e')](hopperContacts))[_0xe606('0x42')](_0xe606('0x45')))[_0xe606('0x44')]();return _0x24aa72;}function _0x2ab72a(_0x2815af,_0x1bb9ad){var _0x1af0ec=squel['insert']()['into']('cm_hopper_black')['fromQuery']([_0xe606('0x39'),'ContactId','ListId',_0x1bb9ad,_0xe606('0x3c'),_0xe606('0x3d')],squel[_0xe606('0x3e')]()['field'](_0xe606('0x39'),_0xe606('0x39'))[_0xe606('0x3f')]('id','ContactId')[_0xe606('0x3f')](LISTID[_0xe606('0x44')](),_0xe606('0x26'))[_0xe606('0x3f')](_0x2815af['id']['toString'](),_0x1bb9ad)['field'](_0xe606('0x40'),'createdAt')[_0xe606('0x3f')](_0xe606('0x40'),_0xe606('0x3d'))['from'](_0xe606('0x49'))[_0xe606('0x42')](_0xe606('0x4a'))[_0xe606('0x42')](_0xe606('0x43'),LISTID[_0xe606('0x44')]())[_0xe606('0x42')](_0xe606('0x4b'),squel[_0xe606('0x4e')](hopperContacts))[_0xe606('0x42')](_0xe606('0x45')))[_0xe606('0x44')]();return _0x1af0ec;}return db[_0xe606('0x4f')][_0xe606('0x50')]({'where':{'type':'outbound'},'attributes':['id',_0xe606('0x51')],'include':[{'model':db['CmList'],'as':_0xe606('0x52'),'where':{'id':LISTID}}]})[_0xe606('0x2d')](function(_0x166233){var _0x1cc8a2=[];if(_0x166233){var _0x1aa907;for(var _0x2d310a=0x0,_0xdf43a0;_0x2d310a<_0x166233[_0xe606('0x28')];_0x2d310a+=0x1){_0xdf43a0=_0x166233[_0x2d310a][_0xe606('0x53')]({'plain':!![]});switch(_0xdf43a0[_0xe606('0x51')]){case _0xe606('0x54'):_0x1cc8a2[_0xe606('0x2e')](db[_0xe606('0x55')][_0xe606('0x56')](_0x21d631(_0xdf43a0,_0xe606('0x57')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;case _0xe606('0x58'):_0x1cc8a2[_0xe606('0x2e')](db['sequelize'][_0xe606('0x56')](_0x36f917(_0xdf43a0,'VoiceQueueId'))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;default:_0x1cc8a2[_0xe606('0x2e')](db[_0xe606('0x55')][_0xe606('0x56')](_0x18e94e(_0xdf43a0,_0xe606('0x57')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));}}}return _0x1cc8a2;})['all']()[_0xe606('0x2d')](function(){return db[_0xe606('0x4f')][_0xe606('0x50')]({'where':{'type':_0xe606('0x59')},'attributes':['id'],'include':[{'model':db[_0xe606('0x5a')],'as':_0xe606('0x5b'),'where':{'id':LISTID}}]})[_0xe606('0x2d')](function(_0x5d41bc){var _0x46d779=[];if(_0x5d41bc){var _0x47772c;for(var _0x2a988a=0x0,_0x4e9c1e;_0x2a988a<_0x5d41bc['length'];_0x2a988a+=0x1){_0x4e9c1e=_0x5d41bc[_0x2a988a]['get']({'plain':!![]});_0x46d779[_0xe606('0x2e')](db[_0xe606('0x55')]['query'](_0x2ab72a(_0x4e9c1e,_0xe606('0x57')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));}}return _0x46d779;})[_0xe606('0x5c')]();})['then'](function(){return db[_0xe606('0x5d')][_0xe606('0x50')]({'attributes':['id',_0xe606('0x51')],'include':[{'model':db[_0xe606('0x5a')],'as':'Lists','where':{'id':LISTID}}]})[_0xe606('0x2d')](function(_0x55822c){var _0x515e96=[];if(_0x55822c){for(var _0x133fff=0x0,_0x50c0b4;_0x133fff<_0x55822c[_0xe606('0x28')];_0x133fff+=0x1){_0x50c0b4=_0x55822c[_0x133fff][_0xe606('0x53')]({'plain':!![]});switch(_0x50c0b4[_0xe606('0x51')]){case _0xe606('0x54'):_0x515e96['push'](db[_0xe606('0x55')]['query'](_0x21d631(_0x50c0b4,'CampaignId'))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;case _0xe606('0x58'):_0x515e96['push'](db[_0xe606('0x55')]['query'](_0x36f917(_0x50c0b4,_0xe606('0x5e')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));break;default:_0x515e96['push'](db[_0xe606('0x55')][_0xe606('0x56')](_0x18e94e(_0x50c0b4,_0xe606('0x5e')))[_0xe606('0x2d')](function(){})[_0xe606('0x30')](_0x13a990()));}}}return _0x515e96;})['all']();})['then'](function(){return db[_0xe606('0x5d')][_0xe606('0x50')]({'attributes':['id'],'include':[{'model':db[_0xe606('0x5a')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x1357b7){var _0x5359aa=[];if(_0x1357b7){for(var _0x23e6b3=0x0,_0x2118cf;_0x23e6b3<_0x1357b7['length'];_0x23e6b3+=0x1){_0x2118cf=_0x1357b7[_0x23e6b3]['get']({'plain':!![]});_0x5359aa[_0xe606('0x2e')](db[_0xe606('0x55')][_0xe606('0x56')](_0x2ab72a(_0x2118cf,_0xe606('0x5e')))['then'](function(){})[_0xe606('0x30')](_0x13a990()));}}return _0x5359aa;})[_0xe606('0x5c')]();})[_0xe606('0x30')](function(_0x20d893){logger[_0xe606('0x16')](_0xe606('0x5f'),_0xe606('0x60'),_0x20d893[_0xe606('0x1c')]);});}var processPromises=function(_0x5be3bd){return BPromise[_0xe606('0x5c')](promises)[_0xe606('0x2d')](function(_0x391190){})[_0xe606('0x30')](function(_0x569203){logger[_0xe606('0x16')](_0xe606('0x61'),JSON[_0xe606('0x32')](_0x569203));})['finally'](function(){socket[_0xe606('0x62')](_0xe606('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5be3bd){return _0x5be3bd['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xe606('0x2d')](function(){socket['emit'](_0xe606('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x37e0df){logger['error'](_0xe606('0x64'),JSON[_0xe606('0x32')](_0x37e0df));}finally{process[_0xe606('0x65')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xe606('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0xe606('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe606('0x13')](',');return db['CmContact'][_0xe606('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe606('0x2d')](function(_0x26f938){var _0x37cde6=fs[_0xe606('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x37cde6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a01e6,_0x19abcc){total+=0x1;var _0x4e37ae=total;promises[_0xe606('0x2e')](checkRow(_0x3a01e6,_0x26f938,_0x4e37ae)['then'](function(){success+=0x1;})[_0xe606('0x30')](function(_0x590e7b){if(_0x590e7b[_0xe606('0x16')]){errors+=0x1;delete _0x590e7b[_0xe606('0x16')];}else if(_0x590e7b[_0xe606('0x2a')]){duplicates+=0x1;delete _0x590e7b[_0xe606('0x2a')];}rows[_0xe606('0x2e')](_0x590e7b);}));if(total%0xc8===0x0){_0x19abcc['pause']();return processPromises(_0x19abcc);}},'complete':function(){return processPromises()[_0xe606('0x2d')](function(){logger[_0xe606('0x68')](_0xe606('0x69'));endCsv();});},'error':function(_0x526eea,_0x5a249a){logger[_0xe606('0x68')](_0xe606('0x6a'),JSON[_0xe606('0x32')](_0x526eea));endCsv();}});})[_0xe606('0x30')](function(_0x15e75d){logger[_0xe606('0x16')](_0xe606('0x6b'),JSON[_0xe606('0x32')](_0x15e75d));});}main(); \ No newline at end of file +var _0xb013=['calleridnum','cm_hopper_final','\x20=\x20?','into','str','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','always','sequelize','query','VoiceQueueId','all','BlackLists','Campaign','dialCheckDuplicateType','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','NOW()','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb013,0x99));var _0x3b01=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xb013[_0x2235bf];return _0x4c3a64;};'use strict';var BPromise=require(_0x3b01('0x0'));var util=require(_0x3b01('0x1'));var _=require(_0x3b01('0x2'));var fs=require('fs');var squel=require(_0x3b01('0x3'));var Papa=require(_0x3b01('0x4'));var Redis=require(_0x3b01('0x5'));var db=require(_0x3b01('0x6'))['db'];var config=require(_0x3b01('0x7'));var logger=require(_0x3b01('0x8'))(_0x3b01('0x9'));config['redis']=_[_0x3b01('0xa')](config[_0x3b01('0xb')],{'host':_0x3b01('0xc'),'port':0x18eb});var socket=require(_0x3b01('0xd'))(new Redis(config[_0x3b01('0xb')]));require(_0x3b01('0xe'))['register'](socket);try{if(!process[_0x3b01('0xf')][0x2]||process[_0x3b01('0xf')][0x2]===_0x3b01('0x10')||process[_0x3b01('0xf')][0x2]===_0x3b01('0x11')){throw new Error(_0x3b01('0x12'));}var FILEPATH=process['argv'][0x2];if(!process[_0x3b01('0xf')][0x3]||process['argv'][0x3]===_0x3b01('0x10')||process[_0x3b01('0xf')][0x3]===_0x3b01('0x11')||!process[_0x3b01('0xf')][0x4]||process[_0x3b01('0xf')][0x4]==='undefined'||process[_0x3b01('0xf')][0x4]===_0x3b01('0x11')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x3b01('0x13')](process[_0x3b01('0xf')][0x3][_0x3b01('0x14')](','),process[_0x3b01('0xf')][0x4][_0x3b01('0x14')](','));if(!process[_0x3b01('0xf')][0x5]||process[_0x3b01('0xf')][0x5]==='undefined'||process['argv'][0x5]==='null'){throw new Error(_0x3b01('0x15'));}var LISTID=process[_0x3b01('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x3b01('0x10')&&process['argv'][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x3b01('0xf')][0x7]!==_0x3b01('0x10')&&process['argv'][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x3b01('0xf')][0x8]||process[_0x3b01('0xf')][0x8]===_0x3b01('0x10')||process['argv'][0x8]==='null'){throw new Error(_0x3b01('0x16'));}var SOCKET_TIMESTAMP=process[_0x3b01('0xf')][0x8];}catch(_0x5b7551){logger[_0x3b01('0x17')](_0x5b7551);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(_0x14034e,_0x51c9ef,_0xd9bd5c,_0x5c513a){var _0x366347={'message':_0x51c9ef};_0x366347[_0x14034e]=!![];if(_0xd9bd5c){_0x366347[_0x3b01('0x18')]=_0xd9bd5c;}if(_0x5c513a){_0x366347[_0x3b01('0x19')]=_0x5c513a;}return _0x366347;}function isEmail(_0x101606){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))*$/[_0x3b01('0x1a')](_0x101606);}function checkRow(_0x507edd,_0x36b9a6,_0x43c57c){return new BPromise(function(_0x15ce5f,_0x4d9b88){if(_[_0x3b01('0x1b')](_0x507edd)){return _0x4d9b88(handleCheckRowError(_0x3b01('0x17'),_0x3b01('0x1c'),null,_0x43c57c));}if(_0x507edd[_0x3b01('0x1d')]&&_0x507edd[_0x3b01('0x1d')][_0x3b01('0x1e')]){var _0x412ec3=_[_0x3b01('0x1f')](_0x507edd[_0x3b01('0x1d')],_0x3b01('0x20'))[_0x3b01('0x21')](';');return _0x4d9b88(handleCheckRowError('error',_0x412ec3,null,_0x43c57c));}var _0x3b7741={};for(var _0x2a36b2 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2a36b2)&&FIELDS[_0x2a36b2]){_0x3b7741[_0x2a36b2]=_0x507edd[_0x3b01('0x22')][0x0][FIELDS[_0x2a36b2]]||_0x507edd['data'][0x0]['\ufeff'+FIELDS[_0x2a36b2]];}}if(!_0x3b7741[_0x3b01('0x23')]){return _0x4d9b88(handleCheckRowError(_0x3b01('0x17'),'firstName\x20not\x20specified!',null,_0x43c57c));}if(!_0x3b7741[_0x3b01('0x24')]){return _0x4d9b88(handleCheckRowError(_0x3b01('0x17'),_0x3b01('0x25'),null,_0x43c57c));}if(_0x3b7741[_0x3b01('0x26')]){var _0xa576c=moment(_0x3b7741[_0x3b01('0x26')],'YYYY-MM-DD');if(!_0xa576c[_0x3b01('0x27')]()){return _0x4d9b88(handleCheckRowError('error',_0x3b01('0x28'),null,_0x43c57c));}}if(_0x3b7741[_0x3b01('0x29')]){if(!isEmail(_0x3b7741[_0x3b01('0x29')])){return _0x4d9b88(handleCheckRowError(_0x3b01('0x17'),_0x3b01('0x2a'),null,_0x43c57c));}}_0x3b7741['ListId']=LISTID;_0x3b7741[_0x3b01('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3b01('0x1e')]&&_0x36b9a6){var _0x4701cf={};for(var _0x36d172=0x0,_0x1e86d3=DUPLICATES[_0x3b01('0x1e')];_0x36d172<_0x1e86d3;_0x36d172+=0x1){_0x4701cf[DUPLICATES[_0x36d172]]=_0x3b7741[DUPLICATES[_0x36d172]];}var _0x13652c=_[_0x3b01('0x2c')](_0x36b9a6,_0x4701cf);if(_0x13652c){return _0x4d9b88(handleCheckRowError(_0x3b01('0x2d'),_0x3b01('0x2e'),_0x13652c,_0x43c57c));}}return db[_0x3b01('0x2f')]['create'](_0x3b7741,{'raw':!![],'hooks':![],'fields':_[_0x3b01('0x30')](_0x3b7741)})[_0x3b01('0x31')](function(_0x407fbc){if(DUPLICATES&&DUPLICATES['length']&&_0x36b9a6){_0x36b9a6[_0x3b01('0x32')](_[_0x3b01('0x33')](_0x3b7741,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x407fbc['id'];return _0x15ce5f();})[_0x3b01('0x34')](function(_0x29b48d){return _0x4d9b88(handleCheckRowError(_0x3b01('0x17'),_0x3b01('0x35')+(_0x29b48d[_0x3b01('0x20')]||JSON[_0x3b01('0x36')](_0x29b48d)),null,_0x43c57c));});});}function checkHopper(){function _0x3ff095(){return function(_0x27aa15){logger[_0x3b01('0x17')](_0x3b01('0x37'),'checkHopper',util[_0x3b01('0x38')](_0x27aa15,{'showHidden':![],'depth':null}));};}var _0x483681=function(_0x11e924,_0x4c6565){var _0x27df13=squel[_0x3b01('0x39')]()['into']('cm_hopper')[_0x3b01('0x3a')]([_0x3b01('0x24'),_0x3b01('0x3b'),_0x3b01('0x3c'),_0x3b01('0x3d'),_0x4c6565,_0x3b01('0x3e'),_0x3b01('0x3f')],squel[_0x3b01('0x40')]()['field'](_0x3b01('0x24'),_0x3b01('0x24'))['field'](_0x3b01('0x41'),_0x3b01('0x3b'))[_0x3b01('0x42')]('id',_0x3b01('0x3c'))[_0x3b01('0x42')](LISTID[_0x3b01('0x43')](),_0x3b01('0x3d'))['field'](_0x11e924['id'][_0x3b01('0x43')](),_0x4c6565)[_0x3b01('0x42')]('NOW()',_0x3b01('0x3e'))[_0x3b01('0x42')](_0x3b01('0x41'),'updatedAt')[_0x3b01('0x44')](_0x3b01('0x45'))['where'](_0x3b01('0x46'))[_0x3b01('0x47')](_0x3b01('0x48'),LISTID[_0x3b01('0x43')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x3b01('0x49'),squel[_0x3b01('0x40')]()[_0x3b01('0x42')](_0x3b01('0x24'))[_0x3b01('0x44')](_0x3b01('0x4a'))[_0x3b01('0x47')](_0x4c6565+'\x20=\x20?',_0x11e924['id'][_0x3b01('0x43')]())))['toString']();return _0x27df13;};var _0x1968d3=function(_0x235af9,_0x588426){var _0x252165=squel[_0x3b01('0x39')]()['into'](_0x3b01('0x4a'))['fromQuery']([_0x3b01('0x24'),_0x3b01('0x3b'),_0x3b01('0x3c'),_0x3b01('0x3d'),_0x588426,_0x3b01('0x3e'),_0x3b01('0x3f')],squel['select']()['field']('phone','phone')['field'](_0x3b01('0x41'),_0x3b01('0x3b'))[_0x3b01('0x42')]('id','ContactId')[_0x3b01('0x42')](LISTID[_0x3b01('0x43')](),_0x3b01('0x3d'))[_0x3b01('0x42')](_0x235af9['id']['toString'](),_0x588426)[_0x3b01('0x42')](_0x3b01('0x41'),_0x3b01('0x3e'))['field']('NOW()','updatedAt')[_0x3b01('0x44')]('cm_contacts')[_0x3b01('0x47')](_0x3b01('0x46'))['where'](_0x3b01('0x48'),LISTID[_0x3b01('0x43')]())[_0x3b01('0x47')](_0x3b01('0x4b'),squel['str'](hopperContacts))[_0x3b01('0x47')](_0x3b01('0x4c'))[_0x3b01('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3b01('0x40')]()[_0x3b01('0x42')](_0x3b01('0x4d'))['from'](_0x3b01('0x4e'))['where'](_0x588426+_0x3b01('0x4f'),_0x235af9['id'][_0x3b01('0x43')]()))[_0x3b01('0x47')](_0x3b01('0x49'),squel['select']()[_0x3b01('0x42')](_0x3b01('0x24'))[_0x3b01('0x44')](_0x3b01('0x4a'))[_0x3b01('0x47')](_0x588426+_0x3b01('0x4f'),_0x235af9['id'][_0x3b01('0x43')]())))[_0x3b01('0x43')]();return _0x252165;};function _0x2a20bb(_0x1206ed,_0x2d943a){var _0x5c4cb3=squel[_0x3b01('0x39')]()[_0x3b01('0x50')](_0x3b01('0x4a'))[_0x3b01('0x3a')]([_0x3b01('0x24'),_0x3b01('0x3b'),_0x3b01('0x3c'),_0x3b01('0x3d'),_0x2d943a,_0x3b01('0x3e'),_0x3b01('0x3f')],squel[_0x3b01('0x40')]()[_0x3b01('0x42')](_0x3b01('0x24'),'phone')[_0x3b01('0x42')]('NOW()',_0x3b01('0x3b'))[_0x3b01('0x42')]('id',_0x3b01('0x3c'))[_0x3b01('0x42')](LISTID[_0x3b01('0x43')](),'ListId')[_0x3b01('0x42')](_0x1206ed['id'][_0x3b01('0x43')](),_0x2d943a)['field'](_0x3b01('0x41'),'createdAt')[_0x3b01('0x42')](_0x3b01('0x41'),'updatedAt')[_0x3b01('0x44')](_0x3b01('0x45'))[_0x3b01('0x47')](_0x3b01('0x46'))[_0x3b01('0x47')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x3b01('0x4b'),squel[_0x3b01('0x51')](hopperContacts))[_0x3b01('0x47')](_0x3b01('0x4c')))[_0x3b01('0x43')]();return _0x5c4cb3;}function _0x5f41e2(_0x441666,_0x2d496e){var _0x2c7de2=squel['insert']()[_0x3b01('0x50')](_0x3b01('0x52'))[_0x3b01('0x3a')](['phone',_0x3b01('0x3c'),'ListId',_0x2d496e,'createdAt',_0x3b01('0x3f')],squel[_0x3b01('0x40')]()['field'](_0x3b01('0x24'),_0x3b01('0x24'))[_0x3b01('0x42')]('id',_0x3b01('0x3c'))[_0x3b01('0x42')](LISTID[_0x3b01('0x43')](),_0x3b01('0x3d'))[_0x3b01('0x42')](_0x441666['id'][_0x3b01('0x43')](),_0x2d496e)[_0x3b01('0x42')](_0x3b01('0x41'),_0x3b01('0x3e'))[_0x3b01('0x42')]('NOW()',_0x3b01('0x3f'))[_0x3b01('0x44')](_0x3b01('0x45'))['where'](_0x3b01('0x46'))[_0x3b01('0x47')](_0x3b01('0x48'),LISTID['toString']())['where'](_0x3b01('0x4b'),squel[_0x3b01('0x51')](hopperContacts))[_0x3b01('0x47')](_0x3b01('0x4c')))['toString']();return _0x2c7de2;}return db[_0x3b01('0x53')][_0x3b01('0x54')]({'where':{'type':_0x3b01('0x55')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3b01('0x56')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0xfdc61c){var _0x442e84=[];if(_0xfdc61c){var _0x339752;for(var _0x357bf7=0x0,_0x3d8112;_0x357bf7<_0xfdc61c[_0x3b01('0x1e')];_0x357bf7+=0x1){_0x3d8112=_0xfdc61c[_0x357bf7][_0x3b01('0x57')]({'plain':!![]});switch(_0x3d8112['dialCheckDuplicateType']){case _0x3b01('0x58'):_0x442e84[_0x3b01('0x32')](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x1968d3(_0x3d8112,'VoiceQueueId'))[_0x3b01('0x31')](function(){})[_0x3b01('0x34')](_0x3ff095()));break;case'onlyIfOpen':_0x442e84[_0x3b01('0x32')](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x483681(_0x3d8112,_0x3b01('0x5b')))[_0x3b01('0x31')](function(){})[_0x3b01('0x34')](_0x3ff095()));break;default:_0x442e84[_0x3b01('0x32')](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x2a20bb(_0x3d8112,_0x3b01('0x5b')))['then'](function(){})[_0x3b01('0x34')](_0x3ff095()));}}}return _0x442e84;})[_0x3b01('0x5c')]()[_0x3b01('0x31')](function(){return db[_0x3b01('0x53')][_0x3b01('0x54')]({'where':{'type':_0x3b01('0x55')},'attributes':['id'],'include':[{'model':db[_0x3b01('0x56')],'as':_0x3b01('0x5d'),'where':{'id':LISTID}}]})[_0x3b01('0x31')](function(_0x5b70e1){var _0x5b5fd3=[];if(_0x5b70e1){var _0x49fbf9;for(var _0x16f85d=0x0,_0x54b60c;_0x16f85d<_0x5b70e1['length'];_0x16f85d+=0x1){_0x54b60c=_0x5b70e1[_0x16f85d][_0x3b01('0x57')]({'plain':!![]});_0x5b5fd3[_0x3b01('0x32')](db['sequelize'][_0x3b01('0x5a')](_0x5f41e2(_0x54b60c,_0x3b01('0x5b')))[_0x3b01('0x31')](function(){})['catch'](_0x3ff095()));}}return _0x5b5fd3;})['all']();})[_0x3b01('0x31')](function(){return db[_0x3b01('0x5e')][_0x3b01('0x54')]({'attributes':['id',_0x3b01('0x5f')],'include':[{'model':db[_0x3b01('0x56')],'as':_0x3b01('0x60'),'where':{'id':LISTID}}]})[_0x3b01('0x31')](function(_0x2c8c06){var _0xfcf849=[];if(_0x2c8c06){for(var _0x267d94=0x0,_0x506ba2;_0x267d94<_0x2c8c06[_0x3b01('0x1e')];_0x267d94+=0x1){_0x506ba2=_0x2c8c06[_0x267d94][_0x3b01('0x57')]({'plain':!![]});switch(_0x506ba2[_0x3b01('0x5f')]){case'always':_0xfcf849[_0x3b01('0x32')](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x1968d3(_0x506ba2,_0x3b01('0x61')))[_0x3b01('0x31')](function(){})[_0x3b01('0x34')](_0x3ff095()));break;case _0x3b01('0x62'):_0xfcf849[_0x3b01('0x32')](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x483681(_0x506ba2,'CampaignId'))[_0x3b01('0x31')](function(){})[_0x3b01('0x34')](_0x3ff095()));break;default:_0xfcf849['push'](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x2a20bb(_0x506ba2,_0x3b01('0x61')))['then'](function(){})[_0x3b01('0x34')](_0x3ff095()));}}}return _0xfcf849;})[_0x3b01('0x5c')]();})[_0x3b01('0x31')](function(){return db['Campaign'][_0x3b01('0x54')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3b01('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0xa08804){var _0x55ccf7=[];if(_0xa08804){for(var _0x16f2c7=0x0,_0x286805;_0x16f2c7<_0xa08804['length'];_0x16f2c7+=0x1){_0x286805=_0xa08804[_0x16f2c7][_0x3b01('0x57')]({'plain':!![]});_0x55ccf7[_0x3b01('0x32')](db[_0x3b01('0x59')][_0x3b01('0x5a')](_0x5f41e2(_0x286805,_0x3b01('0x61')))[_0x3b01('0x31')](function(){})[_0x3b01('0x34')](_0x3ff095()));}}return _0x55ccf7;})['all']();})[_0x3b01('0x34')](function(_0x393ca5){logger[_0x3b01('0x17')](_0x3b01('0x63'),'generalCheckHopper',_0x393ca5['message']);});}var processPromises=function(_0x4b0ab6){return BPromise[_0x3b01('0x5c')](promises)[_0x3b01('0x31')](function(_0x39111f){})['catch'](function(_0x4783ba){logger[_0x3b01('0x17')](_0x3b01('0x64'),JSON[_0x3b01('0x36')](_0x4783ba));})['finally'](function(){socket[_0x3b01('0x65')](_0x3b01('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b0ab6){return _0x4b0ab6[_0x3b01('0x67')]();}});};var endCsv=function(){return BPromise[_0x3b01('0x68')]()[_0x3b01('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x3b01('0x31')](function(){socket[_0x3b01('0x65')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x27bd47){logger[_0x3b01('0x17')](_0x3b01('0x69'),JSON[_0x3b01('0x36')](_0x27bd47));}finally{process[_0x3b01('0x6a')](0x0);}});};process['on'](_0x3b01('0x6b'),function(){logger['info'](_0x3b01('0x6c'));endCsv();});function main(){return BPromise[_0x3b01('0x68')]()[_0x3b01('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3b01('0x2f')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3b01('0x31')](function(_0x3f132e){var _0x2b3cc3=fs[_0x3b01('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3b01('0x6e')](_0x2b3cc3,{'header':!![],'skipEmptyLines':!![],'step':function(_0x36207e,_0x2da0b7){total+=0x1;var _0x173a03=total;promises[_0x3b01('0x32')](checkRow(_0x36207e,_0x3f132e,_0x173a03)['then'](function(){success+=0x1;})[_0x3b01('0x34')](function(_0x341af6){if(_0x341af6[_0x3b01('0x17')]){errors+=0x1;delete _0x341af6[_0x3b01('0x17')];}else if(_0x341af6[_0x3b01('0x2d')]){duplicates+=0x1;delete _0x341af6[_0x3b01('0x2d')];}rows[_0x3b01('0x32')](_0x341af6);}));if(total%0xc8===0x0){_0x2da0b7['pause']();return processPromises(_0x2da0b7);}},'complete':function(){return processPromises()[_0x3b01('0x31')](function(){logger[_0x3b01('0x6f')](_0x3b01('0x70'));endCsv();});},'error':function(_0xf9e7ea,_0x5667f8){logger['info'](_0x3b01('0x71'),JSON['stringify'](_0xf9e7ea));endCsv();}});})[_0x3b01('0x34')](function(_0x58fd03){logger['error'](_0x3b01('0x72'),JSON[_0x3b01('0x36')](_0x58fd03));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7f700e5..ae5e1bf 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 _0x4128=['binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.phone','cm_hopper_black','join','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','info','Received\x20SIGINT','error','message','errors','push','code','sequelize','spread','catch','main','stringify','start','binding','socket_timestamp','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','rows','data','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','campaigns','CampaignId','each','then','finish','emit','unlink','exit','complete','arguments\x20\x20\x20','root','argv','existsSync','file\x20doesn\x27t\x20exists'];(function(_0x2f5b91,_0x40f255){var _0x2fa9b2=function(_0x3f94d4){while(--_0x3f94d4){_0x2f5b91['push'](_0x2f5b91['shift']());}};_0x2fa9b2(++_0x40f255);}(_0x4128,0x1a5));var _0x8412=function(_0x1a6de3,_0x583ebd){_0x1a6de3=_0x1a6de3-0x0;var _0x220273=_0x4128[_0x1a6de3];return _0x220273;};'use strict';var fs=require('fs');var path=require(_0x8412('0x0'));var _=require(_0x8412('0x1'));var Papa=require(_0x8412('0x2'));var util=require(_0x8412('0x3'));var BPromise=require(_0x8412('0x4'));var moment=require(_0x8412('0x5'));var squel=require(_0x8412('0x6'));var Redis=require('ioredis');var db=require(_0x8412('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x8412('0x8'))(_0x8412('0x9'));config['redis']=_[_0x8412('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8412('0xb'))(new Redis(config[_0x8412('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8412('0xd')](_0x8412('0xe'));function isEmail(_0x51dbb0){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x8412('0xf')](_0x51dbb0);}function selectNotIn(_0x26e754,_0x3e2d9a,_0xc05c,_0x1a3701,_0x52c16b){return squel[_0x8412('0x10')]()[_0x8412('0x11')](_0x8412('0x12'))[_0x8412('0x13')](_0x1a3701)['join'](_0x3e2d9a,null,_0x3e2d9a+'.id\x20=\x20'+_0x1a3701+'.'+_0xc05c)[_0x8412('0x14')](_0x1a3701+'.'+_0xc05c+_0x8412('0x15')+_0x26e754+'.'+_0xc05c)[_0x8412('0x14')](_0x3e2d9a+_0x8412('0x16')+_0x52c16b['join']()+')');}function insertCmHopper(_0x3d7721,_0x4b6a0c,_0x124532,_0x1ff35f,_0x22c5bf){var _0x5e7021=['cm_contacts.phone',_0x8412('0x17'),_0x8412('0x18'),_0x8412('0x19'),_0x4b6a0c+'.'+_0x1ff35f,'cm_contacts.createdAt',_0x8412('0x1a'),_0x8412('0x1b'),_0x8412('0x1c'),'\x22'+_0x22c5bf+'\x22'];return squel[_0x8412('0x1d')]()[_0x8412('0x1e')]('cm_hopper')[_0x8412('0x1f')](['phone',_0x8412('0x20'),_0x8412('0x21'),_0x8412('0x22'),_0x1ff35f,_0x8412('0x23'),_0x8412('0x24'),_0x8412('0x25'),_0x8412('0x26'),_0x8412('0x27')],squel[_0x8412('0x10')]()[_0x8412('0x28')](_0x5e7021)['from'](_0x4b6a0c)['join'](_0x8412('0x29'),null,_0x8412('0x2a')+_0x4b6a0c+'.CmListId')['join'](_0x124532,null,_0x124532+'.id\x20=\x20'+_0x4b6a0c+'.'+_0x1ff35f)[_0x8412('0x14')](_0x4b6a0c+'.CmListId\x20=\x20?',_0x3d7721)[_0x8412('0x14')](_0x8412('0x2b'),NOW)['where'](_0x8412('0x2c'),selectNotIn(_0x4b6a0c,_0x124532,_0x1ff35f,_0x8412('0x2d'),[_0x8412('0x2e'),'\x22onlyIfOpen\x22']))['where'](_0x8412('0x2c'),selectNotIn(_0x4b6a0c,_0x124532,_0x1ff35f,_0x8412('0x2d'),[_0x8412('0x2e')])))[_0x8412('0x2f')]();}function insertCmHopperBlack(_0x5d0696,_0x28a117,_0x2d32cf,_0x52ef89){var _0x59a5e2=[_0x8412('0x30'),_0x8412('0x18'),'cm_contacts.ListId',_0x28a117+'.'+_0x52ef89,'cm_contacts.createdAt',_0x8412('0x1a')];return squel[_0x8412('0x1d')]()[_0x8412('0x1e')](_0x8412('0x31'))[_0x8412('0x1f')]([_0x8412('0x12'),_0x8412('0x21'),_0x8412('0x22'),_0x52ef89,'createdAt',_0x8412('0x24')],squel['select']()[_0x8412('0x28')](_0x59a5e2)[_0x8412('0x13')](_0x28a117)[_0x8412('0x32')](_0x8412('0x29'),null,_0x8412('0x2a')+_0x28a117+_0x8412('0x33'))[_0x8412('0x32')](_0x2d32cf,null,_0x2d32cf+_0x8412('0x34')+_0x28a117+'.'+_0x52ef89)[_0x8412('0x14')](_0x28a117+_0x8412('0x35'),_0x5d0696)[_0x8412('0x14')](_0x8412('0x2b'),NOW)[_0x8412('0x14')](_0x8412('0x2c'),squel[_0x8412('0x10')]()[_0x8412('0x11')]('phone')[_0x8412('0x13')]('cm_hopper_black')[_0x8412('0x14')](_0x8412('0x36'),_0x5d0696)['where'](_0x52ef89+_0x8412('0x37'),_0x28a117+'.'+_0x52ef89)))[_0x8412('0x2f')]();}function insertCmContact(_0x5a6c5e,_0x4cf94e,_0x1145f7,_0x18a24b){var _0x141b9e=_[_0x8412('0x38')](_['keys'](_0x18a24b),[_0x8412('0x22'),'CompanyId',_0x8412('0x23'),'updatedAt']);return squel['insert']()[_0x8412('0x1e')]('cm_contacts')[_0x8412('0x1f')](_0x141b9e,squel[_0x8412('0x10')]()[_0x8412('0x28')](_0x141b9e)[_0x8412('0x13')](_0x4cf94e)['where']('('+_0x1145f7[_0x8412('0x32')](',')+_0x8412('0x39'),squel[_0x8412('0x10')]()[_0x8412('0x28')](_0x1145f7)['from']('cm_contacts')[_0x8412('0x14')](_0x8412('0x36'),_0x5a6c5e)[_0x8412('0x14')](_0x8412('0x3a')))[_0x8412('0x14')]('id\x20IN\x20?',squel[_0x8412('0x10')]()[_0x8412('0x11')](_0x8412('0x3b'),'min_id')['from'](_0x4cf94e)['group'](_0x1145f7['join'](','))))[_0x8412('0x2f')]();}function handleStop(){logger[_0x8412('0x3c')](_0x8412('0x3d'));stopped=!![];}function handleUncaughtException(_0x1ff175){logger[_0x8412('0x3e')](_0x1ff175[_0x8412('0x3f')]);process['exit'](0x1);}function handleError(_0x5a8d4f,_0x32a131){stats[_0x8412('0x40')][_0x8412('0x41')]({'name':_0x32a131[_0x8412('0x42')],'message':_0x32a131[_0x8412('0x3f')],'row':_0x5a8d4f});}function handleQuery(_0x3a8649){logger[_0x8412('0x3c')](_0x3a8649);return db[_0x8412('0x43')]['query'](_0x3a8649)[_0x8412('0x44')](function(_0x22febb){results[_0x8412('0x41')](_0x22febb);})[_0x8412('0x45')](function(_0x112614){logger['error'](_0x112614[_0x8412('0x3f')]);});}function main(_0x54e1ba,_0x26c1f3,_0x338bfd,_0x311fe7){logger[_0x8412('0x3c')](_0x8412('0x46'),_0x54e1ba,JSON[_0x8412('0x47')](_0x26c1f3));process['send'](_0x8412('0x48'));var _0x3c96ee=_0x26c1f3[_0x8412('0x49')];var _0x10728c=_0x26c1f3[_0x8412('0x4a')];var _0x1b7122=path[_0x8412('0x32')](config['root'],_0x8412('0x4b'),_0x10728c+_0x8412('0x4c'));var _0x11e3ae=_[_0x8412('0x4d')](_0x3c96ee)[_0x8412('0x32')]();logger['info'](_0x8412('0x4e'),_0x11e3ae);fs[_0x8412('0x4f')](_0x1b7122,_0x11e3ae+'\x0a');Papa[_0x8412('0x50')](fs[_0x8412('0x51')](_0x54e1ba),{'header':!![],'skipEmptyLines':!![],'step':function(_0x10f62b,_0x209594){try{for(var _0x4e7de4=0x0,_0x46bb5e=[];_0x4e7de4<_0x10f62b['data']['length'];_0x4e7de4++){stats[_0x8412('0x52')]+=0x1;if(_0x10f62b[_0x8412('0x40')][_0x4e7de4]){handleError(_0x10f62b[_0x8412('0x53')][_0x4e7de4],_0x10f62b[_0x8412('0x40')][_0x4e7de4]);}else{var _0x243e42=[];for(var _0x3ec581 in _0x3c96ee){if(_0x3c96ee[_0x8412('0x54')](_0x3ec581)){if(_0x10f62b[_0x8412('0x53')][_0x4e7de4][_0x3c96ee[_0x3ec581]]){var _0x2874a3=_[_0x8412('0x55')](_0x10f62b['data'][_0x4e7de4][_0x3c96ee[_0x3ec581]]['replace'](/"/g,'\x27'));switch(_0x3ec581){case _0x8412('0x20'):var _0x5be7c3=moment(_0x2874a3,_0x8412('0xe'),!![]);if(_0x5be7c3[_0x8412('0x56')]()){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');}else{_0x243e42[_0x8412('0x41')](_0x8412('0x57'));}break;case _0x8412('0x25'):var _0x4878c6=parseInt(_0x2874a3);_0x2874a3=_[_0x8412('0x58')](_0x4878c6)||_0x4878c6<0x0||_0x4878c6>0x4?_0x311fe7?0x3:0x2:_0x4878c6;_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');break;case _0x8412('0x26'):var _0x4e4a18=parseInt(_0x2874a3);if(_[_0x8412('0x59')](_0x4e4a18)&&_['includes'](_0x338bfd,_0x4e4a18)){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x4e4a18+'\x22');}else{_0x243e42[_0x8412('0x41')](_0x8412('0x5a'));}break;case _0x8412('0x5b'):if(isEmail(_0x2874a3)){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');}else{_0x243e42[_0x8412('0x41')](_0x8412('0x5c'));}break;case _0x8412('0x5d'):var _0x2a8228=moment(_0x2874a3,'YYYY-MM-DD',!![]);if(_0x2a8228['isValid']()){_0x46bb5e[_0x8412('0x41')]('\x22'+_0x2874a3+'\x22');}else{_0x243e42[_0x8412('0x41')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x46bb5e['push']('\x22'+_0x2874a3+'\x22');}}else{switch(_0x3ec581){case _0x8412('0x5e'):case _0x8412('0x12'):_0x243e42['push'](_0x3ec581+_0x8412('0x5f'));break;default:_0x46bb5e[_0x8412('0x41')]('\x22\x22');}}}}if(_0x243e42[_0x8412('0x60')]){handleError(_0x10f62b[_0x8412('0x53')][_0x4e7de4],{'code':_0x8412('0x61'),'message':_0x243e42['join']()});}else{fs[_0x8412('0x62')](_0x1b7122,_0x46bb5e[_0x8412('0x32')]()+'\x0a');}_0x46bb5e=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x8412('0x63')+_0x10728c,stats);stats[_0x8412('0x40')]=[];}}if(stopped){logger[_0x8412('0x3c')]('Abort\x20parser');_0x209594[_0x8412('0x64')]();}}catch(_0x193785){handleError(_0x10f62b[_0x8412('0x53')][_0x4e7de4],{'code':_0x8412('0x65'),'message':_0x193785['message']});logger['error'](_0x8412('0x66'),_0x193785['message']);}},'complete':function(){try{var _0x4e6316=[];var _0x3f8833='cm_contacts';if(_0x26c1f3[_0x8412('0x67')]&&_0x26c1f3['duplicates']['length']){_0x3f8833=_0x8412('0x68')+_0x10728c;_0x4e6316['push'](_0x8412('0x69')+_0x3f8833+_0x8412('0x6a'));}var _0x4d92b7=util[_0x8412('0xd')](_0x8412('0x6b'),_0x1b7122,_0x3f8833,_0x11e3ae,_0x26c1f3[_0x8412('0x22')],_0x26c1f3[_0x8412('0x6c')]||null,NOW,NOW);if(_[_0x8412('0x6d')](_0x3c96ee[_0x8412('0x20')])){_0x4d92b7+=_0x8412('0x6e');}_0x4e6316['push'](_0x4d92b7);if(_0x26c1f3['duplicates']&&_0x26c1f3['duplicates'][_0x8412('0x60')]){_0x4e6316['push'](insertCmContact(_0x26c1f3[_0x8412('0x22')],_0x3f8833,_0x26c1f3[_0x8412('0x67')],_0x3c96ee));_0x4e6316['push']('DROP\x20TABLE\x20'+_0x3f8833+';');}_0x4e6316[_0x8412('0x41')](insertCmHopper(_0x26c1f3[_0x8412('0x22')],_0x8412('0x6f'),_0x8412('0x70'),_0x8412('0x71'),_0x311fe7));_0x4e6316[_0x8412('0x41')](insertCmHopperBlack(_0x26c1f3[_0x8412('0x22')],_0x8412('0x72'),_0x8412('0x70'),_0x8412('0x71')));_0x4e6316[_0x8412('0x41')](insertCmHopper(_0x26c1f3[_0x8412('0x22')],_0x8412('0x73'),'campaigns','CampaignId',_0x311fe7));_0x4e6316['push'](insertCmHopperBlack(_0x26c1f3[_0x8412('0x22')],_0x8412('0x74'),_0x8412('0x75'),_0x8412('0x76')));BPromise[_0x8412('0x77')](_0x4e6316,handleQuery)[_0x8412('0x78')](function(_0x316bf1){stats[_0x8412('0x79')]=!![];stats['affectedRows']=_0x26c1f3[_0x8412('0x67')]&&_0x26c1f3[_0x8412('0x67')][_0x8412('0x60')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0x8412('0x7a')](_0x8412('0x63')+_0x10728c,stats);fs[_0x8412('0x7b')](_0x54e1ba);fs[_0x8412('0x7b')](_0x1b7122);process[_0x8412('0x7c')](0x0);})[_0x8412('0x45')](function(_0x501ab3){logger[_0x8412('0x3e')](_0x501ab3[_0x8412('0x3f')]);process['exit'](0x1);});}catch(_0x565a19){logger[_0x8412('0x3e')](_0x8412('0x7d'),_0x565a19[_0x8412('0x3f')]);process[_0x8412('0x7c')](0x1);}},'error':function(_0xc28579,_0x16d272,_0x1f631f,_0x4e5bdb){throw new Error(_0x4e5bdb);}});}function validate(){if(process['argv']&&process['argv'][_0x8412('0x60')]<0x4){throw new Error(_0x8412('0x7e'));}var _0x1c0380=path['join'](config[_0x8412('0x7f')],_0x8412('0x4b'),process[_0x8412('0x80')][0x2]);if(!fs[_0x8412('0x81')](_0x1c0380)){throw new Error(_0x8412('0x82'));}var _0x4d1a5e={};try{_0x4d1a5e=JSON[_0x8412('0x50')](process[_0x8412('0x80')][0x3]);if(!_0x4d1a5e[_0x8412('0x49')]){throw new Error(_0x8412('0x83'));}if(!_0x4d1a5e[_0x8412('0x49')][_0x8412('0x12')]){throw new Error(_0x8412('0x84'));}if(!_0x4d1a5e[_0x8412('0x49')][_0x8412('0x5e')]){throw new Error('firstName\x20is\x20mandatory');}var _0x4867b8=0x0;if(_0x4d1a5e['binding'][_0x8412('0x26')]){_0x4867b8=0x1;}if(!_0x4d1a5e['ListId']){throw new Error(_0x8412('0x85'));}}catch(_0x5211f1){throw new Error('body\x20id\x20mandatory');}var _0x536b27=[];try{_0x536b27=_[_0x8412('0x86')](JSON[_0x8412('0x50')](process[_0x8412('0x80')][0x4]),'id');}catch(_0x3f7a45){logger[_0x8412('0x3c')](_0x8412('0x87'));}main(_0x1c0380,_0x4d1a5e,_0x536b27,_0x4867b8);}validate();process['on'](_0x8412('0x88'),handleStop);process['on'](_0x8412('0x89'),handleUncaughtException); \ No newline at end of file +var _0x5ed6=['SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','socket.io-emitter','format','test','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','select','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','push','sequelize','spread','catch','stringify','send','binding','root','.csv','header','writeFileSync','parse','data','length','rows','hasOwnProperty','trim','isValid','isNumber','includes','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x5ed6,0x83));var _0x65ed=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x5ed6[_0x12ddb2];return _0x10b6dd;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x65ed('0x0'));var Papa=require('papaparse');var util=require(_0x65ed('0x1'));var BPromise=require(_0x65ed('0x2'));var moment=require(_0x65ed('0x3'));var squel=require(_0x65ed('0x4'));var Redis=require(_0x65ed('0x5'));var db=require(_0x65ed('0x6'))['db'];var config=require(_0x65ed('0x7'));var logger=require(_0x65ed('0x8'))(_0x65ed('0x9'));config[_0x65ed('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x65ed('0xb'))(new Redis(config[_0x65ed('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x65ed('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x31280c){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))*$/[_0x65ed('0xd')](_0x31280c);}function selectNotIn(_0xb56240,_0x388222,_0x135f23,_0x1220dd,_0x21835c){return squel['select']()[_0x65ed('0xe')](_0x65ed('0xf'))[_0x65ed('0x10')](_0x1220dd)[_0x65ed('0x11')](_0x388222,null,_0x388222+'.id\x20=\x20'+_0x1220dd+'.'+_0x135f23)[_0x65ed('0x12')](_0x1220dd+'.'+_0x135f23+_0x65ed('0x13')+_0xb56240+'.'+_0x135f23)['where'](_0x388222+_0x65ed('0x14')+_0x21835c[_0x65ed('0x11')]()+')');}function insertCmHopper(_0x1830db,_0x9b7857,_0x5cb215,_0x23d931,_0x269a00){var _0x36120f=[_0x65ed('0x15'),_0x65ed('0x16'),_0x65ed('0x17'),_0x65ed('0x18'),_0x9b7857+'.'+_0x23d931,_0x65ed('0x19'),_0x65ed('0x1a'),_0x65ed('0x1b'),_0x65ed('0x1c'),'\x22'+_0x269a00+'\x22'];return squel[_0x65ed('0x1d')]()[_0x65ed('0x1e')](_0x65ed('0x1f'))[_0x65ed('0x20')]([_0x65ed('0xf'),_0x65ed('0x21'),_0x65ed('0x22'),_0x65ed('0x23'),_0x23d931,_0x65ed('0x24'),'updatedAt',_0x65ed('0x25'),_0x65ed('0x26'),'recallme'],squel[_0x65ed('0x27')]()[_0x65ed('0x28')](_0x36120f)['from'](_0x9b7857)[_0x65ed('0x11')](_0x65ed('0x29'),null,'cm_contacts.ListId\x20=\x20'+_0x9b7857+_0x65ed('0x2a'))[_0x65ed('0x11')](_0x5cb215,null,_0x5cb215+_0x65ed('0x2b')+_0x9b7857+'.'+_0x23d931)[_0x65ed('0x12')](_0x9b7857+_0x65ed('0x2c'),_0x1830db)[_0x65ed('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x65ed('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x9b7857,_0x5cb215,_0x23d931,'cm_hopper',[_0x65ed('0x2d'),_0x65ed('0x2e')]))[_0x65ed('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x9b7857,_0x5cb215,_0x23d931,'cm_hopper',['\x22always\x22'])))[_0x65ed('0x2f')]();}function insertCmHopperBlack(_0x2ed8d3,_0x61968c,_0xce1884,_0x2dc045){var _0x4da9c4=[_0x65ed('0x15'),'cm_contacts.id','cm_contacts.ListId',_0x61968c+'.'+_0x2dc045,_0x65ed('0x19'),'cm_contacts.updatedAt'];return squel['insert']()[_0x65ed('0x1e')](_0x65ed('0x30'))[_0x65ed('0x20')]([_0x65ed('0xf'),_0x65ed('0x22'),'ListId',_0x2dc045,_0x65ed('0x24'),_0x65ed('0x31')],squel[_0x65ed('0x27')]()[_0x65ed('0x28')](_0x4da9c4)[_0x65ed('0x10')](_0x61968c)[_0x65ed('0x11')]('cm_contacts',null,_0x65ed('0x32')+_0x61968c+'.CmListId')[_0x65ed('0x11')](_0xce1884,null,_0xce1884+_0x65ed('0x2b')+_0x61968c+'.'+_0x2dc045)[_0x65ed('0x12')](_0x61968c+'.CmListId\x20=\x20?',_0x2ed8d3)[_0x65ed('0x12')](_0x65ed('0x33'),NOW)[_0x65ed('0x12')](_0x65ed('0x34'),squel[_0x65ed('0x27')]()[_0x65ed('0xe')](_0x65ed('0xf'))['from'](_0x65ed('0x30'))['where'](_0x65ed('0x35'),_0x2ed8d3)['where'](_0x2dc045+_0x65ed('0x36'),_0x61968c+'.'+_0x2dc045)))[_0x65ed('0x2f')]();}function insertCmContact(_0x10d44b,_0x514d20,_0x33a6db,_0x34b085){var _0x29fa61=_[_0x65ed('0x37')](_[_0x65ed('0x38')](_0x34b085),[_0x65ed('0x23'),_0x65ed('0x39'),_0x65ed('0x24'),'updatedAt']);return squel[_0x65ed('0x1d')]()[_0x65ed('0x1e')]('cm_contacts')[_0x65ed('0x20')](_0x29fa61,squel[_0x65ed('0x27')]()[_0x65ed('0x28')](_0x29fa61)[_0x65ed('0x10')](_0x514d20)[_0x65ed('0x12')]('('+_0x33a6db[_0x65ed('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x65ed('0x27')]()[_0x65ed('0x28')](_0x33a6db)[_0x65ed('0x10')]('cm_contacts')[_0x65ed('0x12')](_0x65ed('0x35'),_0x10d44b)[_0x65ed('0x12')](_0x65ed('0x3a')))['where'](_0x65ed('0x3b'),squel['select']()[_0x65ed('0xe')](_0x65ed('0x3c'),_0x65ed('0x3d'))[_0x65ed('0x10')](_0x514d20)[_0x65ed('0x3e')](_0x33a6db[_0x65ed('0x11')](','))))['toString']();}function handleStop(){logger[_0x65ed('0x3f')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3a4a97){logger[_0x65ed('0x40')](_0x3a4a97[_0x65ed('0x41')]);process[_0x65ed('0x42')](0x1);}function handleError(_0x1fa0b9,_0x5dab2c){stats[_0x65ed('0x43')][_0x65ed('0x44')]({'name':_0x5dab2c['code'],'message':_0x5dab2c[_0x65ed('0x41')],'row':_0x1fa0b9});}function handleQuery(_0xf0580a){logger['info'](_0xf0580a);return db[_0x65ed('0x45')]['query'](_0xf0580a)[_0x65ed('0x46')](function(_0x5f3e19){results[_0x65ed('0x44')](_0x5f3e19);})[_0x65ed('0x47')](function(_0x422f61){logger[_0x65ed('0x40')](_0x422f61[_0x65ed('0x41')]);});}function main(_0x1328fd,_0x2aa8a6,_0x4f5f79,_0x99ae){logger[_0x65ed('0x3f')]('main',_0x1328fd,JSON[_0x65ed('0x48')](_0x2aa8a6));process[_0x65ed('0x49')]('start');var _0x3e6c82=_0x2aa8a6[_0x65ed('0x4a')];var _0x4a7e7f=_0x2aa8a6['socket_timestamp'];var _0x23da78=path[_0x65ed('0x11')](config[_0x65ed('0x4b')],'server/files/tmp',_0x4a7e7f+_0x65ed('0x4c'));var _0x360154=_[_0x65ed('0x38')](_0x3e6c82)[_0x65ed('0x11')]();logger[_0x65ed('0x3f')](_0x65ed('0x4d'),_0x360154);fs[_0x65ed('0x4e')](_0x23da78,_0x360154+'\x0a');Papa[_0x65ed('0x4f')](fs['createReadStream'](_0x1328fd),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4ffe78,_0x158181){try{for(var _0x2a8b54=0x0,_0x7cea83=[];_0x2a8b54<_0x4ffe78[_0x65ed('0x50')][_0x65ed('0x51')];_0x2a8b54++){stats[_0x65ed('0x52')]+=0x1;if(_0x4ffe78['errors'][_0x2a8b54]){handleError(_0x4ffe78[_0x65ed('0x50')][_0x2a8b54],_0x4ffe78['errors'][_0x2a8b54]);}else{var _0x56d3c4=[];for(var _0x1837a2 in _0x3e6c82){if(_0x3e6c82[_0x65ed('0x53')](_0x1837a2)){if(_0x4ffe78[_0x65ed('0x50')][_0x2a8b54][_0x3e6c82[_0x1837a2]]){var _0x7223a1=_[_0x65ed('0x54')](_0x4ffe78[_0x65ed('0x50')][_0x2a8b54][_0x3e6c82[_0x1837a2]]['replace'](/"/g,'\x27'));switch(_0x1837a2){case _0x65ed('0x21'):var _0x2db197=moment(_0x7223a1,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2db197[_0x65ed('0x55')]()){_0x7cea83['push']('\x22'+_0x7223a1+'\x22');}else{_0x56d3c4['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x65ed('0x25'):var _0x3465be=parseInt(_0x7223a1);_0x7223a1=_['isNaN'](_0x3465be)||_0x3465be<0x0||_0x3465be>0x4?_0x99ae?0x3:0x2:_0x3465be;_0x7cea83[_0x65ed('0x44')]('\x22'+_0x7223a1+'\x22');break;case _0x65ed('0x26'):var _0x10df11=parseInt(_0x7223a1);if(_[_0x65ed('0x56')](_0x10df11)&&_[_0x65ed('0x57')](_0x4f5f79,_0x10df11)){_0x7cea83[_0x65ed('0x44')]('\x22'+_0x10df11+'\x22');}else{_0x56d3c4[_0x65ed('0x44')]('agent\x20not\x20exists');}break;case _0x65ed('0x58'):if(isEmail(_0x7223a1)){_0x7cea83[_0x65ed('0x44')]('\x22'+_0x7223a1+'\x22');}else{_0x56d3c4[_0x65ed('0x44')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x16baf7=moment(_0x7223a1,_0x65ed('0x59'),!![]);if(_0x16baf7['isValid']()){_0x7cea83[_0x65ed('0x44')]('\x22'+_0x7223a1+'\x22');}else{_0x56d3c4[_0x65ed('0x44')](_0x65ed('0x5a'));}break;default:_0x7cea83[_0x65ed('0x44')]('\x22'+_0x7223a1+'\x22');}}else{switch(_0x1837a2){case _0x65ed('0x5b'):case _0x65ed('0xf'):_0x56d3c4[_0x65ed('0x44')](_0x1837a2+'\x20not\x20specified');break;default:_0x7cea83[_0x65ed('0x44')]('\x22\x22');}}}}if(_0x56d3c4[_0x65ed('0x51')]){handleError(_0x4ffe78['data'][_0x2a8b54],{'code':_0x65ed('0x5c'),'message':_0x56d3c4[_0x65ed('0x11')]()});}else{fs[_0x65ed('0x5d')](_0x23da78,_0x7cea83[_0x65ed('0x11')]()+'\x0a');}_0x7cea83=[];}if(!(stats['rows']%0xc8)){socket[_0x65ed('0x5e')]('contact:import:'+_0x4a7e7f,stats);stats['errors']=[];}}if(stopped){logger[_0x65ed('0x3f')]('Abort\x20parser');_0x158181[_0x65ed('0x5f')]();}}catch(_0x450ae6){handleError(_0x4ffe78[_0x65ed('0x50')][_0x2a8b54],{'code':_0x65ed('0x60'),'message':_0x450ae6['message']});logger[_0x65ed('0x40')](_0x65ed('0x61'),_0x450ae6[_0x65ed('0x41')]);}},'complete':function(){try{var _0x5ba8df=[];var _0x2d2d9d=_0x65ed('0x29');if(_0x2aa8a6['duplicates']&&_0x2aa8a6[_0x65ed('0x62')][_0x65ed('0x51')]){_0x2d2d9d='cm_contacts_'+_0x4a7e7f;_0x5ba8df[_0x65ed('0x44')](_0x65ed('0x63')+_0x2d2d9d+_0x65ed('0x64'));}var _0x50b51d=util[_0x65ed('0xc')](_0x65ed('0x65'),_0x23da78,_0x2d2d9d,_0x360154,_0x2aa8a6[_0x65ed('0x23')],_0x2aa8a6[_0x65ed('0x39')]||null,NOW,NOW);if(_[_0x65ed('0x66')](_0x3e6c82[_0x65ed('0x21')])){_0x50b51d+=',\x20scheduledAt\x20=\x20NOW()';}_0x5ba8df['push'](_0x50b51d);if(_0x2aa8a6[_0x65ed('0x62')]&&_0x2aa8a6['duplicates']['length']){_0x5ba8df[_0x65ed('0x44')](insertCmContact(_0x2aa8a6[_0x65ed('0x23')],_0x2d2d9d,_0x2aa8a6['duplicates'],_0x3e6c82));_0x5ba8df[_0x65ed('0x44')](_0x65ed('0x67')+_0x2d2d9d+';');}_0x5ba8df[_0x65ed('0x44')](insertCmHopper(_0x2aa8a6['ListId'],_0x65ed('0x68'),_0x65ed('0x69'),_0x65ed('0x6a'),_0x99ae));_0x5ba8df[_0x65ed('0x44')](insertCmHopperBlack(_0x2aa8a6[_0x65ed('0x23')],_0x65ed('0x6b'),'voice_queues','VoiceQueueId'));_0x5ba8df[_0x65ed('0x44')](insertCmHopper(_0x2aa8a6[_0x65ed('0x23')],_0x65ed('0x6c'),_0x65ed('0x6d'),_0x65ed('0x6e'),_0x99ae));_0x5ba8df[_0x65ed('0x44')](insertCmHopperBlack(_0x2aa8a6[_0x65ed('0x23')],_0x65ed('0x6f'),'campaigns',_0x65ed('0x6e')));BPromise[_0x65ed('0x70')](_0x5ba8df,handleQuery)['then'](function(_0x4bb98){stats[_0x65ed('0x71')]=!![];stats['affectedRows']=_0x2aa8a6['duplicates']&&_0x2aa8a6[_0x65ed('0x62')]['length']?results[0x2][_0x65ed('0x72')]:results[0x0][_0x65ed('0x72')];socket[_0x65ed('0x5e')](_0x65ed('0x73')+_0x4a7e7f,stats);fs[_0x65ed('0x74')](_0x1328fd);fs[_0x65ed('0x74')](_0x23da78);process[_0x65ed('0x42')](0x0);})[_0x65ed('0x47')](function(_0x217caf){logger[_0x65ed('0x40')](_0x217caf[_0x65ed('0x41')]);process[_0x65ed('0x42')](0x1);});}catch(_0x5b1b40){logger[_0x65ed('0x40')](_0x65ed('0x75'),_0x5b1b40[_0x65ed('0x41')]);process['exit'](0x1);}},'error':function(_0x7e0e75,_0x1a1cb6,_0xbb9856,_0x2157fd){throw new Error(_0x2157fd);}});}function validate(){if(process[_0x65ed('0x76')]&&process['argv'][_0x65ed('0x51')]<0x4){throw new Error(_0x65ed('0x77'));}var _0x1abac7=path[_0x65ed('0x11')](config['root'],_0x65ed('0x78'),process[_0x65ed('0x76')][0x2]);if(!fs[_0x65ed('0x79')](_0x1abac7)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x7046b={};try{_0x7046b=JSON['parse'](process[_0x65ed('0x76')][0x3]);if(!_0x7046b[_0x65ed('0x4a')]){throw new Error(_0x65ed('0x7a'));}if(!_0x7046b[_0x65ed('0x4a')][_0x65ed('0xf')]){throw new Error(_0x65ed('0x7b'));}if(!_0x7046b[_0x65ed('0x4a')][_0x65ed('0x5b')]){throw new Error('firstName\x20is\x20mandatory');}var _0x231e30=0x0;if(_0x7046b[_0x65ed('0x4a')]['UserId']){_0x231e30=0x1;}if(!_0x7046b[_0x65ed('0x23')]){throw new Error(_0x65ed('0x7c'));}}catch(_0x39a342){throw new Error(_0x65ed('0x7d'));}var _0x42af16=[];try{_0x42af16=_['map'](JSON[_0x65ed('0x4f')](process[_0x65ed('0x76')][0x4]),'id');}catch(_0x16fc34){logger[_0x65ed('0x3f')](_0x65ed('0x7e'));}main(_0x1abac7,_0x7046b,_0x42af16,_0x231e30);}validate();process['on'](_0x65ed('0x7f'),handleStop);process['on'](_0x65ed('0x80'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index b53a445..e85725a 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 _0x2eb3=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x2eb3,0x15e));var _0x32eb=function(_0x40490a,_0xc5de74){_0x40490a=_0x40490a-0x0;var _0x376ff0=_0x2eb3[_0x40490a];return _0x376ff0;};'use strict';exports[_0x32eb('0x0')]=function(_0x1e9b3f,_0x262897){var _0x542fcc=[{'type':'string','content':_0x32eb('0x1'),'variableName':null}];switch(_0x1e9b3f[_0x32eb('0x2')]()){case _0x32eb('0x3'):switch(_0x262897['toLowerCase']()){case'inbound':_0x542fcc[_0x32eb('0x4')]({'type':_0x32eb('0x5'),'content':'','variableName':_0x32eb('0x6')});_0x542fcc[_0x32eb('0x4')]({'type':_0x32eb('0x5'),'content':'','variableName':_0x32eb('0x7')});break;case _0x32eb('0x8'):_0x542fcc['push']({'type':_0x32eb('0x9'),'content':_0x32eb('0xa'),'variableName':null});_0x542fcc[_0x32eb('0x4')]({'type':_0x32eb('0x5'),'content':'','variableName':_0x32eb('0xb')});break;}}return _0x542fcc;};exports[_0x32eb('0xc')]=function(_0x12be92,_0xea4c9d){var _0x542679=[];switch(_0x12be92['toLowerCase']()){case _0x32eb('0x3'):switch(_0xea4c9d['toLowerCase']()){case _0x32eb('0xd'):_0x542679=[{'type':_0x32eb('0x9'),'content':_0x32eb('0xe'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x32eb('0xf'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x7')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x11'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x12')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x13'),'keyType':'variable','variableName':_0x32eb('0x14')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x15'),'keyType':'variable','variableName':_0x32eb('0x6')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x16'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x17')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x18'),'keyType':'variable','variableName':_0x32eb('0x19')},{'type':_0x32eb('0x9'),'content':_0x32eb('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x1b'),'keyType':'variable','variableName':_0x32eb('0x1c')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x1d'),'keyType':'variable','variableName':_0x32eb('0xb')},{'type':_0x32eb('0x9'),'content':_0x32eb('0x1e'),'key':null,'keyType':null,'variableName':null},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x1f'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x19')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x20'),'keyType':'variable','variableName':_0x32eb('0x21')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x22'),'keyType':_0x32eb('0x5'),'variableName':_0x32eb('0x23')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x24'),'keyType':_0x32eb('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0x32eb('0x25'),'keyType':_0x32eb('0x5'),'variableName':'talktime'}];break;case _0x32eb('0x8'):_0x542679=[{'type':'string','content':_0x32eb('0xe'),'variableName':null},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x26'),'keyType':'variable','keyContent':'','variableName':_0x32eb('0xb')},{'type':'keyValue','content':'','key':_0x32eb('0x27'),'keyType':'variable','keyContent':'','variableName':_0x32eb('0x28')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x16'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x17')},{'type':_0x32eb('0x10'),'content':'','key':'Date','keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x29')},{'type':_0x32eb('0x9'),'content':_0x32eb('0x1e')},{'type':_0x32eb('0x10'),'content':'','key':_0x32eb('0x2a'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x2b')},{'type':_0x32eb('0x10'),'content':'','key':'Complete\x20Time','keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x2c')},{'type':'keyValue','content':'','key':_0x32eb('0x2d'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':_0x32eb('0x2e')},{'type':'keyValue','content':'','key':_0x32eb('0x2f'),'keyType':_0x32eb('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x542679;}; \ No newline at end of file +var _0x3884=['destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','membername','starttime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','queue','variable','calleridnum','outbound','Outbound\x20Call'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x3884,0xd5));var _0x4388=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x3884[_0x5b27da];return _0x3254f4;};'use strict';exports[_0x4388('0x0')]=function(_0x23a96f,_0x18d124){var _0x1939b1=[{'type':_0x4388('0x1'),'content':_0x4388('0x2'),'variableName':null}];switch(_0x23a96f['toLowerCase']()){case _0x4388('0x3'):switch(_0x18d124[_0x4388('0x4')]()){case _0x4388('0x5'):_0x1939b1[_0x4388('0x6')]({'type':'variable','content':'','variableName':_0x4388('0x7')});_0x1939b1[_0x4388('0x6')]({'type':_0x4388('0x8'),'content':'','variableName':_0x4388('0x9')});break;case _0x4388('0xa'):_0x1939b1[_0x4388('0x6')]({'type':'string','content':_0x4388('0xb'),'variableName':null});_0x1939b1['push']({'type':_0x4388('0x8'),'content':'','variableName':_0x4388('0xc')});break;}}return _0x1939b1;};exports[_0x4388('0xd')]=function(_0x1742e6,_0x97b324){var _0x4d839f=[];switch(_0x1742e6[_0x4388('0x4')]()){case'voice':switch(_0x97b324[_0x4388('0x4')]()){case'inbound':_0x4d839f=[{'type':'string','content':_0x4388('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x10'),'keyType':_0x4388('0x8'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x4388('0x11'),'keyType':_0x4388('0x8'),'variableName':_0x4388('0x12')},{'type':'keyValue','content':'','key':_0x4388('0x13'),'keyType':_0x4388('0x8'),'variableName':_0x4388('0x14')},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x15'),'keyType':_0x4388('0x8'),'variableName':_0x4388('0x7')},{'type':_0x4388('0xf'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0x4388('0x16')},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x17'),'keyType':'variable','variableName':_0x4388('0x18')},{'type':_0x4388('0x1'),'content':_0x4388('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4388('0x1a'),'keyType':'variable','variableName':_0x4388('0x1b')},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x1c'),'keyType':_0x4388('0x8'),'variableName':_0x4388('0xc')},{'type':_0x4388('0x1'),'content':_0x4388('0x1d'),'key':null,'keyType':null,'variableName':null},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x1e'),'keyType':_0x4388('0x8'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x4388('0x1f'),'keyType':_0x4388('0x8'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':'variable','variableName':'agentcompleteAt'},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x20'),'keyType':_0x4388('0x8'),'variableName':_0x4388('0x21')},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x22'),'keyType':'variable','variableName':_0x4388('0x23')}];break;case'outbound':_0x4d839f=[{'type':_0x4388('0x1'),'content':_0x4388('0xe'),'variableName':null},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x24'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x4388('0xf'),'content':'','key':'Member\x20Name','keyType':_0x4388('0x8'),'keyContent':'','variableName':_0x4388('0x25')},{'type':_0x4388('0xf'),'content':'','key':'UniqueId','keyType':_0x4388('0x8'),'keyContent':'','variableName':_0x4388('0x16')},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x17'),'keyType':_0x4388('0x8'),'keyContent':'','variableName':_0x4388('0x26')},{'type':_0x4388('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x4388('0xf'),'content':'','key':'Answer\x20Time','keyType':_0x4388('0x8'),'keyContent':'','variableName':'answertime'},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x27'),'keyType':_0x4388('0x8'),'keyContent':'','variableName':_0x4388('0x28')},{'type':'keyValue','content':'','key':_0x4388('0x29'),'keyType':_0x4388('0x8'),'keyContent':'','variableName':_0x4388('0x2a')},{'type':_0x4388('0xf'),'content':'','key':_0x4388('0x2b'),'keyType':_0x4388('0x8'),'keyContent':'','variableName':_0x4388('0x2c')}];break;}}return _0x4d839f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index d2f64f1..a9a8cd4 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 _0x3f6d=['error','tracked','user','clone','omit','phone','mobile','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','null','then','info'];(function(_0x45bee0,_0x42bf09){var _0x1fcfd5=function(_0x235b6a){while(--_0x235b6a){_0x45bee0['push'](_0x45bee0['shift']());}};_0x1fcfd5(++_0x42bf09);}(_0x3f6d,0xee));var _0xd3f6=function(_0x22bb3d,_0x472b68){_0x22bb3d=_0x22bb3d-0x0;var _0x1916f8=_0x3f6d[_0x22bb3d];return _0x1916f8;};'use strict';var _=require('lodash');var db=require(_0xd3f6('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xd3f6('0x1')),'mail':require(_0xd3f6('0x2'))('mail-interactions'),'fax':require(_0xd3f6('0x2'))('fax-interactions'),'sms':require(_0xd3f6('0x2'))(_0xd3f6('0x3')),'chat':require(_0xd3f6('0x2'))(_0xd3f6('0x4')),'whatsapp':require(_0xd3f6('0x2'))(_0xd3f6('0x5'))};function getInteractionId(_0x34f10a,_0x2dedf1,_0x56af62){if(_0x34f10a&&_0x34f10a[_[_0xd3f6('0x6')](_0x56af62)+_0xd3f6('0x7')]){return _0x34f10a[_['upperFirst'](_0x56af62)+_0xd3f6('0x7')];}else if(_0x34f10a&&_0x34f10a['id']){return _0x34f10a['id'];}else if(_0x2dedf1&&_0x2dedf1['id']){return _0x2dedf1['id'];}else{return'unknown';}}function log(_0x1eea39,_0x2bae23,_0x32614b,_0x4def00,_0x4d7946,_0x2cb6bf){loggers[_0x4d7946['toLowerCase']()][_0x1eea39](_0xd3f6('0x8'),_0x2cb6bf['toUpperCase'](),_0x2bae23?_0x2bae23['id']:null,_0x2bae23?_0x2bae23[_0xd3f6('0x9')]:null,_0x2bae23?_0x2bae23[_0xd3f6('0xa')]:null,getInteractionId(_0x32614b,_0x4def00,_0x4d7946),_0x32614b?JSON['stringify'](_0x32614b):_0xd3f6('0xb'));}function updateUser(_0x4e94f1,_0x2a1c72,_0x5be05d,_0x2760de,_0x520e8d){db[_[_0xd3f6('0x6')](_0x2760de)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x2a1c72,_0x5be05d,_0x2760de)}})[_0xd3f6('0xc')](function(_0x5a3565){if(_0x5a3565){return _0x5a3565['update']({'UserId':_0x4e94f1?_0x4e94f1['id']:null});}})[_0xd3f6('0xc')](function(_0x1c3437){if(_0x1c3437){log(_0xd3f6('0xd'),_0x4e94f1,_0x2a1c72,_0x5be05d,_0x2760de,_0x520e8d);}})['catch'](function(){log(_0xd3f6('0xe'),_0x4e94f1,_0x2a1c72,_0x5be05d,_0x2760de,_0x520e8d);});}exports[_0xd3f6('0xf')]=function(_0x15d148,_0x8b3d36){return function(_0x37c3e3,_0xf7f5b6,_0x40600d){var _0x5b4660=_0x37c3e3[_0xd3f6('0x10')];var _0x37fbff={};var _0x22c8b5=_0x37c3e3['query'];if(_0x37fbff){_0x37fbff=_[_0xd3f6('0x11')](_0x37c3e3['body']);_0x37fbff=_[_0xd3f6('0x12')](_0x37fbff,['body','html',_0xd3f6('0x13'),'fax',_0xd3f6('0x14')]);}updateUser(_0x5b4660,_0x37fbff,_0x22c8b5,_0x15d148,_0x8b3d36);_0x40600d(null);};}; \ No newline at end of file +var _0x289e=['lodash','../../config/logger','mail-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','update','info','catch','error','user','query','clone','body','omit','phone','fax','mobile'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x289e,0xfc));var _0xe289=function(_0x4959d0,_0x21f44b){_0x4959d0=_0x4959d0-0x0;var _0x2a7258=_0x289e[_0x4959d0];return _0x2a7258;};'use strict';var _=require(_0xe289('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xe289('0x1'))('openchannel-interactions'),'mail':require(_0xe289('0x1'))(_0xe289('0x2')),'fax':require(_0xe289('0x1'))('fax-interactions'),'sms':require(_0xe289('0x1'))('sms-interactions'),'chat':require(_0xe289('0x1'))(_0xe289('0x3')),'whatsapp':require(_0xe289('0x1'))(_0xe289('0x4'))};function getInteractionId(_0x494816,_0x32d489,_0x579981){if(_0x494816&&_0x494816[_[_0xe289('0x5')](_0x579981)+_0xe289('0x6')]){return _0x494816[_[_0xe289('0x5')](_0x579981)+'InteractionId'];}else if(_0x494816&&_0x494816['id']){return _0x494816['id'];}else if(_0x32d489&&_0x32d489['id']){return _0x32d489['id'];}else{return'unknown';}}function log(_0x29ddc1,_0x596a8d,_0x3c28e5,_0x51472f,_0x18af2c,_0x4c341){loggers[_0x18af2c[_0xe289('0x7')]()][_0x29ddc1](_0xe289('0x8'),_0x4c341[_0xe289('0x9')](),_0x596a8d?_0x596a8d['id']:null,_0x596a8d?_0x596a8d[_0xe289('0xa')]:null,_0x596a8d?_0x596a8d[_0xe289('0xb')]:null,getInteractionId(_0x3c28e5,_0x51472f,_0x18af2c),_0x3c28e5?JSON[_0xe289('0xc')](_0x3c28e5):_0xe289('0xd'));}function updateUser(_0x1a8278,_0x480177,_0x52e501,_0x3aa4f9,_0x785bdb){db[_[_0xe289('0x5')](_0x3aa4f9)+'Interaction'][_0xe289('0xe')]({'where':{'id':getInteractionId(_0x480177,_0x52e501,_0x3aa4f9)}})[_0xe289('0xf')](function(_0x507160){if(_0x507160){return _0x507160[_0xe289('0x10')]({'UserId':_0x1a8278?_0x1a8278['id']:null});}})[_0xe289('0xf')](function(_0xdfb12d){if(_0xdfb12d){log(_0xe289('0x11'),_0x1a8278,_0x480177,_0x52e501,_0x3aa4f9,_0x785bdb);}})[_0xe289('0x12')](function(){log(_0xe289('0x13'),_0x1a8278,_0x480177,_0x52e501,_0x3aa4f9,_0x785bdb);});}exports['tracked']=function(_0x39f70d,_0x1437b0){return function(_0x5bcc4d,_0x260d28,_0x3e5414){var _0x4e4657=_0x5bcc4d[_0xe289('0x14')];var _0xf09f49={};var _0x3f5587=_0x5bcc4d[_0xe289('0x15')];if(_0xf09f49){_0xf09f49=_[_0xe289('0x16')](_0x5bcc4d[_0xe289('0x17')]);_0xf09f49=_[_0xe289('0x18')](_0xf09f49,[_0xe289('0x17'),'html',_0xe289('0x19'),_0xe289('0x1a'),_0xe289('0x1b')]);}updateUser(_0x4e4657,_0xf09f49,_0x3f5587,_0x39f70d,_0x1437b0);_0x3e5414(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 4a825c5..b8f29fa 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 _0x4331=['hasOwnProperty','License','findOne','then','count','json','User','user','isUserLimit','crypto','util','../../config/environment','license','data1','split','createDecipher','format','base64','utf8','final','parse'];(function(_0x8412d3,_0x5b96a6){var _0x1c18de=function(_0x48cd8a){while(--_0x48cd8a){_0x8412d3['push'](_0x8412d3['shift']());}};_0x1c18de(++_0x5b96a6);}(_0x4331,0x9c));var _0x1433=function(_0x28e502,_0x3e36c5){_0x28e502=_0x28e502-0x0;var _0x2fd662=_0x4331[_0x28e502];return _0x2fd662;};'use strict';var crypto=require(_0x1433('0x0'));var util=require(_0x1433('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x1433('0x2'));function getValueFromLicense(_0x155b46,_0x38db9b){if(_0x155b46&&_0x38db9b){if(_0x38db9b['data1']&&_0x38db9b[_0x1433('0x3')]){var _0x29e51e=_0x38db9b[_0x1433('0x4')];var _0x4ba616=_0x38db9b[_0x1433('0x3')];var _0x1ca7ab=_0x29e51e[_0x1433('0x5')]('-')[0x4];var _0x69d683=_0x29e51e[_0x1433('0x5')]('-')[0x0];var _0x136501=crypto[_0x1433('0x6')]('aes-256-ctr',util[_0x1433('0x7')]('%s:%s:%s',_0x1ca7ab,_0x29e51e,_0x69d683));var _0x573d11=_0x136501['update'](_0x4ba616,_0x1433('0x8'),_0x1433('0x9'));_0x573d11+=_0x136501[_0x1433('0xa')](_0x1433('0x9'));var _0x19b1f7=JSON[_0x1433('0xb')](_0x573d11);return _0x19b1f7[_0x1433('0xc')](_0x155b46)?_0x19b1f7[_0x155b46]:null;}}return null;}function isLimit(_0x1010cf,_0x43b5f7,_0x40e607,_0x2d7763){var _0x22d29d=_0x43b5f7;return compose()['use'](function(_0xe6b533,_0x3954f6,_0x121c07){return db[_0x1433('0xd')][_0x1433('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x1433('0xf')](function(_0x5379fa){var _0x4bd3e7=getValueFromLicense(_0x1010cf,_0x5379fa);return _0x4bd3e7?_0x4bd3e7:_0x22d29d;})[_0x1433('0xf')](function(_0x209b65){_0x22d29d=_0x209b65;return _0x40e607[_0x1433('0x10')](_0x2d7763);})[_0x1433('0xf')](function(_0x1828f8){if(_0x1828f8>=_0x22d29d){return _0x3954f6['status'](0x193)[_0x1433('0x11')]({'message':util[_0x1433('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1010cf)});}_0x121c07();})['catch'](function(_0xad4d8c){_0x121c07(_0xad4d8c);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x1433('0x12')],{'where':{'$or':[{'role':'admin'},{'role':_0x1433('0x13')}]}});}exports[_0x1433('0x14')]=isUserLimit; \ No newline at end of file +var _0xc3dd=['hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8'];(function(_0x1c1777,_0x4f345b){var _0x1e634c=function(_0x16df88){while(--_0x16df88){_0x1c1777['push'](_0x1c1777['shift']());}};_0x1e634c(++_0x4f345b);}(_0xc3dd,0xa3));var _0xdc3d=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0xc3dd[_0x5ad07c];return _0x204bae;};'use strict';var crypto=require(_0xdc3d('0x0'));var util=require(_0xdc3d('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xdc3d('0x2'));function getValueFromLicense(_0xec3dc,_0x4ab517){if(_0xec3dc&&_0x4ab517){if(_0x4ab517[_0xdc3d('0x3')]&&_0x4ab517[_0xdc3d('0x4')]){var _0x3b3f97=_0x4ab517[_0xdc3d('0x3')];var _0x46c4e7=_0x4ab517['license'];var _0x4cb632=_0x3b3f97[_0xdc3d('0x5')]('-')[0x4];var _0x3e1c62=_0x3b3f97[_0xdc3d('0x5')]('-')[0x0];var _0x385695=crypto['createDecipher'](_0xdc3d('0x6'),util[_0xdc3d('0x7')](_0xdc3d('0x8'),_0x4cb632,_0x3b3f97,_0x3e1c62));var _0x106fe1=_0x385695[_0xdc3d('0x9')](_0x46c4e7,_0xdc3d('0xa'),_0xdc3d('0xb'));_0x106fe1+=_0x385695['final'](_0xdc3d('0xb'));var _0x300c2=JSON['parse'](_0x106fe1);return _0x300c2[_0xdc3d('0xc')](_0xec3dc)?_0x300c2[_0xec3dc]:null;}}return null;}function isLimit(_0x3682d6,_0x5edd3b,_0x73033b,_0x55a160){var _0x1e7806=_0x5edd3b;return compose()[_0xdc3d('0xd')](function(_0xc65e66,_0x20ad44,_0x5abb21){return db[_0xdc3d('0xe')][_0xdc3d('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x45c0e4){var _0x2e01e6=getValueFromLicense(_0x3682d6,_0x45c0e4);return _0x2e01e6?_0x2e01e6:_0x1e7806;})[_0xdc3d('0x10')](function(_0x211548){_0x1e7806=_0x211548;return _0x73033b['count'](_0x55a160);})[_0xdc3d('0x10')](function(_0x59b79b){if(_0x59b79b>=_0x1e7806){return _0x20ad44[_0xdc3d('0x11')](0x193)[_0xdc3d('0x12')]({'message':util[_0xdc3d('0x7')](_0xdc3d('0x13'),_0x3682d6)});}_0x5abb21();})[_0xdc3d('0x14')](function(_0x3f90db){_0x5abb21(_0x3f90db);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xdc3d('0x15')],{'where':{'$or':[{'role':_0xdc3d('0x16')},{'role':_0xdc3d('0x17')}]}});}exports[_0xdc3d('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 7b6d665..bf433d0 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 _0x50d7=['$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','[$and]','replace','split','length','shift','match','forEach','indexOf','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20'];(function(_0xef01fc,_0x161731){var _0x20cd53=function(_0x47e11d){while(--_0x47e11d){_0xef01fc['push'](_0xef01fc['shift']());}};_0x20cd53(++_0x161731);}(_0x50d7,0x1c7));var _0x750d=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x50d7[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x750d('0x0'));var moment=require(_0x750d('0x1'));exports[_0x750d('0x2')]=function(_0x425c75){var _0x17d179={'conditions':[]};_0x17d179[_0x750d('0x3')]=_[_0x750d('0x4')](_0x425c75,_0x750d('0x5'))?'or':'and';var _0x4cd626=_0x425c75['replace'](_0x750d('0x6'),'')[_0x750d('0x7')](_0x750d('0x5'),'')[_0x750d('0x8')]('||');for(var _0x38b470=0x0;_0x38b470<_0x4cd626[_0x750d('0x9')];_0x38b470++){var _0x1bbd4b=_0x4cd626[_0x38b470][_0x750d('0x8')](':=');var _0xc36269=_0x1bbd4b[0x0];var _0x4e8e8e=_0x1bbd4b['slice'](0x1);_0x4e8e8e['forEach'](function(_0x1f8ac2){var _0x52e06f=_0x1f8ac2[_0x750d('0x8')]('[')[_0x750d('0xa')]();var _0x4d3938=_0x1f8ac2[_0x750d('0xb')](/\[(.*?)\]/g);_0x4d3938[_0x750d('0xc')](function(_0x3ca680){var _0x17b35b=_0x3ca680[_0x750d('0x8')]('[')['filter'](function(_0x4a40a8){return _0x4a40a8[_0x750d('0xd')](']')>-0x1;})['map'](function(_0x597510){return _0x597510[_0x750d('0x8')](']')[0x0];})[0x0];_0x17d179[_0x750d('0xe')][_0x750d('0xf')]({'field':_0xc36269,'operator':_0x52e06f,'value':_0x17b35b});});});}return _0x17d179;};exports[_0x750d('0x10')]=function(_0x427483,_0x1210f0,_0x40a26c){var _0x4648b2={};if(_0x1210f0===_0x750d('0x11')){if(_0x40a26c[_0x750d('0x12')]===_0x750d('0x13')){_0x40a26c[_0x750d('0x12')]='$between';_0x40a26c[_0x750d('0x14')]+=','+_0x40a26c['value'];}else if(_[_0x750d('0x15')](['$gt',_0x750d('0x16')],_0x40a26c[_0x750d('0x12')])){_0x40a26c[_0x750d('0x14')]=moment(_0x40a26c['value'])[_0x750d('0x17')](0x1,'days')[_0x750d('0x18')](_0x750d('0x19'));}}if(_0x40a26c[_0x750d('0x1a')]){_0x1210f0=_0x40a26c[_0x750d('0x1a')];_0x4648b2[_0x750d('0x1b')]=_0x750d('0x1c')+_0x427483+'.'+_0x40a26c[_0x750d('0x1d')]+_0x750d('0x1e')+_0x40a26c[_0x750d('0x1a')]+')\x20'+parseOperator(_0x40a26c[_0x750d('0x12')]);}else{_0x4648b2['text']=_0x427483+'.'+_0x40a26c[_0x750d('0x1d')]+'\x20'+parseOperator(_0x40a26c['operator']);}if(_['includes']([_0x750d('0x1f'),_0x750d('0x20')],_0x40a26c['operator']))_0x4648b2['text']='('+_0x4648b2[_0x750d('0x1b')]+_0x750d('0x21')+_0x427483+'.'+_0x40a26c[_0x750d('0x1d')]+'\x20IS\x20NULL)';_0x4648b2[_0x750d('0x14')]=parseValue(_0x1210f0,_0x40a26c[_0x750d('0x12')],_0x40a26c[_0x750d('0x14')]);return _0x4648b2;};function parseOperator(_0x135875){var _0x2670ce;switch(_0x135875){case _0x750d('0x22'):_0x2670ce=_0x750d('0x23');break;case'$notIn':_0x2670ce='NOT\x20IN\x20?';break;case _0x750d('0x13'):_0x2670ce=_0x750d('0x24');break;case _0x750d('0x1f'):_0x2670ce='<>\x20?';break;case _0x750d('0x25'):case _0x750d('0x26'):case _0x750d('0x27'):_0x2670ce=_0x750d('0x28');break;case _0x750d('0x29'):_0x2670ce=_0x750d('0x2a');break;case _0x750d('0x2b'):_0x2670ce=_0x750d('0x2c');break;case _0x750d('0x16'):_0x2670ce=_0x750d('0x2d');break;case _0x750d('0x2e'):_0x2670ce='>=\x20?';break;case _0x750d('0x2f'):_0x2670ce=_0x750d('0x30');break;}return _0x2670ce;}function parseValue(_0x5e63c6,_0x271bcc,_0x4ad966){var _0x555b26={'start':undefined,'end':undefined};switch(_0x271bcc){case _0x750d('0x22'):case _0x750d('0x20'):_0x555b26[_0x750d('0x31')]=_0x4ad966[_0x750d('0x8')](',');break;case _0x750d('0x25'):_0x555b26['start']='%'+_0x4ad966+'%';break;case'$startsWith':_0x555b26['start']=_0x4ad966+'%';break;case _0x750d('0x27'):_0x555b26[_0x750d('0x31')]='%'+_0x4ad966;break;case _0x750d('0x2f'):var _0xe11e4f=_0x4ad966[_0x750d('0x8')](',');var _0x4ad966=_0xe11e4f[_0x750d('0xa')]();var _0x4da7f0=_0xe11e4f['pop']();if(_0x5e63c6===_0x750d('0x11')){_0x4ad966=moment(_0x4ad966)[_0x750d('0x32')](0x0,!![])[_0x750d('0x18')]();_0x4da7f0=moment(_0x4da7f0)[_0x750d('0x32')](0x0,!![])[_0x750d('0x17')](0x17,_0x750d('0x33'))['add'](0x3b,_0x750d('0x34'))['add'](0x3b,_0x750d('0x35'))['format']();}_0x555b26={'start':_0x4ad966,'end':_0x4da7f0};break;default:_0x555b26[_0x750d('0x31')]=_0x4ad966;break;}return _0x555b26;} \ No newline at end of file +var _0x5649=['days','format','YYYY-MM-DD','castTo','CAST(','field','text','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','start','$substring','$startsWith','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','startsWith','[$or]','replace','split','length','slice','forEach','shift','filter','indexOf','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte'];(function(_0x3c37b7,_0x5a57ee){var _0x381fe8=function(_0x548e1b){while(--_0x548e1b){_0x3c37b7['push'](_0x3c37b7['shift']());}};_0x381fe8(++_0x5a57ee);}(_0x5649,0xc2));var _0x9564=function(_0xcba291,_0x10e9d5){_0xcba291=_0xcba291-0x0;var _0x162274=_0x5649[_0xcba291];return _0x162274;};'use strict';var _=require(_0x9564('0x0'));var moment=require(_0x9564('0x1'));exports['parseSearch']=function(_0x4f243f){var _0x4686a2={'conditions':[]};_0x4686a2['sqlOperator']=_[_0x9564('0x2')](_0x4f243f,_0x9564('0x3'))?'or':'and';var _0x29d41b=_0x4f243f[_0x9564('0x4')]('[$and]','')[_0x9564('0x4')](_0x9564('0x3'),'')[_0x9564('0x5')]('||');for(var _0x553bf3=0x0;_0x553bf3<_0x29d41b[_0x9564('0x6')];_0x553bf3++){var _0x2294e0=_0x29d41b[_0x553bf3][_0x9564('0x5')](':=');var _0x2f743f=_0x2294e0[0x0];var _0x185aac=_0x2294e0[_0x9564('0x7')](0x1);_0x185aac[_0x9564('0x8')](function(_0x382438){var _0x5eaed1=_0x382438[_0x9564('0x5')]('[')[_0x9564('0x9')]();var _0x536d5a=_0x382438['match'](/\[(.*?)\]/g);_0x536d5a[_0x9564('0x8')](function(_0x120aa3){var _0x2b68f6=_0x120aa3['split']('[')[_0x9564('0xa')](function(_0x4ce686){return _0x4ce686[_0x9564('0xb')](']')>-0x1;})['map'](function(_0x4add1e){return _0x4add1e[_0x9564('0x5')](']')[0x0];})[0x0];_0x4686a2[_0x9564('0xc')][_0x9564('0xd')]({'field':_0x2f743f,'operator':_0x5eaed1,'value':_0x2b68f6});});});}return _0x4686a2;};exports[_0x9564('0xe')]=function(_0x508476,_0x1f6f8c,_0x38537e){var _0x385b34={};if(_0x1f6f8c===_0x9564('0xf')){if(_0x38537e[_0x9564('0x10')]===_0x9564('0x11')){_0x38537e['operator']=_0x9564('0x12');_0x38537e['value']+=','+_0x38537e[_0x9564('0x13')];}else if(_['includes']([_0x9564('0x14'),_0x9564('0x15')],_0x38537e[_0x9564('0x10')])){_0x38537e['value']=moment(_0x38537e[_0x9564('0x13')])['add'](0x1,_0x9564('0x16'))[_0x9564('0x17')](_0x9564('0x18'));}}if(_0x38537e[_0x9564('0x19')]){_0x1f6f8c=_0x38537e[_0x9564('0x19')];_0x385b34['text']=_0x9564('0x1a')+_0x508476+'.'+_0x38537e[_0x9564('0x1b')]+'\x20AS\x20'+_0x38537e['castTo']+')\x20'+parseOperator(_0x38537e[_0x9564('0x10')]);}else{_0x385b34[_0x9564('0x1c')]=_0x508476+'.'+_0x38537e[_0x9564('0x1b')]+'\x20'+parseOperator(_0x38537e[_0x9564('0x10')]);}if(_['includes'](['$ne','$notIn'],_0x38537e[_0x9564('0x10')]))_0x385b34[_0x9564('0x1c')]='('+_0x385b34['text']+_0x9564('0x1d')+_0x508476+'.'+_0x38537e[_0x9564('0x1b')]+_0x9564('0x1e');_0x385b34[_0x9564('0x13')]=parseValue(_0x1f6f8c,_0x38537e[_0x9564('0x10')],_0x38537e['value']);return _0x385b34;};function parseOperator(_0x526545){var _0x24d58a;switch(_0x526545){case _0x9564('0x1f'):_0x24d58a=_0x9564('0x20');break;case _0x9564('0x21'):_0x24d58a=_0x9564('0x22');break;case _0x9564('0x11'):_0x24d58a=_0x9564('0x23');break;case _0x9564('0x24'):_0x24d58a=_0x9564('0x25');break;case'$substring':case'$startsWith':case _0x9564('0x26'):_0x24d58a=_0x9564('0x27');break;case _0x9564('0x28'):_0x24d58a=_0x9564('0x29');break;case _0x9564('0x14'):_0x24d58a='>\x20?';break;case _0x9564('0x15'):_0x24d58a=_0x9564('0x2a');break;case _0x9564('0x2b'):_0x24d58a=_0x9564('0x2c');break;case _0x9564('0x12'):_0x24d58a='BETWEEN\x20?\x20AND\x20?';break;}return _0x24d58a;}function parseValue(_0x9f1cec,_0x2728e3,_0x5861f1){var _0x3aa0d3={'start':undefined,'end':undefined};switch(_0x2728e3){case _0x9564('0x1f'):case _0x9564('0x21'):_0x3aa0d3[_0x9564('0x2d')]=_0x5861f1['split'](',');break;case _0x9564('0x2e'):_0x3aa0d3[_0x9564('0x2d')]='%'+_0x5861f1+'%';break;case _0x9564('0x2f'):_0x3aa0d3[_0x9564('0x2d')]=_0x5861f1+'%';break;case _0x9564('0x26'):_0x3aa0d3[_0x9564('0x2d')]='%'+_0x5861f1;break;case _0x9564('0x12'):var _0x29d30e=_0x5861f1['split'](',');var _0x5861f1=_0x29d30e[_0x9564('0x9')]();var _0x4d063b=_0x29d30e[_0x9564('0x30')]();if(_0x9f1cec===_0x9564('0xf')){_0x5861f1=moment(_0x5861f1)[_0x9564('0x31')](0x0,!![])[_0x9564('0x17')]();_0x4d063b=moment(_0x4d063b)['utcOffset'](0x0,!![])[_0x9564('0x32')](0x17,_0x9564('0x33'))[_0x9564('0x32')](0x3b,_0x9564('0x34'))['add'](0x3b,_0x9564('0x35'))[_0x9564('0x17')]();}_0x3aa0d3={'start':_0x5861f1,'end':_0x4d063b};break;default:_0x3aa0d3['start']=_0x5861f1;break;}return _0x3aa0d3;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 5784d7f..9293262 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 _0x2c32=['length','omit','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','name','options','sequelize','parse','keys','includes','fields','split','filters','isEmpty','forOwn','DATE','isPlainObject','YYYY-MM-DD','utc','$lte','format','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','ASC'];(function(_0x4071cc,_0x2ba75f){var _0x2f2f8c=function(_0x5bd564){while(--_0x5bd564){_0x4071cc['push'](_0x4071cc['shift']());}};_0x2f2f8c(++_0x2ba75f);}(_0x2c32,0x16e));var _0x22c3=function(_0x56a387,_0x304d8c){_0x56a387=_0x56a387-0x0;var _0x4f9535=_0x2c32[_0x56a387];return _0x4f9535;};'use strict';var _=require('lodash');var sequelize=require(_0x22c3('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x969e82){var _0xc8e895=['ne'];try{var _0x3d3d58=JSON[_0x22c3('0x1')](_0x969e82);var _0x3bff1b=Object[_0x22c3('0x2')](_0x3d3d58)[0x0];return _0xc8e895[_0x22c3('0x3')](_0x3bff1b);}catch(_0x20fbfd){return![];}}function getOperatorValue(_0x3ccfdc){var _0x3b7eae=JSON[_0x22c3('0x1')](_0x3ccfdc);var _0x2e68db=Object[_0x22c3('0x2')](_0x3b7eae)[0x0];var _0x35cb67=_0x3b7eae[_0x2e68db];return{['$'+_0x2e68db]:_0x35cb67};}exports[_0x22c3('0x4')]=function(_0x47a6ee){var _0x54a9ee=null;if(_0x47a6ee){_0x54a9ee=_0x47a6ee[_0x22c3('0x5')](',');}return _0x54a9ee;};exports[_0x22c3('0x6')]=function(_0x31d660,_0x51dafd){var _0x373fcb={};if(!_[_0x22c3('0x7')](_0x31d660)){_[_0x22c3('0x8')](_0x31d660,function(_0x6f0abd,_0x50631f){try{if(_0x51dafd){var _0x2b524b=_['find'](_0x51dafd,{'name':_0x50631f})||{};if(hasSequelizeOperator(_0x6f0abd)){_0x373fcb[_0x50631f]=getOperatorValue(_0x6f0abd);}else if(_0x2b524b['type']===_0x22c3('0x9')&&_[_0x22c3('0xa')](_0x6f0abd)){var _0x49cb81=JSON['parse'](_0x6f0abd);var _0x2e2b1a={'$gte':moment(moment(_0x49cb81['$gte'])['format'](_0x22c3('0xb')))[_0x22c3('0xc')]()['format'](),'$lte':moment(moment(_0x49cb81[_0x22c3('0xd')])[_0x22c3('0xe')](_0x22c3('0xb')))[_0x22c3('0xc')]()['subtract'](0x1,'s')[_0x22c3('0xe')]()};_0x373fcb[_0x50631f]=_0x2e2b1a;}else if(_0x2b524b['name']==='uniqueid'){_0x373fcb[_0x50631f]=_0x6f0abd;}else{_0x373fcb[_0x50631f]=_[_0x22c3('0xf')](_0x6f0abd)?_0x6f0abd:JSON['parse'](_0x6f0abd);}}else{_0x373fcb[_0x50631f]=_[_0x22c3('0xf')](_0x6f0abd)?_0x6f0abd:JSON[_0x22c3('0x1')](_0x6f0abd);}}catch(_0x525d31){_0x373fcb[_0x50631f]=_0x6f0abd[_0x22c3('0x5')](',');}});}return _0x373fcb;};exports[_0x22c3('0x10')]=function(_0xfe55fa){_0xfe55fa=parseInt(_0xfe55fa,0xa);if(!_0xfe55fa||_0xfe55fa<0x0){_0xfe55fa=LIMIT_VALUE;}return _0xfe55fa;};exports[_0x22c3('0x11')]=function(_0x1a552f){_0x1a552f=parseInt(_0x1a552f,0xa);if(!_0x1a552f||_0x1a552f<0x0){_0x1a552f=0x0;}return _0x1a552f;};exports[_0x22c3('0x12')]=function(_0x1ae8aa){var _0x6549fe,_0x3cdd69=null;if(_0x1ae8aa){_0x6549fe=_0x1ae8aa['split'](',');_0x3cdd69=_[_0x22c3('0x13')](_0x6549fe,function(_0xf94db){if(_0xf94db[_0x22c3('0x14')]('-')===0x0){return[_0xf94db===_0x22c3('0x15')?sequelize[_0x22c3('0x16')](sequelize[_0x22c3('0x17')]('priority'),_0x22c3('0x18')):_0xf94db['substr'](0x1),'DESC'];}else{return[_0xf94db===_0x22c3('0x15')?sequelize[_0x22c3('0x16')](sequelize[_0x22c3('0x17')]('priority'),'unsigned'):_0xf94db,_0x22c3('0x19')];}});}return _0x3cdd69;};exports['omit']=function(_0x5e8c43,_0x5117e4){if(_[_0x22c3('0x7')](_0x5e8c43)){return _0x5e8c43;}if(_['isArray'](_0x5e8c43)){for(var _0x5f5e0b=0x0;_0x5f5e0b<_0x5e8c43[_0x22c3('0x1a')];_0x5f5e0b+=0x1){_0x5e8c43[_0x5f5e0b]=this[_0x22c3('0x1b')](_0x5e8c43[_0x5f5e0b],_0x5117e4);}return _0x5e8c43;}if(!_[_0x22c3('0x1c')](_0x5e8c43)){return _0x5e8c43;}if(_[_0x22c3('0x1d')](_0x5117e4)){_0x5117e4=[_0x5117e4];}if(!_[_0x22c3('0xf')](_0x5117e4)){return _0x5e8c43;}for(var _0x26f4e3=0x0;_0x26f4e3<_0x5117e4['length'];_0x26f4e3+=0x1){_[_0x22c3('0x1e')](_0x5e8c43,_0x5117e4[_0x26f4e3]);}for(var _0x3523a3 in _0x5e8c43){if(_0x5e8c43['hasOwnProperty'](_0x3523a3)){_0x5e8c43[_0x3523a3]=this['omit'](_0x5e8c43[_0x3523a3],_0x5117e4);}}return _0x5e8c43;};exports[_0x22c3('0x1f')]=function(_0x402b1b){return _0x402b1b[_0x22c3('0x20')](RegExp(_0x22c3('0x21')))?!![]:![];};exports['isEmail']=function(_0x4aae35){return _0x4aae35['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x22c3('0x22')]=function(_0x255fb9){var _0x1d5aae=[];_0x255fb9[_0x22c3('0x5')](/[ ,]+/)[_0x22c3('0x23')](function(_0x3789b8){_0x3789b8=_0x3789b8[_0x22c3('0x24')](/([^:]")"+/g,'$1');_0x3789b8='+'+_0x3789b8+'*';if(_0x3789b8[_0x22c3('0x3')]('@'))_0x3789b8='\x22'+_0x3789b8+'\x22';_0x1d5aae[_0x22c3('0x25')](_0x3789b8);});return _0x1d5aae[_0x22c3('0x26')]('\x20');};exports[_0x22c3('0x27')]=function(_0x4230ce,_0x669c82,_0x59bf50){var _0x48712b={},_0x43ac46={};if(_0x669c82[_0x22c3('0x28')][_0x22c3('0x29')]){_0x669c82[_0x22c3('0x28')]['id']=_0x669c82[_0x22c3('0x28')][_0x22c3('0x29')];delete _0x669c82[_0x22c3('0x28')][_0x22c3('0x29')];}_0x48712b[_0x22c3('0x2a')]=_[_0x22c3('0x13')](_0x4230ce,'name');_0x48712b[_0x22c3('0x28')]=_['keys'](_0x669c82[_0x22c3('0x28')]);_0x48712b[_0x22c3('0x6')]=_[_0x22c3('0x2b')](_0x48712b['model'],_0x48712b['query']);_0x43ac46['attributes']=_[_0x22c3('0x2b')](_0x48712b[_0x22c3('0x2a')],this[_0x22c3('0x4')](_0x669c82[_0x22c3('0x28')][_0x22c3('0x4')]));_0x43ac46['attributes']=_0x43ac46[_0x22c3('0x2c')][_0x22c3('0x1a')]?_0x43ac46[_0x22c3('0x2c')]:_0x48712b[_0x22c3('0x2a')];if(!_0x669c82[_0x22c3('0x28')][_0x22c3('0x2d')](_0x22c3('0x2e'))){_0x43ac46[_0x22c3('0x10')]=this[_0x22c3('0x10')](_0x669c82[_0x22c3('0x28')]['limit']);_0x43ac46[_0x22c3('0x11')]=this['offset'](_0x669c82['query'][_0x22c3('0x11')]);}_0x43ac46[_0x22c3('0x2f')]=this[_0x22c3('0x12')](_0x669c82[_0x22c3('0x28')][_0x22c3('0x12')]);_0x43ac46[_0x22c3('0x30')]=this[_0x22c3('0x6')](_[_0x22c3('0x31')](_0x669c82[_0x22c3('0x28')],_0x48712b[_0x22c3('0x6')]),_0x4230ce);if(_0x669c82['query'][_0x22c3('0x32')]){_0x43ac46[_0x22c3('0x30')]=_[_0x22c3('0x33')](_0x43ac46[_0x22c3('0x30')],{'$or':_[_0x22c3('0x13')](_0x4230ce,function(_0x33d490){if(_0x33d490[_0x22c3('0x34')]!==_0x22c3('0x35')){if(_0x59bf50){return sequelize[_0x22c3('0x30')](sequelize['fn']('lower',sequelize['col'](_0x33d490[_0x22c3('0x36')])),{'$like':sequelize['fn']('lower','%'+_0x669c82[_0x22c3('0x28')][_0x22c3('0x32')]+'%')});}else{var _0x27f1fa={};_0x27f1fa[_0x33d490[_0x22c3('0x36')]]={'$like':'%'+_0x669c82['query'][_0x22c3('0x32')]+'%'};return _0x27f1fa;}}})});}_0x43ac46=_[_0x22c3('0x33')]({},_0x43ac46,_0x669c82[_0x22c3('0x37')]);return _0x43ac46;}; \ No newline at end of file +var _0x06a7=['split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','match','isEmail','forEach','replace','push','join','getOptions','$id','query','model','intersection','attributes','nolimit','order','where','filter','type','VIRTUAL','lodash','sequelize','moment','parse','includes','keys','fields'];(function(_0x52f444,_0x11eb63){var _0x4b68ee=function(_0x206344){while(--_0x206344){_0x52f444['push'](_0x52f444['shift']());}};_0x4b68ee(++_0x11eb63);}(_0x06a7,0x18f));var _0x706a=function(_0x2c5435,_0x1bbff8){_0x2c5435=_0x2c5435-0x0;var _0x1f7ffe=_0x06a7[_0x2c5435];return _0x1f7ffe;};'use strict';var _=require(_0x706a('0x0'));var sequelize=require(_0x706a('0x1'));var moment=require(_0x706a('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4b1cc2){var _0x1927e7=['ne'];try{var _0xd334a6=JSON[_0x706a('0x3')](_0x4b1cc2);var _0x5ed842=Object['keys'](_0xd334a6)[0x0];return _0x1927e7[_0x706a('0x4')](_0x5ed842);}catch(_0x392387){return![];}}function getOperatorValue(_0x864de4){var _0x5d94bc=JSON[_0x706a('0x3')](_0x864de4);var _0x190685=Object[_0x706a('0x5')](_0x5d94bc)[0x0];var _0x12a1af=_0x5d94bc[_0x190685];return{['$'+_0x190685]:_0x12a1af};}exports[_0x706a('0x6')]=function(_0x18378c){var _0xe463ee=null;if(_0x18378c){_0xe463ee=_0x18378c[_0x706a('0x7')](',');}return _0xe463ee;};exports[_0x706a('0x8')]=function(_0x184cc7,_0x2bb68c){var _0x29a50e={};if(!_[_0x706a('0x9')](_0x184cc7)){_[_0x706a('0xa')](_0x184cc7,function(_0xa28d8,_0x5cc6db){try{if(_0x2bb68c){var _0x3c7843=_[_0x706a('0xb')](_0x2bb68c,{'name':_0x5cc6db})||{};if(hasSequelizeOperator(_0xa28d8)){_0x29a50e[_0x5cc6db]=getOperatorValue(_0xa28d8);}else if(_0x3c7843['type']===_0x706a('0xc')&&_[_0x706a('0xd')](_0xa28d8)){var _0x25e4a7=JSON[_0x706a('0x3')](_0xa28d8);var _0x26054b={'$gte':moment(moment(_0x25e4a7[_0x706a('0xe')])[_0x706a('0xf')]('YYYY-MM-DD'))[_0x706a('0x10')]()['format'](),'$lte':moment(moment(_0x25e4a7[_0x706a('0x11')])[_0x706a('0xf')](_0x706a('0x12')))['utc']()[_0x706a('0x13')](0x1,'s')[_0x706a('0xf')]()};_0x29a50e[_0x5cc6db]=_0x26054b;}else if(_0x3c7843[_0x706a('0x14')]===_0x706a('0x15')){_0x29a50e[_0x5cc6db]=_0xa28d8;}else{_0x29a50e[_0x5cc6db]=_[_0x706a('0x16')](_0xa28d8)?_0xa28d8:JSON[_0x706a('0x3')](_0xa28d8);}}else{_0x29a50e[_0x5cc6db]=_[_0x706a('0x16')](_0xa28d8)?_0xa28d8:JSON['parse'](_0xa28d8);}}catch(_0x49e6bf){_0x29a50e[_0x5cc6db]=_0xa28d8[_0x706a('0x7')](',');}});}return _0x29a50e;};exports[_0x706a('0x17')]=function(_0x41f288){_0x41f288=parseInt(_0x41f288,0xa);if(!_0x41f288||_0x41f288<0x0){_0x41f288=LIMIT_VALUE;}return _0x41f288;};exports[_0x706a('0x18')]=function(_0x28206d){_0x28206d=parseInt(_0x28206d,0xa);if(!_0x28206d||_0x28206d<0x0){_0x28206d=0x0;}return _0x28206d;};exports[_0x706a('0x19')]=function(_0x185185){var _0x3a4878,_0x3bea2d=null;if(_0x185185){_0x3a4878=_0x185185[_0x706a('0x7')](',');_0x3bea2d=_[_0x706a('0x1a')](_0x3a4878,function(_0x8cce94){if(_0x8cce94[_0x706a('0x1b')]('-')===0x0){return[_0x8cce94===_0x706a('0x1c')?sequelize[_0x706a('0x1d')](sequelize['col'](_0x706a('0x1c')),_0x706a('0x1e')):_0x8cce94[_0x706a('0x1f')](0x1),'DESC'];}else{return[_0x8cce94===_0x706a('0x1c')?sequelize['cast'](sequelize[_0x706a('0x20')](_0x706a('0x1c')),'unsigned'):_0x8cce94,_0x706a('0x21')];}});}return _0x3bea2d;};exports[_0x706a('0x22')]=function(_0x2f4155,_0x39f88a){if(_['isEmpty'](_0x2f4155)){return _0x2f4155;}if(_['isArray'](_0x2f4155)){for(var _0x34b09a=0x0;_0x34b09a<_0x2f4155[_0x706a('0x23')];_0x34b09a+=0x1){_0x2f4155[_0x34b09a]=this['omit'](_0x2f4155[_0x34b09a],_0x39f88a);}return _0x2f4155;}if(!_[_0x706a('0x24')](_0x2f4155)){return _0x2f4155;}if(_[_0x706a('0x25')](_0x39f88a)){_0x39f88a=[_0x39f88a];}if(!_['isArray'](_0x39f88a)){return _0x2f4155;}for(var _0x38e179=0x0;_0x38e179<_0x39f88a[_0x706a('0x23')];_0x38e179+=0x1){_[_0x706a('0x26')](_0x2f4155,_0x39f88a[_0x38e179]);}for(var _0x430c3a in _0x2f4155){if(_0x2f4155[_0x706a('0x27')](_0x430c3a)){_0x2f4155[_0x430c3a]=this[_0x706a('0x22')](_0x2f4155[_0x430c3a],_0x39f88a);}}return _0x2f4155;};exports['isNumeric']=function(_0x51a7d0){return _0x51a7d0[_0x706a('0x28')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x706a('0x29')]=function(_0x3c27c5){return _0x3c27c5['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3e2c5d){var _0x2d07d2=[];_0x3e2c5d[_0x706a('0x7')](/[ ,]+/)[_0x706a('0x2a')](function(_0x21ad2c){_0x21ad2c=_0x21ad2c[_0x706a('0x2b')](/([^:]")"+/g,'$1');_0x21ad2c='+'+_0x21ad2c+'*';if(_0x21ad2c[_0x706a('0x4')]('@'))_0x21ad2c='\x22'+_0x21ad2c+'\x22';_0x2d07d2[_0x706a('0x2c')](_0x21ad2c);});return _0x2d07d2[_0x706a('0x2d')]('\x20');};exports[_0x706a('0x2e')]=function(_0x8d8162,_0x2f688a,_0x2262eb){var _0x4c9bd8={},_0x28ac72={};if(_0x2f688a['query'][_0x706a('0x2f')]){_0x2f688a[_0x706a('0x30')]['id']=_0x2f688a[_0x706a('0x30')][_0x706a('0x2f')];delete _0x2f688a[_0x706a('0x30')]['$id'];}_0x4c9bd8[_0x706a('0x31')]=_[_0x706a('0x1a')](_0x8d8162,_0x706a('0x14'));_0x4c9bd8['query']=_['keys'](_0x2f688a['query']);_0x4c9bd8[_0x706a('0x8')]=_[_0x706a('0x32')](_0x4c9bd8['model'],_0x4c9bd8[_0x706a('0x30')]);_0x28ac72[_0x706a('0x33')]=_[_0x706a('0x32')](_0x4c9bd8[_0x706a('0x31')],this[_0x706a('0x6')](_0x2f688a[_0x706a('0x30')][_0x706a('0x6')]));_0x28ac72[_0x706a('0x33')]=_0x28ac72[_0x706a('0x33')][_0x706a('0x23')]?_0x28ac72[_0x706a('0x33')]:_0x4c9bd8[_0x706a('0x31')];if(!_0x2f688a[_0x706a('0x30')][_0x706a('0x27')](_0x706a('0x34'))){_0x28ac72[_0x706a('0x17')]=this[_0x706a('0x17')](_0x2f688a[_0x706a('0x30')]['limit']);_0x28ac72[_0x706a('0x18')]=this['offset'](_0x2f688a[_0x706a('0x30')][_0x706a('0x18')]);}_0x28ac72[_0x706a('0x35')]=this[_0x706a('0x19')](_0x2f688a[_0x706a('0x30')][_0x706a('0x19')]);_0x28ac72[_0x706a('0x36')]=this['filters'](_['pick'](_0x2f688a[_0x706a('0x30')],_0x4c9bd8[_0x706a('0x8')]),_0x8d8162);if(_0x2f688a[_0x706a('0x30')][_0x706a('0x37')]){_0x28ac72[_0x706a('0x36')]=_['merge'](_0x28ac72[_0x706a('0x36')],{'$or':_['map'](_0x8d8162,function(_0x1301e3){if(_0x1301e3[_0x706a('0x38')]!==_0x706a('0x39')){if(_0x2262eb){return sequelize[_0x706a('0x36')](sequelize['fn']('lower',sequelize[_0x706a('0x20')](_0x1301e3[_0x706a('0x14')])),{'$like':sequelize['fn']('lower','%'+_0x2f688a[_0x706a('0x30')][_0x706a('0x37')]+'%')});}else{var _0x4388b5={};_0x4388b5[_0x1301e3[_0x706a('0x14')]]={'$like':'%'+_0x2f688a[_0x706a('0x30')][_0x706a('0x37')]+'%'};return _0x4388b5;}}})});}_0x28ac72=_['merge']({},_0x28ac72,_0x2f688a['options']);return _0x28ac72;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a8589c7..e0ea118 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4004=['path','passport','moment','./environment','../mysqldb','default','get','env','production','appPath','join','public','test','root','use','set','json\x20replacer','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler'];(function(_0x942eca,_0x1d0181){var _0x589c16=function(_0x235ca1){while(--_0x235ca1){_0x942eca['push'](_0x942eca['shift']());}};_0x589c16(++_0x1d0181);}(_0x4004,0x1a8));var _0x4400=function(_0x1e0ca5,_0x57fd4f){_0x1e0ca5=_0x1e0ca5-0x0;var _0x410923=_0x4004[_0x1e0ca5];return _0x410923;};'use strict';var express=require('express');var favicon=require(_0x4400('0x0'));var bodyParser=require(_0x4400('0x1'));var methodOverride=require(_0x4400('0x2'));var cookieParser=require(_0x4400('0x3'));var errorHandler=require(_0x4400('0x4'));var path=require(_0x4400('0x5'));var passport=require(_0x4400('0x6'));var cors=require('cors');var moment=require(_0x4400('0x7'));var config=require(_0x4400('0x8'));var db=require(_0x4400('0x9'))['db'];exports[_0x4400('0xa')]=function(_0x2ac372){var _0x3850cb=_0x2ac372[_0x4400('0xb')](_0x4400('0xc'));if(_0x3850cb===_0x4400('0xd')){_0x2ac372['set'](_0x4400('0xe'),path[_0x4400('0xf')](config['root'],_0x4400('0x10')));}if(_0x3850cb==='development'||_0x3850cb===_0x4400('0x11')){_0x2ac372['set']('appPath',path[_0x4400('0xf')](config[_0x4400('0x12')],'client'));_0x2ac372[_0x4400('0x13')](errorHandler());}_0x2ac372[_0x4400('0x14')](_0x4400('0x15'),function(_0x405681,_0x5c85a7){if(this[_0x405681]instanceof Date){_0x5c85a7=this[_0x405681]['toISOString']()['split']('.')[0x0]+'Z';}return _0x5c85a7;});_0x2ac372[_0x4400('0x13')](express[_0x4400('0x16')](_0x2ac372[_0x4400('0xb')](_0x4400('0xe'))));_0x2ac372[_0x4400('0x14')](_0x4400('0x17'),config[_0x4400('0x12')]+_0x4400('0x18'));_0x2ac372[_0x4400('0x19')](_0x4400('0x1a'),require(_0x4400('0x1b'))[_0x4400('0x1c')]);_0x2ac372[_0x4400('0x14')](_0x4400('0x1d'),'html');_0x2ac372[_0x4400('0x13')](bodyParser[_0x4400('0x1e')]({'limit':_0x4400('0x1f'),'extended':!![]}));_0x2ac372[_0x4400('0x13')](bodyParser['json']({'limit':_0x4400('0x1f')}));_0x2ac372['use'](cors());_0x2ac372[_0x4400('0x13')](methodOverride());_0x2ac372[_0x4400('0x13')](cookieParser());_0x2ac372[_0x4400('0x13')](passport[_0x4400('0x20')]());}; \ No newline at end of file +var _0x6fa6=['express','serve-favicon','method-override','errorhandler','path','passport','moment','./environment','../mysqldb','default','get','env','appPath','root','public','test','set','join','use','json\x20replacer','toISOString','split','static','/server/views','html','ejs','renderFile','view\x20engine','50mb','json','initialize'];(function(_0x128e62,_0x2ae3ef){var _0x55328f=function(_0x32171f){while(--_0x32171f){_0x128e62['push'](_0x128e62['shift']());}};_0x55328f(++_0x2ae3ef);}(_0x6fa6,0x7c));var _0x66fa=function(_0x5737ca,_0x4574bd){_0x5737ca=_0x5737ca-0x0;var _0x5ca566=_0x6fa6[_0x5737ca];return _0x5ca566;};'use strict';var express=require(_0x66fa('0x0'));var favicon=require(_0x66fa('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x66fa('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x66fa('0x3'));var path=require(_0x66fa('0x4'));var passport=require(_0x66fa('0x5'));var cors=require('cors');var moment=require(_0x66fa('0x6'));var config=require(_0x66fa('0x7'));var db=require(_0x66fa('0x8'))['db'];exports[_0x66fa('0x9')]=function(_0x1c1938){var _0x5b8378=_0x1c1938[_0x66fa('0xa')](_0x66fa('0xb'));if(_0x5b8378==='production'){_0x1c1938['set'](_0x66fa('0xc'),path['join'](config[_0x66fa('0xd')],_0x66fa('0xe')));}if(_0x5b8378==='development'||_0x5b8378===_0x66fa('0xf')){_0x1c1938[_0x66fa('0x10')]('appPath',path[_0x66fa('0x11')](config[_0x66fa('0xd')],'client'));_0x1c1938[_0x66fa('0x12')](errorHandler());}_0x1c1938[_0x66fa('0x10')](_0x66fa('0x13'),function(_0x241765,_0x5c129f){if(this[_0x241765]instanceof Date){_0x5c129f=this[_0x241765][_0x66fa('0x14')]()[_0x66fa('0x15')]('.')[0x0]+'Z';}return _0x5c129f;});_0x1c1938[_0x66fa('0x12')](express[_0x66fa('0x16')](_0x1c1938[_0x66fa('0xa')](_0x66fa('0xc'))));_0x1c1938['set']('views',config[_0x66fa('0xd')]+_0x66fa('0x17'));_0x1c1938['engine'](_0x66fa('0x18'),require(_0x66fa('0x19'))[_0x66fa('0x1a')]);_0x1c1938[_0x66fa('0x10')](_0x66fa('0x1b'),_0x66fa('0x18'));_0x1c1938[_0x66fa('0x12')](bodyParser['urlencoded']({'limit':_0x66fa('0x1c'),'extended':!![]}));_0x1c1938[_0x66fa('0x12')](bodyParser[_0x66fa('0x1d')]({'limit':_0x66fa('0x1c')}));_0x1c1938['use'](cors());_0x1c1938[_0x66fa('0x12')](methodOverride());_0x1c1938[_0x66fa('0x12')](cookieParser());_0x1c1938['use'](passport[_0x66fa('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 46aa6b2..d3d1aa9 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 _0xbb3f=['test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','createHash','md5','update','digest','hex','getUuid','licenseToken'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xbb3f,0x1dc));var _0xfbb3=function(_0x50e7fa,_0x2748f5){_0x50e7fa=_0x50e7fa-0x0;var _0x23cb6e=_0xbb3f[_0x50e7fa];return _0x23cb6e;};'use strict';var _=require(_0xfbb3('0x0'));var os=require('os');var crypto=require(_0xfbb3('0x1'));var machine=require(_0xfbb3('0x2'));var exec=require(_0xfbb3('0x3'))[_0xfbb3('0x4')];var config=require(_0xfbb3('0x5'));function getInterfaces(){var _0x3dc756=[];var _0x57e62a=os[_0xfbb3('0x6')]();var _0x27be7a=_[_0xfbb3('0x7')](_[_0xfbb3('0x8')](_0x57e62a));for(var _0x4d04a8=0x0;_0x4d04a8<_0x27be7a[_0xfbb3('0x9')];_0x4d04a8++){var _0x45ce19=_0x57e62a[_0x27be7a[_0x4d04a8]][_0xfbb3('0xa')](function(_0x14a499){return _0x14a499[_0xfbb3('0xb')]==='IPv4'&&_0x14a499[_0xfbb3('0xc')]===![];});_0x3dc756=_0x3dc756[_0xfbb3('0xd')](_0x45ce19);}return _0x3dc756;}function getFirstInterface(){var _0x5095e1=_['head'](getInterfaces());return{'macAddress':_0x5095e1&&_0x5095e1[_0xfbb3('0xe')]?_0x5095e1[_0xfbb3('0xe')]:_0xfbb3('0xf'),'ipAddress':_0x5095e1&&_0x5095e1[_0xfbb3('0x10')]?_0x5095e1[_0xfbb3('0x10')]:_0xfbb3('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xbf2ebd=_['orderBy'](os[_0xfbb3('0x12')]()[_0xfbb3('0x13')](function(_0x4801e4){return _0x4801e4['model'];}))[_0xfbb3('0x14')](':');return crypto[_0xfbb3('0x15')](_0xfbb3('0x16'))[_0xfbb3('0x17')](_0xbf2ebd)[_0xfbb3('0x18')](_0xfbb3('0x19'));}exports[_0xfbb3('0x1a')]=function(){var _0xc52a02=os['platform']();var _0x276b0a=/[0-9a-f-]{36}/;if(config[_0xfbb3('0x1b')]&&_0x276b0a[_0xfbb3('0x1c')](config[_0xfbb3('0x1b')])){return config[_0xfbb3('0x1b')];}else if(_0xc52a02===_0xfbb3('0x1d')){return exec(_0xfbb3('0x1e'),{'encoding':'utf8'})[_0xfbb3('0x1f')]('\x0d\x0a','');}else{var _0x22d060=getFirstInterface();var _0x58b6f6=getCPUhash();var _0x225071=_0x58b6f6+'|'+os[_0xfbb3('0x20')]()+'|'+_0x22d060[_0xfbb3('0x21')]+'|'+_0x22d060[_0xfbb3('0x22')];var _0x1d176d=crypto[_0xfbb3('0x15')](_0xfbb3('0x16'))[_0xfbb3('0x17')](_0x225071)[_0xfbb3('0x18')](_0xfbb3('0x19'));return _0x1d176d[_0xfbb3('0x23')](0x0,0x8)+'-'+_0x1d176d[_0xfbb3('0x23')](0x8,0xc)+'-'+_0x1d176d[_0xfbb3('0x23')](0xc,0x10)+'-'+_0x1d176d[_0xfbb3('0x23')](0x10,0x14)+'-'+_0x1d176d['substring'](0x14);}}; \ No newline at end of file +var _0xd6a0=['filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','createHash','md5','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','hex','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6a0,0x117));var _0x0d6a=function(_0x28965b,_0x45ba24){_0x28965b=_0x28965b-0x0;var _0x323553=_0xd6a0[_0x28965b];return _0x323553;};'use strict';var _=require(_0x0d6a('0x0'));var os=require('os');var crypto=require(_0x0d6a('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x0d6a('0x2'))[_0x0d6a('0x3')];var config=require(_0x0d6a('0x4'));function getInterfaces(){var _0x5e8457=[];var _0x987c25=os[_0x0d6a('0x5')]();var _0x2ed843=_[_0x0d6a('0x6')](_[_0x0d6a('0x7')](_0x987c25));for(var _0x16f7a9=0x0;_0x16f7a9<_0x2ed843[_0x0d6a('0x8')];_0x16f7a9++){var _0x1eb51c=_0x987c25[_0x2ed843[_0x16f7a9]][_0x0d6a('0x9')](function(_0x347645){return _0x347645[_0x0d6a('0xa')]===_0x0d6a('0xb')&&_0x347645[_0x0d6a('0xc')]===![];});_0x5e8457=_0x5e8457[_0x0d6a('0xd')](_0x1eb51c);}return _0x5e8457;}function getFirstInterface(){var _0x2c2ae=_['head'](getInterfaces());return{'macAddress':_0x2c2ae&&_0x2c2ae[_0x0d6a('0xe')]?_0x2c2ae['mac']:_0x0d6a('0xf'),'ipAddress':_0x2c2ae&&_0x2c2ae[_0x0d6a('0x10')]?_0x2c2ae[_0x0d6a('0x10')]:'127.0.0.1'};}exports[_0x0d6a('0x11')]=getFirstInterface;function getCPUhash(){var _0x2b4972=_['orderBy'](os[_0x0d6a('0x12')]()[_0x0d6a('0x13')](function(_0x98a4db){return _0x98a4db[_0x0d6a('0x14')];}))['join'](':');return crypto[_0x0d6a('0x15')](_0x0d6a('0x16'))[_0x0d6a('0x17')](_0x2b4972)[_0x0d6a('0x18')]('hex');}exports[_0x0d6a('0x19')]=function(){var _0x189de0=os[_0x0d6a('0x1a')]();var _0x105e40=/[0-9a-f-]{36}/;if(config[_0x0d6a('0x1b')]&&_0x105e40[_0x0d6a('0x1c')](config[_0x0d6a('0x1b')])){return config['licenseToken'];}else if(_0x189de0===_0x0d6a('0x1d')){return exec(_0x0d6a('0x1e'),{'encoding':'utf8'})[_0x0d6a('0x1f')]('\x0d\x0a','');}else{var _0x4d2b8a=getFirstInterface();var _0x210c76=getCPUhash();var _0x1fe4fd=_0x210c76+'|'+os['hostname']()+'|'+_0x4d2b8a[_0x0d6a('0x20')]+'|'+_0x4d2b8a[_0x0d6a('0x21')];var _0x259bf0=crypto[_0x0d6a('0x15')](_0x0d6a('0x16'))[_0x0d6a('0x17')](_0x1fe4fd)['digest'](_0x0d6a('0x22'));return _0x259bf0[_0x0d6a('0x23')](0x0,0x8)+'-'+_0x259bf0[_0x0d6a('0x23')](0x8,0xc)+'-'+_0x259bf0[_0x0d6a('0x23')](0xc,0x10)+'-'+_0x259bf0[_0x0d6a('0x23')](0x10,0x14)+'-'+_0x259bf0['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 559ddbf..ec462e7 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 _0x6b8f=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x1d3047,_0x3c1a42){var _0x13850f=function(_0x3106a9){while(--_0x3106a9){_0x1d3047['push'](_0x1d3047['shift']());}};_0x13850f(++_0x3c1a42);}(_0x6b8f,0xa6));var _0xf6b8=function(_0x4432ba,_0x767e85){_0x4432ba=_0x4432ba-0x0;var _0x335fab=_0x6b8f[_0x4432ba];return _0x335fab;};'use strict';var util=require(_0xf6b8('0x0'));var moment=require(_0xf6b8('0x1'));var rp=require(_0xf6b8('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xf6b8('0x3'))(module,_0xf6b8('0x4'));var db=require(_0xf6b8('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xf6b8('0x6'));var logger=require(_0xf6b8('0x7'))(_0xf6b8('0x8'));var HOST=_0xf6b8('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3131cd){return new BPromise(function(_0x38dbe9,_0x5186b5){var _0x38c4b8=util[_0xf6b8('0xa')](_0xf6b8('0xb'),HOST,_0x3131cd,module[_0xf6b8('0xc')]['version']);if(oldToken){_0x38c4b8=util[_0xf6b8('0xa')](_0xf6b8('0xd'),HOST,_0x3131cd,module[_0xf6b8('0xc')][_0xf6b8('0x4')],oldToken);}var _0x4ae654={'uri':_0x38c4b8,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4ae654)['then'](function(_0x35ab1a){_0x38dbe9(_0x35ab1a);})[_0xf6b8('0xe')](function(_0x202c9e){_0x5186b5(_0x202c9e);});});}function manageLicense(_0x2ccc74,_0x1b803f){var _0x203507=_0x1b803f['get']({'plain':!![]});if(!isOldTokenSent&&_0x203507[_0xf6b8('0xf')]!==_0x2ccc74&&!_0x203507[_0xf6b8('0x10')]){oldToken=_0x203507[_0xf6b8('0xf')];}httpRequest(_0x2ccc74)[_0xf6b8('0x11')](function(_0x2066fc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2066fc[_0xf6b8('0x12')]){isOldTokenSent=![];if(!_0x203507['license']&&_0x203507[_0xf6b8('0x8')]!=_0x2066fc[_0xf6b8('0x8')]||_0x203507[_0xf6b8('0x8')]&&_0x203507[_0xf6b8('0x10')]){logger[_0xf6b8('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x203507[_0xf6b8('0x8')]&&!_0x203507[_0xf6b8('0x10')]&&_0x203507['license']!=_0x2066fc['license']){logger[_0xf6b8('0x13')](_0xf6b8('0x14'));}if(_0x203507[_0xf6b8('0x8')]&&!_0x203507['data2']&&_0x203507['license']==_0x2066fc[_0xf6b8('0x8')]){return _0x1b803f;}return _0x1b803f[_0xf6b8('0x15')]({'data1':_0x2ccc74,'data2':null,'license':_0x2066fc[_0xf6b8('0x8')]});}else{if(_0x2066fc[_0xf6b8('0x8')]||_0x203507[_0xf6b8('0x8')]){if(!_0x203507['data2']){if(_0x203507[_0xf6b8('0xf')]==_0x2ccc74){GRAY_PERIOD_REASON=_0xf6b8('0x16');logger['info'](_0xf6b8('0x17'));}else{GRAY_PERIOD_REASON=_0xf6b8('0x18');logger['info'](_0xf6b8('0x19'),_0x203507['data1'],_0x2ccc74);}logger[_0xf6b8('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xf6b8('0x1a')](),moment()[_0xf6b8('0xa')](_0xf6b8('0x1b')));return _0x1b803f[_0xf6b8('0x15')]({'data2':encryptor[_0xf6b8('0x1c')](moment()[_0xf6b8('0xa')](_0xf6b8('0x1b')))});}else{if(moment()['diff'](encryptor[_0xf6b8('0x1d')](_0x203507[_0xf6b8('0x10')]),_0xf6b8('0x1e'))>DAYS){logger[_0xf6b8('0x13')](_0xf6b8('0x1f'),moment()[_0xf6b8('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x1b803f[_0xf6b8('0x15')]({'data1':_0x2ccc74,'data2':null,'license':null});}}}else{if(_0x203507['data1']!=_0x2ccc74){logger[_0xf6b8('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x203507[_0xf6b8('0xf')],_0x2ccc74);return _0x1b803f[_0xf6b8('0x15')]({'data1':_0x2ccc74,'data2':null,'license':null});}}}return _0x1b803f;})[_0xf6b8('0x11')](function(_0x3c8f8d){_0x1b803f=_0x3c8f8d;})[_0xf6b8('0xe')](function(_0xac2fa5){logger[_0xf6b8('0x20')](_0xac2fa5[_0xf6b8('0x21')]);})[_0xf6b8('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1b803f);},TIME);});}function defaultLicense(){var _0x3c8221=hardware['getUuid']();if(_0x3c8221){return db[_0xf6b8('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3c8221}})['spread'](function(_0x317484,_0x48f60d){logger[_0xf6b8('0x13')](_0xf6b8('0x24'),_0x3c8221);manageLicense(_0x3c8221,_0x317484);})[_0xf6b8('0xe')](function(_0x445bd9){logger[_0xf6b8('0x20')](_0x445bd9[_0xf6b8('0x21')]);});}}exports[_0xf6b8('0x25')]=defaultLicense; \ No newline at end of file +var _0xdd94=['finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error'];(function(_0xcfc92e,_0x4fe753){var _0x2fd951=function(_0x2999ab){while(--_0x2999ab){_0xcfc92e['push'](_0xcfc92e['shift']());}};_0x2fd951(++_0x4fe753);}(_0xdd94,0xa2));var _0x4dd9=function(_0x5032b6,_0x4c57a3){_0x5032b6=_0x5032b6-0x0;var _0x15e212=_0xdd94[_0x5032b6];return _0x15e212;};'use strict';var util=require(_0x4dd9('0x0'));var moment=require(_0x4dd9('0x1'));var rp=require(_0x4dd9('0x2'));var BPromise=require(_0x4dd9('0x3'));var pkginfo=require(_0x4dd9('0x4'))(module,_0x4dd9('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x4dd9('0x6'));var logger=require('../logger')(_0x4dd9('0x7'));var HOST=_0x4dd9('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4aee70){return new BPromise(function(_0x10852a,_0x546276){var _0xb2c079=util[_0x4dd9('0x9')](_0x4dd9('0xa'),HOST,_0x4aee70,module['exports']['version']);if(oldToken){_0xb2c079=util[_0x4dd9('0x9')](_0x4dd9('0xb'),HOST,_0x4aee70,module['exports'][_0x4dd9('0x5')],oldToken);}var _0x325487={'uri':_0xb2c079,'method':_0x4dd9('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x325487)['then'](function(_0x4e44e1){_0x10852a(_0x4e44e1);})[_0x4dd9('0xd')](function(_0x10dea5){_0x546276(_0x10dea5);});});}function manageLicense(_0x17a9ad,_0x1e233b){var _0x16f319=_0x1e233b[_0x4dd9('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x16f319[_0x4dd9('0xf')]!==_0x17a9ad&&!_0x16f319[_0x4dd9('0x10')]){oldToken=_0x16f319[_0x4dd9('0xf')];}httpRequest(_0x17a9ad)[_0x4dd9('0x11')](function(_0x2bfcb4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2bfcb4['active']){isOldTokenSent=![];if(!_0x16f319[_0x4dd9('0x7')]&&_0x16f319['license']!=_0x2bfcb4[_0x4dd9('0x7')]||_0x16f319[_0x4dd9('0x7')]&&_0x16f319[_0x4dd9('0x10')]){logger[_0x4dd9('0x12')](_0x4dd9('0x13'));}if(_0x16f319['license']&&!_0x16f319[_0x4dd9('0x10')]&&_0x16f319[_0x4dd9('0x7')]!=_0x2bfcb4['license']){logger[_0x4dd9('0x12')](_0x4dd9('0x14'));}if(_0x16f319[_0x4dd9('0x7')]&&!_0x16f319[_0x4dd9('0x10')]&&_0x16f319['license']==_0x2bfcb4[_0x4dd9('0x7')]){return _0x1e233b;}return _0x1e233b[_0x4dd9('0x15')]({'data1':_0x17a9ad,'data2':null,'license':_0x2bfcb4[_0x4dd9('0x7')]});}else{if(_0x2bfcb4['license']||_0x16f319[_0x4dd9('0x7')]){if(!_0x16f319[_0x4dd9('0x10')]){if(_0x16f319['data1']==_0x17a9ad){GRAY_PERIOD_REASON=_0x4dd9('0x16');logger[_0x4dd9('0x12')](_0x4dd9('0x17'));}else{GRAY_PERIOD_REASON=_0x4dd9('0x18');logger[_0x4dd9('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x16f319[_0x4dd9('0xf')],_0x17a9ad);}logger[_0x4dd9('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x4dd9('0x19')](),moment()[_0x4dd9('0x9')](_0x4dd9('0x1a')));return _0x1e233b['update']({'data2':encryptor[_0x4dd9('0x1b')](moment()[_0x4dd9('0x9')](_0x4dd9('0x1a')))});}else{if(moment()[_0x4dd9('0x1c')](encryptor[_0x4dd9('0x1d')](_0x16f319[_0x4dd9('0x10')]),_0x4dd9('0x1e'))>DAYS){logger[_0x4dd9('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0x4dd9('0x9')](_0x4dd9('0x1a')));isOldTokenSent=![];return _0x1e233b[_0x4dd9('0x15')]({'data1':_0x17a9ad,'data2':null,'license':null});}}}else{if(_0x16f319['data1']!=_0x17a9ad){logger['info'](_0x4dd9('0x1f'),_0x16f319[_0x4dd9('0xf')],_0x17a9ad);return _0x1e233b['update']({'data1':_0x17a9ad,'data2':null,'license':null});}}}return _0x1e233b;})[_0x4dd9('0x11')](function(_0x4e7f5f){_0x1e233b=_0x4e7f5f;})[_0x4dd9('0xd')](function(_0x5586ab){logger[_0x4dd9('0x20')](_0x5586ab['message']);})[_0x4dd9('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1e233b);},TIME);});}function defaultLicense(){var _0x52e873=hardware[_0x4dd9('0x22')]();if(_0x52e873){return db[_0x4dd9('0x23')][_0x4dd9('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x52e873}})['spread'](function(_0xcdaa52,_0x2397c0){logger[_0x4dd9('0x12')](_0x4dd9('0x25'),_0x52e873);manageLicense(_0x52e873,_0xcdaa52);})[_0x4dd9('0xd')](function(_0x3f04d0){logger[_0x4dd9('0x20')](_0x3f04d0['message']);});}}exports[_0x4dd9('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2b028e4..64fe2b9 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 _0xb934=['sequelize','COUNT','count','admin','telephone','users','pick','user','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','grayReason','message','User','findAll','role'];(function(_0x20dd43,_0x59d01a){var _0x36e1d5=function(_0x2a1dde){while(--_0x2a1dde){_0x20dd43['push'](_0x20dd43['shift']());}};_0x36e1d5(++_0x59d01a);}(_0xb934,0x14a));var _0x4b93=function(_0x38558a,_0x2b6e15){_0x38558a=_0x38558a-0x0;var _0x14ff8b=_0xb934[_0x38558a];return _0x14ff8b;};'use strict';var util=require(_0x4b93('0x0'));var _=require(_0x4b93('0x1'));var moment=require('moment');var BPromise=require(_0x4b93('0x2'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x4b93('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b93('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4b93('0x5'),'machineUuid':hardware[_0x4b93('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b93('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x4b93('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x32bc36){return new BPromise(function(_0x43a089,_0x3bba66){return db[_0x4b93('0x7')][_0x4b93('0x8')](_[_0x4b93('0x9')](_0x32bc36,{'raw':!![],'where':{'id':0x1}}))[_0x4b93('0xa')](function(_0x2be0d8){return checkLicense(_0x2be0d8,null);})['then'](function(_0x2333ae){_0x43a089(_0x2333ae);return;})[_0x4b93('0xb')](function(_0x483d57){_0x3bba66(_0x483d57);});});}function checkLicense(_0x26ba46,_0x4de78e){if(!_0x26ba46){demoLicense[_0x4b93('0xc')]=_0x26ba46[_0x4b93('0xd')];return demoLicense;}try{var _0x19fd81=_0x4de78e||_0x26ba46[_0x4b93('0xe')];if(_[_0x4b93('0xf')](_0x19fd81)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5da3e9=_0x26ba46[_0x4b93('0xd')];var _0x99c81=_0x26ba46['data2'];var _0x23ee0d=_0x5da3e9[_0x4b93('0x10')]('-')[0x4];var _0x343aad=_0x5da3e9[_0x4b93('0x10')]('-')[0x0];var _0x3a0e97=encryptor[_0x4b93('0x11')](_0x19fd81,util[_0x4b93('0x12')](_0x4b93('0x13'),_0x23ee0d,_0x5da3e9,_0x343aad));var _0x42103f=JSON[_0x4b93('0x14')](_0x3a0e97);_0x42103f[_0x4b93('0x15')]=![];_0x42103f['uuid']=_0x5da3e9;_0x42103f[_0x4b93('0x16')]=hardware[_0x4b93('0x6')]();if(_0x99c81){var _0x3f1dfd=encryptor[_0x4b93('0x11')](_0x99c81);_0x42103f['gray']=_0x3f1dfd;_0x42103f[_0x4b93('0x17')]=moment(_0x3f1dfd)[_0x4b93('0x18')](0x7,'days')['format']();_0x42103f[_0x4b93('0x19')]=_0x42103f[_0x4b93('0xc')]!=_0x42103f[_0x4b93('0x16')]?'changed':'disabled';}return _0x42103f;}catch(_0x290a85){breakingLicense[_0x4b93('0xc')]=_0x26ba46[_0x4b93('0xd')];breakingLicense['message']=_0x290a85[_0x4b93('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d8e9b,_0x2ffd11){getLicense()[_0x4b93('0xa')](function(_0x5b87ca){return db[_0x4b93('0x1b')][_0x4b93('0x1c')]({'attributes':[_0x4b93('0x1d'),[db[_0x4b93('0x1e')]['fn'](_0x4b93('0x1f'),db[_0x4b93('0x1e')]['col'](_0x4b93('0x1d'))),_0x4b93('0x20')]],'group':_0x4b93('0x1d'),'where':{'role':{'$or':[_0x4b93('0x21'),'user',_0x4b93('0x22')]}},'raw':!![]})[_0x4b93('0xa')](function(_0x1de6fd){var _0x4be0a8={'user':_0x5b87ca[_0x4b93('0x23')]||0x0,'telephone':_0x5b87ca['telephones']||0x0};_0x1de6fd['forEach'](function(_0xc3f464){var _0x5454d3=_0xc3f464['role']===_0x4b93('0x21')?'user':_0xc3f464[_0x4b93('0x1d')];_0x4be0a8[_0x5454d3]-=_0xc3f464[_0x4b93('0x20')];if(_0x4be0a8[_0x5454d3]<0x0)_0x4be0a8[_0x5454d3]=0x0;});_0x4d8e9b(_0x4be0a8);return;});})[_0x4b93('0xb')](function(_0x50917f){_0x2ffd11(_0x50917f);});});}function checkUserLimits(_0x6ba95a){return new BPromise(function(_0x27d0d0,_0x2e66c){getLimits()[_0x4b93('0xa')](function(_0x1014fc){var _0x61d4a7=_[_0x4b93('0x24')](_['countBy'](_0x6ba95a,_0x4b93('0x1d')),[_0x4b93('0x21'),_0x4b93('0x25'),'telephone']);var _0x4bdadd=(_0x61d4a7[_0x4b93('0x21')]||0x0)+(_0x61d4a7[_0x4b93('0x25')]||0x0);var _0x551088=_0x61d4a7[_0x4b93('0x22')]||0x0;if(_0x4bdadd>_0x1014fc[_0x4b93('0x25')])return _0x2e66c('License\x20limit\x20reached\x20for\x20users');if(_0x551088>_0x1014fc[_0x4b93('0x22')])return _0x2e66c(_0x4b93('0x26'));return _0x27d0d0();})['catch'](function(_0x59bfee){_0x2e66c(_0x59bfee);});});}module[_0x4b93('0x27')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xcad6=['License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','grayReason','uuid','disabled','message','User','role','sequelize','COUNT','col','count','user','telephone','users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xcad6,0x83));var _0x6cad=function(_0x51abea,_0xfd7684){_0x51abea=_0x51abea-0x0;var _0x340b9c=_0xcad6[_0x51abea];return _0x340b9c;};'use strict';var util=require(_0x6cad('0x0'));var _=require(_0x6cad('0x1'));var moment=require('moment');var BPromise=require(_0x6cad('0x2'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6cad('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6cad('0x4'),'machineUuid':hardware[_0x6cad('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6cad('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6cad('0x6'),'machineUuid':hardware[_0x6cad('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x9dda68){return new BPromise(function(_0x23f972,_0x4d19cc){return db['License']['find'](_['defaults'](_0x9dda68,{'raw':!![],'where':{'id':0x1}}))[_0x6cad('0x7')](function(_0x23ea62){return checkLicense(_0x23ea62,null);})[_0x6cad('0x7')](function(_0x2bca6b){_0x23f972(_0x2bca6b);return;})[_0x6cad('0x8')](function(_0x5f532b){_0x4d19cc(_0x5f532b);});});}function checkLicense(_0x3ce926,_0x38ce85){if(!_0x3ce926){demoLicense['uuid']=_0x3ce926[_0x6cad('0x9')];return demoLicense;}try{var _0x5ac734=_0x38ce85||_0x3ce926[_0x6cad('0xa')];if(_[_0x6cad('0xb')](_0x5ac734)){throw new Error(_0x6cad('0xc'));}var _0x912c4c=_0x3ce926['data1'];var _0x169d39=_0x3ce926['data2'];var _0x5ad4c9=_0x912c4c['split']('-')[0x4];var _0x27a8cd=_0x912c4c['split']('-')[0x0];var _0x1c0bcb=encryptor[_0x6cad('0xd')](_0x5ac734,util[_0x6cad('0xe')](_0x6cad('0xf'),_0x5ad4c9,_0x912c4c,_0x27a8cd));var _0x3fa065=JSON[_0x6cad('0x10')](_0x1c0bcb);_0x3fa065['demo']=![];_0x3fa065['uuid']=_0x912c4c;_0x3fa065[_0x6cad('0x11')]=hardware[_0x6cad('0x5')]();if(_0x169d39){var _0x4467d8=encryptor[_0x6cad('0xd')](_0x169d39);_0x3fa065[_0x6cad('0x12')]=_0x4467d8;_0x3fa065[_0x6cad('0x13')]=moment(_0x4467d8)[_0x6cad('0x14')](0x7,_0x6cad('0x15'))['format']();_0x3fa065[_0x6cad('0x16')]=_0x3fa065[_0x6cad('0x17')]!=_0x3fa065[_0x6cad('0x11')]?'changed':_0x6cad('0x18');}return _0x3fa065;}catch(_0x5911f5){breakingLicense[_0x6cad('0x17')]=_0x3ce926['data1'];breakingLicense['message']=_0x5911f5[_0x6cad('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x417fc8,_0x42054f){getLicense()[_0x6cad('0x7')](function(_0x1fe2b5){return db[_0x6cad('0x1a')]['findAll']({'attributes':[_0x6cad('0x1b'),[db[_0x6cad('0x1c')]['fn'](_0x6cad('0x1d'),db[_0x6cad('0x1c')][_0x6cad('0x1e')](_0x6cad('0x1b'))),_0x6cad('0x1f')]],'group':_0x6cad('0x1b'),'where':{'role':{'$or':['admin',_0x6cad('0x20'),_0x6cad('0x21')]}},'raw':!![]})[_0x6cad('0x7')](function(_0x1a4aad){var _0x125cbf={'user':_0x1fe2b5[_0x6cad('0x22')]||0x0,'telephone':_0x1fe2b5[_0x6cad('0x23')]||0x0};_0x1a4aad[_0x6cad('0x24')](function(_0x227d5c){var _0x2974a7=_0x227d5c[_0x6cad('0x1b')]===_0x6cad('0x25')?_0x6cad('0x20'):_0x227d5c[_0x6cad('0x1b')];_0x125cbf[_0x2974a7]-=_0x227d5c['count'];if(_0x125cbf[_0x2974a7]<0x0)_0x125cbf[_0x2974a7]=0x0;});_0x417fc8(_0x125cbf);return;});})['catch'](function(_0xf98278){_0x42054f(_0xf98278);});});}function checkUserLimits(_0x4ef3bc){return new BPromise(function(_0xc5bf97,_0x43f7fb){getLimits()[_0x6cad('0x7')](function(_0x450ec8){var _0x234cd1=_[_0x6cad('0x26')](_[_0x6cad('0x27')](_0x4ef3bc,'role'),[_0x6cad('0x25'),'user',_0x6cad('0x21')]);var _0xb6d829=(_0x234cd1[_0x6cad('0x25')]||0x0)+(_0x234cd1[_0x6cad('0x20')]||0x0);var _0x3dff8d=_0x234cd1[_0x6cad('0x21')]||0x0;if(_0xb6d829>_0x450ec8[_0x6cad('0x20')])return _0x43f7fb(_0x6cad('0x28'));if(_0x3dff8d>_0x450ec8[_0x6cad('0x21')])return _0x43f7fb(_0x6cad('0x29'));return _0xc5bf97();})[_0x6cad('0x8')](function(_0x23c2aa){_0x43f7fb(_0x23c2aa);});});}module[_0x6cad('0x2a')]={'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 40bcadc..dc99c37 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 _0xfb11=['exports','myappanuglar-secret','app-id'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xfb11[_0x2bf141];return _0x48277b;};'use strict';module[_0x1fb1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1fb1('0x1'),'GOOGLE_ID':_0x1fb1('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x84a0=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x3fd55b,_0x403b8a){var _0xb4654d=function(_0xa0b527){while(--_0xa0b527){_0x3fd55b['push'](_0x3fd55b['shift']());}};_0xb4654d(++_0x403b8a);}(_0x84a0,0x66));var _0x084a=function(_0x688c0e,_0xc9e8e8){_0x688c0e=_0x688c0e-0x0;var _0x351de9=_0x84a0[_0x688c0e];return _0x351de9;};'use strict';module[_0x084a('0x0')]={'DOMAIN':_0x084a('0x1'),'SESSION_SECRET':_0x084a('0x2'),'GOOGLE_ID':_0x084a('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 14f939f..b864473 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8913=['replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','%s-%s','error','File','info','Console','moment','util','path','log','xcally','format','%s-%s.log','message'];(function(_0x2b69e7,_0x31b0de){var _0x288421=function(_0x570419){while(--_0x570419){_0x2b69e7['push'](_0x2b69e7['shift']());}};_0x288421(++_0x31b0de);}(_0x8913,0xdf));var _0x3891=function(_0x1cb66d,_0x2d4e36){_0x1cb66d=_0x1cb66d-0x0;var _0x11441c=_0x8913[_0x1cb66d];return _0x11441c;};'use strict';var moment=require(_0x3891('0x0'));var winston=require('winston');var util=require(_0x3891('0x1'));var path=require(_0x3891('0x2'));var debugLevel='INFO';function filename(_0x18193a,_0x11be20){return path['join']('/var',_0x3891('0x3'),_0x3891('0x4'),util[_0x3891('0x5')](_0x3891('0x6'),_0x18193a,_0x11be20));}function formatter(_0x1a424c,_0x534f20){_0x534f20[_0x3891('0x7')]=_0x534f20[_0x3891('0x7')][_0x3891('0x8')](/@@{/g,'{{{')[_0x3891('0x8')](/}@@/g,_0x3891('0x9'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x3891('0x5')](_0x3891('0xa'),moment()['format'](_0x3891('0xb')),_0x534f20[_0x3891('0xc')]['toUpperCase'](),_0x1a424c,_0x534f20[_0x3891('0x7')]);}module[_0x3891('0xd')]=function(_0x3f6194){return new winston[(_0x3891('0xe'))]({'transports':[new winston[(_0x3891('0xf'))]['File']({'name':util['format'](_0x3891('0x10'),_0x3f6194,'error'),'filename':filename(_0x3f6194,_0x3891('0x11')),'level':_0x3891('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42498b){return formatter(_0x3f6194,_0x42498b);}}),new winston['transports'][(_0x3891('0x12'))]({'name':util['format'](_0x3891('0x10'),_0x3f6194,_0x3891('0x13')),'filename':filename(_0x3f6194,_0x3891('0x13')),'level':_0x3891('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x35f8e4){return formatter(_0x3f6194,_0x35f8e4);}}),new winston[(_0x3891('0xf'))][(_0x3891('0x14'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x17f55){return formatter(_0x3f6194,_0x17f55);}})]});}; \ No newline at end of file +var _0x64fe=['env','debugLevel','winston','util','path','INFO','join','/var','log','xcally','format','message','replace','}}}','toUpperCase','exports','Logger','transports','%s-%s','error','File','info'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x64fe,0x14c));var _0xe64f=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x64fe[_0x13e741];return _0x3f8bb3;};'use strict';var moment=require('moment');var winston=require(_0xe64f('0x0'));var util=require(_0xe64f('0x1'));var path=require(_0xe64f('0x2'));var debugLevel=_0xe64f('0x3');function filename(_0x1356f7,_0x5d1edf){return path[_0xe64f('0x4')](_0xe64f('0x5'),_0xe64f('0x6'),_0xe64f('0x7'),util[_0xe64f('0x8')]('%s-%s.log',_0x1356f7,_0x5d1edf));}function formatter(_0x307191,_0x2f72c9){_0x2f72c9['message']=_0x2f72c9[_0xe64f('0x9')][_0xe64f('0xa')](/@@{/g,'{{{')[_0xe64f('0xa')](/}@@/g,_0xe64f('0xb'))[_0xe64f('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xe64f('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xe64f('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2f72c9['level'][_0xe64f('0xc')](),_0x307191,_0x2f72c9[_0xe64f('0x9')]);}module[_0xe64f('0xd')]=function(_0x695b8a){return new winston[(_0xe64f('0xe'))]({'transports':[new winston[(_0xe64f('0xf'))]['File']({'name':util[_0xe64f('0x8')](_0xe64f('0x10'),_0x695b8a,_0xe64f('0x11')),'filename':filename(_0x695b8a,'error'),'level':_0xe64f('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ea16a){return formatter(_0x695b8a,_0x3ea16a);}}),new winston[(_0xe64f('0xf'))][(_0xe64f('0x12'))]({'name':util[_0xe64f('0x8')]('%s-%s',_0x695b8a,'info'),'filename':filename(_0x695b8a,_0xe64f('0x13')),'level':_0xe64f('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x7bb772){return formatter(_0x695b8a,_0x7bb772);}}),new winston[(_0xe64f('0xf'))]['Console']({'level':process[_0xe64f('0x14')][_0xe64f('0x15')]||debugLevel,'json':![],'formatter':function(_0x505059){return formatter(_0x695b8a,_0x505059);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 06fc597..9fb1d5c 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 _0x0aea=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/ami/index.js'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0aea,0x6a));var _0xa0ae=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x0aea[_0x4e5552];return _0x60a338;};'use strict';var path=require(_0xa0ae('0x0'));var os=require('os');var config={'apps':[{'name':_0xa0ae('0x1'),'script':path[_0xa0ae('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xa0ae('0x2')](__dirname,_0xa0ae('0x3'))},{'name':'agi','script':path[_0xa0ae('0x2')](__dirname,_0xa0ae('0x4'))},{'name':_0xa0ae('0x5'),'script':path['join'](__dirname,_0xa0ae('0x6'))},{'name':_0xa0ae('0x7'),'script':path[_0xa0ae('0x2')](__dirname,_0xa0ae('0x8'))},{'name':_0xa0ae('0x9'),'script':path['join'](__dirname,_0xa0ae('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x1e37=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x537c37,_0x536e74){var _0x241f84=function(_0x3fe709){while(--_0x3fe709){_0x537c37['push'](_0x537c37['shift']());}};_0x241f84(++_0x536e74);}(_0x1e37,0x1c4));var _0x71e3=function(_0x114867,_0x3495b3){_0x114867=_0x114867-0x0;var _0x504fd4=_0x1e37[_0x114867];return _0x504fd4;};'use strict';var path=require(_0x71e3('0x0'));var os=require('os');var config={'apps':[{'name':_0x71e3('0x1'),'script':path[_0x71e3('0x2')](__dirname,_0x71e3('0x3'))},{'name':_0x71e3('0x4'),'script':path[_0x71e3('0x2')](__dirname,_0x71e3('0x5'))},{'name':'agi','script':path[_0x71e3('0x2')](__dirname,_0x71e3('0x6'))},{'name':_0x71e3('0x7'),'script':path[_0x71e3('0x2')](__dirname,_0x71e3('0x8'))},{'name':_0x71e3('0x9'),'script':path[_0x71e3('0x2')](__dirname,_0x71e3('0xa'))},{'name':_0x71e3('0xb'),'script':path[_0x71e3('0x2')](__dirname,_0x71e3('0xc'))}]};module[_0x71e3('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index d6e12fc..0b5abb2 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 _0x139e=['delete','dump','saved','pm2','bluebird','./config','connect','start','disconnect','stop','then','restart','list','describe'];(function(_0x49197b,_0x354a27){var _0x39df92=function(_0x2547e3){while(--_0x2547e3){_0x49197b['push'](_0x49197b['shift']());}};_0x39df92(++_0x354a27);}(_0x139e,0x137));var _0xe139=function(_0x5261ac,_0x2193fa){_0x5261ac=_0x5261ac-0x0;var _0x1e904e=_0x139e[_0x5261ac];return _0x1e904e;};'use strict';var pm2=require(_0xe139('0x0'));var BPromise=require(_0xe139('0x1'));var config=require(_0xe139('0x2'));function connect(){return new BPromise(function(_0x541abd,_0x85a42e){return pm2[_0xe139('0x3')](function(_0xe86aaa){if(_0xe86aaa){return _0x85a42e(_0xe86aaa);}return _0x541abd('connected');});});};exports['start']=function(_0x530b60){return connect()['then'](function(){return new BPromise(function(_0x1d3f16,_0x52d3df){return pm2[_0xe139('0x4')](_0x530b60,function(_0x2b62c6,_0x5dfbd8){if(_0x2b62c6){return _0x52d3df(_0x2b62c6);}pm2[_0xe139('0x5')]();return _0x1d3f16(_0x5dfbd8);});});});};exports[_0xe139('0x6')]=function(_0xdbb43f){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x55ddd4,_0x1e27ac){return pm2['stop'](_0xdbb43f,function(_0x43138e,_0x2d69c1){if(_0x43138e){return _0x1e27ac(_0x43138e);}pm2[_0xe139('0x5')]();return _0x55ddd4(_0x2d69c1);});});});};exports['restart']=function(_0x392312){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x36cf46,_0x201477){return pm2[_0xe139('0x8')](_0x392312,function(_0x1007e5,_0x5e8aea){if(_0x1007e5){return _0x201477(_0x1007e5);}pm2[_0xe139('0x5')]();return _0x36cf46(_0x5e8aea);});});});};exports[_0xe139('0x9')]=function(){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0xe34fcd,_0x24ac63){return pm2[_0xe139('0x9')](function(_0x4e1534,_0x984602){if(_0x4e1534){return _0x24ac63(_0x4e1534);}pm2[_0xe139('0x5')]();return _0xe34fcd(_0x984602);});});});};exports[_0xe139('0xa')]=function(_0x5280a1){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x3cb987,_0x2c9ad3){return pm2[_0xe139('0xa')](_0x5280a1,function(_0x13383e,_0x2f9792){if(_0x13383e){return _0x2c9ad3(_0x13383e);}pm2[_0xe139('0x5')]();return _0x3cb987(_0x2f9792);});});});};exports[_0xe139('0xb')]=function(_0x492daf){return connect()['then'](function(){return new BPromise(function(_0x27e650,_0x319860){return pm2[_0xe139('0xb')](_0x492daf,function(_0x22be82,_0xcfe479){if(_0x22be82){return _0x319860(_0x22be82);}pm2['disconnect']();return _0x27e650(_0xcfe479);});});});};exports[_0xe139('0xc')]=function(){return connect()[_0xe139('0x7')](function(){return new BPromise(function(_0x2bef2d,_0x4c1778){return pm2[_0xe139('0xc')](function(_0x25d77c){if(_0x25d77c){return _0x4c1778(_0x25d77c);}return _0x2bef2d(_0xe139('0xd'));});});});}; \ No newline at end of file +var _0x7c0b=['connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config','connect'];(function(_0x21d90e,_0x5b5a8c){var _0x467866=function(_0x3c5088){while(--_0x3c5088){_0x21d90e['push'](_0x21d90e['shift']());}};_0x467866(++_0x5b5a8c);}(_0x7c0b,0x1a1));var _0xb7c0=function(_0x800d8d,_0xfeb09f){_0x800d8d=_0x800d8d-0x0;var _0x5022f7=_0x7c0b[_0x800d8d];return _0x5022f7;};'use strict';var pm2=require(_0xb7c0('0x0'));var BPromise=require('bluebird');var config=require(_0xb7c0('0x1'));function connect(){return new BPromise(function(_0x21b439,_0xb4b9fb){return pm2[_0xb7c0('0x2')](function(_0x179969){if(_0x179969){return _0xb4b9fb(_0x179969);}return _0x21b439(_0xb7c0('0x3'));});});};exports['start']=function(_0x304d3f){return connect()[_0xb7c0('0x4')](function(){return new BPromise(function(_0x4de4b4,_0x3854e0){return pm2[_0xb7c0('0x5')](_0x304d3f,function(_0x1dfdc5,_0x53855b){if(_0x1dfdc5){return _0x3854e0(_0x1dfdc5);}pm2[_0xb7c0('0x6')]();return _0x4de4b4(_0x53855b);});});});};exports[_0xb7c0('0x7')]=function(_0x1b26bf){return connect()[_0xb7c0('0x4')](function(){return new BPromise(function(_0x1f0910,_0x42af7f){return pm2['stop'](_0x1b26bf,function(_0x3b1238,_0x2fd1b2){if(_0x3b1238){return _0x42af7f(_0x3b1238);}pm2[_0xb7c0('0x6')]();return _0x1f0910(_0x2fd1b2);});});});};exports[_0xb7c0('0x8')]=function(_0x52c2cd){return connect()['then'](function(){return new BPromise(function(_0x17b942,_0x134ef2){return pm2['restart'](_0x52c2cd,function(_0x44e742,_0x11fa38){if(_0x44e742){return _0x134ef2(_0x44e742);}pm2[_0xb7c0('0x6')]();return _0x17b942(_0x11fa38);});});});};exports[_0xb7c0('0x9')]=function(){return connect()[_0xb7c0('0x4')](function(){return new BPromise(function(_0x232267,_0x3b5ef1){return pm2[_0xb7c0('0x9')](function(_0xebf361,_0x20f1d3){if(_0xebf361){return _0x3b5ef1(_0xebf361);}pm2[_0xb7c0('0x6')]();return _0x232267(_0x20f1d3);});});});};exports[_0xb7c0('0xa')]=function(_0x23cd2d){return connect()[_0xb7c0('0x4')](function(){return new BPromise(function(_0x33bb1c,_0x29f7cc){return pm2['describe'](_0x23cd2d,function(_0x4e88a4,_0x3983f0){if(_0x4e88a4){return _0x29f7cc(_0x4e88a4);}pm2[_0xb7c0('0x6')]();return _0x33bb1c(_0x3983f0);});});});};exports[_0xb7c0('0xb')]=function(_0xd9a73c){return connect()[_0xb7c0('0x4')](function(){return new BPromise(function(_0x6cb1a,_0x3a167b){return pm2[_0xb7c0('0xb')](_0xd9a73c,function(_0x1ad7e5,_0x169c5d){if(_0x1ad7e5){return _0x3a167b(_0x1ad7e5);}pm2[_0xb7c0('0x6')]();return _0x6cb1a(_0x169c5d);});});});};exports['dump']=function(){return connect()[_0xb7c0('0x4')](function(){return new BPromise(function(_0x5128a7,_0x2b5ec1){return pm2[_0xb7c0('0xc')](function(_0x1e7adf){if(_0x1e7adf){return _0x2b5ec1(_0x1e7adf);}return _0x5128a7(_0xb7c0('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 810df84..6b716fe 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 _0x1369=['subtract','minutes','then','length','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt'];(function(_0x41397b,_0x481d0e){var _0x5f4677=function(_0x4a0b5b){while(--_0x4a0b5b){_0x41397b['push'](_0x41397b['shift']());}};_0x5f4677(++_0x481d0e);}(_0x1369,0xbc));var _0x9136=function(_0x191b5d,_0x415035){_0x191b5d=_0x191b5d-0x0;var _0x3c8216=_0x1369[_0x191b5d];return _0x3c8216;};'use strict';var _=require(_0x9136('0x0'));var moment=require(_0x9136('0x1'));var Redis=require(_0x9136('0x2'));var util=require(_0x9136('0x3'));var config=require(_0x9136('0x4'));var db=require(_0x9136('0x5'))['db'];var logger=require('../logger')(_0x9136('0x6'));config[_0x9136('0x7')]=_['defaults'](config['redis'],{'host':_0x9136('0x8'),'port':0x18eb});var io=require(_0x9136('0x9'))(new Redis(config[_0x9136('0x7')]));function closeInteractions(){var _0x24bf39=0x0;var _0x1f18ee=[];return db['Setting'][_0x9136('0xa')]({'raw':!![],'attributes':['id',_0x9136('0xb')],'where':{'id':0x1}})['then'](function(_0x2eebc9){_0x24bf39=_0x2eebc9[_0x9136('0xb')];if(_0x24bf39){return db[_0x9136('0xc')][_0x9136('0xd')]({'raw':!![],'attributes':['id',_0x9136('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9136('0xf')](_0x2eebc9[_0x9136('0xb')],_0x9136('0x10'))}}});}else{return[];}})[_0x9136('0x11')](function(_0x43ec73){if(_0x43ec73&&_0x43ec73[_0x9136('0x12')]){_0x1f18ee=_['map'](_0x43ec73||[],'id');logger['info'](_0x9136('0x13'),_0x1f18ee[_0x9136('0x14')]());return db['ChatInteraction'][_0x9136('0x15')]({'closeReason':_0x9136('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x9136('0x17'))},{'where':{'id':_0x1f18ee}});}})['then'](function(){if(_0x1f18ee&&_0x1f18ee['length']){logger[_0x9136('0x18')](_0x9136('0x19'),_0x1f18ee[_0x9136('0x14')]());for(var _0x9ab35e=0x0;_0x9ab35e<_0x1f18ee[_0x9136('0x12')];_0x9ab35e++){io['emit'](_0x9136('0x1a'),{'id':_0x1f18ee[_0x9ab35e],'closed':!![]});}}})['catch'](function(_0x218c49){logger['error'](_0x9136('0x1b'),_0x218c49?util['inspect'](_0x218c49,{'showHidden':![],'depth':null}):'');});}exports[_0x9136('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa411=['then','ChatInteraction','subtract','minutes','length','map','info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','chatTimeout'];(function(_0x231770,_0xb3ad5a){var _0x5ce5f3=function(_0x433f82){while(--_0x433f82){_0x231770['push'](_0x231770['shift']());}};_0x5ce5f3(++_0xb3ad5a);}(_0xa411,0x15d));var _0x1a41=function(_0x4dc00b,_0x229642){_0x4dc00b=_0x4dc00b-0x0;var _0x38a107=_0xa411[_0x4dc00b];return _0x38a107;};'use strict';var _=require('lodash');var moment=require(_0x1a41('0x0'));var Redis=require('ioredis');var util=require(_0x1a41('0x1'));var config=require(_0x1a41('0x2'));var db=require(_0x1a41('0x3'))['db'];var logger=require(_0x1a41('0x4'))(_0x1a41('0x5'));config[_0x1a41('0x6')]=_[_0x1a41('0x7')](config[_0x1a41('0x6')],{'host':_0x1a41('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1a41('0x6')]));function closeInteractions(){var _0x3651b9=0x0;var _0x3bf9d6=[];return db[_0x1a41('0x9')]['find']({'raw':!![],'attributes':['id',_0x1a41('0xa')],'where':{'id':0x1}})[_0x1a41('0xb')](function(_0xaa4bf0){_0x3651b9=_0xaa4bf0['chatTimeout'];if(_0x3651b9){return db[_0x1a41('0xc')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1a41('0xd')](_0xaa4bf0[_0x1a41('0xa')],_0x1a41('0xe'))}}});}else{return[];}})['then'](function(_0x5d2008){if(_0x5d2008&&_0x5d2008[_0x1a41('0xf')]){_0x3bf9d6=_[_0x1a41('0x10')](_0x5d2008||[],'id');logger[_0x1a41('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3bf9d6['join']());return db[_0x1a41('0xc')][_0x1a41('0x12')]({'closeReason':_0x1a41('0x13'),'disposition':_0x1a41('0x14'),'closed':!![],'closedAt':moment()[_0x1a41('0x15')](_0x1a41('0x16'))},{'where':{'id':_0x3bf9d6}});}})[_0x1a41('0xb')](function(){if(_0x3bf9d6&&_0x3bf9d6['length']){logger[_0x1a41('0x11')](_0x1a41('0x17'),_0x3bf9d6[_0x1a41('0x18')]());for(var _0x590056=0x0;_0x590056<_0x3bf9d6[_0x1a41('0xf')];_0x590056++){io[_0x1a41('0x19')](_0x1a41('0x1a'),{'id':_0x3bf9d6[_0x590056],'closed':!![]});}}})[_0x1a41('0x1b')](function(_0x2693d3){logger['error'](_0x1a41('0x1c'),_0x2693d3?util[_0x1a41('0x1d')](_0x2693d3,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 8f08438..6d27dd3 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 _0xbcb6=['join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','toRun','my\x20id','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit'];(function(_0x1a2853,_0xba99a1){var _0x3a885f=function(_0x419436){while(--_0x419436){_0x1a2853['push'](_0x1a2853['shift']());}};_0x3a885f(++_0xba99a1);}(_0xbcb6,0x1a7));var _0x6bcb=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0xbcb6[_0x1830ce];return _0x2bce9f;};'use strict';var fs=require('fs');var util=require(_0x6bcb('0x0'));var path=require(_0x6bcb('0x1'));var _=require(_0x6bcb('0x2'));var moment=require(_0x6bcb('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x6bcb('0x4'));var BPromise=require(_0x6bcb('0x5'));var logger=require(_0x6bcb('0x6'))(_0x6bcb('0x7'));var db=require(_0x6bcb('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x6bcb('0x9'));var client=jayson[_0x6bcb('0xa')][_0x6bcb('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x162d38,_0x530f85){return function(){logger[_0x6bcb('0xc')](_0x6bcb('0xd'),_0x162d38[_0x6bcb('0xe')]);var _0x215eff=!![];var _0x39fb85={'tls':{'rejectUnauthorized':![]}};if(_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')]['service']){_0x39fb85[_0x6bcb('0x11')]=_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')][_0x6bcb('0x11')];}else{_0x39fb85[_0x6bcb('0x12')]=_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')][_0x6bcb('0x12')];_0x39fb85[_0x6bcb('0x13')]=_0x162d38[_0x6bcb('0xf')]['Smtp'][_0x6bcb('0x13')];_0x39fb85[_0x6bcb('0x14')]=_0x162d38['MailAccount'][_0x6bcb('0x10')][_0x6bcb('0x14')];}if(_0x162d38[_0x6bcb('0xf')]['Smtp'][_0x6bcb('0x15')]){_0x39fb85[_0x6bcb('0x16')]={'user':_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')][_0x6bcb('0x17')],'pass':_0x162d38[_0x6bcb('0xf')]['Smtp'][_0x6bcb('0x18')]};}var _0x41c832={'account':_0x39fb85,'message':{'from':util['format'](_0x6bcb('0x19'),_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x1a')],_0x162d38['MailAccount'][_0x6bcb('0xe')]||_0x162d38[_0x6bcb('0xf')][_0x6bcb('0x10')]['user']),'to':_0x162d38[_0x6bcb('0xe')],'cc':_0x162d38['cc'],'bcc':_0x162d38[_0x6bcb('0x1b')],'subject':util[_0x6bcb('0x1c')](_0x6bcb('0x1d'),_0x530f85[_0x6bcb('0x1a')],_0x162d38[_0x6bcb('0x1e')],_0x162d38[_0x6bcb('0x1f')])}};var _0x48097e=path[_0x6bcb('0x20')](__dirname,_0x6bcb('0x21'));var _0x51b122=_0x530f85[_0x6bcb('0x22')];var _0x30a21c=util[_0x6bcb('0x1c')](_0x6bcb('0x23'),path[_0x6bcb('0x24')](_0x530f85['savename'],path[_0x6bcb('0x25')](_0x530f85[_0x6bcb('0x22')])),_0x6bcb('0x26'));var _0x3f0057=path[_0x6bcb('0x20')](_0x48097e,_0x51b122);var _0x19e993=path[_0x6bcb('0x20')](_0x48097e,_0x30a21c);if(fs[_0x6bcb('0x27')](_0x3f0057)){_0x530f85[_0x6bcb('0x28')]='Sent';_0x41c832[_0x6bcb('0x29')][_0x6bcb('0x2a')]=[{'filename':_0x51b122,'path':_0x3f0057}];_0x41c832['message'][_0x6bcb('0x2b')]=util[_0x6bcb('0x1c')](_0x6bcb('0x2c'),JSON[_0x6bcb('0x2d')](_0x530f85,null,0x2));}else if(fs[_0x6bcb('0x27')](_0x19e993)){_0x530f85[_0x6bcb('0x28')]='Sent';_0x41c832[_0x6bcb('0x29')][_0x6bcb('0x2a')]=[{'filename':_0x30a21c,'path':_0x19e993}];}else{_0x41c832['message']['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x162d38[_0x6bcb('0x2e')]){_0x215eff=![];logger['info'](_0x6bcb('0x2f'));}}if(_0x215eff){return client['request']('SendMail',_0x41c832)[_0x6bcb('0x30')](function(_0x263ac8){if(_0x263ac8['error']){return logger[_0x6bcb('0x31')](_0x6bcb('0x32'),JSON['stringify'](_0x263ac8));}return logger[_0x6bcb('0xc')](_0x6bcb('0x33'));})[_0x6bcb('0x34')](function(_0x133dee){return logger[_0x6bcb('0x31')](_0x6bcb('0x32'),JSON[_0x6bcb('0x2d')](_0x133dee));});}};}function handleError(){return function(_0x2b9d0f){return logger[_0x6bcb('0x31')](JSON['stringify'](_0x2b9d0f));};}function handleResult(_0x218d9e){return function(_0x1c6a21){logger['info'](_0x6bcb('0x35'),JSON[_0x6bcb('0x2d')](_0x1c6a21));if(_0x218d9e[_0x6bcb('0xf')]&&_0x218d9e[_0x6bcb('0xf')]['Smtp']&&!_[_0x6bcb('0x36')](_0x218d9e['email'])){setTimeout(handleSendEmail(_0x218d9e,_0x1c6a21),0x3c*0x3e8);}};}function handleJob(_0x3ccbf2){return function(){try{if(_['isNil'](_0x3ccbf2[_0x6bcb('0x1e')])){return logger[_0x6bcb('0xc')](_0x6bcb('0x37'));}if(_[_0x6bcb('0x36')](_0x3ccbf2[_0x6bcb('0x1f')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x55dc78={'startDate':moment()[_0x6bcb('0x38')](_0x3ccbf2[_0x6bcb('0x1e')],_0x3ccbf2['subtractUnit'])['format'](_0x6bcb('0x39')),'endDate':moment()[_0x6bcb('0x1c')](_0x6bcb('0x39')),'type':_0x6bcb('0x3a'),'output':_0x3ccbf2[_0x6bcb('0x3b')],'name':_0x3ccbf2[_0x6bcb('0x1a')]};if(!_['isNil'](_0x3ccbf2['DefaultReportId'])){logger[_0x6bcb('0xc')](_0x6bcb('0x3c'),_0x3ccbf2['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x3ccbf2[_0x6bcb('0x3d')]},_0x55dc78)[_0x6bcb('0x30')](handleResult(_0x3ccbf2))[_0x6bcb('0x34')](handleError());}if(!_[_0x6bcb('0x36')](_0x3ccbf2[_0x6bcb('0x3e')])){logger[_0x6bcb('0xc')](_0x6bcb('0x3f'),_0x3ccbf2['CustomReportId']);return analyticCustomReportController[_0x6bcb('0x40')]({'id':_0x3ccbf2[_0x6bcb('0x3e')]},_0x55dc78)[_0x6bcb('0x30')](handleResult(_0x3ccbf2))[_0x6bcb('0x34')](handleError());}}catch(_0x8ac23f){logger[_0x6bcb('0x31')](JSON[_0x6bcb('0x2d')](_0x8ac23f));}return logger['info'](_0x6bcb('0x41'));};}function getJobs(_0x8e087a){var _0x480a93={};if(_0x8e087a){_0x480a93['id']=_0x8e087a;}return db[_0x6bcb('0x42')][_0x6bcb('0x43')]({'where':_0x480a93,'include':[{'model':db[_0x6bcb('0xf')],'attributes':['id',_0x6bcb('0x1a'),_0x6bcb('0xe')],'include':[{'model':db[_0x6bcb('0x44')],'as':_0x6bcb('0x10')}]}]})[_0x6bcb('0x30')](function(_0x2027c6){var _0xdd7a7c=_[_0x6bcb('0x45')](manager['jobs']);var _0x452c7f=_[_0x6bcb('0x46')](_0x2027c6,function(_0x30c5de){return _0x30c5de['id'][_0x6bcb('0x47')]();});var _0xa911b2=_[_0x6bcb('0x48')](_0x2027c6,function(_0x1fb5a1){return _0x1fb5a1['id'][_0x6bcb('0x47')]();});var _0x331f18=_0x8e087a?_0x452c7f:_[_0x6bcb('0x49')](_0x452c7f,_0xdd7a7c);var _0x16b846=_[_0x6bcb('0x4a')](_0x452c7f,_0xdd7a7c);var _0x3898ef=_[_0x6bcb('0x49')](_0xdd7a7c,_0x452c7f);var _0x17330a;var _0x1cbca1;for(_0x17330a=0x0;_0x17330a<_0x3898ef[_0x6bcb('0x4b')]&&!_0x8e087a;_0x17330a+=0x1){_0x1cbca1=_0x3898ef[_0x17330a]['toString']();if(manager[_0x6bcb('0x4c')](_0x1cbca1)){manager[_0x6bcb('0x4d')](_0x1cbca1);manager[_0x6bcb('0x4e')](_0x1cbca1);logger[_0x6bcb('0xc')]('delete\x20cron',_0x1cbca1);}}logger[_0x6bcb('0xc')](_0x6bcb('0x4f'),JSON[_0x6bcb('0x2d')](_0x331f18));for(_0x17330a=0x0;_0x17330a<_0x331f18[_0x6bcb('0x4b')];_0x17330a+=0x1){_0x1cbca1=_0x331f18[_0x17330a]['toString']();logger[_0x6bcb('0xc')]('index',_0x1cbca1);if(_0x8e087a){logger[_0x6bcb('0xc')](_0x6bcb('0x50'),_0x8e087a);logger[_0x6bcb('0xc')](JSON['stringify'](_0xa911b2[_0x1cbca1]));BPromise['resolve']()['then'](handleJob(_0xa911b2[_0x1cbca1]));logger[_0x6bcb('0xc')]('run\x20job',_0xa911b2[_0x1cbca1][_0x6bcb('0x1a')],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}else if(_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]&&_0xa911b2[_0x1cbca1][_0x6bcb('0x52')]&&moment()[_0x6bcb('0x53')](_0xa911b2[_0x1cbca1][_0x6bcb('0x54')],_0xa911b2[_0x1cbca1][_0x6bcb('0x55')])){manager['add'](_0x1cbca1,_0xa911b2[_0x1cbca1][_0x6bcb('0x51')],handleJob(_0xa911b2[_0x1cbca1]));manager[_0x6bcb('0x56')](_0x1cbca1);logger[_0x6bcb('0xc')](_0x6bcb('0x57'),_0xa911b2[_0x1cbca1][_0x6bcb('0x1a')],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}else if(manager[_0x6bcb('0x4c')](_0x1cbca1)){manager[_0x6bcb('0x4d')](_0x1cbca1);manager[_0x6bcb('0x4e')](_0x1cbca1);logger[_0x6bcb('0xc')](_0x6bcb('0x58'),_0xa911b2[_0x1cbca1][_0x6bcb('0x1a')],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}}for(_0x17330a=0x0,_0x1cbca1;_0x17330a<_0x16b846[_0x6bcb('0x4b')]&&!_0x8e087a;_0x17330a+=0x1){_0x1cbca1=_0x16b846[_0x17330a][_0x6bcb('0x47')]();if(manager[_0x6bcb('0x4c')](_0x1cbca1)){if(_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]&&_0xa911b2[_0x1cbca1][_0x6bcb('0x52')]&&moment()[_0x6bcb('0x53')](_0xa911b2[_0x1cbca1][_0x6bcb('0x54')],_0xa911b2[_0x1cbca1][_0x6bcb('0x55')])){manager[_0x6bcb('0x59')](_0x1cbca1,_0xa911b2[_0x1cbca1][_0x6bcb('0x51')],handleJob(_0xa911b2[_0x1cbca1]));logger[_0x6bcb('0xc')](_0x6bcb('0x5a'),_0xa911b2[_0x1cbca1]['name'],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}else{manager[_0x6bcb('0x4d')](_0x1cbca1);manager[_0x6bcb('0x4e')](_0x1cbca1);logger[_0x6bcb('0xc')](_0x6bcb('0x58'),_0xa911b2[_0x1cbca1]['name'],_0xa911b2[_0x1cbca1][_0x6bcb('0x51')]);}}}})[_0x6bcb('0x34')](function(_0xa8c2fd){logger[_0x6bcb('0x31')](JSON[_0x6bcb('0x2d')](_0xa8c2fd));});}exports['run']=function(_0x191b4b){return getJobs(_0x191b4b);};exports[_0x6bcb('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x15ad=['authentication','user','pass','format','name','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','attachments','text','stringify','sendIfEmpty','info','request','SendMail','error','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','MailServerOut','keys','map','toString','keyBy','difference','intersection','deleteJob','delete\x20cron','toRun','length','my\x20id','resolve','run\x20job','cron','startAt','start','add\x20cron','exists','stop','stop\x20cron','update\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure'];(function(_0x1fade3,_0x55d6b7){var _0x580908=function(_0x547e2d){while(--_0x547e2d){_0x1fade3['push'](_0x1fade3['shift']());}};_0x580908(++_0x55d6b7);}(_0x15ad,0x97));var _0xd15a=function(_0x32ab9f,_0x355ca9){_0x32ab9f=_0x32ab9f-0x0;var _0x69f75c=_0x15ad[_0x32ab9f];return _0x69f75c;};'use strict';var fs=require('fs');var util=require(_0xd15a('0x0'));var path=require(_0xd15a('0x1'));var _=require('lodash');var moment=require(_0xd15a('0x2'));var CronJobManager=require(_0xd15a('0x3'));var jayson=require(_0xd15a('0x4'));var BPromise=require('bluebird');var logger=require(_0xd15a('0x5'))(_0xd15a('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xd15a('0x7'));var analyticDefaultReportController=require(_0xd15a('0x8'));var client=jayson[_0xd15a('0x9')][_0xd15a('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x595f32,_0x2e2313){return function(){logger['info'](_0xd15a('0xb'),_0x595f32[_0xd15a('0xc')]);var _0x358765=!![];var _0xa19eda={'tls':{'rejectUnauthorized':![]}};if(_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')]['service']){_0xa19eda[_0xd15a('0xf')]=_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')]['service'];}else{_0xa19eda[_0xd15a('0x10')]=_0x595f32['MailAccount'][_0xd15a('0xe')][_0xd15a('0x10')];_0xa19eda[_0xd15a('0x11')]=_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')][_0xd15a('0x11')];_0xa19eda[_0xd15a('0x12')]=_0x595f32['MailAccount'][_0xd15a('0xe')][_0xd15a('0x12')];}if(_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')][_0xd15a('0x13')]){_0xa19eda['auth']={'user':_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')][_0xd15a('0x14')],'pass':_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')][_0xd15a('0x15')]};}var _0x55bfaa={'account':_0xa19eda,'message':{'from':util[_0xd15a('0x16')]('\x22%s\x22\x20<%s>',_0x595f32['MailAccount'][_0xd15a('0x17')],_0x595f32[_0xd15a('0xd')][_0xd15a('0xc')]||_0x595f32[_0xd15a('0xd')][_0xd15a('0xe')][_0xd15a('0x14')]),'to':_0x595f32[_0xd15a('0xc')],'cc':_0x595f32['cc'],'bcc':_0x595f32['bcc'],'subject':util[_0xd15a('0x16')](_0xd15a('0x18'),_0x2e2313[_0xd15a('0x17')],_0x595f32['subtractNumber'],_0x595f32[_0xd15a('0x19')])}};var _0x22a960=path['join'](__dirname,_0xd15a('0x1a'));var _0x246fad=_0x2e2313[_0xd15a('0x1b')];var _0x16c8f0=util['format'](_0xd15a('0x1c'),path[_0xd15a('0x1d')](_0x2e2313[_0xd15a('0x1b')],path[_0xd15a('0x1e')](_0x2e2313[_0xd15a('0x1b')])),_0xd15a('0x1f'));var _0x20fb9b=path[_0xd15a('0x20')](_0x22a960,_0x246fad);var _0x253812=path[_0xd15a('0x20')](_0x22a960,_0x16c8f0);if(fs[_0xd15a('0x21')](_0x20fb9b)){_0x2e2313[_0xd15a('0x22')]=_0xd15a('0x23');_0x55bfaa[_0xd15a('0x24')][_0xd15a('0x25')]=[{'filename':_0x246fad,'path':_0x20fb9b}];_0x55bfaa['message'][_0xd15a('0x26')]=util[_0xd15a('0x16')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd15a('0x27')](_0x2e2313,null,0x2));}else if(fs[_0xd15a('0x21')](_0x253812)){_0x2e2313[_0xd15a('0x22')]='Sent';_0x55bfaa[_0xd15a('0x24')][_0xd15a('0x25')]=[{'filename':_0x16c8f0,'path':_0x253812}];}else{_0x55bfaa[_0xd15a('0x24')][_0xd15a('0x26')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x595f32[_0xd15a('0x28')]){_0x358765=![];logger[_0xd15a('0x29')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x358765){return client[_0xd15a('0x2a')](_0xd15a('0x2b'),_0x55bfaa)['then'](function(_0x57627b){if(_0x57627b[_0xd15a('0x2c')]){return logger['error'](_0xd15a('0x2d'),JSON['stringify'](_0x57627b));}return logger[_0xd15a('0x29')]('email\x20sent');})['catch'](function(_0x49aa59){return logger[_0xd15a('0x2c')]('error\x20mail',JSON[_0xd15a('0x27')](_0x49aa59));});}};}function handleError(){return function(_0xa749d){return logger['error'](JSON[_0xd15a('0x27')](_0xa749d));};}function handleResult(_0x554654){return function(_0x19ad92){logger['info'](_0xd15a('0x2e'),JSON['stringify'](_0x19ad92));if(_0x554654[_0xd15a('0xd')]&&_0x554654[_0xd15a('0xd')]['Smtp']&&!_['isNil'](_0x554654[_0xd15a('0xc')])){setTimeout(handleSendEmail(_0x554654,_0x19ad92),0x3c*0x3e8);}};}function handleJob(_0x5ab14b){return function(){try{if(_[_0xd15a('0x2f')](_0x5ab14b[_0xd15a('0x30')])){return logger[_0xd15a('0x29')](_0xd15a('0x31'));}if(_[_0xd15a('0x2f')](_0x5ab14b[_0xd15a('0x19')])){return logger[_0xd15a('0x29')]('subtractUnit\x20null\x20or\x20undefined');}var _0x19ba74={'startDate':moment()[_0xd15a('0x32')](_0x5ab14b[_0xd15a('0x30')],_0x5ab14b[_0xd15a('0x19')])[_0xd15a('0x16')](_0xd15a('0x33')),'endDate':moment()['format'](_0xd15a('0x33')),'type':_0xd15a('0x34'),'output':_0x5ab14b[_0xd15a('0x35')],'name':_0x5ab14b[_0xd15a('0x17')]};if(!_[_0xd15a('0x2f')](_0x5ab14b['DefaultReportId'])){logger[_0xd15a('0x29')](_0xd15a('0x36'),_0x5ab14b[_0xd15a('0x37')]);return analyticDefaultReportController[_0xd15a('0x38')]({'id':_0x5ab14b[_0xd15a('0x37')]},_0x19ba74)[_0xd15a('0x39')](handleResult(_0x5ab14b))[_0xd15a('0x3a')](handleError());}if(!_[_0xd15a('0x2f')](_0x5ab14b[_0xd15a('0x3b')])){logger[_0xd15a('0x29')](_0xd15a('0x3c'),_0x5ab14b['CustomReportId']);return analyticCustomReportController[_0xd15a('0x38')]({'id':_0x5ab14b[_0xd15a('0x3b')]},_0x19ba74)[_0xd15a('0x39')](handleResult(_0x5ab14b))[_0xd15a('0x3a')](handleError());}}catch(_0x1d7a9e){logger[_0xd15a('0x2c')](JSON[_0xd15a('0x27')](_0x1d7a9e));}return logger['info'](_0xd15a('0x3d'));};}function getJobs(_0x1e9700){var _0x3ff7fc={};if(_0x1e9700){_0x3ff7fc['id']=_0x1e9700;}return db['Schedule']['findAll']({'where':_0x3ff7fc,'include':[{'model':db[_0xd15a('0xd')],'attributes':['id',_0xd15a('0x17'),_0xd15a('0xc')],'include':[{'model':db[_0xd15a('0x3e')],'as':_0xd15a('0xe')}]}]})[_0xd15a('0x39')](function(_0x2a5285){var _0x1026ce=_[_0xd15a('0x3f')](manager['jobs']);var _0x1a61af=_[_0xd15a('0x40')](_0x2a5285,function(_0x56bbbb){return _0x56bbbb['id'][_0xd15a('0x41')]();});var _0x3cdb93=_[_0xd15a('0x42')](_0x2a5285,function(_0x3cd4f6){return _0x3cd4f6['id'][_0xd15a('0x41')]();});var _0x4352c0=_0x1e9700?_0x1a61af:_[_0xd15a('0x43')](_0x1a61af,_0x1026ce);var _0x45585f=_[_0xd15a('0x44')](_0x1a61af,_0x1026ce);var _0x1305f3=_[_0xd15a('0x43')](_0x1026ce,_0x1a61af);var _0xfd6973;var _0x17754f;for(_0xfd6973=0x0;_0xfd6973<_0x1305f3['length']&&!_0x1e9700;_0xfd6973+=0x1){_0x17754f=_0x1305f3[_0xfd6973]['toString']();if(manager['exists'](_0x17754f)){manager['stop'](_0x17754f);manager[_0xd15a('0x45')](_0x17754f);logger[_0xd15a('0x29')](_0xd15a('0x46'),_0x17754f);}}logger[_0xd15a('0x29')](_0xd15a('0x47'),JSON[_0xd15a('0x27')](_0x4352c0));for(_0xfd6973=0x0;_0xfd6973<_0x4352c0[_0xd15a('0x48')];_0xfd6973+=0x1){_0x17754f=_0x4352c0[_0xfd6973][_0xd15a('0x41')]();logger[_0xd15a('0x29')]('index',_0x17754f);if(_0x1e9700){logger[_0xd15a('0x29')](_0xd15a('0x49'),_0x1e9700);logger[_0xd15a('0x29')](JSON[_0xd15a('0x27')](_0x3cdb93[_0x17754f]));BPromise[_0xd15a('0x4a')]()[_0xd15a('0x39')](handleJob(_0x3cdb93[_0x17754f]));logger[_0xd15a('0x29')](_0xd15a('0x4b'),_0x3cdb93[_0x17754f][_0xd15a('0x17')],_0x3cdb93[_0x17754f][_0xd15a('0x4c')]);}else if(_0x3cdb93[_0x17754f][_0xd15a('0x4c')]&&_0x3cdb93[_0x17754f]['active']&&moment()['isBetween'](_0x3cdb93[_0x17754f][_0xd15a('0x4d')],_0x3cdb93[_0x17754f]['endAt'])){manager['add'](_0x17754f,_0x3cdb93[_0x17754f]['cron'],handleJob(_0x3cdb93[_0x17754f]));manager[_0xd15a('0x4e')](_0x17754f);logger['info'](_0xd15a('0x4f'),_0x3cdb93[_0x17754f][_0xd15a('0x17')],_0x3cdb93[_0x17754f][_0xd15a('0x4c')]);}else if(manager[_0xd15a('0x50')](_0x17754f)){manager[_0xd15a('0x51')](_0x17754f);manager['deleteJob'](_0x17754f);logger[_0xd15a('0x29')](_0xd15a('0x52'),_0x3cdb93[_0x17754f][_0xd15a('0x17')],_0x3cdb93[_0x17754f][_0xd15a('0x4c')]);}}for(_0xfd6973=0x0,_0x17754f;_0xfd6973<_0x45585f['length']&&!_0x1e9700;_0xfd6973+=0x1){_0x17754f=_0x45585f[_0xfd6973]['toString']();if(manager[_0xd15a('0x50')](_0x17754f)){if(_0x3cdb93[_0x17754f]['cron']&&_0x3cdb93[_0x17754f]['active']&&moment()['isBetween'](_0x3cdb93[_0x17754f][_0xd15a('0x4d')],_0x3cdb93[_0x17754f]['endAt'])){manager['update'](_0x17754f,_0x3cdb93[_0x17754f][_0xd15a('0x4c')],handleJob(_0x3cdb93[_0x17754f]));logger[_0xd15a('0x29')](_0xd15a('0x53'),_0x3cdb93[_0x17754f][_0xd15a('0x17')],_0x3cdb93[_0x17754f][_0xd15a('0x4c')]);}else{manager[_0xd15a('0x51')](_0x17754f);manager[_0xd15a('0x45')](_0x17754f);logger[_0xd15a('0x29')]('stop\x20cron',_0x3cdb93[_0x17754f][_0xd15a('0x17')],_0x3cdb93[_0x17754f]['cron']);}}}})[_0xd15a('0x3a')](function(_0x2c20ab){logger[_0xd15a('0x2c')](JSON['stringify'](_0x2c20ab));});}exports[_0xd15a('0x54')]=function(_0xa785cf){return getJobs(_0xa785cf);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 0cf2bc5..35aabfb 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 _0xd136=['inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','error','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis'];(function(_0x511ff0,_0x5f7232){var _0x5ddae4=function(_0x2bc913){while(--_0x2bc913){_0x511ff0['push'](_0x511ff0['shift']());}};_0x5ddae4(++_0x5f7232);}(_0xd136,0x94));var _0x6d13=function(_0x1c8a79,_0x3ad5a2){_0x1c8a79=_0x1c8a79-0x0;var _0x4b3e97=_0xd136[_0x1c8a79];return _0x4b3e97;};var _=require('lodash');var AWS=require(_0x6d13('0x0'));var rp=require(_0x6d13('0x1'));var util=require('util');var BPromise=require(_0x6d13('0x2'));var db=require(_0x6d13('0x3'))['db'];var logger=require(_0x6d13('0x4'))(_0x6d13('0x5'));function getTranscriptionJob(_0xec09ab,_0x387947,_0x276099,_0x18fa4f){return new Promise(function(_0x147026,_0x4aabef){var _0x335482=new AWS[(_0x6d13('0x6'))]({'accessKeyId':_0x387947,'secretAccessKey':_0xec09ab,'region':_0x276099});_0x335482['getTranscriptionJob']({'TranscriptionJobName':_0x18fa4f},function(_0x598021,_0x1af16f){if(_0x598021){return _0x4aabef(_0x598021);}else{return _0x147026(_0x1af16f);}});});}function sentiment(_0x1f7d07,_0x240dba,_0x2216d7,_0x5c8282,_0x4f494b){return new Promise(function(_0x1a3613,_0x600fa9){var _0x1cf1e1=new AWS['Comprehend']({'accessKeyId':_0x240dba,'secretAccessKey':_0x1f7d07,'region':_0x2216d7});_0x1cf1e1['detectSentiment']({'Text':_0x5c8282,'LanguageCode':_0x4f494b[_0x6d13('0x7')](0x0,0x2)},function(_0x2a2120,_0x28fe97){if(_0x2a2120){return _0x600fa9(_0x2a2120);}else{return _0x1a3613(_0x28fe97);}});});}function checkTranscribeJob(_0x47d637,_0x1b4cc3,_0x5ef7e6){var _0x37d3c1;return new BPromise(function(_0x2b53e8,_0x5a07f8){logger['info'](util['format'](_0x6d13('0x8'),_0x47d637['id'],_0x47d637[_0x6d13('0x9')]));return getTranscriptionJob(_0x5ef7e6[_0x6d13('0xa')],_0x5ef7e6[_0x6d13('0xb')],_0x1b4cc3[_0x6d13('0xc')],_0x47d637['transcribeName'])[_0x6d13('0xd')](function(_0x405368){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x10'),_0x47d637['id'],_0x47d637[_0x6d13('0x9')],_0x405368[_0x6d13('0x11')][_0x6d13('0x12')]));if(!_0x47d637[_0x6d13('0x13')]){switch(_0x405368['TranscriptionJob'][_0x6d13('0x12')]){case _0x6d13('0x14'):var _0x78eef7={'transcribeStatus':_0x405368[_0x6d13('0x11')][_0x6d13('0x12')],'fileUri':_0x405368[_0x6d13('0x11')][_0x6d13('0x15')][_0x6d13('0x16')]};logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x17'),_0x47d637['id']));return rp({'uri':_0x405368[_0x6d13('0x11')][_0x6d13('0x15')][_0x6d13('0x16')],'json':!![]})[_0x6d13('0xd')](function(_0x208876){logger['info'](util[_0x6d13('0xf')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x47d637['id']));if(_0x208876&&_0x208876[_0x6d13('0x18')]&&_0x208876[_0x6d13('0x18')][_0x6d13('0x19')]&&_0x208876['results'][_0x6d13('0x19')][_0x6d13('0x1a')]){_0x78eef7[_0x6d13('0x13')]='';for(var _0x4366a0=0x0;_0x4366a0<_0x208876[_0x6d13('0x18')][_0x6d13('0x19')][_0x6d13('0x1a')];_0x4366a0++){_0x78eef7[_0x6d13('0x13')]+=_0x208876['results'][_0x6d13('0x19')][_0x4366a0]['transcript']+'';}}return _0x47d637['update'](_0x78eef7);})[_0x6d13('0xd')](function(){logger['info'](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));if(!_0x47d637[_0x6d13('0x1c')]){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x1e'));}if(!_0x1b4cc3['sentiment']||!_0x1b4cc3[_0x6d13('0x1f')]||!_0x1b4cc3[_0x6d13('0x20')]||!_0x1b4cc3[_0x6d13('0x21')]||!_0x1b4cc3[_0x6d13('0x22')]){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x24'));}if(!_0x78eef7[_0x6d13('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b4cc3[_0x6d13('0x1f')]===_0x5ef7e6['id']){return _0x5ef7e6;}else{return db[_0x6d13('0x25')]['findOne']({'where':{'id':_settings[_0x6d13('0x1f')]}});}})[_0x6d13('0xd')](function(_0x19eb67){if(!_0x19eb67){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x26'));}if(!_0x19eb67[_0x6d13('0xa')]||!_0x19eb67[_0x6d13('0xb')]){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x27'));}_0x37d3c1=_0x19eb67;logger['info'](util[_0x6d13('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x47d637['id']));return sentiment(_0x37d3c1[_0x6d13('0xa')],_0x37d3c1[_0x6d13('0xb')],_0x1b4cc3[_0x6d13('0x20')],_0x78eef7[_0x6d13('0x13')],_0x1b4cc3[_0x6d13('0x21')]);})[_0x6d13('0xd')](function(_0x4d7223){logger['info'](util[_0x6d13('0xf')](_0x6d13('0x28'),_0x47d637['id']));return _0x47d637[_0x6d13('0x29')]({'sentiment':_0x4d7223[_0x6d13('0x2a')],'sPositive':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2c')],'sNegative':_0x4d7223['SentimentScore'][_0x6d13('0x2d')],'sMixed':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2e')],'sNeutral':_0x4d7223[_0x6d13('0x2b')][_0x6d13('0x2f')]});})[_0x6d13('0xd')](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});case _0x6d13('0x30'):return _0x47d637['update']({'transcribeStatus':'FAILED','failureReason':_0x405368[_0x6d13('0x11')]['FailureReason']})['then'](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});default:logger['info'](util[_0x6d13('0xf')](_0x6d13('0x31'),_0x47d637['id']));break;}}else{return BPromise[_0x6d13('0x32')]()['then'](function(){if(!_0x47d637[_0x6d13('0x1c')]){throw new db['Sequelize'][(_0x6d13('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1b4cc3['sentiment']||!_0x1b4cc3[_0x6d13('0x1f')]||!_0x1b4cc3[_0x6d13('0x20')]||!_0x1b4cc3['language']||!_0x1b4cc3['bucket']){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x24'));}if(!_0x47d637[_0x6d13('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1b4cc3[_0x6d13('0x1f')]===_0x5ef7e6['id']){return _0x5ef7e6;}else{return db[_0x6d13('0x25')]['findOne']({'where':{'id':_settings[_0x6d13('0x1f')]}});}})[_0x6d13('0xd')](function(_0x42a347){if(!_0x42a347){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x26'));}if(!_0x42a347[_0x6d13('0xa')]||!_0x42a347['data2']){throw new db[(_0x6d13('0x23'))][(_0x6d13('0x1d'))](_0x6d13('0x27'));}_0x37d3c1=_0x42a347;logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x33'),_0x47d637['id']));return sentiment(_0x37d3c1[_0x6d13('0xa')],_0x37d3c1['data2'],_0x1b4cc3[_0x6d13('0x20')],_0x47d637['fileText'],_0x1b4cc3[_0x6d13('0x21')]);})[_0x6d13('0xd')](function(_0x223b03){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x28'),_0x47d637['id']));return _0x47d637[_0x6d13('0x29')]({'sentiment':_0x223b03[_0x6d13('0x2a')],'sPositive':_0x223b03['SentimentScore'][_0x6d13('0x2c')],'sNegative':_0x223b03['SentimentScore'][_0x6d13('0x2d')],'sMixed':_0x223b03[_0x6d13('0x2b')][_0x6d13('0x2e')],'sNeutral':_0x223b03[_0x6d13('0x2b')][_0x6d13('0x2f')],'transcribeStatus':_0x6d13('0x14')});})[_0x6d13('0xd')](function(){logger[_0x6d13('0xe')](util[_0x6d13('0xf')](_0x6d13('0x1b'),_0x47d637['id']));_0x2b53e8();});}})[_0x6d13('0x34')](function(_0x479b50){if(_0x479b50){if(!_0x479b50[_0x6d13('0x35')]||_0x479b50[_0x6d13('0x35')]!==_0x6d13('0x36')){logger['error'](util['format'](_0x6d13('0x37'),_0x47d637['id']),util[_0x6d13('0x38')](_0x479b50,{'showHidden':![],'depth':null}));}}_0x2b53e8();});});}function checkTranscribe(){var _0x2492b5;var _0x5b00c6;var _0x3ac978;return db[_0x6d13('0x39')][_0x6d13('0x3a')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x6d13('0xd')](function(_0x122adb){if(!_0x122adb||!_0x122adb['length']){throw new db['Sequelize'][(_0x6d13('0x1d'))](_0x6d13('0x3b'));}_0x2492b5=_0x122adb;return db[_0x6d13('0x3c')][_0x6d13('0x3d')]({'where':{'id':0x1}});})[_0x6d13('0xd')](function(_0x3d3244){if(!_0x3d3244){throw new db['Sequelize']['ValidationError'](_0x6d13('0x3e'));}_0x5b00c6=_0x3d3244;if(!_0x5b00c6[_0x6d13('0x5')]||!_0x5b00c6[_0x6d13('0x3f')]||!_0x5b00c6[_0x6d13('0xc')]||!_0x5b00c6[_0x6d13('0x21')]||!_0x5b00c6['bucket']){throw new db[(_0x6d13('0x23'))]['ValidationError'](_0x6d13('0x40'));}return db[_0x6d13('0x25')][_0x6d13('0x3d')]({'where':{'id':_0x5b00c6['transcribeAccountId']}});})[_0x6d13('0xd')](function(_0x53854e){if(!_0x53854e){throw new db['Sequelize'][(_0x6d13('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x53854e[_0x6d13('0xa')]||!_0x53854e['data2']){throw new db[(_0x6d13('0x23'))]['ValidationError'](_0x6d13('0x27'));}_0x3ac978=_0x53854e;var _0x42f131=[];_0x2492b5['forEach'](function(_0x95e9c6){_0x42f131['push'](checkTranscribeJob(_0x95e9c6,_0x5b00c6,_0x3ac978));});return BPromise[_0x6d13('0x41')](_0x42f131);})[_0x6d13('0x34')](function(_0x2daf24){if(_0x2daf24){if(!_0x2daf24[_0x6d13('0x35')]||_0x2daf24['name']!==_0x6d13('0x36')){logger[_0x6d13('0x42')](util[_0x6d13('0x38')](_0x2daf24,{'showHidden':![],'depth':null}));}}});}exports[_0x6d13('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x3611=['COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','update','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','CloudProvider','forEach','all','inspect','start','lodash','util','../../config/logger','transcribe','getTranscriptionJob','Comprehend','info','format','data1','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText'];(function(_0x11dbb0,_0x557eb1){var _0x11873e=function(_0x361d8b){while(--_0x361d8b){_0x11dbb0['push'](_0x11dbb0['shift']());}};_0x11873e(++_0x557eb1);}(_0x3611,0x136));var _0x1361=function(_0xa00492,_0x5ab9e5){_0xa00492=_0xa00492-0x0;var _0x122014=_0x3611[_0xa00492];return _0x122014;};var _=require(_0x1361('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0x1361('0x1'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x1361('0x2'))(_0x1361('0x3'));function getTranscriptionJob(_0x25db42,_0x383a70,_0x5c4262,_0x289e07){return new Promise(function(_0x304832,_0x5aa5dc){var _0x216d22=new AWS['TranscribeService']({'accessKeyId':_0x383a70,'secretAccessKey':_0x25db42,'region':_0x5c4262});_0x216d22[_0x1361('0x4')]({'TranscriptionJobName':_0x289e07},function(_0x49cfad,_0x5cc29f){if(_0x49cfad){return _0x5aa5dc(_0x49cfad);}else{return _0x304832(_0x5cc29f);}});});}function sentiment(_0xc43b7e,_0x253b3a,_0x146242,_0x3f02de,_0x43acbd){return new Promise(function(_0x410a2b,_0x14756b){var _0x519638=new AWS[(_0x1361('0x5'))]({'accessKeyId':_0x253b3a,'secretAccessKey':_0xc43b7e,'region':_0x146242});_0x519638['detectSentiment']({'Text':_0x3f02de,'LanguageCode':_0x43acbd['substring'](0x0,0x2)},function(_0x10b9e7,_0x4a98fe){if(_0x10b9e7){return _0x14756b(_0x10b9e7);}else{return _0x410a2b(_0x4a98fe);}});});}function checkTranscribeJob(_0x27dd65,_0x2cecd6,_0xbc9d68){var _0x1a36e9;return new BPromise(function(_0x459788,_0x2e05ce){logger[_0x1361('0x6')](util[_0x1361('0x7')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x27dd65['id'],_0x27dd65['transcribeName']));return getTranscriptionJob(_0xbc9d68[_0x1361('0x8')],_0xbc9d68['data2'],_0x2cecd6['transcribeRegion'],_0x27dd65[_0x1361('0x9')])[_0x1361('0xa')](function(_0x31e1c7){logger[_0x1361('0x6')](util['format'](_0x1361('0xb'),_0x27dd65['id'],_0x27dd65[_0x1361('0x9')],_0x31e1c7[_0x1361('0xc')][_0x1361('0xd')]));if(!_0x27dd65[_0x1361('0xe')]){switch(_0x31e1c7[_0x1361('0xc')]['TranscriptionJobStatus']){case _0x1361('0xf'):var _0x49e768={'transcribeStatus':_0x31e1c7[_0x1361('0xc')][_0x1361('0xd')],'fileUri':_0x31e1c7[_0x1361('0xc')][_0x1361('0x10')][_0x1361('0x11')]};logger['info'](util[_0x1361('0x7')](_0x1361('0x12'),_0x27dd65['id']));return rp({'uri':_0x31e1c7[_0x1361('0xc')][_0x1361('0x10')]['TranscriptFileUri'],'json':!![]})['then'](function(_0xa3f1f8){logger['info'](util[_0x1361('0x7')](_0x1361('0x13'),_0x27dd65['id']));if(_0xa3f1f8&&_0xa3f1f8[_0x1361('0x14')]&&_0xa3f1f8[_0x1361('0x14')][_0x1361('0x15')]&&_0xa3f1f8['results'][_0x1361('0x15')][_0x1361('0x16')]){_0x49e768[_0x1361('0xe')]='';for(var _0x1d9c1d=0x0;_0x1d9c1d<_0xa3f1f8['results'][_0x1361('0x15')][_0x1361('0x16')];_0x1d9c1d++){_0x49e768[_0x1361('0xe')]+=_0xa3f1f8['results'][_0x1361('0x15')][_0x1d9c1d][_0x1361('0x17')]+'';}}return _0x27dd65['update'](_0x49e768);})[_0x1361('0xa')](function(){logger[_0x1361('0x6')](util[_0x1361('0x7')](_0x1361('0x18'),_0x27dd65['id']));if(!_0x27dd65['tempSentiment']){throw new db[(_0x1361('0x19'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2cecd6[_0x1361('0x1a')]||!_0x2cecd6[_0x1361('0x1b')]||!_0x2cecd6[_0x1361('0x1c')]||!_0x2cecd6[_0x1361('0x1d')]||!_0x2cecd6[_0x1361('0x1e')]){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))](_0x1361('0x20'));}if(!_0x49e768[_0x1361('0xe')]){throw new Error(_0x1361('0x21'));}if(_0x2cecd6[_0x1361('0x1b')]===_0xbc9d68['id']){return _0xbc9d68;}else{return db['CloudProvider'][_0x1361('0x22')]({'where':{'id':_settings[_0x1361('0x1b')]}});}})[_0x1361('0xa')](function(_0x187f85){if(!_0x187f85){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))](_0x1361('0x23'));}if(!_0x187f85[_0x1361('0x8')]||!_0x187f85[_0x1361('0x24')]){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))](_0x1361('0x25'));}_0x1a36e9=_0x187f85;logger[_0x1361('0x6')](util[_0x1361('0x7')](_0x1361('0x26'),_0x27dd65['id']));return sentiment(_0x1a36e9[_0x1361('0x8')],_0x1a36e9[_0x1361('0x24')],_0x2cecd6['sentimentRegion'],_0x49e768[_0x1361('0xe')],_0x2cecd6[_0x1361('0x1d')]);})['then'](function(_0x234be2){logger[_0x1361('0x6')](util[_0x1361('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x27dd65['id']));return _0x27dd65[_0x1361('0x27')]({'sentiment':_0x234be2['Sentiment'],'sPositive':_0x234be2[_0x1361('0x28')]['Positive'],'sNegative':_0x234be2['SentimentScore'][_0x1361('0x29')],'sMixed':_0x234be2['SentimentScore'][_0x1361('0x2a')],'sNeutral':_0x234be2[_0x1361('0x28')][_0x1361('0x2b')]});})[_0x1361('0xa')](function(){logger['info'](util[_0x1361('0x7')](_0x1361('0x18'),_0x27dd65['id']));_0x459788();});case'FAILED':return _0x27dd65[_0x1361('0x27')]({'transcribeStatus':'FAILED','failureReason':_0x31e1c7[_0x1361('0xc')]['FailureReason']})['then'](function(){logger[_0x1361('0x6')](util[_0x1361('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27dd65['id']));_0x459788();});default:logger[_0x1361('0x6')](util[_0x1361('0x7')](_0x1361('0x2c'),_0x27dd65['id']));break;}}else{return BPromise[_0x1361('0x2d')]()[_0x1361('0xa')](function(){if(!_0x27dd65[_0x1361('0x2e')]){throw new db['Sequelize'][(_0x1361('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2cecd6['sentiment']||!_0x2cecd6[_0x1361('0x1b')]||!_0x2cecd6[_0x1361('0x1c')]||!_0x2cecd6[_0x1361('0x1d')]||!_0x2cecd6[_0x1361('0x1e')]){throw new db[(_0x1361('0x19'))]['ValidationError'](_0x1361('0x20'));}if(!_0x27dd65[_0x1361('0xe')]){throw new Error(_0x1361('0x21'));}if(_0x2cecd6[_0x1361('0x1b')]===_0xbc9d68['id']){return _0xbc9d68;}else{return db['CloudProvider'][_0x1361('0x22')]({'where':{'id':_settings[_0x1361('0x1b')]}});}})[_0x1361('0xa')](function(_0x490c95){if(!_0x490c95){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x490c95['data1']||!_0x490c95['data2']){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1a36e9=_0x490c95;logger[_0x1361('0x6')](util[_0x1361('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x27dd65['id']));return sentiment(_0x1a36e9['data1'],_0x1a36e9[_0x1361('0x24')],_0x2cecd6[_0x1361('0x1c')],_0x27dd65[_0x1361('0xe')],_0x2cecd6[_0x1361('0x1d')]);})[_0x1361('0xa')](function(_0x193581){logger[_0x1361('0x6')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x27dd65['id']));return _0x27dd65[_0x1361('0x27')]({'sentiment':_0x193581[_0x1361('0x2f')],'sPositive':_0x193581['SentimentScore']['Positive'],'sNegative':_0x193581[_0x1361('0x28')][_0x1361('0x29')],'sMixed':_0x193581[_0x1361('0x28')][_0x1361('0x2a')],'sNeutral':_0x193581['SentimentScore'][_0x1361('0x2b')],'transcribeStatus':_0x1361('0xf')});})['then'](function(){logger[_0x1361('0x6')](util[_0x1361('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x27dd65['id']));_0x459788();});}})[_0x1361('0x30')](function(_0x5c4f56){if(_0x5c4f56){if(!_0x5c4f56[_0x1361('0x31')]||_0x5c4f56[_0x1361('0x31')]!==_0x1361('0x32')){logger[_0x1361('0x33')](util[_0x1361('0x7')](_0x1361('0x34'),_0x27dd65['id']),util['inspect'](_0x5c4f56,{'showHidden':![],'depth':null}));}}_0x459788();});});}function checkTranscribe(){var _0x21324c;var _0x4412c2;var _0x4b8114;return db[_0x1361('0x35')]['findAll']({'where':{'transcribeStatus':_0x1361('0x36')}})['then'](function(_0x1d8703){if(!_0x1d8703||!_0x1d8703['length']){throw new db['Sequelize'][(_0x1361('0x1f'))](_0x1361('0x37'));}_0x21324c=_0x1d8703;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x1361('0xa')](function(_0x3bd647){if(!_0x3bd647){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))](_0x1361('0x38'));}_0x4412c2=_0x3bd647;if(!_0x4412c2[_0x1361('0x3')]||!_0x4412c2[_0x1361('0x39')]||!_0x4412c2[_0x1361('0x3a')]||!_0x4412c2['language']||!_0x4412c2['bucket']){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))](_0x1361('0x3b'));}return db[_0x1361('0x3c')][_0x1361('0x22')]({'where':{'id':_0x4412c2[_0x1361('0x39')]}});})['then'](function(_0x1a7120){if(!_0x1a7120){throw new db['Sequelize'][(_0x1361('0x1f'))](_0x1361('0x23'));}if(!_0x1a7120[_0x1361('0x8')]||!_0x1a7120['data2']){throw new db[(_0x1361('0x19'))][(_0x1361('0x1f'))](_0x1361('0x25'));}_0x4b8114=_0x1a7120;var _0x96ca99=[];_0x21324c[_0x1361('0x3d')](function(_0x5ec794){_0x96ca99['push'](checkTranscribeJob(_0x5ec794,_0x4412c2,_0x4b8114));});return BPromise[_0x1361('0x3e')](_0x96ca99);})[_0x1361('0x30')](function(_0x307704){if(_0x307704){if(!_0x307704[_0x1361('0x31')]||_0x307704['name']!==_0x1361('0x32')){logger[_0x1361('0x33')](util[_0x1361('0x3f')](_0x307704,{'showHidden':![],'depth':null}));}}});}exports[_0x1361('0x40')]=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 0dbb442..d9f6901 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 _0xe41f=['format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system'];(function(_0x564c74,_0x504669){var _0xb815a3=function(_0x37cc39){while(--_0x37cc39){_0x564c74['push'](_0x564c74['shift']());}};_0xb815a3(++_0x504669);}(_0xe41f,0xb7));var _0xfe41=function(_0x4245ae,_0x594e15){_0x4245ae=_0x4245ae-0x0;var _0x2b2f79=_0xe41f[_0x4245ae];return _0x2b2f79;};'use strict';var _=require(_0xfe41('0x0'));var moment=require(_0xfe41('0x1'));var Redis=require(_0xfe41('0x2'));var util=require(_0xfe41('0x3'));var config=require(_0xfe41('0x4'));var db=require(_0xfe41('0x5'))['db'];var logger=require(_0xfe41('0x6'))('schedule');config[_0xfe41('0x7')]=_['defaults'](config['redis'],{'host':_0xfe41('0x8'),'port':0x18eb});var io=require(_0xfe41('0x9'))(new Redis(config[_0xfe41('0x7')]));function closeInteractions(){var _0x3b5aa2=[];return db[_0xfe41('0xa')][_0xfe41('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xfe41('0xc'))}}})[_0xfe41('0xd')](function(_0x1f1d8b){if(_0x1f1d8b&&_0x1f1d8b[_0xfe41('0xe')]){_0x3b5aa2=_[_0xfe41('0xf')](_0x1f1d8b||[],'id');logger[_0xfe41('0x10')](_0xfe41('0x11'),_0x3b5aa2[_0xfe41('0x12')]());return db[_0xfe41('0xa')]['update']({'closeReason':_0xfe41('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xfe41('0x14')](_0xfe41('0x15'))},{'where':{'id':_0x3b5aa2}});}})[_0xfe41('0xd')](function(){if(_0x3b5aa2&&_0x3b5aa2[_0xfe41('0xe')]){logger[_0xfe41('0x10')](_0xfe41('0x16'),_0x3b5aa2[_0xfe41('0x12')]());for(var _0x4739bc=0x0;_0x4739bc<_0x3b5aa2[_0xfe41('0xe')];_0x4739bc++){io[_0xfe41('0x17')](_0xfe41('0x18'),{'id':_0x3b5aa2[_0x4739bc],'closed':!![]});}}})[_0xfe41('0x19')](function(_0x1bb69a){logger[_0xfe41('0x1a')](_0xfe41('0x1b'),_0x1bb69a?util[_0xfe41('0x1c')](_0x1bb69a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x829a=['hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract'];(function(_0x3608ed,_0x1339d7){var _0xa53c8d=function(_0x2c6001){while(--_0x2c6001){_0x3608ed['push'](_0x3608ed['shift']());}};_0xa53c8d(++_0x1339d7);}(_0x829a,0xee));var _0xa829=function(_0x5a2ddc,_0x4d7f76){_0x5a2ddc=_0x5a2ddc-0x0;var _0x2d1019=_0x829a[_0x5a2ddc];return _0x2d1019;};'use strict';var _=require(_0xa829('0x0'));var moment=require('moment');var Redis=require(_0xa829('0x1'));var util=require(_0xa829('0x2'));var config=require(_0xa829('0x3'));var db=require(_0xa829('0x4'))['db'];var logger=require(_0xa829('0x5'))(_0xa829('0x6'));config[_0xa829('0x7')]=_[_0xa829('0x8')](config[_0xa829('0x7')],{'host':_0xa829('0x9'),'port':0x18eb});var io=require(_0xa829('0xa'))(new Redis(config[_0xa829('0x7')]));function closeInteractions(){var _0x2710b1=[];return db[_0xa829('0xb')][_0xa829('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa829('0xd')](0x18,_0xa829('0xe'))}}})[_0xa829('0xf')](function(_0x2c08f7){if(_0x2c08f7&&_0x2c08f7['length']){_0x2710b1=_[_0xa829('0x10')](_0x2c08f7||[],'id');logger[_0xa829('0x11')](_0xa829('0x12'),_0x2710b1[_0xa829('0x13')]());return db[_0xa829('0xb')]['update']({'closeReason':_0xa829('0x14'),'disposition':_0xa829('0x15'),'closed':!![],'closedAt':moment()['format'](_0xa829('0x16'))},{'where':{'id':_0x2710b1}});}})[_0xa829('0xf')](function(){if(_0x2710b1&&_0x2710b1['length']){logger[_0xa829('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2710b1[_0xa829('0x13')]());for(var _0x78e963=0x0;_0x78e963<_0x2710b1['length'];_0x78e963++){io[_0xa829('0x17')](_0xa829('0x18'),{'id':_0x2710b1[_0x78e963],'closed':!![]});}}})[_0xa829('0x19')](function(_0x4e32f0){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4e32f0?util[_0xa829('0x1a')](_0x4e32f0,{'showHidden':![],'depth':null}):'');});}exports[_0xa829('0x1b')]=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 f5be37c..29ba360 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x828b=['CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','log','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo'];(function(_0x388e15,_0x45b424){var _0x476c16=function(_0x2926e0){while(--_0x2926e0){_0x388e15['push'](_0x388e15['shift']());}};_0x476c16(++_0x45b424);}(_0x828b,0x161));var _0xb828=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x828b[_0x54da5b];return _0x285d3b;};'use strict';var util=require(_0xb828('0x0'));var db=require(_0xb828('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb828('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xb828('0x3')+i,'phone':0xf879fb460+i,'email':_0xb828('0x4')+i+_0xb828('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb828('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb828('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb828('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb828('0x2')]({'id':i,'firstName':_0xb828('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xb828('0x4')+i+_0xb828('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb828('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb828('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xb828('0x8')][_0xb828('0x9')]({'where':{}})['then'](function(){return db[_0xb828('0x8')]['bulkCreate'](contacts);})[_0xb828('0xa')](function(){console['log'](_0xb828('0xb'),_0xb828('0xc'));return db[_0xb828('0xd')]['destroy']({'where':{}});})[_0xb828('0xa')](function(){return db[_0xb828('0xd')][_0xb828('0xe')](hopper);})['then'](function(){console['log']('finished\x20populating',_0xb828('0xf'));return db['CmContact']['bulkCreate'](contacts2);})[_0xb828('0xa')](function(){console[_0xb828('0x10')](_0xb828('0xb'),_0xb828('0x11'));return db[_0xb828('0xd')][_0xb828('0xe')](hopper2);})[_0xb828('0xa')](function(){console[_0xb828('0x10')](_0xb828('0xb'),_0xb828('0x12'));})['catch'](function(_0x2075c5){console[_0xb828('0x10')](_0x2075c5);}); \ No newline at end of file +var _0x4f8d=['../mysqldb','push','Innocenzo','Biondo','now','@xcally.com','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','hopper2','catch','util'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x4f8d,0x179));var _0xd4f8=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x4f8d[_0x391c55];return _0xa434e0;};'use strict';var util=require(_0xd4f8('0x0'));var db=require(_0xd4f8('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd4f8('0x2')]({'id':i,'firstName':_0xd4f8('0x3')+i,'lastName':_0xd4f8('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd4f8('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd4f8('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd4f8('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd4f8('0x2')]({'id':i,'firstName':_0xd4f8('0x3')+i,'lastName':_0xd4f8('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xd4f8('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd4f8('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd4f8('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd4f8('0x5')]()});}db[_0xd4f8('0x7')]['destroy']({'where':{}})[_0xd4f8('0x8')](function(){return db['CmContact'][_0xd4f8('0x9')](contacts);})['then'](function(){console[_0xd4f8('0xa')](_0xd4f8('0xb'),_0xd4f8('0xc'));return db['CmHopper'][_0xd4f8('0xd')]({'where':{}});})['then'](function(){return db[_0xd4f8('0xe')][_0xd4f8('0x9')](hopper);})[_0xd4f8('0x8')](function(){console['log'](_0xd4f8('0xb'),_0xd4f8('0xf'));return db[_0xd4f8('0x7')][_0xd4f8('0x9')](contacts2);})[_0xd4f8('0x8')](function(){console[_0xd4f8('0xa')]('finished\x20populating','contacts2');return db[_0xd4f8('0xe')][_0xd4f8('0x9')](hopper2);})[_0xd4f8('0x8')](function(){console[_0xd4f8('0xa')](_0xd4f8('0xb'),_0xd4f8('0x10'));})[_0xd4f8('0x11')](function(_0x312561){console[_0xd4f8('0xa')](_0x312561);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 24f8d54..5c8dcd7 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfe8=['push','format','agent','%s%s','%s%s@xcally.com','password','wss','all','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','then','log','add\x20user','catch'];(function(_0x5f4d0a,_0x214e68){var _0x1b8c80=function(_0x54d74c){while(--_0x54d74c){_0x5f4d0a['push'](_0x5f4d0a['shift']());}};_0x1b8c80(++_0x214e68);}(_0xdfe8,0x69));var _0x8dfe=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0xdfe8[_0x297eea];return _0x1c42d2;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8dfe('0x0')]({'name':util[_0x8dfe('0x1')]('%s%s',_0x8dfe('0x2'),i),'fullname':util[_0x8dfe('0x1')](_0x8dfe('0x3'),_0x8dfe('0x2'),i),'email':util['format'](_0x8dfe('0x4'),_0x8dfe('0x2'),i),'role':_0x8dfe('0x2'),'password':_0x8dfe('0x5'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x8dfe('0x6')],'disallow':[_0x8dfe('0x7')],'allow':['ulaw'],'defaultuser':util[_0x8dfe('0x1')](_0x8dfe('0x3'),'agent',i),'encryption':'yes','avpf':_0x8dfe('0x8'),'force_avp':_0x8dfe('0x8'),'icesupport':'yes','dtlsenable':_0x8dfe('0x8'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x8dfe('0x9'),'dtlssetup':'actpass','callerid':util['format'](_0x8dfe('0xa'),util['format'](_0x8dfe('0x3'),'agent',i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x8dfe('0xb')](function(){console[_0x8dfe('0xc')](_0x8dfe('0xd'));})[_0x8dfe('0xe')](function(_0x190f72){console[_0x8dfe('0xc')](_0x190f72);}); \ No newline at end of file +var _0x0913=['actpass','\x22%s\x22\x20<%s>','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','all','ulaw','yes'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x0913,0x1ec));var _0x3091=function(_0x4a4c9b,_0x7cec4a){_0x4a4c9b=_0x4a4c9b-0x0;var _0x493e11=_0x0913[_0x4a4c9b];return _0x493e11;};'use strict';var util=require(_0x3091('0x0'));var db=require(_0x3091('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3091('0x2')]({'name':util[_0x3091('0x3')](_0x3091('0x4'),'agent',i),'fullname':util[_0x3091('0x3')]('%s%s',_0x3091('0x5'),i),'email':util[_0x3091('0x3')](_0x3091('0x6'),'agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x3091('0x7'),'ws',_0x3091('0x8')],'disallow':[_0x3091('0x9')],'allow':[_0x3091('0xa')],'defaultuser':util[_0x3091('0x3')](_0x3091('0x4'),_0x3091('0x5'),i),'encryption':_0x3091('0xb'),'avpf':_0x3091('0xb'),'force_avp':_0x3091('0xb'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x3091('0xc'),'callerid':util['format'](_0x3091('0xd'),util[_0x3091('0x3')](_0x3091('0x4'),'agent',i),0xfa0+i)});}db['User'][_0x3091('0xe')](users)['then'](function(){console[_0x3091('0xf')](_0x3091('0x10'));})[_0x3091('0x11')](function(_0x1eef2f){console[_0x3091('0xf')](_0x1eef2f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 818fd81..0f47e63 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1107=['log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','voice:outbound','VoiceQueue','ChatQueue','voice:inbound','getChatQueues','getFaxQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch'];(function(_0x8a431a,_0x13c750){var _0x50b105=function(_0xfe5fb6){while(--_0xfe5fb6){_0x8a431a['push'](_0x8a431a['shift']());}};_0x50b105(++_0x13c750);}(_0x1107,0xd8));var _0x7110=function(_0x3bbd21,_0x23f22d){_0x3bbd21=_0x3bbd21-0x0;var _0x11908b=_0x1107[_0x3bbd21];return _0x11908b;};'use strict';var _=require(_0x7110('0x0'));var util=require(_0x7110('0x1'));var BPromise=require(_0x7110('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x7110('0x3')],'include':[{'as':_0x7110('0x4'),'model':db['User'],'attributes':['id',_0x7110('0x3'),_0x7110('0x5')],'raw':!![],'where':{'role':_0x7110('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7110('0x3')],'where':{'role':_0x7110('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7110('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x7110('0x3')],'where':{'role':_0x7110('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7110('0x3'),_0x7110('0x8')],'where':{'type':_0x7110('0x9')}};function getAssociatedResources(_0x466351,_0x271466,_0x4960b1){return db[_0x7110('0xa')]['findOne']({'where':{'name':_0x466351,'userProfileId':_0x271466},'raw':!![]})[_0x7110('0xb')](function(_0x19d729){if(_0x19d729){if(_0x19d729['autoAssociation']){switch(_0x466351){case _0x7110('0xc'):case _0x7110('0xd'):case _0x7110('0xe'):case _0x7110('0xf'):case _0x7110('0x10'):case _0x7110('0x11'):case _0x7110('0x12'):return db[_0x4960b1][_0x7110('0x13')](queryQueues);case _0x7110('0x14'):return db[_0x4960b1]['findAll'](queryTelephones);case _0x7110('0x15'):return db[_0x4960b1]['findAll'](queryTrunks);case _0x7110('0x16'):return db[_0x4960b1]['findAll'](queryCampaigns);}}else{return db[_0x7110('0x17')][_0x7110('0x13')]({'attributes':[_0x7110('0x18')],'where':{'sectionId':_0x19d729['id']},'raw':!![]})[_0x7110('0xb')](function(_0x26fe8a){if(_0x26fe8a){var _0x1a8f7f={'where':{'id':_[_0x7110('0x19')](_0x26fe8a,'resourceId')},'raw':!![]};switch(_0x4960b1){case _0x7110('0x1a'):_0x1a8f7f['where'][_0x7110('0x5')]=_0x7110('0x7');break;case'Campaign':_0x1a8f7f[_0x7110('0x1b')][_0x7110('0x8')]=_0x7110('0x9');break;}return db[_0x4960b1]['findAll'](_0x1a8f7f);}else{return[];}});}}else{return[];}})['then'](function(_0x25cc51){return _0x25cc51;});}function joinOrLeaveQueues(_0x13c8ea,_0x388c84,_0x21cc2e,_0x2adfc7){_0x13c8ea[_0x388c84](util['format'](_0x7110('0x1c'),_0x21cc2e,_0x2adfc7[_0x7110('0x3')]));if(_0x2adfc7[_0x7110('0x4')]){for(var _0x264250=0x0;_0x264250<_0x2adfc7[_0x7110('0x4')][_0x7110('0x1d')];_0x264250+=0x1){_0x13c8ea[_0x388c84](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x2adfc7['Agents'][_0x264250][_0x7110('0x3')]));}}}function joinOrLeave(_0x5e22d9,_0x3bd510,_0xcf45c){var _0x2373b4;if(_0x5e22d9[_0x7110('0x20')]['query']['id']){db[_0x7110('0x1a')][_0x7110('0x21')]({'attributes':['id',_0x7110('0x3'),'role',_0x7110('0x22')],'where':{'id':_0x5e22d9['handshake']['query']['id']},'include':[{'model':db[_0x7110('0x23')],'as':_0x7110('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x25')],'as':_0x7110('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x7110('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x28')],'as':_0x7110('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x2a')],'as':_0x7110('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x7110('0x2c')],'as':_0x7110('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x7110('0xb')](function(_0x1b163a){if(_0x1b163a){_0x2373b4=_0x1b163a;_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x1b163a[_0x7110('0x3')]));var _0x5aedc2=[];switch(_0x1b163a['role']){case _0x7110('0x2e'):_0x5e22d9[_0x3bd510]('voice:inbound');_0x5e22d9[_0x3bd510]('voice:outbound');if(queryQueues[_0x7110('0x2f')](_0x7110('0x30'))){delete queryQueues['include'];}_0x5aedc2[_0x7110('0x31')](db['VoiceQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db['ChatQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x32')]['findAll'](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x33')][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x34')][_0x7110('0x13')](queryQueues));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x35')][_0x7110('0x13')](queryQueues));_0x5aedc2['push'](db['WhatsappQueue'][_0x7110('0x13')](queryQueues));_0x5aedc2['push'](db[_0x7110('0x1a')][_0x7110('0x13')](queryTelephones));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x36')]['findAll'](queryTrunks));_0x5aedc2['push'](db[_0x7110('0x37')]['findAll'](queryCampaigns));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x1a')]['findAll'](queryAgents));break;case _0x7110('0x38'):_0x5e22d9[_0x3bd510]('voice:inbound');_0x5e22d9[_0x3bd510](_0x7110('0x39'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xc'),_0x1b163a[_0x7110('0x22')],_0x7110('0x3a')));_0x5aedc2['push'](getAssociatedResources(_0x7110('0xd'),_0x1b163a[_0x7110('0x22')],_0x7110('0x3b')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xe'),_0x1b163a[_0x7110('0x22')],'FaxQueue'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0xf'),_0x1b163a[_0x7110('0x22')],'SmsQueue'));_0x5aedc2['push'](getAssociatedResources('MailQueues',_0x1b163a[_0x7110('0x22')],_0x7110('0x34')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0x11'),_0x1b163a['userProfileId'],_0x7110('0x35')));_0x5aedc2[_0x7110('0x31')](getAssociatedResources('WhatsappQueues',_0x1b163a[_0x7110('0x22')],'WhatsappQueue'));_0x5aedc2['push'](getAssociatedResources('Telephones',_0x1b163a[_0x7110('0x22')],'User'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources(_0x7110('0x15'),_0x1b163a[_0x7110('0x22')],'Trunk'));_0x5aedc2[_0x7110('0x31')](getAssociatedResources('IvrCampaigns',_0x1b163a[_0x7110('0x22')],_0x7110('0x37')));_0x5aedc2[_0x7110('0x31')](db[_0x7110('0x1a')][_0x7110('0x13')](queryAgents));break;case _0x7110('0x6'):_0x5e22d9[_0x3bd510](_0x7110('0x3c'));_0x5e22d9[_0x3bd510]('voice:outbound');_0x5aedc2[_0x7110('0x31')](_0x1b163a['getVoiceQueues']({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2['push'](_0x1b163a[_0x7110('0x3d')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2['push'](_0x1b163a[_0x7110('0x3e')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getSmsQueues']({'attributes':['id','name']}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getMailQueues']({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a[_0x7110('0x3f')]({'attributes':['id',_0x7110('0x3')]}));_0x5aedc2[_0x7110('0x31')](_0x1b163a['getWhatsappQueues']({'attributes':['id',_0x7110('0x3')]}));break;}return BPromise[_0x7110('0x40')](_0x5aedc2);}})[_0x7110('0xb')](function(_0x15b2ca){if(_0x15b2ca&&_0x15b2ca['length']){for(var _0x1bb7f3=0x0;_0x1bb7f3<_0x15b2ca[_0x7110('0x1d')];_0x1bb7f3+=0x1){for(var _0x4ca881=0x0;_0x4ca881<_0x15b2ca[_0x1bb7f3]['length'];_0x4ca881+=0x1){switch(_0x1bb7f3){case 0x0:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x41'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x1:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x42'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x2:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x43'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x3:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x44'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x4:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x45'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x5:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,'openchannel',_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x6:joinOrLeaveQueues(_0x5e22d9,_0x3bd510,_0x7110('0x46'),_0x15b2ca[_0x1bb7f3][_0x4ca881]);break;case 0x7:if(_0x2373b4['role']!==_0x7110('0x6'))_0x5e22d9[_0x3bd510](util['format'](_0x7110('0x47'),_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x3')]));break;case 0x8:if(_0x2373b4[_0x7110('0x5')]!=='agent')_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x48'),_0x15b2ca[_0x1bb7f3][_0x4ca881]['name']));break;case 0x9:if(_0x2373b4[_0x7110('0x5')]!==_0x7110('0x6'))_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x49'),_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x8')],_0x15b2ca[_0x1bb7f3][_0x4ca881][_0x7110('0x3')]));break;case 0xa:_0x5e22d9[_0x3bd510](util[_0x7110('0x1e')](_0x7110('0x1f'),_0x15b2ca[_0x1bb7f3][_0x4ca881]['name']));break;}}}}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x29ffe6=_[_0x7110('0x19')](_0x2373b4['ChatInteractions'],'id');return _0x2373b4['removeChatInteractions'](_0x29ffe6)[_0x7110('0xb')](function(){for(var _0x26976d=0x0;_0x26976d<_0x29ffe6[_0x7110('0x1d')];_0x26976d+=0x1){_0xcf45c[_0x7110('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x29ffe6[_0x26976d]),'UserId':Number(_0x2373b4['id'])});}});}})['then'](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x3d7ad6=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x26')],'id');return _0x2373b4[_0x7110('0x4c')](_0x3d7ad6)[_0x7110('0xb')](function(){for(var _0xa28592=0x0;_0xa28592<_0x3d7ad6['length'];_0xa28592+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x4d'),{'MailInteractionId':Number(_0x3d7ad6[_0xa28592]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510==='leave'){var _0x106ea4=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x27')],'id');return _0x2373b4[_0x7110('0x4e')](_0x106ea4)[_0x7110('0xb')](function(){for(var _0x5c9b76=0x0;_0x5c9b76<_0x106ea4[_0x7110('0x1d')];_0x5c9b76+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x4f'),{'FaxInteractionId':Number(_0x106ea4[_0x5c9b76]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x2102fd=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x29')],'id');return _0x2373b4[_0x7110('0x50')](_0x2102fd)[_0x7110('0xb')](function(){for(var _0x64b6df=0x0;_0x64b6df<_0x2102fd['length'];_0x64b6df+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x51'),{'SmsInteractionId':Number(_0x2102fd[_0x64b6df]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x9f41ab=_[_0x7110('0x19')](_0x2373b4['OpenchannelInteractions'],'id');return _0x2373b4[_0x7110('0x52')](_0x9f41ab)[_0x7110('0xb')](function(){for(var _0x444025=0x0;_0x444025<_0x9f41ab[_0x7110('0x1d')];_0x444025+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x53'),{'OpenchannelInteractionId':Number(_0x9f41ab[_0x444025]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0xb')](function(){if(_0x3bd510===_0x7110('0x4a')){var _0x3b17b4=_[_0x7110('0x19')](_0x2373b4[_0x7110('0x2d')],'id');return _0x2373b4[_0x7110('0x54')](_0x3b17b4)[_0x7110('0xb')](function(){for(var _0xfb36c1=0x0;_0xfb36c1<_0x3b17b4[_0x7110('0x1d')];_0xfb36c1+=0x1){_0xcf45c[_0x7110('0x4b')](_0x7110('0x55'),{'WhatsappInteractionId':Number(_0x3b17b4[_0xfb36c1]),'UserId':Number(_0x2373b4['id'])});}});}})[_0x7110('0x56')](function(_0x364a42){_0x5e22d9[_0x7110('0x57')](_0x364a42);});}}function onDisconnect(_0xb8f1d7,_0x5ec978){joinOrLeave(_0xb8f1d7,_0x7110('0x4a'),_0x5ec978);}function onConnect(_0x1112f7){joinOrLeave(_0x1112f7,_0x7110('0x58'));}exports[_0x7110('0x59')]=function(_0xc58606){_0xc58606['on'](_0x7110('0x5a'),function(_0x2d3f96){_0x2d3f96[_0x7110('0x5b')](0x0);_0x2d3f96[_0x7110('0x5c')]=_0x2d3f96[_0x7110('0x5d')][_0x7110('0x5a')][_0x7110('0x5e')]+':'+_0x2d3f96[_0x7110('0x5d')]['connection'][_0x7110('0x5f')];_0x2d3f96[_0x7110('0x60')]=new Date();_0x2d3f96[_0x7110('0x57')]=function(_0x34de8b){console[_0x7110('0x57')]('SocketIO\x20'+_0x2d3f96[_0x7110('0x61')][_0x7110('0x3')]+'['+_0x2d3f96[_0x7110('0x5c')]+']',_0x34de8b);};_0x2d3f96['on'](_0x7110('0x62'),function(){onDisconnect(_0x2d3f96,_0xc58606);_0x2d3f96[_0x7110('0x57')](_0x7110('0x63'));});onConnect(_0x2d3f96);_0x2d3f96[_0x7110('0x57')](_0x7110('0x64'));});}; \ No newline at end of file +var _0x6a55=['removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','./environment','User','role','name','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','ChatQueue','FaxQueues','SmsQueues','MailQueue','Trunks','Trunk','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','voice','chat','openchannel','whatsapp','telephone:%s','campaign:%s:%s','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','leave','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions'];(function(_0x9a138c,_0x2607f8){var _0x3771a3=function(_0x22ebbb){while(--_0x22ebbb){_0x9a138c['push'](_0x9a138c['shift']());}};_0x3771a3(++_0x2607f8);}(_0x6a55,0xdb));var _0x56a5=function(_0x5b174b,_0x404869){_0x5b174b=_0x5b174b-0x0;var _0x47ee37=_0x6a55[_0x5b174b];return _0x47ee37;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x56a5('0x1'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x56a5('0x2')],'attributes':['id','name',_0x56a5('0x3')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x56a5('0x4')],'where':{'role':_0x56a5('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x56a5('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x56a5('0x4')],'where':{'role':_0x56a5('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x56a5('0x4'),_0x56a5('0x7')],'where':{'type':_0x56a5('0x8')}};function getAssociatedResources(_0x586f7a,_0x1c9e7a,_0xf15490){return db[_0x56a5('0x9')][_0x56a5('0xa')]({'where':{'name':_0x586f7a,'userProfileId':_0x1c9e7a},'raw':!![]})[_0x56a5('0xb')](function(_0x3a721d){if(_0x3a721d){if(_0x3a721d[_0x56a5('0xc')]){switch(_0x586f7a){case _0x56a5('0xd'):case _0x56a5('0xe'):case'FaxQueues':case'SmsQueues':case _0x56a5('0xf'):case _0x56a5('0x10'):case _0x56a5('0x11'):return db[_0xf15490][_0x56a5('0x12')](queryQueues);case _0x56a5('0x13'):return db[_0xf15490][_0x56a5('0x12')](queryTelephones);case'Trunks':return db[_0xf15490]['findAll'](queryTrunks);case _0x56a5('0x14'):return db[_0xf15490][_0x56a5('0x12')](queryCampaigns);}}else{return db[_0x56a5('0x15')][_0x56a5('0x12')]({'attributes':[_0x56a5('0x16')],'where':{'sectionId':_0x3a721d['id']},'raw':!![]})[_0x56a5('0xb')](function(_0xe3091f){if(_0xe3091f){var _0x5c4028={'where':{'id':_[_0x56a5('0x17')](_0xe3091f,'resourceId')},'raw':!![]};switch(_0xf15490){case _0x56a5('0x2'):_0x5c4028['where'][_0x56a5('0x3')]=_0x56a5('0x5');break;case _0x56a5('0x18'):_0x5c4028[_0x56a5('0x19')][_0x56a5('0x7')]=_0x56a5('0x8');break;}return db[_0xf15490][_0x56a5('0x12')](_0x5c4028);}else{return[];}});}}else{return[];}})['then'](function(_0x8621c1){return _0x8621c1;});}function joinOrLeaveQueues(_0x3db687,_0x2bd357,_0x127d73,_0x52eee2){_0x3db687[_0x2bd357](util[_0x56a5('0x1a')](_0x56a5('0x1b'),_0x127d73,_0x52eee2[_0x56a5('0x4')]));if(_0x52eee2[_0x56a5('0x1c')]){for(var _0x155d3b=0x0;_0x155d3b<_0x52eee2['Agents']['length'];_0x155d3b+=0x1){_0x3db687[_0x2bd357](util[_0x56a5('0x1a')](_0x56a5('0x1d'),_0x52eee2['Agents'][_0x155d3b][_0x56a5('0x4')]));}}}function joinOrLeave(_0x309fa5,_0x615d49,_0x15d9f8){var _0xe1ded0;if(_0x309fa5[_0x56a5('0x1e')][_0x56a5('0x1f')]['id']){db[_0x56a5('0x2')][_0x56a5('0x20')]({'attributes':['id',_0x56a5('0x4'),_0x56a5('0x3'),_0x56a5('0x21')],'where':{'id':_0x309fa5[_0x56a5('0x1e')]['query']['id']},'include':[{'model':db[_0x56a5('0x22')],'as':_0x56a5('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x56a5('0x24')],'as':_0x56a5('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x56a5('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x56a5('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x56a5('0x28')],'as':_0x56a5('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x56a5('0x2a')],'as':_0x56a5('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3b55e6){if(_0x3b55e6){_0xe1ded0=_0x3b55e6;_0x309fa5[_0x615d49](util[_0x56a5('0x1a')](_0x56a5('0x1d'),_0x3b55e6['name']));var _0x22ceab=[];switch(_0x3b55e6[_0x56a5('0x3')]){case _0x56a5('0x2c'):_0x309fa5[_0x615d49](_0x56a5('0x2d'));_0x309fa5[_0x615d49](_0x56a5('0x2e'));if(queryQueues['hasOwnProperty'](_0x56a5('0x2f'))){delete queryQueues[_0x56a5('0x2f')];}_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x31')][_0x56a5('0x12')](queryQueues));_0x22ceab['push'](db['ChatQueue'][_0x56a5('0x12')](queryQueues));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x32')]['findAll'](queryQueues));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x33')]['findAll'](queryQueues));_0x22ceab['push'](db['MailQueue']['findAll'](queryQueues));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x34')][_0x56a5('0x12')](queryQueues));_0x22ceab['push'](db[_0x56a5('0x35')]['findAll'](queryQueues));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x2')]['findAll'](queryTelephones));_0x22ceab[_0x56a5('0x30')](db['Trunk'][_0x56a5('0x12')](queryTrunks));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x18')]['findAll'](queryCampaigns));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x2')][_0x56a5('0x12')](queryAgents));break;case'user':_0x309fa5[_0x615d49](_0x56a5('0x2d'));_0x309fa5[_0x615d49](_0x56a5('0x2e'));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0xd'),_0x3b55e6[_0x56a5('0x21')],'VoiceQueue'));_0x22ceab['push'](getAssociatedResources(_0x56a5('0xe'),_0x3b55e6[_0x56a5('0x21')],_0x56a5('0x36')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0x37'),_0x3b55e6[_0x56a5('0x21')],_0x56a5('0x32')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0x38'),_0x3b55e6[_0x56a5('0x21')],_0x56a5('0x33')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0xf'),_0x3b55e6[_0x56a5('0x21')],_0x56a5('0x39')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0x10'),_0x3b55e6[_0x56a5('0x21')],_0x56a5('0x34')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0x11'),_0x3b55e6[_0x56a5('0x21')],'WhatsappQueue'));_0x22ceab['push'](getAssociatedResources(_0x56a5('0x13'),_0x3b55e6['userProfileId'],_0x56a5('0x2')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources(_0x56a5('0x3a'),_0x3b55e6[_0x56a5('0x21')],_0x56a5('0x3b')));_0x22ceab[_0x56a5('0x30')](getAssociatedResources('IvrCampaigns',_0x3b55e6['userProfileId'],_0x56a5('0x18')));_0x22ceab[_0x56a5('0x30')](db[_0x56a5('0x2')][_0x56a5('0x12')](queryAgents));break;case _0x56a5('0x6'):_0x309fa5[_0x615d49](_0x56a5('0x2d'));_0x309fa5[_0x615d49]('voice:outbound');_0x22ceab[_0x56a5('0x30')](_0x3b55e6[_0x56a5('0x3c')]({'attributes':['id','name']}));_0x22ceab[_0x56a5('0x30')](_0x3b55e6[_0x56a5('0x3d')]({'attributes':['id',_0x56a5('0x4')]}));_0x22ceab[_0x56a5('0x30')](_0x3b55e6['getFaxQueues']({'attributes':['id',_0x56a5('0x4')]}));_0x22ceab['push'](_0x3b55e6[_0x56a5('0x3e')]({'attributes':['id',_0x56a5('0x4')]}));_0x22ceab['push'](_0x3b55e6[_0x56a5('0x3f')]({'attributes':['id','name']}));_0x22ceab[_0x56a5('0x30')](_0x3b55e6[_0x56a5('0x40')]({'attributes':['id','name']}));_0x22ceab[_0x56a5('0x30')](_0x3b55e6['getWhatsappQueues']({'attributes':['id',_0x56a5('0x4')]}));break;}return BPromise['all'](_0x22ceab);}})[_0x56a5('0xb')](function(_0x47c740){if(_0x47c740&&_0x47c740[_0x56a5('0x41')]){for(var _0xe57293=0x0;_0xe57293<_0x47c740[_0x56a5('0x41')];_0xe57293+=0x1){for(var _0x3017dd=0x0;_0x3017dd<_0x47c740[_0xe57293][_0x56a5('0x41')];_0x3017dd+=0x1){switch(_0xe57293){case 0x0:joinOrLeaveQueues(_0x309fa5,_0x615d49,_0x56a5('0x42'),_0x47c740[_0xe57293][_0x3017dd]);break;case 0x1:joinOrLeaveQueues(_0x309fa5,_0x615d49,_0x56a5('0x43'),_0x47c740[_0xe57293][_0x3017dd]);break;case 0x2:joinOrLeaveQueues(_0x309fa5,_0x615d49,'fax',_0x47c740[_0xe57293][_0x3017dd]);break;case 0x3:joinOrLeaveQueues(_0x309fa5,_0x615d49,'sms',_0x47c740[_0xe57293][_0x3017dd]);break;case 0x4:joinOrLeaveQueues(_0x309fa5,_0x615d49,'mail',_0x47c740[_0xe57293][_0x3017dd]);break;case 0x5:joinOrLeaveQueues(_0x309fa5,_0x615d49,_0x56a5('0x44'),_0x47c740[_0xe57293][_0x3017dd]);break;case 0x6:joinOrLeaveQueues(_0x309fa5,_0x615d49,_0x56a5('0x45'),_0x47c740[_0xe57293][_0x3017dd]);break;case 0x7:if(_0xe1ded0[_0x56a5('0x3')]!=='agent')_0x309fa5[_0x615d49](util[_0x56a5('0x1a')](_0x56a5('0x46'),_0x47c740[_0xe57293][_0x3017dd][_0x56a5('0x4')]));break;case 0x8:if(_0xe1ded0['role']!==_0x56a5('0x6'))_0x309fa5[_0x615d49](util[_0x56a5('0x1a')]('trunk:%s',_0x47c740[_0xe57293][_0x3017dd][_0x56a5('0x4')]));break;case 0x9:if(_0xe1ded0[_0x56a5('0x3')]!==_0x56a5('0x6'))_0x309fa5[_0x615d49](util[_0x56a5('0x1a')](_0x56a5('0x47'),_0x47c740[_0xe57293][_0x3017dd]['type'],_0x47c740[_0xe57293][_0x3017dd][_0x56a5('0x4')]));break;case 0xa:_0x309fa5[_0x615d49](util[_0x56a5('0x1a')](_0x56a5('0x1d'),_0x47c740[_0xe57293][_0x3017dd][_0x56a5('0x4')]));break;}}}}})[_0x56a5('0xb')](function(){if(_0x615d49==='leave'){var _0x22be73=_[_0x56a5('0x17')](_0xe1ded0['ChatInteractions'],'id');return _0xe1ded0[_0x56a5('0x48')](_0x22be73)[_0x56a5('0xb')](function(){for(var _0x1565c0=0x0;_0x1565c0<_0x22be73['length'];_0x1565c0+=0x1){_0x15d9f8[_0x56a5('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x22be73[_0x1565c0]),'UserId':Number(_0xe1ded0['id'])});}});}})[_0x56a5('0xb')](function(){if(_0x615d49==='leave'){var _0x12821e=_[_0x56a5('0x17')](_0xe1ded0[_0x56a5('0x25')],'id');return _0xe1ded0[_0x56a5('0x4a')](_0x12821e)['then'](function(){for(var _0x341116=0x0;_0x341116<_0x12821e['length'];_0x341116+=0x1){_0x15d9f8[_0x56a5('0x49')](_0x56a5('0x4b'),{'MailInteractionId':Number(_0x12821e[_0x341116]),'UserId':Number(_0xe1ded0['id'])});}});}})[_0x56a5('0xb')](function(){if(_0x615d49===_0x56a5('0x4c')){var _0x20988d=_[_0x56a5('0x17')](_0xe1ded0[_0x56a5('0x4d')],'id');return _0xe1ded0[_0x56a5('0x4e')](_0x20988d)[_0x56a5('0xb')](function(){for(var _0x76c6bb=0x0;_0x76c6bb<_0x20988d['length'];_0x76c6bb+=0x1){_0x15d9f8[_0x56a5('0x49')](_0x56a5('0x4f'),{'FaxInteractionId':Number(_0x20988d[_0x76c6bb]),'UserId':Number(_0xe1ded0['id'])});}});}})['then'](function(){if(_0x615d49===_0x56a5('0x4c')){var _0x5b9a2c=_[_0x56a5('0x17')](_0xe1ded0[_0x56a5('0x50')],'id');return _0xe1ded0[_0x56a5('0x51')](_0x5b9a2c)[_0x56a5('0xb')](function(){for(var _0xcc1218=0x0;_0xcc1218<_0x5b9a2c['length'];_0xcc1218+=0x1){_0x15d9f8[_0x56a5('0x49')](_0x56a5('0x52'),{'SmsInteractionId':Number(_0x5b9a2c[_0xcc1218]),'UserId':Number(_0xe1ded0['id'])});}});}})[_0x56a5('0xb')](function(){if(_0x615d49===_0x56a5('0x4c')){var _0x580f08=_['map'](_0xe1ded0[_0x56a5('0x29')],'id');return _0xe1ded0[_0x56a5('0x53')](_0x580f08)[_0x56a5('0xb')](function(){for(var _0xe5f854=0x0;_0xe5f854<_0x580f08[_0x56a5('0x41')];_0xe5f854+=0x1){_0x15d9f8[_0x56a5('0x49')](_0x56a5('0x54'),{'OpenchannelInteractionId':Number(_0x580f08[_0xe5f854]),'UserId':Number(_0xe1ded0['id'])});}});}})['then'](function(){if(_0x615d49===_0x56a5('0x4c')){var _0x3c9832=_[_0x56a5('0x17')](_0xe1ded0['WhatsappInteractions'],'id');return _0xe1ded0['removeWhatsappInteractions'](_0x3c9832)[_0x56a5('0xb')](function(){for(var _0x150bc3=0x0;_0x150bc3<_0x3c9832[_0x56a5('0x41')];_0x150bc3+=0x1){_0x15d9f8[_0x56a5('0x49')](_0x56a5('0x55'),{'WhatsappInteractionId':Number(_0x3c9832[_0x150bc3]),'UserId':Number(_0xe1ded0['id'])});}});}})[_0x56a5('0x56')](function(_0x3624b1){_0x309fa5['log'](_0x3624b1);});}}function onDisconnect(_0x405eac,_0xefb9a8){joinOrLeave(_0x405eac,_0x56a5('0x4c'),_0xefb9a8);}function onConnect(_0x4240e3){joinOrLeave(_0x4240e3,_0x56a5('0x57'));}exports[_0x56a5('0x58')]=function(_0x50b7d0){_0x50b7d0['on'](_0x56a5('0x59'),function(_0x13c8c1){_0x13c8c1[_0x56a5('0x5a')](0x0);_0x13c8c1[_0x56a5('0x5b')]=_0x13c8c1[_0x56a5('0x5c')][_0x56a5('0x59')]['remoteAddress']+':'+_0x13c8c1['request'][_0x56a5('0x59')][_0x56a5('0x5d')];_0x13c8c1[_0x56a5('0x5e')]=new Date();_0x13c8c1['log']=function(_0x3e243f){console[_0x56a5('0x5f')](_0x56a5('0x60')+_0x13c8c1[_0x56a5('0x61')][_0x56a5('0x4')]+'['+_0x13c8c1[_0x56a5('0x5b')]+']',_0x3e243f);};_0x13c8c1['on'](_0x56a5('0x62'),function(){onDisconnect(_0x13c8c1,_0x50b7d0);_0x13c8c1[_0x56a5('0x5f')]('DISCONNECTED');});onConnect(_0x13c8c1);_0x13c8c1[_0x56a5('0x5f')](_0x56a5('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 8904fdb..65048fb 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 _0x52e6=['ContactId','sequelize','query','QueryTypes','SELECT','then','contact','UserId','User','find','name','email','internal','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','motionChannel','event','opened','Sequelize','changed','closed','fullname','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','Chat','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'];(function(_0x4f81a5,_0x3b8f31){var _0x28e8d4=function(_0xfa06e0){while(--_0xfa06e0){_0x4f81a5['push'](_0x4f81a5['shift']());}};_0x28e8d4(++_0x3b8f31);}(_0x52e6,0x1c0));var _0x652e=function(_0x584d62,_0x48e7ac){_0x584d62=_0x584d62-0x0;var _0x483d7e=_0x52e6[_0x584d62];return _0x483d7e;};'use strict';var util=require(_0x652e('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x652e('0x1'));var logger=require(_0x652e('0x2'))(_0x652e('0x3'));var _=require('lodash');var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x652e('0x4'),'model':'ChatInteraction','event':_0x652e('0x5'),'condition':_0x652e('0x6'),'callback':afterCreate},{'channel':_0x652e('0x4'),'model':'ChatInteraction','event':_0x652e('0x7'),'condition':_0x652e('0x8'),'callback':afterUpdate},{'channel':_0x652e('0x4'),'model':_0x652e('0x9'),'event':_0x652e('0x5'),'condition':_0x652e('0xa'),'callback':afterCreateMessage},{'channel':_0x652e('0xb'),'model':'SmsInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0x652e('0xc'),'event':'afterUpdate','condition':_0x652e('0x8'),'callback':afterUpdate},{'channel':'Sms','model':_0x652e('0xd'),'event':_0x652e('0x5'),'condition':_0x652e('0xa'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x652e('0xe'),'event':'afterCreate','condition':_0x652e('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x652e('0xe'),'event':_0x652e('0x7'),'condition':_0x652e('0x8'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x652e('0xf'),'event':_0x652e('0x5'),'condition':_0x652e('0xa'),'callback':afterCreateMessage},{'channel':_0x652e('0x10'),'model':_0x652e('0x11'),'event':_0x652e('0x5'),'condition':_0x652e('0x6'),'callback':afterCreate},{'channel':'Fax','model':_0x652e('0x11'),'event':_0x652e('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x652e('0x12'),'event':_0x652e('0x5'),'condition':_0x652e('0xa'),'callback':afterCreateMessage},{'channel':_0x652e('0x13'),'model':_0x652e('0x14'),'event':_0x652e('0x5'),'condition':_0x652e('0x6'),'callback':afterCreate},{'channel':_0x652e('0x13'),'model':'MailInteraction','event':'afterUpdate','condition':_0x652e('0x8'),'callback':afterUpdate},{'channel':'Mail','model':_0x652e('0x15'),'event':'afterCreate','condition':_0x652e('0xa'),'callback':afterCreateMessage},{'channel':_0x652e('0x16'),'model':_0x652e('0x17'),'event':'afterCreate','condition':_0x652e('0x6'),'callback':afterCreate},{'channel':'Openchannel','model':_0x652e('0x17'),'event':_0x652e('0x7'),'condition':_0x652e('0x8'),'callback':afterUpdate},{'channel':_0x652e('0x16'),'model':'OpenchannelMessage','event':_0x652e('0x5'),'condition':_0x652e('0xa'),'callback':afterCreateMessage}];function request(_0x27d158){return client[_0x652e('0x18')](_0x652e('0x19'),_0x27d158)['then'](function(_0x3171ba){logger[_0x652e('0x1a')](_0x652e('0x1b'),_0x652e('0x19'),_0x3171ba);if(_0x3171ba['error']){if(_0x3171ba[_0x652e('0x1c')][_0x652e('0x1d')]===0x1f4){logger['error'](_0x652e('0x1b'),_0x652e('0x19'),_0x3171ba[_0x652e('0x1c')]);}}})[_0x652e('0x1e')](function(_0x2b32ac){logger[_0x652e('0x1c')](_0x652e('0x1b'),_0x652e('0x19'),_0x2b32ac);});}function afterCreateMessage(_0x330bdb,_0xa9ab7a){return function(_0x176b48,_0x4c2fc2){_0x176b48=_0x176b48[_0x652e('0x1f')]({'plain':!![]});_0x176b48[_0x652e('0x20')]=_0x330bdb;_0x176b48['motionChannel']=_0x330bdb;_0x176b48['event']=_0x176b48[_0x652e('0x21')];var _0x48416a=_0x652e('0x22')+_0x176b48[_0x652e('0x23')];return db[_0x652e('0x24')][_0x652e('0x25')](_0x48416a,{'type':db['Sequelize'][_0x652e('0x26')][_0x652e('0x27')],'raw':!![]})[_0x652e('0x28')](function(_0x463be6){return _0x463be6;})[_0x652e('0x28')](function(_0xc97742){if(_0xc97742){_0x176b48[_0x652e('0x29')]=_0xc97742[0x0];}if(_0x176b48[_0x652e('0x2a')]){return db[_0x652e('0x2b')][_0x652e('0x2c')]({'where':{'id':_0x176b48[_0x652e('0x2a')]},'attributes':['id',_0x652e('0x2d'),'fullname',_0x652e('0x2e'),_0x652e('0x2f')],'raw':!![]})[_0x652e('0x28')](function(_0x81b01c){_0x176b48[_0x652e('0x30')]=util[_0x652e('0x31')](_0x652e('0x32'),_0x81b01c[_0x652e('0x2d')]);_0x176b48[_0x652e('0x20')]=_0x330bdb;_0x176b48[_0x652e('0x33')]=_0x81b01c;return request({'event':_0x652e('0x34'),'message':_0x176b48});})[_0x652e('0x1e')](function(_0x3e4742){console[_0x652e('0x1c')](_0x3e4742);});}else{return request({'event':_0x652e('0x35'),'message':_0x176b48});}});};}function afterCreate(_0x4d25ce,_0x440884){return function(_0x5e140c,_0x264dc2){_0x5e140c=_0x5e140c[_0x652e('0x1f')]({'plain':!![]});_0x5e140c[_0x652e('0x20')]=_0x4d25ce;_0x5e140c[_0x652e('0x36')]=_0x4d25ce;_0x5e140c[_0x652e('0x37')]=_0x652e('0x38');var _0x5a13a4=_0x652e('0x22')+_0x5e140c[_0x652e('0x23')];return db[_0x652e('0x24')][_0x652e('0x25')](_0x5a13a4,{'type':db[_0x652e('0x39')][_0x652e('0x26')][_0x652e('0x27')],'raw':!![]})[_0x652e('0x28')](function(_0x16532d){return _0x16532d;})['then'](function(_0x3d659e){if(_0x3d659e){_0x5e140c[_0x652e('0x29')]=_0x3d659e[0x0];}return request({'event':_0x440884,'message':_0x5e140c});});};}function afterUpdate(_0x746972){return function(_0x23b9e0){var _0x1708f5=_0x23b9e0[_0x652e('0x3a')](_0x652e('0x3b'))&&_0x23b9e0[_0x652e('0x3b')];var _0x1a250d=_0x23b9e0[_0x652e('0x3a')]('substatus');if(_0x1708f5||_0x1a250d){var _0x28e990=_0x1708f5?_0x652e('0x8'):'substatus';var _0x264627=_0x23b9e0[_0x652e('0x1f')]({'plain':!![]});_0x264627[_0x652e('0x20')]=_0x746972;_0x264627['motionChannel']=_0x746972;_0x264627[_0x652e('0x37')]=_0x1708f5?_0x652e('0x3b'):'substatus';var _0x3ebaf4=_0x652e('0x22')+_0x264627[_0x652e('0x23')];return db[_0x652e('0x24')][_0x652e('0x25')](_0x3ebaf4,{'type':db[_0x652e('0x39')][_0x652e('0x26')][_0x652e('0x27')],'raw':!![]})['then'](function(_0x35e483){if(_0x35e483){_0x264627[_0x652e('0x29')]=_0x35e483[0x0];}if(_0x264627['UserId']){return db[_0x652e('0x2b')]['find']({'where':{'id':_0x264627[_0x652e('0x2a')]},'attributes':['id','name',_0x652e('0x3c'),_0x652e('0x2e'),_0x652e('0x2f')],'raw':!![]})[_0x652e('0x28')](function(_0x2d871f){_0x264627[_0x652e('0x30')]=util[_0x652e('0x31')](_0x652e('0x32'),_0x2d871f[_0x652e('0x2d')]);_0x264627[_0x652e('0x33')]=_0x2d871f;return request({'event':_0x28e990,'message':_0x264627});})['catch'](function(_0x5417e3){console[_0x652e('0x1c')](_0x5417e3);});}else{return request({'event':_0x28e990,'message':_0x264627});}});}};}exports[_0x652e('0x3d')]=function(){for(var _0x256e13=0x0;_0x256e13=_0x6454c9[_0x9697('0x10')]){throw Error(_0x9697('0x11'));}_0x23bb19(_0x1e79b4);})[_0x9697('0x12')](function(_0x1e5e3b){_0xe996e2(_0x1e5e3b);});});}; \ No newline at end of file +var _0xf004=['updateAttributes','getLicense','role','agent','User','then','agents','catch','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','blockedAt'];(function(_0x2b7567,_0x412715){var _0x2522dc=function(_0x242d85){while(--_0x242d85){_0x2b7567['push'](_0x2b7567['shift']());}};_0x2522dc(++_0x412715);}(_0xf004,0x178));var _0x4f00=function(_0x28340a,_0x37f8ed){_0x28340a=_0x28340a-0x0;var _0x39ed64=_0xf004[_0x28340a];return _0x39ed64;};'use strict';var _=require('lodash');var BPromise=require(_0x4f00('0x0'));var db=require(_0x4f00('0x1'))['db'];var util=require(_0x4f00('0x2'));var channels=[_0x4f00('0x3'),_0x4f00('0x4'),_0x4f00('0x5'),_0x4f00('0x6'),_0x4f00('0x7'),'whatsapp',_0x4f00('0x8')];exports[_0x4f00('0x9')]=function(){return channels;};exports[_0x4f00('0xa')]=function(_0x46d368){_0x46d368=_0x46d368[_0x4f00('0xb')]();return _[_0x4f00('0xc')](channels,_0x46d368);};exports['clearBlockUser']=function(_0x2f252f,_0x5be49e,_0x3e12dc,_0x23ccae){var _0x1902df={'loginAttempts':_0x5be49e,'blocked':_0x3e12dc};if(!_[_0x4f00('0xd')](_0x23ccae)){_0x1902df[_0x4f00('0xe')]=_0x23ccae;}return _0x2f252f[_0x4f00('0xf')](_0x1902df);};exports[_0x4f00('0x10')]=function(_0x1854f3){return new BPromise(function(_0x5d149e,_0x2ead22){var _0x574263=0x0;if(_0x1854f3[_0x4f00('0x11')]!==_0x4f00('0x12')){_0x5d149e(_0x1854f3);}db[_0x4f00('0x13')]['count']({'where':{'role':_0x4f00('0x12'),'online':!![],'id':{'$ne':_0x1854f3['id']}}})[_0x4f00('0x14')](function(_0x565ee4){_0x574263=_0x565ee4;return util[_0x4f00('0x10')]();})[_0x4f00('0x14')](function(_0x3f01a6){if(_0x3f01a6&&_0x3f01a6[_0x4f00('0x15')]&&_0x574263>=_0x3f01a6[_0x4f00('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5d149e(_0x1854f3);})[_0x4f00('0x16')](function(_0x6747b3){_0x2ead22(_0x6747b3);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index f4d47d4..9be4c79 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6379=['404','status','render','json','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6379,0xc7));var _0x9637=function(_0x1d0a89,_0x11eda8){_0x1d0a89=_0x1d0a89-0x0;var _0x29a843=_0x6379[_0x1d0a89];return _0x29a843;};'use strict';module[_0x9637('0x0')][0x194]=function pageNotFound(_0xfb5d15,_0x366c3f){var _0x38eb25=_0x9637('0x1');var _0x568c7e=0x194;var _0x1d46dc={'status':_0x568c7e};_0x366c3f[_0x9637('0x2')](_0x1d46dc[_0x9637('0x2')]);_0x366c3f[_0x9637('0x3')](_0x38eb25,{},function(_0x46c912,_0x4c75b1){if(_0x46c912){return _0x366c3f[_0x9637('0x2')](_0x1d46dc[_0x9637('0x2')])[_0x9637('0x4')](_0x1d46dc);}_0x366c3f['send'](_0x4c75b1);});}; \ No newline at end of file +var _0x7d6e=['json','send','404','status'];(function(_0x26cb2e,_0x13e37a){var _0x14f042=function(_0x4cdad8){while(--_0x4cdad8){_0x26cb2e['push'](_0x26cb2e['shift']());}};_0x14f042(++_0x13e37a);}(_0x7d6e,0x76));var _0xe7d6=function(_0x45bcb1,_0x46cad0){_0x45bcb1=_0x45bcb1-0x0;var _0x4bd6a3=_0x7d6e[_0x45bcb1];return _0x4bd6a3;};'use strict';module['exports'][0x194]=function pageNotFound(_0x555ed0,_0x1c3709){var _0x498923=_0xe7d6('0x0');var _0x2ea07f=0x194;var _0x3d76ab={'status':_0x2ea07f};_0x1c3709[_0xe7d6('0x1')](_0x3d76ab['status']);_0x1c3709['render'](_0x498923,{},function(_0x4aeecd,_0x599299){if(_0x4aeecd){return _0x1c3709[_0xe7d6('0x1')](_0x3d76ab['status'])[_0xe7d6('0x2')](_0x3d76ab);}_0x1c3709[_0xe7d6('0x3')](_0x599299);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 397aaed..3443fdd 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','VoiceQueues','MailQueue','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','AgentReports','uniqueid','Contact','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','FaxAccountId','Exntensions','TagId','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','ContactId','SmsAccountId','SmsInteractionId','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','Attachments','UserChatQueue','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Agent','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Field','Variable','VariableId','SugarcrmAccount','Subject','Description','DeskField','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','ServicenowField','ToId','SessionId','ProjectId','JscriptyProject','user_has_square_projects','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefixes','Hoppers','HopperBlacks','TrunkBackupId','SquareProjectId','Lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','xC@LL1234','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model'];(function(_0x490527,_0x189a2a){var _0x52aba7=function(_0x511771){while(--_0x511771){_0x490527['push'](_0x490527['shift']());}};_0x52aba7(++_0x189a2a);}(_0x5c00,0x17e));var _0x05c0=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0x5c00[_0x27c25f];return _0x2da4c4;};'use strict';var config=require(_0x05c0('0x0'));var Sequelize=require(_0x05c0('0x1'));var _=require(_0x05c0('0x2'));var jstz=require('jstz');var timezone=jstz[_0x05c0('0x3')]();config['sequelize']=_[_0x05c0('0x4')](config[_0x05c0('0x1')],{'database':_0x05c0('0x5'),'username':_0x05c0('0x6'),'password':'xC@LL1234','options':{'host':_0x05c0('0x7'),'port':0xcea,'dialect':_0x05c0('0x8'),'dialectOptions':{'charset':_0x05c0('0x9')},'logging':![],'timezone':timezone[_0x05c0('0xa')](),'define':{'charset':'utf8','collate':_0x05c0('0xb')}}});config[_0x05c0('0xc')]=_[_0x05c0('0x4')](config['sequelizeHistory'],{'database':_0x05c0('0x5'),'username':_0x05c0('0x6'),'password':_0x05c0('0xd'),'options':{'host':_0x05c0('0x7'),'port':0xcea,'dialect':_0x05c0('0x8'),'dialectOptions':{'charset':_0x05c0('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x05c0('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x05c0('0xe')],config[_0x05c0('0x1')][_0x05c0('0xf')],config['sequelize'][_0x05c0('0x10')],config['sequelize'][_0x05c0('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x05c0('0xc')][_0x05c0('0xe')],config[_0x05c0('0xc')][_0x05c0('0xf')],config[_0x05c0('0xc')][_0x05c0('0x10')],config[_0x05c0('0xc')]['options'])};db[_0x05c0('0x12')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x14'));db[_0x05c0('0x15')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x16'));db[_0x05c0('0x17')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x18'));db[_0x05c0('0x19')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x1a'));db[_0x05c0('0x1b')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x05c0('0x1c')]=db[_0x05c0('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x1d'));db[_0x05c0('0x1e')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x1f'));db['VoiceMail']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize']['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0x05c0('0x20')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x21'));db[_0x05c0('0x22')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x05c0('0x23')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x24'));db[_0x05c0('0x25')]=db[_0x05c0('0x1')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x05c0('0x26')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x27'));db[_0x05c0('0x28')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x29'));db[_0x05c0('0x2a')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x2b'));db['UserVoiceQueueRt']=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x2c'));db[_0x05c0('0x2d')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x2e'));db['UserChatQueue']=db[_0x05c0('0x1')]['import'](_0x05c0('0x2f'));db[_0x05c0('0x30')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x31'));db[_0x05c0('0x32')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x33'));db[_0x05c0('0x34')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x35'));db[_0x05c0('0x36')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x37'));db[_0x05c0('0x38')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x39'));db[_0x05c0('0x3a')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x3b'));db[_0x05c0('0x3c')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x3d'));db[_0x05c0('0x3e')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x3f'));db['MailQueue']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x40'));db[_0x05c0('0x41')]=db['sequelize']['import'](_0x05c0('0x42'));db[_0x05c0('0x43')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x44'));db[_0x05c0('0x45')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/mailMessage/mailMessage.model');db[_0x05c0('0x46')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x47'));db[_0x05c0('0x48')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x49'));db[_0x05c0('0x4a')]=db[_0x05c0('0x1')]['import']('../api/dashboard/dashboard.model');db[_0x05c0('0x4b')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x4c'));db[_0x05c0('0x4d')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x4e'));db[_0x05c0('0x4f')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x50'));db[_0x05c0('0x51')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x52'));db[_0x05c0('0x53')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x54'));db[_0x05c0('0x55')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x56'));db[_0x05c0('0x57')]=db['sequelize']['import'](_0x05c0('0x58'));db[_0x05c0('0x59')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x5a'));db[_0x05c0('0x5b')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x5c'));db[_0x05c0('0x5d')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x5e'));db[_0x05c0('0x5f')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/smsMessage/smsMessage.model');db[_0x05c0('0x60')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x61'));db['OpenchannelAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x05c0('0x62')]=db['sequelize']['import'](_0x05c0('0x63'));db['OpenchannelInteraction']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x64'));db[_0x05c0('0x65')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x05c0('0x66')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x67'));db[_0x05c0('0x68')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x69'));db[_0x05c0('0x6a')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x05c0('0x6b')]=db[_0x05c0('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0x05c0('0x6c')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x6d'));db[_0x05c0('0x6e')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/chatMessage/chatMessage.model');db[_0x05c0('0x6f')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x70'));db['ChatQueue']=db[_0x05c0('0x1')]['import'](_0x05c0('0x71'));db[_0x05c0('0x72')]=db['sequelize'][_0x05c0('0x13')]('../api/chatGroup/chatGroup.model');db[_0x05c0('0x73')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x74'));db[_0x05c0('0x75')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x76'));db[_0x05c0('0x77')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x78'));db[_0x05c0('0x79')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x7a'));db[_0x05c0('0x7b')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x7c'));db[_0x05c0('0x7d')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x7e'));db[_0x05c0('0x7f')]=db[_0x05c0('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x80'));db['CmCustomField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x81'));db[_0x05c0('0x82')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x83'));db['Automation']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x84'));db[_0x05c0('0x85')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x05c0('0x86')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x87'));db[_0x05c0('0x88')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/condition/condition.model');db[_0x05c0('0x89')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x8a'));db[_0x05c0('0x8b')]=db['sequelize']['import'](_0x05c0('0x8c'));db[_0x05c0('0x8d')]=db['sequelize'][_0x05c0('0x13')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x8e'));db['Schedule']=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x8f'));db[_0x05c0('0x90')]=db['sequelize']['import']('../api/sound/sound.model');db['Tag']=db['sequelize'][_0x05c0('0x13')]('../api/tag/tag.model');db['Template']=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x91'));db[_0x05c0('0x92')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x93'));db['Variable']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x94'));db[_0x05c0('0x95')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x96'));db[_0x05c0('0x97')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x05c0('0x1')]['import'](_0x05c0('0x98'));db[_0x05c0('0x99')]=db['sequelize'][_0x05c0('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize']['import'](_0x05c0('0x9a'));db[_0x05c0('0x9b')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x05c0('0x9c')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x9d'));db[_0x05c0('0x9e')]=db['sequelize'][_0x05c0('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x9f'));db[_0x05c0('0xa0')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xa1'));db['SugarcrmAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xa2'));db[_0x05c0('0xa3')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x05c0('0xa4')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xa5'));db[_0x05c0('0xa6')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xa7'));db[_0x05c0('0xa8')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xa9'));db['DeskField']=db[_0x05c0('0x1')]['import'](_0x05c0('0xaa'));db[_0x05c0('0xab')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xac'));db[_0x05c0('0xad')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xae'));db[_0x05c0('0xaf')]=db['sequelize'][_0x05c0('0x13')]('../api/intZohoField/intZohoField.model');db[_0x05c0('0xb0')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xb1'));db[_0x05c0('0xb2')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xb3'));db[_0x05c0('0xb4')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xb5'));db[_0x05c0('0xb6')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xb7'));db['FreshdeskField']=db[_0x05c0('0x1')]['import'](_0x05c0('0xb8'));db['VtigerAccount']=db[_0x05c0('0x1')]['import'](_0x05c0('0xb9'));db[_0x05c0('0xba')]=db['sequelize'][_0x05c0('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xbb'));db[_0x05c0('0xbc')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xbd'));db['ServicenowConfiguration']=db['sequelize']['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xbe'));db[_0x05c0('0xbf')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xc0'));db[_0x05c0('0xc1')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xc2'));db[_0x05c0('0xc3')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x05c0('0xc4')]=db['sequelize'][_0x05c0('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x05c0('0xc5')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xc6'));db[_0x05c0('0xc7')]=db['sequelize'][_0x05c0('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x05c0('0x95')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/integration/integration.model');db['Network']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xc8'));db[_0x05c0('0xc9')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xca'));db[_0x05c0('0xcb')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xcc'));db[_0x05c0('0xcd')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x05c0('0xce')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xcf'));db['JscriptySessionReport']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xd0'));db[_0x05c0('0xd1')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xd2'));db[_0x05c0('0xd3')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xd4'));db[_0x05c0('0xd5')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xd6'));db['JscriptyProject']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x05c0('0xd7')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xd8'));db[_0x05c0('0xd9')]=db['sequelize'][_0x05c0('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x05c0('0xda')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xdb'));db[_0x05c0('0xdc')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xdd'));db['SquareMessage']=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/squareMessage/squareMessage.model');db[_0x05c0('0xde')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xdf'));db['License']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xe0'));db[_0x05c0('0xe1')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xe2'));db['Migration']=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xe3'));db[_0x05c0('0xe4')]=db[_0x05c0('0x1')][_0x05c0('0x13')]('../api/attachment/attachment.model');db[_0x05c0('0xe5')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xe6'));db[_0x05c0('0xe7')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xe8'));db[_0x05c0('0xe9')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xea'));db[_0x05c0('0xeb')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xec'));db[_0x05c0('0xed')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xee'));db[_0x05c0('0xef')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xf0'));db[_0x05c0('0xf1')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xf2'));db[_0x05c0('0xf3')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xf4'));db[_0x05c0('0xf5')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0xf6'));db[_0x05c0('0xf7')]=db[_0x05c0('0x1')]['import'](_0x05c0('0xf8'));db[_0x05c0('0xf9')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xfa'));db[_0x05c0('0xfb')]=db['sequelize']['import'](_0x05c0('0xfc'));db[_0x05c0('0xfd')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0xfe'));db[_0x05c0('0xff')]=db['sequelize']['import'](_0x05c0('0x100'));db[_0x05c0('0x101')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x102'));db[_0x05c0('0x103')]=db[_0x05c0('0x1')]['import'](_0x05c0('0x104'));db[_0x05c0('0x105')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x106'));db[_0x05c0('0x107')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x108'));db[_0x05c0('0x109')]=db['sequelize'][_0x05c0('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x05c0('0x10a')]=db['sequelize'][_0x05c0('0x13')](_0x05c0('0x10b'));db['TeamVoiceQueue']=db[_0x05c0('0x1')]['import'](_0x05c0('0x10c'));db[_0x05c0('0x10d')]=db[_0x05c0('0x1')][_0x05c0('0x13')](_0x05c0('0x10e'));db[_0x05c0('0x10f')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x05c0('0x12')][_0x05c0('0x110')](db[_0x05c0('0x111')],{'as':_0x05c0('0x111'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x115')],{'as':_0x05c0('0x116'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')]['hasMany'](db[_0x05c0('0x117')],{'as':_0x05c0('0x118'),'foreignKey':_0x05c0('0x113')});db['User'][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x119'),'onDelete':'cascade','hooks':!![]});db['User'][_0x05c0('0x114')](db[_0x05c0('0x7d')],{'as':'HopperFinals','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')]['hasMany'](db[_0x05c0('0x7f')],{'as':'HopperHistory','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':'ReportAgentPreview','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x05c0('0x113')});db['User'][_0x05c0('0x114')](db['ChatInteraction'],{'as':_0x05c0('0x11b'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x5d')],{'as':_0x05c0('0x11c'),'foreignKey':'UserId'});db['User'][_0x05c0('0x114')](db['FaxInteraction'],{'as':_0x05c0('0x11d'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x43')],{'as':_0x05c0('0x11e'),'foreignKey':'UserId'});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0x101')],{'as':_0x05c0('0x11f'),'foreignKey':'UserId'});db[_0x05c0('0x12')][_0x05c0('0x114')](db[_0x05c0('0xfb')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0x05c0('0x120')](db[_0x05c0('0xf5')],{'as':_0x05c0('0xf5'),'foreignKey':_0x05c0('0x121')});db[_0x05c0('0x12')][_0x05c0('0x122')](db['ChatGroup'],{'as':_0x05c0('0x123'),'through':_0x05c0('0x124')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x77')],{'as':_0x05c0('0x125'),'through':'cm_user_has_contacts'});db['User'][_0x05c0('0x122')](db['CmList'],{'as':'Lists','through':_0x05c0('0x126')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x127')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x43')],{'as':'MailInteractions','through':_0x05c0('0x128')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x6c')],{'as':_0x05c0('0x11b'),'through':'user_has_chat_interactions'});db['User'][_0x05c0('0x122')](db[_0x05c0('0x51')],{'as':_0x05c0('0x11d'),'through':_0x05c0('0x129')});db['User']['belongsToMany'](db[_0x05c0('0x5d')],{'as':_0x05c0('0x11c'),'through':_0x05c0('0x12a')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x12b')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x05c0('0x12')]['belongsToMany'](db[_0x05c0('0x101')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x12c'),'through':_0x05c0('0x2d'),'required':![]});db[_0x05c0('0x12')]['belongsToMany'](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x05c0('0x10f'),'required':![]});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x12d')],{'as':'MailQueues','through':_0x05c0('0x30'),'required':![]});db['User'][_0x05c0('0x122')](db[_0x05c0('0x12e')],{'as':_0x05c0('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x05c0('0x12')]['belongsToMany'](db[_0x05c0('0x55')],{'as':_0x05c0('0x130'),'through':_0x05c0('0x32'),'required':![]});db[_0x05c0('0x12')]['belongsToMany'](db[_0x05c0('0x60')],{'as':_0x05c0('0x131'),'through':_0x05c0('0x34'),'required':![]});db[_0x05c0('0x12')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0x05c0('0x132'),'through':'UserOpenchannelQueue','required':![]});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x109')],{'as':_0x05c0('0x133'),'through':_0x05c0('0x38'),'required':![]});db['User'][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'through':'cm_user_has_lists'});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x68')],{'as':_0x05c0('0x134'),'through':_0x05c0('0x135')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x4d')],{'as':'FaxAccounts','through':_0x05c0('0x136')});db['User'][_0x05c0('0x122')](db['MailAccount'],{'as':_0x05c0('0x137'),'through':_0x05c0('0x138')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x139')],{'as':_0x05c0('0x13a'),'through':'user_has_openchannel_accounts'});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0x59')],{'as':_0x05c0('0x13b'),'through':_0x05c0('0x13c')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0xfd')],{'as':_0x05c0('0x13d'),'through':_0x05c0('0x13e')});db[_0x05c0('0x12')][_0x05c0('0x122')](db[_0x05c0('0xda')],{'as':_0x05c0('0x13f'),'through':'user_has_square_projects'});db[_0x05c0('0x15')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x140'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x141')});db[_0x05c0('0x17')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'onDelete':_0x05c0('0x112')});db[_0x05c0('0x19')]['hasMany'](db[_0x05c0('0x19')],{'as':_0x05c0('0x142'),'onDelete':'cascade'});db[_0x05c0('0x1b')]['belongsToMany'](db['Sound'],{'as':_0x05c0('0x143'),'through':'moh_has_sounds'});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x117')],{'as':_0x05c0('0x144'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x79')],{'as':'Hoppers','foreignKey':_0x05c0('0x145')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':_0x05c0('0x147'),'foreignKey':'VoiceQueueId'});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':_0x05c0('0x11a'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')]['hasMany'](db[_0x05c0('0x7b')],{'as':'HopperBlacks','foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x114')](db[_0x05c0('0x148')],{'as':_0x05c0('0x149'),'foreignKey':_0x05c0('0x145')});db[_0x05c0('0x1c')][_0x05c0('0x120')](db[_0x05c0('0x28')],{'as':_0x05c0('0x28'),'foreignKey':_0x05c0('0x14a')});db[_0x05c0('0x1c')][_0x05c0('0x120')](db[_0x05c0('0x28')],{'as':_0x05c0('0x14b'),'foreignKey':'TrunkBackupId'});db[_0x05c0('0x1c')]['belongsTo'](db[_0x05c0('0x89')],{'as':_0x05c0('0x89'),'foreignKey':_0x05c0('0x14c')});db['VoiceQueue'][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x1c')][_0x05c0('0x122')](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x05c0('0x1c')][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x2d')});db['VoiceQueue'][_0x05c0('0x122')](db[_0x05c0('0xde')],{'as':_0x05c0('0x150'),'through':_0x05c0('0x151')});db[_0x05c0('0x1c')][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x152'),'through':_0x05c0('0x153')});db[_0x05c0('0x115')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x12'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x1e')][_0x05c0('0x120')](db['User'],{'as':'User','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x111')]['hasMany'](db[_0x05c0('0x154')],{'as':_0x05c0('0x155'),'onDelete':_0x05c0('0x112'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db['VoiceMailMessage'][_0x05c0('0x120')](db[_0x05c0('0x111')],{'foreignKey':_0x05c0('0x156'),'targetKey':_0x05c0('0x157')});db[_0x05c0('0x20')][_0x05c0('0x114')](db[_0x05c0('0x25')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x05c0('0x20')]['hasMany'](db[_0x05c0('0x23')],{'as':_0x05c0('0x158'),'foreignKey':_0x05c0('0x159'),'constraints':![]});db[_0x05c0('0x20')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x05c0('0x113')});db[_0x05c0('0x20')]['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db['MailServerIn'][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':'MailAccount','foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x3c')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':_0x05c0('0x3e'),'foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x3e')][_0x05c0('0x110')](db['MailServerIn'],{'as':_0x05c0('0x15c'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x3e')][_0x05c0('0x110')](db[_0x05c0('0x3c')],{'as':_0x05c0('0x15d'),'onDelete':'cascade'});db[_0x05c0('0x3e')]['hasMany'](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0x05c0('0x3e')]['hasMany'](db[_0x05c0('0x85')],{'as':_0x05c0('0x15f'),'foreignKey':_0x05c0('0x15b')});db['MailAccount'][_0x05c0('0x114')](db[_0x05c0('0x45')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x15b')});db['MailAccount'][_0x05c0('0x114')](db[_0x05c0('0x43')],{'as':_0x05c0('0x160')});db[_0x05c0('0x3e')][_0x05c0('0x114')](db['MailApplication'],{'as':_0x05c0('0x142')});db[_0x05c0('0x3e')][_0x05c0('0x120')](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x3e')][_0x05c0('0x120')](db[_0x05c0('0x163')],{'as':_0x05c0('0x163'),'foreignKey':_0x05c0('0x164')});db[_0x05c0('0x3e')][_0x05c0('0x120')](db['Pause'],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x3e')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':'user_has_mail_accounts'});db[_0x05c0('0x12d')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x30')});db['MailQueue'][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x165'),'as':_0x05c0('0x150')});db['MailInteraction'][_0x05c0('0x114')](db['MailMessage'],{'as':_0x05c0('0x155'),'onDelete':'cascade','foreignKey':_0x05c0('0x166')});db[_0x05c0('0x43')]['belongsTo'](db['MailAccount'],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x15b')});db['MailInteraction']['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db[_0x05c0('0x43')][_0x05c0('0x120')](db['User'],{'as':_0x05c0('0x168'),'foreignKey':'UserId'});db[_0x05c0('0x43')]['belongsToMany'](db[_0x05c0('0x169')],{'through':_0x05c0('0x16a'),'as':_0x05c0('0x16b')});db[_0x05c0('0x43')][_0x05c0('0x122')](db['Tag'],{'through':_0x05c0('0x16a'),'as':_0x05c0('0x16c')});db[_0x05c0('0x43')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':'user_has_mail_interactions','foreignKey':_0x05c0('0x166')});db[_0x05c0('0x45')][_0x05c0('0x114')](db[_0x05c0('0xe4')],{'as':'Attachments','onDelete':'cascade'});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':'User'});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':_0x05c0('0x15a')});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x43')],{'as':_0x05c0('0x16e'),'foreignKey':_0x05c0('0x166')});db['MailMessage'][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':'Account','foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x68')],{'as':_0x05c0('0x68'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x45')][_0x05c0('0x120')](db[_0x05c0('0x6f')],{'as':_0x05c0('0x6f'),'foreignKey':_0x05c0('0x170')});db[_0x05c0('0x46')]['belongsTo'](db[_0x05c0('0x12')],{'onDelete':'restrict'});db['MailApplication'][_0x05c0('0x120')](db[_0x05c0('0x12d')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x46')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'onDelete':'restrict'});db[_0x05c0('0x46')][_0x05c0('0x120')](db['Interval'],{'onDelete':_0x05c0('0x171'),'foreignKey':'IntervalId'});db[_0x05c0('0x46')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':'TagId'});db[_0x05c0('0x48')][_0x05c0('0x120')](db['MailAccount'],{});db[_0x05c0('0x48')]['belongsTo'](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db['MailQueueReport']['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db[_0x05c0('0x48')][_0x05c0('0x120')](db[_0x05c0('0x43')],{});db[_0x05c0('0x48')][_0x05c0('0x120')](db[_0x05c0('0x45')],{});db[_0x05c0('0x48')][_0x05c0('0x120')](db['User'],{});db[_0x05c0('0x48')][_0x05c0('0x120')](db[_0x05c0('0x12d')],{});db[_0x05c0('0x4a')][_0x05c0('0x114')](db[_0x05c0('0x4b')],{'as':'Items','onDelete':'cascade'});db['FaxAccount'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':'Dispositions','foreignKey':_0x05c0('0x172'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x4d')][_0x05c0('0x114')](db['CannedAnswer'],{'as':_0x05c0('0x15f'),'foreignKey':'FaxAccountId'});db[_0x05c0('0x4d')][_0x05c0('0x114')](db[_0x05c0('0x51')],{'as':_0x05c0('0x160')});db[_0x05c0('0x4d')]['hasMany'](db[_0x05c0('0x4f')],{'as':_0x05c0('0x142')});db['FaxAccount'][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x173'),'onDelete':_0x05c0('0x112')});db['FaxAccount'][_0x05c0('0x114')](db[_0x05c0('0x53')],{'as':_0x05c0('0x155')});db[_0x05c0('0x4d')][_0x05c0('0x120')](db[_0x05c0('0x28')],{'as':_0x05c0('0x28')});db[_0x05c0('0x4d')][_0x05c0('0x120')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x05c0('0x4d')]['belongsTo'](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x4d')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':'user_has_fax_accounts'});db[_0x05c0('0x4f')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x171')});db['FaxApplication']['belongsTo'](db['FaxQueue'],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x4f')][_0x05c0('0x120')](db[_0x05c0('0x4d')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x4f')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x174')});db[_0x05c0('0x51')][_0x05c0('0x114')](db[_0x05c0('0x53')],{'as':'Messages','onDelete':_0x05c0('0x112'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x05c0('0x120')](db[_0x05c0('0x4d')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x172')});db['FaxInteraction']['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db['FaxInteraction'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':'UserId'});db[_0x05c0('0x51')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x175'),'as':_0x05c0('0x16b')});db[_0x05c0('0x51')][_0x05c0('0x122')](db['Tag'],{'through':_0x05c0('0x175'),'as':_0x05c0('0x16c')});db[_0x05c0('0x51')][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x129'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'as':'User'});db[_0x05c0('0x53')][_0x05c0('0x120')](db[_0x05c0('0x51')],{'as':'Interaction','foreignKey':_0x05c0('0x176')});db[_0x05c0('0x53')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x15a')});db[_0x05c0('0x53')]['belongsTo'](db[_0x05c0('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x05c0('0x53')]['belongsTo'](db[_0x05c0('0x4d')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x172')});db['FaxQueue'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x32')});db[_0x05c0('0x55')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x177'),'as':_0x05c0('0x150')});db['FaxQueueReport'][_0x05c0('0x120')](db[_0x05c0('0x4d')],{});db[_0x05c0('0x57')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x57')]['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x57')][_0x05c0('0x120')](db[_0x05c0('0x51')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db[_0x05c0('0x57')][_0x05c0('0x120')](db['User'],{});db[_0x05c0('0x57')][_0x05c0('0x120')](db['FaxQueue'],{});db[_0x05c0('0x59')]['hasMany'](db[_0x05c0('0x86')],{'as':'Dispositions','foreignKey':_0x05c0('0x179'),'onDelete':'cascade'});db[_0x05c0('0x59')][_0x05c0('0x114')](db['CannedAnswer'],{'as':_0x05c0('0x15f'),'foreignKey':_0x05c0('0x179')});db['SmsAccount'][_0x05c0('0x114')](db[_0x05c0('0x5f')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x179')});db[_0x05c0('0x59')][_0x05c0('0x114')](db[_0x05c0('0x5d')],{'as':_0x05c0('0x160')});db[_0x05c0('0x59')]['hasMany'](db[_0x05c0('0x5b')],{'as':'Applications'});db[_0x05c0('0x59')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x59')][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0x05c0('0x14e')});db['SmsAccount'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x13c')});db['SmsApplication'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':'restrict'});db[_0x05c0('0x5b')][_0x05c0('0x120')](db[_0x05c0('0x60')],{'onDelete':'restrict'});db[_0x05c0('0x5b')]['belongsTo'](db[_0x05c0('0x59')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0x5b')][_0x05c0('0x120')](db[_0x05c0('0x89')],{'onDelete':'restrict','foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x5b')][_0x05c0('0x120')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0x05c0('0x114')](db[_0x05c0('0x5f')],{'as':_0x05c0('0x155'),'onDelete':_0x05c0('0x112'),'foreignKey':'SmsInteractionId'});db[_0x05c0('0x5d')]['belongsTo'](db[_0x05c0('0x59')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x179')});db[_0x05c0('0x5d')][_0x05c0('0x120')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['SmsInteraction'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x5d')][_0x05c0('0x122')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x05c0('0x5d')]['belongsToMany'](db[_0x05c0('0x169')],{'through':'sms_interaction_has_tags','as':_0x05c0('0x16c')});db[_0x05c0('0x5d')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x12a'),'foreignKey':_0x05c0('0x17a')});db[_0x05c0('0x5f')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x12')});db[_0x05c0('0x5f')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':'Contact'});db[_0x05c0('0x5f')][_0x05c0('0x120')](db[_0x05c0('0x5d')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x16e'),'foreignKey':_0x05c0('0x17a')});db[_0x05c0('0x5f')]['belongsTo'](db[_0x05c0('0x59')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x179')});db['SmsQueue'][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x34'),'foreignKey':_0x05c0('0x17b')});db[_0x05c0('0x60')]['belongsToMany'](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':_0x05c0('0x17c'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x139')][_0x05c0('0x114')](db[_0x05c0('0x85')],{'as':'Answers','foreignKey':_0x05c0('0x17c')});db[_0x05c0('0x139')][_0x05c0('0x114')](db[_0x05c0('0x12b')],{'as':_0x05c0('0x160'),'foreignKey':_0x05c0('0x17c')});db['OpenchannelAccount'][_0x05c0('0x114')](db['OpenchannelMessage'],{'as':_0x05c0('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x05c0('0x139')][_0x05c0('0x114')](db[_0x05c0('0x62')],{'as':_0x05c0('0x142'),'foreignKey':_0x05c0('0x17c')});db[_0x05c0('0x139')][_0x05c0('0x120')](db['CmList'],{'as':'List','foreignKey':_0x05c0('0x162')});db['OpenchannelAccount'][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x139')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x17d')});db['OpenchannelApplication'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x171')});db['OpenchannelApplication'][_0x05c0('0x120')](db['OpenchannelQueue'],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x17e')});db[_0x05c0('0x62')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'onDelete':'restrict','foreignKey':_0x05c0('0x17c')});db['OpenchannelApplication'][_0x05c0('0x120')](db['Interval'],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x62')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':'TagId'});db[_0x05c0('0x12b')][_0x05c0('0x114')](db[_0x05c0('0x65')],{'as':'Messages','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x17f')});db[_0x05c0('0x12b')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x17c')});db['OpenchannelInteraction']['belongsTo'](db[_0x05c0('0x77')],{'as':'Contact','foreignKey':'ContactId'});db[_0x05c0('0x12b')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db['OpenchannelInteraction'][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':'openchannel_interaction_has_tags','as':_0x05c0('0x16b')});db[_0x05c0('0x12b')]['belongsToMany'](db[_0x05c0('0x169')],{'through':_0x05c0('0x180'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Users','through':_0x05c0('0x181'),'foreignKey':'OpenchannelInteractionId'});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x12')});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':_0x05c0('0x15a')});db['OpenchannelMessage'][_0x05c0('0x120')](db[_0x05c0('0x12b')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x05c0('0x17f')});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0xe4')],{'as':_0x05c0('0xe4'),'foreignKey':_0x05c0('0x182')});db[_0x05c0('0x65')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x17c')});db[_0x05c0('0x66')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x05c0('0x66')]['belongsToMany'](db[_0x05c0('0xde')],{'through':_0x05c0('0x183'),'as':_0x05c0('0x150')});db['ChatWebsite'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':_0x05c0('0x16f'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x68')][_0x05c0('0x114')](db[_0x05c0('0x85')],{'as':_0x05c0('0x15f'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x68')][_0x05c0('0x114')](db[_0x05c0('0x73')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x05c0('0x114')](db[_0x05c0('0x6c')],{'as':'Interactions'});db[_0x05c0('0x68')][_0x05c0('0x114')](db[_0x05c0('0x6b')],{'as':_0x05c0('0x142')});db['ChatWebsite'][_0x05c0('0x114')](db['ChatMessage'],{'as':_0x05c0('0x155')});db[_0x05c0('0x68')]['belongsTo'](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x68')][_0x05c0('0x120')](db['Interval'],{'as':'Interval','foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x68')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'as':'MailAccount','foreignKey':_0x05c0('0x15b')});db[_0x05c0('0x68')]['belongsTo'](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0x68')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x135')});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x139')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db['OpenchannelQueueReport']['belongsTo'](db[_0x05c0('0x12b')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x65')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db[_0x05c0('0x12')],{});db[_0x05c0('0x6a')][_0x05c0('0x120')](db['OpenchannelQueue'],{});db[_0x05c0('0x6b')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':'Agent','foreignKey':_0x05c0('0x113'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x6b')]['belongsTo'](db['ChatQueue'],{'as':_0x05c0('0x184'),'foreignKey':_0x05c0('0x185'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x6b')]['belongsTo'](db[_0x05c0('0x68')],{'as':_0x05c0('0x186'),'foreignKey':_0x05c0('0x16f'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x6b')][_0x05c0('0x120')](db[_0x05c0('0x169')],{'onDelete':_0x05c0('0x171'),'foreignKey':'TagId'});db[_0x05c0('0x6c')][_0x05c0('0x114')](db[_0x05c0('0x6e')],{'as':_0x05c0('0x155'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x05c0('0x6c')]['belongsTo'](db[_0x05c0('0x68')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x6c')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x6c')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x6c')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':'chat_interaction_has_tags','as':_0x05c0('0x16b')});db[_0x05c0('0x6c')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x187'),'as':'ThroughTags'});db[_0x05c0('0x6c')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x188'),'foreignKey':_0x05c0('0x189')});db[_0x05c0('0x6e')][_0x05c0('0x120')](db['User'],{'onDelete':_0x05c0('0x112'),'as':'User'});db[_0x05c0('0x6e')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db['ChatMessage'][_0x05c0('0x120')](db[_0x05c0('0x6c')],{'onDelete':_0x05c0('0x112'),'as':'Interaction','foreignKey':_0x05c0('0x189')});db[_0x05c0('0x6e')]['belongsTo'](db['Attachment'],{'as':_0x05c0('0xe4'),'foreignKey':_0x05c0('0x182')});db['ChatMessage'][_0x05c0('0x120')](db[_0x05c0('0x68')],{'as':'Account','foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x6f')]['hasMany'](db[_0x05c0('0xe4')],{'as':_0x05c0('0x18a'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x05c0('0x6f')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':'cascade','as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x6f')]['belongsTo'](db['ChatWebsite'],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x12e')]['belongsToMany'](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x18b'),'hooks':!![]});db[_0x05c0('0x12e')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x18c'),'as':'Teams'});db[_0x05c0('0x72')][_0x05c0('0x114')](db[_0x05c0('0xcb')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x18d'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x72')]['belongsToMany'](db['User'],{'as':_0x05c0('0x144'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x05c0('0x120')](db[_0x05c0('0x68')],{'as':'Website','foreignKey':_0x05c0('0x16f')});db[_0x05c0('0x75')][_0x05c0('0x114')](db[_0x05c0('0x77')],{'as':_0x05c0('0x125'),'foreignKey':_0x05c0('0x18e')});db[_0x05c0('0x77')][_0x05c0('0x114')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x05c0('0x178')});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x7d')],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x178')});db['CmContact'][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':_0x05c0('0x147'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':_0x05c0('0x11a'),'foreignKey':'ContactId'});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x148')],{'as':'JscriptySessions','foreignKey':_0x05c0('0x178')});db['CmContact'][_0x05c0('0x114')](db[_0x05c0('0x12b')],{'as':'OpenchannelInteractions','foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')]['hasMany'](db[_0x05c0('0x6c')],{'as':_0x05c0('0x11b'),'foreignKey':_0x05c0('0x178'),'onDelete':'restrict'});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x5d')],{'as':'SmsInteractions','foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')]['hasMany'](db[_0x05c0('0x51')],{'as':'FaxInteractions','foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')][_0x05c0('0x114')](db[_0x05c0('0x43')],{'as':_0x05c0('0x11e'),'foreignKey':_0x05c0('0x178'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x77')][_0x05c0('0x120')](db['CmCompany'],{'as':_0x05c0('0x18f'),'foreignKey':_0x05c0('0x18e')});db[_0x05c0('0x77')][_0x05c0('0x120')](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':'ListId','onDelete':_0x05c0('0x112')});db[_0x05c0('0x77')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x190')});db[_0x05c0('0x77')]['belongsToMany'](db[_0x05c0('0x169')],{'as':_0x05c0('0x16b'),'through':_0x05c0('0x191')});db[_0x05c0('0x77')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':'cm_contact_has_tags','as':_0x05c0('0x16c')});db['CmHopper'][_0x05c0('0x120')](db['CmContact'],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178'),'onDelete':'cascade'});db[_0x05c0('0x79')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x79')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x192'),'foreignKey':_0x05c0('0x113')});db['CmHopper'][_0x05c0('0x120')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x184'),'foreignKey':_0x05c0('0x145'),'onDelete':'cascade'});db[_0x05c0('0x79')]['belongsTo'](db[_0x05c0('0xe1')],{'as':_0x05c0('0xe1'),'foreignKey':_0x05c0('0x193'),'onDelete':'cascade'});db[_0x05c0('0x79')]['belongsTo'](db['User'],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x194')});db[_0x05c0('0x7b')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId','onDelete':_0x05c0('0x112')});db[_0x05c0('0x7b')][_0x05c0('0x120')](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162'),'onDelete':_0x05c0('0x112')});db['CmHopperBlack'][_0x05c0('0x120')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x184'),'foreignKey':_0x05c0('0x145'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x7b')]['belongsTo'](db['Campaign'],{'as':_0x05c0('0xe1'),'foreignKey':_0x05c0('0x193'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x195')][_0x05c0('0x114')](db[_0x05c0('0x88')],{'as':{'plural':_0x05c0('0x196'),'singular':_0x05c0('0x197')},'foreignKey':_0x05c0('0x198'),'onDelete':'cascade','hooks':!![]});db[_0x05c0('0x195')][_0x05c0('0x114')](db[_0x05c0('0x88')],{'as':{'plural':_0x05c0('0x199'),'singular':_0x05c0('0x19a')},'foreignKey':_0x05c0('0x19b'),'onDelete':_0x05c0('0x112'),'hooks':!![]});db[_0x05c0('0x195')]['hasMany'](db[_0x05c0('0x82')],{'as':_0x05c0('0x19c'),'foreignKey':_0x05c0('0x19d'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0x05c0('0x114')](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':'ParentId','onDelete':_0x05c0('0x112')});db['Interval'][_0x05c0('0x114')](db[_0x05c0('0x89')],{'as':_0x05c0('0x19e'),'foreignKey':_0x05c0('0x14c'),'onDelete':_0x05c0('0x112'),'hooks':!![],'required':![]});db[_0x05c0('0x89')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x119'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x05c0('0x89')][_0x05c0('0x114')](db[_0x05c0('0x46')],{'as':'MailApplications','foreignKey':_0x05c0('0x14c')});db['Interval'][_0x05c0('0x114')](db['ChatApplication'],{'as':_0x05c0('0x19f'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x89')][_0x05c0('0x114')](db['FaxApplication'],{'as':_0x05c0('0x1a0'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x89')][_0x05c0('0x114')](db['SmsApplication'],{'as':_0x05c0('0x1a1'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0x1a2')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{});db[_0x05c0('0x1a2')][_0x05c0('0x120')](db[_0x05c0('0x99')],{'foreignKey':'DefaultReportId'});db[_0x05c0('0x1a2')]['belongsTo'](db[_0x05c0('0x1a3')],{'foreignKey':_0x05c0('0x1a4')});db[_0x05c0('0x90')][_0x05c0('0x122')](db[_0x05c0('0x1b')],{'as':_0x05c0('0x1a5'),'through':_0x05c0('0x1a6'),'onDelete':_0x05c0('0x171')});db[_0x05c0('0x169')][_0x05c0('0x122')](db['CmContact'],{'through':_0x05c0('0x191')});db[_0x05c0('0x169')]['belongsToMany'](db[_0x05c0('0x6c')],{'through':_0x05c0('0x187')});db[_0x05c0('0x169')][_0x05c0('0x122')](db[_0x05c0('0x43')],{'through':_0x05c0('0x16a')});db[_0x05c0('0x169')][_0x05c0('0x122')](db[_0x05c0('0x5d')],{'through':_0x05c0('0x1a7')});db['Tag'][_0x05c0('0x122')](db['FaxInteraction'],{'through':_0x05c0('0x175')});db['Tag'][_0x05c0('0x122')](db[_0x05c0('0x12b')],{'through':_0x05c0('0x180')});db[_0x05c0('0x169')]['belongsToMany'](db[_0x05c0('0x101')],{'through':_0x05c0('0x1a8')});db[_0x05c0('0x92')]['hasMany'](db[_0x05c0('0x88')],{'as':{'plural':_0x05c0('0x1a9'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x05c0('0x112'),'hooks':!![]});db['Trigger'][_0x05c0('0x114')](db[_0x05c0('0x88')],{'as':{'plural':'AnyConditions','singular':_0x05c0('0x1aa')},'foreignKey':_0x05c0('0x1ab'),'onDelete':'cascade','hooks':!![]});db[_0x05c0('0x92')][_0x05c0('0x114')](db['Action'],{'as':'Actions','foreignKey':_0x05c0('0x1ac'),'onDelete':'cascade','hooks':!![]});db[_0x05c0('0x1a3')][_0x05c0('0x114')](db['AnalyticFieldReport'],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1a4'),'hooks':!![]});db['AnalyticDefaultReport'][_0x05c0('0x114')](db[_0x05c0('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x05c0('0x114')](db[_0x05c0('0x9c')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':'MetricId'});db[_0x05c0('0x9c')][_0x05c0('0x120')](db[_0x05c0('0x9b')],{'foreignKey':_0x05c0('0x1ae')});db[_0x05c0('0x1af')][_0x05c0('0x114')](db[_0x05c0('0xa0')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xa0')][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db['SalesforceConfiguration'][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':_0x05c0('0x1b5'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xa0')][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db['SalesforceConfiguration'][_0x05c0('0x120')](db[_0x05c0('0x1af')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x05c0('0x114')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1b2')][_0x05c0('0x114')](db[_0x05c0('0x1b2')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x05c0('0x1b2')][_0x05c0('0x114')](db['SalesforceField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1b2')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':'Variable','foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0x1bb')]['hasMany'](db[_0x05c0('0xa3')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db['SugarcrmConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xa4')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db['SugarcrmConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xa4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x05c0('0x1b6')});db['SugarcrmConfiguration'][_0x05c0('0x114')](db['SugarcrmField'],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db['SugarcrmConfiguration'][_0x05c0('0x120')](db[_0x05c0('0x1bb')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xa4')][_0x05c0('0x114')](db[_0x05c0('0xa4')],{'as':_0x05c0('0x1bc'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x05c0('0x114')](db['SugarcrmField'],{'as':_0x05c0('0x1bd'),'foreignKey':'DescriptionId'});db[_0x05c0('0xa4')][_0x05c0('0x114')](db['SugarcrmField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xa4')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db[_0x05c0('0xa6')]['hasMany'](db['DeskConfiguration'],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':_0x05c0('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x05c0('0xa8')][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':'Descriptions','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xa8')][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':_0x05c0('0x167'),'foreignKey':'AccountId'});db[_0x05c0('0xa8')]['belongsToMany'](db['Tag'],{'through':_0x05c0('0x1bf')});db[_0x05c0('0x1be')]['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1be')][_0x05c0('0x114')](db[_0x05c0('0x1be')],{'as':_0x05c0('0x1bd'),'foreignKey':'DescriptionId'});db[_0x05c0('0x1be')]['hasMany'](db['DeskField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1be')]['belongsTo'](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xab')][_0x05c0('0x114')](db[_0x05c0('0xad')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xad')][_0x05c0('0x114')](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1b5'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xad')][_0x05c0('0x114')](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xad')][_0x05c0('0x120')](db['ZohoAccount'],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xaf')][_0x05c0('0x114')](db['ZohoField'],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xaf')][_0x05c0('0x114')](db[_0x05c0('0xaf')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db['ZohoField']['hasMany'](db[_0x05c0('0xaf')],{'as':'Field','foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xaf')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':'VariableId'});db[_0x05c0('0xb0')][_0x05c0('0x114')](db[_0x05c0('0xb2')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xb2')][_0x05c0('0x114')](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1b3'),'foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db[_0x05c0('0xb4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1ad'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xb2')][_0x05c0('0x120')](db[_0x05c0('0xb0')],{'as':_0x05c0('0x167'),'foreignKey':'AccountId'});db[_0x05c0('0xb2')][_0x05c0('0x122')](db['Tag'],{'through':_0x05c0('0x1c0')});db['ZendeskField'][_0x05c0('0x114')](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db['ZendeskField'][_0x05c0('0x114')](db['ZendeskField'],{'as':'Description','foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xb4')]['hasMany'](db[_0x05c0('0xb4')],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xb4')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db['FreshdeskAccount'][_0x05c0('0x114')](db['FreshdeskConfiguration'],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xb6')]['hasMany'](db[_0x05c0('0x1c1')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xb6')][_0x05c0('0x114')](db[_0x05c0('0x1c1')],{'as':'Descriptions','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xb6')][_0x05c0('0x114')](db[_0x05c0('0x1c1')],{'as':_0x05c0('0x1ad'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0xb6')][_0x05c0('0x120')](db[_0x05c0('0x1c2')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db['FreshdeskConfiguration'][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x1c3')});db[_0x05c0('0x1c1')]['hasMany'](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1c1')][_0x05c0('0x114')](db['FreshdeskField'],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0x1c1')][_0x05c0('0x114')](db[_0x05c0('0x1c1')],{'as':'Field','foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c1')][_0x05c0('0x120')](db['Variable'],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0x1c4')][_0x05c0('0x114')](db[_0x05c0('0xba')],{'as':'Configurations','onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db['VtigerConfiguration'][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':'Subjects','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xba')]['hasMany'](db['VtigerField'],{'as':_0x05c0('0x1b5'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xba')][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':_0x05c0('0x1ad'),'foreignKey':'FieldId'});db[_0x05c0('0xba')][_0x05c0('0x120')](db[_0x05c0('0x1c4')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0x1c5')][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':_0x05c0('0x1bc'),'foreignKey':'SubjectId'});db['VtigerField'][_0x05c0('0x114')](db[_0x05c0('0x1c5')],{'as':'Description','foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0x1c5')][_0x05c0('0x114')](db['VtigerField'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c5')][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xbc')]['hasMany'](db[_0x05c0('0x1c6')],{'as':'Configurations','onDelete':_0x05c0('0x112'),'foreignKey':'AccountId'});db[_0x05c0('0x1c6')][_0x05c0('0x114')](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1b3'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x05c0('0x114')](db['ServicenowField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1ad'),'foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c6')][_0x05c0('0x120')](db[_0x05c0('0xbc')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0x1c7')][_0x05c0('0x114')](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0x1c7')]['hasMany'](db[_0x05c0('0x1c7')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0x1c7')][_0x05c0('0x114')](db['ServicenowField'],{'as':'Field','foreignKey':_0x05c0('0x1b7')});db[_0x05c0('0x1c7')]['belongsTo'](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xbf')][_0x05c0('0x114')](db[_0x05c0('0xc1')],{'as':_0x05c0('0x1b0'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b1')});db['Dynamics365Configuration'][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':_0x05c0('0x1b3'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b4')});db['Dynamics365Configuration'][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':_0x05c0('0x1b5'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xc1')][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':'Fields','onDelete':_0x05c0('0x112'),'foreignKey':'FieldId'});db[_0x05c0('0xc1')]['belongsTo'](db[_0x05c0('0xbf')],{'as':'Account','foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xc3')][_0x05c0('0x114')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xc3')][_0x05c0('0x114')](db[_0x05c0('0xc3')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xc3')][_0x05c0('0x114')](db['Dynamics365Field'],{'as':_0x05c0('0x1b8'),'foreignKey':_0x05c0('0x1b7')});db['Dynamics365Field'][_0x05c0('0x120')](db[_0x05c0('0x1b9')],{'as':_0x05c0('0x1b9'),'foreignKey':'VariableId'});db[_0x05c0('0xc4')][_0x05c0('0x114')](db[_0x05c0('0xc5')],{'as':_0x05c0('0x1b0'),'onDelete':'cascade','foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xc5')][_0x05c0('0x114')](db['FreshsalesField'],{'as':_0x05c0('0x1b3'),'foreignKey':_0x05c0('0x1b4')});db['FreshsalesConfiguration'][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':'Descriptions','foreignKey':_0x05c0('0x1b6')});db[_0x05c0('0xc5')][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':_0x05c0('0x1ad'),'foreignKey':'FieldId'});db[_0x05c0('0xc5')][_0x05c0('0x120')](db[_0x05c0('0xc4')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1b1')});db[_0x05c0('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0x05c0('0x1bc'),'foreignKey':_0x05c0('0x1b4')});db[_0x05c0('0xc7')][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':_0x05c0('0x1bd'),'foreignKey':_0x05c0('0x1b6')});db['FreshsalesField'][_0x05c0('0x114')](db[_0x05c0('0xc7')],{'as':_0x05c0('0x1b8'),'foreignKey':'FieldId'});db[_0x05c0('0xc7')]['belongsTo'](db[_0x05c0('0x1b9')],{'as':'Variable','foreignKey':_0x05c0('0x1ba')});db[_0x05c0('0xc9')][_0x05c0('0x120')](db['ChatWebsite'],{});db[_0x05c0('0xc9')]['belongsTo'](db['CmList'],{'as':_0x05c0('0x161'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xc9')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':'Contact','foreignKey':_0x05c0('0x178')});db[_0x05c0('0xc9')]['belongsTo'](db[_0x05c0('0x6c')],{});db[_0x05c0('0xc9')][_0x05c0('0x120')](db[_0x05c0('0x6e')],{});db['ChatQueueReport'][_0x05c0('0x120')](db['User'],{});db[_0x05c0('0xc9')][_0x05c0('0x120')](db['ChatQueue'],{});db[_0x05c0('0xcb')]['belongsTo'](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1c8')});db[_0x05c0('0x148')][_0x05c0('0x114')](db[_0x05c0('0xce')],{'foreignKey':_0x05c0('0x1c9'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0x148')]['hasMany'](db[_0x05c0('0xcd')],{'foreignKey':_0x05c0('0x1c9'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0xd1')][_0x05c0('0x120')](db['SmsAccount'],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x161'),'foreignKey':'ListId'});db[_0x05c0('0xd1')]['belongsTo'](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':'ContactId'});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x5d')],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x5f')],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x12')],{});db[_0x05c0('0xd1')][_0x05c0('0x120')](db[_0x05c0('0x60')],{});db['JscriptyProject'][_0x05c0('0x114')](db[_0x05c0('0x148')],{'foreignKey':_0x05c0('0x1ca')});db[_0x05c0('0x1cb')][_0x05c0('0x114')](db[_0x05c0('0xce')],{'foreignKey':'ProjectId'});db[_0x05c0('0x1cb')][_0x05c0('0x114')](db['JscriptyAnswerReport'],{'foreignKey':_0x05c0('0x1ca')});db[_0x05c0('0xda')][_0x05c0('0x122')](db['User'],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x1cc')});db['Team']['belongsToMany'](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x127')});db['Team'][_0x05c0('0x122')](db['VoiceQueue'],{'through':_0x05c0('0x151'),'as':_0x05c0('0x12c')});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x12d')],{'through':_0x05c0('0x165'),'as':'MailQueues'});db[_0x05c0('0xde')][_0x05c0('0x122')](db['ChatQueue'],{'through':_0x05c0('0x18c'),'as':_0x05c0('0x12f')});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x55')],{'through':_0x05c0('0x177'),'as':'FaxQueues'});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x60')],{'through':_0x05c0('0x1cd'),'as':_0x05c0('0x131')});db[_0x05c0('0xde')][_0x05c0('0x122')](db[_0x05c0('0x66')],{'through':_0x05c0('0x183'),'as':_0x05c0('0x132')});db['Team']['belongsToMany'](db[_0x05c0('0x109')],{'through':_0x05c0('0x1ce'),'as':_0x05c0('0x133')});db[_0x05c0('0xde')]['belongsToMany'](db[_0x05c0('0xf3')],{'through':'TeamVoicePrefix','as':_0x05c0('0x1cf')});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x79')],{'as':_0x05c0('0x1d0'),'foreignKey':_0x05c0('0x193')});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x7d')],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x193')});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':_0x05c0('0x147'),'foreignKey':'CampaignId'});db[_0x05c0('0xe1')][_0x05c0('0x114')](db[_0x05c0('0x7b')],{'as':_0x05c0('0x1d1'),'foreignKey':_0x05c0('0x193')});db[_0x05c0('0xe1')]['belongsTo'](db[_0x05c0('0x28')],{'as':_0x05c0('0x28'),'foreignKey':_0x05c0('0x14a')});db['Campaign'][_0x05c0('0x120')](db['Trunk'],{'as':_0x05c0('0x14b'),'foreignKey':_0x05c0('0x1d2')});db[_0x05c0('0xe1')][_0x05c0('0x120')](db[_0x05c0('0x89')],{'as':_0x05c0('0x89'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0xe1')][_0x05c0('0x120')](db[_0x05c0('0xda')],{'as':'SquareProject','foreignKey':_0x05c0('0x1d3')});db[_0x05c0('0xe1')][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'as':_0x05c0('0x1d4'),'through':'campaigns_has_cm_lists'});db[_0x05c0('0xe1')][_0x05c0('0x122')](db[_0x05c0('0xf1')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db['Attachment'][_0x05c0('0x120')](db[_0x05c0('0x6f')],{'as':_0x05c0('0x6f'),'foreignKey':'ChatOfflineMessageId'});db[_0x05c0('0xe7')]['belongsTo'](db[_0x05c0('0x45')],{});db[_0x05c0('0xe7')][_0x05c0('0x120')](db['MailInteraction'],{});db[_0x05c0('0xe7')][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'foreignKey':_0x05c0('0x1d5'),'as':_0x05c0('0x1d6')});db['MailTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db['MailTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db[_0x05c0('0xe7')][_0x05c0('0x120')](db[_0x05c0('0x12d')],{'foreignKey':'ToMailQueueId','as':_0x05c0('0x1da')});db['MailTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x3e')],{'foreignKey':_0x05c0('0x1db'),'as':'ToAccount'});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x6e')],{});db[_0x05c0('0xe9')][_0x05c0('0x120')](db[_0x05c0('0x6c')],{});db[_0x05c0('0xe9')][_0x05c0('0x120')](db[_0x05c0('0x68')],{'foreignKey':_0x05c0('0x1dc'),'as':_0x05c0('0x1d6')});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db['ChatTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12e')],{'foreignKey':_0x05c0('0x1dd'),'as':_0x05c0('0x1da')});db[_0x05c0('0xe9')][_0x05c0('0x120')](db[_0x05c0('0x68')],{'foreignKey':_0x05c0('0x1de'),'as':_0x05c0('0x1df')});db[_0x05c0('0xeb')][_0x05c0('0x120')](db[_0x05c0('0x53')],{});db['FaxTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x51')],{});db['FaxTransferReport']['belongsTo'](db[_0x05c0('0x4d')],{'foreignKey':_0x05c0('0x1e0'),'as':_0x05c0('0x1d6')});db[_0x05c0('0xeb')]['belongsTo'](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0xeb')]['belongsTo'](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':_0x05c0('0x1e1')});db[_0x05c0('0xeb')][_0x05c0('0x120')](db[_0x05c0('0x55')],{'foreignKey':_0x05c0('0x1e2'),'as':_0x05c0('0x1da')});db[_0x05c0('0xeb')][_0x05c0('0x120')](db[_0x05c0('0x4d')],{'foreignKey':_0x05c0('0x1e3'),'as':_0x05c0('0x1df')});db['OpenchannelTransferReport'][_0x05c0('0x120')](db['OpenchannelMessage'],{});db[_0x05c0('0xed')][_0x05c0('0x120')](db[_0x05c0('0x12b')],{});db[_0x05c0('0xed')][_0x05c0('0x120')](db[_0x05c0('0x139')],{'foreignKey':_0x05c0('0x1e4'),'as':_0x05c0('0x1d6')});db['OpenchannelTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0xed')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db['OpenchannelTransferReport']['belongsTo'](db[_0x05c0('0x66')],{'foreignKey':_0x05c0('0x1e5'),'as':_0x05c0('0x1da')});db['OpenchannelTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x139')],{'foreignKey':_0x05c0('0x1e6'),'as':_0x05c0('0x1df')});db['SmsTransferReport']['belongsTo'](db[_0x05c0('0x5f')],{});db[_0x05c0('0xef')][_0x05c0('0x120')](db['SmsInteraction'],{});db[_0x05c0('0xef')][_0x05c0('0x120')](db[_0x05c0('0x59')],{'foreignKey':_0x05c0('0x1e7'),'as':_0x05c0('0x1d6')});db[_0x05c0('0xef')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0xef')]['belongsTo'](db['User'],{'foreignKey':_0x05c0('0x1d9'),'as':'ToAgent'});db[_0x05c0('0xef')][_0x05c0('0x120')](db[_0x05c0('0x60')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x05c0('0xef')][_0x05c0('0x120')](db['SmsAccount'],{'foreignKey':_0x05c0('0x1e8'),'as':_0x05c0('0x1df')});db['CmList'][_0x05c0('0x114')](db['Disposition'],{'as':_0x05c0('0x15e'),'foreignKey':_0x05c0('0x162'),'onDelete':_0x05c0('0x112')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x1e9')],{'as':_0x05c0('0x1ea'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x77')],{'as':_0x05c0('0x125'),'onDelete':'cascade','foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db['CmHopperFinal'],{'as':_0x05c0('0x146'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x7f')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x05c0('0xf1')][_0x05c0('0x114')](db[_0x05c0('0x11a')],{'as':_0x05c0('0x11a'),'foreignKey':_0x05c0('0x162')});db[_0x05c0('0xf1')][_0x05c0('0x122')](db[_0x05c0('0x1c')],{'as':_0x05c0('0x1eb'),'through':'voice_queues_has_cm_lists'});db[_0x05c0('0xf1')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':'cm_user_has_lists'});db[_0x05c0('0xf3')][_0x05c0('0x114')](db[_0x05c0('0x19')],{'as':_0x05c0('0x119'),'onDelete':'cascade'});db[_0x05c0('0xf3')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x10f')});db[_0x05c0('0xf3')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x10d'),'as':_0x05c0('0x150')});db[_0x05c0('0xf5')][_0x05c0('0x114')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'foreignKey':_0x05c0('0x121')});db[_0x05c0('0xf5')]['hasMany'](db['UserProfileSection'],{'as':_0x05c0('0x1ec'),'foreignKey':_0x05c0('0x121'),'onDelete':'cascade'});db[_0x05c0('0xf7')]['hasMany'](db['UserProfileResource'],{'as':_0x05c0('0x1ed'),'foreignKey':_0x05c0('0x1ee'),'onDelete':_0x05c0('0x112')});db['WhatsappAccount']['hasMany'](db[_0x05c0('0x86')],{'as':_0x05c0('0x15e'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x05c0('0xfd')][_0x05c0('0x114')](db[_0x05c0('0x85')],{'as':_0x05c0('0x15f'),'foreignKey':'WhatsappAccountId'});db[_0x05c0('0xfd')][_0x05c0('0x114')](db[_0x05c0('0x103')],{'as':_0x05c0('0x155'),'foreignKey':_0x05c0('0x1ef')});db[_0x05c0('0xfd')][_0x05c0('0x114')](db[_0x05c0('0x101')],{'as':_0x05c0('0x160')});db['WhatsappAccount'][_0x05c0('0x114')](db[_0x05c0('0xff')],{'as':'Applications'});db[_0x05c0('0xfd')][_0x05c0('0x120')](db['CmList'],{'as':'List','foreignKey':_0x05c0('0x162')});db[_0x05c0('0xfd')][_0x05c0('0x120')](db[_0x05c0('0x8b')],{'as':_0x05c0('0x14d'),'foreignKey':_0x05c0('0x14e')});db[_0x05c0('0xfd')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x14f'),'through':_0x05c0('0x13e')});db[_0x05c0('0xff')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0xff')][_0x05c0('0x120')](db[_0x05c0('0x109')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0xff')][_0x05c0('0x120')](db[_0x05c0('0xfd')],{'onDelete':_0x05c0('0x171')});db[_0x05c0('0xff')]['belongsTo'](db[_0x05c0('0x89')],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x14c')});db[_0x05c0('0xff')][_0x05c0('0x120')](db['Tag'],{'onDelete':_0x05c0('0x171'),'foreignKey':_0x05c0('0x174')});db['WhatsappInteraction'][_0x05c0('0x114')](db[_0x05c0('0x103')],{'as':_0x05c0('0x155'),'onDelete':_0x05c0('0x112'),'foreignKey':_0x05c0('0x1f0')});db['WhatsappInteraction'][_0x05c0('0x120')](db[_0x05c0('0xfd')],{'as':_0x05c0('0x167'),'foreignKey':_0x05c0('0x1ef')});db[_0x05c0('0x101')][_0x05c0('0x120')](db['CmContact'],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x101')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':_0x05c0('0x168'),'foreignKey':_0x05c0('0x113')});db[_0x05c0('0x101')][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x1a8'),'as':'Tags'});db['WhatsappInteraction'][_0x05c0('0x122')](db[_0x05c0('0x169')],{'through':_0x05c0('0x1a8'),'as':_0x05c0('0x16c')});db['WhatsappInteraction'][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':_0x05c0('0x16d'),'through':_0x05c0('0x1f1'),'foreignKey':'WhatsappInteractionId'});db[_0x05c0('0x103')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'as':'User'});db[_0x05c0('0x103')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'onDelete':_0x05c0('0x112'),'as':_0x05c0('0x15a')});db[_0x05c0('0x103')][_0x05c0('0x120')](db[_0x05c0('0x101')],{'onDelete':_0x05c0('0x112'),'as':'Interaction','foreignKey':_0x05c0('0x1f0')});db['WhatsappMessage'][_0x05c0('0x120')](db['WhatsappAccount'],{'as':_0x05c0('0x167'),'foreignKey':'WhatsappAccountId'});db[_0x05c0('0x105')]['belongsTo'](db[_0x05c0('0xfd')],{});db['WhatsappQueueReport'][_0x05c0('0x120')](db[_0x05c0('0xf1')],{'as':'List','foreignKey':_0x05c0('0x162')});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x77')],{'as':_0x05c0('0x15a'),'foreignKey':_0x05c0('0x178')});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x101')],{});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x109')],{});db[_0x05c0('0x105')]['belongsTo'](db['WhatsappMessage'],{});db[_0x05c0('0x105')][_0x05c0('0x120')](db[_0x05c0('0x12')],{});db[_0x05c0('0x107')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x05c0('0x101')],{});db[_0x05c0('0x107')][_0x05c0('0x120')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x05c0('0x1d6')});db['WhatsappTransferReport'][_0x05c0('0x120')](db[_0x05c0('0xfd')],{'foreignKey':'ToWhatsappAccountId','as':_0x05c0('0x1df')});db[_0x05c0('0x107')][_0x05c0('0x120')](db['WhatsappQueue'],{'foreignKey':_0x05c0('0x1f2'),'as':_0x05c0('0x1da')});db['WhatsappTransferReport'][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d7'),'as':_0x05c0('0x1d8')});db[_0x05c0('0x107')][_0x05c0('0x120')](db[_0x05c0('0x12')],{'foreignKey':_0x05c0('0x1d9'),'as':_0x05c0('0x1e1')});db[_0x05c0('0x109')][_0x05c0('0x122')](db[_0x05c0('0x12')],{'as':'Agents','through':_0x05c0('0x38'),'foreignKey':_0x05c0('0x1f3')});db[_0x05c0('0x109')][_0x05c0('0x122')](db[_0x05c0('0xde')],{'through':_0x05c0('0x1ce'),'as':'Teams'});module[_0x05c0('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xf4eb=['CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','CmHopperFinal','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','WhatsappInteractions','UserNotification','belongsTo','userProfileId','belongsToMany','ChatGroup','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','SquareProjects','SpiedAgents','ChanSpyId','VoiceExtension','VoiceMusicOnHold','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','VoiceMail','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','Applications','List','ListId','TemplateId','mandatoryDispositionPauseId','Team','team_has_mail_queues','MailInteractionId','Account','Contact','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','Tag','TagId','Items','FaxAccountId','Exntensions','FaxQueue','fax_interaction_has_tags','FaxInteractionId','AttachmentId','SmsAccountId','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelMessage','Interaction','OpenchannelQueueId','ChatProactiveAction','ProactiveActions','ChatApplication','ChatMessage','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Hoppers','Company','CompanyId','cm_contact_has_tags','Queue','CampaignId','OwnerId','OneAll','Any','AutomationAnyId','Actions','ParentId','ChatApplications','FaxApplications','DefaultReportId','Mohs','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','AnalyticDefaultReport','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','SubjectId','DescriptionId','Subject','Description','Descriptions','FieldId','Field','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','FromId','ToId','user_has_square_projects','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProjectId','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','Extensions','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','database','options','username','User','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue'];(function(_0x3db83a,_0x1fc6e7){var _0x1f774d=function(_0x3d8e22){while(--_0x3d8e22){_0x3db83a['push'](_0x3db83a['shift']());}};_0x1f774d(++_0x1fc6e7);}(_0xf4eb,0xec));var _0xbf4e=function(_0x13a495,_0x30389b){_0x13a495=_0x13a495-0x0;var _0x527c05=_0xf4eb[_0x13a495];return _0x527c05;};'use strict';var config=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config[_0xbf4e('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xbf4e('0x2'),'username':_0xbf4e('0x3'),'password':_0xbf4e('0x4'),'options':{'host':_0xbf4e('0x5'),'port':0xcea,'dialect':_0xbf4e('0x6'),'dialectOptions':{'charset':_0xbf4e('0x7')},'logging':![],'timezone':timezone[_0xbf4e('0x8')](),'define':{'charset':'utf8','collate':_0xbf4e('0x9')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xbf4e('0xa')],{'database':_0xbf4e('0x2'),'username':_0xbf4e('0x3'),'password':_0xbf4e('0x4'),'options':{'host':_0xbf4e('0x5'),'port':0xcea,'dialect':_0xbf4e('0x6'),'dialectOptions':{'charset':_0xbf4e('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xbf4e('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xbf4e('0xb')],config[_0xbf4e('0x1')]['username'],config[_0xbf4e('0x1')]['password'],config['sequelize'][_0xbf4e('0xc')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbf4e('0xa')][_0xbf4e('0xb')],config[_0xbf4e('0xa')][_0xbf4e('0xd')],config[_0xbf4e('0xa')]['password'],config['sequelizeHistory'][_0xbf4e('0xc')])};db[_0xbf4e('0xe')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xf'));db[_0xbf4e('0x10')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xbf4e('0x12')]=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x13'));db['VoiceMusicOnHold']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x14'));db[_0xbf4e('0x15')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x16'));db[_0xbf4e('0x17')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x18'));db[_0xbf4e('0x19')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x1a'));db['VoiceMail']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x1b'));db[_0xbf4e('0x1c')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x1d'));db[_0xbf4e('0x1e')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x1f'));db['VoiceDialReport']=db['sequelize'][_0xbf4e('0x11')]('../api/voiceDialReport/voiceDialReport.model');db[_0xbf4e('0x20')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x21'));db['VoiceQueueReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x22'));db['MemberReport']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x23'));db[_0xbf4e('0x24')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x25'));db[_0xbf4e('0x26')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x27'));db[_0xbf4e('0x28')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x29'));db['UserVoiceQueue']=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xbf4e('0x2a')]=db['sequelize'][_0xbf4e('0x11')]('../api/userChatQueue/userChatQueue.model');db[_0xbf4e('0x2b')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/userMailQueue/userMailQueue.model');db[_0xbf4e('0x2c')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x2d'));db[_0xbf4e('0x2e')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x2f'));db[_0xbf4e('0x30')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x31'));db['UserWhatsappQueue']=db['sequelize']['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xbf4e('0x32')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x33'));db[_0xbf4e('0x34')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x35'));db[_0xbf4e('0x36')]=db['sequelize']['import'](_0xbf4e('0x37'));db[_0xbf4e('0x38')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x39'));db['MailSubstatus']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x3a'));db[_0xbf4e('0x3b')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x3c'));db[_0xbf4e('0x3d')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x3e'));db[_0xbf4e('0x3f')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x40'));db[_0xbf4e('0x41')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x42'));db[_0xbf4e('0x43')]=db['sequelize']['import'](_0xbf4e('0x44'));db[_0xbf4e('0x45')]=db['sequelize']['import'](_0xbf4e('0x46'));db[_0xbf4e('0x47')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x48'));db[_0xbf4e('0x49')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x4a'));db['FaxInteraction']=db['sequelize']['import']('../api/faxInteraction/faxInteraction.model');db[_0xbf4e('0x4b')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x4c'));db['FaxQueue']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x4d'));db[_0xbf4e('0x4e')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/faxQueueReport/faxQueueReport.model');db[_0xbf4e('0x4f')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x50'));db[_0xbf4e('0x51')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x52'));db['SmsInteraction']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x53'));db[_0xbf4e('0x54')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x55'));db[_0xbf4e('0x56')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x57'));db[_0xbf4e('0x58')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x59'));db[_0xbf4e('0x5a')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x5b'));db[_0xbf4e('0x5c')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x5d'));db['OpenchannelMessage']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x5e'));db['OpenchannelQueue']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x5f'));db[_0xbf4e('0x60')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x61'));db[_0xbf4e('0x62')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x63'));db['ChatApplication']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x64'));db[_0xbf4e('0x65')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x66'));db['ChatMessage']=db['sequelize'][_0xbf4e('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x67'));db[_0xbf4e('0x68')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x69'));db['ChatGroup']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x6a'));db['ChatProactiveAction']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x6b'));db[_0xbf4e('0x6c')]=db[_0xbf4e('0x1')]['import']('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x6d'));db['CmHopper']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x6e'));db[_0xbf4e('0x6f')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x70'));db['CmHopperFinal']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x71'));db['CmHopperHistory']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x72'));db[_0xbf4e('0x73')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x74'));db[_0xbf4e('0x75')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x76'));db[_0xbf4e('0x77')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x78'));db[_0xbf4e('0x79')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x7a'));db['CannedAnswer']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x7b'));db[_0xbf4e('0x7c')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x7d'));db[_0xbf4e('0x7e')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x7f'));db[_0xbf4e('0x80')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/interval/interval.model');db[_0xbf4e('0x81')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x82'));db[_0xbf4e('0x83')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x84'));db['VoiceQueuesLog']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x85'));db[_0xbf4e('0x86')]=db['sequelize'][_0xbf4e('0x11')]('../api/schedule/schedule.model');db['Sound']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x87'));db['Tag']=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/tag/tag.model');db[_0xbf4e('0x88')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x89'));db[_0xbf4e('0x8a')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x8b'));db[_0xbf4e('0x8c')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x8d'));db[_0xbf4e('0x8e')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x8f'));db[_0xbf4e('0x90')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x91'));db[_0xbf4e('0x92')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x93'));db['AnalyticDefaultReport']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x94'));db[_0xbf4e('0x95')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x96'));db['AnalyticMetric']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x97'));db['AnalyticFieldReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x98'));db['AnalyticTreeReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x99'));db[_0xbf4e('0x9a')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x9b'));db['SalesforceConfiguration']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x9c'));db['SalesforceField']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x9d'));db[_0xbf4e('0x9e')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x9f'));db[_0xbf4e('0xa0')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xa1'));db[_0xbf4e('0xa2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xa3'));db[_0xbf4e('0xa4')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xa5'));db['DeskConfiguration']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xa6'));db[_0xbf4e('0xa7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xa8'));db[_0xbf4e('0xa9')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xaa'));db[_0xbf4e('0xab')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xac'));db[_0xbf4e('0xad')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xae'));db[_0xbf4e('0xaf')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xb0'));db[_0xbf4e('0xb1')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xb2'));db['ZendeskField']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xb3'));db[_0xbf4e('0xb4')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xb5'));db[_0xbf4e('0xb6')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xb7'));db[_0xbf4e('0xb8')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xb9'));db[_0xbf4e('0xba')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xbb'));db[_0xbf4e('0xbc')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xbd'));db[_0xbf4e('0xbe')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xbf'));db[_0xbf4e('0xc0')]=db['sequelize']['import'](_0xbf4e('0xc1'));db[_0xbf4e('0xc2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xc3'));db[_0xbf4e('0xc4')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xc5'));db[_0xbf4e('0xc6')]=db[_0xbf4e('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xbf4e('0xc7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xbf4e('0xc8')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xbf4e('0xc9')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xca'));db[_0xbf4e('0xcb')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xcc'));db[_0xbf4e('0xcd')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xbf4e('0x8e')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x8f'));db[_0xbf4e('0xce')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xcf'));db[_0xbf4e('0xd0')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xd1'));db[_0xbf4e('0xd2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xd3'));db[_0xbf4e('0xd4')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xbf4e('0xd5')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xd6'));db[_0xbf4e('0xd7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xd8'));db[_0xbf4e('0xd9')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/smsQueueReport/smsQueueReport.model');db[_0xbf4e('0xda')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xdb'));db[_0xbf4e('0xdc')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xdd'));db[_0xbf4e('0xde')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xdf'));db[_0xbf4e('0xe0')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/setting/setting.model');db['SquareOdbc']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xe1'));db[_0xbf4e('0xe2')]=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xe3'));db['SquareRecording']=db[_0xbf4e('0x1')][_0xbf4e('0x11')]('../api/squareRecording/squareRecording.model');db[_0xbf4e('0xe4')]=db['sequelize'][_0xbf4e('0x11')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0xe5'));db['License']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xe6'));db[_0xbf4e('0xe7')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xe8'));db[_0xbf4e('0xe9')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xea'));db['Attachment']=db['sequelize']['import'](_0xbf4e('0xeb'));db[_0xbf4e('0xec')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xed'));db[_0xbf4e('0xee')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xef'));db[_0xbf4e('0xf0')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xf1'));db[_0xbf4e('0xf2')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xf3'));db[_0xbf4e('0xf4')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xf5'));db[_0xbf4e('0xf6')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xf7'));db['CmList']=db['sequelize'][_0xbf4e('0x11')]('../api/cmList/cmList.model');db[_0xbf4e('0xf8')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xf9'));db[_0xbf4e('0xfa')]=db['sequelize']['import'](_0xbf4e('0xfb'));db[_0xbf4e('0xfc')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xfd'));db['UserProfileResource']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0xfe'));db['UserNotification']=db[_0xbf4e('0x1')]['import'](_0xbf4e('0xff'));db['WhatsappAccount']=db['sequelize'][_0xbf4e('0x11')](_0xbf4e('0x100'));db[_0xbf4e('0x101')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x102'));db[_0xbf4e('0x103')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x104'));db[_0xbf4e('0x105')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x106'));db['WhatsappQueueReport']=db['sequelize']['import'](_0xbf4e('0x107'));db['WhatsappTransferReport']=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x108'));db[_0xbf4e('0x109')]=db['sequelize']['import']('../api/whatsappQueue/whatsappQueue.model');db[_0xbf4e('0x10a')]=db[_0xbf4e('0x1')]['import'](_0xbf4e('0x10b'));db[_0xbf4e('0x10c')]=db[_0xbf4e('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xbf4e('0x10d')]=db[_0xbf4e('0x1')][_0xbf4e('0x11')](_0xbf4e('0x10e'));db[_0xbf4e('0x10f')]=db['sequelize']['import'](_0xbf4e('0x110'));db[_0xbf4e('0xe')][_0xbf4e('0x111')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')]['hasMany'](db[_0xbf4e('0x17')],{'as':_0xbf4e('0x114'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x28')],{'as':_0xbf4e('0x116'),'foreignKey':'UserId'});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')]['hasMany'](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x11a'),'foreignKey':'UserId'});db['User'][_0xbf4e('0x115')](db['ReportAgentPreview'],{'as':_0xbf4e('0x73'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x5c')],{'as':_0xbf4e('0x11b'),'foreignKey':_0xbf4e('0x113')});db['User']['hasMany'](db['ChatInteraction'],{'as':_0xbf4e('0x11c'),'foreignKey':'UserId'});db[_0xbf4e('0xe')]['hasMany'](db['SmsInteraction'],{'as':_0xbf4e('0x11d'),'foreignKey':'UserId'});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x11e')],{'as':_0xbf4e('0x11f'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0xe')][_0xbf4e('0x115')](db[_0xbf4e('0x103')],{'as':_0xbf4e('0x120'),'foreignKey':_0xbf4e('0x113')});db['User']['hasMany'](db[_0xbf4e('0x121')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xbf4e('0xe')][_0xbf4e('0x122')](db[_0xbf4e('0xfa')],{'as':_0xbf4e('0xfa'),'foreignKey':_0xbf4e('0x123')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x125')],{'as':'Groups','through':_0xbf4e('0x126')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x128'),'through':_0xbf4e('0x129')});db[_0xbf4e('0xe')]['belongsToMany'](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x12b'),'through':_0xbf4e('0x12c')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db['Team'],{'through':_0xbf4e('0x12d')});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x3b')],{'as':_0xbf4e('0x12e'),'through':'user_has_mail_interactions'});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x65')],{'as':_0xbf4e('0x11c'),'through':_0xbf4e('0x12f')});db['User'][_0xbf4e('0x124')](db['FaxInteraction'],{'as':_0xbf4e('0x11f'),'through':_0xbf4e('0x130')});db[_0xbf4e('0xe')]['belongsToMany'](db[_0xbf4e('0x131')],{'as':_0xbf4e('0x11d'),'through':_0xbf4e('0x132')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db['OpenchannelInteraction'],{'as':_0xbf4e('0x11b'),'through':'user_has_openchannel_interactions'});db['User'][_0xbf4e('0x124')](db['WhatsappInteraction'],{'as':_0xbf4e('0x120'),'through':_0xbf4e('0x133')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x134'),'through':_0xbf4e('0x135'),'required':![]});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0xf8')],{'as':_0xbf4e('0x136'),'through':_0xbf4e('0x10f'),'required':![]});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x38')],{'as':_0xbf4e('0x137'),'through':_0xbf4e('0x2b'),'required':![]});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x68')],{'as':_0xbf4e('0x138'),'through':_0xbf4e('0x2a'),'required':![],'hooks':!![]});db[_0xbf4e('0xe')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db['User']['belongsToMany'](db[_0xbf4e('0x56')],{'as':_0xbf4e('0x139'),'through':_0xbf4e('0x2e'),'required':![]});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x13a')],{'as':_0xbf4e('0x13b'),'through':_0xbf4e('0x30'),'required':![]});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x109')],{'as':_0xbf4e('0x13c'),'through':_0xbf4e('0x13d'),'required':![]});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'through':'cm_user_has_lists'});db['User'][_0xbf4e('0x124')](db['ChatWebsite'],{'as':_0xbf4e('0x13e'),'through':'user_has_chat_websites'});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x47')],{'as':'FaxAccounts','through':_0xbf4e('0x13f')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x36')],{'as':'MailAccounts','through':_0xbf4e('0x140')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x58')],{'as':_0xbf4e('0x141'),'through':_0xbf4e('0x142')});db['User'][_0xbf4e('0x124')](db[_0xbf4e('0x4f')],{'as':_0xbf4e('0x143'),'through':_0xbf4e('0x144')});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db[_0xbf4e('0x145')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xbf4e('0xe')][_0xbf4e('0x124')](db['SquareProject'],{'as':_0xbf4e('0x146'),'through':'user_has_square_projects'});db[_0xbf4e('0x10')]['hasMany'](db['VoiceExtension'],{'as':_0xbf4e('0x147'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x148')});db[_0xbf4e('0x12')][_0xbf4e('0x115')](db['VoiceExtension'],{'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x149')][_0xbf4e('0x115')](db[_0xbf4e('0x149')],{'as':'Applications','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x14a')][_0xbf4e('0x124')](db[_0xbf4e('0x14b')],{'as':_0xbf4e('0x14c'),'through':_0xbf4e('0x14d')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db[_0xbf4e('0x28')],{'as':_0xbf4e('0x14e'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')]['hasMany'](db[_0xbf4e('0x150')],{'as':'Hoppers','foreignKey':_0xbf4e('0x14f')});db['VoiceQueue']['hasMany'](db[_0xbf4e('0x117')],{'as':'HopperFinals','foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')]['hasMany'](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x151'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db[_0xbf4e('0x73')],{'as':'ReportAgentPreview','foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db[_0xbf4e('0x6f')],{'as':_0xbf4e('0x152'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x115')](db['JscriptySessionReport'],{'as':_0xbf4e('0x153'),'foreignKey':_0xbf4e('0x14f')});db[_0xbf4e('0x15')][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x24'),'foreignKey':_0xbf4e('0x154')});db['VoiceQueue']['belongsTo'](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x155'),'foreignKey':_0xbf4e('0x156')});db['VoiceQueue'][_0xbf4e('0x122')](db[_0xbf4e('0x80')],{'as':'Interval','foreignKey':_0xbf4e('0x157')});db['VoiceQueue'][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'as':'Lists','through':_0xbf4e('0x159')});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x135')});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db['Team'],{'as':_0xbf4e('0x15b'),'through':_0xbf4e('0x10c')});db[_0xbf4e('0x15')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'as':'BlackLists','through':_0xbf4e('0x15c')});db[_0xbf4e('0x17')]['belongsTo'](db['User'],{'as':_0xbf4e('0xe'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x19')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0xe'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x15d')][_0xbf4e('0x115')](db[_0xbf4e('0x1c')],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x15f'),'sourceKey':_0xbf4e('0x160')});db[_0xbf4e('0x1c')]['belongsTo'](db[_0xbf4e('0x15d')],{'foreignKey':_0xbf4e('0x15f'),'targetKey':'mailbox'});db[_0xbf4e('0x1e')][_0xbf4e('0x115')](db[_0xbf4e('0x161')],{'as':'QueueCalls','foreignKey':_0xbf4e('0x162'),'constraints':![]});db[_0xbf4e('0x1e')][_0xbf4e('0x115')](db[_0xbf4e('0x20')],{'as':_0xbf4e('0x163'),'foreignKey':_0xbf4e('0x162'),'constraints':![]});db[_0xbf4e('0x1e')]['belongsTo'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0xe'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x1e')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0xbf4e('0x32')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'as':_0xbf4e('0x36'),'foreignKey':_0xbf4e('0x164')});db[_0xbf4e('0x34')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'as':'MailAccount','foreignKey':_0xbf4e('0x164')});db['MailAccount'][_0xbf4e('0x111')](db['MailServerIn'],{'as':_0xbf4e('0x165'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x36')][_0xbf4e('0x111')](db[_0xbf4e('0x34')],{'as':_0xbf4e('0x166'),'onDelete':'cascade'});db[_0xbf4e('0x36')]['hasMany'](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x164'),'onDelete':'cascade'});db[_0xbf4e('0x36')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':_0xbf4e('0x169'),'foreignKey':_0xbf4e('0x164')});db['MailAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x3d')],{'as':_0xbf4e('0x15e'),'foreignKey':'MailAccountId'});db[_0xbf4e('0x36')][_0xbf4e('0x115')](db[_0xbf4e('0x3b')],{'as':_0xbf4e('0x16a')});db[_0xbf4e('0x36')][_0xbf4e('0x115')](db[_0xbf4e('0x3f')],{'as':_0xbf4e('0x16b')});db[_0xbf4e('0x36')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x36')][_0xbf4e('0x122')](db[_0xbf4e('0x88')],{'as':_0xbf4e('0x88'),'foreignKey':_0xbf4e('0x16e')});db[_0xbf4e('0x36')]['belongsTo'](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x36')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':'user_has_mail_accounts'});db['MailQueue'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x2b')});db[_0xbf4e('0x38')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':_0xbf4e('0x171'),'as':_0xbf4e('0x15b')});db[_0xbf4e('0x3b')]['hasMany'](db[_0xbf4e('0x3d')],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x172')});db[_0xbf4e('0x3b')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'as':_0xbf4e('0x173'),'foreignKey':'MailAccountId'});db[_0xbf4e('0x3b')]['belongsTo'](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x3b')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x3b')][_0xbf4e('0x124')](db['Tag'],{'through':_0xbf4e('0x177'),'as':_0xbf4e('0x178')});db[_0xbf4e('0x3b')][_0xbf4e('0x124')](db['Tag'],{'through':_0xbf4e('0x177'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x3b')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x17b'),'foreignKey':_0xbf4e('0x172')});db[_0xbf4e('0x3d')]['hasMany'](db[_0xbf4e('0x17c')],{'as':_0xbf4e('0x17d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db['User'],{'as':_0xbf4e('0xe')});db[_0xbf4e('0x3d')]['belongsTo'](db['CmContact'],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x174')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xbf4e('0x172')});db['MailMessage'][_0xbf4e('0x122')](db['MailAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x164')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':'ChatWebsite','foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x3d')][_0xbf4e('0x122')](db['ChatOfflineMessage'],{'as':_0xbf4e('0x17f'),'foreignKey':_0xbf4e('0x180')});db[_0xbf4e('0x3f')]['belongsTo'](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x3f')][_0xbf4e('0x122')](db[_0xbf4e('0x38')],{'onDelete':_0xbf4e('0x181')});db['MailApplication'][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x3f')][_0xbf4e('0x122')](db['Interval'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x157')});db['MailApplication']['belongsTo'](db[_0xbf4e('0x182')],{'onDelete':'restrict','foreignKey':_0xbf4e('0x183')});db[_0xbf4e('0x41')]['belongsTo'](db[_0xbf4e('0x36')],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db['MailQueueReport'][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db['MailQueueReport'][_0xbf4e('0x122')](db['MailInteraction'],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db[_0xbf4e('0x3d')],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x41')][_0xbf4e('0x122')](db['MailQueue'],{});db[_0xbf4e('0x43')][_0xbf4e('0x115')](db[_0xbf4e('0x45')],{'as':_0xbf4e('0x184'),'onDelete':'cascade'});db['FaxAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x185'),'onDelete':'cascade'});db['FaxAccount'][_0xbf4e('0x115')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xbf4e('0x185')});db[_0xbf4e('0x47')][_0xbf4e('0x115')](db[_0xbf4e('0x11e')],{'as':'Interactions'});db['FaxAccount'][_0xbf4e('0x115')](db['FaxApplication'],{'as':'Applications'});db[_0xbf4e('0x47')][_0xbf4e('0x115')](db[_0xbf4e('0x149')],{'as':_0xbf4e('0x186'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x47')][_0xbf4e('0x115')](db[_0xbf4e('0x4b')],{'as':'Messages'});db[_0xbf4e('0x47')][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x24')});db['FaxAccount'][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':'ListId'});db[_0xbf4e('0x47')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x47')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Agents','through':_0xbf4e('0x13f')});db[_0xbf4e('0x49')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x181')});db['FaxApplication'][_0xbf4e('0x122')](db[_0xbf4e('0x187')],{'onDelete':'restrict'});db[_0xbf4e('0x49')][_0xbf4e('0x122')](db[_0xbf4e('0x47')],{'onDelete':_0xbf4e('0x181')});db['FaxApplication'][_0xbf4e('0x122')](db['Tag'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x183')});db[_0xbf4e('0x11e')]['hasMany'](db['FaxMessage'],{'as':_0xbf4e('0x15e'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xbf4e('0x122')](db[_0xbf4e('0x47')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x185')});db['FaxInteraction'][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':'Contact','foreignKey':_0xbf4e('0x175')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0xbf4e('0x176'),'foreignKey':'UserId'});db['FaxInteraction'][_0xbf4e('0x124')](db['Tag'],{'through':_0xbf4e('0x188'),'as':_0xbf4e('0x178')});db[_0xbf4e('0x11e')]['belongsToMany'](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x188'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x11e')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0xbf4e('0x189')});db['FaxMessage'][_0xbf4e('0x122')](db['User'],{'onDelete':'cascade','as':_0xbf4e('0xe')});db['FaxMessage'][_0xbf4e('0x122')](db['FaxInteraction'],{'as':'Interaction','foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'onDelete':'cascade','as':_0xbf4e('0x174')});db[_0xbf4e('0x4b')][_0xbf4e('0x122')](db['Attachment'],{'as':_0xbf4e('0x17c'),'foreignKey':_0xbf4e('0x18a')});db[_0xbf4e('0x4b')]['belongsTo'](db[_0xbf4e('0x47')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x185')});db['FaxQueue'][_0xbf4e('0x124')](db['User'],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x2c')});db[_0xbf4e('0x187')][_0xbf4e('0x124')](db['Team'],{'through':'team_has_fax_queues','as':_0xbf4e('0x15b')});db[_0xbf4e('0x4e')]['belongsTo'](db[_0xbf4e('0x47')],{});db[_0xbf4e('0x4e')]['belongsTo'](db[_0xbf4e('0x12a')],{'as':'List','foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0x11e')],{});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0x4b')],{});db[_0xbf4e('0x4e')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x4e')]['belongsTo'](db['FaxQueue'],{});db[_0xbf4e('0x4f')][_0xbf4e('0x115')](db['Disposition'],{'as':_0xbf4e('0x167'),'foreignKey':'SmsAccountId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x4f')]['hasMany'](db['CannedAnswer'],{'as':_0xbf4e('0x169'),'foreignKey':_0xbf4e('0x18b')});db[_0xbf4e('0x4f')]['hasMany'](db[_0xbf4e('0x54')],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x18b')});db['SmsAccount'][_0xbf4e('0x115')](db['SmsInteraction'],{'as':_0xbf4e('0x16a')});db[_0xbf4e('0x4f')]['hasMany'](db[_0xbf4e('0x51')],{'as':_0xbf4e('0x16b')});db[_0xbf4e('0x4f')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':'List','foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x4f')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbf4e('0x4f')][_0xbf4e('0x124')](db['User'],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x144')});db[_0xbf4e('0x51')][_0xbf4e('0x122')](db['User'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x51')][_0xbf4e('0x122')](db['SmsQueue'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x51')][_0xbf4e('0x122')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0xbf4e('0x122')](db[_0xbf4e('0x80')],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x157')});db['SmsApplication'][_0xbf4e('0x122')](db['Tag'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x183')});db['SmsInteraction'][_0xbf4e('0x115')](db[_0xbf4e('0x54')],{'as':_0xbf4e('0x15e'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x18c')});db[_0xbf4e('0x131')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x18b')});db['SmsInteraction']['belongsTo'](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x131')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x113')});db['SmsInteraction'][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':'sms_interaction_has_tags','as':_0xbf4e('0x178')});db[_0xbf4e('0x131')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':'sms_interaction_has_tags','as':_0xbf4e('0x179')});db[_0xbf4e('0x131')][_0xbf4e('0x124')](db['User'],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x132'),'foreignKey':_0xbf4e('0x18c')});db[_0xbf4e('0x54')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0xe')});db[_0xbf4e('0x54')][_0xbf4e('0x122')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0xbf4e('0x122')](db[_0xbf4e('0x131')],{'onDelete':_0xbf4e('0x112'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xbf4e('0x54')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'as':_0xbf4e('0x173'),'foreignKey':'SmsAccountId'});db[_0xbf4e('0x56')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Agents','through':_0xbf4e('0x2e'),'foreignKey':_0xbf4e('0x18d')});db[_0xbf4e('0x56')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':'team_has_sms_queues','as':_0xbf4e('0x15b')});db[_0xbf4e('0x58')][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x58')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':_0xbf4e('0x169'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x5c')],{'as':_0xbf4e('0x16a'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x58')][_0xbf4e('0x115')](db['OpenchannelMessage'],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x18e')});db['OpenchannelAccount']['hasMany'](db['OpenchannelApplication'],{'as':_0xbf4e('0x16b'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x58')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':'List','foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x58')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xbf4e('0x16f')});db['OpenchannelAccount'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x142')});db[_0xbf4e('0x5a')]['belongsTo'](db['User'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x5a')][_0xbf4e('0x122')](db[_0xbf4e('0x13a')],{'onDelete':_0xbf4e('0x181'),'foreignKey':'OpenchannelQueueId'});db[_0xbf4e('0x5a')][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x5a')][_0xbf4e('0x122')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x5a')]['belongsTo'](db[_0xbf4e('0x182')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xbf4e('0x5c')][_0xbf4e('0x115')](db['OpenchannelMessage'],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x18f')});db[_0xbf4e('0x5c')][_0xbf4e('0x122')](db['OpenchannelAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x18e')});db[_0xbf4e('0x5c')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':'ContactId'});db[_0xbf4e('0x5c')]['belongsTo'](db[_0xbf4e('0xe')],{'as':'Owner','foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x5c')][_0xbf4e('0x124')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0xbf4e('0x5c')]['belongsToMany'](db['Tag'],{'through':_0xbf4e('0x190'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x5c')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Users','through':_0xbf4e('0x191'),'foreignKey':_0xbf4e('0x18f')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0xe')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x174')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db['OpenchannelInteraction'],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x193'),'foreignKey':'OpenchannelInteractionId'});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0x17c')],{'as':_0xbf4e('0x17c'),'foreignKey':_0xbf4e('0x18a')});db[_0xbf4e('0x192')][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x30'),'foreignKey':_0xbf4e('0x194')});db[_0xbf4e('0x13a')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':'team_has_openchannel_queues','as':_0xbf4e('0x15b')});db['ChatWebsite'][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':'Dispositions','foreignKey':_0xbf4e('0x17e'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x60')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0xbf4e('0x60')][_0xbf4e('0x115')](db[_0xbf4e('0x195')],{'as':_0xbf4e('0x196')});db[_0xbf4e('0x60')]['hasMany'](db['ChatInteraction'],{'as':_0xbf4e('0x16a')});db[_0xbf4e('0x60')][_0xbf4e('0x115')](db[_0xbf4e('0x197')],{'as':_0xbf4e('0x16b')});db['ChatWebsite'][_0xbf4e('0x115')](db[_0xbf4e('0x198')],{'as':_0xbf4e('0x15e')});db['ChatWebsite'][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x60')][_0xbf4e('0x122')](db[_0xbf4e('0x80')],{'as':'Interval','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x60')][_0xbf4e('0x122')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xbf4e('0x164')});db[_0xbf4e('0x60')][_0xbf4e('0x122')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x60')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':'user_has_chat_websites'});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db['CmContact'],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x62')]['belongsTo'](db[_0xbf4e('0x5c')],{});db[_0xbf4e('0x62')]['belongsTo'](db[_0xbf4e('0x192')],{});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x62')][_0xbf4e('0x122')](db['OpenchannelQueue'],{});db[_0xbf4e('0x197')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x199'),'foreignKey':_0xbf4e('0x113'),'onDelete':'restrict'});db[_0xbf4e('0x197')][_0xbf4e('0x122')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xbf4e('0x19a'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x197')][_0xbf4e('0x122')](db['ChatWebsite'],{'as':_0xbf4e('0x19b'),'foreignKey':_0xbf4e('0x17e'),'onDelete':_0xbf4e('0x181')});db['ChatApplication']['belongsTo'](db[_0xbf4e('0x182')],{'onDelete':'restrict','foreignKey':_0xbf4e('0x183')});db[_0xbf4e('0x65')][_0xbf4e('0x115')](db[_0xbf4e('0x198')],{'as':_0xbf4e('0x15e'),'onDelete':'cascade','foreignKey':_0xbf4e('0x19c')});db[_0xbf4e('0x65')][_0xbf4e('0x122')](db['ChatWebsite'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x65')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x65')]['belongsTo'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x65')]['belongsToMany'](db[_0xbf4e('0x182')],{'through':'chat_interaction_has_tags','as':_0xbf4e('0x178')});db[_0xbf4e('0x65')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x19d'),'as':'ThroughTags'});db[_0xbf4e('0x65')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x12f'),'foreignKey':'ChatInteractionId'});db[_0xbf4e('0x198')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':'cascade','as':_0xbf4e('0xe')});db['ChatMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x198')][_0xbf4e('0x122')](db['ChatInteraction'],{'onDelete':_0xbf4e('0x112'),'as':_0xbf4e('0x193'),'foreignKey':'ChatInteractionId'});db[_0xbf4e('0x198')]['belongsTo'](db[_0xbf4e('0x17c')],{'as':_0xbf4e('0x17c'),'foreignKey':_0xbf4e('0x18a')});db[_0xbf4e('0x198')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':'Account','foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x17f')][_0xbf4e('0x115')](db['Attachment'],{'as':_0xbf4e('0x17d'),'foreignKey':_0xbf4e('0x180'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x17f')]['belongsTo'](db[_0xbf4e('0x127')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x17f')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x68')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Agents','through':_0xbf4e('0x2a'),'hooks':!![]});db[_0xbf4e('0x68')][_0xbf4e('0x124')](db[_0xbf4e('0x170')],{'through':_0xbf4e('0x19e'),'as':'Teams'});db[_0xbf4e('0x125')]['hasMany'](db[_0xbf4e('0xd2')],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x19f'),'onDelete':'cascade'});db['ChatGroup'][_0xbf4e('0x124')](db['User'],{'as':'Members','through':_0xbf4e('0x126')});db['ChatProactiveAction'][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'as':_0xbf4e('0x19b'),'foreignKey':_0xbf4e('0x17e')});db[_0xbf4e('0x6c')][_0xbf4e('0x115')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x128'),'foreignKey':'CompanyId'});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x150')],{'as':_0xbf4e('0x1a0'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x127')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x127')][_0xbf4e('0x115')](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x151'),'foreignKey':_0xbf4e('0x175')});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x73')],{'as':_0xbf4e('0x73'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x127')]['hasMany'](db[_0xbf4e('0xd7')],{'as':_0xbf4e('0x153'),'foreignKey':'ContactId'});db[_0xbf4e('0x127')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xbf4e('0x11b'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x65')],{'as':'ChatInteractions','foreignKey':_0xbf4e('0x175'),'onDelete':'restrict'});db[_0xbf4e('0x127')][_0xbf4e('0x115')](db[_0xbf4e('0x131')],{'as':_0xbf4e('0x11d'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db['CmContact'][_0xbf4e('0x115')](db[_0xbf4e('0x11e')],{'as':_0xbf4e('0x11f'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x127')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x181')});db['CmContact'][_0xbf4e('0x122')](db['CmCompany'],{'as':_0xbf4e('0x1a1'),'foreignKey':_0xbf4e('0x1a2')});db[_0xbf4e('0x127')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x127')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x129')});db[_0xbf4e('0x127')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'as':_0xbf4e('0x178'),'through':'cm_contact_has_tags'});db[_0xbf4e('0x127')][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1a3'),'as':'ThroughTags'});db['CmHopper']['belongsTo'](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':'ContactId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x150')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':'ListId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x150')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x199'),'foreignKey':_0xbf4e('0x113')});db[_0xbf4e('0x150')][_0xbf4e('0x122')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x1a4'),'foreignKey':'VoiceQueueId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x150')]['belongsTo'](db[_0xbf4e('0xe7')],{'as':_0xbf4e('0xe7'),'foreignKey':_0xbf4e('0x1a5'),'onDelete':_0xbf4e('0x112')});db['CmHopper'][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x176'),'foreignKey':_0xbf4e('0x1a6')});db[_0xbf4e('0x6f')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175'),'onDelete':_0xbf4e('0x112')});db['CmHopperBlack'][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x6f')][_0xbf4e('0x122')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x1a4'),'foreignKey':_0xbf4e('0x14f'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x6f')][_0xbf4e('0x122')](db[_0xbf4e('0xe7')],{'as':_0xbf4e('0xe7'),'foreignKey':_0xbf4e('0x1a5'),'onDelete':_0xbf4e('0x112')});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':'All','singular':_0xbf4e('0x1a7')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xbf4e('0x79')]['hasMany'](db[_0xbf4e('0x7e')],{'as':{'plural':_0xbf4e('0x1a8'),'singular':'OneAny'},'foreignKey':_0xbf4e('0x1a9'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x79')][_0xbf4e('0x115')](db[_0xbf4e('0x77')],{'as':_0xbf4e('0x1aa'),'foreignKey':'AutomationId','onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x7c')][_0xbf4e('0x115')](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x1ab'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db['Interval'],{'as':'Intervals','foreignKey':_0xbf4e('0x157'),'onDelete':_0xbf4e('0x112'),'hooks':!![],'required':![]});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db[_0xbf4e('0x149')],{'as':'Extensions','foreignKey':_0xbf4e('0x157'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db['ChatApplication'],{'as':_0xbf4e('0x1ac'),'foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x80')]['hasMany'](db[_0xbf4e('0x49')],{'as':_0xbf4e('0x1ad'),'foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x80')][_0xbf4e('0x115')](db[_0xbf4e('0x51')],{'as':'SmsApplications','foreignKey':_0xbf4e('0x157')});db['Schedule'][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{});db['Schedule'][_0xbf4e('0x122')](db['AnalyticDefaultReport'],{'foreignKey':_0xbf4e('0x1ae')});db['Schedule'][_0xbf4e('0x122')](db[_0xbf4e('0x92')],{'foreignKey':'CustomReportId'});db['Sound'][_0xbf4e('0x124')](db[_0xbf4e('0x14a')],{'as':_0xbf4e('0x1af'),'through':_0xbf4e('0x14d'),'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db[_0xbf4e('0x127')],{'through':_0xbf4e('0x1a3')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db['ChatInteraction'],{'through':_0xbf4e('0x19d')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db[_0xbf4e('0x131')],{'through':_0xbf4e('0x1b0')});db[_0xbf4e('0x182')][_0xbf4e('0x124')](db[_0xbf4e('0x11e')],{'through':_0xbf4e('0x188')});db['Tag'][_0xbf4e('0x124')](db['OpenchannelInteraction'],{'through':_0xbf4e('0x190')});db['Tag'][_0xbf4e('0x124')](db[_0xbf4e('0x103')],{'through':_0xbf4e('0x1b1')});db[_0xbf4e('0x8a')][_0xbf4e('0x115')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xbf4e('0x1b2')},'foreignKey':'TriggerAllId','onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x8a')][_0xbf4e('0x115')](db[_0xbf4e('0x7e')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xbf4e('0x1b3'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xbf4e('0x77')],{'as':'Actions','foreignKey':_0xbf4e('0x1b4'),'onDelete':_0xbf4e('0x112'),'hooks':!![]});db[_0xbf4e('0x92')][_0xbf4e('0x115')](db[_0xbf4e('0x1b5')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xbf4e('0x1b7')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1ae')});db[_0xbf4e('0x1b8')][_0xbf4e('0x115')](db[_0xbf4e('0x1b5')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xbf4e('0x1b9')});db[_0xbf4e('0x1b5')]['belongsTo'](db[_0xbf4e('0x1b8')],{'foreignKey':_0xbf4e('0x1b9')});db[_0xbf4e('0x9a')][_0xbf4e('0x115')](db[_0xbf4e('0x1ba')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0x1ba')][_0xbf4e('0x115')](db[_0xbf4e('0x1bd')],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0x1ba')][_0xbf4e('0x115')](db[_0xbf4e('0x1bd')],{'as':'Descriptions','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0x1ba')][_0xbf4e('0x115')](db[_0xbf4e('0x1bd')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xbf4e('0x122')](db[_0xbf4e('0x9a')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0xbf4e('0x115')](db['SalesforceField'],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db['SalesforceField'][_0xbf4e('0x115')](db['SalesforceField'],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0x1bd')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':'FieldId'});db[_0xbf4e('0x1bd')][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':'Variable','foreignKey':'VariableId'});db[_0xbf4e('0x9e')][_0xbf4e('0x115')](db['SugarcrmConfiguration'],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xa0')][_0xbf4e('0x115')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xa0')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c3'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xa0')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1b6'),'onDelete':'cascade','foreignKey':_0xbf4e('0x1c4')});db['SugarcrmConfiguration'][_0xbf4e('0x122')](db['SugarcrmAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xa2')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xa2')]['hasMany'](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c2'),'foreignKey':'DescriptionId'});db[_0xbf4e('0xa2')][_0xbf4e('0x115')](db[_0xbf4e('0xa2')],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db[_0xbf4e('0xa2')]['belongsTo'](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xa4')][_0xbf4e('0x115')](db[_0xbf4e('0x1c7')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':'AccountId'});db[_0xbf4e('0x1c7')][_0xbf4e('0x115')](db['DeskField'],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0x1c7')]['hasMany'](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1c3'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xbf4e('0x1c7')][_0xbf4e('0x115')](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0x1c7')][_0xbf4e('0x122')](db[_0xbf4e('0xa4')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db['DeskConfiguration']['belongsToMany'](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1c8')});db[_0xbf4e('0xa7')][_0xbf4e('0x115')](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xa7')]['hasMany'](db[_0xbf4e('0xa7')],{'as':_0xbf4e('0x1c2'),'foreignKey':'DescriptionId'});db[_0xbf4e('0xa7')][_0xbf4e('0x115')](db[_0xbf4e('0xa7')],{'as':'Field','foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xa7')]['belongsTo'](db[_0xbf4e('0x8c')],{'as':'Variable','foreignKey':_0xbf4e('0x1c6')});db['ZohoAccount'][_0xbf4e('0x115')](db['ZohoConfiguration'],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xab')][_0xbf4e('0x115')](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xab')][_0xbf4e('0x115')](db['ZohoField'],{'as':_0xbf4e('0x1c3'),'onDelete':'cascade','foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xab')]['hasMany'](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0xbf4e('0x122')](db['ZohoAccount'],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xad')][_0xbf4e('0x115')](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db['ZohoField']['hasMany'](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xad')][_0xbf4e('0x115')](db[_0xbf4e('0xad')],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db['ZohoField'][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xaf')][_0xbf4e('0x115')](db[_0xbf4e('0xb1')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xb1')][_0xbf4e('0x115')](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1be'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xb1')][_0xbf4e('0x115')](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1c3'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xb1')][_0xbf4e('0x115')](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xb1')]['belongsTo'](db[_0xbf4e('0xaf')],{'as':'Account','foreignKey':_0xbf4e('0x1bc')});db['ZendeskConfiguration'][_0xbf4e('0x124')](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1ca')});db[_0xbf4e('0x1c9')]['hasMany'](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1c1'),'foreignKey':'SubjectId'});db[_0xbf4e('0x1c9')]['hasMany'](db[_0xbf4e('0x1c9')],{'as':'Description','foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0x1c9')]['hasMany'](db[_0xbf4e('0x1c9')],{'as':_0xbf4e('0x1c5'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0x1c9')][_0xbf4e('0x122')](db['Variable'],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xb4')]['hasMany'](db[_0xbf4e('0xb6')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db['FreshdeskConfiguration'][_0xbf4e('0x115')](db['FreshdeskField'],{'as':_0xbf4e('0x1be'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xb6')]['hasMany'](db[_0xbf4e('0xb8')],{'as':'Descriptions','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db['FreshdeskConfiguration'][_0xbf4e('0x115')](db[_0xbf4e('0xb8')],{'as':'Fields','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xb6')]['belongsTo'](db[_0xbf4e('0xb4')],{'as':_0xbf4e('0x173'),'foreignKey':'AccountId'});db[_0xbf4e('0xb6')]['belongsToMany'](db[_0xbf4e('0x182')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xbf4e('0x115')](db[_0xbf4e('0xb8')],{'as':'Subject','foreignKey':_0xbf4e('0x1bf')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xb8')][_0xbf4e('0x115')](db[_0xbf4e('0xb8')],{'as':_0xbf4e('0x1c5'),'foreignKey':_0xbf4e('0x1c4')});db['FreshdeskField'][_0xbf4e('0x122')](db['Variable'],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xba')][_0xbf4e('0x115')](db[_0xbf4e('0xbc')],{'as':'Configurations','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xbc')][_0xbf4e('0x115')](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1be'),'foreignKey':'SubjectId'});db[_0xbf4e('0xbc')]['hasMany'](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1c3'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xbc')]['hasMany'](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xbc')]['belongsTo'](db[_0xbf4e('0xba')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db['VtigerField']['hasMany'](db[_0xbf4e('0xbe')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xbe')][_0xbf4e('0x115')](db['VtigerField'],{'as':_0xbf4e('0x1c2'),'foreignKey':'DescriptionId'});db[_0xbf4e('0xbe')][_0xbf4e('0x115')](db[_0xbf4e('0xbe')],{'as':'Field','foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xbe')][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xc0')][_0xbf4e('0x115')](db[_0xbf4e('0xc2')],{'as':_0xbf4e('0x1bb'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xc2')]['hasMany'](db['ServicenowField'],{'as':_0xbf4e('0x1be'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xc2')]['hasMany'](db[_0xbf4e('0xc4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xbf4e('0x115')](db[_0xbf4e('0xc4')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xc2')][_0xbf4e('0x122')](db[_0xbf4e('0xc0')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0xbf4e('0x115')](db['ServicenowField'],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xc4')][_0xbf4e('0x115')](db[_0xbf4e('0xc4')],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db['ServicenowField']['hasMany'](db[_0xbf4e('0xc4')],{'as':'Field','foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xc4')][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xc6')][_0xbf4e('0x115')](db['Dynamics365Configuration'],{'as':_0xbf4e('0x1bb'),'onDelete':'cascade','foreignKey':_0xbf4e('0x1bc')});db[_0xbf4e('0xc7')][_0xbf4e('0x115')](db[_0xbf4e('0xc8')],{'as':'Subjects','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bf')});db['Dynamics365Configuration'][_0xbf4e('0x115')](db[_0xbf4e('0xc8')],{'as':'Descriptions','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xc7')]['hasMany'](db[_0xbf4e('0xc8')],{'as':_0xbf4e('0x1b6'),'onDelete':_0xbf4e('0x112'),'foreignKey':'FieldId'});db[_0xbf4e('0xc7')][_0xbf4e('0x122')](db[_0xbf4e('0xc6')],{'as':_0xbf4e('0x173'),'foreignKey':'AccountId'});db[_0xbf4e('0xc8')]['hasMany'](db[_0xbf4e('0xc8')],{'as':_0xbf4e('0x1c1'),'foreignKey':_0xbf4e('0x1bf')});db['Dynamics365Field']['hasMany'](db[_0xbf4e('0xc8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xbf4e('0xc8')][_0xbf4e('0x115')](db['Dynamics365Field'],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xbf4e('0x122')](db[_0xbf4e('0x8c')],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xc9')][_0xbf4e('0x115')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1bc')});db['FreshsalesConfiguration'][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':'Subjects','foreignKey':_0xbf4e('0x1bf')});db[_0xbf4e('0xcb')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1c3'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xcb')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1b6'),'foreignKey':_0xbf4e('0x1c4')});db[_0xbf4e('0xcb')]['belongsTo'](db[_0xbf4e('0xc9')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1bc')});db['FreshsalesField'][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbf4e('0xcd')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1c2'),'foreignKey':_0xbf4e('0x1c0')});db[_0xbf4e('0xcd')][_0xbf4e('0x115')](db[_0xbf4e('0xcd')],{'as':_0xbf4e('0x1c5'),'foreignKey':'FieldId'});db[_0xbf4e('0xcd')]['belongsTo'](db['Variable'],{'as':_0xbf4e('0x8c'),'foreignKey':_0xbf4e('0x1c6')});db[_0xbf4e('0xd0')]['belongsTo'](db['ChatWebsite'],{});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db['ChatQueueReport'][_0xbf4e('0x122')](db['ChatInteraction'],{});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db[_0xbf4e('0x198')],{});db[_0xbf4e('0xd0')]['belongsTo'](db[_0xbf4e('0xe')],{});db[_0xbf4e('0xd0')][_0xbf4e('0x122')](db['ChatQueue'],{});db['ChatInternalMessage']['belongsTo'](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1cb')});db[_0xbf4e('0xd2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1cc')});db[_0xbf4e('0xd7')][_0xbf4e('0x115')](db[_0xbf4e('0xd5')],{'foreignKey':'SessionId','onDelete':_0xbf4e('0x112')});db[_0xbf4e('0xd7')][_0xbf4e('0x115')](db[_0xbf4e('0xd4')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xbf4e('0xd9')]['belongsTo'](db['SmsAccount'],{});db[_0xbf4e('0xd9')]['belongsTo'](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0xd9')]['belongsTo'](db[_0xbf4e('0x131')],{});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0x54')],{});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{});db[_0xbf4e('0xd9')][_0xbf4e('0x122')](db[_0xbf4e('0x56')],{});db[_0xbf4e('0xde')][_0xbf4e('0x115')](db[_0xbf4e('0xd7')],{'foreignKey':'ProjectId'});db[_0xbf4e('0xde')][_0xbf4e('0x115')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xbf4e('0xde')][_0xbf4e('0x115')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':'Users','through':_0xbf4e('0x1cd')});db[_0xbf4e('0x170')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x12d')});db[_0xbf4e('0x170')]['belongsToMany'](db['VoiceQueue'],{'through':_0xbf4e('0x10c'),'as':_0xbf4e('0x134')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x38')],{'through':_0xbf4e('0x171'),'as':'MailQueues'});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x68')],{'through':_0xbf4e('0x19e'),'as':_0xbf4e('0x138')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x187')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xbf4e('0x170')]['belongsToMany'](db[_0xbf4e('0x56')],{'through':_0xbf4e('0x1ce'),'as':_0xbf4e('0x139')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x13a')],{'through':_0xbf4e('0x1cf'),'as':_0xbf4e('0x13b')});db[_0xbf4e('0x170')][_0xbf4e('0x124')](db[_0xbf4e('0x109')],{'through':_0xbf4e('0x1d0'),'as':_0xbf4e('0x13c')});db[_0xbf4e('0x170')]['belongsToMany'](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xbf4e('0x136')});db[_0xbf4e('0xe7')][_0xbf4e('0x115')](db['CmHopper'],{'as':_0xbf4e('0x1a0'),'foreignKey':_0xbf4e('0x1a5')});db[_0xbf4e('0xe7')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':_0xbf4e('0x1a5')});db['Campaign'][_0xbf4e('0x115')](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x151'),'foreignKey':'CampaignId'});db[_0xbf4e('0xe7')][_0xbf4e('0x115')](db[_0xbf4e('0x6f')],{'as':_0xbf4e('0x152'),'foreignKey':_0xbf4e('0x1a5')});db['Campaign'][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':'Trunk','foreignKey':_0xbf4e('0x154')});db[_0xbf4e('0xe7')][_0xbf4e('0x122')](db[_0xbf4e('0x24')],{'as':_0xbf4e('0x155'),'foreignKey':'TrunkBackupId'});db[_0xbf4e('0xe7')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0xe7')][_0xbf4e('0x122')](db[_0xbf4e('0xe2')],{'as':_0xbf4e('0xe2'),'foreignKey':_0xbf4e('0x1d1')});db[_0xbf4e('0xe7')][_0xbf4e('0x124')](db[_0xbf4e('0x12a')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xbf4e('0xe7')]['belongsToMany'](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x1d2'),'through':_0xbf4e('0x1d3')});db[_0xbf4e('0x17c')][_0xbf4e('0x122')](db[_0xbf4e('0x17f')],{'as':_0xbf4e('0x17f'),'foreignKey':_0xbf4e('0x180')});db['MailTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x3d')],{});db[_0xbf4e('0xee')]['belongsTo'](db[_0xbf4e('0x3b')],{});db[_0xbf4e('0xee')][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'foreignKey':_0xbf4e('0x1d4'),'as':_0xbf4e('0x1d5')});db['MailTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':_0xbf4e('0x1d7')});db[_0xbf4e('0xee')]['belongsTo'](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db[_0xbf4e('0xee')][_0xbf4e('0x122')](db[_0xbf4e('0x38')],{'foreignKey':_0xbf4e('0x1da'),'as':'ToQueue'});db['MailTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x36')],{'foreignKey':_0xbf4e('0x1db'),'as':'ToAccount'});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x198')],{});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x65')],{});db[_0xbf4e('0xf0')]['belongsTo'](db[_0xbf4e('0x60')],{'foreignKey':_0xbf4e('0x1dc'),'as':'FromAccount'});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':_0xbf4e('0x1d7')});db['ChatTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':'ToAgent'});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x68')],{'foreignKey':_0xbf4e('0x1dd'),'as':_0xbf4e('0x1de')});db[_0xbf4e('0xf0')][_0xbf4e('0x122')](db[_0xbf4e('0x60')],{'foreignKey':_0xbf4e('0x1df'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0x4b')],{});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0x11e')],{});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0x47')],{'foreignKey':_0xbf4e('0x1e1'),'as':'FromAccount'});db[_0xbf4e('0xf2')]['belongsTo'](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':_0xbf4e('0x1d7')});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db[_0xbf4e('0xf2')]['belongsTo'](db[_0xbf4e('0x187')],{'foreignKey':_0xbf4e('0x1e2'),'as':_0xbf4e('0x1de')});db[_0xbf4e('0xf2')][_0xbf4e('0x122')](db['FaxAccount'],{'foreignKey':_0xbf4e('0x1e3'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db['OpenchannelMessage'],{});db[_0xbf4e('0xf4')]['belongsTo'](db[_0xbf4e('0x5c')],{});db['OpenchannelTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x58')],{'foreignKey':_0xbf4e('0x1e4'),'as':'FromAccount'});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db['User'],{'foreignKey':_0xbf4e('0x1d6'),'as':'FromAgent'});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db['OpenchannelTransferReport'][_0xbf4e('0x122')](db[_0xbf4e('0x13a')],{'foreignKey':'ToOpenchannelQueueId','as':_0xbf4e('0x1de')});db[_0xbf4e('0xf4')][_0xbf4e('0x122')](db['OpenchannelAccount'],{'foreignKey':_0xbf4e('0x1e5'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0xf6')]['belongsTo'](db[_0xbf4e('0x54')],{});db[_0xbf4e('0xf6')]['belongsTo'](db[_0xbf4e('0x131')],{});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'foreignKey':_0xbf4e('0x1e6'),'as':'FromAccount'});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':'FromAgent'});db['SmsTransferReport'][_0xbf4e('0x122')](db['User'],{'foreignKey':_0xbf4e('0x1d8'),'as':_0xbf4e('0x1d9')});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0x56')],{'foreignKey':'ToSmsQueueId','as':_0xbf4e('0x1de')});db[_0xbf4e('0xf6')][_0xbf4e('0x122')](db[_0xbf4e('0x4f')],{'foreignKey':_0xbf4e('0x1e7'),'as':'ToAccount'});db[_0xbf4e('0x12a')]['hasMany'](db[_0xbf4e('0x7c')],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x16d'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db['CmCustomField'],{'as':_0xbf4e('0x1e8'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x127')],{'as':_0xbf4e('0x128'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x117')],{'as':_0xbf4e('0x118'),'foreignKey':'ListId'});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x119')],{'as':_0xbf4e('0x11a'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x12a')][_0xbf4e('0x115')](db[_0xbf4e('0x73')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xbf4e('0x12a')][_0xbf4e('0x124')](db[_0xbf4e('0x15')],{'as':_0xbf4e('0x1e9'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x12c')});db[_0xbf4e('0xf8')][_0xbf4e('0x115')](db['VoiceExtension'],{'as':_0xbf4e('0x1ea'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0xf8')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x10f')});db['VoicePrefix']['belongsToMany'](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db['UserProfile'][_0xbf4e('0x115')](db['User'],{'as':'Users','foreignKey':_0xbf4e('0x123')});db[_0xbf4e('0xfa')][_0xbf4e('0x115')](db[_0xbf4e('0xfc')],{'as':_0xbf4e('0x1eb'),'foreignKey':_0xbf4e('0x123'),'onDelete':'cascade'});db[_0xbf4e('0xfc')][_0xbf4e('0x115')](db[_0xbf4e('0x1ec')],{'as':_0xbf4e('0x1ed'),'foreignKey':_0xbf4e('0x1ee'),'onDelete':_0xbf4e('0x112')});db[_0xbf4e('0x145')]['hasMany'](db['Disposition'],{'as':_0xbf4e('0x167'),'foreignKey':_0xbf4e('0x1ef'),'onDelete':'cascade'});db[_0xbf4e('0x145')][_0xbf4e('0x115')](db[_0xbf4e('0x168')],{'as':_0xbf4e('0x169'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x145')]['hasMany'](db[_0xbf4e('0x105')],{'as':_0xbf4e('0x15e'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x145')][_0xbf4e('0x115')](db[_0xbf4e('0x103')],{'as':_0xbf4e('0x16a')});db['WhatsappAccount'][_0xbf4e('0x115')](db[_0xbf4e('0x101')],{'as':_0xbf4e('0x16b')});db[_0xbf4e('0x145')][_0xbf4e('0x122')](db[_0xbf4e('0x12a')],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x145')][_0xbf4e('0x122')](db[_0xbf4e('0x81')],{'as':_0xbf4e('0x158'),'foreignKey':_0xbf4e('0x16f')});db[_0xbf4e('0x145')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0xbf4e('0x101')][_0xbf4e('0x122')](db['User'],{'onDelete':'restrict'});db[_0xbf4e('0x101')][_0xbf4e('0x122')](db[_0xbf4e('0x109')],{'onDelete':_0xbf4e('0x181')});db['WhatsappApplication'][_0xbf4e('0x122')](db['WhatsappAccount'],{'onDelete':_0xbf4e('0x181')});db[_0xbf4e('0x101')]['belongsTo'](db['Interval'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x157')});db[_0xbf4e('0x101')][_0xbf4e('0x122')](db['Tag'],{'onDelete':_0xbf4e('0x181'),'foreignKey':_0xbf4e('0x183')});db['WhatsappInteraction'][_0xbf4e('0x115')](db['WhatsappMessage'],{'as':_0xbf4e('0x15e'),'onDelete':_0xbf4e('0x112'),'foreignKey':_0xbf4e('0x1f0')});db[_0xbf4e('0x103')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x103')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'as':'Contact','foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x103')][_0xbf4e('0x122')](db['User'],{'as':_0xbf4e('0x176'),'foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0xbf4e('0x182')],{'through':_0xbf4e('0x1b1'),'as':_0xbf4e('0x178')});db[_0xbf4e('0x103')]['belongsToMany'](db['Tag'],{'through':_0xbf4e('0x1b1'),'as':_0xbf4e('0x179')});db[_0xbf4e('0x103')][_0xbf4e('0x124')](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x17a'),'through':_0xbf4e('0x133'),'foreignKey':_0xbf4e('0x1f0')});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db['User'],{'as':_0xbf4e('0xe')});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db[_0xbf4e('0x127')],{'onDelete':_0xbf4e('0x112'),'as':'Contact'});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db[_0xbf4e('0x103')],{'onDelete':'cascade','as':_0xbf4e('0x193'),'foreignKey':'WhatsappInteractionId'});db[_0xbf4e('0x105')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{'as':_0xbf4e('0x173'),'foreignKey':_0xbf4e('0x1ef')});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db['CmList'],{'as':_0xbf4e('0x16c'),'foreignKey':_0xbf4e('0x16d')});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db['CmContact'],{'as':_0xbf4e('0x174'),'foreignKey':_0xbf4e('0x175')});db[_0xbf4e('0x1f1')][_0xbf4e('0x122')](db[_0xbf4e('0x103')],{});db['WhatsappQueueReport'][_0xbf4e('0x122')](db[_0xbf4e('0x109')],{});db[_0xbf4e('0x1f1')]['belongsTo'](db[_0xbf4e('0x105')],{});db[_0xbf4e('0x1f1')]['belongsTo'](db[_0xbf4e('0xe')],{});db[_0xbf4e('0x1f2')]['belongsTo'](db[_0xbf4e('0x105')],{});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db['WhatsappInteraction'],{});db[_0xbf4e('0x1f2')]['belongsTo'](db[_0xbf4e('0x145')],{'foreignKey':'FromWhatsappAccountId','as':_0xbf4e('0x1d5')});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0x145')],{'foreignKey':_0xbf4e('0x1f3'),'as':_0xbf4e('0x1e0')});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0x109')],{'foreignKey':_0xbf4e('0x1f4'),'as':_0xbf4e('0x1de')});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':_0xbf4e('0x1d6'),'as':'FromAgent'});db[_0xbf4e('0x1f2')][_0xbf4e('0x122')](db[_0xbf4e('0xe')],{'foreignKey':'ToUserId','as':_0xbf4e('0x1d9')});db[_0xbf4e('0x109')]['belongsToMany'](db[_0xbf4e('0xe')],{'as':_0xbf4e('0x15a'),'through':_0xbf4e('0x13d'),'foreignKey':_0xbf4e('0x1f5')});db['WhatsappQueue']['belongsToMany'](db['Team'],{'through':'team_has_whatsapp_queues','as':_0xbf4e('0x15b')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index e721f8d..dc17195 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8079=['./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','password','firstName','lastName','street','phone','mobile','email','clientId','securityToken','accessKey','token','channelSecret','accessToken','accessTokenSecret','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','express','express-winston','util','./config/logger','api','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','method','headers','x-forwarded-for','remoteAddress','url','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','connection','statusCode','name','other','agent_id','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxApplication','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations'];(function(_0x328e00,_0x61ef39){var _0x5d6bec=function(_0x524666){while(--_0x524666){_0x328e00['push'](_0x328e00['shift']());}};_0x5d6bec(++_0x61ef39);}(_0x8079,0x1d1));var _0x9807=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x8079[_0x296754];return _0x1d9f1d;};'use strict';var _=require(_0x9807('0x0'));var path=require('path');var express=require(_0x9807('0x1'));var ewinston=require(_0x9807('0x2'));var util=require(_0x9807('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x9807('0x4'))(_0x9807('0x5'));var authLogger=require(_0x9807('0x4'))('auth');exports[_0x9807('0x6')]=function(_0x4f02bd){_0x4f02bd[_0x9807('0x7')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x483173,_0x399b17){var _0x295db4=_0x9807('0x8');if(!_['isEmpty'](_0x483173['body'])){_0x295db4+=_0x9807('0x9');var _0x368f32=_0x483173[_0x9807('0xa')];maskSensitiveData(_0x368f32);}return util['format'](_0x295db4,_0x483173[_0x9807('0xb')],_0x483173[_0x9807('0xc')][_0x9807('0xd')]?_0x483173['headers'][_0x9807('0xd')]:_0x483173['connection'][_0x9807('0xe')]||_0x483173['ip'],_0x483173[_0x9807('0xf')],_0x399b17['statusCode'],_0x399b17[_0x9807('0x10')],_0x483173['user']?_0x483173['user']['id']:null,_0x483173[_0x9807('0x11')]?_0x483173['user']['name']:null,_0x483173[_0x9807('0x11')]?_0x483173[_0x9807('0x11')][_0x9807('0x12')]:null,_0x368f32?util['inspect'](_0x368f32,![],null):'');}}));_0x4f02bd['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x145288,_0x2e4d7a){var _0x898100=_0x9807('0x13');if(_0x145288[_0x9807('0xa')]&&_0x145288['body']['device']&&_0x145288[_0x9807('0xa')]['agent_id']){_0x898100=_0x9807('0x14');}return util[_0x9807('0x15')](_0x898100,_0x145288['method'],_0x145288['headers'][_0x9807('0xd')]?_0x145288[_0x9807('0xc')]['x-forwarded-for']:_0x145288[_0x9807('0x16')]['remoteAddress']||_0x145288['ip'],_0x145288[_0x9807('0xf')],_0x2e4d7a[_0x9807('0x17')],_0x2e4d7a[_0x9807('0x10')],_0x145288[_0x9807('0x11')]?_0x145288[_0x9807('0x11')]['id']:null,_0x145288[_0x9807('0x11')]?_0x145288['user'][_0x9807('0x18')]:null,_0x145288[_0x9807('0x11')]?_0x145288['user'][_0x9807('0x12')]:null,_0x145288[_0x9807('0xa')]&&_0x145288[_0x9807('0xa')]['device']?_0x145288[_0x9807('0xa')]['device']:_0x9807('0x19'),_0x145288['body']&&_0x145288[_0x9807('0xa')]['agent_id']?_0x145288[_0x9807('0xa')][_0x9807('0x1a')]:'',_0x145288[_0x9807('0xa')]&&_0x145288[_0x9807('0xa')]['agent_name']?_0x145288[_0x9807('0xa')][_0x9807('0x1b')]:'');},'ignoreRoute':function(_0x493eea){var _0x4cedab=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4cedab['test'](_0x493eea[_0x9807('0xf')]);}}));_0x4f02bd[_0x9807('0x7')](_0x9807('0x1c'),require(_0x9807('0x1d')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x1e'),require(_0x9807('0x1f')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x20'),require(_0x9807('0x21')));_0x4f02bd[_0x9807('0x7')]('/api/voice/extensions',require(_0x9807('0x22')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x23'),require('./api/voiceMusicOnHold'));_0x4f02bd['use'](_0x9807('0x24'),require(_0x9807('0x25')));_0x4f02bd[_0x9807('0x7')]('/api/voice/recordings',require(_0x9807('0x26')));_0x4f02bd[_0x9807('0x7')]('/api/screen/recordings',require(_0x9807('0x27')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x28'),require(_0x9807('0x29')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x2a'),require(_0x9807('0x2b')));_0x4f02bd['use'](_0x9807('0x2c'),require(_0x9807('0x2d')));_0x4f02bd[_0x9807('0x7')]('/api/voice/dials/reports',require(_0x9807('0x2e')));_0x4f02bd['use'](_0x9807('0x2f'),require('./api/voiceAgentReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x30'),require(_0x9807('0x31')));_0x4f02bd[_0x9807('0x7')]('/api/members/reports',require(_0x9807('0x32')));_0x4f02bd['use'](_0x9807('0x33'),require(_0x9807('0x34')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x35'),require('./api/voiceTransferReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x36'),require(_0x9807('0x37')));_0x4f02bd[_0x9807('0x7')]('/api/mail/accounts',require(_0x9807('0x38')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x39'),require(_0x9807('0x3a')));_0x4f02bd[_0x9807('0x7')]('/api/mail/substatuses',require(_0x9807('0x3b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x3c'),require('./api/mailInteraction'));_0x4f02bd['use']('/api/mail/messages',require(_0x9807('0x3d')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x3e'),require('./api/mailApplication'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x3f'),require(_0x9807('0x40')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x41'),require('./api/dashboard'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x42'),require(_0x9807('0x43')));_0x4f02bd['use']('/api/fax/accounts',require('./api/faxAccount'));_0x4f02bd['use']('/api/fax/applications',require(_0x9807('0x44')));_0x4f02bd[_0x9807('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x45'),require(_0x9807('0x46')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x47'),require(_0x9807('0x48')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x49'),require(_0x9807('0x4a')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x4b'),require(_0x9807('0x4c')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x4d'),require(_0x9807('0x4e')));_0x4f02bd[_0x9807('0x7')]('/api/sms/interactions',require('./api/smsInteraction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x4f'),require(_0x9807('0x50')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x51'),require(_0x9807('0x52')));_0x4f02bd['use'](_0x9807('0x53'),require(_0x9807('0x54')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x55'),require('./api/openchannelApplication'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x56'),require(_0x9807('0x57')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x58'),require(_0x9807('0x59')));_0x4f02bd['use'](_0x9807('0x5a'),require('./api/openchannelQueue'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x5b'),require(_0x9807('0x5c')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x5d'),require(_0x9807('0x5e')));_0x4f02bd['use'](_0x9807('0x5f'),require(_0x9807('0x60')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x61'),require('./api/chatInteraction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x62'),require(_0x9807('0x63')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x64'),require(_0x9807('0x65')));_0x4f02bd[_0x9807('0x7')]('/api/chat/queues',require(_0x9807('0x66')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x67'),require(_0x9807('0x68')));_0x4f02bd[_0x9807('0x7')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x69'),require(_0x9807('0x6a')));_0x4f02bd[_0x9807('0x7')]('/api/cm/contacts',require(_0x9807('0x6b')));_0x4f02bd[_0x9807('0x7')]('/api/cm/hopper',require(_0x9807('0x6c')));_0x4f02bd[_0x9807('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x6d'),require(_0x9807('0x6e')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x6f'),require(_0x9807('0x70')));_0x4f02bd['use'](_0x9807('0x71'),require('./api/cmCustomField'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x72'),require('./api/action'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x73'),require('./api/automation'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x74'),require(_0x9807('0x75')));_0x4f02bd['use']('/api/dispositions',require(_0x9807('0x76')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x77'),require(_0x9807('0x78')));_0x4f02bd[_0x9807('0x7')]('/api/intervals',require('./api/interval'));_0x4f02bd[_0x9807('0x7')]('/api/pauses',require(_0x9807('0x79')));_0x4f02bd['use'](_0x9807('0x7a'),require(_0x9807('0x7b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x7c'),require(_0x9807('0x7d')));_0x4f02bd['use'](_0x9807('0x7e'),require(_0x9807('0x7f')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x80'),require(_0x9807('0x81')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x82'),require(_0x9807('0x83')));_0x4f02bd[_0x9807('0x7')]('/api/templates',require('./api/template'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x84'),require(_0x9807('0x85')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x86'),require('./api/variable'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x87'),require('./api/integration'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x88'),require(_0x9807('0x89')));_0x4f02bd['use'](_0x9807('0x8a'),require(_0x9807('0x8b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x8c'),require(_0x9807('0x8d')));_0x4f02bd['use'](_0x9807('0x8e'),require(_0x9807('0x8f')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x90'),require(_0x9807('0x91')));_0x4f02bd['use'](_0x9807('0x92'),require(_0x9807('0x93')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x94'),require(_0x9807('0x95')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x96'),require('./api/intSalesforceAccount'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x97'),require('./api/intSalesforceConfiguration'));_0x4f02bd['use'](_0x9807('0x98'),require(_0x9807('0x99')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x9a'),require('./api/intSugarcrmAccount'));_0x4f02bd['use']('/api/integrations/sugarcrm/configurations',require(_0x9807('0x9b')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x9c'),require(_0x9807('0x9d')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x9e'),require('./api/intDeskAccount'));_0x4f02bd['use'](_0x9807('0x9f'),require(_0x9807('0xa0')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa1'),require('./api/intDeskField'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa2'),require(_0x9807('0xa3')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa4'),require('./api/intZohoConfiguration'));_0x4f02bd['use'](_0x9807('0xa5'),require(_0x9807('0xa6')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xa7'),require(_0x9807('0xa8')));_0x4f02bd[_0x9807('0x7')]('/api/integrations/zendesk/configurations',require(_0x9807('0xa9')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xaa'),require('./api/intZendeskField'));_0x4f02bd['use'](_0x9807('0xab'),require('./api/intFreshdeskAccount'));_0x4f02bd['use'](_0x9807('0xac'),require(_0x9807('0xad')));_0x4f02bd['use']('/api/integrations/freshdesk/fields',require(_0x9807('0xae')));_0x4f02bd[_0x9807('0x7')]('/api/integrations/vtiger/accounts',require(_0x9807('0xaf')));_0x4f02bd[_0x9807('0x7')]('/api/integrations/vtiger/configurations',require(_0x9807('0xb0')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xb1'),require(_0x9807('0xb2')));_0x4f02bd['use'](_0x9807('0xb3'),require(_0x9807('0xb4')));_0x4f02bd['use'](_0x9807('0xb5'),require('./api/intServicenowConfiguration'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xb6'),require('./api/intServicenowField'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xb7'),require(_0x9807('0xb8')));_0x4f02bd['use']('/api/integrations/dynamics365/configurations',require(_0x9807('0xb9')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xba'),require(_0x9807('0xbb')));_0x4f02bd['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x4f02bd['use'](_0x9807('0xbc'),require(_0x9807('0xbd')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xbe'),require(_0x9807('0xbf')));_0x4f02bd['use'](_0x9807('0xc0'),require(_0x9807('0xc1')));_0x4f02bd['use'](_0x9807('0xc2'),require(_0x9807('0xc3')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc4'),require(_0x9807('0xc5')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc6'),require('./api/jscriptyAnswerReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc7'),require('./api/jscriptyQuestionReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xc8'),require(_0x9807('0xc9')));_0x4f02bd['use'](_0x9807('0xca'),require(_0x9807('0xcb')));_0x4f02bd['use'](_0x9807('0xcc'),require(_0x9807('0xcd')));_0x4f02bd[_0x9807('0x7')]('/api/square/details/reports',require(_0x9807('0xce')));_0x4f02bd[_0x9807('0x7')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xcf'),require('./api/setting'));_0x4f02bd[_0x9807('0x7')]('/api/square/odbc',require(_0x9807('0xd0')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd1'),require(_0x9807('0xd2')));_0x4f02bd[_0x9807('0x7')]('/api/square/recordings',require(_0x9807('0xd3')));_0x4f02bd[_0x9807('0x7')]('/api/square/messages',require(_0x9807('0xd4')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd5'),require('./api/team'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd6'),require(_0x9807('0xd7')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xd8'),require(_0x9807('0xd9')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xda'),require(_0x9807('0xdb')));_0x4f02bd['use'](_0x9807('0xdc'),require('./api/attachment'));_0x4f02bd[_0x9807('0x7')]('/api/plugins',require(_0x9807('0xdd')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xde'),require(_0x9807('0xdf')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe0'),require(_0x9807('0xe1')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe2'),require(_0x9807('0xe3')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe4'),require(_0x9807('0xe5')));_0x4f02bd['use'](_0x9807('0xe6'),require('./api/smsTransferReport'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe7'),require('./api/cmList'));_0x4f02bd[_0x9807('0x7')]('/api/voice/prefixes',require(_0x9807('0xe8')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xe9'),require(_0x9807('0xea')));_0x4f02bd['use']('/api/userProfile/sections',require(_0x9807('0xeb')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xec'),require(_0x9807('0xed')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xee'),require(_0x9807('0xef')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf0'),require(_0x9807('0xf1')));_0x4f02bd['use']('/api/whatsapp/applications',require(_0x9807('0xf2')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf3'),require(_0x9807('0xf4')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf5'),require(_0x9807('0xf6')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf7'),require(_0x9807('0xf8')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xf9'),require(_0x9807('0xfa')));_0x4f02bd[_0x9807('0x7')](_0x9807('0xfb'),require('./api/whatsappQueue'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xfc'),require(_0x9807('0xfd')));_0x4f02bd['use'](_0x9807('0xfe'),require('./api/realtime'));_0x4f02bd[_0x9807('0x7')](_0x9807('0xff'),require(_0x9807('0x100')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x101'),require('./api/authGoogle'));_0x4f02bd[_0x9807('0x7')](_0x9807('0x102'),require('./api/jira'));_0x4f02bd['use'](_0x9807('0x103'),require(_0x9807('0x104')));_0x4f02bd['use'](_0x9807('0x105'),require(_0x9807('0x106')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x107'),require(_0x9807('0x108')));_0x4f02bd[_0x9807('0x7')](_0x9807('0x109'),require('./api/pm2'));_0x4f02bd[_0x9807('0x7')]('/api/webbar',require(_0x9807('0x10a')));_0x4f02bd[_0x9807('0x7')]('/apidoc',express[_0x9807('0x10b')](path[_0x9807('0x10c')](config[_0x9807('0x10d')],_0x9807('0x10e'))));_0x4f02bd[_0x9807('0x7')](_0x9807('0x10f'),express[_0x9807('0x10b')](path[_0x9807('0x10c')](config['root'],_0x9807('0x10f'))));_0x4f02bd['use']('/demo',express[_0x9807('0x10b')](path[_0x9807('0x10c')](config[_0x9807('0x10d')],_0x9807('0x110'))));_0x4f02bd[_0x9807('0x7')](_0x9807('0x111'),express[_0x9807('0x10b')](path[_0x9807('0x10c')](config[_0x9807('0x10d')],'snippet',_0x9807('0x112'))));_0x4f02bd[_0x9807('0x7')]('/plugins',express[_0x9807('0x10b')](path[_0x9807('0x10c')](config['root'],_0x9807('0x113'))));_0x4f02bd[_0x9807('0x114')](_0x9807('0x115'))[_0x9807('0x116')](errors[0x194]);_0x4f02bd[_0x9807('0x114')]('/*')[_0x9807('0x116')](function(_0x1bcf23,_0x2d7cf8){_0x2d7cf8['sendFile'](path[_0x9807('0x117')](_0x4f02bd[_0x9807('0x116')]('appPath')+_0x9807('0x118')));});};var sensitiveFields=['username',_0x9807('0x119'),'newPassword','apiKey',_0x9807('0x11a'),_0x9807('0x11b'),_0x9807('0x11c'),_0x9807('0x11d'),_0x9807('0x11e'),'fax',_0x9807('0x11f'),_0x9807('0x120'),'clientSecret',_0x9807('0x121'),'code',_0x9807('0x122'),'tenantId',_0x9807('0x123'),_0x9807('0x124'),_0x9807('0x125'),_0x9807('0x126'),'authToken','consumerKey',_0x9807('0x127'),_0x9807('0x128'),_0x9807('0x129'),_0x9807('0x12a'),'exten',_0x9807('0x12b'),_0x9807('0x12c'),_0x9807('0x12d'),'accesskeyid',_0x9807('0x12e'),_0x9807('0x12f'),'user',_0x9807('0x130'),_0x9807('0x131'),_0x9807('0x132'),_0x9807('0x133'),_0x9807('0x134'),_0x9807('0x135'),_0x9807('0x136')];function maskSensitiveData(_0x2ab757){var _0x168cc2=/(?!^)[\s\S](?!$)/g;if(!_[_0x9807('0x137')](_0x2ab757))return;for(var _0x1d9de7 in _0x2ab757){if(_[_0x9807('0x138')](_0x2ab757[_0x1d9de7])){for(var _0x4b2e75=0x0;_0x4b2e75<_0x2ab757[_0x1d9de7][_0x9807('0x139')];_0x4b2e75++){maskSensitiveData(_0x2ab757[_0x1d9de7][_0x4b2e75]);}}else if(_[_0x9807('0x137')](_0x2ab757[_0x1d9de7])){maskSensitiveData(_0x2ab757[_0x1d9de7]);}else if(_[_0x9807('0x13a')](_0x2ab757[_0x1d9de7])){_0x2ab757[_0x1d9de7]=_0x2ab757[_0x1d9de7][_0x9807('0x13b')](/{{{/g,_0x9807('0x13c'))[_0x9807('0x13b')](/}}}/g,_0x9807('0x13d'))[_0x9807('0x13b')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x9807('0x13e')](sensitiveFields,_0x1d9de7)){_0x2ab757[_0x1d9de7]=_0x2ab757[_0x1d9de7]['replace'](_0x168cc2,'*');}}}} \ No newline at end of file +var _0x5471=['./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/conditions','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/schedule','/api/sounds','/api/tags','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/authLocal','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridnum','exten','vidaooApiKey','accesskeyid','key','pass','localstationid','secret','registry','oldPassword','isPlainObject','isArray','isString','replace','@@{','includes','lodash','path','express','express-winston','util','./errors','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','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','method','other','agent_name','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions'];(function(_0x2d19b9,_0x4e7fa4){var _0x10b8e4=function(_0x221cf1){while(--_0x221cf1){_0x2d19b9['push'](_0x2d19b9['shift']());}};_0x10b8e4(++_0x4e7fa4);}(_0x5471,0xfe));var _0x1547=function(_0x289b71,_0xa160ed){_0x289b71=_0x289b71-0x0;var _0x21bf3c=_0x5471[_0x289b71];return _0x21bf3c;};'use strict';var _=require(_0x1547('0x0'));var path=require(_0x1547('0x1'));var express=require(_0x1547('0x2'));var ewinston=require(_0x1547('0x3'));var util=require(_0x1547('0x4'));var errors=require(_0x1547('0x5'));var config=require('./config/environment');var logger=require(_0x1547('0x6'))(_0x1547('0x7'));var authLogger=require(_0x1547('0x6'))(_0x1547('0x8'));exports[_0x1547('0x9')]=function(_0x7949a9){_0x7949a9[_0x1547('0xa')](ewinston[_0x1547('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x533562,_0x1e09a6){var _0x406730=_0x1547('0xc');if(!_[_0x1547('0xd')](_0x533562[_0x1547('0xe')])){_0x406730+=_0x1547('0xf');var _0x4b8757=_0x533562['body'];maskSensitiveData(_0x4b8757);}return util[_0x1547('0x10')](_0x406730,_0x533562['method'],_0x533562[_0x1547('0x11')][_0x1547('0x12')]?_0x533562['headers'][_0x1547('0x12')]:_0x533562[_0x1547('0x13')][_0x1547('0x14')]||_0x533562['ip'],_0x533562[_0x1547('0x15')],_0x1e09a6[_0x1547('0x16')],_0x1e09a6[_0x1547('0x17')],_0x533562[_0x1547('0x18')]?_0x533562['user']['id']:null,_0x533562['user']?_0x533562['user'][_0x1547('0x19')]:null,_0x533562[_0x1547('0x18')]?_0x533562[_0x1547('0x18')][_0x1547('0x1a')]:null,_0x4b8757?util[_0x1547('0x1b')](_0x4b8757,![],null):'');}}));_0x7949a9[_0x1547('0xa')](ewinston[_0x1547('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xaceaa6,_0x1a0c50){var _0x1b1740=_0x1547('0x1c');if(_0xaceaa6[_0x1547('0xe')]&&_0xaceaa6[_0x1547('0xe')][_0x1547('0x1d')]&&_0xaceaa6['body'][_0x1547('0x1e')]){_0x1b1740='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x1547('0x10')](_0x1b1740,_0xaceaa6[_0x1547('0x1f')],_0xaceaa6['headers'][_0x1547('0x12')]?_0xaceaa6[_0x1547('0x11')][_0x1547('0x12')]:_0xaceaa6[_0x1547('0x13')][_0x1547('0x14')]||_0xaceaa6['ip'],_0xaceaa6['url'],_0x1a0c50[_0x1547('0x16')],_0x1a0c50[_0x1547('0x17')],_0xaceaa6[_0x1547('0x18')]?_0xaceaa6[_0x1547('0x18')]['id']:null,_0xaceaa6[_0x1547('0x18')]?_0xaceaa6['user'][_0x1547('0x19')]:null,_0xaceaa6['user']?_0xaceaa6['user']['role']:null,_0xaceaa6[_0x1547('0xe')]&&_0xaceaa6[_0x1547('0xe')][_0x1547('0x1d')]?_0xaceaa6[_0x1547('0xe')][_0x1547('0x1d')]:_0x1547('0x20'),_0xaceaa6['body']&&_0xaceaa6[_0x1547('0xe')][_0x1547('0x1e')]?_0xaceaa6['body']['agent_id']:'',_0xaceaa6[_0x1547('0xe')]&&_0xaceaa6['body']['agent_name']?_0xaceaa6[_0x1547('0xe')][_0x1547('0x21')]:'');},'ignoreRoute':function(_0x1870f7){var _0x322f55=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x322f55['test'](_0x1870f7[_0x1547('0x15')]);}}));_0x7949a9[_0x1547('0xa')]('/api/users',require('./api/user'));_0x7949a9['use'](_0x1547('0x22'),require(_0x1547('0x23')));_0x7949a9[_0x1547('0xa')](_0x1547('0x24'),require('./api/voiceContext'));_0x7949a9[_0x1547('0xa')]('/api/voice/extensions',require(_0x1547('0x25')));_0x7949a9[_0x1547('0xa')](_0x1547('0x26'),require('./api/voiceMusicOnHold'));_0x7949a9['use'](_0x1547('0x27'),require('./api/voiceQueue'));_0x7949a9[_0x1547('0xa')](_0x1547('0x28'),require('./api/voiceRecording'));_0x7949a9[_0x1547('0xa')](_0x1547('0x29'),require(_0x1547('0x2a')));_0x7949a9[_0x1547('0xa')]('/api/voice/mails',require(_0x1547('0x2b')));_0x7949a9[_0x1547('0xa')](_0x1547('0x2c'),require(_0x1547('0x2d')));_0x7949a9['use'](_0x1547('0x2e'),require(_0x1547('0x2f')));_0x7949a9[_0x1547('0xa')](_0x1547('0x30'),require(_0x1547('0x31')));_0x7949a9[_0x1547('0xa')](_0x1547('0x32'),require(_0x1547('0x33')));_0x7949a9['use'](_0x1547('0x34'),require(_0x1547('0x35')));_0x7949a9[_0x1547('0xa')](_0x1547('0x36'),require(_0x1547('0x37')));_0x7949a9[_0x1547('0xa')](_0x1547('0x38'),require(_0x1547('0x39')));_0x7949a9[_0x1547('0xa')](_0x1547('0x3a'),require(_0x1547('0x3b')));_0x7949a9[_0x1547('0xa')]('/api/mail/out_servers',require(_0x1547('0x3c')));_0x7949a9[_0x1547('0xa')](_0x1547('0x3d'),require(_0x1547('0x3e')));_0x7949a9[_0x1547('0xa')](_0x1547('0x3f'),require(_0x1547('0x40')));_0x7949a9[_0x1547('0xa')](_0x1547('0x41'),require(_0x1547('0x42')));_0x7949a9[_0x1547('0xa')](_0x1547('0x43'),require(_0x1547('0x44')));_0x7949a9[_0x1547('0xa')](_0x1547('0x45'),require('./api/mailMessage'));_0x7949a9[_0x1547('0xa')](_0x1547('0x46'),require(_0x1547('0x47')));_0x7949a9[_0x1547('0xa')](_0x1547('0x48'),require(_0x1547('0x49')));_0x7949a9['use'](_0x1547('0x4a'),require(_0x1547('0x4b')));_0x7949a9[_0x1547('0xa')]('/api/dashboards/items',require(_0x1547('0x4c')));_0x7949a9[_0x1547('0xa')](_0x1547('0x4d'),require(_0x1547('0x4e')));_0x7949a9['use'](_0x1547('0x4f'),require('./api/faxApplication'));_0x7949a9[_0x1547('0xa')](_0x1547('0x50'),require(_0x1547('0x51')));_0x7949a9['use'](_0x1547('0x52'),require(_0x1547('0x53')));_0x7949a9[_0x1547('0xa')](_0x1547('0x54'),require(_0x1547('0x55')));_0x7949a9[_0x1547('0xa')]('/api/fax/reports/queue',require(_0x1547('0x56')));_0x7949a9[_0x1547('0xa')](_0x1547('0x57'),require(_0x1547('0x58')));_0x7949a9[_0x1547('0xa')](_0x1547('0x59'),require(_0x1547('0x5a')));_0x7949a9['use'](_0x1547('0x5b'),require(_0x1547('0x5c')));_0x7949a9[_0x1547('0xa')]('/api/sms/messages',require(_0x1547('0x5d')));_0x7949a9['use'](_0x1547('0x5e'),require(_0x1547('0x5f')));_0x7949a9[_0x1547('0xa')](_0x1547('0x60'),require('./api/openchannelAccount'));_0x7949a9[_0x1547('0xa')](_0x1547('0x61'),require(_0x1547('0x62')));_0x7949a9[_0x1547('0xa')](_0x1547('0x63'),require(_0x1547('0x64')));_0x7949a9['use'](_0x1547('0x65'),require(_0x1547('0x66')));_0x7949a9[_0x1547('0xa')]('/api/openchannel/queues',require(_0x1547('0x67')));_0x7949a9[_0x1547('0xa')](_0x1547('0x68'),require('./api/chatWebsite'));_0x7949a9['use'](_0x1547('0x69'),require(_0x1547('0x6a')));_0x7949a9[_0x1547('0xa')](_0x1547('0x6b'),require('./api/chatApplication'));_0x7949a9[_0x1547('0xa')](_0x1547('0x6c'),require(_0x1547('0x6d')));_0x7949a9[_0x1547('0xa')](_0x1547('0x6e'),require('./api/chatMessage'));_0x7949a9[_0x1547('0xa')]('/api/chat/offline_messages',require(_0x1547('0x6f')));_0x7949a9[_0x1547('0xa')](_0x1547('0x70'),require('./api/chatQueue'));_0x7949a9[_0x1547('0xa')]('/api/chat/groups',require(_0x1547('0x71')));_0x7949a9['use'](_0x1547('0x72'),require(_0x1547('0x73')));_0x7949a9[_0x1547('0xa')](_0x1547('0x74'),require(_0x1547('0x75')));_0x7949a9[_0x1547('0xa')](_0x1547('0x76'),require('./api/cmContact'));_0x7949a9[_0x1547('0xa')](_0x1547('0x77'),require(_0x1547('0x78')));_0x7949a9[_0x1547('0xa')](_0x1547('0x79'),require(_0x1547('0x7a')));_0x7949a9[_0x1547('0xa')](_0x1547('0x7b'),require(_0x1547('0x7c')));_0x7949a9[_0x1547('0xa')](_0x1547('0x7d'),require(_0x1547('0x7e')));_0x7949a9[_0x1547('0xa')](_0x1547('0x7f'),require(_0x1547('0x80')));_0x7949a9[_0x1547('0xa')](_0x1547('0x81'),require(_0x1547('0x82')));_0x7949a9['use']('/api/automations',require(_0x1547('0x83')));_0x7949a9[_0x1547('0xa')](_0x1547('0x84'),require('./api/cannedAnswer'));_0x7949a9['use']('/api/dispositions',require('./api/disposition'));_0x7949a9[_0x1547('0xa')](_0x1547('0x85'),require('./api/condition'));_0x7949a9[_0x1547('0xa')]('/api/intervals',require(_0x1547('0x86')));_0x7949a9['use']('/api/pauses',require(_0x1547('0x87')));_0x7949a9[_0x1547('0xa')](_0x1547('0x88'),require(_0x1547('0x89')));_0x7949a9[_0x1547('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x7949a9[_0x1547('0xa')]('/api/schedules',require(_0x1547('0x8a')));_0x7949a9[_0x1547('0xa')](_0x1547('0x8b'),require('./api/sound'));_0x7949a9[_0x1547('0xa')](_0x1547('0x8c'),require('./api/tag'));_0x7949a9[_0x1547('0xa')]('/api/templates',require(_0x1547('0x8d')));_0x7949a9[_0x1547('0xa')]('/api/triggers',require(_0x1547('0x8e')));_0x7949a9[_0x1547('0xa')](_0x1547('0x8f'),require(_0x1547('0x90')));_0x7949a9[_0x1547('0xa')]('/api/integrations',require(_0x1547('0x91')));_0x7949a9[_0x1547('0xa')](_0x1547('0x92'),require(_0x1547('0x93')));_0x7949a9[_0x1547('0xa')]('/api/analytics/custom_reports',require(_0x1547('0x94')));_0x7949a9[_0x1547('0xa')](_0x1547('0x95'),require(_0x1547('0x96')));_0x7949a9[_0x1547('0xa')](_0x1547('0x97'),require('./api/analyticExtractedReport'));_0x7949a9['use'](_0x1547('0x98'),require('./api/analyticMetric'));_0x7949a9[_0x1547('0xa')](_0x1547('0x99'),require('./api/analyticFieldReport'));_0x7949a9['use']('/api/analytics/tree_reports',require(_0x1547('0x9a')));_0x7949a9['use']('/api/integrations/salesforce/accounts',require(_0x1547('0x9b')));_0x7949a9['use'](_0x1547('0x9c'),require(_0x1547('0x9d')));_0x7949a9[_0x1547('0xa')]('/api/integrations/salesforce/fields',require(_0x1547('0x9e')));_0x7949a9['use'](_0x1547('0x9f'),require(_0x1547('0xa0')));_0x7949a9[_0x1547('0xa')](_0x1547('0xa1'),require('./api/intSugarcrmConfiguration'));_0x7949a9[_0x1547('0xa')]('/api/integrations/sugarcrm/fields',require(_0x1547('0xa2')));_0x7949a9[_0x1547('0xa')](_0x1547('0xa3'),require(_0x1547('0xa4')));_0x7949a9[_0x1547('0xa')](_0x1547('0xa5'),require(_0x1547('0xa6')));_0x7949a9['use']('/api/integrations/desk/fields',require('./api/intDeskField'));_0x7949a9[_0x1547('0xa')](_0x1547('0xa7'),require('./api/intZohoAccount'));_0x7949a9[_0x1547('0xa')]('/api/integrations/zoho/configurations',require(_0x1547('0xa8')));_0x7949a9[_0x1547('0xa')](_0x1547('0xa9'),require(_0x1547('0xaa')));_0x7949a9[_0x1547('0xa')](_0x1547('0xab'),require(_0x1547('0xac')));_0x7949a9[_0x1547('0xa')](_0x1547('0xad'),require(_0x1547('0xae')));_0x7949a9[_0x1547('0xa')](_0x1547('0xaf'),require(_0x1547('0xb0')));_0x7949a9[_0x1547('0xa')](_0x1547('0xb1'),require('./api/intFreshdeskAccount'));_0x7949a9[_0x1547('0xa')](_0x1547('0xb2'),require(_0x1547('0xb3')));_0x7949a9['use'](_0x1547('0xb4'),require('./api/intFreshdeskField'));_0x7949a9[_0x1547('0xa')](_0x1547('0xb5'),require(_0x1547('0xb6')));_0x7949a9[_0x1547('0xa')](_0x1547('0xb7'),require(_0x1547('0xb8')));_0x7949a9[_0x1547('0xa')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x7949a9[_0x1547('0xa')](_0x1547('0xb9'),require('./api/intServicenowAccount'));_0x7949a9[_0x1547('0xa')](_0x1547('0xba'),require('./api/intServicenowConfiguration'));_0x7949a9[_0x1547('0xa')](_0x1547('0xbb'),require('./api/intServicenowField'));_0x7949a9[_0x1547('0xa')](_0x1547('0xbc'),require(_0x1547('0xbd')));_0x7949a9[_0x1547('0xa')](_0x1547('0xbe'),require('./api/intDynamics365Configuration'));_0x7949a9[_0x1547('0xa')](_0x1547('0xbf'),require(_0x1547('0xc0')));_0x7949a9['use'](_0x1547('0xc1'),require(_0x1547('0xc2')));_0x7949a9[_0x1547('0xa')](_0x1547('0xc3'),require(_0x1547('0xc4')));_0x7949a9[_0x1547('0xa')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x7949a9[_0x1547('0xa')](_0x1547('0xc5'),require('./api/network'));_0x7949a9[_0x1547('0xa')](_0x1547('0xc6'),require(_0x1547('0xc7')));_0x7949a9[_0x1547('0xa')](_0x1547('0xc8'),require(_0x1547('0xc9')));_0x7949a9[_0x1547('0xa')]('/api/jscripty/answers/reports',require(_0x1547('0xca')));_0x7949a9[_0x1547('0xa')](_0x1547('0xcb'),require(_0x1547('0xcc')));_0x7949a9[_0x1547('0xa')](_0x1547('0xcd'),require(_0x1547('0xce')));_0x7949a9['use'](_0x1547('0xcf'),require(_0x1547('0xd0')));_0x7949a9[_0x1547('0xa')]('/api/square/reports',require(_0x1547('0xd1')));_0x7949a9['use'](_0x1547('0xd2'),require('./api/squareReportDetail'));_0x7949a9[_0x1547('0xa')](_0x1547('0xd3'),require(_0x1547('0xd4')));_0x7949a9[_0x1547('0xa')](_0x1547('0xd5'),require(_0x1547('0xd6')));_0x7949a9['use'](_0x1547('0xd7'),require(_0x1547('0xd8')));_0x7949a9[_0x1547('0xa')]('/api/square/projects',require(_0x1547('0xd9')));_0x7949a9['use'](_0x1547('0xda'),require(_0x1547('0xdb')));_0x7949a9[_0x1547('0xa')](_0x1547('0xdc'),require(_0x1547('0xdd')));_0x7949a9['use']('/api/teams',require('./api/team'));_0x7949a9[_0x1547('0xa')]('/api/license',require(_0x1547('0xde')));_0x7949a9[_0x1547('0xa')](_0x1547('0xdf'),require(_0x1547('0xe0')));_0x7949a9[_0x1547('0xa')](_0x1547('0xe1'),require(_0x1547('0xe2')));_0x7949a9[_0x1547('0xa')](_0x1547('0xe3'),require(_0x1547('0xe4')));_0x7949a9[_0x1547('0xa')](_0x1547('0xe5'),require(_0x1547('0xe6')));_0x7949a9['use'](_0x1547('0xe7'),require('./api/mailTransferReport'));_0x7949a9[_0x1547('0xa')](_0x1547('0xe8'),require(_0x1547('0xe9')));_0x7949a9[_0x1547('0xa')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x7949a9[_0x1547('0xa')](_0x1547('0xea'),require(_0x1547('0xeb')));_0x7949a9[_0x1547('0xa')](_0x1547('0xec'),require('./api/smsTransferReport'));_0x7949a9[_0x1547('0xa')](_0x1547('0xed'),require(_0x1547('0xee')));_0x7949a9[_0x1547('0xa')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x7949a9[_0x1547('0xa')]('/api/userProfiles',require(_0x1547('0xef')));_0x7949a9[_0x1547('0xa')]('/api/userProfile/sections',require(_0x1547('0xf0')));_0x7949a9[_0x1547('0xa')](_0x1547('0xf1'),require(_0x1547('0xf2')));_0x7949a9[_0x1547('0xa')](_0x1547('0xf3'),require(_0x1547('0xf4')));_0x7949a9[_0x1547('0xa')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x7949a9[_0x1547('0xa')](_0x1547('0xf5'),require(_0x1547('0xf6')));_0x7949a9[_0x1547('0xa')](_0x1547('0xf7'),require(_0x1547('0xf8')));_0x7949a9[_0x1547('0xa')](_0x1547('0xf9'),require(_0x1547('0xfa')));_0x7949a9[_0x1547('0xa')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x7949a9[_0x1547('0xa')](_0x1547('0xfb'),require(_0x1547('0xfc')));_0x7949a9[_0x1547('0xa')](_0x1547('0xfd'),require(_0x1547('0xfe')));_0x7949a9[_0x1547('0xa')](_0x1547('0xff'),require(_0x1547('0x100')));_0x7949a9[_0x1547('0xa')](_0x1547('0x101'),require('./api/realtime'));_0x7949a9[_0x1547('0xa')]('/api/auth/local',require(_0x1547('0x102')));_0x7949a9[_0x1547('0xa')]('/api/auth/google',require(_0x1547('0x103')));_0x7949a9[_0x1547('0xa')]('/api/jira',require(_0x1547('0x104')));_0x7949a9[_0x1547('0xa')](_0x1547('0x105'),require(_0x1547('0x106')));_0x7949a9[_0x1547('0xa')]('/api/version',require('./api/version'));_0x7949a9['use']('/api/system',require(_0x1547('0x107')));_0x7949a9['use'](_0x1547('0x108'),require(_0x1547('0x109')));_0x7949a9[_0x1547('0xa')](_0x1547('0x10a'),require(_0x1547('0x10b')));_0x7949a9['use'](_0x1547('0x10c'),express[_0x1547('0x10d')](path[_0x1547('0x10e')](config[_0x1547('0x10f')],_0x1547('0x10c'))));_0x7949a9[_0x1547('0xa')]('/www',express[_0x1547('0x10d')](path[_0x1547('0x10e')](config[_0x1547('0x10f')],_0x1547('0x110'))));_0x7949a9[_0x1547('0xa')](_0x1547('0x111'),express[_0x1547('0x10d')](path['join'](config['root'],_0x1547('0x111'))));_0x7949a9[_0x1547('0xa')]('/snippet',express[_0x1547('0x10d')](path[_0x1547('0x10e')](config['root'],'snippet',_0x1547('0x112'))));_0x7949a9['use'](_0x1547('0x113'),express[_0x1547('0x10d')](path[_0x1547('0x10e')](config[_0x1547('0x10f')],'/server/files/plugins')));_0x7949a9[_0x1547('0x114')](_0x1547('0x115'))[_0x1547('0x116')](errors[0x194]);_0x7949a9[_0x1547('0x114')]('/*')[_0x1547('0x116')](function(_0x50a48b,_0x1b8430){_0x1b8430['sendFile'](path[_0x1547('0x117')](_0x7949a9[_0x1547('0x116')](_0x1547('0x118'))+_0x1547('0x119')));});};var sensitiveFields=[_0x1547('0x11a'),_0x1547('0x11b'),'newPassword',_0x1547('0x11c'),_0x1547('0x11d'),_0x1547('0x11e'),_0x1547('0x11f'),_0x1547('0x120'),_0x1547('0x121'),_0x1547('0x122'),_0x1547('0x123'),_0x1547('0x124'),_0x1547('0x125'),_0x1547('0x126'),_0x1547('0x127'),_0x1547('0x128'),_0x1547('0x129'),_0x1547('0x12a'),_0x1547('0x12b'),_0x1547('0x12c'),_0x1547('0x12d'),_0x1547('0x12e'),_0x1547('0x12f'),_0x1547('0x130'),_0x1547('0x131'),'calleridname',_0x1547('0x132'),_0x1547('0x133'),_0x1547('0x134'),'clientEmail','privateKey',_0x1547('0x135'),'secretaccesskey',_0x1547('0x136'),_0x1547('0x18'),_0x1547('0x137'),'accountSid',_0x1547('0x138'),'dsn',_0x1547('0x139'),_0x1547('0x13a'),_0x1547('0x13b')];function maskSensitiveData(_0x18b42b){var _0x41e6ad=/(?!^)[\s\S](?!$)/g;if(!_[_0x1547('0x13c')](_0x18b42b))return;for(var _0x14a659 in _0x18b42b){if(_[_0x1547('0x13d')](_0x18b42b[_0x14a659])){for(var _0x23b33d=0x0;_0x23b33d<_0x18b42b[_0x14a659]['length'];_0x23b33d++){maskSensitiveData(_0x18b42b[_0x14a659][_0x23b33d]);}}else if(_[_0x1547('0x13c')](_0x18b42b[_0x14a659])){maskSensitiveData(_0x18b42b[_0x14a659]);}else if(_[_0x1547('0x13e')](_0x18b42b[_0x14a659])){_0x18b42b[_0x14a659]=_0x18b42b[_0x14a659][_0x1547('0x13f')](/{{{/g,_0x1547('0x140'))[_0x1547('0x13f')](/}}}/g,'}@@')[_0x1547('0x13f')](/{{/g,'@{')[_0x1547('0x13f')](/}}/g,'}@');if(_[_0x1547('0x141')](sensitiveFields,_0x14a659)){_0x18b42b[_0x14a659]=_0x18b42b[_0x14a659][_0x1547('0x13f')](_0x41e6ad,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 1e1c044..81c0db5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f58=['../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x3f58,0x1f0));var _0x83f5=function(_0x57c481,_0x2661a2){_0x57c481=_0x57c481-0x0;var _0x475a13=_0x3f58[_0x57c481];return _0x475a13;};'use strict';var jayson=require(_0x83f5('0x0'));var BPromise=require('bluebird');var _=require(_0x83f5('0x1'));var config=require(_0x83f5('0x2'));exports[_0x83f5('0x3')]=function(){return new BPromise(function(_0xf9b596,_0x2cc256){var _0x598c14={};_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x5')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x6')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x7')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x8')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x9')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xa')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0xb')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0xc')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xd')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/trunk/trunk.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xe')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0xf')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x10')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/mailAccount/mailAccount.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x11')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/mailInteraction/mailInteraction.rpc'));_0x598c14=_['merge'](_0x598c14,require('../api/mailMessage/mailMessage.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x12')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x13')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x14')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x15')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/faxInteraction/faxInteraction.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x16')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x17')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x18')));_0x598c14=_['merge'](_0x598c14,require('../api/smsAccount/smsAccount.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x19')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1a')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1b')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x1c')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1d')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1e')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x1f')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x20')));_0x598c14=_['merge'](_0x598c14,require('../api/chatQueue/chatQueue.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/cmContact/cmContact.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x21')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x22')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x23')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x24')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x25')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x26')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x27')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x28')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x29')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x2a')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2b')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x598c14=_['merge'](_0x598c14,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x2c')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2d')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2e')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x2f')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x30')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x31')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x32')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x33')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x34')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x35')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x36')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x37')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x38')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x39')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3a')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3b')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3c')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/attachment/attachment.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3d')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x3e')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x3f')));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x598c14=_[_0x83f5('0x4')](_0x598c14,require(_0x83f5('0x40')));_0x598c14=_['merge'](_0x598c14,require(_0x83f5('0x41')));var _0xf7cdad=jayson[_0x83f5('0x42')](_0x598c14)[_0x83f5('0x43')]();var _0x276141=config[_0x83f5('0x44')]['port']||config[_0x83f5('0x45')]+0x1;var _0x1ce35b=config[_0x83f5('0x44')]['ip']||_0x83f5('0x46');_0xf7cdad['on'](_0x83f5('0x47'),function(_0x4e7e9b){return _0x2cc256(_0x4e7e9b);});_0xf7cdad[_0x83f5('0x3')](_0x276141,_0x1ce35b,function(){console[_0x83f5('0x48')](_0x83f5('0x49'),_0x1ce35b,_0x276141);require(_0x83f5('0x4a'))[_0x83f5('0x4b')]();return _0xf9b596('RPC\x20listening\x20on\x20'+_0x1ce35b+':'+_0x276141);});});}; \ No newline at end of file +var _0x12d0=['../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0x12d0,0xea));var _0x012d=function(_0x4687b5,_0x20ed24){_0x4687b5=_0x4687b5-0x0;var _0x551ce5=_0x12d0[_0x4687b5];return _0x551ce5;};'use strict';var jayson=require(_0x012d('0x0'));var BPromise=require(_0x012d('0x1'));var _=require(_0x012d('0x2'));var config=require('../config/environment');exports[_0x012d('0x3')]=function(){return new BPromise(function(_0x2ca51e,_0x812215){var _0x300edb={};_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x5')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x6')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x7')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x8')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x9')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0xa')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0xb')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0xc')));_0x300edb=_['merge'](_0x300edb,require('../api/memberReport/memberReport.rpc'));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0xd')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0xe')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0xf')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/mailAccount/mailAccount.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x10')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/mailInteraction/mailInteraction.rpc'));_0x300edb=_['merge'](_0x300edb,require('../api/mailMessage/mailMessage.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/mailApplication/mailApplication.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x11')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x12')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/faxApplication/faxApplication.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x13')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x14')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x15')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x16')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x17')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x18')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x19')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x1a')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x1b')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x300edb=_['merge'](_0x300edb,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x1c')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x1d')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x1e')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x1f')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x20')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x21')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x22')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x23')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x24')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x25')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x26')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/pause/pause.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/sound/sound.rpc'));_0x300edb=_['merge'](_0x300edb,require('../api/template/template.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x27')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x28')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x29')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x2a')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x2b')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x2c')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x2d')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x2e')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x2f')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x30')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x31')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x32')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x33')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x34')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/setting/setting.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x35')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x36')));_0x300edb=_['merge'](_0x300edb,require('../api/squareRecording/squareRecording.rpc'));_0x300edb=_['merge'](_0x300edb,require('../api/squareMessage/squareMessage.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x37')));_0x300edb=_['merge'](_0x300edb,require(_0x012d('0x38')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require('../api/plugin/plugin.rpc'));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x39')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x3a')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x3b')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x3c')));_0x300edb=_[_0x012d('0x4')](_0x300edb,require(_0x012d('0x3d')));var _0x5d591b=jayson[_0x012d('0x3e')](_0x300edb)[_0x012d('0x3f')]();var _0x251f11=config[_0x012d('0x40')][_0x012d('0x41')]||config[_0x012d('0x41')]+0x1;var _0x43be73=config['rpc']['ip']||_0x012d('0x42');_0x5d591b['on'](_0x012d('0x43'),function(_0x3ab583){return _0x812215(_0x3ab583);});_0x5d591b['listen'](_0x251f11,_0x43be73,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x43be73,_0x251f11);require(_0x012d('0x44'))[_0x012d('0x45')]();return _0x2ca51e(_0x012d('0x46')+_0x43be73+':'+_0x251f11);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4cfd3de..39bbc9f 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 _0xd706=['code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','prototype','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','sendRequest','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','call','setEncoding','utf8','setTimeout','headers','hangup','emit','substring','520-Invalid','search','function','no\x20code','replace','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd706,0x115));var _0x6d70=function(_0x1bdc19,_0x406dd3){_0x1bdc19=_0x1bdc19-0x0;var _0x23f947=_0xd706[_0x1bdc19];return _0x23f947;};'use strict';var util=require(_0x6d70('0x0'));var _=require(_0x6d70('0x1'));var EventEmitter=require(_0x6d70('0x2'))['EventEmitter'];var AGIReply=require(_0x6d70('0x3'));var AGIError=require('./error');function AGIChannel(_0x1fdbec){var _0x512beb=this,_0x4a6af3=new AGIReply(),_0x333383=![],_0x24a4a9={};EventEmitter[_0x6d70('0x4')](_0x512beb);_0x1fdbec[_0x6d70('0x5')](_0x6d70('0x6'));_0x1fdbec[_0x6d70('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4a6af3[_0x6d70('0x5')](_0x6d70('0x6'));_0x4a6af3['on'](_0x6d70('0x8'),function(_0x408b54){for(var _0x385eec in _0x408b54){_0x512beb[_0x385eec]=_0x408b54[_0x385eec];}_0x512beb['emit']('ready');});_0x4a6af3['on']('line',function(_0x1bcbdd){if(_0x1bcbdd['toLowerCase']()==_0x6d70('0x9')){_0x512beb[_0x6d70('0xa')](_0x6d70('0x9'));return;}if(_0x1bcbdd[_0x6d70('0xb')](0x0,0xb)==_0x6d70('0xc')){_0x333383=!![];}if(_0x333383){_0x24a4a9['rx']+=_0x1bcbdd+'\x0a';if(_0x1bcbdd[_0x6d70('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x333383=![];}}else{_0x24a4a9['rx']=_0x1bcbdd;}if(_0x333383){return;}if(typeof _0x24a4a9['cb']==_0x6d70('0xe')){var _0xdbc562=_0x24a4a9['rx'][_0x6d70('0xb')](0x0,0x3),_0x2f93be=null,_0x2d75a8=null;_0xdbc562=parseInt(_0xdbc562);if(isNaN(_0xdbc562)){_0x24a4a9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6d70('0xf')});return;}if(_0xdbc562!=0xc8){_0x24a4a9['cb'](null,{'code':_0xdbc562,'result':-0x1,'extra':'KO'});return;}_0x2f93be=_0x24a4a9['rx'][_0x6d70('0xb')](0x4)[_0x6d70('0x10')]('result=','');if(_0x2f93be[_0x6d70('0x11')]('\x20')!=-0x1){_0x2f93be=_0x2f93be['substr'](0x0,_0x2f93be[_0x6d70('0x11')]('\x20'));}if(_[_0x6d70('0x12')](_0x2f93be,'-1')){_0x2f93be=parseInt(_0x2f93be);}_0x2d75a8=_0x24a4a9['rx'][_0x6d70('0x13')]('\x20');if(_0x2d75a8[_0x6d70('0x14')]==0x3){_0x2d75a8=_0x2d75a8[0x2][_0x6d70('0xb')](0x1,_0x2d75a8[0x2][_0x6d70('0x14')]-0x1);}else if(_0x2d75a8[_0x6d70('0x14')]>0x3){var _0x1d1799=/\((.+)\)/;var _0x2c24ef=_0x24a4a9['rx']['match'](_0x1d1799);if(_0x2c24ef){_0x2d75a8=_0x2c24ef[0x1];}else{_0x2d75a8=null;}}else{_0x2d75a8=null;}_0x24a4a9['cb'](null,{'code':_0xdbc562,'result':_0x2f93be,'extra':_0x2d75a8});}});_0x1fdbec['on']('error',function(_0x2a1e1a){_0x512beb['emit'](_0x6d70('0x15'),new AGIError(_0x6d70('0x16'),_0x2a1e1a[_0x6d70('0x17')]));});_0x1fdbec['on'](_0x6d70('0x18'),function(){_0x512beb[_0x6d70('0xa')]('close',new AGIError(_0x6d70('0x19')));});_0x1fdbec['on'](_0x6d70('0x1a'),function(){_0x512beb['emit'](_0x6d70('0x1a'),new AGIError(_0x6d70('0x1b')));_0x1fdbec['destroy']();});_0x1fdbec['pipe'](_0x4a6af3);this[_0x6d70('0x1c')]=function(_0x173850,_0x20c5e1){var _0x173850=_0x173850||'',_0x20c5e1=typeof _0x20c5e1==_0x6d70('0xe')?_0x20c5e1:new Function();_0x24a4a9={'tx':_0x173850,'rx':'','cb':_0x20c5e1};_0x1fdbec[_0x6d70('0x1d')](_0x173850+'\x0a');},this[_0x6d70('0x18')]=function(){_0x1fdbec[_0x6d70('0x1e')]();};}util[_0x6d70('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x6d70('0x20')]['sendRequest']=function(_0x367e5c){return this[_0x6d70('0x1c')][_0x6d70('0x21')](this,_0x367e5c);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0x6d70('0x22'));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x23')]=function(_0x14efc0,_0x1b2993,_0x483a84){_0x14efc0=_0x14efc0===undefined?_0x6d70('0x24'):_0x14efc0;_0x1b2993=_0x1b2993===undefined?'5':_0x1b2993;_0x483a84=_0x483a84===undefined?'1':_0x483a84;return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x26'),_0x14efc0,_0x1b2993*0x3e8,_0x483a84));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x27')]=function(_0x30d12e){_0x30d12e=_0x30d12e||_0x6d70('0x28');return this[_0x6d70('0x29')](util['format'](_0x6d70('0x2a'),_0x30d12e));};AGIChannel[_0x6d70('0x20')]['exec']=function(_0x311fc3,_0x5d0022){if(_[_0x6d70('0x2b')](_0x5d0022)){return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x2c'),_0x311fc3,_0x5d0022['join'](',')));}return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x2c'),_0x311fc3,_0x5d0022));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x2d')]=function(_0x3afde8){return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x2e'),_0x3afde8));};AGIChannel['prototype']['setExtension']=function(_0x21ee66){return this[_0x6d70('0x29')](util[_0x6d70('0x25')]('SET\x20EXTENSION\x20%s',_0x21ee66));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x2f')]=function(_0x1fd867){return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x30'),_0x1fd867));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x9')]=function(){return this[_0x6d70('0x29')]('HANGUP');};AGIChannel['prototype'][_0x6d70('0x31')]=function(_0x3d1a19,_0x5c9c8f){var _0x11398a=_['isBoolean'](_0x5c9c8f)||_[_0x6d70('0x32')](_0x5c9c8f)?_0x5c9c8f[_0x6d70('0x33')]():_0x5c9c8f;return this[_0x6d70('0x29')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3d1a19,_0x11398a?_0x11398a[_0x6d70('0x33')]()[_0x6d70('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x34')]=function(_0x479520,_0x4e5f0c){return this['sendRequest'](util[_0x6d70('0x25')](_0x6d70('0x35'),_0x479520,_0x4e5f0c));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x36')]=function(_0x5c3e71,_0x1b1434){return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x37'),_0x5c3e71,_0x1b1434));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x38')]=function(_0x21cc53,_0x260f32){return this['sendRequest'](util['format'](_0x6d70('0x39'),_0x21cc53,_0x260f32));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x3a')]=function(_0x370e74,_0x3d7c96,_0x509971){_0x3d7c96=_0x3d7c96||this['extension'];_0x509971=_0x509971||0x1;this[_0x6d70('0x2d')](_0x370e74);this[_0x6d70('0x3b')](_0x3d7c96);this[_0x6d70('0x2f')](_0x509971);return this[_0x6d70('0x27')](util[_0x6d70('0x25')](_0x6d70('0x3c'),_0x370e74,_0x3d7c96,_0x509971));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x3d')]=function(_0x7b69f6){return this[_0x6d70('0x29')](util[_0x6d70('0x25')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7b69f6));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x3e')]=function(_0x53da8f,_0x399c9d,_0xf1b3af,_0xa64566,_0x5c18d4,_0x4fe084){_0x399c9d=_0x399c9d||_0x6d70('0x3f');_0xf1b3af=_0xf1b3af||'';_0xa64566=_0xa64566===undefined?-0x1:_0xa64566==='-1'?-0x1:_0xa64566*0x3e8;_0x5c18d4=_0x5c18d4===undefined?'':'s='+_0x5c18d4;_0x4fe084=_0x4fe084?_0x6d70('0x40'):'';return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x41'),_0x53da8f,_0x399c9d,_0xf1b3af,_0xa64566,_0x4fe084,_0x5c18d4));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x42')]=function(_0x54c978,_0xd52e03){_0xd52e03=_0xd52e03||'';return this[_0x6d70('0x29')](util[_0x6d70('0x25')](_0x6d70('0x43'),_0x54c978,_0xd52e03));};AGIChannel[_0x6d70('0x20')][_0x6d70('0x44')]=function(_0x3e7620){return this[_0x6d70('0x45')](_0x6d70('0x46'),_0x3e7620);};AGIChannel[_0x6d70('0x20')]['wait']=function(_0x39a658){return this[_0x6d70('0x45')](_0x6d70('0x47'),_0x39a658);};AGIChannel[_0x6d70('0x20')][_0x6d70('0x15')]=function(_0x8f7aaf,_0x2c9c78){this[_0x6d70('0x27')](util[_0x6d70('0x25')](_0x6d70('0x48'),_0x8f7aaf['id'],_0x8f7aaf[_0x6d70('0x49')],_0x2c9c78));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6d70('0x4a')]=AGIChannel; \ No newline at end of file +var _0xf163=['extension','setPriority','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sync','answer','sendRequest','getData','beep','format','noop','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt'];(function(_0x3f4f84,_0x53a0c5){var _0x3edd6c=function(_0x39c506){while(--_0x39c506){_0x3f4f84['push'](_0x3f4f84['shift']());}};_0x3edd6c(++_0x53a0c5);}(_0xf163,0x129));var _0x3f16=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xf163[_0x3ceb54];return _0x26d8a6;};'use strict';var util=require(_0x3f16('0x0'));var _=require('lodash');var EventEmitter=require(_0x3f16('0x1'))[_0x3f16('0x2')];var AGIReply=require(_0x3f16('0x3'));var AGIError=require(_0x3f16('0x4'));function AGIChannel(_0x3b5045){var _0x505606=this,_0xb7e352=new AGIReply(),_0x2accc4=![],_0x5771b7={};EventEmitter[_0x3f16('0x5')](_0x505606);_0x3b5045[_0x3f16('0x6')](_0x3f16('0x7'));_0x3b5045[_0x3f16('0x8')](0x8*0x3c*0x3c*0x3e8);_0xb7e352[_0x3f16('0x6')](_0x3f16('0x7'));_0xb7e352['on'](_0x3f16('0x9'),function(_0x258189){for(var _0x28eaae in _0x258189){_0x505606[_0x28eaae]=_0x258189[_0x28eaae];}_0x505606[_0x3f16('0xa')]('ready');});_0xb7e352['on'](_0x3f16('0xb'),function(_0x204899){if(_0x204899[_0x3f16('0xc')]()==_0x3f16('0xd')){_0x505606[_0x3f16('0xa')](_0x3f16('0xd'));return;}if(_0x204899['substring'](0x0,0xb)==_0x3f16('0xe')){_0x2accc4=!![];}if(_0x2accc4){_0x5771b7['rx']+=_0x204899+'\x0a';if(_0x204899['search'](_0x3f16('0xf'))!=-0x1){_0x2accc4=![];}}else{_0x5771b7['rx']=_0x204899;}if(_0x2accc4){return;}if(typeof _0x5771b7['cb']==_0x3f16('0x10')){var _0xd36fd0=_0x5771b7['rx'][_0x3f16('0x11')](0x0,0x3),_0x101158=null,_0x1e7330=null;_0xd36fd0=parseInt(_0xd36fd0);if(isNaN(_0xd36fd0)){_0x5771b7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xd36fd0!=0xc8){_0x5771b7['cb'](null,{'code':_0xd36fd0,'result':-0x1,'extra':'KO'});return;}_0x101158=_0x5771b7['rx'][_0x3f16('0x11')](0x4)[_0x3f16('0x12')](_0x3f16('0x13'),'');if(_0x101158[_0x3f16('0x14')]('\x20')!=-0x1){_0x101158=_0x101158[_0x3f16('0x15')](0x0,_0x101158['indexOf']('\x20'));}if(_[_0x3f16('0x16')](_0x101158,'-1')){_0x101158=parseInt(_0x101158);}_0x1e7330=_0x5771b7['rx']['split']('\x20');if(_0x1e7330[_0x3f16('0x17')]==0x3){_0x1e7330=_0x1e7330[0x2][_0x3f16('0x11')](0x1,_0x1e7330[0x2][_0x3f16('0x17')]-0x1);}else if(_0x1e7330[_0x3f16('0x17')]>0x3){var _0x17bf34=/\((.+)\)/;var _0x164041=_0x5771b7['rx'][_0x3f16('0x18')](_0x17bf34);if(_0x164041){_0x1e7330=_0x164041[0x1];}else{_0x1e7330=null;}}else{_0x1e7330=null;}_0x5771b7['cb'](null,{'code':_0xd36fd0,'result':_0x101158,'extra':_0x1e7330});}});_0x3b5045['on'](_0x3f16('0x19'),function(_0x2fae0f){_0x505606[_0x3f16('0xa')](_0x3f16('0x19'),new AGIError(_0x3f16('0x1a'),_0x2fae0f[_0x3f16('0x1b')]));});_0x3b5045['on'](_0x3f16('0x1c'),function(){_0x505606[_0x3f16('0xa')](_0x3f16('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3b5045['on'](_0x3f16('0x1d'),function(){_0x505606['emit'](_0x3f16('0x1d'),new AGIError(_0x3f16('0x1e')));_0x3b5045[_0x3f16('0x1f')]();});_0x3b5045[_0x3f16('0x20')](_0xb7e352);this['command']=function(_0x27bba9,_0xd451c6){var _0x27bba9=_0x27bba9||'',_0xd451c6=typeof _0xd451c6==_0x3f16('0x10')?_0xd451c6:new Function();_0x5771b7={'tx':_0x27bba9,'rx':'','cb':_0xd451c6};_0x3b5045[_0x3f16('0x21')](_0x27bba9+'\x0a');},this[_0x3f16('0x1c')]=function(){_0x3b5045[_0x3f16('0x1f')]();};}util[_0x3f16('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x3f16('0x23')]['sendRequest']=function(_0x2ef2a5){return this['command'][_0x3f16('0x24')](this,_0x2ef2a5);};AGIChannel[_0x3f16('0x23')][_0x3f16('0x25')]=function(){return this[_0x3f16('0x26')]('ANSWER');};AGIChannel['prototype'][_0x3f16('0x27')]=function(_0x20261f,_0x1f18eb,_0xfe2506){_0x20261f=_0x20261f===undefined?_0x3f16('0x28'):_0x20261f;_0x1f18eb=_0x1f18eb===undefined?'5':_0x1f18eb;_0xfe2506=_0xfe2506===undefined?'1':_0xfe2506;return this[_0x3f16('0x26')](util[_0x3f16('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x20261f,_0x1f18eb*0x3e8,_0xfe2506));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x2a')]=function(_0x48227f){_0x48227f=_0x48227f||'NO\x20MESSAGE';return this[_0x3f16('0x26')](util[_0x3f16('0x29')]('VERBOSE\x20\x22%s\x22',_0x48227f));};AGIChannel['prototype'][_0x3f16('0x2b')]=function(_0x3048d4,_0x52a045){if(_['isArray'](_0x52a045)){return this[_0x3f16('0x26')](util[_0x3f16('0x29')](_0x3f16('0x2c'),_0x3048d4,_0x52a045[_0x3f16('0x2d')](',')));}return this[_0x3f16('0x26')](util[_0x3f16('0x29')]('EXEC\x20%s\x20%s',_0x3048d4,_0x52a045));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x2e')]=function(_0x1e19bb){return this[_0x3f16('0x26')](util[_0x3f16('0x29')](_0x3f16('0x2f'),_0x1e19bb));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x30')]=function(_0x229ce8){return this['sendRequest'](util['format'](_0x3f16('0x31'),_0x229ce8));};AGIChannel[_0x3f16('0x23')]['setPriority']=function(_0x1ad98b){return this[_0x3f16('0x26')](util[_0x3f16('0x29')](_0x3f16('0x32'),_0x1ad98b));};AGIChannel[_0x3f16('0x23')][_0x3f16('0xd')]=function(){return this['sendRequest'](_0x3f16('0x33'));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x34')]=function(_0xb6535e,_0x1351a5){var _0xefadf0=_[_0x3f16('0x35')](_0x1351a5)||_[_0x3f16('0x36')](_0x1351a5)?_0x1351a5[_0x3f16('0x37')]():_0x1351a5;return this[_0x3f16('0x26')](util[_0x3f16('0x29')](_0x3f16('0x38'),_0xb6535e,_0xefadf0?_0xefadf0['toString']()[_0x3f16('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x39')]=function(_0x2a08b7,_0xc0f6d6){return this[_0x3f16('0x26')](util[_0x3f16('0x29')](_0x3f16('0x3a'),_0x2a08b7,_0xc0f6d6));};AGIChannel['prototype'][_0x3f16('0x3b')]=function(_0xfec238,_0x2dc2a8){return this[_0x3f16('0x26')](util[_0x3f16('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0xfec238,_0x2dc2a8));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x3c')]=function(_0x30c708,_0x1240a6){return this['sendRequest'](util[_0x3f16('0x29')](_0x3f16('0x3d'),_0x30c708,_0x1240a6));};AGIChannel[_0x3f16('0x23')][_0x3f16('0x3e')]=function(_0x596679,_0x4ad275,_0x1288e1){_0x4ad275=_0x4ad275||this[_0x3f16('0x3f')];_0x1288e1=_0x1288e1||0x1;this[_0x3f16('0x2e')](_0x596679);this[_0x3f16('0x30')](_0x4ad275);this[_0x3f16('0x40')](_0x1288e1);return this[_0x3f16('0x2a')](util[_0x3f16('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x596679,_0x4ad275,_0x1288e1));};AGIChannel[_0x3f16('0x23')]['getVariable']=function(_0x14720c){return this[_0x3f16('0x26')](util[_0x3f16('0x29')](_0x3f16('0x41'),_0x14720c));};AGIChannel[_0x3f16('0x23')]['recordFile']=function(_0xd0a629,_0x3a65bc,_0x18bf96,_0x198c68,_0x2c2909,_0x59df2f){_0x3a65bc=_0x3a65bc||_0x3f16('0x42');_0x18bf96=_0x18bf96||'';_0x198c68=_0x198c68===undefined?-0x1:_0x198c68==='-1'?-0x1:_0x198c68*0x3e8;_0x2c2909=_0x2c2909===undefined?'':'s='+_0x2c2909;_0x59df2f=_0x59df2f?_0x3f16('0x43'):'';return this[_0x3f16('0x26')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0xd0a629,_0x3a65bc,_0x18bf96,_0x198c68,_0x59df2f,_0x2c2909));};AGIChannel[_0x3f16('0x23')]['streamFile']=function(_0x1fdc2e,_0x108f46){_0x108f46=_0x108f46||'';return this[_0x3f16('0x26')](util[_0x3f16('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1fdc2e,_0x108f46));};AGIChannel[_0x3f16('0x23')]['agi']=function(_0x35a895){return this['exec'](_0x3f16('0x44'),_0x35a895);};AGIChannel[_0x3f16('0x23')]['wait']=function(_0x52d7b2){return this[_0x3f16('0x2b')](_0x3f16('0x45'),_0x52d7b2);};AGIChannel[_0x3f16('0x23')]['error']=function(_0x1faf08,_0x176069){this[_0x3f16('0x2a')](util[_0x3f16('0x29')](_0x3f16('0x46'),_0x1faf08['id'],_0x1faf08['label'],_0x176069));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3f16('0x47')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index bcaafe2..c3f6ff9 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 _0xdf18=['util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports'];(function(_0x5a6949,_0x428667){var _0x523b4d=function(_0x31e02a){while(--_0x31e02a){_0x5a6949['push'](_0x5a6949['shift']());}};_0x523b4d(++_0x428667);}(_0xdf18,0xc3));var _0x8df1=function(_0x2c4ef4,_0x21ffd7){_0x2c4ef4=_0x2c4ef4-0x0;var _0xb5b9f0=_0xdf18[_0x2c4ef4];return _0xb5b9f0;};'use strict';var util=require(_0x8df1('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x8df1('0x1'),'E_AGI_SERVER_ERROR':_0x8df1('0x2'),'E_AGI_SERVER_CLOSE':_0x8df1('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x8df1('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x8df1('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x8df1('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8df1('0x7'),'E_AGI_IVR_ENTRY':_0x8df1('0x8')};function AGIError(_0x4729bf){var _0x4729bf=_0x4729bf||null,_0x3e6035=_0x3e6035||[],_0x22bff1=0x1,_0x235dae='';if(!error[_0x4729bf]){_0x4729bf=_0x8df1('0x9');}_0x3e6035[_0x8df1('0xa')](error[_0x4729bf]);while(arguments[_0x22bff1]){_0x3e6035[_0x8df1('0xa')](arguments[_0x22bff1]);_0x22bff1++;}_0x235dae=util[_0x8df1('0xb')][_0x8df1('0xc')](util,_0x3e6035);this[_0x8df1('0xd')]=_0x235dae;this['name']=_0x4729bf;}module[_0x8df1('0xe')]=AGIError; \ No newline at end of file +var _0x5fbb=['Undefined\x20error.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','exports','util'];(function(_0x22cd62,_0x3f322d){var _0x5e8bf3=function(_0x19319c){while(--_0x19319c){_0x22cd62['push'](_0x22cd62['shift']());}};_0x5e8bf3(++_0x3f322d);}(_0x5fbb,0xc2));var _0xb5fb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5fbb[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0xb5fb('0x0'));var error={'E_AGI_UNDEFINED':_0xb5fb('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xb5fb('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xb5fb('0x3'),'E_AGI_SOCKET_ERROR':_0xb5fb('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xb5fb('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb5fb('0x6'),'E_AGI_IVR_ENTRY':_0xb5fb('0x7')};function AGIError(_0x16ddaa){var _0x16ddaa=_0x16ddaa||null,_0x2ea41d=_0x2ea41d||[],_0x22a15c=0x1,_0x19ad60='';if(!error[_0x16ddaa]){_0x16ddaa='E_AGI_UNDEFINED';}_0x2ea41d[_0xb5fb('0x8')](error[_0x16ddaa]);while(arguments[_0x22a15c]){_0x2ea41d[_0xb5fb('0x8')](arguments[_0x22a15c]);_0x22a15c++;}_0x19ad60=util[_0xb5fb('0x9')][_0xb5fb('0xa')](util,_0x2ea41d);this[_0xb5fb('0xb')]=_0x19ad60;this['name']=_0x16ddaa;}module[_0xb5fb('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index b6080a7..3a0e609 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 _0xb78d=['vswitch','target','default','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand'];(function(_0x2cd0f5,_0x44682c){var _0x506c12=function(_0x122633){while(--_0x122633){_0x2cd0f5['push'](_0x2cd0f5['shift']());}};_0x506c12(++_0x44682c);}(_0xb78d,0x164));var _0xdb78=function(_0x4fc94c,_0x467582){_0x4fc94c=_0x4fc94c-0x0;var _0x176464=_0xb78d[_0x4fc94c];return _0x176464;};'use strict';var _=require(_0xdb78('0x0'));var logger=require(_0xdb78('0x1'))('agi');var verticesWithRetry=[_0xdb78('0x2'),'getdigits',_0xdb78('0x3')];var Graph=function(){this[_0xdb78('0x4')]={};this[_0xdb78('0x5')]={};this[_0xdb78('0x6')]=0x0;};Graph[_0xdb78('0x7')][_0xdb78('0x8')]=function(_0xd65ee4){this[_0xdb78('0x4')][_0xd65ee4['id']]=_0xd65ee4;this[_0xdb78('0x5')][_0xd65ee4['id']]=[];};Graph[_0xdb78('0x7')]['addEdge']=function(_0x2c0b3c,_0x4def51,_0x4de0a4){this[_0xdb78('0x5')][_0x2c0b3c][_0xdb78('0x9')]({'target':_0x4def51,'condition':_0x4de0a4});this[_0xdb78('0x6')]+=0x1;};Graph[_0xdb78('0x7')][_0xdb78('0xa')]=function(){return _[_0xdb78('0xa')](this[_0xdb78('0x4')]);};Graph[_0xdb78('0x7')][_0xdb78('0xb')]=function(){return this[_0xdb78('0x6')];};Graph['prototype']['getVertex']=function(_0x3f86fb){return this[_0xdb78('0x4')][_0x3f86fb];};Graph[_0xdb78('0x7')][_0xdb78('0xc')]=function(_0x1802d3,_0x27adbc){if(!this[_0xdb78('0x4')][_0x1802d3]){return logger[_0xdb78('0xd')](_0xdb78('0xe'));}var _0x3f8c55=_0x27adbc(this[_0xdb78('0x4')][_0x1802d3]);if(!_0x3f8c55){return logger['info'](_0xdb78('0xf'));}if(this[_0xdb78('0x5')][_0x1802d3][_0xdb78('0x10')]===0x0){return logger[_0xdb78('0xd')](_0xdb78('0x11'));}for(var _0x58cd95=0x0,_0x44e20d=[],_0xe49ce8=![];_0x58cd95\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','format','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xcc29,0x182));var _0x9cc2=function(_0x4394ba,_0x5a2f5d){_0x4394ba=_0x4394ba-0x0;var _0x1e35fa=_0xcc29[_0x4394ba];return _0x1e35fa;};'use strict';var parser=require(_0x9cc2('0x0'));var _=require('lodash');var syncho=require(_0x9cc2('0x1'));var util=require(_0x9cc2('0x2'));var moment=require(_0x9cc2('0x3'));var config=require(_0x9cc2('0x4'));var logger=require(_0x9cc2('0x5'))(_0x9cc2('0x6'));var utilLicense=require(_0x9cc2('0x7'));var rpc=require(_0x9cc2('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x9cc2('0x9'));var Vertices=require(_0x9cc2('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9cc2('0x6')]=_['defaults'](config[_0x9cc2('0x6')],{'ip':_0x9cc2('0xb'),'port':0x11dd});function connectionHandler(_0x3dcaac){process[_0x9cc2('0xc')](function(){syncho(function(){try{setChannelVariables(_0x3dcaac);agiHandler(_0x3dcaac);}catch(_0x2a2faa){logger[_0x9cc2('0xd')](_0x2a2faa[_0x9cc2('0xe')]);}});});}function listeningHandler(){console[_0x9cc2('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9cc2('0x6')][_0x9cc2('0x10')]);logger[_0x9cc2('0x11')](util['format'](_0x9cc2('0x12'),config['agi']['ip'],config[_0x9cc2('0x6')][_0x9cc2('0x10')]));}function errorHandler(_0x125719){if(_0x125719&&_0x125719['name']&&_0x125719[_0x9cc2('0x13')]){logger[_0x9cc2('0xd')](util[_0x9cc2('0x14')]('[%s]\x20%s',_0x125719[_0x9cc2('0x15')],_0x125719[_0x9cc2('0x13')]));}else{logger['error'](util[_0x9cc2('0x14')]('[ERROR]\x20%s',_0x125719[_0x9cc2('0xe')]));}}function closeHandler(){logger[_0x9cc2('0x11')](util['format'](_0x9cc2('0x16'),this[_0x9cc2('0x17')],this[_0x9cc2('0x18')],this['callerid'],this[_0x9cc2('0x19')],this[_0x9cc2('0x1a')]));try{createSquareReport(this);}catch(_0x3a6dcc){logger['error'](_0x3a6dcc[_0x9cc2('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x9cc2('0x14')](_0x9cc2('0x1b'),this[_0x9cc2('0x17')],this[_0x9cc2('0x18')],this[_0x9cc2('0x1c')],this[_0x9cc2('0x19')],this[_0x9cc2('0x1a')]));}function hangupHandler(){logger[_0x9cc2('0x11')](util['format'](_0x9cc2('0x1d'),this[_0x9cc2('0x17')],this[_0x9cc2('0x18')],this[_0x9cc2('0x1c')],this['dnid'],this['uniqueid']));this[_0x9cc2('0x1e')]=!![];}function getRoot(_0x358407){return parser[_0x9cc2('0x1f')](_0x358407,{'object':!![]})[_0x9cc2('0x20')]['root'];}function addVertex(_0x435a5e,_0x5e5e45,_0x470eed){_0x5e5e45[_0x9cc2('0x21')]=_0x470eed;if(_0x5e5e45[_0x9cc2('0x22')]('retry')){_0x5e5e45[_0x9cc2('0x23')]=parseInt(_0x5e5e45['retry'],0xa);}_0x435a5e[_0x9cc2('0x24')](_['omit'](_0x5e5e45,_0x9cc2('0x25')));}function initGraph(_0x583e6c,_0x109011){var _0x33f4bb=new Graph();for(var _0x20239e in _0x583e6c){if(_0x583e6c['hasOwnProperty'](_0x20239e)){if(_[_0x9cc2('0x26')](_0x583e6c[_0x20239e])){for(var _0x25969e=0x0;_0x25969e<_0x583e6c[_0x20239e][_0x9cc2('0x27')];_0x25969e+=0x1){addVertex(_0x33f4bb,_0x583e6c[_0x20239e][_0x25969e],_0x20239e);}}else{addVertex(_0x33f4bb,_0x583e6c[_0x20239e],_0x20239e);}}}for(var _0x2f2b2f=0x0;_0x2f2b2f<_0x109011[_0x9cc2('0x27')];_0x2f2b2f+=0x1){if(_0x109011[_0x2f2b2f][_0x9cc2('0x28')]&&_0x109011[_0x2f2b2f][_0x9cc2('0x29')]){_0x33f4bb[_0x9cc2('0x2a')](_0x109011[_0x2f2b2f][_0x9cc2('0x28')],_0x109011[_0x2f2b2f][_0x9cc2('0x29')],_0x109011[_0x2f2b2f]['value']);}}return _0x33f4bb;}function getSquareProject(_0x1c298b,_0x46e399){rpc[_0x9cc2('0x2b')](_0x1c298b)[_0x9cc2('0x2c')](function(_0x79c0ff){_0x46e399(null,_0x79c0ff);})[_0x9cc2('0x2d')](function(_0x4f8ba4){_0x46e399(null,_0x4f8ba4);});}function createSquareReport(_0x285900,_0x50ed70){rpc[_0x9cc2('0x2e')](_0x285900)[_0x9cc2('0x2c')](function(_0x153457){if(_0x50ed70){_0x50ed70(null,_0x153457);}})[_0x9cc2('0x2d')](function(_0x56e725){if(_0x50ed70){_0x50ed70(null,_0x56e725);}});}function setChannelVariables(_0x538116){for(var _0x1041db in _0x538116){if(_0x538116[_0x9cc2('0x22')](_0x1041db)){if(_0x1041db[_0x9cc2('0x2f')](_0x9cc2('0x30'))===0x0){_0x538116[_0x1041db[_0x9cc2('0x31')](0x4)]=_0x538116[_0x1041db];delete _0x538116[_0x1041db];}}}}function getLogFromObject(_0x2ab0a9){return util[_0x9cc2('0x32')](_0x2ab0a9,{'showHidden':![],'depth':null});}function agiHandler(_0x4090ca){var _0xbe396d,_0x4aa9ad,_0x3fb19e,_0x2cbb1a,_0x6e3e29;logger[_0x9cc2('0x33')]('variables',JSON['stringify'](_0x4090ca,null,0x2));logger['info'](util[_0x9cc2('0x14')](_0x9cc2('0x34'),_0x4090ca['arg_1'],_0x4090ca[_0x9cc2('0x18')],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca['dnid'],_0x4090ca['uniqueid']));_0x4090ca['on'](_0x9cc2('0xd'),errorHandler);_0x4090ca['on'](_0x9cc2('0x35'),closeHandler);_0x4090ca['on'](_0x9cc2('0x36'),timeoutHandler);_0x4090ca[_0x9cc2('0x1e')]=![];_0x4090ca['on']('hangup',hangupHandler);var _0x27db02=getSquareProject[_0x9cc2('0x37')](null,_0x4090ca[_0x9cc2('0x17')]);if(_0x27db02){if(_0x27db02[_0x9cc2('0x38')]){_0xbe396d=getRoot(_0x27db02['production']);if(_0xbe396d&&_0xbe396d['start']){logger['debug'](_0x9cc2('0x39'),JSON[_0x9cc2('0x3a')](_0xbe396d,null,0x2));_0x4090ca[_0x9cc2('0x3b')]=moment()[_0x9cc2('0x14')](_0x9cc2('0x3c'));_0x4aa9ad=initGraph(_[_0x9cc2('0x3d')](_0xbe396d,_0x9cc2('0x25')),_0xbe396d['mxCell']);_0x3fb19e=new Vertices(_0x4090ca,rpc,mailRpc);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4090ca[_0x9cc2('0x17')],_0x4090ca['calleridname'],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca[_0x9cc2('0x19')],_0x4090ca[_0x9cc2('0x1a')]));_0x4aa9ad['traverseBFS'](_0xbe396d[_0x9cc2('0x3e')]['id'],function(_0x54a560){try{_0x54a560=_0x3fb19e[_0x9cc2('0x3f')](_0x54a560);logger[_0x9cc2('0x33')](_0x9cc2('0x40'),JSON['stringify'](_0x54a560,null,0x2));if(_0x54a560['agicommand']===_0x9cc2('0x41')){logger['info'](_0x9cc2('0x42'));_0x4090ca['context']=_0x54a560['context']||_0x4090ca[_0x9cc2('0x43')];_0x4090ca[_0x9cc2('0x44')]=_0x54a560[_0x9cc2('0x44')];_0x4090ca['priority']=_0x54a560[_0x9cc2('0x45')]?_0x54a560['priority']-0x1:0x1;return null;}else if(_0x54a560&&_0x3fb19e[_0x54a560['agicommand']]){_0x6e3e29=_0x3fb19e[_0x54a560[_0x9cc2('0x21')]](_0x54a560);logger[_0x9cc2('0x11')]('response',JSON[_0x9cc2('0x3a')](_0x6e3e29,null,0x2));if(_0x6e3e29&&_0x6e3e29[_0x9cc2('0x46')]===AGI_CODE_SUCCESS&&_0x6e3e29[_0x9cc2('0x47')]!==AGI_RESULT_ERROR&&!_0x4090ca[_0x9cc2('0x1e')]){logger[_0x9cc2('0x33')](_0x9cc2('0x48'),getLogFromObject(_0x6e3e29));return _[_0x9cc2('0x49')](_0x6e3e29[_0x9cc2('0x47')])?null:_0x6e3e29['result'][_0x9cc2('0x4a')]();}else{logger[_0x9cc2('0xd')](_0x9cc2('0x48'),getLogFromObject(_0x6e3e29));return null;}}else{logger[_0x9cc2('0xd')](_0x9cc2('0x4b'));return null;}}catch(_0x772c75){logger[_0x9cc2('0xd')](_0x772c75[_0x9cc2('0xe')]);return null;}});if(_0xbe396d[_0x9cc2('0x4c')]){logger['info'](util['format'](_0x9cc2('0x4d'),_0x4090ca['arg_1'],_0x4090ca[_0x9cc2('0x18')],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca['dnid'],_0x4090ca['uniqueid']));_0x4aa9ad[_0x9cc2('0x4e')](_0xbe396d[_0x9cc2('0x4c')]['id'],function(_0x489eb8){try{_0x489eb8=_0x3fb19e[_0x9cc2('0x3f')](_0x489eb8);logger[_0x9cc2('0x33')](_0x9cc2('0x40'),JSON[_0x9cc2('0x3a')](_0x489eb8,null,0x2));if(_0x489eb8&&_0x3fb19e[_0x489eb8[_0x9cc2('0x21')]]){_0x6e3e29=_0x3fb19e[_0x489eb8[_0x9cc2('0x21')]](_0x489eb8);if(_0x6e3e29){logger[_0x9cc2('0x33')](_0x9cc2('0x48'),getLogFromObject(_0x6e3e29));return _[_0x9cc2('0x49')](_0x6e3e29[_0x9cc2('0x47')])?null:_0x6e3e29[_0x9cc2('0x47')][_0x9cc2('0x4a')]();}else{logger['error']('response',getLogFromObject(_0x6e3e29));return null;}}else{logger[_0x9cc2('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x20d28a){logger['error'](_0x20d28a[_0x9cc2('0xe')]);return null;}});}logger['info'](util[_0x9cc2('0x14')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4090ca[_0x9cc2('0x17')],_0x4090ca[_0x9cc2('0x18')],_0x4090ca[_0x9cc2('0x1c')],_0x4090ca['dnid'],_0x4090ca['uniqueid']));logger[_0x9cc2('0x11')](util[_0x9cc2('0x14')](_0x9cc2('0x4f'),_0x4090ca[_0x9cc2('0x43')],_0x4090ca[_0x9cc2('0x44')],parseInt(_0x4090ca['priority'],0xa)+0x1));_0x4090ca['continueAt'](_0x4090ca[_0x9cc2('0x43')],_0x4090ca[_0x9cc2('0x44')],parseInt(_0x4090ca[_0x9cc2('0x45')],0xa)+0x1);_0x4090ca[_0x9cc2('0x35')]();}}else{logger[_0x9cc2('0xd')](util[_0x9cc2('0x14')](_0x9cc2('0x50'),_0x4090ca['arg_1']));_0x4090ca[_0x9cc2('0x51')](_0x4090ca['context'],_0x4090ca['extension'],parseInt(_0x4090ca[_0x9cc2('0x45')],0xa)+0x1);_0x4090ca['close']();}}else{logger['error'](util[_0x9cc2('0x14')](_0x9cc2('0x52'),_0x4090ca[_0x9cc2('0x17')]));_0x4090ca['continueAt'](_0x4090ca[_0x9cc2('0x43')],_0x4090ca['extension'],parseInt(_0x4090ca[_0x9cc2('0x45')],0xa)+0x1);_0x4090ca[_0x9cc2('0x35')]();}}function main(){var _0x39021e;return utilLicense[_0x9cc2('0x53')]()['then'](function(_0x46b436){if(_0x46b436){if(_0x46b436['voice']){if(_0x46b436[_0x9cc2('0x54')]&&_0x46b436[_0x9cc2('0x54')]>0x0){logger['info'](util[_0x9cc2('0x14')](_0x9cc2('0x55'),_0x46b436[_0x9cc2('0x54')]));_0x39021e=_0x46b436[_0x9cc2('0x54')];}else{logger[_0x9cc2('0x11')](_0x9cc2('0x56'));}}else{logger[_0x9cc2('0x11')](_0x9cc2('0x57'));_0x39021e=-0x1;}}})[_0x9cc2('0x2d')](function(_0x39107a){logger[_0x9cc2('0xd')](_0x9cc2('0x58'),_0x39107a[_0x9cc2('0xe')]);})[_0x9cc2('0x4c')](function(){var _0x3cfa87=require(_0x9cc2('0x59'))(config[_0x9cc2('0x6')]['port'],config[_0x9cc2('0x6')]['ip'],_0x39021e);_0x3cfa87['on']('error',errorHandler);_0x3cfa87['on'](_0x9cc2('0x5a'),listeningHandler);_0x3cfa87['on'](_0x9cc2('0x5b'),connectionHandler);_0x3cfa87['on'](_0x9cc2('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0xcea5=['close','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','start','clear','vertex','context','extension','priority','code','result','response','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','omit','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xcea5,0x1cf));var _0x5cea=function(_0x210bd1,_0x18b3f8){_0x210bd1=_0x210bd1-0x0;var _0x32d1da=_0xcea5[_0x210bd1];return _0x32d1da;};'use strict';var parser=require(_0x5cea('0x0'));var _=require(_0x5cea('0x1'));var syncho=require(_0x5cea('0x2'));var util=require('util');var moment=require(_0x5cea('0x3'));var config=require(_0x5cea('0x4'));var logger=require(_0x5cea('0x5'))(_0x5cea('0x6'));var utilLicense=require(_0x5cea('0x7'));var rpc=require(_0x5cea('0x8'));var mailRpc=require(_0x5cea('0x9'));var Graph=require(_0x5cea('0xa'));var Vertices=require(_0x5cea('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5cea('0x6')]=_['defaults'](config[_0x5cea('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x39393b){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x39393b);agiHandler(_0x39393b);}catch(_0x296611){logger[_0x5cea('0xc')](_0x296611['stack']);}});});}function listeningHandler(){console[_0x5cea('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x5cea('0x6')][_0x5cea('0xe')]);logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x11'),config[_0x5cea('0x6')]['ip'],config['agi'][_0x5cea('0xe')]));}function errorHandler(_0x2f6816){if(_0x2f6816&&_0x2f6816[_0x5cea('0x12')]&&_0x2f6816[_0x5cea('0x13')]){logger[_0x5cea('0xc')](util['format'](_0x5cea('0x14'),_0x2f6816[_0x5cea('0x12')],_0x2f6816[_0x5cea('0x13')]));}else{logger['error'](util[_0x5cea('0x10')]('[ERROR]\x20%s',_0x2f6816[_0x5cea('0x15')]));}}function closeHandler(){logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x16'),this[_0x5cea('0x17')],this[_0x5cea('0x18')],this[_0x5cea('0x19')],this[_0x5cea('0x1a')],this[_0x5cea('0x1b')]));try{createSquareReport(this);}catch(_0x2d9301){logger[_0x5cea('0xc')](_0x2d9301[_0x5cea('0x15')]);}}function timeoutHandler(){logger[_0x5cea('0xf')](util[_0x5cea('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x5cea('0x17')],this['calleridname'],this['callerid'],this[_0x5cea('0x1a')],this[_0x5cea('0x1b')]));}function hangupHandler(){logger['info'](util['format'](_0x5cea('0x1c'),this[_0x5cea('0x17')],this[_0x5cea('0x18')],this[_0x5cea('0x19')],this[_0x5cea('0x1a')],this[_0x5cea('0x1b')]));this[_0x5cea('0x1d')]=!![];}function getRoot(_0x259aed){return parser[_0x5cea('0x1e')](_0x259aed,{'object':!![]})[_0x5cea('0x1f')][_0x5cea('0x20')];}function addVertex(_0xdd405f,_0x28a04f,_0x164f5e){_0x28a04f[_0x5cea('0x21')]=_0x164f5e;if(_0x28a04f[_0x5cea('0x22')](_0x5cea('0x23'))){_0x28a04f[_0x5cea('0x24')]=parseInt(_0x28a04f[_0x5cea('0x23')],0xa);}_0xdd405f['addVertex'](_[_0x5cea('0x25')](_0x28a04f,'mxCell'));}function initGraph(_0x4a245b,_0x5ec18b){var _0x1fa2c1=new Graph();for(var _0x378c7a in _0x4a245b){if(_0x4a245b[_0x5cea('0x22')](_0x378c7a)){if(_[_0x5cea('0x26')](_0x4a245b[_0x378c7a])){for(var _0x780ced=0x0;_0x780ced<_0x4a245b[_0x378c7a]['length'];_0x780ced+=0x1){addVertex(_0x1fa2c1,_0x4a245b[_0x378c7a][_0x780ced],_0x378c7a);}}else{addVertex(_0x1fa2c1,_0x4a245b[_0x378c7a],_0x378c7a);}}}for(var _0x1d0013=0x0;_0x1d0013<_0x5ec18b[_0x5cea('0x27')];_0x1d0013+=0x1){if(_0x5ec18b[_0x1d0013]['source']&&_0x5ec18b[_0x1d0013][_0x5cea('0x28')]){_0x1fa2c1[_0x5cea('0x29')](_0x5ec18b[_0x1d0013][_0x5cea('0x2a')],_0x5ec18b[_0x1d0013]['target'],_0x5ec18b[_0x1d0013][_0x5cea('0x2b')]);}}return _0x1fa2c1;}function getSquareProject(_0xf22d21,_0xd6087f){rpc[_0x5cea('0x2c')](_0xf22d21)[_0x5cea('0x2d')](function(_0x54225f){_0xd6087f(null,_0x54225f);})[_0x5cea('0x2e')](function(_0x25122b){_0xd6087f(null,_0x25122b);});}function createSquareReport(_0x2ef8ec,_0x3d22b9){rpc[_0x5cea('0x2f')](_0x2ef8ec)['then'](function(_0x459a40){if(_0x3d22b9){_0x3d22b9(null,_0x459a40);}})['catch'](function(_0x4a0907){if(_0x3d22b9){_0x3d22b9(null,_0x4a0907);}});}function setChannelVariables(_0x6e6aa0){for(var _0xbc807a in _0x6e6aa0){if(_0x6e6aa0[_0x5cea('0x22')](_0xbc807a)){if(_0xbc807a['indexOf']('agi_')===0x0){_0x6e6aa0[_0xbc807a[_0x5cea('0x30')](0x4)]=_0x6e6aa0[_0xbc807a];delete _0x6e6aa0[_0xbc807a];}}}}function getLogFromObject(_0x495ab3){return util['inspect'](_0x495ab3,{'showHidden':![],'depth':null});}function agiHandler(_0x3aa3a9){var _0x5c95f5,_0x4cadcd,_0xa3341e,_0x55ca3f,_0x3b104f;logger[_0x5cea('0x31')](_0x5cea('0x32'),JSON[_0x5cea('0x33')](_0x3aa3a9,null,0x2));logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x34'),_0x3aa3a9[_0x5cea('0x17')],_0x3aa3a9[_0x5cea('0x18')],_0x3aa3a9[_0x5cea('0x19')],_0x3aa3a9[_0x5cea('0x1a')],_0x3aa3a9[_0x5cea('0x1b')]));_0x3aa3a9['on'](_0x5cea('0xc'),errorHandler);_0x3aa3a9['on'](_0x5cea('0x35'),closeHandler);_0x3aa3a9['on']('timeout',timeoutHandler);_0x3aa3a9[_0x5cea('0x1d')]=![];_0x3aa3a9['on'](_0x5cea('0x36'),hangupHandler);var _0x4e9246=getSquareProject[_0x5cea('0x37')](null,_0x3aa3a9[_0x5cea('0x17')]);if(_0x4e9246){if(_0x4e9246[_0x5cea('0x38')]){_0x5c95f5=getRoot(_0x4e9246['production']);if(_0x5c95f5&&_0x5c95f5['start']){logger['debug'](_0x5cea('0x20'),JSON[_0x5cea('0x33')](_0x5c95f5,null,0x2));_0x3aa3a9[_0x5cea('0x39')]=moment()[_0x5cea('0x10')](_0x5cea('0x3a'));_0x4cadcd=initGraph(_[_0x5cea('0x25')](_0x5c95f5,'mxCell'),_0x5c95f5[_0x5cea('0x3b')]);_0xa3341e=new Vertices(_0x3aa3a9,rpc,mailRpc);logger[_0x5cea('0xf')](util[_0x5cea('0x10')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3aa3a9[_0x5cea('0x17')],_0x3aa3a9['calleridname'],_0x3aa3a9[_0x5cea('0x19')],_0x3aa3a9[_0x5cea('0x1a')],_0x3aa3a9[_0x5cea('0x1b')]));_0x4cadcd['traverseBFS'](_0x5c95f5[_0x5cea('0x3c')]['id'],function(_0x495ae3){try{_0x495ae3=_0xa3341e[_0x5cea('0x3d')](_0x495ae3);logger[_0x5cea('0x31')](_0x5cea('0x3e'),JSON[_0x5cea('0x33')](_0x495ae3,null,0x2));if(_0x495ae3['agicommand']==='gotoc'){logger[_0x5cea('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3aa3a9[_0x5cea('0x3f')]=_0x495ae3['context']||_0x3aa3a9[_0x5cea('0x3f')];_0x3aa3a9[_0x5cea('0x40')]=_0x495ae3[_0x5cea('0x40')];_0x3aa3a9[_0x5cea('0x41')]=_0x495ae3[_0x5cea('0x41')]?_0x495ae3[_0x5cea('0x41')]-0x1:0x1;return null;}else if(_0x495ae3&&_0xa3341e[_0x495ae3[_0x5cea('0x21')]]){_0x3b104f=_0xa3341e[_0x495ae3[_0x5cea('0x21')]](_0x495ae3);logger[_0x5cea('0xf')]('response',JSON[_0x5cea('0x33')](_0x3b104f,null,0x2));if(_0x3b104f&&_0x3b104f[_0x5cea('0x42')]===AGI_CODE_SUCCESS&&_0x3b104f[_0x5cea('0x43')]!==AGI_RESULT_ERROR&&!_0x3aa3a9[_0x5cea('0x1d')]){logger[_0x5cea('0x31')](_0x5cea('0x44'),getLogFromObject(_0x3b104f));return _[_0x5cea('0x45')](_0x3b104f['result'])?null:_0x3b104f[_0x5cea('0x43')][_0x5cea('0x46')]();}else{logger[_0x5cea('0xc')](_0x5cea('0x44'),getLogFromObject(_0x3b104f));return null;}}else{logger[_0x5cea('0xc')](_0x5cea('0x47'));return null;}}catch(_0x4609e9){logger['error'](_0x4609e9[_0x5cea('0x15')]);return null;}});if(_0x5c95f5['finally']){logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x48'),_0x3aa3a9[_0x5cea('0x17')],_0x3aa3a9['calleridname'],_0x3aa3a9['callerid'],_0x3aa3a9[_0x5cea('0x1a')],_0x3aa3a9[_0x5cea('0x1b')]));_0x4cadcd[_0x5cea('0x49')](_0x5c95f5[_0x5cea('0x4a')]['id'],function(_0x4c0def){try{_0x4c0def=_0xa3341e[_0x5cea('0x3d')](_0x4c0def);logger[_0x5cea('0x31')](_0x5cea('0x3e'),JSON[_0x5cea('0x33')](_0x4c0def,null,0x2));if(_0x4c0def&&_0xa3341e[_0x4c0def['agicommand']]){_0x3b104f=_0xa3341e[_0x4c0def['agicommand']](_0x4c0def);if(_0x3b104f){logger[_0x5cea('0x31')](_0x5cea('0x44'),getLogFromObject(_0x3b104f));return _[_0x5cea('0x45')](_0x3b104f[_0x5cea('0x43')])?null:_0x3b104f[_0x5cea('0x43')]['toString']();}else{logger[_0x5cea('0xc')](_0x5cea('0x44'),getLogFromObject(_0x3b104f));return null;}}else{logger['error'](_0x5cea('0x47'));return null;}}catch(_0x2ff4ad){logger[_0x5cea('0xc')](_0x2ff4ad[_0x5cea('0x15')]);return null;}});}logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x4b'),_0x3aa3a9[_0x5cea('0x17')],_0x3aa3a9[_0x5cea('0x18')],_0x3aa3a9[_0x5cea('0x19')],_0x3aa3a9['dnid'],_0x3aa3a9[_0x5cea('0x1b')]));logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x4c'),_0x3aa3a9[_0x5cea('0x3f')],_0x3aa3a9[_0x5cea('0x40')],parseInt(_0x3aa3a9[_0x5cea('0x41')],0xa)+0x1));_0x3aa3a9[_0x5cea('0x4d')](_0x3aa3a9[_0x5cea('0x3f')],_0x3aa3a9[_0x5cea('0x40')],parseInt(_0x3aa3a9[_0x5cea('0x41')],0xa)+0x1);_0x3aa3a9[_0x5cea('0x35')]();}}else{logger[_0x5cea('0xc')](util[_0x5cea('0x10')](_0x5cea('0x4e'),_0x3aa3a9['arg_1']));_0x3aa3a9['continueAt'](_0x3aa3a9['context'],_0x3aa3a9['extension'],parseInt(_0x3aa3a9[_0x5cea('0x41')],0xa)+0x1);_0x3aa3a9[_0x5cea('0x35')]();}}else{logger[_0x5cea('0xc')](util[_0x5cea('0x10')]('Project\x20%s\x20not\x20found',_0x3aa3a9[_0x5cea('0x17')]));_0x3aa3a9[_0x5cea('0x4d')](_0x3aa3a9[_0x5cea('0x3f')],_0x3aa3a9[_0x5cea('0x40')],parseInt(_0x3aa3a9[_0x5cea('0x41')],0xa)+0x1);_0x3aa3a9[_0x5cea('0x35')]();}}function main(){var _0x1bbfd6;return utilLicense['getLicense']()[_0x5cea('0x2d')](function(_0x429e3a){if(_0x429e3a){if(_0x429e3a[_0x5cea('0x4f')]){if(_0x429e3a[_0x5cea('0x50')]&&_0x429e3a[_0x5cea('0x50')]>0x0){logger[_0x5cea('0xf')](util[_0x5cea('0x10')](_0x5cea('0x51'),_0x429e3a[_0x5cea('0x50')]));_0x1bbfd6=_0x429e3a['callysquare'];}else{logger[_0x5cea('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x5cea('0x52'));_0x1bbfd6=-0x1;}}})['catch'](function(_0x39a763){logger[_0x5cea('0xc')](_0x5cea('0x53'),_0x39a763[_0x5cea('0x15')]);})['finally'](function(){var _0x80a5a1=require(_0x5cea('0x54'))(config[_0x5cea('0x6')][_0x5cea('0xe')],config[_0x5cea('0x6')]['ip'],_0x1bbfd6);_0x80a5a1['on'](_0x5cea('0xc'),errorHandler);_0x80a5a1['on'](_0x5cea('0x55'),listeningHandler);_0x80a5a1['on']('connection',connectionHandler);_0x80a5a1['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 189fdc4..cc658b1 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 _0xa26d=['then','message','result','catch','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x42cc58,_0x5a4760){var _0x5ca9cb=function(_0xf46e9b){while(--_0xf46e9b){_0x42cc58['push'](_0x42cc58['shift']());}};_0x5ca9cb(++_0x5a4760);}(_0xa26d,0x128));var _0xda26=function(_0x4cf8fa,_0x8cd69f){_0x4cf8fa=_0x4cf8fa-0x0;var _0x4e50a2=_0xa26d[_0x4cf8fa];return _0x4e50a2;};'use strict';var BPromise=require(_0xda26('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xda26('0x1')][_0xda26('0x2')]({'port':0x232b});function request(_0x33e396,_0x3b0df8){return new BPromise(function(_0x9f4718,_0x2da00f){return client[_0xda26('0x3')](_0x33e396,_0x3b0df8)[_0xda26('0x4')](function(_0x212079){if(_0x212079['error']){return _0x2da00f(_0x212079['error'][_0xda26('0x5')]);}else{return _0x9f4718(_0x212079[_0xda26('0x6')]);}})[_0xda26('0x7')](function(_0x247b66){return _0x2da00f(_0x247b66);});});}exports[_0xda26('0x8')]=function(_0x4a3b18,_0x6bb74e){return request(_0xda26('0x9'),{'account':_0x4a3b18,'message':_0x6bb74e});}; \ No newline at end of file +var _0x2697=['catch','SendMail','bluebird','jayson/promise','client','http','error','result'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x2697,0x142));var _0x7269=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x2697[_0x3f4891];return _0x54f2d8;};'use strict';var BPromise=require(_0x7269('0x0'));var jayson=require(_0x7269('0x1'));var client=jayson[_0x7269('0x2')][_0x7269('0x3')]({'port':0x232b});function request(_0x5b21e0,_0x1a3bb9){return new BPromise(function(_0x7b46f3,_0x3c5796){return client['request'](_0x5b21e0,_0x1a3bb9)['then'](function(_0x50fa70){if(_0x50fa70[_0x7269('0x4')]){return _0x3c5796(_0x50fa70['error']['message']);}else{return _0x7b46f3(_0x50fa70[_0x7269('0x5')]);}})[_0x7269('0x6')](function(_0x2f1713){return _0x3c5796(_0x2f1713);});});}exports['sendMailMessage']=function(_0x3260c8,_0x483c03){return request(_0x7269('0x7'),{'account':_0x3260c8,'message':_0x483c03});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index eed8ddb..38d9c81 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 _0xcc8d=['stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x5161fc,_0x37c5f6){_0x5161fc=_0x5161fc-0x0;var _0x38490b=_0xcc8d[_0x5161fc];return _0x38490b;};'use strict';var util=require('util');var Transform=require(_0xdcc8('0x0'))[_0xdcc8('0x1')];function AGIReply(_0x54464b){Transform['call'](this,_0x54464b);this[_0xdcc8('0x2')]='';this[_0xdcc8('0x3')]=![];}util[_0xdcc8('0x4')](AGIReply,Transform);AGIReply[_0xdcc8('0x5')][_0xdcc8('0x6')]=function(_0x1bf391,_0x28713a,_0x47b30e){var _0x44e0b0='\x0a',_0xfeebba=['\x0a\x0a',_0xdcc8('0x7')],_0x10dd63=-0x1,_0x237528=-0x1,_0x11c497='',_0x5a85bd=0x0,_0x2bdaff='',_0xa991a1='';this[_0xdcc8('0x2')]+=_0x1bf391[_0xdcc8('0x8')]();_0x2bdaff=this[_0xdcc8('0x2')];if(!this[_0xdcc8('0x3')]){_0x5a85bd=0x0;while(_0xfeebba[_0x5a85bd]){while((_0x237528=_0x2bdaff[_0xdcc8('0x9')](_0xfeebba[_0x5a85bd]))!=-0x1){_0x11c497=_0xfeebba[_0x5a85bd];_0xa991a1=_0x2bdaff[_0xdcc8('0xa')](0x0,_0x237528);_0x2bdaff=_0x2bdaff[_0xdcc8('0xa')](_0x237528+_0x11c497[_0xdcc8('0xb')]);var _0x312dd7=_0xa991a1[_0xdcc8('0xc')](_0x44e0b0),_0x59af51=0x0,_0x4160ff={},_0x37d3c1='',_0x5d5554='',_0x2b658e=-0x1;while(_0x312dd7[_0x59af51]){_0x2b658e=_0x312dd7[_0x59af51][_0xdcc8('0x9')](':');if(_0x2b658e!=-0x1){_0x37d3c1=_0x312dd7[_0x59af51][_0xdcc8('0xd')](0x0,_0x2b658e)['trim']();_0x5d5554=_0x312dd7[_0x59af51][_0xdcc8('0xd')](_0x2b658e+0x1)[_0xdcc8('0xe')]();if(_0x37d3c1['length']>0x0){_0x4160ff[_0x37d3c1]=_0x5d5554;}}else{}_0x59af51++;}this[_0xdcc8('0xf')]('headers',_0x4160ff);this[_0xdcc8('0x3')]=!![];}_0x5a85bd++;}this[_0xdcc8('0x2')]=_0x2bdaff;}else{while((_0x10dd63=_0x2bdaff[_0xdcc8('0x9')](_0x44e0b0))!=-0x1){_0xa991a1=_0x2bdaff[_0xdcc8('0xa')](0x0,_0x10dd63);this[_0xdcc8('0xf')](_0xdcc8('0x10'),_0xa991a1);_0x2bdaff=_0x2bdaff[_0xdcc8('0xa')](_0x10dd63+_0x44e0b0['length']);}this['_localBuffer']=_0x2bdaff;}_0x47b30e();};module['exports']=AGIReply; \ No newline at end of file +var _0xb469=['toString','substring','length','split','indexOf','slice','trim','emit','headers','util','stream','Transform','call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb469,0x13b));var _0x9b46=function(_0x1c1a79,_0x4fcda6){_0x1c1a79=_0x1c1a79-0x0;var _0x3f1bbe=_0xb469[_0x1c1a79];return _0x3f1bbe;};'use strict';var util=require(_0x9b46('0x0'));var Transform=require(_0x9b46('0x1'))[_0x9b46('0x2')];function AGIReply(_0x34f477){Transform[_0x9b46('0x3')](this,_0x34f477);this[_0x9b46('0x4')]='';this[_0x9b46('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x9b46('0x6')][_0x9b46('0x7')]=function(_0x538fc4,_0x368923,_0x405d1c){var _0x50b49e='\x0a',_0x1b2dd3=['\x0a\x0a',_0x9b46('0x8')],_0x5bd834=-0x1,_0x4c1ed9=-0x1,_0x34c0de='',_0x545b6c=0x0,_0x402595='',_0xb9d1b5='';this['_localBuffer']+=_0x538fc4[_0x9b46('0x9')]();_0x402595=this['_localBuffer'];if(!this[_0x9b46('0x5')]){_0x545b6c=0x0;while(_0x1b2dd3[_0x545b6c]){while((_0x4c1ed9=_0x402595['indexOf'](_0x1b2dd3[_0x545b6c]))!=-0x1){_0x34c0de=_0x1b2dd3[_0x545b6c];_0xb9d1b5=_0x402595[_0x9b46('0xa')](0x0,_0x4c1ed9);_0x402595=_0x402595['substring'](_0x4c1ed9+_0x34c0de[_0x9b46('0xb')]);var _0x233b6b=_0xb9d1b5[_0x9b46('0xc')](_0x50b49e),_0x563de4=0x0,_0x360974={},_0x417df5='',_0x5b65c2='',_0x14362a=-0x1;while(_0x233b6b[_0x563de4]){_0x14362a=_0x233b6b[_0x563de4][_0x9b46('0xd')](':');if(_0x14362a!=-0x1){_0x417df5=_0x233b6b[_0x563de4][_0x9b46('0xe')](0x0,_0x14362a)[_0x9b46('0xf')]();_0x5b65c2=_0x233b6b[_0x563de4][_0x9b46('0xe')](_0x14362a+0x1)[_0x9b46('0xf')]();if(_0x417df5[_0x9b46('0xb')]>0x0){_0x360974[_0x417df5]=_0x5b65c2;}}else{}_0x563de4++;}this[_0x9b46('0x10')](_0x9b46('0x11'),_0x360974);this[_0x9b46('0x5')]=!![];}_0x545b6c++;}this[_0x9b46('0x4')]=_0x402595;}else{while((_0x5bd834=_0x402595[_0x9b46('0xd')](_0x50b49e))!=-0x1){_0xb9d1b5=_0x402595['substring'](0x0,_0x5bd834);this['emit']('line',_0xb9d1b5);_0x402595=_0x402595[_0x9b46('0xa')](_0x5bd834+_0x50b49e[_0x9b46('0xb')]);}this[_0x9b46('0x4')]=_0x402595;}_0x405d1c();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 57d01ce..7780cf3 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 _0xf781=['PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','client','http','then','error','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin'];(function(_0x351eff,_0x544e14){var _0x169489=function(_0x4f558e){while(--_0x4f558e){_0x351eff['push'](_0x351eff['shift']());}};_0x169489(++_0x544e14);}(_0xf781,0x185));var _0x1f78=function(_0x56f9f3,_0xf5edc3){_0x56f9f3=_0x56f9f3-0x0;var _0x2f12af=_0xf781[_0x56f9f3];return _0x2f12af;};'use strict';var BPromise=require(_0x1f78('0x0'));var moment=require(_0x1f78('0x1'));var _=require(_0x1f78('0x2'));var util=require(_0x1f78('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x1f78('0x4')][_0x1f78('0x5')]({'port':0x2329});function request(_0x13fecf,_0x24e733){return new BPromise(function(_0x2575bd,_0x2f3050){return client['request'](_0x13fecf,_0x24e733)[_0x1f78('0x6')](function(_0x2ab629){if(_0x2ab629[_0x1f78('0x7')]){return _0x2f3050(_0x2ab629[_0x1f78('0x7')]['message']);}else{return _0x2575bd(_0x2ab629['result']);}})['catch'](function(_0x562fe2){return _0x2f3050(_0x562fe2);});});}exports[_0x1f78('0x8')]=function(_0x584a41){return request(_0x1f78('0x9'),{'options':{'raw':![],'where':{'name':_0x584a41},'attributes':[_0x1f78('0xa')]}});};exports[_0x1f78('0xb')]=function(_0x40676e){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x40676e},'include':[{'model':_0x1f78('0xc'),'as':_0x1f78('0xd')}],'attributes':['id',_0x1f78('0xe'),_0x1f78('0xf')]}});};exports['getSquareProjectById']=function(_0x448e94){return request(_0x1f78('0x9'),{'options':{'where':{'id':_0x448e94},'attributes':[_0x1f78('0xe')]}});};exports[_0x1f78('0x10')]=function(_0x4edbd9){return request(_0x1f78('0x11'),{'options':{'where':{'id':_0x4edbd9},'attributes':['name']}});};exports[_0x1f78('0x12')]=function(_0x28f4f1){return request('ShowVariable',{'options':{'where':{'id':_0x28f4f1},'attributes':[_0x1f78('0xe')]}});};exports[_0x1f78('0x13')]=function(_0x253a17){return request(_0x1f78('0x14'),{'options':{'where':{'id':_0x253a17},'attributes':[_0x1f78('0x15')]}});};exports['getUserById']=function(_0x12ebbc){return request(_0x1f78('0x16'),{'options':{'where':{'id':_0x12ebbc},'attributes':[_0x1f78('0xe')]}});};exports[_0x1f78('0x17')]=function(_0x21bb76){return request(_0x1f78('0x18'),{'options':{'where':{'id':_0x21bb76},'attributes':[_0x1f78('0xe')]}});};exports['getSoundById']=function(_0x47ee0f){return request('ShowSound',{'options':{'where':{'id':_0x47ee0f},'attributes':[_0x1f78('0x19')]}});};exports[_0x1f78('0x1a')]=function(_0x4a4f4c){return request(_0x1f78('0x1b'),{'options':{'raw':![],'where':{'id':_0x4a4f4c},'include':[{'model':_0x1f78('0x1c'),'as':_0x1f78('0x1d')}]}});};exports[_0x1f78('0x1e')]=function(_0x25a916){return request(_0x1f78('0x1f'),{'options':{'where':{'id':_0x25a916},'attributes':['id',_0x1f78('0xe')]}});};exports[_0x1f78('0x20')]=function(_0x1bda25){return request(_0x1f78('0x21'),{'body':_0x1bda25});};exports[_0x1f78('0x22')]=function(_0x4d394f){return request(_0x1f78('0x23'),{'body':_0x4d394f});};exports[_0x1f78('0x24')]=function(_0xc121d5){return request(_0x1f78('0x25'),{'body':_[_0x1f78('0x26')](_0xc121d5,{'project_name':_0xc121d5[_0x1f78('0x27')],'prev_project_name':_0xc121d5[_0x1f78('0x28')]||'','is_subproject':_0xc121d5['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x1f78('0x29'))})});};exports['createSquareRecording']=function(_0x417aef){return request('CreateSquareRecording',{'body':_0x417aef});};exports['createSquareMessage']=function(_0x2b7071){return request(_0x1f78('0x2a'),{'body':_0x2b7071});};exports[_0x1f78('0x2b')]=function(_0x145652){return request(_0x1f78('0x2c'),{'options':{'raw':![],'where':{'phone':_0x145652[_0x1f78('0x2d')],'ListId':_0x145652[_0x1f78('0x2e')]}}})[_0x1f78('0x6')](function(_0x2bc98f){if(_0x2bc98f){return _0x2bc98f;}return request(_0x1f78('0x2f'),{'body':_0x145652});});};exports[_0x1f78('0x30')]=function(_0x2077a9){return request(_0x1f78('0x31'),{'options':{'where':{'id':_0x2077a9},'attributes':['name']}});};exports[_0x1f78('0x32')]=function(_0x3c7174,_0x3e8a56){return request('LoginUser',{'body':{'interface':_0x3e8a56},'options':{'where':_0x3c7174}});};exports['agentPause']=function(_0x4e11fa,_0x2d7284,_0x1a631b){return request(_0x1f78('0x33'),{'body':{'type':_0x2d7284,'uniqueid':_0x1a631b},'options':{'where':_0x4e11fa}});};exports[_0x1f78('0x34')]=function(_0x72ab93){return request(_0x1f78('0x35'),{'body':{},'options':{'where':_0x72ab93}});};exports[_0x1f78('0x36')]=function(_0x4f8e0a){return request('LogoutUser',{'body':{},'options':{'where':_0x4f8e0a}});}; \ No newline at end of file +var _0x63d1=['CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','http','request','then','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport'];(function(_0x5db045,_0x22ed69){var _0x18c1c2=function(_0x45c126){while(--_0x45c126){_0x5db045['push'](_0x5db045['shift']());}};_0x18c1c2(++_0x22ed69);}(_0x63d1,0x13c));var _0x163d=function(_0x46ceaa,_0x1e5518){_0x46ceaa=_0x46ceaa-0x0;var _0x50e799=_0x63d1[_0x46ceaa];return _0x50e799;};'use strict';var BPromise=require(_0x163d('0x0'));var moment=require(_0x163d('0x1'));var _=require(_0x163d('0x2'));var util=require(_0x163d('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x163d('0x4')][_0x163d('0x5')]({'port':0x2329});function request(_0x2e0d2f,_0x286780){return new BPromise(function(_0x4864b7,_0x11c3fd){return client[_0x163d('0x6')](_0x2e0d2f,_0x286780)[_0x163d('0x7')](function(_0x3dffb7){if(_0x3dffb7['error']){return _0x11c3fd(_0x3dffb7[_0x163d('0x8')][_0x163d('0x9')]);}else{return _0x4864b7(_0x3dffb7[_0x163d('0xa')]);}})[_0x163d('0xb')](function(_0x26f007){return _0x11c3fd(_0x26f007);});});}exports['getSquareProject']=function(_0x227335){return request(_0x163d('0xc'),{'options':{'raw':![],'where':{'name':_0x227335},'attributes':[_0x163d('0xd')]}});};exports[_0x163d('0xe')]=function(_0x132502){return request(_0x163d('0xf'),{'options':{'raw':![],'where':{'id':_0x132502},'include':[{'model':_0x163d('0x10'),'as':_0x163d('0x11')}],'attributes':['id',_0x163d('0x12'),_0x163d('0x13')]}});};exports[_0x163d('0x14')]=function(_0x1bd5fe){return request('ShowSquareProject',{'options':{'where':{'id':_0x1bd5fe},'attributes':[_0x163d('0x12')]}});};exports[_0x163d('0x15')]=function(_0x390cb8){return request(_0x163d('0x16'),{'options':{'where':{'id':_0x390cb8},'attributes':[_0x163d('0x12')]}});};exports['getVariableById']=function(_0x18abaf){return request('ShowVariable',{'options':{'where':{'id':_0x18abaf},'attributes':['name']}});};exports[_0x163d('0x17')]=function(_0x216d2d){return request(_0x163d('0x18'),{'options':{'where':{'id':_0x216d2d},'attributes':[_0x163d('0x19')]}});};exports[_0x163d('0x1a')]=function(_0x1fcf8a){return request(_0x163d('0x1b'),{'options':{'where':{'id':_0x1fcf8a},'attributes':[_0x163d('0x12')]}});};exports['getTrunkById']=function(_0x14082e){return request(_0x163d('0x1c'),{'options':{'where':{'id':_0x14082e},'attributes':[_0x163d('0x12')]}});};exports[_0x163d('0x1d')]=function(_0x5ef1a1){return request('ShowSound',{'options':{'where':{'id':_0x5ef1a1},'attributes':[_0x163d('0x1e')]}});};exports[_0x163d('0x1f')]=function(_0x5e0d9f){return request(_0x163d('0x20'),{'options':{'raw':![],'where':{'id':_0x5e0d9f},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x163d('0x21')]=function(_0x21dc9f){return request(_0x163d('0x22'),{'options':{'where':{'id':_0x21dc9f},'attributes':['id',_0x163d('0x12')]}});};exports[_0x163d('0x23')]=function(_0x3c8b8b){return request(_0x163d('0x24'),{'body':_0x3c8b8b});};exports[_0x163d('0x25')]=function(_0x423ad2){return request(_0x163d('0x26'),{'body':_0x423ad2});};exports[_0x163d('0x27')]=function(_0x1e716f){return request(_0x163d('0x28'),{'body':_[_0x163d('0x29')](_0x1e716f,{'project_name':_0x1e716f[_0x163d('0x2a')],'prev_project_name':_0x1e716f[_0x163d('0x2b')]||'','is_subproject':_0x1e716f[_0x163d('0x2b')]?!![]:![],'leaveAt':moment()[_0x163d('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x163d('0x2d')]=function(_0x3770b4){return request(_0x163d('0x2e'),{'body':_0x3770b4});};exports['createSquareMessage']=function(_0x3a9b78){return request('CreateSquareMessage',{'body':_0x3a9b78});};exports[_0x163d('0x2f')]=function(_0x5dfded){return request(_0x163d('0x30'),{'options':{'raw':![],'where':{'phone':_0x5dfded[_0x163d('0x31')],'ListId':_0x5dfded['ListId']}}})[_0x163d('0x7')](function(_0x34dc70){if(_0x34dc70){return _0x34dc70;}return request(_0x163d('0x32'),{'body':_0x5dfded});});};exports[_0x163d('0x33')]=function(_0x4620f5){return request('ShowPause',{'options':{'where':{'id':_0x4620f5},'attributes':[_0x163d('0x12')]}});};exports[_0x163d('0x34')]=function(_0x4e21bd,_0x462fe3){return request('LoginUser',{'body':{'interface':_0x462fe3},'options':{'where':_0x4e21bd}});};exports[_0x163d('0x35')]=function(_0x35d875,_0x2dad72,_0x1dcc0b){return request(_0x163d('0x36'),{'body':{'type':_0x2dad72,'uniqueid':_0x1dcc0b},'options':{'where':_0x35d875}});};exports[_0x163d('0x37')]=function(_0x312bc6){return request(_0x163d('0x38'),{'body':{},'options':{'where':_0x312bc6}});};exports[_0x163d('0x39')]=function(_0x47f584){return request(_0x163d('0x3a'),{'body':{},'options':{'where':_0x47f584}});}; \ 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 fccc4b7..f015c45 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 _0x4453=['./polly','./lex'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4453,0x9c));var _0x3445=function(_0x43173e,_0x1d793a){_0x43173e=_0x43173e-0x0;var _0x435fe7=_0x4453[_0x43173e];return _0x435fe7;};var polly=require(_0x3445('0x0'));var lex=require(_0x3445('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd0c9=['./polly','./lex'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xd0c9[_0x5c2e3e];return _0x53f64a;};var polly=require(_0x9d0c('0x0'));var lex=require(_0x9d0c('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index aa6bf74..2cec545 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 _0xdace=['./lib/api'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xdace,0xc5));var _0xedac=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xdace[_0x220afa];return _0x1b79d1;};'use strict';var lex=require(_0xedac('0x0'));module['exports']=function(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2){return lex(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2);}; \ No newline at end of file +var _0x9bde=['exports'];(function(_0x166e88,_0x53d48c){var _0x2973f9=function(_0x344e52){while(--_0x344e52){_0x166e88['push'](_0x166e88['shift']());}};_0x2973f9(++_0x53d48c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4c986c,_0x4546b5){_0x4c986c=_0x4c986c-0x0;var _0x2b7c2b=_0x9bde[_0x4c986c];return _0x2b7c2b;};'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 diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index d211a0a..8e8b42d 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(_0x12cec2,_0x58da6c){var _0x5bddea=function(_0x5b4516){while(--_0x5b4516){_0x12cec2['push'](_0x12cec2['shift']());}};_0x5bddea(++_0x58da6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x4a0f6f,_0x36da54){var _0xc45eaf=function(_0x5b2fb8){while(--_0x5b2fb8){_0x4a0f6f['push'](_0x4a0f6f['shift']());}};_0xc45eaf(++_0x36da54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 8b4e1db..9869f6d 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 _0xaa24=['exports'];(function(_0x2bd67f,_0x373e28){var _0x4cd465=function(_0x4e1e77){while(--_0x4e1e77){_0x2bd67f['push'](_0x2bd67f['shift']());}};_0x4cd465(++_0x373e28);}(_0xaa24,0x1ed));var _0x4aa2=function(_0xa18875,_0x5565a1){_0xa18875=_0xa18875-0x0;var _0x13c825=_0xaa24[_0xa18875];return _0x13c825;};'use strict';var polly=require('./lib/api');module[_0x4aa2('0x0')]=function(_0x4c39e9,_0x4617ee,_0x2dc95a,_0x94d1ce,_0x3e7a71,_0x2c7102,_0x1c0789){return polly(_0x4c39e9,_0x4617ee,_0x2dc95a,_0x94d1ce,_0x3e7a71,_0x2c7102,_0x1c0789);}; \ No newline at end of file +var _0xa2cf=['exports','./lib/api'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xa2cf,0x1b7));var _0xfa2c=function(_0x24c341,_0x45d908){_0x24c341=_0x24c341-0x0;var _0x12c2ee=_0xa2cf[_0x24c341];return _0x12c2ee;};'use strict';var polly=require(_0xfa2c('0x0'));module[_0xfa2c('0x1')]=function(_0xc7c96f,_0x2d84a8,_0xd04123,_0x52e52f,_0x40261b,_0x4f2761,_0x125b59){return polly(_0xc7c96f,_0x2d84a8,_0xd04123,_0x52e52f,_0x40261b,_0x4f2761,_0x125b59);}; \ 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 10be0fc..5f0995c 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 _0x2140=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x2140,0xe8));var _0x0214=function(_0x3c4a32,_0x3bceea){_0x3c4a32=_0x3c4a32-0x0;var _0x2063bc=_0x2140[_0x3c4a32];return _0x2063bc;};'use strict';var fs=require('fs');var path=require(_0x0214('0x0'));var BPromise=require(_0x0214('0x1'));var rs=require(_0x0214('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x23b270,_0x257b5a,_0x301eb6){return new BPromise(function(_0x3e5592,_0x29368d){_0x23b270[_0x0214('0x3')](_0x257b5a,function(_0x485012,_0x3ce5b6){if(_0x485012){_0x29368d(_0x485012);}else if(_0x3ce5b6){if(_0x3ce5b6[_0x0214('0x4')]instanceof Buffer){fs['writeFile'](_0x301eb6,_0x3ce5b6[_0x0214('0x4')],function(_0x4f0e6a){if(_0x4f0e6a){_0x29368d(_0x4f0e6a);}else{_0x3e5592();}});}else{_0x29368d(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x29368d(new Error(_0x0214('0x5')));}});});}module[_0x0214('0x6')]=function(_0x67eef8,_0x106f48,_0x285fba,_0x404605,_0x2e9c82,_0x66f7e7,_0x33b588){var _0x3948ec=new AWS[(_0x0214('0x7'))]({'accessKeyId':_0x67eef8,'secretAccessKey':_0x106f48,'region':_0x285fba});var _0x2429aa={'Text':_0x2e9c82,'TextType':_0x66f7e7||'text','OutputFormat':'mp3','VoiceId':_0x404605};return pollyResult(_0x3948ec,_0x2429aa,_0x33b588);}; \ No newline at end of file +var _0x8395=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream'];(function(_0x30c794,_0xda57ee){var _0x38c2fd=function(_0x2ffacb){while(--_0x2ffacb){_0x30c794['push'](_0x30c794['shift']());}};_0x38c2fd(++_0xda57ee);}(_0x8395,0x10d));var _0x5839=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x8395[_0x4e1d03];return _0x362d4b;};'use strict';var fs=require('fs');var path=require(_0x5839('0x0'));var BPromise=require(_0x5839('0x1'));var rs=require('randomstring');var AWS=require(_0x5839('0x2'));function pollyResult(_0x4ed613,_0x547178,_0x485747){return new BPromise(function(_0x4ccf25,_0x346b0f){_0x4ed613[_0x5839('0x3')](_0x547178,function(_0xee575a,_0xb533b4){if(_0xee575a){_0x346b0f(_0xee575a);}else if(_0xb533b4){if(_0xb533b4['AudioStream']instanceof Buffer){fs[_0x5839('0x4')](_0x485747,_0xb533b4[_0x5839('0x5')],function(_0x43883c){if(_0x43883c){_0x346b0f(_0x43883c);}else{_0x4ccf25();}});}else{_0x346b0f(new Error(_0x5839('0x6')));}}else{_0x346b0f(new Error(_0x5839('0x7')));}});});}module[_0x5839('0x8')]=function(_0x31987e,_0x464f0a,_0x57d9c1,_0x36b87f,_0x46d148,_0x5b7bc6,_0x356f41){var _0x401f21=new AWS['Polly']({'accessKeyId':_0x31987e,'secretAccessKey':_0x464f0a,'region':_0x57d9c1});var _0x1c5de3={'Text':_0x46d148,'TextType':_0x5b7bc6||_0x5839('0x9'),'OutputFormat':_0x5839('0xa'),'VoiceId':_0x36b87f};return pollyResult(_0x401f21,_0x1c5de3,_0x356f41);}; \ 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 6db0a17..6cd2193 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 _0x7ff5=['./lib/api','exports'];(function(_0x5f5af9,_0x1077d7){var _0x956d55=function(_0x2624b0){while(--_0x2624b0){_0x5f5af9['push'](_0x5f5af9['shift']());}};_0x956d55(++_0x1077d7);}(_0x7ff5,0x190));var _0x57ff=function(_0x46c76f,_0x3de6e3){_0x46c76f=_0x46c76f-0x0;var _0x3d24be=_0x7ff5[_0x46c76f];return _0x3d24be;};'use strict';var asr=require(_0x57ff('0x0'));module[_0x57ff('0x1')]=function(_0x2da3a6,_0x378b37,_0x10cebf,_0xc1aef9){return asr(_0x2da3a6,_0x378b37,_0x10cebf);}; \ No newline at end of file +var _0xc079=['./lib/api','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc079,0x1d4));var _0x9c07=function(_0x536cf0,_0x4f32e1){_0x536cf0=_0x536cf0-0x0;var _0x4073e8=_0xc079[_0x536cf0];return _0x4073e8;};'use strict';var asr=require(_0x9c07('0x0'));module[_0x9c07('0x1')]=function(_0x5ea744,_0x4b06de,_0x28d9d7,_0x173d6a){return asr(_0x5ea744,_0x4b06de,_0x28d9d7);}; \ 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 9a44382..483335d 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 _0x89f7=['string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x89f7,0x105));var _0x789f=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0x89f7[_0x529059];return _0x156bc2;};'use strict';var url=require(_0x789f('0x0'));var BPromise=require(_0x789f('0x1'));var fs=require('fs');var host=_0x789f('0x2');module['exports']=function(_0x2e09ac,_0x564d48,_0x1c55ac){return new BPromise(function(_0x48fa02,_0xf6ef5d){var _0x14a3e7;if(typeof _0x2e09ac!==_0x789f('0x3')||_0x2e09ac[_0x789f('0x4')]===0x0){return _0xf6ef5d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x564d48!==_0x789f('0x3')||_0x564d48[_0x789f('0x4')]===0x0){return _0xf6ef5d(_0x789f('0x5'));}if(typeof _0x1c55ac!==_0x789f('0x6')&&(typeof _0x1c55ac!=='string'||_0x1c55ac['length']===0x0)){return _0xf6ef5d(_0x789f('0x7'));}try{_0x14a3e7=fs[_0x789f('0x8')](_0x2e09ac)[_0x789f('0x9')]('base64');}catch(_0x300d27){return _0xf6ef5d(_0x300d27);}return _0x48fa02({'method':_0x789f('0xa'),'uri':host+_0x789f('0xb')+_0x564d48,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1c55ac},'audio':{'content':_0x14a3e7}},'json':!![]});});}; \ No newline at end of file +var _0x20ce=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x564edb,_0x5d77dc){var _0x482482=function(_0x45017d){while(--_0x45017d){_0x564edb['push'](_0x564edb['shift']());}};_0x482482(++_0x5d77dc);}(_0x20ce,0x10d));var _0xe20c=function(_0x5e5430,_0x39b452){_0x5e5430=_0x5e5430-0x0;var _0x2db3a7=_0x20ce[_0x5e5430];return _0x2db3a7;};'use strict';var url=require(_0xe20c('0x0'));var BPromise=require(_0xe20c('0x1'));var fs=require('fs');var host=_0xe20c('0x2');module['exports']=function(_0x377a74,_0x34b536,_0x213486){return new BPromise(function(_0x26479b,_0x7e5160){var _0x23f743;if(typeof _0x377a74!==_0xe20c('0x3')||_0x377a74[_0xe20c('0x4')]===0x0){return _0x7e5160(_0xe20c('0x5'));}if(typeof _0x34b536!==_0xe20c('0x3')||_0x34b536[_0xe20c('0x4')]===0x0){return _0x7e5160(_0xe20c('0x6'));}if(typeof _0x213486!==_0xe20c('0x7')&&(typeof _0x213486!==_0xe20c('0x3')||_0x213486[_0xe20c('0x4')]===0x0)){return _0x7e5160(_0xe20c('0x8'));}try{_0x23f743=fs[_0xe20c('0x9')](_0x377a74)[_0xe20c('0xa')](_0xe20c('0xb'));}catch(_0x16aaaa){return _0x7e5160(_0x16aaaa);}return _0x26479b({'method':_0xe20c('0xc'),'uri':host+_0xe20c('0xd')+_0x34b536,'body':{'config':{'encoding':_0xe20c('0xe'),'sampleRateHertz':_0xe20c('0xf'),'languageCode':_0x213486},'audio':{'content':_0x23f743}},'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 c7d2123..02d1eb7 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 _0x9989=['exports'];(function(_0x2da27c,_0x593bfb){var _0x3c313d=function(_0x430bee){while(--_0x430bee){_0x2da27c['push'](_0x2da27c['shift']());}};_0x3c313d(++_0x593bfb);}(_0x9989,0x18c));var _0x9998=function(_0x1ac157,_0x1c998d){_0x1ac157=_0x1ac157-0x0;var _0x11e1f8=_0x9989[_0x1ac157];return _0x11e1f8;};var asr=require('./asr');module[_0x9998('0x0')]={'asr':asr}; \ No newline at end of file +var _0x584d=['./asr','exports'];(function(_0x3a42d9,_0x481189){var _0x5d1fef=function(_0x32e455){while(--_0x32e455){_0x3a42d9['push'](_0x3a42d9['shift']());}};_0x5d1fef(++_0x481189);}(_0x584d,0xe6));var _0xd584=function(_0x3e36d4,_0x3bfe44){_0x3e36d4=_0x3e36d4-0x0;var _0x46e2c5=_0x584d[_0x3e36d4];return _0x46e2c5;};var asr=require(_0xd584('0x0'));module[_0xd584('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 1a66662..f31e5ab 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 _0x0006=['?key=','input','voice','MP3','text:synthesize','then','.mp3','from','audioContent','writeFile','split','googleTTS','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','map','confidence','join','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','close','unlink','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','chmodSync','777','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/'];(function(_0x1f4f14,_0x570d4b){var _0x3135b1=function(_0x89b844){while(--_0x89b844){_0x1f4f14['push'](_0x1f4f14['shift']());}};_0x3135b1(++_0x570d4b);}(_0x0006,0xdf));var _0x6000=function(_0x35db8b,_0x5aafdb){_0x35db8b=_0x35db8b-0x0;var _0xf74e7f=_0x0006[_0x35db8b];return _0xf74e7f;};'use strict';var apiai=require(_0x6000('0x0'));var BPromise=require(_0x6000('0x1'));var dialogflow=require(_0x6000('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x6000('0x3'));var md5=require(_0x6000('0x4'));var path=require(_0x6000('0x5'));var querystring=require(_0x6000('0x6'));var rp=require(_0x6000('0x7'));var rs=require(_0x6000('0x8'));var sox=require('sox');var tts=require(_0x6000('0x9'));var urlParse=require(_0x6000('0xa'))[_0x6000('0xb')];var util=require(_0x6000('0xc'));var aws=require(_0x6000('0xd'));var google=require('./google');var sestek=require(_0x6000('0xe'));var tilde=require('./tilde');var logger=require(_0x6000('0xf'))(_0x6000('0x10'));var ISPEECH_API=_0x6000('0x11');function downloadFile(_0x30bfbd,_0x383168){return new BPromise(function(_0xa1831b,_0x250d9e){var _0x50f9ff=urlParse(_0x30bfbd);var _0x458b90=_0x50f9ff[_0x6000('0x12')]===_0x6000('0x13')?https:http;var _0x13e4ee={'host':_0x50f9ff[_0x6000('0x14')],'path':_0x50f9ff[_0x6000('0x5')],'headers':{'user-agent':_0x6000('0x15')}};_0x458b90[_0x6000('0x16')](_0x13e4ee,function(_0x52e916){if(_0x52e916[_0x6000('0x17')]!==0xc8){logger[_0x6000('0x18')](_0x6000('0x19')+_0x30bfbd+_0x6000('0x1a')+_0x52e916[_0x6000('0x17')]+'\x20('+_0x52e916[_0x6000('0x1b')]+')');_0x250d9e(new Error(_0x6000('0x19')+_0x30bfbd+_0x6000('0x1a')+_0x52e916['statusCode']+'\x20('+_0x52e916[_0x6000('0x1b')]+')'));return;}var _0x61633f=fs['createWriteStream'](_0x383168);_0x61633f['on'](_0x6000('0x1c'),function(){logger[_0x6000('0x1d')]('finish\x20download\x20file');_0x61633f[_0x6000('0x1e')](_0xa1831b);});_0x61633f['on'](_0x6000('0x18'),function(_0x5b74fa){fs[_0x6000('0x1f')](_0x383168);logger[_0x6000('0x18')]('download\x20error',_0x5b74fa);_0x250d9e(_0x5b74fa);});_0x52e916[_0x6000('0x20')](_0x61633f);})['on'](_0x6000('0x18'),function(_0x4efa5d){logger[_0x6000('0x18')](_0x4efa5d);_0x250d9e(_0x4efa5d);})[_0x6000('0x21')]();});}function uploadFile(_0x3c945d){return new BPromise(function(_0x4b4d72,_0x292a7d){var _0x57ab5b=urlParse(_0x3c945d);var _0x800eb5=_0x57ab5b[_0x6000('0x12')]===_0x6000('0x13')?https:http;var _0x120c2f={'host':_0x57ab5b['host'],'path':_0x57ab5b[_0x6000('0x5')],'headers':{'user-agent':_0x6000('0x15')}};_0x800eb5[_0x6000('0x16')](_0x120c2f,function(_0x24aad4){if(_0x24aad4[_0x6000('0x17')]!==0xc8){_0x292a7d(new Error(_0x6000('0x19')+_0x3c945d+_0x6000('0x1a')+_0x24aad4[_0x6000('0x17')]+'\x20('+_0x24aad4[_0x6000('0x1b')]+')'));return;}var _0x2788a0='';_0x24aad4['on'](_0x6000('0x22'),function(_0x2b03dc){_0x2788a0+=_0x2b03dc;});_0x24aad4['on'](_0x6000('0x21'),function(){_0x4b4d72(_0x2788a0);});})['on']('error',function(_0x3e70ee){_0x292a7d(_0x3e70ee);})[_0x6000('0x21')]();});}function convertFile(_0x3adc12,_0x25f435){return new BPromise(function(_0x25d15c,_0x569a38){var _0x2611f4=sox[_0x6000('0x23')](_0x3adc12,_0x25f435,{'sampleRate':0x1f40,'format':_0x6000('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2611f4['on'](_0x6000('0x18'),function(_0x12a867){logger['error'](_0x6000('0x25'),_0x12a867);_0x569a38(_0x12a867);});_0x2611f4['on'](_0x6000('0x21'),function(){logger[_0x6000('0x1d')](_0x6000('0x26'));_0x25d15c();});_0x2611f4[_0x6000('0x27')]();});}function base64Decode(_0x44b64d,_0x47a8cc){var _0x15cfbf=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x2b'));fs[_0x6000('0x2c')](_0x15cfbf,_0x44b64d,'base64');return convertFile(_0x15cfbf,_0x47a8cc)['then'](function(){try{fs[_0x6000('0x1f')](_0x15cfbf);fs[_0x6000('0x2d')](_0x47a8cc,_0x6000('0x2e'));}catch(_0x34b4e3){logger[_0x6000('0x18')](_0x34b4e3);}return _0x47a8cc['split']('.')[0x0];});}function base64Encode(_0x48188a){var _0x1ee5dc=fs[_0x6000('0x2f')](_0x48188a);return new Buffer(_0x1ee5dc)['toString'](_0x6000('0x30'));}exports[_0x6000('0x31')]=function(_0x3945c6,_0x25ba51,_0x2858a1,_0x20dcb1,_0xf93c4,_0x3b2b47){var _0x1150b2,_0x24b00b;var _0x2ba408=_0x6000('0x32');var _0x21f008=_0x6000('0x33')+_0x3945c6;var _0x399eb5={};if(_0x25ba51==='ssml'){_0x399eb5[_0x6000('0x34')]={'ssml':_0x2858a1};}else{_0x399eb5[_0x6000('0x34')]={'text':_0x2858a1};};_0x399eb5[_0x6000('0x35')]={'languageCode':_0x20dcb1,'ssmlGender':_0xf93c4};_0x399eb5['audioConfig']={'audioEncoding':_0x6000('0x36'),'sampleRateHertz':0x1f40};var _0x3a77b2={'url':_0x2ba408+_0x6000('0x37')+_0x21f008,'method':'POST','json':!![],'body':_0x399eb5};return rp(_0x3a77b2)[_0x6000('0x38')](function(_0x4cb8bc){return new BPromise(function(_0x442226,_0x4ffbf0){_0x1150b2=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs['generate'](0x4)+_0x6000('0x39'));var _0x329ec5=Buffer[_0x6000('0x3a')](_0x4cb8bc[_0x6000('0x3b')],_0x6000('0x30'));return fs[_0x6000('0x3c')](_0x1150b2,_0x329ec5,function(_0x5816e1){_0x4ffbf0(_0x5816e1);},function(_0x3bae33){fs[_0x6000('0x2d')](_0x1150b2,_0x6000('0x2e'));_0x442226(_0x3bae33);});});})['then'](function(_0x31eaed){_0x24b00b=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs['generate'](0x4)+_0x6000('0x2b'));return convertFile(_0x1150b2,_0x24b00b);})[_0x6000('0x38')](function(){try{fs[_0x6000('0x1f')](_0x1150b2);fs[_0x6000('0x2d')](_0x24b00b,_0x6000('0x2e'));}catch(_0x2c3b18){logger[_0x6000('0x18')](_0x2c3b18);}logger[_0x6000('0x1d')]('googleCloudTTS\x20path',_0x24b00b[_0x6000('0x3d')]('.')[0x0]);return _0x24b00b[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x3e')]=function(_0x7d134c,_0x2d5745){var _0xaf52b4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x256a18,_0x36490f;var _0x4b3350;var _0x10b83d={'encoding':_0x6000('0x3f'),'method':_0x6000('0x40'),'timeout':0x2710,'url':_0xaf52b4,'headers':{'Content-Type':_0x6000('0x41')},'body':_0x6000('0x42')+encodeURIComponent(JSON['stringify']([[[_0x6000('0x43'),JSON['stringify']([_0x7d134c,_0x2d5745||'en',![],'null']),null,'generic']]]))};return rp(_0x10b83d)['then'](function(_0x4c53f9){try{_0x4b3350=eval(_0x4c53f9[_0x6000('0x44')](0x5))[0x0][0x2];}catch(_0x4eb65f){throw new Error(_0x6000('0x45')+_0x4c53f9['data']);}if(!_0x4b3350){if(_0x7d134c[_0x6000('0x46')]>0xc8){throw new Error(_0x6000('0x47'));}else{throw new Error(_0x6000('0x48')+_0x2d5745+'\x22\x20might\x20not\x20exist');}}try{_0x4b3350=eval(_0x4b3350)[0x0];}catch(_0x227ff8){throw new Error(_0x6000('0x45')+res[_0x6000('0x22')]);}const _0xfe8cb3=_0x4b3350;_0x256a18=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x39'));fs[_0x6000('0x2c')](_0x256a18,_0x4b3350,{'encoding':_0x6000('0x30')});_0x36490f=path['resolve'](__dirname,'tmp',rs[_0x6000('0x2a')](0x4)+_0x6000('0x2b'));return convertFile(_0x256a18,_0x36490f);})[_0x6000('0x38')](function(){try{fs[_0x6000('0x1f')](_0x256a18);fs[_0x6000('0x2d')](_0x36490f,_0x6000('0x2e'));}catch(_0x47c69c){logger[_0x6000('0x18')](_0x47c69c);}logger[_0x6000('0x1d')](_0x6000('0x49'),_0x36490f[_0x6000('0x3d')]('.')[0x0]);return _0x36490f[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x4a')]=function(_0x5e5b66,_0x2a85ba,_0x29ea14){return google[_0x6000('0x4b')](_0x5e5b66,_0x2a85ba,_0x29ea14)[_0x6000('0x38')](function(_0xd3eb5){logger[_0x6000('0x1d')](_0xd3eb5['uri']);return rp(_0xd3eb5);})[_0x6000('0x38')](function(_0x21e75c){var _0x568537='';var _0x714bf0=0x0;try{fs[_0x6000('0x1f')](_0x5e5b66);}catch(_0x339341){logger[_0x6000('0x18')](_0x339341);}if(_0x21e75c&&_0x21e75c[_0x6000('0x4c')]){_0x568537=_0x21e75c[_0x6000('0x4c')]['map'](function(_0x40c5e1){return _0x40c5e1&&_0x40c5e1[_0x6000('0x4d')][0x0]&&_0x40c5e1[_0x6000('0x4d')][0x0][_0x6000('0x4e')]?_0x40c5e1[_0x6000('0x4d')][0x0]['transcript']:'';})['join']('\x0a');_0x714bf0=_0x21e75c['results'][_0x6000('0x4f')](function(_0x1e5d30){return _0x1e5d30&&_0x1e5d30[_0x6000('0x4d')][0x0]&&_0x1e5d30[_0x6000('0x4d')][0x0][_0x6000('0x50')]?_0x1e5d30[_0x6000('0x4d')][0x0][_0x6000('0x50')]:0x0;})[_0x6000('0x51')]('\x0a');}logger[_0x6000('0x1d')]('googleASR\x20transcription',_0x568537);logger[_0x6000('0x1d')](_0x6000('0x52'),_0x714bf0);return{'transcript':_0x568537,'confidence':_0x714bf0};})['catch'](function(_0x3c131a){logger['error'](_0x6000('0x53'),_0x3c131a[_0x6000('0x17')],_0x3c131a[_0x6000('0x54')],_0x3c131a[_0x6000('0x55')]);});};exports[_0x6000('0x56')]=function(_0x626a62,_0x15a7b8,_0x14efe1,_0x3b9856){var _0x26f203=apiai(_0x15a7b8,{'language':_0x3b9856||'en'});return _0x26f203[_0x6000('0x57')](_0x14efe1,{'sessionId':md5(_0x626a62)})[_0x6000('0x38')](function(_0x5cb494){logger[_0x6000('0x1d')](JSON['stringify'](_0x5cb494));return{'source':_0x5cb494[_0x6000('0x58')][_0x6000('0x59')],'resolvedQuery':_0x5cb494[_0x6000('0x58')][_0x6000('0x5a')],'action':_0x5cb494[_0x6000('0x58')][_0x6000('0x5b')],'actionIncomplete':_0x5cb494[_0x6000('0x58')][_0x6000('0x5c')],'speech':_0x5cb494[_0x6000('0x58')][_0x6000('0x5d')][_0x6000('0x5e')],'score':_0x5cb494[_0x6000('0x58')][_0x6000('0x5f')],'statusCode':_0x5cb494[_0x6000('0x60')]['code'],'endConversation':_0x5cb494['result']['metadata'][_0x6000('0x61')]||![],'isFallbackIntent':_0x5cb494[_0x6000('0x58')][_0x6000('0x62')][_0x6000('0x63')]};});};exports[_0x6000('0x64')]=function(_0x5b886f,_0x499c79,_0x3daafc,_0x36219b,_0x1f96f5,_0x34fb2b){var _0x122757=_0x36219b[_0x6000('0x65')](/\\n/g,'\x0a');var _0x4c7b4e={'credentials':{'private_key':_0x122757,'client_email':_0x3daafc}};var _0x21eae2=new dialogflow[(_0x6000('0x66'))](_0x4c7b4e);var _0xaec5bd=_0x21eae2[_0x6000('0x67')](_0x499c79,md5(_0x5b886f));var _0x7fbb2b={'session':_0xaec5bd,'queryInput':{'text':{'text':_0x1f96f5,'languageCode':_0x34fb2b}}};return _0x21eae2[_0x6000('0x68')](_0x7fbb2b)[_0x6000('0x38')](function(_0x1320f1){if(_0x1320f1&&_0x1320f1[_0x6000('0x46')]){logger[_0x6000('0x1d')](_0x6000('0x69'),JSON[_0x6000('0x6a')](_0x1320f1));var _0xa91033=_0x1320f1[0x0];if(_0xa91033){var _0x1cf667={'action':_0xa91033[_0x6000('0x6b')]['action'],'allRequiredParamsPresent':_0xa91033['queryResult'][_0x6000('0x6c')],'endConversation':_0xa91033[_0x6000('0x6b')]['diagnosticInfo']&&_0xa91033[_0x6000('0x6b')][_0x6000('0x6d')]['fields']?_0xa91033[_0x6000('0x6b')][_0x6000('0x6d')][_0x6000('0x6e')][_0x6000('0x6f')][_0x6000('0x70')]:![],'fulfillmentText':_0xa91033['queryResult'][_0x6000('0x71')],'intentName':_0xa91033[_0x6000('0x6b')]['intent'][_0x6000('0x54')],'intentDisplayName':_0xa91033[_0x6000('0x6b')][_0x6000('0x72')][_0x6000('0x73')],'isFallbackIntent':_0xa91033['queryResult'][_0x6000('0x72')]['isFallback'],'languageCode':_0xa91033['queryResult'][_0x6000('0x74')],'queryText':_0xa91033[_0x6000('0x6b')][_0x6000('0x75')],'responseId':_0xa91033['responseId'],'score':_0xa91033[_0x6000('0x6b')][_0x6000('0x76')],'speech':_0xa91033[_0x6000('0x6b')][_0x6000('0x71')],'providerResponse':JSON['stringify'](_0x1320f1)};return _0x1cf667;}}});};exports[_0x6000('0x77')]=function(_0x2973fc,_0x41faa6,_0x5ef752,_0x20f4af){return tilde[_0x6000('0x4b')](_0x2973fc,_0x41faa6,_0x5ef752,_0x20f4af)[_0x6000('0x38')](function(_0x3e655f){try{fs[_0x6000('0x1f')](_0x2973fc);}catch(_0x12563e){logger[_0x6000('0x18')](_0x12563e);}logger[_0x6000('0x1d')]('Tilde\x20ASR\x20transcription',_0x3e655f[_0x6000('0x4e')]);logger['info'](_0x6000('0x78'),_0x3e655f[_0x6000('0x50')]);return _0x3e655f;});};exports[_0x6000('0x79')]=function(_0x3da29c,_0x36c5ba,_0x63d292,_0x672224,_0x52e449,_0x1d675e){var _0x44c7ff=path[_0x6000('0x28')](__dirname,'tmp',rs[_0x6000('0x2a')](0x4)+'.mp3');var _0x1307da;return aws[_0x6000('0x7a')](_0x3da29c,_0x36c5ba,_0x63d292,_0x672224,_0x52e449,_0x1d675e,_0x44c7ff)[_0x6000('0x38')](function(){_0x1307da=path[_0x6000('0x28')](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x2b'));return convertFile(_0x44c7ff,_0x1307da);})[_0x6000('0x38')](function(){try{fs[_0x6000('0x1f')](_0x44c7ff);fs[_0x6000('0x2d')](_0x1307da,'777');}catch(_0x4b870b){logger[_0x6000('0x18')](_0x4b870b);}return _0x1307da[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x7b')]=function(_0x35eafe,_0x2d1f69,_0x46a2f0,_0x398fef,_0x54f77d,_0x2cf5d8){return aws[_0x6000('0x7c')](_0x35eafe,_0x2d1f69,_0x46a2f0,_0x398fef,_0x54f77d,_0x2cf5d8)[_0x6000('0x38')](function(_0x4bd0f1){logger['info'](JSON[_0x6000('0x6a')](_0x4bd0f1));return _0x4bd0f1;});};exports[_0x6000('0x7d')]=function(_0x376323,_0x31bcc2,_0x5931cc,_0xccb8b1){var _0x4d85d9=util[_0x6000('0x7e')](_0x6000('0x7f'),ISPEECH_API,_0x376323,encodeURIComponent(_0x31bcc2),_0x5931cc,_0xccb8b1);var _0x5106a6=path['resolve'](__dirname,_0x6000('0x29'),rs[_0x6000('0x2a')](0x4)+_0x6000('0x39'));var _0x40feef;return downloadFile(_0x4d85d9,_0x5106a6)[_0x6000('0x38')](function(){_0x40feef=path['resolve'](__dirname,_0x6000('0x29'),rs['generate'](0x4)+_0x6000('0x2b'));return convertFile(_0x5106a6,_0x40feef);})[_0x6000('0x38')](function(){try{fs['unlink'](_0x5106a6);fs['chmodSync'](_0x40feef,_0x6000('0x2e'));}catch(_0x4b689c){logger[_0x6000('0x18')](_0x4b689c);}return _0x40feef[_0x6000('0x3d')]('.')[0x0];});};exports[_0x6000('0x80')]=function(_0x2a5500,_0x57d412,_0x16a2bf,_0xdb0a01){var _0x19aa61=util[_0x6000('0x7e')](_0x6000('0x81'),ISPEECH_API,_0x57d412,_0x16a2bf,base64Encode(_0x2a5500),_0xdb0a01?util['format'](_0x6000('0x82'),encodeURIComponent(_0xdb0a01)):'freeform=3');return uploadFile(_0x19aa61)['then'](function(_0x2a9238){return querystring[_0x6000('0xb')](_0x2a9238);});};exports[_0x6000('0x83')]=function(_0x2875d2,_0xe46edc){return sestek['nda'](_0x2875d2,_0xe46edc)[_0x6000('0x38')](function(_0x1f6bc8){logger['info'](JSON[_0x6000('0x6a')](_0x1f6bc8));var _0x33acfc={'speech':_0x1f6bc8[_0x6000('0x84')],'action':_0x1f6bc8[_0x6000('0x85')]?_0x1f6bc8[_0x6000('0x85')][_0x6000('0x86')]:undefined,'actiondata':_0x1f6bc8[_0x6000('0x85')]?_0x1f6bc8['channelData']['CustomActionData']:undefined};if(_0x1f6bc8[_0x6000('0x85')]&&_0x1f6bc8[_0x6000('0x85')][_0x6000('0x87')]){return base64Decode(_0x1f6bc8['channelData'][_0x6000('0x87')]['Data'],path['resolve'](__dirname,'tmp',rs[_0x6000('0x2a')](0x4)+'.wav'))[_0x6000('0x38')](function(_0x4584bb){_0x33acfc['audiofile']=_0x4584bb;return _0x33acfc;});}return _0x33acfc;});};exports[_0x6000('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0xeba2=['allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','https','md5','querystring','request-promise','randomstring','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','path','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','close','data','end','transcode','wav','error\x20convert','info','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','unlink','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','slice','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','resolvedQuery','action','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult'];(function(_0x5ae288,_0x12f312){var _0x2ff4cc=function(_0x43c51e){while(--_0x43c51e){_0x5ae288['push'](_0x5ae288['shift']());}};_0x2ff4cc(++_0x12f312);}(_0xeba2,0x122));var _0x2eba=function(_0x454bd3,_0x3e4d94){_0x454bd3=_0x454bd3-0x0;var _0x4eb066=_0xeba2[_0x454bd3];return _0x4eb066;};'use strict';var apiai=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x2eba('0x2'));var md5=require(_0x2eba('0x3'));var path=require('path');var querystring=require(_0x2eba('0x4'));var rp=require(_0x2eba('0x5'));var rs=require(_0x2eba('0x6'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x2eba('0x7'))[_0x2eba('0x8')];var util=require(_0x2eba('0x9'));var aws=require(_0x2eba('0xa'));var google=require(_0x2eba('0xb'));var sestek=require(_0x2eba('0xc'));var tilde=require(_0x2eba('0xd'));var logger=require(_0x2eba('0xe'))(_0x2eba('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0xf33fe,_0x1fdff7){return new BPromise(function(_0x1c153c,_0x5d1254){var _0x4aabac=urlParse(_0xf33fe);var _0x29d30d=_0x4aabac[_0x2eba('0x10')]===_0x2eba('0x11')?https:http;var _0x516f2d={'host':_0x4aabac[_0x2eba('0x12')],'path':_0x4aabac[_0x2eba('0x13')],'headers':{'user-agent':_0x2eba('0x14')}};_0x29d30d[_0x2eba('0x15')](_0x516f2d,function(_0x29c940){if(_0x29c940[_0x2eba('0x16')]!==0xc8){logger[_0x2eba('0x17')]('request\x20to\x20'+_0xf33fe+_0x2eba('0x18')+_0x29c940[_0x2eba('0x16')]+'\x20('+_0x29c940[_0x2eba('0x19')]+')');_0x5d1254(new Error(_0x2eba('0x1a')+_0xf33fe+_0x2eba('0x18')+_0x29c940[_0x2eba('0x16')]+'\x20('+_0x29c940[_0x2eba('0x19')]+')'));return;}var _0x473515=fs[_0x2eba('0x1b')](_0x1fdff7);_0x473515['on'](_0x2eba('0x1c'),function(){logger['info']('finish\x20download\x20file');_0x473515[_0x2eba('0x1d')](_0x1c153c);});_0x473515['on'](_0x2eba('0x17'),function(_0x319752){fs['unlink'](_0x1fdff7);logger['error']('download\x20error',_0x319752);_0x5d1254(_0x319752);});_0x29c940['pipe'](_0x473515);})['on']('error',function(_0x13c36e){logger[_0x2eba('0x17')](_0x13c36e);_0x5d1254(_0x13c36e);})['end']();});}function uploadFile(_0x27c1ad){return new BPromise(function(_0x29cb86,_0x14ee87){var _0x3ea830=urlParse(_0x27c1ad);var _0x330b66=_0x3ea830[_0x2eba('0x10')]==='https:'?https:http;var _0x575267={'host':_0x3ea830['host'],'path':_0x3ea830[_0x2eba('0x13')],'headers':{'user-agent':_0x2eba('0x14')}};_0x330b66[_0x2eba('0x15')](_0x575267,function(_0x2f0b79){if(_0x2f0b79['statusCode']!==0xc8){_0x14ee87(new Error('request\x20to\x20'+_0x27c1ad+_0x2eba('0x18')+_0x2f0b79[_0x2eba('0x16')]+'\x20('+_0x2f0b79[_0x2eba('0x19')]+')'));return;}var _0x227c06='';_0x2f0b79['on'](_0x2eba('0x1e'),function(_0x4a77fb){_0x227c06+=_0x4a77fb;});_0x2f0b79['on'](_0x2eba('0x1f'),function(){_0x29cb86(_0x227c06);});})['on'](_0x2eba('0x17'),function(_0xae3492){_0x14ee87(_0xae3492);})[_0x2eba('0x1f')]();});}function convertFile(_0x4ba133,_0x46f58d){return new BPromise(function(_0x48324d,_0x39880c){var _0x10e530=sox[_0x2eba('0x20')](_0x4ba133,_0x46f58d,{'sampleRate':0x1f40,'format':_0x2eba('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x10e530['on']('error',function(_0x56cfcc){logger[_0x2eba('0x17')](_0x2eba('0x22'),_0x56cfcc);_0x39880c(_0x56cfcc);});_0x10e530['on'](_0x2eba('0x1f'),function(){logger[_0x2eba('0x23')](_0x2eba('0x24'));_0x48324d();});_0x10e530['start']();});}function base64Decode(_0x1c2172,_0x4253e7){var _0x2dcc18=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x28'));fs[_0x2eba('0x29')](_0x2dcc18,_0x1c2172,_0x2eba('0x2a'));return convertFile(_0x2dcc18,_0x4253e7)[_0x2eba('0x2b')](function(){try{fs['unlink'](_0x2dcc18);fs[_0x2eba('0x2c')](_0x4253e7,_0x2eba('0x2d'));}catch(_0x4a9cc1){logger[_0x2eba('0x17')](_0x4a9cc1);}return _0x4253e7['split']('.')[0x0];});}function base64Encode(_0x537020){var _0x9f9b7b=fs[_0x2eba('0x2e')](_0x537020);return new Buffer(_0x9f9b7b)['toString'](_0x2eba('0x2a'));}exports['googleCloudTTS']=function(_0x40f250,_0x134f39,_0x143860,_0x5515b9,_0x264f3b,_0x363be2){var _0x44b261,_0x56da86;var _0x1b1b4e=_0x2eba('0x2f');var _0x3e4440=_0x2eba('0x30')+_0x40f250;var _0x575dbd={};if(_0x134f39==='ssml'){_0x575dbd['input']={'ssml':_0x143860};}else{_0x575dbd['input']={'text':_0x143860};};_0x575dbd[_0x2eba('0x31')]={'languageCode':_0x5515b9,'ssmlGender':_0x264f3b};_0x575dbd[_0x2eba('0x32')]={'audioEncoding':_0x2eba('0x33'),'sampleRateHertz':0x1f40};var _0xc4c894={'url':_0x1b1b4e+_0x2eba('0x34')+_0x3e4440,'method':_0x2eba('0x35'),'json':!![],'body':_0x575dbd};return rp(_0xc4c894)[_0x2eba('0x2b')](function(_0x8acad0){return new BPromise(function(_0xc1e97f,_0x3a959e){_0x44b261=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x36'));var _0x354bcd=Buffer[_0x2eba('0x37')](_0x8acad0[_0x2eba('0x38')],_0x2eba('0x2a'));return fs[_0x2eba('0x39')](_0x44b261,_0x354bcd,function(_0x5f50df){_0x3a959e(_0x5f50df);},function(_0x6ac160){fs[_0x2eba('0x2c')](_0x44b261,_0x2eba('0x2d'));_0xc1e97f(_0x6ac160);});});})[_0x2eba('0x2b')](function(_0x5f39d2){_0x56da86=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x28'));return convertFile(_0x44b261,_0x56da86);})[_0x2eba('0x2b')](function(){try{fs[_0x2eba('0x3a')](_0x44b261);fs[_0x2eba('0x2c')](_0x56da86,'777');}catch(_0x50d758){logger[_0x2eba('0x17')](_0x50d758);}logger[_0x2eba('0x23')]('googleCloudTTS\x20path',_0x56da86[_0x2eba('0x3b')]('.')[0x0]);return _0x56da86[_0x2eba('0x3b')]('.')[0x0];});};exports[_0x2eba('0x3c')]=function(_0x341092,_0x5cf275){var _0x1bed85=_0x2eba('0x3d');var _0x4c2999,_0x3196e5;var _0x2881b4;var _0x4f48f9={'encoding':_0x2eba('0x3e'),'method':_0x2eba('0x35'),'timeout':0x2710,'url':_0x1bed85,'headers':{'Content-Type':_0x2eba('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0x2eba('0x40')]([[[_0x2eba('0x41'),JSON[_0x2eba('0x40')]([_0x341092,_0x5cf275||'en',![],'null']),null,'generic']]]))};return rp(_0x4f48f9)[_0x2eba('0x2b')](function(_0x27d8bd){try{_0x2881b4=eval(_0x27d8bd[_0x2eba('0x42')](0x5))[0x0][0x2];}catch(_0x90d844){throw new Error('parse\x20response\x20failed:\x0a'+_0x27d8bd[_0x2eba('0x1e')]);}if(!_0x2881b4){if(_0x341092['length']>0xc8){throw new Error(_0x2eba('0x43'));}else{throw new Error(_0x2eba('0x44')+_0x5cf275+'\x22\x20might\x20not\x20exist');}}try{_0x2881b4=eval(_0x2881b4)[0x0];}catch(_0xcc9940){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x2eba('0x1e')]);}const _0x18c09f=_0x2881b4;_0x4c2999=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs['generate'](0x4)+_0x2eba('0x36'));fs[_0x2eba('0x29')](_0x4c2999,_0x2881b4,{'encoding':_0x2eba('0x2a')});_0x3196e5=path['resolve'](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+'.wav');return convertFile(_0x4c2999,_0x3196e5);})['then'](function(){try{fs[_0x2eba('0x3a')](_0x4c2999);fs[_0x2eba('0x2c')](_0x3196e5,_0x2eba('0x2d'));}catch(_0xa035f1){logger['error'](_0xa035f1);}logger[_0x2eba('0x23')](_0x2eba('0x45'),_0x3196e5[_0x2eba('0x3b')]('.')[0x0]);return _0x3196e5[_0x2eba('0x3b')]('.')[0x0];});};exports['googleASR']=function(_0x54fb33,_0x3e9f94,_0x463c6e){return google[_0x2eba('0x46')](_0x54fb33,_0x3e9f94,_0x463c6e)[_0x2eba('0x2b')](function(_0x38bcf9){logger[_0x2eba('0x23')](_0x38bcf9['uri']);return rp(_0x38bcf9);})[_0x2eba('0x2b')](function(_0x27d4a4){var _0x5479f1='';var _0x2b00de=0x0;try{fs[_0x2eba('0x3a')](_0x54fb33);}catch(_0x46e4f2){logger[_0x2eba('0x17')](_0x46e4f2);}if(_0x27d4a4&&_0x27d4a4[_0x2eba('0x47')]){_0x5479f1=_0x27d4a4[_0x2eba('0x47')][_0x2eba('0x48')](function(_0x1e03a5){return _0x1e03a5&&_0x1e03a5[_0x2eba('0x49')][0x0]&&_0x1e03a5[_0x2eba('0x49')][0x0][_0x2eba('0x4a')]?_0x1e03a5[_0x2eba('0x49')][0x0][_0x2eba('0x4a')]:'';})[_0x2eba('0x4b')]('\x0a');_0x2b00de=_0x27d4a4[_0x2eba('0x47')]['map'](function(_0x6a38cb){return _0x6a38cb&&_0x6a38cb[_0x2eba('0x49')][0x0]&&_0x6a38cb[_0x2eba('0x49')][0x0][_0x2eba('0x4c')]?_0x6a38cb[_0x2eba('0x49')][0x0][_0x2eba('0x4c')]:0x0;})[_0x2eba('0x4b')]('\x0a');}logger[_0x2eba('0x23')](_0x2eba('0x4d'),_0x5479f1);logger[_0x2eba('0x23')]('googleASR\x20confidence',_0x2b00de);return{'transcript':_0x5479f1,'confidence':_0x2b00de};})[_0x2eba('0x4e')](function(_0x46c6e2){logger['error'](_0x2eba('0x4f'),_0x46c6e2[_0x2eba('0x16')],_0x46c6e2[_0x2eba('0x50')],_0x46c6e2[_0x2eba('0x51')]);});};exports[_0x2eba('0x52')]=function(_0x400f2e,_0x1318ba,_0x4deea9,_0x27e117){var _0x5051f6=apiai(_0x1318ba,{'language':_0x27e117||'en'});return _0x5051f6['textRequest'](_0x4deea9,{'sessionId':md5(_0x400f2e)})[_0x2eba('0x2b')](function(_0x40739e){logger[_0x2eba('0x23')](JSON[_0x2eba('0x40')](_0x40739e));return{'source':_0x40739e[_0x2eba('0x53')][_0x2eba('0x54')],'resolvedQuery':_0x40739e[_0x2eba('0x53')][_0x2eba('0x55')],'action':_0x40739e['result'][_0x2eba('0x56')],'actionIncomplete':_0x40739e[_0x2eba('0x53')]['actionIncomplete'],'speech':_0x40739e['result']['fulfillment']['speech'],'score':_0x40739e[_0x2eba('0x53')][_0x2eba('0x57')],'statusCode':_0x40739e[_0x2eba('0x58')][_0x2eba('0x59')],'endConversation':_0x40739e[_0x2eba('0x53')]['metadata'][_0x2eba('0x5a')]||![],'isFallbackIntent':_0x40739e[_0x2eba('0x53')][_0x2eba('0x5b')][_0x2eba('0x5c')]};});};exports[_0x2eba('0x5d')]=function(_0x2c3386,_0x5b9285,_0x2bb961,_0x3c89b4,_0x28dad1,_0x1359cf){var _0x485a78=_0x3c89b4[_0x2eba('0x5e')](/\\n/g,'\x0a');var _0x2a897e={'credentials':{'private_key':_0x485a78,'client_email':_0x2bb961}};var _0x37f4c3=new dialogflow[(_0x2eba('0x5f'))](_0x2a897e);var _0x442d9f=_0x37f4c3['sessionPath'](_0x5b9285,md5(_0x2c3386));var _0x31fb8d={'session':_0x442d9f,'queryInput':{'text':{'text':_0x28dad1,'languageCode':_0x1359cf}}};return _0x37f4c3[_0x2eba('0x60')](_0x31fb8d)[_0x2eba('0x2b')](function(_0x5cae51){if(_0x5cae51&&_0x5cae51[_0x2eba('0x61')]){logger[_0x2eba('0x23')](_0x2eba('0x62'),JSON[_0x2eba('0x40')](_0x5cae51));var _0x3b99b7=_0x5cae51[0x0];if(_0x3b99b7){var _0x4c12f9={'action':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x56')],'allRequiredParamsPresent':_0x3b99b7['queryResult'][_0x2eba('0x64')],'endConversation':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x65')]&&_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x65')][_0x2eba('0x66')]?_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x65')]['fields']['end_conversation'][_0x2eba('0x67')]:![],'fulfillmentText':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x68')],'intentName':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x69')][_0x2eba('0x50')],'intentDisplayName':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x69')]['displayName'],'isFallbackIntent':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x69')][_0x2eba('0x6a')],'languageCode':_0x3b99b7[_0x2eba('0x63')]['languageCode'],'queryText':_0x3b99b7[_0x2eba('0x63')][_0x2eba('0x6b')],'responseId':_0x3b99b7[_0x2eba('0x6c')],'score':_0x3b99b7['queryResult'][_0x2eba('0x6d')],'speech':_0x3b99b7['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x2eba('0x40')](_0x5cae51)};return _0x4c12f9;}}});};exports[_0x2eba('0x6e')]=function(_0x5993d3,_0x2e7ea6,_0x295c9c,_0x55fd44){return tilde['asr'](_0x5993d3,_0x2e7ea6,_0x295c9c,_0x55fd44)[_0x2eba('0x2b')](function(_0x400166){try{fs[_0x2eba('0x3a')](_0x5993d3);}catch(_0x511286){logger[_0x2eba('0x17')](_0x511286);}logger['info']('Tilde\x20ASR\x20transcription',_0x400166[_0x2eba('0x4a')]);logger[_0x2eba('0x23')](_0x2eba('0x6f'),_0x400166[_0x2eba('0x4c')]);return _0x400166;});};exports[_0x2eba('0x70')]=function(_0x469e8c,_0x1e8249,_0x35147f,_0x1b1640,_0x5024a8,_0x3c142e){var _0x4e8514=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x36'));var _0x49e308;return aws['polly'](_0x469e8c,_0x1e8249,_0x35147f,_0x1b1640,_0x5024a8,_0x3c142e,_0x4e8514)[_0x2eba('0x2b')](function(){_0x49e308=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x28'));return convertFile(_0x4e8514,_0x49e308);})[_0x2eba('0x2b')](function(){try{fs[_0x2eba('0x3a')](_0x4e8514);fs[_0x2eba('0x2c')](_0x49e308,_0x2eba('0x2d'));}catch(_0x125164){logger[_0x2eba('0x17')](_0x125164);}return _0x49e308[_0x2eba('0x3b')]('.')[0x0];});};exports[_0x2eba('0x71')]=function(_0x26fdb8,_0x2e111b,_0xdba063,_0x523ea8,_0x7fed81,_0x42b94c){return aws[_0x2eba('0x72')](_0x26fdb8,_0x2e111b,_0xdba063,_0x523ea8,_0x7fed81,_0x42b94c)[_0x2eba('0x2b')](function(_0xf7b118){logger[_0x2eba('0x23')](JSON[_0x2eba('0x40')](_0xf7b118));return _0xf7b118;});};exports['ispeechTTS']=function(_0x9a74fa,_0x2427bf,_0x10a5ee,_0xd8008b){var _0x162d9b=util['format'](_0x2eba('0x73'),ISPEECH_API,_0x9a74fa,encodeURIComponent(_0x2427bf),_0x10a5ee,_0xd8008b);var _0x13833e=path[_0x2eba('0x25')](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x36'));var _0x3b7fc0;return downloadFile(_0x162d9b,_0x13833e)[_0x2eba('0x2b')](function(){_0x3b7fc0=path['resolve'](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+'.wav');return convertFile(_0x13833e,_0x3b7fc0);})['then'](function(){try{fs[_0x2eba('0x3a')](_0x13833e);fs[_0x2eba('0x2c')](_0x3b7fc0,_0x2eba('0x2d'));}catch(_0x2cd64d){logger[_0x2eba('0x17')](_0x2cd64d);}return _0x3b7fc0[_0x2eba('0x3b')]('.')[0x0];});};exports[_0x2eba('0x74')]=function(_0x3d42dd,_0x8c0a57,_0x5536a8,_0x53d65a){var _0x129968=util[_0x2eba('0x75')](_0x2eba('0x76'),ISPEECH_API,_0x8c0a57,_0x5536a8,base64Encode(_0x3d42dd),_0x53d65a?util['format'](_0x2eba('0x77'),encodeURIComponent(_0x53d65a)):_0x2eba('0x78'));return uploadFile(_0x129968)['then'](function(_0x28903e){return querystring[_0x2eba('0x8')](_0x28903e);});};exports[_0x2eba('0x79')]=function(_0x2f8b96,_0x3ae136){return sestek[_0x2eba('0x7a')](_0x2f8b96,_0x3ae136)[_0x2eba('0x2b')](function(_0x508743){logger['info'](JSON[_0x2eba('0x40')](_0x508743));var _0x24de63={'speech':_0x508743[_0x2eba('0x7b')],'action':_0x508743[_0x2eba('0x7c')]?_0x508743['channelData'][_0x2eba('0x7d')]:undefined,'actiondata':_0x508743[_0x2eba('0x7c')]?_0x508743[_0x2eba('0x7c')][_0x2eba('0x7e')]:undefined};if(_0x508743[_0x2eba('0x7c')]&&_0x508743[_0x2eba('0x7c')]['AudioFromTts']){return base64Decode(_0x508743[_0x2eba('0x7c')][_0x2eba('0x7f')]['Data'],path['resolve'](__dirname,_0x2eba('0x26'),rs[_0x2eba('0x27')](0x4)+_0x2eba('0x28')))['then'](function(_0x14361f){_0x24de63[_0x2eba('0x80')]=_0x14361f;return _0x24de63;});}return _0x24de63;});};exports[_0x2eba('0x81')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 917ead6..665c27d 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 _0x4a40=['exports','./nda'];(function(_0x6bbb78,_0x3a3015){var _0x2d37b9=function(_0x24212d){while(--_0x24212d){_0x6bbb78['push'](_0x6bbb78['shift']());}};_0x2d37b9(++_0x3a3015);}(_0x4a40,0xeb));var _0x04a4=function(_0x171945,_0xd87274){_0x171945=_0x171945-0x0;var _0x2d73e6=_0x4a40[_0x171945];return _0x2d73e6;};var nda=require(_0x04a4('0x0'));module[_0x04a4('0x1')]={'nda':nda}; \ No newline at end of file +var _0x77bf=['exports','./nda'];(function(_0x86e67a,_0x5c26ea){var _0x595003=function(_0x1638e6){while(--_0x1638e6){_0x86e67a['push'](_0x86e67a['shift']());}};_0x595003(++_0x5c26ea);}(_0x77bf,0xd5));var _0xf77b=function(_0x50b411,_0x3743b2){_0x50b411=_0x50b411-0x0;var _0x2e973e=_0x77bf[_0x50b411];return _0x2e973e;};var nda=require(_0xf77b('0x0'));module[_0xf77b('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 1b149bc..2061c08 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 _0x0565=['resolve','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','Bearer\x20','channelData','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x0565,0xf2));var _0x5056=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x0565[_0x45783c];return _0x1161da;};'use strict';var rp=require(_0x5056('0x0'));var url=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));module[_0x5056('0x4')]=function(_0x397289,_0xd4624d){var _0x300055={'method':_0x5056('0x5'),'uri':url[_0x5056('0x6')](_0xd4624d['ndauth_url'],_0x5056('0x7')),'form':{'grant_type':_0x5056('0x8'),'username':_0xd4624d[_0x5056('0x9')],'password':_0xd4624d[_0x5056('0x8')]},'json':!![]};return rp(_0x300055)['then'](function(_0x52b01f){var _0x38f74={'method':_0x5056('0x5'),'uri':url[_0x5056('0x6')](_0xd4624d[_0x5056('0xa')],_0x5056('0xb')),'body':{'type':_0xd4624d[_0x5056('0xc')]||_0x5056('0xd'),'channelId':_0x5056('0xe'),'conversation':{'id':_0x397289['uniqueid']},'from':{'id':_0x397289[_0x5056('0xf')],'name':_0x397289[_0x5056('0x10')]},'recipient':{'id':_0x397289[_0x5056('0x11')],'name':_0x397289['extension']},'text':_0xd4624d['text'],'channelData':{}},'headers':{'Authorization':_0x5056('0x12')+_0x52b01f['access_token']},'json':!![]};if(_0xd4624d['project']){_0x38f74['body'][_0x5056('0x13')]['ProjectName']=_0xd4624d[_0x5056('0x14')];}if(_0xd4624d[_0x5056('0x15')]=='1'){_0x38f74[_0x5056('0x16')]['channelData'][_0x5056('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5056('0x18')};}if(_0xd4624d[_0x5056('0x19')]){_0x38f74[_0x5056('0x16')][_0x5056('0x13')][_0x5056('0x1a')]=_0xd4624d['custom_action'];if(_0xd4624d[_0x5056('0x1b')]){_0x38f74['body'][_0x5056('0x13')][_0x5056('0x1c')]=_0xd4624d[_0x5056('0x1b')];}}logger[_0x5056('0x1d')](JSON[_0x5056('0x1e')](_0x38f74));return rp(_0x38f74);});}; \ No newline at end of file +var _0x0b96=['then','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','CustomActionData','custom_action_data','request-promise','url','../../../../../config/logger','exports','POST','resolve','/token','password','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b96,0xa5));var _0x60b9=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x0b96[_0x1dac7a];return _0x4cb363;};'use strict';var rp=require(_0x60b9('0x0'));var url=require(_0x60b9('0x1'));var logger=require(_0x60b9('0x2'))('agi');module[_0x60b9('0x3')]=function(_0x13616a,_0x23a080){var _0x4a68ca={'method':_0x60b9('0x4'),'uri':url[_0x60b9('0x5')](_0x23a080['ndauth_url'],_0x60b9('0x6')),'form':{'grant_type':_0x60b9('0x7'),'username':_0x23a080[_0x60b9('0x8')],'password':_0x23a080[_0x60b9('0x7')]},'json':!![]};return rp(_0x4a68ca)[_0x60b9('0x9')](function(_0x28d32f){var _0x1e5cef={'method':'POST','uri':url[_0x60b9('0x5')](_0x23a080['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x23a080[_0x60b9('0xa')]||_0x60b9('0xb'),'channelId':_0x60b9('0xc'),'conversation':{'id':_0x13616a[_0x60b9('0xd')]},'from':{'id':_0x13616a['callerid'],'name':_0x13616a[_0x60b9('0xe')]},'recipient':{'id':_0x13616a[_0x60b9('0xf')],'name':_0x13616a[_0x60b9('0x10')]},'text':_0x23a080['text'],'channelData':{}},'headers':{'Authorization':_0x60b9('0x11')+_0x28d32f[_0x60b9('0x12')]},'json':!![]};if(_0x23a080[_0x60b9('0x13')]){_0x1e5cef[_0x60b9('0x14')][_0x60b9('0x15')][_0x60b9('0x16')]=_0x23a080[_0x60b9('0x13')];}if(_0x23a080[_0x60b9('0x17')]=='1'){_0x1e5cef[_0x60b9('0x14')][_0x60b9('0x15')][_0x60b9('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x23a080[_0x60b9('0x19')]){_0x1e5cef[_0x60b9('0x14')][_0x60b9('0x15')][_0x60b9('0x1a')]=_0x23a080[_0x60b9('0x19')];if(_0x23a080['custom_action_data']){_0x1e5cef[_0x60b9('0x14')][_0x60b9('0x15')][_0x60b9('0x1b')]=_0x23a080[_0x60b9('0x1c')];}}logger['info'](JSON['stringify'](_0x1e5cef));return rp(_0x1e5cef);});}; \ 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 c68e4c3..e17b54a 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 _0x709b=['./lib/api','exports'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x709b,0x1ea));var _0xb709=function(_0x4f030a,_0x2e4618){_0x4f030a=_0x4f030a-0x0;var _0x45ce23=_0x709b[_0x4f030a];return _0x45ce23;};'use strict';var asr=require(_0xb709('0x0'));module[_0xb709('0x1')]=function(_0x47f7ff,_0x1a27b1,_0x2e5874,_0x6d0445){return asr(_0x47f7ff,_0x1a27b1,_0x2e5874,_0x6d0445);}; \ No newline at end of file +var _0x1f8e=['./lib/api','exports'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x1f8e,0xa4));var _0xe1f8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x1f8e[_0xaa0309];return _0x5de7ce;};'use strict';var asr=require(_0xe1f8('0x0'));module[_0xe1f8('0x1')]=function(_0x2739c3,_0x5aef4c,_0x1ae2d5,_0x582abe){return asr(_0x2739c3,_0x5aef4c,_0x1ae2d5,_0x582abe);}; \ 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 6b0b18c..39cbfbb 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 _0x8cf7=['close','bluebird','lodash','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8cf7,0xcd));var _0x78cf=function(_0x14af04,_0x5ab6c4){_0x14af04=_0x14af04-0x0;var _0x44cb0a=_0x8cf7[_0x14af04];return _0x44cb0a;};'use strict';var BPromise=require(_0x78cf('0x0'));var _=require(_0x78cf('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0x78cf('0x2')]=function(_0x48e53c,_0x4e2008,_0x44d107,_0x2f0985){return new BPromise(function(_0x1f77b7,_0x15da71){logger[_0x78cf('0x3')](_0x78cf('0x4'),_0x2f0985||_0x78cf('0x5'));var _0x3460d1=new WebSocket(_0x2f0985||_0x78cf('0x5'),{'perMessageDeflate':![]});var _0xa576e3='';var _0x3dfbbb='0';var _0x2e02d5='1';var _0x3f8915='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x5b8d54(_0x4bd14a){var _0x1aa602=crypto['createHash'](_0x78cf('0x6'));_0x1aa602[_0x78cf('0x7')](_0x4bd14a);return _0x1aa602['digest'](_0x78cf('0x8'));}function _0x312ffd(){try{logger[_0x78cf('0x3')](_0x78cf('0x9'));var _0xb63345=moment()[_0x78cf('0xa')]();var _0xe70cf2=_0x5b8d54(_0xb63345+_0x4e2008+_0x44d107);_0x3460d1[_0x78cf('0xb')](JSON[_0x78cf('0xc')]({'appID':_0x4e2008,'timestamp':_0xb63345,'appKey':_0xe70cf2}));var _0x5ff9b8=fs['createReadStream'](_0x48e53c);_0x5ff9b8['on'](_0x78cf('0xd'),function(_0x248f38){_0x3460d1['send'](_0x248f38);});_0x5ff9b8['on']('close',function(){_0x3460d1[_0x78cf('0xb')](_0x78cf('0xe'));});}catch(_0xe9e089){logger[_0x78cf('0xf')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0xe9e089));_0x3460d1[_0x78cf('0x10')]();}}function _0x4176a1(_0x8a3c76){try{if(_0x8a3c76){var _0x54196e=JSON[_0x78cf('0x11')](_0x8a3c76);switch(_0x54196e['status']){case 0x0:if(_0x54196e[_0x78cf('0x12')]){if(_0x54196e['result'][_0x78cf('0x13')]){logger[_0x78cf('0x3')](_0x78cf('0x14'),JSON[_0x78cf('0xc')](_0x54196e[_0x78cf('0x12')]['hypotheses']));_0xa576e3=_0x54196e['result']['hypotheses'][0x0]['transcript'];_0x3dfbbb=_0x54196e[_0x78cf('0x12')]['hypotheses'][0x0][_0x78cf('0x15')];_0x2e02d5='0';_0x3f8915='Success.';_0x3460d1[_0x78cf('0x10')]();}}break;case 0x1:logger[_0x78cf('0x3')](_0x78cf('0x16'));_0x2e02d5='1';_0x3f8915=_0x78cf('0x16');break;case 0x2:logger[_0x78cf('0x3')](_0x78cf('0x17'));_0x2e02d5='2';_0x3f8915='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x78cf('0x3')](_0x78cf('0x18'));_0x2e02d5='9';_0x3f8915=_0x78cf('0x18');break;case 0xa:logger[_0x78cf('0x3')](_0x78cf('0x19'));_0x2e02d5='10';_0x3f8915='Authentication\x20failed.';break;case 0xb:logger[_0x78cf('0x3')](_0x78cf('0x1a'));_0x2e02d5='11';_0x3f8915=_0x78cf('0x1a');}}}catch(_0x1a37e3){logger['error'](_0x78cf('0x1b'),JSON[_0x78cf('0xc')](_0x1a37e3));_0x3460d1[_0x78cf('0x10')]();}}function _0x585462(){logger[_0x78cf('0x3')]('Close\x20Tilde\x20ASR\x20socket');_0x1f77b7({'transcript':_0xa576e3,'confidence':_0x3dfbbb,'status':_0x2e02d5,'status_message':_0x3f8915});}function _0xf3b221(_0x10ab05){logger[_0x78cf('0xf')](_0x78cf('0x1c'));if(!_[_0x78cf('0x1d')](_0x10ab05)){logger[_0x78cf('0xf')](_[_0x78cf('0x1e')](_0x10ab05)?JSON[_0x78cf('0xc')](_0x10ab05):_0x10ab05);}}_0x3460d1['on'](_0x78cf('0x1f'),_0x312ffd);_0x3460d1['on'](_0x78cf('0x20'),_0x4176a1);_0x3460d1['on'](_0x78cf('0x21'),_0x585462);_0x3460d1['on']('error',_0xf3b221);});}; \ No newline at end of file +var _0xb5f2=['bluebird','lodash','moment','../../../../../../config/logger','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0xb5f2,0x1c7));var _0x2b5f=function(_0x166f4c,_0x55923a){_0x166f4c=_0x166f4c-0x0;var _0x51489f=_0xb5f2[_0x166f4c];return _0x51489f;};'use strict';var BPromise=require(_0x2b5f('0x0'));var _=require(_0x2b5f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2b5f('0x2'));var crypto=require('crypto');var logger=require(_0x2b5f('0x3'))('agi');module['exports']=function(_0x5816f6,_0x5ab7cc,_0x5c423c,_0x3ddb76){return new BPromise(function(_0x454c3a,_0x12ddee){logger[_0x2b5f('0x4')](_0x2b5f('0x5'),_0x3ddb76||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x466a63=new WebSocket(_0x3ddb76||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x5d0b0a='';var _0x4be163='0';var _0x382691='1';var _0x2bb170=_0x2b5f('0x6');function _0x2268cf(_0x1a8564){var _0x3cac42=crypto[_0x2b5f('0x7')]('sha1');_0x3cac42[_0x2b5f('0x8')](_0x1a8564);return _0x3cac42['digest']('hex');}function _0x1e5152(){try{logger[_0x2b5f('0x4')](_0x2b5f('0x9'));var _0x3c04bb=moment()[_0x2b5f('0xa')]();var _0x24b6ff=_0x2268cf(_0x3c04bb+_0x5ab7cc+_0x5c423c);_0x466a63['send'](JSON[_0x2b5f('0xb')]({'appID':_0x5ab7cc,'timestamp':_0x3c04bb,'appKey':_0x24b6ff}));var _0x18e8e6=fs[_0x2b5f('0xc')](_0x5816f6);_0x18e8e6['on'](_0x2b5f('0xd'),function(_0x10e656){_0x466a63[_0x2b5f('0xe')](_0x10e656);});_0x18e8e6['on'](_0x2b5f('0xf'),function(){_0x466a63[_0x2b5f('0xe')]('EOS');});}catch(_0x4aec2c){logger[_0x2b5f('0x10')](_0x2b5f('0x11'),JSON[_0x2b5f('0xb')](_0x4aec2c));_0x466a63['terminate']();}}function _0xbf08e(_0x4a6ce7){try{if(_0x4a6ce7){var _0x40aa2e=JSON[_0x2b5f('0x12')](_0x4a6ce7);switch(_0x40aa2e[_0x2b5f('0x13')]){case 0x0:if(_0x40aa2e[_0x2b5f('0x14')]){if(_0x40aa2e[_0x2b5f('0x14')][_0x2b5f('0x15')]){logger[_0x2b5f('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0x2b5f('0xb')](_0x40aa2e[_0x2b5f('0x14')][_0x2b5f('0x16')]));_0x5d0b0a=_0x40aa2e['result'][_0x2b5f('0x16')][0x0]['transcript'];_0x4be163=_0x40aa2e[_0x2b5f('0x14')][_0x2b5f('0x16')][0x0][_0x2b5f('0x17')];_0x382691='0';_0x2bb170=_0x2b5f('0x18');_0x466a63[_0x2b5f('0x19')]();}}break;case 0x1:logger[_0x2b5f('0x4')](_0x2b5f('0x6'));_0x382691='1';_0x2bb170=_0x2b5f('0x6');break;case 0x2:logger['info'](_0x2b5f('0x1a'));_0x382691='2';_0x2bb170=_0x2b5f('0x1a');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x382691='9';_0x2bb170=_0x2b5f('0x1b');break;case 0xa:logger[_0x2b5f('0x4')](_0x2b5f('0x1c'));_0x382691='10';_0x2bb170=_0x2b5f('0x1c');break;case 0xb:logger[_0x2b5f('0x4')](_0x2b5f('0x1d'));_0x382691='11';_0x2bb170=_0x2b5f('0x1d');}}}catch(_0x2d79e7){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x2b5f('0xb')](_0x2d79e7));_0x466a63[_0x2b5f('0x19')]();}}function _0x522aa5(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x454c3a({'transcript':_0x5d0b0a,'confidence':_0x4be163,'status':_0x382691,'status_message':_0x2bb170});}function _0x580e17(_0x3ad0c8){logger[_0x2b5f('0x10')](_0x2b5f('0x1e'));if(!_[_0x2b5f('0x1f')](_0x3ad0c8)){logger[_0x2b5f('0x10')](_[_0x2b5f('0x20')](_0x3ad0c8)?JSON[_0x2b5f('0xb')](_0x3ad0c8):_0x3ad0c8);}}_0x466a63['on'](_0x2b5f('0x21'),_0x1e5152);_0x466a63['on'](_0x2b5f('0x22'),_0xbf08e);_0x466a63['on'](_0x2b5f('0xf'),_0x522aa5);_0x466a63['on'](_0x2b5f('0x10'),_0x580e17);});}; \ 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 944e16c..07b999e 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 _0x8e30=['exports','./asr'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x8e30,0x113));var _0x08e3=function(_0x4d15e8,_0x32386e){_0x4d15e8=_0x4d15e8-0x0;var _0x10e13b=_0x8e30[_0x4d15e8];return _0x10e13b;};var asr=require(_0x08e3('0x0'));module[_0x08e3('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6f7f=['exports','./asr'];(function(_0x4ede09,_0x18801d){var _0x253193=function(_0xa4c752){while(--_0xa4c752){_0x4ede09['push'](_0x4ede09['shift']());}};_0x253193(++_0x18801d);}(_0x6f7f,0x137));var _0xf6f7=function(_0x42f63c,_0x4ef8a3){_0x42f63c=_0x42f63c-0x0;var _0x194f22=_0x6f7f[_0x42f63c];return _0x194f22;};var asr=require(_0xf6f7('0x0'));module[_0xf6f7('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 50be61d..a7f0ebd 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 _0xf5c3=['EventEmitter','./error','./channel','127.0.0.1','call','error','createServer','listen','listening','connection','getConnections','emit','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events'];(function(_0x3f7869,_0x19a57f){var _0x4c5697=function(_0xbf3dee){while(--_0xbf3dee){_0x3f7869['push'](_0x3f7869['shift']());}};_0x4c5697(++_0x19a57f);}(_0xf5c3,0x88));var _0x3f5c=function(_0xffa747,_0x525550){_0xffa747=_0xffa747-0x0;var _0x4a5607=_0xf5c3[_0xffa747];return _0x4a5607;};'use strict';var util=require(_0x3f5c('0x0'));var net=require('net');var EventEmitter=require(_0x3f5c('0x1'))[_0x3f5c('0x2')];var AGIError=require(_0x3f5c('0x3'));var AGIChannel=require(_0x3f5c('0x4'));var AGIServer=function(_0x3ab6ab,_0x4f1510,_0x2e5d7c){var _0x2cd151=this,_0x3ab6ab=_0x3ab6ab||0x11dd,_0x4f1510=_0x4f1510||_0x3f5c('0x5'),_0x3ec722=null,_0xc210f7=0x0;EventEmitter[_0x3f5c('0x6')](_0x2cd151);function _0x3fa9c4(){if(!_0x3ab6ab){_0x2cd151['emit'](_0x3f5c('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x3ec722=net[_0x3f5c('0x8')]();_0x3ec722[_0x3f5c('0x9')](_0x3ab6ab,_0x4f1510);_0x3ec722['on'](_0x3f5c('0xa'),function(){_0x2cd151['emit'](_0x3f5c('0xa'));});_0x3ec722['on'](_0x3f5c('0xb'),function(_0x3419b3){_0x3ec722[_0x3f5c('0xc')](function(_0xf288e7,_0x10130d){if(_0xf288e7){_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0xf288e7));}else if(_0x2e5d7c&&_0x2e5d7c<0x0){_0x2cd151[_0x3f5c('0xd')]('error',new AGIError(_0x3f5c('0xe')));_0x3419b3[_0x3f5c('0xf')]();}else if(_0x2e5d7c&&_0x2e5d7c>0x0&&_0x2e5d7c<_0x10130d){_0xc210f7+=0x1;_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xc210f7));_0x3419b3['destroy']();}else{var _0x38a2e5=new AGIChannel(_0x3419b3);_0x38a2e5['on'](_0x3f5c('0x10'),function(){_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0xb'),_0x38a2e5);});}});});_0x3ec722['on'](_0x3f5c('0x7'),function(_0x1d21d8){_0x2cd151['emit'](_0x3f5c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x1d21d8[_0x3f5c('0x11')]));});_0x3ec722['on'](_0x3f5c('0x12'),function(){_0x2cd151[_0x3f5c('0xd')](_0x3f5c('0x12'),new AGIError(_0x3f5c('0x13')));});}process[_0x3f5c('0x14')](function(){_0x3fa9c4();});};util[_0x3f5c('0x15')](AGIServer,EventEmitter);module[_0x3f5c('0x16')]=function(_0x4ca8fb,_0x33bfc2,_0x3902e3){return new AGIServer(_0x4ca8fb,_0x33bfc2,_0x3902e3);}; \ No newline at end of file +var _0x5650=['./channel','127.0.0.1','emit','E_AGI_ARGUMENT_PORT','createServer','listen','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error'];(function(_0x529aaa,_0x4dc537){var _0x190930=function(_0x15672b){while(--_0x15672b){_0x529aaa['push'](_0x529aaa['shift']());}};_0x190930(++_0x4dc537);}(_0x5650,0x1db));var _0x0565=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x5650[_0x2742db];return _0x18659e;};'use strict';var util=require(_0x0565('0x0'));var net=require(_0x0565('0x1'));var EventEmitter=require(_0x0565('0x2'))[_0x0565('0x3')];var AGIError=require(_0x0565('0x4'));var AGIChannel=require(_0x0565('0x5'));var AGIServer=function(_0x572456,_0x335528,_0x502903){var _0x1c08a4=this,_0x572456=_0x572456||0x11dd,_0x335528=_0x335528||_0x0565('0x6'),_0x4fa5d2=null,_0x1e8254=0x0;EventEmitter['call'](_0x1c08a4);function _0x5e0d5d(){if(!_0x572456){_0x1c08a4[_0x0565('0x7')]('error',new AGIError(_0x0565('0x8')));return![];}_0x4fa5d2=net[_0x0565('0x9')]();_0x4fa5d2[_0x0565('0xa')](_0x572456,_0x335528);_0x4fa5d2['on']('listening',function(){_0x1c08a4[_0x0565('0x7')]('listening');});_0x4fa5d2['on'](_0x0565('0xb'),function(_0x3c5d84){_0x4fa5d2[_0x0565('0xc')](function(_0x13bae7,_0x3b5911){if(_0x13bae7){_0x1c08a4[_0x0565('0x7')](_0x0565('0xd'),new AGIError(_0x0565('0xe'),_0x13bae7));}else if(_0x502903&&_0x502903<0x0){_0x1c08a4[_0x0565('0x7')](_0x0565('0xd'),new AGIError(_0x0565('0xf')));_0x3c5d84[_0x0565('0x10')]();}else if(_0x502903&&_0x502903>0x0&&_0x502903<_0x3b5911){_0x1e8254+=0x1;_0x1c08a4[_0x0565('0x7')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x1e8254));_0x3c5d84[_0x0565('0x10')]();}else{var _0x5e8598=new AGIChannel(_0x3c5d84);_0x5e8598['on'](_0x0565('0x11'),function(){_0x1c08a4['emit']('connection',_0x5e8598);});}});});_0x4fa5d2['on']('error',function(_0x43ac1d){_0x1c08a4[_0x0565('0x7')]('error',new AGIError(_0x0565('0xe'),_0x43ac1d[_0x0565('0x12')]));});_0x4fa5d2['on'](_0x0565('0x13'),function(){_0x1c08a4[_0x0565('0x7')](_0x0565('0x13'),new AGIError(_0x0565('0x14')));});}process[_0x0565('0x15')](function(){_0x5e0d5d();});};util[_0x0565('0x16')](AGIServer,EventEmitter);module[_0x0565('0x17')]=function(_0x44c84e,_0x1d01a7,_0x9b25dd){return new AGIServer(_0x44c84e,_0x1d01a7,_0x9b25dd);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 57bba46..420fe0b 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 _0x85b0=['ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Response:','inspect','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawBody','menu','getdigits','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','format','getQueryOdbc','info','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20odbc\x20database\x20found','replace','variable_id','forEach','keys','%s[%s][%s]','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','no\x20trunk\x20selected','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appid\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s'];(function(_0x2eee3d,_0xed25ae){var _0x149d3b=function(_0x5275fd){while(--_0x5275fd){_0x2eee3d['push'](_0x2eee3d['shift']());}};_0x149d3b(++_0xed25ae);}(_0x85b0,0x7f));var _0x085b=function(_0x31c359,_0x1d6736){_0x31c359=_0x31c359-0x0;var _0x35f3f7=_0x85b0[_0x31c359];return _0x35f3f7;};'use strict';var fs=require('fs');var path=require(_0x085b('0x0'));var util=require(_0x085b('0x1'));var _=require('lodash');var sh=require(_0x085b('0x2'));var odbc=require(_0x085b('0x3'))();var rs=require(_0x085b('0x4'));var moment=require(_0x085b('0x5'));var Mustache=require(_0x085b('0x6'));var rp=require(_0x085b('0x7'));var logger=require(_0x085b('0x8'))(_0x085b('0x9'));var config=require(_0x085b('0xa'));var scripts=require('./scripts');var FILES_PATH=_0x085b('0xb');var recursiveMapAttributes=['rawHeaders',_0x085b('0xc')];var verticesWithRetry=[_0x085b('0xd'),_0x085b('0xe'),'getsecretdigits'];var AGIVertices=function(_0x43a0a5,_0x2d71c9,_0x41a495){this['channel']=_0x43a0a5;this['rpc']=_0x2d71c9;this[_0x085b('0xf')]=_0x41a495;};AGIVertices[_0x085b('0x10')][_0x085b('0x11')]=function(_0x3cb024,_0x2eae03){this[_0x085b('0x12')][_0x085b('0x13')](_0x3cb024)[_0x085b('0x14')](function(_0x49c5cf){_0x2eae03(null,_0x49c5cf?_0x49c5cf[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x5b9d39){_0x2eae03(_0x5b9d39);});};AGIVertices[_0x085b('0x10')]['getVoiceQueue']=function(_0x494e68,_0x34a834){this['rpc'][_0x085b('0x17')](_0x494e68)[_0x085b('0x14')](function(_0x4b19bf){_0x34a834(null,_0x4b19bf?_0x4b19bf[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x2adb28){_0x34a834(_0x2adb28);});};AGIVertices['prototype'][_0x085b('0x18')]=function(_0x344f06,_0x31f0b6){this[_0x085b('0x12')]['getSquareProjectById'](_0x344f06)['then'](function(_0x36bf75){_0x31f0b6(null,_0x36bf75?_0x36bf75[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x260598){_0x31f0b6(_0x260598);});};AGIVertices[_0x085b('0x10')][_0x085b('0x19')]=function(_0xc20181,_0x532019){this[_0x085b('0x12')][_0x085b('0x1a')](_0xc20181)['then'](function(_0x21f8d7){_0x532019(null,_0x21f8d7?_0x21f8d7[_0x085b('0x1b')]:![]);})[_0x085b('0x16')](function(_0x3f8d7a){_0x532019(_0x3f8d7a);});};AGIVertices['prototype'][_0x085b('0x1c')]=function(_0x1ebbe0,_0x581b91){this[_0x085b('0x12')][_0x085b('0x1d')](_0x1ebbe0)[_0x085b('0x14')](function(_0x59f8d1){_0x581b91(null,_0x59f8d1?_0x59f8d1['name']:![]);})['catch'](function(_0x311722){_0x581b91(_0x311722);});};AGIVertices[_0x085b('0x10')]['getTrunk']=function(_0x2b38e8,_0x1f684b){this[_0x085b('0x12')][_0x085b('0x1e')](_0x2b38e8)[_0x085b('0x14')](function(_0x1d79ae){_0x1f684b(null,_0x1d79ae?_0x1d79ae[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x30ab8d){_0x1f684b(_0x30ab8d);});};AGIVertices[_0x085b('0x10')][_0x085b('0x1f')]=function(_0x5358e5,_0x311295){var _0x196105=this;this[_0x085b('0x12')][_0x085b('0x20')](_0x5358e5)[_0x085b('0x14')](function(_0x39c4c3){_0x311295(null,_0x39c4c3?_0x196105[_0x085b('0x21')](_0x39c4c3['save_name']):![]);})[_0x085b('0x16')](function(_0x7f0129){_0x311295(_0x7f0129);});};AGIVertices[_0x085b('0x10')]['getMailAccount']=function(_0x29e04b,_0xdffe7e){this[_0x085b('0x12')][_0x085b('0x22')](_0x29e04b)[_0x085b('0x14')](function(_0x1059e3){_0xdffe7e(null,_0x1059e3?_0x1059e3:![]);})[_0x085b('0x16')](function(_0x41d595){_0xdffe7e(_0x41d595);});};AGIVertices['prototype'][_0x085b('0x23')]=function(_0x1201fa,_0x3e9400,_0x118973){this[_0x085b('0xf')][_0x085b('0x23')](_0x1201fa,_0x3e9400)[_0x085b('0x14')](function(){_0x118973(null);})[_0x085b('0x16')](function(_0x15750b){_0x118973(_0x15750b);});};AGIVertices[_0x085b('0x10')][_0x085b('0x24')]=function(_0x3002c2,_0x56d1d3){this[_0x085b('0x12')][_0x085b('0x25')](_0x3002c2)['then'](function(_0x4a7bce){if(_0x4a7bce){if(_0x4a7bce['IntervalId']){_0x56d1d3(null,[_0x4a7bce[_0x085b('0x26')]]);}else{_0x56d1d3(null,_[_0x085b('0x27')](_0x4a7bce['Intervals'],_0x085b('0x26')));}}else{_0x56d1d3(null,![]);}})['catch'](function(_0x5711ef){_0x56d1d3(_0x5711ef);});};AGIVertices['prototype'][_0x085b('0x21')]=function(_0x267d03){return util[_0x085b('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x267d03);};AGIVertices[_0x085b('0x10')][_0x085b('0x29')]=function(_0x543af2,_0x5b239c,_0x414aa5){odbc['open'](_0x543af2,function(_0x1179c3){if(_0x1179c3){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1179c3);_0x414aa5(_0x1179c3);}else{logger[_0x085b('0x2a')]('ODBC\x20connection\x20successfully');odbc[_0x085b('0x2b')](_0x5b239c,function(_0x1c8106,_0x4f1b3d){if(_0x1c8106){logger[_0x085b('0x2a')]('Error\x20executing\x20query\x20%s',_0x5b239c);_0x414aa5(_0x1c8106);}else{logger[_0x085b('0x2a')](_0x085b('0x2c'),_0x5b239c);odbc[_0x085b('0x2d')](function(_0x5cc9d2){if(_0x5cc9d2){logger[_0x085b('0x2e')](_0x085b('0x2f'),_0x5cc9d2);}_0x414aa5(null,_0x4f1b3d);});}});}});};AGIVertices[_0x085b('0x10')][_0x085b('0x30')]=function(_0x328b80,_0x21c5ce){this[_0x085b('0x12')][_0x085b('0x31')](_0x328b80)[_0x085b('0x14')](function(_0x1b0955){_0x21c5ce(null,_0x1b0955?_0x1b0955:![]);})['catch'](function(_0x52b40a){_0x21c5ce(_0x52b40a);});};AGIVertices[_0x085b('0x10')][_0x085b('0x32')]=function(_0x592895,_0x2db24b){this[_0x085b('0x12')][_0x085b('0x32')](_0x592895)[_0x085b('0x14')](function(_0x1e151d){_0x2db24b(null,_0x1e151d);})[_0x085b('0x16')](function(_0x719428){_0x2db24b(_0x719428);});};AGIVertices[_0x085b('0x10')][_0x085b('0x33')]=function(_0x148ec6,_0x8a4f81,_0x5768a4){this[_0x085b('0x12')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x085b('0x34')],'node':_0x148ec6[_0x085b('0x35')],'application':_0x148ec6[_0x085b('0x36')],'data':_0x8a4f81||null,'project_name':this[_0x085b('0x37')][_0x085b('0x38')],'callerid':this['channel'][_0x085b('0x39')]})[_0x085b('0x14')](function(_0x456744){if(_0x5768a4){_0x5768a4(null,_0x456744);}})[_0x085b('0x16')](function(_0x57233b){if(_0x5768a4){_0x5768a4(_0x57233b);}});};AGIVertices['prototype'][_0x085b('0x3a')]=function(_0x56c6be,_0x1d2f30,_0x5daad7,_0x2d97cf){this[_0x085b('0x12')]['createSquareRecording']({'uniqueid':this[_0x085b('0x37')][_0x085b('0x34')],'callerid':this[_0x085b('0x37')]['callerid'],'calleridname':this['channel'][_0x085b('0x3b')],'context':this['channel'][_0x085b('0x3c')],'extension':this[_0x085b('0x37')][_0x085b('0x3d')],'priority':this['channel'][_0x085b('0x3e')],'accountcode':this['channel'][_0x085b('0x3f')],'dnid':this[_0x085b('0x37')][_0x085b('0x40')],'projectName':this[_0x085b('0x37')][_0x085b('0x38')],'saveName':_0x1d2f30,'filename':_0x56c6be[_0x085b('0x41')]||_0x1d2f30,'savePath':_0x5daad7})[_0x085b('0x14')](function(_0x1d074f){_0x2d97cf(null,_0x1d074f);})[_0x085b('0x16')](function(_0x36d253){_0x2d97cf(_0x36d253);});};AGIVertices['prototype'][_0x085b('0x42')]=function(_0x32845f,_0x7720fd,_0x1278c1,_0x434583,_0x17de16){this[_0x085b('0x12')][_0x085b('0x42')]({'uniqueid':this[_0x085b('0x37')]['uniqueid'],'body':_0x32845f,'direction':_0x7720fd,'providerName':_0x1278c1,'providerResponse':_0x434583})['then'](function(_0xb3995e){if(_0x17de16){_0x17de16(null,_0xb3995e);}})[_0x085b('0x16')](function(_0x18bf61){if(_0x17de16){_0x17de16(_0x18bf61);}});};AGIVertices[_0x085b('0x10')][_0x085b('0x43')]=function(_0x13db12,_0x1f3611){this[_0x085b('0x12')][_0x085b('0x43')]({'firstName':_[_0x085b('0x44')](_0x13db12[_0x085b('0x15')])||_[_0x085b('0x45')](_0x13db12['name'])?'callback_'+Math[_0x085b('0x46')]():_0x13db12[_0x085b('0x15')],'lastName':_[_0x085b('0x44')](_0x13db12['lastName'])||_[_0x085b('0x45')](_0x13db12[_0x085b('0x47')])?null:_0x13db12[_0x085b('0x47')],'phone':_0x13db12['phone'],'ListId':_0x13db12['list_id'],'scheduledat':_0x13db12['scheduledAt'],'callbackUniqueid':this[_0x085b('0x37')][_0x085b('0x34')],'tags':_0x085b('0x48'),'description':_0x085b('0x49')+_0x13db12[_0x085b('0x4a')][_0x085b('0x4b')](),'priority':_0x13db12[_0x085b('0x4c')]})[_0x085b('0x14')](function(_0x3349d8){_0x1f3611(null,_0x3349d8);})[_0x085b('0x16')](function(_0x256728){_0x1f3611(_0x256728);});};AGIVertices[_0x085b('0x10')][_0x085b('0x4d')]=function(_0x1554fe,_0x3fc8cd){this[_0x085b('0x12')][_0x085b('0x4e')](_0x1554fe)[_0x085b('0x14')](function(_0xf3d861){_0x3fc8cd(null,_0xf3d861?_0xf3d861[_0x085b('0x15')]:![]);})[_0x085b('0x16')](function(_0x1bafc7){_0x3fc8cd(_0x1bafc7);});};AGIVertices['prototype'][_0x085b('0x4f')]=function(_0x2933ba,_0x5783c0,_0x5d3ccf){var _0x757833={'role':_0x085b('0x50')};_0x757833[_0x2933ba]=this[_0x085b('0x37')][_0x085b('0x39')];this['rpc'][_0x085b('0x4f')](_0x757833,_0x5783c0,this[_0x085b('0x37')][_0x085b('0x34')])['then'](function(_0x47e8a1){_0x5d3ccf(null,_[_0x085b('0x45')](_0x47e8a1)?![]:!![]);})['catch'](function(_0x72a673){logger['error'](_0x72a673);_0x5d3ccf(null,![]);});};AGIVertices[_0x085b('0x10')]['agentUnpause']=function(_0x1e838b,_0x1fa781){var _0x1fe5b2={'role':_0x085b('0x50')};_0x1fe5b2[_0x1e838b]=this[_0x085b('0x37')]['callerid'];this[_0x085b('0x12')][_0x085b('0x51')](_0x1fe5b2)[_0x085b('0x14')](function(_0x17d2d5){_0x1fa781(null,_['isNil'](_0x17d2d5)?![]:!![]);})[_0x085b('0x16')](function(_0x5e3689){logger[_0x085b('0x2e')](_0x5e3689);_0x1fa781(null,![]);});};AGIVertices[_0x085b('0x10')][_0x085b('0x52')]=function(_0x4b5f27,_0x35dcc6){var _0xe7731d={'role':'agent'};_0xe7731d[_0x4b5f27]=this[_0x085b('0x37')][_0x085b('0x39')];this[_0x085b('0x12')][_0x085b('0x52')](_0xe7731d)['then'](function(_0x410427){_0x35dcc6(null,_[_0x085b('0x45')](_0x410427)?![]:!![]);})['catch'](function(_0x27e5e6){logger['error'](_0x27e5e6);_0x35dcc6(null,![]);});};AGIVertices[_0x085b('0x10')][_0x085b('0x53')]=function(_0x4741c4,_0x537eb4){var _0x3b6fa5={'role':'agent'};_0x3b6fa5[_0x4741c4]=this[_0x085b('0x37')][_0x085b('0x39')];var _0x2adb5e=_0x4741c4!=_0x085b('0x54')?util[_0x085b('0x28')](_0x085b('0x55'),_0x085b('0x56'),this[_0x085b('0x37')][_0x085b('0x39')]):undefined;this['rpc'][_0x085b('0x53')](_0x3b6fa5,_0x2adb5e)[_0x085b('0x14')](function(_0x21b957){_0x537eb4(null,_[_0x085b('0x45')](_0x21b957)?![]:!![]);})['catch'](function(_0x468384){logger[_0x085b('0x2e')](_0x468384);_0x537eb4(null,![]);});};AGIVertices[_0x085b('0x10')][_0x085b('0x57')]=function(_0xf4049b,_0xb0c795){sh[_0x085b('0x58')](_['trim'](_0xf4049b),function(_0x93ce62,_0x23b0b2){var _0x1fd86d=_0x23b0b2['replace'](/(\r\n|\n|\r)/gm,'');_0xb0c795(null,_0x1fd86d);});};AGIVertices[_0x085b('0x10')][_0x085b('0x59')]=function(_0x20cc7e,_0x1610c0){scripts[_0x085b('0x59')](_0x20cc7e['apiKey'],_0x20cc7e[_0x085b('0x5a')]||_0x085b('0x5b'),_0x20cc7e[_0x085b('0x5b')],_0x20cc7e[_0x085b('0x5c')]||_0x085b('0x5d'),_0x20cc7e[_0x085b('0x5e')]||_0x085b('0x5f'),_0x20cc7e[_0x085b('0x60')]||_0x085b('0x61'))[_0x085b('0x14')](function(_0x3ef627){_0x1610c0(null,_0x3ef627);})['catch'](function(_0x3a900a){_0x1610c0(_0x3a900a);});};AGIVertices['prototype']['googleTTS']=function(_0x5bc030,_0x1d8603){scripts['googleTTS'](_0x5bc030[_0x085b('0x5b')],_0x5bc030['google_tts_language']||'en',0x1)['then'](function(_0x5607d7){_0x1d8603(null,_0x5607d7);})[_0x085b('0x16')](function(_0x3eadad){_0x1d8603(_0x3eadad);});};AGIVertices[_0x085b('0x10')][_0x085b('0x62')]=function(_0x37ab25,_0x3903bb){var _0x154cc1={'uri':_0x37ab25[_0x085b('0x63')],'method':_0x37ab25[_0x085b('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37ab25[_0x085b('0x65')])===_0x085b('0x66')&&parseInt(_0x37ab25[_0x085b('0x65')])>=0x1?parseInt(_0x37ab25[_0x085b('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x085b('0x67')]([_0x085b('0x68'),_0x085b('0x69')],_0x154cc1['method'][_0x085b('0x6a')]())){try{_0x154cc1[_0x085b('0x6b')]=_0x37ab25['rawBody']?JSON['parse'](_0x37ab25[_0x085b('0xc')]):{};}catch(_0x22d790){logger[_0x085b('0x2e')](_0x085b('0x6c'),_0x22d790);}}try{_0x154cc1['headers']=_0x37ab25[_0x085b('0x6d')]?JSON[_0x085b('0x6e')](_0x37ab25[_0x085b('0x6d')]):{};}catch(_0xd86919){logger[_0x085b('0x2e')](_0x085b('0x6f'),_0xd86919);}if(_0x37ab25[_0x085b('0x70')]){try{var _0x3fbc2a=require(_0x37ab25[_0x085b('0x70')])[_0x085b('0x71')](this,_0x154cc1);_0x154cc1[_0x085b('0x72')]=Mustache[_0x085b('0x73')](_0x37ab25[_0x085b('0x63')],_0x3fbc2a,{},['$$','$$']);if(_0x154cc1[_0x085b('0x74')]){_0x154cc1[_0x085b('0x74')]=JSON[_0x085b('0x6e')](Mustache[_0x085b('0x73')](JSON[_0x085b('0x75')](_0x154cc1[_0x085b('0x74')]),_0x3fbc2a,{},['$$','$$']));}if(_0x154cc1[_0x085b('0x6b')]){_0x154cc1['body']=JSON[_0x085b('0x6e')](Mustache[_0x085b('0x73')](JSON[_0x085b('0x75')](_0x154cc1[_0x085b('0x6b')]),_0x3fbc2a,{},['$$','$$']));}}catch(_0xf0effe){logger[_0x085b('0x2e')](_0x085b('0x76'),_0xf0effe);}}rp(_0x154cc1)['then'](function(_0x148383){var _0x9184e2={'statusCode':_0x148383[_0x085b('0x77')]||0xc8,'statusMessage':_0x148383[_0x085b('0x78')]||'OK','headers':_0x148383['headers']||{},'body':_0x148383[_0x085b('0x6b')]||{}};_0x3903bb(null,_0x9184e2);})['catch'](function(_0x45eac2){var _0x47c212={'statusCode':_0x45eac2[_0x085b('0x77')]||0x1f4,'statusMessage':_0x45eac2[_0x085b('0x79')]||_0x085b('0x7a'),'headers':_0x45eac2[_0x085b('0x7b')][_0x085b('0x74')]||{},'body':_0x45eac2[_0x085b('0x7b')]['body']||{}};_0x3903bb(null,_0x47c212);});};AGIVertices['prototype'][_0x085b('0x7c')]=function(_0x44df9d,_0x2d1bc4){scripts[_0x085b('0x7c')](this[_0x085b('0x37')]['uniqueid'],_0x44df9d[_0x085b('0x7d')],_0x44df9d[_0x085b('0x5b')],_0x44df9d['dialogflow_language']||'en')[_0x085b('0x14')](function(_0x2d2880){_0x2d1bc4(null,_0x2d2880);})['catch'](function(_0x1ffe19){_0x2d1bc4(_0x1ffe19);});};AGIVertices[_0x085b('0x10')][_0x085b('0x7e')]=function(_0x2e1db5,_0x1f6e93){scripts['googleDialogflowV2'](this[_0x085b('0x37')][_0x085b('0x34')],_0x2e1db5[_0x085b('0x7f')],_0x2e1db5[_0x085b('0x80')],_0x2e1db5[_0x085b('0x81')],_0x2e1db5['text'],_0x2e1db5[_0x085b('0x82')]||'en')[_0x085b('0x14')](function(_0x2e727f){_0x1f6e93(null,_0x2e727f);})[_0x085b('0x16')](function(_0x4a1087){_0x1f6e93(_0x4a1087);});};AGIVertices[_0x085b('0x10')][_0x085b('0x83')]=function(_0x46ddfb,_0xc26471){scripts[_0x085b('0x83')](this['channel'],_0x46ddfb)[_0x085b('0x14')](function(_0x5f7ef4){_0xc26471(null,_0x5f7ef4);})[_0x085b('0x16')](function(_0x3e8e8a){_0xc26471(_0x3e8e8a);});};AGIVertices[_0x085b('0x10')][_0x085b('0x84')]=function(_0x2efc83,_0xef2bfe){scripts[_0x085b('0x84')](_0x2efc83['key'],_0x2efc83[_0x085b('0x5b')],_0x2efc83['ispeech_tts_language']||_0x085b('0x5d'),_0x2efc83[_0x085b('0x85')])['then'](function(_0x214601){_0xef2bfe(null,_0x214601);})[_0x085b('0x16')](function(_0x195374){_0xef2bfe(_0x195374);});};AGIVertices[_0x085b('0x10')]['ispeechASR']=function(_0x40d6bc,_0x17e73f,_0x436a1e){scripts['ispeechASR'](_0x17e73f,_0x40d6bc[_0x085b('0x7d')],_0x40d6bc[_0x085b('0x86')]||_0x085b('0x5d'),this[_0x085b('0x87')](_0x40d6bc[_0x085b('0x88')])?_0x40d6bc[_0x085b('0x88')]:undefined)[_0x085b('0x14')](function(_0x32fa24){_0x436a1e(null,_0x32fa24);})[_0x085b('0x16')](function(_0x4fbb7a){_0x436a1e(_0x4fbb7a);});};AGIVertices[_0x085b('0x10')][_0x085b('0x89')]=function(_0x37fc5b,_0xc66272){scripts['awsPolly'](_0x37fc5b[_0x085b('0x8a')],_0x37fc5b['aws_secret_access_key'],_0x37fc5b[_0x085b('0x8b')],_0x37fc5b[_0x085b('0x8c')]||_0x085b('0x8d'),_0x37fc5b['text'],_0x37fc5b[_0x085b('0x8e')]||_0x085b('0x5b'))[_0x085b('0x14')](function(_0x2a4993){_0xc66272(null,_0x2a4993);})[_0x085b('0x16')](function(_0x30e918){_0xc66272(_0x30e918);});};AGIVertices[_0x085b('0x10')][_0x085b('0x8f')]=function(_0x366006,_0x2b22e9){scripts[_0x085b('0x8f')](this[_0x085b('0x37')][_0x085b('0x34')],_0x366006['aws_access_key_id'],_0x366006[_0x085b('0x90')],_0x366006['aws_lex_region'],_0x366006[_0x085b('0x5b')],_0x366006[_0x085b('0x91')])[_0x085b('0x14')](function(_0x4544d1){_0x2b22e9(null,_0x4544d1);})['catch'](function(_0x5a22b4){_0x2b22e9(_0x5a22b4);});};AGIVertices[_0x085b('0x10')][_0x085b('0x92')]=function(_0x4f17f3,_0xa9cbf3,_0x233ef1){scripts[_0x085b('0x92')](_0xa9cbf3,_0x4f17f3[_0x085b('0x7d')],_0x4f17f3[_0x085b('0x93')]||'en-US')[_0x085b('0x14')](function(_0x56d79a){_0x233ef1(null,_0x56d79a);})[_0x085b('0x16')](function(_0x4c0e17){_0x233ef1(_0x4c0e17);});};AGIVertices[_0x085b('0x10')][_0x085b('0x94')]=function(_0x46822e,_0x119ff9,_0x5fa0c9){scripts[_0x085b('0x94')](_0x119ff9,_0x46822e['appid'],_0x46822e[_0x085b('0x95')],_0x46822e[_0x085b('0x72')])['then'](function(_0x434bbc){_0x5fa0c9(null,_0x434bbc);})[_0x085b('0x16')](function(_0x22aebe){_0x5fa0c9(_0x22aebe);});};AGIVertices[_0x085b('0x10')][_0x085b('0x96')]=function(_0x41ce8e){var _0x346d09=_['includes'](verticesWithRetry,_0x41ce8e[_0x085b('0x36')])?_0x41ce8e:_['clone'](_0x41ce8e);for(var _0x5a1e47 in _0x346d09){if(_0x346d09[_0x085b('0x97')](_0x5a1e47)){if(_0x346d09[_0x5a1e47]&&_[_0x085b('0x98')](_0x346d09[_0x5a1e47])){if(_['includes'](recursiveMapAttributes,_0x5a1e47)){_0x346d09[_0x5a1e47]=this[_0x085b('0x99')](_0x346d09[_0x5a1e47]);}else{_0x346d09[_0x5a1e47]=this[_0x085b('0x9a')](_0x346d09[_0x5a1e47]);}}}}return _0x346d09;};AGIVertices[_0x085b('0x10')]['recursiveNodeIndex']=function(_0x241858){for(var _0x3fb65a in _0x241858){if(_0x241858[_0x085b('0x97')](_0x3fb65a)){if(_[_0x085b('0x9b')](_0x241858[_0x3fb65a])){this[_0x085b('0x9c')](_0x241858[_0x3fb65a]);}else if(_[_0x085b('0x9d')](_0x241858[_0x3fb65a])){for(var _0x1af12c=0x0;_0x1af12c<_0x241858[_0x3fb65a][_0x085b('0x9e')];_0x1af12c++){this[_0x085b('0x9c')](_0x241858[_0x3fb65a][_0x1af12c]);}}else if(_[_0x085b('0x98')](_0x241858[_0x3fb65a])){_0x241858[_0x3fb65a]=this[_0x085b('0x9a')](_0x241858[_0x3fb65a]);}}}};AGIVertices[_0x085b('0x10')][_0x085b('0x9f')]=function(_0x1f13da,_0x2b5172){for(var _0x1dc397 in _0x1f13da){if(_0x1f13da['hasOwnProperty'](_0x1dc397)){if(_[_0x085b('0x9b')](_0x1f13da[_0x1dc397])){if(!_['isEmpty'](_0x1f13da[_0x1dc397])){this[_0x085b('0x9f')](_0x1f13da[_0x1dc397],util[_0x085b('0x28')](_0x085b('0xa0'),_0x2b5172,_0x1dc397));}}else if(_[_0x085b('0x9d')](_0x1f13da[_0x1dc397])){for(var _0xfec50d=0x0;_0xfec50d<_0x1f13da[_0x1dc397][_0x085b('0x9e')];_0xfec50d++){this[_0x085b('0x9f')](_0x1f13da[_0x1dc397][_0xfec50d],util[_0x085b('0x28')](_0x085b('0xa0'),_0x2b5172,_0x1dc397+'['+_0xfec50d+']'));}}else{if(!_['isNil'](_0x1f13da[_0x1dc397])){this[_0x085b('0x37')][_0x085b('0xa1')](util['format'](_0x085b('0xa0'),_0x2b5172,_0x1dc397),_0x1f13da[_0x1dc397]);}}}}};AGIVertices[_0x085b('0x10')][_0x085b('0x99')]=function(_0x12222c){try{var _0x3645d8=JSON['parse'](_0x12222c);this[_0x085b('0x9c')](_0x3645d8);return JSON[_0x085b('0x75')](_0x3645d8);}catch(_0x3c62fe){return this[_0x085b('0x9a')](_0x12222c);}};AGIVertices['prototype'][_0x085b('0x9a')]=function(_0x5e3ec2){var _0x1d95f4=_0x5e3ec2[_0x085b('0xa2')]('{');for(var _0xf6e094=0x1;_0xf6e094<_0x1d95f4['length'];_0xf6e094+=0x1){var _0x27cd56=_0x1d95f4[_0xf6e094][_0x085b('0xa2')]('}');if(_0x27cd56[_0x085b('0x9e')]>0x1){_0x5e3ec2=_0x5e3ec2[_0x085b('0xa3')]('{'+_0x27cd56[0x0]+'}',this[_0x085b('0x37')]['getVariable'](_0x27cd56[0x0])[_0x085b('0xa4')]||_0x27cd56[0x0]);}}if(_0x1d95f4[_0x085b('0x9e')]===0x1){return _0x5e3ec2[_0x085b('0x4b')]();}return this[_0x085b('0x9a')](_0x5e3ec2);};AGIVertices[_0x085b('0x10')][_0x085b('0xa5')]=function(_0x264160,_0x202fa1){var _0x1833e2=this[_0x085b('0x37')][_0x085b('0x11')](_0x264160);if(_0x1833e2[_0x085b('0xa6')]===-0x1){return _0x1833e2;}logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xa7'),_0x202fa1,_0x1833e2[_0x085b('0xa4')]));return this['channel'][_0x085b('0xa1')](_0x202fa1,_0x1833e2[_0x085b('0xa4')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x87')]=function(_0x3fff03){return _0x3fff03&&_0x3fff03!=='0'&&_0x3fff03!=='-1'&&_0x3fff03!=='';};AGIVertices[_0x085b('0x10')][_0x085b('0xa8')]=function(_0xcb0b7f){this[_0x085b('0x33')][_0x085b('0x71')](this,_0xcb0b7f,'-');_0xcb0b7f['retry']=_0xcb0b7f['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x085b('0x10')][_0x085b('0xa9')]=function(_0x1f72ce){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xaa'),_0x1f72ce[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x1f72ce['text'])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}var _0x248095='\x22'+_0x1f72ce['text']+'\x22';if(this[_0x085b('0x87')](_0x1f72ce[_0x085b('0x7b')])){_0x248095+=','+_0x1f72ce[_0x085b('0x7b')];}var _0x44b66e=this[_0x085b('0x37')][_0x085b('0x58')]('MRCPSynth',_0x248095);if(_0x44b66e['result']===-0x1){return _0x44b66e;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xad'),_0x248095));};AGIVertices['prototype'][_0x085b('0xae')]=function(_0x6ae674){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xaf'),_0x6ae674['label']));if(!this[_0x085b('0x87')](_0x6ae674['grammar'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xb0'));}var _0x49b6b4=_0x6ae674[_0x085b('0xb1')];if(this[_0x085b('0x87')](_0x6ae674[_0x085b('0x7b')])){_0x49b6b4+=','+_0x6ae674['options'];}var _0x15a3d9=this['channel'][_0x085b('0x58')](_0x085b('0xb2'),_0x49b6b4);if(_0x15a3d9[_0x085b('0xa6')]===-0x1){return _0x15a3d9;}var _0x1f64e0=this[_0x085b('0xa5')]('RECOG_CONFIDENCE()',_0x085b('0xb3'));if(_0x1f64e0[_0x085b('0xa6')]===-0x1){return _0x1f64e0;}var _0x1bc187=this['getAndSetVariable'](_0x085b('0xb4'),_0x085b('0xb5'));if(_0x1bc187[_0x085b('0xa6')]===-0x1){return _0x1bc187;}var _0x3055dd=this[_0x085b('0xa5')](_0x085b('0xb6'),_0x085b('0xb7'));if(_0x3055dd[_0x085b('0xa6')]===-0x1){return _0x3055dd;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xb8'),_0x49b6b4));};AGIVertices['prototype'][_0x085b('0x9')]=function(_0x3881f3){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3881f3[_0x085b('0x35')]));return this[_0x085b('0x37')][_0x085b('0x9')]([_0x3881f3[_0x085b('0xb9')],_0x3881f3[_0x085b('0xba')]]);};AGIVertices['prototype'][_0x085b('0xbb')]=function(_0x13c1a6){logger[_0x085b('0x2a')](util['format'](_0x085b('0xbc'),_0x13c1a6[_0x085b('0x35')]));if(this[_0x085b('0x87')](_0x13c1a6[_0x085b('0x65')])){logger['info'](util[_0x085b('0x28')](_0x085b('0xbd'),_0x13c1a6[_0x085b('0x65')]));var _0x2f9173=this[_0x085b('0x37')]['wait'](_0x13c1a6[_0x085b('0x65')]);if(_0x2f9173[_0x085b('0xa6')]===-0x1){return _0x2f9173;}}return this[_0x085b('0x37')][_0x085b('0xbb')]();};AGIVertices['prototype'][_0x085b('0x48')]=function(_0xbd229e){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xbe'),_0xbd229e[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0xbd229e[_0x085b('0xbf')])){return this['channel']['error'](_0xbd229e,_0x085b('0xc0'));}_0xbd229e[_0x085b('0x4a')]=moment();if(this[_0x085b('0x87')](_0xbd229e[_0x085b('0xc1')])){_0xbd229e[_0x085b('0x4a')]=moment()[_0x085b('0xc2')](_0xbd229e['delay'],_0x085b('0xc3'));}if(!this[_0x085b('0x87')](_0xbd229e['callback_priority'])){_0xbd229e['callback_priority']=0x2;}this['createCmContact'][_0x085b('0x71')](this,_0xbd229e);return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc4'),_0xbd229e[_0x085b('0xc5')],_0xbd229e[_0x085b('0xbf')],_0xbd229e['scheduledAt']));};AGIVertices[_0x085b('0x10')][_0x085b('0xc6')]=function(_0x150d27){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xc7'),_0x150d27[_0x085b('0x35')]));var _0x2b42ef=this[_0x085b('0x37')][_0x085b('0x58')](_0x150d27[_0x085b('0xc8')],_0x150d27['options']);if(_0x2b42ef[_0x085b('0xa6')]===-0x1){return _0x2b42ef;}return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc9'),_0x150d27['application'],_0x150d27['options']));};AGIVertices[_0x085b('0x10')][_0x085b('0xca')]=function(_0x31e77c){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x31e77c[_0x085b('0x35')]));if(!this['isConfigured'](_0x31e77c[_0x085b('0x5b')])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}var _0xbd6bbb='\x22'+_0x31e77c[_0x085b('0x5b')]+'\x22';if(this['isConfigured'](_0x31e77c[_0x085b('0x7b')])){_0xbd6bbb+=','+_0x31e77c[_0x085b('0x7b')];}var _0x1c7528=this['channel'][_0x085b('0x58')](_0x085b('0xcb'),_0xbd6bbb);if(_0x1c7528[_0x085b('0xa6')]===-0x1){return _0x1c7528;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xad'),_0xbd6bbb));};AGIVertices[_0x085b('0x10')][_0x085b('0xcc')]=function(_0x49d00f){logger['info'](util[_0x085b('0x28')](_0x085b('0xcd'),_0x49d00f[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x49d00f[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}var _0x25c4f3='\x22'+_0x49d00f['text']+'\x22';if(this[_0x085b('0x87')](_0x49d00f[_0x085b('0x7b')])){_0x25c4f3+=','+_0x49d00f[_0x085b('0x7b')];}var _0x5d7ba9=this['channel'][_0x085b('0x58')](_0x085b('0xcb'),_0x25c4f3);if(_0x5d7ba9[_0x085b('0xa6')]===-0x1){return _0x5d7ba9;}return this['channel']['noop'](util[_0x085b('0x28')](_0x085b('0xad'),_0x25c4f3));};AGIVertices[_0x085b('0x10')][_0x085b('0xce')]=function(_0x2211f8){logger['info'](util[_0x085b('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2211f8[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x2211f8['grammar'])){return this['channel'][_0x085b('0xac')](_0x085b('0xb0'));}var _0x23dd43=_0x2211f8[_0x085b('0xb1')];if(this['isConfigured'](_0x2211f8[_0x085b('0x7b')])){_0x23dd43+=','+_0x2211f8[_0x085b('0x7b')];}var _0x265dfd=this[_0x085b('0x37')][_0x085b('0x58')]('MRCPRecog',_0x23dd43);if(_0x265dfd['result']===-0x1){return _0x265dfd;}var _0x56f240=this[_0x085b('0xa5')]('RECOG_CONFIDENCE()',_0x085b('0xcf'));if(_0x56f240[_0x085b('0xa6')]===-0x1){return _0x56f240;}var _0x5ab6b0=this['getAndSetVariable'](_0x085b('0xb4'),_0x085b('0xd0'));if(_0x5ab6b0['result']===-0x1){return _0x5ab6b0;}var _0x221b15=this['getAndSetVariable']('RECOG_INSTANCE()',_0x085b('0xd1'));if(_0x221b15[_0x085b('0xa6')]===-0x1){return _0x221b15;}return this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0xb8'),_0x23dd43));};AGIVertices[_0x085b('0x10')][_0x085b('0xd2')]=function(_0x1815fb){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1815fb[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x1815fb[_0x085b('0xb1')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x5fb179=_0x1815fb[_0x085b('0xb1')];if(this['isConfigured'](_0x1815fb[_0x085b('0x7b')])){_0x5fb179+=','+_0x1815fb[_0x085b('0x7b')];}var _0x4332ca=this[_0x085b('0x37')][_0x085b('0x58')](_0x085b('0xb2'),_0x5fb179);if(_0x4332ca[_0x085b('0xa6')]===-0x1){return _0x4332ca;}var _0xffd218=this[_0x085b('0xa5')]('RECOG_CONFIDENCE()',_0x085b('0xd3'));if(_0xffd218['result']===-0x1){return _0xffd218;}var _0x3bf569=this[_0x085b('0xa5')](_0x085b('0xb4'),'SESTEK_ASR_TRANSCRIPT');if(_0x3bf569[_0x085b('0xa6')]===-0x1){return _0x3bf569;}var _0x1e4b33=this['getAndSetVariable'](_0x085b('0xb6'),'SESTEK_ASR_INSTANCE');if(_0x1e4b33['result']===-0x1){return _0x1e4b33;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xb8'),_0x5fb179));};AGIVertices['prototype'][_0x085b('0xd4')]=function(_0x254761){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xd5'),_0x254761['label']));if(!this[_0x085b('0x87')](_0x254761['odbc_id'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x254761,_0x085b('0xd6'));}var _0x3b162b=this[_0x085b('0x19')]['sync'](this,_0x254761['odbc_id']);if(!_0x3b162b){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x254761,_0x085b('0xd7'));}if(!this[_0x085b('0x87')](_0x254761['query'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x254761,'no\x20query\x20configured');}var _0x3c5126=_0x254761[_0x085b('0x2b')][_0x085b('0xd8')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('query:\x20%s',_0x3c5126));var _0x3b85e3=this['getQueryOdbc'][_0x085b('0x71')](this,_0x3b162b,_0x3c5126);this[_0x085b('0x33')][_0x085b('0x71')](this,_0x254761,_0x3c5126);if(!this[_0x085b('0x87')](_0x254761[_0x085b('0xd9')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x24a7e0=this[_0x085b('0x11')][_0x085b('0x71')](this,_0x254761[_0x085b('0xd9')]);if(!_0x24a7e0){return this['channel'][_0x085b('0x2e')](_0x254761,'no\x20variable\x20found');}var _0xe27160=this;_0x3b85e3[_0x085b('0xda')](function(_0x4c1d25,_0xbc741b){Object[_0x085b('0xdb')](_0x4c1d25)[_0x085b('0xda')](function(_0x44da06){_0xe27160[_0x085b('0x37')]['setVariable'](util[_0x085b('0x28')](_0x085b('0xdc'),_0x24a7e0,_0xbc741b,_0x44da06),_0x4c1d25[_0x44da06]);});});this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')]('%s_ROWS_COUNT',_0x24a7e0),_0x3b85e3['length']);return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('variable\x20%s\x20set',_0x24a7e0));};AGIVertices[_0x085b('0x10')][_0x085b('0xdd')]=function(_0x559b87){logger['debug'](util[_0x085b('0x28')](_0x085b('0xde'),_0x559b87[_0x085b('0x35')]));if(!this['isConfigured'](_0x559b87[_0x085b('0xdf')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x559b87,_0x085b('0xe0'));}var _0x31c416=this[_0x085b('0x1c')][_0x085b('0x71')](this,_0x559b87[_0x085b('0xdf')]);if(!_0x31c416){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x559b87,'no\x20user\x20found');}var _0x5d37b9=this['channel'][_0x085b('0x58')](_0x085b('0xe1'),[util[_0x085b('0x28')]('SIP/%s',_0x31c416),_0x559b87[_0x085b('0x65')],_0x559b87[_0x085b('0xe2')],_0x559b87['url']]);if(_0x5d37b9[_0x085b('0xa6')]===-0x1){return _0x5d37b9;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xe3'),_0x085b('0xe1')));};AGIVertices[_0x085b('0x10')][_0x085b('0xe4')]=function(_0x5c5e09){logger[_0x085b('0x2a')](util['format'](_0x085b('0xe5'),_0x5c5e09[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x5c5e09[_0x085b('0x7d')])){return this[_0x085b('0x37')]['noop']('no\x20key\x20configured');}if(!this[_0x085b('0x87')](_0x5c5e09[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xe6')]=!![];this[_0x085b('0x33')](_0x5c5e09);this[_0x085b('0x42')](_0x5c5e09['text'],'in','','');this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0xe7'),_0x5c5e09['text']));var _0x55bbab=this[_0x085b('0x7c')]['sync'](this,_0x5c5e09);if(_0x55bbab){for(var _0x41549c in _0x55bbab){if(_0x55bbab[_0x085b('0x97')](_0x41549c)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0xe8'),_0x41549c[_0x085b('0x6a')]()),_0x55bbab[_0x41549c]);}}this[_0x085b('0x42')](_0x55bbab[_0x085b('0xe9')],'out',_0x085b('0xe4'),'');return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Dialogflow\x20Result\x20%s',_0x55bbab['speech']));}return this['channel']['error'](_0x5c5e09,_0x085b('0xea'));};AGIVertices[_0x085b('0x10')][_0x085b('0xeb')]=function(_0x4237ba){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0xec'),_0x4237ba[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4237ba['dialogflowV2_project_id'])){return this['channel']['noop'](_0x085b('0xed'));}if(!this[_0x085b('0x87')](_0x4237ba[_0x085b('0x80')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20client_email\x20configured');}if(!this[_0x085b('0x87')](_0x4237ba['private_key'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xee'));}if(!this[_0x085b('0x87')](_0x4237ba[_0x085b('0x82')])){return this['channel'][_0x085b('0xac')](_0x085b('0xef'));}if(!this['isConfigured'](_0x4237ba['text'])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xe6')]=!![];this['createSquareDetailsReport'](_0x4237ba);this[_0x085b('0x42')](_0x4237ba[_0x085b('0x5b')],'in','','');this[_0x085b('0x37')][_0x085b('0xac')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x4237ba['text']));var _0x4cc029=this[_0x085b('0x7e')][_0x085b('0x71')](this,_0x4237ba);if(_0x4cc029){for(var _0x175950 in _0x4cc029){if(_0x4cc029[_0x085b('0x97')](_0x175950)){if(_0x175950!==_0x085b('0xf0')){this[_0x085b('0x37')]['setVariable'](util[_0x085b('0x28')]('DIALOGFLOW_%s',_0x175950[_0x085b('0x6a')]()),_0x4cc029[_0x175950]);}}}this[_0x085b('0x42')](_0x4cc029['speech'],_0x085b('0xf1'),_0x085b('0xeb'),_0x4cc029['providerResponse']);return this[_0x085b('0x37')][_0x085b('0xac')](util['format'](_0x085b('0xf2'),_0x4cc029[_0x085b('0xe9')]));}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x4237ba,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x085b('0x10')][_0x085b('0xf3')]=function(_0x50a9f2){logger['info'](util[_0x085b('0x28')](_0x085b('0xf4'),_0x50a9f2[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf5')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xf6'));}if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf7')])){return this[_0x085b('0x37')]['noop']('no\x20username\x20configured');}if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf8')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20password\x20configured');}if(!this[_0x085b('0x87')](_0x50a9f2[_0x085b('0xf9')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}this[_0x085b('0x37')][_0x085b('0xe6')]=!![];this[_0x085b('0x33')](_0x50a9f2);this[_0x085b('0x42')](_0x50a9f2[_0x085b('0x5b')],'in','','');this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20SestekNDA:\x20%s',_0x50a9f2[_0x085b('0x5b')]));var _0x23dc63=this[_0x085b('0x83')]['sync'](this,_0x50a9f2);if(_0x23dc63){for(var _0x38e4e8 in _0x23dc63){if(_0x23dc63[_0x085b('0x97')](_0x38e4e8)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0xfa'),_0x38e4e8[_0x085b('0x6a')]()),_0x23dc63[_0x38e4e8]);}}this['createSquareMessage'](_0x23dc63[_0x085b('0xe9')],'out',_0x085b('0xf3'),'');if(_0x23dc63[_0x085b('0xfb')]){this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xfc'),_0x23dc63[_0x085b('0xfb')]));var _0x331143=this['channel'][_0x085b('0xfd')](_0x23dc63['audiofile']);try{fs[_0x085b('0xfe')](_0x23dc63[_0x085b('0xfb')]+_0x085b('0xff'));}catch(_0x789a8){logger[_0x085b('0x2e')](_0x789a8);}return _0x331143;}else{return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x100'),_0x23dc63[_0x085b('0xe9')]));}}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x50a9f2,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x085b('0x10')][_0x085b('0x101')]=function(_0x2b6f90){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x2b6f90[_0x085b('0x35')]));return this['channel']['noop'](_0x085b('0x101'));};AGIVertices['prototype'][_0x085b('0x102')]=function(_0x454e23){logger[_0x085b('0x2a')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x454e23[_0x085b('0x35')]));var _0x41e1e7='';if(_0x454e23['trunk_id']){if(!this[_0x085b('0x87')](_0x454e23['trunk_id'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x454e23,_0x085b('0x103'));}else{var _0x240419=parseInt(_0x454e23[_0x085b('0x104')],0xa);if(isNaN(_0x240419)){_0x41e1e7=_0x454e23[_0x085b('0x104')];}else{_0x41e1e7=this[_0x085b('0x105')][_0x085b('0x71')](this,_0x454e23[_0x085b('0x104')]);if(!_0x41e1e7){return this['channel'][_0x085b('0x2e')](_0x454e23,_0x085b('0x106'));}}}}else if(_0x454e23['trunk_name']){_0x41e1e7=_0x454e23[_0x085b('0x107')];}else{return this[_0x085b('0x37')][_0x085b('0x2e')](_0x454e23,_0x085b('0x103'));}var _0x555d6b=this[_0x085b('0x37')][_0x085b('0x58')](_0x085b('0xe1'),[util[_0x085b('0x28')](_0x085b('0x108'),_0x41e1e7,_0x454e23[_0x085b('0xc5')]),_0x454e23[_0x085b('0x65')],_0x454e23[_0x085b('0xe2')],_0x454e23[_0x085b('0x63')]]);if(_0x555d6b[_0x085b('0xa6')]===-0x1){return _0x555d6b;}return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xe3'),_0x085b('0xe1')));};AGIVertices[_0x085b('0x10')][_0x085b('0x109')]=function(_0x987029){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x10a'),_0x987029['label']));return this['channel']['noop'](_0x085b('0x109'));};AGIVertices['prototype'][_0x085b('0xe')]=function(_0x565e3e){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x10b'),_0x565e3e[_0x085b('0x35')]));if(_0x565e3e[_0x085b('0x10c')]===0x0){return this['maxRetry'](_0x565e3e);}_0x565e3e[_0x085b('0x10c')]-=0x1;if(!this['isConfigured'](_0x565e3e[_0x085b('0x10d')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x565e3e,'no\x20file\x20audio\x20selected');}var _0x1526e8=this[_0x085b('0x1f')]['sync'](this,_0x565e3e[_0x085b('0x10d')]);if(!_0x1526e8){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x565e3e,'no\x20file\x20audio\x20found');}if(!this[_0x085b('0x87')](_0x565e3e['variable_id'])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x085b('0x10e'));}var _0x508ef9=this[_0x085b('0x37')]['getData'](_0x1526e8,_0x565e3e[_0x085b('0x10f')],_0x565e3e[_0x085b('0x110')]);var _0x451b26=_0x508ef9[_0x085b('0xa6')]?_0x508ef9[_0x085b('0xa6')]['toString']():'';logger[_0x085b('0x2a')](_0x085b('0x111'),JSON[_0x085b('0x75')](_0x508ef9));if(_0x508ef9['result']===-0x1){this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x565e3e,_0x451b26);return _0x508ef9;}else if(_0x508ef9[_0x085b('0xa4')]==='timeout'){_0x508ef9[_0x085b('0xa6')]=_0x451b26[_0x085b('0x9e')]>=parseInt(_0x565e3e[_0x085b('0x112')])?'x':'i';}else{_0x508ef9['result']=_0x451b26[_0x085b('0x9e')]>=parseInt(_0x565e3e[_0x085b('0x112')])&&_0x451b26[_0x085b('0x9e')]<=parseInt(_0x565e3e[_0x085b('0x110')])?'x':'i';}var _0x263405=this[_0x085b('0x11')]['sync'](this,_0x565e3e[_0x085b('0xd9')]);if(!_0x263405){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x565e3e,_0x085b('0x113'));}this[_0x085b('0x37')]['setVariable'](_0x263405,_0x451b26);if(this[_0x085b('0x87')](_0x565e3e[_0x085b('0x114')])){var _0x2eb9b3=parseInt(_0x565e3e[_0x085b('0x114')],0xa);var _0x364b4a=rs[_0x085b('0x115')]({'charset':'*','length':_0x2eb9b3});var _0x3061c7=_0x451b26[_0x085b('0x9e')];if(_0x3061c7>0x0){if(_0x3061c7>_0x2eb9b3){this[_0x085b('0x33')]['sync'](this,_0x565e3e,_0x565e3e['hiddendigitspos']===_0x085b('0x116')?_0x364b4a+_0x451b26[_0x085b('0x117')](_0x2eb9b3):_0x451b26[_0x085b('0x117')](0x0,_0x3061c7-_0x2eb9b3)+_0x364b4a);}else{this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x565e3e,rs['generate']({'charset':'*','length':_0x3061c7}));}}else{this[_0x085b('0x33')][_0x085b('0x71')](this,_0x565e3e,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x565e3e,_0x451b26);}return _0x508ef9;};AGIVertices[_0x085b('0x10')][_0x085b('0x118')]=function(_0x5ba143){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x119'),_0x5ba143[_0x085b('0x35')]));return this['getdigits'](_0x5ba143);};AGIVertices[_0x085b('0x10')]['goal']=function(_0x30d8bc){logger[_0x085b('0x2a')](util['format'](_0x085b('0x11a'),_0x30d8bc[_0x085b('0x35')]));this[_0x085b('0x33')][_0x085b('0x71')](this,_0x30d8bc,_0x30d8bc[_0x085b('0x11b')]);return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x11c'),_0x30d8bc[_0x085b('0x11b')]));};AGIVertices[_0x085b('0x10')][_0x085b('0x11d')]=function(_0x4308a9){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x11e'),_0x4308a9[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4308a9['aws_access_key_id'])||!this[_0x085b('0x87')](_0x4308a9['aws_secret_access_key'])){return this[_0x085b('0x37')]['noop'](_0x085b('0x11f'));}if(!this[_0x085b('0x87')](_0x4308a9['text'])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}this['channel'][_0x085b('0xac')](util['format'](_0x085b('0x120'),_0x4308a9[_0x085b('0x5b')]));var _0x3273e3=this[_0x085b('0x89')][_0x085b('0x71')](this,_0x4308a9);if(_0x3273e3){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x121'),_0x3273e3));var _0x22b53b=this[_0x085b('0x37')][_0x085b('0xfd')](_0x3273e3);try{fs['unlink'](_0x3273e3+'.wav');}catch(_0xfa065c){logger[_0x085b('0x2e')](_0xfa065c);}return _0x22b53b;}return this['channel']['error'](_0x4308a9,_0x085b('0x122'));};AGIVertices[_0x085b('0x10')]['awslex']=function(_0x395099){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x395099[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x395099[_0x085b('0x8a')])||!this[_0x085b('0x87')](_0x395099['aws_secret_access_key'])){return this[_0x085b('0x37')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x395099[_0x085b('0x91')])){return this['channel'][_0x085b('0xac')](_0x085b('0x123'));}if(!this[_0x085b('0x87')](_0x395099['text'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xab'));}this[_0x085b('0x37')]['bot']=!![];this[_0x085b('0x33')](_0x395099);this[_0x085b('0x42')](_0x395099['text'],'in','','');this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x395099['text']));var _0x157495=this[_0x085b('0x8f')][_0x085b('0x71')](this,_0x395099);if(_0x157495){for(var _0x1cbec6 in _0x157495){if(_0x157495[_0x085b('0x97')](_0x1cbec6)&&_[_0x085b('0x98')](_0x157495[_0x1cbec6])){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x124'),_0x1cbec6[_0x085b('0x6a')]()),_0x157495[_0x1cbec6]);}}if(_[_0x085b('0x45')](_0x157495[_0x085b('0x79')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x125'));}else{this['createSquareMessage'](_0x157495[_0x085b('0x79')],_0x085b('0xf1'),_0x085b('0x126'),'');return this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0x127'),_0x157495[_0x085b('0x79')]));}}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x395099,_0x085b('0x128'));};AGIVertices[_0x085b('0x10')][_0x085b('0x129')]=function(_0x1e7ceb){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x12a'),_0x1e7ceb['label'],_0x1e7ceb[_0x085b('0x65')]));if(!this['isConfigured'](_0x1e7ceb[_0x085b('0x7d')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20key\x20configured');}var _0x21bfc7=_0x085b('0x12b');var _0x554e59=util['format'](_0x085b('0x12c'),FILES_PATH,rs[_0x085b('0x115')](0x4));var _0x426511=util[_0x085b('0x28')](_0x085b('0xa0'),_0x554e59,_0x21bfc7);var _0x430ff7=!![];if(_0x1e7ceb[_0x085b('0x12d')]===_0x085b('0x12e')){_0x430ff7=![];}var _0x4c9706=this[_0x085b('0x37')][_0x085b('0x12f')](_0x554e59,_0x21bfc7,_0x1e7ceb[_0x085b('0x130')],_0x1e7ceb[_0x085b('0x65')],undefined,_0x430ff7);if(_0x4c9706[_0x085b('0xa6')]!==-0x1){this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('google\x20%s\x20file\x20created',_0x426511));var _0x50687d=this[_0x085b('0x92')][_0x085b('0x71')](this,_0x1e7ceb,_0x426511);if(_0x50687d){for(var _0x3b196a in _0x50687d){if(_0x50687d[_0x085b('0x97')](_0x3b196a)){this['channel'][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x131'),_0x3b196a[_0x085b('0x6a')]()),_0x50687d[_0x3b196a]);}}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x132'),JSON[_0x085b('0x75')](_0x50687d)));}}return _0x4c9706;};AGIVertices[_0x085b('0x10')]['tildeasr']=function(_0x4aa1f0){logger['info'](util[_0x085b('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4aa1f0[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4aa1f0['appid'])){return this['channel'][_0x085b('0xac')](_0x085b('0x133'));}if(!this['isConfigured'](_0x4aa1f0['appsecret'])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20appsecret\x20configured');}var _0xdf106f=_0x085b('0x12b');var _0x199f3f=util[_0x085b('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x085b('0x115')](0x4));var _0x3b2156=util[_0x085b('0x28')](_0x085b('0xa0'),_0x199f3f,_0xdf106f);var _0x438fd9=!![];if(_0x4aa1f0['beep']===_0x085b('0x12e')){_0x438fd9=![];}var _0x219f27=this[_0x085b('0x37')][_0x085b('0x12f')](_0x199f3f,_0xdf106f,_0x4aa1f0[_0x085b('0x130')],_0x4aa1f0[_0x085b('0x65')],undefined,_0x438fd9);if(_0x219f27[_0x085b('0xa6')]!==-0x1){this[_0x085b('0x37')]['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x3b2156));var _0x2e029f=this['tildeASR'][_0x085b('0x71')](this,_0x4aa1f0,_0x3b2156);if(_0x2e029f){for(var _0x48d4a6 in _0x2e029f){if(_0x2e029f['hasOwnProperty'](_0x48d4a6)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x134'),_0x48d4a6[_0x085b('0x6a')]()),_0x2e029f[_0x48d4a6]);}}return this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0x135'),JSON['stringify'](_0x2e029f)));}}return _0x219f27;};AGIVertices['prototype'][_0x085b('0x136')]=function(_0x5d5155){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x137'),_0x5d5155[_0x085b('0x35')]));return this[_0x085b('0x37')][_0x085b('0x138')](_0x5d5155[_0x085b('0x3c')],_0x5d5155['extension'],_0x5d5155[_0x085b('0x3e')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x139')]=function(_0x104ee){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x13a'),_0x104ee[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x104ee[_0x085b('0x13b')])){return this[_0x085b('0x37')]['error'](_0x104ee,'no\x20condition\x20configured');}try{var _0x20bdc9=eval(_0x104ee[_0x085b('0x13b')])?_0x085b('0x13c'):_0x085b('0x13d');this[_0x085b('0x37')][_0x085b('0xac')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x104ee[_0x085b('0x13b')],_0x20bdc9));return{'code':0xc8,'result':_0x20bdc9};}catch(_0x1879f6){return{'code':0xc8,'result':_0x085b('0x13d')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x13e')]=function(_0x943c91){logger[_0x085b('0x2a')](util['format'](_0x085b('0x13f'),_0x943c91[_0x085b('0x35')]));if(!this['isConfigured'](_0x943c91[_0x085b('0x140')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x943c91,'no\x20interval\x20configured');}var _0x4184f8=this[_0x085b('0x24')][_0x085b('0x71')](this,_0x943c91[_0x085b('0x140')]);if(!_0x4184f8){return this[_0x085b('0x37')]['error'](_0x943c91,_0x085b('0x141'));}for(var _0x1b263d=0x0;_0x1b263d<_0x4184f8[_0x085b('0x9e')];_0x1b263d+=0x1){var _0x1b5bdf=this['channel'][_0x085b('0x11')](util[_0x085b('0x28')]('IFTIME(%s?true:false)',_0x4184f8[_0x1b263d]));if(_0x1b5bdf[_0x085b('0xa6')]===-0x1){return _0x1b5bdf;}logger['info'](util[_0x085b('0x28')](_0x085b('0x142'),_0x4184f8[_0x1b263d],_0x1b5bdf[_0x085b('0xa4')]));if(_0x1b5bdf[_0x085b('0xa4')]===_0x085b('0x13c')){logger[_0x085b('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x4184f8[_0x1b263d],_0x085b('0x13c')));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x142'),_0x4184f8[_0x1b263d],_0x085b('0x13c')));return{'code':0xc8,'result':_0x085b('0x13c')};}else{logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x142'),_0x4184f8[_0x1b263d],_0x085b('0x13d')));this[_0x085b('0x37')][_0x085b('0xac')](util['format']('IFTIME\x20%s\x20%s',_0x4184f8[_0x1b263d],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x085b('0x10')][_0x085b('0x143')]=function(_0x52054c){logger['info'](util[_0x085b('0x28')](_0x085b('0x144'),_0x52054c['label']));return this['channel']['hangup']();};AGIVertices[_0x085b('0x10')]['ispeechasr']=function(_0x51b7ab){logger[_0x085b('0x2a')](util['format'](_0x085b('0x145'),_0x51b7ab[_0x085b('0x35')]));if(!this['isConfigured'](_0x51b7ab[_0x085b('0x7d')])){return this['channel']['noop'](_0x085b('0x146'));}var _0x27bff6='wav';var _0x5007ba=util['format'](_0x085b('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x22a8c9=util['format']('%s.%s',_0x5007ba,_0x27bff6);var _0x87a4e7=!![];if(_0x51b7ab[_0x085b('0x12d')]==='NOBEEP'){_0x87a4e7=![];}var _0x42d48e=this[_0x085b('0x37')][_0x085b('0x12f')](_0x5007ba,_0x27bff6,_0x51b7ab[_0x085b('0x130')],_0x51b7ab[_0x085b('0x65')],undefined,_0x87a4e7);if(_0x42d48e[_0x085b('0xa6')]!==-0x1){this['channel']['noop'](util[_0x085b('0x28')](_0x085b('0x147'),_0x22a8c9));var _0xc96fd1=this['ispeechASR'][_0x085b('0x71')](this,_0x51b7ab,_0x22a8c9);if(_0xc96fd1){for(var _0x29d3ba in _0xc96fd1){if(_0xc96fd1['hasOwnProperty'](_0x29d3ba)){this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x148'),_0x29d3ba[_0x085b('0x6a')]()),_0xc96fd1[_0x29d3ba]);}}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x149'),JSON[_0x085b('0x75')](_0xc96fd1)));}}return _0x42d48e;};AGIVertices[_0x085b('0x10')][_0x085b('0x14a')]=function(_0x32c10c){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x14b'),_0x32c10c[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x32c10c[_0x085b('0x7d')])){return this[_0x085b('0x37')]['noop'](_0x085b('0x146'));}if(!this['isConfigured'](_0x32c10c[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20text\x20configured');}this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x14c'),_0x32c10c[_0x085b('0x5b')]));var _0x18d393=this[_0x085b('0x84')][_0x085b('0x71')](this,_0x32c10c);if(_0x18d393){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x147'),_0x18d393));var _0x36651e=this['channel'][_0x085b('0xfd')](_0x18d393,_0x32c10c[_0x085b('0x130')]);try{fs[_0x085b('0xfe')](_0x18d393+_0x085b('0xff'));}catch(_0x12a2ec){logger[_0x085b('0x2e')](_0x12a2ec);}return _0x36651e;}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x32c10c,_0x085b('0x14d'));};AGIVertices['prototype'][_0x085b('0x14e')]=function(_0x3b42e5){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3b42e5['label']));if(!this['isConfigured'](_0x3b42e5['findBy'])){return this[_0x085b('0x37')]['error'](_0x3b42e5,_0x085b('0x14f'));}logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x150'),this['channel'][_0x085b('0x39')],_0x3b42e5['findBy']));var _0x759410=this[_0x085b('0x53')]['sync'](this,_0x3b42e5[_0x085b('0x151')]);if(_0x759410){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x3b42e5[_0x085b('0x151')]));this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')][_0x085b('0x39')],_0x3b42e5['findBy']));return{'code':0xc8,'result':_0x085b('0x153')};}else{logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x154'),this['channel'][_0x085b('0x39')],_0x3b42e5[_0x085b('0x151')]));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x154'),this[_0x085b('0x37')]['callerid'],_0x3b42e5[_0x085b('0x151')]));return{'code':0xc8,'result':_0x085b('0x155')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x156')]=function(_0x4ed671){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4ed671[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x4ed671[_0x085b('0x151')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x4ed671,_0x085b('0x14f'));}logger[_0x085b('0x2a')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x085b('0x37')][_0x085b('0x39')],_0x4ed671['findBy']));var _0x5a84a5=this[_0x085b('0x52')][_0x085b('0x71')](this,_0x4ed671['findBy']);if(_0x5a84a5){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x4ed671[_0x085b('0x151')]));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')][_0x085b('0x39')],_0x4ed671[_0x085b('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x085b('0x2a')](util['format'](_0x085b('0x154'),this[_0x085b('0x37')][_0x085b('0x39')],_0x4ed671[_0x085b('0x151')]));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x085b('0x37')]['callerid'],_0x4ed671[_0x085b('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x491f7c){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x157'),_0x491f7c['label']));if(!this[_0x085b('0x87')](_0x491f7c[_0x085b('0x158')])){return this['channel'][_0x085b('0x2e')](_0x491f7c,'no\x20operation\x20configured');}this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('math\x20%s',_0x491f7c[_0x085b('0x158')]));var _0x4ac202=eval(_0x491f7c[_0x085b('0x158')]);if(!this[_0x085b('0x87')](_0x491f7c[_0x085b('0xd9')])){return this[_0x085b('0x37')]['noop'](_0x085b('0x10e'));}var _0x214d79=this['getVariable'][_0x085b('0x71')](this,_0x491f7c[_0x085b('0xd9')]);if(!_0x214d79){return this[_0x085b('0x37')]['error'](_0x491f7c,_0x085b('0x113'));}if(_[_0x085b('0x9d')](_0x4ac202)){var _0x30155e=this;_0x4ac202[_0x085b('0xda')](function(_0x31f568,_0x131491){_0x30155e['channel'][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x159'),_0x214d79,_0x131491),_0x31f568);});return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x15a'),_0x214d79));}else{return this[_0x085b('0x37')]['setVariable'](_0x214d79,_0x4ac202);}};AGIVertices[_0x085b('0x10')]['menu']=function(_0x37efde){logger[_0x085b('0x2a')](util['format'](_0x085b('0x15b'),_0x37efde[_0x085b('0x35')]));if(_0x37efde[_0x085b('0x10c')]===0x0){return this[_0x085b('0xa8')](_0x37efde);}_0x37efde[_0x085b('0x10c')]-=0x1;if(!this[_0x085b('0x87')](_0x37efde[_0x085b('0x10d')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x37efde,_0x085b('0x15c'));}var _0x10c809=this[_0x085b('0x1f')][_0x085b('0x71')](this,_0x37efde['file_id']);if(!_0x10c809){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x37efde,'no\x20file\x20audio\x20found');}var _0x1ec0d4=this[_0x085b('0x37')][_0x085b('0x15d')](_0x10c809,_0x37efde['response'],_0x37efde[_0x085b('0x15e')]);var _0x553755=_0x1ec0d4['result'];if(_0x1ec0d4['result']===-0x1){this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x37efde,'-1');return _0x1ec0d4;}else if(_0x1ec0d4['extra']===_0x085b('0x65')){_0x1ec0d4[_0x085b('0xa6')]=_0x1ec0d4[_0x085b('0xa6')]['length']>0x0?_0x1ec0d4[_0x085b('0xa6')]:'t';}else if(_[_0x085b('0x44')](_0x1ec0d4[_0x085b('0xa6')])){_0x1ec0d4[_0x085b('0xa6')]='#';_0x553755='#';}if(!this[_0x085b('0x87')](_0x37efde['variable_id'])){this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x10e'));}else{var _0x5afc7c=this['getVariable'][_0x085b('0x71')](this,_0x37efde['variable_id']);if(!_0x5afc7c){return this['channel'][_0x085b('0x2e')](_0x37efde,_0x085b('0x113'));}this[_0x085b('0x37')][_0x085b('0xa1')](_0x5afc7c,_0x553755);}this['createSquareDetailsReport'][_0x085b('0x71')](this,_0x37efde,_0x553755);return _0x1ec0d4;};AGIVertices[_0x085b('0x10')][_0x085b('0xac')]=function(_0xfeef21){logger['info'](util['format'](_0x085b('0x15f'),_0xfeef21[_0x085b('0x35')]));return this['channel']['noop'](_0xfeef21[_0x085b('0x160')]||_0xfeef21[_0x085b('0x35')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x161')]=function(_0x28c804){logger['info'](util[_0x085b('0x28')](_0x085b('0x162'),_0x28c804[_0x085b('0x35')]));if(!this['isConfigured'](_0x28c804[_0x085b('0x151')])){return this['channel'][_0x085b('0x2e')](_0x28c804,_0x085b('0x14f'));}logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x150'),this[_0x085b('0x37')][_0x085b('0x39')],_0x28c804[_0x085b('0x151')]));var _0x3fa468=this[_0x085b('0x4d')][_0x085b('0x71')](this,_0x28c804['pause_id']);var _0x460fb8=this[_0x085b('0x4f')][_0x085b('0x71')](this,_0x28c804[_0x085b('0x151')],_0x3fa468);if(_0x460fb8){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x28c804[_0x085b('0x151')]));this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0x152'),this['channel']['callerid'],_0x28c804['findBy']));return{'code':0xc8,'result':_0x085b('0x153')};}else{logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x154'),this[_0x085b('0x37')]['callerid'],_0x28c804['findBy']));this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x152'),this['channel'][_0x085b('0x39')],_0x28c804[_0x085b('0x151')]));return{'code':0xc8,'result':_0x085b('0x155')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x163')]=function(_0x249235){logger[_0x085b('0x2a')](util['format'](_0x085b('0x164'),_0x249235[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x249235['file_id'])){return this[_0x085b('0x37')]['error'](_0x249235,'no\x20file\x20audio\x20selected');}var _0x3cfd3d=this[_0x085b('0x1f')][_0x085b('0x71')](this,_0x249235[_0x085b('0x10d')]);if(!_0x3cfd3d){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x249235,_0x085b('0x165'));}var _0x333e97=this[_0x085b('0x37')][_0x085b('0x58')](_0x085b('0x166'),[_0x3cfd3d,_0x249235[_0x085b('0xe2')]]);if(_0x333e97[_0x085b('0xa6')]===-0x1){return _0x333e97;}return this['channel']['noop'](util[_0x085b('0x28')](_0x085b('0xc9'),_0x085b('0x166'),_0x3cfd3d));};AGIVertices[_0x085b('0x10')]['queue']=function(_0x200ce3){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x200ce3[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x200ce3['queue_id'])){return this['channel'][_0x085b('0x2e')](_0x200ce3,_0x085b('0x167'));}var _0x1a2e5e='';var _0x3fd69d=parseInt(_0x200ce3[_0x085b('0x168')],0xa);if(isNaN(_0x3fd69d)){_0x1a2e5e=_0x200ce3[_0x085b('0x168')];}else{_0x1a2e5e=this[_0x085b('0x169')][_0x085b('0x71')](this,_0x200ce3[_0x085b('0x168')]);if(!_0x1a2e5e){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x200ce3,_0x085b('0x16a'));}}var _0x1492d3='';if(this[_0x085b('0x87')](_0x200ce3['file_id'])){var _0xbc5a5b=this['getSound']['sync'](this,_0x200ce3[_0x085b('0x10d')]);if(_0xbc5a5b){_0x1492d3=_0xbc5a5b;}}this[_0x085b('0x33')][_0x085b('0x71')](this,_0x200ce3,_0x1a2e5e);if(_0x200ce3[_0x085b('0xe2')]['indexOf']('x')<0x0){_0x200ce3['opts']+='x';}if(_0x200ce3[_0x085b('0xe2')][_0x085b('0x16b')]('X')<0x0){_0x200ce3['opts']+='X';}this['channel']['setVariable'](_0x085b('0x16c'),_0x1a2e5e?_0x1a2e5e[_0x085b('0x16d')]():'');var _0x479613=this[_0x085b('0x37')][_0x085b('0x58')]('QUEUE',[_0x1a2e5e,_0x200ce3[_0x085b('0xe2')],_0x200ce3[_0x085b('0x63')],_0x1492d3,_0x200ce3[_0x085b('0x65')],_0x200ce3[_0x085b('0x9')],_0x200ce3[_0x085b('0x16e')],_0x200ce3[_0x085b('0x16f')],'',_0x200ce3[_0x085b('0x170')]]);if(_0x479613[_0x085b('0xa6')]===-0x1){return _0x479613;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc9'),_0x085b('0x171'),_0x1a2e5e));};AGIVertices[_0x085b('0x10')][_0x085b('0x172')]=function(_0x1932e0){logger['info'](util[_0x085b('0x28')](_0x085b('0x173'),_0x1932e0[_0x085b('0x35')]));var _0x66e2ef=_0x1932e0[_0x085b('0x174')]||_0x085b('0x12b');var _0x3527a5=util[_0x085b('0x28')](_0x085b('0x175'),this[_0x085b('0x37')]['uniqueid'],rs[_0x085b('0x115')](0x5));var _0x271099=util[_0x085b('0x28')](_0x085b('0x176'),FILES_PATH,_0x3527a5,_0x66e2ef);var _0x1f1783=util[_0x085b('0x28')](_0x085b('0x12c'),FILES_PATH,_0x3527a5);this[_0x085b('0x3a')][_0x085b('0x71')](this,_0x1932e0,_0x3527a5,_0x271099);this[_0x085b('0x37')]['setVariable']('RECORDING_SAVENAME',_0x3527a5);logger['info'](_0x085b('0x177'),_0x1f1783,_0x66e2ef,_0x1932e0[_0x085b('0x178')],_0x1932e0[_0x085b('0x65')]);return this[_0x085b('0x37')]['recordFile'](_0x1f1783,_0x66e2ef,_0x1932e0[_0x085b('0x178')],_0x1932e0[_0x085b('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x085b('0x179')]=function(_0x49f7d6){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x49f7d6[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x49f7d6['url'])){return this[_0x085b('0x37')]['noop']('no\x20url\x20configured');}var _0x43b52f=this[_0x085b('0x62')][_0x085b('0x71')](this,_0x49f7d6);logger[_0x085b('0x2a')](util['format'](_0x085b('0x17a'),util[_0x085b('0x17b')](_0x43b52f,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x49f7d6[_0x085b('0xd9')])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x431628=this['getVariable'][_0x085b('0x71')](this,_0x49f7d6['variable_id']);if(!_0x431628){return this[_0x085b('0x37')]['error'](_0x49f7d6,_0x085b('0x113'));}this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')](_0x085b('0x17c'),_0x431628),_0x43b52f[_0x085b('0x77')]?_0x43b52f[_0x085b('0x77')]:_0x085b('0x17d'));this[_0x085b('0x37')][_0x085b('0xa1')](util[_0x085b('0x28')]('%s_STATUS_MESSAGE',_0x431628),_0x43b52f[_0x085b('0x78')]?_0x43b52f['statusMessage']:'OK');if(_0x43b52f[_0x085b('0x6b')]){try{this[_0x085b('0x9f')](_0x43b52f[_0x085b('0x6b')],_0x431628);}catch(_0x239086){logger[_0x085b('0x2e')](util['format'](_0x085b('0x17e'),_0x431628));}}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x17f'),_0x431628));};AGIVertices[_0x085b('0x10')][_0x085b('0x180')]=function(_0x2f3e1f){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2f3e1f['label']));return this[_0x085b('0x37')][_0x085b('0x181')](_0x2f3e1f['digits'][_0x085b('0xd8')](/\s+/g,''),_0x2f3e1f[_0x085b('0x178')]);};AGIVertices[_0x085b('0x10')][_0x085b('0x182')]=function(_0x39e1f2){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x183'),_0x39e1f2[_0x085b('0x35')]));return this[_0x085b('0x37')][_0x085b('0x184')](_0x39e1f2[_0x085b('0x66')][_0x085b('0xd8')](/\s+/g,''),_0x39e1f2[_0x085b('0x178')]);};AGIVertices[_0x085b('0x10')]['sayphonetic']=function(_0x47aa62){logger['info'](util[_0x085b('0x28')](_0x085b('0x185'),_0x47aa62[_0x085b('0x35')]));return this['channel'][_0x085b('0x186')](_0x47aa62[_0x085b('0x5b')],_0x47aa62[_0x085b('0x178')]);};AGIVertices['prototype'][_0x085b('0x187')]=function(_0x495afe){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x188'),_0x495afe[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x495afe[_0x085b('0x189')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x18a'));}var _0x3495d9=this[_0x085b('0x18b')][_0x085b('0x71')](this,_0x495afe[_0x085b('0x189')]);if(!_0x3495d9||!_0x3495d9[_0x085b('0x18c')]){return this['channel'][_0x085b('0x2e')](_0x495afe,'no\x20mail\x20account\x20found');}var _0x5bb0f3={'from':util[_0x085b('0x28')](_0x085b('0x18d'),_0x3495d9['name'],_0x3495d9[_0x085b('0x18e')]||_0x3495d9[_0x085b('0x18c')][_0x085b('0x18f')]),'to':_0x495afe['to']||'','cc':_0x495afe['cc']||'','bcc':_0x495afe[_0x085b('0x190')]||'','subject':_0x495afe[_0x085b('0x191')],'html':_0x495afe['text'],'text':_0x495afe['text']};var _0x1f7d30={'tls':{'rejectUnauthorized':![]}};if(_0x3495d9[_0x085b('0x18c')][_0x085b('0x192')]){_0x1f7d30['service']=_0x3495d9[_0x085b('0x18c')]['service'];}else{_0x1f7d30['host']=_0x3495d9[_0x085b('0x18c')][_0x085b('0x193')];_0x1f7d30[_0x085b('0x194')]=_0x3495d9[_0x085b('0x18c')][_0x085b('0x194')];_0x1f7d30[_0x085b('0x195')]=_0x3495d9[_0x085b('0x18c')][_0x085b('0x195')];}if(_0x3495d9['Smtp'][_0x085b('0x196')]){_0x1f7d30[_0x085b('0x197')]={'user':_0x3495d9[_0x085b('0x18c')][_0x085b('0x18f')],'pass':_0x3495d9['Smtp']['pass']};}if(this[_0x085b('0x87')](_0x495afe[_0x085b('0x198')])){}logger[_0x085b('0x199')](_0x085b('0x19a'),JSON[_0x085b('0x75')](_0x5bb0f3));this[_0x085b('0x33')][_0x085b('0x71')](this,_0x495afe,_0x495afe[_0x085b('0x189')]);this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3495d9[_0x085b('0x15')]));this[_0x085b('0x23')][_0x085b('0x71')](this,_0x1f7d30,_0x5bb0f3);return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x19b'));};AGIVertices['prototype'][_0x085b('0x19c')]=function(_0x3f22dd){logger['info'](util[_0x085b('0x28')](_0x085b('0x19d'),_0x3f22dd['label']));return this['channel'][_0x085b('0xac')](_0x085b('0x19e'));};AGIVertices['prototype']['sendSMS']=function(_0x58d8ee){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x19f'),_0x58d8ee[_0x085b('0x35')]));if(!this[_0x085b('0x87')](_0x58d8ee['sms_account_id'])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x1a0'));}var _0x1ff8fd=this[_0x085b('0x30')]['sync'](this,_0x58d8ee[_0x085b('0x1a1')]);if(!_0x1ff8fd){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x58d8ee,_0x085b('0x1a2'));}var _0xfef726={'body':_0x58d8ee[_0x085b('0x1a3')],'phone':_0x58d8ee['to']||'','SmsAccountId':_0x1ff8fd['id']};logger['debug'](_0x085b('0x1a4'),JSON[_0x085b('0x75')](_0xfef726));this[_0x085b('0x33')][_0x085b('0x71')](this,_0x58d8ee,_0x58d8ee[_0x085b('0x1a1')]);this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0x1a5'),_0x1ff8fd[_0x085b('0x15')]));this[_0x085b('0x32')]['sync'](this,_0xfef726);return this[_0x085b('0x37')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x085b('0x10')][_0x085b('0x1a6')]=function(_0x5392da){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5392da[_0x085b('0x35')]));if(!this['isConfigured'](_0x5392da[_0x085b('0xd9')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x5392da,_0x085b('0x1a7'));}var _0x1d599e=this[_0x085b('0x11')]['sync'](this,_0x5392da['variable_id']);if(!_0x1d599e){return this['channel'][_0x085b('0x2e')](_0x5392da,_0x085b('0x113'));}return this[_0x085b('0x37')]['setVariable'](_0x1d599e,_0x5392da['variable_value']);};AGIVertices[_0x085b('0x10')][_0x085b('0x1a8')]=function(_0x3d4fb9){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1a9'),_0x3d4fb9[_0x085b('0x35')]));this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0x1aa'));if(_0x3d4fb9[_0x085b('0xbb')]===_0x085b('0x1ab')){this[_0x085b('0x37')]['noop'](_0x085b('0x1ac'));return this[_0x085b('0x37')][_0x085b('0xbb')]();}return this[_0x085b('0x37')]['noop'](_0x085b('0x1ad'));};AGIVertices['prototype'][_0x085b('0x1ae')]=function(_0x15946e){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1af'),_0x15946e[_0x085b('0x35')]));if(!this['isConfigured'](_0x15946e[_0x085b('0x1b0')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x15946e,'no\x20subproject\x20selected');}var _0x2636c6=this[_0x085b('0x18')][_0x085b('0x71')](this,_0x15946e[_0x085b('0x1b0')]);if(!this[_0x085b('0x87')](_0x2636c6)){return this['channel'][_0x085b('0x2e')](_0x15946e,util[_0x085b('0x28')](_0x085b('0x1b1'),_0x15946e[_0x085b('0x1b0')]));}if(_0x2636c6===this[_0x085b('0x37')][_0x085b('0x38')]){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x15946e,_0x085b('0x1b2'));}this[_0x085b('0x33')][_0x085b('0x71')](this,_0x15946e,_0x2636c6);var _0xca02af=this['channel']['exec'](_0x085b('0x1b3'),util[_0x085b('0x28')](_0x085b('0x1b4'),config[_0x085b('0x9')][_0x085b('0x193')]||_0x085b('0x1b5'),_0x2636c6,this[_0x085b('0x37')]['arg_1']));if(_0xca02af['result']===-0x1){return _0xca02af;}return this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Executed\x20command\x20%s\x20%s',_0x085b('0x1b3'),_0x2636c6));};AGIVertices[_0x085b('0x10')][_0x085b('0x1b6')]=function(_0xe0dda9){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1b7'),_0xe0dda9['label']));var _0x350422=this['shellCommand'][_0x085b('0x71')](this,_0xe0dda9['command']);this[_0x085b('0x33')][_0x085b('0x71')](this,_0xe0dda9,_0xe0dda9[_0x085b('0xb9')]);if(this[_0x085b('0x87')](_0xe0dda9['variable_id'])){var _0xecd800=this[_0x085b('0x11')][_0x085b('0x71')](this,_0xe0dda9[_0x085b('0xd9')]);if(_0xecd800){this['channel'][_0x085b('0xa1')](_0xecd800,_0x350422);return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1b8'),_0xe0dda9[_0x085b('0xb9')],_0xecd800));}}return this[_0x085b('0x37')]['noop'](util[_0x085b('0x28')](_0x085b('0x1b9'),_0xe0dda9[_0x085b('0xb9')]));};AGIVertices[_0x085b('0x10')][_0x085b('0x1ba')]=function(_0x179957){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x1bb'),_0x179957['label']));_0x179957[_0x085b('0x5b')]=_0x179957[_0x085b('0x5b')][_0x085b('0xd8')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x179957['apiKey'])){return this[_0x085b('0x37')][_0x085b('0xac')]('no\x20apiKey\x20configured');}if(!this[_0x085b('0x87')](_0x179957['text'])){return this[_0x085b('0x37')]['noop'](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x179957['text']));var _0x33819d=this[_0x085b('0x59')][_0x085b('0x71')](this,_0x179957);if(_0x33819d){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1bc'),_0x33819d));var _0x4ec91f=this['channel'][_0x085b('0xfd')](_0x33819d);try{fs[_0x085b('0xfe')](_0x33819d+_0x085b('0xff'));}catch(_0x5cdecf){logger[_0x085b('0x2e')](_0x5cdecf);}return _0x4ec91f;}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x179957,_0x085b('0x1bd'));};AGIVertices[_0x085b('0x10')][_0x085b('0x1be')]=function(_0x2f0553){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x1bf'),_0x2f0553[_0x085b('0x35')]));_0x2f0553[_0x085b('0x5b')]=_0x2f0553[_0x085b('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x085b('0x87')](_0x2f0553[_0x085b('0x5b')])){return this[_0x085b('0x37')][_0x085b('0xac')](_0x085b('0xab'));}this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1c0'),_0x2f0553['text']));var _0x89bcb4=this[_0x085b('0x1c1')]['sync'](this,_0x2f0553);if(_0x89bcb4){this[_0x085b('0x37')][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0x1c2'),_0x89bcb4));var _0x5800de=this[_0x085b('0x37')][_0x085b('0xfd')](_0x89bcb4);try{fs['unlink'](_0x89bcb4+_0x085b('0xff'));}catch(_0x17f6e3){logger['error'](_0x17f6e3);}return _0x5800de;}return this[_0x085b('0x37')][_0x085b('0x2e')](_0x2f0553,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x085b('0x10')][_0x085b('0x1c3')]=function(_0x37ca78){logger[_0x085b('0x2a')](util[_0x085b('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x37ca78['label']));if(!this[_0x085b('0x87')](_0x37ca78[_0x085b('0x151')])){return this[_0x085b('0x37')][_0x085b('0x2e')](_0x37ca78,_0x085b('0x14f'));}logger['info'](util[_0x085b('0x28')](_0x085b('0x150'),this[_0x085b('0x37')][_0x085b('0x39')],_0x37ca78['findBy']));var _0x4dbaec=this[_0x085b('0x51')][_0x085b('0x71')](this,_0x37ca78[_0x085b('0x151')]);if(_0x4dbaec){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x152'),this[_0x085b('0x37')]['callerid'],_0x37ca78[_0x085b('0x151')]));this['channel'][_0x085b('0xac')](util[_0x085b('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x085b('0x37')][_0x085b('0x39')],_0x37ca78[_0x085b('0x151')]));return{'code':0xc8,'result':_0x085b('0x153')};}else{logger['info'](util[_0x085b('0x28')](_0x085b('0x154'),this['channel'][_0x085b('0x39')],_0x37ca78[_0x085b('0x151')]));this[_0x085b('0x37')]['noop'](util['format'](_0x085b('0x154'),this[_0x085b('0x37')][_0x085b('0x39')],_0x37ca78['findBy']));return{'code':0xc8,'result':_0x085b('0x155')};}};AGIVertices[_0x085b('0x10')][_0x085b('0x1c4')]=function(_0x5497b0){logger[_0x085b('0x2a')](util[_0x085b('0x28')](_0x085b('0x1c5'),_0x5497b0[_0x085b('0x35')]));var _0x40e1cb=this[_0x085b('0x37')]['exec'](_0x085b('0x1c6'),[_0x5497b0[_0x085b('0x1c7')],_0x5497b0['options']]);if(_0x40e1cb['result']===-0x1){return _0x40e1cb;}return this['channel'][_0x085b('0xac')](util[_0x085b('0x28')](_0x085b('0xc9'),_0x085b('0x1c6'),_0x5497b0['mailbox']));};AGIVertices[_0x085b('0x10')][_0x085b('0x1c8')]=function(_0x423b23){logger[_0x085b('0x2a')](util['format'](_0x085b('0x1c9'),_0x423b23['label']));if(!this[_0x085b('0x87')](_0x423b23[_0x085b('0xd9')])){return this['channel']['error'](_0x423b23,_0x085b('0x1a7'));}var _0x4ba525=this[_0x085b('0x11')][_0x085b('0x71')](this,_0x423b23[_0x085b('0xd9')]);if(!_0x4ba525){return this['channel'][_0x085b('0x2e')](_0x423b23,'no\x20variable\x20found');}var _0x75d981=this[_0x085b('0x37')][_0x085b('0x11')](_0x4ba525);return{'code':0xc8,'result':_0x75d981[_0x085b('0xa4')]?_0x75d981[_0x085b('0xa4')]:'-'};};String['prototype']['replaceAll']=function(_0x57f213,_0xa38d6){return this[_0x085b('0xa2')](_0x57f213)[_0x085b('0x1ca')](_0xa38d6);};module[_0x085b('0x1cb')]=AGIVertices; \ No newline at end of file +var _0x784a=['aws_polly_voice','Amy','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','saveRestApiResult','length','setVariable','%s.%s','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','noop','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','phone','list_id','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20query\x20configured','getQueryOdbc','createSquareDetailsReport','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','opts','no\x20key\x20configured','bot','DIALOGFLOW_%s','out','dialogflow','Dialogflow\x20Result\x20%s','speech','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','toString','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','beep','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','gotoif','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\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','macro','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','no\x20url\x20configured','restAPI','inspect','%s_STATUS_CODE','200','sayDigits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','service','host','port','secure','authentication','auth','pass','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','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','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','odbc','moment','mustache','../../config/logger','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','catch','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','MALE','audioEncoding','MP3','googleTTS','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region'];(function(_0x2c64b9,_0x30d121){var _0x25e018=function(_0x21c5dc){while(--_0x21c5dc){_0x2c64b9['push'](_0x2c64b9['shift']());}};_0x25e018(++_0x30d121);}(_0x784a,0x130));var _0xa784=function(_0x58916b,_0x43fc5d){_0x58916b=_0x58916b-0x0;var _0x238322=_0x784a[_0x58916b];return _0x238322;};'use strict';var fs=require('fs');var path=require(_0xa784('0x0'));var util=require(_0xa784('0x1'));var _=require(_0xa784('0x2'));var sh=require('shelljs');var odbc=require(_0xa784('0x3'))();var rs=require('randomstring');var moment=require(_0xa784('0x4'));var Mustache=require(_0xa784('0x5'));var rp=require('request-promise');var logger=require(_0xa784('0x6'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0xa784('0x7');var recursiveMapAttributes=[_0xa784('0x8'),_0xa784('0x9')];var verticesWithRetry=[_0xa784('0xa'),_0xa784('0xb'),_0xa784('0xc')];var AGIVertices=function(_0x2e55ec,_0xfe31dc,_0xf850d){this[_0xa784('0xd')]=_0x2e55ec;this[_0xa784('0xe')]=_0xfe31dc;this[_0xa784('0xf')]=_0xf850d;};AGIVertices[_0xa784('0x10')][_0xa784('0x11')]=function(_0x3bcec9,_0xc63bec){this[_0xa784('0xe')][_0xa784('0x12')](_0x3bcec9)[_0xa784('0x13')](function(_0x12ef61){_0xc63bec(null,_0x12ef61?_0x12ef61[_0xa784('0x14')]:![]);})['catch'](function(_0x513281){_0xc63bec(_0x513281);});};AGIVertices[_0xa784('0x10')][_0xa784('0x15')]=function(_0x1e8863,_0x5e3845){this['rpc'][_0xa784('0x16')](_0x1e8863)[_0xa784('0x13')](function(_0x4fc277){_0x5e3845(null,_0x4fc277?_0x4fc277[_0xa784('0x14')]:![]);})['catch'](function(_0x16a900){_0x5e3845(_0x16a900);});};AGIVertices[_0xa784('0x10')][_0xa784('0x17')]=function(_0x3e6c07,_0x4dac88){this[_0xa784('0xe')][_0xa784('0x18')](_0x3e6c07)[_0xa784('0x13')](function(_0x265e4e){_0x4dac88(null,_0x265e4e?_0x265e4e[_0xa784('0x14')]:![]);})['catch'](function(_0x333d98){_0x4dac88(_0x333d98);});};AGIVertices['prototype'][_0xa784('0x19')]=function(_0x242525,_0x3b57d3){this[_0xa784('0xe')][_0xa784('0x1a')](_0x242525)[_0xa784('0x13')](function(_0x3f6bc4){_0x3b57d3(null,_0x3f6bc4?_0x3f6bc4['dsn']:![]);})[_0xa784('0x1b')](function(_0x2d17a8){_0x3b57d3(_0x2d17a8);});};AGIVertices[_0xa784('0x10')]['getUser']=function(_0x58a132,_0x42f829){this['rpc']['getUserById'](_0x58a132)[_0xa784('0x13')](function(_0x5dd044){_0x42f829(null,_0x5dd044?_0x5dd044[_0xa784('0x14')]:![]);})[_0xa784('0x1b')](function(_0x3b3974){_0x42f829(_0x3b3974);});};AGIVertices['prototype'][_0xa784('0x1c')]=function(_0x23336d,_0x3986ce){this['rpc'][_0xa784('0x1d')](_0x23336d)[_0xa784('0x13')](function(_0x46514c){_0x3986ce(null,_0x46514c?_0x46514c[_0xa784('0x14')]:![]);})[_0xa784('0x1b')](function(_0x2cf9a9){_0x3986ce(_0x2cf9a9);});};AGIVertices[_0xa784('0x10')][_0xa784('0x1e')]=function(_0x14e9c4,_0x289a49){var _0x390adc=this;this['rpc'][_0xa784('0x1f')](_0x14e9c4)['then'](function(_0x2f631b){_0x289a49(null,_0x2f631b?_0x390adc[_0xa784('0x20')](_0x2f631b[_0xa784('0x21')]):![]);})[_0xa784('0x1b')](function(_0x10d3cc){_0x289a49(_0x10d3cc);});};AGIVertices[_0xa784('0x10')][_0xa784('0x22')]=function(_0x5de8f2,_0xbfa556){this[_0xa784('0xe')][_0xa784('0x23')](_0x5de8f2)['then'](function(_0x1deec9){_0xbfa556(null,_0x1deec9?_0x1deec9:![]);})['catch'](function(_0x243e99){_0xbfa556(_0x243e99);});};AGIVertices['prototype'][_0xa784('0x24')]=function(_0x3663fb,_0x7925c0,_0xca891c){this[_0xa784('0xf')][_0xa784('0x24')](_0x3663fb,_0x7925c0)[_0xa784('0x13')](function(){_0xca891c(null);})[_0xa784('0x1b')](function(_0x67e6bb){_0xca891c(_0x67e6bb);});};AGIVertices[_0xa784('0x10')][_0xa784('0x25')]=function(_0x48a47e,_0x4ec572){this['rpc'][_0xa784('0x26')](_0x48a47e)[_0xa784('0x13')](function(_0x1e3c8f){if(_0x1e3c8f){if(_0x1e3c8f[_0xa784('0x27')]){_0x4ec572(null,[_0x1e3c8f[_0xa784('0x28')]]);}else{_0x4ec572(null,_[_0xa784('0x29')](_0x1e3c8f['Intervals'],_0xa784('0x28')));}}else{_0x4ec572(null,![]);}})['catch'](function(_0xc2c908){_0x4ec572(_0xc2c908);});};AGIVertices[_0xa784('0x10')]['getSoundPath']=function(_0x65d270){return util[_0xa784('0x2a')]('%s/sounds/converted/%s',FILES_PATH,_0x65d270);};AGIVertices[_0xa784('0x10')]['getQueryOdbc']=function(_0x2507b8,_0x2bb9ae,_0x1c600f){odbc[_0xa784('0x2b')](_0x2507b8,function(_0x32c3fa){if(_0x32c3fa){logger[_0xa784('0x2c')](_0xa784('0x2d'),_0x32c3fa);_0x1c600f(_0x32c3fa);}else{logger[_0xa784('0x2e')](_0xa784('0x2f'));odbc[_0xa784('0x30')](_0x2bb9ae,function(_0xa2dbf4,_0x16ca4b){if(_0xa2dbf4){logger[_0xa784('0x2e')](_0xa784('0x31'),_0x2bb9ae);_0x1c600f(_0xa2dbf4);}else{logger[_0xa784('0x2e')](_0xa784('0x32'),_0x2bb9ae);odbc[_0xa784('0x33')](function(_0x20a33c){if(_0x20a33c){logger[_0xa784('0x2c')](_0xa784('0x34'),_0x20a33c);}_0x1c600f(null,_0x16ca4b);});}});}});};AGIVertices[_0xa784('0x10')]['getSmsAccount']=function(_0x4bfde2,_0x4b2aa0){this[_0xa784('0xe')][_0xa784('0x35')](_0x4bfde2)[_0xa784('0x13')](function(_0xba6692){_0x4b2aa0(null,_0xba6692?_0xba6692:![]);})[_0xa784('0x1b')](function(_0xc7ce7b){_0x4b2aa0(_0xc7ce7b);});};AGIVertices[_0xa784('0x10')]['createSmsMessage']=function(_0x44df54,_0x301ad0){this[_0xa784('0xe')]['createSmsMessage'](_0x44df54)[_0xa784('0x13')](function(_0x3a9520){_0x301ad0(null,_0x3a9520);})[_0xa784('0x1b')](function(_0x219f53){_0x301ad0(_0x219f53);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x468ba1,_0x3eaf37,_0x3ac8dc){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0xa784('0xd')][_0xa784('0x36')],'node':_0x468ba1[_0xa784('0x37')],'application':_0x468ba1[_0xa784('0x38')],'data':_0x3eaf37||null,'project_name':this[_0xa784('0xd')][_0xa784('0x39')],'callerid':this['channel'][_0xa784('0x3a')]})['then'](function(_0x473862){if(_0x3ac8dc){_0x3ac8dc(null,_0x473862);}})[_0xa784('0x1b')](function(_0x57fe9c){if(_0x3ac8dc){_0x3ac8dc(_0x57fe9c);}});};AGIVertices['prototype'][_0xa784('0x3b')]=function(_0x1650ac,_0x384846,_0x41598e,_0x153b90){this[_0xa784('0xe')]['createSquareRecording']({'uniqueid':this[_0xa784('0xd')]['uniqueid'],'callerid':this[_0xa784('0xd')]['callerid'],'calleridname':this[_0xa784('0xd')]['calleridname'],'context':this[_0xa784('0xd')][_0xa784('0x3c')],'extension':this[_0xa784('0xd')][_0xa784('0x3d')],'priority':this[_0xa784('0xd')][_0xa784('0x3e')],'accountcode':this['channel'][_0xa784('0x3f')],'dnid':this[_0xa784('0xd')][_0xa784('0x40')],'projectName':this['channel'][_0xa784('0x39')],'saveName':_0x384846,'filename':_0x1650ac[_0xa784('0x41')]||_0x384846,'savePath':_0x41598e})['then'](function(_0x37fe1e){_0x153b90(null,_0x37fe1e);})[_0xa784('0x1b')](function(_0x352f62){_0x153b90(_0x352f62);});};AGIVertices[_0xa784('0x10')][_0xa784('0x42')]=function(_0x2376f1,_0x2e006,_0x241cf4,_0x5aab6e,_0x38c9d3){this[_0xa784('0xe')][_0xa784('0x42')]({'uniqueid':this['channel'][_0xa784('0x36')],'body':_0x2376f1,'direction':_0x2e006,'providerName':_0x241cf4,'providerResponse':_0x5aab6e})[_0xa784('0x13')](function(_0x1e631a){if(_0x38c9d3){_0x38c9d3(null,_0x1e631a);}})[_0xa784('0x1b')](function(_0x1b49c7){if(_0x38c9d3){_0x38c9d3(_0x1b49c7);}});};AGIVertices[_0xa784('0x10')][_0xa784('0x43')]=function(_0x52a9d0,_0x411f83){this['rpc'][_0xa784('0x43')]({'firstName':_[_0xa784('0x44')](_0x52a9d0[_0xa784('0x14')])||_[_0xa784('0x45')](_0x52a9d0[_0xa784('0x14')])?_0xa784('0x46')+Math[_0xa784('0x47')]():_0x52a9d0[_0xa784('0x14')],'lastName':_[_0xa784('0x44')](_0x52a9d0[_0xa784('0x48')])||_[_0xa784('0x45')](_0x52a9d0['lastName'])?null:_0x52a9d0[_0xa784('0x48')],'phone':_0x52a9d0['phone'],'ListId':_0x52a9d0['list_id'],'scheduledat':_0x52a9d0[_0xa784('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xa784('0x4a'),'description':_0xa784('0x4b')+_0x52a9d0[_0xa784('0x49')]['toString'](),'priority':_0x52a9d0[_0xa784('0x4c')]})[_0xa784('0x13')](function(_0x10fcf7){_0x411f83(null,_0x10fcf7);})[_0xa784('0x1b')](function(_0x222ae9){_0x411f83(_0x222ae9);});};AGIVertices[_0xa784('0x10')][_0xa784('0x4d')]=function(_0x80a13f,_0x3cae6a){this['rpc']['getPauseById'](_0x80a13f)[_0xa784('0x13')](function(_0x4b2f64){_0x3cae6a(null,_0x4b2f64?_0x4b2f64[_0xa784('0x14')]:![]);})[_0xa784('0x1b')](function(_0x20212f){_0x3cae6a(_0x20212f);});};AGIVertices[_0xa784('0x10')][_0xa784('0x4e')]=function(_0xdc923a,_0x4b2785,_0xfb9466){var _0x2c46d9={'role':'agent'};_0x2c46d9[_0xdc923a]=this[_0xa784('0xd')]['callerid'];this[_0xa784('0xe')][_0xa784('0x4e')](_0x2c46d9,_0x4b2785,this['channel'][_0xa784('0x36')])[_0xa784('0x13')](function(_0x2aecff){_0xfb9466(null,_['isNil'](_0x2aecff)?![]:!![]);})[_0xa784('0x1b')](function(_0x342533){logger['error'](_0x342533);_0xfb9466(null,![]);});};AGIVertices[_0xa784('0x10')][_0xa784('0x4f')]=function(_0xb9880c,_0x55056c){var _0x2cd4e3={'role':_0xa784('0x50')};_0x2cd4e3[_0xb9880c]=this['channel']['callerid'];this['rpc'][_0xa784('0x4f')](_0x2cd4e3)[_0xa784('0x13')](function(_0x13c0d4){_0x55056c(null,_[_0xa784('0x45')](_0x13c0d4)?![]:!![]);})[_0xa784('0x1b')](function(_0xe523dd){logger['error'](_0xe523dd);_0x55056c(null,![]);});};AGIVertices[_0xa784('0x10')][_0xa784('0x51')]=function(_0x5995a4,_0x33d88a){var _0x4aa326={'role':_0xa784('0x50')};_0x4aa326[_0x5995a4]=this['channel'][_0xa784('0x3a')];this[_0xa784('0xe')]['agentLogout'](_0x4aa326)['then'](function(_0x30088b){_0x33d88a(null,_[_0xa784('0x45')](_0x30088b)?![]:!![]);})['catch'](function(_0x57fa95){logger[_0xa784('0x2c')](_0x57fa95);_0x33d88a(null,![]);});};AGIVertices[_0xa784('0x10')][_0xa784('0x52')]=function(_0x3bae51,_0x29f4d6){var _0x3ba0ee={'role':_0xa784('0x50')};_0x3ba0ee[_0x3bae51]=this[_0xa784('0xd')][_0xa784('0x3a')];var _0x4b386a=_0x3bae51!=_0xa784('0x53')?util[_0xa784('0x2a')](_0xa784('0x54'),_0xa784('0x55'),this[_0xa784('0xd')][_0xa784('0x3a')]):undefined;this[_0xa784('0xe')][_0xa784('0x52')](_0x3ba0ee,_0x4b386a)[_0xa784('0x13')](function(_0x4ac896){_0x29f4d6(null,_[_0xa784('0x45')](_0x4ac896)?![]:!![]);})[_0xa784('0x1b')](function(_0x5c45cf){logger[_0xa784('0x2c')](_0x5c45cf);_0x29f4d6(null,![]);});};AGIVertices['prototype'][_0xa784('0x56')]=function(_0x47718e,_0xc5cebc){sh[_0xa784('0x57')](_[_0xa784('0x58')](_0x47718e),function(_0x114f4b,_0x3f72aa){var _0x30962b=_0x3f72aa[_0xa784('0x59')](/(\r\n|\n|\r)/gm,'');_0xc5cebc(null,_0x30962b);});};AGIVertices[_0xa784('0x10')]['googleCloudTTS']=function(_0x4c4410,_0x5d0a2d){scripts[_0xa784('0x5a')](_0x4c4410[_0xa784('0x5b')],_0x4c4410['google_cloud_tts_text_type']||_0xa784('0x5c'),_0x4c4410[_0xa784('0x5c')],_0x4c4410['languageCode']||'en-US',_0x4c4410['ssmlGender']||_0xa784('0x5d'),_0x4c4410[_0xa784('0x5e')]||_0xa784('0x5f'))[_0xa784('0x13')](function(_0x41cefe){_0x5d0a2d(null,_0x41cefe);})['catch'](function(_0x23f030){_0x5d0a2d(_0x23f030);});};AGIVertices[_0xa784('0x10')][_0xa784('0x60')]=function(_0x276310,_0x3d32b6){scripts[_0xa784('0x60')](_0x276310['text'],_0x276310['google_tts_language']||'en',0x1)[_0xa784('0x13')](function(_0x1a065b){_0x3d32b6(null,_0x1a065b);})[_0xa784('0x1b')](function(_0x37d764){_0x3d32b6(_0x37d764);});};AGIVertices['prototype']['restAPI']=function(_0x4aa277,_0x129b78){var _0x2ada54={'uri':_0x4aa277[_0xa784('0x61')],'method':_0x4aa277[_0xa784('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4aa277[_0xa784('0x63')])===_0xa784('0x64')&&parseInt(_0x4aa277[_0xa784('0x63')])>=0x1?parseInt(_0x4aa277['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa784('0x65')]([_0xa784('0x66'),_0xa784('0x67')],_0x2ada54[_0xa784('0x62')][_0xa784('0x68')]())){try{_0x2ada54[_0xa784('0x69')]=_0x4aa277['rawBody']?JSON['parse'](_0x4aa277[_0xa784('0x9')]):{};}catch(_0x342fb1){logger[_0xa784('0x2c')](_0xa784('0x6a'),_0x342fb1);}}try{_0x2ada54['headers']=_0x4aa277[_0xa784('0x8')]?JSON[_0xa784('0x6b')](_0x4aa277[_0xa784('0x8')]):{};}catch(_0x20e199){logger[_0xa784('0x2c')](_0xa784('0x6c'),_0x20e199);}if(_0x4aa277['computedVariables']){try{var _0x1bcd24=require(_0x4aa277[_0xa784('0x6d')])[_0xa784('0x6e')](this,_0x2ada54);_0x2ada54[_0xa784('0x6f')]=Mustache[_0xa784('0x70')](_0x4aa277['url'],_0x1bcd24,{},['$$','$$']);if(_0x2ada54[_0xa784('0x71')]){_0x2ada54[_0xa784('0x71')]=JSON[_0xa784('0x6b')](Mustache[_0xa784('0x70')](JSON[_0xa784('0x72')](_0x2ada54[_0xa784('0x71')]),_0x1bcd24,{},['$$','$$']));}if(_0x2ada54[_0xa784('0x69')]){_0x2ada54[_0xa784('0x69')]=JSON['parse'](Mustache[_0xa784('0x70')](JSON[_0xa784('0x72')](_0x2ada54[_0xa784('0x69')]),_0x1bcd24,{},['$$','$$']));}}catch(_0x3a6e4f){logger[_0xa784('0x2c')](_0xa784('0x73'),_0x3a6e4f);}}rp(_0x2ada54)[_0xa784('0x13')](function(_0x453f88){var _0x4977e6={'statusCode':_0x453f88[_0xa784('0x74')]||0xc8,'statusMessage':_0x453f88[_0xa784('0x75')]||'OK','headers':_0x453f88[_0xa784('0x71')]||{},'body':_0x453f88[_0xa784('0x69')]||{}};_0x129b78(null,_0x4977e6);})[_0xa784('0x1b')](function(_0x10e221){var _0x248c37={'statusCode':_0x10e221[_0xa784('0x74')]||0x1f4,'statusMessage':_0x10e221[_0xa784('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x10e221['options']['headers']||{},'body':_0x10e221[_0xa784('0x77')][_0xa784('0x69')]||{}};_0x129b78(null,_0x248c37);});};AGIVertices[_0xa784('0x10')]['googleDialogflow']=function(_0x275144,_0x3ee0ce){scripts[_0xa784('0x78')](this['channel'][_0xa784('0x36')],_0x275144['key'],_0x275144[_0xa784('0x5c')],_0x275144[_0xa784('0x79')]||'en')['then'](function(_0x21c640){_0x3ee0ce(null,_0x21c640);})['catch'](function(_0x574b01){_0x3ee0ce(_0x574b01);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x1df7e3,_0x4a9c8c){scripts['googleDialogflowV2'](this[_0xa784('0xd')][_0xa784('0x36')],_0x1df7e3[_0xa784('0x7a')],_0x1df7e3[_0xa784('0x7b')],_0x1df7e3[_0xa784('0x7c')],_0x1df7e3['text'],_0x1df7e3[_0xa784('0x7d')]||'en')[_0xa784('0x13')](function(_0x4c0082){_0x4a9c8c(null,_0x4c0082);})[_0xa784('0x1b')](function(_0x30a565){_0x4a9c8c(_0x30a565);});};AGIVertices[_0xa784('0x10')][_0xa784('0x7e')]=function(_0xbcb504,_0x447f42){scripts[_0xa784('0x7e')](this[_0xa784('0xd')],_0xbcb504)[_0xa784('0x13')](function(_0x411a10){_0x447f42(null,_0x411a10);})[_0xa784('0x1b')](function(_0x13ae84){_0x447f42(_0x13ae84);});};AGIVertices['prototype'][_0xa784('0x7f')]=function(_0x46bb7e,_0x5ecac1){scripts[_0xa784('0x7f')](_0x46bb7e[_0xa784('0x80')],_0x46bb7e['text'],_0x46bb7e[_0xa784('0x81')]||_0xa784('0x82'),_0x46bb7e[_0xa784('0x83')])['then'](function(_0x1be091){_0x5ecac1(null,_0x1be091);})[_0xa784('0x1b')](function(_0x53e3cd){_0x5ecac1(_0x53e3cd);});};AGIVertices['prototype'][_0xa784('0x84')]=function(_0x10435f,_0x49933f,_0x411709){scripts[_0xa784('0x84')](_0x49933f,_0x10435f['key'],_0x10435f['ispeech_asr_language']||'en-US',this[_0xa784('0x85')](_0x10435f[_0xa784('0x86')])?_0x10435f[_0xa784('0x86')]:undefined)[_0xa784('0x13')](function(_0x932421){_0x411709(null,_0x932421);})[_0xa784('0x1b')](function(_0x17a5bd){_0x411709(_0x17a5bd);});};AGIVertices[_0xa784('0x10')][_0xa784('0x87')]=function(_0x249f33,_0xbd9b1){scripts[_0xa784('0x87')](_0x249f33['aws_access_key_id'],_0x249f33[_0xa784('0x88')],_0x249f33[_0xa784('0x89')],_0x249f33[_0xa784('0x8a')]||_0xa784('0x8b'),_0x249f33[_0xa784('0x5c')],_0x249f33['aws_text_type']||_0xa784('0x5c'))[_0xa784('0x13')](function(_0x40f701){_0xbd9b1(null,_0x40f701);})[_0xa784('0x1b')](function(_0x5b0095){_0xbd9b1(_0x5b0095);});};AGIVertices['prototype'][_0xa784('0x8c')]=function(_0x19e9df,_0x344ec0){scripts['awsLex'](this[_0xa784('0xd')][_0xa784('0x36')],_0x19e9df[_0xa784('0x8d')],_0x19e9df['aws_secret_access_key'],_0x19e9df[_0xa784('0x8e')],_0x19e9df[_0xa784('0x5c')],_0x19e9df[_0xa784('0x8f')])[_0xa784('0x13')](function(_0x52ab8f){_0x344ec0(null,_0x52ab8f);})['catch'](function(_0x3a3a94){_0x344ec0(_0x3a3a94);});};AGIVertices['prototype']['googleASR']=function(_0x52a81f,_0x2e053d,_0x249651){scripts[_0xa784('0x90')](_0x2e053d,_0x52a81f[_0xa784('0x80')],_0x52a81f['google_asr_language']||_0xa784('0x82'))[_0xa784('0x13')](function(_0x21b2b1){_0x249651(null,_0x21b2b1);})[_0xa784('0x1b')](function(_0x2b8ad0){_0x249651(_0x2b8ad0);});};AGIVertices[_0xa784('0x10')]['tildeASR']=function(_0x415c9d,_0x551ffb,_0x1cc91c){scripts[_0xa784('0x91')](_0x551ffb,_0x415c9d[_0xa784('0x92')],_0x415c9d['appsecret'],_0x415c9d[_0xa784('0x6f')])[_0xa784('0x13')](function(_0x255794){_0x1cc91c(null,_0x255794);})[_0xa784('0x1b')](function(_0x1d15ec){_0x1cc91c(_0x1d15ec);});};AGIVertices['prototype'][_0xa784('0x93')]=function(_0x313af7){var _0xe02350=_[_0xa784('0x65')](verticesWithRetry,_0x313af7[_0xa784('0x38')])?_0x313af7:_['clone'](_0x313af7);for(var _0x533405 in _0xe02350){if(_0xe02350[_0xa784('0x94')](_0x533405)){if(_0xe02350[_0x533405]&&_[_0xa784('0x95')](_0xe02350[_0x533405])){if(_[_0xa784('0x65')](recursiveMapAttributes,_0x533405)){_0xe02350[_0x533405]=this[_0xa784('0x96')](_0xe02350[_0x533405]);}else{_0xe02350[_0x533405]=this[_0xa784('0x97')](_0xe02350[_0x533405]);}}}}return _0xe02350;};AGIVertices[_0xa784('0x10')]['recursiveNodeIndex']=function(_0x5aefd6){for(var _0x14df24 in _0x5aefd6){if(_0x5aefd6[_0xa784('0x94')](_0x14df24)){if(_[_0xa784('0x98')](_0x5aefd6[_0x14df24])){this[_0xa784('0x99')](_0x5aefd6[_0x14df24]);}else if(_[_0xa784('0x9a')](_0x5aefd6[_0x14df24])){for(var _0x52de39=0x0;_0x52de39<_0x5aefd6[_0x14df24]['length'];_0x52de39++){this[_0xa784('0x99')](_0x5aefd6[_0x14df24][_0x52de39]);}}else if(_['isString'](_0x5aefd6[_0x14df24])){_0x5aefd6[_0x14df24]=this['replaceAllVariables'](_0x5aefd6[_0x14df24]);}}}};AGIVertices[_0xa784('0x10')][_0xa784('0x9b')]=function(_0x4b1a54,_0xfc6ddd){for(var _0x63d95c in _0x4b1a54){if(_0x4b1a54['hasOwnProperty'](_0x63d95c)){if(_[_0xa784('0x98')](_0x4b1a54[_0x63d95c])){if(!_[_0xa784('0x44')](_0x4b1a54[_0x63d95c])){this[_0xa784('0x9b')](_0x4b1a54[_0x63d95c],util[_0xa784('0x2a')]('%s.%s',_0xfc6ddd,_0x63d95c));}}else if(_['isArray'](_0x4b1a54[_0x63d95c])){for(var _0x16da03=0x0;_0x16da03<_0x4b1a54[_0x63d95c][_0xa784('0x9c')];_0x16da03++){this['saveRestApiResult'](_0x4b1a54[_0x63d95c][_0x16da03],util[_0xa784('0x2a')]('%s.%s',_0xfc6ddd,_0x63d95c+'['+_0x16da03+']'));}}else{if(!_[_0xa784('0x45')](_0x4b1a54[_0x63d95c])){this[_0xa784('0xd')][_0xa784('0x9d')](util[_0xa784('0x2a')](_0xa784('0x9e'),_0xfc6ddd,_0x63d95c),_0x4b1a54[_0x63d95c]);}}}}};AGIVertices[_0xa784('0x10')][_0xa784('0x96')]=function(_0x588030){try{var _0x526a86=JSON[_0xa784('0x6b')](_0x588030);this[_0xa784('0x99')](_0x526a86);return JSON[_0xa784('0x72')](_0x526a86);}catch(_0x2a31c9){return this['replaceAllVariables'](_0x588030);}};AGIVertices[_0xa784('0x10')]['replaceAllVariables']=function(_0x223974){var _0x121aaf=_0x223974[_0xa784('0x9f')]('{');for(var _0x9acd88=0x1;_0x9acd88<_0x121aaf[_0xa784('0x9c')];_0x9acd88+=0x1){var _0x1926eb=_0x121aaf[_0x9acd88][_0xa784('0x9f')]('}');if(_0x1926eb[_0xa784('0x9c')]>0x1){_0x223974=_0x223974[_0xa784('0xa0')]('{'+_0x1926eb[0x0]+'}',this['channel'][_0xa784('0x11')](_0x1926eb[0x0])[_0xa784('0xa1')]||_0x1926eb[0x0]);}}if(_0x121aaf['length']===0x1){return _0x223974['toString']();}return this[_0xa784('0x97')](_0x223974);};AGIVertices['prototype'][_0xa784('0xa2')]=function(_0x1792b7,_0x113361){var _0x5a633e=this[_0xa784('0xd')][_0xa784('0x11')](_0x1792b7);if(_0x5a633e[_0xa784('0xa3')]===-0x1){return _0x5a633e;}logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x113361,_0x5a633e[_0xa784('0xa1')]));return this[_0xa784('0xd')][_0xa784('0x9d')](_0x113361,_0x5a633e[_0xa784('0xa1')]);};AGIVertices[_0xa784('0x10')]['isConfigured']=function(_0x259453){return _0x259453&&_0x259453!=='0'&&_0x259453!=='-1'&&_0x259453!=='';};AGIVertices[_0xa784('0x10')][_0xa784('0xa4')]=function(_0x5e74c9){this['createSquareDetailsReport']['sync'](this,_0x5e74c9,'-');_0x5e74c9[_0xa784('0xa5')]=_0x5e74c9['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xa784('0xa6')]=function(_0x1fe56a){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0xa7'),_0x1fe56a[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x1fe56a[_0xa784('0x5c')])){return this['channel']['noop'](_0xa784('0xa8'));}var _0xded129='\x22'+_0x1fe56a[_0xa784('0x5c')]+'\x22';if(this[_0xa784('0x85')](_0x1fe56a['options'])){_0xded129+=','+_0x1fe56a['options'];}var _0x274e80=this['channel'][_0xa784('0x57')](_0xa784('0xa9'),_0xded129);if(_0x274e80[_0xa784('0xa3')]===-0x1){return _0x274e80;}return this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')](_0xa784('0xaa'),_0xded129));};AGIVertices[_0xa784('0x10')][_0xa784('0xab')]=function(_0x433979){logger['info'](util[_0xa784('0x2a')](_0xa784('0xac'),_0x433979[_0xa784('0x37')]));if(!this['isConfigured'](_0x433979['grammar'])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xae'));}var _0x1a13fd=_0x433979[_0xa784('0xaf')];if(this[_0xa784('0x85')](_0x433979[_0xa784('0x77')])){_0x1a13fd+=','+_0x433979['options'];}var _0x272d3d=this[_0xa784('0xd')][_0xa784('0x57')](_0xa784('0xb0'),_0x1a13fd);if(_0x272d3d[_0xa784('0xa3')]===-0x1){return _0x272d3d;}var _0xe329d=this[_0xa784('0xa2')](_0xa784('0xb1'),'MRCP_RECOG_CONFIDENCE');if(_0xe329d[_0xa784('0xa3')]===-0x1){return _0xe329d;}var _0x3e308b=this[_0xa784('0xa2')](_0xa784('0xb2'),_0xa784('0xb3'));if(_0x3e308b['result']===-0x1){return _0x3e308b;}var _0xb53824=this[_0xa784('0xa2')](_0xa784('0xb4'),_0xa784('0xb5'));if(_0xb53824[_0xa784('0xa3')]===-0x1){return _0xb53824;}return this[_0xa784('0xd')][_0xa784('0xad')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x1a13fd));};AGIVertices[_0xa784('0x10')][_0xa784('0xb6')]=function(_0x310e20){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0xb7'),_0x310e20[_0xa784('0x37')]));return this['channel'][_0xa784('0xb6')]([_0x310e20[_0xa784('0xb8')],_0x310e20['args']]);};AGIVertices[_0xa784('0x10')][_0xa784('0xb9')]=function(_0x4b2594){logger['info'](util[_0xa784('0x2a')](_0xa784('0xba'),_0x4b2594[_0xa784('0x37')]));if(this[_0xa784('0x85')](_0x4b2594[_0xa784('0x63')])){logger['info'](util[_0xa784('0x2a')](_0xa784('0xbb'),_0x4b2594[_0xa784('0x63')]));var _0xcb8004=this[_0xa784('0xd')]['wait'](_0x4b2594[_0xa784('0x63')]);if(_0xcb8004[_0xa784('0xa3')]===-0x1){return _0xcb8004;}}return this['channel'][_0xa784('0xb9')]();};AGIVertices[_0xa784('0x10')][_0xa784('0x4a')]=function(_0x3ff437){logger['info'](util['format'](_0xa784('0xbc'),_0x3ff437['label']));if(!this[_0xa784('0x85')](_0x3ff437['list_id'])){return this['channel'][_0xa784('0x2c')](_0x3ff437,_0xa784('0xbd'));}_0x3ff437[_0xa784('0x49')]=moment();if(this[_0xa784('0x85')](_0x3ff437[_0xa784('0xbe')])){_0x3ff437[_0xa784('0x49')]=moment()[_0xa784('0xbf')](_0x3ff437['delay'],'minutes');}if(!this[_0xa784('0x85')](_0x3ff437['callback_priority'])){_0x3ff437[_0xa784('0x4c')]=0x2;}this[_0xa784('0x43')][_0xa784('0x6e')](this,_0x3ff437);return this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3ff437[_0xa784('0xc0')],_0x3ff437[_0xa784('0xc1')],_0x3ff437[_0xa784('0x49')]));};AGIVertices[_0xa784('0x10')][_0xa784('0xc2')]=function(_0x3ae461){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3ae461['label']));var _0x11eb43=this[_0xa784('0xd')][_0xa784('0x57')](_0x3ae461[_0xa784('0xc3')],_0x3ae461[_0xa784('0x77')]);if(_0x11eb43[_0xa784('0xa3')]===-0x1){return _0x11eb43;}return this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xc4'),_0x3ae461[_0xa784('0xc3')],_0x3ae461[_0xa784('0x77')]));};AGIVertices['prototype'][_0xa784('0xc5')]=function(_0x3dae3e){logger['info'](util[_0xa784('0x2a')](_0xa784('0xc6'),_0x3dae3e[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x3dae3e[_0xa784('0x5c')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x5314bb='\x22'+_0x3dae3e['text']+'\x22';if(this['isConfigured'](_0x3dae3e['options'])){_0x5314bb+=','+_0x3dae3e['options'];}var _0x43d908=this['channel'][_0xa784('0x57')](_0xa784('0xa9'),_0x5314bb);if(_0x43d908[_0xa784('0xa3')]===-0x1){return _0x43d908;}return this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5314bb));};AGIVertices[_0xa784('0x10')][_0xa784('0xc7')]=function(_0x44bc50){logger[_0xa784('0x2e')](util['format'](_0xa784('0xc8'),_0x44bc50[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x44bc50[_0xa784('0x5c')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xa8'));}var _0x1216f7='\x22'+_0x44bc50[_0xa784('0x5c')]+'\x22';if(this[_0xa784('0x85')](_0x44bc50[_0xa784('0x77')])){_0x1216f7+=','+_0x44bc50[_0xa784('0x77')];}var _0x5be86b=this[_0xa784('0xd')]['exec']('MRCPSynth',_0x1216f7);if(_0x5be86b[_0xa784('0xa3')]===-0x1){return _0x5be86b;}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xaa'),_0x1216f7));};AGIVertices[_0xa784('0x10')][_0xa784('0xc9')]=function(_0x4e3127){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0xca'),_0x4e3127[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x4e3127[_0xa784('0xaf')])){return this['channel'][_0xa784('0xad')](_0xa784('0xae'));}var _0x132ebb=_0x4e3127[_0xa784('0xaf')];if(this[_0xa784('0x85')](_0x4e3127['options'])){_0x132ebb+=','+_0x4e3127[_0xa784('0x77')];}var _0x490547=this[_0xa784('0xd')][_0xa784('0x57')](_0xa784('0xb0'),_0x132ebb);if(_0x490547[_0xa784('0xa3')]===-0x1){return _0x490547;}var _0x31294d=this[_0xa784('0xa2')](_0xa784('0xb1'),_0xa784('0xcb'));if(_0x31294d[_0xa784('0xa3')]===-0x1){return _0x31294d;}var _0x288981=this[_0xa784('0xa2')](_0xa784('0xb2'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x288981[_0xa784('0xa3')]===-0x1){return _0x288981;}var _0x4238a7=this[_0xa784('0xa2')](_0xa784('0xb4'),_0xa784('0xcc'));if(_0x4238a7['result']===-0x1){return _0x4238a7;}return this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xcd'),_0x132ebb));};AGIVertices[_0xa784('0x10')][_0xa784('0xce')]=function(_0x43fc6c){logger['info'](util[_0xa784('0x2a')](_0xa784('0xcf'),_0x43fc6c[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x43fc6c[_0xa784('0xaf')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xae'));}var _0x2e909a=_0x43fc6c[_0xa784('0xaf')];if(this['isConfigured'](_0x43fc6c['options'])){_0x2e909a+=','+_0x43fc6c[_0xa784('0x77')];}var _0x201f58=this[_0xa784('0xd')][_0xa784('0x57')]('MRCPRecog',_0x2e909a);if(_0x201f58['result']===-0x1){return _0x201f58;}var _0x249d68=this[_0xa784('0xa2')](_0xa784('0xb1'),_0xa784('0xd0'));if(_0x249d68['result']===-0x1){return _0x249d68;}var _0x380b73=this[_0xa784('0xa2')](_0xa784('0xb2'),'SESTEK_ASR_TRANSCRIPT');if(_0x380b73[_0xa784('0xa3')]===-0x1){return _0x380b73;}var _0x84a8cf=this['getAndSetVariable'](_0xa784('0xb4'),_0xa784('0xd1'));if(_0x84a8cf[_0xa784('0xa3')]===-0x1){return _0x84a8cf;}return this[_0xa784('0xd')][_0xa784('0xad')](util['format'](_0xa784('0xcd'),_0x2e909a));};AGIVertices['prototype'][_0xa784('0xd2')]=function(_0x3deb7e){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3deb7e['label']));if(!this[_0xa784('0x85')](_0x3deb7e['odbc_id'])){return this[_0xa784('0xd')]['error'](_0x3deb7e,'no\x20database\x20selected');}var _0x31479f=this[_0xa784('0x19')]['sync'](this,_0x3deb7e[_0xa784('0xd3')]);if(!_0x31479f){return this[_0xa784('0xd')]['error'](_0x3deb7e,'no\x20odbc\x20database\x20found');}if(!this[_0xa784('0x85')](_0x3deb7e[_0xa784('0x30')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3deb7e,_0xa784('0xd4'));}var _0x18eec8=_0x3deb7e['query'][_0xa784('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')]('query:\x20%s',_0x18eec8));var _0x38e882=this[_0xa784('0xd5')]['sync'](this,_0x31479f,_0x18eec8);this[_0xa784('0xd6')]['sync'](this,_0x3deb7e,_0x18eec8);if(!this[_0xa784('0x85')](_0x3deb7e[_0xa784('0xd7')])){return this['channel'][_0xa784('0xad')](_0xa784('0xd8'));}var _0x4c2fbd=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x3deb7e[_0xa784('0xd7')]);if(!_0x4c2fbd){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3deb7e,'no\x20variable\x20found');}var _0x2b337a=this;_0x38e882['forEach'](function(_0x131268,_0x295197){Object['keys'](_0x131268)['forEach'](function(_0x178dfa){_0x2b337a['channel'][_0xa784('0x9d')](util[_0xa784('0x2a')]('%s[%s][%s]',_0x4c2fbd,_0x295197,_0x178dfa),_0x131268[_0x178dfa]);});});this['channel']['setVariable'](util[_0xa784('0x2a')](_0xa784('0xd9'),_0x4c2fbd),_0x38e882[_0xa784('0x9c')]);return this[_0xa784('0xd')][_0xa784('0xad')](util['format'](_0xa784('0xda'),_0x4c2fbd));};AGIVertices[_0xa784('0x10')][_0xa784('0xdb')]=function(_0x2bc86e){logger['debug'](util[_0xa784('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2bc86e['label']));if(!this[_0xa784('0x85')](_0x2bc86e[_0xa784('0xdc')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x2bc86e,_0xa784('0xdd'));}var _0x459a17=this[_0xa784('0xde')][_0xa784('0x6e')](this,_0x2bc86e['sip_id']);if(!_0x459a17){return this[_0xa784('0xd')]['error'](_0x2bc86e,_0xa784('0xdf'));}var _0x39caa6=this[_0xa784('0xd')][_0xa784('0x57')](_0xa784('0xe0'),[util[_0xa784('0x2a')]('SIP/%s',_0x459a17),_0x2bc86e[_0xa784('0x63')],_0x2bc86e[_0xa784('0xe1')],_0x2bc86e[_0xa784('0x61')]]);if(_0x39caa6[_0xa784('0xa3')]===-0x1){return _0x39caa6;}return this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')]('Executed\x20command\x20%s',_0xa784('0xe0')));};AGIVertices['prototype']['dialogflow']=function(_0x4c0168){logger['info'](util[_0xa784('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4c0168[_0xa784('0x37')]));if(!this['isConfigured'](_0x4c0168[_0xa784('0x80')])){return this[_0xa784('0xd')]['noop'](_0xa784('0xe2'));}if(!this[_0xa784('0x85')](_0x4c0168[_0xa784('0x5c')])){return this['channel'][_0xa784('0xad')](_0xa784('0xa8'));}this[_0xa784('0xd')][_0xa784('0xe3')]=!![];this['createSquareDetailsReport'](_0x4c0168);this['createSquareMessage'](_0x4c0168[_0xa784('0x5c')],'in','','');this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x4c0168[_0xa784('0x5c')]));var _0x288ffe=this['googleDialogflow'][_0xa784('0x6e')](this,_0x4c0168);if(_0x288ffe){for(var _0x584ebf in _0x288ffe){if(_0x288ffe['hasOwnProperty'](_0x584ebf)){this[_0xa784('0xd')][_0xa784('0x9d')](util[_0xa784('0x2a')](_0xa784('0xe4'),_0x584ebf[_0xa784('0x68')]()),_0x288ffe[_0x584ebf]);}}this[_0xa784('0x42')](_0x288ffe['speech'],_0xa784('0xe5'),_0xa784('0xe6'),'');return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xe7'),_0x288ffe[_0xa784('0xe8')]));}return this[_0xa784('0xd')][_0xa784('0x2c')](_0x4c0168,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xa784('0x10')]['dialogflowV2']=function(_0x719369){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0xe9'),_0x719369[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x719369['dialogflowV2_project_id'])){return this[_0xa784('0xd')]['noop'](_0xa784('0xea'));}if(!this[_0xa784('0x85')](_0x719369['client_email'])){return this[_0xa784('0xd')][_0xa784('0xad')]('no\x20client_email\x20configured');}if(!this[_0xa784('0x85')](_0x719369[_0xa784('0x7c')])){return this['channel'][_0xa784('0xad')](_0xa784('0xeb'));}if(!this['isConfigured'](_0x719369['dialogflowV2_language'])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xec'));}if(!this['isConfigured'](_0x719369[_0xa784('0x5c')])){return this['channel'][_0xa784('0xad')](_0xa784('0xa8'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x719369);this[_0xa784('0x42')](_0x719369[_0xa784('0x5c')],'in','','');this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')]('Trying\x20DialogflowV2:\x20%s',_0x719369['text']));var _0x2af80f=this['googleDialogflowV2'][_0xa784('0x6e')](this,_0x719369);if(_0x2af80f){for(var _0x543114 in _0x2af80f){if(_0x2af80f[_0xa784('0x94')](_0x543114)){if(_0x543114!=='providerResponse'){this[_0xa784('0xd')][_0xa784('0x9d')](util[_0xa784('0x2a')](_0xa784('0xe4'),_0x543114[_0xa784('0x68')]()),_0x2af80f[_0x543114]);}}}this[_0xa784('0x42')](_0x2af80f['speech'],_0xa784('0xe5'),'dialogflowV2',_0x2af80f[_0xa784('0xed')]);return this['channel'][_0xa784('0xad')](util['format'](_0xa784('0xee'),_0x2af80f[_0xa784('0xe8')]));}return this['channel'][_0xa784('0x2c')](_0x719369,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xa784('0x10')][_0xa784('0xef')]=function(_0x3fa459){logger[_0xa784('0x2e')](util['format'](_0xa784('0xf0'),_0x3fa459[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x3fa459[_0xa784('0xf1')])){return this[_0xa784('0xd')][_0xa784('0xad')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x3fa459['username'])){return this[_0xa784('0xd')][_0xa784('0xad')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x3fa459[_0xa784('0xf2')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xf3'));}if(!this['isConfigured'](_0x3fa459[_0xa784('0xf4')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xa8'));}this[_0xa784('0xd')]['bot']=!![];this[_0xa784('0xd6')](_0x3fa459);this[_0xa784('0x42')](_0x3fa459[_0xa784('0x5c')],'in','','');this['channel']['noop'](util[_0xa784('0x2a')](_0xa784('0xf5'),_0x3fa459[_0xa784('0x5c')]));var _0x1fc324=this[_0xa784('0x7e')][_0xa784('0x6e')](this,_0x3fa459);if(_0x1fc324){for(var _0x2010a7 in _0x1fc324){if(_0x1fc324['hasOwnProperty'](_0x2010a7)){this[_0xa784('0xd')][_0xa784('0x9d')](util[_0xa784('0x2a')](_0xa784('0xf6'),_0x2010a7[_0xa784('0x68')]()),_0x1fc324[_0x2010a7]);}}this['createSquareMessage'](_0x1fc324[_0xa784('0xe8')],_0xa784('0xe5'),_0xa784('0xef'),'');if(_0x1fc324[_0xa784('0xf7')]){this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')](_0xa784('0xf8'),_0x1fc324[_0xa784('0xf7')]));var _0xeea2e1=this['channel'][_0xa784('0xf9')](_0x1fc324['audiofile']);try{fs[_0xa784('0xfa')](_0x1fc324[_0xa784('0xf7')]+'.wav');}catch(_0x110842){logger['error'](_0x110842);}return _0xeea2e1;}else{return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xfb'),_0x1fc324[_0xa784('0xe8')]));}}return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3fa459,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xa784('0x10')][_0xa784('0xfc')]=function(_0x102cea){logger[_0xa784('0x2e')](util['format'](_0xa784('0xfd'),_0x102cea['label']));return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xfc'));};AGIVertices[_0xa784('0x10')][_0xa784('0xfe')]=function(_0x595b8c){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x595b8c['label']));var _0x44a37d='';if(_0x595b8c[_0xa784('0xff')]){if(!this['isConfigured'](_0x595b8c[_0xa784('0xff')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x595b8c,_0xa784('0x100'));}else{var _0x21f535=parseInt(_0x595b8c[_0xa784('0xff')],0xa);if(isNaN(_0x21f535)){_0x44a37d=_0x595b8c[_0xa784('0xff')];}else{_0x44a37d=this[_0xa784('0x1c')][_0xa784('0x6e')](this,_0x595b8c[_0xa784('0xff')]);if(!_0x44a37d){return this['channel'][_0xa784('0x2c')](_0x595b8c,_0xa784('0x101'));}}}}else if(_0x595b8c['trunk_name']){_0x44a37d=_0x595b8c['trunk_name'];}else{return this['channel'][_0xa784('0x2c')](_0x595b8c,_0xa784('0x100'));}var _0x27fb68=this[_0xa784('0xd')]['exec']('DIAL',[util['format'](_0xa784('0x102'),_0x44a37d,_0x595b8c[_0xa784('0xc0')]),_0x595b8c[_0xa784('0x63')],_0x595b8c[_0xa784('0xe1')],_0x595b8c['url']]);if(_0x27fb68['result']===-0x1){return _0x27fb68;}return this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')](_0xa784('0x103'),_0xa784('0xe0')));};AGIVertices[_0xa784('0x10')][_0xa784('0x104')]=function(_0x213cc7){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x105'),_0x213cc7['label']));return this[_0xa784('0xd')]['noop'](_0xa784('0x104'));};AGIVertices['prototype'][_0xa784('0xb')]=function(_0x3ebe44){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x106'),_0x3ebe44[_0xa784('0x37')]));if(_0x3ebe44['retry']===0x0){return this[_0xa784('0xa4')](_0x3ebe44);}_0x3ebe44['retry']-=0x1;if(!this[_0xa784('0x85')](_0x3ebe44[_0xa784('0x107')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3ebe44,_0xa784('0x108'));}var _0x2043d9=this['getSound'][_0xa784('0x6e')](this,_0x3ebe44[_0xa784('0x107')]);if(!_0x2043d9){return this['channel'][_0xa784('0x2c')](_0x3ebe44,_0xa784('0x109'));}if(!this[_0xa784('0x85')](_0x3ebe44[_0xa784('0xd7')])){return this[_0xa784('0xd')]['error'](_0xa784('0xd8'));}var _0x37ddb0=this['channel']['getData'](_0x2043d9,_0x3ebe44[_0xa784('0x10a')],_0x3ebe44[_0xa784('0x10b')]);var _0x3ece0f=_0x37ddb0[_0xa784('0xa3')]?_0x37ddb0[_0xa784('0xa3')][_0xa784('0x10c')]():'';logger[_0xa784('0x2e')](_0xa784('0x10d'),JSON[_0xa784('0x72')](_0x37ddb0));if(_0x37ddb0[_0xa784('0xa3')]===-0x1){this[_0xa784('0xd6')][_0xa784('0x6e')](this,_0x3ebe44,_0x3ece0f);return _0x37ddb0;}else if(_0x37ddb0[_0xa784('0xa1')]===_0xa784('0x63')){_0x37ddb0[_0xa784('0xa3')]=_0x3ece0f[_0xa784('0x9c')]>=parseInt(_0x3ebe44[_0xa784('0x10e')])?'x':'i';}else{_0x37ddb0[_0xa784('0xa3')]=_0x3ece0f[_0xa784('0x9c')]>=parseInt(_0x3ebe44['mindigit'])&&_0x3ece0f['length']<=parseInt(_0x3ebe44[_0xa784('0x10b')])?'x':'i';}var _0x24072b=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x3ebe44[_0xa784('0xd7')]);if(!_0x24072b){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3ebe44,_0xa784('0x10f'));}this[_0xa784('0xd')][_0xa784('0x9d')](_0x24072b,_0x3ece0f);if(this[_0xa784('0x85')](_0x3ebe44[_0xa784('0x110')])){var _0x190482=parseInt(_0x3ebe44[_0xa784('0x110')],0xa);var _0x2f477f=rs[_0xa784('0x111')]({'charset':'*','length':_0x190482});var _0xe343ec=_0x3ece0f[_0xa784('0x9c')];if(_0xe343ec>0x0){if(_0xe343ec>_0x190482){this['createSquareDetailsReport'][_0xa784('0x6e')](this,_0x3ebe44,_0x3ebe44['hiddendigitspos']==='first'?_0x2f477f+_0x3ece0f[_0xa784('0x112')](_0x190482):_0x3ece0f[_0xa784('0x112')](0x0,_0xe343ec-_0x190482)+_0x2f477f);}else{this[_0xa784('0xd6')]['sync'](this,_0x3ebe44,rs['generate']({'charset':'*','length':_0xe343ec}));}}else{this[_0xa784('0xd6')][_0xa784('0x6e')](this,_0x3ebe44,'');}}else{this[_0xa784('0xd6')][_0xa784('0x6e')](this,_0x3ebe44,_0x3ece0f);}return _0x37ddb0;};AGIVertices[_0xa784('0x10')][_0xa784('0xc')]=function(_0x8de82f){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x113'),_0x8de82f[_0xa784('0x37')]));return this[_0xa784('0xb')](_0x8de82f);};AGIVertices[_0xa784('0x10')][_0xa784('0x114')]=function(_0xe72081){logger['info'](util[_0xa784('0x2a')](_0xa784('0x115'),_0xe72081[_0xa784('0x37')]));this[_0xa784('0xd6')]['sync'](this,_0xe72081,_0xe72081[_0xa784('0x116')]);return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')]('GOAL\x20%s',_0xe72081[_0xa784('0x116')]));};AGIVertices[_0xa784('0x10')][_0xa784('0x117')]=function(_0x47e069){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x118'),_0x47e069['label']));if(!this['isConfigured'](_0x47e069[_0xa784('0x8d')])||!this[_0xa784('0x85')](_0x47e069[_0xa784('0x88')])){return this[_0xa784('0xd')]['noop'](_0xa784('0x119'));}if(!this[_0xa784('0x85')](_0x47e069[_0xa784('0x5c')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xa8'));}this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')]('Trying\x20aws\x20Polly\x20%s',_0x47e069[_0xa784('0x5c')]));var _0x241efd=this[_0xa784('0x87')][_0xa784('0x6e')](this,_0x47e069);if(_0x241efd){this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x11a'),_0x241efd));var _0x570b7b=this[_0xa784('0xd')]['streamFile'](_0x241efd);try{fs[_0xa784('0xfa')](_0x241efd+_0xa784('0x11b'));}catch(_0x42b168){logger['error'](_0x42b168);}return _0x570b7b;}return this['channel'][_0xa784('0x2c')](_0x47e069,_0xa784('0x11c'));};AGIVertices['prototype'][_0xa784('0x11d')]=function(_0x2e0127){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x11e'),_0x2e0127['label']));if(!this[_0xa784('0x85')](_0x2e0127[_0xa784('0x8d')])||!this[_0xa784('0x85')](_0x2e0127[_0xa784('0x88')])){return this['channel'][_0xa784('0xad')](_0xa784('0x119'));}if(!this['isConfigured'](_0x2e0127[_0xa784('0x8f')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0x11f'));}if(!this[_0xa784('0x85')](_0x2e0127['text'])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xa8'));}this['channel']['bot']=!![];this[_0xa784('0xd6')](_0x2e0127);this[_0xa784('0x42')](_0x2e0127[_0xa784('0x5c')],'in','','');this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x120'),_0x2e0127[_0xa784('0x5c')]));var _0x1e2a44=this['awsLex'][_0xa784('0x6e')](this,_0x2e0127);if(_0x1e2a44){for(var _0x3e273d in _0x1e2a44){if(_0x1e2a44[_0xa784('0x94')](_0x3e273d)&&_[_0xa784('0x95')](_0x1e2a44[_0x3e273d])){this['channel'][_0xa784('0x9d')](util[_0xa784('0x2a')](_0xa784('0x121'),_0x3e273d[_0xa784('0x68')]()),_0x1e2a44[_0x3e273d]);}}if(_['isNil'](_0x1e2a44[_0xa784('0x76')])){return this['channel'][_0xa784('0xad')](_0xa784('0x122'));}else{this[_0xa784('0x42')](_0x1e2a44[_0xa784('0x76')],'out',_0xa784('0x123'),'');return this['channel']['noop'](util['format'](_0xa784('0x124'),_0x1e2a44[_0xa784('0x76')]));}}return this['channel']['error'](_0x2e0127,_0xa784('0x125'));};AGIVertices[_0xa784('0x10')]['googleasr']=function(_0x5d18de){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x126'),_0x5d18de[_0xa784('0x37')],_0x5d18de[_0xa784('0x63')]));if(!this[_0xa784('0x85')](_0x5d18de[_0xa784('0x80')])){return this[_0xa784('0xd')]['noop'](_0xa784('0xe2'));}var _0x1e8fe9=_0xa784('0x127');var _0x56ff13=util['format'](_0xa784('0x128'),FILES_PATH,rs[_0xa784('0x111')](0x4));var _0x5a3b90=util[_0xa784('0x2a')](_0xa784('0x9e'),_0x56ff13,_0x1e8fe9);var _0x2b5e33=!![];if(_0x5d18de['beep']===_0xa784('0x129')){_0x2b5e33=![];}var _0x5181d0=this['channel'][_0xa784('0x12a')](_0x56ff13,_0x1e8fe9,_0x5d18de['intKey'],_0x5d18de[_0xa784('0x63')],undefined,_0x2b5e33);if(_0x5181d0[_0xa784('0xa3')]!==-0x1){this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')](_0xa784('0x12b'),_0x5a3b90));var _0x1a24a2=this[_0xa784('0x90')][_0xa784('0x6e')](this,_0x5d18de,_0x5a3b90);if(_0x1a24a2){for(var _0xde2106 in _0x1a24a2){if(_0x1a24a2[_0xa784('0x94')](_0xde2106)){this[_0xa784('0xd')]['setVariable'](util[_0xa784('0x2a')]('GOOGLE_ASR_%s',_0xde2106[_0xa784('0x68')]()),_0x1a24a2[_0xde2106]);}}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x12c'),JSON[_0xa784('0x72')](_0x1a24a2)));}}return _0x5181d0;};AGIVertices[_0xa784('0x10')][_0xa784('0x12d')]=function(_0x3388d3){logger[_0xa784('0x2e')](util['format'](_0xa784('0x12e'),_0x3388d3[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x3388d3[_0xa784('0x92')])){return this[_0xa784('0xd')]['noop'](_0xa784('0x12f'));}if(!this[_0xa784('0x85')](_0x3388d3[_0xa784('0x130')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x503d6f=_0xa784('0x127');var _0x300215=util[_0xa784('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xa784('0x111')](0x4));var _0x25db71=util[_0xa784('0x2a')]('%s.%s',_0x300215,_0x503d6f);var _0x356835=!![];if(_0x3388d3[_0xa784('0x131')]==='NOBEEP'){_0x356835=![];}var _0x18323d=this['channel'][_0xa784('0x12a')](_0x300215,_0x503d6f,_0x3388d3[_0xa784('0x132')],_0x3388d3[_0xa784('0x63')],undefined,_0x356835);if(_0x18323d[_0xa784('0xa3')]!==-0x1){this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')]('tilde\x20%s\x20file\x20created',_0x25db71));var _0x5d6fcf=this['tildeASR'][_0xa784('0x6e')](this,_0x3388d3,_0x25db71);if(_0x5d6fcf){for(var _0x3dd4f9 in _0x5d6fcf){if(_0x5d6fcf[_0xa784('0x94')](_0x3dd4f9)){this[_0xa784('0xd')]['setVariable'](util[_0xa784('0x2a')](_0xa784('0x133'),_0x3dd4f9[_0xa784('0x68')]()),_0x5d6fcf[_0x3dd4f9]);}}return this['channel'][_0xa784('0xad')](util['format'](_0xa784('0x134'),JSON[_0xa784('0x72')](_0x5d6fcf)));}}return _0x18323d;};AGIVertices['prototype']['gotoc']=function(_0x120698){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x120698[_0xa784('0x37')]));return this[_0xa784('0xd')][_0xa784('0x135')](_0x120698['context'],_0x120698[_0xa784('0x3d')],_0x120698[_0xa784('0x3e')]);};AGIVertices[_0xa784('0x10')][_0xa784('0x136')]=function(_0x143ed4){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x143ed4[_0xa784('0x37')]));if(!this['isConfigured'](_0x143ed4[_0xa784('0x137')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x143ed4,_0xa784('0x138'));}try{var _0x22ce07=eval(_0x143ed4[_0xa784('0x137')])?_0xa784('0x139'):_0xa784('0x13a');this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x13b'),_0x143ed4[_0xa784('0x137')],_0x22ce07));return{'code':0xc8,'result':_0x22ce07};}catch(_0xc53c27){return{'code':0xc8,'result':_0xa784('0x13a')};}};AGIVertices['prototype']['gotoiftime']=function(_0x194585){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x13c'),_0x194585[_0xa784('0x37')]));if(!this['isConfigured'](_0x194585[_0xa784('0x13d')])){return this['channel'][_0xa784('0x2c')](_0x194585,_0xa784('0x13e'));}var _0x386bb6=this[_0xa784('0x25')]['sync'](this,_0x194585[_0xa784('0x13d')]);if(!_0x386bb6){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x194585,_0xa784('0x13f'));}for(var _0x2c9f02=0x0;_0x2c9f02<_0x386bb6[_0xa784('0x9c')];_0x2c9f02+=0x1){var _0x2ed2f8=this[_0xa784('0xd')][_0xa784('0x11')](util[_0xa784('0x2a')]('IFTIME(%s?true:false)',_0x386bb6[_0x2c9f02]));if(_0x2ed2f8[_0xa784('0xa3')]===-0x1){return _0x2ed2f8;}logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x140'),_0x386bb6[_0x2c9f02],_0x2ed2f8[_0xa784('0xa1')]));if(_0x2ed2f8['extra']===_0xa784('0x139')){logger[_0xa784('0x2e')](util['format'](_0xa784('0x140'),_0x386bb6[_0x2c9f02],_0xa784('0x139')));this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x140'),_0x386bb6[_0x2c9f02],_0xa784('0x139')));return{'code':0xc8,'result':_0xa784('0x139')};}else{logger[_0xa784('0x2e')](util['format'](_0xa784('0x140'),_0x386bb6[_0x2c9f02],_0xa784('0x13a')));this[_0xa784('0xd')][_0xa784('0xad')](util['format'](_0xa784('0x140'),_0x386bb6[_0x2c9f02],_0xa784('0x13a')));}}return{'code':0xc8,'result':_0xa784('0x13a')};};AGIVertices[_0xa784('0x10')][_0xa784('0x141')]=function(_0x71a18c){logger[_0xa784('0x2e')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x71a18c[_0xa784('0x37')]));return this['channel']['hangup']();};AGIVertices['prototype'][_0xa784('0x142')]=function(_0x49aaca){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x143'),_0x49aaca['label']));if(!this[_0xa784('0x85')](_0x49aaca[_0xa784('0x80')])){return this[_0xa784('0xd')]['noop'](_0xa784('0xe2'));}var _0x1b56d7=_0xa784('0x127');var _0x14b313=util['format'](_0xa784('0x128'),FILES_PATH,rs[_0xa784('0x111')](0x4));var _0x4ed952=util[_0xa784('0x2a')](_0xa784('0x9e'),_0x14b313,_0x1b56d7);var _0x1d4534=!![];if(_0x49aaca[_0xa784('0x131')]===_0xa784('0x129')){_0x1d4534=![];}var _0x28665d=this[_0xa784('0xd')][_0xa784('0x12a')](_0x14b313,_0x1b56d7,_0x49aaca[_0xa784('0x132')],_0x49aaca[_0xa784('0x63')],undefined,_0x1d4534);if(_0x28665d[_0xa784('0xa3')]!==-0x1){this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')]('ispeech\x20%s\x20file\x20created',_0x4ed952));var _0x3c5717=this[_0xa784('0x84')]['sync'](this,_0x49aaca,_0x4ed952);if(_0x3c5717){for(var _0x5bf6a3 in _0x3c5717){if(_0x3c5717[_0xa784('0x94')](_0x5bf6a3)){this[_0xa784('0xd')][_0xa784('0x9d')](util[_0xa784('0x2a')]('ISPEECH_ASR_%s',_0x5bf6a3['toUpperCase']()),_0x3c5717[_0x5bf6a3]);}}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x144'),JSON[_0xa784('0x72')](_0x3c5717)));}}return _0x28665d;};AGIVertices[_0xa784('0x10')]['ispeechtts']=function(_0x52a43d){logger['info'](util[_0xa784('0x2a')](_0xa784('0x145'),_0x52a43d[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x52a43d[_0xa784('0x80')])){return this['channel'][_0xa784('0xad')](_0xa784('0xe2'));}if(!this['isConfigured'](_0x52a43d[_0xa784('0x5c')])){return this[_0xa784('0xd')]['noop'](_0xa784('0xa8'));}this[_0xa784('0xd')][_0xa784('0xad')](util['format'](_0xa784('0x146'),_0x52a43d[_0xa784('0x5c')]));var _0x2ad10d=this['ispeechTTS'][_0xa784('0x6e')](this,_0x52a43d);if(_0x2ad10d){this[_0xa784('0xd')][_0xa784('0xad')](util['format']('ispeech\x20%s\x20file\x20created',_0x2ad10d));var _0x174847=this[_0xa784('0xd')][_0xa784('0xf9')](_0x2ad10d,_0x52a43d['intKey']);try{fs['unlink'](_0x2ad10d+_0xa784('0x11b'));}catch(_0x2a0f40){logger[_0xa784('0x2c')](_0x2a0f40);}return _0x174847;}return this[_0xa784('0xd')]['error'](_0x52a43d,_0xa784('0x147'));};AGIVertices[_0xa784('0x10')][_0xa784('0x148')]=function(_0x3bcc30){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3bcc30[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x3bcc30[_0xa784('0x149')])){return this['channel'][_0xa784('0x2c')](_0x3bcc30,_0xa784('0x14a'));}logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14b'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x3bcc30[_0xa784('0x149')]));var _0x4139bf=this[_0xa784('0x52')][_0xa784('0x6e')](this,_0x3bcc30[_0xa784('0x149')]);if(_0x4139bf){logger[_0xa784('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa784('0xd')][_0xa784('0x3a')],_0x3bcc30[_0xa784('0x149')]));this['channel']['noop'](util['format'](_0xa784('0x14c'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x3bcc30[_0xa784('0x149')]));return{'code':0xc8,'result':_0xa784('0x14d')};}else{logger[_0xa784('0x2e')](util['format'](_0xa784('0x14e'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x3bcc30[_0xa784('0x149')]));this[_0xa784('0xd')][_0xa784('0xad')](util['format'](_0xa784('0x14e'),this[_0xa784('0xd')]['callerid'],_0x3bcc30[_0xa784('0x149')]));return{'code':0xc8,'result':_0xa784('0x14f')};}};AGIVertices[_0xa784('0x10')][_0xa784('0x150')]=function(_0x41b78b){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x151'),_0x41b78b[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x41b78b['findBy'])){return this[_0xa784('0xd')]['error'](_0x41b78b,_0xa784('0x14a'));}logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa784('0xd')]['callerid'],_0x41b78b['findBy']));var _0x2e5922=this['agentLogout'][_0xa784('0x6e')](this,_0x41b78b[_0xa784('0x149')]);if(_0x2e5922){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14c'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x41b78b[_0xa784('0x149')]));this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x14c'),this['channel']['callerid'],_0x41b78b['findBy']));return{'code':0xc8,'result':_0xa784('0x14d')};}else{logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14e'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x41b78b[_0xa784('0x149')]));this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x14e'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x41b78b[_0xa784('0x149')]));return{'code':0xc8,'result':_0xa784('0x14f')};}};AGIVertices[_0xa784('0x10')]['math']=function(_0x3bb40c){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x152'),_0x3bb40c[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x3bb40c[_0xa784('0x153')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3bb40c,_0xa784('0x154'));}this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x155'),_0x3bb40c[_0xa784('0x153')]));var _0x13e44b=eval(_0x3bb40c[_0xa784('0x153')]);if(!this[_0xa784('0x85')](_0x3bb40c[_0xa784('0xd7')])){return this[_0xa784('0xd')][_0xa784('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1923cc=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x3bb40c[_0xa784('0xd7')]);if(!_0x1923cc){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3bb40c,_0xa784('0x10f'));}if(_[_0xa784('0x9a')](_0x13e44b)){var _0x21c163=this;_0x13e44b['forEach'](function(_0x41b94e,_0x27c1f2){_0x21c163[_0xa784('0xd')][_0xa784('0x9d')](util[_0xa784('0x2a')]('%s[%s]',_0x1923cc,_0x27c1f2),_0x41b94e);});return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')]('variable\x20%s[key]\x20set',_0x1923cc));}else{return this[_0xa784('0xd')][_0xa784('0x9d')](_0x1923cc,_0x13e44b);}};AGIVertices[_0xa784('0x10')]['menu']=function(_0x14dabf){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x14dabf[_0xa784('0x37')]));if(_0x14dabf[_0xa784('0xa5')]===0x0){return this[_0xa784('0xa4')](_0x14dabf);}_0x14dabf[_0xa784('0xa5')]-=0x1;if(!this[_0xa784('0x85')](_0x14dabf[_0xa784('0x107')])){return this[_0xa784('0xd')]['error'](_0x14dabf,_0xa784('0x108'));}var _0x49c497=this[_0xa784('0x1e')]['sync'](this,_0x14dabf['file_id']);if(!_0x49c497){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x14dabf,_0xa784('0x109'));}var _0x12be31=this['channel'][_0xa784('0x156')](_0x49c497,_0x14dabf[_0xa784('0x10a')],_0x14dabf['digit']);var _0x56fc28=_0x12be31[_0xa784('0xa3')];if(_0x12be31[_0xa784('0xa3')]===-0x1){this[_0xa784('0xd6')]['sync'](this,_0x14dabf,'-1');return _0x12be31;}else if(_0x12be31[_0xa784('0xa1')]===_0xa784('0x63')){_0x12be31[_0xa784('0xa3')]=_0x12be31[_0xa784('0xa3')]['length']>0x0?_0x12be31[_0xa784('0xa3')]:'t';}else if(_[_0xa784('0x44')](_0x12be31['result'])){_0x12be31[_0xa784('0xa3')]='#';_0x56fc28='#';}if(!this[_0xa784('0x85')](_0x14dabf[_0xa784('0xd7')])){this[_0xa784('0xd')][_0xa784('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x9faea4=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x14dabf[_0xa784('0xd7')]);if(!_0x9faea4){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x14dabf,_0xa784('0x10f'));}this[_0xa784('0xd')][_0xa784('0x9d')](_0x9faea4,_0x56fc28);}this['createSquareDetailsReport'][_0xa784('0x6e')](this,_0x14dabf,_0x56fc28);return _0x12be31;};AGIVertices[_0xa784('0x10')][_0xa784('0xad')]=function(_0x57f511){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x157'),_0x57f511[_0xa784('0x37')]));return this[_0xa784('0xd')][_0xa784('0xad')](_0x57f511[_0xa784('0x158')]||_0x57f511[_0xa784('0x37')]);};AGIVertices[_0xa784('0x10')][_0xa784('0x159')]=function(_0x3d87f3){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3d87f3[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x3d87f3[_0xa784('0x149')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3d87f3,'no\x20find\x20by\x20configured');}logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14b'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x3d87f3[_0xa784('0x149')]));var _0x39f131=this[_0xa784('0x4d')][_0xa784('0x6e')](this,_0x3d87f3[_0xa784('0x15a')]);var _0x111a1d=this['agentPause'][_0xa784('0x6e')](this,_0x3d87f3[_0xa784('0x149')],_0x39f131);if(_0x111a1d){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14c'),this[_0xa784('0xd')]['callerid'],_0x3d87f3[_0xa784('0x149')]));this[_0xa784('0xd')][_0xa784('0xad')](util['format'](_0xa784('0x14c'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x3d87f3[_0xa784('0x149')]));return{'code':0xc8,'result':_0xa784('0x14d')};}else{logger[_0xa784('0x2e')](util['format'](_0xa784('0x14e'),this[_0xa784('0xd')]['callerid'],_0x3d87f3[_0xa784('0x149')]));this[_0xa784('0xd')]['noop'](util['format'](_0xa784('0x14c'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x3d87f3[_0xa784('0x149')]));return{'code':0xc8,'result':_0xa784('0x14f')};}};AGIVertices[_0xa784('0x10')]['playback']=function(_0x50e7af){logger['info'](util[_0xa784('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x50e7af[_0xa784('0x37')]));if(!this['isConfigured'](_0x50e7af['file_id'])){return this['channel']['error'](_0x50e7af,_0xa784('0x108'));}var _0x2ef92b=this[_0xa784('0x1e')]['sync'](this,_0x50e7af[_0xa784('0x107')]);if(!_0x2ef92b){return this['channel'][_0xa784('0x2c')](_0x50e7af,_0xa784('0x109'));}var _0x3eb072=this[_0xa784('0xd')][_0xa784('0x57')](_0xa784('0x15b'),[_0x2ef92b,_0x50e7af[_0xa784('0xe1')]]);if(_0x3eb072[_0xa784('0xa3')]===-0x1){return _0x3eb072;}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')]('Executed\x20command\x20%s\x20%s',_0xa784('0x15b'),_0x2ef92b));};AGIVertices[_0xa784('0x10')][_0xa784('0x15c')]=function(_0x379ce8){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x15d'),_0x379ce8['label']));if(!this[_0xa784('0x85')](_0x379ce8['queue_id'])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x379ce8,_0xa784('0x15e'));}var _0x342083='';var _0x3b36f3=parseInt(_0x379ce8[_0xa784('0x15f')],0xa);if(isNaN(_0x3b36f3)){_0x342083=_0x379ce8['queue_id'];}else{_0x342083=this[_0xa784('0x15')][_0xa784('0x6e')](this,_0x379ce8[_0xa784('0x15f')]);if(!_0x342083){return this[_0xa784('0xd')]['error'](_0x379ce8,'no\x20queue\x20found');}}var _0x571e0d='';if(this[_0xa784('0x85')](_0x379ce8[_0xa784('0x107')])){var _0x310d62=this[_0xa784('0x1e')][_0xa784('0x6e')](this,_0x379ce8[_0xa784('0x107')]);if(_0x310d62){_0x571e0d=_0x310d62;}}this['createSquareDetailsReport']['sync'](this,_0x379ce8,_0x342083);if(_0x379ce8[_0xa784('0xe1')][_0xa784('0x160')]('x')<0x0){_0x379ce8[_0xa784('0xe1')]+='x';}if(_0x379ce8['opts'][_0xa784('0x160')]('X')<0x0){_0x379ce8[_0xa784('0xe1')]+='X';}this[_0xa784('0xd')][_0xa784('0x9d')](_0xa784('0x161'),_0x342083?_0x342083['toLowerCase']():'');var _0x59d639=this[_0xa784('0xd')]['exec']('QUEUE',[_0x342083,_0x379ce8[_0xa784('0xe1')],_0x379ce8[_0xa784('0x61')],_0x571e0d,_0x379ce8[_0xa784('0x63')],_0x379ce8['agi'],_0x379ce8[_0xa784('0x162')],_0x379ce8['gosub'],'',_0x379ce8[_0xa784('0x163')]]);if(_0x59d639['result']===-0x1){return _0x59d639;}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xc4'),_0xa784('0x164'),_0x342083));};AGIVertices[_0xa784('0x10')]['record']=function(_0x1f2f42){logger[_0xa784('0x2e')](util['format'](_0xa784('0x165'),_0x1f2f42['label']));var _0xbcc228=_0x1f2f42[_0xa784('0x166')]||'wav';var _0x5e5678=util[_0xa784('0x2a')](_0xa784('0x167'),this[_0xa784('0xd')][_0xa784('0x36')],rs['generate'](0x5));var _0x47dc2f=util[_0xa784('0x2a')](_0xa784('0x168'),FILES_PATH,_0x5e5678,_0xbcc228);var _0x58a9c7=util['format'](_0xa784('0x128'),FILES_PATH,_0x5e5678);this[_0xa784('0x3b')]['sync'](this,_0x1f2f42,_0x5e5678,_0x47dc2f);this[_0xa784('0xd')][_0xa784('0x9d')](_0xa784('0x169'),_0x5e5678);logger[_0xa784('0x2e')](_0xa784('0x16a'),_0x58a9c7,_0xbcc228,_0x1f2f42['escape_digits'],_0x1f2f42[_0xa784('0x63')]);return this['channel'][_0xa784('0x12a')](_0x58a9c7,_0xbcc228,_0x1f2f42[_0xa784('0x16b')],_0x1f2f42['timeout'],undefined,!![]);};AGIVertices[_0xa784('0x10')][_0xa784('0x16c')]=function(_0x140098){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x16d'),_0x140098[_0xa784('0x37')]));if(!this['isConfigured'](_0x140098[_0xa784('0x61')])){return this['channel'][_0xa784('0xad')](_0xa784('0x16e'));}var _0x2ec31e=this[_0xa784('0x16f')][_0xa784('0x6e')](this,_0x140098);logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Response:',util[_0xa784('0x170')](_0x2ec31e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x140098['variable_id'])){return this[_0xa784('0xd')][_0xa784('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x8218b2=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x140098[_0xa784('0xd7')]);if(!_0x8218b2){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x140098,_0xa784('0x10f'));}this[_0xa784('0xd')][_0xa784('0x9d')](util['format'](_0xa784('0x171'),_0x8218b2),_0x2ec31e[_0xa784('0x74')]?_0x2ec31e[_0xa784('0x74')]:_0xa784('0x172'));this['channel']['setVariable'](util[_0xa784('0x2a')]('%s_STATUS_MESSAGE',_0x8218b2),_0x2ec31e[_0xa784('0x75')]?_0x2ec31e[_0xa784('0x75')]:'OK');if(_0x2ec31e[_0xa784('0x69')]){try{this['saveRestApiResult'](_0x2ec31e['body'],_0x8218b2);}catch(_0x2668b3){logger[_0xa784('0x2c')](util[_0xa784('0x2a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x8218b2));}}return this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')]('variable\x20%s\x20set',_0x8218b2));};AGIVertices[_0xa784('0x10')]['saydigits']=function(_0x5565b0){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5565b0[_0xa784('0x37')]));return this[_0xa784('0xd')][_0xa784('0x173')](_0x5565b0['digits'][_0xa784('0x59')](/\s+/g,''),_0x5565b0['escape_digits']);};AGIVertices['prototype'][_0xa784('0x174')]=function(_0x1c43c9){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1c43c9['label']));return this[_0xa784('0xd')][_0xa784('0x175')](_0x1c43c9['number']['replace'](/\s+/g,''),_0x1c43c9['escape_digits']);};AGIVertices[_0xa784('0x10')][_0xa784('0x176')]=function(_0x30948d){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x177'),_0x30948d[_0xa784('0x37')]));return this[_0xa784('0xd')]['sayPhonetic'](_0x30948d['text'],_0x30948d[_0xa784('0x16b')]);};AGIVertices[_0xa784('0x10')][_0xa784('0x178')]=function(_0xe07d8a){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xe07d8a[_0xa784('0x37')]));if(!this['isConfigured'](_0xe07d8a[_0xa784('0x179')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0x17a'));}var _0x2bd2d8=this[_0xa784('0x22')][_0xa784('0x6e')](this,_0xe07d8a[_0xa784('0x179')]);if(!_0x2bd2d8||!_0x2bd2d8['Smtp']){return this[_0xa784('0xd')]['error'](_0xe07d8a,_0xa784('0x17b'));}var _0x19e655={'from':util[_0xa784('0x2a')](_0xa784('0x17c'),_0x2bd2d8[_0xa784('0x14')],_0x2bd2d8[_0xa784('0x17d')]||_0x2bd2d8[_0xa784('0x17e')][_0xa784('0x17f')]),'to':_0xe07d8a['to']||'','cc':_0xe07d8a['cc']||'','bcc':_0xe07d8a['bcc']||'','subject':_0xe07d8a[_0xa784('0x180')],'html':_0xe07d8a[_0xa784('0x5c')],'text':_0xe07d8a['text']};var _0x3566ad={'tls':{'rejectUnauthorized':![]}};if(_0x2bd2d8['Smtp'][_0xa784('0x181')]){_0x3566ad[_0xa784('0x181')]=_0x2bd2d8[_0xa784('0x17e')][_0xa784('0x181')];}else{_0x3566ad['host']=_0x2bd2d8['Smtp'][_0xa784('0x182')];_0x3566ad[_0xa784('0x183')]=_0x2bd2d8[_0xa784('0x17e')][_0xa784('0x183')];_0x3566ad[_0xa784('0x184')]=_0x2bd2d8[_0xa784('0x17e')][_0xa784('0x184')];}if(_0x2bd2d8[_0xa784('0x17e')][_0xa784('0x185')]){_0x3566ad[_0xa784('0x186')]={'user':_0x2bd2d8[_0xa784('0x17e')]['user'],'pass':_0x2bd2d8[_0xa784('0x17e')][_0xa784('0x187')]};}if(this[_0xa784('0x85')](_0xe07d8a['template_id'])){}logger[_0xa784('0x188')]('sendMail\x20message',JSON['stringify'](_0x19e655));this[_0xa784('0xd6')][_0xa784('0x6e')](this,_0xe07d8a,_0xe07d8a['account_id']);this['channel']['noop'](util[_0xa784('0x2a')](_0xa784('0x189'),_0x2bd2d8['name']));this[_0xa784('0x24')][_0xa784('0x6e')](this,_0x3566ad,_0x19e655);return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0x18a'));};AGIVertices[_0xa784('0x10')]['sendFax']=function(_0xb23539){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xb23539[_0xa784('0x37')]));return this['channel']['noop'](_0xa784('0x18b'));};AGIVertices[_0xa784('0x10')][_0xa784('0x18c')]=function(_0x8e607e){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x18d'),_0x8e607e[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x8e607e[_0xa784('0x18e')])){return this[_0xa784('0xd')]['noop']('no\x20sms\x20account\x20configured');}var _0x40b934=this[_0xa784('0x18f')][_0xa784('0x6e')](this,_0x8e607e[_0xa784('0x18e')]);if(!_0x40b934){return this['channel'][_0xa784('0x2c')](_0x8e607e,_0xa784('0x190'));}var _0x37ed65={'body':_0x8e607e[_0xa784('0x191')],'phone':_0x8e607e['to']||'','SmsAccountId':_0x40b934['id']};logger[_0xa784('0x188')](_0xa784('0x192'),JSON[_0xa784('0x72')](_0x37ed65));this[_0xa784('0xd6')][_0xa784('0x6e')](this,_0x8e607e,_0x8e607e[_0xa784('0x18e')]);this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x193'),_0x40b934[_0xa784('0x14')]));this[_0xa784('0x194')][_0xa784('0x6e')](this,_0x37ed65);return this['channel']['noop'](_0xa784('0x195'));};AGIVertices[_0xa784('0x10')][_0xa784('0x196')]=function(_0x2c49bb){logger[_0xa784('0x2e')](util['format'](_0xa784('0x197'),_0x2c49bb[_0xa784('0x37')]));if(!this[_0xa784('0x85')](_0x2c49bb[_0xa784('0xd7')])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x2c49bb,_0xa784('0x198'));}var _0x2d0e4f=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x2c49bb[_0xa784('0xd7')]);if(!_0x2d0e4f){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x2c49bb,_0xa784('0x10f'));}return this[_0xa784('0xd')]['setVariable'](_0x2d0e4f,_0x2c49bb[_0xa784('0x199')]);};AGIVertices[_0xa784('0x10')][_0xa784('0x19a')]=function(_0x338172){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x19b'),_0x338172[_0xa784('0x37')]));this['channel'][_0xa784('0xad')](_0xa784('0x19c'));if(_0x338172[_0xa784('0xb9')]==='yes'){this[_0xa784('0xd')]['noop']('Answer');return this['channel'][_0xa784('0xb9')]();}return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0x19d'));};AGIVertices['prototype'][_0xa784('0x19e')]=function(_0x22eb67){logger['info'](util[_0xa784('0x2a')](_0xa784('0x19f'),_0x22eb67[_0xa784('0x37')]));if(!this['isConfigured'](_0x22eb67['project_id'])){return this[_0xa784('0xd')]['error'](_0x22eb67,_0xa784('0x1a0'));}var _0x2b6b36=this[_0xa784('0x17')][_0xa784('0x6e')](this,_0x22eb67[_0xa784('0x1a1')]);if(!this[_0xa784('0x85')](_0x2b6b36)){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x22eb67,util[_0xa784('0x2a')](_0xa784('0x1a2'),_0x22eb67[_0xa784('0x1a1')]));}if(_0x2b6b36===this[_0xa784('0xd')]['arg_1']){return this[_0xa784('0xd')]['error'](_0x22eb67,_0xa784('0x1a3'));}this[_0xa784('0xd6')][_0xa784('0x6e')](this,_0x22eb67,_0x2b6b36);var _0x1a0d40=this['channel'][_0xa784('0x57')](_0xa784('0x1a4'),util['format'](_0xa784('0x1a5'),config[_0xa784('0xb6')][_0xa784('0x182')]||_0xa784('0x1a6'),_0x2b6b36,this['channel'][_0xa784('0x39')]));if(_0x1a0d40[_0xa784('0xa3')]===-0x1){return _0x1a0d40;}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xc4'),'AGI',_0x2b6b36));};AGIVertices[_0xa784('0x10')][_0xa784('0x1a7')]=function(_0x14dc5){logger[_0xa784('0x2e')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x14dc5['label']));var _0x47c912=this[_0xa784('0x56')][_0xa784('0x6e')](this,_0x14dc5[_0xa784('0xb8')]);this['createSquareDetailsReport'][_0xa784('0x6e')](this,_0x14dc5,_0x14dc5['command']);if(this['isConfigured'](_0x14dc5[_0xa784('0xd7')])){var _0x348219=this[_0xa784('0x11')]['sync'](this,_0x14dc5[_0xa784('0xd7')]);if(_0x348219){this[_0xa784('0xd')][_0xa784('0x9d')](_0x348219,_0x47c912);return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x1a8'),_0x14dc5[_0xa784('0xb8')],_0x348219));}}return this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x14dc5[_0xa784('0xb8')]));};AGIVertices[_0xa784('0x10')][_0xa784('0x1a9')]=function(_0x3535a1){logger[_0xa784('0x2e')](util[_0xa784('0x2a')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3535a1[_0xa784('0x37')]));_0x3535a1['text']=_0x3535a1['text'][_0xa784('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa784('0x85')](_0x3535a1[_0xa784('0x5b')])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0x1aa'));}if(!this['isConfigured'](_0x3535a1['text'])){return this[_0xa784('0xd')][_0xa784('0xad')](_0xa784('0xa8'));}this[_0xa784('0xd')]['noop'](util[_0xa784('0x2a')](_0xa784('0x1ab'),_0x3535a1[_0xa784('0x5c')]));var _0x5509ee=this[_0xa784('0x5a')][_0xa784('0x6e')](this,_0x3535a1);if(_0x5509ee){this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x1ac'),_0x5509ee));var _0x604620=this['channel'][_0xa784('0xf9')](_0x5509ee);try{fs[_0xa784('0xfa')](_0x5509ee+_0xa784('0x11b'));}catch(_0x45d716){logger['error'](_0x45d716);}return _0x604620;}return this[_0xa784('0xd')][_0xa784('0x2c')](_0x3535a1,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa784('0x10')]['tts']=function(_0x397f4a){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x1ad'),_0x397f4a['label']));_0x397f4a[_0xa784('0x5c')]=_0x397f4a[_0xa784('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa784('0x85')](_0x397f4a[_0xa784('0x5c')])){return this[_0xa784('0xd')][_0xa784('0xad')]('no\x20text\x20configured');}this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x1ae'),_0x397f4a[_0xa784('0x5c')]));var _0x5a3171=this[_0xa784('0x60')][_0xa784('0x6e')](this,_0x397f4a);if(_0x5a3171){this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0x1af'),_0x5a3171));var _0x43aea8=this['channel']['streamFile'](_0x5a3171);try{fs[_0xa784('0xfa')](_0x5a3171+_0xa784('0x11b'));}catch(_0x15a8a8){logger[_0xa784('0x2c')](_0x15a8a8);}return _0x43aea8;}return this[_0xa784('0xd')]['error'](_0x397f4a,_0xa784('0x1b0'));};AGIVertices[_0xa784('0x10')][_0xa784('0x1b1')]=function(_0x44e121){logger[_0xa784('0x2e')](util['format'](_0xa784('0x1b2'),_0x44e121[_0xa784('0x37')]));if(!this['isConfigured'](_0x44e121['findBy'])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x44e121,_0xa784('0x14a'));}logger['info'](util[_0xa784('0x2a')](_0xa784('0x14b'),this[_0xa784('0xd')]['callerid'],_0x44e121[_0xa784('0x149')]));var _0x24f29a=this[_0xa784('0x4f')][_0xa784('0x6e')](this,_0x44e121[_0xa784('0x149')]);if(_0x24f29a){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14c'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x44e121[_0xa784('0x149')]));this['channel']['noop'](util['format'](_0xa784('0x14c'),this['channel'][_0xa784('0x3a')],_0x44e121['findBy']));return{'code':0xc8,'result':_0xa784('0x14d')};}else{logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x14e'),this[_0xa784('0xd')][_0xa784('0x3a')],_0x44e121[_0xa784('0x149')]));this['channel'][_0xa784('0xad')](util[_0xa784('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa784('0xd')][_0xa784('0x3a')],_0x44e121[_0xa784('0x149')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa784('0x10')][_0xa784('0x1b3')]=function(_0x4fc6c7){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x1b4'),_0x4fc6c7[_0xa784('0x37')]));var _0x5210ac=this['channel'][_0xa784('0x57')](_0xa784('0x1b5'),[_0x4fc6c7['mailbox'],_0x4fc6c7[_0xa784('0x77')]]);if(_0x5210ac['result']===-0x1){return _0x5210ac;}return this[_0xa784('0xd')][_0xa784('0xad')](util[_0xa784('0x2a')](_0xa784('0xc4'),_0xa784('0x1b5'),_0x4fc6c7[_0xa784('0x1b6')]));};AGIVertices[_0xa784('0x10')][_0xa784('0x1b7')]=function(_0x4f9bbd){logger[_0xa784('0x2e')](util[_0xa784('0x2a')](_0xa784('0x1b8'),_0x4f9bbd['label']));if(!this[_0xa784('0x85')](_0x4f9bbd['variable_id'])){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x4f9bbd,_0xa784('0x198'));}var _0x9e2fbc=this[_0xa784('0x11')][_0xa784('0x6e')](this,_0x4f9bbd['variable_id']);if(!_0x9e2fbc){return this[_0xa784('0xd')][_0xa784('0x2c')](_0x4f9bbd,_0xa784('0x10f'));}var _0x3e0834=this[_0xa784('0xd')]['getVariable'](_0x9e2fbc);return{'code':0xc8,'result':_0x3e0834['extra']?_0x3e0834[_0xa784('0xa1')]:'-'};};String[_0xa784('0x10')][_0xa784('0xa0')]=function(_0x4fb35e,_0x16295a){return this['split'](_0x4fb35e)[_0xa784('0x1b9')](_0x16295a);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index d013963..c255d3d 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 _0xfcb3=['mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','startAcw','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','mandatoryDisposition'];(function(_0x322fe3,_0x52813f){var _0x138aab=function(_0x40422b){while(--_0x40422b){_0x322fe3['push'](_0x322fe3['shift']());}};_0x138aab(++_0x52813f);}(_0xfcb3,0x8f));var _0x3fcb=function(_0x263466,_0x3becf8){_0x263466=_0x263466-0x0;var _0x238730=_0xfcb3[_0x263466];return _0x238730;};'use strict';var util=require(_0x3fcb('0x0'));var _=require(_0x3fcb('0x1'));var moment=require(_0x3fcb('0x2'));var ami=require(_0x3fcb('0x3'));var logger=require(_0x3fcb('0x4'))(_0x3fcb('0x5'));var RpcUser=require(_0x3fcb('0x6'));var RpcVoiceAgentReport=require(_0x3fcb('0x7'));function Acw(_0x5dd380){this[_0x3fcb('0x8')]=_0x5dd380[_0x3fcb('0x8')];this['agents']=_0x5dd380[_0x3fcb('0x9')];this[_0x3fcb('0xa')]=_0x5dd380[_0x3fcb('0xa')];this[_0x3fcb('0xb')]={};ami['on'](_0x3fcb('0xc'),this[_0x3fcb('0xd')][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0xf'),this[_0x3fcb('0x10')]['bind'](this));ami['on'](_0x3fcb('0x11'),this['syncHangup'][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0x12'),this[_0x3fcb('0x13')][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0x14'),this[_0x3fcb('0x15')][_0x3fcb('0xe')](this));ami['on'](_0x3fcb('0x16'),this[_0x3fcb('0x17')]['bind'](this));ami['on'](_0x3fcb('0x18'),this[_0x3fcb('0x19')][_0x3fcb('0xe')](this));}function getDiff(_0x599ce2){var _0x16435b=moment()[_0x3fcb('0x1a')](0x0);var _0x28fd19=moment(_0x599ce2)['milliseconds'](0x0);return _0x16435b[_0x3fcb('0x1b')](_0x28fd19,_0x3fcb('0x1c'));}Acw[_0x3fcb('0x1d')]['startAcw']=function(_0x2a65f9){try{var _0x32bc20=this;var _0x371c8d=this['channels'][_0x2a65f9][_0x3fcb('0x1e')];var _0x4ad1bd=this[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x1f')];var _0x4d9ddb=this[_0x3fcb('0x8')][_0x4ad1bd];var _0x1c217f=![];var _0x569174='ACW';if(_0x4d9ddb[_0x3fcb('0x20')]){if(_0x4d9ddb[_0x3fcb('0x21')][_0x3fcb('0x22')]){_0x1c217f=!![];_0x569174=_0x4d9ddb[_0x3fcb('0x21')][_0x3fcb('0x22')];}}ami[_0x3fcb('0x23')]({'action':_0x3fcb('0x24'),'interface':_0x371c8d,'paused':!![],'reason':_0x569174})[_0x3fcb('0x25')](function(_0x56f207){if(_0x32bc20[_0x3fcb('0x9')][_0x371c8d]){return RpcUser[_0x3fcb('0x26')](_0x32bc20['agents'][_0x371c8d]['id'])['then'](function(_0x389815){if(_0x389815&&!_0x389815[_0x3fcb('0x27')]){logger[_0x3fcb('0x28')](_0x3fcb('0x29'),_0x2a65f9,_0x371c8d,_0x4ad1bd);var _0x40301b=_0x32bc20[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x2a')]&&_0x32bc20[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x2b')]?_0x32bc20[_0x3fcb('0xb')][_0x2a65f9][_0x3fcb('0x2b')]:_0x2a65f9;return RpcUser['savePause'](_0x32bc20[_0x3fcb('0x9')][_0x371c8d],_0x569174,_0x40301b)['then'](function(_0x4150da){if(!_0x1c217f){_0x32bc20[_0x3fcb('0xa')][_0x371c8d]={};logger[_0x3fcb('0x28')](_0x3fcb('0x2c'),_0x2a65f9,_0x32bc20[_0x3fcb('0x8')][_0x4ad1bd]['acwTimeout'],_0x371c8d,_0x4ad1bd);_0x32bc20['timers'][_0x371c8d][_0x3fcb('0x2d')]=setTimeout(_0x32bc20[_0x3fcb('0x2e')]['bind'](_0x32bc20,_0x371c8d),_0x32bc20[_0x3fcb('0x8')][_0x4ad1bd][_0x3fcb('0x2f')]*0x3e8);_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x30')]=moment()[_0x3fcb('0x31')](_0x3fcb('0x32'));_0x32bc20[_0x3fcb('0xa')][_0x371c8d]['uniqueid']=_0x2a65f9;_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x1f')]=_0x4ad1bd;_0x32bc20[_0x3fcb('0xa')][_0x371c8d]['updateAcw']=function(){var _0x3dff5d=getDiff(_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x30')]);clearTimeout(_0x32bc20[_0x3fcb('0xa')][_0x371c8d]['timer']);_0x32bc20['timers'][_0x371c8d]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3dff5d},_0x32bc20[_0x3fcb('0xa')][_0x371c8d][_0x3fcb('0x33')],_0x371c8d)[_0x3fcb('0x25')](function(_0x5a17a1){logger[_0x3fcb('0x28')](_0x3fcb('0x34'),_0x2a65f9,_0x3dff5d,_0x5a17a1);})[_0x3fcb('0x35')](function(_0x265004){logger[_0x3fcb('0x36')](_0x3fcb('0x37'),_0x2a65f9,_0x265004);});delete _0x32bc20[_0x3fcb('0xa')][_0x371c8d];};}});}else{logger[_0x3fcb('0x28')](_0x3fcb('0x38'),_0x2a65f9,_0x371c8d,_0x4ad1bd);}});}})[_0x3fcb('0x35')](function(_0x705c73){logger[_0x3fcb('0x36')](_0x3fcb('0x2c'),_0x2a65f9,_0x32bc20[_0x3fcb('0x8')][_0x4ad1bd][_0x3fcb('0x2f')],_0x371c8d,_0x4ad1bd);})[_0x3fcb('0x39')](function(){delete _0x32bc20[_0x3fcb('0xb')][_0x2a65f9];});}catch(_0x87993a){logger['error']('[ACW][START]\x20%s',_0x87993a[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x2e')]=function(_0x593689){try{var _0x6dec6e=this;if(_0x6dec6e[_0x3fcb('0xa')][_0x593689]){_0x6dec6e[_0x3fcb('0xa')][_0x593689][_0x3fcb('0x2d')]=![];var _0x4aea77=_0x6dec6e[_0x3fcb('0xa')][_0x593689][_0x3fcb('0x33')];var _0x34f5ba=_0x6dec6e[_0x3fcb('0xa')][_0x593689]['queue'];var _0x4ff90b=_0x6dec6e[_0x3fcb('0x8')][_0x34f5ba][_0x3fcb('0x2f')];logger[_0x3fcb('0x28')](_0x3fcb('0x3b'),_0x4aea77,_0x593689);RpcUser[_0x3fcb('0x3c')](this[_0x3fcb('0x9')][_0x593689]);RpcVoiceAgentReport[_0x3fcb('0x3d')]({'acwtime':_0x4ff90b,'agentacw':!![]},_0x4aea77,_0x593689)[_0x3fcb('0x25')](function(_0x212faf){logger['info'](_0x3fcb('0x34'),_0x4aea77,_0x4ff90b,_0x212faf);})[_0x3fcb('0x35')](function(_0x142e37){logger[_0x3fcb('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x4aea77,_0x142e37);});}else{logger['error'](_0x3fcb('0x3e'),_0x593689);if(_0x6dec6e['timers']){logger[_0x3fcb('0x28')](_0x3fcb('0x3f'),JSON[_0x3fcb('0x40')](_0x6dec6e['timers']));}}}catch(_0x53408a){logger[_0x3fcb('0x36')](_0x3fcb('0x41'),_0x53408a[_0x3fcb('0x3a')]);}};Acw[_0x3fcb('0x1d')][_0x3fcb('0xd')]=function(_0x2cfe06){try{if(this[_0x3fcb('0x8')][_0x2cfe06['queue']]&&(this[_0x3fcb('0x8')][_0x2cfe06[_0x3fcb('0x1f')]][_0x3fcb('0x5')]||this[_0x3fcb('0x8')][_0x2cfe06[_0x3fcb('0x1f')]][_0x3fcb('0x20')])){if(this[_0x3fcb('0x9')][_0x2cfe06[_0x3fcb('0x1e')]]){this[_0x3fcb('0xb')][_0x2cfe06['uniqueid']]={'queue':_0x2cfe06['queue'],'interface':_0x2cfe06[_0x3fcb('0x1e')],'destlinkedid':_0x2cfe06[_0x3fcb('0x2b')]};}}}catch(_0x3689bd){logger[_0x3fcb('0x36')](_0x3fcb('0x42'),_0x3689bd[_0x3fcb('0x3a')]);}};Acw[_0x3fcb('0x1d')][_0x3fcb('0x19')]=function(_0x49b7f4){try{if(this[_0x3fcb('0x8')][_0x49b7f4[_0x3fcb('0x1f')]]&&(this['voiceQueues'][_0x49b7f4[_0x3fcb('0x1f')]][_0x3fcb('0x5')]||this[_0x3fcb('0x8')][_0x49b7f4[_0x3fcb('0x1f')]][_0x3fcb('0x20')])){if(this[_0x3fcb('0x9')][_0x49b7f4[_0x3fcb('0x1e')]]){this['channels'][_0x49b7f4[_0x3fcb('0x33')]]={'queue':_0x49b7f4[_0x3fcb('0x1f')],'interface':_0x49b7f4[_0x3fcb('0x1e')]};}}}catch(_0x2ff5ad){logger[_0x3fcb('0x36')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2ff5ad[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x10')]=function(_0x36ff4b){try{if(this[_0x3fcb('0xb')][_0x36ff4b['uniqueid']]&&_['isUndefined'](this[_0x3fcb('0xb')][_0x36ff4b[_0x3fcb('0x33')]]['attended'])){logger[_0x3fcb('0x28')]('[%s][HANGUP:UNIQUEID]',_0x36ff4b[_0x3fcb('0x33')]);this['startAcw'](_0x36ff4b['uniqueid']);}else if(this[_0x3fcb('0xb')][_0x36ff4b[_0x3fcb('0x43')]]&&_[_0x3fcb('0x44')](this[_0x3fcb('0xb')][_0x36ff4b[_0x3fcb('0x43')]]['attended'])){logger[_0x3fcb('0x28')](_0x3fcb('0x45'),_0x36ff4b['linkedid']);this['startAcw'](_0x36ff4b['linkedid']);}}catch(_0x4bfb37){logger[_0x3fcb('0x36')](_0x3fcb('0x46'),_0x4bfb37[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x47')]=function(_0x2c2a09){try{if(this[_0x3fcb('0xb')][_0x2c2a09[_0x3fcb('0x33')]]&&this[_0x3fcb('0xb')][_0x2c2a09[_0x3fcb('0x33')]][_0x3fcb('0x2a')]){logger[_0x3fcb('0x28')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2c2a09[_0x3fcb('0x33')]);this['startAcw'](_0x2c2a09[_0x3fcb('0x33')]);}else if(this[_0x3fcb('0xb')][_0x2c2a09['linkedid']]&&this[_0x3fcb('0xb')][_0x2c2a09[_0x3fcb('0x43')]]['attended']){logger[_0x3fcb('0x28')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2c2a09[_0x3fcb('0x43')]);this[_0x3fcb('0x48')](_0x2c2a09[_0x3fcb('0x43')]);}}catch(_0x214980){logger['error'](_0x3fcb('0x49'),_0x214980['message']);}};Acw[_0x3fcb('0x1d')]['syncAttendedTransfer']=function(_0x3facc4){try{if(!_[_0x3fcb('0x4a')](this[_0x3fcb('0xb')][_0x3facc4['transfereeuniqueid']])){this[_0x3fcb('0x48')](_0x3facc4[_0x3fcb('0x4b')]);if(this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4c')]]){this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4c')]][_0x3fcb('0x2a')]=!![];this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4d')]]=this['channels'][_0x3facc4[_0x3fcb('0x4c')]];delete this['channels'][_0x3facc4[_0x3fcb('0x4c')]];}}else if(!_[_0x3fcb('0x4a')](this[_0x3fcb('0xb')][_0x3facc4['transfertargetuniqueid']])){this['startAcw'](_0x3facc4[_0x3fcb('0x4d')]);if(this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4e')]]){this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4e')]][_0x3fcb('0x2a')]=!![];this[_0x3fcb('0xb')][_0x3facc4[_0x3fcb('0x4b')]]=this[_0x3fcb('0xb')][_0x3facc4['origtransfereruniqueid']];delete this[_0x3fcb('0xb')][_0x3facc4['origtransfereruniqueid']];}}}catch(_0x244be7){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x244be7[_0x3fcb('0x3a')]);}};Acw['prototype'][_0x3fcb('0x17')]=function(_0xb38701){try{if(this['channels'][_0xb38701[_0x3fcb('0x4f')]]){logger[_0x3fcb('0x28')](_0x3fcb('0x50'),JSON[_0x3fcb('0x40')](_0xb38701[_0x3fcb('0x4f')]));this[_0x3fcb('0x48')](_0xb38701[_0x3fcb('0x4f')]);}else if(this[_0x3fcb('0xb')][_0xb38701[_0x3fcb('0x51')]]){logger[_0x3fcb('0x28')](_0x3fcb('0x52'),JSON[_0x3fcb('0x40')](_0xb38701[_0x3fcb('0x51')]));this[_0x3fcb('0x48')](_0xb38701['transfererlinkedid']);}}catch(_0x1cd733){logger[_0x3fcb('0x36')]('[ACW][syncBlindTransfer]\x20%s',_0x1cd733['message']);}};Acw['prototype'][_0x3fcb('0x13')]=function(_0x1fa45e){try{if(this[_0x3fcb('0x8')][_0x1fa45e[_0x3fcb('0x1f')]]&&this[_0x3fcb('0x8')][_0x1fa45e[_0x3fcb('0x1f')]]['autopause']===_0x3fcb('0x53')){if(this[_0x3fcb('0x9')][_0x1fa45e['interface']]){logger[_0x3fcb('0x28')](_0x3fcb('0x54'),_0x1fa45e[_0x3fcb('0x33')],_0x1fa45e[_0x3fcb('0x1e')],_0x1fa45e[_0x3fcb('0x1f')]);return RpcUser[_0x3fcb('0x55')](this[_0x3fcb('0x9')][_0x1fa45e['interface']],_0x3fcb('0x56'),_0x1fa45e['uniqueid']);}}}catch(_0x242120){logger['error'](_0x3fcb('0x57'),_0x242120['message']);}};module['exports']=Acw; \ No newline at end of file +var _0xb330=['autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','name','Action','QueuePause','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','then','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','message','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s'];(function(_0x7ca0dc,_0x31ff6d){var _0x1dd8d5=function(_0x4e9ec1){while(--_0x4e9ec1){_0x7ca0dc['push'](_0x7ca0dc['shift']());}};_0x1dd8d5(++_0x31ff6d);}(_0xb330,0x15a));var _0x0b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb330[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0b33('0x0'));var _=require('lodash');var moment=require(_0x0b33('0x1'));var ami=require(_0x0b33('0x2'));var logger=require('../../../config/logger')(_0x0b33('0x3'));var RpcUser=require(_0x0b33('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3d411e){this[_0x0b33('0x5')]=_0x3d411e[_0x0b33('0x5')];this['agents']=_0x3d411e[_0x0b33('0x6')];this[_0x0b33('0x7')]=_0x3d411e[_0x0b33('0x7')];this[_0x0b33('0x8')]={};ami['on'](_0x0b33('0x9'),this['syncAgentConnect'][_0x0b33('0xa')](this));ami['on'](_0x0b33('0xb'),this[_0x0b33('0xc')]['bind'](this));ami['on'](_0x0b33('0xd'),this[_0x0b33('0xe')][_0x0b33('0xa')](this));ami['on'](_0x0b33('0xf'),this[_0x0b33('0x10')][_0x0b33('0xa')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x0b33('0x11'),this[_0x0b33('0x12')][_0x0b33('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x0b33('0x13')]['bind'](this));}function getDiff(_0x491e03){var _0x26c313=moment()[_0x0b33('0x14')](0x0);var _0x33a1c0=moment(_0x491e03)[_0x0b33('0x14')](0x0);return _0x26c313['diff'](_0x33a1c0,_0x0b33('0x15'));}Acw[_0x0b33('0x16')][_0x0b33('0x17')]=function(_0x1bf37d){try{var _0x17fb2a=this;var _0x45cd85=this[_0x0b33('0x8')][_0x1bf37d]['interface'];var _0x328685=this[_0x0b33('0x8')][_0x1bf37d][_0x0b33('0x18')];var _0x1b1fe6=this[_0x0b33('0x5')][_0x328685];var _0x42ad05=![];var _0x4827b5=_0x0b33('0x19');if(_0x1b1fe6[_0x0b33('0x1a')]){if(_0x1b1fe6['mandatoryDispositionPause'][_0x0b33('0x1b')]){_0x42ad05=!![];_0x4827b5=_0x1b1fe6['mandatoryDispositionPause'][_0x0b33('0x1b')];}}ami[_0x0b33('0x1c')]({'action':_0x0b33('0x1d'),'interface':_0x45cd85,'paused':!![],'reason':_0x4827b5})['then'](function(_0x5e1334){if(_0x17fb2a['agents'][_0x45cd85]){return RpcUser['getAgent'](_0x17fb2a['agents'][_0x45cd85]['id'])['then'](function(_0x510a1d){if(_0x510a1d&&!_0x510a1d[_0x0b33('0x1e')]){logger['info'](_0x0b33('0x1f'),_0x1bf37d,_0x45cd85,_0x328685);var _0x5bb693=_0x17fb2a[_0x0b33('0x8')][_0x1bf37d][_0x0b33('0x20')]&&_0x17fb2a[_0x0b33('0x8')][_0x1bf37d][_0x0b33('0x21')]?_0x17fb2a[_0x0b33('0x8')][_0x1bf37d][_0x0b33('0x21')]:_0x1bf37d;return RpcUser['savePause'](_0x17fb2a[_0x0b33('0x6')][_0x45cd85],_0x4827b5,_0x5bb693)[_0x0b33('0x22')](function(_0x110a62){if(!_0x42ad05){_0x17fb2a[_0x0b33('0x7')][_0x45cd85]={};logger[_0x0b33('0x23')](_0x0b33('0x24'),_0x1bf37d,_0x17fb2a[_0x0b33('0x5')][_0x328685]['acwTimeout'],_0x45cd85,_0x328685);_0x17fb2a[_0x0b33('0x7')][_0x45cd85]['timer']=setTimeout(_0x17fb2a[_0x0b33('0x25')][_0x0b33('0xa')](_0x17fb2a,_0x45cd85),_0x17fb2a['voiceQueues'][_0x328685][_0x0b33('0x26')]*0x3e8);_0x17fb2a['timers'][_0x45cd85][_0x0b33('0x27')]=moment()[_0x0b33('0x28')](_0x0b33('0x29'));_0x17fb2a[_0x0b33('0x7')][_0x45cd85][_0x0b33('0x2a')]=_0x1bf37d;_0x17fb2a[_0x0b33('0x7')][_0x45cd85][_0x0b33('0x18')]=_0x328685;_0x17fb2a[_0x0b33('0x7')][_0x45cd85][_0x0b33('0x2b')]=function(){var _0x26917b=getDiff(_0x17fb2a['timers'][_0x45cd85][_0x0b33('0x27')]);clearTimeout(_0x17fb2a[_0x0b33('0x7')][_0x45cd85]['timer']);_0x17fb2a[_0x0b33('0x7')][_0x45cd85][_0x0b33('0x2c')]=![];RpcVoiceAgentReport[_0x0b33('0x2d')]({'acwtime':_0x26917b},_0x17fb2a[_0x0b33('0x7')][_0x45cd85][_0x0b33('0x2a')],_0x45cd85)[_0x0b33('0x22')](function(_0x3d273d){logger[_0x0b33('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x1bf37d,_0x26917b,_0x3d273d);})['catch'](function(_0x5f2a2e){logger[_0x0b33('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x1bf37d,_0x5f2a2e);});delete _0x17fb2a[_0x0b33('0x7')][_0x45cd85];};}});}else{logger[_0x0b33('0x23')](_0x0b33('0x2f'),_0x1bf37d,_0x45cd85,_0x328685);}});}})[_0x0b33('0x30')](function(_0x799c0a){logger['error'](_0x0b33('0x24'),_0x1bf37d,_0x17fb2a[_0x0b33('0x5')][_0x328685][_0x0b33('0x26')],_0x45cd85,_0x328685);})[_0x0b33('0x31')](function(){delete _0x17fb2a['channels'][_0x1bf37d];});}catch(_0x399f23){logger[_0x0b33('0x2e')]('[ACW][START]\x20%s',_0x399f23[_0x0b33('0x32')]);}};Acw['prototype'][_0x0b33('0x25')]=function(_0x3624cc){try{var _0x46f1c8=this;if(_0x46f1c8[_0x0b33('0x7')][_0x3624cc]){_0x46f1c8[_0x0b33('0x7')][_0x3624cc][_0x0b33('0x2c')]=![];var _0x291b47=_0x46f1c8[_0x0b33('0x7')][_0x3624cc][_0x0b33('0x2a')];var _0x3df764=_0x46f1c8[_0x0b33('0x7')][_0x3624cc][_0x0b33('0x18')];var _0xa159fc=_0x46f1c8['voiceQueues'][_0x3df764]['acwTimeout'];logger[_0x0b33('0x23')]('[%s][TIMER][STOP][AGENT:%s]',_0x291b47,_0x3624cc);RpcUser[_0x0b33('0x33')](this[_0x0b33('0x6')][_0x3624cc]);RpcVoiceAgentReport[_0x0b33('0x2d')]({'acwtime':_0xa159fc,'agentacw':!![]},_0x291b47,_0x3624cc)[_0x0b33('0x22')](function(_0x1839ee){logger[_0x0b33('0x23')](_0x0b33('0x34'),_0x291b47,_0xa159fc,_0x1839ee);})[_0x0b33('0x30')](function(_0x147f45){logger[_0x0b33('0x2e')](_0x0b33('0x35'),_0x291b47,_0x147f45);});}else{logger[_0x0b33('0x2e')](_0x0b33('0x36'),_0x3624cc);if(_0x46f1c8[_0x0b33('0x7')]){logger[_0x0b33('0x23')](_0x0b33('0x37'),JSON[_0x0b33('0x38')](_0x46f1c8[_0x0b33('0x7')]));}}}catch(_0x29552b){logger[_0x0b33('0x2e')](_0x0b33('0x39'),_0x29552b[_0x0b33('0x32')]);}};Acw[_0x0b33('0x16')][_0x0b33('0x3a')]=function(_0x503a64){try{if(this[_0x0b33('0x5')][_0x503a64[_0x0b33('0x18')]]&&(this[_0x0b33('0x5')][_0x503a64[_0x0b33('0x18')]][_0x0b33('0x3')]||this[_0x0b33('0x5')][_0x503a64['queue']][_0x0b33('0x1a')])){if(this['agents'][_0x503a64[_0x0b33('0x3b')]]){this[_0x0b33('0x8')][_0x503a64[_0x0b33('0x2a')]]={'queue':_0x503a64[_0x0b33('0x18')],'interface':_0x503a64[_0x0b33('0x3b')],'destlinkedid':_0x503a64[_0x0b33('0x21')]};}}}catch(_0x3ea6c2){logger[_0x0b33('0x2e')](_0x0b33('0x3c'),_0x3ea6c2['message']);}};Acw[_0x0b33('0x16')]['syncAgentConnectPreview']=function(_0x985a1b){try{if(this[_0x0b33('0x5')][_0x985a1b['queue']]&&(this[_0x0b33('0x5')][_0x985a1b[_0x0b33('0x18')]]['acw']||this[_0x0b33('0x5')][_0x985a1b[_0x0b33('0x18')]][_0x0b33('0x1a')])){if(this[_0x0b33('0x6')][_0x985a1b['interface']]){this[_0x0b33('0x8')][_0x985a1b[_0x0b33('0x2a')]]={'queue':_0x985a1b[_0x0b33('0x18')],'interface':_0x985a1b[_0x0b33('0x3b')]};}}}catch(_0x30ad6f){logger[_0x0b33('0x2e')](_0x0b33('0x3d'),_0x30ad6f[_0x0b33('0x32')]);}};Acw[_0x0b33('0x16')]['syncHangupRequest']=function(_0xdd19ed){try{if(this[_0x0b33('0x8')][_0xdd19ed[_0x0b33('0x2a')]]&&_[_0x0b33('0x3e')](this[_0x0b33('0x8')][_0xdd19ed[_0x0b33('0x2a')]][_0x0b33('0x20')])){logger[_0x0b33('0x23')]('[%s][HANGUP:UNIQUEID]',_0xdd19ed['uniqueid']);this[_0x0b33('0x17')](_0xdd19ed[_0x0b33('0x2a')]);}else if(this[_0x0b33('0x8')][_0xdd19ed[_0x0b33('0x3f')]]&&_[_0x0b33('0x3e')](this[_0x0b33('0x8')][_0xdd19ed[_0x0b33('0x3f')]]['attended'])){logger[_0x0b33('0x23')](_0x0b33('0x40'),_0xdd19ed[_0x0b33('0x3f')]);this[_0x0b33('0x17')](_0xdd19ed[_0x0b33('0x3f')]);}}catch(_0x2df15a){logger[_0x0b33('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x2df15a[_0x0b33('0x32')]);}};Acw[_0x0b33('0x16')]['syncHangup']=function(_0x129cde){try{if(this[_0x0b33('0x8')][_0x129cde['uniqueid']]&&this[_0x0b33('0x8')][_0x129cde[_0x0b33('0x2a')]][_0x0b33('0x20')]){logger[_0x0b33('0x23')](_0x0b33('0x41'),_0x129cde[_0x0b33('0x2a')]);this['startAcw'](_0x129cde[_0x0b33('0x2a')]);}else if(this[_0x0b33('0x8')][_0x129cde['linkedid']]&&this[_0x0b33('0x8')][_0x129cde[_0x0b33('0x3f')]][_0x0b33('0x20')]){logger[_0x0b33('0x23')](_0x0b33('0x42'),_0x129cde[_0x0b33('0x3f')]);this[_0x0b33('0x17')](_0x129cde[_0x0b33('0x3f')]);}}catch(_0x192b50){logger[_0x0b33('0x2e')]('[ACW][syncHangup]\x20%s',_0x192b50[_0x0b33('0x32')]);}};Acw[_0x0b33('0x16')][_0x0b33('0x43')]=function(_0x22262f){try{if(!_[_0x0b33('0x44')](this[_0x0b33('0x8')][_0x22262f[_0x0b33('0x45')]])){this[_0x0b33('0x17')](_0x22262f[_0x0b33('0x45')]);if(this['channels'][_0x22262f[_0x0b33('0x46')]]){this[_0x0b33('0x8')][_0x22262f['secondtransfereruniqueid']][_0x0b33('0x20')]=!![];this[_0x0b33('0x8')][_0x22262f['transfertargetuniqueid']]=this['channels'][_0x22262f[_0x0b33('0x46')]];delete this[_0x0b33('0x8')][_0x22262f['secondtransfereruniqueid']];}}else if(!_[_0x0b33('0x44')](this['channels'][_0x22262f[_0x0b33('0x47')]])){this[_0x0b33('0x17')](_0x22262f[_0x0b33('0x47')]);if(this['channels'][_0x22262f[_0x0b33('0x48')]]){this[_0x0b33('0x8')][_0x22262f[_0x0b33('0x48')]][_0x0b33('0x20')]=!![];this[_0x0b33('0x8')][_0x22262f[_0x0b33('0x45')]]=this[_0x0b33('0x8')][_0x22262f[_0x0b33('0x48')]];delete this[_0x0b33('0x8')][_0x22262f['origtransfereruniqueid']];}}}catch(_0x49318d){logger[_0x0b33('0x2e')](_0x0b33('0x49'),_0x49318d[_0x0b33('0x32')]);}};Acw[_0x0b33('0x16')]['syncBlindTransfer']=function(_0x43a68e){try{if(this['channels'][_0x43a68e[_0x0b33('0x4a')]]){logger[_0x0b33('0x23')](_0x0b33('0x4b'),JSON[_0x0b33('0x38')](_0x43a68e['transfereruniqueid']));this[_0x0b33('0x17')](_0x43a68e[_0x0b33('0x4a')]);}else if(this[_0x0b33('0x8')][_0x43a68e['transfererlinkedid']]){logger[_0x0b33('0x23')](_0x0b33('0x4c'),JSON['stringify'](_0x43a68e[_0x0b33('0x4d')]));this[_0x0b33('0x17')](_0x43a68e[_0x0b33('0x4d')]);}}catch(_0x46e4a3){logger[_0x0b33('0x2e')](_0x0b33('0x4e'),_0x46e4a3['message']);}};Acw[_0x0b33('0x16')]['syncAgentRingNoAnswer']=function(_0x56d438){try{if(this[_0x0b33('0x5')][_0x56d438[_0x0b33('0x18')]]&&this[_0x0b33('0x5')][_0x56d438[_0x0b33('0x18')]][_0x0b33('0x4f')]===_0x0b33('0x50')){if(this['agents'][_0x56d438[_0x0b33('0x3b')]]){logger[_0x0b33('0x23')](_0x0b33('0x51'),_0x56d438[_0x0b33('0x2a')],_0x56d438[_0x0b33('0x3b')],_0x56d438[_0x0b33('0x18')]);return RpcUser[_0x0b33('0x52')](this[_0x0b33('0x6')][_0x56d438[_0x0b33('0x3b')]],'Auto-Pause',_0x56d438[_0x0b33('0x2a')]);}}}catch(_0x23c3be){logger[_0x0b33('0x2e')](_0x0b33('0x53'),_0x23c3be[_0x0b33('0x32')]);}};module[_0x0b33('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index dc7a628..c094862 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 _0x85ec=['Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','log','exports','asterisk-manager','bluebird','lodash','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x85ec,0x10f));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0xc85e('0x0'));var BPromise=require(_0xc85e('0x1'));var moment=require('moment');var util=require('util');var _=require(_0xc85e('0x2'));var logger=require('../../config/logger')(_0xc85e('0x3'));var config=require(_0xc85e('0x4'));var ami=new Manager(config[_0xc85e('0x5')][_0xc85e('0x6')],config[_0xc85e('0x5')]['ip'],config['asterisk'][_0xc85e('0x7')],config['asterisk'][_0xc85e('0x8')],!![]);ami[_0xc85e('0x9')]();ami[_0xc85e('0xa')]=BPromise[_0xc85e('0xb')](ami['action']);function error(_0x24a804){logger[_0xc85e('0xc')](util[_0xc85e('0xd')](_0xc85e('0xe'),config[_0xc85e('0x5')]['username'],config[_0xc85e('0x5')]['ip'],config[_0xc85e('0x5')][_0xc85e('0x6')],util[_0xc85e('0xf')](_0x24a804,![],null)));}function close(){logger[_0xc85e('0xc')](util['format'](_0xc85e('0x10'),config[_0xc85e('0x5')][_0xc85e('0x7')],config['asterisk']['ip'],config[_0xc85e('0x5')][_0xc85e('0x6')]));}ami[_0xc85e('0x11')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':'sipshowregistry'});};};ami[_0xc85e('0x12')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':_0xc85e('0x13')});};};ami[_0xc85e('0x14')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':'sippeerstatus'});};};ami[_0xc85e('0x15')]=function(){return function(){return ami[_0xc85e('0xa')]({'action':'queuesummary'});};};ami[_0xc85e('0x16')]=function(){return function(){return ami['Action']({'action':_0xc85e('0x17')});};};function connect(_0x4ff1a9){logger[_0xc85e('0x18')](util[_0xc85e('0xd')](_0xc85e('0x19'),config[_0xc85e('0x5')][_0xc85e('0x7')],config[_0xc85e('0x5')]['ip'],config['asterisk']['port']));ami[_0xc85e('0x1a')](_0xc85e('0xc'),error);ami[_0xc85e('0x1a')](_0xc85e('0x1b'),close);}ami['on'](_0xc85e('0x1c'),connect);ami['on'](_0xc85e('0x1d'),function(_0x489648){logger[_0xc85e('0x18')](util['format'](_0xc85e('0x1e'),config['asterisk'][_0xc85e('0x7')],config[_0xc85e('0x5')]['ip'],config[_0xc85e('0x5')][_0xc85e('0x6')],util['inspect'](_0x489648,![],null)));});ami['on'](_0xc85e('0x1f'),function(_0x360f4b){logger['info'](util[_0xc85e('0xd')](_0xc85e('0x20'),config[_0xc85e('0x5')][_0xc85e('0x7')],config[_0xc85e('0x5')]['ip'],config['asterisk'][_0xc85e('0x6')]));return BPromise['resolve']()['then'](ami[_0xc85e('0x11')]())[_0xc85e('0x21')](ami[_0xc85e('0x12')]())[_0xc85e('0x21')](ami[_0xc85e('0x14')]())['then'](ami['actionQueueSummary']())[_0xc85e('0x21')](ami['actionCoreShowChannels']())[_0xc85e('0x22')](function(_0x3f3e59){console[_0xc85e('0x23')](_0x3f3e59);});});ami[_0xc85e('0x1a')](_0xc85e('0xc'),error);ami[_0xc85e('0x1a')]('close',close);module[_0xc85e('0x24')]=ami; \ No newline at end of file +var _0x8953=['error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','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','actionQueueSummary','log','close','asterisk-manager','moment','lodash','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action'];(function(_0x4c3846,_0x39b39c){var _0x247d35=function(_0x16b82b){while(--_0x16b82b){_0x4c3846['push'](_0x4c3846['shift']());}};_0x247d35(++_0x39b39c);}(_0x8953,0xcc));var _0x3895=function(_0x38d5ed,_0x2b5125){_0x38d5ed=_0x38d5ed-0x0;var _0x504b92=_0x8953[_0x38d5ed];return _0x504b92;};'use strict';var Manager=require(_0x3895('0x0'));var BPromise=require('bluebird');var moment=require(_0x3895('0x1'));var util=require('util');var _=require(_0x3895('0x2'));var logger=require('../../config/logger')('ami');var config=require(_0x3895('0x3'));var ami=new Manager(config['asterisk'][_0x3895('0x4')],config[_0x3895('0x5')]['ip'],config[_0x3895('0x5')][_0x3895('0x6')],config[_0x3895('0x5')][_0x3895('0x7')],!![]);ami[_0x3895('0x8')]();ami[_0x3895('0x9')]=BPromise[_0x3895('0xa')](ami[_0x3895('0xb')]);function error(_0x4c0924){logger[_0x3895('0xc')](util[_0x3895('0xd')](_0x3895('0xe'),config[_0x3895('0x5')]['username'],config[_0x3895('0x5')]['ip'],config[_0x3895('0x5')][_0x3895('0x4')],util[_0x3895('0xf')](_0x4c0924,![],null)));}function close(){logger[_0x3895('0xc')](util[_0x3895('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x3895('0x5')][_0x3895('0x6')],config[_0x3895('0x5')]['ip'],config['asterisk'][_0x3895('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x3895('0x9')]({'action':_0x3895('0x10')});};};ami[_0x3895('0x11')]=function(){return function(){return ami['Action']({'action':_0x3895('0x12')});};};ami[_0x3895('0x13')]=function(){return function(){return ami['Action']({'action':_0x3895('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x3895('0x15')});};};ami[_0x3895('0x16')]=function(){return function(){return ami[_0x3895('0x9')]({'action':_0x3895('0x17')});};};function connect(_0x30b54d){logger[_0x3895('0x18')](util['format'](_0x3895('0x19'),config[_0x3895('0x5')][_0x3895('0x6')],config['asterisk']['ip'],config[_0x3895('0x5')]['port']));ami['once']('error',error);ami[_0x3895('0x1a')]('close',close);}ami['on']('connect',connect);ami['on'](_0x3895('0x1b'),function(_0x3cd306){logger['info'](util['format'](_0x3895('0x1c'),config[_0x3895('0x5')][_0x3895('0x6')],config[_0x3895('0x5')]['ip'],config[_0x3895('0x5')][_0x3895('0x4')],util[_0x3895('0xf')](_0x3cd306,![],null)));});ami['on'](_0x3895('0x1d'),function(_0x233b47){logger['info'](util['format'](_0x3895('0x1e'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x3895('0x5')]['port']));return BPromise[_0x3895('0x1f')]()['then'](ami['actionSipShowRegistry']())[_0x3895('0x20')](ami[_0x3895('0x11')]())['then'](ami[_0x3895('0x13')]())[_0x3895('0x20')](ami[_0x3895('0x21')]())[_0x3895('0x20')](ami[_0x3895('0x16')]())['catch'](function(_0x68f266){console[_0x3895('0x22')](_0x68f266);});});ami[_0x3895('0x1a')](_0x3895('0xc'),error);ami[_0x3895('0x1a')](_0x3895('0x23'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d9f65eb..4f209a5 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xe706,0xa3));var _0x6e70=function(_0x1cdabe,_0x286194){_0x1cdabe=_0x1cdabe-0x0;var _0x3dcc9c=_0xe706[_0x1cdabe];return _0x3dcc9c;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xb7e7[_0x2faddb];return _0x273c05;};'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 55c1d63..84b9bba 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 _0xded1=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','moment','string','voiceQueue','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x2914fc,_0x25a703){var _0x273f89=function(_0xf2d690){while(--_0xf2d690){_0x2914fc['push'](_0x2914fc['shift']());}};_0x273f89(++_0x25a703);}(_0xded1,0x190));var _0x1ded=function(_0x182b41,_0x3710ca){_0x182b41=_0x182b41-0x0;var _0x39e4dc=_0xded1[_0x182b41];return _0x39e4dc;};'use strict';var util=require(_0x1ded('0x0'));var _=require('lodash');var moment=require(_0x1ded('0x1'));function checkNameSurname(_0x56ded8,_0x39b8e4,_0x4f7322){var _0x10e14e='';if(!_['isNil'](_0x39b8e4)&&_0x1ded('0x2')===typeof _0x39b8e4){_0x10e14e+=_0x39b8e4;}if(!_['isNil'](_0x4f7322)&&'string'===typeof _0x4f7322){_0x10e14e+='\x20'+_0x4f7322;}if(_0x10e14e!==''){return _0x10e14e;}return _0x56ded8;}function Action(_0xb71635,_0x450647,_0x393d11){this[_0x1ded('0x3')]=_0xb71635;this['uniqueid']=_0x393d11||undefined;this[_0x1ded('0x4')]=checkNameSurname(_0x450647[_0x1ded('0x5')][_0x1ded('0x6')],_0x450647['Contact'][_0x1ded('0x7')],_0x450647[_0x1ded('0x5')][_0x1ded('0x8')]);this['number']=_0x450647[_0x1ded('0x5')][_0x1ded('0x6')];this['queue']=_0xb71635[_0x1ded('0x4')];this[_0x1ded('0x9')]=_0x450647[_0x1ded('0x9')]||![];this['type']=_0xb71635[_0x1ded('0xa')];this['dialQueueTimeout']=_0xb71635[_0x1ded('0xb')]||0x3;this[_0x1ded('0xc')]=_0x450647[_0x1ded('0xc')];this['countbusyretry']=_0x450647[_0x1ded('0xd')];this[_0x1ded('0xe')]=_0x450647[_0x1ded('0xe')];this[_0x1ded('0xf')]=_0x450647[_0x1ded('0xf')];this[_0x1ded('0x10')]=_0x450647[_0x1ded('0x10')];this[_0x1ded('0x11')]=_0x450647[_0x1ded('0x11')];this[_0x1ded('0x12')]=_0x450647[_0x1ded('0x12')];this[_0x1ded('0x13')]=_0x450647['countmachineretry'];this['countagentrejectretry']=_0x450647[_0x1ded('0x14')];this[_0x1ded('0x15')]=_0x450647['ContactId'];this[_0x1ded('0x16')]=_0x450647['ListId'];this[_0x1ded('0x17')]=_0x450647[_0x1ded('0x17')];this[_0x1ded('0x18')]=_0x450647[_0x1ded('0x18')];this['CampaignId']=_0x450647[_0x1ded('0x19')];this[_0x1ded('0x1a')]=_0x450647['id'];this['ContactFirstName']=_0x450647[_0x1ded('0x5')][_0x1ded('0x7')]||'';this[_0x1ded('0x1b')]=moment()['format'](_0x1ded('0x1c'));this['callback']=_0x450647[_0x1ded('0x1d')];this[_0x1ded('0x1e')]=_0x450647[_0x1ded('0x1e')];this[_0x1ded('0x1f')]=_0x450647[_0x1ded('0x1f')];this[_0x1ded('0x20')]=_0x450647[_0x1ded('0x20')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1ded('0x21')][_0x1ded('0x22')]=function(){return util[_0x1ded('0x23')](_0x1ded('0x24'),this[_0x1ded('0x4')],this['voiceQueue'][_0x1ded('0x25')]>0x0?this[_0x1ded('0x26')][_0x1ded('0x27')](this[_0x1ded('0x3')][_0x1ded('0x25')]):this['number']);};Action[_0x1ded('0x21')][_0x1ded('0x28')]=function(){return this['queue'];};module[_0x1ded('0x29')]=Action; \ No newline at end of file +var _0x2812=['starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName'];(function(_0x945377,_0x3173bc){var _0xd5193b=function(_0x515614){while(--_0x515614){_0x945377['push'](_0x945377['shift']());}};_0xd5193b(++_0x3173bc);}(_0x2812,0x1c6));var _0x2281=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0x2812[_0x418549];return _0x288826;};'use strict';var util=require(_0x2281('0x0'));var _=require(_0x2281('0x1'));var moment=require(_0x2281('0x2'));function checkNameSurname(_0x1b6fab,_0x3a934f,_0x162447){var _0x1dd25b='';if(!_[_0x2281('0x3')](_0x3a934f)&&'string'===typeof _0x3a934f){_0x1dd25b+=_0x3a934f;}if(!_[_0x2281('0x3')](_0x162447)&&_0x2281('0x4')===typeof _0x162447){_0x1dd25b+='\x20'+_0x162447;}if(_0x1dd25b!==''){return _0x1dd25b;}return _0x1b6fab;}function Action(_0x55f199,_0x4c625c,_0x373666){this[_0x2281('0x5')]=_0x55f199;this['uniqueid']=_0x373666||undefined;this[_0x2281('0x6')]=checkNameSurname(_0x4c625c[_0x2281('0x7')][_0x2281('0x8')],_0x4c625c[_0x2281('0x7')][_0x2281('0x9')],_0x4c625c[_0x2281('0x7')][_0x2281('0xa')]);this['number']=_0x4c625c[_0x2281('0x7')][_0x2281('0x8')];this[_0x2281('0xb')]=_0x55f199[_0x2281('0x6')];this[_0x2281('0xc')]=_0x4c625c[_0x2281('0xc')]||![];this['type']=_0x55f199[_0x2281('0xd')];this['dialQueueTimeout']=_0x55f199['dialQueueTimeout']||0x3;this[_0x2281('0xe')]=_0x4c625c['scheduledat'];this[_0x2281('0xf')]=_0x4c625c[_0x2281('0xf')];this[_0x2281('0x10')]=_0x4c625c['countcongestionretry'];this[_0x2281('0x11')]=_0x4c625c[_0x2281('0x11')];this['countnosuchnumberretry']=_0x4c625c[_0x2281('0x12')];this[_0x2281('0x13')]=_0x4c625c[_0x2281('0x13')];this[_0x2281('0x14')]=_0x4c625c[_0x2281('0x14')];this[_0x2281('0x15')]=_0x4c625c[_0x2281('0x15')];this['countagentrejectretry']=_0x4c625c[_0x2281('0x16')];this[_0x2281('0x17')]=_0x4c625c[_0x2281('0x17')];this[_0x2281('0x18')]=_0x4c625c['ListId'];this['UserId']=_0x4c625c[_0x2281('0x19')];this[_0x2281('0x1a')]=_0x4c625c['VoiceQueueId'];this[_0x2281('0x1b')]=_0x4c625c[_0x2281('0x1b')];this[_0x2281('0x1c')]=_0x4c625c['id'];this[_0x2281('0x1d')]=_0x4c625c[_0x2281('0x7')]['firstName']||'';this[_0x2281('0x1e')]=moment()['format'](_0x2281('0x1f'));this['callback']=_0x4c625c[_0x2281('0x20')];this['callbackuniqueid']=_0x4c625c[_0x2281('0x21')];this[_0x2281('0x22')]=_0x4c625c[_0x2281('0x22')];this[_0x2281('0x23')]=_0x4c625c[_0x2281('0x23')];this[_0x2281('0x24')]='';this[_0x2281('0x25')]='';}Action[_0x2281('0x26')]['getCaller']=function(){return util[_0x2281('0x27')](_0x2281('0x28'),this[_0x2281('0x6')],this[_0x2281('0x5')][_0x2281('0x29')]>0x0?this[_0x2281('0x2a')][_0x2281('0x2b')](this[_0x2281('0x5')]['dialCutDigit']):this[_0x2281('0x2a')]);};Action[_0x2281('0x26')]['getQueue']=function(){return this[_0x2281('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 552706b..3dde97e 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 _0x70a7=['countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x5897fc,_0x9bbad6){var _0x292681=function(_0x45bc59){while(--_0x45bc59){_0x5897fc['push'](_0x5897fc['shift']());}};_0x292681(++_0x9bbad6);}(_0x70a7,0x116));var _0x770a=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x70a7[_0x12f688];return _0x59c3de;};'use strict';var util=require(_0x770a('0x0'));var _=require(_0x770a('0x1'));var moment=require(_0x770a('0x2'));function getSeconds(_0x1ab751,_0x3f4e4c){var _0x4391ea=moment(_0x1ab751)[_0x770a('0x3')](0x0);var _0x16a45a=moment(_0x3f4e4c)[_0x770a('0x3')](0x0);return _0x4391ea[_0x770a('0x4')](_0x16a45a,_0x770a('0x5'));}function AgentComplete(_0x526ae8,_0x161ebf){this[_0x770a('0x6')]=0x4;this[_0x770a('0x7')]=_0x770a('0x8');this['scheduledat']=_0x526ae8[_0x770a('0x9')];this[_0x770a('0xa')]=_0x526ae8[_0x770a('0xa')];this[_0x770a('0xb')]=_0x526ae8[_0x770a('0xa')]===_0x770a('0xc')?_0x770a('0xd'):_0x526ae8[_0x770a('0xa')];this[_0x770a('0xe')]=_0x526ae8[_0x770a('0xe')];this['countcongestionretry']=_0x526ae8[_0x770a('0xf')];this[_0x770a('0x10')]=_0x526ae8[_0x770a('0x10')];this[_0x770a('0x11')]=_0x526ae8[_0x770a('0xe')]+_0x526ae8[_0x770a('0xf')]+_0x526ae8[_0x770a('0x10')]+_0x526ae8['countnosuchnumberretry']+_0x526ae8[_0x770a('0x12')]+_0x526ae8[_0x770a('0x13')]+_0x526ae8['countmachineretry']+_0x526ae8[_0x770a('0x14')];this[_0x770a('0x15')]=_0x526ae8['countnosuchnumberretry'];this[_0x770a('0x12')]=_0x526ae8['countdropretry'];this[_0x770a('0x13')]=_0x526ae8['countabandonedretry'];this[_0x770a('0x16')]=_0x526ae8[_0x770a('0x16')];this[_0x770a('0x14')]=_0x526ae8['countagentrejectretry'];this[_0x770a('0x17')]=_0x161ebf[_0x770a('0x17')];this[_0x770a('0x18')]=_0x526ae8['name'];this[_0x770a('0x19')]=_0x526ae8['number'];this[_0x770a('0x1a')]=_0x526ae8[_0x770a('0x1a')];this[_0x770a('0x1b')]=_0x526ae8[_0x770a('0x1b')];this[_0x770a('0x1c')]=_0x526ae8[_0x770a('0x1c')];this[_0x770a('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x526ae8[_0x770a('0x1b')],_0x526ae8[_0x770a('0x1a')]);this['holdtime']=getSeconds(_0x526ae8[_0x770a('0x1c')],_0x526ae8[_0x770a('0x1b')]);this['talktime']=getSeconds(this['endtime'],_0x526ae8['answertime']);this[_0x770a('0xd')]=_0x161ebf[_0x770a('0xd')];this[_0x770a('0x1e')]=_0x161ebf[_0x770a('0x1e')];this['reason']=_0x161ebf['reason'];this[_0x770a('0x1f')]=_0x526ae8[_0x770a('0x1f')];this[_0x770a('0x20')]=_0x526ae8[_0x770a('0x20')];this['callbackat']=_0x526ae8[_0x770a('0x21')];this[_0x770a('0x22')]=_0x526ae8[_0x770a('0x22')];this['ContactId']=_0x526ae8[_0x770a('0x23')];this[_0x770a('0x24')]=_0x526ae8[_0x770a('0x24')];this[_0x770a('0x25')]=_0x526ae8[_0x770a('0x25')];this['VoiceQueueId']=_0x526ae8['VoiceQueueId'];this[_0x770a('0x26')]=_0x526ae8[_0x770a('0x26')];this['originatecalleridnum']=_0x526ae8[_0x770a('0x27')]||'';this['originatecalleridname']=_0x526ae8[_0x770a('0x28')]||'';}module[_0x770a('0x29')]=AgentComplete; \ No newline at end of file +var _0xe4a2=['originatecalleridnum','lodash','moment','milliseconds','diff','seconds','state','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x45a272,_0x28ac26){var _0x11bdf2=function(_0x226032){while(--_0x226032){_0x45a272['push'](_0x45a272['shift']());}};_0x11bdf2(++_0x28ac26);}(_0xe4a2,0xd3));var _0x2e4a=function(_0x2bcbd9,_0x2b28d1){_0x2bcbd9=_0x2bcbd9-0x0;var _0x9c7581=_0xe4a2[_0x2bcbd9];return _0x9c7581;};'use strict';var util=require('util');var _=require(_0x2e4a('0x0'));var moment=require(_0x2e4a('0x1'));function getSeconds(_0x154174,_0x2842f6){var _0x59b3b9=moment(_0x154174)['milliseconds'](0x0);var _0x2de6bc=moment(_0x2842f6)[_0x2e4a('0x2')](0x0);return _0x59b3b9[_0x2e4a('0x3')](_0x2de6bc,_0x2e4a('0x4'));}function AgentComplete(_0x9e2a4f,_0x10fc31){this[_0x2e4a('0x5')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x9e2a4f[_0x2e4a('0x6')];this[_0x2e4a('0x7')]=_0x9e2a4f[_0x2e4a('0x7')];this[_0x2e4a('0x8')]=_0x9e2a4f[_0x2e4a('0x7')]==='outbound'?_0x2e4a('0x9'):_0x9e2a4f[_0x2e4a('0x7')];this['countbusyretry']=_0x9e2a4f[_0x2e4a('0xa')];this['countcongestionretry']=_0x9e2a4f[_0x2e4a('0xb')];this[_0x2e4a('0xc')]=_0x9e2a4f['countnoanswerretry'];this['countglobal']=_0x9e2a4f['countbusyretry']+_0x9e2a4f[_0x2e4a('0xb')]+_0x9e2a4f[_0x2e4a('0xc')]+_0x9e2a4f[_0x2e4a('0xd')]+_0x9e2a4f[_0x2e4a('0xe')]+_0x9e2a4f[_0x2e4a('0xf')]+_0x9e2a4f[_0x2e4a('0x10')]+_0x9e2a4f['countagentrejectretry'];this[_0x2e4a('0xd')]=_0x9e2a4f['countnosuchnumberretry'];this[_0x2e4a('0xe')]=_0x9e2a4f[_0x2e4a('0xe')];this[_0x2e4a('0xf')]=_0x9e2a4f['countabandonedretry'];this[_0x2e4a('0x10')]=_0x9e2a4f[_0x2e4a('0x10')];this[_0x2e4a('0x11')]=_0x9e2a4f[_0x2e4a('0x11')];this[_0x2e4a('0x12')]=_0x10fc31[_0x2e4a('0x12')];this[_0x2e4a('0x13')]=_0x9e2a4f[_0x2e4a('0x14')];this[_0x2e4a('0x15')]=_0x9e2a4f[_0x2e4a('0x16')];this[_0x2e4a('0x17')]=_0x9e2a4f[_0x2e4a('0x17')];this[_0x2e4a('0x18')]=_0x9e2a4f[_0x2e4a('0x18')];this[_0x2e4a('0x19')]=_0x9e2a4f[_0x2e4a('0x19')];this['endtime']=moment()[_0x2e4a('0x1a')](_0x2e4a('0x1b'));this[_0x2e4a('0x1c')]=getSeconds(_0x9e2a4f[_0x2e4a('0x18')],_0x9e2a4f['starttime']);this['holdtime']=getSeconds(_0x9e2a4f[_0x2e4a('0x19')],_0x9e2a4f[_0x2e4a('0x18')]);this[_0x2e4a('0x1d')]=getSeconds(this['endtime'],_0x9e2a4f['answertime']);this[_0x2e4a('0x9')]=_0x10fc31[_0x2e4a('0x9')];this[_0x2e4a('0x1e')]=_0x10fc31['membername'];this[_0x2e4a('0x1f')]=_0x10fc31[_0x2e4a('0x1f')];this[_0x2e4a('0x20')]=_0x9e2a4f['callback'];this[_0x2e4a('0x21')]=_0x9e2a4f[_0x2e4a('0x21')];this[_0x2e4a('0x22')]=_0x9e2a4f[_0x2e4a('0x22')];this[_0x2e4a('0x23')]=_0x9e2a4f[_0x2e4a('0x23')];this[_0x2e4a('0x24')]=_0x9e2a4f[_0x2e4a('0x24')];this[_0x2e4a('0x25')]=_0x9e2a4f[_0x2e4a('0x25')];this[_0x2e4a('0x26')]=_0x9e2a4f[_0x2e4a('0x26')];this[_0x2e4a('0x27')]=_0x9e2a4f['VoiceQueueId'];this[_0x2e4a('0x28')]=_0x9e2a4f[_0x2e4a('0x28')];this[_0x2e4a('0x29')]=_0x9e2a4f['originatecalleridnum']||'';this['originatecalleridname']=_0x9e2a4f['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index e3cb026..b5db763 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 _0x8ef6=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x232a4d,_0x2447bc){var _0x379449=function(_0x423644){while(--_0x423644){_0x232a4d['push'](_0x232a4d['shift']());}};_0x379449(++_0x2447bc);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2f80a8,_0x3df49b){_0x2f80a8=_0x2f80a8-0x0;var _0xf62f4=_0x8ef6[_0x2f80a8];return _0xf62f4;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));function getSeconds(_0x279e08,_0x2cc97b){var _0x44e0d3=moment(_0x279e08)[_0x68ef('0x3')](0x0);var _0x4a72b8=moment(_0x2cc97b)[_0x68ef('0x3')](0x0);return _0x44e0d3[_0x68ef('0x4')](_0x4a72b8,_0x68ef('0x5'));}function Final(_0x2ac782){this['uniqueid']=_0x2ac782['uniqueid'];this[_0x68ef('0x6')]=_0x2ac782[_0x68ef('0x6')];this[_0x68ef('0x7')]=_0x2ac782['type'];this[_0x68ef('0x8')]=_0x2ac782[_0x68ef('0x7')]===_0x68ef('0x9')?_0x68ef('0xa'):_0x2ac782[_0x68ef('0x7')];this[_0x68ef('0xb')]=_0x2ac782[_0x68ef('0xb')];this[_0x68ef('0xc')]=_0x2ac782[_0x68ef('0xc')];this[_0x68ef('0xd')]=_0x2ac782[_0x68ef('0xd')];this[_0x68ef('0xe')]=_0x2ac782['countbusyretry']+_0x2ac782[_0x68ef('0xc')]+_0x2ac782[_0x68ef('0xd')]+_0x2ac782[_0x68ef('0xf')]+_0x2ac782[_0x68ef('0x10')]+_0x2ac782[_0x68ef('0x11')]+_0x2ac782[_0x68ef('0x12')]+_0x2ac782['countagentrejectretry'];this[_0x68ef('0xf')]=_0x2ac782[_0x68ef('0xf')];this[_0x68ef('0x10')]=_0x2ac782['countdropretry'];this[_0x68ef('0x11')]=_0x2ac782[_0x68ef('0x11')];this[_0x68ef('0x12')]=_0x2ac782['countmachineretry'];this[_0x68ef('0x13')]=_0x2ac782[_0x68ef('0x13')];this[_0x68ef('0xa')]=_0x2ac782[_0x68ef('0xa')];this['calleridname']=_0x2ac782[_0x68ef('0x14')];this['calleridnum']=_0x2ac782['calleridnum'];this[_0x68ef('0x15')]=_0x2ac782[_0x68ef('0x15')];this['responsetime']=_0x2ac782['responsetime'];this[_0x68ef('0x16')]=_0x2ac782[_0x68ef('0x17')];this[_0x68ef('0x18')]=_0x2ac782['ringtime']||0x0;this[_0x68ef('0x19')]=_0x2ac782[_0x68ef('0x19')]||0x0;this[_0x68ef('0x1a')]=_0x2ac782['talktime']||0x0;this[_0x68ef('0x1b')]=_0x2ac782[_0x68ef('0x1b')];this['callbackuniqueid']=_0x2ac782[_0x68ef('0x1c')];this[_0x68ef('0x1d')]=_0x2ac782[_0x68ef('0x1d')];this['recallme']=_0x2ac782['recallme'];this['ContactId']=_0x2ac782[_0x68ef('0x1e')];this[_0x68ef('0x1f')]=_0x2ac782[_0x68ef('0x1f')];this[_0x68ef('0x20')]=_0x2ac782[_0x68ef('0x20')];this[_0x68ef('0x21')]=_0x2ac782[_0x68ef('0x21')];this[_0x68ef('0x22')]=_0x2ac782[_0x68ef('0x22')];this[_0x68ef('0x23')]=_0x2ac782['originatecalleridnum']||'';this[_0x68ef('0x24')]=_0x2ac782['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x8098=['diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds'];(function(_0x743293,_0x1c6a7a){var _0x432544=function(_0x3204c9){while(--_0x3204c9){_0x743293['push'](_0x743293['shift']());}};_0x432544(++_0x1c6a7a);}(_0x8098,0x1ba));var _0x8809=function(_0x39aba0,_0x5a5cf6){_0x39aba0=_0x39aba0-0x0;var _0x56dc38=_0x8098[_0x39aba0];return _0x56dc38;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8809('0x0'));function getSeconds(_0x1ad523,_0x4037be){var _0x22f28d=moment(_0x1ad523)[_0x8809('0x1')](0x0);var _0x4b0838=moment(_0x4037be)[_0x8809('0x1')](0x0);return _0x22f28d[_0x8809('0x2')](_0x4b0838,_0x8809('0x3'));}function Final(_0x1a11bf){this['uniqueid']=_0x1a11bf[_0x8809('0x4')];this[_0x8809('0x5')]=_0x1a11bf['scheduledat'];this[_0x8809('0x6')]=_0x1a11bf[_0x8809('0x6')];this[_0x8809('0x7')]=_0x1a11bf[_0x8809('0x6')]===_0x8809('0x8')?_0x8809('0x9'):_0x1a11bf[_0x8809('0x6')];this[_0x8809('0xa')]=_0x1a11bf[_0x8809('0xa')];this[_0x8809('0xb')]=_0x1a11bf[_0x8809('0xb')];this[_0x8809('0xc')]=_0x1a11bf[_0x8809('0xc')];this[_0x8809('0xd')]=_0x1a11bf[_0x8809('0xa')]+_0x1a11bf[_0x8809('0xb')]+_0x1a11bf['countnoanswerretry']+_0x1a11bf[_0x8809('0xe')]+_0x1a11bf[_0x8809('0xf')]+_0x1a11bf['countabandonedretry']+_0x1a11bf[_0x8809('0x10')]+_0x1a11bf[_0x8809('0x11')];this['countnosuchnumberretry']=_0x1a11bf['countnosuchnumberretry'];this[_0x8809('0xf')]=_0x1a11bf[_0x8809('0xf')];this[_0x8809('0x12')]=_0x1a11bf[_0x8809('0x12')];this[_0x8809('0x10')]=_0x1a11bf[_0x8809('0x10')];this[_0x8809('0x11')]=_0x1a11bf['countagentrejectretry'];this[_0x8809('0x9')]=_0x1a11bf[_0x8809('0x9')];this['calleridname']=_0x1a11bf[_0x8809('0x13')];this[_0x8809('0x14')]=_0x1a11bf['calleridnum'];this[_0x8809('0x15')]=_0x1a11bf[_0x8809('0x15')];this[_0x8809('0x16')]=_0x1a11bf[_0x8809('0x16')];this[_0x8809('0x17')]=_0x1a11bf['responsetime'];this['ringtime']=_0x1a11bf[_0x8809('0x18')]||0x0;this[_0x8809('0x19')]=_0x1a11bf[_0x8809('0x19')]||0x0;this[_0x8809('0x1a')]=_0x1a11bf[_0x8809('0x1a')]||0x0;this[_0x8809('0x1b')]=_0x1a11bf[_0x8809('0x1b')];this[_0x8809('0x1c')]=_0x1a11bf[_0x8809('0x1c')];this[_0x8809('0x1d')]=_0x1a11bf[_0x8809('0x1d')];this[_0x8809('0x1e')]=_0x1a11bf[_0x8809('0x1e')];this['ContactId']=_0x1a11bf['ContactId'];this[_0x8809('0x1f')]=_0x1a11bf[_0x8809('0x1f')];this['UserId']=_0x1a11bf['UserId'];this['VoiceQueueId']=_0x1a11bf[_0x8809('0x20')];this[_0x8809('0x21')]=_0x1a11bf[_0x8809('0x21')];this[_0x8809('0x22')]=_0x1a11bf[_0x8809('0x22')]||'';this[_0x8809('0x23')]=_0x1a11bf[_0x8809('0x23')]||'';}module[_0x8809('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 0296066..4eb81fb 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 _0x9d14=['calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid'];(function(_0x24f6e5,_0x23863b){var _0x262b55=function(_0x5c635b){while(--_0x5c635b){_0x24f6e5['push'](_0x24f6e5['shift']());}};_0x262b55(++_0x23863b);}(_0x9d14,0x118));var _0x49d1=function(_0x1ea36c,_0x4388f1){_0x1ea36c=_0x1ea36c-0x0;var _0x403020=_0x9d14[_0x1ea36c];return _0x403020;};'use strict';var util=require(_0x49d1('0x0'));var _=require(_0x49d1('0x1'));var moment=require(_0x49d1('0x2'));function getSeconds(_0x283701,_0x5dddaf){var _0x5914be=moment(_0x283701)['milliseconds'](0x0);var _0x547757=moment(_0x5dddaf)[_0x49d1('0x3')](0x0);return _0x5914be[_0x49d1('0x4')](_0x547757,_0x49d1('0x5'));}function Hangup(_0x3d33c6,_0x79baea){this[_0x49d1('0x6')]=0x4;this[_0x49d1('0x7')]=_0x49d1('0x8');this['scheduledat']=_0x3d33c6['scheduledat'];this[_0x49d1('0x9')]=_0x3d33c6[_0x49d1('0x9')];this['campaigntype']=_0x3d33c6['type']==='outbound'?_0x49d1('0xa'):_0x3d33c6[_0x49d1('0x9')];this[_0x49d1('0xb')]=_0x3d33c6[_0x49d1('0xb')];this[_0x49d1('0xc')]=_0x3d33c6[_0x49d1('0xc')];this[_0x49d1('0xd')]=_0x3d33c6['countnoanswerretry'];this[_0x49d1('0xe')]=_0x3d33c6[_0x49d1('0xb')]+_0x3d33c6[_0x49d1('0xc')]+_0x3d33c6['countnoanswerretry']+_0x3d33c6['countnosuchnumberretry']+_0x3d33c6[_0x49d1('0xf')]+_0x3d33c6[_0x49d1('0x10')]+_0x3d33c6[_0x49d1('0x11')]+_0x3d33c6['countagentrejectretry'];this['countnosuchnumberretry']=_0x3d33c6[_0x49d1('0x12')];this[_0x49d1('0xf')]=_0x3d33c6[_0x49d1('0xf')];this[_0x49d1('0x10')]=_0x3d33c6[_0x49d1('0x10')];this[_0x49d1('0x11')]=_0x3d33c6['countmachineretry'];this[_0x49d1('0x13')]=_0x3d33c6[_0x49d1('0x13')];this['uniqueid']=_0x79baea[_0x49d1('0x14')];this[_0x49d1('0x15')]=_0x3d33c6[_0x49d1('0x16')];this['calleridnum']=_0x3d33c6[_0x49d1('0x17')];this[_0x49d1('0x18')]=_0x3d33c6[_0x49d1('0x18')];this['responsetime']=_0x3d33c6[_0x49d1('0x19')];this[_0x49d1('0x1a')]=moment()[_0x49d1('0x1b')](_0x49d1('0x1c'));this[_0x49d1('0x1d')]=getSeconds(_0x3d33c6['responsetime'],_0x3d33c6[_0x49d1('0x18')]);this['holdtime']=0x0;this[_0x49d1('0x1e')]=getSeconds(this[_0x49d1('0x1a')],_0x3d33c6[_0x49d1('0x19')]);this[_0x49d1('0xa')]=_0x3d33c6['queue'];this['membername']=_0x49d1('0x1f');this[_0x49d1('0x20')]=_0x79baea[_0x49d1('0x21')];this[_0x49d1('0x22')]=_0x3d33c6[_0x49d1('0x22')];this[_0x49d1('0x23')]=_0x3d33c6[_0x49d1('0x23')];this[_0x49d1('0x24')]=_0x3d33c6[_0x49d1('0x24')];this[_0x49d1('0x25')]=_0x3d33c6[_0x49d1('0x25')];this['ContactId']=_0x3d33c6[_0x49d1('0x26')];this[_0x49d1('0x27')]=_0x3d33c6[_0x49d1('0x27')];this[_0x49d1('0x28')]=_0x3d33c6['UserId'];this[_0x49d1('0x29')]=_0x3d33c6[_0x49d1('0x29')];this['CampaignId']=_0x3d33c6['CampaignId'];}module[_0x49d1('0x2a')]=Hangup; \ No newline at end of file +var _0xdaa7=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','IVR','reason','callback','callbackuniqueid'];(function(_0x59cdf6,_0x35faea){var _0x51b72b=function(_0x4fa65d){while(--_0x4fa65d){_0x59cdf6['push'](_0x59cdf6['shift']());}};_0x51b72b(++_0x35faea);}(_0xdaa7,0x1df));var _0x7daa=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0xdaa7[_0x503564];return _0x4be9fd;};'use strict';var util=require(_0x7daa('0x0'));var _=require(_0x7daa('0x1'));var moment=require(_0x7daa('0x2'));function getSeconds(_0x5b2b3f,_0x5cf652){var _0x3d62b5=moment(_0x5b2b3f)[_0x7daa('0x3')](0x0);var _0x1b1134=moment(_0x5cf652)['milliseconds'](0x0);return _0x3d62b5['diff'](_0x1b1134,_0x7daa('0x4'));}function Hangup(_0xcb2883,_0x4c9ead){this[_0x7daa('0x5')]=0x4;this[_0x7daa('0x6')]=_0x7daa('0x7');this[_0x7daa('0x8')]=_0xcb2883[_0x7daa('0x8')];this[_0x7daa('0x9')]=_0xcb2883[_0x7daa('0x9')];this['campaigntype']=_0xcb2883[_0x7daa('0x9')]==='outbound'?'queue':_0xcb2883['type'];this[_0x7daa('0xa')]=_0xcb2883[_0x7daa('0xa')];this['countcongestionretry']=_0xcb2883[_0x7daa('0xb')];this['countnoanswerretry']=_0xcb2883[_0x7daa('0xc')];this[_0x7daa('0xd')]=_0xcb2883[_0x7daa('0xa')]+_0xcb2883[_0x7daa('0xb')]+_0xcb2883[_0x7daa('0xc')]+_0xcb2883[_0x7daa('0xe')]+_0xcb2883['countdropretry']+_0xcb2883['countabandonedretry']+_0xcb2883[_0x7daa('0xf')]+_0xcb2883[_0x7daa('0x10')];this[_0x7daa('0xe')]=_0xcb2883[_0x7daa('0xe')];this[_0x7daa('0x11')]=_0xcb2883[_0x7daa('0x11')];this[_0x7daa('0x12')]=_0xcb2883[_0x7daa('0x12')];this['countmachineretry']=_0xcb2883['countmachineretry'];this[_0x7daa('0x10')]=_0xcb2883[_0x7daa('0x10')];this[_0x7daa('0x13')]=_0x4c9ead['uniqueid'];this[_0x7daa('0x14')]=_0xcb2883['name'];this[_0x7daa('0x15')]=_0xcb2883[_0x7daa('0x16')];this[_0x7daa('0x17')]=_0xcb2883[_0x7daa('0x17')];this[_0x7daa('0x18')]=_0xcb2883[_0x7daa('0x18')];this[_0x7daa('0x19')]=moment()[_0x7daa('0x1a')](_0x7daa('0x1b'));this[_0x7daa('0x1c')]=getSeconds(_0xcb2883['responsetime'],_0xcb2883[_0x7daa('0x17')]);this[_0x7daa('0x1d')]=0x0;this[_0x7daa('0x1e')]=getSeconds(this[_0x7daa('0x19')],_0xcb2883[_0x7daa('0x18')]);this[_0x7daa('0x1f')]=_0xcb2883['queue'];this[_0x7daa('0x20')]=_0x7daa('0x21');this[_0x7daa('0x22')]=_0x4c9ead['cause-txt'];this[_0x7daa('0x23')]=_0xcb2883[_0x7daa('0x23')];this['callbackuniqueid']=_0xcb2883[_0x7daa('0x24')];this['callbackat']=_0xcb2883['callbackat'];this[_0x7daa('0x25')]=_0xcb2883['recallme'];this['ContactId']=_0xcb2883[_0x7daa('0x26')];this[_0x7daa('0x27')]=_0xcb2883[_0x7daa('0x27')];this[_0x7daa('0x28')]=_0xcb2883[_0x7daa('0x28')];this[_0x7daa('0x29')]=_0xcb2883[_0x7daa('0x29')];this[_0x7daa('0x2a')]=_0xcb2883[_0x7daa('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b21b0e1..8433976 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 _0x8ca7=['responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','name','calleridnum','number','starttime'];(function(_0x17d241,_0xed198d){var _0x1908f1=function(_0x4fb558){while(--_0x4fb558){_0x17d241['push'](_0x17d241['shift']());}};_0x1908f1(++_0xed198d);}(_0x8ca7,0x1b2));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x78ca('0x0'));function getSeconds(_0x3e9102,_0x19644c){var _0x56a461=moment(_0x3e9102)['milliseconds'](0x0);var _0x24f861=moment(_0x19644c)[_0x78ca('0x1')](0x0);return _0x56a461[_0x78ca('0x2')](_0x24f861,_0x78ca('0x3'));}function History(_0x1f28a1){this['uniqueid']=_0x1f28a1['uniqueid'];this['scheduledat']=_0x1f28a1[_0x78ca('0x4')]||undefined;this[_0x78ca('0x5')]=_0x1f28a1['type'];this[_0x78ca('0x6')]=_0x1f28a1[_0x78ca('0x5')]===_0x78ca('0x7')?_0x78ca('0x8'):_0x1f28a1[_0x78ca('0x5')];this[_0x78ca('0x9')]=_0x1f28a1[_0x78ca('0x9')];this[_0x78ca('0xa')]=_0x1f28a1[_0x78ca('0xa')];this[_0x78ca('0xb')]=_0x1f28a1['countnoanswerretry'];this['countglobal']=_0x1f28a1[_0x78ca('0x9')]+_0x1f28a1[_0x78ca('0xa')]+_0x1f28a1[_0x78ca('0xb')]+_0x1f28a1[_0x78ca('0xc')]+_0x1f28a1['countdropretry']+_0x1f28a1['countabandonedretry']+_0x1f28a1['countmachineretry']+_0x1f28a1[_0x78ca('0xd')];this[_0x78ca('0xc')]=_0x1f28a1[_0x78ca('0xc')];this[_0x78ca('0xe')]=_0x1f28a1[_0x78ca('0xe')];this[_0x78ca('0xf')]=_0x1f28a1[_0x78ca('0xf')];this[_0x78ca('0x10')]=_0x1f28a1['countmachineretry'];this[_0x78ca('0xd')]=_0x1f28a1[_0x78ca('0xd')];this[_0x78ca('0x8')]=_0x1f28a1[_0x78ca('0x8')];this['calleridname']=_0x1f28a1[_0x78ca('0x11')];this[_0x78ca('0x12')]=_0x1f28a1[_0x78ca('0x13')];this[_0x78ca('0x14')]=_0x1f28a1[_0x78ca('0x14')];this[_0x78ca('0x15')]=_0x1f28a1['responsetime'];this[_0x78ca('0x16')]=_0x1f28a1['responsetime'];this[_0x78ca('0x17')]=getSeconds(_0x1f28a1[_0x78ca('0x15')],_0x1f28a1[_0x78ca('0x14')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x78ca('0x18')]=_0x1f28a1[_0x78ca('0x18')];this[_0x78ca('0x19')]=_0x1f28a1[_0x78ca('0x19')];this[_0x78ca('0x1a')]=_0x1f28a1[_0x78ca('0x1a')];this['recallme']=_0x1f28a1[_0x78ca('0x1b')];this[_0x78ca('0x1c')]=_0x1f28a1[_0x78ca('0x1c')];this[_0x78ca('0x1d')]=_0x1f28a1['ListId'];this[_0x78ca('0x1e')]=_0x1f28a1[_0x78ca('0x1e')];this[_0x78ca('0x1f')]=_0x1f28a1['VoiceQueueId'];this[_0x78ca('0x20')]=_0x1f28a1[_0x78ca('0x20')];this[_0x78ca('0x21')]=_0x1f28a1[_0x78ca('0x21')]||'';this[_0x78ca('0x22')]=_0x1f28a1[_0x78ca('0x22')]||'';}module['exports']=History; \ No newline at end of file +var _0xa226=['countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x5677b1,_0x4cfe89){var _0x3324e5=function(_0x39fe8e){while(--_0x39fe8e){_0x5677b1['push'](_0x5677b1['shift']());}};_0x3324e5(++_0x4cfe89);}(_0xa226,0x13d));var _0x6a22=function(_0x2b8f9f,_0x4ba01e){_0x2b8f9f=_0x2b8f9f-0x0;var _0x4df414=_0xa226[_0x2b8f9f];return _0x4df414;};'use strict';var util=require(_0x6a22('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x10d4bc,_0xd069c8){var _0x3b29f1=moment(_0x10d4bc)[_0x6a22('0x1')](0x0);var _0x141eff=moment(_0xd069c8)[_0x6a22('0x1')](0x0);return _0x3b29f1[_0x6a22('0x2')](_0x141eff,_0x6a22('0x3'));}function History(_0xe0ec53){this[_0x6a22('0x4')]=_0xe0ec53['uniqueid'];this['scheduledat']=_0xe0ec53['scheduledat']||undefined;this[_0x6a22('0x5')]=_0xe0ec53[_0x6a22('0x5')];this[_0x6a22('0x6')]=_0xe0ec53[_0x6a22('0x5')]===_0x6a22('0x7')?_0x6a22('0x8'):_0xe0ec53[_0x6a22('0x5')];this[_0x6a22('0x9')]=_0xe0ec53['countbusyretry'];this['countcongestionretry']=_0xe0ec53['countcongestionretry'];this[_0x6a22('0xa')]=_0xe0ec53[_0x6a22('0xa')];this[_0x6a22('0xb')]=_0xe0ec53[_0x6a22('0x9')]+_0xe0ec53['countcongestionretry']+_0xe0ec53[_0x6a22('0xa')]+_0xe0ec53[_0x6a22('0xc')]+_0xe0ec53[_0x6a22('0xd')]+_0xe0ec53[_0x6a22('0xe')]+_0xe0ec53[_0x6a22('0xf')]+_0xe0ec53[_0x6a22('0x10')];this[_0x6a22('0xc')]=_0xe0ec53[_0x6a22('0xc')];this['countdropretry']=_0xe0ec53['countdropretry'];this['countabandonedretry']=_0xe0ec53[_0x6a22('0xe')];this[_0x6a22('0xf')]=_0xe0ec53[_0x6a22('0xf')];this[_0x6a22('0x10')]=_0xe0ec53['countagentrejectretry'];this[_0x6a22('0x8')]=_0xe0ec53['queue'];this[_0x6a22('0x11')]=_0xe0ec53[_0x6a22('0x12')];this[_0x6a22('0x13')]=_0xe0ec53[_0x6a22('0x14')];this[_0x6a22('0x15')]=_0xe0ec53[_0x6a22('0x15')];this['responsetime']=_0xe0ec53[_0x6a22('0x16')];this['endtime']=_0xe0ec53[_0x6a22('0x16')];this['ringtime']=getSeconds(_0xe0ec53['responsetime'],_0xe0ec53['starttime']);this[_0x6a22('0x17')]=0x0;this[_0x6a22('0x18')]=0x0;this[_0x6a22('0x19')]=_0xe0ec53['callback'];this[_0x6a22('0x1a')]=_0xe0ec53[_0x6a22('0x1a')];this[_0x6a22('0x1b')]=_0xe0ec53[_0x6a22('0x1b')];this[_0x6a22('0x1c')]=_0xe0ec53[_0x6a22('0x1c')];this['ContactId']=_0xe0ec53[_0x6a22('0x1d')];this[_0x6a22('0x1e')]=_0xe0ec53[_0x6a22('0x1e')];this[_0x6a22('0x1f')]=_0xe0ec53[_0x6a22('0x1f')];this[_0x6a22('0x20')]=_0xe0ec53[_0x6a22('0x20')];this[_0x6a22('0x21')]=_0xe0ec53[_0x6a22('0x21')];this[_0x6a22('0x22')]=_0xe0ec53[_0x6a22('0x22')]||'';this['originatecalleridname']=_0xe0ec53[_0x6a22('0x23')]||'';}module[_0x6a22('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 0d43e49..5ebfc4b 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 _0xfa12=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','format','voice_queue:save','ivr','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','uniqueId','[actions]','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','resolve','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','trunks','SIP/%s','reachable','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerCallsDay','state','statedesc','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','dialAMDActive','[syncHangupInAMDIvr][createHistory]','countglobal','dialGlobalMaxRetry','dialMachineMaxRetry','[syncHangupIvr]','AGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','actionid','locked','stateinterface','rrmemory','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','interval','content','indexOf','iftime\x20%s,%s','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','booked','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalHitRate','abandonmentRate','[CatchErlangB]','predictiveIntervalPauses','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','Contact.phone','[actionOriginatePredictive]\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error','m\x20=\x20','Ts\x20=\x20','[abandonmentRate]','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','seconds','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay'];(function(_0x134991,_0x2a0072){var _0x47765b=function(_0x239145){while(--_0x239145){_0x134991['push'](_0x134991['shift']());}};_0x47765b(++_0x2a0072);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x64411,_0x2dd485){_0x64411=_0x64411-0x0;var _0x19c7fe=_0xfa12[_0x64411];return _0x19c7fe;};'use strict';var util=require(_0x2fa1('0x0'));var _=require(_0x2fa1('0x1'));var BPromise=require('bluebird');var uuid=require(_0x2fa1('0x2'));var moment=require(_0x2fa1('0x3'));var rr=require('rr');var md5=require(_0x2fa1('0x4'));var Redis=require(_0x2fa1('0x5'));var ut=require('../preview/util/util');var config=require(_0x2fa1('0x6'));var logger=require(_0x2fa1('0x7'))(_0x2fa1('0x8'));var loggerBooked=require(_0x2fa1('0x7'))('booked');var loggerPredictive=require(_0x2fa1('0x7'))(_0x2fa1('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x2fa1('0xa'));var loggerSyncQueueSummary=require(_0x2fa1('0x7'))(_0x2fa1('0xb'));var ami=require(_0x2fa1('0xc'));config['redis']=_[_0x2fa1('0xd')](config[_0x2fa1('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x2fa1('0xf'))(new Redis(config[_0x2fa1('0xe')]));var cmHopper=require(_0x2fa1('0x10'));var cmHopperHistory=require(_0x2fa1('0x11'));var cmHopperBlack=require(_0x2fa1('0x12'));var voiceQueueRt=require(_0x2fa1('0x13'));var Action=require(_0x2fa1('0x14'));var History=require(_0x2fa1('0x15'));var Final=require('./final');var AgentComplete=require(_0x2fa1('0x16'));var QueueCallerAbandon=require(_0x2fa1('0x17'));var Hangup=require(_0x2fa1('0x18'));var ipAgi=process[_0x2fa1('0x19')][_0x2fa1('0x1a')]||_0x2fa1('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':_0x2fa1('0x1c')};var Sequence=function(){};Sequence[_0x2fa1('0x1d')][_0x2fa1('0x1e')]=function(_0x20c559){this['tail']=this[_0x2fa1('0x1f')]?this[_0x2fa1('0x1f')]['finally'](_0x20c559):_0x20c559();};function Dialer(_0x3f41f3,_0x328712){this[_0x2fa1('0x20')]=new Sequence();this[_0x2fa1('0x21')]=_0x328712;this[_0x2fa1('0x22')]=_0x3f41f3[_0x2fa1('0x22')];this[_0x2fa1('0x23')]=_0x3f41f3[_0x2fa1('0x23')];this['agents']=_0x3f41f3[_0x2fa1('0x24')];this['trunks']=_0x3f41f3['trunks'];this[_0x2fa1('0x25')]=config[_0x2fa1('0x25')]||0x2;this[_0x2fa1('0x26')]={};this[_0x2fa1('0x27')]={};this[_0x2fa1('0x28')]={};this['uniqueId']={};this[_0x2fa1('0x29')]={};this['startPredictive']={};this[_0x2fa1('0x2a')]={};this[_0x2fa1('0x2b')]={};this[_0x2fa1('0x2c')]={};this[_0x2fa1('0x2d')]={};ami['on'](_0x2fa1('0x2e'),this[_0x2fa1('0x2f')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x31'),this[_0x2fa1('0x32')][_0x2fa1('0x30')](this));ami['on']('originateresponse',this[_0x2fa1('0x33')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x2fa1('0x30')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x34'),this[_0x2fa1('0x35')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x36'),this[_0x2fa1('0x37')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x38'),this[_0x2fa1('0x39')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x3a'),this[_0x2fa1('0x3b')][_0x2fa1('0x30')](this));ami['on'](_0x2fa1('0x3c'),this[_0x2fa1('0x3d')][_0x2fa1('0x30')](this));this[_0x2fa1('0x3e')]();this[_0x2fa1('0x3f')]();}function isNotNull(_0x5f41d1){return _0x5f41d1!==null&&!_[_0x2fa1('0x40')](_0x5f41d1);}function checkIsLoggedIn(_0x1860a0,_0x4bf6b5){return function(){if(_0x4bf6b5<=0x0){_0x1860a0[_0x2fa1('0x41')]=_0x2fa1('0x42');throw _0x1860a0[_0x2fa1('0x43')]+_0x2fa1('0x44');}};}function isActive(_0x22d992){return _0x22d992;}function checkIsActive(_0x4d82e3,_0x2b4a68){return function(){if(!isActive(_0x2b4a68)){_0x4d82e3[_0x2fa1('0x41')]=_0x2fa1('0x45');throw _0x4d82e3[_0x2fa1('0x43')]+'\x20NOT\x20Active';}};}function checkInterval(_0x1eb469){return function(){if(!isNotNull(_0x1eb469[_0x2fa1('0x46')])){_0x1eb469['message']=_0x2fa1('0x47');throw _0x1eb469['name']+_0x2fa1('0x48');}if(!isNotNull(_0x1eb469[_0x2fa1('0x46')][_0x2fa1('0x49')])){_0x1eb469[_0x2fa1('0x41')]=_0x2fa1('0x47');throw _0x1eb469[_0x2fa1('0x43')]+_0x2fa1('0x48');}if(!isNotNull(_[_0x2fa1('0x4a')](_0x1eb469['Interval'][_0x2fa1('0x49')]))){_0x1eb469[_0x2fa1('0x41')]='INTERVAL_IS_NULL';throw _0x1eb469[_0x2fa1('0x43')]+_0x2fa1('0x48');}};}function msgResponse(_0x15cf1b,_0x227880,_0x18b8cd){return{'action':_0x15cf1b,'response':_0x227880,'message':_0x18b8cd,'stack':_0x18b8cd};}function myreject(_0x39ca6f){return function(_0x1e8177){return _0x39ca6f(msgResponse(_0x2fa1('0x4b'),'Error',JSON['stringify'](_0x1e8177)));};}function getSeconds(_0x50cfee,_0x3f27b5){var _0x4663ff=moment(_0x50cfee)['milliseconds'](0x0);var _0x5802fc=moment(_0x3f27b5)[_0x2fa1('0x4c')](0x0);return _0x4663ff['diff'](_0x5802fc,_0x2fa1('0x4d'));}function emit(_0x4bf096,_0x17eeb5,_0x3b9585){io['to'](_0x4bf096)[_0x2fa1('0x4e')](_0x17eeb5,_0x3b9585);}function emitVoiceQueueSummary(_0x1b129a){if(_0x1b129a['type']==='outbound'){var _0x15c7d7={'id':_0x1b129a['id'],'name':_0x1b129a[_0x2fa1('0x43')],'strategy':_0x1b129a[_0x2fa1('0x4f')],'answered':_0x1b129a[_0x2fa1('0x50')],'available':_0x1b129a[_0x2fa1('0x51')],'loggedIn':_0x1b129a[_0x2fa1('0x52')],'pTalking':_0x1b129a[_0x2fa1('0x53')],'sumBillable':_0x1b129a[_0x2fa1('0x54')],'sumDuration':_0x1b129a['sumDuration'],'sumHoldTime':_0x1b129a[_0x2fa1('0x55')]||0x0,'talking':_0x1b129a[_0x2fa1('0x56')],'total':_0x1b129a['total'],'type':_0x1b129a[_0x2fa1('0x57')],'unmanaged':_0x1b129a[_0x2fa1('0x58')],'abandoned':_0x1b129a[_0x2fa1('0x59')],'waiting':_0x1b129a[_0x2fa1('0x5a')],'loggedInDb':_0x1b129a[_0x2fa1('0x5b')],'dialActive':_0x1b129a[_0x2fa1('0x5c')],'dialMethod':_0x1b129a[_0x2fa1('0x5d')],'dialOriginateCallerIdName':_0x1b129a['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1b129a[_0x2fa1('0x5e')],'dialOriginateTimeout':_0x1b129a[_0x2fa1('0x5f')],'dialPrefix':_0x1b129a[_0x2fa1('0x60')],'outboundAnswerAgiCallsDay':_0x1b129a[_0x2fa1('0x61')],'outboundAnswerCallsDay':_0x1b129a['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1b129a[_0x2fa1('0x62')],'outboundBusyCallsDay':_0x1b129a[_0x2fa1('0x63')],'outboundCongestionCallsDay':_0x1b129a[_0x2fa1('0x64')],'outboundDropCallsDayACS':_0x1b129a[_0x2fa1('0x65')],'outboundDropCallsDayCallersExit':_0x1b129a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1b129a[_0x2fa1('0x66')],'outboundNoAnswerCallsDay':_0x1b129a[_0x2fa1('0x67')],'outboundNoSuchCallsDay':_0x1b129a[_0x2fa1('0x68')],'outboundOriginateFailureCallsDay':_0x1b129a[_0x2fa1('0x69')],'outboundReCallsDay':_0x1b129a[_0x2fa1('0x6a')],'outboundRejectCallsDay':_0x1b129a[_0x2fa1('0x6b')],'outboundUnknownCallsDay':_0x1b129a[_0x2fa1('0x6c')],'predictiveIntervalAnsweredCalls':_0x1b129a[_0x2fa1('0x6d')],'predictiveIntervalAvgHoldtime':_0x1b129a[_0x2fa1('0x6e')],'predictiveIntervalAvgTalktime':_0x1b129a[_0x2fa1('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x1b129a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1b129a['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1b129a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1b129a[_0x2fa1('0x70')],'predictiveIntervalHitRate':_0x1b129a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1b129a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1b129a['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1b129a[_0x2fa1('0x71')],'predictiveIntervalTotalCalls':_0x1b129a[_0x2fa1('0x72')],'message':_0x1b129a[_0x2fa1('0x41')],'originated':_0x1b129a[_0x2fa1('0x73')],'erlangCalls':_0x1b129a['erlangCalls'],'erlangCallToSecond':_0x1b129a[_0x2fa1('0x74')],'erlangAbandonmentRate':_0x1b129a[_0x2fa1('0x75')],'erlangBusyFactor':_0x1b129a[_0x2fa1('0x76')],'startPredictive':_0x1b129a[_0x2fa1('0x77')],'startProgressive':_0x1b129a[_0x2fa1('0x2a')]};if(_0x1b129a[_0x2fa1('0x78')]){_0x15c7d7[_0x2fa1('0x78')]={'id':_0x1b129a[_0x2fa1('0x78')]['id'],'name':_0x1b129a[_0x2fa1('0x78')][_0x2fa1('0x43')],'active':_0x1b129a['Trunk'][_0x2fa1('0x79')],'callerid':_0x1b129a[_0x2fa1('0x78')][_0x2fa1('0x7a')]};}if(_0x1b129a[_0x2fa1('0x46')]){_0x15c7d7[_0x2fa1('0x46')]={'id':_0x1b129a['Interval']['id'],'name':_0x1b129a[_0x2fa1('0x46')][_0x2fa1('0x43')]};}var _0x1b8556=md5(JSON[_0x2fa1('0x7b')](_0x15c7d7));if(_0x1b129a['md5']!==_0x1b8556){_0x1b129a['md5']=_0x1b8556;emit(util[_0x2fa1('0x7c')]('voice:queue:%s',_0x15c7d7[_0x2fa1('0x43')]),_0x2fa1('0x7d'),_0x15c7d7);}}}function emitCampaignSummary(_0x1f227d){if(_0x1f227d[_0x2fa1('0x57')]===_0x2fa1('0x7e')){emit(util[_0x2fa1('0x7c')]('campaign:ivr:%s',_0x1f227d['name']),'campaign:save',_0x1f227d);}}function checkGetDataPredictive(_0x5cab79){if(isNotNull(_0x5cab79)&&!_['isEmpty'](_0x5cab79)){loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x80'));loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x81'),_0x5cab79[_0x2fa1('0x72')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5cab79['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x82'),_0x5cab79['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x83'),_0x5cab79[_0x2fa1('0x84')]);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x85'),_0x5cab79['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x86'),_0x5cab79['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x2fa1('0x87'));if(_0x5cab79[_0x2fa1('0x72')]>0x0){if(!_[_0x2fa1('0x40')](_0x5cab79['predictiveIntervalAvgTalktime'])&&_0x5cab79[_0x2fa1('0x6f')]>0x0){return!![];}loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x88'));if(!_[_0x2fa1('0x40')](_0x5cab79[_0x2fa1('0x6e')])&&_0x5cab79['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x89'));}else{loggerPredictive['info'](_0x2fa1('0x8a'));}}else{loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x8b'));}return![];}function mergeDataErlangB(_0x1baaee){return function(_0x3a9076){loggerPredictive[_0x2fa1('0x7f')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x2fa1('0x7f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a9076['erlangCalls']);loggerPredictive['info'](_0x2fa1('0x8c'),_0x3a9076['erlangCallToSecond']);loggerPredictive['info'](_0x2fa1('0x8d'),_0x3a9076[_0x2fa1('0x75')]);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x8e'),_0x3a9076[_0x2fa1('0x76')]);loggerPredictive[_0x2fa1('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a9076['erlangAbandonmentRate']);loggerPredictive['info'](_0x2fa1('0x87'));_['merge'](_0x1baaee,_0x3a9076);};}function getDiff(_0x3968a5){var _0x1fa81b=moment()[_0x2fa1('0x4c')](0x0);var _0x2f2bc0=moment(_0x3968a5)['milliseconds'](0x0);return _0x1fa81b[_0x2fa1('0x8f')](_0x2f2bc0,_0x2fa1('0x4d'));}function ifInterval(_0x4b0250,_0x9101b7){if(_[_0x2fa1('0x40')](_0x9101b7)){return![];}return getDiff(_0x9101b7)<_0x4b0250*0x3c;}function freeVariablesPredictive(_0x163145){if(isNotNull(_0x163145)){if(!_[_0x2fa1('0x40')](_0x163145['startProgressive'])){_0x163145[_0x2fa1('0x2a')]=undefined;loggerPredictive['info'](_0x163145['name'],_0x2fa1('0x90'));}if(!_[_0x2fa1('0x40')](_0x163145['startPredictive'])){_0x163145['startPredictive']=undefined;loggerPredictive['info'](_0x163145[_0x2fa1('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x163145[_0x2fa1('0x91')])){clearInterval(_0x163145[_0x2fa1('0x91')]);_0x163145[_0x2fa1('0x91')]=undefined;loggerPredictive[_0x2fa1('0x7f')](_0x163145[_0x2fa1('0x43')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0xaa354,_0x11e2fa){if(_0x11e2fa===0x0){return 0x0;}var _0x1f8911=0x1;for(var _0x2ca396=0x1;_0x2ca396<=_0x11e2fa;_0x2ca396+=0x1){_0x1f8911=0x1+_0x1f8911*_0x2ca396/_0xaa354;}return 0x1/_0x1f8911;}function isVoiceQueueOutbound(_0x4e8d81){return _0x4e8d81===_0x2fa1('0x92');}function isNotPreview(_0x175712){return _0x175712!==_0x2fa1('0x21');}function isCampaignIvr(_0x288187){return _0x288187===_0x2fa1('0x7e');}function getCallerId(_0x2a0a5d,_0x253c36,_0x3b86db){if(!_[_0x2fa1('0x40')](_0x3b86db)&&typeof _0x3b86db===_0x2fa1('0x93')&&!_['isEmpty'](_0x3b86db)){if(!_['isUndefined'](_0x253c36)&&typeof _0x253c36===_0x2fa1('0x93')&&!_[_0x2fa1('0x4a')](_0x253c36)){return util[_0x2fa1('0x7c')](_0x2fa1('0x94'),_0x253c36,_0x3b86db);}return util['format'](_0x2fa1('0x94'),_0x3b86db,_0x3b86db);}if(!_[_0x2fa1('0x40')](_0x2a0a5d)&&typeof _0x2a0a5d===_0x2fa1('0x93')&&!_['isEmpty'](_0x2a0a5d)){return _0x2a0a5d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x35b9a7,_0x4d292e){return function(_0x521fa9){freeVariablesPredictive(_0x4d292e);emitVoiceQueueSummary(_0x4d292e);emitCampaignSummary(_0x4d292e);loggerSyncQueueSummary[_0x2fa1('0x95')](_0x35b9a7,util[_0x2fa1('0x96')](_0x521fa9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2b4088,_0x295a28){return function(_0x4f6ded){loggerPredictive[_0x2fa1('0x95')](_0x295a28['name'],_0x2b4088);loggerPredictive['error'](_0x4f6ded[_0x2fa1('0x97')]);freeVariablesPredictive(_0x295a28);};}function loggerCatch(_0x4e62a8){return function(_0x35dbd3){logger[_0x2fa1('0x95')](_0x4e62a8,util['inspect'](_0x35dbd3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xbf42ab){return _0xbf42ab&&!_[_0x2fa1('0x40')](_0xbf42ab)&&_0xbf42ab[_0x2fa1('0x98')]>0x0;}function decremetOriginate(_0x4fad8a){if(!_['isUndefined'](_0x4fad8a)&&_0x4fad8a!==null){if(typeof _0x4fad8a[_0x2fa1('0x73')]!=='undefined'){if(_0x4fad8a[_0x2fa1('0x73')]>0x0){_0x4fad8a[_0x2fa1('0x73')]-=0x1;}else{logger['error'](_0x2fa1('0x99'));}}}else{logger[_0x2fa1('0x95')](_0x2fa1('0x9a'));}}function checkContactLowerLimitOriginate(_0x35b680,_0x18d16d,_0x2db33c){if(_0x18d16d>_0x2db33c){for(var _0x2dc426=0x0;_0x2dc426<_0x18d16d-_0x2db33c;_0x2dc426+=0x1){decremetOriginate(_0x35b680);}}}function loggerGetContactDialer(_0x50441f,_0x456cd2,_0x175973){return function(_0x1c39c8){checkContactLowerLimitOriginate(_0x456cd2,_0x175973,0x0);logger[_0x2fa1('0x95')](_0x50441f,util['inspect'](_0x1c39c8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a0863){return function(_0x469b71){if(isNotNull(_0x469b71)&&isNotNull(_0x469b71[0x0])){if(_0x469b71[0x0][_0x2fa1('0x9b')]>0x0){_0x1a0863[_0x2fa1('0x41')]=_0x2fa1('0x9c');logger[_0x2fa1('0x7f')]('[getContactDialer2][ReScheduled]'+_0x1a0863[_0x2fa1('0x43')],_0x469b71[0x0]['contactsRescheduled'],_0x2fa1('0x9d'));}else{_0x1a0863[_0x2fa1('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x2fa1('0x7f')](_0x2fa1('0x9e')+_0x1a0863[_0x2fa1('0x43')]);}}};}function notSendMessagesQueue(_0x1b58de){if(_0x1b58de[_0x2fa1('0x9f')]){freeVariablesPredictive(_0x1b58de);if(_0x1b58de[_0x2fa1('0x73')]===0x0&&_0x1b58de[_0x2fa1('0x56')]===0x0&&_0x1b58de[_0x2fa1('0x5a')]===0x0&&(_0x1b58de['pTalking']||0x0)===0x0){_0x1b58de[_0x2fa1('0x9f')]=![];_0x1b58de[_0x2fa1('0x51')]=0x0;_0x1b58de['message']=_0x2fa1('0x45');loggerSyncQueueSummary[_0x2fa1('0x95')](_0x2fa1('0xa0'),_0x1b58de[_0x2fa1('0x43')],_0x2fa1('0xa1'));}else{_0x1b58de['message']=_0x2fa1('0xa2');loggerSyncQueueSummary['error'](_0x2fa1('0xa0'),_0x1b58de[_0x2fa1('0x43')],_0x2fa1('0xa3'));}emitVoiceQueueSummary(_0x1b58de);}}function notSendMessagesCampaign(_0x3ebb7b){if(_0x3ebb7b[_0x2fa1('0x9f')]){if(_0x3ebb7b[_0x2fa1('0x73')]===0x0){_0x3ebb7b['sendMessageOneNotActive']=![];_0x3ebb7b[_0x2fa1('0x41')]=_0x2fa1('0x45');loggerSyncQueueSummary[_0x2fa1('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3ebb7b[_0x2fa1('0x43')],_0x2fa1('0xa1'));}else{_0x3ebb7b[_0x2fa1('0x41')]=_0x2fa1('0xa2');loggerSyncQueueSummary[_0x2fa1('0x95')](_0x2fa1('0xa4'),_0x3ebb7b[_0x2fa1('0x43')],_0x2fa1('0xa3'));}emitCampaignSummary(_0x3ebb7b);}}function createObjHistory(_0x57479b,_0x5012e5,_0xcd060c,_0x4e100f,_0x92deb9){_0x57479b['message']=_0xcd060c;var _0x2ba1f5=new Action(_0x57479b,_0x5012e5);var _0x3dc0be=new History(_0x2ba1f5);_0x3dc0be['state']=_0x4e100f;_0x3dc0be['statedesc']=_0x92deb9;_0x3dc0be[_0x2fa1('0xa5')]=_0x2ba1f5[_0x2fa1('0xa6')];return _0x3dc0be;}Dialer['prototype'][_0x2fa1('0x3f')]=function(){var _0x7a1a2b=this;setInterval(function(){_0x7a1a2b[_0x2fa1('0xa7')](_0x7a1a2b[_0x2fa1('0xa8')],'[uniqueid]');_0x7a1a2b['clearZombieChannels'](_0x7a1a2b[_0x2fa1('0x27')],_0x2fa1('0xa9'));},0x32c8);};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xa7')]=function(_0x579ccb,_0x49ad67){var _0x5d6dfd=this;for(var _0x1e156b in _0x579ccb){if(typeof _0x579ccb[_0x1e156b]!=='undefined'){this[_0x2fa1('0x20')][_0x2fa1('0x1e')](function(){if(!_['isNil'](_0x579ccb[_0x1e156b])){return ami[_0x2fa1('0xaa')]({'action':_0x2fa1('0xab'),'channel':_0x579ccb[_0x1e156b][_0x2fa1('0xac')]})[_0x2fa1('0xad')](function(_0xe76580){if(_0xe76580[_0x2fa1('0x41')]===_0x2fa1('0xae')){setTimeout(function(){if(_0x579ccb[_0x1e156b]&&_0x579ccb[_0x1e156b][_0x2fa1('0x57')]!==_0x2fa1('0x7e')){_0x5d6dfd[_0x2fa1('0xaf')](_0x5d6dfd[_0x2fa1('0x22')][_0x579ccb[_0x1e156b][_0x2fa1('0xb0')]]);logger[_0x2fa1('0x95')](_0x2fa1('0xb1'),_0x49ad67,_0x1e156b,_0x579ccb[_0x1e156b]['queue']);delete _0x579ccb[_0x1e156b];}if(_0x579ccb[_0x1e156b]&&_0x579ccb[_0x1e156b][_0x2fa1('0x57')]===_0x2fa1('0x7e')){_0x5d6dfd[_0x2fa1('0xaf')](_0x5d6dfd['campaigns'][_0x579ccb[_0x1e156b]['queue']]);logger[_0x2fa1('0x95')]('[Dialer][checkChannel][ivr]',_0x49ad67,_0x1e156b,_0x579ccb[_0x1e156b][_0x2fa1('0xb0')]);delete _0x579ccb[_0x1e156b];}},0x2328);}});}});}}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xb2')]=function(_0x274709){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xb2')](_0x274709))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x2fa1('0x1d')]['checkIsBlackList']=function(_0x3d5cd4){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopperBlack[_0x2fa1('0xb4')](_0x3d5cd4))['catch'](loggerCatch(_0x2fa1('0xb5')));};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xb6')]=function(_0x194d9b){return BPromise['resolve']()['then'](cmHopperBlack[_0x2fa1('0xb6')](_0x194d9b))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xb7')));};Dialer['prototype'][_0x2fa1('0xb8')]=function(_0x43aada){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopperHistory['avgHandleTime'](_0x43aada))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xb9')));};Dialer['prototype'][_0x2fa1('0xba')]=function(_0x4871fb){return BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xba')](_0x4871fb))[_0x2fa1('0xad')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x4b6ba2,_0x582db4,_0x5c919d){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xbc')](_0x4b6ba2,_0x582db4,_0x5c919d))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xbd')));};Dialer['prototype'][_0x2fa1('0xbe')]=function(_0x1bdf48,_0x8a2912,_0x26a2bb,_0x473ac6,_0x56c33e){return BPromise[_0x2fa1('0xbb')]()['then'](cmHopper[_0x2fa1('0xbe')](_0x1bdf48,_0x8a2912,_0x26a2bb,_0x473ac6))[_0x2fa1('0xad')](function(_0x3ad1d6){_0x56c33e[_0x2fa1('0xbf')]-=_0x26a2bb;_0x56c33e[_0x2fa1('0xbf')]=_0x56c33e['temp']>0x0?_0x56c33e['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x3ad1d6);});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xc0')]=function(_0x30af80,_0x593fad,_0x32f969,_0x19510c){return BPromise['resolve']()['then'](cmHopper[_0x2fa1('0xc0')](_0x30af80,_0x593fad,_0x32f969))[_0x2fa1('0xad')](function(_0x3e9340){_0x19510c[_0x2fa1('0xbf')]-=_0x593fad;_0x19510c['temp']=_0x19510c[_0x2fa1('0xbf')]>0x0?_0x19510c['temp']:0x0;loggerCatch(_0x2fa1('0xc1'))(_0x3e9340);});};Dialer['prototype'][_0x2fa1('0xc2')]=function(_0x79add5){return BPromise['resolve']()[_0x2fa1('0xb3')](voiceQueueRt[_0x2fa1('0xc2')](_0x79add5))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0xc3')));};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xc4')]=function(_0x5875df){return BPromise['resolve']()[_0x2fa1('0xb3')](cmHopper[_0x2fa1('0xc4')](_0x5875df))['catch'](loggerCatch(_0x2fa1('0xc5')));};Dialer[_0x2fa1('0x1d')]['createHistory']=function(_0x3c8d9c){return BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](cmHopperHistory[_0x2fa1('0xc6')](_0x3c8d9c))['catch'](loggerCatch(_0x2fa1('0xc7')));};Dialer[_0x2fa1('0x1d')]['updateOriginated']=function(_0x15f171){if(!_[_0x2fa1('0x40')](_0x15f171)&&_0x15f171!==null){if(typeof _0x15f171['originated']!==_0x2fa1('0xc8')){if(_0x15f171[_0x2fa1('0x73')]>0x0){_0x15f171[_0x2fa1('0x73')]-=0x1;}else{logger[_0x2fa1('0x95')](_0x2fa1('0xc9'));}}}else{logger[_0x2fa1('0x95')](_0x2fa1('0xca'));}};Dialer['prototype']['loggerHandler']=function(_0x1e50c7,_0x4348f5){var _0x300740=this;return function(_0x3e8c84){_0x300740[_0x2fa1('0xaf')](_0x4348f5);logger[_0x2fa1('0x95')](_0x1e50c7,util[_0x2fa1('0x96')](_0x3e8c84,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x2fa1('0xcb')]=function(_0x1b1ddb,_0x165fc6,_0x584e2d){var _0x36bebf={'state':0x19,'statedesc':_0x2fa1('0xcc')};this['updateOriginated'](_0x165fc6);this[_0x2fa1('0xcd')](_[_0x2fa1('0xce')](_0x36bebf,_[_0x2fa1('0xcf')](_0x584e2d,[_0x2fa1('0xd0'),_0x2fa1('0xd1'),_0x2fa1('0xd2'),_0x2fa1('0xd3'),_0x2fa1('0xd4')])),_0x2fa1('0xd5'),_0x2fa1('0xd6'));logger[_0x2fa1('0x95')](_0x1b1ddb);};Dialer[_0x2fa1('0x1d')]['isSuccess']=function(_0xb4e7af){return _0xb4e7af===_0x2fa1('0xd7');};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xd8')]=function(_0x464321){return!_[_0x2fa1('0x40')](_0x464321)&&_0x464321&&!_[_0x2fa1('0x40')](_0x464321[_0x2fa1('0x43')])&&!_[_0x2fa1('0x40')](_0x464321[_0x2fa1('0x79')])&&_0x464321[_0x2fa1('0x79')]&&(this[_0x2fa1('0xd9')][util[_0x2fa1('0x7c')](_0x2fa1('0xda'),_0x464321['name'])]['status']===_0x2fa1('0xdb')||this['trunks'][util[_0x2fa1('0x7c')]('SIP/%s',_0x464321[_0x2fa1('0x43')])][_0x2fa1('0xab')]==='unmonitored');};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xcd')]=function(_0x461761,_0x25aa78,_0x4d46f6){this['createHistory'](_0x461761)[_0x2fa1('0xad')](loggerCatch(_0x25aa78));this[_0x2fa1('0xc4')](_0x461761)[_0x2fa1('0xad')](loggerCatch(_0x4d46f6));};Dialer['prototype'][_0x2fa1('0x39')]=function(_0xf21049){var _0x5ee20d=this[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];var _0x447211;if(!_['isNil'](_0xf21049)&&!_[_0x2fa1('0xdd')](_0xf21049[_0x2fa1('0xde')])&&!_[_0x2fa1('0xdd')](_0xf21049[_0x2fa1('0xde')][_0x2fa1('0xdf')])&&_0xf21049[_0x2fa1('0xe0')]===_0x2fa1('0xe1')&&_0x5ee20d){if(_0x5ee20d[_0x2fa1('0x57')]!==_0x2fa1('0x7e')&&this['voiceQueues'][_0x5ee20d[_0x2fa1('0xb0')]]['dialAMDActive']&&_0xf21049[_0x2fa1('0xe2')]===_0x2fa1('0xe3')){delete this[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]]);this[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0xe4')]+=0x1;this[_0x2fa1('0x22')][_0x5ee20d['queue']][_0x2fa1('0x61')]+=0x1;_0x447211=new Hangup(_0x5ee20d,_0xf21049);_0x447211[_0x2fa1('0xe5')]=0x12;_0x447211[_0x2fa1('0xe6')]=_0x2fa1('0xe7');_0x447211['membername']=_0x2fa1('0xe8');ami[_0x2fa1('0x4e')](_0x2fa1('0xe9'),ut[_0x2fa1('0xea')](_0x447211,_0x2fa1('0xeb')));this[_0x2fa1('0xcd')](_0x447211,_0x2fa1('0xec'),_0x2fa1('0xed'));}if(_0x5ee20d[_0x2fa1('0x57')]!==_0x2fa1('0x7e')&&this[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]]['dialAMDActive']&&_0xf21049[_0x2fa1('0xe2')]===_0x2fa1('0xee')){var _0x5d2ae6=this;return new BPromise(function(_0x190a18,_0x34bbb6){delete _0x5d2ae6[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];_0x5d2ae6['updateOriginated'](_0x5d2ae6['voiceQueues'][_0x5ee20d[_0x2fa1('0xb0')]]);_0x5d2ae6[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0xe4')]+=0x1;_0x5d2ae6[_0x2fa1('0x22')][_0x5ee20d['queue']][_0x2fa1('0x61')]+=0x1;var _0x22dd29=_0x5d2ae6[_0x2fa1('0x22')][_0x5ee20d[_0x2fa1('0xb0')]];var _0x28d67b=new Hangup(_0x5ee20d,_0xf21049);_0x28d67b[_0x2fa1('0xe5')]=0x13;_0x28d67b[_0x2fa1('0xe6')]=_0x2fa1('0xef');_0x28d67b[_0x2fa1('0xf0')]=_0x2fa1('0xe8');_0x28d67b[_0x2fa1('0xf1')]+=0x1;_0x28d67b['countglobal']+=0x1;_0x28d67b[_0x2fa1('0xeb')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0x28d67b,_0x2fa1('0xeb')));_0x5d2ae6[_0x2fa1('0xc6')](_0x28d67b)['catch'](loggerCatch(_0x2fa1('0xf2')));if(_0x28d67b[_0x2fa1('0xf3')]+_0x28d67b[_0x2fa1('0xf4')]+_0x28d67b[_0x2fa1('0xf5')]+_0x28d67b[_0x2fa1('0xf6')]+_0x28d67b['countdropretry']+_0x28d67b[_0x2fa1('0xf7')]+_0x28d67b[_0x2fa1('0xf1')]+_0x28d67b[_0x2fa1('0xf8')]>=_0x22dd29['dialGlobalMaxRetry']){_0x5d2ae6[_0x2fa1('0xf9')](_0x28d67b,_0x190a18,_0x34bbb6,_0x2fa1('0xfa'));}else{if(_0x28d67b['countmachineretry']>=_0x22dd29['dialMachineMaxRetry']){_0x5d2ae6[_0x2fa1('0xfb')](_0x28d67b,_0x190a18,_0x34bbb6,_0x2fa1('0xfc'));}else{_0x5d2ae6['rescheduleContact']({'active':![],'countmachineretry':_0x28d67b[_0x2fa1('0xf1')],'scheduledat':moment()[_0x2fa1('0xfd')](_0x22dd29['dialMachineRetryFrequency'],_0x2fa1('0xfe'))['format'](_0x2fa1('0xff')),'ContactId':_0x28d67b[_0x2fa1('0xd0')],'ListId':_0x28d67b[_0x2fa1('0xd1')],'VoiceQueueId':_0x28d67b['VoiceQueueId']||undefined,'CampaignId':_0x28d67b['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x100')));_0x190a18({'reschedule':0x1});}}});}if(_0x5ee20d['type']===_0x2fa1('0x7e')&&this[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0x101')]&&_0xf21049['value']===_0x2fa1('0xe3')){delete this[_0x2fa1('0xa8')][_0xf21049[_0x2fa1('0xdc')]];this['updateOriginated'](this['campaigns'][_0x5ee20d[_0x2fa1('0xb0')]]);_0x447211=new Hangup(_0x5ee20d,_0xf21049);_0x447211[_0x2fa1('0xe5')]=0x12;_0x447211['statedesc']=_0x2fa1('0xe7');_0x447211[_0x2fa1('0xf0')]=_0x2fa1('0xe8');ami['emit'](_0x2fa1('0xe9'),ut[_0x2fa1('0xea')](_0x447211,_0x2fa1('0xeb')));this[_0x2fa1('0xcd')](_0x447211,_0x2fa1('0x102'),'[syncHangupInAMDIvr]');}if(_0x5ee20d[_0x2fa1('0x57')]==='ivr'&&this[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0x101')]&&_0xf21049[_0x2fa1('0xe2')]==='MACHINE'){var _0x5d2ae6=this;return new BPromise(function(_0x1f1324,_0x3a4c80){delete _0x5d2ae6[_0x2fa1('0xa8')][_0xf21049['uniqueid']];_0x5d2ae6['updateOriginated'](_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d['queue']]);_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0xe4')]+=0x1;_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]][_0x2fa1('0x61')]+=0x1;var _0x2ba616=_0x5d2ae6[_0x2fa1('0x23')][_0x5ee20d[_0x2fa1('0xb0')]];var _0x4074d4=new Hangup(_0x5ee20d,_0xf21049);_0x4074d4['state']=0x13;_0x4074d4[_0x2fa1('0xe6')]=_0x2fa1('0xef');_0x4074d4['membername']=_0x2fa1('0xe8');_0x4074d4[_0x2fa1('0xf1')]+=0x1;_0x4074d4[_0x2fa1('0x103')]+=0x1;_0x4074d4[_0x2fa1('0xeb')]=!![];ami[_0x2fa1('0x4e')](_0x2fa1('0xe9'),ut['buildObj'](_0x4074d4,'amd'));_0x5d2ae6['createHistory'](_0x4074d4)['catch'](loggerCatch(_0x2fa1('0xf2')));if(_0x4074d4[_0x2fa1('0xf3')]+_0x4074d4[_0x2fa1('0xf4')]+_0x4074d4[_0x2fa1('0xf5')]+_0x4074d4[_0x2fa1('0xf6')]+_0x4074d4['countdropretry']+_0x4074d4['countabandonedretry']+_0x4074d4[_0x2fa1('0xf1')]+_0x4074d4[_0x2fa1('0xf8')]>=_0x2ba616[_0x2fa1('0x104')]){_0x5d2ae6[_0x2fa1('0xf9')](_0x4074d4,_0x1f1324,_0x3a4c80,_0x2fa1('0xfa'));}else{if(_0x4074d4[_0x2fa1('0xf1')]>=_0x2ba616[_0x2fa1('0x105')]){_0x5d2ae6['createStateFinal'](_0x4074d4,_0x1f1324,_0x3a4c80,'reason\x2019\x20machine....');}else{_0x5d2ae6[_0x2fa1('0xba')]({'active':![],'countmachineretry':_0x4074d4[_0x2fa1('0xf1')],'scheduledat':moment()[_0x2fa1('0xfd')](_0x2ba616['dialMachineRetryFrequency'],_0x2fa1('0xfe'))['format'](_0x2fa1('0xff')),'ContactId':_0x4074d4[_0x2fa1('0xd0')],'ListId':_0x4074d4[_0x2fa1('0xd1')],'VoiceQueueId':_0x4074d4[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x4074d4[_0x2fa1('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1f1324({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x2fa1('0x35')]=function(_0x43acee){var _0x4287a9=this['uniqueId'][_0x43acee[_0x2fa1('0xdc')]];var _0x10aab4=this;var _0x4a21f0;if(_0x4287a9&&_0x4287a9[_0x2fa1('0x57')]===_0x2fa1('0x7e')){delete this[_0x2fa1('0xa8')][_0x43acee['uniqueid']];this[_0x2fa1('0xaf')](this[_0x2fa1('0x23')][_0x4287a9[_0x2fa1('0xb0')]]);this['campaigns'][_0x4287a9[_0x2fa1('0xb0')]]['ivrAnswerCallsDay']+=0x1;_0x4a21f0=new Hangup(_0x4287a9,_0x43acee);this['createHistory'](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x106')));}if(_0x4287a9&&_0x4287a9[_0x2fa1('0x57')]!=='ivr'&&isNotNull(this[_0x2fa1('0x22')][_0x4287a9['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x43acee[_0x2fa1('0xdc')]];this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x4287a9[_0x2fa1('0xb0')]]);this[_0x2fa1('0x22')][_0x4287a9['queue']][_0x2fa1('0xe4')]+=0x1;this[_0x2fa1('0x22')][_0x4287a9[_0x2fa1('0xb0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4a21f0=new Hangup(_0x4287a9,_0x43acee);_0x4a21f0[_0x2fa1('0xe5')]=0x10;_0x4a21f0[_0x2fa1('0xe6')]='AnswerAGI';_0x4a21f0[_0x2fa1('0xf0')]=_0x2fa1('0x107');this[_0x2fa1('0xc6')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x108')));this[_0x2fa1('0xc4')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x106')));}if(_0x4287a9&&_0x4287a9[_0x2fa1('0x57')]!==_0x2fa1('0x7e')&&!isNotNull(this[_0x2fa1('0x22')][_0x4287a9['queue']][_0x2fa1('0x109')])){delete this['uniqueId'][_0x43acee['uniqueid']];this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x4287a9[_0x2fa1('0xb0')]]);this[_0x2fa1('0x22')][_0x4287a9['queue']][_0x2fa1('0x6c')]+=0x1;_0x4a21f0=new Hangup(_0x4287a9,_0x43acee);_0x4a21f0[_0x2fa1('0xe5')]=0xc;_0x4a21f0[_0x2fa1('0xe6')]=_0x43acee[_0x2fa1('0x10a')];_0x4a21f0['membername']=_0x2fa1('0x10b');this[_0x2fa1('0xc6')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x108')));this[_0x2fa1('0xc4')](_0x4a21f0)[_0x2fa1('0xad')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x2fa1('0x10c')]=function(_0x24f790){var _0xde1ae2=this[_0x2fa1('0xa8')][_0x24f790[_0x2fa1('0xdc')]];var _0xc9ae1d=this;if(this[_0x2fa1('0x22')][_0x24f790[_0x2fa1('0xb0')]]){if(_0xde1ae2&&_0xde1ae2['type']!==_0x2fa1('0x7e')){delete this[_0x2fa1('0xa8')][_0x24f790[_0x2fa1('0xdc')]];this['voiceQueues'][_0x24f790[_0x2fa1('0xb0')]]['outboundAnswerCallsDay']+=0x1;var _0x2d4c3f=new AgentComplete(_0xde1ae2,_0x24f790);if(_0x24f790[_0x2fa1('0x10d')]===_0x2fa1('0x10e')){_0x2d4c3f['agiafterat']=this[_0x2fa1('0x22')][_0x24f790[_0x2fa1('0xb0')]][_0x2fa1('0x10f')]&&this[_0x2fa1('0x22')][_0x24f790[_0x2fa1('0xb0')]]['dialAgiAfterHangupAgent']?moment()[_0x2fa1('0x7c')](_0x2fa1('0xff')):undefined;}this[_0x2fa1('0xc6')](_0x2d4c3f)['catch'](loggerCatch(_0x2fa1('0x110')));this[_0x2fa1('0xc4')](_0x2d4c3f)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x111')));}}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x2f')]=function(_0x5ab677){if(this[_0x2fa1('0x22')][_0x5ab677['queue']]){if(this['uniqueId'][_0x5ab677[_0x2fa1('0xdc')]]&&this[_0x2fa1('0xa8')][_0x5ab677['uniqueid']]['type']!==_0x2fa1('0x7e')){this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][_0x5ab677[_0x2fa1('0xb0')]]);this[_0x2fa1('0xa8')][_0x5ab677['uniqueid']][_0x2fa1('0x112')]=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x2fa1('0x113')]=function(_0x56f0ad){this[_0x2fa1('0xc6')](_0x56f0ad)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x110')));this['moveContactManagedDialer'](_0x56f0ad)['catch'](loggerCatch(_0x2fa1('0x114')));};Dialer['prototype'][_0x2fa1('0x32')]=function(_0x28deaa){var _0x3ff658=this[_0x2fa1('0xa8')][_0x28deaa[_0x2fa1('0xdc')]];var _0x11eaee=this;if(this[_0x2fa1('0x22')][_0x28deaa['queue']]){if(_0x3ff658&&_0x3ff658[_0x2fa1('0x57')]!=='ivr'){delete this[_0x2fa1('0xa8')][_0x28deaa['uniqueid']];this['updateOriginated'](this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]]);_0x3ff658['droptime']=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));var _0x3b870c=new QueueCallerAbandon(_0x3ff658,_0x28deaa);if(getSeconds(_0x3ff658[_0x2fa1('0x115')],_0x3ff658[_0x2fa1('0x116')])>=_0x3ff658['dialQueueTimeout']){this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x117')]+=0x1;this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x70')]+=0x1;_0x3b870c['state']=0xa;_0x3b870c[_0x2fa1('0xe6')]=_0x2fa1('0x118');_0x3b870c[_0x2fa1('0x119')]=_0x2fa1('0x11a');_0x3b870c[_0x2fa1('0x11b')]=this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]]['dialQueueProject2']?moment()[_0x2fa1('0x7c')](_0x2fa1('0xff')):undefined;_0x3b870c[_0x2fa1('0x11c')]+=0x1;_0x3b870c[_0x2fa1('0x103')]+=0x1;if(_0x3b870c['countdropretry']>=this['voiceQueues'][_0x28deaa['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x3b870c);}else{this[_0x2fa1('0xba')]({'active':![],'countdropretry':_0x3b870c['countdropretry'],'scheduledat':moment()[_0x2fa1('0xfd')](this['voiceQueues'][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x11d')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')](_0x2fa1('0xff')),'ContactId':_0x3ff658[_0x2fa1('0xd0')],'ListId':_0x3ff658[_0x2fa1('0xd1')],'VoiceQueueId':_0x3ff658[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x3ff658[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x11e')));var _0x3e7dfd=new History(_0x3b870c);_0x3e7dfd[_0x2fa1('0xe5')]=0xa;_0x3e7dfd[_0x2fa1('0xe6')]=_0x2fa1('0x118');_0x3e7dfd['starttime']=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e7dfd['endtime']=_0x3e7dfd[_0x2fa1('0xa6')];_0x3e7dfd[_0x2fa1('0x11f')]=_0x3b870c[_0x2fa1('0x11f')];_0x3e7dfd[_0x2fa1('0x120')]=_0x3b870c[_0x2fa1('0x120')];this[_0x2fa1('0xc6')](_0x3e7dfd)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x121')));}}else{this['voiceQueues'][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x84')]+=0x1;this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x122')]+=0x1;_0x3b870c['state']=0xb;_0x3b870c[_0x2fa1('0xe6')]=_0x2fa1('0x123');_0x3b870c[_0x2fa1('0x119')]=_0x2fa1('0x124');_0x3b870c[_0x2fa1('0xf7')]+=0x1;_0x3b870c['countglobal']+=0x1;if(_0x3b870c[_0x2fa1('0xf7')]>=this[_0x2fa1('0x22')][_0x28deaa[_0x2fa1('0xb0')]][_0x2fa1('0x125')]){this[_0x2fa1('0x113')](_0x3b870c);}else{this[_0x2fa1('0xba')]({'active':![],'countabandonedretry':_0x3b870c[_0x2fa1('0xf7')],'scheduledat':moment()[_0x2fa1('0xfd')](this[_0x2fa1('0x22')][_0x28deaa['queue']]['dialAbandonedRetryFrequency'],'minutes')[_0x2fa1('0x7c')](_0x2fa1('0xff')),'ContactId':_0x3ff658[_0x2fa1('0xd0')],'ListId':_0x3ff658[_0x2fa1('0xd1')],'VoiceQueueId':_0x3ff658[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x3ff658[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x126')));var _0x3e7dfd=new History(_0x3b870c);_0x3e7dfd[_0x2fa1('0xe5')]=0xb;_0x3e7dfd['statedesc']=_0x2fa1('0x123');_0x3e7dfd[_0x2fa1('0xa6')]=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));_0x3e7dfd[_0x2fa1('0xa5')]=_0x3e7dfd[_0x2fa1('0xa6')];_0x3e7dfd[_0x2fa1('0x11f')]=_0x3b870c['calleridname'];_0x3e7dfd['calleridnum']=_0x3b870c[_0x2fa1('0x120')];this['createHistory'](_0x3e7dfd)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x37')]=function(_0x493e28){if(this[_0x2fa1('0x27')][_0x493e28[_0x2fa1('0xdc')]]){this[_0x2fa1('0x27')][_0x493e28[_0x2fa1('0xdc')]][_0x2fa1('0xac')]=_0x493e28[_0x2fa1('0xac')];}if(this[_0x2fa1('0xa8')][_0x493e28[_0x2fa1('0xdc')]]){this[_0x2fa1('0xa8')][_0x493e28[_0x2fa1('0xdc')]]['channel']=_0x493e28[_0x2fa1('0xac')];}};Dialer[_0x2fa1('0x1d')]['syncQueueMember']=function(_0x2f960f){if(strategy[this[_0x2fa1('0x22')][this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]]['queue']][_0x2fa1('0x4f')]]===_0x2fa1('0x1c')){if(this[_0x2fa1('0x27')][_0x2f960f['actionid']]&&_['isNil'](this['actions'][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0x128')])&&_0x2f960f[_0x2fa1('0xab')]==='1'&&_0x2f960f['paused']==='0'){if(this[_0x2fa1('0x24')][_0x2f960f[_0x2fa1('0x129')]]){if(!this[_0x2fa1('0x24')][_0x2f960f[_0x2fa1('0x129')]][_0x2fa1('0x128')]){this['agents'][_0x2f960f[_0x2fa1('0x129')]][_0x2fa1('0x128')]=!![];this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0x128')]=!![];this['actions'][_0x2f960f['actionid']][_0x2fa1('0x129')]=_0x2f960f['stateinterface'];}}}}else if((strategy[this[_0x2fa1('0x22')][this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x4f')]]||_0x2fa1('0x12a'))===_0x2fa1('0x12a')){if(this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]]){if(this['agents'][_0x2f960f[_0x2fa1('0x129')]]){this[_0x2fa1('0x27')][_0x2f960f['actionid']]['stateinterface']=_0x2f960f[_0x2fa1('0x129')];if(_[_0x2fa1('0xdd')](this[_0x2fa1('0x2c')][this['actions'][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]])){this['queueBooked'][this[_0x2fa1('0x27')][_0x2f960f['actionid']][_0x2fa1('0xb0')]]=[];}this['queueBooked'][this['actions'][_0x2f960f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]]['push'](_[_0x2fa1('0xce')](_[_0x2fa1('0xcf')](this[_0x2fa1('0x27')][_0x2f960f[_0x2fa1('0x127')]],[_0x2fa1('0x12b'),_0x2fa1('0x129')]),{'status':_0x2f960f[_0x2fa1('0xab')],'paused':_0x2f960f[_0x2fa1('0x12c')]}));}}}};function unlockQueueStatus(_0x3cf0ca,_0x4f0281){setTimeout(function(){if(_[_0x2fa1('0x40')](_0x3cf0ca[_0x2fa1('0x12d')])){loggerBooked[_0x2fa1('0x95')]('[unlockQueueStatus][undefined]',_0x4f0281);}_0x3cf0ca['queueStatusComplete']=!![];loggerBooked[_0x2fa1('0x7f')](_0x2fa1('0x12e'),_0x4f0281,JSON['stringify'](_[_0x2fa1('0xcf')](_0x3cf0ca,['name',_0x2fa1('0x12d')])));},0x1f3);}Dialer['prototype'][_0x2fa1('0x3d')]=function(_0x207f3f){var _0xc64e27=this;var _0x27af4e=_0xc64e27[_0x2fa1('0x22')][_0xc64e27[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]];if(strategy[this[_0x2fa1('0x22')][this['actions'][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x4f')]]===_0x2fa1('0x1c')){if(this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]&&this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['stateinterface']){this['preview']['run'](this['actions'][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0x12b')],this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0x129')])[_0x2fa1('0xad')](function(_0x3c2133){logger[_0x2fa1('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x2fa1('0x96')](_0x3c2133,{'showHidden':![],'depth':null}));})[_0x2fa1('0x12f')](function(){_0xc64e27[_0x2fa1('0xaf')](_0xc64e27[_0x2fa1('0x22')][_0xc64e27[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]]);_0xc64e27['agents'][_0xc64e27[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0x129')]]['locked']=![];delete _0xc64e27[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]];unlockQueueStatus(_0x27af4e);});}else{this[_0x2fa1('0xaf')](this[_0x2fa1('0x22')][this[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xb0')]]);this[_0x2fa1('0xba')]({'active':![],'ContactId':this[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xd0')],'ListId':this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['ListId'],'VoiceQueueId':this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x207f3f[_0x2fa1('0x127')]];unlockQueueStatus(_0x27af4e);}}else if((strategy[this['voiceQueues'][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x4f')]]||_0x2fa1('0x12a'))===_0x2fa1('0x12a')){var _0xf0a101;if(this[_0x2fa1('0x27')][_0x207f3f['actionid']]&&!_['isEmpty'](this[_0x2fa1('0x2c')][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]])){if(this[_0x2fa1('0x2d')][_0xc64e27['actions'][_0x207f3f['actionid']][_0x2fa1('0xb0')]]){this[_0x2fa1('0x2d')][_0xc64e27[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xb0')]]=this[_0x2fa1('0x2d')][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]]?this[_0x2fa1('0x2d')][this['actions'][_0x207f3f[_0x2fa1('0x127')]]['queue']]:this[_0x2fa1('0x2c')][this[_0x2fa1('0x27')][_0x207f3f['actionid']]['queue']]?this['queueBooked'][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]][_0x2fa1('0x130')]||0x0:0x0;}this['queueBooked'][this[_0x2fa1('0x27')][_0x207f3f['actionid']][_0x2fa1('0xb0')]]['_rr']=this[_0x2fa1('0x2d')][this[_0x2fa1('0x27')][_0x207f3f[_0x2fa1('0x127')]][_0x2fa1('0xb0')]];for(var _0x2d478d=0x0;_0x2d478d=0x0;})[_0x2fa1('0xad')](myreject(_0x4d6ff6)));}}else{_0x4c9a3b['push'](ami['Action']({'action':_0x2fa1('0x146'),'command':util[_0x2fa1('0x7c')](_0x2fa1('0x14a'),_0x57e989,!_[_0x2fa1('0x40')](config[_0x2fa1('0x141')][_0x4633d5])?_0x4633d5:'')})[_0x2fa1('0xb3')](function(_0x3ce631){return _0x3ce631[_0x2fa1('0x148')][_0x2fa1('0x149')](_0x2fa1('0x14b'))>=0x0;})[_0x2fa1('0xad')](myreject(_0x4d6ff6)));}BPromise[_0x2fa1('0x14c')](_0x4c9a3b)[_0x2fa1('0xb3')](function(_0x554c96){var _0x3a6ea1=_['some'](_0x554c96);if(_0x3a6ea1){return _0x3f942e(_0x3a6ea1);}else{_0x2953db[_0x2fa1('0x41')]=_0x41e121?_0x2fa1('0x14d'):_0x2fa1('0x14e');return _0x4d6ff6(msgResponse(_0x2fa1('0x14f'),_0x2fa1('0x13f'),_0x2fa1('0x150')+_0x41e121+'\x20'+_0x32eb04+'\x20Interval\x20is\x20overtime:\x20'+util[_0x2fa1('0x96')](_0x57e989,{'showHidden':![],'depth':null})+_0x2fa1('0x151')+_0x4633d5));}})[_0x2fa1('0xad')](function(_0x4b1092){return _0x4d6ff6(msgResponse(_0x2fa1('0x13d'),_0x2fa1('0x13f'),JSON['stringify'](_0x4b1092)));});});};Dialer[_0x2fa1('0x1d')]['checkDialMethod']=function(_0x9428a){var _0x3b785b=this;return function(){switch(_0x9428a[_0x2fa1('0x5d')]){case'progressive':freeVariablesPredictive(_0x9428a);_0x3b785b[_0x2fa1('0x152')](_0x9428a,0x1);break;case _0x2fa1('0x153'):freeVariablesPredictive(_0x9428a);_0x3b785b[_0x2fa1('0x152')](_0x9428a,_0x9428a[_0x2fa1('0x154')]);break;case _0x2fa1('0x9'):_0x3b785b[_0x2fa1('0x9')](_0x9428a);break;case _0x2fa1('0x155'):freeVariablesPredictive(_0x9428a);_0x3b785b[_0x2fa1('0x152')](_0x9428a,0x1);break;default:freeVariablesPredictive(_0x9428a);logger[_0x2fa1('0x95')](_0x2fa1('0x156'),_0x9428a[_0x2fa1('0x43')],'method\x20not\x20recognized');}};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x157')]=function(_0x2c9cdd){var _0x47c65f=this;return function(){_0x47c65f[_0x2fa1('0x158')](_0x2c9cdd);};};Dialer['prototype'][_0x2fa1('0xb')]=function(_0xee1a8f){var _0x4a5374=this;if(isNotPreview(_0xee1a8f[_0x2fa1('0x5d')])){if(isVoiceQueueOutbound(_0xee1a8f[_0x2fa1('0x57')])&&isActive(_0xee1a8f[_0x2fa1('0x5c')])){_0xee1a8f['sendMessageOneNotActive']=!![];BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](checkIsLoggedIn(_0xee1a8f,_0xee1a8f['loggedIn']))[_0x2fa1('0xb3')](checkIsActive(_0xee1a8f,_0xee1a8f['dialActive']))[_0x2fa1('0xb3')](checkInterval(_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x13b')](_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x13c')](_0xee1a8f[_0x2fa1('0x159')],_0xee1a8f['dialTimezone'],_0xee1a8f[_0x2fa1('0x43')],_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x13e')](_0xee1a8f['Interval'],_0xee1a8f[_0x2fa1('0x15a')],_0xee1a8f[_0x2fa1('0x43')],_0xee1a8f))[_0x2fa1('0xb3')](_0x4a5374[_0x2fa1('0x15b')](_0xee1a8f))[_0x2fa1('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0xee1a8f));}else{notSendMessagesQueue(_0xee1a8f);}}else{freeVariablesPredictive(_0xee1a8f);}};Dialer[_0x2fa1('0x1d')]['syncCampaigns']=function(){var _0x2b5bcb=this;var _0x44f94b;for(var _0x2af6be in this[_0x2fa1('0x23')]){if(typeof this['campaigns'][_0x2af6be]!=='undefined'){_0x44f94b=this[_0x2fa1('0x23')][_0x2af6be];if(isCampaignIvr(_0x44f94b[_0x2fa1('0x57')])&&isActive(_0x44f94b[_0x2fa1('0x79')])){_0x44f94b['sendMessageOneNotActive']=!![];BPromise[_0x2fa1('0xbb')]()[_0x2fa1('0xb3')](checkIsActive(_0x44f94b,_0x44f94b['active']))['then'](checkInterval(_0x44f94b))[_0x2fa1('0xb3')](_0x2b5bcb[_0x2fa1('0x13b')](_0x44f94b))[_0x2fa1('0xb3')](_0x2b5bcb[_0x2fa1('0x13c')](_0x44f94b[_0x2fa1('0x159')],_0x44f94b[_0x2fa1('0x15a')],_0x44f94b[_0x2fa1('0x43')],_0x44f94b))['then'](_0x2b5bcb[_0x2fa1('0x13e')](_0x44f94b['Interval'],_0x44f94b['dialTimezone'],_0x44f94b[_0x2fa1('0x43')],_0x44f94b))['then'](_0x2b5bcb[_0x2fa1('0x157')](_0x44f94b))[_0x2fa1('0xad')](loggerCatchQueueSummary(_0x2fa1('0x15c'),_0x44f94b));}else{notSendMessagesCampaign(_0x44f94b);}}}};function getCallerIdRandom(_0x70de73,_0x521260){var _0x310b9d;var _0x3f0ded;var _0x31ccc8;if(_0x521260<=0x0){_0x521260=0x1;}_0x310b9d=new RegExp(_0x2fa1('0x15d')+_0x521260+'}$');_0x3f0ded=Math[_0x2fa1('0x15e')](0xa,_0x521260-0x1);_0x31ccc8=Math['pow'](0xa,_0x521260)-0x1;return util[_0x2fa1('0x7c')]('%s',_[_0x2fa1('0x15f')](_0x70de73,_0x310b9d,_[_0x2fa1('0x160')](_0x3f0ded,_0x31ccc8)));}function extractCalleridName(_0x5ef578){var _0x56abba=_0x5ef578[_0x2fa1('0x161')](/"(.*?)"/);return _0x56abba?_0x56abba[0x1]:_0x5ef578;}function extractCalleridNumber(_0x1a165d){var _0x33b8d9=_0x1a165d[_0x2fa1('0x161')](/<(.*?)>/);return _0x33b8d9?_0x33b8d9[0x1]:_0x1a165d;}Dialer[_0x2fa1('0x1d')][_0x2fa1('0x162')]=function(_0x2c12d2,_0x15a538){var _0x37af8d=this;var _0x2e029f=uuid['v4']();this[_0x2fa1('0x27')][_0x2e029f]=new Action(_0x2c12d2,_0x15a538,_0x2e029f);return new BPromise(function(_0x276c99,_0x1164c6){if(_[_0x2fa1('0x40')](_0x2c12d2)&&typeof _0x2c12d2!==_0x2fa1('0x163')){return _0x1164c6(msgResponse(_0x2fa1('0x164'),_0x2fa1('0x13f'),_0x2fa1('0x165')));}if(_[_0x2fa1('0x40')](_0x15a538[_0x2fa1('0x166')][_0x2fa1('0x167')])||_0x15a538[_0x2fa1('0x166')]['phone']===null){return _0x1164c6(msgResponse(_0x2fa1('0x164'),_0x2fa1('0x13f'),'contact\x20is\x20undefine'));}var _0x205226={'XMD-CALLERID':_0x37af8d[_0x2fa1('0x27')][_0x2e029f][_0x2fa1('0x168')](),'XMD-AGI':_0x2c12d2[_0x2fa1('0x109')]?util['format'](_0x2fa1('0x169'),ipAgi,_0x2c12d2[_0x2fa1('0x109')]):_0x2fa1('0x16a'),'XMD-AGIAFTER':_0x2c12d2[_0x2fa1('0x10f')]?util['format'](_0x2fa1('0x169'),ipAgi,_0x2c12d2[_0x2fa1('0x10f')]):'NONE','XMD-QUEUE':_0x2c12d2[_0x2fa1('0x57')]===_0x2fa1('0x92')?util['format'](_0x2fa1('0x16b'),_0x2c12d2['name'],_0x2c12d2[_0x2fa1('0x16c')]||'',_0x2c12d2['dialAgiAfterHangupAgent']?'c':'',_0x2c12d2[_0x2fa1('0x16d')]||0x3):_0x2fa1('0x16a'),'XMD-CONTACTID':_0x15a538[_0x2fa1('0xd0')],'XMD-CDRTYPE':_0x2fa1('0x8'),'CALLERID(all)':_0x37af8d['actions'][_0x2e029f]['getCaller'](),'XMD-AMD':_0x2c12d2[_0x2fa1('0x101')]?_0x2fa1('0x16e'):_0x2fa1('0x16a'),'XMD-DESTINATION':_0x2fa1('0xe1')};if(_0x2c12d2[_0x2fa1('0x101')]){_0x205226[_0x2fa1('0x16f')]=_0x2c12d2[_0x2fa1('0x170')]||0x9c4;_0x205226[_0x2fa1('0x171')]=_0x2c12d2[_0x2fa1('0x172')]||0x5dc;_0x205226[_0x2fa1('0x173')]=_0x2c12d2['dialAMDAfterGreetingSilence']||0x320;_0x205226[_0x2fa1('0x174')]=_0x2c12d2['dialAMDTotalAnalysisTime']||0x1388;_0x205226[_0x2fa1('0x175')]=_0x2c12d2['dialAMDMinWordLength']||0x64;_0x205226['XMD-AMDBETWEENWORDSSILENCE']=_0x2c12d2[_0x2fa1('0x176')]||0x32;_0x205226['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2c12d2[_0x2fa1('0x177')]||0x3;_0x205226[_0x2fa1('0x178')]=_0x2c12d2[_0x2fa1('0x179')]||0x100;_0x205226[_0x2fa1('0x17a')]=_0x2c12d2['dialAMDMaximumWordLength']||0x1388;}if(_0x2c12d2['type']==='outbound'){_0x205226[_0x2fa1('0x17b')]=_0x15a538['VoiceQueueId'];}else{_0x205226[_0x2fa1('0x17c')]=_0x15a538[_0x2fa1('0xd4')];}for(var _0x32ec59 in _0x15a538[_0x2fa1('0x166')]){if(typeof _0x15a538[_0x2fa1('0x166')][_0x32ec59]!==_0x2fa1('0xc8')){if(isNotNull(_0x15a538['Contact'][_0x32ec59])&&_0x32ec59!=='id'&&_0x32ec59!==_0x2fa1('0x17d')&&_0x32ec59!==_0x2fa1('0x17e')&&_0x32ec59!==_0x2fa1('0x17f')){_0x205226[util[_0x2fa1('0x7c')](_0x2fa1('0x180'),'XMD-',_[_0x2fa1('0x181')](_0x32ec59))]=_0x15a538['Contact'][_0x32ec59];}}}var _0x28d1c9=_0x37af8d[_0x2fa1('0xd8')](_0x2c12d2[_0x2fa1('0x78')])?getCallerId(_0x2c12d2[_0x2fa1('0x78')][_0x2fa1('0x7a')],_0x2c12d2[_0x2fa1('0x182')],_0x2c12d2['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2c12d2['dialOriginateCallerIdNumber'],_0x2c12d2[_0x2fa1('0x183')]):_0x2c12d2[_0x2fa1('0x5e')]):getCallerId(_[_0x2fa1('0xdd')](_0x2c12d2[_0x2fa1('0x184')])?_0x2c12d2['Trunk'][_0x2fa1('0x7a')]:_0x2c12d2['TrunkBackup'][_0x2fa1('0x7a')],_0x2c12d2['dialOriginateCallerIdName'],_0x2c12d2[_0x2fa1('0x183')]>0x0?getCallerIdRandom(_0x2c12d2[_0x2fa1('0x5e')],_0x2c12d2['dialRandomLastDigitCallerIdNumber']):_0x2c12d2[_0x2fa1('0x5e')]);if(_0x28d1c9){_0x205226[_0x2fa1('0x185')]=_0x37af8d[_0x2fa1('0x27')][_0x2e029f][_0x2fa1('0x186')]=extractCalleridName(_0x28d1c9);_0x205226['XMD-ORIGINATECALLERIDNUM']=_0x37af8d[_0x2fa1('0x27')][_0x2e029f][_0x2fa1('0x187')]=extractCalleridNumber(_0x28d1c9);}return ami[_0x2fa1('0xaa')]({'actionid':_0x2e029f,'action':_0x2fa1('0x164'),'channel':_0x37af8d[_0x2fa1('0xd8')](_0x2c12d2[_0x2fa1('0x78')])?util[_0x2fa1('0x7c')](_0x2fa1('0x188'),_0x2c12d2['Trunk']['name'],isNotNull(_0x2c12d2[_0x2fa1('0x60')])?_0x2c12d2[_0x2fa1('0x60')][_0x2fa1('0x189')]()||'':'',_0x2c12d2['dialCutDigit']>0x0?_0x15a538['Contact'][_0x2fa1('0x167')][_0x2fa1('0x18a')](_0x2c12d2['dialCutDigit']):_0x15a538[_0x2fa1('0x166')][_0x2fa1('0x167')]):util[_0x2fa1('0x7c')](_0x2fa1('0x188'),_[_0x2fa1('0xdd')](_0x2c12d2[_0x2fa1('0x184')])?_0x2c12d2['Trunk'][_0x2fa1('0x43')]:_0x2c12d2[_0x2fa1('0x184')]['name'],isNotNull(_0x2c12d2['dialPrefix'])?_0x2c12d2[_0x2fa1('0x60')]['trim']()||'':'',_0x2c12d2[_0x2fa1('0x18b')]>0x0?_0x15a538[_0x2fa1('0x166')][_0x2fa1('0x167')]['substring'](_0x2c12d2[_0x2fa1('0x18b')]):_0x15a538[_0x2fa1('0x166')]['phone']),'callerid':_0x28d1c9,'Exten':_0x2fa1('0xe1'),'Context':_0x2fa1('0x18c'),'Priority':'1','variable':_0x205226,'timeout':(_0x2c12d2['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2e029f})['then'](function(_0x315974){return _0x276c99(_0x315974);})['catch'](function(_0x4fc090){_0x2c12d2[_0x2fa1('0x69')]+=0x1;var _0x270f47=new History(_0x37af8d[_0x2fa1('0x27')][_0x2e029f]);logger[_0x2fa1('0x95')](util[_0x2fa1('0x7c')](_0x2fa1('0x18d'),JSON[_0x2fa1('0x7b')](_0x4fc090)));_0x270f47[_0x2fa1('0xe5')]=0xe;_0x270f47['statedesc']=_0x2fa1('0x18e');_0x270f47[_0x2fa1('0xa6')]=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x270f47[_0x2fa1('0xa5')]=_0x270f47[_0x2fa1('0xa6')];_0x37af8d[_0x2fa1('0xc6')](_0x270f47)[_0x2fa1('0xad')](loggerCatch('[originate][error]'));_0x37af8d[_0x2fa1('0xc4')](_0x270f47)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x18f')))[_0x2fa1('0x12f')](function(){delete _0x37af8d['actions'][_0x2e029f];return _0x1164c6(msgResponse('originate','Error',_0x2fa1('0x190')));});});});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x33')]=function(_0x4c7904){var _0x5876a4=this['actions'][_0x4c7904[_0x2fa1('0x127')]];if(_0x5876a4){delete this[_0x2fa1('0x27')][_0x4c7904[_0x2fa1('0x127')]];_0x5876a4[_0x2fa1('0x116')]=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1867e6=_0x5876a4[_0x2fa1('0x57')]===_0x2fa1('0x7e')?this[_0x2fa1('0x23')][_0x5876a4['queue']]:this['voiceQueues'][_0x5876a4[_0x2fa1('0x191')]()];if(!this[_0x2fa1('0x192')](_0x4c7904[_0x2fa1('0x193')])){this[_0x2fa1('0xaf')](_0x1867e6);return this[_0x2fa1('0x194')](_0x5876a4,_0x1867e6,_0x4c7904)['catch'](loggerCatch(_0x2fa1('0x195')));}this['uniqueId'][_0x4c7904[_0x2fa1('0xdc')]]=_0x5876a4;}};Dialer[_0x2fa1('0x1d')]['checkRetriveMax']=function(_0x3a087b,_0x345b68,_0x2a78a4){var _0x345b27=new History(_0x345b68);if(_0x345b27[_0x2fa1('0xf3')]+_0x345b27[_0x2fa1('0xf4')]+_0x345b27['countnoanswerretry']+_0x345b27[_0x2fa1('0xf6')]+_0x345b27[_0x2fa1('0x11c')]+_0x345b27[_0x2fa1('0xf7')]+_0x345b27[_0x2fa1('0xf1')]+_0x345b27[_0x2fa1('0xf8')]>=_0x2a78a4[_0x2fa1('0x104')]-0x1){return!![];}switch(_0x3a087b){case 0x3:if(_0x345b27[_0x2fa1('0xf5')]>=_0x2a78a4[_0x2fa1('0x196')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x345b27[_0x2fa1('0xf5')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4['dialNoAnswerRetryFrequency'],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x197')));break;case 0x5:if(_0x345b27[_0x2fa1('0xf3')]>=_0x2a78a4[_0x2fa1('0x198')]-0x1){return!![];}this[_0x2fa1('0xba')]({'active':![],'countbusyretry':_0x345b27[_0x2fa1('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x2a78a4[_0x2fa1('0x199')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x19a')));break;case 0x8:if(_0x345b27['countcongestionretry']>=_0x2a78a4[_0x2fa1('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x345b27[_0x2fa1('0xf4')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x19c')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x345b27[_0x2fa1('0xf6')]>=_0x2a78a4[_0x2fa1('0x19d')]-0x1){return!![];}else{this[_0x2fa1('0xba')]({'active':![],'countnosuchnumberretry':_0x345b27[_0x2fa1('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x2a78a4[_0x2fa1('0x19e')],_0x2fa1('0xfe'))[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27['ContactId'],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x19f')));}break;case 0xa:if(_0x345b27[_0x2fa1('0x11c')]>=_0x2a78a4[_0x2fa1('0x1a0')]-0x1){return!![];}this[_0x2fa1('0xba')]({'active':![],'countdropretry':_0x345b27[_0x2fa1('0x11c')]+=0x1,'scheduledat':moment()['add'](_0x2a78a4[_0x2fa1('0x11d')],'minutes')['format'](_0x2fa1('0xff')),'ContactId':_0x345b27['ContactId'],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x11e')));break;case 0xb:if(_0x345b27[_0x2fa1('0xf7')]>=_0x2a78a4[_0x2fa1('0x125')]-0x1){return!![];}this[_0x2fa1('0xba')]({'active':![],'countabandonedretry':_0x345b27[_0x2fa1('0xf7')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x1a1')],_0x2fa1('0xfe'))['format'](_0x2fa1('0xff')),'ContactId':_0x345b27['ContactId'],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x126')));break;case 0x13:if(_0x345b27[_0x2fa1('0xf1')]>=_0x2a78a4[_0x2fa1('0x105')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x345b27[_0x2fa1('0xf1')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x1a2')],'minutes')[_0x2fa1('0x7c')](_0x2fa1('0xff')),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27['ListId'],'VoiceQueueId':_0x345b27[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x100')));break;case 0x14:if(_0x345b27['countagentrejectretry']>=_0x2a78a4[_0x2fa1('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x345b27[_0x2fa1('0xf8')]+=0x1,'scheduledat':moment()[_0x2fa1('0xfd')](_0x2a78a4[_0x2fa1('0x1a4')],_0x2fa1('0xfe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x345b27[_0x2fa1('0xd0')],'ListId':_0x345b27[_0x2fa1('0xd1')],'VoiceQueueId':_0x345b27['VoiceQueueId']||undefined,'CampaignId':_0x345b27[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x2fa1('0x1d')]['callProgressDetecting']=function(_0x26a05b,_0x37305b,_0x1b95ad){var _0x5b96f3=this;var _0x1b71fe=new History(_0x26a05b);return new BPromise(function(_0x3c8d12,_0x54e7ba){if(_[_0x2fa1('0x40')](_0x37305b)&&typeof _0x37305b!==_0x2fa1('0x163')){return _0x54e7ba(msgResponse(_0x2fa1('0x1a5'),'Failure','entity\x20is\x20undefine'));}if(_[_0x2fa1('0x40')](_0x1b95ad)&&typeof _0x1b95ad!==_0x2fa1('0x163')){return _0x54e7ba(msgResponse('[callProgressDetecting]','Failure',_0x2fa1('0x1a6')));}switch(_0x1b95ad[_0x2fa1('0x10d')]){case'0':_0x37305b[_0x2fa1('0x68')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x0;_0x1b71fe[_0x2fa1('0xe6')]=_0x2fa1('0x1a7');_0x1b71fe['countnosuchnumberretry']+=0x1;_0x1b71fe['countglobal']+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1a8'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1a9')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)['catch'](loggerCatch(_0x2fa1('0xf2')));if(_0x5b96f3[_0x2fa1('0x1aa')](0x0,_0x26a05b,_0x37305b)){if(_0x1b71fe['countnosuchnumberretry']>=_0x37305b['dialNoSuchNumberMaxRetry']){_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1ab'));}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1ab'));}}break;case'3':_0x37305b['outboundNoAnswerCallsDay']+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x3;_0x1b71fe['statedesc']='NoAnswer';_0x1b71fe[_0x2fa1('0xf5')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1ac'),ut['buildObj'](_0x26a05b,_0x2fa1('0x1ad')));_0x5b96f3['createHistory'](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1ae')));if(_0x5b96f3[_0x2fa1('0x1aa')](0x3,_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf5')]>=_0x37305b[_0x2fa1('0x196')]){_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1af'));}}break;case'5':_0x37305b[_0x2fa1('0x63')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x5;_0x1b71fe[_0x2fa1('0xe6')]='Busy';_0x1b71fe['countbusyretry']+=0x1;_0x1b71fe['countglobal']+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1b0'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1b1')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x5b96f3[_0x2fa1('0x1aa')](0x5,_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf3')]>=_0x37305b[_0x2fa1('0x198')]){_0x5b96f3[_0x2fa1('0xfb')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1b2'));}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x205\x20busy');}}break;case'8':_0x37305b[_0x2fa1('0x64')]+=0x1;_0x1b71fe['state']=0x8;_0x1b71fe[_0x2fa1('0xe6')]='Congestion';_0x1b71fe[_0x2fa1('0xf4')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1b3'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1b4')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5b96f3['checkRetriveMax'](0x8,_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf4')]>=_0x37305b[_0x2fa1('0x19b')]){_0x5b96f3[_0x2fa1('0xfb')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x208\x20congestion');}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1b5'));}}break;case'11':_0x37305b[_0x2fa1('0x1b6')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0xb;_0x1b71fe[_0x2fa1('0xe6')]=_0x2fa1('0x123');_0x1b71fe[_0x2fa1('0xf7')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1b7')));if(_0x5b96f3[_0x2fa1('0x1aa')](0xb,_0x26a05b,_0x37305b)){if(_0x1b71fe['countabandonedretry']>=_0x37305b[_0x2fa1('0x125')]){_0x5b96f3[_0x2fa1('0xfb')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x2011\x20abandoned');}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1b8'));}}break;case'20':_0x37305b['outboundRejectCallsDay']+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0x14;_0x1b71fe[_0x2fa1('0xe6')]=_0x2fa1('0x1b9');_0x1b71fe[_0x2fa1('0xf8')]+=0x1;_0x1b71fe[_0x2fa1('0x103')]+=0x1;ami[_0x2fa1('0x4e')](_0x2fa1('0x1ba'),ut[_0x2fa1('0xea')](_0x26a05b,_0x2fa1('0x1bb')));_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)['catch'](loggerCatch(_0x2fa1('0x1bc')));if(_0x5b96f3[_0x2fa1('0x1aa')](0x14,_0x26a05b,_0x37305b)){if(_0x1b71fe['countagentrejectretry']>=_0x37305b[_0x2fa1('0x1a3')]){_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x2fa1('0x1bd'));}else{_0x5b96f3[_0x2fa1('0xf9')](_0x1b71fe,_0x3c8d12,_0x54e7ba,'reason\x2020\x20agentreject');}}break;default:_0x37305b[_0x2fa1('0x6c')]+=0x1;_0x1b71fe[_0x2fa1('0xe5')]=0xc;_0x1b71fe[_0x2fa1('0xe6')]=_0x1b95ad['reason'];_0x5b96f3[_0x2fa1('0xc6')](_0x1b71fe)[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1be')));if(_0x5b96f3[_0x2fa1('0x1aa')](_0x1b95ad['reason'],_0x26a05b,_0x37305b)){if(_0x1b71fe[_0x2fa1('0xf3')]+_0x1b71fe[_0x2fa1('0xf4')]+_0x1b71fe[_0x2fa1('0xf5')]+_0x1b71fe['countnosuchnumberretry']+_0x1b71fe[_0x2fa1('0x11c')]+_0x1b71fe['countabandonedretry']+_0x1b71fe['countmachineretry']+_0x1b71fe['countagentrejectretry']>=_0x37305b['dialGlobalMaxRetry']){_0x5b96f3['stateGlobal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x1b95ad[_0x2fa1('0x10d')]);}else{_0x5b96f3['createStateFinal'](_0x1b71fe,_0x3c8d12,_0x54e7ba,_0x1b95ad[_0x2fa1('0x10d')]);}}}});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xf9')]=function(_0x210dc5,_0x19f282,_0x3dc69e,_0x382059){var _0x2ea0a5=new Final(_0x210dc5);_0x2ea0a5[_0x2fa1('0xe5')]=0xf;_0x2ea0a5[_0x2fa1('0xe6')]=_0x2fa1('0x1bf');this[_0x2fa1('0xfb')](_0x2ea0a5,_0x19f282,_0x3dc69e,_0x382059);};Dialer[_0x2fa1('0x1d')][_0x2fa1('0xfb')]=function(_0x512e78,_0x1952e9,_0x37f53f,_0x31a933){this[_0x2fa1('0xc4')](_0x512e78)[_0x2fa1('0xb3')](function(){return _0x1952e9(msgResponse(_0x2fa1('0x1a5'),_0x2fa1('0xd7'),_0x31a933));})[_0x2fa1('0xad')](function(){return _0x37f53f(msgResponse(_0x2fa1('0x1c0'),_0x2fa1('0x13f'),_0x2fa1('0x1c1')));});};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x9')]=function(_0x5221d9){var _0x1f0df6=_0x5221d9[_0x2fa1('0x1c2')]/0x64;var _0x54f8d7=_0x5221d9[_0x2fa1('0x66')]/(_0x5221d9['outboundDropCallsDayTimeout']+_0x5221d9[_0x2fa1('0xe4')]);var _0x585f75=Math[_0x2fa1('0x1c3')](_0x5221d9[_0x2fa1('0x71')]*(_0x5221d9[_0x2fa1('0x1c4')]/0x64));var _0x48a24a=Math[_0x2fa1('0x1c3')](_0x5221d9[_0x2fa1('0x71')]*(_0x5221d9[_0x2fa1('0x1c5')]/0x64));var _0x3dbc19=_0x5221d9[_0x2fa1('0x51')]+_0x5221d9[_0x2fa1('0x56')];var _0xb0b33=Math[_0x2fa1('0x1c6')](_0x5221d9[_0x2fa1('0x1c7')]*_0x5221d9[_0x2fa1('0x75')]*_0x5221d9['predictiveIntervalHitRate']*_0x5221d9[_0x2fa1('0x1c8')]);if(_[_0x2fa1('0x40')](_0x5221d9[_0x2fa1('0x2a')])){if(!_[_0x2fa1('0x40')](_0x5221d9[_0x2fa1('0x77')])){_0x5221d9['startPredictive']=undefined;loggerPredictive['error'](_0x2fa1('0x1c9'),_0x2fa1('0x1ca'));}if(!_[_0x2fa1('0x40')](_0x5221d9['handlePredictive'])){loggerPredictive[_0x2fa1('0x95')](_0x2fa1('0x1c9'),_0x2fa1('0x1cb'));clearInterval(_0x5221d9[_0x2fa1('0x91')]);_0x5221d9[_0x2fa1('0x91')]=undefined;}_0x5221d9[_0x2fa1('0x2a')]=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],_0x2fa1('0x1cc'),_0x5221d9['startProgressive']);this[_0x2fa1('0x152')](_0x5221d9,0x1);}else if(ifInterval(_0x5221d9[_0x2fa1('0x1cd')],_0x5221d9[_0x2fa1('0x2a')])){this[_0x2fa1('0x152')](_0x5221d9,0x1);loggerPredictiveCalls[_0x2fa1('0x7f')]('[startMethodPredictive][StartProgressive][Loop]',_0x5221d9[_0x2fa1('0x2a')],_0x5221d9[_0x2fa1('0x43')]);_0x5221d9[_0x2fa1('0x1c7')]=0x0;_0x5221d9['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1f0df6<_0x54f8d7&&_0x5221d9['dialPredictiveOptimization']===_0x2fa1('0x1ce')){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x1cf'),'Dropped\x20calls\x20day',_0x54f8d7,_0x2fa1('0x2a'),_0x5221d9[_0x2fa1('0x43')]);}else if(_0xb0b33<_0x5221d9[_0x2fa1('0x70')]&&_0x5221d9[_0x2fa1('0x1d0')]===_0x2fa1('0x1ce')){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x1d1'),_0x2fa1('0x1d2'),_0xb0b33,_0x2fa1('0x1d3'),_0x5221d9[_0x2fa1('0x70')],_0x2fa1('0x2a'),_0x5221d9[_0x2fa1('0x43')]);}else if(!ifInterval(_0x5221d9['dialPredictiveInterval'],_0x5221d9[_0x2fa1('0x2a')])&&_[_0x2fa1('0x40')](_0x5221d9[_0x2fa1('0x77')])&&!_[_0x2fa1('0x40')](_0x5221d9['startProgressive'])){_0x5221d9[_0x2fa1('0x77')]=moment()[_0x2fa1('0x7c')](_0x2fa1('0xff'));loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],'started\x20in\x20predictive\x20at',_0x5221d9[_0x2fa1('0x77')]);this[_0x2fa1('0xb8')](_0x5221d9[_0x2fa1('0x1cd')])[_0x2fa1('0xb3')](this[_0x2fa1('0x1d4')](_0x5221d9))[_0x2fa1('0xb3')](mergeDataErlangB(_0x5221d9))[_0x2fa1('0xb3')](this[_0x2fa1('0x1d5')](_0x5221d9))[_0x2fa1('0xad')](loggerCatchPredictive(_0x2fa1('0x1d6'),_0x5221d9));}else if(!ifInterval(_0x5221d9[_0x2fa1('0x1cd')],_0x5221d9[_0x2fa1('0x77')])){_0x5221d9[_0x2fa1('0x70')]=0x0;_0x5221d9['startPredictive']=moment()[_0x2fa1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],'recalculate\x20predictive\x20at',_0x5221d9[_0x2fa1('0x77')]);clearInterval(_0x5221d9['handlePredictive']);_0x5221d9['handlePredictive']=undefined;this[_0x2fa1('0xb8')](_0x5221d9['dialPredictiveInterval'])['then'](this[_0x2fa1('0x1d4')](_0x5221d9))['then'](mergeDataErlangB(_0x5221d9))[_0x2fa1('0xb3')](this['startMethodPredictive'](_0x5221d9))[_0x2fa1('0xad')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5221d9));}else if(_0x5221d9[_0x2fa1('0x71')]&&_0x3dbc19<_0x5221d9['predictiveIntervalAvailable']-_0x48a24a){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],_0x2fa1('0x1d7'),_0x3dbc19,_0x2fa1('0x1d8'),_0x5221d9[_0x2fa1('0x71')],'-',_0x48a24a,'=',_0x5221d9['predictiveIntervalAvailable']-_0x48a24a,')');}else if(_0x5221d9['predictiveIntervalAvailable']&&_0x3dbc19>_0x5221d9['predictiveIntervalAvailable']+_0x585f75){freeVariablesPredictive(_0x5221d9);loggerPredictive[_0x2fa1('0x7f')](_0x5221d9[_0x2fa1('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3dbc19,')\x20are\x20more\x20than\x20threshold\x20(',_0x5221d9['predictiveIntervalAvailable'],'+',_0x585f75,'=',_0x5221d9[_0x2fa1('0x71')]+_0x585f75,')');}};Dialer['prototype'][_0x2fa1('0x1d4')]=function(_0xbbcc8){var _0x3bfd05=this;return function(_0x5eb957){return new BPromise(function(_0x4c3c5a,_0x5a9583){_[_0x2fa1('0xce')](_0xbbcc8,_0x5eb957[0x0]);if(checkGetDataPredictive(_0x5eb957[0x0])){var _0x25bde7=_0xbbcc8['predictiveIntervalAvailable']=_0xbbcc8['talking']+_0xbbcc8[_0x2fa1('0x51')];var _0x527833=_0xbbcc8[_0x2fa1('0x1cd')]*0x3c;var _0x2cfc4f=_0x5eb957[0x0][_0x2fa1('0x6f')]+_0x5eb957[0x0][_0x2fa1('0x6e')];var _0x2723a2=(_0x5eb957[0x0][_0x2fa1('0x6d')]+_0x5eb957[0x0][_0x2fa1('0x117')]+_0x5eb957[0x0][_0x2fa1('0x84')])/_0x5eb957[0x0][_0x2fa1('0x72')];_0xbbcc8['predictiveIntervalHitRate']=_0x2723a2>0x0?_0x2723a2:0x1;switch(_0xbbcc8[_0x2fa1('0x1d0')]){case _0x2fa1('0x1ce'):var _0x25827=_0xbbcc8['dialPredictiveOptimizationPercentage']/0x64;return _0x3bfd05['abandonmentRate'](_0x25bde7,_0x527833,_0x2cfc4f,_0x2723a2,_0x25827)['then'](function(_0x531c49){return _0x4c3c5a(_0x531c49);});case _0x2fa1('0x1d9'):var _0x4b78f6=_0xbbcc8[_0x2fa1('0x1c2')]/0x64;return _0x3bfd05[_0x2fa1('0x1da')](_0x25bde7,_0x527833,_0x2cfc4f,_0x2723a2,_0x4b78f6)[_0x2fa1('0xb3')](function(_0x3c0c2e){return _0x4c3c5a(_0x3c0c2e);});default:return _0x5a9583(msgResponse(_0x2fa1('0x1db'),_0x2fa1('0x13f'),_0x2fa1('0x1dc')));}}else{return _0x5a9583(msgResponse(_0x2fa1('0x1db'),_0x2fa1('0x13f'),_0x2fa1('0x1dd')));}});};};Dialer['prototype'][_0x2fa1('0x1de')]=function(_0x4599ed){var _0x46e192=this;return function(_0x4cdb68){return new BPromise(function(_0x4a3a52,_0x589b8a){_[_0x2fa1('0xce')](_0x4599ed,_0x4cdb68[0x0]);if(checkGetDataPredictive(_0x4cdb68[0x0])){loggerPredictive[_0x2fa1('0x7f')](JSON[_0x2fa1('0x7b')](_0x4cdb68[0x0]));if(_0x4599ed[_0x2fa1('0x1d0')]==='dropRate'){return _0x46e192['getVoiceQueueRtPauses'](_0x4599ed['id'])[_0x2fa1('0xb3')](function(_0x3083d2){var _0xcff8b7=_0x4599ed[_0x2fa1('0x52')]-_0x3083d2[0x0][_0x2fa1('0x1df')];var _0x1ba1e1=_0x4599ed['dialPredictiveInterval']*0x3c;var _0x493241=_0x4cdb68[0x0][_0x2fa1('0x6f')]+_0x4cdb68[0x0]['predictiveIntervalAvgHoldtime'];var _0x1cfcc5=(_0x4cdb68[0x0][_0x2fa1('0x6d')]+_0x4cdb68[0x0][_0x2fa1('0x117')]+_0x4cdb68[0x0][_0x2fa1('0x84')])/_0x4cdb68[0x0][_0x2fa1('0x72')];var _0x4da2d3=_0x4599ed[_0x2fa1('0x1c2')]/0x64;_0x4599ed['predictiveIntervalPauses']=_0x3083d2[0x0][_0x2fa1('0x1df')]||0x0;_0x4599ed[_0x2fa1('0x1e0')]=_0x1cfcc5>0x0?_0x1cfcc5:0x1;return _0x46e192[_0x2fa1('0x1e1')](_0xcff8b7,_0x1ba1e1,_0x493241,_0x1cfcc5,_0x4da2d3);})['then'](function(_0x394944){return _0x4a3a52(_0x394944);})[_0x2fa1('0xad')](function(_0x1de2d1){return _0x589b8a(msgResponse(_0x2fa1('0x1e2'),_0x2fa1('0x13f'),JSON[_0x2fa1('0x7b')](_0x1de2d1)));});}if(_0x4599ed[_0x2fa1('0x1d0')]==='agentBusyFactor'){return _0x46e192[_0x2fa1('0xc2')](_0x4599ed['id'])[_0x2fa1('0xb3')](function(_0x57a7bd){var _0x48e405=_0x4599ed['loggedIn']-_0x57a7bd[0x0][_0x2fa1('0x1df')];var _0x1ab1e4=_0x4599ed[_0x2fa1('0x1cd')]*0x3c;var _0x39c043=_0x4cdb68[0x0][_0x2fa1('0x6f')]+_0x4cdb68[0x0][_0x2fa1('0x6e')];var _0x4517e6=(_0x4cdb68[0x0][_0x2fa1('0x6d')]+_0x4cdb68[0x0][_0x2fa1('0x117')]+_0x4cdb68[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4cdb68[0x0][_0x2fa1('0x72')];var _0x2dceb3=_0x4599ed[_0x2fa1('0x1c2')]/0x64;_0x4599ed[_0x2fa1('0x1e3')]=_0x57a7bd[0x0][_0x2fa1('0x1df')]||0x0;_0x4599ed['predictiveIntervalHitRate']=_0x4517e6>0x0?_0x4517e6:0x1;return _0x46e192[_0x2fa1('0x1da')](_0x48e405,_0x1ab1e4,_0x39c043,_0x4517e6,_0x2dceb3);})[_0x2fa1('0xb3')](function(_0x46ea76){return _0x4a3a52(_0x46ea76);})['catch'](function(_0x519676){return _0x589b8a(msgResponse(_0x2fa1('0x1e2'),'Failure',JSON[_0x2fa1('0x7b')](_0x519676)));});}}else{return _0x589b8a(msgResponse(_0x2fa1('0x1db'),_0x2fa1('0x13f'),_0x2fa1('0x1dd')));}});};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x1d5')]=function(_0xe5882e){var _0x308617=this;return function(){var _0x3171f3=0x0;var _0x39b3ee=Math[_0x2fa1('0x1c6')](_0xe5882e['erlangCallToSecond']*0x3e8);if(_0x39b3ee>0x0){_0x39b3ee=_0x39b3ee<0x64?0x64:_0x39b3ee;loggerPredictive[_0x2fa1('0x7f')](_0xe5882e[_0x2fa1('0x43')],'one\x20call\x20every:',_0x39b3ee,_0x2fa1('0x4c'));_0xe5882e[_0x2fa1('0x91')]=setInterval(function(){_0x308617[_0x2fa1('0x91')](_0xe5882e);loggerPredictiveCalls[_0x2fa1('0x7f')](_0x2fa1('0x1e4'),_0x3171f3+=0x1);},_0x39b3ee);}else{loggerPredictive[_0x2fa1('0x7f')](_0xe5882e[_0x2fa1('0x43')],_0x2fa1('0x1e5'));}};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x1e6')]=function(_0x1f2924,_0x2f7739){var _0xee530f=this;return function(_0x458945){if(_[_0x2fa1('0x4a')](_0x458945)){if(_[_0x2fa1('0xdd')](_0x2f7739['UserId'])||!_0x2f7739[_0x2fa1('0x1e7')]){if(_0x1f2924[_0x2fa1('0x5d')]===_0x2fa1('0x155')){_0x1f2924[_0x2fa1('0x12d')]=_[_0x2fa1('0x40')](_0x1f2924['queueStatusComplete'])?!![]:_0x1f2924[_0x2fa1('0x12d')];var _0x45e290=uuid['v4']();_0xee530f[_0x2fa1('0x27')][_0x45e290]=new Action(_0x1f2924,_0x2f7739,_0x45e290);loggerBooked[_0x2fa1('0x7f')](_0x2fa1('0x1e8'),_0x45e290,_0x2fa1('0x1e9'),JSON[_0x2fa1('0x7b')](_0x1f2924[_0x2fa1('0x12d')]),_0x2fa1('0x1ea'),_0x1f2924[_0x2fa1('0x43')]);if(_0x1f2924[_0x2fa1('0x12d')]){_0x1f2924[_0x2fa1('0x12d')]=![];_0xee530f[_0x2fa1('0x2c')][_0xee530f[_0x2fa1('0x27')][_0x45e290]['queue']]=[];ami[_0x2fa1('0xaa')]({'actionid':_0x45e290,'action':'queuestatus','queue':_0x1f2924[_0x2fa1('0x43')]})[_0x2fa1('0xad')](function(){_0xee530f[_0x2fa1('0xaf')](_0x1f2924);_0xee530f[_0x2fa1('0xba')]({'active':![],'ContactId':_0xee530f[_0x2fa1('0x27')][_0x45e290][_0x2fa1('0xd0')],'ListId':_0xee530f['actions'][_0x45e290][_0x2fa1('0xd1')],'VoiceQueueId':_0xee530f['actions'][_0x45e290]['VoiceQueueId']||undefined,'CampaignId':_0xee530f[_0x2fa1('0x27')][_0x45e290]['CampaignId']||undefined})['catch'](loggerCatch(_0x2fa1('0x1eb')));delete _0xee530f[_0x2fa1('0x27')][_0x45e290];});}else{loggerBooked[_0x2fa1('0x7f')](_0x2fa1('0x1ec'),JSON[_0x2fa1('0x7b')](_0x1f2924[_0x2fa1('0x12d')]),_0x2fa1('0x1ea'),_0x1f2924[_0x2fa1('0x43')]);_0xee530f[_0x2fa1('0xaf')](_0x1f2924);_0xee530f[_0x2fa1('0xba')]({'active':![],'ContactId':_0xee530f[_0x2fa1('0x27')][_0x45e290][_0x2fa1('0xd0')],'ListId':_0xee530f[_0x2fa1('0x27')][_0x45e290][_0x2fa1('0xd1')],'VoiceQueueId':_0xee530f[_0x2fa1('0x27')][_0x45e290]['VoiceQueueId']||undefined,'CampaignId':_0xee530f[_0x2fa1('0x27')][_0x45e290]['CampaignId']||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1eb')));delete _0xee530f[_0x2fa1('0x27')][_0x45e290];}}else{return _0xee530f[_0x2fa1('0x162')](_0x1f2924,_0x2f7739);}}else{if(getDiff(_0x2f7739['scheduledat'])<_0x1f2924['dialRecallMeTimeout']*0x3c){if(_0x2f7739[_0x2fa1('0x1ed')]&&!_0x2f7739[_0x2fa1('0x1ed')]['voicePause']){_0xee530f[_0x2fa1('0x21')][_0x2fa1('0x135')](_0x2f7739['id'])['finally'](function(){_0xee530f[_0x2fa1('0xaf')](_0x1f2924);});}else{_0xee530f[_0x2fa1('0xbc')]({'active':![]},_0x2f7739['id'],0x1)['finally'](function(){_0xee530f[_0x2fa1('0xaf')](_0x1f2924);});}}else{_0x1f2924[_0x2fa1('0x6a')]+=0x1;_0xee530f['updateOriginated'](_0x1f2924);if(_0x1f2924['dialRecallInQueue']){_0xee530f['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2f7739[_0x2fa1('0xd0')],'ListId':_0x2f7739[_0x2fa1('0xd1')],'VoiceQueueId':_0x2f7739[_0x2fa1('0xd3')]||undefined,'CampaignId':_0x2f7739[_0x2fa1('0xd4')]||undefined})[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1ee')));_0xee530f[_0x2fa1('0xc6')](createObjHistory(_0x1f2924,_0x2f7739,_0x2fa1('0x1ef'),0x17,_0x2fa1('0x1f0')))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x1f1')));}else{_0xee530f[_0x2fa1('0xcd')](createObjHistory(_0x1f2924,_0x2f7739,'RECALLFAILEDTIMEOUT',0x16,_0x2fa1('0x1f2')),_0x2fa1('0x1f3'),_0x2fa1('0x1f4'));}}}}else{_0x1f2924['outboundBlacklistCallsDay']+=0x1;_0xee530f[_0x2fa1('0xcd')](createObjHistory(_0x1f2924,_0x2f7739,'BLACKLIST',0xd,'Blacklist'),_0x2fa1('0x1f5'),'[Originate][MoveBlacklist]');throw _0x2fa1('0x1f6');}};};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x158')]=function(_0x60294d){var _0x178aee=this;var _0x4f2e57=_0x60294d['limitCalls']-_0x60294d[_0x2fa1('0x73')]-_0x60294d[_0x2fa1('0xbf')];emitCampaignSummary(_0x60294d);if(_0x4f2e57>0x0){if(_0x4f2e57>this[_0x2fa1('0x25')]){_0x4f2e57=this[_0x2fa1('0x25')];}_0x60294d[_0x2fa1('0xbf')]+=_0x4f2e57;this[_0x2fa1('0xc0')](_0x60294d['id'],_0x4f2e57,_0x60294d[_0x2fa1('0x1f7')],_0x60294d)['then'](function(_0x4811a6){_0x60294d[_0x2fa1('0xbf')]-=_0x4f2e57;_0x60294d[_0x2fa1('0xbf')]=_0x60294d['temp']>0x0?_0x60294d[_0x2fa1('0xbf')]:0x0;if(!checkContactEmpty(_0x4811a6)){_0x60294d['message']=_0x2fa1('0x1f8');logger[_0x2fa1('0x7f')]('[getContactCampaign2][Empty]'+_0x60294d['name']);}else{_0x60294d[_0x2fa1('0x73')]+=_0x4811a6[_0x2fa1('0x98')];_0x60294d[_0x2fa1('0x41')]=_0x2fa1('0x1f9');for(var _0x1119c8=0x0;_0x1119c8<_0x4811a6['length'];_0x1119c8+=0x1){_0x60294d[_0x2fa1('0x1fa')]+=0x1;if(_[_0x2fa1('0xdd')](_0x4811a6[_0x1119c8])||_[_0x2fa1('0xdd')](_0x4811a6[_0x1119c8][_0x2fa1('0x166')])||_[_0x2fa1('0xdd')](_0x4811a6[_0x1119c8][_0x2fa1('0x166')][_0x2fa1('0x167')])){_0x178aee[_0x2fa1('0xcb')](_0x2fa1('0x1fb'),_0x60294d,_0x4811a6[_0x1119c8]);}else{_0x178aee[_0x2fa1('0xb6')](_['pick'](_0x4811a6[_0x1119c8],[_0x2fa1('0xd4'),'Contact.phone']))[_0x2fa1('0xb3')](_0x178aee[_0x2fa1('0x1e6')](_0x60294d,_0x4811a6[_0x1119c8]))[_0x2fa1('0xad')](_0x178aee[_0x2fa1('0x1fc')](_0x2fa1('0x1fd'),_0x60294d));}}}})['catch'](loggerGetContactDialer(_0x2fa1('0x1fe'),_0x60294d,_0x4f2e57));}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x152')]=function(_0x3794a0,_0x480741){var _0x4ef6ce=this;var _0x52b2ef=[];var _0x20761b=_0x480741>=0x1?_0x480741:0x1;if(_0x3794a0['dialMethod']===_0x2fa1('0x155')){_0x20761b=0x1;}var _0x529ae3=Math[_0x2fa1('0x1c6')](_0x3794a0[_0x2fa1('0x51')]*_0x20761b)-_0x3794a0[_0x2fa1('0x73')]-_0x3794a0[_0x2fa1('0xbf')];emitVoiceQueueSummary(_0x3794a0);if(_0x3794a0['dialLimitQueue']>0x0){var _0x3fbf9c=_0x3794a0[_0x2fa1('0x1ff')]-_0x3794a0['originated']-_0x3794a0[_0x2fa1('0x56')]-_0x3794a0[_0x2fa1('0xbf')]-_0x3794a0['pTalking'];if(_0x529ae3>_0x3fbf9c){_0x529ae3=_0x3fbf9c;}}if(_0x529ae3>0x0){if(_0x3794a0[_0x2fa1('0x5d')]===_0x2fa1('0x155')){_0x529ae3=0x1;}if(_0x529ae3>this[_0x2fa1('0x25')]){_0x529ae3=this[_0x2fa1('0x25')];}_0x3794a0['temp']+=_0x529ae3;for(var _0x3282e7 in this[_0x2fa1('0x24')]){if(typeof this[_0x2fa1('0x24')][_0x3282e7]!=='undefined'){if(this[_0x2fa1('0x24')][_0x3282e7][_0x2fa1('0xe5')]==='not_inuse'&&this[_0x2fa1('0x24')][_0x3282e7][_0x2fa1('0xab')]===_0x2fa1('0xdb')){_0x52b2ef[_0x2fa1('0x145')](this[_0x2fa1('0x24')][_0x3282e7]['id']);}}}this[_0x2fa1('0xbe')](_0x3794a0['id'],_0x52b2ef,_0x529ae3,_0x3794a0['dialOrderByScheduledAt'],_0x3794a0)['then'](function(_0x5b71e9){_0x3794a0[_0x2fa1('0xbf')]-=_0x529ae3;_0x3794a0['temp']=_0x3794a0['temp']>0x0?_0x3794a0[_0x2fa1('0xbf')]:0x0;if(!checkContactEmpty(_0x5b71e9)){_0x4ef6ce[_0x2fa1('0xb2')](_0x3794a0)[_0x2fa1('0xb3')](sendMessageReschedule(_0x3794a0))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x200')));}else{_0x3794a0[_0x2fa1('0x73')]+=_0x5b71e9[_0x2fa1('0x98')];_0x3794a0[_0x2fa1('0x41')]=_0x3794a0[_0x2fa1('0x5d')]===_0x2fa1('0x155')?_0x2fa1('0x16e'):_0x2fa1('0x1f9');for(var _0x2fc25c=0x0;_0x2fc25c<_0x5b71e9[_0x2fa1('0x98')];_0x2fc25c+=0x1){if(_[_0x2fa1('0xdd')](_0x5b71e9[_0x2fc25c])||_[_0x2fa1('0xdd')](_0x5b71e9[_0x2fc25c]['Contact'])||_[_0x2fa1('0xdd')](_0x5b71e9[_0x2fc25c][_0x2fa1('0x166')]['phone'])){_0x4ef6ce[_0x2fa1('0xcb')](_0x2fa1('0x1fb'),_0x3794a0,_0x5b71e9[_0x2fc25c]);}else{_0x4ef6ce[_0x2fa1('0xb4')](_[_0x2fa1('0xcf')](_0x5b71e9[_0x2fc25c],['VoiceQueueId','Contact.phone']))[_0x2fa1('0xb3')](_0x4ef6ce['checkContactBlack'](_0x3794a0,_0x5b71e9[_0x2fc25c]))[_0x2fa1('0xad')](_0x4ef6ce[_0x2fa1('0x1fc')](_0x2fa1('0x1fb'),_0x3794a0));}}}})['catch'](loggerGetContactDialer(_0x2fa1('0x201'),_0x3794a0,_0x529ae3));}};Dialer[_0x2fa1('0x1d')]['handlePredictive']=function(_0x503576){if(_0x503576[_0x2fa1('0x1ff')]>0x0){var _0x2e4821=_0x503576[_0x2fa1('0x1ff')]-_0x503576[_0x2fa1('0x73')]-_0x503576[_0x2fa1('0x56')];if(_0x2e4821>0x0){this[_0x2fa1('0x202')](_0x503576);}else{loggerPredictiveCalls[_0x2fa1('0x7f')](_0x2fa1('0x203'));}}else{this['tryOriginatePredictive'](_0x503576);}};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x202')]=function(_0x554947){var _0x4e485d=this;var _0x8d2042=[];_0x554947[_0x2fa1('0x73')]+=0x1;for(var _0x1ecc00 in this[_0x2fa1('0x24')]){if(typeof this[_0x2fa1('0x24')][_0x1ecc00]!==_0x2fa1('0xc8')){if(this['agents'][_0x1ecc00][_0x2fa1('0xe5')]==='not_inuse'&&this['agents'][_0x1ecc00][_0x2fa1('0xab')]===_0x2fa1('0xdb')){_0x8d2042[_0x2fa1('0x145')](this[_0x2fa1('0x24')][_0x1ecc00]['id']);}}}this[_0x2fa1('0xbe')](_0x554947['id'],_0x8d2042,0x1,_0x554947[_0x2fa1('0x1f7')],_0x554947)['then'](function(_0xf2caa3){if(!checkContactEmpty(_0xf2caa3)){checkContactLowerLimitOriginate(_0x554947,0x1,0x0);_0x4e485d[_0x2fa1('0xb2')](_0x554947)['then'](sendMessageReschedule(_0x554947))[_0x2fa1('0xad')](loggerCatch(_0x2fa1('0x200')));}else{_0x554947['message']='RUNNING';if(_[_0x2fa1('0xdd')](_0xf2caa3[0x0])||_[_0x2fa1('0xdd')](_0xf2caa3[0x0][_0x2fa1('0x166')])||_['isNil'](_0xf2caa3[0x0][_0x2fa1('0x166')][_0x2fa1('0x167')])){_0x4e485d[_0x2fa1('0xcb')](_0x2fa1('0x1fb'),_0x554947,_0xf2caa3[0x0]);}else{_0x4e485d[_0x2fa1('0xb4')](_['pick'](_0xf2caa3[0x0],[_0x2fa1('0xd3'),_0x2fa1('0x204')]))[_0x2fa1('0xb3')](_0x4e485d[_0x2fa1('0x1e6')](_0x554947,_0xf2caa3[0x0]))['catch'](_0x4e485d[_0x2fa1('0x1fc')](_0x2fa1('0x205'),_0x554947));}}})[_0x2fa1('0xad')](loggerGetContactDialer('[getContactDialerPredictive]',_0x554947,0x1));emitVoiceQueueSummary(_0x554947);};Dialer[_0x2fa1('0x1d')][_0x2fa1('0x1e1')]=function(_0x43d3f6,_0x4ec696,_0x35c146,_0x37702e,_0x2f9965,_0x3f6d7d){loggerPredictive[_0x2fa1('0x7f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x2fa1('0x7f')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43d3f6);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x206'),_0x4ec696);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x207'),_0x35c146);loggerPredictive['info'](_0x2fa1('0x208'),_0x37702e);loggerPredictive[_0x2fa1('0x7f')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f9965);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x87'));return new BPromise(function(_0x433ef5,_0x331d19){if(_0x43d3f6<=0x0||isNaN(_0x43d3f6)){return _0x331d19(msgResponse('[abandonmentRate]',_0x2fa1('0x209'),_0x2fa1('0x20a')+_0x43d3f6));}if(_0x35c146<=0x0||isNaN(_0x35c146)){return _0x331d19(msgResponse('[abandonmentRate]',_0x2fa1('0x209'),_0x2fa1('0x20b')+_0x35c146));}if(_0x37702e<=0x0||isNaN(_0x37702e)){return _0x331d19(msgResponse(_0x2fa1('0x20c'),_0x2fa1('0x209'),'p\x20=\x20'+_0x37702e));}if(_0x4ec696<=0x0||isNaN(_0x4ec696)){return _0x331d19(msgResponse(_0x2fa1('0x20c'),_0x2fa1('0x209'),'interval\x20=\x20'+_0x4ec696));}if(_0x2f9965<=0x0||isNaN(_0x2f9965)){return _0x331d19(msgResponse(_0x2fa1('0x20c'),_0x2fa1('0x209'),_0x2fa1('0x20d')+_0x2f9965));}_0x3f6d7d=_0x3f6d7d||0x0;var _0x290228=0x1/_0x35c146;var _0x108ba7=0x0;var _0x2e55ce=0x0;var _0x3050d0=0x0;var _0x5ad84f=0x0;for(var _0x3f46d7=0x0;_0x3050d0<_0x2f9965;_0x3f46d7+=0x1){_0x2e55ce=_0x3f46d7/_0x4ec696;_0x108ba7=(_0x37702e*_0x2e55ce+_0x3f6d7d)/_0x290228;_0x3050d0=erlangb(_0x108ba7,_0x43d3f6);_0x5ad84f=_0x108ba7/_0x43d3f6*(0x1-erlangb(_0x108ba7,_0x43d3f6));}return _0x433ef5({'erlangCalls':_0x3f46d7,'erlangCallToSecond':_0x4ec696/_0x3f46d7,'erlangAbandonmentRate':_0x3050d0,'erlangBusyFactor':_0x5ad84f});});};Dialer['prototype'][_0x2fa1('0x1da')]=function(_0x282dc6,_0xd2a23,_0x1e2cc4,_0x396d25,_0x50a13c,_0x59dd66){loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x20e'));loggerPredictive['info'](_0x2fa1('0x20f'),_0x282dc6);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x206'),_0xd2a23);loggerPredictive[_0x2fa1('0x7f')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e2cc4);loggerPredictive['info'](_0x2fa1('0x208'),_0x396d25);loggerPredictive[_0x2fa1('0x7f')](_0x2fa1('0x210'),_0x50a13c);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3a6381,_0x11348a){if(_0x282dc6<=0x0||isNaN(_0x282dc6)){return _0x11348a(msgResponse('[busyFactor]',_0x2fa1('0x209'),_0x2fa1('0x20a')+_0x282dc6));}if(_0x1e2cc4<=0x0||isNaN(_0x1e2cc4)){return _0x11348a(msgResponse(_0x2fa1('0x211'),_0x2fa1('0x209'),_0x2fa1('0x20b')+_0x1e2cc4));}if(_0x396d25<=0x0||isNaN(_0x396d25)){return _0x11348a(msgResponse(_0x2fa1('0x211'),_0x2fa1('0x209'),_0x2fa1('0x212')+_0x396d25));}if(_0xd2a23<=0x0||isNaN(_0xd2a23)){return _0x11348a(msgResponse(_0x2fa1('0x211'),'Error','interval\x20=\x20'+_0xd2a23));}if(_0x50a13c<=0x0||isNaN(_0x50a13c)){return _0x11348a(msgResponse(_0x2fa1('0x211'),'Error',_0x2fa1('0x213')+_0x50a13c));}_0x59dd66=_0x59dd66||0x0;var _0xe22390=0x1/_0x1e2cc4;var _0x5f46cc=0x0;var _0x26b31e=0x0;var _0x58719f=0x0;var _0x1e914d=0x0;for(var _0x451b0a=0x0;_0x1e914d<_0x50a13c;_0x451b0a+=0x1){_0x26b31e=_0x451b0a/_0xd2a23;_0x5f46cc=(_0x396d25*_0x26b31e+_0x59dd66)/_0xe22390;_0x58719f=erlangb(_0x5f46cc,_0x282dc6);_0x1e914d=_0x5f46cc/_0x282dc6*(0x1-erlangb(_0x5f46cc,_0x282dc6));}return _0x3a6381({'erlangCalls':_0x451b0a,'erlangCallToSecond':_0xd2a23/_0x451b0a,'erlangAbandonmentRate':_0x58719f,'erlangBusyFactor':_0x1e914d});});};module[_0x2fa1('0x214')]=Dialer; \ No newline at end of file +var _0xf4eb=['_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','finally','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','command','interval','content','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','OriginateError','[originate][error]','getQueue','isSuccess','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','erlangCalls','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','[countReScheduled]\x20','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','md5','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperBlack','./action','./history','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','sequence','preview','voiceQueues','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncHangup','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','ivr','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','info','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','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','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','---------\x20ErlangB\x20---------','Agent\x20Busy\x20Factor:\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','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','inspect','error','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','loopClearZombieChannels','[uniqueid]','clearZombieChannels','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','campaigns','countReScheduled','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','SIP/%s','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','uniqueid','HangupInAMD','membername','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countnoanswerretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','VoiceQueueId','[syncHangupInAMDIvr][createHistory]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','agents','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]'];(function(_0x1bdaa7,_0x16f164){var _0x598e78=function(_0x1eb468){while(--_0x1eb468){_0x1bdaa7['push'](_0x1bdaa7['shift']());}};_0x598e78(++_0x16f164);}(_0xf4eb,0xec));var _0xbf4e=function(_0x517184,_0x220b74){_0x517184=_0x517184-0x0;var _0x312933=_0xf4eb[_0x517184];return _0x312933;};'use strict';var util=require(_0xbf4e('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0xbf4e('0x1'));var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0xbf4e('0x2'));var logger=require(_0xbf4e('0x3'))(_0xbf4e('0x4'));var loggerBooked=require(_0xbf4e('0x3'))(_0xbf4e('0x5'));var loggerPredictive=require(_0xbf4e('0x3'))(_0xbf4e('0x6'));var loggerPredictiveCalls=require('../../../config/logger')(_0xbf4e('0x7'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0xbf4e('0x8'));config[_0xbf4e('0x9')]=_[_0xbf4e('0xa')](config[_0xbf4e('0x9')],{'host':_0xbf4e('0xb'),'port':0x18eb});var io=require(_0xbf4e('0xc'))(new Redis(config[_0xbf4e('0x9')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xbf4e('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xbf4e('0xe'));var History=require(_0xbf4e('0xf'));var Final=require('./final');var AgentComplete=require(_0xbf4e('0x10'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xbf4e('0x11')][_0xbf4e('0x12')]||_0xbf4e('0x13');var strategy={'rrmemory':_0xbf4e('0x14'),'roundrobin':_0xbf4e('0x15')};var Sequence=function(){};Sequence[_0xbf4e('0x16')]['enqueue']=function(_0x59fb15){this[_0xbf4e('0x17')]=this[_0xbf4e('0x17')]?this[_0xbf4e('0x17')]['finally'](_0x59fb15):_0x59fb15();};function Dialer(_0x14110b,_0x2c292c){this[_0xbf4e('0x18')]=new Sequence();this[_0xbf4e('0x19')]=_0x2c292c;this['voiceQueues']=_0x14110b[_0xbf4e('0x1a')];this['campaigns']=_0x14110b['campaigns'];this['agents']=_0x14110b['agents'];this[_0xbf4e('0x1b')]=_0x14110b[_0xbf4e('0x1b')];this[_0xbf4e('0x1c')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0xbf4e('0x1d')]={};this[_0xbf4e('0x1e')]={};this[_0xbf4e('0x1f')]={};this[_0xbf4e('0x20')]={};this[_0xbf4e('0x21')]={};this[_0xbf4e('0x22')]={};this[_0xbf4e('0x23')]={};this[_0xbf4e('0x24')]={};this[_0xbf4e('0x25')]={};ami['on'](_0xbf4e('0x26'),this[_0xbf4e('0x27')]['bind'](this));ami['on'](_0xbf4e('0x28'),this[_0xbf4e('0x29')]['bind'](this));ami['on'](_0xbf4e('0x2a'),this[_0xbf4e('0x2b')][_0xbf4e('0x2c')](this));ami['on'](_0xbf4e('0x2d'),this[_0xbf4e('0x2e')]['bind'](this));ami['on'](_0xbf4e('0x2f'),this[_0xbf4e('0x30')][_0xbf4e('0x2c')](this));ami['on']('hangup',this[_0xbf4e('0x31')]['bind'](this));ami['on']('newexten',this[_0xbf4e('0x32')]['bind'](this));ami['on'](_0xbf4e('0x33'),this[_0xbf4e('0x34')][_0xbf4e('0x2c')](this));ami['on'](_0xbf4e('0x35'),this['syncQueueMember'][_0xbf4e('0x2c')](this));ami['on'](_0xbf4e('0x36'),this[_0xbf4e('0x37')]['bind'](this));this[_0xbf4e('0x38')]();this['loopClearZombieChannels']();}function isNotNull(_0x1dfa81){return _0x1dfa81!==null&&!_[_0xbf4e('0x39')](_0x1dfa81);}function checkIsLoggedIn(_0xb8b58e,_0x498dbd){return function(){if(_0x498dbd<=0x0){_0xb8b58e[_0xbf4e('0x3a')]=_0xbf4e('0x3b');throw _0xb8b58e[_0xbf4e('0x3c')]+_0xbf4e('0x3d');}};}function isActive(_0x2343dd){return _0x2343dd;}function checkIsActive(_0x3b5776,_0x5a7c71){return function(){if(!isActive(_0x5a7c71)){_0x3b5776[_0xbf4e('0x3a')]=_0xbf4e('0x3e');throw _0x3b5776['name']+_0xbf4e('0x3f');}};}function checkInterval(_0x26a375){return function(){if(!isNotNull(_0x26a375['Interval'])){_0x26a375[_0xbf4e('0x3a')]='INTERVAL_IS_NULL';throw _0x26a375[_0xbf4e('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x26a375[_0xbf4e('0x40')][_0xbf4e('0x41')])){_0x26a375[_0xbf4e('0x3a')]='INTERVAL_IS_NULL';throw _0x26a375[_0xbf4e('0x3c')]+_0xbf4e('0x42');}if(!isNotNull(_[_0xbf4e('0x43')](_0x26a375[_0xbf4e('0x40')][_0xbf4e('0x41')]))){_0x26a375[_0xbf4e('0x3a')]='INTERVAL_IS_NULL';throw _0x26a375[_0xbf4e('0x3c')]+_0xbf4e('0x42');}};}function msgResponse(_0x25b837,_0x3bba55,_0x31d49a){return{'action':_0x25b837,'response':_0x3bba55,'message':_0x31d49a,'stack':_0x31d49a};}function myreject(_0x5b7ea1){return function(_0x4864bd){return _0x5b7ea1(msgResponse('[ifTime][Action]','Error',JSON[_0xbf4e('0x44')](_0x4864bd)));};}function getSeconds(_0x17a1a1,_0x91b52f){var _0x2693ba=moment(_0x17a1a1)[_0xbf4e('0x45')](0x0);var _0x257b74=moment(_0x91b52f)[_0xbf4e('0x45')](0x0);return _0x2693ba[_0xbf4e('0x46')](_0x257b74,_0xbf4e('0x47'));}function emit(_0x54527d,_0x4f6e93,_0x303fd8){io['to'](_0x54527d)[_0xbf4e('0x48')](_0x4f6e93,_0x303fd8);}function emitVoiceQueueSummary(_0x2cf1b0){if(_0x2cf1b0['type']===_0xbf4e('0x49')){var _0x4e72a2={'id':_0x2cf1b0['id'],'name':_0x2cf1b0[_0xbf4e('0x3c')],'strategy':_0x2cf1b0[_0xbf4e('0x4a')],'answered':_0x2cf1b0[_0xbf4e('0x4b')],'available':_0x2cf1b0[_0xbf4e('0x4c')],'loggedIn':_0x2cf1b0['loggedIn'],'pTalking':_0x2cf1b0[_0xbf4e('0x4d')],'sumBillable':_0x2cf1b0[_0xbf4e('0x4e')],'sumDuration':_0x2cf1b0[_0xbf4e('0x4f')],'sumHoldTime':_0x2cf1b0[_0xbf4e('0x50')]||0x0,'talking':_0x2cf1b0['talking'],'total':_0x2cf1b0[_0xbf4e('0x51')],'type':_0x2cf1b0[_0xbf4e('0x52')],'unmanaged':_0x2cf1b0[_0xbf4e('0x53')],'abandoned':_0x2cf1b0[_0xbf4e('0x54')],'waiting':_0x2cf1b0[_0xbf4e('0x55')],'loggedInDb':_0x2cf1b0[_0xbf4e('0x56')],'dialActive':_0x2cf1b0[_0xbf4e('0x57')],'dialMethod':_0x2cf1b0['dialMethod'],'dialOriginateCallerIdName':_0x2cf1b0[_0xbf4e('0x58')],'dialOriginateCallerIdNumber':_0x2cf1b0[_0xbf4e('0x59')],'dialOriginateTimeout':_0x2cf1b0['dialOriginateTimeout'],'dialPrefix':_0x2cf1b0['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2cf1b0[_0xbf4e('0x5a')],'outboundAnswerCallsDay':_0x2cf1b0[_0xbf4e('0x5b')],'outboundBlacklistCallsDay':_0x2cf1b0['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2cf1b0['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x2cf1b0[_0xbf4e('0x5c')],'outboundDropCallsDayACS':_0x2cf1b0[_0xbf4e('0x5d')],'outboundDropCallsDayCallersExit':_0x2cf1b0[_0xbf4e('0x5e')],'outboundDropCallsDayTimeout':_0x2cf1b0[_0xbf4e('0x5f')],'outboundNoAnswerCallsDay':_0x2cf1b0[_0xbf4e('0x60')],'outboundNoSuchCallsDay':_0x2cf1b0[_0xbf4e('0x61')],'outboundOriginateFailureCallsDay':_0x2cf1b0['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2cf1b0[_0xbf4e('0x62')],'outboundRejectCallsDay':_0x2cf1b0[_0xbf4e('0x63')],'outboundUnknownCallsDay':_0x2cf1b0['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2cf1b0['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2cf1b0['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2cf1b0['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x2cf1b0[_0xbf4e('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x2cf1b0['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x2cf1b0[_0xbf4e('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x2cf1b0[_0xbf4e('0x66')],'predictiveIntervalHitRate':_0x2cf1b0['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2cf1b0['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2cf1b0[_0xbf4e('0x67')],'predictiveIntervalAvailable':_0x2cf1b0[_0xbf4e('0x68')],'predictiveIntervalTotalCalls':_0x2cf1b0[_0xbf4e('0x69')],'message':_0x2cf1b0[_0xbf4e('0x3a')],'originated':_0x2cf1b0[_0xbf4e('0x6a')],'erlangCalls':_0x2cf1b0['erlangCalls'],'erlangCallToSecond':_0x2cf1b0[_0xbf4e('0x6b')],'erlangAbandonmentRate':_0x2cf1b0[_0xbf4e('0x6c')],'erlangBusyFactor':_0x2cf1b0[_0xbf4e('0x6d')],'startPredictive':_0x2cf1b0[_0xbf4e('0x21')],'startProgressive':_0x2cf1b0[_0xbf4e('0x22')]};if(_0x2cf1b0[_0xbf4e('0x6e')]){_0x4e72a2[_0xbf4e('0x6e')]={'id':_0x2cf1b0[_0xbf4e('0x6e')]['id'],'name':_0x2cf1b0['Trunk'][_0xbf4e('0x3c')],'active':_0x2cf1b0[_0xbf4e('0x6e')][_0xbf4e('0x6f')],'callerid':_0x2cf1b0[_0xbf4e('0x6e')][_0xbf4e('0x70')]};}if(_0x2cf1b0[_0xbf4e('0x40')]){_0x4e72a2[_0xbf4e('0x40')]={'id':_0x2cf1b0[_0xbf4e('0x40')]['id'],'name':_0x2cf1b0[_0xbf4e('0x40')][_0xbf4e('0x3c')]};}var _0x2fdba9=md5(JSON[_0xbf4e('0x44')](_0x4e72a2));if(_0x2cf1b0[_0xbf4e('0x1')]!==_0x2fdba9){_0x2cf1b0[_0xbf4e('0x1')]=_0x2fdba9;emit(util[_0xbf4e('0x71')](_0xbf4e('0x72'),_0x4e72a2[_0xbf4e('0x3c')]),'voice_queue:save',_0x4e72a2);}}}function emitCampaignSummary(_0x22d8ef){if(_0x22d8ef[_0xbf4e('0x52')]===_0xbf4e('0x73')){emit(util['format'](_0xbf4e('0x74'),_0x22d8ef['name']),'campaign:save',_0x22d8ef);}}function checkGetDataPredictive(_0x3832c3){if(isNotNull(_0x3832c3)&&!_[_0xbf4e('0x43')](_0x3832c3)){loggerPredictive['info'](_0xbf4e('0x75'));loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x77'),_0x3832c3[_0xbf4e('0x69')]);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x78'),_0x3832c3[_0xbf4e('0x79')]);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x7a'),_0x3832c3[_0xbf4e('0x7b')]);loggerPredictive[_0xbf4e('0x76')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3832c3['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x7c'),_0x3832c3[_0xbf4e('0x7d')]);loggerPredictive['info'](_0xbf4e('0x7e'),_0x3832c3[_0xbf4e('0x7f')]);loggerPredictive['info']('---------------------------');if(_0x3832c3[_0xbf4e('0x69')]>0x0){if(!_['isUndefined'](_0x3832c3['predictiveIntervalAvgTalktime'])&&_0x3832c3[_0xbf4e('0x7f')]>0x0){return!![];}loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x80'));if(!_[_0xbf4e('0x39')](_0x3832c3[_0xbf4e('0x7d')])&&_0x3832c3['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xbf4e('0x76')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xbf4e('0x76')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xbf4e('0x76')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xab6991){return function(_0x6c593a){loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x81'));loggerPredictive[_0xbf4e('0x76')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6c593a['erlangCalls']);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6c593a[_0xbf4e('0x6b')]);loggerPredictive[_0xbf4e('0x76')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6c593a[_0xbf4e('0x6c')]);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x82'),_0x6c593a[_0xbf4e('0x6d')]);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x83'),_0x6c593a[_0xbf4e('0x6c')]);loggerPredictive['info'](_0xbf4e('0x84'));_[_0xbf4e('0x85')](_0xab6991,_0x6c593a);};}function getDiff(_0x42e117){var _0x5e548a=moment()['milliseconds'](0x0);var _0x64d8ea=moment(_0x42e117)[_0xbf4e('0x45')](0x0);return _0x5e548a[_0xbf4e('0x46')](_0x64d8ea,'seconds');}function ifInterval(_0x432967,_0x3d0f2c){if(_[_0xbf4e('0x39')](_0x3d0f2c)){return![];}return getDiff(_0x3d0f2c)<_0x432967*0x3c;}function freeVariablesPredictive(_0x4039a4){if(isNotNull(_0x4039a4)){if(!_[_0xbf4e('0x39')](_0x4039a4[_0xbf4e('0x22')])){_0x4039a4[_0xbf4e('0x22')]=undefined;loggerPredictive[_0xbf4e('0x76')](_0x4039a4[_0xbf4e('0x3c')],_0xbf4e('0x86'));}if(!_[_0xbf4e('0x39')](_0x4039a4[_0xbf4e('0x21')])){_0x4039a4['startPredictive']=undefined;loggerPredictive[_0xbf4e('0x76')](_0x4039a4['name'],_0xbf4e('0x87'));}if(!_[_0xbf4e('0x39')](_0x4039a4[_0xbf4e('0x88')])){clearInterval(_0x4039a4[_0xbf4e('0x88')]);_0x4039a4[_0xbf4e('0x88')]=undefined;loggerPredictive[_0xbf4e('0x76')](_0x4039a4[_0xbf4e('0x3c')],_0xbf4e('0x89'));}}}function erlangb(_0x4ea377,_0x1aeedd){if(_0x1aeedd===0x0){return 0x0;}var _0x325d09=0x1;for(var _0x22d5e1=0x1;_0x22d5e1<=_0x1aeedd;_0x22d5e1+=0x1){_0x325d09=0x1+_0x325d09*_0x22d5e1/_0x4ea377;}return 0x1/_0x325d09;}function isVoiceQueueOutbound(_0x33f9c4){return _0x33f9c4===_0xbf4e('0x49');}function isNotPreview(_0x5f3deb){return _0x5f3deb!==_0xbf4e('0x19');}function isCampaignIvr(_0x753f25){return _0x753f25===_0xbf4e('0x73');}function getCallerId(_0x1770ca,_0x12f19f,_0x2c606b){if(!_['isUndefined'](_0x2c606b)&&typeof _0x2c606b===_0xbf4e('0x8a')&&!_['isEmpty'](_0x2c606b)){if(!_[_0xbf4e('0x39')](_0x12f19f)&&typeof _0x12f19f===_0xbf4e('0x8a')&&!_[_0xbf4e('0x43')](_0x12f19f)){return util[_0xbf4e('0x71')]('\x22%s\x22\x20<%s>',_0x12f19f,_0x2c606b);}return util[_0xbf4e('0x71')]('\x22%s\x22\x20<%s>',_0x2c606b,_0x2c606b);}if(!_['isUndefined'](_0x1770ca)&&typeof _0x1770ca===_0xbf4e('0x8a')&&!_[_0xbf4e('0x43')](_0x1770ca)){return _0x1770ca;}return _0xbf4e('0x8b');}function loggerCatchQueueSummary(_0x56f3e0,_0x1c0b76){return function(_0x43bba9){freeVariablesPredictive(_0x1c0b76);emitVoiceQueueSummary(_0x1c0b76);emitCampaignSummary(_0x1c0b76);loggerSyncQueueSummary['error'](_0x56f3e0,util[_0xbf4e('0x8c')](_0x43bba9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x42df5f,_0x4405b9){return function(_0x137224){loggerPredictive[_0xbf4e('0x8d')](_0x4405b9[_0xbf4e('0x3c')],_0x42df5f);loggerPredictive[_0xbf4e('0x8d')](_0x137224[_0xbf4e('0x8e')]);freeVariablesPredictive(_0x4405b9);};}function loggerCatch(_0x2bd74f){return function(_0x52c527){logger[_0xbf4e('0x8d')](_0x2bd74f,util[_0xbf4e('0x8c')](_0x52c527,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2b2545){return _0x2b2545&&!_[_0xbf4e('0x39')](_0x2b2545)&&_0x2b2545['length']>0x0;}function decremetOriginate(_0x29a55f){if(!_[_0xbf4e('0x39')](_0x29a55f)&&_0x29a55f!==null){if(typeof _0x29a55f[_0xbf4e('0x6a')]!==_0xbf4e('0x8f')){if(_0x29a55f[_0xbf4e('0x6a')]>0x0){_0x29a55f[_0xbf4e('0x6a')]-=0x1;}else{logger[_0xbf4e('0x8d')](_0xbf4e('0x90'));}}}else{logger[_0xbf4e('0x8d')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x24c5a1,_0x47ef56,_0x11dcdb){if(_0x47ef56>_0x11dcdb){for(var _0x2ae98a=0x0;_0x2ae98a<_0x47ef56-_0x11dcdb;_0x2ae98a+=0x1){decremetOriginate(_0x24c5a1);}}}function loggerGetContactDialer(_0x34116f,_0x2e335f,_0xc5c749){return function(_0x4db6d7){checkContactLowerLimitOriginate(_0x2e335f,_0xc5c749,0x0);logger[_0xbf4e('0x8d')](_0x34116f,util[_0xbf4e('0x8c')](_0x4db6d7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x16dd5f){return function(_0x4930a3){if(isNotNull(_0x4930a3)&&isNotNull(_0x4930a3[0x0])){if(_0x4930a3[0x0][_0xbf4e('0x91')]>0x0){_0x16dd5f[_0xbf4e('0x3a')]=_0xbf4e('0x92');logger['info'](_0xbf4e('0x93')+_0x16dd5f[_0xbf4e('0x3c')],_0x4930a3[0x0][_0xbf4e('0x91')],_0xbf4e('0x94'));}else{_0x16dd5f[_0xbf4e('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xbf4e('0x76')]('[getContactDialer2][Empty]'+_0x16dd5f[_0xbf4e('0x3c')]);}}};}function notSendMessagesQueue(_0x504723){if(_0x504723[_0xbf4e('0x95')]){freeVariablesPredictive(_0x504723);if(_0x504723['originated']===0x0&&_0x504723[_0xbf4e('0x96')]===0x0&&_0x504723['waiting']===0x0&&(_0x504723[_0xbf4e('0x4d')]||0x0)===0x0){_0x504723[_0xbf4e('0x95')]=![];_0x504723[_0xbf4e('0x4c')]=0x0;_0x504723[_0xbf4e('0x3a')]=_0xbf4e('0x3e');loggerSyncQueueSummary[_0xbf4e('0x8d')](_0xbf4e('0x97'),_0x504723['name'],_0xbf4e('0x98'));}else{_0x504723[_0xbf4e('0x3a')]=_0xbf4e('0x99');loggerSyncQueueSummary[_0xbf4e('0x8d')](_0xbf4e('0x97'),_0x504723[_0xbf4e('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x504723);}}function notSendMessagesCampaign(_0x207d2f){if(_0x207d2f[_0xbf4e('0x95')]){if(_0x207d2f['originated']===0x0){_0x207d2f[_0xbf4e('0x95')]=![];_0x207d2f[_0xbf4e('0x3a')]=_0xbf4e('0x3e');loggerSyncQueueSummary[_0xbf4e('0x8d')](_0xbf4e('0x9a'),_0x207d2f[_0xbf4e('0x3c')],_0xbf4e('0x98'));}else{_0x207d2f[_0xbf4e('0x3a')]=_0xbf4e('0x99');loggerSyncQueueSummary['error'](_0xbf4e('0x9a'),_0x207d2f[_0xbf4e('0x3c')],_0xbf4e('0x9b'));}emitCampaignSummary(_0x207d2f);}}function createObjHistory(_0x4ee7ac,_0x44c6f2,_0x27ebde,_0x563f14,_0x3d17dd){_0x4ee7ac[_0xbf4e('0x3a')]=_0x27ebde;var _0x380d25=new Action(_0x4ee7ac,_0x44c6f2);var _0xef121e=new History(_0x380d25);_0xef121e[_0xbf4e('0x9c')]=_0x563f14;_0xef121e[_0xbf4e('0x9d')]=_0x3d17dd;_0xef121e[_0xbf4e('0x9e')]=_0x380d25[_0xbf4e('0x9f')];return _0xef121e;}Dialer[_0xbf4e('0x16')][_0xbf4e('0xa0')]=function(){var _0x55bc7c=this;setInterval(function(){_0x55bc7c['clearZombieChannels'](_0x55bc7c[_0xbf4e('0x1f')],_0xbf4e('0xa1'));_0x55bc7c[_0xbf4e('0xa2')](_0x55bc7c[_0xbf4e('0x1d')],'[actions]');},0x32c8);};Dialer[_0xbf4e('0x16')][_0xbf4e('0xa2')]=function(_0x299af9,_0x99d48d){var _0x37876f=this;for(var _0xf27015 in _0x299af9){if(typeof _0x299af9[_0xf27015]!==_0xbf4e('0x8f')){this['sequence'][_0xbf4e('0xa3')](function(){if(!_[_0xbf4e('0xa4')](_0x299af9[_0xf27015])){return ami[_0xbf4e('0xa5')]({'action':_0xbf4e('0xa6'),'channel':_0x299af9[_0xf27015][_0xbf4e('0xa7')]})[_0xbf4e('0xa8')](function(_0x521d8e){if(_0x521d8e[_0xbf4e('0x3a')]===_0xbf4e('0xa9')){setTimeout(function(){if(_0x299af9[_0xf27015]&&_0x299af9[_0xf27015][_0xbf4e('0x52')]!==_0xbf4e('0x73')){_0x37876f[_0xbf4e('0xaa')](_0x37876f[_0xbf4e('0x1a')][_0x299af9[_0xf27015][_0xbf4e('0xab')]]);logger['error']('[Dialer][checkChannel]',_0x99d48d,_0xf27015,_0x299af9[_0xf27015][_0xbf4e('0xab')]);delete _0x299af9[_0xf27015];}if(_0x299af9[_0xf27015]&&_0x299af9[_0xf27015][_0xbf4e('0x52')]===_0xbf4e('0x73')){_0x37876f[_0xbf4e('0xaa')](_0x37876f[_0xbf4e('0xac')][_0x299af9[_0xf27015][_0xbf4e('0xab')]]);logger[_0xbf4e('0x8d')]('[Dialer][checkChannel][ivr]',_0x99d48d,_0xf27015,_0x299af9[_0xf27015][_0xbf4e('0xab')]);delete _0x299af9[_0xf27015];}},0x2328);}});}});}}};Dialer[_0xbf4e('0x16')][_0xbf4e('0xad')]=function(_0x54ee1a){return BPromise['resolve']()[_0xbf4e('0xae')](cmHopper[_0xbf4e('0xad')](_0x54ee1a))[_0xbf4e('0xa8')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xbf4e('0x16')][_0xbf4e('0xaf')]=function(_0x2870d4){return BPromise['resolve']()[_0xbf4e('0xae')](cmHopperBlack[_0xbf4e('0xaf')](_0x2870d4))[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xb0')));};Dialer[_0xbf4e('0x16')][_0xbf4e('0xb1')]=function(_0xbcac6d){return BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](cmHopperBlack[_0xbf4e('0xb1')](_0xbcac6d))[_0xbf4e('0xa8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xbf4e('0x16')]['averageHandleTime']=function(_0x2de373){return BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](cmHopperHistory[_0xbf4e('0xb3')](_0x2de373))['catch'](loggerCatch(_0xbf4e('0xb4')));};Dialer[_0xbf4e('0x16')]['rescheduleContact']=function(_0x1b555c){return BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](cmHopper[_0xbf4e('0xb5')](_0x1b555c))[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xb6')));};Dialer[_0xbf4e('0x16')][_0xbf4e('0xb7')]=function(_0x9c06e,_0x5f461a,_0x426445){return BPromise[_0xbf4e('0xb2')]()['then'](cmHopper[_0xbf4e('0xb7')](_0x9c06e,_0x5f461a,_0x426445))[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xb8')));};Dialer[_0xbf4e('0x16')][_0xbf4e('0xb9')]=function(_0x27d975,_0xae2904,_0x46d3db,_0x512dd1,_0x1a534d){return BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](cmHopper[_0xbf4e('0xb9')](_0x27d975,_0xae2904,_0x46d3db,_0x512dd1))[_0xbf4e('0xa8')](function(_0x50b409){_0x1a534d[_0xbf4e('0xba')]-=_0x46d3db;_0x1a534d[_0xbf4e('0xba')]=_0x1a534d[_0xbf4e('0xba')]>0x0?_0x1a534d[_0xbf4e('0xba')]:0x0;loggerCatch(_0xbf4e('0xbb'))(_0x50b409);});};Dialer[_0xbf4e('0x16')][_0xbf4e('0xbc')]=function(_0x8cea1b,_0x439b10,_0x5f2c43,_0x50106f){return BPromise['resolve']()[_0xbf4e('0xae')](cmHopper[_0xbf4e('0xbc')](_0x8cea1b,_0x439b10,_0x5f2c43))[_0xbf4e('0xa8')](function(_0x56add4){_0x50106f[_0xbf4e('0xba')]-=_0x439b10;_0x50106f[_0xbf4e('0xba')]=_0x50106f['temp']>0x0?_0x50106f[_0xbf4e('0xba')]:0x0;loggerCatch(_0xbf4e('0xbd'))(_0x56add4);});};Dialer['prototype'][_0xbf4e('0xbe')]=function(_0x5844a9){return BPromise[_0xbf4e('0xb2')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x5844a9))['catch'](loggerCatch(_0xbf4e('0xbf')));};Dialer[_0xbf4e('0x16')]['moveContactManagedDialer']=function(_0x29d9ed){return BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](cmHopper[_0xbf4e('0xc0')](_0x29d9ed))[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xc1')));};Dialer[_0xbf4e('0x16')][_0xbf4e('0xc2')]=function(_0x14bf39){return BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](cmHopperHistory['createHistory'](_0x14bf39))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0xbf4e('0x16')][_0xbf4e('0xaa')]=function(_0x4e8f19){if(!_[_0xbf4e('0x39')](_0x4e8f19)&&_0x4e8f19!==null){if(typeof _0x4e8f19[_0xbf4e('0x6a')]!==_0xbf4e('0x8f')){if(_0x4e8f19[_0xbf4e('0x6a')]>0x0){_0x4e8f19['originated']-=0x1;}else{logger[_0xbf4e('0x8d')](_0xbf4e('0xc3'));}}}else{logger[_0xbf4e('0x8d')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xbf4e('0x16')][_0xbf4e('0xc4')]=function(_0x3f7ae0,_0x92e714){var _0x2d46b0=this;return function(_0xa32ada){_0x2d46b0[_0xbf4e('0xaa')](_0x92e714);logger[_0xbf4e('0x8d')](_0x3f7ae0,util[_0xbf4e('0x8c')](_0xa32ada,{'showHidden':![],'depth':null}));};};Dialer[_0xbf4e('0x16')][_0xbf4e('0xc5')]=function(_0x5cc246,_0x477a0,_0x5dfb54){var _0x5e0dca={'state':0x19,'statedesc':_0xbf4e('0xc6')};this['updateOriginated'](_0x477a0);this[_0xbf4e('0xc7')](_[_0xbf4e('0x85')](_0x5e0dca,_[_0xbf4e('0xc8')](_0x5dfb54,[_0xbf4e('0xc9'),_0xbf4e('0xca'),'UserId','VoiceQueueId',_0xbf4e('0xcb')])),_0xbf4e('0xcc'),_0xbf4e('0xcd'));logger[_0xbf4e('0x8d')](_0x5cc246);};Dialer[_0xbf4e('0x16')]['isSuccess']=function(_0x271ea1){return _0x271ea1===_0xbf4e('0xce');};Dialer[_0xbf4e('0x16')]['isTrunkReachable']=function(_0xdf4d72){return!_['isUndefined'](_0xdf4d72)&&_0xdf4d72&&!_[_0xbf4e('0x39')](_0xdf4d72['name'])&&!_['isUndefined'](_0xdf4d72[_0xbf4e('0x6f')])&&_0xdf4d72[_0xbf4e('0x6f')]&&(this[_0xbf4e('0x1b')][util[_0xbf4e('0x71')](_0xbf4e('0xcf'),_0xdf4d72[_0xbf4e('0x3c')])][_0xbf4e('0xa6')]===_0xbf4e('0xd0')||this['trunks'][util[_0xbf4e('0x71')](_0xbf4e('0xcf'),_0xdf4d72[_0xbf4e('0x3c')])][_0xbf4e('0xa6')]===_0xbf4e('0xd1'));};Dialer['prototype']['saveInDb']=function(_0x4ce422,_0x354d2a,_0x488efe){this[_0xbf4e('0xc2')](_0x4ce422)[_0xbf4e('0xa8')](loggerCatch(_0x354d2a));this[_0xbf4e('0xc0')](_0x4ce422)[_0xbf4e('0xa8')](loggerCatch(_0x488efe));};Dialer['prototype']['syncVarSet']=function(_0x5f07a5){var _0x1716cf=this[_0xbf4e('0x1f')][_0x5f07a5['uniqueid']];var _0x1d717e;if(!_[_0xbf4e('0xa4')](_0x5f07a5)&&!_[_0xbf4e('0xa4')](_0x5f07a5['variable'])&&!_['isNil'](_0x5f07a5[_0xbf4e('0xd2')][_0xbf4e('0xd3')])&&_0x5f07a5[_0xbf4e('0xd4')]===_0xbf4e('0xd5')&&_0x1716cf){if(_0x1716cf[_0xbf4e('0x52')]!=='ivr'&&this['voiceQueues'][_0x1716cf[_0xbf4e('0xab')]][_0xbf4e('0xd6')]&&_0x5f07a5[_0xbf4e('0xd7')]==='HANGUP'){delete this['uniqueId'][_0x5f07a5[_0xbf4e('0xd8')]];this[_0xbf4e('0xaa')](this[_0xbf4e('0x1a')][_0x1716cf['queue']]);this[_0xbf4e('0x1a')][_0x1716cf[_0xbf4e('0xab')]][_0xbf4e('0x5b')]+=0x1;this[_0xbf4e('0x1a')][_0x1716cf[_0xbf4e('0xab')]][_0xbf4e('0x5a')]+=0x1;_0x1d717e=new Hangup(_0x1716cf,_0x5f07a5);_0x1d717e[_0xbf4e('0x9c')]=0x12;_0x1d717e['statedesc']=_0xbf4e('0xd9');_0x1d717e[_0xbf4e('0xda')]='AMD';ami['emit']('custom:amd',ut[_0xbf4e('0xdb')](_0x1d717e,_0xbf4e('0xdc')));this[_0xbf4e('0xc7')](_0x1d717e,_0xbf4e('0xdd'),_0xbf4e('0xde'));}if(_0x1716cf[_0xbf4e('0x52')]!=='ivr'&&this[_0xbf4e('0x1a')][_0x1716cf[_0xbf4e('0xab')]]['dialAMDActive']&&_0x5f07a5['value']===_0xbf4e('0xdf')){var _0x190fa6=this;return new BPromise(function(_0x224bee,_0x2b8ec0){delete _0x190fa6[_0xbf4e('0x1f')][_0x5f07a5[_0xbf4e('0xd8')]];_0x190fa6[_0xbf4e('0xaa')](_0x190fa6[_0xbf4e('0x1a')][_0x1716cf[_0xbf4e('0xab')]]);_0x190fa6['voiceQueues'][_0x1716cf['queue']]['outboundAnswerCallsDay']+=0x1;_0x190fa6[_0xbf4e('0x1a')][_0x1716cf['queue']][_0xbf4e('0x5a')]+=0x1;var _0x5d1407=_0x190fa6['voiceQueues'][_0x1716cf[_0xbf4e('0xab')]];var _0x4da3c7=new Hangup(_0x1716cf,_0x5f07a5);_0x4da3c7[_0xbf4e('0x9c')]=0x13;_0x4da3c7[_0xbf4e('0x9d')]=_0xbf4e('0xe0');_0x4da3c7[_0xbf4e('0xda')]=_0xbf4e('0xe1');_0x4da3c7[_0xbf4e('0xe2')]+=0x1;_0x4da3c7[_0xbf4e('0xe3')]+=0x1;_0x4da3c7['amd']=!![];ami['emit'](_0xbf4e('0xe4'),ut[_0xbf4e('0xdb')](_0x4da3c7,_0xbf4e('0xdc')));_0x190fa6[_0xbf4e('0xc2')](_0x4da3c7)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xe5')));if(_0x4da3c7['countbusyretry']+_0x4da3c7['countcongestionretry']+_0x4da3c7[_0xbf4e('0xe6')]+_0x4da3c7['countnosuchnumberretry']+_0x4da3c7['countdropretry']+_0x4da3c7[_0xbf4e('0xe7')]+_0x4da3c7[_0xbf4e('0xe2')]+_0x4da3c7[_0xbf4e('0xe8')]>=_0x5d1407[_0xbf4e('0xe9')]){_0x190fa6[_0xbf4e('0xea')](_0x4da3c7,_0x224bee,_0x2b8ec0,_0xbf4e('0xeb'));}else{if(_0x4da3c7[_0xbf4e('0xe2')]>=_0x5d1407[_0xbf4e('0xec')]){_0x190fa6['createStateFinal'](_0x4da3c7,_0x224bee,_0x2b8ec0,_0xbf4e('0xed'));}else{_0x190fa6[_0xbf4e('0xb5')]({'active':![],'countmachineretry':_0x4da3c7[_0xbf4e('0xe2')],'scheduledat':moment()[_0xbf4e('0xee')](_0x5d1407[_0xbf4e('0xef')],_0xbf4e('0xf0'))[_0xbf4e('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4da3c7[_0xbf4e('0xc9')],'ListId':_0x4da3c7[_0xbf4e('0xca')],'VoiceQueueId':_0x4da3c7[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x4da3c7[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x224bee({'reschedule':0x1});}}});}if(_0x1716cf[_0xbf4e('0x52')]==='ivr'&&this[_0xbf4e('0xac')][_0x1716cf[_0xbf4e('0xab')]][_0xbf4e('0xd6')]&&_0x5f07a5['value']==='HANGUP'){delete this[_0xbf4e('0x1f')][_0x5f07a5[_0xbf4e('0xd8')]];this[_0xbf4e('0xaa')](this[_0xbf4e('0xac')][_0x1716cf['queue']]);_0x1d717e=new Hangup(_0x1716cf,_0x5f07a5);_0x1d717e[_0xbf4e('0x9c')]=0x12;_0x1d717e['statedesc']=_0xbf4e('0xd9');_0x1d717e[_0xbf4e('0xda')]=_0xbf4e('0xe1');ami['emit'](_0xbf4e('0xe4'),ut[_0xbf4e('0xdb')](_0x1d717e,_0xbf4e('0xdc')));this[_0xbf4e('0xc7')](_0x1d717e,_0xbf4e('0xf2'),'[syncHangupInAMDIvr]');}if(_0x1716cf[_0xbf4e('0x52')]==='ivr'&&this['campaigns'][_0x1716cf[_0xbf4e('0xab')]]['dialAMDActive']&&_0x5f07a5[_0xbf4e('0xd7')]===_0xbf4e('0xdf')){var _0x190fa6=this;return new BPromise(function(_0x35afdb,_0x2a1935){delete _0x190fa6[_0xbf4e('0x1f')][_0x5f07a5[_0xbf4e('0xd8')]];_0x190fa6['updateOriginated'](_0x190fa6[_0xbf4e('0xac')][_0x1716cf[_0xbf4e('0xab')]]);_0x190fa6[_0xbf4e('0xac')][_0x1716cf[_0xbf4e('0xab')]]['outboundAnswerCallsDay']+=0x1;_0x190fa6[_0xbf4e('0xac')][_0x1716cf[_0xbf4e('0xab')]][_0xbf4e('0x5a')]+=0x1;var _0x43d546=_0x190fa6[_0xbf4e('0xac')][_0x1716cf[_0xbf4e('0xab')]];var _0x1033dc=new Hangup(_0x1716cf,_0x5f07a5);_0x1033dc[_0xbf4e('0x9c')]=0x13;_0x1033dc[_0xbf4e('0x9d')]=_0xbf4e('0xe0');_0x1033dc['membername']='AMD';_0x1033dc['countmachineretry']+=0x1;_0x1033dc['countglobal']+=0x1;_0x1033dc['amd']=!![];ami['emit'](_0xbf4e('0xe4'),ut[_0xbf4e('0xdb')](_0x1033dc,_0xbf4e('0xdc')));_0x190fa6['createHistory'](_0x1033dc)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xe5')));if(_0x1033dc[_0xbf4e('0xf3')]+_0x1033dc[_0xbf4e('0xf4')]+_0x1033dc[_0xbf4e('0xe6')]+_0x1033dc[_0xbf4e('0xf5')]+_0x1033dc[_0xbf4e('0xf6')]+_0x1033dc[_0xbf4e('0xe7')]+_0x1033dc[_0xbf4e('0xe2')]+_0x1033dc[_0xbf4e('0xe8')]>=_0x43d546[_0xbf4e('0xe9')]){_0x190fa6[_0xbf4e('0xea')](_0x1033dc,_0x35afdb,_0x2a1935,'reason19\x20machine....');}else{if(_0x1033dc['countmachineretry']>=_0x43d546[_0xbf4e('0xec')]){_0x190fa6['createStateFinal'](_0x1033dc,_0x35afdb,_0x2a1935,_0xbf4e('0xed'));}else{_0x190fa6['rescheduleContact']({'active':![],'countmachineretry':_0x1033dc[_0xbf4e('0xe2')],'scheduledat':moment()[_0xbf4e('0xee')](_0x43d546[_0xbf4e('0xef')],'minutes')[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x1033dc[_0xbf4e('0xc9')],'ListId':_0x1033dc[_0xbf4e('0xca')],'VoiceQueueId':_0x1033dc['VoiceQueueId']||undefined,'CampaignId':_0x1033dc[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xf8')));_0x35afdb({'reschedule':0x1});}}});}}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x31')]=function(_0x2fdf55){var _0x59ae4c=this[_0xbf4e('0x1f')][_0x2fdf55[_0xbf4e('0xd8')]];var _0x38f10c=this;var _0x20cc47;if(_0x59ae4c&&_0x59ae4c[_0xbf4e('0x52')]===_0xbf4e('0x73')){delete this[_0xbf4e('0x1f')][_0x2fdf55['uniqueid']];this['updateOriginated'](this[_0xbf4e('0xac')][_0x59ae4c[_0xbf4e('0xab')]]);this['campaigns'][_0x59ae4c[_0xbf4e('0xab')]]['ivrAnswerCallsDay']+=0x1;_0x20cc47=new Hangup(_0x59ae4c,_0x2fdf55);this[_0xbf4e('0xc2')](_0x20cc47)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbf4e('0xc0')](_0x20cc47)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xf9')));}if(_0x59ae4c&&_0x59ae4c[_0xbf4e('0x52')]!==_0xbf4e('0x73')&&isNotNull(this['voiceQueues'][_0x59ae4c[_0xbf4e('0xab')]][_0xbf4e('0xfa')])){delete this[_0xbf4e('0x1f')][_0x2fdf55[_0xbf4e('0xd8')]];this['updateOriginated'](this[_0xbf4e('0x1a')][_0x59ae4c[_0xbf4e('0xab')]]);this[_0xbf4e('0x1a')][_0x59ae4c[_0xbf4e('0xab')]][_0xbf4e('0x5b')]+=0x1;this[_0xbf4e('0x1a')][_0x59ae4c[_0xbf4e('0xab')]][_0xbf4e('0x5a')]+=0x1;_0x20cc47=new Hangup(_0x59ae4c,_0x2fdf55);_0x20cc47[_0xbf4e('0x9c')]=0x10;_0x20cc47[_0xbf4e('0x9d')]=_0xbf4e('0xfb');_0x20cc47[_0xbf4e('0xda')]='AGI';this[_0xbf4e('0xc2')](_0x20cc47)['catch'](loggerCatch(_0xbf4e('0xfc')));this['moveContactManagedDialer'](_0x20cc47)['catch'](loggerCatch(_0xbf4e('0xf9')));}if(_0x59ae4c&&_0x59ae4c['type']!==_0xbf4e('0x73')&&!isNotNull(this[_0xbf4e('0x1a')][_0x59ae4c['queue']][_0xbf4e('0xfa')])){delete this[_0xbf4e('0x1f')][_0x2fdf55[_0xbf4e('0xd8')]];this[_0xbf4e('0xaa')](this[_0xbf4e('0x1a')][_0x59ae4c[_0xbf4e('0xab')]]);this['voiceQueues'][_0x59ae4c[_0xbf4e('0xab')]][_0xbf4e('0xfd')]+=0x1;_0x20cc47=new Hangup(_0x59ae4c,_0x2fdf55);_0x20cc47[_0xbf4e('0x9c')]=0xc;_0x20cc47[_0xbf4e('0x9d')]=_0x2fdf55[_0xbf4e('0xfe')];_0x20cc47[_0xbf4e('0xda')]=_0xbf4e('0xff');this[_0xbf4e('0xc2')](_0x20cc47)['catch'](loggerCatch(_0xbf4e('0xfc')));this[_0xbf4e('0xc0')](_0x20cc47)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0xf9')));}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x2e')]=function(_0xa0c438){var _0x593b10=this['uniqueId'][_0xa0c438[_0xbf4e('0xd8')]];var _0x31d49b=this;if(this[_0xbf4e('0x1a')][_0xa0c438['queue']]){if(_0x593b10&&_0x593b10[_0xbf4e('0x52')]!==_0xbf4e('0x73')){delete this['uniqueId'][_0xa0c438[_0xbf4e('0xd8')]];this['voiceQueues'][_0xa0c438[_0xbf4e('0xab')]][_0xbf4e('0x5b')]+=0x1;var _0x24c937=new AgentComplete(_0x593b10,_0xa0c438);if(_0xa0c438['reason']===_0xbf4e('0x100')){_0x24c937[_0xbf4e('0x101')]=this[_0xbf4e('0x1a')][_0xa0c438['queue']][_0xbf4e('0x102')]&&this[_0xbf4e('0x1a')][_0xa0c438[_0xbf4e('0xab')]][_0xbf4e('0x103')]?moment()[_0xbf4e('0x71')](_0xbf4e('0xf7')):undefined;}this[_0xbf4e('0xc2')](_0x24c937)[_0xbf4e('0xa8')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xbf4e('0xc0')](_0x24c937)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x104')));}}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x27')]=function(_0x5b0a70){if(this[_0xbf4e('0x1a')][_0x5b0a70[_0xbf4e('0xab')]]){if(this['uniqueId'][_0x5b0a70['uniqueid']]&&this[_0xbf4e('0x1f')][_0x5b0a70[_0xbf4e('0xd8')]][_0xbf4e('0x52')]!==_0xbf4e('0x73')){this[_0xbf4e('0xaa')](this[_0xbf4e('0x1a')][_0x5b0a70[_0xbf4e('0xab')]]);this[_0xbf4e('0x1f')][_0x5b0a70[_0xbf4e('0xd8')]][_0xbf4e('0x105')]=moment()[_0xbf4e('0x71')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x106')]=function(_0xa93842){this['createHistory'](_0xa93842)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x107')));this['moveContactManagedDialer'](_0xa93842)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x108')));};Dialer[_0xbf4e('0x16')]['syncQueueCallerAbandon']=function(_0x32a47c){var _0x2ddc4a=this[_0xbf4e('0x1f')][_0x32a47c[_0xbf4e('0xd8')]];var _0x23fbe0=this;if(this[_0xbf4e('0x1a')][_0x32a47c[_0xbf4e('0xab')]]){if(_0x2ddc4a&&_0x2ddc4a['type']!==_0xbf4e('0x73')){delete this[_0xbf4e('0x1f')][_0x32a47c[_0xbf4e('0xd8')]];this[_0xbf4e('0xaa')](this[_0xbf4e('0x1a')][_0x32a47c[_0xbf4e('0xab')]]);_0x2ddc4a['droptime']=moment()['format'](_0xbf4e('0xf7'));var _0x400f61=new QueueCallerAbandon(_0x2ddc4a,_0x32a47c);if(getSeconds(_0x2ddc4a[_0xbf4e('0x109')],_0x2ddc4a[_0xbf4e('0x10a')])>=_0x2ddc4a[_0xbf4e('0x10b')]){this[_0xbf4e('0x1a')][_0x32a47c[_0xbf4e('0xab')]][_0xbf4e('0x7b')]+=0x1;this['voiceQueues'][_0x32a47c[_0xbf4e('0xab')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xbf4e('0x1a')][_0x32a47c['queue']][_0xbf4e('0x66')]+=0x1;_0x400f61[_0xbf4e('0x9c')]=0xa;_0x400f61[_0xbf4e('0x9d')]=_0xbf4e('0x10c');_0x400f61[_0xbf4e('0x10d')]=_0xbf4e('0x10e');_0x400f61['agiafterat']=this[_0xbf4e('0x1a')][_0x32a47c['queue']][_0xbf4e('0x102')]?moment()[_0xbf4e('0x71')](_0xbf4e('0xf7')):undefined;_0x400f61['countdropretry']+=0x1;_0x400f61[_0xbf4e('0xe3')]+=0x1;if(_0x400f61[_0xbf4e('0xf6')]>=this[_0xbf4e('0x1a')][_0x32a47c[_0xbf4e('0xab')]][_0xbf4e('0x10f')]){this['queueCallerAbandonCreateState'](_0x400f61);}else{this[_0xbf4e('0xb5')]({'active':![],'countdropretry':_0x400f61[_0xbf4e('0xf6')],'scheduledat':moment()[_0xbf4e('0xee')](this['voiceQueues'][_0x32a47c[_0xbf4e('0xab')]][_0xbf4e('0x110')],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x2ddc4a[_0xbf4e('0xc9')],'ListId':_0x2ddc4a[_0xbf4e('0xca')],'VoiceQueueId':_0x2ddc4a[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x2ddc4a[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x111')));var _0x35b10f=new History(_0x400f61);_0x35b10f[_0xbf4e('0x9c')]=0xa;_0x35b10f[_0xbf4e('0x9d')]=_0xbf4e('0x10c');_0x35b10f[_0xbf4e('0x9f')]=moment()[_0xbf4e('0x71')](_0xbf4e('0xf7'));_0x35b10f[_0xbf4e('0x9e')]=_0x35b10f['starttime'];_0x35b10f[_0xbf4e('0x112')]=_0x400f61[_0xbf4e('0x112')];_0x35b10f[_0xbf4e('0x113')]=_0x400f61[_0xbf4e('0x113')];this[_0xbf4e('0xc2')](_0x35b10f)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x114')));}}else{this['voiceQueues'][_0x32a47c['queue']][_0xbf4e('0x64')]+=0x1;this[_0xbf4e('0x1a')][_0x32a47c[_0xbf4e('0xab')]][_0xbf4e('0x5e')]+=0x1;_0x400f61[_0xbf4e('0x9c')]=0xb;_0x400f61[_0xbf4e('0x9d')]=_0xbf4e('0x115');_0x400f61[_0xbf4e('0x10d')]=_0xbf4e('0x116');_0x400f61[_0xbf4e('0xe7')]+=0x1;_0x400f61['countglobal']+=0x1;if(_0x400f61[_0xbf4e('0xe7')]>=this[_0xbf4e('0x1a')][_0x32a47c['queue']][_0xbf4e('0x117')]){this[_0xbf4e('0x106')](_0x400f61);}else{this[_0xbf4e('0xb5')]({'active':![],'countabandonedretry':_0x400f61[_0xbf4e('0xe7')],'scheduledat':moment()[_0xbf4e('0xee')](this['voiceQueues'][_0x32a47c[_0xbf4e('0xab')]]['dialAbandonedRetryFrequency'],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x2ddc4a[_0xbf4e('0xc9')],'ListId':_0x2ddc4a[_0xbf4e('0xca')],'VoiceQueueId':_0x2ddc4a[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x2ddc4a[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x118')));var _0x35b10f=new History(_0x400f61);_0x35b10f['state']=0xb;_0x35b10f[_0xbf4e('0x9d')]=_0xbf4e('0x115');_0x35b10f[_0xbf4e('0x9f')]=moment()[_0xbf4e('0x71')]('YYYY-MM-DD\x20HH:mm:ss');_0x35b10f[_0xbf4e('0x9e')]=_0x35b10f[_0xbf4e('0x9f')];_0x35b10f[_0xbf4e('0x112')]=_0x400f61['calleridname'];_0x35b10f[_0xbf4e('0x113')]=_0x400f61[_0xbf4e('0x113')];this[_0xbf4e('0xc2')](_0x35b10f)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x119')));}}}}};Dialer['prototype'][_0xbf4e('0x32')]=function(_0x1d77ee){if(this[_0xbf4e('0x1d')][_0x1d77ee[_0xbf4e('0xd8')]]){this[_0xbf4e('0x1d')][_0x1d77ee['uniqueid']][_0xbf4e('0xa7')]=_0x1d77ee[_0xbf4e('0xa7')];}if(this['uniqueId'][_0x1d77ee['uniqueid']]){this[_0xbf4e('0x1f')][_0x1d77ee[_0xbf4e('0xd8')]][_0xbf4e('0xa7')]=_0x1d77ee[_0xbf4e('0xa7')];}};Dialer['prototype']['syncQueueMember']=function(_0x436f32){if(strategy[this['voiceQueues'][this[_0xbf4e('0x1d')][_0x436f32['actionid']][_0xbf4e('0xab')]][_0xbf4e('0x4a')]]===_0xbf4e('0x15')){if(this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]]&&_['isNil'](this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]][_0xbf4e('0x11b')])&&_0x436f32['status']==='1'&&_0x436f32[_0xbf4e('0x11c')]==='0'){if(this[_0xbf4e('0x11d')][_0x436f32[_0xbf4e('0x11e')]]){if(!this['agents'][_0x436f32[_0xbf4e('0x11e')]][_0xbf4e('0x11b')]){this[_0xbf4e('0x11d')][_0x436f32[_0xbf4e('0x11e')]][_0xbf4e('0x11b')]=!![];this[_0xbf4e('0x1d')][_0x436f32['actionid']][_0xbf4e('0x11b')]=!![];this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]][_0xbf4e('0x11e')]=_0x436f32[_0xbf4e('0x11e')];}}}}else if((strategy[this['voiceQueues'][this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]]['queue']]['strategy']]||_0xbf4e('0x14'))==='rrmemory'){if(this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]]){if(this['agents'][_0x436f32[_0xbf4e('0x11e')]]){this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]][_0xbf4e('0x11e')]=_0x436f32[_0xbf4e('0x11e')];if(_[_0xbf4e('0xa4')](this['queueBooked'][this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]][_0xbf4e('0xab')]])){this[_0xbf4e('0x24')][this['actions'][_0x436f32[_0xbf4e('0x11a')]]['queue']]=[];}this[_0xbf4e('0x24')][this[_0xbf4e('0x1d')][_0x436f32[_0xbf4e('0x11a')]][_0xbf4e('0xab')]][_0xbf4e('0x11f')](_[_0xbf4e('0x85')](_[_0xbf4e('0xc8')](this[_0xbf4e('0x1d')][_0x436f32['actionid']],[_0xbf4e('0x120'),_0xbf4e('0x11e')]),{'status':_0x436f32[_0xbf4e('0xa6')],'paused':_0x436f32[_0xbf4e('0x11c')]}));}}}};function unlockQueueStatus(_0x57eeb3,_0x5519b5){setTimeout(function(){if(_[_0xbf4e('0x39')](_0x57eeb3[_0xbf4e('0x121')])){loggerBooked[_0xbf4e('0x8d')](_0xbf4e('0x122'),_0x5519b5);}_0x57eeb3['queueStatusComplete']=!![];loggerBooked['info'](_0xbf4e('0x123'),_0x5519b5,JSON['stringify'](_['pick'](_0x57eeb3,[_0xbf4e('0x3c'),_0xbf4e('0x121')])));},0x1f3);}Dialer[_0xbf4e('0x16')][_0xbf4e('0x37')]=function(_0x581e1a){var _0x497b42=this;var _0x2c1587=_0x497b42['voiceQueues'][_0x497b42['actions'][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0xab')]];if(strategy[this[_0xbf4e('0x1a')][this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0xab')]][_0xbf4e('0x4a')]]===_0xbf4e('0x15')){if(this['actions'][_0x581e1a[_0xbf4e('0x11a')]]&&this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0x11e')]){this['preview'][_0xbf4e('0x124')](this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['idHopper'],this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0x11e')])['catch'](function(_0xaabd7d){logger[_0xbf4e('0x8d')](_0xbf4e('0x125'),util[_0xbf4e('0x8c')](_0xaabd7d,{'showHidden':![],'depth':null}));})['finally'](function(){_0x497b42[_0xbf4e('0xaa')](_0x497b42[_0xbf4e('0x1a')][_0x497b42[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0xab')]]);_0x497b42['agents'][_0x497b42[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['stateinterface']][_0xbf4e('0x11b')]=![];delete _0x497b42[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]];unlockQueueStatus(_0x2c1587);});}else{this[_0xbf4e('0xaa')](this['voiceQueues'][this[_0xbf4e('0x1d')][_0x581e1a['actionid']][_0xbf4e('0xab')]]);this[_0xbf4e('0xb5')]({'active':![],'ContactId':this[_0xbf4e('0x1d')][_0x581e1a['actionid']]['ContactId'],'ListId':this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['ListId'],'VoiceQueueId':this['actions'][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0xf1')]||undefined,'CampaignId':this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['CampaignId']||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x126')));delete this['actions'][_0x581e1a[_0xbf4e('0x11a')]];unlockQueueStatus(_0x2c1587);}}else if((strategy[this['voiceQueues'][this['actions'][_0x581e1a['actionid']][_0xbf4e('0xab')]]['strategy']]||'rrmemory')===_0xbf4e('0x14')){var _0x5900d2;if(this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]&&!_[_0xbf4e('0x43')](this['queueBooked'][this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]][_0xbf4e('0xab')]])){if(this[_0xbf4e('0x25')][_0x497b42[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['queue']]){this['queueBookedRR'][_0x497b42[_0xbf4e('0x1d')][_0x581e1a['actionid']][_0xbf4e('0xab')]]=this['queueBookedRR'][this['actions'][_0x581e1a[_0xbf4e('0x11a')]]['queue']]?this[_0xbf4e('0x25')][this['actions'][_0x581e1a['actionid']]['queue']]:this['queueBooked'][this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['queue']]?this[_0xbf4e('0x24')][this[_0xbf4e('0x1d')][_0x581e1a[_0xbf4e('0x11a')]]['queue']][_0xbf4e('0x127')]||0x0:0x0;}this[_0xbf4e('0x24')][this[_0xbf4e('0x1d')][_0x581e1a['actionid']][_0xbf4e('0xab')]][_0xbf4e('0x127')]=this[_0xbf4e('0x25')][this['actions'][_0x581e1a[_0xbf4e('0x11a')]]['queue']];for(var _0x21b5cb=0x0;_0x21b5cb=0x0;})['catch'](myreject(_0x255ade)));}}else{_0x66f312[_0xbf4e('0x11f')](ami['Action']({'action':_0xbf4e('0x13e'),'command':util[_0xbf4e('0x71')](_0xbf4e('0x142'),_0x3c605e,!_['isUndefined'](config['timezones'][_0x2dd31c])?_0x2dd31c:'')})['then'](function(_0x9af3c3){return _0x9af3c3['content']['indexOf'](_0xbf4e('0x141'))>=0x0;})[_0xbf4e('0xa8')](myreject(_0x255ade)));}BPromise[_0xbf4e('0x143')](_0x66f312)[_0xbf4e('0xae')](function(_0x3d4bf1){var _0x493fba=_[_0xbf4e('0x144')](_0x3d4bf1);if(_0x493fba){return _0x15ab5f(_0x493fba);}else{_0x4d069a[_0xbf4e('0x3a')]=_0xc4d7ae?_0xbf4e('0x145'):_0xbf4e('0x146');return _0x255ade(msgResponse(_0xbf4e('0x147'),_0xbf4e('0x136'),_0xbf4e('0x148')+_0xc4d7ae+'\x20'+_0x532f2a+_0xbf4e('0x149')+util[_0xbf4e('0x8c')](_0x3c605e,{'showHidden':![],'depth':null})+_0xbf4e('0x14a')+_0x2dd31c));}})[_0xbf4e('0xa8')](function(_0x282456){return _0x255ade(msgResponse(_0xbf4e('0x135'),_0xbf4e('0x136'),JSON['stringify'](_0x282456)));});});};Dialer[_0xbf4e('0x16')][_0xbf4e('0x14b')]=function(_0x5c93f6){var _0x43af83=this;return function(){switch(_0x5c93f6[_0xbf4e('0x14c')]){case _0xbf4e('0x14d'):freeVariablesPredictive(_0x5c93f6);_0x43af83[_0xbf4e('0x14e')](_0x5c93f6,0x1);break;case _0xbf4e('0x14f'):freeVariablesPredictive(_0x5c93f6);_0x43af83[_0xbf4e('0x14e')](_0x5c93f6,_0x5c93f6[_0xbf4e('0x150')]);break;case _0xbf4e('0x6'):_0x43af83['predictive'](_0x5c93f6);break;case'booked':freeVariablesPredictive(_0x5c93f6);_0x43af83['handlePower'](_0x5c93f6,0x1);break;default:freeVariablesPredictive(_0x5c93f6);logger['error'](_0xbf4e('0x151'),_0x5c93f6[_0xbf4e('0x3c')],_0xbf4e('0x152'));}};};Dialer[_0xbf4e('0x16')][_0xbf4e('0x153')]=function(_0x34ffe7){var _0x271668=this;return function(){_0x271668['handleIvr'](_0x34ffe7);};};Dialer[_0xbf4e('0x16')]['syncQueueSummary']=function(_0x2b2d82){var _0x41ac70=this;if(isNotPreview(_0x2b2d82['dialMethod'])){if(isVoiceQueueOutbound(_0x2b2d82[_0xbf4e('0x52')])&&isActive(_0x2b2d82[_0xbf4e('0x57')])){_0x2b2d82[_0xbf4e('0x95')]=!![];BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](checkIsLoggedIn(_0x2b2d82,_0x2b2d82['loggedIn']))['then'](checkIsActive(_0x2b2d82,_0x2b2d82[_0xbf4e('0x57')]))[_0xbf4e('0xae')](checkInterval(_0x2b2d82))[_0xbf4e('0xae')](_0x41ac70[_0xbf4e('0x130')](_0x2b2d82))[_0xbf4e('0xae')](_0x41ac70['checkIfTime'](_0x2b2d82['dialGlobalInterval'],_0x2b2d82[_0xbf4e('0x154')],_0x2b2d82[_0xbf4e('0x3c')],_0x2b2d82))[_0xbf4e('0xae')](_0x41ac70[_0xbf4e('0x155')](_0x2b2d82[_0xbf4e('0x40')],_0x2b2d82['dialTimezone'],_0x2b2d82[_0xbf4e('0x3c')],_0x2b2d82))[_0xbf4e('0xae')](_0x41ac70[_0xbf4e('0x14b')](_0x2b2d82))['catch'](loggerCatchQueueSummary(_0xbf4e('0x156'),_0x2b2d82));}else{notSendMessagesQueue(_0x2b2d82);}}else{freeVariablesPredictive(_0x2b2d82);}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x12f')]=function(){var _0x1edb86=this;var _0x219fad;for(var _0x29d107 in this[_0xbf4e('0xac')]){if(typeof this['campaigns'][_0x29d107]!==_0xbf4e('0x8f')){_0x219fad=this[_0xbf4e('0xac')][_0x29d107];if(isCampaignIvr(_0x219fad[_0xbf4e('0x52')])&&isActive(_0x219fad['active'])){_0x219fad['sendMessageOneNotActive']=!![];BPromise[_0xbf4e('0xb2')]()[_0xbf4e('0xae')](checkIsActive(_0x219fad,_0x219fad[_0xbf4e('0x6f')]))['then'](checkInterval(_0x219fad))['then'](_0x1edb86[_0xbf4e('0x130')](_0x219fad))[_0xbf4e('0xae')](_0x1edb86['checkIfTime'](_0x219fad[_0xbf4e('0x157')],_0x219fad[_0xbf4e('0x154')],_0x219fad['name'],_0x219fad))[_0xbf4e('0xae')](_0x1edb86[_0xbf4e('0x155')](_0x219fad[_0xbf4e('0x40')],_0x219fad[_0xbf4e('0x154')],_0x219fad[_0xbf4e('0x3c')],_0x219fad))['then'](_0x1edb86[_0xbf4e('0x153')](_0x219fad))[_0xbf4e('0xa8')](loggerCatchQueueSummary(_0xbf4e('0x158'),_0x219fad));}else{notSendMessagesCampaign(_0x219fad);}}}};function getCallerIdRandom(_0x3f6ced,_0x5443fa){var _0x1c6858;var _0x428a44;var _0x1bd079;if(_0x5443fa<=0x0){_0x5443fa=0x1;}_0x1c6858=new RegExp('\x5cw{0,'+_0x5443fa+'}$');_0x428a44=Math[_0xbf4e('0x159')](0xa,_0x5443fa-0x1);_0x1bd079=Math[_0xbf4e('0x159')](0xa,_0x5443fa)-0x1;return util['format']('%s',_[_0xbf4e('0x15a')](_0x3f6ced,_0x1c6858,_[_0xbf4e('0x15b')](_0x428a44,_0x1bd079)));}function extractCalleridName(_0x32126c){var _0xc64f18=_0x32126c[_0xbf4e('0x15c')](/"(.*?)"/);return _0xc64f18?_0xc64f18[0x1]:_0x32126c;}function extractCalleridNumber(_0x1983ef){var _0x4dcd16=_0x1983ef[_0xbf4e('0x15c')](/<(.*?)>/);return _0x4dcd16?_0x4dcd16[0x1]:_0x1983ef;}Dialer[_0xbf4e('0x16')][_0xbf4e('0x15d')]=function(_0x453348,_0x1564be){var _0x4fb90d=this;var _0x162565=uuid['v4']();this[_0xbf4e('0x1d')][_0x162565]=new Action(_0x453348,_0x1564be,_0x162565);return new BPromise(function(_0x51d7d3,_0x4a0259){if(_[_0xbf4e('0x39')](_0x453348)&&typeof _0x453348!==_0xbf4e('0x15e')){return _0x4a0259(msgResponse(_0xbf4e('0x15f'),_0xbf4e('0x136'),'voiceQueue\x20is\x20undefine'));}if(_[_0xbf4e('0x39')](_0x1564be[_0xbf4e('0x160')][_0xbf4e('0x161')])||_0x1564be['Contact']['phone']===null){return _0x4a0259(msgResponse(_0xbf4e('0x15f'),'Failure',_0xbf4e('0x162')));}var _0x41de24={'XMD-CALLERID':_0x4fb90d[_0xbf4e('0x1d')][_0x162565][_0xbf4e('0x163')](),'XMD-AGI':_0x453348[_0xbf4e('0xfa')]?util['format'](_0xbf4e('0x164'),ipAgi,_0x453348[_0xbf4e('0xfa')]):_0xbf4e('0x165'),'XMD-AGIAFTER':_0x453348['dialQueueProject2']?util[_0xbf4e('0x71')](_0xbf4e('0x164'),ipAgi,_0x453348[_0xbf4e('0x102')]):'NONE','XMD-QUEUE':_0x453348['type']==='outbound'?util[_0xbf4e('0x71')](_0xbf4e('0x166'),_0x453348['name'],_0x453348[_0xbf4e('0x167')]||'',_0x453348[_0xbf4e('0x103')]?'c':'',_0x453348[_0xbf4e('0x10b')]||0x3):_0xbf4e('0x165'),'XMD-CONTACTID':_0x1564be['ContactId'],'XMD-CDRTYPE':_0xbf4e('0x4'),'CALLERID(all)':_0x4fb90d['actions'][_0x162565][_0xbf4e('0x163')](),'XMD-AMD':_0x453348[_0xbf4e('0xd6')]?_0xbf4e('0x168'):_0xbf4e('0x165'),'XMD-DESTINATION':_0xbf4e('0xd5')};if(_0x453348['dialAMDActive']){_0x41de24[_0xbf4e('0x169')]=_0x453348[_0xbf4e('0x16a')]||0x9c4;_0x41de24[_0xbf4e('0x16b')]=_0x453348[_0xbf4e('0x16c')]||0x5dc;_0x41de24[_0xbf4e('0x16d')]=_0x453348['dialAMDAfterGreetingSilence']||0x320;_0x41de24[_0xbf4e('0x16e')]=_0x453348[_0xbf4e('0x16f')]||0x1388;_0x41de24[_0xbf4e('0x170')]=_0x453348['dialAMDMinWordLength']||0x64;_0x41de24[_0xbf4e('0x171')]=_0x453348['dialAMDBetweenWordsSilence']||0x32;_0x41de24['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x453348['dialAMDMaximumNumberOfWords']||0x3;_0x41de24['XMD-AMDSILENCETHRESHOLD']=_0x453348[_0xbf4e('0x172')]||0x100;_0x41de24[_0xbf4e('0x173')]=_0x453348[_0xbf4e('0x174')]||0x1388;}if(_0x453348[_0xbf4e('0x52')]==='outbound'){_0x41de24[_0xbf4e('0x175')]=_0x1564be[_0xbf4e('0xf1')];}else{_0x41de24['XMD-CAMPAIGNID']=_0x1564be[_0xbf4e('0xcb')];}for(var _0x4fc1c8 in _0x1564be[_0xbf4e('0x160')]){if(typeof _0x1564be[_0xbf4e('0x160')][_0x4fc1c8]!==_0xbf4e('0x8f')){if(isNotNull(_0x1564be[_0xbf4e('0x160')][_0x4fc1c8])&&_0x4fc1c8!=='id'&&_0x4fc1c8!==_0xbf4e('0x176')&&_0x4fc1c8!==_0xbf4e('0x177')&&_0x4fc1c8!=='updatedAt'){_0x41de24[util[_0xbf4e('0x71')](_0xbf4e('0x178'),_0xbf4e('0x179'),_['toUpper'](_0x4fc1c8))]=_0x1564be[_0xbf4e('0x160')][_0x4fc1c8];}}}var _0x2f56b2=_0x4fb90d[_0xbf4e('0x131')](_0x453348[_0xbf4e('0x6e')])?getCallerId(_0x453348['Trunk'][_0xbf4e('0x70')],_0x453348['dialOriginateCallerIdName'],_0x453348['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x453348[_0xbf4e('0x59')],_0x453348[_0xbf4e('0x17a')]):_0x453348[_0xbf4e('0x59')]):getCallerId(_[_0xbf4e('0xa4')](_0x453348[_0xbf4e('0x132')])?_0x453348[_0xbf4e('0x6e')][_0xbf4e('0x70')]:_0x453348[_0xbf4e('0x132')][_0xbf4e('0x70')],_0x453348['dialOriginateCallerIdName'],_0x453348[_0xbf4e('0x17a')]>0x0?getCallerIdRandom(_0x453348[_0xbf4e('0x59')],_0x453348[_0xbf4e('0x17a')]):_0x453348[_0xbf4e('0x59')]);if(_0x2f56b2){_0x41de24[_0xbf4e('0x17b')]=_0x4fb90d['actions'][_0x162565][_0xbf4e('0x17c')]=extractCalleridName(_0x2f56b2);_0x41de24['XMD-ORIGINATECALLERIDNUM']=_0x4fb90d[_0xbf4e('0x1d')][_0x162565][_0xbf4e('0x17d')]=extractCalleridNumber(_0x2f56b2);}return ami[_0xbf4e('0xa5')]({'actionid':_0x162565,'action':'originate','channel':_0x4fb90d['isTrunkReachable'](_0x453348[_0xbf4e('0x6e')])?util['format']('SIP/%s/%s%s',_0x453348[_0xbf4e('0x6e')]['name'],isNotNull(_0x453348[_0xbf4e('0x17e')])?_0x453348[_0xbf4e('0x17e')][_0xbf4e('0x17f')]()||'':'',_0x453348[_0xbf4e('0x180')]>0x0?_0x1564be[_0xbf4e('0x160')][_0xbf4e('0x161')][_0xbf4e('0x181')](_0x453348[_0xbf4e('0x180')]):_0x1564be['Contact']['phone']):util[_0xbf4e('0x71')](_0xbf4e('0x182'),_[_0xbf4e('0xa4')](_0x453348[_0xbf4e('0x132')])?_0x453348[_0xbf4e('0x6e')][_0xbf4e('0x3c')]:_0x453348[_0xbf4e('0x132')][_0xbf4e('0x3c')],isNotNull(_0x453348[_0xbf4e('0x17e')])?_0x453348[_0xbf4e('0x17e')][_0xbf4e('0x17f')]()||'':'',_0x453348[_0xbf4e('0x180')]>0x0?_0x1564be[_0xbf4e('0x160')][_0xbf4e('0x161')]['substring'](_0x453348[_0xbf4e('0x180')]):_0x1564be[_0xbf4e('0x160')][_0xbf4e('0x161')]),'callerid':_0x2f56b2,'Exten':_0xbf4e('0xd5'),'Context':_0xbf4e('0x183'),'Priority':'1','variable':_0x41de24,'timeout':(_0x453348['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x162565})[_0xbf4e('0xae')](function(_0x1f9b39){return _0x51d7d3(_0x1f9b39);})['catch'](function(_0x3c9914){_0x453348['outboundOriginateFailureCallsDay']+=0x1;var _0x512145=new History(_0x4fb90d[_0xbf4e('0x1d')][_0x162565]);logger[_0xbf4e('0x8d')](util[_0xbf4e('0x71')]('[originateError]:\x20%s',JSON[_0xbf4e('0x44')](_0x3c9914)));_0x512145[_0xbf4e('0x9c')]=0xe;_0x512145['statedesc']=_0xbf4e('0x184');_0x512145['starttime']=moment()[_0xbf4e('0x71')](_0xbf4e('0xf7'));_0x512145[_0xbf4e('0x9e')]=_0x512145[_0xbf4e('0x9f')];_0x4fb90d[_0xbf4e('0xc2')](_0x512145)[_0xbf4e('0xa8')](loggerCatch('[originate][error]'));_0x4fb90d[_0xbf4e('0xc0')](_0x512145)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x185')))[_0xbf4e('0x12c')](function(){delete _0x4fb90d[_0xbf4e('0x1d')][_0x162565];return _0x4a0259(msgResponse(_0xbf4e('0x15f'),'Error','originate\x20action\x20Error'));});});});};Dialer['prototype'][_0xbf4e('0x2b')]=function(_0x1a0bf4){var _0x531951=this[_0xbf4e('0x1d')][_0x1a0bf4['actionid']];if(_0x531951){delete this[_0xbf4e('0x1d')][_0x1a0bf4[_0xbf4e('0x11a')]];_0x531951[_0xbf4e('0x10a')]=moment()[_0xbf4e('0x71')](_0xbf4e('0xf7'));var _0x107a3c=_0x531951[_0xbf4e('0x52')]===_0xbf4e('0x73')?this[_0xbf4e('0xac')][_0x531951[_0xbf4e('0xab')]]:this[_0xbf4e('0x1a')][_0x531951[_0xbf4e('0x186')]()];if(!this[_0xbf4e('0x187')](_0x1a0bf4[_0xbf4e('0x188')])){this[_0xbf4e('0xaa')](_0x107a3c);return this[_0xbf4e('0x189')](_0x531951,_0x107a3c,_0x1a0bf4)[_0xbf4e('0xa8')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xbf4e('0x1f')][_0x1a0bf4[_0xbf4e('0xd8')]]=_0x531951;}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x18a')]=function(_0x5a174d,_0x48d429,_0x483258){var _0x29b832=new History(_0x48d429);if(_0x29b832[_0xbf4e('0xf3')]+_0x29b832['countcongestionretry']+_0x29b832[_0xbf4e('0xe6')]+_0x29b832[_0xbf4e('0xf5')]+_0x29b832[_0xbf4e('0xf6')]+_0x29b832[_0xbf4e('0xe7')]+_0x29b832[_0xbf4e('0xe2')]+_0x29b832['countagentrejectretry']>=_0x483258[_0xbf4e('0xe9')]-0x1){return!![];}switch(_0x5a174d){case 0x3:if(_0x29b832[_0xbf4e('0xe6')]>=_0x483258[_0xbf4e('0x18b')]-0x1){return!![];}this[_0xbf4e('0xb5')]({'active':![],'countnoanswerretry':_0x29b832[_0xbf4e('0xe6')]+=0x1,'scheduledat':moment()[_0xbf4e('0xee')](_0x483258[_0xbf4e('0x18c')],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832['ContactId'],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832['CampaignId']||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x18d')));break;case 0x5:if(_0x29b832[_0xbf4e('0xf3')]>=_0x483258[_0xbf4e('0x18e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x29b832[_0xbf4e('0xf3')]+=0x1,'scheduledat':moment()[_0xbf4e('0xee')](_0x483258[_0xbf4e('0x18f')],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832[_0xbf4e('0xc9')],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832[_0xbf4e('0xcb')]||undefined})['catch'](loggerCatch(_0xbf4e('0x190')));break;case 0x8:if(_0x29b832[_0xbf4e('0xf4')]>=_0x483258[_0xbf4e('0x191')]-0x1){return!![];}this[_0xbf4e('0xb5')]({'active':![],'countcongestionretry':_0x29b832[_0xbf4e('0xf4')]+=0x1,'scheduledat':moment()[_0xbf4e('0xee')](_0x483258[_0xbf4e('0x192')],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832[_0xbf4e('0xc9')],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x193')));break;case 0x0:if(_0x29b832[_0xbf4e('0xf5')]>=_0x483258['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x29b832['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x483258[_0xbf4e('0x194')],'minutes')['format'](_0xbf4e('0xf7')),'ContactId':_0x29b832['ContactId'],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832['CampaignId']||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x195')));}break;case 0xa:if(_0x29b832[_0xbf4e('0xf6')]>=_0x483258[_0xbf4e('0x10f')]-0x1){return!![];}this[_0xbf4e('0xb5')]({'active':![],'countdropretry':_0x29b832[_0xbf4e('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x483258[_0xbf4e('0x110')],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832[_0xbf4e('0xc9')],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x29b832['countabandonedretry']>=_0x483258[_0xbf4e('0x117')]-0x1){return!![];}this[_0xbf4e('0xb5')]({'active':![],'countabandonedretry':_0x29b832[_0xbf4e('0xe7')]+=0x1,'scheduledat':moment()[_0xbf4e('0xee')](_0x483258[_0xbf4e('0x196')],'minutes')[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832[_0xbf4e('0xc9')],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832['VoiceQueueId']||undefined,'CampaignId':_0x29b832['CampaignId']||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x118')));break;case 0x13:if(_0x29b832[_0xbf4e('0xe2')]>=_0x483258['dialMachineMaxRetry']-0x1){return!![];}this[_0xbf4e('0xb5')]({'active':![],'countmachineretry':_0x29b832[_0xbf4e('0xe2')]+=0x1,'scheduledat':moment()[_0xbf4e('0xee')](_0x483258['dialMachineRetryFrequency'],_0xbf4e('0xf0'))[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832[_0xbf4e('0xc9')],'ListId':_0x29b832[_0xbf4e('0xca')],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832['CampaignId']||undefined})[_0xbf4e('0xa8')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x29b832[_0xbf4e('0xe8')]>=_0x483258[_0xbf4e('0x197')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x29b832[_0xbf4e('0xe8')]+=0x1,'scheduledat':moment()['add'](_0x483258[_0xbf4e('0x198')],'minutes')[_0xbf4e('0x71')](_0xbf4e('0xf7')),'ContactId':_0x29b832['ContactId'],'ListId':_0x29b832['ListId'],'VoiceQueueId':_0x29b832[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x29b832[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x199')));break;default:return!![];}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x189')]=function(_0x289a10,_0x451729,_0x4704f1){var _0x2aa2d9=this;var _0xbf141b=new History(_0x289a10);return new BPromise(function(_0x4dfe49,_0x10aaec){if(_[_0xbf4e('0x39')](_0x451729)&&typeof _0x451729!==_0xbf4e('0x15e')){return _0x10aaec(msgResponse('[callProgressDetecting]','Failure',_0xbf4e('0x19a')));}if(_[_0xbf4e('0x39')](_0x4704f1)&&typeof _0x4704f1!==_0xbf4e('0x15e')){return _0x10aaec(msgResponse(_0xbf4e('0x19b'),_0xbf4e('0x136'),_0xbf4e('0x19c')));}switch(_0x4704f1[_0xbf4e('0x19d')]){case'0':_0x451729[_0xbf4e('0x61')]+=0x1;_0xbf141b['state']=0x0;_0xbf141b[_0xbf4e('0x9d')]='NoSuchNumber';_0xbf141b[_0xbf4e('0xf5')]+=0x1;_0xbf141b['countglobal']+=0x1;ami[_0xbf4e('0x48')](_0xbf4e('0x19e'),ut[_0xbf4e('0xdb')](_0x289a10,_0xbf4e('0x19f')));_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2aa2d9[_0xbf4e('0x18a')](0x0,_0x289a10,_0x451729)){if(_0xbf141b['countnosuchnumberretry']>=_0x451729[_0xbf4e('0x1a0')]){_0x2aa2d9[_0xbf4e('0x1a1')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1a2'));}else{_0x2aa2d9[_0xbf4e('0xea')](_0xbf141b,_0x4dfe49,_0x10aaec,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x451729['outboundNoAnswerCallsDay']+=0x1;_0xbf141b[_0xbf4e('0x9c')]=0x3;_0xbf141b[_0xbf4e('0x9d')]='NoAnswer';_0xbf141b['countnoanswerretry']+=0x1;_0xbf141b[_0xbf4e('0xe3')]+=0x1;ami['emit'](_0xbf4e('0x1a3'),ut[_0xbf4e('0xdb')](_0x289a10,_0xbf4e('0x1a4')));_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x1a5')));if(_0x2aa2d9[_0xbf4e('0x18a')](0x3,_0x289a10,_0x451729)){if(_0xbf141b['countnoanswerretry']>=_0x451729[_0xbf4e('0x18b')]){_0x2aa2d9['createStateFinal'](_0xbf141b,_0x4dfe49,_0x10aaec,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2aa2d9[_0xbf4e('0xea')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1a6'));}}break;case'5':_0x451729[_0xbf4e('0x1a7')]+=0x1;_0xbf141b[_0xbf4e('0x9c')]=0x5;_0xbf141b[_0xbf4e('0x9d')]=_0xbf4e('0x1a8');_0xbf141b['countbusyretry']+=0x1;_0xbf141b['countglobal']+=0x1;ami[_0xbf4e('0x48')](_0xbf4e('0x1a9'),ut['buildObj'](_0x289a10,_0xbf4e('0x1aa')));_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x1ab')));if(_0x2aa2d9[_0xbf4e('0x18a')](0x5,_0x289a10,_0x451729)){if(_0xbf141b[_0xbf4e('0xf3')]>=_0x451729[_0xbf4e('0x18e')]){_0x2aa2d9[_0xbf4e('0x1a1')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1ac'));}else{_0x2aa2d9[_0xbf4e('0xea')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1ac'));}}break;case'8':_0x451729[_0xbf4e('0x5c')]+=0x1;_0xbf141b[_0xbf4e('0x9c')]=0x8;_0xbf141b[_0xbf4e('0x9d')]=_0xbf4e('0x1ad');_0xbf141b[_0xbf4e('0xf4')]+=0x1;_0xbf141b[_0xbf4e('0xe3')]+=0x1;ami['emit'](_0xbf4e('0x1ae'),ut[_0xbf4e('0xdb')](_0x289a10,_0xbf4e('0x1af')));_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x1b0')));if(_0x2aa2d9[_0xbf4e('0x18a')](0x8,_0x289a10,_0x451729)){if(_0xbf141b['countcongestionretry']>=_0x451729['dialCongestionMaxRetry']){_0x2aa2d9[_0xbf4e('0x1a1')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1b1'));}else{_0x2aa2d9['stateGlobal'](_0xbf141b,_0x4dfe49,_0x10aaec,'reason\x208\x20congestion');}}break;case'11':_0x451729['outboundAbandonedCallsDay']+=0x1;_0xbf141b[_0xbf4e('0x9c')]=0xb;_0xbf141b['statedesc']=_0xbf4e('0x115');_0xbf141b[_0xbf4e('0xe7')]+=0x1;_0xbf141b['countglobal']+=0x1;_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)['catch'](loggerCatch(_0xbf4e('0x119')));if(_0x2aa2d9[_0xbf4e('0x18a')](0xb,_0x289a10,_0x451729)){if(_0xbf141b[_0xbf4e('0xe7')]>=_0x451729['dialAbandonedMaxRetry']){_0x2aa2d9['createStateFinal'](_0xbf141b,_0x4dfe49,_0x10aaec,'reason\x2011\x20abandoned');}else{_0x2aa2d9['stateGlobal'](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1b2'));}}break;case'20':_0x451729[_0xbf4e('0x63')]+=0x1;_0xbf141b[_0xbf4e('0x9c')]=0x14;_0xbf141b['statedesc']='AgentReject';_0xbf141b[_0xbf4e('0xe8')]+=0x1;_0xbf141b[_0xbf4e('0xe3')]+=0x1;ami['emit'](_0xbf4e('0x1b3'),ut[_0xbf4e('0xdb')](_0x289a10,_0xbf4e('0x1b4')));_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)[_0xbf4e('0xa8')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2aa2d9['checkRetriveMax'](0x14,_0x289a10,_0x451729)){if(_0xbf141b[_0xbf4e('0xe8')]>=_0x451729[_0xbf4e('0x197')]){_0x2aa2d9[_0xbf4e('0x1a1')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1b5'));}else{_0x2aa2d9[_0xbf4e('0xea')](_0xbf141b,_0x4dfe49,_0x10aaec,_0xbf4e('0x1b5'));}}break;default:_0x451729[_0xbf4e('0xfd')]+=0x1;_0xbf141b[_0xbf4e('0x9c')]=0xc;_0xbf141b[_0xbf4e('0x9d')]=_0x4704f1[_0xbf4e('0x19d')];_0x2aa2d9[_0xbf4e('0xc2')](_0xbf141b)[_0xbf4e('0xa8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2aa2d9[_0xbf4e('0x18a')](_0x4704f1['reason'],_0x289a10,_0x451729)){if(_0xbf141b[_0xbf4e('0xf3')]+_0xbf141b['countcongestionretry']+_0xbf141b[_0xbf4e('0xe6')]+_0xbf141b[_0xbf4e('0xf5')]+_0xbf141b[_0xbf4e('0xf6')]+_0xbf141b[_0xbf4e('0xe7')]+_0xbf141b[_0xbf4e('0xe2')]+_0xbf141b[_0xbf4e('0xe8')]>=_0x451729[_0xbf4e('0xe9')]){_0x2aa2d9[_0xbf4e('0xea')](_0xbf141b,_0x4dfe49,_0x10aaec,_0x4704f1['reason']);}else{_0x2aa2d9[_0xbf4e('0x1a1')](_0xbf141b,_0x4dfe49,_0x10aaec,_0x4704f1[_0xbf4e('0x19d')]);}}}});};Dialer['prototype'][_0xbf4e('0xea')]=function(_0x2857b2,_0x418799,_0x1fb898,_0x53551a){var _0x117f38=new Final(_0x2857b2);_0x117f38['state']=0xf;_0x117f38[_0xbf4e('0x9d')]=_0xbf4e('0x1b6');this[_0xbf4e('0x1a1')](_0x117f38,_0x418799,_0x1fb898,_0x53551a);};Dialer[_0xbf4e('0x16')][_0xbf4e('0x1a1')]=function(_0x1070c3,_0x379ad5,_0x10b199,_0x478c2d){this[_0xbf4e('0xc0')](_0x1070c3)[_0xbf4e('0xae')](function(){return _0x379ad5(msgResponse('[callProgressDetecting]',_0xbf4e('0xce'),_0x478c2d));})[_0xbf4e('0xa8')](function(){return _0x10b199(msgResponse(_0xbf4e('0x1b7'),_0xbf4e('0x136'),'contact\x20not\x20moved'));});};Dialer[_0xbf4e('0x16')][_0xbf4e('0x6')]=function(_0x530703){var _0x4f8f62=_0x530703[_0xbf4e('0x1b8')]/0x64;var _0xedd921=_0x530703[_0xbf4e('0x5f')]/(_0x530703[_0xbf4e('0x5f')]+_0x530703[_0xbf4e('0x5b')]);var _0x44c7ab=Math[_0xbf4e('0x1b9')](_0x530703[_0xbf4e('0x68')]*(_0x530703[_0xbf4e('0x1ba')]/0x64));var _0x2ae38c=Math[_0xbf4e('0x1b9')](_0x530703['predictiveIntervalAvailable']*(_0x530703['predictiveIntervalMinThreshold']/0x64));var _0x3f2b0a=_0x530703[_0xbf4e('0x4c')]+_0x530703[_0xbf4e('0x96')];var _0x3c93be=Math[_0xbf4e('0x1bb')](_0x530703[_0xbf4e('0x1bc')]*_0x530703[_0xbf4e('0x6c')]*_0x530703[_0xbf4e('0x1bd')]*_0x530703['predictiveIntervalMultiplicativeFactor']);if(_[_0xbf4e('0x39')](_0x530703[_0xbf4e('0x22')])){if(!_['isUndefined'](_0x530703[_0xbf4e('0x21')])){_0x530703[_0xbf4e('0x21')]=undefined;loggerPredictive[_0xbf4e('0x8d')]('[startMethodPredictive][StartProgressive]',_0xbf4e('0x1be'));}if(!_[_0xbf4e('0x39')](_0x530703['handlePredictive'])){loggerPredictive[_0xbf4e('0x8d')]('[startMethodPredictive][StartProgressive]',_0xbf4e('0x1bf'));clearInterval(_0x530703['handlePredictive']);_0x530703[_0xbf4e('0x88')]=undefined;}_0x530703['startProgressive']=moment()[_0xbf4e('0x71')](_0xbf4e('0xf7'));loggerPredictive[_0xbf4e('0x76')](_0x530703[_0xbf4e('0x3c')],_0xbf4e('0x1c0'),_0x530703[_0xbf4e('0x22')]);this[_0xbf4e('0x14e')](_0x530703,0x1);}else if(ifInterval(_0x530703[_0xbf4e('0x1c1')],_0x530703[_0xbf4e('0x22')])){this[_0xbf4e('0x14e')](_0x530703,0x1);loggerPredictiveCalls[_0xbf4e('0x76')]('[startMethodPredictive][StartProgressive][Loop]',_0x530703[_0xbf4e('0x22')],_0x530703['name']);_0x530703[_0xbf4e('0x1bc')]=0x0;_0x530703[_0xbf4e('0x66')]=0x0;}else if(_0x4f8f62<_0xedd921&&_0x530703['dialPredictiveOptimization']===_0xbf4e('0x1c2')){freeVariablesPredictive(_0x530703);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x1c3'),'Dropped\x20calls\x20day',_0xedd921,'startProgressive',_0x530703[_0xbf4e('0x3c')]);}else if(_0x3c93be<_0x530703['predictiveIntervalErlangCallsDroppedCalls']&&_0x530703[_0xbf4e('0x1c4')]===_0xbf4e('0x1c2')){freeVariablesPredictive(_0x530703);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x1c5'),_0xbf4e('0x1c6'),_0x3c93be,_0xbf4e('0x1c7'),_0x530703[_0xbf4e('0x66')],'startProgressive',_0x530703['name']);}else if(!ifInterval(_0x530703[_0xbf4e('0x1c1')],_0x530703[_0xbf4e('0x22')])&&_[_0xbf4e('0x39')](_0x530703[_0xbf4e('0x21')])&&!_[_0xbf4e('0x39')](_0x530703[_0xbf4e('0x22')])){_0x530703[_0xbf4e('0x21')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbf4e('0x76')](_0x530703[_0xbf4e('0x3c')],_0xbf4e('0x1c8'),_0x530703[_0xbf4e('0x21')]);this[_0xbf4e('0x1c9')](_0x530703[_0xbf4e('0x1c1')])[_0xbf4e('0xae')](this[_0xbf4e('0x1ca')](_0x530703))[_0xbf4e('0xae')](mergeDataErlangB(_0x530703))[_0xbf4e('0xae')](this[_0xbf4e('0x1cb')](_0x530703))[_0xbf4e('0xa8')](loggerCatchPredictive(_0xbf4e('0x1cc'),_0x530703));}else if(!ifInterval(_0x530703[_0xbf4e('0x1c1')],_0x530703[_0xbf4e('0x21')])){_0x530703[_0xbf4e('0x66')]=0x0;_0x530703[_0xbf4e('0x21')]=moment()[_0xbf4e('0x71')](_0xbf4e('0xf7'));loggerPredictive[_0xbf4e('0x76')](_0x530703[_0xbf4e('0x3c')],_0xbf4e('0x1cd'),_0x530703[_0xbf4e('0x21')]);clearInterval(_0x530703[_0xbf4e('0x88')]);_0x530703[_0xbf4e('0x88')]=undefined;this[_0xbf4e('0x1c9')](_0x530703['dialPredictiveInterval'])[_0xbf4e('0xae')](this['getDataPredictive'](_0x530703))[_0xbf4e('0xae')](mergeDataErlangB(_0x530703))['then'](this[_0xbf4e('0x1cb')](_0x530703))[_0xbf4e('0xa8')](loggerCatchPredictive(_0xbf4e('0x1ce'),_0x530703));}else if(_0x530703[_0xbf4e('0x68')]&&_0x3f2b0a<_0x530703['predictiveIntervalAvailable']-_0x2ae38c){freeVariablesPredictive(_0x530703);loggerPredictive[_0xbf4e('0x76')](_0x530703[_0xbf4e('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3f2b0a,_0xbf4e('0x1cf'),_0x530703['predictiveIntervalAvailable'],'-',_0x2ae38c,'=',_0x530703[_0xbf4e('0x68')]-_0x2ae38c,')');}else if(_0x530703['predictiveIntervalAvailable']&&_0x3f2b0a>_0x530703[_0xbf4e('0x68')]+_0x44c7ab){freeVariablesPredictive(_0x530703);loggerPredictive[_0xbf4e('0x76')](_0x530703['name'],_0xbf4e('0x1d0'),_0x3f2b0a,_0xbf4e('0x1d1'),_0x530703[_0xbf4e('0x68')],'+',_0x44c7ab,'=',_0x530703[_0xbf4e('0x68')]+_0x44c7ab,')');}};Dialer[_0xbf4e('0x16')]['getDataPredictive']=function(_0x21d9ef){var _0x3b64b2=this;return function(_0x25a49a){return new BPromise(function(_0x4bd22f,_0x1a7538){_[_0xbf4e('0x85')](_0x21d9ef,_0x25a49a[0x0]);if(checkGetDataPredictive(_0x25a49a[0x0])){var _0x2ca433=_0x21d9ef[_0xbf4e('0x68')]=_0x21d9ef['talking']+_0x21d9ef[_0xbf4e('0x4c')];var _0x5d7be7=_0x21d9ef[_0xbf4e('0x1c1')]*0x3c;var _0x443e7e=_0x25a49a[0x0][_0xbf4e('0x7f')]+_0x25a49a[0x0][_0xbf4e('0x7d')];var _0x5d08f6=(_0x25a49a[0x0][_0xbf4e('0x79')]+_0x25a49a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x25a49a[0x0][_0xbf4e('0x64')])/_0x25a49a[0x0][_0xbf4e('0x69')];_0x21d9ef['predictiveIntervalHitRate']=_0x5d08f6>0x0?_0x5d08f6:0x1;switch(_0x21d9ef[_0xbf4e('0x1c4')]){case _0xbf4e('0x1c2'):var _0x5cb5ea=_0x21d9ef[_0xbf4e('0x1b8')]/0x64;return _0x3b64b2[_0xbf4e('0x1d2')](_0x2ca433,_0x5d7be7,_0x443e7e,_0x5d08f6,_0x5cb5ea)[_0xbf4e('0xae')](function(_0x596bd1){return _0x4bd22f(_0x596bd1);});case _0xbf4e('0x1d3'):var _0x24d78c=_0x21d9ef['dialPredictiveOptimizationPercentage']/0x64;return _0x3b64b2[_0xbf4e('0x1d4')](_0x2ca433,_0x5d7be7,_0x443e7e,_0x5d08f6,_0x24d78c)['then'](function(_0x3b2198){return _0x4bd22f(_0x3b2198);});default:return _0x1a7538(msgResponse('[getDataPredictive]','Failure',_0xbf4e('0x1d5')));}}else{return _0x1a7538(msgResponse(_0xbf4e('0x1d6'),'Failure',_0xbf4e('0x1d7')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x5702ee){var _0x78925=this;return function(_0x333f77){return new BPromise(function(_0x2286ff,_0x219530){_[_0xbf4e('0x85')](_0x5702ee,_0x333f77[0x0]);if(checkGetDataPredictive(_0x333f77[0x0])){loggerPredictive[_0xbf4e('0x76')](JSON[_0xbf4e('0x44')](_0x333f77[0x0]));if(_0x5702ee['dialPredictiveOptimization']===_0xbf4e('0x1c2')){return _0x78925['getVoiceQueueRtPauses'](_0x5702ee['id'])[_0xbf4e('0xae')](function(_0x1e82d3){var _0x388217=_0x5702ee[_0xbf4e('0x1d8')]-_0x1e82d3[0x0][_0xbf4e('0x1d9')];var _0x4c8dda=_0x5702ee[_0xbf4e('0x1c1')]*0x3c;var _0x16b46d=_0x333f77[0x0][_0xbf4e('0x7f')]+_0x333f77[0x0][_0xbf4e('0x7d')];var _0x2b7fdd=(_0x333f77[0x0][_0xbf4e('0x79')]+_0x333f77[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x333f77[0x0][_0xbf4e('0x64')])/_0x333f77[0x0]['predictiveIntervalTotalCalls'];var _0x423c39=_0x5702ee[_0xbf4e('0x1b8')]/0x64;_0x5702ee[_0xbf4e('0x67')]=_0x1e82d3[0x0][_0xbf4e('0x1d9')]||0x0;_0x5702ee['predictiveIntervalHitRate']=_0x2b7fdd>0x0?_0x2b7fdd:0x1;return _0x78925[_0xbf4e('0x1d2')](_0x388217,_0x4c8dda,_0x16b46d,_0x2b7fdd,_0x423c39);})[_0xbf4e('0xae')](function(_0x3c4a61){return _0x2286ff(_0x3c4a61);})[_0xbf4e('0xa8')](function(_0x5ed2b3){return _0x219530(msgResponse(_0xbf4e('0x1da'),_0xbf4e('0x136'),JSON[_0xbf4e('0x44')](_0x5ed2b3)));});}if(_0x5702ee['dialPredictiveOptimization']==='agentBusyFactor'){return _0x78925[_0xbf4e('0xbe')](_0x5702ee['id'])[_0xbf4e('0xae')](function(_0x25cbef){var _0x23e5a4=_0x5702ee[_0xbf4e('0x1d8')]-_0x25cbef[0x0]['outboundQueuePauses'];var _0x14ea1a=_0x5702ee['dialPredictiveInterval']*0x3c;var _0x3f9deb=_0x333f77[0x0][_0xbf4e('0x7f')]+_0x333f77[0x0][_0xbf4e('0x7d')];var _0x4c7ac6=(_0x333f77[0x0][_0xbf4e('0x79')]+_0x333f77[0x0][_0xbf4e('0x7b')]+_0x333f77[0x0][_0xbf4e('0x64')])/_0x333f77[0x0][_0xbf4e('0x69')];var _0x1acd06=_0x5702ee[_0xbf4e('0x1b8')]/0x64;_0x5702ee[_0xbf4e('0x67')]=_0x25cbef[0x0][_0xbf4e('0x1d9')]||0x0;_0x5702ee[_0xbf4e('0x1bd')]=_0x4c7ac6>0x0?_0x4c7ac6:0x1;return _0x78925[_0xbf4e('0x1d4')](_0x23e5a4,_0x14ea1a,_0x3f9deb,_0x4c7ac6,_0x1acd06);})[_0xbf4e('0xae')](function(_0x2b30f1){return _0x2286ff(_0x2b30f1);})[_0xbf4e('0xa8')](function(_0x5085e0){return _0x219530(msgResponse('[CatchErlangB]',_0xbf4e('0x136'),JSON[_0xbf4e('0x44')](_0x5085e0)));});}}else{return _0x219530(msgResponse(_0xbf4e('0x1d6'),'Failure',_0xbf4e('0x1d7')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x4a8388){var _0x28b9db=this;return function(){var _0x2a15f9=0x0;var _0x9fa321=Math[_0xbf4e('0x1bb')](_0x4a8388[_0xbf4e('0x6b')]*0x3e8);if(_0x9fa321>0x0){_0x9fa321=_0x9fa321<0x64?0x64:_0x9fa321;loggerPredictive[_0xbf4e('0x76')](_0x4a8388[_0xbf4e('0x3c')],'one\x20call\x20every:',_0x9fa321,'milliseconds');_0x4a8388['handlePredictive']=setInterval(function(){_0x28b9db[_0xbf4e('0x88')](_0x4a8388);loggerPredictiveCalls['info'](_0xbf4e('0x1db'),_0x2a15f9+=0x1);},_0x9fa321);}else{loggerPredictive[_0xbf4e('0x76')](_0x4a8388[_0xbf4e('0x3c')],_0xbf4e('0x1dc'));}};};Dialer[_0xbf4e('0x16')][_0xbf4e('0x1dd')]=function(_0x437d1c,_0x51d779){var _0x5a709e=this;return function(_0x2f0375){if(_['isEmpty'](_0x2f0375)){if(_[_0xbf4e('0xa4')](_0x51d779[_0xbf4e('0x1de')])||!_0x51d779[_0xbf4e('0x1df')]){if(_0x437d1c[_0xbf4e('0x14c')]===_0xbf4e('0x5')){_0x437d1c[_0xbf4e('0x121')]=_[_0xbf4e('0x39')](_0x437d1c[_0xbf4e('0x121')])?!![]:_0x437d1c['queueStatusComplete'];var _0x353643=uuid['v4']();_0x5a709e['actions'][_0x353643]=new Action(_0x437d1c,_0x51d779,_0x353643);loggerBooked[_0xbf4e('0x76')](_0xbf4e('0x1e0'),_0x353643,_0xbf4e('0x1e1'),JSON[_0xbf4e('0x44')](_0x437d1c['queueStatusComplete']),_0xbf4e('0x1e2'),_0x437d1c[_0xbf4e('0x3c')]);if(_0x437d1c['queueStatusComplete']){_0x437d1c[_0xbf4e('0x121')]=![];_0x5a709e[_0xbf4e('0x24')][_0x5a709e['actions'][_0x353643][_0xbf4e('0xab')]]=[];ami[_0xbf4e('0xa5')]({'actionid':_0x353643,'action':_0xbf4e('0x1e3'),'queue':_0x437d1c['name']})[_0xbf4e('0xa8')](function(){_0x5a709e[_0xbf4e('0xaa')](_0x437d1c);_0x5a709e[_0xbf4e('0xb5')]({'active':![],'ContactId':_0x5a709e['actions'][_0x353643][_0xbf4e('0xc9')],'ListId':_0x5a709e[_0xbf4e('0x1d')][_0x353643][_0xbf4e('0xca')],'VoiceQueueId':_0x5a709e[_0xbf4e('0x1d')][_0x353643]['VoiceQueueId']||undefined,'CampaignId':_0x5a709e[_0xbf4e('0x1d')][_0x353643]['CampaignId']||undefined})[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x1e4')));delete _0x5a709e[_0xbf4e('0x1d')][_0x353643];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xbf4e('0x44')](_0x437d1c['queueStatusComplete']),'Queue:\x20',_0x437d1c[_0xbf4e('0x3c')]);_0x5a709e[_0xbf4e('0xaa')](_0x437d1c);_0x5a709e['rescheduleContact']({'active':![],'ContactId':_0x5a709e[_0xbf4e('0x1d')][_0x353643]['ContactId'],'ListId':_0x5a709e['actions'][_0x353643][_0xbf4e('0xca')],'VoiceQueueId':_0x5a709e[_0xbf4e('0x1d')][_0x353643][_0xbf4e('0xf1')]||undefined,'CampaignId':_0x5a709e[_0xbf4e('0x1d')][_0x353643][_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5a709e['actions'][_0x353643];}}else{return _0x5a709e[_0xbf4e('0x15d')](_0x437d1c,_0x51d779);}}else{if(getDiff(_0x51d779[_0xbf4e('0x1e5')])<_0x437d1c['dialRecallMeTimeout']*0x3c){if(_0x51d779[_0xbf4e('0x1e6')]&&!_0x51d779[_0xbf4e('0x1e6')]['voicePause']){_0x5a709e[_0xbf4e('0x19')][_0xbf4e('0x124')](_0x51d779['id'])[_0xbf4e('0x12c')](function(){_0x5a709e[_0xbf4e('0xaa')](_0x437d1c);});}else{_0x5a709e[_0xbf4e('0xb7')]({'active':![]},_0x51d779['id'],0x1)[_0xbf4e('0x12c')](function(){_0x5a709e[_0xbf4e('0xaa')](_0x437d1c);});}}else{_0x437d1c[_0xbf4e('0x62')]+=0x1;_0x5a709e[_0xbf4e('0xaa')](_0x437d1c);if(_0x437d1c[_0xbf4e('0x1e7')]){_0x5a709e[_0xbf4e('0xb5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x51d779[_0xbf4e('0xc9')],'ListId':_0x51d779['ListId'],'VoiceQueueId':_0x51d779[_0xbf4e('0xf1')]||undefined,'CampaignId':_0x51d779[_0xbf4e('0xcb')]||undefined})[_0xbf4e('0xa8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5a709e[_0xbf4e('0xc2')](createObjHistory(_0x437d1c,_0x51d779,_0xbf4e('0x1e8'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0xbf4e('0x1e9')));}else{_0x5a709e[_0xbf4e('0xc7')](createObjHistory(_0x437d1c,_0x51d779,_0xbf4e('0x1ea'),0x16,_0xbf4e('0x1eb')),_0xbf4e('0x1ec'),_0xbf4e('0x1ed'));}}}}else{_0x437d1c[_0xbf4e('0x1ee')]+=0x1;_0x5a709e[_0xbf4e('0xc7')](createObjHistory(_0x437d1c,_0x51d779,_0xbf4e('0x1ef'),0xd,'Blacklist'),_0xbf4e('0x1f0'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xbf4e('0x16')][_0xbf4e('0x1f1')]=function(_0x35ae70){var _0x5efff8=this;var _0x5ec006=_0x35ae70[_0xbf4e('0x1f2')]-_0x35ae70[_0xbf4e('0x6a')]-_0x35ae70['temp'];emitCampaignSummary(_0x35ae70);if(_0x5ec006>0x0){if(_0x5ec006>this[_0xbf4e('0x1c')]){_0x5ec006=this[_0xbf4e('0x1c')];}_0x35ae70[_0xbf4e('0xba')]+=_0x5ec006;this[_0xbf4e('0xbc')](_0x35ae70['id'],_0x5ec006,_0x35ae70[_0xbf4e('0x1f3')],_0x35ae70)[_0xbf4e('0xae')](function(_0x18a611){_0x35ae70['temp']-=_0x5ec006;_0x35ae70[_0xbf4e('0xba')]=_0x35ae70['temp']>0x0?_0x35ae70[_0xbf4e('0xba')]:0x0;if(!checkContactEmpty(_0x18a611)){_0x35ae70[_0xbf4e('0x3a')]=_0xbf4e('0x1f4');logger[_0xbf4e('0x76')]('[getContactCampaign2][Empty]'+_0x35ae70[_0xbf4e('0x3c')]);}else{_0x35ae70[_0xbf4e('0x6a')]+=_0x18a611[_0xbf4e('0x13d')];_0x35ae70['message']='RUNNING';for(var _0x50ecd6=0x0;_0x50ecd6<_0x18a611[_0xbf4e('0x13d')];_0x50ecd6+=0x1){_0x35ae70[_0xbf4e('0x1f5')]+=0x1;if(_[_0xbf4e('0xa4')](_0x18a611[_0x50ecd6])||_[_0xbf4e('0xa4')](_0x18a611[_0x50ecd6][_0xbf4e('0x160')])||_[_0xbf4e('0xa4')](_0x18a611[_0x50ecd6][_0xbf4e('0x160')][_0xbf4e('0x161')])){_0x5efff8[_0xbf4e('0xc5')](_0xbf4e('0x1f6'),_0x35ae70,_0x18a611[_0x50ecd6]);}else{_0x5efff8[_0xbf4e('0xb1')](_['pick'](_0x18a611[_0x50ecd6],[_0xbf4e('0xcb'),_0xbf4e('0x1f7')]))[_0xbf4e('0xae')](_0x5efff8[_0xbf4e('0x1dd')](_0x35ae70,_0x18a611[_0x50ecd6]))['catch'](_0x5efff8['loggerHandler'](_0xbf4e('0x1f8'),_0x35ae70));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x35ae70,_0x5ec006));}};Dialer[_0xbf4e('0x16')]['handlePower']=function(_0x531299,_0x40fbb7){var _0x2afc4f=this;var _0x3efa9b=[];var _0x1f6d11=_0x40fbb7>=0x1?_0x40fbb7:0x1;if(_0x531299[_0xbf4e('0x14c')]===_0xbf4e('0x5')){_0x1f6d11=0x1;}var _0x25375a=Math[_0xbf4e('0x1bb')](_0x531299['available']*_0x1f6d11)-_0x531299[_0xbf4e('0x6a')]-_0x531299[_0xbf4e('0xba')];emitVoiceQueueSummary(_0x531299);if(_0x531299[_0xbf4e('0x1f9')]>0x0){var _0x386c67=_0x531299[_0xbf4e('0x1f9')]-_0x531299[_0xbf4e('0x6a')]-_0x531299[_0xbf4e('0x96')]-_0x531299[_0xbf4e('0xba')]-_0x531299[_0xbf4e('0x4d')];if(_0x25375a>_0x386c67){_0x25375a=_0x386c67;}}if(_0x25375a>0x0){if(_0x531299[_0xbf4e('0x14c')]===_0xbf4e('0x5')){_0x25375a=0x1;}if(_0x25375a>this[_0xbf4e('0x1c')]){_0x25375a=this[_0xbf4e('0x1c')];}_0x531299['temp']+=_0x25375a;for(var _0x37dd35 in this[_0xbf4e('0x11d')]){if(typeof this['agents'][_0x37dd35]!=='undefined'){if(this[_0xbf4e('0x11d')][_0x37dd35][_0xbf4e('0x9c')]==='not_inuse'&&this['agents'][_0x37dd35]['status']===_0xbf4e('0xd0')){_0x3efa9b[_0xbf4e('0x11f')](this['agents'][_0x37dd35]['id']);}}}this[_0xbf4e('0xb9')](_0x531299['id'],_0x3efa9b,_0x25375a,_0x531299[_0xbf4e('0x1f3')],_0x531299)['then'](function(_0x1cac10){_0x531299[_0xbf4e('0xba')]-=_0x25375a;_0x531299[_0xbf4e('0xba')]=_0x531299[_0xbf4e('0xba')]>0x0?_0x531299['temp']:0x0;if(!checkContactEmpty(_0x1cac10)){_0x2afc4f['countReScheduled'](_0x531299)[_0xbf4e('0xae')](sendMessageReschedule(_0x531299))[_0xbf4e('0xa8')](loggerCatch(_0xbf4e('0x1fa')));}else{_0x531299[_0xbf4e('0x6a')]+=_0x1cac10[_0xbf4e('0x13d')];_0x531299[_0xbf4e('0x3a')]=_0x531299['dialMethod']===_0xbf4e('0x5')?_0xbf4e('0x168'):_0xbf4e('0x1fb');for(var _0x28a3a1=0x0;_0x28a3a1<_0x1cac10[_0xbf4e('0x13d')];_0x28a3a1+=0x1){if(_[_0xbf4e('0xa4')](_0x1cac10[_0x28a3a1])||_[_0xbf4e('0xa4')](_0x1cac10[_0x28a3a1][_0xbf4e('0x160')])||_['isNil'](_0x1cac10[_0x28a3a1]['Contact'][_0xbf4e('0x161')])){_0x2afc4f['emptyContact'](_0xbf4e('0x1f6'),_0x531299,_0x1cac10[_0x28a3a1]);}else{_0x2afc4f[_0xbf4e('0xaf')](_[_0xbf4e('0xc8')](_0x1cac10[_0x28a3a1],[_0xbf4e('0xf1'),_0xbf4e('0x1f7')]))[_0xbf4e('0xae')](_0x2afc4f[_0xbf4e('0x1dd')](_0x531299,_0x1cac10[_0x28a3a1]))[_0xbf4e('0xa8')](_0x2afc4f[_0xbf4e('0xc4')](_0xbf4e('0x1f6'),_0x531299));}}}})[_0xbf4e('0xa8')](loggerGetContactDialer(_0xbf4e('0x1fc'),_0x531299,_0x25375a));}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x88')]=function(_0x4fc3d5){if(_0x4fc3d5['dialLimitQueue']>0x0){var _0x4d79e4=_0x4fc3d5[_0xbf4e('0x1f9')]-_0x4fc3d5[_0xbf4e('0x6a')]-_0x4fc3d5[_0xbf4e('0x96')];if(_0x4d79e4>0x0){this['tryOriginatePredictive'](_0x4fc3d5);}else{loggerPredictiveCalls[_0xbf4e('0x76')](_0xbf4e('0x1fd'));}}else{this[_0xbf4e('0x1fe')](_0x4fc3d5);}};Dialer[_0xbf4e('0x16')][_0xbf4e('0x1fe')]=function(_0x30d853){var _0x8e16f2=this;var _0x5db666=[];_0x30d853[_0xbf4e('0x6a')]+=0x1;for(var _0x11c0c0 in this[_0xbf4e('0x11d')]){if(typeof this['agents'][_0x11c0c0]!==_0xbf4e('0x8f')){if(this[_0xbf4e('0x11d')][_0x11c0c0][_0xbf4e('0x9c')]===_0xbf4e('0x1ff')&&this[_0xbf4e('0x11d')][_0x11c0c0]['status']===_0xbf4e('0xd0')){_0x5db666[_0xbf4e('0x11f')](this['agents'][_0x11c0c0]['id']);}}}this[_0xbf4e('0xb9')](_0x30d853['id'],_0x5db666,0x1,_0x30d853[_0xbf4e('0x1f3')],_0x30d853)[_0xbf4e('0xae')](function(_0x3b6a4b){if(!checkContactEmpty(_0x3b6a4b)){checkContactLowerLimitOriginate(_0x30d853,0x1,0x0);_0x8e16f2[_0xbf4e('0xad')](_0x30d853)['then'](sendMessageReschedule(_0x30d853))[_0xbf4e('0xa8')](loggerCatch('[countReScheduled]\x20'));}else{_0x30d853['message']='RUNNING';if(_[_0xbf4e('0xa4')](_0x3b6a4b[0x0])||_[_0xbf4e('0xa4')](_0x3b6a4b[0x0][_0xbf4e('0x160')])||_[_0xbf4e('0xa4')](_0x3b6a4b[0x0][_0xbf4e('0x160')][_0xbf4e('0x161')])){_0x8e16f2[_0xbf4e('0xc5')](_0xbf4e('0x1f6'),_0x30d853,_0x3b6a4b[0x0]);}else{_0x8e16f2[_0xbf4e('0xaf')](_['pick'](_0x3b6a4b[0x0],['VoiceQueueId',_0xbf4e('0x1f7')]))['then'](_0x8e16f2[_0xbf4e('0x1dd')](_0x30d853,_0x3b6a4b[0x0]))[_0xbf4e('0xa8')](_0x8e16f2[_0xbf4e('0xc4')](_0xbf4e('0x200'),_0x30d853));}}})[_0xbf4e('0xa8')](loggerGetContactDialer(_0xbf4e('0x201'),_0x30d853,0x1));emitVoiceQueueSummary(_0x30d853);};Dialer[_0xbf4e('0x16')][_0xbf4e('0x1d2')]=function(_0x4f5f78,_0x1669b7,_0x400eb2,_0x472d38,_0x4bb7d0,_0x186391){loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x202'));loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x203'),_0x4f5f78);loggerPredictive[_0xbf4e('0x76')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1669b7);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x204'),_0x400eb2);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x205'),_0x472d38);loggerPredictive[_0xbf4e('0x76')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bb7d0);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x84'));return new BPromise(function(_0x1f36ac,_0x36845a){if(_0x4f5f78<=0x0||isNaN(_0x4f5f78)){return _0x36845a(msgResponse(_0xbf4e('0x206'),_0xbf4e('0x207'),_0xbf4e('0x208')+_0x4f5f78));}if(_0x400eb2<=0x0||isNaN(_0x400eb2)){return _0x36845a(msgResponse('[abandonmentRate]','Error',_0xbf4e('0x209')+_0x400eb2));}if(_0x472d38<=0x0||isNaN(_0x472d38)){return _0x36845a(msgResponse(_0xbf4e('0x206'),_0xbf4e('0x207'),'p\x20=\x20'+_0x472d38));}if(_0x1669b7<=0x0||isNaN(_0x1669b7)){return _0x36845a(msgResponse(_0xbf4e('0x206'),_0xbf4e('0x207'),_0xbf4e('0x20a')+_0x1669b7));}if(_0x4bb7d0<=0x0||isNaN(_0x4bb7d0)){return _0x36845a(msgResponse(_0xbf4e('0x206'),_0xbf4e('0x207'),_0xbf4e('0x20b')+_0x4bb7d0));}_0x186391=_0x186391||0x0;var _0x262f24=0x1/_0x400eb2;var _0x4948cb=0x0;var _0xa765d6=0x0;var _0x3f5253=0x0;var _0x509f38=0x0;for(var _0x116c42=0x0;_0x3f5253<_0x4bb7d0;_0x116c42+=0x1){_0xa765d6=_0x116c42/_0x1669b7;_0x4948cb=(_0x472d38*_0xa765d6+_0x186391)/_0x262f24;_0x3f5253=erlangb(_0x4948cb,_0x4f5f78);_0x509f38=_0x4948cb/_0x4f5f78*(0x1-erlangb(_0x4948cb,_0x4f5f78));}return _0x1f36ac({'erlangCalls':_0x116c42,'erlangCallToSecond':_0x1669b7/_0x116c42,'erlangAbandonmentRate':_0x3f5253,'erlangBusyFactor':_0x509f38});});};Dialer[_0xbf4e('0x16')][_0xbf4e('0x1d4')]=function(_0x1e06b5,_0xba5879,_0x5d7535,_0x9e3971,_0x420554,_0xaef200){loggerPredictive['info'](_0xbf4e('0x20c'));loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x203'),_0x1e06b5);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x20d'),_0xba5879);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x204'),_0x5d7535);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x205'),_0x9e3971);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x20e'),_0x420554);loggerPredictive[_0xbf4e('0x76')](_0xbf4e('0x84'));return new BPromise(function(_0x159e88,_0x2b500e){if(_0x1e06b5<=0x0||isNaN(_0x1e06b5)){return _0x2b500e(msgResponse(_0xbf4e('0x20f'),_0xbf4e('0x207'),_0xbf4e('0x208')+_0x1e06b5));}if(_0x5d7535<=0x0||isNaN(_0x5d7535)){return _0x2b500e(msgResponse(_0xbf4e('0x20f'),_0xbf4e('0x207'),'Ts\x20=\x20'+_0x5d7535));}if(_0x9e3971<=0x0||isNaN(_0x9e3971)){return _0x2b500e(msgResponse(_0xbf4e('0x20f'),'Error',_0xbf4e('0x210')+_0x9e3971));}if(_0xba5879<=0x0||isNaN(_0xba5879)){return _0x2b500e(msgResponse(_0xbf4e('0x20f'),_0xbf4e('0x207'),_0xbf4e('0x20a')+_0xba5879));}if(_0x420554<=0x0||isNaN(_0x420554)){return _0x2b500e(msgResponse(_0xbf4e('0x20f'),_0xbf4e('0x207'),_0xbf4e('0x211')+_0x420554));}_0xaef200=_0xaef200||0x0;var _0x23044d=0x1/_0x5d7535;var _0x7a9526=0x0;var _0x4dcbc9=0x0;var _0x2d8baa=0x0;var _0xd58426=0x0;for(var _0x41d381=0x0;_0xd58426<_0x420554;_0x41d381+=0x1){_0x4dcbc9=_0x41d381/_0xba5879;_0x7a9526=(_0x9e3971*_0x4dcbc9+_0xaef200)/_0x23044d;_0x2d8baa=erlangb(_0x7a9526,_0x1e06b5);_0xd58426=_0x7a9526/_0x1e06b5*(0x1-erlangb(_0x7a9526,_0x1e06b5));}return _0x159e88({'erlangCalls':_0x41d381,'erlangCallToSecond':_0xba5879/_0x41d381,'erlangAbandonmentRate':_0x2d8baa,'erlangBusyFactor':_0xd58426});});};module[_0xbf4e('0x212')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index dc43442..4259fed 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 _0xad0d=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x1187d6,_0x4c8832){var _0x412cf4=function(_0xdbec93){while(--_0xdbec93){_0x1187d6['push'](_0x1187d6['shift']());}};_0x412cf4(++_0x4c8832);}(_0xad0d,0x77));var _0xdad0=function(_0x4e6318,_0x54feed){_0x4e6318=_0x4e6318-0x0;var _0x22d424=_0xad0d[_0x4e6318];return _0x22d424;};'use strict';var util=require(_0xdad0('0x0'));var _=require(_0xdad0('0x1'));var moment=require('moment');function getSeconds(_0x279a17,_0x43e33c){var _0x331d8c=moment(_0x279a17)[_0xdad0('0x2')](0x0);var _0x429596=moment(_0x43e33c)[_0xdad0('0x2')](0x0);return _0x331d8c['diff'](_0x429596,_0xdad0('0x3'));}function QueueCallerAbandon(_0x36482d,_0x17f8d5){this[_0xdad0('0x4')]=_0x36482d[_0xdad0('0x4')];this[_0xdad0('0x5')]=_0x36482d['type'];this[_0xdad0('0x6')]=_0x36482d[_0xdad0('0x5')]===_0xdad0('0x7')?_0xdad0('0x8'):_0x36482d[_0xdad0('0x5')];this['countbusyretry']=_0x36482d[_0xdad0('0x9')];this[_0xdad0('0xa')]=_0x36482d[_0xdad0('0xa')];this[_0xdad0('0xb')]=_0x36482d['countnoanswerretry'];this['countglobal']=_0x36482d['countbusyretry']+_0x36482d[_0xdad0('0xa')]+_0x36482d['countnoanswerretry']+_0x36482d[_0xdad0('0xc')]+_0x36482d[_0xdad0('0xd')]+_0x36482d[_0xdad0('0xe')]+_0x36482d[_0xdad0('0xf')]+_0x36482d[_0xdad0('0x10')];this[_0xdad0('0xc')]=_0x36482d[_0xdad0('0xc')];this['countdropretry']=_0x36482d[_0xdad0('0xd')];this[_0xdad0('0xe')]=_0x36482d[_0xdad0('0xe')];this['countmachineretry']=_0x36482d['countmachineretry'];this[_0xdad0('0x10')]=_0x36482d[_0xdad0('0x10')];this[_0xdad0('0x11')]=_0x17f8d5[_0xdad0('0x11')];this[_0xdad0('0x12')]=_0x36482d[_0xdad0('0x13')];this[_0xdad0('0x14')]=_0x36482d['number'];this[_0xdad0('0x15')]=_0x36482d['starttime'];this[_0xdad0('0x16')]=_0x36482d['responsetime'];this[_0xdad0('0x17')]=_0x36482d[_0xdad0('0x17')];this[_0xdad0('0x18')]=this[_0xdad0('0x17')];this['ringtime']=getSeconds(_0x36482d[_0xdad0('0x16')],_0x36482d[_0xdad0('0x15')]);this['holdtime']=getSeconds(this[_0xdad0('0x17')],_0x36482d['responsetime']);this['talktime']=0x0;this['queue']=_0x17f8d5[_0xdad0('0x8')];this[_0xdad0('0x19')]=_0x17f8d5['connectedlinename'];this[_0xdad0('0x1a')]=_0x17f8d5[_0xdad0('0x1a')];this[_0xdad0('0x1b')]=_0x36482d['callback'];this[_0xdad0('0x1c')]=_0x36482d[_0xdad0('0x1c')];this[_0xdad0('0x1d')]=_0x36482d[_0xdad0('0x1d')];this[_0xdad0('0x1e')]=_0x36482d[_0xdad0('0x1e')];this[_0xdad0('0x1f')]=_0x36482d[_0xdad0('0x1f')];this[_0xdad0('0x20')]=_0x36482d[_0xdad0('0x20')];this[_0xdad0('0x21')]=_0x36482d[_0xdad0('0x21')];this[_0xdad0('0x22')]=_0x36482d[_0xdad0('0x22')];this[_0xdad0('0x23')]=_0x36482d[_0xdad0('0x23')];this[_0xdad0('0x24')]=_0x36482d['originatecalleridnum']||'';this['originatecalleridname']=_0x36482d[_0xdad0('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x2c75=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','droptime','holdtime','responsetime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x32ebe4,_0x55d2e1){var _0xbe603f=function(_0x5dc3bb){while(--_0x5dc3bb){_0x32ebe4['push'](_0x32ebe4['shift']());}};_0xbe603f(++_0x55d2e1);}(_0x2c75,0x127));var _0x52c7=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x2c75[_0xe66cf2];return _0x2d84e7;};'use strict';var util=require(_0x52c7('0x0'));var _=require(_0x52c7('0x1'));var moment=require('moment');function getSeconds(_0xa17760,_0x3bb330){var _0xf6b5d1=moment(_0xa17760)[_0x52c7('0x2')](0x0);var _0x5ce750=moment(_0x3bb330)[_0x52c7('0x2')](0x0);return _0xf6b5d1[_0x52c7('0x3')](_0x5ce750,_0x52c7('0x4'));}function QueueCallerAbandon(_0x16c7b6,_0x34b4a4){this['scheduledat']=_0x16c7b6[_0x52c7('0x5')];this['type']=_0x16c7b6['type'];this[_0x52c7('0x6')]=_0x16c7b6['type']===_0x52c7('0x7')?'queue':_0x16c7b6['type'];this[_0x52c7('0x8')]=_0x16c7b6[_0x52c7('0x8')];this[_0x52c7('0x9')]=_0x16c7b6[_0x52c7('0x9')];this[_0x52c7('0xa')]=_0x16c7b6[_0x52c7('0xa')];this[_0x52c7('0xb')]=_0x16c7b6[_0x52c7('0x8')]+_0x16c7b6['countcongestionretry']+_0x16c7b6[_0x52c7('0xa')]+_0x16c7b6[_0x52c7('0xc')]+_0x16c7b6[_0x52c7('0xd')]+_0x16c7b6['countabandonedretry']+_0x16c7b6[_0x52c7('0xe')]+_0x16c7b6[_0x52c7('0xf')];this[_0x52c7('0xc')]=_0x16c7b6[_0x52c7('0xc')];this[_0x52c7('0xd')]=_0x16c7b6['countdropretry'];this['countabandonedretry']=_0x16c7b6['countabandonedretry'];this[_0x52c7('0xe')]=_0x16c7b6[_0x52c7('0xe')];this[_0x52c7('0xf')]=_0x16c7b6[_0x52c7('0xf')];this['uniqueid']=_0x34b4a4[_0x52c7('0x10')];this[_0x52c7('0x11')]=_0x16c7b6[_0x52c7('0x12')];this['calleridnum']=_0x16c7b6[_0x52c7('0x13')];this['starttime']=_0x16c7b6[_0x52c7('0x14')];this['responsetime']=_0x16c7b6['responsetime'];this[_0x52c7('0x15')]=_0x16c7b6[_0x52c7('0x15')];this['endtime']=this[_0x52c7('0x15')];this['ringtime']=getSeconds(_0x16c7b6['responsetime'],_0x16c7b6[_0x52c7('0x14')]);this[_0x52c7('0x16')]=getSeconds(this[_0x52c7('0x15')],_0x16c7b6[_0x52c7('0x17')]);this[_0x52c7('0x18')]=0x0;this['queue']=_0x34b4a4[_0x52c7('0x19')];this[_0x52c7('0x1a')]=_0x34b4a4[_0x52c7('0x1b')];this[_0x52c7('0x1c')]=_0x34b4a4[_0x52c7('0x1c')];this[_0x52c7('0x1d')]=_0x16c7b6[_0x52c7('0x1d')];this[_0x52c7('0x1e')]=_0x16c7b6[_0x52c7('0x1e')];this[_0x52c7('0x1f')]=_0x16c7b6[_0x52c7('0x1f')];this[_0x52c7('0x20')]=_0x16c7b6[_0x52c7('0x20')];this[_0x52c7('0x21')]=_0x16c7b6['ContactId'];this[_0x52c7('0x22')]=_0x16c7b6[_0x52c7('0x22')];this[_0x52c7('0x23')]=_0x16c7b6[_0x52c7('0x23')];this['VoiceQueueId']=_0x16c7b6[_0x52c7('0x24')];this[_0x52c7('0x25')]=_0x16c7b6[_0x52c7('0x25')];this[_0x52c7('0x26')]=_0x16c7b6[_0x52c7('0x26')]||'';this[_0x52c7('0x27')]=_0x16c7b6['originatecalleridname']||'';}module[_0x52c7('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 fa584fc..a4b63bb 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(_0x14b0c7,_0x5b6f81){var _0x480db0=function(_0x10af9f){while(--_0x10af9f){_0x14b0c7['push'](_0x14b0c7['shift']());}};_0x480db0(++_0x5b6f81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x555e07,_0x2d41d4){var _0x2ad74e=function(_0x3c08a3){while(--_0x3c08a3){_0x555e07['push'](_0x555e07['shift']());}};_0x2ad74e(++_0x2d41d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 eaaac37..1d76476 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 _0x94d8=['./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','uuid','moment','fax','../ami','./channel'];(function(_0x52e272,_0x3ee0e3){var _0x34f3a2=function(_0x22804c){while(--_0x22804c){_0x52e272['push'](_0x52e272['shift']());}};_0x34f3a2(++_0x3ee0e3);}(_0x94d8,0x73));var _0x894d=function(_0x1f1584,_0x1481ba){_0x1f1584=_0x1f1584-0x0;var _0x18cf5c=_0x94d8[_0x1f1584];return _0x18cf5c;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x894d('0x0'));var moment=require(_0x894d('0x1'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x894d('0x2'));var ami=require(_0x894d('0x3'));var rpcDb=require('./rpcDb');var Channel=require(_0x894d('0x4'));var ut=require(_0x894d('0x5'));var Action=require(_0x894d('0x6'));var faxAccount=require(_0x894d('0x7'));var attachment=require(_0x894d('0x8'));var faxMessage=require(_0x894d('0x9'));function Fax(_0x3ac014){this[_0x894d('0xa')]={};this[_0x894d('0xb')]=_0x3ac014[_0x894d('0xb')];this['trunks']=_0x3ac014[_0x894d('0xc')];this['actions']={};ami['on'](_0x894d('0xd'),this[_0x894d('0xe')]['bind'](this));ami['on'](_0x894d('0xf'),this[_0x894d('0x10')][_0x894d('0x11')](this));ami['on'](_0x894d('0x12'),this[_0x894d('0x13')][_0x894d('0x11')](this));ami['on'](_0x894d('0x14'),this[_0x894d('0x15')][_0x894d('0x11')](this));ami['on']('faxstatus',this[_0x894d('0x16')]['bind'](this));ami['on'](_0x894d('0x17'),this['syncReceiveFax'][_0x894d('0x11')](this));ami['on'](_0x894d('0x18'),this[_0x894d('0x19')]['bind'](this));ami['on'](_0x894d('0x1a'),this['syncOriginateResponse'][_0x894d('0x11')](this));}Fax[_0x894d('0x1b')][_0x894d('0xe')]=function(_0x1ec27e){if(_0x1ec27e[_0x894d('0x1c')]===_0x894d('0x1d')){for(var _0x47e14b in this[_0x894d('0xb')]){if(this[_0x894d('0xb')][_0x894d('0x1e')](_0x47e14b)){if(_0x1ec27e[_0x894d('0x1f')]===this[_0x894d('0xb')][_0x47e14b][_0x894d('0x20')]){this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]={};this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]][_0x894d('0x22')]=_0x1ec27e[_0x894d('0x22')];this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]['id']=this[_0x894d('0xb')][_0x47e14b]['id'];this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]['name']=this[_0x894d('0xb')][_0x47e14b][_0x894d('0x23')];logger[_0x894d('0x24')](_0x1ec27e[_0x894d('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x894d('0x25')][_0x1ec27e[_0x894d('0x21')]]){this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]={};this[_0x894d('0xa')][_0x1ec27e[_0x894d('0x21')]]['channel']=_0x1ec27e['channel'];logger[_0x894d('0x24')](_0x1ec27e['uniqueid'],_0x894d('0x26'));}};Fax['prototype'][_0x894d('0x10')]=function(_0x254797){if(this[_0x894d('0xa')][_0x254797[_0x894d('0x21')]]){for(var _0x118833 in _0x254797[_0x894d('0x27')]){if(_0x254797[_0x894d('0x27')][_0x894d('0x1e')](_0x118833)){this[_0x894d('0xa')][_0x254797[_0x894d('0x21')]][_0x118833]=_0x254797[_0x894d('0x28')];}}}};Fax[_0x894d('0x1b')][_0x894d('0x13')]=function(_0x275bee){if(this[_0x894d('0xa')][_0x275bee[_0x894d('0x21')]]){this[_0x894d('0xa')][_0x275bee['uniqueid']][_0x894d('0x29')]=_0x275bee[_0x894d('0x29')];this['channels'][_0x275bee[_0x894d('0x21')]][_0x894d('0x2a')]=_0x275bee['channelstatedesc'];}};Fax['prototype'][_0x894d('0x15')]=function(_0x258f4f){if(this[_0x894d('0xa')][_0x258f4f[_0x894d('0x21')]]){for(var _0x19ddd2 in _0x258f4f[_0x894d('0x27')]){if(_0x258f4f['variable']['hasOwnProperty'](_0x19ddd2)){this[_0x894d('0xa')][_0x258f4f[_0x894d('0x21')]][_0x19ddd2]=_0x258f4f[_0x894d('0x28')];}}}};Fax[_0x894d('0x1b')][_0x894d('0x16')]=function(_0xc6bf83){if(this['channels'][_0xc6bf83['uniqueid']]){this[_0x894d('0xa')][_0xc6bf83[_0x894d('0x21')]][_0x894d('0x2b')]=_0xc6bf83[_0x894d('0x2b')];this[_0x894d('0xa')][_0xc6bf83[_0x894d('0x21')]]['status']=_0xc6bf83[_0x894d('0x2c')];this['channels'][_0xc6bf83[_0x894d('0x21')]][_0x894d('0x20')]=_0xc6bf83[_0x894d('0x20')];this[_0x894d('0xa')][_0xc6bf83[_0x894d('0x21')]][_0x894d('0x2d')]=_0xc6bf83[_0x894d('0x2d')];logger[_0x894d('0x24')](_0xc6bf83['uniqueid'],_0x894d('0x2e'));}};Fax[_0x894d('0x1b')][_0x894d('0x2f')]=function(_0x1a6a4b){var _0x477e05=this;if(this['channels'][_0x1a6a4b[_0x894d('0x21')]]){var _0x139b74=this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['id'];this['channels'][_0x1a6a4b[_0x894d('0x21')]]['remotestationid']=_0x1a6a4b[_0x894d('0x30')];this['channels'][_0x1a6a4b[_0x894d('0x21')]]['pagestransferred']=_0x1a6a4b[_0x894d('0x31')];this[_0x894d('0xa')][_0x1a6a4b['uniqueid']][_0x894d('0x20')]=_0x1a6a4b['localstationid'];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]][_0x894d('0x32')]=_0x1a6a4b[_0x894d('0x32')];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['transferrate']=_0x1a6a4b[_0x894d('0x33')];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['filename']=_0x1a6a4b[_0x894d('0x2d')];this[_0x894d('0xa')][_0x1a6a4b[_0x894d('0x21')]]['calleridnum']=_0x1a6a4b[_0x894d('0x34')];if(this[_0x894d('0xa')][_0x1a6a4b['uniqueid']][_0x894d('0x31')]>0x0){tiff2pdf(_0x1a6a4b[_0x894d('0x2d')],_0x894d('0x35'),function(_0x2b803c){logger['info'](_0x1a6a4b[_0x894d('0x21')],_0x894d('0x36'),_0x2b803c['message']);attachment['create']({'name':path[_0x894d('0x37')](_0x1a6a4b['filename'])[_0x894d('0x23')],'basename':path[_0x894d('0x37')](_0x1a6a4b[_0x894d('0x2d')])[_0x894d('0x23')]+'.pdf','type':'application/pdf'})['then'](function(_0xfd7930){faxAccount[_0x894d('0x38')](_0x139b74,{'from':_0x1a6a4b[_0x894d('0x34')],'mapKey':_0x894d('0x2'),'body':path[_0x894d('0x37')](_0x1a6a4b[_0x894d('0x2d')])[_0x894d('0x23')]+_0x894d('0x39'),'AttachmentId':_0xfd7930['id']})[_0x894d('0x3a')](function(_0x58ef21){logger[_0x894d('0x3b')](_0x1a6a4b[_0x894d('0x21')],_0x894d('0x3c'),JSON[_0x894d('0x3d')](_0x58ef21));});})[_0x894d('0x3a')](function(_0x100680){logger['error'](_0x1a6a4b[_0x894d('0x21')],_0x894d('0x3e'),JSON['stringify'](_0x100680));});});}logger[_0x894d('0x24')](_0x1a6a4b[_0x894d('0x21')],'\x20receiveFax\x20');}};Fax[_0x894d('0x1b')][_0x894d('0x3f')]=function(_0x1f44d5){if(this[_0x894d('0x25')][_0x1f44d5[_0x894d('0x21')]]){_[_0x894d('0x40')](this['channels'][_0x1f44d5[_0x894d('0x21')]],_[_0x894d('0x41')](_0x1f44d5,[_0x894d('0x42'),_0x894d('0x43')]));}};function updateStatus(_0x18545a){if(_0x18545a[_0x894d('0x44')]){faxMessage[_0x894d('0x45')](_0x18545a['AttachmentId'],{'failMessage':_0x894d('0x46')})['then'](function(_0x84757){ut[_0x894d('0x47')](_0x894d('0x48'),_0x84757);})['catch'](function(_0xf49ae6){ut[_0x894d('0x47')](_0x894d('0x49'),_0xf49ae6);});}else{ut[_0x894d('0x47')](_0x894d('0x4a'));}}Fax[_0x894d('0x1b')][_0x894d('0x4b')]=function(_0x2af6e0,_0x348292,_0x480879){var _0x2185a3=this;var _0x16dcd6={};if(_0x348292){_0x16dcd6={'read':_0x348292};}else{_0x16dcd6={'failMessage':_0x480879};}if(this['actions'][_0x2af6e0][_0x894d('0x44')]){faxMessage['update'](this['actions'][_0x2af6e0][_0x894d('0x44')],_0x16dcd6)[_0x894d('0x4c')](function(_0x2aba98){ut['logger'](_0x894d('0x4d'),_0x2aba98);})[_0x894d('0x3a')](function(_0x1556c4){ut[_0x894d('0x47')](_0x894d('0x4e'),_0x1556c4);})[_0x894d('0x4f')](function(){delete _0x2185a3[_0x894d('0xa')][_0x2af6e0];delete _0x2185a3[_0x894d('0x25')][_0x2af6e0];});}else{ut[_0x894d('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x894d('0xa')][_0x2af6e0];delete this['actions'][_0x2af6e0];}};Fax['prototype'][_0x894d('0x19')]=function(_0x33550e){var _0x40d170=this;if(this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]]){if(this['actions'][_0x33550e[_0x894d('0x21')]]){this['channels'][_0x33550e['uniqueid']]['id']=this['actions'][_0x33550e[_0x894d('0x21')]]['id'];this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x23')]=this[_0x894d('0x25')][_0x33550e[_0x894d('0x21')]][_0x894d('0x23')];}logger[_0x894d('0x24')](_0x33550e[_0x894d('0x21')],this['actions'][_0x33550e[_0x894d('0x21')]]?_0x894d('0x50'):_0x894d('0x51'),JSON[_0x894d('0x3d')](this['channels'][_0x33550e[_0x894d('0x21')]]));if(this[_0x894d('0x25')][_0x33550e['uniqueid']]){if(this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x52')]>0x0&&this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x53')]===_0x894d('0x54')){this[_0x894d('0x4b')](_0x33550e[_0x894d('0x21')],!![]);}else{this[_0x894d('0x4b')](_0x33550e[_0x894d('0x21')],![],this['channels'][_0x33550e[_0x894d('0x21')]][_0x894d('0x55')]?_0x894d('0x56')+this[_0x894d('0xa')][_0x33550e[_0x894d('0x21')]][_0x894d('0x55')]:_0x894d('0x57'));}}}};Fax[_0x894d('0x1b')]['send']=function(_0x406853){var _0x2381bf=this;return new BPromise(function(_0x482ba6,_0x1b2716){_0x2381bf[_0x894d('0x58')](_0x406853,_0x2381bf[_0x894d('0xb')][_0x406853[_0x894d('0x59')]])[_0x894d('0x4c')](function(_0x541f0e){ut[_0x894d('0x47')](_0x894d('0x5a'),_0x541f0e);_0x482ba6(ut[_0x894d('0x5b')](_0x894d('0x5c')));})['catch'](function(_0x1ccc5f){ut[_0x894d('0x47')](_0x894d('0x5d'),_0x1ccc5f);updateStatus(_0x406853);_0x1b2716(ut['message']('Fax\x20failed'));});});};Fax[_0x894d('0x1b')][_0x894d('0x5e')]=function(_0x2e92b4){var _0x567d7c=this;return new BPromise(function(_0x2639e2,_0x1ad23d){var _0x4e400a=_0x567d7c[_0x894d('0x5f')](_0x567d7c[_0x894d('0xb')][_0x2e92b4[_0x894d('0x59')]]['Trunk'],_0x2e92b4);if(_0x4e400a[_0x894d('0x60')]){_0x2639e2(ut[_0x894d('0x5b')](_0x894d('0x61')));}else{_0x1ad23d(ut[_0x894d('0x5b')](_0x4e400a[_0x894d('0x5b')]));}});};function originate(_0x2c3130,_0x4b67f1,_0x3303f4){return new BPromise(function(_0x10fbd3,_0x2a5c29){if(_0x3303f4){var _0x1c2245=util[_0x894d('0x62')](_0x894d('0x63'),path['parse'](_0x2c3130[_0x894d('0x64')])[_0x894d('0x23')],_0x2c3130[_0x894d('0x64')]);gs[_0x894d('0x65')](_0x1c2245)[_0x894d('0x4c')](function(){_0x2c3130['path']=util[_0x894d('0x62')](_0x894d('0x66'),path[_0x894d('0x37')](_0x2c3130[_0x894d('0x64')])['dir'],path[_0x894d('0x37')](_0x2c3130[_0x894d('0x64')])[_0x894d('0x23')]);_0x4b67f1[_0x894d('0x67')]=_0x2c3130[_0x894d('0x64')];ut[_0x894d('0x47')](_0x894d('0x68'),'');ami[_0x894d('0x69')](ut[_0x894d('0x6a')](_0x2c3130,_0x4b67f1))[_0x894d('0x4c')](function(_0xe5efe3){_0x10fbd3(_0xe5efe3);})[_0x894d('0x3a')](function(_0x9314b5){_0x2a5c29(_0x9314b5);});})['catch'](function(_0x5126a4){_0x2a5c29(_0x5126a4);});}else{ami[_0x894d('0x69')](ut[_0x894d('0x6a')](_0x2c3130,_0x4b67f1))[_0x894d('0x4c')](function(_0xebc28e){_0x10fbd3(_0xebc28e);})[_0x894d('0x3a')](function(_0x35acca){_0x2a5c29(_0x35acca);});}});}Fax[_0x894d('0x1b')][_0x894d('0x58')]=function(_0x400e22,_0x57bed5){var _0x2380a7=this;return new BPromise(function(_0x46aef8,_0x3222dc){var _0x3edc7c=uuid['v4']();var _0x34eadd=ut[_0x894d('0x6b')](_0x400e22,_0x57bed5);_0x2380a7[_0x894d('0x25')][_0x3edc7c]=new Action(_0x3edc7c,_0x57bed5,_0x400e22);var _0x80fe81=_0x2380a7[_0x894d('0x25')][_0x3edc7c];if(path[_0x894d('0x37')](_0x400e22[_0x894d('0x64')])[_0x894d('0x6c')]===_0x894d('0x39')){originate(_0x80fe81,_0x34eadd,!![])[_0x894d('0x4c')](function(_0x4ce0a9){_0x46aef8(_0x4ce0a9);})[_0x894d('0x3a')](function(_0x21c379){_0x3222dc(_0x21c379);});}else{originate(_0x80fe81,_0x34eadd,![])[_0x894d('0x4c')](function(_0x3194a6){_0x46aef8(_0x3194a6);})[_0x894d('0x3a')](function(_0x4a89e7){_0x3222dc(_0x4a89e7);});}});};Fax[_0x894d('0x1b')]['isTrunkReachable']=function(_0x5684b7){return!_[_0x894d('0x6d')](_0x5684b7)&&!_['isNil'](_0x5684b7[_0x894d('0x23')])&&!_['isNil'](_0x5684b7[_0x894d('0x6e')])&&_0x5684b7[_0x894d('0x6e')]&&!_['isNil'](this['trunks'][util[_0x894d('0x62')](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])])&&!_['isNil'](this['trunks'][util[_0x894d('0x62')](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])][_0x894d('0x2c')])&&(this[_0x894d('0xc')][util['format'](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])][_0x894d('0x2c')]==='reachable'||this[_0x894d('0xc')][util['format'](_0x894d('0x6f'),_0x5684b7[_0x894d('0x23')])][_0x894d('0x2c')]==='unmonitored');};Fax[_0x894d('0x1b')][_0x894d('0x5f')]=function(_0xf005c1,_0x230985){if(!this[_0x894d('0x70')](_0xf005c1)){ut[_0x894d('0x47')](_0x894d('0x71'),_[_0x894d('0x6d')](_0xf005c1)?'':_0xf005c1['name']+_0x894d('0x72'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x894d('0x6d')](_0x230985[_0x894d('0x2')])){ut[_0x894d('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x894d('0x3d')](_0x230985));return{'isValid':![],'message':_0x894d('0x73')};}if(_[_0x894d('0x6d')](_0x230985['path'])){ut[_0x894d('0x47')](_0x894d('0x74'),JSON[_0x894d('0x3d')](_0x230985));return{'isValid':![],'message':_0x894d('0x75')};}return{'isValid':!![],'message':_0x894d('0x76')};};module[_0x894d('0x77')]=Fax; \ No newline at end of file +var _0x8e41=['./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','hangup','syncHangup','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20receiveFax\x20','stringify','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','faxpages','faxstatus','SUCCESS','faxstatusstring','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x8e41,0xd6));var _0x18e4=function(_0x409ef4,_0x435589){_0x409ef4=_0x409ef4-0x0;var _0x50036b=_0x8e41[_0x409ef4];return _0x50036b;};'use strict';var util=require(_0x18e4('0x0'));var _=require(_0x18e4('0x1'));var BPromise=require(_0x18e4('0x2'));var uuid=require('uuid');var moment=require(_0x18e4('0x3'));var path=require(_0x18e4('0x4'));var tiff2pdf=require(_0x18e4('0x5'));var gs=require(_0x18e4('0x6'));var logger=require(_0x18e4('0x7'))(_0x18e4('0x8'));var ami=require(_0x18e4('0x9'));var rpcDb=require(_0x18e4('0xa'));var Channel=require('./channel');var ut=require(_0x18e4('0xb'));var Action=require(_0x18e4('0xc'));var faxAccount=require(_0x18e4('0xd'));var attachment=require(_0x18e4('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0xe5493b){this[_0x18e4('0xf')]={};this['faxAccounts']=_0xe5493b[_0x18e4('0x10')];this[_0x18e4('0x11')]=_0xe5493b[_0x18e4('0x11')];this['actions']={};ami['on'](_0x18e4('0x12'),this[_0x18e4('0x13')][_0x18e4('0x14')](this));ami['on']('varset',this[_0x18e4('0x15')]['bind'](this));ami['on'](_0x18e4('0x16'),this[_0x18e4('0x17')]['bind'](this));ami['on'](_0x18e4('0x18'),this['syncNewExten'][_0x18e4('0x14')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x18e4('0x14')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x18e4('0x14')](this));ami['on'](_0x18e4('0x19'),this[_0x18e4('0x1a')][_0x18e4('0x14')](this));ami['on']('originateresponse',this[_0x18e4('0x1b')][_0x18e4('0x14')](this));}Fax['prototype'][_0x18e4('0x13')]=function(_0x5cd989){if(_0x5cd989[_0x18e4('0x1c')]===_0x18e4('0x1d')){for(var _0x2dbaf2 in this[_0x18e4('0x10')]){if(this[_0x18e4('0x10')][_0x18e4('0x1e')](_0x2dbaf2)){if(_0x5cd989[_0x18e4('0x1f')]===this['faxAccounts'][_0x2dbaf2][_0x18e4('0x20')]){this[_0x18e4('0xf')][_0x5cd989[_0x18e4('0x21')]]={};this[_0x18e4('0xf')][_0x5cd989[_0x18e4('0x21')]]['channel']=_0x5cd989[_0x18e4('0x22')];this[_0x18e4('0xf')][_0x5cd989[_0x18e4('0x21')]]['id']=this[_0x18e4('0x10')][_0x2dbaf2]['id'];this[_0x18e4('0xf')][_0x5cd989['uniqueid']][_0x18e4('0x23')]=this[_0x18e4('0x10')][_0x2dbaf2]['name'];logger[_0x18e4('0x24')](_0x5cd989[_0x18e4('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x18e4('0x25')][_0x5cd989['uniqueid']]){this['channels'][_0x5cd989[_0x18e4('0x21')]]={};this[_0x18e4('0xf')][_0x5cd989[_0x18e4('0x21')]]['channel']=_0x5cd989[_0x18e4('0x22')];logger[_0x18e4('0x24')](_0x5cd989[_0x18e4('0x21')],_0x18e4('0x26'));}};Fax[_0x18e4('0x27')]['syncVarSet']=function(_0x1b2a72){if(this[_0x18e4('0xf')][_0x1b2a72[_0x18e4('0x21')]]){for(var _0x1f3318 in _0x1b2a72[_0x18e4('0x28')]){if(_0x1b2a72[_0x18e4('0x28')]['hasOwnProperty'](_0x1f3318)){this['channels'][_0x1b2a72[_0x18e4('0x21')]][_0x1f3318]=_0x1b2a72['value'];}}}};Fax[_0x18e4('0x27')][_0x18e4('0x17')]=function(_0x1cf969){if(this[_0x18e4('0xf')][_0x1cf969[_0x18e4('0x21')]]){this[_0x18e4('0xf')][_0x1cf969[_0x18e4('0x21')]]['channelstate']=_0x1cf969[_0x18e4('0x29')];this[_0x18e4('0xf')][_0x1cf969[_0x18e4('0x21')]][_0x18e4('0x2a')]=_0x1cf969[_0x18e4('0x2a')];}};Fax['prototype']['syncNewExten']=function(_0x5b0a9a){if(this[_0x18e4('0xf')][_0x5b0a9a[_0x18e4('0x21')]]){for(var _0x39136f in _0x5b0a9a[_0x18e4('0x28')]){if(_0x5b0a9a[_0x18e4('0x28')]['hasOwnProperty'](_0x39136f)){this['channels'][_0x5b0a9a[_0x18e4('0x21')]][_0x39136f]=_0x5b0a9a[_0x18e4('0x2b')];}}}};Fax[_0x18e4('0x27')][_0x18e4('0x2c')]=function(_0xf1c6e){if(this[_0x18e4('0xf')][_0xf1c6e[_0x18e4('0x21')]]){this['channels'][_0xf1c6e[_0x18e4('0x21')]][_0x18e4('0x2d')]=_0xf1c6e[_0x18e4('0x2d')];this['channels'][_0xf1c6e['uniqueid']][_0x18e4('0x2e')]=_0xf1c6e[_0x18e4('0x2e')];this[_0x18e4('0xf')][_0xf1c6e['uniqueid']]['localstationid']=_0xf1c6e[_0x18e4('0x20')];this['channels'][_0xf1c6e[_0x18e4('0x21')]][_0x18e4('0x2f')]=_0xf1c6e[_0x18e4('0x2f')];logger[_0x18e4('0x24')](_0xf1c6e[_0x18e4('0x21')],_0x18e4('0x30'));}};Fax[_0x18e4('0x27')]['syncReceiveFax']=function(_0x3096e3){var _0x4c8519=this;if(this[_0x18e4('0xf')][_0x3096e3['uniqueid']]){var _0x58fd38=this['channels'][_0x3096e3[_0x18e4('0x21')]]['id'];this[_0x18e4('0xf')][_0x3096e3['uniqueid']]['remotestationid']=_0x3096e3[_0x18e4('0x31')];this[_0x18e4('0xf')][_0x3096e3[_0x18e4('0x21')]][_0x18e4('0x32')]=_0x3096e3[_0x18e4('0x32')];this[_0x18e4('0xf')][_0x3096e3['uniqueid']][_0x18e4('0x20')]=_0x3096e3['localstationid'];this[_0x18e4('0xf')][_0x3096e3[_0x18e4('0x21')]][_0x18e4('0x33')]=_0x3096e3[_0x18e4('0x33')];this[_0x18e4('0xf')][_0x3096e3[_0x18e4('0x21')]][_0x18e4('0x34')]=_0x3096e3['transferrate'];this[_0x18e4('0xf')][_0x3096e3[_0x18e4('0x21')]][_0x18e4('0x2f')]=_0x3096e3[_0x18e4('0x2f')];this[_0x18e4('0xf')][_0x3096e3[_0x18e4('0x21')]][_0x18e4('0x35')]=_0x3096e3[_0x18e4('0x35')];if(this['channels'][_0x3096e3[_0x18e4('0x21')]][_0x18e4('0x32')]>0x0){tiff2pdf(_0x3096e3[_0x18e4('0x2f')],_0x18e4('0x36'),function(_0x3ed878){logger[_0x18e4('0x24')](_0x3096e3[_0x18e4('0x21')],_0x18e4('0x37'),_0x3ed878[_0x18e4('0x38')]);attachment[_0x18e4('0x39')]({'name':path['parse'](_0x3096e3[_0x18e4('0x2f')])[_0x18e4('0x23')],'basename':path[_0x18e4('0x3a')](_0x3096e3[_0x18e4('0x2f')])[_0x18e4('0x23')]+_0x18e4('0x3b'),'type':_0x18e4('0x3c')})[_0x18e4('0x3d')](function(_0x55c2f8){faxAccount[_0x18e4('0x3e')](_0x58fd38,{'from':_0x3096e3[_0x18e4('0x35')],'mapKey':'fax','body':path['parse'](_0x3096e3[_0x18e4('0x2f')])['name']+_0x18e4('0x3b'),'AttachmentId':_0x55c2f8['id']})[_0x18e4('0x3f')](function(_0xbe2366){logger[_0x18e4('0x40')](_0x3096e3[_0x18e4('0x21')],'\x20notify\x20',JSON['stringify'](_0xbe2366));});})[_0x18e4('0x3f')](function(_0x172a9a){logger[_0x18e4('0x40')](_0x3096e3[_0x18e4('0x21')],_0x18e4('0x41'),JSON[_0x18e4('0x42')](_0x172a9a));});});}logger[_0x18e4('0x24')](_0x3096e3[_0x18e4('0x21')],_0x18e4('0x41'));}};Fax[_0x18e4('0x27')][_0x18e4('0x1b')]=function(_0x17d72a){if(this[_0x18e4('0x25')][_0x17d72a[_0x18e4('0x21')]]){_['merge'](this[_0x18e4('0xf')][_0x17d72a[_0x18e4('0x21')]],_[_0x18e4('0x43')](_0x17d72a,[_0x18e4('0x44'),_0x18e4('0x45')]));}};function updateStatus(_0x4df332){if(_0x4df332[_0x18e4('0x46')]){faxMessage['update'](_0x4df332[_0x18e4('0x46')],{'failMessage':_0x18e4('0x47')})[_0x18e4('0x3d')](function(_0x19b162){ut[_0x18e4('0x48')](_0x18e4('0x49'),_0x19b162);})['catch'](function(_0x18faea){ut[_0x18e4('0x48')](_0x18e4('0x4a'),_0x18faea);});}else{ut[_0x18e4('0x48')](_0x18e4('0x4b'));}}Fax[_0x18e4('0x27')][_0x18e4('0x4c')]=function(_0x2b7f82,_0x1aa5c4,_0x289067){var _0x204e11=this;var _0x45760b={};if(_0x1aa5c4){_0x45760b={'read':_0x1aa5c4};}else{_0x45760b={'failMessage':_0x289067};}if(this[_0x18e4('0x25')][_0x2b7f82][_0x18e4('0x46')]){faxMessage[_0x18e4('0x4d')](this['actions'][_0x2b7f82][_0x18e4('0x46')],_0x45760b)[_0x18e4('0x3d')](function(_0x21b454){ut[_0x18e4('0x48')]('[Fax][Message][Updated]',_0x21b454);})[_0x18e4('0x3f')](function(_0x418904){ut[_0x18e4('0x48')](_0x18e4('0x4e'),_0x418904);})['finally'](function(){delete _0x204e11[_0x18e4('0xf')][_0x2b7f82];delete _0x204e11['actions'][_0x2b7f82];});}else{ut['logger'](_0x18e4('0x4f'));delete this[_0x18e4('0xf')][_0x2b7f82];delete this[_0x18e4('0x25')][_0x2b7f82];}};Fax[_0x18e4('0x27')][_0x18e4('0x1a')]=function(_0x5d70ac){var _0x4cd818=this;if(this[_0x18e4('0xf')][_0x5d70ac[_0x18e4('0x21')]]){if(this[_0x18e4('0x25')][_0x5d70ac['uniqueid']]){this[_0x18e4('0xf')][_0x5d70ac[_0x18e4('0x21')]]['id']=this[_0x18e4('0x25')][_0x5d70ac[_0x18e4('0x21')]]['id'];this['channels'][_0x5d70ac['uniqueid']][_0x18e4('0x23')]=this[_0x18e4('0x25')][_0x5d70ac[_0x18e4('0x21')]][_0x18e4('0x23')];}logger[_0x18e4('0x24')](_0x5d70ac[_0x18e4('0x21')],this[_0x18e4('0x25')][_0x5d70ac[_0x18e4('0x21')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x18e4('0xf')][_0x5d70ac[_0x18e4('0x21')]]));if(this[_0x18e4('0x25')][_0x5d70ac['uniqueid']]){if(this['channels'][_0x5d70ac['uniqueid']][_0x18e4('0x50')]>0x0&&this[_0x18e4('0xf')][_0x5d70ac[_0x18e4('0x21')]][_0x18e4('0x51')]===_0x18e4('0x52')){this[_0x18e4('0x4c')](_0x5d70ac[_0x18e4('0x21')],!![]);}else{this['updateStatus'](_0x5d70ac['uniqueid'],![],this[_0x18e4('0xf')][_0x5d70ac['uniqueid']]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this['channels'][_0x5d70ac[_0x18e4('0x21')]][_0x18e4('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x18e4('0x27')]['send']=function(_0x3c1d0c){var _0x25d2c3=this;return new BPromise(function(_0xe818b6,_0x1c33bc){_0x25d2c3[_0x18e4('0x54')](_0x3c1d0c,_0x25d2c3[_0x18e4('0x10')][_0x3c1d0c[_0x18e4('0x55')]])[_0x18e4('0x3d')](function(_0x25ea6f){ut[_0x18e4('0x48')]('[Fax][execOriginate][success]',_0x25ea6f);_0xe818b6(ut['message']('Fax\x20received'));})[_0x18e4('0x3f')](function(_0x541da4){ut[_0x18e4('0x48')](_0x18e4('0x56'),_0x541da4);updateStatus(_0x3c1d0c);_0x1c33bc(ut[_0x18e4('0x38')](_0x18e4('0x57')));});});};Fax['prototype'][_0x18e4('0x58')]=function(_0xa5226f){var _0x1b9393=this;return new BPromise(function(_0x4cb8f5,_0x484c7b){var _0x22d10d=_0x1b9393[_0x18e4('0x59')](_0x1b9393[_0x18e4('0x10')][_0xa5226f['FaxAccountId']][_0x18e4('0x5a')],_0xa5226f);if(_0x22d10d[_0x18e4('0x5b')]){_0x4cb8f5(ut[_0x18e4('0x38')](_0x18e4('0x5c')));}else{_0x484c7b(ut['message'](_0x22d10d[_0x18e4('0x38')]));}});};function originate(_0x5b89ff,_0x527198,_0x20909f){return new BPromise(function(_0x1ce98a,_0x313b3e){if(_0x20909f){var _0x346a1d=util[_0x18e4('0x5d')](_0x18e4('0x5e'),path[_0x18e4('0x3a')](_0x5b89ff[_0x18e4('0x4')])[_0x18e4('0x23')],_0x5b89ff[_0x18e4('0x4')]);gs[_0x18e4('0x5f')](_0x346a1d)[_0x18e4('0x3d')](function(){_0x5b89ff['path']=util[_0x18e4('0x5d')](_0x18e4('0x60'),path[_0x18e4('0x3a')](_0x5b89ff[_0x18e4('0x4')])['dir'],path[_0x18e4('0x3a')](_0x5b89ff['path'])[_0x18e4('0x23')]);_0x527198[_0x18e4('0x61')]=_0x5b89ff[_0x18e4('0x4')];ut[_0x18e4('0x48')](_0x18e4('0x62'),'');ami[_0x18e4('0x63')](ut[_0x18e4('0x64')](_0x5b89ff,_0x527198))['then'](function(_0x901418){_0x1ce98a(_0x901418);})['catch'](function(_0x3f9100){_0x313b3e(_0x3f9100);});})[_0x18e4('0x3f')](function(_0x3809b3){_0x313b3e(_0x3809b3);});}else{ami['Action'](ut[_0x18e4('0x64')](_0x5b89ff,_0x527198))[_0x18e4('0x3d')](function(_0x58007e){_0x1ce98a(_0x58007e);})[_0x18e4('0x3f')](function(_0x103076){_0x313b3e(_0x103076);});}});}Fax[_0x18e4('0x27')][_0x18e4('0x54')]=function(_0x458e87,_0x44e1f2){var _0x1a6c05=this;return new BPromise(function(_0x173775,_0x172174){var _0x3b868b=uuid['v4']();var _0x360cfd=ut[_0x18e4('0x65')](_0x458e87,_0x44e1f2);_0x1a6c05[_0x18e4('0x25')][_0x3b868b]=new Action(_0x3b868b,_0x44e1f2,_0x458e87);var _0x37f6fa=_0x1a6c05[_0x18e4('0x25')][_0x3b868b];if(path[_0x18e4('0x3a')](_0x458e87[_0x18e4('0x4')])[_0x18e4('0x66')]===_0x18e4('0x3b')){originate(_0x37f6fa,_0x360cfd,!![])[_0x18e4('0x3d')](function(_0x39ad58){_0x173775(_0x39ad58);})['catch'](function(_0x4ba296){_0x172174(_0x4ba296);});}else{originate(_0x37f6fa,_0x360cfd,![])[_0x18e4('0x3d')](function(_0x138b9c){_0x173775(_0x138b9c);})[_0x18e4('0x3f')](function(_0x5d6381){_0x172174(_0x5d6381);});}});};Fax['prototype']['isTrunkReachable']=function(_0x515ae8){return!_[_0x18e4('0x67')](_0x515ae8)&&!_[_0x18e4('0x67')](_0x515ae8[_0x18e4('0x23')])&&!_[_0x18e4('0x67')](_0x515ae8[_0x18e4('0x68')])&&_0x515ae8[_0x18e4('0x68')]&&!_[_0x18e4('0x67')](this['trunks'][util[_0x18e4('0x5d')](_0x18e4('0x69'),_0x515ae8['name'])])&&!_[_0x18e4('0x67')](this['trunks'][util[_0x18e4('0x5d')]('SIP/%s',_0x515ae8[_0x18e4('0x23')])][_0x18e4('0x2e')])&&(this[_0x18e4('0x11')][util[_0x18e4('0x5d')](_0x18e4('0x69'),_0x515ae8['name'])][_0x18e4('0x2e')]==='reachable'||this['trunks'][util[_0x18e4('0x5d')]('SIP/%s',_0x515ae8['name'])][_0x18e4('0x2e')]===_0x18e4('0x6a'));};Fax['prototype']['checkTrunk']=function(_0x7a4e71,_0x3d29d2){if(!this['isTrunkReachable'](_0x7a4e71)){ut['logger'](_0x18e4('0x6b'),_[_0x18e4('0x67')](_0x7a4e71)?'':_0x7a4e71[_0x18e4('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x18e4('0x6c')};}if(_[_0x18e4('0x67')](_0x3d29d2[_0x18e4('0x8')])){ut['logger'](_0x18e4('0x6d'),JSON[_0x18e4('0x42')](_0x3d29d2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x18e4('0x67')](_0x3d29d2[_0x18e4('0x4')])){ut[_0x18e4('0x48')](_0x18e4('0x6e'),JSON[_0x18e4('0x42')](_0x3d29d2));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x18e4('0x6f')};};module[_0x18e4('0x70')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 48c7212..5b31ddf 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 _0x1c50=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','util','bluebird','../../../config/logger','preview'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c50,0x11a));var _0x01c5=function(_0x2c9a9b,_0x53b928){_0x2c9a9b=_0x2c9a9b-0x0;var _0x4e35cf=_0x1c50[_0x2c9a9b];return _0x4e35cf;};'use strict';var util=require(_0x01c5('0x0'));var BPromise=require(_0x01c5('0x1'));var logger=require(_0x01c5('0x2'))(_0x01c5('0x3'));var _=require(_0x01c5('0x4'));var faxAccount=require(_0x01c5('0x5'));function loggerCatch(_0x3b7433){return function(_0x4e42d6){logger[_0x01c5('0x6')](_0x3b7433,util[_0x01c5('0x7')](_0x4e42d6,{'showHidden':![],'depth':null}));};}exports[_0x01c5('0x8')]=function(_0x11b266,_0x741294){return BPromise[_0x01c5('0x9')]()[_0x01c5('0xa')](faxAccount[_0x01c5('0x8')](_0x11b266,_0x741294))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xe356=['util','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','then','notify','[Notify]\x20'];(function(_0x4a58b7,_0xe6c30b){var _0x3afe14=function(_0x29a5e7){while(--_0x29a5e7){_0x4a58b7['push'](_0x4a58b7['shift']());}};_0x3afe14(++_0xe6c30b);}(_0xe356,0x144));var _0x6e35=function(_0x20caec,_0x16cb7e){_0x20caec=_0x20caec-0x0;var _0x5cbb27=_0xe356[_0x20caec];return _0x5cbb27;};'use strict';var util=require(_0x6e35('0x0'));var BPromise=require('bluebird');var logger=require(_0x6e35('0x1'))(_0x6e35('0x2'));var _=require(_0x6e35('0x3'));var faxAccount=require(_0x6e35('0x4'));function loggerCatch(_0x2c683e){return function(_0x31eb0d){logger['error'](_0x2c683e,util[_0x6e35('0x5')](_0x31eb0d,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2efaaf,_0x497320){return BPromise['resolve']()[_0x6e35('0x6')](faxAccount[_0x6e35('0x7')](_0x2efaaf,_0x497320))['catch'](loggerCatch(_0x6e35('0x8')));}; \ 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 c4984cd..78e7c76 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 _0x5d11=['Exec\x20gs','inspect','../../../../config/logger','fax','bluebird','child_process','execute','info'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5d11,0x72));var _0x15d1=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0x5d11[_0x499ca5];return _0x7bfd9c;};'use strict';var util=require('util');var logger=require(_0x15d1('0x0'))(_0x15d1('0x1'));var BPromise=require(_0x15d1('0x2'));var exec=require(_0x15d1('0x3'))['exec'];exports[_0x15d1('0x4')]=function(_0x32a157){return new BPromise(function(_0xbc30b9,_0x3f099d){exec(_0x32a157,function(_0x4dfe3f,_0xed158e,_0x297842){logger[_0x15d1('0x5')](_0x15d1('0x6'),_0xed158e);if(_0x4dfe3f){logger[_0x15d1('0x5')](_0x15d1('0x6'),'\x20Error\x20:',util[_0x15d1('0x7')](_0x4dfe3f,{'showHidden':![],'depth':null}),_0xed158e,_0x297842);_0x3f099d(_0x4dfe3f);}_0xbc30b9(_0xed158e);});});}; \ No newline at end of file +var _0x5d6c=['inspect','../../../../config/logger','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:'];(function(_0x37a416,_0x14ee6a){var _0x47959e=function(_0x57aa93){while(--_0x57aa93){_0x37a416['push'](_0x37a416['shift']());}};_0x47959e(++_0x14ee6a);}(_0x5d6c,0xa1));var _0xc5d6=function(_0x4ea773,_0x50c3b0){_0x4ea773=_0x4ea773-0x0;var _0x42b5d1=_0x5d6c[_0x4ea773];return _0x42b5d1;};'use strict';var util=require('util');var logger=require(_0xc5d6('0x0'))('fax');var BPromise=require('bluebird');var exec=require(_0xc5d6('0x1'))[_0xc5d6('0x2')];exports[_0xc5d6('0x3')]=function(_0x2b9188){return new BPromise(function(_0x1eb030,_0x3abc4d){exec(_0x2b9188,function(_0xebc1e6,_0x5bb2cc,_0x5aaf42){logger['info'](_0xc5d6('0x4'),_0x5bb2cc);if(_0xebc1e6){logger[_0xc5d6('0x5')](_0xc5d6('0x4'),_0xc5d6('0x6'),util[_0xc5d6('0x7')](_0xebc1e6,{'showHidden':![],'depth':null}),_0x5bb2cc,_0x5aaf42);_0x3abc4d(_0xebc1e6);}_0x1eb030(_0x5bb2cc);});});}; \ 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 c9d1555..c75243a 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 _0x51fc=['moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','path','variablesAction','uniqueid','originate','channel','from-sip','localstationid','util'];(function(_0x9decac,_0x249b5c){var _0x267afb=function(_0x3bc773){while(--_0x3bc773){_0x9decac['push'](_0x9decac['shift']());}};_0x267afb(++_0x249b5c);}(_0x51fc,0x1b4));var _0xc51f=function(_0x185deb,_0x20e36f){_0x185deb=_0x185deb-0x0;var _0x37436e=_0x51fc[_0x185deb];return _0x37436e;};'use strict';var util=require(_0xc51f('0x0'));var _=require('lodash');var moment=require(_0xc51f('0x1'));var logger=require(_0xc51f('0x2'))(_0xc51f('0x3'));exports[_0xc51f('0x4')]=function(_0xcd6db1){return{'message':_0xcd6db1};};exports[_0xc51f('0x5')]=function(_0xa290a9,_0x241e44){logger[_0xc51f('0x6')](_0xa290a9,util[_0xc51f('0x7')](_0x241e44,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x22e166,_0x3d86f9){var _0xcdad90={'XMF-ECM':_0x3d86f9[_0xc51f('0x8')],'XMF-HEADERINFO':_0x3d86f9[_0xc51f('0x9')],'XMF-MINRATE':_0x3d86f9[_0xc51f('0xa')],'XMF-MAXRATE':_0x3d86f9[_0xc51f('0xb')],'XMF-MODEM':util['format'](_0xc51f('0xc'),_0x3d86f9[_0xc51f('0xd')]),'XMF-GATEWAY':_0x3d86f9[_0xc51f('0xe')],'XMF-FAXDETECT':_0x3d86f9[_0xc51f('0xf')],'XMF-T38TIMEOUT':_0x3d86f9['t38timeout'],'XMF-LOCALSTATIONID':_0x3d86f9['localstationid'],'XMF-PATH':_0x22e166[_0xc51f('0x10')]};return _0xcdad90;};exports[_0xc51f('0x11')]=function(_0x615cdd,_0x5971e8){return{'actionid':_0x615cdd[_0xc51f('0x12')],'action':_0xc51f('0x13'),'channel':_0x615cdd[_0xc51f('0x14')],'Exten':'xcally-motion-fax','Context':_0xc51f('0x15'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x615cdd['headerinfo']?_0x615cdd[_0xc51f('0x9')]:'',_0x615cdd[_0xc51f('0x16')]),'variable':_0x5971e8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x615cdd[_0xc51f('0x12')]};}; \ No newline at end of file +var _0x770e=['format','\x22%s\x22','gateway','faxdetect','t38timeout','path','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','../../../../config/logger','message','logger','inspect','addVariables','headerinfo','minrate'];(function(_0x1f3a0c,_0x3c55c8){var _0x1cf471=function(_0x36c2a3){while(--_0x36c2a3){_0x1f3a0c['push'](_0x1f3a0c['shift']());}};_0x1cf471(++_0x3c55c8);}(_0x770e,0x1b0));var _0xe770=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x770e[_0x33032e];return _0x13316b;};'use strict';var util=require('util');var _=require(_0xe770('0x0'));var moment=require('moment');var logger=require(_0xe770('0x1'))('fax');exports[_0xe770('0x2')]=function(_0x3d5b68){return{'message':_0x3d5b68};};exports[_0xe770('0x3')]=function(_0x46a026,_0x1540c8){logger['info'](_0x46a026,util[_0xe770('0x4')](_0x1540c8,{'showHidden':![],'depth':null}));};exports[_0xe770('0x5')]=function(_0x592b6c,_0x4e4eb0){var _0x4d8fdc={'XMF-ECM':_0x4e4eb0['ecm'],'XMF-HEADERINFO':_0x4e4eb0[_0xe770('0x6')],'XMF-MINRATE':_0x4e4eb0[_0xe770('0x7')],'XMF-MAXRATE':_0x4e4eb0['maxrate'],'XMF-MODEM':util[_0xe770('0x8')](_0xe770('0x9'),_0x4e4eb0['modem']),'XMF-GATEWAY':_0x4e4eb0[_0xe770('0xa')],'XMF-FAXDETECT':_0x4e4eb0[_0xe770('0xb')],'XMF-T38TIMEOUT':_0x4e4eb0[_0xe770('0xc')],'XMF-LOCALSTATIONID':_0x4e4eb0['localstationid'],'XMF-PATH':_0x592b6c[_0xe770('0xd')]};return _0x4d8fdc;};exports['variablesAction']=function(_0x2b0478,_0x27b650){return{'actionid':_0x2b0478[_0xe770('0xe')],'action':_0xe770('0xf'),'channel':_0x2b0478[_0xe770('0x10')],'Exten':'xcally-motion-fax','Context':_0xe770('0x11'),'Priority':'1','callerid':util['format'](_0xe770('0x12'),_0x2b0478[_0xe770('0x6')]?_0x2b0478[_0xe770('0x6')]:'',_0x2b0478[_0xe770('0x13')]),'variable':_0x27b650,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2b0478[_0xe770('0xe')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index d83e163..f8663a7 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 _0xd2ab=['getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','listen','sync','log','bluebird','util','./server','./realtime','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates'];(function(_0x48dc11,_0x5b63b5){var _0x552608=function(_0x7b6683){while(--_0x7b6683){_0x48dc11['push'](_0x48dc11['shift']());}};_0x552608(++_0x5b63b5);}(_0xd2ab,0x137));var _0xbd2a=function(_0x59136e,_0x50137e){_0x59136e=_0x59136e-0x0;var _0x3f136c=_0xd2ab[_0x59136e];return _0x3f136c;};'use strict';var BPromise=require(_0xbd2a('0x0'));var util=require(_0xbd2a('0x1'));var moment=require('moment');var server=require(_0xbd2a('0x2'));var Realtime=require(_0xbd2a('0x3'));var Report=require(_0xbd2a('0x4'));var Acw=require(_0xbd2a('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xbd2a('0x6'));var Preview=require('./preview');var Fax=require(_0xbd2a('0x7'));var user=require(_0xbd2a('0x8'));var voiceQueue=require(_0xbd2a('0x9'));var voiceQueueReport=require(_0xbd2a('0xa'));var voiceCallReport=require(_0xbd2a('0xb'));var trunk=require(_0xbd2a('0xc'));var trigger=require(_0xbd2a('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbd2a('0xe'));var campaign=require(_0xbd2a('0xf'));var voiceExtension=require(_0xbd2a('0x10'));var faxAccount=require(_0xbd2a('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xbd2a('0x12'));var sugarcrm=require(_0xbd2a('0x13'));var freshdesk=require(_0xbd2a('0x14'));var desk=require(_0xbd2a('0x15'));var zoho=require(_0xbd2a('0x16'));var vtiger=require(_0xbd2a('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xbd2a('0x18'));var dynamics365=require(_0xbd2a('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xbd2a('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xbd2a('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbd2a('0x1b')]()[_0xbd2a('0x1c')](user[_0xbd2a('0x1d')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x1e')]())[_0xbd2a('0x1c')](user[_0xbd2a('0x1f')]())['then'](realtime['initTelephones']())[_0xbd2a('0x1c')](trunk[_0xbd2a('0x20')]())['then'](realtime[_0xbd2a('0x21')]())['then'](voiceQueue[_0xbd2a('0x22')]())['then'](realtime[_0xbd2a('0x23')]())[_0xbd2a('0x1c')](trigger[_0xbd2a('0x24')]())['then'](realtime[_0xbd2a('0x25')]())[_0xbd2a('0x1c')](template['getTemplates']())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x26')]())[_0xbd2a('0x1c')](zendesk[_0xbd2a('0x27')]())[_0xbd2a('0x1c')](realtime['initZendeskAccounts']())[_0xbd2a('0x1c')](salesforce['getSalesforceAccounts']())['then'](realtime[_0xbd2a('0x28')]())[_0xbd2a('0x1c')](sugarcrm[_0xbd2a('0x29')]())['then'](realtime[_0xbd2a('0x2a')]())[_0xbd2a('0x1c')](freshdesk[_0xbd2a('0x2b')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0xbd2a('0x2c')]())[_0xbd2a('0x1c')](realtime['initDeskAccounts']())[_0xbd2a('0x1c')](zoho[_0xbd2a('0x2d')]())[_0xbd2a('0x1c')](realtime['initZohoAccounts']())[_0xbd2a('0x1c')](vtiger[_0xbd2a('0x2e')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x2f')]())[_0xbd2a('0x1c')](freshsales[_0xbd2a('0x30')]())['then'](realtime[_0xbd2a('0x31')]())[_0xbd2a('0x1c')](servicenow[_0xbd2a('0x32')]())['then'](realtime[_0xbd2a('0x33')]())[_0xbd2a('0x1c')](dynamics365[_0xbd2a('0x34')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x35')]())[_0xbd2a('0x1c')](campaign[_0xbd2a('0x36')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x37')]())[_0xbd2a('0x1c')](voiceExtension[_0xbd2a('0x38')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x39')]())[_0xbd2a('0x1c')](faxAccount[_0xbd2a('0x3a')]())['then'](realtime['initFaxAccounts']())[_0xbd2a('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xbd2a('0x1b')]()[_0xbd2a('0x1c')](voiceQueueReport[_0xbd2a('0x3b')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x3c')]())['then'](cmHopperHistory[_0xbd2a('0x3d')]())[_0xbd2a('0x1c')](realtime[_0xbd2a('0x3e')]())[_0xbd2a('0x1c')](cmHopperHistory[_0xbd2a('0x3f')]())['then'](realtime[_0xbd2a('0x40')]())[_0xbd2a('0x1c')](voiceCallReport[_0xbd2a('0x41')]())[_0xbd2a('0x1c')](realtime['initVoiceCallReports']())['then'](function(_0x54656f){})[_0xbd2a('0x42')](function(_0x2c71d0){console['log'](_0x2c71d0);});}function main(){return server[_0xbd2a('0x43')](realtime,preview,fax)[_0xbd2a('0x1c')](function(_0x8b1171){return initRealtime();})[_0xbd2a('0x1c')](function(){return initParams();})[_0xbd2a('0x1c')](function(){report[_0xbd2a('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x2f3a14){console[_0xbd2a('0x45')](_0x2f3a14);});}main(); \ No newline at end of file +var _0x0617=['./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','initAgents','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk'];(function(_0x221686,_0x1b686e){var _0x3a8d5b=function(_0x232794){while(--_0x232794){_0x221686['push'](_0x221686['shift']());}};_0x3a8d5b(++_0x1b686e);}(_0x0617,0x14c));var _0x7061=function(_0x1199a5,_0x5bd63b){_0x1199a5=_0x1199a5-0x0;var _0x29d7b6=_0x0617[_0x1199a5];return _0x29d7b6;};'use strict';var BPromise=require(_0x7061('0x0'));var util=require(_0x7061('0x1'));var moment=require(_0x7061('0x2'));var server=require('./server');var Realtime=require(_0x7061('0x3'));var Report=require(_0x7061('0x4'));var Acw=require(_0x7061('0x5'));var Trigger=require(_0x7061('0x6'));var Dialer=require(_0x7061('0x7'));var Preview=require(_0x7061('0x8'));var Fax=require(_0x7061('0x9'));var user=require(_0x7061('0xa'));var voiceQueue=require(_0x7061('0xb'));var voiceQueueReport=require(_0x7061('0xc'));var voiceCallReport=require(_0x7061('0xd'));var trunk=require('./rpc/trunk');var trigger=require(_0x7061('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x7061('0xf'));var campaign=require(_0x7061('0x10'));var voiceExtension=require(_0x7061('0x11'));var faxAccount=require(_0x7061('0x12'));var zendesk=require(_0x7061('0x13'));var salesforce=require(_0x7061('0x14'));var sugarcrm=require(_0x7061('0x15'));var freshdesk=require(_0x7061('0x16'));var desk=require(_0x7061('0x17'));var zoho=require(_0x7061('0x18'));var vtiger=require(_0x7061('0x19'));var freshsales=require(_0x7061('0x1a'));var servicenow=require(_0x7061('0x1b'));var dynamics365=require(_0x7061('0x1c'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7061('0x1d')](_0x7061('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7061('0x1d')](_0x7061('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7061('0x1f')]()['then'](user['getAgents']())[_0x7061('0x20')](realtime[_0x7061('0x21')]())[_0x7061('0x20')](user['getTelephones']())['then'](realtime['initTelephones']())[_0x7061('0x20')](trunk[_0x7061('0x22')]())[_0x7061('0x20')](realtime[_0x7061('0x23')]())[_0x7061('0x20')](voiceQueue[_0x7061('0x24')]())[_0x7061('0x20')](realtime['initVoiceQueues']())[_0x7061('0x20')](trigger[_0x7061('0x25')]())['then'](realtime[_0x7061('0x26')]())[_0x7061('0x20')](template[_0x7061('0x27')]())[_0x7061('0x20')](realtime[_0x7061('0x28')]())[_0x7061('0x20')](zendesk['getZendeskAccounts']())[_0x7061('0x20')](realtime[_0x7061('0x29')]())[_0x7061('0x20')](salesforce[_0x7061('0x2a')]())[_0x7061('0x20')](realtime[_0x7061('0x2b')]())['then'](sugarcrm[_0x7061('0x2c')]())[_0x7061('0x20')](realtime[_0x7061('0x2d')]())[_0x7061('0x20')](freshdesk['getFreshdeskAccounts']())[_0x7061('0x20')](realtime[_0x7061('0x2e')]())[_0x7061('0x20')](desk[_0x7061('0x2f')]())[_0x7061('0x20')](realtime[_0x7061('0x30')]())[_0x7061('0x20')](zoho['getZohoAccounts']())['then'](realtime[_0x7061('0x31')]())['then'](vtiger['getVtigerAccounts']())['then'](realtime[_0x7061('0x32')]())[_0x7061('0x20')](freshsales[_0x7061('0x33')]())['then'](realtime[_0x7061('0x34')]())[_0x7061('0x20')](servicenow['getServicenowAccounts']())['then'](realtime[_0x7061('0x35')]())[_0x7061('0x20')](dynamics365[_0x7061('0x36')]())[_0x7061('0x20')](realtime[_0x7061('0x37')]())[_0x7061('0x20')](campaign[_0x7061('0x38')]())[_0x7061('0x20')](realtime[_0x7061('0x39')]())['then'](voiceExtension[_0x7061('0x3a')]())[_0x7061('0x20')](realtime[_0x7061('0x3b')]())[_0x7061('0x20')](faxAccount['getFaxAccounts']())['then'](realtime[_0x7061('0x3c')]())[_0x7061('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0x7061('0x1f')]()[_0x7061('0x20')](voiceQueueReport[_0x7061('0x3d')]())[_0x7061('0x20')](realtime[_0x7061('0x3e')]())['then'](cmHopperHistory[_0x7061('0x3f')]())[_0x7061('0x20')](realtime['initVoiceQueueHopperHistory']())[_0x7061('0x20')](cmHopperHistory[_0x7061('0x40')]())[_0x7061('0x20')](realtime['initCampaignHopperHistory']())[_0x7061('0x20')](voiceCallReport[_0x7061('0x41')]())[_0x7061('0x20')](realtime[_0x7061('0x42')]())['then'](function(_0x2164db){})[_0x7061('0x43')](function(_0x120406){console[_0x7061('0x44')](_0x120406);});}function main(){return server[_0x7061('0x45')](realtime,preview,fax)['then'](function(_0x53645b){return initRealtime();})[_0x7061('0x20')](function(){return initParams();})[_0x7061('0x20')](function(){report[_0x7061('0x46')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3bc356){console[_0x7061('0x44')](_0x3bc356);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 80571bf..b7f023c 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(_0x4e720e,_0x15919d){var _0x185d01=function(_0x5b05de){while(--_0x5b05de){_0x4e720e['push'](_0x4e720e['shift']());}};_0x185d01(++_0x15919d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x3833f9,_0x3a088e){var _0x162837=function(_0x5282bd){while(--_0x5282bd){_0x3833f9['push'](_0x3833f9['shift']());}};_0x162837(++_0x3a088e);}(_0xe706,0xa3));var _0x6e70=function(_0x2a2b9d,_0x29ad81){_0x2a2b9d=_0x2a2b9d-0x0;var _0x314b2d=_0xe706[_0x2a2b9d];return _0x314b2d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index bd1e66e..b3f5809 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 _0x08ec=['Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x08ec,0x1d1));var _0xc08e=function(_0x4d0468,_0x1f9694){_0x4d0468=_0x4d0468-0x0;var _0x481f9b=_0x08ec[_0x4d0468];return _0x481f9b;};'use strict';function Campaign(_0xbf0103){this['id']=_0xbf0103['id']||0x0;this[_0xc08e('0x0')]=_0xbf0103[_0xc08e('0x0')]||'';this[_0xc08e('0x1')]=_0xbf0103['type']||_0xc08e('0x2');this[_0xc08e('0x3')]=0x0;this[_0xc08e('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xc08e('0x5')]=0x0;this[_0xc08e('0x6')]='';this[_0xc08e('0x7')]=!![];this['active']=_0xbf0103[_0xc08e('0x8')];this[_0xc08e('0x9')]=_0xbf0103[_0xc08e('0x9')];this[_0xc08e('0xa')]=_0xbf0103[_0xc08e('0xa')]||null;this[_0xc08e('0xb')]=_0xbf0103[_0xc08e('0xb')]?_0xbf0103['dialGlobalInterval']:null;this[_0xc08e('0xc')]=_0xbf0103['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0xbf0103[_0xc08e('0xd')];this['dialOriginateTimeout']=_0xbf0103[_0xc08e('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0xbf0103[_0xc08e('0xf')];this['dialCongestionRetryFrequency']=_0xbf0103[_0xc08e('0x10')];this['dialBusyMaxRetry']=_0xbf0103[_0xc08e('0x11')];this['dialBusyRetryFrequency']=_0xbf0103[_0xc08e('0x12')];this[_0xc08e('0x13')]=_0xbf0103[_0xc08e('0x13')];this['dialNoAnswerRetryFrequency']=_0xbf0103[_0xc08e('0x14')];this[_0xc08e('0x15')]=_0xbf0103['dialGlobalMaxRetry'];this[_0xc08e('0x16')]=_0xbf0103[_0xc08e('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xbf0103['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0xbf0103['dialDropMaxRetry']||0x3;this[_0xc08e('0x17')]=_0xbf0103[_0xc08e('0x17')]||0x96;this[_0xc08e('0x18')]=_0xbf0103['dialAbandonedMaxRetry']||0x3;this[_0xc08e('0x19')]=_0xbf0103[_0xc08e('0x19')]||0x96;this['dialMachineMaxRetry']=_0xbf0103[_0xc08e('0x1a')]||0x3;this[_0xc08e('0x1b')]=_0xbf0103[_0xc08e('0x1b')]||0x96;this[_0xc08e('0x1c')]=_0xbf0103[_0xc08e('0x1c')]||0x3;this[_0xc08e('0x1d')]=_0xbf0103[_0xc08e('0x1d')]||0x96;this[_0xc08e('0x1e')]=_0xbf0103[_0xc08e('0x1e')]||_0xc08e('0x1f');this[_0xc08e('0x20')]=_0xbf0103[_0xc08e('0x20')]||undefined;this[_0xc08e('0x21')]=_0xbf0103[_0xc08e('0x21')]||undefined;this['dialCutDigit']=_0xbf0103['dialCutDigit']||undefined;this[_0xc08e('0x22')]=_0xbf0103[_0xc08e('0x22')]?_0xbf0103['TrunkBackup']:undefined;this[_0xc08e('0x23')]=_0xbf0103[_0xc08e('0x23')]?_0xbf0103[_0xc08e('0x23')]:undefined;this[_0xc08e('0x24')]=_0xbf0103[_0xc08e('0x24')]?_0xbf0103['Interval']:undefined;this['SquareProject']=_0xbf0103[_0xc08e('0x25')]?_0xbf0103[_0xc08e('0x25')]:undefined;this[_0xc08e('0x26')]=_0xbf0103[_0xc08e('0x25')]?_0xbf0103[_0xc08e('0x25')]['name']:undefined;this[_0xc08e('0x27')]=_0xbf0103[_0xc08e('0x27')]||![];this[_0xc08e('0x28')]=_0xbf0103[_0xc08e('0x28')];this['dialAMDGreeting']=_0xbf0103[_0xc08e('0x29')];this[_0xc08e('0x2a')]=_0xbf0103[_0xc08e('0x2a')];this['dialAMDTotalAnalysisTime']=_0xbf0103[_0xc08e('0x2b')];this[_0xc08e('0x2c')]=_0xbf0103['dialAMDMinWordLength'];this[_0xc08e('0x2d')]=_0xbf0103[_0xc08e('0x2d')];this[_0xc08e('0x2e')]=_0xbf0103[_0xc08e('0x2e')];this[_0xc08e('0x2f')]=_0xbf0103[_0xc08e('0x2f')];this[_0xc08e('0x30')]=_0xbf0103[_0xc08e('0x30')];}module[_0xc08e('0x31')]=Campaign; \ No newline at end of file +var _0xa5a3=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x4026df,_0x4d7dc4){var _0x1ad571=function(_0x539274){while(--_0x539274){_0x4026df['push'](_0x4026df['shift']());}};_0x1ad571(++_0x4d7dc4);}(_0xa5a3,0x186));var _0x3a5a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa5a3[_0x2641f9];return _0x585741;};'use strict';function Campaign(_0x315941){this['id']=_0x315941['id']||0x0;this['name']=_0x315941['name']||'';this[_0x3a5a('0x0')]=_0x315941['type']||_0x3a5a('0x1');this[_0x3a5a('0x2')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x3a5a('0x3')]='';this[_0x3a5a('0x4')]=!![];this[_0x3a5a('0x5')]=_0x315941[_0x3a5a('0x5')];this[_0x3a5a('0x6')]=_0x315941['limitCalls'];this['dialTimezone']=_0x315941['dialTimezone']||null;this[_0x3a5a('0x7')]=_0x315941[_0x3a5a('0x7')]?_0x315941[_0x3a5a('0x7')]:null;this[_0x3a5a('0x8')]=_0x315941[_0x3a5a('0x8')];this[_0x3a5a('0x9')]=_0x315941[_0x3a5a('0x9')];this[_0x3a5a('0xa')]=_0x315941['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x315941['dialCongestionMaxRetry'];this[_0x3a5a('0xb')]=_0x315941['dialCongestionRetryFrequency'];this[_0x3a5a('0xc')]=_0x315941['dialBusyMaxRetry'];this[_0x3a5a('0xd')]=_0x315941[_0x3a5a('0xd')];this[_0x3a5a('0xe')]=_0x315941[_0x3a5a('0xe')];this[_0x3a5a('0xf')]=_0x315941[_0x3a5a('0xf')];this[_0x3a5a('0x10')]=_0x315941[_0x3a5a('0x10')];this[_0x3a5a('0x11')]=_0x315941[_0x3a5a('0x11')]||0x3;this[_0x3a5a('0x12')]=_0x315941[_0x3a5a('0x12')]||0x96;this[_0x3a5a('0x13')]=_0x315941[_0x3a5a('0x13')]||0x3;this['dialDropRetryFrequency']=_0x315941['dialDropRetryFrequency']||0x96;this[_0x3a5a('0x14')]=_0x315941['dialAbandonedMaxRetry']||0x3;this[_0x3a5a('0x15')]=_0x315941['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x315941[_0x3a5a('0x16')]||0x3;this[_0x3a5a('0x17')]=_0x315941[_0x3a5a('0x17')]||0x96;this[_0x3a5a('0x18')]=_0x315941['dialAgentRejectMaxRetry']||0x3;this[_0x3a5a('0x19')]=_0x315941[_0x3a5a('0x19')]||0x96;this[_0x3a5a('0x1a')]=_0x315941['dialOrderByScheduledAt']||_0x3a5a('0x1b');this[_0x3a5a('0x1c')]=_0x315941[_0x3a5a('0x1c')]||undefined;this[_0x3a5a('0x1d')]=_0x315941[_0x3a5a('0x1d')]||undefined;this[_0x3a5a('0x1e')]=_0x315941['dialCutDigit']||undefined;this['TrunkBackup']=_0x315941[_0x3a5a('0x1f')]?_0x315941['TrunkBackup']:undefined;this[_0x3a5a('0x20')]=_0x315941[_0x3a5a('0x20')]?_0x315941['Trunk']:undefined;this[_0x3a5a('0x21')]=_0x315941[_0x3a5a('0x21')]?_0x315941[_0x3a5a('0x21')]:undefined;this['SquareProject']=_0x315941[_0x3a5a('0x22')]?_0x315941[_0x3a5a('0x22')]:undefined;this['dialQueueProject']=_0x315941['SquareProject']?_0x315941[_0x3a5a('0x22')][_0x3a5a('0x23')]:undefined;this[_0x3a5a('0x24')]=_0x315941[_0x3a5a('0x24')]||![];this[_0x3a5a('0x25')]=_0x315941[_0x3a5a('0x25')];this[_0x3a5a('0x26')]=_0x315941[_0x3a5a('0x26')];this['dialAMDAfterGreetingSilence']=_0x315941[_0x3a5a('0x27')];this['dialAMDTotalAnalysisTime']=_0x315941['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x315941[_0x3a5a('0x28')];this[_0x3a5a('0x29')]=_0x315941[_0x3a5a('0x29')];this[_0x3a5a('0x2a')]=_0x315941[_0x3a5a('0x2a')];this[_0x3a5a('0x2b')]=_0x315941['dialAMDSilenceThreshold'];this[_0x3a5a('0x2c')]=_0x315941['dialAMDMaximumWordLength'];}module[_0x3a5a('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 858d26d..f4a03a7 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 _0xdf28=['exports','starttime','destinationchannel','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','monitorFilename','queue','transfercalleridnum','transferType','mohtime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf28,0x1c3));var _0x8df2=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0xdf28[_0x393db8];return _0x4295cc;};'use strict';function Channel(){this[_0x8df2('0x0')]=null;this['channel']='';this[_0x8df2('0x1')]='';this['calleridnum']=0x0;this[_0x8df2('0x2')]='';this[_0x8df2('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x8df2('0x4')]=0x0;this[_0x8df2('0x5')]='';this[_0x8df2('0x6')]=0x0;this[_0x8df2('0x7')]=0x0;this[_0x8df2('0x8')]=0x0;this[_0x8df2('0x9')]=![];this[_0x8df2('0xa')]=null;this[_0x8df2('0xb')]=null;this[_0x8df2('0xc')]=![];this[_0x8df2('0xd')]=![];this['lastapplication']='';this[_0x8df2('0xe')]='';this[_0x8df2('0xf')]=0x0;this[_0x8df2('0x10')]=0x0;this[_0x8df2('0x11')]=0x0;this[_0x8df2('0x12')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x8df2('0x13')]=null;this[_0x8df2('0x14')]=null;this['monitors']=[];this[_0x8df2('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x8df2('0x16')]=undefined;this[_0x8df2('0x17')]=0x0;}module[_0x8df2('0x18')]=Channel; \ No newline at end of file +var _0x8a5c=['mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','transfercalleridnum','transferType'];(function(_0x48783c,_0x1f986b){var _0x2ce586=function(_0x38e1bd){while(--_0x38e1bd){_0x48783c['push'](_0x48783c['shift']());}};_0x2ce586(++_0x1f986b);}(_0x8a5c,0x136));var _0xc8a5=function(_0x90df50,_0x5110bb){_0x90df50=_0x90df50-0x0;var _0x10aa2b=_0x8a5c[_0x90df50];return _0x10aa2b;};'use strict';function Channel(){this[_0xc8a5('0x0')]=null;this[_0xc8a5('0x1')]='';this[_0xc8a5('0x2')]='';this[_0xc8a5('0x3')]=0x0;this[_0xc8a5('0x4')]='';this[_0xc8a5('0x5')]=undefined;this[_0xc8a5('0x6')]=undefined;this[_0xc8a5('0x7')]=0x0;this[_0xc8a5('0x8')]='';this['uniqueid']=0x0;this[_0xc8a5('0x9')]=0x0;this[_0xc8a5('0xa')]=0x0;this['answered']=![];this[_0xc8a5('0xb')]=null;this[_0xc8a5('0xc')]=null;this[_0xc8a5('0xd')]=![];this[_0xc8a5('0xe')]=![];this['lastapplication']='';this[_0xc8a5('0xf')]='';this[_0xc8a5('0x10')]=0x0;this[_0xc8a5('0x11')]=0x0;this[_0xc8a5('0x12')]=0x0;this[_0xc8a5('0x13')]=null;this[_0xc8a5('0x14')]=null;this[_0xc8a5('0x15')]=null;this[_0xc8a5('0x16')]=![];this[_0xc8a5('0x17')]=null;this['queue']=null;this['monitors']=[];this[_0xc8a5('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xc8a5('0x19')]=undefined;this[_0xc8a5('0x1a')]=0x0;}module[_0xc8a5('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d7eb2bd..fc708d6 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 _0xd25f=['consumerSecret','token','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x64bbb9,_0x909c76){var _0x5c3707=function(_0x26ded5){while(--_0x26ded5){_0x64bbb9['push'](_0x64bbb9['shift']());}};_0x5c3707(++_0x909c76);}(_0xd25f,0x162));var _0xfd25=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xd25f[_0x1bc013];return _0x55df36;};'use strict';function DeskAccount(_0x4edaaf){this['id']=_0x4edaaf['id']||0x0;this[_0xfd25('0x0')]=_0x4edaaf[_0xfd25('0x0')]||'';this['username']=_0x4edaaf[_0xfd25('0x1')]||'';this[_0xfd25('0x2')]=_0x4edaaf[_0xfd25('0x2')]||'';this['authType']=_0x4edaaf[_0xfd25('0x3')]||'';this[_0xfd25('0x4')]=_0x4edaaf[_0xfd25('0x4')]||'';this[_0xfd25('0x5')]=_0x4edaaf[_0xfd25('0x5')]||'';this[_0xfd25('0x6')]=_0x4edaaf[_0xfd25('0x6')]||'';this[_0xfd25('0x7')]=_0x4edaaf[_0xfd25('0x7')]||'';this['tokenSecret']=_0x4edaaf['tokenSecret']||'';this[_0xfd25('0x8')]=_0x4edaaf[_0xfd25('0x8')]||'';this[_0xfd25('0x9')]=_0x4edaaf[_0xfd25('0x9')]||'';this[_0xfd25('0xa')]=_0x4edaaf['Configurations']||{};}module[_0xfd25('0xb')]=DeskAccount; \ No newline at end of file +var _0x45e1=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x392ec2,_0x4e9f85){var _0x16e517=function(_0x379e8b){while(--_0x379e8b){_0x392ec2['push'](_0x392ec2['shift']());}};_0x16e517(++_0x4e9f85);}(_0x45e1,0x188));var _0x145e=function(_0x21f074,_0x3c7959){_0x21f074=_0x21f074-0x0;var _0x1521b1=_0x45e1[_0x21f074];return _0x1521b1;};'use strict';function DeskAccount(_0x2eb562){this['id']=_0x2eb562['id']||0x0;this[_0x145e('0x0')]=_0x2eb562[_0x145e('0x0')]||'';this['username']=_0x2eb562[_0x145e('0x1')]||'';this[_0x145e('0x2')]=_0x2eb562[_0x145e('0x2')]||'';this[_0x145e('0x3')]=_0x2eb562[_0x145e('0x3')]||'';this[_0x145e('0x4')]=_0x2eb562[_0x145e('0x4')]||'';this['consumerKey']=_0x2eb562[_0x145e('0x5')]||'';this[_0x145e('0x6')]=_0x2eb562[_0x145e('0x6')]||'';this[_0x145e('0x7')]=_0x2eb562[_0x145e('0x7')]||'';this[_0x145e('0x8')]=_0x2eb562[_0x145e('0x8')]||'';this['type']=_0x2eb562[_0x145e('0x9')]||'';this[_0x145e('0xa')]=_0x2eb562['serverUrl']||'';this[_0x145e('0xb')]=_0x2eb562[_0x145e('0xb')]||{};}module[_0x145e('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index df74079..5d863dd 100644 --- a/server/services/ami/model/dynamics365Account.js +++ b/server/services/ami/model/dynamics365Account.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['clientId','serverUrl','Configurations','exports','name','password','remoteUri','tenantId'];(function(_0x543167,_0x1b53bf){var _0x527731=function(_0x3e3d28){while(--_0x3e3d28){_0x543167['push'](_0x543167['shift']());}};_0x527731(++_0x1b53bf);}(_0xda3f,0xec));var _0xfda3=function(_0x2caa44,_0x5776ed){_0x2caa44=_0x2caa44-0x0;var _0x77d435=_0xda3f[_0x2caa44];return _0x77d435;};'use strict';function Dynamics365Account(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['username']=_0x33f0ce['username']||'';this['password']=_0x33f0ce[_0xfda3('0x1')]||'';this['remoteUri']=_0x33f0ce[_0xfda3('0x2')]||'';this[_0xfda3('0x3')]=_0x33f0ce['tenantId']||'';this[_0xfda3('0x4')]=_0x33f0ce[_0xfda3('0x4')]||'';this['clientSecret']=_0x33f0ce['clientSecret']||{};this[_0xfda3('0x5')]=_0x33f0ce[_0xfda3('0x5')]||'';this[_0xfda3('0x6')]=_0x33f0ce[_0xfda3('0x6')]||{};}module[_0xfda3('0x7')]=Dynamics365Account; \ No newline at end of file +var _0x9348=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x9348,0x10d));var _0x8934=function(_0x47f0bb,_0x1d431c){_0x47f0bb=_0x47f0bb-0x0;var _0x32019f=_0x9348[_0x47f0bb];return _0x32019f;};'use strict';function Dynamics365Account(_0x41a189){this['id']=_0x41a189['id']||0x0;this[_0x8934('0x0')]=_0x41a189[_0x8934('0x0')]||'';this[_0x8934('0x1')]=_0x41a189[_0x8934('0x1')]||'';this['password']=_0x41a189[_0x8934('0x2')]||'';this[_0x8934('0x3')]=_0x41a189['remoteUri']||'';this[_0x8934('0x4')]=_0x41a189[_0x8934('0x4')]||'';this[_0x8934('0x5')]=_0x41a189[_0x8934('0x5')]||'';this[_0x8934('0x6')]=_0x41a189[_0x8934('0x6')]||{};this['serverUrl']=_0x41a189[_0x8934('0x7')]||'';this[_0x8934('0x8')]=_0x41a189[_0x8934('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 86c8fb5..6920036 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 _0x7d65=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x2f4a8c,_0x178a48){var _0x370ae6=function(_0x3b042c){while(--_0x3b042c){_0x2f4a8c['push'](_0x2f4a8c['shift']());}};_0x370ae6(++_0x178a48);}(_0x7d65,0xb3));var _0x57d6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7d65[_0x2dafbe];return _0x58a45a;};'use strict';function FaxAccount(_0x40f946){this['id']=_0x40f946['id']||0x0;this[_0x57d6('0x0')]=_0x40f946[_0x57d6('0x0')]||'';this[_0x57d6('0x1')]=_0x40f946[_0x57d6('0x1')];this[_0x57d6('0x2')]=_0x40f946[_0x57d6('0x2')];this[_0x57d6('0x3')]=_0x40f946[_0x57d6('0x3')];this[_0x57d6('0x4')]=_0x40f946[_0x57d6('0x4')];this[_0x57d6('0x5')]=_0x40f946['minrate']||0x960;this['maxrate']=_0x40f946[_0x57d6('0x6')]||0x3840;this[_0x57d6('0x7')]=_0x40f946[_0x57d6('0x7')]||_0x57d6('0x8');this['gateway']=_0x40f946[_0x57d6('0x9')]||'no';this[_0x57d6('0xa')]=_0x40f946[_0x57d6('0xa')]||'no';this[_0x57d6('0xb')]=_0x40f946[_0x57d6('0xb')]||0x1388;this[_0x57d6('0xc')]=_0x40f946[_0x57d6('0xc')]||_0x57d6('0xd');this[_0x57d6('0xe')]=_0x40f946[_0x57d6('0xe')]?_0x40f946['Trunk']:undefined;this[_0x57d6('0xf')]=_0x40f946[_0x57d6('0xf')];this[_0x57d6('0x10')]=_0x40f946[_0x57d6('0x10')];}module[_0x57d6('0x11')]=FaxAccount; \ No newline at end of file +var _0xbb22=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb22,0x166));var _0x2bb2=function(_0x47d986,_0x461405){_0x47d986=_0x47d986-0x0;var _0x54fe45=_0xbb22[_0x47d986];return _0x54fe45;};'use strict';function FaxAccount(_0x33600c){this['id']=_0x33600c['id']||0x0;this[_0x2bb2('0x0')]=_0x33600c[_0x2bb2('0x0')]||'';this[_0x2bb2('0x1')]=_0x33600c[_0x2bb2('0x1')];this[_0x2bb2('0x2')]=_0x33600c[_0x2bb2('0x2')];this[_0x2bb2('0x3')]=_0x33600c[_0x2bb2('0x3')];this[_0x2bb2('0x4')]=_0x33600c[_0x2bb2('0x4')];this[_0x2bb2('0x5')]=_0x33600c[_0x2bb2('0x5')]||0x960;this[_0x2bb2('0x6')]=_0x33600c[_0x2bb2('0x6')]||0x3840;this[_0x2bb2('0x7')]=_0x33600c[_0x2bb2('0x7')]||_0x2bb2('0x8');this[_0x2bb2('0x9')]=_0x33600c[_0x2bb2('0x9')]||'no';this['faxdetect']=_0x33600c[_0x2bb2('0xa')]||'no';this[_0x2bb2('0xb')]=_0x33600c['t38timeout']||0x1388;this[_0x2bb2('0xc')]=_0x33600c['tech']||_0x2bb2('0xd');this['Trunk']=_0x33600c[_0x2bb2('0xe')]?_0x33600c[_0x2bb2('0xe')]:undefined;this[_0x2bb2('0xf')]=_0x33600c[_0x2bb2('0xf')];this[_0x2bb2('0x10')]=_0x33600c[_0x2bb2('0x10')];}module[_0x2bb2('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 783fc33..4472648 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 _0xa137=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x54e46c,_0x3707e1){var _0x193c09=function(_0x5206f2){while(--_0x5206f2){_0x54e46c['push'](_0x54e46c['shift']());}};_0x193c09(++_0x3707e1);}(_0xa137,0x177));var _0x7a13=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa137[_0x3e5086];return _0xfeb102;};'use strict';function FreshdeskAccount(_0x6a34bb){this['id']=_0x6a34bb['id']||0x0;this[_0x7a13('0x0')]=_0x6a34bb[_0x7a13('0x0')]||'';this['username']=_0x6a34bb[_0x7a13('0x1')]||'';this[_0x7a13('0x2')]=_0x6a34bb[_0x7a13('0x3')]||'';this[_0x7a13('0x4')]=_0x6a34bb['remoteUri']||'';this[_0x7a13('0x5')]=_0x6a34bb['serverUrl']||'';this[_0x7a13('0x6')]=_0x6a34bb[_0x7a13('0x6')]||{};}module[_0x7a13('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x519c=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x519c,0xf6));var _0xc519=function(_0x13910a,_0xbfcaab){_0x13910a=_0x13910a-0x0;var _0x2815bb=_0x519c[_0x13910a];return _0x2815bb;};'use strict';function FreshdeskAccount(_0x2a47d0){this['id']=_0x2a47d0['id']||0x0;this['name']=_0x2a47d0[_0xc519('0x0')]||'';this[_0xc519('0x1')]=_0x2a47d0['username']||'';this[_0xc519('0x2')]=_0x2a47d0[_0xc519('0x3')]||'';this[_0xc519('0x4')]=_0x2a47d0[_0xc519('0x4')]||'';this[_0xc519('0x5')]=_0x2a47d0[_0xc519('0x5')]||'';this[_0xc519('0x6')]=_0x2a47d0[_0xc519('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index e439def..e8eb5b1 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 _0x0f80=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4efe30,_0x10d4c3){var _0x154f4e=function(_0xd12157){while(--_0xd12157){_0x4efe30['push'](_0x4efe30['shift']());}};_0x154f4e(++_0x10d4c3);}(_0x0f80,0x108));var _0x00f8=function(_0x52c4ae,_0x596203){_0x52c4ae=_0x52c4ae-0x0;var _0x54571d=_0x0f80[_0x52c4ae];return _0x54571d;};'use strict';function FreshsalesAccount(_0x2aaa24){this['id']=_0x2aaa24['id']||0x0;this[_0x00f8('0x0')]=_0x2aaa24[_0x00f8('0x0')]||'';this[_0x00f8('0x1')]=_0x2aaa24[_0x00f8('0x1')]||'';this[_0x00f8('0x2')]=_0x2aaa24['token']||'';this[_0x00f8('0x3')]=_0x2aaa24[_0x00f8('0x3')]||'';this[_0x00f8('0x4')]=_0x2aaa24['serverUrl']||'';this[_0x00f8('0x5')]=_0x2aaa24[_0x00f8('0x5')]||{};}module[_0x00f8('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x24ce=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5dac05,_0x3e58d1){var _0x341fc1=function(_0x2d168e){while(--_0x2d168e){_0x5dac05['push'](_0x5dac05['shift']());}};_0x341fc1(++_0x3e58d1);}(_0x24ce,0x1de));var _0xe24c=function(_0x23dbc8,_0x3949a3){_0x23dbc8=_0x23dbc8-0x0;var _0x3dd3f8=_0x24ce[_0x23dbc8];return _0x3dd3f8;};'use strict';function FreshsalesAccount(_0x1ba72f){this['id']=_0x1ba72f['id']||0x0;this[_0xe24c('0x0')]=_0x1ba72f[_0xe24c('0x0')]||'';this[_0xe24c('0x1')]=_0x1ba72f[_0xe24c('0x1')]||'';this['apiKey']=_0x1ba72f['token']||'';this[_0xe24c('0x2')]=_0x1ba72f['remoteUri']||'';this['serverUrl']=_0x1ba72f[_0xe24c('0x3')]||'';this[_0xe24c('0x4')]=_0x1ba72f[_0xe24c('0x4')]||{};}module[_0xe24c('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 62b0773..7f0908f 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 _0x221e=['priority','holdtime','motionChannel','voice','mohtime','variables','inbound','uniqueid','calleridnum','calleridname','queuecallerleaveAt','position','count','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten'];(function(_0x4bea2a,_0x1638c5){var _0x152ad2=function(_0x25c627){while(--_0x25c627){_0x4bea2a['push'](_0x4bea2a['shift']());}};_0x152ad2(++_0x1638c5);}(_0x221e,0x166));var _0xe221=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x221e[_0x39096d];return _0x13da4f;};'use strict';function QueueReport(){this['type']=_0xe221('0x0');this[_0xe221('0x1')]='';this[_0xe221('0x2')]='';this[_0xe221('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0xe221('0x4')]=null;this[_0xe221('0x5')]=0x1;this[_0xe221('0x6')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xe221('0x7')]=![];this['queuecallercompleteAt']=null;this[_0xe221('0x8')]=![];this[_0xe221('0x9')]=null;this[_0xe221('0xa')]=0x1;this[_0xe221('0xb')]='';this[_0xe221('0xc')]='';this[_0xe221('0xd')]='';this[_0xe221('0xe')]='';this['context']='';this[_0xe221('0xf')]='';this[_0xe221('0x10')]='';this[_0xe221('0x11')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xe221('0x12')]=_0xe221('0x13');this[_0xe221('0x14')]=0x0;this[_0xe221('0x15')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x963a=['connectedlinename','context','exten','holdtime','lastAssignedTo','motionChannel','voice','variables','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0x90740d,_0xf25227){var _0x5cb962=function(_0x41b805){while(--_0x41b805){_0x90740d['push'](_0x90740d['shift']());}};_0x5cb962(++_0xf25227);}(_0x963a,0x1b1));var _0xa963=function(_0x1f2062,_0x52e086){_0x1f2062=_0x1f2062-0x0;var _0x97405f=_0x963a[_0x1f2062];return _0x97405f;};'use strict';function QueueReport(){this[_0xa963('0x0')]=_0xa963('0x1');this[_0xa963('0x2')]='';this['calleridnum']='';this[_0xa963('0x3')]='';this[_0xa963('0x4')]='';this[_0xa963('0x5')]=null;this[_0xa963('0x6')]=null;this[_0xa963('0x7')]=0x1;this[_0xa963('0x8')]=0x1;this['queuecallerabandon']=![];this[_0xa963('0x9')]=null;this[_0xa963('0xa')]=![];this[_0xa963('0xb')]=null;this[_0xa963('0xc')]=![];this[_0xa963('0xd')]=null;this[_0xa963('0xe')]=0x1;this[_0xa963('0xf')]='';this[_0xa963('0x10')]='';this[_0xa963('0x11')]='';this['accountcode']='';this[_0xa963('0x12')]='';this[_0xa963('0x13')]='';this['priority']='';this[_0xa963('0x14')]=0x0;this['assigned']=![];this[_0xa963('0x15')]='';this[_0xa963('0x16')]=_0xa963('0x17');this['mohtime']=0x0;this[_0xa963('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 3832050..f988a3b 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 _0x1544=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','username','remoteUri','password','clientId'];(function(_0x11d7f6,_0x2aaf46){var _0x5732bd=function(_0x5bc6db){while(--_0x5bc6db){_0x11d7f6['push'](_0x11d7f6['shift']());}};_0x5732bd(++_0x2aaf46);}(_0x1544,0x6a));var _0x4154=function(_0x45fb8f,_0x46da98){_0x45fb8f=_0x45fb8f-0x0;var _0x3d906b=_0x1544[_0x45fb8f];return _0x3d906b;};'use strict';function SalesforceAccount(_0x1a2af2){this['id']=_0x1a2af2['id']||0x0;this['name']=_0x1a2af2['name']||'';this[_0x4154('0x0')]=_0x1a2af2[_0x4154('0x0')]||'';this[_0x4154('0x1')]=_0x1a2af2[_0x4154('0x1')]||'';this[_0x4154('0x2')]=_0x1a2af2[_0x4154('0x2')]||'';this[_0x4154('0x3')]=_0x1a2af2['clientId']||'';this[_0x4154('0x4')]=_0x1a2af2[_0x4154('0x4')]||'';this[_0x4154('0x5')]=_0x1a2af2['securityToken']||'';this[_0x4154('0x6')]=_0x1a2af2[_0x4154('0x6')]||_0x4154('0x7');this['serverUrl']=_0x1a2af2[_0x4154('0x8')]||'';this[_0x4154('0x9')]=_0x1a2af2['Configurations']||{};}module[_0x4154('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x6cd4=['serverUrl','Configurations','name','username','remoteUri','password','clientId','securityToken','type','integrationTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cd4,0x1d8));var _0x46cd=function(_0x292b1e,_0x10e9d5){_0x292b1e=_0x292b1e-0x0;var _0x116b08=_0x6cd4[_0x292b1e];return _0x116b08;};'use strict';function SalesforceAccount(_0x55835f){this['id']=_0x55835f['id']||0x0;this[_0x46cd('0x0')]=_0x55835f[_0x46cd('0x0')]||'';this[_0x46cd('0x1')]=_0x55835f[_0x46cd('0x1')]||'';this[_0x46cd('0x2')]=_0x55835f[_0x46cd('0x2')]||'';this[_0x46cd('0x3')]=_0x55835f[_0x46cd('0x3')]||'';this[_0x46cd('0x4')]=_0x55835f['clientId']||'';this['clientSecret']=_0x55835f['clientSecret']||'';this[_0x46cd('0x5')]=_0x55835f[_0x46cd('0x5')]||'';this[_0x46cd('0x6')]=_0x55835f[_0x46cd('0x6')]||_0x46cd('0x7');this[_0x46cd('0x8')]=_0x55835f['serverUrl']||'';this[_0x46cd('0x9')]=_0x55835f['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a3696d3..60fca6b 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 _0x4b2d=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x4b2d,0x13d));var _0xd4b2=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0x4b2d[_0x37e886];return _0x57c5cd;};'use strict';function ServicenowAccount(_0x44819f){this['id']=_0x44819f['id']||0x0;this['name']=_0x44819f[_0xd4b2('0x0')]||'';this[_0xd4b2('0x1')]=_0x44819f['username']||'';this[_0xd4b2('0x2')]=_0x44819f[_0xd4b2('0x2')]||'';this['remoteUri']=_0x44819f[_0xd4b2('0x3')]||'';this[_0xd4b2('0x4')]=_0x44819f[_0xd4b2('0x4')]||'';this[_0xd4b2('0x5')]=_0x44819f[_0xd4b2('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xf468=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x23bea4,_0x38a38){var _0xb54789=function(_0x2a5608){while(--_0x2a5608){_0x23bea4['push'](_0x23bea4['shift']());}};_0xb54789(++_0x38a38);}(_0xf468,0x191));var _0x8f46=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xf468[_0x47e7cb];return _0x2a8874;};'use strict';function ServicenowAccount(_0x38496d){this['id']=_0x38496d['id']||0x0;this[_0x8f46('0x0')]=_0x38496d[_0x8f46('0x0')]||'';this[_0x8f46('0x1')]=_0x38496d[_0x8f46('0x1')]||'';this[_0x8f46('0x2')]=_0x38496d[_0x8f46('0x2')]||'';this[_0x8f46('0x3')]=_0x38496d[_0x8f46('0x3')]||'';this[_0x8f46('0x4')]=_0x38496d['serverUrl']||'';this[_0x8f46('0x5')]=_0x38496d[_0x8f46('0x5')]||{};}module[_0x8f46('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 3774750..3937305 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 _0xc2b0=['Configurations','username','password','remoteUri','serverUrl'];(function(_0x4268d1,_0x5e1221){var _0x452963=function(_0x76b76f){while(--_0x76b76f){_0x4268d1['push'](_0x4268d1['shift']());}};_0x452963(++_0x5e1221);}(_0xc2b0,0x13c));var _0x0c2b=function(_0x261b08,_0x563d91){_0x261b08=_0x261b08-0x0;var _0xeeaf84=_0xc2b0[_0x261b08];return _0xeeaf84;};'use strict';function SugarcrmAccount(_0x2c57e2){this['id']=_0x2c57e2['id']||0x0;this['name']=_0x2c57e2['name']||'';this[_0x0c2b('0x0')]=_0x2c57e2[_0x0c2b('0x0')]||'';this['password']=_0x2c57e2[_0x0c2b('0x1')]||'';this[_0x0c2b('0x2')]=_0x2c57e2[_0x0c2b('0x2')]||'';this[_0x0c2b('0x3')]=_0x2c57e2[_0x0c2b('0x3')]||'';this['Configurations']=_0x2c57e2[_0x0c2b('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xde72=['name','username','password','remoteUri'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xde72,0x1a4));var _0x2de7=function(_0x33e290,_0x21085c){_0x33e290=_0x33e290-0x0;var _0x371e69=_0xde72[_0x33e290];return _0x371e69;};'use strict';function SugarcrmAccount(_0x24de05){this['id']=_0x24de05['id']||0x0;this[_0x2de7('0x0')]=_0x24de05[_0x2de7('0x0')]||'';this[_0x2de7('0x1')]=_0x24de05[_0x2de7('0x1')]||'';this[_0x2de7('0x2')]=_0x24de05[_0x2de7('0x2')]||'';this[_0x2de7('0x3')]=_0x24de05[_0x2de7('0x3')]||'';this['serverUrl']=_0x24de05['serverUrl']||'';this['Configurations']=_0x24de05['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index c0b5a88..79a7d95 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 _0x6827=['address','exports','name','accountcode','unknown','stateTime'];(function(_0xf5ed1b,_0x33a489){var _0x5ecbdb=function(_0x152c8e){while(--_0x152c8e){_0xf5ed1b['push'](_0xf5ed1b['shift']());}};_0x5ecbdb(++_0x33a489);}(_0x6827,0xda));var _0x7682=function(_0xbacb69,_0x447ae3){_0xbacb69=_0xbacb69-0x0;var _0x2876a8=_0x6827[_0xbacb69];return _0x2876a8;};'use strict';function Telephone(_0x400276){this['id']=_0x400276['id']||0x0;this[_0x7682('0x0')]=_0x400276[_0x7682('0x0')]||'';this[_0x7682('0x1')]=_0x400276[_0x7682('0x1')]||'';this['state']=_0x7682('0x2');this[_0x7682('0x3')]=0x0;this['status']=_0x7682('0x2');this[_0x7682('0x4')]='';}module[_0x7682('0x5')]=Telephone; \ No newline at end of file +var _0x09dd=['address','name','accountcode','state','unknown','stateTime','status'];(function(_0x426ab4,_0x3aa799){var _0x290c07=function(_0x41ffe4){while(--_0x41ffe4){_0x426ab4['push'](_0x426ab4['shift']());}};_0x290c07(++_0x3aa799);}(_0x09dd,0xb7));var _0xd09d=function(_0x44cad0,_0x229ce2){_0x44cad0=_0x44cad0-0x0;var _0x360e6f=_0x09dd[_0x44cad0];return _0x360e6f;};'use strict';function Telephone(_0x5de53a){this['id']=_0x5de53a['id']||0x0;this[_0xd09d('0x0')]=_0x5de53a[_0xd09d('0x0')]||'';this[_0xd09d('0x1')]=_0x5de53a[_0xd09d('0x1')]||'';this[_0xd09d('0x2')]=_0xd09d('0x3');this[_0xd09d('0x4')]=0x0;this[_0xd09d('0x5')]='unknown';this[_0xd09d('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 5afd1b6..3110d52 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(_0x1a55be,_0x7839d9){var _0xcf466b=function(_0x36cc4b){while(--_0x36cc4b){_0x1a55be['push'](_0x1a55be['shift']());}};_0xcf466b(++_0x7839d9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d86f4,_0x2a9220){_0x3d86f4=_0x3d86f4-0x0;var _0x5d8e87=_0xb10b[_0x3d86f4];return _0x5d8e87;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x5b91a8,_0x4b1e91){var _0x341a51=function(_0x5b2d02){while(--_0x5b2d02){_0x5b91a8['push'](_0x5b91a8['shift']());}};_0x341a51(++_0x4b1e91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e4a27f1..2698265 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x594f77,_0x15659a){var _0x2c62cc=function(_0x4eb060){while(--_0x4eb060){_0x594f77['push'](_0x594f77['shift']());}};_0x2c62cc(++_0x15659a);}(_0x4fc2,0x111));var _0x24fc=function(_0x380d90,_0x4f711d){_0x380d90=_0x380d90-0x0;var _0x1ff262=_0x4fc2[_0x380d90];return _0x1ff262;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x4d9e58,_0x41a4a8){var _0x5782f4=function(_0x4ef867){while(--_0x4ef867){_0x4d9e58['push'](_0x4d9e58['shift']());}};_0x5782f4(++_0x41a4a8);}(_0x14a0,0x8e));var _0x014a=function(_0x3c67d4,_0x25e777){_0x3c67d4=_0x3c67d4-0x0;var _0xf8966c=_0x14a0[_0x3c67d4];return _0xf8966c;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}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 7d45694..deb1603 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 _0x08cd=['exports','active','name','unknown','status','registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser'];(function(_0x1b4722,_0x2e6118){var _0x48fa16=function(_0x447a61){while(--_0x447a61){_0x1b4722['push'](_0x1b4722['shift']());}};_0x48fa16(++_0x2e6118);}(_0x08cd,0x81));var _0xd08c=function(_0xbb5c78,_0x52a47a){_0xbb5c78=_0xbb5c78-0x0;var _0x3cb12d=_0x08cd[_0xbb5c78];return _0x3cb12d;};'use strict';function Trunk(_0x737cab){this['id']=_0x737cab['id']||0x0;this[_0xd08c('0x0')]=_0x737cab['active']||![];this[_0xd08c('0x1')]=_0x737cab['name']||'';this['state']=_0xd08c('0x2');this['stateTime']=0x0;this[_0xd08c('0x3')]='unknown';this['registry']=_0x737cab[_0xd08c('0x4')]&&_0x737cab[_0xd08c('0x4')][_0xd08c('0x5')](':')?_0x737cab['registry'][_0xd08c('0x6')](':')[0x0]:'';this[_0xd08c('0x7')]='';this[_0xd08c('0x8')]='';this[_0xd08c('0x9')]='';this[_0xd08c('0xa')]='';this['refresh']='';this[_0xd08c('0xb')]='unknown';this[_0xd08c('0xc')]='';this[_0xd08c('0xd')]='';this[_0xd08c('0xe')]=_0x737cab[_0xd08c('0xe')]||'';}module[_0xd08c('0xf')]=Trunk; \ No newline at end of file +var _0x793b=['stateRegistry','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport'];(function(_0x45ee80,_0x556689){var _0x350e98=function(_0x96e156){while(--_0x96e156){_0x45ee80['push'](_0x45ee80['shift']());}};_0x350e98(++_0x556689);}(_0x793b,0x1b4));var _0xb793=function(_0x53122a,_0x4ace15){_0x53122a=_0x53122a-0x0;var _0x73686=_0x793b[_0x53122a];return _0x73686;};'use strict';function Trunk(_0x3348b9){this['id']=_0x3348b9['id']||0x0;this[_0xb793('0x0')]=_0x3348b9[_0xb793('0x0')]||![];this[_0xb793('0x1')]=_0x3348b9[_0xb793('0x1')]||'';this['state']=_0xb793('0x2');this[_0xb793('0x3')]=0x0;this[_0xb793('0x4')]=_0xb793('0x2');this[_0xb793('0x5')]=_0x3348b9['registry']&&_0x3348b9[_0xb793('0x5')][_0xb793('0x6')](':')?_0x3348b9['registry'][_0xb793('0x7')](':')[0x0]:'';this[_0xb793('0x8')]='';this[_0xb793('0x9')]='';this[_0xb793('0xa')]='';this[_0xb793('0xb')]='';this['refresh']='';this[_0xb793('0xc')]=_0xb793('0x2');this['registrationtime']='';this[_0xb793('0xd')]='';this[_0xb793('0xe')]=_0x3348b9['defaultuser']||'';}module[_0xb793('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 57c803a..15fb6ae 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 _0x0df8=['mandatoryDisposition','exports','exten'];(function(_0x16c87e,_0x5eed1a){var _0xdfafec=function(_0x5302b7){while(--_0x5302b7){_0x16c87e['push'](_0x16c87e['shift']());}};_0xdfafec(++_0x5eed1a);}(_0x0df8,0x1df));var _0x80df=function(_0x42ed93,_0x448249){_0x42ed93=_0x42ed93-0x0;var _0x12c2b9=_0x0df8[_0x42ed93];return _0x12c2b9;};'use strict';function voiceExtension(_0x26205a){this['id']=_0x26205a['id']||0x0;this['exten']=_0x26205a[_0x80df('0x0')]||'';this['recordingFormat']=_0x26205a['recordingFormat']||'none';this[_0x80df('0x1')]=_0x26205a[_0x80df('0x1')]||![];}module[_0x80df('0x2')]=voiceExtension; \ No newline at end of file +var _0x66e7=['exports','exten','mandatoryDisposition'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x66e7,0xaf));var _0x766e=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x66e7[_0xe45118];return _0x15e15d;};'use strict';function voiceExtension(_0xf93b7f){this['id']=_0xf93b7f['id']||0x0;this[_0x766e('0x0')]=_0xf93b7f[_0x766e('0x0')]||'';this['recordingFormat']=_0xf93b7f['recordingFormat']||'none';this[_0x766e('0x1')]=_0xf93b7f[_0x766e('0x1')]||![];}module[_0x766e('0x2')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 9b5f5d1..7d362c1 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 _0x150a=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','wav','wav49','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x4e6175,_0x5c608f){var _0x1143e8=function(_0x31e59d){while(--_0x31e59d){_0x4e6175['push'](_0x4e6175['shift']());}};_0x1143e8(++_0x5c608f);}(_0x150a,0x1a7));var _0xa150=function(_0x5e84ee,_0x9645a6){_0x5e84ee=_0x5e84ee-0x0;var _0xa2b329=_0x150a[_0x5e84ee];return _0xa2b329;};'use strict';var statusDesc=[_0xa150('0x0'),_0xa150('0x1'),_0xa150('0x2'),'busy',_0xa150('0x3'),_0xa150('0x4'),_0xa150('0x5'),_0xa150('0x6'),'onhold'];var monitorFormat={'wav':_0xa150('0x7'),'wav49':_0xa150('0x8'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xa150('0x9')};function VoiceQueue(_0x263d27){this['id']=_0x263d27['id']||0x0;this[_0xa150('0xa')]=_0x263d27[_0xa150('0xa')]||'';this[_0xa150('0xb')]=_0x263d27['monitor_format']||'';this[_0xa150('0xc')]=_0x263d27[_0xa150('0xc')]||_0xa150('0xd');this[_0xa150('0xe')]=0x0;this[_0xa150('0xf')]=0x0;this[_0xa150('0x10')]=0x0;this[_0xa150('0x11')]=0x0;this[_0xa150('0x12')]=0x0;this['sumHoldTime']=0x0;this[_0xa150('0x13')]=0x0;this['unmanaged']=0x0;this[_0xa150('0x14')]=0x0;this[_0xa150('0x15')]=0x0;this[_0xa150('0x16')]=0x0;this[_0xa150('0x17')]=_0x263d27[_0xa150('0x17')]||![];this['acwTimeout']=_0x263d27[_0xa150('0x18')]||0xa;this['autopause']=_0x263d27['autopause']||'no';this[_0xa150('0x19')]=!![];this[_0xa150('0x1a')]='';this[_0xa150('0x1b')]=0x0;this[_0xa150('0x1c')]=0x0;this[_0xa150('0x1d')]=_0x263d27[_0xa150('0x1d')]||null;this[_0xa150('0x1e')]=_0x263d27['dialGlobalInterval']?_0x263d27['dialGlobalInterval']:null;this['dialActive']=_0x263d27['dialActive'];this[_0xa150('0x1f')]=_0x263d27[_0xa150('0x1f')]||_0xa150('0x20');this['dialLimitChannel']=_0x263d27[_0xa150('0x21')]||0x0;this['dialLimitQueue']=_0x263d27['dialLimitQueue']||0x0;this[_0xa150('0x22')]=_0x263d27['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x263d27[_0xa150('0x23')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x263d27['dialPredictiveOptimizationPercentage']||0.03;this[_0xa150('0x24')]=_0x263d27[_0xa150('0x24')]||0x258;this[_0xa150('0x25')]=_0x263d27[_0xa150('0x25')]||_0xa150('0x26');this[_0xa150('0x27')]=_0x263d27['dialOriginateCallerIdNumber']||_0xa150('0x26');this['dialOriginateTimeout']=_0x263d27[_0xa150('0x28')]||0x1e;this['dialQueueOptions']=_0x263d27[_0xa150('0x29')]||_0xa150('0x2a');this[_0xa150('0x2b')]=_0x263d27['dialQueueTimeout']||0x3;this[_0xa150('0x2c')]=_0x263d27[_0xa150('0x2c')]||undefined;this[_0xa150('0x2d')]=_0x263d27['dialCongestionMaxRetry']||0x3;this[_0xa150('0x2e')]=_0x263d27['dialCongestionRetryFrequency']||0x96;this[_0xa150('0x2f')]=_0x263d27[_0xa150('0x2f')]||0x3;this[_0xa150('0x30')]=_0x263d27[_0xa150('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x263d27[_0xa150('0x31')]||0x3;this[_0xa150('0x32')]=_0x263d27['dialNoAnswerRetryFrequency']||0x96;this[_0xa150('0x33')]=_0x263d27['dialNoSuchNumberMaxRetry']||0x3;this[_0xa150('0x34')]=_0x263d27['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x263d27[_0xa150('0x35')]||0x3;this[_0xa150('0x36')]=_0x263d27['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x263d27[_0xa150('0x37')]||0x3;this[_0xa150('0x38')]=_0x263d27[_0xa150('0x38')]||0x96;this['dialMachineMaxRetry']=_0x263d27['dialMachineMaxRetry']||0x3;this[_0xa150('0x39')]=_0x263d27['dialMachineRetryFrequency']||0x96;this[_0xa150('0x3a')]=_0x263d27[_0xa150('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x263d27[_0xa150('0x3b')]||0x96;this[_0xa150('0x3c')]=_0x263d27[_0xa150('0x3c')]||0x4;this[_0xa150('0x3d')]=_0x263d27[_0xa150('0x3d')]?_0x263d27[_0xa150('0x3d')]:undefined;this[_0xa150('0x3e')]=_0x263d27[_0xa150('0x3e')]?_0x263d27[_0xa150('0x3e')]:undefined;this[_0xa150('0x3f')]=_0x263d27['dialPrefix']||undefined;this[_0xa150('0x40')]=_0x263d27['Interval']?_0x263d27[_0xa150('0x40')]:undefined;this[_0xa150('0x41')]=_0x263d27['dialOrderByScheduledAt']||_0xa150('0x42');this['dialRandomLastDigitCallerIdNumber']=_0x263d27['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa150('0x43')]=_0x263d27[_0xa150('0x43')]||undefined;this[_0xa150('0x44')]=strategy[_0x263d27[_0xa150('0x44')]]||'rrmemory';this[_0xa150('0x45')]=!![];this[_0xa150('0x46')]=_0x263d27[_0xa150('0x46')]||![];this[_0xa150('0x47')]=_0x263d27[_0xa150('0x47')];this[_0xa150('0x48')]=_0x263d27[_0xa150('0x48')];this[_0xa150('0x49')]=_0x263d27[_0xa150('0x49')];this[_0xa150('0x4a')]=_0x263d27[_0xa150('0x4a')];this[_0xa150('0x4b')]=_0x263d27[_0xa150('0x4b')];this['dialAMDBetweenWordsSilence']=_0x263d27[_0xa150('0x4c')];this[_0xa150('0x4d')]=_0x263d27[_0xa150('0x4d')];this[_0xa150('0x4e')]=_0x263d27[_0xa150('0x4e')];this[_0xa150('0x4f')]=_0x263d27[_0xa150('0x4f')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x263d27[_0xa150('0x50')];this[_0xa150('0x51')]=0x0;this[_0xa150('0x52')]=0x0;this[_0xa150('0x53')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xa150('0x54')]=0x0;this[_0xa150('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xa150('0x56')]=0x0;this[_0xa150('0x57')]=0x0;this[_0xa150('0x58')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xa150('0x59')]=0x0;this['outboundReCallsDay']=0x0;this[_0xa150('0x5a')]=0x0;this['startProgressive']=undefined;this[_0xa150('0x5b')]=undefined;this[_0xa150('0x5c')]=undefined;this[_0xa150('0x5d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xa150('0x5e')]=0x0;this[_0xa150('0x5f')]=0x0;this[_0xa150('0x60')]=0x0;this[_0xa150('0x61')]=0x0;this[_0xa150('0x62')]=0x0;this[_0xa150('0x63')]=0x0;this[_0xa150('0x64')]=0x0;this[_0xa150('0x65')]=_0x263d27['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xa150('0x66')]=_0x263d27[_0xa150('0x67')]||0xa;this[_0xa150('0x68')]=0x0;this[_0xa150('0x69')]=0x0;this[_0xa150('0x6a')]=0x1;this[_0xa150('0x6b')]=0x0;this[_0xa150('0x6c')]=0x0;this[_0xa150('0x6d')]=0x0;this[_0xa150('0x6e')]=0x0;this[_0xa150('0x6f')]=_0x263d27['dialRecallMeTimeout']||0x1e;this[_0xa150('0x70')]=_0x263d27['dialRecallInQueue']||![];this[_0xa150('0x71')]=_0x263d27[_0xa150('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x263d27[_0xa150('0x72')]||![];this[_0xa150('0x73')]=_0x263d27[_0xa150('0x73')]||![];this[_0xa150('0xb')]=monitorFormat[_0x263d27[_0xa150('0xb')]]?monitorFormat[_0x263d27[_0xa150('0xb')]]:undefined;this[_0xa150('0x74')]=_0x263d27['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x263d27[_0xa150('0x75')]?_0x263d27[_0xa150('0x75')]:undefined;}module[_0xa150('0x76')]=VoiceQueue; \ No newline at end of file +var _0xa2d7=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','unmanaged','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting'];(function(_0x2b432f,_0x1525e2){var _0x27b15f=function(_0x3f8d49){while(--_0x3f8d49){_0x2b432f['push'](_0x2b432f['shift']());}};_0x27b15f(++_0x1525e2);}(_0xa2d7,0x195));var _0x7a2d=function(_0x2559ff,_0x262547){_0x2559ff=_0x2559ff-0x0;var _0x789425=_0xa2d7[_0x2559ff];return _0x789425;};'use strict';var statusDesc=[_0x7a2d('0x0'),'not_inuse',_0x7a2d('0x1'),'busy',_0x7a2d('0x2'),_0x7a2d('0x3'),_0x7a2d('0x4'),_0x7a2d('0x5'),_0x7a2d('0x6')];var monitorFormat={'wav':_0x7a2d('0x7'),'wav49':_0x7a2d('0x8'),'gsm':_0x7a2d('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x596358){this['id']=_0x596358['id']||0x0;this[_0x7a2d('0xa')]=_0x596358[_0x7a2d('0xa')]||'';this[_0x7a2d('0xb')]=_0x596358[_0x7a2d('0xb')]||'';this[_0x7a2d('0xc')]=_0x596358[_0x7a2d('0xc')]||_0x7a2d('0xd');this[_0x7a2d('0xe')]=0x0;this[_0x7a2d('0xf')]=0x0;this[_0x7a2d('0x10')]=0x0;this[_0x7a2d('0x11')]=0x0;this[_0x7a2d('0x12')]=0x0;this[_0x7a2d('0x13')]=0x0;this['sumBillable']=0x0;this[_0x7a2d('0x14')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x7a2d('0x15')]=_0x596358['acw']||![];this[_0x7a2d('0x16')]=_0x596358[_0x7a2d('0x16')]||0xa;this['autopause']=_0x596358[_0x7a2d('0x17')]||'no';this[_0x7a2d('0x18')]=!![];this[_0x7a2d('0x19')]='';this[_0x7a2d('0x1a')]=0x0;this[_0x7a2d('0x1b')]=0x0;this[_0x7a2d('0x1c')]=_0x596358['dialTimezone']||null;this['dialGlobalInterval']=_0x596358[_0x7a2d('0x1d')]?_0x596358['dialGlobalInterval']:null;this[_0x7a2d('0x1e')]=_0x596358[_0x7a2d('0x1e')];this[_0x7a2d('0x1f')]=_0x596358[_0x7a2d('0x1f')]||'progressive';this[_0x7a2d('0x20')]=_0x596358[_0x7a2d('0x20')]||0x0;this['dialLimitQueue']=_0x596358[_0x7a2d('0x21')]||0x0;this['dialPowerLevel']=_0x596358[_0x7a2d('0x22')]||0x1;this[_0x7a2d('0x23')]=_0x596358[_0x7a2d('0x23')]||_0x7a2d('0x24');this[_0x7a2d('0x25')]=_0x596358['dialPredictiveOptimizationPercentage']||0.03;this[_0x7a2d('0x26')]=_0x596358[_0x7a2d('0x26')]||0x258;this[_0x7a2d('0x27')]=_0x596358[_0x7a2d('0x27')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x596358[_0x7a2d('0x28')]||_0x7a2d('0x29');this['dialOriginateTimeout']=_0x596358[_0x7a2d('0x2a')]||0x1e;this['dialQueueOptions']=_0x596358[_0x7a2d('0x2b')]||_0x7a2d('0x2c');this['dialQueueTimeout']=_0x596358[_0x7a2d('0x2d')]||0x3;this[_0x7a2d('0x2e')]=_0x596358['dialQueueProject']||undefined;this[_0x7a2d('0x2f')]=_0x596358['dialCongestionMaxRetry']||0x3;this[_0x7a2d('0x30')]=_0x596358[_0x7a2d('0x30')]||0x96;this[_0x7a2d('0x31')]=_0x596358[_0x7a2d('0x31')]||0x3;this[_0x7a2d('0x32')]=_0x596358[_0x7a2d('0x32')]||0x96;this[_0x7a2d('0x33')]=_0x596358[_0x7a2d('0x33')]||0x3;this[_0x7a2d('0x34')]=_0x596358[_0x7a2d('0x34')]||0x96;this[_0x7a2d('0x35')]=_0x596358[_0x7a2d('0x35')]||0x3;this[_0x7a2d('0x36')]=_0x596358[_0x7a2d('0x36')]||0x96;this[_0x7a2d('0x37')]=_0x596358[_0x7a2d('0x37')]||0x3;this[_0x7a2d('0x38')]=_0x596358[_0x7a2d('0x38')]||0x96;this[_0x7a2d('0x39')]=_0x596358['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x596358[_0x7a2d('0x3a')]||0x96;this[_0x7a2d('0x3b')]=_0x596358[_0x7a2d('0x3b')]||0x3;this[_0x7a2d('0x3c')]=_0x596358[_0x7a2d('0x3c')]||0x96;this[_0x7a2d('0x3d')]=_0x596358['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x596358[_0x7a2d('0x3e')]||0x96;this['dialGlobalMaxRetry']=_0x596358[_0x7a2d('0x3f')]||0x4;this[_0x7a2d('0x40')]=_0x596358['Trunk']?_0x596358[_0x7a2d('0x40')]:undefined;this[_0x7a2d('0x41')]=_0x596358[_0x7a2d('0x41')]?_0x596358[_0x7a2d('0x41')]:undefined;this['dialPrefix']=_0x596358[_0x7a2d('0x42')]||undefined;this[_0x7a2d('0x43')]=_0x596358[_0x7a2d('0x43')]?_0x596358['Interval']:undefined;this[_0x7a2d('0x44')]=_0x596358['dialOrderByScheduledAt']||'DESC';this[_0x7a2d('0x45')]=_0x596358[_0x7a2d('0x45')]||undefined;this[_0x7a2d('0x46')]=_0x596358[_0x7a2d('0x46')]||undefined;this['strategy']=strategy[_0x596358[_0x7a2d('0x47')]]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x596358[_0x7a2d('0x48')]||![];this['dialAMDInitialSilence']=_0x596358[_0x7a2d('0x49')];this['dialAMDGreeting']=_0x596358[_0x7a2d('0x4a')];this[_0x7a2d('0x4b')]=_0x596358[_0x7a2d('0x4b')];this[_0x7a2d('0x4c')]=_0x596358[_0x7a2d('0x4c')];this[_0x7a2d('0x4d')]=_0x596358[_0x7a2d('0x4d')];this['dialAMDBetweenWordsSilence']=_0x596358[_0x7a2d('0x4e')];this['dialAMDMaximumNumberOfWords']=_0x596358[_0x7a2d('0x4f')];this[_0x7a2d('0x50')]=_0x596358[_0x7a2d('0x50')];this[_0x7a2d('0x51')]=_0x596358[_0x7a2d('0x51')];this[_0x7a2d('0x52')]=0x0;this[_0x7a2d('0x53')]=0x0;this[_0x7a2d('0x54')]=_0x596358[_0x7a2d('0x54')];this[_0x7a2d('0x55')]=0x0;this[_0x7a2d('0x56')]=0x0;this[_0x7a2d('0x57')]=0x0;this[_0x7a2d('0x58')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x7a2d('0x59')]=0x0;this[_0x7a2d('0x5a')]=0x0;this[_0x7a2d('0x5b')]=0x0;this[_0x7a2d('0x5c')]=0x0;this[_0x7a2d('0x5d')]=0x0;this[_0x7a2d('0x5e')]=0x0;this[_0x7a2d('0x5f')]=0x0;this[_0x7a2d('0x60')]=0x0;this[_0x7a2d('0x61')]=undefined;this['startPredictive']=undefined;this[_0x7a2d('0x62')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7a2d('0x63')]=0x0;this[_0x7a2d('0x64')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x7a2d('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x7a2d('0x66')]=0x0;this[_0x7a2d('0x67')]=0x0;this[_0x7a2d('0x68')]=_0x596358[_0x7a2d('0x69')]||0x14;this[_0x7a2d('0x6a')]=_0x596358[_0x7a2d('0x69')]||0xa;this[_0x7a2d('0x6b')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x7a2d('0x6c')]=0x1;this[_0x7a2d('0x6d')]=0x0;this['erlangCallToSecond']=0x0;this[_0x7a2d('0x6e')]=0x0;this[_0x7a2d('0x6f')]=0x0;this[_0x7a2d('0x70')]=_0x596358['dialRecallMeTimeout']||0x1e;this[_0x7a2d('0x71')]=_0x596358[_0x7a2d('0x71')]||![];this['dialQueueProject2']=_0x596358[_0x7a2d('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x596358[_0x7a2d('0x73')]||![];this['dialAgiAfterHangupAgent']=_0x596358[_0x7a2d('0x74')]||![];this[_0x7a2d('0xb')]=monitorFormat[_0x596358[_0x7a2d('0xb')]]?monitorFormat[_0x596358[_0x7a2d('0xb')]]:undefined;this[_0x7a2d('0x75')]=_0x596358[_0x7a2d('0x75')]||![];this[_0x7a2d('0x76')]=_0x596358[_0x7a2d('0x76')]?_0x596358[_0x7a2d('0x76')]:undefined;}module[_0x7a2d('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 4612e14..14dfa99 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 _0xa123=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x40bb62,_0x3fbe9e){var _0x3a3a54=function(_0x435d00){while(--_0x435d00){_0x40bb62['push'](_0x40bb62['shift']());}};_0x3a3a54(++_0x3fbe9e);}(_0xa123,0x1c2));var _0x3a12=function(_0x52404d,_0x4836fa){_0x52404d=_0x52404d-0x0;var _0x5c4a1b=_0xa123[_0x52404d];return _0x5c4a1b;};'use strict';function VtigerAccount(_0x2d5094){this['id']=_0x2d5094['id']||0x0;this[_0x3a12('0x0')]=_0x2d5094['name']||'';this[_0x3a12('0x1')]=_0x2d5094[_0x3a12('0x1')]||'';this['accessKey']=_0x2d5094[_0x3a12('0x2')]||'';this[_0x3a12('0x3')]=_0x2d5094[_0x3a12('0x3')]||'';this['serverUrl']=_0x2d5094[_0x3a12('0x4')]||'';this[_0x3a12('0x5')]=_0x2d5094['Configurations']||{};}module[_0x3a12('0x6')]=VtigerAccount; \ No newline at end of file +var _0xa7ba=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x31eb24,_0x45b8b9){var _0x155720=function(_0x472699){while(--_0x472699){_0x31eb24['push'](_0x31eb24['shift']());}};_0x155720(++_0x45b8b9);}(_0xa7ba,0xca));var _0xaa7b=function(_0x35c4a9,_0x3e7cde){_0x35c4a9=_0x35c4a9-0x0;var _0x1c66e=_0xa7ba[_0x35c4a9];return _0x1c66e;};'use strict';function VtigerAccount(_0x69796a){this['id']=_0x69796a['id']||0x0;this['name']=_0x69796a[_0xaa7b('0x0')]||'';this['username']=_0x69796a[_0xaa7b('0x1')]||'';this['accessKey']=_0x69796a[_0xaa7b('0x2')]||'';this['remoteUri']=_0x69796a[_0xaa7b('0x3')]||'';this['serverUrl']=_0x69796a[_0xaa7b('0x4')]||'';this[_0xaa7b('0x5')]=_0x69796a[_0xaa7b('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 9d38cdd..75a2dd0 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 _0xbb71=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb71,0xcd));var _0x1bb7=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xbb71[_0x2064e5];return _0x21a233;};'use strict';function ZendeskAccount(_0x20dbc9){this['id']=_0x20dbc9['id']||0x0;this['name']=_0x20dbc9['name']||'';this['username']=_0x20dbc9[_0x1bb7('0x0')]||'';this[_0x1bb7('0x1')]=_0x20dbc9[_0x1bb7('0x1')]||'';this['token']=_0x20dbc9['token']||'';this[_0x1bb7('0x2')]=_0x20dbc9[_0x1bb7('0x2')]||'';this[_0x1bb7('0x3')]=_0x20dbc9[_0x1bb7('0x3')]||'';this['type']=_0x20dbc9[_0x1bb7('0x4')]||_0x1bb7('0x5');this[_0x1bb7('0x6')]=_0x20dbc9['serverUrl']||'';this[_0x1bb7('0x7')]=_0x20dbc9[_0x1bb7('0x7')]||{};}module[_0x1bb7('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x0d2a=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x414cbe,_0x16a463){var _0x2793fe=function(_0x3a75f6){while(--_0x3a75f6){_0x414cbe['push'](_0x414cbe['shift']());}};_0x2793fe(++_0x16a463);}(_0x0d2a,0x1b4));var _0xa0d2=function(_0xa4c821,_0x2b0838){_0xa4c821=_0xa4c821-0x0;var _0x2f5424=_0x0d2a[_0xa4c821];return _0x2f5424;};'use strict';function ZendeskAccount(_0x210ae3){this['id']=_0x210ae3['id']||0x0;this[_0xa0d2('0x0')]=_0x210ae3['name']||'';this[_0xa0d2('0x1')]=_0x210ae3['username']||'';this['password']=_0x210ae3[_0xa0d2('0x2')]||'';this['token']=_0x210ae3[_0xa0d2('0x3')]||'';this[_0xa0d2('0x4')]=_0x210ae3[_0xa0d2('0x4')]||'';this[_0xa0d2('0x5')]=_0x210ae3[_0xa0d2('0x5')]||'';this['type']=_0x210ae3['type']||_0xa0d2('0x6');this[_0xa0d2('0x7')]=_0x210ae3['serverUrl']||'';this[_0xa0d2('0x8')]=_0x210ae3['Configurations']||{};}module[_0xa0d2('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 fa06b9d..0a37830 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 _0xbcd9=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x7f7579,_0x44ef50){var _0x5a0902=function(_0x31d144){while(--_0x31d144){_0x7f7579['push'](_0x7f7579['shift']());}};_0x5a0902(++_0x44ef50);}(_0xbcd9,0x102));var _0x9bcd=function(_0x4cf6b7,_0x429f3f){_0x4cf6b7=_0x4cf6b7-0x0;var _0x17e62f=_0xbcd9[_0x4cf6b7];return _0x17e62f;};'use strict';function ZohoAccount(_0x590adb){this['id']=_0x590adb['id']||0x0;this[_0x9bcd('0x0')]=_0x590adb[_0x9bcd('0x0')]||'';this[_0x9bcd('0x1')]=_0x590adb[_0x9bcd('0x1')]||'';this[_0x9bcd('0x2')]=_0x590adb[_0x9bcd('0x2')]||'';this[_0x9bcd('0x3')]=_0x590adb[_0x9bcd('0x3')]||'';this[_0x9bcd('0x4')]=_0x590adb[_0x9bcd('0x4')]||'';this[_0x9bcd('0x5')]=_0x590adb[_0x9bcd('0x5')]||'';this['serverUrl']=_0x590adb[_0x9bcd('0x6')]||'';this['code']=_0x590adb[_0x9bcd('0x7')]||'';this[_0x9bcd('0x8')]=_0x590adb[_0x9bcd('0x8')]||'';this[_0x9bcd('0x9')]=_0x590adb['Configurations']||{};}module[_0x9bcd('0xa')]=ZohoAccount; \ No newline at end of file +var _0x3b38=['zone','clientId','clientSecret','serverUrl','code','Configurations','exports','name','host'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b38,0xfa));var _0x83b3=function(_0x2998b8,_0x31b8d3){_0x2998b8=_0x2998b8-0x0;var _0x128fa7=_0x3b38[_0x2998b8];return _0x128fa7;};'use strict';function ZohoAccount(_0x409861){this['id']=_0x409861['id']||0x0;this[_0x83b3('0x0')]=_0x409861['name']||'';this['description']=_0x409861['description']||'';this[_0x83b3('0x1')]=_0x409861[_0x83b3('0x1')]||'';this['zone']=_0x409861[_0x83b3('0x2')]||'';this['clientId']=_0x409861[_0x83b3('0x3')]||'';this[_0x83b3('0x4')]=_0x409861[_0x83b3('0x4')]||'';this['serverUrl']=_0x409861[_0x83b3('0x5')]||'';this[_0x83b3('0x6')]=_0x409861[_0x83b3('0x6')]||'';this['refreshToken']=_0x409861['refreshToken']||'';this[_0x83b3('0x7')]=_0x409861[_0x83b3('0x7')]||{};}module[_0x83b3('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 86e986e..0fc14bc 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 _0xbc9c=['VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact','type','campaigntype','queue','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x348ca1,_0x429707){var _0x466322=function(_0x131ed7){while(--_0x131ed7){_0x348ca1['push'](_0x348ca1['shift']());}};_0x466322(++_0x429707);}(_0xbc9c,0x167));var _0xcbc9=function(_0x2fb110,_0x5c0176){_0x2fb110=_0x2fb110-0x0;var _0x5bc452=_0xbc9c[_0x2fb110];return _0x5bc452;};'use strict';var util=require(_0xcbc9('0x0'));var _=require(_0xcbc9('0x1'));var moment=require('moment');function checkNameSurname(_0x3670b0,_0x217b62,_0x3d8d53){var _0x113ee8='';if(!_[_0xcbc9('0x2')](_0x217b62)&&_0xcbc9('0x3')===typeof _0x217b62){_0x113ee8+=_0x217b62;}if(!_[_0xcbc9('0x2')](_0x3d8d53)&&'string'===typeof _0x3d8d53){_0x113ee8+='\x20'+_0x3d8d53;}if(_0x113ee8!==''){return _0x113ee8;}return _0x3670b0;}function Action(_0x5ced62,_0x50e596,_0x1e067f,_0x5840e3,_0x429407){this['uniqueid']=_0x1e067f||undefined;this[_0xcbc9('0x4')]=_0x5ced62['id'];this['queue']=_0x50e596['name'];this[_0xcbc9('0x5')]=_0x50e596['type'];this[_0xcbc9('0x6')]=_0xcbc9('0x7');this['dialAnswer']=![];this[_0xcbc9('0x8')]=_[_0xcbc9('0x2')](_0x5ced62[_0xcbc9('0x9')])?undefined:_0x5ced62[_0xcbc9('0x9')][_0xcbc9('0xa')];this[_0xcbc9('0xb')]=this['membername']?util[_0xcbc9('0xc')](_0xcbc9('0xd'),this[_0xcbc9('0x8')]):_0x5840e3||undefined;this[_0xcbc9('0xe')]=checkNameSurname(_0x5ced62['Contact'][_0xcbc9('0xf')],_0x5ced62[_0xcbc9('0x10')][_0xcbc9('0x11')],_0x5ced62[_0xcbc9('0x10')][_0xcbc9('0x12')]);this['active']=_0x5ced62[_0xcbc9('0x13')]||![];this['calleridnum']=_0x5ced62[_0xcbc9('0x10')][_0xcbc9('0xf')];this['scheduledat']=_0x5ced62[_0xcbc9('0x14')];this[_0xcbc9('0x15')]=_0x5ced62[_0xcbc9('0x15')]||0x0;this[_0xcbc9('0x16')]=_0x5ced62['countcongestionretry']||0x0;this[_0xcbc9('0x17')]=_0x5ced62[_0xcbc9('0x17')]||0x0;this[_0xcbc9('0x18')]=(_0x5ced62[_0xcbc9('0x15')]||0x0)+(_0x5ced62['countcongestionretry']||0x0)+(_0x5ced62['countnoanswerretry']||0x0)+(_0x5ced62[_0xcbc9('0x19')]||0x0)+(_0x5ced62[_0xcbc9('0x1a')]||0x0)+(_0x5ced62[_0xcbc9('0x1b')]||0x0)+(_0x5ced62[_0xcbc9('0x1c')]||0x0)+(_0x5ced62[_0xcbc9('0x1d')]||0x0);this[_0xcbc9('0x19')]=_0x5ced62[_0xcbc9('0x19')]||0x0;this[_0xcbc9('0x1a')]=_0x5ced62['countdropretry']||0x0;this[_0xcbc9('0x1b')]=_0x5ced62[_0xcbc9('0x1b')]||0x0;this['countmachineretry']=_0x5ced62[_0xcbc9('0x1c')]||0x0;this['countagentrejectretry']=_0x5ced62[_0xcbc9('0x1d')]||0x0;this[_0xcbc9('0x1e')]=_0x5ced62[_0xcbc9('0x1e')];this[_0xcbc9('0x1f')]=_0x5ced62[_0xcbc9('0x1f')];this[_0xcbc9('0x20')]=_0x5ced62[_0xcbc9('0x20')];this[_0xcbc9('0x21')]=_0x5ced62['recallme'];this[_0xcbc9('0x22')]=_0x5ced62[_0xcbc9('0x22')];this[_0xcbc9('0x23')]=_0x5ced62['ListId'];this[_0xcbc9('0x24')]=_[_0xcbc9('0x2')](_0x5ced62[_0xcbc9('0x9')])?_0x5ced62[_0xcbc9('0x24')]:_0x5ced62[_0xcbc9('0x9')]['id'];this[_0xcbc9('0x25')]=_0x5ced62[_0xcbc9('0x25')];this[_0xcbc9('0x26')]='';this['originatecalleridname']='';}Action[_0xcbc9('0x27')][_0xcbc9('0x28')]=function(){return util[_0xcbc9('0xc')](_0xcbc9('0x29'),this[_0xcbc9('0xe')],this[_0xcbc9('0x2a')]);};module[_0xcbc9('0x2b')]=Action; \ No newline at end of file +var _0xf948=['phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','number','util','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','isNil','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','calleridnum'];(function(_0x1f6f66,_0x48f930){var _0xf3cc69=function(_0x391b05){while(--_0x391b05){_0x1f6f66['push'](_0x1f6f66['shift']());}};_0xf3cc69(++_0x48f930);}(_0xf948,0x1f4));var _0x8f94=function(_0x2524fe,_0x3e18f9){_0x2524fe=_0x2524fe-0x0;var _0xc6a9f3=_0xf948[_0x2524fe];return _0xc6a9f3;};'use strict';var util=require(_0x8f94('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x5b1503,_0x2c8d06,_0x1dce4f){var _0x4836ff='';if(!_['isNil'](_0x2c8d06)&&_0x8f94('0x1')===typeof _0x2c8d06){_0x4836ff+=_0x2c8d06;}if(!_['isNil'](_0x1dce4f)&&_0x8f94('0x1')===typeof _0x1dce4f){_0x4836ff+='\x20'+_0x1dce4f;}if(_0x4836ff!==''){return _0x4836ff;}return _0x5b1503;}function Action(_0x4ee184,_0x164214,_0x5364d7,_0x598e86,_0x4242bf){this[_0x8f94('0x2')]=_0x5364d7||undefined;this[_0x8f94('0x3')]=_0x4ee184['id'];this[_0x8f94('0x4')]=_0x164214[_0x8f94('0x5')];this['type']=_0x164214[_0x8f94('0x6')];this[_0x8f94('0x7')]=_0x8f94('0x4');this[_0x8f94('0x8')]=![];this[_0x8f94('0x9')]=_[_0x8f94('0xa')](_0x4ee184[_0x8f94('0xb')])?undefined:_0x4ee184[_0x8f94('0xb')]['name'];this[_0x8f94('0xc')]=this[_0x8f94('0x9')]?util[_0x8f94('0xd')](_0x8f94('0xe'),this['membername']):_0x598e86||undefined;this[_0x8f94('0xf')]=checkNameSurname(_0x4ee184[_0x8f94('0x10')]['phone'],_0x4ee184[_0x8f94('0x10')][_0x8f94('0x11')],_0x4ee184[_0x8f94('0x10')][_0x8f94('0x12')]);this['active']=_0x4ee184['active']||![];this[_0x8f94('0x13')]=_0x4ee184['Contact'][_0x8f94('0x14')];this[_0x8f94('0x15')]=_0x4ee184['scheduledat'];this[_0x8f94('0x16')]=_0x4ee184['countbusyretry']||0x0;this[_0x8f94('0x17')]=_0x4ee184[_0x8f94('0x17')]||0x0;this[_0x8f94('0x18')]=_0x4ee184[_0x8f94('0x18')]||0x0;this[_0x8f94('0x19')]=(_0x4ee184[_0x8f94('0x16')]||0x0)+(_0x4ee184[_0x8f94('0x17')]||0x0)+(_0x4ee184[_0x8f94('0x18')]||0x0)+(_0x4ee184[_0x8f94('0x1a')]||0x0)+(_0x4ee184[_0x8f94('0x1b')]||0x0)+(_0x4ee184['countabandonedretry']||0x0)+(_0x4ee184[_0x8f94('0x1c')]||0x0)+(_0x4ee184[_0x8f94('0x1d')]||0x0);this['countnosuchnumberretry']=_0x4ee184[_0x8f94('0x1a')]||0x0;this['countdropretry']=_0x4ee184[_0x8f94('0x1b')]||0x0;this['countabandonedretry']=_0x4ee184[_0x8f94('0x1e')]||0x0;this['countmachineretry']=_0x4ee184[_0x8f94('0x1c')]||0x0;this[_0x8f94('0x1d')]=_0x4ee184[_0x8f94('0x1d')]||0x0;this['callback']=_0x4ee184[_0x8f94('0x1f')];this[_0x8f94('0x20')]=_0x4ee184[_0x8f94('0x20')];this[_0x8f94('0x21')]=_0x4ee184[_0x8f94('0x21')];this['recallme']=_0x4ee184['recallme'];this[_0x8f94('0x22')]=_0x4ee184[_0x8f94('0x22')];this[_0x8f94('0x23')]=_0x4ee184[_0x8f94('0x23')];this[_0x8f94('0x24')]=_[_0x8f94('0xa')](_0x4ee184[_0x8f94('0xb')])?_0x4ee184[_0x8f94('0x24')]:_0x4ee184[_0x8f94('0xb')]['id'];this['VoiceQueueId']=_0x4ee184[_0x8f94('0x25')];this['originatecalleridnum']='';this[_0x8f94('0x26')]='';}Action['prototype']['getCaller']=function(){return util[_0x8f94('0xd')]('\x22%s\x22\x20<%s>',this[_0x8f94('0xf')],this[_0x8f94('0x27')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index b103eda..e5cee19 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 _0x43ed=['talktime','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','AgentReject','agentreject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','recallme','validateContact','isValid','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','prototype','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','callerid','Interval','stringify','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','hasOwnProperty','recallMe','sequence','enqueue','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','responsetime','answertime','uniqueid','\x20Queue','connect','buildAcw','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration'];(function(_0x3f7d24,_0x3ce1d5){var _0x143f6e=function(_0x4689be){while(--_0x4689be){_0x3f7d24['push'](_0x3f7d24['shift']());}};_0x143f6e(++_0x3ce1d5);}(_0x43ed,0x92));var _0xd43e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x43ed[_0x5d4607];return _0x5e4a86;};'use strict';var util=require(_0xd43e('0x0'));var _=require('lodash');var BPromise=require(_0xd43e('0x1'));var uuid=require('uuid');var moment=require(_0xd43e('0x2'));var md5=require('md5');var Redis=require(_0xd43e('0x3'));var config=require(_0xd43e('0x4'));var logger=require(_0xd43e('0x5'))(_0xd43e('0x6'));var loggerAction=require(_0xd43e('0x5'))('actionPreview');var ami=require(_0xd43e('0x7'));var rpcDb=require(_0xd43e('0x8'));var Action=require(_0xd43e('0x9'));var ut=require(_0xd43e('0xa'));config[_0xd43e('0xb')]=_[_0xd43e('0xc')](config[_0xd43e('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd43e('0xb')]));var Sequence=function(){};Sequence[_0xd43e('0xd')]['enqueue']=function(_0x186c57){this['tail']=this['tail']?this['tail'][_0xd43e('0xe')](_0x186c57):_0x186c57();};function Preview(_0x4c8edd){this['sequence']=new Sequence();this[_0xd43e('0xf')]=_0x4c8edd[_0xd43e('0x10')];this[_0xd43e('0x11')]=_0x4c8edd[_0xd43e('0x11')];this[_0xd43e('0x12')]={};this[_0xd43e('0x13')]=_0x4c8edd['agents'];this[_0xd43e('0x14')]=0x0;ami['on']('originateresponse',this[_0xd43e('0x15')]['bind'](this));ami['on'](_0xd43e('0x16'),this[_0xd43e('0x17')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x19'),this[_0xd43e('0x1a')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x1b'),this['syncDialEnd'][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x1c'),this[_0xd43e('0x1d')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x1e'),this[_0xd43e('0x1f')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x20'),this[_0xd43e('0x21')][_0xd43e('0x18')](this));ami['on'](_0xd43e('0x22'),this[_0xd43e('0x23')]['bind'](this));this[_0xd43e('0x24')](this[_0xd43e('0xf')]);}function emit(_0x611285,_0x5162f7,_0x72ea78){io['to'](_0x611285)[_0xd43e('0x25')](_0x5162f7,_0x72ea78);}function emitCampaignPreview(_0x3b6fbf){if(_0x3b6fbf[_0xd43e('0x26')]===_0xd43e('0x27')){var _0x5565ef={'id':_0x3b6fbf['id'],'name':_0x3b6fbf[_0xd43e('0x28')],'strategy':_0x3b6fbf[_0xd43e('0x29')],'answered':_0x3b6fbf[_0xd43e('0x2a')],'available':_0x3b6fbf[_0xd43e('0x2b')],'loggedIn':_0x3b6fbf['loggedIn'],'pTalking':_0x3b6fbf[_0xd43e('0x2c')],'sumBillable':_0x3b6fbf[_0xd43e('0x2d')],'sumDuration':_0x3b6fbf['sumDuration'],'sumHoldTime':_0x3b6fbf[_0xd43e('0x2e')]||0x0,'talking':_0x3b6fbf[_0xd43e('0x2f')],'total':_0x3b6fbf[_0xd43e('0x30')],'type':_0x3b6fbf[_0xd43e('0x26')],'unmanaged':_0x3b6fbf[_0xd43e('0x31')],'abandoned':_0x3b6fbf['abandoned'],'waiting':_0x3b6fbf[_0xd43e('0x32')],'loggedInDb':_0x3b6fbf['loggedInDb'],'dialActive':_0x3b6fbf[_0xd43e('0x33')],'dialMethod':_0x3b6fbf[_0xd43e('0x34')],'dialOriginateCallerIdName':_0x3b6fbf['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3b6fbf[_0xd43e('0x35')],'dialOriginateTimeout':_0x3b6fbf['dialOriginateTimeout'],'dialPrefix':_0x3b6fbf[_0xd43e('0x36')],'outboundAnswerAgiCallsDay':_0x3b6fbf[_0xd43e('0x37')],'outboundAnswerCallsDay':_0x3b6fbf[_0xd43e('0x38')],'outboundBlacklistCallsDay':_0x3b6fbf['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3b6fbf[_0xd43e('0x39')],'outboundCongestionCallsDay':_0x3b6fbf[_0xd43e('0x3a')],'outboundDropCallsDayACS':_0x3b6fbf[_0xd43e('0x3b')],'outboundDropCallsDayCallersExit':_0x3b6fbf[_0xd43e('0x3c')],'outboundDropCallsDayTimeout':_0x3b6fbf[_0xd43e('0x3d')],'outboundNoAnswerCallsDay':_0x3b6fbf['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3b6fbf[_0xd43e('0x3e')],'outboundOriginateFailureCallsDay':_0x3b6fbf[_0xd43e('0x3f')],'outboundReCallsDay':_0x3b6fbf[_0xd43e('0x40')],'outboundRejectCallsDay':_0x3b6fbf['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3b6fbf[_0xd43e('0x41')],'outboundAbandonedCallsDay':_0x3b6fbf[_0xd43e('0x42')],'predictiveIntervalAnsweredCalls':_0x3b6fbf['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3b6fbf['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3b6fbf['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3b6fbf[_0xd43e('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x3b6fbf[_0xd43e('0x44')],'predictiveIntervalErlangCalls':_0x3b6fbf[_0xd43e('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x3b6fbf[_0xd43e('0x46')],'predictiveIntervalHitRate':_0x3b6fbf[_0xd43e('0x47')],'predictiveIntervalMultiplicativeFactor':_0x3b6fbf[_0xd43e('0x48')],'predictiveIntervalPauses':_0x3b6fbf[_0xd43e('0x49')],'predictiveIntervalAvailable':_0x3b6fbf[_0xd43e('0x4a')],'predictiveIntervalTotalCalls':_0x3b6fbf['predictiveIntervalTotalCalls'],'message':_0x3b6fbf['message'],'originated':_0x3b6fbf['originated'],'erlangCalls':_0x3b6fbf[_0xd43e('0x4b')],'erlangCallToSecond':_0x3b6fbf[_0xd43e('0x4c')],'erlangAbandonmentRate':_0x3b6fbf['erlangAbandonmentRate'],'erlangBusyFactor':_0x3b6fbf[_0xd43e('0x4d')],'startPredictive':_0x3b6fbf['startPredictive'],'startProgressive':_0x3b6fbf[_0xd43e('0x4e')]};if(_0x3b6fbf[_0xd43e('0x4f')]){_0x5565ef[_0xd43e('0x4f')]={'id':_0x3b6fbf[_0xd43e('0x4f')]['id'],'name':_0x3b6fbf[_0xd43e('0x4f')]['name'],'active':_0x3b6fbf[_0xd43e('0x4f')]['active'],'callerid':_0x3b6fbf['Trunk'][_0xd43e('0x50')]};}if(_0x3b6fbf[_0xd43e('0x51')]){_0x5565ef[_0xd43e('0x51')]={'id':_0x3b6fbf[_0xd43e('0x51')]['id'],'name':_0x3b6fbf['Interval'][_0xd43e('0x28')]};}var _0x4e8902=md5(JSON[_0xd43e('0x52')](_0x5565ef));if(_0x3b6fbf[_0xd43e('0x53')]!==_0x4e8902){_0x3b6fbf[_0xd43e('0x53')]=_0x4e8902;emit(util[_0xd43e('0x54')](_0xd43e('0x55'),_0x5565ef[_0xd43e('0x28')]),'voice_queue:save',_0x5565ef);}}}function emitVoiceQueueChannelRemove(_0x8eb48d){logger[_0xd43e('0x56')](_0xd43e('0x57'),JSON[_0xd43e('0x52')](_0x8eb48d));emit(util[_0xd43e('0x54')](_0xd43e('0x55'),_0x8eb48d[_0xd43e('0x28')]),'voice_queue_channel:remove',_0x8eb48d);io['emit'](_0xd43e('0x58'),_0x8eb48d);}function notSendMessagesQueue(_0x4693fd){if(_0x4693fd[_0xd43e('0x59')]){if(_0x4693fd[_0xd43e('0x5a')]===0x0&&_0x4693fd[_0xd43e('0x2c')]===0x0){_0x4693fd[_0xd43e('0x59')]=![];_0x4693fd[_0xd43e('0x2b')]=0x0;_0x4693fd[_0xd43e('0x5b')]=0x0;_0x4693fd[_0xd43e('0x5c')]='NOT_ACTIVE';ut[_0xd43e('0x5d')](_0xd43e('0x5e'),_0x4693fd[_0xd43e('0x28')]+_0xd43e('0x5f'));}else{_0x4693fd[_0xd43e('0x5c')]=_0xd43e('0x60');ut[_0xd43e('0x5d')](_0xd43e('0x5e'),_0x4693fd['name']+_0xd43e('0x61'));}emitCampaignPreview(_0x4693fd);}}Preview[_0xd43e('0xd')][_0xd43e('0x24')]=function(){var _0x332617=this;setInterval(function(){_0x332617[_0xd43e('0x62')]();},0x7cf);};Preview['prototype'][_0xd43e('0x62')]=function(){var _0x4f4fa1=this[_0xd43e('0xf')];this['clockClearZombieChannels']+=0x1;for(var _0x255ab3 in _0x4f4fa1){if(_0x4f4fa1['hasOwnProperty'](_0x255ab3)&&(_0x4f4fa1[_0x255ab3][_0xd43e('0x34')]===_0xd43e('0x6')||_0x4f4fa1[_0x255ab3]['dialMethod']===_0xd43e('0x63'))&&_0x4f4fa1[_0x255ab3][_0xd43e('0x26')]===_0xd43e('0x27')){if(this[_0xd43e('0x14')]>0x7){this[_0xd43e('0x14')]=0x0;this['clearZombieChannels']();}}if(_0x4f4fa1[_0xd43e('0x64')](_0x255ab3)&&_0x4f4fa1[_0x255ab3]['dialMethod']===_0xd43e('0x6')&&_0x4f4fa1[_0x255ab3][_0xd43e('0x26')]===_0xd43e('0x27')){if(_0x4f4fa1[_0x255ab3]['dialActive']){this['setMessage'](_0x4f4fa1[_0x255ab3]);this[_0xd43e('0x65')](_0x4f4fa1[_0x255ab3]);}else{notSendMessagesQueue(_0x4f4fa1[_0x255ab3]);}}}};Preview[_0xd43e('0xd')]['clearZombieChannel']=function(_0x387dd9){var _0x3949cf=this;this[_0xd43e('0x66')][_0xd43e('0x67')](function(){if(!_[_0xd43e('0x68')](_0x3949cf[_0xd43e('0x12')][_0x387dd9])){loggerAction[_0xd43e('0x56')]('[clearZombieChannels][talking]',_0x387dd9,_0xd43e('0x69'),_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')],_0xd43e('0x6b'),JSON[_0xd43e('0x52')](_0x3949cf[_0xd43e('0xf')][_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')]][_0xd43e('0x5a')]),_0xd43e('0x6c'),JSON['stringify'](_0x3949cf[_0xd43e('0xf')][_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')]]['pTalking']),JSON[_0xd43e('0x52')](_0x3949cf['actions'][_0x387dd9][_0xd43e('0x6d')]),JSON[_0xd43e('0x52')](_[_0xd43e('0x6e')](_0x3949cf[_0xd43e('0x12')][_0x387dd9],[_0xd43e('0x6f'),_0xd43e('0x70'),_0xd43e('0x71'),_0xd43e('0x72')])));return ami[_0xd43e('0x73')]({'action':_0xd43e('0x74'),'channel':_0x3949cf['actions'][_0x387dd9][_0xd43e('0x75')]})[_0xd43e('0x76')](function(_0x55c6e5){if(_0x55c6e5['message']===_0xd43e('0x77')){setTimeout(function(){if(_0x3949cf[_0xd43e('0x12')][_0x387dd9]){ut['updateOriginated'](_0x3949cf[_0xd43e('0xf')][_0x3949cf['actions'][_0x387dd9][_0xd43e('0x6a')]],_0xd43e('0x78'));if(_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6d')]===!![]){ut[_0xd43e('0x79')](_0x3949cf[_0xd43e('0xf')][_0x3949cf[_0xd43e('0x12')][_0x387dd9]['queue']],'[clearZombieChannel]');ut[_0xd43e('0x7a')](_0xd43e('0x7b')+_0x387dd9,_0x3949cf[_0xd43e('0x12')][_0x387dd9][_0xd43e('0x6a')]);}ut['loggerError'](_0xd43e('0x7c')+_0x387dd9,_0x3949cf['actions'][_0x387dd9][_0xd43e('0x6a')]);delete _0x3949cf['actions'][_0x387dd9];}},0x2328);}});}});};Preview[_0xd43e('0xd')][_0xd43e('0x7d')]=function(){var _0x4e0f2a=this;loggerAction[_0xd43e('0x56')]('[action]',_['size'](this[_0xd43e('0x12')]));for(var _0x133c9f in this[_0xd43e('0x12')]){if(_0x4e0f2a['actions'][_0xd43e('0x64')](_0x133c9f)){_0x4e0f2a[_0xd43e('0x7e')](_0x133c9f);}}};Preview['prototype'][_0xd43e('0x65')]=function(_0x5e76c5){var _0x2bbd41=this;rpcDb[_0xd43e('0x7f')](_0x5e76c5['id'],ut[_0xd43e('0x80')](this[_0xd43e('0x13')]))[_0xd43e('0x81')](function(_0x2d5272){if(!_['isNil'](_0x2d5272)){for(var _0x437701=0x0;_0x437701<_0x2d5272[_0xd43e('0x82')];_0x437701+=0x1){if(ut[_0xd43e('0x83')](_0x2d5272[_0x437701][_0xd43e('0x84')])<_0x5e76c5[_0xd43e('0x85')]*0x3c){if(_0x2d5272[_0x437701][_0xd43e('0x86')]&&!_0x2d5272[_0x437701][_0xd43e('0x86')][_0xd43e('0x87')]){_0x2bbd41[_0xd43e('0x88')](_0x2d5272[_0x437701]['id'])[_0xd43e('0x81')](ut[_0xd43e('0x89')](_0xd43e('0x8a')))[_0xd43e('0x76')](ut[_0xd43e('0x89')]('[RecallMe]'));}else{rpcDb[_0xd43e('0x8b')](_0x2d5272[_0x437701]['id']);}}else{var _0x172c58=new Action(_0x2d5272[_0x437701],_0x5e76c5);_0x172c58[_0xd43e('0x8c')]=moment()['format'](_0xd43e('0x8d'));_0x5e76c5[_0xd43e('0x40')]+=0x1;ut['logCustomer'](_0x172c58,0x17,_0xd43e('0x8e'));if(_0x5e76c5['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xd43e('0x8f')](_0x2d5272[_0x437701]));rpcDb[_0xd43e('0x90')](_0x172c58,_0xd43e('0x91'));}else{ut['logCustomer'](_0x172c58,0x16,_0xd43e('0x92'));rpcDb[_0xd43e('0x90')](_0x172c58,'[HistoryRecallClose]');rpcDb[_0xd43e('0x93')](_0x172c58,_0xd43e('0x94'));}}}}})['catch'](ut['logger2'](_0xd43e('0x95')));};Preview[_0xd43e('0xd')][_0xd43e('0x96')]=function(_0x49b501){_0x49b501[_0xd43e('0x59')]=!![];if(ut[_0xd43e('0x97')](_0x49b501['loggedIn'])){_0x49b501[_0xd43e('0x5c')]=_0xd43e('0x98');}else if(!ut[_0xd43e('0x99')](_0x49b501[_0xd43e('0x33')])){_0x49b501[_0xd43e('0x5c')]=_0xd43e('0x9a');}else if(!this['isTrunkReachable'](_0x49b501[_0xd43e('0x4f')])){if(!this[_0xd43e('0x9b')](_0x49b501[_0xd43e('0x9c')])){_0x49b501[_0xd43e('0x5c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x49b501[_0xd43e('0x5c')]=_0xd43e('0x9d');}}else{_0x49b501[_0xd43e('0x5c')]='ACTIVE';}emitCampaignPreview(_0x49b501);};Preview[_0xd43e('0xd')][_0xd43e('0x9e')]=function(_0x5748d9,_0x30c232,_0x20c09f){var _0x5bb696=this;var _0x263de1=this[_0xd43e('0x12')][_0x30c232];var _0x20ebfa=this[_0xd43e('0xf')][_0x263de1[_0xd43e('0x6a')]];var _0x5f558e;if(_0x20ebfa){switch(_0x20c09f){case'1':_0x20ebfa['outboundNoSuchCallsDay']+=0x1;_0x263de1[_0xd43e('0x9f')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x0,_0xd43e('0xa3'));ami['emit'](_0xd43e('0xa4'),ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xa6')));rpcDb[_0xd43e('0x90')](_0x263de1,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut['cloneAction'](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xa9'));}else{if(_0x263de1[_0xd43e('0x9f')]>=_0x20ebfa[_0xd43e('0xaa')]){rpcDb['createCustomerFinal'](_0x263de1,_0xd43e('0xa9'));}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,_0xd43e('0x9f'),_0x20ebfa[_0xd43e('0xad')]),_0x263de1['unlockAgent'],_0x263de1[_0xd43e('0xae')]);}}delete this['actions'][_0x5748d9['linkedid']];break;case _0xd43e('0xaf'):var _0x8beb35=moment()[_0xd43e('0x54')](_0xd43e('0x8d'));_0x263de1[_0xd43e('0xb0')]=_0x8beb35;_0x263de1[_0xd43e('0xb1')]=_0x8beb35;_0x263de1[_0xd43e('0x6d')]=!![];_0x20ebfa['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x263de1[_0xd43e('0xb2')],_0xd43e('0xb3'),_0x20ebfa[_0xd43e('0x28')],_0xd43e('0x6c'),_0x20ebfa[_0xd43e('0x2c')]);ami[_0xd43e('0x25')]('custom:agentconnect',ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xb4'),this['campaignsPreview'][_0x263de1[_0xd43e('0x6a')]]));if(_0x20ebfa['acw']){ami['emit']('custom:agentConnectPreview',ut[_0xd43e('0xb5')](_0x263de1));}break;case'16':ami[_0xd43e('0x25')](_0xd43e('0xb6'),ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xb7'),this[_0xd43e('0xf')][_0x263de1['queue']]));emitVoiceQueueChannelRemove(ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xb7')));_0x20ebfa['outboundAnswerCallsDay']+=0x1;_0x20ebfa[_0xd43e('0x30')]+=0x1;_0x20ebfa[_0xd43e('0x2a')]+=0x1;ut[_0xd43e('0x79')](_0x20ebfa,'[16]');_0x263de1['countglobal']=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x4,_0xd43e('0xb8'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xb9'));rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xba'));rpcDb[_0xd43e('0xbb')](_0x263de1);_0x20ebfa[_0xd43e('0xbc')]+=_0x263de1[_0xd43e('0xbd')];_0x20ebfa[_0xd43e('0x2d')]+=_0x263de1[_0xd43e('0xbd')];logger['info']('[syncHangup][talking][decrement]',_0x263de1[_0xd43e('0xb2')],_0xd43e('0xb3'),_0x20ebfa[_0xd43e('0x28')],_0xd43e('0x6c'),_0x20ebfa[_0xd43e('0x2c')]);delete this[_0xd43e('0x12')][_0x5748d9['linkedid']];break;case'BUSY':_0x20ebfa[_0xd43e('0x39')]+=0x1;_0x263de1['countbusyretry']+=0x1;_0x263de1['countglobal']=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x5,'Busy');ami[_0xd43e('0x25')](_0xd43e('0xbe'),ut['buildObj'](_0x263de1,'busy'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xbf'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xc1'));}else{if(_0x263de1[_0xd43e('0xc2')]>=_0x20ebfa['dialBusyMaxRetry']){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xbf'));}else{rpcDb[_0xd43e('0xab')](ut['scheduledAt'](_0x263de1,_0xd43e('0xc2'),_0x20ebfa[_0xd43e('0xc3')]),_0x263de1[_0xd43e('0xc4')],_0x263de1[_0xd43e('0xae')]);}}break;case _0xd43e('0xc5'):_0x20ebfa[_0xd43e('0xc6')]+=0x1;_0x263de1[_0xd43e('0xc7')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x3,'NoAnswer');ami['emit'](_0xd43e('0xc8'),ut['buildObj'](_0x263de1,'noanswer'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xc9'));if(ut['totalGlobal'](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xca'));}else{if(_0x263de1[_0xd43e('0xc7')]>=_0x20ebfa[_0xd43e('0xcb')]){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xc9'));}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,_0xd43e('0xc7'),_0x20ebfa['dialNoAnswerRetryFrequency']),_0x263de1['unlockAgent'],_0x263de1[_0xd43e('0xae')]);}}break;case'CONGESTION':_0x20ebfa[_0xd43e('0x3a')]+=0x1;_0x263de1[_0xd43e('0xcc')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x8,'Congestion');ami[_0xd43e('0x25')]('custom:agentcongestion',ut['buildObj'](_0x263de1,'congestion'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xcd'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa['dialGlobalMaxRetry']){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x263de1[_0xd43e('0xcc')]>=_0x20ebfa[_0xd43e('0xce')]){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xcd'));}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,_0xd43e('0xcc'),_0x20ebfa[_0xd43e('0xc3')]),_0x263de1[_0xd43e('0xc4')],_0x263de1[_0xd43e('0xae')]);}}break;case _0xd43e('0xcf'):_0x20ebfa[_0xd43e('0xd0')]+=0x1;_0x263de1['countagentrejectretry']+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x14,_0xd43e('0xd1'));ami[_0xd43e('0x25')]('custom:agentreject',ut['buildObj'](_0x263de1,_0xd43e('0xd2')));rpcDb[_0xd43e('0x90')](_0x263de1,'[syncHangupRequest][logAgentReject]');if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x5f558e,_0xd43e('0xd3'));}else{if(_0x263de1[_0xd43e('0xd4')]>=_0x20ebfa[_0xd43e('0xd5')]){rpcDb[_0xd43e('0x93')](_0x263de1,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd43e('0xab')](ut[_0xd43e('0xac')](_0x263de1,'countagentrejectretry',_0x20ebfa['dialAgentRejectRetryFrequency']),_0x263de1[_0xd43e('0xc4')],_0x263de1['activeContact']);}}break;case _0xd43e('0xd6'):_0x20ebfa[_0xd43e('0x42')]+=0x1;_0x263de1[_0xd43e('0xd7')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0xb,_0xd43e('0xd8'));rpcDb[_0xd43e('0x90')](_0x263de1,_0xd43e('0xd9'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,'Global');rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xd9'));}else{if(_0x263de1[_0xd43e('0xda')]>=_0x20ebfa['dialAbandonedMaxRety']){rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xd9'));}else{rpcDb[_0xd43e('0xab')](ut['scheduledAt'](_0x263de1,_0xd43e('0xd7'),_0x20ebfa[_0xd43e('0xdb')]),_0x263de1[_0xd43e('0xc4')],_0x263de1[_0xd43e('0xae')]);}}break;case'18':_0x20ebfa[_0xd43e('0x41')]+=0x1;_0x263de1[_0xd43e('0xdc')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0x12,_0x5748d9['cause-txt']||_0x5748d9[_0xd43e('0xdd')]);ami[_0xd43e('0x25')]('custom:amd',ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xde')));rpcDb[_0xd43e('0x90')](_0x263de1,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,'Global');rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xdf'));}else{rpcDb[_0xd43e('0x93')](_0x263de1,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe0')]];break;case'19':_0x20ebfa[_0xd43e('0x41')]+=0x1;_0x263de1['countglobal']=ut[_0xd43e('0xa1')](_0x263de1);ut['logCustomer'](_0x263de1,0x13,_0x5748d9[_0xd43e('0xe1')]||_0x5748d9[_0xd43e('0xdd')]);ami[_0xd43e('0x25')](_0xd43e('0xe2'),ut[_0xd43e('0xa5')](_0x263de1,_0xd43e('0xde')));rpcDb['createCustomerHistory'](_0x263de1,_0xd43e('0xe3'));if(ut[_0xd43e('0xa1')](_0x263de1)>=_0x20ebfa[_0xd43e('0xa7')]){_0x5f558e=ut[_0xd43e('0xc0')](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xe3'));}else{rpcDb[_0xd43e('0x93')](_0x263de1,'[callProgressDetectingCustomer][machine]');}delete this[_0xd43e('0x12')][_0x5748d9['linkedid']];break;default:if(_0x263de1['dialAnswer']){ut['decrementTalkink'](_0x20ebfa,_0xd43e('0xe4'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x20ebfa[_0xd43e('0x28')],_0x5748d9);}_0x20ebfa[_0xd43e('0x41')]+=0x1;_0x263de1[_0xd43e('0xa0')]=ut[_0xd43e('0xa1')](_0x263de1);ut[_0xd43e('0xa2')](_0x263de1,0xc,_0x5748d9[_0xd43e('0xe1')]||_0x5748d9[_0xd43e('0xdd')]);rpcDb['createCustomerHistory'](_0x263de1,_0xd43e('0xe5'));if(ut['totalGlobal'](_0x263de1)>=_0x20ebfa['dialGlobalMaxRetry']){_0x5f558e=ut['cloneAction'](_0x263de1,0xf,_0xd43e('0xa8'));rpcDb[_0xd43e('0x93')](_0x5f558e,_0xd43e('0xe6'));}else{rpcDb[_0xd43e('0x93')](_0x263de1,_0xd43e('0xe6'));}delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe0')]];}if(!(_0x263de1[_0xd43e('0x6d')]&&_0x20c09f==='16')){ut[_0xd43e('0xe7')](_0x20ebfa,_0xd43e('0xe8'));logger[_0xd43e('0x56')]('[originated][decrement][callProgressDetectingCustomer]',_0x263de1[_0xd43e('0xb2')],'\x20Queue',_0x20ebfa[_0xd43e('0x28')],_0xd43e('0x6b'),_0x20ebfa[_0xd43e('0x5a')]);}if(_0x20c09f!==_0xd43e('0xaf')){delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe0')]];delete this[_0xd43e('0x12')][_0x5748d9[_0xd43e('0xe9')]];}}};Preview[_0xd43e('0xd')][_0xd43e('0xea')]=function(_0x1952bc,_0xa7f5ea,_0x13e034){if(_[_0xd43e('0xeb')](_0xa7f5ea)&&'object'!==typeof _0xa7f5ea){return;}if(_[_0xd43e('0xeb')](_0x13e034)&&_0xd43e('0xec')!==typeof _0x13e034){return;}switch(_0x13e034[_0xd43e('0xed')]){case'0':ut['logAgent'](_0x1952bc,0x0,_0xd43e('0xa3'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xef'));break;case'3':ut[_0xd43e('0xf0')](_0x1952bc,0x3,_0xd43e('0xf1'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf2'));break;case'5':ut[_0xd43e('0xf0')](_0x1952bc,0x5,_0xd43e('0xf3'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf4'));break;case'8':ut[_0xd43e('0xf0')](_0x1952bc,0x8,_0xd43e('0xf5'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf6'));break;case'22':ut[_0xd43e('0xf0')](_0x1952bc,0x16,_0xd43e('0xf7'));rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf8'));break;default:ut['logAgent'](_0x1952bc,0xc,_0x13e034[_0xd43e('0xed')]);rpcDb[_0xd43e('0xee')](_0x1952bc,_0xd43e('0xf6'));}ut[_0xd43e('0xe7')](_0xa7f5ea,'[callProgressDetectingAgent]');logger['info'](_0xd43e('0xf9'),_0x1952bc['uniqueid'],_0xd43e('0xb3'),_0xa7f5ea['name'],_0xd43e('0x6b'),_0xa7f5ea[_0xd43e('0x5a')]);delete this['actions'][_0x1952bc[_0xd43e('0xb2')]];};Preview[_0xd43e('0xd')]['checkInBlack']=function(_0x4be06a,_0x40a3ad,_0x518cc8,_0x3ace2d,_0x609b60){var _0x37d672=this;return new BPromise(function(_0x2e5c66,_0x176d5d){if(_[_0xd43e('0x68')](_0x40a3ad)||_['isNil'](_0x40a3ad[_0xd43e('0xfa')])||_[_0xd43e('0x68')](_0x40a3ad[_0xd43e('0xfa')][_0xd43e('0xfb')])||_[_0xd43e('0x68')](_0x40a3ad[_0xd43e('0x71')])){_0x176d5d(ut[_0xd43e('0x5c')](_0xd43e('0xfc'),_0x3ace2d,_0x609b60));return;}var _0x3ff91c=uuid['v4']();var _0x381666=_0x37d672['campaignsPreview'][_0x40a3ad['Queue'][_0xd43e('0x28')]];var _0x43feb3=_0x518cc8?_0x37d672[_0xd43e('0x13')][_0x518cc8]['id']:undefined;_0x37d672[_0xd43e('0x12')][_0x3ff91c]=new Action(_0x40a3ad,_0x381666,_0x3ff91c,_0x518cc8,_0x43feb3);var _0xcb4d7d=_0x37d672[_0xd43e('0x12')][_0x3ff91c];_0xcb4d7d[_0xd43e('0xc4')]=_0x3ace2d;_0xcb4d7d[_0xd43e('0xae')]=_0x609b60;_0xcb4d7d[_0xd43e('0xfd')]=_0x518cc8;if(_[_0xd43e('0xfe')](_0x4be06a)){_0x37d672[_0xd43e('0xff')](_0xcb4d7d,_0x381666,_0x40a3ad,_0x518cc8)[_0xd43e('0x81')](function(_0x274c3){logger[_0xd43e('0x56')](_0xd43e('0x100'),'Queue:\x20'+_0xcb4d7d[_0xd43e('0x6a')]+'\x20IdHopper:\x20'+_0xcb4d7d[_0xd43e('0x101')],JSON[_0xd43e('0x52')](_0x274c3));ami['emit'](_0xd43e('0x102'),ut[_0xd43e('0xa5')](_0xcb4d7d,_0xd43e('0x103'),_0x37d672['campaignsPreview'][_0xcb4d7d[_0xd43e('0x6a')]]));_0x2e5c66(ut[_0xd43e('0x5c')](_0xd43e('0x104')));})['catch'](function(_0x246a05){ut[_0xd43e('0x5d')](_0xd43e('0x105'),_0x246a05);_0x176d5d(ut['message'](_0xd43e('0x106'),_0x3ace2d,_0x609b60));});}else{_0x381666['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0xcb4d7d);rpcDb[_0xd43e('0x107')](_0xcb4d7d,_0xd43e('0x108'));delete _0x37d672[_0xd43e('0x12')][_0x3ff91c];_0x176d5d(ut[_0xd43e('0x5c')](_0xd43e('0x109'),_0x3ace2d,_0x609b60));}});};Preview['prototype'][_0xd43e('0x9b')]=function(_0x5044fa){return!_[_0xd43e('0x68')](_0x5044fa)&&!_['isNil'](_0x5044fa['name'])&&!_[_0xd43e('0x68')](_0x5044fa[_0xd43e('0x10a')])&&_0x5044fa[_0xd43e('0x10a')]&&!_['isNil'](this['trunks'][util['format'](_0xd43e('0x10b'),_0x5044fa[_0xd43e('0x28')])])&&!_[_0xd43e('0x68')](this[_0xd43e('0x11')][util[_0xd43e('0x54')](_0xd43e('0x10b'),_0x5044fa[_0xd43e('0x28')])][_0xd43e('0x74')])&&(this[_0xd43e('0x11')][util[_0xd43e('0x54')](_0xd43e('0x10b'),_0x5044fa['name'])][_0xd43e('0x74')]==='reachable'||this[_0xd43e('0x11')][util[_0xd43e('0x54')](_0xd43e('0x10b'),_0x5044fa['name'])][_0xd43e('0x74')]===_0xd43e('0x10c'));};Preview[_0xd43e('0xd')][_0xd43e('0x88')]=function(_0x5ac9a3,_0x4b02c9){var _0x31f24e=this;return new BPromise(function(_0x45a79f,_0x13ec6e){_0x31f24e[_0xd43e('0x10d')](_0x5ac9a3,_0x4b02c9)['then'](function(_0x34be10){_0x45a79f(_[_0xd43e('0x6e')](_0x34be10,['message']));})[_0xd43e('0x76')](function(_0x3bded5){if(_0x3bded5[_0xd43e('0x10e')]){rpcDb['unlockContact'](_0x5ac9a3);}if(_0x3bded5['active']){rpcDb[_0xd43e('0x8b')](_0x5ac9a3);}_0x13ec6e(_[_0xd43e('0x6e')](_0x3bded5,[_0xd43e('0x5c')]));});});};Preview[_0xd43e('0xd')][_0xd43e('0x10d')]=function(_0x1f7cf4,_0x253dd4){var _0x3527ab=this;return new BPromise(function(_0x496735,_0x306d96){var _0x56e0df,_0x4a942a;rpcDb['getContactPreview'](_0x1f7cf4)[_0xd43e('0x81')](function(_0x213fae){if(!_[_0xd43e('0x68')](_0x213fae[0x0])){_0x4a942a=_0x213fae[0x0][_0xd43e('0x10f')]?![]:!![];_0x56e0df=_0x213fae[0x0]['recallme']?!![]:![];_0x56e0df=_0x253dd4?!![]:_0x56e0df;}var _0x1a5fb5=_0x3527ab[_0xd43e('0x110')](_0x213fae);if(_0x1a5fb5[_0xd43e('0x111')]){rpcDb['checkIsBlackList'](_[_0xd43e('0x6e')](_0x213fae[0x0],[_0xd43e('0x71'),_0xd43e('0x112')]))[_0xd43e('0x81')](function(_0x1af24c){_0x3527ab[_0xd43e('0x113')](_0x1af24c,_0x213fae[0x0],_0x253dd4,_0x4a942a,_0x56e0df)[_0xd43e('0x81')](function(_0x553ee5){_0x496735(_0x553ee5);})[_0xd43e('0x76')](function(_0x33d4b9){_0x306d96(_0x33d4b9);});})['catch'](function(_0x474ca7){ut[_0xd43e('0x5d')](_0xd43e('0x114'),_0x474ca7);_0x306d96(ut['message'](_0xd43e('0x115'),_0x4a942a,_0x56e0df));});}else{_0x306d96(ut[_0xd43e('0x5c')](_0x1a5fb5['message'],_0x4a942a,_0x56e0df));}})[_0xd43e('0x76')](function(_0x1f1007){ut[_0xd43e('0x5d')](_0xd43e('0x116'),_0x1f1007);_0x306d96(ut[_0xd43e('0x5c')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xd43e('0x110')]=function(_0x240be5){if(_['isNil'](_0x240be5)||_[_0xd43e('0xfe')](_0x240be5)||!_[_0xd43e('0x68')](_0x240be5[0x0][_0xd43e('0x86')])&&_[_0xd43e('0x68')](_0x240be5[0x0][_0xd43e('0x86')]['name'])){ut[_0xd43e('0x5d')](_0xd43e('0x117'),_0x240be5);return{'isValid':![],'message':_0xd43e('0x118')};}var _0x203528=this[_0xd43e('0xf')][_0x240be5[0x0][_0xd43e('0x69')][_0xd43e('0x28')]];_0x203528[_0xd43e('0x5c')]=_0xd43e('0x9d');if(_[_0xd43e('0x68')](_0x203528)){ut[_0xd43e('0x5d')](_0xd43e('0x119'),_0x203528);return{'isValid':![],'message':_0xd43e('0x11a')};}if(!this[_0xd43e('0x9b')](_0x203528[_0xd43e('0x4f')])){ut[_0xd43e('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xd43e('0x11b')+_0x203528[_0xd43e('0x28')]+_0xd43e('0x11c'));if(!this[_0xd43e('0x9b')](_0x203528['TrunkBackup'])){ut[_0xd43e('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x203528['name']+_0xd43e('0x11d'));return{'isValid':![],'message':_0xd43e('0x11e')};}}if(!ut[_0xd43e('0x99')](_0x203528[_0xd43e('0x33')])){ut[_0xd43e('0x5d')](_0xd43e('0x11f'),_0x203528[_0xd43e('0x28')]+_0xd43e('0x120'));return{'isValid':![],'message':_0xd43e('0x11b')+_0x203528[_0xd43e('0x28')]+_0xd43e('0x120')};}return{'isValid':!![],'message':_0xd43e('0x121')};};Preview[_0xd43e('0xd')][_0xd43e('0xff')]=function(_0x59f287,_0x4d4a32,_0x29cabe,_0x3a1c19){var _0x177e10=this;return new BPromise(function(_0x338a2a,_0x1b0580){var _0x3f0848=_0x59f287[_0xd43e('0xb2')];var _0x3a93e8=_0x177e10[_0xd43e('0x9b')](_0x4d4a32[_0xd43e('0x4f')])?util[_0xd43e('0x54')](_0xd43e('0x122'),_0x4d4a32[_0xd43e('0x4f')][_0xd43e('0x28')],_[_0xd43e('0x68')](_0x4d4a32[_0xd43e('0x36')])?'':_0x4d4a32[_0xd43e('0x36')][_0xd43e('0x123')]()||'',_0x4d4a32[_0xd43e('0x124')]>0x0?_0x29cabe[_0xd43e('0xfa')][_0xd43e('0xfb')]['substring'](_0x4d4a32[_0xd43e('0x124')]):_0x29cabe[_0xd43e('0xfa')][_0xd43e('0xfb')]):util['format']('SIP/%s/%s%s',_[_0xd43e('0x68')](_0x4d4a32[_0xd43e('0x9c')])?_0x4d4a32[_0xd43e('0x4f')][_0xd43e('0x28')]:_0x4d4a32[_0xd43e('0x9c')][_0xd43e('0x28')],_[_0xd43e('0x68')](_0x4d4a32['dialPrefix'])?'':_0x4d4a32[_0xd43e('0x36')][_0xd43e('0x123')]()||'',_0x4d4a32[_0xd43e('0x124')]>0x0?_0x29cabe['Contact'][_0xd43e('0xfb')][_0xd43e('0x125')](_0x4d4a32[_0xd43e('0x124')]):_0x29cabe[_0xd43e('0xfa')][_0xd43e('0xfb')]);var _0x377210=_0x177e10[_0xd43e('0x9b')](_0x4d4a32[_0xd43e('0x4f')])?ut[_0xd43e('0x126')](_0x4d4a32['Trunk']['callerid'],_0x4d4a32[_0xd43e('0x127')],_0x4d4a32['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd43e('0x128')](_0x4d4a32[_0xd43e('0x35')],_0x4d4a32[_0xd43e('0x129')]):_0x4d4a32[_0xd43e('0x35')]):ut['getCallerId'](_[_0xd43e('0x68')](_0x4d4a32[_0xd43e('0x9c')])?_0x4d4a32['Trunk']['callerid']:_0x4d4a32['TrunkBackup'][_0xd43e('0x50')],_0x4d4a32[_0xd43e('0x127')],_0x4d4a32[_0xd43e('0x129')]>0x0?ut[_0xd43e('0x128')](_0x4d4a32[_0xd43e('0x35')],_0x4d4a32['dialRandomLastDigitCallerIdNumber']):_0x4d4a32['dialOriginateCallerIdNumber']);if(_0x377210){_0x59f287[_0xd43e('0x12a')]=ut[_0xd43e('0x12b')](_0x377210);_0x59f287[_0xd43e('0x12c')]=ut[_0xd43e('0x12d')](_0x377210);}var _0x518d11=ut['addVariables'](_0x4d4a32,_0x29cabe,_0x3a93e8,_0x377210,_0x3f0848,_0x59f287);_[_0xd43e('0x12e')](_0x59f287,ut[_0xd43e('0x12f')](_0x518d11));_0x59f287[_0xd43e('0x8c')]=moment()[_0xd43e('0x54')](_0xd43e('0x8d'));ami[_0xd43e('0x73')](ut[_0xd43e('0x130')](_0x59f287,_0x4d4a32,_0x518d11,_0x59f287[_0xd43e('0xae')],_0x3a1c19))[_0xd43e('0x81')](function(_0x18f7f5){var _0x1bdd42=_0x59f287['channelAgent'];if(!_['isNil'](_0x1bdd42)){if(!_[_0xd43e('0x68')](_0x177e10[_0xd43e('0x13')][_0x1bdd42])){_0x177e10[_0xd43e('0x13')][_0x1bdd42][_0xd43e('0x131')]=_0x59f287[_0xd43e('0x132')];emit(util[_0xd43e('0x54')](_0xd43e('0x133'),_0x177e10['agents'][_0x1bdd42][_0xd43e('0x28')]),_0xd43e('0x134'),{'destaccountcode':_0x177e10[_0xd43e('0x13')][_0x1bdd42]['accountcode'],'destconnectedlinenum':_0x59f287[_0xd43e('0x132')]});}}_0x4d4a32['originated']+=0x1;logger['info'](_0xd43e('0x135'),_0x3f0848,_0xd43e('0xb3'),_0x4d4a32[_0xd43e('0x28')],'originated:\x20',_0x4d4a32[_0xd43e('0x5a')]);_0x338a2a(_0x18f7f5);})[_0xd43e('0x76')](function(_0xddf932){ut['logAgent'](_0x59f287,0xe,_0xd43e('0x136'));rpcDb[_0xd43e('0xee')](_0x59f287,_0xd43e('0x137'));_0x1b0580(_0xddf932);});});};Preview[_0xd43e('0xd')][_0xd43e('0x1d')]=function(_0x21e79c){if(this[_0xd43e('0x12')][_0x21e79c[_0xd43e('0xe0')]]){this['actions'][_0x21e79c[_0xd43e('0xe0')]][_0xd43e('0x75')]=_0x21e79c['channel'];}};Preview[_0xd43e('0xd')][_0xd43e('0x15')]=function(_0x24a8ca){var _0x4ce84c=this;var _0x565e29=this[_0xd43e('0x12')][_0x24a8ca['actionid']];if(_0x565e29){if(_0x565e29['lookAgent']&&this['agents'][_0x565e29[_0xd43e('0xfd')]]){ut[_0xd43e('0x138')](_0x565e29,this[_0xd43e('0x13')][_0x565e29[_0xd43e('0xfd')]][_0xd43e('0x28')],this[_0xd43e('0x13')][_0x565e29[_0xd43e('0xfd')]]['id']);}var _0x3d2204=_[_0xd43e('0x139')](_0x565e29);_0x3d2204[_0xd43e('0xb0')]=moment()[_0xd43e('0x54')](_0xd43e('0x8d'));var _0x5aacd7=_0x4ce84c[_0xd43e('0xf')][_0x565e29[_0xd43e('0x6a')]];if(ut[_0xd43e('0x13a')](_0x24a8ca[_0xd43e('0x13b')])){if(_0x565e29[_0xd43e('0xc4')]){rpcDb['unlockContact'](_0x565e29[_0xd43e('0x101')]);}if(_0x565e29[_0xd43e('0xae')]){rpcDb[_0xd43e('0x8b')](_0x565e29[_0xd43e('0x101')]);}ami[_0xd43e('0x25')](_0xd43e('0x13c'),ut[_0xd43e('0xa5')](_0x565e29,'rejected',this['campaignsPreview'][_0x565e29['queue']]));this['callProgressDetectingAgent'](_0x3d2204,_0x5aacd7,_0x24a8ca);}else{_0x565e29[_0xd43e('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x3d2204,0x4,_0xd43e('0xb8'));rpcDb['createAgentHistory'](_0x3d2204,_0xd43e('0x13d'));}}};Preview[_0xd43e('0xd')][_0xd43e('0x17')]=function(_0x171933){var _0x296523=this;var _0x190dcb=this['actions'][_0x171933['linkedid']];var _0x111a28;if(_0x190dcb){_0x111a28=this[_0xd43e('0xf')][_0x190dcb[_0xd43e('0x6a')]];logger[_0xd43e('0x56')]('[syncHangup][talking]',_0x171933[_0xd43e('0xe0')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],'pTalking:\x20',_0x111a28[_0xd43e('0x2c')]);}if(this[_0xd43e('0x12')][_0x171933['linkedid']]&&_0x171933[_0xd43e('0xe0')]!==_0x171933['uniqueid']){if(_0x171933[_0xd43e('0x13e')]==='16'&&this[_0xd43e('0x12')][_0x171933[_0xd43e('0xe0')]][_0xd43e('0x6d')]){this[_0xd43e('0x9e')](_0x171933,_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')]);}else if(this[_0xd43e('0x12')][_0x171933[_0xd43e('0xe0')]][_0xd43e('0x6d')]){logger[_0xd43e('0x56')](_0xd43e('0x13f'),_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],'pTalking:\x20',_0x111a28[_0xd43e('0x2c')]);this[_0xd43e('0x9e')](_0x171933,_0x171933[_0xd43e('0xe0')],_0x171933['cause']);}}else if(_0x190dcb&&_[_0xd43e('0x68')](_0x190dcb['statedesc'])&&_0x111a28[_0xd43e('0x140')]&&_0x171933[_0xd43e('0xe0')]===_0x171933[_0xd43e('0xb2')]&&_[_0xd43e('0x68')](_0x171933[_0xd43e('0xed')])&&_0x171933[_0xd43e('0x13e')]==='16'&&_0x171933['channelstate']==='6'&&_['isUndefined'](_0x190dcb[_0xd43e('0x141')])){if(_0x190dcb['unlockAgent']){rpcDb['unlockContact'](_0x190dcb['idContact']);}if(_0x190dcb[_0xd43e('0xae')]){rpcDb[_0xd43e('0x8b')](_0x190dcb[_0xd43e('0x101')]);}_0x171933[_0xd43e('0xed')]='22';this['callProgressDetectingAgent'](_0x190dcb,_0x111a28,_0x171933);}else if(_0x190dcb&&_0x190dcb[_0xd43e('0x141')]){if(_0x171933[_0xd43e('0x13e')]==='16'&&this[_0xd43e('0x12')][_0x171933['linkedid']]['dialAnswer']){logger[_0xd43e('0x56')](_0xd43e('0x142'),_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],_0xd43e('0x6c'),_0x111a28[_0xd43e('0x2c')]);this['callProgressDetectingCustomer'](_0x171933,_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')]);}else if(this['actions'][_0x171933[_0xd43e('0xe0')]][_0xd43e('0x6d')]){logger[_0xd43e('0x56')](_0xd43e('0x13f'),_0x171933[_0xd43e('0xe0')],_0x171933[_0xd43e('0x13e')],_0xd43e('0xb3'),_0x111a28[_0xd43e('0x28')],_0xd43e('0x6c'),_0x111a28['pTalking']);this[_0xd43e('0x9e')](_0x171933,_0x171933['linkedid'],_0x171933[_0xd43e('0x13e')]);}}};Preview[_0xd43e('0xd')][_0xd43e('0x143')]=function(_0x284998){if(this['actions'][_0x284998[_0xd43e('0xe9')]]&&_0x284998[_0xd43e('0xe9')]!==_0x284998['destuniqueid']){this[_0xd43e('0x9e')](_0x284998,_0x284998[_0xd43e('0xe9')],_0x284998[_0xd43e('0xdd')]);}};Preview[_0xd43e('0xd')][_0xd43e('0x1a')]=function(_0x49e291){if(this[_0xd43e('0x12')][_0x49e291['linkedid']]&&_0x49e291['linkedid']!==_0x49e291[_0xd43e('0xb2')]&&!this['actions'][_0x49e291[_0xd43e('0xe0')]]['dialAnswer']){if(_0x49e291[_0xd43e('0x13e')]==='1'){this[_0xd43e('0x9e')](_0x49e291,_0x49e291[_0xd43e('0xe0')],_0x49e291[_0xd43e('0x13e')]);}}};Preview[_0xd43e('0xd')][_0xd43e('0x144')]=function(_0x4b4044,_0x213147,_0x2fd72c){if(this[_0xd43e('0x12')][_0x4b4044]){if(_[_0xd43e('0x68')](this['actions'][_0x4b4044][_0xd43e('0x145')])){this[_0xd43e('0x12')][_0x4b4044][_0xd43e('0x145')]={};}this[_0xd43e('0x12')][_0x4b4044]['variables'][_0x213147]=_0x2fd72c;}};Preview[_0xd43e('0xd')][_0xd43e('0x1f')]=function(_0x5c61d5){try{if(!_[_0xd43e('0x68')](_0x5c61d5)){if(ut['filterKey'](_[_0xd43e('0x146')](_0x5c61d5[_0xd43e('0x147')])[0x0])){this['addVariable'](_0x5c61d5[_0xd43e('0xb2')],_[_0xd43e('0x146')](_0x5c61d5[_0xd43e('0x147')])[0x0],_0x5c61d5[_0xd43e('0x148')]);}}}catch(_0x44f9da){logger[_0xd43e('0x149')](_0xd43e('0x14a'),util[_0xd43e('0x14b')](_0x44f9da,{'showHidden':![],'depth':null}));}};Preview[_0xd43e('0xd')]['syncAttendedTransfer']=function(_0x4acb82){if(_0x4acb82){if(this[_0xd43e('0x12')][_0x4acb82['transfertargetlinkedid']]){this['actions'][_0x4acb82[_0xd43e('0x14c')]]['transfer']=!![];}}};Preview[_0xd43e('0xd')][_0xd43e('0x23')]=function(_0x4199c2){if(_0x4199c2){if(this[_0xd43e('0x12')][_0x4199c2['transfererlinkedid']]){this[_0xd43e('0x12')][_0x4199c2[_0xd43e('0x14d')]][_0xd43e('0x141')]=!![];}}};module[_0xd43e('0x14e')]=Preview; \ No newline at end of file +var _0x2dab=['[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','run','execRun','unlockContact','getContactPreview','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','Contact','phone','substring','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','user:%s','user:agentconnect','accountcode','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','idContact','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./util/util','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','blindtransfer','syncBlindTransfer','emit','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','sendMessageOneNotActive','originated','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','setMessage','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','ListId','Action','status','channel','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','then','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','catch','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','answered','[16]','totalGlobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','outboundCongestionCallsDay','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dab,0x1c6));var _0xb2da=function(_0x2dcd3d,_0x1c296a){_0x2dcd3d=_0x2dcd3d-0x0;var _0x394515=_0x2dab[_0x2dcd3d];return _0x394515;};'use strict';var util=require(_0xb2da('0x0'));var _=require(_0xb2da('0x1'));var BPromise=require(_0xb2da('0x2'));var uuid=require('uuid');var moment=require(_0xb2da('0x3'));var md5=require(_0xb2da('0x4'));var Redis=require('ioredis');var config=require(_0xb2da('0x5'));var logger=require('../../../config/logger')(_0xb2da('0x6'));var loggerAction=require(_0xb2da('0x7'))(_0xb2da('0x8'));var ami=require(_0xb2da('0x9'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xb2da('0xa'));config[_0xb2da('0xb')]=_['defaults'](config[_0xb2da('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb2da('0xb')]));var Sequence=function(){};Sequence[_0xb2da('0xc')][_0xb2da('0xd')]=function(_0x4d2978){this[_0xb2da('0xe')]=this[_0xb2da('0xe')]?this['tail'][_0xb2da('0xf')](_0x4d2978):_0x4d2978();};function Preview(_0x107333){this[_0xb2da('0x10')]=new Sequence();this[_0xb2da('0x11')]=_0x107333[_0xb2da('0x12')];this[_0xb2da('0x13')]=_0x107333['trunks'];this[_0xb2da('0x14')]={};this[_0xb2da('0x15')]=_0x107333[_0xb2da('0x15')];this[_0xb2da('0x16')]=0x0;ami['on'](_0xb2da('0x17'),this[_0xb2da('0x18')][_0xb2da('0x19')](this));ami['on']('hangup',this[_0xb2da('0x1a')]['bind'](this));ami['on'](_0xb2da('0x1b'),this[_0xb2da('0x1c')]['bind'](this));ami['on']('dialend',this[_0xb2da('0x1d')]['bind'](this));ami['on']('newexten',this[_0xb2da('0x1e')][_0xb2da('0x19')](this));ami['on'](_0xb2da('0x1f'),this[_0xb2da('0x20')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xb2da('0x21'),this[_0xb2da('0x22')]['bind'](this));this['loopCampaigns'](this[_0xb2da('0x11')]);}function emit(_0x3a1520,_0x3685d4,_0x474897){io['to'](_0x3a1520)[_0xb2da('0x23')](_0x3685d4,_0x474897);}function emitCampaignPreview(_0x15a0a5){if(_0x15a0a5['type']===_0xb2da('0x24')){var _0x36b780={'id':_0x15a0a5['id'],'name':_0x15a0a5[_0xb2da('0x25')],'strategy':_0x15a0a5[_0xb2da('0x26')],'answered':_0x15a0a5['answered'],'available':_0x15a0a5[_0xb2da('0x27')],'loggedIn':_0x15a0a5[_0xb2da('0x28')],'pTalking':_0x15a0a5[_0xb2da('0x29')],'sumBillable':_0x15a0a5[_0xb2da('0x2a')],'sumDuration':_0x15a0a5[_0xb2da('0x2b')],'sumHoldTime':_0x15a0a5['sumHoldTime']||0x0,'talking':_0x15a0a5[_0xb2da('0x2c')],'total':_0x15a0a5[_0xb2da('0x2d')],'type':_0x15a0a5[_0xb2da('0x2e')],'unmanaged':_0x15a0a5['unmanaged'],'abandoned':_0x15a0a5[_0xb2da('0x2f')],'waiting':_0x15a0a5[_0xb2da('0x30')],'loggedInDb':_0x15a0a5[_0xb2da('0x31')],'dialActive':_0x15a0a5[_0xb2da('0x32')],'dialMethod':_0x15a0a5['dialMethod'],'dialOriginateCallerIdName':_0x15a0a5[_0xb2da('0x33')],'dialOriginateCallerIdNumber':_0x15a0a5['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x15a0a5[_0xb2da('0x34')],'dialPrefix':_0x15a0a5[_0xb2da('0x35')],'outboundAnswerAgiCallsDay':_0x15a0a5[_0xb2da('0x36')],'outboundAnswerCallsDay':_0x15a0a5[_0xb2da('0x37')],'outboundBlacklistCallsDay':_0x15a0a5[_0xb2da('0x38')],'outboundBusyCallsDay':_0x15a0a5[_0xb2da('0x39')],'outboundCongestionCallsDay':_0x15a0a5['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x15a0a5[_0xb2da('0x3a')],'outboundDropCallsDayCallersExit':_0x15a0a5[_0xb2da('0x3b')],'outboundDropCallsDayTimeout':_0x15a0a5[_0xb2da('0x3c')],'outboundNoAnswerCallsDay':_0x15a0a5[_0xb2da('0x3d')],'outboundNoSuchCallsDay':_0x15a0a5[_0xb2da('0x3e')],'outboundOriginateFailureCallsDay':_0x15a0a5[_0xb2da('0x3f')],'outboundReCallsDay':_0x15a0a5[_0xb2da('0x40')],'outboundRejectCallsDay':_0x15a0a5[_0xb2da('0x41')],'outboundUnknownCallsDay':_0x15a0a5[_0xb2da('0x42')],'outboundAbandonedCallsDay':_0x15a0a5[_0xb2da('0x43')],'predictiveIntervalAnsweredCalls':_0x15a0a5['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x15a0a5[_0xb2da('0x44')],'predictiveIntervalAvgTalktime':_0x15a0a5[_0xb2da('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x15a0a5['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x15a0a5[_0xb2da('0x46')],'predictiveIntervalErlangCalls':_0x15a0a5[_0xb2da('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x15a0a5[_0xb2da('0x48')],'predictiveIntervalHitRate':_0x15a0a5[_0xb2da('0x49')],'predictiveIntervalMultiplicativeFactor':_0x15a0a5['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x15a0a5['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x15a0a5[_0xb2da('0x4a')],'predictiveIntervalTotalCalls':_0x15a0a5[_0xb2da('0x4b')],'message':_0x15a0a5[_0xb2da('0x4c')],'originated':_0x15a0a5['originated'],'erlangCalls':_0x15a0a5['erlangCalls'],'erlangCallToSecond':_0x15a0a5[_0xb2da('0x4d')],'erlangAbandonmentRate':_0x15a0a5[_0xb2da('0x4e')],'erlangBusyFactor':_0x15a0a5[_0xb2da('0x4f')],'startPredictive':_0x15a0a5[_0xb2da('0x50')],'startProgressive':_0x15a0a5[_0xb2da('0x51')]};if(_0x15a0a5['Trunk']){_0x36b780[_0xb2da('0x52')]={'id':_0x15a0a5[_0xb2da('0x52')]['id'],'name':_0x15a0a5[_0xb2da('0x52')][_0xb2da('0x25')],'active':_0x15a0a5['Trunk'][_0xb2da('0x53')],'callerid':_0x15a0a5['Trunk']['callerid']};}if(_0x15a0a5['Interval']){_0x36b780[_0xb2da('0x54')]={'id':_0x15a0a5[_0xb2da('0x54')]['id'],'name':_0x15a0a5[_0xb2da('0x54')][_0xb2da('0x25')]};}var _0x326e53=md5(JSON['stringify'](_0x36b780));if(_0x15a0a5[_0xb2da('0x4')]!==_0x326e53){_0x15a0a5[_0xb2da('0x4')]=_0x326e53;emit(util['format'](_0xb2da('0x55'),_0x36b780[_0xb2da('0x25')]),_0xb2da('0x56'),_0x36b780);}}}function emitVoiceQueueChannelRemove(_0x3d229d){logger[_0xb2da('0x57')](_0xb2da('0x58'),JSON[_0xb2da('0x59')](_0x3d229d));emit(util[_0xb2da('0x5a')](_0xb2da('0x55'),_0x3d229d['name']),'voice_queue_channel:remove',_0x3d229d);io[_0xb2da('0x23')]('voice_queue_presence:remove',_0x3d229d);}function notSendMessagesQueue(_0x45c39d){if(_0x45c39d[_0xb2da('0x5b')]){if(_0x45c39d[_0xb2da('0x5c')]===0x0&&_0x45c39d[_0xb2da('0x29')]===0x0){_0x45c39d[_0xb2da('0x5b')]=![];_0x45c39d[_0xb2da('0x27')]=0x0;_0x45c39d[_0xb2da('0x5d')]=0x0;_0x45c39d[_0xb2da('0x4c')]='NOT_ACTIVE';ut[_0xb2da('0x5e')](_0xb2da('0x5f'),_0x45c39d['name']+'\x20is\x20not\x20active');}else{_0x45c39d['message']='IS_DISACTIVED';ut[_0xb2da('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x45c39d[_0xb2da('0x25')]+'\x20is\x20disactive');}emitCampaignPreview(_0x45c39d);}}Preview[_0xb2da('0xc')][_0xb2da('0x60')]=function(){var _0x338675=this;setInterval(function(){_0x338675[_0xb2da('0x61')]();},0x7cf);};Preview[_0xb2da('0xc')][_0xb2da('0x61')]=function(){var _0x2839cf=this[_0xb2da('0x11')];this[_0xb2da('0x16')]+=0x1;for(var _0x4436d6 in _0x2839cf){if(_0x2839cf[_0xb2da('0x62')](_0x4436d6)&&(_0x2839cf[_0x4436d6][_0xb2da('0x63')]===_0xb2da('0x6')||_0x2839cf[_0x4436d6][_0xb2da('0x63')]==='booked')&&_0x2839cf[_0x4436d6][_0xb2da('0x2e')]===_0xb2da('0x24')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xb2da('0x64')]();}}if(_0x2839cf[_0xb2da('0x62')](_0x4436d6)&&_0x2839cf[_0x4436d6][_0xb2da('0x63')]===_0xb2da('0x6')&&_0x2839cf[_0x4436d6][_0xb2da('0x2e')]===_0xb2da('0x24')){if(_0x2839cf[_0x4436d6][_0xb2da('0x32')]){this[_0xb2da('0x65')](_0x2839cf[_0x4436d6]);this['recallMe'](_0x2839cf[_0x4436d6]);}else{notSendMessagesQueue(_0x2839cf[_0x4436d6]);}}}};Preview['prototype'][_0xb2da('0x66')]=function(_0x2b6850){var _0x163ff9=this;this[_0xb2da('0x10')][_0xb2da('0xd')](function(){if(!_[_0xb2da('0x67')](_0x163ff9['actions'][_0x2b6850])){loggerAction[_0xb2da('0x57')]('[clearZombieChannels][talking]',_0x2b6850,_0xb2da('0x68'),_0x163ff9[_0xb2da('0x14')][_0x2b6850][_0xb2da('0x69')],_0xb2da('0x6a'),JSON[_0xb2da('0x59')](_0x163ff9['campaignsPreview'][_0x163ff9[_0xb2da('0x14')][_0x2b6850]['queue']][_0xb2da('0x5c')]),_0xb2da('0x6b'),JSON[_0xb2da('0x59')](_0x163ff9['campaignsPreview'][_0x163ff9['actions'][_0x2b6850]['queue']]['pTalking']),JSON[_0xb2da('0x59')](_0x163ff9[_0xb2da('0x14')][_0x2b6850][_0xb2da('0x6c')]),JSON[_0xb2da('0x59')](_[_0xb2da('0x6d')](_0x163ff9['actions'][_0x2b6850],[_0xb2da('0x6e'),'UserId','VoiceQueueId',_0xb2da('0x6f')])));return ami[_0xb2da('0x70')]({'action':_0xb2da('0x71'),'channel':_0x163ff9[_0xb2da('0x14')][_0x2b6850][_0xb2da('0x72')]})['catch'](function(_0x1c23f0){if(_0x1c23f0[_0xb2da('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x163ff9[_0xb2da('0x14')][_0x2b6850]){ut['updateOriginated'](_0x163ff9['campaignsPreview'][_0x163ff9[_0xb2da('0x14')][_0x2b6850][_0xb2da('0x69')]],_0xb2da('0x73'));if(_0x163ff9[_0xb2da('0x14')][_0x2b6850]['dialAnswer']===!![]){ut[_0xb2da('0x74')](_0x163ff9[_0xb2da('0x11')][_0x163ff9[_0xb2da('0x14')][_0x2b6850][_0xb2da('0x69')]],'[clearZombieChannel]');ut['loggerError'](_0xb2da('0x75')+_0x2b6850,_0x163ff9['actions'][_0x2b6850][_0xb2da('0x69')]);}ut[_0xb2da('0x76')](_0xb2da('0x77')+_0x2b6850,_0x163ff9[_0xb2da('0x14')][_0x2b6850][_0xb2da('0x69')]);delete _0x163ff9[_0xb2da('0x14')][_0x2b6850];}},0x2328);}});}});};Preview[_0xb2da('0xc')]['clearZombieChannels']=function(){var _0x464137=this;loggerAction['info'](_0xb2da('0x78'),_[_0xb2da('0x79')](this['actions']));for(var _0x327080 in this[_0xb2da('0x14')]){if(_0x464137[_0xb2da('0x14')][_0xb2da('0x62')](_0x327080)){_0x464137[_0xb2da('0x66')](_0x327080);}}};Preview[_0xb2da('0xc')]['recallMe']=function(_0x165e0e){var _0x22788c=this;rpcDb['getContactRecallMe'](_0x165e0e['id'],ut[_0xb2da('0x7a')](this[_0xb2da('0x15')]))['then'](function(_0x150997){if(!_['isNil'](_0x150997)){for(var _0x372ae8=0x0;_0x372ae8<_0x150997[_0xb2da('0x7b')];_0x372ae8+=0x1){if(ut[_0xb2da('0x7c')](_0x150997[_0x372ae8][_0xb2da('0x7d')])<_0x165e0e[_0xb2da('0x7e')]*0x3c){if(_0x150997[_0x372ae8][_0xb2da('0x7f')]&&!_0x150997[_0x372ae8][_0xb2da('0x7f')][_0xb2da('0x80')]){_0x22788c['run'](_0x150997[_0x372ae8]['id'])[_0xb2da('0x81')](ut['logger2'](_0xb2da('0x82')))['catch'](ut['logger2'](_0xb2da('0x82')));}else{rpcDb[_0xb2da('0x83')](_0x150997[_0x372ae8]['id']);}}else{var _0x19f262=new Action(_0x150997[_0x372ae8],_0x165e0e);_0x19f262[_0xb2da('0x84')]=moment()['format'](_0xb2da('0x85'));_0x165e0e['outboundReCallsDay']+=0x1;ut[_0xb2da('0x86')](_0x19f262,0x17,'RecallInQueue');if(_0x165e0e[_0xb2da('0x87')]){rpcDb[_0xb2da('0x88')](ut[_0xb2da('0x89')](_0x150997[_0x372ae8]));rpcDb[_0xb2da('0x8a')](_0x19f262,_0xb2da('0x8b'));}else{ut[_0xb2da('0x86')](_0x19f262,0x16,_0xb2da('0x8c'));rpcDb[_0xb2da('0x8a')](_0x19f262,'[HistoryRecallClose]');rpcDb[_0xb2da('0x8d')](_0x19f262,_0xb2da('0x8e'));}}}}})[_0xb2da('0x8f')](ut['logger2'](_0xb2da('0x90')));};Preview[_0xb2da('0xc')][_0xb2da('0x65')]=function(_0x5826fb){_0x5826fb[_0xb2da('0x5b')]=!![];if(ut[_0xb2da('0x91')](_0x5826fb['loggedIn'])){_0x5826fb['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xb2da('0x92')](_0x5826fb['dialActive'])){_0x5826fb[_0xb2da('0x4c')]='NOT_ACTIVE';}else if(!this[_0xb2da('0x93')](_0x5826fb[_0xb2da('0x52')])){if(!this[_0xb2da('0x93')](_0x5826fb[_0xb2da('0x94')])){_0x5826fb[_0xb2da('0x4c')]=_0xb2da('0x95');}else{_0x5826fb[_0xb2da('0x4c')]=_0xb2da('0x96');}}else{_0x5826fb['message']=_0xb2da('0x96');}emitCampaignPreview(_0x5826fb);};Preview['prototype'][_0xb2da('0x97')]=function(_0x126e5d,_0x48395d,_0x1d9426){var _0x18e417=this;var _0x3f3702=this[_0xb2da('0x14')][_0x48395d];var _0x31a365=this[_0xb2da('0x11')][_0x3f3702['queue']];var _0xff655b;if(_0x31a365){switch(_0x1d9426){case'1':_0x31a365[_0xb2da('0x3e')]+=0x1;_0x3f3702[_0xb2da('0x98')]+=0x1;_0x3f3702[_0xb2da('0x99')]=ut['totalGlobal'](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x0,_0xb2da('0x9a'));ami['emit'](_0xb2da('0x9b'),ut[_0xb2da('0x9c')](_0x3f3702,_0xb2da('0x9d')));rpcDb[_0xb2da('0x8a')](_0x3f3702,_0xb2da('0x9e'));if(ut['totalGlobal'](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut['cloneAction'](_0x3f3702,0xf,'Global');rpcDb[_0xb2da('0x8d')](_0xff655b,_0xb2da('0xa0'));}else{if(_0x3f3702[_0xb2da('0x98')]>=_0x31a365[_0xb2da('0xa1')]){rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xa0'));}else{rpcDb[_0xb2da('0xa2')](ut[_0xb2da('0xa3')](_0x3f3702,'countnosuchnumberretry',_0x31a365[_0xb2da('0xa4')]),_0x3f3702['unlockAgent'],_0x3f3702[_0xb2da('0xa5')]);}}delete this[_0xb2da('0x14')][_0x126e5d[_0xb2da('0xa6')]];break;case _0xb2da('0xa7'):var _0x2f95b1=moment()[_0xb2da('0x5a')](_0xb2da('0x85'));_0x3f3702['responsetime']=_0x2f95b1;_0x3f3702[_0xb2da('0xa8')]=_0x2f95b1;_0x3f3702[_0xb2da('0x6c')]=!![];_0x31a365[_0xb2da('0x29')]+=0x1;logger[_0xb2da('0x57')](_0xb2da('0xa9'),_0x3f3702[_0xb2da('0xaa')],_0xb2da('0xab'),_0x31a365['name'],_0xb2da('0x6b'),_0x31a365[_0xb2da('0x29')]);ami[_0xb2da('0x23')](_0xb2da('0xac'),ut['buildObj'](_0x3f3702,'connect',this[_0xb2da('0x11')][_0x3f3702['queue']]));if(_0x31a365[_0xb2da('0xad')]){ami[_0xb2da('0x23')](_0xb2da('0xae'),ut['buildAcw'](_0x3f3702));}break;case'16':ami[_0xb2da('0x23')](_0xb2da('0xaf'),ut[_0xb2da('0x9c')](_0x3f3702,_0xb2da('0xb0'),this['campaignsPreview'][_0x3f3702[_0xb2da('0x69')]]));emitVoiceQueueChannelRemove(ut[_0xb2da('0x9c')](_0x3f3702,'complete'));_0x31a365['outboundAnswerCallsDay']+=0x1;_0x31a365[_0xb2da('0x2d')]+=0x1;_0x31a365[_0xb2da('0xb1')]+=0x1;ut[_0xb2da('0x74')](_0x31a365,_0xb2da('0xb2'));_0x3f3702['countglobal']=ut[_0xb2da('0xb3')](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x4,'Answer');rpcDb['createCustomerHistory'](_0x3f3702,_0xb2da('0xb4'));rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xb5'));rpcDb[_0xb2da('0xb6')](_0x3f3702);_0x31a365[_0xb2da('0x2b')]+=_0x3f3702[_0xb2da('0xb7')];_0x31a365[_0xb2da('0x2a')]+=_0x3f3702[_0xb2da('0xb7')];logger[_0xb2da('0x57')]('[syncHangup][talking][decrement]',_0x3f3702[_0xb2da('0xaa')],_0xb2da('0xab'),_0x31a365[_0xb2da('0x25')],_0xb2da('0x6b'),_0x31a365['pTalking']);delete this[_0xb2da('0x14')][_0x126e5d['linkedid']];break;case _0xb2da('0xb8'):_0x31a365['outboundBusyCallsDay']+=0x1;_0x3f3702['countbusyretry']+=0x1;_0x3f3702[_0xb2da('0x99')]=ut[_0xb2da('0xb3')](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x5,_0xb2da('0xb9'));ami[_0xb2da('0x23')](_0xb2da('0xba'),ut[_0xb2da('0x9c')](_0x3f3702,_0xb2da('0xbb')));rpcDb['createCustomerHistory'](_0x3f3702,_0xb2da('0xbc'));if(ut[_0xb2da('0xb3')](_0x3f3702)>=_0x31a365['dialGlobalMaxRetry']){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,'Global');rpcDb[_0xb2da('0x8d')](_0xff655b,_0xb2da('0xbe'));}else{if(_0x3f3702[_0xb2da('0xbf')]>=_0x31a365[_0xb2da('0xc0')]){rpcDb[_0xb2da('0x8d')](_0x3f3702,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xb2da('0xa2')](ut[_0xb2da('0xa3')](_0x3f3702,_0xb2da('0xbf'),_0x31a365[_0xb2da('0xc1')]),_0x3f3702['unlockAgent'],_0x3f3702[_0xb2da('0xa5')]);}}break;case _0xb2da('0xc2'):_0x31a365[_0xb2da('0x3d')]+=0x1;_0x3f3702[_0xb2da('0xc3')]+=0x1;_0x3f3702[_0xb2da('0x99')]=ut[_0xb2da('0xb3')](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x3,_0xb2da('0xc4'));ami[_0xb2da('0x23')](_0xb2da('0xc5'),ut[_0xb2da('0x9c')](_0x3f3702,'noanswer'));rpcDb[_0xb2da('0x8a')](_0x3f3702,_0xb2da('0xc6'));if(ut[_0xb2da('0xb3')](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,_0xb2da('0xc7'));rpcDb[_0xb2da('0x8d')](_0xff655b,_0xb2da('0xc8'));}else{if(_0x3f3702[_0xb2da('0xc3')]>=_0x31a365[_0xb2da('0xc9')]){rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xc6'));}else{rpcDb[_0xb2da('0xa2')](ut['scheduledAt'](_0x3f3702,_0xb2da('0xc3'),_0x31a365[_0xb2da('0xca')]),_0x3f3702[_0xb2da('0xcb')],_0x3f3702[_0xb2da('0xa5')]);}}break;case'CONGESTION':_0x31a365[_0xb2da('0xcc')]+=0x1;_0x3f3702['countcongestionretry']+=0x1;_0x3f3702[_0xb2da('0x99')]=ut[_0xb2da('0xb3')](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x8,'Congestion');ami[_0xb2da('0x23')]('custom:agentcongestion',ut[_0xb2da('0x9c')](_0x3f3702,_0xb2da('0xcd')));rpcDb['createCustomerHistory'](_0x3f3702,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xb2da('0xb3')](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,_0xb2da('0xc7'));rpcDb[_0xb2da('0x8d')](_0xff655b,_0xb2da('0xce'));}else{if(_0x3f3702[_0xb2da('0xcf')]>=_0x31a365[_0xb2da('0xd0')]){rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xd1'));}else{rpcDb[_0xb2da('0xa2')](ut[_0xb2da('0xa3')](_0x3f3702,_0xb2da('0xcf'),_0x31a365[_0xb2da('0xc1')]),_0x3f3702[_0xb2da('0xcb')],_0x3f3702[_0xb2da('0xa5')]);}}break;case _0xb2da('0xd2'):_0x31a365[_0xb2da('0x41')]+=0x1;_0x3f3702[_0xb2da('0xd3')]+=0x1;_0x3f3702[_0xb2da('0x99')]=ut[_0xb2da('0xb3')](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x14,_0xb2da('0xd4'));ami['emit']('custom:agentreject',ut[_0xb2da('0x9c')](_0x3f3702,_0xb2da('0xd5')));rpcDb[_0xb2da('0x8a')](_0x3f3702,_0xb2da('0xd6'));if(ut[_0xb2da('0xb3')](_0x3f3702)>=_0x31a365['dialGlobalMaxRetry']){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0x14,_0xb2da('0xd4'));rpcDb['createCustomerFinal'](_0xff655b,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3f3702[_0xb2da('0xd3')]>=_0x31a365[_0xb2da('0xd7')]){rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xd8'));}else{rpcDb[_0xb2da('0xa2')](ut[_0xb2da('0xa3')](_0x3f3702,'countagentrejectretry',_0x31a365[_0xb2da('0xd9')]),_0x3f3702[_0xb2da('0xcb')],_0x3f3702[_0xb2da('0xa5')]);}}break;case _0xb2da('0xda'):_0x31a365[_0xb2da('0x43')]+=0x1;_0x3f3702[_0xb2da('0xdb')]+=0x1;_0x3f3702[_0xb2da('0x99')]=ut[_0xb2da('0xb3')](_0x3f3702);ut['logCustomer'](_0x3f3702,0xb,'Abandoned');rpcDb[_0xb2da('0x8a')](_0x3f3702,_0xb2da('0xdc'));if(ut['totalGlobal'](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,_0xb2da('0xc7'));rpcDb[_0xb2da('0x8d')](_0xff655b,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3f3702[_0xb2da('0xdd')]>=_0x31a365[_0xb2da('0xde')]){rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xdc'));}else{rpcDb[_0xb2da('0xa2')](ut['scheduledAt'](_0x3f3702,_0xb2da('0xdb'),_0x31a365['dialAbandonedRetryFrequency']),_0x3f3702[_0xb2da('0xcb')],_0x3f3702[_0xb2da('0xa5')]);}}break;case'18':_0x31a365['outboundUnknownCallsDay']+=0x1;_0x3f3702['countmachineretry']+=0x1;_0x3f3702[_0xb2da('0x99')]=ut['totalGlobal'](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x12,_0x126e5d[_0xb2da('0xdf')]||_0x126e5d[_0xb2da('0xe0')]);ami['emit']('custom:amd',ut['buildObj'](_0x3f3702,_0xb2da('0xe1')));rpcDb[_0xb2da('0x8a')](_0x3f3702,'[callProgressDetectingCustomer][hangupInAMD]');if(ut['totalGlobal'](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,'Global');rpcDb['createCustomerFinal'](_0xff655b,_0xb2da('0xe2'));}else{rpcDb[_0xb2da('0x8d')](_0x3f3702,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x126e5d[_0xb2da('0xa6')]];break;case'19':_0x31a365['outboundUnknownCallsDay']+=0x1;_0x3f3702[_0xb2da('0x99')]=ut['totalGlobal'](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0x13,_0x126e5d['cause-txt']||_0x126e5d[_0xb2da('0xe0')]);ami[_0xb2da('0x23')]('custom:amd',ut[_0xb2da('0x9c')](_0x3f3702,_0xb2da('0xe1')));rpcDb[_0xb2da('0x8a')](_0x3f3702,_0xb2da('0xe3'));if(ut['totalGlobal'](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,_0xb2da('0xc7'));rpcDb[_0xb2da('0x8d')](_0xff655b,_0xb2da('0xe3'));}else{rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xe3'));}delete this[_0xb2da('0x14')][_0x126e5d[_0xb2da('0xa6')]];break;default:if(_0x3f3702['dialAnswer']){ut['decrementTalkink'](_0x31a365,_0xb2da('0xe4'));ut[_0xb2da('0x76')](_0xb2da('0xe5')+_0x31a365[_0xb2da('0x25')],_0x126e5d);}_0x31a365['outboundUnknownCallsDay']+=0x1;_0x3f3702['countglobal']=ut['totalGlobal'](_0x3f3702);ut[_0xb2da('0x86')](_0x3f3702,0xc,_0x126e5d[_0xb2da('0xdf')]||_0x126e5d[_0xb2da('0xe0')]);rpcDb[_0xb2da('0x8a')](_0x3f3702,_0xb2da('0xe6'));if(ut['totalGlobal'](_0x3f3702)>=_0x31a365[_0xb2da('0x9f')]){_0xff655b=ut[_0xb2da('0xbd')](_0x3f3702,0xf,_0xb2da('0xc7'));rpcDb['createCustomerFinal'](_0xff655b,_0xb2da('0xe7'));}else{rpcDb[_0xb2da('0x8d')](_0x3f3702,_0xb2da('0xe7'));}delete this[_0xb2da('0x14')][_0x126e5d['linkedid']];}if(!(_0x3f3702[_0xb2da('0x6c')]&&_0x1d9426==='16')){ut[_0xb2da('0xe8')](_0x31a365,_0xb2da('0xe9'));logger[_0xb2da('0x57')]('[originated][decrement][callProgressDetectingCustomer]',_0x3f3702[_0xb2da('0xaa')],'\x20Queue',_0x31a365[_0xb2da('0x25')],'originated:\x20',_0x31a365[_0xb2da('0x5c')]);}if(_0x1d9426!=='ANSWER'){delete this[_0xb2da('0x14')][_0x126e5d['linkedid']];delete this[_0xb2da('0x14')][_0x126e5d['destlinkedid']];}}};Preview[_0xb2da('0xc')]['callProgressDetectingAgent']=function(_0x41084a,_0x158cc7,_0x24486d){if(_[_0xb2da('0xea')](_0x158cc7)&&'object'!==typeof _0x158cc7){return;}if(_[_0xb2da('0xea')](_0x24486d)&&_0xb2da('0xeb')!==typeof _0x24486d){return;}switch(_0x24486d[_0xb2da('0xec')]){case'0':ut[_0xb2da('0xed')](_0x41084a,0x0,_0xb2da('0x9a'));rpcDb['createAgentHistory'](_0x41084a,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xb2da('0xed')](_0x41084a,0x3,_0xb2da('0xc4'));rpcDb[_0xb2da('0xee')](_0x41084a,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x41084a,0x5,'Busy');rpcDb['createAgentHistory'](_0x41084a,_0xb2da('0xef'));break;case'8':ut[_0xb2da('0xed')](_0x41084a,0x8,_0xb2da('0xf0'));rpcDb[_0xb2da('0xee')](_0x41084a,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xb2da('0xed')](_0x41084a,0x16,_0xb2da('0xf1'));rpcDb[_0xb2da('0xee')](_0x41084a,_0xb2da('0xf2'));break;default:ut[_0xb2da('0xed')](_0x41084a,0xc,_0x24486d['reason']);rpcDb[_0xb2da('0xee')](_0x41084a,_0xb2da('0xf3'));}ut['updateOriginated'](_0x158cc7,'[callProgressDetectingAgent]');logger[_0xb2da('0x57')]('[originated][decrement][callProgressDetectingAgent]',_0x41084a[_0xb2da('0xaa')],_0xb2da('0xab'),_0x158cc7[_0xb2da('0x25')],'originated:\x20',_0x158cc7[_0xb2da('0x5c')]);delete this[_0xb2da('0x14')][_0x41084a['uniqueid']];};Preview[_0xb2da('0xc')]['checkInBlack']=function(_0x13b7fa,_0x3d6b2f,_0x25ae96,_0x2c727f,_0x4253d0){var _0x139979=this;return new BPromise(function(_0x3f6032,_0x2db7df){if(_[_0xb2da('0x67')](_0x3d6b2f)||_['isNil'](_0x3d6b2f['Contact'])||_[_0xb2da('0x67')](_0x3d6b2f['Contact']['phone'])||_[_0xb2da('0x67')](_0x3d6b2f[_0xb2da('0xf4')])){_0x2db7df(ut['message'](_0xb2da('0xf5'),_0x2c727f,_0x4253d0));return;}var _0x39f361=uuid['v4']();var _0x704a69=_0x139979[_0xb2da('0x11')][_0x3d6b2f['Queue'][_0xb2da('0x25')]];var _0x5b2075=_0x25ae96?_0x139979[_0xb2da('0x15')][_0x25ae96]['id']:undefined;_0x139979[_0xb2da('0x14')][_0x39f361]=new Action(_0x3d6b2f,_0x704a69,_0x39f361,_0x25ae96,_0x5b2075);var _0x1c42fa=_0x139979[_0xb2da('0x14')][_0x39f361];_0x1c42fa[_0xb2da('0xcb')]=_0x2c727f;_0x1c42fa[_0xb2da('0xa5')]=_0x4253d0;_0x1c42fa[_0xb2da('0xf6')]=_0x25ae96;if(_[_0xb2da('0xf7')](_0x13b7fa)){_0x139979[_0xb2da('0xf8')](_0x1c42fa,_0x704a69,_0x3d6b2f,_0x25ae96)[_0xb2da('0x81')](function(_0x56ca47){logger[_0xb2da('0x57')](_0xb2da('0xf9'),_0xb2da('0xfa')+_0x1c42fa[_0xb2da('0x69')]+_0xb2da('0xfb')+_0x1c42fa['idContact'],JSON[_0xb2da('0x59')](_0x56ca47));ami[_0xb2da('0x23')]('custom:agentcalled',ut[_0xb2da('0x9c')](_0x1c42fa,'called',_0x139979[_0xb2da('0x11')][_0x1c42fa['queue']]));_0x3f6032(ut['message'](_0xb2da('0xfc')));})[_0xb2da('0x8f')](function(_0x499663){ut[_0xb2da('0x5e')](_0xb2da('0xfd'),_0x499663);_0x2db7df(ut[_0xb2da('0x4c')](_0xb2da('0xfe'),_0x2c727f,_0x4253d0));});}else{_0x704a69[_0xb2da('0x38')]+=0x1;ut['logBlacklist'](_0x1c42fa);rpcDb[_0xb2da('0xff')](_0x1c42fa,_0xb2da('0x100'));delete _0x139979['actions'][_0x39f361];_0x2db7df(ut[_0xb2da('0x4c')](_0xb2da('0x101'),_0x2c727f,_0x4253d0));}});};Preview['prototype'][_0xb2da('0x93')]=function(_0x3cf60f){return!_[_0xb2da('0x67')](_0x3cf60f)&&!_[_0xb2da('0x67')](_0x3cf60f[_0xb2da('0x25')])&&!_[_0xb2da('0x67')](_0x3cf60f['active'])&&_0x3cf60f[_0xb2da('0x53')]&&!_[_0xb2da('0x67')](this[_0xb2da('0x13')][util[_0xb2da('0x5a')](_0xb2da('0x102'),_0x3cf60f[_0xb2da('0x25')])])&&!_[_0xb2da('0x67')](this[_0xb2da('0x13')][util[_0xb2da('0x5a')](_0xb2da('0x102'),_0x3cf60f['name'])][_0xb2da('0x71')])&&(this['trunks'][util[_0xb2da('0x5a')](_0xb2da('0x102'),_0x3cf60f[_0xb2da('0x25')])][_0xb2da('0x71')]==='reachable'||this[_0xb2da('0x13')][util[_0xb2da('0x5a')](_0xb2da('0x102'),_0x3cf60f[_0xb2da('0x25')])]['status']==='unmonitored');};Preview[_0xb2da('0xc')][_0xb2da('0x103')]=function(_0x553cd2,_0x41c027){var _0x351502=this;return new BPromise(function(_0x3f2e9c,_0x4cf1f6){_0x351502[_0xb2da('0x104')](_0x553cd2,_0x41c027)['then'](function(_0x42fac5){_0x3f2e9c(_['pick'](_0x42fac5,['message']));})['catch'](function(_0x233b8d){if(_0x233b8d['unlock']){rpcDb[_0xb2da('0x105')](_0x553cd2);}if(_0x233b8d[_0xb2da('0x53')]){rpcDb[_0xb2da('0x83')](_0x553cd2);}_0x4cf1f6(_['pick'](_0x233b8d,[_0xb2da('0x4c')]));});});};Preview[_0xb2da('0xc')][_0xb2da('0x104')]=function(_0x3591fc,_0xf93a85){var _0x580a6a=this;return new BPromise(function(_0x268fd6,_0x3ae513){var _0x368f13,_0x54098b;rpcDb[_0xb2da('0x106')](_0x3591fc)[_0xb2da('0x81')](function(_0x38f8b1){if(!_[_0xb2da('0x67')](_0x38f8b1[0x0])){_0x54098b=_0x38f8b1[0x0]['recallme']?![]:!![];_0x368f13=_0x38f8b1[0x0]['recallme']?!![]:![];_0x368f13=_0xf93a85?!![]:_0x368f13;}var _0x53f037=_0x580a6a[_0xb2da('0x107')](_0x38f8b1);if(_0x53f037[_0xb2da('0x108')]){rpcDb[_0xb2da('0x109')](_[_0xb2da('0x6d')](_0x38f8b1[0x0],[_0xb2da('0xf4'),'Contact.phone']))[_0xb2da('0x81')](function(_0x1a47cc){_0x580a6a[_0xb2da('0x10a')](_0x1a47cc,_0x38f8b1[0x0],_0xf93a85,_0x54098b,_0x368f13)[_0xb2da('0x81')](function(_0x11a33e){_0x268fd6(_0x11a33e);})[_0xb2da('0x8f')](function(_0xf737eb){_0x3ae513(_0xf737eb);});})[_0xb2da('0x8f')](function(_0x6f3345){ut[_0xb2da('0x5e')](_0xb2da('0x10b'),_0x6f3345);_0x3ae513(ut['message']('Call\x20unsuccessful',_0x54098b,_0x368f13));});}else{_0x3ae513(ut[_0xb2da('0x4c')](_0x53f037[_0xb2da('0x4c')],_0x54098b,_0x368f13));}})['catch'](function(_0x5cd7cb){ut['logger']('[Preview][getContactPreview]',_0x5cd7cb);_0x3ae513(ut['message'](_0xb2da('0x10c'),![],!![]));});});};Preview['prototype'][_0xb2da('0x107')]=function(_0x2c690e){if(_[_0xb2da('0x67')](_0x2c690e)||_[_0xb2da('0xf7')](_0x2c690e)||!_[_0xb2da('0x67')](_0x2c690e[0x0][_0xb2da('0x7f')])&&_[_0xb2da('0x67')](_0x2c690e[0x0][_0xb2da('0x7f')]['name'])){ut[_0xb2da('0x5e')](_0xb2da('0x10d'),_0x2c690e);return{'isValid':![],'message':_0xb2da('0x10e')};}var _0x5cdb45=this[_0xb2da('0x11')][_0x2c690e[0x0][_0xb2da('0x68')]['name']];_0x5cdb45['message']=_0xb2da('0x96');if(_[_0xb2da('0x67')](_0x5cdb45)){ut[_0xb2da('0x5e')](_0xb2da('0x10f'),_0x5cdb45);return{'isValid':![],'message':_0xb2da('0x110')};}if(!this[_0xb2da('0x93')](_0x5cdb45[_0xb2da('0x52')])){ut[_0xb2da('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xb2da('0x111')+_0x5cdb45[_0xb2da('0x25')]+_0xb2da('0x112'));if(!this[_0xb2da('0x93')](_0x5cdb45['TrunkBackup'])){ut['logger'](_0xb2da('0x113'),_0x5cdb45[_0xb2da('0x25')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xb2da('0x114')};}}if(!ut['isActive'](_0x5cdb45[_0xb2da('0x32')])){ut[_0xb2da('0x5e')](_0xb2da('0x115'),_0x5cdb45[_0xb2da('0x25')]+_0xb2da('0x116'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x5cdb45[_0xb2da('0x25')]+_0xb2da('0x116')};}return{'isValid':!![],'message':_0xb2da('0x117')};};Preview['prototype'][_0xb2da('0xf8')]=function(_0x3db6ad,_0x313351,_0x6d942d,_0x2032f7){var _0x4c1c4c=this;return new BPromise(function(_0x191a06,_0x128753){var _0x5f5113=_0x3db6ad[_0xb2da('0xaa')];var _0x2589c4=_0x4c1c4c[_0xb2da('0x93')](_0x313351[_0xb2da('0x52')])?util['format'](_0xb2da('0x118'),_0x313351[_0xb2da('0x52')]['name'],_[_0xb2da('0x67')](_0x313351[_0xb2da('0x35')])?'':_0x313351[_0xb2da('0x35')][_0xb2da('0x119')]()||'',_0x313351[_0xb2da('0x11a')]>0x0?_0x6d942d[_0xb2da('0x11b')][_0xb2da('0x11c')][_0xb2da('0x11d')](_0x313351[_0xb2da('0x11a')]):_0x6d942d['Contact'][_0xb2da('0x11c')]):util[_0xb2da('0x5a')](_0xb2da('0x118'),_[_0xb2da('0x67')](_0x313351[_0xb2da('0x94')])?_0x313351[_0xb2da('0x52')][_0xb2da('0x25')]:_0x313351[_0xb2da('0x94')][_0xb2da('0x25')],_[_0xb2da('0x67')](_0x313351[_0xb2da('0x35')])?'':_0x313351[_0xb2da('0x35')][_0xb2da('0x119')]()||'',_0x313351[_0xb2da('0x11a')]>0x0?_0x6d942d[_0xb2da('0x11b')]['phone']['substring'](_0x313351[_0xb2da('0x11a')]):_0x6d942d[_0xb2da('0x11b')]['phone']);var _0x48b82=_0x4c1c4c[_0xb2da('0x93')](_0x313351[_0xb2da('0x52')])?ut[_0xb2da('0x11e')](_0x313351[_0xb2da('0x52')][_0xb2da('0x11f')],_0x313351[_0xb2da('0x33')],_0x313351['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb2da('0x120')](_0x313351['dialOriginateCallerIdNumber'],_0x313351['dialRandomLastDigitCallerIdNumber']):_0x313351['dialOriginateCallerIdNumber']):ut[_0xb2da('0x11e')](_[_0xb2da('0x67')](_0x313351['TrunkBackup'])?_0x313351[_0xb2da('0x52')][_0xb2da('0x11f')]:_0x313351[_0xb2da('0x94')]['callerid'],_0x313351[_0xb2da('0x33')],_0x313351[_0xb2da('0x121')]>0x0?ut[_0xb2da('0x120')](_0x313351[_0xb2da('0x122')],_0x313351[_0xb2da('0x121')]):_0x313351['dialOriginateCallerIdNumber']);if(_0x48b82){_0x3db6ad[_0xb2da('0x123')]=ut[_0xb2da('0x124')](_0x48b82);_0x3db6ad[_0xb2da('0x125')]=ut[_0xb2da('0x126')](_0x48b82);}var _0x25fec3=ut[_0xb2da('0x127')](_0x313351,_0x6d942d,_0x2589c4,_0x48b82,_0x5f5113,_0x3db6ad);_['merge'](_0x3db6ad,ut[_0xb2da('0x128')](_0x25fec3));_0x3db6ad['starttime']=moment()['format'](_0xb2da('0x85'));ami[_0xb2da('0x70')](ut[_0xb2da('0x129')](_0x3db6ad,_0x313351,_0x25fec3,_0x3db6ad[_0xb2da('0xa5')],_0x2032f7))[_0xb2da('0x81')](function(_0x11a138){var _0x4dd487=_0x3db6ad['channelAgent'];if(!_['isNil'](_0x4dd487)){if(!_[_0xb2da('0x67')](_0x4c1c4c[_0xb2da('0x15')][_0x4dd487])){_0x4c1c4c[_0xb2da('0x15')][_0x4dd487]['destconnectedlinenum']=_0x3db6ad['calleridnum'];emit(util['format'](_0xb2da('0x12a'),_0x4c1c4c[_0xb2da('0x15')][_0x4dd487][_0xb2da('0x25')]),_0xb2da('0x12b'),{'destaccountcode':_0x4c1c4c[_0xb2da('0x15')][_0x4dd487][_0xb2da('0x12c')],'destconnectedlinenum':_0x3db6ad[_0xb2da('0x12d')]});}}_0x313351[_0xb2da('0x5c')]+=0x1;logger[_0xb2da('0x57')](_0xb2da('0x12e'),_0x5f5113,'\x20Queue',_0x313351['name'],_0xb2da('0x6a'),_0x313351['originated']);_0x191a06(_0x11a138);})[_0xb2da('0x8f')](function(_0x294dc7){ut[_0xb2da('0xed')](_0x3db6ad,0xe,_0xb2da('0x12f'));rpcDb[_0xb2da('0xee')](_0x3db6ad,_0xb2da('0x130'));_0x128753(_0x294dc7);});});};Preview['prototype'][_0xb2da('0x1e')]=function(_0x24509c){if(this[_0xb2da('0x14')][_0x24509c[_0xb2da('0xa6')]]){this[_0xb2da('0x14')][_0x24509c[_0xb2da('0xa6')]]['channel']=_0x24509c[_0xb2da('0x72')];}};Preview['prototype']['syncOriginateResponse']=function(_0x58dae2){var _0x12ffb0=this;var _0x178983=this[_0xb2da('0x14')][_0x58dae2['actionid']];if(_0x178983){if(_0x178983[_0xb2da('0xf6')]&&this[_0xb2da('0x15')][_0x178983['lookAgent']]){ut[_0xb2da('0x131')](_0x178983,this[_0xb2da('0x15')][_0x178983[_0xb2da('0xf6')]][_0xb2da('0x25')],this[_0xb2da('0x15')][_0x178983[_0xb2da('0xf6')]]['id']);}var _0x641927=_[_0xb2da('0x132')](_0x178983);_0x641927['responsetime']=moment()['format'](_0xb2da('0x85'));var _0x5e2310=_0x12ffb0[_0xb2da('0x11')][_0x178983['queue']];if(ut[_0xb2da('0x133')](_0x58dae2[_0xb2da('0x134')])){if(_0x178983[_0xb2da('0xcb')]){rpcDb[_0xb2da('0x105')](_0x178983[_0xb2da('0x135')]);}if(_0x178983[_0xb2da('0xa5')]){rpcDb[_0xb2da('0x83')](_0x178983[_0xb2da('0x135')]);}ami[_0xb2da('0x23')]('custom:agentringnoanswer',ut[_0xb2da('0x9c')](_0x178983,_0xb2da('0x136'),this['campaignsPreview'][_0x178983['queue']]));this[_0xb2da('0x137')](_0x641927,_0x5e2310,_0x58dae2);}else{_0x178983['starttime']=moment()[_0xb2da('0x5a')](_0xb2da('0x85'));ut[_0xb2da('0xed')](_0x641927,0x4,_0xb2da('0x138'));rpcDb[_0xb2da('0xee')](_0x641927,_0xb2da('0x139'));}}};Preview['prototype'][_0xb2da('0x1a')]=function(_0x3f0e5b){var _0xb844da=this;var _0x55ab20=this[_0xb2da('0x14')][_0x3f0e5b[_0xb2da('0xa6')]];var _0x2ef67b;if(_0x55ab20){_0x2ef67b=this[_0xb2da('0x11')][_0x55ab20[_0xb2da('0x69')]];logger[_0xb2da('0x57')](_0xb2da('0x13a'),_0x3f0e5b[_0xb2da('0xa6')],'\x20Queue',_0x2ef67b[_0xb2da('0x25')],_0xb2da('0x6b'),_0x2ef67b[_0xb2da('0x29')]);}if(this[_0xb2da('0x14')][_0x3f0e5b[_0xb2da('0xa6')]]&&_0x3f0e5b[_0xb2da('0xa6')]!==_0x3f0e5b['uniqueid']){if(_0x3f0e5b['cause']==='16'&&this[_0xb2da('0x14')][_0x3f0e5b[_0xb2da('0xa6')]][_0xb2da('0x6c')]){this['callProgressDetectingCustomer'](_0x3f0e5b,_0x3f0e5b[_0xb2da('0xa6')],_0x3f0e5b[_0xb2da('0x13b')]);}else if(this['actions'][_0x3f0e5b['linkedid']][_0xb2da('0x6c')]){logger[_0xb2da('0x57')]('[syncHangup][talking][cause]',_0x3f0e5b['linkedid'],_0x3f0e5b[_0xb2da('0x13b')],_0xb2da('0xab'),_0x2ef67b[_0xb2da('0x25')],_0xb2da('0x6b'),_0x2ef67b[_0xb2da('0x29')]);this[_0xb2da('0x97')](_0x3f0e5b,_0x3f0e5b['linkedid'],_0x3f0e5b['cause']);}}else if(_0x55ab20&&_[_0xb2da('0x67')](_0x55ab20[_0xb2da('0x13c')])&&_0x2ef67b[_0xb2da('0x13d')]&&_0x3f0e5b[_0xb2da('0xa6')]===_0x3f0e5b['uniqueid']&&_[_0xb2da('0x67')](_0x3f0e5b[_0xb2da('0xec')])&&_0x3f0e5b['cause']==='16'&&_0x3f0e5b[_0xb2da('0x13e')]==='6'&&_[_0xb2da('0xea')](_0x55ab20[_0xb2da('0x13f')])){if(_0x55ab20[_0xb2da('0xcb')]){rpcDb['unlockContact'](_0x55ab20[_0xb2da('0x135')]);}if(_0x55ab20[_0xb2da('0xa5')]){rpcDb[_0xb2da('0x83')](_0x55ab20[_0xb2da('0x135')]);}_0x3f0e5b[_0xb2da('0xec')]='22';this[_0xb2da('0x137')](_0x55ab20,_0x2ef67b,_0x3f0e5b);}else if(_0x55ab20&&_0x55ab20[_0xb2da('0x13f')]){if(_0x3f0e5b[_0xb2da('0x13b')]==='16'&&this[_0xb2da('0x14')][_0x3f0e5b['linkedid']]['dialAnswer']){logger[_0xb2da('0x57')](_0xb2da('0x140'),_0x3f0e5b[_0xb2da('0xa6')],_0x3f0e5b[_0xb2da('0x13b')],'\x20Queue',_0x2ef67b[_0xb2da('0x25')],_0xb2da('0x6b'),_0x2ef67b[_0xb2da('0x29')]);this[_0xb2da('0x97')](_0x3f0e5b,_0x3f0e5b[_0xb2da('0xa6')],_0x3f0e5b[_0xb2da('0x13b')]);}else if(this[_0xb2da('0x14')][_0x3f0e5b[_0xb2da('0xa6')]][_0xb2da('0x6c')]){logger['info']('[syncHangup][talking][cause]',_0x3f0e5b[_0xb2da('0xa6')],_0x3f0e5b[_0xb2da('0x13b')],'\x20Queue',_0x2ef67b['name'],'pTalking:\x20',_0x2ef67b[_0xb2da('0x29')]);this[_0xb2da('0x97')](_0x3f0e5b,_0x3f0e5b[_0xb2da('0xa6')],_0x3f0e5b['cause']);}}};Preview['prototype'][_0xb2da('0x1d')]=function(_0x79fefc){if(this['actions'][_0x79fefc[_0xb2da('0x141')]]&&_0x79fefc[_0xb2da('0x141')]!==_0x79fefc[_0xb2da('0x142')]){this[_0xb2da('0x97')](_0x79fefc,_0x79fefc['destlinkedid'],_0x79fefc[_0xb2da('0xe0')]);}};Preview[_0xb2da('0xc')][_0xb2da('0x1c')]=function(_0x303649){if(this[_0xb2da('0x14')][_0x303649[_0xb2da('0xa6')]]&&_0x303649[_0xb2da('0xa6')]!==_0x303649[_0xb2da('0xaa')]&&!this[_0xb2da('0x14')][_0x303649[_0xb2da('0xa6')]][_0xb2da('0x6c')]){if(_0x303649[_0xb2da('0x13b')]==='1'){this[_0xb2da('0x97')](_0x303649,_0x303649['linkedid'],_0x303649[_0xb2da('0x13b')]);}}};Preview[_0xb2da('0xc')][_0xb2da('0x143')]=function(_0x3a0429,_0x33644c,_0x420896){if(this['actions'][_0x3a0429]){if(_[_0xb2da('0x67')](this['actions'][_0x3a0429]['variables'])){this[_0xb2da('0x14')][_0x3a0429][_0xb2da('0x144')]={};}this[_0xb2da('0x14')][_0x3a0429][_0xb2da('0x144')][_0x33644c]=_0x420896;}};Preview['prototype'][_0xb2da('0x20')]=function(_0x45054b){try{if(!_[_0xb2da('0x67')](_0x45054b)){if(ut['filterKey'](_[_0xb2da('0x145')](_0x45054b['variable'])[0x0])){this[_0xb2da('0x143')](_0x45054b[_0xb2da('0xaa')],_[_0xb2da('0x145')](_0x45054b[_0xb2da('0x146')])[0x0],_0x45054b[_0xb2da('0x147')]);}}}catch(_0x5eaabe){logger[_0xb2da('0x148')](_0xb2da('0x149'),util[_0xb2da('0x14a')](_0x5eaabe,{'showHidden':![],'depth':null}));}};Preview[_0xb2da('0xc')][_0xb2da('0x14b')]=function(_0x26420c){if(_0x26420c){if(this[_0xb2da('0x14')][_0x26420c['transfertargetlinkedid']]){this['actions'][_0x26420c[_0xb2da('0x14c')]][_0xb2da('0x13f')]=!![];}}};Preview[_0xb2da('0xc')]['syncBlindTransfer']=function(_0x3fd698){if(_0x3fd698){if(this[_0xb2da('0x14')][_0x3fd698[_0xb2da('0x14d')]]){this[_0xb2da('0x14')][_0x3fd698[_0xb2da('0x14d')]][_0xb2da('0x13f')]=!![];}}};module[_0xb2da('0x14e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 66fad22..38a2fef 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 _0xc2eb=['queuecallerexitreason','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xc2eb,0x149));var _0xbc2e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xc2eb[_0x37c22c];return _0x119d79;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require('lodash');var cmHopper=require(_0xbc2e('0x0'));var cmHopperFinal=require(_0xbc2e('0x1'));var cmHopperHistory=require(_0xbc2e('0x2'));var cmHopperBlack=require(_0xbc2e('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xbc2e('0x4'));var voiceQueueReport=require(_0xbc2e('0x5'));function loggerCatch(_0x63d224){return function(_0x2d13d5){logger[_0xbc2e('0x6')](_0x63d224,util[_0xbc2e('0x7')](_0x2d13d5,{'showHidden':![],'depth':null}));};}function create(_0x40e357){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopperHistory[_0xbc2e('0xa')](_0x40e357))[_0xbc2e('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1b81ea){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](agentReportPreview[_0xbc2e('0xa')](_0x1b81ea))[_0xbc2e('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x1c91c8){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopper['moveContactManagedDialer'](_0x1c91c8,!![]))['catch'](loggerCatch(_0xbc2e('0xc')));}exports[_0xbc2e('0xd')]=function(_0x1d9fef){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopperBlack[_0xbc2e('0xd')](_0x1d9fef))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0xe')));};exports[_0xbc2e('0xf')]=function(_0x4dce89){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0xf')](_0x4dce89))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x10')));};exports[_0xbc2e('0xa')]=function(_0x3f5d67,_0x5db806){create(_0x3f5d67)[_0xbc2e('0xb')](loggerCatch(_0x5db806));moveContact(_0x3f5d67)[_0xbc2e('0xb')](loggerCatch(_0x5db806));};exports[_0xbc2e('0x11')]=function(_0x810b1,_0x3e0a37){createAgent(_0x810b1)[_0xbc2e('0xb')](loggerCatch(_0x3e0a37));};exports[_0xbc2e('0x12')]=function(_0x2f6514,_0x53943b){create(_0x2f6514)[_0xbc2e('0xb')](loggerCatch(_0x53943b));};exports[_0xbc2e('0x13')]=function(_0x448557,_0x31f29f){moveContact(_0x448557)['catch'](loggerCatch(_0x31f29f));};exports[_0xbc2e('0x14')]=function(_0x35636c,_0x4b3712,_0x3c46fc){if(_0x4b3712){_0x35636c[_0xbc2e('0x15')]=null;}if(_0x3c46fc){_0x35636c[_0xbc2e('0x16')]=![];}return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper['rescheduleContact'](_0x35636c))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x17')));};exports[_0xbc2e('0x18')]=function(_0x52b849){return BPromise[_0xbc2e('0x8')]()['then'](cmHopper[_0xbc2e('0x18')](_0x52b849))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x19')));};exports[_0xbc2e('0x1a')]=function(_0x5cf7a4){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper['unlockContact']({'UserId':null},_0x5cf7a4,0x1))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x1b')));};exports[_0xbc2e('0x1c')]=function(_0x5e63bf){return BPromise['resolve']()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0x1a')]({'active':![]},_0x5e63bf,0x1))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x1d')));};exports[_0xbc2e('0x1e')]=function(_0x44c534){var _0x10f47b={};_0x10f47b[_0xbc2e('0x1f')]=_0x44c534[_0xbc2e('0x1f')];_0x10f47b[_0xbc2e('0x20')]=_0x44c534[_0xbc2e('0x20')];_0x10f47b[_0xbc2e('0x21')]=_0x44c534[_0xbc2e('0x21')];_0x10f47b['calleridname']=_0x44c534[_0xbc2e('0x22')];_0x10f47b[_0xbc2e('0x23')]=_0x44c534['queue'];_0x10f47b[_0xbc2e('0x24')]=_0x44c534['answertime'];_0x10f47b[_0xbc2e('0x25')]=_0x44c534[_0xbc2e('0x26')];_0x10f47b[_0xbc2e('0x27')]=0x1;_0x10f47b[_0xbc2e('0x28')]=_0x44c534[_0xbc2e('0x29')];_0x10f47b['connectedlinename']=_0x44c534[_0xbc2e('0x2a')];_0x10f47b[_0xbc2e('0x2b')]=_0xbc2e('0x2c');_0x10f47b[_0xbc2e('0x2d')]='xcally-motion-preview';_0x10f47b[_0xbc2e('0x2e')]=0x0;_0x10f47b[_0xbc2e('0x2f')]=0x1;_0x10f47b[_0xbc2e('0x30')]=_0x44c534[_0xbc2e('0x2a')];_0x10f47b[_0xbc2e('0x31')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x10f47b))[_0xbc2e('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xbc2e('0x32')]=function(_0x39dfcc,_0x40259d){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0x32')](_0x39dfcc,_0x40259d))['catch'](loggerCatch(_0xbc2e('0x33')));};exports[_0xbc2e('0x34')]=function(_0x31e27f){return BPromise[_0xbc2e('0x8')]()[_0xbc2e('0x9')](cmHopper[_0xbc2e('0x14')](_0x31e27f,!![],!![]))[_0xbc2e('0xb')](loggerCatch(_0xbc2e('0x35')));}; \ No newline at end of file +var _0x8a58=['[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','exten','holdtime','assigned','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch'];(function(_0x2c8087,_0x306bb6){var _0x228e8b=function(_0x59a8f0){while(--_0x59a8f0){_0x2c8087['push'](_0x2c8087['shift']());}};_0x228e8b(++_0x306bb6);}(_0x8a58,0x191));var _0x88a5=function(_0x43eb54,_0x35e944){_0x43eb54=_0x43eb54-0x0;var _0x3892ac=_0x8a58[_0x43eb54];return _0x3892ac;};'use strict';var util=require(_0x88a5('0x0'));var BPromise=require('bluebird');var logger=require(_0x88a5('0x1'))('preview');var _=require('lodash');var cmHopper=require(_0x88a5('0x2'));var cmHopperFinal=require(_0x88a5('0x3'));var cmHopperHistory=require(_0x88a5('0x4'));var cmHopperBlack=require(_0x88a5('0x5'));var voiceQueueRt=require(_0x88a5('0x6'));var agentReportPreview=require(_0x88a5('0x7'));var voiceQueueReport=require(_0x88a5('0x8'));function loggerCatch(_0x33b34b){return function(_0x3853c9){logger[_0x88a5('0x9')](_0x33b34b,util[_0x88a5('0xa')](_0x3853c9,{'showHidden':![],'depth':null}));};}function create(_0x535425){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopperHistory[_0x88a5('0xd')](_0x535425))[_0x88a5('0xe')](loggerCatch(_0x88a5('0xf')));}function createAgent(_0x3050d9){return BPromise['resolve']()[_0x88a5('0xc')](agentReportPreview['createHistory'](_0x3050d9))[_0x88a5('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3c13fd){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopper[_0x88a5('0x10')](_0x3c13fd,!![]))[_0x88a5('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x88a5('0x11')]=function(_0x4458bf){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopperBlack[_0x88a5('0x11')](_0x4458bf))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x88a5('0x12')]=function(_0x445474){return BPromise['resolve']()['then'](cmHopper['getContactPreview'](_0x445474))['catch'](loggerCatch(_0x88a5('0x13')));};exports['createHistory']=function(_0x42229f,_0x1fd758){create(_0x42229f)[_0x88a5('0xe')](loggerCatch(_0x1fd758));moveContact(_0x42229f)['catch'](loggerCatch(_0x1fd758));};exports['createAgentHistory']=function(_0x14737f,_0x345fd6){createAgent(_0x14737f)[_0x88a5('0xe')](loggerCatch(_0x345fd6));};exports[_0x88a5('0x14')]=function(_0x16c70f,_0x34c361){create(_0x16c70f)[_0x88a5('0xe')](loggerCatch(_0x34c361));};exports[_0x88a5('0x15')]=function(_0x26cdc7,_0x5d1581){moveContact(_0x26cdc7)[_0x88a5('0xe')](loggerCatch(_0x5d1581));};exports[_0x88a5('0x16')]=function(_0x5f32ea,_0x52bd3b,_0x734d6c){if(_0x52bd3b){_0x5f32ea[_0x88a5('0x17')]=null;}if(_0x734d6c){_0x5f32ea[_0x88a5('0x18')]=![];}return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopper[_0x88a5('0x16')](_0x5f32ea))[_0x88a5('0xe')](loggerCatch(_0x88a5('0x19')));};exports['countReScheduled']=function(_0x17919a){return BPromise['resolve']()[_0x88a5('0xc')](cmHopper['countReScheduled'](_0x17919a))[_0x88a5('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x88a5('0x1a')]=function(_0x6cbdfe){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopper[_0x88a5('0x1a')]({'UserId':null},_0x6cbdfe,0x1))[_0x88a5('0xe')](loggerCatch(_0x88a5('0x1b')));};exports[_0x88a5('0x1c')]=function(_0x20cf53){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopper[_0x88a5('0x1a')]({'active':![]},_0x20cf53,0x1))[_0x88a5('0xe')](loggerCatch(_0x88a5('0x1d')));};exports[_0x88a5('0x1e')]=function(_0x37fc78){var _0x2796df={};_0x2796df['type']=_0x37fc78[_0x88a5('0x1f')];_0x2796df['uniqueid']=_0x37fc78['uniqueid'];_0x2796df[_0x88a5('0x20')]=_0x37fc78[_0x88a5('0x20')];_0x2796df[_0x88a5('0x21')]=_0x37fc78[_0x88a5('0x21')];_0x2796df[_0x88a5('0x22')]=_0x37fc78['queue'];_0x2796df[_0x88a5('0x23')]=_0x37fc78[_0x88a5('0x24')];_0x2796df[_0x88a5('0x25')]=_0x37fc78[_0x88a5('0x24')];_0x2796df[_0x88a5('0x26')]=0x1;_0x2796df[_0x88a5('0x27')]=_0x37fc78[_0x88a5('0x28')];_0x2796df['connectedlinename']=_0x37fc78[_0x88a5('0x29')];_0x2796df['context']='from-sip';_0x2796df[_0x88a5('0x2a')]='xcally-motion-preview';_0x2796df[_0x88a5('0x2b')]=0x0;_0x2796df[_0x88a5('0x2c')]=0x1;_0x2796df['lastAssignedTo']=_0x37fc78[_0x88a5('0x29')];_0x2796df[_0x88a5('0x2d')]='COMPLETED';return BPromise[_0x88a5('0xb')]()['then'](voiceQueueReport[_0x88a5('0x2e')](_0x2796df))[_0x88a5('0xe')](loggerCatch(_0x88a5('0x2f')));};exports[_0x88a5('0x30')]=function(_0x3c1d92,_0x5b8b25){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopper['getContactRecallMe'](_0x3c1d92,_0x5b8b25))['catch'](loggerCatch(_0x88a5('0x31')));};exports[_0x88a5('0x32')]=function(_0x4006e7){return BPromise[_0x88a5('0xb')]()[_0x88a5('0xc')](cmHopper[_0x88a5('0x16')](_0x4006e7,!![],!![]))[_0x88a5('0xe')](loggerCatch(_0x88a5('0x33')));}; \ 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 26e7b92..a86b620 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 _0x3bc2=['from-sip','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','idContact','type','countglobal','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','RECALL','BOOKED','originate','channelAgent','xcally-motion-preview'];(function(_0x59e846,_0x5ee51f){var _0x5173d8=function(_0x156e6f){while(--_0x156e6f){_0x59e846['push'](_0x59e846['shift']());}};_0x5173d8(++_0x5ee51f);}(_0x3bc2,0x14f));var _0x23bc=function(_0x15a00d,_0x1db175){_0x15a00d=_0x15a00d-0x0;var _0x2ce54d=_0x3bc2[_0x15a00d];return _0x2ce54d;};'use strict';var util=require(_0x23bc('0x0'));var _=require(_0x23bc('0x1'));var moment=require(_0x23bc('0x2'));var logger=require(_0x23bc('0x3'))(_0x23bc('0x4'));var ipAgi=process['env'][_0x23bc('0x5')]||'127.0.0.1';function getSeconds(_0x42759c,_0x1dc289){var _0x3a71fd=moment(_0x42759c)['milliseconds'](0x0);var _0x325f09=moment(_0x1dc289)['milliseconds'](0x0);return _0x3a71fd['diff'](_0x325f09,_0x23bc('0x6'));}exports[_0x23bc('0x7')]=function(_0x9876f7){return function(_0x25292d){logger[_0x23bc('0x8')](_0x9876f7,util[_0x23bc('0x9')](_0x25292d,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x50f3b5,_0x28ef3e){logger[_0x23bc('0xa')](_0x50f3b5,util[_0x23bc('0x9')](_0x28ef3e,{'showHidden':![],'depth':null}));};exports[_0x23bc('0xb')]=function(_0x153180,_0x7f5d1b){logger[_0x23bc('0x8')](_0x153180,util[_0x23bc('0x9')](_0x7f5d1b,{'showHidden':![],'depth':null}));};exports[_0x23bc('0xc')]=function(_0x1169f4){return function(_0x591a28){logger['info'](_0x1169f4,util[_0x23bc('0x9')](_0x591a28,{'showHidden':![],'depth':null}));};};exports[_0x23bc('0xd')]=function(_0x491953,_0x1e44fb,_0xddfdc3){return{'message':_0x491953,'unlock':_0x1e44fb,'active':_0xddfdc3};};exports[_0x23bc('0xe')]=function(_0x2356a6,_0xd4abc8,_0x4aa227){if(!_[_0x23bc('0xf')](_0x4aa227)&&_0x23bc('0x10')===typeof _0x4aa227&&!_[_0x23bc('0x11')](_0x4aa227)){if(!_['isUndefined'](_0xd4abc8)&&_0x23bc('0x10')===typeof _0xd4abc8&&!_['isEmpty'](_0xd4abc8)){return util['format'](_0x23bc('0x12'),_0xd4abc8,_0x4aa227);}return util[_0x23bc('0x13')]('\x22%s\x22\x20<%s>',_0x4aa227,_0x4aa227);}if(!_[_0x23bc('0xf')](_0x2356a6)&&_0x23bc('0x10')===typeof _0x2356a6&&!_['isEmpty'](_0x2356a6)){return _0x2356a6;}return _0x23bc('0x14');};exports[_0x23bc('0x15')]=function(_0x1e8c6d){if(_[_0x23bc('0x16')](_0x1e8c6d)){return![];}return _0x1e8c6d;};exports[_0x23bc('0x17')]=function(_0x534b49,_0x342475,_0x2e4b28,_0x247a5,_0x1479bf,_0x3a67f8){var _0x202f97={'XMD-QUEUE':_0x342475[_0x23bc('0x18')]?_0x342475['Queue'][_0x23bc('0x19')]:'','XMD-CALLERID':_0x247a5,'XMD-CALLERID-PREVIEW':_0x3a67f8?util[_0x23bc('0x13')](_0x23bc('0x12'),_0x3a67f8[_0x23bc('0x1a')],_0x3a67f8[_0x23bc('0x1b')]):_0x247a5,'XMD-DIALID':_0x1479bf,'XMD-CONTACTID':_0x342475[_0x23bc('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x247a5,'XMD-VOICEQUEUEID':_0x342475[_0x23bc('0x1d')],'XMD-DIALCHANNEL':_0x2e4b28,'XMD-DIALTIMEOUT':_0x534b49['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x534b49['dialQueueProject2']?'g':'',_[_0x23bc('0x11')](_0x534b49[_0x23bc('0x1e')])?'':_0x23bc('0x1f')),'XMD-DIALURL':_0x534b49[_0x23bc('0x20')]||'','XMD-AGI':_0x534b49[_0x23bc('0x21')]?util[_0x23bc('0x13')](_0x23bc('0x22'),ipAgi,_0x534b49['dialQueueProject']):_0x23bc('0x23'),'XMD-AGIAFTER':_0x534b49[_0x23bc('0x24')]?util[_0x23bc('0x13')](_0x23bc('0x22'),ipAgi,_0x534b49[_0x23bc('0x24')]):_0x23bc('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3a67f8?_0x3a67f8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3a67f8?_0x3a67f8[_0x23bc('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x23bc('0x11')](_0x534b49['monitor_format'])){_0x202f97[util[_0x23bc('0x13')]('%s',_0x23bc('0x26'))]=_0x534b49[_0x23bc('0x1e')];_0x202f97[util[_0x23bc('0x13')]('%s',_0x23bc('0x27'))]=_0x1479bf;}if(_0x342475&&_0x342475['Contact']){for(var _0x2b31bb in _0x342475[_0x23bc('0x28')]){if(_0x342475[_0x23bc('0x28')][_0x23bc('0x29')](_0x2b31bb)){if(!_[_0x23bc('0x16')](_0x342475['Contact'][_0x2b31bb])&&_0x2b31bb!=='id'&&_0x2b31bb!==_0x23bc('0x2a')&&_0x2b31bb!==_0x23bc('0x2b')&&_0x2b31bb!=='updatedAt'){_0x202f97[util[_0x23bc('0x13')](_0x23bc('0x2c'),_0x23bc('0x2d'),_[_0x23bc('0x2e')](_0x2b31bb))]=_0x342475['Contact'][_0x2b31bb];}}}}return _0x202f97;};exports['toLowerVariables']=function(_0x54f123){var _0x9c3b2b={};for(var _0x45f3ac in _0x54f123){if(_0x54f123[_0x23bc('0x29')](_0x45f3ac)){_0x9c3b2b[util[_0x23bc('0x13')]('%s',_[_0x23bc('0x2f')](_0x45f3ac))]=_0x54f123[_0x45f3ac];}}return{'variables':_0x9c3b2b};};exports[_0x23bc('0x30')]=function(_0x2d56b3,_0x3e6229){if(!_[_0x23bc('0x16')](_0x2d56b3)){if(_0x2d56b3[_0x23bc('0x29')](_0x23bc('0x31'))){if(_0x2d56b3[_0x23bc('0x31')]>0x0){_0x2d56b3[_0x23bc('0x31')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3e6229);}}}else{logger[_0x23bc('0x8')](_0x23bc('0x32'),_0x3e6229);}};exports[_0x23bc('0x33')]=function(_0x55c3b2){var _0x370595=moment()[_0x23bc('0x13')](_0x23bc('0x34'));_0x55c3b2[_0x23bc('0x35')]=0xd;_0x55c3b2[_0x23bc('0x36')]=_0x23bc('0x37');_0x55c3b2[_0x23bc('0x38')]=_0x370595;_0x55c3b2[_0x23bc('0x39')]=_0x370595;_0x55c3b2[_0x23bc('0x3a')]=_0x370595;};exports[_0x23bc('0x3b')]=function(_0x4dfd97,_0x47bc1c,_0x4f2a27){var _0x23cf8c=moment()[_0x23bc('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dfd97[_0x23bc('0x35')]=_0x47bc1c;_0x4dfd97['statedesc']=_0x4f2a27;_0x4dfd97[_0x23bc('0x39')]=_0x23cf8c;_0x4dfd97[_0x23bc('0x3c')]=getSeconds(_0x4dfd97[_0x23bc('0x39')],_0x4dfd97['starttime']);};exports[_0x23bc('0x3d')]=function(_0x3ff512,_0x22ded5,_0x4dafa5){_0x3ff512[_0x23bc('0x3e')]=_0x22ded5;_0x3ff512[_0x23bc('0x3f')]=_0x4dafa5;};exports['logCustomer']=function(_0x8088a8,_0x4d92e5,_0x48bde1){var _0x4e7250=moment()[_0x23bc('0x13')](_0x23bc('0x34'));_0x8088a8[_0x23bc('0x35')]=_0x4d92e5;_0x8088a8[_0x23bc('0x36')]=_0x48bde1;_0x8088a8[_0x23bc('0x39')]=_0x8088a8[_0x23bc('0x39')]?_0x8088a8['responsetime']:_0x4e7250;_0x8088a8[_0x23bc('0x3a')]=_0x8088a8['endtime']?_0x8088a8['endtime']:_0x4e7250;_0x8088a8[_0x23bc('0x3c')]=getSeconds(_0x8088a8[_0x23bc('0x39')]||0x0,_0x8088a8['starttime']||0x0);_0x8088a8[_0x23bc('0x40')]=_0x8088a8[_0x23bc('0x41')]?getSeconds(_0x8088a8[_0x23bc('0x3a')],_0x8088a8[_0x23bc('0x41')]):0x0;};exports[_0x23bc('0x42')]=function(_0x106b3e){return _0x106b3e===_0x23bc('0x43');};exports['variablesAction']=function(_0x56dabe,_0x454ad8,_0x237f50,_0x5cc695,_0x4b9452){var _0xf3c982=_0x5cc695?_0x23bc('0x44'):_0x56dabe[_0x23bc('0x1a')];_0xf3c982=_0x4b9452?_0x23bc('0x45'):_0xf3c982;return{'actionid':_0x56dabe['uniqueid'],'action':_0x23bc('0x46'),'channel':_0x56dabe[_0x23bc('0x47')],'callerid':util['format'](_0x23bc('0x12'),_0xf3c982,_0x56dabe[_0x23bc('0x1b')]),'Exten':_0x23bc('0x48'),'Context':_0x23bc('0x49'),'Priority':'1','variable':_0x237f50,'timeout':(_0x454ad8['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x56dabe[_0x23bc('0x4a')]};};exports['totalGlobal']=function(_0x382d74){return _0x382d74[_0x23bc('0x4b')]+_0x382d74[_0x23bc('0x4c')]+_0x382d74[_0x23bc('0x4d')]+_0x382d74[_0x23bc('0x4e')]+_0x382d74[_0x23bc('0x4f')];};exports['cloneAction']=function(_0x8affe8){var _0xeb622c=_[_0x23bc('0x50')](_0x8affe8);_0xeb622c[_0x23bc('0x35')]=0xf;_0xeb622c[_0x23bc('0x36')]=_0x23bc('0x51');return _0xeb622c;};exports[_0x23bc('0x52')]=function(_0x56bcd7,_0x24f5f7,_0xac2282){var _0x558e84={};_0x558e84[_0x24f5f7]=_0x56bcd7[_0x24f5f7];_0x558e84[_0x23bc('0x53')]=![];_0x558e84[_0x23bc('0x54')]=moment()['add'](_0xac2282,_0x23bc('0x55'))['format'](_0x23bc('0x34'));_0x558e84[_0x23bc('0x1c')]=_0x56bcd7[_0x23bc('0x1c')];_0x558e84[_0x23bc('0x56')]=_0x56bcd7['ListId'];_0x558e84['VoiceQueueId']=_0x56bcd7['VoiceQueueId']||undefined;return _0x558e84;};exports[_0x23bc('0x57')]=function(_0x1eb130,_0x4d9111){if(!_[_0x23bc('0x16')](_0x1eb130)){if(_0x1eb130[_0x23bc('0x58')]>0x0){_0x1eb130[_0x23bc('0x58')]-=0x1;}else{logger[_0x23bc('0x8')](_0x4d9111,_0x23bc('0x59'));}}else{logger[_0x23bc('0x8')](_0x4d9111,_0x23bc('0x5a'));}};exports[_0x23bc('0x5b')]=function(_0x19149d){if(_0x19149d<=0x0){return!![];}return![];};exports[_0x23bc('0x5c')]=function(_0x9a4ecc,_0x13f230,_0xe5f952){_0x9a4ecc[_0x23bc('0x5d')]=_0x13f230;_0x9a4ecc[_0x23bc('0x19')]=_0x9a4ecc[_0x23bc('0x5e')];_0x9a4ecc[_0x23bc('0x5f')]=_0x9a4ecc[_0x23bc('0x47')];_0x9a4ecc['motionChannel']=_0x23bc('0x60');if(_0xe5f952){_0x9a4ecc[_0x23bc('0x61')]=_0xe5f952[_0x23bc('0x61')];}return _0x9a4ecc;};exports['buildAcw']=function(_0x1bd18a){var _0xe7ef6d={};_0xe7ef6d[_0x23bc('0x5e')]=_0x1bd18a['queue'];_0xe7ef6d[_0x23bc('0x5f')]=_0x1bd18a[_0x23bc('0x47')];_0xe7ef6d['uniqueid']=_0x1bd18a[_0x23bc('0x4a')];return _0xe7ef6d;};exports[_0x23bc('0x62')]=function(_0x129850){var _0x58d5fd=[];for(var _0xc8515a in _0x129850){if(_0x129850[_0x23bc('0x29')](_0xc8515a)){if(!_[_0x23bc('0x16')](_0x129850[_0xc8515a])&&_0x129850[_0xc8515a][_0x23bc('0x35')]===_0x23bc('0x63')&&_0x129850[_0xc8515a]['status']===_0x23bc('0x64')){_0x58d5fd[_0x23bc('0x65')](_0x129850[_0xc8515a]['id']);}}}return _0x58d5fd;};exports[_0x23bc('0x66')]=function(_0x41a27f){var _0x57ed65=moment()[_0x23bc('0x67')](0x0);var _0x36fe1a=moment(_0x41a27f)[_0x23bc('0x67')](0x0);return _0x57ed65[_0x23bc('0x68')](_0x36fe1a,'seconds');};exports[_0x23bc('0x69')]=function(_0x36eac5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x36eac5[_0x23bc('0x1c')],'ListId':_0x36eac5[_0x23bc('0x56')],'VoiceQueueId':_0x36eac5[_0x23bc('0x1d')]||undefined,'CampaignId':_0x36eac5[_0x23bc('0x6a')]||undefined};};exports['filterKey']=function(_0x24a396){if(_0x24a396===_0x23bc('0x4a')||_0x24a396===_0x23bc('0x6b')||_0x24a396==='queue'||_0x24a396===_0x23bc('0x6c')||_0x24a396==='campaigntype'||_0x24a396==='dialAnswer'||_0x24a396==='membername'||_0x24a396===_0x23bc('0x47')||_0x24a396===_0x23bc('0x1a')||_0x24a396===_0x23bc('0x53')||_0x24a396===_0x23bc('0x1b')||_0x24a396==='scheduledat'||_0x24a396===_0x23bc('0x4b')||_0x24a396==='countcongestionretry'||_0x24a396===_0x23bc('0x4d')||_0x24a396===_0x23bc('0x6d')||_0x24a396==='callback'||_0x24a396===_0x23bc('0x6e')||_0x24a396==='callbackat'||_0x24a396==='recallme'||_0x24a396===_0x23bc('0x1c')||_0x24a396===_0x23bc('0x56')||_0x24a396===_0x23bc('0x3f')||_0x24a396===_0x23bc('0x1d')||_0x24a396===_0x23bc('0x6f')||_0x24a396===_0x23bc('0x70')||_0x24a396==='xmd-queue'||_0x24a396===_0x23bc('0x71')||_0x24a396==='xmd-listid'||_0x24a396===_0x23bc('0x72')||_0x24a396===_0x23bc('0x73')||_0x24a396===_0x23bc('0x74')||_0x24a396===_0x23bc('0x75')||_0x24a396===_0x23bc('0x76')||_0x24a396===_0x23bc('0x77')||_0x24a396==='xmd-cdrtype'||_0x24a396==='xmd-callerid'||_0x24a396==='xmd-agiafter'||_0x24a396===_0x23bc('0x78')||_0x24a396===_0x23bc('0x79')||_0x24a396===_0x23bc('0x7a')||_0x24a396===_0x23bc('0x7b')||_0x24a396===_0x23bc('0x7c')||_0x24a396===_0x23bc('0x7d')||_0x24a396===_0x23bc('0x7e')||_0x24a396==='rtpaudioqosrtt'||_0x24a396===_0x23bc('0x7f')||_0x24a396==='rtpaudioqos'||_0x24a396===_0x23bc('0x7a')||_0x24a396==='rtpaudioqosjitter'||_0x24a396==='rtpaudioqosjitterbridged'||_0x24a396===_0x23bc('0x7d')||_0x24a396==='rtpaudioqoslossbridged'||_0x24a396===_0x23bc('0x80')||_0x24a396===_0x23bc('0x7f')||_0x24a396===_0x23bc('0x81')||_0x24a396==='bridgepvtcallid'||_0x24a396===_0x23bc('0x35')||_0x24a396===_0x23bc('0x36')){return![];}return!![];};exports[_0x23bc('0x82')]=function(_0xe566b2,_0x11318c){var _0x5edd42,_0xf9bcf0,_0x334fe0;if(_0x11318c<=0x0){_0x11318c=0x1;}_0x5edd42=new RegExp('\x5cw{0,'+_0x11318c+'}$');_0xf9bcf0=Math[_0x23bc('0x83')](0xa,_0x11318c-0x1);_0x334fe0=Math[_0x23bc('0x83')](0xa,_0x11318c)-0x1;return util['format']('%s',_[_0x23bc('0x84')](_0xe566b2,_0x5edd42,_[_0x23bc('0x85')](_0xf9bcf0,_0x334fe0)));};exports['extractCalleridName']=function(_0x374123){var _0x30cfdd=_0x374123[_0x23bc('0x86')](/"(.*?)"/);return _0x30cfdd?_0x30cfdd[0x1]:_0x374123;};exports[_0x23bc('0x87')]=function(_0x4dac42){var _0x360dbd=_0x4dac42[_0x23bc('0x86')](/<(.*?)>/);return _0x360dbd?_0x360dbd[0x1]:_0x4dac42;}; \ No newline at end of file +var _0x6408=['isNil','Queue','name','calleridname','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','idContact','type','dialAnswer','scheduledat','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','loggerError','inspect','logger2','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','isActive'];(function(_0x5660d5,_0x235c27){var _0x2a144d=function(_0x54fb3f){while(--_0x54fb3f){_0x5660d5['push'](_0x5660d5['shift']());}};_0x2a144d(++_0x235c27);}(_0x6408,0x1a9));var _0x8640=function(_0x5e7fa2,_0x2aa73b){_0x5e7fa2=_0x5e7fa2-0x0;var _0x509e85=_0x6408[_0x5e7fa2];return _0x509e85;};'use strict';var util=require('util');var _=require(_0x8640('0x0'));var moment=require(_0x8640('0x1'));var logger=require(_0x8640('0x2'))(_0x8640('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x8640('0x4');function getSeconds(_0x3bc7f0,_0x10e5f3){var _0x34bc76=moment(_0x3bc7f0)[_0x8640('0x5')](0x0);var _0x3e3a97=moment(_0x10e5f3)[_0x8640('0x5')](0x0);return _0x34bc76[_0x8640('0x6')](_0x3e3a97,_0x8640('0x7'));}exports[_0x8640('0x8')]=function(_0x2f1d29){return function(_0x1ca971){logger[_0x8640('0x9')](_0x2f1d29,util['inspect'](_0x1ca971,{'showHidden':![],'depth':null}));};};exports[_0x8640('0xa')]=function(_0x47ffdd,_0x1c79f1){logger[_0x8640('0xb')](_0x47ffdd,util['inspect'](_0x1c79f1,{'showHidden':![],'depth':null}));};exports[_0x8640('0xc')]=function(_0x58cc85,_0x536763){logger[_0x8640('0x9')](_0x58cc85,util[_0x8640('0xd')](_0x536763,{'showHidden':![],'depth':null}));};exports[_0x8640('0xe')]=function(_0x36add0){return function(_0x496ae5){logger[_0x8640('0xb')](_0x36add0,util['inspect'](_0x496ae5,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1e5a6b,_0x3b4010,_0x25a0c1){return{'message':_0x1e5a6b,'unlock':_0x3b4010,'active':_0x25a0c1};};exports[_0x8640('0xf')]=function(_0x5b77cc,_0x318753,_0x4ad0aa){if(!_[_0x8640('0x10')](_0x4ad0aa)&&'string'===typeof _0x4ad0aa&&!_[_0x8640('0x11')](_0x4ad0aa)){if(!_[_0x8640('0x10')](_0x318753)&&_0x8640('0x12')===typeof _0x318753&&!_[_0x8640('0x11')](_0x318753)){return util['format'](_0x8640('0x13'),_0x318753,_0x4ad0aa);}return util[_0x8640('0x14')](_0x8640('0x13'),_0x4ad0aa,_0x4ad0aa);}if(!_[_0x8640('0x10')](_0x5b77cc)&&_0x8640('0x12')===typeof _0x5b77cc&&!_[_0x8640('0x11')](_0x5b77cc)){return _0x5b77cc;}return'\x22\x22\x20<>';};exports[_0x8640('0x15')]=function(_0x126d74){if(_[_0x8640('0x16')](_0x126d74)){return![];}return _0x126d74;};exports['addVariables']=function(_0xa80179,_0xd9411c,_0x5541d0,_0x9713c7,_0x12d9b9,_0x53fe4d){var _0x17c564={'XMD-QUEUE':_0xd9411c[_0x8640('0x17')]?_0xd9411c['Queue'][_0x8640('0x18')]:'','XMD-CALLERID':_0x9713c7,'XMD-CALLERID-PREVIEW':_0x53fe4d?util['format'](_0x8640('0x13'),_0x53fe4d[_0x8640('0x19')],_0x53fe4d['calleridnum']):_0x9713c7,'XMD-DIALID':_0x12d9b9,'XMD-CONTACTID':_0xd9411c['ContactId'],'XMD-CDRTYPE':_0x8640('0x1a'),'CALLERID(all)':_0x9713c7,'XMD-VOICEQUEUEID':_0xd9411c[_0x8640('0x1b')],'XMD-DIALCHANNEL':_0x5541d0,'XMD-DIALTIMEOUT':_0xa80179[_0x8640('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x8640('0x1d'),_0xa80179[_0x8640('0x1e')]?'g':'',_[_0x8640('0x11')](_0xa80179[_0x8640('0x1f')])?'':_0x8640('0x20')),'XMD-DIALURL':_0xa80179['dialPreviewUrl']||'','XMD-AGI':_0xa80179[_0x8640('0x21')]?util[_0x8640('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0xa80179[_0x8640('0x21')]):_0x8640('0x22'),'XMD-AGIAFTER':_0xa80179['dialQueueProject2']?util[_0x8640('0x14')](_0x8640('0x23'),ipAgi,_0xa80179[_0x8640('0x1e')]):_0x8640('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x53fe4d?_0x53fe4d[_0x8640('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x53fe4d?_0x53fe4d[_0x8640('0x25')]:'','XMD-DESTINATION':_0x8640('0x26')};if(!_[_0x8640('0x11')](_0xa80179['monitor_format'])){_0x17c564[util[_0x8640('0x14')]('%s',_0x8640('0x27'))]=_0xa80179['monitor_format'];_0x17c564[util[_0x8640('0x14')]('%s',_0x8640('0x28'))]=_0x12d9b9;}if(_0xd9411c&&_0xd9411c['Contact']){for(var _0x313976 in _0xd9411c['Contact']){if(_0xd9411c[_0x8640('0x29')]['hasOwnProperty'](_0x313976)){if(!_[_0x8640('0x16')](_0xd9411c[_0x8640('0x29')][_0x313976])&&_0x313976!=='id'&&_0x313976!==_0x8640('0x2a')&&_0x313976!==_0x8640('0x2b')&&_0x313976!==_0x8640('0x2c')){_0x17c564[util[_0x8640('0x14')](_0x8640('0x2d'),_0x8640('0x2e'),_[_0x8640('0x2f')](_0x313976))]=_0xd9411c[_0x8640('0x29')][_0x313976];}}}}return _0x17c564;};exports[_0x8640('0x30')]=function(_0x12beea){var _0x4016c9={};for(var _0x437ac2 in _0x12beea){if(_0x12beea[_0x8640('0x31')](_0x437ac2)){_0x4016c9[util['format']('%s',_['toLower'](_0x437ac2))]=_0x12beea[_0x437ac2];}}return{'variables':_0x4016c9};};exports[_0x8640('0x32')]=function(_0x29d052,_0x583b31){if(!_[_0x8640('0x16')](_0x29d052)){if(_0x29d052[_0x8640('0x31')](_0x8640('0x33'))){if(_0x29d052['originated']>0x0){_0x29d052[_0x8640('0x33')]-=0x1;}else{logger['error'](_0x8640('0x34'),_0x583b31);}}}else{logger[_0x8640('0x9')](_0x8640('0x35'),_0x583b31);}};exports[_0x8640('0x36')]=function(_0x1b142f){var _0x56de9f=moment()[_0x8640('0x14')](_0x8640('0x37'));_0x1b142f[_0x8640('0x38')]=0xd;_0x1b142f[_0x8640('0x39')]=_0x8640('0x3a');_0x1b142f[_0x8640('0x3b')]=_0x56de9f;_0x1b142f[_0x8640('0x3c')]=_0x56de9f;_0x1b142f['endtime']=_0x56de9f;};exports[_0x8640('0x3d')]=function(_0xc0b40d,_0x580ada,_0x388537){var _0x54edef=moment()[_0x8640('0x14')](_0x8640('0x37'));_0xc0b40d['state']=_0x580ada;_0xc0b40d['statedesc']=_0x388537;_0xc0b40d['responsetime']=_0x54edef;_0xc0b40d[_0x8640('0x3e')]=getSeconds(_0xc0b40d[_0x8640('0x3c')],_0xc0b40d[_0x8640('0x3b')]);};exports[_0x8640('0x3f')]=function(_0x200cb2,_0x51e06d,_0x277c47){_0x200cb2[_0x8640('0x40')]=_0x51e06d;_0x200cb2[_0x8640('0x41')]=_0x277c47;};exports[_0x8640('0x42')]=function(_0x161342,_0x4b117c,_0xee550b){var _0x364e89=moment()[_0x8640('0x14')](_0x8640('0x37'));_0x161342[_0x8640('0x38')]=_0x4b117c;_0x161342[_0x8640('0x39')]=_0xee550b;_0x161342[_0x8640('0x3c')]=_0x161342[_0x8640('0x3c')]?_0x161342[_0x8640('0x3c')]:_0x364e89;_0x161342[_0x8640('0x43')]=_0x161342['endtime']?_0x161342['endtime']:_0x364e89;_0x161342['ringtime']=getSeconds(_0x161342[_0x8640('0x3c')]||0x0,_0x161342[_0x8640('0x3b')]||0x0);_0x161342[_0x8640('0x44')]=_0x161342[_0x8640('0x45')]?getSeconds(_0x161342[_0x8640('0x43')],_0x161342['answertime']):0x0;};exports[_0x8640('0x46')]=function(_0x408c1b){return _0x408c1b==='Failure';};exports[_0x8640('0x47')]=function(_0x43c4df,_0xd9c026,_0x1215cc,_0x1b464b,_0x2e1876){var _0x19c33b=_0x1b464b?_0x8640('0x48'):_0x43c4df['calleridname'];_0x19c33b=_0x2e1876?_0x8640('0x49'):_0x19c33b;return{'actionid':_0x43c4df[_0x8640('0x4a')],'action':_0x8640('0x4b'),'channel':_0x43c4df[_0x8640('0x4c')],'callerid':util[_0x8640('0x14')]('\x22%s\x22\x20<%s>',_0x19c33b,_0x43c4df['calleridnum']),'Exten':_0x8640('0x26'),'Context':_0x8640('0x4d'),'Priority':'1','variable':_0x1215cc,'timeout':(_0xd9c026[_0x8640('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x43c4df['uniqueid']};};exports[_0x8640('0x4f')]=function(_0x5ca231){return _0x5ca231['countbusyretry']+_0x5ca231[_0x8640('0x50')]+_0x5ca231['countnoanswerretry']+_0x5ca231[_0x8640('0x51')]+_0x5ca231['countnosuchnumberretry'];};exports[_0x8640('0x52')]=function(_0x54e451){var _0x6a78f2=_[_0x8640('0x53')](_0x54e451);_0x6a78f2[_0x8640('0x38')]=0xf;_0x6a78f2[_0x8640('0x39')]=_0x8640('0x54');return _0x6a78f2;};exports[_0x8640('0x55')]=function(_0x4498f7,_0x5a28da,_0x5f2e7a){var _0x17927a={};_0x17927a[_0x5a28da]=_0x4498f7[_0x5a28da];_0x17927a[_0x8640('0x56')]=![];_0x17927a['scheduledat']=moment()[_0x8640('0x57')](_0x5f2e7a,_0x8640('0x58'))['format'](_0x8640('0x37'));_0x17927a[_0x8640('0x59')]=_0x4498f7[_0x8640('0x59')];_0x17927a['ListId']=_0x4498f7[_0x8640('0x5a')];_0x17927a[_0x8640('0x1b')]=_0x4498f7[_0x8640('0x1b')]||undefined;return _0x17927a;};exports['decrementTalkink']=function(_0x51688d,_0xeec73d){if(!_[_0x8640('0x16')](_0x51688d)){if(_0x51688d[_0x8640('0x5b')]>0x0){_0x51688d['pTalking']-=0x1;}else{logger[_0x8640('0x9')](_0xeec73d,_0x8640('0x5c'));}}else{logger[_0x8640('0x9')](_0xeec73d,_0x8640('0x5d'));}};exports[_0x8640('0x5e')]=function(_0x137210){if(_0x137210<=0x0){return!![];}return![];};exports[_0x8640('0x5f')]=function(_0x4c75bf,_0x1eab45,_0x1ffb1f){_0x4c75bf[_0x8640('0x60')]=_0x1eab45;_0x4c75bf[_0x8640('0x18')]=_0x4c75bf[_0x8640('0x61')];_0x4c75bf[_0x8640('0x62')]=_0x4c75bf[_0x8640('0x4c')];_0x4c75bf[_0x8640('0x63')]=_0x8640('0x64');if(_0x1ffb1f){_0x4c75bf['mandatoryDisposition']=_0x1ffb1f[_0x8640('0x65')];}return _0x4c75bf;};exports[_0x8640('0x66')]=function(_0x59ca05){var _0x2f966d={};_0x2f966d[_0x8640('0x61')]=_0x59ca05[_0x8640('0x61')];_0x2f966d[_0x8640('0x62')]=_0x59ca05[_0x8640('0x4c')];_0x2f966d['uniqueid']=_0x59ca05[_0x8640('0x4a')];return _0x2f966d;};exports[_0x8640('0x67')]=function(_0x4e95a9){var _0x388289=[];for(var _0x513d3e in _0x4e95a9){if(_0x4e95a9[_0x8640('0x31')](_0x513d3e)){if(!_['isNil'](_0x4e95a9[_0x513d3e])&&_0x4e95a9[_0x513d3e][_0x8640('0x38')]===_0x8640('0x68')&&_0x4e95a9[_0x513d3e][_0x8640('0x69')]===_0x8640('0x6a')){_0x388289[_0x8640('0x6b')](_0x4e95a9[_0x513d3e]['id']);}}}return _0x388289;};exports[_0x8640('0x6c')]=function(_0x37bc2e){var _0xae2d98=moment()['milliseconds'](0x0);var _0x413cfa=moment(_0x37bc2e)[_0x8640('0x5')](0x0);return _0xae2d98['diff'](_0x413cfa,_0x8640('0x7'));};exports[_0x8640('0x6d')]=function(_0x39b12f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x39b12f['ContactId'],'ListId':_0x39b12f[_0x8640('0x5a')],'VoiceQueueId':_0x39b12f['VoiceQueueId']||undefined,'CampaignId':_0x39b12f['CampaignId']||undefined};};exports['filterKey']=function(_0xc2877d){if(_0xc2877d==='uniqueid'||_0xc2877d===_0x8640('0x6e')||_0xc2877d===_0x8640('0x61')||_0xc2877d===_0x8640('0x6f')||_0xc2877d==='campaigntype'||_0xc2877d===_0x8640('0x70')||_0xc2877d===_0x8640('0x40')||_0xc2877d===_0x8640('0x4c')||_0xc2877d===_0x8640('0x19')||_0xc2877d===_0x8640('0x56')||_0xc2877d==='calleridnum'||_0xc2877d===_0x8640('0x71')||_0xc2877d===_0x8640('0x72')||_0xc2877d===_0x8640('0x50')||_0xc2877d===_0x8640('0x73')||_0xc2877d===_0x8640('0x74')||_0xc2877d===_0x8640('0x75')||_0xc2877d===_0x8640('0x76')||_0xc2877d===_0x8640('0x77')||_0xc2877d===_0x8640('0x78')||_0xc2877d==='ContactId'||_0xc2877d===_0x8640('0x5a')||_0xc2877d===_0x8640('0x41')||_0xc2877d===_0x8640('0x1b')||_0xc2877d==='sipcallid'||_0xc2877d===_0x8640('0x79')||_0xc2877d===_0x8640('0x7a')||_0xc2877d==='xmd-phone'||_0xc2877d===_0x8640('0x7b')||_0xc2877d===_0x8640('0x7c')||_0xc2877d===_0x8640('0x7d')||_0xc2877d===_0x8640('0x7e')||_0xc2877d===_0x8640('0x7f')||_0xc2877d===_0x8640('0x80')||_0xc2877d===_0x8640('0x81')||_0xc2877d===_0x8640('0x82')||_0xc2877d==='xmd-callerid'||_0xc2877d===_0x8640('0x83')||_0xc2877d===_0x8640('0x84')||_0xc2877d===_0x8640('0x85')||_0xc2877d===_0x8640('0x86')||_0xc2877d===_0x8640('0x87')||_0xc2877d===_0x8640('0x88')||_0xc2877d===_0x8640('0x89')||_0xc2877d===_0x8640('0x8a')||_0xc2877d===_0x8640('0x8b')||_0xc2877d===_0x8640('0x8c')||_0xc2877d===_0x8640('0x85')||_0xc2877d===_0x8640('0x86')||_0xc2877d==='rtpaudioqosjitter'||_0xc2877d===_0x8640('0x88')||_0xc2877d==='rtpaudioqosloss'||_0xc2877d===_0x8640('0x8a')||_0xc2877d===_0x8640('0x8b')||_0xc2877d===_0x8640('0x8c')||_0xc2877d===_0x8640('0x8d')||_0xc2877d==='bridgepvtcallid'||_0xc2877d===_0x8640('0x38')||_0xc2877d===_0x8640('0x39')){return![];}return!![];};exports[_0x8640('0x8e')]=function(_0x1010cc,_0x1f0f93){var _0x2c1282,_0x334431,_0x5bd6f9;if(_0x1f0f93<=0x0){_0x1f0f93=0x1;}_0x2c1282=new RegExp(_0x8640('0x8f')+_0x1f0f93+'}$');_0x334431=Math[_0x8640('0x90')](0xa,_0x1f0f93-0x1);_0x5bd6f9=Math[_0x8640('0x90')](0xa,_0x1f0f93)-0x1;return util[_0x8640('0x14')]('%s',_[_0x8640('0x91')](_0x1010cc,_0x2c1282,_['random'](_0x334431,_0x5bd6f9)));};exports[_0x8640('0x92')]=function(_0x11b6e2){var _0xe25181=_0x11b6e2[_0x8640('0x93')](/"(.*?)"/);return _0xe25181?_0xe25181[0x1]:_0x11b6e2;};exports[_0x8640('0x94')]=function(_0xab4d9){var _0x4c8bf3=_0xab4d9[_0x8640('0x93')](/<(.*?)>/);return _0x4c8bf3?_0x4c8bf3[0x1]:_0xab4d9;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d724d31..3fee61c 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 _0x264a=['queuepause','reload','voicechannel','voicequeuechannelhangup','string','boolean','queueremove'];(function(_0x568fd6,_0x266183){var _0x3e871c=function(_0x5878d1){while(--_0x5878d1){_0x568fd6['push'](_0x568fd6['shift']());}};_0x3e871c(++_0x266183);}(_0x264a,0x1c4));var _0xa264=function(_0x230ea9,_0x1a4f64){_0x230ea9=_0x230ea9-0x0;var _0x4a3389=_0x264a[_0x230ea9];return _0x4a3389;};'use strict';exports['queueadd']={'queue':{'type':_0xa264('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xa264('0x1'),'required':![]}};exports[_0xa264('0x2')]={'queue':{'type':_0xa264('0x0'),'required':!![]},'interface':{'type':_0xa264('0x0'),'required':!![]}};exports[_0xa264('0x3')]={'interface':{'type':_0xa264('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xa264('0x0'),'required':![]}};exports[_0xa264('0x4')]={'module':{'type':_0xa264('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xa264('0x0'),'required':!![]}};exports[_0xa264('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xa264('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xa264('0x6')]={'uniqueid':{'type':_0xa264('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xa264('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xa264('0x0')}}; \ No newline at end of file +var _0xf960=['voicequeuechannelredirect','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x3ce0af,_0x33a353){var _0x49ada9=function(_0x39c566){while(--_0x39c566){_0x3ce0af['push'](_0x3ce0af['shift']());}};_0x49ada9(++_0x33a353);}(_0xf960,0xf1));var _0x0f96=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xf960[_0x5a60ce];return _0x393e5e;};'use strict';exports['queueadd']={'queue':{'type':_0x0f96('0x0'),'required':!![]},'interface':{'type':_0x0f96('0x0'),'required':!![]},'membername':{'type':_0x0f96('0x0'),'required':!![]},'penalty':{'type':_0x0f96('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x0f96('0x2')]={'queue':{'type':_0x0f96('0x0'),'required':!![]},'interface':{'type':_0x0f96('0x0'),'required':!![]}};exports[_0x0f96('0x3')]={'interface':{'type':_0x0f96('0x0'),'required':!![]},'paused':{'type':_0x0f96('0x4')},'reason':{'type':_0x0f96('0x0'),'required':![]}};exports[_0x0f96('0x5')]={'module':{'type':_0x0f96('0x0'),'required':![]}};exports[_0x0f96('0x6')]={'uniqueid':{'type':_0x0f96('0x0'),'required':!![]}};exports[_0x0f96('0x7')]={'uniqueid':{'type':_0x0f96('0x0'),'required':!![]},'filename':{'type':_0x0f96('0x0')},'format':{'type':_0x0f96('0x0')},'mixmonitorid':{'type':_0x0f96('0x0')}};exports[_0x0f96('0x8')]={'uniqueid':{'type':_0x0f96('0x0'),'required':!![]}};exports[_0x0f96('0x9')]={'uniqueid':{'type':_0x0f96('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x0f96('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 75221d4..1185baf 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 _0x8c40=['sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTrunks','trunks','initTemplates','initZendeskAccounts','zendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','groupBy','queuecallerexit','queuecallerleaveAt','diff','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','seconds','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings'];(function(_0x3df382,_0x561c8f){var _0xce8e0c=function(_0x149379){while(--_0x149379){_0x3df382['push'](_0x3df382['shift']());}};_0xce8e0c(++_0x561c8f);}(_0x8c40,0x182));var _0x08c4=function(_0x58ef30,_0x248d33){_0x58ef30=_0x58ef30-0x0;var _0x2e8fc6=_0x8c40[_0x58ef30];return _0x2e8fc6;};'use strict';var BPromise=require(_0x08c4('0x0'));var util=require(_0x08c4('0x1'));var _=require(_0x08c4('0x2'));var moment=require(_0x08c4('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x08c4('0x4'));var Trunk=require(_0x08c4('0x5'));var VoiceQueue=require(_0x08c4('0x6'));var Trigger=require('../model/trigger');var Template=require(_0x08c4('0x7'));var Campaign=require(_0x08c4('0x8'));var VoiceExtension=require(_0x08c4('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x08c4('0xa'));var FreshdeskAccount=require(_0x08c4('0xb'));var SugarcrmAccount=require(_0x08c4('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x08c4('0xd'));var ServicenowAccount=require(_0x08c4('0xe'));var Dynamics365Account=require(_0x08c4('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x08c4('0x10'));var Realtime=function(){this[_0x08c4('0x11')]={};this[_0x08c4('0x12')]={};this['trunks']={};this[_0x08c4('0x13')]={};this[_0x08c4('0x14')]={};this[_0x08c4('0x15')]={};this[_0x08c4('0x16')]={};this[_0x08c4('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x08c4('0x18')]={};this[_0x08c4('0x19')]={};this[_0x08c4('0x1a')]={};this[_0x08c4('0x1b')]={};this[_0x08c4('0x1c')]={};this[_0x08c4('0x1d')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x08c4('0x1e')]={};this[_0x08c4('0x1f')]={};this['zohoAccounts']={};this[_0x08c4('0x20')]={};this[_0x08c4('0x21')]={};this[_0x08c4('0x22')]={};this[_0x08c4('0x23')]={};this['freshsalesAccounts']={};this[_0x08c4('0x24')]={};};function freeIsNotKey(_0x59594c,_0x2e3047,_0x49d7bd){var _0x59dfb4=_[_0x08c4('0x25')](_0x59594c,function(_0x47d9f6,_0x2d8434){return _0x47d9f6[_0x49d7bd];});for(var _0x3b474f in _0x2e3047){if(_0x2e3047[_0x08c4('0x26')](_0x3b474f)){if(!_0x59dfb4[_0x3b474f]){delete _0x2e3047[_0x3b474f];}}}}function freeIsNotKeySip(_0x4082de,_0x58ad33){var _0x516270=_[_0x08c4('0x25')](_0x4082de,function(_0x3680e1,_0x536850){return util[_0x08c4('0x27')](_0x08c4('0x28'),_0x3680e1[_0x08c4('0x29')]);});for(var _0x17d4f0 in _0x58ad33){if(_0x58ad33[_0x08c4('0x26')](_0x17d4f0)){if(!_0x516270[_0x17d4f0]){delete _0x58ad33[_0x17d4f0];}}}}function freeIsNotKeyAgent(_0x9cb7dd,_0x1351a2){var _0x21f553=_[_0x08c4('0x25')](_0x9cb7dd,function(_0x164582,_0x30c562){var _0x18e20b=_[_0x08c4('0x2a')](_0x164582['interface'])?util['format'](_0x08c4('0x28'),_0x164582['name']):_0x164582[_0x08c4('0x2b')];return _0x18e20b;});for(var _0x483d3c in _0x1351a2){if(_0x1351a2[_0x08c4('0x26')](_0x483d3c)){if(!_0x21f553[_0x483d3c]){delete _0x1351a2[_0x483d3c];}}}}function clearVoiceCallReports(_0x59710b){_0x59710b[_0x08c4('0x2c')]=0x0;_0x59710b[_0x08c4('0x2d')]=0x0;_0x59710b[_0x08c4('0x2e')]=0x0;_0x59710b[_0x08c4('0x2f')]=0x0;_0x59710b[_0x08c4('0x30')]=0x0;}function clearCampaigns(_0x21da61){if(!_[_0x08c4('0x31')](_0x21da61)){for(var _0xa0ef5a in _0x21da61){if(_0x21da61['hasOwnProperty'](_0xa0ef5a)){_0x21da61[_0xa0ef5a][_0x08c4('0x32')]=0x0;_0x21da61[_0xa0ef5a][_0x08c4('0x33')]=0x0;}}}}function clearVoiceQueues(_0x8a54bf){if(!_[_0x08c4('0x31')](_0x8a54bf)){for(var _0x1c9f24 in _0x8a54bf){if(_0x8a54bf[_0x08c4('0x26')](_0x1c9f24)){_0x8a54bf[_0x1c9f24]['total']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x2d')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x34')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x35')]=0x0;_0x8a54bf[_0x1c9f24]['sumHoldTime']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x2f')]=0x0;_0x8a54bf[_0x1c9f24]['sumBillable']=0x0;_0x8a54bf[_0x1c9f24]['outboundAnswerAgiCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x36')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x37')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x38')]=0x0;_0x8a54bf[_0x1c9f24]['outboundNoSuchCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x39')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3a')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3b')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3c')]=0x0;_0x8a54bf[_0x1c9f24]['outboundOriginateFailureCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3d')]=0x0;_0x8a54bf[_0x1c9f24]['outboundReCallsDay']=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3e')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x3f')]=0x0;_0x8a54bf[_0x1c9f24][_0x08c4('0x40')]=!![];}}}}Realtime[_0x08c4('0x41')][_0x08c4('0x42')]=function(_0x41a9a7,_0x2b0b3d){for(var _0x32115f in _0x2b0b3d){if(_0x41a9a7['hasOwnProperty'](_0x32115f)){_0x41a9a7[_0x32115f]=_0x2b0b3d[_0x32115f];}}};Realtime['prototype']['initAgents']=function(){var _0x2fd789=this;return function(_0x22c62a){if(_0x22c62a){freeIsNotKeyAgent(_0x22c62a,_0x2fd789[_0x08c4('0x11')]);for(var _0x1ad6cc=0x0,_0x1b6b01={},_0x3f4cc4={};_0x1ad6cc<_0x22c62a[_0x08c4('0x43')];_0x1ad6cc+=0x1){_0x1b6b01=_0x22c62a[_0x1ad6cc];var _0xdd0ab2=_['isNil'](_0x1b6b01[_0x08c4('0x2b')])?util['format'](_0x08c4('0x28'),_0x1b6b01[_0x08c4('0x29')]):_0x1b6b01[_0x08c4('0x2b')];if(_['isUndefined'](_0x2fd789[_0x08c4('0x11')][_0xdd0ab2])){_0x2fd789['agents'][_0xdd0ab2]=new Agent(_0x1b6b01);}else{_0x2fd789[_0x08c4('0x42')](_0x2fd789['agents'][_0xdd0ab2],_0x1b6b01);}}}return _0x2fd789[_0x08c4('0x11')];};};Realtime[_0x08c4('0x41')]['initTelephones']=function(){var _0xedb01=this;return function(_0x24e776){if(_0x24e776){freeIsNotKeySip(_0x24e776,_0xedb01[_0x08c4('0x12')]);for(var _0x172979=0x0,_0x2b24ae={},_0x5cdd73={};_0x172979<_0x24e776[_0x08c4('0x43')];_0x172979+=0x1){_0x2b24ae=_0x24e776[_0x172979];if(_[_0x08c4('0x44')](_0xedb01['telephones'][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x2b24ae['name'])])){_0xedb01['telephones'][util[_0x08c4('0x27')]('SIP/%s',_0x2b24ae[_0x08c4('0x29')])]=new Telephone(_0x2b24ae);}else{_0xedb01[_0x08c4('0x42')](_0xedb01[_0x08c4('0x12')][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x2b24ae[_0x08c4('0x29')])],_0x2b24ae);}}}return _0xedb01[_0x08c4('0x12')];};};Realtime['prototype'][_0x08c4('0x45')]=function(){var _0x21d750=this;return function(_0x4b015a){if(_0x4b015a){freeIsNotKeySip(_0x4b015a,_0x21d750[_0x08c4('0x46')]);for(var _0x331610=0x0,_0x1cadd9={},_0x2c6a2d={};_0x331610<_0x4b015a[_0x08c4('0x43')];_0x331610+=0x1){_0x1cadd9=_0x4b015a[_0x331610];if(_[_0x08c4('0x44')](_0x21d750[_0x08c4('0x46')][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x1cadd9[_0x08c4('0x29')])])){_0x21d750[_0x08c4('0x46')][util[_0x08c4('0x27')](_0x08c4('0x28'),_0x1cadd9['name'])]=new Trunk(_0x1cadd9);}else{_0x21d750[_0x08c4('0x42')](_0x21d750[_0x08c4('0x46')][util[_0x08c4('0x27')]('SIP/%s',_0x1cadd9[_0x08c4('0x29')])],_0x1cadd9);}}}return _0x21d750['trunks'];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x237c5f=this;return function(_0x226b3f){if(_0x226b3f){freeIsNotKey(_0x226b3f,_0x237c5f[_0x08c4('0x13')],'name');for(var _0x1fa0b7=0x0,_0x107d45={},_0x1f2a14={};_0x1fa0b7<_0x226b3f['length'];_0x1fa0b7+=0x1){_0x107d45=_0x226b3f[_0x1fa0b7];if(_[_0x08c4('0x44')](_0x237c5f[_0x08c4('0x13')][_0x107d45['name']])){_0x237c5f[_0x08c4('0x13')][_0x107d45['name']]=new VoiceQueue(_0x107d45);}else{_0x237c5f[_0x08c4('0x42')](_0x237c5f[_0x08c4('0x13')][_0x107d45[_0x08c4('0x29')]],_0x107d45);}}}return _0x237c5f['voiceQueues'];};};Realtime[_0x08c4('0x41')]['initTriggers']=function(){var _0x29573e=this;return function(_0x8c1448){if(_0x8c1448){freeIsNotKey(_0x8c1448,_0x29573e['triggers'],'id');for(var _0x4916b5=0x0,_0x17341d={},_0x421007={};_0x4916b5<_0x8c1448['length'];_0x4916b5+=0x1){_0x17341d=_0x8c1448[_0x4916b5];if(_['isUndefined'](_0x29573e['triggers'][_0x17341d['id']])){_0x29573e['triggers'][_0x17341d['id']]=new Trigger(_0x17341d);}else{_0x29573e[_0x08c4('0x42')](_0x29573e[_0x08c4('0x14')][_0x17341d['id']],_0x17341d);}}}return _0x29573e[_0x08c4('0x14')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x47')]=function(){var _0x226462=this;return function(_0x25e25a){if(_0x25e25a){freeIsNotKey(_0x25e25a,_0x226462[_0x08c4('0x16')],'id');for(var _0x5b7788=0x0,_0x23f549={},_0x44bb2b={};_0x5b7788<_0x25e25a['length'];_0x5b7788+=0x1){_0x23f549=_0x25e25a[_0x5b7788];if(_['isUndefined'](_0x226462['templates'][_0x23f549['id']])){_0x226462[_0x08c4('0x16')][_0x23f549['id']]=new Template(_0x23f549);}else{_0x226462[_0x08c4('0x42')](_0x226462[_0x08c4('0x16')][_0x23f549['id']],_0x23f549);}}}return _0x226462[_0x08c4('0x16')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x48')]=function(){var _0x52abd4=this;return function(_0x3dfba2){if(_0x3dfba2){freeIsNotKey(_0x3dfba2,_0x52abd4[_0x08c4('0x49')],'id');for(var _0x245b8f=0x0,_0x39ba06={},_0x21a1ef={};_0x245b8f<_0x3dfba2[_0x08c4('0x43')];_0x245b8f+=0x1){_0x39ba06=_0x3dfba2[_0x245b8f];if(_['isUndefined'](_0x52abd4['zendeskAccounts'][_0x39ba06['id']])){_0x52abd4[_0x08c4('0x49')][_0x39ba06['id']]=new ZendeskAccount(_0x39ba06);}else{_0x52abd4[_0x08c4('0x42')](_0x52abd4[_0x08c4('0x49')][_0x39ba06['id']],_0x39ba06);}}}return _0x52abd4['zendeskAccounts'];};};Realtime[_0x08c4('0x41')]['initSalesforceAccounts']=function(){var _0x808a37=this;return function(_0x4608f9){if(_0x4608f9){freeIsNotKey(_0x4608f9,_0x808a37[_0x08c4('0x4a')],'id');for(var _0xec78d5=0x0,_0x14d231={},_0x272347={};_0xec78d5<_0x4608f9[_0x08c4('0x43')];_0xec78d5+=0x1){_0x14d231=_0x4608f9[_0xec78d5];if(_[_0x08c4('0x44')](_0x808a37['salesforceAccounts'][_0x14d231['id']])){_0x808a37[_0x08c4('0x4a')][_0x14d231['id']]=new SalesforceAccount(_0x14d231);}else{_0x808a37[_0x08c4('0x42')](_0x808a37[_0x08c4('0x4a')][_0x14d231['id']],_0x14d231);}}}return _0x808a37[_0x08c4('0x4a')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4b')]=function(){var _0x3b050c=this;return function(_0x188219){if(_0x188219){freeIsNotKey(_0x188219,_0x3b050c[_0x08c4('0x1f')],'id');for(var _0x45f55e=0x0,_0x80428d={},_0x516e61={};_0x45f55e<_0x188219[_0x08c4('0x43')];_0x45f55e+=0x1){_0x80428d=_0x188219[_0x45f55e];if(_['isUndefined'](_0x3b050c[_0x08c4('0x1f')][_0x80428d['id']])){_0x3b050c[_0x08c4('0x1f')][_0x80428d['id']]=new FreshdeskAccount(_0x80428d);}else{_0x3b050c[_0x08c4('0x42')](_0x3b050c[_0x08c4('0x1f')][_0x80428d['id']],_0x80428d);}}}return _0x3b050c[_0x08c4('0x1f')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4c')]=function(){var _0x4fca86=this;return function(_0x1d4882){if(_0x1d4882){freeIsNotKey(_0x1d4882,_0x4fca86[_0x08c4('0x4d')],'id');for(var _0xaed68f=0x0,_0x418dac={},_0x3efc8a={};_0xaed68f<_0x1d4882[_0x08c4('0x43')];_0xaed68f+=0x1){_0x418dac=_0x1d4882[_0xaed68f];if(_[_0x08c4('0x44')](_0x4fca86[_0x08c4('0x4d')][_0x418dac['id']])){_0x4fca86['zohoAccounts'][_0x418dac['id']]=new ZohoAccount(_0x418dac);}else{_0x4fca86[_0x08c4('0x42')](_0x4fca86[_0x08c4('0x4d')][_0x418dac['id']],_0x418dac);}}}return _0x4fca86[_0x08c4('0x4d')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4e')]=function(){var _0x4dd4c0=this;return function(_0x4a4108){if(_0x4a4108){freeIsNotKey(_0x4a4108,_0x4dd4c0['deskAccounts'],'id');for(var _0x1389c9=0x0,_0x4e1178={},_0x51c450={};_0x1389c9<_0x4a4108['length'];_0x1389c9+=0x1){_0x4e1178=_0x4a4108[_0x1389c9];if(_[_0x08c4('0x44')](_0x4dd4c0[_0x08c4('0x20')][_0x4e1178['id']])){_0x4dd4c0['deskAccounts'][_0x4e1178['id']]=new DeskAccount(_0x4e1178);}else{_0x4dd4c0[_0x08c4('0x42')](_0x4dd4c0[_0x08c4('0x20')][_0x4e1178['id']],_0x4e1178);}}}return _0x4dd4c0['deskAccounts'];};};Realtime[_0x08c4('0x41')][_0x08c4('0x4f')]=function(){var _0x23ad2f=this;return function(_0x1e5d74){if(_0x1e5d74){freeIsNotKey(_0x1e5d74,_0x23ad2f[_0x08c4('0x1e')],'id');for(var _0x39555e=0x0,_0x354287={},_0x184c41={};_0x39555e<_0x1e5d74[_0x08c4('0x43')];_0x39555e+=0x1){_0x354287=_0x1e5d74[_0x39555e];if(_[_0x08c4('0x44')](_0x23ad2f[_0x08c4('0x1e')][_0x354287['id']])){_0x23ad2f[_0x08c4('0x1e')][_0x354287['id']]=new SugarcrmAccount(_0x354287);}else{_0x23ad2f[_0x08c4('0x42')](_0x23ad2f['sugarcrmAccounts'][_0x354287['id']],_0x354287);}}}return _0x23ad2f[_0x08c4('0x1e')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x50')]=function(){var _0x1c7bd5=this;return function(_0x32b1c8){if(_0x32b1c8){freeIsNotKey(_0x32b1c8,_0x1c7bd5[_0x08c4('0x21')],'id');for(var _0xc4a8fe=0x0,_0x27d199={},_0x3155fa={};_0xc4a8fe<_0x32b1c8[_0x08c4('0x43')];_0xc4a8fe+=0x1){_0x27d199=_0x32b1c8[_0xc4a8fe];if(_[_0x08c4('0x44')](_0x1c7bd5[_0x08c4('0x21')][_0x27d199['id']])){_0x1c7bd5['vtigerAccounts'][_0x27d199['id']]=new VtigerAccount(_0x27d199);}else{_0x1c7bd5[_0x08c4('0x42')](_0x1c7bd5[_0x08c4('0x21')][_0x27d199['id']],_0x27d199);}}}return _0x1c7bd5[_0x08c4('0x21')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x51')]=function(){var _0x2b7e46=this;return function(_0x4e259d){if(_0x4e259d){freeIsNotKey(_0x4e259d,_0x2b7e46[_0x08c4('0x22')],'id');for(var _0x516222=0x0,_0x362add={},_0x5bffaa={};_0x516222<_0x4e259d[_0x08c4('0x43')];_0x516222+=0x1){_0x362add=_0x4e259d[_0x516222];if(_['isUndefined'](_0x2b7e46[_0x08c4('0x22')][_0x362add['id']])){_0x2b7e46[_0x08c4('0x22')][_0x362add['id']]=new ServicenowAccount(_0x362add);}else{_0x2b7e46[_0x08c4('0x42')](_0x2b7e46['servicenowAccounts'][_0x362add['id']],_0x362add);}}}return _0x2b7e46[_0x08c4('0x22')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x52')]=function(){var _0x5b3fcf=this;return function(_0x3cb345){if(_0x3cb345){freeIsNotKey(_0x3cb345,_0x5b3fcf[_0x08c4('0x23')],'id');for(var _0x29dd13=0x0,_0x10c282={},_0x26eccc={};_0x29dd13<_0x3cb345[_0x08c4('0x43')];_0x29dd13+=0x1){_0x10c282=_0x3cb345[_0x29dd13];if(_[_0x08c4('0x44')](_0x5b3fcf[_0x08c4('0x23')][_0x10c282['id']])){_0x5b3fcf[_0x08c4('0x23')][_0x10c282['id']]=new Dynamics365Account(_0x10c282);}else{_0x5b3fcf[_0x08c4('0x42')](_0x5b3fcf[_0x08c4('0x23')][_0x10c282['id']],_0x10c282);}}}return _0x5b3fcf[_0x08c4('0x23')];};};Realtime['prototype'][_0x08c4('0x53')]=function(){var _0x122cbc=this;return function(_0x57ca31){if(_0x57ca31){freeIsNotKey(_0x57ca31,_0x122cbc[_0x08c4('0x54')],'id');for(var _0x53674f=0x0,_0x3e6c6b={},_0x4bc3e2={};_0x53674f<_0x57ca31[_0x08c4('0x43')];_0x53674f+=0x1){_0x3e6c6b=_0x57ca31[_0x53674f];if(_[_0x08c4('0x44')](_0x122cbc[_0x08c4('0x54')][_0x3e6c6b['id']])){_0x122cbc['freshsalesAccounts'][_0x3e6c6b['id']]=new FreshsalesAccount(_0x3e6c6b);}else{_0x122cbc[_0x08c4('0x42')](_0x122cbc['freshsalesAccounts'][_0x3e6c6b['id']],_0x3e6c6b);}}}return _0x122cbc[_0x08c4('0x54')];};};Realtime[_0x08c4('0x41')]['initVoiceQueueHopperHistory']=function(){var _0x375be6=this;return function(_0x3c3869){for(var _0x416387=0x0;_0x416387<_0x3c3869[_0x08c4('0x43')];_0x416387+=0x1){_['merge'](_0x375be6['voiceQueues'][_0x3c3869[_0x416387]['name']],_0x3c3869[_0x416387]);}return _0x375be6[_0x08c4('0x13')];};};Realtime[_0x08c4('0x41')]['initVoiceQueueReports']=function(){var _0xfac10e=this;return function(_0xfa2417){clearVoiceQueues(_0xfac10e[_0x08c4('0x13')]);if(_0xfa2417){_0xfa2417=_[_0x08c4('0x55')](_0xfa2417,'uniqueid');for(var _0x5b1c9b in _0xfa2417){if(_0xfa2417['hasOwnProperty'](_0x5b1c9b)){var _0x1d705f={};for(var _0x17b3a6=0x0;_0x17b3a6<_0xfa2417[_0x5b1c9b]['length'];_0x17b3a6+=0x1){var _0x5ea1f2=_0xfa2417[_0x5b1c9b][_0x17b3a6]['queue'];if(_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]){if(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x56')]){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]['unmanaged']+=0x1;}if(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallerabandon']){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x35')]+=0x1;}_0xfac10e['voiceQueues'][_0x5ea1f2][_0x08c4('0x2e')]+=moment(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x57')])[_0x08c4('0x58')](moment(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallerjoinAt']),'seconds')||0x0;if(_0x17b3a6===_0xfa2417[_0x5b1c9b][_0x08c4('0x43')]-0x1){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]['sumDuration']+=moment(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x59')]||_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x5a')]||_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x5b')])[_0x08c4('0x58')](moment(_0xfa2417[_0x5b1c9b][_0x17b3a6][_0x08c4('0x5c')]),_0x08c4('0x5d'))||0x0;_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x2c')]+=0x1;if(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallercomplete']){_0xfac10e[_0x08c4('0x13')][_0x5ea1f2]['answered']+=0x1;_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x30')]+=moment(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallercompleteAt'])[_0x08c4('0x58')](moment(_0xfa2417[_0x5b1c9b][_0x17b3a6]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x2f')]+=_0xfac10e[_0x08c4('0x13')][_0x5ea1f2][_0x08c4('0x2e')]||0x0;}}}}}}return _0xfac10e[_0x08c4('0x13')];};};Realtime[_0x08c4('0x41')]['initVoiceCallReports']=function(){var _0x46ae92=this;return function(_0x57db09){clearVoiceCallReports(_0x46ae92[_0x08c4('0x17')]);if(_0x57db09){for(var _0x20b1bf=0x0;_0x20b1bf<_0x57db09[_0x08c4('0x43')];_0x20b1bf+=0x1){_0x46ae92[_0x08c4('0x17')]['total']+=0x1;_0x46ae92[_0x08c4('0x17')]['sumDuration']+=_0x57db09[_0x20b1bf][_0x08c4('0x5e')];if(_0x57db09[_0x20b1bf][_0x08c4('0x5f')]==='ANSWERED'){_0x46ae92[_0x08c4('0x17')][_0x08c4('0x2d')]+=0x1;_0x46ae92[_0x08c4('0x17')][_0x08c4('0x2e')]+=_0x57db09[_0x20b1bf]['duration']-_0x57db09[_0x20b1bf]['billableseconds']||0x0;_0x46ae92[_0x08c4('0x17')][_0x08c4('0x30')]+=_0x57db09[_0x20b1bf][_0x08c4('0x60')];}}}return _0x46ae92[_0x08c4('0x17')];};};Realtime['prototype'][_0x08c4('0x61')]=function(){var _0x491be7=this;return function(_0x3de5c2){if(_0x3de5c2){freeIsNotKey(_0x3de5c2,_0x491be7[_0x08c4('0x15')],'name');for(var _0x506a95=0x0,_0x23d7c7={};_0x506a95<_0x3de5c2[_0x08c4('0x43')];_0x506a95+=0x1){_0x23d7c7=_0x3de5c2[_0x506a95];if(_[_0x08c4('0x44')](_0x491be7[_0x08c4('0x15')][_0x23d7c7['name']])){_0x491be7['campaigns'][_0x23d7c7[_0x08c4('0x29')]]=new Campaign(_0x23d7c7);}else{_0x491be7[_0x08c4('0x42')](_0x491be7[_0x08c4('0x15')][_0x23d7c7[_0x08c4('0x29')]],_0x23d7c7);_0x491be7['campaigns'][_0x23d7c7[_0x08c4('0x29')]][_0x08c4('0x62')]=_0x23d7c7['SquareProject']?_0x23d7c7[_0x08c4('0x63')][_0x08c4('0x29')]:undefined;}}}return _0x491be7['campaigns'];};};Realtime[_0x08c4('0x41')][_0x08c4('0x64')]=function(){var _0x9c4ef5=this;return function(_0xc12c11){if(_0xc12c11){freeIsNotKey(_0xc12c11,_0x9c4ef5[_0x08c4('0x18')],'id');for(var _0xe3214a=0x0,_0x2d4179={};_0xe3214a<_0xc12c11[_0x08c4('0x43')];_0xe3214a+=0x1){_0x2d4179=_0xc12c11[_0xe3214a];if(_[_0x08c4('0x44')](_0x9c4ef5[_0x08c4('0x18')][_0x2d4179['id']])){_0x9c4ef5[_0x08c4('0x18')][_0x2d4179['id']]=new VoiceExtension(_0x2d4179);}else{_0x9c4ef5[_0x08c4('0x42')](_0x9c4ef5[_0x08c4('0x18')][_0x2d4179['id']],_0x2d4179);}}}return _0x9c4ef5[_0x08c4('0x18')];};};Realtime[_0x08c4('0x41')][_0x08c4('0x65')]=function(){var _0x220b96=this;return function(_0x528409){clearCampaigns(_0x220b96['campaigns']);for(var _0x11e61e=0x0;_0x11e61e<_0x528409[_0x08c4('0x43')];_0x11e61e+=0x1){_[_0x08c4('0x66')](_0x220b96['campaigns'][_0x528409[_0x11e61e]['name']],_0x528409[_0x11e61e]);}return _0x220b96[_0x08c4('0x15')];};};Realtime[_0x08c4('0x41')]['initFaxAccounts']=function(){var _0x7d128a=this;return function(_0x1e1aec){if(_0x1e1aec){freeIsNotKey(_0x1e1aec,_0x7d128a[_0x08c4('0x24')],'id');for(var _0x2e15a7=0x0,_0x20eb79={},_0x2d2db2={};_0x2e15a7<_0x1e1aec['length'];_0x2e15a7+=0x1){_0x20eb79=_0x1e1aec[_0x2e15a7];if(_['isUndefined'](_0x7d128a['faxAccounts'][_0x20eb79['id']])){_0x7d128a[_0x08c4('0x24')][_0x20eb79['id']]=new FaxAccount(_0x20eb79);}else{_0x7d128a['mergeFromDatabase'](_0x7d128a[_0x08c4('0x24')][_0x20eb79['id']],_0x20eb79);}}}return _0x7d128a[_0x08c4('0x24')];};};module[_0x08c4('0x67')]=Realtime; \ No newline at end of file +var _0xf114=['salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','initTelephones','mergeFromDatabase','initTrunks','trunks','initVoiceQueues','voiceQueues','zendeskAccounts','initFreshdeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','uniqueid','queuecallerexit','sumHoldTime','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','diff','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','../model/agent','../model/telephone','../model/voiceQueue','../model/campaign','../model/zendeskAccount','../model/freshdeskAccount','../model/zohoAccount','../model/servicenowAccount','../model/freshsalesAccount','agents','telephones','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings'];(function(_0x5877b7,_0x57d044){var _0x3a22af=function(_0x44961b){while(--_0x44961b){_0x5877b7['push'](_0x5877b7['shift']());}};_0x3a22af(++_0x57d044);}(_0xf114,0x182));var _0x4f11=function(_0x5dfe07,_0x3c70d3){_0x5dfe07=_0x5dfe07-0x0;var _0x2f353c=_0xf114[_0x5dfe07];return _0x2f353c;};'use strict';var BPromise=require('bluebird');var util=require(_0x4f11('0x0'));var _=require(_0x4f11('0x1'));var moment=require('moment');var Agent=require(_0x4f11('0x2'));var Telephone=require(_0x4f11('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x4f11('0x4'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x4f11('0x5'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x4f11('0x6'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x4f11('0x7'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x4f11('0x8'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x4f11('0x9'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x4f11('0xa'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x4f11('0xb')]={};this[_0x4f11('0xc')]={};this['trunks']={};this['voiceQueues']={};this[_0x4f11('0xd')]={};this[_0x4f11('0xe')]={};this[_0x4f11('0xf')]={};this[_0x4f11('0x10')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x4f11('0x11')]={};this[_0x4f11('0x12')]={};this[_0x4f11('0x13')]={};this[_0x4f11('0x14')]={};this[_0x4f11('0x15')]={};this['zendeskAccounts']={};this[_0x4f11('0x16')]={};this['sugarcrmAccounts']={};this[_0x4f11('0x17')]={};this[_0x4f11('0x18')]={};this[_0x4f11('0x19')]={};this[_0x4f11('0x1a')]={};this['servicenowAccounts']={};this[_0x4f11('0x1b')]={};this[_0x4f11('0x1c')]={};this[_0x4f11('0x1d')]={};};function freeIsNotKey(_0x28e21f,_0x5b607a,_0x912717){var _0x5bde04=_[_0x4f11('0x1e')](_0x28e21f,function(_0x10eeef,_0xd749fc){return _0x10eeef[_0x912717];});for(var _0x48211e in _0x5b607a){if(_0x5b607a[_0x4f11('0x1f')](_0x48211e)){if(!_0x5bde04[_0x48211e]){delete _0x5b607a[_0x48211e];}}}}function freeIsNotKeySip(_0x4f4575,_0x561b69){var _0x44b3af=_[_0x4f11('0x1e')](_0x4f4575,function(_0x2bbfe1,_0x29ec26){return util[_0x4f11('0x20')](_0x4f11('0x21'),_0x2bbfe1[_0x4f11('0x22')]);});for(var _0x242379 in _0x561b69){if(_0x561b69[_0x4f11('0x1f')](_0x242379)){if(!_0x44b3af[_0x242379]){delete _0x561b69[_0x242379];}}}}function freeIsNotKeyAgent(_0x12c2d2,_0x4c74bb){var _0x10c11a=_[_0x4f11('0x1e')](_0x12c2d2,function(_0x14145b,_0x5b2fb3){var _0x462c4b=_[_0x4f11('0x23')](_0x14145b['interface'])?util['format'](_0x4f11('0x21'),_0x14145b[_0x4f11('0x22')]):_0x14145b[_0x4f11('0x24')];return _0x462c4b;});for(var _0x5a9f63 in _0x4c74bb){if(_0x4c74bb[_0x4f11('0x1f')](_0x5a9f63)){if(!_0x10c11a[_0x5a9f63]){delete _0x4c74bb[_0x5a9f63];}}}}function clearVoiceCallReports(_0x141011){_0x141011[_0x4f11('0x25')]=0x0;_0x141011[_0x4f11('0x26')]=0x0;_0x141011['sumHoldTime']=0x0;_0x141011[_0x4f11('0x27')]=0x0;_0x141011[_0x4f11('0x28')]=0x0;}function clearCampaigns(_0x359d50){if(!_[_0x4f11('0x29')](_0x359d50)){for(var _0x1d699c in _0x359d50){if(_0x359d50[_0x4f11('0x1f')](_0x1d699c)){_0x359d50[_0x1d699c][_0x4f11('0x2a')]=0x0;_0x359d50[_0x1d699c][_0x4f11('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x4812e1){if(!_['isEmpty'](_0x4812e1)){for(var _0xa96dfd in _0x4812e1){if(_0x4812e1[_0x4f11('0x1f')](_0xa96dfd)){_0x4812e1[_0xa96dfd][_0x4f11('0x25')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x26')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x2c')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x2d')]=0x0;_0x4812e1[_0xa96dfd]['sumHoldTime']=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x27')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x28')]=0x0;_0x4812e1[_0xa96dfd]['outboundAnswerAgiCallsDay']=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x2e')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x2f')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x30')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x31')]=0x0;_0x4812e1[_0xa96dfd]['outboundUnknownCallsDay']=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x32')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x33')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x34')]=0x0;_0x4812e1[_0xa96dfd]['outboundOriginateFailureCallsDay']=0x0;_0x4812e1[_0xa96dfd]['outboundRejectCallsDay']=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x35')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x36')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x37')]=0x0;_0x4812e1[_0xa96dfd][_0x4f11('0x38')]=!![];}}}}Realtime[_0x4f11('0x39')]['mergeFromDatabase']=function(_0x1736c7,_0x6d1ee4){for(var _0x48d33e in _0x6d1ee4){if(_0x1736c7[_0x4f11('0x1f')](_0x48d33e)){_0x1736c7[_0x48d33e]=_0x6d1ee4[_0x48d33e];}}};Realtime[_0x4f11('0x39')][_0x4f11('0x3a')]=function(){var _0x217906=this;return function(_0x1f50e7){if(_0x1f50e7){freeIsNotKeyAgent(_0x1f50e7,_0x217906[_0x4f11('0xb')]);for(var _0x3031f5=0x0,_0x352b69={},_0x24cb9a={};_0x3031f5<_0x1f50e7[_0x4f11('0x3b')];_0x3031f5+=0x1){_0x352b69=_0x1f50e7[_0x3031f5];var _0x2f1b7e=_[_0x4f11('0x23')](_0x352b69[_0x4f11('0x24')])?util[_0x4f11('0x20')](_0x4f11('0x21'),_0x352b69['name']):_0x352b69['interface'];if(_[_0x4f11('0x3c')](_0x217906[_0x4f11('0xb')][_0x2f1b7e])){_0x217906[_0x4f11('0xb')][_0x2f1b7e]=new Agent(_0x352b69);}else{_0x217906['mergeFromDatabase'](_0x217906['agents'][_0x2f1b7e],_0x352b69);}}}return _0x217906[_0x4f11('0xb')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x3d')]=function(){var _0x42f505=this;return function(_0x3f247d){if(_0x3f247d){freeIsNotKeySip(_0x3f247d,_0x42f505[_0x4f11('0xc')]);for(var _0x3c5df6=0x0,_0x2de421={},_0x45cff2={};_0x3c5df6<_0x3f247d[_0x4f11('0x3b')];_0x3c5df6+=0x1){_0x2de421=_0x3f247d[_0x3c5df6];if(_[_0x4f11('0x3c')](_0x42f505['telephones'][util[_0x4f11('0x20')](_0x4f11('0x21'),_0x2de421[_0x4f11('0x22')])])){_0x42f505['telephones'][util[_0x4f11('0x20')]('SIP/%s',_0x2de421[_0x4f11('0x22')])]=new Telephone(_0x2de421);}else{_0x42f505[_0x4f11('0x3e')](_0x42f505[_0x4f11('0xc')][util[_0x4f11('0x20')]('SIP/%s',_0x2de421['name'])],_0x2de421);}}}return _0x42f505[_0x4f11('0xc')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x3f')]=function(){var _0xf99807=this;return function(_0xa9b58a){if(_0xa9b58a){freeIsNotKeySip(_0xa9b58a,_0xf99807['trunks']);for(var _0x121e00=0x0,_0x588a25={},_0x37cae1={};_0x121e00<_0xa9b58a['length'];_0x121e00+=0x1){_0x588a25=_0xa9b58a[_0x121e00];if(_['isUndefined'](_0xf99807[_0x4f11('0x40')][util[_0x4f11('0x20')]('SIP/%s',_0x588a25[_0x4f11('0x22')])])){_0xf99807[_0x4f11('0x40')][util[_0x4f11('0x20')](_0x4f11('0x21'),_0x588a25['name'])]=new Trunk(_0x588a25);}else{_0xf99807[_0x4f11('0x3e')](_0xf99807[_0x4f11('0x40')][util['format']('SIP/%s',_0x588a25[_0x4f11('0x22')])],_0x588a25);}}}return _0xf99807[_0x4f11('0x40')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x41')]=function(){var _0xa86d6c=this;return function(_0x2e6ef6){if(_0x2e6ef6){freeIsNotKey(_0x2e6ef6,_0xa86d6c[_0x4f11('0x42')],_0x4f11('0x22'));for(var _0x4f4f9b=0x0,_0x3b0af5={},_0x44a082={};_0x4f4f9b<_0x2e6ef6['length'];_0x4f4f9b+=0x1){_0x3b0af5=_0x2e6ef6[_0x4f4f9b];if(_[_0x4f11('0x3c')](_0xa86d6c[_0x4f11('0x42')][_0x3b0af5[_0x4f11('0x22')]])){_0xa86d6c[_0x4f11('0x42')][_0x3b0af5['name']]=new VoiceQueue(_0x3b0af5);}else{_0xa86d6c['mergeFromDatabase'](_0xa86d6c[_0x4f11('0x42')][_0x3b0af5[_0x4f11('0x22')]],_0x3b0af5);}}}return _0xa86d6c[_0x4f11('0x42')];};};Realtime[_0x4f11('0x39')]['initTriggers']=function(){var _0x47717a=this;return function(_0xfa1d55){if(_0xfa1d55){freeIsNotKey(_0xfa1d55,_0x47717a[_0x4f11('0xd')],'id');for(var _0x493cbf=0x0,_0x2aaafb={},_0x52e4b9={};_0x493cbf<_0xfa1d55['length'];_0x493cbf+=0x1){_0x2aaafb=_0xfa1d55[_0x493cbf];if(_['isUndefined'](_0x47717a[_0x4f11('0xd')][_0x2aaafb['id']])){_0x47717a[_0x4f11('0xd')][_0x2aaafb['id']]=new Trigger(_0x2aaafb);}else{_0x47717a[_0x4f11('0x3e')](_0x47717a[_0x4f11('0xd')][_0x2aaafb['id']],_0x2aaafb);}}}return _0x47717a[_0x4f11('0xd')];};};Realtime['prototype']['initTemplates']=function(){var _0x175f75=this;return function(_0x560f34){if(_0x560f34){freeIsNotKey(_0x560f34,_0x175f75[_0x4f11('0xf')],'id');for(var _0x3773c4=0x0,_0x4964ab={},_0x13456c={};_0x3773c4<_0x560f34[_0x4f11('0x3b')];_0x3773c4+=0x1){_0x4964ab=_0x560f34[_0x3773c4];if(_[_0x4f11('0x3c')](_0x175f75[_0x4f11('0xf')][_0x4964ab['id']])){_0x175f75['templates'][_0x4964ab['id']]=new Template(_0x4964ab);}else{_0x175f75[_0x4f11('0x3e')](_0x175f75[_0x4f11('0xf')][_0x4964ab['id']],_0x4964ab);}}}return _0x175f75[_0x4f11('0xf')];};};Realtime[_0x4f11('0x39')]['initZendeskAccounts']=function(){var _0x2126f6=this;return function(_0x305a90){if(_0x305a90){freeIsNotKey(_0x305a90,_0x2126f6[_0x4f11('0x43')],'id');for(var _0x28b7b1=0x0,_0x386259={},_0x1215d6={};_0x28b7b1<_0x305a90['length'];_0x28b7b1+=0x1){_0x386259=_0x305a90[_0x28b7b1];if(_['isUndefined'](_0x2126f6['zendeskAccounts'][_0x386259['id']])){_0x2126f6[_0x4f11('0x43')][_0x386259['id']]=new ZendeskAccount(_0x386259);}else{_0x2126f6[_0x4f11('0x3e')](_0x2126f6[_0x4f11('0x43')][_0x386259['id']],_0x386259);}}}return _0x2126f6['zendeskAccounts'];};};Realtime[_0x4f11('0x39')]['initSalesforceAccounts']=function(){var _0x2596e0=this;return function(_0x59d2b9){if(_0x59d2b9){freeIsNotKey(_0x59d2b9,_0x2596e0[_0x4f11('0x16')],'id');for(var _0x23b376=0x0,_0x4197e0={},_0x3230f8={};_0x23b376<_0x59d2b9[_0x4f11('0x3b')];_0x23b376+=0x1){_0x4197e0=_0x59d2b9[_0x23b376];if(_[_0x4f11('0x3c')](_0x2596e0[_0x4f11('0x16')][_0x4197e0['id']])){_0x2596e0[_0x4f11('0x16')][_0x4197e0['id']]=new SalesforceAccount(_0x4197e0);}else{_0x2596e0[_0x4f11('0x3e')](_0x2596e0[_0x4f11('0x16')][_0x4197e0['id']],_0x4197e0);}}}return _0x2596e0[_0x4f11('0x16')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x44')]=function(){var _0x25f96a=this;return function(_0xe3f128){if(_0xe3f128){freeIsNotKey(_0xe3f128,_0x25f96a[_0x4f11('0x17')],'id');for(var _0x1bb9a0=0x0,_0x5edb96={},_0x1c9855={};_0x1bb9a0<_0xe3f128[_0x4f11('0x3b')];_0x1bb9a0+=0x1){_0x5edb96=_0xe3f128[_0x1bb9a0];if(_[_0x4f11('0x3c')](_0x25f96a['freshdeskAccounts'][_0x5edb96['id']])){_0x25f96a[_0x4f11('0x17')][_0x5edb96['id']]=new FreshdeskAccount(_0x5edb96);}else{_0x25f96a[_0x4f11('0x3e')](_0x25f96a[_0x4f11('0x17')][_0x5edb96['id']],_0x5edb96);}}}return _0x25f96a[_0x4f11('0x17')];};};Realtime[_0x4f11('0x39')]['initZohoAccounts']=function(){var _0x5b878a=this;return function(_0xacfe6e){if(_0xacfe6e){freeIsNotKey(_0xacfe6e,_0x5b878a[_0x4f11('0x18')],'id');for(var _0x3c4529=0x0,_0x413373={},_0x35a810={};_0x3c4529<_0xacfe6e[_0x4f11('0x3b')];_0x3c4529+=0x1){_0x413373=_0xacfe6e[_0x3c4529];if(_[_0x4f11('0x3c')](_0x5b878a[_0x4f11('0x18')][_0x413373['id']])){_0x5b878a['zohoAccounts'][_0x413373['id']]=new ZohoAccount(_0x413373);}else{_0x5b878a[_0x4f11('0x3e')](_0x5b878a['zohoAccounts'][_0x413373['id']],_0x413373);}}}return _0x5b878a[_0x4f11('0x18')];};};Realtime[_0x4f11('0x39')]['initDeskAccounts']=function(){var _0x196b64=this;return function(_0x325fe8){if(_0x325fe8){freeIsNotKey(_0x325fe8,_0x196b64['deskAccounts'],'id');for(var _0x3efb25=0x0,_0x456eb3={},_0x18f539={};_0x3efb25<_0x325fe8[_0x4f11('0x3b')];_0x3efb25+=0x1){_0x456eb3=_0x325fe8[_0x3efb25];if(_[_0x4f11('0x3c')](_0x196b64['deskAccounts'][_0x456eb3['id']])){_0x196b64[_0x4f11('0x19')][_0x456eb3['id']]=new DeskAccount(_0x456eb3);}else{_0x196b64[_0x4f11('0x3e')](_0x196b64[_0x4f11('0x19')][_0x456eb3['id']],_0x456eb3);}}}return _0x196b64['deskAccounts'];};};Realtime[_0x4f11('0x39')][_0x4f11('0x45')]=function(){var _0x5e2861=this;return function(_0x2f61e8){if(_0x2f61e8){freeIsNotKey(_0x2f61e8,_0x5e2861[_0x4f11('0x46')],'id');for(var _0x15c804=0x0,_0x516ada={},_0x458f2f={};_0x15c804<_0x2f61e8['length'];_0x15c804+=0x1){_0x516ada=_0x2f61e8[_0x15c804];if(_[_0x4f11('0x3c')](_0x5e2861[_0x4f11('0x46')][_0x516ada['id']])){_0x5e2861['sugarcrmAccounts'][_0x516ada['id']]=new SugarcrmAccount(_0x516ada);}else{_0x5e2861['mergeFromDatabase'](_0x5e2861[_0x4f11('0x46')][_0x516ada['id']],_0x516ada);}}}return _0x5e2861[_0x4f11('0x46')];};};Realtime['prototype'][_0x4f11('0x47')]=function(){var _0x45eed7=this;return function(_0x230754){if(_0x230754){freeIsNotKey(_0x230754,_0x45eed7[_0x4f11('0x1a')],'id');for(var _0x31437d=0x0,_0x421ebd={},_0x5448ed={};_0x31437d<_0x230754[_0x4f11('0x3b')];_0x31437d+=0x1){_0x421ebd=_0x230754[_0x31437d];if(_[_0x4f11('0x3c')](_0x45eed7[_0x4f11('0x1a')][_0x421ebd['id']])){_0x45eed7[_0x4f11('0x1a')][_0x421ebd['id']]=new VtigerAccount(_0x421ebd);}else{_0x45eed7[_0x4f11('0x3e')](_0x45eed7['vtigerAccounts'][_0x421ebd['id']],_0x421ebd);}}}return _0x45eed7[_0x4f11('0x1a')];};};Realtime['prototype'][_0x4f11('0x48')]=function(){var _0x515175=this;return function(_0x506f82){if(_0x506f82){freeIsNotKey(_0x506f82,_0x515175['servicenowAccounts'],'id');for(var _0x444926=0x0,_0x1e2056={},_0x2aaee8={};_0x444926<_0x506f82[_0x4f11('0x3b')];_0x444926+=0x1){_0x1e2056=_0x506f82[_0x444926];if(_[_0x4f11('0x3c')](_0x515175['servicenowAccounts'][_0x1e2056['id']])){_0x515175[_0x4f11('0x49')][_0x1e2056['id']]=new ServicenowAccount(_0x1e2056);}else{_0x515175['mergeFromDatabase'](_0x515175['servicenowAccounts'][_0x1e2056['id']],_0x1e2056);}}}return _0x515175[_0x4f11('0x49')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x4a')]=function(){var _0x8fad82=this;return function(_0x4a33ab){if(_0x4a33ab){freeIsNotKey(_0x4a33ab,_0x8fad82[_0x4f11('0x1b')],'id');for(var _0x5a0e24=0x0,_0x339cac={},_0x5b94aa={};_0x5a0e24<_0x4a33ab[_0x4f11('0x3b')];_0x5a0e24+=0x1){_0x339cac=_0x4a33ab[_0x5a0e24];if(_[_0x4f11('0x3c')](_0x8fad82[_0x4f11('0x1b')][_0x339cac['id']])){_0x8fad82[_0x4f11('0x1b')][_0x339cac['id']]=new Dynamics365Account(_0x339cac);}else{_0x8fad82[_0x4f11('0x3e')](_0x8fad82[_0x4f11('0x1b')][_0x339cac['id']],_0x339cac);}}}return _0x8fad82['dynamics365Accounts'];};};Realtime[_0x4f11('0x39')][_0x4f11('0x4b')]=function(){var _0x20d380=this;return function(_0x5f0a95){if(_0x5f0a95){freeIsNotKey(_0x5f0a95,_0x20d380[_0x4f11('0x1c')],'id');for(var _0x3a06ef=0x0,_0x2b30ab={},_0x1e8308={};_0x3a06ef<_0x5f0a95[_0x4f11('0x3b')];_0x3a06ef+=0x1){_0x2b30ab=_0x5f0a95[_0x3a06ef];if(_['isUndefined'](_0x20d380[_0x4f11('0x1c')][_0x2b30ab['id']])){_0x20d380[_0x4f11('0x1c')][_0x2b30ab['id']]=new FreshsalesAccount(_0x2b30ab);}else{_0x20d380[_0x4f11('0x3e')](_0x20d380[_0x4f11('0x1c')][_0x2b30ab['id']],_0x2b30ab);}}}return _0x20d380[_0x4f11('0x1c')];};};Realtime[_0x4f11('0x39')]['initVoiceQueueHopperHistory']=function(){var _0x1302cb=this;return function(_0x36a089){for(var _0x9a0646=0x0;_0x9a0646<_0x36a089[_0x4f11('0x3b')];_0x9a0646+=0x1){_[_0x4f11('0x4c')](_0x1302cb[_0x4f11('0x42')][_0x36a089[_0x9a0646][_0x4f11('0x22')]],_0x36a089[_0x9a0646]);}return _0x1302cb[_0x4f11('0x42')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x4d')]=function(){var _0xa14ef6=this;return function(_0x1c6874){clearVoiceQueues(_0xa14ef6[_0x4f11('0x42')]);if(_0x1c6874){_0x1c6874=_['groupBy'](_0x1c6874,_0x4f11('0x4e'));for(var _0x4c20af in _0x1c6874){if(_0x1c6874[_0x4f11('0x1f')](_0x4c20af)){var _0xb17567={};for(var _0xb7f282=0x0;_0xb7f282<_0x1c6874[_0x4c20af]['length'];_0xb7f282+=0x1){var _0x21397d=_0x1c6874[_0x4c20af][_0xb7f282]['queue'];if(_0xa14ef6[_0x4f11('0x42')][_0x21397d]){if(_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x4f')]){_0xa14ef6[_0x4f11('0x42')][_0x21397d][_0x4f11('0x2c')]+=0x1;}if(_0x1c6874[_0x4c20af][_0xb7f282]['queuecallerabandon']){_0xa14ef6[_0x4f11('0x42')][_0x21397d][_0x4f11('0x2d')]+=0x1;}_0xa14ef6[_0x4f11('0x42')][_0x21397d][_0x4f11('0x50')]+=moment(_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x51')])['diff'](moment(_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x52')]),_0x4f11('0x53'))||0x0;if(_0xb7f282===_0x1c6874[_0x4c20af]['length']-0x1){_0xa14ef6[_0x4f11('0x42')][_0x21397d]['sumDuration']+=moment(_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x54')]||_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x55')]||_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x56')])['diff'](moment(_0x1c6874[_0x4c20af][_0xb7f282]['queuecallerjoinAt']),_0x4f11('0x53'))||0x0;_0xa14ef6['voiceQueues'][_0x21397d][_0x4f11('0x25')]+=0x1;if(_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x57')]){_0xa14ef6[_0x4f11('0x42')][_0x21397d]['answered']+=0x1;_0xa14ef6[_0x4f11('0x42')][_0x21397d][_0x4f11('0x28')]+=moment(_0x1c6874[_0x4c20af][_0xb7f282][_0x4f11('0x54')])[_0x4f11('0x58')](moment(_0x1c6874[_0x4c20af][_0xb7f282]['queuecallerleaveAt']),_0x4f11('0x53'))||0x0;}}else{_0xa14ef6[_0x4f11('0x42')][_0x21397d][_0x4f11('0x27')]+=_0xa14ef6['voiceQueues'][_0x21397d][_0x4f11('0x50')]||0x0;}}}}}}return _0xa14ef6[_0x4f11('0x42')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x59')]=function(){var _0x19e76b=this;return function(_0x1b2f82){clearVoiceCallReports(_0x19e76b[_0x4f11('0x10')]);if(_0x1b2f82){for(var _0x5651fb=0x0;_0x5651fb<_0x1b2f82['length'];_0x5651fb+=0x1){_0x19e76b[_0x4f11('0x10')][_0x4f11('0x25')]+=0x1;_0x19e76b[_0x4f11('0x10')][_0x4f11('0x27')]+=_0x1b2f82[_0x5651fb][_0x4f11('0x5a')];if(_0x1b2f82[_0x5651fb][_0x4f11('0x5b')]===_0x4f11('0x5c')){_0x19e76b[_0x4f11('0x10')]['answered']+=0x1;_0x19e76b['outbound']['sumHoldTime']+=_0x1b2f82[_0x5651fb][_0x4f11('0x5a')]-_0x1b2f82[_0x5651fb][_0x4f11('0x5d')]||0x0;_0x19e76b[_0x4f11('0x10')][_0x4f11('0x28')]+=_0x1b2f82[_0x5651fb][_0x4f11('0x5d')];}}}return _0x19e76b[_0x4f11('0x10')];};};Realtime['prototype'][_0x4f11('0x5e')]=function(){var _0x5ad6ff=this;return function(_0x42c424){if(_0x42c424){freeIsNotKey(_0x42c424,_0x5ad6ff[_0x4f11('0xe')],_0x4f11('0x22'));for(var _0x2ff97f=0x0,_0x332af7={};_0x2ff97f<_0x42c424[_0x4f11('0x3b')];_0x2ff97f+=0x1){_0x332af7=_0x42c424[_0x2ff97f];if(_[_0x4f11('0x3c')](_0x5ad6ff[_0x4f11('0xe')][_0x332af7[_0x4f11('0x22')]])){_0x5ad6ff[_0x4f11('0xe')][_0x332af7[_0x4f11('0x22')]]=new Campaign(_0x332af7);}else{_0x5ad6ff[_0x4f11('0x3e')](_0x5ad6ff['campaigns'][_0x332af7[_0x4f11('0x22')]],_0x332af7);_0x5ad6ff[_0x4f11('0xe')][_0x332af7[_0x4f11('0x22')]][_0x4f11('0x5f')]=_0x332af7[_0x4f11('0x60')]?_0x332af7[_0x4f11('0x60')]['name']:undefined;}}}return _0x5ad6ff[_0x4f11('0xe')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x61')]=function(){var _0xf08aed=this;return function(_0x452fa5){if(_0x452fa5){freeIsNotKey(_0x452fa5,_0xf08aed[_0x4f11('0x62')],'id');for(var _0x4a1f0e=0x0,_0x530dc4={};_0x4a1f0e<_0x452fa5[_0x4f11('0x3b')];_0x4a1f0e+=0x1){_0x530dc4=_0x452fa5[_0x4a1f0e];if(_[_0x4f11('0x3c')](_0xf08aed['voiceExtensions'][_0x530dc4['id']])){_0xf08aed['voiceExtensions'][_0x530dc4['id']]=new VoiceExtension(_0x530dc4);}else{_0xf08aed[_0x4f11('0x3e')](_0xf08aed[_0x4f11('0x62')][_0x530dc4['id']],_0x530dc4);}}}return _0xf08aed[_0x4f11('0x62')];};};Realtime[_0x4f11('0x39')][_0x4f11('0x63')]=function(){var _0x500039=this;return function(_0x1c87f7){clearCampaigns(_0x500039[_0x4f11('0xe')]);for(var _0xbf61f1=0x0;_0xbf61f1<_0x1c87f7[_0x4f11('0x3b')];_0xbf61f1+=0x1){_[_0x4f11('0x4c')](_0x500039[_0x4f11('0xe')][_0x1c87f7[_0xbf61f1][_0x4f11('0x22')]],_0x1c87f7[_0xbf61f1]);}return _0x500039['campaigns'];};};Realtime[_0x4f11('0x39')][_0x4f11('0x64')]=function(){var _0x3e7db4=this;return function(_0x31ef35){if(_0x31ef35){freeIsNotKey(_0x31ef35,_0x3e7db4[_0x4f11('0x1d')],'id');for(var _0x501ae3=0x0,_0x222f26={},_0x2940d1={};_0x501ae3<_0x31ef35[_0x4f11('0x3b')];_0x501ae3+=0x1){_0x222f26=_0x31ef35[_0x501ae3];if(_['isUndefined'](_0x3e7db4[_0x4f11('0x1d')][_0x222f26['id']])){_0x3e7db4['faxAccounts'][_0x222f26['id']]=new FaxAccount(_0x222f26);}else{_0x3e7db4['mergeFromDatabase'](_0x3e7db4[_0x4f11('0x1d')][_0x222f26['id']],_0x222f26);}}}return _0x3e7db4[_0x4f11('0x1d')];};};module[_0x4f11('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f3751b5..579c684 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 _0x0cee=['channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','blindTransfer','internal','UserId','split','membername','create','monitor','monitors','monitorFilename','createdAt','exten','xcally-motion-preview','connectedlinename','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','accountcode','isNil','find','name','voiceQueueReport','length','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','format','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','voiceCallReport','type','dialer','queue','lastdata','context','destination','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x0cee,0x12f));var _0xe0ce=function(_0x43f47b,_0x19f40d){_0x43f47b=_0x43f47b-0x0;var _0x5ba225=_0x0cee[_0x43f47b];return _0x5ba225;};'use strict';var _=require(_0xe0ce('0x0'));var moment=require(_0xe0ce('0x1'));var util=require(_0xe0ce('0x2'));var config=require(_0xe0ce('0x3'));var ami=require(_0xe0ce('0x4'));var RpcVoiceAgentReport=require(_0xe0ce('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xe0ce('0x6'));var RpcVoiceQueueReport=require(_0xe0ce('0x7'));var RpcVoiceRecording=require(_0xe0ce('0x8'));var RpcVoiceTransferReport=require(_0xe0ce('0x9'));var VoiceQueueReport=require(_0xe0ce('0xa'));var VoiceCallReport=require(_0xe0ce('0xb'));var VoiceAgentReport=require(_0xe0ce('0xc'));var VoiceDialReport=require(_0xe0ce('0xd'));var UserReport=require('./userReport');function Report(_0x27eea3){this[_0xe0ce('0xe')]=_0x27eea3;this['agents']=_0x27eea3[_0xe0ce('0xf')];this[_0xe0ce('0x10')]=_0x27eea3[_0xe0ce('0x10')];}Report[_0xe0ce('0x11')]['sync']=function(_0x48a0a4){var _0x5cf1d8=new VoiceQueueReport(this[_0xe0ce('0xe')]);var _0x441e01=new VoiceAgentReport(this[_0xe0ce('0xe')]);var _0x2698f8=new VoiceDialReport(this[_0xe0ce('0xe')]);var _0x3a0754=new VoiceCallReport(this[_0xe0ce('0xe')]);var _0x4598e1=new UserReport(this[_0xe0ce('0xe')]);if(config[_0xe0ce('0x12')]&&config[_0xe0ce('0x12')][_0xe0ce('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xe0ce('0x14')](this));ami['on'](_0xe0ce('0x15'),this['voiceCallReport']['bind'](this));ami['on'](_0xe0ce('0x16'),this[_0xe0ce('0x17')][_0xe0ce('0x14')](this));ami['on'](_0xe0ce('0x18'),this[_0xe0ce('0x19')]['bind'](this));ami['on'](_0xe0ce('0x1a'),this['blindTransfer'][_0xe0ce('0x14')](this));ami['on'](_0xe0ce('0x1b'),this[_0xe0ce('0x1c')][_0xe0ce('0x14')](this));}};Report[_0xe0ce('0x11')]['findAgent']=function(_0x59bcab){var _0xadcb66;_0xadcb66=_['find'](this['agents'],function(_0x2875bf){return _0x2875bf[_0xe0ce('0x1d')]==_0x59bcab||_0x2875bf['name']==_0x59bcab;});if(_[_0xe0ce('0x1e')](_0xadcb66)){var _0x96c2a4=_[_0xe0ce('0x1f')](this[_0xe0ce('0x10')],function(_0x3b1975){return _0x3b1975['accountcode']==_0x59bcab||_0x3b1975[_0xe0ce('0x20')]==_0x59bcab;});if(_0x96c2a4){_0xadcb66=_['find'](this[_0xe0ce('0xf')],function(_0x4a394d){return _0x4a394d['interface']==util['format']('SIP/%s',_0x96c2a4[_0xe0ce('0x20')]);});}}return _0xadcb66;};Report['prototype'][_0xe0ce('0x21')]=function(_0x21f9c3){for(var _0x33211a=0x0;_0x33211a<_0x21f9c3[_0xe0ce('0x22')];_0x33211a+=0x1){var _0x3a8c3e=this[_0xe0ce('0x23')](_0x21f9c3[_0x33211a][_0xe0ce('0x24')]);if(_0x3a8c3e){_0x21f9c3[_0x33211a][_0xe0ce('0x1d')]=_0x3a8c3e[_0xe0ce('0x1d')];_0x21f9c3[_0x33211a][_0xe0ce('0x25')]=!![];_0x21f9c3[_0x33211a][_0xe0ce('0x26')]=_0x3a8c3e[_0xe0ce('0x20')];_0x21f9c3[_0x33211a]['interface']=_[_0xe0ce('0x1e')](_0x3a8c3e[_0xe0ce('0x27')])?util[_0xe0ce('0x28')](_0xe0ce('0x29'),_0x3a8c3e['name']):_0x3a8c3e[_0xe0ce('0x27')];if(_0x21f9c3[_0x33211a][_0xe0ce('0x2a')]){_0x21f9c3[_0x33211a]['queuecallercompleteAt']=moment()[_0xe0ce('0x28')](_0xe0ce('0x2b'));}if(_0x21f9c3[_0x33211a][_0xe0ce('0x2c')]){_0x21f9c3[_0x33211a][_0xe0ce('0x2d')]=moment()[_0xe0ce('0x28')](_0xe0ce('0x2b'));}RpcMemberReport[_0xe0ce('0x21')](_0x21f9c3[_0x33211a]);}RpcVoiceQueueReport['create'](_0x21f9c3[_0x33211a]);}};function extractCalleridNumber(_0x1a95a7){var _0x2d06ab=_0x1a95a7[_0xe0ce('0x2e')](/<(.*?)>/);return _0x2d06ab?_0x2d06ab[0x1]:_0x1a95a7;}Report[_0xe0ce('0x11')][_0xe0ce('0x2f')]=function(_0x1271c3){for(var _0x108260=0x0;_0x108260','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','internal','split','membername','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','prototype','accountcode','name','isNil','find','interface','format','SIP/%s','length','findAgent','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','keys','voiceCallReport','destination','exten','type','dialer','lastapplication','lastdata','queue','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid'];(function(_0x5a704d,_0x4082d8){var _0x1f76e1=function(_0x3d20c0){while(--_0x3d20c0){_0x5a704d['push'](_0x5a704d['shift']());}};_0x1f76e1(++_0x4082d8);}(_0xf109,0xce));var _0x9f10=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xf109[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x9f10('0x0'));var moment=require(_0x9f10('0x1'));var util=require(_0x9f10('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9f10('0x3'));var RpcVoiceDialReport=require(_0x9f10('0x4'));var RpcMemberReport=require(_0x9f10('0x5'));var RpcVoiceQueueReport=require(_0x9f10('0x6'));var RpcVoiceRecording=require(_0x9f10('0x7'));var RpcVoiceTransferReport=require(_0x9f10('0x8'));var VoiceQueueReport=require(_0x9f10('0x9'));var VoiceCallReport=require(_0x9f10('0xa'));var VoiceAgentReport=require(_0x9f10('0xb'));var VoiceDialReport=require(_0x9f10('0xc'));var UserReport=require(_0x9f10('0xd'));function Report(_0x5c8719){this[_0x9f10('0xe')]=_0x5c8719;this[_0x9f10('0xf')]=_0x5c8719[_0x9f10('0xf')];this[_0x9f10('0x10')]=_0x5c8719[_0x9f10('0x10')];}Report['prototype'][_0x9f10('0x11')]=function(_0x18995b){var _0x4522d9=new VoiceQueueReport(this['realtime']);var _0x50215f=new VoiceAgentReport(this[_0x9f10('0xe')]);var _0x311935=new VoiceDialReport(this[_0x9f10('0xe')]);var _0x56780e=new VoiceCallReport(this[_0x9f10('0xe')]);var _0x260606=new UserReport(this[_0x9f10('0xe')]);if(config['xdr']&&config[_0x9f10('0x12')][_0x9f10('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x9f10('0x14')][_0x9f10('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x9f10('0x15')](this));ami['on'](_0x9f10('0x16'),this['voiceAgentReport'][_0x9f10('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x9f10('0x17')][_0x9f10('0x15')](this));ami['on']('blindtransfer',this[_0x9f10('0x18')][_0x9f10('0x15')](this));ami['on']('attendedtransfer',this[_0x9f10('0x19')]['bind'](this));}};Report[_0x9f10('0x1a')]['findAgent']=function(_0x2c5064){var _0x56fb44;_0x56fb44=_['find'](this[_0x9f10('0xf')],function(_0x1a1e7e){return _0x1a1e7e[_0x9f10('0x1b')]==_0x2c5064||_0x1a1e7e[_0x9f10('0x1c')]==_0x2c5064;});if(_[_0x9f10('0x1d')](_0x56fb44)){var _0x332575=_[_0x9f10('0x1e')](this['telephones'],function(_0x366044){return _0x366044['accountcode']==_0x2c5064||_0x366044[_0x9f10('0x1c')]==_0x2c5064;});if(_0x332575){_0x56fb44=_[_0x9f10('0x1e')](this[_0x9f10('0xf')],function(_0x4adbda){return _0x4adbda[_0x9f10('0x1f')]==util[_0x9f10('0x20')](_0x9f10('0x21'),_0x332575['name']);});}}return _0x56fb44;};Report[_0x9f10('0x1a')][_0x9f10('0x14')]=function(_0x44b99d){for(var _0x4c531e=0x0;_0x4c531e<_0x44b99d[_0x9f10('0x22')];_0x4c531e+=0x1){var _0x23c2e7=this[_0x9f10('0x23')](_0x44b99d[_0x4c531e][_0x9f10('0x24')]);if(_0x23c2e7){_0x44b99d[_0x4c531e]['accountcode']=_0x23c2e7['accountcode'];_0x44b99d[_0x4c531e]['assigned']=!![];_0x44b99d[_0x4c531e][_0x9f10('0x25')]=_0x23c2e7['name'];_0x44b99d[_0x4c531e][_0x9f10('0x1f')]=_[_0x9f10('0x1d')](_0x23c2e7[_0x9f10('0x1f')])?util[_0x9f10('0x20')](_0x9f10('0x21'),_0x23c2e7['name']):_0x23c2e7[_0x9f10('0x1f')];if(_0x44b99d[_0x4c531e][_0x9f10('0x26')]){_0x44b99d[_0x4c531e][_0x9f10('0x27')]=moment()[_0x9f10('0x20')](_0x9f10('0x28'));}if(_0x44b99d[_0x4c531e][_0x9f10('0x29')]){_0x44b99d[_0x4c531e]['queuecallerexitAt']=moment()[_0x9f10('0x20')](_0x9f10('0x28'));}RpcMemberReport[_0x9f10('0x14')](_0x44b99d[_0x4c531e]);}RpcVoiceQueueReport[_0x9f10('0x2a')](_0x44b99d[_0x4c531e]);}};function extractCalleridNumber(_0x49b3f4){var _0x44f0a0=_0x49b3f4[_0x9f10('0x2b')](/<(.*?)>/);return _0x44f0a0?_0x44f0a0[0x1]:_0x49b3f4;}Report[_0x9f10('0x1a')]['getAgentByInternal']=function(_0x434128){for(var _0x5af399=0x0;_0x5af3990x0?_0x4c77e0:0x0;this[_0x31b7('0x12')][_0x4bd00d['queue']][_0x31b7('0x6e')]=this['voiceQueues'][_0x4bd00d[_0x31b7('0x67')]][_0x31b7('0x6e')]>_[_0x31b7('0x6d')](_0x4bd00d[_0x31b7('0x6f')])?_['toNumber'](_0x4bd00d[_0x31b7('0x6f')]):this['voiceQueues'][_0x4bd00d[_0x31b7('0x67')]][_0x31b7('0x6e')];this[_0x31b7('0x50')](this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]],_0x31b7('0x16'));}logger['debug'](_0x31b7('0x70'),util[_0x31b7('0x3e')](this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]],{'showHidden':![],'depth':null}));ami[_0x31b7('0x44')](_0x31b7('0x71'),this[_0x31b7('0x12')][_0x4bd00d[_0x31b7('0x67')]]);}}}catch(_0x350fba){logger[_0x31b7('0x3d')](_0x31b7('0x65'),util[_0x31b7('0x3e')](_0x350fba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x1a')]=function(_0x2de398){logger[_0x31b7('0x46')](_0x31b7('0x72'),util[_0x31b7('0x3e')](_0x2de398,{'showHidden':![],'depth':null}));this[_0x31b7('0x13')]=!![];};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x73')]=function(_0x2640db){try{if(this[_0x31b7('0x66')](_0x2640db)){logger[_0x31b7('0x46')](_0x31b7('0x74'),_0x2640db[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x2640db,{'showHidden':![],'depth':null}));if(_[_0x31b7('0x60')](this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]]))this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]]=[];if(_[_0x31b7('0x60')](this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]))this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]={};var _0x4b923b=new QueueReport();_0x4b923b[_0x31b7('0x4a')]=_0x2640db[_0x31b7('0x67')];_0x4b923b['type']=this[_0x31b7('0x12')][_0x4b923b[_0x31b7('0x4a')]]&&this[_0x31b7('0x12')][_0x4b923b[_0x31b7('0x4a')]][_0x31b7('0x51')]?this['voiceQueues'][_0x4b923b[_0x31b7('0x4a')]][_0x31b7('0x51')]||_0x31b7('0x75'):_0x31b7('0x75');_0x4b923b[_0x31b7('0x67')]=_0x2640db[_0x31b7('0x67')];_0x4b923b[_0x31b7('0x76')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x4b923b[_0x31b7('0x78')]=_0x2640db[_0x31b7('0x78')];_0x4b923b[_0x31b7('0x79')]=_0x2640db['count'];_0x4b923b['uniqueid']=_0x2640db['uniqueid'];_0x4b923b[_0x31b7('0x7a')]=this['channels'][_0x2640db[_0x31b7('0x48')]][_0x31b7('0x7a')];logger['info'](_0x31b7('0x7b'),_0x4b923b[_0x31b7('0x4a')],_0x4b923b[_0x31b7('0x51')]);_[_0x31b7('0x7c')](_0x4b923b,_['pick'](_0x2640db,_['keys'](_0x4b923b)));this[_0x31b7('0xe')][_0x2640db[_0x31b7('0x48')]][_0x31b7('0x7d')](_0x4b923b);this[_0x31b7('0x10')][_0x2640db[_0x31b7('0x48')]]=_0x4b923b;this[_0x31b7('0x45')](_0x4b923b,_0x31b7('0x1b'));}}catch(_0xbb8b16){logger[_0x31b7('0x3d')](_0x31b7('0x74'),_0x2640db['uniqueid'],util[_0x31b7('0x3e')](_0xbb8b16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x1c')]=function(_0x50f1b5){try{if(this[_0x31b7('0x66')](_0x50f1b5)){logger[_0x31b7('0x46')](_0x31b7('0x7e'),_0x50f1b5[_0x31b7('0x48')],util['inspect'](_0x50f1b5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x50f1b5['uniqueid']]){var _0x1739af=_['last'](this['queueReports'][_0x50f1b5[_0x31b7('0x48')]]);_0x1739af['queuecallercomplete']=![];_0x1739af[_0x31b7('0x7f')]=null;_0x1739af[_0x31b7('0x80')]=_0x50f1b5['holdtime'];_0x1739af['originalposition']=_0x50f1b5[_0x31b7('0x81')];_0x1739af[_0x31b7('0x82')]=!![];_0x1739af[_0x31b7('0x83')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x1739af['queuecallerexitreason']=_0x31b7('0x84');_0x1739af[_0x31b7('0x85')]=null;logger[_0x31b7('0x69')](_0x31b7('0x86'),_0x1739af[_0x31b7('0x4a')],_0x1739af[_0x31b7('0x51')]);this['channels'][_0x50f1b5[_0x31b7('0x48')]]=_0x1739af;this[_0x31b7('0x42')](_0x1739af,_0x31b7('0x82'));}}}catch(_0x2f314c){logger[_0x31b7('0x3d')](_0x31b7('0x7e'),_0x50f1b5['uniqueid'],util[_0x31b7('0x3e')](_0x2f314c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x1d')]=function(_0x4e369c){try{if(this[_0x31b7('0x66')](_0x4e369c)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x4e369c[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x4e369c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e369c[_0x31b7('0x48')]]){var _0x50bde9=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x4e369c[_0x31b7('0x48')]]);_0x50bde9[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x50bde9['connectedlinenum']=_0x4e369c[_0x31b7('0x89')];_0x50bde9[_0x31b7('0x8a')]=_0x4e369c[_0x31b7('0x8a')];logger['info'](_0x31b7('0x8b'),_0x50bde9[_0x31b7('0x4a')],_0x50bde9[_0x31b7('0x51')],_0x4e369c['connectedlinenum'],_0x4e369c['connectedlinename']);this[_0x31b7('0x10')][_0x4e369c['uniqueid']]=_0x50bde9;this[_0x31b7('0x45')](_0x50bde9,_0x31b7('0x8c'));}}}catch(_0x5da016){logger[_0x31b7('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x4e369c['uniqueid'],util[_0x31b7('0x3e')](_0x5da016,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0x20')]=function(_0x323ab2){try{if(this['isNotNull'](_0x323ab2)){logger[_0x31b7('0x46')](_0x31b7('0x8d'),_0x323ab2['uniqueid'],util['inspect'](_0x323ab2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x323ab2[_0x31b7('0x48')]]){var _0x477445=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x323ab2[_0x31b7('0x48')]]);_0x477445[_0x31b7('0x8e')]=!![];_0x477445['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x31b7('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x477445[_0x31b7('0x4a')],_0x477445[_0x31b7('0x51')]);}}}catch(_0x2a7141){logger[_0x31b7('0x3d')](_0x31b7('0x8d'),_0x323ab2[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x2a7141,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x1f')]=function(_0x100da0){try{if(this[_0x31b7('0x66')](_0x100da0)){logger[_0x31b7('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x100da0['uniqueid'],util[_0x31b7('0x3e')](_0x100da0,{'showHidden':![],'depth':null}));if(this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]]){var _0x18b1be=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x100da0['uniqueid']]);_0x18b1be[_0x31b7('0x82')]=![];_0x18b1be[_0x31b7('0x83')]=null;_0x18b1be[_0x31b7('0x8f')]=!![];_0x18b1be[_0x31b7('0x85')]=_0x100da0['membername'];_0x18b1be['holdtime']=_0x100da0[_0x31b7('0x80')];_0x18b1be[_0x31b7('0x8e')]=!![];_0x18b1be[_0x31b7('0x90')]=![];_0x18b1be['queuecallerexitAt']=null;if(!_0x18b1be[_0x31b7('0x91')]){if(_0x100da0[_0x31b7('0x92')]==_0x31b7('0x91')){_0x18b1be[_0x31b7('0x93')]='COMPLETED';logger['info'](_0x31b7('0x94'),_0x18b1be[_0x31b7('0x4a')],_0x18b1be[_0x31b7('0x51')]);}else{if(_[_0x31b7('0x95')](_0x100da0[_0x31b7('0x3a')][_0x31b7('0x96')](),_0x31b7('0x97'))){if(this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]){var _0x16bce7=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]);_0x16bce7['queuecallercomplete']=![];_0x16bce7[_0x31b7('0x90')]=!![];_0x16bce7[_0x31b7('0x99')]=moment(_0x18b1be[_0x31b7('0x76')])[_0x31b7('0x9a')](_0x100da0[_0x31b7('0x80')],_0x31b7('0x9b'))[_0x31b7('0x4e')](_0x31b7('0x77'));_0x16bce7[_0x31b7('0x93')]=_0x31b7('0x9c');_0x16bce7[_0x31b7('0x91')]=!![];_0x16bce7[_0x31b7('0x9d')]='FORWARD';_0x16bce7['transferexten']=_0x100da0[_0x31b7('0x9e')];_0x16bce7[_0x31b7('0x9f')]=_0x100da0['uniqueid'];logger[_0x31b7('0x69')](_0x31b7('0xa0'),_0x16bce7[_0x31b7('0x4a')],_0x16bce7['type']);var _0x1b1884=this['queueReports'][_0x100da0[_0x31b7('0x98')]];this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x98')]]=this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]];this[_0x31b7('0xe')][_0x100da0[_0x31b7('0x48')]]=_0x1b1884;}}else{_0x18b1be[_0x31b7('0x93')]=_0x31b7('0xa1')+_0x100da0[_0x31b7('0x92')][_0x31b7('0xa2')]();logger['info'](_0x31b7('0xa3'),_0x18b1be[_0x31b7('0x4a')],_0x18b1be[_0x31b7('0x51')],_0x18b1be[_0x31b7('0x93')]);}}}this['channels'][_0x100da0[_0x31b7('0x48')]]=_0x18b1be;this[_0x31b7('0x42')](_0x18b1be,'agentcomplete');}}}catch(_0x12421e){logger['error'](_0x31b7('0xa4'),_0x100da0[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x12421e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x22')]=function(_0x3e500b){try{if(this['isNotNull'](_0x3e500b)){logger[_0x31b7('0x46')](_0x31b7('0xa5'),_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x3e500b,{'showHidden':![],'depth':null}));this[_0x31b7('0xa6')](_0x3e500b[_0x31b7('0x48')],_[_0x31b7('0xa7')](_0x3e500b['variable'])[0x0],_0x3e500b['value']);if(this[_0x31b7('0xe')][_0x3e500b[_0x31b7('0x48')]]){var _0x5af354=_[_0x31b7('0x87')](this[_0x31b7('0xe')][_0x3e500b[_0x31b7('0x48')]]);if(_0x5af354){if(this[_0x31b7('0x66')](_0x3e500b[_0x31b7('0xa8')])&&this[_0x31b7('0x66')](_0x3e500b['variable'][_0x31b7('0xa9')])){switch(_0x3e500b[_0x31b7('0xaa')]){case'CONTINUE':_0x5af354[_0x31b7('0x90')]=![];_0x5af354[_0x31b7('0x99')]=null;break;case'TIMEOUT':_0x5af354[_0x31b7('0xab')]='timeout';_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x5af354[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x31b7('0x46')](_0x31b7('0xac'),_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x5af354,{'showHidden':![],'depth':null}));ami[_0x31b7('0x44')](_0x31b7('0xad'),_0x5af354);break;default:_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()['format'](_0x31b7('0x77'));_0x5af354[_0x31b7('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5af354['queuecallerabandon']=![];_0x5af354[_0x31b7('0x83')]=null;_0x5af354[_0x31b7('0x93')]=_0x3e500b[_0x31b7('0xaa')];this[_0x31b7('0x10')][_0x3e500b[_0x31b7('0x48')]]=_0x5af354;this[_0x31b7('0x42')](_0x5af354,_0x31b7('0x21'));}else if(this[_0x31b7('0x66')](_0x3e500b['variable'])&&this[_0x31b7('0x66')](_0x3e500b[_0x31b7('0xa8')]['queueposition'])){if(!_0x5af354[_0x31b7('0x82')]){_0x5af354[_0x31b7('0x90')]=!![];_0x5af354[_0x31b7('0x99')]=moment()[_0x31b7('0x4e')](_0x31b7('0x77'));_0x5af354[_0x31b7('0x93')]=_0x31b7('0xae');_0x5af354[_0x31b7('0x88')]=moment()[_0x31b7('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x31b7('0x10')][_0x3e500b[_0x31b7('0x48')]]=_0x5af354;}}logger[_0x31b7('0x69')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3e500b[_0x31b7('0x48')],_0x5af354['name'],_0x5af354['type'],_[_0x31b7('0xa7')](_0x3e500b[_0x31b7('0xa8')])[0x0],_0x3e500b['value']);_0x5af354[_0x31b7('0x15')]=this[_0x31b7('0x15')][_0x3e500b[_0x31b7('0x48')]];}}}}catch(_0x50560d){logger['error']('[%s][voiceQueueReport][varset]',_0x3e500b[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x50560d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x31b7('0xa6')]=function(_0x45cbff,_0x30d1fe,_0x885199){var _0x2a6f37=[_0x31b7('0xaf'),_0x31b7('0xb0'),'rtpaudioqosjitter',_0x31b7('0xb1'),'rtpaudioqosloss',_0x31b7('0xb2'),_0x31b7('0xb3'),_0x31b7('0xb4'),'sipcallid',_0x31b7('0xb5'),'bridgepeer',_0x31b7('0xb6'),'membercalls',_0x31b7('0xb7'),'memberinterface',_0x31b7('0xb8'),_0x31b7('0xb9'),_0x31b7('0xba'),'memberrealtime'];if(!_[_0x31b7('0xbb')](_0x30d1fe)&&!_[_0x31b7('0xbc')](_0x2a6f37,_0x30d1fe)){if(_['isUndefined'](this[_0x31b7('0x15')][_0x45cbff])){this[_0x31b7('0x15')][_0x45cbff]={};}this[_0x31b7('0x15')][_0x45cbff][_0x30d1fe]=_0x885199;}};VoiceQueueReport[_0x31b7('0xa')][_0x31b7('0x23')]=function(_0x5c8071){try{if(this[_0x31b7('0x66')](_0x5c8071)){logger[_0x31b7('0x46')](_0x31b7('0xbd'),_0x5c8071[_0x31b7('0x48')],util[_0x31b7('0x3e')](_0x5c8071,{'showHidden':![],'depth':null}));if(this[_0x31b7('0xe')][_0x5c8071[_0x31b7('0x48')]]){for(var _0x3b0fb3=0x0,_0x144c27={};_0x3b0fb30x0?_0x1ad67b:0x0;this[_0xeeeb('0x14')][_0x43ab07[_0xeeeb('0x70')]][_0xeeeb('0x5f')]=this['voiceQueues'][_0x43ab07[_0xeeeb('0x70')]]['talking']>_[_0xeeeb('0x73')](_0x43ab07[_0xeeeb('0x74')])?_['toNumber'](_0x43ab07['loggedin']):this[_0xeeeb('0x14')][_0x43ab07['queue']][_0xeeeb('0x5f')];this[_0xeeeb('0x56')](this['voiceQueues'][_0x43ab07[_0xeeeb('0x70')]],_0xeeeb('0x17'));}logger[_0xeeeb('0x4d')](_0xeeeb('0x77'),util[_0xeeeb('0x44')](this[_0xeeeb('0x14')][_0x43ab07[_0xeeeb('0x70')]],{'showHidden':![],'depth':null}));ami[_0xeeeb('0x4b')]('custom:queuesummary',this[_0xeeeb('0x14')][_0x43ab07[_0xeeeb('0x70')]]);}}}catch(_0xee4612){logger[_0xeeeb('0x42')](_0xeeeb('0x6e'),util[_0xeeeb('0x44')](_0xee4612,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeeeb('0x1b')]=function(_0x126747){logger[_0xeeeb('0x4d')](_0xeeeb('0x78'),util[_0xeeeb('0x44')](_0x126747,{'showHidden':![],'depth':null}));this[_0xeeeb('0x15')]=!![];};VoiceQueueReport[_0xeeeb('0xc')]['syncQueueCallerJoin']=function(_0x4b60e4){try{if(this[_0xeeeb('0x69')](_0x4b60e4)){logger['debug'](_0xeeeb('0x79'),_0x4b60e4[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x4b60e4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xeeeb('0x10')][_0x4b60e4[_0xeeeb('0x7a')]]))this['queueReports'][_0x4b60e4[_0xeeeb('0x7a')]]=[];if(_['isUndefined'](this[_0xeeeb('0x12')][_0x4b60e4['uniqueid']]))this[_0xeeeb('0x12')][_0x4b60e4[_0xeeeb('0x7a')]]={};var _0x201483=new QueueReport();_0x201483['name']=_0x4b60e4[_0xeeeb('0x70')];_0x201483['type']=this[_0xeeeb('0x14')][_0x201483['name']]&&this['voiceQueues'][_0x201483['name']][_0xeeeb('0x57')]?this[_0xeeeb('0x14')][_0x201483[_0xeeeb('0x50')]]['type']||_0xeeeb('0x58'):_0xeeeb('0x58');_0x201483['queue']=_0x4b60e4[_0xeeeb('0x70')];_0x201483[_0xeeeb('0x7b')]=moment()[_0xeeeb('0x53')](_0xeeeb('0x7c'));_0x201483['position']=_0x4b60e4['position'];_0x201483[_0xeeeb('0x7d')]=_0x4b60e4[_0xeeeb('0x7d')];_0x201483[_0xeeeb('0x7a')]=_0x4b60e4['uniqueid'];_0x201483[_0xeeeb('0x7e')]=this['channels'][_0x4b60e4[_0xeeeb('0x7a')]]['routealias'];logger[_0xeeeb('0x71')](_0xeeeb('0x7f'),_0x201483[_0xeeeb('0x50')],_0x201483[_0xeeeb('0x57')]);_[_0xeeeb('0x80')](_0x201483,_[_0xeeeb('0x81')](_0x4b60e4,_['keys'](_0x201483)));this[_0xeeeb('0x10')][_0x4b60e4[_0xeeeb('0x7a')]][_0xeeeb('0x82')](_0x201483);this[_0xeeeb('0x12')][_0x4b60e4[_0xeeeb('0x7a')]]=_0x201483;this['emitVoiceQueueChannelSave'](_0x201483,_0xeeeb('0x1c'));}}catch(_0x4c3b57){logger[_0xeeeb('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4b60e4[_0xeeeb('0x7a')],util['inspect'](_0x4c3b57,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeeeb('0xc')][_0xeeeb('0x1f')]=function(_0x55cb48){try{if(this[_0xeeeb('0x69')](_0x55cb48)){logger['debug'](_0xeeeb('0x83'),_0x55cb48[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x55cb48,{'showHidden':![],'depth':null}));if(this[_0xeeeb('0x10')][_0x55cb48['uniqueid']]){var _0x5af5a4=_[_0xeeeb('0x84')](this['queueReports'][_0x55cb48[_0xeeeb('0x7a')]]);_0x5af5a4[_0xeeeb('0x85')]=![];_0x5af5a4[_0xeeeb('0x86')]=null;_0x5af5a4[_0xeeeb('0x87')]=_0x55cb48[_0xeeeb('0x87')];_0x5af5a4[_0xeeeb('0x88')]=_0x55cb48[_0xeeeb('0x88')];_0x5af5a4['queuecallerabandon']=!![];_0x5af5a4[_0xeeeb('0x89')]=moment()[_0xeeeb('0x53')](_0xeeeb('0x7c'));_0x5af5a4[_0xeeeb('0x8a')]=_0xeeeb('0x8b');_0x5af5a4[_0xeeeb('0x8c')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5af5a4[_0xeeeb('0x50')],_0x5af5a4[_0xeeeb('0x57')]);this[_0xeeeb('0x12')][_0x55cb48[_0xeeeb('0x7a')]]=_0x5af5a4;this['emitVoiceQueueChannelRemove'](_0x5af5a4,_0xeeeb('0x1e'));}}}catch(_0x437818){logger[_0xeeeb('0x42')](_0xeeeb('0x83'),_0x55cb48[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x437818,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeeeb('0xc')][_0xeeeb('0x21')]=function(_0x1a0bf8){try{if(this[_0xeeeb('0x69')](_0x1a0bf8)){logger[_0xeeeb('0x4d')](_0xeeeb('0x8d'),_0x1a0bf8[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x1a0bf8,{'showHidden':![],'depth':null}));if(this[_0xeeeb('0x10')][_0x1a0bf8['uniqueid']]){var _0x404917=_[_0xeeeb('0x84')](this[_0xeeeb('0x10')][_0x1a0bf8[_0xeeeb('0x7a')]]);_0x404917[_0xeeeb('0x8e')]=moment()[_0xeeeb('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x404917[_0xeeeb('0x8f')]=_0x1a0bf8[_0xeeeb('0x8f')];_0x404917[_0xeeeb('0x90')]=_0x1a0bf8['connectedlinename'];logger['info'](_0xeeeb('0x91'),_0x404917['name'],_0x404917['type'],_0x1a0bf8[_0xeeeb('0x8f')],_0x1a0bf8[_0xeeeb('0x90')]);this['channels'][_0x1a0bf8[_0xeeeb('0x7a')]]=_0x404917;this[_0xeeeb('0x4c')](_0x404917,'queuecallerleave');}}}catch(_0x20a162){logger[_0xeeeb('0x42')](_0xeeeb('0x8d'),_0x1a0bf8['uniqueid'],util['inspect'](_0x20a162,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x103ffe){try{if(this[_0xeeeb('0x69')](_0x103ffe)){logger[_0xeeeb('0x4d')]('[%s][voiceQueueReport][agentconnect]',_0x103ffe['uniqueid'],util[_0xeeeb('0x44')](_0x103ffe,{'showHidden':![],'depth':null}));if(this[_0xeeeb('0x10')][_0x103ffe['uniqueid']]){var _0x5584c8=_[_0xeeeb('0x84')](this['queueReports'][_0x103ffe[_0xeeeb('0x7a')]]);_0x5584c8[_0xeeeb('0x85')]=!![];_0x5584c8['queuecallerexitreason']=_0xeeeb('0x92');logger[_0xeeeb('0x71')](_0xeeeb('0x93'),_0x5584c8[_0xeeeb('0x50')],_0x5584c8[_0xeeeb('0x57')]);}}}catch(_0x5a2732){logger[_0xeeeb('0x42')](_0xeeeb('0x94'),_0x103ffe[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x5a2732,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeeeb('0x23')]=function(_0x2e2d4e){try{if(this['isNotNull'](_0x2e2d4e)){logger[_0xeeeb('0x4d')](_0xeeeb('0x95'),_0x2e2d4e[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x2e2d4e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2e2d4e[_0xeeeb('0x7a')]]){var _0x49978c=_[_0xeeeb('0x84')](this[_0xeeeb('0x10')][_0x2e2d4e['uniqueid']]);_0x49978c['queuecallerabandon']=![];_0x49978c[_0xeeeb('0x89')]=null;_0x49978c[_0xeeeb('0x96')]=!![];_0x49978c['lastAssignedTo']=_0x2e2d4e['membername'];_0x49978c[_0xeeeb('0x87')]=_0x2e2d4e[_0xeeeb('0x87')];_0x49978c[_0xeeeb('0x85')]=!![];_0x49978c[_0xeeeb('0x97')]=![];_0x49978c['queuecallerexitAt']=null;if(!_0x49978c[_0xeeeb('0x98')]){if(_0x2e2d4e[_0xeeeb('0x99')]==_0xeeeb('0x98')){_0x49978c[_0xeeeb('0x8a')]=_0xeeeb('0x9a');logger[_0xeeeb('0x71')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x49978c['name'],_0x49978c[_0xeeeb('0x57')]);}else{if(_[_0xeeeb('0x9b')](_0x2e2d4e[_0xeeeb('0x3f')]['toLowerCase'](),_0xeeeb('0x9c'))){if(this[_0xeeeb('0x10')][_0x2e2d4e['linkedid']]){var _0x38f649=_[_0xeeeb('0x84')](this[_0xeeeb('0x10')][_0x2e2d4e[_0xeeeb('0x9d')]]);_0x38f649['queuecallercomplete']=![];_0x38f649[_0xeeeb('0x97')]=!![];_0x38f649[_0xeeeb('0x9e')]=moment(_0x49978c['queuecallerjoinAt'])[_0xeeeb('0x9f')](_0x2e2d4e[_0xeeeb('0x87')],_0xeeeb('0xa0'))[_0xeeeb('0x53')](_0xeeeb('0x7c'));_0x38f649[_0xeeeb('0x8a')]=_0xeeeb('0xa1');_0x38f649[_0xeeeb('0x98')]=!![];_0x38f649['transfertype']='FORWARD';_0x38f649[_0xeeeb('0xa2')]=_0x2e2d4e[_0xeeeb('0xa3')];_0x38f649[_0xeeeb('0xa4')]=_0x2e2d4e[_0xeeeb('0x7a')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x38f649[_0xeeeb('0x50')],_0x38f649[_0xeeeb('0x57')]);var _0x1eb0e6=this[_0xeeeb('0x10')][_0x2e2d4e[_0xeeeb('0x9d')]];this[_0xeeeb('0x10')][_0x2e2d4e[_0xeeeb('0x9d')]]=this[_0xeeeb('0x10')][_0x2e2d4e[_0xeeeb('0x7a')]];this[_0xeeeb('0x10')][_0x2e2d4e[_0xeeeb('0x7a')]]=_0x1eb0e6;}}else{_0x49978c[_0xeeeb('0x8a')]=_0xeeeb('0xa5')+_0x2e2d4e[_0xeeeb('0x99')][_0xeeeb('0xa6')]();logger[_0xeeeb('0x71')](_0xeeeb('0xa7'),_0x49978c[_0xeeeb('0x50')],_0x49978c[_0xeeeb('0x57')],_0x49978c[_0xeeeb('0x8a')]);}}}this[_0xeeeb('0x12')][_0x2e2d4e['uniqueid']]=_0x49978c;this['emitVoiceQueueChannelRemove'](_0x49978c,'agentcomplete');}}}catch(_0x21fa45){logger[_0xeeeb('0x42')](_0xeeeb('0x95'),_0x2e2d4e[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x21fa45,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeeeb('0xc')][_0xeeeb('0x27')]=function(_0x1651ec){try{if(this[_0xeeeb('0x69')](_0x1651ec)){logger[_0xeeeb('0x4d')]('[%s][voiceQueueReport][varset]',_0x1651ec[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x1651ec,{'showHidden':![],'depth':null}));this[_0xeeeb('0xa8')](_0x1651ec[_0xeeeb('0x7a')],_[_0xeeeb('0xa9')](_0x1651ec[_0xeeeb('0xaa')])[0x0],_0x1651ec[_0xeeeb('0xab')]);if(this[_0xeeeb('0x10')][_0x1651ec[_0xeeeb('0x7a')]]){var _0x200ac2=_[_0xeeeb('0x84')](this[_0xeeeb('0x10')][_0x1651ec[_0xeeeb('0x7a')]]);if(_0x200ac2){if(this['isNotNull'](_0x1651ec['variable'])&&this[_0xeeeb('0x69')](_0x1651ec[_0xeeeb('0xaa')][_0xeeeb('0xac')])){switch(_0x1651ec['value']){case _0xeeeb('0xad'):_0x200ac2['queuecallerexit']=![];_0x200ac2[_0xeeeb('0x9e')]=null;break;case _0xeeeb('0xae'):_0x200ac2[_0xeeeb('0xaf')]=_0xeeeb('0xb0');_0x200ac2[_0xeeeb('0x97')]=!![];_0x200ac2['queuecallerexitAt']=moment()[_0xeeeb('0x53')](_0xeeeb('0x7c'));_0x200ac2['queuecallerleaveAt']=moment()[_0xeeeb('0x53')](_0xeeeb('0x7c'));logger['debug'](_0xeeeb('0xb1'),_0x1651ec[_0xeeeb('0x7a')],util[_0xeeeb('0x44')](_0x200ac2,{'showHidden':![],'depth':null}));ami[_0xeeeb('0x4b')](_0xeeeb('0xb2'),_0x200ac2);break;default:_0x200ac2[_0xeeeb('0x97')]=!![];_0x200ac2['queuecallerexitAt']=moment()[_0xeeeb('0x53')](_0xeeeb('0x7c'));_0x200ac2[_0xeeeb('0x8e')]=moment()[_0xeeeb('0x53')](_0xeeeb('0x7c'));}_0x200ac2[_0xeeeb('0x1e')]=![];_0x200ac2['queuecallerabandonAt']=null;_0x200ac2[_0xeeeb('0x8a')]=_0x1651ec['value'];this[_0xeeeb('0x12')][_0x1651ec[_0xeeeb('0x7a')]]=_0x200ac2;this[_0xeeeb('0x52')](_0x200ac2,_0xeeeb('0x26'));}else if(this[_0xeeeb('0x69')](_0x1651ec[_0xeeeb('0xaa')])&&this[_0xeeeb('0x69')](_0x1651ec[_0xeeeb('0xaa')][_0xeeeb('0xb3')])){if(!_0x200ac2[_0xeeeb('0x1e')]){_0x200ac2[_0xeeeb('0x97')]=!![];_0x200ac2[_0xeeeb('0x9e')]=moment()['format'](_0xeeeb('0x7c'));_0x200ac2['queuecallerexitreason']=_0xeeeb('0xb4');_0x200ac2[_0xeeeb('0x8e')]=moment()[_0xeeeb('0x53')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xeeeb('0x12')][_0x1651ec['uniqueid']]=_0x200ac2;}}logger[_0xeeeb('0x71')](_0xeeeb('0xb5'),_0x1651ec['uniqueid'],_0x200ac2['name'],_0x200ac2['type'],_[_0xeeeb('0xa9')](_0x1651ec[_0xeeeb('0xaa')])[0x0],_0x1651ec['value']);_0x200ac2[_0xeeeb('0x16')]=this['variables'][_0x1651ec[_0xeeeb('0x7a')]];}}}}catch(_0x5f3d72){logger[_0xeeeb('0x42')](_0xeeeb('0xb6'),_0x1651ec['uniqueid'],util[_0xeeeb('0x44')](_0x5f3d72,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeeeb('0xa8')]=function(_0x559a31,_0x17954f,_0x12e0e7){var _0x38f66a=[_0xeeeb('0xb7'),_0xeeeb('0xb8'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0xeeeb('0xb9'),_0xeeeb('0xba'),_0xeeeb('0xbb'),_0xeeeb('0xbc'),_0xeeeb('0xbd'),'bridgepeer',_0xeeeb('0xbe'),_0xeeeb('0xbf'),_0xeeeb('0xc0'),_0xeeeb('0xc1'),_0xeeeb('0xc2'),_0xeeeb('0xc3'),'memberpenalty',_0xeeeb('0xc4')];if(!_['isNil'](_0x17954f)&&!_[_0xeeeb('0xc5')](_0x38f66a,_0x17954f)){if(_['isUndefined'](this[_0xeeeb('0x16')][_0x559a31])){this[_0xeeeb('0x16')][_0x559a31]={};}this[_0xeeeb('0x16')][_0x559a31][_0x17954f]=_0x12e0e7;}};VoiceQueueReport['prototype'][_0xeeeb('0x29')]=function(_0x22892d){try{if(this['isNotNull'](_0x22892d)){logger[_0xeeeb('0x4d')](_0xeeeb('0xc6'),_0x22892d[_0xeeeb('0x7a')],util['inspect'](_0x22892d,{'showHidden':![],'depth':null}));if(this[_0xeeeb('0x10')][_0x22892d[_0xeeeb('0x7a')]]){for(var _0x50ab93=0x0,_0x615b52={};_0x50ab93=0x0?moment(_0x172bc0[_0xad6f('0x18')])[_0xad6f('0xc')](_0x172bc0[_0xad6f('0x17')],'seconds'):null,'data1':_0xad6f('0x19'),'data2':_0x172bc0[_0xad6f('0x12')],'data3':_0x172bc0['exten'],'data4':_0x172bc0[_0xad6f('0x1a')]||null,'role':_0xad6f('0x11'),'internal':_0x172bc0[_0xad6f('0x12')]?_[_0xad6f('0x13')](_0x172bc0[_0xad6f('0x12')]):undefined,'uniqueid':_0x172bc0[_0xad6f('0x14')]},'log':_0xad6f('0x4')});}; \ No newline at end of file +var _0x61fe=['queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','diff','outbound','exten','dialstring','agent','lodash','util','../client','voiceQueueReport','queuecallercompleteAt'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x61fe,0x73));var _0xe61f=function(_0x3fa487,_0xf70b3d){_0x3fa487=_0x3fa487-0x0;var _0x48bea4=_0x61fe[_0x3fa487];return _0x48bea4;};'use strict';var moment=require('moment');var _=require(_0xe61f('0x0'));var util=require(_0xe61f('0x1'));var client=require(_0xe61f('0x2'));exports[_0xe61f('0x3')]=function(_0x13df9f){var _0x4c3cfe=_0x13df9f[_0xe61f('0x4')]||_0x13df9f[_0xe61f('0x5')];return client[_0xe61f('0x6')](_0xe61f('0x7'),{'body':{'channel':_0xe61f('0x8'),'membername':_0x13df9f[_0xe61f('0x9')],'interface':_[_0xe61f('0xa')](_0x13df9f[_0xe61f('0xb')])?util[_0xe61f('0xc')](_0xe61f('0xd'),_0x13df9f['lastAssignedTo']):_0x13df9f[_0xe61f('0xb')],'type':_0xe61f('0xe'),'enterAt':_0x13df9f['queuecallerleaveAt'],'exitAt':_0x4c3cfe,'duration':moment(_0x4c3cfe)['diff'](_0x13df9f[_0xe61f('0xf')],_0xe61f('0x10')),'data1':_0xe61f('0x11'),'data2':_0x13df9f[_0xe61f('0x12')],'data3':_0x13df9f['exten'],'data4':null,'data5':_0x13df9f['queue'],'role':'agent','internal':_0x13df9f[_0xe61f('0x13')]?_[_0xe61f('0x14')](_0x13df9f[_0xe61f('0x13')]):undefined,'uniqueid':_0x13df9f[_0xe61f('0x15')]},'log':'CreateMemberReport'});};exports[_0xe61f('0x16')]=function(_0x5e86c6){return client[_0xe61f('0x6')]('CreateMemberReport',{'body':{'channel':_0xe61f('0x8'),'membername':_0x5e86c6['membername'],'interface':_0x5e86c6[_0xe61f('0xb')],'type':'TALKING','enterAt':_0x5e86c6[_0xe61f('0x17')],'exitAt':_0x5e86c6[_0xe61f('0x18')],'duration':moment(_0x5e86c6[_0xe61f('0x18')])[_0xe61f('0x19')](_0x5e86c6[_0xe61f('0x17')],_0xe61f('0x10'))>=0x0?moment(_0x5e86c6['endtime'])[_0xe61f('0x19')](_0x5e86c6[_0xe61f('0x17')],_0xe61f('0x10')):null,'data1':_0xe61f('0x1a'),'data2':_0x5e86c6[_0xe61f('0x13')],'data3':_0x5e86c6[_0xe61f('0x1b')],'data4':_0x5e86c6[_0xe61f('0x1c')]||null,'role':_0xe61f('0x1d'),'internal':_0x5e86c6[_0xe61f('0x13')]?_[_0xe61f('0x14')](_0x5e86c6['accountcode']):undefined,'uniqueid':_0x5e86c6['uniqueid']},'log':_0xe61f('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index dd18608..3a256bc 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 _0x781f=['getSettings','ShowSetting','GetSettings','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x781f,0x13f));var _0xf781=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x781f[_0x26fc81];return _0x9feece;};'use strict';var client=require(_0xf781('0x0'));exports[_0xf781('0x1')]=function(){return client['Request'](_0xf781('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xf781('0x3')});}; \ No newline at end of file +var _0x0820=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x17cec2,_0x306995){var _0x68c99a=function(_0xe89750){while(--_0xe89750){_0x17cec2['push'](_0x17cec2['shift']());}};_0x68c99a(++_0x306995);}(_0x0820,0x1c8));var _0x0082=function(_0x38373f,_0x577bc4){_0x38373f=_0x38373f-0x0;var _0x2bbb9f=_0x0820[_0x38373f];return _0x2bbb9f;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x0082('0x0')](_0x0082('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0082('0x2')]},'log':_0x0082('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c62dfe1..72fb6ac 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 _0xb346=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb346,0xcb));var _0x6b34=function(_0x410bae,_0x4773df){_0x410bae=_0x410bae-0x0;var _0x8b6f0a=_0xb346[_0x410bae];return _0x8b6f0a;};'use strict';var client=require(_0x6b34('0x0'));exports[_0x6b34('0x1')]=function(_0x596b5a){return function(_0x428564){return client[_0x6b34('0x2')](_0x6b34('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6b34('0x4'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x59d8=['Request','GetTemplate','name','html','../client'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x59d8,0x95));var _0x859d=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x59d8[_0x7c0074];return _0x13e95b;};'use strict';var client=require(_0x859d('0x0'));exports['getTemplates']=function(_0x544ccf){return function(_0x2dda94){return client[_0x859d('0x1')](_0x859d('0x2'),{'options':{'raw':!![],'attributes':['id',_0x859d('0x3'),_0x859d('0x4')]},'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 c725ca1..67e4e7b 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 _0x906e=['action','data1','data2','data3','data4','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions'];(function(_0x21a11d,_0x18d8ec){var _0x474e50=function(_0x45d33b){while(--_0x45d33b){_0x21a11d['push'](_0x21a11d['shift']());}};_0x474e50(++_0x18d8ec);}(_0x906e,0x1c0));var _0xe906=function(_0x2067e3,_0x19bcb2){_0x2067e3=_0x2067e3-0x0;var _0x180c44=_0x906e[_0x2067e3];return _0x180c44;};'use strict';var client=require(_0xe906('0x0'));exports[_0xe906('0x1')]=function(_0x3a596b){return function(_0x160ad1){return client['Request'](_0xe906('0x2'),{'options':{'raw':![],'attributes':['id',_0xe906('0x3'),_0xe906('0x4'),_0xe906('0x5')],'include':[{'model':_0xe906('0x6'),'as':_0xe906('0x7'),'attributes':['id',_0xe906('0x8'),_0xe906('0x9'),_0xe906('0xa')]},{'model':_0xe906('0x6'),'as':_0xe906('0xb'),'attributes':['id',_0xe906('0x8'),_0xe906('0x9'),_0xe906('0xa')]},{'model':_0xe906('0xc'),'as':_0xe906('0xd'),'attributes':['id',_0xe906('0xe'),_0xe906('0xf'),_0xe906('0x10'),_0xe906('0x11'),_0xe906('0x12'),'data5',_0xe906('0x13'),_0xe906('0x14')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x91b8=['Request','name','channel','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers'];(function(_0x45e7ad,_0xf665c){var _0xd5fa6c=function(_0xfb4b53){while(--_0xfb4b53){_0x45e7ad['push'](_0x45e7ad['shift']());}};_0xd5fa6c(++_0xf665c);}(_0x91b8,0x70));var _0x891b=function(_0x88827c,_0xc85e60){_0x88827c=_0x88827c-0x0;var _0xcc5c89=_0x91b8[_0x88827c];return _0xcc5c89;};'use strict';var client=require(_0x891b('0x0'));exports[_0x891b('0x1')]=function(_0x479246){return function(_0xf4a27c){return client[_0x891b('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x891b('0x3'),_0x891b('0x4'),'status'],'include':[{'model':_0x891b('0x5'),'as':_0x891b('0x6'),'attributes':['id',_0x891b('0x7'),_0x891b('0x8'),_0x891b('0x9')]},{'model':_0x891b('0x5'),'as':_0x891b('0xa'),'attributes':['id',_0x891b('0x7'),_0x891b('0x8'),_0x891b('0x9')]},{'model':_0x891b('0xb'),'as':_0x891b('0xc'),'attributes':['id','action','data1','data2',_0x891b('0xd'),_0x891b('0xe'),_0x891b('0xf'),_0x891b('0x10'),_0x891b('0x11')]}]},'log':_0x891b('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index cfd330f..b500977 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 _0xb871=['defaultuser','GetTrunk','getTrunks','Request','registry'];(function(_0x59a538,_0x43f222){var _0x591245=function(_0x248939){while(--_0x248939){_0x59a538['push'](_0x59a538['shift']());}};_0x591245(++_0x43f222);}(_0xb871,0x6b));var _0x1b87=function(_0x1f3d15,_0x5176a8){_0x1f3d15=_0x1f3d15-0x0;var _0x48617b=_0xb871[_0x1f3d15];return _0x48617b;};'use strict';var client=require('../client');exports[_0x1b87('0x0')]=function(_0x1e1274){return function(_0x1d39a3){return client[_0x1b87('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x1b87('0x2'),_0x1b87('0x3')]},'log':_0x1b87('0x4')});};}; \ No newline at end of file +var _0x427f=['name','registry','../client','getTrunks','GetTrunk'];(function(_0x24b5c0,_0x432f0e){var _0x48f81a=function(_0x3b27c9){while(--_0x3b27c9){_0x24b5c0['push'](_0x24b5c0['shift']());}};_0x48f81a(++_0x432f0e);}(_0x427f,0x1ba));var _0xf427=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x427f[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0xf427('0x0'));exports[_0xf427('0x1')]=function(_0x587bd0){return function(_0x195f58){return client['Request'](_0xf427('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf427('0x3'),_0xf427('0x4'),'defaultuser']},'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 11a13b1..fdc5bd7 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x35fc6b,_0x2e006b){var _0x1b75a6=function(_0x3a2a57){while(--_0x3a2a57){_0x35fc6b['push'](_0x35fc6b['shift']());}};_0x1b75a6(++_0x2e006b);}(_0x34e8,0x12c));var _0x834e=function(_0x562452,_0x40e890){_0x562452=_0x562452-0x0;var _0x5ad702=_0x34e8[_0x562452];return _0x5ad702;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x322cc7,_0x33b839){var _0x5f57aa=function(_0x185de9){while(--_0x185de9){_0x322cc7['push'](_0x322cc7['shift']());}};_0x5f57aa(++_0x33b839);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 31975e7..de7aea7 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 _0x68de=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','Request'];(function(_0x41eccd,_0x2052f4){var _0x4ebf84=function(_0x270f6b){while(--_0x270f6b){_0x41eccd['push'](_0x41eccd['shift']());}};_0x4ebf84(++_0x2052f4);}(_0x68de,0x125));var _0xe68d=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x68de[_0x31a371];return _0x2a5bd6;};'use strict';var client=require(_0xe68d('0x0'));exports['create']=function(_0x351956){return client[_0xe68d('0x1')](_0xe68d('0x2'),{'body':_0x351956,'log':_0xe68d('0x2')});};exports[_0xe68d('0x3')]=function(_0xf58b73,_0x48b16c,_0xcd90eb){return client[_0xe68d('0x1')]('UpdateVoiceAgentReport',{'body':_0xf58b73,'options':{'where':{'uniqueid':_0x48b16c,'interface':_0xcd90eb,'agentcomplete':!![]}},'log':_0xe68d('0x4')});}; \ No newline at end of file +var _0xf06c=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0xe845f0,_0x29ce48){var _0x236cf9=function(_0x2fe93){while(--_0x2fe93){_0xe845f0['push'](_0xe845f0['shift']());}};_0x236cf9(++_0x29ce48);}(_0xf06c,0x1d8));var _0xcf06=function(_0x12687a,_0x34b58f){_0x12687a=_0x12687a-0x0;var _0x14cb37=_0xf06c[_0x12687a];return _0x14cb37;};'use strict';var client=require(_0xcf06('0x0'));exports['create']=function(_0x261249){return client[_0xcf06('0x1')](_0xcf06('0x2'),{'body':_0x261249,'log':_0xcf06('0x2')});};exports[_0xcf06('0x3')]=function(_0x2c1fe1,_0x4a03e7,_0x3002a8){return client[_0xcf06('0x1')](_0xcf06('0x4'),{'body':_0x2c1fe1,'options':{'where':{'uniqueid':_0x4a03e7,'interface':_0x3002a8,'agentcomplete':!![]}},'log':_0xcf06('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 543421b..ce1e692 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 _0x7a29=['context','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum'];(function(_0x2bbc02,_0x36b28a){var _0x40a67a=function(_0x50b4b3){while(--_0x50b4b3){_0x2bbc02['push'](_0x2bbc02['shift']());}};_0x40a67a(++_0x36b28a);}(_0x7a29,0x92));var _0x97a2=function(_0x357078,_0x1167ee){_0x357078=_0x357078-0x0;var _0x285339=_0x7a29[_0x357078];return _0x285339;};'use strict';var moment=require(_0x97a2('0x0'));var util=require(_0x97a2('0x1'));var _=require(_0x97a2('0x2'));var client=require('../client');exports[_0x97a2('0x3')]=function(_0x37a88a){return client[_0x97a2('0x4')](_0x97a2('0x5'),{'body':_['merge'](_0x37a88a,{'source':_0x37a88a[_0x97a2('0x6')],'destinationcontext':_0x37a88a[_0x97a2('0x7')],'callerid':_0x37a88a['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x97a2('0x5')});};exports[_0x97a2('0x8')]=function(){return function(){return client[_0x97a2('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x97a2('0x9')],'createdAt':{'$between':[moment()[_0x97a2('0xa')](_0x97a2('0xb'))[_0x97a2('0xc')](_0x97a2('0xd')),moment()['endOf'](_0x97a2('0xb'))[_0x97a2('0xc')](_0x97a2('0xd'))]}},'attributes':['type',_0x97a2('0xe'),_0x97a2('0xf'),'billableseconds']},'log':_0x97a2('0x10')});};}; \ No newline at end of file +var _0xcc3b=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','util','lodash','Request','CreateVoiceCallReport','context','callerid','getVoiceCallReports','GetVoiceCallReport'];(function(_0x17afd2,_0x4deb5e){var _0x3c7fec=function(_0x10a031){while(--_0x10a031){_0x17afd2['push'](_0x17afd2['shift']());}};_0x3c7fec(++_0x4deb5e);}(_0xcc3b,0x196));var _0xbcc3=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xcc3b[_0xa148b7];return _0x51efd3;};'use strict';var moment=require('moment');var util=require(_0xbcc3('0x0'));var _=require(_0xbcc3('0x1'));var client=require('../client');exports['create']=function(_0xa257c4){return client[_0xbcc3('0x2')](_0xbcc3('0x3'),{'body':_['merge'](_0xa257c4,{'source':_0xa257c4['calleridnum'],'destinationcontext':_0xa257c4[_0xbcc3('0x4')],'callerid':_0xa257c4[_0xbcc3('0x5')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xbcc3('0x6')]=function(){return function(){return client['Request'](_0xbcc3('0x7'),{'options':{'where':{'type':[_0xbcc3('0x8')],'createdAt':{'$between':[moment()[_0xbcc3('0x9')](_0xbcc3('0xa'))[_0xbcc3('0xb')](_0xbcc3('0xc')),moment()[_0xbcc3('0xd')]('day')[_0xbcc3('0xb')](_0xbcc3('0xc'))]}},'attributes':[_0xbcc3('0xe'),'disposition',_0xbcc3('0xf'),_0xbcc3('0x10')]},'log':_0xbcc3('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 65bc7fe..385e793 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 _0x6289=['CreateVoiceDialReport','../client','create'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6289,0x6a));var _0x9628=function(_0x3de8a2,_0x1c8615){_0x3de8a2=_0x3de8a2-0x0;var _0x267573=_0x6289[_0x3de8a2];return _0x267573;};'use strict';var client=require(_0x9628('0x0'));exports[_0x9628('0x1')]=function(_0x23aa18){return client['Request'](_0x9628('0x2'),{'body':_0x23aa18,'log':_0x9628('0x2')});}; \ No newline at end of file +var _0x4639=['../client','Request','CreateVoiceDialReport'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4639,0x66));var _0x9463=function(_0x2ed51e,_0x20d606){_0x2ed51e=_0x2ed51e-0x0;var _0x44318c=_0x4639[_0x2ed51e];return _0x44318c;};'use strict';var client=require(_0x9463('0x0'));exports['create']=function(_0x569e1c){return client[_0x9463('0x1')](_0x9463('0x2'),{'body':_0x569e1c,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 65b56a3..10bf555 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 _0xa0bc=['exten','recordingFormat','getVoiceExtensions','Request'];(function(_0x506664,_0x2ba4b0){var _0xeac868=function(_0xc277a9){while(--_0xc277a9){_0x506664['push'](_0x506664['shift']());}};_0xeac868(++_0x2ba4b0);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xca0b('0x0')]=function(){return function(){return client[_0xca0b('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xca0b('0x2'),_0xca0b('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xca0b('0x0')});};}; \ No newline at end of file +var _0x58a7=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x58a7,0xf7));var _0x758a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x58a7[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x758a('0x0'));exports[_0x758a('0x1')]=function(){return function(){return client[_0x758a('0x2')](_0x758a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x758a('0x4'),_0x758a('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x758a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index a819d4d..42c953b 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 _0x046f=['getVoiceQueues','name','acw','acwTimeout','autopause','type','dialMethod','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdNumber','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client'];(function(_0x102fdc,_0x3d5a60){var _0x24b8eb=function(_0x5916d3){while(--_0x5916d3){_0x102fdc['push'](_0x102fdc['shift']());}};_0x24b8eb(++_0x3d5a60);}(_0x046f,0x73));var _0xf046=function(_0x4eaedd,_0x4c28c0){_0x4eaedd=_0x4eaedd-0x0;var _0x1f943c=_0x046f[_0x4eaedd];return _0x1f943c;};'use strict';var client=require(_0xf046('0x0'));exports[_0xf046('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xf046('0x2'),_0xf046('0x3'),_0xf046('0x4'),_0xf046('0x5'),'monitor_format',_0xf046('0x6'),'dialActive',_0xf046('0x7'),'dialLimitChannel',_0xf046('0x8'),_0xf046('0x9'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0xf046('0xa'),'dialOriginateTimeout','dialQueueOptions',_0xf046('0xb'),'dialQueueProject',_0xf046('0xc'),_0xf046('0xd'),'dialBusyMaxRetry',_0xf046('0xe'),_0xf046('0xf'),_0xf046('0x10'),_0xf046('0x11'),_0xf046('0x12'),_0xf046('0x13'),_0xf046('0x14'),_0xf046('0x15'),'dialAMDActive','dialAMDInitialSilence',_0xf046('0x16'),_0xf046('0x17'),_0xf046('0x18'),_0xf046('0x19'),_0xf046('0x1a'),_0xf046('0x1b'),'dialAMDSilenceThreshold',_0xf046('0x1c'),_0xf046('0x1d'),_0xf046('0x1e'),_0xf046('0x1f'),_0xf046('0x20'),_0xf046('0x21'),_0xf046('0x22'),_0xf046('0x23'),_0xf046('0x24'),_0xf046('0x25'),'dialRandomLastDigitCallerIdNumber',_0xf046('0x26'),'dialNoSuchNumberMaxRetry',_0xf046('0x27'),_0xf046('0x28'),_0xf046('0x29'),_0xf046('0x2a'),'dialAbandonedRetryFrequency',_0xf046('0x2b'),_0xf046('0x2c'),_0xf046('0x2d'),_0xf046('0x2e'),'mandatoryDisposition',_0xf046('0x2f'),_0xf046('0x30')],'include':[{'model':_0xf046('0x31'),'as':_0xf046('0x31'),'attributes':['id',_0xf046('0x2'),_0xf046('0x32'),_0xf046('0x33')]},{'model':_0xf046('0x34'),'as':_0xf046('0x35'),'attributes':['id',_0xf046('0x2')]},{'model':_0xf046('0x31'),'as':_0xf046('0x36'),'attributes':['id',_0xf046('0x2'),_0xf046('0x32'),_0xf046('0x33')]},{'model':_0xf046('0x37'),'as':_0xf046('0x37'),'attributes':['id',_0xf046('0x2')],'include':[{'model':'Interval','as':_0xf046('0x38'),'attributes':['id',_0xf046('0x2'),_0xf046('0x39')]}]}]},'log':_0xf046('0x1')});};}; \ No newline at end of file +var _0x112f=['dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x112f,0x116));var _0xf112=function(_0x2044ae,_0x12c028){_0x2044ae=_0x2044ae-0x0;var _0x2db12e=_0x112f[_0x2044ae];return _0x2db12e;};'use strict';var client=require(_0xf112('0x0'));exports[_0xf112('0x1')]=function(){return function(){return client[_0xf112('0x2')](_0xf112('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xf112('0x4'),'acwTimeout',_0xf112('0x5'),_0xf112('0x6'),_0xf112('0x7'),_0xf112('0x8'),_0xf112('0x9'),_0xf112('0xa'),_0xf112('0xb'),_0xf112('0xc'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xf112('0xd'),_0xf112('0xe'),_0xf112('0xf'),_0xf112('0x10'),'dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0xf112('0x11'),_0xf112('0x12'),_0xf112('0x13'),_0xf112('0x14'),_0xf112('0x15'),'dialGlobalMaxRetry',_0xf112('0x16'),_0xf112('0x17'),_0xf112('0x18'),_0xf112('0x19'),_0xf112('0x1a'),_0xf112('0x1b'),_0xf112('0x1c'),_0xf112('0x1d'),_0xf112('0x1e'),_0xf112('0x1f'),_0xf112('0x20'),_0xf112('0x21'),'dialAMDSilenceThreshold',_0xf112('0x22'),_0xf112('0x23'),_0xf112('0x24'),_0xf112('0x25'),_0xf112('0x26'),_0xf112('0x27'),_0xf112('0x28'),_0xf112('0x29'),_0xf112('0x6'),_0xf112('0x2a'),_0xf112('0x2b'),_0xf112('0x2c'),_0xf112('0x2d'),_0xf112('0x2e'),_0xf112('0x2f'),_0xf112('0x30'),_0xf112('0x31'),'dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency',_0xf112('0x32'),_0xf112('0x33'),_0xf112('0x34'),_0xf112('0x35'),_0xf112('0x36')],'include':[{'model':_0xf112('0x37'),'as':_0xf112('0x37'),'attributes':['id',_0xf112('0x38'),'callerid',_0xf112('0x39')]},{'model':_0xf112('0x3a'),'as':_0xf112('0x3b'),'attributes':['id',_0xf112('0x38')]},{'model':_0xf112('0x37'),'as':'TrunkBackup','attributes':['id','name','callerid',_0xf112('0x39')]},{'model':_0xf112('0x3c'),'as':_0xf112('0x3c'),'attributes':['id',_0xf112('0x38')],'include':[{'model':_0xf112('0x3c'),'as':_0xf112('0x3d'),'attributes':['id','name',_0xf112('0x3e')]}]}]},'log':_0xf112('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d37a154..71e7557 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(_0x507cef,_0x30dd42){var _0x13ae09=function(_0x3bd5c0){while(--_0x3bd5c0){_0x507cef['push'](_0x507cef['shift']());}};_0x13ae09(++_0x30dd42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +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(_0x50dfa4,_0x1e9bb2){var _0x9c4062=function(_0x9b0b2b){while(--_0x9b0b2b){_0x50dfa4['push'](_0x50dfa4['shift']());}};_0x9c4062(++_0x1e9bb2);}(_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 0cede58..c8639db 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 _0x8e8a=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x263999,_0x477176){var _0x336996=function(_0x43c50a){while(--_0x43c50a){_0x263999['push'](_0x263999['shift']());}};_0x336996(++_0x477176);}(_0x8e8a,0xcc));var _0xa8e8=function(_0x3004cf,_0x17641f){_0x3004cf=_0x3004cf-0x0;var _0x347e8b=_0x8e8a[_0x3004cf];return _0x347e8b;};'use strict';var client=require(_0xa8e8('0x0'));exports[_0xa8e8('0x1')]=function(_0x2f02c3){return function(){return client[_0xa8e8('0x2')](_0xa8e8('0x3'),{'options':{'where':{'VoiceQueueId':_0x2f02c3,'paused':!![]},'raw':!![]},'log':_0xa8e8('0x1')});};}; \ No newline at end of file +var _0x3b4e=['getVoiceQueueRtPauses','../client','GetVoiceQueueRtPauses'];(function(_0x51407e,_0x3f024e){var _0x22e929=function(_0x144df6){while(--_0x144df6){_0x51407e['push'](_0x51407e['shift']());}};_0x22e929(++_0x3f024e);}(_0x3b4e,0x169));var _0xe3b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b4e[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xe3b4('0x0'));exports['getVoiceQueueRtPauses']=function(_0xef275d){return function(){return client['Request'](_0xe3b4('0x1'),{'options':{'where':{'VoiceQueueId':_0xef275d,'paused':!![]},'raw':!![]},'log':_0xe3b4('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 88bf533..064c2f2 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(_0x3393a6,_0x111b57){var _0x29a783=function(_0x56dd99){while(--_0x56dd99){_0x3393a6['push'](_0x3393a6['shift']());}};_0x29a783(++_0x111b57);}(_0x7a54,0x106));var _0x47a5=function(_0x1b7761,_0x28e696){_0x1b7761=_0x1b7761-0x0;var _0x4f98f4=_0x7a54[_0x1b7761];return _0x4f98f4;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x572600,_0x18d042){var _0x1db19c=function(_0x3fd54d){while(--_0x3fd54d){_0x572600['push'](_0x572600['shift']());}};_0x1db19c(++_0x18d042);}(_0x7a54,0x106));var _0x47a5=function(_0x24ad7d,_0x1b4662){_0x24ad7d=_0x24ad7d-0x0;var _0x39193d=_0x7a54[_0x24ad7d];return _0x39193d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 65d1b2b..03c8bfe 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 _0x4a1c=['transfereeexten','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x3c9368,_0x568de8){var _0x170e77=function(_0x3fb1ad){while(--_0x3fb1ad){_0x3c9368['push'](_0x3c9368['shift']());}};_0x170e77(++_0x568de8);}(_0x4a1c,0xc5));var _0xc4a1=function(_0x21c068,_0x369d6a){_0x21c068=_0x21c068-0x0;var _0x5cf199=_0x4a1c[_0x21c068];return _0x5cf199;};'use strict';var client=require('../client');exports[_0xc4a1('0x0')]={};exports[_0xc4a1('0x1')]=function(_0xb9745a){return client[_0xc4a1('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xb9745a[_0xc4a1('0x3')],'transfererchannel':_0xb9745a[_0xc4a1('0x4')],'transferercalleridnum':_0xb9745a['transferercalleridnum'],'transferercalleridname':_0xb9745a[_0xc4a1('0x5')],'transfererconnectedlinenum':_0xb9745a['transfererconnectedlinenum'],'transfererconnectedlinename':_0xb9745a[_0xc4a1('0x6')],'transfereraccountcode':_0xb9745a['transfereraccountcode'],'transferercontext':_0xb9745a[_0xc4a1('0x7')],'transfererexten':_0xb9745a['transfererexten'],'transfererlinkedid':_0xb9745a[_0xc4a1('0x8')],'transfereechannel':_0xb9745a['transfereechannel'],'transfereecalleridnum':_0xb9745a['transfereecalleridnum'],'transfereecalleridname':_0xb9745a['transfereecalleridname'],'transfereeconnectedlinenum':_0xb9745a[_0xc4a1('0x9')],'transfereeconnectedlinename':_0xb9745a[_0xc4a1('0xa')],'transfereeaccountcode':_0xb9745a[_0xc4a1('0xb')],'transfereecontext':_0xb9745a[_0xc4a1('0xc')],'transfereeexten':_0xb9745a[_0xc4a1('0xd')],'transfereelinkedid':_0xb9745a['transfereelinkedid'],'isexternal':_0xb9745a[_0xc4a1('0xe')],'context':_0xb9745a['context'],'extension':_0xb9745a[_0xc4a1('0xf')],'type':_0xc4a1('0x10')},'log':_0xc4a1('0x11')});};exports[_0xc4a1('0x12')]=function(_0x2c0291){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x2c0291[_0xc4a1('0x3')],'transfererchannel':_0x2c0291[_0xc4a1('0x13')],'transferercalleridnum':_0x2c0291[_0xc4a1('0x14')],'transferercalleridname':_0x2c0291[_0xc4a1('0x15')],'transfererconnectedlinenum':_0x2c0291['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2c0291['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2c0291[_0xc4a1('0x16')],'transferercontext':_0x2c0291[_0xc4a1('0x17')],'transfererexten':_0x2c0291[_0xc4a1('0x18')],'transfererlinkedid':_0x2c0291[_0xc4a1('0x19')],'transfereechannel':_0x2c0291[_0xc4a1('0x1a')],'transfereecalleridnum':_0x2c0291[_0xc4a1('0x1b')],'transfereecalleridname':_0x2c0291[_0xc4a1('0x1c')],'transfereeconnectedlinenum':_0x2c0291[_0xc4a1('0x1d')],'transfereeconnectedlinename':_0x2c0291['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2c0291[_0xc4a1('0x1e')],'transfereecontext':_0x2c0291[_0xc4a1('0x1f')],'transfereeexten':_0x2c0291['transfertargetexten'],'transfereelinkedid':_0x2c0291[_0xc4a1('0x20')],'isexternal':_0x2c0291['isexternal'],'context':_0x2c0291[_0xc4a1('0x21')],'extension':_0x2c0291[_0xc4a1('0x22')],'type':'attended'},'log':_0xc4a1('0x11')});}; \ No newline at end of file +var _0x8b31=['origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transferercontext','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','context','extension','blind','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext'];(function(_0x1ba697,_0x186781){var _0x433b23=function(_0xe5df67){while(--_0xe5df67){_0x1ba697['push'](_0x1ba697['shift']());}};_0x433b23(++_0x186781);}(_0x8b31,0x71));var _0x18b3=function(_0x2229c8,_0x3f24f5){_0x2229c8=_0x2229c8-0x0;var _0x120708=_0x8b31[_0x2229c8];return _0x120708;};'use strict';var client=require(_0x18b3('0x0'));exports['transfers']={};exports[_0x18b3('0x1')]=function(_0xca5450){return client[_0x18b3('0x2')](_0x18b3('0x3'),{'body':{'result':_0xca5450[_0x18b3('0x4')],'transfererchannel':_0xca5450[_0x18b3('0x5')],'transferercalleridnum':_0xca5450[_0x18b3('0x6')],'transferercalleridname':_0xca5450[_0x18b3('0x7')],'transfererconnectedlinenum':_0xca5450[_0x18b3('0x8')],'transfererconnectedlinename':_0xca5450['transfererconnectedlinename'],'transfereraccountcode':_0xca5450['transfereraccountcode'],'transferercontext':_0xca5450[_0x18b3('0x9')],'transfererexten':_0xca5450['transfererexten'],'transfererlinkedid':_0xca5450['transfererlinkedid'],'transfereechannel':_0xca5450[_0x18b3('0xa')],'transfereecalleridnum':_0xca5450['transfereecalleridnum'],'transfereecalleridname':_0xca5450[_0x18b3('0xb')],'transfereeconnectedlinenum':_0xca5450[_0x18b3('0xc')],'transfereeconnectedlinename':_0xca5450[_0x18b3('0xd')],'transfereeaccountcode':_0xca5450[_0x18b3('0xe')],'transfereecontext':_0xca5450[_0x18b3('0xf')],'transfereeexten':_0xca5450['transfereeexten'],'transfereelinkedid':_0xca5450[_0x18b3('0x10')],'isexternal':_0xca5450['isexternal'],'context':_0xca5450[_0x18b3('0x11')],'extension':_0xca5450[_0x18b3('0x12')],'type':_0x18b3('0x13')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x796bee){return client[_0x18b3('0x2')](_0x18b3('0x3'),{'body':{'result':_0x796bee[_0x18b3('0x4')],'transfererchannel':_0x796bee['origtransfererchannel'],'transferercalleridnum':_0x796bee[_0x18b3('0x14')],'transferercalleridname':_0x796bee['origtransferercalleridname'],'transfererconnectedlinenum':_0x796bee['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x796bee[_0x18b3('0x15')],'transfereraccountcode':_0x796bee[_0x18b3('0x16')],'transferercontext':_0x796bee[_0x18b3('0x17')],'transfererexten':_0x796bee[_0x18b3('0x18')],'transfererlinkedid':_0x796bee[_0x18b3('0x19')],'transfereechannel':_0x796bee[_0x18b3('0x1a')],'transfereecalleridnum':_0x796bee[_0x18b3('0x1b')],'transfereecalleridname':_0x796bee[_0x18b3('0x1c')],'transfereeconnectedlinenum':_0x796bee[_0x18b3('0x1d')],'transfereeconnectedlinename':_0x796bee[_0x18b3('0x1e')],'transfereeaccountcode':_0x796bee['transfertargetaccountcode'],'transfereecontext':_0x796bee[_0x18b3('0x1f')],'transfereeexten':_0x796bee['transfertargetexten'],'transfereelinkedid':_0x796bee[_0x18b3('0x20')],'isexternal':_0x796bee[_0x18b3('0x21')],'context':_0x796bee[_0x18b3('0x22')],'extension':_0x796bee[_0x18b3('0x23')],'type':_0x18b3('0x24')},'log':_0x18b3('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 5788cea..75cf5c6 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 _0x32f4=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','map','uniqueid','channel','%s.%s','wav','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','StopMixMonitor','destinationchannel','status','filename','stop','voicequeuechannel','voicequeuechannelhangup','Hangup','queueChannels','exten','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','agents','pause','QueuePause','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Action','then','message','catch','isConnected','join','command','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumDuration','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x32f4,0x154));var _0x432f=function(_0x103a26,_0x11d0cb){_0x103a26=_0x103a26-0x0;var _0x47c27e=_0x32f4[_0x103a26];return _0x47c27e;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var jayson=require(_0x432f('0x2'));var schema=require(_0x432f('0x3'));var BPromise=require('bluebird');var moment=require(_0x432f('0x4'));var config=require(_0x432f('0x5'));var properties=require('../properties');var ami=require(_0x432f('0x6'));exports[_0x432f('0x7')]=function(_0x344a29,_0x355b02,_0x2f5f03){return new BPromise(function(_0x5d8cc0,_0x5b5f08){var _0x2f66fd={'QueuePause':function(_0x32b062){return new Promise(function(_0x4a5b56,_0x2a2ef6){var _0x5aaf1a=util[_0x432f('0x8')](_0x432f('0x9'),_0x432f('0xa'),_0x32b062[_0x432f('0xb')]);if(_0x344a29[_0x432f('0xc')]&&_0x344a29['timers'][_0x5aaf1a]&&_0x344a29[_0x432f('0xc')][_0x5aaf1a]['timer']){_0x344a29[_0x432f('0xc')][_0x5aaf1a]['updateAcw']();}if(_0x344a29[_0x432f('0xd')][_0x5aaf1a]){_0x344a29[_0x432f('0xd')][_0x5aaf1a]['updateStatusRealtime']({'statePause':_0x32b062[_0x432f('0xe')]?!![]:![]});}_0x4a5b56({'code':0xc8,'message':_0x432f('0xf')});});},'Reload':function(_0x52e40f){var _0x10b6fa=this;return new Promise(function(_0x26aa9a,_0x5dd518){if(ami['isConnected']()==![]){return _0x5dd518(_0x10b6fa[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')]['join']('\x20')));}_0x52e40f=_[_0x432f('0x14')](_0x52e40f,_[_0x432f('0x15')](properties[_0x432f('0x16')]));_0x52e40f[_0x432f('0x17')]='Reload';return ami[_0x432f('0x18')](_0x52e40f)[_0x432f('0x19')](function(_0x42c2d2){_0x26aa9a({'code':0xc8,'message':_0x42c2d2[_0x432f('0x1a')]});})[_0x432f('0x1b')](function(_0x129582){_0x5dd518(_0x10b6fa['error'](0x1f5,_0x129582[_0x432f('0x1a')]));});});},'Command':function(_0x4ddd21){var _0x3d545d=this;return new Promise(function(_0x2bf251,_0x1799c4){if(ami[_0x432f('0x1c')]()==![]){return _0x1799c4(_0x3d545d[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')][_0x432f('0x1d')]('\x20')));}_0x4ddd21=_[_0x432f('0x14')](_0x4ddd21,_0x432f('0x1e'));_0x4ddd21['action']='Command';return ami[_0x432f('0x18')](_0x4ddd21)['then'](function(_0x28968e){_0x2bf251({'code':0xc8,'message':_0x28968e['content']});})[_0x432f('0x1b')](function(_0x175d1b){_0x1799c4(_0x3d545d[_0x432f('0x10')](0x1f5,_0x175d1b[_0x432f('0x1a')]));});});},'VoiceQueues':function(_0x2f84a7){return new Promise(function(_0x1e347a,_0x59f352){var _0x252b3b=[];for(var _0x33edec in _0x344a29['voiceQueues']){if(_0x344a29[_0x432f('0x1f')][_0x432f('0x20')](_0x33edec)){var _0x2bcbb4=_0x344a29[_0x432f('0x1f')][_0x33edec];var _0x44839={'id':_0x2bcbb4['id'],'name':_0x2bcbb4[_0x432f('0xb')],'strategy':_0x2bcbb4[_0x432f('0x21')],'answered':_0x2bcbb4['answered'],'available':_0x2bcbb4[_0x432f('0x22')],'loggedIn':_0x2bcbb4['loggedIn'],'pTalking':_0x2bcbb4[_0x432f('0x23')],'sumBillable':_0x2bcbb4['sumBillable'],'sumDuration':_0x2bcbb4[_0x432f('0x24')],'sumHoldTime':_0x2bcbb4['sumHoldTime']||0x0,'talking':_0x2bcbb4[_0x432f('0x25')],'total':_0x2bcbb4['total'],'type':_0x2bcbb4[_0x432f('0x26')],'unmanaged':_0x2bcbb4[_0x432f('0x27')],'abandoned':_0x2bcbb4[_0x432f('0x28')],'waiting':_0x2bcbb4['waiting'],'loggedInDb':_0x2bcbb4[_0x432f('0x29')]};if(_0x2bcbb4[_0x432f('0x26')]==='outbound'){_0x44839['dialActive']=_0x2bcbb4[_0x432f('0x2a')];_0x44839[_0x432f('0x2b')]=_0x2bcbb4[_0x432f('0x2b')];_0x44839[_0x432f('0x2c')]=_0x2bcbb4[_0x432f('0x2c')];_0x44839[_0x432f('0x2d')]=_0x2bcbb4['dialOriginateCallerIdNumber'];_0x44839['dialOriginateTimeout']=_0x2bcbb4[_0x432f('0x2e')];_0x44839[_0x432f('0x2f')]=_0x2bcbb4[_0x432f('0x2f')];_0x44839['temp']=_0x2bcbb4[_0x432f('0x30')];_0x44839[_0x432f('0x31')]=_0x2bcbb4[_0x432f('0x31')];_0x44839[_0x432f('0x32')]=_0x2bcbb4[_0x432f('0x32')];_0x44839[_0x432f('0x33')]=_0x2bcbb4[_0x432f('0x33')];_0x44839[_0x432f('0x34')]=_0x2bcbb4['outboundBusyCallsDay'];_0x44839['outboundCongestionCallsDay']=_0x2bcbb4[_0x432f('0x35')];_0x44839[_0x432f('0x36')]=_0x2bcbb4['outboundDropCallsDayACS'];_0x44839['outboundDropCallsDayCallersExit']=_0x2bcbb4['outboundDropCallsDayCallersExit'];_0x44839[_0x432f('0x37')]=_0x2bcbb4[_0x432f('0x37')];_0x44839['outboundNoAnswerCallsDay']=_0x2bcbb4[_0x432f('0x38')];_0x44839[_0x432f('0x39')]=_0x2bcbb4[_0x432f('0x39')];_0x44839['outboundOriginateFailureCallsDay']=_0x2bcbb4[_0x432f('0x3a')];_0x44839[_0x432f('0x3b')]=_0x2bcbb4['outboundReCallsDay'];_0x44839[_0x432f('0x3c')]=_0x2bcbb4[_0x432f('0x3c')];_0x44839['outboundUnknownCallsDay']=_0x2bcbb4[_0x432f('0x3d')];_0x44839[_0x432f('0x3e')]=_0x2bcbb4[_0x432f('0x3e')];_0x44839[_0x432f('0x3f')]=_0x2bcbb4[_0x432f('0x3f')];_0x44839[_0x432f('0x40')]=_0x2bcbb4[_0x432f('0x40')];_0x44839[_0x432f('0x41')]=_0x2bcbb4[_0x432f('0x41')];_0x44839[_0x432f('0x42')]=_0x2bcbb4[_0x432f('0x42')];_0x44839['predictiveIntervalErlangCalls']=_0x2bcbb4[_0x432f('0x43')];_0x44839['predictiveIntervalErlangCallsDroppedCalls']=_0x2bcbb4[_0x432f('0x44')];_0x44839[_0x432f('0x45')]=_0x2bcbb4['predictiveIntervalHitRate'];_0x44839[_0x432f('0x46')]=_0x2bcbb4['predictiveIntervalMultiplicativeFactor'];_0x44839[_0x432f('0x47')]=_0x2bcbb4[_0x432f('0x47')];_0x44839['predictiveIntervalAvailable']=_0x2bcbb4['predictiveIntervalAvailable'];_0x44839[_0x432f('0x48')]=_0x2bcbb4[_0x432f('0x48')];_0x44839[_0x432f('0x1a')]=_0x2bcbb4[_0x432f('0x1a')];_0x44839[_0x432f('0x49')]=_0x2bcbb4['originated'];_0x44839['erlangCalls']=_0x2bcbb4['erlangCalls'];_0x44839[_0x432f('0x4a')]=_0x2bcbb4[_0x432f('0x4a')];_0x44839['erlangAbandonmentRate']=_0x2bcbb4[_0x432f('0x4b')];_0x44839[_0x432f('0x4c')]=_0x2bcbb4[_0x432f('0x4c')];_0x44839[_0x432f('0x4d')]=_0x2bcbb4[_0x432f('0x4d')];_0x44839[_0x432f('0x4e')]=_0x2bcbb4[_0x432f('0x4e')];}if(_0x2bcbb4[_0x432f('0x4f')]){_0x44839[_0x432f('0x4f')]={'id':_0x2bcbb4['Trunk']['id'],'name':_0x2bcbb4[_0x432f('0x4f')][_0x432f('0xb')],'active':_0x2bcbb4['Trunk'][_0x432f('0x50')],'callerid':_0x2bcbb4[_0x432f('0x4f')][_0x432f('0x51')]};}if(_0x2bcbb4[_0x432f('0x52')]){_0x44839[_0x432f('0x52')]={'id':_0x2bcbb4[_0x432f('0x52')]['id'],'name':_0x2bcbb4[_0x432f('0x52')][_0x432f('0xb')]};}_0x252b3b[_0x432f('0x53')](_0x44839);}}_0x1e347a({'count':_0x252b3b[_0x432f('0x54')],'rows':_0x252b3b});});},'UpdateVoiceQueue':function(_0x12247f){return new Promise(function(_0x2b456c,_0x2c914b){var _0x77938b=_['find'](_0x344a29['voiceQueues'],{'id':parseInt(_0x12247f['id'])});var _0x31d3ad=_[_0x432f('0x55')](_0x12247f,['id']);if(_0x77938b){for(var _0xcbdcc0 in _0x31d3ad){if(typeof _0x31d3ad[_0xcbdcc0]!==_0x432f('0x56')&&typeof _0x77938b[_0xcbdcc0]!==_0x432f('0x56')){_0x77938b[_0xcbdcc0]=_0x31d3ad[_0xcbdcc0];}}_0x2b456c(_0x77938b);}else{_0x2c914b();}});},'VoiceChannels':function(_0x49a17c){return new Promise(function(_0x366230,_0x23ee80){var _0x46c5ee=_[_0x432f('0x57')](_0x344a29[_0x432f('0x58')]);_0x366230({'count':_0x46c5ee[_0x432f('0x54')],'rows':_0x46c5ee});});},'VoiceChannelMixMonitor':function(_0x26f31e){var _0x5a91ca=this;return new Promise(function(_0x3abafe,_0x2dd9c2){if(ami[_0x432f('0x1c')]()==![]){return _0x2dd9c2(_0x5a91ca['error'](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')]['username'],'ami\x20disconnected'][_0x432f('0x1d')]('\x20')));}var _0x24f244=schema(properties['voicechannel'])['validate'](_0x26f31e);if(_0x24f244[_0x432f('0x54')]>0x0){return _0x2dd9c2(_0x5a91ca['error'](0x1f4,_[_0x432f('0x59')](_0x24f244,_0x432f('0x1a'))['join'](',\x20')));}var _0x12f2f7=_['find'](_0x344a29[_0x432f('0x58')],{'uniqueid':_0x26f31e[_0x432f('0x5a')]});if(_0x12f2f7&&_0x12f2f7[_0x432f('0x5b')]){var _0xe43f31=util[_0x432f('0x8')](_0x432f('0x5c'),_0x26f31e['filename']||_0x26f31e[_0x432f('0x5a')],_0x26f31e['format']||_0x432f('0x5d'));return ami[_0x432f('0x18')]({'action':_0x432f('0x5e'),'channel':_0x12f2f7[_0x432f('0x5b')],'file':_0xe43f31,'options':'ai(mixmonitorid)'})[_0x432f('0x19')](function(_0x476c09){var _0x12e177=_[_0x432f('0x5f')](_0x12f2f7[_0x432f('0x60')],{'filename':_0x432f('0x61')+_0xe43f31[_0x432f('0x62')]()});if(_['isNil'](_0x12e177)){_0x12f2f7['monitors'][_0x432f('0x53')]({'filename':_0x432f('0x61')+_0xe43f31[_0x432f('0x62')](),'createdAt':moment()[_0x432f('0x8')](_0x432f('0x63')),'mixmonitorid':_0x476c09[_0x432f('0x64')],'status':'rec'});}else{_0x12e177[_0x432f('0x64')]=_0x476c09['mixmonitorid'];_0x12e177['status']=_0x432f('0x65');}_0x3abafe({'code':0xc8,'message':[_0x26f31e[_0x432f('0x5a')],_0x432f('0x66'),_0x476c09[_0x432f('0x64')]][_0x432f('0x1d')]('\x20'),'mixmonitorid':_0x476c09[_0x432f('0x64')]});})['catch'](function(_0x46c36d){_0x2dd9c2(_0x5a91ca[_0x432f('0x10')](0x1f5,[_0x26f31e['uniqueid'],_0x46c36d[_0x432f('0x1a')][_0x432f('0x62')]()]['join']('\x20')));});}else{return _0x2dd9c2(_0x5a91ca[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x348331){var _0x387999=this;return new Promise(function(_0x3d6382,_0xe729fc){if(ami[_0x432f('0x1c')]()==![]){return _0xe729fc(_0x387999[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')][_0x432f('0x1d')]('\x20')));}var _0x43577d=schema(properties[_0x432f('0x68')])[_0x432f('0x3')](_0x348331);if(_0x43577d['length']>0x0){return _0xe729fc(_0x387999['error'](0x1f4,_[_0x432f('0x59')](_0x43577d,_0x432f('0x1a'))[_0x432f('0x1d')](',\x20')));}var _0x5de9ae=_[_0x432f('0x5f')](_0x344a29[_0x432f('0x58')],{'uniqueid':_0x348331[_0x432f('0x5a')]});if(_0x5de9ae){return BPromise['resolve']()['then'](function(){if(_0x5de9ae[_0x432f('0x5b')]){return ami[_0x432f('0x18')]({'action':'StopMixMonitor','channel':_0x5de9ae[_0x432f('0x5b')],'mixmonitorid':_0x348331['mixmonitorid']})[_0x432f('0x1b')](function(_0x17d1f3){});}})[_0x432f('0x19')](function(){if(_0x5de9ae['destinationchannel']){return ami[_0x432f('0x18')]({'action':_0x432f('0x69'),'channel':_0x5de9ae[_0x432f('0x6a')],'mixmonitorid':_0x348331[_0x432f('0x64')]})['catch'](function(_0x422468){});}})[_0x432f('0x19')](function(_0x52f2ae){var _0x44fbd2=_['find'](_0x5de9ae['monitors'],{'mixmonitorid':_0x348331['mixmonitorid']});if(_0x44fbd2){_0x44fbd2[_0x432f('0x6b')]='stop';}})[_0x432f('0x19')](function(){var _0x32dfe1=util['format']('%s.%s',_0x348331[_0x432f('0x6c')]||_0x348331[_0x432f('0x5a')],_0x348331[_0x432f('0x8')]||_0x432f('0x5d'));var _0x5174cb=_[_0x432f('0x5f')](_0x5de9ae[_0x432f('0x60')],{'filename':'/var/spool/asterisk/monitor/'+_0x32dfe1[_0x432f('0x62')]()});if(_0x5174cb){_0x5174cb['status']=_0x432f('0x6d');}})[_0x432f('0x19')](function(){_0x3d6382({'code':0xc8,'message':[_0x348331[_0x432f('0x5a')],'StopMixMonitor\x20Success'][_0x432f('0x1d')]('\x20')});})[_0x432f('0x1b')](function(_0x149119){_0xe729fc(_0x387999[_0x432f('0x10')](0x1f5,[_0x348331['uniqueid'],_0x149119[_0x432f('0x1a')]['toLowerCase']()][_0x432f('0x1d')]('\x20')));});}else{return _0xe729fc(_0x387999[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceQueuesChannels':function(_0x2038fd){return new Promise(function(_0xef62ee,_0x891328){var _0x354e52=_[_0x432f('0x57')](_0x344a29['queueChannels']);_0xef62ee({'count':_0x354e52[_0x432f('0x54')],'rows':_0x354e52});});},'VoiceQueuesChannel':function(_0x2e0e99){var _0x3be062=this;return new Promise(function(_0x1c96ab,_0x5c06af){var _0x38d006=schema(properties[_0x432f('0x6e')])['validate'](_0x2e0e99);if(_0x38d006[_0x432f('0x54')]>0x0){return _0x5c06af(_0x3be062[_0x432f('0x10')](0x1f4,_[_0x432f('0x59')](_0x38d006,'message')[_0x432f('0x1d')](',\x20')));}var _0x197e77=_[_0x432f('0x5f')](_0x344a29['queueChannels'],{'uniqueid':_0x2e0e99['uniqueid']});if(_0x197e77){_0x1c96ab(_0x197e77);}else{return _0x5c06af(_0x3be062[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x439509){var _0x39930d=this;return new Promise(function(_0x5593aa,_0x5ba58b){if(ami[_0x432f('0x1c')]()==![]){return _0x5ba58b(_0x39930d['error'](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],_0x432f('0x13')][_0x432f('0x1d')]('\x20')));}var _0x28e378=schema(properties[_0x432f('0x6f')])[_0x432f('0x3')](_0x439509);if(_0x28e378['length']>0x0){return _0x5ba58b(_0x39930d[_0x432f('0x10')](0x1f4,_[_0x432f('0x59')](_0x28e378,'message')[_0x432f('0x1d')](',\x20')));}var _0x8a4d01=_['find'](_0x344a29['queueChannels'],{'uniqueid':_0x439509['uniqueid']});if(_0x8a4d01&&_0x8a4d01[_0x432f('0x5b')]){return ami[_0x432f('0x18')]({'action':_0x432f('0x70'),'channel':_0x8a4d01[_0x432f('0x5b')]})[_0x432f('0x19')](function(_0x414a3d){_0x5593aa({'code':0xc8,'message':[_0x439509['uniqueid'],_0x414a3d[_0x432f('0x1a')][_0x432f('0x62')]()][_0x432f('0x1d')]('\x20')});})[_0x432f('0x1b')](function(_0x2137bd){_0x5ba58b(_0x39930d[_0x432f('0x10')](0x1f5,[_0x439509[_0x432f('0x5a')],_0x2137bd[_0x432f('0x1a')][_0x432f('0x62')]()]['join']('\x20')));});}else{return _0x5ba58b(_0x39930d[_0x432f('0x10')](0x1f5,_0x432f('0x67')));}});},'VoiceQueuesChannelRedirect':function(_0x11dec){var _0x438ed8=this;return new Promise(function(_0x43edc6,_0x465e43){if(ami[_0x432f('0x1c')]()==![]){return _0x465e43(_0x438ed8[_0x432f('0x10')](0x1f4,[config[_0x432f('0x11')]['ip'],config[_0x432f('0x11')][_0x432f('0x12')],'ami\x20disconnected'][_0x432f('0x1d')]('\x20')));}var _0x5ac391=schema(properties['voicequeuechannelredirect'])[_0x432f('0x3')](_0x11dec);if(_0x5ac391[_0x432f('0x54')]>0x0){return _0x465e43(_0x438ed8[_0x432f('0x10')](0x1f4,_['map'](_0x5ac391,'message')[_0x432f('0x1d')](',\x20')));}var _0x398b64=_[_0x432f('0x5f')](_0x344a29[_0x432f('0x71')],{'uniqueid':_0x11dec[_0x432f('0x5a')]});if(_0x398b64&&_0x398b64[_0x432f('0x5b')]){return ami[_0x432f('0x18')]({'action':'Redirect','channel':_0x398b64[_0x432f('0x5b')],'exten':_0x11dec[_0x432f('0x72')],'context':_0x11dec[_0x432f('0x73')]||_0x398b64['context'],'priority':0x1})[_0x432f('0x19')](function(_0x198bd6){_0x43edc6({'code':0xc8,'message':[_0x11dec['uniqueid'],_0x198bd6[_0x432f('0x1a')]['toLowerCase']()][_0x432f('0x1d')]('\x20')});})[_0x432f('0x1b')](function(_0x2c7794){_0x465e43(_0x438ed8[_0x432f('0x10')](0x1f5,[_0x11dec[_0x432f('0x5a')],_0x2c7794[_0x432f('0x1a')][_0x432f('0x62')]()][_0x432f('0x1d')]('\x20')));});}else{return _0x465e43(_0x438ed8['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x525560){return new Promise(function(_0x31d0f0,_0x3b53e1){var _0x5eadfe=_[_0x432f('0x57')](_0x344a29[_0x432f('0xd')]);_0x31d0f0({'count':_0x5eadfe[_0x432f('0x54')],'rows':_0x5eadfe});});},'Telephones':function(_0x778d1e){return new Promise(function(_0x54dd28,_0x243306){var _0x2c83a9=_[_0x432f('0x57')](_0x344a29['telephones']);_0x54dd28({'count':_0x2c83a9[_0x432f('0x54')],'rows':_0x2c83a9});});},'Trunks':function(_0x3a0b57){return new Promise(function(_0xc6c937,_0xb88fae){var _0x43b3d3=_[_0x432f('0x57')](_0x344a29[_0x432f('0x74')]);_0xc6c937({'count':_0x43b3d3[_0x432f('0x54')],'rows':_0x43b3d3});});},'OutboundChannels':function(_0x3463c1){return new Promise(function(_0x24cb70,_0x16b357){var _0x300eb9=_['values'](_0x344a29[_0x432f('0x75')]);_0x24cb70({'count':_0x300eb9['length'],'rows':_0x300eb9});});},'Outbound':function(_0x36618f){return new Promise(function(_0x23dfbf,_0x2d796e){_0x23dfbf(_0x344a29['outbound']);});},'Campaigns':function(_0x16ea61){return new Promise(function(_0x1150ee,_0x1da920){var _0x1302d7=_[_0x432f('0x57')](_0x344a29[_0x432f('0x76')]);_0x1150ee({'count':_0x1302d7[_0x432f('0x54')],'rows':_0x1302d7});});},'VoiceQueuesPreview':function(_0x1b9c1a){var _0x307ccc=this;return new Promise(function(_0x51023c,_0x4f196d){_0x355b02['run'](_0x1b9c1a['id'])[_0x432f('0x19')](function(_0x3bc812){_0x51023c({'code':0xc8,'message':_0x3bc812[_0x432f('0x1a')]});})[_0x432f('0x1b')](function(_0x1b678b){_0x4f196d(_0x307ccc[_0x432f('0x10')](0x1f4,_0x1b678b[_0x432f('0x1a')]));});});},'EventManager':function(_0x37c723){var _0x1496c0=this;return new Promise(function(_0x20ea13,_0x56730d){if(!_0x37c723[_0x432f('0x77')]){return _0x56730d(_0x1496c0['error'](0x1f4,_0x432f('0x78')));}ami['emit'](_0x432f('0x79')+_0x37c723[_0x432f('0x77')],_0x37c723[_0x432f('0x1a')]);_0x20ea13({'code':0xc8,'message':_0x37c723});});},'FaxAccounts':function(_0x16bb82){return new Promise(function(_0x21dd08,_0x294444){var _0x47324f=_[_0x432f('0x57')](_0x344a29[_0x432f('0x7a')]);_0x21dd08({'count':_0x47324f[_0x432f('0x54')],'rows':_0x47324f});});},'SendFax':function(_0x38c7a9){var _0x2e00bd=this;return new Promise(function(_0x4bb00d,_0x1f62bc){_0x2f5f03[_0x432f('0x7b')](_0x38c7a9)['then'](function(_0x2357ac){_0x4bb00d({'code':0xc8,'message':_0x2357ac[_0x432f('0x1a')]});})['catch'](function(_0x7ae055){_0x1f62bc(_0x2e00bd[_0x432f('0x10')](0x1f4,_0x7ae055['message']));});});},'CheckAfterSend':function(_0x2dd4b5){var _0x52ba30=this;return new Promise(function(_0x52aa1c,_0x3dd96e){_0x2f5f03['checkAfterSend'](_0x2dd4b5)[_0x432f('0x19')](function(_0xaaf183){_0x52aa1c({'code':0xc8,'message':_0xaaf183['message']});})['catch'](function(_0x4c0a7c){_0x3dd96e(_0x52ba30[_0x432f('0x10')](0x1f4,_0x4c0a7c[_0x432f('0x1a')]));});});}};var _0x28187a=jayson[_0x432f('0x7c')](_0x2f66fd)[_0x432f('0x7d')]();_0x28187a['on'](_0x432f('0x10'),function(_0x532b0d){return _0x5b5f08(_0x532b0d);});_0x28187a[_0x432f('0x7')](0x232a,_0x432f('0x7e'),function(){console[_0x432f('0x7f')](_0x432f('0x80'),0x232a);return _0x5d8cc0(_0x432f('0x81')+0x232a);});});}; \ No newline at end of file +var _0x31c2=['wav','MixMonitor','channel','ai(mixmonitorid)','monitors','toLowerCase','isNil','push','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','message','catch','command','Command','then','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','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','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','format','%s.%s','filename'];(function(_0x5893f5,_0xbea086){var _0x59773b=function(_0x14716c){while(--_0x14716c){_0x5893f5['push'](_0x5893f5['shift']());}};_0x59773b(++_0xbea086);}(_0x31c2,0x1e1));var _0x231c=function(_0x598a9b,_0x29501f){_0x598a9b=_0x598a9b-0x0;var _0x5bddfc=_0x31c2[_0x598a9b];return _0x5bddfc;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var jayson=require(_0x231c('0x2'));var schema=require(_0x231c('0x3'));var BPromise=require(_0x231c('0x4'));var moment=require(_0x231c('0x5'));var config=require(_0x231c('0x6'));var properties=require(_0x231c('0x7'));var ami=require('../ami');exports['listen']=function(_0x2b7d5f,_0x1b9d64,_0x1f3f7d){return new BPromise(function(_0x219c3f,_0x48bfb2){var _0x111bf9={'QueuePause':function(_0x49ff9e){return new Promise(function(_0x439df8,_0x38b3b9){var _0x1000c9=util['format'](_0x231c('0x8'),_0x231c('0x9'),_0x49ff9e[_0x231c('0xa')]);if(_0x2b7d5f[_0x231c('0xb')]&&_0x2b7d5f[_0x231c('0xb')][_0x1000c9]&&_0x2b7d5f[_0x231c('0xb')][_0x1000c9][_0x231c('0xc')]){_0x2b7d5f['timers'][_0x1000c9][_0x231c('0xd')]();}if(_0x2b7d5f[_0x231c('0xe')][_0x1000c9]){_0x2b7d5f['agents'][_0x1000c9][_0x231c('0xf')]({'statePause':_0x49ff9e[_0x231c('0x10')]?!![]:![]});}_0x439df8({'code':0xc8,'message':_0x231c('0x11')});});},'Reload':function(_0x1aa3fe){var _0x284280=this;return new Promise(function(_0x1404bc,_0x2c4f75){if(ami[_0x231c('0x12')]()==![]){return _0x2c4f75(_0x284280[_0x231c('0x13')](0x1f4,[config[_0x231c('0x14')]['ip'],config[_0x231c('0x14')][_0x231c('0x15')],_0x231c('0x16')][_0x231c('0x17')]('\x20')));}_0x1aa3fe=_[_0x231c('0x18')](_0x1aa3fe,_[_0x231c('0x19')](properties[_0x231c('0x1a')]));_0x1aa3fe[_0x231c('0x1b')]=_0x231c('0x1c');return ami[_0x231c('0x1d')](_0x1aa3fe)['then'](function(_0x599cd6){_0x1404bc({'code':0xc8,'message':_0x599cd6[_0x231c('0x1e')]});})[_0x231c('0x1f')](function(_0xadea80){_0x2c4f75(_0x284280[_0x231c('0x13')](0x1f5,_0xadea80[_0x231c('0x1e')]));});});},'Command':function(_0x3c3ea6){var _0x172d50=this;return new Promise(function(_0x2890e3,_0x1c9c85){if(ami['isConnected']()==![]){return _0x1c9c85(_0x172d50[_0x231c('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x231c('0x14')]['username'],_0x231c('0x16')][_0x231c('0x17')]('\x20')));}_0x3c3ea6=_[_0x231c('0x18')](_0x3c3ea6,_0x231c('0x20'));_0x3c3ea6[_0x231c('0x1b')]=_0x231c('0x21');return ami[_0x231c('0x1d')](_0x3c3ea6)[_0x231c('0x22')](function(_0x54566f){_0x2890e3({'code':0xc8,'message':_0x54566f[_0x231c('0x23')]});})[_0x231c('0x1f')](function(_0x4af49b){_0x1c9c85(_0x172d50[_0x231c('0x13')](0x1f5,_0x4af49b[_0x231c('0x1e')]));});});},'VoiceQueues':function(_0x5c569a){return new Promise(function(_0x318dad,_0x564939){var _0x3ea0cd=[];for(var _0x454f70 in _0x2b7d5f[_0x231c('0x24')]){if(_0x2b7d5f[_0x231c('0x24')][_0x231c('0x25')](_0x454f70)){var _0x131cfd=_0x2b7d5f[_0x231c('0x24')][_0x454f70];var _0x4caf68={'id':_0x131cfd['id'],'name':_0x131cfd[_0x231c('0xa')],'strategy':_0x131cfd[_0x231c('0x26')],'answered':_0x131cfd['answered'],'available':_0x131cfd[_0x231c('0x27')],'loggedIn':_0x131cfd[_0x231c('0x28')],'pTalking':_0x131cfd[_0x231c('0x29')],'sumBillable':_0x131cfd[_0x231c('0x2a')],'sumDuration':_0x131cfd[_0x231c('0x2b')],'sumHoldTime':_0x131cfd[_0x231c('0x2c')]||0x0,'talking':_0x131cfd[_0x231c('0x2d')],'total':_0x131cfd['total'],'type':_0x131cfd[_0x231c('0x2e')],'unmanaged':_0x131cfd[_0x231c('0x2f')],'abandoned':_0x131cfd['abandoned'],'waiting':_0x131cfd['waiting'],'loggedInDb':_0x131cfd['loggedInDb']};if(_0x131cfd[_0x231c('0x2e')]==='outbound'){_0x4caf68[_0x231c('0x30')]=_0x131cfd['dialActive'];_0x4caf68[_0x231c('0x31')]=_0x131cfd[_0x231c('0x31')];_0x4caf68[_0x231c('0x32')]=_0x131cfd[_0x231c('0x32')];_0x4caf68['dialOriginateCallerIdNumber']=_0x131cfd[_0x231c('0x33')];_0x4caf68[_0x231c('0x34')]=_0x131cfd[_0x231c('0x34')];_0x4caf68[_0x231c('0x35')]=_0x131cfd[_0x231c('0x35')];_0x4caf68[_0x231c('0x36')]=_0x131cfd[_0x231c('0x36')];_0x4caf68[_0x231c('0x37')]=_0x131cfd['outboundAnswerAgiCallsDay'];_0x4caf68['outboundAnswerCallsDay']=_0x131cfd[_0x231c('0x38')];_0x4caf68[_0x231c('0x39')]=_0x131cfd[_0x231c('0x39')];_0x4caf68[_0x231c('0x3a')]=_0x131cfd[_0x231c('0x3a')];_0x4caf68[_0x231c('0x3b')]=_0x131cfd['outboundCongestionCallsDay'];_0x4caf68[_0x231c('0x3c')]=_0x131cfd[_0x231c('0x3c')];_0x4caf68['outboundDropCallsDayCallersExit']=_0x131cfd['outboundDropCallsDayCallersExit'];_0x4caf68[_0x231c('0x3d')]=_0x131cfd['outboundDropCallsDayTimeout'];_0x4caf68[_0x231c('0x3e')]=_0x131cfd['outboundNoAnswerCallsDay'];_0x4caf68[_0x231c('0x3f')]=_0x131cfd[_0x231c('0x3f')];_0x4caf68['outboundOriginateFailureCallsDay']=_0x131cfd[_0x231c('0x40')];_0x4caf68[_0x231c('0x41')]=_0x131cfd[_0x231c('0x41')];_0x4caf68['outboundRejectCallsDay']=_0x131cfd[_0x231c('0x42')];_0x4caf68[_0x231c('0x43')]=_0x131cfd[_0x231c('0x43')];_0x4caf68[_0x231c('0x44')]=_0x131cfd[_0x231c('0x44')];_0x4caf68[_0x231c('0x45')]=_0x131cfd[_0x231c('0x45')];_0x4caf68[_0x231c('0x46')]=_0x131cfd[_0x231c('0x46')];_0x4caf68[_0x231c('0x47')]=_0x131cfd[_0x231c('0x47')];_0x4caf68[_0x231c('0x48')]=_0x131cfd[_0x231c('0x48')];_0x4caf68['predictiveIntervalErlangCalls']=_0x131cfd[_0x231c('0x49')];_0x4caf68[_0x231c('0x4a')]=_0x131cfd[_0x231c('0x4a')];_0x4caf68[_0x231c('0x4b')]=_0x131cfd[_0x231c('0x4b')];_0x4caf68['predictiveIntervalMultiplicativeFactor']=_0x131cfd[_0x231c('0x4c')];_0x4caf68[_0x231c('0x4d')]=_0x131cfd[_0x231c('0x4d')];_0x4caf68['predictiveIntervalAvailable']=_0x131cfd[_0x231c('0x4e')];_0x4caf68[_0x231c('0x4f')]=_0x131cfd[_0x231c('0x4f')];_0x4caf68[_0x231c('0x1e')]=_0x131cfd[_0x231c('0x1e')];_0x4caf68[_0x231c('0x50')]=_0x131cfd['originated'];_0x4caf68[_0x231c('0x51')]=_0x131cfd[_0x231c('0x51')];_0x4caf68[_0x231c('0x52')]=_0x131cfd[_0x231c('0x52')];_0x4caf68['erlangAbandonmentRate']=_0x131cfd[_0x231c('0x53')];_0x4caf68['erlangBusyFactor']=_0x131cfd[_0x231c('0x54')];_0x4caf68['startPredictive']=_0x131cfd[_0x231c('0x55')];_0x4caf68[_0x231c('0x56')]=_0x131cfd[_0x231c('0x56')];}if(_0x131cfd[_0x231c('0x57')]){_0x4caf68[_0x231c('0x57')]={'id':_0x131cfd[_0x231c('0x57')]['id'],'name':_0x131cfd['Trunk'][_0x231c('0xa')],'active':_0x131cfd[_0x231c('0x57')][_0x231c('0x58')],'callerid':_0x131cfd['Trunk'][_0x231c('0x59')]};}if(_0x131cfd[_0x231c('0x5a')]){_0x4caf68[_0x231c('0x5a')]={'id':_0x131cfd[_0x231c('0x5a')]['id'],'name':_0x131cfd['Interval'][_0x231c('0xa')]};}_0x3ea0cd['push'](_0x4caf68);}}_0x318dad({'count':_0x3ea0cd[_0x231c('0x5b')],'rows':_0x3ea0cd});});},'UpdateVoiceQueue':function(_0x446cf1){return new Promise(function(_0x4c1451,_0x436907){var _0x3d88d3=_[_0x231c('0x5c')](_0x2b7d5f[_0x231c('0x24')],{'id':parseInt(_0x446cf1['id'])});var _0x27ab66=_[_0x231c('0x5d')](_0x446cf1,['id']);if(_0x3d88d3){for(var _0x450f70 in _0x27ab66){if(typeof _0x27ab66[_0x450f70]!==_0x231c('0x5e')&&typeof _0x3d88d3[_0x450f70]!==_0x231c('0x5e')){_0x3d88d3[_0x450f70]=_0x27ab66[_0x450f70];}}_0x4c1451(_0x3d88d3);}else{_0x436907();}});},'VoiceChannels':function(_0x80ef81){return new Promise(function(_0x373fc7,_0x53f33d){var _0x18aaca=_[_0x231c('0x5f')](_0x2b7d5f[_0x231c('0x60')]);_0x373fc7({'count':_0x18aaca[_0x231c('0x5b')],'rows':_0x18aaca});});},'VoiceChannelMixMonitor':function(_0x25500d){var _0x565493=this;return new Promise(function(_0x5b096d,_0x317c11){if(ami['isConnected']()==![]){return _0x317c11(_0x565493[_0x231c('0x13')](0x1f4,[config[_0x231c('0x14')]['ip'],config[_0x231c('0x14')]['username'],_0x231c('0x16')]['join']('\x20')));}var _0x2c9336=schema(properties[_0x231c('0x61')])['validate'](_0x25500d);if(_0x2c9336[_0x231c('0x5b')]>0x0){return _0x317c11(_0x565493[_0x231c('0x13')](0x1f4,_[_0x231c('0x62')](_0x2c9336,'message')['join'](',\x20')));}var _0x4a93af=_[_0x231c('0x5c')](_0x2b7d5f[_0x231c('0x60')],{'uniqueid':_0x25500d[_0x231c('0x63')]});if(_0x4a93af&&_0x4a93af['channel']){var _0x228615=util[_0x231c('0x64')](_0x231c('0x65'),_0x25500d[_0x231c('0x66')]||_0x25500d[_0x231c('0x63')],_0x25500d[_0x231c('0x64')]||_0x231c('0x67'));return ami[_0x231c('0x1d')]({'action':_0x231c('0x68'),'channel':_0x4a93af[_0x231c('0x69')],'file':_0x228615,'options':_0x231c('0x6a')})['then'](function(_0xd29a0d){var _0x27cecf=_['find'](_0x4a93af[_0x231c('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x228615[_0x231c('0x6c')]()});if(_[_0x231c('0x6d')](_0x27cecf)){_0x4a93af[_0x231c('0x6b')][_0x231c('0x6e')]({'filename':_0x231c('0x6f')+_0x228615[_0x231c('0x6c')](),'createdAt':moment()[_0x231c('0x64')](_0x231c('0x70')),'mixmonitorid':_0xd29a0d[_0x231c('0x71')],'status':_0x231c('0x72')});}else{_0x27cecf['mixmonitorid']=_0xd29a0d[_0x231c('0x71')];_0x27cecf[_0x231c('0x73')]=_0x231c('0x72');}_0x5b096d({'code':0xc8,'message':[_0x25500d['uniqueid'],_0x231c('0x74'),_0xd29a0d[_0x231c('0x71')]]['join']('\x20'),'mixmonitorid':_0xd29a0d[_0x231c('0x71')]});})['catch'](function(_0x14f28b){_0x317c11(_0x565493[_0x231c('0x13')](0x1f5,[_0x25500d[_0x231c('0x63')],_0x14f28b[_0x231c('0x1e')][_0x231c('0x6c')]()]['join']('\x20')));});}else{return _0x317c11(_0x565493[_0x231c('0x13')](0x1f5,_0x231c('0x75')));}});},'VoiceChannelStopMixMonitor':function(_0xd016a9){var _0x2bd806=this;return new Promise(function(_0x2889fb,_0x29ceda){if(ami[_0x231c('0x12')]()==![]){return _0x29ceda(_0x2bd806['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x231c('0x15')],_0x231c('0x16')]['join']('\x20')));}var _0x28ce15=schema(properties['voicechannel'])[_0x231c('0x3')](_0xd016a9);if(_0x28ce15[_0x231c('0x5b')]>0x0){return _0x29ceda(_0x2bd806[_0x231c('0x13')](0x1f4,_[_0x231c('0x62')](_0x28ce15,'message')[_0x231c('0x17')](',\x20')));}var _0x586866=_[_0x231c('0x5c')](_0x2b7d5f['channels'],{'uniqueid':_0xd016a9['uniqueid']});if(_0x586866){return BPromise[_0x231c('0x76')]()['then'](function(){if(_0x586866[_0x231c('0x69')]){return ami[_0x231c('0x1d')]({'action':'StopMixMonitor','channel':_0x586866[_0x231c('0x69')],'mixmonitorid':_0xd016a9[_0x231c('0x71')]})[_0x231c('0x1f')](function(_0x163561){});}})[_0x231c('0x22')](function(){if(_0x586866[_0x231c('0x77')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x586866['destinationchannel'],'mixmonitorid':_0xd016a9[_0x231c('0x71')]})[_0x231c('0x1f')](function(_0xfed294){});}})[_0x231c('0x22')](function(_0xb72644){var _0x58b010=_['find'](_0x586866[_0x231c('0x6b')],{'mixmonitorid':_0xd016a9[_0x231c('0x71')]});if(_0x58b010){_0x58b010[_0x231c('0x73')]='stop';}})[_0x231c('0x22')](function(){var _0x1d2afa=util[_0x231c('0x64')](_0x231c('0x65'),_0xd016a9['filename']||_0xd016a9['uniqueid'],_0xd016a9['format']||_0x231c('0x67'));var _0x330f0e=_['find'](_0x586866[_0x231c('0x6b')],{'filename':_0x231c('0x6f')+_0x1d2afa[_0x231c('0x6c')]()});if(_0x330f0e){_0x330f0e[_0x231c('0x73')]=_0x231c('0x78');}})[_0x231c('0x22')](function(){_0x2889fb({'code':0xc8,'message':[_0xd016a9['uniqueid'],_0x231c('0x79')][_0x231c('0x17')]('\x20')});})[_0x231c('0x1f')](function(_0x496dc3){_0x29ceda(_0x2bd806[_0x231c('0x13')](0x1f5,[_0xd016a9[_0x231c('0x63')],_0x496dc3[_0x231c('0x1e')]['toLowerCase']()][_0x231c('0x17')]('\x20')));});}else{return _0x29ceda(_0x2bd806[_0x231c('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x58b86c){return new Promise(function(_0x1d4227,_0x413e39){var _0x182d15=_[_0x231c('0x5f')](_0x2b7d5f[_0x231c('0x7a')]);_0x1d4227({'count':_0x182d15[_0x231c('0x5b')],'rows':_0x182d15});});},'VoiceQueuesChannel':function(_0x323111){var _0x5eef4d=this;return new Promise(function(_0x5734c7,_0x23f255){var _0x4a2f3a=schema(properties[_0x231c('0x7b')])[_0x231c('0x3')](_0x323111);if(_0x4a2f3a['length']>0x0){return _0x23f255(_0x5eef4d[_0x231c('0x13')](0x1f4,_[_0x231c('0x62')](_0x4a2f3a,'message')[_0x231c('0x17')](',\x20')));}var _0x5e98a9=_[_0x231c('0x5c')](_0x2b7d5f[_0x231c('0x7a')],{'uniqueid':_0x323111['uniqueid']});if(_0x5e98a9){_0x5734c7(_0x5e98a9);}else{return _0x23f255(_0x5eef4d[_0x231c('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x18393c){var _0x6098ec=this;return new Promise(function(_0x4ece82,_0x13a7ac){if(ami['isConnected']()==![]){return _0x13a7ac(_0x6098ec[_0x231c('0x13')](0x1f4,[config[_0x231c('0x14')]['ip'],config[_0x231c('0x14')][_0x231c('0x15')],_0x231c('0x16')][_0x231c('0x17')]('\x20')));}var _0x3ba0e0=schema(properties[_0x231c('0x7c')])[_0x231c('0x3')](_0x18393c);if(_0x3ba0e0[_0x231c('0x5b')]>0x0){return _0x13a7ac(_0x6098ec[_0x231c('0x13')](0x1f4,_[_0x231c('0x62')](_0x3ba0e0,_0x231c('0x1e'))[_0x231c('0x17')](',\x20')));}var _0x55cc9a=_[_0x231c('0x5c')](_0x2b7d5f[_0x231c('0x7a')],{'uniqueid':_0x18393c[_0x231c('0x63')]});if(_0x55cc9a&&_0x55cc9a[_0x231c('0x69')]){return ami[_0x231c('0x1d')]({'action':_0x231c('0x7d'),'channel':_0x55cc9a[_0x231c('0x69')]})[_0x231c('0x22')](function(_0x53bbb9){_0x4ece82({'code':0xc8,'message':[_0x18393c[_0x231c('0x63')],_0x53bbb9['message'][_0x231c('0x6c')]()][_0x231c('0x17')]('\x20')});})[_0x231c('0x1f')](function(_0x39f291){_0x13a7ac(_0x6098ec['error'](0x1f5,[_0x18393c['uniqueid'],_0x39f291['message'][_0x231c('0x6c')]()][_0x231c('0x17')]('\x20')));});}else{return _0x13a7ac(_0x6098ec['error'](0x1f5,_0x231c('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x2f2f40){var _0x5ec9b3=this;return new Promise(function(_0x16a8a3,_0x4b3e84){if(ami[_0x231c('0x12')]()==![]){return _0x4b3e84(_0x5ec9b3[_0x231c('0x13')](0x1f4,[config[_0x231c('0x14')]['ip'],config[_0x231c('0x14')][_0x231c('0x15')],'ami\x20disconnected']['join']('\x20')));}var _0x42b9ce=schema(properties[_0x231c('0x7e')])[_0x231c('0x3')](_0x2f2f40);if(_0x42b9ce['length']>0x0){return _0x4b3e84(_0x5ec9b3[_0x231c('0x13')](0x1f4,_[_0x231c('0x62')](_0x42b9ce,'message')[_0x231c('0x17')](',\x20')));}var _0x2d037f=_['find'](_0x2b7d5f[_0x231c('0x7a')],{'uniqueid':_0x2f2f40[_0x231c('0x63')]});if(_0x2d037f&&_0x2d037f[_0x231c('0x69')]){return ami[_0x231c('0x1d')]({'action':_0x231c('0x7f'),'channel':_0x2d037f[_0x231c('0x69')],'exten':_0x2f2f40[_0x231c('0x80')],'context':_0x2f2f40['context']||_0x2d037f[_0x231c('0x81')],'priority':0x1})[_0x231c('0x22')](function(_0x263717){_0x16a8a3({'code':0xc8,'message':[_0x2f2f40[_0x231c('0x63')],_0x263717[_0x231c('0x1e')][_0x231c('0x6c')]()][_0x231c('0x17')]('\x20')});})['catch'](function(_0x205f3a){_0x4b3e84(_0x5ec9b3[_0x231c('0x13')](0x1f5,[_0x2f2f40[_0x231c('0x63')],_0x205f3a[_0x231c('0x1e')][_0x231c('0x6c')]()][_0x231c('0x17')]('\x20')));});}else{return _0x4b3e84(_0x5ec9b3[_0x231c('0x13')](0x1f5,_0x231c('0x75')));}});},'Agents':function(_0x2205c3){return new Promise(function(_0x46f6f1,_0x32d698){var _0x130165=_[_0x231c('0x5f')](_0x2b7d5f['agents']);_0x46f6f1({'count':_0x130165[_0x231c('0x5b')],'rows':_0x130165});});},'Telephones':function(_0x40812b){return new Promise(function(_0x507086,_0x47d826){var _0x991169=_[_0x231c('0x5f')](_0x2b7d5f[_0x231c('0x82')]);_0x507086({'count':_0x991169[_0x231c('0x5b')],'rows':_0x991169});});},'Trunks':function(_0x5d94fe){return new Promise(function(_0x202041,_0x4e72df){var _0x3fbd53=_[_0x231c('0x5f')](_0x2b7d5f['trunks']);_0x202041({'count':_0x3fbd53[_0x231c('0x5b')],'rows':_0x3fbd53});});},'OutboundChannels':function(_0x5e8657){return new Promise(function(_0x286551,_0x55f136){var _0x160bbc=_[_0x231c('0x5f')](_0x2b7d5f[_0x231c('0x83')]);_0x286551({'count':_0x160bbc[_0x231c('0x5b')],'rows':_0x160bbc});});},'Outbound':function(_0x170273){return new Promise(function(_0x59b622,_0x54f22b){_0x59b622(_0x2b7d5f[_0x231c('0x84')]);});},'Campaigns':function(_0x237b23){return new Promise(function(_0xc2e4a0,_0x55d370){var _0x37aff9=_[_0x231c('0x5f')](_0x2b7d5f[_0x231c('0x85')]);_0xc2e4a0({'count':_0x37aff9[_0x231c('0x5b')],'rows':_0x37aff9});});},'VoiceQueuesPreview':function(_0x1d9e00){var _0x52712a=this;return new Promise(function(_0x1e2b62,_0x24a405){_0x1b9d64[_0x231c('0x86')](_0x1d9e00['id'])[_0x231c('0x22')](function(_0x537a53){_0x1e2b62({'code':0xc8,'message':_0x537a53[_0x231c('0x1e')]});})['catch'](function(_0xd36d2c){_0x24a405(_0x52712a[_0x231c('0x13')](0x1f4,_0xd36d2c[_0x231c('0x1e')]));});});},'EventManager':function(_0x2cfe62){var _0x4a8527=this;return new Promise(function(_0x20dd2a,_0x5e0f80){if(!_0x2cfe62[_0x231c('0x87')]){return _0x5e0f80(_0x4a8527[_0x231c('0x13')](0x1f4,_0x231c('0x88')));}ami[_0x231c('0x89')]('custom:'+_0x2cfe62[_0x231c('0x87')],_0x2cfe62[_0x231c('0x1e')]);_0x20dd2a({'code':0xc8,'message':_0x2cfe62});});},'FaxAccounts':function(_0x3a270c){return new Promise(function(_0xb3890e,_0x5c1c52){var _0xf73db2=_[_0x231c('0x5f')](_0x2b7d5f[_0x231c('0x8a')]);_0xb3890e({'count':_0xf73db2[_0x231c('0x5b')],'rows':_0xf73db2});});},'SendFax':function(_0x31a8c5){var _0x47366e=this;return new Promise(function(_0x283fd1,_0x4693e8){_0x1f3f7d[_0x231c('0x8b')](_0x31a8c5)['then'](function(_0x279c82){_0x283fd1({'code':0xc8,'message':_0x279c82['message']});})[_0x231c('0x1f')](function(_0xb67ff7){_0x4693e8(_0x47366e['error'](0x1f4,_0xb67ff7['message']));});});},'CheckAfterSend':function(_0x487e4b){var _0x4a2e1a=this;return new Promise(function(_0x393ab8,_0x46b070){_0x1f3f7d[_0x231c('0x8c')](_0x487e4b)[_0x231c('0x22')](function(_0x2ecf43){_0x393ab8({'code':0xc8,'message':_0x2ecf43[_0x231c('0x1e')]});})['catch'](function(_0x5f18d9){_0x46b070(_0x4a2e1a['error'](0x1f4,_0x5f18d9['message']));});});}};var _0x35e570=jayson[_0x231c('0x8d')](_0x111bf9)[_0x231c('0x8e')]();_0x35e570['on'](_0x231c('0x13'),function(_0x143838){return _0x48bfb2(_0x143838);});_0x35e570['listen'](0x232a,_0x231c('0x8f'),function(){console[_0x231c('0x90')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x219c3f(_0x231c('0x91')+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 b568a19..f2f752d 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 _0x3e74=['scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','data1','data2','isNil','data5','ListId','data3','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt'];(function(_0x246619,_0x4fd68f){var _0x1d6117=function(_0x12706c){while(--_0x12706c){_0x246619['push'](_0x246619['shift']());}};_0x1d6117(++_0x4fd68f);}(_0x3e74,0x175));var _0x43e7=function(_0x28608f,_0x41fc21){_0x28608f=_0x28608f-0x0;var _0x5dbe09=_0x3e74[_0x28608f];return _0x5dbe09;};'use strict';var _=require(_0x43e7('0x0'));var BPromise=require('bluebird');var Redis=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x43e7('0x4'));config['redis']=_[_0x43e7('0x5')](config[_0x43e7('0x6')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config[_0x43e7('0x6')]));function emit(_0x503698,_0x45a0d1,_0x3491d6,_0x2ede2d,_0x8528fc){logger[_0x43e7('0x9')]('[CM][%s][%s]',_0x503698,_0x45a0d1['id'],_0x3491d6,_0x2ede2d,JSON[_0x43e7('0xa')](_0x8528fc));io['to'](_0x3491d6)['emit'](_0x2ede2d,_0x8528fc);}exports['exec']=function(_0x39c8bd,_0x4139c9,_0x5c34f4,_0x2803d9){var _0x513707,_0xf7c520;var _0x37302c={};var _0x4ebc8e=Number(_0x5c34f4[_0x43e7('0xb')]);var _0xc960ea=_0x5c34f4[_0x43e7('0xc')]?Boolean(Number(_0x5c34f4[_0x43e7('0xc')])):![];var _0x4e008c;var _0x583d85=![];if(!_[_0x43e7('0xd')](_0x5c34f4[_0x43e7('0xe')])){if(_0x5c34f4[_0x43e7('0xe')]=='1')_0x583d85=!![];}if(!_0x583d85){if(_0x2803d9['xmd-contactid']){_0x37302c['id']=_0x2803d9['xmd-contactid'];}}if(!_0x37302c['id']){_0x37302c[_0x43e7('0xf')]=_0x4ebc8e;_0x4e008c=_0x5c34f4[_0x43e7('0x10')]&&_0x5c34f4[_0x43e7('0x10')]!=='0'?_0x5c34f4[_0x43e7('0x10')]['split'](','):['phone'];_0x37302c[_0x43e7('0x11')]=_[_0x43e7('0x12')](_0x4e008c,function(_0x273a32){var _0x5d346f={};_0x5d346f[_0x273a32]=_0x2803d9['routeId']?_0x2803d9[_0x43e7('0x13')]:_0x2803d9[_0x43e7('0x14')];return _0x5d346f;});}var _0x9037d3=['id',_0x43e7('0x15'),_0x43e7('0x16'),_0x43e7('0x17'),_0x43e7('0x18'),_0x43e7('0x19'),_0x43e7('0xf'),_0x43e7('0x1a'),_0x43e7('0x1b'),_0x43e7('0x1c')];var _0x4b5d64=_[_0x43e7('0x1d')](_0x9037d3,_0x4e008c);BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x1f')]({'attributes':_0x4b5d64,'where':_0x37302c}))[_0x43e7('0x20')](function(_0x3945bb){_0xf7c520=_0x3945bb;if(!_[_0x43e7('0x21')](_0xf7c520)){if(_0xf7c520[_0x43e7('0x22')]===0x1){_0x513707=_0xf7c520[0x0];logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_[_0x43e7('0x12')](_0xf7c520,'id')['join'](','));}return;}else{logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);var _0x5c5e67={'ListId':_0x4ebc8e};var _0x1af208=_0x5c34f4[_0x43e7('0x24')]&&_0x5c34f4[_0x43e7('0x24')]!=='0'?_0x5c34f4[_0x43e7('0x24')]:'phone';if(_0xc960ea){logger['info'](_0x43e7('0x25'),_0x2803d9['uniqueid'],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])?_0x2803d9[_0x43e7('0x14')]:_0x2803d9[_0x43e7('0x13')];if(_['isNil'](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x27')]:_0x43e7('0x29');}else{_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x2a')]&&_0x2803d9[_0x43e7('0x2a')]!==_0x43e7('0x28')?_0x2803d9[_0x43e7('0x2a')]:_0x43e7('0x29');}return BPromise[_0x43e7('0x1e')]()['then'](cmContactRpc[_0x43e7('0x2b')](_0x5c5e67))[_0x43e7('0x20')](function(_0x3b8f78){_0x513707=_0x3b8f78;_0xf7c520[_0x43e7('0x2c')](_0x3b8f78);if(_0x513707){logger[_0x43e7('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2803d9[_0x43e7('0x23')],_0x4139c9['id'],_0x513707['id']);}return;});}else{logger[_0x43e7('0x9')](_0x43e7('0x2d'),_0x2803d9[_0x43e7('0x23')],_0x4139c9['id']);_0x5c5e67[_0x1af208]=_['isNil'](_0x2803d9['routeId'])?_0x2803d9['calleridnum']:_0x2803d9[_0x43e7('0x13')];if(_[_0x43e7('0xd')](_0x2803d9[_0x43e7('0x26')])){_0x5c5e67[_0x43e7('0x15')]=_0x2803d9[_0x43e7('0x27')]&&_0x2803d9[_0x43e7('0x27')]!==''?_0x2803d9['calleridname']:'Unknown';}else{_0x5c5e67['firstName']=_0x2803d9['destcalleridname']&&_0x2803d9['destcalleridname']!==''?_0x2803d9[_0x43e7('0x2a')]:'Unknown';}_0x513707=_0x5c5e67;_0xf7c520[_0x43e7('0x2c')](_0x5c5e67);return;}}})[_0x43e7('0x20')](function(){if(_0x39c8bd){emit(_0x2803d9[_0x43e7('0x23')],_0x4139c9,util[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x39c8bd[_0x43e7('0x30')]),util[_0x43e7('0x2e')]('trigger:%s',_0x5c34f4['action']['toLowerCase']()),{'evt':_[_0x43e7('0x31')](_0x2803d9,{'autoCreate':_0xc960ea}),'contact':_0x513707===undefined?{}:_0x513707,'contacts':_0xf7c520[_0x43e7('0x22')]===0x0?undefined:_0xf7c520});}});}; \ No newline at end of file +var _0x4b84=['calleridnum','lastName','phone','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','destcalleridnum','calleridname','Unknown','firstName','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','../../../../config/environment','../../rpc/cmContact','redis','defaults','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','ListId','data3','map','routeId'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x4b84[_0x1d94d1];return _0x23c397;};'use strict';var _=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x44b8('0x2'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x44b8('0x3'));config[_0x44b8('0x4')]=_[_0x44b8('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44b8('0x4')]));function emit(_0x54274b,_0x327f59,_0x5947f7,_0x3e87c5,_0x5a2353){logger['info'](_0x44b8('0x6'),_0x54274b,_0x327f59['id'],_0x5947f7,_0x3e87c5,JSON[_0x44b8('0x7')](_0x5a2353));io['to'](_0x5947f7)[_0x44b8('0x8')](_0x3e87c5,_0x5a2353);}exports['exec']=function(_0xc650ec,_0x2cc74b,_0x4315f6,_0x9b6048){var _0x24dd10,_0x37e471;var _0xe9a025={};var _0x4ae8a1=Number(_0x4315f6[_0x44b8('0x9')]);var _0x4301a6=_0x4315f6['data2']?Boolean(Number(_0x4315f6[_0x44b8('0xa')])):![];var _0x490bc6;var _0x833ea3=![];if(!_[_0x44b8('0xb')](_0x4315f6['data5'])){if(_0x4315f6[_0x44b8('0xc')]=='1')_0x833ea3=!![];}if(!_0x833ea3){if(_0x9b6048['xmd-contactid']){_0xe9a025['id']=_0x9b6048['xmd-contactid'];}}if(!_0xe9a025['id']){_0xe9a025[_0x44b8('0xd')]=_0x4ae8a1;_0x490bc6=_0x4315f6[_0x44b8('0xe')]&&_0x4315f6[_0x44b8('0xe')]!=='0'?_0x4315f6[_0x44b8('0xe')]['split'](','):['phone'];_0xe9a025['$or']=_[_0x44b8('0xf')](_0x490bc6,function(_0x5b7803){var _0x28ef36={};_0x28ef36[_0x5b7803]=_0x9b6048[_0x44b8('0x10')]?_0x9b6048['destcalleridnum']:_0x9b6048[_0x44b8('0x11')];return _0x28ef36;});}var _0xe3de8f=['id','firstName',_0x44b8('0x12'),_0x44b8('0x13'),'mobile',_0x44b8('0x14'),_0x44b8('0xd'),_0x44b8('0x15'),_0x44b8('0x16'),_0x44b8('0x17')];var _0x369c09=_[_0x44b8('0x18')](_0xe3de8f,_0x490bc6);BPromise[_0x44b8('0x19')]()[_0x44b8('0x1a')](cmContactRpc[_0x44b8('0x1b')]({'attributes':_0x369c09,'where':_0xe9a025}))[_0x44b8('0x1a')](function(_0x14996c){_0x37e471=_0x14996c;if(!_['isEmpty'](_0x37e471)){if(_0x37e471[_0x44b8('0x1c')]===0x1){_0x24dd10=_0x37e471[0x0];logger[_0x44b8('0x1d')](_0x44b8('0x1e'),_0x9b6048[_0x44b8('0x1f')],_0x2cc74b['id'],_0x24dd10['id']);}else{logger[_0x44b8('0x1d')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x9b6048[_0x44b8('0x1f')],_0x2cc74b['id'],_['map'](_0x37e471,'id')[_0x44b8('0x20')](','));}return;}else{logger[_0x44b8('0x1d')](_0x44b8('0x21'),_0x9b6048[_0x44b8('0x1f')],_0x2cc74b['id']);var _0x230a3d={'ListId':_0x4ae8a1};var _0x59acbc=_0x4315f6[_0x44b8('0x22')]&&_0x4315f6['data4']!=='0'?_0x4315f6[_0x44b8('0x22')]:_0x44b8('0x13');if(_0x4301a6){logger['info'](_0x44b8('0x23'),_0x9b6048[_0x44b8('0x1f')],_0x2cc74b['id']);_0x230a3d[_0x59acbc]=_[_0x44b8('0xb')](_0x9b6048['routeId'])?_0x9b6048[_0x44b8('0x11')]:_0x9b6048[_0x44b8('0x24')];if(_['isNil'](_0x9b6048[_0x44b8('0x10')])){_0x230a3d['firstName']=_0x9b6048[_0x44b8('0x25')]&&_0x9b6048['calleridname']!==''?_0x9b6048['calleridname']:_0x44b8('0x26');}else{_0x230a3d[_0x44b8('0x27')]=_0x9b6048[_0x44b8('0x28')]&&_0x9b6048[_0x44b8('0x28')]!==_0x44b8('0x29')?_0x9b6048[_0x44b8('0x28')]:_0x44b8('0x26');}return BPromise[_0x44b8('0x19')]()[_0x44b8('0x1a')](cmContactRpc[_0x44b8('0x2a')](_0x230a3d))[_0x44b8('0x1a')](function(_0x417d81){_0x24dd10=_0x417d81;_0x37e471[_0x44b8('0x2b')](_0x417d81);if(_0x24dd10){logger['info'](_0x44b8('0x2c'),_0x9b6048['uniqueid'],_0x2cc74b['id'],_0x24dd10['id']);}return;});}else{logger[_0x44b8('0x1d')](_0x44b8('0x2d'),_0x9b6048[_0x44b8('0x1f')],_0x2cc74b['id']);_0x230a3d[_0x59acbc]=_[_0x44b8('0xb')](_0x9b6048[_0x44b8('0x10')])?_0x9b6048['calleridnum']:_0x9b6048[_0x44b8('0x24')];if(_[_0x44b8('0xb')](_0x9b6048[_0x44b8('0x10')])){_0x230a3d[_0x44b8('0x27')]=_0x9b6048[_0x44b8('0x25')]&&_0x9b6048['calleridname']!==_0x44b8('0x29')?_0x9b6048[_0x44b8('0x25')]:_0x44b8('0x26');}else{_0x230a3d[_0x44b8('0x27')]=_0x9b6048[_0x44b8('0x28')]&&_0x9b6048[_0x44b8('0x28')]!==_0x44b8('0x29')?_0x9b6048[_0x44b8('0x28')]:_0x44b8('0x26');}_0x24dd10=_0x230a3d;_0x37e471[_0x44b8('0x2b')](_0x230a3d);return;}}})[_0x44b8('0x1a')](function(){if(_0xc650ec){emit(_0x9b6048[_0x44b8('0x1f')],_0x2cc74b,util[_0x44b8('0x2e')](_0x44b8('0x2f'),_0xc650ec[_0x44b8('0x30')]),util[_0x44b8('0x2e')](_0x44b8('0x31'),_0x4315f6[_0x44b8('0x32')][_0x44b8('0x33')]()),{'evt':_[_0x44b8('0x34')](_0x9b6048,{'autoCreate':_0x4301a6}),'contact':_0x24dd10===undefined?{}:_0x24dd10,'contacts':_0x37e471[_0x44b8('0x1c')]===0x0?undefined:_0x37e471});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0b59e45..d87b5ef 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 _0xb9fc=['trigger','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:timeout','syncAgentDial','custom:dialconnect','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','prototype','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','status','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','isNil','data3','data4','uriLocation','data5','800','windowHeight','data6','600','winapp','winApplication','user:%s','name','format','jscripty','trigger:%s','merge','exec','integration','queue','routeId','urlforward','script','buildUri','parse','query','search','checkTrigger','channel','AllConditions','AnyConditions','some','checkConditions','field','account','operator','AccountId','value','upperFirst','interaction','message','event','agent','membername','lastevent','exports','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment'];(function(_0x25f476,_0x12208e){var _0x4209a0=function(_0x3c81bf){while(--_0x3c81bf){_0x25f476['push'](_0x25f476['shift']());}};_0x4209a0(++_0x12208e);}(_0xb9fc,0x6e));var _0xcb9f=function(_0x520d51,_0x5b1fe0){_0x520d51=_0x520d51-0x0;var _0x45d16d=_0xb9fc[_0x520d51];return _0x45d16d;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xcb9f('0x0'));var Mustache=require(_0xcb9f('0x1'));var Redis=require(_0xcb9f('0x2'));var urlforward=require(_0xcb9f('0x3'));var integration=require(_0xcb9f('0x4'));var cmContact=require(_0xcb9f('0x5'));var script=require(_0xcb9f('0x6'));var config=require(_0xcb9f('0x7'));var logger=require('../../../config/logger')(_0xcb9f('0x8'));var ami=require('../ami');config[_0xcb9f('0x9')]=_[_0xcb9f('0xa')](config[_0xcb9f('0x9')],{'host':_0xcb9f('0xb'),'port':0x18eb});var io=require(_0xcb9f('0xc'))(new Redis(config[_0xcb9f('0x9')]));var operators={'equals':function(_0x4b1e0b,_0x1327bb){return _0x4b1e0b==_0x1327bb;},'not_equals':function(_0x4e10da,_0x20ac2f){return _0x4e10da!=_0x20ac2f;}};var barAndWebActions=[_0xcb9f('0xd'),_0xcb9f('0x0'),'winapp'];function Trigger(_0x49be90){this[_0xcb9f('0xe')]=_0x49be90[_0xcb9f('0xe')];this[_0xcb9f('0xf')]=_0x49be90[_0xcb9f('0xf')];this[_0xcb9f('0x10')]=_0x49be90[_0xcb9f('0x10')];this[_0xcb9f('0x11')]=_0x49be90['templates'];this[_0xcb9f('0x12')]=_0x49be90[_0xcb9f('0x12')];this[_0xcb9f('0x13')]=_0x49be90['zendeskAccounts'];this[_0xcb9f('0x14')]=_0x49be90['freshdeskAccounts'];this['salesforceAccounts']=_0x49be90[_0xcb9f('0x15')];this[_0xcb9f('0x16')]=_0x49be90[_0xcb9f('0x16')];this[_0xcb9f('0x17')]=_0x49be90[_0xcb9f('0x17')];this[_0xcb9f('0x18')]=_0x49be90[_0xcb9f('0x18')];this[_0xcb9f('0x19')]=_0x49be90[_0xcb9f('0x19')];this[_0xcb9f('0x1a')]=_0x49be90[_0xcb9f('0x1a')];this[_0xcb9f('0x1b')]=_0x49be90['dynamics365Accounts'];this[_0xcb9f('0x1c')]=_0x49be90[_0xcb9f('0x1c')];this[_0xcb9f('0x1d')]={'zendesk':this[_0xcb9f('0x13')],'salesforce':this[_0xcb9f('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xcb9f('0x16')],'zoho':this[_0xcb9f('0x17')],'desk':this[_0xcb9f('0x18')],'vtiger':this[_0xcb9f('0x19')],'dynamics365':this[_0xcb9f('0x1b')],'freshsales':this[_0xcb9f('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xcb9f('0x1e'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x21'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on']('custom:agentringnoanswer',this[_0xcb9f('0x1f')]['bind'](this));ami['on'](_0xcb9f('0x22'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x23'),this[_0xcb9f('0x1f')]['bind'](this));ami['on'](_0xcb9f('0x24'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x25'),this['syncCustomEvent'][_0xcb9f('0x20')](this));ami['on']('custom:agentcongestion',this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on']('custom:agentreject',this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x26'),this[_0xcb9f('0x1f')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x27'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on']('custom:dialbegin',this[_0xcb9f('0x28')]['bind'](this));ami['on'](_0xcb9f('0x29'),this['syncAgentDial']['bind'](this));ami['on']('custom:dialend',this[_0xcb9f('0x28')][_0xcb9f('0x20')](this));ami['on']('custom:newinteraction',this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x2a'),this[_0xcb9f('0x1f')]['bind'](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0xcb9f('0x2c'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x2d'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));ami['on'](_0xcb9f('0x2e'),this[_0xcb9f('0x1f')][_0xcb9f('0x20')](this));}Trigger['prototype'][_0xcb9f('0x2f')]=function(_0x38f7c6,_0x1dd27f,_0x3c0c7b){logger[_0xcb9f('0x30')](_0x38f7c6,_0x1dd27f,JSON[_0xcb9f('0x31')](_0x3c0c7b));io['to'](_0x38f7c6)[_0xcb9f('0x2f')](_0x1dd27f,_0x3c0c7b);};Trigger[_0xcb9f('0x32')][_0xcb9f('0x1f')]=function(_0x1858c2){var _0x193ce1=_['clone'](_0x1858c2);if(typeof _0x193ce1[_0xcb9f('0x33')]===_0xcb9f('0x34')){_0x193ce1['motionChannel']=_0xcb9f('0x35');}this[_0xcb9f('0x36')](_0x193ce1);};Trigger[_0xcb9f('0x32')][_0xcb9f('0x28')]=function(_0x56baaa){if(this[_0xcb9f('0xf')][_0x56baaa[_0xcb9f('0x37')]]){this[_0xcb9f('0x1f')](_0x56baaa);}};Trigger[_0xcb9f('0x32')][_0xcb9f('0x36')]=function(_0x109e39){var _0x22998c;for(var _0x44ae45 in this[_0xcb9f('0xe')]){if(this[_0xcb9f('0xe')][_0xcb9f('0x38')](_0x44ae45)){if(this[_0xcb9f('0xe')][_0x44ae45][_0xcb9f('0x39')]){_0x22998c=this['checkTrigger'](this['triggers'][_0x44ae45],_0x109e39);if(_0x22998c){_['merge'](_0x109e39,_0x109e39[_0xcb9f('0x3a')]);for(var _0x100d11=0x0,_0x550562,_0x4d169d,_0x11a389;_0x100d110x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0xb5fd95,_0x38c1aa){var _0x4cde64=function(_0x11b778){while(--_0x11b778){_0xb5fd95['push'](_0xb5fd95['shift']());}};_0x4cde64(++_0x38c1aa);}(_0x55ca,0x126));var _0xa55c=function(_0x17cb63,_0x4c0e90){_0x17cb63=_0x17cb63-0x0;var _0x4340bc=_0x55ca[_0x17cb63];return _0x4340bc;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 05230e4..ac19b06 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 _0x1862=['util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','4.0','headers','substring','lastIndexOf','%2b','telephone1','enduserId','contactid',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','phonecalls','assign','/systemusers(','callDirection','queue','Fields','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','stripTrailingSlash','remoteUri','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise'];(function(_0x4076fb,_0x74de32){var _0x2521a0=function(_0x31fada){while(--_0x31fada){_0x4076fb['push'](_0x4076fb['shift']());}};_0x2521a0(++_0x74de32);}(_0x1862,0x12c));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2186('0x0'));var BPromise=require(_0x2186('0x1'));var rp=require(_0x2186('0x2'));var util=require(_0x2186('0x3'));var intUtil=require(_0x2186('0x4'));var md5=require(_0x2186('0x5'));var Redis=require(_0x2186('0x6'));var logger=require('../../../../config/logger')(_0x2186('0x7'));var config=require(_0x2186('0x8'));config[_0x2186('0x9')]=_[_0x2186('0xa')](config[_0x2186('0x9')],{'host':_0x2186('0xb'),'port':0x18eb});var io=require(_0x2186('0xc'))(new Redis(config['redis']));function getAuthToken(_0x447a20,_0x348552,_0x380f45){var _0x276237={'method':_0x2186('0xd'),'uri':_0x348552,'form':{'client_id':_0x447a20['clientId'],'resource':_0x447a20['remoteUri'],'username':_0x447a20[_0x2186('0xe')],'password':_0x447a20[_0x2186('0xf')],'grant_type':_0x2186('0xf'),'client_secret':_0x447a20[_0x2186('0x10')]},'json':!![]};return rp(_0x276237)['then'](function(_0x49eea3){return _0x49eea3[_0x2186('0x11')];})[_0x2186('0x12')](function(_0x28430a){logger[_0x2186('0x13')]('['+[_0x380f45[_0x2186('0x14')]()]+_0x2186('0x15'));return _0x28430a['message'];});}function getUser(_0x3468a5,_0x1c6303,_0x521c93,_0x3f246f,_0x2abde7,_0x3fb01d){return new BPromise(function(_0x3bf1c8,_0x49ed07){return getAuthToken(_0x1c6303,_0x3f246f,_0x3fb01d)[_0x2186('0x16')](function(_0x398d3f){var _0x5e8986={'method':_0x2186('0x17'),'uri':_0x2abde7+_0x2186('0x18'),'headers':{'Authorization':_0x2186('0x19')+_0x398d3f,'OData-Version':'4.0'},'json':!![]};return rp(_0x5e8986);})[_0x2186('0x16')](function(_0x4f57fb){var _0x371487=_0x4f57fb[_0x2186('0x1a')];var _0x298db2=![];var _0x3a7da2=null;if(!_[_0x2186('0x1b')](_0x521c93)){if(intUtil['validateEmail'](_0x521c93[_0x2186('0x1c')])){_0x3468a5[_0x2186('0x1d')]=_0x521c93[_0x2186('0x1c')];for(_0x3a7da2=0x0;_0x3a7da2<_0x371487[_0x2186('0x1e')];_0x3a7da2++){if(_0x371487[_0x3a7da2][_0x2186('0x1f')]===_0x521c93[_0x2186('0x1c')]&&!_0x371487[_0x3a7da2][_0x2186('0x20')]){_0x298db2=!![];logger[_0x2186('0x21')]('['+[_0x3fb01d[_0x2186('0x14')]()]+_0x2186('0x22')+_0x371487[_0x3a7da2][_0x2186('0x23')]+'!');_0x3468a5[_0x2186('0x24')]=_0x371487[_0x3a7da2]['systemuserid'];}}}}if(!_0x298db2){logger[_0x2186('0x21')]('['+[_0x3fb01d[_0x2186('0x14')]()]+_0x2186('0x25'));_0x3468a5[_0x2186('0x1d')]=_0x1c6303[_0x2186('0xe')];for(_0x3a7da2=0x0;_0x3a7da2<_0x371487[_0x2186('0x1e')];_0x3a7da2++){if(_0x371487[_0x3a7da2][_0x2186('0x1f')]===_0x1c6303[_0x2186('0xe')]){_0x3468a5[_0x2186('0x24')]=_0x371487[_0x3a7da2][_0x2186('0x23')];}}}_0x3bf1c8(_0x3468a5);})[_0x2186('0x12')](function(_0x510975){_0x49ed07(_0x510975[_0x2186('0x26')]);});});}function createEndUser(_0x269a70,_0x41014a,_0x2ebfe7,_0x17f072,_0xd23887,_0x33ca59){return new BPromise(function(_0x58945a,_0x50fd63){return getAuthToken(_0x41014a,_0x2ebfe7,_0x33ca59)['then'](function(_0x33bfa3){var _0x52dc89=_0x33ca59[_0x2186('0x27')]()===_0x2186('0x28')?_0xd23887[_0x2186('0x29')]:_0xd23887[_0x2186('0x2a')];var _0x2dbbec={'method':_0x2186('0xd'),'uri':_0x17f072+_0x2186('0x2b'),'body':{'telephone1':_0x52dc89,'fullname':_0x52dc89,'firstname':_0x52dc89,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x269a70[_0x2186('0x24')]+')'},'headers':{'Authorization':_0x2186('0x19')+_0x33bfa3,'OData-Version':_0x2186('0x2c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2dbbec);})[_0x2186('0x16')](function(_0x48a7b6){var _0x164bb3=_0x48a7b6[_0x2186('0x2d')]['odata-entityid'];var _0x5195f5=_0x164bb3[_0x2186('0x2e')](_0x164bb3[_0x2186('0x2f')]('(')+0x1,_0x164bb3[_0x2186('0x2f')](')'));_0x269a70['enduserId']=_0x5195f5;_0x58945a(_0x269a70);})[_0x2186('0x12')](function(_0x485f63){_0x50fd63(_0x485f63[_0x2186('0x26')]);});});}function getEndUser(_0x29dd5a,_0x24c28d,_0x582816,_0x98e4a7,_0x1b401b,_0x2d8368){return new BPromise(function(_0x3b59ef,_0x4e00fd){var _0x54e688=_0x2d8368[_0x2186('0x27')]()===_0x2186('0x28')?_0x1b401b[_0x2186('0x29')]:_0x1b401b[_0x2186('0x2a')];return getAuthToken(_0x24c28d,_0x582816,_0x2d8368)['then'](function(_0x1e926e){var _0x452d15={'method':_0x2186('0x17'),'uri':_0x98e4a7+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x54e688['replace']('+',_0x2186('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1e926e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x452d15);})[_0x2186('0x16')](function(_0x24e31c){var _0x42d33a=null;if(_0x24e31c){var _0x225f06=_0x24e31c[_0x2186('0x1a')];var _0x174b52=![];for(_0x42d33a=0x0;_0x42d33a<_0x225f06[_0x2186('0x1e')];_0x42d33a++){if(_0x225f06[_0x42d33a][_0x2186('0x31')]===_0x54e688){_0x174b52=!![];_0x29dd5a[_0x2186('0x32')]=_0x225f06[_0x42d33a][_0x2186('0x33')];}}if(_0x174b52){_0x3b59ef(_0x29dd5a);}else{return createEndUser(_0x29dd5a,_0x24c28d,_0x582816,_0x98e4a7,_0x1b401b,_0x2d8368)[_0x2186('0x16')](function(_0x5edec7){logger[_0x2186('0x21')]('['+[_0x2d8368[_0x2186('0x14')]()]+_0x2186('0x34'),_0x5edec7['enduserId']);_0x3b59ef(_0x5edec7);});}}else{return createEndUser(_0x29dd5a,_0x24c28d,_0x582816,_0x98e4a7,_0x1b401b,_0x2d8368)[_0x2186('0x16')](function(_0x5bb18c){logger[_0x2186('0x21')]('['+[_0x2d8368['toUpperCase']()]+']\x20Enduser\x20Created!',_0x5bb18c[_0x2186('0x32')]);_0x3b59ef(_0x5bb18c);});}});});}function getCustomFields(_0x3d4550,_0x3d73ce,_0x229ce4){var _0x2fdac5={};if(_0x3d4550[_0x2186('0x1e')]>0x0){_['forEach'](_0x3d4550,function(_0x4afd9b){if(_[_0x2186('0x35')](['string',_0x2186('0x36')],_0x4afd9b[_0x2186('0x37')])&&_0x4afd9b[_0x2186('0x38')]&&!_0x4afd9b[_0x2186('0x39')]){var _0x3f9355=_0x4afd9b[_0x2186('0x3a')]['toLowerCase']();var _0x3fa55b=_0x3f9355[_0x2186('0x2e')](0x0,_0x3f9355[_0x2186('0x3b')]('_'));var _0x129236=_0x3f9355[_0x2186('0x2e')](_0x3f9355[_0x2186('0x3b')]('_')+0x1);if(_0x3fa55b===_0x229ce4){_0x2fdac5[_0x129236]=_0x4afd9b[_0x2186('0x3c')];}}});}return _0x2fdac5;}function getTicket(_0x152de7,_0x19053e,_0x20aef4,_0x3dd8ea,_0x2d7b30,_0x2d2f6d,_0x4dbd4f){return new BPromise(function(_0x590959,_0xd1d638){var _0x22b3b0;return getAuthToken(_0x19053e,_0x20aef4,_0x4dbd4f)[_0x2186('0x16')](function(_0x55052d){if(_0x2d2f6d[_0x2186('0x3d')]===_0x2186('0x3e')){_0x22b3b0={'method':_0x2186('0xd'),'uri':_0x3dd8ea+_0x2186('0x3f'),'body':Object['assign']({},{'title':intUtil[_0x2186('0x40')](_0x2d2f6d[_0x2186('0x41')],_0x2d7b30,'\x20'),'description':intUtil[_0x2186('0x40')](_0x2d2f6d[_0x2186('0x42')],_0x2d7b30,'\x0a'),'customerid_contact@odata.bind':_0x2186('0x43')+_0x152de7[_0x2186('0x32')]+')','ownerid@odata.bind':'/systemusers('+_0x152de7[_0x2186('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2d2f6d['Fields'],_0x2d7b30,_0x2d2f6d['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x55052d,'OData-Version':_0x2186('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2d2f6d[_0x2186('0x3d')]==='phonecall'){_0x22b3b0={'method':_0x2186('0xd'),'uri':_0x3dd8ea+_0x2186('0x44'),'body':Object[_0x2186('0x45')]({},{'subject':intUtil[_0x2186('0x40')](_0x2d2f6d['Subjects'],_0x2d7b30,'\x20'),'phonenumber':String(_0x2d7b30['calleridnum']),'description':intUtil['getString'](_0x2d2f6d[_0x2186('0x42')],_0x2d7b30,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x152de7[_0x2186('0x32')]+')','ownerid@odata.bind':_0x2186('0x46')+_0x152de7[_0x2186('0x24')]+')','directioncode':_0x152de7[_0x2186('0x47')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2186('0x46')+_0x152de7[_0x2186('0x24')]+')','participationtypemask':_0x152de7[_0x2186('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x2186('0x43')+_0x152de7[_0x2186('0x32')]+')','participationtypemask':_0x152de7[_0x2186('0x47')]===_0x2186('0x48')?0x1:0x2}]},getCustomFields(_0x2d2f6d[_0x2186('0x49')],_0x2d7b30,_0x2d2f6d[_0x2186('0x3d')])),'headers':{'Authorization':_0x2186('0x19')+_0x55052d,'OData-Version':_0x2186('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x22b3b0);})[_0x2186('0x16')](function(_0xbb3903){var _0xa920da=_0xbb3903[_0x2186('0x2d')][_0x2186('0x4a')];var _0x5e4ae1=_0xa920da[_0x2186('0x2e')](_0xa920da[_0x2186('0x2f')]('(')+0x1,_0xa920da[_0x2186('0x2f')](')'));_0x152de7[_0x2186('0x4b')]=_0x5e4ae1;_0x590959(_0x152de7);})[_0x2186('0x12')](function(_0x50d1e0){_0xd1d638(_0x50d1e0[_0x2186('0x26')]);});});}function emit(_0x5265e5,_0x41b292,_0xb67ee0,_0x406a1b){var _0x27c185={'uri':util['format'](_0x2186('0x4c'),_0x5265e5,_0xb67ee0,_0x406a1b)};io['to'](util[_0x2186('0x4d')]('user:%s',_0x41b292))[_0x2186('0x4e')]('trigger:browser:url',_0x27c185);}exports['cs']=function(_0x19ea6f,_0x300db5,_0x33862a,_0x4f4f9c,_0x3aaa5b,_0x304ad5,_0x3f7e2c,_0x358019){var _0x4b0e99={};_0x304ad5['remoteUri']=intUtil[_0x2186('0x4f')](_0x304ad5[_0x2186('0x50')]);_0x304ad5[_0x2186('0x51')]=intUtil[_0x2186('0x4f')](_0x304ad5[_0x2186('0x51')]);_0x4b0e99[_0x2186('0x47')]=_0x358019===_0x2186('0x48')||_0x358019==='unmanaged'?'queue':_0x2186('0x28');var _0x398ea2=util['format'](_0x2186('0x52'),_0x304ad5['remoteUri']);var _0x38e791=util[_0x2186('0x4d')](_0x2186('0x53'),_0x304ad5[_0x2186('0x54')]);var _0x532846=util[_0x2186('0x4d')](_0x2186('0x55'),_0x304ad5[_0x2186('0x51')],_0x300db5['uniqueid'],md5(_0x300db5['uniqueid']));if(_0x3aaa5b&&_0x3aaa5b[_0x2186('0x56')]){logger[_0x2186('0x21')](_0x2186('0x57'),_0x2186('0x58'));_0x300db5[_0x2186('0x59')]=_0x532846;}else if(_0x3f7e2c&&_0x3f7e2c[_0x2186('0x5a')]&&_0x3f7e2c[_0x2186('0x5a')]!==_0x2186('0x5b')){logger[_0x2186('0x21')](_0x2186('0x5c'),'Recording\x20is\x20enabled!');_0x300db5[_0x2186('0x59')]=_0x532846;}else{_0x300db5['recordingURL']='';}return getUser(_0x4b0e99,_0x304ad5,_0x4f4f9c,_0x38e791,_0x398ea2,_0x358019)[_0x2186('0x16')](function(_0x9eb7f8){logger[_0x2186('0x21')]('['+_0x358019[_0x2186('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x9eb7f8[_0x2186('0x24')]);logger[_0x2186('0x21')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x5d'),_0x9eb7f8[_0x2186('0x1d')]);return getEndUser(_0x9eb7f8,_0x304ad5,_0x38e791,_0x398ea2,_0x300db5,_0x358019);})[_0x2186('0x16')](function(_0x655456){logger[_0x2186('0x21')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x5e'),_0x655456[_0x2186('0x32')]);logger[_0x2186('0x21')]('['+_0x358019['toUpperCase']()+_0x2186('0x5f'),_0x300db5[_0x2186('0x2a')]);return getTicket(_0x655456,_0x304ad5,_0x38e791,_0x398ea2,_0x300db5,_0x33862a,_0x358019);})[_0x2186('0x16')](function(_0x7dfc95){logger[_0x2186('0x21')](util[_0x2186('0x4d')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x60'),_0x33862a[_0x2186('0x3d')],_0x7dfc95[_0x2186('0x4b')]));logger[_0x2186('0x21')](util[_0x2186('0x4d')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x61'),_0x358019));if(_0x358019!==_0x2186('0x62')){logger['info']('['+_0x358019[_0x2186('0x14')]()+']',_0x2186('0x63'));emit(_0x304ad5['remoteUri'],_0x4f4f9c['name'],_0x33862a['ticketType'],_0x7dfc95[_0x2186('0x4b')]);}})[_0x2186('0x12')](function(_0x131140){logger[_0x2186('0x13')]('['+_0x358019[_0x2186('0x14')]()+_0x2186('0x64'),util['inspect'](_0x131140,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x95de=['userEmail','userId','then','outbound','destcalleridnum','calleridnum','contacts','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','contactid',']\x20Enduser\x20Created!','forEach','includes','picklist','nameField','idField','indexOf','ticketType','incidents','getString','phonecall','assign','Subjects','Descriptions','/contacts(','/systemusers(','callDirection','queue','ticketId','catch','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','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...','name',']\x20Error\x20running\x20Dynamics365\x20integration','bluebird','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','POST','clientId','remoteUri','username','password','clientSecret','access_token','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x95de,0x163));var _0xe95d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x95de[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var BPromise=require(_0xe95d('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0xe95d('0x1'));var md5=require(_0xe95d('0x2'));var Redis=require(_0xe95d('0x3'));var logger=require(_0xe95d('0x4'))(_0xe95d('0x5'));var config=require(_0xe95d('0x6'));config[_0xe95d('0x7')]=_[_0xe95d('0x8')](config[_0xe95d('0x7')],{'host':_0xe95d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe95d('0x7')]));function getAuthToken(_0x39cd3c,_0x2950c6,_0x540a7a){var _0x20d443={'method':_0xe95d('0xa'),'uri':_0x2950c6,'form':{'client_id':_0x39cd3c[_0xe95d('0xb')],'resource':_0x39cd3c[_0xe95d('0xc')],'username':_0x39cd3c[_0xe95d('0xd')],'password':_0x39cd3c[_0xe95d('0xe')],'grant_type':'password','client_secret':_0x39cd3c[_0xe95d('0xf')]},'json':!![]};return rp(_0x20d443)['then'](function(_0x4146b5){return _0x4146b5[_0xe95d('0x10')];})['catch'](function(_0x20ef28){logger[_0xe95d('0x11')]('['+[_0x540a7a['toUpperCase']()]+_0xe95d('0x12'));return _0x20ef28[_0xe95d('0x13')];});}function getUser(_0x4996c7,_0x5034ed,_0x4a0ccd,_0x103b71,_0x111ac5,_0x517410){return new BPromise(function(_0x1813de,_0x627643){return getAuthToken(_0x5034ed,_0x103b71,_0x517410)['then'](function(_0x2e937f){var _0x1f8054={'method':'GET','uri':_0x111ac5+_0xe95d('0x14'),'headers':{'Authorization':_0xe95d('0x15')+_0x2e937f,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f8054);})['then'](function(_0x5a8f49){var _0x29530e=_0x5a8f49[_0xe95d('0x16')];var _0x19e5b2=![];var _0x5aa3ed=null;if(!_['isNil'](_0x4a0ccd)){if(intUtil[_0xe95d('0x17')](_0x4a0ccd[_0xe95d('0x18')])){_0x4996c7['userEmail']=_0x4a0ccd['email'];for(_0x5aa3ed=0x0;_0x5aa3ed<_0x29530e[_0xe95d('0x19')];_0x5aa3ed++){if(_0x29530e[_0x5aa3ed][_0xe95d('0x1a')]===_0x4a0ccd[_0xe95d('0x18')]&&!_0x29530e[_0x5aa3ed][_0xe95d('0x1b')]){_0x19e5b2=!![];logger[_0xe95d('0x1c')]('['+[_0x517410[_0xe95d('0x1d')]()]+_0xe95d('0x1e')+_0x29530e[_0x5aa3ed][_0xe95d('0x1f')]+'!');_0x4996c7['userId']=_0x29530e[_0x5aa3ed]['systemuserid'];}}}}if(!_0x19e5b2){logger[_0xe95d('0x1c')]('['+[_0x517410[_0xe95d('0x1d')]()]+_0xe95d('0x20'));_0x4996c7[_0xe95d('0x21')]=_0x5034ed[_0xe95d('0xd')];for(_0x5aa3ed=0x0;_0x5aa3ed<_0x29530e['length'];_0x5aa3ed++){if(_0x29530e[_0x5aa3ed][_0xe95d('0x1a')]===_0x5034ed[_0xe95d('0xd')]){_0x4996c7[_0xe95d('0x22')]=_0x29530e[_0x5aa3ed]['systemuserid'];}}}_0x1813de(_0x4996c7);})['catch'](function(_0x168bae){_0x627643(_0x168bae[_0xe95d('0x13')]);});});}function createEndUser(_0x523dc5,_0x105017,_0x914cc9,_0x30089c,_0x47f13a,_0x465024){return new BPromise(function(_0x26b920,_0x5c05cc){return getAuthToken(_0x105017,_0x914cc9,_0x465024)[_0xe95d('0x23')](function(_0x16cb77){var _0x1664ad=_0x465024['toLowerCase']()===_0xe95d('0x24')?_0x47f13a[_0xe95d('0x25')]:_0x47f13a[_0xe95d('0x26')];var _0x28071d={'method':_0xe95d('0xa'),'uri':_0x30089c+_0xe95d('0x27'),'body':{'telephone1':_0x1664ad,'fullname':_0x1664ad,'firstname':_0x1664ad,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x523dc5['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x16cb77,'OData-Version':_0xe95d('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x28071d);})[_0xe95d('0x23')](function(_0x44d7cb){var _0x178dae=_0x44d7cb[_0xe95d('0x29')][_0xe95d('0x2a')];var _0x312120=_0x178dae[_0xe95d('0x2b')](_0x178dae[_0xe95d('0x2c')]('(')+0x1,_0x178dae['lastIndexOf'](')'));_0x523dc5[_0xe95d('0x2d')]=_0x312120;_0x26b920(_0x523dc5);})['catch'](function(_0x365b26){_0x5c05cc(_0x365b26[_0xe95d('0x13')]);});});}function getEndUser(_0x1ac750,_0x2cf842,_0x305aed,_0x4182c8,_0x4ec1e8,_0x2ac2d0){return new BPromise(function(_0x3b0ab0,_0x4bb8aa){var _0x240fb0=_0x2ac2d0[_0xe95d('0x2e')]()===_0xe95d('0x24')?_0x4ec1e8['destcalleridnum']:_0x4ec1e8[_0xe95d('0x26')];return getAuthToken(_0x2cf842,_0x305aed,_0x2ac2d0)['then'](function(_0x26cb83){var _0x39fa7a={'method':'GET','uri':_0x4182c8+_0xe95d('0x2f')+_0x240fb0[_0xe95d('0x30')]('+','%2b')+'\x27','headers':{'Authorization':_0xe95d('0x15')+_0x26cb83,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x39fa7a);})[_0xe95d('0x23')](function(_0x41b06d){var _0x50d5a9=null;if(_0x41b06d){var _0x4a33bf=_0x41b06d[_0xe95d('0x16')];var _0x367cec=![];for(_0x50d5a9=0x0;_0x50d5a9<_0x4a33bf[_0xe95d('0x19')];_0x50d5a9++){if(_0x4a33bf[_0x50d5a9]['telephone1']===_0x240fb0){_0x367cec=!![];_0x1ac750['enduserId']=_0x4a33bf[_0x50d5a9][_0xe95d('0x31')];}}if(_0x367cec){_0x3b0ab0(_0x1ac750);}else{return createEndUser(_0x1ac750,_0x2cf842,_0x305aed,_0x4182c8,_0x4ec1e8,_0x2ac2d0)[_0xe95d('0x23')](function(_0x5e3c4a){logger[_0xe95d('0x1c')]('['+[_0x2ac2d0[_0xe95d('0x1d')]()]+']\x20Enduser\x20created!',_0x5e3c4a[_0xe95d('0x2d')]);_0x3b0ab0(_0x5e3c4a);});}}else{return createEndUser(_0x1ac750,_0x2cf842,_0x305aed,_0x4182c8,_0x4ec1e8,_0x2ac2d0)[_0xe95d('0x23')](function(_0xccba5f){logger[_0xe95d('0x1c')]('['+[_0x2ac2d0['toUpperCase']()]+_0xe95d('0x32'),_0xccba5f[_0xe95d('0x2d')]);_0x3b0ab0(_0xccba5f);});}});});}function getCustomFields(_0x134d17,_0x3a725f,_0x57fa5){var _0x23002e={};if(_0x134d17[_0xe95d('0x19')]>0x0){_[_0xe95d('0x33')](_0x134d17,function(_0x4472cb){if(_[_0xe95d('0x34')](['string',_0xe95d('0x35')],_0x4472cb['type'])&&_0x4472cb[_0xe95d('0x36')]&&!_0x4472cb['customField']){var _0x44780c=_0x4472cb[_0xe95d('0x37')][_0xe95d('0x2e')]();var _0x3d69c6=_0x44780c[_0xe95d('0x2b')](0x0,_0x44780c[_0xe95d('0x38')]('_'));var _0x5aaf55=_0x44780c[_0xe95d('0x2b')](_0x44780c['indexOf']('_')+0x1);if(_0x3d69c6===_0x57fa5){_0x23002e[_0x5aaf55]=_0x4472cb['content'];}}});}return _0x23002e;}function getTicket(_0x34ac1e,_0x54ac27,_0x313018,_0x1beef5,_0x123e3f,_0x45bde7,_0x27c52e){return new BPromise(function(_0x470147,_0x4e5977){var _0x1211d7;return getAuthToken(_0x54ac27,_0x313018,_0x27c52e)[_0xe95d('0x23')](function(_0x395dca){if(_0x45bde7[_0xe95d('0x39')]==='incident'){_0x1211d7={'method':'POST','uri':_0x1beef5+_0xe95d('0x3a'),'body':Object['assign']({},{'title':intUtil[_0xe95d('0x3b')](_0x45bde7['Subjects'],_0x123e3f,'\x20'),'description':intUtil[_0xe95d('0x3b')](_0x45bde7['Descriptions'],_0x123e3f,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x34ac1e['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x34ac1e[_0xe95d('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x45bde7['Fields'],_0x123e3f,_0x45bde7[_0xe95d('0x39')])),'headers':{'Authorization':_0xe95d('0x15')+_0x395dca,'OData-Version':_0xe95d('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x45bde7[_0xe95d('0x39')]===_0xe95d('0x3c')){_0x1211d7={'method':_0xe95d('0xa'),'uri':_0x1beef5+'phonecalls','body':Object[_0xe95d('0x3d')]({},{'subject':intUtil[_0xe95d('0x3b')](_0x45bde7[_0xe95d('0x3e')],_0x123e3f,'\x20'),'phonenumber':String(_0x123e3f[_0xe95d('0x26')]),'description':intUtil[_0xe95d('0x3b')](_0x45bde7[_0xe95d('0x3f')],_0x123e3f,'\x0a'),'regardingobjectid_contact@odata.bind':_0xe95d('0x40')+_0x34ac1e[_0xe95d('0x2d')]+')','ownerid@odata.bind':_0xe95d('0x41')+_0x34ac1e['userId']+')','directioncode':_0x34ac1e[_0xe95d('0x42')]===_0xe95d('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xe95d('0x41')+_0x34ac1e[_0xe95d('0x22')]+')','participationtypemask':_0x34ac1e[_0xe95d('0x42')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xe95d('0x40')+_0x34ac1e[_0xe95d('0x2d')]+')','participationtypemask':_0x34ac1e[_0xe95d('0x42')]===_0xe95d('0x43')?0x1:0x2}]},getCustomFields(_0x45bde7['Fields'],_0x123e3f,_0x45bde7[_0xe95d('0x39')])),'headers':{'Authorization':_0xe95d('0x15')+_0x395dca,'OData-Version':_0xe95d('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1211d7);})['then'](function(_0x3ff801){var _0xd03254=_0x3ff801['headers']['odata-entityid'];var _0x6786f=_0xd03254['substring'](_0xd03254[_0xe95d('0x2c')]('(')+0x1,_0xd03254[_0xe95d('0x2c')](')'));_0x34ac1e[_0xe95d('0x44')]=_0x6786f;_0x470147(_0x34ac1e);})[_0xe95d('0x45')](function(_0x11ba83){_0x4e5977(_0x11ba83[_0xe95d('0x13')]);});});}function emit(_0x266d63,_0x1fe6d7,_0x52f827,_0x481265){var _0x4a5eb0={'uri':util['format'](_0xe95d('0x46'),_0x266d63,_0x52f827,_0x481265)};io['to'](util['format'](_0xe95d('0x47'),_0x1fe6d7))[_0xe95d('0x48')](_0xe95d('0x49'),_0x4a5eb0);}exports['cs']=function(_0x2139ee,_0x7419ad,_0x29cba2,_0x24ab2e,_0x13d17a,_0xb24db0,_0x4d021c,_0x1458ea){var _0x17848d={};_0xb24db0['remoteUri']=intUtil[_0xe95d('0x4a')](_0xb24db0[_0xe95d('0xc')]);_0xb24db0[_0xe95d('0x4b')]=intUtil[_0xe95d('0x4a')](_0xb24db0[_0xe95d('0x4b')]);_0x17848d[_0xe95d('0x42')]=_0x1458ea===_0xe95d('0x43')||_0x1458ea===_0xe95d('0x4c')?_0xe95d('0x43'):_0xe95d('0x24');var _0x39d406=util[_0xe95d('0x4d')](_0xe95d('0x4e'),_0xb24db0[_0xe95d('0xc')]);var _0x7cdd85=util[_0xe95d('0x4d')](_0xe95d('0x4f'),_0xb24db0[_0xe95d('0x50')]);var _0x51a68a=util[_0xe95d('0x4d')](_0xe95d('0x51'),_0xb24db0[_0xe95d('0x4b')],_0x7419ad['uniqueid'],md5(_0x7419ad['uniqueid']));if(_0x13d17a&&_0x13d17a[_0xe95d('0x52')]){logger[_0xe95d('0x1c')]('[QUEUE]',_0xe95d('0x53'));_0x7419ad[_0xe95d('0x54')]=_0x51a68a;}else if(_0x4d021c&&_0x4d021c[_0xe95d('0x55')]&&_0x4d021c['recordingFormat']!==_0xe95d('0x56')){logger[_0xe95d('0x1c')](_0xe95d('0x57'),'Recording\x20is\x20enabled!');_0x7419ad[_0xe95d('0x54')]=_0x51a68a;}else{_0x7419ad[_0xe95d('0x54')]='';}return getUser(_0x17848d,_0xb24db0,_0x24ab2e,_0x7cdd85,_0x39d406,_0x1458ea)[_0xe95d('0x23')](function(_0x389a1b){logger['info']('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x58'),_0x389a1b[_0xe95d('0x22')]);logger[_0xe95d('0x1c')]('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x59'),_0x389a1b['userEmail']);return getEndUser(_0x389a1b,_0xb24db0,_0x7cdd85,_0x39d406,_0x7419ad,_0x1458ea);})[_0xe95d('0x23')](function(_0x10ccef){logger[_0xe95d('0x1c')]('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x5a'),_0x10ccef['enduserId']);logger[_0xe95d('0x1c')]('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x5b'),_0x7419ad[_0xe95d('0x26')]);return getTicket(_0x10ccef,_0xb24db0,_0x7cdd85,_0x39d406,_0x7419ad,_0x29cba2,_0x1458ea);})[_0xe95d('0x23')](function(_0x43cf49){logger[_0xe95d('0x1c')](util[_0xe95d('0x4d')]('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x5c'),_0x29cba2[_0xe95d('0x39')],_0x43cf49[_0xe95d('0x44')]));logger[_0xe95d('0x1c')](util['format']('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x5d'),_0x1458ea));if(_0x1458ea!==_0xe95d('0x4c')){logger[_0xe95d('0x1c')]('['+_0x1458ea[_0xe95d('0x1d')]()+']',_0xe95d('0x5e'));emit(_0xb24db0['remoteUri'],_0x24ab2e[_0xe95d('0x5f')],_0x29cba2['ticketType'],_0x43cf49[_0xe95d('0x44')]);}})[_0xe95d('0x45')](function(_0x3f7970){logger[_0xe95d('0x11')]('['+_0x1458ea[_0xe95d('0x1d')]()+_0xe95d('0x60'),util['inspect'](_0x3f7970,{'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 bf2fc20..d19bfc3 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 _0xb014=['debug','[HTTP]','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb014,0x158));var _0x4b01=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0xb014[_0x23ca4d];return _0x435432;};'use strict';var _=require(_0x4b01('0x0'));var rp=require(_0x4b01('0x1'));var md5=require(_0x4b01('0x2'));var util=require(_0x4b01('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4b01('0x4'));var config=require(_0x4b01('0x5'));var logger=require(_0x4b01('0x6'))(_0x4b01('0x7'));config['redis']=_[_0x4b01('0x8')](config[_0x4b01('0x9')],{'host':_0x4b01('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x4b01('0xb'),'Accept':'application/json'};function emit(_0x319be1,_0x25d5a7,_0x2d59e1){io['to'](_0x319be1)[_0x4b01('0xc')](_0x25d5a7,_0x2d59e1);}function getTicket(_0x988726,_0x56bff6,_0x231184,_0x52793c,_0x219d71){logger[_0x4b01('0xd')](_0x4b01('0xe'));var _0xfdadef=_[_0x4b01('0xf')]({'responder_id':_0x56bff6['id'],'requester_id':_0x231184['id'],'name':util['format']('Caller\x20-\x20%s',_0x219d71[_0x4b01('0x10')]),'phone':_0x219d71['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4b01('0x11')](_0x52793c[_0x4b01('0x12')],_0x219d71,'\x20'),'description':intUtil[_0x4b01('0x11')](_0x52793c[_0x4b01('0x13')],_0x219d71,_0x4b01('0x14')),'tags':getTags(_0x52793c['Tags'],_0x4b01('0x15'))},getCustomFields(_0x52793c[_0x4b01('0x16')],_0x219d71));_0xfdadef[_0x4b01('0x17')]=_[_0x4b01('0x18')](_[_0x4b01('0x19')](_0xfdadef['custom_fields'],'id'),_0x4b01('0x1a'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x1c'),_0x988726[_0x4b01('0x1d')]),'method':_0x4b01('0x1e'),'body':_0xfdadef})[_0x4b01('0x1f')](function(_0x35a014){logger[_0x4b01('0xd')]('Ticket\x20created!');return _0x35a014;});}function getUser(_0x2a7c3f,_0x4c8edf){if(intUtil[_0x4b01('0x20')](_0x4c8edf)){return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x21'),_0x2a7c3f[_0x4b01('0x1d')]),'qs':{'email':_0x4c8edf}})[_0x4b01('0x1f')](function(_0x284152){if(_0x284152[_0x4b01('0x22')]){logger[_0x4b01('0xd')](_0x4b01('0x23'));return _[_0x4b01('0x24')](_0x284152,function(_0x3f3a0b){return _0x3f3a0b[_0x4b01('0x25')][_0x4b01('0x26')]===_0x4c8edf;});}else{logger[_0x4b01('0xd')](_0x4b01('0x27'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x28'),_0x2a7c3f[_0x4b01('0x1d')])})[_0x4b01('0x1f')](function(_0x249302){logger['info'](_0x4b01('0x29'));return _0x249302;});}});}else{logger[_0x4b01('0xd')](_0x4b01('0x2a'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x28'),_0x2a7c3f[_0x4b01('0x1d')])})[_0x4b01('0x1f')](function(_0x226e93){logger[_0x4b01('0xd')](_0x4b01('0x29'));return _0x226e93;});}}function getEndUser(_0x3d5e2d,_0x9a672a,_0x49b7d3){logger['info'](_0x4b01('0x2b'),_0x49b7d3);return request({'uri':util[_0x4b01('0x1b')]('%s/api/v2/contacts',_0x3d5e2d[_0x4b01('0x1d')]),'qs':{'phone':_0x49b7d3}})[_0x4b01('0x1f')](function(_0x405753){if(_0x405753['length']){logger[_0x4b01('0xd')](_0x4b01('0x2c'));return _[_0x4b01('0x24')](_0x405753,{'phone':_0x49b7d3});}else{logger[_0x4b01('0xd')](_0x4b01('0x2d'));return request({'uri':util[_0x4b01('0x1b')](_0x4b01('0x2e'),_0x3d5e2d[_0x4b01('0x1d')]),'method':'POST','body':{'name':_0x9a672a,'phone':_0x49b7d3}})[_0x4b01('0x1f')](function(_0x3e27ee){logger[_0x4b01('0xd')](_0x4b01('0x2f'));return _0x3e27ee;});}});}function getAuth(_0x56c8ca){return util[_0x4b01('0x1b')](_0x4b01('0x30'),new Buffer(_0x56c8ca[_0x4b01('0x31')]+':X')[_0x4b01('0x32')](_0x4b01('0x33')));}function request(_0x17122f){logger[_0x4b01('0x34')](_0x4b01('0x35'),JSON['stringify'](_0x17122f));return rp(_[_0x4b01('0x8')](_0x17122f,{'method':_0x4b01('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x2fe398,_0x3c3856){var _0x2b663f=[];if(_0x2fe398&&_0x2fe398['length']>0x0){_0x2b663f=_[_0x4b01('0x37')](_0x2fe398,_0x3c3856);}return _0x2b663f;}function getCustomFields(_0x377aa4,_0xfb00e8){var _0x1840fc=[];var _0xb35555={'custom_fields':[]};if(_0x377aa4[_0x4b01('0x22')]>0x0){_[_0x4b01('0x38')](_0x377aa4,function(_0x56c896){if(_[_0x4b01('0x39')](['string',_0x4b01('0x3a')],_0x56c896[_0x4b01('0x3b')])&&_0x56c896[_0x4b01('0x3c')]&&!_0x56c896[_0x4b01('0x3d')]){_0xb35555[_0x56c896['nameField'][_0x4b01('0x3e')]()]=_0x56c896[_0x4b01('0x3f')]['toString']();}else if(_[_0x4b01('0x39')](['string',_0x4b01('0x3a')],_0x56c896[_0x4b01('0x3b')])&&_0x56c896[_0x4b01('0x40')]&&_0x56c896[_0x4b01('0x3d')]){_0xb35555['custom_fields']['push']({'id':_0x56c896['idField'],'value':_0x56c896[_0x4b01('0x3f')]['toString']()});}else if(_0x56c896['type']===_0x4b01('0x41')&&_0x56c896[_0x4b01('0x42')]&&_0x56c896[_0x4b01('0x40')]&&_0x56c896[_0x4b01('0x3d')]){_0xfb00e8[_0x56c896[_0x4b01('0x42')]]&&_0xb35555[_0x4b01('0x17')][_0x4b01('0x43')]({'id':_0x56c896['idField'],'value':_0xfb00e8[_0x56c896[_0x4b01('0x42')]]['toString']()});}else if(_0x56c896['type']===_0x4b01('0x44')&&_0x56c896[_0x4b01('0x45')]&&_0x56c896[_0x4b01('0x45')][_0x4b01('0x15')]&&_0x56c896[_0x4b01('0x40')]&&_0x56c896[_0x4b01('0x3d')]){_0xfb00e8[_0x56c896[_0x4b01('0x45')][_0x4b01('0x15')][_0x4b01('0x3e')]()]&&_0xb35555[_0x4b01('0x17')][_0x4b01('0x43')]({'id':_0x56c896[_0x4b01('0x40')],'value':_0xfb00e8[_0x56c896['Variable'][_0x4b01('0x15')][_0x4b01('0x3e')]()][_0x4b01('0x32')]()});}});}return _0xb35555;}exports['queue']=function(_0x241a81,_0x498be3,_0x1cfd0e,_0x3f7c49,_0x367d1f,_0x409c6f){var _0x364c32,_0x24e46d;_0x409c6f[_0x4b01('0x1d')]=intUtil['stripTrailingSlash'](_0x409c6f['remoteUri']);_0x409c6f[_0x4b01('0x46')]=intUtil[_0x4b01('0x47')](_0x409c6f['serverUrl']);if(_0x367d1f&&_0x367d1f[_0x4b01('0x48')]){logger['info']('[QUEUE]',_0x4b01('0x49'));_0x498be3[_0x4b01('0x4a')]=util[_0x4b01('0x1b')](_0x4b01('0x4b'),_0x409c6f[_0x4b01('0x46')],_0x498be3[_0x4b01('0x4c')],md5(_0x498be3[_0x4b01('0x4c')]));}else{_0x498be3[_0x4b01('0x4a')]='';}headers[_0x4b01('0x4d')]=getAuth(_0x409c6f);return getUser(_0x409c6f,_0x3f7c49[_0x4b01('0x26')])[_0x4b01('0x1f')](function(_0x337c45){_0x364c32=_0x337c45;logger[_0x4b01('0xd')](_0x4b01('0x4e'),_0x364c32['id']);return getEndUser(_0x409c6f,_0x498be3[_0x4b01('0x10')],_0x498be3[_0x4b01('0x4f')]);})[_0x4b01('0x1f')](function(_0x3d52af){_0x24e46d=_0x3d52af;logger[_0x4b01('0xd')]('The\x20Enduser\x20ID\x20is:',_0x24e46d['id']);return getTicket(_0x409c6f,_0x364c32,_0x24e46d,_0x1cfd0e,_0x498be3);})['then'](function(_0x2ea55b){if(_0x2ea55b&&_0x2ea55b['id']){logger[_0x4b01('0xd')](_0x4b01('0x50'));logger[_0x4b01('0xd')](_0x4b01('0x51'),_0x2ea55b['id']);logger[_0x4b01('0xd')](_0x4b01('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4b01('0x1b')](_0x4b01('0x53'),_0x3f7c49[_0x4b01('0x15')]),_0x4b01('0x54'),{'uri':util[_0x4b01('0x1b')](_0x4b01('0x55'),_0x409c6f[_0x4b01('0x1d')],_0x2ea55b['id'])});}})['catch'](function(_0x466801){logger[_0x4b01('0x56')](_0x4b01('0x52'),JSON[_0x4b01('0x57')](_0x466801));});};exports[_0x4b01('0x58')]=function(_0x3b99fe,_0x2b8cf3,_0x51ebf1,_0x40aca5,_0x162f63,_0x4c8015,_0x2fc8da){var _0x5f667b,_0x42cd5a;_0x4c8015[_0x4b01('0x1d')]=intUtil[_0x4b01('0x47')](_0x4c8015[_0x4b01('0x1d')]);_0x4c8015[_0x4b01('0x46')]=intUtil[_0x4b01('0x47')](_0x4c8015['serverUrl']);if(_0x2fc8da&&_0x2fc8da['recordingFormat']&&_0x2fc8da[_0x4b01('0x59')]!=='none'){logger[_0x4b01('0xd')](_0x4b01('0x5a'),_0x4b01('0x49'));_0x2b8cf3['recordingURL']=util[_0x4b01('0x1b')](_0x4b01('0x4b'),_0x4c8015[_0x4b01('0x46')],_0x2b8cf3[_0x4b01('0x4c')],md5(_0x2b8cf3[_0x4b01('0x4c')]));}headers['Authorization']=getAuth(_0x4c8015);return getUser(_0x4c8015,_0x40aca5[_0x4b01('0x26')])['then'](function(_0x419741){_0x5f667b=_0x419741;logger[_0x4b01('0xd')]('The\x20User\x20ID\x20is:',_0x5f667b['id']);return getEndUser(_0x4c8015,_0x2b8cf3[_0x4b01('0x5b')],_0x2b8cf3[_0x4b01('0x5c')]);})[_0x4b01('0x1f')](function(_0x4f6cc9){_0x42cd5a=_0x4f6cc9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x42cd5a['id']);return getTicket(_0x4c8015,_0x5f667b,_0x42cd5a,_0x51ebf1,_0x2b8cf3);})[_0x4b01('0x1f')](function(_0x669a23){if(_0x669a23&&_0x669a23['id']){logger['info'](_0x4b01('0x50'));logger[_0x4b01('0xd')]('The\x20Ticket\x20ID\x20is:',_0x669a23['id']);logger[_0x4b01('0xd')]('[OUTBOUND]',_0x4b01('0x5d'));emit(util[_0x4b01('0x1b')]('user:%s',_0x40aca5[_0x4b01('0x15')]),_0x4b01('0x54'),{'uri':util[_0x4b01('0x1b')](_0x4b01('0x55'),_0x4c8015[_0x4b01('0x1d')],_0x669a23['id'])});}})[_0x4b01('0x5e')](function(_0x1d4fe5){logger[_0x4b01('0x56')](_0x4b01('0x5a'),JSON['stringify'](_0x1d4fe5));});};exports[_0x4b01('0x5f')]=function(_0x314a0d,_0x3653e5,_0x400d02,_0x46ae65,_0x2409f5,_0x4413b5){var _0x458daf,_0x5888ab;_0x4413b5[_0x4b01('0x1d')]=intUtil[_0x4b01('0x47')](_0x4413b5[_0x4b01('0x1d')]);_0x4413b5[_0x4b01('0x46')]=intUtil[_0x4b01('0x47')](_0x4413b5[_0x4b01('0x46')]);if(_0x2409f5&&_0x2409f5['monitor_format']){logger[_0x4b01('0xd')]('['+_0x3653e5[_0x4b01('0x60')][_0x4b01('0x61')]()+']',_0x4b01('0x49'));_0x3653e5[_0x4b01('0x4a')]=util[_0x4b01('0x1b')](_0x4b01('0x4b'),_0x4413b5[_0x4b01('0x46')],_0x3653e5[_0x4b01('0x4c')],md5(_0x3653e5[_0x4b01('0x4c')]));}else{_0x3653e5['recordingURL']='';}headers[_0x4b01('0x4d')]=getAuth(_0x4413b5);return getUser(_0x4413b5,'')[_0x4b01('0x1f')](function(_0x12a579){_0x458daf=_0x12a579;logger[_0x4b01('0xd')](_0x4b01('0x4e'),_0x458daf['id']);return getEndUser(_0x4413b5,_0x3653e5[_0x4b01('0x10')],_0x3653e5[_0x4b01('0x4f')]);})[_0x4b01('0x1f')](function(_0x56f290){_0x5888ab=_0x56f290;logger['info'](_0x4b01('0x62'),_0x5888ab['id']);return getTicket(_0x4413b5,_0x458daf,_0x5888ab,_0x400d02,_0x3653e5);})[_0x4b01('0x1f')](function(_0xbcbf4c){if(_0xbcbf4c){logger['info'](_0x4b01('0x50'));logger[_0x4b01('0xd')](_0x4b01('0x51'),_0xbcbf4c['id']);}})[_0x4b01('0x5e')](function(_0x10dc79){logger[_0x4b01('0x56')]('['+_0x3653e5[_0x4b01('0x60')]['toUpperCase']()+']',JSON[_0x4b01('0x57')](_0x10dc79));});}; \ No newline at end of file +var _0xfd0d=['catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','error','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','remoteUri','info','Ticket\x20created!','validateEmail','then','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','toString','base64','debug','map','includes','string','picklist','type','nameField','customField','content','push','idField','variableName','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfd0d,0xbd));var _0xdfd0=function(_0x46a281,_0x2bf44b){_0x46a281=_0x46a281-0x0;var _0x38474d=_0xfd0d[_0x46a281];return _0x38474d;};'use strict';var _=require(_0xdfd0('0x0'));var rp=require(_0xdfd0('0x1'));var md5=require(_0xdfd0('0x2'));var util=require(_0xdfd0('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xdfd0('0x4'));var logger=require(_0xdfd0('0x5'))(_0xdfd0('0x6'));config[_0xdfd0('0x7')]=_[_0xdfd0('0x8')](config[_0xdfd0('0x7')],{'host':_0xdfd0('0x9'),'port':0x18eb});var io=require(_0xdfd0('0xa'))(new Redis(config[_0xdfd0('0x7')]));var headers={'Content-Type':'application/json','Accept':_0xdfd0('0xb')};function emit(_0x548c36,_0x7af06b,_0x264fc6){io['to'](_0x548c36)[_0xdfd0('0xc')](_0x7af06b,_0x264fc6);}function getTicket(_0x2e3ea1,_0x4cae87,_0x827315,_0x593e06,_0x20b4b9){logger['info'](_0xdfd0('0xd'));var _0x33c64f=_[_0xdfd0('0xe')]({'responder_id':_0x4cae87['id'],'requester_id':_0x827315['id'],'name':util[_0xdfd0('0xf')](_0xdfd0('0x10'),_0x20b4b9[_0xdfd0('0x11')]),'phone':_0x20b4b9[_0xdfd0('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdfd0('0x13')](_0x593e06[_0xdfd0('0x14')],_0x20b4b9,'\x20'),'description':intUtil[_0xdfd0('0x13')](_0x593e06[_0xdfd0('0x15')],_0x20b4b9,_0xdfd0('0x16')),'tags':getTags(_0x593e06[_0xdfd0('0x17')],_0xdfd0('0x18'))},getCustomFields(_0x593e06[_0xdfd0('0x19')],_0x20b4b9));_0x33c64f[_0xdfd0('0x1a')]=_[_0xdfd0('0x1b')](_['keyBy'](_0x33c64f['custom_fields'],'id'),'value');return request({'uri':util['format']('%s/api/v2/tickets',_0x2e3ea1[_0xdfd0('0x1c')]),'method':'POST','body':_0x33c64f})['then'](function(_0x297e69){logger[_0xdfd0('0x1d')](_0xdfd0('0x1e'));return _0x297e69;});}function getUser(_0x21da4c,_0x56ec9b){if(intUtil[_0xdfd0('0x1f')](_0x56ec9b)){return request({'uri':util['format']('%s/api/v2/agents',_0x21da4c['remoteUri']),'qs':{'email':_0x56ec9b}})[_0xdfd0('0x20')](function(_0x597c1a){if(_0x597c1a[_0xdfd0('0x21')]){logger[_0xdfd0('0x1d')](_0xdfd0('0x22'));return _[_0xdfd0('0x23')](_0x597c1a,function(_0x38a62a){return _0x38a62a[_0xdfd0('0x24')]['email']===_0x56ec9b;});}else{logger[_0xdfd0('0x1d')](_0xdfd0('0x25'));return request({'uri':util['format'](_0xdfd0('0x26'),_0x21da4c[_0xdfd0('0x1c')])})[_0xdfd0('0x20')](function(_0x54a5c7){logger[_0xdfd0('0x1d')]('Admin\x20account\x20selected.');return _0x54a5c7;});}});}else{logger[_0xdfd0('0x1d')](_0xdfd0('0x27'));return request({'uri':util['format'](_0xdfd0('0x26'),_0x21da4c[_0xdfd0('0x1c')])})[_0xdfd0('0x20')](function(_0xc4a148){logger[_0xdfd0('0x1d')](_0xdfd0('0x28'));return _0xc4a148;});}}function getEndUser(_0x35f80e,_0x7991a4,_0x4ce3e3){logger['info'](_0xdfd0('0x29'),_0x4ce3e3);return request({'uri':util[_0xdfd0('0xf')]('%s/api/v2/contacts',_0x35f80e[_0xdfd0('0x1c')]),'qs':{'phone':_0x4ce3e3}})[_0xdfd0('0x20')](function(_0x538f58){if(_0x538f58[_0xdfd0('0x21')]){logger[_0xdfd0('0x1d')]('Enduser\x20found!');return _['find'](_0x538f58,{'phone':_0x4ce3e3});}else{logger[_0xdfd0('0x1d')](_0xdfd0('0x2a'));return request({'uri':util['format']('%s/api/v2/contacts',_0x35f80e[_0xdfd0('0x1c')]),'method':'POST','body':{'name':_0x7991a4,'phone':_0x4ce3e3}})['then'](function(_0x50e817){logger[_0xdfd0('0x1d')]('Enduser\x20created.');return _0x50e817;});}});}function getAuth(_0x18264d){return util[_0xdfd0('0xf')]('Basic\x20%s',new Buffer(_0x18264d['apiKey']+':X')[_0xdfd0('0x2b')](_0xdfd0('0x2c')));}function request(_0x2c989b){logger[_0xdfd0('0x2d')]('[HTTP]',JSON['stringify'](_0x2c989b));return rp(_[_0xdfd0('0x8')](_0x2c989b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1f92fb,_0x14fe7f){var _0x551a6e=[];if(_0x1f92fb&&_0x1f92fb[_0xdfd0('0x21')]>0x0){_0x551a6e=_[_0xdfd0('0x2e')](_0x1f92fb,_0x14fe7f);}return _0x551a6e;}function getCustomFields(_0x9aef29,_0x525efc){var _0x92e36=[];var _0x2bc388={'custom_fields':[]};if(_0x9aef29[_0xdfd0('0x21')]>0x0){_['forEach'](_0x9aef29,function(_0x1858e4){if(_[_0xdfd0('0x2f')]([_0xdfd0('0x30'),_0xdfd0('0x31')],_0x1858e4[_0xdfd0('0x32')])&&_0x1858e4[_0xdfd0('0x33')]&&!_0x1858e4[_0xdfd0('0x34')]){_0x2bc388[_0x1858e4[_0xdfd0('0x33')]['toLowerCase']()]=_0x1858e4[_0xdfd0('0x35')][_0xdfd0('0x2b')]();}else if(_['includes']([_0xdfd0('0x30'),_0xdfd0('0x31')],_0x1858e4[_0xdfd0('0x32')])&&_0x1858e4['idField']&&_0x1858e4['customField']){_0x2bc388[_0xdfd0('0x1a')][_0xdfd0('0x36')]({'id':_0x1858e4['idField'],'value':_0x1858e4[_0xdfd0('0x35')][_0xdfd0('0x2b')]()});}else if(_0x1858e4[_0xdfd0('0x32')]==='variable'&&_0x1858e4['variableName']&&_0x1858e4[_0xdfd0('0x37')]&&_0x1858e4[_0xdfd0('0x34')]){_0x525efc[_0x1858e4['variableName']]&&_0x2bc388['custom_fields']['push']({'id':_0x1858e4[_0xdfd0('0x37')],'value':_0x525efc[_0x1858e4[_0xdfd0('0x38')]][_0xdfd0('0x2b')]()});}else if(_0x1858e4['type']==='customVariable'&&_0x1858e4[_0xdfd0('0x39')]&&_0x1858e4['Variable'][_0xdfd0('0x18')]&&_0x1858e4[_0xdfd0('0x37')]&&_0x1858e4['customField']){_0x525efc[_0x1858e4[_0xdfd0('0x39')][_0xdfd0('0x18')][_0xdfd0('0x3a')]()]&&_0x2bc388[_0xdfd0('0x1a')][_0xdfd0('0x36')]({'id':_0x1858e4[_0xdfd0('0x37')],'value':_0x525efc[_0x1858e4[_0xdfd0('0x39')][_0xdfd0('0x18')]['toLowerCase']()]['toString']()});}});}return _0x2bc388;}exports['queue']=function(_0x19b3c5,_0x1b70af,_0x158343,_0x47efaa,_0x3ca6bd,_0x19ae4b){var _0xdbf8b7,_0x472781;_0x19ae4b[_0xdfd0('0x1c')]=intUtil[_0xdfd0('0x3b')](_0x19ae4b[_0xdfd0('0x1c')]);_0x19ae4b[_0xdfd0('0x3c')]=intUtil[_0xdfd0('0x3b')](_0x19ae4b[_0xdfd0('0x3c')]);if(_0x3ca6bd&&_0x3ca6bd[_0xdfd0('0x3d')]){logger[_0xdfd0('0x1d')]('[QUEUE]',_0xdfd0('0x3e'));_0x1b70af[_0xdfd0('0x3f')]=util['format'](_0xdfd0('0x40'),_0x19ae4b[_0xdfd0('0x3c')],_0x1b70af[_0xdfd0('0x41')],md5(_0x1b70af[_0xdfd0('0x41')]));}else{_0x1b70af['recordingURL']='';}headers[_0xdfd0('0x42')]=getAuth(_0x19ae4b);return getUser(_0x19ae4b,_0x47efaa[_0xdfd0('0x43')])[_0xdfd0('0x20')](function(_0x5d2afb){_0xdbf8b7=_0x5d2afb;logger[_0xdfd0('0x1d')](_0xdfd0('0x44'),_0xdbf8b7['id']);return getEndUser(_0x19ae4b,_0x1b70af[_0xdfd0('0x11')],_0x1b70af[_0xdfd0('0x12')]);})[_0xdfd0('0x20')](function(_0x5ac968){_0x472781=_0x5ac968;logger[_0xdfd0('0x1d')](_0xdfd0('0x45'),_0x472781['id']);return getTicket(_0x19ae4b,_0xdbf8b7,_0x472781,_0x158343,_0x1b70af);})[_0xdfd0('0x20')](function(_0x11628c){if(_0x11628c&&_0x11628c['id']){logger['info']('Ticket\x20created!');logger[_0xdfd0('0x1d')](_0xdfd0('0x46'),_0x11628c['id']);logger[_0xdfd0('0x1d')](_0xdfd0('0x47'),_0xdfd0('0x48'));emit(util[_0xdfd0('0xf')](_0xdfd0('0x49'),_0x47efaa[_0xdfd0('0x18')]),_0xdfd0('0x4a'),{'uri':util[_0xdfd0('0xf')]('%s/helpdesk/tickets/%d',_0x19ae4b[_0xdfd0('0x1c')],_0x11628c['id'])});}})[_0xdfd0('0x4b')](function(_0x521f7f){logger['error']('[QUEUE]',JSON[_0xdfd0('0x4c')](_0x521f7f));});};exports[_0xdfd0('0x4d')]=function(_0x54ac9b,_0x11a08c,_0x96b562,_0x758e3f,_0x32575c,_0x4eef57,_0x25bf2d){var _0x5e08e4,_0x40b13b;_0x4eef57[_0xdfd0('0x1c')]=intUtil['stripTrailingSlash'](_0x4eef57['remoteUri']);_0x4eef57[_0xdfd0('0x3c')]=intUtil[_0xdfd0('0x3b')](_0x4eef57[_0xdfd0('0x3c')]);if(_0x25bf2d&&_0x25bf2d[_0xdfd0('0x4e')]&&_0x25bf2d[_0xdfd0('0x4e')]!==_0xdfd0('0x4f')){logger[_0xdfd0('0x1d')](_0xdfd0('0x50'),_0xdfd0('0x3e'));_0x11a08c[_0xdfd0('0x3f')]=util[_0xdfd0('0xf')](_0xdfd0('0x40'),_0x4eef57[_0xdfd0('0x3c')],_0x11a08c[_0xdfd0('0x41')],md5(_0x11a08c[_0xdfd0('0x41')]));}headers[_0xdfd0('0x42')]=getAuth(_0x4eef57);return getUser(_0x4eef57,_0x758e3f[_0xdfd0('0x43')])[_0xdfd0('0x20')](function(_0x2f1970){_0x5e08e4=_0x2f1970;logger['info'](_0xdfd0('0x44'),_0x5e08e4['id']);return getEndUser(_0x4eef57,_0x11a08c[_0xdfd0('0x51')],_0x11a08c[_0xdfd0('0x52')]);})['then'](function(_0x522adf){_0x40b13b=_0x522adf;logger[_0xdfd0('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x40b13b['id']);return getTicket(_0x4eef57,_0x5e08e4,_0x40b13b,_0x96b562,_0x11a08c);})[_0xdfd0('0x20')](function(_0x36553c){if(_0x36553c&&_0x36553c['id']){logger[_0xdfd0('0x1d')](_0xdfd0('0x1e'));logger[_0xdfd0('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x36553c['id']);logger[_0xdfd0('0x1d')](_0xdfd0('0x50'),_0xdfd0('0x48'));emit(util[_0xdfd0('0xf')](_0xdfd0('0x49'),_0x758e3f[_0xdfd0('0x18')]),_0xdfd0('0x4a'),{'uri':util[_0xdfd0('0xf')](_0xdfd0('0x53'),_0x4eef57[_0xdfd0('0x1c')],_0x36553c['id'])});}})[_0xdfd0('0x4b')](function(_0x23aada){logger['error'](_0xdfd0('0x50'),JSON[_0xdfd0('0x4c')](_0x23aada));});};exports[_0xdfd0('0x54')]=function(_0x3971f9,_0x54a620,_0xf0774,_0x56daef,_0x2ed617,_0xa8770d){var _0x3f6cde,_0x250909;_0xa8770d['remoteUri']=intUtil[_0xdfd0('0x3b')](_0xa8770d[_0xdfd0('0x1c')]);_0xa8770d[_0xdfd0('0x3c')]=intUtil[_0xdfd0('0x3b')](_0xa8770d[_0xdfd0('0x3c')]);if(_0x2ed617&&_0x2ed617[_0xdfd0('0x3d')]){logger['info']('['+_0x54a620[_0xdfd0('0x55')][_0xdfd0('0x56')]()+']',_0xdfd0('0x3e'));_0x54a620[_0xdfd0('0x3f')]=util[_0xdfd0('0xf')](_0xdfd0('0x40'),_0xa8770d['serverUrl'],_0x54a620[_0xdfd0('0x41')],md5(_0x54a620[_0xdfd0('0x41')]));}else{_0x54a620[_0xdfd0('0x3f')]='';}headers[_0xdfd0('0x42')]=getAuth(_0xa8770d);return getUser(_0xa8770d,'')['then'](function(_0x4c52b2){_0x3f6cde=_0x4c52b2;logger['info'](_0xdfd0('0x44'),_0x3f6cde['id']);return getEndUser(_0xa8770d,_0x54a620['calleridname'],_0x54a620[_0xdfd0('0x12')]);})[_0xdfd0('0x20')](function(_0x11ef69){_0x250909=_0x11ef69;logger['info'](_0xdfd0('0x45'),_0x250909['id']);return getTicket(_0xa8770d,_0x3f6cde,_0x250909,_0xf0774,_0x54a620);})[_0xdfd0('0x20')](function(_0x13303e){if(_0x13303e){logger['info']('Ticket\x20created!');logger[_0xdfd0('0x1d')](_0xdfd0('0x46'),_0x13303e['id']);}})[_0xdfd0('0x4b')](function(_0x2f5122){logger[_0xdfd0('0x57')]('['+_0x54a620[_0xdfd0('0x55')]['toUpperCase']()+']',JSON[_0xdfd0('0x4c')](_0x2f5122));});}; \ 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 64adaa1..9167812 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 _0x9891=['error','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','format','add','task','Task\x20created:','/contacts/','emit','stripTrailingSlash','remoteUri','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0x9891,0x7f));var _0x1989=function(_0x2911e2,_0x39c3d9){_0x2911e2=_0x2911e2-0x0;var _0x111b30=_0x9891[_0x2911e2];return _0x111b30;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1989('0x0'));var util=require('util');var moment=require(_0x1989('0x1'));var Promise=require(_0x1989('0x2'));var Redis=require(_0x1989('0x3'));var intUtil=require(_0x1989('0x4'));var config=require(_0x1989('0x5'));var logger=require(_0x1989('0x6'))('freshsales');config[_0x1989('0x7')]=_[_0x1989('0x8')](config[_0x1989('0x7')],{'host':_0x1989('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1989('0x7')]));function getAdminId(_0x135a0e,_0x5465c8,_0x2f42d8,_0x189aa0){return new Promise(function(_0x3f03e9,_0x4d98d0){var _0x5d3624=![];var _0x1043d4={'method':_0x1989('0xa'),'uri':_0x189aa0+_0x1989('0xb'),'json':!![]};_0x1043d4[_0x1989('0xc')]=_0x2f42d8;logger[_0x1989('0xd')](_0x1989('0xe'));return rp(_0x1043d4)[_0x1989('0xf')](function(_0x30b641){if(_0x30b641){var _0x18087e=_0x30b641[_0x1989('0x10')];var _0xcc664d=null;for(_0xcc664d=0x0;_0xcc664d<_0x18087e['length'];_0xcc664d++){if(_0x18087e[_0xcc664d][_0x1989('0x11')]===_0x135a0e[_0x1989('0x12')]){_0x135a0e[_0x1989('0x13')]=_0x18087e[_0xcc664d]['id'];_0x5d3624=!![];}}if(_0x5d3624){logger[_0x1989('0xd')]('Admin\x20found:',_0x135a0e[_0x1989('0x13')]);_0x3f03e9(_0x135a0e);}else{_0x4d98d0({'statusCode':0x194,'message':_0x1989('0x14')});}}else{_0x4d98d0({'statusCode':0x194,'message':_0x1989('0x14')});}})[_0x1989('0x15')](function(_0xd1390a){logger['error']('['+[_0x5465c8[_0x1989('0x16')]()]+']',_0xd1390a[_0x1989('0x17')]);_0x4d98d0(_0xd1390a);});});}function getUser(_0x392f29,_0x2a3262,_0x41ead9){return function(_0x1f6422){return new Promise(function(_0xd38bfb,_0x32cd91){var _0x6b89a4={'method':_0x1989('0xa'),'uri':_0x41ead9+_0x1989('0xb'),'json':!![]};_0x6b89a4['headers']=_0x2a3262;logger[_0x1989('0xd')](_0x1989('0x18'));return rp(_0x6b89a4)[_0x1989('0xf')](function(_0x55f675){if(_0x55f675){var _0x5ee3a0=_0x55f675[_0x1989('0x10')];var _0x5cd0e5=![];var _0x399397=null;if(_0x1f6422[_0x1989('0x19')]!==null){logger[_0x1989('0xd')](_0x1989('0x1a'),_0x1f6422[_0x1989('0x19')]);_0x1f6422[_0x1989('0x1b')]=_0x1f6422['agentEmail'];for(_0x399397=0x0;_0x399397<_0x5ee3a0[_0x1989('0x1c')];_0x399397++){if(_0x5ee3a0[_0x399397][_0x1989('0x11')]===_0x1f6422[_0x1989('0x19')]){_0x5cd0e5=!![];_0x1f6422[_0x1989('0x1d')]=_0x5ee3a0[_0x399397]['id'];logger['info'](_0x1989('0x1e'),_0x1f6422[_0x1989('0x1d')]);}}}if(!_0x5cd0e5){logger['info']('Admin\x20selected');_0x1f6422[_0x1989('0x1b')]=_0x1f6422[_0x1989('0x12')];_0x1f6422[_0x1989('0x1d')]=_0x1f6422[_0x1989('0x13')];_0x5cd0e5=!![];}if(_0x5cd0e5){_0xd38bfb(_0x1f6422);}else{_0x32cd91({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x32cd91({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x3f558d){logger[_0x1989('0x1f')]('['+[_0x392f29['toUpperCase']()]+']',_0x3f558d[_0x1989('0x17')]);_0x32cd91(_0x3f558d);});});};}function searchContact(_0x4fb52c,_0x3bd072,_0x489d90,_0x34c916){return new Promise(function(_0x25360c,_0x506ef7){var _0x4eec41={'method':_0x1989('0xa'),'headers':_0x3bd072,'uri':_0x4fb52c+'/api/lookup?q='+_0x34c916+_0x1989('0x20')+_0x489d90+_0x1989('0x21'),'json':!![]};rp(_0x4eec41)[_0x1989('0xf')](function(_0x44f5f9){var _0x275553=_[_0x1989('0x22')](_0x44f5f9[_0x1989('0x23')][_0x1989('0x23')],[_0x489d90,_0x34c916]);_0x25360c(_0x275553);})[_0x1989('0x15')](function(_0x5ca394){_0x506ef7(_0x5ca394);});});}function getEndUser(_0x41491b,_0x42b1ba,_0xada2fa){return function(_0x1e2c69){return new Promise(function(_0x2c667e,_0x5b5ff8){logger[_0x1989('0xd')](util['format'](_0x1989('0x24'),_0x1e2c69[_0x1989('0x25')]));searchContact(_0xada2fa,_0x42b1ba,_0x1989('0x26'),_0x1e2c69[_0x1989('0x25')])[_0x1989('0xf')](function(_0x44bd49){if(_0x44bd49){_0x1e2c69[_0x1989('0x27')]=_0x44bd49['id'];logger[_0x1989('0xd')](_0x1989('0x28'),_0x1e2c69[_0x1989('0x27')]);return _0x2c667e(_0x1e2c69);}searchContact(_0xada2fa,_0x42b1ba,_0x1989('0x29'),_0x1e2c69[_0x1989('0x25')])['then'](function(_0x232125){if(_0x232125){_0x1e2c69[_0x1989('0x27')]=_0x232125['id'];logger[_0x1989('0xd')](_0x1989('0x2a'),_0x1e2c69[_0x1989('0x27')]);return _0x2c667e(_0x1e2c69);}createEndUser(_0x1e2c69,_0x41491b,_0x42b1ba,_0xada2fa)[_0x1989('0xf')](function(_0x453288){logger[_0x1989('0xd')](_0x1989('0x2b'),_0x453288[_0x1989('0x27')]);return _0x2c667e(_0x453288);});});})[_0x1989('0x15')](function(_0x4ecc5e){_0x5b5ff8(_0x4ecc5e);});});};}function createEndUser(_0x247fa7,_0x3f6205,_0x5c7016,_0x47e9c6){return new Promise(function(_0x1659bb,_0x1ceafa){var _0x4fc93b=moment();var _0x3b505a={'method':_0x1989('0x2c'),'uri':_0x47e9c6+'/api/contacts','body':{'contact':{'last_name':_0x247fa7['contactNumber'],'work_number':_0x247fa7[_0x1989('0x25')],'mobile_number':_0x247fa7[_0x1989('0x25')],'owner_id':_0x247fa7['userId'],'created_at':_0x4fc93b['format'](_0x1989('0x2d'))}},'json':!![]};_0x3b505a[_0x1989('0xc')]=_0x5c7016;logger[_0x1989('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3b505a)[_0x1989('0xf')](function(_0x378fdc){_0x247fa7[_0x1989('0x27')]=_0x378fdc[_0x1989('0x2e')]['id'];_0x1659bb(_0x247fa7);})[_0x1989('0x15')](function(_0x3668a5){logger[_0x1989('0x1f')]('['+[_0x3f6205['toUpperCase']()]+']',_0x3668a5[_0x1989('0x17')]);_0x1ceafa(_0x3668a5[_0x1989('0x17')]);});});}function getTicket(_0x320293,_0x64127d,_0x3fa59c,_0x57ade9,_0x2779e){return function(_0x5925f4){logger[_0x1989('0xd')](_0x1989('0x2f'));return new Promise(function(_0x295e8f,_0x886a8b){var _0x112a42=moment();var _0x5a26c7={'method':'POST','uri':_0x3fa59c+_0x1989('0x30'),'body':{'title':intUtil['getString'](_0x57ade9['Subjects'],_0x2779e,'\x20'),'description':intUtil[_0x1989('0x31')](_0x57ade9[_0x1989('0x32')],_0x2779e,'\x0a'),'owner_id':_0x5925f4[_0x1989('0x1d')],'creater_id':_0x5925f4[_0x1989('0x13')],'targetable_id':_0x5925f4['endUserId'],'targetable_type':_0x1989('0x33'),'created_at':_0x112a42[_0x1989('0x34')](_0x1989('0x2d')),'due_date':_0x112a42[_0x1989('0x35')](0x1e,'m')[_0x1989('0x34')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5a26c7['headers']=_0x64127d;return rp(_0x5a26c7)[_0x1989('0xf')](function(_0x2b2c36){_0x5925f4['ticketId']=_0x2b2c36[_0x1989('0x36')]['id'];logger[_0x1989('0xd')](_0x1989('0x37'),_0x5925f4['ticketId']);_0x295e8f(_0x5925f4);})[_0x1989('0x15')](function(_0x19a1bc){logger['error']('['+[_0x320293[_0x1989('0x16')]()]+']',_0x19a1bc[_0x1989('0x17')]);_0x886a8b(_0x19a1bc[_0x1989('0x17')]);});});};}function emit(_0xff18a3,_0x2936b3,_0x5cd1cb){var _0x342f68={'uri':_0xff18a3+_0x1989('0x38')+_0x5cd1cb};io['to'](util[_0x1989('0x34')]('user:%s',_0x2936b3))[_0x1989('0x39')]('trigger:browser:url',_0x342f68);}exports['cs']=function(_0x180bdf,_0x505598,_0x491f95,_0x563ee5,_0x4d648a,_0x168764,_0x354363,_0x992f01){var _0x25bf34={};var _0x2a78f0={'Authorization':'Token\x20token='+_0x168764['apiKey']};_0x168764['remoteUri']=intUtil[_0x1989('0x3a')](_0x168764[_0x1989('0x3b')]);_0x168764['serverUrl']=intUtil['stripTrailingSlash'](_0x168764['serverUrl']);var _0x5f20f2=_0x168764[_0x1989('0x3b')];_0x25bf34[_0x1989('0x12')]=_0x168764['username'];_0x25bf34[_0x1989('0x25')]=_0x992f01[_0x1989('0x3c')]()===_0x1989('0x3d')?_0x505598[_0x1989('0x3e')]:_0x505598[_0x1989('0x3f')];_0x25bf34[_0x1989('0x40')]=_0x992f01===_0x1989('0x41')||_0x992f01===_0x1989('0x42')?_0x1989('0x41'):_0x1989('0x3d');if(_0x563ee5){_0x25bf34['agentEmail']=_0x563ee5['email'];}var _0x4683c9=util[_0x1989('0x34')](_0x1989('0x43'),_0x168764[_0x1989('0x44')],_0x505598['uniqueid'],md5(_0x505598[_0x1989('0x45')]));if(_0x4d648a&&_0x4d648a['monitor_format']){logger[_0x1989('0xd')](_0x1989('0x46'),'Recording\x20is\x20enabled!');_0x505598[_0x1989('0x47')]=_0x4683c9;}else if(_0x354363&&_0x354363[_0x1989('0x48')]&&_0x354363[_0x1989('0x48')]!=='none'){logger['info']('[OUTBOUND]',_0x1989('0x49'));_0x505598['recordingURL']=_0x4683c9;}else{_0x505598[_0x1989('0x47')]='';}return getAdminId(_0x25bf34,_0x992f01,_0x2a78f0,_0x5f20f2)[_0x1989('0xf')](getUser(_0x992f01,_0x2a78f0,_0x5f20f2))[_0x1989('0xf')](getEndUser(_0x992f01,_0x2a78f0,_0x5f20f2))[_0x1989('0xf')](getTicket(_0x992f01,_0x2a78f0,_0x5f20f2,_0x491f95,_0x505598))[_0x1989('0xf')](function(_0x5eba9c){logger[_0x1989('0xd')](util[_0x1989('0x34')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5eba9c[_0x1989('0x4a')]));if(_0x992f01!==_0x1989('0x42')){logger['info']('['+[_0x992f01[_0x1989('0x16')]()]+']',_0x1989('0x4b'));emit(_0x5f20f2,_0x563ee5[_0x1989('0x4c')],_0x5eba9c[_0x1989('0x27')]);}})[_0x1989('0x15')](function(_0x4a3c87){logger[_0x1989('0x1f')]('['+[_0x992f01['toUpperCase']()]+_0x1989('0x4d'),util[_0x1989('0x4e')](_0x4a3c87,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa889=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','redis','defaults','localhost','GET','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','catch','/api/lookup?q=','&f=','&entities=contact','find','format','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','username','toLowerCase','outbound','queue','uniqueid','monitor_format','[QUEUE]','recordingURL'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa889,0xa3));var _0x9a88=function(_0x450442,_0x4a8fc1){_0x450442=_0x450442-0x0;var _0x287b29=_0xa889[_0x450442];return _0x287b29;};'use strict';var _=require(_0x9a88('0x0'));var rp=require(_0x9a88('0x1'));var md5=require(_0x9a88('0x2'));var util=require('util');var moment=require(_0x9a88('0x3'));var Promise=require(_0x9a88('0x4'));var Redis=require(_0x9a88('0x5'));var intUtil=require(_0x9a88('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshsales');config[_0x9a88('0x7')]=_[_0x9a88('0x8')](config['redis'],{'host':_0x9a88('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9a88('0x7')]));function getAdminId(_0x38a962,_0x1897b3,_0x428746,_0x333977){return new Promise(function(_0x158ca3,_0x2f62ec){var _0x25bae6=![];var _0x373a6d={'method':_0x9a88('0xa'),'uri':_0x333977+'/api/selector/owners','json':!![]};_0x373a6d[_0x9a88('0xb')]=_0x428746;logger[_0x9a88('0xc')](_0x9a88('0xd'));return rp(_0x373a6d)[_0x9a88('0xe')](function(_0x4bdbce){if(_0x4bdbce){var _0x280951=_0x4bdbce['users'];var _0x3f96da=null;for(_0x3f96da=0x0;_0x3f96da<_0x280951[_0x9a88('0xf')];_0x3f96da++){if(_0x280951[_0x3f96da][_0x9a88('0x10')]===_0x38a962[_0x9a88('0x11')]){_0x38a962[_0x9a88('0x12')]=_0x280951[_0x3f96da]['id'];_0x25bae6=!![];}}if(_0x25bae6){logger['info'](_0x9a88('0x13'),_0x38a962['adminId']);_0x158ca3(_0x38a962);}else{_0x2f62ec({'statusCode':0x194,'message':_0x9a88('0x14')});}}else{_0x2f62ec({'statusCode':0x194,'message':_0x9a88('0x14')});}})['catch'](function(_0x2e3843){logger[_0x9a88('0x15')]('['+[_0x1897b3[_0x9a88('0x16')]()]+']',_0x2e3843[_0x9a88('0x17')]);_0x2f62ec(_0x2e3843);});});}function getUser(_0x37af17,_0xcfa282,_0x114dac){return function(_0x5b3a41){return new Promise(function(_0x2eab4a,_0x4b5ae5){var _0x1f7676={'method':'GET','uri':_0x114dac+'/api/selector/owners','json':!![]};_0x1f7676[_0x9a88('0xb')]=_0xcfa282;logger['info'](_0x9a88('0x18'));return rp(_0x1f7676)['then'](function(_0x107cde){if(_0x107cde){var _0x2ae137=_0x107cde[_0x9a88('0x19')];var _0x31ec77=![];var _0x54b5f7=null;if(_0x5b3a41[_0x9a88('0x1a')]!==null){logger[_0x9a88('0xc')](_0x9a88('0x1b'),_0x5b3a41[_0x9a88('0x1a')]);_0x5b3a41['userEmail']=_0x5b3a41['agentEmail'];for(_0x54b5f7=0x0;_0x54b5f7<_0x2ae137[_0x9a88('0xf')];_0x54b5f7++){if(_0x2ae137[_0x54b5f7][_0x9a88('0x10')]===_0x5b3a41[_0x9a88('0x1a')]){_0x31ec77=!![];_0x5b3a41[_0x9a88('0x1c')]=_0x2ae137[_0x54b5f7]['id'];logger[_0x9a88('0xc')](_0x9a88('0x1d'),_0x5b3a41['userId']);}}}if(!_0x31ec77){logger[_0x9a88('0xc')](_0x9a88('0x1e'));_0x5b3a41[_0x9a88('0x1f')]=_0x5b3a41[_0x9a88('0x11')];_0x5b3a41[_0x9a88('0x1c')]=_0x5b3a41[_0x9a88('0x12')];_0x31ec77=!![];}if(_0x31ec77){_0x2eab4a(_0x5b3a41);}else{_0x4b5ae5({'statusCode':0x194,'message':_0x9a88('0x14')});}}else{_0x4b5ae5({'statusCode':0x194,'message':_0x9a88('0x14')});}})[_0x9a88('0x20')](function(_0xd4c903){logger['error']('['+[_0x37af17[_0x9a88('0x16')]()]+']',_0xd4c903['message']);_0x4b5ae5(_0xd4c903);});});};}function searchContact(_0x25ee53,_0xbfec8c,_0x36393e,_0x582e88){return new Promise(function(_0x11c96a,_0x34b8a3){var _0x332fa5={'method':_0x9a88('0xa'),'headers':_0xbfec8c,'uri':_0x25ee53+_0x9a88('0x21')+_0x582e88+_0x9a88('0x22')+_0x36393e+_0x9a88('0x23'),'json':!![]};rp(_0x332fa5)[_0x9a88('0xe')](function(_0x49db0d){var _0x50e81c=_[_0x9a88('0x24')](_0x49db0d['contacts']['contacts'],[_0x36393e,_0x582e88]);_0x11c96a(_0x50e81c);})['catch'](function(_0x5a252a){_0x34b8a3(_0x5a252a);});});}function getEndUser(_0x469b6d,_0x483da0,_0xa76ced){return function(_0x531e89){return new Promise(function(_0x18f041,_0x2ce78c){logger[_0x9a88('0xc')](util[_0x9a88('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x531e89[_0x9a88('0x26')]));searchContact(_0xa76ced,_0x483da0,_0x9a88('0x27'),_0x531e89[_0x9a88('0x26')])[_0x9a88('0xe')](function(_0x38b066){if(_0x38b066){_0x531e89['endUserId']=_0x38b066['id'];logger[_0x9a88('0xc')](_0x9a88('0x28'),_0x531e89['endUserId']);return _0x18f041(_0x531e89);}searchContact(_0xa76ced,_0x483da0,_0x9a88('0x29'),_0x531e89[_0x9a88('0x26')])[_0x9a88('0xe')](function(_0xe8d933){if(_0xe8d933){_0x531e89[_0x9a88('0x2a')]=_0xe8d933['id'];logger['info']('Contact\x20found\x20work_number:',_0x531e89[_0x9a88('0x2a')]);return _0x18f041(_0x531e89);}createEndUser(_0x531e89,_0x469b6d,_0x483da0,_0xa76ced)[_0x9a88('0xe')](function(_0x1ff32f){logger[_0x9a88('0xc')](_0x9a88('0x2b'),_0x1ff32f['endUserId']);return _0x18f041(_0x1ff32f);});});})[_0x9a88('0x20')](function(_0x3ba3e7){_0x2ce78c(_0x3ba3e7);});});};}function createEndUser(_0x5de7f9,_0x2df4b0,_0x372e3a,_0x2254e6){return new Promise(function(_0x10db6e,_0x766112){var _0x5af846=moment();var _0x32fa62={'method':_0x9a88('0x2c'),'uri':_0x2254e6+_0x9a88('0x2d'),'body':{'contact':{'last_name':_0x5de7f9[_0x9a88('0x26')],'work_number':_0x5de7f9['contactNumber'],'mobile_number':_0x5de7f9[_0x9a88('0x26')],'owner_id':_0x5de7f9[_0x9a88('0x1c')],'created_at':_0x5af846[_0x9a88('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x32fa62[_0x9a88('0xb')]=_0x372e3a;logger[_0x9a88('0xc')](_0x9a88('0x2e'));return rp(_0x32fa62)[_0x9a88('0xe')](function(_0x5b404c){_0x5de7f9[_0x9a88('0x2a')]=_0x5b404c[_0x9a88('0x2f')]['id'];_0x10db6e(_0x5de7f9);})['catch'](function(_0x3e90e6){logger['error']('['+[_0x2df4b0[_0x9a88('0x16')]()]+']',_0x3e90e6[_0x9a88('0x17')]);_0x766112(_0x3e90e6[_0x9a88('0x17')]);});});}function getTicket(_0x33c863,_0xfb8529,_0x2a7bb5,_0x4da841,_0x3a6943){return function(_0x46f355){logger['info'](_0x9a88('0x30'));return new Promise(function(_0x29ab4c,_0xbbaf6){var _0x352be1=moment();var _0x14ccec={'method':_0x9a88('0x2c'),'uri':_0x2a7bb5+_0x9a88('0x31'),'body':{'title':intUtil['getString'](_0x4da841[_0x9a88('0x32')],_0x3a6943,'\x20'),'description':intUtil['getString'](_0x4da841[_0x9a88('0x33')],_0x3a6943,'\x0a'),'owner_id':_0x46f355['userId'],'creater_id':_0x46f355['adminId'],'targetable_id':_0x46f355['endUserId'],'targetable_type':_0x9a88('0x34'),'created_at':_0x352be1[_0x9a88('0x25')](_0x9a88('0x35')),'due_date':_0x352be1[_0x9a88('0x36')](0x1e,'m')[_0x9a88('0x25')](_0x9a88('0x35'))},'json':!![]};_0x14ccec[_0x9a88('0xb')]=_0xfb8529;return rp(_0x14ccec)[_0x9a88('0xe')](function(_0x2d225d){_0x46f355['ticketId']=_0x2d225d[_0x9a88('0x37')]['id'];logger[_0x9a88('0xc')](_0x9a88('0x38'),_0x46f355['ticketId']);_0x29ab4c(_0x46f355);})[_0x9a88('0x20')](function(_0x54436f){logger[_0x9a88('0x15')]('['+[_0x33c863[_0x9a88('0x16')]()]+']',_0x54436f[_0x9a88('0x17')]);_0xbbaf6(_0x54436f['message']);});});};}function emit(_0x31d39e,_0x5c525e,_0x19be7c){var _0x15061e={'uri':_0x31d39e+'/contacts/'+_0x19be7c};io['to'](util[_0x9a88('0x25')](_0x9a88('0x39'),_0x5c525e))[_0x9a88('0x3a')](_0x9a88('0x3b'),_0x15061e);}exports['cs']=function(_0x41b488,_0x4dc86c,_0x130b39,_0x3de59a,_0x482109,_0xf671f8,_0x33e456,_0x1a1a5d){var _0x202d20={};var _0x210272={'Authorization':_0x9a88('0x3c')+_0xf671f8['apiKey']};_0xf671f8[_0x9a88('0x3d')]=intUtil[_0x9a88('0x3e')](_0xf671f8['remoteUri']);_0xf671f8['serverUrl']=intUtil[_0x9a88('0x3e')](_0xf671f8['serverUrl']);var _0x15298b=_0xf671f8[_0x9a88('0x3d')];_0x202d20[_0x9a88('0x11')]=_0xf671f8[_0x9a88('0x3f')];_0x202d20['contactNumber']=_0x1a1a5d[_0x9a88('0x40')]()===_0x9a88('0x41')?_0x4dc86c['destcalleridnum']:_0x4dc86c['calleridnum'];_0x202d20['callDirection']=_0x1a1a5d===_0x9a88('0x42')||_0x1a1a5d==='unmanaged'?_0x9a88('0x42'):_0x9a88('0x41');if(_0x3de59a){_0x202d20[_0x9a88('0x1a')]=_0x3de59a['email'];}var _0x2e6665=util[_0x9a88('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf671f8['serverUrl'],_0x4dc86c[_0x9a88('0x43')],md5(_0x4dc86c[_0x9a88('0x43')]));if(_0x482109&&_0x482109[_0x9a88('0x44')]){logger[_0x9a88('0xc')](_0x9a88('0x45'),'Recording\x20is\x20enabled!');_0x4dc86c[_0x9a88('0x46')]=_0x2e6665;}else if(_0x33e456&&_0x33e456[_0x9a88('0x47')]&&_0x33e456[_0x9a88('0x47')]!==_0x9a88('0x48')){logger[_0x9a88('0xc')](_0x9a88('0x49'),_0x9a88('0x4a'));_0x4dc86c[_0x9a88('0x46')]=_0x2e6665;}else{_0x4dc86c[_0x9a88('0x46')]='';}return getAdminId(_0x202d20,_0x1a1a5d,_0x210272,_0x15298b)[_0x9a88('0xe')](getUser(_0x1a1a5d,_0x210272,_0x15298b))[_0x9a88('0xe')](getEndUser(_0x1a1a5d,_0x210272,_0x15298b))[_0x9a88('0xe')](getTicket(_0x1a1a5d,_0x210272,_0x15298b,_0x130b39,_0x4dc86c))[_0x9a88('0xe')](function(_0x29a206){logger[_0x9a88('0xc')](util[_0x9a88('0x25')](_0x9a88('0x4b'),_0x29a206['ticketId']));if(_0x1a1a5d!==_0x9a88('0x4c')){logger[_0x9a88('0xc')]('['+[_0x1a1a5d[_0x9a88('0x16')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x15298b,_0x3de59a['name'],_0x29a206[_0x9a88('0x2a')]);}})['catch'](function(_0x272af8){logger[_0x9a88('0x15')]('['+[_0x1a1a5d['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x9a88('0x4d')](_0x272af8,{'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 dc38f2b..e87030f 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 _0x5298=['%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./freshdesk','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','desk','servicenow','exec','toLowerCase','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','zoho','vtiger','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','data1','error','[EXEC]'];(function(_0x3e2adf,_0x5420c3){var _0x20354b=function(_0x1162a1){while(--_0x1162a1){_0x3e2adf['push'](_0x3e2adf['shift']());}};_0x20354b(++_0x5420c3);}(_0x5298,0x157));var _0x8529=function(_0x10802e,_0xb4e008){_0x10802e=_0x10802e-0x0;var _0x15fa97=_0x5298[_0x10802e];return _0x15fa97;};'use strict';var _=require(_0x8529('0x0'));var util=require('util');var zendesk=require(_0x8529('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x8529('0x2'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x8529('0x3'));var dynamics365=require('./dynamics365');var freshsales=require(_0x8529('0x4'));var integrations=[_0x8529('0x5'),_0x8529('0x6'),_0x8529('0x7'),'freshdesk','zoho',_0x8529('0x8'),'vtiger','dynamics365','freshsales',_0x8529('0x9')];exports[_0x8529('0xa')]=function(_0x5f1f07,_0x4a4fca,_0x209479,_0x234c44,_0x5c8533,_0x2a5521){if(_0x209479){if(_['includes'](integrations,_0x5f1f07['data1'][_0x8529('0xb')]())){try{var _0x50bd52=null;var _0x163e57='';var _0x18d1c6=_0x209479[_0x5f1f07['data1']['toLowerCase']()];if(_0x18d1c6){var _0x54dd6e=_0x18d1c6[_0x5f1f07['data2']];if(_0x54dd6e){var _0x211b88=_['find'](_0x54dd6e['Configurations'],{'id':parseInt(_0x5f1f07[_0x8529('0xc')],0xa)});if(_0x211b88){if(_0x234c44){if(_0x5c8533&&_0x4a4fca[_0x8529('0xd')]){_0x163e57='queue';}else if(_0x4a4fca[_0x8529('0xe')]){_0x163e57=_0x8529('0xf');}else{console[_0x8529('0x10')](_0x8529('0x11'),_0x4a4fca);}}else{_0x163e57=_0x8529('0x12');}switch(_0x5f1f07['data1'][_0x8529('0xb')]()){case'zendesk':zendesk[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case'salesforce':salesforce[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x7'):sugarcrm[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x13'):freshdesk[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x14'):zoho[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case'desk':desk[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x15'):vtiger[_0x163e57](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521);break;case _0x8529('0x16'):freshsales['cs'](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521,_0x163e57);break;case _0x8529('0x9'):servicenow['cs'](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521,_0x163e57);break;case _0x8529('0x17'):dynamics365['cs'](_0x5f1f07,_0x4a4fca,_0x211b88,_0x234c44,_0x5c8533,_0x54dd6e,_0x2a5521,_0x163e57);break;default:console[_0x8529('0x10')](_0x8529('0x18'));}}else{_0x50bd52=require(_0x8529('0x19'))(_0x5f1f07[_0x8529('0x1a')]['toLowerCase']());_0x50bd52[_0x8529('0x1b')](_0x8529('0x1c'),util['format'](_0x8529('0x1d'),_0x5f1f07[_0x8529('0x1a')][_0x8529('0xb')](),_0x5f1f07[_0x8529('0xc')]));}}else{_0x50bd52=require('../../../../config/logger')(_0x5f1f07['data1'][_0x8529('0xb')]());_0x50bd52['error'](_0x8529('0x1c'),util['format'](_0x8529('0x1e'),_0x5f1f07['data1'][_0x8529('0xb')](),_0x5f1f07['data2']));}}else{}}catch(_0x40c768){console['error'](_0x40c768);}}}}; \ No newline at end of file +var _0x7f54=['EVENT\x20UNKNOWN','unmanaged','toLowerCase','zendesk','freshdesk','desk','unknown\x20integration','../../../../config/logger','format','[EXEC]','%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','salesforce','sugarcrm','zoho','vtiger','dynamics365','freshsales','servicenow','data1','data2','find','Configurations','data3','queue','log'];(function(_0x43777c,_0x2f3033){var _0x8817f4=function(_0x37ff2c){while(--_0x37ff2c){_0x43777c['push'](_0x43777c['shift']());}};_0x8817f4(++_0x2f3033);}(_0x7f54,0x16a));var _0x47f5=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x7f54[_0x459b74];return _0x46cb16;};'use strict';var _=require(_0x47f5('0x0'));var util=require(_0x47f5('0x1'));var zendesk=require(_0x47f5('0x2'));var salesforce=require(_0x47f5('0x3'));var sugarcrm=require(_0x47f5('0x4'));var freshdesk=require(_0x47f5('0x5'));var zoho=require(_0x47f5('0x6'));var desk=require(_0x47f5('0x7'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x47f5('0x8'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x47f5('0x9'),_0x47f5('0xa'),'freshdesk',_0x47f5('0xb'),'desk',_0x47f5('0xc'),_0x47f5('0xd'),_0x47f5('0xe'),_0x47f5('0xf')];exports['exec']=function(_0x3dd654,_0x189e11,_0x966671,_0x59e549,_0x20d1cd,_0x1d4c90){if(_0x966671){if(_['includes'](integrations,_0x3dd654[_0x47f5('0x10')]['toLowerCase']())){try{var _0x2bca72=null;var _0x4ad3b4='';var _0x60822e=_0x966671[_0x3dd654[_0x47f5('0x10')]['toLowerCase']()];if(_0x60822e){var _0x21c2eb=_0x60822e[_0x3dd654[_0x47f5('0x11')]];if(_0x21c2eb){var _0x3bd0af=_[_0x47f5('0x12')](_0x21c2eb[_0x47f5('0x13')],{'id':parseInt(_0x3dd654[_0x47f5('0x14')],0xa)});if(_0x3bd0af){if(_0x59e549){if(_0x20d1cd&&_0x189e11[_0x47f5('0x15')]){_0x4ad3b4=_0x47f5('0x15');}else if(_0x189e11['routeId']){_0x4ad3b4='outbound';}else{console[_0x47f5('0x16')](_0x47f5('0x17'),_0x189e11);}}else{_0x4ad3b4=_0x47f5('0x18');}switch(_0x3dd654[_0x47f5('0x10')][_0x47f5('0x19')]()){case _0x47f5('0x1a'):zendesk[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case'salesforce':salesforce[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case _0x47f5('0xa'):sugarcrm[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case _0x47f5('0x1b'):freshdesk[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case _0x47f5('0xb'):zoho[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case _0x47f5('0x1c'):desk[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case _0x47f5('0xc'):vtiger[_0x4ad3b4](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90);break;case _0x47f5('0xe'):freshsales['cs'](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90,_0x4ad3b4);break;case _0x47f5('0xf'):servicenow['cs'](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90,_0x4ad3b4);break;case'dynamics365':dynamics365['cs'](_0x3dd654,_0x189e11,_0x3bd0af,_0x59e549,_0x20d1cd,_0x21c2eb,_0x1d4c90,_0x4ad3b4);break;default:console['log'](_0x47f5('0x1d'));}}else{_0x2bca72=require(_0x47f5('0x1e'))(_0x3dd654[_0x47f5('0x10')]['toLowerCase']());_0x2bca72['error']('[EXEC]',util[_0x47f5('0x1f')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3dd654['data1']['toLowerCase'](),_0x3dd654['data3']));}}else{_0x2bca72=require(_0x47f5('0x1e'))(_0x3dd654[_0x47f5('0x10')]['toLowerCase']());_0x2bca72['error'](_0x47f5('0x20'),util['format'](_0x47f5('0x21'),_0x3dd654['data1'][_0x47f5('0x19')](),_0x3dd654['data2']));}}else{}}catch(_0x574b8f){console[_0x47f5('0x22')](_0x574b8f);}}}}; \ 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 869fa0d..bb51359 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 _0x2bbf=['getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','contact','lead','WhoId','endUserType','account','WhatId','Case','ContactId','AccountId','leadId','sobject','create','validateEmail','then','length','find','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','Contact','execute','additionalSearchLead','account_contact_lead','additionalSearchAccount','merge','Account','$or','Lead','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','integrationTab','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','newTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','isNil',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign'];(function(_0x246e95,_0x33aca9){var _0x466bd7=function(_0xeb35b4){while(--_0xeb35b4){_0x246e95['push'](_0x246e95['shift']());}};_0x466bd7(++_0x33aca9);}(_0x2bbf,0x1f1));var _0xf2bb=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x2bbf[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var rp=require(_0xf2bb('0x0'));var moment=require(_0xf2bb('0x1'));var BPromise=require(_0xf2bb('0x2'));var md5=require(_0xf2bb('0x3'));var jsforce=require(_0xf2bb('0x4'));var util=require(_0xf2bb('0x5'));var Redis=require('ioredis');var intUtil=require(_0xf2bb('0x6'));var config=require(_0xf2bb('0x7'));var logger=require(_0xf2bb('0x8'))('salesforce');config['redis']=_[_0xf2bb('0x9')](config[_0xf2bb('0xa')],{'host':_0xf2bb('0xb'),'port':0x18eb});var io=require(_0xf2bb('0xc'))(new Redis(config['redis']));function emit(_0x2aef6c,_0x5f337a,_0x1aec33){io['to'](_0x2aef6c)[_0xf2bb('0xd')](_0x5f337a,_0x1aec33);}function getTicket(_0x4b0729,_0xe539b6,_0x511b62,_0x462778,_0x4bdfc4,_0x1a8919,_0x139ad5,_0x28cc5f){var _0x56a2fc=Object[_0xf2bb('0xe')]({},{'OwnerId':_0xe539b6['id'],'Subject':intUtil[_0xf2bb('0xf')](_0x462778[_0xf2bb('0x10')],_0x4bdfc4,'\x20'),'Description':intUtil[_0xf2bb('0xf')](_0x462778[_0xf2bb('0x11')],_0x4bdfc4,'\x0a')},getCustomFields(_0x1a8919,_0x4bdfc4));if(_0x511b62){if(_0x462778[_0xf2bb('0x12')]===_0xf2bb('0x13')){_0x56a2fc[_0xf2bb('0x14')]=moment[_0xf2bb('0x15')]();_0x56a2fc['IsReminderSet']=![];_0x56a2fc['IsRecurrence']=![];if(_0x511b62['endUserType']===_0xf2bb('0x16')||_0x511b62['endUserType']===_0xf2bb('0x17')){_0x56a2fc[_0xf2bb('0x18')]=_0x511b62['id'];}else if(_0x511b62[_0xf2bb('0x19')]===_0xf2bb('0x1a')){_0x56a2fc[_0xf2bb('0x1b')]=_0x511b62['id'];}}else if(_0x462778['ticketType']===_0xf2bb('0x1c')){if(_0x511b62[_0xf2bb('0x19')]==='contact'){_0x56a2fc[_0xf2bb('0x1d')]=_0x511b62['id'];}else if(_0x511b62[_0xf2bb('0x19')]===_0xf2bb('0x1a')){_0x56a2fc[_0xf2bb('0x1e')]=_0x511b62['id'];}else if(_0x511b62['endUserType']===_0xf2bb('0x17')&&_0x462778[_0xf2bb('0x1f')]){_0x56a2fc[_0x462778[_0xf2bb('0x1f')]]=_0x511b62['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x139ad5[_0xf2bb('0x20')](_0x462778['ticketType'])[_0xf2bb('0x21')](_0x56a2fc);}function getUser(_0x120b54,_0x2602ba,_0x9d9d9){if(!_['isNil'](_0x2602ba)&&intUtil[_0xf2bb('0x22')](_0x2602ba)){var _0x50de4f={'Email':_0x2602ba};var _0x4bcbd7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x9d9d9[_0xf2bb('0x20')]('User')['find'](_0x50de4f,_0x4bcbd7)['execute']()[_0xf2bb('0x23')](function(_0x47a7a1){if(_0x47a7a1[_0xf2bb('0x24')]){var _0x17a49d=_[_0xf2bb('0x25')](_0x47a7a1,function(_0xafd750){return _0xafd750[_0xf2bb('0x26')]===_0x2602ba;});if(_0x17a49d){logger[_0xf2bb('0x27')]('Agent\x20%s\x20found.',_0x2602ba);return BPromise[_0xf2bb('0x28')]({'id':_0x17a49d['Id'],'name':_0x17a49d[_0xf2bb('0x29')]});}}else{logger[_0xf2bb('0x27')](_0xf2bb('0x2a'),_0x2602ba);return _0x9d9d9[_0xf2bb('0x2b')]()[_0xf2bb('0x23')](function(_0x33d9d9){return BPromise[_0xf2bb('0x28')]({'id':_0x33d9d9[_0xf2bb('0x2c')],'name':_0x33d9d9[_0xf2bb('0x2d')]});});}});}else{logger[_0xf2bb('0x27')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2602ba);return _0x9d9d9[_0xf2bb('0x2b')]()[_0xf2bb('0x23')](function(_0x367bc5){return BPromise[_0xf2bb('0x28')]({'id':_0x367bc5['user_id'],'name':_0x367bc5['display_name']});});}}function getEndUser(_0x159bd2,_0x51c612,_0x4ca70c,_0x5af443,_0xb1da88){var _0x40484b={'$or':{'Phone':_0x5af443}};var _0x2ccf79={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf2bb('0x28')]()[_0xf2bb('0x23')](function(){logger['info'](_0xf2bb('0x2e'),_0x5af443,_0x51c612[_0xf2bb('0x2f')]);switch(_0x51c612[_0xf2bb('0x2f')]){case'contact_lead':var _0x2744e2=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612['additionalSearchContact']){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x31')]]=_0x5af443;_['merge'](_0x2744e2['$or'],_0x44af0b);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x32'))[_0xf2bb('0x25')](_0x2744e2,_0x2ccf79)[_0xf2bb('0x33')]()[_0xf2bb('0x23')](function(_0x209f97){if(_0x209f97&&_0x209f97[_0xf2bb('0x24')]){return _0x209f97;}else{var _0x50a681=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x34')]){var _0x4582d3={};_0x4582d3[_0x51c612[_0xf2bb('0x34')]]=_0x5af443;_['merge'](_0x50a681['$or'],_0x4582d3);}return _0xb1da88[_0xf2bb('0x20')]('Lead')[_0xf2bb('0x25')](_0x50a681,_0x2ccf79);}});case _0xf2bb('0x35'):var _0x2a1ccb=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x36')]){var _0x44af0b={};_0x44af0b[_0x51c612['additionalSearchAccount']]=_0x5af443;_[_0xf2bb('0x37')](_0x2a1ccb['$or'],_0x44af0b);}return _0xb1da88['sobject'](_0xf2bb('0x38'))[_0xf2bb('0x25')](_0x2a1ccb,_0x2ccf79)[_0xf2bb('0x33')]()[_0xf2bb('0x23')](function(_0x5524e8){if(_0x5524e8&&_0x5524e8[_0xf2bb('0x24')]){return _0x5524e8;}else{var _0x152899=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x31')]){var _0xb503a6={};_0xb503a6[_0x51c612[_0xf2bb('0x31')]]=_0x5af443;_[_0xf2bb('0x37')](_0x152899[_0xf2bb('0x39')],_0xb503a6);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x32'))['find'](_0x152899,_0x2ccf79)['then'](function(_0x35a6d4){if(_0x35a6d4&&_0x35a6d4[_0xf2bb('0x24')]){return _0x35a6d4;}else{var _0x346688=_['cloneDeep'](_0x40484b);if(_0x51c612[_0xf2bb('0x34')]){var _0x2ff14f={};_0x2ff14f[_0x51c612[_0xf2bb('0x34')]]=_0x5af443;_['merge'](_0x346688[_0xf2bb('0x39')],_0x2ff14f);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x3a'))[_0xf2bb('0x25')](_0x346688,_0x2ccf79);}});}});case _0xf2bb('0x16'):var _0x2744e2=_['cloneDeep'](_0x40484b);if(_0x51c612['additionalSearchContact']){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x31')]]=_0x5af443;_[_0xf2bb('0x37')](_0x2744e2[_0xf2bb('0x39')],_0x44af0b);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x32'))[_0xf2bb('0x25')](_0x2744e2,_0x2ccf79)[_0xf2bb('0x33')]();case _0xf2bb('0x17'):var _0x3638b7=_[_0xf2bb('0x30')](_0x40484b);if(_0x51c612[_0xf2bb('0x34')]){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x34')]]=_0x5af443;_[_0xf2bb('0x37')](_0x3638b7[_0xf2bb('0x39')],_0x44af0b);}return _0xb1da88['sobject'](_0xf2bb('0x3a'))[_0xf2bb('0x25')](_0x3638b7,_0x2ccf79);case _0xf2bb('0x1a'):var _0x2a1ccb=_['cloneDeep'](_0x40484b);if(_0x51c612['additionalSearchAccount']){var _0x44af0b={};_0x44af0b[_0x51c612[_0xf2bb('0x36')]]=_0x5af443;_['merge'](_0x2a1ccb[_0xf2bb('0x39')],_0x44af0b);}return _0xb1da88[_0xf2bb('0x20')](_0xf2bb('0x38'))[_0xf2bb('0x25')](_0x2a1ccb,_0x2ccf79);default:return null;}})[_0xf2bb('0x23')](function(_0x49aaa1){if(_0x49aaa1&&_0x49aaa1[_0xf2bb('0x24')]){var _0x9e3798=_[_0xf2bb('0x3b')](_0x49aaa1);if(_0x9e3798){return BPromise[_0xf2bb('0x28')]({'id':_0x9e3798['Id'],'name':_0x9e3798[_0xf2bb('0x29')],'phone':_0x9e3798['Phone'],'endUserType':_0x9e3798[_0xf2bb('0x3c')][_0xf2bb('0x3d')][_0xf2bb('0x3e')]()});}}})[_0xf2bb('0x23')](function(_0x5a6a52){if(_0x5a6a52){logger[_0xf2bb('0x27')](_0xf2bb('0x3f'),_0x5a6a52[_0xf2bb('0x19')],_0x5af443);return BPromise[_0xf2bb('0x28')](_0x5a6a52);}else{logger[_0xf2bb('0x27')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x5af443);var _0x54dcea={'Phone':_0x5af443};if(_0x51c612[_0xf2bb('0x40')]){if(_0x51c612[_0xf2bb('0x40')]===_0xf2bb('0x16')){logger[_0xf2bb('0x27')](_0xf2bb('0x41'),_0x5af443,_0x51c612[_0xf2bb('0x40')]);_0x54dcea[_0xf2bb('0x42')]=_0x4ca70c!==_0xf2bb('0x43')?_0x4ca70c:util['format'](_0xf2bb('0x44'),_0x5af443);}else if(_0x51c612[_0xf2bb('0x40')]==='lead'){logger[_0xf2bb('0x27')](_0xf2bb('0x41'),_0x5af443,_0x51c612[_0xf2bb('0x40')]);_0x54dcea[_0xf2bb('0x42')]=_0x4ca70c!==_0xf2bb('0x43')?_0x4ca70c:util['format'](_0xf2bb('0x44'),_0x5af443);_0x54dcea[_0xf2bb('0x45')]=_0xf2bb('0x46');}else if(_0x51c612[_0xf2bb('0x40')]==='account'){logger['info'](_0xf2bb('0x41'),_0x5af443,_0x51c612[_0xf2bb('0x40')]);_0x54dcea[_0xf2bb('0x29')]=_0x4ca70c!==_0xf2bb('0x43')?_0x4ca70c:util['format'](_0xf2bb('0x44'),_0x5af443);}else{return null;}}return _0xb1da88[_0xf2bb('0x20')](_[_0xf2bb('0x47')](_0x51c612[_0xf2bb('0x40')]))[_0xf2bb('0x21')](_0x54dcea)[_0xf2bb('0x23')](function(_0x33b23f){return BPromise['resolve']({'id':_0x33b23f['id'],'endUserType':_0x51c612[_0xf2bb('0x40')]});});}});}function getCustomFields(_0xe80421,_0x14413b){var _0x36e514={};if(_0xe80421[_0xf2bb('0x24')]>0x0){_[_0xf2bb('0x48')](_0xe80421,function(_0x72a247){if(_[_0xf2bb('0x49')]([_0xf2bb('0x4a'),_0xf2bb('0x4b')],_0x72a247[_0xf2bb('0x3d')])&&_0x72a247['idField']){_0x36e514[_0x72a247[_0xf2bb('0x4c')]]=_0x72a247[_0xf2bb('0x4d')][_0xf2bb('0x4e')]();}else if(_0x72a247['type']===_0xf2bb('0x4f')&&_0x72a247[_0xf2bb('0x50')]&&_0x72a247[_0xf2bb('0x4c')]){_0x14413b[_0x72a247['variableName']]&&(_0x36e514[_0x72a247['idField']]=_0x14413b[_0x72a247[_0xf2bb('0x50')]][_0xf2bb('0x4e')]());}else if(_0x72a247[_0xf2bb('0x3d')]===_0xf2bb('0x51')&&_0x72a247[_0xf2bb('0x52')]&&_0x72a247[_0xf2bb('0x52')][_0xf2bb('0x53')]&&_0x72a247[_0xf2bb('0x4c')]){_0x14413b[_0x72a247[_0xf2bb('0x52')]['name'][_0xf2bb('0x3e')]()]&&(_0x36e514[_0x72a247[_0xf2bb('0x4c')]]=_0x14413b[_0x72a247[_0xf2bb('0x52')][_0xf2bb('0x53')][_0xf2bb('0x3e')]()][_0xf2bb('0x4e')]());}});}return _0x36e514;}function getConnection(_0x58cbc3){var _0x2833a0=_0x58cbc3[_0xf2bb('0x54')][_0xf2bb('0x55')](_0x58cbc3[_0xf2bb('0x56')]);var _0x40daf2=new jsforce[(_0xf2bb('0x57'))]({'oauth2':{'loginUrl':_0x58cbc3[_0xf2bb('0x58')]||'https://login.salesforce.com','clientId':_0x58cbc3[_0xf2bb('0x59')],'clientSecret':_0x58cbc3['clientSecret']}});return _0x40daf2[_0xf2bb('0x5a')](_0x58cbc3[_0xf2bb('0x5b')],_0x2833a0)[_0xf2bb('0x23')](function(){logger['info'](_0xf2bb('0x5c'));return _0x40daf2;});}exports[_0xf2bb('0x5d')]=function(_0x3208f7,_0x308008,_0x6f86bb,_0x4eb469,_0x3fc9e4,_0x5bede4){var _0x534ecf,_0x937446,_0x1f8aa3,_0xc7dfd8;_0x5bede4[_0xf2bb('0x5e')]=intUtil[_0xf2bb('0x5f')](_0x5bede4[_0xf2bb('0x5e')]);_0x5bede4[_0xf2bb('0x58')]=intUtil[_0xf2bb('0x5f')](_0x5bede4[_0xf2bb('0x58')]);if(_0x3fc9e4&&_0x3fc9e4[_0xf2bb('0x60')]){logger[_0xf2bb('0x27')](_0xf2bb('0x61'),'Recording\x20is\x20enabled!');_0x308008['recordingURL']=util[_0xf2bb('0x62')](_0xf2bb('0x63'),_0x5bede4['serverUrl'],_0x308008[_0xf2bb('0x64')],md5(_0x308008[_0xf2bb('0x64')]));}else{_0x308008[_0xf2bb('0x65')]='';}return getConnection(_0x5bede4)[_0xf2bb('0x23')](function(_0x2033b9){_0xc7dfd8=_0x2033b9;return getUser(_0x5bede4,_0x4eb469['email'],_0xc7dfd8);})[_0xf2bb('0x23')](function(_0x2bcd5a){_0x534ecf=_0x2bcd5a;return getEndUser(_0x5bede4,_0x6f86bb,_0x308008[_0xf2bb('0x66')],_0x308008[_0xf2bb('0x67')],_0xc7dfd8);})[_0xf2bb('0x23')](function(_0x2da539){_0x937446=_0x2da539;return getTicket(_0x5bede4,_0x534ecf,_0x937446,_0x6f86bb,_0x308008,_0x6f86bb['Fields'],_0xc7dfd8,_0xf2bb('0x5d'));})[_0xf2bb('0x23')](function(_0x4bdff7){_0x1f8aa3=_0x4bdff7;logger[_0xf2bb('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x1f8aa3['id']);logger[_0xf2bb('0x27')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1f8aa3['id'],_0x4eb469[_0xf2bb('0x53')],_0x5bede4['type']);switch(_0x5bede4['type']){case _0xf2bb('0x68'):emit(util[_0xf2bb('0x62')]('user:%s',_0x4eb469[_0xf2bb('0x53')]),'trigger:salesforce:display',{'recordId':_0x1f8aa3['id']});break;case'newTab':emit(util[_0xf2bb('0x62')](_0xf2bb('0x69'),_0x4eb469[_0xf2bb('0x53')]),_0xf2bb('0x6a'),{'uri':util[_0xf2bb('0x62')](_0xf2bb('0x6b'),_0xc7dfd8['instanceUrl'],_0x1f8aa3['id'])});break;default:logger[_0xf2bb('0x6c')](_0xf2bb('0x6d'));}})[_0xf2bb('0x6e')](function(_0x1b353a){logger['error'](_0xf2bb('0x61'),_0x1b353a);});};exports[_0xf2bb('0x6f')]=function(_0x4c890f,_0x1ea68d,_0x57b6d0,_0x1fac3f,_0x304593,_0x307ed1,_0x5a9d78){var _0x4bd398,_0x35ff8e,_0x2e9b0e,_0x360c04;_0x307ed1['serverUrl']=intUtil['stripTrailingSlash'](_0x307ed1[_0xf2bb('0x5e')]);_0x307ed1['remoteUri']=intUtil['stripTrailingSlash'](_0x307ed1[_0xf2bb('0x58')]);if(_0x5a9d78&&_0x5a9d78[_0xf2bb('0x70')]&&_0x5a9d78[_0xf2bb('0x70')]!==_0xf2bb('0x71')){logger['info'](_0xf2bb('0x72'),_0xf2bb('0x73'));_0x1ea68d[_0xf2bb('0x65')]=util['format'](_0xf2bb('0x63'),_0x307ed1[_0xf2bb('0x5e')],_0x1ea68d[_0xf2bb('0x64')],md5(_0x1ea68d[_0xf2bb('0x64')]));}return getConnection(_0x307ed1)[_0xf2bb('0x23')](function(_0xcd695c){_0x360c04=_0xcd695c;return getUser(_0x307ed1,_0x1fac3f[_0xf2bb('0x74')],_0x360c04);})['then'](function(_0xcd675f){_0x4bd398=_0xcd675f;return getEndUser(_0x307ed1,_0x57b6d0,_0x1ea68d[_0xf2bb('0x75')],_0x1ea68d[_0xf2bb('0x76')],_0x360c04);})['then'](function(_0x5e0ff1){_0x35ff8e=_0x5e0ff1;return getTicket(_0x307ed1,_0x4bd398,_0x35ff8e,_0x57b6d0,_0x1ea68d,_0x57b6d0[_0xf2bb('0x77')],_0x360c04,_0xf2bb('0x6f'));})['then'](function(_0x583a11){_0x2e9b0e=_0x583a11;logger[_0xf2bb('0x27')](_0xf2bb('0x78'),_0x2e9b0e['id']);logger[_0xf2bb('0x27')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2e9b0e['id'],_0x1fac3f['name'],_0x307ed1[_0xf2bb('0x3d')]);switch(_0x307ed1[_0xf2bb('0x3d')]){case _0xf2bb('0x68'):emit(util[_0xf2bb('0x62')](_0xf2bb('0x69'),_0x1fac3f[_0xf2bb('0x53')]),_0xf2bb('0x79'),{'recordId':_0x2e9b0e['id']});break;case _0xf2bb('0x7a'):emit(util['format'](_0xf2bb('0x69'),_0x1fac3f['name']),_0xf2bb('0x6a'),{'uri':util[_0xf2bb('0x62')](_0xf2bb('0x6b'),_0x360c04['instanceUrl'],_0x2e9b0e['id'])});break;default:logger[_0xf2bb('0x6c')](_0xf2bb('0x72'),_0xf2bb('0x7b'));}})[_0xf2bb('0x6e')](function(_0x36365e){logger[_0xf2bb('0x6c')](_0xf2bb('0x72'),_0x36365e);});};exports['unmanaged']=function(_0x27571f,_0x103d87,_0x294d24,_0x3dd8b6,_0x4c7bc7,_0x39d060){var _0x5b076c,_0x4eedcf,_0x4671e2,_0x189bc5;_0x39d060[_0xf2bb('0x5e')]=intUtil[_0xf2bb('0x5f')](_0x39d060[_0xf2bb('0x5e')]);_0x39d060[_0xf2bb('0x58')]=intUtil['stripTrailingSlash'](_0x39d060['remoteUri']);if(_0x4c7bc7&&_0x4c7bc7[_0xf2bb('0x60')]){logger[_0xf2bb('0x27')]('['+_0x103d87[_0xf2bb('0x7c')][_0xf2bb('0x7d')]()+']',_0xf2bb('0x73'));_0x103d87[_0xf2bb('0x65')]=util[_0xf2bb('0x62')](_0xf2bb('0x63'),_0x39d060[_0xf2bb('0x5e')],_0x103d87[_0xf2bb('0x64')],md5(_0x103d87['uniqueid']));}else{_0x103d87[_0xf2bb('0x65')]='';}return getConnection(_0x39d060)[_0xf2bb('0x23')](function(_0x37717a){_0x189bc5=_0x37717a;if(!_[_0xf2bb('0x7e')](_0x3dd8b6)){return getUser(_0x39d060,_0x3dd8b6[_0xf2bb('0x53')],_0x189bc5);}else{return getUser(_0x39d060,null,_0x189bc5);}})[_0xf2bb('0x23')](function(_0x385448){_0x5b076c=_0x385448;return getEndUser(_0x39d060,_0x294d24,_0x103d87[_0xf2bb('0x66')],_0x103d87[_0xf2bb('0x67')],_0x189bc5);})['then'](function(_0x2d16f4){_0x4eedcf=_0x2d16f4;return getTicket(_0x39d060,_0x5b076c,_0x4eedcf,_0x294d24,_0x103d87,_0x294d24['Fields'],_0x189bc5);})['then'](function(_0x11df3e){_0x4671e2=_0x11df3e;logger[_0xf2bb('0x27')]('['+_0x103d87['lastevent'][_0xf2bb('0x7d')]()+']\x20Ticket\x20%s\x20created.',_0x4671e2['id']);logger[_0xf2bb('0x27')]('['+_0x103d87['lastevent'][_0xf2bb('0x7d')]()+_0xf2bb('0x7f'),_0x39d060[_0xf2bb('0x3d')]);})[_0xf2bb('0x6e')](function(_0x9a49b5){logger['error']('['+_0x103d87[_0xf2bb('0x7c')]['toUpperCase']()+']',_0x9a49b5);});}; \ No newline at end of file +var _0xcb51=['contact','lead','WhoId','WhatId','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','then','length','Email','Agent\x20%s\x20found.','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','$or','cloneDeep','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','execute','first','Name','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','','Caller\x20-\x20%s','Company','No\x20Company','format','upperFirst','forEach','includes','string','idField','content','variable','variableName','toString','customVariable','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','monitor_format','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','defaults','localhost','assign','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType'];(function(_0x5f55c7,_0x4d5e85){var _0x5c254a=function(_0x28fcfe){while(--_0x28fcfe){_0x5f55c7['push'](_0x5f55c7['shift']());}};_0x5c254a(++_0x4d5e85);}(_0xcb51,0x163));var _0x1cb5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xcb51[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x1cb5('0x0'));var rp=require(_0x1cb5('0x1'));var moment=require(_0x1cb5('0x2'));var BPromise=require(_0x1cb5('0x3'));var md5=require(_0x1cb5('0x4'));var jsforce=require(_0x1cb5('0x5'));var util=require(_0x1cb5('0x6'));var Redis=require(_0x1cb5('0x7'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x1cb5('0x8'))(_0x1cb5('0x9'));config[_0x1cb5('0xa')]=_[_0x1cb5('0xb')](config['redis'],{'host':_0x1cb5('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1cb5('0xa')]));function emit(_0x2f9310,_0x140d42,_0x5f574c){io['to'](_0x2f9310)['emit'](_0x140d42,_0x5f574c);}function getTicket(_0xd27427,_0x5c6e46,_0x3f93da,_0x7ce7e,_0x522285,_0x484d5b,_0x463559,_0x566f10){var _0x4c38fb=Object[_0x1cb5('0xd')]({},{'OwnerId':_0x5c6e46['id'],'Subject':intUtil['getString'](_0x7ce7e[_0x1cb5('0xe')],_0x522285,'\x20'),'Description':intUtil['getString'](_0x7ce7e[_0x1cb5('0xf')],_0x522285,'\x0a')},getCustomFields(_0x484d5b,_0x522285));if(_0x3f93da){if(_0x7ce7e[_0x1cb5('0x10')]===_0x1cb5('0x11')){_0x4c38fb[_0x1cb5('0x12')]=moment[_0x1cb5('0x13')]();_0x4c38fb[_0x1cb5('0x14')]=![];_0x4c38fb[_0x1cb5('0x15')]=![];if(_0x3f93da[_0x1cb5('0x16')]===_0x1cb5('0x17')||_0x3f93da[_0x1cb5('0x16')]===_0x1cb5('0x18')){_0x4c38fb[_0x1cb5('0x19')]=_0x3f93da['id'];}else if(_0x3f93da[_0x1cb5('0x16')]==='account'){_0x4c38fb[_0x1cb5('0x1a')]=_0x3f93da['id'];}}else if(_0x7ce7e[_0x1cb5('0x10')]==='Case'){if(_0x3f93da[_0x1cb5('0x16')]===_0x1cb5('0x17')){_0x4c38fb[_0x1cb5('0x1b')]=_0x3f93da['id'];}else if(_0x3f93da[_0x1cb5('0x16')]===_0x1cb5('0x1c')){_0x4c38fb[_0x1cb5('0x1d')]=_0x3f93da['id'];}else if(_0x3f93da['endUserType']===_0x1cb5('0x18')&&_0x7ce7e[_0x1cb5('0x1e')]){_0x4c38fb[_0x7ce7e[_0x1cb5('0x1e')]]=_0x3f93da['id'];}else{logger[_0x1cb5('0x1f')](_0x1cb5('0x20'));}}}return _0x463559[_0x1cb5('0x21')](_0x7ce7e[_0x1cb5('0x10')])[_0x1cb5('0x22')](_0x4c38fb);}function getUser(_0x3e6f3e,_0x30086d,_0x43d918){if(!_[_0x1cb5('0x23')](_0x30086d)&&intUtil['validateEmail'](_0x30086d)){var _0xb851ac={'Email':_0x30086d};var _0x5399ec={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x43d918[_0x1cb5('0x21')](_0x1cb5('0x24'))[_0x1cb5('0x25')](_0xb851ac,_0x5399ec)['execute']()[_0x1cb5('0x26')](function(_0x3771f4){if(_0x3771f4[_0x1cb5('0x27')]){var _0x3b516c=_[_0x1cb5('0x25')](_0x3771f4,function(_0x3c5c4d){return _0x3c5c4d[_0x1cb5('0x28')]===_0x30086d;});if(_0x3b516c){logger['info'](_0x1cb5('0x29'),_0x30086d);return BPromise['resolve']({'id':_0x3b516c['Id'],'name':_0x3b516c['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x30086d);return _0x43d918['identity']()[_0x1cb5('0x26')](function(_0x3667a4){return BPromise['resolve']({'id':_0x3667a4[_0x1cb5('0x2a')],'name':_0x3667a4['display_name']});});}});}else{logger[_0x1cb5('0x1f')](_0x1cb5('0x2b'),_0x30086d);return _0x43d918[_0x1cb5('0x2c')]()[_0x1cb5('0x26')](function(_0x4bffb3){return BPromise[_0x1cb5('0x2d')]({'id':_0x4bffb3[_0x1cb5('0x2a')],'name':_0x4bffb3[_0x1cb5('0x2e')]});});}}function getEndUser(_0x44581c,_0x4ec99f,_0x1b0e7,_0x38b57c,_0x1d317e){var _0x26a7d9={'$or':{'Phone':_0x38b57c}};var _0x18e78d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1cb5('0x2d')]()[_0x1cb5('0x26')](function(){logger['info'](_0x1cb5('0x2f'),_0x38b57c,_0x4ec99f[_0x1cb5('0x30')]);switch(_0x4ec99f[_0x1cb5('0x30')]){case'contact_lead':var _0x2fc6ab=_['cloneDeep'](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x31')]){var _0x5317f2={};_0x5317f2[_0x4ec99f[_0x1cb5('0x31')]]=_0x38b57c;_['merge'](_0x2fc6ab[_0x1cb5('0x32')],_0x5317f2);}return _0x1d317e[_0x1cb5('0x21')]('Contact')['find'](_0x2fc6ab,_0x18e78d)['execute']()[_0x1cb5('0x26')](function(_0x316226){if(_0x316226&&_0x316226[_0x1cb5('0x27')]){return _0x316226;}else{var _0x558d70=_[_0x1cb5('0x33')](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x34')]){var _0x5a0205={};_0x5a0205[_0x4ec99f['additionalSearchLead']]=_0x38b57c;_[_0x1cb5('0x35')](_0x558d70[_0x1cb5('0x32')],_0x5a0205);}return _0x1d317e['sobject'](_0x1cb5('0x36'))['find'](_0x558d70,_0x18e78d);}});case _0x1cb5('0x37'):var _0x40861c=_['cloneDeep'](_0x26a7d9);if(_0x4ec99f['additionalSearchAccount']){var _0x5317f2={};_0x5317f2[_0x4ec99f[_0x1cb5('0x38')]]=_0x38b57c;_[_0x1cb5('0x35')](_0x40861c[_0x1cb5('0x32')],_0x5317f2);}return _0x1d317e['sobject'](_0x1cb5('0x39'))[_0x1cb5('0x25')](_0x40861c,_0x18e78d)['execute']()['then'](function(_0x15237c){if(_0x15237c&&_0x15237c['length']){return _0x15237c;}else{var _0x3b2cff=_[_0x1cb5('0x33')](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x31')]){var _0x4b88ed={};_0x4b88ed[_0x4ec99f[_0x1cb5('0x31')]]=_0x38b57c;_[_0x1cb5('0x35')](_0x3b2cff[_0x1cb5('0x32')],_0x4b88ed);}return _0x1d317e[_0x1cb5('0x21')]('Contact')['find'](_0x3b2cff,_0x18e78d)['then'](function(_0x387432){if(_0x387432&&_0x387432['length']){return _0x387432;}else{var _0x22aca1=_[_0x1cb5('0x33')](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x34')]){var _0x4e8165={};_0x4e8165[_0x4ec99f['additionalSearchLead']]=_0x38b57c;_[_0x1cb5('0x35')](_0x22aca1[_0x1cb5('0x32')],_0x4e8165);}return _0x1d317e[_0x1cb5('0x21')](_0x1cb5('0x36'))[_0x1cb5('0x25')](_0x22aca1,_0x18e78d);}});}});case'contact':var _0x2fc6ab=_['cloneDeep'](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x31')]){var _0x5317f2={};_0x5317f2[_0x4ec99f[_0x1cb5('0x31')]]=_0x38b57c;_[_0x1cb5('0x35')](_0x2fc6ab[_0x1cb5('0x32')],_0x5317f2);}return _0x1d317e[_0x1cb5('0x21')](_0x1cb5('0x3a'))[_0x1cb5('0x25')](_0x2fc6ab,_0x18e78d)[_0x1cb5('0x3b')]();case _0x1cb5('0x18'):var _0x1a7e07=_[_0x1cb5('0x33')](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x34')]){var _0x5317f2={};_0x5317f2[_0x4ec99f[_0x1cb5('0x34')]]=_0x38b57c;_[_0x1cb5('0x35')](_0x1a7e07[_0x1cb5('0x32')],_0x5317f2);}return _0x1d317e['sobject']('Lead')[_0x1cb5('0x25')](_0x1a7e07,_0x18e78d);case _0x1cb5('0x1c'):var _0x40861c=_[_0x1cb5('0x33')](_0x26a7d9);if(_0x4ec99f[_0x1cb5('0x38')]){var _0x5317f2={};_0x5317f2[_0x4ec99f[_0x1cb5('0x38')]]=_0x38b57c;_['merge'](_0x40861c[_0x1cb5('0x32')],_0x5317f2);}return _0x1d317e[_0x1cb5('0x21')]('Account')[_0x1cb5('0x25')](_0x40861c,_0x18e78d);default:return null;}})[_0x1cb5('0x26')](function(_0x4d5367){if(_0x4d5367&&_0x4d5367[_0x1cb5('0x27')]){var _0x1b1373=_[_0x1cb5('0x3c')](_0x4d5367);if(_0x1b1373){return BPromise[_0x1cb5('0x2d')]({'id':_0x1b1373['Id'],'name':_0x1b1373[_0x1cb5('0x3d')],'phone':_0x1b1373[_0x1cb5('0x3e')],'endUserType':_0x1b1373[_0x1cb5('0x3f')][_0x1cb5('0x40')][_0x1cb5('0x41')]()});}}})[_0x1cb5('0x26')](function(_0x5a8951){if(_0x5a8951){logger[_0x1cb5('0x1f')](_0x1cb5('0x42'),_0x5a8951[_0x1cb5('0x16')],_0x38b57c);return BPromise['resolve'](_0x5a8951);}else{logger[_0x1cb5('0x1f')](_0x1cb5('0x43'),_0x38b57c);var _0x350259={'Phone':_0x38b57c};if(_0x4ec99f[_0x1cb5('0x44')]){if(_0x4ec99f[_0x1cb5('0x44')]===_0x1cb5('0x17')){logger['info'](_0x1cb5('0x45'),_0x38b57c,_0x4ec99f['moduleCreate']);_0x350259[_0x1cb5('0x46')]=_0x1b0e7!==_0x1cb5('0x47')?_0x1b0e7:util['format'](_0x1cb5('0x48'),_0x38b57c);}else if(_0x4ec99f[_0x1cb5('0x44')]===_0x1cb5('0x18')){logger[_0x1cb5('0x1f')](_0x1cb5('0x45'),_0x38b57c,_0x4ec99f[_0x1cb5('0x44')]);_0x350259['LastName']=_0x1b0e7!==_0x1cb5('0x47')?_0x1b0e7:util['format'](_0x1cb5('0x48'),_0x38b57c);_0x350259[_0x1cb5('0x49')]=_0x1cb5('0x4a');}else if(_0x4ec99f[_0x1cb5('0x44')]===_0x1cb5('0x1c')){logger[_0x1cb5('0x1f')](_0x1cb5('0x45'),_0x38b57c,_0x4ec99f[_0x1cb5('0x44')]);_0x350259[_0x1cb5('0x3d')]=_0x1b0e7!==_0x1cb5('0x47')?_0x1b0e7:util[_0x1cb5('0x4b')]('Caller\x20-\x20%s',_0x38b57c);}else{return null;}}return _0x1d317e[_0x1cb5('0x21')](_[_0x1cb5('0x4c')](_0x4ec99f[_0x1cb5('0x44')]))[_0x1cb5('0x22')](_0x350259)[_0x1cb5('0x26')](function(_0xabe7a3){return BPromise[_0x1cb5('0x2d')]({'id':_0xabe7a3['id'],'endUserType':_0x4ec99f[_0x1cb5('0x44')]});});}});}function getCustomFields(_0x4fcb2,_0x16c348){var _0x52f1e0={};if(_0x4fcb2['length']>0x0){_[_0x1cb5('0x4d')](_0x4fcb2,function(_0x4f566f){if(_[_0x1cb5('0x4e')]([_0x1cb5('0x4f'),'picklist'],_0x4f566f[_0x1cb5('0x40')])&&_0x4f566f[_0x1cb5('0x50')]){_0x52f1e0[_0x4f566f[_0x1cb5('0x50')]]=_0x4f566f[_0x1cb5('0x51')]['toString']();}else if(_0x4f566f[_0x1cb5('0x40')]===_0x1cb5('0x52')&&_0x4f566f[_0x1cb5('0x53')]&&_0x4f566f[_0x1cb5('0x50')]){_0x16c348[_0x4f566f[_0x1cb5('0x53')]]&&(_0x52f1e0[_0x4f566f[_0x1cb5('0x50')]]=_0x16c348[_0x4f566f[_0x1cb5('0x53')]][_0x1cb5('0x54')]());}else if(_0x4f566f[_0x1cb5('0x40')]===_0x1cb5('0x55')&&_0x4f566f[_0x1cb5('0x56')]&&_0x4f566f[_0x1cb5('0x56')][_0x1cb5('0x57')]&&_0x4f566f[_0x1cb5('0x50')]){_0x16c348[_0x4f566f[_0x1cb5('0x56')][_0x1cb5('0x57')]['toLowerCase']()]&&(_0x52f1e0[_0x4f566f['idField']]=_0x16c348[_0x4f566f['Variable'][_0x1cb5('0x57')][_0x1cb5('0x41')]()][_0x1cb5('0x54')]());}});}return _0x52f1e0;}function getConnection(_0x5816ca){var _0x2566a4=_0x5816ca[_0x1cb5('0x58')]['concat'](_0x5816ca[_0x1cb5('0x59')]);var _0xc24a13=new jsforce[(_0x1cb5('0x5a'))]({'oauth2':{'loginUrl':_0x5816ca[_0x1cb5('0x5b')]||_0x1cb5('0x5c'),'clientId':_0x5816ca[_0x1cb5('0x5d')],'clientSecret':_0x5816ca[_0x1cb5('0x5e')]}});return _0xc24a13['login'](_0x5816ca[_0x1cb5('0x5f')],_0x2566a4)[_0x1cb5('0x26')](function(){logger[_0x1cb5('0x1f')](_0x1cb5('0x60'));return _0xc24a13;});}exports['queue']=function(_0x165bc2,_0x3c8d38,_0x4493d4,_0xa0ccd6,_0x148bb1,_0x455472){var _0x3c317b,_0x179a8f,_0x173c7c,_0x26b823;_0x455472[_0x1cb5('0x61')]=intUtil[_0x1cb5('0x62')](_0x455472[_0x1cb5('0x61')]);_0x455472[_0x1cb5('0x5b')]=intUtil[_0x1cb5('0x62')](_0x455472['remoteUri']);if(_0x148bb1&&_0x148bb1['monitor_format']){logger[_0x1cb5('0x1f')](_0x1cb5('0x63'),_0x1cb5('0x64'));_0x3c8d38[_0x1cb5('0x65')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x455472['serverUrl'],_0x3c8d38[_0x1cb5('0x66')],md5(_0x3c8d38[_0x1cb5('0x66')]));}else{_0x3c8d38[_0x1cb5('0x65')]='';}return getConnection(_0x455472)[_0x1cb5('0x26')](function(_0x3dbec9){_0x26b823=_0x3dbec9;return getUser(_0x455472,_0xa0ccd6['email'],_0x26b823);})[_0x1cb5('0x26')](function(_0x30bbbb){_0x3c317b=_0x30bbbb;return getEndUser(_0x455472,_0x4493d4,_0x3c8d38['calleridname'],_0x3c8d38[_0x1cb5('0x67')],_0x26b823);})[_0x1cb5('0x26')](function(_0x5d4e79){_0x179a8f=_0x5d4e79;return getTicket(_0x455472,_0x3c317b,_0x179a8f,_0x4493d4,_0x3c8d38,_0x4493d4[_0x1cb5('0x68')],_0x26b823,'queue');})[_0x1cb5('0x26')](function(_0x30dfb4){_0x173c7c=_0x30dfb4;logger[_0x1cb5('0x1f')](_0x1cb5('0x69'),_0x173c7c['id']);logger[_0x1cb5('0x1f')](_0x1cb5('0x6a'),_0x173c7c['id'],_0xa0ccd6['name'],_0x455472['type']);switch(_0x455472[_0x1cb5('0x40')]){case _0x1cb5('0x6b'):emit(util[_0x1cb5('0x4b')](_0x1cb5('0x6c'),_0xa0ccd6['name']),_0x1cb5('0x6d'),{'recordId':_0x173c7c['id']});break;case _0x1cb5('0x6e'):emit(util[_0x1cb5('0x4b')](_0x1cb5('0x6c'),_0xa0ccd6[_0x1cb5('0x57')]),_0x1cb5('0x6f'),{'uri':util[_0x1cb5('0x4b')](_0x1cb5('0x70'),_0x26b823[_0x1cb5('0x71')],_0x173c7c['id'])});break;default:logger[_0x1cb5('0x72')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x1cb5('0x73')](function(_0x3930e6){logger[_0x1cb5('0x72')](_0x1cb5('0x63'),_0x3930e6);});};exports['outbound']=function(_0x85e2ff,_0x4df09f,_0x30eb9e,_0xc43c4e,_0x5594b4,_0x9189ac,_0x5187d0){var _0x2a397a,_0x33d21b,_0x42ab99,_0x62d492;_0x9189ac['serverUrl']=intUtil[_0x1cb5('0x62')](_0x9189ac[_0x1cb5('0x61')]);_0x9189ac[_0x1cb5('0x5b')]=intUtil[_0x1cb5('0x62')](_0x9189ac[_0x1cb5('0x5b')]);if(_0x5187d0&&_0x5187d0['recordingFormat']&&_0x5187d0['recordingFormat']!=='none'){logger[_0x1cb5('0x1f')](_0x1cb5('0x74'),_0x1cb5('0x64'));_0x4df09f[_0x1cb5('0x65')]=util[_0x1cb5('0x4b')](_0x1cb5('0x75'),_0x9189ac['serverUrl'],_0x4df09f['uniqueid'],md5(_0x4df09f['uniqueid']));}return getConnection(_0x9189ac)[_0x1cb5('0x26')](function(_0x342e73){_0x62d492=_0x342e73;return getUser(_0x9189ac,_0xc43c4e['email'],_0x62d492);})[_0x1cb5('0x26')](function(_0xa54fca){_0x2a397a=_0xa54fca;return getEndUser(_0x9189ac,_0x30eb9e,_0x4df09f['destcalleridname'],_0x4df09f[_0x1cb5('0x76')],_0x62d492);})[_0x1cb5('0x26')](function(_0x4c9834){_0x33d21b=_0x4c9834;return getTicket(_0x9189ac,_0x2a397a,_0x33d21b,_0x30eb9e,_0x4df09f,_0x30eb9e[_0x1cb5('0x68')],_0x62d492,'outbound');})[_0x1cb5('0x26')](function(_0x4b942d){_0x42ab99=_0x4b942d;logger['info'](_0x1cb5('0x77'),_0x42ab99['id']);logger[_0x1cb5('0x1f')](_0x1cb5('0x78'),_0x42ab99['id'],_0xc43c4e['name'],_0x9189ac['type']);switch(_0x9189ac[_0x1cb5('0x40')]){case _0x1cb5('0x6b'):emit(util['format'](_0x1cb5('0x6c'),_0xc43c4e[_0x1cb5('0x57')]),_0x1cb5('0x6d'),{'recordId':_0x42ab99['id']});break;case _0x1cb5('0x6e'):emit(util['format']('user:%s',_0xc43c4e[_0x1cb5('0x57')]),_0x1cb5('0x6f'),{'uri':util[_0x1cb5('0x4b')](_0x1cb5('0x70'),_0x62d492['instanceUrl'],_0x42ab99['id'])});break;default:logger[_0x1cb5('0x72')](_0x1cb5('0x74'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x1cb5('0x73')](function(_0x18a7b8){logger['error'](_0x1cb5('0x74'),_0x18a7b8);});};exports['unmanaged']=function(_0x244010,_0x490d85,_0xf7817b,_0x4d1539,_0x186b53,_0x3b9f10){var _0x38dff2,_0x1f6d27,_0x596eaf,_0x4a9a9b;_0x3b9f10[_0x1cb5('0x61')]=intUtil[_0x1cb5('0x62')](_0x3b9f10[_0x1cb5('0x61')]);_0x3b9f10[_0x1cb5('0x5b')]=intUtil['stripTrailingSlash'](_0x3b9f10[_0x1cb5('0x5b')]);if(_0x186b53&&_0x186b53[_0x1cb5('0x79')]){logger['info']('['+_0x490d85[_0x1cb5('0x7a')][_0x1cb5('0x7b')]()+']',_0x1cb5('0x64'));_0x490d85['recordingURL']=util[_0x1cb5('0x4b')](_0x1cb5('0x75'),_0x3b9f10[_0x1cb5('0x61')],_0x490d85[_0x1cb5('0x66')],md5(_0x490d85[_0x1cb5('0x66')]));}else{_0x490d85[_0x1cb5('0x65')]='';}return getConnection(_0x3b9f10)[_0x1cb5('0x26')](function(_0x36f779){_0x4a9a9b=_0x36f779;if(!_[_0x1cb5('0x23')](_0x4d1539)){return getUser(_0x3b9f10,_0x4d1539[_0x1cb5('0x57')],_0x4a9a9b);}else{return getUser(_0x3b9f10,null,_0x4a9a9b);}})['then'](function(_0x2487d9){_0x38dff2=_0x2487d9;return getEndUser(_0x3b9f10,_0xf7817b,_0x490d85[_0x1cb5('0x7c')],_0x490d85['calleridnum'],_0x4a9a9b);})['then'](function(_0x108eff){_0x1f6d27=_0x108eff;return getTicket(_0x3b9f10,_0x38dff2,_0x1f6d27,_0xf7817b,_0x490d85,_0xf7817b['Fields'],_0x4a9a9b);})[_0x1cb5('0x26')](function(_0x1b9b60){_0x596eaf=_0x1b9b60;logger[_0x1cb5('0x1f')]('['+_0x490d85[_0x1cb5('0x7a')][_0x1cb5('0x7b')]()+_0x1cb5('0x7d'),_0x596eaf['id']);logger['info']('['+_0x490d85[_0x1cb5('0x7a')][_0x1cb5('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x3b9f10['type']);})[_0x1cb5('0x73')](function(_0x4541b3){logger[_0x1cb5('0x72')]('['+_0x490d85[_0x1cb5('0x7a')]['toUpperCase']()+']',_0x4541b3);});}; \ 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 1ed2f62..dee7c0d 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 _0xe65b=['Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail','catch',']\x20using\x20admin\x20profile','POST','sys_user?','user','endUserNumber','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','type','customField','toLowerCase','content','toString','string','picklist','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident'];(function(_0x5cdd0f,_0x3c3a5e){var _0x4d4eb8=function(_0x106fef){while(--_0x106fef){_0x5cdd0f['push'](_0x5cdd0f['shift']());}};_0x4d4eb8(++_0x3c3a5e);}(_0xe65b,0x111));var _0xbe65=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe65b[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xbe65('0x0'));var Promise=require(_0xbe65('0x1'));var rp=require(_0xbe65('0x2'));var util=require(_0xbe65('0x3'));var md5=require(_0xbe65('0x4'));var Redis=require(_0xbe65('0x5'));var intUtil=require(_0xbe65('0x6'));var config=require(_0xbe65('0x7'));var logger=require('../../../../config/logger')(_0xbe65('0x8'));config[_0xbe65('0x9')]=_[_0xbe65('0xa')](config['redis'],{'host':_0xbe65('0xb'),'port':0x18eb});var io=require(_0xbe65('0xc'))(new Redis(config[_0xbe65('0x9')]));function getAdminUser(_0x9982b,_0x1fe1df,_0x4de027,_0x4e05f2,_0x5e121e,_0x3d6aaa){return new Promise(function(_0x355a2f,_0x2e3096){var _0x4a8a04={'method':_0xbe65('0xd'),'uri':_0x4e05f2+_0xbe65('0xe')+'&'+_0x5e121e+'&'+_0x3d6aaa,'auth':_0x1fe1df,'json':!![]};return rp(_0x4a8a04)['then'](function(_0x37715f){if(_0x37715f[_0xbe65('0xf')]['length']>0x0){_0x4de027[_0xbe65('0x10')]=_0x37715f[_0xbe65('0xf')][0x0][_0xbe65('0x11')];}logger['info']('['+[_0x9982b[_0xbe65('0x12')]()]+_0xbe65('0x13'),_0x4de027);_0x355a2f(_0x4de027);})['catch'](function(_0x5d00aa){logger[_0xbe65('0x14')]('['+[_0x9982b[_0xbe65('0x12')]()]+']',_0x5d00aa['message']);_0x2e3096(_0x5d00aa[_0xbe65('0x15')]);});});}function getUser(_0x4fb421,_0x320e92,_0x14ff97,_0x15f6fb,_0x51d44a){return function(_0x529d64){logger[_0xbe65('0x16')]('['+[_0x4fb421['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x529d64);return new Promise(function(_0x5cfdd0,_0x2618ca){if(intUtil[_0xbe65('0x17')](_0x529d64['userEmail'])){var _0x2857d9={'method':_0xbe65('0xd'),'uri':_0x14ff97+_0xbe65('0x18')+_0x529d64[_0xbe65('0x19')]+'&'+_0x15f6fb+'&'+_0x51d44a,'auth':_0x320e92,'json':!![]};logger[_0xbe65('0x16')]('['+[_0x4fb421[_0xbe65('0x12')]()]+_0xbe65('0x1a'),_0x2857d9);return rp(_0x2857d9)['then'](function(_0x20f296){logger[_0xbe65('0x16')]('['+[_0x4fb421[_0xbe65('0x12')]()]+_0xbe65('0x1b'),_0x20f296);if(_0x20f296['result'][_0xbe65('0x1c')]>0x0&&String(_0x20f296[_0xbe65('0xf')][0x0][_0xbe65('0x1d')])===_0xbe65('0x1e')){_0x529d64[_0xbe65('0x1f')]=_0x20f296[_0xbe65('0xf')][0x0]['sys_id'];}else{_0x529d64[_0xbe65('0x1f')]=_0x529d64['adminId'];_0x529d64[_0xbe65('0x19')]=_0x529d64[_0xbe65('0x20')];}logger[_0xbe65('0x16')]('['+[_0x4fb421[_0xbe65('0x12')]()]+'],\x20getUser\x20crm',_0x529d64);_0x5cfdd0(_0x529d64);})[_0xbe65('0x21')](function(_0x48b639){logger[_0xbe65('0x14')]('['+[_0x4fb421[_0xbe65('0x12')]()]+']',_0x48b639[_0xbe65('0x15')]);_0x2618ca(_0x48b639['message']);});}else{logger[_0xbe65('0x16')]('['+[_0x4fb421['toUpperCase']()]+_0xbe65('0x22'));_0x529d64['userId']=_0x529d64['adminId'];_0x529d64['userEmail']=_0x529d64[_0xbe65('0x20')];_0x5cfdd0(_0x529d64);}});};}function createEndUser(_0x11a18a,_0x44aba0,_0x23a9cb,_0xc5730d,_0x130689){logger[_0xbe65('0x16')]('['+[_0x11a18a[_0xbe65('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x23a9cb);return new Promise(function(_0x4a6bee,_0x153394){var _0x44425c={'method':_0xbe65('0x23'),'uri':_0xc5730d+_0xbe65('0x24')+_0x130689,'body':{'user_name':_0x23a9cb['endUserNumber'],'roles':_0xbe65('0x25'),'first_name':_0x23a9cb[_0xbe65('0x26')],'active':_0xbe65('0x1e'),'date_format':_0xbe65('0x27'),'phone':_0x23a9cb['endUserNumber']},'auth':_0x44aba0,'json':!![]};return rp(_0x44425c)[_0xbe65('0x28')](function(_0x2deb7e){logger[_0xbe65('0x16')]('['+[_0x11a18a[_0xbe65('0x12')]()]+_0xbe65('0x29'),_0x2deb7e[_0xbe65('0xf')]);_0x23a9cb[_0xbe65('0x2a')]=_0x2deb7e[_0xbe65('0xf')][_0xbe65('0x11')];_0x4a6bee(_0x23a9cb);})['catch'](function(_0x3533c1){logger[_0xbe65('0x14')]('['+[_0x11a18a[_0xbe65('0x12')]()]+']',_0x3533c1['message']);_0x153394(_0x3533c1[_0xbe65('0x15')]);});});}function getEndUser(_0x528559,_0x30042e,_0x3a2ce1,_0x67bc2c,_0x5c81a7){return function(_0x9312cf){logger[_0xbe65('0x16')]('['+[_0x528559[_0xbe65('0x12')]()]+_0xbe65('0x2b'),_0x9312cf);return new Promise(function(_0x267e64,_0x3090be){var _0x5ee0a2={'method':_0xbe65('0xd'),'uri':_0x3a2ce1+_0xbe65('0x2c')+_0x9312cf[_0xbe65('0x26')]+'&'+_0x67bc2c+'&'+_0x5c81a7,'auth':_0x30042e,'json':!![]};return rp(_0x5ee0a2)[_0xbe65('0x28')](function(_0xb4f2da){if(_0xb4f2da['result'][_0xbe65('0x1c')]>0x0){_0x9312cf[_0xbe65('0x2a')]=_0xb4f2da[_0xbe65('0xf')][0x0][_0xbe65('0x11')];logger['info']('['+[_0x528559['toUpperCase']()]+_0xbe65('0x2d'),_0x9312cf);_0x267e64(_0x9312cf);}else{return createEndUser(_0x528559,_0x30042e,_0x9312cf,_0x3a2ce1,_0x67bc2c)[_0xbe65('0x28')](function(_0x2b9c39){logger[_0xbe65('0x16')]('['+[_0x528559[_0xbe65('0x12')]()]+_0xbe65('0x2e'),_0x2b9c39);_0x267e64(_0x2b9c39);});}})['catch'](function(_0x2deb23){logger[_0xbe65('0x14')]('['+[_0x528559[_0xbe65('0x12')]()]+']',_0x2deb23[_0xbe65('0x15')]);_0x3090be(_0x2deb23[_0xbe65('0x15')]);});});};}function getCustomFields(_0x45eeaa,_0x45a4e6){var _0x1b9123={};if(_0x45eeaa[_0xbe65('0x1c')]>0x0){_[_0xbe65('0x2f')](_0x45eeaa,function(_0x124d99){if(_[_0xbe65('0x30')](['string','picklist'],_0x124d99[_0xbe65('0x31')])&&_0x124d99['nameField']&&!_0x124d99[_0xbe65('0x32')]){_0x1b9123[_0x124d99['nameField'][_0xbe65('0x33')]()]=_0x124d99[_0xbe65('0x34')][_0xbe65('0x35')]();}else if(_[_0xbe65('0x30')]([_0xbe65('0x36'),_0xbe65('0x37')],_0x124d99[_0xbe65('0x31')])&&_0x124d99[_0xbe65('0x38')]&&_0x124d99['customField']){_0x1b9123[_0x124d99[_0xbe65('0x38')][_0xbe65('0x33')]()]=_0x124d99[_0xbe65('0x34')][_0xbe65('0x35')]();}else if(_0x124d99['type']===_0xbe65('0x39')&&_0x124d99[_0xbe65('0x3a')]&&_0x124d99['idField']&&_0x124d99[_0xbe65('0x32')]){_0x1b9123[_0x124d99[_0xbe65('0x38')][_0xbe65('0x33')]()]=_0x45a4e6[_0x124d99[_0xbe65('0x3a')]][_0xbe65('0x35')]();}else if(_0x124d99['type']===_0xbe65('0x3b')&&_0x124d99[_0xbe65('0x3c')]&&_0x124d99['Variable']['name']&&_0x124d99[_0xbe65('0x38')]&&_0x124d99[_0xbe65('0x32')]){_0x1b9123[_0x124d99[_0xbe65('0x38')][_0xbe65('0x33')]()]=_0x45a4e6[_0x124d99[_0xbe65('0x3c')][_0xbe65('0x3d')][_0xbe65('0x33')]()]['toString']();}});}return _0x1b9123;}function getTicket(_0x490a8f,_0x5aabcf,_0xb4538c,_0x372fb2,_0x85d4f9,_0x1af4be){return function(_0x9b7438){logger['info']('['+[_0x490a8f[_0xbe65('0x12')]()]+_0xbe65('0x3e'),_0x9b7438);return new Promise(function(_0xd9acbc,_0xda18f9){var _0x4e4bfc=_0x490a8f[_0xbe65('0x33')]()==='outbound'?_0x9b7438[_0xbe65('0x1f')]:_0x9b7438[_0xbe65('0x2a')];var _0x1d9167={'method':_0xbe65('0x23'),'uri':_0xb4538c+_0xbe65('0x3f')+'?'+_0x1af4be,'body':Object[_0xbe65('0x40')]({},{'active':_0xbe65('0x1e'),'caller_id':_0x4e4bfc,'assigned_to':_0x9b7438['userId'],'short_description':intUtil[_0xbe65('0x41')](_0x372fb2['Subjects'],_0x85d4f9,'\x20'),'description':intUtil[_0xbe65('0x41')](_0x372fb2[_0xbe65('0x42')],_0x85d4f9,'\x0a')},getCustomFields(_0x372fb2[_0xbe65('0x43')],_0x85d4f9)),'auth':_0x5aabcf,'json':!![]};return rp(_0x1d9167)[_0xbe65('0x28')](function(_0x5ec625){logger[_0xbe65('0x16')]('['+[_0x490a8f[_0xbe65('0x12')]()]+_0xbe65('0x44'),_0x5ec625[_0xbe65('0xf')]);_0x9b7438[_0xbe65('0x45')]=_0x5ec625[_0xbe65('0xf')][_0xbe65('0x11')];_0x9b7438['ticketNumber']=_0x5ec625[_0xbe65('0xf')][_0xbe65('0x46')];logger[_0xbe65('0x16')]('['+[_0x490a8f[_0xbe65('0x12')]()]+_0xbe65('0x47'),_0x9b7438);_0xd9acbc(_0x9b7438);})[_0xbe65('0x21')](function(_0x142238){logger[_0xbe65('0x14')]('['+[_0x490a8f[_0xbe65('0x12')]()]+']',_0x142238[_0xbe65('0x15')]);_0xda18f9(_0x142238[_0xbe65('0x15')]);});});};}function createRemoteTag(_0x2f7e78,_0x984992,_0x165b6b,_0xac565a){return new Promise(function(_0x18fdd8,_0x4f7a30){var _0x48928d={'method':_0xbe65('0x23'),'uri':_0x165b6b+_0xbe65('0x48')+'?'+_0xac565a,'body':{'short_description':_0x2f7e78,'global':!![],'active':!![],'name':_0x2f7e78},'auth':_0x984992,'json':!![]};return rp(_0x48928d)['then'](function(_0x185e64){var _0x44f0c8=_0x185e64[_0xbe65('0xf')][_0xbe65('0x11')];_0x18fdd8(_0x44f0c8);});});}function getRemoteTag(_0x35598f,_0x550b01,_0xf1f78c,_0x397de7,_0xef1e6c){return new Promise(function(_0x7ff903,_0x5a71fa){var _0x52a183={'method':'GET','uri':_0xf1f78c+'label'+_0xbe65('0x49')+_0x35598f+'&'+_0x397de7,'auth':_0x550b01,'json':!![]};return rp(_0x52a183)['then'](function(_0x3156ff){if(_0x3156ff[_0xbe65('0xf')]['length']>0x0){var _0x4ce34b=_0x3156ff['result'][0x0][_0xbe65('0x11')];_0x7ff903(_0x4ce34b);}else{return createRemoteTag(_0x35598f,_0x550b01,_0xf1f78c,_0x397de7)[_0xbe65('0x28')](function(_0x7255f3){_0x7ff903(_0x7255f3);});}});});}function assignTagToIncident(_0x4475ff,_0x1403de,_0x55646f,_0x2032c9,_0x2bc5af){return new Promise(function(_0x5118dd,_0x1c35e8){var _0x40aeae={'method':_0xbe65('0x23'),'uri':_0x55646f+'label_entry'+'?'+_0x2bc5af,'body':{'label':_0x4475ff,'table':_0xbe65('0x3f'),'id_type':_0xbe65('0x4a'),'table_key':_0x2032c9['ticketId'],'title':_0xbe65('0x4b')+_0x2032c9[_0xbe65('0x4c')],'id_display':_0x2032c9['ticketNumber']},'auth':_0x1403de,'json':!![]};return rp(_0x40aeae)['then'](function(_0x5d6933){_0x5118dd();})[_0xbe65('0x21')](function(){_0x5118dd();});});}function manageTags(_0x341221,_0x5ce253,_0x1589f6,_0xce284b,_0x508b31,_0x2b815e,_0x5b8744){return new Promise(function(_0x2eefd8,_0x3459df){var _0x814e19=[];_0x5ce253['forEach'](function(_0xdb67a4){_0x814e19[_0xbe65('0x4d')](getRemoteTag(_0xdb67a4,_0x1589f6,_0xce284b,_0x2b815e,_0x5b8744));});return Promise[_0xbe65('0x4e')](_0x814e19)[_0xbe65('0x28')](function(_0x1e1a8c){if(_0x1e1a8c['length']){logger['info']('['+[_0x341221[_0xbe65('0x12')]()]+_0xbe65('0x4f'),_0x1e1a8c);var _0x307aa2=[];_0x1e1a8c['forEach'](function(_0x151cef){_0x307aa2[_0xbe65('0x4d')](assignTagToIncident(_0x151cef,_0x1589f6,_0xce284b,_0x508b31,_0x2b815e));});return Promise['all'](_0x307aa2)[_0xbe65('0x28')](function(){_0x2eefd8();})[_0xbe65('0x21')](function(){_0x2eefd8();});}else{_0x2eefd8();}});});}function getTags(_0x496c71,_0x239947,_0x465795,_0x258751,_0x3eb816,_0x1565f1){return function(_0xe8f912){return new Promise(function(_0x30e625,_0x2e490c){var _0x41c9d1=[];var _0x5bba95=_0x258751[_0xbe65('0x50')];if(_0x5bba95&&_0x5bba95['length']>0x0){_0x41c9d1=_[_0xbe65('0x51')](_0x5bba95,'name');}if(_0x41c9d1[_0xbe65('0x1c')]>0x0){return manageTags(_0x496c71,_0x41c9d1,_0x239947,_0x465795,_0xe8f912,_0x3eb816,_0x1565f1)[_0xbe65('0x28')](function(){_0x30e625(_0xe8f912);});}else{_0x30e625(_0xe8f912);}});};}function emit(_0x309bfe,_0x354e5b,_0x3aa1cb){var _0x2afa33=_0xbe65('0x52')+_0xbe65('0x53')+_0xbe65('0x54')+_0xbe65('0x55');var _0x59d373={'uri':_0x309bfe+_0xbe65('0x56')+_0x3aa1cb+_0x2afa33};io['to'](util[_0xbe65('0x57')]('user:%s',_0x354e5b))[_0xbe65('0x58')](_0xbe65('0x59'),_0x59d373);}exports['cs']=function(_0x3bad9f,_0x529b53,_0x153ddf,_0x2f264a,_0x1eb7bd,_0x3a2761,_0x2887e,_0x104bd9){var _0x2cb82b={};var _0x11cf31={'user':_0x3a2761[_0xbe65('0x5a')],'pass':_0x3a2761[_0xbe65('0x5b')]};var _0x20e717='sysparm_limit=1';var _0x798476=_0xbe65('0x5c');_0x3a2761[_0xbe65('0x5d')]=intUtil['stripTrailingSlash'](_0x3a2761['remoteUri']);_0x3a2761[_0xbe65('0x5e')]=intUtil['stripTrailingSlash'](_0x3a2761['serverUrl']);var _0x51b218=util['format'](_0xbe65('0x5f'),_0x3a2761[_0xbe65('0x5d')]);_0x2cb82b[_0xbe65('0x19')]=!_[_0xbe65('0x60')](_0x2f264a)?_0x2f264a[_0xbe65('0x61')]:null;_0x2cb82b[_0xbe65('0x20')]=_0x3a2761[_0xbe65('0x61')];_0x2cb82b[_0xbe65('0x26')]=_0x104bd9[_0xbe65('0x33')]()==='outbound'?_0x529b53[_0xbe65('0x62')]:_0x529b53[_0xbe65('0x63')];_0x2cb82b[_0xbe65('0x64')]=_0x104bd9===_0xbe65('0x65')||_0x104bd9===_0xbe65('0x66')?_0xbe65('0x65'):_0xbe65('0x67');var _0x58d2f6=util[_0xbe65('0x57')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a2761['serverUrl'],_0x529b53[_0xbe65('0x68')],md5(_0x529b53['uniqueid']));if(_0x1eb7bd&&_0x1eb7bd[_0xbe65('0x69')]){logger['info'](_0xbe65('0x6a'),_0xbe65('0x6b'));_0x529b53['recordingURL']=_0x58d2f6;}else if(_0x2887e&&_0x2887e[_0xbe65('0x6c')]&&_0x2887e[_0xbe65('0x6c')]!==_0xbe65('0x6d')){logger[_0xbe65('0x16')](_0xbe65('0x6e'),'Recording\x20is\x20enabled!');_0x529b53[_0xbe65('0x6f')]=_0x58d2f6;}else{_0x529b53[_0xbe65('0x6f')]='';}return getAdminUser(_0x104bd9,_0x11cf31,_0x2cb82b,_0x51b218,_0x798476,_0x20e717)['then'](getUser(_0x104bd9,_0x11cf31,_0x51b218,_0x798476,_0x20e717))[_0xbe65('0x28')](getEndUser(_0x104bd9,_0x11cf31,_0x51b218,_0x798476,_0x20e717))[_0xbe65('0x28')](getTicket(_0x104bd9,_0x11cf31,_0x51b218,_0x153ddf,_0x529b53,_0x798476))[_0xbe65('0x28')](function(_0x275327){logger['info'](util[_0xbe65('0x57')](_0xbe65('0x70'),_0x275327['ticketId']));logger[_0xbe65('0x16')](util[_0xbe65('0x57')](_0xbe65('0x71'),_0x104bd9));if(_0x104bd9!==_0xbe65('0x66')){logger[_0xbe65('0x16')]('['+[_0x104bd9[_0xbe65('0x12')]()]+']',_0xbe65('0x72'));emit(_0x3a2761[_0xbe65('0x5d')],_0x2f264a[_0xbe65('0x3d')],_0x275327['ticketId']);}})[_0xbe65('0x21')](function(_0x4cb3c2){logger['error']('['+[_0x104bd9[_0xbe65('0x12')]()]+_0xbe65('0x73'),util['inspect'](_0x4cb3c2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4172=['user','true','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','picklist','type','customField','nameField','toLowerCase','toString','idField','content','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','serverUrl','%s/api/now/table/','remoteUri','isNil','email','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','../../../../config/logger','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','length','userId','],\x20getUser\x20crm','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber'];(function(_0x5a981b,_0x407fb2){var _0x37ed7e=function(_0x11040b){while(--_0x11040b){_0x5a981b['push'](_0x5a981b['shift']());}};_0x37ed7e(++_0x407fb2);}(_0x4172,0xbc));var _0x2417=function(_0x4249d9,_0x54ea10){_0x4249d9=_0x4249d9-0x0;var _0x326fe1=_0x4172[_0x4249d9];return _0x326fe1;};'use strict';var _=require(_0x2417('0x0'));var Promise=require(_0x2417('0x1'));var rp=require('request-promise');var util=require(_0x2417('0x2'));var md5=require(_0x2417('0x3'));var Redis=require(_0x2417('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x2417('0x5'))(_0x2417('0x6'));config[_0x2417('0x7')]=_['defaults'](config['redis'],{'host':_0x2417('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x4fb8ed,_0x355eec,_0x34c75f,_0x29140b,_0x54238f,_0x5dd785){return new Promise(function(_0x13ec0f,_0x10aeb1){var _0x199b0a={'method':_0x2417('0x9'),'uri':_0x29140b+_0x2417('0xa')+'&'+_0x54238f+'&'+_0x5dd785,'auth':_0x355eec,'json':!![]};return rp(_0x199b0a)[_0x2417('0xb')](function(_0x1a13ee){if(_0x1a13ee[_0x2417('0xc')]['length']>0x0){_0x34c75f['adminId']=_0x1a13ee['result'][0x0][_0x2417('0xd')];}logger[_0x2417('0xe')]('['+[_0x4fb8ed[_0x2417('0xf')]()]+_0x2417('0x10'),_0x34c75f);_0x13ec0f(_0x34c75f);})[_0x2417('0x11')](function(_0x3c408b){logger[_0x2417('0x12')]('['+[_0x4fb8ed['toUpperCase']()]+']',_0x3c408b[_0x2417('0x13')]);_0x10aeb1(_0x3c408b[_0x2417('0x13')]);});});}function getUser(_0x42b950,_0x451e3a,_0x501ce0,_0x3a8b19,_0x326630){return function(_0x1138c){logger[_0x2417('0xe')]('['+[_0x42b950[_0x2417('0xf')]()]+'],\x20getUser\x20input\x20crm',_0x1138c);return new Promise(function(_0x1c5b1c,_0x35bfd6){if(intUtil[_0x2417('0x14')](_0x1138c['userEmail'])){var _0x1e45ce={'method':_0x2417('0x9'),'uri':_0x501ce0+_0x2417('0x15')+_0x1138c[_0x2417('0x16')]+'&'+_0x3a8b19+'&'+_0x326630,'auth':_0x451e3a,'json':!![]};logger[_0x2417('0xe')]('['+[_0x42b950['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x1e45ce);return rp(_0x1e45ce)[_0x2417('0xb')](function(_0x13650b){logger['info']('['+[_0x42b950['toUpperCase']()]+_0x2417('0x17'),_0x13650b);if(_0x13650b[_0x2417('0xc')][_0x2417('0x18')]>0x0&&String(_0x13650b[_0x2417('0xc')][0x0]['active'])==='true'){_0x1138c[_0x2417('0x19')]=_0x13650b[_0x2417('0xc')][0x0][_0x2417('0xd')];}else{_0x1138c['userId']=_0x1138c['adminId'];_0x1138c['userEmail']=_0x1138c['adminEmail'];}logger[_0x2417('0xe')]('['+[_0x42b950[_0x2417('0xf')]()]+_0x2417('0x1a'),_0x1138c);_0x1c5b1c(_0x1138c);})[_0x2417('0x11')](function(_0x47ca6b){logger[_0x2417('0x12')]('['+[_0x42b950[_0x2417('0xf')]()]+']',_0x47ca6b[_0x2417('0x13')]);_0x35bfd6(_0x47ca6b[_0x2417('0x13')]);});}else{logger['info']('['+[_0x42b950['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x1138c['userId']=_0x1138c[_0x2417('0x1b')];_0x1138c['userEmail']=_0x1138c[_0x2417('0x1c')];_0x1c5b1c(_0x1138c);}});};}function createEndUser(_0x1a9eb6,_0x5b929c,_0x3fb40c,_0x5c698e,_0x5e7efa){logger[_0x2417('0xe')]('['+[_0x1a9eb6[_0x2417('0xf')]()]+_0x2417('0x1d'),_0x3fb40c);return new Promise(function(_0x1d0095,_0x249dcb){var _0x3f31b8={'method':_0x2417('0x1e'),'uri':_0x5c698e+'sys_user?'+_0x5e7efa,'body':{'user_name':_0x3fb40c[_0x2417('0x1f')],'roles':_0x2417('0x20'),'first_name':_0x3fb40c[_0x2417('0x1f')],'active':_0x2417('0x21'),'date_format':_0x2417('0x22'),'phone':_0x3fb40c[_0x2417('0x1f')]},'auth':_0x5b929c,'json':!![]};return rp(_0x3f31b8)[_0x2417('0xb')](function(_0x3a071f){logger['info']('['+[_0x1a9eb6[_0x2417('0xf')]()]+_0x2417('0x23'),_0x3a071f[_0x2417('0xc')]);_0x3fb40c['endUserId']=_0x3a071f[_0x2417('0xc')][_0x2417('0xd')];_0x1d0095(_0x3fb40c);})[_0x2417('0x11')](function(_0x28e451){logger[_0x2417('0x12')]('['+[_0x1a9eb6['toUpperCase']()]+']',_0x28e451[_0x2417('0x13')]);_0x249dcb(_0x28e451['message']);});});}function getEndUser(_0x5b8fe3,_0x3b86ba,_0x3bb0bd,_0x1919e1,_0x148934){return function(_0x162fea){logger[_0x2417('0xe')]('['+[_0x5b8fe3[_0x2417('0xf')]()]+_0x2417('0x24'),_0x162fea);return new Promise(function(_0x65cae0,_0x157383){var _0x208fb3={'method':_0x2417('0x9'),'uri':_0x3bb0bd+_0x2417('0x25')+_0x162fea[_0x2417('0x1f')]+'&'+_0x1919e1+'&'+_0x148934,'auth':_0x3b86ba,'json':!![]};return rp(_0x208fb3)[_0x2417('0xb')](function(_0x124cef){if(_0x124cef[_0x2417('0xc')][_0x2417('0x18')]>0x0){_0x162fea['endUserId']=_0x124cef[_0x2417('0xc')][0x0]['sys_id'];logger[_0x2417('0xe')]('['+[_0x5b8fe3[_0x2417('0xf')]()]+'],\x20getEndUser\x20crm',_0x162fea);_0x65cae0(_0x162fea);}else{return createEndUser(_0x5b8fe3,_0x3b86ba,_0x162fea,_0x3bb0bd,_0x1919e1)[_0x2417('0xb')](function(_0x94bbea){logger[_0x2417('0xe')]('['+[_0x5b8fe3[_0x2417('0xf')]()]+_0x2417('0x26'),_0x94bbea);_0x65cae0(_0x94bbea);});}})[_0x2417('0x11')](function(_0x68f7c8){logger[_0x2417('0x12')]('['+[_0x5b8fe3['toUpperCase']()]+']',_0x68f7c8[_0x2417('0x13')]);_0x157383(_0x68f7c8[_0x2417('0x13')]);});});};}function getCustomFields(_0x5405d0,_0x126232){var _0x5aa27d={};if(_0x5405d0['length']>0x0){_[_0x2417('0x27')](_0x5405d0,function(_0x1bf4ca){if(_[_0x2417('0x28')](['string',_0x2417('0x29')],_0x1bf4ca[_0x2417('0x2a')])&&_0x1bf4ca['nameField']&&!_0x1bf4ca[_0x2417('0x2b')]){_0x5aa27d[_0x1bf4ca[_0x2417('0x2c')][_0x2417('0x2d')]()]=_0x1bf4ca['content'][_0x2417('0x2e')]();}else if(_[_0x2417('0x28')](['string','picklist'],_0x1bf4ca[_0x2417('0x2a')])&&_0x1bf4ca[_0x2417('0x2f')]&&_0x1bf4ca[_0x2417('0x2b')]){_0x5aa27d[_0x1bf4ca['idField'][_0x2417('0x2d')]()]=_0x1bf4ca[_0x2417('0x30')][_0x2417('0x2e')]();}else if(_0x1bf4ca['type']===_0x2417('0x31')&&_0x1bf4ca[_0x2417('0x32')]&&_0x1bf4ca[_0x2417('0x2f')]&&_0x1bf4ca[_0x2417('0x2b')]){_0x5aa27d[_0x1bf4ca['idField'][_0x2417('0x2d')]()]=_0x126232[_0x1bf4ca[_0x2417('0x32')]][_0x2417('0x2e')]();}else if(_0x1bf4ca['type']==='customVariable'&&_0x1bf4ca[_0x2417('0x33')]&&_0x1bf4ca[_0x2417('0x33')][_0x2417('0x34')]&&_0x1bf4ca[_0x2417('0x2f')]&&_0x1bf4ca[_0x2417('0x2b')]){_0x5aa27d[_0x1bf4ca[_0x2417('0x2f')][_0x2417('0x2d')]()]=_0x126232[_0x1bf4ca[_0x2417('0x33')][_0x2417('0x34')]['toLowerCase']()][_0x2417('0x2e')]();}});}return _0x5aa27d;}function getTicket(_0x4aebb1,_0x2d0043,_0x24e0d1,_0x315755,_0xbd1d1e,_0x5d6a58){return function(_0x259271){logger[_0x2417('0xe')]('['+[_0x4aebb1['toUpperCase']()]+_0x2417('0x35'),_0x259271);return new Promise(function(_0xad8693,_0x34c95f){var _0x587fcd=_0x4aebb1['toLowerCase']()===_0x2417('0x36')?_0x259271['userId']:_0x259271[_0x2417('0x37')];var _0x2402c3={'method':_0x2417('0x1e'),'uri':_0x24e0d1+_0x2417('0x38')+'?'+_0x5d6a58,'body':Object[_0x2417('0x39')]({},{'active':_0x2417('0x21'),'caller_id':_0x587fcd,'assigned_to':_0x259271['userId'],'short_description':intUtil[_0x2417('0x3a')](_0x315755[_0x2417('0x3b')],_0xbd1d1e,'\x20'),'description':intUtil[_0x2417('0x3a')](_0x315755[_0x2417('0x3c')],_0xbd1d1e,'\x0a')},getCustomFields(_0x315755[_0x2417('0x3d')],_0xbd1d1e)),'auth':_0x2d0043,'json':!![]};return rp(_0x2402c3)[_0x2417('0xb')](function(_0x43de2f){logger[_0x2417('0xe')]('['+[_0x4aebb1[_0x2417('0xf')]()]+_0x2417('0x3e'),_0x43de2f[_0x2417('0xc')]);_0x259271[_0x2417('0x3f')]=_0x43de2f[_0x2417('0xc')]['sys_id'];_0x259271[_0x2417('0x40')]=_0x43de2f[_0x2417('0xc')][_0x2417('0x41')];logger[_0x2417('0xe')]('['+[_0x4aebb1['toUpperCase']()]+_0x2417('0x42'),_0x259271);_0xad8693(_0x259271);})[_0x2417('0x11')](function(_0x35b58c){logger[_0x2417('0x12')]('['+[_0x4aebb1[_0x2417('0xf')]()]+']',_0x35b58c['message']);_0x34c95f(_0x35b58c['message']);});});};}function createRemoteTag(_0x4f7457,_0x2eb593,_0x29a833,_0x5cd092){return new Promise(function(_0x253301,_0x24e388){var _0x3ea680={'method':_0x2417('0x1e'),'uri':_0x29a833+_0x2417('0x43')+'?'+_0x5cd092,'body':{'short_description':_0x4f7457,'global':!![],'active':!![],'name':_0x4f7457},'auth':_0x2eb593,'json':!![]};return rp(_0x3ea680)[_0x2417('0xb')](function(_0x544183){var _0x493d08=_0x544183[_0x2417('0xc')][_0x2417('0xd')];_0x253301(_0x493d08);});});}function getRemoteTag(_0x5dae80,_0x3e5cc0,_0x151c62,_0x50bf0b,_0x3143b0){return new Promise(function(_0x3cfe78,_0x27641d){var _0x58043d={'method':'GET','uri':_0x151c62+_0x2417('0x43')+_0x2417('0x44')+_0x5dae80+'&'+_0x50bf0b,'auth':_0x3e5cc0,'json':!![]};return rp(_0x58043d)[_0x2417('0xb')](function(_0x2af57a){if(_0x2af57a[_0x2417('0xc')]['length']>0x0){var _0x485a6c=_0x2af57a[_0x2417('0xc')][0x0][_0x2417('0xd')];_0x3cfe78(_0x485a6c);}else{return createRemoteTag(_0x5dae80,_0x3e5cc0,_0x151c62,_0x50bf0b)[_0x2417('0xb')](function(_0x3bfae5){_0x3cfe78(_0x3bfae5);});}});});}function assignTagToIncident(_0x36bacb,_0x513bb1,_0x46072c,_0x28cd7a,_0x60a7fd){return new Promise(function(_0x300209,_0x5803bc){var _0x5721a0={'method':_0x2417('0x1e'),'uri':_0x46072c+_0x2417('0x45')+'?'+_0x60a7fd,'body':{'label':_0x36bacb,'table':_0x2417('0x38'),'id_type':_0x2417('0x46'),'table_key':_0x28cd7a['ticketId'],'title':_0x2417('0x47')+_0x28cd7a[_0x2417('0x40')],'id_display':_0x28cd7a[_0x2417('0x40')]},'auth':_0x513bb1,'json':!![]};return rp(_0x5721a0)[_0x2417('0xb')](function(_0x246412){_0x300209();})[_0x2417('0x11')](function(){_0x300209();});});}function manageTags(_0x39ab3,_0x2e404b,_0xf6906c,_0x21d051,_0xd62cf2,_0x4b364c,_0x206c5d){return new Promise(function(_0xef4248,_0x549567){var _0x1ae0ff=[];_0x2e404b['forEach'](function(_0x25f831){_0x1ae0ff[_0x2417('0x48')](getRemoteTag(_0x25f831,_0xf6906c,_0x21d051,_0x4b364c,_0x206c5d));});return Promise[_0x2417('0x49')](_0x1ae0ff)[_0x2417('0xb')](function(_0xd84430){if(_0xd84430['length']){logger['info']('['+[_0x39ab3[_0x2417('0xf')]()]+_0x2417('0x4a'),_0xd84430);var _0x4b0815=[];_0xd84430[_0x2417('0x27')](function(_0x4711b5){_0x4b0815[_0x2417('0x48')](assignTagToIncident(_0x4711b5,_0xf6906c,_0x21d051,_0xd62cf2,_0x4b364c));});return Promise[_0x2417('0x49')](_0x4b0815)[_0x2417('0xb')](function(){_0xef4248();})[_0x2417('0x11')](function(){_0xef4248();});}else{_0xef4248();}});});}function getTags(_0x5b1eab,_0x4deab1,_0x49ad4c,_0x596b26,_0x3dbe85,_0xef2168){return function(_0x28d923){return new Promise(function(_0x3459b,_0x2f0d49){var _0x45c8c8=[];var _0x5e90a4=_0x596b26[_0x2417('0x4b')];if(_0x5e90a4&&_0x5e90a4['length']>0x0){_0x45c8c8=_[_0x2417('0x4c')](_0x5e90a4,'name');}if(_0x45c8c8[_0x2417('0x18')]>0x0){return manageTags(_0x5b1eab,_0x45c8c8,_0x4deab1,_0x49ad4c,_0x28d923,_0x3dbe85,_0xef2168)['then'](function(){_0x3459b(_0x28d923);});}else{_0x3459b(_0x28d923);}});};}function emit(_0x11c559,_0x45cdd7,_0x3d81c8){var _0x37af21=_0x2417('0x4d')+_0x2417('0x4e')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x2417('0x4f');var _0xadca04={'uri':_0x11c559+_0x2417('0x50')+_0x3d81c8+_0x37af21};io['to'](util[_0x2417('0x51')](_0x2417('0x52'),_0x45cdd7))[_0x2417('0x53')](_0x2417('0x54'),_0xadca04);}exports['cs']=function(_0x17bf3b,_0x5a0f51,_0x256a97,_0x2ee13c,_0x5c0667,_0x4f65ae,_0x5504ae,_0x57e2ea){var _0x552827={};var _0x194143={'user':_0x4f65ae[_0x2417('0x55')],'pass':_0x4f65ae[_0x2417('0x56')]};var _0x43df7a=_0x2417('0x57');var _0x311b26=_0x2417('0x58');_0x4f65ae['remoteUri']=intUtil[_0x2417('0x59')](_0x4f65ae['remoteUri']);_0x4f65ae[_0x2417('0x5a')]=intUtil['stripTrailingSlash'](_0x4f65ae['serverUrl']);var _0x44b038=util[_0x2417('0x51')](_0x2417('0x5b'),_0x4f65ae[_0x2417('0x5c')]);_0x552827['userEmail']=!_[_0x2417('0x5d')](_0x2ee13c)?_0x2ee13c[_0x2417('0x5e')]:null;_0x552827['adminEmail']=_0x4f65ae[_0x2417('0x5e')];_0x552827['endUserNumber']=_0x57e2ea[_0x2417('0x2d')]()===_0x2417('0x36')?_0x5a0f51['destcalleridnum']:_0x5a0f51['calleridnum'];_0x552827[_0x2417('0x5f')]=_0x57e2ea==='queue'||_0x57e2ea===_0x2417('0x60')?_0x2417('0x61'):'outbound';var _0x5f83da=util[_0x2417('0x51')](_0x2417('0x62'),_0x4f65ae[_0x2417('0x5a')],_0x5a0f51[_0x2417('0x63')],md5(_0x5a0f51[_0x2417('0x63')]));if(_0x5c0667&&_0x5c0667[_0x2417('0x64')]){logger[_0x2417('0xe')](_0x2417('0x65'),'Recording\x20is\x20enabled!');_0x5a0f51[_0x2417('0x66')]=_0x5f83da;}else if(_0x5504ae&&_0x5504ae[_0x2417('0x67')]&&_0x5504ae['recordingFormat']!=='none'){logger['info'](_0x2417('0x68'),'Recording\x20is\x20enabled!');_0x5a0f51[_0x2417('0x66')]=_0x5f83da;}else{_0x5a0f51[_0x2417('0x66')]='';}return getAdminUser(_0x57e2ea,_0x194143,_0x552827,_0x44b038,_0x311b26,_0x43df7a)[_0x2417('0xb')](getUser(_0x57e2ea,_0x194143,_0x44b038,_0x311b26,_0x43df7a))[_0x2417('0xb')](getEndUser(_0x57e2ea,_0x194143,_0x44b038,_0x311b26,_0x43df7a))[_0x2417('0xb')](getTicket(_0x57e2ea,_0x194143,_0x44b038,_0x256a97,_0x5a0f51,_0x311b26))['then'](function(_0x1bb72f){logger[_0x2417('0xe')](util['format'](_0x2417('0x69'),_0x1bb72f[_0x2417('0x3f')]));logger[_0x2417('0xe')](util['format'](_0x2417('0x6a'),_0x57e2ea));if(_0x57e2ea!==_0x2417('0x60')){logger[_0x2417('0xe')]('['+[_0x57e2ea['toUpperCase']()]+']',_0x2417('0x6b'));emit(_0x4f65ae[_0x2417('0x5c')],_0x2ee13c[_0x2417('0x34')],_0x1bb72f[_0x2417('0x3f')]);}})[_0x2417('0x11')](function(_0x2136e0){logger['error']('['+[_0x57e2ea['toUpperCase']()]+_0x2417('0x6c'),util[_0x2417('0x6d')](_0x2136e0,{'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 13086e0..6f0f7fe 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 _0x7142=['duration_minutes','Contacts','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','phone_home','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','users','version','trigger:browser:url','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Inbound','lodash','request-promise','bluebird','md5','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7142,0x152));var _0x2714=function(_0x41bf3a,_0x2a4001){_0x41bf3a=_0x41bf3a-0x0;var _0x3acb43=_0x7142[_0x41bf3a];return _0x3acb43;};'use strict';var _=require(_0x2714('0x0'));var rp=require(_0x2714('0x1'));var BPromise=require(_0x2714('0x2'));var md5=require(_0x2714('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2714('0x4'));var logger=require(_0x2714('0x5'))(_0x2714('0x6'));config[_0x2714('0x7')]=_[_0x2714('0x8')](config[_0x2714('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2714('0x7')]));var def={'method':_0x2714('0x9'),'json':!![]};function emit(_0x2e700a,_0x23ddcc,_0x3b028a){io['to'](_0x2e700a)['emit'](_0x23ddcc,_0x3b028a);}function getTicket(_0x5178a4,_0x2a9188,_0x22fb66,_0x1ed210,_0x571697,_0x42d076,_0x2d1183,_0x460463){logger[_0x2714('0xa')](_0x2714('0xb'));var _0x4bc983=new Date();var _0x36c207=[{'name':_0x2714('0xc'),'value':intUtil[_0x2714('0xd')](_0x1ed210['Subjects'],_0x571697,'\x20')},{'name':_0x2714('0xe'),'value':_0x2a9188['id']},{'name':_0x2714('0xf'),'value':_0x2a9188['id']},{'name':_0x2714('0x10'),'value':intUtil[_0x2714('0xd')](_0x1ed210[_0x2714('0x11')],_0x571697,'\x0a')},{'name':_0x2714('0x12'),'value':_0x4bc983[_0x2714('0x13')]()['slice'](0x0,0x13)[_0x2714('0x14')]('T','\x20')},{'name':_0x2714('0x15'),'value':'0'},{'name':_0x2714('0x16'),'value':'15'},{'name':'parent_id','value':_0x22fb66['id']},{'name':'parent_type','value':_0x2714('0x17')},{'name':'parent_name','value':_0x22fb66[_0x2714('0xc')]},{'name':_0x2714('0x18'),'value':_0x460463}];if(_0x42d076[_0x2714('0x19')]){_[_0x2714('0x1a')](_0x42d076,function(_0x5b0fe2){if(_0x571697[_0x5b0fe2[_0x2714('0x1b')]]){_0x36c207[_0x2714('0x1c')]({'name':_0x5b0fe2[_0x2714('0x1d')],'value':_0x571697[_0x5b0fe2[_0x2714('0x1b')]]});}});}return request({'form':{'method':_0x2714('0x1e'),'input_type':'JSON','response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x2d1183['id'],'module_name':'Calls','name_value_list':_0x36c207})}});}function getAuth(_0x63144){return util[_0x2714('0x21')](_0x2714('0x22'),new Buffer(_0x63144[_0x2714('0x23')]+':X')[_0x2714('0x24')](_0x2714('0x25')));}function getServerInfo(_0x5cd9d5){return request({'form':{'method':_0x2714('0x26'),'input_type':'JSON','response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x5cd9d5['id']})}});}function getUser(_0x13292f,_0x53fa69,_0x5916c0){if(!_[_0x2714('0x27')](_0x53fa69)){logger[_0x2714('0xa')](_0x2714('0x28'),_0x53fa69);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x2714('0x1f'),'rest_data':JSON['stringify']({'session':_0x5916c0['id'],'module_name':_0x2714('0x29'),'query':util[_0x2714('0x21')](_0x2714('0x2a'),_0x53fa69),'order_by':'','offset':'0','select_fields':['id',_0x2714('0xc'),_0x2714('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2714('0x2c')](function(_0x204856){if(_0x204856['entry_list'][_0x2714('0x19')]){var _0x54f0af=_[_0x2714('0x2d')](_0x204856[_0x2714('0x2e')],function(_0x2f08b4){return _0x2f08b4[_0x2714('0x2f')][_0x2714('0x2b')][_0x2714('0x30')]===_0x53fa69;});if(_0x54f0af){logger['info'](_0x2714('0x31'));return BPromise[_0x2714('0x32')]({'id':_0x54f0af[_0x2714('0x2f')]['id']['value'],'name':_0x54f0af['name_value_list']['name'][_0x2714('0x30')]});}}logger[_0x2714('0xa')](_0x2714('0x33'));return BPromise['resolve']({'id':_0x5916c0[_0x2714('0x2f')][_0x2714('0x34')][_0x2714('0x30')],'name':_0x5916c0[_0x2714('0x2f')][_0x2714('0x2b')][_0x2714('0x30')]});});}else{logger['info'](_0x2714('0x35'));return BPromise['resolve']({'id':_0x5916c0[_0x2714('0x2f')][_0x2714('0x34')][_0x2714('0x30')],'name':_0x5916c0['name_value_list'][_0x2714('0x2b')][_0x2714('0x30')]});}}function getEndUser(_0x193fbc,_0x93f84c,_0x14cfaa,_0x362160){logger['info'](_0x2714('0x36'),_0x14cfaa);return request({'form':{'method':_0x2714('0x37'),'input_type':_0x2714('0x1f'),'response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x362160['id'],'module_name':'Contacts','query':util[_0x2714('0x21')](_0x2714('0x38'),_0x14cfaa),'order_by':'','offset':'0','select_fields':['id',_0x2714('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2714('0x2c')](function(_0xd1ede4){if(_0xd1ede4[_0x2714('0x2e')][_0x2714('0x19')]){var _0x11d171=_[_0x2714('0x2d')](_0xd1ede4[_0x2714('0x2e')],function(_0xa33813){return _0xa33813[_0x2714('0x2f')]['phone_home'][_0x2714('0x30')]===_0x14cfaa;});if(_0x11d171){logger[_0x2714('0xa')](_0x2714('0x39'));return BPromise[_0x2714('0x32')]({'id':_0x11d171[_0x2714('0x2f')]['id'][_0x2714('0x30')],'name':_0x11d171[_0x2714('0x2f')]['name'][_0x2714('0x30')],'phone':_0x11d171[_0x2714('0x2f')]['phone_home'][_0x2714('0x30')]});}}else{logger[_0x2714('0xa')](_0x2714('0x3a'));return request({'form':{'method':_0x2714('0x1e'),'input_type':_0x2714('0x1f'),'response_type':_0x2714('0x1f'),'rest_data':JSON['stringify']({'session':_0x362160['id'],'module_name':'Contacts','name_value_list':[{'name':_0x2714('0x3b'),'value':_0x93f84c!==''?_0x93f84c:util['format']('Caller\x20-\x20%s',_0x14cfaa)},{'name':_0x2714('0x3c'),'value':_0x14cfaa}]})}})[_0x2714('0x2c')](function(_0x3b557a){logger[_0x2714('0xa')](_0x2714('0x3d'));return BPromise[_0x2714('0x32')]({'id':_0x3b557a['id'],'name':_0x3b557a[_0x2714('0x2e')][_0x2714('0x3b')][_0x2714('0x30')],'phone':_0x3b557a[_0x2714('0x2e')][_0x2714('0x3c')][_0x2714('0x30')]});});}});}function request(_0x48dc02){logger[_0x2714('0x3e')](_0x2714('0x3f'),JSON[_0x2714('0x20')](_0x48dc02));return rp(_[_0x2714('0x40')](def,_0x48dc02));}function getTags(_0x1d27f0,_0x5986aa){var _0x345f87=[];if(_0x1d27f0&&_0x1d27f0[_0x2714('0x19')]>0x0){_0x345f87=_[_0x2714('0x41')](_0x1d27f0,_0x5986aa);}return _0x345f87;}function getCustomFields(_0x2f7826,_0x40580c){var _0x2a65fb=[];var _0x1861d9={'custom_fields':[]};if(_0x2f7826[_0x2714('0x19')]>0x0){_[_0x2714('0x1a')](_0x2f7826,function(_0x540513){if(_0x540513[_0x2714('0x42')]===_0x2714('0x43')&&_0x540513[_0x2714('0x44')]&&!_0x540513[_0x2714('0x45')]){_0x1861d9[_0x540513[_0x2714('0x44')][_0x2714('0x46')]()]=_0x540513['content'][_0x2714('0x24')]();}else if(_0x540513[_0x2714('0x42')]===_0x2714('0x43')&&_0x540513['idField']&&_0x540513[_0x2714('0x45')]){_0x1861d9[_0x2714('0x47')][_0x2714('0x1c')]({'id':_0x540513['idField'],'value':_0x540513[_0x2714('0x48')][_0x2714('0x24')]()});}else if(_0x540513[_0x2714('0x42')]===_0x2714('0x49')&&_0x540513['variableName']&&_0x540513['idField']&&_0x540513[_0x2714('0x45')]){_0x40580c[_0x540513[_0x2714('0x1b')]]&&_0x1861d9[_0x2714('0x47')][_0x2714('0x1c')]({'id':_0x540513['idField'],'value':_0x40580c[_0x540513[_0x2714('0x1b')]][_0x2714('0x24')]()});}else if(_0x540513[_0x2714('0x42')]===_0x2714('0x4a')&&_0x540513[_0x2714('0x4b')]&&_0x540513[_0x2714('0x4b')][_0x2714('0xc')]&&_0x540513[_0x2714('0x1d')]&&_0x540513[_0x2714('0x45')]){_0x40580c[_0x540513[_0x2714('0x4b')][_0x2714('0xc')][_0x2714('0x46')]()]&&_0x1861d9['custom_fields'][_0x2714('0x1c')]({'id':_0x540513[_0x2714('0x1d')],'value':_0x40580c[_0x540513[_0x2714('0x4b')][_0x2714('0xc')][_0x2714('0x46')]()][_0x2714('0x24')]()});}});}return _0x1861d9;}function getConnection(_0x231eb7){return request({'method':_0x2714('0x9'),'form':{'method':'login','input_type':_0x2714('0x1f'),'response_type':'JSON','rest_data':JSON[_0x2714('0x20')]({'user_auth':{'user_name':_0x231eb7['username'],'password':_0x231eb7[_0x2714('0x4c')],'encryption':_0x2714('0x4d')},'application':_0x2714('0x4e')})}})[_0x2714('0x2c')](function(_0x51caac){var _0x133fe4=_0x51caac;if(_0x133fe4['id']){def[_0x2714('0x4f')]=_0x133fe4['id'];return BPromise[_0x2714('0x32')](_0x133fe4);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x231eb7['id']));}});}function setRelationship(_0x3d14c6,_0x6780c9,_0x56460c,_0x9a516d){return request({'form':{'method':'set_relationship','input_type':_0x2714('0x1f'),'response_type':_0x2714('0x1f'),'rest_data':JSON[_0x2714('0x20')]({'session':_0x3d14c6['id'],'module_name':_0x2714('0x50'),'module_id':_0x56460c['id'],'link_field_name':_0x9a516d,'related_ids':[_0x6780c9['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4a3251,_0x436fc1,_0x2d5baf,_0x591bc1,_0x40ef2d,_0x170645){var _0x11a2d3,_0x4a9f02,_0x58be9f,_0x1fd1e1;_0x170645[_0x2714('0x51')]=intUtil[_0x2714('0x52')](_0x170645['remoteUri']);_0x170645[_0x2714('0x53')]=intUtil[_0x2714('0x52')](_0x170645['serverUrl']);def[_0x2714('0x54')]=util[_0x2714('0x21')](_0x2714('0x55'),_0x170645[_0x2714('0x51')]);if(_0x40ef2d&&_0x40ef2d[_0x2714('0x56')]){logger[_0x2714('0xa')](_0x2714('0x57'),_0x2714('0x58'));_0x436fc1[_0x2714('0x59')]=util[_0x2714('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x170645[_0x2714('0x53')],_0x436fc1[_0x2714('0x5a')],md5(_0x436fc1[_0x2714('0x5a')]));}else{_0x436fc1[_0x2714('0x59')]='';}return getConnection(_0x170645)[_0x2714('0x2c')](function(_0x3079bd){_0x1fd1e1=_0x3079bd;return getUser(_0x170645,_0x591bc1['name'],_0x1fd1e1);})[_0x2714('0x2c')](function(_0x5292a5){_0x11a2d3=_0x5292a5;logger['info'](_0x2714('0x5b'),_0x11a2d3['id']);return getEndUser(_0x170645,_0x436fc1[_0x2714('0x5c')],_0x436fc1[_0x2714('0x5d')],_0x1fd1e1);})[_0x2714('0x2c')](function(_0x5c763b){_0x4a9f02=_0x5c763b;logger[_0x2714('0xa')](_0x2714('0x5e'),_0x4a9f02['id']);return getTicket(_0x170645,_0x11a2d3,_0x4a9f02,_0x2d5baf,_0x436fc1,_0x2d5baf[_0x2714('0x5f')],_0x1fd1e1,'Inbound');})[_0x2714('0x2c')](function(_0x386025){_0x58be9f=_0x386025;logger[_0x2714('0xa')](_0x2714('0x60'));logger['info'](_0x2714('0x61'),_0x58be9f['id']);return setRelationship(_0x1fd1e1,_0x11a2d3,_0x58be9f,'users');})[_0x2714('0x2c')](function(){return setRelationship(_0x1fd1e1,_0x4a9f02,_0x58be9f,_0x2714('0x62'));})[_0x2714('0x2c')](function(){return getServerInfo(_0x1fd1e1);})['then'](function(_0x20b365){var _0x5bf879=parseInt(_0x20b365['version'][_0x2714('0x63')](0x0));var _0xdbd05c=util[_0x2714('0x21')](_0x2714('0x64'),_0x170645[_0x2714('0x51')],_0x58be9f['id']);if(_0x5bf879>0x6){_0xdbd05c=util[_0x2714('0x21')](_0x2714('0x65'),_0x170645[_0x2714('0x51')],_0x58be9f['id']);}logger['info'](_0x2714('0x57'),_0x2714('0x66'));emit(util['format'](_0x2714('0x67'),_0x591bc1[_0x2714('0xc')]),'trigger:browser:url',{'uri':_0xdbd05c});})[_0x2714('0x68')](function(_0x1b4b5f){logger[_0x2714('0x69')]('[QUEUE]',JSON['stringify'](_0x1b4b5f));});};exports[_0x2714('0x6a')]=function(_0x4fb42f,_0x370987,_0x953a70,_0x324f73,_0x1521c7,_0xe1daca,_0x5d7f55){var _0x425f12,_0x1f262b,_0x523b67,_0x15016a;_0xe1daca[_0x2714('0x51')]=intUtil[_0x2714('0x52')](_0xe1daca[_0x2714('0x51')]);_0xe1daca['serverUrl']=intUtil['stripTrailingSlash'](_0xe1daca[_0x2714('0x53')]);def[_0x2714('0x54')]=util[_0x2714('0x21')](_0x2714('0x55'),_0xe1daca[_0x2714('0x51')]);if(_0x5d7f55&&_0x5d7f55[_0x2714('0x6b')]&&_0x5d7f55['recordingFormat']!=='none'){logger[_0x2714('0xa')](_0x2714('0x6c'),'Recording\x20is\x20enabled!');_0x370987[_0x2714('0x59')]=util[_0x2714('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe1daca[_0x2714('0x53')],_0x370987[_0x2714('0x5a')],md5(_0x370987['uniqueid']));}return getConnection(_0xe1daca)['then'](function(_0x32f36b){_0x15016a=_0x32f36b;return getUser(_0xe1daca,_0x324f73[_0x2714('0xc')],_0x15016a);})[_0x2714('0x2c')](function(_0x350a76){_0x425f12=_0x350a76;logger['info']('The\x20User\x20ID\x20is:',_0x425f12['id']);return getEndUser(_0xe1daca,_0x370987[_0x2714('0x6d')],_0x370987[_0x2714('0x6e')],_0x15016a);})[_0x2714('0x2c')](function(_0xbb67d3){_0x1f262b=_0xbb67d3;logger[_0x2714('0xa')](_0x2714('0x5e'),_0x1f262b['id']);return getTicket(_0xe1daca,_0x425f12,_0x1f262b,_0x953a70,_0x370987,_0x953a70[_0x2714('0x5f')],_0x15016a,_0x2714('0x6f'));})[_0x2714('0x2c')](function(_0x31c1c4){_0x523b67=_0x31c1c4;logger[_0x2714('0xa')](_0x2714('0x60'));logger['info'](_0x2714('0x61'),_0x523b67['id']);return setRelationship(_0x15016a,_0x425f12,_0x523b67,_0x2714('0x70'));})[_0x2714('0x2c')](function(){return setRelationship(_0x15016a,_0x1f262b,_0x523b67,_0x2714('0x62'));})[_0x2714('0x2c')](function(){return getServerInfo(_0x15016a);})[_0x2714('0x2c')](function(_0x488ec4){var _0x32ed57=parseInt(_0x488ec4[_0x2714('0x71')]['charAt'](0x0));var _0x4fa1e2=util[_0x2714('0x21')](_0x2714('0x64'),_0xe1daca[_0x2714('0x51')],_0x523b67['id']);if(_0x32ed57>0x6){_0x4fa1e2=util[_0x2714('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xe1daca[_0x2714('0x51')],_0x523b67['id']);}logger[_0x2714('0xa')]('[OUTBOUND]',_0x2714('0x66'));emit(util[_0x2714('0x21')](_0x2714('0x67'),_0x324f73[_0x2714('0xc')]),_0x2714('0x72'),{'uri':_0x4fa1e2});})[_0x2714('0x68')](function(_0x493484){logger[_0x2714('0x69')](_0x2714('0x6c'),JSON[_0x2714('0x20')](_0x493484));});};exports[_0x2714('0x73')]=function(_0x59a44f,_0x40fb7b,_0x2af667,_0xac6757,_0x5d52d3,_0x36f3ad){var _0x12c590,_0xf045f5,_0x27ce38,_0x4f6aa9;_0x36f3ad[_0x2714('0x51')]=intUtil['stripTrailingSlash'](_0x36f3ad[_0x2714('0x51')]);_0x36f3ad[_0x2714('0x53')]=intUtil[_0x2714('0x52')](_0x36f3ad['serverUrl']);def[_0x2714('0x54')]=util[_0x2714('0x21')]('%s/service/v4_1/rest.php',_0x36f3ad[_0x2714('0x51')]);if(_0x5d52d3&&_0x5d52d3[_0x2714('0x56')]){logger[_0x2714('0xa')]('['+_0x40fb7b[_0x2714('0x74')][_0x2714('0x75')]()+']',_0x2714('0x58'));_0x40fb7b[_0x2714('0x59')]=util[_0x2714('0x21')](_0x2714('0x76'),_0x36f3ad[_0x2714('0x53')],_0x40fb7b[_0x2714('0x5a')],md5(_0x40fb7b[_0x2714('0x5a')]));}else{_0x40fb7b[_0x2714('0x59')]='';}return getConnection(_0x36f3ad)['then'](function(_0xdb24e7){_0x4f6aa9=_0xdb24e7;if(!_['isNil'](_0xac6757)){return getUser(_0x36f3ad,_0xac6757[_0x2714('0xc')],_0x4f6aa9);}else{return getUser(_0x36f3ad,null,_0x4f6aa9);}})['then'](function(_0x45e0c5){_0x12c590=_0x45e0c5;logger[_0x2714('0xa')](_0x2714('0x5b'),_0x12c590['id']);return getEndUser(_0x36f3ad,_0x40fb7b[_0x2714('0x5c')],_0x40fb7b[_0x2714('0x5d')],_0x4f6aa9);})['then'](function(_0x1b5037){_0xf045f5=_0x1b5037;logger['info'](_0x2714('0x5e'),_0xf045f5['id']);return getTicket(_0x36f3ad,_0x12c590,_0xf045f5,_0x2af667,_0x40fb7b,_0x2af667[_0x2714('0x5f')],_0x4f6aa9,_0x2714('0x77'));})[_0x2714('0x2c')](function(_0x3697b6){_0x27ce38=_0x3697b6;logger[_0x2714('0xa')](_0x2714('0x60'));logger[_0x2714('0xa')](_0x2714('0x61'),_0x27ce38['id']);return setRelationship(_0x4f6aa9,_0x12c590,_0x27ce38,'users');})[_0x2714('0x2c')](function(){return setRelationship(_0x4f6aa9,_0xf045f5,_0x27ce38,_0x2714('0x62'));})[_0x2714('0x2c')](function(){return getServerInfo(_0x4f6aa9);})['catch'](function(_0x18df8a){logger[_0x2714('0x69')]('['+_0x40fb7b[_0x2714('0x74')][_0x2714('0x75')]()+']',JSON[_0x2714('0x20')](_0x18df8a));});}; \ No newline at end of file +var _0x1029=['../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','Descriptions','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','toLowerCase','content','idField','custom_fields','variable','customField','push','Variable','username','password','PLAIN','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','destcalleridnum','Fields','Outbound','[OUTBOUND]','trigger:browser:url','toUpperCase','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment'];(function(_0x31d040,_0x46742e){var _0xf4812a=function(_0x3e1d93){while(--_0x3e1d93){_0x31d040['push'](_0x31d040['shift']());}};_0xf4812a(++_0x46742e);}(_0x1029,0x1d5));var _0x9102=function(_0x339d0a,_0x152d67){_0x339d0a=_0x339d0a-0x0;var _0x7f1818=_0x1029[_0x339d0a];return _0x7f1818;};'use strict';var _=require(_0x9102('0x0'));var rp=require(_0x9102('0x1'));var BPromise=require(_0x9102('0x2'));var md5=require(_0x9102('0x3'));var util=require(_0x9102('0x4'));var Redis=require('ioredis');var intUtil=require(_0x9102('0x5'));var config=require(_0x9102('0x6'));var logger=require(_0x9102('0x7'))(_0x9102('0x8'));config[_0x9102('0x9')]=_[_0x9102('0xa')](config[_0x9102('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x9102('0xb'))(new Redis(config[_0x9102('0x9')]));var def={'method':_0x9102('0xc'),'json':!![]};function emit(_0x1bd006,_0x26ba77,_0x2bbf92){io['to'](_0x1bd006)[_0x9102('0xd')](_0x26ba77,_0x2bbf92);}function getTicket(_0x317dce,_0x49a820,_0x1c3893,_0x1673f1,_0x133eaa,_0x1c1c2e,_0x22494a,_0x3c6556){logger['info'](_0x9102('0xe'));var _0x1c65ef=new Date();var _0x28b7bc=[{'name':_0x9102('0xf'),'value':intUtil[_0x9102('0x10')](_0x1673f1[_0x9102('0x11')],_0x133eaa,'\x20')},{'name':'assigned_user_id','value':_0x49a820['id']},{'name':_0x9102('0x12'),'value':_0x49a820['id']},{'name':'description','value':intUtil[_0x9102('0x10')](_0x1673f1[_0x9102('0x13')],_0x133eaa,'\x0a')},{'name':'date_start','value':_0x1c65ef[_0x9102('0x14')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x9102('0x15'),'value':'0'},{'name':_0x9102('0x16'),'value':'15'},{'name':_0x9102('0x17'),'value':_0x1c3893['id']},{'name':_0x9102('0x18'),'value':_0x9102('0x19')},{'name':_0x9102('0x1a'),'value':_0x1c3893[_0x9102('0xf')]},{'name':'direction','value':_0x3c6556}];if(_0x1c1c2e[_0x9102('0x1b')]){_[_0x9102('0x1c')](_0x1c1c2e,function(_0x27a5bf){if(_0x133eaa[_0x27a5bf[_0x9102('0x1d')]]){_0x28b7bc['push']({'name':_0x27a5bf['idField'],'value':_0x133eaa[_0x27a5bf['variableName']]});}});}return request({'form':{'method':_0x9102('0x1e'),'input_type':'JSON','response_type':_0x9102('0x1f'),'rest_data':JSON[_0x9102('0x20')]({'session':_0x22494a['id'],'module_name':'Calls','name_value_list':_0x28b7bc})}});}function getAuth(_0x7d987b){return util[_0x9102('0x21')](_0x9102('0x22'),new Buffer(_0x7d987b[_0x9102('0x23')]+':X')[_0x9102('0x24')](_0x9102('0x25')));}function getServerInfo(_0x4425c3){return request({'form':{'method':_0x9102('0x26'),'input_type':_0x9102('0x1f'),'response_type':_0x9102('0x1f'),'rest_data':JSON[_0x9102('0x20')]({'session':_0x4425c3['id']})}});}function getUser(_0x27232f,_0x31a19f,_0x1b9c43){if(!_[_0x9102('0x27')](_0x31a19f)){logger[_0x9102('0x28')](_0x9102('0x29'),_0x31a19f);return request({'form':{'method':_0x9102('0x2a'),'input_type':_0x9102('0x1f'),'response_type':_0x9102('0x1f'),'rest_data':JSON[_0x9102('0x20')]({'session':_0x1b9c43['id'],'module_name':_0x9102('0x2b'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x31a19f),'order_by':'','offset':'0','select_fields':['id',_0x9102('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9102('0x2c')](function(_0x1e7301){if(_0x1e7301[_0x9102('0x2d')][_0x9102('0x1b')]){var _0x1357f8=_['find'](_0x1e7301['entry_list'],function(_0x24b78c){return _0x24b78c['name_value_list']['user_name'][_0x9102('0x2e')]===_0x31a19f;});if(_0x1357f8){logger[_0x9102('0x28')]('Agent\x20found!');return BPromise[_0x9102('0x2f')]({'id':_0x1357f8['name_value_list']['id'][_0x9102('0x2e')],'name':_0x1357f8[_0x9102('0x30')][_0x9102('0xf')][_0x9102('0x2e')]});}}logger[_0x9102('0x28')](_0x9102('0x31'));return BPromise[_0x9102('0x2f')]({'id':_0x1b9c43['name_value_list'][_0x9102('0x32')][_0x9102('0x2e')],'name':_0x1b9c43[_0x9102('0x30')][_0x9102('0x33')]['value']});});}else{logger[_0x9102('0x28')](_0x9102('0x34'));return BPromise['resolve']({'id':_0x1b9c43[_0x9102('0x30')][_0x9102('0x32')][_0x9102('0x2e')],'name':_0x1b9c43[_0x9102('0x30')][_0x9102('0x33')]['value']});}}function getEndUser(_0x255b17,_0x19e255,_0x1a4ac8,_0x5f22f3){logger['info'](_0x9102('0x35'),_0x1a4ac8);return request({'form':{'method':'get_entry_list','input_type':_0x9102('0x1f'),'response_type':_0x9102('0x1f'),'rest_data':JSON['stringify']({'session':_0x5f22f3['id'],'module_name':'Contacts','query':util['format'](_0x9102('0x36'),_0x1a4ac8),'order_by':'','offset':'0','select_fields':['id','name',_0x9102('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9102('0x2c')](function(_0x25f6cd){if(_0x25f6cd[_0x9102('0x2d')][_0x9102('0x1b')]){var _0x45aa0d=_[_0x9102('0x38')](_0x25f6cd[_0x9102('0x2d')],function(_0x2f5444){return _0x2f5444[_0x9102('0x30')][_0x9102('0x37')][_0x9102('0x2e')]===_0x1a4ac8;});if(_0x45aa0d){logger[_0x9102('0x28')](_0x9102('0x39'));return BPromise['resolve']({'id':_0x45aa0d['name_value_list']['id'][_0x9102('0x2e')],'name':_0x45aa0d['name_value_list']['name']['value'],'phone':_0x45aa0d['name_value_list'][_0x9102('0x37')]['value']});}}else{logger[_0x9102('0x28')](_0x9102('0x3a'));return request({'form':{'method':_0x9102('0x1e'),'input_type':_0x9102('0x1f'),'response_type':_0x9102('0x1f'),'rest_data':JSON['stringify']({'session':_0x5f22f3['id'],'module_name':'Contacts','name_value_list':[{'name':_0x9102('0x3b'),'value':_0x19e255!==_0x9102('0x3c')?_0x19e255:util[_0x9102('0x21')](_0x9102('0x3d'),_0x1a4ac8)},{'name':'phone_home','value':_0x1a4ac8}]})}})['then'](function(_0xe35879){logger[_0x9102('0x28')](_0x9102('0x3e'));return BPromise[_0x9102('0x2f')]({'id':_0xe35879['id'],'name':_0xe35879['entry_list'][_0x9102('0x3b')][_0x9102('0x2e')],'phone':_0xe35879['entry_list'][_0x9102('0x37')][_0x9102('0x2e')]});});}});}function request(_0x542aa0){logger[_0x9102('0x3f')](_0x9102('0x40'),JSON[_0x9102('0x20')](_0x542aa0));return rp(_['merge'](def,_0x542aa0));}function getTags(_0x2b6df4,_0x1d81e2){var _0x41e902=[];if(_0x2b6df4&&_0x2b6df4[_0x9102('0x1b')]>0x0){_0x41e902=_[_0x9102('0x41')](_0x2b6df4,_0x1d81e2);}return _0x41e902;}function getCustomFields(_0x5449bf,_0x2163d8){var _0x5be83c=[];var _0x21efc0={'custom_fields':[]};if(_0x5449bf[_0x9102('0x1b')]>0x0){_[_0x9102('0x1c')](_0x5449bf,function(_0x7f49c8){if(_0x7f49c8[_0x9102('0x42')]===_0x9102('0x43')&&_0x7f49c8[_0x9102('0x44')]&&!_0x7f49c8['customField']){_0x21efc0[_0x7f49c8[_0x9102('0x44')][_0x9102('0x45')]()]=_0x7f49c8[_0x9102('0x46')][_0x9102('0x24')]();}else if(_0x7f49c8[_0x9102('0x42')]==='string'&&_0x7f49c8[_0x9102('0x47')]&&_0x7f49c8['customField']){_0x21efc0[_0x9102('0x48')]['push']({'id':_0x7f49c8[_0x9102('0x47')],'value':_0x7f49c8[_0x9102('0x46')][_0x9102('0x24')]()});}else if(_0x7f49c8['type']===_0x9102('0x49')&&_0x7f49c8[_0x9102('0x1d')]&&_0x7f49c8[_0x9102('0x47')]&&_0x7f49c8[_0x9102('0x4a')]){_0x2163d8[_0x7f49c8[_0x9102('0x1d')]]&&_0x21efc0['custom_fields'][_0x9102('0x4b')]({'id':_0x7f49c8['idField'],'value':_0x2163d8[_0x7f49c8[_0x9102('0x1d')]]['toString']()});}else if(_0x7f49c8[_0x9102('0x42')]==='customVariable'&&_0x7f49c8[_0x9102('0x4c')]&&_0x7f49c8[_0x9102('0x4c')][_0x9102('0xf')]&&_0x7f49c8[_0x9102('0x47')]&&_0x7f49c8[_0x9102('0x4a')]){_0x2163d8[_0x7f49c8[_0x9102('0x4c')][_0x9102('0xf')]['toLowerCase']()]&&_0x21efc0['custom_fields'][_0x9102('0x4b')]({'id':_0x7f49c8['idField'],'value':_0x2163d8[_0x7f49c8[_0x9102('0x4c')][_0x9102('0xf')][_0x9102('0x45')]()][_0x9102('0x24')]()});}});}return _0x21efc0;}function getConnection(_0x12b10e){return request({'method':_0x9102('0xc'),'form':{'method':'login','input_type':'JSON','response_type':_0x9102('0x1f'),'rest_data':JSON[_0x9102('0x20')]({'user_auth':{'user_name':_0x12b10e[_0x9102('0x4d')],'password':_0x12b10e[_0x9102('0x4e')],'encryption':_0x9102('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x33636d){var _0x3599b8=_0x33636d;if(_0x3599b8['id']){def[_0x9102('0x50')]=_0x3599b8['id'];return BPromise['resolve'](_0x3599b8);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x12b10e['id']));}});}function setRelationship(_0x11043b,_0x412e9d,_0x956568,_0x49437b){return request({'form':{'method':_0x9102('0x51'),'input_type':'JSON','response_type':_0x9102('0x1f'),'rest_data':JSON[_0x9102('0x20')]({'session':_0x11043b['id'],'module_name':'Calls','module_id':_0x956568['id'],'link_field_name':_0x49437b,'related_ids':[_0x412e9d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9102('0x52')]=function(_0x3e8820,_0x308805,_0x1b9f19,_0x3f62a6,_0x342edd,_0x29e1f0){var _0x3c897f,_0x3480c4,_0x1633b5,_0x2faf3b;_0x29e1f0[_0x9102('0x53')]=intUtil[_0x9102('0x54')](_0x29e1f0[_0x9102('0x53')]);_0x29e1f0[_0x9102('0x55')]=intUtil['stripTrailingSlash'](_0x29e1f0[_0x9102('0x55')]);def[_0x9102('0x56')]=util[_0x9102('0x21')](_0x9102('0x57'),_0x29e1f0[_0x9102('0x53')]);if(_0x342edd&&_0x342edd[_0x9102('0x58')]){logger['info'](_0x9102('0x59'),_0x9102('0x5a'));_0x308805[_0x9102('0x5b')]=util['format'](_0x9102('0x5c'),_0x29e1f0['serverUrl'],_0x308805[_0x9102('0x5d')],md5(_0x308805[_0x9102('0x5d')]));}else{_0x308805[_0x9102('0x5b')]='';}return getConnection(_0x29e1f0)[_0x9102('0x2c')](function(_0x54d661){_0x2faf3b=_0x54d661;return getUser(_0x29e1f0,_0x3f62a6[_0x9102('0xf')],_0x2faf3b);})[_0x9102('0x2c')](function(_0xbb477){_0x3c897f=_0xbb477;logger[_0x9102('0x28')](_0x9102('0x5e'),_0x3c897f['id']);return getEndUser(_0x29e1f0,_0x308805[_0x9102('0x5f')],_0x308805[_0x9102('0x60')],_0x2faf3b);})[_0x9102('0x2c')](function(_0x7e32db){_0x3480c4=_0x7e32db;logger['info'](_0x9102('0x61'),_0x3480c4['id']);return getTicket(_0x29e1f0,_0x3c897f,_0x3480c4,_0x1b9f19,_0x308805,_0x1b9f19['Fields'],_0x2faf3b,_0x9102('0x62'));})[_0x9102('0x2c')](function(_0x14993e){_0x1633b5=_0x14993e;logger[_0x9102('0x28')](_0x9102('0x63'));logger['info'](_0x9102('0x64'),_0x1633b5['id']);return setRelationship(_0x2faf3b,_0x3c897f,_0x1633b5,_0x9102('0x65'));})['then'](function(){return setRelationship(_0x2faf3b,_0x3480c4,_0x1633b5,_0x9102('0x66'));})[_0x9102('0x2c')](function(){return getServerInfo(_0x2faf3b);})['then'](function(_0x266414){var _0x31319a=parseInt(_0x266414['version'][_0x9102('0x67')](0x0));var _0x5916ac=util[_0x9102('0x21')](_0x9102('0x68'),_0x29e1f0[_0x9102('0x53')],_0x1633b5['id']);if(_0x31319a>0x6){_0x5916ac=util[_0x9102('0x21')](_0x9102('0x69'),_0x29e1f0[_0x9102('0x53')],_0x1633b5['id']);}logger['info'](_0x9102('0x59'),_0x9102('0x6a'));emit(util[_0x9102('0x21')](_0x9102('0x6b'),_0x3f62a6[_0x9102('0xf')]),'trigger:browser:url',{'uri':_0x5916ac});})[_0x9102('0x6c')](function(_0x50573a){logger[_0x9102('0x6d')](_0x9102('0x59'),JSON[_0x9102('0x20')](_0x50573a));});};exports[_0x9102('0x6e')]=function(_0x1afa68,_0x1d1f6e,_0x5ae8e9,_0x39f7f8,_0x29deb3,_0x518ab5,_0x5c24af){var _0x15359d,_0x3b2eb6,_0x25e12f,_0x2ed946;_0x518ab5[_0x9102('0x53')]=intUtil[_0x9102('0x54')](_0x518ab5[_0x9102('0x53')]);_0x518ab5[_0x9102('0x55')]=intUtil[_0x9102('0x54')](_0x518ab5[_0x9102('0x55')]);def[_0x9102('0x56')]=util[_0x9102('0x21')](_0x9102('0x57'),_0x518ab5[_0x9102('0x53')]);if(_0x5c24af&&_0x5c24af[_0x9102('0x6f')]&&_0x5c24af['recordingFormat']!==_0x9102('0x70')){logger[_0x9102('0x28')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1d1f6e[_0x9102('0x5b')]=util[_0x9102('0x21')](_0x9102('0x5c'),_0x518ab5[_0x9102('0x55')],_0x1d1f6e[_0x9102('0x5d')],md5(_0x1d1f6e[_0x9102('0x5d')]));}return getConnection(_0x518ab5)[_0x9102('0x2c')](function(_0xd0f051){_0x2ed946=_0xd0f051;return getUser(_0x518ab5,_0x39f7f8[_0x9102('0xf')],_0x2ed946);})[_0x9102('0x2c')](function(_0x5573d9){_0x15359d=_0x5573d9;logger[_0x9102('0x28')](_0x9102('0x5e'),_0x15359d['id']);return getEndUser(_0x518ab5,_0x1d1f6e['destcalleridname'],_0x1d1f6e[_0x9102('0x71')],_0x2ed946);})['then'](function(_0x31377f){_0x3b2eb6=_0x31377f;logger[_0x9102('0x28')](_0x9102('0x61'),_0x3b2eb6['id']);return getTicket(_0x518ab5,_0x15359d,_0x3b2eb6,_0x5ae8e9,_0x1d1f6e,_0x5ae8e9[_0x9102('0x72')],_0x2ed946,_0x9102('0x73'));})[_0x9102('0x2c')](function(_0x264929){_0x25e12f=_0x264929;logger[_0x9102('0x28')](_0x9102('0x63'));logger[_0x9102('0x28')](_0x9102('0x64'),_0x25e12f['id']);return setRelationship(_0x2ed946,_0x15359d,_0x25e12f,_0x9102('0x65'));})['then'](function(){return setRelationship(_0x2ed946,_0x3b2eb6,_0x25e12f,_0x9102('0x66'));})[_0x9102('0x2c')](function(){return getServerInfo(_0x2ed946);})[_0x9102('0x2c')](function(_0x43b4f7){var _0x535527=parseInt(_0x43b4f7['version']['charAt'](0x0));var _0x5632d8=util[_0x9102('0x21')](_0x9102('0x68'),_0x518ab5['remoteUri'],_0x25e12f['id']);if(_0x535527>0x6){_0x5632d8=util['format'](_0x9102('0x69'),_0x518ab5[_0x9102('0x53')],_0x25e12f['id']);}logger[_0x9102('0x28')](_0x9102('0x74'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9102('0x21')](_0x9102('0x6b'),_0x39f7f8['name']),_0x9102('0x75'),{'uri':_0x5632d8});})[_0x9102('0x6c')](function(_0x2fb972){logger[_0x9102('0x6d')](_0x9102('0x74'),JSON[_0x9102('0x20')](_0x2fb972));});};exports['unmanaged']=function(_0x4b348c,_0x4ec5c7,_0x5aa74d,_0x2a1c4b,_0x1f417a,_0x56eaff){var _0x8b6756,_0x50cbfc,_0x36ec57,_0xf36e70;_0x56eaff['remoteUri']=intUtil[_0x9102('0x54')](_0x56eaff[_0x9102('0x53')]);_0x56eaff[_0x9102('0x55')]=intUtil['stripTrailingSlash'](_0x56eaff['serverUrl']);def[_0x9102('0x56')]=util[_0x9102('0x21')](_0x9102('0x57'),_0x56eaff[_0x9102('0x53')]);if(_0x1f417a&&_0x1f417a[_0x9102('0x58')]){logger[_0x9102('0x28')]('['+_0x4ec5c7['lastevent']['toUpperCase']()+']',_0x9102('0x5a'));_0x4ec5c7[_0x9102('0x5b')]=util['format'](_0x9102('0x5c'),_0x56eaff[_0x9102('0x55')],_0x4ec5c7['uniqueid'],md5(_0x4ec5c7[_0x9102('0x5d')]));}else{_0x4ec5c7[_0x9102('0x5b')]='';}return getConnection(_0x56eaff)[_0x9102('0x2c')](function(_0x23f23f){_0xf36e70=_0x23f23f;if(!_[_0x9102('0x27')](_0x2a1c4b)){return getUser(_0x56eaff,_0x2a1c4b[_0x9102('0xf')],_0xf36e70);}else{return getUser(_0x56eaff,null,_0xf36e70);}})[_0x9102('0x2c')](function(_0x556728){_0x8b6756=_0x556728;logger[_0x9102('0x28')](_0x9102('0x5e'),_0x8b6756['id']);return getEndUser(_0x56eaff,_0x4ec5c7['calleridname'],_0x4ec5c7['calleridnum'],_0xf36e70);})[_0x9102('0x2c')](function(_0x53e113){_0x50cbfc=_0x53e113;logger[_0x9102('0x28')](_0x9102('0x61'),_0x50cbfc['id']);return getTicket(_0x56eaff,_0x8b6756,_0x50cbfc,_0x5aa74d,_0x4ec5c7,_0x5aa74d[_0x9102('0x72')],_0xf36e70,_0x9102('0x62'));})[_0x9102('0x2c')](function(_0x56a0eb){_0x36ec57=_0x56a0eb;logger[_0x9102('0x28')]('Ticket\x20created!');logger[_0x9102('0x28')]('The\x20Ticket\x20ID\x20is:',_0x36ec57['id']);return setRelationship(_0xf36e70,_0x8b6756,_0x36ec57,_0x9102('0x65'));})[_0x9102('0x2c')](function(){return setRelationship(_0xf36e70,_0x50cbfc,_0x36ec57,_0x9102('0x66'));})[_0x9102('0x2c')](function(){return getServerInfo(_0xf36e70);})[_0x9102('0x6c')](function(_0x37f464){logger[_0x9102('0x6d')]('['+_0x4ec5c7['lastevent'][_0x9102('0x76')]()+']',JSON[_0x9102('0x20')](_0x37f464));});}; \ 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 744134e..559ae74 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 _0x69b7=['stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join'];(function(_0x4a9ba3,_0x16e601){var _0x326416=function(_0xb76b49){while(--_0xb76b49){_0x4a9ba3['push'](_0x4a9ba3['shift']());}};_0x326416(++_0x16e601);}(_0x69b7,0x1c5));var _0x769b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x69b7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x769b('0x0'));var util=require(_0x769b('0x1'));exports[_0x769b('0x2')]=function(_0x254305,_0x4f6df3,_0x58d7e9){var _0x3b4d8d=[];if(_0x254305[_0x769b('0x3')]>0x0){var _0x170ff3=_[_0x769b('0x4')](_0x254305,['id']);for(var _0x4cff47=0x0;_0x4cff47<_0x170ff3[_0x769b('0x3')];_0x4cff47++){var _0x2b67e7=_0x170ff3[_0x4cff47];if(_0x2b67e7[_0x769b('0x5')]===_0x769b('0x6')){_0x3b4d8d[_0x769b('0x7')](_0x2b67e7[_0x769b('0x8')]);}else if(_0x2b67e7['type']===_0x769b('0x9')&&_0x2b67e7[_0x769b('0xa')]){_0x4f6df3[_0x2b67e7['variableName']]&&_0x3b4d8d['push'](_0x4f6df3[_0x2b67e7[_0x769b('0xa')]][_0x769b('0xb')]());}else if(_0x2b67e7[_0x769b('0x5')]==='customVariable'&&_0x2b67e7[_0x769b('0xc')]&&_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')]){_0x4f6df3[_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')][_0x769b('0xe')]()]&&_0x3b4d8d[_0x769b('0x7')](_0x4f6df3[_0x2b67e7[_0x769b('0xc')]['name']['toLowerCase']()][_0x769b('0xb')]());}else if(_0x2b67e7[_0x769b('0x5')]===_0x769b('0xf')){if(_0x2b67e7[_0x769b('0x10')]===_0x769b('0x6')&&_0x2b67e7[_0x769b('0x11')]){_0x3b4d8d[_0x769b('0x7')](util[_0x769b('0x12')](_0x769b('0x13'),_0x2b67e7[_0x769b('0x11')],_0x2b67e7[_0x769b('0x14')]));}else if(_0x2b67e7[_0x769b('0x10')]==='variable'&&_0x2b67e7['variableName']&&_0x2b67e7['key']){_0x4f6df3[_0x2b67e7['variableName']]&&_0x3b4d8d[_0x769b('0x7')](util[_0x769b('0x12')](_0x769b('0x13'),_0x2b67e7[_0x769b('0x11')],_0x4f6df3[_0x2b67e7['variableName']]));}else if(_0x2b67e7[_0x769b('0x10')]===_0x769b('0x15')&&_0x2b67e7[_0x769b('0xc')]&&_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')]&&_0x2b67e7[_0x769b('0x11')]){_0x4f6df3[_0x2b67e7[_0x769b('0xc')][_0x769b('0xd')]['toLowerCase']()]&&_0x3b4d8d['push'](util[_0x769b('0x12')](_0x769b('0x13'),_0x2b67e7['key'],_0x4f6df3[_0x2b67e7['Variable'][_0x769b('0xd')]['toLowerCase']()]));}}}}return _0x3b4d8d[_0x769b('0x16')](_0x58d7e9);};exports[_0x769b('0x17')]=function(_0x24ff7b){var _0x4fb884=_0x24ff7b[_0x769b('0x18')](-0x1);if(_0x4fb884==='/'){_0x24ff7b=_0x24ff7b[_0x769b('0x19')](0x0,_0x24ff7b['lastIndexOf'](_0x4fb884));}return _0x24ff7b;};exports[_0x769b('0x1a')]=function(_0x45f8a0){if(!_['isNil'](_0x45f8a0)&&_0x45f8a0!==''){var _0x4b743b=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x4b743b[_0x769b('0x1b')](String(_0x45f8a0)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x3a0e=['type','string','push','variableName','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','customVariable','stripTrailingSlash','slice','substring','validateEmail','lodash','getString','length','sortBy'];(function(_0x4ad1f8,_0x2058ca){var _0x86623b=function(_0x5cb618){while(--_0x5cb618){_0x4ad1f8['push'](_0x4ad1f8['shift']());}};_0x86623b(++_0x2058ca);}(_0x3a0e,0x9d));var _0xe3a0=function(_0x59a32e,_0xf48643){_0x59a32e=_0x59a32e-0x0;var _0x19e843=_0x3a0e[_0x59a32e];return _0x19e843;};'use strict';var _=require(_0xe3a0('0x0'));var util=require('util');exports[_0xe3a0('0x1')]=function(_0x167717,_0x31b60b,_0x21ce3c){var _0x4fd945=[];if(_0x167717[_0xe3a0('0x2')]>0x0){var _0x3bde36=_[_0xe3a0('0x3')](_0x167717,['id']);for(var _0x183809=0x0;_0x183809<_0x3bde36['length'];_0x183809++){var _0xff438e=_0x3bde36[_0x183809];if(_0xff438e[_0xe3a0('0x4')]===_0xe3a0('0x5')){_0x4fd945[_0xe3a0('0x6')](_0xff438e['content']);}else if(_0xff438e[_0xe3a0('0x4')]==='variable'&&_0xff438e[_0xe3a0('0x7')]){_0x31b60b[_0xff438e[_0xe3a0('0x7')]]&&_0x4fd945[_0xe3a0('0x6')](_0x31b60b[_0xff438e[_0xe3a0('0x7')]]['toString']());}else if(_0xff438e[_0xe3a0('0x4')]==='customVariable'&&_0xff438e[_0xe3a0('0x8')]&&_0xff438e[_0xe3a0('0x8')]['name']){_0x31b60b[_0xff438e[_0xe3a0('0x8')][_0xe3a0('0x9')][_0xe3a0('0xa')]()]&&_0x4fd945['push'](_0x31b60b[_0xff438e[_0xe3a0('0x8')][_0xe3a0('0x9')][_0xe3a0('0xa')]()]['toString']());}else if(_0xff438e[_0xe3a0('0x4')]===_0xe3a0('0xb')){if(_0xff438e[_0xe3a0('0xc')]==='string'&&_0xff438e[_0xe3a0('0xd')]){_0x4fd945['push'](util[_0xe3a0('0xe')](_0xe3a0('0xf'),_0xff438e[_0xe3a0('0xd')],_0xff438e[_0xe3a0('0x10')]));}else if(_0xff438e['keyType']===_0xe3a0('0x11')&&_0xff438e[_0xe3a0('0x7')]&&_0xff438e[_0xe3a0('0xd')]){_0x31b60b[_0xff438e[_0xe3a0('0x7')]]&&_0x4fd945['push'](util[_0xe3a0('0xe')](_0xe3a0('0xf'),_0xff438e[_0xe3a0('0xd')],_0x31b60b[_0xff438e[_0xe3a0('0x7')]]));}else if(_0xff438e[_0xe3a0('0xc')]===_0xe3a0('0x12')&&_0xff438e[_0xe3a0('0x8')]&&_0xff438e['Variable'][_0xe3a0('0x9')]&&_0xff438e[_0xe3a0('0xd')]){_0x31b60b[_0xff438e['Variable'][_0xe3a0('0x9')][_0xe3a0('0xa')]()]&&_0x4fd945[_0xe3a0('0x6')](util['format'](_0xe3a0('0xf'),_0xff438e[_0xe3a0('0xd')],_0x31b60b[_0xff438e[_0xe3a0('0x8')][_0xe3a0('0x9')]['toLowerCase']()]));}}}}return _0x4fd945['join'](_0x21ce3c);};exports[_0xe3a0('0x13')]=function(_0x1270eb){var _0x9629c8=_0x1270eb[_0xe3a0('0x14')](-0x1);if(_0x9629c8==='/'){_0x1270eb=_0x1270eb[_0xe3a0('0x15')](0x0,_0x1270eb['lastIndexOf'](_0x9629c8));}return _0x1270eb;};exports[_0xe3a0('0x16')]=function(_0x48746c){if(!_['isNil'](_0x48746c)&&_0x48746c!==''){var _0x2d730a=/^(([^<>()\[\]\\.,;:\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 _0x2d730a['test'](String(_0x48746c)[_0xe3a0('0xa')]());}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 195e0b2..fef15af 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 39e9ec5..d8843e0 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 _0xc0dc=['redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','length','map','forEach','includes','string','picklist','type','customField','toLowerCase','content','toString','idField','variable','variableName','push','customVariable','Variable','name','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk'];(function(_0x3d19d9,_0x5ecdaa){var _0x1ab1d7=function(_0x1dfe5e){while(--_0x1dfe5e){_0x3d19d9['push'](_0x3d19d9['shift']());}};_0x1ab1d7(++_0x5ecdaa);}(_0xc0dc,0x1c5));var _0xcc0d=function(_0x1e6dfb,_0xe01cdd){_0x1e6dfb=_0x1e6dfb-0x0;var _0x32d3f1=_0xc0dc[_0x1e6dfb];return _0x32d3f1;};'use strict';var _=require(_0xcc0d('0x0'));var rp=require(_0xcc0d('0x1'));var md5=require('md5');var util=require(_0xcc0d('0x2'));var Redis=require(_0xcc0d('0x3'));var intUtil=require('./util');var config=require(_0xcc0d('0x4'));var logger=require(_0xcc0d('0x5'))(_0xcc0d('0x6'));config[_0xcc0d('0x7')]=_[_0xcc0d('0x8')](config['redis'],{'host':_0xcc0d('0x9'),'port':0x18eb});var io=require(_0xcc0d('0xa'))(new Redis(config['redis']));function emit(_0x3d5525,_0x2025e9,_0x1aa970){io['to'](_0x3d5525)['emit'](_0x2025e9,_0x1aa970);}var headers={'Content-Type':_0xcc0d('0xb'),'Accept':_0xcc0d('0xb')};function getTicket(_0x209d30,_0x46e54e,_0x5b3ebc,_0x14eddd,_0x57aa6f){logger[_0xcc0d('0xc')](_0xcc0d('0xd'));return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0xf'),_0x209d30[_0xcc0d('0x10')]),'method':_0xcc0d('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x5b3ebc['id'],'submitter_id':_0x46e54e?_0x46e54e['id']:undefined,'assignee_id':_0x46e54e?_0x46e54e['id']:undefined,'tags':getTags(_0x14eddd['Tags'],'name'),'subject':intUtil[_0xcc0d('0x12')](_0x14eddd[_0xcc0d('0x13')],_0x57aa6f,'\x20'),'description':intUtil['getString'](_0x14eddd['Descriptions'],_0x57aa6f,'\x0a'),'comment':{'public':![],'body':intUtil[_0xcc0d('0x12')](_0x14eddd[_0xcc0d('0x14')],_0x57aa6f,'\x0a')}},getCustomFields(_0x14eddd[_0xcc0d('0x15')],_0x57aa6f))}})[_0xcc0d('0x16')](function(_0x202bac){logger[_0xcc0d('0xc')](_0xcc0d('0x17'));return _0x202bac[_0xcc0d('0x18')];});}function getUser(_0x3a8ad3,_0x2b9fda){if(intUtil[_0xcc0d('0x19')](_0x2b9fda)){logger[_0xcc0d('0xc')](_0xcc0d('0x1a'),_0x2b9fda);return request({'uri':util['format']('%s/search.json',_0x3a8ad3['remoteUri']),'qs':{'query':util[_0xcc0d('0xe')](_0xcc0d('0x1b'),_0x2b9fda)}})[_0xcc0d('0x16')](function(_0x2289ec){if(_0x2289ec[_0xcc0d('0x1c')]){logger[_0xcc0d('0xc')](_0xcc0d('0x1d'));return _[_0xcc0d('0x1e')](_0x2289ec[_0xcc0d('0x1f')],{'email':_0x2b9fda,'role':_0xcc0d('0x20')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3a8ad3[_0xcc0d('0x10')])})[_0xcc0d('0x16')](function(_0xac5722){logger[_0xcc0d('0xc')](_0xcc0d('0x21'));return _0xac5722[_0xcc0d('0x22')];});}});}else{logger[_0xcc0d('0xc')](_0xcc0d('0x23'));return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x24'),_0x3a8ad3[_0xcc0d('0x10')])})[_0xcc0d('0x16')](function(_0xfa1f8f){logger['info'](_0xcc0d('0x21'));return _0xfa1f8f[_0xcc0d('0x22')];});}}function getEndUser(_0x8e2b9b,_0x295b79,_0x4a117b){logger[_0xcc0d('0xc')](_0xcc0d('0x25'),_0x4a117b);return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x26'),_0x8e2b9b[_0xcc0d('0x10')]),'qs':{'query':util['format'](_0xcc0d('0x27'),_0x4a117b)}})[_0xcc0d('0x16')](function(_0x2ea1d0){var _0x336d08;if(_0x2ea1d0[_0xcc0d('0x1f')]['length']){_0x2ea1d0[_0xcc0d('0x1f')]=_[_0xcc0d('0x28')](_0x2ea1d0[_0xcc0d('0x1f')],{'suspended':![],'role':_0xcc0d('0x29')});if(_0x2ea1d0['results']['length']){_0x336d08=_[_0xcc0d('0x2a')](_0x2ea1d0[_0xcc0d('0x1f')]);}}if(_0x336d08){logger[_0xcc0d('0xc')](_0xcc0d('0x2b'));return _0x336d08;}else{logger[_0xcc0d('0xc')](_0xcc0d('0x2c'));return request({'uri':util['format'](_0xcc0d('0x2d'),_0x8e2b9b['remoteUri']),'method':_0xcc0d('0x11'),'body':{'user':{'role':_0xcc0d('0x29'),'name':util[_0xcc0d('0xe')](_0xcc0d('0x2e'),_0x295b79||_0x4a117b),'phone':_0x4a117b}}})[_0xcc0d('0x16')](function(_0x395775){logger[_0xcc0d('0xc')](_0xcc0d('0x2f'));return _0x395775[_0xcc0d('0x22')];});}});}function getAuth(_0x242e42){var _0x39e3c2;if(_0x242e42[_0xcc0d('0x30')]===_0xcc0d('0x31')){_0x39e3c2=util[_0xcc0d('0xe')](_0xcc0d('0x32'),_0x242e42['username'],_0x242e42[_0xcc0d('0x31')]);}else if(_0x242e42[_0xcc0d('0x30')]===_0xcc0d('0x33')){_0x39e3c2=util[_0xcc0d('0xe')](_0xcc0d('0x34'),_0x242e42['username'],_0x242e42[_0xcc0d('0x33')]);}return util[_0xcc0d('0xe')](_0xcc0d('0x35'),new Buffer(_0x39e3c2)['toString'](_0xcc0d('0x36')));}function request(_0x376e71){logger[_0xcc0d('0x37')](_0xcc0d('0x38'),JSON[_0xcc0d('0x39')](_0x376e71));return rp(_[_0xcc0d('0x8')](_0x376e71,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x324cf7,_0x1a51c4){var _0x6829e8=[];if(_0x324cf7&&_0x324cf7[_0xcc0d('0x3a')]>0x0){_0x6829e8=_[_0xcc0d('0x3b')](_0x324cf7,_0x1a51c4);}return _0x6829e8;}function getCustomFields(_0x1befdd,_0x18cbd2){var _0x40ca5d=[];var _0x9b6231={'custom_fields':[]};if(_0x1befdd[_0xcc0d('0x3a')]>0x0){_[_0xcc0d('0x3c')](_0x1befdd,function(_0x1a9a2e){if(_[_0xcc0d('0x3d')]([_0xcc0d('0x3e'),_0xcc0d('0x3f')],_0x1a9a2e[_0xcc0d('0x40')])&&_0x1a9a2e['nameField']&&!_0x1a9a2e[_0xcc0d('0x41')]){_0x9b6231[_0x1a9a2e['nameField'][_0xcc0d('0x42')]()]=_0x1a9a2e[_0xcc0d('0x43')][_0xcc0d('0x44')]();}else if(_[_0xcc0d('0x3d')]([_0xcc0d('0x3e'),_0xcc0d('0x3f')],_0x1a9a2e[_0xcc0d('0x40')])&&_0x1a9a2e[_0xcc0d('0x45')]&&_0x1a9a2e[_0xcc0d('0x41')]){_0x9b6231['custom_fields']['push']({'id':_0x1a9a2e[_0xcc0d('0x45')],'value':_0x1a9a2e[_0xcc0d('0x43')]['toString']()});}else if(_0x1a9a2e[_0xcc0d('0x40')]===_0xcc0d('0x46')&&_0x1a9a2e[_0xcc0d('0x47')]&&_0x1a9a2e[_0xcc0d('0x45')]&&_0x1a9a2e[_0xcc0d('0x41')]){_0x18cbd2[_0x1a9a2e[_0xcc0d('0x47')]]&&_0x9b6231['custom_fields'][_0xcc0d('0x48')]({'id':_0x1a9a2e[_0xcc0d('0x45')],'value':_0x18cbd2[_0x1a9a2e[_0xcc0d('0x47')]]['toString']()});}else if(_0x1a9a2e[_0xcc0d('0x40')]===_0xcc0d('0x49')&&_0x1a9a2e['Variable']&&_0x1a9a2e[_0xcc0d('0x4a')]['name']&&_0x1a9a2e[_0xcc0d('0x45')]&&_0x1a9a2e[_0xcc0d('0x41')]){_0x18cbd2[_0x1a9a2e[_0xcc0d('0x4a')][_0xcc0d('0x4b')][_0xcc0d('0x42')]()]&&_0x9b6231['custom_fields']['push']({'id':_0x1a9a2e[_0xcc0d('0x45')],'value':_0x18cbd2[_0x1a9a2e[_0xcc0d('0x4a')]['name'][_0xcc0d('0x42')]()][_0xcc0d('0x44')]()});}});}return _0x9b6231;}exports[_0xcc0d('0x4c')]=function(_0x1ae04b,_0x5d6630,_0x754933,_0x362b9c,_0xe7aeb4,_0x2ad869){var _0x5c3294,_0x262f42;_0x2ad869[_0xcc0d('0x10')]=intUtil['stripTrailingSlash'](_0x2ad869[_0xcc0d('0x10')]);_0x2ad869[_0xcc0d('0x4d')]=intUtil['stripTrailingSlash'](_0x2ad869[_0xcc0d('0x4d')]);if(_0xe7aeb4&&_0xe7aeb4[_0xcc0d('0x4e')]){logger[_0xcc0d('0xc')](_0xcc0d('0x4f'),_0xcc0d('0x50'));_0x5d6630['recordingURL']=util['format'](_0xcc0d('0x51'),_0x2ad869[_0xcc0d('0x4d')],_0x5d6630[_0xcc0d('0x52')],md5(_0x5d6630[_0xcc0d('0x52')]));}else{_0x5d6630[_0xcc0d('0x53')]='';}headers[_0xcc0d('0x54')]=getAuth(_0x2ad869);return getUser(_0x2ad869,_0x362b9c[_0xcc0d('0x55')])[_0xcc0d('0x16')](function(_0x3a28ca){_0x5c3294=_0x3a28ca;logger[_0xcc0d('0xc')]('The\x20User\x20ID\x20is:',_0x5c3294['id']);return getEndUser(_0x2ad869,_0x5d6630['calleridname'],_0x5d6630[_0xcc0d('0x56')]);})[_0xcc0d('0x16')](function(_0x38ab94){_0x262f42=_0x38ab94;logger[_0xcc0d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x262f42['id']);return getTicket(_0x2ad869,_0x5c3294,_0x262f42,_0x754933,_0x5d6630);})[_0xcc0d('0x16')](function(_0x1c3eee){if(_0x1c3eee){logger[_0xcc0d('0xc')](_0xcc0d('0x57'),_0x1c3eee['id']);switch(_0x2ad869[_0xcc0d('0x40')]){case _0xcc0d('0x58'):logger[_0xcc0d('0xc')](_0xcc0d('0x4f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x59'),_0x2ad869[_0xcc0d('0x10')],_0x5c3294['id'],_0x1c3eee['id']),'method':_0xcc0d('0x11')});case _0xcc0d('0x5a'):logger[_0xcc0d('0xc')](_0xcc0d('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcc0d('0xe')]('user:%s',_0x362b9c[_0xcc0d('0x4b')]),_0xcc0d('0x5b'),{'uri':util[_0xcc0d('0xe')](_0xcc0d('0x5c'),_0x2ad869[_0xcc0d('0x10')][_0xcc0d('0x5d')](_0xcc0d('0x5e'),''),_0x1c3eee['id'])});break;default:logger['error'](_0xcc0d('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x469ea6){logger[_0xcc0d('0x5f')](_0xcc0d('0x60'),util[_0xcc0d('0x61')](_0x469ea6,{'showHidden':!![],'depth':null}));});};exports[_0xcc0d('0x62')]=function(_0x32f438,_0x4251fd,_0x459049,_0x109692,_0x132d0f,_0x1f8fee,_0x2bb1cb){var _0x11587a,_0x20da39;_0x1f8fee[_0xcc0d('0x10')]=intUtil['stripTrailingSlash'](_0x1f8fee[_0xcc0d('0x10')]);_0x1f8fee['serverUrl']=intUtil[_0xcc0d('0x63')](_0x1f8fee['serverUrl']);if(_0x2bb1cb&&_0x2bb1cb[_0xcc0d('0x64')]&&_0x2bb1cb['recordingFormat']!=='none'){logger[_0xcc0d('0xc')](_0xcc0d('0x65'),_0xcc0d('0x50'));_0x4251fd['recordingURL']=util['format'](_0xcc0d('0x51'),_0x1f8fee[_0xcc0d('0x4d')],_0x4251fd['uniqueid'],md5(_0x4251fd[_0xcc0d('0x52')]));}headers['Authorization']=getAuth(_0x1f8fee);return getUser(_0x1f8fee,_0x109692['email'])['then'](function(_0xdccdd6){_0x11587a=_0xdccdd6;logger[_0xcc0d('0xc')](_0xcc0d('0x66'),_0x11587a['id']);return getEndUser(_0x1f8fee,_0x4251fd[_0xcc0d('0x67')],_0x4251fd[_0xcc0d('0x68')]);})['then'](function(_0x882ce0){_0x20da39=_0x882ce0;logger[_0xcc0d('0xc')](_0xcc0d('0x69'),_0x20da39['id']);return getTicket(_0x1f8fee,_0x11587a,_0x20da39,_0x459049,_0x4251fd);})['then'](function(_0x21273d){if(_0x21273d){logger['info'](_0xcc0d('0x57'),_0x21273d['id']);switch(_0x1f8fee[_0xcc0d('0x40')]){case _0xcc0d('0x58'):logger['info'](_0xcc0d('0x65'),_0xcc0d('0x6a'));return request({'uri':util[_0xcc0d('0xe')](_0xcc0d('0x59'),_0x1f8fee[_0xcc0d('0x10')],_0x11587a['id'],_0x21273d['id']),'method':_0xcc0d('0x11')});case _0xcc0d('0x5a'):logger[_0xcc0d('0xc')]('[OUTBOUND]',_0xcc0d('0x6b'));emit(util[_0xcc0d('0xe')](_0xcc0d('0x6c'),_0x109692[_0xcc0d('0x4b')]),'trigger:browser:url',{'uri':util[_0xcc0d('0xe')]('%s/agent/tickets/%s',_0x1f8fee[_0xcc0d('0x10')][_0xcc0d('0x5d')]('/api/v2',''),_0x21273d['id'])});break;default:logger['error']('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xcc0d('0x6d')](function(_0x258947){logger['error'](_0xcc0d('0x6e'),util[_0xcc0d('0x61')](_0x258947,{'showHidden':!![],'depth':null}));});};exports[_0xcc0d('0x6f')]=function(_0x20b4c5,_0x4d5f68,_0x32d558,_0x7ebc63,_0x10af3d,_0x3198e5){var _0x44ccd3,_0x2c7414;_0x3198e5['remoteUri']=intUtil[_0xcc0d('0x63')](_0x3198e5[_0xcc0d('0x10')]);_0x3198e5[_0xcc0d('0x4d')]=intUtil[_0xcc0d('0x63')](_0x3198e5[_0xcc0d('0x4d')]);if(_0x10af3d&&_0x10af3d[_0xcc0d('0x4e')]){logger[_0xcc0d('0xc')]('['+_0x4d5f68['lastevent'][_0xcc0d('0x70')]()+']',_0xcc0d('0x50'));_0x4d5f68[_0xcc0d('0x53')]=util[_0xcc0d('0xe')](_0xcc0d('0x51'),_0x3198e5[_0xcc0d('0x4d')],_0x4d5f68[_0xcc0d('0x52')],md5(_0x4d5f68['uniqueid']));}else{_0x4d5f68[_0xcc0d('0x53')]='';}headers[_0xcc0d('0x54')]=getAuth(_0x3198e5);return getUser(_0x3198e5)[_0xcc0d('0x16')](function(_0x44b802){_0x44ccd3=_0x44b802;logger[_0xcc0d('0xc')]('The\x20User\x20ID\x20is:',_0x44ccd3['id']);return getEndUser(_0x3198e5,_0x4d5f68[_0xcc0d('0x71')],_0x4d5f68[_0xcc0d('0x56')]);})['then'](function(_0x3dc9de){_0x2c7414=_0x3dc9de;logger[_0xcc0d('0xc')](_0xcc0d('0x69'),_0x2c7414['id']);return getTicket(_0x3198e5,_0x44ccd3,_0x2c7414,_0x32d558,_0x4d5f68);})[_0xcc0d('0x16')](function(_0x882f5){if(_0x882f5){logger[_0xcc0d('0xc')](_0xcc0d('0x57'),_0x882f5['id']);}})[_0xcc0d('0x6d')](function(_0x399ce7){logger[_0xcc0d('0x5f')]('['+_0x4d5f68['lastevent']['toUpperCase']()+']'+_0xcc0d('0x72'),util[_0xcc0d('0x61')](_0x399ce7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc38a=['[OUTBOUND]','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','password','%s:%s','username','authType','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','customField','nameField','toLowerCase','content','toString','picklist','idField','custom_fields','type','variable','variableName','push','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridnum','newTab'];(function(_0x389a5b,_0x44ebfc){var _0x5a0782=function(_0xc15f3b){while(--_0xc15f3b){_0x389a5b['push'](_0x389a5b['shift']());}};_0x5a0782(++_0x44ebfc);}(_0xc38a,0x79));var _0xac38=function(_0x2fff28,_0x540e58){_0x2fff28=_0x2fff28-0x0;var _0x1f68b9=_0xc38a[_0x2fff28];return _0x1f68b9;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xac38('0x0'));var Redis=require(_0xac38('0x1'));var intUtil=require('./util');var config=require(_0xac38('0x2'));var logger=require(_0xac38('0x3'))(_0xac38('0x4'));config['redis']=_[_0xac38('0x5')](config[_0xac38('0x6')],{'host':_0xac38('0x7'),'port':0x18eb});var io=require(_0xac38('0x8'))(new Redis(config[_0xac38('0x6')]));function emit(_0x426c82,_0x1398ec,_0x5748fb){io['to'](_0x426c82)[_0xac38('0x9')](_0x1398ec,_0x5748fb);}var headers={'Content-Type':_0xac38('0xa'),'Accept':_0xac38('0xa')};function getTicket(_0x518ed1,_0x2e45e2,_0x2d2bd2,_0x2cf938,_0x27e7ea){logger[_0xac38('0xb')](_0xac38('0xc'));return request({'uri':util[_0xac38('0xd')](_0xac38('0xe'),_0x518ed1[_0xac38('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x2d2bd2['id'],'submitter_id':_0x2e45e2?_0x2e45e2['id']:undefined,'assignee_id':_0x2e45e2?_0x2e45e2['id']:undefined,'tags':getTags(_0x2cf938[_0xac38('0x10')],'name'),'subject':intUtil['getString'](_0x2cf938[_0xac38('0x11')],_0x27e7ea,'\x20'),'description':intUtil[_0xac38('0x12')](_0x2cf938[_0xac38('0x13')],_0x27e7ea,'\x0a'),'comment':{'public':![],'body':intUtil[_0xac38('0x12')](_0x2cf938[_0xac38('0x13')],_0x27e7ea,'\x0a')}},getCustomFields(_0x2cf938[_0xac38('0x14')],_0x27e7ea))}})[_0xac38('0x15')](function(_0x208295){logger[_0xac38('0xb')](_0xac38('0x16'));return _0x208295[_0xac38('0x17')];});}function getUser(_0x5d95fe,_0x4f5f03){if(intUtil['validateEmail'](_0x4f5f03)){logger[_0xac38('0xb')](_0xac38('0x18'),_0x4f5f03);return request({'uri':util['format'](_0xac38('0x19'),_0x5d95fe[_0xac38('0xf')]),'qs':{'query':util[_0xac38('0xd')](_0xac38('0x1a'),_0x4f5f03)}})[_0xac38('0x15')](function(_0x46d266){if(_0x46d266[_0xac38('0x1b')]){logger[_0xac38('0xb')]('Agent\x20found!');return _[_0xac38('0x1c')](_0x46d266['results'],{'email':_0x4f5f03,'role':_0xac38('0x1d')});}else{logger[_0xac38('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xac38('0xd')]('%s/users/me.json',_0x5d95fe['remoteUri'])})[_0xac38('0x15')](function(_0x51f271){logger[_0xac38('0xb')](_0xac38('0x1e'));return _0x51f271[_0xac38('0x1f')];});}});}else{logger[_0xac38('0xb')](_0xac38('0x20'));return request({'uri':util[_0xac38('0xd')](_0xac38('0x21'),_0x5d95fe[_0xac38('0xf')])})[_0xac38('0x15')](function(_0x514ed3){logger['info'](_0xac38('0x1e'));return _0x514ed3[_0xac38('0x1f')];});}}function getEndUser(_0x1fd9f1,_0x2728f9,_0x45fb28){logger[_0xac38('0xb')](_0xac38('0x22'),_0x45fb28);return request({'uri':util[_0xac38('0xd')](_0xac38('0x19'),_0x1fd9f1[_0xac38('0xf')]),'qs':{'query':util[_0xac38('0xd')](_0xac38('0x23'),_0x45fb28)}})['then'](function(_0x5a7df9){var _0xd19b23;if(_0x5a7df9['results']['length']){_0x5a7df9[_0xac38('0x24')]=_[_0xac38('0x25')](_0x5a7df9[_0xac38('0x24')],{'suspended':![],'role':_0xac38('0x26')});if(_0x5a7df9['results'][_0xac38('0x27')]){_0xd19b23=_['first'](_0x5a7df9[_0xac38('0x24')]);}}if(_0xd19b23){logger[_0xac38('0xb')](_0xac38('0x28'));return _0xd19b23;}else{logger[_0xac38('0xb')](_0xac38('0x29'));return request({'uri':util[_0xac38('0xd')](_0xac38('0x2a'),_0x1fd9f1[_0xac38('0xf')]),'method':_0xac38('0x2b'),'body':{'user':{'role':_0xac38('0x26'),'name':util[_0xac38('0xd')](_0xac38('0x2c'),_0x2728f9||_0x45fb28),'phone':_0x45fb28}}})[_0xac38('0x15')](function(_0x50151c){logger[_0xac38('0xb')]('Enduser\x20created.');return _0x50151c['user'];});}});}function getAuth(_0x133cc8){var _0x52bcd4;if(_0x133cc8['authType']===_0xac38('0x2d')){_0x52bcd4=util[_0xac38('0xd')](_0xac38('0x2e'),_0x133cc8[_0xac38('0x2f')],_0x133cc8['password']);}else if(_0x133cc8[_0xac38('0x30')]==='token'){_0x52bcd4=util[_0xac38('0xd')](_0xac38('0x31'),_0x133cc8[_0xac38('0x2f')],_0x133cc8[_0xac38('0x32')]);}return util['format'](_0xac38('0x33'),new Buffer(_0x52bcd4)['toString'](_0xac38('0x34')));}function request(_0x42456c){logger[_0xac38('0x35')](_0xac38('0x36'),JSON[_0xac38('0x37')](_0x42456c));return rp(_[_0xac38('0x5')](_0x42456c,{'method':_0xac38('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x24b58c,_0x1e44d2){var _0x1d77bd=[];if(_0x24b58c&&_0x24b58c[_0xac38('0x27')]>0x0){_0x1d77bd=_[_0xac38('0x39')](_0x24b58c,_0x1e44d2);}return _0x1d77bd;}function getCustomFields(_0x222e38,_0x3f01cc){var _0x46bc0f=[];var _0x3be7d2={'custom_fields':[]};if(_0x222e38[_0xac38('0x27')]>0x0){_[_0xac38('0x3a')](_0x222e38,function(_0x48559c){if(_[_0xac38('0x3b')]([_0xac38('0x3c'),'picklist'],_0x48559c['type'])&&_0x48559c['nameField']&&!_0x48559c[_0xac38('0x3d')]){_0x3be7d2[_0x48559c[_0xac38('0x3e')][_0xac38('0x3f')]()]=_0x48559c[_0xac38('0x40')][_0xac38('0x41')]();}else if(_['includes'](['string',_0xac38('0x42')],_0x48559c['type'])&&_0x48559c[_0xac38('0x43')]&&_0x48559c[_0xac38('0x3d')]){_0x3be7d2[_0xac38('0x44')]['push']({'id':_0x48559c['idField'],'value':_0x48559c['content'][_0xac38('0x41')]()});}else if(_0x48559c[_0xac38('0x45')]===_0xac38('0x46')&&_0x48559c[_0xac38('0x47')]&&_0x48559c[_0xac38('0x43')]&&_0x48559c[_0xac38('0x3d')]){_0x3f01cc[_0x48559c[_0xac38('0x47')]]&&_0x3be7d2[_0xac38('0x44')][_0xac38('0x48')]({'id':_0x48559c[_0xac38('0x43')],'value':_0x3f01cc[_0x48559c[_0xac38('0x47')]][_0xac38('0x41')]()});}else if(_0x48559c[_0xac38('0x45')]==='customVariable'&&_0x48559c['Variable']&&_0x48559c[_0xac38('0x49')][_0xac38('0x4a')]&&_0x48559c[_0xac38('0x43')]&&_0x48559c[_0xac38('0x3d')]){_0x3f01cc[_0x48559c['Variable'][_0xac38('0x4a')][_0xac38('0x3f')]()]&&_0x3be7d2[_0xac38('0x44')][_0xac38('0x48')]({'id':_0x48559c[_0xac38('0x43')],'value':_0x3f01cc[_0x48559c['Variable']['name'][_0xac38('0x3f')]()][_0xac38('0x41')]()});}});}return _0x3be7d2;}exports[_0xac38('0x4b')]=function(_0x392bc4,_0x597ae5,_0x2b9265,_0x4e9847,_0x2fedb6,_0x5597cd){var _0x3d3aa4,_0x2b51ad;_0x5597cd[_0xac38('0xf')]=intUtil['stripTrailingSlash'](_0x5597cd['remoteUri']);_0x5597cd[_0xac38('0x4c')]=intUtil[_0xac38('0x4d')](_0x5597cd[_0xac38('0x4c')]);if(_0x2fedb6&&_0x2fedb6[_0xac38('0x4e')]){logger[_0xac38('0xb')](_0xac38('0x4f'),_0xac38('0x50'));_0x597ae5[_0xac38('0x51')]=util['format'](_0xac38('0x52'),_0x5597cd[_0xac38('0x4c')],_0x597ae5[_0xac38('0x53')],md5(_0x597ae5[_0xac38('0x53')]));}else{_0x597ae5[_0xac38('0x51')]='';}headers[_0xac38('0x54')]=getAuth(_0x5597cd);return getUser(_0x5597cd,_0x4e9847[_0xac38('0x55')])[_0xac38('0x15')](function(_0x183361){_0x3d3aa4=_0x183361;logger[_0xac38('0xb')](_0xac38('0x56'),_0x3d3aa4['id']);return getEndUser(_0x5597cd,_0x597ae5[_0xac38('0x57')],_0x597ae5[_0xac38('0x58')]);})[_0xac38('0x15')](function(_0x475c11){_0x2b51ad=_0x475c11;logger[_0xac38('0xb')](_0xac38('0x59'),_0x2b51ad['id']);return getTicket(_0x5597cd,_0x3d3aa4,_0x2b51ad,_0x2b9265,_0x597ae5);})[_0xac38('0x15')](function(_0x430b7b){if(_0x430b7b){logger[_0xac38('0xb')](_0xac38('0x5a'),_0x430b7b['id']);switch(_0x5597cd[_0xac38('0x45')]){case _0xac38('0x5b'):logger['info'](_0xac38('0x4f'),_0xac38('0x5c'));return request({'uri':util[_0xac38('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5597cd[_0xac38('0xf')],_0x3d3aa4['id'],_0x430b7b['id']),'method':'POST'});case'newTab':logger[_0xac38('0xb')]('[QUEUE]',_0xac38('0x5d'));emit(util['format'](_0xac38('0x5e'),_0x4e9847[_0xac38('0x4a')]),_0xac38('0x5f'),{'uri':util[_0xac38('0xd')]('%s/agent/tickets/%s',_0x5597cd['remoteUri'][_0xac38('0x60')]('/api/v2',''),_0x430b7b['id'])});break;default:logger[_0xac38('0x61')](_0xac38('0x4f'),_0xac38('0x62'));}}})[_0xac38('0x63')](function(_0x54eb97){logger[_0xac38('0x61')](_0xac38('0x64'),util[_0xac38('0x65')](_0x54eb97,{'showHidden':!![],'depth':null}));});};exports[_0xac38('0x66')]=function(_0x3adb72,_0x54d64c,_0x436ee6,_0x2a0a3d,_0x609e57,_0x3cfcb6,_0x2c614e){var _0x3da296,_0x19b5d3;_0x3cfcb6[_0xac38('0xf')]=intUtil[_0xac38('0x4d')](_0x3cfcb6[_0xac38('0xf')]);_0x3cfcb6[_0xac38('0x4c')]=intUtil[_0xac38('0x4d')](_0x3cfcb6[_0xac38('0x4c')]);if(_0x2c614e&&_0x2c614e['recordingFormat']&&_0x2c614e[_0xac38('0x67')]!==_0xac38('0x68')){logger[_0xac38('0xb')]('[OUTBOUND]',_0xac38('0x50'));_0x54d64c[_0xac38('0x51')]=util['format'](_0xac38('0x52'),_0x3cfcb6['serverUrl'],_0x54d64c[_0xac38('0x53')],md5(_0x54d64c[_0xac38('0x53')]));}headers['Authorization']=getAuth(_0x3cfcb6);return getUser(_0x3cfcb6,_0x2a0a3d[_0xac38('0x55')])[_0xac38('0x15')](function(_0x5ebbb7){_0x3da296=_0x5ebbb7;logger[_0xac38('0xb')](_0xac38('0x56'),_0x3da296['id']);return getEndUser(_0x3cfcb6,_0x54d64c['destcalleridname'],_0x54d64c[_0xac38('0x69')]);})[_0xac38('0x15')](function(_0x5d2876){_0x19b5d3=_0x5d2876;logger[_0xac38('0xb')](_0xac38('0x59'),_0x19b5d3['id']);return getTicket(_0x3cfcb6,_0x3da296,_0x19b5d3,_0x436ee6,_0x54d64c);})[_0xac38('0x15')](function(_0x5bce8e){if(_0x5bce8e){logger[_0xac38('0xb')](_0xac38('0x5a'),_0x5bce8e['id']);switch(_0x3cfcb6['type']){case _0xac38('0x5b'):logger['info']('[OUTBOUND]',_0xac38('0x5c'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3cfcb6[_0xac38('0xf')],_0x3da296['id'],_0x5bce8e['id']),'method':_0xac38('0x2b')});case _0xac38('0x6a'):logger['info'](_0xac38('0x6b'),_0xac38('0x5d'));emit(util['format'](_0xac38('0x5e'),_0x2a0a3d[_0xac38('0x4a')]),_0xac38('0x5f'),{'uri':util[_0xac38('0xd')](_0xac38('0x6c'),_0x3cfcb6['remoteUri'][_0xac38('0x60')](_0xac38('0x6d'),''),_0x5bce8e['id'])});break;default:logger[_0xac38('0x61')](_0xac38('0x6b'),_0xac38('0x62'));}}})[_0xac38('0x63')](function(_0x2a2a12){logger[_0xac38('0x61')](_0xac38('0x6e'),util[_0xac38('0x65')](_0x2a2a12,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x412aa1,_0x3eeb5d,_0x5d1c81,_0x5614b1,_0x53a9d2,_0x2f0758){var _0x487aa6,_0x51b9ba;_0x2f0758[_0xac38('0xf')]=intUtil[_0xac38('0x4d')](_0x2f0758[_0xac38('0xf')]);_0x2f0758[_0xac38('0x4c')]=intUtil[_0xac38('0x4d')](_0x2f0758[_0xac38('0x4c')]);if(_0x53a9d2&&_0x53a9d2['monitor_format']){logger['info']('['+_0x3eeb5d[_0xac38('0x6f')][_0xac38('0x70')]()+']',_0xac38('0x50'));_0x3eeb5d[_0xac38('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f0758['serverUrl'],_0x3eeb5d[_0xac38('0x53')],md5(_0x3eeb5d[_0xac38('0x53')]));}else{_0x3eeb5d['recordingURL']='';}headers[_0xac38('0x54')]=getAuth(_0x2f0758);return getUser(_0x2f0758)[_0xac38('0x15')](function(_0x26ddb3){_0x487aa6=_0x26ddb3;logger[_0xac38('0xb')](_0xac38('0x56'),_0x487aa6['id']);return getEndUser(_0x2f0758,_0x3eeb5d[_0xac38('0x57')],_0x3eeb5d[_0xac38('0x58')]);})[_0xac38('0x15')](function(_0x204480){_0x51b9ba=_0x204480;logger[_0xac38('0xb')](_0xac38('0x59'),_0x51b9ba['id']);return getTicket(_0x2f0758,_0x487aa6,_0x51b9ba,_0x5d1c81,_0x3eeb5d);})['then'](function(_0x225eb2){if(_0x225eb2){logger[_0xac38('0xb')](_0xac38('0x5a'),_0x225eb2['id']);}})['catch'](function(_0x509236){logger['error']('['+_0x3eeb5d['lastevent'][_0xac38('0x70')]()+']'+_0xac38('0x71'),util['inspect'](_0x509236,{'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 301930b..da86665 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 _0x07b9=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','com','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','info','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','talktime','Call_Duration','utc','mm:ss','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','complete','Answered','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','details','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id='];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x07b9,0x143));var _0x907b=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x07b9[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x907b('0x0'));var rp=require(_0x907b('0x1'));var md5=require(_0x907b('0x2'));var util=require(_0x907b('0x3'));var intUtil=require('./util');var moment=require(_0x907b('0x4'));var Redis=require('ioredis');var BPromise=require(_0x907b('0x5'));var config=require(_0x907b('0x6'));var logger=require(_0x907b('0x7'))(_0x907b('0x8'));config[_0x907b('0x9')]=_[_0x907b('0xa')](config[_0x907b('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x907b('0xb'))(new Redis(config[_0x907b('0x9')]));function emit(_0x43c574,_0x1ff1ca,_0x5e0b45){io['to'](_0x43c574)['emit'](_0x1ff1ca,_0x5e0b45);}function request(_0x34767a){logger[_0x907b('0xc')](_0x907b('0xd'),JSON[_0x907b('0xe')](_0x34767a));return rp(_0x34767a);}function getCustomFields(_0x241430,_0xb0e6d){var _0x18437b={};if(_0x241430[_0x907b('0xf')]>0x0){_[_0x907b('0x10')](_0x241430,function(_0x1ef039){if(_['includes']([_0x907b('0x11'),'picklist'],_0x1ef039['type'])&&_0x1ef039[_0x907b('0x12')]){_0x18437b[_0x1ef039[_0x907b('0x12')]]=_0x1ef039[_0x907b('0x13')][_0x907b('0x14')]();}else if(_0x1ef039[_0x907b('0x15')]===_0x907b('0x16')&&_0x1ef039['variableName']&&_0x1ef039[_0x907b('0x12')]&&_0xb0e6d[_0x1ef039[_0x907b('0x17')]]){_0x18437b[_0x1ef039['idField']]=_0xb0e6d[_0x1ef039['variableName']][_0x907b('0x14')]();}else if(_0x1ef039[_0x907b('0x15')]===_0x907b('0x18')&&_0x1ef039[_0x907b('0x19')]&&_0x1ef039[_0x907b('0x19')]['name']&&_0x1ef039[_0x907b('0x12')]&&_0xb0e6d[_0x1ef039[_0x907b('0x19')]['name'][_0x907b('0x1a')]()]){_0x18437b[_0x1ef039[_0x907b('0x12')]]=_0xb0e6d[_0x1ef039[_0x907b('0x19')][_0x907b('0x1b')][_0x907b('0x1a')]()][_0x907b('0x14')]();}});}return _0x18437b;}function getName(_0xf2acff){if(_0xf2acff[_0x907b('0x1c')]('\x20')>0x0){var _0x11fdab=_0xf2acff[_0x907b('0x1d')](/ (.+)/);if(_0x11fdab[0x1]){return _0x11fdab;}}return[_0xf2acff,_0xf2acff];}var accountsTokens={};function getAccessToken(_0x34db23){return new Promise(function(_0x3b5c6e,_0x3fe834){if(!_['isNil'](accountsTokens[_0x34db23['id']])&&!_[_0x907b('0x1e')](accountsTokens[_0x34db23['id']][_0x907b('0x1f')])){if(moment()[_0x907b('0x20')](accountsTokens[_0x34db23['id']][_0x907b('0x21')])){_0x3b5c6e(accountsTokens[_0x34db23['id']][_0x907b('0x1f')]);}}var _0x22fa2d;switch(_0x34db23[_0x907b('0x22')]){case'US':_0x22fa2d='https://accounts.zoho.com';break;case'AU':_0x22fa2d=_0x907b('0x23');break;case'EU':_0x22fa2d=_0x907b('0x24');break;case'IN':_0x22fa2d=_0x907b('0x25');break;case'CN':_0x22fa2d=_0x907b('0x26');break;default:_0x22fa2d=_0x907b('0x24');break;}var _0x1fdacc={'method':_0x907b('0x27'),'uri':_0x22fa2d+_0x907b('0x28'),'qs':{'refresh_token':_0x34db23[_0x907b('0x29')],'client_id':_0x34db23[_0x907b('0x2a')],'client_secret':_0x34db23['clientSecret'],'grant_type':_0x907b('0x2b')},'json':!![]};return rp(_0x1fdacc)['then'](function(_0x41017e){accountsTokens[_0x34db23['id']]={'access_token':_0x41017e[_0x907b('0x1f')],'expires_in':moment()[_0x907b('0x2c')](_0x41017e['expires_in'],'seconds')};_0x3b5c6e(_0x41017e[_0x907b('0x1f')]);})[_0x907b('0x2d')](function(_0x318239){logger[_0x907b('0x2e')](_0x907b('0x2f'),_0x318239[_0x907b('0x30')]);_0x3fe834(_0x318239);});});}function getUser(_0x100f98,_0x599099,_0x2b2b08,_0x270cfd){logger['info'](_0x907b('0x31'));return request({'method':_0x907b('0x32'),'uri':util[_0x907b('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x599099),'qs':{'type':_0x907b('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x100f98},'json':!![]})[_0x907b('0x35')](function(_0x346233){if(_0x346233[_0x907b('0x36')]){var _0x38a07d=-0x1;if(_[_0x907b('0x37')](_0x346233[_0x907b('0x36')])){if(!_[_0x907b('0x1e')](_0x270cfd)){_0x38a07d=_[_0x907b('0x38')](_0x346233[_0x907b('0x36')],function(_0xdbca52){return _0xdbca52[_0x907b('0x39')]===_0x270cfd;});}if(_0x38a07d>=0x0){logger['info'](_0x907b('0x3a'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x38a07d=_[_0x907b('0x38')](_0x346233['users'],function(_0x37c833){return _0x37c833[_0x907b('0x3b')][_0x907b('0x1b')]===_0x907b('0x3c');});}return _0x346233[_0x907b('0x36')][_0x38a07d];}else{if(_0x346233[_0x907b('0x3d')][_0x907b('0x3b')][_0x907b('0x1b')]===_0x907b('0x3c')){logger[_0x907b('0x3e')](_0x907b('0x3f'));user=_0x346233['user'];return user;}else{logger['error'](_0x907b('0x40'),JSON['stringify'](_0x346233));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x907b('0xe')](_0x346233));}}}else{logger['error'](_0x907b('0x40'),JSON[_0x907b('0xe')](_0x346233));throw new Error(_0x907b('0x41')+JSON[_0x907b('0xe')](_0x346233));}})[_0x907b('0x2d')](function(_0x15f89d){console['error'](_0x15f89d);});}function getZohoUser(_0x5c67ef,_0x345e92){return new BPromise(function(_0x2e7975,_0x1055b2){request(_0x5c67ef)[_0x907b('0x35')](function(_0xe52205){var _0x4e963f=null;if(_0xe52205){_0x4e963f=_0xe52205[_0x907b('0x42')][0x0];_0x4e963f[_0x907b('0x43')]=_0x345e92;}_0x2e7975(_0x4e963f);})['catch'](function(_0x27104f){_0x1055b2(_0x27104f);});});}function createEndUser(_0x648b6f,_0xeb4cef,_0x192c2c,_0x42799e,_0x52f536,_0x1525cb){var _0x192c2c=getName(_0x192c2c);return request({'method':_0x907b('0x27'),'uri':_0x907b('0x44')+_0xeb4cef+_0x907b('0x45')+_['startCase'](_0x1525cb[_0x907b('0x46')])+'s','body':{'data':[{'Last_Name':_0x192c2c[0x1],'First_Name':_0x192c2c[0x0],'Phone':_0x42799e,'Owner':{'name':!_[_0x907b('0x1e')](_0x52f536[_0x907b('0x47')]['name'])?_0x52f536[_0x907b('0x47')][_0x907b('0x1b')]:!_[_0x907b('0x1e')](_0x52f536[_0x907b('0x48')])?_0x52f536['first_name']+'\x20'+_0x52f536[_0x907b('0x49')]:_0x52f536[_0x907b('0x49')],'id':_0x52f536['id']}}]},'headers':{'Authorization':_0x907b('0x4a')+_0x648b6f},'json':!![]})[_0x907b('0x35')](function(_0x386b8a){if(_0x386b8a&&_0x386b8a[_0x907b('0x42')][0x0][_0x907b('0x4b')]==='SUCCESS'){var _0x5b55d3=_0x386b8a['data'][0x0]['details'];_0x5b55d3['enduserType']=_[_0x907b('0x4c')](_0x1525cb[_0x907b('0x46')])+'s';return _0x5b55d3;}logger[_0x907b('0x2e')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x907b('0x4d')+JSON['stringify'](data));})['catch'](function(_0x53e653){console[_0x907b('0x4e')](_0x907b('0x4f'),_0x53e653);});}function getEndUser(_0x15cee2,_0x3003c,_0x551b2e,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c){var _0x1cf274={'method':_0x907b('0x32'),'uri':'','headers':{'Authorization':_0x907b('0x4a')+_0x15cee2},'json':!![]};switch(_0x49a35c[_0x907b('0x50')]){case _0x907b('0x51'):_0x1cf274[_0x907b('0x52')]=_0x907b('0x44')+_0x3003c+_0x907b('0x53')+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,_0x907b('0x54'))[_0x907b('0x35')](function(_0x560668){if(_0x560668)return _0x560668;_0x1cf274[_0x907b('0x52')]='https://www.zohoapis.'+_0x3003c+_0x907b('0x55')+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,'Leads')[_0x907b('0x35')](function(_0x3bad4f){if(_0x3bad4f)return _0x3bad4f;if(_0x49a35c['moduleCreate']!=_0x907b('0x56')){return createEndUser(_0x15cee2,_0x3003c,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c);}else{return{};}});});break;case _0x907b('0x57'):_0x1cf274['uri']=_0x907b('0x44')+_0x3003c+_0x907b('0x53')+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,'Contacts')['then'](function(_0x284127){if(_0x284127)return _0x284127;if(_0x49a35c[_0x907b('0x46')]!=_0x907b('0x56')){return createEndUser(_0x15cee2,_0x3003c,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c);}else{return{};}});break;case _0x907b('0x58'):_0x1cf274[_0x907b('0x52')]=_0x907b('0x44')+_0x3003c+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3a8ff5+'))';return getZohoUser(_0x1cf274,'Leads')['then'](function(_0x387972){if(_0x387972)return _0x387972;if(_0x49a35c['moduleCreate']!=_0x907b('0x56')){return createEndUser(_0x15cee2,_0x3003c,_0x4d549f,_0x3a8ff5,_0x4ef7c4,_0x49a35c);}else{return{};}});break;}}function getCall(_0x2dbee8,_0x5e4de9,_0x3d8706,_0x54bca3,_0xc7b50a,_0x3f68d4,_0x2d4743,_0x1e6a07){logger[_0x907b('0x3e')](_0x907b('0x59'));var _0x4281c1={};_0x4281c1['Owner']={'name':!_[_0x907b('0x1e')](_0x54bca3[_0x907b('0x47')][_0x907b('0x1b')])&&!_[_0x907b('0x1e')](_0x54bca3[_0x907b('0x3b')][_0x907b('0x1b')])&&_0x54bca3[_0x907b('0x3b')][_0x907b('0x1b')]===_0x907b('0x5a')?_0x54bca3[_0x907b('0x47')]['name']:!_[_0x907b('0x1e')](_0x54bca3['first_name'])?_0x54bca3[_0x907b('0x48')]+'\x20'+_0x54bca3[_0x907b('0x49')]:_0x54bca3[_0x907b('0x49')],'id':_0x54bca3['id']};_0x4281c1['Subject']=intUtil[_0x907b('0x5b')](_0x3f68d4[_0x907b('0x5c')],_0x2d4743,'\x20');_0x4281c1[_0x907b('0x5d')]=intUtil[_0x907b('0x5b')](_0x3f68d4[_0x907b('0x5e')],_0x2d4743,'\x0a');if(_0xc7b50a[_0x907b('0x43')]==='Contacts'){_0x4281c1[_0x907b('0x5f')]={'name':!_[_0x907b('0x1e')](_0xc7b50a['Full_Name'])?_0xc7b50a[_0x907b('0x60')]:!_[_0x907b('0x1e')](_0xc7b50a[_0x907b('0x61')])?_0xc7b50a['First_Name']+'\x20'+_0xc7b50a[_0x907b('0x62')]:_0xc7b50a[_0x907b('0x62')],'id':_0xc7b50a['id']};}if(_0xc7b50a[_0x907b('0x43')]===_0x907b('0x63')){_0x4281c1[_0x907b('0x64')]={'name':!_[_0x907b('0x1e')](_0xc7b50a[_0x907b('0x60')])?_0xc7b50a[_0x907b('0x60')]:!_[_0x907b('0x1e')](_0xc7b50a['First_Name'])?_0xc7b50a[_0x907b('0x61')]+'\x20'+_0xc7b50a['Last_Name']:_0xc7b50a[_0x907b('0x62')],'id':_0xc7b50a['id']};_0x4281c1['$se_module']=_['startCase'](_0xc7b50a[_0x907b('0x43')]);}if(_0x2d4743[_0x907b('0x65')]){_0x4281c1[_0x907b('0x66')]=moment[_0x907b('0x67')](parseInt(_0x2d4743['talktime'])*0x3e8)[_0x907b('0x33')](_0x907b('0x68'));}else if(_0x2d4743['answertime']&&_0x2d4743[_0x907b('0x69')]){_0x4281c1[_0x907b('0x66')]=moment[_0x907b('0x67')](moment(_0x2d4743['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x907b('0x6a')](moment(_0x2d4743[_0x907b('0x6b')],_0x907b('0x6c'))))['format'](_0x907b('0x68'));}switch(_0x2d4743['lastevent']){case _0x907b('0x6d'):_0x4281c1[_0x907b('0x6e')]='Called';break;case _0x907b('0x6f'):case'connect':_0x4281c1[_0x907b('0x6e')]=_0x907b('0x70');break;case'rejected':_0x4281c1['Call_Result']=_0x907b('0x71');break;case'abandoned':_0x4281c1[_0x907b('0x6e')]=_0x907b('0x72');break;case _0x907b('0x73'):_0x4281c1[_0x907b('0x6e')]=_0x907b('0x74');default:}_0x4281c1[_0x907b('0x75')]=(_0x1e6a07===_0x907b('0x76')?moment(_0x2d4743[_0x907b('0x6b')])['format'](_0x907b('0x6c')):moment(_0x2d4743[_0x907b('0x77')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x907b('0x33')](_0x907b('0x6c'));_0x4281c1[_0x907b('0x78')]=_0x1e6a07||_0x907b('0x79');_0x4281c1=_[_0x907b('0x7a')](_0x4281c1,getCustomFields(_0x3f68d4[_0x907b('0x7b')],_0x2d4743));return request({'method':_0x907b('0x27'),'uri':_0x907b('0x44')+_0x5e4de9+_0x907b('0x7c'),'headers':{'Authorization':_0x907b('0x4a')+_0x2dbee8},'body':{'data':[_0x4281c1]},'json':!![]})['then'](function(_0x568782){if(_0x568782&&_0x568782['data'][0x0][_0x907b('0x4b')]===_0x907b('0x7d')){logger['info'](_0x907b('0x7e'));return{'id':_0x568782[_0x907b('0x42')][0x0][_0x907b('0x7f')]['id']};}})['catch'](function(_0x15cd89){logger[_0x907b('0x3e')]('err',_0x15cd89[_0x907b('0x30')]);console[_0x907b('0x4e')]('err',_0x15cd89);});}exports[_0x907b('0x80')]=function(_0x235e1f,_0x3cf6fb,_0x589014,_0x299a47,_0x2daf38,_0x11c5c3){var _0x4d5ee5,_0x3be9eb,_0x4ac25e;_0x11c5c3['host']=intUtil[_0x907b('0x81')](_0x11c5c3[_0x907b('0x82')]);_0x11c5c3['serverUrl']=intUtil[_0x907b('0x81')](_0x11c5c3[_0x907b('0x83')]);if(_0x2daf38&&_0x2daf38['monitor_format']){logger['info'](_0x907b('0x84'),'Recording\x20is\x20enabled!');_0x3cf6fb['recordingURL']=_0x11c5c3['serverUrl']+_0x907b('0x85')+_0x3cf6fb[_0x907b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x3cf6fb['uniqueid']);}else{_0x3cf6fb[_0x907b('0x87')]='';}var _0x3fce6e=_0x11c5c3[_0x907b('0x82')]===_0x907b('0x88')?'eu':'com';return getAccessToken(_0x11c5c3)[_0x907b('0x35')](function(_0x354a6e){_0x4ac25e=_0x354a6e;return getUser(_0x4ac25e,_0x3fce6e,_0x11c5c3,_0x299a47[_0x907b('0x39')]);})[_0x907b('0x35')](function(_0x19eb61){_0x4d5ee5=_0x19eb61;logger[_0x907b('0x3e')](_0x907b('0x89'),_0x4d5ee5['id']);return getEndUser(_0x4ac25e,_0x3fce6e,_0x11c5c3,_0x3cf6fb[_0x907b('0x8a')],_0x3cf6fb[_0x907b('0x8b')],_0x4d5ee5,_0x589014);})['then'](function(_0x3b9415){_0x3be9eb=_0x3b9415;return getCall(_0x4ac25e,_0x3fce6e,_0x11c5c3,_0x4d5ee5,_0x3be9eb,_0x589014,_0x3cf6fb,_0x907b('0x79'));})[_0x907b('0x35')](function(_0x4af64c){if(_0x4af64c){logger['info'](_0x907b('0x8c'),_0x4af64c['id']);logger['info'](_0x907b('0x84'),_0x907b('0x8d'));emit(util[_0x907b('0x33')](_0x907b('0x8e'),_0x299a47[_0x907b('0x1b')]),_0x907b('0x8f'),{'uri':'https://crm.'+_0x11c5c3[_0x907b('0x82')]+_0x907b('0x90')+_0x4af64c['id']});}})[_0x907b('0x2d')](function(_0x2ed3e1){logger[_0x907b('0x2e')](_0x907b('0x84'),JSON['stringify'](_0x2ed3e1));});};exports['outbound']=function(_0x44a407,_0x19e18a,_0x4fdfee,_0x11cee4,_0x5c5363,_0x5f512f,_0x447835){var _0x10da00,_0x243342,_0x57bdab;_0x5f512f['host']=intUtil[_0x907b('0x81')](_0x5f512f[_0x907b('0x82')]);_0x5f512f[_0x907b('0x83')]=intUtil[_0x907b('0x81')](_0x5f512f[_0x907b('0x83')]);if(_0x447835&&_0x447835[_0x907b('0x91')]&&_0x447835[_0x907b('0x91')]!==_0x907b('0x92')){logger['info'](_0x907b('0x93'),_0x907b('0x94'));_0x19e18a[_0x907b('0x87')]=_0x5f512f['serverUrl']+'/api/voice/recordings/'+_0x19e18a[_0x907b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x19e18a['uniqueid']);}var _0x5e2d82=_0x5f512f[_0x907b('0x82')]===_0x907b('0x88')?'eu':_0x907b('0x95');return getAccessToken(_0x5f512f)['then'](function(_0x3a2cd8){_0x57bdab=_0x3a2cd8;return getUser(_0x57bdab,_0x5e2d82,_0x5f512f,_0x11cee4[_0x907b('0x39')]);})[_0x907b('0x35')](function(_0x2d7fc6){_0x10da00=_0x2d7fc6;logger[_0x907b('0x3e')](_0x907b('0x89'),_0x10da00['id']);return getEndUser(_0x57bdab,_0x5e2d82,_0x5f512f,_0x19e18a[_0x907b('0x96')],_0x19e18a[_0x907b('0x97')],_0x10da00,_0x4fdfee);})[_0x907b('0x35')](function(_0x3ad8af){_0x243342=_0x3ad8af;return getCall(_0x57bdab,_0x5e2d82,_0x5f512f,_0x10da00,_0x243342,_0x4fdfee,_0x19e18a,_0x907b('0x98'));})[_0x907b('0x35')](function(_0x5871b1){if(_0x5871b1){logger['info'](_0x907b('0x8c'),_0x5871b1['id']);logger[_0x907b('0x3e')](_0x907b('0x93'),_0x907b('0x8d'));emit(util[_0x907b('0x33')](_0x907b('0x8e'),_0x11cee4[_0x907b('0x1b')]),_0x907b('0x8f'),{'uri':'https://crm.'+_0x5f512f[_0x907b('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5871b1['id']});}})[_0x907b('0x2d')](function(_0x56d48d){logger['error'](_0x907b('0x93'),JSON[_0x907b('0xe')](_0x56d48d));});};exports[_0x907b('0x99')]=function(_0x3a37d0,_0x28b73d,_0x3e3b99,_0x5c13ec,_0x56f5f8,_0x5df7d5){var _0x21d9b3,_0x1f1268,_0x4b1f4a;_0x5df7d5[_0x907b('0x82')]=intUtil['stripTrailingSlash'](_0x5df7d5['host']);_0x5df7d5[_0x907b('0x83')]=intUtil[_0x907b('0x81')](_0x5df7d5[_0x907b('0x83')]);if(_0x56f5f8&&_0x56f5f8['monitor_format']){logger[_0x907b('0x3e')]('['+_0x28b73d[_0x907b('0x9a')][_0x907b('0x9b')]()+']',_0x907b('0x94'));_0x28b73d[_0x907b('0x87')]=_0x5df7d5[_0x907b('0x83')]+_0x907b('0x85')+_0x28b73d[_0x907b('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x28b73d[_0x907b('0x86')]);}else{_0x28b73d[_0x907b('0x87')]='';}var _0x53d085=_0x5df7d5['host']==='zoho.eu'?'eu':_0x907b('0x95');return getAccessToken(_0x5df7d5)['then'](function(_0x2498a5){_0x4b1f4a=_0x2498a5;return getUser(_0x4b1f4a,_0x53d085,_0x5df7d5);})[_0x907b('0x35')](function(_0x5d9152){_0x21d9b3=_0x5d9152;logger[_0x907b('0x3e')]('The\x20User\x20ID\x20is:',_0x21d9b3['id']);return getEndUser(_0x4b1f4a,_0x53d085,_0x5df7d5,_0x28b73d[_0x907b('0x8a')],_0x28b73d[_0x907b('0x8b')],_0x21d9b3,_0x3e3b99);})[_0x907b('0x35')](function(_0x251f14){_0x1f1268=_0x251f14;return getCall(_0x4b1f4a,_0x53d085,_0x5df7d5,_0x21d9b3,_0x1f1268,_0x3e3b99,_0x28b73d,_0x907b('0x79'));})['then'](function(_0x420fdc){if(_0x420fdc){logger[_0x907b('0x3e')](_0x907b('0x8c'),_0x420fdc['id']);}})[_0x907b('0x2d')](function(_0x45a1c5){logger[_0x907b('0x2e')]('['+_0x28b73d[_0x907b('0x9a')][_0x907b('0x9b')]()+']',JSON['stringify'](_0x45a1c5));});}; \ No newline at end of file +var _0x7dbe=['abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','calleridnum','Inbound','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','emit','debug','[HTTP]','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','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','then','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','complete','connect','Answered','Rejected'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dbe,0x16d));var _0xe7db=function(_0x26a137,_0x238c59){_0x26a137=_0x26a137-0x0;var _0x3049d3=_0x7dbe[_0x26a137];return _0x3049d3;};'use strict';var _=require(_0xe7db('0x0'));var rp=require('request-promise');var md5=require(_0xe7db('0x1'));var util=require(_0xe7db('0x2'));var intUtil=require(_0xe7db('0x3'));var moment=require(_0xe7db('0x4'));var Redis=require(_0xe7db('0x5'));var BPromise=require(_0xe7db('0x6'));var config=require(_0xe7db('0x7'));var logger=require(_0xe7db('0x8'))('zoho');config[_0xe7db('0x9')]=_[_0xe7db('0xa')](config[_0xe7db('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe7db('0x9')]));function emit(_0x1811a3,_0x1c2221,_0x52653a){io['to'](_0x1811a3)[_0xe7db('0xb')](_0x1c2221,_0x52653a);}function request(_0x1b725b){logger[_0xe7db('0xc')](_0xe7db('0xd'),JSON['stringify'](_0x1b725b));return rp(_0x1b725b);}function getCustomFields(_0x3324ec,_0x229285){var _0x59e66f={};if(_0x3324ec['length']>0x0){_[_0xe7db('0xe')](_0x3324ec,function(_0x37ce6c){if(_[_0xe7db('0xf')]([_0xe7db('0x10'),_0xe7db('0x11')],_0x37ce6c[_0xe7db('0x12')])&&_0x37ce6c['idField']){_0x59e66f[_0x37ce6c[_0xe7db('0x13')]]=_0x37ce6c[_0xe7db('0x14')]['toString']();}else if(_0x37ce6c['type']===_0xe7db('0x15')&&_0x37ce6c[_0xe7db('0x16')]&&_0x37ce6c['idField']&&_0x229285[_0x37ce6c[_0xe7db('0x16')]]){_0x59e66f[_0x37ce6c[_0xe7db('0x13')]]=_0x229285[_0x37ce6c[_0xe7db('0x16')]][_0xe7db('0x17')]();}else if(_0x37ce6c[_0xe7db('0x12')]===_0xe7db('0x18')&&_0x37ce6c[_0xe7db('0x19')]&&_0x37ce6c['Variable'][_0xe7db('0x1a')]&&_0x37ce6c[_0xe7db('0x13')]&&_0x229285[_0x37ce6c['Variable'][_0xe7db('0x1a')][_0xe7db('0x1b')]()]){_0x59e66f[_0x37ce6c[_0xe7db('0x13')]]=_0x229285[_0x37ce6c[_0xe7db('0x19')][_0xe7db('0x1a')][_0xe7db('0x1b')]()][_0xe7db('0x17')]();}});}return _0x59e66f;}function getName(_0x49f03f){if(_0x49f03f[_0xe7db('0x1c')]('\x20')>0x0){var _0x1f5d12=_0x49f03f['split'](/ (.+)/);if(_0x1f5d12[0x1]){return _0x1f5d12;}}return[_0x49f03f,_0x49f03f];}var accountsTokens={};function getAccessToken(_0x641144){return new Promise(function(_0x2b14a2,_0x14cc6a){if(!_['isNil'](accountsTokens[_0x641144['id']])&&!_[_0xe7db('0x1d')](accountsTokens[_0x641144['id']][_0xe7db('0x1e')])){if(moment()['isBefore'](accountsTokens[_0x641144['id']][_0xe7db('0x1f')])){_0x2b14a2(accountsTokens[_0x641144['id']][_0xe7db('0x1e')]);}}var _0x31e91d;switch(_0x641144[_0xe7db('0x20')]){case'US':_0x31e91d=_0xe7db('0x21');break;case'AU':_0x31e91d=_0xe7db('0x22');break;case'EU':_0x31e91d=_0xe7db('0x23');break;case'IN':_0x31e91d=_0xe7db('0x24');break;case'CN':_0x31e91d=_0xe7db('0x25');break;default:_0x31e91d=_0xe7db('0x23');break;}var _0x21e4e7={'method':_0xe7db('0x26'),'uri':_0x31e91d+_0xe7db('0x27'),'qs':{'refresh_token':_0x641144[_0xe7db('0x28')],'client_id':_0x641144[_0xe7db('0x29')],'client_secret':_0x641144[_0xe7db('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x21e4e7)[_0xe7db('0x2b')](function(_0x2c0675){accountsTokens[_0x641144['id']]={'access_token':_0x2c0675[_0xe7db('0x1e')],'expires_in':moment()['add'](_0x2c0675[_0xe7db('0x1f')],'seconds')};_0x2b14a2(_0x2c0675[_0xe7db('0x1e')]);})[_0xe7db('0x2c')](function(_0x4dd3e4){logger['error'](_0xe7db('0x2d'),_0x4dd3e4[_0xe7db('0x2e')]);_0x14cc6a(_0x4dd3e4);});});}function getUser(_0x5d2666,_0x2f3714,_0x544699,_0x19337f){logger[_0xe7db('0x2f')](_0xe7db('0x30'));return request({'method':_0xe7db('0x31'),'uri':util[_0xe7db('0x32')](_0xe7db('0x33'),_0x2f3714),'qs':{'type':_0xe7db('0x34')},'headers':{'Authorization':_0xe7db('0x35')+_0x5d2666},'json':!![]})['then'](function(_0x55ad21){if(_0x55ad21[_0xe7db('0x36')]){var _0x9c80c9=-0x1;if(_[_0xe7db('0x37')](_0x55ad21[_0xe7db('0x36')])){if(!_[_0xe7db('0x1d')](_0x19337f)){_0x9c80c9=_[_0xe7db('0x38')](_0x55ad21[_0xe7db('0x36')],function(_0x4b212e){return _0x4b212e[_0xe7db('0x39')]===_0x19337f;});}if(_0x9c80c9>=0x0){logger['info'](_0xe7db('0x3a'));}else{logger[_0xe7db('0x2f')](_0xe7db('0x3b'));_0x9c80c9=_[_0xe7db('0x38')](_0x55ad21[_0xe7db('0x36')],function(_0x1f714a){return _0x1f714a['profile'][_0xe7db('0x1a')]===_0xe7db('0x3c');});}return _0x55ad21['users'][_0x9c80c9];}else{if(_0x55ad21[_0xe7db('0x3d')][_0xe7db('0x3e')]['name']===_0xe7db('0x3c')){logger['info'](_0xe7db('0x3b'));user=_0x55ad21[_0xe7db('0x3d')];return user;}else{logger[_0xe7db('0x3f')](_0xe7db('0x40'),JSON[_0xe7db('0x41')](_0x55ad21));throw new Error(_0xe7db('0x42')+JSON[_0xe7db('0x41')](_0x55ad21));}}}else{logger[_0xe7db('0x3f')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x55ad21));throw new Error(_0xe7db('0x42')+JSON['stringify'](_0x55ad21));}})[_0xe7db('0x2c')](function(_0x45fb27){console[_0xe7db('0x3f')](_0x45fb27);});}function getZohoUser(_0x1dc1ab,_0x4c6d9b){return new BPromise(function(_0x3a2e5c,_0x1cff2a){request(_0x1dc1ab)['then'](function(_0x2e0bbc){var _0x101f8b=null;if(_0x2e0bbc){_0x101f8b=_0x2e0bbc[_0xe7db('0x43')][0x0];_0x101f8b[_0xe7db('0x44')]=_0x4c6d9b;}_0x3a2e5c(_0x101f8b);})[_0xe7db('0x2c')](function(_0x5d5040){_0x1cff2a(_0x5d5040);});});}function createEndUser(_0x4edacf,_0x3e4cbf,_0x4d44f4,_0x35414c,_0xd7c862,_0x52085a){var _0x4d44f4=getName(_0x4d44f4);return request({'method':_0xe7db('0x26'),'uri':_0xe7db('0x45')+_0x3e4cbf+'/crm/v2/'+_[_0xe7db('0x46')](_0x52085a['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4d44f4[0x1],'First_Name':_0x4d44f4[0x0],'Phone':_0x35414c,'Owner':{'name':!_[_0xe7db('0x1d')](_0xd7c862['role'][_0xe7db('0x1a')])?_0xd7c862[_0xe7db('0x47')][_0xe7db('0x1a')]:!_[_0xe7db('0x1d')](_0xd7c862[_0xe7db('0x48')])?_0xd7c862['first_name']+'\x20'+_0xd7c862[_0xe7db('0x49')]:_0xd7c862[_0xe7db('0x49')],'id':_0xd7c862['id']}}]},'headers':{'Authorization':_0xe7db('0x35')+_0x4edacf},'json':!![]})[_0xe7db('0x2b')](function(_0x4fa927){if(_0x4fa927&&_0x4fa927[_0xe7db('0x43')][0x0][_0xe7db('0x4a')]===_0xe7db('0x4b')){var _0x32a8b6=_0x4fa927[_0xe7db('0x43')][0x0]['details'];_0x32a8b6[_0xe7db('0x44')]=_['startCase'](_0x52085a['moduleCreate'])+'s';return _0x32a8b6;}logger[_0xe7db('0x3f')](_0xe7db('0x40'),JSON[_0xe7db('0x41')](data));throw new Error(_0xe7db('0x4c')+JSON['stringify'](data));})[_0xe7db('0x2c')](function(_0x18d704){console[_0xe7db('0x4d')](_0xe7db('0x4e'),_0x18d704);});}function getEndUser(_0x5eadda,_0x37d362,_0x4613b7,_0x32dfa4,_0x4be2b4,_0x1fa626,_0x41eb7e){var _0x40177f={'method':_0xe7db('0x31'),'uri':'','headers':{'Authorization':_0xe7db('0x35')+_0x5eadda},'json':!![]};switch(_0x41eb7e[_0xe7db('0x4f')]){case _0xe7db('0x50'):_0x40177f[_0xe7db('0x51')]='https://www.zohoapis.'+_0x37d362+_0xe7db('0x52')+_0x4be2b4+'))';return getZohoUser(_0x40177f,_0xe7db('0x53'))[_0xe7db('0x2b')](function(_0x4b95c8){if(_0x4b95c8)return _0x4b95c8;_0x40177f[_0xe7db('0x51')]='https://www.zohoapis.'+_0x37d362+_0xe7db('0x54')+_0x4be2b4+'))';return getZohoUser(_0x40177f,_0xe7db('0x55'))['then'](function(_0x2cf2d3){if(_0x2cf2d3)return _0x2cf2d3;if(_0x41eb7e[_0xe7db('0x56')]!=_0xe7db('0x57')){return createEndUser(_0x5eadda,_0x37d362,_0x32dfa4,_0x4be2b4,_0x1fa626,_0x41eb7e);}else{return{};}});});break;case _0xe7db('0x58'):_0x40177f[_0xe7db('0x51')]=_0xe7db('0x45')+_0x37d362+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4be2b4+'))';return getZohoUser(_0x40177f,_0xe7db('0x53'))['then'](function(_0x39afd9){if(_0x39afd9)return _0x39afd9;if(_0x41eb7e[_0xe7db('0x56')]!=_0xe7db('0x57')){return createEndUser(_0x5eadda,_0x37d362,_0x32dfa4,_0x4be2b4,_0x1fa626,_0x41eb7e);}else{return{};}});break;case _0xe7db('0x59'):_0x40177f[_0xe7db('0x51')]='https://www.zohoapis.'+_0x37d362+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4be2b4+'))';return getZohoUser(_0x40177f,'Leads')['then'](function(_0x516607){if(_0x516607)return _0x516607;if(_0x41eb7e[_0xe7db('0x56')]!=_0xe7db('0x57')){return createEndUser(_0x5eadda,_0x37d362,_0x32dfa4,_0x4be2b4,_0x1fa626,_0x41eb7e);}else{return{};}});break;}}function getCall(_0x5299cf,_0x104cef,_0xc383cb,_0x46dce2,_0x14b693,_0x412028,_0x3a94ef,_0x275e09){logger[_0xe7db('0x2f')](_0xe7db('0x5a'));var _0x54ffa7={};_0x54ffa7[_0xe7db('0x5b')]={'name':!_['isNil'](_0x46dce2[_0xe7db('0x47')][_0xe7db('0x1a')])&&!_[_0xe7db('0x1d')](_0x46dce2[_0xe7db('0x3e')][_0xe7db('0x1a')])&&_0x46dce2[_0xe7db('0x3e')][_0xe7db('0x1a')]===_0xe7db('0x5c')?_0x46dce2[_0xe7db('0x47')][_0xe7db('0x1a')]:!_[_0xe7db('0x1d')](_0x46dce2['first_name'])?_0x46dce2[_0xe7db('0x48')]+'\x20'+_0x46dce2[_0xe7db('0x49')]:_0x46dce2[_0xe7db('0x49')],'id':_0x46dce2['id']};_0x54ffa7[_0xe7db('0x5d')]=intUtil[_0xe7db('0x5e')](_0x412028[_0xe7db('0x5f')],_0x3a94ef,'\x20');_0x54ffa7[_0xe7db('0x60')]=intUtil['getString'](_0x412028['Descriptions'],_0x3a94ef,'\x0a');if(_0x14b693[_0xe7db('0x44')]===_0xe7db('0x53')){_0x54ffa7['Who_Id']={'name':!_[_0xe7db('0x1d')](_0x14b693[_0xe7db('0x61')])?_0x14b693[_0xe7db('0x61')]:!_[_0xe7db('0x1d')](_0x14b693['First_Name'])?_0x14b693['First_Name']+'\x20'+_0x14b693[_0xe7db('0x62')]:_0x14b693['Last_Name'],'id':_0x14b693['id']};}if(_0x14b693['enduserType']===_0xe7db('0x55')){_0x54ffa7[_0xe7db('0x63')]={'name':!_['isNil'](_0x14b693['Full_Name'])?_0x14b693['Full_Name']:!_['isNil'](_0x14b693[_0xe7db('0x64')])?_0x14b693[_0xe7db('0x64')]+'\x20'+_0x14b693[_0xe7db('0x62')]:_0x14b693[_0xe7db('0x62')],'id':_0x14b693['id']};_0x54ffa7[_0xe7db('0x65')]=_[_0xe7db('0x46')](_0x14b693[_0xe7db('0x44')]);}if(_0x3a94ef[_0xe7db('0x66')]){_0x54ffa7[_0xe7db('0x67')]=moment[_0xe7db('0x68')](parseInt(_0x3a94ef[_0xe7db('0x66')])*0x3e8)['format']('mm:ss');}else if(_0x3a94ef[_0xe7db('0x69')]&&_0x3a94ef[_0xe7db('0x6a')]){_0x54ffa7[_0xe7db('0x67')]=moment[_0xe7db('0x68')](moment(_0x3a94ef[_0xe7db('0x6a')],_0xe7db('0x6b'))[_0xe7db('0x6c')](moment(_0x3a94ef[_0xe7db('0x6d')],_0xe7db('0x6b'))))[_0xe7db('0x32')](_0xe7db('0x6e'));}switch(_0x3a94ef[_0xe7db('0x6f')]){case _0xe7db('0x70'):_0x54ffa7[_0xe7db('0x71')]='Called';break;case _0xe7db('0x72'):case _0xe7db('0x73'):_0x54ffa7[_0xe7db('0x71')]=_0xe7db('0x74');break;case'rejected':_0x54ffa7[_0xe7db('0x71')]=_0xe7db('0x75');break;case _0xe7db('0x76'):_0x54ffa7[_0xe7db('0x71')]='Abandoned';break;case _0xe7db('0x77'):_0x54ffa7[_0xe7db('0x71')]=_0xe7db('0x78');default:}_0x54ffa7[_0xe7db('0x79')]=(_0x275e09==='outbound'?moment(_0x3a94ef['starttime'])[_0xe7db('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x3a94ef[_0xe7db('0x7a')])[_0xe7db('0x32')](_0xe7db('0x6b')))||moment()[_0xe7db('0x32')]('YYYY-MM-DDTHH:mm:ss');_0x54ffa7[_0xe7db('0x7b')]=_0x275e09||'Inbound';_0x54ffa7=_[_0xe7db('0x7c')](_0x54ffa7,getCustomFields(_0x412028[_0xe7db('0x7d')],_0x3a94ef));return request({'method':_0xe7db('0x26'),'uri':'https://www.zohoapis.'+_0x104cef+_0xe7db('0x7e'),'headers':{'Authorization':_0xe7db('0x35')+_0x5299cf},'body':{'data':[_0x54ffa7]},'json':!![]})[_0xe7db('0x2b')](function(_0x20ce79){if(_0x20ce79&&_0x20ce79[_0xe7db('0x43')][0x0][_0xe7db('0x4a')]===_0xe7db('0x4b')){logger['info'](_0xe7db('0x7f'));return{'id':_0x20ce79[_0xe7db('0x43')][0x0][_0xe7db('0x80')]['id']};}})[_0xe7db('0x2c')](function(_0x43958e){logger[_0xe7db('0x2f')]('err',_0x43958e[_0xe7db('0x2e')]);console[_0xe7db('0x4d')](_0xe7db('0x81'),_0x43958e);});}exports[_0xe7db('0x82')]=function(_0x2c6adf,_0x11c6ff,_0x2ff72c,_0x29b348,_0x1badbf,_0x42c13c){var _0x58de3c,_0x37fc98,_0x135205;_0x42c13c[_0xe7db('0x83')]=intUtil[_0xe7db('0x84')](_0x42c13c[_0xe7db('0x83')]);_0x42c13c[_0xe7db('0x85')]=intUtil[_0xe7db('0x84')](_0x42c13c[_0xe7db('0x85')]);if(_0x1badbf&&_0x1badbf[_0xe7db('0x86')]){logger[_0xe7db('0x2f')](_0xe7db('0x87'),_0xe7db('0x88'));_0x11c6ff[_0xe7db('0x89')]=_0x42c13c['serverUrl']+_0xe7db('0x8a')+_0x11c6ff['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x11c6ff[_0xe7db('0x8b')]);}else{_0x11c6ff[_0xe7db('0x89')]='';}var _0x3eb934=_0x42c13c[_0xe7db('0x83')]===_0xe7db('0x8c')?'eu':_0xe7db('0x8d');return getAccessToken(_0x42c13c)[_0xe7db('0x2b')](function(_0x18c16e){_0x135205=_0x18c16e;return getUser(_0x135205,_0x3eb934,_0x42c13c,_0x29b348[_0xe7db('0x39')]);})[_0xe7db('0x2b')](function(_0x114884){_0x58de3c=_0x114884;logger[_0xe7db('0x2f')](_0xe7db('0x8e'),_0x58de3c['id']);return getEndUser(_0x135205,_0x3eb934,_0x42c13c,_0x11c6ff[_0xe7db('0x8f')],_0x11c6ff['calleridnum'],_0x58de3c,_0x2ff72c);})[_0xe7db('0x2b')](function(_0x3dc8b2){_0x37fc98=_0x3dc8b2;return getCall(_0x135205,_0x3eb934,_0x42c13c,_0x58de3c,_0x37fc98,_0x2ff72c,_0x11c6ff,'Inbound');})[_0xe7db('0x2b')](function(_0x4ae9ae){if(_0x4ae9ae){logger[_0xe7db('0x2f')]('The\x20Call\x20ID\x20is:',_0x4ae9ae['id']);logger[_0xe7db('0x2f')](_0xe7db('0x87'),_0xe7db('0x90'));emit(util[_0xe7db('0x32')](_0xe7db('0x91'),_0x29b348[_0xe7db('0x1a')]),_0xe7db('0x92'),{'uri':_0xe7db('0x93')+_0x42c13c[_0xe7db('0x83')]+_0xe7db('0x94')+_0x4ae9ae['id']});}})['catch'](function(_0x13eb5e){logger[_0xe7db('0x3f')](_0xe7db('0x87'),JSON[_0xe7db('0x41')](_0x13eb5e));});};exports[_0xe7db('0x95')]=function(_0x764931,_0xa8493d,_0x2f7752,_0x45225d,_0x42ff26,_0x218653,_0x49bf8f){var _0x5426d5,_0x109603,_0x1bfe12;_0x218653[_0xe7db('0x83')]=intUtil[_0xe7db('0x84')](_0x218653[_0xe7db('0x83')]);_0x218653['serverUrl']=intUtil[_0xe7db('0x84')](_0x218653[_0xe7db('0x85')]);if(_0x49bf8f&&_0x49bf8f['recordingFormat']&&_0x49bf8f['recordingFormat']!==_0xe7db('0x96')){logger['info'](_0xe7db('0x97'),'Recording\x20is\x20enabled!');_0xa8493d['recordingURL']=_0x218653['serverUrl']+_0xe7db('0x8a')+_0xa8493d['uniqueid']+_0xe7db('0x98')+md5(_0xa8493d[_0xe7db('0x8b')]);}var _0x57e8e6=_0x218653[_0xe7db('0x83')]===_0xe7db('0x8c')?'eu':_0xe7db('0x8d');return getAccessToken(_0x218653)[_0xe7db('0x2b')](function(_0x102ff9){_0x1bfe12=_0x102ff9;return getUser(_0x1bfe12,_0x57e8e6,_0x218653,_0x45225d[_0xe7db('0x39')]);})[_0xe7db('0x2b')](function(_0x13af21){_0x5426d5=_0x13af21;logger[_0xe7db('0x2f')](_0xe7db('0x8e'),_0x5426d5['id']);return getEndUser(_0x1bfe12,_0x57e8e6,_0x218653,_0xa8493d[_0xe7db('0x99')],_0xa8493d[_0xe7db('0x9a')],_0x5426d5,_0x2f7752);})[_0xe7db('0x2b')](function(_0x45150f){_0x109603=_0x45150f;return getCall(_0x1bfe12,_0x57e8e6,_0x218653,_0x5426d5,_0x109603,_0x2f7752,_0xa8493d,_0xe7db('0x9b'));})[_0xe7db('0x2b')](function(_0x5165ba){if(_0x5165ba){logger[_0xe7db('0x2f')](_0xe7db('0x9c'),_0x5165ba['id']);logger['info']('[OUTBOUND]',_0xe7db('0x90'));emit(util[_0xe7db('0x32')]('user:%s',_0x45225d['name']),'trigger:browser:url',{'uri':_0xe7db('0x93')+_0x218653[_0xe7db('0x83')]+_0xe7db('0x94')+_0x5165ba['id']});}})[_0xe7db('0x2c')](function(_0x4baa4b){logger[_0xe7db('0x3f')](_0xe7db('0x97'),JSON[_0xe7db('0x41')](_0x4baa4b));});};exports[_0xe7db('0x9d')]=function(_0xd60fa1,_0x197153,_0x3e87ad,_0x325309,_0x122eef,_0x36854d){var _0x4df407,_0x60ccac,_0x1239db;_0x36854d[_0xe7db('0x83')]=intUtil[_0xe7db('0x84')](_0x36854d[_0xe7db('0x83')]);_0x36854d['serverUrl']=intUtil[_0xe7db('0x84')](_0x36854d['serverUrl']);if(_0x122eef&&_0x122eef[_0xe7db('0x86')]){logger[_0xe7db('0x2f')]('['+_0x197153[_0xe7db('0x6f')][_0xe7db('0x9e')]()+']',_0xe7db('0x88'));_0x197153['recordingURL']=_0x36854d[_0xe7db('0x85')]+_0xe7db('0x8a')+_0x197153[_0xe7db('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x197153['uniqueid']);}else{_0x197153['recordingURL']='';}var _0x53499b=_0x36854d[_0xe7db('0x83')]===_0xe7db('0x8c')?'eu':'com';return getAccessToken(_0x36854d)['then'](function(_0x5abb4f){_0x1239db=_0x5abb4f;return getUser(_0x1239db,_0x53499b,_0x36854d);})['then'](function(_0x3bf2b3){_0x4df407=_0x3bf2b3;logger['info'](_0xe7db('0x8e'),_0x4df407['id']);return getEndUser(_0x1239db,_0x53499b,_0x36854d,_0x197153['calleridname'],_0x197153[_0xe7db('0x9f')],_0x4df407,_0x3e87ad);})[_0xe7db('0x2b')](function(_0x289180){_0x60ccac=_0x289180;return getCall(_0x1239db,_0x53499b,_0x36854d,_0x4df407,_0x60ccac,_0x3e87ad,_0x197153,_0xe7db('0xa0'));})[_0xe7db('0x2b')](function(_0x305efc){if(_0x305efc){logger[_0xe7db('0x2f')](_0xe7db('0x9c'),_0x305efc['id']);}})[_0xe7db('0x2c')](function(_0x2babf5){logger[_0xe7db('0x3f')]('['+_0x197153[_0xe7db('0x6f')][_0xe7db('0x9e')]()+']',JSON[_0xe7db('0x41')](_0x2babf5));});}; \ 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 c4a53a6..26730e2 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 _0xfc0b=['data3','render','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0xfc0b,0x1cd));var _0xbfc0=function(_0x4d6bd9,_0x497295){_0x4d6bd9=_0x4d6bd9-0x0;var _0x348d88=_0xfc0b[_0x4d6bd9];return _0x348d88;};'use strict';var util=require(_0xbfc0('0x0'));var sh=require(_0xbfc0('0x1'));var Mustache=require('mustache');var logger=require(_0xbfc0('0x2'))(_0xbfc0('0x3'));exports[_0xbfc0('0x4')]=function(_0x40092d,_0xb82fa4){var _0x323acb=_0x40092d['data2']?_0x40092d[_0xbfc0('0x5')]:_0xbfc0('0x6');var _0x219909=_0x40092d[_0xbfc0('0x7')]?Mustache[_0xbfc0('0x8')](_0x40092d[_0xbfc0('0x7')],_0xb82fa4):_0xb82fa4;sh[_0xbfc0('0x4')](_0x219909,function(_0x23f50b,_0x35f646,_0x264444){if(_0x23f50b!==0x0){logger['error'](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x323acb,_0x219909,_0x23f50b,_0x264444));}else{logger[_0xbfc0('0x9')](util[_0xbfc0('0xa')](_0xbfc0('0xb'),_0x323acb,_0x219909,_0x35f646));}});}; \ No newline at end of file +var _0xa3a0=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x4f1b87,_0x260834){var _0x74718e=function(_0x24c7c2){while(--_0x24c7c2){_0x4f1b87['push'](_0x4f1b87['shift']());}};_0x74718e(++_0x260834);}(_0xa3a0,0x11a));var _0x0a3a=function(_0x2c1f41,_0xc56665){_0x2c1f41=_0x2c1f41-0x0;var _0x53a353=_0xa3a0[_0x2c1f41];return _0x53a353;};'use strict';var util=require(_0x0a3a('0x0'));var sh=require(_0x0a3a('0x1'));var Mustache=require(_0x0a3a('0x2'));var logger=require('../../../../config/logger')(_0x0a3a('0x3'));exports[_0x0a3a('0x4')]=function(_0x735ce1,_0xf604ce){var _0x38a2d1=_0x735ce1[_0x0a3a('0x5')]?_0x735ce1['data2']:_0x0a3a('0x6');var _0x58475f=_0x735ce1[_0x0a3a('0x7')]?Mustache[_0x0a3a('0x8')](_0x735ce1[_0x0a3a('0x7')],_0xf604ce):_0xf604ce;sh[_0x0a3a('0x4')](_0x58475f,function(_0x4578e9,_0x2fe8f7,_0x2b9a07){if(_0x4578e9!==0x0){logger[_0x0a3a('0x9')](util[_0x0a3a('0xa')](_0x0a3a('0xb'),_0x38a2d1,_0x58475f,_0x4578e9,_0x2b9a07));}else{logger[_0x0a3a('0xc')](util[_0x0a3a('0xa')](_0x0a3a('0xd'),_0x38a2d1,_0x58475f,_0x2fe8f7));}});}; \ 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 78e6289..0ca59f8 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 _0x2f06=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','data2','name','message','request-promise','util','lodash','mustache','trigger','exec','render','number','data5','parse','data6','stack','data1','GET','DELETE','POST','data7','body','error','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','info','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f06,0x10f));var _0x62f0=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2f06[_0x15bc81];return _0x59440e;};'use strict';var rp=require(_0x62f0('0x0'));var util=require(_0x62f0('0x1'));var _=require(_0x62f0('0x2'));var Mustache=require(_0x62f0('0x3'));var logger=require('../../../../config/logger')(_0x62f0('0x4'));exports[_0x62f0('0x5')]=function(_0x2130a0,_0x1119e8){var _0x228cb7,_0x57af5c;var _0x45991e={'method':_0x2130a0['data1']['toUpperCase'](),'uri':Mustache[_0x62f0('0x6')](_0x2130a0['data2'],_0x1119e8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2130a0['data5'])===_0x62f0('0x7')&&parseInt(_0x2130a0[_0x62f0('0x8')])>=0x1&&parseInt(_0x2130a0[_0x62f0('0x8')])<=0xa?parseInt(_0x2130a0[_0x62f0('0x8')])*0x3e8:0x5*0x3e8};try{_0x45991e['headers']=_0x2130a0['data6']?JSON[_0x62f0('0x9')](Mustache['render'](_0x2130a0[_0x62f0('0xa')],_0x1119e8)):{};}catch(_0x3ac711){logger['error'](_0x3ac711[_0x62f0('0xb')]);}switch(_0x2130a0[_0x62f0('0xc')]['toUpperCase']()){case _0x62f0('0xd'):case _0x62f0('0xe'):_0x228cb7=null;_0x45991e['qs']=_0x1119e8;break;case _0x62f0('0xf'):case'PUT':if(_0x2130a0[_0x62f0('0x10')]){try{_0x228cb7=JSON[_0x62f0('0x9')](Mustache[_0x62f0('0x6')](_0x2130a0['data7'],_0x1119e8));_0x45991e[_0x62f0('0x11')]=_0x228cb7;}catch(_0x31c3fe){logger[_0x62f0('0x12')](_0x31c3fe[_0x62f0('0xb')]);logger[_0x62f0('0x12')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x228cb7=_0x1119e8;_0x45991e[_0x62f0('0x11')]=_0x228cb7;}break;}logger['info'](util['format'](_0x62f0('0x13'),_0x2130a0[_0x62f0('0xc')],_0x2130a0['data2'],JSON[_0x62f0('0x14')](_0x45991e)));rp(_0x45991e)[_0x62f0('0x15')](function(_0x593f03){_0x228cb7=!_[_0x62f0('0x16')](_0x228cb7)?_0x62f0('0x17')+_0x228cb7:'';_0x57af5c=typeof _0x593f03[_0x62f0('0x11')]==='object'?JSON[_0x62f0('0x14')](_0x593f03[_0x62f0('0x11')]):_0x593f03[_0x62f0('0x11')];logger[_0x62f0('0x18')](util[_0x62f0('0x19')](_0x62f0('0x1a'),_0x2130a0[_0x62f0('0xc')],_0x2130a0['data2'],_0x593f03[_0x62f0('0x1b')],_0x57af5c));})[_0x62f0('0x1c')](function(_0x111051){logger[_0x62f0('0x12')](util['format'](_0x62f0('0x1d'),_0x2130a0[_0x62f0('0xc')],_0x2130a0[_0x62f0('0x1e')],_0x111051[_0x62f0('0x1b')],_0x111051[_0x62f0('0x1f')],_0x111051[_0x62f0('0x20')]));});}; \ No newline at end of file +var _0xa2e2=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data5','number','headers','data6','parse','render','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','info','data2','catch'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa2e2,0x162));var _0x2a2e=function(_0x32be7d,_0x1e1fd6){_0x32be7d=_0x32be7d-0x0;var _0x3ddf=_0xa2e2[_0x32be7d];return _0x3ddf;};'use strict';var rp=require(_0x2a2e('0x0'));var util=require('util');var _=require(_0x2a2e('0x1'));var Mustache=require(_0x2a2e('0x2'));var logger=require(_0x2a2e('0x3'))(_0x2a2e('0x4'));exports[_0x2a2e('0x5')]=function(_0x7569ad,_0x59ae04){var _0x1a0570,_0x2c28ec;var _0x2d4c8a={'method':_0x7569ad[_0x2a2e('0x6')][_0x2a2e('0x7')](),'uri':Mustache['render'](_0x7569ad['data2'],_0x59ae04),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x7569ad[_0x2a2e('0x8')])===_0x2a2e('0x9')&&parseInt(_0x7569ad[_0x2a2e('0x8')])>=0x1&&parseInt(_0x7569ad[_0x2a2e('0x8')])<=0xa?parseInt(_0x7569ad[_0x2a2e('0x8')])*0x3e8:0x5*0x3e8};try{_0x2d4c8a[_0x2a2e('0xa')]=_0x7569ad[_0x2a2e('0xb')]?JSON[_0x2a2e('0xc')](Mustache[_0x2a2e('0xd')](_0x7569ad[_0x2a2e('0xb')],_0x59ae04)):{};}catch(_0x10c8a3){logger[_0x2a2e('0xe')](_0x10c8a3[_0x2a2e('0xf')]);}switch(_0x7569ad[_0x2a2e('0x6')][_0x2a2e('0x7')]()){case _0x2a2e('0x10'):case _0x2a2e('0x11'):_0x1a0570=null;_0x2d4c8a['qs']=_0x59ae04;break;case _0x2a2e('0x12'):case _0x2a2e('0x13'):if(_0x7569ad[_0x2a2e('0x14')]){try{_0x1a0570=JSON[_0x2a2e('0xc')](Mustache[_0x2a2e('0xd')](_0x7569ad['data7'],_0x59ae04));_0x2d4c8a[_0x2a2e('0x15')]=_0x1a0570;}catch(_0x50d8a1){logger[_0x2a2e('0xe')](_0x50d8a1[_0x2a2e('0xf')]);logger[_0x2a2e('0xe')](_0x2a2e('0x16'));}}else{_0x1a0570=_0x59ae04;_0x2d4c8a[_0x2a2e('0x15')]=_0x1a0570;}break;}logger['info'](util['format'](_0x2a2e('0x17'),_0x7569ad[_0x2a2e('0x6')],_0x7569ad['data2'],JSON['stringify'](_0x2d4c8a)));rp(_0x2d4c8a)[_0x2a2e('0x18')](function(_0x383216){_0x1a0570=!_['isNil'](_0x1a0570)?_0x2a2e('0x19')+_0x1a0570:'';_0x2c28ec=typeof _0x383216[_0x2a2e('0x15')]===_0x2a2e('0x1a')?JSON[_0x2a2e('0x1b')](_0x383216['body']):_0x383216[_0x2a2e('0x15')];logger[_0x2a2e('0x1c')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x7569ad[_0x2a2e('0x6')],_0x7569ad[_0x2a2e('0x1d')],_0x383216['statusCode'],_0x2c28ec));})[_0x2a2e('0x1e')](function(_0x255ee1){logger[_0x2a2e('0xe')](util['format'](_0x2a2e('0x1f'),_0x7569ad[_0x2a2e('0x6')],_0x7569ad[_0x2a2e('0x1d')],_0x255ee1[_0x2a2e('0x20')],_0x255ee1[_0x2a2e('0x21')],_0x255ee1[_0x2a2e('0x22')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b542fd8..ab43d26 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 _0x2a61=['jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','routing','error','message','result','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a61,0x170));var _0x12a6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2a61[_0x502c7d];return _0x30b7ed;};'use strict';var jayson=require(_0x12a6('0x0'));var BPromise=require(_0x12a6('0x1'));var logger=require(_0x12a6('0x2'))('routing');var client=jayson[_0x12a6('0x3')][_0x12a6('0x4')]({'port':0x2329});client[_0x12a6('0x5')]=function(_0x50da8e,_0xf86bb3){return new BPromise(function(_0x28421b,_0x4d6f97){return client[_0x12a6('0x6')](_0x50da8e,_0xf86bb3)[_0x12a6('0x7')](function(_0x42f07e){logger[_0x12a6('0x8')](_0x12a6('0x9'),_0x12a6('0xa'),_0x50da8e,_0xf86bb3,_0x42f07e);if(_0x42f07e[_0x12a6('0xb')]){logger[_0x12a6('0xb')](_0x12a6('0x9'),'routing',_0x50da8e,_0x42f07e[_0x12a6('0xb')][_0x12a6('0xc')],_0xf86bb3);return _0x4d6f97(_0x42f07e[_0x12a6('0xb')][_0x12a6('0xc')]);}else{return _0x28421b(_0x42f07e[_0x12a6('0xd')]);}})[_0x12a6('0xe')](function(_0xba903e){logger['error'](_0x12a6('0x9'),_0x12a6('0xa'),_0x50da8e,_0xba903e,_0xf86bb3);return _0x4d6f97(_0xba903e);});});};module[_0x12a6('0xf')]=client; \ No newline at end of file +var _0x6950=['routing','error','message','result','catch','jayson/promise','../../config/logger','http','Request','debug','rpc'];(function(_0x154bde,_0x154bef){var _0x926d94=function(_0x1d2b72){while(--_0x1d2b72){_0x154bde['push'](_0x154bde['shift']());}};_0x926d94(++_0x154bef);}(_0x6950,0x144));var _0x0695=function(_0x389ec7,_0x1c920c){_0x389ec7=_0x389ec7-0x0;var _0x40f216=_0x6950[_0x389ec7];return _0x40f216;};'use strict';var jayson=require(_0x0695('0x0'));var BPromise=require('bluebird');var logger=require(_0x0695('0x1'))('routing');var client=jayson['client'][_0x0695('0x2')]({'port':0x2329});client[_0x0695('0x3')]=function(_0x14a4f3,_0x2ab03){return new BPromise(function(_0x222bfc,_0x152341){return client['request'](_0x14a4f3,_0x2ab03)['then'](function(_0x2506bb){logger[_0x0695('0x4')](_0x0695('0x5'),_0x0695('0x6'),_0x14a4f3,_0x2ab03,_0x2506bb);if(_0x2506bb['error']){logger[_0x0695('0x7')](_0x0695('0x5'),_0x0695('0x6'),_0x14a4f3,_0x2506bb[_0x0695('0x7')]['message'],_0x2ab03);return _0x152341(_0x2506bb['error'][_0x0695('0x8')]);}else{return _0x222bfc(_0x2506bb[_0x0695('0x9')]);}})[_0x0695('0xa')](function(_0x38953b){logger[_0x0695('0x7')]('rpc','routing',_0x14a4f3,_0x38953b,_0x2ab03);return _0x152341(_0x38953b);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 28b4a5d..973c2e8 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 _0xcd3e=['./realtime','./lib/email','./rpc/mailAccount','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','log','bluebird','./server'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0xcd3e,0x132));var _0xecd3=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xcd3e[_0x39cf70];return _0x580424;};'use strict';var BPromise=require(_0xecd3('0x0'));var server=require(_0xecd3('0x1'));var Realtime=require(_0xecd3('0x2'));var EmailChannel=require(_0xecd3('0x3'));var mailAccount=require(_0xecd3('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xecd3('0x5')](mailAccount[_0xecd3('0x6')]())[_0xecd3('0x5')](realtime[_0xecd3('0x7')]())[_0xecd3('0x5')](function(){email[_0xecd3('0x8')](realtime[_0xecd3('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xecd3('0x5')](function(){return initRealtime();})[_0xecd3('0x5')](function(){return setting[_0xecd3('0xa')]();})[_0xecd3('0x5')](function(_0x5f1c45){return setInterval(initRealtime,_0x5f1c45[_0xecd3('0xb')]*0x3e8);})[_0xecd3('0xc')](function(_0x2c964b){console[_0xecd3('0xd')](_0x2c964b);});}main(); \ No newline at end of file +var _0x1ef7=['getSettings','loginMailFrequency','log','./server','then','getMailAccounts','mailAccounts','listen'];(function(_0x5a83ed,_0x37d457){var _0x2bd399=function(_0xdcf644){while(--_0xdcf644){_0x5a83ed['push'](_0x5a83ed['shift']());}};_0x2bd399(++_0x37d457);}(_0x1ef7,0x173));var _0x71ef=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x1ef7[_0x3a04ab];return _0x4bff6d;};'use strict';var BPromise=require('bluebird');var server=require(_0x71ef('0x0'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x71ef('0x1')](mailAccount[_0x71ef('0x2')]())[_0x71ef('0x1')](realtime['initMailAccounts']())[_0x71ef('0x1')](function(){email['refresh'](realtime[_0x71ef('0x3')]);return realtime;});}function main(){return server[_0x71ef('0x4')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x71ef('0x5')]();})[_0x71ef('0x1')](function(_0x2a99e5){return setInterval(initRealtime,_0x2a99e5[_0x71ef('0x6')]*0x3e8);})['catch'](function(_0x4bdb7a){console[_0x71ef('0x7')](_0x4bdb7a);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 63c0f02..8a986da 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 _0x4696=['notify','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','Smtp','verify','verified','exports','lodash','bluebird','ioredis','../../../config/environment','email','defaults','redis','localhost','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from'];(function(_0xec54a3,_0x33d6b5){var _0x26af94=function(_0x53b37d){while(--_0x53b37d){_0xec54a3['push'](_0xec54a3['shift']());}};_0x26af94(++_0x33d6b5);}(_0x4696,0xa6));var _0x6469=function(_0x33f42b,_0x25a153){_0x33f42b=_0x33f42b-0x0;var _0x4ab30b=_0x4696[_0x33f42b];return _0x4ab30b;};'use strict';var _=require(_0x6469('0x0'));var moment=require('moment');var BPromise=require(_0x6469('0x1'));var md5=require('md5');var Redis=require(_0x6469('0x2'));var config=require(_0x6469('0x3'));var logger=require('../../../config/logger')(_0x6469('0x4'));config['redis']=_[_0x6469('0x5')](config[_0x6469('0x6')],{'host':_0x6469('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6469('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x6469('0x8'));var mailAccount=require(_0x6469('0x9'));var md5Accounts={};function EmailChannel(_0x43dad4){logger[_0x6469('0xa')](_0x6469('0xb'));this['mailAccounts']=_0x43dad4[_0x6469('0xc')];this[_0x6469('0xd')]={};this[_0x6469('0xe')]=new EmailSmtp();}EmailChannel[_0x6469('0xf')][_0x6469('0x10')]=function(_0x4731f0){var _0x349784=this[_0x6469('0xc')][_0x4731f0];var _0x5c016e={'id':_0x349784['id'],'name':_0x349784[_0x6469('0x11')],'key':_0x349784[_0x6469('0x12')],'active':_0x349784[_0x6469('0x13')],'Imap':{'status':_0x349784[_0x6469('0x14')][_0x6469('0x15')],'messageStatus':_0x349784[_0x6469('0x14')][_0x6469('0x16')],'total':_0x349784['Imap'][_0x6469('0x17')]}};if(_[_0x6469('0x18')](md5Accounts[_0x4731f0])){md5Accounts[_0x4731f0]={};}var _0x97b2af=md5(JSON[_0x6469('0x19')](_0x5c016e));if(md5Accounts[_0x4731f0][_0x6469('0x1a')]!==_0x97b2af){md5Accounts[_0x4731f0][_0x6469('0x1a')]=_0x97b2af;io['emit'](_0x6469('0x1b'),_0x5c016e);}};EmailChannel[_0x6469('0xf')][_0x6469('0x1c')]=function(_0x16ce74){for(var _0x19309d in _0x16ce74){if(_0x16ce74['hasOwnProperty'](_0x19309d)){if(_0x16ce74[_0x19309d]['Imap']&&_0x16ce74[_0x19309d][_0x6469('0x13')]){var _0x1ee8be=_0x16ce74[_0x19309d][_0x6469('0x14')];if(!this[_0x6469('0xd')][_0x6469('0x1d')](_0x1ee8be['id'])){this['imapAccounts'][_0x1ee8be['id']]=new EmailImap(_0x1ee8be,_0x16ce74[_0x19309d][_0x6469('0x4')]);this[_0x6469('0xd')][_0x1ee8be['id']]['on'](_0x6469('0x1e'),this[_0x6469('0x1f')][_0x6469('0x20')](this,_0x19309d));this[_0x6469('0xd')][_0x1ee8be['id']]['on'](_0x6469('0x4'),this[_0x6469('0x21')]['bind'](this,_0x19309d));this[_0x6469('0xd')][_0x1ee8be['id']]['on'](_0x6469('0x22'),this['handleImapEnd']['bind'](this,_0x19309d));this['imapAccounts'][_0x1ee8be['id']]['on'](_0x6469('0x23'),this[_0x6469('0x24')][_0x6469('0x20')](this,_0x19309d));}}else{if(_[_0x6469('0x18')](this[_0x6469('0xc')][_0x19309d]['Imap'])){this[_0x6469('0xc')][_0x19309d][_0x6469('0x14')]={};}this[_0x6469('0xc')][_0x19309d][_0x6469('0x14')][_0x6469('0x15')]='disabled';this[_0x6469('0xc')][_0x19309d][_0x6469('0x14')][_0x6469('0x16')]='';this[_0x6469('0x10')](_0x19309d);}}}};EmailChannel['prototype'][_0x6469('0x1f')]=function(_0x14ae82,_0x30e491){if(this[_0x6469('0xc')][_0x14ae82]){this[_0x6469('0xc')][_0x14ae82][_0x6469('0x14')][_0x6469('0x15')]=_0x6469('0x25');this[_0x6469('0xc')][_0x14ae82]['Imap'][_0x6469('0x16')]=_0x30e491['name'];if(_0x30e491['messages']){this[_0x6469('0xc')][_0x14ae82][_0x6469('0x14')][_0x6469('0x17')]=_0x30e491[_0x6469('0x26')][_0x6469('0x17')];}return this[_0x6469('0x10')](_0x14ae82);}};EmailChannel['prototype'][_0x6469('0x21')]=function(_0x50369a,_0x483e76){logger['info'](_0x6469('0x27'),_0x483e76['firstName'],_0x483e76[_0x6469('0x28')],_0x483e76[_0x6469('0x29')],_0x50369a);if(this[_0x6469('0xc')][_0x50369a]){return mailAccount[_0x6469('0x2a')](_0x50369a,_0x483e76)[_0x6469('0x2b')](function(_0xcf2bd9){if(_0xcf2bd9){logger[_0x6469('0xa')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x5bece5){logger[_0x6469('0x23')](_0x6469('0x2c'),JSON['stringify'](_0x5bece5));});}};EmailChannel[_0x6469('0xf')][_0x6469('0x2d')]=function(_0x5c4d81){if(this[_0x6469('0xc')][_0x5c4d81]&&this['mailAccounts'][_0x5c4d81]['Imap']){if(this[_0x6469('0xd')][this[_0x6469('0xc')][_0x5c4d81][_0x6469('0x14')]['id']]){delete this['imapAccounts'][this[_0x6469('0xc')][_0x5c4d81][_0x6469('0x14')]['id']];}this[_0x6469('0xc')][_0x5c4d81][_0x6469('0x14')][_0x6469('0x2e')]=moment();this[_0x6469('0x10')](_0x5c4d81);}};EmailChannel['prototype']['handleImapError']=function(_0x586877,_0x367d77){if(this[_0x6469('0xc')][_0x586877]){this[_0x6469('0xc')][_0x586877][_0x6469('0x14')][_0x6469('0x15')]=_0x6469('0x23');this['mailAccounts'][_0x586877][_0x6469('0x14')][_0x6469('0x16')]=_0x367d77;return this[_0x6469('0x10')](_0x586877);}};EmailChannel[_0x6469('0xf')][_0x6469('0x2f')]=function(_0x2c2a49,_0x16d5cf){return this[_0x6469('0xe')]['send'](_0x2c2a49,_0x16d5cf);};EmailChannel[_0x6469('0xf')]['verifySmtp']=function(_0x23b274){var _0x2ce20d=this;if(this[_0x6469('0xc')][_0x23b274['id']]){if(_[_0x6469('0x18')](this['mailAccounts'][_0x23b274['id']]['Smtp'])){this[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')]={};}this['mailAccounts'][_0x23b274['id']][_0x6469('0x30')]['lastSync']=moment();return new BPromise(function(_0x3f0c8d,_0x35313d){return _0x2ce20d[_0x6469('0xe')][_0x6469('0x31')](_0x23b274)[_0x6469('0x2b')](function(_0x58420f){_0x2ce20d['mailAccounts'][_0x23b274['id']][_0x6469('0x30')][_0x6469('0x15')]=_0x6469('0x32');_0x2ce20d[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')]['messageStatus']='';_0x2ce20d['emit'](_0x23b274['id']);_0x3f0c8d(_0x58420f);})['catch'](function(_0x53bc9b){_0x2ce20d[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')][_0x6469('0x15')]=_0x6469('0x23');_0x2ce20d[_0x6469('0xc')][_0x23b274['id']][_0x6469('0x30')]['messageStatus']=_0x53bc9b;_0x2ce20d['emit'](_0x23b274['id']);_0x35313d(_0x53bc9b);});});}return this[_0x6469('0xe')][_0x6469('0x31')](_0x23b274);};module[_0x6469('0x33')]=EmailChannel; \ No newline at end of file +var _0x2768=['socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','md5','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','isNil','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verified','exports','lodash','../../../config/logger','redis','localhost'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x2768,0xfb));var _0x8276=function(_0x52f249,_0x16b09a){_0x52f249=_0x52f249-0x0;var _0x11f1af=_0x2768[_0x52f249];return _0x11f1af;};'use strict';var _=require(_0x8276('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x8276('0x1'))('email');config[_0x8276('0x2')]=_['defaults'](config['redis'],{'host':_0x8276('0x3'),'port':0x18eb});var io=require(_0x8276('0x4'))(new Redis(config[_0x8276('0x2')]));var EmailImap=require(_0x8276('0x5'));var EmailSmtp=require(_0x8276('0x6'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x174665){logger[_0x8276('0x7')](_0x8276('0x8'));this[_0x8276('0x9')]=_0x174665[_0x8276('0x9')];this[_0x8276('0xa')]={};this[_0x8276('0xb')]=new EmailSmtp();}EmailChannel[_0x8276('0xc')][_0x8276('0xd')]=function(_0x334eac){var _0x526ba5=this[_0x8276('0x9')][_0x334eac];var _0x326444={'id':_0x526ba5['id'],'name':_0x526ba5[_0x8276('0xe')],'key':_0x526ba5[_0x8276('0xf')],'active':_0x526ba5[_0x8276('0x10')],'Imap':{'status':_0x526ba5[_0x8276('0x11')][_0x8276('0x12')],'messageStatus':_0x526ba5[_0x8276('0x11')][_0x8276('0x13')],'total':_0x526ba5['Imap'][_0x8276('0x14')]}};if(_['isNil'](md5Accounts[_0x334eac])){md5Accounts[_0x334eac]={};}var _0x58d905=md5(JSON[_0x8276('0x15')](_0x326444));if(md5Accounts[_0x334eac][_0x8276('0x16')]!==_0x58d905){md5Accounts[_0x334eac][_0x8276('0x16')]=_0x58d905;io[_0x8276('0xd')]('mailAccount:update',_0x326444);}};EmailChannel[_0x8276('0xc')]['refresh']=function(_0x262039){for(var _0x38601e in _0x262039){if(_0x262039['hasOwnProperty'](_0x38601e)){if(_0x262039[_0x38601e][_0x8276('0x11')]&&_0x262039[_0x38601e][_0x8276('0x10')]){var _0x242a48=_0x262039[_0x38601e][_0x8276('0x11')];if(!this[_0x8276('0xa')][_0x8276('0x17')](_0x242a48['id'])){this['imapAccounts'][_0x242a48['id']]=new EmailImap(_0x242a48,_0x262039[_0x38601e][_0x8276('0x18')]);this['imapAccounts'][_0x242a48['id']]['on'](_0x8276('0x19'),this[_0x8276('0x1a')][_0x8276('0x1b')](this,_0x38601e));this['imapAccounts'][_0x242a48['id']]['on'](_0x8276('0x18'),this[_0x8276('0x1c')][_0x8276('0x1b')](this,_0x38601e));this['imapAccounts'][_0x242a48['id']]['on'](_0x8276('0x1d'),this[_0x8276('0x1e')][_0x8276('0x1b')](this,_0x38601e));this['imapAccounts'][_0x242a48['id']]['on'](_0x8276('0x1f'),this['handleImapError'][_0x8276('0x1b')](this,_0x38601e));}}else{if(_[_0x8276('0x20')](this[_0x8276('0x9')][_0x38601e][_0x8276('0x11')])){this[_0x8276('0x9')][_0x38601e][_0x8276('0x11')]={};}this[_0x8276('0x9')][_0x38601e]['Imap'][_0x8276('0x12')]=_0x8276('0x21');this[_0x8276('0x9')][_0x38601e]['Imap'][_0x8276('0x13')]='';this[_0x8276('0xd')](_0x38601e);}}}};EmailChannel[_0x8276('0xc')][_0x8276('0x1a')]=function(_0x19a15c,_0x401336){if(this[_0x8276('0x9')][_0x19a15c]){this[_0x8276('0x9')][_0x19a15c][_0x8276('0x11')]['status']=_0x8276('0x22');this[_0x8276('0x9')][_0x19a15c][_0x8276('0x11')][_0x8276('0x13')]=_0x401336['name'];if(_0x401336[_0x8276('0x23')]){this[_0x8276('0x9')][_0x19a15c]['Imap'][_0x8276('0x14')]=_0x401336[_0x8276('0x23')][_0x8276('0x14')];}return this[_0x8276('0xd')](_0x19a15c);}};EmailChannel['prototype'][_0x8276('0x1c')]=function(_0x5b7515,_0x51ac12){logger[_0x8276('0x7')](_0x8276('0x24'),_0x51ac12[_0x8276('0x25')],_0x51ac12[_0x8276('0x26')],_0x51ac12[_0x8276('0x27')],_0x5b7515);if(this['mailAccounts'][_0x5b7515]){return mailAccount['notify'](_0x5b7515,_0x51ac12)[_0x8276('0x28')](function(_0x197eb4){if(_0x197eb4){logger[_0x8276('0x7')](_0x8276('0x29'));}})[_0x8276('0x2a')](function(_0x129e3b){logger[_0x8276('0x1f')](_0x8276('0x2b'),JSON[_0x8276('0x15')](_0x129e3b));});}};EmailChannel[_0x8276('0xc')][_0x8276('0x1e')]=function(_0x33be1a){if(this[_0x8276('0x9')][_0x33be1a]&&this[_0x8276('0x9')][_0x33be1a][_0x8276('0x11')]){if(this[_0x8276('0xa')][this[_0x8276('0x9')][_0x33be1a][_0x8276('0x11')]['id']]){delete this['imapAccounts'][this[_0x8276('0x9')][_0x33be1a][_0x8276('0x11')]['id']];}this[_0x8276('0x9')][_0x33be1a][_0x8276('0x11')][_0x8276('0x2c')]=moment();this['emit'](_0x33be1a);}};EmailChannel[_0x8276('0xc')]['handleImapError']=function(_0x1e5c17,_0x136542){if(this['mailAccounts'][_0x1e5c17]){this[_0x8276('0x9')][_0x1e5c17][_0x8276('0x11')]['status']=_0x8276('0x1f');this[_0x8276('0x9')][_0x1e5c17][_0x8276('0x11')][_0x8276('0x13')]=_0x136542;return this[_0x8276('0xd')](_0x1e5c17);}};EmailChannel['prototype'][_0x8276('0x2d')]=function(_0x3f8c4a,_0x33e5df){return this[_0x8276('0xb')][_0x8276('0x2e')](_0x3f8c4a,_0x33e5df);};EmailChannel[_0x8276('0xc')][_0x8276('0x2f')]=function(_0x3d4328){var _0x552f67=this;if(this[_0x8276('0x9')][_0x3d4328['id']]){if(_[_0x8276('0x20')](this['mailAccounts'][_0x3d4328['id']][_0x8276('0x30')])){this['mailAccounts'][_0x3d4328['id']][_0x8276('0x30')]={};}this[_0x8276('0x9')][_0x3d4328['id']][_0x8276('0x30')][_0x8276('0x2c')]=moment();return new BPromise(function(_0x4f78ed,_0x15b274){return _0x552f67['smtp']['verify'](_0x3d4328)[_0x8276('0x28')](function(_0x2ed26d){_0x552f67[_0x8276('0x9')][_0x3d4328['id']][_0x8276('0x30')][_0x8276('0x12')]=_0x8276('0x31');_0x552f67[_0x8276('0x9')][_0x3d4328['id']][_0x8276('0x30')]['messageStatus']='';_0x552f67[_0x8276('0xd')](_0x3d4328['id']);_0x4f78ed(_0x2ed26d);})[_0x8276('0x2a')](function(_0x10eb3b){_0x552f67[_0x8276('0x9')][_0x3d4328['id']][_0x8276('0x30')]['status']=_0x8276('0x1f');_0x552f67[_0x8276('0x9')][_0x3d4328['id']][_0x8276('0x30')]['messageStatus']=_0x10eb3b;_0x552f67[_0x8276('0xd')](_0x3d4328['id']);_0x15b274(_0x10eb3b);});});}return this[_0x8276('0xb')]['verify'](_0x3d4328);};module[_0x8276('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f94f142..3f2e9ca 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 _0xe207=['required','getHost','anonymous@xcally.com','openBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','error','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','mailparser','simpleParser','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','handleReady','bind','once','end','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls'];(function(_0x7c5058,_0xd1227f){var _0x296883=function(_0x19d4b3){while(--_0x19d4b3){_0x7c5058['push'](_0x7c5058['shift']());}};_0x296883(++_0xd1227f);}(_0xe207,0x154));var _0x7e20=function(_0xcfaa79,_0x372c22){_0xcfaa79=_0xcfaa79-0x0;var _0x414eed=_0xe207[_0xcfaa79];return _0x414eed;};'use strict';var fs=require('fs');var path=require(_0x7e20('0x0'));var util=require(_0x7e20('0x1'));var Imap=require(_0x7e20('0x2'));var _=require(_0x7e20('0x3'));var rs=require(_0x7e20('0x4'));var simpleParser=require(_0x7e20('0x5'))[_0x7e20('0x6')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0x7e20('0x7'))(_0x7e20('0x8'));function EmailImap(_0x23d06e,_0x2aac14){this[_0x7e20('0x9')]=_0x7e20('0xa');this[_0x7e20('0xb')]=this[_0x7e20('0xc')](_0x23d06e,_0x2aac14);this[_0x7e20('0x2')]=new Imap(this[_0x7e20('0xb')]);this[_0x7e20('0x2')]['once'](_0x7e20('0xd'),this[_0x7e20('0xe')][_0x7e20('0xf')](this));this['imap'][_0x7e20('0x10')](_0x7e20('0x11'),this['handleEnd'][_0x7e20('0xf')](this));this[_0x7e20('0x2')]['on']('error',this[_0x7e20('0x12')][_0x7e20('0xf')](this));this[_0x7e20('0x2')][_0x7e20('0x13')]();}util[_0x7e20('0x14')](EmailImap,EventEmitter);EmailImap[_0x7e20('0x15')][_0x7e20('0xc')]=function(_0x29da2c,_0x59177c){var _0x47327f={'connTimeout':_0x29da2c[_0x7e20('0x16')]?_0x29da2c[_0x7e20('0x16')]*0x3e8:0x2710,'authTimeout':_0x29da2c['authTimeout']?_0x29da2c[_0x7e20('0x17')]*0x3e8:0x1388};if(_[_0x7e20('0x18')](_0x29da2c[_0x7e20('0x19')])){if(_0x29da2c[_0x7e20('0x1a')]){_0x47327f['user']=_0x29da2c[_0x7e20('0x1b')];_0x47327f['password']=_0x29da2c[_0x7e20('0x1c')];}_0x47327f[_0x7e20('0x1d')]=_0x29da2c[_0x7e20('0x1d')];_0x47327f[_0x7e20('0x1e')]=_0x29da2c[_0x7e20('0x1e')]||0x3e1;if(_0x29da2c[_0x7e20('0x1f')]){_0x47327f[_0x7e20('0x1f')]=!![];}else{_0x47327f[_0x7e20('0x1f')]=![];_0x47327f['autotls']=_0x7e20('0x20');}}else{_0x47327f['user']=_0x29da2c['user'];_0x47327f[_0x7e20('0x1c')]=_0x29da2c[_0x7e20('0x1c')];_0x47327f['host']=utils[_0x7e20('0x21')](_0x29da2c[_0x7e20('0x19')]);_0x47327f[_0x7e20('0x1e')]=0x3e1;_0x47327f['tls']=!![];}_0x47327f[_0x7e20('0x8')]=_0x59177c||_0x29da2c[_0x7e20('0x1b')]||_0x7e20('0x22');return _0x47327f;};EmailImap['prototype']['handleReady']=function(){this[_0x7e20('0x2')][_0x7e20('0x23')](this['mailbox'],![],this['handleOpenBox'][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')]['handleOpenBox']=function(_0x48cfbf,_0x23cdc5){if(_0x48cfbf){this['handleError'](_0x48cfbf,!![]);}else{this[_0x7e20('0x24')](_0x7e20('0x25'),_0x23cdc5);this[_0x7e20('0x26')]();}};EmailImap[_0x7e20('0x15')][_0x7e20('0x27')]=function(_0x3ddf43){if(_0x3ddf43){this[_0x7e20('0x12')](_0x3ddf43,!![]);}else{this[_0x7e20('0x2')]['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x7e20('0x2')][_0x7e20('0x28')]([_0x7e20('0x29')],this[_0x7e20('0x2a')][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x2a')]=function(_0x44cf46,_0x53ee91){if(_0x44cf46){this[_0x7e20('0x12')](_0x44cf46,!![]);}else{if(_0x53ee91[_0x7e20('0x2b')]){try{var _0x452595=this[_0x7e20('0x2')]['fetch'](_0x53ee91,{'bodies':'','markSeen':!![]});_0x452595['on'](_0x7e20('0x2c'),this['handleFetchMessage'][_0x7e20('0xf')](this));_0x452595[_0x7e20('0x10')](_0x7e20('0x2d'),this[_0x7e20('0x2e')]['bind'](this));_0x452595[_0x7e20('0x10')](_0x7e20('0x11'),this[_0x7e20('0x2f')][_0x7e20('0xf')](this));}catch(_0x26450b){logger['error'](_0x26450b);}}else{this[_0x7e20('0x2')][_0x7e20('0x30')](!![],this[_0x7e20('0x27')][_0x7e20('0xf')](this));}}};EmailImap[_0x7e20('0x15')][_0x7e20('0x31')]=function(_0x16103a,_0x405f24){_0x16103a['on'](_0x7e20('0x32'),this[_0x7e20('0x33')]['bind'](this));_0x16103a[_0x7e20('0x10')](_0x7e20('0x34'),this[_0x7e20('0x35')][_0x7e20('0xf')](this));_0x16103a[_0x7e20('0x10')](_0x7e20('0x11'),this[_0x7e20('0x36')]['bind'](this));};EmailImap['prototype'][_0x7e20('0x33')]=function(_0x43c3e4,_0x2c39a0){simpleParser(_0x43c3e4,{'Iconv':Iconv},this[_0x7e20('0x37')][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x35')]=function(_0x6e02b9){};EmailImap[_0x7e20('0x15')][_0x7e20('0x36')]=function(){};EmailImap['prototype'][_0x7e20('0x37')]=function(_0x1269d4,_0x231065){if(_0x1269d4){logger[_0x7e20('0x2d')](_0x1269d4);}else{var _0x185ce7=this;utils[_0x7e20('0x38')](this[_0x7e20('0xb')],_0x231065,function(_0x1243e7){_0x185ce7['emit'](_0x7e20('0x8'),_0x1243e7);});}};EmailImap[_0x7e20('0x15')][_0x7e20('0x2f')]=function(){this[_0x7e20('0x2')][_0x7e20('0x30')](!![],this['handleCloseBox'][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x2e')]=function(_0x573e06){this[_0x7e20('0x12')](_0x573e06);this[_0x7e20('0x2')][_0x7e20('0x30')](!![],this[_0x7e20('0x27')][_0x7e20('0xf')](this));};EmailImap[_0x7e20('0x15')][_0x7e20('0x39')]=function(){this[_0x7e20('0x24')](_0x7e20('0x11'));};EmailImap[_0x7e20('0x15')][_0x7e20('0x12')]=function(_0x5a3c2a,_0x4968ba){logger[_0x7e20('0x2d')](_0x7e20('0x12'),this['account'][_0x7e20('0x8')],JSON[_0x7e20('0x3a')](_0x5a3c2a));var _0x4d69c0='';if(_0x5a3c2a){if(_0x5a3c2a[_0x7e20('0x3b')]){_0x4d69c0=_0x5a3c2a[_0x7e20('0x3b')];}else{for(var _0xb2d17f in _0x5a3c2a){if(_0x5a3c2a[_0x7e20('0x3c')](_0xb2d17f)){_0x4d69c0+=_[_0x7e20('0x3d')](_0xb2d17f)+':\x20'+_0x5a3c2a[_0xb2d17f]+'\x0a';}}}}if(_0x4968ba){this[_0x7e20('0x2')][_0x7e20('0x11')]();}else{this[_0x7e20('0x24')](_0x7e20('0x2d'),_0x4d69c0);this[_0x7e20('0x24')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x0f13=['../../../config/logger','email','mailbox','account','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','stringify','textCode','hasOwnProperty','exports','path','util','imap','lodash','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils'];(function(_0x57411c,_0x529577){var _0xa52b6f=function(_0x3964a8){while(--_0x3964a8){_0x57411c['push'](_0x57411c['shift']());}};_0xa52b6f(++_0x529577);}(_0x0f13,0x12b));var _0x30f1=function(_0x80c77b,_0xc44140){_0x80c77b=_0x80c77b-0x0;var _0x3fca8f=_0x0f13[_0x80c77b];return _0x3fca8f;};'use strict';var fs=require('fs');var path=require(_0x30f1('0x0'));var util=require(_0x30f1('0x1'));var Imap=require(_0x30f1('0x2'));var _=require(_0x30f1('0x3'));var rs=require('randomstring');var simpleParser=require(_0x30f1('0x4'))[_0x30f1('0x5')];var Iconv=require(_0x30f1('0x6'))[_0x30f1('0x7')];var EventEmitter=require(_0x30f1('0x8'))[_0x30f1('0x9')];var utils=require(_0x30f1('0xa'));var logger=require(_0x30f1('0xb'))(_0x30f1('0xc'));function EmailImap(_0x64f714,_0x4dba15){this[_0x30f1('0xd')]='INBOX';this[_0x30f1('0xe')]=this['getAccount'](_0x64f714,_0x4dba15);this[_0x30f1('0x2')]=new Imap(this[_0x30f1('0xe')]);this[_0x30f1('0x2')]['once']('ready',this[_0x30f1('0xf')][_0x30f1('0x10')](this));this[_0x30f1('0x2')]['once'](_0x30f1('0x11'),this[_0x30f1('0x12')][_0x30f1('0x10')](this));this[_0x30f1('0x2')]['on'](_0x30f1('0x13'),this[_0x30f1('0x14')][_0x30f1('0x10')](this));this[_0x30f1('0x2')][_0x30f1('0x15')]();}util[_0x30f1('0x16')](EmailImap,EventEmitter);EmailImap[_0x30f1('0x17')]['getAccount']=function(_0xd1372b,_0x19678e){var _0x53cc24={'connTimeout':_0xd1372b[_0x30f1('0x18')]?_0xd1372b[_0x30f1('0x18')]*0x3e8:0x2710,'authTimeout':_0xd1372b[_0x30f1('0x19')]?_0xd1372b[_0x30f1('0x19')]*0x3e8:0x1388};if(_[_0x30f1('0x1a')](_0xd1372b[_0x30f1('0x1b')])){if(_0xd1372b[_0x30f1('0x1c')]){_0x53cc24[_0x30f1('0x1d')]=_0xd1372b[_0x30f1('0x1d')];_0x53cc24[_0x30f1('0x1e')]=_0xd1372b[_0x30f1('0x1e')];}_0x53cc24[_0x30f1('0x1f')]=_0xd1372b[_0x30f1('0x1f')];_0x53cc24['port']=_0xd1372b[_0x30f1('0x20')]||0x3e1;if(_0xd1372b[_0x30f1('0x21')]){_0x53cc24[_0x30f1('0x21')]=!![];}else{_0x53cc24['tls']=![];_0x53cc24[_0x30f1('0x22')]=_0x30f1('0x23');}}else{_0x53cc24['user']=_0xd1372b[_0x30f1('0x1d')];_0x53cc24[_0x30f1('0x1e')]=_0xd1372b[_0x30f1('0x1e')];_0x53cc24[_0x30f1('0x1f')]=utils[_0x30f1('0x24')](_0xd1372b['service']);_0x53cc24[_0x30f1('0x20')]=0x3e1;_0x53cc24[_0x30f1('0x21')]=!![];}_0x53cc24[_0x30f1('0xc')]=_0x19678e||_0xd1372b[_0x30f1('0x1d')]||_0x30f1('0x25');return _0x53cc24;};EmailImap[_0x30f1('0x17')][_0x30f1('0xf')]=function(){this[_0x30f1('0x2')][_0x30f1('0x26')](this[_0x30f1('0xd')],![],this[_0x30f1('0x27')][_0x30f1('0x10')](this));};EmailImap[_0x30f1('0x17')][_0x30f1('0x27')]=function(_0x249f02,_0x2a20dd){if(_0x249f02){this[_0x30f1('0x14')](_0x249f02,!![]);}else{this[_0x30f1('0x28')]('box',_0x2a20dd);this[_0x30f1('0x29')]();}};EmailImap[_0x30f1('0x17')][_0x30f1('0x2a')]=function(_0x4748e0){if(_0x4748e0){this['handleError'](_0x4748e0,!![]);}else{this['imap'][_0x30f1('0x11')]();}};EmailImap[_0x30f1('0x17')]['readUnseen']=function(){this[_0x30f1('0x2')][_0x30f1('0x2b')]([_0x30f1('0x2c')],this[_0x30f1('0x2d')][_0x30f1('0x10')](this));};EmailImap[_0x30f1('0x17')][_0x30f1('0x2d')]=function(_0x5297f0,_0x337e99){if(_0x5297f0){this[_0x30f1('0x14')](_0x5297f0,!![]);}else{if(_0x337e99[_0x30f1('0x2e')]){try{var _0x11921d=this[_0x30f1('0x2')][_0x30f1('0x2f')](_0x337e99,{'bodies':'','markSeen':!![]});_0x11921d['on']('message',this[_0x30f1('0x30')][_0x30f1('0x10')](this));_0x11921d[_0x30f1('0x31')](_0x30f1('0x13'),this[_0x30f1('0x32')]['bind'](this));_0x11921d[_0x30f1('0x31')](_0x30f1('0x11'),this[_0x30f1('0x33')][_0x30f1('0x10')](this));}catch(_0x2e0978){logger[_0x30f1('0x13')](_0x2e0978);}}else{this[_0x30f1('0x2')][_0x30f1('0x34')](!![],this[_0x30f1('0x2a')][_0x30f1('0x10')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x1fe9d8,_0x285f5f){_0x1fe9d8['on'](_0x30f1('0x35'),this['handleMessageBody']['bind'](this));_0x1fe9d8[_0x30f1('0x31')]('attributes',this[_0x30f1('0x36')]['bind'](this));_0x1fe9d8[_0x30f1('0x31')](_0x30f1('0x11'),this[_0x30f1('0x37')][_0x30f1('0x10')](this));};EmailImap[_0x30f1('0x17')][_0x30f1('0x38')]=function(_0x224e06,_0x130cc1){simpleParser(_0x224e06,{'Iconv':Iconv},this[_0x30f1('0x39')][_0x30f1('0x10')](this));};EmailImap[_0x30f1('0x17')][_0x30f1('0x36')]=function(_0x4f1d3b){};EmailImap[_0x30f1('0x17')][_0x30f1('0x37')]=function(){};EmailImap['prototype'][_0x30f1('0x39')]=function(_0x37da56,_0x3ca1e5){if(_0x37da56){logger[_0x30f1('0x13')](_0x37da56);}else{var _0x1439cc=this;utils['parser'](this['account'],_0x3ca1e5,function(_0x4f9e6b){_0x1439cc['emit'](_0x30f1('0xc'),_0x4f9e6b);});}};EmailImap['prototype'][_0x30f1('0x33')]=function(){this[_0x30f1('0x2')]['closeBox'](!![],this[_0x30f1('0x2a')]['bind'](this));};EmailImap[_0x30f1('0x17')][_0x30f1('0x32')]=function(_0x216223){this['handleError'](_0x216223);this['imap'][_0x30f1('0x34')](!![],this[_0x30f1('0x2a')][_0x30f1('0x10')](this));};EmailImap[_0x30f1('0x17')][_0x30f1('0x12')]=function(){this[_0x30f1('0x28')](_0x30f1('0x11'));};EmailImap[_0x30f1('0x17')][_0x30f1('0x14')]=function(_0x1ac6ad,_0x98f7be){logger['error']('handleError',this['account'][_0x30f1('0xc')],JSON[_0x30f1('0x3a')](_0x1ac6ad));var _0x494887='';if(_0x1ac6ad){if(_0x1ac6ad[_0x30f1('0x3b')]){_0x494887=_0x1ac6ad[_0x30f1('0x3b')];}else{for(var _0x49c61b in _0x1ac6ad){if(_0x1ac6ad[_0x30f1('0x3c')](_0x49c61b)){_0x494887+=_['upperFirst'](_0x49c61b)+':\x20'+_0x1ac6ad[_0x49c61b]+'\x0a';}}}}if(_0x98f7be){this['imap'][_0x30f1('0x11')]();}else{this[_0x30f1('0x28')](_0x30f1('0x13'),_0x494887);this[_0x30f1('0x28')](_0x30f1('0x11'));}};module[_0x30f1('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index c82b6d3..759000f 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 _0x7d36=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x1a3f6c,_0x2177cc){var _0x361953=function(_0x270019){while(--_0x270019){_0x1a3f6c['push'](_0x1a3f6c['shift']());}};_0x361953(++_0x2177cc);}(_0x7d36,0x1ea));var _0x67d3=function(_0x37c286,_0x2a3368){_0x37c286=_0x37c286-0x0;var _0x2b7ca1=_0x7d36[_0x37c286];return _0x2b7ca1;};'use strict';var nodemailer=require(_0x67d3('0x0'));var BPromise=require(_0x67d3('0x1'));var inlineBase64=require(_0x67d3('0x2'));function EmailSmtp(){}EmailSmtp[_0x67d3('0x3')][_0x67d3('0x4')]=function(_0x466748,_0x1538ed){return new BPromise(function(_0x4d83e2,_0x4872cb){var _0x599c01=nodemailer[_0x67d3('0x5')](_0x466748);_0x599c01[_0x67d3('0x6')](_0x67d3('0x7'),inlineBase64());_0x599c01['sendMail'](_0x1538ed,function(_0x386b51,_0x16323d){if(_0x386b51){_0x4872cb(_0x386b51[_0x67d3('0x8')]());}else{_0x4d83e2(_0x16323d);}});});};EmailSmtp[_0x67d3('0x3')][_0x67d3('0x9')]=function(_0x2b5ca8){return new BPromise(function(_0x3d2ea7,_0x49f202){var _0x49b395=nodemailer[_0x67d3('0x5')](_0x2b5ca8);_0x49b395[_0x67d3('0x9')](function(_0x417f1a,_0x82a495){if(_0x417f1a){_0x49f202(_0x417f1a['toString']());}else{if(_0x82a495){_0x3d2ea7(_0x82a495);}else{_0x49f202(_0x67d3('0xa'));}}});});};module[_0x67d3('0xb')]=EmailSmtp; \ No newline at end of file +var _0xe029=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0xe029,0x8d));var _0x9e02=function(_0x5c1b26,_0x356a45){_0x5c1b26=_0x5c1b26-0x0;var _0x5253de=_0xe029[_0x5c1b26];return _0x5253de;};'use strict';var nodemailer=require(_0x9e02('0x0'));var BPromise=require(_0x9e02('0x1'));var inlineBase64=require(_0x9e02('0x2'));function EmailSmtp(){}EmailSmtp[_0x9e02('0x3')][_0x9e02('0x4')]=function(_0x2b087f,_0x4cf091){return new BPromise(function(_0x20360a,_0x10df38){var _0x28ddcf=nodemailer[_0x9e02('0x5')](_0x2b087f);_0x28ddcf[_0x9e02('0x6')](_0x9e02('0x7'),inlineBase64());_0x28ddcf[_0x9e02('0x8')](_0x4cf091,function(_0x408e44,_0x30b3d6){if(_0x408e44){_0x10df38(_0x408e44[_0x9e02('0x9')]());}else{_0x20360a(_0x30b3d6);}});});};EmailSmtp[_0x9e02('0x3')][_0x9e02('0xa')]=function(_0x19b7b1){return new BPromise(function(_0x54164f,_0x528916){var _0x3648ee=nodemailer[_0x9e02('0x5')](_0x19b7b1);_0x3648ee[_0x9e02('0xa')](function(_0x33def7,_0x20ce59){if(_0x33def7){_0x528916(_0x33def7['toString']());}else{if(_0x20ce59){_0x54164f(_0x20ce59);}else{_0x528916(_0x9e02('0xb'));}}});});};module[_0x9e02('0xc')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index db2538e..13f0153 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 _0xfa9f=['BodyHTML','

Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','email','value','anonymous','generate','@xcally.com','head','name','address','substring','indexOf','length','slice','join','Anonymous','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x3fb095[_0xffa9('0x10')](0x0,-0x1)[_0xffa9('0x11')]('\x20'):_0x5cc8b2[_0xffa9('0xb')];}return _0xffa9('0x12');}function getLastName(_0x78f311){var _0x10a76e=_[_0xffa9('0xa')](_0x78f311[_0xffa9('0x6')]);if(_0x10a76e&&_0x10a76e[_0xffa9('0xb')]){var _0x5812d0=_0x10a76e[_0xffa9('0xb')]['split'](/\s+/);return _0x5812d0[_0xffa9('0xf')]>0x1?_0x5812d0[_0xffa9('0x13')]():'';}return'';}function getMails(_0x54cae8,_0x7ad8ba){var _0x2eacc0='';for(var _0x1ce6c3=0x0;_0x1ce6c3<_0x7ad8ba['value'][_0xffa9('0xf')];_0x1ce6c3+=0x1){if(_0x7ad8ba[_0xffa9('0x6')][_0x1ce6c3][_0xffa9('0xc')]!==_0x54cae8){if(!_[_0xffa9('0x14')](_0x2eacc0)){_0x2eacc0+=',';}_0x2eacc0+=_0x7ad8ba['value'][_0x1ce6c3][_0xffa9('0xb')]||_0x7ad8ba['value'][_0x1ce6c3][_0xffa9('0xc')]||'';_0x2eacc0+='\x20<';_0x2eacc0+=_0x7ad8ba[_0xffa9('0x6')][_0x1ce6c3][_0xffa9('0xc')]?_0x7ad8ba[_0xffa9('0x6')][_0x1ce6c3][_0xffa9('0xc')]:_0xffa9('0x7')+random['generate'](0x6)+_0xffa9('0x9');_0x2eacc0+='>';}}return _0x2eacc0;}function parseEmail(_0x22121d,_0x41eb49,_0x27f229){if(_0x41eb49[_0xffa9('0x15')]){var _0x2c9c20=/)<[^<]*)*<\/script>/gi;while(_0x2c9c20[_0xffa9('0x16')](_0x41eb49[_0xffa9('0x15')])){_0x41eb49[_0xffa9('0x15')]=_0x41eb49['html']['replace'](_0x2c9c20,'');}if(_0x41eb49[_0xffa9('0x15')][_0xffa9('0x17')](_0xffa9('0x18'))){var _0x48a6aa=[];_0x41eb49['attachments'][_0xffa9('0x19')](_0xb9e513=>{_0x48a6aa[_0xffa9('0x1a')](_0xb9e513['filename']);});var _0x573a85=/]+>/g;var _0x43f0c7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x57af5b=_0x41eb49[_0xffa9('0x15')][_0xffa9('0x1b')](_0x43f0c7,_0xffa9('0x1c'));var _0x331606=_0x57af5b[_0xffa9('0x1b')](_0x573a85,_0xffa9('0x1d'));for(let _0x34611e=0x0;_0x34611e<_0x48a6aa['length'];_0x34611e++){var _0x23e449=_0x331606[_0xffa9('0x1b')](_0xffa9('0x1d'),_0xffa9('0x1e')+_0x48a6aa[_0x34611e]+_0xffa9('0x1f'));_0x331606=_0x23e449;}_0x41eb49[_0xffa9('0x15')]=_0x331606;}_0x27f229['body']=_0x41eb49['html'];}else{_0x27f229[_0xffa9('0x20')]=_0x41eb49[_0xffa9('0x21')];}if(_0x27f229[_0xffa9('0x20')]){_0x27f229[_0xffa9('0x20')]=_0x27f229[_0xffa9('0x20')][_0xffa9('0x1b')](/0x0){var _0x410d17=[_0xffa9('0x30'),_0xffa9('0x31'),'Precedence:\x20auto_reply'];for(var _0x503c8a=0x0;_0x503c8a<_0x41eb49[_0xffa9('0x2f')][_0xffa9('0xf')];_0x503c8a++){var _0x39a0e5=_[_0xffa9('0xe')](_0x410d17,_0x41eb49['headerLines'][_0x503c8a][_0xffa9('0x32')]);if(_0x39a0e5>=0x0){_0x27f229[_0xffa9('0x33')]=!![];}}}return _0x27f229;}exports[_0xffa9('0x34')]=function(_0x358bd3,_0x2d3500,_0xa7013c){var _0x2a25f2={'from':getAddress(_0x2d3500[_0xffa9('0x35')]),'firstName':getFirstName(_0x2d3500[_0xffa9('0x35')]),'lastName':getLastName(_0x2d3500[_0xffa9('0x35')]),'mapKey':_0xffa9('0x5'),'message':{'from':getMails(_0x358bd3[_0xffa9('0x5')],_0x2d3500[_0xffa9('0x35')]),'to':_0x358bd3[_0xffa9('0x5')],'cc':'','subject':_0x2d3500[_0xffa9('0x36')]||'','messageId':_0x2d3500['messageId'],'inReplyTo':_0x2d3500['inReplyTo'],'sentAt':moment(_0x2d3500[_0xffa9('0x37')])[_0xffa9('0x2a')](_0xffa9('0x38')),'attach':![],'attachments':[]}};if(!_0x2d3500[_0xffa9('0x15')]&&!_0x2d3500[_0xffa9('0x21')]){var _0x3e59df=_['filter'](_0x2d3500[_0xffa9('0x27')],{'contentType':_0xffa9('0x39')});if(_0x3e59df['length']){logger['info'](util[_0xffa9('0x2a')](_0xffa9('0x3a'),_0x2d3500[_0xffa9('0x3b')]));tnef['parseBuffer'](_['first'](_0x3e59df)['content'],function(_0x22c3a5,_0x37be15){if(_0x37be15){_0x2d3500[_0xffa9('0x15')]=_0x37be15[_0xffa9('0x3c')]||_0xffa9('0x3d');if(_0x37be15[_0xffa9('0x3e')]){for(var _0x2fff16=0x0;_0x2fff16<_0x37be15['Attachments'][_0xffa9('0xf')];_0x2fff16++){var _0x33e1f5=_0x37be15[_0xffa9('0x3e')][_0x2fff16];_0x2a25f2[_0xffa9('0x23')][_0xffa9('0x27')][_0xffa9('0x1a')]({'filename':_0x33e1f5['Title'],'content':Buffer[_0xffa9('0x35')](_0x33e1f5['Data'])});}}}_0xa7013c(parseEmail(_0x358bd3,_0x2d3500,_0x2a25f2));});}else{_0x2d3500[_0xffa9('0x15')]=_0xffa9('0x3d');_0xa7013c(parseEmail(_0x358bd3,_0x2d3500,_0x2a25f2));}}else{_0xa7013c(parseEmail(_0x358bd3,_0x2d3500,_0x2a25f2));}};exports[_0xffa9('0x3f')]=function(_0x1141cc){switch(_0x1141cc){case _0xffa9('0x40'):return _0xffa9('0x41');case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0xffa9('0x42');case _0xffa9('0x43'):return'outlook.office365.com';}return _0xffa9('0x44');}; \ No newline at end of file +var _0x2ffe=['messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','join','Anonymous','length','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','body','0x1?_0x19d2ce[_0xe2ff('0x11')](0x0,-0x1)[_0xe2ff('0x12')]('\x20'):_0x115c88['name'];}return _0xe2ff('0x13');}function getLastName(_0x3061e2){var _0x1c60ab=_[_0xe2ff('0x7')](_0x3061e2[_0xe2ff('0x8')]);if(_0x1c60ab&&_0x1c60ab[_0xe2ff('0xd')]){var _0x201128=_0x1c60ab[_0xe2ff('0xd')][_0xe2ff('0x10')](/\s+/);return _0x201128[_0xe2ff('0x14')]>0x1?_0x201128[_0xe2ff('0x15')]():'';}return'';}function getMails(_0x3b8f1b,_0x336368){var _0x31a8a0='';for(var _0x3fb0f4=0x0;_0x3fb0f4<_0x336368[_0xe2ff('0x8')]['length'];_0x3fb0f4+=0x1){if(_0x336368[_0xe2ff('0x8')][_0x3fb0f4][_0xe2ff('0x9')]!==_0x3b8f1b){if(!_[_0xe2ff('0x16')](_0x31a8a0)){_0x31a8a0+=',';}_0x31a8a0+=_0x336368[_0xe2ff('0x8')][_0x3fb0f4]['name']||_0x336368[_0xe2ff('0x8')][_0x3fb0f4][_0xe2ff('0x9')]||'';_0x31a8a0+='\x20<';_0x31a8a0+=_0x336368[_0xe2ff('0x8')][_0x3fb0f4][_0xe2ff('0x9')]?_0x336368[_0xe2ff('0x8')][_0x3fb0f4][_0xe2ff('0x9')]:_0xe2ff('0xa')+random['generate'](0x6)+'@xcally.com';_0x31a8a0+='>';}}return _0x31a8a0;}function parseEmail(_0x5646ee,_0x5e31f3,_0x418362){if(_0x5e31f3[_0xe2ff('0x17')]){var _0xcaf707=/)<[^<]*)*<\/script>/gi;while(_0xcaf707[_0xe2ff('0x18')](_0x5e31f3[_0xe2ff('0x17')])){_0x5e31f3[_0xe2ff('0x17')]=_0x5e31f3[_0xe2ff('0x17')][_0xe2ff('0x19')](_0xcaf707,'');}if(_0x5e31f3[_0xe2ff('0x17')]['includes'](_0xe2ff('0x1a'))){var _0x4a2222=[];_0x5e31f3[_0xe2ff('0x1b')][_0xe2ff('0x1c')](_0x495bb2=>{_0x4a2222[_0xe2ff('0x1d')](_0x495bb2['filename']);});var _0x5265b5=/]+>/g;var _0x497890=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x373529=_0x5e31f3['html']['replace'](_0x497890,_0xe2ff('0x1e'));var _0x143ed9=_0x373529['replace'](_0x5265b5,'_IMG');for(let _0x3eeba0=0x0;_0x3eeba0<_0x4a2222[_0xe2ff('0x14')];_0x3eeba0++){var _0x2b8839=_0x143ed9[_0xe2ff('0x19')](_0xe2ff('0x1f'),_0xe2ff('0x20')+_0x4a2222[_0x3eeba0]+'\x20]');_0x143ed9=_0x2b8839;}_0x5e31f3[_0xe2ff('0x17')]=_0x143ed9;}_0x418362[_0xe2ff('0x21')]=_0x5e31f3[_0xe2ff('0x17')];}else{_0x418362[_0xe2ff('0x21')]=_0x5e31f3['textAsHtml'];}if(_0x418362[_0xe2ff('0x21')]){_0x418362[_0xe2ff('0x21')]=_0x418362['body'][_0xe2ff('0x19')](/0x0){var _0x3be03f=[_0xe2ff('0x32'),_0xe2ff('0x33'),_0xe2ff('0x34')];for(var _0x127b24=0x0;_0x127b24<_0x5e31f3['headerLines'][_0xe2ff('0x14')];_0x127b24++){var _0x486cd7=_['indexOf'](_0x3be03f,_0x5e31f3['headerLines'][_0x127b24][_0xe2ff('0x35')]);if(_0x486cd7>=0x0){_0x418362[_0xe2ff('0x36')]=!![];}}}return _0x418362;}exports[_0xe2ff('0x37')]=function(_0x4ef9f7,_0x3f4572,_0x268650){var _0x190b49={'from':getAddress(_0x3f4572[_0xe2ff('0x38')]),'firstName':getFirstName(_0x3f4572[_0xe2ff('0x38')]),'lastName':getLastName(_0x3f4572[_0xe2ff('0x38')]),'mapKey':_0xe2ff('0x5'),'message':{'from':getMails(_0x4ef9f7[_0xe2ff('0x5')],_0x3f4572[_0xe2ff('0x38')]),'to':_0x4ef9f7[_0xe2ff('0x5')],'cc':'','subject':_0x3f4572[_0xe2ff('0x39')]||'','messageId':_0x3f4572[_0xe2ff('0x3a')],'inReplyTo':_0x3f4572[_0xe2ff('0x3b')],'sentAt':moment(_0x3f4572[_0xe2ff('0x3c')])[_0xe2ff('0x2a')](_0xe2ff('0x3d')),'attach':![],'attachments':[]}};if(!_0x3f4572[_0xe2ff('0x17')]&&!_0x3f4572[_0xe2ff('0x3e')]){var _0x11b208=_[_0xe2ff('0x3f')](_0x3f4572[_0xe2ff('0x1b')],{'contentType':_0xe2ff('0x40')});if(_0x11b208[_0xe2ff('0x14')]){logger[_0xe2ff('0x41')](util['format'](_0xe2ff('0x42'),_0x3f4572['messageId']));tnef[_0xe2ff('0x43')](_[_0xe2ff('0x44')](_0x11b208)[_0xe2ff('0x2f')],function(_0x9ddb96,_0x4acdcb){if(_0x4acdcb){_0x3f4572[_0xe2ff('0x17')]=_0x4acdcb[_0xe2ff('0x45')]||'

Empty\x20message

';if(_0x4acdcb[_0xe2ff('0x46')]){for(var _0x4a25bc=0x0;_0x4a25bc<_0x4acdcb[_0xe2ff('0x46')][_0xe2ff('0x14')];_0x4a25bc++){var _0x521d2a=_0x4acdcb[_0xe2ff('0x46')][_0x4a25bc];_0x190b49[_0xe2ff('0x23')]['attachments']['push']({'filename':_0x521d2a[_0xe2ff('0x47')],'content':Buffer['from'](_0x521d2a[_0xe2ff('0x48')])});}}}_0x268650(parseEmail(_0x4ef9f7,_0x3f4572,_0x190b49));});}else{_0x3f4572[_0xe2ff('0x17')]=_0xe2ff('0x49');_0x268650(parseEmail(_0x4ef9f7,_0x3f4572,_0x190b49));}}else{_0x268650(parseEmail(_0x4ef9f7,_0x3f4572,_0x190b49));}};exports[_0xe2ff('0x4a')]=function(_0x432c60){switch(_0x432c60){case _0xe2ff('0x4b'):return _0xe2ff('0x4c');case'yahoo':return _0xe2ff('0x4d');case _0xe2ff('0x4e'):return _0xe2ff('0x4f');case _0xe2ff('0x50'):return'outlook.office365.com';}return _0xe2ff('0x51');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 8fbe83a..f0cbfdf 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 _0xb03b=['name','key','SERV','active','Smtp','exports','lodash'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xb03b,0x148));var _0xbb03=function(_0x4936bb,_0x57d99d){_0x4936bb=_0x4936bb-0x0;var _0x3909c3=_0xb03b[_0x4936bb];return _0x3909c3;};'use strict';var _=require(_0xbb03('0x0'));function MailAccount(_0x56003c){this['id']=_0x56003c['id']||0x0;this[_0xbb03('0x1')]=_0x56003c[_0xbb03('0x1')]||'Service';this[_0xbb03('0x2')]=_0x56003c[_0xbb03('0x2')]||_0xbb03('0x3');this['active']=_0x56003c[_0xbb03('0x4')]||![];this['Imap']=_0x56003c['Imap']||[];this[_0xbb03('0x5')]=_0x56003c['Smtp']||[];}module[_0xbb03('0x6')]=MailAccount; \ No newline at end of file +var _0xdcbb=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xdcbb,0xe8));var _0xbdcb=function(_0x29df4c,_0x173127){_0x29df4c=_0x29df4c-0x0;var _0x4357e2=_0xdcbb[_0x29df4c];return _0x4357e2;};'use strict';var _=require('lodash');function MailAccount(_0x70cba8){this['id']=_0x70cba8['id']||0x0;this[_0xbdcb('0x0')]=_0x70cba8['name']||_0xbdcb('0x1');this[_0xbdcb('0x2')]=_0x70cba8[_0xbdcb('0x2')]||_0xbdcb('0x3');this[_0xbdcb('0x4')]=_0x70cba8['active']||![];this['Imap']=_0x70cba8[_0xbdcb('0x5')]||[];this[_0xbdcb('0x6')]=_0x70cba8[_0xbdcb('0x6')]||[];}module[_0xbdcb('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 20cc23e..cb88d95 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 _0x5097=['prototype','mergeFromDatabase','merge','exports','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x3d8434,_0x41b651){var _0x1838e3=function(_0x1f1e2c){while(--_0x1f1e2c){_0x3d8434['push'](_0x3d8434['shift']());}};_0x1838e3(++_0x41b651);}(_0x5097,0x10e));var _0x7509=function(_0x165495,_0x1e6395){_0x165495=_0x165495-0x0;var _0x207a6a=_0x5097[_0x165495];return _0x207a6a;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x7509('0x0')]={};};function freeIsNotKey(_0x4f4b8e,_0x56ec86,_0x3717b8){var _0x3d11d4=_[_0x7509('0x1')](_0x4f4b8e,function(_0x207b90,_0x4882a6){return _0x207b90[_0x3717b8];});for(var _0x3bec14 in _0x56ec86){if(_0x56ec86[_0x7509('0x2')](_0x3bec14)){if(!_0x3d11d4[_0x3bec14]){delete _0x56ec86[_0x3bec14];}}}}Realtime[_0x7509('0x3')][_0x7509('0x4')]=function(_0x173237,_0x36e375){for(var _0x2c269c in _0x36e375){if(_0x173237[_0x7509('0x2')](_0x2c269c)){_0x173237[_0x2c269c]=_0x36e375[_0x2c269c];}}};Realtime[_0x7509('0x3')]['initMailAccounts']=function(){var _0x154a8d=this;return function(_0x3964c2){if(_0x3964c2){freeIsNotKey(_0x3964c2,_0x154a8d[_0x7509('0x0')],'id');for(var _0x33de6c=0x0,_0x5cb040={},_0x5f3cb5={};_0x33de6c<_0x3964c2['length'];_0x33de6c+=0x1){_0x5cb040=_0x3964c2[_0x33de6c];if(_['isUndefined'](_0x154a8d['mailAccounts'][_0x5cb040['id']])){_0x154a8d['mailAccounts'][_0x5cb040['id']]=new MailAccount(_0x5cb040);}else{_[_0x7509('0x5')](_0x154a8d['mailAccounts'][_0x5cb040['id']],_0x5cb040);}}}return _0x154a8d[_0x7509('0x0')];};};module[_0x7509('0x6')]=Realtime; \ No newline at end of file +var _0xb3cd=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x136304,_0x2045f4){var _0x76ef02=function(_0x175347){while(--_0x175347){_0x136304['push'](_0x136304['shift']());}};_0x76ef02(++_0x2045f4);}(_0xb3cd,0x189));var _0xdb3c=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xb3cd[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0xdb3c('0x0'));var MailAccount=require(_0xdb3c('0x1'));var Realtime=function(){this[_0xdb3c('0x2')]={};};function freeIsNotKey(_0x5213ef,_0x2d2ba1,_0x1c13e3){var _0xc3af0d=_['mapKeys'](_0x5213ef,function(_0x4837e6,_0x3d47f2){return _0x4837e6[_0x1c13e3];});for(var _0x8b5a0 in _0x2d2ba1){if(_0x2d2ba1[_0xdb3c('0x3')](_0x8b5a0)){if(!_0xc3af0d[_0x8b5a0]){delete _0x2d2ba1[_0x8b5a0];}}}}Realtime[_0xdb3c('0x4')][_0xdb3c('0x5')]=function(_0x233d69,_0xc9eac6){for(var _0xd4cde7 in _0xc9eac6){if(_0x233d69[_0xdb3c('0x3')](_0xd4cde7)){_0x233d69[_0xd4cde7]=_0xc9eac6[_0xd4cde7];}}};Realtime[_0xdb3c('0x4')][_0xdb3c('0x6')]=function(){var _0x2d3648=this;return function(_0x3356f8){if(_0x3356f8){freeIsNotKey(_0x3356f8,_0x2d3648[_0xdb3c('0x2')],'id');for(var _0x4d9e64=0x0,_0x533e97={},_0x143521={};_0x4d9e64<_0x3356f8[_0xdb3c('0x7')];_0x4d9e64+=0x1){_0x533e97=_0x3356f8[_0x4d9e64];if(_[_0xdb3c('0x8')](_0x2d3648[_0xdb3c('0x2')][_0x533e97['id']])){_0x2d3648['mailAccounts'][_0x533e97['id']]=new MailAccount(_0x533e97);}else{_[_0xdb3c('0x9')](_0x2d3648[_0xdb3c('0x2')][_0x533e97['id']],_0x533e97);}}}return _0x2d3648[_0xdb3c('0x2')];};};module[_0xdb3c('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 8493c18..777c7f1 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 _0x5e6a=['MailServerIn','Imap','Smtp','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','service','email','active','key','ListId','TemplateId'];(function(_0x5a6061,_0x3bd9ec){var _0x4aa6c9=function(_0x5d5e0f){while(--_0x5d5e0f){_0x5a6061['push'](_0x5a6061['shift']());}};_0x4aa6c9(++_0x3bd9ec);}(_0x5e6a,0x1e5));var _0xa5e6=function(_0x49684e,_0x9a24fb){_0x49684e=_0x49684e-0x0;var _0x54062f=_0x5e6a[_0x49684e];return _0x54062f;};'use strict';var client=require(_0xa5e6('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xa5e6('0x1')](_0xa5e6('0x2'),{'options':{'attributes':['id',_0xa5e6('0x3'),_0xa5e6('0x4'),_0xa5e6('0x5'),_0xa5e6('0x6'),_0xa5e6('0x7'),_0xa5e6('0x8'),_0xa5e6('0x9')],'raw':![],'include':[{'model':_0xa5e6('0xa'),'as':_0xa5e6('0xb')},{'model':'MailServerOut','as':_0xa5e6('0xc')}]},'log':'getMailAccount'});};};exports[_0xa5e6('0xd')]=function(_0x39fe06,_0x12d425){return client[_0xa5e6('0x1')](_0xa5e6('0xe'),{'account':{'id':_0x39fe06},'body':_0x12d425,'log':_0xa5e6('0xe')});}; \ No newline at end of file +var _0x5226=['name','email','active','key','TemplateId','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount'];(function(_0x1f52ec,_0xeeaf8e){var _0x53b820=function(_0x315c1d){while(--_0x315c1d){_0x1f52ec['push'](_0x1f52ec['shift']());}};_0x53b820(++_0xeeaf8e);}(_0x5226,0x137));var _0x6522=function(_0x29e157,_0x111d44){_0x29e157=_0x29e157-0x0;var _0x3a67cd=_0x5226[_0x29e157];return _0x3a67cd;};'use strict';var client=require(_0x6522('0x0'));exports[_0x6522('0x1')]=function(){return function(){return client[_0x6522('0x2')](_0x6522('0x3'),{'options':{'attributes':['id',_0x6522('0x4'),'service',_0x6522('0x5'),_0x6522('0x6'),_0x6522('0x7'),'ListId',_0x6522('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x6522('0x9')},{'model':_0x6522('0xa'),'as':_0x6522('0xb')}]},'log':_0x6522('0xc')});};};exports[_0x6522('0xd')]=function(_0x2dbe49,_0x318dc1){return client['Request']('NotifyMailAccount',{'account':{'id':_0x2dbe49},'body':_0x318dc1,'log':_0x6522('0xe')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 42b853e..b6ac6bf 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 _0x9569=['ShowSetting','loginMailFrequency','../client'];(function(_0x50653f,_0x1f76b5){var _0x57d8e7=function(_0x33e2af){while(--_0x33e2af){_0x50653f['push'](_0x50653f['shift']());}};_0x57d8e7(++_0x1f76b5);}(_0x9569,0x18b));var _0x9956=function(_0x5d97ca,_0x32b0b1){_0x5d97ca=_0x5d97ca-0x0;var _0x253439=_0x9569[_0x5d97ca];return _0x253439;};'use strict';var client=require(_0x9956('0x0'));exports['getSettings']=function(){return client['Request'](_0x9956('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9956('0x2')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x065b=['loginMailFrequency','../client','getSettings','Request','ShowSetting'];(function(_0x43002a,_0x202b9b){var _0x4f58d1=function(_0xfe6045){while(--_0xfe6045){_0x43002a['push'](_0x43002a['shift']());}};_0x4f58d1(++_0x202b9b);}(_0x065b,0x83));var _0xb065=function(_0x584513,_0x37c6c9){_0x584513=_0x584513-0x0;var _0xe4a14e=_0x065b[_0x584513];return _0xe4a14e;};'use strict';var client=require(_0xb065('0x0'));exports[_0xb065('0x1')]=function(){return client[_0xb065('0x2')](_0xb065('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb065('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index ed195f5..ced2b12 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +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(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 cf3573f..e4e3e91 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 _0xf8ad=['listen','port','websocket','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout'];(function(_0x410981,_0x546ec1){var _0x14296e=function(_0xf77c99){while(--_0xf77c99){_0x410981['push'](_0x410981['shift']());}};_0x14296e(++_0x546ec1);}(_0xf8ad,0xd0));var _0xdf8a=function(_0x1f9f77,_0x20a988){_0x1f9f77=_0x1f9f77-0x0;var _0x52d64e=_0xf8ad[_0x1f9f77];return _0x52d64e;};'use strict';var _=require(_0xdf8a('0x0'));var http=require(_0xdf8a('0x1'));var express=require(_0xdf8a('0x2'));var sticky=require(_0xdf8a('0x3'));var Redis=require(_0xdf8a('0x4'));var config=require(_0xdf8a('0x5'));var app=express();var server=http[_0xdf8a('0x6')](app);server[_0xdf8a('0x7')]=0xdbba0;if(sticky[_0xdf8a('0x8')](server,config[_0xdf8a('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0xdf8a('0xa'),'polling']});config[_0xdf8a('0xb')]=_['defaults'](config['redis'],{'host':_0xdf8a('0xc'),'port':0x18eb});socketio[_0xdf8a('0xd')](require(_0xdf8a('0xe'))({'pubClient':new Redis(config[_0xdf8a('0xb')]),'subClient':new Redis(config[_0xdf8a('0xb')])}));require(_0xdf8a('0xf'))['default']();require(_0xdf8a('0x10'))[_0xdf8a('0x11')](socketio);require(_0xdf8a('0x12'))['default'](app);require(_0xdf8a('0x13'))[_0xdf8a('0x11')](app);}else{server[_0xdf8a('0x14')]('listening',function(){console[_0xdf8a('0x15')](_0xdf8a('0x16'),config[_0xdf8a('0x9')]);});}exports=module[_0xdf8a('0x17')]=app; \ No newline at end of file +var _0x545e=['http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','defaults','redis','localhost','adapter','default','../../config/express','../../routes','once','listening','log','exports','lodash'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x545e,0xdb));var _0xe545=function(_0x51daaa,_0x40ed35){_0x51daaa=_0x51daaa-0x0;var _0x5bb545=_0x545e[_0x51daaa];return _0x5bb545;};'use strict';var _=require(_0xe545('0x0'));var http=require(_0xe545('0x1'));var express=require(_0xe545('0x2'));var sticky=require(_0xe545('0x3'));var Redis=require(_0xe545('0x4'));var config=require(_0xe545('0x5'));var app=express();var server=http[_0xe545('0x6')](app);server[_0xe545('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0xe545('0x8')])){var socketio=require(_0xe545('0x9'))(server,{'transports':[_0xe545('0xa'),'polling']});config['redis']=_[_0xe545('0xb')](config[_0xe545('0xc')],{'host':_0xe545('0xd'),'port':0x18eb});socketio[_0xe545('0xe')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xe545('0xf')]();require('../../config/socketio')[_0xe545('0xf')](socketio);require(_0xe545('0x10'))['default'](app);require(_0xe545('0x11'))[_0xe545('0xf')](app);}else{server[_0xe545('0x12')](_0xe545('0x13'),function(){console[_0xe545('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe545('0x8')]);});}exports=module[_0xe545('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 827b4e1..e14672a 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 _0xe319=['bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','exports','jayson/promise'];(function(_0x14e2d2,_0x474a70){var _0x41e76c=function(_0x891f90){while(--_0x891f90){_0x14e2d2['push'](_0x14e2d2['shift']());}};_0x41e76c(++_0x474a70);}(_0xe319,0x103));var _0x9e31=function(_0x382fe6,_0x40b548){_0x382fe6=_0x382fe6-0x0;var _0x155c15=_0xe319[_0x382fe6];return _0x155c15;};'use strict';var jayson=require(_0x9e31('0x0'));var BPromise=require(_0x9e31('0x1'));var logger=require(_0x9e31('0x2'))(_0x9e31('0x3'));var client=jayson[_0x9e31('0x4')][_0x9e31('0x5')]({'port':0x2329});client[_0x9e31('0x6')]=function(_0x1a306d,_0x3c6fe5){return new BPromise(function(_0x45b44f,_0x5cb4a8){return client[_0x9e31('0x7')](_0x1a306d,_0x3c6fe5)['then'](function(_0x314db0){logger[_0x9e31('0x8')](_0x9e31('0x9'),_0x9e31('0x3'),_0x1a306d,_0x3c6fe5,_0x314db0);if(_0x314db0[_0x9e31('0xa')]){logger[_0x9e31('0xa')]('rpc',_0x9e31('0x3'),_0x1a306d,_0x314db0[_0x9e31('0xa')]['message'],_0x3c6fe5);return _0x5cb4a8(_0x314db0[_0x9e31('0xa')][_0x9e31('0xb')]);}else{return _0x45b44f(_0x314db0['result']);}})['catch'](function(_0x4a146c){logger['error'](_0x9e31('0x9'),_0x9e31('0x3'),_0x1a306d,_0x4a146c,_0x3c6fe5);return _0x5cb4a8(_0x4a146c);});});};module[_0x9e31('0xc')]=client; \ No newline at end of file +var _0xa054=['Request','request','then','debug','rpc','error','message','result','catch','jayson/promise','../../config/logger','routing','client','http'];(function(_0x5cf974,_0x43baa9){var _0x1a38f2=function(_0x372487){while(--_0x372487){_0x5cf974['push'](_0x5cf974['shift']());}};_0x1a38f2(++_0x43baa9);}(_0xa054,0x79));var _0x4a05=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xa054[_0x1e4f2d];return _0xd05ce5;};'use strict';var jayson=require(_0x4a05('0x0'));var BPromise=require('bluebird');var logger=require(_0x4a05('0x1'))(_0x4a05('0x2'));var client=jayson[_0x4a05('0x3')][_0x4a05('0x4')]({'port':0x2329});client[_0x4a05('0x5')]=function(_0x36a826,_0xb48614){return new BPromise(function(_0xe8b56c,_0x21dd24){return client[_0x4a05('0x6')](_0x36a826,_0xb48614)[_0x4a05('0x7')](function(_0x456168){logger[_0x4a05('0x8')](_0x4a05('0x9'),_0x4a05('0x2'),_0x36a826,_0xb48614,_0x456168);if(_0x456168[_0x4a05('0xa')]){logger[_0x4a05('0xa')](_0x4a05('0x9'),_0x4a05('0x2'),_0x36a826,_0x456168[_0x4a05('0xa')][_0x4a05('0xb')],_0xb48614);return _0x21dd24(_0x456168['error'][_0x4a05('0xb')]);}else{return _0xe8b56c(_0x456168[_0x4a05('0xc')]);}})[_0x4a05('0xd')](function(_0x5c6f38){logger[_0x4a05('0xa')](_0x4a05('0x9'),'routing',_0x36a826,_0x5c6f38,_0xb48614);return _0x21dd24(_0x5c6f38);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 4fb07c4..df3bfc0 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 _0x389e=['initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents'];(function(_0x3b1a8c,_0x1528be){var _0x32f853=function(_0x24ca99){while(--_0x24ca99){_0x3b1a8c['push'](_0x3b1a8c['shift']());}};_0x32f853(++_0x1528be);}(_0x389e,0x16c));var _0xe389=function(_0x2f80da,_0x7ce7d8){_0x2f80da=_0x2f80da-0x0;var _0x43a267=_0x389e[_0x2f80da];return _0x43a267;};'use strict';var BPromise=require(_0xe389('0x0'));var server=require(_0xe389('0x1'));var Realtime=require(_0xe389('0x2'));var user=require(_0xe389('0x3'));var interval=require(_0xe389('0x4'));var openchannelQueue=require(_0xe389('0x5'));var chatQueue=require(_0xe389('0x6'));var smsQueue=require(_0xe389('0x7'));var mailQueue=require(_0xe389('0x8'));var faxQueue=require(_0xe389('0x9'));var whatsappQueue=require(_0xe389('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe389('0xb')]()[_0xe389('0xc')](user[_0xe389('0xd')]())[_0xe389('0xc')](realtime[_0xe389('0xe')]())[_0xe389('0xc')](interval[_0xe389('0xf')]())[_0xe389('0xc')](realtime[_0xe389('0x10')]())[_0xe389('0xc')](openchannelQueue[_0xe389('0x11')]())[_0xe389('0xc')](realtime[_0xe389('0x12')]())[_0xe389('0xc')](chatQueue['getChatQueues']())[_0xe389('0xc')](realtime[_0xe389('0x13')]())[_0xe389('0xc')](smsQueue[_0xe389('0x14')]())[_0xe389('0xc')](realtime[_0xe389('0x15')]())[_0xe389('0xc')](mailQueue[_0xe389('0x16')]())[_0xe389('0xc')](realtime[_0xe389('0x17')]())[_0xe389('0xc')](faxQueue[_0xe389('0x18')]())[_0xe389('0xc')](realtime[_0xe389('0x19')]())['then'](whatsappQueue['getWhatsappQueues']())[_0xe389('0xc')](realtime[_0xe389('0x1a')]())[_0xe389('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xe389('0xc')](function(_0x56fdc2){return initRealtime();})[_0xe389('0xc')](function(_0x368687){return setInterval(initRealtime,0x1388);})['catch'](function(_0x569cc6){console['log'](_0x569cc6);});}main(); \ No newline at end of file +var _0xbc68=['then','initAgents','initIntervals','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','getAgents'];(function(_0x3a0fba,_0x4567d7){var _0x5b1752=function(_0x4a3fd9){while(--_0x4a3fd9){_0x3a0fba['push'](_0x3a0fba['shift']());}};_0x5b1752(++_0x4567d7);}(_0xbc68,0x12d));var _0x8bc6=function(_0x5509f7,_0x29958a){_0x5509f7=_0x5509f7-0x0;var _0x48582f=_0xbc68[_0x5509f7];return _0x48582f;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x8bc6('0x0'));var user=require(_0x8bc6('0x1'));var interval=require(_0x8bc6('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x8bc6('0x3'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0x8bc6('0x4')]())[_0x8bc6('0x5')](realtime[_0x8bc6('0x6')]())[_0x8bc6('0x5')](interval['getIntervals']())[_0x8bc6('0x5')](realtime[_0x8bc6('0x7')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x8bc6('0x5')](realtime[_0x8bc6('0x8')]())[_0x8bc6('0x5')](chatQueue[_0x8bc6('0x9')]())[_0x8bc6('0x5')](realtime['initChatQueues']())['then'](smsQueue[_0x8bc6('0xa')]())[_0x8bc6('0x5')](realtime['initSmsQueues']())[_0x8bc6('0x5')](mailQueue[_0x8bc6('0xb')]())[_0x8bc6('0x5')](realtime[_0x8bc6('0xc')]())[_0x8bc6('0x5')](faxQueue[_0x8bc6('0xd')]())['then'](realtime[_0x8bc6('0xe')]())[_0x8bc6('0x5')](whatsappQueue[_0x8bc6('0xf')]())['then'](realtime['initWhatsappQueues']())[_0x8bc6('0x5')](function(){return realtime;});}function main(){return server[_0x8bc6('0x10')](realtime)[_0x8bc6('0x5')](function(_0x15cadd){return initRealtime();})[_0x8bc6('0x5')](function(_0x44f5d3){return setInterval(initRealtime,0x1388);})[_0x8bc6('0x11')](function(_0x52fb92){console['log'](_0x52fb92);});}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 bbb80a5..2696474 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x55a452,_0x3aed55){var _0x409dfd=function(_0x6ca585){while(--_0x6ca585){_0x55a452['push'](_0x55a452['shift']());}};_0x409dfd(++_0x3aed55);}(_0xe14b,0x93));var _0xbe14=function(_0x354048,_0x363842){_0x354048=_0x354048-0x0;var _0x52aec8=_0xe14b[_0x354048];return _0x52aec8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x4bb32f,_0x2217e){var _0x2dd6e6=function(_0x28cd57){while(--_0x28cd57){_0x4bb32f['push'](_0x4bb32f['shift']());}};_0x2dd6e6(++_0x2217e);}(_0x326f,0xd1));var _0xf326=function(_0x508418,_0x21a5f5){_0x508418=_0x508418-0x0;var _0x28357b=_0x326f[_0x508418];return _0x28357b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 41874c8..c3cc7d4 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 _0xe0ca=['result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x128f69,_0x3a502d){var _0x37cdfa=function(_0xd3f800){while(--_0xd3f800){_0x128f69['push'](_0x128f69['shift']());}};_0x37cdfa(++_0x3a502d);}(_0xe0ca,0xb3));var _0xae0c=function(_0x1b79f5,_0x1cf93a){_0x1b79f5=_0x1b79f5-0x0;var _0x26a6f1=_0xe0ca[_0x1b79f5];return _0x26a6f1;};'use strict';var BPromise=require(_0xae0c('0x0'));var jayson=require(_0xae0c('0x1'));var client=jayson[_0xae0c('0x2')][_0xae0c('0x3')]({'port':0x232b});function request(_0x11302d,_0x41551b){return new BPromise(function(_0x3de03e,_0x1a9ddf){return client[_0xae0c('0x4')](_0x11302d,_0x41551b)[_0xae0c('0x5')](function(_0x2a43b4){if(_0x2a43b4[_0xae0c('0x6')]){return _0x1a9ddf(_0x2a43b4[_0xae0c('0x6')][_0xae0c('0x7')]);}else{return _0x3de03e(_0x2a43b4[_0xae0c('0x8')]);}})['catch'](function(_0x218588){return _0x1a9ddf(_0x218588);});});}exports[_0xae0c('0x9')]=function(_0x14febc,_0x362d5d){return request(_0xae0c('0xa'),{'account':_0x14febc,'message':_0x362d5d});}; \ No newline at end of file +var _0xcf90=['message','sendMailMessage','SendMail','jayson/promise','client','request','then','error'];(function(_0x5067db,_0xf8d2f2){var _0x2771e4=function(_0x3d5cb2){while(--_0x3d5cb2){_0x5067db['push'](_0x5067db['shift']());}};_0x2771e4(++_0xf8d2f2);}(_0xcf90,0x1cb));var _0x0cf9=function(_0x294ac7,_0x2e959b){_0x294ac7=_0x294ac7-0x0;var _0x4597e2=_0xcf90[_0x294ac7];return _0x4597e2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x0cf9('0x0'));var client=jayson[_0x0cf9('0x1')]['http']({'port':0x232b});function request(_0x6f1d4e,_0x515885){return new BPromise(function(_0xee9198,_0x5631c3){return client[_0x0cf9('0x2')](_0x6f1d4e,_0x515885)[_0x0cf9('0x3')](function(_0x7ce49b){if(_0x7ce49b[_0x0cf9('0x4')]){return _0x5631c3(_0x7ce49b[_0x0cf9('0x4')][_0x0cf9('0x5')]);}else{return _0xee9198(_0x7ce49b['result']);}})['catch'](function(_0x48d379){return _0x5631c3(_0x48d379);});});}exports[_0x0cf9('0x6')]=function(_0x12c75a,_0x450b6f){return request(_0x0cf9('0x7'),{'account':_0x12c75a,'message':_0x450b6f});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 10fab2e..01c7c3b 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 _0xf6c1=['smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','getChannelStatus','CurrentCapacity','Capacity','working','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','format','smsPause','faxStatus','stringify','emit','user:save','exports','lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0x4b8e60,_0x3cc2b9){var _0x28071c=function(_0x175b57){while(--_0x175b57){_0x4b8e60['push'](_0x4b8e60['shift']());}};_0x28071c(++_0x3cc2b9);}(_0xf6c1,0x149));var _0x1f6c=function(_0x46be2c,_0x4a8474){_0x46be2c=_0x46be2c-0x0;var _0x50ee72=_0xf6c1[_0x46be2c];return _0x50ee72;};'use strict';var _=require(_0x1f6c('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x1f6c('0x1'));var config=require('../../../config/environment');config[_0x1f6c('0x2')]=_[_0x1f6c('0x3')](config[_0x1f6c('0x2')],{'host':_0x1f6c('0x4'),'port':0x18eb});var io=require(_0x1f6c('0x5'))(new Redis(config['redis']));function Agent(_0x299ce2){this['id']=_0x299ce2['id']||0x0;this[_0x1f6c('0x6')]=_0x299ce2[_0x1f6c('0x6')]||'';this[_0x1f6c('0x7')]=_0x299ce2['online']||!![];this[_0x1f6c('0x8')]=_0x299ce2[_0x1f6c('0x8')]||![];this[_0x1f6c('0x9')]=_0x299ce2[_0x1f6c('0x9')]||![];this[_0x1f6c('0xa')]=_0x299ce2[_0x1f6c('0xa')]||![];this[_0x1f6c('0xb')]=_0x299ce2[_0x1f6c('0xb')]||![];this['smsPause']=_0x299ce2['smsPause']||![];this['openchannelPause']=_0x299ce2[_0x1f6c('0xc')]||![];this[_0x1f6c('0xd')]='unknown';this[_0x1f6c('0xe')]=0x0;this[_0x1f6c('0xf')]=_0x299ce2['chatCapacity']||0x0;this[_0x1f6c('0x10')]=0x0;this[_0x1f6c('0x11')]=_0x1f6c('0x12');this[_0x1f6c('0x13')]=0x0;this[_0x1f6c('0x14')]=_0x299ce2[_0x1f6c('0x14')]||0x0;this[_0x1f6c('0x15')]=0x0;this['faxStatus']=_0x1f6c('0x12');this[_0x1f6c('0x16')]=0x0;this[_0x1f6c('0x17')]=_0x299ce2[_0x1f6c('0x17')]||0x0;this[_0x1f6c('0x18')]=0x0;this[_0x1f6c('0x19')]=_0x1f6c('0x12');this[_0x1f6c('0x1a')]=0x0;this[_0x1f6c('0x1b')]=_0x299ce2['smsCapacity']||0x0;this[_0x1f6c('0x1c')]=0x0;this[_0x1f6c('0x1d')]=_0x1f6c('0x12');this[_0x1f6c('0x1e')]=0x0;this[_0x1f6c('0x1f')]=_0x299ce2[_0x1f6c('0x1f')]||0x0;this[_0x1f6c('0x20')]=0x0;this[_0x1f6c('0x21')]='unknown';this[_0x1f6c('0x22')]=0x0;this[_0x1f6c('0x23')]=_0x299ce2[_0x1f6c('0x23')]||0x0;this[_0x1f6c('0x24')]=0x0;this[_0x1f6c('0x25')]=![];this[_0x1f6c('0x26')]=undefined;this[_0x1f6c('0x27')]='';this['updateRealtime']();}Agent['prototype'][_0x1f6c('0x28')]=function(_0x23b9e8){if(this[_0x23b9e8+_0x1f6c('0x29')]>0x0){if(this[_0x23b9e8+'Capacity']>0x0&&this[_0x23b9e8+_0x1f6c('0x29')]>=this[_0x23b9e8+_0x1f6c('0x2a')]){return'maxcapacity';}else{return _0x1f6c('0x2b');}}else{return'idle';}};Agent['prototype'][_0x1f6c('0x2c')]=function(){var _0x524a91=[_0x1f6c('0x2d'),_0x1f6c('0x2e'),_0x1f6c('0x2f'),'fax',_0x1f6c('0x30'),_0x1f6c('0x31')];for(var _0x3b3110=0x0;_0x3b3110<_0x524a91[_0x1f6c('0x32')];_0x3b3110+=0x1){var _0x51aecc=this[_0x1f6c('0x28')](_0x524a91[_0x3b3110]);if(this[_0x524a91[_0x3b3110]+_0x1f6c('0x33')]!==_0x51aecc){this[_0x524a91[_0x3b3110]+'StatusTime']=_['toNumber'](moment()[_0x1f6c('0x34')]('x'));}this[_0x524a91[_0x3b3110]+_0x1f6c('0x33')]=_0x51aecc;}var _0x438ea8={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x1f6c('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x1f6c('0x35')],'faxPause':this['faxPause'],'openchannelPause':this[_0x1f6c('0xc')],'chatStatus':this[_0x1f6c('0xd')],'chatStatusTime':this[_0x1f6c('0xe')],'chatCapacity':this[_0x1f6c('0xf')],'chatCurrentCapacity':this[_0x1f6c('0x10')],'mailStatus':this[_0x1f6c('0x11')],'mailStatusTime':this[_0x1f6c('0x13')],'mailCapacity':this[_0x1f6c('0x14')],'mailCurrentCapacity':this[_0x1f6c('0x15')],'faxStatus':this[_0x1f6c('0x36')],'faxStatusTime':this[_0x1f6c('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1f6c('0x18')],'smsStatus':this[_0x1f6c('0x19')],'smsStatusTime':this[_0x1f6c('0x1a')],'smsCapacity':this[_0x1f6c('0x1b')],'smsCurrentCapacity':this[_0x1f6c('0x1c')],'whatsappStatus':this[_0x1f6c('0x1d')],'whatsappStatusTime':this[_0x1f6c('0x1e')],'whatsappCapacity':this[_0x1f6c('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x1f6c('0x21')],'openchannelStatusTime':this[_0x1f6c('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x1f6c('0x24')],'busy':this[_0x1f6c('0x25')],'busyQueue':this[_0x1f6c('0x26')]};var _0x19c02a=md5(JSON[_0x1f6c('0x37')](_0x438ea8));if(this[_0x1f6c('0x27')]!==_0x19c02a){this[_0x1f6c('0x27')]=_0x19c02a;io[_0x1f6c('0x38')](_0x1f6c('0x39'),_0x438ea8);}};module[_0x1f6c('0x3a')]=Agent; \ No newline at end of file +var _0x76e0=['redis','socket.io-emitter','name','voicePause','chatPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','openchannel','fax','length','StatusTime','mailPause','faxPause','chatCapacity','mailCurrentCapacity','smsStatus','openchannelCurrentCapacity','busy','stringify','emit','user:save','exports','../../../config/environment','defaults'];(function(_0x2e39e8,_0xd7987e){var _0x2e1a83=function(_0x5f213b){while(--_0x5f213b){_0x2e39e8['push'](_0x2e39e8['shift']());}};_0x2e1a83(++_0xd7987e);}(_0x76e0,0x6e));var _0x076e=function(_0x302220,_0x11be79){_0x302220=_0x302220-0x0;var _0x29e5b0=_0x76e0[_0x302220];return _0x29e5b0;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x076e('0x0'));config['redis']=_[_0x076e('0x1')](config[_0x076e('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x076e('0x3'))(new Redis(config[_0x076e('0x2')]));function Agent(_0x3bacb1){this['id']=_0x3bacb1['id']||0x0;this[_0x076e('0x4')]=_0x3bacb1[_0x076e('0x4')]||'';this['online']=_0x3bacb1['online']||!![];this[_0x076e('0x5')]=_0x3bacb1[_0x076e('0x5')]||![];this[_0x076e('0x6')]=_0x3bacb1['chatPause']||![];this['mailPause']=_0x3bacb1['mailPause']||![];this['faxPause']=_0x3bacb1['faxPause']||![];this[_0x076e('0x7')]=_0x3bacb1[_0x076e('0x7')]||![];this[_0x076e('0x8')]=_0x3bacb1[_0x076e('0x8')]||![];this[_0x076e('0x9')]=_0x076e('0xa');this[_0x076e('0xb')]=0x0;this['chatCapacity']=_0x3bacb1['chatCapacity']||0x0;this[_0x076e('0xc')]=0x0;this[_0x076e('0xd')]=_0x076e('0xa');this[_0x076e('0xe')]=0x0;this[_0x076e('0xf')]=_0x3bacb1[_0x076e('0xf')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x076e('0x10')]=_0x076e('0xa');this[_0x076e('0x11')]=0x0;this['faxCapacity']=_0x3bacb1[_0x076e('0x12')]||0x0;this[_0x076e('0x13')]=0x0;this['smsStatus']=_0x076e('0xa');this[_0x076e('0x14')]=0x0;this[_0x076e('0x15')]=_0x3bacb1[_0x076e('0x15')]||0x0;this[_0x076e('0x16')]=0x0;this[_0x076e('0x17')]=_0x076e('0xa');this[_0x076e('0x18')]=0x0;this[_0x076e('0x19')]=_0x3bacb1[_0x076e('0x19')]||0x0;this[_0x076e('0x1a')]=0x0;this[_0x076e('0x1b')]='unknown';this[_0x076e('0x1c')]=0x0;this[_0x076e('0x1d')]=_0x3bacb1[_0x076e('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x076e('0x1e')]=undefined;this[_0x076e('0x1f')]='';this[_0x076e('0x20')]();}Agent['prototype'][_0x076e('0x21')]=function(_0x410bca){if(this[_0x410bca+_0x076e('0x22')]>0x0){if(this[_0x410bca+_0x076e('0x23')]>0x0&&this[_0x410bca+_0x076e('0x22')]>=this[_0x410bca+_0x076e('0x23')]){return _0x076e('0x24');}else{return _0x076e('0x25');}}else{return _0x076e('0x26');}};Agent[_0x076e('0x27')]['updateRealtime']=function(){var _0x447043=[_0x076e('0x28'),'chat',_0x076e('0x29'),_0x076e('0x2a'),'sms','whatsapp'];for(var _0x4c7ed3=0x0;_0x4c7ed3<_0x447043[_0x076e('0x2b')];_0x4c7ed3+=0x1){var _0x1a6011=this[_0x076e('0x21')](_0x447043[_0x4c7ed3]);if(this[_0x447043[_0x4c7ed3]+'Status']!==_0x1a6011){this[_0x447043[_0x4c7ed3]+_0x076e('0x2c')]=_['toNumber'](moment()['format']('x'));}this[_0x447043[_0x4c7ed3]+'Status']=_0x1a6011;}var _0x17d06d={'id':this['id'],'name':this[_0x076e('0x4')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x076e('0x6')],'mailPause':this[_0x076e('0x2d')],'smsPause':this[_0x076e('0x7')],'faxPause':this[_0x076e('0x2e')],'openchannelPause':this[_0x076e('0x8')],'chatStatus':this[_0x076e('0x9')],'chatStatusTime':this[_0x076e('0xb')],'chatCapacity':this[_0x076e('0x2f')],'chatCurrentCapacity':this[_0x076e('0xc')],'mailStatus':this[_0x076e('0xd')],'mailStatusTime':this[_0x076e('0xe')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x076e('0x30')],'faxStatus':this[_0x076e('0x10')],'faxStatusTime':this[_0x076e('0x11')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x076e('0x13')],'smsStatus':this[_0x076e('0x31')],'smsStatusTime':this[_0x076e('0x14')],'smsCapacity':this[_0x076e('0x15')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x076e('0x17')],'whatsappStatusTime':this[_0x076e('0x18')],'whatsappCapacity':this[_0x076e('0x19')],'whatsappCurrentCapacity':this[_0x076e('0x1a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x076e('0x1c')],'openchannelCapacity':this[_0x076e('0x1d')],'openchannelCurrentCapacity':this[_0x076e('0x32')],'busy':this[_0x076e('0x33')],'busyQueue':this[_0x076e('0x1e')]};var _0xd87254=md5(JSON[_0x076e('0x34')](_0x17d06d));if(this[_0x076e('0x1f')]!==_0xd87254){this[_0x076e('0x1f')]=_0xd87254;io[_0x076e('0x35')](_0x076e('0x36'),_0x17d06d);}};module[_0x076e('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 6aea139..94cb1dd 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 _0xe8e2=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','online','chatPause','available','paused','stringify','format','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy'];(function(_0x4667a5,_0x1a2dbe){var _0x4c4cba=function(_0x3e5dc4){while(--_0x3e5dc4){_0x4667a5['push'](_0x4667a5['shift']());}};_0x4c4cba(++_0x1a2dbe);}(_0xe8e2,0x1e5));var _0x2e8e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xe8e2[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x2e8e('0x0'));var md5=require(_0x2e8e('0x1'));var util=require(_0x2e8e('0x2'));var Redis=require(_0x2e8e('0x3'));var config=require(_0x2e8e('0x4'));config[_0x2e8e('0x5')]=_['defaults'](config[_0x2e8e('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x1ab84b){this['id']=_0x1ab84b['id']||0x0;this['name']=_0x1ab84b[_0x2e8e('0x6')]||'';this[_0x2e8e('0x7')]=_0x1ab84b['timeout']||0xa;this[_0x2e8e('0x8')]=_0x1ab84b[_0x2e8e('0x8')]||_0x2e8e('0x9');this[_0x2e8e('0xa')]=_0x1ab84b[_0x2e8e('0xa')];this[_0x2e8e('0xb')]={};this[_0x2e8e('0xc')]=0x0;this[_0x2e8e('0x1')]='';this[_0x2e8e('0xd')]();this[_0x2e8e('0xe')]();}ChatQueue[_0x2e8e('0xf')][_0x2e8e('0xd')]=function(){var _0x276a5b=this[_0x2e8e('0xb')][_0x2e8e('0x10')];this['mapAgentsId']=_['map'](this[_0x2e8e('0xa')],'id');this['mapAgentsId']['_rr']=_0x276a5b;};ChatQueue['prototype'][_0x2e8e('0xe')]=function(){this[_0x2e8e('0x11')]=0x0;this['paused']=0x0;for(var _0x5cc11f=0x0;_0x5cc11f=0x0?this['available']:0x0;var _0x2910bf={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2e8e('0x11')],'name':this[_0x2e8e('0x6')],'paused':this['paused'],'waiting':this[_0x2e8e('0xc')]};var _0x59bb8d=md5(JSON[_0x2e8e('0x16')](_0x2910bf));if(this['md5']!==_0x59bb8d){this[_0x2e8e('0x1')]=_0x59bb8d;io['to'](util[_0x2e8e('0x17')]('chat:queue:%s',_0x2910bf['name']))['emit'](_0x2e8e('0x18'),_0x2910bf);}};module[_0x2e8e('0x19')]=ChatQueue; \ No newline at end of file +var _0x37f1=['md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','length','online','loggedIn','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash'];(function(_0x111e4c,_0x39e226){var _0x2aaa89=function(_0x5a31c8){while(--_0x5a31c8){_0x111e4c['push'](_0x111e4c['shift']());}};_0x2aaa89(++_0x39e226);}(_0x37f1,0x1ec));var _0x137f=function(_0x17f47a,_0x5c773a){_0x17f47a=_0x17f47a-0x0;var _0x3d9fc5=_0x37f1[_0x17f47a];return _0x3d9fc5;};'use strict';var _=require(_0x137f('0x0'));var md5=require(_0x137f('0x1'));var util=require('util');var Redis=require(_0x137f('0x2'));var config=require(_0x137f('0x3'));config[_0x137f('0x4')]=_[_0x137f('0x5')](config[_0x137f('0x4')],{'host':_0x137f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x137f('0x4')]));function ChatQueue(_0x45038a){this['id']=_0x45038a['id']||0x0;this['name']=_0x45038a[_0x137f('0x7')]||'';this[_0x137f('0x8')]=_0x45038a[_0x137f('0x8')]||0xa;this[_0x137f('0x9')]=_0x45038a[_0x137f('0x9')]||'beepall';this[_0x137f('0xa')]=_0x45038a['Agents'];this[_0x137f('0xb')]={};this[_0x137f('0xc')]=0x0;this[_0x137f('0x1')]='';this[_0x137f('0xd')]();this['updateRealtime']();}ChatQueue['prototype'][_0x137f('0xd')]=function(){var _0x3a15f8=this[_0x137f('0xb')][_0x137f('0xe')];this['mapAgentsId']=_['map'](this[_0x137f('0xa')],'id');this[_0x137f('0xb')]['_rr']=_0x3a15f8;};ChatQueue[_0x137f('0xf')][_0x137f('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xd3c8cd=0x0;_0xd3c8cd=0x0?this[_0x137f('0x16')]:0x0;var _0x318947={'id':this['id'],'available':this[_0x137f('0x16')],'loggedIn':this[_0x137f('0x13')],'name':this[_0x137f('0x7')],'paused':this[_0x137f('0x15')],'waiting':this[_0x137f('0xc')]};var _0x3e88c0=md5(JSON[_0x137f('0x17')](_0x318947));if(this[_0x137f('0x1')]!==_0x3e88c0){this['md5']=_0x3e88c0;io['to'](util[_0x137f('0x18')](_0x137f('0x19'),_0x318947[_0x137f('0x7')]))[_0x137f('0x1a')](_0x137f('0x1b'),_0x318947);}};module[_0x137f('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 ea5575a..9d76445 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 _0x787b=['strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','paused','online','faxPause','available','loggedIn','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x787b,0xc7));var _0xb787=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x787b[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xb787('0x0'));var md5=require(_0xb787('0x1'));var util=require(_0xb787('0x2'));var Redis=require(_0xb787('0x3'));var config=require(_0xb787('0x4'));config['redis']=_[_0xb787('0x5')](config['redis'],{'host':_0xb787('0x6'),'port':0x18eb});var io=require(_0xb787('0x7'))(new Redis(config[_0xb787('0x8')]));function FaxQueue(_0x216b9e){this['id']=_0x216b9e['id']||0x0;this[_0xb787('0x9')]=_0x216b9e[_0xb787('0x9')]||'';this[_0xb787('0xa')]=_0x216b9e[_0xb787('0xa')]||0xa;this['strategy']=_0x216b9e[_0xb787('0xb')]||_0xb787('0xc');this[_0xb787('0xd')]=_0x216b9e[_0xb787('0xd')];this['mapAgentsId']={};this[_0xb787('0xe')]=0x0;this[_0xb787('0x1')]='';this['updateRouting']();this[_0xb787('0xf')]();}FaxQueue[_0xb787('0x10')][_0xb787('0x11')]=function(){var _0xa8ab7d=this[_0xb787('0x12')][_0xb787('0x13')];this[_0xb787('0x12')]=_[_0xb787('0x14')](this[_0xb787('0xd')],'id');this[_0xb787('0x12')][_0xb787('0x13')]=_0xa8ab7d;};FaxQueue[_0xb787('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb787('0x15')]=0x0;for(var _0x463219=0x0;_0x463219=0x0?this['available']:0x0;var _0x131dde={'id':this['id'],'available':this[_0xb787('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xb787('0x15')],'waiting':this[_0xb787('0xe')]};var _0x5a27ec=md5(JSON['stringify'](_0x131dde));if(this['md5']!==_0x5a27ec){this[_0xb787('0x1')]=_0x5a27ec;io['to'](util[_0xb787('0x1a')](_0xb787('0x1b'),_0x131dde[_0xb787('0x9')]))['emit'](_0xb787('0x1c'),_0x131dde);}};module[_0xb787('0x1d')]=FaxQueue; \ No newline at end of file +var _0xd2ab=['faxPause','available','loggedIn','waiting','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online'];(function(_0x5bdc74,_0x23377a){var _0x1e46a3=function(_0x52abc1){while(--_0x52abc1){_0x5bdc74['push'](_0x5bdc74['shift']());}};_0x1e46a3(++_0x23377a);}(_0xd2ab,0x1c9));var _0xbd2a=function(_0x4c13dc,_0x28e2f1){_0x4c13dc=_0x4c13dc-0x0;var _0x32ad5b=_0xd2ab[_0x4c13dc];return _0x32ad5b;};'use strict';var _=require(_0xbd2a('0x0'));var md5=require(_0xbd2a('0x1'));var util=require(_0xbd2a('0x2'));var Redis=require(_0xbd2a('0x3'));var config=require(_0xbd2a('0x4'));config[_0xbd2a('0x5')]=_[_0xbd2a('0x6')](config[_0xbd2a('0x5')],{'host':_0xbd2a('0x7'),'port':0x18eb});var io=require(_0xbd2a('0x8'))(new Redis(config[_0xbd2a('0x5')]));function FaxQueue(_0x515521){this['id']=_0x515521['id']||0x0;this['name']=_0x515521[_0xbd2a('0x9')]||'';this['timeout']=_0x515521[_0xbd2a('0xa')]||0xa;this[_0xbd2a('0xb')]=_0x515521[_0xbd2a('0xb')]||_0xbd2a('0xc');this['Agents']=_0x515521[_0xbd2a('0xd')];this[_0xbd2a('0xe')]={};this['waiting']=0x0;this[_0xbd2a('0x1')]='';this[_0xbd2a('0xf')]();this[_0xbd2a('0x10')]();}FaxQueue[_0xbd2a('0x11')][_0xbd2a('0xf')]=function(){var _0x5edf72=this['mapAgentsId'][_0xbd2a('0x12')];this[_0xbd2a('0xe')]=_[_0xbd2a('0x13')](this[_0xbd2a('0xd')],'id');this[_0xbd2a('0xe')][_0xbd2a('0x12')]=_0x5edf72;};FaxQueue[_0xbd2a('0x11')][_0xbd2a('0x10')]=function(){this['loggedIn']=0x0;this[_0xbd2a('0x14')]=0x0;for(var _0x5af69c=0x0;_0x5af69c=0x0?this[_0xbd2a('0x18')]:0x0;var _0x54773d={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbd2a('0x19')],'name':this[_0xbd2a('0x9')],'paused':this[_0xbd2a('0x14')],'waiting':this[_0xbd2a('0x1a')]};var _0x335399=md5(JSON['stringify'](_0x54773d));if(this[_0xbd2a('0x1')]!==_0x335399){this['md5']=_0x335399;io['to'](util[_0xbd2a('0x1b')](_0xbd2a('0x1c'),_0x54773d['name']))[_0xbd2a('0x1d')](_0xbd2a('0x1e'),_0x54773d);}};module[_0xbd2a('0x1f')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 03cbe59..f9b018b 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 _0xd5f2=['Intervals','exports','name'];(function(_0x18fd0b,_0xe0f9ed){var _0x3b19a3=function(_0xde37ae){while(--_0xde37ae){_0x18fd0b['push'](_0x18fd0b['shift']());}};_0x3b19a3(++_0xe0f9ed);}(_0xd5f2,0x1bb));var _0x2d5f=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xd5f2[_0x40a825];return _0x273a54;};'use strict';function Interval(_0x379be3){this['id']=_0x379be3['id']||0x0;this[_0x2d5f('0x0')]=_0x379be3[_0x2d5f('0x0')]||'';this[_0x2d5f('0x1')]=_0x379be3['Intervals']||{};}module[_0x2d5f('0x2')]=Interval; \ No newline at end of file +var _0x734c=['exports','name','Intervals'];(function(_0x12dccf,_0x5d6207){var _0xc4efbf=function(_0x268419){while(--_0x268419){_0x12dccf['push'](_0x12dccf['shift']());}};_0xc4efbf(++_0x5d6207);}(_0x734c,0x11e));var _0xc734=function(_0x1ca285,_0x229461){_0x1ca285=_0x1ca285-0x0;var _0x595e82=_0x734c[_0x1ca285];return _0x595e82;};'use strict';function Interval(_0x498db6){this['id']=_0x498db6['id']||0x0;this[_0xc734('0x0')]=_0x498db6[_0xc734('0x0')]||'';this[_0xc734('0x1')]=_0x498db6[_0xc734('0x1')]||{};}module[_0xc734('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 87374c6..6f9a902 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 _0x25e6=['format','mail:queue:%s','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','loggedIn','paused','online','mailPause','available'];(function(_0x1c72c2,_0x2d32c5){var _0x1e43f2=function(_0x45b046){while(--_0x45b046){_0x1c72c2['push'](_0x1c72c2['shift']());}};_0x1e43f2(++_0x2d32c5);}(_0x25e6,0xb9));var _0x625e=function(_0x5c3565,_0x253757){_0x5c3565=_0x5c3565-0x0;var _0x4ebba2=_0x25e6[_0x5c3565];return _0x4ebba2;};'use strict';var _=require(_0x625e('0x0'));var md5=require(_0x625e('0x1'));var util=require(_0x625e('0x2'));var Redis=require(_0x625e('0x3'));var config=require('../../../config/environment');config[_0x625e('0x4')]=_[_0x625e('0x5')](config['redis'],{'host':_0x625e('0x6'),'port':0x18eb});var io=require(_0x625e('0x7'))(new Redis(config[_0x625e('0x4')]));function MailQueue(_0x3f5c68){this['id']=_0x3f5c68['id']||0x0;this[_0x625e('0x8')]=_0x3f5c68[_0x625e('0x8')]||'';this[_0x625e('0x9')]=_0x3f5c68[_0x625e('0x9')]||0xa;this['strategy']=_0x3f5c68[_0x625e('0xa')]||_0x625e('0xb');this[_0x625e('0xc')]=_0x3f5c68['Agents'];this[_0x625e('0xd')]={};this['waiting']=0x0;this[_0x625e('0x1')]='';this[_0x625e('0xe')]();this[_0x625e('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0x43d971=this[_0x625e('0xd')]['_rr'];this[_0x625e('0xd')]=_[_0x625e('0x10')](this[_0x625e('0xc')],'id');this['mapAgentsId'][_0x625e('0x11')]=_0x43d971;};MailQueue['prototype'][_0x625e('0xf')]=function(){this[_0x625e('0x12')]=0x0;this[_0x625e('0x13')]=0x0;for(var _0x50c059=0x0;_0x50c059=0x0?this[_0x625e('0x16')]:0x0;var _0x21e7be={'id':this['id'],'available':this[_0x625e('0x16')],'loggedIn':this[_0x625e('0x12')],'name':this[_0x625e('0x8')],'paused':this[_0x625e('0x13')],'waiting':this['waiting']};var _0x450dc6=md5(JSON['stringify'](_0x21e7be));if(this[_0x625e('0x1')]!==_0x450dc6){this['md5']=_0x450dc6;io['to'](util[_0x625e('0x17')](_0x625e('0x18'),_0x21e7be[_0x625e('0x8')]))['emit']('mail_queue:save',_0x21e7be);}};module[_0x625e('0x19')]=MailQueue; \ No newline at end of file +var _0x0972=['waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','mailPause','paused','available','format','emit','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0972,0x1de));var _0x2097=function(_0x53c53b,_0x257775){_0x53c53b=_0x53c53b-0x0;var _0x20a2e2=_0x0972[_0x53c53b];return _0x20a2e2;};'use strict';var _=require(_0x2097('0x0'));var md5=require(_0x2097('0x1'));var util=require(_0x2097('0x2'));var Redis=require(_0x2097('0x3'));var config=require(_0x2097('0x4'));config[_0x2097('0x5')]=_[_0x2097('0x6')](config[_0x2097('0x5')],{'host':_0x2097('0x7'),'port':0x18eb});var io=require(_0x2097('0x8'))(new Redis(config['redis']));function MailQueue(_0x2ad2d2){this['id']=_0x2ad2d2['id']||0x0;this[_0x2097('0x9')]=_0x2ad2d2[_0x2097('0x9')]||'';this['timeout']=_0x2ad2d2[_0x2097('0xa')]||0xa;this[_0x2097('0xb')]=_0x2ad2d2[_0x2097('0xb')]||_0x2097('0xc');this[_0x2097('0xd')]=_0x2ad2d2[_0x2097('0xd')];this[_0x2097('0xe')]={};this[_0x2097('0xf')]=0x0;this['md5']='';this[_0x2097('0x10')]();this['updateRealtime']();}MailQueue[_0x2097('0x11')][_0x2097('0x10')]=function(){var _0x546192=this[_0x2097('0xe')][_0x2097('0x12')];this[_0x2097('0xe')]=_[_0x2097('0x13')](this[_0x2097('0xd')],'id');this[_0x2097('0xe')][_0x2097('0x12')]=_0x546192;};MailQueue['prototype'][_0x2097('0x14')]=function(){this[_0x2097('0x15')]=0x0;this['paused']=0x0;for(var _0x3ce6cc=0x0;_0x3ce6cc=0x0?this[_0x2097('0x1a')]:0x0;var _0x1fa5fb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2097('0x15')],'name':this[_0x2097('0x9')],'paused':this[_0x2097('0x19')],'waiting':this[_0x2097('0xf')]};var _0x38144c=md5(JSON['stringify'](_0x1fa5fb));if(this[_0x2097('0x1')]!==_0x38144c){this[_0x2097('0x1')]=_0x38144c;io['to'](util[_0x2097('0x1b')]('mail:queue:%s',_0x1fa5fb[_0x2097('0x9')]))[_0x2097('0x1c')]('mail_queue:save',_0x1fa5fb);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f3fa8b7..26b4eac 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e19f5,_0x23d687){_0x5e19f5=_0x5e19f5-0x0;var _0x33d570=_0x2ef3[_0x5e19f5];return _0x33d570;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x1261,0x144));var _0x1126=function(_0x32eb8b,_0x5ac0b5){_0x32eb8b=_0x32eb8b-0x0;var _0x5bc68b=_0x1261[_0x32eb8b];return _0x5bc68b;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f552941..fb26936 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 _0x07c3=['updateRouting','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype'];(function(_0x5668a4,_0x27dee2){var _0x3995e1=function(_0x4d37dc){while(--_0x4d37dc){_0x5668a4['push'](_0x5668a4['shift']());}};_0x3995e1(++_0x27dee2);}(_0x07c3,0x1bf));var _0x307c=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0x07c3[_0x45dd0e];return _0x50e5ca;};'use strict';var _=require(_0x307c('0x0'));var md5=require(_0x307c('0x1'));var util=require(_0x307c('0x2'));var Redis=require(_0x307c('0x3'));var config=require(_0x307c('0x4'));config[_0x307c('0x5')]=_[_0x307c('0x6')](config[_0x307c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x307c('0x7'))(new Redis(config[_0x307c('0x5')]));function SmsQueue(_0x27515b){this['id']=_0x27515b['id']||0x0;this[_0x307c('0x8')]=_0x27515b[_0x307c('0x8')]||'';this[_0x307c('0x9')]=_0x27515b[_0x307c('0x9')]||0xa;this[_0x307c('0xa')]=_0x27515b[_0x307c('0xa')]||_0x307c('0xb');this[_0x307c('0xc')]=_0x27515b[_0x307c('0xc')];this[_0x307c('0xd')]={};this[_0x307c('0xe')]=0x0;this[_0x307c('0x1')]='';this['updateRouting']();this[_0x307c('0xf')]();}SmsQueue[_0x307c('0x10')][_0x307c('0x11')]=function(){var _0x2af63f=this['mapAgentsId']['_rr'];this[_0x307c('0xd')]=_['map'](this[_0x307c('0xc')],'id');this[_0x307c('0xd')]['_rr']=_0x2af63f;};SmsQueue[_0x307c('0x10')][_0x307c('0xf')]=function(){this[_0x307c('0x12')]=0x0;this[_0x307c('0x13')]=0x0;for(var _0x4193d8=0x0;_0x4193d8=0x0?this[_0x307c('0x17')]:0x0;var _0x3e05e2={'id':this['id'],'available':this[_0x307c('0x17')],'loggedIn':this[_0x307c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x307c('0xe')]};var _0x4aa3c8=md5(JSON[_0x307c('0x18')](_0x3e05e2));if(this['md5']!==_0x4aa3c8){this['md5']=_0x4aa3c8;io['to'](util[_0x307c('0x19')](_0x307c('0x1a'),_0x3e05e2['name']))[_0x307c('0x1b')](_0x307c('0x1c'),_0x3e05e2);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x919e=['stringify','format','emit','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','length','online','paused','available'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe919('0x0'));var md5=require(_0xe919('0x1'));var util=require(_0xe919('0x2'));var Redis=require('ioredis');var config=require(_0xe919('0x3'));config['redis']=_['defaults'](config[_0xe919('0x4')],{'host':_0xe919('0x5'),'port':0x18eb});var io=require(_0xe919('0x6'))(new Redis(config[_0xe919('0x4')]));function SmsQueue(_0x2171e9){this['id']=_0x2171e9['id']||0x0;this[_0xe919('0x7')]=_0x2171e9[_0xe919('0x7')]||'';this['timeout']=_0x2171e9[_0xe919('0x8')]||0xa;this[_0xe919('0x9')]=_0x2171e9['strategy']||_0xe919('0xa');this['Agents']=_0x2171e9[_0xe919('0xb')];this[_0xe919('0xc')]={};this[_0xe919('0xd')]=0x0;this['md5']='';this[_0xe919('0xe')]();this[_0xe919('0xf')]();}SmsQueue[_0xe919('0x10')]['updateRouting']=function(){var _0x12098d=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xe919('0x11')](this[_0xe919('0xb')],'id');this[_0xe919('0xc')]['_rr']=_0x12098d;};SmsQueue['prototype'][_0xe919('0xf')]=function(){this[_0xe919('0x12')]=0x0;this['paused']=0x0;for(var _0x3c09be=0x0;_0x3c09be=0x0?this['available']:0x0;var _0x5250b9={'id':this['id'],'available':this[_0xe919('0x16')],'loggedIn':this[_0xe919('0x12')],'name':this[_0xe919('0x7')],'paused':this[_0xe919('0x15')],'waiting':this['waiting']};var _0x4cc471=md5(JSON[_0xe919('0x17')](_0x5250b9));if(this[_0xe919('0x1')]!==_0x4cc471){this[_0xe919('0x1')]=_0x4cc471;io['to'](util[_0xe919('0x18')]('sms:queue:%s',_0x5250b9[_0xe919('0x7')]))[_0xe919('0x19')]('sms_queue:save',_0x5250b9);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 2b2aa75..b4b0b14 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 _0x6080=['length','online','whatsappPause','available','name','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused'];(function(_0x4fbf9c,_0x45db15){var _0x2f4670=function(_0x4bda1c){while(--_0x4bda1c){_0x4fbf9c['push'](_0x4fbf9c['shift']());}};_0x2f4670(++_0x45db15);}(_0x6080,0xfc));var _0x0608=function(_0x1c1131,_0x183402){_0x1c1131=_0x1c1131-0x0;var _0x32471e=_0x6080[_0x1c1131];return _0x32471e;};'use strict';var _=require(_0x0608('0x0'));var md5=require(_0x0608('0x1'));var util=require('util');var Redis=require(_0x0608('0x2'));var config=require(_0x0608('0x3'));config[_0x0608('0x4')]=_['defaults'](config[_0x0608('0x4')],{'host':_0x0608('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0608('0x4')]));function WhatsappQueue(_0x504570){this['id']=_0x504570['id']||0x0;this['name']=_0x504570['name']||'';this[_0x0608('0x6')]=_0x504570[_0x0608('0x6')]||0xa;this['strategy']=_0x504570[_0x0608('0x7')]||_0x0608('0x8');this[_0x0608('0x9')]=_0x504570[_0x0608('0x9')];this[_0x0608('0xa')]={};this[_0x0608('0xb')]=0x0;this[_0x0608('0x1')]='';this['updateRouting']();this[_0x0608('0xc')]();}WhatsappQueue[_0x0608('0xd')]['updateRouting']=function(){var _0x5eebff=this['mapAgentsId'][_0x0608('0xe')];this['mapAgentsId']=_[_0x0608('0xf')](this['Agents'],'id');this[_0x0608('0xa')]['_rr']=_0x5eebff;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x0608('0x10')]=0x0;this[_0x0608('0x11')]=0x0;for(var _0x1ab655=0x0;_0x1ab655=0x0?this[_0x0608('0x15')]:0x0;var _0x12c253={'id':this['id'],'available':this[_0x0608('0x15')],'loggedIn':this[_0x0608('0x10')],'name':this[_0x0608('0x16')],'paused':this[_0x0608('0x11')],'waiting':this[_0x0608('0xb')]};var _0x13bca3=md5(JSON['stringify'](_0x12c253));if(this[_0x0608('0x1')]!==_0x13bca3){this[_0x0608('0x1')]=_0x13bca3;io['to'](util[_0x0608('0x17')](_0x0608('0x18'),_0x12c253[_0x0608('0x16')]))['emit'](_0x0608('0x19'),_0x12c253);}};module[_0x0608('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xec22=['strategy','beepall','Agents','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x2dbf76,_0x50b1c8){var _0x3f16b4=function(_0x5837f9){while(--_0x5837f9){_0x2dbf76['push'](_0x2dbf76['shift']());}};_0x3f16b4(++_0x50b1c8);}(_0xec22,0x1aa));var _0x2ec2=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xec22[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x2ec2('0x0'));var md5=require(_0x2ec2('0x1'));var util=require(_0x2ec2('0x2'));var Redis=require('ioredis');var config=require(_0x2ec2('0x3'));config['redis']=_['defaults'](config[_0x2ec2('0x4')],{'host':_0x2ec2('0x5'),'port':0x18eb});var io=require(_0x2ec2('0x6'))(new Redis(config[_0x2ec2('0x4')]));function WhatsappQueue(_0x45addc){this['id']=_0x45addc['id']||0x0;this[_0x2ec2('0x7')]=_0x45addc[_0x2ec2('0x7')]||'';this['timeout']=_0x45addc[_0x2ec2('0x8')]||0xa;this[_0x2ec2('0x9')]=_0x45addc['strategy']||_0x2ec2('0xa');this[_0x2ec2('0xb')]=_0x45addc[_0x2ec2('0xb')];this[_0x2ec2('0xc')]={};this['waiting']=0x0;this[_0x2ec2('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x380c4f=this[_0x2ec2('0xc')][_0x2ec2('0xd')];this[_0x2ec2('0xc')]=_[_0x2ec2('0xe')](this[_0x2ec2('0xb')],'id');this[_0x2ec2('0xc')][_0x2ec2('0xd')]=_0x380c4f;};WhatsappQueue[_0x2ec2('0xf')][_0x2ec2('0x10')]=function(){this[_0x2ec2('0x11')]=0x0;this[_0x2ec2('0x12')]=0x0;for(var _0x326f0b=0x0;_0x326f0b=0x0?this[_0x2ec2('0x16')]:0x0;var _0x294d0f={'id':this['id'],'available':this[_0x2ec2('0x16')],'loggedIn':this[_0x2ec2('0x11')],'name':this['name'],'paused':this[_0x2ec2('0x12')],'waiting':this['waiting']};var _0x307ba0=md5(JSON[_0x2ec2('0x17')](_0x294d0f));if(this[_0x2ec2('0x1')]!==_0x307ba0){this[_0x2ec2('0x1')]=_0x307ba0;io['to'](util[_0x2ec2('0x18')](_0x2ec2('0x19'),_0x294d0f[_0x2ec2('0x7')]))[_0x2ec2('0x1a')](_0x2ec2('0x1b'),_0x294d0f);}};module[_0x2ec2('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index da5a011..19430f8 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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xc44f55,_0x3b4fba){var _0x236c29=function(_0x5c2640){while(--_0x5c2640){_0xc44f55['push'](_0xc44f55['shift']());}};_0x236c29(++_0x3b4fba);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c1ddc,_0x587040){_0x5c1ddc=_0x5c1ddc-0x0;var _0x542a11=_0xb10b[_0x5c1ddc];return _0x542a11;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 7c1e533..d7d0bbd 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 _0xd334=['addTagsToChatInteraction','../client','Request','addTags','AddTagsToChatInteraction'];(function(_0x232401,_0x318157){var _0x377d50=function(_0x5cab28){while(--_0x5cab28){_0x232401['push'](_0x232401['shift']());}};_0x377d50(++_0x318157);}(_0xd334,0x150));var _0x4d33=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xd334[_0x5bd426];return _0x23a7eb;};'use strict';var client=require(_0x4d33('0x0'));exports['update']=function(_0x517c0b,_0x46fffc){return client[_0x4d33('0x1')]('UpdateChatInteraction',{'body':_0x46fffc,'options':{'where':{'id':_0x517c0b}},'log':'updateChatInteraction'});};exports[_0x4d33('0x2')]=function(_0x4a1735,_0x16e7f7){return client[_0x4d33('0x1')](_0x4d33('0x3'),{'body':_0x16e7f7,'options':{'where':{'id':_0x4a1735}},'log':_0x4d33('0x4')});}; \ No newline at end of file +var _0xf6bd=['../client','update','Request','UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xf6bd,0x10e));var _0xdf6b=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xf6bd[_0x12aaee];return _0x37c350;};'use strict';var client=require(_0xdf6b('0x0'));exports[_0xdf6b('0x1')]=function(_0x5c9f2b,_0x5417c0){return client[_0xdf6b('0x2')](_0xdf6b('0x3'),{'body':_0x5417c0,'options':{'where':{'id':_0x5c9f2b}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x34c99f,_0x19978d){return client['Request'](_0xdf6b('0x4'),{'body':_0x19978d,'options':{'where':{'id':_0x34c99f}},'log':_0xdf6b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 2ae8538..187d6a7 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 _0xf69c=['Request','createChatMessage','../client','create'];(function(_0x565d73,_0x16aff8){var _0x4ac3a0=function(_0x524d5e){while(--_0x524d5e){_0x565d73['push'](_0x565d73['shift']());}};_0x4ac3a0(++_0x16aff8);}(_0xf69c,0x1e2));var _0xcf69=function(_0x20a822,_0x5dc295){_0x20a822=_0x20a822-0x0;var _0x3775d1=_0xf69c[_0x20a822];return _0x3775d1;};'use strict';var client=require(_0xcf69('0x0'));exports[_0xcf69('0x1')]=function(_0x478546){return client[_0xcf69('0x2')]('CreateChatMessage',{'body':_0x478546,'log':_0xcf69('0x3')});}; \ No newline at end of file +var _0xb826=['create','Request','createChatMessage','../client'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0xb826,0x1ab));var _0x6b82=function(_0x590624,_0x121026){_0x590624=_0x590624-0x0;var _0x4f2beb=_0xb826[_0x590624];return _0x4f2beb;};'use strict';var client=require(_0x6b82('0x0'));exports[_0x6b82('0x1')]=function(_0x599b12){return client[_0x6b82('0x2')]('CreateChatMessage',{'body':_0x599b12,'log':_0x6b82('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5b52081..65c3c83 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 _0xaab2=['User','Agents','name','chatPause','getChatQueues','Request','GetChatQueue','timeout','strategy'];(function(_0x275454,_0x12daca){var _0x1bdb36=function(_0x569c5f){while(--_0x569c5f){_0x275454['push'](_0x275454['shift']());}};_0x1bdb36(++_0x12daca);}(_0xaab2,0xca));var _0x2aab=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xaab2[_0x5bd426];return _0x23a7eb;};'use strict';var client=require('../client');exports[_0x2aab('0x0')]=function(){return function(){return client[_0x2aab('0x1')](_0x2aab('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2aab('0x3'),_0x2aab('0x4')],'include':[{'model':_0x2aab('0x5'),'as':_0x2aab('0x6'),'attributes':['id',_0x2aab('0x7'),'online',_0x2aab('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x7118=['name','online','chatPause','Request','GetChatQueue','timeout','strategy','User','Agents'];(function(_0x474ed3,_0x15d96d){var _0x5851b1=function(_0x29d005){while(--_0x29d005){_0x474ed3['push'](_0x474ed3['shift']());}};_0x5851b1(++_0x15d96d);}(_0x7118,0x159));var _0x8711=function(_0x169eb5,_0xa19793){_0x169eb5=_0x169eb5-0x0;var _0x25ce90=_0x7118[_0x169eb5];return _0x25ce90;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x8711('0x0')](_0x8711('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8711('0x2'),_0x8711('0x3')],'include':[{'model':_0x8711('0x4'),'as':_0x8711('0x5'),'attributes':['id',_0x8711('0x6'),_0x8711('0x7'),_0x8711('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index c20fd11..e9649c1 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 _0x5c4a=['DESC','create','CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x2f72d0,_0x4b288d){_0x2f72d0=_0x2f72d0-0x0;var _0x1d60a3=_0x5c4a[_0x2f72d0];return _0x1d60a3;};'use strict';var client=require('../client');exports[_0xa5c4('0x0')]=function(_0x1ba095){return client['Request'](_0xa5c4('0x1'),{'body':_0x1ba095,'log':_0xa5c4('0x1')});};exports['update']=function(_0x7411a4,_0x180239){return client[_0xa5c4('0x2')](_0xa5c4('0x3'),{'body':_0x180239,'options':{'where':{'uniqueid':_0x7411a4},'order':[['id',_0xa5c4('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x225c=['Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport','update'];(function(_0x5c8bbe,_0x5bda35){var _0x2e3aa6=function(_0x46672f){while(--_0x46672f){_0x5c8bbe['push'](_0x5c8bbe['shift']());}};_0x2e3aa6(++_0x5bda35);}(_0x225c,0x106));var _0xc225=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x225c[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xc225('0x0'));exports[_0xc225('0x1')]=function(_0x4882b7){return client['Request'](_0xc225('0x2'),{'body':_0x4882b7,'log':'CreateChatQueueReport'});};exports[_0xc225('0x3')]=function(_0xc96c33,_0x4778ea){return client[_0xc225('0x4')](_0xc225('0x5'),{'body':_0x4778ea,'options':{'where':{'uniqueid':_0xc96c33},'order':[['id',_0xc225('0x6')]],'limit':0x1},'log':_0xc225('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index ad1dda6..517843a 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(_0xd86a22,_0x58034d){var _0x2cc68b=function(_0x16171e){while(--_0x16171e){_0xd86a22['push'](_0xd86a22['shift']());}};_0x2cc68b(++_0x58034d);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x425063,_0x53b0b8){var _0x3e8302=function(_0x4f3119){while(--_0x4f3119){_0x425063['push'](_0x425063['shift']());}};_0x3e8302(++_0x53b0b8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_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 bcc7483..684eef6 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 _0x03c6=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x31351d,_0x508e96){var _0x5cab25=function(_0x1181a7){while(--_0x1181a7){_0x31351d['push'](_0x31351d['shift']());}};_0x5cab25(++_0x508e96);}(_0x03c6,0x17e));var _0x603c=function(_0x23fff2,_0x369871){_0x23fff2=_0x23fff2-0x0;var _0x466c9=_0x03c6[_0x23fff2];return _0x466c9;};'use strict';var client=require(_0x603c('0x0'));exports[_0x603c('0x1')]=function(_0x3589cc){return client['Request'](_0x603c('0x2'),{'body':_0x3589cc,'log':_0x603c('0x3')});}; \ No newline at end of file +var _0xbcc8=['create','CreateFaxMessage','createFaxMessage'];(function(_0x208481,_0x26d7db){var _0x43fe11=function(_0x179bec){while(--_0x179bec){_0x208481['push'](_0x208481['shift']());}};_0x43fe11(++_0x26d7db);}(_0xbcc8,0xa8));var _0x8bcc=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0xbcc8[_0x3b2369];return _0x5a1367;};'use strict';var client=require('../client');exports[_0x8bcc('0x0')]=function(_0xf3472b){return client['Request'](_0x8bcc('0x1'),{'body':_0xf3472b,'log':_0x8bcc('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index dcaf055..2b9eb55 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 _0x9eee=['Request','GetFaxQueue','name','timeout','strategy','online','faxPause','getFaxQueues','../client'];(function(_0x42e79a,_0x263ca1){var _0x21bb28=function(_0x527c14){while(--_0x527c14){_0x42e79a['push'](_0x42e79a['shift']());}};_0x21bb28(++_0x263ca1);}(_0x9eee,0x131));var _0xe9ee=function(_0xe4c80d,_0x345e82){_0xe4c80d=_0xe4c80d-0x0;var _0x20a426=_0x9eee[_0xe4c80d];return _0x20a426;};'use strict';var client=require(_0xe9ee('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xe9ee('0x1')](_0xe9ee('0x2'),{'options':{'raw':![],'attributes':['id',_0xe9ee('0x3'),_0xe9ee('0x4'),_0xe9ee('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xe9ee('0x3'),_0xe9ee('0x6'),_0xe9ee('0x7')]}]},'log':_0xe9ee('0x8')});};}; \ No newline at end of file +var _0xd273=['Request','timeout','strategy','User','Agents','faxPause','getFaxQueues'];(function(_0x3c5fb9,_0xa9c4ff){var _0x441532=function(_0x30882e){while(--_0x30882e){_0x3c5fb9['push'](_0x3c5fb9['shift']());}};_0x441532(++_0xa9c4ff);}(_0xd273,0x84));var _0x3d27=function(_0xb809d1,_0x1a30b6){_0xb809d1=_0xb809d1-0x0;var _0x49d5f6=_0xd273[_0xb809d1];return _0x49d5f6;};'use strict';var client=require('../client');exports[_0x3d27('0x0')]=function(){return function(){return client[_0x3d27('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x3d27('0x2'),_0x3d27('0x3')],'include':[{'model':_0x3d27('0x4'),'as':_0x3d27('0x5'),'attributes':['id','name','online',_0x3d27('0x6')]}]},'log':_0x3d27('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index dcac123..16950f9 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 _0xde2b=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x4ee174,_0x433e46){var _0x5836dc=function(_0x4f08ab){while(--_0x4f08ab){_0x4ee174['push'](_0x4ee174['shift']());}};_0x5836dc(++_0x433e46);}(_0xde2b,0x131));var _0xbde2=function(_0x44e9cb,_0x589b66){_0x44e9cb=_0x44e9cb-0x0;var _0x1102df=_0xde2b[_0x44e9cb];return _0x1102df;};'use strict';var client=require(_0xbde2('0x0'));exports[_0xbde2('0x1')]=function(_0xa394b2){return client[_0xbde2('0x2')](_0xbde2('0x3'),{'body':_0xa394b2,'log':_0xbde2('0x3')});};exports[_0xbde2('0x4')]=function(_0x3b539f,_0x22da13){return client['Request'](_0xbde2('0x5'),{'body':_0x22da13,'options':{'where':{'uniqueid':_0x3b539f},'order':[['id',_0xbde2('0x6')]],'limit':0x1},'log':_0xbde2('0x5')});}; \ No newline at end of file +var _0x7e4e=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x47e7dd,_0x51b041){var _0x38501f=function(_0x5ba66d){while(--_0x5ba66d){_0x47e7dd['push'](_0x47e7dd['shift']());}};_0x38501f(++_0x51b041);}(_0x7e4e,0x66));var _0xe7e4=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0x7e4e[_0x15f724];return _0x49b152;};'use strict';var client=require(_0xe7e4('0x0'));exports[_0xe7e4('0x1')]=function(_0x7718a){return client[_0xe7e4('0x2')](_0xe7e4('0x3'),{'body':_0x7718a,'log':_0xe7e4('0x3')});};exports[_0xe7e4('0x4')]=function(_0x4fdcd5,_0x38f8b9){return client[_0xe7e4('0x2')](_0xe7e4('0x5'),{'body':_0x38f8b9,'options':{'where':{'uniqueid':_0x4fdcd5},'order':[['id',_0xe7e4('0x6')]],'limit':0x1},'log':_0xe7e4('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b86a44c..e301472 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 _0x77a3=['interval','../client','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0x77a3,0xa1));var _0x377a=function(_0x209e59,_0x266c29){_0x209e59=_0x209e59-0x0;var _0x3d534c=_0x77a3[_0x209e59];return _0x3d534c;};'use strict';var client=require(_0x377a('0x0'));exports[_0x377a('0x1')]=function(){return function(){return client[_0x377a('0x2')](_0x377a('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x377a('0x4')],'include':[{'model':_0x377a('0x5'),'as':_0x377a('0x6'),'attributes':['id',_0x377a('0x4'),_0x377a('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xcd71=['name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xcd71,0x1af));var _0x1cd7=function(_0x21057f,_0x4e3b82){_0x21057f=_0x21057f-0x0;var _0x1e2c77=_0xcd71[_0x21057f];return _0x1e2c77;};'use strict';var client=require(_0x1cd7('0x0'));exports[_0x1cd7('0x1')]=function(){return function(){return client[_0x1cd7('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1cd7('0x3')],'include':[{'model':_0x1cd7('0x4'),'as':_0x1cd7('0x5'),'attributes':['id','name',_0x1cd7('0x6')]}]},'log':_0x1cd7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 04b1d2a..c930307 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 _0x57ca=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x1587c2,_0x4e9c58){var _0x4ee5f5=function(_0x205dea){while(--_0x205dea){_0x1587c2['push'](_0x1587c2['shift']());}};_0x4ee5f5(++_0x4e9c58);}(_0x57ca,0x108));var _0xa57c=function(_0x22c980,_0x44cb14){_0x22c980=_0x22c980-0x0;var _0x2d1ffe=_0x57ca[_0x22c980];return _0x2d1ffe;};'use strict';var client=require('../client');exports[_0xa57c('0x0')]=function(_0x4ad696,_0x4b1712){return client[_0xa57c('0x1')](_0xa57c('0x2'),{'body':_0x4b1712,'options':{'where':{'id':_0x4ad696}},'log':_0xa57c('0x3')});};exports[_0xa57c('0x4')]=function(_0x1da469,_0x48be2d){return client[_0xa57c('0x1')](_0xa57c('0x5'),{'body':_0x48be2d,'options':{'where':{'id':_0x1da469}},'log':_0xa57c('0x6')});}; \ No newline at end of file +var _0x4cf8=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update'];(function(_0x412871,_0x418447){var _0x328d47=function(_0x25f0fc){while(--_0x25f0fc){_0x412871['push'](_0x412871['shift']());}};_0x328d47(++_0x418447);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x13ec2b,_0x40b664){_0x13ec2b=_0x13ec2b-0x0;var _0x1fb3f4=_0x4cf8[_0x13ec2b];return _0x1fb3f4;};'use strict';var client=require(_0x84cf('0x0'));exports[_0x84cf('0x1')]=function(_0x287eb2,_0x2125ed){return client[_0x84cf('0x2')](_0x84cf('0x3'),{'body':_0x2125ed,'options':{'where':{'id':_0x287eb2}},'log':_0x84cf('0x4')});};exports[_0x84cf('0x5')]=function(_0x3bbbc3,_0x2d38c0){return client[_0x84cf('0x2')](_0x84cf('0x6'),{'body':_0x2d38c0,'options':{'where':{'id':_0x3bbbc3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c8232cd..158a047 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 _0xf659=['../client','Request','CreateMailMessage','createMailMessage'];(function(_0x5a5cb4,_0x227321){var _0x21eede=function(_0x4d09d3){while(--_0x4d09d3){_0x5a5cb4['push'](_0x5a5cb4['shift']());}};_0x21eede(++_0x227321);}(_0xf659,0x1b8));var _0x9f65=function(_0x5c88ff,_0x19e675){_0x5c88ff=_0x5c88ff-0x0;var _0x4eec40=_0xf659[_0x5c88ff];return _0x4eec40;};'use strict';var client=require(_0x9f65('0x0'));exports['create']=function(_0x24937e){return client[_0x9f65('0x1')](_0x9f65('0x2'),{'body':_0x24937e,'log':_0x9f65('0x3')});}; \ No newline at end of file +var _0xdde4=['Request','createMailMessage','../client'];(function(_0x23b85e,_0x39b209){var _0x329756=function(_0x3418e1){while(--_0x3418e1){_0x23b85e['push'](_0x23b85e['shift']());}};_0x329756(++_0x39b209);}(_0xdde4,0x80));var _0x4dde=function(_0x196cd4,_0x1f7234){_0x196cd4=_0x196cd4-0x0;var _0x3bb930=_0xdde4[_0x196cd4];return _0x3bb930;};'use strict';var client=require(_0x4dde('0x0'));exports['create']=function(_0x267730){return client[_0x4dde('0x1')]('CreateMailMessage',{'body':_0x267730,'log':_0x4dde('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 88a4e7f..42dc72a 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 _0xabac=['mailPause','../client','getMailQueues','Request','User','Agents','name'];(function(_0x62b58e,_0x46fe1e){var _0x37fe84=function(_0x12a2ca){while(--_0x12a2ca){_0x62b58e['push'](_0x62b58e['shift']());}};_0x37fe84(++_0x46fe1e);}(_0xabac,0x1dd));var _0xcaba=function(_0x91384,_0x476988){_0x91384=_0x91384-0x0;var _0x1a16c2=_0xabac[_0x91384];return _0x1a16c2;};'use strict';var client=require(_0xcaba('0x0'));exports[_0xcaba('0x1')]=function(){return function(){return client[_0xcaba('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xcaba('0x3'),'as':_0xcaba('0x4'),'attributes':['id',_0xcaba('0x5'),'online',_0xcaba('0x6')]}]},'log':_0xcaba('0x1')});};}; \ No newline at end of file +var _0xe808=['name','strategy','User','mailPause','getMailQueues','../client','GetMailQueue'];(function(_0x255a8d,_0x12b2c2){var _0x19ceb8=function(_0x2a005d){while(--_0x2a005d){_0x255a8d['push'](_0x255a8d['shift']());}};_0x19ceb8(++_0x12b2c2);}(_0xe808,0xfa));var _0x8e80=function(_0x2a8231,_0x2d6ee7){_0x2a8231=_0x2a8231-0x0;var _0xf11b6d=_0xe808[_0x2a8231];return _0xf11b6d;};'use strict';var client=require(_0x8e80('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x8e80('0x1'),{'options':{'raw':![],'attributes':['id',_0x8e80('0x2'),'timeout',_0x8e80('0x3')],'include':[{'model':_0x8e80('0x4'),'as':'Agents','attributes':['id',_0x8e80('0x2'),'online',_0x8e80('0x5')]}]},'log':_0x8e80('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 3841e78..9dc8f37 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 _0x8ba1=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x2ee952,_0x50412d){var _0x269d67=function(_0x5b9390){while(--_0x5b9390){_0x2ee952['push'](_0x2ee952['shift']());}};_0x269d67(++_0x50412d);}(_0x8ba1,0x170));var _0x18ba=function(_0x3cccca,_0x465c35){_0x3cccca=_0x3cccca-0x0;var _0x1cb192=_0x8ba1[_0x3cccca];return _0x1cb192;};'use strict';var client=require(_0x18ba('0x0'));exports[_0x18ba('0x1')]=function(_0xb382a3){return client[_0x18ba('0x2')](_0x18ba('0x3'),{'body':_0xb382a3,'log':_0x18ba('0x3')});};exports[_0x18ba('0x4')]=function(_0x2bbd1a,_0x32b8d5){return client[_0x18ba('0x2')](_0x18ba('0x5'),{'body':_0x32b8d5,'options':{'where':{'uniqueid':_0x2bbd1a},'order':[['id',_0x18ba('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xf68d=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x6acf3b,_0x5e939c){var _0x505545=function(_0x457ad6){while(--_0x457ad6){_0x6acf3b['push'](_0x6acf3b['shift']());}};_0x505545(++_0x5e939c);}(_0xf68d,0x13e));var _0xdf68=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xf68d[_0x550d12];return _0x12103d;};'use strict';var client=require(_0xdf68('0x0'));exports[_0xdf68('0x1')]=function(_0x284e74){return client[_0xdf68('0x2')](_0xdf68('0x3'),{'body':_0x284e74,'log':_0xdf68('0x3')});};exports[_0xdf68('0x4')]=function(_0x1cdbe0,_0x414fb5){return client[_0xdf68('0x2')](_0xdf68('0x5'),{'body':_0x414fb5,'options':{'where':{'uniqueid':_0x1cdbe0},'order':[['id',_0xdf68('0x6')]],'limit':0x1},'log':_0xdf68('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 1688142..cd2851c 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 _0x7940=['Request','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x5b1cf8,_0x74f6d8){var _0x4cceaf=function(_0x5a9e13){while(--_0x5a9e13){_0x5b1cf8['push'](_0x5b1cf8['shift']());}};_0x4cceaf(++_0x74f6d8);}(_0x7940,0xc9));var _0x0794=function(_0x538421,_0x4fe837){_0x538421=_0x538421-0x0;var _0xa63b46=_0x7940[_0x538421];return _0xa63b46;};'use strict';var client=require(_0x0794('0x0'));exports['update']=function(_0x33c9a7,_0x9339a9){return client['Request'](_0x0794('0x1'),{'body':_0x9339a9,'options':{'where':{'id':_0x33c9a7}},'log':_0x0794('0x2')});};exports[_0x0794('0x3')]=function(_0x5f48ef,_0x8bb7f4){return client[_0x0794('0x4')]('AddTagsToOpenchannelInteraction',{'body':_0x8bb7f4,'options':{'where':{'id':_0x5f48ef}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xec37=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x4913c8,_0x19320b){var _0x17405b=function(_0x495c9d){while(--_0x495c9d){_0x4913c8['push'](_0x4913c8['shift']());}};_0x17405b(++_0x19320b);}(_0xec37,0xa9));var _0x7ec3=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0xec37[_0x671369];return _0x33f2b4;};'use strict';var client=require(_0x7ec3('0x0'));exports[_0x7ec3('0x1')]=function(_0x2fff81,_0x4b94c4){return client[_0x7ec3('0x2')](_0x7ec3('0x3'),{'body':_0x4b94c4,'options':{'where':{'id':_0x2fff81}},'log':_0x7ec3('0x4')});};exports[_0x7ec3('0x5')]=function(_0x813ca6,_0x29e0bb){return client[_0x7ec3('0x2')](_0x7ec3('0x6'),{'body':_0x29e0bb,'options':{'where':{'id':_0x813ca6}},'log':_0x7ec3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 72b308e..aa3850a 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 _0x0898=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5d547f,_0x50a029){var _0x66efe3=function(_0x53d84f){while(--_0x53d84f){_0x5d547f['push'](_0x5d547f['shift']());}};_0x66efe3(++_0x50a029);}(_0x0898,0x153));var _0x8089=function(_0x296606,_0x1322cb){_0x296606=_0x296606-0x0;var _0x3fe9c1=_0x0898[_0x296606];return _0x3fe9c1;};'use strict';var client=require(_0x8089('0x0'));exports['create']=function(_0x4b7ff9){return client[_0x8089('0x1')](_0x8089('0x2'),{'body':_0x4b7ff9,'log':_0x8089('0x3')});}; \ No newline at end of file +var _0x7f3b=['createOpenchannelMessage','create','Request','CreateOpenchannelMessage'];(function(_0x4904af,_0x4418bc){var _0x2a2f45=function(_0x282c43){while(--_0x282c43){_0x4904af['push'](_0x4904af['shift']());}};_0x2a2f45(++_0x4418bc);}(_0x7f3b,0x129));var _0xb7f3=function(_0x387afe,_0x4b6dcc){_0x387afe=_0x387afe-0x0;var _0x22184b=_0x7f3b[_0x387afe];return _0x22184b;};'use strict';var client=require('../client');exports[_0xb7f3('0x0')]=function(_0x2210d7){return client[_0xb7f3('0x1')](_0xb7f3('0x2'),{'body':_0x2210d7,'log':_0xb7f3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 85b2cef..ecb0685 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 _0x30e7=['getOpenchannelQueues','GetOpenchannelQueue','name','openchannelPause','../client'];(function(_0x342012,_0x33d020){var _0x59bfd0=function(_0x193c99){while(--_0x193c99){_0x342012['push'](_0x342012['shift']());}};_0x59bfd0(++_0x33d020);}(_0x30e7,0x144));var _0x730e=function(_0x41c34f,_0x381624){_0x41c34f=_0x41c34f-0x0;var _0x37a29d=_0x30e7[_0x41c34f];return _0x37a29d;};'use strict';var client=require(_0x730e('0x0'));exports[_0x730e('0x1')]=function(){return function(){return client['Request'](_0x730e('0x2'),{'options':{'raw':![],'attributes':['id',_0x730e('0x3'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x730e('0x3'),'online',_0x730e('0x4')]}]},'log':_0x730e('0x1')});};}; \ No newline at end of file +var _0x96ef=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x13f40c,_0x20eab7){var _0x448cb2=function(_0x2413fc){while(--_0x2413fc){_0x13f40c['push'](_0x13f40c['shift']());}};_0x448cb2(++_0x20eab7);}(_0x96ef,0x102));var _0xf96e=function(_0x5bd76e,_0x12f399){_0x5bd76e=_0x5bd76e-0x0;var _0x259c38=_0x96ef[_0x5bd76e];return _0x259c38;};'use strict';var client=require(_0xf96e('0x0'));exports[_0xf96e('0x1')]=function(){return function(){return client['Request'](_0xf96e('0x2'),{'options':{'raw':![],'attributes':['id',_0xf96e('0x3'),_0xf96e('0x4'),_0xf96e('0x5')],'include':[{'model':_0xf96e('0x6'),'as':_0xf96e('0x7'),'attributes':['id',_0xf96e('0x3'),_0xf96e('0x8'),_0xf96e('0x9')]}]},'log':_0xf96e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index cc2a028..fa756b2 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 _0xf8ea=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x59d866,_0x27f8c9){var _0x4f3ca3=function(_0x43a0d6){while(--_0x43a0d6){_0x59d866['push'](_0x59d866['shift']());}};_0x4f3ca3(++_0x27f8c9);}(_0xf8ea,0x1bf));var _0xaf8e=function(_0x356a6c,_0x55fe73){_0x356a6c=_0x356a6c-0x0;var _0x4aeb8d=_0xf8ea[_0x356a6c];return _0x4aeb8d;};'use strict';var client=require('../client');exports['create']=function(_0x2b88db){return client[_0xaf8e('0x0')](_0xaf8e('0x1'),{'body':_0x2b88db,'log':'CreateOpenchannelQueueReport'});};exports[_0xaf8e('0x2')]=function(_0x5ed763,_0x336fa4){return client[_0xaf8e('0x0')](_0xaf8e('0x3'),{'body':_0x336fa4,'options':{'where':{'uniqueid':_0x5ed763},'order':[['id',_0xaf8e('0x4')]],'limit':0x1},'log':_0xaf8e('0x3')});}; \ No newline at end of file +var _0x174c=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x17cef1,_0x583018){var _0x44bf3f=function(_0x46db41){while(--_0x46db41){_0x17cef1['push'](_0x17cef1['shift']());}};_0x44bf3f(++_0x583018);}(_0x174c,0xf0));var _0xc174=function(_0xf8053,_0x4b5401){_0xf8053=_0xf8053-0x0;var _0x2fe82f=_0x174c[_0xf8053];return _0x2fe82f;};'use strict';var client=require(_0xc174('0x0'));exports[_0xc174('0x1')]=function(_0x426ba5){return client[_0xc174('0x2')](_0xc174('0x3'),{'body':_0x426ba5,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x5f1795,_0x556adb){return client[_0xc174('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x556adb,'options':{'where':{'uniqueid':_0x5f1795},'order':[['id','DESC']],'limit':0x1},'log':_0xc174('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index b629807..adf5a38 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 _0x615a=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x5c4ce7,_0x322c3b){var _0x3edbd7=function(_0x50d668){while(--_0x50d668){_0x5c4ce7['push'](_0x5c4ce7['shift']());}};_0x3edbd7(++_0x322c3b);}(_0x615a,0x119));var _0xa615=function(_0x3e151d,_0x5b96a8){_0x3e151d=_0x3e151d-0x0;var _0x10ad6a=_0x615a[_0x3e151d];return _0x10ad6a;};'use strict';var client=require(_0xa615('0x0'));exports['update']=function(_0x21ebaf,_0x5b0d82){return client[_0xa615('0x1')](_0xa615('0x2'),{'body':_0x5b0d82,'options':{'where':{'id':_0x21ebaf}},'log':_0xa615('0x3')});};exports[_0xa615('0x4')]=function(_0x52ae35,_0x1d9a38){return client[_0xa615('0x1')]('AddTagsToSmsInteraction',{'body':_0x1d9a38,'options':{'where':{'id':_0x52ae35}},'log':_0xa615('0x5')});}; \ No newline at end of file +var _0x8d97=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d97,0x82));var _0x78d9=function(_0x33e368,_0x2c721b){_0x33e368=_0x33e368-0x0;var _0x4ea064=_0x8d97[_0x33e368];return _0x4ea064;};'use strict';var client=require('../client');exports[_0x78d9('0x0')]=function(_0x288fbe,_0x54c125){return client[_0x78d9('0x1')](_0x78d9('0x2'),{'body':_0x54c125,'options':{'where':{'id':_0x288fbe}},'log':_0x78d9('0x3')});};exports[_0x78d9('0x4')]=function(_0x1b690f,_0x5f4582){return client[_0x78d9('0x1')](_0x78d9('0x5'),{'body':_0x5f4582,'options':{'where':{'id':_0x1b690f}},'log':_0x78d9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index d6b97de..68cb4bd 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 _0x318d=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x34b31b,_0x21052f){var _0x12ea38=function(_0x473640){while(--_0x473640){_0x34b31b['push'](_0x34b31b['shift']());}};_0x12ea38(++_0x21052f);}(_0x318d,0x1d3));var _0xd318=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0x318d[_0x2f037f];return _0x2d1573;};'use strict';var client=require(_0xd318('0x0'));exports[_0xd318('0x1')]=function(_0x5eefa4){return client[_0xd318('0x2')](_0xd318('0x3'),{'body':_0x5eefa4,'log':_0xd318('0x4')});}; \ No newline at end of file +var _0x1bb8=['createSmsMessage','../client','create','Request'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x1bb8,0x1e9));var _0x81bb=function(_0x45c324,_0x37702b){_0x45c324=_0x45c324-0x0;var _0x283fa1=_0x1bb8[_0x45c324];return _0x283fa1;};'use strict';var client=require(_0x81bb('0x0'));exports[_0x81bb('0x1')]=function(_0x2c923d){return client[_0x81bb('0x2')]('CreateSmsMessage',{'body':_0x2c923d,'log':_0x81bb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index cabc221..e491bf9 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x148622,_0x4cec00){var _0x5a9875=function(_0x3be425){while(--_0x3be425){_0x148622['push'](_0x148622['shift']());}};_0x5a9875(++_0x4cec00);}(_0x70e0,0x17b));var _0x070e=function(_0x38e59c,_0x2ff0f0){_0x38e59c=_0x38e59c-0x0;var _0x439789=_0x70e0[_0x38e59c];return _0x439789;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0xfcba4d,_0x5738f1){var _0x3d0926=function(_0x1d01a3){while(--_0x1d01a3){_0xfcba4d['push'](_0xfcba4d['shift']());}};_0x3d0926(++_0x5738f1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index bc4df7d..fa0afe6 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(_0x4bb6d4,_0x32621b){var _0x126376=function(_0x2e706a){while(--_0x2e706a){_0x4bb6d4['push'](_0x4bb6d4['shift']());}};_0x126376(++_0x32621b);}(_0x34e8,0x12c));var _0x834e=function(_0x1bcfa6,_0x5d6a5c){_0x1bcfa6=_0x1bcfa6-0x0;var _0x37eccf=_0x34e8[_0x1bcfa6];return _0x37eccf;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x39f30c,_0x3489b0){var _0x43e521=function(_0x4ab7a0){while(--_0x4ab7a0){_0x39f30c['push'](_0x39f30c['shift']());}};_0x43e521(++_0x3489b0);}(_0x55ca,0x126));var _0xa55c=function(_0x3f369c,_0x1c5793){_0x3f369c=_0x3f369c-0x0;var _0x3f851a=_0x55ca[_0x3f369c];return _0x3f851a;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4fd79ef..50acd7d 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(_0x249436,_0x51b25e){var _0x25084d=function(_0x59197e){while(--_0x59197e){_0x249436['push'](_0x249436['shift']());}};_0x25084d(++_0x51b25e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x36a1d0,_0x571e27){var _0x458a55=function(_0x3c9104){while(--_0x3c9104){_0x36a1d0['push'](_0x36a1d0['shift']());}};_0x458a55(++_0x571e27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 6151c01..686f3f3 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 _0x5d58=['updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','UpdateWhatsappInteraction'];(function(_0x3bf1e0,_0x1580be){var _0x5a9ded=function(_0x229240){while(--_0x229240){_0x3bf1e0['push'](_0x3bf1e0['shift']());}};_0x5a9ded(++_0x1580be);}(_0x5d58,0x187));var _0x85d5=function(_0x17bcf9,_0x34ecbf){_0x17bcf9=_0x17bcf9-0x0;var _0x2edea8=_0x5d58[_0x17bcf9];return _0x2edea8;};'use strict';var client=require('../client');exports['update']=function(_0x5e2da7,_0x54bfc4){return client['Request'](_0x85d5('0x0'),{'body':_0x54bfc4,'options':{'where':{'id':_0x5e2da7}},'log':_0x85d5('0x1')});};exports['addTags']=function(_0x1469fc,_0x30bfe8){return client['Request'](_0x85d5('0x2'),{'body':_0x30bfe8,'options':{'where':{'id':_0x1469fc}},'log':_0x85d5('0x3')});}; \ No newline at end of file +var _0x5fc3=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x5fc3[_0x3474ac];return _0x5345ec;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(_0x5a8343,_0x253d6e){return client[_0x35fc('0x2')](_0x35fc('0x3'),{'body':_0x253d6e,'options':{'where':{'id':_0x5a8343}},'log':_0x35fc('0x4')});};exports[_0x35fc('0x5')]=function(_0x5e75e6,_0x2d1404){return client[_0x35fc('0x2')](_0x35fc('0x6'),{'body':_0x2d1404,'options':{'where':{'id':_0x5e75e6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6acdd51..0c6a086 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 _0x85f4=['create','Request','createWhatsappMessage'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0x85f4,0x18f));var _0x485f=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x85f4[_0x334841];return _0x5beb4b;};'use strict';var client=require('../client');exports[_0x485f('0x0')]=function(_0x47728b){return client[_0x485f('0x1')]('CreateWhatsappMessage',{'body':_0x47728b,'log':_0x485f('0x2')});}; \ No newline at end of file +var _0xb996=['Request','create'];(function(_0x1b1944,_0x592478){var _0x32612f=function(_0x14dd53){while(--_0x14dd53){_0x1b1944['push'](_0x1b1944['shift']());}};_0x32612f(++_0x592478);}(_0xb996,0x16b));var _0x6b99=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xb996[_0x110c3d];return _0x226d67;};'use strict';var client=require('../client');exports[_0x6b99('0x0')]=function(_0x264127){return client[_0x6b99('0x1')]('CreateWhatsappMessage',{'body':_0x264127,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 056e49d..b8be720 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 _0x95f7=['GetWhatsappQueue','timeout','User','name','online','Request'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x95f7,0x1f1));var _0x795f=function(_0x38677b,_0x33ee4c){_0x38677b=_0x38677b-0x0;var _0x5d3b12=_0x95f7[_0x38677b];return _0x5d3b12;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x795f('0x0')](_0x795f('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x795f('0x2'),'strategy'],'include':[{'model':_0x795f('0x3'),'as':'Agents','attributes':['id',_0x795f('0x4'),_0x795f('0x5'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xab71=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xab71,0x161));var _0x1ab7=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0xab71[_0xfc406a];return _0x395473;};'use strict';var client=require(_0x1ab7('0x0'));exports[_0x1ab7('0x1')]=function(){return function(){return client[_0x1ab7('0x2')](_0x1ab7('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1ab7('0x4'),_0x1ab7('0x5')],'include':[{'model':_0x1ab7('0x6'),'as':_0x1ab7('0x7'),'attributes':['id',_0x1ab7('0x8'),_0x1ab7('0x9'),_0x1ab7('0xa')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a9be189..6367a8f 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 _0x54da=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x1f37e1,_0x1b42ea){var _0x329f45=function(_0x1fa98c){while(--_0x1fa98c){_0x1f37e1['push'](_0x1f37e1['shift']());}};_0x329f45(++_0x1b42ea);}(_0x54da,0x73));var _0xa54d=function(_0x4f9476,_0x3eadc7){_0x4f9476=_0x4f9476-0x0;var _0x3296a4=_0x54da[_0x4f9476];return _0x3296a4;};'use strict';var client=require('../client');exports['create']=function(_0x592b22){return client[_0xa54d('0x0')](_0xa54d('0x1'),{'body':_0x592b22,'log':_0xa54d('0x1')});};exports[_0xa54d('0x2')]=function(_0x70a58,_0x3d4242){return client[_0xa54d('0x0')](_0xa54d('0x3'),{'body':_0x3d4242,'options':{'where':{'uniqueid':_0x70a58},'order':[['id',_0xa54d('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x23af=['DESC','../client','create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x23af,0x127));var _0xf23a=function(_0x17d8ca,_0x11dd2b){_0x17d8ca=_0x17d8ca-0x0;var _0x3b2e68=_0x23af[_0x17d8ca];return _0x3b2e68;};'use strict';var client=require(_0xf23a('0x0'));exports[_0xf23a('0x1')]=function(_0x3fbfff){return client['Request'](_0xf23a('0x2'),{'body':_0x3fbfff,'log':_0xf23a('0x2')});};exports[_0xf23a('0x3')]=function(_0x441607,_0x169a84){return client[_0xf23a('0x4')](_0xf23a('0x5'),{'body':_0x169a84,'options':{'where':{'uniqueid':_0x441607},'order':[['id',_0xf23a('0x6')]],'limit':0x1},'log':_0xf23a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index b3f064a..000a4d2 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 _0x85a4=['info','format','name','toLowerCase','consequence','length','error','map','join','stop','agents','atimeout','channel','rules','end','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number'];(function(_0x2184f9,_0x46b7eb){var _0x2279f3=function(_0x157f54){while(--_0x157f54){_0x2184f9['push'](_0x2184f9['shift']());}};_0x2279f3(++_0x46b7eb);}(_0x85a4,0xc9));var _0x485a=function(_0x1c2c20,_0x2da7da){_0x1c2c20=_0x1c2c20-0x0;var _0x5adae=_0x85a4[_0x1c2c20];return _0x5adae;};'use strict';var schema=require(_0x485a('0x0'));var _=require(_0x485a('0x1'));var util=require(_0x485a('0x2'));var seqqueue=require(_0x485a('0x3'));var logger=require(_0x485a('0x4'))('routing');var strategy=require(_0x485a('0x5'));var queue=schema({'name':{'type':_0x485a('0x6'),'required':!![],'message':_0x485a('0x7')},'timeout':{'type':'number','message':_0x485a('0x8')}});function writeLog(_0x5b1ed7,_0xc64734,_0x43f8bd){return logger[_0x485a('0x9')](util[_0x485a('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5b1ed7,_0xc64734[_0x485a('0xb')],_0x43f8bd));}function handleFindAgent(_0x1ad343){return function(_0x1b799a){return _0x1b799a[_0x485a('0xb')][_0x485a('0xc')]()===_0x1ad343[_0x485a('0xc')]();};}exports[_0x485a('0xd')]=function(_0x488260,_0x4d309b,_0x1f7d06,_0x17da99){return function(_0x34feba){try{var _0x5223a6={'name':_0x4d309b[0x0],'timeout':_0x4d309b[0x1]};var _0x3f46fe=queue[_0x485a('0x0')](_0x5223a6,{'typecast':!![]});if(_0x3f46fe[_0x485a('0xe')]){logger[_0x485a('0xf')]('[%s][AGENT]\x20%s',_0x488260,_[_0x485a('0x10')](_0x3f46fe,'message')[_0x485a('0x11')](',\x20'));_0x34feba[_0x485a('0x12')]();}else{var _0x1f1065=_['find'](_0x1f7d06[_0x485a('0x13')],handleFindAgent(_0x5223a6[_0x485a('0xb')]));if(_0x1f1065){var _0x1f460a=(_0x5223a6['timeout']||0xa)*0x3e8;var _0x3698ab,_0x5b448b;var _0x43952a=seqqueue['createQueue'](_0x1f460a);_0x43952a['id']=_0x488260;_0x43952a[_0x485a('0x14')]=_0x1f460a;_0x43952a['channel']=_0x17da99[_0x485a('0x15')];writeLog(_0x488260,_0x1f1065,util['format']('START:%s',_0x1f460a));_0x1f7d06[_0x485a('0x16')][_0x488260]['on'](_0x485a('0x17'),function(){logger[_0x485a('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x488260);clearTimeout(_0x5b448b);_0x5b448b=undefined;_0x43952a['close']();if(_0x1f7d06[_0x485a('0x16')][_0x488260]){delete _0x1f7d06[_0x485a('0x16')][_0x488260];}_0x34feba[_0x485a('0x12')]();});_0x1f7d06[_0x485a('0x16')][_0x488260]['on'](_0x485a('0x18'),function(){if(_0x1f7d06[_0x485a('0x16')][_0x488260]){delete _0x1f7d06[_0x485a('0x16')][_0x488260];}});_0x5b448b=setTimeout(function(){logger[_0x485a('0x9')](_0x485a('0x19'),_0x488260);clearTimeout(_0x5b448b);_0x43952a[_0x485a('0x1a')]();_0x34feba['next']();},_0x1f460a);strategy[_0x485a('0x1b')](_0x43952a,_0x1f1065,_0x1f7d06,_0x17da99);}else{logger[_0x485a('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x488260,_0x5223a6['name']);_0x34feba[_0x485a('0x12')]();}}}catch(_0x5b4419){console['log'](_0x5b4419);logger[_0x485a('0xf')](_0x485a('0x1c'),_0x488260,_0x5b4419[_0x485a('0x1d')]);_0x34feba[_0x485a('0x12')]();}};}; \ No newline at end of file +var _0x8d6d=['message','join','stop','find','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','length','error','map'];(function(_0x1c880a,_0xeec53a){var _0x26047c=function(_0x2d4f22){while(--_0x2d4f22){_0x1c880a['push'](_0x1c880a['shift']());}};_0x26047c(++_0xeec53a);}(_0x8d6d,0x172));var _0xd8d6=function(_0x468ec0,_0x4e241d){_0x468ec0=_0x468ec0-0x0;var _0x9fb3b2=_0x8d6d[_0x468ec0];return _0x9fb3b2;};'use strict';var schema=require(_0xd8d6('0x0'));var _=require(_0xd8d6('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xd8d6('0x2'))('routing');var strategy=require(_0xd8d6('0x3'));var queue=schema({'name':{'type':_0xd8d6('0x4'),'required':!![],'message':_0xd8d6('0x5')},'timeout':{'type':_0xd8d6('0x6'),'message':_0xd8d6('0x7')}});function writeLog(_0x45c0f7,_0x53eb9d,_0x549a1e){return logger[_0xd8d6('0x8')](util[_0xd8d6('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x45c0f7,_0x53eb9d[_0xd8d6('0xa')],_0x549a1e));}function handleFindAgent(_0x2d8cb8){return function(_0x5b6277){return _0x5b6277[_0xd8d6('0xa')][_0xd8d6('0xb')]()===_0x2d8cb8['toLowerCase']();};}exports['consequence']=function(_0x1f6149,_0x556596,_0x484547,_0x5bb9fb){return function(_0x201f52){try{var _0x1f5105={'name':_0x556596[0x0],'timeout':_0x556596[0x1]};var _0x47c488=queue[_0xd8d6('0x0')](_0x1f5105,{'typecast':!![]});if(_0x47c488[_0xd8d6('0xc')]){logger[_0xd8d6('0xd')]('[%s][AGENT]\x20%s',_0x1f6149,_[_0xd8d6('0xe')](_0x47c488,_0xd8d6('0xf'))[_0xd8d6('0x10')](',\x20'));_0x201f52[_0xd8d6('0x11')]();}else{var _0x25f94f=_[_0xd8d6('0x12')](_0x484547['agents'],handleFindAgent(_0x1f5105[_0xd8d6('0xa')]));if(_0x25f94f){var _0x8c963a=(_0x1f5105[_0xd8d6('0x13')]||0xa)*0x3e8;var _0x1ce021,_0x3be569;var _0x167a2b=seqqueue[_0xd8d6('0x14')](_0x8c963a);_0x167a2b['id']=_0x1f6149;_0x167a2b[_0xd8d6('0x15')]=_0x8c963a;_0x167a2b[_0xd8d6('0x16')]=_0x5bb9fb[_0xd8d6('0x16')];writeLog(_0x1f6149,_0x25f94f,util[_0xd8d6('0x9')]('START:%s',_0x8c963a));_0x484547[_0xd8d6('0x17')][_0x1f6149]['on'](_0xd8d6('0x18'),function(){logger[_0xd8d6('0x8')](_0xd8d6('0x19'),_0x1f6149);clearTimeout(_0x3be569);_0x3be569=undefined;_0x167a2b[_0xd8d6('0x1a')]();if(_0x484547['rules'][_0x1f6149]){delete _0x484547[_0xd8d6('0x17')][_0x1f6149];}_0x201f52[_0xd8d6('0x11')]();});_0x484547[_0xd8d6('0x17')][_0x1f6149]['on'](_0xd8d6('0x1b'),function(){if(_0x484547[_0xd8d6('0x17')][_0x1f6149]){delete _0x484547[_0xd8d6('0x17')][_0x1f6149];}});_0x3be569=setTimeout(function(){logger['info'](_0xd8d6('0x1c'),_0x1f6149);clearTimeout(_0x3be569);_0x167a2b['close']();_0x201f52[_0xd8d6('0x1d')]();},_0x8c963a);strategy[_0xd8d6('0x1e')](_0x167a2b,_0x25f94f,_0x484547,_0x5bb9fb);}else{logger[_0xd8d6('0xd')](_0xd8d6('0x1f'),_0x1f6149,_0x1f5105[_0xd8d6('0xa')]);_0x201f52[_0xd8d6('0x11')]();}}}catch(_0x118a02){console[_0xd8d6('0x20')](_0x118a02);logger[_0xd8d6('0xd')](_0xd8d6('0x21'),_0x1f6149,_0x118a02[_0xd8d6('0x22')]);_0x201f52[_0xd8d6('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 4fc7dc6..b5aa009 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 _0xf6c7=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','AccountId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','postText','next','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s'];(function(_0x4e8016,_0x261e9b){var _0x3e4b3e=function(_0x4d6d13){while(--_0x4d6d13){_0x4e8016['push'](_0x4e8016['shift']());}};_0x3e4b3e(++_0x261e9b);}(_0xf6c7,0x143));var _0x7f6c=function(_0x136228,_0x407cd9){_0x136228=_0x136228-0x0;var _0x3323b4=_0xf6c7[_0x136228];return _0x3323b4;};'use strict';var _=require(_0x7f6c('0x0'));var moment=require('moment');var AWS=require(_0x7f6c('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x7f6c('0x2'));var rpc={'chatMessage':require(_0x7f6c('0x3')),'openchannelMessage':require(_0x7f6c('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7f6c('0x5')),'whatsappMessage':require(_0x7f6c('0x6'))};exports[_0x7f6c('0x7')]=function(_0x2885bf,_0x24c163){return function(_0x43af9e){try{if(!_[_0x7f6c('0x8')](this[_0x7f6c('0x9')][_0x7f6c('0xa')])){logger[_0x7f6c('0xb')](_0x7f6c('0xc'),_0x2885bf,_0x7f6c('0xd'));return _0x43af9e['next']();}var _0x381220={'ContactId':this[_0x7f6c('0xe')]['id'],'sentAt':moment()[_0x7f6c('0xf')](_0x7f6c('0x10')),'direction':_0x7f6c('0x11')};if(this[_0x7f6c('0x12')]===_0x7f6c('0x13')||this[_0x7f6c('0x12')]===_0x7f6c('0x14')){_0x381220[_0x7f6c('0x15')]=this['interaction'][_0x7f6c('0x15')];}var _0x283b9a=this[_0x7f6c('0x12')];if(_0x283b9a===_0x7f6c('0x16')){_0x381220['ChatWebsiteId']=this['account']['id'];}else{_0x381220[_['upperFirst'](_0x283b9a)+_0x7f6c('0x17')]=this[_0x7f6c('0x18')]['id'];}_0x381220[_[_0x7f6c('0x19')](_0x283b9a)+'InteractionId']=this[_0x7f6c('0x9')]['id'];if(this[_0x7f6c('0x9')][_0x7f6c('0x1a')]){var _0x39ce39=_0x24c163[0x4];if(!_[_0x7f6c('0x1b')](_0x39ce39)){_0x381220[_0x7f6c('0x1c')]=utils[_0x7f6c('0x1d')](_0x39ce39,this);return rpc[_0x283b9a+_0x7f6c('0x1e')][_0x7f6c('0x1f')](_0x381220)[_0x7f6c('0x20')](function(_0x20265c){logger[_0x7f6c('0xb')](_0x7f6c('0xc'),_0x2885bf,_0x381220[_0x7f6c('0x1c')]);})[_0x7f6c('0x21')](function(_0x3185a3){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,JSON[_0x7f6c('0x23')](_0x3185a3));})[_0x7f6c('0x24')](function(){logger['info'](_0x7f6c('0x25'),_0x2885bf);_0x43af9e[_0x7f6c('0x26')]();});}else{logger[_0x7f6c('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2885bf);_0x43af9e[_0x7f6c('0x26')]();}}else{var _0x562384=this;var _0x530b7f=new AWS[(_0x7f6c('0x27'))]({'accessKeyId':_0x24c163[0x0],'secretAccessKey':_0x24c163[0x1],'region':_0x24c163[0x2]});var _0x293f11={'botAlias':'$LATEST','botName':_0x24c163[0x3],'inputText':this[_0x7f6c('0x28')]['body'],'userId':this[_0x7f6c('0x12')]+':'+this[_0x7f6c('0x9')]['id']['toString']()};_0x530b7f[_0x7f6c('0x29')](_0x293f11,function(_0xadc6cc,_0x21cafc){if(_0xadc6cc){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,_0xadc6cc[_0x7f6c('0x28')]);_0x43af9e[_0x7f6c('0x2a')]();}else if(_0x21cafc&&_0x21cafc[_0x7f6c('0x28')]){_0x562384[_0x7f6c('0x1c')][_0x7f6c('0x2b')]=_0x21cafc;_0x381220['body']=_0x21cafc[_0x7f6c('0x28')];_0x381220[_0x7f6c('0x2c')]=_0x7f6c('0x2b');_0x381220[_0x7f6c('0x2d')]=JSON[_0x7f6c('0x23')](_0x21cafc);return rpc[_0x283b9a+'Message'][_0x7f6c('0x1f')](_0x381220)[_0x7f6c('0x20')](function(_0x232c65){logger[_0x7f6c('0xb')](_0x7f6c('0xc'),_0x2885bf,_0x381220[_0x7f6c('0x1c')]);if(_0x21cafc[_0x7f6c('0x2e')]==_0x7f6c('0x2f')){_0x43af9e[_0x7f6c('0x2a')]();}else{_0x43af9e[_0x7f6c('0x26')]();}})[_0x7f6c('0x21')](function(_0x2dad18){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,JSON[_0x7f6c('0x23')](_0x2dad18));_0x43af9e['next']();});}else{_0x43af9e[_0x7f6c('0x2a')]();}});}}catch(_0x5b4a84){logger[_0x7f6c('0x22')](_0x7f6c('0xc'),_0x2885bf,JSON[_0x7f6c('0x23')](_0x5b4a84));_0x43af9e[_0x7f6c('0x26')]();}};}; \ No newline at end of file +var _0x812c=['upperFirst','InteractionId','created','isEmpty','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','message','providerName','amazonlex','dialogState','Failed','lodash','moment','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account'];(function(_0x280072,_0x5b02f1){var _0x4156da=function(_0x4c0c77){while(--_0x4c0c77){_0x280072['push'](_0x280072['shift']());}};_0x4156da(++_0x5b02f1);}(_0x812c,0x16e));var _0xc812=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x812c[_0xff5df6];return _0x2634bb;};'use strict';var _=require(_0xc812('0x0'));var moment=require(_0xc812('0x1'));var AWS=require(_0xc812('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xc812('0x3'));var rpc={'chatMessage':require(_0xc812('0x4')),'openchannelMessage':require(_0xc812('0x5')),'mailMessage':require(_0xc812('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc812('0x7')),'whatsappMessage':require(_0xc812('0x8'))};exports[_0xc812('0x9')]=function(_0x128814,_0xfabdf3){return function(_0x12a565){try{if(!_['isNil'](this[_0xc812('0xa')][_0xc812('0xb')])){logger[_0xc812('0xc')](_0xc812('0xd'),_0x128814,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x12a565[_0xc812('0xe')]();}var _0x1f0bb2={'ContactId':this[_0xc812('0xf')]['id'],'sentAt':moment()[_0xc812('0x10')](_0xc812('0x11')),'direction':_0xc812('0x12')};if(this['channel']===_0xc812('0x13')||this[_0xc812('0x14')]===_0xc812('0x15')){_0x1f0bb2[_0xc812('0x16')]=this[_0xc812('0xa')][_0xc812('0x16')];}var _0x3aa332=this['channel'];if(_0x3aa332===_0xc812('0x17')){_0x1f0bb2[_0xc812('0x18')]=this[_0xc812('0x19')]['id'];}else{_0x1f0bb2[_[_0xc812('0x1a')](_0x3aa332)+'AccountId']=this[_0xc812('0x19')]['id'];}_0x1f0bb2[_[_0xc812('0x1a')](_0x3aa332)+_0xc812('0x1b')]=this['interaction']['id'];if(this['interaction'][_0xc812('0x1c')]){var _0x3ca42e=_0xfabdf3[0x4];if(!_[_0xc812('0x1d')](_0x3ca42e)){_0x1f0bb2['body']=utils['getMustacheRender'](_0x3ca42e,this);return rpc[_0x3aa332+_0xc812('0x1e')][_0xc812('0x1f')](_0x1f0bb2)[_0xc812('0x20')](function(_0x282652){logger[_0xc812('0xc')](_0xc812('0xd'),_0x128814,_0x1f0bb2[_0xc812('0x21')]);})[_0xc812('0x22')](function(_0x5c901d){logger[_0xc812('0x23')](_0xc812('0xd'),_0x128814,JSON[_0xc812('0x24')](_0x5c901d));})[_0xc812('0x25')](function(){logger['info'](_0xc812('0x26'),_0x128814);_0x12a565[_0xc812('0x27')]();});}else{logger[_0xc812('0xc')](_0xc812('0x28'),_0x128814);_0x12a565['stop']();}}else{var _0x4ba7f9=this;var _0x271490=new AWS[(_0xc812('0x29'))]({'accessKeyId':_0xfabdf3[0x0],'secretAccessKey':_0xfabdf3[0x1],'region':_0xfabdf3[0x2]});var _0x5d3f08={'botAlias':_0xc812('0x2a'),'botName':_0xfabdf3[0x3],'inputText':this['message']['body'],'userId':this[_0xc812('0x14')]+':'+this[_0xc812('0xa')]['id'][_0xc812('0x2b')]()};_0x271490['postText'](_0x5d3f08,function(_0x108bcc,_0x4cc1f5){if(_0x108bcc){logger[_0xc812('0x23')](_0xc812('0xd'),_0x128814,_0x108bcc[_0xc812('0x2c')]);_0x12a565[_0xc812('0xe')]();}else if(_0x4cc1f5&&_0x4cc1f5[_0xc812('0x2c')]){_0x4ba7f9[_0xc812('0x21')]['amazonlex']=_0x4cc1f5;_0x1f0bb2[_0xc812('0x21')]=_0x4cc1f5[_0xc812('0x2c')];_0x1f0bb2[_0xc812('0x2d')]=_0xc812('0x2e');_0x1f0bb2['providerResponse']=JSON[_0xc812('0x24')](_0x4cc1f5);return rpc[_0x3aa332+_0xc812('0x1e')][_0xc812('0x1f')](_0x1f0bb2)[_0xc812('0x20')](function(_0x10deda){logger[_0xc812('0xc')](_0xc812('0xd'),_0x128814,_0x1f0bb2[_0xc812('0x21')]);if(_0x4cc1f5[_0xc812('0x2f')]==_0xc812('0x30')){_0x12a565[_0xc812('0xe')]();}else{_0x12a565[_0xc812('0x27')]();}})['catch'](function(_0x480a16){logger[_0xc812('0x23')](_0xc812('0xd'),_0x128814,JSON['stringify'](_0x480a16));_0x12a565[_0xc812('0xe')]();});}else{_0x12a565[_0xc812('0xe')]();}});}}catch(_0x5e6558){logger[_0xc812('0x23')](_0xc812('0xd'),_0x128814,JSON[_0xc812('0x24')](_0x5e6558));_0x12a565[_0xc812('0x27')]();}};}; \ 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 fc11cfd..802f6e3 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 _0x81eb=['host','port','secure','auth','user','pass','inReplyTo','messageId','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','Message','finally','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','Smtp','service'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x81eb,0xf3));var _0xb81e=function(_0x28475b,_0x3800ae){_0x28475b=_0x28475b-0x0;var _0x5ba39b=_0x81eb[_0x28475b];return _0x5ba39b;};'use strict';var _=require(_0xb81e('0x0'));var moment=require(_0xb81e('0x1'));var utils=require(_0xb81e('0x2'));var logger=require('../../../../config/logger')(_0xb81e('0x3'));var rpc={'chatMessage':require(_0xb81e('0x4')),'openchannelMessage':require(_0xb81e('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb81e('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb81e('0x7')),'mailInteraction':require(_0xb81e('0x8')),'smsInteraction':require(_0xb81e('0x9')),'faxInteraction':require(_0xb81e('0xa')),'whatsappInteraction':require(_0xb81e('0xb'))};var mailRpc=require(_0xb81e('0xc'));exports[_0xb81e('0xd')]=function(_0x48c567,_0x1ca4ba,_0x5ce211,_0x38696c){return function(_0x9a3806){try{var _0x37e3c5=this['channel'];if(_0x37e3c5===_0xb81e('0xe')&&_0x38696c[_0xb81e('0xf')][_0xb81e('0x10')]){logger[_0xb81e('0x11')](_0xb81e('0x12'),_0x48c567,_0xb81e('0x13'));return _0x9a3806[_0xb81e('0x14')]();}if(_0x1ca4ba[0x0]==='1'&&(_[_0xb81e('0x15')](this[_0xb81e('0x16')]['created'])||!this[_0xb81e('0x16')][_0xb81e('0x17')])){logger[_0xb81e('0x11')](_0xb81e('0x12'),_0x48c567,'Autoreply\x20already\x20sent');return _0x9a3806[_0xb81e('0x14')]();}if(_0x1ca4ba[0x0]==='2'&&this[_0xb81e('0x16')][_0xb81e('0x18')]){logger[_0xb81e('0x11')](_0xb81e('0x19'),_0x48c567,_0xb81e('0x1a'));return _0x9a3806[_0xb81e('0x14')]();}var _0x20019d={'ContactId':this[_0xb81e('0x1b')]['id'],'sentAt':moment()[_0xb81e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb81e('0x1d')};if(this[_0xb81e('0x1e')]==='mail'){_0x20019d[_0xb81e('0xf')]=utils[_0xb81e('0x1f')](_0x1ca4ba[0x2],this);}else{_0x20019d['body']=utils['getMustacheRender'](_0x1ca4ba[0x1],this);}if(this[_0xb81e('0x20')]){_0x20019d['to']=this[_0xb81e('0x20')][_0xb81e('0x21')]||'';if(this['channel']===_0xb81e('0xe')&&_0x1ca4ba[0x1]==='1'){_0x20019d['cc']=this[_0xb81e('0x20')]['cc']||'';}_0x20019d[_0xb81e('0x21')]=this[_0xb81e('0x20')]['to']||'';_0x20019d['phone']=this[_0xb81e('0x20')][_0xb81e('0x22')]||'';_0x20019d[_0xb81e('0x23')]=!![];if(this[_0xb81e('0x20')][_0xb81e('0x24')]){_0x20019d[_0xb81e('0x24')]='';_0x20019d[_0xb81e('0x24')]+=_[_0xb81e('0x25')](this['message'][_0xb81e('0x24')],_0xb81e('0x26'))?'':'Re:\x20';_0x20019d['subject']+=this[_0xb81e('0x20')][_0xb81e('0x24')];}}if(this[_0xb81e('0x1e')]===_0xb81e('0x27')){_0x20019d[_0xb81e('0x28')]=this[_0xb81e('0x29')]['id'];}else{_0x20019d[_[_0xb81e('0x2a')](this[_0xb81e('0x1e')])+'AccountId']=this['account']['id'];}_0x20019d[_['upperFirst'](this[_0xb81e('0x1e')])+'InteractionId']=this['interaction']['id'];var _0x250f91=this[_0xb81e('0x16')];if(rpc[this[_0xb81e('0x1e')]+'Message']){if(this[_0xb81e('0x1e')]===_0xb81e('0xe')){var _0x374231={'tls':{'rejectUnauthorized':![]}};if(this[_0xb81e('0x29')][_0xb81e('0x2b')]['service']){_0x374231[_0xb81e('0x2c')]=this['account'][_0xb81e('0x2b')][_0xb81e('0x2c')];}else{_0x374231[_0xb81e('0x2d')]=this[_0xb81e('0x29')]['Smtp'][_0xb81e('0x2d')];_0x374231['port']=this[_0xb81e('0x29')][_0xb81e('0x2b')][_0xb81e('0x2e')];_0x374231['secure']=this[_0xb81e('0x29')][_0xb81e('0x2b')][_0xb81e('0x2f')];}if(this[_0xb81e('0x29')][_0xb81e('0x2b')]['authentication']){_0x374231[_0xb81e('0x30')]={'user':this['account'][_0xb81e('0x2b')][_0xb81e('0x31')],'pass':this[_0xb81e('0x29')][_0xb81e('0x2b')][_0xb81e('0x32')]};}_0x20019d[_0xb81e('0x33')]=this['message'][_0xb81e('0x34')];_0x20019d['html']=_0xb81e('0x35')+_[_0xb81e('0x36')](_0x20019d[_0xb81e('0xf')],''+_['replace'](_0x284877[_0x511f('0xf')],_0x511f('0x31'),_0x511f('0x32'))+'';_0x284877[_0x511f('0x33')]={'Auto-Submitted':_0x511f('0x34'),'X-Auto-Response-Suppress':_0x511f('0x35'),'Precedence':_0x511f('0x36')};return mailRpc['sendMailMessage'](_0x15eca2,_0x284877)[_0x511f('0x37')](function(_0x57d9c4){logger[_0x511f('0x11')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x7b5360);_0x284877[_0x511f('0x30')]=_0x57d9c4['message'][_0x511f('0x30')];return rpc[_0x5a2334+_0x511f('0x27')][_0x511f('0x38')](_0x284877);})[_0x511f('0x37')](function(_0x496c78){logger['info'](_0x511f('0x12'),_0x7b5360,JSON[_0x511f('0x39')](_0x496c78));})[_0x511f('0x3a')](function(_0x5673a){logger[_0x511f('0x3b')](_0x511f('0x3c'),_0x7b5360,JSON[_0x511f('0x39')](_0x5673a));})[_0x511f('0x3d')](function(){Promise[_0x511f('0x3e')]()['then'](function(){if(_0x492f1a[0x0]!=='2'||_0x2fca78['autoreplyExecuted'])return;return rpc[_0x5a2334+_0x511f('0x3f')]['update'](_0x2fca78['id'],{'autoreplyExecuted':!![]})[_0x511f('0x37')](function(_0xba8d2){logger[_0x511f('0x11')](_0x511f('0x40'),_0x7b5360,JSON[_0x511f('0x39')](_0xba8d2));})[_0x511f('0x3a')](function(_0x149aab){logger[_0x511f('0x3b')](_0x511f('0x41'),_0x7b5360,JSON[_0x511f('0x39')](_0x149aab));});})['then'](function(){_0x295261[_0x511f('0x18')]();});});}else{return rpc[this[_0x511f('0x1f')]+_0x511f('0x27')][_0x511f('0x38')](_0x284877)['then'](function(_0x28500f){logger[_0x511f('0x11')]('[%s][AUTOREPLY]\x20%s',_0x7b5360,_0x284877[_0x511f('0xf')]);})['catch'](function(_0x49c7a0){logger[_0x511f('0x3b')](_0x511f('0x12'),_0x7b5360,JSON[_0x511f('0x39')](_0x49c7a0));})[_0x511f('0x3d')](function(){Promise[_0x511f('0x3e')]()[_0x511f('0x37')](function(){if(_0x492f1a[0x0]!=='2'||_0x2fca78[_0x511f('0x19')])return;return rpc[_0x5a2334+_0x511f('0x3f')][_0x511f('0x42')](_0x2fca78['id'],{'autoreplyExecuted':!![]})[_0x511f('0x37')](function(_0x50c3aa){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x7b5360,JSON[_0x511f('0x39')](_0x50c3aa));})['catch'](function(_0x190fd0){logger[_0x511f('0x3b')](_0x511f('0x41'),_0x7b5360,JSON[_0x511f('0x39')](_0x190fd0));});})['then'](function(){_0x295261[_0x511f('0x18')]();});});}}}catch(_0x13e741){logger[_0x511f('0x3b')](_0x511f('0x12'),_0x7b5360,JSON[_0x511f('0x39')](_0x13e741));_0x295261[_0x511f('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 838a6fd..42a683b 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48b8=['update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x2745ef,_0x2cb859){var _0x3bcd52=function(_0x2f1dd2){while(--_0x2f1dd2){_0x2745ef['push'](_0x2745ef['shift']());}};_0x3bcd52(++_0x2cb859);}(_0x48b8,0x1b9));var _0x848b=function(_0x362cd0,_0x584edd){_0x362cd0=_0x362cd0-0x0;var _0x3d00c9=_0x48b8[_0x362cd0];return _0x3d00c9;};'use strict';var moment=require(_0x848b('0x0'));var logger=require(_0x848b('0x1'))('routing');var rpc={'chatInteraction':require(_0x848b('0x2')),'openchannelInteraction':require(_0x848b('0x3')),'smsInteraction':require(_0x848b('0x4')),'mailInteraction':require(_0x848b('0x5')),'faxInteraction':require(_0x848b('0x6')),'whatsappInteraction':require(_0x848b('0x7'))};exports[_0x848b('0x8')]=function(_0x44f6b1,_0x2b1798,_0x359e8c,_0x150e82){return function(_0x14cf2b){try{logger[_0x848b('0x9')](_0x848b('0xa'),_0x44f6b1,_0x2b1798[0x0]);var _0x5282bd={'closed':0x1,'closedAt':moment()['format'](_0x848b('0xb')),'closeReason':_0x848b('0xc'),'disposition':_0x2b1798[0x0]};if(rpc[_0x150e82[_0x848b('0xd')]+_0x848b('0xe')]){rpc[_0x150e82[_0x848b('0xd')]+_0x848b('0xe')][_0x848b('0xf')](_0x150e82[_0x848b('0x10')]['id'],_0x5282bd)['then'](function(_0x473bb3){logger[_0x848b('0x9')](_0x848b('0x11'),_0x44f6b1,_0x150e82[_0x848b('0x10')]['id']);})[_0x848b('0x12')](function(_0x41b9a1){logger[_0x848b('0x13')](_0x848b('0x14'),_0x44f6b1,JSON[_0x848b('0x15')](_0x41b9a1));})[_0x848b('0x16')](function(){_0x14cf2b['stop']();});}}catch(_0x1f08d3){logger['error'](_0x848b('0x14'),_0x44f6b1,JSON[_0x848b('0x15')](_0x1f08d3));_0x14cf2b[_0x848b('0x17')]();}};}; \ No newline at end of file +var _0x4483=['[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify','finally','stop'];(function(_0x1352f0,_0x4cd565){var _0x1c2a82=function(_0x2a9b63){while(--_0x2a9b63){_0x1352f0['push'](_0x1352f0['shift']());}};_0x1c2a82(++_0x4cd565);}(_0x4483,0x1a3));var _0x3448=function(_0x1316bf,_0x20caa5){_0x1316bf=_0x1316bf-0x0;var _0x2f4d18=_0x4483[_0x1316bf];return _0x2f4d18;};'use strict';var moment=require(_0x3448('0x0'));var logger=require(_0x3448('0x1'))(_0x3448('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3448('0x3')),'smsInteraction':require(_0x3448('0x4')),'mailInteraction':require(_0x3448('0x5')),'faxInteraction':require(_0x3448('0x6')),'whatsappInteraction':require(_0x3448('0x7'))};exports['consequence']=function(_0xeb5b8,_0x6a89b,_0x1b05db,_0xd3606d){return function(_0x1bb7e5){try{logger[_0x3448('0x8')](_0x3448('0x9'),_0xeb5b8,_0x6a89b[0x0]);var _0x34b926={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x3448('0xa'),'disposition':_0x6a89b[0x0]};if(rpc[_0xd3606d[_0x3448('0xb')]+_0x3448('0xc')]){rpc[_0xd3606d[_0x3448('0xb')]+_0x3448('0xc')][_0x3448('0xd')](_0xd3606d[_0x3448('0xe')]['id'],_0x34b926)[_0x3448('0xf')](function(_0x39bd9e){logger[_0x3448('0x8')](_0x3448('0x10'),_0xeb5b8,_0xd3606d['interaction']['id']);})['catch'](function(_0x298ae6){logger[_0x3448('0x11')]('[%s][CLOSE]\x20%s',_0xeb5b8,JSON[_0x3448('0x12')](_0x298ae6));})[_0x3448('0x13')](function(){_0x1bb7e5[_0x3448('0x14')]();});}}catch(_0x549306){logger[_0x3448('0x11')](_0x3448('0x15'),_0xeb5b8,JSON['stringify'](_0x549306));_0x1bb7e5[_0x3448('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 1ae2ba4..64201e0 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['speech','providerName','Message','endConversation','next','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','ChatWebsiteId','upperFirst','account','created','body','create','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result'];(function(_0x190cd4,_0x5800e3){var _0x2b3256=function(_0x522b4f){while(--_0x522b4f){_0x190cd4['push'](_0x190cd4['shift']());}};_0x2b3256(++_0x5800e3);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2eb2[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var moment=require(_0x22eb('0x0'));var apiai=require(_0x22eb('0x1'));var md5=require(_0x22eb('0x2'));var utils=require(_0x22eb('0x3'));var logger=require(_0x22eb('0x4'))(_0x22eb('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x22eb('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x22eb('0x7')),'whatsappMessage':require(_0x22eb('0x8'))};exports[_0x22eb('0x9')]=function(_0x2a9850,_0x4539d0){return function(_0x396806){try{if(!_[_0x22eb('0xa')](this[_0x22eb('0xb')][_0x22eb('0xc')])){logger[_0x22eb('0xd')](_0x22eb('0xe'),_0x2a9850,_0x22eb('0xf'));return _0x396806['next']();}var _0x46c197={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x22eb('0x10')),'direction':'out'};if(this[_0x22eb('0x11')]===_0x22eb('0x12')||this['channel']==='whatsapp'){_0x46c197[_0x22eb('0x13')]=this[_0x22eb('0xb')][_0x22eb('0x13')];}var _0x1e2a53=this[_0x22eb('0x11')];if(_0x1e2a53==='chat'){_0x46c197[_0x22eb('0x14')]=this['account']['id'];}else{_0x46c197[_[_0x22eb('0x15')](_0x1e2a53)+'AccountId']=this[_0x22eb('0x16')]['id'];}_0x46c197[_[_0x22eb('0x15')](_0x1e2a53)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x22eb('0x17')]){var _0x5245fe=_0x4539d0[0x2];if(!_['isEmpty'](_0x5245fe)){_0x46c197[_0x22eb('0x18')]=utils['getMustacheRender'](_0x5245fe,this);return rpc[_0x1e2a53+'Message'][_0x22eb('0x19')](_0x46c197)[_0x22eb('0x1a')](function(_0x385bcb){logger[_0x22eb('0xd')](_0x22eb('0xe'),_0x2a9850,_0x46c197['body']);})[_0x22eb('0x1b')](function(_0x12bbd1){logger[_0x22eb('0x1c')](_0x22eb('0xe'),_0x2a9850,JSON[_0x22eb('0x1d')](_0x12bbd1));})['finally'](function(){logger[_0x22eb('0xd')](_0x22eb('0x1e'),_0x2a9850);_0x396806[_0x22eb('0x1f')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2a9850);_0x396806[_0x22eb('0x1f')]();}}else{var _0x267d97=this;var _0x434ecb=apiai(_0x4539d0[0x0],{'language':_0x4539d0[0x1]||'en'});return _0x434ecb[_0x22eb('0x20')](this[_0x22eb('0x21')][_0x22eb('0x18')],{'sessionId':md5(this[_0x22eb('0xb')]['id'])})['then'](function(_0x2e8f7c){_0x267d97[_0x22eb('0x18')][_0x22eb('0x22')]=_0x2e8f7c;_0x46c197[_0x22eb('0x18')]=_0x2e8f7c[_0x22eb('0x23')]['fulfillment'][_0x22eb('0x24')];_0x46c197[_0x22eb('0x25')]=_0x22eb('0x22');_0x46c197['providerResponse']=JSON[_0x22eb('0x1d')](_0x2e8f7c);return rpc[_0x1e2a53+_0x22eb('0x26')]['create'](_0x46c197)[_0x22eb('0x1a')](function(_0x222ef3){logger[_0x22eb('0xd')](_0x22eb('0xe'),_0x2a9850,_0x46c197[_0x22eb('0x18')]);if(_0x2e8f7c['result']['metadata'][_0x22eb('0x27')]){_0x396806[_0x22eb('0x28')]();}else{_0x396806[_0x22eb('0x1f')]();}})[_0x22eb('0x1b')](function(_0x1599c7){logger[_0x22eb('0x1c')](_0x22eb('0xe'),_0x2a9850,JSON[_0x22eb('0x1d')](_0x1599c7));_0x396806[_0x22eb('0x28')]();});})[_0x22eb('0x1b')](function(_0x24e9dc){logger[_0x22eb('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x2a9850,_0x24e9dc[_0x22eb('0x21')]);_0x396806['next']();});}}catch(_0x1dd660){logger[_0x22eb('0x1c')](_0x22eb('0xe'),_0x2a9850,JSON[_0x22eb('0x1d')](_0x1dd660));_0x396806[_0x22eb('0x1f')]();}};}; \ No newline at end of file +var _0x1b94=['phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','Message','create','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','endConversation','error','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','channel'];(function(_0x393115,_0x2fe4f1){var _0x46adfa=function(_0x2679ed){while(--_0x2679ed){_0x393115['push'](_0x393115['shift']());}};_0x46adfa(++_0x2fe4f1);}(_0x1b94,0x1f2));var _0x41b9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b94[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x41b9('0x0'));var moment=require(_0x41b9('0x1'));var apiai=require(_0x41b9('0x2'));var md5=require(_0x41b9('0x3'));var utils=require(_0x41b9('0x4'));var logger=require('../../../../config/logger')(_0x41b9('0x5'));var rpc={'chatMessage':require(_0x41b9('0x6')),'openchannelMessage':require(_0x41b9('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x41b9('0x8')),'faxMessage':require(_0x41b9('0x9')),'whatsappMessage':require(_0x41b9('0xa'))};exports['consequence']=function(_0x310fd8,_0x3e9325){return function(_0x2a0eed){try{if(!_[_0x41b9('0xb')](this[_0x41b9('0xc')]['UserId'])){logger[_0x41b9('0xd')](_0x41b9('0xe'),_0x310fd8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2a0eed[_0x41b9('0xf')]();}var _0x386807={'ContactId':this['contact']['id'],'sentAt':moment()[_0x41b9('0x10')](_0x41b9('0x11')),'direction':'out'};if(this[_0x41b9('0x12')]==='sms'||this[_0x41b9('0x12')]==='whatsapp'){_0x386807[_0x41b9('0x13')]=this[_0x41b9('0xc')][_0x41b9('0x13')];}var _0x1b33c7=this[_0x41b9('0x12')];if(_0x1b33c7==='chat'){_0x386807[_0x41b9('0x14')]=this[_0x41b9('0x15')]['id'];}else{_0x386807[_['upperFirst'](_0x1b33c7)+_0x41b9('0x16')]=this[_0x41b9('0x15')]['id'];}_0x386807[_[_0x41b9('0x17')](_0x1b33c7)+_0x41b9('0x18')]=this['interaction']['id'];if(this['interaction']['created']){var _0x2d7bf0=_0x3e9325[0x2];if(!_[_0x41b9('0x19')](_0x2d7bf0)){_0x386807['body']=utils['getMustacheRender'](_0x2d7bf0,this);return rpc[_0x1b33c7+_0x41b9('0x1a')][_0x41b9('0x1b')](_0x386807)[_0x41b9('0x1c')](function(_0x3ba9f3){logger[_0x41b9('0xd')](_0x41b9('0xe'),_0x310fd8,_0x386807['body']);})[_0x41b9('0x1d')](function(_0x12cab8){logger['error'](_0x41b9('0xe'),_0x310fd8,JSON[_0x41b9('0x1e')](_0x12cab8));})[_0x41b9('0x1f')](function(){logger[_0x41b9('0xd')](_0x41b9('0x20'),_0x310fd8);_0x2a0eed[_0x41b9('0x21')]();});}else{logger['info'](_0x41b9('0x22'),_0x310fd8);_0x2a0eed['stop']();}}else{var _0x319452=this;var _0x14dc16=apiai(_0x3e9325[0x0],{'language':_0x3e9325[0x1]||'en'});return _0x14dc16[_0x41b9('0x23')](this[_0x41b9('0x24')][_0x41b9('0x25')],{'sessionId':md5(this['interaction']['id'])})[_0x41b9('0x1c')](function(_0x50e26b){_0x319452['body']['dialogflow']=_0x50e26b;_0x386807[_0x41b9('0x25')]=_0x50e26b[_0x41b9('0x26')][_0x41b9('0x27')][_0x41b9('0x28')];_0x386807[_0x41b9('0x29')]=_0x41b9('0x2a');_0x386807[_0x41b9('0x2b')]=JSON[_0x41b9('0x1e')](_0x50e26b);return rpc[_0x1b33c7+_0x41b9('0x1a')]['create'](_0x386807)['then'](function(_0x1a3aee){logger[_0x41b9('0xd')](_0x41b9('0xe'),_0x310fd8,_0x386807[_0x41b9('0x25')]);if(_0x50e26b[_0x41b9('0x26')][_0x41b9('0x2c')][_0x41b9('0x2d')]){_0x2a0eed[_0x41b9('0xf')]();}else{_0x2a0eed['stop']();}})['catch'](function(_0x1ae013){logger['error'](_0x41b9('0xe'),_0x310fd8,JSON['stringify'](_0x1ae013));_0x2a0eed[_0x41b9('0xf')]();});})[_0x41b9('0x1d')](function(_0x4be093){logger['error'](_0x41b9('0xe'),_0x310fd8,_0x4be093[_0x41b9('0x24')]);_0x2a0eed['next']();});}}catch(_0x18c95b){logger[_0x41b9('0x2e')]('[%s][DIALOGFLOW]\x20%s',_0x310fd8,JSON[_0x41b9('0x1e')](_0x18c95b));_0x2a0eed['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index a556521..1f2643d 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fad=['DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','message','lodash','dialogflow','md5','moment','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText'];(function(_0xc26344,_0x338bb6){var _0x4623b7=function(_0x2ce669){while(--_0x2ce669){_0xc26344['push'](_0xc26344['shift']());}};_0x4623b7(++_0x338bb6);}(_0x6fad,0x174));var _0xd6fa=function(_0x428377,_0xf1d70d){_0x428377=_0x428377-0x0;var _0x143839=_0x6fad[_0x428377];return _0x143839;};'use strict';var _=require(_0xd6fa('0x0'));var dialogflow=require(_0xd6fa('0x1'));var md5=require(_0xd6fa('0x2'));var moment=require(_0xd6fa('0x3'));var Promise=require('bluebird');var logger=require(_0xd6fa('0x4'))('routing');var utils=require(_0xd6fa('0x5'));var rpc={'chatMessage':require(_0xd6fa('0x6')),'openchannelMessage':require(_0xd6fa('0x7')),'mailMessage':require(_0xd6fa('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd6fa('0x9')),'whatsappMessage':require(_0xd6fa('0xa'))};function createMessage(_0x291bd5,_0x153820,_0x5a1bf0,_0x1d2aaa){return new Promise(function(_0x566a11,_0x92911b){var _0x45d73f=_[_0xd6fa('0xb')](_0x5a1bf0);_0x45d73f[_0xd6fa('0xc')]=_0x1d2aaa;return rpc[_0x153820+_0xd6fa('0xd')]['create'](_0x45d73f)['then'](function(){logger[_0xd6fa('0xe')](_0xd6fa('0xf'),_0x291bd5,_0x45d73f[_0xd6fa('0xc')]);_0x566a11();})[_0xd6fa('0x10')](function(_0x3dd6bb){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x291bd5,JSON[_0xd6fa('0x11')](_0x3dd6bb));_0x92911b(_0x3dd6bb);});});}exports['consequence']=function(_0x5e0600,_0x33ee61){return function(_0x11e5b5){try{if(!_[_0xd6fa('0x12')](this[_0xd6fa('0x13')][_0xd6fa('0x14')])){logger[_0xd6fa('0xe')](_0xd6fa('0xf'),_0x5e0600,_0xd6fa('0x15'));return _0x11e5b5[_0xd6fa('0x16')]();}var _0x5b853a={'ContactId':this[_0xd6fa('0x17')]['id'],'sentAt':moment()[_0xd6fa('0x18')](_0xd6fa('0x19')),'direction':_0xd6fa('0x1a')};if(this['channel']==='sms'||this['channel']==='whatsapp'){_0x5b853a['phone']=this[_0xd6fa('0x13')]['phone'];}var _0x41d26f=this['channel'];if(_0x41d26f===_0xd6fa('0x1b')){_0x5b853a[_0xd6fa('0x1c')]=this[_0xd6fa('0x1d')]['id'];}else{_0x5b853a[_[_0xd6fa('0x1e')](_0x41d26f)+_0xd6fa('0x1f')]=this[_0xd6fa('0x1d')]['id'];}_0x5b853a[_[_0xd6fa('0x1e')](_0x41d26f)+_0xd6fa('0x20')]=this[_0xd6fa('0x13')]['id'];if(this[_0xd6fa('0x13')][_0xd6fa('0x21')]){var _0xe67cee=_0x33ee61[0x4];if(!_[_0xd6fa('0x22')](_0xe67cee)){_0x5b853a[_0xd6fa('0xc')]=utils[_0xd6fa('0x23')](_0xe67cee,this);return rpc[_0x41d26f+_0xd6fa('0xd')][_0xd6fa('0x24')](_0x5b853a)[_0xd6fa('0x25')](function(_0x3fbab3){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5e0600,_0x5b853a[_0xd6fa('0xc')]);})[_0xd6fa('0x10')](function(_0x1b0bc8){logger[_0xd6fa('0x26')](_0xd6fa('0xf'),_0x5e0600,JSON[_0xd6fa('0x11')](_0x1b0bc8));})['finally'](function(){logger[_0xd6fa('0xe')](_0xd6fa('0x27'),_0x5e0600);_0x11e5b5['stop']();});}else{logger[_0xd6fa('0xe')](_0xd6fa('0x28'),_0x5e0600);_0x11e5b5[_0xd6fa('0x29')]();}}else{var _0x47b073=this;var _0x242294=_0x33ee61[0x2][_0xd6fa('0x2a')](/\\n/g,'\x0a');var _0x22e6db={'credentials':{'private_key':_0x242294,'client_email':_0x33ee61[0x1]}};var _0x968568=new dialogflow[(_0xd6fa('0x2b'))](_0x22e6db);var _0x198ad6=_0x968568[_0xd6fa('0x2c')](_0x33ee61[0x0],md5(_0x47b073['interaction']['id']));var _0x2a59c0={'session':_0x198ad6,'queryInput':{'text':{'text':_0x47b073['message'][_0xd6fa('0xc')],'languageCode':_0x33ee61[0x3]||'en'}}};return _0x968568[_0xd6fa('0x2d')](_0x2a59c0)['then'](function(_0x3fc7f5){if(_0x3fc7f5&&_0x3fc7f5[_0xd6fa('0x2e')]){_0x47b073[_0xd6fa('0xc')][_0xd6fa('0x2f')]=_0x3fc7f5;var _0x36e1e6=_0x3fc7f5[0x0];var _0x3b0bab=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x31')]&&_0x36e1e6[_0xd6fa('0x30')]['diagnosticInfo'][_0xd6fa('0x32')]?_0x36e1e6[_0xd6fa('0x30')]['diagnosticInfo'][_0xd6fa('0x32')][_0xd6fa('0x33')][_0xd6fa('0x34')]:![];_0x47b073[_0xd6fa('0xc')][_0xd6fa('0x35')]=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x36')];_0x47b073[_0xd6fa('0xc')][_0xd6fa('0x37')]=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x38')];_0x47b073['body'][_0xd6fa('0x39')]=_0x36e1e6['queryResult'][_0xd6fa('0x31')]&&_0x36e1e6['queryResult'][_0xd6fa('0x31')][_0xd6fa('0x32')]?_0x36e1e6['queryResult'][_0xd6fa('0x31')]['fields'][_0xd6fa('0x33')][_0xd6fa('0x34')]:![];_0x47b073[_0xd6fa('0xc')]['DIALOGFLOWV2_INTENTNAME']=_0x36e1e6['queryResult'][_0xd6fa('0x3a')][_0xd6fa('0x3b')];_0x47b073[_0xd6fa('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x3a')][_0xd6fa('0x3c')];_0x47b073[_0xd6fa('0xc')][_0xd6fa('0x3d')]=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x3a')]['isFallback'];_0x47b073[_0xd6fa('0xc')][_0xd6fa('0x3e')]=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x3f')];_0x47b073[_0xd6fa('0xc')][_0xd6fa('0x40')]=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x41')];_0x47b073['body'][_0xd6fa('0x42')]=_0x36e1e6[_0xd6fa('0x30')][_0xd6fa('0x43')];_0x5b853a[_0xd6fa('0x44')]=_0xd6fa('0x2f');_0x5b853a[_0xd6fa('0x45')]=JSON[_0xd6fa('0x11')](_0x3fc7f5);var _0x22ab6c=[];for(var _0x141f13=0x0;_0x141f13<_0x3fc7f5['length'];_0x141f13++){var _0x1a1699=_0x3fc7f5[_0x141f13];if(_0x1a1699&&_0x1a1699[_0xd6fa('0x30')]&&_0x1a1699[_0xd6fa('0x30')][_0xd6fa('0x46')]){_0x22ab6c['push'](createMessage(_0x5e0600,_0x41d26f,_0x5b853a,_0x1a1699[_0xd6fa('0x30')][_0xd6fa('0x46')]));}}return Promise[_0xd6fa('0x47')](_0x22ab6c)[_0xd6fa('0x25')](function(){if(_0x3b0bab){_0x11e5b5[_0xd6fa('0x16')]();}else{_0x11e5b5[_0xd6fa('0x29')]();}})[_0xd6fa('0x10')](function(_0x3af46b){logger[_0xd6fa('0x26')](_0xd6fa('0xf'),_0x5e0600,JSON[_0xd6fa('0x11')](_0x3af46b));_0x11e5b5[_0xd6fa('0x16')]();});}})[_0xd6fa('0x10')](function(_0x6fa393){logger[_0xd6fa('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x5e0600,_0x6fa393[_0xd6fa('0x48')]);_0x11e5b5[_0xd6fa('0x16')]();});}}catch(_0x50944b){logger[_0xd6fa('0x26')](_0xd6fa('0xf'),_0x5e0600,JSON[_0xd6fa('0x11')](_0x50944b));_0x11e5b5[_0xd6fa('0x29')]();}};}; \ No newline at end of file +var _0x66cd=['DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','providerName','dialogflowV2','fulfillmentText','push','all','next','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','catch','error','stringify','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','account','upperFirst','InteractionId','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20%s','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','message','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x66cd,0xa4));var _0xd66c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x66cd[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xd66c('0x0'));var dialogflow=require(_0xd66c('0x1'));var md5=require(_0xd66c('0x2'));var moment=require(_0xd66c('0x3'));var Promise=require('bluebird');var logger=require(_0xd66c('0x4'))(_0xd66c('0x5'));var utils=require(_0xd66c('0x6'));var rpc={'chatMessage':require(_0xd66c('0x7')),'openchannelMessage':require(_0xd66c('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd66c('0x9')),'faxMessage':require(_0xd66c('0xa')),'whatsappMessage':require(_0xd66c('0xb'))};function createMessage(_0x528f64,_0x43d66d,_0x4d47fa,_0x2cfaaa){return new Promise(function(_0x5c09b9,_0x4eb2dd){var _0x38ec16=_[_0xd66c('0xc')](_0x4d47fa);_0x38ec16[_0xd66c('0xd')]=_0x2cfaaa;return rpc[_0x43d66d+_0xd66c('0xe')]['create'](_0x38ec16)[_0xd66c('0xf')](function(){logger[_0xd66c('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x528f64,_0x38ec16['body']);_0x5c09b9();})[_0xd66c('0x11')](function(_0x3c81c1){logger[_0xd66c('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x528f64,JSON[_0xd66c('0x13')](_0x3c81c1));_0x4eb2dd(_0x3c81c1);});});}exports['consequence']=function(_0x5bb143,_0x321fa6){return function(_0x85a281){try{if(!_['isNil'](this[_0xd66c('0x14')][_0xd66c('0x15')])){logger[_0xd66c('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x5bb143,_0xd66c('0x16'));return _0x85a281['next']();}var _0x528ea3={'ContactId':this[_0xd66c('0x17')]['id'],'sentAt':moment()[_0xd66c('0x18')](_0xd66c('0x19')),'direction':_0xd66c('0x1a')};if(this[_0xd66c('0x1b')]===_0xd66c('0x1c')||this['channel']==='whatsapp'){_0x528ea3[_0xd66c('0x1d')]=this[_0xd66c('0x14')][_0xd66c('0x1d')];}var _0x3dfb49=this[_0xd66c('0x1b')];if(_0x3dfb49===_0xd66c('0x1e')){_0x528ea3['ChatWebsiteId']=this[_0xd66c('0x1f')]['id'];}else{_0x528ea3[_[_0xd66c('0x20')](_0x3dfb49)+'AccountId']=this[_0xd66c('0x1f')]['id'];}_0x528ea3[_[_0xd66c('0x20')](_0x3dfb49)+_0xd66c('0x21')]=this[_0xd66c('0x14')]['id'];if(this[_0xd66c('0x14')]['created']){var _0x5d7718=_0x321fa6[0x4];if(!_[_0xd66c('0x22')](_0x5d7718)){_0x528ea3['body']=utils[_0xd66c('0x23')](_0x5d7718,this);return rpc[_0x3dfb49+_0xd66c('0xe')]['create'](_0x528ea3)['then'](function(_0x486a9a){logger[_0xd66c('0x10')](_0xd66c('0x24'),_0x5bb143,_0x528ea3['body']);})[_0xd66c('0x11')](function(_0x46f6c5){logger['error'](_0xd66c('0x24'),_0x5bb143,JSON[_0xd66c('0x13')](_0x46f6c5));})[_0xd66c('0x25')](function(){logger['info'](_0xd66c('0x26'),_0x5bb143);_0x85a281['stop']();});}else{logger['info'](_0xd66c('0x27'),_0x5bb143);_0x85a281[_0xd66c('0x28')]();}}else{var _0x15ad83=this;var _0x1dc01d=_0x321fa6[0x2][_0xd66c('0x29')](/\\n/g,'\x0a');var _0x464f2c={'credentials':{'private_key':_0x1dc01d,'client_email':_0x321fa6[0x1]}};var _0x410086=new dialogflow[(_0xd66c('0x2a'))](_0x464f2c);var _0x5de70d=_0x410086[_0xd66c('0x2b')](_0x321fa6[0x0],md5(_0x15ad83[_0xd66c('0x14')]['id']));var _0x370ccf={'session':_0x5de70d,'queryInput':{'text':{'text':_0x15ad83[_0xd66c('0x2c')][_0xd66c('0xd')],'languageCode':_0x321fa6[0x3]||'en'}}};return _0x410086[_0xd66c('0x2d')](_0x370ccf)['then'](function(_0x33d610){if(_0x33d610&&_0x33d610['length']){_0x15ad83['body']['dialogflowV2']=_0x33d610;var _0x4e7be0=_0x33d610[0x0];var _0x47c1b1=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x2f')]&&_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x2f')][_0xd66c('0x30')]?_0x4e7be0[_0xd66c('0x2e')]['diagnosticInfo']['fields'][_0xd66c('0x31')][_0xd66c('0x32')]:![];_0x15ad83[_0xd66c('0xd')][_0xd66c('0x33')]=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x34')];_0x15ad83[_0xd66c('0xd')][_0xd66c('0x35')]=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x36')];_0x15ad83['body'][_0xd66c('0x37')]=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x2f')]&&_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x2f')]['fields']?_0x4e7be0['queryResult'][_0xd66c('0x2f')][_0xd66c('0x30')][_0xd66c('0x31')]['boolValue']:![];_0x15ad83[_0xd66c('0xd')][_0xd66c('0x38')]=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x39')][_0xd66c('0x3a')];_0x15ad83['body'][_0xd66c('0x3b')]=_0x4e7be0[_0xd66c('0x2e')]['intent'][_0xd66c('0x3c')];_0x15ad83[_0xd66c('0xd')][_0xd66c('0x3d')]=_0x4e7be0[_0xd66c('0x2e')]['intent'][_0xd66c('0x3e')];_0x15ad83[_0xd66c('0xd')][_0xd66c('0x3f')]=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x40')];_0x15ad83['body'][_0xd66c('0x41')]=_0x4e7be0[_0xd66c('0x2e')]['queryText'];_0x15ad83['body']['DIALOGFLOWV2_SCORE']=_0x4e7be0[_0xd66c('0x2e')][_0xd66c('0x42')];_0x528ea3[_0xd66c('0x43')]=_0xd66c('0x44');_0x528ea3['providerResponse']=JSON[_0xd66c('0x13')](_0x33d610);var _0x3e0177=[];for(var _0x555c4e=0x0;_0x555c4e<_0x33d610['length'];_0x555c4e++){var _0x44e91b=_0x33d610[_0x555c4e];if(_0x44e91b&&_0x44e91b['queryResult']&&_0x44e91b[_0xd66c('0x2e')][_0xd66c('0x45')]){_0x3e0177[_0xd66c('0x46')](createMessage(_0x5bb143,_0x3dfb49,_0x528ea3,_0x44e91b['queryResult'][_0xd66c('0x45')]));}}return Promise[_0xd66c('0x47')](_0x3e0177)[_0xd66c('0xf')](function(){if(_0x47c1b1){_0x85a281['next']();}else{_0x85a281['stop']();}})[_0xd66c('0x11')](function(_0x7eaaaa){logger[_0xd66c('0x12')](_0xd66c('0x24'),_0x5bb143,JSON[_0xd66c('0x13')](_0x7eaaaa));_0x85a281[_0xd66c('0x48')]();});}})[_0xd66c('0x11')](function(_0x2641a5){logger[_0xd66c('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x5bb143,_0x2641a5[_0xd66c('0x2c')]);_0x85a281[_0xd66c('0x48')]();});}}catch(_0x41879b){logger['error'](_0xd66c('0x24'),_0x5bb143,JSON[_0xd66c('0x13')](_0x41879b));_0x85a281[_0xd66c('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index ec483e0..bccacc7 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac13=['map','message','join','stop','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','replace','error'];(function(_0x1ffe7a,_0x3313b1){var _0x40af2f=function(_0x1845ca){while(--_0x1845ca){_0x1ffe7a['push'](_0x1ffe7a['shift']());}};_0x40af2f(++_0x3313b1);}(_0xac13,0x7b));var _0x3ac1=function(_0x4abcf8,_0x4191de){_0x4abcf8=_0x4abcf8-0x0;var _0x86ef7c=_0xac13[_0x4abcf8];return _0x86ef7c;};'use strict';var schema=require('validate');var _=require(_0x3ac1('0x0'));var htmlToText=require(_0x3ac1('0x1'));var utils=require(_0x3ac1('0x2'));var logger=require(_0x3ac1('0x3'))(_0x3ac1('0x4'));var gotoif=schema({'condition':{'type':_0x3ac1('0x5'),'required':!![],'message':_0x3ac1('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x3ac1('0x7'),'message':_0x3ac1('0x8')}});exports[_0x3ac1('0x9')]=function(_0x2a7593,_0x109ead){return function(_0x2a477c){try{var _0x4ae226={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x109ead[0x0],this),{'wordwrap':![]})[_0x3ac1('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x109ead[0x1],'priorityFalse':_0x109ead[0x2]};var _0x1f9c7e=gotoif['validate'](_0x4ae226,{'typecast':!![]});if(_0x1f9c7e['length']){logger[_0x3ac1('0xb')]('[%s][GOTOIF]\x20%s',_0x2a7593,_[_0x3ac1('0xc')](_0x1f9c7e,_0x3ac1('0xd'))[_0x3ac1('0xe')](',\x20'));_0x2a477c[_0x3ac1('0xf')]();}else{try{var _0xbc892=eval('('+_0x4ae226['condition']+')');var _0x780deb=_0xbc892?_0x4ae226[_0x3ac1('0x10')]:_0x4ae226['priorityFalse'];logger[_0x3ac1('0x11')](_0x3ac1('0x12'),_0x2a7593,_0x4ae226['condition'],_0xbc892,_0x780deb||'next');if(_0x780deb){var _0x1caaf0=_[_0x3ac1('0x13')](_0x2a477c[_0x3ac1('0x14')](),{'p':_0x780deb});if(_0x1caaf0>=0x0){logger[_0x3ac1('0x11')](_0x3ac1('0x15'),_0x2a7593,_0x780deb||_0x3ac1('0x16'),_0x1caaf0);_0x2a477c['next'](_0x1caaf0);}else{logger[_0x3ac1('0x11')](_0x3ac1('0x17'),_0x2a7593,_0x780deb||'next');_0x2a477c['stop']();}}else{_0x2a477c['next']();}}catch(_0x3d8f1f){logger[_0x3ac1('0xb')](_0x3ac1('0x18'),_0x2a7593,_0x3d8f1f[_0x3ac1('0xd')]);_0x2a477c[_0x3ac1('0xf')]();}}}catch(_0x246d3a){logger['error'](_0x3ac1('0x19'),_0x2a7593,JSON[_0x3ac1('0x1a')](_0x246d3a));_0x2a477c[_0x3ac1('0xf')]();}};}; \ No newline at end of file +var _0xeb38=['[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','validate','length','error','map','message','join','stop','condition','priorityTrue','priorityFalse','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]\x20eval\x20error:\x20%s'];(function(_0x503752,_0x151f62){var _0x4f311c=function(_0x3e928f){while(--_0x3e928f){_0x503752['push'](_0x503752['shift']());}};_0x4f311c(++_0x151f62);}(_0xeb38,0x17b));var _0x8eb3=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xeb38[_0x40a825];return _0x273a54;};'use strict';var schema=require('validate');var _=require(_0x8eb3('0x0'));var htmlToText=require(_0x8eb3('0x1'));var utils=require(_0x8eb3('0x2'));var logger=require(_0x8eb3('0x3'))(_0x8eb3('0x4'));var gotoif=schema({'condition':{'type':_0x8eb3('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x8eb3('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x8eb3('0x7')}});exports[_0x8eb3('0x8')]=function(_0x5ad96b,_0x4e02bf){return function(_0x2a7bbf){try{var _0x5bc5f7={'condition':htmlToText[_0x8eb3('0x9')](utils[_0x8eb3('0xa')](_0x4e02bf[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4e02bf[0x1],'priorityFalse':_0x4e02bf[0x2]};var _0x98f696=gotoif[_0x8eb3('0xb')](_0x5bc5f7,{'typecast':!![]});if(_0x98f696[_0x8eb3('0xc')]){logger[_0x8eb3('0xd')]('[%s][GOTOIF]\x20%s',_0x5ad96b,_[_0x8eb3('0xe')](_0x98f696,_0x8eb3('0xf'))[_0x8eb3('0x10')](',\x20'));_0x2a7bbf[_0x8eb3('0x11')]();}else{try{var _0x4371b2=eval('('+_0x5bc5f7[_0x8eb3('0x12')]+')');var _0x303a61=_0x4371b2?_0x5bc5f7[_0x8eb3('0x13')]:_0x5bc5f7[_0x8eb3('0x14')];logger[_0x8eb3('0x15')](_0x8eb3('0x16'),_0x5ad96b,_0x5bc5f7['condition'],_0x4371b2,_0x303a61||_0x8eb3('0x17'));if(_0x303a61){var _0x1f9798=_['findIndex'](_0x2a7bbf['rules'](),{'p':_0x303a61});if(_0x1f9798>=0x0){logger[_0x8eb3('0x15')](_0x8eb3('0x18'),_0x5ad96b,_0x303a61||_0x8eb3('0x17'),_0x1f9798);_0x2a7bbf[_0x8eb3('0x17')](_0x1f9798);}else{logger[_0x8eb3('0x15')](_0x8eb3('0x19'),_0x5ad96b,_0x303a61||'next');_0x2a7bbf['stop']();}}else{_0x2a7bbf[_0x8eb3('0x17')]();}}catch(_0x277425){logger['error'](_0x8eb3('0x1a'),_0x5ad96b,_0x277425['message']);_0x2a7bbf[_0x8eb3('0x11')]();}}}catch(_0xed6b76){logger['error'](_0x8eb3('0x1b'),_0x5ad96b,JSON[_0x8eb3('0x1c')](_0xed6b76));_0x2a7bbf[_0x8eb3('0x11')]();}};}; \ 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 72e7b44..a8bcf59 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 _0xcb05=['routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','lodash','../../../../config/logger'];(function(_0x56e959,_0x2acd5d){var _0x465e27=function(_0x263c14){while(--_0x263c14){_0x56e959['push'](_0x56e959['shift']());}};_0x465e27(++_0x2acd5d);}(_0xcb05,0x185));var _0x5cb0=function(_0x503182,_0x52fbeb){_0x503182=_0x503182-0x0;var _0x58913d=_0xcb05[_0x503182];return _0x58913d;};'use strict';var schema=require('validate');var _=require(_0x5cb0('0x0'));var logger=require(_0x5cb0('0x1'))(_0x5cb0('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5cb0('0x3')}});exports[_0x5cb0('0x4')]=function(_0x43e155,_0x35966e){return function(_0x33b52b){try{var _0x43b268={'priority':_0x35966e[0x0]};var _0x22631d=gotop['validate'](_0x43b268,{'typecast':!![]});if(_0x22631d[_0x5cb0('0x5')]){logger[_0x5cb0('0x6')](_0x5cb0('0x7'),_0x43e155,_['map'](_0x22631d,'message')[_0x5cb0('0x8')](',\x20'));_0x33b52b[_0x5cb0('0x9')]();}else{logger[_0x5cb0('0xa')](_0x5cb0('0xb'),_0x43e155,_0x43b268[_0x5cb0('0xc')]);if(_0x43b268['priority']){var _0x581f90=_[_0x5cb0('0xd')](_0x33b52b[_0x5cb0('0xe')](),{'p':_0x43b268[_0x5cb0('0xc')]});if(_0x581f90>=0x0){logger[_0x5cb0('0xa')](_0x5cb0('0xf'),_0x43e155,_0x43b268[_0x5cb0('0xc')]||'next',_0x581f90);_0x33b52b[_0x5cb0('0x10')](_0x581f90);}else{logger[_0x5cb0('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x43e155,_0x43b268[_0x5cb0('0xc')]||'next');_0x33b52b['stop']();}}else{_0x33b52b[_0x5cb0('0x10')]();}}}catch(_0x4075fc){logger[_0x5cb0('0x6')](_0x5cb0('0x7'),_0x43e155,JSON['stringify'](_0x4075fc));_0x33b52b[_0x5cb0('0x9')]();}};}; \ No newline at end of file +var _0x56ee=['[%s][GOTOP]\x20%s','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','../../../../config/logger','routing','consequence','length','error'];(function(_0x2768c6,_0x5cb241){var _0x4048d9=function(_0x346a3e){while(--_0x346a3e){_0x2768c6['push'](_0x2768c6['shift']());}};_0x4048d9(++_0x5cb241);}(_0x56ee,0x1d5));var _0xe56e=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x56ee[_0x4bc65f];return _0x44f85f;};'use strict';var schema=require(_0xe56e('0x0'));var _=require('lodash');var logger=require(_0xe56e('0x1'))(_0xe56e('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xe56e('0x3')]=function(_0x4228c4,_0x32c666){return function(_0x23ef9b){try{var _0x16afcb={'priority':_0x32c666[0x0]};var _0x103425=gotop['validate'](_0x16afcb,{'typecast':!![]});if(_0x103425[_0xe56e('0x4')]){logger[_0xe56e('0x5')](_0xe56e('0x6'),_0x4228c4,_['map'](_0x103425,_0xe56e('0x7'))[_0xe56e('0x8')](',\x20'));_0x23ef9b['stop']();}else{logger[_0xe56e('0x9')](_0xe56e('0xa'),_0x4228c4,_0x16afcb[_0xe56e('0xb')]);if(_0x16afcb['priority']){var _0x2a7ae0=_[_0xe56e('0xc')](_0x23ef9b[_0xe56e('0xd')](),{'p':_0x16afcb['priority']});if(_0x2a7ae0>=0x0){logger[_0xe56e('0x9')](_0xe56e('0xe'),_0x4228c4,_0x16afcb[_0xe56e('0xb')]||_0xe56e('0xf'),_0x2a7ae0);_0x23ef9b[_0xe56e('0xf')](_0x2a7ae0);}else{logger[_0xe56e('0x9')](_0xe56e('0x10'),_0x4228c4,_0x16afcb[_0xe56e('0xb')]||_0xe56e('0xf'));_0x23ef9b[_0xe56e('0x11')]();}}else{_0x23ef9b[_0xe56e('0xf')]();}}}catch(_0x959adc){logger[_0xe56e('0x5')](_0xe56e('0x6'),_0x4228c4,JSON[_0xe56e('0x12')](_0x959adc));_0x23ef9b['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 2fa7a9a..a53e59e 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 _0x5761=['stop','error','stringify','lodash','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5761,0x107));var _0x1576=function(_0x199c70,_0xc1a988){_0x199c70=_0x199c70-0x0;var _0x429b39=_0x5761[_0x199c70];return _0x429b39;};'use strict';var _=require(_0x1576('0x0'));var utils=require(_0x1576('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x1576('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1576('0x3')),'smsMessage':require(_0x1576('0x4')),'faxMessage':require(_0x1576('0x5')),'whatsappMessage':require(_0x1576('0x6'))};exports[_0x1576('0x7')]=function(_0x1a36b6,_0x5730fd){return function(_0x4dfdf5){try{var _0x30f503={'body':utils[_0x1576('0x8')](_0x5730fd[0x0],this),'ContactId':this[_0x1576('0x9')]['id']};if(this[_0x1576('0xa')]==='chat'){_0x30f503[_0x1576('0xb')]=this[_0x1576('0xc')]['id'];}else{_0x30f503[_['upperFirst'](this[_0x1576('0xa')])+'AccountId']=this['account']['id'];}_0x30f503[_[_0x1576('0xd')](this[_0x1576('0xa')])+_0x1576('0xe')]=this[_0x1576('0xf')]['id'];if(rpc[this[_0x1576('0xa')]+'Message']){return rpc[this[_0x1576('0xa')]+'Message'][_0x1576('0x10')](_0x30f503)[_0x1576('0x11')](function(_0x137128){logger[_0x1576('0x12')](_0x1576('0x13'),_0x1a36b6,_0x30f503[_0x1576('0x14')]);_0x4dfdf5[_0x1576('0x15')]();})[_0x1576('0x16')](function(_0x2f344a){logger['error'](_0x1576('0x13'),_0x1a36b6,JSON['stringify'](_0x2f344a));_0x4dfdf5[_0x1576('0x17')]();});}}catch(_0x1d1e53){logger[_0x1576('0x18')](_0x1576('0x13'),_0x1a36b6,JSON[_0x1576('0x19')](_0x1d1e53));_0x4dfdf5[_0x1576('0x17')]();}};}; \ No newline at end of file +var _0xaf23=['getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message','then','info','next','catch','error','stringify','stop','[%s][MESSAGE]\x20%s','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0x18b36c,_0x3fd9e5){var _0x3efbfa=function(_0x87e516){while(--_0x87e516){_0x18b36c['push'](_0x18b36c['shift']());}};_0x3efbfa(++_0x3fd9e5);}(_0xaf23,0x11a));var _0x3af2=function(_0x1eaf74,_0x23a786){_0x1eaf74=_0x1eaf74-0x0;var _0xd34db2=_0xaf23[_0x1eaf74];return _0xd34db2;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x3af2('0x0'))(_0x3af2('0x1'));var rpc={'chatMessage':require(_0x3af2('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3af2('0x3')),'smsMessage':require(_0x3af2('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x3af2('0x5'))};exports['consequence']=function(_0x19004b,_0x533d17){return function(_0x523e91){try{var _0x141c5e={'body':utils[_0x3af2('0x6')](_0x533d17[0x0],this),'ContactId':this[_0x3af2('0x7')]['id']};if(this[_0x3af2('0x8')]==='chat'){_0x141c5e[_0x3af2('0x9')]=this['account']['id'];}else{_0x141c5e[_[_0x3af2('0xa')](this['channel'])+_0x3af2('0xb')]=this[_0x3af2('0xc')]['id'];}_0x141c5e[_[_0x3af2('0xa')](this[_0x3af2('0x8')])+_0x3af2('0xd')]=this[_0x3af2('0xe')]['id'];if(rpc[this[_0x3af2('0x8')]+_0x3af2('0xf')]){return rpc[this[_0x3af2('0x8')]+_0x3af2('0xf')]['create'](_0x141c5e)[_0x3af2('0x10')](function(_0x308943){logger[_0x3af2('0x11')]('[%s][MESSAGE]\x20%s',_0x19004b,_0x141c5e['body']);_0x523e91[_0x3af2('0x12')]();})[_0x3af2('0x13')](function(_0x3f5667){logger[_0x3af2('0x14')]('[%s][MESSAGE]\x20%s',_0x19004b,JSON[_0x3af2('0x15')](_0x3f5667));_0x523e91[_0x3af2('0x16')]();});}}catch(_0x821374){logger['error'](_0x3af2('0x17'),_0x19004b,JSON[_0x3af2('0x15')](_0x821374));_0x523e91[_0x3af2('0x16')]();}};}; \ 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 6c74f32..45fdf34 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 _0x099c=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stop'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0x099c,0x100));var _0xc099=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x099c[_0x330414];return _0x99dbff;};'use strict';var utils=require(_0xc099('0x0'));var logger=require(_0xc099('0x1'))(_0xc099('0x2'));exports[_0xc099('0x3')]=function(_0x33553e,_0x4ea106){return function(_0x4a2e99){try{logger[_0xc099('0x4')](_0xc099('0x5'),_0x33553e,utils[_0xc099('0x6')](_0x4ea106[0x0],this));_0x4a2e99['next']();}catch(_0x1b1045){logger['error'](_0xc099('0x5'),_0x33553e,JSON['stringify'](_0x1b1045));_0x4a2e99[_0xc099('0x7')]();}};}; \ No newline at end of file +var _0xa24e=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','routing'];(function(_0x140ede,_0x4abc15){var _0x5c316f=function(_0x6d9659){while(--_0x6d9659){_0x140ede['push'](_0x140ede['shift']());}};_0x5c316f(++_0x4abc15);}(_0xa24e,0x7e));var _0xea24=function(_0x21bceb,_0x56c1fd){_0x21bceb=_0x21bceb-0x0;var _0x1ac9b3=_0xa24e[_0x21bceb];return _0x1ac9b3;};'use strict';var utils=require(_0xea24('0x0'));var logger=require('../../../../config/logger')(_0xea24('0x1'));exports['consequence']=function(_0x56b282,_0x1abb8a){return function(_0x24389a){try{logger[_0xea24('0x2')](_0xea24('0x3'),_0x56b282,utils[_0xea24('0x4')](_0x1abb8a[0x0],this));_0x24389a[_0xea24('0x5')]();}catch(_0x8aff74){logger['error']('[%s][NOOP]\x20%s',_0x56b282,JSON[_0xea24('0x6')](_0x8aff74));_0x24389a[_0xea24('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 03f6027..3f80144 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 _0x5c01=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','message','catch','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport'];(function(_0xbc32ba,_0x469f68){var _0xe02534=function(_0x47a50c){while(--_0x47a50c){_0xbc32ba['push'](_0xbc32ba['shift']());}};_0xe02534(++_0x469f68);}(_0x5c01,0x83));var _0x15c0=function(_0x5ebc92,_0x39bfe7){_0x5ebc92=_0x5ebc92-0x0;var _0x334bd7=_0x5c01[_0x5ebc92];return _0x334bd7;};'use strict';var schema=require(_0x15c0('0x0'));var _=require(_0x15c0('0x1'));var util=require(_0x15c0('0x2'));var seqqueue=require(_0x15c0('0x3'));var moment=require(_0x15c0('0x4'));var Redis=require(_0x15c0('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x15c0('0x6'));var strategy=require(_0x15c0('0x7'));config[_0x15c0('0x8')]=_[_0x15c0('0x9')](config['redis'],{'host':_0x15c0('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x15c0('0xb'),_0x15c0('0xc'),_0x15c0('0xd'),_0x15c0('0xe'),'joinAt'];function emit(_0x44183e,_0x8526ca,_0x54a7c1){io['to'](_0x44183e)[_0x15c0('0xf')](_0x8526ca,_0x54a7c1);}function emitChannelQueueInteraction(_0x3e4971,_0x292b8d,_0x29bc11,_0x27aab7,_0x5d60b7,_0x58df74,_0x2a502c,_0x476ad5){var _0x2cb644=_[_0x15c0('0x10')](_0x29bc11);_0x2cb644[_0x15c0('0xb')]=_0x476ad5;_0x2cb644[_0x15c0('0xd')]=_0x292b8d;_0x2cb644[_0x15c0('0xc')]=_0x27aab7;_0x2cb644['id']=_0x5d60b7;if(_0x58df74){_0x2a502c[util[_0x15c0('0x11')](_0x15c0('0x12'),_0x3e4971)][_0x5d60b7]=_['pick'](_0x2cb644,attributes);}else{delete _0x2a502c[util[_0x15c0('0x11')](_0x15c0('0x12'),_0x3e4971)][_0x5d60b7];}emit(util[_0x15c0('0x11')](_0x15c0('0x13'),_0x3e4971,_0x292b8d),util[_0x15c0('0x11')](_0x15c0('0x14'),_0x3e4971,_0x58df74?_0x15c0('0x15'):_0x15c0('0x16')),_[_0x15c0('0x17')](_0x2cb644,attributes));}var rpc={'openchannelQueueReport':require(_0x15c0('0x18')),'mailQueueReport':require(_0x15c0('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x15c0('0x1a')),'faxQueueReport':require(_0x15c0('0x1b')),'whatsappQueueReport':require(_0x15c0('0x1c'))};var queue=schema({'name':{'type':_0x15c0('0x1d'),'required':!![],'message':_0x15c0('0x1e')},'timeout':{'type':_0x15c0('0x1f'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x56d774,_0x4acdcd,_0x13dc5a,_0x1770b6){if(_0x56d774&&_0x4acdcd&&_0x13dc5a){_0x4acdcd['waiting']+=0x1;var _0x484233={'uniqueid':_0x56d774,'from':_0x13dc5a['body']?_0x13dc5a[_0x15c0('0x20')][_0x15c0('0xe')]:'','joinAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'ContactId':_0x13dc5a['contact']?_0x13dc5a[_0x15c0('0x22')]['id']:null,'ListId':_0x13dc5a[_0x15c0('0x23')]?_0x13dc5a[_0x15c0('0x23')]['id']:null};_0x484233[_['upperFirst'](_0x13dc5a[_0x15c0('0x24')])+'QueueId']=_0x4acdcd['id']||null;_0x484233[_[_0x15c0('0x25')](_0x13dc5a[_0x15c0('0x24')])+_0x15c0('0x26')]=_0x13dc5a[_0x15c0('0x27')]?_0x13dc5a[_0x15c0('0x27')]['id']:null;_0x484233[_[_0x15c0('0x25')](_0x13dc5a[_0x15c0('0x24')])+'MessageId']=_0x13dc5a['message']?_0x13dc5a['message']['id']:null;_0x484233[_[_0x15c0('0x25')](_0x13dc5a[_0x15c0('0x24')])+(_0x13dc5a[_0x15c0('0x24')]!==_0x15c0('0x28')?'AccountId':'WebsiteId')]=_0x13dc5a[_0x15c0('0xc')]?_0x13dc5a[_0x15c0('0xc')]['id']:null;logger[_0x15c0('0x29')](util[_0x15c0('0x11')](_0x15c0('0x2a'),_0x56d774,_0x4acdcd['name']));emitChannelQueueInteraction(_0x13dc5a['channel'],_0x4acdcd[_0x15c0('0x2b')],_0x484233,_0x13dc5a['account'][_0x15c0('0x2b')],_0x13dc5a['message']['id'],!![],_0x1770b6,_0x4acdcd['id']);if(rpc[_0x13dc5a[_0x15c0('0x24')]+_0x15c0('0x2c')]){return rpc[_0x13dc5a[_0x15c0('0x24')]+_0x15c0('0x2c')][_0x15c0('0x2d')](_0x484233)['catch'](function(_0x455f26){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0xecd47e,_0xb8fd31,_0x123d58,_0x1a340b){if(_0xecd47e&&_0xb8fd31){_0xb8fd31[_0x15c0('0x2e')]-=0x1;var _0x3c2aec={'leaveAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'acceptAt':moment()['format'](_0x15c0('0x21')),'reason':_0x15c0('0x2f')};logger[_0x15c0('0x29')](util[_0x15c0('0x11')](_0x15c0('0x30'),_0xecd47e,_0xb8fd31['name']));emitChannelQueueInteraction(_0x123d58[_0x15c0('0x24')],_0xb8fd31[_0x15c0('0x2b')],_0x123d58[_0x15c0('0x20')],_0x123d58['account']['name'],_0x123d58['message']['id'],![],_0x1a340b,_0xb8fd31['id']);if(rpc[_0x123d58[_0x15c0('0x24')]+_0x15c0('0x2c')]){return rpc[_0x123d58[_0x15c0('0x24')]+'QueueReport'][_0x15c0('0x31')](_0xecd47e,_0x3c2aec)['catch'](function(_0x11479f){logger[_0x15c0('0x32')](_0x15c0('0x33'));});}}}function endRouting(_0x5c6030,_0x24e8b5,_0x5080dc,_0x4628ac){if(_0x5c6030&&_0x24e8b5){_0x24e8b5[_0x15c0('0x2e')]-=0x1;var _0x14cd87={'leaveAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'exitAt':moment()[_0x15c0('0x11')](_0x15c0('0x21')),'reason':_0x15c0('0x34')};logger['info'](util[_0x15c0('0x11')](_0x15c0('0x35'),_0x5c6030,_0x24e8b5['name']));emitChannelQueueInteraction(_0x5080dc[_0x15c0('0x24')],_0x24e8b5['name'],_0x5080dc['body'],_0x5080dc[_0x15c0('0xc')][_0x15c0('0x2b')],_0x5080dc[_0x15c0('0x36')]['id'],![],_0x4628ac);if(rpc[_0x5080dc[_0x15c0('0x24')]+_0x15c0('0x2c')]){return rpc[_0x5080dc[_0x15c0('0x24')]+_0x15c0('0x2c')]['update'](_0x5c6030,_0x14cd87)[_0x15c0('0x37')](function(_0x45a5a7){logger['error'](_0x15c0('0x33'));});}}}function handleFindQueue(_0xbafe33){return function(_0x473d3c){return _0x473d3c[_0x15c0('0x2b')]['toLowerCase']()===_0xbafe33[_0x15c0('0x38')]();};}exports[_0x15c0('0x39')]=function(_0x133274,_0x177b33,_0x3ba168,_0x1c1523){return function(_0x476c12){try{var _0x254820={'name':_0x177b33[0x0],'timeout':_0x177b33[0x1]};var _0x508fdc=queue[_0x15c0('0x0')](_0x254820,{'typecast':!![]});if(_0x508fdc[_0x15c0('0x3a')]){logger['error'](_0x15c0('0x3b'),_0x133274,_[_0x15c0('0x3c')](_0x508fdc,'message')['join'](',\x20'));_0x476c12['stop']();}else{var _0x2d8ad7=_[_0x15c0('0x3d')](_0x3ba168[_0x1c1523[_0x15c0('0x24')]+_0x15c0('0x3e')],handleFindQueue(_0x254820[_0x15c0('0x2b')]));if(_0x2d8ad7){startRouting(_0x133274,_0x2d8ad7,_0x1c1523,_0x3ba168);var _0x2d8bf4=(_0x2d8ad7['timeout']||0xa)*0x3e8;var _0x42e269=(_0x254820[_0x15c0('0x34')]||0x14)*0x3e8;var _0x27999b,_0x3f63f3;if(_0x2d8bf4>_0x42e269){_0x42e269=_0x2d8bf4;}var _0x4054b0=seqqueue[_0x15c0('0x3f')](_0x2d8bf4);_0x4054b0['id']=_0x133274;_0x4054b0[_0x15c0('0x40')]=_0x2d8bf4;_0x4054b0[_0x15c0('0x41')]=_0x42e269;_0x4054b0['channel']=_0x1c1523[_0x15c0('0x24')];_0x3ba168[_0x15c0('0x42')][_0x133274]['on'](_0x15c0('0x43'),function(){logger[_0x15c0('0x29')](_0x15c0('0x44'),_0x133274);stopRouting(_0x133274,_0x2d8ad7,_0x1c1523,_0x3ba168);clearTimeout(_0x27999b);_0x27999b=undefined;_0x4054b0[_0x15c0('0x45')](!![]);if(_0x3ba168[_0x15c0('0x42')][_0x133274]){delete _0x3ba168[_0x15c0('0x42')][_0x133274];}_0x476c12[_0x15c0('0x46')]();});_0x3ba168[_0x15c0('0x42')][_0x133274]['on'](_0x15c0('0x47'),function(){if(_0x3ba168['rules'][_0x133274]){delete _0x3ba168[_0x15c0('0x42')][_0x133274];}});_0x27999b=setTimeout(function(){logger[_0x15c0('0x29')](_0x15c0('0x48'),_0x133274);endRouting(_0x133274,_0x2d8ad7,_0x1c1523,_0x3ba168);clearTimeout(_0x27999b);_0x4054b0['close'](!![]);_0x476c12[_0x15c0('0x49')]();},_0x42e269);switch(_0x2d8ad7[_0x15c0('0x4a')]){case _0x15c0('0x4b'):strategy[_0x15c0('0x4b')](_0x4054b0,_0x2d8ad7,_0x3ba168,_0x1c1523);break;default:strategy['beepall'](_0x4054b0,_0x2d8ad7,_0x3ba168,_0x1c1523);}}else{logger[_0x15c0('0x32')](_0x15c0('0x4c'),_0x133274,_0x254820['name']);_0x476c12[_0x15c0('0x46')]();}}}catch(_0x175cbd){console[_0x15c0('0x4d')](_0x175cbd);logger['error']('[%s][QUEUE]\x20%s',_0x133274,_0x175cbd[_0x15c0('0x4e')]);_0x476c12[_0x15c0('0x46')]();}};}; \ No newline at end of file +var _0x87a1=['createQueue','atimeout','qtimeout','rules','end','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','from','joinAt','queue','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','interaction','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update','update\x20queue\x20report','timeout','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','map','join'];(function(_0x4605da,_0x4d86f8){var _0x26ab6e=function(_0x5e7e2f){while(--_0x5e7e2f){_0x4605da['push'](_0x4605da['shift']());}};_0x26ab6e(++_0x4d86f8);}(_0x87a1,0x1c5));var _0x187a=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x87a1[_0x36dfbd];return _0x4ecad9;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x187a('0x0'));var seqqueue=require(_0x187a('0x1'));var moment=require('moment');var Redis=require(_0x187a('0x2'));var config=require(_0x187a('0x3'));var logger=require(_0x187a('0x4'))(_0x187a('0x5'));var strategy=require('./strategy');config[_0x187a('0x6')]=_[_0x187a('0x7')](config[_0x187a('0x6')],{'host':_0x187a('0x8'),'port':0x18eb});var io=require(_0x187a('0x9'))(new Redis(config[_0x187a('0x6')]));var attributes=['id',_0x187a('0xa'),'account','queue',_0x187a('0xb'),_0x187a('0xc')];function emit(_0x3c1516,_0x41de5f,_0x550060){io['to'](_0x3c1516)['emit'](_0x41de5f,_0x550060);}function emitChannelQueueInteraction(_0x133616,_0xdc6bb9,_0x1fe021,_0x151afc,_0x5efc6b,_0x5ca22d,_0x53546d,_0x56006c){var _0x1267c2=_['clone'](_0x1fe021);_0x1267c2[_0x187a('0xa')]=_0x56006c;_0x1267c2[_0x187a('0xd')]=_0xdc6bb9;_0x1267c2[_0x187a('0xe')]=_0x151afc;_0x1267c2['id']=_0x5efc6b;if(_0x5ca22d){_0x53546d[util['format'](_0x187a('0xf'),_0x133616)][_0x5efc6b]=_[_0x187a('0x10')](_0x1267c2,attributes);}else{delete _0x53546d[util[_0x187a('0x11')]('%sQueuesWaitingInteractions',_0x133616)][_0x5efc6b];}emit(util[_0x187a('0x11')](_0x187a('0x12'),_0x133616,_0xdc6bb9),util[_0x187a('0x11')](_0x187a('0x13'),_0x133616,_0x5ca22d?'save':'remove'),_[_0x187a('0x10')](_0x1267c2,attributes));}var rpc={'openchannelQueueReport':require(_0x187a('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x187a('0x15')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x187a('0x16')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x187a('0x17'),'required':!![],'message':_0x187a('0x18')},'timeout':{'type':_0x187a('0x19'),'message':_0x187a('0x1a')}});function startRouting(_0x476c02,_0x20ce7d,_0x2dd34a,_0x352e0c){if(_0x476c02&&_0x20ce7d&&_0x2dd34a){_0x20ce7d[_0x187a('0x1b')]+=0x1;var _0x27438b={'uniqueid':_0x476c02,'from':_0x2dd34a[_0x187a('0x1c')]?_0x2dd34a[_0x187a('0x1c')]['from']:'','joinAt':moment()[_0x187a('0x11')](_0x187a('0x1d')),'ContactId':_0x2dd34a[_0x187a('0x1e')]?_0x2dd34a[_0x187a('0x1e')]['id']:null,'ListId':_0x2dd34a['list']?_0x2dd34a[_0x187a('0x1f')]['id']:null};_0x27438b[_[_0x187a('0x20')](_0x2dd34a['channel'])+_0x187a('0x21')]=_0x20ce7d['id']||null;_0x27438b[_['upperFirst'](_0x2dd34a[_0x187a('0x22')])+'InteractionId']=_0x2dd34a[_0x187a('0x23')]?_0x2dd34a['interaction']['id']:null;_0x27438b[_['upperFirst'](_0x2dd34a['channel'])+'MessageId']=_0x2dd34a[_0x187a('0x24')]?_0x2dd34a[_0x187a('0x24')]['id']:null;_0x27438b[_[_0x187a('0x20')](_0x2dd34a[_0x187a('0x22')])+(_0x2dd34a['channel']!==_0x187a('0x25')?'AccountId':_0x187a('0x26'))]=_0x2dd34a[_0x187a('0xe')]?_0x2dd34a[_0x187a('0xe')]['id']:null;logger[_0x187a('0x27')](util[_0x187a('0x11')](_0x187a('0x28'),_0x476c02,_0x20ce7d[_0x187a('0x29')]));emitChannelQueueInteraction(_0x2dd34a['channel'],_0x20ce7d[_0x187a('0x29')],_0x27438b,_0x2dd34a[_0x187a('0xe')]['name'],_0x2dd34a[_0x187a('0x24')]['id'],!![],_0x352e0c,_0x20ce7d['id']);if(rpc[_0x2dd34a[_0x187a('0x22')]+'QueueReport']){return rpc[_0x2dd34a[_0x187a('0x22')]+'QueueReport'][_0x187a('0x2a')](_0x27438b)[_0x187a('0x2b')](function(_0x25e68d){logger[_0x187a('0x2c')](_0x187a('0x2d'));});}}}function stopRouting(_0x30e619,_0xb60003,_0x112783,_0x5f3583){if(_0x30e619&&_0xb60003){_0xb60003['waiting']-=0x1;var _0x16b27c={'leaveAt':moment()[_0x187a('0x11')](_0x187a('0x1d')),'acceptAt':moment()[_0x187a('0x11')](_0x187a('0x1d')),'reason':_0x187a('0x2e')};logger['info'](util['format'](_0x187a('0x2f'),_0x30e619,_0xb60003[_0x187a('0x29')]));emitChannelQueueInteraction(_0x112783[_0x187a('0x22')],_0xb60003[_0x187a('0x29')],_0x112783['body'],_0x112783['account'][_0x187a('0x29')],_0x112783['message']['id'],![],_0x5f3583,_0xb60003['id']);if(rpc[_0x112783['channel']+_0x187a('0x30')]){return rpc[_0x112783['channel']+_0x187a('0x30')][_0x187a('0x31')](_0x30e619,_0x16b27c)[_0x187a('0x2b')](function(_0x2bba5e){logger[_0x187a('0x2c')](_0x187a('0x32'));});}}}function endRouting(_0x5266a0,_0x5644b1,_0x15dd83,_0x2dd238){if(_0x5266a0&&_0x5644b1){_0x5644b1['waiting']-=0x1;var _0x3709ea={'leaveAt':moment()[_0x187a('0x11')](_0x187a('0x1d')),'exitAt':moment()[_0x187a('0x11')](_0x187a('0x1d')),'reason':_0x187a('0x33')};logger[_0x187a('0x27')](util[_0x187a('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x5266a0,_0x5644b1[_0x187a('0x29')]));emitChannelQueueInteraction(_0x15dd83['channel'],_0x5644b1['name'],_0x15dd83[_0x187a('0x1c')],_0x15dd83[_0x187a('0xe')]['name'],_0x15dd83[_0x187a('0x24')]['id'],![],_0x2dd238);if(rpc[_0x15dd83[_0x187a('0x22')]+_0x187a('0x30')]){return rpc[_0x15dd83[_0x187a('0x22')]+_0x187a('0x30')][_0x187a('0x31')](_0x5266a0,_0x3709ea)[_0x187a('0x2b')](function(_0x58d659){logger[_0x187a('0x2c')](_0x187a('0x32'));});}}}function handleFindQueue(_0x199aa0){return function(_0x228dab){return _0x228dab[_0x187a('0x29')]['toLowerCase']()===_0x199aa0[_0x187a('0x34')]();};}exports[_0x187a('0x35')]=function(_0x5d0bbb,_0x299b81,_0x516bf5,_0x38937a){return function(_0x4f86be){try{var _0x5a0099={'name':_0x299b81[0x0],'timeout':_0x299b81[0x1]};var _0x1d9153=queue[_0x187a('0x36')](_0x5a0099,{'typecast':!![]});if(_0x1d9153['length']){logger[_0x187a('0x2c')](_0x187a('0x37'),_0x5d0bbb,_[_0x187a('0x38')](_0x1d9153,_0x187a('0x24'))[_0x187a('0x39')](',\x20'));_0x4f86be['stop']();}else{var _0x40fde3=_['find'](_0x516bf5[_0x38937a['channel']+'Queues'],handleFindQueue(_0x5a0099[_0x187a('0x29')]));if(_0x40fde3){startRouting(_0x5d0bbb,_0x40fde3,_0x38937a,_0x516bf5);var _0x50d901=(_0x40fde3[_0x187a('0x33')]||0xa)*0x3e8;var _0x4b21d8=(_0x5a0099[_0x187a('0x33')]||0x14)*0x3e8;var _0x2fa666,_0x2e1249;if(_0x50d901>_0x4b21d8){_0x4b21d8=_0x50d901;}var _0x19a906=seqqueue[_0x187a('0x3a')](_0x50d901);_0x19a906['id']=_0x5d0bbb;_0x19a906[_0x187a('0x3b')]=_0x50d901;_0x19a906[_0x187a('0x3c')]=_0x4b21d8;_0x19a906[_0x187a('0x22')]=_0x38937a[_0x187a('0x22')];_0x516bf5[_0x187a('0x3d')][_0x5d0bbb]['on'](_0x187a('0x3e'),function(){logger[_0x187a('0x27')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x5d0bbb);stopRouting(_0x5d0bbb,_0x40fde3,_0x38937a,_0x516bf5);clearTimeout(_0x2fa666);_0x2fa666=undefined;_0x19a906[_0x187a('0x3f')](!![]);if(_0x516bf5[_0x187a('0x3d')][_0x5d0bbb]){delete _0x516bf5[_0x187a('0x3d')][_0x5d0bbb];}_0x4f86be[_0x187a('0x40')]();});_0x516bf5['rules'][_0x5d0bbb]['on'](_0x187a('0x41'),function(){if(_0x516bf5['rules'][_0x5d0bbb]){delete _0x516bf5[_0x187a('0x3d')][_0x5d0bbb];}});_0x2fa666=setTimeout(function(){logger[_0x187a('0x27')](_0x187a('0x42'),_0x5d0bbb);endRouting(_0x5d0bbb,_0x40fde3,_0x38937a,_0x516bf5);clearTimeout(_0x2fa666);_0x19a906[_0x187a('0x3f')](!![]);_0x4f86be[_0x187a('0x43')]();},_0x4b21d8);switch(_0x40fde3[_0x187a('0x44')]){case _0x187a('0x45'):strategy['rrmemory'](_0x19a906,_0x40fde3,_0x516bf5,_0x38937a);break;default:strategy[_0x187a('0x46')](_0x19a906,_0x40fde3,_0x516bf5,_0x38937a);}}else{logger[_0x187a('0x2c')](_0x187a('0x47'),_0x5d0bbb,_0x5a0099[_0x187a('0x29')]);_0x4f86be['stop']();}}}catch(_0x4ae3ff){console[_0x187a('0x48')](_0x4ae3ff);logger['error']('[%s][QUEUE]\x20%s',_0x5d0bbb,_0x4ae3ff['stack']);_0x4f86be['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 6a4703c..4149d65 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 _0x7656=['busy','busyQueue','showNotification','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel'];(function(_0x4587fa,_0x163c40){var _0x3e7e13=function(_0x315872){while(--_0x315872){_0x4587fa['push'](_0x4587fa['shift']());}};_0x3e7e13(++_0x163c40);}(_0x7656,0x1dc));var _0x6765=function(_0x3e1c43,_0x342cbe){_0x3e1c43=_0x3e1c43-0x0;var _0x282365=_0x7656[_0x3e1c43];return _0x282365;};'use strict';var _=require(_0x6765('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x6765('0x1'))(_0x6765('0x2'));var Agent=function(_0x2cf42b,_0x3aa498,_0x31c671,_0x40fa2c){this[_0x6765('0x3')]=uuid['v4']();this[_0x6765('0x4')]=_0x2cf42b;this[_0x6765('0x5')]=_0x3aa498;this[_0x6765('0x6')]=_0x31c671;this[_0x6765('0x2')]=_0x40fa2c;this[_0x6765('0x4')][_0x6765('0x7')](this[_0x6765('0x8')][_0x6765('0x9')](this),this[_0x6765('0xa')][_0x6765('0x9')](this));this[_0x6765('0x4')]['on'](_0x6765('0xb'),this[_0x6765('0xa')][_0x6765('0x9')](this));this[_0x6765('0x4')]['on'](_0x6765('0xc'),this[_0x6765('0xd')][_0x6765('0x9')](this));};Agent[_0x6765('0xe')][_0x6765('0x7')]=function(){this[_0x6765('0x4')][_0x6765('0x7')](this['handleRun'][_0x6765('0x9')](this),this['handleTimeout']['bind'](this));};Agent['prototype'][_0x6765('0xd')]=function(){this[_0x6765('0xa')](!![]);};Agent[_0x6765('0xe')][_0x6765('0x8')]=function(_0x1b8270){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x6765('0x5')]['id']);if(_[_0x6765('0xf')](this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']])){logger[_0x6765('0x11')](_0x6765('0x12'),this['squeue']['id'],this[_0x6765('0x5')]['id']);setTimeout(this['push'][_0x6765('0x9')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0x6765('0x4')]['id'],this['realtime']['agents'][this['agent']['id']],this['squeue'][_0x6765('0x13')],![])){this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']][_0x6765('0x14')]=!![];this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']][_0x6765('0x15')]=undefined;util[_0x6765('0x16')](this[_0x6765('0x3')],this[_0x6765('0x4')]['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],null,this['routing']);util[_0x6765('0x17')](this['squeue']['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],_0x6765('0x18')+(this[_0x6765('0x2')][_0x6765('0x19')]?':FORCED':''));}else{logger['info'](_0x6765('0x1a'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x6765('0x7')]['bind'](this),0x3e8);}}};Agent[_0x6765('0xe')][_0x6765('0xa')]=function(_0x2afc03){if(_[_0x6765('0xf')](this[_0x6765('0x6')]['agents'][this[_0x6765('0x5')]['id']])){return logger[_0x6765('0x11')](_0x6765('0x12'),this[_0x6765('0x4')]['id'],this[_0x6765('0x5')]['id']);}else{logger[_0x6765('0x11')](_0x6765('0x1b'),this[_0x6765('0x4')]['id'],this[_0x6765('0x5')]['id']);util[_0x6765('0x1c')](this[_0x6765('0x3')],this['squeue']['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],null,this['routing']);this[_0x6765('0x6')][_0x6765('0x10')][this['agent']['id']][_0x6765('0x14')]=![];this['realtime'][_0x6765('0x10')][this[_0x6765('0x5')]['id']]['busyQueue']=undefined;util[_0x6765('0x17')](this[_0x6765('0x4')]['id'],this[_0x6765('0x6')][_0x6765('0x10')][this[_0x6765('0x5')]['id']],_0x2afc03?'STOP':_0x6765('0x1d'));}if(!_0x2afc03){setTimeout(this[_0x6765('0x7')]['bind'](this),0x3e8);}};function agent(_0x480faf,_0x55dd3b,_0x51addd,_0x17b2da){return new Agent(_0x480faf,_0x55dd3b,_0x51addd,_0x17b2da);}module[_0x6765('0x1e')]=agent; \ No newline at end of file +var _0xc80f=['uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','handleTimeout','bind','timeout','drained','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash'];(function(_0x4490e1,_0x2d9991){var _0x265655=function(_0x10652a){while(--_0x10652a){_0x4490e1['push'](_0x4490e1['shift']());}};_0x265655(++_0x2d9991);}(_0xc80f,0x10f));var _0xfc80=function(_0x402d16,_0x5b93ed){_0x402d16=_0x402d16-0x0;var _0x3fe1d8=_0xc80f[_0x402d16];return _0x3fe1d8;};'use strict';var _=require(_0xfc80('0x0'));var uuid=require(_0xfc80('0x1'));var util=require(_0xfc80('0x2'));var logger=require(_0xfc80('0x3'))(_0xfc80('0x4'));var Agent=function(_0x5b2494,_0xa7c631,_0x2583e6,_0x52e701){this[_0xfc80('0x5')]=uuid['v4']();this[_0xfc80('0x6')]=_0x5b2494;this[_0xfc80('0x7')]=_0xa7c631;this[_0xfc80('0x8')]=_0x2583e6;this[_0xfc80('0x4')]=_0x52e701;this['squeue']['push'](this[_0xfc80('0x9')]['bind'](this),this[_0xfc80('0xa')][_0xfc80('0xb')](this));this[_0xfc80('0x6')]['on'](_0xfc80('0xc'),this[_0xfc80('0xa')][_0xfc80('0xb')](this));this[_0xfc80('0x6')]['on'](_0xfc80('0xd'),this['handleDrained'][_0xfc80('0xb')](this));};Agent[_0xfc80('0xe')][_0xfc80('0xf')]=function(){this[_0xfc80('0x6')][_0xfc80('0xf')](this[_0xfc80('0x9')][_0xfc80('0xb')](this),this[_0xfc80('0xa')][_0xfc80('0xb')](this));};Agent[_0xfc80('0xe')][_0xfc80('0x10')]=function(){this[_0xfc80('0xa')](!![]);};Agent[_0xfc80('0xe')][_0xfc80('0x9')]=function(_0x3b5939){logger[_0xfc80('0x11')](_0xfc80('0x12'),this[_0xfc80('0x6')]['id'],this[_0xfc80('0x7')]['id']);if(_['isNil'](this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']])){logger['info'](_0xfc80('0x14'),this[_0xfc80('0x6')]['id'],this[_0xfc80('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0xfc80('0x15')]||util['isAgentAvailable'](this[_0xfc80('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0xfc80('0x6')][_0xfc80('0x16')],![])){this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']][_0xfc80('0x17')]=!![];this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']][_0xfc80('0x18')]=undefined;util['showNotification'](this['notificationId'],this[_0xfc80('0x6')]['id'],this['realtime'][_0xfc80('0x13')][this['agent']['id']],null,this[_0xfc80('0x4')]);util[_0xfc80('0x19')](this[_0xfc80('0x6')]['id'],this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']],_0xfc80('0x1a')+(this[_0xfc80('0x4')][_0xfc80('0x15')]?':FORCED':''));}else{logger[_0xfc80('0x11')](_0xfc80('0x1b'),this['squeue']['id'],this[_0xfc80('0x7')]['id']);setTimeout(this[_0xfc80('0xf')][_0xfc80('0xb')](this),0x3e8);}}};Agent[_0xfc80('0xe')]['handleTimeout']=function(_0x4ef88f){if(_[_0xfc80('0x1c')](this[_0xfc80('0x8')]['agents'][this[_0xfc80('0x7')]['id']])){return logger[_0xfc80('0x11')](_0xfc80('0x14'),this[_0xfc80('0x6')]['id'],this[_0xfc80('0x7')]['id']);}else{logger['info'](_0xfc80('0x1d'),this[_0xfc80('0x6')]['id'],this[_0xfc80('0x7')]['id']);util[_0xfc80('0x1e')](this[_0xfc80('0x5')],this[_0xfc80('0x6')]['id'],this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']],null,this[_0xfc80('0x4')]);this[_0xfc80('0x8')][_0xfc80('0x13')][this['agent']['id']][_0xfc80('0x17')]=![];this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']][_0xfc80('0x18')]=undefined;util[_0xfc80('0x19')](this['squeue']['id'],this[_0xfc80('0x8')][_0xfc80('0x13')][this[_0xfc80('0x7')]['id']],_0x4ef88f?_0xfc80('0x1f'):_0xfc80('0x20'));}if(!_0x4ef88f){setTimeout(this['push'][_0xfc80('0xb')](this),0x3e8);}};function agent(_0x299424,_0x331e71,_0x1f4177,_0x28acde){return new Agent(_0x299424,_0x331e71,_0x1f4177,_0x28acde);}module[_0xfc80('0x21')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 713d9f4..496dc39 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 _0xdf98=['isNil','STOP','TIMEOUT','exports','lodash','./util','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY'];(function(_0x3a53ad,_0x442370){var _0x227d03=function(_0xf3d02a){while(--_0xf3d02a){_0x3a53ad['push'](_0x3a53ad['shift']());}};_0x227d03(++_0x442370);}(_0xdf98,0xcf));var _0x8df9=function(_0x3df822,_0x299495){_0x3df822=_0x3df822-0x0;var _0x4e457d=_0xdf98[_0x3df822];return _0x4e457d;};'use strict';var _=require(_0x8df9('0x0'));var uuid=require('uuid');var util=require(_0x8df9('0x1'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x263e95,_0x27ce98,_0x19edc7,_0xeec2ab){this[_0x8df9('0x2')]=uuid['v4']();this[_0x8df9('0x3')]=_0x263e95;this[_0x8df9('0x4')]=_0x27ce98;this[_0x8df9('0x5')]=_0x19edc7;this[_0x8df9('0x6')]=_0xeec2ab;this['squeue'][_0x8df9('0x7')](this[_0x8df9('0x8')][_0x8df9('0x9')](this),this['handleTimeout']['bind'](this));this[_0x8df9('0x3')]['on']('timeout',this[_0x8df9('0xa')][_0x8df9('0x9')](this));this[_0x8df9('0x3')]['on'](_0x8df9('0xb'),this[_0x8df9('0xc')][_0x8df9('0x9')](this));};Beepall[_0x8df9('0xd')][_0x8df9('0x7')]=function(){this['squeue'][_0x8df9('0x7')](this[_0x8df9('0x8')][_0x8df9('0x9')](this),this['handleTimeout'][_0x8df9('0x9')](this));};Beepall[_0x8df9('0xd')][_0x8df9('0xc')]=function(_0x351d5d){this['handleTimeout'](!![]);};Beepall['prototype'][_0x8df9('0x8')]=function(_0x304ba3){var _0x334a5f=!![];if(!_['isNil'](this[_0x8df9('0x4')])&&!_['isNil'](this[_0x8df9('0x4')]['Agents'])&&this[_0x8df9('0x4')][_0x8df9('0xe')][_0x8df9('0xf')]>0x0){for(var _0x218e76=0x0,_0x119a88;_0x218e760x0){for(var _0x1f4300=0x0,_0x17b680;_0x1f43000x0&&_0x2d3277[_0x41e29f+_0x04c6('0x23')]>=_0x2d3277[_0x41e29f+_0x04c6('0x24')]){writeLog(_0x49c179,_0x2d3277,_0x41e29f[_0x04c6('0x25')]()+_0x04c6('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x1d0d3f,_0x165cb5,_0x4e00fe,_0x264cde,_0x1cd16a){return sendNotification(!![],_0x1d0d3f,_0x165cb5,_0x4e00fe,_0x264cde,_0x1cd16a);};exports['hideNotification']=function(_0x5c9003,_0x115d84,_0x3a6d92,_0x2a191f,_0xbb9e81){return sendNotification(![],_0x5c9003,_0x115d84,_0x3a6d92,_0x2a191f,_0xbb9e81);};exports[_0x04c6('0x27')]=writeLog; \ No newline at end of file +var _0x323f=['getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','writeLog','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','\x20interaction','notificationSound','account','notificationShake','body','queue','msg'];(function(_0x27177c,_0x4c74a6){var _0xed6aa6=function(_0x612e98){while(--_0x612e98){_0x27177c['push'](_0x27177c['shift']());}};_0xed6aa6(++_0x4c74a6);}(_0x323f,0x1ee));var _0xf323=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x323f[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var utils=require('../utils');var Mustache=require(_0xf323('0x1'));var Redis=require(_0xf323('0x2'));var config=require(_0xf323('0x3'));var logger=require(_0xf323('0x4'))(_0xf323('0x5'));config[_0xf323('0x6')]=_[_0xf323('0x7')](config[_0xf323('0x6')],{'host':_0xf323('0x8'),'port':0x18eb});var io=require(_0xf323('0x9'))(new Redis(config['redis']));function emit(_0xb9a667,_0x444cba,_0x1af70d){io['to'](_0xb9a667)[_0xf323('0xa')](_0x444cba,_0x1af70d);}function sendNotification(_0x8abeac,_0x3c416a,_0x105b93,_0x2b24a2,_0x10d1ff,_0x21e82e){io['to'](util[_0xf323('0xb')](_0xf323('0xc'),_0x2b24a2[_0xf323('0xd')]))[_0xf323('0xa')](_0xf323('0xe'),_0x2b24a2);var _0xb6ec37=_0x21e82e||{};var _0x11a363=_0x105b93['split']('.');var _0x1b6a09={'uniqueid':_0x3c416a,'channel':_0x11a363[0x0],'id':_0x11a363[0x1],'title':_0x11a363[0x0]+_0xf323('0xf'),'interactionId':_0x11a363[0x2],'queue':_0x10d1ff?_0x10d1ff[_0xf323('0xd')]:null,'sound':_0xb6ec37['account'][_0xf323('0x10')],'shake':_0xb6ec37[_0xf323('0x11')][_0xf323('0x12')]};try{if(!_0xb6ec37[_0xf323('0x13')]){_0xb6ec37[_0xf323('0x13')]={};}if(_0x10d1ff){_0xb6ec37[_0xf323('0x13')]['queue']=_0x10d1ff;}else if(_0xb6ec37['body'][_0xf323('0x14')]){delete _0xb6ec37[_0xf323('0x13')][_0xf323('0x14')];}_0x1b6a09[_0xf323('0x15')]=utils[_0xf323('0x16')](_0xb6ec37['account'][_0xf323('0x17')],_0xb6ec37);}catch(_0x1632ad){_0x1b6a09[_0xf323('0x15')]=_0xf323('0x18');logger['error'](util[_0xf323('0xb')](_0xf323('0x19'),_0x3c416a,_0x1632ad[_0xf323('0x1a')]));}io['to'](util[_0xf323('0xb')]('user:%s',_0x2b24a2[_0xf323('0xd')]))[_0xf323('0xa')](util['format'](_0xf323('0x1b'),_0x8abeac?_0xf323('0x1c'):_0xf323('0x1d')),_0x1b6a09);}function writeLog(_0x183ce0,_0x58e22b,_0xdc7891){return logger[_0xf323('0x1e')](util[_0xf323('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x183ce0,_0x58e22b[_0xf323('0xd')],_0xdc7891));}exports[_0xf323('0x1f')]=function(_0x3e1c49,_0x3450d6,_0x13ec1f,_0xa3362c){if(_0x3450d6[_0xf323('0x20')]){writeLog(_0x3e1c49,_0x3450d6,_0xf323('0x21'));return![];}if(!_0x3450d6[_0xf323('0x22')]){writeLog(_0x3e1c49,_0x3450d6,'OFFLINE');return![];}if(_0x3450d6[_0x13ec1f+_0xf323('0x23')]){writeLog(_0x3e1c49,_0x3450d6,_0xf323('0x24'));return![];}if(_0xa3362c&&_0x3450d6[_0xf323('0x25')](_0x13ec1f+_0xf323('0x26'))&&_0x3450d6[_0xf323('0x25')](_0x13ec1f+_0xf323('0x27'))){if(_0x3450d6[_0x13ec1f+'Capacity']>0x0&&_0x3450d6[_0x13ec1f+_0xf323('0x27')]>=_0x3450d6[_0x13ec1f+'Capacity']){writeLog(_0x3e1c49,_0x3450d6,_0x13ec1f[_0xf323('0x28')]()+_0xf323('0x29'));return![];}}return!![];};exports['showNotification']=function(_0x46663b,_0x3c95ce,_0x2b6254,_0x3dcf65,_0x46e3b1){return sendNotification(!![],_0x46663b,_0x3c95ce,_0x2b6254,_0x3dcf65,_0x46e3b1);};exports['hideNotification']=function(_0x44c944,_0x34b536,_0x12c7d5,_0x30a5d7,_0x4260f3){return sendNotification(![],_0x44c944,_0x34b536,_0x12c7d5,_0x30a5d7,_0x4260f3);};exports[_0xf323('0x2a')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index f200e59..712aa46 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 _0x0fa5=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','message','getMustacheRender','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0fa5,0x132));var _0x50fa=function(_0x1d99a1,_0x2baa4b){_0x1d99a1=_0x1d99a1-0x0;var _0x46571b=_0x0fa5[_0x1d99a1];return _0x46571b;};'use strict';var schema=require(_0x50fa('0x0'));var sh=require(_0x50fa('0x1'));var _=require(_0x50fa('0x2'));var utils=require(_0x50fa('0x3'));var logger=require(_0x50fa('0x4'))(_0x50fa('0x5'));var system=schema({'command':{'type':_0x50fa('0x6'),'required':!![],'message':_0x50fa('0x7')}});exports[_0x50fa('0x8')]=function(_0x4d38a8,_0x5be315){return function(_0x375033){try{var _0x291683={'command':_0x5be315[0x0]};var _0x573dc7=system[_0x50fa('0x0')](_0x291683,{'typecast':!![]});if(_0x573dc7['length']){logger['error'](_0x50fa('0x9'),_0x4d38a8,_['map'](_0x573dc7,_0x50fa('0xa'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4d38a8);_0x375033['next']();}else{var _0x47512b=this;var _0x4f7d23=utils[_0x50fa('0xb')](_0x5be315[0x0],this);logger[_0x50fa('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x4d38a8,_0x4f7d23);sh[_0x50fa('0xd')](_[_0x50fa('0xe')](_0x4f7d23),function(_0x3580e0,_0x1c5f96){logger[_0x50fa('0xc')](_0x50fa('0xf'),_0x4d38a8,_0x3580e0);if(_0x3580e0==0x0){var _0x156865=_0x1c5f96[_0x50fa('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x50fa('0x11')](_0x5be315[0x1])||_['isEmpty'](_0x5be315[0x1])){logger['info'](_0x50fa('0x12'),_0x4d38a8);_0x47512b[_0x50fa('0x13')][_0x5be315[0x1]]=_0x156865;}else{logger[_0x50fa('0xc')](_0x50fa('0x14'),_0x4d38a8,_0x5be315[0x1],_0x156865);_0x47512b[_0x50fa('0x13')][_0x5be315[0x1]]=_0x156865;}}_0x375033[_0x50fa('0x15')]();});}}catch(_0x1e3245){logger[_0x50fa('0x16')](_0x50fa('0x9'),_0x4d38a8,_[_0x50fa('0x17')](_0x1e3245)?JSON[_0x50fa('0x18')](_0x1e3245):_0x1e3245);logger[_0x50fa('0xc')](_0x50fa('0x19'),_0x4d38a8);_0x375033[_0x50fa('0x15')]();}};}; \ No newline at end of file +var _0xb3ed=['body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','shelljs','lodash','./utils','../../../../config/logger','routing','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3ed,0x173));var _0xdb3e=function(_0x3f1b3f,_0x4df181){_0x3f1b3f=_0x3f1b3f-0x0;var _0x5688e4=_0xb3ed[_0x3f1b3f];return _0x5688e4;};'use strict';var schema=require('validate');var sh=require(_0xdb3e('0x0'));var _=require(_0xdb3e('0x1'));var utils=require(_0xdb3e('0x2'));var logger=require(_0xdb3e('0x3'))(_0xdb3e('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xdb3e('0x5')]=function(_0xc8422e,_0x38d8ce){return function(_0x31fba1){try{var _0x408f9b={'command':_0x38d8ce[0x0]};var _0x430119=system[_0xdb3e('0x6')](_0x408f9b,{'typecast':!![]});if(_0x430119['length']){logger[_0xdb3e('0x7')](_0xdb3e('0x8'),_0xc8422e,_[_0xdb3e('0x9')](_0x430119,_0xdb3e('0xa'))[_0xdb3e('0xb')](',\x20'));logger['info'](_0xdb3e('0xc'),_0xc8422e);_0x31fba1['next']();}else{var _0x460847=this;var _0x4f3843=utils[_0xdb3e('0xd')](_0x38d8ce[0x0],this);logger[_0xdb3e('0xe')](_0xdb3e('0xf'),_0xc8422e,_0x4f3843);sh[_0xdb3e('0x10')](_['trim'](_0x4f3843),function(_0x367c8c,_0x148d9d){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xc8422e,_0x367c8c);if(_0x367c8c==0x0){var _0xa97ab0=_0x148d9d[_0xdb3e('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x38d8ce[0x1])||_[_0xdb3e('0x12')](_0x38d8ce[0x1])){logger[_0xdb3e('0xe')](_0xdb3e('0x13'),_0xc8422e);_0x460847[_0xdb3e('0x14')][_0x38d8ce[0x1]]=_0xa97ab0;}else{logger[_0xdb3e('0xe')](_0xdb3e('0x15'),_0xc8422e,_0x38d8ce[0x1],_0xa97ab0);_0x460847[_0xdb3e('0x14')][_0x38d8ce[0x1]]=_0xa97ab0;}}_0x31fba1['next']();});}}catch(_0x45d015){logger[_0xdb3e('0x7')]('[%s][SYSTEM]\x20%s',_0xc8422e,_['isObject'](_0x45d015)?JSON['stringify'](_0x45d015):_0x45d015);logger[_0xdb3e('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0xc8422e);_0x31fba1[_0xdb3e('0x16')]();}};}; \ 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 86de99c..a176a8d 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 _0x2a09=['error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','next','isObject','stringify','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length'];(function(_0x5e8dbf,_0x38d146){var _0x10c24c=function(_0x2409ea){while(--_0x2409ea){_0x5e8dbf['push'](_0x5e8dbf['shift']());}};_0x10c24c(++_0x38d146);}(_0x2a09,0x198));var _0x92a0=function(_0xae2489,_0x55adfb){_0xae2489=_0xae2489-0x0;var _0x4a40c7=_0x2a09[_0xae2489];return _0x4a40c7;};'use strict';var schema=require(_0x92a0('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x92a0('0x1')),'openchannelInteraction':require(_0x92a0('0x2')),'smsInteraction':require(_0x92a0('0x3')),'mailInteraction':require(_0x92a0('0x4')),'faxInteraction':require(_0x92a0('0x5')),'whatsappInteraction':require(_0x92a0('0x6'))};var logger=require(_0x92a0('0x7'))(_0x92a0('0x8'));var tag=schema({'tag':{'type':_0x92a0('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x92a0('0xa')]=function(_0x5a2e80,_0x551e33,_0x420296,_0x3d598d){return function(_0x5d3e15){try{var _0x5d3881={'tag':_0x551e33[0x0]};var _0x4cb1dd=tag[_0x92a0('0x0')](_0x5d3881,{'typecast':!![]});if(_0x4cb1dd[_0x92a0('0xb')]){logger[_0x92a0('0xc')](_0x92a0('0xd'),_0x5a2e80,_['map'](_0x4cb1dd,_0x92a0('0xe'))[_0x92a0('0xf')](',\x20'));logger[_0x92a0('0x10')](_0x92a0('0x11'),_0x5a2e80);_0x5d3e15['next']();}else{var _0x115976={'ids':[_0x551e33[0x0]]};if(rpc[_0x3d598d[_0x92a0('0x12')]+_0x92a0('0x13')]){rpc[_0x3d598d[_0x92a0('0x12')]+'Interaction'][_0x92a0('0x14')](_0x3d598d[_0x92a0('0x15')]['id'],_0x115976)[_0x92a0('0x16')](function(_0x356040){logger[_0x92a0('0x10')](_0x92a0('0x17'),_0x5a2e80,_0x551e33[0x1],_0x3d598d[_0x92a0('0x12')],_0x3d598d[_0x92a0('0x15')]['id']);})[_0x92a0('0x18')](function(_0x56f7f6){logger[_0x92a0('0xc')](_0x92a0('0xd'),_0x5a2e80,JSON['stringify'](_0x56f7f6));logger[_0x92a0('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a2e80);})['finally'](function(){_0x5d3e15[_0x92a0('0x19')]();});}}}catch(_0x427c03){logger[_0x92a0('0xc')](_0x92a0('0xd'),_0x5a2e80,_[_0x92a0('0x1a')](_0x427c03)?JSON[_0x92a0('0x1b')](_0x427c03):_0x427c03);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a2e80);_0x5d3e15[_0x92a0('0x19')]();}};}; \ No newline at end of file +var _0xdfaa=['length','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','error','[%s][TAG]\x20%s','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','consequence'];(function(_0x29268f,_0x17a5dc){var _0x195c54=function(_0x238fa8){while(--_0x238fa8){_0x29268f['push'](_0x29268f['shift']());}};_0x195c54(++_0x17a5dc);}(_0xdfaa,0x6d));var _0xadfa=function(_0x7f6c37,_0x612623){_0x7f6c37=_0x7f6c37-0x0;var _0x37f7db=_0xdfaa[_0x7f6c37];return _0x37f7db;};'use strict';var schema=require(_0xadfa('0x0'));var _=require(_0xadfa('0x1'));var rpc={'chatInteraction':require(_0xadfa('0x2')),'openchannelInteraction':require(_0xadfa('0x3')),'smsInteraction':require(_0xadfa('0x4')),'mailInteraction':require(_0xadfa('0x5')),'faxInteraction':require(_0xadfa('0x6')),'whatsappInteraction':require(_0xadfa('0x7'))};var logger=require(_0xadfa('0x8'))('routing');var tag=schema({'tag':{'type':_0xadfa('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xadfa('0xa')]=function(_0x5991f5,_0x300436,_0x5bd9e2,_0x56fe09){return function(_0x17b81a){try{var _0x2e3ba1={'tag':_0x300436[0x0]};var _0x47637c=tag[_0xadfa('0x0')](_0x2e3ba1,{'typecast':!![]});if(_0x47637c[_0xadfa('0xb')]){logger['error']('[%s][TAG]\x20%s',_0x5991f5,_[_0xadfa('0xc')](_0x47637c,_0xadfa('0xd'))[_0xadfa('0xe')](',\x20'));logger[_0xadfa('0xf')](_0xadfa('0x10'),_0x5991f5);_0x17b81a[_0xadfa('0x11')]();}else{var _0x5e49a8={'ids':[_0x300436[0x0]]};if(rpc[_0x56fe09[_0xadfa('0x12')]+_0xadfa('0x13')]){rpc[_0x56fe09[_0xadfa('0x12')]+_0xadfa('0x13')][_0xadfa('0x14')](_0x56fe09[_0xadfa('0x15')]['id'],_0x5e49a8)[_0xadfa('0x16')](function(_0x5e1f57){logger['info'](_0xadfa('0x17'),_0x5991f5,_0x300436[0x1],_0x56fe09[_0xadfa('0x12')],_0x56fe09['interaction']['id']);})[_0xadfa('0x18')](function(_0x4a5e31){logger[_0xadfa('0x19')](_0xadfa('0x1a'),_0x5991f5,JSON[_0xadfa('0x1b')](_0x4a5e31));logger[_0xadfa('0xf')](_0xadfa('0x10'),_0x5991f5);})[_0xadfa('0x1c')](function(){_0x17b81a[_0xadfa('0x11')]();});}}}catch(_0xc54e2f){logger[_0xadfa('0x19')](_0xadfa('0x1a'),_0x5991f5,_[_0xadfa('0x1d')](_0xc54e2f)?JSON[_0xadfa('0x1b')](_0xc54e2f):_0xc54e2f);logger[_0xadfa('0xf')](_0xadfa('0x10'),_0x5991f5);_0x17b81a[_0xadfa('0x11')]();}};}; \ 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 9daf291..9eda447 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(_0x2168c1,_0x166138){var _0x18c3c0=function(_0x3335c3){while(--_0x3335c3){_0x2168c1['push'](_0x2168c1['shift']());}};_0x18c3c0(++_0x166138);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4a569c,_0x81fe1b){var _0x8e9d2a=function(_0x2da2ef){while(--_0x2da2ef){_0x4a569c['push'](_0x4a569c['shift']());}};_0x8e9d2a(++_0x81fe1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 03132c9..0111f2e 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 _0x8109=['length','join','app','.js','autoreply','split','channel','mail','push','slice','appdata','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','stack','agent','agents','busy','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8109,0xa9));var _0x9810=function(_0xecc3e8,_0x459433){_0xecc3e8=_0xecc3e8-0x0;var _0x5c236c=_0x8109[_0xecc3e8];return _0x5c236c;};'use strict';var _=require(_0x9810('0x0'));var util=require('util');var path=require(_0x9810('0x1'));var fs=require('fs');var jayson=require(_0x9810('0x2'));var BPromise=require('bluebird');var uuid=require(_0x9810('0x3'));var config=require(_0x9810('0x4'));var logger=require(_0x9810('0x5'))(_0x9810('0x6'));var rpc={'openchannelQueueReport':require(_0x9810('0x7')),'mailQueueReport':require(_0x9810('0x8')),'chatQueueReport':require(_0x9810('0x9')),'smsQueueReport':require(_0x9810('0xa')),'faxQueueReport':require(_0x9810('0xb')),'whatsappQueueReport':require(_0x9810('0xc'))};var RuleEngine=require(_0x9810('0xd'));function getId(_0x5e367b,_0x3b0e0d,_0xafe932){return util[_0x9810('0xe')](_0x9810('0xf'),_0x5e367b,_0x3b0e0d||0x0,_0xafe932||0x0);}function getIntervals(_0xd9e6d,_0x57707e){var _0x3d2f90=[];if(!_[_0x9810('0x10')](_0x57707e[_0x9810('0x11')])&&!_['isNil'](_0xd9e6d[_0x57707e[_0x9810('0x11')]])&&!_['isNil'](_0xd9e6d[_0x57707e['IntervalId']][_0x9810('0x12')])){_0x3d2f90=_[_0x9810('0x13')](_0xd9e6d[_0x57707e[_0x9810('0x11')]][_0x9810('0x12')],_0x9810('0x14'));}else if(!_[_0x9810('0x10')](_0x57707e['interval'])){_0x3d2f90=[_0x57707e[_0x9810('0x14')]];}return _0x3d2f90;}exports[_0x9810('0x15')]=function(_0x3c74b0){_0x3c74b0[_0x9810('0x16')]={};return new BPromise(function(_0x2d52b1,_0x333ad4){var _0x22366c={'Start':function(_0x5c39eb){var _0x3796e2=this;return new Promise(function(_0x1a4735,_0xd6188c){if(_0x5c39eb){try{var _0x260be2=[];var _0x59d8e0=getId(_0x5c39eb['channel'],_0x5c39eb[_0x9810('0x17')]?_0x5c39eb['message']['id']:0x0,_0x5c39eb['interaction']?_0x5c39eb[_0x9810('0x18')]['id']:0x0);if(_0x5c39eb[_0x9810('0x19')]&&_[_0x9810('0x1a')](_0x5c39eb[_0x9810('0x19')])&&_0x5c39eb[_0x9810('0x19')][_0x9810('0x1b')]){for(var _0x5c4a9b=0x0;_0x5c4a9b<_0x5c39eb['applications']['length'];_0x5c4a9b+=0x1){var _0x3e5fac=_0x5c39eb[_0x9810('0x19')][_0x5c4a9b];if(fs['existsSync'](path[_0x9810('0x1c')](__dirname,_0x9810('0x19'),_0x3e5fac[_0x9810('0x1d')]+_0x9810('0x1e')))){var _0x1ba97a=[];switch(_0x3e5fac[_0x9810('0x1d')]['toLowerCase']()){case _0x9810('0x1f'):var _0x164c42=_0x3e5fac['appdata'][_0x9810('0x20')](',');if(_0x5c39eb[_0x9810('0x21')]===_0x9810('0x22')){_0x1ba97a['push'](_0x164c42[0x0]);_0x1ba97a[_0x9810('0x23')](_0x164c42[0x1]);_0x1ba97a['push'](_0x164c42[_0x9810('0x24')](0x2,_0x164c42['length'])[_0x9810('0x1c')](','));}else{_0x1ba97a[_0x9810('0x23')](_0x164c42[0x0]);_0x1ba97a[_0x9810('0x23')](_0x164c42[_0x9810('0x24')](0x1,_0x164c42['length'])['join'](','));}break;case'dialogflow':var _0x137b47=_0x3e5fac[_0x9810('0x25')]['split'](',');_0x1ba97a[_0x9810('0x23')](_0x137b47[0x0]);_0x1ba97a['push'](_0x137b47[0x1]);_0x1ba97a['push'](_0x137b47[_0x9810('0x24')](0x2,_0x137b47[_0x9810('0x1b')])[_0x9810('0x1c')](','));break;case _0x9810('0x26'):var _0x17f314=_0x3e5fac[_0x9810('0x25')]['split'](',');_0x1ba97a[_0x9810('0x23')](_0x17f314[0x0]);_0x1ba97a[_0x9810('0x23')](_0x17f314[0x1]);_0x1ba97a[_0x9810('0x23')](_0x17f314[0x2]);_0x1ba97a['push'](_0x17f314[0x3]);_0x1ba97a[_0x9810('0x23')](_0x17f314['slice'](0x4,_0x17f314[_0x9810('0x1b')])['join'](','));break;case _0x9810('0x27'):var _0x167058=_0x3e5fac[_0x9810('0x25')][_0x9810('0x20')](',');_0x1ba97a[_0x9810('0x23')](_0x167058[0x0]);_0x1ba97a[_0x9810('0x23')](_0x167058[0x1]);_0x1ba97a['push'](_0x167058[0x2]);_0x1ba97a[_0x9810('0x23')](_0x167058[0x3]);_0x1ba97a[_0x9810('0x23')](_0x167058[_0x9810('0x24')](0x4,_0x167058[_0x9810('0x1b')])['join'](','));break;case'message':_0x1ba97a['push'](_0x3e5fac['appdata']);break;case'tag':_0x1ba97a['push'](_0x3e5fac[_0x9810('0x28')]);_0x1ba97a[_0x9810('0x23')](_0x3e5fac[_0x9810('0x25')]);break;default:_0x1ba97a=_[_0x9810('0x10')](_0x3e5fac[_0x9810('0x25')])?[]:_0x3e5fac['appdata'][_0x9810('0x20')](',');}var _0x51effd={'id':util[_0x9810('0xe')](_0x9810('0x29'),_0x59d8e0,_0x3e5fac['id'],_0x3e5fac['app']),'condition':require(_0x9810('0x2a'))[_0x9810('0x2b')](_0x59d8e0,getIntervals(_0x3c74b0[_0x9810('0x2c')],_0x3e5fac),_0x3c74b0),'consequence':require(_0x9810('0x2d')+_0x3e5fac[_0x9810('0x1d')])[_0x9810('0x2e')](_0x59d8e0,_0x1ba97a,_0x3c74b0,_0x5c39eb),'p':_0x3e5fac[_0x9810('0x2f')]||0x0};logger[_0x9810('0x30')](_0x9810('0x31'),_0x51effd['id'],'on\x20interval',getIntervals(_0x3c74b0[_0x9810('0x2c')],_0x3e5fac)[_0x9810('0x1c')]('\x20|\x20'));_0x260be2[_0x9810('0x23')](_0x51effd);}else{logger[_0x9810('0x32')](_0x9810('0x33'),path[_0x9810('0x1c')](__dirname,_0x9810('0x19'),_0x3e5fac['app']+_0x9810('0x1e')));}}_0x3c74b0[_0x9810('0x16')][_0x59d8e0]=new RuleEngine(_0x260be2);_0x3c74b0[_0x9810('0x16')][_0x59d8e0][_0x9810('0x34')](_0x5c39eb,function(_0x1ca47b){logger[_0x9810('0x30')](_0x9810('0x35'),JSON[_0x9810('0x36')](_0x1ca47b[_0x9810('0x37')]));if(_0x3c74b0[_0x9810('0x16')][_0x59d8e0]){_0x3c74b0[_0x9810('0x16')][_0x59d8e0]['emit'](_0x9810('0x38'));}});return _0x1a4735({'code':0xc8,'message':_0x5c39eb});}else{logger[_0x9810('0x30')]('No\x20applications\x20to\x20execute');return _0x1a4735({'code':0xc8,'message':_0x5c39eb});}}catch(_0x4afdd8){logger[_0x9810('0x32')](_0x4afdd8[_0x9810('0x39')]);return _0xd6188c(_0x3796e2[_0x9810('0x32')](0x1f4,_0x4afdd8));}}return _0xd6188c('routing\x20is\x20empty');});},'AcceptMessage':function(_0x132309){var _0x1b5989=this;return new Promise(function(_0xf4541a,_0x43640){if(_0x132309[_0x9810('0x3a')]&&_0x132309[_0x9810('0x3a')]['id']){if(_0x3c74b0[_0x9810('0x3b')][_0x132309[_0x9810('0x3a')]['id']]){_0x3c74b0[_0x9810('0x3b')][_0x132309[_0x9810('0x3a')]['id']][_0x9810('0x3c')]=![];_0x3c74b0[_0x9810('0x3b')][_0x132309['agent']['id']]['busyQueue']=undefined;}}if(_0x132309[_0x9810('0x17')]&&_0x132309[_0x9810('0x17')]['id']){try{var _0x359865=getId(_0x132309[_0x9810('0x21')],_0x132309[_0x9810('0x17')]?_0x132309['message']['id']:0x0,_0x132309[_0x9810('0x18')]?_0x132309[_0x9810('0x18')]['id']:0x0);if(_0x3c74b0['rules'][_0x359865]){_0x3c74b0[_0x9810('0x16')][_0x359865][_0x9810('0x3d')](_0x9810('0x3e'));if(rpc[_0x132309[_0x9810('0x21')]+_0x9810('0x3f')]){rpc[_0x132309[_0x9810('0x21')]+_0x9810('0x3f')][_0x9810('0x40')](_0x359865,{'UserId':_0x132309[_0x9810('0x17')][_0x9810('0x41')]})[_0x9810('0x42')](function(_0x99ec07){logger[_0x9810('0x32')](_0x9810('0x43'));});}}return _0xf4541a({'code':0xc8,'message':_0x132309});}catch(_0x781a8b){logger[_0x9810('0x32')](_0x781a8b[_0x9810('0x39')]);return _0x43640(_0x1b5989[_0x9810('0x32')](0x1f4,_0x781a8b));}}logger[_0x9810('0x32')]('message\x20is\x20empty');return _0x43640(_0x1b5989[_0x9810('0x32')](0x1f4,_0x9810('0x44')));});},'RejectMessage':function(_0x2fd6ea){var _0x42db0a=this;return new Promise(function(_0x3c8ef2,_0x283630){if(_0x2fd6ea[_0x9810('0x3a')]&&_0x2fd6ea[_0x9810('0x3a')]['id']){try{if(_0x3c74b0[_0x9810('0x3b')][_0x2fd6ea[_0x9810('0x3a')]['id']]){_0x3c74b0[_0x9810('0x3b')][_0x2fd6ea[_0x9810('0x3a')]['id']][_0x9810('0x3c')]=![];_0x3c74b0[_0x9810('0x3b')][_0x2fd6ea[_0x9810('0x3a')]['id']][_0x9810('0x45')]=undefined;}return _0x3c8ef2({'code':0xc8,'message':_0x2fd6ea});}catch(_0xb2ffc7){logger[_0x9810('0x32')](_0xb2ffc7['stack']);return _0x283630(_0x42db0a[_0x9810('0x32')](0x1f4,_0xb2ffc7));}}logger[_0x9810('0x32')](_0x9810('0x44'));return _0x283630(_0x42db0a[_0x9810('0x32')](0x1f4,_0x9810('0x44')));});},'AbandonInteraction':function(_0x56b8a3){var _0x2061bc=this;return new Promise(function(_0x2184f8,_0x2b7e10){if(_0x56b8a3[_0x9810('0x21')]&&_0x56b8a3['interaction']&&_0x56b8a3[_0x9810('0x18')]['id']){try{var _0x1151c2=getId(_0x56b8a3[_0x9810('0x21')],_0x56b8a3['message']?_0x56b8a3['message']['id']:0x0,_0x56b8a3[_0x9810('0x18')]?_0x56b8a3[_0x9810('0x18')]['id']:0x0);if(_0x3c74b0[_0x9810('0x16')][_0x1151c2]){_0x3c74b0[_0x9810('0x16')][_0x1151c2][_0x9810('0x3d')](_0x9810('0x3e'));}return _0x2184f8({'code':0xc8,'message':_0x56b8a3});}catch(_0x442f14){logger[_0x9810('0x32')](_0x442f14['stack']);return _0x2b7e10(_0x2061bc[_0x9810('0x32')](0x1f4,_0x442f14));}}logger[_0x9810('0x32')](_0x9810('0x44'));return _0x2b7e10(_0x2061bc['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x586864){var _0x556085=this;return new Promise(function(_0x3b9518,_0x1a59c0){if(_0x3c74b0[_0x9810('0x3b')]['hasOwnProperty'](_0x586864['id'])){for(var _0x4d5c8f in _0x586864[_0x9810('0x46')]){if(_0x586864[_0x9810('0x46')][_0x9810('0x47')](_0x4d5c8f)){if(_0x3c74b0[_0x9810('0x3b')][_0x586864['id']]['hasOwnProperty'](_0x4d5c8f+'CurrentCapacity')){_0x3c74b0['agents'][_0x586864['id']][_0x4d5c8f+_0x9810('0x48')]=parseInt(_0x586864[_0x9810('0x46')][_0x4d5c8f],0xa);}}}_0x3c74b0['agents'][_0x586864['id']][_0x9810('0x49')]();return _0x3b9518({'code':0xc8,'message':_0x3c74b0[_0x9810('0x3b')][_0x586864['id']]});}else{return _0x1a59c0(_0x556085[_0x9810('0x32')](0x1f4,_0x9810('0x4a')));}});},'Agents':function(_0xfe18ab){return new Promise(function(_0x5b3f37,_0xa1b3a2){var _0x36fc91=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x3b')]);_0x5b3f37({'count':_0x36fc91[_0x9810('0x1b')],'rows':_0x36fc91});});},'ChatQueues':function(_0x232891){return new Promise(function(_0xdfa02,_0x1c3d70){var _0x5ceac9=[];for(var _0x3fd52b in _0x3c74b0[_0x9810('0x4c')]){if(_0x3c74b0[_0x9810('0x4c')]['hasOwnProperty'](_0x3fd52b)){var _0x3772d4=_0x3c74b0[_0x9810('0x4c')][_0x3fd52b];var _0x11e3d0={'id':_0x3772d4['id'],'available':_0x3772d4[_0x9810('0x4d')],'loggedIn':_0x3772d4[_0x9810('0x4e')],'name':_0x3772d4[_0x9810('0x4f')],'paused':_0x3772d4['paused'],'waiting':_0x3772d4[_0x9810('0x50')]};_0x5ceac9[_0x9810('0x23')](_0x11e3d0);}}_0xdfa02({'count':_0x5ceac9[_0x9810('0x1b')],'rows':_0x5ceac9});});},'MailQueues':function(_0x2dbd93){return new Promise(function(_0x4a4808,_0x304516){var _0x588fba=[];for(var _0x1757b3 in _0x3c74b0[_0x9810('0x51')]){if(_0x3c74b0[_0x9810('0x51')][_0x9810('0x47')](_0x1757b3)){var _0x1d5786=_0x3c74b0[_0x9810('0x51')][_0x1757b3];var _0x2c053e={'id':_0x1d5786['id'],'available':_0x1d5786[_0x9810('0x4d')],'loggedIn':_0x1d5786[_0x9810('0x4e')],'name':_0x1d5786[_0x9810('0x4f')],'paused':_0x1d5786['paused'],'waiting':_0x1d5786[_0x9810('0x50')]};_0x588fba['push'](_0x2c053e);}}_0x4a4808({'count':_0x588fba[_0x9810('0x1b')],'rows':_0x588fba});});},'OpenchannelQueues':function(_0x542f07){return new Promise(function(_0x326c23,_0x4804fd){var _0x132617=[];for(var _0x4d3920 in _0x3c74b0[_0x9810('0x52')]){if(_0x3c74b0['openchannelQueues'][_0x9810('0x47')](_0x4d3920)){var _0x1dca5b=_0x3c74b0[_0x9810('0x52')][_0x4d3920];var _0x2fd327={'id':_0x1dca5b['id'],'available':_0x1dca5b[_0x9810('0x4d')],'loggedIn':_0x1dca5b['loggedIn'],'name':_0x1dca5b[_0x9810('0x4f')],'paused':_0x1dca5b[_0x9810('0x53')],'waiting':_0x1dca5b[_0x9810('0x50')]};_0x132617['push'](_0x2fd327);}}_0x326c23({'count':_0x132617['length'],'rows':_0x132617});});},'SmsQueues':function(_0x2877ba){return new Promise(function(_0x231c1f,_0x54a368){var _0x3a9aae=[];for(var _0x44f1b1 in _0x3c74b0['smsQueues']){if(_0x3c74b0[_0x9810('0x54')][_0x9810('0x47')](_0x44f1b1)){var _0x21e983=_0x3c74b0[_0x9810('0x54')][_0x44f1b1];var _0x30016b={'id':_0x21e983['id'],'available':_0x21e983[_0x9810('0x4d')],'loggedIn':_0x21e983['loggedIn'],'name':_0x21e983[_0x9810('0x4f')],'paused':_0x21e983['paused'],'waiting':_0x21e983[_0x9810('0x50')]};_0x3a9aae[_0x9810('0x23')](_0x30016b);}}_0x231c1f({'count':_0x3a9aae[_0x9810('0x1b')],'rows':_0x3a9aae});});},'FaxQueues':function(_0x134fb8){return new Promise(function(_0x49867f,_0x17a3e6){var _0x54f9eb=[];for(var _0x1eba47 in _0x3c74b0[_0x9810('0x55')]){if(_0x3c74b0[_0x9810('0x55')][_0x9810('0x47')](_0x1eba47)){var _0x337b50=_0x3c74b0[_0x9810('0x55')][_0x1eba47];var _0x130b0f={'id':_0x337b50['id'],'available':_0x337b50['available'],'loggedIn':_0x337b50['loggedIn'],'name':_0x337b50[_0x9810('0x4f')],'paused':_0x337b50['paused'],'waiting':_0x337b50[_0x9810('0x50')]};_0x54f9eb['push'](_0x130b0f);}}_0x49867f({'count':_0x54f9eb['length'],'rows':_0x54f9eb});});},'WhatsappQueues':function(_0x57a2fd){return new Promise(function(_0x2da6d7,_0x4b76be){var _0xa50ad=[];for(var _0x4f9478 in _0x3c74b0[_0x9810('0x56')]){if(_0x3c74b0[_0x9810('0x56')][_0x9810('0x47')](_0x4f9478)){var _0x58c08a=_0x3c74b0[_0x9810('0x56')][_0x4f9478];var _0x5d9b0d={'id':_0x58c08a['id'],'available':_0x58c08a[_0x9810('0x4d')],'loggedIn':_0x58c08a['loggedIn'],'name':_0x58c08a[_0x9810('0x4f')],'paused':_0x58c08a['paused'],'waiting':_0x58c08a[_0x9810('0x50')]};_0xa50ad['push'](_0x5d9b0d);}}_0x2da6d7({'count':_0xa50ad['length'],'rows':_0xa50ad});});},'ChatQueuesWaitingInteractions':function(_0x39e363){return new Promise(function(_0x3ad0f4,_0x1f953f){var _0x474800=_['values'](_0x3c74b0[_0x9810('0x57')]);_0x3ad0f4({'count':_0x474800[_0x9810('0x1b')],'rows':_0x474800});});},'MailQueuesWaitingInteractions':function(_0x280ef8){return new Promise(function(_0x33ce7d,_0x21894b){var _0x25766b=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x58')]);_0x33ce7d({'count':_0x25766b[_0x9810('0x1b')],'rows':_0x25766b});});},'OpenchannelQueuesWaitingInteractions':function(_0x20e3a6){return new Promise(function(_0x264d17,_0x3433a4){var _0x25e422=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x59')]);_0x264d17({'count':_0x25e422[_0x9810('0x1b')],'rows':_0x25e422});});},'SmsQueuesWaitingInteractions':function(_0x114fcb){return new Promise(function(_0x33eda4,_0x4575ba){var _0x2320ec=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x5a')]);_0x33eda4({'count':_0x2320ec['length'],'rows':_0x2320ec});});},'FaxQueuesWaitingInteractions':function(_0x44c600){return new Promise(function(_0x39cf53,_0x2d5642){var _0x5d6c4b=_['values'](_0x3c74b0[_0x9810('0x5b')]);_0x39cf53({'count':_0x5d6c4b[_0x9810('0x1b')],'rows':_0x5d6c4b});});},'WhatsappQueuesWaitingInteractions':function(_0xcee5ab){return new Promise(function(_0x2fc42c,_0x589aac){var _0x46b7ce=_[_0x9810('0x4b')](_0x3c74b0[_0x9810('0x5c')]);_0x2fc42c({'count':_0x46b7ce['length'],'rows':_0x46b7ce});});}};var _0x48f6e3=jayson[_0x9810('0x5d')](_0x22366c)[_0x9810('0x5e')]();_0x48f6e3['on'](_0x9810('0x32'),function(_0x40d6c5){logger[_0x9810('0x32')](JSON[_0x9810('0x36')](_0x40d6c5));return _0x333ad4(_0x40d6c5);});_0x48f6e3[_0x9810('0x15')](0x232c,'127.0.0.1',function(){console[_0x9810('0x5f')](_0x9810('0x60'),0x232c);return _0x2d52b1(_0x9810('0x61')+0x232c);});});}; \ No newline at end of file +var _0xf8f4=['../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','isArray','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','info','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busy','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','waiting','mailQueues','hasOwnProperty','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf8f4,0x1c6));var _0x4f8f=function(_0xf35672,_0x3833af){_0xf35672=_0xf35672-0x0;var _0x26afcf=_0xf8f4[_0xf35672];return _0x26afcf;};'use strict';var _=require(_0x4f8f('0x0'));var util=require(_0x4f8f('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x4f8f('0x2'));var BPromise=require(_0x4f8f('0x3'));var uuid=require(_0x4f8f('0x4'));var config=require(_0x4f8f('0x5'));var logger=require(_0x4f8f('0x6'))(_0x4f8f('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4f8f('0x8')),'chatQueueReport':require(_0x4f8f('0x9')),'smsQueueReport':require(_0x4f8f('0xa')),'faxQueueReport':require(_0x4f8f('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x4f8f('0xc'));function getId(_0x5f3309,_0x46b303,_0xb441aa){return util[_0x4f8f('0xd')]('%s.%s.%s',_0x5f3309,_0x46b303||0x0,_0xb441aa||0x0);}function getIntervals(_0x24847d,_0x54fca2){var _0x114c99=[];if(!_['isNil'](_0x54fca2[_0x4f8f('0xe')])&&!_[_0x4f8f('0xf')](_0x24847d[_0x54fca2[_0x4f8f('0xe')]])&&!_[_0x4f8f('0xf')](_0x24847d[_0x54fca2[_0x4f8f('0xe')]][_0x4f8f('0x10')])){_0x114c99=_[_0x4f8f('0x11')](_0x24847d[_0x54fca2[_0x4f8f('0xe')]]['Intervals'],'interval');}else if(!_[_0x4f8f('0xf')](_0x54fca2['interval'])){_0x114c99=[_0x54fca2[_0x4f8f('0x12')]];}return _0x114c99;}exports[_0x4f8f('0x13')]=function(_0x23aada){_0x23aada['rules']={};return new BPromise(function(_0x1d8a27,_0x19dd75){var _0x57fae7={'Start':function(_0x5d5533){var _0xec3db2=this;return new Promise(function(_0x3137bb,_0x4131a7){if(_0x5d5533){try{var _0x59dd92=[];var _0x3529e0=getId(_0x5d5533[_0x4f8f('0x14')],_0x5d5533['message']?_0x5d5533[_0x4f8f('0x15')]['id']:0x0,_0x5d5533[_0x4f8f('0x16')]?_0x5d5533['interaction']['id']:0x0);if(_0x5d5533['applications']&&_[_0x4f8f('0x17')](_0x5d5533[_0x4f8f('0x18')])&&_0x5d5533[_0x4f8f('0x18')][_0x4f8f('0x19')]){for(var _0x4470b3=0x0;_0x4470b3<_0x5d5533[_0x4f8f('0x18')][_0x4f8f('0x19')];_0x4470b3+=0x1){var _0x1f00ec=_0x5d5533[_0x4f8f('0x18')][_0x4470b3];if(fs[_0x4f8f('0x1a')](path[_0x4f8f('0x1b')](__dirname,'applications',_0x1f00ec[_0x4f8f('0x1c')]+'.js'))){var _0x4248b7=[];switch(_0x1f00ec[_0x4f8f('0x1c')][_0x4f8f('0x1d')]()){case _0x4f8f('0x1e'):var _0x352b7a=_0x1f00ec[_0x4f8f('0x1f')][_0x4f8f('0x20')](',');if(_0x5d5533[_0x4f8f('0x14')]==='mail'){_0x4248b7[_0x4f8f('0x21')](_0x352b7a[0x0]);_0x4248b7[_0x4f8f('0x21')](_0x352b7a[0x1]);_0x4248b7[_0x4f8f('0x21')](_0x352b7a['slice'](0x2,_0x352b7a[_0x4f8f('0x19')])[_0x4f8f('0x1b')](','));}else{_0x4248b7[_0x4f8f('0x21')](_0x352b7a[0x0]);_0x4248b7[_0x4f8f('0x21')](_0x352b7a[_0x4f8f('0x22')](0x1,_0x352b7a[_0x4f8f('0x19')])[_0x4f8f('0x1b')](','));}break;case'dialogflow':var _0x5ab3e6=_0x1f00ec[_0x4f8f('0x1f')]['split'](',');_0x4248b7[_0x4f8f('0x21')](_0x5ab3e6[0x0]);_0x4248b7[_0x4f8f('0x21')](_0x5ab3e6[0x1]);_0x4248b7[_0x4f8f('0x21')](_0x5ab3e6[_0x4f8f('0x22')](0x2,_0x5ab3e6[_0x4f8f('0x19')])[_0x4f8f('0x1b')](','));break;case _0x4f8f('0x23'):var _0x171e95=_0x1f00ec[_0x4f8f('0x1f')]['split'](',');_0x4248b7['push'](_0x171e95[0x0]);_0x4248b7[_0x4f8f('0x21')](_0x171e95[0x1]);_0x4248b7[_0x4f8f('0x21')](_0x171e95[0x2]);_0x4248b7[_0x4f8f('0x21')](_0x171e95[0x3]);_0x4248b7[_0x4f8f('0x21')](_0x171e95[_0x4f8f('0x22')](0x4,_0x171e95[_0x4f8f('0x19')])[_0x4f8f('0x1b')](','));break;case _0x4f8f('0x24'):var _0x549aab=_0x1f00ec[_0x4f8f('0x1f')][_0x4f8f('0x20')](',');_0x4248b7[_0x4f8f('0x21')](_0x549aab[0x0]);_0x4248b7['push'](_0x549aab[0x1]);_0x4248b7[_0x4f8f('0x21')](_0x549aab[0x2]);_0x4248b7[_0x4f8f('0x21')](_0x549aab[0x3]);_0x4248b7[_0x4f8f('0x21')](_0x549aab[_0x4f8f('0x22')](0x4,_0x549aab[_0x4f8f('0x19')])[_0x4f8f('0x1b')](','));break;case _0x4f8f('0x15'):_0x4248b7[_0x4f8f('0x21')](_0x1f00ec[_0x4f8f('0x1f')]);break;case _0x4f8f('0x25'):_0x4248b7[_0x4f8f('0x21')](_0x1f00ec[_0x4f8f('0x26')]);_0x4248b7[_0x4f8f('0x21')](_0x1f00ec['appdata']);break;default:_0x4248b7=_[_0x4f8f('0xf')](_0x1f00ec[_0x4f8f('0x1f')])?[]:_0x1f00ec[_0x4f8f('0x1f')]['split'](',');}var _0x124ee3={'id':util['format'](_0x4f8f('0x27'),_0x3529e0,_0x1f00ec['id'],_0x1f00ec[_0x4f8f('0x1c')]),'condition':require(_0x4f8f('0x28'))['condition'](_0x3529e0,getIntervals(_0x23aada[_0x4f8f('0x29')],_0x1f00ec),_0x23aada),'consequence':require(_0x4f8f('0x2a')+_0x1f00ec[_0x4f8f('0x1c')])[_0x4f8f('0x2b')](_0x3529e0,_0x4248b7,_0x23aada,_0x5d5533),'p':_0x1f00ec['priority']||0x0};logger[_0x4f8f('0x2c')]('Push\x20new\x20rule',_0x124ee3['id'],'on\x20interval',getIntervals(_0x23aada[_0x4f8f('0x29')],_0x1f00ec)['join'](_0x4f8f('0x2d')));_0x59dd92[_0x4f8f('0x21')](_0x124ee3);}else{logger['error'](_0x4f8f('0x2e'),path[_0x4f8f('0x1b')](__dirname,_0x4f8f('0x18'),_0x1f00ec[_0x4f8f('0x1c')]+_0x4f8f('0x2f')));}}_0x23aada[_0x4f8f('0x30')][_0x3529e0]=new RuleEngine(_0x59dd92);_0x23aada[_0x4f8f('0x30')][_0x3529e0]['execute'](_0x5d5533,function(_0x5e86e5){logger['info'](_0x4f8f('0x31'),JSON[_0x4f8f('0x32')](_0x5e86e5[_0x4f8f('0x33')]));if(_0x23aada[_0x4f8f('0x30')][_0x3529e0]){_0x23aada[_0x4f8f('0x30')][_0x3529e0][_0x4f8f('0x34')](_0x4f8f('0x35'));}});return _0x3137bb({'code':0xc8,'message':_0x5d5533});}else{logger[_0x4f8f('0x2c')](_0x4f8f('0x36'));return _0x3137bb({'code':0xc8,'message':_0x5d5533});}}catch(_0x1a876c){logger['error'](_0x1a876c['stack']);return _0x4131a7(_0xec3db2[_0x4f8f('0x37')](0x1f4,_0x1a876c));}}return _0x4131a7(_0x4f8f('0x38'));});},'AcceptMessage':function(_0xb5e35a){var _0x1254e2=this;return new Promise(function(_0x9e26db,_0x5bb546){if(_0xb5e35a[_0x4f8f('0x39')]&&_0xb5e35a[_0x4f8f('0x39')]['id']){if(_0x23aada[_0x4f8f('0x3a')][_0xb5e35a[_0x4f8f('0x39')]['id']]){_0x23aada[_0x4f8f('0x3a')][_0xb5e35a[_0x4f8f('0x39')]['id']]['busy']=![];_0x23aada[_0x4f8f('0x3a')][_0xb5e35a['agent']['id']][_0x4f8f('0x3b')]=undefined;}}if(_0xb5e35a[_0x4f8f('0x15')]&&_0xb5e35a[_0x4f8f('0x15')]['id']){try{var _0x1a3848=getId(_0xb5e35a[_0x4f8f('0x14')],_0xb5e35a['message']?_0xb5e35a[_0x4f8f('0x15')]['id']:0x0,_0xb5e35a[_0x4f8f('0x16')]?_0xb5e35a['interaction']['id']:0x0);if(_0x23aada[_0x4f8f('0x30')][_0x1a3848]){_0x23aada[_0x4f8f('0x30')][_0x1a3848][_0x4f8f('0x34')](_0x4f8f('0x3c'));if(rpc[_0xb5e35a[_0x4f8f('0x14')]+_0x4f8f('0x3d')]){rpc[_0xb5e35a['channel']+'QueueReport']['update'](_0x1a3848,{'UserId':_0xb5e35a[_0x4f8f('0x15')][_0x4f8f('0x3e')]})['catch'](function(_0xe21c06){logger[_0x4f8f('0x37')](_0x4f8f('0x3f'));});}}return _0x9e26db({'code':0xc8,'message':_0xb5e35a});}catch(_0x5cebcb){logger['error'](_0x5cebcb[_0x4f8f('0x40')]);return _0x5bb546(_0x1254e2['error'](0x1f4,_0x5cebcb));}}logger[_0x4f8f('0x37')](_0x4f8f('0x41'));return _0x5bb546(_0x1254e2[_0x4f8f('0x37')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2a033a){var _0x5f48f7=this;return new Promise(function(_0x35be03,_0xf1111f){if(_0x2a033a[_0x4f8f('0x39')]&&_0x2a033a[_0x4f8f('0x39')]['id']){try{if(_0x23aada[_0x4f8f('0x3a')][_0x2a033a[_0x4f8f('0x39')]['id']]){_0x23aada[_0x4f8f('0x3a')][_0x2a033a['agent']['id']][_0x4f8f('0x42')]=![];_0x23aada[_0x4f8f('0x3a')][_0x2a033a['agent']['id']][_0x4f8f('0x3b')]=undefined;}return _0x35be03({'code':0xc8,'message':_0x2a033a});}catch(_0x89bf2){logger[_0x4f8f('0x37')](_0x89bf2['stack']);return _0xf1111f(_0x5f48f7[_0x4f8f('0x37')](0x1f4,_0x89bf2));}}logger[_0x4f8f('0x37')](_0x4f8f('0x41'));return _0xf1111f(_0x5f48f7[_0x4f8f('0x37')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xe245b2){var _0xa8bbab=this;return new Promise(function(_0x55c961,_0x4fc859){if(_0xe245b2['channel']&&_0xe245b2['interaction']&&_0xe245b2[_0x4f8f('0x16')]['id']){try{var _0x47e952=getId(_0xe245b2[_0x4f8f('0x14')],_0xe245b2[_0x4f8f('0x15')]?_0xe245b2['message']['id']:0x0,_0xe245b2[_0x4f8f('0x16')]?_0xe245b2[_0x4f8f('0x16')]['id']:0x0);if(_0x23aada[_0x4f8f('0x30')][_0x47e952]){_0x23aada[_0x4f8f('0x30')][_0x47e952][_0x4f8f('0x34')]('end');}return _0x55c961({'code':0xc8,'message':_0xe245b2});}catch(_0x52870f){logger['error'](_0x52870f[_0x4f8f('0x40')]);return _0x4fc859(_0xa8bbab[_0x4f8f('0x37')](0x1f4,_0x52870f));}}logger[_0x4f8f('0x37')]('message\x20is\x20empty');return _0x4fc859(_0xa8bbab[_0x4f8f('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xfb854b){var _0x3af639=this;return new Promise(function(_0x28f047,_0x20e7d4){if(_0x23aada[_0x4f8f('0x3a')]['hasOwnProperty'](_0xfb854b['id'])){for(var _0x5ce825 in _0xfb854b[_0x4f8f('0x43')]){if(_0xfb854b[_0x4f8f('0x43')]['hasOwnProperty'](_0x5ce825)){if(_0x23aada[_0x4f8f('0x3a')][_0xfb854b['id']]['hasOwnProperty'](_0x5ce825+_0x4f8f('0x44'))){_0x23aada['agents'][_0xfb854b['id']][_0x5ce825+_0x4f8f('0x44')]=parseInt(_0xfb854b['capacity'][_0x5ce825],0xa);}}}_0x23aada[_0x4f8f('0x3a')][_0xfb854b['id']][_0x4f8f('0x45')]();return _0x28f047({'code':0xc8,'message':_0x23aada[_0x4f8f('0x3a')][_0xfb854b['id']]});}else{return _0x20e7d4(_0x3af639['error'](0x1f4,_0x4f8f('0x46')));}});},'Agents':function(_0x41c40e){return new Promise(function(_0x215098,_0x526e01){var _0x5643ec=_['values'](_0x23aada[_0x4f8f('0x3a')]);_0x215098({'count':_0x5643ec[_0x4f8f('0x19')],'rows':_0x5643ec});});},'ChatQueues':function(_0x408067){return new Promise(function(_0x1cff86,_0x42692b){var _0x403dfe=[];for(var _0x2d7dea in _0x23aada[_0x4f8f('0x47')]){if(_0x23aada[_0x4f8f('0x47')]['hasOwnProperty'](_0x2d7dea)){var _0x2c8a2c=_0x23aada['chatQueues'][_0x2d7dea];var _0x44b9f9={'id':_0x2c8a2c['id'],'available':_0x2c8a2c[_0x4f8f('0x48')],'loggedIn':_0x2c8a2c[_0x4f8f('0x49')],'name':_0x2c8a2c[_0x4f8f('0x4a')],'paused':_0x2c8a2c['paused'],'waiting':_0x2c8a2c[_0x4f8f('0x4b')]};_0x403dfe[_0x4f8f('0x21')](_0x44b9f9);}}_0x1cff86({'count':_0x403dfe[_0x4f8f('0x19')],'rows':_0x403dfe});});},'MailQueues':function(_0x2a5371){return new Promise(function(_0x41d815,_0x4060f8){var _0x28b15b=[];for(var _0x5e67ff in _0x23aada[_0x4f8f('0x4c')]){if(_0x23aada[_0x4f8f('0x4c')][_0x4f8f('0x4d')](_0x5e67ff)){var _0x4415ca=_0x23aada[_0x4f8f('0x4c')][_0x5e67ff];var _0x4cb581={'id':_0x4415ca['id'],'available':_0x4415ca[_0x4f8f('0x48')],'loggedIn':_0x4415ca[_0x4f8f('0x49')],'name':_0x4415ca[_0x4f8f('0x4a')],'paused':_0x4415ca[_0x4f8f('0x4e')],'waiting':_0x4415ca['waiting']};_0x28b15b[_0x4f8f('0x21')](_0x4cb581);}}_0x41d815({'count':_0x28b15b['length'],'rows':_0x28b15b});});},'OpenchannelQueues':function(_0x1a91a0){return new Promise(function(_0x21eef1,_0x3dd462){var _0x279acb=[];for(var _0x494c48 in _0x23aada[_0x4f8f('0x4f')]){if(_0x23aada[_0x4f8f('0x4f')][_0x4f8f('0x4d')](_0x494c48)){var _0x2e6973=_0x23aada[_0x4f8f('0x4f')][_0x494c48];var _0x3c199e={'id':_0x2e6973['id'],'available':_0x2e6973[_0x4f8f('0x48')],'loggedIn':_0x2e6973[_0x4f8f('0x49')],'name':_0x2e6973['name'],'paused':_0x2e6973[_0x4f8f('0x4e')],'waiting':_0x2e6973[_0x4f8f('0x4b')]};_0x279acb[_0x4f8f('0x21')](_0x3c199e);}}_0x21eef1({'count':_0x279acb[_0x4f8f('0x19')],'rows':_0x279acb});});},'SmsQueues':function(_0x56ab78){return new Promise(function(_0x5dd9d2,_0x589b86){var _0x11116e=[];for(var _0x42f83a in _0x23aada[_0x4f8f('0x50')]){if(_0x23aada[_0x4f8f('0x50')]['hasOwnProperty'](_0x42f83a)){var _0x409890=_0x23aada[_0x4f8f('0x50')][_0x42f83a];var _0x193b50={'id':_0x409890['id'],'available':_0x409890[_0x4f8f('0x48')],'loggedIn':_0x409890[_0x4f8f('0x49')],'name':_0x409890[_0x4f8f('0x4a')],'paused':_0x409890['paused'],'waiting':_0x409890[_0x4f8f('0x4b')]};_0x11116e[_0x4f8f('0x21')](_0x193b50);}}_0x5dd9d2({'count':_0x11116e[_0x4f8f('0x19')],'rows':_0x11116e});});},'FaxQueues':function(_0x1a6bfe){return new Promise(function(_0x16a1fc,_0x26a1bb){var _0x113eb8=[];for(var _0x35bb1f in _0x23aada[_0x4f8f('0x51')]){if(_0x23aada[_0x4f8f('0x51')][_0x4f8f('0x4d')](_0x35bb1f)){var _0x5c23b7=_0x23aada[_0x4f8f('0x51')][_0x35bb1f];var _0xf604d7={'id':_0x5c23b7['id'],'available':_0x5c23b7[_0x4f8f('0x48')],'loggedIn':_0x5c23b7[_0x4f8f('0x49')],'name':_0x5c23b7['name'],'paused':_0x5c23b7[_0x4f8f('0x4e')],'waiting':_0x5c23b7[_0x4f8f('0x4b')]};_0x113eb8['push'](_0xf604d7);}}_0x16a1fc({'count':_0x113eb8[_0x4f8f('0x19')],'rows':_0x113eb8});});},'WhatsappQueues':function(_0x5ecf7c){return new Promise(function(_0x44a93d,_0x741117){var _0x3450d1=[];for(var _0x3cdc3b in _0x23aada['whatsappQueues']){if(_0x23aada[_0x4f8f('0x52')][_0x4f8f('0x4d')](_0x3cdc3b)){var _0x5170bf=_0x23aada['whatsappQueues'][_0x3cdc3b];var _0x2a0c85={'id':_0x5170bf['id'],'available':_0x5170bf[_0x4f8f('0x48')],'loggedIn':_0x5170bf[_0x4f8f('0x49')],'name':_0x5170bf[_0x4f8f('0x4a')],'paused':_0x5170bf['paused'],'waiting':_0x5170bf[_0x4f8f('0x4b')]};_0x3450d1[_0x4f8f('0x21')](_0x2a0c85);}}_0x44a93d({'count':_0x3450d1[_0x4f8f('0x19')],'rows':_0x3450d1});});},'ChatQueuesWaitingInteractions':function(_0x29cafd){return new Promise(function(_0x71c4c,_0x1e2fca){var _0x22267a=_[_0x4f8f('0x53')](_0x23aada[_0x4f8f('0x54')]);_0x71c4c({'count':_0x22267a[_0x4f8f('0x19')],'rows':_0x22267a});});},'MailQueuesWaitingInteractions':function(_0x5818d0){return new Promise(function(_0x28568a,_0x1c23d4){var _0x5c3387=_[_0x4f8f('0x53')](_0x23aada[_0x4f8f('0x55')]);_0x28568a({'count':_0x5c3387[_0x4f8f('0x19')],'rows':_0x5c3387});});},'OpenchannelQueuesWaitingInteractions':function(_0x4090f5){return new Promise(function(_0x526846,_0x30f7da){var _0x5a017a=_['values'](_0x23aada[_0x4f8f('0x56')]);_0x526846({'count':_0x5a017a[_0x4f8f('0x19')],'rows':_0x5a017a});});},'SmsQueuesWaitingInteractions':function(_0x29b3a9){return new Promise(function(_0x47cdcf,_0x4732ab){var _0x596536=_['values'](_0x23aada['smsQueuesWaitingInteractions']);_0x47cdcf({'count':_0x596536['length'],'rows':_0x596536});});},'FaxQueuesWaitingInteractions':function(_0x337fb8){return new Promise(function(_0x428e75,_0x28a801){var _0x3fbcfd=_[_0x4f8f('0x53')](_0x23aada[_0x4f8f('0x57')]);_0x428e75({'count':_0x3fbcfd['length'],'rows':_0x3fbcfd});});},'WhatsappQueuesWaitingInteractions':function(_0x57a187){return new Promise(function(_0x5a55d3,_0x27ec9b){var _0x3b6b1c=_[_0x4f8f('0x53')](_0x23aada[_0x4f8f('0x58')]);_0x5a55d3({'count':_0x3b6b1c[_0x4f8f('0x19')],'rows':_0x3b6b1c});});}};var _0x476ec1=jayson[_0x4f8f('0x59')](_0x57fae7)['http']();_0x476ec1['on'](_0x4f8f('0x37'),function(_0x49494e){logger[_0x4f8f('0x37')](JSON[_0x4f8f('0x32')](_0x49494e));return _0x19dd75(_0x49494e);});_0x476ec1[_0x4f8f('0x13')](0x232c,'127.0.0.1',function(){console[_0x4f8f('0x5a')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1d8a27(_0x4f8f('0x5b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 2c0e3af..386c5b1 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 _0x9c51=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','jayson/promise','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules'];(function(_0x40c118,_0x1c7114){var _0x7c7f1e=function(_0x4be17b){while(--_0x4be17b){_0x40c118['push'](_0x40c118['shift']());}};_0x7c7f1e(++_0x1c7114);}(_0x9c51,0xf2));var _0x19c5=function(_0x12447c,_0x136527){_0x12447c=_0x12447c-0x0;var _0x4a3ae8=_0x9c51[_0x12447c];return _0x4a3ae8;};'use strict';var util=require(_0x19c5('0x0'));var BPromise=require(_0x19c5('0x1'));var jayson=require(_0x19c5('0x2'));var _=require('lodash');var logger=require(_0x19c5('0x3'))(_0x19c5('0x4'));var client=jayson['client'][_0x19c5('0x5')]({'port':0x232a});function request(_0x13cb18,_0x6900db){return new BPromise(function(_0x195997,_0x54003b){return client[_0x19c5('0x6')](_0x13cb18,_0x6900db)[_0x19c5('0x7')](function(_0x24fead){if(_0x24fead[_0x19c5('0x8')]){return _0x54003b(_0x24fead[_0x19c5('0x8')][_0x19c5('0x9')]);}else{return _0x195997(_0x24fead[_0x19c5('0xa')]);}})[_0x19c5('0xb')](function(_0x281340){return _0x54003b(_0x281340);});});}exports[_0x19c5('0xc')]=function(_0x412ecb,_0x32fd53,_0x75dfef){return function(_0x3da8a4){if(_0x75dfef[_0x19c5('0xd')]&&!_0x75dfef[_0x19c5('0xd')][_0x412ecb]){logger[_0x19c5('0xe')](_0x19c5('0xf'),_0x412ecb);return _0x3da8a4['stop']();}var _0x4ef586=[];for(var _0x1d400f=0x0;_0x1d400f<_0x32fd53[_0x19c5('0x10')];_0x1d400f+=0x1){_0x4ef586[_0x19c5('0x11')](request('Command',{'command':util[_0x19c5('0x12')](_0x19c5('0x13'),_0x32fd53[_0x1d400f])})['then'](function(_0x49992c){return _0x49992c&&_0x49992c['message']&&_0x49992c['message'][_0x19c5('0x14')](_0x19c5('0x15'))>=0x0?!![]:![];})['catch'](function(_0xcfb091){logger['error'](_0x19c5('0x16'),_0x412ecb,_0x32fd53[_0x1d400f]);}));}BPromise[_0x19c5('0x17')](_0x4ef586)[_0x19c5('0x7')](function(_0x142e99){var _0x4d7811=_[_0x19c5('0x18')](_0x142e99);logger['info'](_0x19c5('0x19'),_0x412ecb,_0x32fd53[_0x19c5('0x1a')](_0x19c5('0x1b')),_0x4d7811);_0x3da8a4[_0x19c5('0x1c')](_0x4d7811);})[_0x19c5('0xb')](function(_0x10a07a){console[_0x19c5('0x1d')](_0x10a07a);logger['error'](_0x19c5('0x19'),_0x412ecb,_0x32fd53[_0x19c5('0x1a')](_0x19c5('0x1b')),_0x10a07a[_0x19c5('0x1e')]);_0x3da8a4[_0x19c5('0x1f')]();});};}; \ No newline at end of file +var _0x98af=['result','catch','rules','stop','length','push','Command','iftime\x20%s','then','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','routing','client','error','message'];(function(_0x389cba,_0x1e861f){var _0x493c9f=function(_0x3c3243){while(--_0x3c3243){_0x389cba['push'](_0x389cba['shift']());}};_0x493c9f(++_0x1e861f);}(_0x98af,0x1f0));var _0xf98a=function(_0x2ca718,_0x807f4f){_0x2ca718=_0x2ca718-0x0;var _0xca5918=_0x98af[_0x2ca718];return _0xca5918;};'use strict';var util=require(_0xf98a('0x0'));var BPromise=require(_0xf98a('0x1'));var jayson=require(_0xf98a('0x2'));var _=require(_0xf98a('0x3'));var logger=require('../../../config/logger')(_0xf98a('0x4'));var client=jayson[_0xf98a('0x5')]['http']({'port':0x232a});function request(_0x19675d,_0x299d2d){return new BPromise(function(_0x2d06f5,_0x32aa47){return client['request'](_0x19675d,_0x299d2d)['then'](function(_0x90a099){if(_0x90a099[_0xf98a('0x6')]){return _0x32aa47(_0x90a099[_0xf98a('0x6')][_0xf98a('0x7')]);}else{return _0x2d06f5(_0x90a099[_0xf98a('0x8')]);}})[_0xf98a('0x9')](function(_0x449f51){return _0x32aa47(_0x449f51);});});}exports['condition']=function(_0x32590f,_0x2c6675,_0xfcc671){return function(_0x39c791){if(_0xfcc671['rules']&&!_0xfcc671[_0xf98a('0xa')][_0x32590f]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x32590f);return _0x39c791[_0xf98a('0xb')]();}var _0x400bbe=[];for(var _0x59b733=0x0;_0x59b733<_0x2c6675[_0xf98a('0xc')];_0x59b733+=0x1){_0x400bbe[_0xf98a('0xd')](request(_0xf98a('0xe'),{'command':util['format'](_0xf98a('0xf'),_0x2c6675[_0x59b733])})[_0xf98a('0x10')](function(_0x13ccb5){return _0x13ccb5&&_0x13ccb5[_0xf98a('0x7')]&&_0x13ccb5[_0xf98a('0x7')]['indexOf'](_0xf98a('0x11'))>=0x0?!![]:![];})['catch'](function(_0x350a7e){logger['error'](_0xf98a('0x12'),_0x32590f,_0x2c6675[_0x59b733]);}));}BPromise[_0xf98a('0x13')](_0x400bbe)[_0xf98a('0x10')](function(_0x2798d0){var _0x2ab8d7=_[_0xf98a('0x14')](_0x2798d0);logger[_0xf98a('0x15')](_0xf98a('0x16'),_0x32590f,_0x2c6675[_0xf98a('0x17')](_0xf98a('0x18')),_0x2ab8d7);_0x39c791[_0xf98a('0x19')](_0x2ab8d7);})[_0xf98a('0x9')](function(_0x48d124){console[_0xf98a('0x1a')](_0x48d124);logger[_0xf98a('0x6')](_0xf98a('0x16'),_0x32590f,_0x2c6675['join'](_0xf98a('0x18')),_0x48d124[_0xf98a('0x1b')]);_0x39c791['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b4e255e..56eb1c7 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 _0x0bb5=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','now','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x273502,_0x1c173c){var _0x379e87=function(_0x563348){while(--_0x563348){_0x273502['push'](_0x273502['shift']());}};_0x379e87(++_0x1c173c);}(_0x0bb5,0x148));var _0x50bb=function(_0xd02786,_0x197522){_0xd02786=_0xd02786-0x0;var _0x1d5767=_0x0bb5[_0xd02786];return _0x1d5767;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5a12b6,_0x348380){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x4'),_0x5a12b6[_0x50bb('0x5')],_0x5a12b6[_0x50bb('0x6')],_0x5a12b6[_0x50bb('0x7')],_0x5a12b6[_0x50bb('0x8')],_0x5a12b6['interface'],_0x5a12b6['calleridnum'],_0x5a12b6[_0x50bb('0x9')],_0x5a12b6[_0x50bb('0xa')]));if(_0x5a12b6[_0x50bb('0x7')]){utils[_0x50bb('0xb')](_0x5a12b6['queue'])['then'](function(_0x2bede8){if(_0x2bede8){_0x5a12b6[_0x50bb('0xc')]=_0x2bede8[_0x50bb('0xc')];_0x5a12b6[_0x50bb('0xd')]=_0x5a12b6['agentcomplete']?_0x2bede8[_0x50bb('0xe')]:![];_0x5a12b6[_0x50bb('0xf')]=_0x5a12b6[_0x50bb('0xd')]?_0x2bede8[_0x50bb('0x10')]:0x0;}utils[_0x50bb('0x11')](_0x50bb('0x12'),_0x5a12b6);});}else{utils[_0x50bb('0x11')]('CreateVoiceAgentReport',_0x5a12b6);}if(_0x348380){delete transfers[_0x5a12b6[_0x50bb('0x5')]];}else{delete agents[_0x5a12b6['destuniqueid']];}}exports[_0x50bb('0x13')]=function(_0xd8ab27){try{utils[_0x50bb('0x14')](util['format'](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0xd8ab27);agents[_0xd8ab27[_0x50bb('0x16')]]=_0xd8ab27;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x17')]=utils['now']();agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x18');agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x9')]=null;agents[_0xd8ab27['destuniqueid']][_0x50bb('0x19')]=null;utils[_0x50bb('0x2')](util['format'](_0x50bb('0x1a'),_0xd8ab27['uniqueid'],agents[_0xd8ab27[_0x50bb('0x16')]][_0x50bb('0x8')],_0xd8ab27['destuniqueid']));}catch(_0x4f1c0a){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x15'),_0xd8ab27[_0x50bb('0x5')]),_0x4f1c0a);}};exports['agentringnoanswer']=function(_0x19dc5d){try{if(!_[_0x50bb('0x1c')](agents[_0x19dc5d[_0x50bb('0x16')]])){utils['debug'](util[_0x50bb('0x3')](_0x50bb('0x1d'),_0x19dc5d[_0x50bb('0x5')]),_0x19dc5d);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x19dc5d[_0x50bb('0x5')],agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x8')],_0x19dc5d[_0x50bb('0x16')]));agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x1e')]=!![];agents[_0x19dc5d['destuniqueid']][_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0xa')]='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['reason']='timeout';agents[_0x19dc5d[_0x50bb('0x16')]]['holdtime']=_0x19dc5d['ringtime']?parseInt(_0x19dc5d[_0x50bb('0x21')])/0x3e8:0x0;agents[_0x19dc5d[_0x50bb('0x16')]][_0x50bb('0x22')]=0x0;unanswered[_0x50bb('0x23')](_0x19dc5d[_0x50bb('0x16')]);}}catch(_0x269479){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')]('[%s][agents][agentringnoanswer]',_0x19dc5d[_0x50bb('0x5')]),_0x269479);}};exports[_0x50bb('0x24')]=function(_0x15ee2e){try{_[_0x50bb('0x25')](agents,function(_0x560b07,_0x13dc3c){if(_0x560b07[_0x50bb('0x5')]==_0x15ee2e[_0x50bb('0x5')]&&!_[_0x50bb('0x26')](unanswered,_0x560b07[_0x50bb('0x16')])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x15ee2e);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x28'),_0x15ee2e['uniqueid'],_0x560b07[_0x50bb('0x8')],_0x560b07[_0x50bb('0x16')]));_0x560b07[_0x50bb('0x1e')]=!![];_0x560b07[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x560b07[_0x50bb('0xa')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2a')]=_0x50bb('0x29');_0x560b07[_0x50bb('0x2b')]=_0x15ee2e[_0x50bb('0x2b')];_0x560b07['talktime']=0x0;writeDB(_0x560b07);}});}catch(_0x364ea0){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x27'),_0x15ee2e[_0x50bb('0x5')]),_0x364ea0);}};exports[_0x50bb('0x2c')]=function(_0x53600a){try{if(agents[_0x53600a['destuniqueid']]){utils[_0x50bb('0x14')](util['format'](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x53600a);utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x2e'),_0x53600a['uniqueid'],agents[_0x53600a[_0x50bb('0x16')]]['membername'],_0x53600a[_0x50bb('0x16')]));agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x2f')]=utils['now']();agents[_0x53600a['destuniqueid']][_0x50bb('0x9')]=_0x53600a[_0x50bb('0x9')];agents[_0x53600a[_0x50bb('0x16')]][_0x50bb('0x19')]=_0x53600a['connectedlinename'];agents[_0x53600a[_0x50bb('0x16')]]['holdtime']=_0x53600a['ringtime'];agents[_0x53600a[_0x50bb('0x16')]]['lastevent']=_0x50bb('0x30');_[_0x50bb('0x25')](agents,function(_0x1ef231,_0x1f156e){if(_0x1ef231[_0x50bb('0x16')]!=_0x53600a[_0x50bb('0x16')]&&_0x1ef231[_0x50bb('0x5')]==_0x53600a[_0x50bb('0x5')]){_0x1ef231[_0x50bb('0x22')]=0x0;_0x1ef231[_0x50bb('0x2b')]=_0x53600a['ringtime'];_0x1ef231['agentringnoanswer']=!![];_0x1ef231[_0x50bb('0x1f')]=utils[_0x50bb('0x20')]();_0x1ef231[_0x50bb('0xa')]=_0x50bb('0x31');_0x1ef231['reason']=_0x50bb('0x31');_0x1ef231['answeredelsewheredestinationuniqueid']=_0x53600a[_0x50bb('0x16')];_0x1ef231[_0x50bb('0x32')]=_0x53600a[_0x50bb('0x8')];writeDB(_0x1ef231);}});}}catch(_0x40748d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x2d'),_0x53600a[_0x50bb('0x5')]),_0x40748d);}};exports[_0x50bb('0x33')]=function(_0x46c1c3){try{if(!_[_0x50bb('0x1c')](agents[_0x46c1c3[_0x50bb('0x16')]])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x46c1c3);utils['info'](util[_0x50bb('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x46c1c3[_0x50bb('0x5')],agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x8')],_0x46c1c3[_0x50bb('0x16')]));agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x33')]=!![];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0x35')],agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2f')]);agents[_0x46c1c3['destuniqueid']][_0x50bb('0x2a')]=_0x46c1c3[_0x50bb('0x2a')];agents[_0x46c1c3[_0x50bb('0x16')]][_0x50bb('0xa')]=_0x50bb('0x37');writeDB(agents[_0x46c1c3[_0x50bb('0x16')]]);}}catch(_0x133dd9){utils[_0x50bb('0x1b')](util['format'](_0x50bb('0x34'),_0x46c1c3[_0x50bb('0x5')]),_0x133dd9);}};exports[_0x50bb('0x38')]=function(_0x13afe2){try{if(!_[_0x50bb('0x1c')](agents[_0x13afe2['transfereruniqueid']])){utils[_0x50bb('0x14')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2[_0x50bb('0x5')]),_0x13afe2);utils[_0x50bb('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x13afe2[_0x50bb('0x5')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x8')],agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')]));agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x3b')]=!![];agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3c')]=_0x50bb('0x3d');agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x3e')]=_0x13afe2[_0x50bb('0x3f')];agents[_0x13afe2[_0x50bb('0x3a')]][_0x50bb('0x40')]=agents[_0x13afe2['transfereruniqueid']][_0x50bb('0x5')];}}catch(_0x46b51e){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x39'),_0x13afe2['uniqueid']),_0x46b51e);}};exports[_0x50bb('0x41')]=function(_0x50943a){try{utils[_0x50bb('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x50943a[_0x50bb('0x42')]),_0x50943a);if(_0x50943a['origtransfereruniqueid']==_0x50943a['origtransfererlinkedid']){if(!_[_0x50bb('0x1c')](agents[_0x50943a[_0x50bb('0x43')]])){utils[_0x50bb('0x2')](util[_0x50bb('0x3')](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x8')]));agents[_0x50943a['secondtransfereruniqueid']]['transfer']=!![];agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3c')]=_0x50bb('0x45');agents[_0x50943a[_0x50bb('0x43')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x46')];agents[_0x50943a[_0x50bb('0x43')]]['transferuniqueid']=_0x50943a[_0x50bb('0x42')];}if(_0x50943a[_0x50bb('0x47')]&&agents[_0x50943a[_0x50bb('0x47')]]){agents[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfereeuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x47')]]);transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x43')]]['calleridnum'];transfers[_0x50943a[_0x50bb('0x47')]]['calleridname']=agents[_0x50943a['secondtransfereruniqueid']][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x47')]][_0x50bb('0x48')]=0x2;}}else if(_0x50943a['secondtransfereruniqueid']==_0x50943a[_0x50bb('0x4c')]){if(!_['isNil'](agents[_0x50943a[_0x50bb('0x42')]])){utils[_0x50bb('0x2')](util['format'](_0x50bb('0x44'),_0x50943a[_0x50bb('0x42')],agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x8')]));agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3b')]=!![];agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3c')]='ATTENDED';agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x3e')]=_0x50943a[_0x50bb('0x4d')];agents[_0x50943a['origtransfereruniqueid']][_0x50bb('0x40')]=_0x50943a[_0x50bb('0x43')];}if(_0x50943a[_0x50bb('0x4e')]&&agents[_0x50943a[_0x50bb('0x4e')]]){agents[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x1;transfers[_0x50943a['transfertargetuniqueid']]=_[_0x50bb('0x49')](agents[_0x50943a[_0x50bb('0x4e')]]);transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x4a')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4a')];transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x4b')]=agents[_0x50943a[_0x50bb('0x42')]][_0x50bb('0x4b')];transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x17')]=utils[_0x50bb('0x20')]();transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x2f')]=utils[_0x50bb('0x20')]();transfers[_0x50943a['transfertargetuniqueid']][_0x50bb('0x2b')]=0x0;transfers[_0x50943a[_0x50bb('0x4e')]][_0x50bb('0x48')]=0x2;}}}catch(_0x2d2463){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x4f'),_0x50943a[_0x50bb('0x42')]),_0x2d2463);}};exports[_0x50bb('0x50')]=function(_0x578ff3){try{utils['debug'](util['format'](_0x50bb('0x51'),_0x578ff3['uniqueid']),_0x578ff3);if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')]===_0x50bb('0x52')){if(_0x578ff3[_0x50bb('0x53')]==='21'){agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=_0x50bb('0x54');agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]='rejected';}utils[_0x50bb('0x2')](util[_0x50bb('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3['uniqueid']][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]]['reason'],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(agents[_0x578ff3[_0x50bb('0x5')]]);var _0x51142c=unanswered[_0x50bb('0x55')](_0x578ff3[_0x50bb('0x5')]);if(_0x51142c>-0x1){unanswered[_0x50bb('0x56')](_0x51142c,0x1);}}if(transfers[_0x578ff3[_0x50bb('0x5')]]){transfers[_0x578ff3['uniqueid']][_0x50bb('0x33')]=!![];transfers[_0x578ff3[_0x50bb('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x22')]=utils['diffTime'](transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]);transfers[_0x578ff3[_0x50bb('0x5')]]['reason']='agent';transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3['uniqueid'],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],transfers[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0xa')]));writeDB(transfers[_0x578ff3[_0x50bb('0x5')]],!![]);}if(agents[_0x578ff3['uniqueid']]&&agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2f')]){agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x33')]=!![];agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')]=utils[_0x50bb('0x20')]();agents[_0x578ff3['uniqueid']][_0x50bb('0x22')]=utils[_0x50bb('0x36')](agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x35')],agents[_0x578ff3[_0x50bb('0x5')]]['agentconnectAt']);agents[_0x578ff3['uniqueid']][_0x50bb('0x2a')]=agents[_0x578ff3['uniqueid']][_0x50bb('0x3b')]?_0x50bb('0x3b'):'agent';agents[_0x578ff3['uniqueid']][_0x50bb('0xa')]=_0x50bb('0x37');utils[_0x50bb('0x2')](util['format'](_0x50bb('0x57'),_0x578ff3[_0x50bb('0x5')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x8')],agents[_0x578ff3[_0x50bb('0x5')]][_0x50bb('0x2a')],agents[_0x578ff3[_0x50bb('0x5')]]['lastevent']));writeDB(agents[_0x578ff3['uniqueid']]);}}catch(_0x28c99d){utils[_0x50bb('0x1b')](util[_0x50bb('0x3')](_0x50bb('0x51'),_0x578ff3[_0x50bb('0x5')]),_0x28c99d);}}; \ No newline at end of file +var _0xab40=['forIn','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','membername','agentringnoanswerAt','timeout','reason','ringtime','talktime','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xab40,0xcd));var _0x0ab4=function(_0x5b6bed,_0x3005ec){_0x5b6bed=_0x5b6bed-0x0;var _0x570c99=_0xab40[_0x5b6bed];return _0x570c99;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x570f05,_0x4f3e19){utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x4'),_0x570f05[_0x0ab4('0x5')],_0x570f05[_0x0ab4('0x6')],_0x570f05['queue'],_0x570f05['membername'],_0x570f05[_0x0ab4('0x7')],_0x570f05['calleridnum'],_0x570f05[_0x0ab4('0x8')],_0x570f05[_0x0ab4('0x9')]));if(_0x570f05[_0x0ab4('0xa')]){utils[_0x0ab4('0xb')](_0x570f05['queue'])['then'](function(_0x4b01c4){if(_0x4b01c4){_0x570f05[_0x0ab4('0xc')]=_0x4b01c4[_0x0ab4('0xc')];_0x570f05[_0x0ab4('0xd')]=_0x570f05[_0x0ab4('0xe')]?_0x4b01c4[_0x0ab4('0xf')]:![];_0x570f05[_0x0ab4('0x10')]=_0x570f05[_0x0ab4('0xd')]?_0x4b01c4[_0x0ab4('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x570f05);});}else{utils[_0x0ab4('0x12')]('CreateVoiceAgentReport',_0x570f05);}if(_0x4f3e19){delete transfers[_0x570f05[_0x0ab4('0x5')]];}else{delete agents[_0x570f05[_0x0ab4('0x13')]];}}exports[_0x0ab4('0x14')]=function(_0x1e2b56){try{utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x16'),_0x1e2b56[_0x0ab4('0x5')]),_0x1e2b56);agents[_0x1e2b56[_0x0ab4('0x13')]]=_0x1e2b56;agents[_0x1e2b56[_0x0ab4('0x13')]][_0x0ab4('0x17')]=utils[_0x0ab4('0x18')]();agents[_0x1e2b56[_0x0ab4('0x13')]][_0x0ab4('0x9')]=_0x0ab4('0x19');agents[_0x1e2b56[_0x0ab4('0x13')]][_0x0ab4('0x8')]=null;agents[_0x1e2b56[_0x0ab4('0x13')]]['connectedlinename']=null;utils['info'](util['format'](_0x0ab4('0x1a'),_0x1e2b56[_0x0ab4('0x5')],agents[_0x1e2b56[_0x0ab4('0x13')]]['membername'],_0x1e2b56[_0x0ab4('0x13')]));}catch(_0x13ea9f){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')]('[%s][agents][agentcalled]',_0x1e2b56['uniqueid']),_0x13ea9f);}};exports[_0x0ab4('0x1c')]=function(_0x5b1ed5){try{if(!_[_0x0ab4('0x1d')](agents[_0x5b1ed5[_0x0ab4('0x13')]])){utils['debug'](util[_0x0ab4('0x3')](_0x0ab4('0x1e'),_0x5b1ed5[_0x0ab4('0x5')]),_0x5b1ed5);utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5b1ed5['uniqueid'],agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x1f')],_0x5b1ed5[_0x0ab4('0x13')]));agents[_0x5b1ed5[_0x0ab4('0x13')]]['agentringnoanswer']=!![];agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x20')]=utils[_0x0ab4('0x18')]();agents[_0x5b1ed5['destuniqueid']]['lastevent']=_0x0ab4('0x21');agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x22')]='timeout';agents[_0x5b1ed5['destuniqueid']]['holdtime']=_0x5b1ed5[_0x0ab4('0x23')]?parseInt(_0x5b1ed5['ringtime'])/0x3e8:0x0;agents[_0x5b1ed5[_0x0ab4('0x13')]][_0x0ab4('0x24')]=0x0;unanswered['push'](_0x5b1ed5['destuniqueid']);}}catch(_0x4d0cc1){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')](_0x0ab4('0x1e'),_0x5b1ed5[_0x0ab4('0x5')]),_0x4d0cc1);}};exports[_0x0ab4('0x25')]=function(_0x588e0d){try{_['forIn'](agents,function(_0x580d56,_0x2e7a97){if(_0x580d56[_0x0ab4('0x5')]==_0x588e0d[_0x0ab4('0x5')]&&!_[_0x0ab4('0x26')](unanswered,_0x580d56[_0x0ab4('0x13')])){utils['debug'](util['format'](_0x0ab4('0x27'),_0x588e0d[_0x0ab4('0x5')]),_0x588e0d);utils[_0x0ab4('0x2')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x588e0d[_0x0ab4('0x5')],_0x580d56['membername'],_0x580d56[_0x0ab4('0x13')]));_0x580d56[_0x0ab4('0x1c')]=!![];_0x580d56[_0x0ab4('0x20')]=utils[_0x0ab4('0x18')]();_0x580d56[_0x0ab4('0x9')]=_0x0ab4('0x28');_0x580d56['reason']=_0x0ab4('0x28');_0x580d56[_0x0ab4('0x29')]=_0x588e0d[_0x0ab4('0x29')];_0x580d56[_0x0ab4('0x24')]=0x0;writeDB(_0x580d56);}});}catch(_0x4cce0c){utils['error'](util[_0x0ab4('0x3')](_0x0ab4('0x27'),_0x588e0d[_0x0ab4('0x5')]),_0x4cce0c);}};exports['agentconnect']=function(_0x507d77){try{if(agents[_0x507d77['destuniqueid']]){utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x2a'),_0x507d77['uniqueid']),_0x507d77);utils['info'](util['format'](_0x0ab4('0x2b'),_0x507d77[_0x0ab4('0x5')],agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x1f')],_0x507d77[_0x0ab4('0x13')]));agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x2c')]=utils[_0x0ab4('0x18')]();agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x8')]=_0x507d77['connectedlinenum'];agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x2d')]=_0x507d77[_0x0ab4('0x2d')];agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x29')]=_0x507d77[_0x0ab4('0x23')];agents[_0x507d77[_0x0ab4('0x13')]][_0x0ab4('0x9')]=_0x0ab4('0x2e');_[_0x0ab4('0x2f')](agents,function(_0x449437,_0x1974ce){if(_0x449437['destuniqueid']!=_0x507d77[_0x0ab4('0x13')]&&_0x449437[_0x0ab4('0x5')]==_0x507d77[_0x0ab4('0x5')]){_0x449437[_0x0ab4('0x24')]=0x0;_0x449437['holdtime']=_0x507d77[_0x0ab4('0x23')];_0x449437['agentringnoanswer']=!![];_0x449437[_0x0ab4('0x20')]=utils[_0x0ab4('0x18')]();_0x449437[_0x0ab4('0x9')]=_0x0ab4('0x30');_0x449437[_0x0ab4('0x22')]=_0x0ab4('0x30');_0x449437['answeredelsewheredestinationuniqueid']=_0x507d77[_0x0ab4('0x13')];_0x449437[_0x0ab4('0x31')]=_0x507d77[_0x0ab4('0x1f')];writeDB(_0x449437);}});}}catch(_0x48029f){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')](_0x0ab4('0x2a'),_0x507d77[_0x0ab4('0x5')]),_0x48029f);}};exports[_0x0ab4('0xe')]=function(_0x5aa047){try{if(!_['isNil'](agents[_0x5aa047['destuniqueid']])){utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')]('[%s][agents][agentcomplete]',_0x5aa047[_0x0ab4('0x5')]),_0x5aa047);utils['info'](util[_0x0ab4('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5aa047[_0x0ab4('0x5')],agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0x1f')],_0x5aa047[_0x0ab4('0x13')]));agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0xe')]=!![];agents[_0x5aa047['destuniqueid']][_0x0ab4('0x32')]=utils[_0x0ab4('0x18')]();agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0x24')]=utils[_0x0ab4('0x33')](agents[_0x5aa047[_0x0ab4('0x13')]]['agentcompleteAt'],agents[_0x5aa047[_0x0ab4('0x13')]]['agentconnectAt']);agents[_0x5aa047[_0x0ab4('0x13')]][_0x0ab4('0x22')]=_0x5aa047[_0x0ab4('0x22')];agents[_0x5aa047['destuniqueid']][_0x0ab4('0x9')]=_0x0ab4('0x34');writeDB(agents[_0x5aa047[_0x0ab4('0x13')]]);}}catch(_0x3c1247){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')]('[%s][agents][agentcomplete]',_0x5aa047[_0x0ab4('0x5')]),_0x3c1247);}};exports[_0x0ab4('0x35')]=function(_0x302894){try{if(!_[_0x0ab4('0x1d')](agents[_0x302894[_0x0ab4('0x36')]])){utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x37'),_0x302894[_0x0ab4('0x5')]),_0x302894);utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x38'),_0x302894[_0x0ab4('0x5')],agents[_0x302894['transfereruniqueid']][_0x0ab4('0x1f')],agents[_0x302894[_0x0ab4('0x36')]]['uniqueid']));agents[_0x302894[_0x0ab4('0x36')]]['transfer']=!![];agents[_0x302894['transfereruniqueid']][_0x0ab4('0x39')]=_0x0ab4('0x3a');agents[_0x302894[_0x0ab4('0x36')]]['transferexten']=_0x302894[_0x0ab4('0x3b')];agents[_0x302894[_0x0ab4('0x36')]][_0x0ab4('0x3c')]=agents[_0x302894[_0x0ab4('0x36')]][_0x0ab4('0x5')];}}catch(_0x3f20de){utils[_0x0ab4('0x1b')](util['format'](_0x0ab4('0x37'),_0x302894['uniqueid']),_0x3f20de);}};exports[_0x0ab4('0x3d')]=function(_0x55c073){try{utils[_0x0ab4('0x15')](util['format']('[%s][agents][attendedtransfer]',_0x55c073[_0x0ab4('0x3e')]),_0x55c073);if(_0x55c073[_0x0ab4('0x3e')]==_0x55c073[_0x0ab4('0x3f')]){if(!_[_0x0ab4('0x1d')](agents[_0x55c073['secondtransfereruniqueid']])){utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x40'),_0x55c073[_0x0ab4('0x3e')],agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x1f')]));agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x42')]=!![];agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x39')]=_0x0ab4('0x43');agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x44')]=_0x55c073[_0x0ab4('0x45')];agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x3c')]=_0x55c073[_0x0ab4('0x3e')];}if(_0x55c073[_0x0ab4('0x46')]&&agents[_0x55c073[_0x0ab4('0x46')]]){agents[_0x55c073['transfereeuniqueid']][_0x0ab4('0x47')]=0x1;transfers[_0x55c073[_0x0ab4('0x46')]]=_[_0x0ab4('0x48')](agents[_0x55c073[_0x0ab4('0x46')]]);transfers[_0x55c073[_0x0ab4('0x46')]][_0x0ab4('0x49')]=agents[_0x55c073[_0x0ab4('0x41')]][_0x0ab4('0x49')];transfers[_0x55c073['transfereeuniqueid']][_0x0ab4('0x4a')]=agents[_0x55c073[_0x0ab4('0x41')]]['calleridname'];transfers[_0x55c073['transfereeuniqueid']][_0x0ab4('0x17')]=utils[_0x0ab4('0x18')]();transfers[_0x55c073['transfereeuniqueid']]['agentconnectAt']=utils[_0x0ab4('0x18')]();transfers[_0x55c073['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x55c073[_0x0ab4('0x46')]][_0x0ab4('0x47')]=0x2;}}else if(_0x55c073[_0x0ab4('0x41')]==_0x55c073[_0x0ab4('0x4b')]){if(!_[_0x0ab4('0x1d')](agents[_0x55c073[_0x0ab4('0x3e')]])){utils[_0x0ab4('0x2')](util['format'](_0x0ab4('0x40'),_0x55c073[_0x0ab4('0x3e')],agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x1f')]));agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x42')]=!![];agents[_0x55c073['origtransfereruniqueid']][_0x0ab4('0x39')]=_0x0ab4('0x43');agents[_0x55c073['origtransfereruniqueid']][_0x0ab4('0x44')]=_0x55c073['secondtransfererexten'];agents[_0x55c073[_0x0ab4('0x3e')]]['transferuniqueid']=_0x55c073[_0x0ab4('0x41')];}if(_0x55c073[_0x0ab4('0x4c')]&&agents[_0x55c073[_0x0ab4('0x4c')]]){agents[_0x55c073[_0x0ab4('0x4c')]]['agententerreason']=0x1;transfers[_0x55c073['transfertargetuniqueid']]=_[_0x0ab4('0x48')](agents[_0x55c073[_0x0ab4('0x4c')]]);transfers[_0x55c073['transfertargetuniqueid']][_0x0ab4('0x49')]=agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x49')];transfers[_0x55c073['transfertargetuniqueid']][_0x0ab4('0x4a')]=agents[_0x55c073[_0x0ab4('0x3e')]][_0x0ab4('0x4a')];transfers[_0x55c073[_0x0ab4('0x4c')]][_0x0ab4('0x17')]=utils[_0x0ab4('0x18')]();transfers[_0x55c073[_0x0ab4('0x4c')]][_0x0ab4('0x2c')]=utils['now']();transfers[_0x55c073['transfertargetuniqueid']][_0x0ab4('0x29')]=0x0;transfers[_0x55c073[_0x0ab4('0x4c')]][_0x0ab4('0x47')]=0x2;}}}catch(_0xc23642){utils['error'](util[_0x0ab4('0x3')]('[%s][agents][attendedtransfer]',_0x55c073[_0x0ab4('0x3e')]),_0xc23642);}};exports[_0x0ab4('0x4d')]=function(_0x18308f){try{utils[_0x0ab4('0x15')](util[_0x0ab4('0x3')](_0x0ab4('0x4e'),_0x18308f[_0x0ab4('0x5')]),_0x18308f);if(agents[_0x18308f[_0x0ab4('0x5')]]&&agents[_0x18308f[_0x0ab4('0x5')]]['reason']===_0x0ab4('0x21')){if(_0x18308f['cause']==='21'){agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')]=_0x0ab4('0x4f');agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]=_0x0ab4('0x4f');}utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x50'),_0x18308f['uniqueid'],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x1f')],agents[_0x18308f['uniqueid']][_0x0ab4('0x22')],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]));writeDB(agents[_0x18308f['uniqueid']]);var _0x3feaaa=unanswered[_0x0ab4('0x51')](_0x18308f[_0x0ab4('0x5')]);if(_0x3feaaa>-0x1){unanswered[_0x0ab4('0x52')](_0x3feaaa,0x1);}}if(transfers[_0x18308f['uniqueid']]){transfers[_0x18308f['uniqueid']][_0x0ab4('0xe')]=!![];transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x32')]=utils[_0x0ab4('0x18')]();transfers[_0x18308f['uniqueid']][_0x0ab4('0x24')]=utils[_0x0ab4('0x33')](transfers[_0x18308f[_0x0ab4('0x5')]]['agentcompleteAt'],transfers[_0x18308f['uniqueid']][_0x0ab4('0x2c')]);transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')]=_0x0ab4('0x53');transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]=_0x0ab4('0x34');utils['info'](util[_0x0ab4('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x18308f['uniqueid'],transfers[_0x18308f[_0x0ab4('0x5')]]['membername'],transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')],transfers[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]));writeDB(transfers[_0x18308f[_0x0ab4('0x5')]],!![]);}if(agents[_0x18308f['uniqueid']]&&agents[_0x18308f['uniqueid']][_0x0ab4('0x2c')]){agents[_0x18308f[_0x0ab4('0x5')]]['agentcomplete']=!![];agents[_0x18308f['uniqueid']][_0x0ab4('0x32')]=utils[_0x0ab4('0x18')]();agents[_0x18308f['uniqueid']][_0x0ab4('0x24')]=utils[_0x0ab4('0x33')](agents[_0x18308f[_0x0ab4('0x5')]]['agentcompleteAt'],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x2c')]);agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')]=agents[_0x18308f['uniqueid']][_0x0ab4('0x42')]?_0x0ab4('0x42'):_0x0ab4('0x53');agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]=_0x0ab4('0x34');utils[_0x0ab4('0x2')](util[_0x0ab4('0x3')](_0x0ab4('0x50'),_0x18308f[_0x0ab4('0x5')],agents[_0x18308f['uniqueid']][_0x0ab4('0x1f')],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x22')],agents[_0x18308f[_0x0ab4('0x5')]][_0x0ab4('0x9')]));writeDB(agents[_0x18308f['uniqueid']]);}}catch(_0x448fcb){utils[_0x0ab4('0x1b')](util[_0x0ab4('0x3')](_0x0ab4('0x4e'),_0x18308f[_0x0ab4('0x5')]),_0x448fcb);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 10df25b..4ada9cb 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 _0xa34a=['calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','application','toLowerCase','set','cdr','appdata','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','destinationchannel','answertime','disposition','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid'];(function(_0x5737f7,_0xfe62e2){var _0x56d0c0=function(_0x2030cc){while(--_0x2030cc){_0x5737f7['push'](_0x5737f7['shift']());}};_0x56d0c0(++_0xfe62e2);}(_0xa34a,0x10a));var _0xaa34=function(_0x44457c,_0x581958){_0x44457c=_0x44457c-0x0;var _0x4e6d68=_0xa34a[_0x44457c];return _0x4e6d68;};'use strict';var _=require(_0xaa34('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xaa34('0x1'));var dispositions=['NO\x20ANSWER',_0xaa34('0x2'),_0xaa34('0x2'),_0xaa34('0x3'),_0xaa34('0x3'),_0xaa34('0x3'),'ANSWERED',_0xaa34('0x4'),_0xaa34('0x2'),'FAILED',_0xaa34('0x2')];var channels={};function writeDB(_0x3686a2){var _0x534798;if(transfers[_0xaa34('0x5')][_0x3686a2[_0xaa34('0x6')]]){_0x534798=_0x3686a2[_0xaa34('0x6')];_0x3686a2['uniqueid']=transfers['blinds'][_0x3686a2[_0xaa34('0x6')]][_0xaa34('0x7')];}utils['info'](util[_0xaa34('0x8')](_0xaa34('0x9'),_0x3686a2[_0xaa34('0x6')],_0x3686a2[_0xaa34('0xa')],_0x3686a2[_0xaa34('0xb')],_0x3686a2[_0xaa34('0xc')],_0x3686a2[_0xaa34('0xd')],_0x3686a2[_0xaa34('0xe')],_0x3686a2[_0xaa34('0xf')],_0x3686a2[_0xaa34('0x10')]));if(_0x3686a2[_0xaa34('0x11')]){utils[_0xaa34('0x12')](_0x3686a2['accountcode'])['then'](function(_0x273558){if(_0x273558){_0x3686a2['UserId']=_0x273558['id'];}utils['request'](_0xaa34('0x13'),_0x3686a2);});}else{utils[_0xaa34('0x14')]('CreateVoiceCallReport',_0x3686a2);}if(channels[_0x3686a2['uniqueid']]){delete channels[_0x3686a2[_0xaa34('0x6')]];}else if(_0x534798&&channels[_0x534798]){delete transfers[_0xaa34('0x5')][_0x534798];delete channels[_0x534798];}}exports[_0xaa34('0x15')]=function(_0x58a6dd){try{utils[_0xaa34('0x16')](util['format'](_0xaa34('0x17'),_0x58a6dd[_0xaa34('0x6')]),_0x58a6dd);if(_0x58a6dd['uniqueid']==_0x58a6dd['linkedid']&&_0x58a6dd[_0xaa34('0xa')]!=_0xaa34('0x18')){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x1a'),_0x58a6dd[_0xaa34('0x6')],_0x58a6dd['context'],_0x58a6dd[_0xaa34('0x1b')]));channels[_0x58a6dd[_0xaa34('0x6')]]={'uniqueid':_0x58a6dd[_0xaa34('0x6')],'accountcode':_0x58a6dd['accountcode'],'source':_0x58a6dd[_0xaa34('0xe')],'destination':_0x58a6dd[_0xaa34('0x1b')],'destinationcontext':_0x58a6dd[_0xaa34('0x1c')],'channel':_0x58a6dd[_0xaa34('0xa')],'starttime':utils[_0xaa34('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xaa34('0x1e')};}}catch(_0x9d4f34){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x17'),_0x58a6dd[_0xaa34('0x6')]),_0x9d4f34);}};exports['newstate']=function(_0x4c1471){try{utils['debug'](util['format'](_0xaa34('0x20'),_0x4c1471[_0xaa34('0x6')]),_0x4c1471);if(!_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x6')]])&&_0x4c1471[_0xaa34('0x22')]==0x6){utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x4c1471[_0xaa34('0x6')],_0x4c1471['context'],_0x4c1471[_0xaa34('0xa')]));if(_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x6')]][_0xaa34('0x23')])){channels[_0x4c1471[_0xaa34('0x6')]][_0xaa34('0x23')]=utils['now']();}}else if(!_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x24')]])&&_0x4c1471[_0xaa34('0x22')]==0x6&&_0x4c1471[_0xaa34('0x1c')]!=_0xaa34('0x25')){utils['info'](util[_0xaa34('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4c1471[_0xaa34('0x6')],_0x4c1471[_0xaa34('0x24')],_0x4c1471[_0xaa34('0x1c')],_0x4c1471[_0xaa34('0xa')]));channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x11')]=_0x4c1471[_0xaa34('0x11')];channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x26')]=_0x4c1471[_0xaa34('0xa')];if(_[_0xaa34('0x21')](channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x27')])){channels[_0x4c1471[_0xaa34('0x24')]][_0xaa34('0x27')]=utils['now']();}channels[_0x4c1471['linkedid']][_0xaa34('0x28')]=dispositions[_[_0xaa34('0x29')](_0x4c1471['channelstate'])]||_0xaa34('0x2a');}}catch(_0x32f213){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x20'),_0x4c1471[_0xaa34('0x6')]),_0x32f213);}};exports[_0xaa34('0x2b')]=function(_0x57a00b){try{if(!_['isNil'](channels[_0x57a00b[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util['format'](_0xaa34('0x2c'),_0x57a00b[_0xaa34('0x6')]),_0x57a00b);if(_[_0xaa34('0x21')](channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x2d')])){channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x2d')]=_0x57a00b[_0xaa34('0x2e')]+'\x20<'+_0x57a00b[_0xaa34('0xe')]+'>';}utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x2f'),_0x57a00b[_0xaa34('0x6')],channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x2d')],_0x57a00b[_0xaa34('0x30')]));channels[_0x57a00b[_0xaa34('0x6')]]['endtime']=utils['now']();channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x31')]=utils['diffTime'](channels[_0x57a00b['uniqueid']][_0xaa34('0x32')],channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x33')]);channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x34')]=channels[_0x57a00b[_0xaa34('0x6')]]['answertime']?utils[_0xaa34('0x35')](channels[_0x57a00b[_0xaa34('0x6')]][_0xaa34('0x32')],channels[_0x57a00b[_0xaa34('0x6')]]['answertime']):0x0;writeDB(channels[_0x57a00b[_0xaa34('0x6')]]);}}catch(_0x4e46cc){utils[_0xaa34('0x1f')](util['format'](_0xaa34('0x2c'),_0x57a00b[_0xaa34('0x6')]),_0x4e46cc);}};exports[_0xaa34('0x36')]=function(_0x34f9e8){try{if(!_[_0xaa34('0x21')](channels[_0x34f9e8[_0xaa34('0x37')]])){utils['debug'](util['format'](_0xaa34('0x38'),_0x34f9e8[_0xaa34('0x39')]),_0x34f9e8);if(channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0xa')]==_0x34f9e8[_0xaa34('0x3a')]){utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x34f9e8[_0xaa34('0x39')],_0x34f9e8[_0xaa34('0x37')],_0x34f9e8[_0xaa34('0x3b')]));channels[_0x34f9e8[_0xaa34('0x37')]]['destinationchannel']=_0x34f9e8[_0xaa34('0x3b')];channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0x3c')]=_0xaa34('0x3d');}else if(channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0xa')]=_0x34f9e8['transfertargetchannel']){utils['info'](util[_0xaa34('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x34f9e8[_0xaa34('0x39')],_0x34f9e8[_0xaa34('0x37')],_0x34f9e8[_0xaa34('0x3e')]));channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0x26')]=_0x34f9e8[_0xaa34('0x3e')];channels[_0x34f9e8[_0xaa34('0x37')]][_0xaa34('0x3c')]=_0xaa34('0x3d');}}}catch(_0x2ff1f2){utils[_0xaa34('0x1f')](util['format'](_0xaa34('0x38'),_0x34f9e8['origtransfereruniqueid']),_0x2ff1f2);}};exports[_0xaa34('0x3f')]=function(_0x3bb18d){try{if(!_[_0xaa34('0x21')](channels[_0x3bb18d[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util[_0xaa34('0x8')](_0xaa34('0x40'),_0x3bb18d[_0xaa34('0x6')]),_0x3bb18d);channels[_0x3bb18d['uniqueid']]['musiconholdstartAt']=utils[_0xaa34('0x1d')]();utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x41'),_0x3bb18d['uniqueid'],channels[_0x3bb18d['uniqueid']]['musiconholdstartAt']));}}catch(_0x2dc08a){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x40'),_0x3bb18d[_0xaa34('0x6')]),_0x2dc08a);}};exports[_0xaa34('0x42')]=function(_0x12d112){try{if(!_[_0xaa34('0x21')](channels[_0x12d112[_0xaa34('0x6')]])){utils['debug'](util['format'](_0xaa34('0x43'),_0x12d112['uniqueid']),_0x12d112);if(!_[_0xaa34('0x21')](channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x44')])){channels[_0x12d112[_0xaa34('0x6')]]['mohtime']+=utils[_0xaa34('0x35')](utils[_0xaa34('0x1d')](),channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x44')]);utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x12d112[_0xaa34('0x6')],channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x45')]));delete channels[_0x12d112[_0xaa34('0x6')]][_0xaa34('0x44')];}}}catch(_0x23ef00){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x43'),_0x12d112[_0xaa34('0x6')]),_0x23ef00);}};exports[_0xaa34('0x46')]=function(_0x4bad49){try{if(!_[_0xaa34('0x21')](channels[_0x4bad49[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util[_0xaa34('0x8')]('[%s][calls][varset]',_0x4bad49['uniqueid']),_0x4bad49);if(!_['isNil'](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x48')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x49'),_0x4bad49[_0xaa34('0x6')],_0x4bad49['value']));channels[_0x4bad49['uniqueid']][_0xaa34('0x4a')]=_0x4bad49[_0xaa34('0x4b')];}if(!_[_0xaa34('0x21')](_0x4bad49['variable'][_0xaa34('0x4c')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]]['destination']=_0x4bad49[_0xaa34('0x4b')];channels[_0x4bad49['uniqueid']][_0xaa34('0x2d')]='\x22'+_0x4bad49[_0xaa34('0x4b')]+'\x22\x20<'+_0x4bad49[_0xaa34('0x4b')]+'>';}if(!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x4d')])||!_['isNil'](_0x4bad49['variable'][_0xaa34('0x4e')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x4f'),_0x4bad49[_0xaa34('0x6')],!_[_0xaa34('0x21')](_0x4bad49['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':'xmd-callerid',_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]][_0xaa34('0x2d')]=_0x4bad49[_0xaa34('0x4b')];}if(!_['isNil'](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x50')])||!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')]['xmcs-queue'])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x4f'),_0x4bad49[_0xaa34('0x6')],!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')]['xmd-queue'])?_0xaa34('0x50'):'xmcs-queue',_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49['uniqueid']]['lastapplication']='Queue';channels[_0x4bad49[_0xaa34('0x6')]][_0xaa34('0x51')]=_0x4bad49[_0xaa34('0x4b')];channels[_0x4bad49['uniqueid']][_0xaa34('0xb')]=!![];}if(!_[_0xaa34('0x21')](_0x4bad49['variable']['xmd-contactid'])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x52'),_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]]['ContactId']=_0x4bad49[_0xaa34('0x4b')];}if(!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x53')])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x54'),_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49[_0xaa34('0x6')]]['type']=_0x4bad49[_0xaa34('0x4b')];}if(!_['isNil'](_0x4bad49[_0xaa34('0x47')]['outboundrouteid'])){utils[_0xaa34('0x19')](util[_0xaa34('0x8')](_0xaa34('0x55'),_0x4bad49[_0xaa34('0x6')],_0x4bad49[_0xaa34('0x4b')]));channels[_0x4bad49['uniqueid']][_0xaa34('0x56')]=_0x4bad49[_0xaa34('0x4b')];}if(!_[_0xaa34('0x21')](_0x4bad49[_0xaa34('0x47')][_0xaa34('0x57')])){utils['info'](util[_0xaa34('0x8')](_0xaa34('0x58'),_0x4bad49['uniqueid'],_0x4bad49['value']));channels[_0x4bad49[_0xaa34('0x6')]][_0xaa34('0x57')]=_0x4bad49[_0xaa34('0x4b')];}}}catch(_0x40157b){utils[_0xaa34('0x1f')](util['format'](_0xaa34('0x59'),_0x4bad49[_0xaa34('0x6')]),_0x40157b);}};exports['newexten']=function(_0x267633){try{if(!_[_0xaa34('0x21')](channels[_0x267633[_0xaa34('0x6')]])){utils[_0xaa34('0x16')](util['format'](_0xaa34('0x5a'),_0x267633[_0xaa34('0x6')]),_0x267633);utils[_0xaa34('0x19')](util[_0xaa34('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x267633[_0xaa34('0x6')],_0x267633['application'],_0x267633['appdata']));if(_0x267633[_0xaa34('0x5b')][_0xaa34('0x5c')]()==_0xaa34('0x5d')&&_['startsWith'](_0x267633['appdata'][_0xaa34('0x5c')](),_0xaa34('0x5e'))){var _0x18267b=_0x267633[_0xaa34('0x5f')][_0xaa34('0x60')]('=');var _0x22b349=_0x18267b[0x0][_0xaa34('0x61')](_0x18267b[0x0]['lastIndexOf']('(')+0x1,_0x18267b[0x0][_0xaa34('0x62')](')'));var _0x4b5a6f=_0x18267b[0x1];channels[_0x267633[_0xaa34('0x6')]][_0x22b349]=_0x4b5a6f;}if(!_[_0xaa34('0x63')]([_0xaa34('0x2b'),_0xaa34('0x64'),_0xaa34('0x65'),'set',_0xaa34('0x66')],_0x267633[_0xaa34('0x5b')][_0xaa34('0x5c')]())){channels[_0x267633[_0xaa34('0x6')]][_0xaa34('0x67')]=_0x267633[_0xaa34('0x5b')];channels[_0x267633[_0xaa34('0x6')]]['lastdata']=_0x267633['appdata'];}}}catch(_0x308a0a){utils[_0xaa34('0x1f')](util[_0xaa34('0x8')](_0xaa34('0x5a'),_0x267633[_0xaa34('0x6')]),_0x308a0a);}}; \ No newline at end of file +var _0xa2a9=['xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','format','linkedid','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','error','hangup','[%s][calls][hangup]','calleridname','calleridnum','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstartAt','now','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<'];(function(_0x564cd0,_0x1fdcd0){var _0x303032=function(_0x1eb068){while(--_0x1eb068){_0x564cd0['push'](_0x564cd0['shift']());}};_0x303032(++_0x1fdcd0);}(_0xa2a9,0x89));var _0x9a2a=function(_0x51f983,_0x566b44){_0x51f983=_0x51f983-0x0;var _0x3f182a=_0xa2a9[_0x51f983];return _0x3f182a;};'use strict';var _=require(_0x9a2a('0x0'));var util=require(_0x9a2a('0x1'));var utils=require(_0x9a2a('0x2'));var transfers=require(_0x9a2a('0x3'));var dispositions=[_0x9a2a('0x4'),_0x9a2a('0x5'),'FAILED',_0x9a2a('0x4'),'NO\x20ANSWER','NO\x20ANSWER',_0x9a2a('0x6'),'BUSY',_0x9a2a('0x5'),_0x9a2a('0x5'),_0x9a2a('0x5')];var channels={};function writeDB(_0x447e82){var _0x1a09c3;if(transfers[_0x9a2a('0x7')][_0x447e82[_0x9a2a('0x8')]]){_0x1a09c3=_0x447e82[_0x9a2a('0x8')];_0x447e82[_0x9a2a('0x8')]=transfers['blinds'][_0x447e82[_0x9a2a('0x8')]]['transfereeuniqueid'];}utils[_0x9a2a('0x9')](util['format'](_0x9a2a('0xa'),_0x447e82[_0x9a2a('0x8')],_0x447e82['channel'],_0x447e82[_0x9a2a('0xb')],_0x447e82[_0x9a2a('0xc')],_0x447e82[_0x9a2a('0xd')],_0x447e82['calleridnum'],_0x447e82[_0x9a2a('0xe')],_0x447e82[_0x9a2a('0xf')]));if(_0x447e82[_0x9a2a('0x10')]){utils[_0x9a2a('0x11')](_0x447e82['accountcode'])[_0x9a2a('0x12')](function(_0x2ed0ce){if(_0x2ed0ce){_0x447e82[_0x9a2a('0x13')]=_0x2ed0ce['id'];}utils[_0x9a2a('0x14')](_0x9a2a('0x15'),_0x447e82);});}else{utils['request'](_0x9a2a('0x15'),_0x447e82);}if(channels[_0x447e82[_0x9a2a('0x8')]]){delete channels[_0x447e82[_0x9a2a('0x8')]];}else if(_0x1a09c3&&channels[_0x1a09c3]){delete transfers['blinds'][_0x1a09c3];delete channels[_0x1a09c3];}}exports['newchannel']=function(_0x7714e9){try{utils['debug'](util[_0x9a2a('0x16')]('[%s][calls][newchannel]',_0x7714e9[_0x9a2a('0x8')]),_0x7714e9);if(_0x7714e9[_0x9a2a('0x8')]==_0x7714e9[_0x9a2a('0x17')]&&_0x7714e9[_0x9a2a('0x18')]!='OutgoingSpoolFailed'){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')](_0x9a2a('0x19'),_0x7714e9[_0x9a2a('0x8')],_0x7714e9[_0x9a2a('0x1a')],_0x7714e9[_0x9a2a('0x1b')]));channels[_0x7714e9[_0x9a2a('0x8')]]={'uniqueid':_0x7714e9[_0x9a2a('0x8')],'accountcode':_0x7714e9[_0x9a2a('0x10')],'source':_0x7714e9['calleridnum'],'destination':_0x7714e9[_0x9a2a('0x1b')],'destinationcontext':_0x7714e9[_0x9a2a('0x1a')],'channel':_0x7714e9[_0x9a2a('0x18')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9a2a('0x4'),'amaflags':_0x9a2a('0x1c')};}}catch(_0x2acc5f){utils['error'](util['format'](_0x9a2a('0x1d'),_0x7714e9[_0x9a2a('0x8')]),_0x2acc5f);}};exports[_0x9a2a('0x1e')]=function(_0x548a9a){try{utils[_0x9a2a('0x1f')](util['format'](_0x9a2a('0x20'),_0x548a9a['uniqueid']),_0x548a9a);if(!_[_0x9a2a('0x21')](channels[_0x548a9a[_0x9a2a('0x8')]])&&_0x548a9a['channelstate']==0x6){utils['info'](util[_0x9a2a('0x16')](_0x9a2a('0x22'),_0x548a9a[_0x9a2a('0x8')],_0x548a9a[_0x9a2a('0x1a')],_0x548a9a['channel']));if(_[_0x9a2a('0x21')](channels[_0x548a9a['uniqueid']][_0x9a2a('0x23')])){channels[_0x548a9a[_0x9a2a('0x8')]][_0x9a2a('0x23')]=utils['now']();}}else if(!_[_0x9a2a('0x21')](channels[_0x548a9a[_0x9a2a('0x17')]])&&_0x548a9a[_0x9a2a('0x24')]==0x6&&_0x548a9a['context']!=_0x9a2a('0x25')){utils[_0x9a2a('0x9')](util['format'](_0x9a2a('0x26'),_0x548a9a['uniqueid'],_0x548a9a[_0x9a2a('0x17')],_0x548a9a[_0x9a2a('0x1a')],_0x548a9a['channel']));channels[_0x548a9a[_0x9a2a('0x17')]][_0x9a2a('0x10')]=_0x548a9a[_0x9a2a('0x10')];channels[_0x548a9a[_0x9a2a('0x17')]]['destinationchannel']=_0x548a9a['channel'];if(_['isNil'](channels[_0x548a9a[_0x9a2a('0x17')]]['answertime'])){channels[_0x548a9a[_0x9a2a('0x17')]][_0x9a2a('0x27')]=utils['now']();}channels[_0x548a9a[_0x9a2a('0x17')]]['disposition']=dispositions[_['toNumber'](_0x548a9a['channelstate'])]||_0x9a2a('0x6');}}catch(_0x558961){utils[_0x9a2a('0x28')](util['format'](_0x9a2a('0x20'),_0x548a9a[_0x9a2a('0x8')]),_0x558961);}};exports[_0x9a2a('0x29')]=function(_0x37ab1a){try{if(!_[_0x9a2a('0x21')](channels[_0x37ab1a[_0x9a2a('0x8')]])){utils[_0x9a2a('0x1f')](util['format'](_0x9a2a('0x2a'),_0x37ab1a[_0x9a2a('0x8')]),_0x37ab1a);if(_[_0x9a2a('0x21')](channels[_0x37ab1a[_0x9a2a('0x8')]]['callerid'])){channels[_0x37ab1a['uniqueid']]['callerid']=_0x37ab1a[_0x9a2a('0x2b')]+'\x20<'+_0x37ab1a[_0x9a2a('0x2c')]+'>';}utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x37ab1a[_0x9a2a('0x8')],channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x2d')],_0x37ab1a[_0x9a2a('0x2e')]));channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x2f')]=utils['now']();channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x30')]=utils[_0x9a2a('0x31')](channels[_0x37ab1a['uniqueid']]['endtime'],channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x32')]);channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x33')]=channels[_0x37ab1a['uniqueid']]['answertime']?utils[_0x9a2a('0x31')](channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x2f')],channels[_0x37ab1a[_0x9a2a('0x8')]][_0x9a2a('0x27')]):0x0;writeDB(channels[_0x37ab1a[_0x9a2a('0x8')]]);}}catch(_0x154770){utils[_0x9a2a('0x28')](util[_0x9a2a('0x16')]('[%s][calls][hangup]',_0x37ab1a[_0x9a2a('0x8')]),_0x154770);}};exports['attendedtransfer']=function(_0x413ba9){try{if(!_[_0x9a2a('0x21')](channels[_0x413ba9[_0x9a2a('0x34')]])){utils[_0x9a2a('0x1f')](util['format'](_0x9a2a('0x35'),_0x413ba9[_0x9a2a('0x36')]),_0x413ba9);if(channels[_0x413ba9[_0x9a2a('0x34')]][_0x9a2a('0x18')]==_0x413ba9[_0x9a2a('0x37')]){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')](_0x9a2a('0x38'),_0x413ba9['origtransfereruniqueid'],_0x413ba9['localtwolinkedid'],_0x413ba9[_0x9a2a('0x39')]));channels[_0x413ba9[_0x9a2a('0x34')]][_0x9a2a('0x3a')]=_0x413ba9[_0x9a2a('0x39')];channels[_0x413ba9['localtwolinkedid']][_0x9a2a('0x3b')]=_0x9a2a('0x3c');}else if(channels[_0x413ba9[_0x9a2a('0x34')]][_0x9a2a('0x18')]=_0x413ba9['transfertargetchannel']){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')](_0x9a2a('0x38'),_0x413ba9[_0x9a2a('0x36')],_0x413ba9[_0x9a2a('0x34')],_0x413ba9['origtransfererchannel']));channels[_0x413ba9['localtwolinkedid']][_0x9a2a('0x3a')]=_0x413ba9[_0x9a2a('0x3d')];channels[_0x413ba9['localtwolinkedid']][_0x9a2a('0x3b')]=_0x9a2a('0x3c');}}}catch(_0x549143){utils[_0x9a2a('0x28')](util['format'](_0x9a2a('0x35'),_0x413ba9['origtransfereruniqueid']),_0x549143);}};exports[_0x9a2a('0x3e')]=function(_0x5bccd8){try{if(!_[_0x9a2a('0x21')](channels[_0x5bccd8[_0x9a2a('0x8')]])){utils[_0x9a2a('0x1f')](util[_0x9a2a('0x16')]('[%s][calls][musiconholdstart]',_0x5bccd8[_0x9a2a('0x8')]),_0x5bccd8);channels[_0x5bccd8[_0x9a2a('0x8')]][_0x9a2a('0x3f')]=utils[_0x9a2a('0x40')]();utils[_0x9a2a('0x9')](util['format'](_0x9a2a('0x41'),_0x5bccd8[_0x9a2a('0x8')],channels[_0x5bccd8[_0x9a2a('0x8')]][_0x9a2a('0x3f')]));}}catch(_0x23c847){utils[_0x9a2a('0x28')](util[_0x9a2a('0x16')]('[%s][calls][musiconholdstart]',_0x5bccd8[_0x9a2a('0x8')]),_0x23c847);}};exports[_0x9a2a('0x42')]=function(_0x238a94){try{if(!_['isNil'](channels[_0x238a94[_0x9a2a('0x8')]])){utils['debug'](util[_0x9a2a('0x16')]('[%s][calls][musiconholdstop]',_0x238a94[_0x9a2a('0x8')]),_0x238a94);if(!_[_0x9a2a('0x21')](channels[_0x238a94[_0x9a2a('0x8')]][_0x9a2a('0x3f')])){channels[_0x238a94[_0x9a2a('0x8')]][_0x9a2a('0x43')]+=utils[_0x9a2a('0x31')](utils[_0x9a2a('0x40')](),channels[_0x238a94[_0x9a2a('0x8')]][_0x9a2a('0x3f')]);utils[_0x9a2a('0x9')](util['format'](_0x9a2a('0x44'),_0x238a94[_0x9a2a('0x8')],channels[_0x238a94[_0x9a2a('0x8')]]['mohtime']));delete channels[_0x238a94['uniqueid']][_0x9a2a('0x3f')];}}}catch(_0x235f78){utils[_0x9a2a('0x28')](util['format'](_0x9a2a('0x45'),_0x238a94[_0x9a2a('0x8')]),_0x235f78);}};exports['varset']=function(_0x43df46){try{if(!_[_0x9a2a('0x21')](channels[_0x43df46[_0x9a2a('0x8')]])){utils[_0x9a2a('0x1f')](util[_0x9a2a('0x16')](_0x9a2a('0x46'),_0x43df46[_0x9a2a('0x8')]),_0x43df46);if(!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x48')])){utils['info'](util[_0x9a2a('0x16')](_0x9a2a('0x49'),_0x43df46['uniqueid'],_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0x4b')]=_0x43df46[_0x9a2a('0x4a')];}if(!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x4c')])){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x43df46[_0x9a2a('0x8')],_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0x4d')]=_0x43df46[_0x9a2a('0x4a')];channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0x2d')]='\x22'+_0x43df46[_0x9a2a('0x4a')]+_0x9a2a('0x4e')+_0x43df46[_0x9a2a('0x4a')]+'>';}if(!_['isNil'](_0x43df46[_0x9a2a('0x47')]['xmd-callerid-preview'])||!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x4f')])){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')](_0x9a2a('0x50'),_0x43df46[_0x9a2a('0x8')],!_[_0x9a2a('0x21')](_0x43df46['variable'][_0x9a2a('0x51')])?'xmd-callerid-preview':_0x9a2a('0x4f'),_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0x2d')]=_0x43df46['value'];}if(!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x52')])||!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x53')])){utils[_0x9a2a('0x9')](util['format'](_0x9a2a('0x50'),_0x43df46[_0x9a2a('0x8')],!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x52')])?_0x9a2a('0x52'):_0x9a2a('0x53'),_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0x54')]=_0x9a2a('0x55');channels[_0x43df46[_0x9a2a('0x8')]]['lastdata']=_0x43df46[_0x9a2a('0x4a')];channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0xb')]=!![];}if(!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x56')])){utils[_0x9a2a('0x9')](util['format'](_0x9a2a('0x57'),_0x43df46['uniqueid'],_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46['uniqueid']]['ContactId']=_0x43df46[_0x9a2a('0x4a')];}if(!_[_0x9a2a('0x21')](_0x43df46['variable'][_0x9a2a('0x58')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x43df46[_0x9a2a('0x8')],_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46[_0x9a2a('0x8')]][_0x9a2a('0x59')]=_0x43df46['value'];}if(!_['isNil'](_0x43df46['variable'][_0x9a2a('0x5a')])){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')](_0x9a2a('0x5b'),_0x43df46[_0x9a2a('0x8')],_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46['uniqueid']]['routeid']=_0x43df46['value'];}if(!_[_0x9a2a('0x21')](_0x43df46[_0x9a2a('0x47')][_0x9a2a('0x5c')])){utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')](_0x9a2a('0x5d'),_0x43df46[_0x9a2a('0x8')],_0x43df46[_0x9a2a('0x4a')]));channels[_0x43df46[_0x9a2a('0x8')]]['sipcallid']=_0x43df46[_0x9a2a('0x4a')];}}}catch(_0x4590ad){utils[_0x9a2a('0x28')](util[_0x9a2a('0x16')](_0x9a2a('0x46'),_0x43df46['uniqueid']),_0x4590ad);}};exports[_0x9a2a('0x5e')]=function(_0x4a4892){try{if(!_['isNil'](channels[_0x4a4892[_0x9a2a('0x8')]])){utils['debug'](util[_0x9a2a('0x16')]('[%s][calls][newexten]',_0x4a4892['uniqueid']),_0x4a4892);utils[_0x9a2a('0x9')](util[_0x9a2a('0x16')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4a4892[_0x9a2a('0x8')],_0x4a4892[_0x9a2a('0x5f')],_0x4a4892['appdata']));if(_0x4a4892[_0x9a2a('0x5f')][_0x9a2a('0x60')]()==_0x9a2a('0x61')&&_[_0x9a2a('0x62')](_0x4a4892[_0x9a2a('0x63')]['toLowerCase'](),_0x9a2a('0x64'))){var _0x581344=_0x4a4892['appdata'][_0x9a2a('0x65')]('=');var _0x4b4c7e=_0x581344[0x0][_0x9a2a('0x66')](_0x581344[0x0][_0x9a2a('0x67')]('(')+0x1,_0x581344[0x0][_0x9a2a('0x67')](')'));var _0x292a=_0x581344[0x1];channels[_0x4a4892[_0x9a2a('0x8')]][_0x4b4c7e]=_0x292a;}if(!_['includes']([_0x9a2a('0x29'),_0x9a2a('0x68'),_0x9a2a('0x69'),'set',_0x9a2a('0x6a')],_0x4a4892[_0x9a2a('0x5f')][_0x9a2a('0x60')]())){channels[_0x4a4892[_0x9a2a('0x8')]][_0x9a2a('0x54')]=_0x4a4892[_0x9a2a('0x5f')];channels[_0x4a4892[_0x9a2a('0x8')]][_0x9a2a('0x6b')]=_0x4a4892[_0x9a2a('0x63')];}}}catch(_0x450e4a){utils['error'](util[_0x9a2a('0x16')]('[%s][calls][newexten]',_0x4a4892[_0x9a2a('0x8')]),_0x450e4a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1676602..69b3360 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 _0xd7ad=['shutdown','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','managerevent','./utils','connect'];(function(_0x487870,_0x527924){var _0x3ab6af=function(_0x1febe3){while(--_0x1febe3){_0x487870['push'](_0x487870['shift']());}};_0x3ab6af(++_0x527924);}(_0xd7ad,0x15c));var _0xdd7a=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xd7ad[_0x903228];return _0xcec81d;};'use strict';var utils=require(_0xdd7a('0x0'));exports[_0xdd7a('0x1')]=function(){utils['info']('[core]\x20connected');};exports[_0xdd7a('0x2')]=function(){utils[_0xdd7a('0x3')](_0xdd7a('0x4'));};exports[_0xdd7a('0x5')]=function(){utils['info'](_0xdd7a('0x6'));};exports[_0xdd7a('0x7')]=function(_0x46f9c7){utils[_0xdd7a('0x7')]('[core]\x20error',_0x46f9c7);};exports[_0xdd7a('0x8')]=function(){utils[_0xdd7a('0x3')]('[core]\x20close');};exports[_0xdd7a('0x9')]=function(_0x3263d9){}; \ No newline at end of file +var _0xf555=['[core]\x20shutdown','fullybooted','error','managerevent','./utils','connect','info','[core]\x20connected','shutdown'];(function(_0x206cdf,_0x23b424){var _0x2e9e41=function(_0x375d0d){while(--_0x375d0d){_0x206cdf['push'](_0x206cdf['shift']());}};_0x2e9e41(++_0x23b424);}(_0xf555,0xc1));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x5f55('0x0'));exports[_0x5f55('0x1')]=function(){utils[_0x5f55('0x2')](_0x5f55('0x3'));};exports[_0x5f55('0x4')]=function(){utils['info'](_0x5f55('0x5'));};exports[_0x5f55('0x6')]=function(){utils[_0x5f55('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x1641a6){utils[_0x5f55('0x7')]('[core]\x20error',_0x1641a6);};exports['close']=function(){utils[_0x5f55('0x2')]('[core]\x20close');};exports[_0x5f55('0x8')]=function(_0x4685dc){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ba345b8..304c95b 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 _0x500b=['isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','endtime','diffTime','billableseconds','[%s][dials][hangup]','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','application','toLowerCase','cdr(routeid)','appdata','error','varset','[%s][dials][varset]'];(function(_0x353753,_0x2658f3){var _0x89b646=function(_0x1e2cba){while(--_0x1e2cba){_0x353753['push'](_0x353753['shift']());}};_0x89b646(++_0x2658f3);}(_0x500b,0x110));var _0xb500=function(_0x58ee96,_0x5affd5){_0x58ee96=_0x58ee96-0x0;var _0xb346aa=_0x500b[_0x58ee96];return _0xb346aa;};'use strict';var _=require('lodash');var util=require(_0xb500('0x0'));var utils=require(_0xb500('0x1'));var dials={};function writeDB(_0x4c35f0){utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x4'),_0x4c35f0['uniqueid'],_0x4c35f0['channel'],_0x4c35f0[_0xb500('0x5')],_0x4c35f0[_0xb500('0x6')],_0x4c35f0[_0xb500('0x7')],_0x4c35f0[_0xb500('0x8')]));utils[_0xb500('0x9')](_0xb500('0xa'),_0x4c35f0);delete dials[_0x4c35f0[_0xb500('0xb')]];}exports[_0xb500('0xc')]=function(_0x4c8435){try{utils[_0xb500('0xd')](util[_0xb500('0x3')](_0xb500('0xe'),_0x4c8435[_0xb500('0xb')]),_0x4c8435);utils['info'](util[_0xb500('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4c8435[_0xb500('0xb')],_0x4c8435[_0xb500('0xf')],_0x4c8435['appdata']));if(_0x4c8435['application'][_0xb500('0x10')]()=='set'&&_['startsWith'](_0x4c8435['appdata'][_0xb500('0x10')](),_0xb500('0x11'))){var _0x499beb=_0x4c8435[_0xb500('0x12')]['split']('=');dials[_0x4c8435[_0xb500('0xb')]]={'routeId':_0x499beb[0x1]};}}catch(_0x5a77e2){utils[_0xb500('0x13')](util[_0xb500('0x3')]('[%s][dials][newexten]',_0x4c8435['uniqueid']),_0x5a77e2);}};exports[_0xb500('0x14')]=function(_0x51aff3){try{utils[_0xb500('0xd')](util[_0xb500('0x3')](_0xb500('0x15'),_0x51aff3[_0xb500('0xb')]),_0x51aff3);if(!_[_0xb500('0x16')](_0x51aff3[_0xb500('0x17')][_0xb500('0x18')])){utils[_0xb500('0x2')](util['format'](_0xb500('0x19'),_0x51aff3[_0xb500('0xb')],_0x51aff3[_0xb500('0x1a')]));dials[_0x51aff3[_0xb500('0xb')]]={'routeId':_0x51aff3[_0xb500('0x1a')]};}}catch(_0x54b71f){utils[_0xb500('0x13')](util[_0xb500('0x3')]('[%s][dials][varset]',_0x51aff3['uniqueid']),_0x54b71f);}};exports['dialbegin']=function(_0x185540){try{if(!_[_0xb500('0x16')](dials[_0x185540[_0xb500('0xb')]])){utils['debug'](util['format'](_0xb500('0x1b'),_0x185540[_0xb500('0xb')]),_0x185540);dials[_0x185540[_0xb500('0xb')]]=_[_0xb500('0x1c')](dials[_0x185540[_0xb500('0xb')]],_0x185540);dials[_0x185540[_0xb500('0xb')]][_0xb500('0x1d')]=utils[_0xb500('0x1e')]();dials[_0x185540[_0xb500('0xb')]][_0xb500('0x1f')]=_0xb500('0x20');utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x21'),_0x185540[_0xb500('0xb')],dials[_0x185540['uniqueid']][_0xb500('0x1d')]));}}catch(_0x11f644){utils['error'](util['format'](_0xb500('0x1b'),_0x185540[_0xb500('0xb')]),_0x11f644);}};exports[_0xb500('0x22')]=function(_0x1d98c2){try{if(!_[_0xb500('0x16')](dials[_0x1d98c2['uniqueid']])){utils[_0xb500('0xd')](util[_0xb500('0x3')](_0xb500('0x23'),_0x1d98c2[_0xb500('0xb')]),_0x1d98c2);dials[_0x1d98c2['uniqueid']][_0xb500('0x8')]=_0x1d98c2['dialstatus'];if(_0x1d98c2[_0xb500('0x8')]=='ANSWER'){dials[_0x1d98c2[_0xb500('0xb')]]=_[_0xb500('0x1c')](dials[_0x1d98c2[_0xb500('0xb')]],_0x1d98c2);dials[_0x1d98c2['uniqueid']][_0xb500('0x24')]=utils['now']();dials[_0x1d98c2[_0xb500('0xb')]][_0xb500('0x1f')]=_0xb500('0x25');utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x26'),_0x1d98c2[_0xb500('0xb')],_0x1d98c2[_0xb500('0x8')],dials[_0x1d98c2[_0xb500('0xb')]]['answertime']));}else{utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x27'),_0x1d98c2[_0xb500('0xb')],_0x1d98c2[_0xb500('0x8')]));}}}catch(_0x38b80e){utils[_0xb500('0x13')](util[_0xb500('0x3')](_0xb500('0x23'),_0x1d98c2['uniqueid']),_0x38b80e);}};exports[_0xb500('0x28')]=function(_0x4981e3){try{if(!_[_0xb500('0x16')](dials[_0x4981e3[_0xb500('0xb')]])){utils[_0xb500('0xd')](util[_0xb500('0x3')]('[%s][dials][hangup]',_0x4981e3[_0xb500('0xb')]),_0x4981e3);utils[_0xb500('0x2')](util[_0xb500('0x3')](_0xb500('0x29'),_0x4981e3[_0xb500('0xb')],_0x4981e3['calleridnum'],_0x4981e3[_0xb500('0x2a')],_0x4981e3[_0xb500('0x2b')]));dials[_0x4981e3[_0xb500('0xb')]]=_[_0xb500('0x1c')](dials[_0x4981e3['uniqueid']],{'endtime':utils[_0xb500('0x1e')](),'lastevent':_0xb500('0x2c')});dials[_0x4981e3[_0xb500('0xb')]]['duration']=utils['diffTime'](dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x2d')],dials[_0x4981e3[_0xb500('0xb')]]['starttime']);dials[_0x4981e3[_0xb500('0xb')]]['holdtime']=utils[_0xb500('0x2e')](dials[_0x4981e3['uniqueid']]['answertime']||dials[_0x4981e3['uniqueid']][_0xb500('0x2d')],dials[_0x4981e3[_0xb500('0xb')]]['starttime']);dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x2f')]=dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x24')]?utils['diffTime'](dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x2d')],dials[_0x4981e3[_0xb500('0xb')]][_0xb500('0x24')]):0x0;writeDB(dials[_0x4981e3['uniqueid']]);}}catch(_0x4f1cb9){utils[_0xb500('0x13')](util[_0xb500('0x3')](_0xb500('0x30'),_0x4981e3[_0xb500('0xb')]),_0x4f1cb9);}}; \ No newline at end of file +var _0x2d88=['channel','dialstatus','request','newexten','debug','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','error','[%s][dials][varset]','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','isNil','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','duration','diffTime','holdtime','endtime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid'];(function(_0x261c23,_0x3eea94){var _0x22116b=function(_0xf126f9){while(--_0xf126f9){_0x261c23['push'](_0x261c23['shift']());}};_0x22116b(++_0x3eea94);}(_0x2d88,0x1cf));var _0x82d8=function(_0xb74b54,_0x2247ff){_0xb74b54=_0xb74b54-0x0;var _0x4e7bdf=_0x2d88[_0xb74b54];return _0x4e7bdf;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var utils=require(_0x82d8('0x2'));var dials={};function writeDB(_0x3cf538){utils[_0x82d8('0x3')](util[_0x82d8('0x4')](_0x82d8('0x5'),_0x3cf538[_0x82d8('0x6')],_0x3cf538[_0x82d8('0x7')],_0x3cf538['dialstring'],_0x3cf538['calleridnum'],_0x3cf538['connectedlinenum'],_0x3cf538[_0x82d8('0x8')]));utils[_0x82d8('0x9')]('CreateVoiceDialReport',_0x3cf538);delete dials[_0x3cf538[_0x82d8('0x6')]];}exports[_0x82d8('0xa')]=function(_0x9918e0){try{utils[_0x82d8('0xb')](util[_0x82d8('0x4')]('[%s][dials][newexten]',_0x9918e0[_0x82d8('0x6')]),_0x9918e0);utils[_0x82d8('0x3')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x9918e0[_0x82d8('0x6')],_0x9918e0[_0x82d8('0xc')],_0x9918e0[_0x82d8('0xd')]));if(_0x9918e0[_0x82d8('0xc')]['toLowerCase']()==_0x82d8('0xe')&&_[_0x82d8('0xf')](_0x9918e0[_0x82d8('0xd')][_0x82d8('0x10')](),_0x82d8('0x11'))){var _0x1ef1b7=_0x9918e0[_0x82d8('0xd')]['split']('=');dials[_0x9918e0['uniqueid']]={'routeId':_0x1ef1b7[0x1]};}}catch(_0x46a233){utils[_0x82d8('0x12')](util[_0x82d8('0x4')]('[%s][dials][newexten]',_0x9918e0[_0x82d8('0x6')]),_0x46a233);}};exports['varset']=function(_0x292e82){try{utils[_0x82d8('0xb')](util[_0x82d8('0x4')](_0x82d8('0x13'),_0x292e82[_0x82d8('0x6')]),_0x292e82);if(!_['isNil'](_0x292e82[_0x82d8('0x14')][_0x82d8('0x15')])){utils[_0x82d8('0x3')](util[_0x82d8('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x292e82[_0x82d8('0x6')],_0x292e82[_0x82d8('0x16')]));dials[_0x292e82[_0x82d8('0x6')]]={'routeId':_0x292e82[_0x82d8('0x16')]};}}catch(_0xdc3290){utils[_0x82d8('0x12')](util[_0x82d8('0x4')]('[%s][dials][varset]',_0x292e82[_0x82d8('0x6')]),_0xdc3290);}};exports[_0x82d8('0x17')]=function(_0xf5ec20){try{if(!_['isNil'](dials[_0xf5ec20['uniqueid']])){utils[_0x82d8('0xb')](util[_0x82d8('0x4')](_0x82d8('0x18'),_0xf5ec20[_0x82d8('0x6')]),_0xf5ec20);dials[_0xf5ec20[_0x82d8('0x6')]]=_[_0x82d8('0x19')](dials[_0xf5ec20[_0x82d8('0x6')]],_0xf5ec20);dials[_0xf5ec20[_0x82d8('0x6')]]['starttime']=utils[_0x82d8('0x1a')]();dials[_0xf5ec20[_0x82d8('0x6')]][_0x82d8('0x1b')]=_0x82d8('0x1c');utils[_0x82d8('0x3')](util[_0x82d8('0x4')](_0x82d8('0x1d'),_0xf5ec20[_0x82d8('0x6')],dials[_0xf5ec20['uniqueid']][_0x82d8('0x1e')]));}}catch(_0x4b43f7){utils[_0x82d8('0x12')](util['format'](_0x82d8('0x18'),_0xf5ec20[_0x82d8('0x6')]),_0x4b43f7);}};exports[_0x82d8('0x1f')]=function(_0x309212){try{if(!_[_0x82d8('0x20')](dials[_0x309212[_0x82d8('0x6')]])){utils[_0x82d8('0xb')](util[_0x82d8('0x4')](_0x82d8('0x21'),_0x309212[_0x82d8('0x6')]),_0x309212);dials[_0x309212[_0x82d8('0x6')]]['dialstatus']=_0x309212[_0x82d8('0x8')];if(_0x309212[_0x82d8('0x8')]==_0x82d8('0x22')){dials[_0x309212[_0x82d8('0x6')]]=_['assign'](dials[_0x309212[_0x82d8('0x6')]],_0x309212);dials[_0x309212[_0x82d8('0x6')]][_0x82d8('0x23')]=utils[_0x82d8('0x1a')]();dials[_0x309212[_0x82d8('0x6')]]['lastevent']=_0x82d8('0x24');utils[_0x82d8('0x3')](util['format'](_0x82d8('0x25'),_0x309212[_0x82d8('0x6')],_0x309212[_0x82d8('0x8')],dials[_0x309212[_0x82d8('0x6')]][_0x82d8('0x23')]));}else{utils['info'](util[_0x82d8('0x4')](_0x82d8('0x26'),_0x309212[_0x82d8('0x6')],_0x309212[_0x82d8('0x8')]));}}}catch(_0x43a411){utils[_0x82d8('0x12')](util[_0x82d8('0x4')](_0x82d8('0x21'),_0x309212[_0x82d8('0x6')]),_0x43a411);}};exports['hangup']=function(_0x5b4728){try{if(!_[_0x82d8('0x20')](dials[_0x5b4728[_0x82d8('0x6')]])){utils[_0x82d8('0xb')](util[_0x82d8('0x4')]('[%s][dials][hangup]',_0x5b4728[_0x82d8('0x6')]),_0x5b4728);utils[_0x82d8('0x3')](util['format'](_0x82d8('0x27'),_0x5b4728[_0x82d8('0x6')],_0x5b4728[_0x82d8('0x28')],_0x5b4728[_0x82d8('0x29')],_0x5b4728[_0x82d8('0x2a')]));dials[_0x5b4728[_0x82d8('0x6')]]=_['assign'](dials[_0x5b4728['uniqueid']],{'endtime':utils[_0x82d8('0x1a')](),'lastevent':'complete'});dials[_0x5b4728[_0x82d8('0x6')]][_0x82d8('0x2b')]=utils[_0x82d8('0x2c')](dials[_0x5b4728[_0x82d8('0x6')]]['endtime'],dials[_0x5b4728[_0x82d8('0x6')]][_0x82d8('0x1e')]);dials[_0x5b4728[_0x82d8('0x6')]][_0x82d8('0x2d')]=utils[_0x82d8('0x2c')](dials[_0x5b4728['uniqueid']]['answertime']||dials[_0x5b4728[_0x82d8('0x6')]][_0x82d8('0x2e')],dials[_0x5b4728['uniqueid']]['starttime']);dials[_0x5b4728[_0x82d8('0x6')]]['billableseconds']=dials[_0x5b4728['uniqueid']][_0x82d8('0x23')]?utils[_0x82d8('0x2c')](dials[_0x5b4728[_0x82d8('0x6')]][_0x82d8('0x2e')],dials[_0x5b4728['uniqueid']][_0x82d8('0x23')]):0x0;writeDB(dials[_0x5b4728['uniqueid']]);}}catch(_0x392d42){utils[_0x82d8('0x12')](util[_0x82d8('0x4')]('[%s][dials][hangup]',_0x5b4728[_0x82d8('0x6')]),_0x392d42);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 02a4ee4..21d9c19 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 _0x4c65=['[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','port','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x4c65,0xeb));var _0x54c6=function(_0xc6c6cf,_0x5e477d){_0xc6c6cf=_0xc6c6cf-0x0;var _0x1b1580=_0x4c65[_0xc6c6cf];return _0x1b1580;};var AsteriskManager=require(_0x54c6('0x0'));var config=require(_0x54c6('0x1'));var utils=require(_0x54c6('0x2'));var util=require(_0x54c6('0x3'));var ami=new AsteriskManager(config['asterisk'][_0x54c6('0x4')],config[_0x54c6('0x5')]['ip'],config[_0x54c6('0x5')][_0x54c6('0x6')],config[_0x54c6('0x5')][_0x54c6('0x7')],!![]);ami[_0x54c6('0x8')]();if(config['xdr']&&config[_0x54c6('0x9')][_0x54c6('0xa')]){utils[_0x54c6('0xb')](_0x54c6('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x54c6('0xd'));var queues=require(_0x54c6('0xe'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x54c6('0xf'));var transfers=require(_0x54c6('0x10'));var core=require(_0x54c6('0x11'));ami['on'](_0x54c6('0x12'),core[_0x54c6('0x12')]);ami['on'](_0x54c6('0x13'),core[_0x54c6('0x13')]);ami['on'](_0x54c6('0x14'),core[_0x54c6('0x14')]);ami['on'](_0x54c6('0x15'),core['error']);ami['on'](_0x54c6('0x16'),core[_0x54c6('0x16')]);ami['on'](_0x54c6('0x17'),core['managerevent']);ami['on'](_0x54c6('0x18'),function(_0x6fbb45){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x1b'),_0x6fbb45[_0x54c6('0x1c')]),_0x6fbb45);members[_0x54c6('0x18')](_0x6fbb45);}catch(_0x244974){utils['error'](util[_0x54c6('0x1a')](_0x54c6('0x1b'),_0x6fbb45['device']),_0x244974);}});ami['on']('agentcalled',function(_0x427d02){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x1d'),_0x427d02['uniqueid']),_0x427d02);agents[_0x54c6('0x1e')](_0x427d02);}catch(_0x54e393){utils['error'](util['format'](_0x54c6('0x1d'),_0x427d02[_0x54c6('0x1f')]),_0x54e393);}});ami['on'](_0x54c6('0x20'),function(_0x552112){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')]('[%s][index][agentringnoanswer]',_0x552112[_0x54c6('0x1f')]),_0x552112);agents['agentringnoanswer'](_0x552112);}catch(_0x453168){utils['error'](util[_0x54c6('0x1a')](_0x54c6('0x21'),_0x552112[_0x54c6('0x1f')]),_0x453168);}});ami['on']('agentconnect',function(_0x5a2e68){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')]('[%s][index][agentconnect]',_0x5a2e68[_0x54c6('0x1f')]),_0x5a2e68);agents[_0x54c6('0x22')](_0x5a2e68);queues['agentconnect'](_0x5a2e68);}catch(_0x34e5f0){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x23'),_0x5a2e68[_0x54c6('0x1f')]),_0x34e5f0);}});ami['on']('agentcomplete',function(_0x2b5444){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x24'),_0x2b5444[_0x54c6('0x1f')]),_0x2b5444);agents['agentcomplete'](_0x2b5444);queues[_0x54c6('0x25')](_0x2b5444);members[_0x54c6('0x25')](_0x2b5444);}catch(_0x441d3e){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x24'),_0x2b5444['uniqueid']),_0x441d3e);}});ami['on'](_0x54c6('0x26'),function(_0x59e112){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x27'),_0x59e112['uniqueid']),_0x59e112);agents[_0x54c6('0x26')](_0x59e112);queues[_0x54c6('0x26')](_0x59e112);}catch(_0x90c965){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x27'),_0x59e112[_0x54c6('0x1f')]),_0x90c965);}});ami['on'](_0x54c6('0x28'),function(_0x11c7b2){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x29'),_0x11c7b2[_0x54c6('0x1f')]),_0x11c7b2);queues[_0x54c6('0x28')](_0x11c7b2);recordings[_0x54c6('0x28')](_0x11c7b2);}catch(_0x1aeebe){utils['error'](util['format']('[%s][index][queuecallerjoin]',_0x11c7b2[_0x54c6('0x1f')]),_0x1aeebe);}});ami['on'](_0x54c6('0x2a'),function(_0xff0c0){try{utils[_0x54c6('0x19')](util['format'](_0x54c6('0x2b'),_0xff0c0[_0x54c6('0x1f')]),_0xff0c0);queues['queuecallerleave'](_0xff0c0);}catch(_0x411ee3){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][queuecallerleave]',_0xff0c0[_0x54c6('0x1f')]),_0x411ee3);}});ami['on'](_0x54c6('0x2c'),function(_0x1372a2){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x2d'),_0x1372a2[_0x54c6('0x1f')]),_0x1372a2);queues[_0x54c6('0x2c')](_0x1372a2);calls['musiconholdstart'](_0x1372a2);}catch(_0x2c00f4){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][musiconholdstart]',_0x1372a2[_0x54c6('0x1f')]),_0x2c00f4);}});ami['on'](_0x54c6('0x2e'),function(_0x2e3b68){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x2f'),_0x2e3b68[_0x54c6('0x1f')]),_0x2e3b68);queues[_0x54c6('0x2e')](_0x2e3b68);calls[_0x54c6('0x2e')](_0x2e3b68);}catch(_0x475efd){utils[_0x54c6('0x15')](util['format'](_0x54c6('0x2f'),_0x2e3b68[_0x54c6('0x1f')]),_0x475efd);}});ami['on']('newstate',function(_0x335a9d){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x30'),_0x335a9d[_0x54c6('0x1f')]),_0x335a9d);calls['newstate'](_0x335a9d);recordings[_0x54c6('0x31')](_0x335a9d);}catch(_0x2536bb){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][newstate]',_0x335a9d[_0x54c6('0x1f')]),_0x2536bb);}});ami['on'](_0x54c6('0x32'),function(_0x17d13a){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x33'),_0x17d13a[_0x54c6('0x1f')]),_0x17d13a);calls[_0x54c6('0x32')](_0x17d13a);recordings[_0x54c6('0x32')](_0x17d13a);dials[_0x54c6('0x32')](_0x17d13a);agents[_0x54c6('0x32')](_0x17d13a);queues[_0x54c6('0x32')](_0x17d13a);}catch(_0x38e7d8){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x33'),_0x17d13a[_0x54c6('0x1f')]),_0x38e7d8);}});ami['on'](_0x54c6('0x34'),function(_0x90eec0){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x35'),_0x90eec0[_0x54c6('0x1f')]),_0x90eec0);members[_0x54c6('0x34')](_0x90eec0);}catch(_0x3a4744){utils[_0x54c6('0x15')](util['format'](_0x54c6('0x35'),_0x90eec0[_0x54c6('0x1f')]),_0x3a4744);}});ami['on']('blindtransfer',function(_0x1fc8c7){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x36'),_0x1fc8c7[_0x54c6('0x1f')]),_0x1fc8c7);queues[_0x54c6('0x37')](_0x1fc8c7);agents[_0x54c6('0x37')](_0x1fc8c7);transfers[_0x54c6('0x37')](_0x1fc8c7);}catch(_0xe82438){utils['error'](util['format']('[%s][index][blindtransfer]',_0x1fc8c7['uniqueid']),_0xe82438);}});ami['on'](_0x54c6('0x38'),function(_0x4860b3){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x39'),_0x4860b3[_0x54c6('0x3a')]),_0x4860b3);queues['attendedtransfer'](_0x4860b3);transfers[_0x54c6('0x38')](_0x4860b3);agents['attendedtransfer'](_0x4860b3);calls[_0x54c6('0x38')](_0x4860b3);}catch(_0x345b7d){utils['error'](util['format'](_0x54c6('0x39'),_0x4860b3['origtransfereruniqueid']),_0x345b7d);}});ami['on'](_0x54c6('0x3b'),function(_0x2df048){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x3c'),_0x2df048[_0x54c6('0x1f')]),_0x2df048);queues[_0x54c6('0x3b')](_0x2df048);recordings[_0x54c6('0x3b')](_0x2df048);calls[_0x54c6('0x3b')](_0x2df048);dials['varset'](_0x2df048);}catch(_0x611118){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')]('[%s][index][varset]',_0x2df048[_0x54c6('0x1f')]),_0x611118);}});ami['on'](_0x54c6('0x3d'),function(_0x7eeded){try{utils['debug'](util[_0x54c6('0x1a')](_0x54c6('0x3e'),_0x7eeded[_0x54c6('0x1f')]),_0x7eeded);calls[_0x54c6('0x3d')](_0x7eeded);recordings[_0x54c6('0x3d')](_0x7eeded);dials[_0x54c6('0x3d')](_0x7eeded);}catch(_0x5da356){utils[_0x54c6('0x15')](util['format']('[%s][index][newexten]',_0x7eeded[_0x54c6('0x1f')]),_0x5da356);}});ami['on']('newchannel',function(_0x190117){try{utils[_0x54c6('0x19')](util['format'](_0x54c6('0x3f'),_0x190117['uniqueid']),_0x190117);calls['newchannel'](_0x190117);recordings[_0x54c6('0x40')](_0x190117);}catch(_0x507f15){utils['error'](util['format'](_0x54c6('0x3f'),_0x190117[_0x54c6('0x1f')]),_0x507f15);}});ami['on']('dialbegin',function(_0x1f4b25){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x41'),_0x1f4b25[_0x54c6('0x1f')]),_0x1f4b25);dials[_0x54c6('0x42')](_0x1f4b25);}catch(_0x15a0c1){utils[_0x54c6('0x15')](util[_0x54c6('0x1a')](_0x54c6('0x43'),_0x1f4b25[_0x54c6('0x1f')]),_0x15a0c1);}});ami['on'](_0x54c6('0x44'),function(_0x43fbcf){try{utils[_0x54c6('0x19')](util[_0x54c6('0x1a')](_0x54c6('0x45'),_0x43fbcf[_0x54c6('0x1f')]),_0x43fbcf);dials[_0x54c6('0x44')](_0x43fbcf);}catch(_0x59b76d){utils['error'](util['format']('[%s][index][dialend]',_0x43fbcf[_0x54c6('0x1f')]),_0x59b76d);}});} \ No newline at end of file +var _0x9d3c=['disabled','XDR\x20DISABLED','./agents.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','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','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','port','asterisk','username','password','keepConnected','xdr'];(function(_0x2e7c96,_0x27804d){var _0x36008e=function(_0xd03b6b){while(--_0xd03b6b){_0x2e7c96['push'](_0x2e7c96['shift']());}};_0x36008e(++_0x27804d);}(_0x9d3c,0xc6));var _0xc9d3=function(_0x30bed8,_0x6bbdcd){_0x30bed8=_0x30bed8-0x0;var _0x261e4f=_0x9d3c[_0x30bed8];return _0x261e4f;};var AsteriskManager=require(_0xc9d3('0x0'));var config=require('../../config/environment');var utils=require(_0xc9d3('0x1'));var util=require(_0xc9d3('0x2'));var ami=new AsteriskManager(config['asterisk'][_0xc9d3('0x3')],config[_0xc9d3('0x4')]['ip'],config[_0xc9d3('0x4')][_0xc9d3('0x5')],config['asterisk'][_0xc9d3('0x6')],!![]);ami[_0xc9d3('0x7')]();if(config[_0xc9d3('0x8')]&&config[_0xc9d3('0x8')][_0xc9d3('0x9')]){utils['info'](_0xc9d3('0xa'));}else{var agents=require(_0xc9d3('0xb'));var calls=require('./calls.controller');var queues=require(_0xc9d3('0xc'));var recordings=require('./recordings.controller');var members=require(_0xc9d3('0xd'));var dials=require(_0xc9d3('0xe'));var transfers=require(_0xc9d3('0xf'));var core=require(_0xc9d3('0x10'));ami['on'](_0xc9d3('0x11'),core[_0xc9d3('0x11')]);ami['on'](_0xc9d3('0x12'),core[_0xc9d3('0x12')]);ami['on'](_0xc9d3('0x13'),core['fullybooted']);ami['on'](_0xc9d3('0x14'),core[_0xc9d3('0x14')]);ami['on'](_0xc9d3('0x15'),core['close']);ami['on'](_0xc9d3('0x16'),core[_0xc9d3('0x16')]);ami['on'](_0xc9d3('0x17'),function(_0x439a0c){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x1a'),_0x439a0c['device']),_0x439a0c);members[_0xc9d3('0x17')](_0x439a0c);}catch(_0xb510d8){utils[_0xc9d3('0x14')](util['format'](_0xc9d3('0x1a'),_0x439a0c[_0xc9d3('0x1b')]),_0xb510d8);}});ami['on'](_0xc9d3('0x1c'),function(_0x382695){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x1d'),_0x382695[_0xc9d3('0x1e')]),_0x382695);agents['agentcalled'](_0x382695);}catch(_0x4e7dcd){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x1d'),_0x382695[_0xc9d3('0x1e')]),_0x4e7dcd);}});ami['on'](_0xc9d3('0x1f'),function(_0x4777a4){try{utils[_0xc9d3('0x18')](util['format'](_0xc9d3('0x20'),_0x4777a4[_0xc9d3('0x1e')]),_0x4777a4);agents[_0xc9d3('0x1f')](_0x4777a4);}catch(_0x10f58d){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')]('[%s][index][agentringnoanswer]',_0x4777a4[_0xc9d3('0x1e')]),_0x10f58d);}});ami['on'](_0xc9d3('0x21'),function(_0x45b39e){try{utils['debug'](util['format'](_0xc9d3('0x22'),_0x45b39e[_0xc9d3('0x1e')]),_0x45b39e);agents[_0xc9d3('0x21')](_0x45b39e);queues[_0xc9d3('0x21')](_0x45b39e);}catch(_0xcfb819){utils[_0xc9d3('0x14')](util['format'](_0xc9d3('0x22'),_0x45b39e[_0xc9d3('0x1e')]),_0xcfb819);}});ami['on'](_0xc9d3('0x23'),function(_0x483f57){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x24'),_0x483f57[_0xc9d3('0x1e')]),_0x483f57);agents['agentcomplete'](_0x483f57);queues[_0xc9d3('0x23')](_0x483f57);members[_0xc9d3('0x23')](_0x483f57);}catch(_0x40ba20){utils['error'](util[_0xc9d3('0x19')](_0xc9d3('0x24'),_0x483f57['uniqueid']),_0x40ba20);}});ami['on'](_0xc9d3('0x25'),function(_0x428b93){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x26'),_0x428b93[_0xc9d3('0x1e')]),_0x428b93);agents[_0xc9d3('0x25')](_0x428b93);queues[_0xc9d3('0x25')](_0x428b93);}catch(_0x3550ae){utils[_0xc9d3('0x14')](util['format'](_0xc9d3('0x26'),_0x428b93[_0xc9d3('0x1e')]),_0x3550ae);}});ami['on'](_0xc9d3('0x27'),function(_0x1fd642){try{utils['debug'](util[_0xc9d3('0x19')](_0xc9d3('0x28'),_0x1fd642[_0xc9d3('0x1e')]),_0x1fd642);queues[_0xc9d3('0x27')](_0x1fd642);recordings['queuecallerjoin'](_0x1fd642);}catch(_0x4142eb){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x28'),_0x1fd642[_0xc9d3('0x1e')]),_0x4142eb);}});ami['on'](_0xc9d3('0x29'),function(_0x5031f6){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x2a'),_0x5031f6['uniqueid']),_0x5031f6);queues['queuecallerleave'](_0x5031f6);}catch(_0x34d7b1){utils[_0xc9d3('0x14')](util['format'](_0xc9d3('0x2a'),_0x5031f6[_0xc9d3('0x1e')]),_0x34d7b1);}});ami['on']('musiconholdstart',function(_0x20d166){try{utils[_0xc9d3('0x18')](util['format'](_0xc9d3('0x2b'),_0x20d166[_0xc9d3('0x1e')]),_0x20d166);queues[_0xc9d3('0x2c')](_0x20d166);calls[_0xc9d3('0x2c')](_0x20d166);}catch(_0x257b9e){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x2b'),_0x20d166['uniqueid']),_0x257b9e);}});ami['on'](_0xc9d3('0x2d'),function(_0x44715c){try{utils['debug'](util[_0xc9d3('0x19')](_0xc9d3('0x2e'),_0x44715c[_0xc9d3('0x1e')]),_0x44715c);queues[_0xc9d3('0x2d')](_0x44715c);calls[_0xc9d3('0x2d')](_0x44715c);}catch(_0x116fb0){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')]('[%s][index][musiconholdstop]',_0x44715c[_0xc9d3('0x1e')]),_0x116fb0);}});ami['on'](_0xc9d3('0x2f'),function(_0x436e69){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')]('[%s][index][newstate]',_0x436e69[_0xc9d3('0x1e')]),_0x436e69);calls[_0xc9d3('0x2f')](_0x436e69);recordings[_0xc9d3('0x2f')](_0x436e69);}catch(_0xcd9c25){utils[_0xc9d3('0x14')](util['format'](_0xc9d3('0x30'),_0x436e69[_0xc9d3('0x1e')]),_0xcd9c25);}});ami['on'](_0xc9d3('0x31'),function(_0x47d2e1){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x32'),_0x47d2e1[_0xc9d3('0x1e')]),_0x47d2e1);calls['hangup'](_0x47d2e1);recordings['hangup'](_0x47d2e1);dials[_0xc9d3('0x31')](_0x47d2e1);agents['hangup'](_0x47d2e1);queues['hangup'](_0x47d2e1);}catch(_0x182dc5){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')]('[%s][index][hangup]',_0x47d2e1['uniqueid']),_0x182dc5);}});ami['on'](_0xc9d3('0x33'),function(_0x584f87){try{utils['debug'](util[_0xc9d3('0x19')](_0xc9d3('0x34'),_0x584f87['uniqueid']),_0x584f87);members[_0xc9d3('0x33')](_0x584f87);}catch(_0x31a096){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x34'),_0x584f87[_0xc9d3('0x1e')]),_0x31a096);}});ami['on'](_0xc9d3('0x35'),function(_0x37734f){try{utils[_0xc9d3('0x18')](util['format'](_0xc9d3('0x36'),_0x37734f[_0xc9d3('0x1e')]),_0x37734f);queues[_0xc9d3('0x35')](_0x37734f);agents[_0xc9d3('0x35')](_0x37734f);transfers[_0xc9d3('0x35')](_0x37734f);}catch(_0x1a2941){utils['error'](util[_0xc9d3('0x19')](_0xc9d3('0x36'),_0x37734f['uniqueid']),_0x1a2941);}});ami['on']('attendedtransfer',function(_0x100dcd){try{utils['debug'](util[_0xc9d3('0x19')](_0xc9d3('0x37'),_0x100dcd[_0xc9d3('0x38')]),_0x100dcd);queues[_0xc9d3('0x39')](_0x100dcd);transfers['attendedtransfer'](_0x100dcd);agents[_0xc9d3('0x39')](_0x100dcd);calls[_0xc9d3('0x39')](_0x100dcd);}catch(_0x184b3d){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x37'),_0x100dcd[_0xc9d3('0x38')]),_0x184b3d);}});ami['on'](_0xc9d3('0x3a'),function(_0x4f735e){try{utils['debug'](util[_0xc9d3('0x19')]('[%s][index][varset]',_0x4f735e[_0xc9d3('0x1e')]),_0x4f735e);queues[_0xc9d3('0x3a')](_0x4f735e);recordings[_0xc9d3('0x3a')](_0x4f735e);calls['varset'](_0x4f735e);dials[_0xc9d3('0x3a')](_0x4f735e);}catch(_0x3064eb){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x3b'),_0x4f735e[_0xc9d3('0x1e')]),_0x3064eb);}});ami['on'](_0xc9d3('0x3c'),function(_0x49421b){try{utils['debug'](util[_0xc9d3('0x19')](_0xc9d3('0x3d'),_0x49421b[_0xc9d3('0x1e')]),_0x49421b);calls[_0xc9d3('0x3c')](_0x49421b);recordings[_0xc9d3('0x3c')](_0x49421b);dials['newexten'](_0x49421b);}catch(_0x2148c5){utils['error'](util['format'](_0xc9d3('0x3d'),_0x49421b[_0xc9d3('0x1e')]),_0x2148c5);}});ami['on']('newchannel',function(_0x399ab4){try{utils['debug'](util['format'](_0xc9d3('0x3e'),_0x399ab4['uniqueid']),_0x399ab4);calls[_0xc9d3('0x3f')](_0x399ab4);recordings['newchannel'](_0x399ab4);}catch(_0x137fb2){utils['error'](util[_0xc9d3('0x19')](_0xc9d3('0x3e'),_0x399ab4[_0xc9d3('0x1e')]),_0x137fb2);}});ami['on'](_0xc9d3('0x40'),function(_0x2feef1){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x41'),_0x2feef1[_0xc9d3('0x1e')]),_0x2feef1);dials[_0xc9d3('0x40')](_0x2feef1);}catch(_0x42af25){utils[_0xc9d3('0x14')](util['format'](_0xc9d3('0x42'),_0x2feef1[_0xc9d3('0x1e')]),_0x42af25);}});ami['on'](_0xc9d3('0x43'),function(_0x4cae37){try{utils[_0xc9d3('0x18')](util[_0xc9d3('0x19')](_0xc9d3('0x44'),_0x4cae37[_0xc9d3('0x1e')]),_0x4cae37);dials[_0xc9d3('0x43')](_0x4cae37);}catch(_0x56d555){utils[_0xc9d3('0x14')](util[_0xc9d3('0x19')](_0xc9d3('0x44'),_0x4cae37[_0xc9d3('0x1e')]),_0x56d555);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 9a9ccd6..623f40c 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 _0x48e0=['destinationchannel','destination','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','channel','assign','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1'];(function(_0x5d5d44,_0x322f78){var _0x4a76cd=function(_0x15e72b){while(--_0x15e72b){_0x5d5d44['push'](_0x5d5d44['shift']());}};_0x4a76cd(++_0x322f78);}(_0x48e0,0x146));var _0x048e=function(_0x112ba3,_0x385b57){_0x112ba3=_0x112ba3-0x0;var _0x140b50=_0x48e0[_0x112ba3];return _0x140b50;};'use strict';var _=require('lodash');var util=require(_0x048e('0x0'));var utils=require(_0x048e('0x1'));var members={};var exclude=[_0x048e('0x2'),_0x048e('0x3')];function writeDB(_0x417571){utils[_0x048e('0x4')](util[_0x048e('0x5')](_0x048e('0x6'),_0x417571[_0x048e('0x7')],_0x417571[_0x048e('0x8')],_0x417571['channel'],_0x417571['data2'],_0x417571[_0x048e('0x9')],_0x417571[_0x048e('0xa')]));if(_0x417571['interface']){utils['getUserByInterface'](_0x417571['interface'])[_0x048e('0xb')](function(_0x29d1aa){if(_0x29d1aa){_0x417571[_0x048e('0x9')]=_0x29d1aa[_0x048e('0xc')];_0x417571[_0x048e('0xd')]=_0x29d1aa['internal'];utils[_0x048e('0xe')]('CreateMemberReport',_0x417571);}else{utils[_0x048e('0xf')](_0x417571[_0x048e('0x8')][_0x048e('0x10')]('/')[0x1])[_0x048e('0xb')](function(_0x45357b){if(_0x45357b){_0x417571['membername']=_0x45357b[_0x048e('0xc')];_0x417571[_0x048e('0xd')]=_0x45357b[_0x048e('0xd')];utils[_0x048e('0xe')](_0x048e('0x11'),_0x417571);}});}})[_0x048e('0x12')](function(_0x4aeb76){utils[_0x048e('0x13')](util[_0x048e('0x5')](_0x048e('0x14'),_0x417571[_0x048e('0x7')]),_0x4aeb76);});}delete members[_0x417571[_0x048e('0x8')]];}function startsWith(_0x1fb126,_0x110540){return _[_0x048e('0x15')](_0x1fb126,function(_0x578975){return _[_0x048e('0x16')](_0x110540,_0x578975);});}exports['devicestatechange']=function(_0x234e25){try{utils[_0x048e('0x17')](util[_0x048e('0x5')](_0x048e('0x18'),members[_0x234e25[_0x048e('0x19')]]?members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]:_0x234e25[_0x048e('0x19')]),_0x234e25);utils['info'](util[_0x048e('0x5')](_0x048e('0x1a'),members[_0x234e25[_0x048e('0x19')]]?members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]:_0x234e25[_0x048e('0x19')],_0x234e25[_0x048e('0x1b')],_0x234e25[_0x048e('0x19')]));switch(_0x234e25['state']){case _0x048e('0x1c'):case _0x048e('0x1d'):if(!startsWith(exclude,_0x234e25['device'])){members[_0x234e25[_0x048e('0x19')]]={'channel':_0x048e('0x1e'),'interface':_0x234e25['device'],'type':_0x048e('0x1f'),'enterAt':utils['now'](),'role':_0x048e('0x20')};}break;case'NOT_INUSE':if(!_[_0x048e('0x21')](members[_0x234e25['device']])){members[_0x234e25['device']][_0x048e('0x22')]=utils[_0x048e('0x23')]();members[_0x234e25[_0x048e('0x19')]][_0x048e('0x24')]=utils[_0x048e('0x25')](members[_0x234e25[_0x048e('0x19')]][_0x048e('0x22')],members[_0x234e25[_0x048e('0x19')]][_0x048e('0x26')]);if(members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]){writeDB(members[_0x234e25[_0x048e('0x19')]]);}}break;default:break;}}catch(_0x1170be){utils['error'](util['format'](_0x048e('0x18'),members[_0x234e25[_0x048e('0x19')]]?members[_0x234e25[_0x048e('0x19')]][_0x048e('0x7')]:_0x234e25['device']),_0x1170be);}};exports[_0x048e('0x27')]=function(_0x5e58cb){try{if(!_[_0x048e('0x21')](members[_0x5e58cb[_0x048e('0x8')]])){utils[_0x048e('0x17')](util[_0x048e('0x5')](_0x048e('0x28'),_0x5e58cb[_0x048e('0x7')]),_0x5e58cb);utils[_0x048e('0x4')](util[_0x048e('0x5')](_0x048e('0x29'),_0x5e58cb[_0x048e('0x7')],_0x5e58cb[_0x048e('0x8')],_0x5e58cb[_0x048e('0x2a')]));members[_0x5e58cb[_0x048e('0x8')]]=_['assign'](members[_0x5e58cb[_0x048e('0x8')]],{'data4':_0x5e58cb[_0x048e('0x2a')],'uniqueid':_0x5e58cb[_0x048e('0x7')]});}}catch(_0x3467c4){utils['error'](util[_0x048e('0x5')](_0x048e('0x28'),_0x5e58cb[_0x048e('0x7')]),_0x3467c4);}};exports[_0x048e('0x2b')]=function(_0x3df30b){try{utils['debug'](util[_0x048e('0x5')](_0x048e('0x2c'),_0x3df30b[_0x048e('0x7')]),_0x3df30b);if(_0x3df30b[_0x048e('0x2d')]){var _0x24a41f=_0x3df30b[_0x048e('0x2d')][_0x048e('0x10')]('-')[0x0];if(!_[_0x048e('0x21')](members[_0x24a41f])){members[_0x24a41f]=_[_0x048e('0x2e')](members[_0x24a41f],{'data1':members[_0x24a41f]['data1']||_0x3df30b['type'],'data2':members[_0x24a41f][_0x048e('0x2f')]||_0x3df30b[_0x048e('0x30')],'data3':members[_0x24a41f][_0x048e('0x31')]||_0x3df30b['destination'],'uniqueid':members[_0x24a41f][_0x048e('0x7')]||_0x3df30b[_0x048e('0x7')]});utils['info'](util['format'](_0x048e('0x32'),_0x3df30b['uniqueid'],members[_0x24a41f][_0x048e('0x33')],members[_0x24a41f][_0x048e('0x2f')],members[_0x24a41f]['data3']));if(members[_0x24a41f][_0x048e('0x22')]){writeDB(members[_0x24a41f]);}}}if(_0x3df30b[_0x048e('0x34')]){var _0x39910c=_0x3df30b[_0x048e('0x34')][_0x048e('0x10')]('-')[0x0];if(!_['isNil'](members[_0x39910c])){members[_0x39910c]=_['assign'](members[_0x39910c],{'data1':members[_0x39910c][_0x048e('0x33')]||_0x3df30b[_0x048e('0xa')],'data2':members[_0x39910c][_0x048e('0x2f')]||_0x3df30b[_0x048e('0x30')],'data3':members[_0x39910c][_0x048e('0x31')]||_0x3df30b[_0x048e('0x35')],'uniqueid':members[_0x39910c][_0x048e('0x7')]||_0x3df30b[_0x048e('0x7')]});utils[_0x048e('0x4')](util[_0x048e('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3df30b[_0x048e('0x7')],members[_0x39910c][_0x048e('0x33')],members[_0x39910c][_0x048e('0x2f')],members[_0x39910c]['data3']));if(members[_0x39910c][_0x048e('0x22')]){writeDB(members[_0x39910c]);}}}}catch(_0x35bc2e){utils[_0x048e('0x13')](util[_0x048e('0x5')](_0x048e('0x2c'),_0x3df30b[_0x048e('0x7')]),_0x35bc2e);}}; \ No newline at end of file +var _0x62e9=['lodash','util','./utils','Local/_attended@transfer','Queue:','info','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','isNil','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','source'];(function(_0x1a862b,_0x41c918){var _0xeef1c2=function(_0x48c2da){while(--_0x48c2da){_0x1a862b['push'](_0x1a862b['shift']());}};_0xeef1c2(++_0x41c918);}(_0x62e9,0x1e6));var _0x962e=function(_0x559ba7,_0x42c623){_0x559ba7=_0x559ba7-0x0;var _0x1497ea=_0x62e9[_0x559ba7];return _0x1497ea;};'use strict';var _=require(_0x962e('0x0'));var util=require(_0x962e('0x1'));var utils=require(_0x962e('0x2'));var members={};var exclude=[_0x962e('0x3'),_0x962e('0x4')];function writeDB(_0x5126bc){utils[_0x962e('0x5')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5126bc[_0x962e('0x6')],_0x5126bc[_0x962e('0x7')],_0x5126bc[_0x962e('0x8')],_0x5126bc[_0x962e('0x9')],_0x5126bc[_0x962e('0xa')],_0x5126bc[_0x962e('0xb')]));if(_0x5126bc[_0x962e('0x7')]){utils[_0x962e('0xc')](_0x5126bc[_0x962e('0x7')])[_0x962e('0xd')](function(_0x54180d){if(_0x54180d){_0x5126bc['membername']=_0x54180d[_0x962e('0xe')];_0x5126bc[_0x962e('0xf')]=_0x54180d[_0x962e('0xf')];utils[_0x962e('0x10')]('CreateMemberReport',_0x5126bc);}else{utils[_0x962e('0x11')](_0x5126bc[_0x962e('0x7')][_0x962e('0x12')]('/')[0x1])[_0x962e('0xd')](function(_0x1c06ad){if(_0x1c06ad){_0x5126bc[_0x962e('0xa')]=_0x1c06ad[_0x962e('0xe')];_0x5126bc[_0x962e('0xf')]=_0x1c06ad['internal'];utils[_0x962e('0x10')](_0x962e('0x13'),_0x5126bc);}});}})[_0x962e('0x14')](function(_0x1b29cd){utils[_0x962e('0x15')](util[_0x962e('0x16')](_0x962e('0x17'),_0x5126bc[_0x962e('0x6')]),_0x1b29cd);});}delete members[_0x5126bc[_0x962e('0x7')]];}function startsWith(_0x3549ca,_0x3aa693){return _[_0x962e('0x18')](_0x3549ca,function(_0x5cc51b){return _[_0x962e('0x19')](_0x3aa693,_0x5cc51b);});}exports[_0x962e('0x1a')]=function(_0xd12148){try{utils[_0x962e('0x1b')](util['format'](_0x962e('0x1c'),members[_0xd12148[_0x962e('0x1d')]]?members[_0xd12148[_0x962e('0x1d')]][_0x962e('0x6')]:_0xd12148[_0x962e('0x1d')]),_0xd12148);utils['info'](util[_0x962e('0x16')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0xd12148[_0x962e('0x1d')]]?members[_0xd12148[_0x962e('0x1d')]][_0x962e('0x6')]:_0xd12148['device'],_0xd12148[_0x962e('0x1e')],_0xd12148[_0x962e('0x1d')]));switch(_0xd12148[_0x962e('0x1e')]){case _0x962e('0x1f'):case _0x962e('0x20'):if(!startsWith(exclude,_0xd12148[_0x962e('0x1d')])){members[_0xd12148[_0x962e('0x1d')]]={'channel':_0x962e('0x21'),'interface':_0xd12148[_0x962e('0x1d')],'type':_0x962e('0x22'),'enterAt':utils[_0x962e('0x23')](),'role':_0x962e('0x24')};}break;case _0x962e('0x25'):if(!_['isNil'](members[_0xd12148[_0x962e('0x1d')]])){members[_0xd12148[_0x962e('0x1d')]][_0x962e('0x26')]=utils[_0x962e('0x23')]();members[_0xd12148[_0x962e('0x1d')]][_0x962e('0x27')]=utils[_0x962e('0x28')](members[_0xd12148[_0x962e('0x1d')]][_0x962e('0x26')],members[_0xd12148['device']][_0x962e('0x29')]);if(members[_0xd12148[_0x962e('0x1d')]]['uniqueid']){writeDB(members[_0xd12148[_0x962e('0x1d')]]);}}break;default:break;}}catch(_0x5047f){utils['error'](util[_0x962e('0x16')](_0x962e('0x1c'),members[_0xd12148[_0x962e('0x1d')]]?members[_0xd12148[_0x962e('0x1d')]]['uniqueid']:_0xd12148[_0x962e('0x1d')]),_0x5047f);}};exports['agentcomplete']=function(_0x67c136){try{if(!_['isNil'](members[_0x67c136['interface']])){utils['debug'](util[_0x962e('0x16')](_0x962e('0x2a'),_0x67c136['uniqueid']),_0x67c136);utils[_0x962e('0x5')](util[_0x962e('0x16')](_0x962e('0x2b'),_0x67c136[_0x962e('0x6')],_0x67c136[_0x962e('0x7')],_0x67c136[_0x962e('0x2c')]));members[_0x67c136['interface']]=_[_0x962e('0x2d')](members[_0x67c136[_0x962e('0x7')]],{'data4':_0x67c136[_0x962e('0x2c')],'uniqueid':_0x67c136[_0x962e('0x6')]});}}catch(_0x2905fd){utils['error'](util[_0x962e('0x16')](_0x962e('0x2a'),_0x67c136[_0x962e('0x6')]),_0x2905fd);}};exports[_0x962e('0x2e')]=function(_0x34952f){try{utils[_0x962e('0x1b')](util[_0x962e('0x16')](_0x962e('0x2f'),_0x34952f[_0x962e('0x6')]),_0x34952f);if(_0x34952f[_0x962e('0x8')]){var _0x5d2bd2=_0x34952f[_0x962e('0x8')][_0x962e('0x12')]('-')[0x0];if(!_[_0x962e('0x30')](members[_0x5d2bd2])){members[_0x5d2bd2]=_['assign'](members[_0x5d2bd2],{'data1':members[_0x5d2bd2][_0x962e('0x31')]||_0x34952f['type'],'data2':members[_0x5d2bd2][_0x962e('0x9')]||_0x34952f['source'],'data3':members[_0x5d2bd2][_0x962e('0x32')]||_0x34952f[_0x962e('0x33')],'uniqueid':members[_0x5d2bd2]['uniqueid']||_0x34952f['uniqueid']});utils['info'](util[_0x962e('0x16')](_0x962e('0x34'),_0x34952f['uniqueid'],members[_0x5d2bd2]['data1'],members[_0x5d2bd2][_0x962e('0x9')],members[_0x5d2bd2][_0x962e('0x32')]));if(members[_0x5d2bd2][_0x962e('0x26')]){writeDB(members[_0x5d2bd2]);}}}if(_0x34952f['destinationchannel']){var _0xf1f849=_0x34952f['destinationchannel'][_0x962e('0x12')]('-')[0x0];if(!_[_0x962e('0x30')](members[_0xf1f849])){members[_0xf1f849]=_['assign'](members[_0xf1f849],{'data1':members[_0xf1f849][_0x962e('0x31')]||_0x34952f[_0x962e('0xb')],'data2':members[_0xf1f849][_0x962e('0x9')]||_0x34952f[_0x962e('0x35')],'data3':members[_0xf1f849][_0x962e('0x32')]||_0x34952f[_0x962e('0x33')],'uniqueid':members[_0xf1f849][_0x962e('0x6')]||_0x34952f[_0x962e('0x6')]});utils[_0x962e('0x5')](util['format'](_0x962e('0x34'),_0x34952f['uniqueid'],members[_0xf1f849]['data1'],members[_0xf1f849][_0x962e('0x9')],members[_0xf1f849][_0x962e('0x32')]));if(members[_0xf1f849][_0x962e('0x26')]){writeDB(members[_0xf1f849]);}}}}catch(_0x1e0cdf){utils[_0x962e('0x15')](util[_0x962e('0x16')]('[%s][members][cdr]',_0x34952f[_0x962e('0x6')]),_0x1e0cdf);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index f54eed8..d730ea3 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 _0x485d=['[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','isNil','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferuniqueid','extension','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','musiconholdstartAt'];(function(_0x5bbae4,_0x2a4a4e){var _0x338a50=function(_0x478845){while(--_0x478845){_0x5bbae4['push'](_0x5bbae4['shift']());}};_0x338a50(++_0x2a4a4e);}(_0x485d,0x137));var _0xd485=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x485d[_0x35ef6b];return _0x3ad145;};'use strict';var _=require(_0xd485('0x0'));var util=require(_0xd485('0x1'));var utils=require(_0xd485('0x2'));var queues={};function writeDB(_0x358714){utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x5'),_0x358714[_0xd485('0x6')],_0x358714[_0xd485('0x7')],_0x358714['queue'],_0x358714[_0xd485('0x8')],_0x358714['calleridnum'],_0x358714[_0xd485('0x9')],_0x358714[_0xd485('0xa')]));if(_0x358714[_0xd485('0xb')]){utils['getVoiceQueueByName'](_0x358714[_0xd485('0xb')])[_0xd485('0xc')](function(_0x578505){if(_0x578505){_0x358714[_0xd485('0xd')]=_0x578505[_0xd485('0xd')];}utils[_0xd485('0xe')]('CreateVoiceQueueReport',_0x358714);});}else{utils[_0xd485('0xe')](_0xd485('0xf'),_0x358714);}if(_0x358714[_0xd485('0x10')]){delete queues[_0x358714[_0xd485('0x10')]];}else{delete queues[_0x358714['uniqueid']];}}exports[_0xd485('0x11')]=function(_0x2849d6){try{utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x13'),_0x2849d6[_0xd485('0x6')]),_0x2849d6);utils[_0xd485('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2849d6[_0xd485('0x6')],_0x2849d6[_0xd485('0xb')],_0x2849d6[_0xd485('0x14')]));queues[_0x2849d6[_0xd485('0x6')]]=_[_0xd485('0x15')](_0x2849d6,{'originalposition':_0x2849d6[_0xd485('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x34aa51){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x13'),_0x2849d6['uniqueid']),_0x34aa51);}};exports['hangup']=function(_0x1e1355){try{if(!_['isNil'](queues[_0x1e1355['uniqueid']])){utils[_0xd485('0x12')](util[_0xd485('0x4')]('[%s][queues][hangup]',_0x1e1355['uniqueid']),_0x1e1355);if(queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x17')]){if(!queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x18')]&&!queues[_0x1e1355[_0xd485('0x6')]]['queuecallerexit']){queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x19')]=!![];queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x1a')]=utils[_0xd485('0x1b')]();queues[_0x1e1355[_0xd485('0x6')]]['queuecallerexitreason']=_0xd485('0x1c');}utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x1d'),_0x1e1355['uniqueid'],queues[_0x1e1355[_0xd485('0x6')]]['name'],queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0xa')]));writeDB(queues[_0x1e1355[_0xd485('0x6')]]);}else if(queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x10')]){utils[_0xd485('0x3')](util[_0xd485('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1e1355[_0xd485('0x6')],queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x10')]));queues[queues[_0x1e1355['uniqueid']][_0xd485('0x10')]]=queues[_0x1e1355[_0xd485('0x6')]];queues[queues[_0x1e1355[_0xd485('0x6')]][_0xd485('0x10')]][_0xd485('0x1f')]=0x2;delete queues[_0x1e1355[_0xd485('0x6')]];}}}catch(_0x2179f2){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x20'),_0x1e1355[_0xd485('0x6')]),_0x2179f2);}};exports[_0xd485('0x21')]=function(_0x1545d2){try{utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x22'),_0x1545d2['uniqueid']),_0x1545d2);if(!_['isNil'](_0x1545d2[_0xd485('0x23')][_0xd485('0x24')])&&_0x1545d2['value'][_0xd485('0x25')]()!==_0xd485('0x26')){if(!_[_0xd485('0x27')](queues[_0x1545d2[_0xd485('0x6')]])){queues[_0x1545d2['uniqueid']][_0xd485('0x18')]=![];queues[_0x1545d2['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1545d2['uniqueid']][_0xd485('0x28')]=!![];queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x29')]=utils['now']();queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0xa')]=_0x1545d2['value'][_0xd485('0x25')]();utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x2a'),_0x1545d2[_0xd485('0x6')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x1e')],_0x1545d2[_0xd485('0x2b')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0xa')]));writeDB(queues[_0x1545d2[_0xd485('0x6')]]);}}else if(!_['isNil'](_0x1545d2[_0xd485('0x23')][_0xd485('0x2c')])){if(!_[_0xd485('0x27')](queues[_0x1545d2[_0xd485('0x6')]])&&!queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x18')]){queues[_0x1545d2['uniqueid']][_0xd485('0x18')]=![];queues[_0x1545d2['uniqueid']][_0xd485('0x2d')]=null;queues[_0x1545d2[_0xd485('0x6')]]['queuecallerexit']=!![];queues[_0x1545d2['uniqueid']][_0xd485('0x29')]=utils[_0xd485('0x1b')]();queues[_0x1545d2['uniqueid']][_0xd485('0xa')]=_0xd485('0x2e');utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x2f'),_0x1545d2[_0xd485('0x6')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0x1e')],_0x1545d2[_0xd485('0x2b')],queues[_0x1545d2[_0xd485('0x6')]][_0xd485('0xa')]));}}}catch(_0x38c1d0){utils[_0xd485('0x16')](util['format']('[%s][queues][varset]',_0x1545d2[_0xd485('0x6')]),_0x38c1d0);}};exports['queuecallerabandon']=function(_0x348825){try{if(!_[_0xd485('0x27')](queues[_0x348825[_0xd485('0x6')]])){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x30'),_0x348825[_0xd485('0x6')]),_0x348825);queues[_0x348825[_0xd485('0x6')]][_0xd485('0x28')]=![];queues[_0x348825[_0xd485('0x6')]][_0xd485('0x29')]=null;queues[_0x348825[_0xd485('0x6')]][_0xd485('0x18')]=!![];queues[_0x348825[_0xd485('0x6')]][_0xd485('0x2d')]=utils[_0xd485('0x1b')]();queues[_0x348825[_0xd485('0x6')]][_0xd485('0xa')]=_0xd485('0x31');utils[_0xd485('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x348825['uniqueid'],queues[_0x348825[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x348825[_0xd485('0x6')]][_0xd485('0xa')]));}}catch(_0x53b8f8){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x30'),_0x348825[_0xd485('0x6')]),_0x53b8f8);}};exports[_0xd485('0x32')]=function(_0x1354d6){try{if(!_[_0xd485('0x27')](queues[_0x1354d6[_0xd485('0x6')]])){utils['debug'](util[_0xd485('0x4')](_0xd485('0x33'),_0x1354d6['uniqueid']),_0x1354d6);utils['info'](util[_0xd485('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1354d6['uniqueid'],queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x1e')],_0x1354d6['connectedlinenum'],_0x1354d6[_0xd485('0x34')]));queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x32')]=!![];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x17')]=utils[_0xd485('0x1b')]();queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x35')]=utils[_0xd485('0x36')](queues[_0x1354d6['uniqueid']][_0xd485('0x17')],queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x37')]);queues[_0x1354d6['uniqueid']][_0xd485('0x14')]=_0x1354d6[_0xd485('0x14')];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x38')]=_0x1354d6[_0xd485('0x38')];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x39')]=_0x1354d6[_0xd485('0x39')];queues[_0x1354d6[_0xd485('0x6')]][_0xd485('0x34')]=_0x1354d6[_0xd485('0x34')];}}catch(_0x4faef9){utils[_0xd485('0x16')](util[_0xd485('0x4')](_0xd485('0x33'),_0x1354d6['uniqueid']),_0x4faef9);}};exports[_0xd485('0x3a')]=function(_0xa717c0){try{if(!_[_0xd485('0x27')](queues[_0xa717c0['uniqueid']])){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x3b'),_0xa717c0['uniqueid']),_0xa717c0);utils['info'](util['format'](_0xd485('0x3c'),_0xa717c0['uniqueid'],queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x1e')],_0xa717c0[_0xd485('0x3d')],_0xa717c0['destaccountcode']));queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x18')]=![];queues[_0xa717c0[_0xd485('0x6')]]['queuecallerabandon']=![];queues[_0xa717c0['uniqueid']][_0xd485('0x2d')]=null;queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x28')]=![];queues[_0xa717c0['uniqueid']]['queuecallerexitreason']=null;queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x29')]=null;queues[_0xa717c0['uniqueid']][_0xd485('0x3e')]=!![];queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x9')]=_0xa717c0[_0xd485('0x3f')];queues[_0xa717c0[_0xd485('0x6')]][_0xd485('0x8')]=_0xa717c0[_0xd485('0x3d')];}}catch(_0x43ddb6){utils[_0xd485('0x16')](util[_0xd485('0x4')]('[%s][queues][agentconnect]',_0xa717c0[_0xd485('0x6')]),_0x43ddb6);}};exports[_0xd485('0x40')]=function(_0x198e8a){try{if(!_[_0xd485('0x27')](queues[_0x198e8a['uniqueid']])){if(queues[_0x198e8a['uniqueid']]['queuecallerleaveAt']){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x41'),_0x198e8a[_0xd485('0x6')]),_0x198e8a);queues[_0x198e8a['uniqueid']][_0xd485('0x18')]=![];queues[_0x198e8a[_0xd485('0x6')]]['queuecallerabandon']=![];queues[_0x198e8a[_0xd485('0x6')]]['queuecallerabandonAt']=null;queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x28')]=![];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x29')]=null;queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x3e')]=!![];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x8')]=_0x198e8a[_0xd485('0x3d')];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x19')]=!![];queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x1a')]=utils[_0xd485('0x1b')]();if(_0x198e8a[_0xd485('0x42')]==_0xd485('0x43')){if(!queues[_0x198e8a['uniqueid']][_0xd485('0x43')]){queues[_0x198e8a['uniqueid']]['queuecallerexitreason']=_0xd485('0x44');}}else{queues[_0x198e8a['uniqueid']][_0xd485('0xa')]='COMPLETEDBY'+_0x198e8a['reason'][_0xd485('0x25')]();}utils['info'](util[_0xd485('0x4')](_0xd485('0x45'),_0x198e8a[_0xd485('0x6')],queues[_0x198e8a[_0xd485('0x6')]][_0xd485('0x1e')],_0x198e8a[_0xd485('0x3d')],queues[_0x198e8a['uniqueid']][_0xd485('0xa')]));writeDB(queues[_0x198e8a['uniqueid']]);}}}catch(_0x1d3b2d){utils['error'](util[_0xd485('0x4')](_0xd485('0x41'),_0x198e8a[_0xd485('0x6')]),_0x1d3b2d);}};exports[_0xd485('0x46')]=function(_0x12efdb){try{if(!_[_0xd485('0x27')](queues[_0x12efdb['transfereeuniqueid']])){utils[_0xd485('0x12')](util[_0xd485('0x4')]('[%s][queues][blindtransfer]',_0x12efdb[_0xd485('0x6')]),_0x12efdb);queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x43')]=!![];queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x48')]='BLIND';queues[_0x12efdb[_0xd485('0x47')]]['transferexten']=_0x12efdb['extension'];queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x49')]=_0x12efdb[_0xd485('0x47')];queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0xa')]='BLINDTRANSFER';utils[_0xd485('0x3')](util[_0xd485('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x12efdb[_0xd485('0x6')],queues[_0x12efdb[_0xd485('0x47')]][_0xd485('0x1e')],_0x12efdb[_0xd485('0x47')],_0x12efdb[_0xd485('0x4a')]));}}catch(_0x28ec3b){utils[_0xd485('0x16')](util[_0xd485('0x4')]('[%s][queues][blindtransfer]',_0x12efdb['uniqueid']),_0x28ec3b);}};exports['attendedtransfer']=function(_0x12d65d){try{utils[_0xd485('0x12')](util['format']('[%s][queues][attendedtransfer]',_0x12d65d['origtransfereruniqueid']),_0x12d65d);if(_0x12d65d[_0xd485('0x4b')]==_0x12d65d[_0xd485('0x4c')]){if(!_[_0xd485('0x27')](queues[_0x12d65d[_0xd485('0x4d')]])){utils[_0xd485('0x3')](util['format'](_0xd485('0x4e'),_0x12d65d['origtransfereruniqueid'],queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x1e')],_0x12d65d['origtransfererexten']));queues[_0x12d65d[_0xd485('0x4d')]]['transfer']=!![];queues[_0x12d65d['secondtransfererlinkedid']]['transfertype']=_0xd485('0x4f');queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x50')]=_0x12d65d[_0xd485('0x51')];queues[_0x12d65d[_0xd485('0x4d')]]['transferuniqueid']=_0x12d65d[_0xd485('0x4b')];queues[_0x12d65d['secondtransfererlinkedid']]['queuecallerexitreason']=_0xd485('0x52');}if(!_['isNil'](queues[_0x12d65d[_0xd485('0x4c')]])){if(_0x12d65d['transfereelinkedid']&&queues[_0x12d65d[_0xd485('0x53')]]){queues[_0x12d65d[_0xd485('0x53')]][_0xd485('0x1f')]=0x1;queues[_0x12d65d[_0xd485('0x47')]]=_[_0xd485('0x54')](queues[_0x12d65d[_0xd485('0x53')]]);queues[_0x12d65d[_0xd485('0x47')]]['transfereduniqueid']=_0x12d65d[_0xd485('0x55')];queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x1f')]=0x2;queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x56')]=queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x56')];queues[_0x12d65d['transfereeuniqueid']][_0xd485('0x57')]=queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x57')];queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x37')]=utils[_0xd485('0x1b')]();queues[_0x12d65d[_0xd485('0x47')]]['queuecallerleaveAt']=utils['now']();queues[_0x12d65d[_0xd485('0x47')]]['holdtime']=0x0;queues[_0x12d65d['transfereeuniqueid']][_0xd485('0x58')]=0x0;utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x59'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d['transfereeuniqueid']]['name'],queues[_0x12d65d[_0xd485('0x47')]][_0xd485('0x56')],queues[_0x12d65d['transfereeuniqueid']][_0xd485('0x57')]));}else{utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x5a'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x1e')],_0x12d65d[_0xd485('0x4d')]));queues[_0x12d65d[_0xd485('0x4c')]]['transfereduniqueid']=_0x12d65d[_0xd485('0x4d')];}}}else if(_0x12d65d[_0xd485('0x5b')]==_0x12d65d[_0xd485('0x4d')]){if(!_[_0xd485('0x27')](queues[_0x12d65d[_0xd485('0x4c')]])){utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x5c'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x1e')],_0x12d65d[_0xd485('0x5b')],_0x12d65d['secondtransfererexten']));queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x43')]=!![];queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x48')]=_0xd485('0x4f');queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x50')]=_0x12d65d[_0xd485('0x5d')];queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x49')]=_0x12d65d[_0xd485('0x5b')];queues[_0x12d65d['origtransfererlinkedid']]['queuecallerexitreason']=_0xd485('0x52');}if(!_[_0xd485('0x27')](queues[_0x12d65d[_0xd485('0x4d')]])){if(_0x12d65d[_0xd485('0x5e')]&&queues[_0x12d65d[_0xd485('0x5e')]]){queues[_0x12d65d[_0xd485('0x5e')]][_0xd485('0x1f')]=0x1;queues[_0x12d65d[_0xd485('0x55')]]=_[_0xd485('0x54')](queues[_0x12d65d[_0xd485('0x5e')]]);queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x10')]=_0x12d65d['transfertargetuniqueid'];queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x1f')]=0x2;queues[_0x12d65d['transfertargetuniqueid']][_0xd485('0x56')]=queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x56')];queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x57')]=queues[_0x12d65d[_0xd485('0x4c')]][_0xd485('0x57')];queues[_0x12d65d['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xd485('0x1b')]();queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x17')]=utils[_0xd485('0x1b')]();queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x35')]=0x0;queues[_0x12d65d[_0xd485('0x55')]]['mohtime']=0x0;utils[_0xd485('0x3')](util['format'](_0xd485('0x5f'),_0x12d65d[_0xd485('0x4b')],queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x1e')],queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x10')],queues[_0x12d65d[_0xd485('0x55')]]['calleridnum'],queues[_0x12d65d[_0xd485('0x55')]][_0xd485('0x57')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x12d65d['origtransfereruniqueid'],queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x1e')],_0x12d65d[_0xd485('0x4c')]));queues[_0x12d65d[_0xd485('0x4d')]][_0xd485('0x10')]=_0x12d65d[_0xd485('0x4c')];}}}}catch(_0x3450ba){utils['error'](util[_0xd485('0x4')](_0xd485('0x60'),_0x12d65d[_0xd485('0x4b')]),_0x3450ba);}};exports['musiconholdstart']=function(_0x1ad6d9){try{if(!_[_0xd485('0x27')](queues[_0x1ad6d9[_0xd485('0x6')]])){utils['debug'](util[_0xd485('0x4')]('[%s][queues][musiconholdstart]',_0x1ad6d9['uniqueid']),_0x1ad6d9);queues[_0x1ad6d9[_0xd485('0x6')]]['musiconholdstartAt']=utils[_0xd485('0x1b')]();utils['info'](util[_0xd485('0x4')](_0xd485('0x61'),_0x1ad6d9['uniqueid'],queues[_0x1ad6d9[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x1ad6d9['uniqueid']]['musiconholdstartAt']));}}catch(_0x539b28){utils[_0xd485('0x16')](util['format'](_0xd485('0x62'),_0x1ad6d9[_0xd485('0x6')]),_0x539b28);}};exports[_0xd485('0x63')]=function(_0x5c5a68){try{if(!_['isNil'](queues[_0x5c5a68[_0xd485('0x6')]])){if(!_[_0xd485('0x27')](queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x64')])){utils[_0xd485('0x12')](util[_0xd485('0x4')](_0xd485('0x65'),_0x5c5a68[_0xd485('0x6')]),_0x5c5a68);queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x58')]+=utils[_0xd485('0x36')](utils[_0xd485('0x1b')](),queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x64')]);utils[_0xd485('0x3')](util[_0xd485('0x4')](_0xd485('0x66'),_0x5c5a68['uniqueid'],queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x1e')],queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x58')]));delete queues[_0x5c5a68[_0xd485('0x6')]][_0xd485('0x64')];}}}catch(_0x24ba6e){utils[_0xd485('0x16')](util['format'](_0xd485('0x65'),_0x5c5a68[_0xd485('0x6')]),_0x24ba6e);}}; \ No newline at end of file +var _0x4f1e=['format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','CONTINUE','queuecallerabandon','queuecallerexit','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x4f1e,0x6c));var _0xe4f1=function(_0x24271a,_0x397670){_0x24271a=_0x24271a-0x0;var _0x4a5ffb=_0x4f1e[_0x24271a];return _0x4a5ffb;};'use strict';var _=require(_0xe4f1('0x0'));var util=require('util');var utils=require(_0xe4f1('0x1'));var queues={};function writeDB(_0x4d3222){utils['info'](util[_0xe4f1('0x2')](_0xe4f1('0x3'),_0x4d3222[_0xe4f1('0x4')],_0x4d3222[_0xe4f1('0x5')],_0x4d3222[_0xe4f1('0x6')],_0x4d3222['lastAssignedTo'],_0x4d3222[_0xe4f1('0x7')],_0x4d3222[_0xe4f1('0x8')],_0x4d3222[_0xe4f1('0x9')]));if(_0x4d3222[_0xe4f1('0x6')]){utils[_0xe4f1('0xa')](_0x4d3222[_0xe4f1('0x6')])[_0xe4f1('0xb')](function(_0xfd39){if(_0xfd39){_0x4d3222[_0xe4f1('0xc')]=_0xfd39[_0xe4f1('0xc')];}utils[_0xe4f1('0xd')](_0xe4f1('0xe'),_0x4d3222);});}else{utils[_0xe4f1('0xd')]('CreateVoiceQueueReport',_0x4d3222);}if(_0x4d3222['transfereduniqueid']){delete queues[_0x4d3222[_0xe4f1('0xf')]];}else{delete queues[_0x4d3222[_0xe4f1('0x4')]];}}exports[_0xe4f1('0x10')]=function(_0x31c41a){try{utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x12'),_0x31c41a[_0xe4f1('0x4')]),_0x31c41a);utils[_0xe4f1('0x13')](util['format'](_0xe4f1('0x14'),_0x31c41a[_0xe4f1('0x4')],_0x31c41a[_0xe4f1('0x6')],_0x31c41a[_0xe4f1('0x15')]));queues[_0x31c41a[_0xe4f1('0x4')]]=_[_0xe4f1('0x16')](_0x31c41a,{'originalposition':_0x31c41a[_0xe4f1('0x15')],'queuecallerjoinAt':utils[_0xe4f1('0x17')](),'mohtime':0x0});}catch(_0x124ae4){utils[_0xe4f1('0x18')](util[_0xe4f1('0x2')](_0xe4f1('0x12'),_0x31c41a[_0xe4f1('0x4')]),_0x124ae4);}};exports[_0xe4f1('0x19')]=function(_0x32d165){try{if(!_['isNil'](queues[_0x32d165['uniqueid']])){utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x1a'),_0x32d165['uniqueid']),_0x32d165);if(queues[_0x32d165['uniqueid']][_0xe4f1('0x1b')]){if(!queues[_0x32d165[_0xe4f1('0x4')]]['queuecallerabandon']&&!queues[_0x32d165['uniqueid']]['queuecallerexit']){queues[_0x32d165[_0xe4f1('0x4')]]['queuecallercomplete']=!![];queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0x1c')]=utils[_0xe4f1('0x17')]();queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0x9')]=_0xe4f1('0x1d');}utils['info'](util[_0xe4f1('0x2')](_0xe4f1('0x1e'),_0x32d165[_0xe4f1('0x4')],queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0x1f')],queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0x9')]));writeDB(queues[_0x32d165[_0xe4f1('0x4')]]);}else if(queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0xf')]){utils[_0xe4f1('0x13')](util['format'](_0xe4f1('0x20'),_0x32d165['uniqueid'],queues[_0x32d165['uniqueid']][_0xe4f1('0x1f')],queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0xf')]));queues[queues[_0x32d165[_0xe4f1('0x4')]][_0xe4f1('0xf')]]=queues[_0x32d165['uniqueid']];queues[queues[_0x32d165['uniqueid']][_0xe4f1('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x32d165[_0xe4f1('0x4')]];}}}catch(_0x464a4b){utils[_0xe4f1('0x18')](util['format'](_0xe4f1('0x1a'),_0x32d165['uniqueid']),_0x464a4b);}};exports[_0xe4f1('0x21')]=function(_0x46a83a){try{utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x22'),_0x46a83a[_0xe4f1('0x4')]),_0x46a83a);if(!_[_0xe4f1('0x23')](_0x46a83a[_0xe4f1('0x24')][_0xe4f1('0x25')])&&_0x46a83a[_0xe4f1('0x26')]['toUpperCase']()!==_0xe4f1('0x27')){if(!_['isNil'](queues[_0x46a83a[_0xe4f1('0x4')]])){queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x28')]=![];queues[_0x46a83a[_0xe4f1('0x4')]]['queuecallerabandonAt']=null;queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x29')]=!![];queues[_0x46a83a[_0xe4f1('0x4')]]['queuecallerexitAt']=utils[_0xe4f1('0x17')]();queues[_0x46a83a['uniqueid']][_0xe4f1('0x9')]=_0x46a83a['value'][_0xe4f1('0x2a')]();utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')](_0xe4f1('0x2b'),_0x46a83a[_0xe4f1('0x4')],queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x1f')],_0x46a83a[_0xe4f1('0x26')],queues[_0x46a83a['uniqueid']][_0xe4f1('0x9')]));writeDB(queues[_0x46a83a[_0xe4f1('0x4')]]);}}else if(!_[_0xe4f1('0x23')](_0x46a83a[_0xe4f1('0x24')][_0xe4f1('0x2c')])){if(!_[_0xe4f1('0x23')](queues[_0x46a83a[_0xe4f1('0x4')]])&&!queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x28')]){queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x28')]=![];queues[_0x46a83a['uniqueid']][_0xe4f1('0x2d')]=null;queues[_0x46a83a['uniqueid']][_0xe4f1('0x29')]=!![];queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x2e')]=utils[_0xe4f1('0x17')]();queues[_0x46a83a['uniqueid']][_0xe4f1('0x9')]=_0xe4f1('0x2f');utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x46a83a[_0xe4f1('0x4')],queues[_0x46a83a[_0xe4f1('0x4')]][_0xe4f1('0x1f')],_0x46a83a[_0xe4f1('0x26')],queues[_0x46a83a['uniqueid']][_0xe4f1('0x9')]));}}}catch(_0x1c0960){utils[_0xe4f1('0x18')](util[_0xe4f1('0x2')]('[%s][queues][varset]',_0x46a83a['uniqueid']),_0x1c0960);}};exports[_0xe4f1('0x28')]=function(_0x771bb8){try{if(!_['isNil'](queues[_0x771bb8['uniqueid']])){utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x30'),_0x771bb8[_0xe4f1('0x4')]),_0x771bb8);queues[_0x771bb8[_0xe4f1('0x4')]]['queuecallerexit']=![];queues[_0x771bb8[_0xe4f1('0x4')]][_0xe4f1('0x2e')]=null;queues[_0x771bb8['uniqueid']][_0xe4f1('0x28')]=!![];queues[_0x771bb8[_0xe4f1('0x4')]]['queuecallerabandonAt']=utils[_0xe4f1('0x17')]();queues[_0x771bb8[_0xe4f1('0x4')]]['queuecallerexitreason']=_0xe4f1('0x31');utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')](_0xe4f1('0x32'),_0x771bb8[_0xe4f1('0x4')],queues[_0x771bb8[_0xe4f1('0x4')]][_0xe4f1('0x1f')],queues[_0x771bb8[_0xe4f1('0x4')]]['queuecallerexitreason']));}}catch(_0x1f7421){utils['error'](util[_0xe4f1('0x2')](_0xe4f1('0x30'),_0x771bb8[_0xe4f1('0x4')]),_0x1f7421);}};exports[_0xe4f1('0x33')]=function(_0x5e8dec){try{if(!_[_0xe4f1('0x23')](queues[_0x5e8dec[_0xe4f1('0x4')]])){utils[_0xe4f1('0x11')](util['format'](_0xe4f1('0x34'),_0x5e8dec['uniqueid']),_0x5e8dec);utils['info'](util[_0xe4f1('0x2')](_0xe4f1('0x35'),_0x5e8dec['uniqueid'],queues[_0x5e8dec[_0xe4f1('0x4')]][_0xe4f1('0x1f')],_0x5e8dec[_0xe4f1('0x36')],_0x5e8dec[_0xe4f1('0x37')]));queues[_0x5e8dec['uniqueid']][_0xe4f1('0x33')]=!![];queues[_0x5e8dec['uniqueid']][_0xe4f1('0x1b')]=utils['now']();queues[_0x5e8dec[_0xe4f1('0x4')]][_0xe4f1('0x38')]=utils[_0xe4f1('0x39')](queues[_0x5e8dec[_0xe4f1('0x4')]][_0xe4f1('0x1b')],queues[_0x5e8dec[_0xe4f1('0x4')]][_0xe4f1('0x3a')]);queues[_0x5e8dec['uniqueid']]['position']=_0x5e8dec[_0xe4f1('0x15')];queues[_0x5e8dec[_0xe4f1('0x4')]][_0xe4f1('0x3b')]=_0x5e8dec[_0xe4f1('0x3b')];queues[_0x5e8dec['uniqueid']]['connectedlinenum']=_0x5e8dec[_0xe4f1('0x36')];queues[_0x5e8dec[_0xe4f1('0x4')]]['connectedlinename']=_0x5e8dec['connectedlinename'];}}catch(_0x1549ab){utils[_0xe4f1('0x18')](util[_0xe4f1('0x2')](_0xe4f1('0x34'),_0x5e8dec[_0xe4f1('0x4')]),_0x1549ab);}};exports[_0xe4f1('0x3c')]=function(_0x11b180){try{if(!_['isNil'](queues[_0x11b180[_0xe4f1('0x4')]])){utils['debug'](util[_0xe4f1('0x2')]('[%s][queues][agentconnect]',_0x11b180[_0xe4f1('0x4')]),_0x11b180);utils[_0xe4f1('0x13')](util['format'](_0xe4f1('0x3d'),_0x11b180[_0xe4f1('0x4')],queues[_0x11b180[_0xe4f1('0x4')]][_0xe4f1('0x1f')],_0x11b180[_0xe4f1('0x3e')],_0x11b180[_0xe4f1('0x3f')]));queues[_0x11b180[_0xe4f1('0x4')]]['queuecallerabandon']=![];queues[_0x11b180['uniqueid']][_0xe4f1('0x28')]=![];queues[_0x11b180['uniqueid']][_0xe4f1('0x2d')]=null;queues[_0x11b180['uniqueid']][_0xe4f1('0x29')]=![];queues[_0x11b180[_0xe4f1('0x4')]][_0xe4f1('0x9')]=null;queues[_0x11b180['uniqueid']][_0xe4f1('0x2e')]=null;queues[_0x11b180[_0xe4f1('0x4')]][_0xe4f1('0x40')]=!![];queues[_0x11b180[_0xe4f1('0x4')]][_0xe4f1('0x8')]=_0x11b180['destaccountcode'];queues[_0x11b180[_0xe4f1('0x4')]][_0xe4f1('0x41')]=_0x11b180[_0xe4f1('0x3e')];}}catch(_0x443db3){utils['error'](util['format'](_0xe4f1('0x42'),_0x11b180[_0xe4f1('0x4')]),_0x443db3);}};exports[_0xe4f1('0x43')]=function(_0x22d531){try{if(!_['isNil'](queues[_0x22d531['uniqueid']])){if(queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x1b')]){utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x44'),_0x22d531[_0xe4f1('0x4')]),_0x22d531);queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x28')]=![];queues[_0x22d531['uniqueid']][_0xe4f1('0x28')]=![];queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x2d')]=null;queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x29')]=![];queues[_0x22d531[_0xe4f1('0x4')]]['queuecallerexitAt']=null;queues[_0x22d531['uniqueid']][_0xe4f1('0x40')]=!![];queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x41')]=_0x22d531[_0xe4f1('0x3e')];queues[_0x22d531[_0xe4f1('0x4')]]['queuecallercomplete']=!![];queues[_0x22d531['uniqueid']][_0xe4f1('0x1c')]=utils['now']();if(_0x22d531[_0xe4f1('0x45')]==_0xe4f1('0x46')){if(!queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x46')]){queues[_0x22d531['uniqueid']][_0xe4f1('0x9')]=_0xe4f1('0x47');}}else{queues[_0x22d531[_0xe4f1('0x4')]]['queuecallerexitreason']='COMPLETEDBY'+_0x22d531[_0xe4f1('0x45')]['toUpperCase']();}utils[_0xe4f1('0x13')](util['format'](_0xe4f1('0x48'),_0x22d531[_0xe4f1('0x4')],queues[_0x22d531[_0xe4f1('0x4')]]['name'],_0x22d531[_0xe4f1('0x3e')],queues[_0x22d531[_0xe4f1('0x4')]][_0xe4f1('0x9')]));writeDB(queues[_0x22d531[_0xe4f1('0x4')]]);}}}catch(_0x29bd7a){utils['error'](util['format']('[%s][queues][agentcomplete]',_0x22d531[_0xe4f1('0x4')]),_0x29bd7a);}};exports[_0xe4f1('0x49')]=function(_0x1c0869){try{if(!_['isNil'](queues[_0x1c0869[_0xe4f1('0x4a')]])){utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')]('[%s][queues][blindtransfer]',_0x1c0869[_0xe4f1('0x4')]),_0x1c0869);queues[_0x1c0869[_0xe4f1('0x4a')]][_0xe4f1('0x46')]=!![];queues[_0x1c0869['transfereeuniqueid']][_0xe4f1('0x4b')]=_0xe4f1('0x4c');queues[_0x1c0869['transfereeuniqueid']]['transferexten']=_0x1c0869['extension'];queues[_0x1c0869['transfereeuniqueid']][_0xe4f1('0x4d')]=_0x1c0869[_0xe4f1('0x4a')];queues[_0x1c0869['transfereeuniqueid']][_0xe4f1('0x9')]=_0xe4f1('0x4e');utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')](_0xe4f1('0x4f'),_0x1c0869[_0xe4f1('0x4')],queues[_0x1c0869[_0xe4f1('0x4a')]][_0xe4f1('0x1f')],_0x1c0869[_0xe4f1('0x4a')],_0x1c0869[_0xe4f1('0x50')]));}}catch(_0x5e60ba){utils[_0xe4f1('0x18')](util['format']('[%s][queues][blindtransfer]',_0x1c0869[_0xe4f1('0x4')]),_0x5e60ba);}};exports[_0xe4f1('0x51')]=function(_0x36021e){try{utils[_0xe4f1('0x11')](util['format'](_0xe4f1('0x52'),_0x36021e[_0xe4f1('0x53')]),_0x36021e);if(_0x36021e[_0xe4f1('0x53')]==_0x36021e['origtransfererlinkedid']){if(!_[_0xe4f1('0x23')](queues[_0x36021e['secondtransfererlinkedid']])){utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')](_0xe4f1('0x54'),_0x36021e[_0xe4f1('0x53')],queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x1f')],_0x36021e[_0xe4f1('0x56')]));queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x46')]=!![];queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x4b')]=_0xe4f1('0x57');queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x58')]=_0x36021e[_0xe4f1('0x56')];queues[_0x36021e['secondtransfererlinkedid']][_0xe4f1('0x4d')]=_0x36021e[_0xe4f1('0x53')];queues[_0x36021e[_0xe4f1('0x55')]]['queuecallerexitreason']=_0xe4f1('0x59');}if(!_[_0xe4f1('0x23')](queues[_0x36021e[_0xe4f1('0x5a')]])){if(_0x36021e['transfereelinkedid']&&queues[_0x36021e[_0xe4f1('0x5b')]]){queues[_0x36021e[_0xe4f1('0x5b')]][_0xe4f1('0x5c')]=0x1;queues[_0x36021e[_0xe4f1('0x4a')]]=_[_0xe4f1('0x5d')](queues[_0x36021e[_0xe4f1('0x5b')]]);queues[_0x36021e[_0xe4f1('0x4a')]]['transfereduniqueid']=_0x36021e[_0xe4f1('0x5e')];queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x5c')]=0x2;queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x7')]=queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x7')];queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x5f')]=queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x5f')];queues[_0x36021e['transfereeuniqueid']][_0xe4f1('0x3a')]=utils[_0xe4f1('0x17')]();queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x1b')]=utils[_0xe4f1('0x17')]();queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x38')]=0x0;queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x60')]=0x0;utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x36021e[_0xe4f1('0x53')],queues[_0x36021e['transfereeuniqueid']]['name'],queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x7')],queues[_0x36021e[_0xe4f1('0x4a')]][_0xe4f1('0x5f')]));}else{utils[_0xe4f1('0x13')](util['format'](_0xe4f1('0x61'),_0x36021e[_0xe4f1('0x53')],queues[_0x36021e['origtransfererlinkedid']][_0xe4f1('0x1f')],_0x36021e['secondtransfererlinkedid']));queues[_0x36021e['origtransfererlinkedid']][_0xe4f1('0xf')]=_0x36021e[_0xe4f1('0x55')];}}}else if(_0x36021e[_0xe4f1('0x62')]==_0x36021e[_0xe4f1('0x55')]){if(!_[_0xe4f1('0x23')](queues[_0x36021e['origtransfererlinkedid']])){utils['info'](util[_0xe4f1('0x2')](_0xe4f1('0x63'),_0x36021e[_0xe4f1('0x53')],queues[_0x36021e[_0xe4f1('0x5a')]][_0xe4f1('0x1f')],_0x36021e[_0xe4f1('0x62')],_0x36021e[_0xe4f1('0x64')]));queues[_0x36021e[_0xe4f1('0x5a')]][_0xe4f1('0x46')]=!![];queues[_0x36021e[_0xe4f1('0x5a')]][_0xe4f1('0x4b')]='ATTENDED';queues[_0x36021e['origtransfererlinkedid']][_0xe4f1('0x58')]=_0x36021e[_0xe4f1('0x64')];queues[_0x36021e['origtransfererlinkedid']][_0xe4f1('0x4d')]=_0x36021e['secondtransfereruniqueid'];queues[_0x36021e[_0xe4f1('0x5a')]][_0xe4f1('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xe4f1('0x23')](queues[_0x36021e[_0xe4f1('0x55')]])){if(_0x36021e[_0xe4f1('0x65')]&&queues[_0x36021e['transfertargetlinkedid']]){queues[_0x36021e['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x36021e['transfertargetuniqueid']]=_['clone'](queues[_0x36021e['transfertargetlinkedid']]);queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0xf')]=_0x36021e[_0xe4f1('0x5e')];queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0x5c')]=0x2;queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0x7')]=queues[_0x36021e[_0xe4f1('0x5a')]][_0xe4f1('0x7')];queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0x5f')]=queues[_0x36021e[_0xe4f1('0x5a')]]['calleridname'];queues[_0x36021e[_0xe4f1('0x5e')]]['queuecallerjoinAt']=utils[_0xe4f1('0x17')]();queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0x1b')]=utils[_0xe4f1('0x17')]();queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0x38')]=0x0;queues[_0x36021e[_0xe4f1('0x5e')]]['mohtime']=0x0;utils['info'](util[_0xe4f1('0x2')](_0xe4f1('0x66'),_0x36021e['origtransfereruniqueid'],queues[_0x36021e[_0xe4f1('0x5e')]]['name'],queues[_0x36021e[_0xe4f1('0x5e')]][_0xe4f1('0xf')],queues[_0x36021e[_0xe4f1('0x5e')]]['calleridnum'],queues[_0x36021e['transfertargetuniqueid']][_0xe4f1('0x5f')]));}else{utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x36021e['origtransfereruniqueid'],queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0x1f')],_0x36021e[_0xe4f1('0x5a')]));queues[_0x36021e[_0xe4f1('0x55')]][_0xe4f1('0xf')]=_0x36021e[_0xe4f1('0x5a')];}}}}catch(_0x2946d5){utils[_0xe4f1('0x18')](util['format'](_0xe4f1('0x52'),_0x36021e[_0xe4f1('0x53')]),_0x2946d5);}};exports[_0xe4f1('0x67')]=function(_0x34e8b1){try{if(!_[_0xe4f1('0x23')](queues[_0x34e8b1[_0xe4f1('0x4')]])){utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x68'),_0x34e8b1[_0xe4f1('0x4')]),_0x34e8b1);queues[_0x34e8b1['uniqueid']][_0xe4f1('0x69')]=utils[_0xe4f1('0x17')]();utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')](_0xe4f1('0x6a'),_0x34e8b1[_0xe4f1('0x4')],queues[_0x34e8b1['uniqueid']][_0xe4f1('0x1f')],queues[_0x34e8b1[_0xe4f1('0x4')]][_0xe4f1('0x69')]));}}catch(_0x42f139){utils[_0xe4f1('0x18')](util[_0xe4f1('0x2')](_0xe4f1('0x68'),_0x34e8b1[_0xe4f1('0x4')]),_0x42f139);}};exports[_0xe4f1('0x6b')]=function(_0x5e4153){try{if(!_[_0xe4f1('0x23')](queues[_0x5e4153[_0xe4f1('0x4')]])){if(!_[_0xe4f1('0x23')](queues[_0x5e4153['uniqueid']][_0xe4f1('0x69')])){utils[_0xe4f1('0x11')](util[_0xe4f1('0x2')](_0xe4f1('0x6c'),_0x5e4153[_0xe4f1('0x4')]),_0x5e4153);queues[_0x5e4153[_0xe4f1('0x4')]]['mohtime']+=utils['diffTime'](utils[_0xe4f1('0x17')](),queues[_0x5e4153[_0xe4f1('0x4')]][_0xe4f1('0x69')]);utils[_0xe4f1('0x13')](util[_0xe4f1('0x2')](_0xe4f1('0x6d'),_0x5e4153['uniqueid'],queues[_0x5e4153['uniqueid']]['name'],queues[_0x5e4153[_0xe4f1('0x4')]]['mohtime']));delete queues[_0x5e4153[_0xe4f1('0x4')]]['musiconholdstartAt'];}}}catch(_0x30650c){utils[_0xe4f1('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x5e4153['uniqueid']),_0x30650c);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index de70354..663a352 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 _0x4347=['variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','forEach','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','set','startsWith','split','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset'];(function(_0x2a94cf,_0x2b970d){var _0x22147f=function(_0xfc71ab){while(--_0xfc71ab){_0x2a94cf['push'](_0x2a94cf['shift']());}};_0x22147f(++_0x2b970d);}(_0x4347,0x188));var _0x7434=function(_0x25df45,_0x2f36e2){_0x25df45=_0x25df45-0x0;var _0x3fa45e=_0x4347[_0x25df45];return _0x3fa45e;};'use strict';var _=require(_0x7434('0x0'));var util=require('util');var utils=require(_0x7434('0x1'));var recordings={};function writeDB(_0x2829c4){utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x4'),_0x2829c4[_0x7434('0x5')]));if(_0x2829c4[_0x7434('0x6')]){utils['getUserByInternal'](_0x2829c4[_0x7434('0x6')])[_0x7434('0x7')](function(_0x5670b4){if(_0x5670b4){_0x2829c4[_0x7434('0x8')]=_0x5670b4[_0x7434('0x9')];_0x2829c4[_0x7434('0xa')]=_0x5670b4['id'];}utils[_0x7434('0xb')]('CreateVoiceRecording',_0x2829c4);});}else{utils[_0x7434('0xb')](_0x7434('0xc'),_0x2829c4);}}exports[_0x7434('0xd')]=function(_0x426df9){try{utils[_0x7434('0xe')](util['format']('[%s][recordings][newchannel]',_0x426df9['uniqueid']),_0x426df9);if(_0x426df9[_0x7434('0x5')]==_0x426df9['linkedid']){utils[_0x7434('0x2')](util['format'](_0x7434('0xf'),_0x426df9[_0x7434('0x5')],_0x426df9['context'],_0x426df9['exten']));recordings[_0x426df9[_0x7434('0x5')]]={'uniqueid':_0x426df9[_0x7434('0x5')],'accountcode':_0x426df9[_0x7434('0x6')],'exten':_0x426df9[_0x7434('0x10')],'context':_0x426df9[_0x7434('0x11')],'channel':_0x426df9[_0x7434('0x12')],'monitors':[]};}}catch(_0x558d6f){utils[_0x7434('0x13')](util[_0x7434('0x3')]('[%s][recordings][newchannel]',_0x426df9[_0x7434('0x5')]),_0x558d6f);}};exports[_0x7434('0x14')]=function(_0x44bdb4){try{utils[_0x7434('0xe')](util[_0x7434('0x3')](_0x7434('0x15'),_0x44bdb4[_0x7434('0x5')]),_0x44bdb4);if(!_[_0x7434('0x16')](recordings[_0x44bdb4['uniqueid']])&&_0x44bdb4[_0x7434('0x17')]==0x6){utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x18'),_0x44bdb4[_0x7434('0x5')],_0x44bdb4[_0x7434('0x11')],_0x44bdb4[_0x7434('0x12')]));}else if(!_[_0x7434('0x16')](recordings[_0x44bdb4[_0x7434('0x19')]])&&_0x44bdb4[_0x7434('0x17')]==0x6&&_0x44bdb4[_0x7434('0x11')]!='transfer'){utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x1a'),_0x44bdb4[_0x7434('0x5')],_0x44bdb4[_0x7434('0x19')],_0x44bdb4['context'],_0x44bdb4[_0x7434('0x12')]));recordings[_0x44bdb4[_0x7434('0x19')]]['accountcode']=_0x44bdb4[_0x7434('0x6')];}}catch(_0x43cbee){utils['error'](util[_0x7434('0x3')]('[%s][recordings][newstate]',_0x44bdb4[_0x7434('0x5')]),_0x43cbee);}};exports[_0x7434('0x1b')]=function(_0x5e376f){try{if(!_[_0x7434('0x16')](_0x5e376f[_0x7434('0x1c')])&&!_[_0x7434('0x16')](_0x5e376f[_0x7434('0x1c')][_0x7434('0x1d')])){utils[_0x7434('0xe')](util[_0x7434('0x3')](_0x7434('0x1e'),_0x5e376f['uniqueid']),_0x5e376f);utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x1f'),_0x5e376f[_0x7434('0x5')],_0x5e376f[_0x7434('0x1c')],_0x5e376f[_0x7434('0x20')]));if(_[_0x7434('0x21')](_0x5e376f['value'],_0x7434('0x22'))){_0x5e376f[_0x7434('0x20')]=_0x5e376f['value'][_0x7434('0x23')](_0x7434('0x22'),_0x7434('0x24'));}if(recordings[_0x5e376f[_0x7434('0x19')]]){var _0x4adb79=_[_0x7434('0x25')](recordings[_0x5e376f[_0x7434('0x19')]]['monitors'],{'value':_0x5e376f[_0x7434('0x20')]});if(_[_0x7434('0x16')](_0x4adb79)){recordings[_0x5e376f[_0x7434('0x19')]][_0x7434('0x26')]['push']({'value':_0x5e376f[_0x7434('0x20')]});}}}}catch(_0x3864b9){utils[_0x7434('0x13')](util['format'](_0x7434('0x1e'),_0x5e376f[_0x7434('0x5')]),_0x3864b9);}};exports[_0x7434('0x27')]=function(_0x1911cf){try{if(!_[_0x7434('0x16')](recordings[_0x1911cf[_0x7434('0x5')]])){utils[_0x7434('0xe')](util['format'](_0x7434('0x28'),_0x1911cf[_0x7434('0x5')]),_0x1911cf);utils[_0x7434('0x2')](util[_0x7434('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1911cf[_0x7434('0x5')],_0x1911cf[_0x7434('0x29')],_0x1911cf[_0x7434('0x2a')],_0x1911cf[_0x7434('0x2b')]));recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x29')]=_0x1911cf[_0x7434('0x29')];recordings[_0x1911cf[_0x7434('0x5')]]['calleridname']=_0x1911cf[_0x7434('0x2a')];recordings[_0x1911cf[_0x7434('0x5')]]['connectedlinenum']=_0x1911cf[_0x7434('0x2c')];recordings[_0x1911cf[_0x7434('0x5')]]['connectedlinename']=_0x1911cf['connectedlinename'];if(recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x2d')]==_0x7434('0x2e')&&recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x6')]){recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x2c')]=recordings[_0x1911cf['uniqueid']][_0x7434('0x6')];recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x2f')]='';}recordings[_0x1911cf[_0x7434('0x5')]][_0x7434('0x26')][_0x7434('0x30')](function(_0x2ac414){var _0x36221b=_[_0x7434('0x31')](recordings[_0x1911cf[_0x7434('0x5')]]);_0x36221b['value']=_0x2ac414[_0x7434('0x20')];writeDB(_0x36221b);});delete recordings[_0x1911cf[_0x7434('0x5')]];}}catch(_0x155538){utils[_0x7434('0x13')](util[_0x7434('0x3')](_0x7434('0x28'),_0x1911cf[_0x7434('0x5')]),_0x155538);}};exports['newexten']=function(_0x3f715a){try{if(!_[_0x7434('0x16')](recordings[_0x3f715a[_0x7434('0x5')]])){utils['debug'](util[_0x7434('0x3')]('[%s][recordings][newexten]',_0x3f715a['uniqueid']),_0x3f715a);utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x32'),_0x3f715a[_0x7434('0x5')],_0x3f715a['application'],_0x3f715a[_0x7434('0x33')]));if(_0x3f715a['application']['toLowerCase']()==_0x7434('0x34')&&_[_0x7434('0x35')](_0x3f715a[_0x7434('0x33')]['toLowerCase'](),'cdr')){var _0x2e4938=_0x3f715a[_0x7434('0x33')][_0x7434('0x36')]('=');var _0x3548c8=_0x2e4938[0x0]['substring'](_0x2e4938[0x0][_0x7434('0x37')]('(')+0x1,_0x2e4938[0x0][_0x7434('0x37')](')'));var _0x30fb2f=_0x2e4938[0x1];recordings[_0x3f715a[_0x7434('0x5')]][_0x3548c8]=_0x30fb2f;}}}catch(_0x2729d1){utils['error'](util[_0x7434('0x3')](_0x7434('0x38'),_0x3f715a[_0x7434('0x5')]),_0x2729d1);}};exports['queuecallerjoin']=function(_0x57fb8b){try{if(!_[_0x7434('0x16')](recordings[_0x57fb8b[_0x7434('0x5')]])){utils[_0x7434('0xe')](util[_0x7434('0x3')](_0x7434('0x39'),_0x57fb8b[_0x7434('0x5')]),_0x57fb8b);utils[_0x7434('0x2')](util[_0x7434('0x3')](_0x7434('0x3a'),_0x57fb8b[_0x7434('0x5')],_0x57fb8b[_0x7434('0x3b')]));recordings[_0x57fb8b['uniqueid']][_0x7434('0x3b')]=_0x57fb8b[_0x7434('0x3b')];}}catch(_0x1e68f2){utils[_0x7434('0x13')](util[_0x7434('0x3')](_0x7434('0x39'),_0x57fb8b[_0x7434('0x5')]),_0x1e68f2);}}; \ No newline at end of file +var _0x582e=['toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','uniqueid','getUserByInternal','accountcode','membername','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','linkedid','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors','push','error','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x582e,0x166));var _0xe582=function(_0x20acdb,_0x210c8e){_0x20acdb=_0x20acdb-0x0;var _0x383b0d=_0x582e[_0x20acdb];return _0x383b0d;};'use strict';var _=require(_0xe582('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x4e5bba){utils[_0xe582('0x1')](util[_0xe582('0x2')]('[%s][recordings][writeDB]',_0x4e5bba[_0xe582('0x3')]));if(_0x4e5bba['accountcode']){utils[_0xe582('0x4')](_0x4e5bba[_0xe582('0x5')])['then'](function(_0xcae801){if(_0xcae801){_0x4e5bba[_0xe582('0x6')]=_0xcae801['name'];_0x4e5bba[_0xe582('0x7')]=_0xcae801['id'];}utils[_0xe582('0x8')](_0xe582('0x9'),_0x4e5bba);});}else{utils['request'](_0xe582('0x9'),_0x4e5bba);}}exports['newchannel']=function(_0x39fd30){try{utils[_0xe582('0xa')](util['format'](_0xe582('0xb'),_0x39fd30['uniqueid']),_0x39fd30);if(_0x39fd30['uniqueid']==_0x39fd30['linkedid']){utils[_0xe582('0x1')](util[_0xe582('0x2')](_0xe582('0xc'),_0x39fd30[_0xe582('0x3')],_0x39fd30['context'],_0x39fd30[_0xe582('0xd')]));recordings[_0x39fd30['uniqueid']]={'uniqueid':_0x39fd30['uniqueid'],'accountcode':_0x39fd30['accountcode'],'exten':_0x39fd30['exten'],'context':_0x39fd30[_0xe582('0xe')],'channel':_0x39fd30['channel'],'monitors':[]};}}catch(_0x4aaf7c){utils['error'](util[_0xe582('0x2')](_0xe582('0xb'),_0x39fd30[_0xe582('0x3')]),_0x4aaf7c);}};exports[_0xe582('0xf')]=function(_0x1759e3){try{utils[_0xe582('0xa')](util[_0xe582('0x2')](_0xe582('0x10'),_0x1759e3['uniqueid']),_0x1759e3);if(!_[_0xe582('0x11')](recordings[_0x1759e3[_0xe582('0x3')]])&&_0x1759e3['channelstate']==0x6){utils[_0xe582('0x1')](util[_0xe582('0x2')](_0xe582('0x12'),_0x1759e3['uniqueid'],_0x1759e3['context'],_0x1759e3[_0xe582('0x13')]));}else if(!_[_0xe582('0x11')](recordings[_0x1759e3[_0xe582('0x14')]])&&_0x1759e3['channelstate']==0x6&&_0x1759e3[_0xe582('0xe')]!=_0xe582('0x15')){utils[_0xe582('0x1')](util[_0xe582('0x2')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1759e3[_0xe582('0x3')],_0x1759e3[_0xe582('0x14')],_0x1759e3[_0xe582('0xe')],_0x1759e3[_0xe582('0x13')]));recordings[_0x1759e3[_0xe582('0x14')]][_0xe582('0x5')]=_0x1759e3['accountcode'];}}catch(_0x3c5489){utils['error'](util[_0xe582('0x2')]('[%s][recordings][newstate]',_0x1759e3['uniqueid']),_0x3c5489);}};exports[_0xe582('0x16')]=function(_0xd14555){try{if(!_['isNil'](_0xd14555[_0xe582('0x17')])&&!_[_0xe582('0x11')](_0xd14555[_0xe582('0x17')][_0xe582('0x18')])){utils[_0xe582('0xa')](util[_0xe582('0x2')](_0xe582('0x19'),_0xd14555[_0xe582('0x3')]),_0xd14555);utils['info'](util[_0xe582('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0xd14555['uniqueid'],_0xd14555['variable'],_0xd14555[_0xe582('0x1a')]));if(_[_0xe582('0x1b')](_0xd14555[_0xe582('0x1a')],_0xe582('0x1c'))){_0xd14555[_0xe582('0x1a')]=_0xd14555['value']['replace']('.wav49',_0xe582('0x1d'));}if(recordings[_0xd14555[_0xe582('0x14')]]){var _0x3b71a9=_[_0xe582('0x1e')](recordings[_0xd14555[_0xe582('0x14')]][_0xe582('0x1f')],{'value':_0xd14555[_0xe582('0x1a')]});if(_[_0xe582('0x11')](_0x3b71a9)){recordings[_0xd14555[_0xe582('0x14')]]['monitors'][_0xe582('0x20')]({'value':_0xd14555[_0xe582('0x1a')]});}}}}catch(_0x3d672e){utils[_0xe582('0x21')](util[_0xe582('0x2')](_0xe582('0x19'),_0xd14555['uniqueid']),_0x3d672e);}};exports[_0xe582('0x22')]=function(_0x551387){try{if(!_[_0xe582('0x11')](recordings[_0x551387[_0xe582('0x3')]])){utils[_0xe582('0xa')](util['format'](_0xe582('0x23'),_0x551387['uniqueid']),_0x551387);utils[_0xe582('0x1')](util[_0xe582('0x2')](_0xe582('0x24'),_0x551387[_0xe582('0x3')],_0x551387['calleridnum'],_0x551387[_0xe582('0x25')],_0x551387[_0xe582('0x26')]));recordings[_0x551387['uniqueid']]['calleridnum']=_0x551387[_0xe582('0x27')];recordings[_0x551387[_0xe582('0x3')]][_0xe582('0x25')]=_0x551387[_0xe582('0x25')];recordings[_0x551387['uniqueid']][_0xe582('0x28')]=_0x551387[_0xe582('0x28')];recordings[_0x551387['uniqueid']]['connectedlinename']=_0x551387['connectedlinename'];if(recordings[_0x551387['uniqueid']]['type']==_0xe582('0x29')&&recordings[_0x551387['uniqueid']][_0xe582('0x5')]){recordings[_0x551387[_0xe582('0x3')]]['connectedlinenum']=recordings[_0x551387[_0xe582('0x3')]][_0xe582('0x5')];recordings[_0x551387['uniqueid']]['connectedlinename']='';}recordings[_0x551387[_0xe582('0x3')]]['monitors'][_0xe582('0x2a')](function(_0x3f045a){var _0x56b375=_[_0xe582('0x2b')](recordings[_0x551387['uniqueid']]);_0x56b375[_0xe582('0x1a')]=_0x3f045a[_0xe582('0x1a')];writeDB(_0x56b375);});delete recordings[_0x551387['uniqueid']];}}catch(_0x43739e){utils[_0xe582('0x21')](util['format'](_0xe582('0x23'),_0x551387[_0xe582('0x3')]),_0x43739e);}};exports[_0xe582('0x2c')]=function(_0x36a2ed){try{if(!_[_0xe582('0x11')](recordings[_0x36a2ed['uniqueid']])){utils['debug'](util[_0xe582('0x2')](_0xe582('0x2d'),_0x36a2ed[_0xe582('0x3')]),_0x36a2ed);utils[_0xe582('0x1')](util[_0xe582('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x36a2ed[_0xe582('0x3')],_0x36a2ed[_0xe582('0x2e')],_0x36a2ed[_0xe582('0x2f')]));if(_0x36a2ed[_0xe582('0x2e')][_0xe582('0x30')]()==_0xe582('0x31')&&_[_0xe582('0x32')](_0x36a2ed[_0xe582('0x2f')][_0xe582('0x30')](),_0xe582('0x33'))){var _0x369647=_0x36a2ed['appdata'][_0xe582('0x34')]('=');var _0x361779=_0x369647[0x0][_0xe582('0x35')](_0x369647[0x0][_0xe582('0x36')]('(')+0x1,_0x369647[0x0][_0xe582('0x36')](')'));var _0x78dc9f=_0x369647[0x1];recordings[_0x36a2ed[_0xe582('0x3')]][_0x361779]=_0x78dc9f;}}}catch(_0x5a26bb){utils[_0xe582('0x21')](util[_0xe582('0x2')](_0xe582('0x2d'),_0x36a2ed['uniqueid']),_0x5a26bb);}};exports[_0xe582('0x37')]=function(_0x51b14d){try{if(!_[_0xe582('0x11')](recordings[_0x51b14d[_0xe582('0x3')]])){utils[_0xe582('0xa')](util[_0xe582('0x2')]('[%s][recordings][queuecallerjoin]',_0x51b14d[_0xe582('0x3')]),_0x51b14d);utils[_0xe582('0x1')](util[_0xe582('0x2')](_0xe582('0x38'),_0x51b14d[_0xe582('0x3')],_0x51b14d[_0xe582('0x39')]));recordings[_0x51b14d[_0xe582('0x3')]]['queue']=_0x51b14d['queue'];}}catch(_0x5e91b6){utils[_0xe582('0x21')](util[_0xe582('0x2')]('[%s][recordings][queuecallerjoin]',_0x51b14d[_0xe582('0x3')]),_0x5e91b6);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ca53770..5d8310b 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 _0x7726=['secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','format','type','attended','origtransfereruniqueid','uniqueid','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum'];(function(_0x3893bd,_0xff0325){var _0x53209b=function(_0x492719){while(--_0x492719){_0x3893bd['push'](_0x3893bd['shift']());}};_0x53209b(++_0xff0325);}(_0x7726,0x9a));var _0x6772=function(_0x363cfa,_0x12a78a){_0x363cfa=_0x363cfa-0x0;var _0x1d22d2=_0x7726[_0x363cfa];return _0x1d22d2;};'use strict';var _=require(_0x6772('0x0'));var util=require(_0x6772('0x1'));var utils=require('./utils');function writeDB(_0x4d3503){utils['info'](util[_0x6772('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x4d3503[_0x6772('0x3')]===_0x6772('0x4')?_0x4d3503[_0x6772('0x5')]:_0x4d3503[_0x6772('0x6')],_0x4d3503[_0x6772('0x3')]));utils['request']('CreateVoiceTransferReport',_0x4d3503);}exports[_0x6772('0x7')]={};exports[_0x6772('0x8')]=function(_0x164628){try{utils[_0x6772('0x9')](util[_0x6772('0x2')](_0x6772('0xa'),_0x164628['uniqueid']),_0x164628);utils[_0x6772('0xb')](util[_0x6772('0x2')](_0x6772('0xc'),_0x164628[_0x6772('0x6')],_0x164628[_0x6772('0xd')],_0x164628[_0x6772('0xe')],_0x164628[_0x6772('0xf')],_0x164628['transfereecalleridname']));_0x164628['type']='blind';exports[_0x6772('0x7')][_0x164628[_0x6772('0x10')]]=_0x164628;writeDB(_0x164628);}catch(_0x290eb2){utils[_0x6772('0x11')](util[_0x6772('0x2')](_0x6772('0xa'),_0x164628['uniqueid']),_0x290eb2);}};exports['attendedtransfer']=function(_0x156479){try{utils[_0x6772('0x9')](util[_0x6772('0x2')]('[%s][transfers][attendedtransfer]',_0x156479[_0x6772('0x5')]),_0x156479);utils[_0x6772('0xb')](util[_0x6772('0x2')](_0x6772('0x12'),_0x156479[_0x6772('0x5')],_0x156479[_0x6772('0x13')],_0x156479['origtransferercalleridname'],_0x156479[_0x6772('0x14')],_0x156479[_0x6772('0x15')]));_0x156479=_[_0x6772('0x16')](_0x156479,{'transfererchannel':_0x156479[_0x6772('0x17')],'transferercalleridnum':_0x156479['origtransferercalleridnum'],'transferercalleridname':_0x156479[_0x6772('0x18')],'transfererconnectedlinenum':_0x156479[_0x6772('0x19')],'transfererconnectedlinename':_0x156479['secondtransfererconnectedlinename'],'transfereraccountcode':_0x156479['origtransfereraccountcode'],'transferercontext':_0x156479['secondtransferercontext'],'transfererexten':_0x156479[_0x6772('0x1a')],'transfererlinkedid':_0x156479[_0x6772('0x1b')],'context':_0x156479['origtransferercontext'],'extension':_0x156479[_0x6772('0x1c')],'type':_0x6772('0x4')});if(_['isNil'](_0x156479[_0x6772('0x1d')])){_0x156479=_[_0x6772('0x16')](_0x156479,{'transfereechannel':_0x156479[_0x6772('0x1e')],'transfereecalleridnum':_0x156479['transfertargetcalleridnum'],'transfereecalleridname':_0x156479[_0x6772('0x15')],'transfereeconnectedlinenum':_0x156479[_0x6772('0x1f')],'transfereeconnectedlinename':_0x156479[_0x6772('0x20')],'transfereeaccountcode':_0x156479[_0x6772('0x21')],'transfereecontext':_0x156479[_0x6772('0x22')],'transfereeexten':_0x156479[_0x6772('0x23')],'transfereelinkedid':_0x156479['transfertargetlinkedid']});}writeDB(_0x156479);}catch(_0x554f15){utils[_0x6772('0x11')](util[_0x6772('0x2')]('[%s][transfers][attendedtransfer]',_0x156479[_0x6772('0x5')]),_0x554f15);}}; \ No newline at end of file +var _0xb903=['origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','uniqueid','transferercalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename'];(function(_0x1c25b1,_0x2501e1){var _0x10fa15=function(_0x56395f){while(--_0x56395f){_0x1c25b1['push'](_0x1c25b1['shift']());}};_0x10fa15(++_0x2501e1);}(_0xb903,0x87));var _0x3b90=function(_0x3b6fad,_0x382fcf){_0x3b6fad=_0x3b6fad-0x0;var _0x3db98d=_0xb903[_0x3b6fad];return _0x3db98d;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var utils=require(_0x3b90('0x2'));function writeDB(_0x525f66){utils[_0x3b90('0x3')](util[_0x3b90('0x4')](_0x3b90('0x5'),_0x525f66[_0x3b90('0x6')]===_0x3b90('0x7')?_0x525f66[_0x3b90('0x8')]:_0x525f66['uniqueid'],_0x525f66[_0x3b90('0x6')]));utils['request'](_0x3b90('0x9'),_0x525f66);}exports[_0x3b90('0xa')]={};exports[_0x3b90('0xb')]=function(_0x3c73e6){try{utils['debug'](util[_0x3b90('0x4')]('[%s][transfers][blindtransfer]',_0x3c73e6[_0x3b90('0xc')]),_0x3c73e6);utils[_0x3b90('0x3')](util[_0x3b90('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3c73e6[_0x3b90('0xc')],_0x3c73e6[_0x3b90('0xd')],_0x3c73e6['transferercalleridname'],_0x3c73e6['transfereecalleridnum'],_0x3c73e6[_0x3b90('0xe')]));_0x3c73e6[_0x3b90('0x6')]=_0x3b90('0xf');exports[_0x3b90('0xa')][_0x3c73e6[_0x3b90('0x10')]]=_0x3c73e6;writeDB(_0x3c73e6);}catch(_0x732df5){utils['error'](util[_0x3b90('0x4')](_0x3b90('0x11'),_0x3c73e6['uniqueid']),_0x732df5);}};exports['attendedtransfer']=function(_0x1711d7){try{utils[_0x3b90('0x12')](util[_0x3b90('0x4')](_0x3b90('0x13'),_0x1711d7[_0x3b90('0x8')]),_0x1711d7);utils[_0x3b90('0x3')](util['format'](_0x3b90('0x14'),_0x1711d7['origtransfereruniqueid'],_0x1711d7[_0x3b90('0x15')],_0x1711d7[_0x3b90('0x16')],_0x1711d7[_0x3b90('0x17')],_0x1711d7[_0x3b90('0x18')]));_0x1711d7=_[_0x3b90('0x19')](_0x1711d7,{'transfererchannel':_0x1711d7[_0x3b90('0x1a')],'transferercalleridnum':_0x1711d7[_0x3b90('0x15')],'transferercalleridname':_0x1711d7[_0x3b90('0x16')],'transfererconnectedlinenum':_0x1711d7[_0x3b90('0x1b')],'transfererconnectedlinename':_0x1711d7[_0x3b90('0x1c')],'transfereraccountcode':_0x1711d7[_0x3b90('0x1d')],'transferercontext':_0x1711d7[_0x3b90('0x1e')],'transfererexten':_0x1711d7[_0x3b90('0x1f')],'transfererlinkedid':_0x1711d7[_0x3b90('0x20')],'context':_0x1711d7['origtransferercontext'],'extension':_0x1711d7['origtransfererexten'],'type':_0x3b90('0x7')});if(_[_0x3b90('0x21')](_0x1711d7[_0x3b90('0x22')])){_0x1711d7=_['assign'](_0x1711d7,{'transfereechannel':_0x1711d7['transfertargetchannel'],'transfereecalleridnum':_0x1711d7[_0x3b90('0x17')],'transfereecalleridname':_0x1711d7[_0x3b90('0x18')],'transfereeconnectedlinenum':_0x1711d7[_0x3b90('0x23')],'transfereeconnectedlinename':_0x1711d7['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1711d7[_0x3b90('0x24')],'transfereecontext':_0x1711d7[_0x3b90('0x25')],'transfereeexten':_0x1711d7[_0x3b90('0x26')],'transfereelinkedid':_0x1711d7[_0x3b90('0x27')]});}writeDB(_0x1711d7);}catch(_0x32d9e6){utils[_0x3b90('0x28')](util[_0x3b90('0x4')]('[%s][transfers][attendedtransfer]',_0x1711d7[_0x3b90('0x8')]),_0x32d9e6);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index d1e74b4..d94a38c 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 _0xf440=['[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','result','getUserByInternal','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName'];(function(_0x4c34e2,_0x444ecd){var _0x51a743=function(_0x2c42b4){while(--_0x2c42b4){_0x4c34e2['push'](_0x4c34e2['shift']());}};_0x51a743(++_0x444ecd);}(_0xf440,0x1ea));var _0x0f44=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xf440[_0x465a0c];return _0x1e202e;};'use strict';var BPromise=require(_0x0f44('0x0'));var jayson=require(_0x0f44('0x1'));var moment=require('moment');var util=require(_0x0f44('0x2'));var client=jayson[_0x0f44('0x3')][_0x0f44('0x4')]({'port':0x2329});var logger=require(_0x0f44('0x5'))(_0x0f44('0x6'));exports['info']=function(_0x1090d7,_0x36d132){logger[_0x0f44('0x7')](_0x1090d7,_0x36d132?util[_0x0f44('0x8')](_0x36d132,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x23036f,_0x25f828){logger['debug'](_0x23036f,_0x25f828?util['inspect'](_0x25f828,{'showHidden':![],'depth':null}):'');};exports[_0x0f44('0x9')]=function(_0x570a07,_0x38e4ee){logger['error'](_0x570a07,_0x38e4ee?util[_0x0f44('0x8')](_0x38e4ee,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4180c6,_0x132bfb){return client[_0x0f44('0xa')](_0x4180c6,{'body':_0x132bfb})[_0x0f44('0xb')](function(_0x5078ba){logger[_0x0f44('0xc')](_0x0f44('0xd'),_0x4180c6,_0x5078ba?util[_0x0f44('0x8')](_0x5078ba,{'showHidden':![],'depth':null}):'');})[_0x0f44('0xe')](function(_0x10c09d){logger['error'](_0x0f44('0xd'),_0x4180c6,_0x10c09d?util[_0x0f44('0x8')](_0x10c09d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x10e71b){return client[_0x0f44('0xa')](_0x0f44('0xf'),{'options':{'raw':!![],'attributes':['id',_0x0f44('0x10'),_0x0f44('0x11'),'interface'],'where':_0x10e71b,'limit':0x1}})[_0x0f44('0xb')](function(_0x49c9b2){logger[_0x0f44('0xc')](_0x0f44('0x12'),JSON['stringify'](_0x10e71b),_0x49c9b2?util[_0x0f44('0x8')](_0x49c9b2,{'showHidden':![],'depth':null}):'');return _0x49c9b2[_0x0f44('0x13')]['length']?_0x49c9b2[_0x0f44('0x13')][0x0]:null;});}exports[_0x0f44('0x14')]=function(_0x4fd839){return new BPromise(function(_0x59d211,_0x231f7a){if(_0x4fd839){return getUser({'internal':_0x4fd839})['then'](function(_0x4f38f7){logger[_0x0f44('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4fd839,_0x4f38f7?_0x0f44('0x15'):_0x0f44('0x16'));return _0x59d211(_0x4f38f7);})['catch'](function(_0x71c43e){logger['error']('[utils][getUserByInternal]',_0x71c43e?util[_0x0f44('0x8')](_0x71c43e,{'showHidden':![],'depth':null}):'');return _0x59d211(null);});}return _0x59d211(null);});};exports[_0x0f44('0x17')]=function(_0x32c43e){return new BPromise(function(_0x46f192,_0x13a8c2){if(_0x32c43e){return getUser({'interface':_0x32c43e})[_0x0f44('0xb')](function(_0x2c22df){logger['info'](_0x0f44('0x18'),_0x32c43e,_0x2c22df?'found':_0x0f44('0x16'));return _0x46f192(_0x2c22df);})['catch'](function(_0x3f9baa){logger[_0x0f44('0x9')](_0x0f44('0x19'),_0x3f9baa?util['inspect'](_0x3f9baa,{'showHidden':![],'depth':null}):'');return _0x46f192(null);});}return _0x46f192(null);});};exports[_0x0f44('0x1a')]=function(_0x326231){return new BPromise(function(_0x2da3ea,_0x1d30b2){if(_0x326231){return getUser({'name':_0x326231})[_0x0f44('0xb')](function(_0x5ab1a8){logger[_0x0f44('0x7')](_0x0f44('0x1b'),_0x326231,_0x5ab1a8?_0x0f44('0x15'):'notfound');return _0x2da3ea(_0x5ab1a8);})[_0x0f44('0xe')](function(_0x46fc43){logger['error']('[utils][getUserByName]',_0x46fc43?util[_0x0f44('0x8')](_0x46fc43,{'showHidden':![],'depth':null}):'');return _0x2da3ea(null);});}return _0x2da3ea(null);});};exports[_0x0f44('0x1c')]=function(_0x2aa295){return new BPromise(function(_0x378126,_0x2aa80d){if(_0x2aa295){return client[_0x0f44('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x0f44('0x11'),_0x0f44('0x1d'),_0x0f44('0x1e'),_0x0f44('0x1f')],'where':{'name':_0x2aa295},'limit':0x1}})['then'](function(_0x4e9f10){logger[_0x0f44('0xc')](_0x0f44('0x20'),_0x2aa295,_0x4e9f10?util[_0x0f44('0x8')](_0x4e9f10,{'showHidden':![],'depth':null}):'');logger[_0x0f44('0x7')](_0x0f44('0x21'),_0x2aa295,_0x4e9f10?_0x0f44('0x15'):_0x0f44('0x16'));return _0x378126(_0x4e9f10[_0x0f44('0x13')][_0x0f44('0x22')]?_0x4e9f10[_0x0f44('0x13')][0x0]:null);})['catch'](function(_0x4fbc58){logger[_0x0f44('0x9')](_0x0f44('0x23'),_0x4fbc58?util[_0x0f44('0x8')](_0x4fbc58,{'showHidden':![],'depth':null}):'');return _0x378126(null);});}return _0x378126(null);});};exports[_0x0f44('0x24')]=function(_0x1fef6f,_0x3e50e7){return moment(_0x1fef6f)[_0x0f44('0x25')](_0x3e50e7,_0x0f44('0x26'))[_0x0f44('0x27')](_0x0f44('0x28'));};exports[_0x0f44('0x29')]=function(_0x276da0,_0xd3de49){return moment(_0x276da0)[_0x0f44('0x2a')](_0xd3de49,_0x0f44('0x26'))[_0x0f44('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x3a5a7a,_0x5e2592){return moment(_0x3a5a7a)['diff'](moment(_0x5e2592),_0x0f44('0x26'));};exports[_0x0f44('0x2b')]=function(_0x26ed3c,_0x27eef6){return parseInt(_0x26ed3c,0xa)+parseInt(_0x27eef6,0xa);};exports[_0x0f44('0x2c')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0f44('0x2d')]=function(_0x1b2c5b,_0x2ad394){if(_0x2ad394){return moment(_0x1b2c5b)['isAfter'](_0x2ad394);}return!![];};exports[_0x0f44('0x2e')]=function(_0xf8f1b8,_0x462987){if(_0x462987){return moment(_0xf8f1b8)['isBefore'](_0x462987);}else if(_0xf8f1b8){return!![];}return![];}; \ No newline at end of file +var _0x9541=['YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','debug','inspect','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]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format'];(function(_0x90f39,_0x17382e){var _0x220c6a=function(_0x588f12){while(--_0x588f12){_0x90f39['push'](_0x90f39['shift']());}};_0x220c6a(++_0x17382e);}(_0x9541,0x8f));var _0x1954=function(_0x242e5a,_0x5ea6ac){_0x242e5a=_0x242e5a-0x0;var _0x5aa904=_0x9541[_0x242e5a];return _0x5aa904;};'use strict';var BPromise=require(_0x1954('0x0'));var jayson=require(_0x1954('0x1'));var moment=require(_0x1954('0x2'));var util=require(_0x1954('0x3'));var client=jayson[_0x1954('0x4')]['http']({'port':0x2329});var logger=require(_0x1954('0x5'))(_0x1954('0x6'));exports[_0x1954('0x7')]=function(_0x2e0c68,_0x3ffc0b){logger[_0x1954('0x7')](_0x2e0c68,_0x3ffc0b?util['inspect'](_0x3ffc0b,{'showHidden':![],'depth':null}):'');};exports[_0x1954('0x8')]=function(_0x5748dd,_0x2f9a94){logger[_0x1954('0x8')](_0x5748dd,_0x2f9a94?util[_0x1954('0x9')](_0x2f9a94,{'showHidden':![],'depth':null}):'');};exports[_0x1954('0xa')]=function(_0x5774e0,_0x110e51){logger['error'](_0x5774e0,_0x110e51?util[_0x1954('0x9')](_0x110e51,{'showHidden':![],'depth':null}):'');};exports[_0x1954('0xb')]=function(_0x4b53ab,_0x3403d6){return client[_0x1954('0xb')](_0x4b53ab,{'body':_0x3403d6})[_0x1954('0xc')](function(_0x5aa9a0){logger[_0x1954('0x8')](_0x1954('0xd'),_0x4b53ab,_0x5aa9a0?util[_0x1954('0x9')](_0x5aa9a0,{'showHidden':![],'depth':null}):'');})[_0x1954('0xe')](function(_0x26c5ce){logger[_0x1954('0xa')](_0x1954('0xd'),_0x4b53ab,_0x26c5ce?util[_0x1954('0x9')](_0x26c5ce,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5db69b){return client[_0x1954('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x1954('0xf'),_0x1954('0x10'),_0x1954('0x11')],'where':_0x5db69b,'limit':0x1}})['then'](function(_0x2e04e7){logger['debug'](_0x1954('0x12'),JSON[_0x1954('0x13')](_0x5db69b),_0x2e04e7?util[_0x1954('0x9')](_0x2e04e7,{'showHidden':![],'depth':null}):'');return _0x2e04e7[_0x1954('0x14')][_0x1954('0x15')]?_0x2e04e7['result'][0x0]:null;});}exports[_0x1954('0x16')]=function(_0x2b6cc0){return new BPromise(function(_0x264c20,_0x3f125a){if(_0x2b6cc0){return getUser({'internal':_0x2b6cc0})[_0x1954('0xc')](function(_0x1eb55e){logger[_0x1954('0x7')](_0x1954('0x17'),_0x2b6cc0,_0x1eb55e?_0x1954('0x18'):_0x1954('0x19'));return _0x264c20(_0x1eb55e);})[_0x1954('0xe')](function(_0x10e8fe){logger[_0x1954('0xa')](_0x1954('0x1a'),_0x10e8fe?util[_0x1954('0x9')](_0x10e8fe,{'showHidden':![],'depth':null}):'');return _0x264c20(null);});}return _0x264c20(null);});};exports['getUserByInterface']=function(_0x1a4606){return new BPromise(function(_0x5a8c4e,_0x5c0e80){if(_0x1a4606){return getUser({'interface':_0x1a4606})['then'](function(_0x3dd702){logger[_0x1954('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x1a4606,_0x3dd702?_0x1954('0x18'):_0x1954('0x19'));return _0x5a8c4e(_0x3dd702);})[_0x1954('0xe')](function(_0x4c2361){logger[_0x1954('0xa')](_0x1954('0x1b'),_0x4c2361?util['inspect'](_0x4c2361,{'showHidden':![],'depth':null}):'');return _0x5a8c4e(null);});}return _0x5a8c4e(null);});};exports[_0x1954('0x1c')]=function(_0x9da53e){return new BPromise(function(_0xe51075,_0x2bdbd0){if(_0x9da53e){return getUser({'name':_0x9da53e})[_0x1954('0xc')](function(_0x11cb8a){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x9da53e,_0x11cb8a?_0x1954('0x18'):_0x1954('0x19'));return _0xe51075(_0x11cb8a);})[_0x1954('0xe')](function(_0x4ecdd1){logger[_0x1954('0xa')](_0x1954('0x1d'),_0x4ecdd1?util[_0x1954('0x9')](_0x4ecdd1,{'showHidden':![],'depth':null}):'');return _0xe51075(null);});}return _0xe51075(null);});};exports['getVoiceQueueByName']=function(_0x5a2566){return new BPromise(function(_0x70a102,_0x486fc7){if(_0x5a2566){return client[_0x1954('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x1954('0x10'),'type',_0x1954('0x1e'),'acwTimeout'],'where':{'name':_0x5a2566},'limit':0x1}})[_0x1954('0xc')](function(_0xe98fe0){logger[_0x1954('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x5a2566,_0xe98fe0?util['inspect'](_0xe98fe0,{'showHidden':![],'depth':null}):'');logger[_0x1954('0x7')](_0x1954('0x1f'),_0x5a2566,_0xe98fe0?_0x1954('0x18'):'notfound');return _0x70a102(_0xe98fe0['result'][_0x1954('0x15')]?_0xe98fe0[_0x1954('0x14')][0x0]:null);})[_0x1954('0xe')](function(_0x341e5b){logger[_0x1954('0xa')](_0x1954('0x20'),_0x341e5b?util[_0x1954('0x9')](_0x341e5b,{'showHidden':![],'depth':null}):'');return _0x70a102(null);});}return _0x70a102(null);});};exports[_0x1954('0x21')]=function(_0x17a357,_0xab22af){return moment(_0x17a357)[_0x1954('0x22')](_0xab22af,_0x1954('0x23'))[_0x1954('0x24')](_0x1954('0x25'));};exports[_0x1954('0x26')]=function(_0x571cdc,_0xf037d7){return moment(_0x571cdc)[_0x1954('0x27')](_0xf037d7,_0x1954('0x23'))['format'](_0x1954('0x25'));};exports['diffTime']=function(_0x3b7036,_0x3e0fb8){return moment(_0x3b7036)[_0x1954('0x28')](moment(_0x3e0fb8),'seconds');};exports[_0x1954('0x29')]=function(_0x27a233,_0x138d66){return parseInt(_0x27a233,0xa)+parseInt(_0x138d66,0xa);};exports[_0x1954('0x2a')]=function(){return moment()[_0x1954('0x24')](_0x1954('0x25'));};exports[_0x1954('0x2b')]=function(_0x5aaffe,_0x5457c1){if(_0x5457c1){return moment(_0x5aaffe)[_0x1954('0x2b')](_0x5457c1);}return!![];};exports[_0x1954('0x2c')]=function(_0x55ed5d,_0xe2f9f6){if(_0xe2f9f6){return moment(_0x55ed5d)['isBefore'](_0xe2f9f6);}else if(_0x55ed5d){return!![];}return![];}; \ No newline at end of file -- 1.7.1